@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.mjs
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import React6, { createContext, useContext, useMemo, useState, useRef, useEffect, useCallback, useLayoutEffect, useSyncExternalStore, useId, useImperativeHandle } from 'react';
|
|
1
|
+
import React6, { createContext, lazy, useContext, useMemo, useState, useRef, useEffect, useCallback, useLayoutEffect, useSyncExternalStore, Suspense, useId, useImperativeHandle } from 'react';
|
|
2
2
|
import { ThemedLayoutV2, Show, List, useForm, DeleteButton, useTable, RefineThemes, Breadcrumb as Breadcrumb$1, Create, useSelect, Edit, ListButton, EditButton, RefreshButton } from '@refinedev/antd';
|
|
3
3
|
import { useMenu, useGo, useGetIdentity, useLogout, useOne, useApiUrl, useInvalidate, useCan, useCustom, useLogin, useWarnAboutChange } from '@refinedev/core';
|
|
4
|
-
import { Typography, Menu, theme, Layout, Space, AutoComplete, Input, Spin, Grid, Form, Drawer, Modal, Button, Tooltip, Skeleton, message, Switch, Divider, Tabs, Alert, Card, Table, Select, DatePicker, InputNumber, Checkbox, Pagination, Collapse, Breadcrumb, Tree, ConfigProvider, Empty, Tag, List as List$1, Popover, Dropdown, Avatar, TimePicker, Upload } from 'antd';
|
|
5
|
-
import { SearchOutlined, LockOutlined, LogoutOutlined, InfoCircleOutlined, SaveOutlined, UnorderedListOutlined, DownloadOutlined, SettingOutlined, PlusOutlined, LinkOutlined, ShareAltOutlined, BarChartOutlined, ColumnHeightOutlined, SwapOutlined, FilterOutlined, ArrowUpOutlined, ArrowDownOutlined, DeleteOutlined, ArrowLeftOutlined, ArrowRightOutlined, FileTextOutlined, BugOutlined, EyeOutlined, EditOutlined, FilePdfOutlined, CloseCircleOutlined, DownOutlined, UserOutlined, ReloadOutlined, ClockCircleOutlined, PushpinFilled, PushpinOutlined, DashboardOutlined, CheckCircleOutlined, CopyOutlined, ApartmentOutlined, SaveFilled, CalendarOutlined, MenuOutlined, MenuUnfoldOutlined, MenuFoldOutlined, LayoutOutlined, AppstoreOutlined, CommentOutlined, MinusSquareOutlined, FullscreenOutlined, CloseOutlined, DatabaseOutlined, ShopOutlined, BookOutlined, UploadOutlined, FolderOutlined, FileOutlined, RightOutlined } from '@ant-design/icons';
|
|
4
|
+
import { Typography, Menu, theme, Layout, Space, AutoComplete, Input, Spin, Grid, Form, Drawer, Modal, Button, Tooltip, Skeleton, message, Switch, Divider, Tabs, Alert, Card, Table, Select, DatePicker, InputNumber, Checkbox, Pagination, Collapse, Breadcrumb, Tree, ConfigProvider, Empty, Tag, List as List$1, Popover, Dropdown, Avatar, TimePicker, Upload, Rate, Progress } from 'antd';
|
|
5
|
+
import { SearchOutlined, LockOutlined, LogoutOutlined, InfoCircleOutlined, SaveOutlined, UnorderedListOutlined, DownloadOutlined, SettingOutlined, PlusOutlined, LinkOutlined, ShareAltOutlined, BarChartOutlined, ColumnHeightOutlined, SwapOutlined, FilterOutlined, ArrowUpOutlined, ArrowDownOutlined, DeleteOutlined, ArrowLeftOutlined, ArrowRightOutlined, FileTextOutlined, BugOutlined, EyeOutlined, EditOutlined, FilePdfOutlined, CloseCircleOutlined, DownOutlined, UserOutlined, ReloadOutlined, ClockCircleOutlined, PushpinFilled, PushpinOutlined, DashboardOutlined, CheckCircleOutlined, CopyOutlined, ApartmentOutlined, SaveFilled, CalendarOutlined, MenuOutlined, MenuUnfoldOutlined, MenuFoldOutlined, LayoutOutlined, AppstoreOutlined, CommentOutlined, MinusSquareOutlined, FullscreenOutlined, CloseOutlined, DatabaseOutlined, ShopOutlined, BookOutlined, CheckOutlined, UploadOutlined, FolderOutlined, FileOutlined, RightOutlined } from '@ant-design/icons';
|
|
6
6
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
7
7
|
import { useNavigate, useParams, useSearchParams, useLocation, Link, UNSAFE_RouteContext } from 'react-router-dom';
|
|
8
8
|
import { createPortal } from 'react-dom';
|
|
9
|
-
import
|
|
9
|
+
import dayjs8 from 'dayjs';
|
|
10
|
+
import relativeTime from 'dayjs/plugin/relativeTime';
|
|
10
11
|
import axios from 'axios';
|
|
11
12
|
|
|
12
13
|
var __typeError = (msg) => {
|
|
@@ -858,7 +859,7 @@ var LayoutWrapper = ({
|
|
|
858
859
|
label: "Confirm Password",
|
|
859
860
|
dependencies: ["new_password"],
|
|
860
861
|
rules: [{ required: true }, ({ getFieldValue }) => ({
|
|
861
|
-
validator(
|
|
862
|
+
validator(_41, value) {
|
|
862
863
|
if (!value || getFieldValue("new_password") === value) return Promise.resolve();
|
|
863
864
|
return Promise.reject(new Error("Passwords do not match"));
|
|
864
865
|
}
|
|
@@ -2598,19 +2599,19 @@ function Ut({
|
|
|
2598
2599
|
const { defaultLayoutDeferred: Y, derivedPanelConstraints: Ee, layout: ce } = j.next;
|
|
2599
2600
|
if (Y || Ee.length === 0)
|
|
2600
2601
|
return;
|
|
2601
|
-
const ut = R.panels.map(({ id:
|
|
2602
|
-
R.mutableState.layouts[ut] = ce, Ee.forEach((
|
|
2603
|
-
if (
|
|
2602
|
+
const ut = R.panels.map(({ id: _41 }) => _41).join(",");
|
|
2603
|
+
R.mutableState.layouts[ut] = ce, Ee.forEach((_41) => {
|
|
2604
|
+
if (_41.collapsible) {
|
|
2604
2605
|
const { layout: ge } = j.prev ?? {};
|
|
2605
2606
|
if (ge) {
|
|
2606
2607
|
const ft = I(
|
|
2607
|
-
|
|
2608
|
-
ce[
|
|
2608
|
+
_41.collapsedSize,
|
|
2609
|
+
ce[_41.panelId]
|
|
2609
2610
|
), dt = I(
|
|
2610
|
-
|
|
2611
|
-
ge[
|
|
2611
|
+
_41.collapsedSize,
|
|
2612
|
+
ge[_41.panelId]
|
|
2612
2613
|
);
|
|
2613
|
-
ft && !dt && (R.mutableState.expandedPanelSizes[
|
|
2614
|
+
ft && !dt && (R.mutableState.expandedPanelSizes[_41.panelId] = ge[_41.panelId]);
|
|
2614
2615
|
}
|
|
2615
2616
|
}
|
|
2616
2617
|
});
|
|
@@ -3279,7 +3280,7 @@ var getRelationLabel = (rel) => {
|
|
|
3279
3280
|
const translatedBaseKey = translateRelationKey(baseKey);
|
|
3280
3281
|
if (translatedBaseKey && translatedBaseKey !== baseKey) return translatedBaseKey;
|
|
3281
3282
|
}
|
|
3282
|
-
return asDisplayText(
|
|
3283
|
+
return asDisplayText(rel.label, asDisplayText(relationKey, "")) || relationKey;
|
|
3283
3284
|
};
|
|
3284
3285
|
var getModelLabel = (model) => {
|
|
3285
3286
|
const primary = asDisplayText(model.label, "");
|
|
@@ -3371,8 +3372,8 @@ var useViewSettings = () => {
|
|
|
3371
3372
|
}
|
|
3372
3373
|
const data = await response.json();
|
|
3373
3374
|
if (cancelled) return;
|
|
3374
|
-
const modulesColorSchema = String(data?.modulesColorSchema || "color
|
|
3375
|
-
const modelsColorSchema = String(data?.modelsColorSchema || "color
|
|
3375
|
+
const modulesColorSchema = String(data?.modulesColorSchema || "plain-color");
|
|
3376
|
+
const modelsColorSchema = String(data?.modelsColorSchema || "plain-color");
|
|
3376
3377
|
const plainColorBaseHex = String(data?.plainColorBaseHex || "");
|
|
3377
3378
|
setColorSchemas({ modulesColorSchema, modelsColorSchema, plainColorBaseHex });
|
|
3378
3379
|
setSettings({
|
|
@@ -3574,7 +3575,10 @@ var getConfigVid = (item, mode) => {
|
|
|
3574
3575
|
};
|
|
3575
3576
|
var isAttributeValueEditable = (item, mode) => {
|
|
3576
3577
|
if (!item) return true;
|
|
3577
|
-
const
|
|
3578
|
+
const raw = String(getConfigVid(item, mode) || "").trim();
|
|
3579
|
+
const fieldToken = normalizeFieldViewType(raw);
|
|
3580
|
+
if (fieldToken) return fieldToken.startsWith("editable-");
|
|
3581
|
+
const vid = raw.toLowerCase().replace(/[\s_-]/g, "");
|
|
3578
3582
|
if (vid === "readonly") return false;
|
|
3579
3583
|
return true;
|
|
3580
3584
|
};
|
|
@@ -3585,6 +3589,9 @@ var normalizeRelationViewType = (rawVid) => {
|
|
|
3585
3589
|
if (normalized === "editablelist") return "editable-list";
|
|
3586
3590
|
if (normalized === "list") return "list";
|
|
3587
3591
|
if (normalized === "csv") return "csv";
|
|
3592
|
+
if (normalized === "readandeditlist") return "read-and-edit-list";
|
|
3593
|
+
if (normalized === "readandeditcsv") return "read-and-edit-csv";
|
|
3594
|
+
if (normalized === "editablecsv") return "editable-csv";
|
|
3588
3595
|
if (normalized === "gallery" || normalized === "image") return "gallery";
|
|
3589
3596
|
if (normalized === "calendar" || normalized === "week" || normalized === "month") return "calendar";
|
|
3590
3597
|
if (normalized === "primary") return "primary";
|
|
@@ -3593,6 +3600,47 @@ var normalizeRelationViewType = (rawVid) => {
|
|
|
3593
3600
|
if (normalized === "treedetails") return "tree-details";
|
|
3594
3601
|
return "";
|
|
3595
3602
|
};
|
|
3603
|
+
var FIELD_VIEW_TYPE_TOKENS = /* @__PURE__ */ new Set([
|
|
3604
|
+
"read-only-field",
|
|
3605
|
+
"editable-field",
|
|
3606
|
+
"read-only-password",
|
|
3607
|
+
"editable-password",
|
|
3608
|
+
"read-only-textarea",
|
|
3609
|
+
"editable-textarea",
|
|
3610
|
+
"read-only-markdown",
|
|
3611
|
+
"editable-markdown",
|
|
3612
|
+
"read-only-json",
|
|
3613
|
+
"editable-json",
|
|
3614
|
+
"read-only-url",
|
|
3615
|
+
"editable-url",
|
|
3616
|
+
"read-only-email",
|
|
3617
|
+
"editable-email",
|
|
3618
|
+
"read-only-currency",
|
|
3619
|
+
"editable-currency",
|
|
3620
|
+
"read-only-percentage",
|
|
3621
|
+
"editable-percentage",
|
|
3622
|
+
"read-only-progress",
|
|
3623
|
+
"editable-progress",
|
|
3624
|
+
"read-only-rating",
|
|
3625
|
+
"editable-rating",
|
|
3626
|
+
"read-only-duration",
|
|
3627
|
+
"editable-duration",
|
|
3628
|
+
"read-only-phone",
|
|
3629
|
+
"editable-phone",
|
|
3630
|
+
"read-only-color",
|
|
3631
|
+
"editable-color",
|
|
3632
|
+
"read-only-code",
|
|
3633
|
+
"editable-code",
|
|
3634
|
+
"read-only-image-url",
|
|
3635
|
+
"editable-image-url",
|
|
3636
|
+
"read-only-qrcode",
|
|
3637
|
+
"read-only-relative",
|
|
3638
|
+
"read-only-truncated-text"
|
|
3639
|
+
]);
|
|
3640
|
+
var normalizeFieldViewType = (raw) => {
|
|
3641
|
+
const normalized = String(raw || "").trim().toLowerCase().replace(/[\s_]/g, "-").replace(/-+/g, "-");
|
|
3642
|
+
return FIELD_VIEW_TYPE_TOKENS.has(normalized) ? normalized : "";
|
|
3643
|
+
};
|
|
3596
3644
|
var applyRelationViewOverride = (rel, item, mode) => {
|
|
3597
3645
|
const rawVid = getConfigVid(item, mode);
|
|
3598
3646
|
const vid = normalizeRelationViewType(rawVid);
|
|
@@ -3989,7 +4037,7 @@ var parseInlineStyle = (styleText) => {
|
|
|
3989
4037
|
return styleText.split(";").map((chunk) => chunk.trim()).filter(Boolean).reduce((acc, rule) => {
|
|
3990
4038
|
const [rawKey, rawValue] = rule.split(":").map((part) => part.trim());
|
|
3991
4039
|
if (!rawKey || !rawValue) return acc;
|
|
3992
|
-
const camelKey = rawKey.replace(/-([a-z])/g, (
|
|
4040
|
+
const camelKey = rawKey.replace(/-([a-z])/g, (_41, char) => char.toUpperCase());
|
|
3993
4041
|
acc[camelKey] = rawValue;
|
|
3994
4042
|
return acc;
|
|
3995
4043
|
}, {});
|
|
@@ -5820,7 +5868,7 @@ body, table, th, td, input, button, select, textarea, div, span, p, li, ul, ol {
|
|
|
5820
5868
|
|
|
5821
5869
|
// src/components/DynamicResource/relations/helpers.ts
|
|
5822
5870
|
var _9 = window._ || ((text) => text);
|
|
5823
|
-
var INLINE_RELATION_VIEW_TYPES = /* @__PURE__ */ new Set(["list", "csv"]);
|
|
5871
|
+
var INLINE_RELATION_VIEW_TYPES = /* @__PURE__ */ new Set(["list", "csv", "read-and-edit-list", "read-and-edit-csv", "editable-csv"]);
|
|
5824
5872
|
var TABLE_RELATION_VIEW_TYPES = /* @__PURE__ */ new Set(["table", "totals-details"]);
|
|
5825
5873
|
var isInlineRelationViewType = (viewType) => INLINE_RELATION_VIEW_TYPES.has(viewType);
|
|
5826
5874
|
var usesTableRelationBehavior = (viewType) => TABLE_RELATION_VIEW_TYPES.has(viewType);
|
|
@@ -5835,10 +5883,10 @@ var getRelationViewType = (rel, mode, defaults) => {
|
|
|
5835
5883
|
const showFallback = defaults?.show || "totals-details";
|
|
5836
5884
|
const editFallback = defaults?.edit || "editable-table";
|
|
5837
5885
|
if (mode === "show") {
|
|
5838
|
-
if (rel.
|
|
5886
|
+
if (rel.showViewType) return rel.showViewType;
|
|
5839
5887
|
return showFallback;
|
|
5840
5888
|
}
|
|
5841
|
-
if (rel.
|
|
5889
|
+
if (rel.editViewType) return rel.editViewType;
|
|
5842
5890
|
return editFallback;
|
|
5843
5891
|
};
|
|
5844
5892
|
var getRelationTabName = (rel, mode, fallback) => {
|
|
@@ -6381,17 +6429,49 @@ var fetchPolymorphicGroups = async ({
|
|
|
6381
6429
|
});
|
|
6382
6430
|
return { groups, unresolved, labelsById };
|
|
6383
6431
|
};
|
|
6432
|
+
|
|
6433
|
+
// src/components/DynamicResource/utils/navigation.ts
|
|
6434
|
+
var getShowHref = (resource, id, allModels) => {
|
|
6435
|
+
const resourcePath = resolveResourcePath(resource, allModels);
|
|
6436
|
+
return `/${resourcePath}/show/${id}`;
|
|
6437
|
+
};
|
|
6438
|
+
var shouldHandleLinkClick = (event) => {
|
|
6439
|
+
if (event.defaultPrevented) return false;
|
|
6440
|
+
if (event.button !== 0) return false;
|
|
6441
|
+
if (event.metaKey || event.ctrlKey || event.shiftKey || event.altKey) return false;
|
|
6442
|
+
return true;
|
|
6443
|
+
};
|
|
6384
6444
|
var ReferenceField = ({ id, resource, onLabel }) => {
|
|
6385
6445
|
const { data, isLoading } = useOne({ resource, id, queryOptions: { enabled: !!id } });
|
|
6386
6446
|
const record = data?.data;
|
|
6387
6447
|
const label = record?._label || record?.name || record?.description || id;
|
|
6448
|
+
const go = useGo();
|
|
6449
|
+
const paneNav = usePaneNavigation();
|
|
6450
|
+
const { token } = theme.useToken();
|
|
6388
6451
|
useEffect(() => {
|
|
6389
6452
|
if (onLabel && !isLoading && label !== void 0 && label !== null) {
|
|
6390
6453
|
onLabel(String(label));
|
|
6391
6454
|
}
|
|
6392
6455
|
}, [label, onLabel, isLoading]);
|
|
6393
6456
|
if (isLoading) return /* @__PURE__ */ jsx(Skeleton.Input, { active: true, size: "small", style: { width: 100 } });
|
|
6394
|
-
|
|
6457
|
+
const href = getShowHref(resource, id);
|
|
6458
|
+
return /* @__PURE__ */ jsx(
|
|
6459
|
+
"a",
|
|
6460
|
+
{
|
|
6461
|
+
href,
|
|
6462
|
+
onClick: (e) => {
|
|
6463
|
+
if (!shouldHandleLinkClick(e)) return;
|
|
6464
|
+
e.preventDefault();
|
|
6465
|
+
if (paneNav?.isInMultiPane) {
|
|
6466
|
+
paneNav.openDetail(resource, id);
|
|
6467
|
+
} else {
|
|
6468
|
+
go({ to: { resource, action: "show", id } });
|
|
6469
|
+
}
|
|
6470
|
+
},
|
|
6471
|
+
style: { color: token.colorLink, textDecoration: "none", cursor: "pointer" },
|
|
6472
|
+
children: label
|
|
6473
|
+
}
|
|
6474
|
+
);
|
|
6395
6475
|
};
|
|
6396
6476
|
var RelatedObjectPreview = ({ resource, id, model, allModels, fallbackLabel }) => {
|
|
6397
6477
|
const { data, isLoading } = useOne({ resource, id, queryOptions: { enabled: !!id } });
|
|
@@ -6964,8 +7044,150 @@ var renderOptionTag = (field, rawValue) => {
|
|
|
6964
7044
|
const color = colorMap[String(rawValue)] || getFallbackColor(label);
|
|
6965
7045
|
return /* @__PURE__ */ jsx(Tag, { color, style: { marginInlineEnd: 0, borderRadius: 8, fontWeight: 500 }, children: label });
|
|
6966
7046
|
};
|
|
7047
|
+
dayjs8.extend(relativeTime);
|
|
6967
7048
|
var _16 = window._ || ((text) => text);
|
|
6968
|
-
var
|
|
7049
|
+
var ReactMarkdown = lazy(() => import('react-markdown').then((m) => ({ default: m.default })));
|
|
7050
|
+
var QRCodeSVG = lazy(() => import('qrcode.react').then((m) => ({ default: m.QRCodeSVG })));
|
|
7051
|
+
function formatDuration(totalSeconds) {
|
|
7052
|
+
const h = Math.floor(totalSeconds / 3600);
|
|
7053
|
+
const m = Math.floor(totalSeconds % 3600 / 60);
|
|
7054
|
+
const s = totalSeconds % 60;
|
|
7055
|
+
const parts = [];
|
|
7056
|
+
if (h) parts.push(`${h}h`);
|
|
7057
|
+
if (m) parts.push(`${m}m`);
|
|
7058
|
+
if (s || !parts.length) parts.push(`${s}s`);
|
|
7059
|
+
return parts.join(" ");
|
|
7060
|
+
}
|
|
7061
|
+
var TALL_VIEW_TYPE_TOKENS = /* @__PURE__ */ new Set([
|
|
7062
|
+
"read-only-markdown",
|
|
7063
|
+
"read-only-json",
|
|
7064
|
+
"read-only-code",
|
|
7065
|
+
"read-only-textarea",
|
|
7066
|
+
"read-only-image-url"
|
|
7067
|
+
]);
|
|
7068
|
+
var renderFieldViewTypeReadOnly = (token, value, inTable) => {
|
|
7069
|
+
const str = value === null || value === void 0 ? "" : String(value);
|
|
7070
|
+
const isEmpty = str === "" || str === "null" || str === "undefined";
|
|
7071
|
+
if (isEmpty && token !== "read-only-password" && token !== "read-only-progress" && token !== "read-only-rating") return "-";
|
|
7072
|
+
switch (token) {
|
|
7073
|
+
case "read-only-password":
|
|
7074
|
+
return /* @__PURE__ */ jsx("span", { style: { letterSpacing: 2 }, children: str ? "\u25CF\u25CF\u25CF\u25CF\u25CF\u25CF" : "-" });
|
|
7075
|
+
case "read-only-textarea":
|
|
7076
|
+
return /* @__PURE__ */ jsx(
|
|
7077
|
+
Input.TextArea,
|
|
7078
|
+
{
|
|
7079
|
+
value: str,
|
|
7080
|
+
autoSize: { minRows: 2, maxRows: 12 },
|
|
7081
|
+
readOnly: true,
|
|
7082
|
+
style: { resize: "vertical", background: "transparent", border: "none", padding: 0, boxShadow: "none" }
|
|
7083
|
+
}
|
|
7084
|
+
);
|
|
7085
|
+
case "read-only-markdown":
|
|
7086
|
+
return /* @__PURE__ */ jsx(Suspense, { fallback: /* @__PURE__ */ jsx(Skeleton.Input, { active: true, size: "small", style: { width: 200 } }), children: /* @__PURE__ */ jsx(ReactMarkdown, { children: str }) });
|
|
7087
|
+
case "read-only-json": {
|
|
7088
|
+
let formatted = str;
|
|
7089
|
+
try {
|
|
7090
|
+
formatted = JSON.stringify(JSON.parse(str), null, 2);
|
|
7091
|
+
} catch {
|
|
7092
|
+
}
|
|
7093
|
+
return /* @__PURE__ */ jsx("pre", { style: { margin: 0, fontSize: 12, whiteSpace: "pre-wrap", wordBreak: "break-all" }, children: formatted });
|
|
7094
|
+
}
|
|
7095
|
+
case "read-only-url":
|
|
7096
|
+
return /* @__PURE__ */ jsx("a", { href: str, target: "_blank", rel: "noopener noreferrer", children: str });
|
|
7097
|
+
case "read-only-email":
|
|
7098
|
+
return /* @__PURE__ */ jsx("a", { href: `mailto:${str}`, children: str });
|
|
7099
|
+
case "read-only-currency": {
|
|
7100
|
+
const num = parseFloat(str);
|
|
7101
|
+
if (isNaN(num)) return str || "-";
|
|
7102
|
+
return /* @__PURE__ */ jsx(Fragment, { children: new Intl.NumberFormat("en-US", { style: "currency", currency: "USD" }).format(num) });
|
|
7103
|
+
}
|
|
7104
|
+
case "read-only-percentage": {
|
|
7105
|
+
const num = parseFloat(str);
|
|
7106
|
+
if (isNaN(num)) return str || "-";
|
|
7107
|
+
return /* @__PURE__ */ jsx(Fragment, { children: `${num} %` });
|
|
7108
|
+
}
|
|
7109
|
+
case "read-only-progress": {
|
|
7110
|
+
const num = Math.max(0, Math.min(100, parseFloat(str) || 0));
|
|
7111
|
+
return /* @__PURE__ */ jsx(Progress, { percent: num, size: "small", style: { marginBottom: 0 } });
|
|
7112
|
+
}
|
|
7113
|
+
case "read-only-rating": {
|
|
7114
|
+
const num = parseFloat(str) || 0;
|
|
7115
|
+
return /* @__PURE__ */ jsx(Rate, { disabled: true, value: num });
|
|
7116
|
+
}
|
|
7117
|
+
case "read-only-duration": {
|
|
7118
|
+
const secs = parseInt(str) || 0;
|
|
7119
|
+
return /* @__PURE__ */ jsx(Fragment, { children: formatDuration(secs) });
|
|
7120
|
+
}
|
|
7121
|
+
case "read-only-phone":
|
|
7122
|
+
return /* @__PURE__ */ jsx("a", { href: `tel:${str}`, children: str });
|
|
7123
|
+
case "read-only-color":
|
|
7124
|
+
return /* @__PURE__ */ jsxs("span", { style: { display: "inline-flex", alignItems: "center", gap: 6 }, children: [
|
|
7125
|
+
/* @__PURE__ */ jsx("span", { style: { display: "inline-block", width: 16, height: 16, background: str, border: "1px solid #d9d9d9", borderRadius: 2, flexShrink: 0 } }),
|
|
7126
|
+
str
|
|
7127
|
+
] });
|
|
7128
|
+
case "read-only-code":
|
|
7129
|
+
return /* @__PURE__ */ jsx("pre", { style: { margin: 0, fontSize: 12, fontFamily: "monospace", whiteSpace: "pre-wrap", wordBreak: "break-all" }, children: str });
|
|
7130
|
+
case "read-only-image-url":
|
|
7131
|
+
return /* @__PURE__ */ jsx("a", { href: str, target: "_blank", rel: "noopener noreferrer", children: /* @__PURE__ */ jsx("img", { src: str, alt: "", style: { maxWidth: "100%", maxHeight: 200, objectFit: "contain", borderRadius: 4, display: "block" } }) });
|
|
7132
|
+
case "read-only-qrcode":
|
|
7133
|
+
return /* @__PURE__ */ jsx(Suspense, { fallback: /* @__PURE__ */ jsx(Skeleton.Input, { active: true, size: "small", style: { width: 128 } }), children: /* @__PURE__ */ jsx(QRCodeSVG, { value: str, size: 128 }) });
|
|
7134
|
+
case "read-only-relative": {
|
|
7135
|
+
const parsed = dayjs8(str);
|
|
7136
|
+
if (!parsed.isValid()) return str || "-";
|
|
7137
|
+
return /* @__PURE__ */ jsx(Fragment, { children: parsed.fromNow() });
|
|
7138
|
+
}
|
|
7139
|
+
case "read-only-truncated-text":
|
|
7140
|
+
return /* @__PURE__ */ jsx(Tooltip, { title: str, children: /* @__PURE__ */ jsx("span", { style: { display: "block", overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap", cursor: "default" }, children: str }) });
|
|
7141
|
+
default:
|
|
7142
|
+
return str || "-";
|
|
7143
|
+
}
|
|
7144
|
+
};
|
|
7145
|
+
var wrapForTable = (node) => /* @__PURE__ */ jsx("div", { style: { maxHeight: 120, overflowY: "auto", overflowX: "hidden" }, children: node });
|
|
7146
|
+
var renderFieldValue = (field, record, allModels, inTable) => {
|
|
7147
|
+
const value = record?.[field.key];
|
|
7148
|
+
const isNlSentenceField = field.key === "nl_sentence" || field.key === "nl_asks_sentence";
|
|
7149
|
+
if (isNlSentenceField) {
|
|
7150
|
+
return /* @__PURE__ */ jsx(
|
|
7151
|
+
Input.TextArea,
|
|
7152
|
+
{
|
|
7153
|
+
value: value === null || value === void 0 ? "" : String(value),
|
|
7154
|
+
autoSize: { minRows: 3, maxRows: 18 },
|
|
7155
|
+
style: { resize: "vertical", background: "#f3f6f9" },
|
|
7156
|
+
placeholder: _16(field.key),
|
|
7157
|
+
readOnly: true
|
|
7158
|
+
}
|
|
7159
|
+
);
|
|
7160
|
+
}
|
|
7161
|
+
const showToken = normalizeFieldViewType(field.showViewType || "");
|
|
7162
|
+
if (showToken && showToken.startsWith("read-only-") && !(showToken === "read-only-field" && field.reference)) {
|
|
7163
|
+
const node = renderFieldViewTypeReadOnly(showToken, value);
|
|
7164
|
+
return inTable && TALL_VIEW_TYPE_TOKENS.has(showToken) ? wrapForTable(node) : node;
|
|
7165
|
+
}
|
|
7166
|
+
if (field.type === "boolean") {
|
|
7167
|
+
return value ? /* @__PURE__ */ jsx(CheckCircleOutlined, { style: { color: "green", fontSize: "1.2em" } }) : /* @__PURE__ */ jsx(CloseCircleOutlined, { style: { color: "red", fontSize: "1.2em" } });
|
|
7168
|
+
}
|
|
7169
|
+
if (field.reference && value && hasReferenceModel(field.reference, allModels)) {
|
|
7170
|
+
return /* @__PURE__ */ jsx(ReferenceField, { id: value, resource: resolveResourcePath(field.referencePath || field.reference, allModels) });
|
|
7171
|
+
}
|
|
7172
|
+
if (field.type === "number") {
|
|
7173
|
+
return formatNumberValue(value) ?? "-";
|
|
7174
|
+
}
|
|
7175
|
+
if (field.type === "date") {
|
|
7176
|
+
return formatDateValue(value) ?? "-";
|
|
7177
|
+
}
|
|
7178
|
+
if (field.type === "datetime") {
|
|
7179
|
+
return formatDateTimeValue(value) ?? "-";
|
|
7180
|
+
}
|
|
7181
|
+
if (field.type === "time") {
|
|
7182
|
+
return formatTimeValue(value);
|
|
7183
|
+
}
|
|
7184
|
+
if (field.options && value !== void 0 && value !== null) {
|
|
7185
|
+
return renderOptionTag(field, value);
|
|
7186
|
+
}
|
|
7187
|
+
return value ?? "-";
|
|
7188
|
+
};
|
|
7189
|
+
var _17 = window._ || ((text) => text);
|
|
7190
|
+
var CALENDAR_WEEKDAYS = [_17("Sun"), _17("Mon"), _17("Tue"), _17("Wed"), _17("Thu"), _17("Fri"), _17("Sat")];
|
|
6969
7191
|
var CALENDAR_DATE_FOOTER_FIELDS = /* @__PURE__ */ new Set(["creation_date", "modification_date"]);
|
|
6970
7192
|
var isCalendarDateField = (field) => {
|
|
6971
7193
|
const rawType = String(field?.type || "").trim().toLowerCase();
|
|
@@ -6993,22 +7215,10 @@ var getCalendarDateFieldOptions = (fields) => {
|
|
|
6993
7215
|
var getCalendarRecordDate = (record, fieldKey) => {
|
|
6994
7216
|
const rawValue = record?.[fieldKey];
|
|
6995
7217
|
if (rawValue === void 0 || rawValue === null || rawValue === "") return null;
|
|
6996
|
-
const parsed =
|
|
7218
|
+
const parsed = dayjs8(rawValue);
|
|
6997
7219
|
if (!parsed.isValid()) return null;
|
|
6998
7220
|
return parsed.startOf("day");
|
|
6999
7221
|
};
|
|
7000
|
-
|
|
7001
|
-
// src/components/DynamicResource/utils/navigation.ts
|
|
7002
|
-
var getShowHref = (resource, id, allModels) => {
|
|
7003
|
-
const resourcePath = resolveResourcePath(resource, allModels);
|
|
7004
|
-
return `/${resourcePath}/show/${id}`;
|
|
7005
|
-
};
|
|
7006
|
-
var shouldHandleLinkClick = (event) => {
|
|
7007
|
-
if (event.defaultPrevented) return false;
|
|
7008
|
-
if (event.button !== 0) return false;
|
|
7009
|
-
if (event.metaKey || event.ctrlKey || event.shiftKey || event.altKey) return false;
|
|
7010
|
-
return true;
|
|
7011
|
-
};
|
|
7012
7222
|
var USER_KEY = "jm_user";
|
|
7013
7223
|
function getCurrentUserRoles() {
|
|
7014
7224
|
try {
|
|
@@ -7033,7 +7243,7 @@ function useRoleFilteredModel(model) {
|
|
|
7033
7243
|
return { ...model, fields: filtered };
|
|
7034
7244
|
}, [model, userRoles]);
|
|
7035
7245
|
}
|
|
7036
|
-
var
|
|
7246
|
+
var _18 = window._ || ((text) => text);
|
|
7037
7247
|
var DynamicShow = ({ model: modelProp, allModels, idOverride, embedded }) => {
|
|
7038
7248
|
const model = useRoleFilteredModel(modelProp);
|
|
7039
7249
|
applyI18nLabelsToModel(model);
|
|
@@ -7045,7 +7255,7 @@ var DynamicShow = ({ model: modelProp, allModels, idOverride, embedded }) => {
|
|
|
7045
7255
|
const id = idOverride ?? routeId;
|
|
7046
7256
|
const { formProps, saveButtonProps, record, recordId } = useShowEditableForm(model.resource || model.name, id);
|
|
7047
7257
|
const { formProps: showFormProps, effectiveFields } = buildShowTabFormOptions(formProps, model, allModels);
|
|
7048
|
-
const pageTitle = record?._label ? asDisplayText(record._label, `${
|
|
7258
|
+
const pageTitle = record?._label ? asDisplayText(record._label, `${_18("Show")} ${modelDisplayLabel}`) : `${_18("Show")} ${modelDisplayLabel}`;
|
|
7049
7259
|
const { actionsState, headerButtons } = useShowActionsPreferences(model, allModels, record, saveButtonProps);
|
|
7050
7260
|
const [activeTabKey, setActiveTabKey] = useState("details");
|
|
7051
7261
|
const items = useStandardShowTabs(
|
|
@@ -7093,7 +7303,7 @@ var DynamicShow = ({ model: modelProp, allModels, idOverride, embedded }) => {
|
|
|
7093
7303
|
title: renderWrappedPageTitle(renderModelHeading({
|
|
7094
7304
|
model,
|
|
7095
7305
|
title: pageTitle,
|
|
7096
|
-
actionLabel:
|
|
7306
|
+
actionLabel: _18("Show"),
|
|
7097
7307
|
moduleLabel: model.module ? getModuleLabel(model.module) : void 0
|
|
7098
7308
|
})),
|
|
7099
7309
|
headerButtons,
|
|
@@ -7113,7 +7323,7 @@ var DynamicShow = ({ model: modelProp, allModels, idOverride, embedded }) => {
|
|
|
7113
7323
|
)
|
|
7114
7324
|
] });
|
|
7115
7325
|
};
|
|
7116
|
-
var
|
|
7326
|
+
var _19 = window._ || ((text) => text);
|
|
7117
7327
|
var RELATION_SELECT_DEFAULT_PAGE_SIZE = 2e3;
|
|
7118
7328
|
var RelationSelect = ({ field, value, onChange, allModels, multiple, serverSearch, excludeId }) => {
|
|
7119
7329
|
const optionLabel = "_label";
|
|
@@ -7168,7 +7378,7 @@ var RelationSelect = ({ field, value, onChange, allModels, multiple, serverSearc
|
|
|
7168
7378
|
}
|
|
7169
7379
|
),
|
|
7170
7380
|
isCapped && /* @__PURE__ */ jsxs("div", { style: { display: "flex", alignItems: "center", justifyContent: "space-between", gap: 8, marginTop: 4 }, children: [
|
|
7171
|
-
/* @__PURE__ */ jsx(Typography.Text, { type: "secondary", style: { fontSize: 11 }, children:
|
|
7381
|
+
/* @__PURE__ */ jsx(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)) }),
|
|
7172
7382
|
/* @__PURE__ */ jsx(
|
|
7173
7383
|
Button,
|
|
7174
7384
|
{
|
|
@@ -7177,13 +7387,13 @@ var RelationSelect = ({ field, value, onChange, allModels, multiple, serverSearc
|
|
|
7177
7387
|
style: { fontSize: 11, padding: 0 },
|
|
7178
7388
|
loading: queryResult?.isLoading || queryResult?.isFetching,
|
|
7179
7389
|
onClick: () => setLoadAll(true),
|
|
7180
|
-
children:
|
|
7390
|
+
children: _19("Load all")
|
|
7181
7391
|
}
|
|
7182
7392
|
)
|
|
7183
7393
|
] })
|
|
7184
7394
|
] });
|
|
7185
7395
|
};
|
|
7186
|
-
var
|
|
7396
|
+
var _20 = window._ || ((text) => text);
|
|
7187
7397
|
var FileUploadInput = ({ value: _value, onChange: _onChange }) => {
|
|
7188
7398
|
const form = Form.useFormInstance();
|
|
7189
7399
|
const [uploading, setUploading] = useState(false);
|
|
@@ -7192,7 +7402,7 @@ var FileUploadInput = ({ value: _value, onChange: _onChange }) => {
|
|
|
7192
7402
|
const handleUpload = async (file) => {
|
|
7193
7403
|
const recordId = form.getFieldValue("eid") ?? form.getFieldValue("id");
|
|
7194
7404
|
if (!recordId) {
|
|
7195
|
-
message.error(
|
|
7405
|
+
message.error(_20("Save the record first before uploading a file."));
|
|
7196
7406
|
return false;
|
|
7197
7407
|
}
|
|
7198
7408
|
setUploading(true);
|
|
@@ -7216,9 +7426,9 @@ var FileUploadInput = ({ value: _value, onChange: _onChange }) => {
|
|
|
7216
7426
|
data_hash: result.data_hash
|
|
7217
7427
|
});
|
|
7218
7428
|
setFileName(result.data_name || file.name);
|
|
7219
|
-
message.success(
|
|
7429
|
+
message.success(_20("File uploaded successfully."));
|
|
7220
7430
|
} catch (err) {
|
|
7221
|
-
message.error(err?.message ||
|
|
7431
|
+
message.error(err?.message || _20("File upload failed."));
|
|
7222
7432
|
} finally {
|
|
7223
7433
|
setUploading(false);
|
|
7224
7434
|
}
|
|
@@ -7235,9 +7445,9 @@ var FileUploadInput = ({ value: _value, onChange: _onChange }) => {
|
|
|
7235
7445
|
style: { padding: "8px 16px" },
|
|
7236
7446
|
children: [
|
|
7237
7447
|
/* @__PURE__ */ jsx("p", { style: { marginBottom: 4 }, children: uploading ? /* @__PURE__ */ jsx(Spin, { size: "small" }) : /* @__PURE__ */ jsx(UploadOutlined, { style: { fontSize: 24, color: "#1677ff" } }) }),
|
|
7238
|
-
/* @__PURE__ */ jsx("p", { style: { fontSize: 13, margin: 0 }, children: uploading ?
|
|
7448
|
+
/* @__PURE__ */ jsx("p", { style: { fontSize: 13, margin: 0 }, children: uploading ? _20("Uploading...") : _20("Click or drag a file here to upload") }),
|
|
7239
7449
|
displayName && !uploading && /* @__PURE__ */ jsxs("p", { style: { fontSize: 11, color: "#888", margin: "4px 0 0" }, children: [
|
|
7240
|
-
|
|
7450
|
+
_20("Current"),
|
|
7241
7451
|
": ",
|
|
7242
7452
|
displayName
|
|
7243
7453
|
] })
|
|
@@ -7245,7 +7455,7 @@ var FileUploadInput = ({ value: _value, onChange: _onChange }) => {
|
|
|
7245
7455
|
}
|
|
7246
7456
|
) });
|
|
7247
7457
|
};
|
|
7248
|
-
var
|
|
7458
|
+
var _21 = window._ || ((text) => text);
|
|
7249
7459
|
var AsyncSelectInput = ({
|
|
7250
7460
|
optionsUrl,
|
|
7251
7461
|
placeholder,
|
|
@@ -7305,20 +7515,159 @@ var AsyncSelectInput = ({
|
|
|
7305
7515
|
options,
|
|
7306
7516
|
value,
|
|
7307
7517
|
onChange,
|
|
7308
|
-
placeholder: placeholder ||
|
|
7518
|
+
placeholder: placeholder || _21("Select..."),
|
|
7309
7519
|
style: { width: "100%" },
|
|
7310
7520
|
filterOption: (input, option) => String(option?.label ?? "").toLowerCase().includes(input.toLowerCase())
|
|
7311
7521
|
}
|
|
7312
7522
|
);
|
|
7313
7523
|
};
|
|
7314
|
-
var
|
|
7524
|
+
var _22 = window._ || ((text) => text);
|
|
7525
|
+
var ReactMarkdown2 = lazy(() => import('react-markdown').then((m) => ({ default: m.default })));
|
|
7526
|
+
var MarkdownEditor = ({ value = "", onChange }) => {
|
|
7527
|
+
const [activeTab, setActiveTab] = useState("edit");
|
|
7528
|
+
return /* @__PURE__ */ jsx(
|
|
7529
|
+
Tabs,
|
|
7530
|
+
{
|
|
7531
|
+
activeKey: activeTab,
|
|
7532
|
+
onChange: setActiveTab,
|
|
7533
|
+
size: "small",
|
|
7534
|
+
style: { marginBottom: 0 },
|
|
7535
|
+
items: [
|
|
7536
|
+
{
|
|
7537
|
+
key: "edit",
|
|
7538
|
+
label: _22("Edit"),
|
|
7539
|
+
children: /* @__PURE__ */ jsx(
|
|
7540
|
+
Input.TextArea,
|
|
7541
|
+
{
|
|
7542
|
+
value,
|
|
7543
|
+
onChange: (e) => onChange?.(e.target.value),
|
|
7544
|
+
autoSize: { minRows: 3, maxRows: 18 },
|
|
7545
|
+
style: { resize: "vertical" }
|
|
7546
|
+
}
|
|
7547
|
+
)
|
|
7548
|
+
},
|
|
7549
|
+
{
|
|
7550
|
+
key: "preview",
|
|
7551
|
+
label: _22("Preview"),
|
|
7552
|
+
children: /* @__PURE__ */ jsx("div", { style: { minHeight: 60, padding: "4px 0" }, children: /* @__PURE__ */ jsx(Suspense, { fallback: /* @__PURE__ */ jsx(Skeleton.Input, { active: true, size: "small", style: { width: 200 } }), children: /* @__PURE__ */ jsx(ReactMarkdown2, { children: value }) }) })
|
|
7553
|
+
}
|
|
7554
|
+
]
|
|
7555
|
+
}
|
|
7556
|
+
);
|
|
7557
|
+
};
|
|
7558
|
+
var JsonEditor = ({ value = "", onChange }) => {
|
|
7559
|
+
const [error, setError] = useState(null);
|
|
7560
|
+
const handleChange = (e) => {
|
|
7561
|
+
const raw = e.target.value;
|
|
7562
|
+
onChange?.(raw);
|
|
7563
|
+
if (!raw.trim()) {
|
|
7564
|
+
setError(null);
|
|
7565
|
+
return;
|
|
7566
|
+
}
|
|
7567
|
+
try {
|
|
7568
|
+
JSON.parse(raw);
|
|
7569
|
+
setError(null);
|
|
7570
|
+
} catch (ex) {
|
|
7571
|
+
setError(ex.message);
|
|
7572
|
+
}
|
|
7573
|
+
};
|
|
7574
|
+
return /* @__PURE__ */ jsxs("div", { children: [
|
|
7575
|
+
/* @__PURE__ */ jsx(
|
|
7576
|
+
Input.TextArea,
|
|
7577
|
+
{
|
|
7578
|
+
value,
|
|
7579
|
+
onChange: handleChange,
|
|
7580
|
+
autoSize: { minRows: 3, maxRows: 18 },
|
|
7581
|
+
style: { resize: "vertical", fontFamily: "monospace", fontSize: 12 }
|
|
7582
|
+
}
|
|
7583
|
+
),
|
|
7584
|
+
error && /* @__PURE__ */ jsx(Alert, { type: "error", message: error, showIcon: true, style: { marginTop: 4, padding: "2px 8px", fontSize: 11 } })
|
|
7585
|
+
] });
|
|
7586
|
+
};
|
|
7587
|
+
var renderEditableFieldViewType = (token, value, onChange) => {
|
|
7588
|
+
const str = value === null || value === void 0 ? "" : String(value);
|
|
7589
|
+
switch (token) {
|
|
7590
|
+
case "editable-password":
|
|
7591
|
+
return /* @__PURE__ */ jsx(Input.Password, { value: str, onChange: (e) => onChange?.(e.target.value) });
|
|
7592
|
+
case "editable-textarea":
|
|
7593
|
+
return /* @__PURE__ */ jsx(Input.TextArea, { value: str, onChange: (e) => onChange?.(e.target.value), autoSize: { minRows: 3, maxRows: 18 }, style: { resize: "vertical" } });
|
|
7594
|
+
case "editable-markdown":
|
|
7595
|
+
return /* @__PURE__ */ jsx(MarkdownEditor, { value: str, onChange });
|
|
7596
|
+
case "editable-json":
|
|
7597
|
+
return /* @__PURE__ */ jsx(JsonEditor, { value: str, onChange });
|
|
7598
|
+
case "editable-url":
|
|
7599
|
+
return /* @__PURE__ */ jsxs("div", { children: [
|
|
7600
|
+
/* @__PURE__ */ jsx(Input, { value: str, onChange: (e) => onChange?.(e.target.value), placeholder: "https://..." }),
|
|
7601
|
+
str && /* @__PURE__ */ jsx("div", { style: { marginTop: 2, fontSize: 11 }, children: /* @__PURE__ */ jsx("a", { href: str, target: "_blank", rel: "noopener noreferrer", children: str }) })
|
|
7602
|
+
] });
|
|
7603
|
+
case "editable-email":
|
|
7604
|
+
return /* @__PURE__ */ jsx(Input, { type: "email", value: str, onChange: (e) => onChange?.(e.target.value), placeholder: "user@example.com" });
|
|
7605
|
+
case "editable-currency": {
|
|
7606
|
+
const num = value === null || value === void 0 ? void 0 : Number(value);
|
|
7607
|
+
return /* @__PURE__ */ jsx(InputNumber, { style: { width: "100%" }, value: isNaN(num) ? void 0 : num, onChange, addonBefore: "$", precision: 2, step: 0.01 });
|
|
7608
|
+
}
|
|
7609
|
+
case "editable-percentage": {
|
|
7610
|
+
const num = value === null || value === void 0 ? void 0 : Number(value);
|
|
7611
|
+
return /* @__PURE__ */ jsx(InputNumber, { style: { width: "100%" }, value: isNaN(num) ? void 0 : num, onChange, addonAfter: "%", step: 0.1 });
|
|
7612
|
+
}
|
|
7613
|
+
case "editable-progress": {
|
|
7614
|
+
const num = value === null || value === void 0 ? void 0 : Number(value);
|
|
7615
|
+
return /* @__PURE__ */ jsx(InputNumber, { style: { width: "100%" }, value: isNaN(num) ? void 0 : num, onChange, min: 0, max: 100, addonAfter: "%", precision: 0 });
|
|
7616
|
+
}
|
|
7617
|
+
case "editable-rating":
|
|
7618
|
+
return /* @__PURE__ */ jsx(Rate, { value: Number(value) || 0, onChange });
|
|
7619
|
+
case "editable-duration": {
|
|
7620
|
+
const num = value === null || value === void 0 ? void 0 : Number(value);
|
|
7621
|
+
return /* @__PURE__ */ jsx(InputNumber, { style: { width: "100%" }, value: isNaN(num) ? void 0 : num, onChange, min: 0, precision: 0, addonAfter: "s" });
|
|
7622
|
+
}
|
|
7623
|
+
case "editable-phone":
|
|
7624
|
+
return /* @__PURE__ */ jsx(Input, { type: "tel", value: str, onChange: (e) => onChange?.(e.target.value), placeholder: "+1 555 000 0000" });
|
|
7625
|
+
case "editable-color":
|
|
7626
|
+
return /* @__PURE__ */ jsxs("div", { style: { display: "flex", alignItems: "center", gap: 8 }, children: [
|
|
7627
|
+
/* @__PURE__ */ jsx(
|
|
7628
|
+
"input",
|
|
7629
|
+
{
|
|
7630
|
+
type: "color",
|
|
7631
|
+
value: str || "#000000",
|
|
7632
|
+
onChange: (e) => onChange?.(e.target.value),
|
|
7633
|
+
style: { width: 36, height: 28, border: "1px solid #d9d9d9", borderRadius: 4, padding: 2, cursor: "pointer", flexShrink: 0 }
|
|
7634
|
+
}
|
|
7635
|
+
),
|
|
7636
|
+
/* @__PURE__ */ jsx(Input, { value: str, onChange: (e) => onChange?.(e.target.value), placeholder: "#000000", style: { flex: 1 } })
|
|
7637
|
+
] });
|
|
7638
|
+
case "editable-code":
|
|
7639
|
+
return /* @__PURE__ */ jsx(
|
|
7640
|
+
Input.TextArea,
|
|
7641
|
+
{
|
|
7642
|
+
value: str,
|
|
7643
|
+
onChange: (e) => onChange?.(e.target.value),
|
|
7644
|
+
autoSize: { minRows: 3, maxRows: 18 },
|
|
7645
|
+
style: { resize: "vertical", fontFamily: "monospace", fontSize: 12 }
|
|
7646
|
+
}
|
|
7647
|
+
);
|
|
7648
|
+
case "editable-image-url":
|
|
7649
|
+
return /* @__PURE__ */ jsxs("div", { children: [
|
|
7650
|
+
/* @__PURE__ */ jsx(Input, { value: str, onChange: (e) => onChange?.(e.target.value), placeholder: "https://..." }),
|
|
7651
|
+
str && /* @__PURE__ */ jsx(
|
|
7652
|
+
"img",
|
|
7653
|
+
{
|
|
7654
|
+
src: str,
|
|
7655
|
+
alt: "",
|
|
7656
|
+
style: { marginTop: 4, maxWidth: "100%", maxHeight: 120, objectFit: "contain", borderRadius: 4, display: "block" }
|
|
7657
|
+
}
|
|
7658
|
+
)
|
|
7659
|
+
] });
|
|
7660
|
+
default:
|
|
7661
|
+
return null;
|
|
7662
|
+
}
|
|
7663
|
+
};
|
|
7315
7664
|
var renderInput = (field, allModels, model, currentId) => {
|
|
7316
7665
|
const resolvedField = model && allModels ? applyRelationFieldOverrides(model, allModels).find((item) => item.key === field.key) || field : field;
|
|
7317
7666
|
if (resolvedField.key === "data" && isFileModel(model)) {
|
|
7318
7667
|
return /* @__PURE__ */ jsx(FileUploadInput, {});
|
|
7319
7668
|
}
|
|
7320
7669
|
const isNlSentenceField = resolvedField.key === "nl_sentence" || resolvedField.key === "nl_asks_sentence";
|
|
7321
|
-
const sentenceFieldHelper =
|
|
7670
|
+
const sentenceFieldHelper = _22(resolvedField.key);
|
|
7322
7671
|
if (isNlSentenceField) {
|
|
7323
7672
|
return /* @__PURE__ */ jsx(
|
|
7324
7673
|
Input.TextArea,
|
|
@@ -7332,21 +7681,26 @@ var renderInput = (field, allModels, model, currentId) => {
|
|
|
7332
7681
|
if (resolvedField.readOnly) {
|
|
7333
7682
|
return /* @__PURE__ */ jsx(Input, { disabled: true });
|
|
7334
7683
|
}
|
|
7684
|
+
const editToken = normalizeFieldViewType(resolvedField.editViewType || "");
|
|
7685
|
+
if (editToken && editToken.startsWith("editable-")) {
|
|
7686
|
+
const Wrapper = ({ value, onChange }) => renderEditableFieldViewType(editToken, value, onChange);
|
|
7687
|
+
return /* @__PURE__ */ jsx(Wrapper, {});
|
|
7688
|
+
}
|
|
7335
7689
|
if (resolvedField.reference && hasReferenceModel(resolvedField.reference, allModels)) {
|
|
7336
7690
|
const refResource = resolveResourcePath(resolvedField.reference, allModels);
|
|
7337
7691
|
const modelResource = model ? resolveResourcePath(model.resource || model.name, allModels) : void 0;
|
|
7338
7692
|
const isSelfRef = refResource && modelResource && refResource === modelResource;
|
|
7339
7693
|
return /* @__PURE__ */ jsx(RelationSelect, { field: resolvedField, allModels, excludeId: isSelfRef ? currentId : void 0 });
|
|
7340
7694
|
}
|
|
7341
|
-
if (resolvedField.optionsUrl) return /* @__PURE__ */ jsx(AsyncSelectInput, { optionsUrl: resolvedField.optionsUrl, placeholder: `${
|
|
7695
|
+
if (resolvedField.optionsUrl) return /* @__PURE__ */ jsx(AsyncSelectInput, { optionsUrl: resolvedField.optionsUrl, placeholder: `${_22("Select")} ${_22(resolvedField.label)}...` });
|
|
7342
7696
|
if (resolvedField.options) return /* @__PURE__ */ jsx(Select, { options: resolvedField.options, style: { width: "100%" }, placeholder: `Select ${resolvedField.label}...`, allowClear: true });
|
|
7343
7697
|
switch (resolvedField.type) {
|
|
7344
7698
|
case "boolean":
|
|
7345
7699
|
return /* @__PURE__ */ jsx(Checkbox, {});
|
|
7346
7700
|
case "date":
|
|
7347
|
-
return /* @__PURE__ */ jsx(DatePicker, { style: { width: "100%" }, placeholder:
|
|
7701
|
+
return /* @__PURE__ */ jsx(DatePicker, { style: { width: "100%" }, placeholder: _22("Select date") });
|
|
7348
7702
|
case "datetime":
|
|
7349
|
-
return /* @__PURE__ */ jsx(DatePicker, { showTime: true, style: { width: "100%" }, placeholder:
|
|
7703
|
+
return /* @__PURE__ */ jsx(DatePicker, { showTime: true, style: { width: "100%" }, placeholder: _22("Select date and time") });
|
|
7350
7704
|
case "time":
|
|
7351
7705
|
return /* @__PURE__ */ jsx(TimePicker, { style: { width: "100%" } });
|
|
7352
7706
|
case "number":
|
|
@@ -7355,47 +7709,9 @@ var renderInput = (field, allModels, model, currentId) => {
|
|
|
7355
7709
|
return /* @__PURE__ */ jsx(Input, {});
|
|
7356
7710
|
}
|
|
7357
7711
|
};
|
|
7358
|
-
var _22 = window._ || ((text) => text);
|
|
7359
|
-
var renderFieldValue = (field, record, allModels) => {
|
|
7360
|
-
const isNlSentenceField = field.key === "nl_sentence" || field.key === "nl_asks_sentence";
|
|
7361
|
-
if (isNlSentenceField) {
|
|
7362
|
-
const value = record?.[field.key];
|
|
7363
|
-
return /* @__PURE__ */ jsx(
|
|
7364
|
-
Input.TextArea,
|
|
7365
|
-
{
|
|
7366
|
-
value: value === null || value === void 0 ? "" : String(value),
|
|
7367
|
-
autoSize: { minRows: 3, maxRows: 18 },
|
|
7368
|
-
style: { resize: "vertical", background: "#f3f6f9" },
|
|
7369
|
-
placeholder: _22(field.key),
|
|
7370
|
-
readOnly: true
|
|
7371
|
-
}
|
|
7372
|
-
);
|
|
7373
|
-
}
|
|
7374
|
-
if (field.type === "boolean") {
|
|
7375
|
-
return record?.[field.key] ? /* @__PURE__ */ jsx(CheckCircleOutlined, { style: { color: "green", fontSize: "1.2em" } }) : /* @__PURE__ */ jsx(CloseCircleOutlined, { style: { color: "red", fontSize: "1.2em" } });
|
|
7376
|
-
}
|
|
7377
|
-
if (field.reference && record?.[field.key] && hasReferenceModel(field.reference, allModels)) {
|
|
7378
|
-
return /* @__PURE__ */ jsx(ReferenceField, { id: record[field.key], resource: resolveResourcePath(field.referencePath || field.reference, allModels) });
|
|
7379
|
-
}
|
|
7380
|
-
if (field.type === "number") {
|
|
7381
|
-
return formatNumberValue(record?.[field.key]) ?? "-";
|
|
7382
|
-
}
|
|
7383
|
-
if (field.type === "date") {
|
|
7384
|
-
return formatDateValue(record?.[field.key]) ?? "-";
|
|
7385
|
-
}
|
|
7386
|
-
if (field.type === "datetime") {
|
|
7387
|
-
return formatDateTimeValue(record?.[field.key]) ?? "-";
|
|
7388
|
-
}
|
|
7389
|
-
if (field.type === "time") {
|
|
7390
|
-
return formatTimeValue(record?.[field.key]);
|
|
7391
|
-
}
|
|
7392
|
-
if (field.options && record?.[field.key] !== void 0 && record?.[field.key] !== null) {
|
|
7393
|
-
return renderOptionTag(field, record[field.key]);
|
|
7394
|
-
}
|
|
7395
|
-
return record?.[field.key] ?? "-";
|
|
7396
|
-
};
|
|
7397
7712
|
var _23 = window._ || ((text) => text);
|
|
7398
7713
|
var { Title: Title2 } = Typography;
|
|
7714
|
+
var requiredMark = (field) => field.required ? /* @__PURE__ */ jsx("span", { style: { color: "#ff4d4f", marginLeft: 3 }, children: "*" }) : null;
|
|
7399
7715
|
var DynamicCreate = ({ model: modelProp, allModels, journeyCallbacks, injectedValues }) => {
|
|
7400
7716
|
const model = useRoleFilteredModel(modelProp);
|
|
7401
7717
|
applyI18nLabelsToModel(model);
|
|
@@ -7651,14 +7967,17 @@ var DynamicCreate = ({ model: modelProp, allModels, journeyCallbacks, injectedVa
|
|
|
7651
7967
|
return /* @__PURE__ */ jsx(Form.Item, { name: field.key, hidden: true, rules: field.required ? [{ required: true }] : [], children: renderInput(field, allModels, model) }, `${field.key}-${index}`);
|
|
7652
7968
|
}
|
|
7653
7969
|
return /* @__PURE__ */ jsx("div", { style: { marginBottom: 4 }, children: /* @__PURE__ */ jsxs("div", { style: { display: "grid", gridTemplateColumns: showLabel ? "200px 1fr" : "1fr", alignItems: "start", columnGap: 6 }, children: [
|
|
7654
|
-
showLabel && /* @__PURE__ */
|
|
7970
|
+
showLabel && /* @__PURE__ */ jsxs("div", { style: { ...labelStyle, backgroundColor: labelBackground, padding: "2px 4px", borderRadius: 4 }, children: [
|
|
7971
|
+
field.label,
|
|
7972
|
+
requiredMark(field)
|
|
7973
|
+
] }),
|
|
7655
7974
|
/* @__PURE__ */ 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__ */ jsx(
|
|
7656
7975
|
Form.Item,
|
|
7657
7976
|
{
|
|
7658
7977
|
name: field.key,
|
|
7659
7978
|
rules: field.required ? [{ required: true }] : [],
|
|
7660
7979
|
valuePropName: field.type === "boolean" ? "checked" : void 0,
|
|
7661
|
-
getValueProps: (val) => (field.type === "date" || field.type === "datetime") && val ? { value:
|
|
7980
|
+
getValueProps: (val) => (field.type === "date" || field.type === "datetime") && val ? { value: dayjs8(val) } : field.type === "time" && val ? { value: dayjs8("1970-01-01T" + val) } : { value: val },
|
|
7662
7981
|
style: { margin: 0 },
|
|
7663
7982
|
children: renderInput(field, allModels, model)
|
|
7664
7983
|
}
|
|
@@ -7720,7 +8039,10 @@ var DynamicCreate = ({ model: modelProp, allModels, journeyCallbacks, injectedVa
|
|
|
7720
8039
|
...parseInlineStyle(item.html_format)
|
|
7721
8040
|
};
|
|
7722
8041
|
return /* @__PURE__ */ jsx("div", { style: { marginBottom: 4 }, children: /* @__PURE__ */ jsxs("div", { style: { display: "grid", gridTemplateColumns: showLabel ? "200px 1fr" : "1fr", alignItems: "start", columnGap: 6 }, children: [
|
|
7723
|
-
showLabel && /* @__PURE__ */
|
|
8042
|
+
showLabel && /* @__PURE__ */ jsxs("div", { style: { ...labelStyle, backgroundColor: labelBackground, padding: "2px 4px", borderRadius: 4 }, children: [
|
|
8043
|
+
field.label,
|
|
8044
|
+
requiredMark(field)
|
|
8045
|
+
] }),
|
|
7724
8046
|
/* @__PURE__ */ jsx("div", { style: readonlyValueStyle, children: renderFieldValue(field, createdRecord, allModels) })
|
|
7725
8047
|
] }) }, `${field.key}-${index}`);
|
|
7726
8048
|
};
|
|
@@ -7731,7 +8053,7 @@ var DynamicCreate = ({ model: modelProp, allModels, journeyCallbacks, injectedVa
|
|
|
7731
8053
|
const prefix = useReadonly ? "pc" : "cr";
|
|
7732
8054
|
return /* @__PURE__ */ jsxs("div", { style: { border: `1px solid ${token.colorBorder}`, borderRadius: 8, padding: "6px 6px", marginBottom: 6 }, children: [
|
|
7733
8055
|
/* @__PURE__ */ jsx(Title2, { level: 5, style: { margin: 0, marginBottom: 6, color: "#1677ff" }, children: _23(section) }),
|
|
7734
|
-
/* @__PURE__ */ jsx("table", { style: { width: "100%", borderCollapse: "collapse", tableLayout: "fixed" }, children: /* @__PURE__ */ jsx("tbody", { children: Array.from({ length: maxRow }).map((
|
|
8056
|
+
/* @__PURE__ */ jsx("table", { style: { width: "100%", borderCollapse: "collapse", tableLayout: "fixed" }, children: /* @__PURE__ */ jsx("tbody", { children: Array.from({ length: maxRow }).map((_41, rowIdx) => /* @__PURE__ */ jsx("tr", { children: Array.from({ length: maxCol }).map((_42, colIdx) => {
|
|
7735
8057
|
const cellItems = normalized.filter((r) => r.row === rowIdx + 1 && r.column === colIdx + 1);
|
|
7736
8058
|
return /* @__PURE__ */ jsx("td", { style: { padding: "0 4px", verticalAlign: "top", width: `${100 / maxCol}%` }, children: cellItems.map(
|
|
7737
8059
|
(item, idx) => useReadonly ? renderReadonlyCell(item, idx) : renderFormCell(item, idx)
|
|
@@ -7749,8 +8071,11 @@ var DynamicCreate = ({ model: modelProp, allModels, journeyCallbacks, injectedVa
|
|
|
7749
8071
|
return /* @__PURE__ */ jsx(Form.Item, { name: field.key, hidden: true, rules: field.required ? [{ required: true }] : [], children: renderInput(field, allModels, model) }, field.key);
|
|
7750
8072
|
}
|
|
7751
8073
|
return /* @__PURE__ */ jsxs("div", { style: { display: "grid", gridTemplateColumns: "200px 1fr", justifyContent: "start", alignItems: "start", columnGap: 6 }, children: [
|
|
7752
|
-
/* @__PURE__ */
|
|
7753
|
-
|
|
8074
|
+
/* @__PURE__ */ jsxs("span", { style: labelStyle, children: [
|
|
8075
|
+
field.label,
|
|
8076
|
+
requiredMark(field)
|
|
8077
|
+
] }),
|
|
8078
|
+
/* @__PURE__ */ jsx("div", { style: { padding: "2px 4px", lineHeight: 1.15, maxWidth: "100%", overflowWrap: "anywhere" }, children: /* @__PURE__ */ jsx(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(val) } : field.type === "time" && val ? { value: dayjs8("1970-01-01T" + val) } : { value: val }, style: { margin: 0 }, children: renderInput(field, allModels, model) }) })
|
|
7754
8079
|
] }, field.key);
|
|
7755
8080
|
}) }) })
|
|
7756
8081
|
] }),
|
|
@@ -7884,7 +8209,10 @@ var DynamicCreate = ({ model: modelProp, allModels, journeyCallbacks, injectedVa
|
|
|
7884
8209
|
return /* @__PURE__ */ jsx(Form.Item, { name: field.key, hidden: true, rules: field.required ? [{ required: true }] : [], children: isOtherKey && field.reference && hasReferenceModel(field.reference, allModels) ? /* @__PURE__ */ jsx(RelationSelect, { field, allModels, multiple: true }) : renderInput(field, allModels, model) }, field.key);
|
|
7885
8210
|
}
|
|
7886
8211
|
return /* @__PURE__ */ jsxs("div", { style: { display: "grid", gridTemplateColumns: "200px 1fr", justifyContent: "start", alignItems: "start", columnGap: 6 }, children: [
|
|
7887
|
-
/* @__PURE__ */
|
|
8212
|
+
/* @__PURE__ */ jsxs("span", { style: labelStyle, children: [
|
|
8213
|
+
field.label,
|
|
8214
|
+
requiredMark(field)
|
|
8215
|
+
] }),
|
|
7888
8216
|
/* @__PURE__ */ jsx("div", { style: { padding: "2px 4px", lineHeight: 1.15, maxWidth: "100%", overflowWrap: "anywhere" }, children: /* @__PURE__ */ jsx(Form.Item, { name: field.key, rules: field.required ? [{ required: true }] : [], style: { margin: 0 }, children: isOtherKey && field.reference && hasReferenceModel(field.reference, allModels) ? /* @__PURE__ */ jsx(RelationSelect, { field, allModels, multiple: true }) : renderInput(field, allModels, model) }) })
|
|
7889
8217
|
] }, field.key);
|
|
7890
8218
|
}) })
|
|
@@ -7980,6 +8308,7 @@ var NLSentenceBlock = ({ eid, title: titleProp, showLabel }) => {
|
|
|
7980
8308
|
};
|
|
7981
8309
|
var _24 = window._ || ((text) => text);
|
|
7982
8310
|
var { Title: Title3 } = Typography;
|
|
8311
|
+
var requiredMark2 = (field) => field.required ? /* @__PURE__ */ jsx("span", { style: { color: "#ff4d4f", marginLeft: 3 }, children: "*" }) : null;
|
|
7983
8312
|
var DynamicEdit = ({ model: modelProp, allModels, topContent, extraHeaderButtons, journeyCallbacks, idOverride }) => {
|
|
7984
8313
|
const model = useRoleFilteredModel(modelProp);
|
|
7985
8314
|
applyI18nLabelsToModel(model);
|
|
@@ -8302,14 +8631,17 @@ var DynamicEdit = ({ model: modelProp, allModels, topContent, extraHeaderButtons
|
|
|
8302
8631
|
gap: "4px 6px"
|
|
8303
8632
|
},
|
|
8304
8633
|
children: [
|
|
8305
|
-
/* @__PURE__ */
|
|
8634
|
+
/* @__PURE__ */ jsxs("span", { style: { ...labelStyle, flex: "0 0 200px" }, children: [
|
|
8635
|
+
field.label,
|
|
8636
|
+
requiredMark2(field)
|
|
8637
|
+
] }),
|
|
8306
8638
|
/* @__PURE__ */ jsx("div", { style: { flex: "1 0 200px", padding: "2px 4px", lineHeight: 1.15, overflowWrap: "anywhere", background: valueBackground, borderRadius: 6 }, children: /* @__PURE__ */ jsx(
|
|
8307
8639
|
Form.Item,
|
|
8308
8640
|
{
|
|
8309
8641
|
name: field.key,
|
|
8310
8642
|
rules: field.required && !field.formula ? [{ required: true }] : [],
|
|
8311
8643
|
valuePropName: field.type === "boolean" ? "checked" : void 0,
|
|
8312
|
-
getValueProps: (val) => (field.type === "date" || field.type === "datetime") && val ? { value:
|
|
8644
|
+
getValueProps: (val) => (field.type === "date" || field.type === "datetime") && val ? { value: dayjs8(val) } : field.type === "time" && val ? { value: dayjs8("1970-01-01T" + val) } : { value: val },
|
|
8313
8645
|
style: { margin: 0 },
|
|
8314
8646
|
children: field.formula ? /* @__PURE__ */ jsx(Input, { disabled: true }) : renderInput(field, allModels, model, recordId)
|
|
8315
8647
|
}
|
|
@@ -8351,7 +8683,7 @@ var DynamicEdit = ({ model: modelProp, allModels, topContent, extraHeaderButtons
|
|
|
8351
8683
|
},
|
|
8352
8684
|
children: [
|
|
8353
8685
|
/* @__PURE__ */ jsx(Title3, { level: 5, style: { margin: 0, color: "#1677ff" }, children: _24(section) }),
|
|
8354
|
-
/* @__PURE__ */ jsx("table", { style: { width: "100%", borderCollapse: "collapse", tableLayout: "fixed" }, children: /* @__PURE__ */ jsx("tbody", { children: Array.from({ length: maxRow }).map((
|
|
8686
|
+
/* @__PURE__ */ jsx("table", { style: { width: "100%", borderCollapse: "collapse", tableLayout: "fixed" }, children: /* @__PURE__ */ jsx("tbody", { children: Array.from({ length: maxRow }).map((_41, rowIndex) => /* @__PURE__ */ jsx("tr", { children: Array.from({ length: maxCol }).map((_42, colIndex) => {
|
|
8355
8687
|
const cellItems = normalized.filter(
|
|
8356
8688
|
(item) => item.row === rowIndex + 1 && item.column === colIndex + 1
|
|
8357
8689
|
);
|
|
@@ -8447,7 +8779,7 @@ var DynamicEdit = ({ model: modelProp, allModels, topContent, extraHeaderButtons
|
|
|
8447
8779
|
gap: 2
|
|
8448
8780
|
},
|
|
8449
8781
|
children: [
|
|
8450
|
-
showLabel && /* @__PURE__ */
|
|
8782
|
+
showLabel && /* @__PURE__ */ jsxs(
|
|
8451
8783
|
"div",
|
|
8452
8784
|
{
|
|
8453
8785
|
style: {
|
|
@@ -8456,7 +8788,10 @@ var DynamicEdit = ({ model: modelProp, allModels, topContent, extraHeaderButtons
|
|
|
8456
8788
|
padding: "2px 4px",
|
|
8457
8789
|
borderRadius: 4
|
|
8458
8790
|
},
|
|
8459
|
-
children:
|
|
8791
|
+
children: [
|
|
8792
|
+
field.label,
|
|
8793
|
+
requiredMark2(field)
|
|
8794
|
+
]
|
|
8460
8795
|
}
|
|
8461
8796
|
),
|
|
8462
8797
|
/* @__PURE__ */ jsx("div", { style: readonlyValueStyle, children: renderFieldValue(field, record, allModels) })
|
|
@@ -8473,7 +8808,7 @@ var DynamicEdit = ({ model: modelProp, allModels, topContent, extraHeaderButtons
|
|
|
8473
8808
|
gap: 2
|
|
8474
8809
|
},
|
|
8475
8810
|
children: [
|
|
8476
|
-
showLabel && /* @__PURE__ */
|
|
8811
|
+
showLabel && /* @__PURE__ */ jsxs(
|
|
8477
8812
|
"div",
|
|
8478
8813
|
{
|
|
8479
8814
|
style: {
|
|
@@ -8482,7 +8817,10 @@ var DynamicEdit = ({ model: modelProp, allModels, topContent, extraHeaderButtons
|
|
|
8482
8817
|
padding: "2px 4px",
|
|
8483
8818
|
borderRadius: 4
|
|
8484
8819
|
},
|
|
8485
|
-
children:
|
|
8820
|
+
children: [
|
|
8821
|
+
field.label,
|
|
8822
|
+
requiredMark2(field)
|
|
8823
|
+
]
|
|
8486
8824
|
}
|
|
8487
8825
|
),
|
|
8488
8826
|
/* @__PURE__ */ jsx("div", { style: {
|
|
@@ -8500,7 +8838,7 @@ var DynamicEdit = ({ model: modelProp, allModels, topContent, extraHeaderButtons
|
|
|
8500
8838
|
name: field.key,
|
|
8501
8839
|
rules: field.required && !field.formula ? [{ required: true }] : [],
|
|
8502
8840
|
valuePropName: field.type === "boolean" ? "checked" : void 0,
|
|
8503
|
-
getValueProps: (val) => (field.type === "date" || field.type === "datetime") && val ? { value:
|
|
8841
|
+
getValueProps: (val) => (field.type === "date" || field.type === "datetime") && val ? { value: dayjs8(val) } : field.type === "time" && val ? { value: dayjs8("1970-01-01T" + val) } : { value: val },
|
|
8504
8842
|
style: { margin: 0 },
|
|
8505
8843
|
children: field.formula ? /* @__PURE__ */ jsx(Input, { disabled: true }) : renderInput(field, allModels, model, recordId)
|
|
8506
8844
|
}
|
|
@@ -8564,7 +8902,7 @@ var DynamicEdit = ({ model: modelProp, allModels, topContent, extraHeaderButtons
|
|
|
8564
8902
|
const maxCol = Math.max(1, ...normalized.map((r) => r.column));
|
|
8565
8903
|
return /* @__PURE__ */ jsxs("div", { style: { flex: 1, minWidth: 0, border: `1px solid ${token.colorBorder}`, borderRadius: 8, padding: "2px 6px" }, children: [
|
|
8566
8904
|
/* @__PURE__ */ jsx(Title3, { level: 5, style: { margin: 0, color: "#1677ff" }, children: _24(section) }),
|
|
8567
|
-
/* @__PURE__ */ jsx("table", { style: { width: "100%", borderCollapse: "collapse", tableLayout: "fixed" }, children: /* @__PURE__ */ jsx("tbody", { children: Array.from({ length: maxRow }).map((
|
|
8905
|
+
/* @__PURE__ */ jsx("table", { style: { width: "100%", borderCollapse: "collapse", tableLayout: "fixed" }, children: /* @__PURE__ */ jsx("tbody", { children: Array.from({ length: maxRow }).map((_41, ri) => /* @__PURE__ */ jsx("tr", { children: Array.from({ length: maxCol }).map((_42, ci) => {
|
|
8568
8906
|
const cellItems = normalized.filter((item) => item.row === ri + 1 && item.column === ci + 1);
|
|
8569
8907
|
return /* @__PURE__ */ jsx("td", { style: { padding: "0 4px", verticalAlign: "top", width: `${100 / maxCol}%` }, children: cellItems.map((item, idx) => {
|
|
8570
8908
|
if (item.attribute_or_relation_type === "nlsentence") {
|
|
@@ -8607,14 +8945,17 @@ var DynamicEdit = ({ model: modelProp, allModels, topContent, extraHeaderButtons
|
|
|
8607
8945
|
const showLabel = item.show_label !== false;
|
|
8608
8946
|
const editable = isAttributeValueEditable(item, "edit");
|
|
8609
8947
|
return /* @__PURE__ */ jsx("div", { style: { marginBottom: 4 }, children: /* @__PURE__ */ jsxs("div", { style: { display: "flex", flexDirection: "column", gap: 2 }, children: [
|
|
8610
|
-
showLabel && /* @__PURE__ */
|
|
8948
|
+
showLabel && /* @__PURE__ */ jsxs("div", { style: { ...labelStyle, backgroundColor: labelBackground, padding: "2px 4px", borderRadius: 4 }, children: [
|
|
8949
|
+
field.label,
|
|
8950
|
+
requiredMark2(field)
|
|
8951
|
+
] }),
|
|
8611
8952
|
/* @__PURE__ */ 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__ */ jsx(
|
|
8612
8953
|
Form.Item,
|
|
8613
8954
|
{
|
|
8614
8955
|
name: field.key,
|
|
8615
8956
|
rules: field.required && !field.formula ? [{ required: true }] : [],
|
|
8616
8957
|
valuePropName: field.type === "boolean" ? "checked" : void 0,
|
|
8617
|
-
getValueProps: (val) => (field.type === "date" || field.type === "datetime") && val ? { value:
|
|
8958
|
+
getValueProps: (val) => (field.type === "date" || field.type === "datetime") && val ? { value: dayjs8(val) } : field.type === "time" && val ? { value: dayjs8("1970-01-01T" + val) } : { value: val },
|
|
8618
8959
|
style: { margin: 0 },
|
|
8619
8960
|
children: field.formula ? /* @__PURE__ */ jsx(Input, { disabled: true }) : renderInput(field, allModels, model, recordId)
|
|
8620
8961
|
}
|
|
@@ -8707,7 +9048,57 @@ var DynamicEdit = ({ model: modelProp, allModels, topContent, extraHeaderButtons
|
|
|
8707
9048
|
] });
|
|
8708
9049
|
};
|
|
8709
9050
|
var _25 = window._ || ((text) => text);
|
|
9051
|
+
var ReadAndEditReference = ({ value, onChange, field, allModels, model, currentId }) => {
|
|
9052
|
+
const [editing, setEditing] = useState(false);
|
|
9053
|
+
const [draft, setDraft] = useState(void 0);
|
|
9054
|
+
const form = Form.useFormInstance();
|
|
9055
|
+
const resource = field.referencePath ? field.referencePath : field.reference ? resolveResourcePath(field.reference, allModels) : "";
|
|
9056
|
+
const modelResource = model ? resolveResourcePath(model.resource || model.name, allModels) : void 0;
|
|
9057
|
+
const isSelfRef = resource && modelResource && resource === modelResource;
|
|
9058
|
+
const handleEdit = () => {
|
|
9059
|
+
setDraft(value);
|
|
9060
|
+
setEditing(true);
|
|
9061
|
+
};
|
|
9062
|
+
const handleConfirm = () => {
|
|
9063
|
+
onChange?.(draft);
|
|
9064
|
+
if (form) form.setFieldValue(field.key, draft);
|
|
9065
|
+
setEditing(false);
|
|
9066
|
+
};
|
|
9067
|
+
const handleCancel = () => {
|
|
9068
|
+
setDraft(void 0);
|
|
9069
|
+
setEditing(false);
|
|
9070
|
+
};
|
|
9071
|
+
const row = { display: "flex", alignItems: "center", justifyContent: "flex-start", gap: 4 };
|
|
9072
|
+
if (editing) {
|
|
9073
|
+
return /* @__PURE__ */ jsxs("div", { style: row, children: [
|
|
9074
|
+
/* @__PURE__ */ jsx("div", { style: { flex: 1, minWidth: 0 }, children: /* @__PURE__ */ jsx(
|
|
9075
|
+
RelationSelect,
|
|
9076
|
+
{
|
|
9077
|
+
field,
|
|
9078
|
+
value: draft,
|
|
9079
|
+
onChange: setDraft,
|
|
9080
|
+
allModels,
|
|
9081
|
+
excludeId: isSelfRef ? currentId : void 0
|
|
9082
|
+
}
|
|
9083
|
+
) }),
|
|
9084
|
+
/* @__PURE__ */ jsx(Tooltip, { title: _25("Confirm"), children: /* @__PURE__ */ jsx(Button, { size: "small", type: "primary", icon: /* @__PURE__ */ jsx(CheckOutlined, {}), onClick: handleConfirm }) }),
|
|
9085
|
+
/* @__PURE__ */ jsx(Tooltip, { title: _25("Cancel"), children: /* @__PURE__ */ jsx(Button, { size: "small", icon: /* @__PURE__ */ jsx(CloseOutlined, {}), onClick: handleCancel }) })
|
|
9086
|
+
] });
|
|
9087
|
+
}
|
|
9088
|
+
if (!value) {
|
|
9089
|
+
return /* @__PURE__ */ jsxs("div", { style: row, children: [
|
|
9090
|
+
/* @__PURE__ */ jsx("span", { children: "-" }),
|
|
9091
|
+
/* @__PURE__ */ jsx(Tooltip, { title: _25("Edit"), children: /* @__PURE__ */ jsx(Button, { size: "small", type: "text", icon: /* @__PURE__ */ jsx(EditOutlined, {}), onClick: handleEdit, style: { padding: "0 2px", height: "auto" } }) })
|
|
9092
|
+
] });
|
|
9093
|
+
}
|
|
9094
|
+
return /* @__PURE__ */ jsxs("div", { style: row, children: [
|
|
9095
|
+
/* @__PURE__ */ jsx(ReferenceField, { id: value, resource }),
|
|
9096
|
+
/* @__PURE__ */ jsx(Tooltip, { title: _25("Edit"), children: /* @__PURE__ */ jsx(Button, { size: "small", type: "text", icon: /* @__PURE__ */ jsx(EditOutlined, {}), onClick: handleEdit, style: { padding: "0 2px", height: "auto" } }) })
|
|
9097
|
+
] });
|
|
9098
|
+
};
|
|
9099
|
+
var _26 = window._ || ((text) => text);
|
|
8710
9100
|
var { Title: Title4 } = Typography;
|
|
9101
|
+
var requiredMark3 = (field) => field.required ? /* @__PURE__ */ jsx("span", { style: { color: "#ff4d4f", marginLeft: 3 }, children: "*" }) : null;
|
|
8711
9102
|
function coerce(v) {
|
|
8712
9103
|
if (v && typeof v === "object" && typeof v.valueOf === "function") return v.valueOf();
|
|
8713
9104
|
return v;
|
|
@@ -8801,22 +9192,44 @@ var useStandardShowTabs = (model, record, allModels, actionsState, editForm, ove
|
|
|
8801
9192
|
const renderShowEditableInput = (field, forceReadOnly) => {
|
|
8802
9193
|
const refResource = field.reference ? resolveResourcePath(field.reference, allModels) : void 0;
|
|
8803
9194
|
const isSelfRef = refResource && modelResource && refResource === modelResource;
|
|
9195
|
+
const scalarToken = field.showViewType ? normalizeFieldViewType(field.showViewType) : "";
|
|
9196
|
+
const isReadOnlyToken = scalarToken.startsWith("read-only-");
|
|
9197
|
+
const isEditableToken = scalarToken === "editable-field";
|
|
9198
|
+
if (field.formula || forceReadOnly || isReadOnlyToken) {
|
|
9199
|
+
return renderFieldValue(field, record, allModels);
|
|
9200
|
+
}
|
|
9201
|
+
if (field.reference) {
|
|
9202
|
+
if (!isEditableToken) {
|
|
9203
|
+
const fkRelViewType = normalizeRelationViewType(field.showViewType || "") || "read-and-edit-list";
|
|
9204
|
+
if (fkRelViewType === "read-and-edit-list") {
|
|
9205
|
+
return /* @__PURE__ */ jsx(Form.Item, { name: field.key, style: { margin: 0 }, noStyle: false, children: /* @__PURE__ */ jsx(
|
|
9206
|
+
ReadAndEditReference,
|
|
9207
|
+
{
|
|
9208
|
+
field,
|
|
9209
|
+
allModels,
|
|
9210
|
+
model,
|
|
9211
|
+
currentId: isSelfRef ? currentId : void 0
|
|
9212
|
+
}
|
|
9213
|
+
) });
|
|
9214
|
+
}
|
|
9215
|
+
}
|
|
9216
|
+
}
|
|
8804
9217
|
return /* @__PURE__ */ jsx(
|
|
8805
9218
|
Form.Item,
|
|
8806
9219
|
{
|
|
8807
9220
|
name: field.key,
|
|
8808
|
-
rules: field.required && !field.formula
|
|
9221
|
+
rules: field.required && !field.formula ? [{ required: true }] : [],
|
|
8809
9222
|
valuePropName: field.type === "boolean" ? "checked" : void 0,
|
|
8810
|
-
getValueProps: (val) => (field.type === "date" || field.type === "datetime") && val ? { value:
|
|
9223
|
+
getValueProps: (val) => (field.type === "date" || field.type === "datetime") && val ? { value: dayjs8(val) } : field.type === "time" && val ? { value: dayjs8("1970-01-01T" + val) } : { value: val },
|
|
8811
9224
|
style: { margin: 0 },
|
|
8812
9225
|
noStyle: false,
|
|
8813
|
-
children:
|
|
9226
|
+
children: renderInput(field, allModels, model, isSelfRef ? currentId : void 0)
|
|
8814
9227
|
}
|
|
8815
9228
|
);
|
|
8816
9229
|
};
|
|
8817
9230
|
const detailsTab = {
|
|
8818
9231
|
key: "details",
|
|
8819
|
-
label: renderToneTabLabel(
|
|
9232
|
+
label: renderToneTabLabel(_26("Details"), modelTone),
|
|
8820
9233
|
children: /* @__PURE__ */ jsxs(
|
|
8821
9234
|
Form,
|
|
8822
9235
|
{
|
|
@@ -8837,7 +9250,10 @@ var useStandardShowTabs = (model, record, allModels, actionsState, editForm, ove
|
|
|
8837
9250
|
gap: "4px 6px"
|
|
8838
9251
|
},
|
|
8839
9252
|
children: [
|
|
8840
|
-
/* @__PURE__ */
|
|
9253
|
+
/* @__PURE__ */ jsxs("span", { style: { ...labelStyle, flex: "0 0 200px" }, children: [
|
|
9254
|
+
field.label,
|
|
9255
|
+
requiredMark3(field)
|
|
9256
|
+
] }),
|
|
8841
9257
|
/* @__PURE__ */ jsx(
|
|
8842
9258
|
"div",
|
|
8843
9259
|
{
|
|
@@ -8845,8 +9261,8 @@ var useStandardShowTabs = (model, record, allModels, actionsState, editForm, ove
|
|
|
8845
9261
|
flex: "1 0 200px",
|
|
8846
9262
|
padding: "2px 4px",
|
|
8847
9263
|
lineHeight: 1.15,
|
|
8848
|
-
textAlign: field.type === "number" ? "right" : "left",
|
|
8849
|
-
fontVariantNumeric: field.type === "number" ? "tabular-nums" : void 0,
|
|
9264
|
+
textAlign: field.type === "number" && !field.reference ? "right" : "left",
|
|
9265
|
+
fontVariantNumeric: field.type === "number" && !field.reference ? "tabular-nums" : void 0,
|
|
8850
9266
|
overflowWrap: "anywhere",
|
|
8851
9267
|
background: valueBackground,
|
|
8852
9268
|
borderRadius: 6
|
|
@@ -8884,8 +9300,8 @@ var useStandardShowTabs = (model, record, allModels, actionsState, editForm, ove
|
|
|
8884
9300
|
padding: "6px 6px"
|
|
8885
9301
|
},
|
|
8886
9302
|
children: [
|
|
8887
|
-
/* @__PURE__ */ jsx(Title4, { level: 5, style: { margin: 0, color: "#1677ff" }, children:
|
|
8888
|
-
/* @__PURE__ */ jsx("table", { style: { width: "100%", borderCollapse: "collapse", tableLayout: "fixed" }, children: /* @__PURE__ */ jsx("tbody", { children: Array.from({ length: maxRow }).map((
|
|
9303
|
+
/* @__PURE__ */ jsx(Title4, { level: 5, style: { margin: 0, color: "#1677ff" }, children: _26(section) }),
|
|
9304
|
+
/* @__PURE__ */ jsx("table", { style: { width: "100%", borderCollapse: "collapse", tableLayout: "fixed" }, children: /* @__PURE__ */ jsx("tbody", { children: Array.from({ length: maxRow }).map((_41, rowIndex) => /* @__PURE__ */ jsx("tr", { children: Array.from({ length: maxCol }).map((_42, colIndex) => {
|
|
8889
9305
|
const cellItems = normalized.filter(
|
|
8890
9306
|
(item) => item.row === rowIndex + 1 && item.column === colIndex + 1
|
|
8891
9307
|
);
|
|
@@ -8962,8 +9378,8 @@ var useStandardShowTabs = (model, record, allModels, actionsState, editForm, ove
|
|
|
8962
9378
|
borderRadius: 6,
|
|
8963
9379
|
maxWidth: "100%",
|
|
8964
9380
|
overflowWrap: "anywhere",
|
|
8965
|
-
textAlign: field.type === "number" ? "right" : "left",
|
|
8966
|
-
fontVariantNumeric: field.type === "number" ? "tabular-nums" : void 0,
|
|
9381
|
+
textAlign: field.type === "number" && !field.reference ? "right" : "left",
|
|
9382
|
+
fontVariantNumeric: field.type === "number" && !field.reference ? "tabular-nums" : void 0,
|
|
8967
9383
|
...parseInlineStyle(item.html_format)
|
|
8968
9384
|
};
|
|
8969
9385
|
return /* @__PURE__ */ jsx(VisibilityGate, { condition: item.visibility_condition, children: /* @__PURE__ */ jsx("div", { style: { marginBottom: 4 }, children: /* @__PURE__ */ jsxs(
|
|
@@ -8975,7 +9391,7 @@ var useStandardShowTabs = (model, record, allModels, actionsState, editForm, ove
|
|
|
8975
9391
|
gap: 2
|
|
8976
9392
|
},
|
|
8977
9393
|
children: [
|
|
8978
|
-
showLabel && /* @__PURE__ */
|
|
9394
|
+
showLabel && /* @__PURE__ */ jsxs(
|
|
8979
9395
|
"div",
|
|
8980
9396
|
{
|
|
8981
9397
|
style: {
|
|
@@ -8984,7 +9400,10 @@ var useStandardShowTabs = (model, record, allModels, actionsState, editForm, ove
|
|
|
8984
9400
|
padding: "2px 4px",
|
|
8985
9401
|
borderRadius: 4
|
|
8986
9402
|
},
|
|
8987
|
-
children:
|
|
9403
|
+
children: [
|
|
9404
|
+
field.label,
|
|
9405
|
+
requiredMark3(field)
|
|
9406
|
+
]
|
|
8988
9407
|
}
|
|
8989
9408
|
),
|
|
8990
9409
|
/* @__PURE__ */ jsx("div", { style: { ...valueStyle, border: `1px solid ${token.colorBorder}` }, children: editable || forceReadOnly ? renderShowEditableInput(field, forceReadOnly) : renderFieldValue(field, record, allModels) })
|
|
@@ -9077,8 +9496,8 @@ var useStandardShowTabs = (model, record, allModels, actionsState, editForm, ove
|
|
|
9077
9496
|
const maxRow = Math.max(1, ...normalized.map((r) => r.row));
|
|
9078
9497
|
const maxCol = Math.max(1, ...normalized.map((r) => r.column));
|
|
9079
9498
|
return /* @__PURE__ */ jsxs("div", { style: { flex: 1, minWidth: 0, border: `1px solid ${token.colorBorder}`, borderRadius: 8, padding: "6px 6px" }, children: [
|
|
9080
|
-
/* @__PURE__ */ jsx(Title4, { level: 5, style: { margin: 0, color: "#1677ff" }, children:
|
|
9081
|
-
/* @__PURE__ */ jsx("table", { style: { width: "100%", borderCollapse: "collapse", tableLayout: "fixed" }, children: /* @__PURE__ */ jsx("tbody", { children: Array.from({ length: maxRow }).map((
|
|
9499
|
+
/* @__PURE__ */ jsx(Title4, { level: 5, style: { margin: 0, color: "#1677ff" }, children: _26(section) }),
|
|
9500
|
+
/* @__PURE__ */ jsx("table", { style: { width: "100%", borderCollapse: "collapse", tableLayout: "fixed" }, children: /* @__PURE__ */ jsx("tbody", { children: Array.from({ length: maxRow }).map((_41, ri) => /* @__PURE__ */ jsx("tr", { children: Array.from({ length: maxCol }).map((_42, ci) => {
|
|
9082
9501
|
const cellItems = normalized.filter((item) => item.row === ri + 1 && item.column === ci + 1);
|
|
9083
9502
|
return /* @__PURE__ */ jsx("td", { style: { padding: "0 4px", verticalAlign: "top", width: `${100 / maxCol}%` }, children: cellItems.map((item) => {
|
|
9084
9503
|
if (item.attribute_or_relation_type === "nlsentence") {
|
|
@@ -9135,13 +9554,50 @@ var useStandardShowTabs = (model, record, allModels, actionsState, editForm, ove
|
|
|
9135
9554
|
}) }) });
|
|
9136
9555
|
return {
|
|
9137
9556
|
key: `custom-tab::${tabName}`,
|
|
9138
|
-
label: renderToneTabLabel(
|
|
9557
|
+
label: renderToneTabLabel(_26(tabName), { text: token.colorText, border: token.colorBorder }),
|
|
9139
9558
|
children: tabChildren
|
|
9140
9559
|
};
|
|
9141
9560
|
});
|
|
9142
9561
|
const items = [detailsTab];
|
|
9143
9562
|
items.push(...customConfigTabs);
|
|
9144
9563
|
items.push(...relationTabs);
|
|
9564
|
+
const currentResource = model.resource || model.name.toLowerCase();
|
|
9565
|
+
const namedQueryTabs = (allModels || []).filter((m) => m.isNamedQuery).flatMap((queryModel) => {
|
|
9566
|
+
if (!record) return [];
|
|
9567
|
+
getRecordId(record, model.fields);
|
|
9568
|
+
let filterKey;
|
|
9569
|
+
if (queryModel.primaryResource === currentResource) {
|
|
9570
|
+
filterKey = queryModel.pkField || "id";
|
|
9571
|
+
} else {
|
|
9572
|
+
const fkField = queryModel.fields.find((f) => f.reference === currentResource);
|
|
9573
|
+
filterKey = fkField?.key;
|
|
9574
|
+
}
|
|
9575
|
+
if (!filterKey) return [];
|
|
9576
|
+
const syntheticRel = {
|
|
9577
|
+
resource: queryModel.resource || queryModel.name,
|
|
9578
|
+
targetKey: filterKey,
|
|
9579
|
+
label: queryModel.label,
|
|
9580
|
+
showViewType: queryModel.listViewType || "table"
|
|
9581
|
+
};
|
|
9582
|
+
const relationModel = queryModel;
|
|
9583
|
+
const tone = getModelTone(queryModel.resource || queryModel.name);
|
|
9584
|
+
return [{
|
|
9585
|
+
key: `named-query::${queryModel.name || queryModel.resource}`,
|
|
9586
|
+
label: renderToneTabLabel(queryModel.label, tone),
|
|
9587
|
+
children: /* @__PURE__ */ jsx("div", { children: renderRelationBlock({
|
|
9588
|
+
rel: syntheticRel,
|
|
9589
|
+
relationModel,
|
|
9590
|
+
record,
|
|
9591
|
+
mode: "show",
|
|
9592
|
+
parentResource: model.name,
|
|
9593
|
+
allModels,
|
|
9594
|
+
showActions: false,
|
|
9595
|
+
showCreate: false,
|
|
9596
|
+
relationViewTypeDefaults
|
|
9597
|
+
}) })
|
|
9598
|
+
}];
|
|
9599
|
+
});
|
|
9600
|
+
items.push(...namedQueryTabs);
|
|
9145
9601
|
return items;
|
|
9146
9602
|
};
|
|
9147
9603
|
var INLINE_DEFAULT_PAGE_SIZE = 10;
|
|
@@ -9460,7 +9916,7 @@ var RelatedObjectsInlineValues = ({ rel, record, viewType, allowedRelatedIds, al
|
|
|
9460
9916
|
paginationProps && /* @__PURE__ */ jsx(Pagination, { ...paginationProps })
|
|
9461
9917
|
] });
|
|
9462
9918
|
};
|
|
9463
|
-
var
|
|
9919
|
+
var _27 = window._ || ((text) => text);
|
|
9464
9920
|
var RelatedObjectsCalendar = ({ rel, record, relatedModel, allModels }) => {
|
|
9465
9921
|
useGo();
|
|
9466
9922
|
const { token } = theme.useToken();
|
|
@@ -9469,7 +9925,7 @@ var RelatedObjectsCalendar = ({ rel, record, relatedModel, allModels }) => {
|
|
|
9469
9925
|
const dateFieldOptions = useMemo(() => getCalendarDateFieldOptions(relatedModel.fields), [relatedModel.fields]);
|
|
9470
9926
|
const [calendarMode, setCalendarMode] = useState("month");
|
|
9471
9927
|
const [calendarDateField, setCalendarDateField] = useState(() => dateFieldOptions[0]?.key || "");
|
|
9472
|
-
const [calendarAnchorDate, setCalendarAnchorDate] = useState(() =>
|
|
9928
|
+
const [calendarAnchorDate, setCalendarAnchorDate] = useState(() => dayjs8().startOf("month"));
|
|
9473
9929
|
const dateFieldKeySet = useMemo(() => new Set(dateFieldOptions.map((field) => field.key)), [dateFieldOptions]);
|
|
9474
9930
|
useEffect(() => {
|
|
9475
9931
|
if (calendarDateField && dateFieldKeySet.has(calendarDateField)) return;
|
|
@@ -9507,10 +9963,10 @@ var RelatedObjectsCalendar = ({ rel, record, relatedModel, allModels }) => {
|
|
|
9507
9963
|
if (initSignatureRef.current === signature) return;
|
|
9508
9964
|
initSignatureRef.current = signature;
|
|
9509
9965
|
if (earliestDateTs === null) {
|
|
9510
|
-
setCalendarAnchorDate(
|
|
9966
|
+
setCalendarAnchorDate(dayjs8().startOf(calendarMode));
|
|
9511
9967
|
return;
|
|
9512
9968
|
}
|
|
9513
|
-
setCalendarAnchorDate(
|
|
9969
|
+
setCalendarAnchorDate(dayjs8(earliestDateTs).startOf(calendarMode));
|
|
9514
9970
|
}, [calendarDateField, calendarMode, earliestDateTs]);
|
|
9515
9971
|
const entriesByDate = useMemo(() => {
|
|
9516
9972
|
const grouped = /* @__PURE__ */ new Map();
|
|
@@ -9543,8 +9999,8 @@ var RelatedObjectsCalendar = ({ rel, record, relatedModel, allModels }) => {
|
|
|
9543
9999
|
}, [calendarAnchorDate, calendarMode]);
|
|
9544
10000
|
if (loading) return /* @__PURE__ */ jsx(Spin, { size: "small" });
|
|
9545
10001
|
if (error) return /* @__PURE__ */ jsx(Alert, { type: "error", message: error, showIcon: true });
|
|
9546
|
-
if (dateFieldOptions.length === 0) return /* @__PURE__ */ jsx(Empty, { description:
|
|
9547
|
-
if (!records.length) return /* @__PURE__ */ jsx(Empty, { description:
|
|
10002
|
+
if (dateFieldOptions.length === 0) return /* @__PURE__ */ jsx(Empty, { description: _27("No date/datetime fields available for calendar view.") });
|
|
10003
|
+
if (!records.length) return /* @__PURE__ */ jsx(Empty, { description: _27("No related records available.") });
|
|
9548
10004
|
const selectedDateField = relatedModel.fields.find((field) => field.key === calendarDateField);
|
|
9549
10005
|
const selectedLabel = selectedDateField?.label || calendarDateField;
|
|
9550
10006
|
return /* @__PURE__ */ jsxs("div", { style: { display: "grid", gap: 12 }, children: [
|
|
@@ -9557,8 +10013,8 @@ var RelatedObjectsCalendar = ({ rel, record, relatedModel, allModels }) => {
|
|
|
9557
10013
|
value: calendarMode,
|
|
9558
10014
|
onChange: (value) => setCalendarMode(value),
|
|
9559
10015
|
options: [
|
|
9560
|
-
{ label:
|
|
9561
|
-
{ label:
|
|
10016
|
+
{ label: _27("Monthly"), value: "month" },
|
|
10017
|
+
{ label: _27("Weekly"), value: "week" }
|
|
9562
10018
|
],
|
|
9563
10019
|
style: { minWidth: 120 }
|
|
9564
10020
|
}
|
|
@@ -9571,35 +10027,35 @@ var RelatedObjectsCalendar = ({ rel, record, relatedModel, allModels }) => {
|
|
|
9571
10027
|
onChange: (value) => setCalendarDateField(value),
|
|
9572
10028
|
options: dateFieldOptions.map((field) => ({ label: field.label, value: field.key })),
|
|
9573
10029
|
style: { minWidth: 220 },
|
|
9574
|
-
placeholder:
|
|
10030
|
+
placeholder: _27("Date field")
|
|
9575
10031
|
}
|
|
9576
10032
|
)
|
|
9577
10033
|
] }),
|
|
9578
10034
|
/* @__PURE__ */ jsxs(Space, { size: 8, children: [
|
|
9579
|
-
/* @__PURE__ */ jsx(Tooltip, { title:
|
|
10035
|
+
/* @__PURE__ */ jsx(Tooltip, { title: _27("Previous"), children: /* @__PURE__ */ jsx(
|
|
9580
10036
|
Button,
|
|
9581
10037
|
{
|
|
9582
10038
|
size: "small",
|
|
9583
10039
|
icon: /* @__PURE__ */ jsx(ArrowLeftOutlined, {}),
|
|
9584
|
-
"aria-label":
|
|
10040
|
+
"aria-label": _27("Previous"),
|
|
9585
10041
|
onClick: () => setCalendarAnchorDate((prev) => prev.subtract(1, calendarMode).startOf(calendarMode))
|
|
9586
10042
|
}
|
|
9587
10043
|
) }),
|
|
9588
|
-
/* @__PURE__ */ jsx(Tooltip, { title:
|
|
10044
|
+
/* @__PURE__ */ jsx(Tooltip, { title: _27("Today"), children: /* @__PURE__ */ jsx(
|
|
9589
10045
|
Button,
|
|
9590
10046
|
{
|
|
9591
10047
|
size: "small",
|
|
9592
10048
|
icon: /* @__PURE__ */ jsx(CalendarOutlined, {}),
|
|
9593
|
-
"aria-label":
|
|
9594
|
-
onClick: () => setCalendarAnchorDate(
|
|
10049
|
+
"aria-label": _27("Today"),
|
|
10050
|
+
onClick: () => setCalendarAnchorDate(dayjs8().startOf(calendarMode))
|
|
9595
10051
|
}
|
|
9596
10052
|
) }),
|
|
9597
|
-
/* @__PURE__ */ jsx(Tooltip, { title:
|
|
10053
|
+
/* @__PURE__ */ jsx(Tooltip, { title: _27("Next"), children: /* @__PURE__ */ jsx(
|
|
9598
10054
|
Button,
|
|
9599
10055
|
{
|
|
9600
10056
|
size: "small",
|
|
9601
10057
|
icon: /* @__PURE__ */ jsx(ArrowRightOutlined, {}),
|
|
9602
|
-
"aria-label":
|
|
10058
|
+
"aria-label": _27("Next"),
|
|
9603
10059
|
onClick: () => setCalendarAnchorDate((prev) => prev.add(1, calendarMode).startOf(calendarMode))
|
|
9604
10060
|
}
|
|
9605
10061
|
) })
|
|
@@ -9640,7 +10096,7 @@ var RelatedObjectsCalendar = ({ rel, record, relatedModel, allModels }) => {
|
|
|
9640
10096
|
const dayKey = day.format("YYYY-MM-DD");
|
|
9641
10097
|
const entries = entriesByDate.get(dayKey) || [];
|
|
9642
10098
|
const isOutsideCurrentMonth = calendarMode === "month" && day.month() !== calendarAnchorDate.month();
|
|
9643
|
-
const isToday = day.isSame(
|
|
10099
|
+
const isToday = day.isSame(dayjs8(), "day");
|
|
9644
10100
|
return /* @__PURE__ */ jsxs(
|
|
9645
10101
|
"div",
|
|
9646
10102
|
{
|
|
@@ -9718,12 +10174,12 @@ var RelatedObjectPrimaryCard = ({ record, model, allModels, customPageName }) =>
|
|
|
9718
10174
|
}
|
|
9719
10175
|
);
|
|
9720
10176
|
};
|
|
9721
|
-
var
|
|
10177
|
+
var _28 = window._ || ((text) => text);
|
|
9722
10178
|
var RelatedObjectsPrimaryView = ({ rel, record, model, allModels, customPageName }) => {
|
|
9723
10179
|
const { records, loading, error } = useRelatedGalleryRecords({ rel, record, allModels });
|
|
9724
10180
|
if (loading) return /* @__PURE__ */ jsx(Spin, { size: "small" });
|
|
9725
10181
|
if (error) return /* @__PURE__ */ jsx(Alert, { type: "error", message: error, showIcon: true });
|
|
9726
|
-
if (!records.length) return /* @__PURE__ */ jsx(Empty, { description:
|
|
10182
|
+
if (!records.length) return /* @__PURE__ */ jsx(Empty, { description: _28("No related objects.") });
|
|
9727
10183
|
return /* @__PURE__ */ jsx("div", { style: { display: "grid", gap: 8 }, children: records.map((item) => {
|
|
9728
10184
|
const id = item?.eid ?? item?.id;
|
|
9729
10185
|
return /* @__PURE__ */ jsx(
|
|
@@ -9738,7 +10194,7 @@ var RelatedObjectsPrimaryView = ({ rel, record, model, allModels, customPageName
|
|
|
9738
10194
|
);
|
|
9739
10195
|
}) });
|
|
9740
10196
|
};
|
|
9741
|
-
var
|
|
10197
|
+
var _29 = window._ || ((text) => text);
|
|
9742
10198
|
var RelatedObjectsGallery = ({ rel, record, relatedModel, allModels }) => {
|
|
9743
10199
|
const apiUrl = useApiUrl();
|
|
9744
10200
|
const go = useGo();
|
|
@@ -9753,7 +10209,7 @@ var RelatedObjectsGallery = ({ rel, record, relatedModel, allModels }) => {
|
|
|
9753
10209
|
if (error) return /* @__PURE__ */ jsx(Alert, { type: "error", message: error, showIcon: true });
|
|
9754
10210
|
if (!records.length) return /* @__PURE__ */ jsxs("div", { style: { display: "inline-flex", alignItems: "center", gap: 6, color: "#bfbfbf", fontSize: 12 }, children: [
|
|
9755
10211
|
/* @__PURE__ */ jsx(FileTextOutlined, { style: { fontSize: 16 } }),
|
|
9756
|
-
|
|
10212
|
+
_29("No images available")
|
|
9757
10213
|
] });
|
|
9758
10214
|
return /* @__PURE__ */ jsx("div", { style: { display: "flex", flexWrap: "wrap", gap: 16 }, children: records.map((item) => {
|
|
9759
10215
|
const id = getGalleryItemId(item);
|
|
@@ -9777,7 +10233,7 @@ var RelatedObjectsGallery = ({ rel, record, relatedModel, allModels }) => {
|
|
|
9777
10233
|
});
|
|
9778
10234
|
}) });
|
|
9779
10235
|
};
|
|
9780
|
-
var
|
|
10236
|
+
var _30 = window._ || ((text) => text);
|
|
9781
10237
|
var RelatedObjectsEditableList = ({ rel, record, allModels }) => {
|
|
9782
10238
|
const go = useGo();
|
|
9783
10239
|
const paneNav = usePaneNavigation();
|
|
@@ -9876,7 +10332,7 @@ var RelatedObjectsEditableList = ({ rel, record, allModels }) => {
|
|
|
9876
10332
|
const d = String(body.detail);
|
|
9877
10333
|
if (d.toLowerCase().includes("unique") || d.toLowerCase().includes("duplicate")) {
|
|
9878
10334
|
const optLabel = allOptions.find((o) => o.id === id)?.label ?? String(id);
|
|
9879
|
-
detail = `"${optLabel}" ${
|
|
10335
|
+
detail = `"${optLabel}" ${_30("is already linked to another record and cannot be added here.")}`;
|
|
9880
10336
|
} else {
|
|
9881
10337
|
detail = d;
|
|
9882
10338
|
}
|
|
@@ -9895,9 +10351,9 @@ var RelatedObjectsEditableList = ({ rel, record, allModels }) => {
|
|
|
9895
10351
|
setSelectedIds(new Set(newBaseline));
|
|
9896
10352
|
if (errors.length > 0) {
|
|
9897
10353
|
message.error(errors[0], 6);
|
|
9898
|
-
if (errors.length > 1) message.warning(`${errors.length - 1} ${
|
|
10354
|
+
if (errors.length > 1) message.warning(`${errors.length - 1} ${_30("other error(s) occurred.")}`, 4);
|
|
9899
10355
|
} else {
|
|
9900
|
-
message.success(
|
|
10356
|
+
message.success(_30("Changes saved."));
|
|
9901
10357
|
setEditing(false);
|
|
9902
10358
|
setSearchText("");
|
|
9903
10359
|
}
|
|
@@ -9905,7 +10361,7 @@ var RelatedObjectsEditableList = ({ rel, record, allModels }) => {
|
|
|
9905
10361
|
const newItems = allOptions.filter((opt) => newBaseline.has(opt.id)).map((opt) => ({ id: opt.id, label: opt.label, resource: otherResource }));
|
|
9906
10362
|
setLocalItems(newItems);
|
|
9907
10363
|
} catch (err) {
|
|
9908
|
-
message.error(err instanceof Error ? err.message :
|
|
10364
|
+
message.error(err instanceof Error ? err.message : _30("Failed to save changes."));
|
|
9909
10365
|
} finally {
|
|
9910
10366
|
setSaving(false);
|
|
9911
10367
|
}
|
|
@@ -9925,7 +10381,7 @@ var RelatedObjectsEditableList = ({ rel, record, allModels }) => {
|
|
|
9925
10381
|
const relatedModel = findModelByName(allModels, rel.otherResource || rel.otherResourcePath);
|
|
9926
10382
|
const relatedResource = relatedModel ? resolveResourcePath(relatedModel.resource || relatedModel.name, allModels) : null;
|
|
9927
10383
|
if (!relatedResource) {
|
|
9928
|
-
message.warning(
|
|
10384
|
+
message.warning(_30("No create route for the related model. Opening relation create form."));
|
|
9929
10385
|
params.append(rel.targetKey, String(recordId));
|
|
9930
10386
|
const returnTo2 = `${location.pathname}${location.search}${location.hash}`;
|
|
9931
10387
|
if (returnTo2.startsWith("/")) params.append("returnTo", returnTo2);
|
|
@@ -9944,7 +10400,7 @@ var RelatedObjectsEditableList = ({ rel, record, allModels }) => {
|
|
|
9944
10400
|
if (error) return /* @__PURE__ */ jsx(Alert, { type: "error", message: error, showIcon: true });
|
|
9945
10401
|
if (!editing) {
|
|
9946
10402
|
return /* @__PURE__ */ jsxs("div", { style: { minHeight: 22 }, children: [
|
|
9947
|
-
/* @__PURE__ */ jsx("div", { style: { display: "flex", justifyContent: "flex-end", marginBottom: 4 }, children: /* @__PURE__ */ jsx(Tooltip, { title:
|
|
10403
|
+
/* @__PURE__ */ jsx("div", { style: { display: "flex", justifyContent: "flex-end", marginBottom: 4 }, children: /* @__PURE__ */ jsx(Tooltip, { title: _30("Edit"), children: /* @__PURE__ */ jsx(Button, { size: "small", type: "text", icon: /* @__PURE__ */ jsx(EditOutlined, {}), onClick: () => setEditing(true) }) }) }),
|
|
9948
10404
|
items.length === 0 && total === 0 ? /* @__PURE__ */ jsx("span", { style: { color: token.colorTextSecondary, fontStyle: "italic" }, children: "\u2014" }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
9949
10405
|
/* @__PURE__ */ jsx("ul", { style: { margin: 0, paddingLeft: 16 }, children: items.map((item, index) => /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(
|
|
9950
10406
|
"a",
|
|
@@ -9983,7 +10439,7 @@ var RelatedObjectsEditableList = ({ rel, record, allModels }) => {
|
|
|
9983
10439
|
setPage(p);
|
|
9984
10440
|
}
|
|
9985
10441
|
},
|
|
9986
|
-
onShowSizeChange: (
|
|
10442
|
+
onShowSizeChange: (_41, newPageSize) => {
|
|
9987
10443
|
setPageSize(newPageSize);
|
|
9988
10444
|
setPage(1);
|
|
9989
10445
|
},
|
|
@@ -10015,7 +10471,7 @@ var RelatedObjectsEditableList = ({ rel, record, allModels }) => {
|
|
|
10015
10471
|
Input,
|
|
10016
10472
|
{
|
|
10017
10473
|
prefix: /* @__PURE__ */ jsx(SearchOutlined, { style: { color: token.colorTextSecondary } }),
|
|
10018
|
-
placeholder:
|
|
10474
|
+
placeholder: _30("Search..."),
|
|
10019
10475
|
value: searchText,
|
|
10020
10476
|
onChange: (e) => setSearchText(e.target.value),
|
|
10021
10477
|
allowClear: true,
|
|
@@ -10023,9 +10479,9 @@ var RelatedObjectsEditableList = ({ rel, record, allModels }) => {
|
|
|
10023
10479
|
style: { flex: 1 }
|
|
10024
10480
|
}
|
|
10025
10481
|
),
|
|
10026
|
-
rel.otherResource && rel.otherKey && rel.targetKey && /* @__PURE__ */ jsx(Tooltip, { title:
|
|
10482
|
+
rel.otherResource && rel.otherKey && rel.targetKey && /* @__PURE__ */ jsx(Tooltip, { title: _30("Create new and relate"), children: /* @__PURE__ */ jsx(Button, { size: "small", icon: /* @__PURE__ */ jsx(ShareAltOutlined, {}), onClick: handleCreateNewAndRelate }) })
|
|
10027
10483
|
] }),
|
|
10028
|
-
/* @__PURE__ */ jsx("div", { style: { maxHeight: 280, overflowY: "auto", marginBottom: 8 }, children: optionsLoading ? /* @__PURE__ */ jsx("div", { style: { textAlign: "center", padding: 16 }, children: /* @__PURE__ */ jsx(Spin, { size: "small" }) }) : sortedOptions.length === 0 ? /* @__PURE__ */ jsx(Empty, { image: Empty.PRESENTED_IMAGE_SIMPLE, description:
|
|
10484
|
+
/* @__PURE__ */ jsx("div", { style: { maxHeight: 280, overflowY: "auto", marginBottom: 8 }, children: optionsLoading ? /* @__PURE__ */ jsx("div", { style: { textAlign: "center", padding: 16 }, children: /* @__PURE__ */ jsx(Spin, { size: "small" }) }) : sortedOptions.length === 0 ? /* @__PURE__ */ jsx(Empty, { image: Empty.PRESENTED_IMAGE_SIMPLE, description: _30("No options") }) : sortedOptions.map((opt) => {
|
|
10029
10485
|
const checked = selectedIds.has(opt.id);
|
|
10030
10486
|
return /* @__PURE__ */ jsxs(
|
|
10031
10487
|
"div",
|
|
@@ -10062,41 +10518,139 @@ var RelatedObjectsEditableList = ({ rel, record, allModels }) => {
|
|
|
10062
10518
|
);
|
|
10063
10519
|
}) }),
|
|
10064
10520
|
/* @__PURE__ */ jsxs("div", { style: { display: "flex", justifyContent: "flex-end", gap: 8, borderTop: `1px solid ${token.colorBorderSecondary}`, paddingTop: 8 }, children: [
|
|
10065
|
-
/* @__PURE__ */ jsx(Button, { size: "small", onClick: handleCancel, children:
|
|
10066
|
-
/* @__PURE__ */ jsx(Button, { size: "small", type: "primary", icon: /* @__PURE__ */ jsx(SaveOutlined, {}), onClick: handleSave, loading: saving, disabled: !hasChanges, children:
|
|
10521
|
+
/* @__PURE__ */ jsx(Button, { size: "small", onClick: handleCancel, children: _30("Cancel") }),
|
|
10522
|
+
/* @__PURE__ */ jsx(Button, { size: "small", type: "primary", icon: /* @__PURE__ */ jsx(SaveOutlined, {}), onClick: handleSave, loading: saving, disabled: !hasChanges, children: _30("Save") })
|
|
10067
10523
|
] })
|
|
10068
10524
|
] });
|
|
10069
10525
|
};
|
|
10070
|
-
var
|
|
10071
|
-
var {
|
|
10072
|
-
var PolymorphicRelatedObjectsTable = ({ rel, record, relationModel, parentModel, allModels, showActions = false, showCreate = false, allowInlineEdit = false, layoutPreferenceType, viewVariant = "default" }) => {
|
|
10073
|
-
const recordId = record?.[parentModel?.pkField ?? "eid"] ?? record?.eid ?? record?.id;
|
|
10526
|
+
var _31 = window._ || ((text) => text);
|
|
10527
|
+
var RelatedObjectsEditableCsv = ({ rel, record, allModels }) => {
|
|
10074
10528
|
const apiUrl = useApiUrl();
|
|
10075
|
-
const
|
|
10076
|
-
const [
|
|
10077
|
-
const [
|
|
10078
|
-
const [
|
|
10079
|
-
const
|
|
10080
|
-
|
|
10081
|
-
[rel.otherKey, rel.otherResource, relationModel, allModels]
|
|
10082
|
-
);
|
|
10529
|
+
const { items: fetchedItems, loading, error } = useRelatedInlineItems({ rel, record, allModels });
|
|
10530
|
+
const [saving, setSaving] = useState(false);
|
|
10531
|
+
const [allOptions, setAllOptions] = useState([]);
|
|
10532
|
+
const [optionsLoading, setOptionsLoading] = useState(false);
|
|
10533
|
+
const [selectedIds, setSelectedIds] = useState([]);
|
|
10534
|
+
const [baselineIds, setBaselineIds] = useState(/* @__PURE__ */ new Set());
|
|
10083
10535
|
useEffect(() => {
|
|
10084
|
-
|
|
10085
|
-
|
|
10086
|
-
|
|
10087
|
-
|
|
10088
|
-
|
|
10089
|
-
|
|
10090
|
-
|
|
10091
|
-
|
|
10092
|
-
|
|
10536
|
+
const ids = fetchedItems.map((item) => Number(item.id));
|
|
10537
|
+
setSelectedIds(ids);
|
|
10538
|
+
setBaselineIds(new Set(ids));
|
|
10539
|
+
}, [fetchedItems]);
|
|
10540
|
+
useEffect(() => {
|
|
10541
|
+
if (!rel.otherResource) return;
|
|
10542
|
+
let cancelled = false;
|
|
10543
|
+
const fetchOptions = async () => {
|
|
10544
|
+
setOptionsLoading(true);
|
|
10093
10545
|
try {
|
|
10094
|
-
const
|
|
10095
|
-
|
|
10096
|
-
|
|
10097
|
-
|
|
10098
|
-
|
|
10099
|
-
|
|
10546
|
+
const resource = rel.otherResourcePath || resolveResourcePath(rel.otherResource, allModels);
|
|
10547
|
+
const params = new URLSearchParams({ _start: "0", _end: "50000" });
|
|
10548
|
+
const response = await authenticatedFetch(`${apiUrl}/${resource}?${params.toString()}`);
|
|
10549
|
+
if (!response.ok) throw new Error("Failed to load options");
|
|
10550
|
+
const data = await response.json();
|
|
10551
|
+
if (!cancelled && Array.isArray(data)) {
|
|
10552
|
+
setAllOptions(data.map((item) => ({
|
|
10553
|
+
value: item.eid ?? item.id,
|
|
10554
|
+
label: getRecordDisplayLabel(item)
|
|
10555
|
+
})));
|
|
10556
|
+
}
|
|
10557
|
+
} catch {
|
|
10558
|
+
} finally {
|
|
10559
|
+
if (!cancelled) setOptionsLoading(false);
|
|
10560
|
+
}
|
|
10561
|
+
};
|
|
10562
|
+
fetchOptions();
|
|
10563
|
+
return () => {
|
|
10564
|
+
cancelled = true;
|
|
10565
|
+
};
|
|
10566
|
+
}, [apiUrl, rel.otherResource]);
|
|
10567
|
+
const handleChange = useCallback(async (newIds) => {
|
|
10568
|
+
if (!rel.otherKey || !rel.targetKey) return;
|
|
10569
|
+
const recordId = record?.eid ?? record?.id;
|
|
10570
|
+
if (recordId === void 0 || recordId === null) return;
|
|
10571
|
+
const newSet = new Set(newIds);
|
|
10572
|
+
const toAdd = newIds.filter((id) => !baselineIds.has(id));
|
|
10573
|
+
const toRemove = [...baselineIds].filter((id) => !newSet.has(id));
|
|
10574
|
+
setSelectedIds(newIds);
|
|
10575
|
+
setSaving(true);
|
|
10576
|
+
const errors = [];
|
|
10577
|
+
try {
|
|
10578
|
+
const relationResource = rel.resourcePath || resolveResourcePath(rel.resource, allModels);
|
|
10579
|
+
for (const id of toRemove) {
|
|
10580
|
+
const deleteId = rel.targetKey === "eid_from" ? `${recordId}:${id}` : `${id}:${recordId}`;
|
|
10581
|
+
const resp = await authenticatedFetch(`${apiUrl}/${relationResource}/${encodeURIComponent(deleteId)}`, { method: "DELETE" });
|
|
10582
|
+
if (!resp.ok) errors.push(`Failed to remove (${resp.status})`);
|
|
10583
|
+
}
|
|
10584
|
+
for (const id of toAdd) {
|
|
10585
|
+
const payload = { [rel.targetKey]: recordId, [rel.otherKey]: id };
|
|
10586
|
+
const resp = await authenticatedFetch(`${apiUrl}/${relationResource}`, {
|
|
10587
|
+
method: "POST",
|
|
10588
|
+
headers: { "Content-Type": "application/json" },
|
|
10589
|
+
body: JSON.stringify(payload)
|
|
10590
|
+
});
|
|
10591
|
+
if (!resp.ok) errors.push(`Failed to add (${resp.status})`);
|
|
10592
|
+
}
|
|
10593
|
+
if (errors.length === 0) {
|
|
10594
|
+
setBaselineIds(newSet);
|
|
10595
|
+
} else {
|
|
10596
|
+
message.error(errors.join("; "));
|
|
10597
|
+
setSelectedIds([...baselineIds]);
|
|
10598
|
+
}
|
|
10599
|
+
} finally {
|
|
10600
|
+
setSaving(false);
|
|
10601
|
+
}
|
|
10602
|
+
}, [apiUrl, rel, record, allModels, baselineIds]);
|
|
10603
|
+
if (loading) return /* @__PURE__ */ jsx(Spin, { size: "small" });
|
|
10604
|
+
if (error) return /* @__PURE__ */ jsx(Alert, { type: "error", message: error, showIcon: true });
|
|
10605
|
+
if (!rel.otherResource || !rel.otherKey) {
|
|
10606
|
+
return /* @__PURE__ */ jsx(Alert, { type: "warning", message: _31("editable-csv requires a many-to-many relation"), showIcon: true });
|
|
10607
|
+
}
|
|
10608
|
+
return /* @__PURE__ */ jsx(
|
|
10609
|
+
Select,
|
|
10610
|
+
{
|
|
10611
|
+
mode: "multiple",
|
|
10612
|
+
value: selectedIds,
|
|
10613
|
+
onChange: handleChange,
|
|
10614
|
+
options: allOptions,
|
|
10615
|
+
loading: optionsLoading || saving,
|
|
10616
|
+
style: { width: "100%" },
|
|
10617
|
+
placeholder: `${_31("Select")} ${_31(rel.label)}...`,
|
|
10618
|
+
optionFilterProp: "label",
|
|
10619
|
+
showSearch: true,
|
|
10620
|
+
allowClear: true
|
|
10621
|
+
}
|
|
10622
|
+
);
|
|
10623
|
+
};
|
|
10624
|
+
var _32 = window._ || ((text) => text);
|
|
10625
|
+
var { Title: Title5 } = Typography;
|
|
10626
|
+
var PolymorphicRelatedObjectsTable = ({ rel, record, relationModel, parentModel, allModels, showActions = false, showCreate = false, allowInlineEdit = false, layoutPreferenceType, viewVariant = "default" }) => {
|
|
10627
|
+
const recordId = record?.[parentModel?.pkField ?? "eid"] ?? record?.eid ?? record?.id;
|
|
10628
|
+
const apiUrl = useApiUrl();
|
|
10629
|
+
const [loading, setLoading] = useState(false);
|
|
10630
|
+
const [error, setError] = useState(null);
|
|
10631
|
+
const [groupedIds, setGroupedIds] = useState(/* @__PURE__ */ new Map());
|
|
10632
|
+
const [unresolvedIds, setUnresolvedIds] = useState([]);
|
|
10633
|
+
const polyInfo = useMemo(
|
|
10634
|
+
() => getPolymorphicReferenceInfo(rel, relationModel, allModels),
|
|
10635
|
+
[rel.otherKey, rel.otherResource, relationModel, allModels]
|
|
10636
|
+
);
|
|
10637
|
+
useEffect(() => {
|
|
10638
|
+
if (!recordId || !rel.otherKey || !polyInfo) {
|
|
10639
|
+
setGroupedIds(/* @__PURE__ */ new Map());
|
|
10640
|
+
setUnresolvedIds([]);
|
|
10641
|
+
return;
|
|
10642
|
+
}
|
|
10643
|
+
let isMounted = true;
|
|
10644
|
+
const fetchGroups = async () => {
|
|
10645
|
+
setLoading(true);
|
|
10646
|
+
setError(null);
|
|
10647
|
+
try {
|
|
10648
|
+
const { groups, unresolved } = await fetchPolymorphicGroups({
|
|
10649
|
+
apiUrl,
|
|
10650
|
+
rel,
|
|
10651
|
+
recordId,
|
|
10652
|
+
referenceResource: polyInfo.referenceResource,
|
|
10653
|
+
allModels
|
|
10100
10654
|
});
|
|
10101
10655
|
if (isMounted) {
|
|
10102
10656
|
setGroupedIds(groups);
|
|
@@ -10320,9 +10874,9 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
10320
10874
|
if (failed) {
|
|
10321
10875
|
throw new Error(`Save failed (${failed.status})`);
|
|
10322
10876
|
}
|
|
10323
|
-
message.success(
|
|
10877
|
+
message.success(_32("Layout preferences saved."));
|
|
10324
10878
|
} catch (error2) {
|
|
10325
|
-
message.error(error2 instanceof Error ? error2.message :
|
|
10879
|
+
message.error(error2 instanceof Error ? error2.message : _32("Failed to save layout preferences."));
|
|
10326
10880
|
} finally {
|
|
10327
10881
|
setIsSavingLayoutPrefs(false);
|
|
10328
10882
|
}
|
|
@@ -10351,9 +10905,9 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
10351
10905
|
if (!response.ok) {
|
|
10352
10906
|
throw new Error(`Save failed (${response.status})`);
|
|
10353
10907
|
}
|
|
10354
|
-
message.success(
|
|
10908
|
+
message.success(_32("Analyze preferences saved."));
|
|
10355
10909
|
} catch (error2) {
|
|
10356
|
-
message.error(error2 instanceof Error ? error2.message :
|
|
10910
|
+
message.error(error2 instanceof Error ? error2.message : _32("Failed to save analyze preferences."));
|
|
10357
10911
|
} finally {
|
|
10358
10912
|
setIsSavingAnalyzePrefs(false);
|
|
10359
10913
|
}
|
|
@@ -10456,11 +11010,11 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
10456
11010
|
const viewName = normalizeViewName(saveViewName || currentViewName);
|
|
10457
11011
|
const viewExists = availableViewNames.includes(viewName);
|
|
10458
11012
|
if (saveViewAsNew && viewExists) {
|
|
10459
|
-
message.error(
|
|
11013
|
+
message.error(_32("View name already exists. Choose a new name."));
|
|
10460
11014
|
return;
|
|
10461
11015
|
}
|
|
10462
11016
|
if (!saveViewAsNew && viewName !== currentViewName && viewExists) {
|
|
10463
|
-
message.error(
|
|
11017
|
+
message.error(_32('Choose a new name or enable "Save as new view".'));
|
|
10464
11018
|
return;
|
|
10465
11019
|
}
|
|
10466
11020
|
setSaveViewModalOpen(false);
|
|
@@ -10516,7 +11070,7 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
10516
11070
|
return;
|
|
10517
11071
|
}
|
|
10518
11072
|
if (availableViewNames.includes(newName)) {
|
|
10519
|
-
message.error(
|
|
11073
|
+
message.error(_32("View name already exists."));
|
|
10520
11074
|
return;
|
|
10521
11075
|
}
|
|
10522
11076
|
try {
|
|
@@ -10529,18 +11083,18 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
10529
11083
|
if (!response.ok) {
|
|
10530
11084
|
throw new Error(`Rename failed (${response.status})`);
|
|
10531
11085
|
}
|
|
10532
|
-
message.success(
|
|
11086
|
+
message.success(_32("View renamed."));
|
|
10533
11087
|
setRenameViewModalOpen(false);
|
|
10534
11088
|
await loadViewNames();
|
|
10535
11089
|
} catch (error2) {
|
|
10536
|
-
message.error(error2 instanceof Error ? error2.message :
|
|
11090
|
+
message.error(error2 instanceof Error ? error2.message : _32("Failed to rename view."));
|
|
10537
11091
|
}
|
|
10538
11092
|
}, [apiUrl, availableViewNames, currentViewName, relatedModel.name, relatedModel.resource, renameViewName, allModels, loadViewNames]);
|
|
10539
11093
|
const confirmDeleteView = useCallback(() => {
|
|
10540
11094
|
Modal.confirm({
|
|
10541
|
-
title:
|
|
11095
|
+
title: _32(_32("Delete view")),
|
|
10542
11096
|
content: `Delete "${currentViewName}" and all its saved preferences?`,
|
|
10543
|
-
okText:
|
|
11097
|
+
okText: _32("Delete"),
|
|
10544
11098
|
okButtonProps: { danger: true },
|
|
10545
11099
|
onOk: async () => {
|
|
10546
11100
|
try {
|
|
@@ -10553,10 +11107,10 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
10553
11107
|
if (!response.ok) {
|
|
10554
11108
|
throw new Error(`Delete failed (${response.status})`);
|
|
10555
11109
|
}
|
|
10556
|
-
message.success(
|
|
11110
|
+
message.success(_32("View deleted."));
|
|
10557
11111
|
await loadViewNames();
|
|
10558
11112
|
} catch (error2) {
|
|
10559
|
-
message.error(error2 instanceof Error ? error2.message :
|
|
11113
|
+
message.error(error2 instanceof Error ? error2.message : _32("Failed to delete view."));
|
|
10560
11114
|
}
|
|
10561
11115
|
}
|
|
10562
11116
|
});
|
|
@@ -10740,7 +11294,7 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
10740
11294
|
const direction = value?.direction || "next";
|
|
10741
11295
|
const unit = value?.unit || "weeks";
|
|
10742
11296
|
const isQuarter = unit === "quarters";
|
|
10743
|
-
const base =
|
|
11297
|
+
const base = dayjs8();
|
|
10744
11298
|
if (asRange || direction === "current") {
|
|
10745
11299
|
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);
|
|
10746
11300
|
if (isQuarter) {
|
|
@@ -10813,7 +11367,7 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
10813
11367
|
return true;
|
|
10814
11368
|
}
|
|
10815
11369
|
if (field.type === "date") {
|
|
10816
|
-
const recordDate =
|
|
11370
|
+
const recordDate = dayjs8(rawValue);
|
|
10817
11371
|
if (!recordDate.isValid()) return false;
|
|
10818
11372
|
const mode = rule.value?.mode || "absolute";
|
|
10819
11373
|
const mode2 = rule.value2?.mode || "absolute";
|
|
@@ -10821,7 +11375,7 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
10821
11375
|
if (val?.mode === "relative") {
|
|
10822
11376
|
return resolveRelativeDate(val, asRange);
|
|
10823
11377
|
}
|
|
10824
|
-
const date =
|
|
11378
|
+
const date = dayjs8(val?.date || val);
|
|
10825
11379
|
return asRange ? { start: date.startOf("day"), end: date.endOf("day") } : { date: date.startOf("day") };
|
|
10826
11380
|
};
|
|
10827
11381
|
switch (rule.operator) {
|
|
@@ -10832,13 +11386,13 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
10832
11386
|
}
|
|
10833
11387
|
case "after": {
|
|
10834
11388
|
const dateVal = mode === "relative" ? resolveRelativeDate(rule.value, false).date : getDateValue(rule.value, false).date;
|
|
10835
|
-
if (!dateVal || !
|
|
10836
|
-
return recordDate.valueOf() >
|
|
11389
|
+
if (!dateVal || !dayjs8(dateVal).isValid()) return false;
|
|
11390
|
+
return recordDate.valueOf() > dayjs8(dateVal).endOf("day").valueOf();
|
|
10837
11391
|
}
|
|
10838
11392
|
case "before": {
|
|
10839
11393
|
const dateVal = mode === "relative" ? resolveRelativeDate(rule.value, false).date : getDateValue(rule.value, false).date;
|
|
10840
|
-
if (!dateVal || !
|
|
10841
|
-
return recordDate.valueOf() <
|
|
11394
|
+
if (!dateVal || !dayjs8(dateVal).isValid()) return false;
|
|
11395
|
+
return recordDate.valueOf() < dayjs8(dateVal).startOf("day").valueOf();
|
|
10842
11396
|
}
|
|
10843
11397
|
case "between": {
|
|
10844
11398
|
const startRange = mode === "relative" ? resolveRelativeDate(rule.value, true) : getDateValue(rule.value, true);
|
|
@@ -10962,9 +11516,9 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
10962
11516
|
const deleteId = relationRow && rel.targetKey && rel.otherKey ? `${relationRow["eid_from"]}:${relationRow["eid_to"]}` : relationRow?.id ?? relationRow?.eid;
|
|
10963
11517
|
if (deleteId === void 0 || deleteId === null) return;
|
|
10964
11518
|
Modal.confirm({
|
|
10965
|
-
title:
|
|
10966
|
-
content:
|
|
10967
|
-
okText:
|
|
11519
|
+
title: _32("Delete"),
|
|
11520
|
+
content: _32("Are you sure you want to delete this relation?"),
|
|
11521
|
+
okText: _32("Delete"),
|
|
10968
11522
|
okButtonProps: { danger: true },
|
|
10969
11523
|
onOk: async () => {
|
|
10970
11524
|
try {
|
|
@@ -10985,9 +11539,9 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
10985
11539
|
const itemDeleteId = rel.targetKey && rel.otherKey ? `${itemRelationRow[rel.targetKey]}:${itemRelationRow[rel.otherKey]}` : itemRelationRow?.id ?? itemRelationRow?.eid;
|
|
10986
11540
|
return String(itemDeleteId) !== String(deleteId);
|
|
10987
11541
|
}));
|
|
10988
|
-
message.success(
|
|
11542
|
+
message.success(_32("Relation deleted."));
|
|
10989
11543
|
} catch (err) {
|
|
10990
|
-
message.error(err instanceof Error ? err.message :
|
|
11544
|
+
message.error(err instanceof Error ? err.message : _32("Failed to delete relation."));
|
|
10991
11545
|
}
|
|
10992
11546
|
}
|
|
10993
11547
|
});
|
|
@@ -11290,7 +11844,7 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
11290
11844
|
}
|
|
11291
11845
|
}, [numericFields, rankingFieldKey, rankingMode]);
|
|
11292
11846
|
const formatCategoryValue = useCallback((field, recordRow) => {
|
|
11293
|
-
if (!field) return
|
|
11847
|
+
if (!field) return _32("All");
|
|
11294
11848
|
const raw = recordRow?.[field.key];
|
|
11295
11849
|
if (raw === void 0 || raw === null) return "-";
|
|
11296
11850
|
if (field.key === "eid" && recordRow?._label) return recordRow._label;
|
|
@@ -11301,7 +11855,7 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
11301
11855
|
if (field.options) {
|
|
11302
11856
|
return field.options.find((option) => option.value === raw)?.label || String(raw);
|
|
11303
11857
|
}
|
|
11304
|
-
if (field.type === "boolean") return raw ?
|
|
11858
|
+
if (field.type === "boolean") return raw ? _32("Yes") : _32("No");
|
|
11305
11859
|
if (field.type === "date") return formatDateValue(raw);
|
|
11306
11860
|
return String(raw);
|
|
11307
11861
|
}, [labelCache]);
|
|
@@ -11393,7 +11947,7 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
11393
11947
|
const seriesLabels = numericFields.length > 0 ? numericFields.reduce((acc, field) => {
|
|
11394
11948
|
acc[field.key] = field.label;
|
|
11395
11949
|
return acc;
|
|
11396
|
-
}, { "__count__":
|
|
11950
|
+
}, { "__count__": _32("Count") }) : { "__count__": _32("Count") };
|
|
11397
11951
|
let groups = baseGroups;
|
|
11398
11952
|
if (rankingMode !== "none" && rankingFieldKey) {
|
|
11399
11953
|
const limit = Math.max(1, Math.floor(rankingN || 10));
|
|
@@ -11471,7 +12025,7 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
11471
12025
|
if (field.options) {
|
|
11472
12026
|
return field.options.find((option) => option.value === raw)?.label || String(raw);
|
|
11473
12027
|
}
|
|
11474
|
-
if (field.type === "boolean") return raw ?
|
|
12028
|
+
if (field.type === "boolean") return raw ? _32("Yes") : _32("No");
|
|
11475
12029
|
if (field.type === "date") return formatDateValue(raw);
|
|
11476
12030
|
return String(raw);
|
|
11477
12031
|
}, [labelCache]);
|
|
@@ -11674,7 +12228,7 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
11674
12228
|
if (field.options) {
|
|
11675
12229
|
return field.options.find((option) => option.value === raw)?.label || String(raw);
|
|
11676
12230
|
}
|
|
11677
|
-
if (field.type === "boolean") return raw ?
|
|
12231
|
+
if (field.type === "boolean") return raw ? _32("Yes") : _32("No");
|
|
11678
12232
|
if (field.type === "date") return formatDateValue(raw);
|
|
11679
12233
|
return String(raw);
|
|
11680
12234
|
}, [labelCache]);
|
|
@@ -11746,13 +12300,13 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
11746
12300
|
const getSummaryFunctionDisplayText = (fn) => {
|
|
11747
12301
|
if (!fn) return "";
|
|
11748
12302
|
const labels = {
|
|
11749
|
-
sum:
|
|
11750
|
-
avg:
|
|
11751
|
-
count:
|
|
11752
|
-
max:
|
|
11753
|
-
min:
|
|
11754
|
-
stddev:
|
|
11755
|
-
distinct:
|
|
12303
|
+
sum: _32("Sum"),
|
|
12304
|
+
avg: _32("Average"),
|
|
12305
|
+
count: _32("Count"),
|
|
12306
|
+
max: _32("Max"),
|
|
12307
|
+
min: _32("Min"),
|
|
12308
|
+
stddev: _32("Std Dev"),
|
|
12309
|
+
distinct: _32("Distinct")
|
|
11756
12310
|
};
|
|
11757
12311
|
return labels[fn] || fn;
|
|
11758
12312
|
};
|
|
@@ -11828,12 +12382,12 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
11828
12382
|
]
|
|
11829
12383
|
}
|
|
11830
12384
|
) }),
|
|
11831
|
-
/* @__PURE__ */ jsx(Tooltip, { title: isTotalsDetailsFlipped ?
|
|
12385
|
+
/* @__PURE__ */ jsx(Tooltip, { title: isTotalsDetailsFlipped ? _32("Show totals") : _32("Show details"), children: /* @__PURE__ */ jsx(
|
|
11832
12386
|
Button,
|
|
11833
12387
|
{
|
|
11834
12388
|
size: "small",
|
|
11835
12389
|
icon: /* @__PURE__ */ jsx(SwapOutlined, { style: { transform: "rotate(90deg)" } }),
|
|
11836
|
-
"aria-label": isTotalsDetailsFlipped ?
|
|
12390
|
+
"aria-label": isTotalsDetailsFlipped ? _32("Show totals") : _32("Show details"),
|
|
11837
12391
|
onClick: () => setIsTotalsDetailsFlipped((prev) => !prev),
|
|
11838
12392
|
style: {
|
|
11839
12393
|
flexShrink: 0,
|
|
@@ -11845,7 +12399,7 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
11845
12399
|
) })
|
|
11846
12400
|
] }),
|
|
11847
12401
|
relationRowsCapped && /* @__PURE__ */ jsxs("div", { style: { marginTop: 8, display: "flex", alignItems: "center", justifyContent: "flex-end", gap: 8, flexWrap: "wrap" }, children: [
|
|
11848
|
-
/* @__PURE__ */ jsx(Typography.Text, { type: "secondary", style: { fontSize: 12 }, children:
|
|
12402
|
+
/* @__PURE__ */ jsx(Typography.Text, { type: "secondary", style: { fontSize: 12 }, children: _32("Only the first N rows are loaded").replace("N", formatNumberValue(loadedRowsCount || relationsMaxRowsToLoad)) }),
|
|
11849
12403
|
/* @__PURE__ */ jsx(
|
|
11850
12404
|
Button,
|
|
11851
12405
|
{
|
|
@@ -11856,7 +12410,7 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
11856
12410
|
setFullDataLoaded(false);
|
|
11857
12411
|
setLoadAllRelatedRequested(true);
|
|
11858
12412
|
},
|
|
11859
|
-
children:
|
|
12413
|
+
children: _32("Load all related")
|
|
11860
12414
|
}
|
|
11861
12415
|
)
|
|
11862
12416
|
] })
|
|
@@ -11867,7 +12421,7 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
11867
12421
|
/* @__PURE__ */ jsxs("div", { style: { display: "flex", alignItems: "center", justifyContent: "space-between", gap: 12, marginBottom: 8 }, children: [
|
|
11868
12422
|
/* @__PURE__ */ jsx("div", { style: { minHeight: 22, display: "flex", alignItems: "center" }, children: title && /* @__PURE__ */ jsx(Title5, { level: 5, style: { color: relatedModelTone.text, margin: 0 }, children: title }) }),
|
|
11869
12423
|
/* @__PURE__ */ jsxs("div", { style: { display: "flex", gap: 8 }, children: [
|
|
11870
|
-
/* @__PURE__ */ jsx(Tooltip, { title: columnsSelectorOpen ?
|
|
12424
|
+
/* @__PURE__ */ jsx(Tooltip, { title: columnsSelectorOpen ? _32("Hide view configuration") : _32("Show view configuration"), children: /* @__PURE__ */ jsx(
|
|
11871
12425
|
Button,
|
|
11872
12426
|
{
|
|
11873
12427
|
size: "small",
|
|
@@ -11879,11 +12433,11 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
11879
12433
|
return next;
|
|
11880
12434
|
});
|
|
11881
12435
|
},
|
|
11882
|
-
"aria-label": columnsSelectorOpen ?
|
|
12436
|
+
"aria-label": columnsSelectorOpen ? _32("Hide view configuration") : _32("Show view configuration")
|
|
11883
12437
|
}
|
|
11884
12438
|
) }),
|
|
11885
12439
|
showCreate && recordId !== void 0 && recordId !== null && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
11886
|
-
/* @__PURE__ */ jsx(Tooltip, { title: rel.otherResource && rel.otherKey ?
|
|
12440
|
+
/* @__PURE__ */ jsx(Tooltip, { title: rel.otherResource && rel.otherKey ? _32("Associate existing") : _32("Add relation"), children: /* @__PURE__ */ jsx(
|
|
11887
12441
|
Button,
|
|
11888
12442
|
{
|
|
11889
12443
|
size: "small",
|
|
@@ -11916,7 +12470,7 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
11916
12470
|
}
|
|
11917
12471
|
}
|
|
11918
12472
|
) }),
|
|
11919
|
-
rel.otherResource && rel.otherKey && rel.targetKey && /* @__PURE__ */ jsx(Tooltip, { title:
|
|
12473
|
+
rel.otherResource && rel.otherKey && rel.targetKey && /* @__PURE__ */ jsx(Tooltip, { title: _32("Create new and relate"), children: /* @__PURE__ */ jsx(
|
|
11920
12474
|
Button,
|
|
11921
12475
|
{
|
|
11922
12476
|
size: "small",
|
|
@@ -11930,7 +12484,7 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
11930
12484
|
const relatedModel2 = findModelByName(allModels, rel.otherResource || rel.otherResourcePath);
|
|
11931
12485
|
const relatedResource = relatedModel2 ? resolveResourcePath(relatedModel2.resource || relatedModel2.name, allModels) : null;
|
|
11932
12486
|
if (!relatedResource) {
|
|
11933
|
-
message.warning(
|
|
12487
|
+
message.warning(_32("No create route for the related model. Opening relation create form."));
|
|
11934
12488
|
params.append(rel.targetKey, String(recordId));
|
|
11935
12489
|
if (allowInlineEdit) params.append("inline", "1");
|
|
11936
12490
|
const returnTo2 = `${location.pathname}${location.search}${location.hash}`;
|
|
@@ -11949,7 +12503,7 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
11949
12503
|
}
|
|
11950
12504
|
) })
|
|
11951
12505
|
] }),
|
|
11952
|
-
allowInlineEdit && /* @__PURE__ */ jsx(Tooltip, { title:
|
|
12506
|
+
allowInlineEdit && /* @__PURE__ */ jsx(Tooltip, { title: _32("Save"), children: /* @__PURE__ */ jsx(
|
|
11953
12507
|
Button,
|
|
11954
12508
|
{
|
|
11955
12509
|
size: "small",
|
|
@@ -11957,10 +12511,10 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
11957
12511
|
icon: /* @__PURE__ */ jsx(SaveOutlined, {}),
|
|
11958
12512
|
onClick: saveAllEdits,
|
|
11959
12513
|
loading: savingAll,
|
|
11960
|
-
"aria-label":
|
|
12514
|
+
"aria-label": _32("Save")
|
|
11961
12515
|
}
|
|
11962
12516
|
) }),
|
|
11963
|
-
/* @__PURE__ */ jsx(Tooltip, { title:
|
|
12517
|
+
/* @__PURE__ */ jsx(Tooltip, { title: _32("Export CSV"), children: /* @__PURE__ */ jsx(
|
|
11964
12518
|
Button,
|
|
11965
12519
|
{
|
|
11966
12520
|
size: "small",
|
|
@@ -11975,20 +12529,20 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
11975
12529
|
Modal,
|
|
11976
12530
|
{
|
|
11977
12531
|
open: saveViewModalOpen,
|
|
11978
|
-
title:
|
|
12532
|
+
title: _32("Save view"),
|
|
11979
12533
|
onCancel: () => {
|
|
11980
12534
|
setSaveViewModalOpen(false);
|
|
11981
12535
|
setPendingSaveTarget(null);
|
|
11982
12536
|
},
|
|
11983
12537
|
onOk: handleConfirmSaveView,
|
|
11984
|
-
okText: pendingSaveTarget === "layout" ?
|
|
12538
|
+
okText: pendingSaveTarget === "layout" ? _32("Save layout") : _32("Save analyze"),
|
|
11985
12539
|
okButtonProps: { disabled: !pendingSaveTarget },
|
|
11986
12540
|
children: /* @__PURE__ */ jsxs("div", { style: { display: "grid", gap: 12 }, children: [
|
|
11987
12541
|
/* @__PURE__ */ jsxs("div", { children: [
|
|
11988
|
-
/* @__PURE__ */ jsx("div", { style: { fontSize: 12, color: token.colorTextSecondary, marginBottom: 4 }, children:
|
|
12542
|
+
/* @__PURE__ */ jsx("div", { style: { fontSize: 12, color: token.colorTextSecondary, marginBottom: 4 }, children: _32("View name") }),
|
|
11989
12543
|
/* @__PURE__ */ jsx(Input, { value: saveViewName, onChange: (event) => setSaveViewName(event.target.value) })
|
|
11990
12544
|
] }),
|
|
11991
|
-
/* @__PURE__ */ jsx(Checkbox, { checked: saveViewAsNew, onChange: (event) => setSaveViewAsNew(event.target.checked), children:
|
|
12545
|
+
/* @__PURE__ */ jsx(Checkbox, { checked: saveViewAsNew, onChange: (event) => setSaveViewAsNew(event.target.checked), children: _32("Save as new view") })
|
|
11992
12546
|
] })
|
|
11993
12547
|
}
|
|
11994
12548
|
),
|
|
@@ -11996,10 +12550,10 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
11996
12550
|
Modal,
|
|
11997
12551
|
{
|
|
11998
12552
|
open: renameViewModalOpen,
|
|
11999
|
-
title:
|
|
12553
|
+
title: _32("Rename view"),
|
|
12000
12554
|
onCancel: () => setRenameViewModalOpen(false),
|
|
12001
12555
|
onOk: handleRenameView,
|
|
12002
|
-
okText:
|
|
12556
|
+
okText: _32("Rename"),
|
|
12003
12557
|
children: /* @__PURE__ */ jsx(Input, { value: renameViewName, onChange: (event) => setRenameViewName(event.target.value) })
|
|
12004
12558
|
}
|
|
12005
12559
|
),
|
|
@@ -12009,11 +12563,11 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
12009
12563
|
{
|
|
12010
12564
|
size: "small",
|
|
12011
12565
|
title: /* @__PURE__ */ jsxs("div", { style: { display: "flex", alignItems: "center", justifyContent: "space-between", gap: 12, flexWrap: "wrap" }, children: [
|
|
12012
|
-
/* @__PURE__ */ jsx("span", { style: { color: token.colorTextSecondary, fontSize: 12, fontWeight: 600 }, children:
|
|
12566
|
+
/* @__PURE__ */ jsx("span", { style: { color: token.colorTextSecondary, fontSize: 12, fontWeight: 600 }, children: _32("Filters") }),
|
|
12013
12567
|
/* @__PURE__ */ jsx("div", { style: { display: "flex", alignItems: "center", gap: 8, flex: 1, justifyContent: "flex-end" }, children: /* @__PURE__ */ jsx(
|
|
12014
12568
|
Input,
|
|
12015
12569
|
{
|
|
12016
|
-
placeholder:
|
|
12570
|
+
placeholder: _32("Search all fields..."),
|
|
12017
12571
|
prefix: /* @__PURE__ */ jsx(SearchOutlined, {}),
|
|
12018
12572
|
allowClear: true,
|
|
12019
12573
|
value: localSearch,
|
|
@@ -12031,31 +12585,31 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
12031
12585
|
Card,
|
|
12032
12586
|
{
|
|
12033
12587
|
size: "small",
|
|
12034
|
-
title: /* @__PURE__ */ jsx("span", { style: { color: token.colorTextSecondary, fontSize: 12, fontWeight: 600 }, children:
|
|
12588
|
+
title: /* @__PURE__ */ jsx("span", { style: { color: token.colorTextSecondary, fontSize: 12, fontWeight: 600 }, children: _32("View configuration") }),
|
|
12035
12589
|
style: { marginBottom: 16 },
|
|
12036
12590
|
styles: { body: { display: "grid", gap: 12 } },
|
|
12037
12591
|
children: [
|
|
12038
12592
|
/* @__PURE__ */ jsxs("div", { style: { display: "grid", gap: 12 }, children: [
|
|
12039
12593
|
/* @__PURE__ */ jsxs("div", { style: { display: "grid", gap: 8 }, children: [
|
|
12040
|
-
/* @__PURE__ */ jsx("div", { style: { fontSize: 12, color: token.colorTextSecondary, fontWeight: 600 }, children:
|
|
12041
|
-
filterRules.length === 0 ? /* @__PURE__ */ jsx("div", { style: { color: token.colorTextSecondary, fontSize: 12 }, children:
|
|
12594
|
+
/* @__PURE__ */ jsx("div", { style: { fontSize: 12, color: token.colorTextSecondary, fontWeight: 600 }, children: _32("Advanced filters") }),
|
|
12595
|
+
filterRules.length === 0 ? /* @__PURE__ */ jsx("div", { style: { color: token.colorTextSecondary, fontSize: 12 }, children: _32("No filters yet.") }) : filterRules.map((rule) => {
|
|
12042
12596
|
const field = relatedModel.fields.find((f) => f.key === rule.fieldKey);
|
|
12043
12597
|
const type = field?.type || "string";
|
|
12044
12598
|
const operatorOptions = type === "number" ? [
|
|
12045
|
-
{ label:
|
|
12046
|
-
{ label:
|
|
12047
|
-
{ label:
|
|
12048
|
-
{ label:
|
|
12049
|
-
{ label:
|
|
12050
|
-
{ label:
|
|
12599
|
+
{ label: _32("="), value: "eq" },
|
|
12600
|
+
{ label: _32(">"), value: "gt" },
|
|
12601
|
+
{ label: _32(">="), value: "gte" },
|
|
12602
|
+
{ label: _32("<"), value: "lt" },
|
|
12603
|
+
{ label: _32("<="), value: "lte" },
|
|
12604
|
+
{ label: _32("Between"), value: "between" }
|
|
12051
12605
|
] : type === "date" ? [
|
|
12052
|
-
{ label:
|
|
12053
|
-
{ label:
|
|
12054
|
-
{ label:
|
|
12055
|
-
{ label:
|
|
12056
|
-
] : type === "boolean" ? [{ label:
|
|
12057
|
-
{ label:
|
|
12058
|
-
{ label:
|
|
12606
|
+
{ label: _32("On"), value: "on" },
|
|
12607
|
+
{ label: _32("After"), value: "after" },
|
|
12608
|
+
{ label: _32("Before"), value: "before" },
|
|
12609
|
+
{ label: _32("Between"), value: "between" }
|
|
12610
|
+
] : type === "boolean" ? [{ label: _32("Is"), value: "is" }] : [
|
|
12611
|
+
{ label: _32("Contains"), value: "contains" },
|
|
12612
|
+
{ label: _32("Equals"), value: "equals" }
|
|
12059
12613
|
];
|
|
12060
12614
|
const renderDateInput = (value, onChange) => {
|
|
12061
12615
|
const mode = value?.mode || "absolute";
|
|
@@ -12068,9 +12622,9 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
12068
12622
|
value: value?.direction || "next",
|
|
12069
12623
|
onChange: (val) => onChange({ ...value, mode: "relative", direction: val }),
|
|
12070
12624
|
options: [
|
|
12071
|
-
{ label:
|
|
12072
|
-
{ label:
|
|
12073
|
-
{ label:
|
|
12625
|
+
{ label: _32("Previous"), value: "previous" },
|
|
12626
|
+
{ label: _32("Current"), value: "current" },
|
|
12627
|
+
{ label: _32("Next"), value: "next" }
|
|
12074
12628
|
]
|
|
12075
12629
|
}
|
|
12076
12630
|
),
|
|
@@ -12080,11 +12634,11 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
12080
12634
|
value: value?.unit || "weeks",
|
|
12081
12635
|
onChange: (val) => onChange({ ...value, mode: "relative", unit: val }),
|
|
12082
12636
|
options: [
|
|
12083
|
-
{ label:
|
|
12084
|
-
{ label:
|
|
12085
|
-
{ label:
|
|
12086
|
-
{ label:
|
|
12087
|
-
{ label:
|
|
12637
|
+
{ label: _32("Days"), value: "days" },
|
|
12638
|
+
{ label: _32("Weeks"), value: "weeks" },
|
|
12639
|
+
{ label: _32("Months"), value: "months" },
|
|
12640
|
+
{ label: _32("Quarters"), value: "quarters" },
|
|
12641
|
+
{ label: _32("Years"), value: "years" }
|
|
12088
12642
|
]
|
|
12089
12643
|
}
|
|
12090
12644
|
)
|
|
@@ -12093,7 +12647,7 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
12093
12647
|
return /* @__PURE__ */ jsx(
|
|
12094
12648
|
DatePicker,
|
|
12095
12649
|
{
|
|
12096
|
-
value: value?.date ?
|
|
12650
|
+
value: value?.date ? dayjs8(value.date) : void 0,
|
|
12097
12651
|
onChange: (val) => onChange({ mode: "absolute", date: val ? val.toISOString() : null })
|
|
12098
12652
|
}
|
|
12099
12653
|
);
|
|
@@ -12106,7 +12660,7 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
12106
12660
|
value: rule.fieldKey,
|
|
12107
12661
|
onChange: (value) => setFilterRules((prev) => prev.map((item) => item.id === rule.id ? { ...item, fieldKey: value, operator: void 0, value: void 0, value2: void 0 } : item)),
|
|
12108
12662
|
options: relatedModel.fields.map((f) => ({ label: f.label, value: f.key })),
|
|
12109
|
-
placeholder:
|
|
12663
|
+
placeholder: _32("Field")
|
|
12110
12664
|
}
|
|
12111
12665
|
),
|
|
12112
12666
|
/* @__PURE__ */ jsx(
|
|
@@ -12116,7 +12670,7 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
12116
12670
|
value: rule.operator,
|
|
12117
12671
|
onChange: (value) => setFilterRules((prev) => prev.map((item) => item.id === rule.id ? { ...item, operator: value } : item)),
|
|
12118
12672
|
options: operatorOptions,
|
|
12119
|
-
placeholder:
|
|
12673
|
+
placeholder: _32("Operator")
|
|
12120
12674
|
}
|
|
12121
12675
|
),
|
|
12122
12676
|
type === "number" && rule.operator === "between" && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
@@ -12149,10 +12703,10 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
12149
12703
|
value: rule.value,
|
|
12150
12704
|
onChange: (value) => setFilterRules((prev) => prev.map((item) => item.id === rule.id ? { ...item, value } : item)),
|
|
12151
12705
|
options: [
|
|
12152
|
-
{ label:
|
|
12153
|
-
{ label:
|
|
12706
|
+
{ label: _32("True"), value: true },
|
|
12707
|
+
{ label: _32("False"), value: false }
|
|
12154
12708
|
],
|
|
12155
|
-
placeholder:
|
|
12709
|
+
placeholder: _32("Value")
|
|
12156
12710
|
}
|
|
12157
12711
|
),
|
|
12158
12712
|
type === "date" && rule.operator === "between" && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
@@ -12165,7 +12719,7 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
12165
12719
|
{
|
|
12166
12720
|
value: rule.value,
|
|
12167
12721
|
onChange: (event) => setFilterRules((prev) => prev.map((item) => item.id === rule.id ? { ...item, value: event.target.value } : item)),
|
|
12168
|
-
placeholder:
|
|
12722
|
+
placeholder: _32("Value"),
|
|
12169
12723
|
style: { minWidth: 200 }
|
|
12170
12724
|
}
|
|
12171
12725
|
),
|
|
@@ -12178,8 +12732,8 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
12178
12732
|
setFilterRules((prev) => prev.map((item) => item.id === rule.id ? { ...item, value: { ...item.value || {}, mode: val } } : item));
|
|
12179
12733
|
},
|
|
12180
12734
|
options: [
|
|
12181
|
-
{ label:
|
|
12182
|
-
{ label:
|
|
12735
|
+
{ label: _32("Date"), value: "absolute" },
|
|
12736
|
+
{ label: _32("Relative"), value: "relative" }
|
|
12183
12737
|
]
|
|
12184
12738
|
}
|
|
12185
12739
|
),
|
|
@@ -12192,8 +12746,8 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
12192
12746
|
setFilterRules((prev) => prev.map((item) => item.id === rule.id ? { ...item, value2: { ...item.value2 || {}, mode: val } } : item));
|
|
12193
12747
|
},
|
|
12194
12748
|
options: [
|
|
12195
|
-
{ label:
|
|
12196
|
-
{ label:
|
|
12749
|
+
{ label: _32("Date"), value: "absolute" },
|
|
12750
|
+
{ label: _32("Relative"), value: "relative" }
|
|
12197
12751
|
]
|
|
12198
12752
|
}
|
|
12199
12753
|
),
|
|
@@ -12203,7 +12757,7 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
12203
12757
|
size: "small",
|
|
12204
12758
|
danger: true,
|
|
12205
12759
|
onClick: () => setFilterRules((prev) => prev.filter((item) => item.id !== rule.id)),
|
|
12206
|
-
children:
|
|
12760
|
+
children: _32("Remove")
|
|
12207
12761
|
}
|
|
12208
12762
|
)
|
|
12209
12763
|
] }, rule.id);
|
|
@@ -12215,14 +12769,14 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
12215
12769
|
size: "small",
|
|
12216
12770
|
icon: /* @__PURE__ */ jsx(FilterOutlined, {}),
|
|
12217
12771
|
onClick: () => setFilterRules((prev) => [...prev, { id: `${Date.now()}-${Math.random()}` }]),
|
|
12218
|
-
children:
|
|
12772
|
+
children: _32("Add Filter")
|
|
12219
12773
|
}
|
|
12220
12774
|
),
|
|
12221
|
-
filterRules.length > 0 && /* @__PURE__ */ jsx(Button, { size: "small", onClick: () => setFilterRules([]), children:
|
|
12775
|
+
filterRules.length > 0 && /* @__PURE__ */ jsx(Button, { size: "small", onClick: () => setFilterRules([]), children: _32("Clear filters") })
|
|
12222
12776
|
] })
|
|
12223
12777
|
] }),
|
|
12224
12778
|
/* @__PURE__ */ jsxs("div", { style: { display: "grid", gap: 6 }, children: [
|
|
12225
|
-
/* @__PURE__ */ jsx("div", { style: { fontSize: 12, color: token.colorTextSecondary, fontWeight: 600 }, children:
|
|
12779
|
+
/* @__PURE__ */ jsx("div", { style: { fontSize: 12, color: token.colorTextSecondary, fontWeight: 600 }, children: _32("Views shown") }),
|
|
12226
12780
|
/* @__PURE__ */ jsx(
|
|
12227
12781
|
Select,
|
|
12228
12782
|
{
|
|
@@ -12243,12 +12797,12 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
12243
12797
|
),
|
|
12244
12798
|
selectedViewNames.length > 1 && /* @__PURE__ */ jsx("div", { style: { display: "grid", gap: 6 }, children: selectedViewNames.map((name, index) => /* @__PURE__ */ jsxs("div", { style: { display: "flex", alignItems: "center", gap: 8 }, children: [
|
|
12245
12799
|
/* @__PURE__ */ jsx("div", { style: { flex: 1 }, children: name }),
|
|
12246
|
-
/* @__PURE__ */ jsx(Tooltip, { title:
|
|
12247
|
-
/* @__PURE__ */ jsx(Tooltip, { title:
|
|
12800
|
+
/* @__PURE__ */ jsx(Tooltip, { title: _32("Move up"), children: /* @__PURE__ */ jsx(Button, { size: "small", icon: /* @__PURE__ */ jsx(ArrowUpOutlined, {}), disabled: index === 0, onClick: () => moveSelectedView(name, "up") }) }),
|
|
12801
|
+
/* @__PURE__ */ jsx(Tooltip, { title: _32("Move down"), children: /* @__PURE__ */ jsx(Button, { size: "small", icon: /* @__PURE__ */ jsx(ArrowDownOutlined, {}), disabled: index === selectedViewNames.length - 1, onClick: () => moveSelectedView(name, "down") }) })
|
|
12248
12802
|
] }, name)) })
|
|
12249
12803
|
] }),
|
|
12250
12804
|
/* @__PURE__ */ jsxs("div", { style: { display: "grid", gap: 6 }, children: [
|
|
12251
|
-
/* @__PURE__ */ jsx("div", { style: { fontSize: 12, color: token.colorTextSecondary, fontWeight: 600 }, children:
|
|
12805
|
+
/* @__PURE__ */ jsx("div", { style: { fontSize: 12, color: token.colorTextSecondary, fontWeight: 600 }, children: _32("Active view") }),
|
|
12252
12806
|
viewSelector
|
|
12253
12807
|
] }),
|
|
12254
12808
|
/* @__PURE__ */ jsxs("div", { style: { display: "flex", flexWrap: "wrap", alignItems: "center", gap: 8 }, children: [
|
|
@@ -12260,7 +12814,7 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
12260
12814
|
setRenameViewName(currentViewName);
|
|
12261
12815
|
setRenameViewModalOpen(true);
|
|
12262
12816
|
},
|
|
12263
|
-
children:
|
|
12817
|
+
children: _32("Rename view")
|
|
12264
12818
|
}
|
|
12265
12819
|
),
|
|
12266
12820
|
/* @__PURE__ */ jsx(
|
|
@@ -12271,7 +12825,7 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
12271
12825
|
icon: /* @__PURE__ */ jsx(DeleteOutlined, {}),
|
|
12272
12826
|
disabled: availableViewNames.length <= 1,
|
|
12273
12827
|
onClick: confirmDeleteView,
|
|
12274
|
-
children:
|
|
12828
|
+
children: _32("Delete view")
|
|
12275
12829
|
}
|
|
12276
12830
|
),
|
|
12277
12831
|
layoutPreferenceType && /* @__PURE__ */ jsx(
|
|
@@ -12281,7 +12835,7 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
12281
12835
|
icon: /* @__PURE__ */ jsx(SaveOutlined, {}),
|
|
12282
12836
|
onClick: () => openSaveViewModalFor("layout"),
|
|
12283
12837
|
loading: isSavingLayoutPrefs,
|
|
12284
|
-
children:
|
|
12838
|
+
children: _32("Save layout")
|
|
12285
12839
|
}
|
|
12286
12840
|
),
|
|
12287
12841
|
/* @__PURE__ */ jsx(
|
|
@@ -12293,7 +12847,7 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
12293
12847
|
markLayoutPrefsTouched();
|
|
12294
12848
|
setFiltersCollapsed((prev) => !prev);
|
|
12295
12849
|
},
|
|
12296
|
-
children: filtersCollapsed ?
|
|
12850
|
+
children: filtersCollapsed ? _32("Show Filters") : _32("Hide Filters")
|
|
12297
12851
|
}
|
|
12298
12852
|
),
|
|
12299
12853
|
/* @__PURE__ */ jsx(
|
|
@@ -12305,7 +12859,7 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
12305
12859
|
markLayoutPrefsTouched();
|
|
12306
12860
|
setListVisible((prev) => !prev);
|
|
12307
12861
|
},
|
|
12308
|
-
children:
|
|
12862
|
+
children: _32("View list")
|
|
12309
12863
|
}
|
|
12310
12864
|
),
|
|
12311
12865
|
/* @__PURE__ */ jsx(
|
|
@@ -12319,7 +12873,7 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
12319
12873
|
setIsStatsFlipped(false);
|
|
12320
12874
|
setAnalyzeOpen((prev) => !prev);
|
|
12321
12875
|
},
|
|
12322
|
-
children:
|
|
12876
|
+
children: _32("Analyze")
|
|
12323
12877
|
}
|
|
12324
12878
|
),
|
|
12325
12879
|
/* @__PURE__ */ jsx(
|
|
@@ -12331,7 +12885,7 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
12331
12885
|
markLayoutPrefsTouched();
|
|
12332
12886
|
setIsAnalyzeVertical((prev) => !prev);
|
|
12333
12887
|
},
|
|
12334
|
-
children:
|
|
12888
|
+
children: _32("Switch orientation")
|
|
12335
12889
|
}
|
|
12336
12890
|
),
|
|
12337
12891
|
/* @__PURE__ */ jsx(
|
|
@@ -12343,21 +12897,21 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
12343
12897
|
markLayoutPrefsTouched();
|
|
12344
12898
|
setIsAnalyzeFirst((prev) => !prev);
|
|
12345
12899
|
},
|
|
12346
|
-
children:
|
|
12900
|
+
children: _32("Switch positions")
|
|
12347
12901
|
}
|
|
12348
12902
|
)
|
|
12349
12903
|
] })
|
|
12350
12904
|
] }),
|
|
12351
12905
|
/* @__PURE__ */ jsxs("div", { style: { display: "grid", gap: 12 }, children: [
|
|
12352
12906
|
/* @__PURE__ */ jsxs("div", { style: { display: "flex", alignItems: "center", justifyContent: "space-between", gap: 12 }, children: [
|
|
12353
|
-
/* @__PURE__ */ jsx("span", { style: { color: token.colorTextSecondary, fontSize: 12, fontWeight: 600 }, children:
|
|
12907
|
+
/* @__PURE__ */ jsx("span", { style: { color: token.colorTextSecondary, fontSize: 12, fontWeight: 600 }, children: _32("Columns") }),
|
|
12354
12908
|
selectedColumnKeys && selectedColumnKeys.length > 0 && /* @__PURE__ */ jsx(Button, { size: "small", onClick: () => {
|
|
12355
12909
|
setSelectedColumnKeys(null);
|
|
12356
12910
|
setColumnOrder(null);
|
|
12357
|
-
}, children:
|
|
12911
|
+
}, children: _32("Reset to default") })
|
|
12358
12912
|
] }),
|
|
12359
12913
|
/* @__PURE__ */ jsxs("div", { children: [
|
|
12360
|
-
/* @__PURE__ */ jsx("div", { style: { fontSize: 12, color: token.colorTextSecondary, marginBottom: 6 }, children:
|
|
12914
|
+
/* @__PURE__ */ jsx("div", { style: { fontSize: 12, color: token.colorTextSecondary, marginBottom: 6 }, children: _32("Select columns") }),
|
|
12361
12915
|
/* @__PURE__ */ jsx(
|
|
12362
12916
|
Checkbox.Group,
|
|
12363
12917
|
{
|
|
@@ -12369,27 +12923,27 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
12369
12923
|
(!selectedColumnKeys || selectedColumnKeys.length === 0) && /* @__PURE__ */ jsx("div", { style: { fontSize: 12, color: token.colorTextSecondary, marginTop: 6 }, children: "Using default columns. Select fields to customize." })
|
|
12370
12924
|
] }),
|
|
12371
12925
|
/* @__PURE__ */ jsxs("div", { children: [
|
|
12372
|
-
/* @__PURE__ */ jsx("div", { style: { fontSize: 12, color: token.colorTextSecondary, marginBottom: 6 }, children:
|
|
12373
|
-
orderedSelectedColumns.length === 0 ? /* @__PURE__ */ jsx("div", { style: { fontSize: 12, color: token.colorTextSecondary }, children:
|
|
12926
|
+
/* @__PURE__ */ jsx("div", { style: { fontSize: 12, color: token.colorTextSecondary, marginBottom: 6 }, children: _32("Column order") }),
|
|
12927
|
+
orderedSelectedColumns.length === 0 ? /* @__PURE__ */ jsx("div", { style: { fontSize: 12, color: token.colorTextSecondary }, children: _32("No custom order yet.") }) : orderedSelectedColumns.map((key, index) => {
|
|
12374
12928
|
const field = relatedModel.fields.find((item) => item.key === key);
|
|
12375
12929
|
if (!field) return null;
|
|
12376
12930
|
return /* @__PURE__ */ jsxs("div", { style: { display: "flex", alignItems: "center", gap: 8, marginBottom: 4 }, children: [
|
|
12377
12931
|
/* @__PURE__ */ jsx("div", { style: { flex: 1 }, children: field.label }),
|
|
12378
|
-
/* @__PURE__ */ jsx(Tooltip, { title:
|
|
12379
|
-
/* @__PURE__ */ jsx(Tooltip, { title:
|
|
12932
|
+
/* @__PURE__ */ jsx(Tooltip, { title: _32("Move left"), children: /* @__PURE__ */ jsx(Button, { size: "small", icon: /* @__PURE__ */ jsx(ArrowLeftOutlined, {}), disabled: index === 0, onClick: () => moveColumnOrder(key, "left") }) }),
|
|
12933
|
+
/* @__PURE__ */ jsx(Tooltip, { title: _32("Move right"), children: /* @__PURE__ */ jsx(Button, { size: "small", icon: /* @__PURE__ */ jsx(ArrowRightOutlined, {}), disabled: index === orderedSelectedColumns.length - 1, onClick: () => moveColumnOrder(key, "right") }) })
|
|
12380
12934
|
] }, key);
|
|
12381
12935
|
})
|
|
12382
12936
|
] }),
|
|
12383
12937
|
/* @__PURE__ */ jsxs("div", { children: [
|
|
12384
|
-
/* @__PURE__ */ jsx("div", { style: { fontSize: 12, color: token.colorTextSecondary, marginBottom: 6 }, children:
|
|
12385
|
-
/* @__PURE__ */ jsx("div", { style: { display: "grid", gap: 6 }, children: totalsSummaryConfigFields.length === 0 ? /* @__PURE__ */ jsx("div", { style: { fontSize: 12, color: token.colorTextSecondary }, children:
|
|
12938
|
+
/* @__PURE__ */ jsx("div", { style: { fontSize: 12, color: token.colorTextSecondary, marginBottom: 6 }, children: _32("Totals summary function") }),
|
|
12939
|
+
/* @__PURE__ */ jsx("div", { style: { display: "grid", gap: 6 }, children: totalsSummaryConfigFields.length === 0 ? /* @__PURE__ */ jsx("div", { style: { fontSize: 12, color: token.colorTextSecondary }, children: _32("No numeric fields available.") }) : totalsSummaryConfigFields.map((field) => {
|
|
12386
12940
|
const options = [
|
|
12387
|
-
{ label:
|
|
12388
|
-
{ label:
|
|
12389
|
-
{ label:
|
|
12390
|
-
{ label:
|
|
12391
|
-
{ label:
|
|
12392
|
-
{ label:
|
|
12941
|
+
{ label: _32("Sum"), value: "sum" },
|
|
12942
|
+
{ label: _32("Average"), value: "avg" },
|
|
12943
|
+
{ label: _32("Count"), value: "count" },
|
|
12944
|
+
{ label: _32("Max"), value: "max" },
|
|
12945
|
+
{ label: _32("Min"), value: "min" },
|
|
12946
|
+
{ label: _32("Std Dev"), value: "stddev" }
|
|
12393
12947
|
];
|
|
12394
12948
|
return /* @__PURE__ */ jsxs("div", { style: { display: "flex", alignItems: "center", gap: 8 }, children: [
|
|
12395
12949
|
/* @__PURE__ */ jsx("div", { style: { flex: 1 }, children: field.label }),
|
|
@@ -12443,7 +12997,7 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
12443
12997
|
setCurrentPage(1);
|
|
12444
12998
|
}
|
|
12445
12999
|
},
|
|
12446
|
-
onShowSizeChange: (
|
|
13000
|
+
onShowSizeChange: (_41, newPageSize) => {
|
|
12447
13001
|
if (newPageSize && newPageSize !== pageSize) {
|
|
12448
13002
|
setPageSize(newPageSize);
|
|
12449
13003
|
setCurrentPage(1);
|
|
@@ -12452,8 +13006,8 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
12452
13006
|
},
|
|
12453
13007
|
size: "small",
|
|
12454
13008
|
rowKey: (row) => row?.__relationKey || row?.eid || row?.id || JSON.stringify(row),
|
|
12455
|
-
locale: filteredRows.length === 0 ? { emptyText: /* @__PURE__ */ jsx("span", { style: { display: "inline-block", fontSize: 12, color: "#8c8c8c" }, children:
|
|
12456
|
-
onChange: (
|
|
13009
|
+
locale: filteredRows.length === 0 ? { emptyText: /* @__PURE__ */ jsx("span", { style: { display: "inline-block", fontSize: 12, color: "#8c8c8c" }, children: _32("No related records") }) } : void 0,
|
|
13010
|
+
onChange: (_41, filters, sorter, extra) => {
|
|
12457
13011
|
const nextFilters = {};
|
|
12458
13012
|
Object.entries(filters || {}).forEach(([key, values]) => {
|
|
12459
13013
|
if (!values) return;
|
|
@@ -12521,7 +13075,7 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
12521
13075
|
const recordValue = recordRow?.[field.key];
|
|
12522
13076
|
return String(recordValue) === String(value);
|
|
12523
13077
|
},
|
|
12524
|
-
align: field.type === "number" && !["eid", "eid_from", "eid_to"].includes(field.key) ? "right" : void 0,
|
|
13078
|
+
align: field.type === "number" && !field.reference && !["eid", "eid_from", "eid_to"].includes(field.key) ? "right" : void 0,
|
|
12525
13079
|
render: (value, row) => {
|
|
12526
13080
|
if (allowInlineEdit && field.key !== "eid") {
|
|
12527
13081
|
const rowId = row?.eid ?? row?.id ?? row?.__relationKey;
|
|
@@ -12531,12 +13085,16 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
12531
13085
|
name: [rowId, field.key],
|
|
12532
13086
|
style: { margin: 0 },
|
|
12533
13087
|
valuePropName: field.type === "boolean" ? "checked" : "value",
|
|
12534
|
-
getValueProps: (val) => (field.type === "date" || field.type === "datetime") && val ? { value:
|
|
13088
|
+
getValueProps: (val) => (field.type === "date" || field.type === "datetime") && val ? { value: dayjs8(val) } : field.type === "time" && val ? { value: dayjs8("1970-01-01T" + val) } : { value: val },
|
|
12535
13089
|
children: renderEditableInput(field, rowId)
|
|
12536
13090
|
}
|
|
12537
13091
|
);
|
|
12538
13092
|
}
|
|
12539
13093
|
const renderValue = () => {
|
|
13094
|
+
const showToken = normalizeFieldViewType(field.showViewType || "");
|
|
13095
|
+
if (showToken && !(showToken === "read-only-field" && field.reference)) {
|
|
13096
|
+
return renderFieldValue(field, row, allModels, true);
|
|
13097
|
+
}
|
|
12540
13098
|
if (field.reference && value) {
|
|
12541
13099
|
const cacheKey = `${field.reference}:${value}`;
|
|
12542
13100
|
return labelCache[cacheKey] || value;
|
|
@@ -12578,7 +13136,7 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
12578
13136
|
showActions && /* @__PURE__ */ jsx(
|
|
12579
13137
|
Table.Column,
|
|
12580
13138
|
{
|
|
12581
|
-
title:
|
|
13139
|
+
title: _32("Actions"),
|
|
12582
13140
|
width: 140,
|
|
12583
13141
|
render: (_unused, row) => {
|
|
12584
13142
|
const id = row?.eid ?? row?.id;
|
|
@@ -12586,14 +13144,14 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
12586
13144
|
const deleteId = relationRow && rel.targetKey && rel.otherKey ? `${relationRow["eid_from"]}:${relationRow["eid_to"]}` : relationRow?.id ?? relationRow?.eid;
|
|
12587
13145
|
return /* @__PURE__ */ jsxs(Space, { children: [
|
|
12588
13146
|
id && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
12589
|
-
/* @__PURE__ */ jsx(Tooltip, { title:
|
|
13147
|
+
/* @__PURE__ */ jsx(Tooltip, { title: _32("View"), children: /* @__PURE__ */ jsx(Button, { size: "small", icon: /* @__PURE__ */ jsx(EyeOutlined, {}), onClick: () => {
|
|
12590
13148
|
if (paneNav?.isInMultiPane) {
|
|
12591
13149
|
paneNav.openDetail(relatedModel.name, id);
|
|
12592
13150
|
} else {
|
|
12593
13151
|
go({ to: { resource: relatedModel.name, action: "show", id } });
|
|
12594
13152
|
}
|
|
12595
13153
|
} }) }),
|
|
12596
|
-
/* @__PURE__ */ jsx(Tooltip, { title:
|
|
13154
|
+
/* @__PURE__ */ jsx(Tooltip, { title: _32("Edit"), children: /* @__PURE__ */ jsx(Button, { size: "small", icon: /* @__PURE__ */ jsx(EditOutlined, {}), onClick: () => {
|
|
12597
13155
|
if (allowInlineEdit) {
|
|
12598
13156
|
const params = new URLSearchParams();
|
|
12599
13157
|
params.append("inline", "1");
|
|
@@ -12605,7 +13163,7 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
12605
13163
|
}
|
|
12606
13164
|
} }) })
|
|
12607
13165
|
] }),
|
|
12608
|
-
deleteId && /* @__PURE__ */ jsx(Tooltip, { title:
|
|
13166
|
+
deleteId && /* @__PURE__ */ jsx(Tooltip, { title: _32("Delete"), children: /* @__PURE__ */ jsx(
|
|
12609
13167
|
Button,
|
|
12610
13168
|
{
|
|
12611
13169
|
size: "small",
|
|
@@ -12625,7 +13183,7 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
12625
13183
|
}
|
|
12626
13184
|
),
|
|
12627
13185
|
relationRowsCapped && /* @__PURE__ */ jsxs("div", { style: { marginTop: 8, display: "flex", alignItems: "center", justifyContent: "flex-end", gap: 8, flexWrap: "wrap" }, children: [
|
|
12628
|
-
/* @__PURE__ */ jsx(Typography.Text, { type: "secondary", style: { fontSize: 12 }, children:
|
|
13186
|
+
/* @__PURE__ */ jsx(Typography.Text, { type: "secondary", style: { fontSize: 12 }, children: _32("Only the first N rows are loaded").replace("N", formatNumberValue(loadedRowsCount || relationsMaxRowsToLoad)) }),
|
|
12629
13187
|
/* @__PURE__ */ jsx(
|
|
12630
13188
|
Button,
|
|
12631
13189
|
{
|
|
@@ -12635,7 +13193,7 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
12635
13193
|
setFullDataLoaded(false);
|
|
12636
13194
|
setLoadAllRelatedRequested(true);
|
|
12637
13195
|
},
|
|
12638
|
-
children:
|
|
13196
|
+
children: _32("Load all related")
|
|
12639
13197
|
}
|
|
12640
13198
|
)
|
|
12641
13199
|
] })
|
|
@@ -12645,7 +13203,7 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
12645
13203
|
Card,
|
|
12646
13204
|
{
|
|
12647
13205
|
size: "small",
|
|
12648
|
-
title: /* @__PURE__ */ jsx("span", { style: { color: relatedModelTone.text, fontWeight: 600 }, children:
|
|
13206
|
+
title: /* @__PURE__ */ jsx("span", { style: { color: relatedModelTone.text, fontWeight: 600 }, children: _32("Analyze") }),
|
|
12649
13207
|
styles: {
|
|
12650
13208
|
header: {
|
|
12651
13209
|
background: `linear-gradient(135deg, ${relatedModelTone.solid}18 0%, ${relatedModelTone.solid}0a 100%)`
|
|
@@ -12674,10 +13232,10 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
12674
13232
|
styles: { body: { display: "grid", gap: 16, position: "relative", paddingTop: 48 } },
|
|
12675
13233
|
children: [
|
|
12676
13234
|
/* @__PURE__ */ jsxs("div", { style: { position: "absolute", top: 0, right: 0, display: "flex", gap: 8 }, children: [
|
|
12677
|
-
/* @__PURE__ */ jsx(Tooltip, { title:
|
|
12678
|
-
/* @__PURE__ */ jsx(Tooltip, { title:
|
|
12679
|
-
/* @__PURE__ */ jsx(Tooltip, { title:
|
|
12680
|
-
/* @__PURE__ */ jsx(Tooltip, { title:
|
|
13235
|
+
/* @__PURE__ */ jsx(Tooltip, { title: _32("Save preferences"), children: /* @__PURE__ */ jsx(Button, { size: "small", icon: /* @__PURE__ */ jsx(SaveOutlined, {}), onClick: () => openSaveViewModalFor("analyze"), loading: isSavingAnalyzePrefs }) }),
|
|
13236
|
+
/* @__PURE__ */ jsx(Tooltip, { title: _32("Stats"), children: /* @__PURE__ */ jsx(Button, { size: "small", icon: /* @__PURE__ */ jsx(FileTextOutlined, {}), onClick: () => setIsStatsFlipped(true) }) }),
|
|
13237
|
+
/* @__PURE__ */ jsx(Tooltip, { title: _32("Export chart PDF"), children: /* @__PURE__ */ jsx(Button, { size: "small", icon: /* @__PURE__ */ jsx(FilePdfOutlined, {}), onClick: exportChartPdf }) }),
|
|
13238
|
+
/* @__PURE__ */ jsx(Tooltip, { title: _32("Export chart PNG"), children: /* @__PURE__ */ jsx(Button, { size: "small", icon: /* @__PURE__ */ jsx(DownloadOutlined, {}), onClick: exportChartImage, "aria-label": _32("Export chart") }) })
|
|
12681
13239
|
] }),
|
|
12682
13240
|
/* @__PURE__ */ jsx(
|
|
12683
13241
|
AnalysisChart,
|
|
@@ -12708,11 +13266,11 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
12708
13266
|
items: [
|
|
12709
13267
|
{
|
|
12710
13268
|
key: "configure-chart",
|
|
12711
|
-
label:
|
|
13269
|
+
label: _32("Customize chart"),
|
|
12712
13270
|
children: /* @__PURE__ */ jsxs("div", { style: { display: "grid", gap: 16 }, children: [
|
|
12713
13271
|
/* @__PURE__ */ jsxs("div", { style: { display: "flex", gap: 16, flexWrap: "wrap" }, children: [
|
|
12714
13272
|
/* @__PURE__ */ jsxs("div", { style: { minWidth: 220, flex: 1 }, children: [
|
|
12715
|
-
/* @__PURE__ */ jsx("div", { style: { fontSize: 12, color: token.colorTextSecondary, marginBottom: 4 }, children:
|
|
13273
|
+
/* @__PURE__ */ jsx("div", { style: { fontSize: 12, color: token.colorTextSecondary, marginBottom: 4 }, children: _32("Category 1") }),
|
|
12716
13274
|
/* @__PURE__ */ jsx(
|
|
12717
13275
|
Select,
|
|
12718
13276
|
{
|
|
@@ -12723,12 +13281,12 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
12723
13281
|
},
|
|
12724
13282
|
style: { width: "100%" },
|
|
12725
13283
|
options: categoricalFields.map((field) => ({ label: field.label, value: field.key })),
|
|
12726
|
-
placeholder:
|
|
13284
|
+
placeholder: _32("Select category")
|
|
12727
13285
|
}
|
|
12728
13286
|
)
|
|
12729
13287
|
] }),
|
|
12730
13288
|
/* @__PURE__ */ jsxs("div", { style: { minWidth: 220, flex: 1 }, children: [
|
|
12731
|
-
/* @__PURE__ */ jsx("div", { style: { fontSize: 12, color: token.colorTextSecondary, marginBottom: 4 }, children:
|
|
13289
|
+
/* @__PURE__ */ jsx("div", { style: { fontSize: 12, color: token.colorTextSecondary, marginBottom: 4 }, children: _32("Category 2") }),
|
|
12732
13290
|
/* @__PURE__ */ jsx(
|
|
12733
13291
|
Select,
|
|
12734
13292
|
{
|
|
@@ -12739,14 +13297,14 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
12739
13297
|
},
|
|
12740
13298
|
style: { width: "100%" },
|
|
12741
13299
|
options: [
|
|
12742
|
-
{ label:
|
|
13300
|
+
{ label: _32("None"), value: "__none__" },
|
|
12743
13301
|
...categoricalFields.filter((field) => field.key !== categoryField1).map((field) => ({ label: field.label, value: field.key }))
|
|
12744
13302
|
]
|
|
12745
13303
|
}
|
|
12746
13304
|
)
|
|
12747
13305
|
] }),
|
|
12748
13306
|
/* @__PURE__ */ jsxs("div", { style: { minWidth: 160 }, children: [
|
|
12749
|
-
/* @__PURE__ */ jsx("div", { style: { fontSize: 12, color: token.colorTextSecondary, marginBottom: 4 }, children:
|
|
13307
|
+
/* @__PURE__ */ jsx("div", { style: { fontSize: 12, color: token.colorTextSecondary, marginBottom: 4 }, children: _32("Chart Type") }),
|
|
12750
13308
|
/* @__PURE__ */ jsx(
|
|
12751
13309
|
Select,
|
|
12752
13310
|
{
|
|
@@ -12757,30 +13315,30 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
12757
13315
|
},
|
|
12758
13316
|
style: { width: "100%" },
|
|
12759
13317
|
options: [
|
|
12760
|
-
{ label:
|
|
12761
|
-
{ label:
|
|
12762
|
-
{ label:
|
|
12763
|
-
{ label:
|
|
12764
|
-
{ label:
|
|
12765
|
-
{ label:
|
|
12766
|
-
{ label:
|
|
12767
|
-
{ label:
|
|
12768
|
-
{ label:
|
|
12769
|
-
{ label:
|
|
12770
|
-
{ label:
|
|
12771
|
-
{ label:
|
|
12772
|
-
{ label:
|
|
12773
|
-
{ label:
|
|
12774
|
-
{ label:
|
|
12775
|
-
{ label:
|
|
12776
|
-
{ label:
|
|
12777
|
-
{ label:
|
|
13318
|
+
{ label: _32("Area"), value: "area" },
|
|
13319
|
+
{ label: _32("Horizontal Area"), value: "area-horizontal" },
|
|
13320
|
+
{ label: _32("Bars"), value: "bar" },
|
|
13321
|
+
{ label: _32("Stacked Bars"), value: "stacked" },
|
|
13322
|
+
{ label: _32("Horizontal Bars"), value: "bar-horizontal" },
|
|
13323
|
+
{ label: _32("Horizontal Stacked"), value: "stacked-horizontal" },
|
|
13324
|
+
{ label: _32("Lines"), value: "line" },
|
|
13325
|
+
{ label: _32("Pie"), value: "pie" },
|
|
13326
|
+
{ label: _32("Donut"), value: "donut" },
|
|
13327
|
+
{ label: _32("Scatter"), value: "scatter" },
|
|
13328
|
+
{ label: _32("Bubble"), value: "bubble" },
|
|
13329
|
+
{ label: _32("Histogram"), value: "histogram" },
|
|
13330
|
+
{ label: _32("Box Plot"), value: "box" },
|
|
13331
|
+
{ label: _32("Waterfall"), value: "waterfall" },
|
|
13332
|
+
{ label: _32("Heatmap"), value: "heatmap" },
|
|
13333
|
+
{ label: _32("Crosstab"), value: "crosstab" },
|
|
13334
|
+
{ label: _32("Radar"), value: "radar" },
|
|
13335
|
+
{ label: _32("Combo (Bar + Line)"), value: "combo" }
|
|
12778
13336
|
]
|
|
12779
13337
|
}
|
|
12780
13338
|
)
|
|
12781
13339
|
] }),
|
|
12782
13340
|
/* @__PURE__ */ jsxs("div", { style: { minWidth: 200 }, children: [
|
|
12783
|
-
/* @__PURE__ */ jsx("div", { style: { fontSize: 12, color: token.colorTextSecondary, marginBottom: 4 }, children:
|
|
13341
|
+
/* @__PURE__ */ jsx("div", { style: { fontSize: 12, color: token.colorTextSecondary, marginBottom: 4 }, children: _32("Summary") }),
|
|
12784
13342
|
/* @__PURE__ */ jsx(
|
|
12785
13343
|
Select,
|
|
12786
13344
|
{
|
|
@@ -12791,18 +13349,18 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
12791
13349
|
},
|
|
12792
13350
|
style: { width: "100%" },
|
|
12793
13351
|
options: [
|
|
12794
|
-
{ label:
|
|
12795
|
-
{ label:
|
|
12796
|
-
{ label:
|
|
12797
|
-
{ label:
|
|
12798
|
-
{ label:
|
|
12799
|
-
{ label:
|
|
13352
|
+
{ label: _32("Sum"), value: "sum" },
|
|
13353
|
+
{ label: _32("Average"), value: "avg" },
|
|
13354
|
+
{ label: _32("Count"), value: "count" },
|
|
13355
|
+
{ label: _32("Max"), value: "max" },
|
|
13356
|
+
{ label: _32("Min"), value: "min" },
|
|
13357
|
+
{ label: _32("Std Dev"), value: "stddev" }
|
|
12800
13358
|
]
|
|
12801
13359
|
}
|
|
12802
13360
|
)
|
|
12803
13361
|
] }),
|
|
12804
13362
|
/* @__PURE__ */ jsxs("div", { style: { minWidth: 180 }, children: [
|
|
12805
|
-
/* @__PURE__ */ jsx("div", { style: { fontSize: 12, color: token.colorTextSecondary, marginBottom: 4 }, children:
|
|
13363
|
+
/* @__PURE__ */ jsx("div", { style: { fontSize: 12, color: token.colorTextSecondary, marginBottom: 4 }, children: _32("Ranking Filter") }),
|
|
12806
13364
|
/* @__PURE__ */ jsx(
|
|
12807
13365
|
Select,
|
|
12808
13366
|
{
|
|
@@ -12813,15 +13371,15 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
12813
13371
|
},
|
|
12814
13372
|
style: { width: "100%" },
|
|
12815
13373
|
options: [
|
|
12816
|
-
{ label:
|
|
12817
|
-
{ label:
|
|
12818
|
-
{ label:
|
|
13374
|
+
{ label: _32("None"), value: "none" },
|
|
13375
|
+
{ label: _32("Top N"), value: "top" },
|
|
13376
|
+
{ label: _32("Bottom N"), value: "bottom" }
|
|
12819
13377
|
]
|
|
12820
13378
|
}
|
|
12821
13379
|
)
|
|
12822
13380
|
] }),
|
|
12823
13381
|
/* @__PURE__ */ jsxs("div", { style: { minWidth: 220 }, children: [
|
|
12824
|
-
/* @__PURE__ */ jsx("div", { style: { fontSize: 12, color: token.colorTextSecondary, marginBottom: 4 }, children:
|
|
13382
|
+
/* @__PURE__ */ jsx("div", { style: { fontSize: 12, color: token.colorTextSecondary, marginBottom: 4 }, children: _32("Ranking Column") }),
|
|
12825
13383
|
/* @__PURE__ */ jsx(
|
|
12826
13384
|
Select,
|
|
12827
13385
|
{
|
|
@@ -12832,13 +13390,13 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
12832
13390
|
},
|
|
12833
13391
|
style: { width: "100%" },
|
|
12834
13392
|
options: numericFields.map((field) => ({ label: field.label, value: field.key })),
|
|
12835
|
-
placeholder:
|
|
13393
|
+
placeholder: _32("Select numeric column"),
|
|
12836
13394
|
disabled: rankingMode === "none" || numericFields.length === 0
|
|
12837
13395
|
}
|
|
12838
13396
|
)
|
|
12839
13397
|
] }),
|
|
12840
13398
|
/* @__PURE__ */ jsxs("div", { style: { minWidth: 120 }, children: [
|
|
12841
|
-
/* @__PURE__ */ jsx("div", { style: { fontSize: 12, color: token.colorTextSecondary, marginBottom: 4 }, children:
|
|
13399
|
+
/* @__PURE__ */ jsx("div", { style: { fontSize: 12, color: token.colorTextSecondary, marginBottom: 4 }, children: _32("N") }),
|
|
12842
13400
|
/* @__PURE__ */ jsx(
|
|
12843
13401
|
InputNumber,
|
|
12844
13402
|
{
|
|
@@ -12857,8 +13415,8 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
12857
13415
|
] }),
|
|
12858
13416
|
/* @__PURE__ */ jsxs("div", { children: [
|
|
12859
13417
|
/* @__PURE__ */ jsxs("div", { style: { display: "flex", alignItems: "center", justifyContent: "space-between", gap: 12, marginBottom: 6 }, children: [
|
|
12860
|
-
/* @__PURE__ */ jsx("div", { style: { fontSize: 12, color: token.colorTextSecondary }, children:
|
|
12861
|
-
/* @__PURE__ */ jsx(Tooltip, { title:
|
|
13418
|
+
/* @__PURE__ */ jsx("div", { style: { fontSize: 12, color: token.colorTextSecondary }, children: _32("Series") }),
|
|
13419
|
+
/* @__PURE__ */ jsx(Tooltip, { title: _32("Unselect All"), children: /* @__PURE__ */ jsx(
|
|
12862
13420
|
Button,
|
|
12863
13421
|
{
|
|
12864
13422
|
size: "small",
|
|
@@ -12878,7 +13436,7 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
12878
13436
|
markAnalyzePrefsTouched();
|
|
12879
13437
|
setSelectedSeriesKeys(values);
|
|
12880
13438
|
},
|
|
12881
|
-
options: numericFields.length > 0 ? numericFields.map((field) => ({ label: field.label, value: field.key })) : [{ label:
|
|
13439
|
+
options: numericFields.length > 0 ? numericFields.map((field) => ({ label: field.label, value: field.key })) : [{ label: _32("Count"), value: "__count__" }]
|
|
12882
13440
|
}
|
|
12883
13441
|
)
|
|
12884
13442
|
] })
|
|
@@ -12903,11 +13461,11 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
12903
13461
|
styles: { body: { display: "grid", gap: 16, position: "relative", paddingTop: 48 } },
|
|
12904
13462
|
children: [
|
|
12905
13463
|
/* @__PURE__ */ jsxs("div", { style: { position: "absolute", top: 0, right: 0, display: "flex", gap: 8 }, children: [
|
|
12906
|
-
/* @__PURE__ */ jsx(Tooltip, { title:
|
|
12907
|
-
/* @__PURE__ */ jsx(Tooltip, { title:
|
|
13464
|
+
/* @__PURE__ */ jsx(Tooltip, { title: _32("Analysis"), children: /* @__PURE__ */ jsx(Button, { size: "small", icon: /* @__PURE__ */ jsx(BarChartOutlined, {}), onClick: () => setIsStatsFlipped(false) }) }),
|
|
13465
|
+
/* @__PURE__ */ jsx(Tooltip, { title: _32("Export stats PDF"), children: /* @__PURE__ */ jsx(Button, { size: "small", icon: /* @__PURE__ */ jsx(FilePdfOutlined, {}), onClick: exportStatsPdf }) })
|
|
12908
13466
|
] }),
|
|
12909
13467
|
/* @__PURE__ */ jsxs("div", { style: { display: "grid", gap: 16 }, children: [
|
|
12910
|
-
statsSummary.numericStats.length > 0 && /* @__PURE__ */ jsx(Card, { size: "small", title: /* @__PURE__ */ jsx("span", { style: statsTitleStyle, children:
|
|
13468
|
+
statsSummary.numericStats.length > 0 && /* @__PURE__ */ jsx(Card, { size: "small", title: /* @__PURE__ */ jsx("span", { style: statsTitleStyle, children: _32("Numeric columns") }), children: /* @__PURE__ */ jsxs(
|
|
12911
13469
|
Table,
|
|
12912
13470
|
{
|
|
12913
13471
|
dataSource: statsSummary.numericStats,
|
|
@@ -12918,18 +13476,18 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
12918
13476
|
/* @__PURE__ */ jsx(
|
|
12919
13477
|
Table.Column,
|
|
12920
13478
|
{
|
|
12921
|
-
title:
|
|
13479
|
+
title: _32("Field"),
|
|
12922
13480
|
dataIndex: "label",
|
|
12923
13481
|
render: (label) => /* @__PURE__ */ jsx("span", { style: statsLabelStyle, children: label }),
|
|
12924
13482
|
onHeaderCell: () => ({ style: statsHeaderStyle })
|
|
12925
13483
|
},
|
|
12926
13484
|
"label"
|
|
12927
13485
|
),
|
|
12928
|
-
/* @__PURE__ */ jsx(Table.Column, { title:
|
|
12929
|
-
/* @__PURE__ */ jsx(Table.Column, { title:
|
|
12930
|
-
/* @__PURE__ */ jsx(Table.Column, { title:
|
|
12931
|
-
/* @__PURE__ */ jsx(Table.Column, { title:
|
|
12932
|
-
/* @__PURE__ */ jsx(Table.Column, { title:
|
|
13486
|
+
/* @__PURE__ */ jsx(Table.Column, { title: _32("Sum"), align: "right", render: (_unused, row) => renderStatBar(row.sum, statsNumericMaxes.sum, formatNumberValue), onHeaderCell: () => ({ style: statsHeaderStyle }) }, "sum"),
|
|
13487
|
+
/* @__PURE__ */ jsx(Table.Column, { title: _32("Average"), align: "right", render: (_unused, row) => renderStatBar(row.avg, statsNumericMaxes.avg, formatNumberValue), onHeaderCell: () => ({ style: statsHeaderStyle }) }, "avg"),
|
|
13488
|
+
/* @__PURE__ */ jsx(Table.Column, { title: _32("Min"), align: "right", render: (_unused, row) => renderStatBar(row.min, statsNumericMaxes.min, formatNumberValue), onHeaderCell: () => ({ style: statsHeaderStyle }) }, "min"),
|
|
13489
|
+
/* @__PURE__ */ jsx(Table.Column, { title: _32("Max"), align: "right", render: (_unused, row) => renderStatBar(row.max, statsNumericMaxes.max, formatNumberValue), onHeaderCell: () => ({ style: statsHeaderStyle }) }, "max"),
|
|
13490
|
+
/* @__PURE__ */ jsx(Table.Column, { title: _32("Std Dev"), align: "right", render: (_unused, row) => renderStatBar(row.stddev, statsNumericMaxes.stddev, formatNumberValue), onHeaderCell: () => ({ style: statsHeaderStyle }) }, "stddev")
|
|
12933
13491
|
]
|
|
12934
13492
|
}
|
|
12935
13493
|
) }),
|
|
@@ -12941,7 +13499,7 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
12941
13499
|
items: [
|
|
12942
13500
|
{
|
|
12943
13501
|
key: "categorical-columns",
|
|
12944
|
-
label: /* @__PURE__ */ jsx("span", { style: statsTitleStyle, children:
|
|
13502
|
+
label: /* @__PURE__ */ jsx("span", { style: statsTitleStyle, children: _32("Categorical columns (distinct < 20)") }),
|
|
12945
13503
|
children: statsSummary.categoricalStats.map((field) => /* @__PURE__ */ jsxs("div", { style: { marginBottom: 12 }, children: [
|
|
12946
13504
|
/* @__PURE__ */ jsx("div", { style: { fontWeight: 600, marginBottom: 4 }, children: /* @__PURE__ */ jsx("span", { style: statsLabelStyle, children: field.label }) }),
|
|
12947
13505
|
/* @__PURE__ */ jsxs(
|
|
@@ -12952,11 +13510,11 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
12952
13510
|
pagination: false,
|
|
12953
13511
|
rowKey: (row) => row.value,
|
|
12954
13512
|
children: [
|
|
12955
|
-
/* @__PURE__ */ jsx(Table.Column, { title:
|
|
13513
|
+
/* @__PURE__ */ jsx(Table.Column, { title: _32("Value"), dataIndex: "value", onHeaderCell: () => ({ style: statsHeaderStyle }) }, "value"),
|
|
12956
13514
|
/* @__PURE__ */ jsx(
|
|
12957
13515
|
Table.Column,
|
|
12958
13516
|
{
|
|
12959
|
-
title:
|
|
13517
|
+
title: _32("Count"),
|
|
12960
13518
|
dataIndex: "count",
|
|
12961
13519
|
align: "right",
|
|
12962
13520
|
onHeaderCell: () => ({ style: statsHeaderStyle }),
|
|
@@ -13088,7 +13646,7 @@ var RelatedObjectSingleSelect = ({ rel, record, allModels, required }) => {
|
|
|
13088
13646
|
}
|
|
13089
13647
|
);
|
|
13090
13648
|
};
|
|
13091
|
-
var
|
|
13649
|
+
var _33 = window._ || ((text) => text);
|
|
13092
13650
|
function useMillerColumnItems({
|
|
13093
13651
|
parentId,
|
|
13094
13652
|
rel,
|
|
@@ -13206,7 +13764,7 @@ function useMillerColumnItems({
|
|
|
13206
13764
|
} catch (err) {
|
|
13207
13765
|
if (err instanceof DOMException && err.name === "AbortError") return;
|
|
13208
13766
|
if (isMounted) {
|
|
13209
|
-
setError(err instanceof Error ? err.message :
|
|
13767
|
+
setError(err instanceof Error ? err.message : _33("Failed to load items"));
|
|
13210
13768
|
}
|
|
13211
13769
|
} finally {
|
|
13212
13770
|
if (isMounted) setLoading(false);
|
|
@@ -13258,7 +13816,7 @@ var MillerColumn = ({
|
|
|
13258
13816
|
Empty,
|
|
13259
13817
|
{
|
|
13260
13818
|
image: Empty.PRESENTED_IMAGE_SIMPLE,
|
|
13261
|
-
description:
|
|
13819
|
+
description: _33("No items"),
|
|
13262
13820
|
style: { margin: "32px 0" }
|
|
13263
13821
|
}
|
|
13264
13822
|
),
|
|
@@ -13335,12 +13893,12 @@ var DetailPaneContent = ({ node, allModels }) => {
|
|
|
13335
13893
|
const model = allModels?.find((m) => m.name === node.resource);
|
|
13336
13894
|
const showHref = getShowHref(node.resource, node.id, allModels);
|
|
13337
13895
|
if (!model) {
|
|
13338
|
-
return /* @__PURE__ */ jsx(Empty, { description: `${
|
|
13896
|
+
return /* @__PURE__ */ jsx(Empty, { description: `${_33("No schema for")} ${node.resource}`, style: { marginTop: 32 } });
|
|
13339
13897
|
}
|
|
13340
13898
|
return /* @__PURE__ */ jsxs("div", { children: [
|
|
13341
13899
|
/* @__PURE__ */ jsxs("div", { style: { display: "flex", alignItems: "center", gap: 8, marginBottom: 12 }, children: [
|
|
13342
13900
|
/* @__PURE__ */ jsx(Typography.Title, { level: 5, style: { margin: 0, color: token.colorTextSecondary, fontWeight: 500, flex: 1, minWidth: 0 }, children: node.label }),
|
|
13343
|
-
showHref && /* @__PURE__ */ jsx(Tooltip, { title:
|
|
13901
|
+
showHref && /* @__PURE__ */ jsx(Tooltip, { title: _33("Open in new tab"), children: /* @__PURE__ */ jsx(
|
|
13344
13902
|
Button,
|
|
13345
13903
|
{
|
|
13346
13904
|
size: "small",
|
|
@@ -13446,7 +14004,7 @@ var MillerBrowserLayout = ({
|
|
|
13446
14004
|
}
|
|
13447
14005
|
};
|
|
13448
14006
|
if (!rootId) {
|
|
13449
|
-
return /* @__PURE__ */ jsx(Empty, { description:
|
|
14007
|
+
return /* @__PURE__ */ jsx(Empty, { description: _33("No record selected") });
|
|
13450
14008
|
}
|
|
13451
14009
|
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%" };
|
|
13452
14010
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
@@ -13509,7 +14067,7 @@ var MillerBrowserLayout = ({
|
|
|
13509
14067
|
showDetails && /* @__PURE__ */ jsx(
|
|
13510
14068
|
Drawer,
|
|
13511
14069
|
{
|
|
13512
|
-
title: detailNode?.label ??
|
|
14070
|
+
title: detailNode?.label ?? _33("Details"),
|
|
13513
14071
|
placement: "right",
|
|
13514
14072
|
open: drawerOpen && !isDesktop,
|
|
13515
14073
|
onClose: () => setDrawerOpen(false),
|
|
@@ -13619,6 +14177,24 @@ var renderRelationBlock = ({
|
|
|
13619
14177
|
/* @__PURE__ */ jsx("div", { style: resolvedValueStyle, children: /* @__PURE__ */ jsx(RelatedObjectsInlineValues, { rel, record, viewType: "csv", allModels }) })
|
|
13620
14178
|
] }) });
|
|
13621
14179
|
}
|
|
14180
|
+
if (viewType === "editable-csv" || viewType === "read-and-edit-csv") {
|
|
14181
|
+
return /* @__PURE__ */ jsx("div", { style: { marginBottom: 0 }, children: /* @__PURE__ */ jsxs("div", { style: resolvedLayoutStyle, children: [
|
|
14182
|
+
showLabel && /* @__PURE__ */ jsx("div", { style: resolvedLabelStyle, children: relationLabel }),
|
|
14183
|
+
/* @__PURE__ */ jsx("div", { style: resolvedValueStyle, children: /* @__PURE__ */ jsx(RelatedObjectsEditableCsv, { rel, record, allModels }) })
|
|
14184
|
+
] }) });
|
|
14185
|
+
}
|
|
14186
|
+
if (viewType === "read-and-edit-list") {
|
|
14187
|
+
if (rel.otherResource && rel.otherKey) {
|
|
14188
|
+
return /* @__PURE__ */ jsxs("div", { style: { marginBottom: 16, boxShadow: `0 8px 20px -16px ${relationTone.shadow}` }, children: [
|
|
14189
|
+
/* @__PURE__ */ jsx("div", { style: { ...resolvedLabelStyle, marginBottom: 4 }, children: showLabel ? relationLabel : null }),
|
|
14190
|
+
/* @__PURE__ */ jsx(RelatedObjectsEditableList, { rel, record, allModels })
|
|
14191
|
+
] });
|
|
14192
|
+
}
|
|
14193
|
+
return /* @__PURE__ */ jsx("div", { style: { marginBottom: 0 }, children: /* @__PURE__ */ jsxs("div", { style: resolvedLayoutStyle, children: [
|
|
14194
|
+
showLabel && /* @__PURE__ */ jsx("div", { style: resolvedLabelStyle, children: relationLabel }),
|
|
14195
|
+
/* @__PURE__ */ jsx("div", { style: resolvedValueStyle, children: /* @__PURE__ */ jsx(RelatedObjectsInlineValues, { rel, record, viewType: "list", allModels }) })
|
|
14196
|
+
] }) });
|
|
14197
|
+
}
|
|
13622
14198
|
if (isInlineListView && !polymorphicInfo) {
|
|
13623
14199
|
return /* @__PURE__ */ jsx("div", { style: { marginBottom: 0 }, children: /* @__PURE__ */ jsxs("div", { style: resolvedLayoutStyle, children: [
|
|
13624
14200
|
showLabel && /* @__PURE__ */ jsx("div", { style: resolvedLabelStyle, children: relationLabel }),
|
|
@@ -13812,7 +14388,7 @@ var renderRelationBlock = ({
|
|
|
13812
14388
|
content
|
|
13813
14389
|
] }, rel.resource);
|
|
13814
14390
|
};
|
|
13815
|
-
var
|
|
14391
|
+
var _34 = window._ || ((text) => text);
|
|
13816
14392
|
var { Title: Title7 } = Typography;
|
|
13817
14393
|
var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbedded = false, showActions = true, showCreate = true, layoutPreferenceType, listViewType, rowSelection, extraHeaderButtons, bulkActions, preferencesResourceOverride, defaultListVisible }) => {
|
|
13818
14394
|
const model = useRoleFilteredModel(modelProp);
|
|
@@ -13882,7 +14458,7 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
13882
14458
|
const [galleryPage, setGalleryPage] = useState(1);
|
|
13883
14459
|
const [calendarMode, setCalendarMode] = useState("month");
|
|
13884
14460
|
const [calendarDateField, setCalendarDateField] = useState(() => calendarDateFieldOptions[0]?.key || "");
|
|
13885
|
-
const [calendarAnchorDate, setCalendarAnchorDate] = useState(() =>
|
|
14461
|
+
const [calendarAnchorDate, setCalendarAnchorDate] = useState(() => dayjs8().startOf("month"));
|
|
13886
14462
|
const [isAnalyzeVertical, setIsAnalyzeVertical] = useState(false);
|
|
13887
14463
|
const [isAnalyzeFirst, setIsAnalyzeFirst] = useState(false);
|
|
13888
14464
|
const [filterRules, setFilterRules] = useState([]);
|
|
@@ -13892,7 +14468,9 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
13892
14468
|
const [selectedColumnKeys, setSelectedColumnKeys] = useState(null);
|
|
13893
14469
|
const [columnOrder, setColumnOrder] = useState(null);
|
|
13894
14470
|
const [columnFiltersSelected, setColumnFiltersSelected] = useState({});
|
|
13895
|
-
const [columnSort, setColumnSort] = useState(
|
|
14471
|
+
const [columnSort, setColumnSort] = useState(
|
|
14472
|
+
model.defaultSort ? [{ fieldKey: model.defaultSort.field, order: model.defaultSort.order === "desc" ? "descend" : "ascend" }] : []
|
|
14473
|
+
);
|
|
13896
14474
|
const [totalsSummaryFunctions, setTotalsSummaryFunctions] = useState({});
|
|
13897
14475
|
const [currentViewName, setCurrentViewName] = useState(getDefaultViewName());
|
|
13898
14476
|
const [selectedViewNames, setSelectedViewNames] = useState([]);
|
|
@@ -13947,6 +14525,7 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
13947
14525
|
const layoutPrefsLoadedRef = useRef(false);
|
|
13948
14526
|
const layoutPrefsResourceRef = useRef(null);
|
|
13949
14527
|
const sortIntentRef = useRef(null);
|
|
14528
|
+
const prevViewNameForResetRef = useRef(null);
|
|
13950
14529
|
const [bulkSelectedRowKeys, setBulkSelectedRowKeys] = useState([]);
|
|
13951
14530
|
const bulkSelectedRowsMapRef = useRef(/* @__PURE__ */ new Map());
|
|
13952
14531
|
const [selectModeAssociating, setSelectModeAssociating] = useState(false);
|
|
@@ -13975,12 +14554,12 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
13975
14554
|
});
|
|
13976
14555
|
}
|
|
13977
14556
|
}
|
|
13978
|
-
message.success(
|
|
14557
|
+
message.success(_34("Relations added."));
|
|
13979
14558
|
if (selectModeReturnTo && selectModeReturnTo.startsWith("/")) {
|
|
13980
14559
|
navigate(selectModeReturnTo);
|
|
13981
14560
|
}
|
|
13982
14561
|
} catch {
|
|
13983
|
-
message.error(
|
|
14562
|
+
message.error(_34("Failed to add relations."));
|
|
13984
14563
|
} finally {
|
|
13985
14564
|
setSelectModeAssociating(false);
|
|
13986
14565
|
}
|
|
@@ -14078,7 +14657,7 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
14078
14657
|
const direction = value?.direction || "next";
|
|
14079
14658
|
const unit = value?.unit || "weeks";
|
|
14080
14659
|
const isQuarter = unit === "quarters";
|
|
14081
|
-
const base =
|
|
14660
|
+
const base = dayjs8();
|
|
14082
14661
|
if (asRange || direction === "current") {
|
|
14083
14662
|
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);
|
|
14084
14663
|
if (isQuarter) {
|
|
@@ -14139,7 +14718,7 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
14139
14718
|
return true;
|
|
14140
14719
|
}
|
|
14141
14720
|
if (field.type === "date" || field.type === "datetime") {
|
|
14142
|
-
const recordDate =
|
|
14721
|
+
const recordDate = dayjs8(rawValue);
|
|
14143
14722
|
if (!recordDate.isValid()) return false;
|
|
14144
14723
|
const mode = rule.value?.mode || "absolute";
|
|
14145
14724
|
const mode2 = rule.value2?.mode || "absolute";
|
|
@@ -14147,7 +14726,7 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
14147
14726
|
if (val?.mode === "relative") {
|
|
14148
14727
|
return resolveRelativeDate(val, asRange);
|
|
14149
14728
|
}
|
|
14150
|
-
const date =
|
|
14729
|
+
const date = dayjs8(val?.date || val);
|
|
14151
14730
|
return asRange ? { start: date.startOf("day"), end: date.endOf("day") } : { date: date.startOf("day") };
|
|
14152
14731
|
};
|
|
14153
14732
|
switch (rule.operator) {
|
|
@@ -14158,13 +14737,13 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
14158
14737
|
}
|
|
14159
14738
|
case "after": {
|
|
14160
14739
|
const dateVal = mode === "relative" ? resolveRelativeDate(rule.value, false).date : getDateValue(rule.value, false).date;
|
|
14161
|
-
if (!dateVal || !
|
|
14162
|
-
return recordDate.valueOf() >
|
|
14740
|
+
if (!dateVal || !dayjs8(dateVal).isValid()) return false;
|
|
14741
|
+
return recordDate.valueOf() > dayjs8(dateVal).endOf("day").valueOf();
|
|
14163
14742
|
}
|
|
14164
14743
|
case "before": {
|
|
14165
14744
|
const dateVal = mode === "relative" ? resolveRelativeDate(rule.value, false).date : getDateValue(rule.value, false).date;
|
|
14166
|
-
if (!dateVal || !
|
|
14167
|
-
return recordDate.valueOf() <
|
|
14745
|
+
if (!dateVal || !dayjs8(dateVal).isValid()) return false;
|
|
14746
|
+
return recordDate.valueOf() < dayjs8(dateVal).startOf("day").valueOf();
|
|
14168
14747
|
}
|
|
14169
14748
|
case "between": {
|
|
14170
14749
|
const startRange = mode === "relative" ? resolveRelativeDate(rule.value, true) : getDateValue(rule.value, true);
|
|
@@ -14486,7 +15065,7 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
14486
15065
|
}, [numericFields, rankingFieldKey, rankingMode]);
|
|
14487
15066
|
const resetLayoutDefaults = useCallback(() => {
|
|
14488
15067
|
setListVisible(defaultListVisible ?? true);
|
|
14489
|
-
setAnalyzeOpen(
|
|
15068
|
+
setAnalyzeOpen(isEmbedded);
|
|
14490
15069
|
setIsAnalyzeVertical(false);
|
|
14491
15070
|
setIsAnalyzeFirst(false);
|
|
14492
15071
|
setFiltersCollapsed(isEmbedded);
|
|
@@ -14610,7 +15189,7 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
14610
15189
|
return;
|
|
14611
15190
|
}
|
|
14612
15191
|
if (availableViewNames.includes(newName)) {
|
|
14613
|
-
message.error(
|
|
15192
|
+
message.error(_34("View name already exists."));
|
|
14614
15193
|
return;
|
|
14615
15194
|
}
|
|
14616
15195
|
try {
|
|
@@ -14623,18 +15202,18 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
14623
15202
|
if (!response.ok) {
|
|
14624
15203
|
throw new Error(`Rename failed (${response.status})`);
|
|
14625
15204
|
}
|
|
14626
|
-
message.success(
|
|
15205
|
+
message.success(_34("View renamed."));
|
|
14627
15206
|
setRenameViewModalOpen(false);
|
|
14628
15207
|
await loadViewNames();
|
|
14629
15208
|
} catch (error) {
|
|
14630
|
-
message.error(error instanceof Error ? error.message :
|
|
15209
|
+
message.error(error instanceof Error ? error.message : _34("Failed to rename view."));
|
|
14631
15210
|
}
|
|
14632
15211
|
}, [apiUrl, availableViewNames, currentViewName, model.name, model.resource, renameViewName, allModels, loadViewNames]);
|
|
14633
15212
|
const confirmDeleteView = useCallback(() => {
|
|
14634
15213
|
Modal.confirm({
|
|
14635
|
-
title:
|
|
15214
|
+
title: _34(_34("Delete view")),
|
|
14636
15215
|
content: `Delete "${currentViewName}" and all its saved preferences?`,
|
|
14637
|
-
okText:
|
|
15216
|
+
okText: _34("Delete"),
|
|
14638
15217
|
okButtonProps: { danger: true },
|
|
14639
15218
|
onOk: async () => {
|
|
14640
15219
|
try {
|
|
@@ -14647,10 +15226,10 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
14647
15226
|
if (!response.ok) {
|
|
14648
15227
|
throw new Error(`Delete failed (${response.status})`);
|
|
14649
15228
|
}
|
|
14650
|
-
message.success(
|
|
15229
|
+
message.success(_34("View deleted."));
|
|
14651
15230
|
await loadViewNames();
|
|
14652
15231
|
} catch (error) {
|
|
14653
|
-
message.error(error instanceof Error ? error.message :
|
|
15232
|
+
message.error(error instanceof Error ? error.message : _34("Failed to delete view."));
|
|
14654
15233
|
}
|
|
14655
15234
|
}
|
|
14656
15235
|
});
|
|
@@ -14692,9 +15271,9 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
14692
15271
|
if (failed) {
|
|
14693
15272
|
throw new Error(`Save failed (${failed.status})`);
|
|
14694
15273
|
}
|
|
14695
|
-
message.success(
|
|
15274
|
+
message.success(_34("Layout preferences saved."));
|
|
14696
15275
|
} catch (error) {
|
|
14697
|
-
message.error(error instanceof Error ? error.message :
|
|
15276
|
+
message.error(error instanceof Error ? error.message : _34("Failed to save layout preferences."));
|
|
14698
15277
|
} finally {
|
|
14699
15278
|
setIsSavingLayoutPrefs(false);
|
|
14700
15279
|
}
|
|
@@ -14723,9 +15302,9 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
14723
15302
|
if (!response.ok) {
|
|
14724
15303
|
throw new Error(`Save failed (${response.status})`);
|
|
14725
15304
|
}
|
|
14726
|
-
message.success(
|
|
15305
|
+
message.success(_34("Analyze preferences saved."));
|
|
14727
15306
|
} catch (error) {
|
|
14728
|
-
message.error(error instanceof Error ? error.message :
|
|
15307
|
+
message.error(error instanceof Error ? error.message : _34("Failed to save analyze preferences."));
|
|
14729
15308
|
} finally {
|
|
14730
15309
|
setIsSavingAnalyzePrefs(false);
|
|
14731
15310
|
}
|
|
@@ -14735,11 +15314,11 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
14735
15314
|
const viewName = normalizeViewName(saveViewName || currentViewName);
|
|
14736
15315
|
const viewExists = availableViewNames.includes(viewName);
|
|
14737
15316
|
if (saveViewAsNew && viewExists) {
|
|
14738
|
-
message.error(
|
|
15317
|
+
message.error(_34("View name already exists. Choose a new name."));
|
|
14739
15318
|
return;
|
|
14740
15319
|
}
|
|
14741
15320
|
if (!saveViewAsNew && viewName !== currentViewName && viewExists) {
|
|
14742
|
-
message.error(
|
|
15321
|
+
message.error(_34('Choose a new name or enable "Save as new view".'));
|
|
14743
15322
|
return;
|
|
14744
15323
|
}
|
|
14745
15324
|
setSaveViewModalOpen(false);
|
|
@@ -14762,6 +15341,8 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
14762
15341
|
}, [loadViewNames]);
|
|
14763
15342
|
useEffect(() => {
|
|
14764
15343
|
if (!viewNamesLoaded) return;
|
|
15344
|
+
const viewChanged = prevViewNameForResetRef.current !== null && prevViewNameForResetRef.current !== currentViewName;
|
|
15345
|
+
prevViewNameForResetRef.current = currentViewName;
|
|
14765
15346
|
analyzePrefsTouchedRef.current = false;
|
|
14766
15347
|
layoutPrefsTouchedRef.current = false;
|
|
14767
15348
|
analyzePrefsLoadedRef.current = false;
|
|
@@ -14769,8 +15350,11 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
14769
15350
|
setColumnsSelectorOpen(false);
|
|
14770
15351
|
setSaveViewName(currentViewName);
|
|
14771
15352
|
setSaveViewAsNew(false);
|
|
14772
|
-
|
|
14773
|
-
|
|
15353
|
+
if (viewChanged) {
|
|
15354
|
+
analyzeTouchedRef.current = false;
|
|
15355
|
+
resetLayoutDefaults();
|
|
15356
|
+
resetAnalyzeDefaults();
|
|
15357
|
+
}
|
|
14774
15358
|
}, [currentViewName, resetAnalyzeDefaults, resetLayoutDefaults, viewNamesLoaded]);
|
|
14775
15359
|
useEffect(() => {
|
|
14776
15360
|
const resourceKey = prefsKey;
|
|
@@ -14937,7 +15521,7 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
14937
15521
|
}
|
|
14938
15522
|
setAllRowsData(allRows2);
|
|
14939
15523
|
} catch (error) {
|
|
14940
|
-
setAllRowsError(error instanceof Error ? error.message :
|
|
15524
|
+
setAllRowsError(error instanceof Error ? error.message : _34("Failed to fetch all rows"));
|
|
14941
15525
|
} finally {
|
|
14942
15526
|
setIsAllRowsLoading(false);
|
|
14943
15527
|
setAllRowsLoaded(true);
|
|
@@ -14976,7 +15560,7 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
14976
15560
|
if (forRange) return { start: resolved.start?.toISOString(), end: resolved.end?.toISOString() };
|
|
14977
15561
|
return { date: resolved.date?.toISOString() };
|
|
14978
15562
|
}
|
|
14979
|
-
const date =
|
|
15563
|
+
const date = dayjs8(val?.date || val);
|
|
14980
15564
|
if (!date.isValid()) return {};
|
|
14981
15565
|
if (forRange) return { start: date.startOf("day").toISOString(), end: date.endOf("day").toISOString() };
|
|
14982
15566
|
return { date: date.startOf("day").toISOString() };
|
|
@@ -15032,7 +15616,7 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
15032
15616
|
setFilters(combined, "replace");
|
|
15033
15617
|
}, [filterRules, hasActiveFilterRules, isClientFiltering, model.fields, setFilters, tableFilters]);
|
|
15034
15618
|
const formatCategoryValue = useCallback((field, record) => {
|
|
15035
|
-
if (!field) return
|
|
15619
|
+
if (!field) return _34("All");
|
|
15036
15620
|
const raw = record?.[field.key];
|
|
15037
15621
|
if (raw === void 0 || raw === null) return "-";
|
|
15038
15622
|
if (field.key === "eid" && record?._label) return record._label;
|
|
@@ -15043,7 +15627,7 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
15043
15627
|
if (field.options) {
|
|
15044
15628
|
return field.options.find((option) => option.value === raw)?.label || String(raw);
|
|
15045
15629
|
}
|
|
15046
|
-
if (field.type === "boolean") return raw ?
|
|
15630
|
+
if (field.type === "boolean") return raw ? _34("Yes") : _34("No");
|
|
15047
15631
|
if (field.type === "date") return formatDateValue(raw);
|
|
15048
15632
|
if (field.type === "datetime") return formatDateTimeValue(raw) ?? String(raw);
|
|
15049
15633
|
if (field.type === "time") return formatTimeValue(raw);
|
|
@@ -15128,7 +15712,7 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
15128
15712
|
const seriesLabels = numericFields.length > 0 ? numericFields.reduce((acc, field) => {
|
|
15129
15713
|
acc[field.key] = field.label;
|
|
15130
15714
|
return acc;
|
|
15131
|
-
}, { "__count__":
|
|
15715
|
+
}, { "__count__": _34("Count") }) : { "__count__": _34("Count") };
|
|
15132
15716
|
const baseGroups = Array.from(groupMap.values());
|
|
15133
15717
|
let groups = baseGroups;
|
|
15134
15718
|
if (rankingMode !== "none" && rankingFieldKey) {
|
|
@@ -15185,7 +15769,7 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
15185
15769
|
} else if (field.options) {
|
|
15186
15770
|
label = field.options.find((o) => o.value === raw)?.label || String(raw);
|
|
15187
15771
|
} else if (field.type === "boolean") {
|
|
15188
|
-
label = raw ?
|
|
15772
|
+
label = raw ? _34("Yes") : _34("No");
|
|
15189
15773
|
} else if (field.type === "date") {
|
|
15190
15774
|
label = formatDateValue(raw);
|
|
15191
15775
|
} else if (field.type === "datetime") {
|
|
@@ -15247,13 +15831,13 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
15247
15831
|
const getSummaryFunctionDisplayText = useCallback((fn) => {
|
|
15248
15832
|
if (!fn) return "";
|
|
15249
15833
|
const labels = {
|
|
15250
|
-
sum:
|
|
15251
|
-
avg:
|
|
15252
|
-
count:
|
|
15253
|
-
max:
|
|
15254
|
-
min:
|
|
15255
|
-
stddev:
|
|
15256
|
-
distinct:
|
|
15834
|
+
sum: _34("Sum"),
|
|
15835
|
+
avg: _34("Average"),
|
|
15836
|
+
count: _34("Count"),
|
|
15837
|
+
max: _34("Max"),
|
|
15838
|
+
min: _34("Min"),
|
|
15839
|
+
stddev: _34("Std Dev"),
|
|
15840
|
+
distinct: _34("Distinct")
|
|
15257
15841
|
};
|
|
15258
15842
|
return labels[fn] || fn;
|
|
15259
15843
|
}, []);
|
|
@@ -15314,12 +15898,12 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
15314
15898
|
`td-num-${item.key}`
|
|
15315
15899
|
)) })
|
|
15316
15900
|
] }) }),
|
|
15317
|
-
/* @__PURE__ */ jsx(Tooltip, { title: isTdFlipped ?
|
|
15901
|
+
/* @__PURE__ */ jsx(Tooltip, { title: isTdFlipped ? _34("Show totals") : _34("Show details"), children: /* @__PURE__ */ jsx(
|
|
15318
15902
|
Button,
|
|
15319
15903
|
{
|
|
15320
15904
|
size: "small",
|
|
15321
15905
|
icon: /* @__PURE__ */ jsx(SwapOutlined, { style: { transform: "rotate(90deg)" } }),
|
|
15322
|
-
"aria-label": isTdFlipped ?
|
|
15906
|
+
"aria-label": isTdFlipped ? _34("Show totals") : _34("Show details"),
|
|
15323
15907
|
onClick: () => setIsTdFlipped((prev) => !prev),
|
|
15324
15908
|
style: {
|
|
15325
15909
|
flexShrink: 0,
|
|
@@ -15394,7 +15978,7 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
15394
15978
|
if (field.options) {
|
|
15395
15979
|
return field.options.find((option) => option.value === raw)?.label || String(raw);
|
|
15396
15980
|
}
|
|
15397
|
-
if (field.type === "boolean") return raw ?
|
|
15981
|
+
if (field.type === "boolean") return raw ? _34("Yes") : _34("No");
|
|
15398
15982
|
if (field.type === "date") return formatDateValue(raw);
|
|
15399
15983
|
if (field.type === "datetime") return formatDateTimeValue(raw) ?? String(raw);
|
|
15400
15984
|
if (field.type === "time") return formatTimeValue(raw);
|
|
@@ -15486,7 +16070,8 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
15486
16070
|
const exportStatsPdf = () => {
|
|
15487
16071
|
openPdfWindow(`${model.name}-stats`, buildStatsHtml(statsSummary));
|
|
15488
16072
|
};
|
|
15489
|
-
const getRowKey = (record) => {
|
|
16073
|
+
const getRowKey = (record, index) => {
|
|
16074
|
+
if (model.isNamedQuery && index !== void 0) return String(index);
|
|
15490
16075
|
if (record?.eid !== void 0 && record?.eid !== null) return record.eid;
|
|
15491
16076
|
if (record?.id !== void 0 && record?.id !== null) return record.id;
|
|
15492
16077
|
if (relationConfig?.targetKey || relationConfig?.otherKey) {
|
|
@@ -15503,7 +16088,7 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
15503
16088
|
if (relationConfig?.otherResource && relationConfig?.otherKey && record[relationConfig.otherKey]) {
|
|
15504
16089
|
return { resource: relationConfig.otherResource, id: record[relationConfig.otherKey], isLinkRow: true };
|
|
15505
16090
|
}
|
|
15506
|
-
const resourceName = model.resource || model.name;
|
|
16091
|
+
const resourceName = model.isNamedQuery && model.primaryResource ? model.primaryResource : model.resource || model.name;
|
|
15507
16092
|
const explicitPk = model.pkField ? record[model.pkField] : void 0;
|
|
15508
16093
|
const isPkField = model.fields?.find((f) => f.isPk)?.key;
|
|
15509
16094
|
const pkValue = explicitPk ?? (isPkField ? record[isPkField] : void 0) ?? record.eid ?? record.id ?? null;
|
|
@@ -15569,7 +16154,7 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
15569
16154
|
for (const actionKey of apiActionKeys) {
|
|
15570
16155
|
if (actionKey === "__delete__") {
|
|
15571
16156
|
const resp = await authenticatedFetch(`${apiUrl}/${resource}/${id}`, { method: "DELETE" });
|
|
15572
|
-
if (!resp.ok) throw new Error(`${
|
|
16157
|
+
if (!resp.ok) throw new Error(`${_34("Delete failed for record")} ${id}`);
|
|
15573
16158
|
} else if (actionKey === "__change_field__") {
|
|
15574
16159
|
if (!bulkChangeFieldKey) continue;
|
|
15575
16160
|
const payload = { ...record, [bulkChangeFieldKey]: bulkChangeFieldValue };
|
|
@@ -15579,7 +16164,7 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
15579
16164
|
headers: { "Content-Type": "application/json" },
|
|
15580
16165
|
body: JSON.stringify(payload)
|
|
15581
16166
|
});
|
|
15582
|
-
if (!resp.ok) throw new Error(`${
|
|
16167
|
+
if (!resp.ok) throw new Error(`${_34("Update failed for record")} ${id}`);
|
|
15583
16168
|
} else if (actionKey === "__clone__") {
|
|
15584
16169
|
const clonePayload = { ...record };
|
|
15585
16170
|
delete clonePayload.eid;
|
|
@@ -15591,7 +16176,7 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
15591
16176
|
headers: { "Content-Type": "application/json" },
|
|
15592
16177
|
body: JSON.stringify(clonePayload)
|
|
15593
16178
|
});
|
|
15594
|
-
if (!resp.ok) throw new Error(`${
|
|
16179
|
+
if (!resp.ok) throw new Error(`${_34("Clone failed for record")} ${id}`);
|
|
15595
16180
|
} else if (actionKey === "__pin__") {
|
|
15596
16181
|
await authenticatedFetch(`${apiUrl}/dashboard/pinned-records`, {
|
|
15597
16182
|
method: "POST",
|
|
@@ -15610,11 +16195,11 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
15610
16195
|
}
|
|
15611
16196
|
}
|
|
15612
16197
|
message.success(
|
|
15613
|
-
|
|
16198
|
+
_34("Actions applied successfully to {count} rows").replace("{count}", String(records.length))
|
|
15614
16199
|
);
|
|
15615
16200
|
} catch (e) {
|
|
15616
16201
|
errorOccurred = true;
|
|
15617
|
-
message.error(e?.message ||
|
|
16202
|
+
message.error(e?.message || _34("Bulk action failed"));
|
|
15618
16203
|
} finally {
|
|
15619
16204
|
setIsBulkExecuting(false);
|
|
15620
16205
|
setBulkActionModalOpen(false);
|
|
@@ -15672,7 +16257,7 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
15672
16257
|
Table.SELECTION_NONE,
|
|
15673
16258
|
{
|
|
15674
16259
|
key: "select-all-filtered",
|
|
15675
|
-
text:
|
|
16260
|
+
text: _34("Select all filtered rows"),
|
|
15676
16261
|
onSelect: handleSelectAllFiltered
|
|
15677
16262
|
}
|
|
15678
16263
|
]
|
|
@@ -15681,19 +16266,19 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
15681
16266
|
const bulkActionsAvailable = useMemo(() => {
|
|
15682
16267
|
const opts = [];
|
|
15683
16268
|
if (canBulkEdit) {
|
|
15684
|
-
opts.push({ label:
|
|
16269
|
+
opts.push({ label: _34("Change field value"), value: "__change_field__" });
|
|
15685
16270
|
}
|
|
15686
|
-
opts.push({ label:
|
|
16271
|
+
opts.push({ label: _34("Export selected (CSV)"), value: "__export_csv__" });
|
|
15687
16272
|
if (canBulkEdit) {
|
|
15688
|
-
opts.push({ label:
|
|
16273
|
+
opts.push({ label: _34("Clone / Duplicate selected"), value: "__clone__" });
|
|
15689
16274
|
}
|
|
15690
16275
|
if (bulkActions && bulkActions.length > 0) {
|
|
15691
|
-
bulkActions.forEach((a) => opts.push({ label:
|
|
16276
|
+
bulkActions.forEach((a) => opts.push({ label: _34(a.label), value: a.key }));
|
|
15692
16277
|
}
|
|
15693
|
-
opts.push({ label:
|
|
15694
|
-
opts.push({ label:
|
|
16278
|
+
opts.push({ label: _34("Pin selected"), value: "__pin__" });
|
|
16279
|
+
opts.push({ label: _34("Unpin selected"), value: "__unpin__" });
|
|
15695
16280
|
if (canBulkDelete) {
|
|
15696
|
-
opts.push({ label:
|
|
16281
|
+
opts.push({ label: _34("Delete selected"), value: "__delete__" });
|
|
15697
16282
|
}
|
|
15698
16283
|
return opts;
|
|
15699
16284
|
}, [bulkActions, canBulkDelete, canBulkEdit]);
|
|
@@ -15710,9 +16295,9 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
15710
16295
|
background: token.colorWarningBg,
|
|
15711
16296
|
border: `1px solid ${token.colorWarningBorder}`
|
|
15712
16297
|
}, children: [
|
|
15713
|
-
/* @__PURE__ */ jsx("span", { style: { fontWeight: 500, color: token.colorWarningText }, children: bulkSelectedRowKeys.length > 0 ?
|
|
16298
|
+
/* @__PURE__ */ 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") }),
|
|
15714
16299
|
/* @__PURE__ */ jsxs("div", { style: { display: "flex", gap: 8 }, children: [
|
|
15715
|
-
selectModeReturnTo && /* @__PURE__ */ jsx(Button, { size: "small", onClick: () => navigate(selectModeReturnTo), children:
|
|
16300
|
+
selectModeReturnTo && /* @__PURE__ */ jsx(Button, { size: "small", onClick: () => navigate(selectModeReturnTo), children: _34("Cancel") }),
|
|
15716
16301
|
/* @__PURE__ */ jsx(
|
|
15717
16302
|
Button,
|
|
15718
16303
|
{
|
|
@@ -15721,7 +16306,7 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
15721
16306
|
disabled: bulkSelectedRowKeys.length === 0,
|
|
15722
16307
|
loading: selectModeAssociating,
|
|
15723
16308
|
onClick: handleAssociateSelected,
|
|
15724
|
-
children:
|
|
16309
|
+
children: _34("Associate selected")
|
|
15725
16310
|
}
|
|
15726
16311
|
)
|
|
15727
16312
|
] })
|
|
@@ -15737,7 +16322,7 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
15737
16322
|
background: token.colorInfoBg,
|
|
15738
16323
|
border: `1px solid ${token.colorInfoBorder}`
|
|
15739
16324
|
}, children: [
|
|
15740
|
-
/* @__PURE__ */ jsx("span", { style: { fontWeight: 500 }, children:
|
|
16325
|
+
/* @__PURE__ */ jsx("span", { style: { fontWeight: 500 }, children: _34("{count} rows selected").replace("{count}", String(bulkSelectedRowKeys.length)) }),
|
|
15741
16326
|
bulkSelectedRowKeys.length < filteredTotalCount && /* @__PURE__ */ jsx(
|
|
15742
16327
|
Button,
|
|
15743
16328
|
{
|
|
@@ -15746,16 +16331,16 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
15746
16331
|
loading: selectAllFilteredPending && isAllRowsLoading,
|
|
15747
16332
|
onClick: handleSelectAllFiltered,
|
|
15748
16333
|
style: { padding: 0 },
|
|
15749
|
-
children:
|
|
16334
|
+
children: _34("Select all {count} filtered rows").replace("{count}", String(filteredTotalCount))
|
|
15750
16335
|
}
|
|
15751
16336
|
),
|
|
15752
|
-
/* @__PURE__ */ jsx(Button, { type: "link", size: "small", onClick: clearBulkSelection, style: { padding: 0 }, children:
|
|
16337
|
+
/* @__PURE__ */ jsx(Button, { type: "link", size: "small", onClick: clearBulkSelection, style: { padding: 0 }, children: _34("Clear selection") }),
|
|
15753
16338
|
/* @__PURE__ */ jsx("div", { style: { flex: 1, minWidth: 180 }, children: /* @__PURE__ */ jsx(
|
|
15754
16339
|
Select,
|
|
15755
16340
|
{
|
|
15756
16341
|
mode: "multiple",
|
|
15757
16342
|
size: "small",
|
|
15758
|
-
placeholder:
|
|
16343
|
+
placeholder: _34("Actions"),
|
|
15759
16344
|
style: { width: "100%" },
|
|
15760
16345
|
value: bulkActionsToApply,
|
|
15761
16346
|
onChange: (values) => {
|
|
@@ -15773,7 +16358,7 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
15773
16358
|
Select,
|
|
15774
16359
|
{
|
|
15775
16360
|
size: "small",
|
|
15776
|
-
placeholder:
|
|
16361
|
+
placeholder: _34("Select field"),
|
|
15777
16362
|
style: { minWidth: 160 },
|
|
15778
16363
|
value: bulkChangeFieldKey ?? void 0,
|
|
15779
16364
|
onChange: (v) => {
|
|
@@ -15788,7 +16373,7 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
15788
16373
|
Select,
|
|
15789
16374
|
{
|
|
15790
16375
|
size: "small",
|
|
15791
|
-
placeholder:
|
|
16376
|
+
placeholder: _34("Select value"),
|
|
15792
16377
|
style: { minWidth: 180 },
|
|
15793
16378
|
value: bulkChangeFieldValue ?? void 0,
|
|
15794
16379
|
onChange: (v) => setBulkChangeFieldValue(v),
|
|
@@ -15799,25 +16384,25 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
15799
16384
|
Select,
|
|
15800
16385
|
{
|
|
15801
16386
|
size: "small",
|
|
15802
|
-
placeholder:
|
|
16387
|
+
placeholder: _34("Select value"),
|
|
15803
16388
|
style: { minWidth: 120 },
|
|
15804
16389
|
value: bulkChangeFieldValue ?? void 0,
|
|
15805
16390
|
onChange: (v) => setBulkChangeFieldValue(v),
|
|
15806
|
-
options: [{ label:
|
|
16391
|
+
options: [{ label: _34("True"), value: true }, { label: _34("False"), value: false }],
|
|
15807
16392
|
allowClear: true
|
|
15808
16393
|
}
|
|
15809
16394
|
) : bulkChangeField.type === "date" ? /* @__PURE__ */ jsx(
|
|
15810
16395
|
DatePicker,
|
|
15811
16396
|
{
|
|
15812
16397
|
size: "small",
|
|
15813
|
-
value: bulkChangeFieldValue ?
|
|
16398
|
+
value: bulkChangeFieldValue ? dayjs8(bulkChangeFieldValue) : null,
|
|
15814
16399
|
onChange: (v) => setBulkChangeFieldValue(v ? v.toISOString() : null)
|
|
15815
16400
|
}
|
|
15816
16401
|
) : bulkChangeField.type === "number" ? /* @__PURE__ */ jsx(
|
|
15817
16402
|
InputNumber,
|
|
15818
16403
|
{
|
|
15819
16404
|
size: "small",
|
|
15820
|
-
placeholder:
|
|
16405
|
+
placeholder: _34("Value"),
|
|
15821
16406
|
value: bulkChangeFieldValue,
|
|
15822
16407
|
onChange: (v) => setBulkChangeFieldValue(v),
|
|
15823
16408
|
style: { minWidth: 120 }
|
|
@@ -15826,7 +16411,7 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
15826
16411
|
Input,
|
|
15827
16412
|
{
|
|
15828
16413
|
size: "small",
|
|
15829
|
-
placeholder:
|
|
16414
|
+
placeholder: _34("Value"),
|
|
15830
16415
|
value: bulkChangeFieldValue ?? "",
|
|
15831
16416
|
onChange: (e) => setBulkChangeFieldValue(e.target.value),
|
|
15832
16417
|
style: { minWidth: 160 }
|
|
@@ -15840,7 +16425,7 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
15840
16425
|
size: "small",
|
|
15841
16426
|
disabled: bulkActionsToApply.length === 0,
|
|
15842
16427
|
onClick: () => setBulkActionModalOpen(true),
|
|
15843
|
-
children:
|
|
16428
|
+
children: _34("Apply")
|
|
15844
16429
|
}
|
|
15845
16430
|
)
|
|
15846
16431
|
] }) : null;
|
|
@@ -15848,16 +16433,16 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
15848
16433
|
Modal,
|
|
15849
16434
|
{
|
|
15850
16435
|
open: bulkActionModalOpen,
|
|
15851
|
-
title:
|
|
16436
|
+
title: _34("Confirm bulk action"),
|
|
15852
16437
|
onCancel: () => {
|
|
15853
16438
|
if (!isBulkExecuting) setBulkActionModalOpen(false);
|
|
15854
16439
|
},
|
|
15855
16440
|
footer: [
|
|
15856
|
-
/* @__PURE__ */ jsx(Button, { onClick: () => setBulkActionModalOpen(false), disabled: isBulkExecuting, children:
|
|
15857
|
-
/* @__PURE__ */ jsx(Button, { type: "primary", loading: isBulkExecuting, onClick: executeBulkActions, children:
|
|
16441
|
+
/* @__PURE__ */ jsx(Button, { onClick: () => setBulkActionModalOpen(false), disabled: isBulkExecuting, children: _34("Cancel") }, "cancel"),
|
|
16442
|
+
/* @__PURE__ */ jsx(Button, { type: "primary", loading: isBulkExecuting, onClick: executeBulkActions, children: _34("Confirm") }, "ok")
|
|
15858
16443
|
],
|
|
15859
16444
|
children: [
|
|
15860
|
-
/* @__PURE__ */ jsx("p", { children:
|
|
16445
|
+
/* @__PURE__ */ jsx("p", { children: _34("You are about to apply the following actions to {count} rows:").replace("{count}", String(bulkSelectedRowKeys.length)) }),
|
|
15861
16446
|
/* @__PURE__ */ jsx("ul", { style: { paddingLeft: 20, marginBottom: 8 }, children: bulkActionsToApply.map((actionKey) => {
|
|
15862
16447
|
const label = bulkActionsAvailable.find((a) => a.value === actionKey)?.label ?? actionKey;
|
|
15863
16448
|
const extra = actionKey === "__change_field__" && bulkChangeField ? ` \u2192 ${bulkChangeField.label}: ${String(bulkChangeFieldValue ?? "")}` : "";
|
|
@@ -15873,7 +16458,7 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
15873
16458
|
const listTitle = !isEmbedded ? renderModelHeading({
|
|
15874
16459
|
model,
|
|
15875
16460
|
title: modelDisplayLabel,
|
|
15876
|
-
actionLabel:
|
|
16461
|
+
actionLabel: _34("List"),
|
|
15877
16462
|
moduleLabel: model.module ? getModuleLabel(model.module) : void 0
|
|
15878
16463
|
}) : void 0;
|
|
15879
16464
|
const numericBarColor = modelTone.soft || token.colorPrimaryBg || "rgba(22, 119, 255, 0.16)";
|
|
@@ -15897,7 +16482,7 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
15897
16482
|
items: selectedViewNames.map((name) => ({ key: name, label: renderToneTabLabel(name, modelTone) }))
|
|
15898
16483
|
}
|
|
15899
16484
|
) : null;
|
|
15900
|
-
const listToggleButton = /* @__PURE__ */ jsx(Tooltip, { title:
|
|
16485
|
+
const listToggleButton = /* @__PURE__ */ jsx(Tooltip, { title: _34("View list"), children: /* @__PURE__ */ jsx(
|
|
15901
16486
|
Button,
|
|
15902
16487
|
{
|
|
15903
16488
|
size: "small",
|
|
@@ -15908,7 +16493,7 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
15908
16493
|
}
|
|
15909
16494
|
}
|
|
15910
16495
|
) });
|
|
15911
|
-
const exportButton = !isEmbedded ? /* @__PURE__ */ jsx(Tooltip, { title:
|
|
16496
|
+
const exportButton = !isEmbedded ? /* @__PURE__ */ jsx(Tooltip, { title: _34("Export CSV"), children: /* @__PURE__ */ jsx(
|
|
15912
16497
|
Button,
|
|
15913
16498
|
{
|
|
15914
16499
|
size: "small",
|
|
@@ -15917,7 +16502,7 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
15917
16502
|
loading: exportRequested && isAllRowsLoading
|
|
15918
16503
|
}
|
|
15919
16504
|
) }) : null;
|
|
15920
|
-
const columnsToggleButton = /* @__PURE__ */ jsx(Tooltip, { title: columnsSelectorOpen ?
|
|
16505
|
+
const columnsToggleButton = /* @__PURE__ */ jsx(Tooltip, { title: columnsSelectorOpen ? _34("Hide view configuration") : _34("Show view configuration"), children: /* @__PURE__ */ jsx(
|
|
15921
16506
|
Button,
|
|
15922
16507
|
{
|
|
15923
16508
|
size: "small",
|
|
@@ -15929,10 +16514,10 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
15929
16514
|
return next;
|
|
15930
16515
|
});
|
|
15931
16516
|
},
|
|
15932
|
-
"aria-label": columnsSelectorOpen ?
|
|
16517
|
+
"aria-label": columnsSelectorOpen ? _34("Hide view configuration") : _34("Show view configuration")
|
|
15933
16518
|
}
|
|
15934
16519
|
) });
|
|
15935
|
-
const createRelationButton = isRelationView && showCreate ? /* @__PURE__ */ jsx(Tooltip, { title:
|
|
16520
|
+
const createRelationButton = isRelationView && showCreate ? /* @__PURE__ */ jsx(Tooltip, { title: _34("Add relation"), children: /* @__PURE__ */ jsx(
|
|
15936
16521
|
Button,
|
|
15937
16522
|
{
|
|
15938
16523
|
size: "small",
|
|
@@ -15948,7 +16533,7 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
15948
16533
|
}
|
|
15949
16534
|
}
|
|
15950
16535
|
) }) : null;
|
|
15951
|
-
const associateExistingFkButton = isRelationView && showCreate && filter?.field && filter?.value !== void 0 && filter?.value !== null && !relationConfig?.otherKey ? /* @__PURE__ */ jsx(Tooltip, { title:
|
|
16536
|
+
const associateExistingFkButton = isRelationView && showCreate && filter?.field && filter?.value !== void 0 && filter?.value !== null && !relationConfig?.otherKey ? /* @__PURE__ */ jsx(Tooltip, { title: _34("Associate existing"), children: /* @__PURE__ */ jsx(
|
|
15952
16537
|
Button,
|
|
15953
16538
|
{
|
|
15954
16539
|
size: "small",
|
|
@@ -15968,7 +16553,7 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
15968
16553
|
}
|
|
15969
16554
|
}
|
|
15970
16555
|
) }) : null;
|
|
15971
|
-
const createNewAndRelateButton = isRelationView && showCreate && relationConfig?.otherResource && relationConfig?.otherKey && (relationConfig?.targetKey || filter?.field) && filter?.value !== void 0 && filter?.value !== null ? /* @__PURE__ */ jsx(Tooltip, { title:
|
|
16556
|
+
const createNewAndRelateButton = isRelationView && showCreate && relationConfig?.otherResource && relationConfig?.otherKey && (relationConfig?.targetKey || filter?.field) && filter?.value !== void 0 && filter?.value !== null ? /* @__PURE__ */ jsx(Tooltip, { title: _34("Create new and relate"), children: /* @__PURE__ */ jsx(
|
|
15972
16557
|
Button,
|
|
15973
16558
|
{
|
|
15974
16559
|
size: "small",
|
|
@@ -15984,7 +16569,7 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
15984
16569
|
const relatedModel = findModelByName(allModels, relationConfig?.otherResource || relationConfig?.otherResourcePath);
|
|
15985
16570
|
const relatedResource = relatedModel ? resolveResourcePath(relatedModel.resource || relatedModel.name, allModels) : null;
|
|
15986
16571
|
if (!relatedResource) {
|
|
15987
|
-
message.warning(
|
|
16572
|
+
message.warning(_34("No create route for the related model. Opening relation create form."));
|
|
15988
16573
|
params.append(targetKey, String(targetId));
|
|
15989
16574
|
const returnTo2 = `${location.pathname}${location.search}${location.hash}`;
|
|
15990
16575
|
if (returnTo2.startsWith("/")) params.append("returnTo", returnTo2);
|
|
@@ -16004,7 +16589,7 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
16004
16589
|
const embeddedActionBar = isEmbedded ? /* @__PURE__ */ jsxs("div", { style: { display: "flex", alignItems: "center", justifyContent: "flex-end", gap: 8, marginBottom: 8 }, children: [
|
|
16005
16590
|
columnsToggleButton,
|
|
16006
16591
|
listToggleButton,
|
|
16007
|
-
/* @__PURE__ */ jsx(Tooltip, { title:
|
|
16592
|
+
/* @__PURE__ */ jsx(Tooltip, { title: _34("Analyze"), children: /* @__PURE__ */ jsx(
|
|
16008
16593
|
Button,
|
|
16009
16594
|
{
|
|
16010
16595
|
size: "small",
|
|
@@ -16017,7 +16602,7 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
16017
16602
|
}
|
|
16018
16603
|
}
|
|
16019
16604
|
) }),
|
|
16020
|
-
/* @__PURE__ */ jsx(Tooltip, { title:
|
|
16605
|
+
/* @__PURE__ */ jsx(Tooltip, { title: _34("Switch orientation"), children: /* @__PURE__ */ jsx(
|
|
16021
16606
|
Button,
|
|
16022
16607
|
{
|
|
16023
16608
|
size: "small",
|
|
@@ -16028,7 +16613,7 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
16028
16613
|
}
|
|
16029
16614
|
}
|
|
16030
16615
|
) }),
|
|
16031
|
-
/* @__PURE__ */ jsx(Tooltip, { title:
|
|
16616
|
+
/* @__PURE__ */ jsx(Tooltip, { title: _34("Switch positions"), children: /* @__PURE__ */ jsx(
|
|
16032
16617
|
Button,
|
|
16033
16618
|
{
|
|
16034
16619
|
size: "small",
|
|
@@ -16039,7 +16624,7 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
16039
16624
|
}
|
|
16040
16625
|
}
|
|
16041
16626
|
) }),
|
|
16042
|
-
resolvedLayoutPreferenceType && /* @__PURE__ */ jsx(Tooltip, { title:
|
|
16627
|
+
resolvedLayoutPreferenceType && /* @__PURE__ */ jsx(Tooltip, { title: _34("Save layout"), children: /* @__PURE__ */ jsx(
|
|
16043
16628
|
Button,
|
|
16044
16629
|
{
|
|
16045
16630
|
size: "small",
|
|
@@ -16051,7 +16636,7 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
16051
16636
|
associateExistingFkButton,
|
|
16052
16637
|
createRelationButton,
|
|
16053
16638
|
createNewAndRelateButton,
|
|
16054
|
-
/* @__PURE__ */ jsx(Tooltip, { title:
|
|
16639
|
+
/* @__PURE__ */ jsx(Tooltip, { title: _34("Export CSV"), children: /* @__PURE__ */ jsx(
|
|
16055
16640
|
Button,
|
|
16056
16641
|
{
|
|
16057
16642
|
size: "small",
|
|
@@ -16207,10 +16792,10 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
16207
16792
|
if (calendarInitSignatureRef.current === signature) return;
|
|
16208
16793
|
calendarInitSignatureRef.current = signature;
|
|
16209
16794
|
if (calendarEarliestDateTs === null) {
|
|
16210
|
-
setCalendarAnchorDate(
|
|
16795
|
+
setCalendarAnchorDate(dayjs8().startOf(calendarMode));
|
|
16211
16796
|
return;
|
|
16212
16797
|
}
|
|
16213
|
-
setCalendarAnchorDate(
|
|
16798
|
+
setCalendarAnchorDate(dayjs8(calendarEarliestDateTs).startOf(calendarMode));
|
|
16214
16799
|
}, [calendarDateField, calendarEarliestDateTs, calendarMode, isCalendarView]);
|
|
16215
16800
|
const calendarEntriesByDate = useMemo(() => {
|
|
16216
16801
|
const grouped = /* @__PURE__ */ new Map();
|
|
@@ -16258,7 +16843,7 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
16258
16843
|
};
|
|
16259
16844
|
const renderCalendarView = () => {
|
|
16260
16845
|
if (calendarDateFieldOptions.length === 0) {
|
|
16261
|
-
return /* @__PURE__ */ jsx(Empty, { description:
|
|
16846
|
+
return /* @__PURE__ */ jsx(Empty, { description: _34("No date/datetime fields available for calendar view.") });
|
|
16262
16847
|
}
|
|
16263
16848
|
const selectedDateField = model.fields.find((field) => field.key === calendarDateField);
|
|
16264
16849
|
const selectedLabel = selectedDateField?.label || calendarDateField;
|
|
@@ -16272,8 +16857,8 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
16272
16857
|
value: calendarMode,
|
|
16273
16858
|
onChange: (value) => setCalendarMode(value),
|
|
16274
16859
|
options: [
|
|
16275
|
-
{ label:
|
|
16276
|
-
{ label:
|
|
16860
|
+
{ label: _34("Monthly"), value: "month" },
|
|
16861
|
+
{ label: _34("Weekly"), value: "week" }
|
|
16277
16862
|
],
|
|
16278
16863
|
style: { minWidth: 120 }
|
|
16279
16864
|
}
|
|
@@ -16286,35 +16871,35 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
16286
16871
|
onChange: (value) => setCalendarDateField(value),
|
|
16287
16872
|
options: calendarDateFieldOptions.map((field) => ({ label: field.label, value: field.key })),
|
|
16288
16873
|
style: { minWidth: 220 },
|
|
16289
|
-
placeholder:
|
|
16874
|
+
placeholder: _34("Date field")
|
|
16290
16875
|
}
|
|
16291
16876
|
)
|
|
16292
16877
|
] }),
|
|
16293
16878
|
/* @__PURE__ */ jsxs(Space, { size: 8, children: [
|
|
16294
|
-
/* @__PURE__ */ jsx(Tooltip, { title:
|
|
16879
|
+
/* @__PURE__ */ jsx(Tooltip, { title: _34("Previous"), children: /* @__PURE__ */ jsx(
|
|
16295
16880
|
Button,
|
|
16296
16881
|
{
|
|
16297
16882
|
size: "small",
|
|
16298
16883
|
icon: /* @__PURE__ */ jsx(ArrowLeftOutlined, {}),
|
|
16299
|
-
"aria-label":
|
|
16884
|
+
"aria-label": _34("Previous"),
|
|
16300
16885
|
onClick: () => setCalendarAnchorDate((prev) => prev.subtract(1, calendarMode).startOf(calendarMode))
|
|
16301
16886
|
}
|
|
16302
16887
|
) }),
|
|
16303
|
-
/* @__PURE__ */ jsx(Tooltip, { title:
|
|
16888
|
+
/* @__PURE__ */ jsx(Tooltip, { title: _34("Today"), children: /* @__PURE__ */ jsx(
|
|
16304
16889
|
Button,
|
|
16305
16890
|
{
|
|
16306
16891
|
size: "small",
|
|
16307
16892
|
icon: /* @__PURE__ */ jsx(CalendarOutlined, {}),
|
|
16308
|
-
"aria-label":
|
|
16309
|
-
onClick: () => setCalendarAnchorDate(
|
|
16893
|
+
"aria-label": _34("Today"),
|
|
16894
|
+
onClick: () => setCalendarAnchorDate(dayjs8().startOf(calendarMode))
|
|
16310
16895
|
}
|
|
16311
16896
|
) }),
|
|
16312
|
-
/* @__PURE__ */ jsx(Tooltip, { title:
|
|
16897
|
+
/* @__PURE__ */ jsx(Tooltip, { title: _34("Next"), children: /* @__PURE__ */ jsx(
|
|
16313
16898
|
Button,
|
|
16314
16899
|
{
|
|
16315
16900
|
size: "small",
|
|
16316
16901
|
icon: /* @__PURE__ */ jsx(ArrowRightOutlined, {}),
|
|
16317
|
-
"aria-label":
|
|
16902
|
+
"aria-label": _34("Next"),
|
|
16318
16903
|
onClick: () => setCalendarAnchorDate((prev) => prev.add(1, calendarMode).startOf(calendarMode))
|
|
16319
16904
|
}
|
|
16320
16905
|
) })
|
|
@@ -16355,7 +16940,7 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
16355
16940
|
const dayKey = day.format("YYYY-MM-DD");
|
|
16356
16941
|
const entries = calendarEntriesByDate.get(dayKey) || [];
|
|
16357
16942
|
const isOutsideCurrentMonth = calendarMode === "month" && day.month() !== calendarAnchorDate.month();
|
|
16358
|
-
const isToday = day.isSame(
|
|
16943
|
+
const isToday = day.isSame(dayjs8(), "day");
|
|
16359
16944
|
return /* @__PURE__ */ jsxs(
|
|
16360
16945
|
"div",
|
|
16361
16946
|
{
|
|
@@ -16399,20 +16984,20 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
16399
16984
|
Modal,
|
|
16400
16985
|
{
|
|
16401
16986
|
open: saveViewModalOpen,
|
|
16402
|
-
title:
|
|
16987
|
+
title: _34("Save view"),
|
|
16403
16988
|
onCancel: () => {
|
|
16404
16989
|
setSaveViewModalOpen(false);
|
|
16405
16990
|
setPendingSaveTarget(null);
|
|
16406
16991
|
},
|
|
16407
16992
|
onOk: handleConfirmSaveView,
|
|
16408
|
-
okText: pendingSaveTarget === "layout" ?
|
|
16993
|
+
okText: pendingSaveTarget === "layout" ? _34("Save layout") : _34("Save analyze"),
|
|
16409
16994
|
okButtonProps: { disabled: !pendingSaveTarget },
|
|
16410
16995
|
children: /* @__PURE__ */ jsxs("div", { style: { display: "grid", gap: 12 }, children: [
|
|
16411
16996
|
/* @__PURE__ */ jsxs("div", { children: [
|
|
16412
|
-
/* @__PURE__ */ jsx("div", { style: { fontSize: 12, color: token.colorTextSecondary, marginBottom: 4 }, children:
|
|
16997
|
+
/* @__PURE__ */ jsx("div", { style: { fontSize: 12, color: token.colorTextSecondary, marginBottom: 4 }, children: _34("View name") }),
|
|
16413
16998
|
/* @__PURE__ */ jsx(Input, { value: saveViewName, onChange: (event) => setSaveViewName(event.target.value) })
|
|
16414
16999
|
] }),
|
|
16415
|
-
/* @__PURE__ */ jsx(Checkbox, { checked: saveViewAsNew, onChange: (event) => setSaveViewAsNew(event.target.checked), children:
|
|
17000
|
+
/* @__PURE__ */ jsx(Checkbox, { checked: saveViewAsNew, onChange: (event) => setSaveViewAsNew(event.target.checked), children: _34("Save as new view") })
|
|
16416
17001
|
] })
|
|
16417
17002
|
}
|
|
16418
17003
|
),
|
|
@@ -16420,10 +17005,10 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
16420
17005
|
Modal,
|
|
16421
17006
|
{
|
|
16422
17007
|
open: renameViewModalOpen,
|
|
16423
|
-
title:
|
|
17008
|
+
title: _34("Rename view"),
|
|
16424
17009
|
onCancel: () => setRenameViewModalOpen(false),
|
|
16425
17010
|
onOk: handleRenameView,
|
|
16426
|
-
okText:
|
|
17011
|
+
okText: _34("Rename"),
|
|
16427
17012
|
children: /* @__PURE__ */ jsx(Input, { value: renameViewName, onChange: (event) => setRenameViewName(event.target.value) })
|
|
16428
17013
|
}
|
|
16429
17014
|
),
|
|
@@ -16433,7 +17018,7 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
16433
17018
|
{
|
|
16434
17019
|
size: "small",
|
|
16435
17020
|
title: /* @__PURE__ */ jsxs("div", { style: { display: "flex", alignItems: "center", justifyContent: "space-between", gap: 12, flexWrap: "wrap" }, children: [
|
|
16436
|
-
/* @__PURE__ */ jsx("span", { style: { color: token.colorTextSecondary, fontSize: 12, fontWeight: 600 }, children:
|
|
17021
|
+
/* @__PURE__ */ jsx("span", { style: { color: token.colorTextSecondary, fontSize: 12, fontWeight: 600 }, children: _34("Filters") }),
|
|
16437
17022
|
/* @__PURE__ */ jsx("div", { style: { display: "flex", alignItems: "center", gap: 8, flex: 1, justifyContent: "flex-end" }, children: !filtersCollapsed && searchField && /* @__PURE__ */ jsx(
|
|
16438
17023
|
Form,
|
|
16439
17024
|
{
|
|
@@ -16447,7 +17032,7 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
16447
17032
|
}
|
|
16448
17033
|
searchFormProps.onFinish?.(values);
|
|
16449
17034
|
},
|
|
16450
|
-
children: /* @__PURE__ */ jsx(Form.Item, { name: "q", style: { marginBottom: 0, width: "100%" }, children: /* @__PURE__ */ jsx(Input, { placeholder:
|
|
17035
|
+
children: /* @__PURE__ */ jsx(Form.Item, { name: "q", style: { marginBottom: 0, width: "100%" }, children: /* @__PURE__ */ jsx(Input, { placeholder: _34("Search all fields..."), prefix: /* @__PURE__ */ jsx(SearchOutlined, {}), allowClear: true, style: { width: "100%" } }) })
|
|
16451
17036
|
}
|
|
16452
17037
|
) })
|
|
16453
17038
|
] }),
|
|
@@ -16460,31 +17045,31 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
16460
17045
|
Card,
|
|
16461
17046
|
{
|
|
16462
17047
|
size: "small",
|
|
16463
|
-
title: /* @__PURE__ */ jsx("span", { style: { color: token.colorTextSecondary, fontSize: 12, fontWeight: 600 }, children:
|
|
17048
|
+
title: /* @__PURE__ */ jsx("span", { style: { color: token.colorTextSecondary, fontSize: 12, fontWeight: 600 }, children: _34("View configuration") }),
|
|
16464
17049
|
style: { marginBottom: 16 },
|
|
16465
17050
|
styles: { body: { display: "grid", gap: 12 } },
|
|
16466
17051
|
children: [
|
|
16467
17052
|
/* @__PURE__ */ jsxs("div", { style: { display: "grid", gap: 12 }, children: [
|
|
16468
17053
|
/* @__PURE__ */ jsxs("div", { style: { display: "grid", gap: 8 }, children: [
|
|
16469
|
-
/* @__PURE__ */ jsx("div", { style: { fontSize: 12, color: token.colorTextSecondary, fontWeight: 600 }, children:
|
|
16470
|
-
filterRules.length === 0 ? /* @__PURE__ */ jsx("div", { style: { color: token.colorTextSecondary, fontSize: 12 }, children:
|
|
17054
|
+
/* @__PURE__ */ jsx("div", { style: { fontSize: 12, color: token.colorTextSecondary, fontWeight: 600 }, children: _34("Advanced filters") }),
|
|
17055
|
+
filterRules.length === 0 ? /* @__PURE__ */ jsx("div", { style: { color: token.colorTextSecondary, fontSize: 12 }, children: _34("No filters yet.") }) : filterRules.map((rule) => {
|
|
16471
17056
|
const field = model.fields.find((f) => f.key === rule.fieldKey);
|
|
16472
17057
|
const type = field?.type || "string";
|
|
16473
17058
|
const operatorOptions = type === "number" ? [
|
|
16474
|
-
{ label:
|
|
16475
|
-
{ label:
|
|
16476
|
-
{ label:
|
|
16477
|
-
{ label:
|
|
16478
|
-
{ label:
|
|
16479
|
-
{ label:
|
|
17059
|
+
{ label: _34("="), value: "eq" },
|
|
17060
|
+
{ label: _34(">"), value: "gt" },
|
|
17061
|
+
{ label: _34(">="), value: "gte" },
|
|
17062
|
+
{ label: _34("<"), value: "lt" },
|
|
17063
|
+
{ label: _34("<="), value: "lte" },
|
|
17064
|
+
{ label: _34("Between"), value: "between" }
|
|
16480
17065
|
] : type === "date" ? [
|
|
16481
|
-
{ label:
|
|
16482
|
-
{ label:
|
|
16483
|
-
{ label:
|
|
16484
|
-
{ label:
|
|
16485
|
-
] : type === "boolean" ? [{ label:
|
|
16486
|
-
{ label:
|
|
16487
|
-
{ label:
|
|
17066
|
+
{ label: _34("On"), value: "on" },
|
|
17067
|
+
{ label: _34("After"), value: "after" },
|
|
17068
|
+
{ label: _34("Before"), value: "before" },
|
|
17069
|
+
{ label: _34("Between"), value: "between" }
|
|
17070
|
+
] : type === "boolean" ? [{ label: _34("Is"), value: "is" }] : [
|
|
17071
|
+
{ label: _34("Contains"), value: "contains" },
|
|
17072
|
+
{ label: _34("Equals"), value: "equals" }
|
|
16488
17073
|
];
|
|
16489
17074
|
const renderDateInput = (value, onChange) => {
|
|
16490
17075
|
const mode = value?.mode || "absolute";
|
|
@@ -16497,9 +17082,9 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
16497
17082
|
value: value?.direction || "next",
|
|
16498
17083
|
onChange: (val) => onChange({ ...value, mode: "relative", direction: val }),
|
|
16499
17084
|
options: [
|
|
16500
|
-
{ label:
|
|
16501
|
-
{ label:
|
|
16502
|
-
{ label:
|
|
17085
|
+
{ label: _34("Previous"), value: "previous" },
|
|
17086
|
+
{ label: _34("Current"), value: "current" },
|
|
17087
|
+
{ label: _34("Next"), value: "next" }
|
|
16503
17088
|
]
|
|
16504
17089
|
}
|
|
16505
17090
|
),
|
|
@@ -16509,11 +17094,11 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
16509
17094
|
value: value?.unit || "weeks",
|
|
16510
17095
|
onChange: (val) => onChange({ ...value, mode: "relative", unit: val }),
|
|
16511
17096
|
options: [
|
|
16512
|
-
{ label:
|
|
16513
|
-
{ label:
|
|
16514
|
-
{ label:
|
|
16515
|
-
{ label:
|
|
16516
|
-
{ label:
|
|
17097
|
+
{ label: _34("Days"), value: "days" },
|
|
17098
|
+
{ label: _34("Weeks"), value: "weeks" },
|
|
17099
|
+
{ label: _34("Months"), value: "months" },
|
|
17100
|
+
{ label: _34("Quarters"), value: "quarters" },
|
|
17101
|
+
{ label: _34("Years"), value: "years" }
|
|
16517
17102
|
]
|
|
16518
17103
|
}
|
|
16519
17104
|
)
|
|
@@ -16522,7 +17107,7 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
16522
17107
|
return /* @__PURE__ */ jsx(
|
|
16523
17108
|
DatePicker,
|
|
16524
17109
|
{
|
|
16525
|
-
value: value?.date ?
|
|
17110
|
+
value: value?.date ? dayjs8(value.date) : void 0,
|
|
16526
17111
|
onChange: (val) => onChange({ mode: "absolute", date: val ? val.toISOString() : null })
|
|
16527
17112
|
}
|
|
16528
17113
|
);
|
|
@@ -16535,7 +17120,7 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
16535
17120
|
value: rule.fieldKey,
|
|
16536
17121
|
onChange: (value) => setFilterRules((prev) => prev.map((item) => item.id === rule.id ? { ...item, fieldKey: value, operator: void 0, value: void 0, value2: void 0 } : item)),
|
|
16537
17122
|
options: model.fields.map((f) => ({ label: f.label, value: f.key })),
|
|
16538
|
-
placeholder:
|
|
17123
|
+
placeholder: _34("Field")
|
|
16539
17124
|
}
|
|
16540
17125
|
),
|
|
16541
17126
|
/* @__PURE__ */ jsx(
|
|
@@ -16545,7 +17130,7 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
16545
17130
|
value: rule.operator,
|
|
16546
17131
|
onChange: (value) => setFilterRules((prev) => prev.map((item) => item.id === rule.id ? { ...item, operator: value } : item)),
|
|
16547
17132
|
options: operatorOptions,
|
|
16548
|
-
placeholder:
|
|
17133
|
+
placeholder: _34("Operator")
|
|
16549
17134
|
}
|
|
16550
17135
|
),
|
|
16551
17136
|
type === "number" && rule.operator === "between" && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
@@ -16578,10 +17163,10 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
16578
17163
|
value: rule.value,
|
|
16579
17164
|
onChange: (value) => setFilterRules((prev) => prev.map((item) => item.id === rule.id ? { ...item, value } : item)),
|
|
16580
17165
|
options: [
|
|
16581
|
-
{ label:
|
|
16582
|
-
{ label:
|
|
17166
|
+
{ label: _34("True"), value: true },
|
|
17167
|
+
{ label: _34("False"), value: false }
|
|
16583
17168
|
],
|
|
16584
|
-
placeholder:
|
|
17169
|
+
placeholder: _34("Value")
|
|
16585
17170
|
}
|
|
16586
17171
|
),
|
|
16587
17172
|
type === "date" && rule.operator === "between" && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
@@ -16594,7 +17179,7 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
16594
17179
|
{
|
|
16595
17180
|
value: rule.value,
|
|
16596
17181
|
onChange: (event) => setFilterRules((prev) => prev.map((item) => item.id === rule.id ? { ...item, value: event.target.value } : item)),
|
|
16597
|
-
placeholder:
|
|
17182
|
+
placeholder: _34("Value"),
|
|
16598
17183
|
style: { minWidth: 200 }
|
|
16599
17184
|
}
|
|
16600
17185
|
),
|
|
@@ -16607,8 +17192,8 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
16607
17192
|
setFilterRules((prev) => prev.map((item) => item.id === rule.id ? { ...item, value: { ...item.value || {}, mode: val } } : item));
|
|
16608
17193
|
},
|
|
16609
17194
|
options: [
|
|
16610
|
-
{ label:
|
|
16611
|
-
{ label:
|
|
17195
|
+
{ label: _34("Date"), value: "absolute" },
|
|
17196
|
+
{ label: _34("Relative"), value: "relative" }
|
|
16612
17197
|
]
|
|
16613
17198
|
}
|
|
16614
17199
|
),
|
|
@@ -16621,8 +17206,8 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
16621
17206
|
setFilterRules((prev) => prev.map((item) => item.id === rule.id ? { ...item, value2: { ...item.value2 || {}, mode: val } } : item));
|
|
16622
17207
|
},
|
|
16623
17208
|
options: [
|
|
16624
|
-
{ label:
|
|
16625
|
-
{ label:
|
|
17209
|
+
{ label: _34("Date"), value: "absolute" },
|
|
17210
|
+
{ label: _34("Relative"), value: "relative" }
|
|
16626
17211
|
]
|
|
16627
17212
|
}
|
|
16628
17213
|
),
|
|
@@ -16632,7 +17217,7 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
16632
17217
|
size: "small",
|
|
16633
17218
|
danger: true,
|
|
16634
17219
|
onClick: () => setFilterRules((prev) => prev.filter((item) => item.id !== rule.id)),
|
|
16635
|
-
children:
|
|
17220
|
+
children: _34("Remove")
|
|
16636
17221
|
}
|
|
16637
17222
|
)
|
|
16638
17223
|
] }, rule.id);
|
|
@@ -16644,14 +17229,14 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
16644
17229
|
size: "small",
|
|
16645
17230
|
icon: /* @__PURE__ */ jsx(FilterOutlined, {}),
|
|
16646
17231
|
onClick: () => setFilterRules((prev) => [...prev, { id: `${Date.now()}-${Math.random()}` }]),
|
|
16647
|
-
children:
|
|
17232
|
+
children: _34("Add Filter")
|
|
16648
17233
|
}
|
|
16649
17234
|
),
|
|
16650
|
-
filterRules.length > 0 && /* @__PURE__ */ jsx(Button, { size: "small", onClick: () => setFilterRules([]), children:
|
|
17235
|
+
filterRules.length > 0 && /* @__PURE__ */ jsx(Button, { size: "small", onClick: () => setFilterRules([]), children: _34("Clear filters") })
|
|
16651
17236
|
] })
|
|
16652
17237
|
] }),
|
|
16653
17238
|
/* @__PURE__ */ jsxs("div", { style: { display: "grid", gap: 6 }, children: [
|
|
16654
|
-
/* @__PURE__ */ jsx("div", { style: { fontSize: 12, color: token.colorTextSecondary, fontWeight: 600 }, children:
|
|
17239
|
+
/* @__PURE__ */ jsx("div", { style: { fontSize: 12, color: token.colorTextSecondary, fontWeight: 600 }, children: _34("Views shown") }),
|
|
16655
17240
|
/* @__PURE__ */ jsx(
|
|
16656
17241
|
Select,
|
|
16657
17242
|
{
|
|
@@ -16672,12 +17257,12 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
16672
17257
|
),
|
|
16673
17258
|
selectedViewNames.length > 1 && /* @__PURE__ */ jsx("div", { style: { display: "grid", gap: 6 }, children: selectedViewNames.map((name, index) => /* @__PURE__ */ jsxs("div", { style: { display: "flex", alignItems: "center", gap: 8 }, children: [
|
|
16674
17259
|
/* @__PURE__ */ jsx("div", { style: { flex: 1 }, children: name }),
|
|
16675
|
-
/* @__PURE__ */ jsx(Tooltip, { title:
|
|
16676
|
-
/* @__PURE__ */ jsx(Tooltip, { title:
|
|
17260
|
+
/* @__PURE__ */ jsx(Tooltip, { title: _34("Move up"), children: /* @__PURE__ */ jsx(Button, { size: "small", icon: /* @__PURE__ */ jsx(ArrowUpOutlined, {}), disabled: index === 0, onClick: () => moveSelectedView(name, "up") }) }),
|
|
17261
|
+
/* @__PURE__ */ jsx(Tooltip, { title: _34("Move down"), children: /* @__PURE__ */ jsx(Button, { size: "small", icon: /* @__PURE__ */ jsx(ArrowDownOutlined, {}), disabled: index === selectedViewNames.length - 1, onClick: () => moveSelectedView(name, "down") }) })
|
|
16677
17262
|
] }, name)) })
|
|
16678
17263
|
] }),
|
|
16679
17264
|
/* @__PURE__ */ jsxs("div", { style: { display: "grid", gap: 6 }, children: [
|
|
16680
|
-
/* @__PURE__ */ jsx("div", { style: { fontSize: 12, color: token.colorTextSecondary, fontWeight: 600 }, children:
|
|
17265
|
+
/* @__PURE__ */ jsx("div", { style: { fontSize: 12, color: token.colorTextSecondary, fontWeight: 600 }, children: _34("Active view") }),
|
|
16681
17266
|
viewSelector
|
|
16682
17267
|
] }),
|
|
16683
17268
|
/* @__PURE__ */ jsxs("div", { style: { display: "flex", flexWrap: "wrap", alignItems: "center", gap: 8 }, children: [
|
|
@@ -16689,7 +17274,7 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
16689
17274
|
setRenameViewName(currentViewName);
|
|
16690
17275
|
setRenameViewModalOpen(true);
|
|
16691
17276
|
},
|
|
16692
|
-
children:
|
|
17277
|
+
children: _34("Rename view")
|
|
16693
17278
|
}
|
|
16694
17279
|
),
|
|
16695
17280
|
/* @__PURE__ */ jsx(
|
|
@@ -16700,7 +17285,7 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
16700
17285
|
icon: /* @__PURE__ */ jsx(DeleteOutlined, {}),
|
|
16701
17286
|
disabled: availableViewNames.length <= 1,
|
|
16702
17287
|
onClick: confirmDeleteView,
|
|
16703
|
-
children:
|
|
17288
|
+
children: _34("Delete view")
|
|
16704
17289
|
}
|
|
16705
17290
|
),
|
|
16706
17291
|
resolvedLayoutPreferenceType && /* @__PURE__ */ jsx(
|
|
@@ -16710,7 +17295,7 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
16710
17295
|
icon: /* @__PURE__ */ jsx(SaveOutlined, {}),
|
|
16711
17296
|
onClick: () => openSaveViewModalFor("layout"),
|
|
16712
17297
|
loading: isSavingLayoutPrefs,
|
|
16713
|
-
children:
|
|
17298
|
+
children: _34("Save layout")
|
|
16714
17299
|
}
|
|
16715
17300
|
),
|
|
16716
17301
|
/* @__PURE__ */ jsx(
|
|
@@ -16722,7 +17307,7 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
16722
17307
|
markLayoutPrefsTouched();
|
|
16723
17308
|
setFiltersCollapsed((prev) => !prev);
|
|
16724
17309
|
},
|
|
16725
|
-
children: filtersCollapsed ?
|
|
17310
|
+
children: filtersCollapsed ? _34("Show Filters") : _34("Hide Filters")
|
|
16726
17311
|
}
|
|
16727
17312
|
),
|
|
16728
17313
|
/* @__PURE__ */ jsx(
|
|
@@ -16736,7 +17321,7 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
16736
17321
|
setIsStatsFlipped(false);
|
|
16737
17322
|
setAnalyzeOpen((prev) => !prev);
|
|
16738
17323
|
},
|
|
16739
|
-
children:
|
|
17324
|
+
children: _34("Analyze")
|
|
16740
17325
|
}
|
|
16741
17326
|
),
|
|
16742
17327
|
/* @__PURE__ */ jsx(
|
|
@@ -16748,7 +17333,7 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
16748
17333
|
markLayoutPrefsTouched();
|
|
16749
17334
|
setIsAnalyzeVertical((prev) => !prev);
|
|
16750
17335
|
},
|
|
16751
|
-
children:
|
|
17336
|
+
children: _34("Switch orientation")
|
|
16752
17337
|
}
|
|
16753
17338
|
),
|
|
16754
17339
|
/* @__PURE__ */ jsx(
|
|
@@ -16760,21 +17345,21 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
16760
17345
|
markLayoutPrefsTouched();
|
|
16761
17346
|
setIsAnalyzeFirst((prev) => !prev);
|
|
16762
17347
|
},
|
|
16763
|
-
children:
|
|
17348
|
+
children: _34("Switch positions")
|
|
16764
17349
|
}
|
|
16765
17350
|
)
|
|
16766
17351
|
] })
|
|
16767
17352
|
] }),
|
|
16768
17353
|
/* @__PURE__ */ jsxs("div", { style: { display: "grid", gap: 12 }, children: [
|
|
16769
17354
|
/* @__PURE__ */ jsxs("div", { style: { display: "flex", alignItems: "center", justifyContent: "space-between", gap: 12 }, children: [
|
|
16770
|
-
/* @__PURE__ */ jsx("span", { style: { color: token.colorTextSecondary, fontSize: 12, fontWeight: 600 }, children:
|
|
17355
|
+
/* @__PURE__ */ jsx("span", { style: { color: token.colorTextSecondary, fontSize: 12, fontWeight: 600 }, children: _34("Columns") }),
|
|
16771
17356
|
selectedColumnKeys && selectedColumnKeys.length > 0 && /* @__PURE__ */ jsx(Button, { size: "small", onClick: () => {
|
|
16772
17357
|
setSelectedColumnKeys(null);
|
|
16773
17358
|
setColumnOrder(null);
|
|
16774
|
-
}, children:
|
|
17359
|
+
}, children: _34("Reset to default") })
|
|
16775
17360
|
] }),
|
|
16776
17361
|
/* @__PURE__ */ jsxs("div", { children: [
|
|
16777
|
-
/* @__PURE__ */ jsx("div", { style: { fontSize: 12, color: token.colorTextSecondary, marginBottom: 6 }, children:
|
|
17362
|
+
/* @__PURE__ */ jsx("div", { style: { fontSize: 12, color: token.colorTextSecondary, marginBottom: 6 }, children: _34("Select columns") }),
|
|
16778
17363
|
/* @__PURE__ */ jsx(
|
|
16779
17364
|
Checkbox.Group,
|
|
16780
17365
|
{
|
|
@@ -16786,27 +17371,27 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
16786
17371
|
(!selectedColumnKeys || selectedColumnKeys.length === 0) && /* @__PURE__ */ jsx("div", { style: { fontSize: 12, color: token.colorTextSecondary, marginTop: 6 }, children: "Using default columns. Select fields to customize." })
|
|
16787
17372
|
] }),
|
|
16788
17373
|
/* @__PURE__ */ jsxs("div", { children: [
|
|
16789
|
-
/* @__PURE__ */ jsx("div", { style: { fontSize: 12, color: token.colorTextSecondary, marginBottom: 6 }, children:
|
|
16790
|
-
orderedSelectedColumns.length === 0 ? /* @__PURE__ */ jsx("div", { style: { fontSize: 12, color: token.colorTextSecondary }, children:
|
|
17374
|
+
/* @__PURE__ */ jsx("div", { style: { fontSize: 12, color: token.colorTextSecondary, marginBottom: 6 }, children: _34("Column order") }),
|
|
17375
|
+
orderedSelectedColumns.length === 0 ? /* @__PURE__ */ jsx("div", { style: { fontSize: 12, color: token.colorTextSecondary }, children: _34("No custom order yet.") }) : orderedSelectedColumns.map((key, index) => {
|
|
16791
17376
|
const field = model.fields.find((item) => item.key === key);
|
|
16792
17377
|
if (!field) return null;
|
|
16793
17378
|
return /* @__PURE__ */ jsxs("div", { style: { display: "flex", alignItems: "center", gap: 8, marginBottom: 4 }, children: [
|
|
16794
17379
|
/* @__PURE__ */ jsx("div", { style: { flex: 1 }, children: field.label }),
|
|
16795
|
-
/* @__PURE__ */ jsx(Tooltip, { title:
|
|
16796
|
-
/* @__PURE__ */ jsx(Tooltip, { title:
|
|
17380
|
+
/* @__PURE__ */ jsx(Tooltip, { title: _34("Move left"), children: /* @__PURE__ */ jsx(Button, { size: "small", icon: /* @__PURE__ */ jsx(ArrowLeftOutlined, {}), disabled: index === 0, onClick: () => moveColumnOrder(key, "left") }) }),
|
|
17381
|
+
/* @__PURE__ */ jsx(Tooltip, { title: _34("Move right"), children: /* @__PURE__ */ jsx(Button, { size: "small", icon: /* @__PURE__ */ jsx(ArrowRightOutlined, {}), disabled: index === orderedSelectedColumns.length - 1, onClick: () => moveColumnOrder(key, "right") }) })
|
|
16797
17382
|
] }, key);
|
|
16798
17383
|
})
|
|
16799
17384
|
] }),
|
|
16800
17385
|
isTotalsDetailsView && /* @__PURE__ */ jsxs("div", { children: [
|
|
16801
|
-
/* @__PURE__ */ jsx("div", { style: { fontSize: 12, color: token.colorTextSecondary, marginBottom: 6 }, children:
|
|
16802
|
-
/* @__PURE__ */ jsx("div", { style: { display: "grid", gap: 6 }, children: totalsSummaryConfigFields.length === 0 ? /* @__PURE__ */ jsx("div", { style: { fontSize: 12, color: token.colorTextSecondary }, children:
|
|
17386
|
+
/* @__PURE__ */ jsx("div", { style: { fontSize: 12, color: token.colorTextSecondary, marginBottom: 6 }, children: _34("Totals summary function") }),
|
|
17387
|
+
/* @__PURE__ */ jsx("div", { style: { display: "grid", gap: 6 }, children: totalsSummaryConfigFields.length === 0 ? /* @__PURE__ */ jsx("div", { style: { fontSize: 12, color: token.colorTextSecondary }, children: _34("No numeric fields available.") }) : totalsSummaryConfigFields.map((field) => {
|
|
16803
17388
|
const options = [
|
|
16804
|
-
{ label:
|
|
16805
|
-
{ label:
|
|
16806
|
-
{ label:
|
|
16807
|
-
{ label:
|
|
16808
|
-
{ label:
|
|
16809
|
-
{ label:
|
|
17389
|
+
{ label: _34("Sum"), value: "sum" },
|
|
17390
|
+
{ label: _34("Average"), value: "avg" },
|
|
17391
|
+
{ label: _34("Count"), value: "count" },
|
|
17392
|
+
{ label: _34("Max"), value: "max" },
|
|
17393
|
+
{ label: _34("Min"), value: "min" },
|
|
17394
|
+
{ label: _34("Std Dev"), value: "stddev" }
|
|
16810
17395
|
];
|
|
16811
17396
|
return /* @__PURE__ */ jsxs("div", { style: { display: "flex", alignItems: "center", gap: 8 }, children: [
|
|
16812
17397
|
/* @__PURE__ */ jsx("div", { style: { flex: 1 }, children: field.label }),
|
|
@@ -16834,7 +17419,7 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
16834
17419
|
listVisible && /* @__PURE__ */ jsx("div", { style: listContainerStyle, children: isCalendarView ? renderCalendarView() : isGalleryView ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
16835
17420
|
galleryRows.length === 0 ? /* @__PURE__ */ jsxs("div", { style: { display: "inline-flex", alignItems: "center", gap: 6, color: "#bfbfbf", fontSize: 12 }, children: [
|
|
16836
17421
|
/* @__PURE__ */ jsx(FileTextOutlined, { style: { fontSize: 16 } }),
|
|
16837
|
-
|
|
17422
|
+
_34("No images available")
|
|
16838
17423
|
] }) : /* @__PURE__ */ jsx("div", { style: { display: "flex", flexWrap: "wrap", gap: 16 }, children: galleryRows.map((record) => renderGalleryItem(record)) }),
|
|
16839
17424
|
galleryPaginationProps && /* @__PURE__ */ jsx("div", { style: { marginTop: 12, display: "flex", justifyContent: "flex-end" }, children: /* @__PURE__ */ jsx(Pagination, { ...galleryPaginationProps }) })
|
|
16840
17425
|
] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
@@ -16903,7 +17488,7 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
16903
17488
|
dataIndex: field.key,
|
|
16904
17489
|
title: field.label,
|
|
16905
17490
|
sorter: { compare: (a, b) => compareSortValues(field, a, b), multiple: getSortPriority(columnSort, field.key) },
|
|
16906
|
-
align: field.type === "number" && !["eid", "eid_from", "eid_to"].includes(field.key) ? "right" : void 0,
|
|
17491
|
+
align: field.type === "number" && !field.reference && !["eid", "eid_from", "eid_to"].includes(field.key) ? "right" : void 0,
|
|
16907
17492
|
filters: columnFilters.get(field.key),
|
|
16908
17493
|
filteredValue: columnFiltersSelected[field.key] || null,
|
|
16909
17494
|
sortOrder: columnSort.find((item) => item.fieldKey === field.key)?.order ?? null,
|
|
@@ -16963,6 +17548,10 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
16963
17548
|
render: (value, record) => {
|
|
16964
17549
|
const { resource, id } = getTargetInfo(record);
|
|
16965
17550
|
const renderValue = () => {
|
|
17551
|
+
const showToken = normalizeFieldViewType(field.showViewType || "");
|
|
17552
|
+
if (showToken && !(showToken === "read-only-field" && field.reference)) {
|
|
17553
|
+
return renderFieldValue(field, record, allModels, true);
|
|
17554
|
+
}
|
|
16966
17555
|
if (field.reference && value && hasReferenceModel(field.reference, allModels)) {
|
|
16967
17556
|
return /* @__PURE__ */ jsx(
|
|
16968
17557
|
ReferenceField,
|
|
@@ -17011,17 +17600,17 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
17011
17600
|
showActions && /* @__PURE__ */ jsx(
|
|
17012
17601
|
Table.Column,
|
|
17013
17602
|
{
|
|
17014
|
-
title:
|
|
17603
|
+
title: _34("Actions"),
|
|
17015
17604
|
width: 140,
|
|
17016
17605
|
render: (_unused, record) => {
|
|
17017
17606
|
const { resource, id, isLinkRow } = getTargetInfo(record);
|
|
17018
|
-
if (!id || !resource) return /* @__PURE__ */ jsx(Tooltip, { title: `${
|
|
17607
|
+
if (!id || !resource) return /* @__PURE__ */ jsx(Tooltip, { title: `${_34("Debug: Cannot find target")}. ID: ${id}, Resource: ${resource}. Keys: ${Object.keys(record).join(",")}`, children: /* @__PURE__ */ jsx(Button, { size: "small", danger: true, icon: /* @__PURE__ */ jsx(BugOutlined, {}) }) });
|
|
17019
17608
|
const deleteResource = isLinkRow ? model.name : resource;
|
|
17020
17609
|
const deleteId = isLinkRow && relationConfig?.targetKey && relationConfig?.otherKey ? `${record[relationConfig.targetKey]}:${record[relationConfig.otherKey]}` : id;
|
|
17021
17610
|
return /* @__PURE__ */ jsxs(Space, { children: [
|
|
17022
|
-
/* @__PURE__ */ jsx(Tooltip, { title:
|
|
17023
|
-
/* @__PURE__ */ jsx(Tooltip, { title:
|
|
17024
|
-
/* @__PURE__ */ jsx(Tooltip, { title:
|
|
17611
|
+
/* @__PURE__ */ jsx(Tooltip, { title: _34("View"), children: /* @__PURE__ */ jsx(Button, { size: "small", icon: /* @__PURE__ */ jsx(EyeOutlined, {}), onClick: () => go({ to: { resource, action: "show", id } }) }) }),
|
|
17612
|
+
/* @__PURE__ */ jsx(Tooltip, { title: _34("Edit"), children: /* @__PURE__ */ jsx(Button, { size: "small", icon: /* @__PURE__ */ jsx(EditOutlined, {}), onClick: () => go({ to: { resource, action: "edit", id } }) }) }),
|
|
17613
|
+
/* @__PURE__ */ jsx(Tooltip, { title: _34("Delete"), children: /* @__PURE__ */ jsx(DeleteButton, { hideText: true, size: "small", recordItemId: deleteId, resource: deleteResource }) })
|
|
17025
17614
|
] });
|
|
17026
17615
|
}
|
|
17027
17616
|
},
|
|
@@ -17035,7 +17624,7 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
17035
17624
|
Card,
|
|
17036
17625
|
{
|
|
17037
17626
|
size: "small",
|
|
17038
|
-
title: /* @__PURE__ */ jsx("span", { style: { color: modelTone.text, fontWeight: 600 }, children:
|
|
17627
|
+
title: /* @__PURE__ */ jsx("span", { style: { color: modelTone.text, fontWeight: 600 }, children: _34("Analyze") }),
|
|
17039
17628
|
styles: {
|
|
17040
17629
|
header: {
|
|
17041
17630
|
background: `linear-gradient(135deg, ${modelTone.solid}18 0%, ${modelTone.solid}0a 100%)`
|
|
@@ -17064,10 +17653,10 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
17064
17653
|
styles: { body: { display: "grid", gap: 16, position: "relative", paddingTop: 48 } },
|
|
17065
17654
|
children: [
|
|
17066
17655
|
/* @__PURE__ */ jsxs("div", { style: { position: "absolute", top: 0, right: 0, display: "flex", gap: 8 }, children: [
|
|
17067
|
-
/* @__PURE__ */ jsx(Tooltip, { title:
|
|
17068
|
-
/* @__PURE__ */ jsx(Tooltip, { title:
|
|
17069
|
-
/* @__PURE__ */ jsx(Tooltip, { title:
|
|
17070
|
-
/* @__PURE__ */ jsx(Tooltip, { title:
|
|
17656
|
+
/* @__PURE__ */ jsx(Tooltip, { title: _34("Save preferences"), children: /* @__PURE__ */ jsx(Button, { size: "small", icon: /* @__PURE__ */ jsx(SaveOutlined, {}), onClick: () => openSaveViewModalFor("analyze"), loading: isSavingAnalyzePrefs }) }),
|
|
17657
|
+
/* @__PURE__ */ jsx(Tooltip, { title: _34("Stats"), children: /* @__PURE__ */ jsx(Button, { size: "small", icon: /* @__PURE__ */ jsx(FileTextOutlined, {}), onClick: () => setIsStatsFlipped(true) }) }),
|
|
17658
|
+
/* @__PURE__ */ jsx(Tooltip, { title: _34("Export chart PDF"), children: /* @__PURE__ */ jsx(Button, { size: "small", icon: /* @__PURE__ */ jsx(FilePdfOutlined, {}), onClick: exportChartPdf }) }),
|
|
17659
|
+
/* @__PURE__ */ jsx(Tooltip, { title: _34("Export chart PNG"), children: /* @__PURE__ */ jsx(Button, { size: "small", icon: /* @__PURE__ */ jsx(DownloadOutlined, {}), onClick: exportChartImage, "aria-label": _34("Export chart") }) })
|
|
17071
17660
|
] }),
|
|
17072
17661
|
/* @__PURE__ */ jsx(
|
|
17073
17662
|
AnalysisChart,
|
|
@@ -17098,11 +17687,11 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
17098
17687
|
items: [
|
|
17099
17688
|
{
|
|
17100
17689
|
key: "configure-chart",
|
|
17101
|
-
label:
|
|
17690
|
+
label: _34("Customize chart"),
|
|
17102
17691
|
children: /* @__PURE__ */ jsxs("div", { style: { display: "grid", gap: 16 }, children: [
|
|
17103
17692
|
/* @__PURE__ */ jsxs("div", { style: { display: "flex", gap: 16, flexWrap: "wrap" }, children: [
|
|
17104
17693
|
/* @__PURE__ */ jsxs("div", { style: { minWidth: 220, flex: 1 }, children: [
|
|
17105
|
-
/* @__PURE__ */ jsx("div", { style: { fontSize: 12, color: token.colorTextSecondary, marginBottom: 4 }, children:
|
|
17694
|
+
/* @__PURE__ */ jsx("div", { style: { fontSize: 12, color: token.colorTextSecondary, marginBottom: 4 }, children: _34("Category 1") }),
|
|
17106
17695
|
/* @__PURE__ */ jsx(
|
|
17107
17696
|
Select,
|
|
17108
17697
|
{
|
|
@@ -17113,12 +17702,12 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
17113
17702
|
},
|
|
17114
17703
|
style: { width: "100%" },
|
|
17115
17704
|
options: categoricalFields.map((field) => ({ label: field.label, value: field.key })),
|
|
17116
|
-
placeholder:
|
|
17705
|
+
placeholder: _34("Select category")
|
|
17117
17706
|
}
|
|
17118
17707
|
)
|
|
17119
17708
|
] }),
|
|
17120
17709
|
/* @__PURE__ */ jsxs("div", { style: { minWidth: 220, flex: 1 }, children: [
|
|
17121
|
-
/* @__PURE__ */ jsx("div", { style: { fontSize: 12, color: token.colorTextSecondary, marginBottom: 4 }, children:
|
|
17710
|
+
/* @__PURE__ */ jsx("div", { style: { fontSize: 12, color: token.colorTextSecondary, marginBottom: 4 }, children: _34("Category 2") }),
|
|
17122
17711
|
/* @__PURE__ */ jsx(
|
|
17123
17712
|
Select,
|
|
17124
17713
|
{
|
|
@@ -17129,14 +17718,14 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
17129
17718
|
},
|
|
17130
17719
|
style: { width: "100%" },
|
|
17131
17720
|
options: [
|
|
17132
|
-
{ label:
|
|
17721
|
+
{ label: _34("None"), value: "__none__" },
|
|
17133
17722
|
...categoricalFields.filter((field) => field.key !== categoryField1).map((field) => ({ label: field.label, value: field.key }))
|
|
17134
17723
|
]
|
|
17135
17724
|
}
|
|
17136
17725
|
)
|
|
17137
17726
|
] }),
|
|
17138
17727
|
/* @__PURE__ */ jsxs("div", { style: { minWidth: 160 }, children: [
|
|
17139
|
-
/* @__PURE__ */ jsx("div", { style: { fontSize: 12, color: token.colorTextSecondary, marginBottom: 4 }, children:
|
|
17728
|
+
/* @__PURE__ */ jsx("div", { style: { fontSize: 12, color: token.colorTextSecondary, marginBottom: 4 }, children: _34("Chart Type") }),
|
|
17140
17729
|
/* @__PURE__ */ jsx(
|
|
17141
17730
|
Select,
|
|
17142
17731
|
{
|
|
@@ -17147,30 +17736,30 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
17147
17736
|
},
|
|
17148
17737
|
style: { width: "100%" },
|
|
17149
17738
|
options: [
|
|
17150
|
-
{ label:
|
|
17151
|
-
{ label:
|
|
17152
|
-
{ label:
|
|
17153
|
-
{ label:
|
|
17154
|
-
{ label:
|
|
17155
|
-
{ label:
|
|
17156
|
-
{ label:
|
|
17157
|
-
{ label:
|
|
17158
|
-
{ label:
|
|
17159
|
-
{ label:
|
|
17160
|
-
{ label:
|
|
17161
|
-
{ label:
|
|
17162
|
-
{ label:
|
|
17163
|
-
{ label:
|
|
17164
|
-
{ label:
|
|
17165
|
-
{ label:
|
|
17166
|
-
{ label:
|
|
17167
|
-
{ label:
|
|
17739
|
+
{ label: _34("Area"), value: "area" },
|
|
17740
|
+
{ label: _34("Horizontal Area"), value: "area-horizontal" },
|
|
17741
|
+
{ label: _34("Bars"), value: "bar" },
|
|
17742
|
+
{ label: _34("Stacked Bars"), value: "stacked" },
|
|
17743
|
+
{ label: _34("Horizontal Bars"), value: "bar-horizontal" },
|
|
17744
|
+
{ label: _34("Horizontal Stacked"), value: "stacked-horizontal" },
|
|
17745
|
+
{ label: _34("Lines"), value: "line" },
|
|
17746
|
+
{ label: _34("Pie"), value: "pie" },
|
|
17747
|
+
{ label: _34("Donut"), value: "donut" },
|
|
17748
|
+
{ label: _34("Scatter"), value: "scatter" },
|
|
17749
|
+
{ label: _34("Bubble"), value: "bubble" },
|
|
17750
|
+
{ label: _34("Histogram"), value: "histogram" },
|
|
17751
|
+
{ label: _34("Box Plot"), value: "box" },
|
|
17752
|
+
{ label: _34("Waterfall"), value: "waterfall" },
|
|
17753
|
+
{ label: _34("Heatmap"), value: "heatmap" },
|
|
17754
|
+
{ label: _34("Crosstab"), value: "crosstab" },
|
|
17755
|
+
{ label: _34("Radar"), value: "radar" },
|
|
17756
|
+
{ label: _34("Combo (Bar + Line)"), value: "combo" }
|
|
17168
17757
|
]
|
|
17169
17758
|
}
|
|
17170
17759
|
)
|
|
17171
17760
|
] }),
|
|
17172
17761
|
/* @__PURE__ */ jsxs("div", { style: { minWidth: 200 }, children: [
|
|
17173
|
-
/* @__PURE__ */ jsx("div", { style: { fontSize: 12, color: token.colorTextSecondary, marginBottom: 4 }, children:
|
|
17762
|
+
/* @__PURE__ */ jsx("div", { style: { fontSize: 12, color: token.colorTextSecondary, marginBottom: 4 }, children: _34("Summary") }),
|
|
17174
17763
|
/* @__PURE__ */ jsx(
|
|
17175
17764
|
Select,
|
|
17176
17765
|
{
|
|
@@ -17181,18 +17770,18 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
17181
17770
|
},
|
|
17182
17771
|
style: { width: "100%" },
|
|
17183
17772
|
options: [
|
|
17184
|
-
{ label:
|
|
17185
|
-
{ label:
|
|
17186
|
-
{ label:
|
|
17187
|
-
{ label:
|
|
17188
|
-
{ label:
|
|
17189
|
-
{ label:
|
|
17773
|
+
{ label: _34("Sum"), value: "sum" },
|
|
17774
|
+
{ label: _34("Average"), value: "avg" },
|
|
17775
|
+
{ label: _34("Count"), value: "count" },
|
|
17776
|
+
{ label: _34("Max"), value: "max" },
|
|
17777
|
+
{ label: _34("Min"), value: "min" },
|
|
17778
|
+
{ label: _34("Std Dev"), value: "stddev" }
|
|
17190
17779
|
]
|
|
17191
17780
|
}
|
|
17192
17781
|
)
|
|
17193
17782
|
] }),
|
|
17194
17783
|
/* @__PURE__ */ jsxs("div", { style: { minWidth: 180 }, children: [
|
|
17195
|
-
/* @__PURE__ */ jsx("div", { style: { fontSize: 12, color: token.colorTextSecondary, marginBottom: 4 }, children:
|
|
17784
|
+
/* @__PURE__ */ jsx("div", { style: { fontSize: 12, color: token.colorTextSecondary, marginBottom: 4 }, children: _34("Ranking Filter") }),
|
|
17196
17785
|
/* @__PURE__ */ jsx(
|
|
17197
17786
|
Select,
|
|
17198
17787
|
{
|
|
@@ -17203,15 +17792,15 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
17203
17792
|
},
|
|
17204
17793
|
style: { width: "100%" },
|
|
17205
17794
|
options: [
|
|
17206
|
-
{ label:
|
|
17207
|
-
{ label:
|
|
17208
|
-
{ label:
|
|
17795
|
+
{ label: _34("None"), value: "none" },
|
|
17796
|
+
{ label: _34("Top N"), value: "top" },
|
|
17797
|
+
{ label: _34("Bottom N"), value: "bottom" }
|
|
17209
17798
|
]
|
|
17210
17799
|
}
|
|
17211
17800
|
)
|
|
17212
17801
|
] }),
|
|
17213
17802
|
/* @__PURE__ */ jsxs("div", { style: { minWidth: 220 }, children: [
|
|
17214
|
-
/* @__PURE__ */ jsx("div", { style: { fontSize: 12, color: token.colorTextSecondary, marginBottom: 4 }, children:
|
|
17803
|
+
/* @__PURE__ */ jsx("div", { style: { fontSize: 12, color: token.colorTextSecondary, marginBottom: 4 }, children: _34("Ranking Column") }),
|
|
17215
17804
|
/* @__PURE__ */ jsx(
|
|
17216
17805
|
Select,
|
|
17217
17806
|
{
|
|
@@ -17222,13 +17811,13 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
17222
17811
|
},
|
|
17223
17812
|
style: { width: "100%" },
|
|
17224
17813
|
options: numericFields.map((field) => ({ label: field.label, value: field.key })),
|
|
17225
|
-
placeholder:
|
|
17814
|
+
placeholder: _34("Select numeric column"),
|
|
17226
17815
|
disabled: rankingMode === "none" || numericFields.length === 0
|
|
17227
17816
|
}
|
|
17228
17817
|
)
|
|
17229
17818
|
] }),
|
|
17230
17819
|
/* @__PURE__ */ jsxs("div", { style: { minWidth: 120 }, children: [
|
|
17231
|
-
/* @__PURE__ */ jsx("div", { style: { fontSize: 12, color: token.colorTextSecondary, marginBottom: 4 }, children:
|
|
17820
|
+
/* @__PURE__ */ jsx("div", { style: { fontSize: 12, color: token.colorTextSecondary, marginBottom: 4 }, children: _34("N") }),
|
|
17232
17821
|
/* @__PURE__ */ jsx(
|
|
17233
17822
|
InputNumber,
|
|
17234
17823
|
{
|
|
@@ -17247,8 +17836,8 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
17247
17836
|
] }),
|
|
17248
17837
|
/* @__PURE__ */ jsxs("div", { children: [
|
|
17249
17838
|
/* @__PURE__ */ jsxs("div", { style: { display: "flex", alignItems: "center", justifyContent: "space-between", gap: 12, marginBottom: 6 }, children: [
|
|
17250
|
-
/* @__PURE__ */ jsx("div", { style: { fontSize: 12, color: token.colorTextSecondary }, children:
|
|
17251
|
-
/* @__PURE__ */ jsx(Tooltip, { title:
|
|
17839
|
+
/* @__PURE__ */ jsx("div", { style: { fontSize: 12, color: token.colorTextSecondary }, children: _34("Series") }),
|
|
17840
|
+
/* @__PURE__ */ jsx(Tooltip, { title: _34("Unselect All"), children: /* @__PURE__ */ jsx(
|
|
17252
17841
|
Button,
|
|
17253
17842
|
{
|
|
17254
17843
|
size: "small",
|
|
@@ -17268,11 +17857,11 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
17268
17857
|
markAnalyzePrefsTouched();
|
|
17269
17858
|
setSelectedSeriesKeys(values);
|
|
17270
17859
|
},
|
|
17271
|
-
options: numericFields.length > 0 ? numericFields.map((field) => ({ label: field.label, value: field.key })) : [{ label:
|
|
17860
|
+
options: numericFields.length > 0 ? numericFields.map((field) => ({ label: field.label, value: field.key })) : [{ label: _34("Count"), value: "__count__" }]
|
|
17272
17861
|
}
|
|
17273
17862
|
)
|
|
17274
17863
|
] }),
|
|
17275
|
-
isAllRowsLoading && /* @__PURE__ */ jsx("div", { style: { color: token.colorTextSecondary, fontSize: 12 }, children:
|
|
17864
|
+
isAllRowsLoading && /* @__PURE__ */ jsx("div", { style: { color: token.colorTextSecondary, fontSize: 12 }, children: _34("Loading all rows for analysis...") }),
|
|
17276
17865
|
allRowsError && /* @__PURE__ */ jsx("div", { style: { color: token.colorError, fontSize: 12 }, children: allRowsError })
|
|
17277
17866
|
] })
|
|
17278
17867
|
}
|
|
@@ -17295,11 +17884,11 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
17295
17884
|
styles: { body: { display: "grid", gap: 16, position: "relative", paddingTop: 48 } },
|
|
17296
17885
|
children: [
|
|
17297
17886
|
/* @__PURE__ */ jsxs("div", { style: { position: "absolute", top: 0, right: 0, display: "flex", gap: 8 }, children: [
|
|
17298
|
-
/* @__PURE__ */ jsx(Tooltip, { title:
|
|
17299
|
-
/* @__PURE__ */ jsx(Tooltip, { title:
|
|
17887
|
+
/* @__PURE__ */ jsx(Tooltip, { title: _34("Analysis"), children: /* @__PURE__ */ jsx(Button, { size: "small", icon: /* @__PURE__ */ jsx(BarChartOutlined, {}), onClick: () => setIsStatsFlipped(false) }) }),
|
|
17888
|
+
/* @__PURE__ */ jsx(Tooltip, { title: _34("Export stats PDF"), children: /* @__PURE__ */ jsx(Button, { size: "small", icon: /* @__PURE__ */ jsx(FilePdfOutlined, {}), onClick: exportStatsPdf }) })
|
|
17300
17889
|
] }),
|
|
17301
17890
|
/* @__PURE__ */ jsxs("div", { style: { display: "grid", gap: 16 }, children: [
|
|
17302
|
-
statsSummary.numericStats.length > 0 && /* @__PURE__ */ jsx(Card, { size: "small", title: /* @__PURE__ */ jsx("span", { style: statsTitleStyle, children:
|
|
17891
|
+
statsSummary.numericStats.length > 0 && /* @__PURE__ */ jsx(Card, { size: "small", title: /* @__PURE__ */ jsx("span", { style: statsTitleStyle, children: _34("Numeric columns") }), children: /* @__PURE__ */ jsxs(
|
|
17303
17892
|
Table,
|
|
17304
17893
|
{
|
|
17305
17894
|
dataSource: statsSummary.numericStats,
|
|
@@ -17310,18 +17899,18 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
17310
17899
|
/* @__PURE__ */ jsx(
|
|
17311
17900
|
Table.Column,
|
|
17312
17901
|
{
|
|
17313
|
-
title:
|
|
17902
|
+
title: _34("Field"),
|
|
17314
17903
|
dataIndex: "label",
|
|
17315
17904
|
render: (label) => /* @__PURE__ */ jsx("span", { style: statsLabelStyle, children: label }),
|
|
17316
17905
|
onHeaderCell: () => ({ style: statsHeaderStyle })
|
|
17317
17906
|
},
|
|
17318
17907
|
"label"
|
|
17319
17908
|
),
|
|
17320
|
-
/* @__PURE__ */ jsx(Table.Column, { title:
|
|
17321
|
-
/* @__PURE__ */ jsx(Table.Column, { title:
|
|
17322
|
-
/* @__PURE__ */ jsx(Table.Column, { title:
|
|
17323
|
-
/* @__PURE__ */ jsx(Table.Column, { title:
|
|
17324
|
-
/* @__PURE__ */ jsx(Table.Column, { title:
|
|
17909
|
+
/* @__PURE__ */ jsx(Table.Column, { title: _34("Sum"), align: "right", render: (_unused, row) => renderStatBar(row.sum, statsNumericMaxes.sum, formatNumberValue), onHeaderCell: () => ({ style: statsHeaderStyle }) }, "sum"),
|
|
17910
|
+
/* @__PURE__ */ jsx(Table.Column, { title: _34("Average"), align: "right", render: (_unused, row) => renderStatBar(row.avg, statsNumericMaxes.avg, formatNumberValue), onHeaderCell: () => ({ style: statsHeaderStyle }) }, "avg"),
|
|
17911
|
+
/* @__PURE__ */ jsx(Table.Column, { title: _34("Min"), align: "right", render: (_unused, row) => renderStatBar(row.min, statsNumericMaxes.min, formatNumberValue), onHeaderCell: () => ({ style: statsHeaderStyle }) }, "min"),
|
|
17912
|
+
/* @__PURE__ */ jsx(Table.Column, { title: _34("Max"), align: "right", render: (_unused, row) => renderStatBar(row.max, statsNumericMaxes.max, formatNumberValue), onHeaderCell: () => ({ style: statsHeaderStyle }) }, "max"),
|
|
17913
|
+
/* @__PURE__ */ jsx(Table.Column, { title: _34("Std Dev"), align: "right", render: (_unused, row) => renderStatBar(row.stddev, statsNumericMaxes.stddev, formatNumberValue), onHeaderCell: () => ({ style: statsHeaderStyle }) }, "stddev")
|
|
17325
17914
|
]
|
|
17326
17915
|
}
|
|
17327
17916
|
) }),
|
|
@@ -17333,7 +17922,7 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
17333
17922
|
items: [
|
|
17334
17923
|
{
|
|
17335
17924
|
key: "categorical-columns",
|
|
17336
|
-
label: /* @__PURE__ */ jsx("span", { style: statsTitleStyle, children:
|
|
17925
|
+
label: /* @__PURE__ */ jsx("span", { style: statsTitleStyle, children: _34("Categorical columns (distinct < 20)") }),
|
|
17337
17926
|
children: statsSummary.categoricalStats.map((field) => /* @__PURE__ */ jsxs("div", { style: { marginBottom: 12 }, children: [
|
|
17338
17927
|
/* @__PURE__ */ jsx("div", { style: { fontWeight: 600, marginBottom: 4 }, children: /* @__PURE__ */ jsx("span", { style: statsLabelStyle, children: field.label }) }),
|
|
17339
17928
|
/* @__PURE__ */ jsxs(
|
|
@@ -17344,11 +17933,11 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
17344
17933
|
pagination: false,
|
|
17345
17934
|
rowKey: (row) => row.value,
|
|
17346
17935
|
children: [
|
|
17347
|
-
/* @__PURE__ */ jsx(Table.Column, { title:
|
|
17936
|
+
/* @__PURE__ */ jsx(Table.Column, { title: _34("Value"), dataIndex: "value", onHeaderCell: () => ({ style: statsHeaderStyle }) }, "value"),
|
|
17348
17937
|
/* @__PURE__ */ jsx(
|
|
17349
17938
|
Table.Column,
|
|
17350
17939
|
{
|
|
17351
|
-
title:
|
|
17940
|
+
title: _34("Count"),
|
|
17352
17941
|
dataIndex: "count",
|
|
17353
17942
|
align: "right",
|
|
17354
17943
|
onHeaderCell: () => ({ style: statsHeaderStyle }),
|
|
@@ -17389,7 +17978,7 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
17389
17978
|
columnsToggleButton,
|
|
17390
17979
|
listToggleButton,
|
|
17391
17980
|
exportButton,
|
|
17392
|
-
renderIconOnlyButtons(defaultButtons)
|
|
17981
|
+
!model.isNamedQuery && renderIconOnlyButtons(defaultButtons)
|
|
17393
17982
|
] });
|
|
17394
17983
|
return /* @__PURE__ */ jsxs("div", { className: "jm-tone-scope", style: toneScopeStyle(modelTone), children: [
|
|
17395
17984
|
/* @__PURE__ */ jsx(ToneSharedStyles, {}),
|
|
@@ -17431,7 +18020,7 @@ function applyPanesToSearchParams(existing, panes) {
|
|
|
17431
18020
|
panes.forEach((p) => next.append("pane", `${p.resource}:${p.id}`));
|
|
17432
18021
|
return next;
|
|
17433
18022
|
}
|
|
17434
|
-
var
|
|
18023
|
+
var _35 = window._ || ((text) => text);
|
|
17435
18024
|
var LIST_PANEL_ID = "list-panel";
|
|
17436
18025
|
var detailPanelId = (idx) => `detail-panel-${idx}`;
|
|
17437
18026
|
var COLLAPSED_SIZE = 10;
|
|
@@ -17473,7 +18062,7 @@ var PaneToolbar = ({ model, pane, allModels, onClose, onMinimize, onMaximize })
|
|
|
17473
18062
|
minHeight: PANE_TOOLBAR_HEIGHT
|
|
17474
18063
|
},
|
|
17475
18064
|
children: [
|
|
17476
|
-
/* @__PURE__ */ jsx(Tooltip, { title:
|
|
18065
|
+
/* @__PURE__ */ jsx(Tooltip, { title: _35("Open in full page"), children: /* @__PURE__ */ jsx(
|
|
17477
18066
|
"a",
|
|
17478
18067
|
{
|
|
17479
18068
|
href,
|
|
@@ -17483,7 +18072,7 @@ var PaneToolbar = ({ model, pane, allModels, onClose, onMinimize, onMaximize })
|
|
|
17483
18072
|
children: /* @__PURE__ */ jsx(LinkOutlined, { style: { fontSize: 11 } })
|
|
17484
18073
|
}
|
|
17485
18074
|
) }),
|
|
17486
|
-
/* @__PURE__ */ jsx(Tooltip, { title:
|
|
18075
|
+
/* @__PURE__ */ jsx(Tooltip, { title: _35("Minimize pane"), children: /* @__PURE__ */ jsx(
|
|
17487
18076
|
Button,
|
|
17488
18077
|
{
|
|
17489
18078
|
type: "text",
|
|
@@ -17493,7 +18082,7 @@ var PaneToolbar = ({ model, pane, allModels, onClose, onMinimize, onMaximize })
|
|
|
17493
18082
|
style: { color: token.colorTextTertiary, padding: "0 4px", height: 22, minWidth: 22 }
|
|
17494
18083
|
}
|
|
17495
18084
|
) }),
|
|
17496
|
-
/* @__PURE__ */ jsx(Tooltip, { title:
|
|
18085
|
+
/* @__PURE__ */ jsx(Tooltip, { title: _35("Maximize pane"), children: /* @__PURE__ */ jsx(
|
|
17497
18086
|
Button,
|
|
17498
18087
|
{
|
|
17499
18088
|
type: "text",
|
|
@@ -17503,7 +18092,7 @@ var PaneToolbar = ({ model, pane, allModels, onClose, onMinimize, onMaximize })
|
|
|
17503
18092
|
style: { color: token.colorTextTertiary, padding: "0 4px", height: 22, minWidth: 22 }
|
|
17504
18093
|
}
|
|
17505
18094
|
) }),
|
|
17506
|
-
/* @__PURE__ */ jsx(Tooltip, { title:
|
|
18095
|
+
/* @__PURE__ */ jsx(Tooltip, { title: _35("Close pane"), children: /* @__PURE__ */ jsx(
|
|
17507
18096
|
Button,
|
|
17508
18097
|
{
|
|
17509
18098
|
type: "text",
|
|
@@ -17668,7 +18257,7 @@ var MultiPaneLayout = ({ children }) => {
|
|
|
17668
18257
|
[openDetail]
|
|
17669
18258
|
);
|
|
17670
18259
|
const detailPaneContexts = useMemo(
|
|
17671
|
-
() => panes.map((
|
|
18260
|
+
() => panes.map((_41, idx) => ({
|
|
17672
18261
|
isInMultiPane: true,
|
|
17673
18262
|
paneIndex: idx + 1,
|
|
17674
18263
|
openDetail: (resource, id) => openDetail(idx + 1, resource, id)
|
|
@@ -17729,7 +18318,7 @@ var MultiPaneLayout = ({ children }) => {
|
|
|
17729
18318
|
) });
|
|
17730
18319
|
};
|
|
17731
18320
|
var { Title: Title8 } = Typography;
|
|
17732
|
-
var
|
|
18321
|
+
var _36 = window._ || ((text) => text);
|
|
17733
18322
|
var HierarchyView = ({ resource, recordId, fallback }) => {
|
|
17734
18323
|
const go = useGo();
|
|
17735
18324
|
const { data: ancestorsData, isLoading: ancestorsLoading, error: ancestorsError } = useCustom({
|
|
@@ -17782,15 +18371,15 @@ var HierarchyView = ({ resource, recordId, fallback }) => {
|
|
|
17782
18371
|
}
|
|
17783
18372
|
if (ancestorsError || descendantsError) {
|
|
17784
18373
|
if (fallback) return /* @__PURE__ */ jsx(Fragment, { children: fallback });
|
|
17785
|
-
return /* @__PURE__ */ jsx(Alert, { message:
|
|
18374
|
+
return /* @__PURE__ */ jsx(Alert, { message: _36("Error loading hierarchy data"), type: "error" });
|
|
17786
18375
|
}
|
|
17787
18376
|
return /* @__PURE__ */ jsxs("div", { children: [
|
|
17788
18377
|
ancestorsList.length > 0 && /* @__PURE__ */ jsxs("div", { style: { marginBottom: 24 }, children: [
|
|
17789
|
-
/* @__PURE__ */ jsx(Title8, { level: 5, children:
|
|
18378
|
+
/* @__PURE__ */ jsx(Title8, { level: 5, children: _36("Parent Hierarchy") }),
|
|
17790
18379
|
/* @__PURE__ */ jsx(Breadcrumb, { children: ancestorsList.slice().reverse().map((node) => /* @__PURE__ */ jsx(Breadcrumb.Item, { children: /* @__PURE__ */ jsx("a", { onClick: () => go({ to: { resource, action: "show", id: node.cw_eid } }), children: node._label }) }, node.cw_eid)) })
|
|
17791
18380
|
] }),
|
|
17792
18381
|
treeData.length > 0 && /* @__PURE__ */ jsxs("div", { children: [
|
|
17793
|
-
/* @__PURE__ */ jsx(Title8, { level: 5, children:
|
|
18382
|
+
/* @__PURE__ */ jsx(Title8, { level: 5, children: _36("Sub-hierarchy") }),
|
|
17794
18383
|
/* @__PURE__ */ jsx(
|
|
17795
18384
|
Tree,
|
|
17796
18385
|
{
|
|
@@ -17862,7 +18451,7 @@ var TOKEN_KEY2 = "jm_access_token";
|
|
|
17862
18451
|
var USER_KEY2 = "jm_user";
|
|
17863
18452
|
var ROLE_PERMISSIONS_KEY = "jm_role_permissions";
|
|
17864
18453
|
var RESOURCE_PERMISSIONS_KEY = "jm_resource_permissions";
|
|
17865
|
-
var
|
|
18454
|
+
var _37 = window._ || ((text) => text);
|
|
17866
18455
|
var authProvider = {
|
|
17867
18456
|
/**
|
|
17868
18457
|
* Authenticate by username + password.
|
|
@@ -17880,8 +18469,8 @@ var authProvider = {
|
|
|
17880
18469
|
return {
|
|
17881
18470
|
success: false,
|
|
17882
18471
|
error: {
|
|
17883
|
-
name:
|
|
17884
|
-
message: body?.detail ||
|
|
18472
|
+
name: _37("Login failed"),
|
|
18473
|
+
message: body?.detail || _37("Invalid credentials")
|
|
17885
18474
|
}
|
|
17886
18475
|
};
|
|
17887
18476
|
}
|
|
@@ -17913,8 +18502,8 @@ var authProvider = {
|
|
|
17913
18502
|
return {
|
|
17914
18503
|
success: false,
|
|
17915
18504
|
error: {
|
|
17916
|
-
name:
|
|
17917
|
-
message: err?.message ||
|
|
18505
|
+
name: _37("Login failed"),
|
|
18506
|
+
message: err?.message || _37("Network error")
|
|
17918
18507
|
}
|
|
17919
18508
|
};
|
|
17920
18509
|
}
|
|
@@ -17995,7 +18584,7 @@ var authProvider = {
|
|
|
17995
18584
|
var USER_KEY3 = "jm_user";
|
|
17996
18585
|
var ROLE_PERMISSIONS_KEY2 = "jm_role_permissions";
|
|
17997
18586
|
var RESOURCE_PERMISSIONS_KEY2 = "jm_resource_permissions";
|
|
17998
|
-
var
|
|
18587
|
+
var _38 = window._ || ((text) => text);
|
|
17999
18588
|
var FALLBACK_ROLE_ACTIONS = {
|
|
18000
18589
|
Admin: ["list", "show", "create", "edit", "delete", "clone", "field"],
|
|
18001
18590
|
Manager: ["list", "show", "create", "edit", "clone", "field"],
|
|
@@ -18027,13 +18616,13 @@ var accessControlProvider = {
|
|
|
18027
18616
|
can: async ({ action, resource }) => {
|
|
18028
18617
|
const cached = localStorage.getItem(USER_KEY3);
|
|
18029
18618
|
if (!cached) {
|
|
18030
|
-
return { can: false, reason:
|
|
18619
|
+
return { can: false, reason: _38("Not authenticated") };
|
|
18031
18620
|
}
|
|
18032
18621
|
let user;
|
|
18033
18622
|
try {
|
|
18034
18623
|
user = JSON.parse(cached);
|
|
18035
18624
|
} catch {
|
|
18036
|
-
return { can: false, reason:
|
|
18625
|
+
return { can: false, reason: _38("Not authenticated") };
|
|
18037
18626
|
}
|
|
18038
18627
|
const roles = user?.roles ?? [];
|
|
18039
18628
|
if (roles.some((r) => r.toLowerCase() === "admin")) {
|
|
@@ -18059,7 +18648,7 @@ var accessControlProvider = {
|
|
|
18059
18648
|
}
|
|
18060
18649
|
return {
|
|
18061
18650
|
can: false,
|
|
18062
|
-
reason:
|
|
18651
|
+
reason: _38("Access denied \u2014 insufficient role for this action")
|
|
18063
18652
|
};
|
|
18064
18653
|
},
|
|
18065
18654
|
options: {
|
|
@@ -18147,7 +18736,7 @@ var ResourceContext = createContext({
|
|
|
18147
18736
|
allResources: [],
|
|
18148
18737
|
allSystemModels: []
|
|
18149
18738
|
});
|
|
18150
|
-
var
|
|
18739
|
+
var _39 = window._ || ((text) => text);
|
|
18151
18740
|
var LoginPage = ({ appTitle = "VeloIQ", logo }) => {
|
|
18152
18741
|
const { mutate: login, isLoading, error } = useLogin();
|
|
18153
18742
|
const [form] = Form.useForm();
|
|
@@ -18176,14 +18765,14 @@ var LoginPage = ({ appTitle = "VeloIQ", logo }) => {
|
|
|
18176
18765
|
/* @__PURE__ */ jsxs("div", { style: { textAlign: "center" }, children: [
|
|
18177
18766
|
logo && /* @__PURE__ */ jsx("div", { style: { marginBottom: 8 }, children: typeof logo === "string" ? /* @__PURE__ */ jsx("img", { src: logo, alt: appTitle, style: { height: 48, width: "auto" } }) : logo }),
|
|
18178
18767
|
/* @__PURE__ */ jsx(Typography.Title, { level: 3, style: { marginBottom: 4 }, children: appTitle }),
|
|
18179
|
-
/* @__PURE__ */ jsx(Typography.Text, { type: "secondary", children:
|
|
18768
|
+
/* @__PURE__ */ jsx(Typography.Text, { type: "secondary", children: _39("Sign in to your account") })
|
|
18180
18769
|
] }),
|
|
18181
18770
|
error && /* @__PURE__ */ jsx(
|
|
18182
18771
|
Alert,
|
|
18183
18772
|
{
|
|
18184
18773
|
type: "error",
|
|
18185
|
-
message: error?.name ||
|
|
18186
|
-
description: error?.message ||
|
|
18774
|
+
message: error?.name || _39("Login failed"),
|
|
18775
|
+
description: error?.message || _39("Invalid credentials"),
|
|
18187
18776
|
showIcon: true
|
|
18188
18777
|
}
|
|
18189
18778
|
),
|
|
@@ -18199,13 +18788,13 @@ var LoginPage = ({ appTitle = "VeloIQ", logo }) => {
|
|
|
18199
18788
|
Form.Item,
|
|
18200
18789
|
{
|
|
18201
18790
|
name: "username",
|
|
18202
|
-
label:
|
|
18203
|
-
rules: [{ required: true, message:
|
|
18791
|
+
label: _39("Username"),
|
|
18792
|
+
rules: [{ required: true, message: _39("Please enter your username") }],
|
|
18204
18793
|
children: /* @__PURE__ */ jsx(
|
|
18205
18794
|
Input,
|
|
18206
18795
|
{
|
|
18207
18796
|
prefix: /* @__PURE__ */ jsx(UserOutlined, {}),
|
|
18208
|
-
placeholder:
|
|
18797
|
+
placeholder: _39("Username"),
|
|
18209
18798
|
size: "large"
|
|
18210
18799
|
}
|
|
18211
18800
|
)
|
|
@@ -18215,13 +18804,13 @@ var LoginPage = ({ appTitle = "VeloIQ", logo }) => {
|
|
|
18215
18804
|
Form.Item,
|
|
18216
18805
|
{
|
|
18217
18806
|
name: "password",
|
|
18218
|
-
label:
|
|
18219
|
-
rules: [{ required: true, message:
|
|
18807
|
+
label: _39("Password"),
|
|
18808
|
+
rules: [{ required: true, message: _39("Please enter your password") }],
|
|
18220
18809
|
children: /* @__PURE__ */ jsx(
|
|
18221
18810
|
Input.Password,
|
|
18222
18811
|
{
|
|
18223
18812
|
prefix: /* @__PURE__ */ jsx(LockOutlined, {}),
|
|
18224
|
-
placeholder:
|
|
18813
|
+
placeholder: _39("Password"),
|
|
18225
18814
|
size: "large"
|
|
18226
18815
|
}
|
|
18227
18816
|
)
|
|
@@ -18235,7 +18824,7 @@ var LoginPage = ({ appTitle = "VeloIQ", logo }) => {
|
|
|
18235
18824
|
loading: isLoading,
|
|
18236
18825
|
block: true,
|
|
18237
18826
|
size: "large",
|
|
18238
|
-
children:
|
|
18827
|
+
children: _39("Login")
|
|
18239
18828
|
}
|
|
18240
18829
|
) })
|
|
18241
18830
|
]
|
|
@@ -18374,6 +18963,7 @@ var CellConfigDrawer = ({ open, cell, tabId, config, onClose, onSave }) => {
|
|
|
18374
18963
|
onSave({ ...config, tabs: nextTabs });
|
|
18375
18964
|
onClose();
|
|
18376
18965
|
};
|
|
18966
|
+
const tabOptions = config.tabs.map((t) => ({ value: t.name, label: t.name }));
|
|
18377
18967
|
return /* @__PURE__ */ jsx(
|
|
18378
18968
|
Drawer,
|
|
18379
18969
|
{
|
|
@@ -18388,7 +18978,14 @@ var CellConfigDrawer = ({ open, cell, tabId, config, onClose, onSave }) => {
|
|
|
18388
18978
|
] }),
|
|
18389
18979
|
children: /* @__PURE__ */ jsxs(Form, { form, layout: "vertical", size: "small", children: [
|
|
18390
18980
|
/* @__PURE__ */ jsx(Divider, { orientation: "left", children: "Tab" }),
|
|
18391
|
-
/* @__PURE__ */ jsx(Form.Item, { name: "tabName", label: "Tab name", children: /* @__PURE__ */ jsx(
|
|
18981
|
+
/* @__PURE__ */ jsx(Form.Item, { name: "tabName", label: "Tab name", children: /* @__PURE__ */ jsx(
|
|
18982
|
+
AutoComplete,
|
|
18983
|
+
{
|
|
18984
|
+
options: tabOptions,
|
|
18985
|
+
filterOption: false,
|
|
18986
|
+
placeholder: "Select existing or type a new name"
|
|
18987
|
+
}
|
|
18988
|
+
) }),
|
|
18392
18989
|
/* @__PURE__ */ jsx(Divider, { orientation: "left", children: "Position" }),
|
|
18393
18990
|
/* @__PURE__ */ jsxs(Space, { children: [
|
|
18394
18991
|
/* @__PURE__ */ jsx(Form.Item, { name: "row", label: "Row", style: { marginBottom: 0 }, children: /* @__PURE__ */ jsx(InputNumber, { min: 1, style: { width: 80 } }) }),
|
|
@@ -18428,10 +19025,12 @@ var CellConfigDrawer = ({ open, cell, tabId, config, onClose, onSave }) => {
|
|
|
18428
19025
|
}
|
|
18429
19026
|
);
|
|
18430
19027
|
};
|
|
18431
|
-
var DashboardGridCell = ({ cell, allModels, isMaximized, isMinimized, onConfigure, onMaximize, onMinimize }) => {
|
|
19028
|
+
var DashboardGridCell = ({ cell, allModels, isMaximized, isMinimized, onConfigure, onMaximize, onMinimize, onResize }) => {
|
|
18432
19029
|
const { token } = theme.useToken();
|
|
18433
19030
|
const model = findModelByName(allModels, cell.model);
|
|
19031
|
+
const cellRef = useRef(null);
|
|
18434
19032
|
const cellStyle = {
|
|
19033
|
+
position: "relative",
|
|
18435
19034
|
border: `1px solid ${token.colorBorderSecondary}`,
|
|
18436
19035
|
borderRadius: token.borderRadiusLG,
|
|
18437
19036
|
overflow: "hidden",
|
|
@@ -18460,20 +19059,81 @@ var DashboardGridCell = ({ cell, allModels, isMaximized, isMinimized, onConfigur
|
|
|
18460
19059
|
};
|
|
18461
19060
|
const resource = model?.resource || cell.model;
|
|
18462
19061
|
const cellTitle = model?.label || cell.model;
|
|
18463
|
-
|
|
19062
|
+
const tone = model ? getModelTone(model) : null;
|
|
19063
|
+
const startResize = useCallback((e, dir) => {
|
|
19064
|
+
e.preventDefault();
|
|
19065
|
+
e.stopPropagation();
|
|
19066
|
+
const el = cellRef.current;
|
|
19067
|
+
if (!el) return;
|
|
19068
|
+
const { width: startW, height: startH } = el.getBoundingClientRect();
|
|
19069
|
+
const startX = e.clientX;
|
|
19070
|
+
const startY = e.clientY;
|
|
19071
|
+
const handle = e.currentTarget;
|
|
19072
|
+
handle.setPointerCapture(e.pointerId);
|
|
19073
|
+
const prevCursor = document.body.style.cursor;
|
|
19074
|
+
document.body.style.cursor = dir === "s" ? "ns-resize" : dir === "e" ? "ew-resize" : "nwse-resize";
|
|
19075
|
+
const onMove = (ev) => {
|
|
19076
|
+
if (dir !== "e") el.style.minHeight = `${Math.max(200, Math.round(startH + ev.clientY - startY))}px`;
|
|
19077
|
+
if (dir !== "s") el.style.minWidth = `${Math.max(200, Math.round(startW + ev.clientX - startX))}px`;
|
|
19078
|
+
};
|
|
19079
|
+
const onUp = (ev) => {
|
|
19080
|
+
handle.removeEventListener("pointermove", onMove);
|
|
19081
|
+
handle.removeEventListener("pointerup", onUp);
|
|
19082
|
+
document.body.style.cursor = prevCursor;
|
|
19083
|
+
const newH = dir !== "e" ? `${Math.max(200, Math.round(startH + ev.clientY - startY))}px` : null;
|
|
19084
|
+
const newW = dir !== "s" ? `${Math.max(200, Math.round(startW + ev.clientX - startX))}px` : null;
|
|
19085
|
+
onResize(newW, newH);
|
|
19086
|
+
};
|
|
19087
|
+
handle.addEventListener("pointermove", onMove);
|
|
19088
|
+
handle.addEventListener("pointerup", onUp);
|
|
19089
|
+
}, [onResize]);
|
|
19090
|
+
const handleBase = {
|
|
19091
|
+
position: "absolute",
|
|
19092
|
+
zIndex: 10
|
|
19093
|
+
};
|
|
19094
|
+
return /* @__PURE__ */ jsxs("div", { ref: cellRef, style: cellStyle, className: "jm-dashboard-cell", children: [
|
|
18464
19095
|
/* @__PURE__ */ jsx("style", { children: `
|
|
18465
|
-
.jm-dashboard-cell .jm-cell-actions
|
|
18466
|
-
.jm-dashboard-cell:hover .jm-cell-actions
|
|
19096
|
+
.jm-dashboard-cell .jm-cell-actions { opacity: 0; transition: opacity 0.15s; }
|
|
19097
|
+
.jm-dashboard-cell:hover .jm-cell-actions { opacity: 1; }
|
|
19098
|
+
.jm-dashboard-cell .jm-resize-handle { opacity: 0; transition: opacity 0.15s; background: transparent; }
|
|
19099
|
+
.jm-dashboard-cell:hover .jm-resize-handle { opacity: 1; }
|
|
19100
|
+
.jm-resize-handle:hover { background: rgba(128,128,128,0.25) !important; }
|
|
19101
|
+
.jm-resize-handle:active { background: rgba(128,128,128,0.45) !important; }
|
|
18467
19102
|
` }),
|
|
19103
|
+
/* @__PURE__ */ jsx(
|
|
19104
|
+
"div",
|
|
19105
|
+
{
|
|
19106
|
+
className: "jm-resize-handle",
|
|
19107
|
+
style: { ...handleBase, bottom: 0, left: 12, right: 12, height: 6, cursor: "ns-resize" },
|
|
19108
|
+
onPointerDown: (e) => startResize(e, "s")
|
|
19109
|
+
}
|
|
19110
|
+
),
|
|
19111
|
+
/* @__PURE__ */ jsx(
|
|
19112
|
+
"div",
|
|
19113
|
+
{
|
|
19114
|
+
className: "jm-resize-handle",
|
|
19115
|
+
style: { ...handleBase, top: 12, right: 0, bottom: 12, width: 6, cursor: "ew-resize" },
|
|
19116
|
+
onPointerDown: (e) => startResize(e, "e")
|
|
19117
|
+
}
|
|
19118
|
+
),
|
|
19119
|
+
/* @__PURE__ */ jsx(
|
|
19120
|
+
"div",
|
|
19121
|
+
{
|
|
19122
|
+
className: "jm-resize-handle",
|
|
19123
|
+
style: { ...handleBase, bottom: 0, right: 0, width: 12, height: 12, cursor: "nwse-resize", borderRadius: `0 0 ${token.borderRadiusLG}px 0` },
|
|
19124
|
+
onPointerDown: (e) => startResize(e, "se")
|
|
19125
|
+
}
|
|
19126
|
+
),
|
|
18468
19127
|
/* @__PURE__ */ jsxs("div", { style: toolbarStyle, children: [
|
|
18469
19128
|
/* @__PURE__ */ jsx("span", { style: {
|
|
18470
|
-
fontSize:
|
|
18471
|
-
fontWeight:
|
|
18472
|
-
color: token.colorText,
|
|
19129
|
+
fontSize: 14,
|
|
19130
|
+
fontWeight: 700,
|
|
19131
|
+
color: tone ? tone.solid : token.colorText,
|
|
18473
19132
|
paddingLeft: 4,
|
|
18474
19133
|
overflow: "hidden",
|
|
18475
19134
|
textOverflow: "ellipsis",
|
|
18476
|
-
whiteSpace: "nowrap"
|
|
19135
|
+
whiteSpace: "nowrap",
|
|
19136
|
+
letterSpacing: "-0.01em"
|
|
18477
19137
|
}, children: cellTitle }),
|
|
18478
19138
|
/* @__PURE__ */ jsxs("div", { className: "jm-cell-actions", style: { display: "flex", alignItems: "center", gap: 2 }, children: [
|
|
18479
19139
|
/* @__PURE__ */ jsx(Tooltip, { title: "Configure cell", children: /* @__PURE__ */ jsx(
|
|
@@ -18516,9 +19176,10 @@ var DashboardGridCell = ({ cell, allModels, isMaximized, isMinimized, onConfigur
|
|
|
18516
19176
|
allModels,
|
|
18517
19177
|
isEmbedded: true,
|
|
18518
19178
|
preferencesResourceOverride: `dashboard:${resource}`,
|
|
18519
|
-
defaultListVisible:
|
|
19179
|
+
defaultListVisible: Boolean(cell.view_type),
|
|
18520
19180
|
listViewType: cell.view_type ? cell.view_type : model.listViewType
|
|
18521
|
-
}
|
|
19181
|
+
},
|
|
19182
|
+
`${resource}-${cell.view_type ?? ""}`
|
|
18522
19183
|
) : /* @__PURE__ */ jsx(
|
|
18523
19184
|
Empty,
|
|
18524
19185
|
{
|
|
@@ -18529,7 +19190,7 @@ var DashboardGridCell = ({ cell, allModels, isMaximized, isMinimized, onConfigur
|
|
|
18529
19190
|
) })
|
|
18530
19191
|
] });
|
|
18531
19192
|
};
|
|
18532
|
-
var DashboardTabContent = ({ tab, allModels, maximizedCellId, minimizedCellIds, onMaximize, onMinimize, onConfigure }) => {
|
|
19193
|
+
var DashboardTabContent = ({ tab, allModels, maximizedCellId, minimizedCellIds, onMaximize, onMinimize, onConfigure, onResize }) => {
|
|
18533
19194
|
const cells = tab.cells;
|
|
18534
19195
|
const numCols = useMemo(() => {
|
|
18535
19196
|
if (!cells.length) return 2;
|
|
@@ -18568,7 +19229,8 @@ var DashboardTabContent = ({ tab, allModels, maximizedCellId, minimizedCellIds,
|
|
|
18568
19229
|
isMinimized: minimizedCellIds.has(cell.id),
|
|
18569
19230
|
onConfigure: () => onConfigure(cell),
|
|
18570
19231
|
onMaximize: () => onMaximize(cell.id),
|
|
18571
|
-
onMinimize: () => onMinimize(cell.id)
|
|
19232
|
+
onMinimize: () => onMinimize(cell.id),
|
|
19233
|
+
onResize: (w, h) => onResize(cell.id, w, h)
|
|
18572
19234
|
}
|
|
18573
19235
|
)
|
|
18574
19236
|
},
|
|
@@ -18600,6 +19262,23 @@ var ViewsGrid = ({ config, allModels, onConfigChange }) => {
|
|
|
18600
19262
|
onConfigChange(nextConfig);
|
|
18601
19263
|
setDrawerSelection(null);
|
|
18602
19264
|
}, [onConfigChange]);
|
|
19265
|
+
const handleResizeCell = useCallback((tabId, cellId, minWidth, minHeight) => {
|
|
19266
|
+
const nextTabs = config.tabs.map((tab) => {
|
|
19267
|
+
if (tab.id !== tabId) return tab;
|
|
19268
|
+
return {
|
|
19269
|
+
...tab,
|
|
19270
|
+
cells: tab.cells.map((c) => {
|
|
19271
|
+
if (c.id !== cellId) return c;
|
|
19272
|
+
return {
|
|
19273
|
+
...c,
|
|
19274
|
+
...minWidth !== null ? { min_width: minWidth } : {},
|
|
19275
|
+
...minHeight !== null ? { min_height: minHeight } : {}
|
|
19276
|
+
};
|
|
19277
|
+
})
|
|
19278
|
+
};
|
|
19279
|
+
});
|
|
19280
|
+
onConfigChange({ ...config, tabs: nextTabs });
|
|
19281
|
+
}, [config, onConfigChange]);
|
|
18603
19282
|
const tabItems = useMemo(
|
|
18604
19283
|
() => config.tabs.map((tab) => ({
|
|
18605
19284
|
key: tab.id,
|
|
@@ -18613,11 +19292,12 @@ var ViewsGrid = ({ config, allModels, onConfigChange }) => {
|
|
|
18613
19292
|
minimizedCellIds,
|
|
18614
19293
|
onMaximize: handleMaximize,
|
|
18615
19294
|
onMinimize: handleMinimize,
|
|
18616
|
-
onConfigure: (cell) => handleOpenDrawer(tab.id, cell)
|
|
19295
|
+
onConfigure: (cell) => handleOpenDrawer(tab.id, cell),
|
|
19296
|
+
onResize: (cellId, w, h) => handleResizeCell(tab.id, cellId, w, h)
|
|
18617
19297
|
}
|
|
18618
19298
|
)
|
|
18619
19299
|
})),
|
|
18620
|
-
[config.tabs, allModels, maximizedCellId, minimizedCellIds, handleMaximize, handleMinimize, handleOpenDrawer]
|
|
19300
|
+
[config.tabs, allModels, maximizedCellId, minimizedCellIds, handleMaximize, handleMinimize, handleOpenDrawer, handleResizeCell]
|
|
18621
19301
|
);
|
|
18622
19302
|
if (!config.tabs.length) {
|
|
18623
19303
|
return /* @__PURE__ */ jsx(Empty, { description: "No tabs configured. Run veloiq add-dashboard to add models.", style: { padding: 48 } });
|
|
@@ -18656,7 +19336,7 @@ function parseInlineStyle3(cssText) {
|
|
|
18656
19336
|
const prop = declaration.slice(0, idx).trim();
|
|
18657
19337
|
const value = declaration.slice(idx + 1).trim();
|
|
18658
19338
|
if (!prop || !value) return;
|
|
18659
|
-
const camel = prop.replace(/-([a-z])/g, (
|
|
19339
|
+
const camel = prop.replace(/-([a-z])/g, (_41, c) => c.toUpperCase());
|
|
18660
19340
|
result[camel] = value;
|
|
18661
19341
|
});
|
|
18662
19342
|
return result;
|
|
@@ -18681,7 +19361,7 @@ function useRecentActivity(days) {
|
|
|
18681
19361
|
return { data, loading, reload: load };
|
|
18682
19362
|
}
|
|
18683
19363
|
var { Text: Text2, Title: Title9 } = Typography;
|
|
18684
|
-
function
|
|
19364
|
+
function relativeTime2(iso) {
|
|
18685
19365
|
if (!iso) return "";
|
|
18686
19366
|
const diff = Date.now() - new Date(iso).getTime();
|
|
18687
19367
|
const mins = Math.floor(diff / 6e4);
|
|
@@ -18790,7 +19470,7 @@ var RecentActivityPanel = () => {
|
|
|
18790
19470
|
}
|
|
18791
19471
|
),
|
|
18792
19472
|
isNew && /* @__PURE__ */ jsx(Tag, { color: "green", style: { fontSize: 10, padding: "0 4px", lineHeight: "16px" }, children: "new" }),
|
|
18793
|
-
/* @__PURE__ */ jsx(Text2, { type: "secondary", style: { fontSize: 11, flexShrink: 0 }, children:
|
|
19473
|
+
/* @__PURE__ */ jsx(Text2, { type: "secondary", style: { fontSize: 11, flexShrink: 0 }, children: relativeTime2(timestamp) })
|
|
18794
19474
|
] })
|
|
18795
19475
|
]
|
|
18796
19476
|
}
|
|
@@ -18956,7 +19636,7 @@ var PinnedRecordsPanel = () => {
|
|
|
18956
19636
|
] });
|
|
18957
19637
|
};
|
|
18958
19638
|
var { Text: Text3 } = Typography;
|
|
18959
|
-
var
|
|
19639
|
+
var _40 = window._ || ((text) => text);
|
|
18960
19640
|
var DashboardPage = () => {
|
|
18961
19641
|
const { token } = theme.useToken();
|
|
18962
19642
|
const allModels = useAllModels();
|
|
@@ -18985,7 +19665,7 @@ var DashboardPage = () => {
|
|
|
18985
19665
|
const tabs = [
|
|
18986
19666
|
{
|
|
18987
19667
|
key: "models_grid",
|
|
18988
|
-
label:
|
|
19668
|
+
label: _40("Models Grid"),
|
|
18989
19669
|
children: /* @__PURE__ */ jsx("div", { style: { height: "calc(100vh - 140px)", overflow: "auto" }, children: /* @__PURE__ */ jsx(
|
|
18990
19670
|
ViewsGrid,
|
|
18991
19671
|
{
|
|
@@ -18997,12 +19677,12 @@ var DashboardPage = () => {
|
|
|
18997
19677
|
},
|
|
18998
19678
|
{
|
|
18999
19679
|
key: "recent_activity",
|
|
19000
|
-
label:
|
|
19680
|
+
label: _40("Recent Activity"),
|
|
19001
19681
|
children: /* @__PURE__ */ jsx("div", { style: { height: "calc(100vh - 140px)", overflow: "auto", padding: "0 12px" }, children: /* @__PURE__ */ jsx(RecentActivityPanel, {}) })
|
|
19002
19682
|
},
|
|
19003
19683
|
{
|
|
19004
19684
|
key: "pinned_records",
|
|
19005
|
-
label:
|
|
19685
|
+
label: _40("Pinned Records"),
|
|
19006
19686
|
children: /* @__PURE__ */ jsx("div", { style: { height: "calc(100vh - 140px)", overflow: "auto", padding: "0 12px" }, children: /* @__PURE__ */ jsx(PinnedRecordsPanel, {}) })
|
|
19007
19687
|
}
|
|
19008
19688
|
];
|