@juicemantics/veloiq-ui 0.2.0 → 0.2.1
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 +1325 -677
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1326 -679
- 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,45 +7709,6 @@ 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;
|
|
7399
7714
|
var DynamicCreate = ({ model: modelProp, allModels, journeyCallbacks, injectedValues }) => {
|
|
@@ -7658,7 +7973,7 @@ var DynamicCreate = ({ model: modelProp, allModels, journeyCallbacks, injectedVa
|
|
|
7658
7973
|
name: field.key,
|
|
7659
7974
|
rules: field.required ? [{ required: true }] : [],
|
|
7660
7975
|
valuePropName: field.type === "boolean" ? "checked" : void 0,
|
|
7661
|
-
getValueProps: (val) => (field.type === "date" || field.type === "datetime") && val ? { value:
|
|
7976
|
+
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
7977
|
style: { margin: 0 },
|
|
7663
7978
|
children: renderInput(field, allModels, model)
|
|
7664
7979
|
}
|
|
@@ -7731,7 +8046,7 @@ var DynamicCreate = ({ model: modelProp, allModels, journeyCallbacks, injectedVa
|
|
|
7731
8046
|
const prefix = useReadonly ? "pc" : "cr";
|
|
7732
8047
|
return /* @__PURE__ */ jsxs("div", { style: { border: `1px solid ${token.colorBorder}`, borderRadius: 8, padding: "6px 6px", marginBottom: 6 }, children: [
|
|
7733
8048
|
/* @__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((
|
|
8049
|
+
/* @__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
8050
|
const cellItems = normalized.filter((r) => r.row === rowIdx + 1 && r.column === colIdx + 1);
|
|
7736
8051
|
return /* @__PURE__ */ jsx("td", { style: { padding: "0 4px", verticalAlign: "top", width: `${100 / maxCol}%` }, children: cellItems.map(
|
|
7737
8052
|
(item, idx) => useReadonly ? renderReadonlyCell(item, idx) : renderFormCell(item, idx)
|
|
@@ -7750,7 +8065,7 @@ var DynamicCreate = ({ model: modelProp, allModels, journeyCallbacks, injectedVa
|
|
|
7750
8065
|
}
|
|
7751
8066
|
return /* @__PURE__ */ jsxs("div", { style: { display: "grid", gridTemplateColumns: "200px 1fr", justifyContent: "start", alignItems: "start", columnGap: 6 }, children: [
|
|
7752
8067
|
/* @__PURE__ */ jsx("span", { style: labelStyle, children: field.label }),
|
|
7753
|
-
/* @__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:
|
|
8068
|
+
/* @__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
8069
|
] }, field.key);
|
|
7755
8070
|
}) }) })
|
|
7756
8071
|
] }),
|
|
@@ -8309,7 +8624,7 @@ var DynamicEdit = ({ model: modelProp, allModels, topContent, extraHeaderButtons
|
|
|
8309
8624
|
name: field.key,
|
|
8310
8625
|
rules: field.required && !field.formula ? [{ required: true }] : [],
|
|
8311
8626
|
valuePropName: field.type === "boolean" ? "checked" : void 0,
|
|
8312
|
-
getValueProps: (val) => (field.type === "date" || field.type === "datetime") && val ? { value:
|
|
8627
|
+
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
8628
|
style: { margin: 0 },
|
|
8314
8629
|
children: field.formula ? /* @__PURE__ */ jsx(Input, { disabled: true }) : renderInput(field, allModels, model, recordId)
|
|
8315
8630
|
}
|
|
@@ -8351,7 +8666,7 @@ var DynamicEdit = ({ model: modelProp, allModels, topContent, extraHeaderButtons
|
|
|
8351
8666
|
},
|
|
8352
8667
|
children: [
|
|
8353
8668
|
/* @__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((
|
|
8669
|
+
/* @__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
8670
|
const cellItems = normalized.filter(
|
|
8356
8671
|
(item) => item.row === rowIndex + 1 && item.column === colIndex + 1
|
|
8357
8672
|
);
|
|
@@ -8500,7 +8815,7 @@ var DynamicEdit = ({ model: modelProp, allModels, topContent, extraHeaderButtons
|
|
|
8500
8815
|
name: field.key,
|
|
8501
8816
|
rules: field.required && !field.formula ? [{ required: true }] : [],
|
|
8502
8817
|
valuePropName: field.type === "boolean" ? "checked" : void 0,
|
|
8503
|
-
getValueProps: (val) => (field.type === "date" || field.type === "datetime") && val ? { value:
|
|
8818
|
+
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
8819
|
style: { margin: 0 },
|
|
8505
8820
|
children: field.formula ? /* @__PURE__ */ jsx(Input, { disabled: true }) : renderInput(field, allModels, model, recordId)
|
|
8506
8821
|
}
|
|
@@ -8564,7 +8879,7 @@ var DynamicEdit = ({ model: modelProp, allModels, topContent, extraHeaderButtons
|
|
|
8564
8879
|
const maxCol = Math.max(1, ...normalized.map((r) => r.column));
|
|
8565
8880
|
return /* @__PURE__ */ jsxs("div", { style: { flex: 1, minWidth: 0, border: `1px solid ${token.colorBorder}`, borderRadius: 8, padding: "2px 6px" }, children: [
|
|
8566
8881
|
/* @__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((
|
|
8882
|
+
/* @__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
8883
|
const cellItems = normalized.filter((item) => item.row === ri + 1 && item.column === ci + 1);
|
|
8569
8884
|
return /* @__PURE__ */ jsx("td", { style: { padding: "0 4px", verticalAlign: "top", width: `${100 / maxCol}%` }, children: cellItems.map((item, idx) => {
|
|
8570
8885
|
if (item.attribute_or_relation_type === "nlsentence") {
|
|
@@ -8614,7 +8929,7 @@ var DynamicEdit = ({ model: modelProp, allModels, topContent, extraHeaderButtons
|
|
|
8614
8929
|
name: field.key,
|
|
8615
8930
|
rules: field.required && !field.formula ? [{ required: true }] : [],
|
|
8616
8931
|
valuePropName: field.type === "boolean" ? "checked" : void 0,
|
|
8617
|
-
getValueProps: (val) => (field.type === "date" || field.type === "datetime") && val ? { value:
|
|
8932
|
+
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
8933
|
style: { margin: 0 },
|
|
8619
8934
|
children: field.formula ? /* @__PURE__ */ jsx(Input, { disabled: true }) : renderInput(field, allModels, model, recordId)
|
|
8620
8935
|
}
|
|
@@ -8707,6 +9022,55 @@ var DynamicEdit = ({ model: modelProp, allModels, topContent, extraHeaderButtons
|
|
|
8707
9022
|
] });
|
|
8708
9023
|
};
|
|
8709
9024
|
var _25 = window._ || ((text) => text);
|
|
9025
|
+
var ReadAndEditReference = ({ value, onChange, field, allModels, model, currentId }) => {
|
|
9026
|
+
const [editing, setEditing] = useState(false);
|
|
9027
|
+
const [draft, setDraft] = useState(void 0);
|
|
9028
|
+
const form = Form.useFormInstance();
|
|
9029
|
+
const resource = field.referencePath ? field.referencePath : field.reference ? resolveResourcePath(field.reference, allModels) : "";
|
|
9030
|
+
const modelResource = model ? resolveResourcePath(model.resource || model.name, allModels) : void 0;
|
|
9031
|
+
const isSelfRef = resource && modelResource && resource === modelResource;
|
|
9032
|
+
const handleEdit = () => {
|
|
9033
|
+
setDraft(value);
|
|
9034
|
+
setEditing(true);
|
|
9035
|
+
};
|
|
9036
|
+
const handleConfirm = () => {
|
|
9037
|
+
onChange?.(draft);
|
|
9038
|
+
if (form) form.setFieldValue(field.key, draft);
|
|
9039
|
+
setEditing(false);
|
|
9040
|
+
};
|
|
9041
|
+
const handleCancel = () => {
|
|
9042
|
+
setDraft(void 0);
|
|
9043
|
+
setEditing(false);
|
|
9044
|
+
};
|
|
9045
|
+
const row = { display: "flex", alignItems: "center", justifyContent: "flex-start", gap: 4 };
|
|
9046
|
+
if (editing) {
|
|
9047
|
+
return /* @__PURE__ */ jsxs("div", { style: row, children: [
|
|
9048
|
+
/* @__PURE__ */ jsx("div", { style: { flex: 1, minWidth: 0 }, children: /* @__PURE__ */ jsx(
|
|
9049
|
+
RelationSelect,
|
|
9050
|
+
{
|
|
9051
|
+
field,
|
|
9052
|
+
value: draft,
|
|
9053
|
+
onChange: setDraft,
|
|
9054
|
+
allModels,
|
|
9055
|
+
excludeId: isSelfRef ? currentId : void 0
|
|
9056
|
+
}
|
|
9057
|
+
) }),
|
|
9058
|
+
/* @__PURE__ */ jsx(Tooltip, { title: _25("Confirm"), children: /* @__PURE__ */ jsx(Button, { size: "small", type: "primary", icon: /* @__PURE__ */ jsx(CheckOutlined, {}), onClick: handleConfirm }) }),
|
|
9059
|
+
/* @__PURE__ */ jsx(Tooltip, { title: _25("Cancel"), children: /* @__PURE__ */ jsx(Button, { size: "small", icon: /* @__PURE__ */ jsx(CloseOutlined, {}), onClick: handleCancel }) })
|
|
9060
|
+
] });
|
|
9061
|
+
}
|
|
9062
|
+
if (!value) {
|
|
9063
|
+
return /* @__PURE__ */ jsxs("div", { style: row, children: [
|
|
9064
|
+
/* @__PURE__ */ jsx("span", { children: "-" }),
|
|
9065
|
+
/* @__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" } }) })
|
|
9066
|
+
] });
|
|
9067
|
+
}
|
|
9068
|
+
return /* @__PURE__ */ jsxs("div", { style: row, children: [
|
|
9069
|
+
/* @__PURE__ */ jsx(ReferenceField, { id: value, resource }),
|
|
9070
|
+
/* @__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" } }) })
|
|
9071
|
+
] });
|
|
9072
|
+
};
|
|
9073
|
+
var _26 = window._ || ((text) => text);
|
|
8710
9074
|
var { Title: Title4 } = Typography;
|
|
8711
9075
|
function coerce(v) {
|
|
8712
9076
|
if (v && typeof v === "object" && typeof v.valueOf === "function") return v.valueOf();
|
|
@@ -8801,22 +9165,44 @@ var useStandardShowTabs = (model, record, allModels, actionsState, editForm, ove
|
|
|
8801
9165
|
const renderShowEditableInput = (field, forceReadOnly) => {
|
|
8802
9166
|
const refResource = field.reference ? resolveResourcePath(field.reference, allModels) : void 0;
|
|
8803
9167
|
const isSelfRef = refResource && modelResource && refResource === modelResource;
|
|
9168
|
+
const scalarToken = field.showViewType ? normalizeFieldViewType(field.showViewType) : "";
|
|
9169
|
+
const isReadOnlyToken = scalarToken.startsWith("read-only-");
|
|
9170
|
+
const isEditableToken = scalarToken === "editable-field";
|
|
9171
|
+
if (field.formula || forceReadOnly || isReadOnlyToken) {
|
|
9172
|
+
return renderFieldValue(field, record, allModels);
|
|
9173
|
+
}
|
|
9174
|
+
if (field.reference) {
|
|
9175
|
+
if (!isEditableToken) {
|
|
9176
|
+
const fkRelViewType = normalizeRelationViewType(field.showViewType || "") || "read-and-edit-list";
|
|
9177
|
+
if (fkRelViewType === "read-and-edit-list") {
|
|
9178
|
+
return /* @__PURE__ */ jsx(Form.Item, { name: field.key, style: { margin: 0 }, noStyle: false, children: /* @__PURE__ */ jsx(
|
|
9179
|
+
ReadAndEditReference,
|
|
9180
|
+
{
|
|
9181
|
+
field,
|
|
9182
|
+
allModels,
|
|
9183
|
+
model,
|
|
9184
|
+
currentId: isSelfRef ? currentId : void 0
|
|
9185
|
+
}
|
|
9186
|
+
) });
|
|
9187
|
+
}
|
|
9188
|
+
}
|
|
9189
|
+
}
|
|
8804
9190
|
return /* @__PURE__ */ jsx(
|
|
8805
9191
|
Form.Item,
|
|
8806
9192
|
{
|
|
8807
9193
|
name: field.key,
|
|
8808
|
-
rules: field.required && !field.formula
|
|
9194
|
+
rules: field.required && !field.formula ? [{ required: true }] : [],
|
|
8809
9195
|
valuePropName: field.type === "boolean" ? "checked" : void 0,
|
|
8810
|
-
getValueProps: (val) => (field.type === "date" || field.type === "datetime") && val ? { value:
|
|
9196
|
+
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
9197
|
style: { margin: 0 },
|
|
8812
9198
|
noStyle: false,
|
|
8813
|
-
children:
|
|
9199
|
+
children: renderInput(field, allModels, model, isSelfRef ? currentId : void 0)
|
|
8814
9200
|
}
|
|
8815
9201
|
);
|
|
8816
9202
|
};
|
|
8817
9203
|
const detailsTab = {
|
|
8818
9204
|
key: "details",
|
|
8819
|
-
label: renderToneTabLabel(
|
|
9205
|
+
label: renderToneTabLabel(_26("Details"), modelTone),
|
|
8820
9206
|
children: /* @__PURE__ */ jsxs(
|
|
8821
9207
|
Form,
|
|
8822
9208
|
{
|
|
@@ -8845,8 +9231,8 @@ var useStandardShowTabs = (model, record, allModels, actionsState, editForm, ove
|
|
|
8845
9231
|
flex: "1 0 200px",
|
|
8846
9232
|
padding: "2px 4px",
|
|
8847
9233
|
lineHeight: 1.15,
|
|
8848
|
-
textAlign: field.type === "number" ? "right" : "left",
|
|
8849
|
-
fontVariantNumeric: field.type === "number" ? "tabular-nums" : void 0,
|
|
9234
|
+
textAlign: field.type === "number" && !field.reference ? "right" : "left",
|
|
9235
|
+
fontVariantNumeric: field.type === "number" && !field.reference ? "tabular-nums" : void 0,
|
|
8850
9236
|
overflowWrap: "anywhere",
|
|
8851
9237
|
background: valueBackground,
|
|
8852
9238
|
borderRadius: 6
|
|
@@ -8884,8 +9270,8 @@ var useStandardShowTabs = (model, record, allModels, actionsState, editForm, ove
|
|
|
8884
9270
|
padding: "6px 6px"
|
|
8885
9271
|
},
|
|
8886
9272
|
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((
|
|
9273
|
+
/* @__PURE__ */ jsx(Title4, { level: 5, style: { margin: 0, color: "#1677ff" }, children: _26(section) }),
|
|
9274
|
+
/* @__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
9275
|
const cellItems = normalized.filter(
|
|
8890
9276
|
(item) => item.row === rowIndex + 1 && item.column === colIndex + 1
|
|
8891
9277
|
);
|
|
@@ -8962,8 +9348,8 @@ var useStandardShowTabs = (model, record, allModels, actionsState, editForm, ove
|
|
|
8962
9348
|
borderRadius: 6,
|
|
8963
9349
|
maxWidth: "100%",
|
|
8964
9350
|
overflowWrap: "anywhere",
|
|
8965
|
-
textAlign: field.type === "number" ? "right" : "left",
|
|
8966
|
-
fontVariantNumeric: field.type === "number" ? "tabular-nums" : void 0,
|
|
9351
|
+
textAlign: field.type === "number" && !field.reference ? "right" : "left",
|
|
9352
|
+
fontVariantNumeric: field.type === "number" && !field.reference ? "tabular-nums" : void 0,
|
|
8967
9353
|
...parseInlineStyle(item.html_format)
|
|
8968
9354
|
};
|
|
8969
9355
|
return /* @__PURE__ */ jsx(VisibilityGate, { condition: item.visibility_condition, children: /* @__PURE__ */ jsx("div", { style: { marginBottom: 4 }, children: /* @__PURE__ */ jsxs(
|
|
@@ -9077,8 +9463,8 @@ var useStandardShowTabs = (model, record, allModels, actionsState, editForm, ove
|
|
|
9077
9463
|
const maxRow = Math.max(1, ...normalized.map((r) => r.row));
|
|
9078
9464
|
const maxCol = Math.max(1, ...normalized.map((r) => r.column));
|
|
9079
9465
|
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((
|
|
9466
|
+
/* @__PURE__ */ jsx(Title4, { level: 5, style: { margin: 0, color: "#1677ff" }, children: _26(section) }),
|
|
9467
|
+
/* @__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
9468
|
const cellItems = normalized.filter((item) => item.row === ri + 1 && item.column === ci + 1);
|
|
9083
9469
|
return /* @__PURE__ */ jsx("td", { style: { padding: "0 4px", verticalAlign: "top", width: `${100 / maxCol}%` }, children: cellItems.map((item) => {
|
|
9084
9470
|
if (item.attribute_or_relation_type === "nlsentence") {
|
|
@@ -9135,13 +9521,50 @@ var useStandardShowTabs = (model, record, allModels, actionsState, editForm, ove
|
|
|
9135
9521
|
}) }) });
|
|
9136
9522
|
return {
|
|
9137
9523
|
key: `custom-tab::${tabName}`,
|
|
9138
|
-
label: renderToneTabLabel(
|
|
9524
|
+
label: renderToneTabLabel(_26(tabName), { text: token.colorText, border: token.colorBorder }),
|
|
9139
9525
|
children: tabChildren
|
|
9140
9526
|
};
|
|
9141
9527
|
});
|
|
9142
9528
|
const items = [detailsTab];
|
|
9143
9529
|
items.push(...customConfigTabs);
|
|
9144
9530
|
items.push(...relationTabs);
|
|
9531
|
+
const currentResource = model.resource || model.name.toLowerCase();
|
|
9532
|
+
const namedQueryTabs = (allModels || []).filter((m) => m.isNamedQuery).flatMap((queryModel) => {
|
|
9533
|
+
if (!record) return [];
|
|
9534
|
+
getRecordId(record, model.fields);
|
|
9535
|
+
let filterKey;
|
|
9536
|
+
if (queryModel.primaryResource === currentResource) {
|
|
9537
|
+
filterKey = queryModel.pkField || "id";
|
|
9538
|
+
} else {
|
|
9539
|
+
const fkField = queryModel.fields.find((f) => f.reference === currentResource);
|
|
9540
|
+
filterKey = fkField?.key;
|
|
9541
|
+
}
|
|
9542
|
+
if (!filterKey) return [];
|
|
9543
|
+
const syntheticRel = {
|
|
9544
|
+
resource: queryModel.resource || queryModel.name,
|
|
9545
|
+
targetKey: filterKey,
|
|
9546
|
+
label: queryModel.label,
|
|
9547
|
+
showViewType: queryModel.listViewType || "table"
|
|
9548
|
+
};
|
|
9549
|
+
const relationModel = queryModel;
|
|
9550
|
+
const tone = getModelTone(queryModel.resource || queryModel.name);
|
|
9551
|
+
return [{
|
|
9552
|
+
key: `named-query::${queryModel.name || queryModel.resource}`,
|
|
9553
|
+
label: renderToneTabLabel(queryModel.label, tone),
|
|
9554
|
+
children: /* @__PURE__ */ jsx("div", { children: renderRelationBlock({
|
|
9555
|
+
rel: syntheticRel,
|
|
9556
|
+
relationModel,
|
|
9557
|
+
record,
|
|
9558
|
+
mode: "show",
|
|
9559
|
+
parentResource: model.name,
|
|
9560
|
+
allModels,
|
|
9561
|
+
showActions: false,
|
|
9562
|
+
showCreate: false,
|
|
9563
|
+
relationViewTypeDefaults
|
|
9564
|
+
}) })
|
|
9565
|
+
}];
|
|
9566
|
+
});
|
|
9567
|
+
items.push(...namedQueryTabs);
|
|
9145
9568
|
return items;
|
|
9146
9569
|
};
|
|
9147
9570
|
var INLINE_DEFAULT_PAGE_SIZE = 10;
|
|
@@ -9460,7 +9883,7 @@ var RelatedObjectsInlineValues = ({ rel, record, viewType, allowedRelatedIds, al
|
|
|
9460
9883
|
paginationProps && /* @__PURE__ */ jsx(Pagination, { ...paginationProps })
|
|
9461
9884
|
] });
|
|
9462
9885
|
};
|
|
9463
|
-
var
|
|
9886
|
+
var _27 = window._ || ((text) => text);
|
|
9464
9887
|
var RelatedObjectsCalendar = ({ rel, record, relatedModel, allModels }) => {
|
|
9465
9888
|
useGo();
|
|
9466
9889
|
const { token } = theme.useToken();
|
|
@@ -9469,7 +9892,7 @@ var RelatedObjectsCalendar = ({ rel, record, relatedModel, allModels }) => {
|
|
|
9469
9892
|
const dateFieldOptions = useMemo(() => getCalendarDateFieldOptions(relatedModel.fields), [relatedModel.fields]);
|
|
9470
9893
|
const [calendarMode, setCalendarMode] = useState("month");
|
|
9471
9894
|
const [calendarDateField, setCalendarDateField] = useState(() => dateFieldOptions[0]?.key || "");
|
|
9472
|
-
const [calendarAnchorDate, setCalendarAnchorDate] = useState(() =>
|
|
9895
|
+
const [calendarAnchorDate, setCalendarAnchorDate] = useState(() => dayjs8().startOf("month"));
|
|
9473
9896
|
const dateFieldKeySet = useMemo(() => new Set(dateFieldOptions.map((field) => field.key)), [dateFieldOptions]);
|
|
9474
9897
|
useEffect(() => {
|
|
9475
9898
|
if (calendarDateField && dateFieldKeySet.has(calendarDateField)) return;
|
|
@@ -9507,10 +9930,10 @@ var RelatedObjectsCalendar = ({ rel, record, relatedModel, allModels }) => {
|
|
|
9507
9930
|
if (initSignatureRef.current === signature) return;
|
|
9508
9931
|
initSignatureRef.current = signature;
|
|
9509
9932
|
if (earliestDateTs === null) {
|
|
9510
|
-
setCalendarAnchorDate(
|
|
9933
|
+
setCalendarAnchorDate(dayjs8().startOf(calendarMode));
|
|
9511
9934
|
return;
|
|
9512
9935
|
}
|
|
9513
|
-
setCalendarAnchorDate(
|
|
9936
|
+
setCalendarAnchorDate(dayjs8(earliestDateTs).startOf(calendarMode));
|
|
9514
9937
|
}, [calendarDateField, calendarMode, earliestDateTs]);
|
|
9515
9938
|
const entriesByDate = useMemo(() => {
|
|
9516
9939
|
const grouped = /* @__PURE__ */ new Map();
|
|
@@ -9543,8 +9966,8 @@ var RelatedObjectsCalendar = ({ rel, record, relatedModel, allModels }) => {
|
|
|
9543
9966
|
}, [calendarAnchorDate, calendarMode]);
|
|
9544
9967
|
if (loading) return /* @__PURE__ */ jsx(Spin, { size: "small" });
|
|
9545
9968
|
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:
|
|
9969
|
+
if (dateFieldOptions.length === 0) return /* @__PURE__ */ jsx(Empty, { description: _27("No date/datetime fields available for calendar view.") });
|
|
9970
|
+
if (!records.length) return /* @__PURE__ */ jsx(Empty, { description: _27("No related records available.") });
|
|
9548
9971
|
const selectedDateField = relatedModel.fields.find((field) => field.key === calendarDateField);
|
|
9549
9972
|
const selectedLabel = selectedDateField?.label || calendarDateField;
|
|
9550
9973
|
return /* @__PURE__ */ jsxs("div", { style: { display: "grid", gap: 12 }, children: [
|
|
@@ -9557,8 +9980,8 @@ var RelatedObjectsCalendar = ({ rel, record, relatedModel, allModels }) => {
|
|
|
9557
9980
|
value: calendarMode,
|
|
9558
9981
|
onChange: (value) => setCalendarMode(value),
|
|
9559
9982
|
options: [
|
|
9560
|
-
{ label:
|
|
9561
|
-
{ label:
|
|
9983
|
+
{ label: _27("Monthly"), value: "month" },
|
|
9984
|
+
{ label: _27("Weekly"), value: "week" }
|
|
9562
9985
|
],
|
|
9563
9986
|
style: { minWidth: 120 }
|
|
9564
9987
|
}
|
|
@@ -9571,35 +9994,35 @@ var RelatedObjectsCalendar = ({ rel, record, relatedModel, allModels }) => {
|
|
|
9571
9994
|
onChange: (value) => setCalendarDateField(value),
|
|
9572
9995
|
options: dateFieldOptions.map((field) => ({ label: field.label, value: field.key })),
|
|
9573
9996
|
style: { minWidth: 220 },
|
|
9574
|
-
placeholder:
|
|
9997
|
+
placeholder: _27("Date field")
|
|
9575
9998
|
}
|
|
9576
9999
|
)
|
|
9577
10000
|
] }),
|
|
9578
10001
|
/* @__PURE__ */ jsxs(Space, { size: 8, children: [
|
|
9579
|
-
/* @__PURE__ */ jsx(Tooltip, { title:
|
|
10002
|
+
/* @__PURE__ */ jsx(Tooltip, { title: _27("Previous"), children: /* @__PURE__ */ jsx(
|
|
9580
10003
|
Button,
|
|
9581
10004
|
{
|
|
9582
10005
|
size: "small",
|
|
9583
10006
|
icon: /* @__PURE__ */ jsx(ArrowLeftOutlined, {}),
|
|
9584
|
-
"aria-label":
|
|
10007
|
+
"aria-label": _27("Previous"),
|
|
9585
10008
|
onClick: () => setCalendarAnchorDate((prev) => prev.subtract(1, calendarMode).startOf(calendarMode))
|
|
9586
10009
|
}
|
|
9587
10010
|
) }),
|
|
9588
|
-
/* @__PURE__ */ jsx(Tooltip, { title:
|
|
10011
|
+
/* @__PURE__ */ jsx(Tooltip, { title: _27("Today"), children: /* @__PURE__ */ jsx(
|
|
9589
10012
|
Button,
|
|
9590
10013
|
{
|
|
9591
10014
|
size: "small",
|
|
9592
10015
|
icon: /* @__PURE__ */ jsx(CalendarOutlined, {}),
|
|
9593
|
-
"aria-label":
|
|
9594
|
-
onClick: () => setCalendarAnchorDate(
|
|
10016
|
+
"aria-label": _27("Today"),
|
|
10017
|
+
onClick: () => setCalendarAnchorDate(dayjs8().startOf(calendarMode))
|
|
9595
10018
|
}
|
|
9596
10019
|
) }),
|
|
9597
|
-
/* @__PURE__ */ jsx(Tooltip, { title:
|
|
10020
|
+
/* @__PURE__ */ jsx(Tooltip, { title: _27("Next"), children: /* @__PURE__ */ jsx(
|
|
9598
10021
|
Button,
|
|
9599
10022
|
{
|
|
9600
10023
|
size: "small",
|
|
9601
10024
|
icon: /* @__PURE__ */ jsx(ArrowRightOutlined, {}),
|
|
9602
|
-
"aria-label":
|
|
10025
|
+
"aria-label": _27("Next"),
|
|
9603
10026
|
onClick: () => setCalendarAnchorDate((prev) => prev.add(1, calendarMode).startOf(calendarMode))
|
|
9604
10027
|
}
|
|
9605
10028
|
) })
|
|
@@ -9640,7 +10063,7 @@ var RelatedObjectsCalendar = ({ rel, record, relatedModel, allModels }) => {
|
|
|
9640
10063
|
const dayKey = day.format("YYYY-MM-DD");
|
|
9641
10064
|
const entries = entriesByDate.get(dayKey) || [];
|
|
9642
10065
|
const isOutsideCurrentMonth = calendarMode === "month" && day.month() !== calendarAnchorDate.month();
|
|
9643
|
-
const isToday = day.isSame(
|
|
10066
|
+
const isToday = day.isSame(dayjs8(), "day");
|
|
9644
10067
|
return /* @__PURE__ */ jsxs(
|
|
9645
10068
|
"div",
|
|
9646
10069
|
{
|
|
@@ -9718,12 +10141,12 @@ var RelatedObjectPrimaryCard = ({ record, model, allModels, customPageName }) =>
|
|
|
9718
10141
|
}
|
|
9719
10142
|
);
|
|
9720
10143
|
};
|
|
9721
|
-
var
|
|
10144
|
+
var _28 = window._ || ((text) => text);
|
|
9722
10145
|
var RelatedObjectsPrimaryView = ({ rel, record, model, allModels, customPageName }) => {
|
|
9723
10146
|
const { records, loading, error } = useRelatedGalleryRecords({ rel, record, allModels });
|
|
9724
10147
|
if (loading) return /* @__PURE__ */ jsx(Spin, { size: "small" });
|
|
9725
10148
|
if (error) return /* @__PURE__ */ jsx(Alert, { type: "error", message: error, showIcon: true });
|
|
9726
|
-
if (!records.length) return /* @__PURE__ */ jsx(Empty, { description:
|
|
10149
|
+
if (!records.length) return /* @__PURE__ */ jsx(Empty, { description: _28("No related objects.") });
|
|
9727
10150
|
return /* @__PURE__ */ jsx("div", { style: { display: "grid", gap: 8 }, children: records.map((item) => {
|
|
9728
10151
|
const id = item?.eid ?? item?.id;
|
|
9729
10152
|
return /* @__PURE__ */ jsx(
|
|
@@ -9738,7 +10161,7 @@ var RelatedObjectsPrimaryView = ({ rel, record, model, allModels, customPageName
|
|
|
9738
10161
|
);
|
|
9739
10162
|
}) });
|
|
9740
10163
|
};
|
|
9741
|
-
var
|
|
10164
|
+
var _29 = window._ || ((text) => text);
|
|
9742
10165
|
var RelatedObjectsGallery = ({ rel, record, relatedModel, allModels }) => {
|
|
9743
10166
|
const apiUrl = useApiUrl();
|
|
9744
10167
|
const go = useGo();
|
|
@@ -9753,7 +10176,7 @@ var RelatedObjectsGallery = ({ rel, record, relatedModel, allModels }) => {
|
|
|
9753
10176
|
if (error) return /* @__PURE__ */ jsx(Alert, { type: "error", message: error, showIcon: true });
|
|
9754
10177
|
if (!records.length) return /* @__PURE__ */ jsxs("div", { style: { display: "inline-flex", alignItems: "center", gap: 6, color: "#bfbfbf", fontSize: 12 }, children: [
|
|
9755
10178
|
/* @__PURE__ */ jsx(FileTextOutlined, { style: { fontSize: 16 } }),
|
|
9756
|
-
|
|
10179
|
+
_29("No images available")
|
|
9757
10180
|
] });
|
|
9758
10181
|
return /* @__PURE__ */ jsx("div", { style: { display: "flex", flexWrap: "wrap", gap: 16 }, children: records.map((item) => {
|
|
9759
10182
|
const id = getGalleryItemId(item);
|
|
@@ -9777,7 +10200,7 @@ var RelatedObjectsGallery = ({ rel, record, relatedModel, allModels }) => {
|
|
|
9777
10200
|
});
|
|
9778
10201
|
}) });
|
|
9779
10202
|
};
|
|
9780
|
-
var
|
|
10203
|
+
var _30 = window._ || ((text) => text);
|
|
9781
10204
|
var RelatedObjectsEditableList = ({ rel, record, allModels }) => {
|
|
9782
10205
|
const go = useGo();
|
|
9783
10206
|
const paneNav = usePaneNavigation();
|
|
@@ -9876,7 +10299,7 @@ var RelatedObjectsEditableList = ({ rel, record, allModels }) => {
|
|
|
9876
10299
|
const d = String(body.detail);
|
|
9877
10300
|
if (d.toLowerCase().includes("unique") || d.toLowerCase().includes("duplicate")) {
|
|
9878
10301
|
const optLabel = allOptions.find((o) => o.id === id)?.label ?? String(id);
|
|
9879
|
-
detail = `"${optLabel}" ${
|
|
10302
|
+
detail = `"${optLabel}" ${_30("is already linked to another record and cannot be added here.")}`;
|
|
9880
10303
|
} else {
|
|
9881
10304
|
detail = d;
|
|
9882
10305
|
}
|
|
@@ -9895,9 +10318,9 @@ var RelatedObjectsEditableList = ({ rel, record, allModels }) => {
|
|
|
9895
10318
|
setSelectedIds(new Set(newBaseline));
|
|
9896
10319
|
if (errors.length > 0) {
|
|
9897
10320
|
message.error(errors[0], 6);
|
|
9898
|
-
if (errors.length > 1) message.warning(`${errors.length - 1} ${
|
|
10321
|
+
if (errors.length > 1) message.warning(`${errors.length - 1} ${_30("other error(s) occurred.")}`, 4);
|
|
9899
10322
|
} else {
|
|
9900
|
-
message.success(
|
|
10323
|
+
message.success(_30("Changes saved."));
|
|
9901
10324
|
setEditing(false);
|
|
9902
10325
|
setSearchText("");
|
|
9903
10326
|
}
|
|
@@ -9905,7 +10328,7 @@ var RelatedObjectsEditableList = ({ rel, record, allModels }) => {
|
|
|
9905
10328
|
const newItems = allOptions.filter((opt) => newBaseline.has(opt.id)).map((opt) => ({ id: opt.id, label: opt.label, resource: otherResource }));
|
|
9906
10329
|
setLocalItems(newItems);
|
|
9907
10330
|
} catch (err) {
|
|
9908
|
-
message.error(err instanceof Error ? err.message :
|
|
10331
|
+
message.error(err instanceof Error ? err.message : _30("Failed to save changes."));
|
|
9909
10332
|
} finally {
|
|
9910
10333
|
setSaving(false);
|
|
9911
10334
|
}
|
|
@@ -9925,7 +10348,7 @@ var RelatedObjectsEditableList = ({ rel, record, allModels }) => {
|
|
|
9925
10348
|
const relatedModel = findModelByName(allModels, rel.otherResource || rel.otherResourcePath);
|
|
9926
10349
|
const relatedResource = relatedModel ? resolveResourcePath(relatedModel.resource || relatedModel.name, allModels) : null;
|
|
9927
10350
|
if (!relatedResource) {
|
|
9928
|
-
message.warning(
|
|
10351
|
+
message.warning(_30("No create route for the related model. Opening relation create form."));
|
|
9929
10352
|
params.append(rel.targetKey, String(recordId));
|
|
9930
10353
|
const returnTo2 = `${location.pathname}${location.search}${location.hash}`;
|
|
9931
10354
|
if (returnTo2.startsWith("/")) params.append("returnTo", returnTo2);
|
|
@@ -9944,7 +10367,7 @@ var RelatedObjectsEditableList = ({ rel, record, allModels }) => {
|
|
|
9944
10367
|
if (error) return /* @__PURE__ */ jsx(Alert, { type: "error", message: error, showIcon: true });
|
|
9945
10368
|
if (!editing) {
|
|
9946
10369
|
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:
|
|
10370
|
+
/* @__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
10371
|
items.length === 0 && total === 0 ? /* @__PURE__ */ jsx("span", { style: { color: token.colorTextSecondary, fontStyle: "italic" }, children: "\u2014" }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
9949
10372
|
/* @__PURE__ */ jsx("ul", { style: { margin: 0, paddingLeft: 16 }, children: items.map((item, index) => /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(
|
|
9950
10373
|
"a",
|
|
@@ -9983,7 +10406,7 @@ var RelatedObjectsEditableList = ({ rel, record, allModels }) => {
|
|
|
9983
10406
|
setPage(p);
|
|
9984
10407
|
}
|
|
9985
10408
|
},
|
|
9986
|
-
onShowSizeChange: (
|
|
10409
|
+
onShowSizeChange: (_41, newPageSize) => {
|
|
9987
10410
|
setPageSize(newPageSize);
|
|
9988
10411
|
setPage(1);
|
|
9989
10412
|
},
|
|
@@ -10015,7 +10438,7 @@ var RelatedObjectsEditableList = ({ rel, record, allModels }) => {
|
|
|
10015
10438
|
Input,
|
|
10016
10439
|
{
|
|
10017
10440
|
prefix: /* @__PURE__ */ jsx(SearchOutlined, { style: { color: token.colorTextSecondary } }),
|
|
10018
|
-
placeholder:
|
|
10441
|
+
placeholder: _30("Search..."),
|
|
10019
10442
|
value: searchText,
|
|
10020
10443
|
onChange: (e) => setSearchText(e.target.value),
|
|
10021
10444
|
allowClear: true,
|
|
@@ -10023,9 +10446,9 @@ var RelatedObjectsEditableList = ({ rel, record, allModels }) => {
|
|
|
10023
10446
|
style: { flex: 1 }
|
|
10024
10447
|
}
|
|
10025
10448
|
),
|
|
10026
|
-
rel.otherResource && rel.otherKey && rel.targetKey && /* @__PURE__ */ jsx(Tooltip, { title:
|
|
10449
|
+
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
10450
|
] }),
|
|
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:
|
|
10451
|
+
/* @__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
10452
|
const checked = selectedIds.has(opt.id);
|
|
10030
10453
|
return /* @__PURE__ */ jsxs(
|
|
10031
10454
|
"div",
|
|
@@ -10062,49 +10485,147 @@ var RelatedObjectsEditableList = ({ rel, record, allModels }) => {
|
|
|
10062
10485
|
);
|
|
10063
10486
|
}) }),
|
|
10064
10487
|
/* @__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:
|
|
10488
|
+
/* @__PURE__ */ jsx(Button, { size: "small", onClick: handleCancel, children: _30("Cancel") }),
|
|
10489
|
+
/* @__PURE__ */ jsx(Button, { size: "small", type: "primary", icon: /* @__PURE__ */ jsx(SaveOutlined, {}), onClick: handleSave, loading: saving, disabled: !hasChanges, children: _30("Save") })
|
|
10067
10490
|
] })
|
|
10068
10491
|
] });
|
|
10069
10492
|
};
|
|
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;
|
|
10493
|
+
var _31 = window._ || ((text) => text);
|
|
10494
|
+
var RelatedObjectsEditableCsv = ({ rel, record, allModels }) => {
|
|
10074
10495
|
const apiUrl = useApiUrl();
|
|
10075
|
-
const
|
|
10076
|
-
const [
|
|
10077
|
-
const [
|
|
10078
|
-
const [
|
|
10079
|
-
const
|
|
10080
|
-
|
|
10081
|
-
[rel.otherKey, rel.otherResource, relationModel, allModels]
|
|
10082
|
-
);
|
|
10496
|
+
const { items: fetchedItems, loading, error } = useRelatedInlineItems({ rel, record, allModels });
|
|
10497
|
+
const [saving, setSaving] = useState(false);
|
|
10498
|
+
const [allOptions, setAllOptions] = useState([]);
|
|
10499
|
+
const [optionsLoading, setOptionsLoading] = useState(false);
|
|
10500
|
+
const [selectedIds, setSelectedIds] = useState([]);
|
|
10501
|
+
const [baselineIds, setBaselineIds] = useState(/* @__PURE__ */ new Set());
|
|
10083
10502
|
useEffect(() => {
|
|
10084
|
-
|
|
10085
|
-
|
|
10086
|
-
|
|
10087
|
-
|
|
10088
|
-
|
|
10089
|
-
|
|
10090
|
-
|
|
10091
|
-
|
|
10092
|
-
|
|
10503
|
+
const ids = fetchedItems.map((item) => Number(item.id));
|
|
10504
|
+
setSelectedIds(ids);
|
|
10505
|
+
setBaselineIds(new Set(ids));
|
|
10506
|
+
}, [fetchedItems]);
|
|
10507
|
+
useEffect(() => {
|
|
10508
|
+
if (!rel.otherResource) return;
|
|
10509
|
+
let cancelled = false;
|
|
10510
|
+
const fetchOptions = async () => {
|
|
10511
|
+
setOptionsLoading(true);
|
|
10093
10512
|
try {
|
|
10094
|
-
const
|
|
10095
|
-
|
|
10096
|
-
|
|
10097
|
-
|
|
10098
|
-
|
|
10099
|
-
|
|
10100
|
-
|
|
10101
|
-
|
|
10102
|
-
|
|
10103
|
-
|
|
10104
|
-
}
|
|
10105
|
-
} catch
|
|
10106
|
-
|
|
10107
|
-
|
|
10513
|
+
const resource = rel.otherResourcePath || resolveResourcePath(rel.otherResource, allModels);
|
|
10514
|
+
const params = new URLSearchParams({ _start: "0", _end: "50000" });
|
|
10515
|
+
const response = await authenticatedFetch(`${apiUrl}/${resource}?${params.toString()}`);
|
|
10516
|
+
if (!response.ok) throw new Error("Failed to load options");
|
|
10517
|
+
const data = await response.json();
|
|
10518
|
+
if (!cancelled && Array.isArray(data)) {
|
|
10519
|
+
setAllOptions(data.map((item) => ({
|
|
10520
|
+
value: item.eid ?? item.id,
|
|
10521
|
+
label: getRecordDisplayLabel(item)
|
|
10522
|
+
})));
|
|
10523
|
+
}
|
|
10524
|
+
} catch {
|
|
10525
|
+
} finally {
|
|
10526
|
+
if (!cancelled) setOptionsLoading(false);
|
|
10527
|
+
}
|
|
10528
|
+
};
|
|
10529
|
+
fetchOptions();
|
|
10530
|
+
return () => {
|
|
10531
|
+
cancelled = true;
|
|
10532
|
+
};
|
|
10533
|
+
}, [apiUrl, rel.otherResource]);
|
|
10534
|
+
const handleChange = useCallback(async (newIds) => {
|
|
10535
|
+
if (!rel.otherKey || !rel.targetKey) return;
|
|
10536
|
+
const recordId = record?.eid ?? record?.id;
|
|
10537
|
+
if (recordId === void 0 || recordId === null) return;
|
|
10538
|
+
const newSet = new Set(newIds);
|
|
10539
|
+
const toAdd = newIds.filter((id) => !baselineIds.has(id));
|
|
10540
|
+
const toRemove = [...baselineIds].filter((id) => !newSet.has(id));
|
|
10541
|
+
setSelectedIds(newIds);
|
|
10542
|
+
setSaving(true);
|
|
10543
|
+
const errors = [];
|
|
10544
|
+
try {
|
|
10545
|
+
const relationResource = rel.resourcePath || resolveResourcePath(rel.resource, allModels);
|
|
10546
|
+
for (const id of toRemove) {
|
|
10547
|
+
const deleteId = rel.targetKey === "eid_from" ? `${recordId}:${id}` : `${id}:${recordId}`;
|
|
10548
|
+
const resp = await authenticatedFetch(`${apiUrl}/${relationResource}/${encodeURIComponent(deleteId)}`, { method: "DELETE" });
|
|
10549
|
+
if (!resp.ok) errors.push(`Failed to remove (${resp.status})`);
|
|
10550
|
+
}
|
|
10551
|
+
for (const id of toAdd) {
|
|
10552
|
+
const payload = { [rel.targetKey]: recordId, [rel.otherKey]: id };
|
|
10553
|
+
const resp = await authenticatedFetch(`${apiUrl}/${relationResource}`, {
|
|
10554
|
+
method: "POST",
|
|
10555
|
+
headers: { "Content-Type": "application/json" },
|
|
10556
|
+
body: JSON.stringify(payload)
|
|
10557
|
+
});
|
|
10558
|
+
if (!resp.ok) errors.push(`Failed to add (${resp.status})`);
|
|
10559
|
+
}
|
|
10560
|
+
if (errors.length === 0) {
|
|
10561
|
+
setBaselineIds(newSet);
|
|
10562
|
+
} else {
|
|
10563
|
+
message.error(errors.join("; "));
|
|
10564
|
+
setSelectedIds([...baselineIds]);
|
|
10565
|
+
}
|
|
10566
|
+
} finally {
|
|
10567
|
+
setSaving(false);
|
|
10568
|
+
}
|
|
10569
|
+
}, [apiUrl, rel, record, allModels, baselineIds]);
|
|
10570
|
+
if (loading) return /* @__PURE__ */ jsx(Spin, { size: "small" });
|
|
10571
|
+
if (error) return /* @__PURE__ */ jsx(Alert, { type: "error", message: error, showIcon: true });
|
|
10572
|
+
if (!rel.otherResource || !rel.otherKey) {
|
|
10573
|
+
return /* @__PURE__ */ jsx(Alert, { type: "warning", message: _31("editable-csv requires a many-to-many relation"), showIcon: true });
|
|
10574
|
+
}
|
|
10575
|
+
return /* @__PURE__ */ jsx(
|
|
10576
|
+
Select,
|
|
10577
|
+
{
|
|
10578
|
+
mode: "multiple",
|
|
10579
|
+
value: selectedIds,
|
|
10580
|
+
onChange: handleChange,
|
|
10581
|
+
options: allOptions,
|
|
10582
|
+
loading: optionsLoading || saving,
|
|
10583
|
+
style: { width: "100%" },
|
|
10584
|
+
placeholder: `${_31("Select")} ${_31(rel.label)}...`,
|
|
10585
|
+
optionFilterProp: "label",
|
|
10586
|
+
showSearch: true,
|
|
10587
|
+
allowClear: true
|
|
10588
|
+
}
|
|
10589
|
+
);
|
|
10590
|
+
};
|
|
10591
|
+
var _32 = window._ || ((text) => text);
|
|
10592
|
+
var { Title: Title5 } = Typography;
|
|
10593
|
+
var PolymorphicRelatedObjectsTable = ({ rel, record, relationModel, parentModel, allModels, showActions = false, showCreate = false, allowInlineEdit = false, layoutPreferenceType, viewVariant = "default" }) => {
|
|
10594
|
+
const recordId = record?.[parentModel?.pkField ?? "eid"] ?? record?.eid ?? record?.id;
|
|
10595
|
+
const apiUrl = useApiUrl();
|
|
10596
|
+
const [loading, setLoading] = useState(false);
|
|
10597
|
+
const [error, setError] = useState(null);
|
|
10598
|
+
const [groupedIds, setGroupedIds] = useState(/* @__PURE__ */ new Map());
|
|
10599
|
+
const [unresolvedIds, setUnresolvedIds] = useState([]);
|
|
10600
|
+
const polyInfo = useMemo(
|
|
10601
|
+
() => getPolymorphicReferenceInfo(rel, relationModel, allModels),
|
|
10602
|
+
[rel.otherKey, rel.otherResource, relationModel, allModels]
|
|
10603
|
+
);
|
|
10604
|
+
useEffect(() => {
|
|
10605
|
+
if (!recordId || !rel.otherKey || !polyInfo) {
|
|
10606
|
+
setGroupedIds(/* @__PURE__ */ new Map());
|
|
10607
|
+
setUnresolvedIds([]);
|
|
10608
|
+
return;
|
|
10609
|
+
}
|
|
10610
|
+
let isMounted = true;
|
|
10611
|
+
const fetchGroups = async () => {
|
|
10612
|
+
setLoading(true);
|
|
10613
|
+
setError(null);
|
|
10614
|
+
try {
|
|
10615
|
+
const { groups, unresolved } = await fetchPolymorphicGroups({
|
|
10616
|
+
apiUrl,
|
|
10617
|
+
rel,
|
|
10618
|
+
recordId,
|
|
10619
|
+
referenceResource: polyInfo.referenceResource,
|
|
10620
|
+
allModels
|
|
10621
|
+
});
|
|
10622
|
+
if (isMounted) {
|
|
10623
|
+
setGroupedIds(groups);
|
|
10624
|
+
setUnresolvedIds(unresolved);
|
|
10625
|
+
}
|
|
10626
|
+
} catch (err) {
|
|
10627
|
+
if (isMounted) {
|
|
10628
|
+
setError(err instanceof Error ? err.message : "Failed to load related records");
|
|
10108
10629
|
}
|
|
10109
10630
|
} finally {
|
|
10110
10631
|
if (isMounted) setLoading(false);
|
|
@@ -10320,9 +10841,9 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
10320
10841
|
if (failed) {
|
|
10321
10842
|
throw new Error(`Save failed (${failed.status})`);
|
|
10322
10843
|
}
|
|
10323
|
-
message.success(
|
|
10844
|
+
message.success(_32("Layout preferences saved."));
|
|
10324
10845
|
} catch (error2) {
|
|
10325
|
-
message.error(error2 instanceof Error ? error2.message :
|
|
10846
|
+
message.error(error2 instanceof Error ? error2.message : _32("Failed to save layout preferences."));
|
|
10326
10847
|
} finally {
|
|
10327
10848
|
setIsSavingLayoutPrefs(false);
|
|
10328
10849
|
}
|
|
@@ -10351,9 +10872,9 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
10351
10872
|
if (!response.ok) {
|
|
10352
10873
|
throw new Error(`Save failed (${response.status})`);
|
|
10353
10874
|
}
|
|
10354
|
-
message.success(
|
|
10875
|
+
message.success(_32("Analyze preferences saved."));
|
|
10355
10876
|
} catch (error2) {
|
|
10356
|
-
message.error(error2 instanceof Error ? error2.message :
|
|
10877
|
+
message.error(error2 instanceof Error ? error2.message : _32("Failed to save analyze preferences."));
|
|
10357
10878
|
} finally {
|
|
10358
10879
|
setIsSavingAnalyzePrefs(false);
|
|
10359
10880
|
}
|
|
@@ -10456,11 +10977,11 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
10456
10977
|
const viewName = normalizeViewName(saveViewName || currentViewName);
|
|
10457
10978
|
const viewExists = availableViewNames.includes(viewName);
|
|
10458
10979
|
if (saveViewAsNew && viewExists) {
|
|
10459
|
-
message.error(
|
|
10980
|
+
message.error(_32("View name already exists. Choose a new name."));
|
|
10460
10981
|
return;
|
|
10461
10982
|
}
|
|
10462
10983
|
if (!saveViewAsNew && viewName !== currentViewName && viewExists) {
|
|
10463
|
-
message.error(
|
|
10984
|
+
message.error(_32('Choose a new name or enable "Save as new view".'));
|
|
10464
10985
|
return;
|
|
10465
10986
|
}
|
|
10466
10987
|
setSaveViewModalOpen(false);
|
|
@@ -10516,7 +11037,7 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
10516
11037
|
return;
|
|
10517
11038
|
}
|
|
10518
11039
|
if (availableViewNames.includes(newName)) {
|
|
10519
|
-
message.error(
|
|
11040
|
+
message.error(_32("View name already exists."));
|
|
10520
11041
|
return;
|
|
10521
11042
|
}
|
|
10522
11043
|
try {
|
|
@@ -10529,18 +11050,18 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
10529
11050
|
if (!response.ok) {
|
|
10530
11051
|
throw new Error(`Rename failed (${response.status})`);
|
|
10531
11052
|
}
|
|
10532
|
-
message.success(
|
|
11053
|
+
message.success(_32("View renamed."));
|
|
10533
11054
|
setRenameViewModalOpen(false);
|
|
10534
11055
|
await loadViewNames();
|
|
10535
11056
|
} catch (error2) {
|
|
10536
|
-
message.error(error2 instanceof Error ? error2.message :
|
|
11057
|
+
message.error(error2 instanceof Error ? error2.message : _32("Failed to rename view."));
|
|
10537
11058
|
}
|
|
10538
11059
|
}, [apiUrl, availableViewNames, currentViewName, relatedModel.name, relatedModel.resource, renameViewName, allModels, loadViewNames]);
|
|
10539
11060
|
const confirmDeleteView = useCallback(() => {
|
|
10540
11061
|
Modal.confirm({
|
|
10541
|
-
title:
|
|
11062
|
+
title: _32(_32("Delete view")),
|
|
10542
11063
|
content: `Delete "${currentViewName}" and all its saved preferences?`,
|
|
10543
|
-
okText:
|
|
11064
|
+
okText: _32("Delete"),
|
|
10544
11065
|
okButtonProps: { danger: true },
|
|
10545
11066
|
onOk: async () => {
|
|
10546
11067
|
try {
|
|
@@ -10553,10 +11074,10 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
10553
11074
|
if (!response.ok) {
|
|
10554
11075
|
throw new Error(`Delete failed (${response.status})`);
|
|
10555
11076
|
}
|
|
10556
|
-
message.success(
|
|
11077
|
+
message.success(_32("View deleted."));
|
|
10557
11078
|
await loadViewNames();
|
|
10558
11079
|
} catch (error2) {
|
|
10559
|
-
message.error(error2 instanceof Error ? error2.message :
|
|
11080
|
+
message.error(error2 instanceof Error ? error2.message : _32("Failed to delete view."));
|
|
10560
11081
|
}
|
|
10561
11082
|
}
|
|
10562
11083
|
});
|
|
@@ -10740,7 +11261,7 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
10740
11261
|
const direction = value?.direction || "next";
|
|
10741
11262
|
const unit = value?.unit || "weeks";
|
|
10742
11263
|
const isQuarter = unit === "quarters";
|
|
10743
|
-
const base =
|
|
11264
|
+
const base = dayjs8();
|
|
10744
11265
|
if (asRange || direction === "current") {
|
|
10745
11266
|
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
11267
|
if (isQuarter) {
|
|
@@ -10813,7 +11334,7 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
10813
11334
|
return true;
|
|
10814
11335
|
}
|
|
10815
11336
|
if (field.type === "date") {
|
|
10816
|
-
const recordDate =
|
|
11337
|
+
const recordDate = dayjs8(rawValue);
|
|
10817
11338
|
if (!recordDate.isValid()) return false;
|
|
10818
11339
|
const mode = rule.value?.mode || "absolute";
|
|
10819
11340
|
const mode2 = rule.value2?.mode || "absolute";
|
|
@@ -10821,7 +11342,7 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
10821
11342
|
if (val?.mode === "relative") {
|
|
10822
11343
|
return resolveRelativeDate(val, asRange);
|
|
10823
11344
|
}
|
|
10824
|
-
const date =
|
|
11345
|
+
const date = dayjs8(val?.date || val);
|
|
10825
11346
|
return asRange ? { start: date.startOf("day"), end: date.endOf("day") } : { date: date.startOf("day") };
|
|
10826
11347
|
};
|
|
10827
11348
|
switch (rule.operator) {
|
|
@@ -10832,13 +11353,13 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
10832
11353
|
}
|
|
10833
11354
|
case "after": {
|
|
10834
11355
|
const dateVal = mode === "relative" ? resolveRelativeDate(rule.value, false).date : getDateValue(rule.value, false).date;
|
|
10835
|
-
if (!dateVal || !
|
|
10836
|
-
return recordDate.valueOf() >
|
|
11356
|
+
if (!dateVal || !dayjs8(dateVal).isValid()) return false;
|
|
11357
|
+
return recordDate.valueOf() > dayjs8(dateVal).endOf("day").valueOf();
|
|
10837
11358
|
}
|
|
10838
11359
|
case "before": {
|
|
10839
11360
|
const dateVal = mode === "relative" ? resolveRelativeDate(rule.value, false).date : getDateValue(rule.value, false).date;
|
|
10840
|
-
if (!dateVal || !
|
|
10841
|
-
return recordDate.valueOf() <
|
|
11361
|
+
if (!dateVal || !dayjs8(dateVal).isValid()) return false;
|
|
11362
|
+
return recordDate.valueOf() < dayjs8(dateVal).startOf("day").valueOf();
|
|
10842
11363
|
}
|
|
10843
11364
|
case "between": {
|
|
10844
11365
|
const startRange = mode === "relative" ? resolveRelativeDate(rule.value, true) : getDateValue(rule.value, true);
|
|
@@ -10962,9 +11483,9 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
10962
11483
|
const deleteId = relationRow && rel.targetKey && rel.otherKey ? `${relationRow["eid_from"]}:${relationRow["eid_to"]}` : relationRow?.id ?? relationRow?.eid;
|
|
10963
11484
|
if (deleteId === void 0 || deleteId === null) return;
|
|
10964
11485
|
Modal.confirm({
|
|
10965
|
-
title:
|
|
10966
|
-
content:
|
|
10967
|
-
okText:
|
|
11486
|
+
title: _32("Delete"),
|
|
11487
|
+
content: _32("Are you sure you want to delete this relation?"),
|
|
11488
|
+
okText: _32("Delete"),
|
|
10968
11489
|
okButtonProps: { danger: true },
|
|
10969
11490
|
onOk: async () => {
|
|
10970
11491
|
try {
|
|
@@ -10985,9 +11506,9 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
10985
11506
|
const itemDeleteId = rel.targetKey && rel.otherKey ? `${itemRelationRow[rel.targetKey]}:${itemRelationRow[rel.otherKey]}` : itemRelationRow?.id ?? itemRelationRow?.eid;
|
|
10986
11507
|
return String(itemDeleteId) !== String(deleteId);
|
|
10987
11508
|
}));
|
|
10988
|
-
message.success(
|
|
11509
|
+
message.success(_32("Relation deleted."));
|
|
10989
11510
|
} catch (err) {
|
|
10990
|
-
message.error(err instanceof Error ? err.message :
|
|
11511
|
+
message.error(err instanceof Error ? err.message : _32("Failed to delete relation."));
|
|
10991
11512
|
}
|
|
10992
11513
|
}
|
|
10993
11514
|
});
|
|
@@ -11290,7 +11811,7 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
11290
11811
|
}
|
|
11291
11812
|
}, [numericFields, rankingFieldKey, rankingMode]);
|
|
11292
11813
|
const formatCategoryValue = useCallback((field, recordRow) => {
|
|
11293
|
-
if (!field) return
|
|
11814
|
+
if (!field) return _32("All");
|
|
11294
11815
|
const raw = recordRow?.[field.key];
|
|
11295
11816
|
if (raw === void 0 || raw === null) return "-";
|
|
11296
11817
|
if (field.key === "eid" && recordRow?._label) return recordRow._label;
|
|
@@ -11301,7 +11822,7 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
11301
11822
|
if (field.options) {
|
|
11302
11823
|
return field.options.find((option) => option.value === raw)?.label || String(raw);
|
|
11303
11824
|
}
|
|
11304
|
-
if (field.type === "boolean") return raw ?
|
|
11825
|
+
if (field.type === "boolean") return raw ? _32("Yes") : _32("No");
|
|
11305
11826
|
if (field.type === "date") return formatDateValue(raw);
|
|
11306
11827
|
return String(raw);
|
|
11307
11828
|
}, [labelCache]);
|
|
@@ -11393,7 +11914,7 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
11393
11914
|
const seriesLabels = numericFields.length > 0 ? numericFields.reduce((acc, field) => {
|
|
11394
11915
|
acc[field.key] = field.label;
|
|
11395
11916
|
return acc;
|
|
11396
|
-
}, { "__count__":
|
|
11917
|
+
}, { "__count__": _32("Count") }) : { "__count__": _32("Count") };
|
|
11397
11918
|
let groups = baseGroups;
|
|
11398
11919
|
if (rankingMode !== "none" && rankingFieldKey) {
|
|
11399
11920
|
const limit = Math.max(1, Math.floor(rankingN || 10));
|
|
@@ -11471,7 +11992,7 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
11471
11992
|
if (field.options) {
|
|
11472
11993
|
return field.options.find((option) => option.value === raw)?.label || String(raw);
|
|
11473
11994
|
}
|
|
11474
|
-
if (field.type === "boolean") return raw ?
|
|
11995
|
+
if (field.type === "boolean") return raw ? _32("Yes") : _32("No");
|
|
11475
11996
|
if (field.type === "date") return formatDateValue(raw);
|
|
11476
11997
|
return String(raw);
|
|
11477
11998
|
}, [labelCache]);
|
|
@@ -11674,7 +12195,7 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
11674
12195
|
if (field.options) {
|
|
11675
12196
|
return field.options.find((option) => option.value === raw)?.label || String(raw);
|
|
11676
12197
|
}
|
|
11677
|
-
if (field.type === "boolean") return raw ?
|
|
12198
|
+
if (field.type === "boolean") return raw ? _32("Yes") : _32("No");
|
|
11678
12199
|
if (field.type === "date") return formatDateValue(raw);
|
|
11679
12200
|
return String(raw);
|
|
11680
12201
|
}, [labelCache]);
|
|
@@ -11746,13 +12267,13 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
11746
12267
|
const getSummaryFunctionDisplayText = (fn) => {
|
|
11747
12268
|
if (!fn) return "";
|
|
11748
12269
|
const labels = {
|
|
11749
|
-
sum:
|
|
11750
|
-
avg:
|
|
11751
|
-
count:
|
|
11752
|
-
max:
|
|
11753
|
-
min:
|
|
11754
|
-
stddev:
|
|
11755
|
-
distinct:
|
|
12270
|
+
sum: _32("Sum"),
|
|
12271
|
+
avg: _32("Average"),
|
|
12272
|
+
count: _32("Count"),
|
|
12273
|
+
max: _32("Max"),
|
|
12274
|
+
min: _32("Min"),
|
|
12275
|
+
stddev: _32("Std Dev"),
|
|
12276
|
+
distinct: _32("Distinct")
|
|
11756
12277
|
};
|
|
11757
12278
|
return labels[fn] || fn;
|
|
11758
12279
|
};
|
|
@@ -11828,12 +12349,12 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
11828
12349
|
]
|
|
11829
12350
|
}
|
|
11830
12351
|
) }),
|
|
11831
|
-
/* @__PURE__ */ jsx(Tooltip, { title: isTotalsDetailsFlipped ?
|
|
12352
|
+
/* @__PURE__ */ jsx(Tooltip, { title: isTotalsDetailsFlipped ? _32("Show totals") : _32("Show details"), children: /* @__PURE__ */ jsx(
|
|
11832
12353
|
Button,
|
|
11833
12354
|
{
|
|
11834
12355
|
size: "small",
|
|
11835
12356
|
icon: /* @__PURE__ */ jsx(SwapOutlined, { style: { transform: "rotate(90deg)" } }),
|
|
11836
|
-
"aria-label": isTotalsDetailsFlipped ?
|
|
12357
|
+
"aria-label": isTotalsDetailsFlipped ? _32("Show totals") : _32("Show details"),
|
|
11837
12358
|
onClick: () => setIsTotalsDetailsFlipped((prev) => !prev),
|
|
11838
12359
|
style: {
|
|
11839
12360
|
flexShrink: 0,
|
|
@@ -11845,7 +12366,7 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
11845
12366
|
) })
|
|
11846
12367
|
] }),
|
|
11847
12368
|
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:
|
|
12369
|
+
/* @__PURE__ */ jsx(Typography.Text, { type: "secondary", style: { fontSize: 12 }, children: _32("Only the first N rows are loaded").replace("N", formatNumberValue(loadedRowsCount || relationsMaxRowsToLoad)) }),
|
|
11849
12370
|
/* @__PURE__ */ jsx(
|
|
11850
12371
|
Button,
|
|
11851
12372
|
{
|
|
@@ -11856,7 +12377,7 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
11856
12377
|
setFullDataLoaded(false);
|
|
11857
12378
|
setLoadAllRelatedRequested(true);
|
|
11858
12379
|
},
|
|
11859
|
-
children:
|
|
12380
|
+
children: _32("Load all related")
|
|
11860
12381
|
}
|
|
11861
12382
|
)
|
|
11862
12383
|
] })
|
|
@@ -11867,7 +12388,7 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
11867
12388
|
/* @__PURE__ */ jsxs("div", { style: { display: "flex", alignItems: "center", justifyContent: "space-between", gap: 12, marginBottom: 8 }, children: [
|
|
11868
12389
|
/* @__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
12390
|
/* @__PURE__ */ jsxs("div", { style: { display: "flex", gap: 8 }, children: [
|
|
11870
|
-
/* @__PURE__ */ jsx(Tooltip, { title: columnsSelectorOpen ?
|
|
12391
|
+
/* @__PURE__ */ jsx(Tooltip, { title: columnsSelectorOpen ? _32("Hide view configuration") : _32("Show view configuration"), children: /* @__PURE__ */ jsx(
|
|
11871
12392
|
Button,
|
|
11872
12393
|
{
|
|
11873
12394
|
size: "small",
|
|
@@ -11879,11 +12400,11 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
11879
12400
|
return next;
|
|
11880
12401
|
});
|
|
11881
12402
|
},
|
|
11882
|
-
"aria-label": columnsSelectorOpen ?
|
|
12403
|
+
"aria-label": columnsSelectorOpen ? _32("Hide view configuration") : _32("Show view configuration")
|
|
11883
12404
|
}
|
|
11884
12405
|
) }),
|
|
11885
12406
|
showCreate && recordId !== void 0 && recordId !== null && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
11886
|
-
/* @__PURE__ */ jsx(Tooltip, { title: rel.otherResource && rel.otherKey ?
|
|
12407
|
+
/* @__PURE__ */ jsx(Tooltip, { title: rel.otherResource && rel.otherKey ? _32("Associate existing") : _32("Add relation"), children: /* @__PURE__ */ jsx(
|
|
11887
12408
|
Button,
|
|
11888
12409
|
{
|
|
11889
12410
|
size: "small",
|
|
@@ -11916,7 +12437,7 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
11916
12437
|
}
|
|
11917
12438
|
}
|
|
11918
12439
|
) }),
|
|
11919
|
-
rel.otherResource && rel.otherKey && rel.targetKey && /* @__PURE__ */ jsx(Tooltip, { title:
|
|
12440
|
+
rel.otherResource && rel.otherKey && rel.targetKey && /* @__PURE__ */ jsx(Tooltip, { title: _32("Create new and relate"), children: /* @__PURE__ */ jsx(
|
|
11920
12441
|
Button,
|
|
11921
12442
|
{
|
|
11922
12443
|
size: "small",
|
|
@@ -11930,7 +12451,7 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
11930
12451
|
const relatedModel2 = findModelByName(allModels, rel.otherResource || rel.otherResourcePath);
|
|
11931
12452
|
const relatedResource = relatedModel2 ? resolveResourcePath(relatedModel2.resource || relatedModel2.name, allModels) : null;
|
|
11932
12453
|
if (!relatedResource) {
|
|
11933
|
-
message.warning(
|
|
12454
|
+
message.warning(_32("No create route for the related model. Opening relation create form."));
|
|
11934
12455
|
params.append(rel.targetKey, String(recordId));
|
|
11935
12456
|
if (allowInlineEdit) params.append("inline", "1");
|
|
11936
12457
|
const returnTo2 = `${location.pathname}${location.search}${location.hash}`;
|
|
@@ -11949,7 +12470,7 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
11949
12470
|
}
|
|
11950
12471
|
) })
|
|
11951
12472
|
] }),
|
|
11952
|
-
allowInlineEdit && /* @__PURE__ */ jsx(Tooltip, { title:
|
|
12473
|
+
allowInlineEdit && /* @__PURE__ */ jsx(Tooltip, { title: _32("Save"), children: /* @__PURE__ */ jsx(
|
|
11953
12474
|
Button,
|
|
11954
12475
|
{
|
|
11955
12476
|
size: "small",
|
|
@@ -11957,10 +12478,10 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
11957
12478
|
icon: /* @__PURE__ */ jsx(SaveOutlined, {}),
|
|
11958
12479
|
onClick: saveAllEdits,
|
|
11959
12480
|
loading: savingAll,
|
|
11960
|
-
"aria-label":
|
|
12481
|
+
"aria-label": _32("Save")
|
|
11961
12482
|
}
|
|
11962
12483
|
) }),
|
|
11963
|
-
/* @__PURE__ */ jsx(Tooltip, { title:
|
|
12484
|
+
/* @__PURE__ */ jsx(Tooltip, { title: _32("Export CSV"), children: /* @__PURE__ */ jsx(
|
|
11964
12485
|
Button,
|
|
11965
12486
|
{
|
|
11966
12487
|
size: "small",
|
|
@@ -11975,20 +12496,20 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
11975
12496
|
Modal,
|
|
11976
12497
|
{
|
|
11977
12498
|
open: saveViewModalOpen,
|
|
11978
|
-
title:
|
|
12499
|
+
title: _32("Save view"),
|
|
11979
12500
|
onCancel: () => {
|
|
11980
12501
|
setSaveViewModalOpen(false);
|
|
11981
12502
|
setPendingSaveTarget(null);
|
|
11982
12503
|
},
|
|
11983
12504
|
onOk: handleConfirmSaveView,
|
|
11984
|
-
okText: pendingSaveTarget === "layout" ?
|
|
12505
|
+
okText: pendingSaveTarget === "layout" ? _32("Save layout") : _32("Save analyze"),
|
|
11985
12506
|
okButtonProps: { disabled: !pendingSaveTarget },
|
|
11986
12507
|
children: /* @__PURE__ */ jsxs("div", { style: { display: "grid", gap: 12 }, children: [
|
|
11987
12508
|
/* @__PURE__ */ jsxs("div", { children: [
|
|
11988
|
-
/* @__PURE__ */ jsx("div", { style: { fontSize: 12, color: token.colorTextSecondary, marginBottom: 4 }, children:
|
|
12509
|
+
/* @__PURE__ */ jsx("div", { style: { fontSize: 12, color: token.colorTextSecondary, marginBottom: 4 }, children: _32("View name") }),
|
|
11989
12510
|
/* @__PURE__ */ jsx(Input, { value: saveViewName, onChange: (event) => setSaveViewName(event.target.value) })
|
|
11990
12511
|
] }),
|
|
11991
|
-
/* @__PURE__ */ jsx(Checkbox, { checked: saveViewAsNew, onChange: (event) => setSaveViewAsNew(event.target.checked), children:
|
|
12512
|
+
/* @__PURE__ */ jsx(Checkbox, { checked: saveViewAsNew, onChange: (event) => setSaveViewAsNew(event.target.checked), children: _32("Save as new view") })
|
|
11992
12513
|
] })
|
|
11993
12514
|
}
|
|
11994
12515
|
),
|
|
@@ -11996,10 +12517,10 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
11996
12517
|
Modal,
|
|
11997
12518
|
{
|
|
11998
12519
|
open: renameViewModalOpen,
|
|
11999
|
-
title:
|
|
12520
|
+
title: _32("Rename view"),
|
|
12000
12521
|
onCancel: () => setRenameViewModalOpen(false),
|
|
12001
12522
|
onOk: handleRenameView,
|
|
12002
|
-
okText:
|
|
12523
|
+
okText: _32("Rename"),
|
|
12003
12524
|
children: /* @__PURE__ */ jsx(Input, { value: renameViewName, onChange: (event) => setRenameViewName(event.target.value) })
|
|
12004
12525
|
}
|
|
12005
12526
|
),
|
|
@@ -12009,11 +12530,11 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
12009
12530
|
{
|
|
12010
12531
|
size: "small",
|
|
12011
12532
|
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:
|
|
12533
|
+
/* @__PURE__ */ jsx("span", { style: { color: token.colorTextSecondary, fontSize: 12, fontWeight: 600 }, children: _32("Filters") }),
|
|
12013
12534
|
/* @__PURE__ */ jsx("div", { style: { display: "flex", alignItems: "center", gap: 8, flex: 1, justifyContent: "flex-end" }, children: /* @__PURE__ */ jsx(
|
|
12014
12535
|
Input,
|
|
12015
12536
|
{
|
|
12016
|
-
placeholder:
|
|
12537
|
+
placeholder: _32("Search all fields..."),
|
|
12017
12538
|
prefix: /* @__PURE__ */ jsx(SearchOutlined, {}),
|
|
12018
12539
|
allowClear: true,
|
|
12019
12540
|
value: localSearch,
|
|
@@ -12031,31 +12552,31 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
12031
12552
|
Card,
|
|
12032
12553
|
{
|
|
12033
12554
|
size: "small",
|
|
12034
|
-
title: /* @__PURE__ */ jsx("span", { style: { color: token.colorTextSecondary, fontSize: 12, fontWeight: 600 }, children:
|
|
12555
|
+
title: /* @__PURE__ */ jsx("span", { style: { color: token.colorTextSecondary, fontSize: 12, fontWeight: 600 }, children: _32("View configuration") }),
|
|
12035
12556
|
style: { marginBottom: 16 },
|
|
12036
12557
|
styles: { body: { display: "grid", gap: 12 } },
|
|
12037
12558
|
children: [
|
|
12038
12559
|
/* @__PURE__ */ jsxs("div", { style: { display: "grid", gap: 12 }, children: [
|
|
12039
12560
|
/* @__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:
|
|
12561
|
+
/* @__PURE__ */ jsx("div", { style: { fontSize: 12, color: token.colorTextSecondary, fontWeight: 600 }, children: _32("Advanced filters") }),
|
|
12562
|
+
filterRules.length === 0 ? /* @__PURE__ */ jsx("div", { style: { color: token.colorTextSecondary, fontSize: 12 }, children: _32("No filters yet.") }) : filterRules.map((rule) => {
|
|
12042
12563
|
const field = relatedModel.fields.find((f) => f.key === rule.fieldKey);
|
|
12043
12564
|
const type = field?.type || "string";
|
|
12044
12565
|
const operatorOptions = type === "number" ? [
|
|
12045
|
-
{ label:
|
|
12046
|
-
{ label:
|
|
12047
|
-
{ label:
|
|
12048
|
-
{ label:
|
|
12049
|
-
{ label:
|
|
12050
|
-
{ label:
|
|
12566
|
+
{ label: _32("="), value: "eq" },
|
|
12567
|
+
{ label: _32(">"), value: "gt" },
|
|
12568
|
+
{ label: _32(">="), value: "gte" },
|
|
12569
|
+
{ label: _32("<"), value: "lt" },
|
|
12570
|
+
{ label: _32("<="), value: "lte" },
|
|
12571
|
+
{ label: _32("Between"), value: "between" }
|
|
12051
12572
|
] : type === "date" ? [
|
|
12052
|
-
{ label:
|
|
12053
|
-
{ label:
|
|
12054
|
-
{ label:
|
|
12055
|
-
{ label:
|
|
12056
|
-
] : type === "boolean" ? [{ label:
|
|
12057
|
-
{ label:
|
|
12058
|
-
{ label:
|
|
12573
|
+
{ label: _32("On"), value: "on" },
|
|
12574
|
+
{ label: _32("After"), value: "after" },
|
|
12575
|
+
{ label: _32("Before"), value: "before" },
|
|
12576
|
+
{ label: _32("Between"), value: "between" }
|
|
12577
|
+
] : type === "boolean" ? [{ label: _32("Is"), value: "is" }] : [
|
|
12578
|
+
{ label: _32("Contains"), value: "contains" },
|
|
12579
|
+
{ label: _32("Equals"), value: "equals" }
|
|
12059
12580
|
];
|
|
12060
12581
|
const renderDateInput = (value, onChange) => {
|
|
12061
12582
|
const mode = value?.mode || "absolute";
|
|
@@ -12068,9 +12589,9 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
12068
12589
|
value: value?.direction || "next",
|
|
12069
12590
|
onChange: (val) => onChange({ ...value, mode: "relative", direction: val }),
|
|
12070
12591
|
options: [
|
|
12071
|
-
{ label:
|
|
12072
|
-
{ label:
|
|
12073
|
-
{ label:
|
|
12592
|
+
{ label: _32("Previous"), value: "previous" },
|
|
12593
|
+
{ label: _32("Current"), value: "current" },
|
|
12594
|
+
{ label: _32("Next"), value: "next" }
|
|
12074
12595
|
]
|
|
12075
12596
|
}
|
|
12076
12597
|
),
|
|
@@ -12080,11 +12601,11 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
12080
12601
|
value: value?.unit || "weeks",
|
|
12081
12602
|
onChange: (val) => onChange({ ...value, mode: "relative", unit: val }),
|
|
12082
12603
|
options: [
|
|
12083
|
-
{ label:
|
|
12084
|
-
{ label:
|
|
12085
|
-
{ label:
|
|
12086
|
-
{ label:
|
|
12087
|
-
{ label:
|
|
12604
|
+
{ label: _32("Days"), value: "days" },
|
|
12605
|
+
{ label: _32("Weeks"), value: "weeks" },
|
|
12606
|
+
{ label: _32("Months"), value: "months" },
|
|
12607
|
+
{ label: _32("Quarters"), value: "quarters" },
|
|
12608
|
+
{ label: _32("Years"), value: "years" }
|
|
12088
12609
|
]
|
|
12089
12610
|
}
|
|
12090
12611
|
)
|
|
@@ -12093,7 +12614,7 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
12093
12614
|
return /* @__PURE__ */ jsx(
|
|
12094
12615
|
DatePicker,
|
|
12095
12616
|
{
|
|
12096
|
-
value: value?.date ?
|
|
12617
|
+
value: value?.date ? dayjs8(value.date) : void 0,
|
|
12097
12618
|
onChange: (val) => onChange({ mode: "absolute", date: val ? val.toISOString() : null })
|
|
12098
12619
|
}
|
|
12099
12620
|
);
|
|
@@ -12106,7 +12627,7 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
12106
12627
|
value: rule.fieldKey,
|
|
12107
12628
|
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
12629
|
options: relatedModel.fields.map((f) => ({ label: f.label, value: f.key })),
|
|
12109
|
-
placeholder:
|
|
12630
|
+
placeholder: _32("Field")
|
|
12110
12631
|
}
|
|
12111
12632
|
),
|
|
12112
12633
|
/* @__PURE__ */ jsx(
|
|
@@ -12116,7 +12637,7 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
12116
12637
|
value: rule.operator,
|
|
12117
12638
|
onChange: (value) => setFilterRules((prev) => prev.map((item) => item.id === rule.id ? { ...item, operator: value } : item)),
|
|
12118
12639
|
options: operatorOptions,
|
|
12119
|
-
placeholder:
|
|
12640
|
+
placeholder: _32("Operator")
|
|
12120
12641
|
}
|
|
12121
12642
|
),
|
|
12122
12643
|
type === "number" && rule.operator === "between" && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
@@ -12149,10 +12670,10 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
12149
12670
|
value: rule.value,
|
|
12150
12671
|
onChange: (value) => setFilterRules((prev) => prev.map((item) => item.id === rule.id ? { ...item, value } : item)),
|
|
12151
12672
|
options: [
|
|
12152
|
-
{ label:
|
|
12153
|
-
{ label:
|
|
12673
|
+
{ label: _32("True"), value: true },
|
|
12674
|
+
{ label: _32("False"), value: false }
|
|
12154
12675
|
],
|
|
12155
|
-
placeholder:
|
|
12676
|
+
placeholder: _32("Value")
|
|
12156
12677
|
}
|
|
12157
12678
|
),
|
|
12158
12679
|
type === "date" && rule.operator === "between" && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
@@ -12165,7 +12686,7 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
12165
12686
|
{
|
|
12166
12687
|
value: rule.value,
|
|
12167
12688
|
onChange: (event) => setFilterRules((prev) => prev.map((item) => item.id === rule.id ? { ...item, value: event.target.value } : item)),
|
|
12168
|
-
placeholder:
|
|
12689
|
+
placeholder: _32("Value"),
|
|
12169
12690
|
style: { minWidth: 200 }
|
|
12170
12691
|
}
|
|
12171
12692
|
),
|
|
@@ -12178,8 +12699,8 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
12178
12699
|
setFilterRules((prev) => prev.map((item) => item.id === rule.id ? { ...item, value: { ...item.value || {}, mode: val } } : item));
|
|
12179
12700
|
},
|
|
12180
12701
|
options: [
|
|
12181
|
-
{ label:
|
|
12182
|
-
{ label:
|
|
12702
|
+
{ label: _32("Date"), value: "absolute" },
|
|
12703
|
+
{ label: _32("Relative"), value: "relative" }
|
|
12183
12704
|
]
|
|
12184
12705
|
}
|
|
12185
12706
|
),
|
|
@@ -12192,8 +12713,8 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
12192
12713
|
setFilterRules((prev) => prev.map((item) => item.id === rule.id ? { ...item, value2: { ...item.value2 || {}, mode: val } } : item));
|
|
12193
12714
|
},
|
|
12194
12715
|
options: [
|
|
12195
|
-
{ label:
|
|
12196
|
-
{ label:
|
|
12716
|
+
{ label: _32("Date"), value: "absolute" },
|
|
12717
|
+
{ label: _32("Relative"), value: "relative" }
|
|
12197
12718
|
]
|
|
12198
12719
|
}
|
|
12199
12720
|
),
|
|
@@ -12203,7 +12724,7 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
12203
12724
|
size: "small",
|
|
12204
12725
|
danger: true,
|
|
12205
12726
|
onClick: () => setFilterRules((prev) => prev.filter((item) => item.id !== rule.id)),
|
|
12206
|
-
children:
|
|
12727
|
+
children: _32("Remove")
|
|
12207
12728
|
}
|
|
12208
12729
|
)
|
|
12209
12730
|
] }, rule.id);
|
|
@@ -12215,14 +12736,14 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
12215
12736
|
size: "small",
|
|
12216
12737
|
icon: /* @__PURE__ */ jsx(FilterOutlined, {}),
|
|
12217
12738
|
onClick: () => setFilterRules((prev) => [...prev, { id: `${Date.now()}-${Math.random()}` }]),
|
|
12218
|
-
children:
|
|
12739
|
+
children: _32("Add Filter")
|
|
12219
12740
|
}
|
|
12220
12741
|
),
|
|
12221
|
-
filterRules.length > 0 && /* @__PURE__ */ jsx(Button, { size: "small", onClick: () => setFilterRules([]), children:
|
|
12742
|
+
filterRules.length > 0 && /* @__PURE__ */ jsx(Button, { size: "small", onClick: () => setFilterRules([]), children: _32("Clear filters") })
|
|
12222
12743
|
] })
|
|
12223
12744
|
] }),
|
|
12224
12745
|
/* @__PURE__ */ jsxs("div", { style: { display: "grid", gap: 6 }, children: [
|
|
12225
|
-
/* @__PURE__ */ jsx("div", { style: { fontSize: 12, color: token.colorTextSecondary, fontWeight: 600 }, children:
|
|
12746
|
+
/* @__PURE__ */ jsx("div", { style: { fontSize: 12, color: token.colorTextSecondary, fontWeight: 600 }, children: _32("Views shown") }),
|
|
12226
12747
|
/* @__PURE__ */ jsx(
|
|
12227
12748
|
Select,
|
|
12228
12749
|
{
|
|
@@ -12243,12 +12764,12 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
12243
12764
|
),
|
|
12244
12765
|
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
12766
|
/* @__PURE__ */ jsx("div", { style: { flex: 1 }, children: name }),
|
|
12246
|
-
/* @__PURE__ */ jsx(Tooltip, { title:
|
|
12247
|
-
/* @__PURE__ */ jsx(Tooltip, { title:
|
|
12767
|
+
/* @__PURE__ */ jsx(Tooltip, { title: _32("Move up"), children: /* @__PURE__ */ jsx(Button, { size: "small", icon: /* @__PURE__ */ jsx(ArrowUpOutlined, {}), disabled: index === 0, onClick: () => moveSelectedView(name, "up") }) }),
|
|
12768
|
+
/* @__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
12769
|
] }, name)) })
|
|
12249
12770
|
] }),
|
|
12250
12771
|
/* @__PURE__ */ jsxs("div", { style: { display: "grid", gap: 6 }, children: [
|
|
12251
|
-
/* @__PURE__ */ jsx("div", { style: { fontSize: 12, color: token.colorTextSecondary, fontWeight: 600 }, children:
|
|
12772
|
+
/* @__PURE__ */ jsx("div", { style: { fontSize: 12, color: token.colorTextSecondary, fontWeight: 600 }, children: _32("Active view") }),
|
|
12252
12773
|
viewSelector
|
|
12253
12774
|
] }),
|
|
12254
12775
|
/* @__PURE__ */ jsxs("div", { style: { display: "flex", flexWrap: "wrap", alignItems: "center", gap: 8 }, children: [
|
|
@@ -12260,7 +12781,7 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
12260
12781
|
setRenameViewName(currentViewName);
|
|
12261
12782
|
setRenameViewModalOpen(true);
|
|
12262
12783
|
},
|
|
12263
|
-
children:
|
|
12784
|
+
children: _32("Rename view")
|
|
12264
12785
|
}
|
|
12265
12786
|
),
|
|
12266
12787
|
/* @__PURE__ */ jsx(
|
|
@@ -12271,7 +12792,7 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
12271
12792
|
icon: /* @__PURE__ */ jsx(DeleteOutlined, {}),
|
|
12272
12793
|
disabled: availableViewNames.length <= 1,
|
|
12273
12794
|
onClick: confirmDeleteView,
|
|
12274
|
-
children:
|
|
12795
|
+
children: _32("Delete view")
|
|
12275
12796
|
}
|
|
12276
12797
|
),
|
|
12277
12798
|
layoutPreferenceType && /* @__PURE__ */ jsx(
|
|
@@ -12281,7 +12802,7 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
12281
12802
|
icon: /* @__PURE__ */ jsx(SaveOutlined, {}),
|
|
12282
12803
|
onClick: () => openSaveViewModalFor("layout"),
|
|
12283
12804
|
loading: isSavingLayoutPrefs,
|
|
12284
|
-
children:
|
|
12805
|
+
children: _32("Save layout")
|
|
12285
12806
|
}
|
|
12286
12807
|
),
|
|
12287
12808
|
/* @__PURE__ */ jsx(
|
|
@@ -12293,7 +12814,7 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
12293
12814
|
markLayoutPrefsTouched();
|
|
12294
12815
|
setFiltersCollapsed((prev) => !prev);
|
|
12295
12816
|
},
|
|
12296
|
-
children: filtersCollapsed ?
|
|
12817
|
+
children: filtersCollapsed ? _32("Show Filters") : _32("Hide Filters")
|
|
12297
12818
|
}
|
|
12298
12819
|
),
|
|
12299
12820
|
/* @__PURE__ */ jsx(
|
|
@@ -12305,7 +12826,7 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
12305
12826
|
markLayoutPrefsTouched();
|
|
12306
12827
|
setListVisible((prev) => !prev);
|
|
12307
12828
|
},
|
|
12308
|
-
children:
|
|
12829
|
+
children: _32("View list")
|
|
12309
12830
|
}
|
|
12310
12831
|
),
|
|
12311
12832
|
/* @__PURE__ */ jsx(
|
|
@@ -12319,7 +12840,7 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
12319
12840
|
setIsStatsFlipped(false);
|
|
12320
12841
|
setAnalyzeOpen((prev) => !prev);
|
|
12321
12842
|
},
|
|
12322
|
-
children:
|
|
12843
|
+
children: _32("Analyze")
|
|
12323
12844
|
}
|
|
12324
12845
|
),
|
|
12325
12846
|
/* @__PURE__ */ jsx(
|
|
@@ -12331,7 +12852,7 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
12331
12852
|
markLayoutPrefsTouched();
|
|
12332
12853
|
setIsAnalyzeVertical((prev) => !prev);
|
|
12333
12854
|
},
|
|
12334
|
-
children:
|
|
12855
|
+
children: _32("Switch orientation")
|
|
12335
12856
|
}
|
|
12336
12857
|
),
|
|
12337
12858
|
/* @__PURE__ */ jsx(
|
|
@@ -12343,21 +12864,21 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
12343
12864
|
markLayoutPrefsTouched();
|
|
12344
12865
|
setIsAnalyzeFirst((prev) => !prev);
|
|
12345
12866
|
},
|
|
12346
|
-
children:
|
|
12867
|
+
children: _32("Switch positions")
|
|
12347
12868
|
}
|
|
12348
12869
|
)
|
|
12349
12870
|
] })
|
|
12350
12871
|
] }),
|
|
12351
12872
|
/* @__PURE__ */ jsxs("div", { style: { display: "grid", gap: 12 }, children: [
|
|
12352
12873
|
/* @__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:
|
|
12874
|
+
/* @__PURE__ */ jsx("span", { style: { color: token.colorTextSecondary, fontSize: 12, fontWeight: 600 }, children: _32("Columns") }),
|
|
12354
12875
|
selectedColumnKeys && selectedColumnKeys.length > 0 && /* @__PURE__ */ jsx(Button, { size: "small", onClick: () => {
|
|
12355
12876
|
setSelectedColumnKeys(null);
|
|
12356
12877
|
setColumnOrder(null);
|
|
12357
|
-
}, children:
|
|
12878
|
+
}, children: _32("Reset to default") })
|
|
12358
12879
|
] }),
|
|
12359
12880
|
/* @__PURE__ */ jsxs("div", { children: [
|
|
12360
|
-
/* @__PURE__ */ jsx("div", { style: { fontSize: 12, color: token.colorTextSecondary, marginBottom: 6 }, children:
|
|
12881
|
+
/* @__PURE__ */ jsx("div", { style: { fontSize: 12, color: token.colorTextSecondary, marginBottom: 6 }, children: _32("Select columns") }),
|
|
12361
12882
|
/* @__PURE__ */ jsx(
|
|
12362
12883
|
Checkbox.Group,
|
|
12363
12884
|
{
|
|
@@ -12369,27 +12890,27 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
12369
12890
|
(!selectedColumnKeys || selectedColumnKeys.length === 0) && /* @__PURE__ */ jsx("div", { style: { fontSize: 12, color: token.colorTextSecondary, marginTop: 6 }, children: "Using default columns. Select fields to customize." })
|
|
12370
12891
|
] }),
|
|
12371
12892
|
/* @__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:
|
|
12893
|
+
/* @__PURE__ */ jsx("div", { style: { fontSize: 12, color: token.colorTextSecondary, marginBottom: 6 }, children: _32("Column order") }),
|
|
12894
|
+
orderedSelectedColumns.length === 0 ? /* @__PURE__ */ jsx("div", { style: { fontSize: 12, color: token.colorTextSecondary }, children: _32("No custom order yet.") }) : orderedSelectedColumns.map((key, index) => {
|
|
12374
12895
|
const field = relatedModel.fields.find((item) => item.key === key);
|
|
12375
12896
|
if (!field) return null;
|
|
12376
12897
|
return /* @__PURE__ */ jsxs("div", { style: { display: "flex", alignItems: "center", gap: 8, marginBottom: 4 }, children: [
|
|
12377
12898
|
/* @__PURE__ */ jsx("div", { style: { flex: 1 }, children: field.label }),
|
|
12378
|
-
/* @__PURE__ */ jsx(Tooltip, { title:
|
|
12379
|
-
/* @__PURE__ */ jsx(Tooltip, { title:
|
|
12899
|
+
/* @__PURE__ */ jsx(Tooltip, { title: _32("Move left"), children: /* @__PURE__ */ jsx(Button, { size: "small", icon: /* @__PURE__ */ jsx(ArrowLeftOutlined, {}), disabled: index === 0, onClick: () => moveColumnOrder(key, "left") }) }),
|
|
12900
|
+
/* @__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
12901
|
] }, key);
|
|
12381
12902
|
})
|
|
12382
12903
|
] }),
|
|
12383
12904
|
/* @__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:
|
|
12905
|
+
/* @__PURE__ */ jsx("div", { style: { fontSize: 12, color: token.colorTextSecondary, marginBottom: 6 }, children: _32("Totals summary function") }),
|
|
12906
|
+
/* @__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
12907
|
const options = [
|
|
12387
|
-
{ label:
|
|
12388
|
-
{ label:
|
|
12389
|
-
{ label:
|
|
12390
|
-
{ label:
|
|
12391
|
-
{ label:
|
|
12392
|
-
{ label:
|
|
12908
|
+
{ label: _32("Sum"), value: "sum" },
|
|
12909
|
+
{ label: _32("Average"), value: "avg" },
|
|
12910
|
+
{ label: _32("Count"), value: "count" },
|
|
12911
|
+
{ label: _32("Max"), value: "max" },
|
|
12912
|
+
{ label: _32("Min"), value: "min" },
|
|
12913
|
+
{ label: _32("Std Dev"), value: "stddev" }
|
|
12393
12914
|
];
|
|
12394
12915
|
return /* @__PURE__ */ jsxs("div", { style: { display: "flex", alignItems: "center", gap: 8 }, children: [
|
|
12395
12916
|
/* @__PURE__ */ jsx("div", { style: { flex: 1 }, children: field.label }),
|
|
@@ -12443,7 +12964,7 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
12443
12964
|
setCurrentPage(1);
|
|
12444
12965
|
}
|
|
12445
12966
|
},
|
|
12446
|
-
onShowSizeChange: (
|
|
12967
|
+
onShowSizeChange: (_41, newPageSize) => {
|
|
12447
12968
|
if (newPageSize && newPageSize !== pageSize) {
|
|
12448
12969
|
setPageSize(newPageSize);
|
|
12449
12970
|
setCurrentPage(1);
|
|
@@ -12452,8 +12973,8 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
12452
12973
|
},
|
|
12453
12974
|
size: "small",
|
|
12454
12975
|
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: (
|
|
12976
|
+
locale: filteredRows.length === 0 ? { emptyText: /* @__PURE__ */ jsx("span", { style: { display: "inline-block", fontSize: 12, color: "#8c8c8c" }, children: _32("No related records") }) } : void 0,
|
|
12977
|
+
onChange: (_41, filters, sorter, extra) => {
|
|
12457
12978
|
const nextFilters = {};
|
|
12458
12979
|
Object.entries(filters || {}).forEach(([key, values]) => {
|
|
12459
12980
|
if (!values) return;
|
|
@@ -12521,7 +13042,7 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
12521
13042
|
const recordValue = recordRow?.[field.key];
|
|
12522
13043
|
return String(recordValue) === String(value);
|
|
12523
13044
|
},
|
|
12524
|
-
align: field.type === "number" && !["eid", "eid_from", "eid_to"].includes(field.key) ? "right" : void 0,
|
|
13045
|
+
align: field.type === "number" && !field.reference && !["eid", "eid_from", "eid_to"].includes(field.key) ? "right" : void 0,
|
|
12525
13046
|
render: (value, row) => {
|
|
12526
13047
|
if (allowInlineEdit && field.key !== "eid") {
|
|
12527
13048
|
const rowId = row?.eid ?? row?.id ?? row?.__relationKey;
|
|
@@ -12531,12 +13052,16 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
12531
13052
|
name: [rowId, field.key],
|
|
12532
13053
|
style: { margin: 0 },
|
|
12533
13054
|
valuePropName: field.type === "boolean" ? "checked" : "value",
|
|
12534
|
-
getValueProps: (val) => (field.type === "date" || field.type === "datetime") && val ? { value:
|
|
13055
|
+
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
13056
|
children: renderEditableInput(field, rowId)
|
|
12536
13057
|
}
|
|
12537
13058
|
);
|
|
12538
13059
|
}
|
|
12539
13060
|
const renderValue = () => {
|
|
13061
|
+
const showToken = normalizeFieldViewType(field.showViewType || "");
|
|
13062
|
+
if (showToken && !(showToken === "read-only-field" && field.reference)) {
|
|
13063
|
+
return renderFieldValue(field, row, allModels, true);
|
|
13064
|
+
}
|
|
12540
13065
|
if (field.reference && value) {
|
|
12541
13066
|
const cacheKey = `${field.reference}:${value}`;
|
|
12542
13067
|
return labelCache[cacheKey] || value;
|
|
@@ -12578,7 +13103,7 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
12578
13103
|
showActions && /* @__PURE__ */ jsx(
|
|
12579
13104
|
Table.Column,
|
|
12580
13105
|
{
|
|
12581
|
-
title:
|
|
13106
|
+
title: _32("Actions"),
|
|
12582
13107
|
width: 140,
|
|
12583
13108
|
render: (_unused, row) => {
|
|
12584
13109
|
const id = row?.eid ?? row?.id;
|
|
@@ -12586,14 +13111,14 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
12586
13111
|
const deleteId = relationRow && rel.targetKey && rel.otherKey ? `${relationRow["eid_from"]}:${relationRow["eid_to"]}` : relationRow?.id ?? relationRow?.eid;
|
|
12587
13112
|
return /* @__PURE__ */ jsxs(Space, { children: [
|
|
12588
13113
|
id && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
12589
|
-
/* @__PURE__ */ jsx(Tooltip, { title:
|
|
13114
|
+
/* @__PURE__ */ jsx(Tooltip, { title: _32("View"), children: /* @__PURE__ */ jsx(Button, { size: "small", icon: /* @__PURE__ */ jsx(EyeOutlined, {}), onClick: () => {
|
|
12590
13115
|
if (paneNav?.isInMultiPane) {
|
|
12591
13116
|
paneNav.openDetail(relatedModel.name, id);
|
|
12592
13117
|
} else {
|
|
12593
13118
|
go({ to: { resource: relatedModel.name, action: "show", id } });
|
|
12594
13119
|
}
|
|
12595
13120
|
} }) }),
|
|
12596
|
-
/* @__PURE__ */ jsx(Tooltip, { title:
|
|
13121
|
+
/* @__PURE__ */ jsx(Tooltip, { title: _32("Edit"), children: /* @__PURE__ */ jsx(Button, { size: "small", icon: /* @__PURE__ */ jsx(EditOutlined, {}), onClick: () => {
|
|
12597
13122
|
if (allowInlineEdit) {
|
|
12598
13123
|
const params = new URLSearchParams();
|
|
12599
13124
|
params.append("inline", "1");
|
|
@@ -12605,7 +13130,7 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
12605
13130
|
}
|
|
12606
13131
|
} }) })
|
|
12607
13132
|
] }),
|
|
12608
|
-
deleteId && /* @__PURE__ */ jsx(Tooltip, { title:
|
|
13133
|
+
deleteId && /* @__PURE__ */ jsx(Tooltip, { title: _32("Delete"), children: /* @__PURE__ */ jsx(
|
|
12609
13134
|
Button,
|
|
12610
13135
|
{
|
|
12611
13136
|
size: "small",
|
|
@@ -12625,7 +13150,7 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
12625
13150
|
}
|
|
12626
13151
|
),
|
|
12627
13152
|
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:
|
|
13153
|
+
/* @__PURE__ */ jsx(Typography.Text, { type: "secondary", style: { fontSize: 12 }, children: _32("Only the first N rows are loaded").replace("N", formatNumberValue(loadedRowsCount || relationsMaxRowsToLoad)) }),
|
|
12629
13154
|
/* @__PURE__ */ jsx(
|
|
12630
13155
|
Button,
|
|
12631
13156
|
{
|
|
@@ -12635,7 +13160,7 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
12635
13160
|
setFullDataLoaded(false);
|
|
12636
13161
|
setLoadAllRelatedRequested(true);
|
|
12637
13162
|
},
|
|
12638
|
-
children:
|
|
13163
|
+
children: _32("Load all related")
|
|
12639
13164
|
}
|
|
12640
13165
|
)
|
|
12641
13166
|
] })
|
|
@@ -12645,7 +13170,7 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
12645
13170
|
Card,
|
|
12646
13171
|
{
|
|
12647
13172
|
size: "small",
|
|
12648
|
-
title: /* @__PURE__ */ jsx("span", { style: { color: relatedModelTone.text, fontWeight: 600 }, children:
|
|
13173
|
+
title: /* @__PURE__ */ jsx("span", { style: { color: relatedModelTone.text, fontWeight: 600 }, children: _32("Analyze") }),
|
|
12649
13174
|
styles: {
|
|
12650
13175
|
header: {
|
|
12651
13176
|
background: `linear-gradient(135deg, ${relatedModelTone.solid}18 0%, ${relatedModelTone.solid}0a 100%)`
|
|
@@ -12674,10 +13199,10 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
12674
13199
|
styles: { body: { display: "grid", gap: 16, position: "relative", paddingTop: 48 } },
|
|
12675
13200
|
children: [
|
|
12676
13201
|
/* @__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:
|
|
13202
|
+
/* @__PURE__ */ jsx(Tooltip, { title: _32("Save preferences"), children: /* @__PURE__ */ jsx(Button, { size: "small", icon: /* @__PURE__ */ jsx(SaveOutlined, {}), onClick: () => openSaveViewModalFor("analyze"), loading: isSavingAnalyzePrefs }) }),
|
|
13203
|
+
/* @__PURE__ */ jsx(Tooltip, { title: _32("Stats"), children: /* @__PURE__ */ jsx(Button, { size: "small", icon: /* @__PURE__ */ jsx(FileTextOutlined, {}), onClick: () => setIsStatsFlipped(true) }) }),
|
|
13204
|
+
/* @__PURE__ */ jsx(Tooltip, { title: _32("Export chart PDF"), children: /* @__PURE__ */ jsx(Button, { size: "small", icon: /* @__PURE__ */ jsx(FilePdfOutlined, {}), onClick: exportChartPdf }) }),
|
|
13205
|
+
/* @__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
13206
|
] }),
|
|
12682
13207
|
/* @__PURE__ */ jsx(
|
|
12683
13208
|
AnalysisChart,
|
|
@@ -12708,11 +13233,11 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
12708
13233
|
items: [
|
|
12709
13234
|
{
|
|
12710
13235
|
key: "configure-chart",
|
|
12711
|
-
label:
|
|
13236
|
+
label: _32("Customize chart"),
|
|
12712
13237
|
children: /* @__PURE__ */ jsxs("div", { style: { display: "grid", gap: 16 }, children: [
|
|
12713
13238
|
/* @__PURE__ */ jsxs("div", { style: { display: "flex", gap: 16, flexWrap: "wrap" }, children: [
|
|
12714
13239
|
/* @__PURE__ */ jsxs("div", { style: { minWidth: 220, flex: 1 }, children: [
|
|
12715
|
-
/* @__PURE__ */ jsx("div", { style: { fontSize: 12, color: token.colorTextSecondary, marginBottom: 4 }, children:
|
|
13240
|
+
/* @__PURE__ */ jsx("div", { style: { fontSize: 12, color: token.colorTextSecondary, marginBottom: 4 }, children: _32("Category 1") }),
|
|
12716
13241
|
/* @__PURE__ */ jsx(
|
|
12717
13242
|
Select,
|
|
12718
13243
|
{
|
|
@@ -12723,12 +13248,12 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
12723
13248
|
},
|
|
12724
13249
|
style: { width: "100%" },
|
|
12725
13250
|
options: categoricalFields.map((field) => ({ label: field.label, value: field.key })),
|
|
12726
|
-
placeholder:
|
|
13251
|
+
placeholder: _32("Select category")
|
|
12727
13252
|
}
|
|
12728
13253
|
)
|
|
12729
13254
|
] }),
|
|
12730
13255
|
/* @__PURE__ */ jsxs("div", { style: { minWidth: 220, flex: 1 }, children: [
|
|
12731
|
-
/* @__PURE__ */ jsx("div", { style: { fontSize: 12, color: token.colorTextSecondary, marginBottom: 4 }, children:
|
|
13256
|
+
/* @__PURE__ */ jsx("div", { style: { fontSize: 12, color: token.colorTextSecondary, marginBottom: 4 }, children: _32("Category 2") }),
|
|
12732
13257
|
/* @__PURE__ */ jsx(
|
|
12733
13258
|
Select,
|
|
12734
13259
|
{
|
|
@@ -12739,14 +13264,14 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
12739
13264
|
},
|
|
12740
13265
|
style: { width: "100%" },
|
|
12741
13266
|
options: [
|
|
12742
|
-
{ label:
|
|
13267
|
+
{ label: _32("None"), value: "__none__" },
|
|
12743
13268
|
...categoricalFields.filter((field) => field.key !== categoryField1).map((field) => ({ label: field.label, value: field.key }))
|
|
12744
13269
|
]
|
|
12745
13270
|
}
|
|
12746
13271
|
)
|
|
12747
13272
|
] }),
|
|
12748
13273
|
/* @__PURE__ */ jsxs("div", { style: { minWidth: 160 }, children: [
|
|
12749
|
-
/* @__PURE__ */ jsx("div", { style: { fontSize: 12, color: token.colorTextSecondary, marginBottom: 4 }, children:
|
|
13274
|
+
/* @__PURE__ */ jsx("div", { style: { fontSize: 12, color: token.colorTextSecondary, marginBottom: 4 }, children: _32("Chart Type") }),
|
|
12750
13275
|
/* @__PURE__ */ jsx(
|
|
12751
13276
|
Select,
|
|
12752
13277
|
{
|
|
@@ -12757,30 +13282,30 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
12757
13282
|
},
|
|
12758
13283
|
style: { width: "100%" },
|
|
12759
13284
|
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:
|
|
13285
|
+
{ label: _32("Area"), value: "area" },
|
|
13286
|
+
{ label: _32("Horizontal Area"), value: "area-horizontal" },
|
|
13287
|
+
{ label: _32("Bars"), value: "bar" },
|
|
13288
|
+
{ label: _32("Stacked Bars"), value: "stacked" },
|
|
13289
|
+
{ label: _32("Horizontal Bars"), value: "bar-horizontal" },
|
|
13290
|
+
{ label: _32("Horizontal Stacked"), value: "stacked-horizontal" },
|
|
13291
|
+
{ label: _32("Lines"), value: "line" },
|
|
13292
|
+
{ label: _32("Pie"), value: "pie" },
|
|
13293
|
+
{ label: _32("Donut"), value: "donut" },
|
|
13294
|
+
{ label: _32("Scatter"), value: "scatter" },
|
|
13295
|
+
{ label: _32("Bubble"), value: "bubble" },
|
|
13296
|
+
{ label: _32("Histogram"), value: "histogram" },
|
|
13297
|
+
{ label: _32("Box Plot"), value: "box" },
|
|
13298
|
+
{ label: _32("Waterfall"), value: "waterfall" },
|
|
13299
|
+
{ label: _32("Heatmap"), value: "heatmap" },
|
|
13300
|
+
{ label: _32("Crosstab"), value: "crosstab" },
|
|
13301
|
+
{ label: _32("Radar"), value: "radar" },
|
|
13302
|
+
{ label: _32("Combo (Bar + Line)"), value: "combo" }
|
|
12778
13303
|
]
|
|
12779
13304
|
}
|
|
12780
13305
|
)
|
|
12781
13306
|
] }),
|
|
12782
13307
|
/* @__PURE__ */ jsxs("div", { style: { minWidth: 200 }, children: [
|
|
12783
|
-
/* @__PURE__ */ jsx("div", { style: { fontSize: 12, color: token.colorTextSecondary, marginBottom: 4 }, children:
|
|
13308
|
+
/* @__PURE__ */ jsx("div", { style: { fontSize: 12, color: token.colorTextSecondary, marginBottom: 4 }, children: _32("Summary") }),
|
|
12784
13309
|
/* @__PURE__ */ jsx(
|
|
12785
13310
|
Select,
|
|
12786
13311
|
{
|
|
@@ -12791,18 +13316,18 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
12791
13316
|
},
|
|
12792
13317
|
style: { width: "100%" },
|
|
12793
13318
|
options: [
|
|
12794
|
-
{ label:
|
|
12795
|
-
{ label:
|
|
12796
|
-
{ label:
|
|
12797
|
-
{ label:
|
|
12798
|
-
{ label:
|
|
12799
|
-
{ label:
|
|
13319
|
+
{ label: _32("Sum"), value: "sum" },
|
|
13320
|
+
{ label: _32("Average"), value: "avg" },
|
|
13321
|
+
{ label: _32("Count"), value: "count" },
|
|
13322
|
+
{ label: _32("Max"), value: "max" },
|
|
13323
|
+
{ label: _32("Min"), value: "min" },
|
|
13324
|
+
{ label: _32("Std Dev"), value: "stddev" }
|
|
12800
13325
|
]
|
|
12801
13326
|
}
|
|
12802
13327
|
)
|
|
12803
13328
|
] }),
|
|
12804
13329
|
/* @__PURE__ */ jsxs("div", { style: { minWidth: 180 }, children: [
|
|
12805
|
-
/* @__PURE__ */ jsx("div", { style: { fontSize: 12, color: token.colorTextSecondary, marginBottom: 4 }, children:
|
|
13330
|
+
/* @__PURE__ */ jsx("div", { style: { fontSize: 12, color: token.colorTextSecondary, marginBottom: 4 }, children: _32("Ranking Filter") }),
|
|
12806
13331
|
/* @__PURE__ */ jsx(
|
|
12807
13332
|
Select,
|
|
12808
13333
|
{
|
|
@@ -12813,15 +13338,15 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
12813
13338
|
},
|
|
12814
13339
|
style: { width: "100%" },
|
|
12815
13340
|
options: [
|
|
12816
|
-
{ label:
|
|
12817
|
-
{ label:
|
|
12818
|
-
{ label:
|
|
13341
|
+
{ label: _32("None"), value: "none" },
|
|
13342
|
+
{ label: _32("Top N"), value: "top" },
|
|
13343
|
+
{ label: _32("Bottom N"), value: "bottom" }
|
|
12819
13344
|
]
|
|
12820
13345
|
}
|
|
12821
13346
|
)
|
|
12822
13347
|
] }),
|
|
12823
13348
|
/* @__PURE__ */ jsxs("div", { style: { minWidth: 220 }, children: [
|
|
12824
|
-
/* @__PURE__ */ jsx("div", { style: { fontSize: 12, color: token.colorTextSecondary, marginBottom: 4 }, children:
|
|
13349
|
+
/* @__PURE__ */ jsx("div", { style: { fontSize: 12, color: token.colorTextSecondary, marginBottom: 4 }, children: _32("Ranking Column") }),
|
|
12825
13350
|
/* @__PURE__ */ jsx(
|
|
12826
13351
|
Select,
|
|
12827
13352
|
{
|
|
@@ -12832,13 +13357,13 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
12832
13357
|
},
|
|
12833
13358
|
style: { width: "100%" },
|
|
12834
13359
|
options: numericFields.map((field) => ({ label: field.label, value: field.key })),
|
|
12835
|
-
placeholder:
|
|
13360
|
+
placeholder: _32("Select numeric column"),
|
|
12836
13361
|
disabled: rankingMode === "none" || numericFields.length === 0
|
|
12837
13362
|
}
|
|
12838
13363
|
)
|
|
12839
13364
|
] }),
|
|
12840
13365
|
/* @__PURE__ */ jsxs("div", { style: { minWidth: 120 }, children: [
|
|
12841
|
-
/* @__PURE__ */ jsx("div", { style: { fontSize: 12, color: token.colorTextSecondary, marginBottom: 4 }, children:
|
|
13366
|
+
/* @__PURE__ */ jsx("div", { style: { fontSize: 12, color: token.colorTextSecondary, marginBottom: 4 }, children: _32("N") }),
|
|
12842
13367
|
/* @__PURE__ */ jsx(
|
|
12843
13368
|
InputNumber,
|
|
12844
13369
|
{
|
|
@@ -12857,8 +13382,8 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
12857
13382
|
] }),
|
|
12858
13383
|
/* @__PURE__ */ jsxs("div", { children: [
|
|
12859
13384
|
/* @__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:
|
|
13385
|
+
/* @__PURE__ */ jsx("div", { style: { fontSize: 12, color: token.colorTextSecondary }, children: _32("Series") }),
|
|
13386
|
+
/* @__PURE__ */ jsx(Tooltip, { title: _32("Unselect All"), children: /* @__PURE__ */ jsx(
|
|
12862
13387
|
Button,
|
|
12863
13388
|
{
|
|
12864
13389
|
size: "small",
|
|
@@ -12878,7 +13403,7 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
12878
13403
|
markAnalyzePrefsTouched();
|
|
12879
13404
|
setSelectedSeriesKeys(values);
|
|
12880
13405
|
},
|
|
12881
|
-
options: numericFields.length > 0 ? numericFields.map((field) => ({ label: field.label, value: field.key })) : [{ label:
|
|
13406
|
+
options: numericFields.length > 0 ? numericFields.map((field) => ({ label: field.label, value: field.key })) : [{ label: _32("Count"), value: "__count__" }]
|
|
12882
13407
|
}
|
|
12883
13408
|
)
|
|
12884
13409
|
] })
|
|
@@ -12903,11 +13428,11 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
12903
13428
|
styles: { body: { display: "grid", gap: 16, position: "relative", paddingTop: 48 } },
|
|
12904
13429
|
children: [
|
|
12905
13430
|
/* @__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:
|
|
13431
|
+
/* @__PURE__ */ jsx(Tooltip, { title: _32("Analysis"), children: /* @__PURE__ */ jsx(Button, { size: "small", icon: /* @__PURE__ */ jsx(BarChartOutlined, {}), onClick: () => setIsStatsFlipped(false) }) }),
|
|
13432
|
+
/* @__PURE__ */ jsx(Tooltip, { title: _32("Export stats PDF"), children: /* @__PURE__ */ jsx(Button, { size: "small", icon: /* @__PURE__ */ jsx(FilePdfOutlined, {}), onClick: exportStatsPdf }) })
|
|
12908
13433
|
] }),
|
|
12909
13434
|
/* @__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:
|
|
13435
|
+
statsSummary.numericStats.length > 0 && /* @__PURE__ */ jsx(Card, { size: "small", title: /* @__PURE__ */ jsx("span", { style: statsTitleStyle, children: _32("Numeric columns") }), children: /* @__PURE__ */ jsxs(
|
|
12911
13436
|
Table,
|
|
12912
13437
|
{
|
|
12913
13438
|
dataSource: statsSummary.numericStats,
|
|
@@ -12918,18 +13443,18 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
12918
13443
|
/* @__PURE__ */ jsx(
|
|
12919
13444
|
Table.Column,
|
|
12920
13445
|
{
|
|
12921
|
-
title:
|
|
13446
|
+
title: _32("Field"),
|
|
12922
13447
|
dataIndex: "label",
|
|
12923
13448
|
render: (label) => /* @__PURE__ */ jsx("span", { style: statsLabelStyle, children: label }),
|
|
12924
13449
|
onHeaderCell: () => ({ style: statsHeaderStyle })
|
|
12925
13450
|
},
|
|
12926
13451
|
"label"
|
|
12927
13452
|
),
|
|
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:
|
|
13453
|
+
/* @__PURE__ */ jsx(Table.Column, { title: _32("Sum"), align: "right", render: (_unused, row) => renderStatBar(row.sum, statsNumericMaxes.sum, formatNumberValue), onHeaderCell: () => ({ style: statsHeaderStyle }) }, "sum"),
|
|
13454
|
+
/* @__PURE__ */ jsx(Table.Column, { title: _32("Average"), align: "right", render: (_unused, row) => renderStatBar(row.avg, statsNumericMaxes.avg, formatNumberValue), onHeaderCell: () => ({ style: statsHeaderStyle }) }, "avg"),
|
|
13455
|
+
/* @__PURE__ */ jsx(Table.Column, { title: _32("Min"), align: "right", render: (_unused, row) => renderStatBar(row.min, statsNumericMaxes.min, formatNumberValue), onHeaderCell: () => ({ style: statsHeaderStyle }) }, "min"),
|
|
13456
|
+
/* @__PURE__ */ jsx(Table.Column, { title: _32("Max"), align: "right", render: (_unused, row) => renderStatBar(row.max, statsNumericMaxes.max, formatNumberValue), onHeaderCell: () => ({ style: statsHeaderStyle }) }, "max"),
|
|
13457
|
+
/* @__PURE__ */ jsx(Table.Column, { title: _32("Std Dev"), align: "right", render: (_unused, row) => renderStatBar(row.stddev, statsNumericMaxes.stddev, formatNumberValue), onHeaderCell: () => ({ style: statsHeaderStyle }) }, "stddev")
|
|
12933
13458
|
]
|
|
12934
13459
|
}
|
|
12935
13460
|
) }),
|
|
@@ -12941,7 +13466,7 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
12941
13466
|
items: [
|
|
12942
13467
|
{
|
|
12943
13468
|
key: "categorical-columns",
|
|
12944
|
-
label: /* @__PURE__ */ jsx("span", { style: statsTitleStyle, children:
|
|
13469
|
+
label: /* @__PURE__ */ jsx("span", { style: statsTitleStyle, children: _32("Categorical columns (distinct < 20)") }),
|
|
12945
13470
|
children: statsSummary.categoricalStats.map((field) => /* @__PURE__ */ jsxs("div", { style: { marginBottom: 12 }, children: [
|
|
12946
13471
|
/* @__PURE__ */ jsx("div", { style: { fontWeight: 600, marginBottom: 4 }, children: /* @__PURE__ */ jsx("span", { style: statsLabelStyle, children: field.label }) }),
|
|
12947
13472
|
/* @__PURE__ */ jsxs(
|
|
@@ -12952,11 +13477,11 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
12952
13477
|
pagination: false,
|
|
12953
13478
|
rowKey: (row) => row.value,
|
|
12954
13479
|
children: [
|
|
12955
|
-
/* @__PURE__ */ jsx(Table.Column, { title:
|
|
13480
|
+
/* @__PURE__ */ jsx(Table.Column, { title: _32("Value"), dataIndex: "value", onHeaderCell: () => ({ style: statsHeaderStyle }) }, "value"),
|
|
12956
13481
|
/* @__PURE__ */ jsx(
|
|
12957
13482
|
Table.Column,
|
|
12958
13483
|
{
|
|
12959
|
-
title:
|
|
13484
|
+
title: _32("Count"),
|
|
12960
13485
|
dataIndex: "count",
|
|
12961
13486
|
align: "right",
|
|
12962
13487
|
onHeaderCell: () => ({ style: statsHeaderStyle }),
|
|
@@ -13088,7 +13613,7 @@ var RelatedObjectSingleSelect = ({ rel, record, allModels, required }) => {
|
|
|
13088
13613
|
}
|
|
13089
13614
|
);
|
|
13090
13615
|
};
|
|
13091
|
-
var
|
|
13616
|
+
var _33 = window._ || ((text) => text);
|
|
13092
13617
|
function useMillerColumnItems({
|
|
13093
13618
|
parentId,
|
|
13094
13619
|
rel,
|
|
@@ -13206,7 +13731,7 @@ function useMillerColumnItems({
|
|
|
13206
13731
|
} catch (err) {
|
|
13207
13732
|
if (err instanceof DOMException && err.name === "AbortError") return;
|
|
13208
13733
|
if (isMounted) {
|
|
13209
|
-
setError(err instanceof Error ? err.message :
|
|
13734
|
+
setError(err instanceof Error ? err.message : _33("Failed to load items"));
|
|
13210
13735
|
}
|
|
13211
13736
|
} finally {
|
|
13212
13737
|
if (isMounted) setLoading(false);
|
|
@@ -13258,7 +13783,7 @@ var MillerColumn = ({
|
|
|
13258
13783
|
Empty,
|
|
13259
13784
|
{
|
|
13260
13785
|
image: Empty.PRESENTED_IMAGE_SIMPLE,
|
|
13261
|
-
description:
|
|
13786
|
+
description: _33("No items"),
|
|
13262
13787
|
style: { margin: "32px 0" }
|
|
13263
13788
|
}
|
|
13264
13789
|
),
|
|
@@ -13335,12 +13860,12 @@ var DetailPaneContent = ({ node, allModels }) => {
|
|
|
13335
13860
|
const model = allModels?.find((m) => m.name === node.resource);
|
|
13336
13861
|
const showHref = getShowHref(node.resource, node.id, allModels);
|
|
13337
13862
|
if (!model) {
|
|
13338
|
-
return /* @__PURE__ */ jsx(Empty, { description: `${
|
|
13863
|
+
return /* @__PURE__ */ jsx(Empty, { description: `${_33("No schema for")} ${node.resource}`, style: { marginTop: 32 } });
|
|
13339
13864
|
}
|
|
13340
13865
|
return /* @__PURE__ */ jsxs("div", { children: [
|
|
13341
13866
|
/* @__PURE__ */ jsxs("div", { style: { display: "flex", alignItems: "center", gap: 8, marginBottom: 12 }, children: [
|
|
13342
13867
|
/* @__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:
|
|
13868
|
+
showHref && /* @__PURE__ */ jsx(Tooltip, { title: _33("Open in new tab"), children: /* @__PURE__ */ jsx(
|
|
13344
13869
|
Button,
|
|
13345
13870
|
{
|
|
13346
13871
|
size: "small",
|
|
@@ -13446,7 +13971,7 @@ var MillerBrowserLayout = ({
|
|
|
13446
13971
|
}
|
|
13447
13972
|
};
|
|
13448
13973
|
if (!rootId) {
|
|
13449
|
-
return /* @__PURE__ */ jsx(Empty, { description:
|
|
13974
|
+
return /* @__PURE__ */ jsx(Empty, { description: _33("No record selected") });
|
|
13450
13975
|
}
|
|
13451
13976
|
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
13977
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
@@ -13509,7 +14034,7 @@ var MillerBrowserLayout = ({
|
|
|
13509
14034
|
showDetails && /* @__PURE__ */ jsx(
|
|
13510
14035
|
Drawer,
|
|
13511
14036
|
{
|
|
13512
|
-
title: detailNode?.label ??
|
|
14037
|
+
title: detailNode?.label ?? _33("Details"),
|
|
13513
14038
|
placement: "right",
|
|
13514
14039
|
open: drawerOpen && !isDesktop,
|
|
13515
14040
|
onClose: () => setDrawerOpen(false),
|
|
@@ -13619,6 +14144,24 @@ var renderRelationBlock = ({
|
|
|
13619
14144
|
/* @__PURE__ */ jsx("div", { style: resolvedValueStyle, children: /* @__PURE__ */ jsx(RelatedObjectsInlineValues, { rel, record, viewType: "csv", allModels }) })
|
|
13620
14145
|
] }) });
|
|
13621
14146
|
}
|
|
14147
|
+
if (viewType === "editable-csv" || viewType === "read-and-edit-csv") {
|
|
14148
|
+
return /* @__PURE__ */ jsx("div", { style: { marginBottom: 0 }, children: /* @__PURE__ */ jsxs("div", { style: resolvedLayoutStyle, children: [
|
|
14149
|
+
showLabel && /* @__PURE__ */ jsx("div", { style: resolvedLabelStyle, children: relationLabel }),
|
|
14150
|
+
/* @__PURE__ */ jsx("div", { style: resolvedValueStyle, children: /* @__PURE__ */ jsx(RelatedObjectsEditableCsv, { rel, record, allModels }) })
|
|
14151
|
+
] }) });
|
|
14152
|
+
}
|
|
14153
|
+
if (viewType === "read-and-edit-list") {
|
|
14154
|
+
if (rel.otherResource && rel.otherKey) {
|
|
14155
|
+
return /* @__PURE__ */ jsxs("div", { style: { marginBottom: 16, boxShadow: `0 8px 20px -16px ${relationTone.shadow}` }, children: [
|
|
14156
|
+
/* @__PURE__ */ jsx("div", { style: { ...resolvedLabelStyle, marginBottom: 4 }, children: showLabel ? relationLabel : null }),
|
|
14157
|
+
/* @__PURE__ */ jsx(RelatedObjectsEditableList, { rel, record, allModels })
|
|
14158
|
+
] });
|
|
14159
|
+
}
|
|
14160
|
+
return /* @__PURE__ */ jsx("div", { style: { marginBottom: 0 }, children: /* @__PURE__ */ jsxs("div", { style: resolvedLayoutStyle, children: [
|
|
14161
|
+
showLabel && /* @__PURE__ */ jsx("div", { style: resolvedLabelStyle, children: relationLabel }),
|
|
14162
|
+
/* @__PURE__ */ jsx("div", { style: resolvedValueStyle, children: /* @__PURE__ */ jsx(RelatedObjectsInlineValues, { rel, record, viewType: "list", allModels }) })
|
|
14163
|
+
] }) });
|
|
14164
|
+
}
|
|
13622
14165
|
if (isInlineListView && !polymorphicInfo) {
|
|
13623
14166
|
return /* @__PURE__ */ jsx("div", { style: { marginBottom: 0 }, children: /* @__PURE__ */ jsxs("div", { style: resolvedLayoutStyle, children: [
|
|
13624
14167
|
showLabel && /* @__PURE__ */ jsx("div", { style: resolvedLabelStyle, children: relationLabel }),
|
|
@@ -13812,7 +14355,7 @@ var renderRelationBlock = ({
|
|
|
13812
14355
|
content
|
|
13813
14356
|
] }, rel.resource);
|
|
13814
14357
|
};
|
|
13815
|
-
var
|
|
14358
|
+
var _34 = window._ || ((text) => text);
|
|
13816
14359
|
var { Title: Title7 } = Typography;
|
|
13817
14360
|
var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbedded = false, showActions = true, showCreate = true, layoutPreferenceType, listViewType, rowSelection, extraHeaderButtons, bulkActions, preferencesResourceOverride, defaultListVisible }) => {
|
|
13818
14361
|
const model = useRoleFilteredModel(modelProp);
|
|
@@ -13882,7 +14425,7 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
13882
14425
|
const [galleryPage, setGalleryPage] = useState(1);
|
|
13883
14426
|
const [calendarMode, setCalendarMode] = useState("month");
|
|
13884
14427
|
const [calendarDateField, setCalendarDateField] = useState(() => calendarDateFieldOptions[0]?.key || "");
|
|
13885
|
-
const [calendarAnchorDate, setCalendarAnchorDate] = useState(() =>
|
|
14428
|
+
const [calendarAnchorDate, setCalendarAnchorDate] = useState(() => dayjs8().startOf("month"));
|
|
13886
14429
|
const [isAnalyzeVertical, setIsAnalyzeVertical] = useState(false);
|
|
13887
14430
|
const [isAnalyzeFirst, setIsAnalyzeFirst] = useState(false);
|
|
13888
14431
|
const [filterRules, setFilterRules] = useState([]);
|
|
@@ -13892,7 +14435,9 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
13892
14435
|
const [selectedColumnKeys, setSelectedColumnKeys] = useState(null);
|
|
13893
14436
|
const [columnOrder, setColumnOrder] = useState(null);
|
|
13894
14437
|
const [columnFiltersSelected, setColumnFiltersSelected] = useState({});
|
|
13895
|
-
const [columnSort, setColumnSort] = useState(
|
|
14438
|
+
const [columnSort, setColumnSort] = useState(
|
|
14439
|
+
model.defaultSort ? [{ fieldKey: model.defaultSort.field, order: model.defaultSort.order === "desc" ? "descend" : "ascend" }] : []
|
|
14440
|
+
);
|
|
13896
14441
|
const [totalsSummaryFunctions, setTotalsSummaryFunctions] = useState({});
|
|
13897
14442
|
const [currentViewName, setCurrentViewName] = useState(getDefaultViewName());
|
|
13898
14443
|
const [selectedViewNames, setSelectedViewNames] = useState([]);
|
|
@@ -13947,6 +14492,7 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
13947
14492
|
const layoutPrefsLoadedRef = useRef(false);
|
|
13948
14493
|
const layoutPrefsResourceRef = useRef(null);
|
|
13949
14494
|
const sortIntentRef = useRef(null);
|
|
14495
|
+
const prevViewNameForResetRef = useRef(null);
|
|
13950
14496
|
const [bulkSelectedRowKeys, setBulkSelectedRowKeys] = useState([]);
|
|
13951
14497
|
const bulkSelectedRowsMapRef = useRef(/* @__PURE__ */ new Map());
|
|
13952
14498
|
const [selectModeAssociating, setSelectModeAssociating] = useState(false);
|
|
@@ -13975,12 +14521,12 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
13975
14521
|
});
|
|
13976
14522
|
}
|
|
13977
14523
|
}
|
|
13978
|
-
message.success(
|
|
14524
|
+
message.success(_34("Relations added."));
|
|
13979
14525
|
if (selectModeReturnTo && selectModeReturnTo.startsWith("/")) {
|
|
13980
14526
|
navigate(selectModeReturnTo);
|
|
13981
14527
|
}
|
|
13982
14528
|
} catch {
|
|
13983
|
-
message.error(
|
|
14529
|
+
message.error(_34("Failed to add relations."));
|
|
13984
14530
|
} finally {
|
|
13985
14531
|
setSelectModeAssociating(false);
|
|
13986
14532
|
}
|
|
@@ -14078,7 +14624,7 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
14078
14624
|
const direction = value?.direction || "next";
|
|
14079
14625
|
const unit = value?.unit || "weeks";
|
|
14080
14626
|
const isQuarter = unit === "quarters";
|
|
14081
|
-
const base =
|
|
14627
|
+
const base = dayjs8();
|
|
14082
14628
|
if (asRange || direction === "current") {
|
|
14083
14629
|
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
14630
|
if (isQuarter) {
|
|
@@ -14139,7 +14685,7 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
14139
14685
|
return true;
|
|
14140
14686
|
}
|
|
14141
14687
|
if (field.type === "date" || field.type === "datetime") {
|
|
14142
|
-
const recordDate =
|
|
14688
|
+
const recordDate = dayjs8(rawValue);
|
|
14143
14689
|
if (!recordDate.isValid()) return false;
|
|
14144
14690
|
const mode = rule.value?.mode || "absolute";
|
|
14145
14691
|
const mode2 = rule.value2?.mode || "absolute";
|
|
@@ -14147,7 +14693,7 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
14147
14693
|
if (val?.mode === "relative") {
|
|
14148
14694
|
return resolveRelativeDate(val, asRange);
|
|
14149
14695
|
}
|
|
14150
|
-
const date =
|
|
14696
|
+
const date = dayjs8(val?.date || val);
|
|
14151
14697
|
return asRange ? { start: date.startOf("day"), end: date.endOf("day") } : { date: date.startOf("day") };
|
|
14152
14698
|
};
|
|
14153
14699
|
switch (rule.operator) {
|
|
@@ -14158,13 +14704,13 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
14158
14704
|
}
|
|
14159
14705
|
case "after": {
|
|
14160
14706
|
const dateVal = mode === "relative" ? resolveRelativeDate(rule.value, false).date : getDateValue(rule.value, false).date;
|
|
14161
|
-
if (!dateVal || !
|
|
14162
|
-
return recordDate.valueOf() >
|
|
14707
|
+
if (!dateVal || !dayjs8(dateVal).isValid()) return false;
|
|
14708
|
+
return recordDate.valueOf() > dayjs8(dateVal).endOf("day").valueOf();
|
|
14163
14709
|
}
|
|
14164
14710
|
case "before": {
|
|
14165
14711
|
const dateVal = mode === "relative" ? resolveRelativeDate(rule.value, false).date : getDateValue(rule.value, false).date;
|
|
14166
|
-
if (!dateVal || !
|
|
14167
|
-
return recordDate.valueOf() <
|
|
14712
|
+
if (!dateVal || !dayjs8(dateVal).isValid()) return false;
|
|
14713
|
+
return recordDate.valueOf() < dayjs8(dateVal).startOf("day").valueOf();
|
|
14168
14714
|
}
|
|
14169
14715
|
case "between": {
|
|
14170
14716
|
const startRange = mode === "relative" ? resolveRelativeDate(rule.value, true) : getDateValue(rule.value, true);
|
|
@@ -14486,7 +15032,7 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
14486
15032
|
}, [numericFields, rankingFieldKey, rankingMode]);
|
|
14487
15033
|
const resetLayoutDefaults = useCallback(() => {
|
|
14488
15034
|
setListVisible(defaultListVisible ?? true);
|
|
14489
|
-
setAnalyzeOpen(
|
|
15035
|
+
setAnalyzeOpen(isEmbedded);
|
|
14490
15036
|
setIsAnalyzeVertical(false);
|
|
14491
15037
|
setIsAnalyzeFirst(false);
|
|
14492
15038
|
setFiltersCollapsed(isEmbedded);
|
|
@@ -14610,7 +15156,7 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
14610
15156
|
return;
|
|
14611
15157
|
}
|
|
14612
15158
|
if (availableViewNames.includes(newName)) {
|
|
14613
|
-
message.error(
|
|
15159
|
+
message.error(_34("View name already exists."));
|
|
14614
15160
|
return;
|
|
14615
15161
|
}
|
|
14616
15162
|
try {
|
|
@@ -14623,18 +15169,18 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
14623
15169
|
if (!response.ok) {
|
|
14624
15170
|
throw new Error(`Rename failed (${response.status})`);
|
|
14625
15171
|
}
|
|
14626
|
-
message.success(
|
|
15172
|
+
message.success(_34("View renamed."));
|
|
14627
15173
|
setRenameViewModalOpen(false);
|
|
14628
15174
|
await loadViewNames();
|
|
14629
15175
|
} catch (error) {
|
|
14630
|
-
message.error(error instanceof Error ? error.message :
|
|
15176
|
+
message.error(error instanceof Error ? error.message : _34("Failed to rename view."));
|
|
14631
15177
|
}
|
|
14632
15178
|
}, [apiUrl, availableViewNames, currentViewName, model.name, model.resource, renameViewName, allModels, loadViewNames]);
|
|
14633
15179
|
const confirmDeleteView = useCallback(() => {
|
|
14634
15180
|
Modal.confirm({
|
|
14635
|
-
title:
|
|
15181
|
+
title: _34(_34("Delete view")),
|
|
14636
15182
|
content: `Delete "${currentViewName}" and all its saved preferences?`,
|
|
14637
|
-
okText:
|
|
15183
|
+
okText: _34("Delete"),
|
|
14638
15184
|
okButtonProps: { danger: true },
|
|
14639
15185
|
onOk: async () => {
|
|
14640
15186
|
try {
|
|
@@ -14647,10 +15193,10 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
14647
15193
|
if (!response.ok) {
|
|
14648
15194
|
throw new Error(`Delete failed (${response.status})`);
|
|
14649
15195
|
}
|
|
14650
|
-
message.success(
|
|
15196
|
+
message.success(_34("View deleted."));
|
|
14651
15197
|
await loadViewNames();
|
|
14652
15198
|
} catch (error) {
|
|
14653
|
-
message.error(error instanceof Error ? error.message :
|
|
15199
|
+
message.error(error instanceof Error ? error.message : _34("Failed to delete view."));
|
|
14654
15200
|
}
|
|
14655
15201
|
}
|
|
14656
15202
|
});
|
|
@@ -14692,9 +15238,9 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
14692
15238
|
if (failed) {
|
|
14693
15239
|
throw new Error(`Save failed (${failed.status})`);
|
|
14694
15240
|
}
|
|
14695
|
-
message.success(
|
|
15241
|
+
message.success(_34("Layout preferences saved."));
|
|
14696
15242
|
} catch (error) {
|
|
14697
|
-
message.error(error instanceof Error ? error.message :
|
|
15243
|
+
message.error(error instanceof Error ? error.message : _34("Failed to save layout preferences."));
|
|
14698
15244
|
} finally {
|
|
14699
15245
|
setIsSavingLayoutPrefs(false);
|
|
14700
15246
|
}
|
|
@@ -14723,9 +15269,9 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
14723
15269
|
if (!response.ok) {
|
|
14724
15270
|
throw new Error(`Save failed (${response.status})`);
|
|
14725
15271
|
}
|
|
14726
|
-
message.success(
|
|
15272
|
+
message.success(_34("Analyze preferences saved."));
|
|
14727
15273
|
} catch (error) {
|
|
14728
|
-
message.error(error instanceof Error ? error.message :
|
|
15274
|
+
message.error(error instanceof Error ? error.message : _34("Failed to save analyze preferences."));
|
|
14729
15275
|
} finally {
|
|
14730
15276
|
setIsSavingAnalyzePrefs(false);
|
|
14731
15277
|
}
|
|
@@ -14735,11 +15281,11 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
14735
15281
|
const viewName = normalizeViewName(saveViewName || currentViewName);
|
|
14736
15282
|
const viewExists = availableViewNames.includes(viewName);
|
|
14737
15283
|
if (saveViewAsNew && viewExists) {
|
|
14738
|
-
message.error(
|
|
15284
|
+
message.error(_34("View name already exists. Choose a new name."));
|
|
14739
15285
|
return;
|
|
14740
15286
|
}
|
|
14741
15287
|
if (!saveViewAsNew && viewName !== currentViewName && viewExists) {
|
|
14742
|
-
message.error(
|
|
15288
|
+
message.error(_34('Choose a new name or enable "Save as new view".'));
|
|
14743
15289
|
return;
|
|
14744
15290
|
}
|
|
14745
15291
|
setSaveViewModalOpen(false);
|
|
@@ -14762,6 +15308,8 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
14762
15308
|
}, [loadViewNames]);
|
|
14763
15309
|
useEffect(() => {
|
|
14764
15310
|
if (!viewNamesLoaded) return;
|
|
15311
|
+
const viewChanged = prevViewNameForResetRef.current !== null && prevViewNameForResetRef.current !== currentViewName;
|
|
15312
|
+
prevViewNameForResetRef.current = currentViewName;
|
|
14765
15313
|
analyzePrefsTouchedRef.current = false;
|
|
14766
15314
|
layoutPrefsTouchedRef.current = false;
|
|
14767
15315
|
analyzePrefsLoadedRef.current = false;
|
|
@@ -14769,8 +15317,11 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
14769
15317
|
setColumnsSelectorOpen(false);
|
|
14770
15318
|
setSaveViewName(currentViewName);
|
|
14771
15319
|
setSaveViewAsNew(false);
|
|
14772
|
-
|
|
14773
|
-
|
|
15320
|
+
if (viewChanged) {
|
|
15321
|
+
analyzeTouchedRef.current = false;
|
|
15322
|
+
resetLayoutDefaults();
|
|
15323
|
+
resetAnalyzeDefaults();
|
|
15324
|
+
}
|
|
14774
15325
|
}, [currentViewName, resetAnalyzeDefaults, resetLayoutDefaults, viewNamesLoaded]);
|
|
14775
15326
|
useEffect(() => {
|
|
14776
15327
|
const resourceKey = prefsKey;
|
|
@@ -14937,7 +15488,7 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
14937
15488
|
}
|
|
14938
15489
|
setAllRowsData(allRows2);
|
|
14939
15490
|
} catch (error) {
|
|
14940
|
-
setAllRowsError(error instanceof Error ? error.message :
|
|
15491
|
+
setAllRowsError(error instanceof Error ? error.message : _34("Failed to fetch all rows"));
|
|
14941
15492
|
} finally {
|
|
14942
15493
|
setIsAllRowsLoading(false);
|
|
14943
15494
|
setAllRowsLoaded(true);
|
|
@@ -14976,7 +15527,7 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
14976
15527
|
if (forRange) return { start: resolved.start?.toISOString(), end: resolved.end?.toISOString() };
|
|
14977
15528
|
return { date: resolved.date?.toISOString() };
|
|
14978
15529
|
}
|
|
14979
|
-
const date =
|
|
15530
|
+
const date = dayjs8(val?.date || val);
|
|
14980
15531
|
if (!date.isValid()) return {};
|
|
14981
15532
|
if (forRange) return { start: date.startOf("day").toISOString(), end: date.endOf("day").toISOString() };
|
|
14982
15533
|
return { date: date.startOf("day").toISOString() };
|
|
@@ -15032,7 +15583,7 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
15032
15583
|
setFilters(combined, "replace");
|
|
15033
15584
|
}, [filterRules, hasActiveFilterRules, isClientFiltering, model.fields, setFilters, tableFilters]);
|
|
15034
15585
|
const formatCategoryValue = useCallback((field, record) => {
|
|
15035
|
-
if (!field) return
|
|
15586
|
+
if (!field) return _34("All");
|
|
15036
15587
|
const raw = record?.[field.key];
|
|
15037
15588
|
if (raw === void 0 || raw === null) return "-";
|
|
15038
15589
|
if (field.key === "eid" && record?._label) return record._label;
|
|
@@ -15043,7 +15594,7 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
15043
15594
|
if (field.options) {
|
|
15044
15595
|
return field.options.find((option) => option.value === raw)?.label || String(raw);
|
|
15045
15596
|
}
|
|
15046
|
-
if (field.type === "boolean") return raw ?
|
|
15597
|
+
if (field.type === "boolean") return raw ? _34("Yes") : _34("No");
|
|
15047
15598
|
if (field.type === "date") return formatDateValue(raw);
|
|
15048
15599
|
if (field.type === "datetime") return formatDateTimeValue(raw) ?? String(raw);
|
|
15049
15600
|
if (field.type === "time") return formatTimeValue(raw);
|
|
@@ -15128,7 +15679,7 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
15128
15679
|
const seriesLabels = numericFields.length > 0 ? numericFields.reduce((acc, field) => {
|
|
15129
15680
|
acc[field.key] = field.label;
|
|
15130
15681
|
return acc;
|
|
15131
|
-
}, { "__count__":
|
|
15682
|
+
}, { "__count__": _34("Count") }) : { "__count__": _34("Count") };
|
|
15132
15683
|
const baseGroups = Array.from(groupMap.values());
|
|
15133
15684
|
let groups = baseGroups;
|
|
15134
15685
|
if (rankingMode !== "none" && rankingFieldKey) {
|
|
@@ -15185,7 +15736,7 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
15185
15736
|
} else if (field.options) {
|
|
15186
15737
|
label = field.options.find((o) => o.value === raw)?.label || String(raw);
|
|
15187
15738
|
} else if (field.type === "boolean") {
|
|
15188
|
-
label = raw ?
|
|
15739
|
+
label = raw ? _34("Yes") : _34("No");
|
|
15189
15740
|
} else if (field.type === "date") {
|
|
15190
15741
|
label = formatDateValue(raw);
|
|
15191
15742
|
} else if (field.type === "datetime") {
|
|
@@ -15247,13 +15798,13 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
15247
15798
|
const getSummaryFunctionDisplayText = useCallback((fn) => {
|
|
15248
15799
|
if (!fn) return "";
|
|
15249
15800
|
const labels = {
|
|
15250
|
-
sum:
|
|
15251
|
-
avg:
|
|
15252
|
-
count:
|
|
15253
|
-
max:
|
|
15254
|
-
min:
|
|
15255
|
-
stddev:
|
|
15256
|
-
distinct:
|
|
15801
|
+
sum: _34("Sum"),
|
|
15802
|
+
avg: _34("Average"),
|
|
15803
|
+
count: _34("Count"),
|
|
15804
|
+
max: _34("Max"),
|
|
15805
|
+
min: _34("Min"),
|
|
15806
|
+
stddev: _34("Std Dev"),
|
|
15807
|
+
distinct: _34("Distinct")
|
|
15257
15808
|
};
|
|
15258
15809
|
return labels[fn] || fn;
|
|
15259
15810
|
}, []);
|
|
@@ -15314,12 +15865,12 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
15314
15865
|
`td-num-${item.key}`
|
|
15315
15866
|
)) })
|
|
15316
15867
|
] }) }),
|
|
15317
|
-
/* @__PURE__ */ jsx(Tooltip, { title: isTdFlipped ?
|
|
15868
|
+
/* @__PURE__ */ jsx(Tooltip, { title: isTdFlipped ? _34("Show totals") : _34("Show details"), children: /* @__PURE__ */ jsx(
|
|
15318
15869
|
Button,
|
|
15319
15870
|
{
|
|
15320
15871
|
size: "small",
|
|
15321
15872
|
icon: /* @__PURE__ */ jsx(SwapOutlined, { style: { transform: "rotate(90deg)" } }),
|
|
15322
|
-
"aria-label": isTdFlipped ?
|
|
15873
|
+
"aria-label": isTdFlipped ? _34("Show totals") : _34("Show details"),
|
|
15323
15874
|
onClick: () => setIsTdFlipped((prev) => !prev),
|
|
15324
15875
|
style: {
|
|
15325
15876
|
flexShrink: 0,
|
|
@@ -15394,7 +15945,7 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
15394
15945
|
if (field.options) {
|
|
15395
15946
|
return field.options.find((option) => option.value === raw)?.label || String(raw);
|
|
15396
15947
|
}
|
|
15397
|
-
if (field.type === "boolean") return raw ?
|
|
15948
|
+
if (field.type === "boolean") return raw ? _34("Yes") : _34("No");
|
|
15398
15949
|
if (field.type === "date") return formatDateValue(raw);
|
|
15399
15950
|
if (field.type === "datetime") return formatDateTimeValue(raw) ?? String(raw);
|
|
15400
15951
|
if (field.type === "time") return formatTimeValue(raw);
|
|
@@ -15486,7 +16037,8 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
15486
16037
|
const exportStatsPdf = () => {
|
|
15487
16038
|
openPdfWindow(`${model.name}-stats`, buildStatsHtml(statsSummary));
|
|
15488
16039
|
};
|
|
15489
|
-
const getRowKey = (record) => {
|
|
16040
|
+
const getRowKey = (record, index) => {
|
|
16041
|
+
if (model.isNamedQuery && index !== void 0) return String(index);
|
|
15490
16042
|
if (record?.eid !== void 0 && record?.eid !== null) return record.eid;
|
|
15491
16043
|
if (record?.id !== void 0 && record?.id !== null) return record.id;
|
|
15492
16044
|
if (relationConfig?.targetKey || relationConfig?.otherKey) {
|
|
@@ -15503,7 +16055,7 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
15503
16055
|
if (relationConfig?.otherResource && relationConfig?.otherKey && record[relationConfig.otherKey]) {
|
|
15504
16056
|
return { resource: relationConfig.otherResource, id: record[relationConfig.otherKey], isLinkRow: true };
|
|
15505
16057
|
}
|
|
15506
|
-
const resourceName = model.resource || model.name;
|
|
16058
|
+
const resourceName = model.isNamedQuery && model.primaryResource ? model.primaryResource : model.resource || model.name;
|
|
15507
16059
|
const explicitPk = model.pkField ? record[model.pkField] : void 0;
|
|
15508
16060
|
const isPkField = model.fields?.find((f) => f.isPk)?.key;
|
|
15509
16061
|
const pkValue = explicitPk ?? (isPkField ? record[isPkField] : void 0) ?? record.eid ?? record.id ?? null;
|
|
@@ -15569,7 +16121,7 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
15569
16121
|
for (const actionKey of apiActionKeys) {
|
|
15570
16122
|
if (actionKey === "__delete__") {
|
|
15571
16123
|
const resp = await authenticatedFetch(`${apiUrl}/${resource}/${id}`, { method: "DELETE" });
|
|
15572
|
-
if (!resp.ok) throw new Error(`${
|
|
16124
|
+
if (!resp.ok) throw new Error(`${_34("Delete failed for record")} ${id}`);
|
|
15573
16125
|
} else if (actionKey === "__change_field__") {
|
|
15574
16126
|
if (!bulkChangeFieldKey) continue;
|
|
15575
16127
|
const payload = { ...record, [bulkChangeFieldKey]: bulkChangeFieldValue };
|
|
@@ -15579,7 +16131,7 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
15579
16131
|
headers: { "Content-Type": "application/json" },
|
|
15580
16132
|
body: JSON.stringify(payload)
|
|
15581
16133
|
});
|
|
15582
|
-
if (!resp.ok) throw new Error(`${
|
|
16134
|
+
if (!resp.ok) throw new Error(`${_34("Update failed for record")} ${id}`);
|
|
15583
16135
|
} else if (actionKey === "__clone__") {
|
|
15584
16136
|
const clonePayload = { ...record };
|
|
15585
16137
|
delete clonePayload.eid;
|
|
@@ -15591,7 +16143,7 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
15591
16143
|
headers: { "Content-Type": "application/json" },
|
|
15592
16144
|
body: JSON.stringify(clonePayload)
|
|
15593
16145
|
});
|
|
15594
|
-
if (!resp.ok) throw new Error(`${
|
|
16146
|
+
if (!resp.ok) throw new Error(`${_34("Clone failed for record")} ${id}`);
|
|
15595
16147
|
} else if (actionKey === "__pin__") {
|
|
15596
16148
|
await authenticatedFetch(`${apiUrl}/dashboard/pinned-records`, {
|
|
15597
16149
|
method: "POST",
|
|
@@ -15610,11 +16162,11 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
15610
16162
|
}
|
|
15611
16163
|
}
|
|
15612
16164
|
message.success(
|
|
15613
|
-
|
|
16165
|
+
_34("Actions applied successfully to {count} rows").replace("{count}", String(records.length))
|
|
15614
16166
|
);
|
|
15615
16167
|
} catch (e) {
|
|
15616
16168
|
errorOccurred = true;
|
|
15617
|
-
message.error(e?.message ||
|
|
16169
|
+
message.error(e?.message || _34("Bulk action failed"));
|
|
15618
16170
|
} finally {
|
|
15619
16171
|
setIsBulkExecuting(false);
|
|
15620
16172
|
setBulkActionModalOpen(false);
|
|
@@ -15672,7 +16224,7 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
15672
16224
|
Table.SELECTION_NONE,
|
|
15673
16225
|
{
|
|
15674
16226
|
key: "select-all-filtered",
|
|
15675
|
-
text:
|
|
16227
|
+
text: _34("Select all filtered rows"),
|
|
15676
16228
|
onSelect: handleSelectAllFiltered
|
|
15677
16229
|
}
|
|
15678
16230
|
]
|
|
@@ -15681,19 +16233,19 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
15681
16233
|
const bulkActionsAvailable = useMemo(() => {
|
|
15682
16234
|
const opts = [];
|
|
15683
16235
|
if (canBulkEdit) {
|
|
15684
|
-
opts.push({ label:
|
|
16236
|
+
opts.push({ label: _34("Change field value"), value: "__change_field__" });
|
|
15685
16237
|
}
|
|
15686
|
-
opts.push({ label:
|
|
16238
|
+
opts.push({ label: _34("Export selected (CSV)"), value: "__export_csv__" });
|
|
15687
16239
|
if (canBulkEdit) {
|
|
15688
|
-
opts.push({ label:
|
|
16240
|
+
opts.push({ label: _34("Clone / Duplicate selected"), value: "__clone__" });
|
|
15689
16241
|
}
|
|
15690
16242
|
if (bulkActions && bulkActions.length > 0) {
|
|
15691
|
-
bulkActions.forEach((a) => opts.push({ label:
|
|
16243
|
+
bulkActions.forEach((a) => opts.push({ label: _34(a.label), value: a.key }));
|
|
15692
16244
|
}
|
|
15693
|
-
opts.push({ label:
|
|
15694
|
-
opts.push({ label:
|
|
16245
|
+
opts.push({ label: _34("Pin selected"), value: "__pin__" });
|
|
16246
|
+
opts.push({ label: _34("Unpin selected"), value: "__unpin__" });
|
|
15695
16247
|
if (canBulkDelete) {
|
|
15696
|
-
opts.push({ label:
|
|
16248
|
+
opts.push({ label: _34("Delete selected"), value: "__delete__" });
|
|
15697
16249
|
}
|
|
15698
16250
|
return opts;
|
|
15699
16251
|
}, [bulkActions, canBulkDelete, canBulkEdit]);
|
|
@@ -15710,9 +16262,9 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
15710
16262
|
background: token.colorWarningBg,
|
|
15711
16263
|
border: `1px solid ${token.colorWarningBorder}`
|
|
15712
16264
|
}, children: [
|
|
15713
|
-
/* @__PURE__ */ jsx("span", { style: { fontWeight: 500, color: token.colorWarningText }, children: bulkSelectedRowKeys.length > 0 ?
|
|
16265
|
+
/* @__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
16266
|
/* @__PURE__ */ jsxs("div", { style: { display: "flex", gap: 8 }, children: [
|
|
15715
|
-
selectModeReturnTo && /* @__PURE__ */ jsx(Button, { size: "small", onClick: () => navigate(selectModeReturnTo), children:
|
|
16267
|
+
selectModeReturnTo && /* @__PURE__ */ jsx(Button, { size: "small", onClick: () => navigate(selectModeReturnTo), children: _34("Cancel") }),
|
|
15716
16268
|
/* @__PURE__ */ jsx(
|
|
15717
16269
|
Button,
|
|
15718
16270
|
{
|
|
@@ -15721,7 +16273,7 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
15721
16273
|
disabled: bulkSelectedRowKeys.length === 0,
|
|
15722
16274
|
loading: selectModeAssociating,
|
|
15723
16275
|
onClick: handleAssociateSelected,
|
|
15724
|
-
children:
|
|
16276
|
+
children: _34("Associate selected")
|
|
15725
16277
|
}
|
|
15726
16278
|
)
|
|
15727
16279
|
] })
|
|
@@ -15737,7 +16289,7 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
15737
16289
|
background: token.colorInfoBg,
|
|
15738
16290
|
border: `1px solid ${token.colorInfoBorder}`
|
|
15739
16291
|
}, children: [
|
|
15740
|
-
/* @__PURE__ */ jsx("span", { style: { fontWeight: 500 }, children:
|
|
16292
|
+
/* @__PURE__ */ jsx("span", { style: { fontWeight: 500 }, children: _34("{count} rows selected").replace("{count}", String(bulkSelectedRowKeys.length)) }),
|
|
15741
16293
|
bulkSelectedRowKeys.length < filteredTotalCount && /* @__PURE__ */ jsx(
|
|
15742
16294
|
Button,
|
|
15743
16295
|
{
|
|
@@ -15746,16 +16298,16 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
15746
16298
|
loading: selectAllFilteredPending && isAllRowsLoading,
|
|
15747
16299
|
onClick: handleSelectAllFiltered,
|
|
15748
16300
|
style: { padding: 0 },
|
|
15749
|
-
children:
|
|
16301
|
+
children: _34("Select all {count} filtered rows").replace("{count}", String(filteredTotalCount))
|
|
15750
16302
|
}
|
|
15751
16303
|
),
|
|
15752
|
-
/* @__PURE__ */ jsx(Button, { type: "link", size: "small", onClick: clearBulkSelection, style: { padding: 0 }, children:
|
|
16304
|
+
/* @__PURE__ */ jsx(Button, { type: "link", size: "small", onClick: clearBulkSelection, style: { padding: 0 }, children: _34("Clear selection") }),
|
|
15753
16305
|
/* @__PURE__ */ jsx("div", { style: { flex: 1, minWidth: 180 }, children: /* @__PURE__ */ jsx(
|
|
15754
16306
|
Select,
|
|
15755
16307
|
{
|
|
15756
16308
|
mode: "multiple",
|
|
15757
16309
|
size: "small",
|
|
15758
|
-
placeholder:
|
|
16310
|
+
placeholder: _34("Actions"),
|
|
15759
16311
|
style: { width: "100%" },
|
|
15760
16312
|
value: bulkActionsToApply,
|
|
15761
16313
|
onChange: (values) => {
|
|
@@ -15773,7 +16325,7 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
15773
16325
|
Select,
|
|
15774
16326
|
{
|
|
15775
16327
|
size: "small",
|
|
15776
|
-
placeholder:
|
|
16328
|
+
placeholder: _34("Select field"),
|
|
15777
16329
|
style: { minWidth: 160 },
|
|
15778
16330
|
value: bulkChangeFieldKey ?? void 0,
|
|
15779
16331
|
onChange: (v) => {
|
|
@@ -15788,7 +16340,7 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
15788
16340
|
Select,
|
|
15789
16341
|
{
|
|
15790
16342
|
size: "small",
|
|
15791
|
-
placeholder:
|
|
16343
|
+
placeholder: _34("Select value"),
|
|
15792
16344
|
style: { minWidth: 180 },
|
|
15793
16345
|
value: bulkChangeFieldValue ?? void 0,
|
|
15794
16346
|
onChange: (v) => setBulkChangeFieldValue(v),
|
|
@@ -15799,25 +16351,25 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
15799
16351
|
Select,
|
|
15800
16352
|
{
|
|
15801
16353
|
size: "small",
|
|
15802
|
-
placeholder:
|
|
16354
|
+
placeholder: _34("Select value"),
|
|
15803
16355
|
style: { minWidth: 120 },
|
|
15804
16356
|
value: bulkChangeFieldValue ?? void 0,
|
|
15805
16357
|
onChange: (v) => setBulkChangeFieldValue(v),
|
|
15806
|
-
options: [{ label:
|
|
16358
|
+
options: [{ label: _34("True"), value: true }, { label: _34("False"), value: false }],
|
|
15807
16359
|
allowClear: true
|
|
15808
16360
|
}
|
|
15809
16361
|
) : bulkChangeField.type === "date" ? /* @__PURE__ */ jsx(
|
|
15810
16362
|
DatePicker,
|
|
15811
16363
|
{
|
|
15812
16364
|
size: "small",
|
|
15813
|
-
value: bulkChangeFieldValue ?
|
|
16365
|
+
value: bulkChangeFieldValue ? dayjs8(bulkChangeFieldValue) : null,
|
|
15814
16366
|
onChange: (v) => setBulkChangeFieldValue(v ? v.toISOString() : null)
|
|
15815
16367
|
}
|
|
15816
16368
|
) : bulkChangeField.type === "number" ? /* @__PURE__ */ jsx(
|
|
15817
16369
|
InputNumber,
|
|
15818
16370
|
{
|
|
15819
16371
|
size: "small",
|
|
15820
|
-
placeholder:
|
|
16372
|
+
placeholder: _34("Value"),
|
|
15821
16373
|
value: bulkChangeFieldValue,
|
|
15822
16374
|
onChange: (v) => setBulkChangeFieldValue(v),
|
|
15823
16375
|
style: { minWidth: 120 }
|
|
@@ -15826,7 +16378,7 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
15826
16378
|
Input,
|
|
15827
16379
|
{
|
|
15828
16380
|
size: "small",
|
|
15829
|
-
placeholder:
|
|
16381
|
+
placeholder: _34("Value"),
|
|
15830
16382
|
value: bulkChangeFieldValue ?? "",
|
|
15831
16383
|
onChange: (e) => setBulkChangeFieldValue(e.target.value),
|
|
15832
16384
|
style: { minWidth: 160 }
|
|
@@ -15840,7 +16392,7 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
15840
16392
|
size: "small",
|
|
15841
16393
|
disabled: bulkActionsToApply.length === 0,
|
|
15842
16394
|
onClick: () => setBulkActionModalOpen(true),
|
|
15843
|
-
children:
|
|
16395
|
+
children: _34("Apply")
|
|
15844
16396
|
}
|
|
15845
16397
|
)
|
|
15846
16398
|
] }) : null;
|
|
@@ -15848,16 +16400,16 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
15848
16400
|
Modal,
|
|
15849
16401
|
{
|
|
15850
16402
|
open: bulkActionModalOpen,
|
|
15851
|
-
title:
|
|
16403
|
+
title: _34("Confirm bulk action"),
|
|
15852
16404
|
onCancel: () => {
|
|
15853
16405
|
if (!isBulkExecuting) setBulkActionModalOpen(false);
|
|
15854
16406
|
},
|
|
15855
16407
|
footer: [
|
|
15856
|
-
/* @__PURE__ */ jsx(Button, { onClick: () => setBulkActionModalOpen(false), disabled: isBulkExecuting, children:
|
|
15857
|
-
/* @__PURE__ */ jsx(Button, { type: "primary", loading: isBulkExecuting, onClick: executeBulkActions, children:
|
|
16408
|
+
/* @__PURE__ */ jsx(Button, { onClick: () => setBulkActionModalOpen(false), disabled: isBulkExecuting, children: _34("Cancel") }, "cancel"),
|
|
16409
|
+
/* @__PURE__ */ jsx(Button, { type: "primary", loading: isBulkExecuting, onClick: executeBulkActions, children: _34("Confirm") }, "ok")
|
|
15858
16410
|
],
|
|
15859
16411
|
children: [
|
|
15860
|
-
/* @__PURE__ */ jsx("p", { children:
|
|
16412
|
+
/* @__PURE__ */ jsx("p", { children: _34("You are about to apply the following actions to {count} rows:").replace("{count}", String(bulkSelectedRowKeys.length)) }),
|
|
15861
16413
|
/* @__PURE__ */ jsx("ul", { style: { paddingLeft: 20, marginBottom: 8 }, children: bulkActionsToApply.map((actionKey) => {
|
|
15862
16414
|
const label = bulkActionsAvailable.find((a) => a.value === actionKey)?.label ?? actionKey;
|
|
15863
16415
|
const extra = actionKey === "__change_field__" && bulkChangeField ? ` \u2192 ${bulkChangeField.label}: ${String(bulkChangeFieldValue ?? "")}` : "";
|
|
@@ -15873,7 +16425,7 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
15873
16425
|
const listTitle = !isEmbedded ? renderModelHeading({
|
|
15874
16426
|
model,
|
|
15875
16427
|
title: modelDisplayLabel,
|
|
15876
|
-
actionLabel:
|
|
16428
|
+
actionLabel: _34("List"),
|
|
15877
16429
|
moduleLabel: model.module ? getModuleLabel(model.module) : void 0
|
|
15878
16430
|
}) : void 0;
|
|
15879
16431
|
const numericBarColor = modelTone.soft || token.colorPrimaryBg || "rgba(22, 119, 255, 0.16)";
|
|
@@ -15897,7 +16449,7 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
15897
16449
|
items: selectedViewNames.map((name) => ({ key: name, label: renderToneTabLabel(name, modelTone) }))
|
|
15898
16450
|
}
|
|
15899
16451
|
) : null;
|
|
15900
|
-
const listToggleButton = /* @__PURE__ */ jsx(Tooltip, { title:
|
|
16452
|
+
const listToggleButton = /* @__PURE__ */ jsx(Tooltip, { title: _34("View list"), children: /* @__PURE__ */ jsx(
|
|
15901
16453
|
Button,
|
|
15902
16454
|
{
|
|
15903
16455
|
size: "small",
|
|
@@ -15908,7 +16460,7 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
15908
16460
|
}
|
|
15909
16461
|
}
|
|
15910
16462
|
) });
|
|
15911
|
-
const exportButton = !isEmbedded ? /* @__PURE__ */ jsx(Tooltip, { title:
|
|
16463
|
+
const exportButton = !isEmbedded ? /* @__PURE__ */ jsx(Tooltip, { title: _34("Export CSV"), children: /* @__PURE__ */ jsx(
|
|
15912
16464
|
Button,
|
|
15913
16465
|
{
|
|
15914
16466
|
size: "small",
|
|
@@ -15917,7 +16469,7 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
15917
16469
|
loading: exportRequested && isAllRowsLoading
|
|
15918
16470
|
}
|
|
15919
16471
|
) }) : null;
|
|
15920
|
-
const columnsToggleButton = /* @__PURE__ */ jsx(Tooltip, { title: columnsSelectorOpen ?
|
|
16472
|
+
const columnsToggleButton = /* @__PURE__ */ jsx(Tooltip, { title: columnsSelectorOpen ? _34("Hide view configuration") : _34("Show view configuration"), children: /* @__PURE__ */ jsx(
|
|
15921
16473
|
Button,
|
|
15922
16474
|
{
|
|
15923
16475
|
size: "small",
|
|
@@ -15929,10 +16481,10 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
15929
16481
|
return next;
|
|
15930
16482
|
});
|
|
15931
16483
|
},
|
|
15932
|
-
"aria-label": columnsSelectorOpen ?
|
|
16484
|
+
"aria-label": columnsSelectorOpen ? _34("Hide view configuration") : _34("Show view configuration")
|
|
15933
16485
|
}
|
|
15934
16486
|
) });
|
|
15935
|
-
const createRelationButton = isRelationView && showCreate ? /* @__PURE__ */ jsx(Tooltip, { title:
|
|
16487
|
+
const createRelationButton = isRelationView && showCreate ? /* @__PURE__ */ jsx(Tooltip, { title: _34("Add relation"), children: /* @__PURE__ */ jsx(
|
|
15936
16488
|
Button,
|
|
15937
16489
|
{
|
|
15938
16490
|
size: "small",
|
|
@@ -15948,7 +16500,7 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
15948
16500
|
}
|
|
15949
16501
|
}
|
|
15950
16502
|
) }) : null;
|
|
15951
|
-
const associateExistingFkButton = isRelationView && showCreate && filter?.field && filter?.value !== void 0 && filter?.value !== null && !relationConfig?.otherKey ? /* @__PURE__ */ jsx(Tooltip, { title:
|
|
16503
|
+
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
16504
|
Button,
|
|
15953
16505
|
{
|
|
15954
16506
|
size: "small",
|
|
@@ -15968,7 +16520,7 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
15968
16520
|
}
|
|
15969
16521
|
}
|
|
15970
16522
|
) }) : 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:
|
|
16523
|
+
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
16524
|
Button,
|
|
15973
16525
|
{
|
|
15974
16526
|
size: "small",
|
|
@@ -15984,7 +16536,7 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
15984
16536
|
const relatedModel = findModelByName(allModels, relationConfig?.otherResource || relationConfig?.otherResourcePath);
|
|
15985
16537
|
const relatedResource = relatedModel ? resolveResourcePath(relatedModel.resource || relatedModel.name, allModels) : null;
|
|
15986
16538
|
if (!relatedResource) {
|
|
15987
|
-
message.warning(
|
|
16539
|
+
message.warning(_34("No create route for the related model. Opening relation create form."));
|
|
15988
16540
|
params.append(targetKey, String(targetId));
|
|
15989
16541
|
const returnTo2 = `${location.pathname}${location.search}${location.hash}`;
|
|
15990
16542
|
if (returnTo2.startsWith("/")) params.append("returnTo", returnTo2);
|
|
@@ -16004,7 +16556,7 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
16004
16556
|
const embeddedActionBar = isEmbedded ? /* @__PURE__ */ jsxs("div", { style: { display: "flex", alignItems: "center", justifyContent: "flex-end", gap: 8, marginBottom: 8 }, children: [
|
|
16005
16557
|
columnsToggleButton,
|
|
16006
16558
|
listToggleButton,
|
|
16007
|
-
/* @__PURE__ */ jsx(Tooltip, { title:
|
|
16559
|
+
/* @__PURE__ */ jsx(Tooltip, { title: _34("Analyze"), children: /* @__PURE__ */ jsx(
|
|
16008
16560
|
Button,
|
|
16009
16561
|
{
|
|
16010
16562
|
size: "small",
|
|
@@ -16017,7 +16569,7 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
16017
16569
|
}
|
|
16018
16570
|
}
|
|
16019
16571
|
) }),
|
|
16020
|
-
/* @__PURE__ */ jsx(Tooltip, { title:
|
|
16572
|
+
/* @__PURE__ */ jsx(Tooltip, { title: _34("Switch orientation"), children: /* @__PURE__ */ jsx(
|
|
16021
16573
|
Button,
|
|
16022
16574
|
{
|
|
16023
16575
|
size: "small",
|
|
@@ -16028,7 +16580,7 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
16028
16580
|
}
|
|
16029
16581
|
}
|
|
16030
16582
|
) }),
|
|
16031
|
-
/* @__PURE__ */ jsx(Tooltip, { title:
|
|
16583
|
+
/* @__PURE__ */ jsx(Tooltip, { title: _34("Switch positions"), children: /* @__PURE__ */ jsx(
|
|
16032
16584
|
Button,
|
|
16033
16585
|
{
|
|
16034
16586
|
size: "small",
|
|
@@ -16039,7 +16591,7 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
16039
16591
|
}
|
|
16040
16592
|
}
|
|
16041
16593
|
) }),
|
|
16042
|
-
resolvedLayoutPreferenceType && /* @__PURE__ */ jsx(Tooltip, { title:
|
|
16594
|
+
resolvedLayoutPreferenceType && /* @__PURE__ */ jsx(Tooltip, { title: _34("Save layout"), children: /* @__PURE__ */ jsx(
|
|
16043
16595
|
Button,
|
|
16044
16596
|
{
|
|
16045
16597
|
size: "small",
|
|
@@ -16051,7 +16603,7 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
16051
16603
|
associateExistingFkButton,
|
|
16052
16604
|
createRelationButton,
|
|
16053
16605
|
createNewAndRelateButton,
|
|
16054
|
-
/* @__PURE__ */ jsx(Tooltip, { title:
|
|
16606
|
+
/* @__PURE__ */ jsx(Tooltip, { title: _34("Export CSV"), children: /* @__PURE__ */ jsx(
|
|
16055
16607
|
Button,
|
|
16056
16608
|
{
|
|
16057
16609
|
size: "small",
|
|
@@ -16207,10 +16759,10 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
16207
16759
|
if (calendarInitSignatureRef.current === signature) return;
|
|
16208
16760
|
calendarInitSignatureRef.current = signature;
|
|
16209
16761
|
if (calendarEarliestDateTs === null) {
|
|
16210
|
-
setCalendarAnchorDate(
|
|
16762
|
+
setCalendarAnchorDate(dayjs8().startOf(calendarMode));
|
|
16211
16763
|
return;
|
|
16212
16764
|
}
|
|
16213
|
-
setCalendarAnchorDate(
|
|
16765
|
+
setCalendarAnchorDate(dayjs8(calendarEarliestDateTs).startOf(calendarMode));
|
|
16214
16766
|
}, [calendarDateField, calendarEarliestDateTs, calendarMode, isCalendarView]);
|
|
16215
16767
|
const calendarEntriesByDate = useMemo(() => {
|
|
16216
16768
|
const grouped = /* @__PURE__ */ new Map();
|
|
@@ -16258,7 +16810,7 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
16258
16810
|
};
|
|
16259
16811
|
const renderCalendarView = () => {
|
|
16260
16812
|
if (calendarDateFieldOptions.length === 0) {
|
|
16261
|
-
return /* @__PURE__ */ jsx(Empty, { description:
|
|
16813
|
+
return /* @__PURE__ */ jsx(Empty, { description: _34("No date/datetime fields available for calendar view.") });
|
|
16262
16814
|
}
|
|
16263
16815
|
const selectedDateField = model.fields.find((field) => field.key === calendarDateField);
|
|
16264
16816
|
const selectedLabel = selectedDateField?.label || calendarDateField;
|
|
@@ -16272,8 +16824,8 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
16272
16824
|
value: calendarMode,
|
|
16273
16825
|
onChange: (value) => setCalendarMode(value),
|
|
16274
16826
|
options: [
|
|
16275
|
-
{ label:
|
|
16276
|
-
{ label:
|
|
16827
|
+
{ label: _34("Monthly"), value: "month" },
|
|
16828
|
+
{ label: _34("Weekly"), value: "week" }
|
|
16277
16829
|
],
|
|
16278
16830
|
style: { minWidth: 120 }
|
|
16279
16831
|
}
|
|
@@ -16286,35 +16838,35 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
16286
16838
|
onChange: (value) => setCalendarDateField(value),
|
|
16287
16839
|
options: calendarDateFieldOptions.map((field) => ({ label: field.label, value: field.key })),
|
|
16288
16840
|
style: { minWidth: 220 },
|
|
16289
|
-
placeholder:
|
|
16841
|
+
placeholder: _34("Date field")
|
|
16290
16842
|
}
|
|
16291
16843
|
)
|
|
16292
16844
|
] }),
|
|
16293
16845
|
/* @__PURE__ */ jsxs(Space, { size: 8, children: [
|
|
16294
|
-
/* @__PURE__ */ jsx(Tooltip, { title:
|
|
16846
|
+
/* @__PURE__ */ jsx(Tooltip, { title: _34("Previous"), children: /* @__PURE__ */ jsx(
|
|
16295
16847
|
Button,
|
|
16296
16848
|
{
|
|
16297
16849
|
size: "small",
|
|
16298
16850
|
icon: /* @__PURE__ */ jsx(ArrowLeftOutlined, {}),
|
|
16299
|
-
"aria-label":
|
|
16851
|
+
"aria-label": _34("Previous"),
|
|
16300
16852
|
onClick: () => setCalendarAnchorDate((prev) => prev.subtract(1, calendarMode).startOf(calendarMode))
|
|
16301
16853
|
}
|
|
16302
16854
|
) }),
|
|
16303
|
-
/* @__PURE__ */ jsx(Tooltip, { title:
|
|
16855
|
+
/* @__PURE__ */ jsx(Tooltip, { title: _34("Today"), children: /* @__PURE__ */ jsx(
|
|
16304
16856
|
Button,
|
|
16305
16857
|
{
|
|
16306
16858
|
size: "small",
|
|
16307
16859
|
icon: /* @__PURE__ */ jsx(CalendarOutlined, {}),
|
|
16308
|
-
"aria-label":
|
|
16309
|
-
onClick: () => setCalendarAnchorDate(
|
|
16860
|
+
"aria-label": _34("Today"),
|
|
16861
|
+
onClick: () => setCalendarAnchorDate(dayjs8().startOf(calendarMode))
|
|
16310
16862
|
}
|
|
16311
16863
|
) }),
|
|
16312
|
-
/* @__PURE__ */ jsx(Tooltip, { title:
|
|
16864
|
+
/* @__PURE__ */ jsx(Tooltip, { title: _34("Next"), children: /* @__PURE__ */ jsx(
|
|
16313
16865
|
Button,
|
|
16314
16866
|
{
|
|
16315
16867
|
size: "small",
|
|
16316
16868
|
icon: /* @__PURE__ */ jsx(ArrowRightOutlined, {}),
|
|
16317
|
-
"aria-label":
|
|
16869
|
+
"aria-label": _34("Next"),
|
|
16318
16870
|
onClick: () => setCalendarAnchorDate((prev) => prev.add(1, calendarMode).startOf(calendarMode))
|
|
16319
16871
|
}
|
|
16320
16872
|
) })
|
|
@@ -16355,7 +16907,7 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
16355
16907
|
const dayKey = day.format("YYYY-MM-DD");
|
|
16356
16908
|
const entries = calendarEntriesByDate.get(dayKey) || [];
|
|
16357
16909
|
const isOutsideCurrentMonth = calendarMode === "month" && day.month() !== calendarAnchorDate.month();
|
|
16358
|
-
const isToday = day.isSame(
|
|
16910
|
+
const isToday = day.isSame(dayjs8(), "day");
|
|
16359
16911
|
return /* @__PURE__ */ jsxs(
|
|
16360
16912
|
"div",
|
|
16361
16913
|
{
|
|
@@ -16399,20 +16951,20 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
16399
16951
|
Modal,
|
|
16400
16952
|
{
|
|
16401
16953
|
open: saveViewModalOpen,
|
|
16402
|
-
title:
|
|
16954
|
+
title: _34("Save view"),
|
|
16403
16955
|
onCancel: () => {
|
|
16404
16956
|
setSaveViewModalOpen(false);
|
|
16405
16957
|
setPendingSaveTarget(null);
|
|
16406
16958
|
},
|
|
16407
16959
|
onOk: handleConfirmSaveView,
|
|
16408
|
-
okText: pendingSaveTarget === "layout" ?
|
|
16960
|
+
okText: pendingSaveTarget === "layout" ? _34("Save layout") : _34("Save analyze"),
|
|
16409
16961
|
okButtonProps: { disabled: !pendingSaveTarget },
|
|
16410
16962
|
children: /* @__PURE__ */ jsxs("div", { style: { display: "grid", gap: 12 }, children: [
|
|
16411
16963
|
/* @__PURE__ */ jsxs("div", { children: [
|
|
16412
|
-
/* @__PURE__ */ jsx("div", { style: { fontSize: 12, color: token.colorTextSecondary, marginBottom: 4 }, children:
|
|
16964
|
+
/* @__PURE__ */ jsx("div", { style: { fontSize: 12, color: token.colorTextSecondary, marginBottom: 4 }, children: _34("View name") }),
|
|
16413
16965
|
/* @__PURE__ */ jsx(Input, { value: saveViewName, onChange: (event) => setSaveViewName(event.target.value) })
|
|
16414
16966
|
] }),
|
|
16415
|
-
/* @__PURE__ */ jsx(Checkbox, { checked: saveViewAsNew, onChange: (event) => setSaveViewAsNew(event.target.checked), children:
|
|
16967
|
+
/* @__PURE__ */ jsx(Checkbox, { checked: saveViewAsNew, onChange: (event) => setSaveViewAsNew(event.target.checked), children: _34("Save as new view") })
|
|
16416
16968
|
] })
|
|
16417
16969
|
}
|
|
16418
16970
|
),
|
|
@@ -16420,10 +16972,10 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
16420
16972
|
Modal,
|
|
16421
16973
|
{
|
|
16422
16974
|
open: renameViewModalOpen,
|
|
16423
|
-
title:
|
|
16975
|
+
title: _34("Rename view"),
|
|
16424
16976
|
onCancel: () => setRenameViewModalOpen(false),
|
|
16425
16977
|
onOk: handleRenameView,
|
|
16426
|
-
okText:
|
|
16978
|
+
okText: _34("Rename"),
|
|
16427
16979
|
children: /* @__PURE__ */ jsx(Input, { value: renameViewName, onChange: (event) => setRenameViewName(event.target.value) })
|
|
16428
16980
|
}
|
|
16429
16981
|
),
|
|
@@ -16433,7 +16985,7 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
16433
16985
|
{
|
|
16434
16986
|
size: "small",
|
|
16435
16987
|
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:
|
|
16988
|
+
/* @__PURE__ */ jsx("span", { style: { color: token.colorTextSecondary, fontSize: 12, fontWeight: 600 }, children: _34("Filters") }),
|
|
16437
16989
|
/* @__PURE__ */ jsx("div", { style: { display: "flex", alignItems: "center", gap: 8, flex: 1, justifyContent: "flex-end" }, children: !filtersCollapsed && searchField && /* @__PURE__ */ jsx(
|
|
16438
16990
|
Form,
|
|
16439
16991
|
{
|
|
@@ -16447,7 +16999,7 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
16447
16999
|
}
|
|
16448
17000
|
searchFormProps.onFinish?.(values);
|
|
16449
17001
|
},
|
|
16450
|
-
children: /* @__PURE__ */ jsx(Form.Item, { name: "q", style: { marginBottom: 0, width: "100%" }, children: /* @__PURE__ */ jsx(Input, { placeholder:
|
|
17002
|
+
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
17003
|
}
|
|
16452
17004
|
) })
|
|
16453
17005
|
] }),
|
|
@@ -16460,31 +17012,31 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
16460
17012
|
Card,
|
|
16461
17013
|
{
|
|
16462
17014
|
size: "small",
|
|
16463
|
-
title: /* @__PURE__ */ jsx("span", { style: { color: token.colorTextSecondary, fontSize: 12, fontWeight: 600 }, children:
|
|
17015
|
+
title: /* @__PURE__ */ jsx("span", { style: { color: token.colorTextSecondary, fontSize: 12, fontWeight: 600 }, children: _34("View configuration") }),
|
|
16464
17016
|
style: { marginBottom: 16 },
|
|
16465
17017
|
styles: { body: { display: "grid", gap: 12 } },
|
|
16466
17018
|
children: [
|
|
16467
17019
|
/* @__PURE__ */ jsxs("div", { style: { display: "grid", gap: 12 }, children: [
|
|
16468
17020
|
/* @__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:
|
|
17021
|
+
/* @__PURE__ */ jsx("div", { style: { fontSize: 12, color: token.colorTextSecondary, fontWeight: 600 }, children: _34("Advanced filters") }),
|
|
17022
|
+
filterRules.length === 0 ? /* @__PURE__ */ jsx("div", { style: { color: token.colorTextSecondary, fontSize: 12 }, children: _34("No filters yet.") }) : filterRules.map((rule) => {
|
|
16471
17023
|
const field = model.fields.find((f) => f.key === rule.fieldKey);
|
|
16472
17024
|
const type = field?.type || "string";
|
|
16473
17025
|
const operatorOptions = type === "number" ? [
|
|
16474
|
-
{ label:
|
|
16475
|
-
{ label:
|
|
16476
|
-
{ label:
|
|
16477
|
-
{ label:
|
|
16478
|
-
{ label:
|
|
16479
|
-
{ label:
|
|
17026
|
+
{ label: _34("="), value: "eq" },
|
|
17027
|
+
{ label: _34(">"), value: "gt" },
|
|
17028
|
+
{ label: _34(">="), value: "gte" },
|
|
17029
|
+
{ label: _34("<"), value: "lt" },
|
|
17030
|
+
{ label: _34("<="), value: "lte" },
|
|
17031
|
+
{ label: _34("Between"), value: "between" }
|
|
16480
17032
|
] : type === "date" ? [
|
|
16481
|
-
{ label:
|
|
16482
|
-
{ label:
|
|
16483
|
-
{ label:
|
|
16484
|
-
{ label:
|
|
16485
|
-
] : type === "boolean" ? [{ label:
|
|
16486
|
-
{ label:
|
|
16487
|
-
{ label:
|
|
17033
|
+
{ label: _34("On"), value: "on" },
|
|
17034
|
+
{ label: _34("After"), value: "after" },
|
|
17035
|
+
{ label: _34("Before"), value: "before" },
|
|
17036
|
+
{ label: _34("Between"), value: "between" }
|
|
17037
|
+
] : type === "boolean" ? [{ label: _34("Is"), value: "is" }] : [
|
|
17038
|
+
{ label: _34("Contains"), value: "contains" },
|
|
17039
|
+
{ label: _34("Equals"), value: "equals" }
|
|
16488
17040
|
];
|
|
16489
17041
|
const renderDateInput = (value, onChange) => {
|
|
16490
17042
|
const mode = value?.mode || "absolute";
|
|
@@ -16497,9 +17049,9 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
16497
17049
|
value: value?.direction || "next",
|
|
16498
17050
|
onChange: (val) => onChange({ ...value, mode: "relative", direction: val }),
|
|
16499
17051
|
options: [
|
|
16500
|
-
{ label:
|
|
16501
|
-
{ label:
|
|
16502
|
-
{ label:
|
|
17052
|
+
{ label: _34("Previous"), value: "previous" },
|
|
17053
|
+
{ label: _34("Current"), value: "current" },
|
|
17054
|
+
{ label: _34("Next"), value: "next" }
|
|
16503
17055
|
]
|
|
16504
17056
|
}
|
|
16505
17057
|
),
|
|
@@ -16509,11 +17061,11 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
16509
17061
|
value: value?.unit || "weeks",
|
|
16510
17062
|
onChange: (val) => onChange({ ...value, mode: "relative", unit: val }),
|
|
16511
17063
|
options: [
|
|
16512
|
-
{ label:
|
|
16513
|
-
{ label:
|
|
16514
|
-
{ label:
|
|
16515
|
-
{ label:
|
|
16516
|
-
{ label:
|
|
17064
|
+
{ label: _34("Days"), value: "days" },
|
|
17065
|
+
{ label: _34("Weeks"), value: "weeks" },
|
|
17066
|
+
{ label: _34("Months"), value: "months" },
|
|
17067
|
+
{ label: _34("Quarters"), value: "quarters" },
|
|
17068
|
+
{ label: _34("Years"), value: "years" }
|
|
16517
17069
|
]
|
|
16518
17070
|
}
|
|
16519
17071
|
)
|
|
@@ -16522,7 +17074,7 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
16522
17074
|
return /* @__PURE__ */ jsx(
|
|
16523
17075
|
DatePicker,
|
|
16524
17076
|
{
|
|
16525
|
-
value: value?.date ?
|
|
17077
|
+
value: value?.date ? dayjs8(value.date) : void 0,
|
|
16526
17078
|
onChange: (val) => onChange({ mode: "absolute", date: val ? val.toISOString() : null })
|
|
16527
17079
|
}
|
|
16528
17080
|
);
|
|
@@ -16535,7 +17087,7 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
16535
17087
|
value: rule.fieldKey,
|
|
16536
17088
|
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
17089
|
options: model.fields.map((f) => ({ label: f.label, value: f.key })),
|
|
16538
|
-
placeholder:
|
|
17090
|
+
placeholder: _34("Field")
|
|
16539
17091
|
}
|
|
16540
17092
|
),
|
|
16541
17093
|
/* @__PURE__ */ jsx(
|
|
@@ -16545,7 +17097,7 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
16545
17097
|
value: rule.operator,
|
|
16546
17098
|
onChange: (value) => setFilterRules((prev) => prev.map((item) => item.id === rule.id ? { ...item, operator: value } : item)),
|
|
16547
17099
|
options: operatorOptions,
|
|
16548
|
-
placeholder:
|
|
17100
|
+
placeholder: _34("Operator")
|
|
16549
17101
|
}
|
|
16550
17102
|
),
|
|
16551
17103
|
type === "number" && rule.operator === "between" && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
@@ -16578,10 +17130,10 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
16578
17130
|
value: rule.value,
|
|
16579
17131
|
onChange: (value) => setFilterRules((prev) => prev.map((item) => item.id === rule.id ? { ...item, value } : item)),
|
|
16580
17132
|
options: [
|
|
16581
|
-
{ label:
|
|
16582
|
-
{ label:
|
|
17133
|
+
{ label: _34("True"), value: true },
|
|
17134
|
+
{ label: _34("False"), value: false }
|
|
16583
17135
|
],
|
|
16584
|
-
placeholder:
|
|
17136
|
+
placeholder: _34("Value")
|
|
16585
17137
|
}
|
|
16586
17138
|
),
|
|
16587
17139
|
type === "date" && rule.operator === "between" && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
@@ -16594,7 +17146,7 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
16594
17146
|
{
|
|
16595
17147
|
value: rule.value,
|
|
16596
17148
|
onChange: (event) => setFilterRules((prev) => prev.map((item) => item.id === rule.id ? { ...item, value: event.target.value } : item)),
|
|
16597
|
-
placeholder:
|
|
17149
|
+
placeholder: _34("Value"),
|
|
16598
17150
|
style: { minWidth: 200 }
|
|
16599
17151
|
}
|
|
16600
17152
|
),
|
|
@@ -16607,8 +17159,8 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
16607
17159
|
setFilterRules((prev) => prev.map((item) => item.id === rule.id ? { ...item, value: { ...item.value || {}, mode: val } } : item));
|
|
16608
17160
|
},
|
|
16609
17161
|
options: [
|
|
16610
|
-
{ label:
|
|
16611
|
-
{ label:
|
|
17162
|
+
{ label: _34("Date"), value: "absolute" },
|
|
17163
|
+
{ label: _34("Relative"), value: "relative" }
|
|
16612
17164
|
]
|
|
16613
17165
|
}
|
|
16614
17166
|
),
|
|
@@ -16621,8 +17173,8 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
16621
17173
|
setFilterRules((prev) => prev.map((item) => item.id === rule.id ? { ...item, value2: { ...item.value2 || {}, mode: val } } : item));
|
|
16622
17174
|
},
|
|
16623
17175
|
options: [
|
|
16624
|
-
{ label:
|
|
16625
|
-
{ label:
|
|
17176
|
+
{ label: _34("Date"), value: "absolute" },
|
|
17177
|
+
{ label: _34("Relative"), value: "relative" }
|
|
16626
17178
|
]
|
|
16627
17179
|
}
|
|
16628
17180
|
),
|
|
@@ -16632,7 +17184,7 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
16632
17184
|
size: "small",
|
|
16633
17185
|
danger: true,
|
|
16634
17186
|
onClick: () => setFilterRules((prev) => prev.filter((item) => item.id !== rule.id)),
|
|
16635
|
-
children:
|
|
17187
|
+
children: _34("Remove")
|
|
16636
17188
|
}
|
|
16637
17189
|
)
|
|
16638
17190
|
] }, rule.id);
|
|
@@ -16644,14 +17196,14 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
16644
17196
|
size: "small",
|
|
16645
17197
|
icon: /* @__PURE__ */ jsx(FilterOutlined, {}),
|
|
16646
17198
|
onClick: () => setFilterRules((prev) => [...prev, { id: `${Date.now()}-${Math.random()}` }]),
|
|
16647
|
-
children:
|
|
17199
|
+
children: _34("Add Filter")
|
|
16648
17200
|
}
|
|
16649
17201
|
),
|
|
16650
|
-
filterRules.length > 0 && /* @__PURE__ */ jsx(Button, { size: "small", onClick: () => setFilterRules([]), children:
|
|
17202
|
+
filterRules.length > 0 && /* @__PURE__ */ jsx(Button, { size: "small", onClick: () => setFilterRules([]), children: _34("Clear filters") })
|
|
16651
17203
|
] })
|
|
16652
17204
|
] }),
|
|
16653
17205
|
/* @__PURE__ */ jsxs("div", { style: { display: "grid", gap: 6 }, children: [
|
|
16654
|
-
/* @__PURE__ */ jsx("div", { style: { fontSize: 12, color: token.colorTextSecondary, fontWeight: 600 }, children:
|
|
17206
|
+
/* @__PURE__ */ jsx("div", { style: { fontSize: 12, color: token.colorTextSecondary, fontWeight: 600 }, children: _34("Views shown") }),
|
|
16655
17207
|
/* @__PURE__ */ jsx(
|
|
16656
17208
|
Select,
|
|
16657
17209
|
{
|
|
@@ -16672,12 +17224,12 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
16672
17224
|
),
|
|
16673
17225
|
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
17226
|
/* @__PURE__ */ jsx("div", { style: { flex: 1 }, children: name }),
|
|
16675
|
-
/* @__PURE__ */ jsx(Tooltip, { title:
|
|
16676
|
-
/* @__PURE__ */ jsx(Tooltip, { title:
|
|
17227
|
+
/* @__PURE__ */ jsx(Tooltip, { title: _34("Move up"), children: /* @__PURE__ */ jsx(Button, { size: "small", icon: /* @__PURE__ */ jsx(ArrowUpOutlined, {}), disabled: index === 0, onClick: () => moveSelectedView(name, "up") }) }),
|
|
17228
|
+
/* @__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
17229
|
] }, name)) })
|
|
16678
17230
|
] }),
|
|
16679
17231
|
/* @__PURE__ */ jsxs("div", { style: { display: "grid", gap: 6 }, children: [
|
|
16680
|
-
/* @__PURE__ */ jsx("div", { style: { fontSize: 12, color: token.colorTextSecondary, fontWeight: 600 }, children:
|
|
17232
|
+
/* @__PURE__ */ jsx("div", { style: { fontSize: 12, color: token.colorTextSecondary, fontWeight: 600 }, children: _34("Active view") }),
|
|
16681
17233
|
viewSelector
|
|
16682
17234
|
] }),
|
|
16683
17235
|
/* @__PURE__ */ jsxs("div", { style: { display: "flex", flexWrap: "wrap", alignItems: "center", gap: 8 }, children: [
|
|
@@ -16689,7 +17241,7 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
16689
17241
|
setRenameViewName(currentViewName);
|
|
16690
17242
|
setRenameViewModalOpen(true);
|
|
16691
17243
|
},
|
|
16692
|
-
children:
|
|
17244
|
+
children: _34("Rename view")
|
|
16693
17245
|
}
|
|
16694
17246
|
),
|
|
16695
17247
|
/* @__PURE__ */ jsx(
|
|
@@ -16700,7 +17252,7 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
16700
17252
|
icon: /* @__PURE__ */ jsx(DeleteOutlined, {}),
|
|
16701
17253
|
disabled: availableViewNames.length <= 1,
|
|
16702
17254
|
onClick: confirmDeleteView,
|
|
16703
|
-
children:
|
|
17255
|
+
children: _34("Delete view")
|
|
16704
17256
|
}
|
|
16705
17257
|
),
|
|
16706
17258
|
resolvedLayoutPreferenceType && /* @__PURE__ */ jsx(
|
|
@@ -16710,7 +17262,7 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
16710
17262
|
icon: /* @__PURE__ */ jsx(SaveOutlined, {}),
|
|
16711
17263
|
onClick: () => openSaveViewModalFor("layout"),
|
|
16712
17264
|
loading: isSavingLayoutPrefs,
|
|
16713
|
-
children:
|
|
17265
|
+
children: _34("Save layout")
|
|
16714
17266
|
}
|
|
16715
17267
|
),
|
|
16716
17268
|
/* @__PURE__ */ jsx(
|
|
@@ -16722,7 +17274,7 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
16722
17274
|
markLayoutPrefsTouched();
|
|
16723
17275
|
setFiltersCollapsed((prev) => !prev);
|
|
16724
17276
|
},
|
|
16725
|
-
children: filtersCollapsed ?
|
|
17277
|
+
children: filtersCollapsed ? _34("Show Filters") : _34("Hide Filters")
|
|
16726
17278
|
}
|
|
16727
17279
|
),
|
|
16728
17280
|
/* @__PURE__ */ jsx(
|
|
@@ -16736,7 +17288,7 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
16736
17288
|
setIsStatsFlipped(false);
|
|
16737
17289
|
setAnalyzeOpen((prev) => !prev);
|
|
16738
17290
|
},
|
|
16739
|
-
children:
|
|
17291
|
+
children: _34("Analyze")
|
|
16740
17292
|
}
|
|
16741
17293
|
),
|
|
16742
17294
|
/* @__PURE__ */ jsx(
|
|
@@ -16748,7 +17300,7 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
16748
17300
|
markLayoutPrefsTouched();
|
|
16749
17301
|
setIsAnalyzeVertical((prev) => !prev);
|
|
16750
17302
|
},
|
|
16751
|
-
children:
|
|
17303
|
+
children: _34("Switch orientation")
|
|
16752
17304
|
}
|
|
16753
17305
|
),
|
|
16754
17306
|
/* @__PURE__ */ jsx(
|
|
@@ -16760,21 +17312,21 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
16760
17312
|
markLayoutPrefsTouched();
|
|
16761
17313
|
setIsAnalyzeFirst((prev) => !prev);
|
|
16762
17314
|
},
|
|
16763
|
-
children:
|
|
17315
|
+
children: _34("Switch positions")
|
|
16764
17316
|
}
|
|
16765
17317
|
)
|
|
16766
17318
|
] })
|
|
16767
17319
|
] }),
|
|
16768
17320
|
/* @__PURE__ */ jsxs("div", { style: { display: "grid", gap: 12 }, children: [
|
|
16769
17321
|
/* @__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:
|
|
17322
|
+
/* @__PURE__ */ jsx("span", { style: { color: token.colorTextSecondary, fontSize: 12, fontWeight: 600 }, children: _34("Columns") }),
|
|
16771
17323
|
selectedColumnKeys && selectedColumnKeys.length > 0 && /* @__PURE__ */ jsx(Button, { size: "small", onClick: () => {
|
|
16772
17324
|
setSelectedColumnKeys(null);
|
|
16773
17325
|
setColumnOrder(null);
|
|
16774
|
-
}, children:
|
|
17326
|
+
}, children: _34("Reset to default") })
|
|
16775
17327
|
] }),
|
|
16776
17328
|
/* @__PURE__ */ jsxs("div", { children: [
|
|
16777
|
-
/* @__PURE__ */ jsx("div", { style: { fontSize: 12, color: token.colorTextSecondary, marginBottom: 6 }, children:
|
|
17329
|
+
/* @__PURE__ */ jsx("div", { style: { fontSize: 12, color: token.colorTextSecondary, marginBottom: 6 }, children: _34("Select columns") }),
|
|
16778
17330
|
/* @__PURE__ */ jsx(
|
|
16779
17331
|
Checkbox.Group,
|
|
16780
17332
|
{
|
|
@@ -16786,27 +17338,27 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
16786
17338
|
(!selectedColumnKeys || selectedColumnKeys.length === 0) && /* @__PURE__ */ jsx("div", { style: { fontSize: 12, color: token.colorTextSecondary, marginTop: 6 }, children: "Using default columns. Select fields to customize." })
|
|
16787
17339
|
] }),
|
|
16788
17340
|
/* @__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:
|
|
17341
|
+
/* @__PURE__ */ jsx("div", { style: { fontSize: 12, color: token.colorTextSecondary, marginBottom: 6 }, children: _34("Column order") }),
|
|
17342
|
+
orderedSelectedColumns.length === 0 ? /* @__PURE__ */ jsx("div", { style: { fontSize: 12, color: token.colorTextSecondary }, children: _34("No custom order yet.") }) : orderedSelectedColumns.map((key, index) => {
|
|
16791
17343
|
const field = model.fields.find((item) => item.key === key);
|
|
16792
17344
|
if (!field) return null;
|
|
16793
17345
|
return /* @__PURE__ */ jsxs("div", { style: { display: "flex", alignItems: "center", gap: 8, marginBottom: 4 }, children: [
|
|
16794
17346
|
/* @__PURE__ */ jsx("div", { style: { flex: 1 }, children: field.label }),
|
|
16795
|
-
/* @__PURE__ */ jsx(Tooltip, { title:
|
|
16796
|
-
/* @__PURE__ */ jsx(Tooltip, { title:
|
|
17347
|
+
/* @__PURE__ */ jsx(Tooltip, { title: _34("Move left"), children: /* @__PURE__ */ jsx(Button, { size: "small", icon: /* @__PURE__ */ jsx(ArrowLeftOutlined, {}), disabled: index === 0, onClick: () => moveColumnOrder(key, "left") }) }),
|
|
17348
|
+
/* @__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
17349
|
] }, key);
|
|
16798
17350
|
})
|
|
16799
17351
|
] }),
|
|
16800
17352
|
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:
|
|
17353
|
+
/* @__PURE__ */ jsx("div", { style: { fontSize: 12, color: token.colorTextSecondary, marginBottom: 6 }, children: _34("Totals summary function") }),
|
|
17354
|
+
/* @__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
17355
|
const options = [
|
|
16804
|
-
{ label:
|
|
16805
|
-
{ label:
|
|
16806
|
-
{ label:
|
|
16807
|
-
{ label:
|
|
16808
|
-
{ label:
|
|
16809
|
-
{ label:
|
|
17356
|
+
{ label: _34("Sum"), value: "sum" },
|
|
17357
|
+
{ label: _34("Average"), value: "avg" },
|
|
17358
|
+
{ label: _34("Count"), value: "count" },
|
|
17359
|
+
{ label: _34("Max"), value: "max" },
|
|
17360
|
+
{ label: _34("Min"), value: "min" },
|
|
17361
|
+
{ label: _34("Std Dev"), value: "stddev" }
|
|
16810
17362
|
];
|
|
16811
17363
|
return /* @__PURE__ */ jsxs("div", { style: { display: "flex", alignItems: "center", gap: 8 }, children: [
|
|
16812
17364
|
/* @__PURE__ */ jsx("div", { style: { flex: 1 }, children: field.label }),
|
|
@@ -16834,7 +17386,7 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
16834
17386
|
listVisible && /* @__PURE__ */ jsx("div", { style: listContainerStyle, children: isCalendarView ? renderCalendarView() : isGalleryView ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
16835
17387
|
galleryRows.length === 0 ? /* @__PURE__ */ jsxs("div", { style: { display: "inline-flex", alignItems: "center", gap: 6, color: "#bfbfbf", fontSize: 12 }, children: [
|
|
16836
17388
|
/* @__PURE__ */ jsx(FileTextOutlined, { style: { fontSize: 16 } }),
|
|
16837
|
-
|
|
17389
|
+
_34("No images available")
|
|
16838
17390
|
] }) : /* @__PURE__ */ jsx("div", { style: { display: "flex", flexWrap: "wrap", gap: 16 }, children: galleryRows.map((record) => renderGalleryItem(record)) }),
|
|
16839
17391
|
galleryPaginationProps && /* @__PURE__ */ jsx("div", { style: { marginTop: 12, display: "flex", justifyContent: "flex-end" }, children: /* @__PURE__ */ jsx(Pagination, { ...galleryPaginationProps }) })
|
|
16840
17392
|
] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
@@ -16903,7 +17455,7 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
16903
17455
|
dataIndex: field.key,
|
|
16904
17456
|
title: field.label,
|
|
16905
17457
|
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,
|
|
17458
|
+
align: field.type === "number" && !field.reference && !["eid", "eid_from", "eid_to"].includes(field.key) ? "right" : void 0,
|
|
16907
17459
|
filters: columnFilters.get(field.key),
|
|
16908
17460
|
filteredValue: columnFiltersSelected[field.key] || null,
|
|
16909
17461
|
sortOrder: columnSort.find((item) => item.fieldKey === field.key)?.order ?? null,
|
|
@@ -16963,6 +17515,10 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
16963
17515
|
render: (value, record) => {
|
|
16964
17516
|
const { resource, id } = getTargetInfo(record);
|
|
16965
17517
|
const renderValue = () => {
|
|
17518
|
+
const showToken = normalizeFieldViewType(field.showViewType || "");
|
|
17519
|
+
if (showToken && !(showToken === "read-only-field" && field.reference)) {
|
|
17520
|
+
return renderFieldValue(field, record, allModels, true);
|
|
17521
|
+
}
|
|
16966
17522
|
if (field.reference && value && hasReferenceModel(field.reference, allModels)) {
|
|
16967
17523
|
return /* @__PURE__ */ jsx(
|
|
16968
17524
|
ReferenceField,
|
|
@@ -17011,17 +17567,17 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
17011
17567
|
showActions && /* @__PURE__ */ jsx(
|
|
17012
17568
|
Table.Column,
|
|
17013
17569
|
{
|
|
17014
|
-
title:
|
|
17570
|
+
title: _34("Actions"),
|
|
17015
17571
|
width: 140,
|
|
17016
17572
|
render: (_unused, record) => {
|
|
17017
17573
|
const { resource, id, isLinkRow } = getTargetInfo(record);
|
|
17018
|
-
if (!id || !resource) return /* @__PURE__ */ jsx(Tooltip, { title: `${
|
|
17574
|
+
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
17575
|
const deleteResource = isLinkRow ? model.name : resource;
|
|
17020
17576
|
const deleteId = isLinkRow && relationConfig?.targetKey && relationConfig?.otherKey ? `${record[relationConfig.targetKey]}:${record[relationConfig.otherKey]}` : id;
|
|
17021
17577
|
return /* @__PURE__ */ jsxs(Space, { children: [
|
|
17022
|
-
/* @__PURE__ */ jsx(Tooltip, { title:
|
|
17023
|
-
/* @__PURE__ */ jsx(Tooltip, { title:
|
|
17024
|
-
/* @__PURE__ */ jsx(Tooltip, { title:
|
|
17578
|
+
/* @__PURE__ */ jsx(Tooltip, { title: _34("View"), children: /* @__PURE__ */ jsx(Button, { size: "small", icon: /* @__PURE__ */ jsx(EyeOutlined, {}), onClick: () => go({ to: { resource, action: "show", id } }) }) }),
|
|
17579
|
+
/* @__PURE__ */ jsx(Tooltip, { title: _34("Edit"), children: /* @__PURE__ */ jsx(Button, { size: "small", icon: /* @__PURE__ */ jsx(EditOutlined, {}), onClick: () => go({ to: { resource, action: "edit", id } }) }) }),
|
|
17580
|
+
/* @__PURE__ */ jsx(Tooltip, { title: _34("Delete"), children: /* @__PURE__ */ jsx(DeleteButton, { hideText: true, size: "small", recordItemId: deleteId, resource: deleteResource }) })
|
|
17025
17581
|
] });
|
|
17026
17582
|
}
|
|
17027
17583
|
},
|
|
@@ -17035,7 +17591,7 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
17035
17591
|
Card,
|
|
17036
17592
|
{
|
|
17037
17593
|
size: "small",
|
|
17038
|
-
title: /* @__PURE__ */ jsx("span", { style: { color: modelTone.text, fontWeight: 600 }, children:
|
|
17594
|
+
title: /* @__PURE__ */ jsx("span", { style: { color: modelTone.text, fontWeight: 600 }, children: _34("Analyze") }),
|
|
17039
17595
|
styles: {
|
|
17040
17596
|
header: {
|
|
17041
17597
|
background: `linear-gradient(135deg, ${modelTone.solid}18 0%, ${modelTone.solid}0a 100%)`
|
|
@@ -17064,10 +17620,10 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
17064
17620
|
styles: { body: { display: "grid", gap: 16, position: "relative", paddingTop: 48 } },
|
|
17065
17621
|
children: [
|
|
17066
17622
|
/* @__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:
|
|
17623
|
+
/* @__PURE__ */ jsx(Tooltip, { title: _34("Save preferences"), children: /* @__PURE__ */ jsx(Button, { size: "small", icon: /* @__PURE__ */ jsx(SaveOutlined, {}), onClick: () => openSaveViewModalFor("analyze"), loading: isSavingAnalyzePrefs }) }),
|
|
17624
|
+
/* @__PURE__ */ jsx(Tooltip, { title: _34("Stats"), children: /* @__PURE__ */ jsx(Button, { size: "small", icon: /* @__PURE__ */ jsx(FileTextOutlined, {}), onClick: () => setIsStatsFlipped(true) }) }),
|
|
17625
|
+
/* @__PURE__ */ jsx(Tooltip, { title: _34("Export chart PDF"), children: /* @__PURE__ */ jsx(Button, { size: "small", icon: /* @__PURE__ */ jsx(FilePdfOutlined, {}), onClick: exportChartPdf }) }),
|
|
17626
|
+
/* @__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
17627
|
] }),
|
|
17072
17628
|
/* @__PURE__ */ jsx(
|
|
17073
17629
|
AnalysisChart,
|
|
@@ -17098,11 +17654,11 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
17098
17654
|
items: [
|
|
17099
17655
|
{
|
|
17100
17656
|
key: "configure-chart",
|
|
17101
|
-
label:
|
|
17657
|
+
label: _34("Customize chart"),
|
|
17102
17658
|
children: /* @__PURE__ */ jsxs("div", { style: { display: "grid", gap: 16 }, children: [
|
|
17103
17659
|
/* @__PURE__ */ jsxs("div", { style: { display: "flex", gap: 16, flexWrap: "wrap" }, children: [
|
|
17104
17660
|
/* @__PURE__ */ jsxs("div", { style: { minWidth: 220, flex: 1 }, children: [
|
|
17105
|
-
/* @__PURE__ */ jsx("div", { style: { fontSize: 12, color: token.colorTextSecondary, marginBottom: 4 }, children:
|
|
17661
|
+
/* @__PURE__ */ jsx("div", { style: { fontSize: 12, color: token.colorTextSecondary, marginBottom: 4 }, children: _34("Category 1") }),
|
|
17106
17662
|
/* @__PURE__ */ jsx(
|
|
17107
17663
|
Select,
|
|
17108
17664
|
{
|
|
@@ -17113,12 +17669,12 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
17113
17669
|
},
|
|
17114
17670
|
style: { width: "100%" },
|
|
17115
17671
|
options: categoricalFields.map((field) => ({ label: field.label, value: field.key })),
|
|
17116
|
-
placeholder:
|
|
17672
|
+
placeholder: _34("Select category")
|
|
17117
17673
|
}
|
|
17118
17674
|
)
|
|
17119
17675
|
] }),
|
|
17120
17676
|
/* @__PURE__ */ jsxs("div", { style: { minWidth: 220, flex: 1 }, children: [
|
|
17121
|
-
/* @__PURE__ */ jsx("div", { style: { fontSize: 12, color: token.colorTextSecondary, marginBottom: 4 }, children:
|
|
17677
|
+
/* @__PURE__ */ jsx("div", { style: { fontSize: 12, color: token.colorTextSecondary, marginBottom: 4 }, children: _34("Category 2") }),
|
|
17122
17678
|
/* @__PURE__ */ jsx(
|
|
17123
17679
|
Select,
|
|
17124
17680
|
{
|
|
@@ -17129,14 +17685,14 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
17129
17685
|
},
|
|
17130
17686
|
style: { width: "100%" },
|
|
17131
17687
|
options: [
|
|
17132
|
-
{ label:
|
|
17688
|
+
{ label: _34("None"), value: "__none__" },
|
|
17133
17689
|
...categoricalFields.filter((field) => field.key !== categoryField1).map((field) => ({ label: field.label, value: field.key }))
|
|
17134
17690
|
]
|
|
17135
17691
|
}
|
|
17136
17692
|
)
|
|
17137
17693
|
] }),
|
|
17138
17694
|
/* @__PURE__ */ jsxs("div", { style: { minWidth: 160 }, children: [
|
|
17139
|
-
/* @__PURE__ */ jsx("div", { style: { fontSize: 12, color: token.colorTextSecondary, marginBottom: 4 }, children:
|
|
17695
|
+
/* @__PURE__ */ jsx("div", { style: { fontSize: 12, color: token.colorTextSecondary, marginBottom: 4 }, children: _34("Chart Type") }),
|
|
17140
17696
|
/* @__PURE__ */ jsx(
|
|
17141
17697
|
Select,
|
|
17142
17698
|
{
|
|
@@ -17147,30 +17703,30 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
17147
17703
|
},
|
|
17148
17704
|
style: { width: "100%" },
|
|
17149
17705
|
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:
|
|
17706
|
+
{ label: _34("Area"), value: "area" },
|
|
17707
|
+
{ label: _34("Horizontal Area"), value: "area-horizontal" },
|
|
17708
|
+
{ label: _34("Bars"), value: "bar" },
|
|
17709
|
+
{ label: _34("Stacked Bars"), value: "stacked" },
|
|
17710
|
+
{ label: _34("Horizontal Bars"), value: "bar-horizontal" },
|
|
17711
|
+
{ label: _34("Horizontal Stacked"), value: "stacked-horizontal" },
|
|
17712
|
+
{ label: _34("Lines"), value: "line" },
|
|
17713
|
+
{ label: _34("Pie"), value: "pie" },
|
|
17714
|
+
{ label: _34("Donut"), value: "donut" },
|
|
17715
|
+
{ label: _34("Scatter"), value: "scatter" },
|
|
17716
|
+
{ label: _34("Bubble"), value: "bubble" },
|
|
17717
|
+
{ label: _34("Histogram"), value: "histogram" },
|
|
17718
|
+
{ label: _34("Box Plot"), value: "box" },
|
|
17719
|
+
{ label: _34("Waterfall"), value: "waterfall" },
|
|
17720
|
+
{ label: _34("Heatmap"), value: "heatmap" },
|
|
17721
|
+
{ label: _34("Crosstab"), value: "crosstab" },
|
|
17722
|
+
{ label: _34("Radar"), value: "radar" },
|
|
17723
|
+
{ label: _34("Combo (Bar + Line)"), value: "combo" }
|
|
17168
17724
|
]
|
|
17169
17725
|
}
|
|
17170
17726
|
)
|
|
17171
17727
|
] }),
|
|
17172
17728
|
/* @__PURE__ */ jsxs("div", { style: { minWidth: 200 }, children: [
|
|
17173
|
-
/* @__PURE__ */ jsx("div", { style: { fontSize: 12, color: token.colorTextSecondary, marginBottom: 4 }, children:
|
|
17729
|
+
/* @__PURE__ */ jsx("div", { style: { fontSize: 12, color: token.colorTextSecondary, marginBottom: 4 }, children: _34("Summary") }),
|
|
17174
17730
|
/* @__PURE__ */ jsx(
|
|
17175
17731
|
Select,
|
|
17176
17732
|
{
|
|
@@ -17181,18 +17737,18 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
17181
17737
|
},
|
|
17182
17738
|
style: { width: "100%" },
|
|
17183
17739
|
options: [
|
|
17184
|
-
{ label:
|
|
17185
|
-
{ label:
|
|
17186
|
-
{ label:
|
|
17187
|
-
{ label:
|
|
17188
|
-
{ label:
|
|
17189
|
-
{ label:
|
|
17740
|
+
{ label: _34("Sum"), value: "sum" },
|
|
17741
|
+
{ label: _34("Average"), value: "avg" },
|
|
17742
|
+
{ label: _34("Count"), value: "count" },
|
|
17743
|
+
{ label: _34("Max"), value: "max" },
|
|
17744
|
+
{ label: _34("Min"), value: "min" },
|
|
17745
|
+
{ label: _34("Std Dev"), value: "stddev" }
|
|
17190
17746
|
]
|
|
17191
17747
|
}
|
|
17192
17748
|
)
|
|
17193
17749
|
] }),
|
|
17194
17750
|
/* @__PURE__ */ jsxs("div", { style: { minWidth: 180 }, children: [
|
|
17195
|
-
/* @__PURE__ */ jsx("div", { style: { fontSize: 12, color: token.colorTextSecondary, marginBottom: 4 }, children:
|
|
17751
|
+
/* @__PURE__ */ jsx("div", { style: { fontSize: 12, color: token.colorTextSecondary, marginBottom: 4 }, children: _34("Ranking Filter") }),
|
|
17196
17752
|
/* @__PURE__ */ jsx(
|
|
17197
17753
|
Select,
|
|
17198
17754
|
{
|
|
@@ -17203,15 +17759,15 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
17203
17759
|
},
|
|
17204
17760
|
style: { width: "100%" },
|
|
17205
17761
|
options: [
|
|
17206
|
-
{ label:
|
|
17207
|
-
{ label:
|
|
17208
|
-
{ label:
|
|
17762
|
+
{ label: _34("None"), value: "none" },
|
|
17763
|
+
{ label: _34("Top N"), value: "top" },
|
|
17764
|
+
{ label: _34("Bottom N"), value: "bottom" }
|
|
17209
17765
|
]
|
|
17210
17766
|
}
|
|
17211
17767
|
)
|
|
17212
17768
|
] }),
|
|
17213
17769
|
/* @__PURE__ */ jsxs("div", { style: { minWidth: 220 }, children: [
|
|
17214
|
-
/* @__PURE__ */ jsx("div", { style: { fontSize: 12, color: token.colorTextSecondary, marginBottom: 4 }, children:
|
|
17770
|
+
/* @__PURE__ */ jsx("div", { style: { fontSize: 12, color: token.colorTextSecondary, marginBottom: 4 }, children: _34("Ranking Column") }),
|
|
17215
17771
|
/* @__PURE__ */ jsx(
|
|
17216
17772
|
Select,
|
|
17217
17773
|
{
|
|
@@ -17222,13 +17778,13 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
17222
17778
|
},
|
|
17223
17779
|
style: { width: "100%" },
|
|
17224
17780
|
options: numericFields.map((field) => ({ label: field.label, value: field.key })),
|
|
17225
|
-
placeholder:
|
|
17781
|
+
placeholder: _34("Select numeric column"),
|
|
17226
17782
|
disabled: rankingMode === "none" || numericFields.length === 0
|
|
17227
17783
|
}
|
|
17228
17784
|
)
|
|
17229
17785
|
] }),
|
|
17230
17786
|
/* @__PURE__ */ jsxs("div", { style: { minWidth: 120 }, children: [
|
|
17231
|
-
/* @__PURE__ */ jsx("div", { style: { fontSize: 12, color: token.colorTextSecondary, marginBottom: 4 }, children:
|
|
17787
|
+
/* @__PURE__ */ jsx("div", { style: { fontSize: 12, color: token.colorTextSecondary, marginBottom: 4 }, children: _34("N") }),
|
|
17232
17788
|
/* @__PURE__ */ jsx(
|
|
17233
17789
|
InputNumber,
|
|
17234
17790
|
{
|
|
@@ -17247,8 +17803,8 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
17247
17803
|
] }),
|
|
17248
17804
|
/* @__PURE__ */ jsxs("div", { children: [
|
|
17249
17805
|
/* @__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:
|
|
17806
|
+
/* @__PURE__ */ jsx("div", { style: { fontSize: 12, color: token.colorTextSecondary }, children: _34("Series") }),
|
|
17807
|
+
/* @__PURE__ */ jsx(Tooltip, { title: _34("Unselect All"), children: /* @__PURE__ */ jsx(
|
|
17252
17808
|
Button,
|
|
17253
17809
|
{
|
|
17254
17810
|
size: "small",
|
|
@@ -17268,11 +17824,11 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
17268
17824
|
markAnalyzePrefsTouched();
|
|
17269
17825
|
setSelectedSeriesKeys(values);
|
|
17270
17826
|
},
|
|
17271
|
-
options: numericFields.length > 0 ? numericFields.map((field) => ({ label: field.label, value: field.key })) : [{ label:
|
|
17827
|
+
options: numericFields.length > 0 ? numericFields.map((field) => ({ label: field.label, value: field.key })) : [{ label: _34("Count"), value: "__count__" }]
|
|
17272
17828
|
}
|
|
17273
17829
|
)
|
|
17274
17830
|
] }),
|
|
17275
|
-
isAllRowsLoading && /* @__PURE__ */ jsx("div", { style: { color: token.colorTextSecondary, fontSize: 12 }, children:
|
|
17831
|
+
isAllRowsLoading && /* @__PURE__ */ jsx("div", { style: { color: token.colorTextSecondary, fontSize: 12 }, children: _34("Loading all rows for analysis...") }),
|
|
17276
17832
|
allRowsError && /* @__PURE__ */ jsx("div", { style: { color: token.colorError, fontSize: 12 }, children: allRowsError })
|
|
17277
17833
|
] })
|
|
17278
17834
|
}
|
|
@@ -17295,11 +17851,11 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
17295
17851
|
styles: { body: { display: "grid", gap: 16, position: "relative", paddingTop: 48 } },
|
|
17296
17852
|
children: [
|
|
17297
17853
|
/* @__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:
|
|
17854
|
+
/* @__PURE__ */ jsx(Tooltip, { title: _34("Analysis"), children: /* @__PURE__ */ jsx(Button, { size: "small", icon: /* @__PURE__ */ jsx(BarChartOutlined, {}), onClick: () => setIsStatsFlipped(false) }) }),
|
|
17855
|
+
/* @__PURE__ */ jsx(Tooltip, { title: _34("Export stats PDF"), children: /* @__PURE__ */ jsx(Button, { size: "small", icon: /* @__PURE__ */ jsx(FilePdfOutlined, {}), onClick: exportStatsPdf }) })
|
|
17300
17856
|
] }),
|
|
17301
17857
|
/* @__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:
|
|
17858
|
+
statsSummary.numericStats.length > 0 && /* @__PURE__ */ jsx(Card, { size: "small", title: /* @__PURE__ */ jsx("span", { style: statsTitleStyle, children: _34("Numeric columns") }), children: /* @__PURE__ */ jsxs(
|
|
17303
17859
|
Table,
|
|
17304
17860
|
{
|
|
17305
17861
|
dataSource: statsSummary.numericStats,
|
|
@@ -17310,18 +17866,18 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
17310
17866
|
/* @__PURE__ */ jsx(
|
|
17311
17867
|
Table.Column,
|
|
17312
17868
|
{
|
|
17313
|
-
title:
|
|
17869
|
+
title: _34("Field"),
|
|
17314
17870
|
dataIndex: "label",
|
|
17315
17871
|
render: (label) => /* @__PURE__ */ jsx("span", { style: statsLabelStyle, children: label }),
|
|
17316
17872
|
onHeaderCell: () => ({ style: statsHeaderStyle })
|
|
17317
17873
|
},
|
|
17318
17874
|
"label"
|
|
17319
17875
|
),
|
|
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:
|
|
17876
|
+
/* @__PURE__ */ jsx(Table.Column, { title: _34("Sum"), align: "right", render: (_unused, row) => renderStatBar(row.sum, statsNumericMaxes.sum, formatNumberValue), onHeaderCell: () => ({ style: statsHeaderStyle }) }, "sum"),
|
|
17877
|
+
/* @__PURE__ */ jsx(Table.Column, { title: _34("Average"), align: "right", render: (_unused, row) => renderStatBar(row.avg, statsNumericMaxes.avg, formatNumberValue), onHeaderCell: () => ({ style: statsHeaderStyle }) }, "avg"),
|
|
17878
|
+
/* @__PURE__ */ jsx(Table.Column, { title: _34("Min"), align: "right", render: (_unused, row) => renderStatBar(row.min, statsNumericMaxes.min, formatNumberValue), onHeaderCell: () => ({ style: statsHeaderStyle }) }, "min"),
|
|
17879
|
+
/* @__PURE__ */ jsx(Table.Column, { title: _34("Max"), align: "right", render: (_unused, row) => renderStatBar(row.max, statsNumericMaxes.max, formatNumberValue), onHeaderCell: () => ({ style: statsHeaderStyle }) }, "max"),
|
|
17880
|
+
/* @__PURE__ */ jsx(Table.Column, { title: _34("Std Dev"), align: "right", render: (_unused, row) => renderStatBar(row.stddev, statsNumericMaxes.stddev, formatNumberValue), onHeaderCell: () => ({ style: statsHeaderStyle }) }, "stddev")
|
|
17325
17881
|
]
|
|
17326
17882
|
}
|
|
17327
17883
|
) }),
|
|
@@ -17333,7 +17889,7 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
17333
17889
|
items: [
|
|
17334
17890
|
{
|
|
17335
17891
|
key: "categorical-columns",
|
|
17336
|
-
label: /* @__PURE__ */ jsx("span", { style: statsTitleStyle, children:
|
|
17892
|
+
label: /* @__PURE__ */ jsx("span", { style: statsTitleStyle, children: _34("Categorical columns (distinct < 20)") }),
|
|
17337
17893
|
children: statsSummary.categoricalStats.map((field) => /* @__PURE__ */ jsxs("div", { style: { marginBottom: 12 }, children: [
|
|
17338
17894
|
/* @__PURE__ */ jsx("div", { style: { fontWeight: 600, marginBottom: 4 }, children: /* @__PURE__ */ jsx("span", { style: statsLabelStyle, children: field.label }) }),
|
|
17339
17895
|
/* @__PURE__ */ jsxs(
|
|
@@ -17344,11 +17900,11 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
17344
17900
|
pagination: false,
|
|
17345
17901
|
rowKey: (row) => row.value,
|
|
17346
17902
|
children: [
|
|
17347
|
-
/* @__PURE__ */ jsx(Table.Column, { title:
|
|
17903
|
+
/* @__PURE__ */ jsx(Table.Column, { title: _34("Value"), dataIndex: "value", onHeaderCell: () => ({ style: statsHeaderStyle }) }, "value"),
|
|
17348
17904
|
/* @__PURE__ */ jsx(
|
|
17349
17905
|
Table.Column,
|
|
17350
17906
|
{
|
|
17351
|
-
title:
|
|
17907
|
+
title: _34("Count"),
|
|
17352
17908
|
dataIndex: "count",
|
|
17353
17909
|
align: "right",
|
|
17354
17910
|
onHeaderCell: () => ({ style: statsHeaderStyle }),
|
|
@@ -17389,7 +17945,7 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
17389
17945
|
columnsToggleButton,
|
|
17390
17946
|
listToggleButton,
|
|
17391
17947
|
exportButton,
|
|
17392
|
-
renderIconOnlyButtons(defaultButtons)
|
|
17948
|
+
!model.isNamedQuery && renderIconOnlyButtons(defaultButtons)
|
|
17393
17949
|
] });
|
|
17394
17950
|
return /* @__PURE__ */ jsxs("div", { className: "jm-tone-scope", style: toneScopeStyle(modelTone), children: [
|
|
17395
17951
|
/* @__PURE__ */ jsx(ToneSharedStyles, {}),
|
|
@@ -17431,7 +17987,7 @@ function applyPanesToSearchParams(existing, panes) {
|
|
|
17431
17987
|
panes.forEach((p) => next.append("pane", `${p.resource}:${p.id}`));
|
|
17432
17988
|
return next;
|
|
17433
17989
|
}
|
|
17434
|
-
var
|
|
17990
|
+
var _35 = window._ || ((text) => text);
|
|
17435
17991
|
var LIST_PANEL_ID = "list-panel";
|
|
17436
17992
|
var detailPanelId = (idx) => `detail-panel-${idx}`;
|
|
17437
17993
|
var COLLAPSED_SIZE = 10;
|
|
@@ -17473,7 +18029,7 @@ var PaneToolbar = ({ model, pane, allModels, onClose, onMinimize, onMaximize })
|
|
|
17473
18029
|
minHeight: PANE_TOOLBAR_HEIGHT
|
|
17474
18030
|
},
|
|
17475
18031
|
children: [
|
|
17476
|
-
/* @__PURE__ */ jsx(Tooltip, { title:
|
|
18032
|
+
/* @__PURE__ */ jsx(Tooltip, { title: _35("Open in full page"), children: /* @__PURE__ */ jsx(
|
|
17477
18033
|
"a",
|
|
17478
18034
|
{
|
|
17479
18035
|
href,
|
|
@@ -17483,7 +18039,7 @@ var PaneToolbar = ({ model, pane, allModels, onClose, onMinimize, onMaximize })
|
|
|
17483
18039
|
children: /* @__PURE__ */ jsx(LinkOutlined, { style: { fontSize: 11 } })
|
|
17484
18040
|
}
|
|
17485
18041
|
) }),
|
|
17486
|
-
/* @__PURE__ */ jsx(Tooltip, { title:
|
|
18042
|
+
/* @__PURE__ */ jsx(Tooltip, { title: _35("Minimize pane"), children: /* @__PURE__ */ jsx(
|
|
17487
18043
|
Button,
|
|
17488
18044
|
{
|
|
17489
18045
|
type: "text",
|
|
@@ -17493,7 +18049,7 @@ var PaneToolbar = ({ model, pane, allModels, onClose, onMinimize, onMaximize })
|
|
|
17493
18049
|
style: { color: token.colorTextTertiary, padding: "0 4px", height: 22, minWidth: 22 }
|
|
17494
18050
|
}
|
|
17495
18051
|
) }),
|
|
17496
|
-
/* @__PURE__ */ jsx(Tooltip, { title:
|
|
18052
|
+
/* @__PURE__ */ jsx(Tooltip, { title: _35("Maximize pane"), children: /* @__PURE__ */ jsx(
|
|
17497
18053
|
Button,
|
|
17498
18054
|
{
|
|
17499
18055
|
type: "text",
|
|
@@ -17503,7 +18059,7 @@ var PaneToolbar = ({ model, pane, allModels, onClose, onMinimize, onMaximize })
|
|
|
17503
18059
|
style: { color: token.colorTextTertiary, padding: "0 4px", height: 22, minWidth: 22 }
|
|
17504
18060
|
}
|
|
17505
18061
|
) }),
|
|
17506
|
-
/* @__PURE__ */ jsx(Tooltip, { title:
|
|
18062
|
+
/* @__PURE__ */ jsx(Tooltip, { title: _35("Close pane"), children: /* @__PURE__ */ jsx(
|
|
17507
18063
|
Button,
|
|
17508
18064
|
{
|
|
17509
18065
|
type: "text",
|
|
@@ -17668,7 +18224,7 @@ var MultiPaneLayout = ({ children }) => {
|
|
|
17668
18224
|
[openDetail]
|
|
17669
18225
|
);
|
|
17670
18226
|
const detailPaneContexts = useMemo(
|
|
17671
|
-
() => panes.map((
|
|
18227
|
+
() => panes.map((_41, idx) => ({
|
|
17672
18228
|
isInMultiPane: true,
|
|
17673
18229
|
paneIndex: idx + 1,
|
|
17674
18230
|
openDetail: (resource, id) => openDetail(idx + 1, resource, id)
|
|
@@ -17729,7 +18285,7 @@ var MultiPaneLayout = ({ children }) => {
|
|
|
17729
18285
|
) });
|
|
17730
18286
|
};
|
|
17731
18287
|
var { Title: Title8 } = Typography;
|
|
17732
|
-
var
|
|
18288
|
+
var _36 = window._ || ((text) => text);
|
|
17733
18289
|
var HierarchyView = ({ resource, recordId, fallback }) => {
|
|
17734
18290
|
const go = useGo();
|
|
17735
18291
|
const { data: ancestorsData, isLoading: ancestorsLoading, error: ancestorsError } = useCustom({
|
|
@@ -17782,15 +18338,15 @@ var HierarchyView = ({ resource, recordId, fallback }) => {
|
|
|
17782
18338
|
}
|
|
17783
18339
|
if (ancestorsError || descendantsError) {
|
|
17784
18340
|
if (fallback) return /* @__PURE__ */ jsx(Fragment, { children: fallback });
|
|
17785
|
-
return /* @__PURE__ */ jsx(Alert, { message:
|
|
18341
|
+
return /* @__PURE__ */ jsx(Alert, { message: _36("Error loading hierarchy data"), type: "error" });
|
|
17786
18342
|
}
|
|
17787
18343
|
return /* @__PURE__ */ jsxs("div", { children: [
|
|
17788
18344
|
ancestorsList.length > 0 && /* @__PURE__ */ jsxs("div", { style: { marginBottom: 24 }, children: [
|
|
17789
|
-
/* @__PURE__ */ jsx(Title8, { level: 5, children:
|
|
18345
|
+
/* @__PURE__ */ jsx(Title8, { level: 5, children: _36("Parent Hierarchy") }),
|
|
17790
18346
|
/* @__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
18347
|
] }),
|
|
17792
18348
|
treeData.length > 0 && /* @__PURE__ */ jsxs("div", { children: [
|
|
17793
|
-
/* @__PURE__ */ jsx(Title8, { level: 5, children:
|
|
18349
|
+
/* @__PURE__ */ jsx(Title8, { level: 5, children: _36("Sub-hierarchy") }),
|
|
17794
18350
|
/* @__PURE__ */ jsx(
|
|
17795
18351
|
Tree,
|
|
17796
18352
|
{
|
|
@@ -17862,7 +18418,7 @@ var TOKEN_KEY2 = "jm_access_token";
|
|
|
17862
18418
|
var USER_KEY2 = "jm_user";
|
|
17863
18419
|
var ROLE_PERMISSIONS_KEY = "jm_role_permissions";
|
|
17864
18420
|
var RESOURCE_PERMISSIONS_KEY = "jm_resource_permissions";
|
|
17865
|
-
var
|
|
18421
|
+
var _37 = window._ || ((text) => text);
|
|
17866
18422
|
var authProvider = {
|
|
17867
18423
|
/**
|
|
17868
18424
|
* Authenticate by username + password.
|
|
@@ -17880,8 +18436,8 @@ var authProvider = {
|
|
|
17880
18436
|
return {
|
|
17881
18437
|
success: false,
|
|
17882
18438
|
error: {
|
|
17883
|
-
name:
|
|
17884
|
-
message: body?.detail ||
|
|
18439
|
+
name: _37("Login failed"),
|
|
18440
|
+
message: body?.detail || _37("Invalid credentials")
|
|
17885
18441
|
}
|
|
17886
18442
|
};
|
|
17887
18443
|
}
|
|
@@ -17913,8 +18469,8 @@ var authProvider = {
|
|
|
17913
18469
|
return {
|
|
17914
18470
|
success: false,
|
|
17915
18471
|
error: {
|
|
17916
|
-
name:
|
|
17917
|
-
message: err?.message ||
|
|
18472
|
+
name: _37("Login failed"),
|
|
18473
|
+
message: err?.message || _37("Network error")
|
|
17918
18474
|
}
|
|
17919
18475
|
};
|
|
17920
18476
|
}
|
|
@@ -17995,7 +18551,7 @@ var authProvider = {
|
|
|
17995
18551
|
var USER_KEY3 = "jm_user";
|
|
17996
18552
|
var ROLE_PERMISSIONS_KEY2 = "jm_role_permissions";
|
|
17997
18553
|
var RESOURCE_PERMISSIONS_KEY2 = "jm_resource_permissions";
|
|
17998
|
-
var
|
|
18554
|
+
var _38 = window._ || ((text) => text);
|
|
17999
18555
|
var FALLBACK_ROLE_ACTIONS = {
|
|
18000
18556
|
Admin: ["list", "show", "create", "edit", "delete", "clone", "field"],
|
|
18001
18557
|
Manager: ["list", "show", "create", "edit", "clone", "field"],
|
|
@@ -18027,13 +18583,13 @@ var accessControlProvider = {
|
|
|
18027
18583
|
can: async ({ action, resource }) => {
|
|
18028
18584
|
const cached = localStorage.getItem(USER_KEY3);
|
|
18029
18585
|
if (!cached) {
|
|
18030
|
-
return { can: false, reason:
|
|
18586
|
+
return { can: false, reason: _38("Not authenticated") };
|
|
18031
18587
|
}
|
|
18032
18588
|
let user;
|
|
18033
18589
|
try {
|
|
18034
18590
|
user = JSON.parse(cached);
|
|
18035
18591
|
} catch {
|
|
18036
|
-
return { can: false, reason:
|
|
18592
|
+
return { can: false, reason: _38("Not authenticated") };
|
|
18037
18593
|
}
|
|
18038
18594
|
const roles = user?.roles ?? [];
|
|
18039
18595
|
if (roles.some((r) => r.toLowerCase() === "admin")) {
|
|
@@ -18059,7 +18615,7 @@ var accessControlProvider = {
|
|
|
18059
18615
|
}
|
|
18060
18616
|
return {
|
|
18061
18617
|
can: false,
|
|
18062
|
-
reason:
|
|
18618
|
+
reason: _38("Access denied \u2014 insufficient role for this action")
|
|
18063
18619
|
};
|
|
18064
18620
|
},
|
|
18065
18621
|
options: {
|
|
@@ -18147,7 +18703,7 @@ var ResourceContext = createContext({
|
|
|
18147
18703
|
allResources: [],
|
|
18148
18704
|
allSystemModels: []
|
|
18149
18705
|
});
|
|
18150
|
-
var
|
|
18706
|
+
var _39 = window._ || ((text) => text);
|
|
18151
18707
|
var LoginPage = ({ appTitle = "VeloIQ", logo }) => {
|
|
18152
18708
|
const { mutate: login, isLoading, error } = useLogin();
|
|
18153
18709
|
const [form] = Form.useForm();
|
|
@@ -18176,14 +18732,14 @@ var LoginPage = ({ appTitle = "VeloIQ", logo }) => {
|
|
|
18176
18732
|
/* @__PURE__ */ jsxs("div", { style: { textAlign: "center" }, children: [
|
|
18177
18733
|
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
18734
|
/* @__PURE__ */ jsx(Typography.Title, { level: 3, style: { marginBottom: 4 }, children: appTitle }),
|
|
18179
|
-
/* @__PURE__ */ jsx(Typography.Text, { type: "secondary", children:
|
|
18735
|
+
/* @__PURE__ */ jsx(Typography.Text, { type: "secondary", children: _39("Sign in to your account") })
|
|
18180
18736
|
] }),
|
|
18181
18737
|
error && /* @__PURE__ */ jsx(
|
|
18182
18738
|
Alert,
|
|
18183
18739
|
{
|
|
18184
18740
|
type: "error",
|
|
18185
|
-
message: error?.name ||
|
|
18186
|
-
description: error?.message ||
|
|
18741
|
+
message: error?.name || _39("Login failed"),
|
|
18742
|
+
description: error?.message || _39("Invalid credentials"),
|
|
18187
18743
|
showIcon: true
|
|
18188
18744
|
}
|
|
18189
18745
|
),
|
|
@@ -18199,13 +18755,13 @@ var LoginPage = ({ appTitle = "VeloIQ", logo }) => {
|
|
|
18199
18755
|
Form.Item,
|
|
18200
18756
|
{
|
|
18201
18757
|
name: "username",
|
|
18202
|
-
label:
|
|
18203
|
-
rules: [{ required: true, message:
|
|
18758
|
+
label: _39("Username"),
|
|
18759
|
+
rules: [{ required: true, message: _39("Please enter your username") }],
|
|
18204
18760
|
children: /* @__PURE__ */ jsx(
|
|
18205
18761
|
Input,
|
|
18206
18762
|
{
|
|
18207
18763
|
prefix: /* @__PURE__ */ jsx(UserOutlined, {}),
|
|
18208
|
-
placeholder:
|
|
18764
|
+
placeholder: _39("Username"),
|
|
18209
18765
|
size: "large"
|
|
18210
18766
|
}
|
|
18211
18767
|
)
|
|
@@ -18215,13 +18771,13 @@ var LoginPage = ({ appTitle = "VeloIQ", logo }) => {
|
|
|
18215
18771
|
Form.Item,
|
|
18216
18772
|
{
|
|
18217
18773
|
name: "password",
|
|
18218
|
-
label:
|
|
18219
|
-
rules: [{ required: true, message:
|
|
18774
|
+
label: _39("Password"),
|
|
18775
|
+
rules: [{ required: true, message: _39("Please enter your password") }],
|
|
18220
18776
|
children: /* @__PURE__ */ jsx(
|
|
18221
18777
|
Input.Password,
|
|
18222
18778
|
{
|
|
18223
18779
|
prefix: /* @__PURE__ */ jsx(LockOutlined, {}),
|
|
18224
|
-
placeholder:
|
|
18780
|
+
placeholder: _39("Password"),
|
|
18225
18781
|
size: "large"
|
|
18226
18782
|
}
|
|
18227
18783
|
)
|
|
@@ -18235,7 +18791,7 @@ var LoginPage = ({ appTitle = "VeloIQ", logo }) => {
|
|
|
18235
18791
|
loading: isLoading,
|
|
18236
18792
|
block: true,
|
|
18237
18793
|
size: "large",
|
|
18238
|
-
children:
|
|
18794
|
+
children: _39("Login")
|
|
18239
18795
|
}
|
|
18240
18796
|
) })
|
|
18241
18797
|
]
|
|
@@ -18374,6 +18930,7 @@ var CellConfigDrawer = ({ open, cell, tabId, config, onClose, onSave }) => {
|
|
|
18374
18930
|
onSave({ ...config, tabs: nextTabs });
|
|
18375
18931
|
onClose();
|
|
18376
18932
|
};
|
|
18933
|
+
const tabOptions = config.tabs.map((t) => ({ value: t.name, label: t.name }));
|
|
18377
18934
|
return /* @__PURE__ */ jsx(
|
|
18378
18935
|
Drawer,
|
|
18379
18936
|
{
|
|
@@ -18388,7 +18945,14 @@ var CellConfigDrawer = ({ open, cell, tabId, config, onClose, onSave }) => {
|
|
|
18388
18945
|
] }),
|
|
18389
18946
|
children: /* @__PURE__ */ jsxs(Form, { form, layout: "vertical", size: "small", children: [
|
|
18390
18947
|
/* @__PURE__ */ jsx(Divider, { orientation: "left", children: "Tab" }),
|
|
18391
|
-
/* @__PURE__ */ jsx(Form.Item, { name: "tabName", label: "Tab name", children: /* @__PURE__ */ jsx(
|
|
18948
|
+
/* @__PURE__ */ jsx(Form.Item, { name: "tabName", label: "Tab name", children: /* @__PURE__ */ jsx(
|
|
18949
|
+
AutoComplete,
|
|
18950
|
+
{
|
|
18951
|
+
options: tabOptions,
|
|
18952
|
+
filterOption: false,
|
|
18953
|
+
placeholder: "Select existing or type a new name"
|
|
18954
|
+
}
|
|
18955
|
+
) }),
|
|
18392
18956
|
/* @__PURE__ */ jsx(Divider, { orientation: "left", children: "Position" }),
|
|
18393
18957
|
/* @__PURE__ */ jsxs(Space, { children: [
|
|
18394
18958
|
/* @__PURE__ */ jsx(Form.Item, { name: "row", label: "Row", style: { marginBottom: 0 }, children: /* @__PURE__ */ jsx(InputNumber, { min: 1, style: { width: 80 } }) }),
|
|
@@ -18428,10 +18992,12 @@ var CellConfigDrawer = ({ open, cell, tabId, config, onClose, onSave }) => {
|
|
|
18428
18992
|
}
|
|
18429
18993
|
);
|
|
18430
18994
|
};
|
|
18431
|
-
var DashboardGridCell = ({ cell, allModels, isMaximized, isMinimized, onConfigure, onMaximize, onMinimize }) => {
|
|
18995
|
+
var DashboardGridCell = ({ cell, allModels, isMaximized, isMinimized, onConfigure, onMaximize, onMinimize, onResize }) => {
|
|
18432
18996
|
const { token } = theme.useToken();
|
|
18433
18997
|
const model = findModelByName(allModels, cell.model);
|
|
18998
|
+
const cellRef = useRef(null);
|
|
18434
18999
|
const cellStyle = {
|
|
19000
|
+
position: "relative",
|
|
18435
19001
|
border: `1px solid ${token.colorBorderSecondary}`,
|
|
18436
19002
|
borderRadius: token.borderRadiusLG,
|
|
18437
19003
|
overflow: "hidden",
|
|
@@ -18460,20 +19026,81 @@ var DashboardGridCell = ({ cell, allModels, isMaximized, isMinimized, onConfigur
|
|
|
18460
19026
|
};
|
|
18461
19027
|
const resource = model?.resource || cell.model;
|
|
18462
19028
|
const cellTitle = model?.label || cell.model;
|
|
18463
|
-
|
|
19029
|
+
const tone = model ? getModelTone(model) : null;
|
|
19030
|
+
const startResize = useCallback((e, dir) => {
|
|
19031
|
+
e.preventDefault();
|
|
19032
|
+
e.stopPropagation();
|
|
19033
|
+
const el = cellRef.current;
|
|
19034
|
+
if (!el) return;
|
|
19035
|
+
const { width: startW, height: startH } = el.getBoundingClientRect();
|
|
19036
|
+
const startX = e.clientX;
|
|
19037
|
+
const startY = e.clientY;
|
|
19038
|
+
const handle = e.currentTarget;
|
|
19039
|
+
handle.setPointerCapture(e.pointerId);
|
|
19040
|
+
const prevCursor = document.body.style.cursor;
|
|
19041
|
+
document.body.style.cursor = dir === "s" ? "ns-resize" : dir === "e" ? "ew-resize" : "nwse-resize";
|
|
19042
|
+
const onMove = (ev) => {
|
|
19043
|
+
if (dir !== "e") el.style.minHeight = `${Math.max(200, Math.round(startH + ev.clientY - startY))}px`;
|
|
19044
|
+
if (dir !== "s") el.style.minWidth = `${Math.max(200, Math.round(startW + ev.clientX - startX))}px`;
|
|
19045
|
+
};
|
|
19046
|
+
const onUp = (ev) => {
|
|
19047
|
+
handle.removeEventListener("pointermove", onMove);
|
|
19048
|
+
handle.removeEventListener("pointerup", onUp);
|
|
19049
|
+
document.body.style.cursor = prevCursor;
|
|
19050
|
+
const newH = dir !== "e" ? `${Math.max(200, Math.round(startH + ev.clientY - startY))}px` : null;
|
|
19051
|
+
const newW = dir !== "s" ? `${Math.max(200, Math.round(startW + ev.clientX - startX))}px` : null;
|
|
19052
|
+
onResize(newW, newH);
|
|
19053
|
+
};
|
|
19054
|
+
handle.addEventListener("pointermove", onMove);
|
|
19055
|
+
handle.addEventListener("pointerup", onUp);
|
|
19056
|
+
}, [onResize]);
|
|
19057
|
+
const handleBase = {
|
|
19058
|
+
position: "absolute",
|
|
19059
|
+
zIndex: 10
|
|
19060
|
+
};
|
|
19061
|
+
return /* @__PURE__ */ jsxs("div", { ref: cellRef, style: cellStyle, className: "jm-dashboard-cell", children: [
|
|
18464
19062
|
/* @__PURE__ */ jsx("style", { children: `
|
|
18465
|
-
.jm-dashboard-cell .jm-cell-actions
|
|
18466
|
-
.jm-dashboard-cell:hover .jm-cell-actions
|
|
19063
|
+
.jm-dashboard-cell .jm-cell-actions { opacity: 0; transition: opacity 0.15s; }
|
|
19064
|
+
.jm-dashboard-cell:hover .jm-cell-actions { opacity: 1; }
|
|
19065
|
+
.jm-dashboard-cell .jm-resize-handle { opacity: 0; transition: opacity 0.15s; background: transparent; }
|
|
19066
|
+
.jm-dashboard-cell:hover .jm-resize-handle { opacity: 1; }
|
|
19067
|
+
.jm-resize-handle:hover { background: rgba(128,128,128,0.25) !important; }
|
|
19068
|
+
.jm-resize-handle:active { background: rgba(128,128,128,0.45) !important; }
|
|
18467
19069
|
` }),
|
|
19070
|
+
/* @__PURE__ */ jsx(
|
|
19071
|
+
"div",
|
|
19072
|
+
{
|
|
19073
|
+
className: "jm-resize-handle",
|
|
19074
|
+
style: { ...handleBase, bottom: 0, left: 12, right: 12, height: 6, cursor: "ns-resize" },
|
|
19075
|
+
onPointerDown: (e) => startResize(e, "s")
|
|
19076
|
+
}
|
|
19077
|
+
),
|
|
19078
|
+
/* @__PURE__ */ jsx(
|
|
19079
|
+
"div",
|
|
19080
|
+
{
|
|
19081
|
+
className: "jm-resize-handle",
|
|
19082
|
+
style: { ...handleBase, top: 12, right: 0, bottom: 12, width: 6, cursor: "ew-resize" },
|
|
19083
|
+
onPointerDown: (e) => startResize(e, "e")
|
|
19084
|
+
}
|
|
19085
|
+
),
|
|
19086
|
+
/* @__PURE__ */ jsx(
|
|
19087
|
+
"div",
|
|
19088
|
+
{
|
|
19089
|
+
className: "jm-resize-handle",
|
|
19090
|
+
style: { ...handleBase, bottom: 0, right: 0, width: 12, height: 12, cursor: "nwse-resize", borderRadius: `0 0 ${token.borderRadiusLG}px 0` },
|
|
19091
|
+
onPointerDown: (e) => startResize(e, "se")
|
|
19092
|
+
}
|
|
19093
|
+
),
|
|
18468
19094
|
/* @__PURE__ */ jsxs("div", { style: toolbarStyle, children: [
|
|
18469
19095
|
/* @__PURE__ */ jsx("span", { style: {
|
|
18470
|
-
fontSize:
|
|
18471
|
-
fontWeight:
|
|
18472
|
-
color: token.colorText,
|
|
19096
|
+
fontSize: 14,
|
|
19097
|
+
fontWeight: 700,
|
|
19098
|
+
color: tone ? tone.solid : token.colorText,
|
|
18473
19099
|
paddingLeft: 4,
|
|
18474
19100
|
overflow: "hidden",
|
|
18475
19101
|
textOverflow: "ellipsis",
|
|
18476
|
-
whiteSpace: "nowrap"
|
|
19102
|
+
whiteSpace: "nowrap",
|
|
19103
|
+
letterSpacing: "-0.01em"
|
|
18477
19104
|
}, children: cellTitle }),
|
|
18478
19105
|
/* @__PURE__ */ jsxs("div", { className: "jm-cell-actions", style: { display: "flex", alignItems: "center", gap: 2 }, children: [
|
|
18479
19106
|
/* @__PURE__ */ jsx(Tooltip, { title: "Configure cell", children: /* @__PURE__ */ jsx(
|
|
@@ -18516,9 +19143,10 @@ var DashboardGridCell = ({ cell, allModels, isMaximized, isMinimized, onConfigur
|
|
|
18516
19143
|
allModels,
|
|
18517
19144
|
isEmbedded: true,
|
|
18518
19145
|
preferencesResourceOverride: `dashboard:${resource}`,
|
|
18519
|
-
defaultListVisible:
|
|
19146
|
+
defaultListVisible: Boolean(cell.view_type),
|
|
18520
19147
|
listViewType: cell.view_type ? cell.view_type : model.listViewType
|
|
18521
|
-
}
|
|
19148
|
+
},
|
|
19149
|
+
`${resource}-${cell.view_type ?? ""}`
|
|
18522
19150
|
) : /* @__PURE__ */ jsx(
|
|
18523
19151
|
Empty,
|
|
18524
19152
|
{
|
|
@@ -18529,7 +19157,7 @@ var DashboardGridCell = ({ cell, allModels, isMaximized, isMinimized, onConfigur
|
|
|
18529
19157
|
) })
|
|
18530
19158
|
] });
|
|
18531
19159
|
};
|
|
18532
|
-
var DashboardTabContent = ({ tab, allModels, maximizedCellId, minimizedCellIds, onMaximize, onMinimize, onConfigure }) => {
|
|
19160
|
+
var DashboardTabContent = ({ tab, allModels, maximizedCellId, minimizedCellIds, onMaximize, onMinimize, onConfigure, onResize }) => {
|
|
18533
19161
|
const cells = tab.cells;
|
|
18534
19162
|
const numCols = useMemo(() => {
|
|
18535
19163
|
if (!cells.length) return 2;
|
|
@@ -18568,7 +19196,8 @@ var DashboardTabContent = ({ tab, allModels, maximizedCellId, minimizedCellIds,
|
|
|
18568
19196
|
isMinimized: minimizedCellIds.has(cell.id),
|
|
18569
19197
|
onConfigure: () => onConfigure(cell),
|
|
18570
19198
|
onMaximize: () => onMaximize(cell.id),
|
|
18571
|
-
onMinimize: () => onMinimize(cell.id)
|
|
19199
|
+
onMinimize: () => onMinimize(cell.id),
|
|
19200
|
+
onResize: (w, h) => onResize(cell.id, w, h)
|
|
18572
19201
|
}
|
|
18573
19202
|
)
|
|
18574
19203
|
},
|
|
@@ -18600,6 +19229,23 @@ var ViewsGrid = ({ config, allModels, onConfigChange }) => {
|
|
|
18600
19229
|
onConfigChange(nextConfig);
|
|
18601
19230
|
setDrawerSelection(null);
|
|
18602
19231
|
}, [onConfigChange]);
|
|
19232
|
+
const handleResizeCell = useCallback((tabId, cellId, minWidth, minHeight) => {
|
|
19233
|
+
const nextTabs = config.tabs.map((tab) => {
|
|
19234
|
+
if (tab.id !== tabId) return tab;
|
|
19235
|
+
return {
|
|
19236
|
+
...tab,
|
|
19237
|
+
cells: tab.cells.map((c) => {
|
|
19238
|
+
if (c.id !== cellId) return c;
|
|
19239
|
+
return {
|
|
19240
|
+
...c,
|
|
19241
|
+
...minWidth !== null ? { min_width: minWidth } : {},
|
|
19242
|
+
...minHeight !== null ? { min_height: minHeight } : {}
|
|
19243
|
+
};
|
|
19244
|
+
})
|
|
19245
|
+
};
|
|
19246
|
+
});
|
|
19247
|
+
onConfigChange({ ...config, tabs: nextTabs });
|
|
19248
|
+
}, [config, onConfigChange]);
|
|
18603
19249
|
const tabItems = useMemo(
|
|
18604
19250
|
() => config.tabs.map((tab) => ({
|
|
18605
19251
|
key: tab.id,
|
|
@@ -18613,11 +19259,12 @@ var ViewsGrid = ({ config, allModels, onConfigChange }) => {
|
|
|
18613
19259
|
minimizedCellIds,
|
|
18614
19260
|
onMaximize: handleMaximize,
|
|
18615
19261
|
onMinimize: handleMinimize,
|
|
18616
|
-
onConfigure: (cell) => handleOpenDrawer(tab.id, cell)
|
|
19262
|
+
onConfigure: (cell) => handleOpenDrawer(tab.id, cell),
|
|
19263
|
+
onResize: (cellId, w, h) => handleResizeCell(tab.id, cellId, w, h)
|
|
18617
19264
|
}
|
|
18618
19265
|
)
|
|
18619
19266
|
})),
|
|
18620
|
-
[config.tabs, allModels, maximizedCellId, minimizedCellIds, handleMaximize, handleMinimize, handleOpenDrawer]
|
|
19267
|
+
[config.tabs, allModels, maximizedCellId, minimizedCellIds, handleMaximize, handleMinimize, handleOpenDrawer, handleResizeCell]
|
|
18621
19268
|
);
|
|
18622
19269
|
if (!config.tabs.length) {
|
|
18623
19270
|
return /* @__PURE__ */ jsx(Empty, { description: "No tabs configured. Run veloiq add-dashboard to add models.", style: { padding: 48 } });
|
|
@@ -18656,7 +19303,7 @@ function parseInlineStyle3(cssText) {
|
|
|
18656
19303
|
const prop = declaration.slice(0, idx).trim();
|
|
18657
19304
|
const value = declaration.slice(idx + 1).trim();
|
|
18658
19305
|
if (!prop || !value) return;
|
|
18659
|
-
const camel = prop.replace(/-([a-z])/g, (
|
|
19306
|
+
const camel = prop.replace(/-([a-z])/g, (_41, c) => c.toUpperCase());
|
|
18660
19307
|
result[camel] = value;
|
|
18661
19308
|
});
|
|
18662
19309
|
return result;
|
|
@@ -18681,7 +19328,7 @@ function useRecentActivity(days) {
|
|
|
18681
19328
|
return { data, loading, reload: load };
|
|
18682
19329
|
}
|
|
18683
19330
|
var { Text: Text2, Title: Title9 } = Typography;
|
|
18684
|
-
function
|
|
19331
|
+
function relativeTime2(iso) {
|
|
18685
19332
|
if (!iso) return "";
|
|
18686
19333
|
const diff = Date.now() - new Date(iso).getTime();
|
|
18687
19334
|
const mins = Math.floor(diff / 6e4);
|
|
@@ -18790,7 +19437,7 @@ var RecentActivityPanel = () => {
|
|
|
18790
19437
|
}
|
|
18791
19438
|
),
|
|
18792
19439
|
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:
|
|
19440
|
+
/* @__PURE__ */ jsx(Text2, { type: "secondary", style: { fontSize: 11, flexShrink: 0 }, children: relativeTime2(timestamp) })
|
|
18794
19441
|
] })
|
|
18795
19442
|
]
|
|
18796
19443
|
}
|
|
@@ -18956,7 +19603,7 @@ var PinnedRecordsPanel = () => {
|
|
|
18956
19603
|
] });
|
|
18957
19604
|
};
|
|
18958
19605
|
var { Text: Text3 } = Typography;
|
|
18959
|
-
var
|
|
19606
|
+
var _40 = window._ || ((text) => text);
|
|
18960
19607
|
var DashboardPage = () => {
|
|
18961
19608
|
const { token } = theme.useToken();
|
|
18962
19609
|
const allModels = useAllModels();
|
|
@@ -18985,7 +19632,7 @@ var DashboardPage = () => {
|
|
|
18985
19632
|
const tabs = [
|
|
18986
19633
|
{
|
|
18987
19634
|
key: "models_grid",
|
|
18988
|
-
label:
|
|
19635
|
+
label: _40("Models Grid"),
|
|
18989
19636
|
children: /* @__PURE__ */ jsx("div", { style: { height: "calc(100vh - 140px)", overflow: "auto" }, children: /* @__PURE__ */ jsx(
|
|
18990
19637
|
ViewsGrid,
|
|
18991
19638
|
{
|
|
@@ -18997,12 +19644,12 @@ var DashboardPage = () => {
|
|
|
18997
19644
|
},
|
|
18998
19645
|
{
|
|
18999
19646
|
key: "recent_activity",
|
|
19000
|
-
label:
|
|
19647
|
+
label: _40("Recent Activity"),
|
|
19001
19648
|
children: /* @__PURE__ */ jsx("div", { style: { height: "calc(100vh - 140px)", overflow: "auto", padding: "0 12px" }, children: /* @__PURE__ */ jsx(RecentActivityPanel, {}) })
|
|
19002
19649
|
},
|
|
19003
19650
|
{
|
|
19004
19651
|
key: "pinned_records",
|
|
19005
|
-
label:
|
|
19652
|
+
label: _40("Pinned Records"),
|
|
19006
19653
|
children: /* @__PURE__ */ jsx("div", { style: { height: "calc(100vh - 140px)", overflow: "auto", padding: "0 12px" }, children: /* @__PURE__ */ jsx(PinnedRecordsPanel, {}) })
|
|
19007
19654
|
}
|
|
19008
19655
|
];
|