@dashboard-designer/ui 0.2.4 → 0.2.5
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.ts +15 -17
- package/dist/index.js +1239 -895
- package/dist/styles.css +12 -0
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// src/designer/DashboardDesigner.tsx
|
|
2
2
|
import { resolvePrintHeader } from "@dashboard-designer/core";
|
|
3
|
-
import { connectionVariableNames as connectionVariableNames2 } from "@dashboard-designer/core";
|
|
3
|
+
import { connectionVariableNames as connectionVariableNames2, isSafeHyperlink, openHyperlink as openHyperlink2 } from "@dashboard-designer/core";
|
|
4
4
|
|
|
5
5
|
// src/components/PrintOptionsDialog.tsx
|
|
6
6
|
import { useEffect, useRef, useState } from "react";
|
|
@@ -1057,7 +1057,7 @@ function FilterBar({
|
|
|
1057
1057
|
}
|
|
1058
1058
|
|
|
1059
1059
|
// src/designer/DashboardDesigner.tsx
|
|
1060
|
-
import
|
|
1060
|
+
import React25, { useCallback as useCallback3, useEffect as useEffect21, useMemo as useMemo12, useState as useState22 } from "react";
|
|
1061
1061
|
|
|
1062
1062
|
// src/charts/localTimestamp.ts
|
|
1063
1063
|
function formatLocalTimestamp(value, locale) {
|
|
@@ -1355,7 +1355,7 @@ function chartPopupData(data, dimension, value, selectedColumns) {
|
|
|
1355
1355
|
|
|
1356
1356
|
// src/designer/DashboardDesigner.tsx
|
|
1357
1357
|
import GridLayout from "react-grid-layout";
|
|
1358
|
-
import { useTranslation as
|
|
1358
|
+
import { useTranslation as useTranslation21 } from "react-i18next";
|
|
1359
1359
|
import {
|
|
1360
1360
|
ArrowUpLeft,
|
|
1361
1361
|
Download,
|
|
@@ -1861,8 +1861,25 @@ var resources = {
|
|
|
1861
1861
|
labelClickUrl: "Open URL",
|
|
1862
1862
|
helpLabelClickAction: "What happens when the user clicks the label on the dashboard.",
|
|
1863
1863
|
labelClickUrlField: "URL",
|
|
1864
|
-
helpLabelClickUrl: "Web address opened when the label is clicked.",
|
|
1864
|
+
helpLabelClickUrl: "Web address opened when the label is clicked. Use {{varToken}} to build it from a variable, e.g. a base URL supplied by the host app.",
|
|
1865
1865
|
labelClickUrlNewTab: "Open in new tab",
|
|
1866
|
+
hyperlinkEnable: "Hyperlink",
|
|
1867
|
+
helpHyperlink: "Open a web page, another report or a record when a chart item, table row, KPI or timeline stage is clicked. The address can be built from variables and the clicked row.",
|
|
1868
|
+
hyperlinkUrl: "Link URL",
|
|
1869
|
+
helpHyperlinkUrl: "Use {{varToken}} for a variable, {{fieldToken}} for a column of the clicked row and {{valueToken}} for the clicked value. A token at the start is used as-is (e.g. a base URL variable); later tokens are URL-encoded.",
|
|
1870
|
+
hyperlinkColumn: "Link column",
|
|
1871
|
+
helpHyperlinkColumn: "Show this column as links. Leave empty to make the whole row clickable.",
|
|
1872
|
+
hyperlinkWholeRow: "Whole row",
|
|
1873
|
+
hyperlinkInsertVariable: "Insert variable\u2026",
|
|
1874
|
+
hyperlinkInsertField: "Insert field\u2026",
|
|
1875
|
+
hyperlinkClickedValue: "Clicked value",
|
|
1876
|
+
hyperlinkUnknownVariable: "Unknown variable: {{names}}. Define it under Variables or have the host app supply it.",
|
|
1877
|
+
hyperlinkUnsetVariable: "No preview value for: {{names}}. The link works once the host app supplies it.",
|
|
1878
|
+
hyperlinkOverridesDrill: "When a hyperlink is set, it is used instead of dashboard drill-down.",
|
|
1879
|
+
hyperlinkClickHint: "Click to open link",
|
|
1880
|
+
hyperlinkBlocked: "This link uses a blocked URL scheme.",
|
|
1881
|
+
labelLinkUrl: "Link URL (optional)",
|
|
1882
|
+
helpLabelContainerUrl: "Opens this address instead of a dashboard. Supports {{varToken}}, {{valueToken}} (label text) and, for query labels, {{fieldToken}}.",
|
|
1866
1883
|
helpLabelClickUrlNewTab: "When enabled, the URL opens in a new browser tab.",
|
|
1867
1884
|
labelUrlPreview: "Preview: click would open {{url}}.",
|
|
1868
1885
|
labelDrillPreview: "Preview: click would open \u201C{{target}}\u201D.",
|
|
@@ -2301,8 +2318,25 @@ var resources = {
|
|
|
2301
2318
|
labelClickUrl: "Abrir URL",
|
|
2302
2319
|
helpLabelClickAction: "Qu\xE9 ocurre cuando el usuario hace clic en la etiqueta en el panel.",
|
|
2303
2320
|
labelClickUrlField: "URL",
|
|
2304
|
-
helpLabelClickUrl: "Direcci\xF3n web que se abre al hacer clic en la etiqueta.",
|
|
2321
|
+
helpLabelClickUrl: "Direcci\xF3n web que se abre al hacer clic en la etiqueta. Use {{varToken}} para construirla con una variable, p. ej. una URL base de la aplicaci\xF3n.",
|
|
2305
2322
|
labelClickUrlNewTab: "Abrir en nueva pesta\xF1a",
|
|
2323
|
+
hyperlinkEnable: "Hiperv\xEDnculo",
|
|
2324
|
+
helpHyperlink: "Abre una p\xE1gina web, otro informe o un registro al hacer clic en un elemento del gr\xE1fico, una fila, un KPI o una etapa. La direcci\xF3n puede construirse con variables y la fila pulsada.",
|
|
2325
|
+
hyperlinkUrl: "URL del enlace",
|
|
2326
|
+
helpHyperlinkUrl: "Use {{varToken}} para una variable, {{fieldToken}} para una columna de la fila pulsada y {{valueToken}} para el valor pulsado. Un token al inicio se usa tal cual (p. ej. una variable con la URL base); los dem\xE1s se codifican.",
|
|
2327
|
+
hyperlinkColumn: "Columna de enlace",
|
|
2328
|
+
helpHyperlinkColumn: "Muestra esta columna como enlaces. D\xE9jela vac\xEDa para que toda la fila sea clicable.",
|
|
2329
|
+
hyperlinkWholeRow: "Toda la fila",
|
|
2330
|
+
hyperlinkInsertVariable: "Insertar variable\u2026",
|
|
2331
|
+
hyperlinkInsertField: "Insertar campo\u2026",
|
|
2332
|
+
hyperlinkClickedValue: "Valor pulsado",
|
|
2333
|
+
hyperlinkUnknownVariable: "Variable desconocida: {{names}}. Def\xEDnala en Variables o haga que la aplicaci\xF3n la proporcione.",
|
|
2334
|
+
hyperlinkUnsetVariable: "Sin valor de vista previa para: {{names}}. El enlace funcionar\xE1 cuando la aplicaci\xF3n lo proporcione.",
|
|
2335
|
+
hyperlinkOverridesDrill: "Si hay un hiperv\xEDnculo, se usa en lugar del desglose a otro panel.",
|
|
2336
|
+
hyperlinkClickHint: "Clic para abrir el enlace",
|
|
2337
|
+
hyperlinkBlocked: "Este enlace usa un esquema de URL bloqueado.",
|
|
2338
|
+
labelLinkUrl: "URL del enlace (opcional)",
|
|
2339
|
+
helpLabelContainerUrl: "Abre esta direcci\xF3n en lugar de un panel. Admite {{varToken}}, {{valueToken}} (texto de la etiqueta) y, en etiquetas de consulta, {{fieldToken}}.",
|
|
2306
2340
|
helpLabelClickUrlNewTab: "Si est\xE1 activo, la URL se abre en una nueva pesta\xF1a del navegador.",
|
|
2307
2341
|
labelUrlPreview: "Vista previa: el clic abrir\xEDa {{url}}.",
|
|
2308
2342
|
labelDrillPreview: "Vista previa: el clic abrir\xEDa \u201C{{target}}\u201D.",
|
|
@@ -2905,8 +2939,36 @@ function applyChartAggregations(widget, rows, dimKey, measureKeys) {
|
|
|
2905
2939
|
import {
|
|
2906
2940
|
getLabelClickUrl,
|
|
2907
2941
|
labelClickOpensNewTab,
|
|
2942
|
+
resolveDisplayText,
|
|
2943
|
+
resolveHyperlink as resolveHyperlink2,
|
|
2908
2944
|
resolveLabelClickAction
|
|
2909
2945
|
} from "@dashboard-designer/core";
|
|
2946
|
+
|
|
2947
|
+
// src/charts/hyperlink.ts
|
|
2948
|
+
import {
|
|
2949
|
+
getWidgetHyperlink,
|
|
2950
|
+
openHyperlink,
|
|
2951
|
+
resolveHyperlink
|
|
2952
|
+
} from "@dashboard-designer/core";
|
|
2953
|
+
function hyperlinkClickPayload(template, newTab, variables, row, value) {
|
|
2954
|
+
const result = resolveHyperlink(template, { variables, row, value });
|
|
2955
|
+
return result.ok ? { clickUrl: result.url, openInNewTab: newTab } : { linkError: result.error };
|
|
2956
|
+
}
|
|
2957
|
+
function widgetHyperlinkPayload(widget, variables, row, value) {
|
|
2958
|
+
const link = getWidgetHyperlink(widget.chartOptions);
|
|
2959
|
+
if (!link) return void 0;
|
|
2960
|
+
return hyperlinkClickPayload(link.url, link.newTab, variables, row, value);
|
|
2961
|
+
}
|
|
2962
|
+
function dispatchLinkPayload(payload, onDrillDown) {
|
|
2963
|
+
if (onDrillDown) {
|
|
2964
|
+
onDrillDown(payload);
|
|
2965
|
+
return;
|
|
2966
|
+
}
|
|
2967
|
+
if (typeof payload.clickUrl === "string") openHyperlink(payload.clickUrl, payload.openInNewTab !== false);
|
|
2968
|
+
else if (typeof payload.linkError === "string") console.warn(`[dashboard-designer] ${payload.linkError}`);
|
|
2969
|
+
}
|
|
2970
|
+
|
|
2971
|
+
// src/charts/LabelChart.tsx
|
|
2910
2972
|
import { useTranslation as useTranslation5 } from "react-i18next";
|
|
2911
2973
|
|
|
2912
2974
|
// src/labelColors.ts
|
|
@@ -2971,20 +3033,25 @@ function parseFontSize(raw) {
|
|
|
2971
3033
|
}
|
|
2972
3034
|
function LabelChart({ widget, onDrillDown }) {
|
|
2973
3035
|
const { t } = useTranslation5();
|
|
2974
|
-
const
|
|
3036
|
+
const { values: variables } = useVariables();
|
|
3037
|
+
const rawText = typeof widget.chartOptions.text === "string" && widget.chartOptions.text.trim() ? widget.chartOptions.text : widget.title;
|
|
3038
|
+
const text = resolveDisplayText(rawText, variables);
|
|
2975
3039
|
const explicitColor = parseExplicitHexColor(widget.chartOptions.color);
|
|
2976
3040
|
const explicitBackground = parseLabelBackgroundColor(widget.chartOptions.backgroundColor);
|
|
2977
3041
|
const fontSize = parseFontSize(widget.chartOptions.fontSize);
|
|
2978
3042
|
const clickAction = resolveLabelClickAction(widget.chartOptions, widget.drillDown);
|
|
2979
|
-
const
|
|
3043
|
+
const urlTemplate = getLabelClickUrl(widget.chartOptions);
|
|
3044
|
+
const resolvedLink = urlTemplate ? resolveHyperlink2(urlTemplate, { variables, value: text }) : void 0;
|
|
3045
|
+
const clickUrl = resolvedLink?.ok ? resolvedLink.url : void 0;
|
|
3046
|
+
const linkError = resolvedLink && !resolvedLink.ok ? resolvedLink.error : void 0;
|
|
2980
3047
|
const canOpenDashboard = clickAction === "dashboard" && Boolean(onDrillDown && widget.drillDown?.targetDashboardId);
|
|
2981
|
-
const canOpenUrl = clickAction === "url" && Boolean(
|
|
3048
|
+
const canOpenUrl = clickAction === "url" && Boolean(urlTemplate);
|
|
2982
3049
|
const canNavigate = canOpenDashboard || canOpenUrl;
|
|
2983
3050
|
const opensNewTab = labelClickOpensNewTab(widget.chartOptions);
|
|
2984
3051
|
const style = { fontSize: `${fontSize}px` };
|
|
2985
3052
|
if (explicitColor) style.color = explicitColor;
|
|
2986
3053
|
if (explicitBackground) style.backgroundColor = explicitBackground;
|
|
2987
|
-
const hintTitle = canOpenUrl ? clickUrl : canOpenDashboard ? t("labelOpenDashboardHint") : void 0;
|
|
3054
|
+
const hintTitle = canOpenUrl ? clickUrl ?? linkError : canOpenDashboard ? t("labelOpenDashboardHint") : void 0;
|
|
2988
3055
|
return /* @__PURE__ */ jsx11(
|
|
2989
3056
|
"button",
|
|
2990
3057
|
{
|
|
@@ -2993,14 +3060,11 @@ function LabelChart({ widget, onDrillDown }) {
|
|
|
2993
3060
|
style,
|
|
2994
3061
|
disabled: !canNavigate,
|
|
2995
3062
|
onClick: () => {
|
|
2996
|
-
if (canOpenUrl
|
|
2997
|
-
|
|
2998
|
-
|
|
2999
|
-
|
|
3000
|
-
|
|
3001
|
-
} else {
|
|
3002
|
-
window.location.assign(clickUrl);
|
|
3003
|
-
}
|
|
3063
|
+
if (canOpenUrl) {
|
|
3064
|
+
dispatchLinkPayload(
|
|
3065
|
+
clickUrl ? { clickUrl, openInNewTab: opensNewTab } : { linkError },
|
|
3066
|
+
onDrillDown
|
|
3067
|
+
);
|
|
3004
3068
|
return;
|
|
3005
3069
|
}
|
|
3006
3070
|
if (canOpenDashboard) onDrillDown({});
|
|
@@ -3018,6 +3082,7 @@ import {
|
|
|
3018
3082
|
normalizeContainerLabelTemplate,
|
|
3019
3083
|
normalizeContainerLabels,
|
|
3020
3084
|
normalizeQueryLabelDrillDowns,
|
|
3085
|
+
resolveDisplayText as resolveDisplayText2,
|
|
3021
3086
|
resolveLabelContainerSource as resolveLabelContainerSource2
|
|
3022
3087
|
} from "@dashboard-designer/core";
|
|
3023
3088
|
import { useTranslation as useTranslation6 } from "react-i18next";
|
|
@@ -3045,7 +3110,10 @@ function LabelItem({
|
|
|
3045
3110
|
onDrillDown
|
|
3046
3111
|
}) {
|
|
3047
3112
|
const { t } = useTranslation6();
|
|
3048
|
-
const
|
|
3113
|
+
const { values: variables } = useVariables();
|
|
3114
|
+
const text = resolveDisplayText2(item.text, variables);
|
|
3115
|
+
const hasUrl = Boolean(item.url);
|
|
3116
|
+
const canNavigate = hasUrl || Boolean(onDrillDown && item.targetDashboardId);
|
|
3049
3117
|
const explicitColor = parseExplicitHexColor(item.color);
|
|
3050
3118
|
const explicitBackground = parseLabelBackgroundColor(item.backgroundColor);
|
|
3051
3119
|
const fontSize = parseFontSize2(item.fontSize, 14);
|
|
@@ -3061,13 +3129,20 @@ function LabelItem({
|
|
|
3061
3129
|
disabled: !canNavigate,
|
|
3062
3130
|
onClick: () => {
|
|
3063
3131
|
if (!canNavigate) return;
|
|
3132
|
+
if (hasUrl) {
|
|
3133
|
+
dispatchLinkPayload(
|
|
3134
|
+
hyperlinkClickPayload(item.url, item.urlNewTab !== false, variables, item.linkRow, item.text),
|
|
3135
|
+
onDrillDown
|
|
3136
|
+
);
|
|
3137
|
+
return;
|
|
3138
|
+
}
|
|
3064
3139
|
onDrillDown({
|
|
3065
3140
|
targetDashboardId: item.targetDashboardId,
|
|
3066
3141
|
drillTitle: item.drillTitle || item.text
|
|
3067
3142
|
});
|
|
3068
3143
|
},
|
|
3069
|
-
title: canNavigate ? t("labelOpenDashboardHint") : void 0,
|
|
3070
|
-
children: /* @__PURE__ */ jsx12("span", { className: "dd-container-label-text", children:
|
|
3144
|
+
title: hasUrl ? t("hyperlinkClickHint") : canNavigate ? t("labelOpenDashboardHint") : void 0,
|
|
3145
|
+
children: /* @__PURE__ */ jsx12("span", { className: "dd-container-label-text", children: text })
|
|
3071
3146
|
}
|
|
3072
3147
|
);
|
|
3073
3148
|
}
|
|
@@ -3286,6 +3361,7 @@ function ColumnFilterDialog({ column, values, selected, onApply, onClose }) {
|
|
|
3286
3361
|
}
|
|
3287
3362
|
|
|
3288
3363
|
// src/charts/TableChart.tsx
|
|
3364
|
+
import { getWidgetHyperlink as getWidgetHyperlink2, resolveHyperlink as resolveHyperlink3 } from "@dashboard-designer/core";
|
|
3289
3365
|
import { useTranslation as useTranslation8 } from "react-i18next";
|
|
3290
3366
|
import { jsx as jsx15, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
3291
3367
|
function resolveColumnKey(field, columns) {
|
|
@@ -3324,9 +3400,18 @@ function formatCell2(value, locale) {
|
|
|
3324
3400
|
}
|
|
3325
3401
|
return String(value);
|
|
3326
3402
|
}
|
|
3327
|
-
function TableChart({ widget, data, locale = "en" }) {
|
|
3403
|
+
function TableChart({ widget, data, locale = "en", onDrillDown, variables = {} }) {
|
|
3328
3404
|
const { t } = useTranslation8();
|
|
3329
3405
|
const columns = resolveTableColumns(widget, data);
|
|
3406
|
+
const hyperlink = getWidgetHyperlink2(widget.chartOptions);
|
|
3407
|
+
const linkColumn = hyperlink?.column ? resolveColumnKey(hyperlink.column, columns) : void 0;
|
|
3408
|
+
const rowLink = Boolean(hyperlink && !linkColumn);
|
|
3409
|
+
const rowDrill = !hyperlink && Boolean(onDrillDown && widget.drillDown);
|
|
3410
|
+
const rowClickable = rowLink || rowDrill;
|
|
3411
|
+
const activateRow = (row) => {
|
|
3412
|
+
if (rowLink) dispatchLinkPayload(hyperlinkClickPayload(hyperlink.url, hyperlink.newTab, variables, row), onDrillDown);
|
|
3413
|
+
else if (rowDrill) onDrillDown({ ...row });
|
|
3414
|
+
};
|
|
3330
3415
|
const [columnFilters, setColumnFilters] = useState10({});
|
|
3331
3416
|
const [filterColumn, setFilterColumn] = useState10(null);
|
|
3332
3417
|
useEffect9(() => {
|
|
@@ -3373,11 +3458,51 @@ function TableChart({ widget, data, locale = "en" }) {
|
|
|
3373
3458
|
style: { textAlign: "center" },
|
|
3374
3459
|
children: t("noData")
|
|
3375
3460
|
}
|
|
3376
|
-
) }) : rows.map((row, i) => /* @__PURE__ */ jsx15(
|
|
3461
|
+
) }) : rows.map((row, i) => /* @__PURE__ */ jsx15(
|
|
3462
|
+
"tr",
|
|
3463
|
+
{
|
|
3464
|
+
className: rowClickable ? "dd-table-row-link" : void 0,
|
|
3465
|
+
tabIndex: rowClickable ? 0 : void 0,
|
|
3466
|
+
title: rowLink ? t("hyperlinkClickHint") : rowDrill ? t("drillClickHint") : void 0,
|
|
3467
|
+
onClick: rowClickable ? () => activateRow(row) : void 0,
|
|
3468
|
+
onKeyDown: rowClickable ? (e) => {
|
|
3469
|
+
if (e.key === "Enter" || e.key === " ") {
|
|
3470
|
+
e.preventDefault();
|
|
3471
|
+
activateRow(row);
|
|
3472
|
+
}
|
|
3473
|
+
} : void 0,
|
|
3474
|
+
children: columns.map((c) => {
|
|
3475
|
+
if (hyperlink && c === linkColumn) {
|
|
3476
|
+
const resolved = resolveHyperlink3(hyperlink.url, { variables, row, value: row[c] });
|
|
3477
|
+
return /* @__PURE__ */ jsx15("td", { style: cellStyle(row, c), children: resolved.ok ? /* @__PURE__ */ jsx15(
|
|
3478
|
+
"a",
|
|
3479
|
+
{
|
|
3480
|
+
className: "dd-table-link",
|
|
3481
|
+
href: resolved.url,
|
|
3482
|
+
target: hyperlink.newTab ? "_blank" : void 0,
|
|
3483
|
+
rel: hyperlink.newTab ? "noopener noreferrer" : void 0,
|
|
3484
|
+
onClick: (e) => {
|
|
3485
|
+
e.stopPropagation();
|
|
3486
|
+
if (!onDrillDown || e.ctrlKey || e.metaKey || e.shiftKey || e.button !== 0) return;
|
|
3487
|
+
e.preventDefault();
|
|
3488
|
+
onDrillDown({ clickUrl: resolved.url, openInNewTab: hyperlink.newTab });
|
|
3489
|
+
},
|
|
3490
|
+
children: formatCell2(row[c], locale)
|
|
3491
|
+
}
|
|
3492
|
+
) : /* @__PURE__ */ jsx15("span", { title: resolved.error, children: formatCell2(row[c], locale) }) }, c);
|
|
3493
|
+
}
|
|
3494
|
+
return /* @__PURE__ */ jsx15("td", { style: cellStyle(row, c), children: formatCell2(row[c], locale) }, c);
|
|
3495
|
+
})
|
|
3496
|
+
},
|
|
3497
|
+
i
|
|
3498
|
+
)) })
|
|
3377
3499
|
] })
|
|
3378
3500
|
] });
|
|
3379
3501
|
}
|
|
3380
3502
|
|
|
3503
|
+
// src/charts/ChartRenderer.tsx
|
|
3504
|
+
import { getWidgetHyperlink as getWidgetHyperlink3 } from "@dashboard-designer/core";
|
|
3505
|
+
|
|
3381
3506
|
// src/charts/ChartAxisGuidelines.tsx
|
|
3382
3507
|
import { ReferenceLine } from "recharts";
|
|
3383
3508
|
import { normalizeChartAxisGuidelines } from "@dashboard-designer/core";
|
|
@@ -3510,6 +3635,12 @@ function ChartRenderer({
|
|
|
3510
3635
|
chartColors
|
|
3511
3636
|
}) {
|
|
3512
3637
|
const { t } = useTranslation9();
|
|
3638
|
+
const { values: variableValues } = useVariables();
|
|
3639
|
+
const hyperlink = getWidgetHyperlink3(widget.chartOptions);
|
|
3640
|
+
const openWidgetLink = (row, value) => {
|
|
3641
|
+
const payload = widgetHyperlinkPayload(widget, variableValues, row, value);
|
|
3642
|
+
if (payload) dispatchLinkPayload(payload, onDrillDown);
|
|
3643
|
+
};
|
|
3513
3644
|
const columns = data?.columns ?? [];
|
|
3514
3645
|
const dim = resolveDataKey(widget.binding.dimensions[0], columns, columns[0]);
|
|
3515
3646
|
const measures = (widget.binding.measures.length ? widget.binding.measures : columns.slice(1)).map(
|
|
@@ -3589,7 +3720,11 @@ function ChartRenderer({
|
|
|
3589
3720
|
return /* @__PURE__ */ jsx17("div", { className: "dd-kpi", children: /* @__PURE__ */ jsxs14("div", { className: "dd-kpi-main", children: [
|
|
3590
3721
|
KpiIcon && /* @__PURE__ */ jsx17("span", { className: "dd-kpi-icon", style: typeof widget.chartOptions.kpiIconColor === "string" ? { color: widget.chartOptions.kpiIconColor } : void 0, children: /* @__PURE__ */ jsx17(KpiIcon, { size: 24, "aria-hidden": true }) }),
|
|
3591
3722
|
/* @__PURE__ */ jsxs14("div", { className: "dd-kpi-text", children: [
|
|
3592
|
-
onDataClick && data && rows.length > 0 ? /* @__PURE__ */ jsx17("button", { type: "button", className: "dd-kpi-value dd-kpi-number-button", "aria-label": `${widget.title}: ${String(displayValue)}. View record details`, onClick: () => onDataClick("Record details", ""), children: formatValue(displayValue, locale, widget.chartOptions.format, chartCurrency) }) : /* @__PURE__ */ jsx17("
|
|
3723
|
+
onDataClick && data && rows.length > 0 ? /* @__PURE__ */ jsx17("button", { type: "button", className: "dd-kpi-value dd-kpi-number-button", "aria-label": `${widget.title}: ${String(displayValue)}. View record details`, onClick: () => onDataClick("Record details", ""), children: formatValue(displayValue, locale, widget.chartOptions.format, chartCurrency) }) : hyperlink || onDrillDown && widget.drillDown ? /* @__PURE__ */ jsx17("button", { type: "button", className: "dd-kpi-value dd-kpi-number-button", title: hyperlink ? t("hyperlinkClickHint") : t("drillClickHint"), onClick: () => {
|
|
3724
|
+
const row = rows[0];
|
|
3725
|
+
if (hyperlink) openWidgetLink(row, displayValue);
|
|
3726
|
+
else onDrillDown({ ...row ?? {} });
|
|
3727
|
+
}, children: formatValue(displayValue, locale, widget.chartOptions.format, chartCurrency) }) : /* @__PURE__ */ jsx17("div", { className: "dd-kpi-value", children: formatValue(displayValue, locale, widget.chartOptions.format, chartCurrency) }),
|
|
3593
3728
|
/* @__PURE__ */ jsx17("div", { className: "dd-kpi-label", children: widget.title })
|
|
3594
3729
|
] })
|
|
3595
3730
|
] }) });
|
|
@@ -3601,7 +3736,7 @@ function ChartRenderer({
|
|
|
3601
3736
|
t("loading")
|
|
3602
3737
|
] });
|
|
3603
3738
|
}
|
|
3604
|
-
return /* @__PURE__ */ jsx17(TableChart, { widget, data, locale });
|
|
3739
|
+
return /* @__PURE__ */ jsx17(TableChart, { widget, data, locale, onDrillDown, variables: variableValues });
|
|
3605
3740
|
}
|
|
3606
3741
|
if (!data) {
|
|
3607
3742
|
return /* @__PURE__ */ jsx17("div", { className: "dd-muted", children: t("noData") });
|
|
@@ -3621,7 +3756,15 @@ function ChartRenderer({
|
|
|
3621
3756
|
return /* @__PURE__ */ jsx17("div", { className: "dd-muted", children: t("noData") });
|
|
3622
3757
|
}
|
|
3623
3758
|
if (widget.type === "timeline") {
|
|
3624
|
-
return /* @__PURE__ */ jsx17("div", { className: "dd-timeline-scroll", children: /* @__PURE__ */ jsx17("ol", { className: `dd-timeline${widget.chartOptions.timelineOrientation === "vertical" ? " dd-timeline-vertical" : ""}`, "aria-label": "Records by status", children: timelineStages(rows, dim).map((stage, index) => /* @__PURE__ */ jsx17("li", { style: { "--stage-color": colorAt(index) }, children: /* @__PURE__ */ jsxs14("button", { type: "button", disabled: !onDataClick
|
|
3759
|
+
return /* @__PURE__ */ jsx17("div", { className: "dd-timeline-scroll", children: /* @__PURE__ */ jsx17("ol", { className: `dd-timeline${widget.chartOptions.timelineOrientation === "vertical" ? " dd-timeline-vertical" : ""}`, "aria-label": "Records by status", children: timelineStages(rows, dim).map((stage, index) => /* @__PURE__ */ jsx17("li", { style: { "--stage-color": colorAt(index) }, children: /* @__PURE__ */ jsxs14("button", { type: "button", disabled: !onDataClick && !hyperlink && !(onDrillDown && widget.drillDown), onClick: () => {
|
|
3760
|
+
if (onDataClick) {
|
|
3761
|
+
onDataClick(stage.value, dim);
|
|
3762
|
+
return;
|
|
3763
|
+
}
|
|
3764
|
+
const row = rows.find((r) => r[dim] === stage.value) ?? { [dim]: stage.value };
|
|
3765
|
+
if (hyperlink) openWidgetLink(row, stage.value);
|
|
3766
|
+
else onDrillDown?.({ ...row, [dim]: stage.value });
|
|
3767
|
+
}, "aria-label": `${String(stage.value ?? "(empty)")}: ${stage.count} records${onDataClick ? ". View details" : ""}`, children: [
|
|
3625
3768
|
/* @__PURE__ */ jsxs14("span", { className: "dd-timeline-status", title: String(stage.value ?? "(empty)"), children: [
|
|
3626
3769
|
/* @__PURE__ */ jsx17("span", { className: "dd-timeline-step", children: String(index + 1).padStart(2, "0") }),
|
|
3627
3770
|
String(stage.value ?? "(empty)")
|
|
@@ -3644,18 +3787,20 @@ function ChartRenderer({
|
|
|
3644
3787
|
measures
|
|
3645
3788
|
);
|
|
3646
3789
|
const showData = Boolean(onDataClick && (widget.type === "pie" || widget.type === "bar"));
|
|
3647
|
-
const canDrill = showData || Boolean(onDrillDown && widget.drillDown);
|
|
3790
|
+
const canDrill = showData || Boolean(hyperlink) || Boolean(onDrillDown && widget.drillDown);
|
|
3648
3791
|
const handleClick = (raw) => {
|
|
3649
3792
|
if (!canDrill) return;
|
|
3650
3793
|
const payload = extractClickPayload(raw);
|
|
3651
3794
|
if (!payload) return;
|
|
3652
3795
|
if (showData) onDataClick(payload[dim], dim);
|
|
3796
|
+
else if (hyperlink) openWidgetLink(payload, payload[dim]);
|
|
3653
3797
|
else onDrillDown(payload);
|
|
3654
3798
|
};
|
|
3799
|
+
const clickHint = showData ? "Click to view data" : hyperlink ? t("hyperlinkClickHint") : canDrill ? t("drillClickHint") : void 0;
|
|
3655
3800
|
const drillClass = canDrill ? "dd-chart-fill is-drillable" : "dd-chart-fill";
|
|
3656
3801
|
if (widget.type === "pie") {
|
|
3657
3802
|
const measure = measures[0] || columns[1];
|
|
3658
|
-
return /* @__PURE__ */ jsx17("div", { className: drillClass, title:
|
|
3803
|
+
return /* @__PURE__ */ jsx17("div", { className: drillClass, title: clickHint, children: /* @__PURE__ */ jsx17(ResponsiveContainer, { width: "100%", height: "100%", children: /* @__PURE__ */ jsxs14(PieChart2, { children: [
|
|
3659
3804
|
/* @__PURE__ */ jsx17(
|
|
3660
3805
|
Pie,
|
|
3661
3806
|
{
|
|
@@ -3676,7 +3821,7 @@ function ChartRenderer({
|
|
|
3676
3821
|
] }) }) });
|
|
3677
3822
|
}
|
|
3678
3823
|
if (widget.type === "line") {
|
|
3679
|
-
return /* @__PURE__ */ jsx17("div", { className: drillClass, title:
|
|
3824
|
+
return /* @__PURE__ */ jsx17("div", { className: drillClass, title: clickHint, children: /* @__PURE__ */ jsx17(ResponsiveContainer, { width: "100%", height: "100%", children: /* @__PURE__ */ jsxs14(LineChart2, { data: chartData, onClick: canDrill ? handleClick : void 0, children: [
|
|
3680
3825
|
/* @__PURE__ */ jsx17(CartesianGrid, { strokeDasharray: "3 3", stroke: "#e2e8e4" }),
|
|
3681
3826
|
/* @__PURE__ */ jsx17(XAxis, { dataKey: dim || columns[0], tick: { fontSize: 12 } }),
|
|
3682
3827
|
/* @__PURE__ */ jsx17(YAxis, { tick: { fontSize: 12 } }),
|
|
@@ -3697,7 +3842,7 @@ function ChartRenderer({
|
|
|
3697
3842
|
))
|
|
3698
3843
|
] }) }) });
|
|
3699
3844
|
}
|
|
3700
|
-
return /* @__PURE__ */ jsx17("div", { className: drillClass, title:
|
|
3845
|
+
return /* @__PURE__ */ jsx17("div", { className: drillClass, title: clickHint, children: /* @__PURE__ */ jsx17(ResponsiveContainer, { width: "100%", height: "100%", children: /* @__PURE__ */ jsxs14(BarChart, { data: chartData, children: [
|
|
3701
3846
|
/* @__PURE__ */ jsx17(CartesianGrid, { strokeDasharray: "3 3", stroke: "#e2e8e4" }),
|
|
3702
3847
|
/* @__PURE__ */ jsx17(XAxis, { dataKey: dim || columns[0], tick: { fontSize: 12 } }),
|
|
3703
3848
|
/* @__PURE__ */ jsx17(YAxis, { tick: { fontSize: 12 } }),
|
|
@@ -4187,8 +4332,8 @@ function readJsonFile(file) {
|
|
|
4187
4332
|
}
|
|
4188
4333
|
|
|
4189
4334
|
// src/designer/WidgetEditorModal.tsx
|
|
4190
|
-
import { useEffect as useEffect14, useId as
|
|
4191
|
-
import { useTranslation as
|
|
4335
|
+
import { useEffect as useEffect14, useId as useId6, useRef as useRef11, useState as useState16 } from "react";
|
|
4336
|
+
import { useTranslation as useTranslation15 } from "react-i18next";
|
|
4192
4337
|
import { Save, X as X5 } from "lucide-react";
|
|
4193
4338
|
import {
|
|
4194
4339
|
createEmptyWidget,
|
|
@@ -4267,7 +4412,7 @@ function TableFormattingEditor({ value, columns, onChange }) {
|
|
|
4267
4412
|
}
|
|
4268
4413
|
|
|
4269
4414
|
// src/designer/WidgetConfigForm.tsx
|
|
4270
|
-
import { useEffect as useEffect13, useMemo as useMemo9, useRef as
|
|
4415
|
+
import { useEffect as useEffect13, useMemo as useMemo9, useRef as useRef10, useState as useState15 } from "react";
|
|
4271
4416
|
import {
|
|
4272
4417
|
createContainerLabelItem,
|
|
4273
4418
|
parseStoredProcedureName,
|
|
@@ -4285,7 +4430,7 @@ import {
|
|
|
4285
4430
|
resetContainerLabelItemStyles
|
|
4286
4431
|
} from "@dashboard-designer/core";
|
|
4287
4432
|
import { Link2, LoaderCircle, Play, Plus as Plus2, RotateCcw, Trash2, ArrowUpDown } from "lucide-react";
|
|
4288
|
-
import { useTranslation as
|
|
4433
|
+
import { useTranslation as useTranslation14 } from "react-i18next";
|
|
4289
4434
|
|
|
4290
4435
|
// src/designer/ProcedureParametersEditor.tsx
|
|
4291
4436
|
import { useEffect as useEffect12, useState as useState13 } from "react";
|
|
@@ -4504,6 +4649,144 @@ function QueryLabelDrillDownEditor({ data, field, rules: rawRules, dashboards, o
|
|
|
4504
4649
|
] });
|
|
4505
4650
|
}
|
|
4506
4651
|
|
|
4652
|
+
// src/designer/HyperlinkEditor.tsx
|
|
4653
|
+
import { useId as useId5, useRef as useRef9 } from "react";
|
|
4654
|
+
import { useTranslation as useTranslation13 } from "react-i18next";
|
|
4655
|
+
import { getWidgetHyperlink as getWidgetHyperlink4, hyperlinkVariableNames } from "@dashboard-designer/core";
|
|
4656
|
+
import { jsx as jsx23, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
4657
|
+
var HYPERLINK_TOKEN_HELP = {
|
|
4658
|
+
varToken: "{{var:Name}}",
|
|
4659
|
+
fieldToken: "{{field:Column}}",
|
|
4660
|
+
valueToken: "{{value}}",
|
|
4661
|
+
interpolation: { escapeValue: false }
|
|
4662
|
+
};
|
|
4663
|
+
function HyperlinkUrlInput({ id, value, onChange, fields = [], allowValue = true, placeholder }) {
|
|
4664
|
+
const { t } = useTranslation13();
|
|
4665
|
+
const { definitions, values } = useVariables();
|
|
4666
|
+
const inputRef = useRef9(null);
|
|
4667
|
+
const variableNames = definitions.filter((v) => v.type !== "connection").map((v) => v.name);
|
|
4668
|
+
const insert = (token) => {
|
|
4669
|
+
const input = inputRef.current;
|
|
4670
|
+
const start = input?.selectionStart ?? value.length;
|
|
4671
|
+
const end = input?.selectionEnd ?? start;
|
|
4672
|
+
onChange(value.slice(0, start) + token + value.slice(end));
|
|
4673
|
+
requestAnimationFrame(() => {
|
|
4674
|
+
input?.focus();
|
|
4675
|
+
input?.setSelectionRange(start + token.length, start + token.length);
|
|
4676
|
+
});
|
|
4677
|
+
};
|
|
4678
|
+
const missing = hyperlinkVariableNames(value).filter((name) => !variableNames.includes(name));
|
|
4679
|
+
const unset = hyperlinkVariableNames(value).filter((name) => variableNames.includes(name) && values[name] === void 0);
|
|
4680
|
+
return /* @__PURE__ */ jsxs20("div", { className: "dd-hyperlink-input", children: [
|
|
4681
|
+
/* @__PURE__ */ jsx23(
|
|
4682
|
+
"input",
|
|
4683
|
+
{
|
|
4684
|
+
ref: inputRef,
|
|
4685
|
+
id,
|
|
4686
|
+
className: "dd-input",
|
|
4687
|
+
type: "text",
|
|
4688
|
+
inputMode: "url",
|
|
4689
|
+
spellCheck: false,
|
|
4690
|
+
value,
|
|
4691
|
+
onChange: (e) => onChange(e.target.value),
|
|
4692
|
+
placeholder: placeholder ?? "{{var:url}}/record/{{field:Id}}"
|
|
4693
|
+
}
|
|
4694
|
+
),
|
|
4695
|
+
/* @__PURE__ */ jsxs20("div", { className: "dd-hyperlink-tokens", children: [
|
|
4696
|
+
variableNames.length > 0 && /* @__PURE__ */ jsxs20("select", { className: "dd-input", "aria-label": t("hyperlinkInsertVariable"), value: "", onChange: (e) => {
|
|
4697
|
+
if (e.target.value) insert(`{{var:${e.target.value}}}`);
|
|
4698
|
+
}, children: [
|
|
4699
|
+
/* @__PURE__ */ jsx23("option", { value: "", children: t("hyperlinkInsertVariable") }),
|
|
4700
|
+
variableNames.map((name) => /* @__PURE__ */ jsx23("option", { value: name, children: name }, name))
|
|
4701
|
+
] }),
|
|
4702
|
+
(fields.length > 0 || allowValue) && /* @__PURE__ */ jsxs20("select", { className: "dd-input", "aria-label": t("hyperlinkInsertField"), value: "", onChange: (e) => {
|
|
4703
|
+
if (e.target.value) insert(e.target.value);
|
|
4704
|
+
}, children: [
|
|
4705
|
+
/* @__PURE__ */ jsx23("option", { value: "", children: t("hyperlinkInsertField") }),
|
|
4706
|
+
allowValue && /* @__PURE__ */ jsx23("option", { value: "{{value}}", children: t("hyperlinkClickedValue") }),
|
|
4707
|
+
fields.map((field) => /* @__PURE__ */ jsx23("option", { value: `{{field:${field}}}`, children: field }, field))
|
|
4708
|
+
] })
|
|
4709
|
+
] }),
|
|
4710
|
+
missing.length > 0 && /* @__PURE__ */ jsx23("p", { className: "dd-error dd-hyperlink-warning", children: t("hyperlinkUnknownVariable", { names: missing.join(", "), interpolation: { escapeValue: false } }) }),
|
|
4711
|
+
missing.length === 0 && unset.length > 0 && /* @__PURE__ */ jsx23("p", { className: "dd-hint dd-hyperlink-warning", children: t("hyperlinkUnsetVariable", { names: unset.join(", "), interpolation: { escapeValue: false } }) })
|
|
4712
|
+
] });
|
|
4713
|
+
}
|
|
4714
|
+
function WidgetHyperlinkEditor({ chartOptions, onChange, fields, allowColumn }) {
|
|
4715
|
+
const { t } = useTranslation13();
|
|
4716
|
+
const id = useId5();
|
|
4717
|
+
const enabled = typeof chartOptions.hyperlinkUrl === "string";
|
|
4718
|
+
const link = getWidgetHyperlink4(chartOptions);
|
|
4719
|
+
return /* @__PURE__ */ jsxs20("div", { className: `dd-drill-section ${enabled ? "is-enabled" : ""}`, children: [
|
|
4720
|
+
/* @__PURE__ */ jsxs20("div", { className: "dd-drill-toggle", children: [
|
|
4721
|
+
/* @__PURE__ */ jsxs20("label", { className: "dd-check-row", htmlFor: `${id}-enable`, children: [
|
|
4722
|
+
/* @__PURE__ */ jsx23(
|
|
4723
|
+
"input",
|
|
4724
|
+
{
|
|
4725
|
+
id: `${id}-enable`,
|
|
4726
|
+
type: "checkbox",
|
|
4727
|
+
checked: enabled,
|
|
4728
|
+
onChange: (e) => {
|
|
4729
|
+
const next = { ...chartOptions };
|
|
4730
|
+
if (e.target.checked) next.hyperlinkUrl = "";
|
|
4731
|
+
else {
|
|
4732
|
+
delete next.hyperlinkUrl;
|
|
4733
|
+
delete next.hyperlinkNewTab;
|
|
4734
|
+
delete next.hyperlinkColumn;
|
|
4735
|
+
}
|
|
4736
|
+
onChange(next);
|
|
4737
|
+
}
|
|
4738
|
+
}
|
|
4739
|
+
),
|
|
4740
|
+
/* @__PURE__ */ jsx23("span", { className: "dd-check-row-text", children: t("hyperlinkEnable") })
|
|
4741
|
+
] }),
|
|
4742
|
+
/* @__PURE__ */ jsx23(FieldHelp, { text: t("helpHyperlink") })
|
|
4743
|
+
] }),
|
|
4744
|
+
enabled && /* @__PURE__ */ jsxs20("div", { className: "dd-drill-options", children: [
|
|
4745
|
+
/* @__PURE__ */ jsxs20("div", { className: "dd-field dd-field-tight", children: [
|
|
4746
|
+
/* @__PURE__ */ jsx23(FieldLabel, { htmlFor: `${id}-url`, help: t("helpHyperlinkUrl", HYPERLINK_TOKEN_HELP), children: t("hyperlinkUrl") }),
|
|
4747
|
+
/* @__PURE__ */ jsx23(
|
|
4748
|
+
HyperlinkUrlInput,
|
|
4749
|
+
{
|
|
4750
|
+
id: `${id}-url`,
|
|
4751
|
+
value: String(chartOptions.hyperlinkUrl ?? ""),
|
|
4752
|
+
fields,
|
|
4753
|
+
onChange: (hyperlinkUrl) => onChange({ ...chartOptions, hyperlinkUrl })
|
|
4754
|
+
}
|
|
4755
|
+
)
|
|
4756
|
+
] }),
|
|
4757
|
+
allowColumn && /* @__PURE__ */ jsxs20("div", { className: "dd-field dd-field-tight", children: [
|
|
4758
|
+
/* @__PURE__ */ jsx23(FieldLabel, { htmlFor: `${id}-column`, help: t("helpHyperlinkColumn"), children: t("hyperlinkColumn") }),
|
|
4759
|
+
/* @__PURE__ */ jsxs20(
|
|
4760
|
+
"select",
|
|
4761
|
+
{
|
|
4762
|
+
id: `${id}-column`,
|
|
4763
|
+
className: "dd-input",
|
|
4764
|
+
value: link?.column ?? (typeof chartOptions.hyperlinkColumn === "string" ? chartOptions.hyperlinkColumn : ""),
|
|
4765
|
+
onChange: (e) => onChange({ ...chartOptions, hyperlinkColumn: e.target.value || void 0 }),
|
|
4766
|
+
children: [
|
|
4767
|
+
/* @__PURE__ */ jsx23("option", { value: "", children: t("hyperlinkWholeRow") }),
|
|
4768
|
+
fields.map((field) => /* @__PURE__ */ jsx23("option", { value: field, children: field }, field))
|
|
4769
|
+
]
|
|
4770
|
+
}
|
|
4771
|
+
)
|
|
4772
|
+
] }),
|
|
4773
|
+
/* @__PURE__ */ jsx23("div", { className: "dd-field dd-check-field", children: /* @__PURE__ */ jsxs20("label", { className: "dd-check-row", htmlFor: `${id}-tab`, children: [
|
|
4774
|
+
/* @__PURE__ */ jsx23(
|
|
4775
|
+
"input",
|
|
4776
|
+
{
|
|
4777
|
+
id: `${id}-tab`,
|
|
4778
|
+
type: "checkbox",
|
|
4779
|
+
checked: chartOptions.hyperlinkNewTab !== false,
|
|
4780
|
+
onChange: (e) => onChange({ ...chartOptions, hyperlinkNewTab: e.target.checked })
|
|
4781
|
+
}
|
|
4782
|
+
),
|
|
4783
|
+
/* @__PURE__ */ jsx23("span", { className: "dd-check-row-text", children: t("labelClickUrlNewTab") })
|
|
4784
|
+
] }) }),
|
|
4785
|
+
/* @__PURE__ */ jsx23("p", { className: "dd-hint", children: t("hyperlinkOverridesDrill") })
|
|
4786
|
+
] })
|
|
4787
|
+
] });
|
|
4788
|
+
}
|
|
4789
|
+
|
|
4507
4790
|
// src/designer/parseRawSqlSelectAliases.ts
|
|
4508
4791
|
function parseRawSqlSelectAliases(rawSql) {
|
|
4509
4792
|
if (!rawSql?.trim()) return [];
|
|
@@ -4547,7 +4830,7 @@ function parseRawSqlSelectAliases(rawSql) {
|
|
|
4547
4830
|
}
|
|
4548
4831
|
|
|
4549
4832
|
// src/designer/WidgetConfigForm.tsx
|
|
4550
|
-
import { Fragment as Fragment10, jsx as
|
|
4833
|
+
import { Fragment as Fragment10, jsx as jsx24, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
4551
4834
|
var GUIDELINE_DEFAULT_COLOR = "#94a3b8";
|
|
4552
4835
|
function GuidelineRow({
|
|
4553
4836
|
item,
|
|
@@ -4561,10 +4844,10 @@ function GuidelineRow({
|
|
|
4561
4844
|
t
|
|
4562
4845
|
}) {
|
|
4563
4846
|
const colorValue = item.color && /^#([0-9a-f]{3}|[0-9a-f]{6})$/i.test(item.color.trim()) ? item.color.trim() : GUIDELINE_DEFAULT_COLOR;
|
|
4564
|
-
return /* @__PURE__ */
|
|
4565
|
-
/* @__PURE__ */
|
|
4566
|
-
/* @__PURE__ */
|
|
4567
|
-
/* @__PURE__ */
|
|
4847
|
+
return /* @__PURE__ */ jsxs21("div", { className: "dd-guideline-item", children: [
|
|
4848
|
+
/* @__PURE__ */ jsxs21("div", { className: "dd-guideline-item-head", children: [
|
|
4849
|
+
/* @__PURE__ */ jsx24("span", { className: "dd-guideline-item-title", children: t("guidelineN", { n: index + 1 }) }),
|
|
4850
|
+
/* @__PURE__ */ jsx24(
|
|
4568
4851
|
"button",
|
|
4569
4852
|
{
|
|
4570
4853
|
type: "button",
|
|
@@ -4572,14 +4855,14 @@ function GuidelineRow({
|
|
|
4572
4855
|
title: t("removeGuideline"),
|
|
4573
4856
|
"aria-label": t("removeGuideline"),
|
|
4574
4857
|
onClick: onRemove,
|
|
4575
|
-
children: /* @__PURE__ */
|
|
4858
|
+
children: /* @__PURE__ */ jsx24(Trash2, { size: ICON_SIZE })
|
|
4576
4859
|
}
|
|
4577
4860
|
)
|
|
4578
4861
|
] }),
|
|
4579
|
-
/* @__PURE__ */
|
|
4580
|
-
/* @__PURE__ */
|
|
4581
|
-
/* @__PURE__ */
|
|
4582
|
-
/* @__PURE__ */
|
|
4862
|
+
/* @__PURE__ */ jsxs21("div", { className: "dd-field-row dd-guideline-fields", children: [
|
|
4863
|
+
/* @__PURE__ */ jsxs21("div", { className: "dd-field dd-field-tight", children: [
|
|
4864
|
+
/* @__PURE__ */ jsx24(FieldLabel, { htmlFor: `${idPrefix}-value`, children: valueLabel }),
|
|
4865
|
+
/* @__PURE__ */ jsx24(
|
|
4583
4866
|
"input",
|
|
4584
4867
|
{
|
|
4585
4868
|
id: `${idPrefix}-value`,
|
|
@@ -4591,9 +4874,9 @@ function GuidelineRow({
|
|
|
4591
4874
|
}
|
|
4592
4875
|
)
|
|
4593
4876
|
] }),
|
|
4594
|
-
/* @__PURE__ */
|
|
4595
|
-
/* @__PURE__ */
|
|
4596
|
-
/* @__PURE__ */
|
|
4877
|
+
/* @__PURE__ */ jsxs21("div", { className: "dd-field dd-field-tight", children: [
|
|
4878
|
+
/* @__PURE__ */ jsx24(FieldLabel, { htmlFor: `${idPrefix}-label`, children: t("guidelineLabel") }),
|
|
4879
|
+
/* @__PURE__ */ jsx24(
|
|
4597
4880
|
"input",
|
|
4598
4881
|
{
|
|
4599
4882
|
id: `${idPrefix}-label`,
|
|
@@ -4604,9 +4887,9 @@ function GuidelineRow({
|
|
|
4604
4887
|
}
|
|
4605
4888
|
)
|
|
4606
4889
|
] }),
|
|
4607
|
-
/* @__PURE__ */
|
|
4608
|
-
/* @__PURE__ */
|
|
4609
|
-
/* @__PURE__ */
|
|
4890
|
+
/* @__PURE__ */ jsxs21("div", { className: "dd-field dd-field-tight", children: [
|
|
4891
|
+
/* @__PURE__ */ jsx24(FieldLabel, { htmlFor: `${idPrefix}-color`, children: t("guidelineColor") }),
|
|
4892
|
+
/* @__PURE__ */ jsx24(
|
|
4610
4893
|
"input",
|
|
4611
4894
|
{
|
|
4612
4895
|
id: `${idPrefix}-color`,
|
|
@@ -4631,18 +4914,18 @@ function WidgetConfigForm({
|
|
|
4631
4914
|
onAfterRunQuery,
|
|
4632
4915
|
dashboardTheme
|
|
4633
4916
|
}) {
|
|
4634
|
-
const { t } =
|
|
4917
|
+
const { t } = useTranslation14();
|
|
4635
4918
|
const variables = useVariables();
|
|
4636
4919
|
const variableSignature = JSON.stringify(variables.values);
|
|
4637
4920
|
const executionKey = JSON.stringify([widget.query, widget.filters, variableSignature, variables.ready]);
|
|
4638
|
-
const latestExecutionKey =
|
|
4921
|
+
const latestExecutionKey = useRef10(executionKey);
|
|
4639
4922
|
latestExecutionKey.current = executionKey;
|
|
4640
4923
|
const [ranVariableSignature, setRanVariableSignature] = useState15("");
|
|
4641
4924
|
const [tables, setTables] = useState15([]);
|
|
4642
4925
|
const [columnsByTable, setColumnsByTable] = useState15({});
|
|
4643
4926
|
const [sqlPreview, setSqlPreview] = useState15("");
|
|
4644
4927
|
const [runningQuery, setRunningQuery] = useState15(false);
|
|
4645
|
-
const queryInFlight =
|
|
4928
|
+
const queryInFlight = useRef10(false);
|
|
4646
4929
|
const [resultColumns, setResultColumns] = useState15([]);
|
|
4647
4930
|
const [rawQueryResult, setQueryResult] = useState15(null);
|
|
4648
4931
|
const queryResult = useMemo9(
|
|
@@ -5113,16 +5396,16 @@ function WidgetConfigForm({
|
|
|
5113
5396
|
setRunningQuery(false);
|
|
5114
5397
|
}
|
|
5115
5398
|
};
|
|
5116
|
-
return /* @__PURE__ */
|
|
5117
|
-
/* @__PURE__ */
|
|
5118
|
-
/* @__PURE__ */
|
|
5119
|
-
/* @__PURE__ */
|
|
5120
|
-
/* @__PURE__ */
|
|
5399
|
+
return /* @__PURE__ */ jsxs21("div", { className: "dd-config-form", children: [
|
|
5400
|
+
/* @__PURE__ */ jsxs21("details", { className: "dd-config-section", open: true, children: [
|
|
5401
|
+
/* @__PURE__ */ jsxs21("summary", { children: [
|
|
5402
|
+
/* @__PURE__ */ jsx24("span", { children: "Widget setup" }),
|
|
5403
|
+
/* @__PURE__ */ jsx24("small", { children: "Title, type and content" })
|
|
5121
5404
|
] }),
|
|
5122
|
-
/* @__PURE__ */
|
|
5123
|
-
/* @__PURE__ */
|
|
5124
|
-
/* @__PURE__ */
|
|
5125
|
-
/* @__PURE__ */
|
|
5405
|
+
/* @__PURE__ */ jsxs21("div", { className: "dd-config-section-body", children: [
|
|
5406
|
+
/* @__PURE__ */ jsxs21("div", { className: "dd-field", children: [
|
|
5407
|
+
/* @__PURE__ */ jsx24(FieldLabel, { htmlFor: `${idPrefix}-title`, help: t("helpWidgetTitle"), children: t("title") }),
|
|
5408
|
+
/* @__PURE__ */ jsx24(
|
|
5126
5409
|
"input",
|
|
5127
5410
|
{
|
|
5128
5411
|
id: `${idPrefix}-title`,
|
|
@@ -5132,18 +5415,18 @@ function WidgetConfigForm({
|
|
|
5132
5415
|
}
|
|
5133
5416
|
)
|
|
5134
5417
|
] }),
|
|
5135
|
-
/* @__PURE__ */
|
|
5136
|
-
/* @__PURE__ */
|
|
5137
|
-
/* @__PURE__ */
|
|
5418
|
+
/* @__PURE__ */ jsxs21("div", { className: "dd-field", children: [
|
|
5419
|
+
/* @__PURE__ */ jsx24(FieldLabel, { help: t("changeTypeHint"), children: t("chartType") }),
|
|
5420
|
+
/* @__PURE__ */ jsx24("div", { className: "dd-type-switch", children: CHART_TYPE_OPTIONS.map((type) => {
|
|
5138
5421
|
const Icon = chartTypeIcon[type];
|
|
5139
|
-
return /* @__PURE__ */
|
|
5422
|
+
return /* @__PURE__ */ jsxs21(
|
|
5140
5423
|
"button",
|
|
5141
5424
|
{
|
|
5142
5425
|
type: "button",
|
|
5143
5426
|
className: `dd-chip ${widget.type === type ? "active" : ""}`,
|
|
5144
5427
|
onClick: () => changeChartType(type),
|
|
5145
5428
|
children: [
|
|
5146
|
-
/* @__PURE__ */
|
|
5429
|
+
/* @__PURE__ */ jsx24(Icon, { size: 14, strokeWidth: 2.25, "aria-hidden": true }),
|
|
5147
5430
|
t(type)
|
|
5148
5431
|
]
|
|
5149
5432
|
},
|
|
@@ -5151,10 +5434,10 @@ function WidgetConfigForm({
|
|
|
5151
5434
|
);
|
|
5152
5435
|
}) })
|
|
5153
5436
|
] }),
|
|
5154
|
-
widget.type === "label" && /* @__PURE__ */
|
|
5155
|
-
/* @__PURE__ */
|
|
5156
|
-
/* @__PURE__ */
|
|
5157
|
-
/* @__PURE__ */
|
|
5437
|
+
widget.type === "label" && /* @__PURE__ */ jsxs21(Fragment10, { children: [
|
|
5438
|
+
/* @__PURE__ */ jsxs21("div", { className: "dd-field dd-check-field", children: [
|
|
5439
|
+
/* @__PURE__ */ jsxs21("label", { className: "dd-check-row", htmlFor: `${idPrefix}-label-show-header`, children: [
|
|
5440
|
+
/* @__PURE__ */ jsx24(
|
|
5158
5441
|
"input",
|
|
5159
5442
|
{
|
|
5160
5443
|
id: `${idPrefix}-label-show-header`,
|
|
@@ -5168,13 +5451,13 @@ function WidgetConfigForm({
|
|
|
5168
5451
|
})
|
|
5169
5452
|
}
|
|
5170
5453
|
),
|
|
5171
|
-
/* @__PURE__ */
|
|
5454
|
+
/* @__PURE__ */ jsx24("span", { className: "dd-check-row-text", children: t("labelShowHeader") })
|
|
5172
5455
|
] }),
|
|
5173
|
-
/* @__PURE__ */
|
|
5456
|
+
/* @__PURE__ */ jsx24(FieldHelp, { text: t("helpLabelShowHeader") })
|
|
5174
5457
|
] }),
|
|
5175
|
-
/* @__PURE__ */
|
|
5176
|
-
/* @__PURE__ */
|
|
5177
|
-
/* @__PURE__ */
|
|
5458
|
+
/* @__PURE__ */ jsxs21("div", { className: "dd-field", children: [
|
|
5459
|
+
/* @__PURE__ */ jsx24(FieldLabel, { htmlFor: `${idPrefix}-label-text`, help: t("helpLabelText"), children: t("labelText") }),
|
|
5460
|
+
/* @__PURE__ */ jsx24(
|
|
5178
5461
|
"textarea",
|
|
5179
5462
|
{
|
|
5180
5463
|
id: `${idPrefix}-label-text`,
|
|
@@ -5187,10 +5470,10 @@ function WidgetConfigForm({
|
|
|
5187
5470
|
}
|
|
5188
5471
|
)
|
|
5189
5472
|
] }),
|
|
5190
|
-
/* @__PURE__ */
|
|
5191
|
-
/* @__PURE__ */
|
|
5192
|
-
/* @__PURE__ */
|
|
5193
|
-
/* @__PURE__ */
|
|
5473
|
+
/* @__PURE__ */ jsxs21("div", { className: "dd-field-row dd-label-style-row", children: [
|
|
5474
|
+
/* @__PURE__ */ jsxs21("div", { className: "dd-field dd-field-tight", children: [
|
|
5475
|
+
/* @__PURE__ */ jsx24(FieldLabel, { htmlFor: `${idPrefix}-label-bg`, help: t("helpLabelBackground"), children: t("labelBackground") }),
|
|
5476
|
+
/* @__PURE__ */ jsx24(
|
|
5194
5477
|
"input",
|
|
5195
5478
|
{
|
|
5196
5479
|
id: `${idPrefix}-label-bg`,
|
|
@@ -5210,9 +5493,9 @@ function WidgetConfigForm({
|
|
|
5210
5493
|
}
|
|
5211
5494
|
)
|
|
5212
5495
|
] }),
|
|
5213
|
-
/* @__PURE__ */
|
|
5214
|
-
/* @__PURE__ */
|
|
5215
|
-
/* @__PURE__ */
|
|
5496
|
+
/* @__PURE__ */ jsxs21("div", { className: "dd-field dd-field-tight", children: [
|
|
5497
|
+
/* @__PURE__ */ jsx24(FieldLabel, { htmlFor: `${idPrefix}-label-fg`, help: t("helpLabelForeground"), children: t("labelForeground") }),
|
|
5498
|
+
/* @__PURE__ */ jsx24(
|
|
5216
5499
|
"input",
|
|
5217
5500
|
{
|
|
5218
5501
|
id: `${idPrefix}-label-fg`,
|
|
@@ -5225,9 +5508,9 @@ function WidgetConfigForm({
|
|
|
5225
5508
|
}
|
|
5226
5509
|
)
|
|
5227
5510
|
] }),
|
|
5228
|
-
/* @__PURE__ */
|
|
5229
|
-
/* @__PURE__ */
|
|
5230
|
-
/* @__PURE__ */
|
|
5511
|
+
/* @__PURE__ */ jsxs21("div", { className: "dd-field dd-field-tight dd-label-color-swap", children: [
|
|
5512
|
+
/* @__PURE__ */ jsx24(FieldLabel, { help: t("helpSwapLabelColors"), children: t("swapLabelColors") }),
|
|
5513
|
+
/* @__PURE__ */ jsx24(
|
|
5231
5514
|
"button",
|
|
5232
5515
|
{
|
|
5233
5516
|
type: "button",
|
|
@@ -5244,13 +5527,13 @@ function WidgetConfigForm({
|
|
|
5244
5527
|
chartOptions: { ...widget.chartOptions, ...swapped }
|
|
5245
5528
|
});
|
|
5246
5529
|
},
|
|
5247
|
-
children: /* @__PURE__ */
|
|
5530
|
+
children: /* @__PURE__ */ jsx24(ArrowUpDown, { size: ICON_SIZE })
|
|
5248
5531
|
}
|
|
5249
5532
|
)
|
|
5250
5533
|
] }),
|
|
5251
|
-
/* @__PURE__ */
|
|
5252
|
-
/* @__PURE__ */
|
|
5253
|
-
/* @__PURE__ */
|
|
5534
|
+
/* @__PURE__ */ jsxs21("div", { className: "dd-field dd-field-tight", children: [
|
|
5535
|
+
/* @__PURE__ */ jsx24(FieldLabel, { htmlFor: `${idPrefix}-label-size`, help: t("helpLabelFontSize"), children: t("labelFontSize") }),
|
|
5536
|
+
/* @__PURE__ */ jsx24(
|
|
5254
5537
|
"input",
|
|
5255
5538
|
{
|
|
5256
5539
|
id: `${idPrefix}-label-size`,
|
|
@@ -5269,14 +5552,14 @@ function WidgetConfigForm({
|
|
|
5269
5552
|
)
|
|
5270
5553
|
] })
|
|
5271
5554
|
] }),
|
|
5272
|
-
/* @__PURE__ */
|
|
5555
|
+
/* @__PURE__ */ jsxs21(
|
|
5273
5556
|
"div",
|
|
5274
5557
|
{
|
|
5275
5558
|
className: `dd-drill-section ${resolveLabelClickAction2(widget.chartOptions, widget.drillDown) !== "none" ? "is-enabled" : ""}`,
|
|
5276
5559
|
children: [
|
|
5277
|
-
/* @__PURE__ */
|
|
5278
|
-
/* @__PURE__ */
|
|
5279
|
-
/* @__PURE__ */
|
|
5560
|
+
/* @__PURE__ */ jsxs21("div", { className: "dd-field dd-field-tight", children: [
|
|
5561
|
+
/* @__PURE__ */ jsx24(FieldLabel, { htmlFor: `${idPrefix}-label-click-action`, help: t("helpLabelClickAction"), children: t("labelClickAction") }),
|
|
5562
|
+
/* @__PURE__ */ jsxs21(
|
|
5280
5563
|
"select",
|
|
5281
5564
|
{
|
|
5282
5565
|
id: `${idPrefix}-label-click-action`,
|
|
@@ -5315,22 +5598,22 @@ function WidgetConfigForm({
|
|
|
5315
5598
|
chartOptions: {
|
|
5316
5599
|
...widget.chartOptions,
|
|
5317
5600
|
clickAction: "url",
|
|
5318
|
-
clickUrl: typeof widget.chartOptions.clickUrl === "string" ? widget.chartOptions.clickUrl : "
|
|
5601
|
+
clickUrl: typeof widget.chartOptions.clickUrl === "string" ? widget.chartOptions.clickUrl : ""
|
|
5319
5602
|
}
|
|
5320
5603
|
});
|
|
5321
5604
|
},
|
|
5322
5605
|
children: [
|
|
5323
|
-
/* @__PURE__ */
|
|
5324
|
-
/* @__PURE__ */
|
|
5325
|
-
/* @__PURE__ */
|
|
5606
|
+
/* @__PURE__ */ jsx24("option", { value: "none", children: t("labelClickNone") }),
|
|
5607
|
+
/* @__PURE__ */ jsx24("option", { value: "dashboard", children: t("labelClickDashboard") }),
|
|
5608
|
+
/* @__PURE__ */ jsx24("option", { value: "url", children: t("labelClickUrl") })
|
|
5326
5609
|
]
|
|
5327
5610
|
}
|
|
5328
5611
|
)
|
|
5329
5612
|
] }),
|
|
5330
|
-
resolveLabelClickAction2(widget.chartOptions, widget.drillDown) === "dashboard" && /* @__PURE__ */
|
|
5331
|
-
/* @__PURE__ */
|
|
5332
|
-
/* @__PURE__ */
|
|
5333
|
-
/* @__PURE__ */
|
|
5613
|
+
resolveLabelClickAction2(widget.chartOptions, widget.drillDown) === "dashboard" && /* @__PURE__ */ jsxs21("div", { className: "dd-drill-options", children: [
|
|
5614
|
+
/* @__PURE__ */ jsxs21("div", { className: "dd-field dd-field-tight", children: [
|
|
5615
|
+
/* @__PURE__ */ jsx24(FieldLabel, { htmlFor: `${idPrefix}-label-target`, help: t("labelTargetHint"), children: t("drillTargetDashboard") }),
|
|
5616
|
+
/* @__PURE__ */ jsxs21(
|
|
5334
5617
|
"select",
|
|
5335
5618
|
{
|
|
5336
5619
|
id: `${idPrefix}-label-target`,
|
|
@@ -5344,15 +5627,15 @@ function WidgetConfigForm({
|
|
|
5344
5627
|
}
|
|
5345
5628
|
}),
|
|
5346
5629
|
children: [
|
|
5347
|
-
/* @__PURE__ */
|
|
5348
|
-
dashboardOptions.map((d) => /* @__PURE__ */
|
|
5630
|
+
/* @__PURE__ */ jsx24("option", { value: "", children: t("selectDashboard") }),
|
|
5631
|
+
dashboardOptions.map((d) => /* @__PURE__ */ jsx24("option", { value: d.id, children: d.title }, d.id))
|
|
5349
5632
|
]
|
|
5350
5633
|
}
|
|
5351
5634
|
)
|
|
5352
5635
|
] }),
|
|
5353
|
-
/* @__PURE__ */
|
|
5354
|
-
/* @__PURE__ */
|
|
5355
|
-
/* @__PURE__ */
|
|
5636
|
+
/* @__PURE__ */ jsxs21("div", { className: "dd-field dd-field-tight", children: [
|
|
5637
|
+
/* @__PURE__ */ jsx24(FieldLabel, { htmlFor: `${idPrefix}-label-trail`, help: t("helpDrillTitle"), children: t("drillTitle") }),
|
|
5638
|
+
/* @__PURE__ */ jsx24(
|
|
5356
5639
|
"input",
|
|
5357
5640
|
{
|
|
5358
5641
|
id: `${idPrefix}-label-trail`,
|
|
@@ -5370,30 +5653,28 @@ function WidgetConfigForm({
|
|
|
5370
5653
|
)
|
|
5371
5654
|
] })
|
|
5372
5655
|
] }),
|
|
5373
|
-
resolveLabelClickAction2(widget.chartOptions, widget.drillDown) === "url" && /* @__PURE__ */
|
|
5374
|
-
/* @__PURE__ */
|
|
5375
|
-
/* @__PURE__ */
|
|
5376
|
-
/* @__PURE__ */
|
|
5377
|
-
|
|
5656
|
+
resolveLabelClickAction2(widget.chartOptions, widget.drillDown) === "url" && /* @__PURE__ */ jsxs21("div", { className: "dd-drill-options", children: [
|
|
5657
|
+
/* @__PURE__ */ jsxs21("div", { className: "dd-field dd-field-tight", children: [
|
|
5658
|
+
/* @__PURE__ */ jsx24(FieldLabel, { htmlFor: `${idPrefix}-label-url`, help: t("helpLabelClickUrl", HYPERLINK_TOKEN_HELP), children: t("labelClickUrlField") }),
|
|
5659
|
+
/* @__PURE__ */ jsx24(
|
|
5660
|
+
HyperlinkUrlInput,
|
|
5378
5661
|
{
|
|
5379
5662
|
id: `${idPrefix}-label-url`,
|
|
5380
|
-
className: "dd-input",
|
|
5381
|
-
type: "url",
|
|
5382
5663
|
value: typeof widget.chartOptions.clickUrl === "string" ? widget.chartOptions.clickUrl : "",
|
|
5383
|
-
onChange: (
|
|
5664
|
+
onChange: (clickUrl) => patch({
|
|
5384
5665
|
chartOptions: {
|
|
5385
5666
|
...widget.chartOptions,
|
|
5386
5667
|
clickAction: "url",
|
|
5387
|
-
clickUrl
|
|
5668
|
+
clickUrl
|
|
5388
5669
|
}
|
|
5389
5670
|
}),
|
|
5390
|
-
placeholder: "
|
|
5671
|
+
placeholder: "{{var:url}}/graph/123"
|
|
5391
5672
|
}
|
|
5392
5673
|
)
|
|
5393
5674
|
] }),
|
|
5394
|
-
/* @__PURE__ */
|
|
5395
|
-
/* @__PURE__ */
|
|
5396
|
-
/* @__PURE__ */
|
|
5675
|
+
/* @__PURE__ */ jsxs21("div", { className: "dd-field dd-check-field", children: [
|
|
5676
|
+
/* @__PURE__ */ jsxs21("label", { className: "dd-check-row", htmlFor: `${idPrefix}-label-url-tab`, children: [
|
|
5677
|
+
/* @__PURE__ */ jsx24(
|
|
5397
5678
|
"input",
|
|
5398
5679
|
{
|
|
5399
5680
|
id: `${idPrefix}-label-url-tab`,
|
|
@@ -5408,19 +5689,19 @@ function WidgetConfigForm({
|
|
|
5408
5689
|
})
|
|
5409
5690
|
}
|
|
5410
5691
|
),
|
|
5411
|
-
/* @__PURE__ */
|
|
5692
|
+
/* @__PURE__ */ jsx24("span", { className: "dd-check-row-text", children: t("labelClickUrlNewTab") })
|
|
5412
5693
|
] }),
|
|
5413
|
-
/* @__PURE__ */
|
|
5694
|
+
/* @__PURE__ */ jsx24(FieldHelp, { text: t("helpLabelClickUrlNewTab") })
|
|
5414
5695
|
] })
|
|
5415
5696
|
] })
|
|
5416
5697
|
]
|
|
5417
5698
|
}
|
|
5418
5699
|
)
|
|
5419
5700
|
] }),
|
|
5420
|
-
widget.type === "labelContainer" && /* @__PURE__ */
|
|
5421
|
-
/* @__PURE__ */
|
|
5422
|
-
/* @__PURE__ */
|
|
5423
|
-
/* @__PURE__ */
|
|
5701
|
+
widget.type === "labelContainer" && /* @__PURE__ */ jsxs21(Fragment10, { children: [
|
|
5702
|
+
/* @__PURE__ */ jsxs21("div", { className: "dd-field dd-check-field", children: [
|
|
5703
|
+
/* @__PURE__ */ jsxs21("label", { className: "dd-check-row", htmlFor: `${idPrefix}-lc-show-header`, children: [
|
|
5704
|
+
/* @__PURE__ */ jsx24(
|
|
5424
5705
|
"input",
|
|
5425
5706
|
{
|
|
5426
5707
|
id: `${idPrefix}-lc-show-header`,
|
|
@@ -5434,14 +5715,14 @@ function WidgetConfigForm({
|
|
|
5434
5715
|
})
|
|
5435
5716
|
}
|
|
5436
5717
|
),
|
|
5437
|
-
/* @__PURE__ */
|
|
5718
|
+
/* @__PURE__ */ jsx24("span", { className: "dd-check-row-text", children: t("labelShowHeader") })
|
|
5438
5719
|
] }),
|
|
5439
|
-
/* @__PURE__ */
|
|
5720
|
+
/* @__PURE__ */ jsx24(FieldHelp, { text: t("helpLabelShowHeader") })
|
|
5440
5721
|
] }),
|
|
5441
|
-
/* @__PURE__ */
|
|
5442
|
-
/* @__PURE__ */
|
|
5443
|
-
/* @__PURE__ */
|
|
5444
|
-
/* @__PURE__ */
|
|
5722
|
+
/* @__PURE__ */ jsxs21("div", { className: "dd-field-row dd-label-style-row", children: [
|
|
5723
|
+
/* @__PURE__ */ jsxs21("div", { className: "dd-field dd-field-tight", children: [
|
|
5724
|
+
/* @__PURE__ */ jsx24(FieldLabel, { htmlFor: `${idPrefix}-lc-bg`, help: t("helpLabelContainerBackground"), children: t("labelContainerBackground") }),
|
|
5725
|
+
/* @__PURE__ */ jsx24(
|
|
5445
5726
|
"input",
|
|
5446
5727
|
{
|
|
5447
5728
|
id: `${idPrefix}-lc-bg`,
|
|
@@ -5461,9 +5742,9 @@ function WidgetConfigForm({
|
|
|
5461
5742
|
}
|
|
5462
5743
|
)
|
|
5463
5744
|
] }),
|
|
5464
|
-
/* @__PURE__ */
|
|
5465
|
-
/* @__PURE__ */
|
|
5466
|
-
/* @__PURE__ */
|
|
5745
|
+
/* @__PURE__ */ jsxs21("div", { className: "dd-field dd-field-tight", children: [
|
|
5746
|
+
/* @__PURE__ */ jsx24(FieldLabel, { htmlFor: `${idPrefix}-lc-layout`, help: t("helpLabelContainerLayout"), children: t("labelContainerLayout") }),
|
|
5747
|
+
/* @__PURE__ */ jsxs21(
|
|
5467
5748
|
"select",
|
|
5468
5749
|
{
|
|
5469
5750
|
id: `${idPrefix}-lc-layout`,
|
|
@@ -5476,15 +5757,15 @@ function WidgetConfigForm({
|
|
|
5476
5757
|
}
|
|
5477
5758
|
}),
|
|
5478
5759
|
children: [
|
|
5479
|
-
/* @__PURE__ */
|
|
5480
|
-
/* @__PURE__ */
|
|
5760
|
+
/* @__PURE__ */ jsx24("option", { value: "vertical", children: t("labelContainerLayoutVertical") }),
|
|
5761
|
+
/* @__PURE__ */ jsx24("option", { value: "horizontal", children: t("labelContainerLayoutHorizontal") })
|
|
5481
5762
|
]
|
|
5482
5763
|
}
|
|
5483
5764
|
)
|
|
5484
5765
|
] }),
|
|
5485
|
-
/* @__PURE__ */
|
|
5486
|
-
/* @__PURE__ */
|
|
5487
|
-
/* @__PURE__ */
|
|
5766
|
+
/* @__PURE__ */ jsxs21("div", { className: "dd-field dd-field-tight", children: [
|
|
5767
|
+
/* @__PURE__ */ jsx24(FieldLabel, { htmlFor: `${idPrefix}-lc-gap`, help: t("helpLabelContainerGap"), children: t("labelContainerGap") }),
|
|
5768
|
+
/* @__PURE__ */ jsx24(
|
|
5488
5769
|
"input",
|
|
5489
5770
|
{
|
|
5490
5771
|
id: `${idPrefix}-lc-gap`,
|
|
@@ -5503,9 +5784,9 @@ function WidgetConfigForm({
|
|
|
5503
5784
|
)
|
|
5504
5785
|
] })
|
|
5505
5786
|
] }),
|
|
5506
|
-
/* @__PURE__ */
|
|
5507
|
-
/* @__PURE__ */
|
|
5508
|
-
/* @__PURE__ */
|
|
5787
|
+
/* @__PURE__ */ jsxs21("div", { className: "dd-field", children: [
|
|
5788
|
+
/* @__PURE__ */ jsx24(FieldLabel, { htmlFor: `${idPrefix}-lc-padding`, help: t("helpLabelContainerPadding"), children: t("labelContainerPadding") }),
|
|
5789
|
+
/* @__PURE__ */ jsx24(
|
|
5509
5790
|
"input",
|
|
5510
5791
|
{
|
|
5511
5792
|
id: `${idPrefix}-lc-padding`,
|
|
@@ -5523,9 +5804,9 @@ function WidgetConfigForm({
|
|
|
5523
5804
|
}
|
|
5524
5805
|
)
|
|
5525
5806
|
] }),
|
|
5526
|
-
/* @__PURE__ */
|
|
5527
|
-
/* @__PURE__ */
|
|
5528
|
-
/* @__PURE__ */
|
|
5807
|
+
/* @__PURE__ */ jsxs21("div", { className: "dd-field", children: [
|
|
5808
|
+
/* @__PURE__ */ jsx24(FieldLabel, { htmlFor: `${idPrefix}-lc-source`, help: t("helpLabelContainerSource"), children: t("labelContainerSource") }),
|
|
5809
|
+
/* @__PURE__ */ jsxs21(
|
|
5529
5810
|
"select",
|
|
5530
5811
|
{
|
|
5531
5812
|
id: `${idPrefix}-lc-source`,
|
|
@@ -5563,16 +5844,16 @@ function WidgetConfigForm({
|
|
|
5563
5844
|
});
|
|
5564
5845
|
},
|
|
5565
5846
|
children: [
|
|
5566
|
-
/* @__PURE__ */
|
|
5567
|
-
/* @__PURE__ */
|
|
5847
|
+
/* @__PURE__ */ jsx24("option", { value: "static", children: t("labelContainerSourceStatic") }),
|
|
5848
|
+
/* @__PURE__ */ jsx24("option", { value: "query", children: t("labelContainerSourceQuery") })
|
|
5568
5849
|
]
|
|
5569
5850
|
}
|
|
5570
5851
|
)
|
|
5571
5852
|
] }),
|
|
5572
|
-
resolveLabelContainerSource3(widget.chartOptions) === "query" ? /* @__PURE__ */
|
|
5573
|
-
/* @__PURE__ */
|
|
5574
|
-
/* @__PURE__ */
|
|
5575
|
-
/* @__PURE__ */
|
|
5853
|
+
resolveLabelContainerSource3(widget.chartOptions) === "query" ? /* @__PURE__ */ jsxs21("div", { className: "dd-field", children: [
|
|
5854
|
+
/* @__PURE__ */ jsxs21("div", { className: "dd-field-label-row", children: [
|
|
5855
|
+
/* @__PURE__ */ jsx24(FieldLabel, { help: t("helpLabelContainerTemplate"), children: t("labelContainerTemplate") }),
|
|
5856
|
+
/* @__PURE__ */ jsx24(
|
|
5576
5857
|
"button",
|
|
5577
5858
|
{
|
|
5578
5859
|
type: "button",
|
|
@@ -5593,7 +5874,7 @@ function WidgetConfigForm({
|
|
|
5593
5874
|
}
|
|
5594
5875
|
});
|
|
5595
5876
|
},
|
|
5596
|
-
children: /* @__PURE__ */
|
|
5877
|
+
children: /* @__PURE__ */ jsx24(RotateCcw, { size: ICON_SIZE })
|
|
5597
5878
|
}
|
|
5598
5879
|
)
|
|
5599
5880
|
] }),
|
|
@@ -5607,11 +5888,11 @@ function WidgetConfigForm({
|
|
|
5607
5888
|
labelTemplate: { ...template, ...partial }
|
|
5608
5889
|
}
|
|
5609
5890
|
});
|
|
5610
|
-
return /* @__PURE__ */
|
|
5611
|
-
/* @__PURE__ */
|
|
5612
|
-
/* @__PURE__ */
|
|
5613
|
-
/* @__PURE__ */
|
|
5614
|
-
/* @__PURE__ */
|
|
5891
|
+
return /* @__PURE__ */ jsxs21("div", { className: "dd-label-container-editor-item", children: [
|
|
5892
|
+
/* @__PURE__ */ jsxs21("div", { className: "dd-field-row dd-label-style-row", children: [
|
|
5893
|
+
/* @__PURE__ */ jsxs21("div", { className: "dd-field dd-field-tight", children: [
|
|
5894
|
+
/* @__PURE__ */ jsx24(FieldLabel, { htmlFor: `${idPrefix}-lc-tpl-fg`, children: t("labelForeground") }),
|
|
5895
|
+
/* @__PURE__ */ jsx24(
|
|
5615
5896
|
"input",
|
|
5616
5897
|
{
|
|
5617
5898
|
id: `${idPrefix}-lc-tpl-fg`,
|
|
@@ -5626,9 +5907,9 @@ function WidgetConfigForm({
|
|
|
5626
5907
|
}
|
|
5627
5908
|
)
|
|
5628
5909
|
] }),
|
|
5629
|
-
/* @__PURE__ */
|
|
5630
|
-
/* @__PURE__ */
|
|
5631
|
-
/* @__PURE__ */
|
|
5910
|
+
/* @__PURE__ */ jsxs21("div", { className: "dd-field dd-field-tight", children: [
|
|
5911
|
+
/* @__PURE__ */ jsx24(FieldLabel, { htmlFor: `${idPrefix}-lc-tpl-bg`, children: t("labelBackground") }),
|
|
5912
|
+
/* @__PURE__ */ jsx24(
|
|
5632
5913
|
"input",
|
|
5633
5914
|
{
|
|
5634
5915
|
id: `${idPrefix}-lc-tpl-bg`,
|
|
@@ -5643,9 +5924,9 @@ function WidgetConfigForm({
|
|
|
5643
5924
|
}
|
|
5644
5925
|
)
|
|
5645
5926
|
] }),
|
|
5646
|
-
/* @__PURE__ */
|
|
5647
|
-
/* @__PURE__ */
|
|
5648
|
-
/* @__PURE__ */
|
|
5927
|
+
/* @__PURE__ */ jsxs21("div", { className: "dd-field dd-field-tight dd-label-color-swap", children: [
|
|
5928
|
+
/* @__PURE__ */ jsx24(FieldLabel, { help: t("helpSwapLabelColors"), children: t("swapLabelColors") }),
|
|
5929
|
+
/* @__PURE__ */ jsx24(
|
|
5649
5930
|
"button",
|
|
5650
5931
|
{
|
|
5651
5932
|
type: "button",
|
|
@@ -5660,13 +5941,13 @@ function WidgetConfigForm({
|
|
|
5660
5941
|
);
|
|
5661
5942
|
patchTemplate(swapped);
|
|
5662
5943
|
},
|
|
5663
|
-
children: /* @__PURE__ */
|
|
5944
|
+
children: /* @__PURE__ */ jsx24(ArrowUpDown, { size: ICON_SIZE })
|
|
5664
5945
|
}
|
|
5665
5946
|
)
|
|
5666
5947
|
] }),
|
|
5667
|
-
/* @__PURE__ */
|
|
5668
|
-
/* @__PURE__ */
|
|
5669
|
-
/* @__PURE__ */
|
|
5948
|
+
/* @__PURE__ */ jsxs21("div", { className: "dd-field dd-field-tight", children: [
|
|
5949
|
+
/* @__PURE__ */ jsx24(FieldLabel, { htmlFor: `${idPrefix}-lc-tpl-size`, children: t("labelFontSize") }),
|
|
5950
|
+
/* @__PURE__ */ jsx24(
|
|
5670
5951
|
"input",
|
|
5671
5952
|
{
|
|
5672
5953
|
id: `${idPrefix}-lc-tpl-size`,
|
|
@@ -5685,8 +5966,8 @@ function WidgetConfigForm({
|
|
|
5685
5966
|
)
|
|
5686
5967
|
] })
|
|
5687
5968
|
] }),
|
|
5688
|
-
/* @__PURE__ */
|
|
5689
|
-
/* @__PURE__ */
|
|
5969
|
+
/* @__PURE__ */ jsx24("div", { className: "dd-field dd-field-tight", children: /* @__PURE__ */ jsxs21("label", { className: "dd-check-row", htmlFor: `${idPrefix}-lc-tpl-link`, children: [
|
|
5970
|
+
/* @__PURE__ */ jsx24(
|
|
5690
5971
|
"input",
|
|
5691
5972
|
{
|
|
5692
5973
|
id: `${idPrefix}-lc-tpl-link`,
|
|
@@ -5698,12 +5979,12 @@ function WidgetConfigForm({
|
|
|
5698
5979
|
})
|
|
5699
5980
|
}
|
|
5700
5981
|
),
|
|
5701
|
-
/* @__PURE__ */
|
|
5982
|
+
/* @__PURE__ */ jsx24("span", { className: "dd-check-row-text", children: t("labelOpenDashboard") })
|
|
5702
5983
|
] }) }),
|
|
5703
|
-
template.targetDashboardId && /* @__PURE__ */
|
|
5704
|
-
/* @__PURE__ */
|
|
5705
|
-
/* @__PURE__ */
|
|
5706
|
-
/* @__PURE__ */
|
|
5984
|
+
template.targetDashboardId && /* @__PURE__ */ jsxs21(Fragment10, { children: [
|
|
5985
|
+
/* @__PURE__ */ jsxs21("div", { className: "dd-field dd-field-tight", children: [
|
|
5986
|
+
/* @__PURE__ */ jsx24(FieldLabel, { htmlFor: `${idPrefix}-lc-tpl-target`, children: t("drillTargetDashboard") }),
|
|
5987
|
+
/* @__PURE__ */ jsxs21(
|
|
5707
5988
|
"select",
|
|
5708
5989
|
{
|
|
5709
5990
|
id: `${idPrefix}-lc-tpl-target`,
|
|
@@ -5713,14 +5994,14 @@ function WidgetConfigForm({
|
|
|
5713
5994
|
targetDashboardId: e.target.value || void 0
|
|
5714
5995
|
}),
|
|
5715
5996
|
children: [
|
|
5716
|
-
/* @__PURE__ */
|
|
5717
|
-
dashboardOptions.map((d) => /* @__PURE__ */
|
|
5997
|
+
/* @__PURE__ */ jsx24("option", { value: "", children: t("selectDashboard") }),
|
|
5998
|
+
dashboardOptions.map((d) => /* @__PURE__ */ jsx24("option", { value: d.id, children: d.title }, d.id))
|
|
5718
5999
|
]
|
|
5719
6000
|
}
|
|
5720
6001
|
)
|
|
5721
6002
|
] }),
|
|
5722
|
-
/* @__PURE__ */
|
|
5723
|
-
/* @__PURE__ */
|
|
6003
|
+
/* @__PURE__ */ jsxs21("div", { className: "dd-field dd-field-tight", children: [
|
|
6004
|
+
/* @__PURE__ */ jsx24(
|
|
5724
6005
|
FieldLabel,
|
|
5725
6006
|
{
|
|
5726
6007
|
htmlFor: `${idPrefix}-lc-tpl-trail`,
|
|
@@ -5728,7 +6009,7 @@ function WidgetConfigForm({
|
|
|
5728
6009
|
children: t("drillTitle")
|
|
5729
6010
|
}
|
|
5730
6011
|
),
|
|
5731
|
-
/* @__PURE__ */
|
|
6012
|
+
/* @__PURE__ */ jsx24(
|
|
5732
6013
|
"input",
|
|
5733
6014
|
{
|
|
5734
6015
|
id: `${idPrefix}-lc-tpl-trail`,
|
|
@@ -5739,10 +6020,27 @@ function WidgetConfigForm({
|
|
|
5739
6020
|
}
|
|
5740
6021
|
)
|
|
5741
6022
|
] })
|
|
6023
|
+
] }),
|
|
6024
|
+
/* @__PURE__ */ jsxs21("div", { className: "dd-field dd-field-tight", children: [
|
|
6025
|
+
/* @__PURE__ */ jsx24(FieldLabel, { htmlFor: `${idPrefix}-lc-tpl-url`, help: t("helpLabelContainerUrl", HYPERLINK_TOKEN_HELP), children: t("labelLinkUrl") }),
|
|
6026
|
+
/* @__PURE__ */ jsx24(
|
|
6027
|
+
HyperlinkUrlInput,
|
|
6028
|
+
{
|
|
6029
|
+
id: `${idPrefix}-lc-tpl-url`,
|
|
6030
|
+
value: template.url ?? "",
|
|
6031
|
+
fields: [.../* @__PURE__ */ new Set([...previewData?.columns ?? [], ...resultFieldOptions])],
|
|
6032
|
+
onChange: (url) => patchTemplate({ url: url || void 0 }),
|
|
6033
|
+
placeholder: "{{var:url}}/record/{{field:Id}}"
|
|
6034
|
+
}
|
|
6035
|
+
),
|
|
6036
|
+
template.url && /* @__PURE__ */ jsxs21("label", { className: "dd-check-row", children: [
|
|
6037
|
+
/* @__PURE__ */ jsx24("input", { type: "checkbox", checked: template.urlNewTab !== false, onChange: (e) => patchTemplate({ urlNewTab: e.target.checked ? void 0 : false }) }),
|
|
6038
|
+
/* @__PURE__ */ jsx24("span", { className: "dd-check-row-text", children: t("labelClickUrlNewTab") })
|
|
6039
|
+
] })
|
|
5742
6040
|
] })
|
|
5743
6041
|
] });
|
|
5744
6042
|
})(),
|
|
5745
|
-
/* @__PURE__ */
|
|
6043
|
+
/* @__PURE__ */ jsx24(
|
|
5746
6044
|
QueryLabelDrillDownEditor,
|
|
5747
6045
|
{
|
|
5748
6046
|
data: queryResult ?? previewData,
|
|
@@ -5752,10 +6050,10 @@ function WidgetConfigForm({
|
|
|
5752
6050
|
onChange: (labelValueDrillDowns) => patch({ chartOptions: { ...widget.chartOptions, labelValueDrillDowns } })
|
|
5753
6051
|
}
|
|
5754
6052
|
)
|
|
5755
|
-
] }) : /* @__PURE__ */
|
|
5756
|
-
/* @__PURE__ */
|
|
5757
|
-
/* @__PURE__ */
|
|
5758
|
-
/* @__PURE__ */
|
|
6053
|
+
] }) : /* @__PURE__ */ jsxs21("div", { className: "dd-field", children: [
|
|
6054
|
+
/* @__PURE__ */ jsxs21("div", { className: "dd-field-label-row", children: [
|
|
6055
|
+
/* @__PURE__ */ jsx24(FieldLabel, { help: t("helpLabelContainerLabels"), children: t("labelContainerLabels") }),
|
|
6056
|
+
/* @__PURE__ */ jsxs21(
|
|
5759
6057
|
"button",
|
|
5760
6058
|
{
|
|
5761
6059
|
type: "button",
|
|
@@ -5770,17 +6068,17 @@ function WidgetConfigForm({
|
|
|
5770
6068
|
});
|
|
5771
6069
|
},
|
|
5772
6070
|
children: [
|
|
5773
|
-
/* @__PURE__ */
|
|
6071
|
+
/* @__PURE__ */ jsx24(Plus2, { size: ICON_SIZE }),
|
|
5774
6072
|
t("labelContainerAddLabel")
|
|
5775
6073
|
]
|
|
5776
6074
|
}
|
|
5777
6075
|
)
|
|
5778
6076
|
] }),
|
|
5779
|
-
/* @__PURE__ */
|
|
5780
|
-
/* @__PURE__ */
|
|
5781
|
-
/* @__PURE__ */
|
|
5782
|
-
/* @__PURE__ */
|
|
5783
|
-
/* @__PURE__ */
|
|
6077
|
+
/* @__PURE__ */ jsx24("div", { className: "dd-label-container-editor", children: normalizeContainerLabels2(widget.chartOptions.labels).map((item, index) => /* @__PURE__ */ jsxs21("div", { className: "dd-label-container-editor-item", children: [
|
|
6078
|
+
/* @__PURE__ */ jsxs21("div", { className: "dd-label-container-editor-head", children: [
|
|
6079
|
+
/* @__PURE__ */ jsx24("span", { className: "dd-muted", children: t("labelContainerLabelN", { n: index + 1 }) }),
|
|
6080
|
+
/* @__PURE__ */ jsxs21("div", { className: "dd-label-container-editor-actions", children: [
|
|
6081
|
+
/* @__PURE__ */ jsx24(
|
|
5784
6082
|
"button",
|
|
5785
6083
|
{
|
|
5786
6084
|
type: "button",
|
|
@@ -5794,10 +6092,10 @@ function WidgetConfigForm({
|
|
|
5794
6092
|
);
|
|
5795
6093
|
patch({ chartOptions: { ...widget.chartOptions, labels } });
|
|
5796
6094
|
},
|
|
5797
|
-
children: /* @__PURE__ */
|
|
6095
|
+
children: /* @__PURE__ */ jsx24(RotateCcw, { size: ICON_SIZE })
|
|
5798
6096
|
}
|
|
5799
6097
|
),
|
|
5800
|
-
/* @__PURE__ */
|
|
6098
|
+
/* @__PURE__ */ jsx24(
|
|
5801
6099
|
"button",
|
|
5802
6100
|
{
|
|
5803
6101
|
type: "button",
|
|
@@ -5812,14 +6110,14 @@ function WidgetConfigForm({
|
|
|
5812
6110
|
chartOptions: { ...widget.chartOptions, labels }
|
|
5813
6111
|
});
|
|
5814
6112
|
},
|
|
5815
|
-
children: /* @__PURE__ */
|
|
6113
|
+
children: /* @__PURE__ */ jsx24(Trash2, { size: ICON_SIZE })
|
|
5816
6114
|
}
|
|
5817
6115
|
)
|
|
5818
6116
|
] })
|
|
5819
6117
|
] }),
|
|
5820
|
-
/* @__PURE__ */
|
|
5821
|
-
/* @__PURE__ */
|
|
5822
|
-
/* @__PURE__ */
|
|
6118
|
+
/* @__PURE__ */ jsxs21("div", { className: "dd-field", children: [
|
|
6119
|
+
/* @__PURE__ */ jsx24(FieldLabel, { htmlFor: `${idPrefix}-lc-text-${item.id}`, children: t("labelText") }),
|
|
6120
|
+
/* @__PURE__ */ jsx24(
|
|
5823
6121
|
"textarea",
|
|
5824
6122
|
{
|
|
5825
6123
|
id: `${idPrefix}-lc-text-${item.id}`,
|
|
@@ -5835,10 +6133,10 @@ function WidgetConfigForm({
|
|
|
5835
6133
|
}
|
|
5836
6134
|
)
|
|
5837
6135
|
] }),
|
|
5838
|
-
/* @__PURE__ */
|
|
5839
|
-
/* @__PURE__ */
|
|
5840
|
-
/* @__PURE__ */
|
|
5841
|
-
/* @__PURE__ */
|
|
6136
|
+
/* @__PURE__ */ jsxs21("div", { className: "dd-field-row dd-label-style-row", children: [
|
|
6137
|
+
/* @__PURE__ */ jsxs21("div", { className: "dd-field dd-field-tight", children: [
|
|
6138
|
+
/* @__PURE__ */ jsx24(FieldLabel, { htmlFor: `${idPrefix}-lc-fg-${item.id}`, children: t("labelForeground") }),
|
|
6139
|
+
/* @__PURE__ */ jsx24(
|
|
5842
6140
|
"input",
|
|
5843
6141
|
{
|
|
5844
6142
|
id: `${idPrefix}-lc-fg-${item.id}`,
|
|
@@ -5854,9 +6152,9 @@ function WidgetConfigForm({
|
|
|
5854
6152
|
}
|
|
5855
6153
|
)
|
|
5856
6154
|
] }),
|
|
5857
|
-
/* @__PURE__ */
|
|
5858
|
-
/* @__PURE__ */
|
|
5859
|
-
/* @__PURE__ */
|
|
6155
|
+
/* @__PURE__ */ jsxs21("div", { className: "dd-field dd-field-tight", children: [
|
|
6156
|
+
/* @__PURE__ */ jsx24(FieldLabel, { htmlFor: `${idPrefix}-lc-item-bg-${item.id}`, children: t("labelBackground") }),
|
|
6157
|
+
/* @__PURE__ */ jsx24(
|
|
5860
6158
|
"input",
|
|
5861
6159
|
{
|
|
5862
6160
|
id: `${idPrefix}-lc-item-bg-${item.id}`,
|
|
@@ -5876,9 +6174,9 @@ function WidgetConfigForm({
|
|
|
5876
6174
|
}
|
|
5877
6175
|
)
|
|
5878
6176
|
] }),
|
|
5879
|
-
/* @__PURE__ */
|
|
5880
|
-
/* @__PURE__ */
|
|
5881
|
-
/* @__PURE__ */
|
|
6177
|
+
/* @__PURE__ */ jsxs21("div", { className: "dd-field dd-field-tight dd-label-color-swap", children: [
|
|
6178
|
+
/* @__PURE__ */ jsx24(FieldLabel, { help: t("helpSwapLabelColors"), children: t("swapLabelColors") }),
|
|
6179
|
+
/* @__PURE__ */ jsx24(
|
|
5882
6180
|
"button",
|
|
5883
6181
|
{
|
|
5884
6182
|
type: "button",
|
|
@@ -5899,13 +6197,13 @@ function WidgetConfigForm({
|
|
|
5899
6197
|
);
|
|
5900
6198
|
patch({ chartOptions: { ...widget.chartOptions, labels } });
|
|
5901
6199
|
},
|
|
5902
|
-
children: /* @__PURE__ */
|
|
6200
|
+
children: /* @__PURE__ */ jsx24(ArrowUpDown, { size: ICON_SIZE })
|
|
5903
6201
|
}
|
|
5904
6202
|
)
|
|
5905
6203
|
] }),
|
|
5906
|
-
/* @__PURE__ */
|
|
5907
|
-
/* @__PURE__ */
|
|
5908
|
-
/* @__PURE__ */
|
|
6204
|
+
/* @__PURE__ */ jsxs21("div", { className: "dd-field dd-field-tight", children: [
|
|
6205
|
+
/* @__PURE__ */ jsx24(FieldLabel, { htmlFor: `${idPrefix}-lc-size-${item.id}`, children: t("labelFontSize") }),
|
|
6206
|
+
/* @__PURE__ */ jsx24(
|
|
5909
6207
|
"input",
|
|
5910
6208
|
{
|
|
5911
6209
|
id: `${idPrefix}-lc-size-${item.id}`,
|
|
@@ -5930,8 +6228,8 @@ function WidgetConfigForm({
|
|
|
5930
6228
|
)
|
|
5931
6229
|
] })
|
|
5932
6230
|
] }),
|
|
5933
|
-
/* @__PURE__ */
|
|
5934
|
-
/* @__PURE__ */
|
|
6231
|
+
/* @__PURE__ */ jsx24("div", { className: "dd-field dd-field-tight", children: /* @__PURE__ */ jsxs21("label", { className: "dd-check-row", htmlFor: `${idPrefix}-lc-link-${item.id}`, children: [
|
|
6232
|
+
/* @__PURE__ */ jsx24(
|
|
5935
6233
|
"input",
|
|
5936
6234
|
{
|
|
5937
6235
|
id: `${idPrefix}-lc-link-${item.id}`,
|
|
@@ -5949,11 +6247,11 @@ function WidgetConfigForm({
|
|
|
5949
6247
|
}
|
|
5950
6248
|
}
|
|
5951
6249
|
),
|
|
5952
|
-
/* @__PURE__ */
|
|
6250
|
+
/* @__PURE__ */ jsx24("span", { className: "dd-check-row-text", children: t("labelOpenDashboard") })
|
|
5953
6251
|
] }) }),
|
|
5954
|
-
item.targetDashboardId && /* @__PURE__ */
|
|
5955
|
-
/* @__PURE__ */
|
|
5956
|
-
/* @__PURE__ */
|
|
6252
|
+
item.targetDashboardId && /* @__PURE__ */ jsxs21("div", { className: "dd-field dd-field-tight", children: [
|
|
6253
|
+
/* @__PURE__ */ jsx24(FieldLabel, { htmlFor: `${idPrefix}-lc-target-${item.id}`, children: t("drillTargetDashboard") }),
|
|
6254
|
+
/* @__PURE__ */ jsxs21(
|
|
5957
6255
|
"select",
|
|
5958
6256
|
{
|
|
5959
6257
|
id: `${idPrefix}-lc-target-${item.id}`,
|
|
@@ -5966,27 +6264,60 @@ function WidgetConfigForm({
|
|
|
5966
6264
|
patch({ chartOptions: { ...widget.chartOptions, labels } });
|
|
5967
6265
|
},
|
|
5968
6266
|
children: [
|
|
5969
|
-
/* @__PURE__ */
|
|
5970
|
-
dashboardOptions.map((d) => /* @__PURE__ */
|
|
6267
|
+
/* @__PURE__ */ jsx24("option", { value: "", children: t("selectDashboard") }),
|
|
6268
|
+
dashboardOptions.map((d) => /* @__PURE__ */ jsx24("option", { value: d.id, children: d.title }, d.id))
|
|
5971
6269
|
]
|
|
5972
6270
|
}
|
|
5973
6271
|
)
|
|
6272
|
+
] }),
|
|
6273
|
+
/* @__PURE__ */ jsxs21("div", { className: "dd-field dd-field-tight", children: [
|
|
6274
|
+
/* @__PURE__ */ jsx24(FieldLabel, { htmlFor: `${idPrefix}-lc-url-${item.id}`, help: t("helpLabelContainerUrl", HYPERLINK_TOKEN_HELP), children: t("labelLinkUrl") }),
|
|
6275
|
+
/* @__PURE__ */ jsx24(
|
|
6276
|
+
HyperlinkUrlInput,
|
|
6277
|
+
{
|
|
6278
|
+
id: `${idPrefix}-lc-url-${item.id}`,
|
|
6279
|
+
value: item.url ?? "",
|
|
6280
|
+
onChange: (url) => {
|
|
6281
|
+
const labels = normalizeContainerLabels2(widget.chartOptions.labels).map(
|
|
6282
|
+
(l) => l.id === item.id ? { ...l, url: url || void 0 } : l
|
|
6283
|
+
);
|
|
6284
|
+
patch({ chartOptions: { ...widget.chartOptions, labels } });
|
|
6285
|
+
},
|
|
6286
|
+
placeholder: "{{var:url}}/graph/123"
|
|
6287
|
+
}
|
|
6288
|
+
),
|
|
6289
|
+
item.url && /* @__PURE__ */ jsxs21("label", { className: "dd-check-row", children: [
|
|
6290
|
+
/* @__PURE__ */ jsx24(
|
|
6291
|
+
"input",
|
|
6292
|
+
{
|
|
6293
|
+
type: "checkbox",
|
|
6294
|
+
checked: item.urlNewTab !== false,
|
|
6295
|
+
onChange: (e) => {
|
|
6296
|
+
const labels = normalizeContainerLabels2(widget.chartOptions.labels).map(
|
|
6297
|
+
(l) => l.id === item.id ? { ...l, urlNewTab: e.target.checked ? void 0 : false } : l
|
|
6298
|
+
);
|
|
6299
|
+
patch({ chartOptions: { ...widget.chartOptions, labels } });
|
|
6300
|
+
}
|
|
6301
|
+
}
|
|
6302
|
+
),
|
|
6303
|
+
/* @__PURE__ */ jsx24("span", { className: "dd-check-row-text", children: t("labelClickUrlNewTab") })
|
|
6304
|
+
] })
|
|
5974
6305
|
] })
|
|
5975
6306
|
] }, item.id)) })
|
|
5976
6307
|
] })
|
|
5977
6308
|
] })
|
|
5978
6309
|
] })
|
|
5979
6310
|
] }),
|
|
5980
|
-
widget.type !== "label" && (widget.type !== "labelContainer" || labelContainerQuery) && /* @__PURE__ */
|
|
5981
|
-
/* @__PURE__ */
|
|
5982
|
-
/* @__PURE__ */
|
|
5983
|
-
/* @__PURE__ */
|
|
5984
|
-
/* @__PURE__ */
|
|
6311
|
+
widget.type !== "label" && (widget.type !== "labelContainer" || labelContainerQuery) && /* @__PURE__ */ jsxs21(Fragment10, { children: [
|
|
6312
|
+
/* @__PURE__ */ jsxs21("details", { className: "dd-config-section", open: true, children: [
|
|
6313
|
+
/* @__PURE__ */ jsxs21("summary", { children: [
|
|
6314
|
+
/* @__PURE__ */ jsx24("span", { children: "Data & columns" }),
|
|
6315
|
+
/* @__PURE__ */ jsx24("small", { children: "Connection, query and chart bindings" })
|
|
5985
6316
|
] }),
|
|
5986
|
-
/* @__PURE__ */
|
|
5987
|
-
/* @__PURE__ */
|
|
5988
|
-
/* @__PURE__ */
|
|
5989
|
-
/* @__PURE__ */
|
|
6317
|
+
/* @__PURE__ */ jsxs21("div", { className: "dd-config-section-body", children: [
|
|
6318
|
+
/* @__PURE__ */ jsxs21("div", { className: "dd-field", children: [
|
|
6319
|
+
/* @__PURE__ */ jsx24(FieldLabel, { htmlFor: `${idPrefix}-source`, help: t("helpDataSource"), children: t("dataSource") }),
|
|
6320
|
+
/* @__PURE__ */ jsxs21(
|
|
5990
6321
|
"select",
|
|
5991
6322
|
{
|
|
5992
6323
|
id: `${idPrefix}-source`,
|
|
@@ -6000,8 +6331,8 @@ function WidgetConfigForm({
|
|
|
6000
6331
|
columns: []
|
|
6001
6332
|
}),
|
|
6002
6333
|
children: [
|
|
6003
|
-
/* @__PURE__ */
|
|
6004
|
-
connections.map((c) => /* @__PURE__ */
|
|
6334
|
+
/* @__PURE__ */ jsx24("option", { value: "", children: "\u2014" }),
|
|
6335
|
+
connections.map((c) => /* @__PURE__ */ jsxs21("option", { value: c.id, children: [
|
|
6005
6336
|
c.name,
|
|
6006
6337
|
" (",
|
|
6007
6338
|
c.provider,
|
|
@@ -6011,9 +6342,9 @@ function WidgetConfigForm({
|
|
|
6011
6342
|
}
|
|
6012
6343
|
)
|
|
6013
6344
|
] }),
|
|
6014
|
-
/* @__PURE__ */
|
|
6015
|
-
/* @__PURE__ */
|
|
6016
|
-
/* @__PURE__ */
|
|
6345
|
+
/* @__PURE__ */ jsxs21("div", { className: "dd-field", children: [
|
|
6346
|
+
/* @__PURE__ */ jsx24(FieldLabel, { htmlFor: `${idPrefix}-sql`, help: t("helpRawSql"), children: t("rawSql") }),
|
|
6347
|
+
/* @__PURE__ */ jsx24(
|
|
6017
6348
|
"textarea",
|
|
6018
6349
|
{
|
|
6019
6350
|
id: `${idPrefix}-sql`,
|
|
@@ -6027,14 +6358,14 @@ function WidgetConfigForm({
|
|
|
6027
6358
|
})
|
|
6028
6359
|
}
|
|
6029
6360
|
),
|
|
6030
|
-
/* @__PURE__ */
|
|
6361
|
+
/* @__PURE__ */ jsx24(VariablePicker, { onSelect: (token) => {
|
|
6031
6362
|
const input = document.getElementById(`${idPrefix}-sql`);
|
|
6032
6363
|
const sql = widget.query.rawSql || "";
|
|
6033
6364
|
const start = input?.selectionStart ?? sql.length;
|
|
6034
6365
|
const end = input?.selectionEnd ?? start;
|
|
6035
6366
|
patchQuery({ rawSql: sql.slice(0, start) + token + sql.slice(end) });
|
|
6036
6367
|
} }),
|
|
6037
|
-
variables.definitions.length > 0 && /* @__PURE__ */
|
|
6368
|
+
variables.definitions.length > 0 && /* @__PURE__ */ jsxs21("p", { className: "dd-hint", children: [
|
|
6038
6369
|
"Use ",
|
|
6039
6370
|
"{{var:name}}",
|
|
6040
6371
|
" as an unquoted SQL value, for example UserId = ",
|
|
@@ -6042,7 +6373,7 @@ function WidgetConfigForm({
|
|
|
6042
6373
|
"."
|
|
6043
6374
|
] })
|
|
6044
6375
|
] }),
|
|
6045
|
-
isSqlServer && procedureName && /* @__PURE__ */
|
|
6376
|
+
isSqlServer && procedureName && /* @__PURE__ */ jsx24(
|
|
6046
6377
|
ProcedureParametersEditor,
|
|
6047
6378
|
{
|
|
6048
6379
|
api,
|
|
@@ -6054,14 +6385,14 @@ function WidgetConfigForm({
|
|
|
6054
6385
|
idPrefix
|
|
6055
6386
|
}
|
|
6056
6387
|
),
|
|
6057
|
-
isSqlServer && isProcedureCall && !procedureName && /* @__PURE__ */
|
|
6058
|
-
/* @__PURE__ */
|
|
6059
|
-
/* @__PURE__ */
|
|
6388
|
+
isSqlServer && isProcedureCall && !procedureName && /* @__PURE__ */ jsx24("p", { className: "dd-hint", children: t("procedureBareCallHint") }),
|
|
6389
|
+
/* @__PURE__ */ jsxs21("div", { className: "dd-field", children: [
|
|
6390
|
+
/* @__PURE__ */ jsxs21(FieldLabel, { htmlFor: `${idPrefix}-tables`, help: t("helpTables"), children: [
|
|
6060
6391
|
t("query"),
|
|
6061
6392
|
" \u2014 ",
|
|
6062
6393
|
t("tables")
|
|
6063
6394
|
] }),
|
|
6064
|
-
/* @__PURE__ */
|
|
6395
|
+
/* @__PURE__ */ jsx24(
|
|
6065
6396
|
SearchableSelect,
|
|
6066
6397
|
{
|
|
6067
6398
|
id: `${idPrefix}-tables`,
|
|
@@ -6074,15 +6405,15 @@ function WidgetConfigForm({
|
|
|
6074
6405
|
emptyLabel: !widget.query.connectionId ? t("selectDataSourceFirst") : t("noTablesFound")
|
|
6075
6406
|
}
|
|
6076
6407
|
),
|
|
6077
|
-
selectedTables.length > 1 && /* @__PURE__ */
|
|
6408
|
+
selectedTables.length > 1 && /* @__PURE__ */ jsx24("p", { className: "dd-hint", children: t("multiTableJoinHint") })
|
|
6078
6409
|
] }),
|
|
6079
|
-
/* @__PURE__ */
|
|
6080
|
-
/* @__PURE__ */
|
|
6081
|
-
/* @__PURE__ */
|
|
6410
|
+
/* @__PURE__ */ jsxs21("div", { className: "dd-row-between", children: [
|
|
6411
|
+
/* @__PURE__ */ jsxs21(FieldLabel, { help: t("helpJoins"), children: [
|
|
6412
|
+
/* @__PURE__ */ jsx24(Link2, { size: 14, "aria-hidden": true }),
|
|
6082
6413
|
" ",
|
|
6083
6414
|
t("joins")
|
|
6084
6415
|
] }),
|
|
6085
|
-
/* @__PURE__ */
|
|
6416
|
+
/* @__PURE__ */ jsx24(
|
|
6086
6417
|
"button",
|
|
6087
6418
|
{
|
|
6088
6419
|
type: "button",
|
|
@@ -6090,20 +6421,20 @@ function WidgetConfigForm({
|
|
|
6090
6421
|
onClick: addJoin,
|
|
6091
6422
|
title: t("add"),
|
|
6092
6423
|
"aria-label": t("add"),
|
|
6093
|
-
children: /* @__PURE__ */
|
|
6424
|
+
children: /* @__PURE__ */ jsx24(Plus2, { size: ICON_SIZE })
|
|
6094
6425
|
}
|
|
6095
6426
|
)
|
|
6096
6427
|
] }),
|
|
6097
|
-
incompleteJoins.length > 0 && /* @__PURE__ */
|
|
6098
|
-
(widget.query.joins || []).map((j, index) => /* @__PURE__ */
|
|
6099
|
-
/* @__PURE__ */
|
|
6100
|
-
/* @__PURE__ */
|
|
6428
|
+
incompleteJoins.length > 0 && /* @__PURE__ */ jsx24("p", { className: "dd-hint dd-hint-warn", children: t("incompleteJoinHint") }),
|
|
6429
|
+
(widget.query.joins || []).map((j, index) => /* @__PURE__ */ jsxs21("div", { className: "dd-join-block", children: [
|
|
6430
|
+
/* @__PURE__ */ jsxs21("div", { className: "dd-join-block-header", children: [
|
|
6431
|
+
/* @__PURE__ */ jsxs21("span", { className: "dd-join-block-title", children: [
|
|
6101
6432
|
t("joins"),
|
|
6102
6433
|
" ",
|
|
6103
6434
|
index + 1,
|
|
6104
|
-
/* @__PURE__ */
|
|
6435
|
+
/* @__PURE__ */ jsx24(FieldHelp, { text: t("helpJoinBlock") })
|
|
6105
6436
|
] }),
|
|
6106
|
-
/* @__PURE__ */
|
|
6437
|
+
/* @__PURE__ */ jsx24(
|
|
6107
6438
|
"button",
|
|
6108
6439
|
{
|
|
6109
6440
|
type: "button",
|
|
@@ -6111,31 +6442,31 @@ function WidgetConfigForm({
|
|
|
6111
6442
|
title: t("removeJoin"),
|
|
6112
6443
|
"aria-label": t("removeJoin"),
|
|
6113
6444
|
onClick: () => removeJoin(j.id),
|
|
6114
|
-
children: /* @__PURE__ */
|
|
6445
|
+
children: /* @__PURE__ */ jsx24(Trash2, { size: ICON_SIZE })
|
|
6115
6446
|
}
|
|
6116
6447
|
)
|
|
6117
6448
|
] }),
|
|
6118
|
-
/* @__PURE__ */
|
|
6119
|
-
/* @__PURE__ */
|
|
6120
|
-
/* @__PURE__ */
|
|
6121
|
-
/* @__PURE__ */
|
|
6449
|
+
/* @__PURE__ */ jsxs21("div", { className: "dd-join-fields", children: [
|
|
6450
|
+
/* @__PURE__ */ jsxs21("div", { className: "dd-field dd-field-tight", children: [
|
|
6451
|
+
/* @__PURE__ */ jsx24(FieldLabel, { help: t("helpJoinType"), children: t("joinType") }),
|
|
6452
|
+
/* @__PURE__ */ jsxs21(
|
|
6122
6453
|
"select",
|
|
6123
6454
|
{
|
|
6124
6455
|
className: "dd-input",
|
|
6125
6456
|
value: j.type,
|
|
6126
6457
|
onChange: (e) => updateJoin(j.id, { type: e.target.value }),
|
|
6127
6458
|
children: [
|
|
6128
|
-
/* @__PURE__ */
|
|
6129
|
-
/* @__PURE__ */
|
|
6130
|
-
/* @__PURE__ */
|
|
6131
|
-
/* @__PURE__ */
|
|
6459
|
+
/* @__PURE__ */ jsx24("option", { value: "inner", children: "INNER" }),
|
|
6460
|
+
/* @__PURE__ */ jsx24("option", { value: "left", children: "LEFT" }),
|
|
6461
|
+
/* @__PURE__ */ jsx24("option", { value: "right", children: "RIGHT" }),
|
|
6462
|
+
/* @__PURE__ */ jsx24("option", { value: "full", children: "FULL" })
|
|
6132
6463
|
]
|
|
6133
6464
|
}
|
|
6134
6465
|
)
|
|
6135
6466
|
] }),
|
|
6136
|
-
/* @__PURE__ */
|
|
6137
|
-
/* @__PURE__ */
|
|
6138
|
-
/* @__PURE__ */
|
|
6467
|
+
/* @__PURE__ */ jsxs21("div", { className: "dd-field dd-field-tight", children: [
|
|
6468
|
+
/* @__PURE__ */ jsx24(FieldLabel, { help: t("helpLeftTable"), children: t("leftTable") }),
|
|
6469
|
+
/* @__PURE__ */ jsx24(
|
|
6139
6470
|
SearchableSelect,
|
|
6140
6471
|
{
|
|
6141
6472
|
options: tables,
|
|
@@ -6147,9 +6478,9 @@ function WidgetConfigForm({
|
|
|
6147
6478
|
}
|
|
6148
6479
|
)
|
|
6149
6480
|
] }),
|
|
6150
|
-
/* @__PURE__ */
|
|
6151
|
-
/* @__PURE__ */
|
|
6152
|
-
/* @__PURE__ */
|
|
6481
|
+
/* @__PURE__ */ jsxs21("div", { className: "dd-field dd-field-tight", children: [
|
|
6482
|
+
/* @__PURE__ */ jsx24(FieldLabel, { help: t("helpLeftColumn"), children: t("leftColumn") }),
|
|
6483
|
+
/* @__PURE__ */ jsx24(
|
|
6153
6484
|
SearchableSelect,
|
|
6154
6485
|
{
|
|
6155
6486
|
options: columnsForTable(j.leftTable),
|
|
@@ -6162,9 +6493,9 @@ function WidgetConfigForm({
|
|
|
6162
6493
|
}
|
|
6163
6494
|
)
|
|
6164
6495
|
] }),
|
|
6165
|
-
/* @__PURE__ */
|
|
6166
|
-
/* @__PURE__ */
|
|
6167
|
-
/* @__PURE__ */
|
|
6496
|
+
/* @__PURE__ */ jsxs21("div", { className: "dd-field dd-field-tight", children: [
|
|
6497
|
+
/* @__PURE__ */ jsx24(FieldLabel, { help: t("helpRightTable"), children: t("rightTable") }),
|
|
6498
|
+
/* @__PURE__ */ jsx24(
|
|
6168
6499
|
SearchableSelect,
|
|
6169
6500
|
{
|
|
6170
6501
|
options: tables,
|
|
@@ -6176,9 +6507,9 @@ function WidgetConfigForm({
|
|
|
6176
6507
|
}
|
|
6177
6508
|
)
|
|
6178
6509
|
] }),
|
|
6179
|
-
/* @__PURE__ */
|
|
6180
|
-
/* @__PURE__ */
|
|
6181
|
-
/* @__PURE__ */
|
|
6510
|
+
/* @__PURE__ */ jsxs21("div", { className: "dd-field dd-field-tight", children: [
|
|
6511
|
+
/* @__PURE__ */ jsx24(FieldLabel, { help: t("helpRightColumn"), children: t("rightColumn") }),
|
|
6512
|
+
/* @__PURE__ */ jsx24(
|
|
6182
6513
|
SearchableSelect,
|
|
6183
6514
|
{
|
|
6184
6515
|
options: columnsForTable(j.rightTable),
|
|
@@ -6193,9 +6524,9 @@ function WidgetConfigForm({
|
|
|
6193
6524
|
] })
|
|
6194
6525
|
] })
|
|
6195
6526
|
] }, j.id)),
|
|
6196
|
-
bindingErrorKey && /* @__PURE__ */
|
|
6197
|
-
widget.type !== "kpi" && /* @__PURE__ */
|
|
6198
|
-
/* @__PURE__ */
|
|
6527
|
+
bindingErrorKey && /* @__PURE__ */ jsx24("div", { className: "dd-hint dd-hint-warn", role: "status", children: t(bindingErrorKey) }),
|
|
6528
|
+
widget.type !== "kpi" && /* @__PURE__ */ jsxs21("div", { className: "dd-field", children: [
|
|
6529
|
+
/* @__PURE__ */ jsx24(
|
|
6199
6530
|
FieldLabel,
|
|
6200
6531
|
{
|
|
6201
6532
|
htmlFor: `${idPrefix}-dims`,
|
|
@@ -6203,7 +6534,7 @@ function WidgetConfigForm({
|
|
|
6203
6534
|
children: widget.type === "timeline" ? "Status column" : widget.type === "pie" ? t("pieCategory") : widget.type === "table" ? t("tableColumns") : widget.type === "listbox" ? t("listboxValues") : widget.type === "labelContainer" ? t("labelContainerColumn") : t("xAxis")
|
|
6204
6535
|
}
|
|
6205
6536
|
),
|
|
6206
|
-
/* @__PURE__ */
|
|
6537
|
+
/* @__PURE__ */ jsx24(
|
|
6207
6538
|
SearchableSelect,
|
|
6208
6539
|
{
|
|
6209
6540
|
id: `${idPrefix}-dims`,
|
|
@@ -6217,8 +6548,8 @@ function WidgetConfigForm({
|
|
|
6217
6548
|
}
|
|
6218
6549
|
)
|
|
6219
6550
|
] }),
|
|
6220
|
-
widget.type !== "listbox" && widget.type !== "labelContainer" && /* @__PURE__ */
|
|
6221
|
-
/* @__PURE__ */
|
|
6551
|
+
widget.type !== "listbox" && widget.type !== "labelContainer" && /* @__PURE__ */ jsxs21("div", { className: "dd-field", children: [
|
|
6552
|
+
/* @__PURE__ */ jsx24(
|
|
6222
6553
|
FieldLabel,
|
|
6223
6554
|
{
|
|
6224
6555
|
htmlFor: `${idPrefix}-measures`,
|
|
@@ -6226,7 +6557,7 @@ function WidgetConfigForm({
|
|
|
6226
6557
|
children: widget.type === "timeline" ? "Record detail columns" : widget.type === "pie" ? t("pieValue") : widget.type === "kpi" ? t("kpiValue") : widget.type === "table" ? t("tableValues") : t("yAxis")
|
|
6227
6558
|
}
|
|
6228
6559
|
),
|
|
6229
|
-
/* @__PURE__ */
|
|
6560
|
+
/* @__PURE__ */ jsx24(
|
|
6230
6561
|
SearchableSelect,
|
|
6231
6562
|
{
|
|
6232
6563
|
id: `${idPrefix}-measures`,
|
|
@@ -6240,29 +6571,29 @@ function WidgetConfigForm({
|
|
|
6240
6571
|
}
|
|
6241
6572
|
)
|
|
6242
6573
|
] }),
|
|
6243
|
-
chartTypesWithMeasureAggregation(widget.type) && widget.binding.measures.length > 0 && /* @__PURE__ */
|
|
6244
|
-
/* @__PURE__ */
|
|
6245
|
-
/* @__PURE__ */
|
|
6246
|
-
/* @__PURE__ */
|
|
6247
|
-
/* @__PURE__ */
|
|
6574
|
+
chartTypesWithMeasureAggregation(widget.type) && widget.binding.measures.length > 0 && /* @__PURE__ */ jsxs21("div", { className: "dd-field", children: [
|
|
6575
|
+
/* @__PURE__ */ jsx24(FieldLabel, { help: t("helpMeasureAggregations"), children: t("measureAggregations") }),
|
|
6576
|
+
/* @__PURE__ */ jsx24("div", { className: "dd-measure-aggregations", children: widget.binding.measures.map((field) => /* @__PURE__ */ jsxs21("div", { className: "dd-measure-agg-row", children: [
|
|
6577
|
+
/* @__PURE__ */ jsx24("span", { className: "dd-measure-agg-field", title: field, children: field }),
|
|
6578
|
+
/* @__PURE__ */ jsx24(
|
|
6248
6579
|
"select",
|
|
6249
6580
|
{
|
|
6250
6581
|
className: "dd-input dd-measure-agg-select",
|
|
6251
6582
|
"aria-label": t("measureAggregationFor", { field }),
|
|
6252
6583
|
value: getMeasureAggregation(widget, field),
|
|
6253
6584
|
onChange: (e) => patchMeasureAggregation(field, e.target.value),
|
|
6254
|
-
children: MEASURE_AGGREGATIONS.map((agg) => /* @__PURE__ */
|
|
6585
|
+
children: MEASURE_AGGREGATIONS.map((agg) => /* @__PURE__ */ jsx24("option", { value: agg, children: t(`agg_${agg}`) }, agg))
|
|
6255
6586
|
}
|
|
6256
6587
|
)
|
|
6257
6588
|
] }, field)) })
|
|
6258
6589
|
] }),
|
|
6259
|
-
(widget.type === "bar" || widget.type === "line") && /* @__PURE__ */
|
|
6260
|
-
/* @__PURE__ */
|
|
6261
|
-
/* @__PURE__ */
|
|
6262
|
-
/* @__PURE__ */
|
|
6263
|
-
/* @__PURE__ */
|
|
6264
|
-
/* @__PURE__ */
|
|
6265
|
-
/* @__PURE__ */
|
|
6590
|
+
(widget.type === "bar" || widget.type === "line") && /* @__PURE__ */ jsxs21("div", { className: "dd-field dd-guidelines-editor", children: [
|
|
6591
|
+
/* @__PURE__ */ jsx24("div", { className: "dd-row-between", children: /* @__PURE__ */ jsx24(FieldLabel, { help: t("helpAxisGuidelines"), children: t("axisGuidelines") }) }),
|
|
6592
|
+
/* @__PURE__ */ jsx24("p", { className: "dd-hint", children: t("axisGuidelinesHint") }),
|
|
6593
|
+
/* @__PURE__ */ jsxs21("div", { className: "dd-guidelines-group", children: [
|
|
6594
|
+
/* @__PURE__ */ jsxs21("div", { className: "dd-guidelines-group-head", children: [
|
|
6595
|
+
/* @__PURE__ */ jsx24("span", { className: "dd-guidelines-group-title", children: t("yAxisGuidelines") }),
|
|
6596
|
+
/* @__PURE__ */ jsx24(
|
|
6266
6597
|
"button",
|
|
6267
6598
|
{
|
|
6268
6599
|
type: "button",
|
|
@@ -6278,11 +6609,11 @@ function WidgetConfigForm({
|
|
|
6278
6609
|
}
|
|
6279
6610
|
});
|
|
6280
6611
|
},
|
|
6281
|
-
children: /* @__PURE__ */
|
|
6612
|
+
children: /* @__PURE__ */ jsx24(Plus2, { size: ICON_SIZE })
|
|
6282
6613
|
}
|
|
6283
6614
|
)
|
|
6284
6615
|
] }),
|
|
6285
|
-
normalizeChartAxisGuidelines2(widget.chartOptions.axisGuidelines).filter((g) => g.axis === "y").map((item, index) => /* @__PURE__ */
|
|
6616
|
+
normalizeChartAxisGuidelines2(widget.chartOptions.axisGuidelines).filter((g) => g.axis === "y").map((item, index) => /* @__PURE__ */ jsx24(
|
|
6286
6617
|
GuidelineRow,
|
|
6287
6618
|
{
|
|
6288
6619
|
item,
|
|
@@ -6317,10 +6648,10 @@ function WidgetConfigForm({
|
|
|
6317
6648
|
item.id
|
|
6318
6649
|
))
|
|
6319
6650
|
] }),
|
|
6320
|
-
/* @__PURE__ */
|
|
6321
|
-
/* @__PURE__ */
|
|
6322
|
-
/* @__PURE__ */
|
|
6323
|
-
/* @__PURE__ */
|
|
6651
|
+
/* @__PURE__ */ jsxs21("div", { className: "dd-guidelines-group", children: [
|
|
6652
|
+
/* @__PURE__ */ jsxs21("div", { className: "dd-guidelines-group-head", children: [
|
|
6653
|
+
/* @__PURE__ */ jsx24("span", { className: "dd-guidelines-group-title", children: t("xAxisGuidelines") }),
|
|
6654
|
+
/* @__PURE__ */ jsx24(
|
|
6324
6655
|
"button",
|
|
6325
6656
|
{
|
|
6326
6657
|
type: "button",
|
|
@@ -6336,11 +6667,11 @@ function WidgetConfigForm({
|
|
|
6336
6667
|
}
|
|
6337
6668
|
});
|
|
6338
6669
|
},
|
|
6339
|
-
children: /* @__PURE__ */
|
|
6670
|
+
children: /* @__PURE__ */ jsx24(Plus2, { size: ICON_SIZE })
|
|
6340
6671
|
}
|
|
6341
6672
|
)
|
|
6342
6673
|
] }),
|
|
6343
|
-
normalizeChartAxisGuidelines2(widget.chartOptions.axisGuidelines).filter((g) => g.axis === "x").map((item, index) => /* @__PURE__ */
|
|
6674
|
+
normalizeChartAxisGuidelines2(widget.chartOptions.axisGuidelines).filter((g) => g.axis === "x").map((item, index) => /* @__PURE__ */ jsx24(
|
|
6344
6675
|
GuidelineRow,
|
|
6345
6676
|
{
|
|
6346
6677
|
item,
|
|
@@ -6376,10 +6707,10 @@ function WidgetConfigForm({
|
|
|
6376
6707
|
))
|
|
6377
6708
|
] })
|
|
6378
6709
|
] }),
|
|
6379
|
-
widget.type === "listbox" && /* @__PURE__ */
|
|
6380
|
-
/* @__PURE__ */
|
|
6381
|
-
/* @__PURE__ */
|
|
6382
|
-
/* @__PURE__ */
|
|
6710
|
+
widget.type === "listbox" && /* @__PURE__ */ jsxs21(Fragment10, { children: [
|
|
6711
|
+
/* @__PURE__ */ jsxs21("div", { className: "dd-field", children: [
|
|
6712
|
+
/* @__PURE__ */ jsx24(FieldLabel, { htmlFor: `${idPrefix}-filter-field`, help: t("helpListboxFilterField"), children: t("listboxFilterField") }),
|
|
6713
|
+
/* @__PURE__ */ jsx24(
|
|
6383
6714
|
"input",
|
|
6384
6715
|
{
|
|
6385
6716
|
id: `${idPrefix}-filter-field`,
|
|
@@ -6395,9 +6726,9 @@ function WidgetConfigForm({
|
|
|
6395
6726
|
}
|
|
6396
6727
|
)
|
|
6397
6728
|
] }),
|
|
6398
|
-
/* @__PURE__ */
|
|
6399
|
-
/* @__PURE__ */
|
|
6400
|
-
/* @__PURE__ */
|
|
6729
|
+
/* @__PURE__ */ jsxs21("div", { className: "dd-field dd-check-field", children: [
|
|
6730
|
+
/* @__PURE__ */ jsxs21("label", { className: "dd-check-row", htmlFor: `${idPrefix}-multi`, children: [
|
|
6731
|
+
/* @__PURE__ */ jsx24(
|
|
6401
6732
|
"input",
|
|
6402
6733
|
{
|
|
6403
6734
|
id: `${idPrefix}-multi`,
|
|
@@ -6408,13 +6739,13 @@ function WidgetConfigForm({
|
|
|
6408
6739
|
})
|
|
6409
6740
|
}
|
|
6410
6741
|
),
|
|
6411
|
-
/* @__PURE__ */
|
|
6742
|
+
/* @__PURE__ */ jsx24("span", { className: "dd-check-row-text", children: t("listboxMultiSelect") })
|
|
6412
6743
|
] }),
|
|
6413
|
-
/* @__PURE__ */
|
|
6744
|
+
/* @__PURE__ */ jsx24(FieldHelp, { text: t("helpListboxMultiSelect") })
|
|
6414
6745
|
] }),
|
|
6415
|
-
/* @__PURE__ */
|
|
6416
|
-
/* @__PURE__ */
|
|
6417
|
-
/* @__PURE__ */
|
|
6746
|
+
/* @__PURE__ */ jsxs21("div", { className: "dd-field dd-check-field", children: [
|
|
6747
|
+
/* @__PURE__ */ jsxs21("label", { className: "dd-check-row", htmlFor: `${idPrefix}-show-all`, children: [
|
|
6748
|
+
/* @__PURE__ */ jsx24(
|
|
6418
6749
|
"input",
|
|
6419
6750
|
{
|
|
6420
6751
|
id: `${idPrefix}-show-all`,
|
|
@@ -6425,21 +6756,21 @@ function WidgetConfigForm({
|
|
|
6425
6756
|
})
|
|
6426
6757
|
}
|
|
6427
6758
|
),
|
|
6428
|
-
/* @__PURE__ */
|
|
6759
|
+
/* @__PURE__ */ jsx24("span", { className: "dd-check-row-text", children: t("listboxShowAll") })
|
|
6429
6760
|
] }),
|
|
6430
|
-
/* @__PURE__ */
|
|
6761
|
+
/* @__PURE__ */ jsx24(FieldHelp, { text: t("helpListboxShowAll") })
|
|
6431
6762
|
] })
|
|
6432
6763
|
] })
|
|
6433
6764
|
] })
|
|
6434
6765
|
] }),
|
|
6435
|
-
/* @__PURE__ */
|
|
6436
|
-
/* @__PURE__ */
|
|
6437
|
-
/* @__PURE__ */
|
|
6438
|
-
/* @__PURE__ */
|
|
6766
|
+
/* @__PURE__ */ jsxs21("details", { className: "dd-config-section", children: [
|
|
6767
|
+
/* @__PURE__ */ jsxs21("summary", { children: [
|
|
6768
|
+
/* @__PURE__ */ jsx24("span", { children: "Filters" }),
|
|
6769
|
+
/* @__PURE__ */ jsx24("small", { children: "Widget controls and data conditions" })
|
|
6439
6770
|
] }),
|
|
6440
|
-
/* @__PURE__ */
|
|
6441
|
-
/* @__PURE__ */
|
|
6442
|
-
/* @__PURE__ */
|
|
6771
|
+
/* @__PURE__ */ jsxs21("div", { className: "dd-config-section-body", children: [
|
|
6772
|
+
/* @__PURE__ */ jsx24(FilterBar, { title: "Widget filters", hint: "Shown on this widget only. Viewers can change values to filter the loaded records without affecting other widgets. Leave empty to hide the controls.", filters: widget.chartOptions.widgetFilters ?? [], onChange: (widgetFilters) => patch({ chartOptions: { ...widget.chartOptions, widgetFilters } }), fieldOptions: columnOptions }),
|
|
6773
|
+
/* @__PURE__ */ jsx24(
|
|
6443
6774
|
FilterBar,
|
|
6444
6775
|
{
|
|
6445
6776
|
title: t("frontendFilters"),
|
|
@@ -6455,7 +6786,7 @@ function WidgetConfigForm({
|
|
|
6455
6786
|
fieldDisabled: !hasColumnSource
|
|
6456
6787
|
}
|
|
6457
6788
|
),
|
|
6458
|
-
/* @__PURE__ */
|
|
6789
|
+
/* @__PURE__ */ jsx24(
|
|
6459
6790
|
FilterBar,
|
|
6460
6791
|
{
|
|
6461
6792
|
title: t("whereFilters"),
|
|
@@ -6477,7 +6808,7 @@ function WidgetConfigForm({
|
|
|
6477
6808
|
defaultClause: "where"
|
|
6478
6809
|
}
|
|
6479
6810
|
),
|
|
6480
|
-
/* @__PURE__ */
|
|
6811
|
+
/* @__PURE__ */ jsx24(
|
|
6481
6812
|
FilterBar,
|
|
6482
6813
|
{
|
|
6483
6814
|
title: t("chartFilters"),
|
|
@@ -6504,19 +6835,19 @@ function WidgetConfigForm({
|
|
|
6504
6835
|
)
|
|
6505
6836
|
] })
|
|
6506
6837
|
] }),
|
|
6507
|
-
/* @__PURE__ */
|
|
6508
|
-
/* @__PURE__ */
|
|
6509
|
-
/* @__PURE__ */
|
|
6510
|
-
/* @__PURE__ */
|
|
6838
|
+
/* @__PURE__ */ jsxs21("details", { className: "dd-config-section", children: [
|
|
6839
|
+
/* @__PURE__ */ jsxs21("summary", { children: [
|
|
6840
|
+
/* @__PURE__ */ jsx24("span", { children: "Query ordering" }),
|
|
6841
|
+
/* @__PURE__ */ jsx24("small", { children: "Sort records at the data source" })
|
|
6511
6842
|
] }),
|
|
6512
|
-
/* @__PURE__ */
|
|
6513
|
-
/* @__PURE__ */
|
|
6514
|
-
/* @__PURE__ */
|
|
6515
|
-
/* @__PURE__ */
|
|
6843
|
+
/* @__PURE__ */ jsxs21("div", { className: "dd-config-section-body", children: [
|
|
6844
|
+
/* @__PURE__ */ jsxs21("div", { className: "dd-row-between", children: [
|
|
6845
|
+
/* @__PURE__ */ jsxs21(FieldLabel, { help: t("orderByHint"), children: [
|
|
6846
|
+
/* @__PURE__ */ jsx24(ArrowUpDown, { size: 14, "aria-hidden": true }),
|
|
6516
6847
|
" ",
|
|
6517
6848
|
t("orderBy")
|
|
6518
6849
|
] }),
|
|
6519
|
-
/* @__PURE__ */
|
|
6850
|
+
/* @__PURE__ */ jsx24(
|
|
6520
6851
|
"button",
|
|
6521
6852
|
{
|
|
6522
6853
|
type: "button",
|
|
@@ -6525,19 +6856,19 @@ function WidgetConfigForm({
|
|
|
6525
6856
|
title: t("addOrderBy"),
|
|
6526
6857
|
"aria-label": t("addOrderBy"),
|
|
6527
6858
|
disabled: orderByColumnOptions.length === 0,
|
|
6528
|
-
children: /* @__PURE__ */
|
|
6859
|
+
children: /* @__PURE__ */ jsx24(Plus2, { size: ICON_SIZE })
|
|
6529
6860
|
}
|
|
6530
6861
|
)
|
|
6531
6862
|
] }),
|
|
6532
|
-
orderByRules.length === 0 && /* @__PURE__ */
|
|
6533
|
-
orderByRules.map((rule, index) => /* @__PURE__ */
|
|
6534
|
-
/* @__PURE__ */
|
|
6535
|
-
/* @__PURE__ */
|
|
6863
|
+
orderByRules.length === 0 && /* @__PURE__ */ jsx24("p", { className: "dd-hint", children: t("orderByEmptyHint") }),
|
|
6864
|
+
orderByRules.map((rule, index) => /* @__PURE__ */ jsxs21("div", { className: "dd-join-block", children: [
|
|
6865
|
+
/* @__PURE__ */ jsxs21("div", { className: "dd-join-block-header", children: [
|
|
6866
|
+
/* @__PURE__ */ jsxs21("span", { className: "dd-join-block-title", children: [
|
|
6536
6867
|
t("orderByRule"),
|
|
6537
6868
|
" ",
|
|
6538
6869
|
index + 1
|
|
6539
6870
|
] }),
|
|
6540
|
-
/* @__PURE__ */
|
|
6871
|
+
/* @__PURE__ */ jsx24(
|
|
6541
6872
|
"button",
|
|
6542
6873
|
{
|
|
6543
6874
|
type: "button",
|
|
@@ -6545,14 +6876,14 @@ function WidgetConfigForm({
|
|
|
6545
6876
|
title: t("removeOrderBy"),
|
|
6546
6877
|
"aria-label": t("removeOrderBy"),
|
|
6547
6878
|
onClick: () => removeOrderBy(index),
|
|
6548
|
-
children: /* @__PURE__ */
|
|
6879
|
+
children: /* @__PURE__ */ jsx24(Trash2, { size: ICON_SIZE })
|
|
6549
6880
|
}
|
|
6550
6881
|
)
|
|
6551
6882
|
] }),
|
|
6552
|
-
/* @__PURE__ */
|
|
6553
|
-
/* @__PURE__ */
|
|
6554
|
-
/* @__PURE__ */
|
|
6555
|
-
/* @__PURE__ */
|
|
6883
|
+
/* @__PURE__ */ jsxs21("div", { className: "dd-join-fields", children: [
|
|
6884
|
+
/* @__PURE__ */ jsxs21("div", { className: "dd-field dd-field-tight", children: [
|
|
6885
|
+
/* @__PURE__ */ jsx24(FieldLabel, { help: t("orderByColumnHint"), children: t("orderByColumn") }),
|
|
6886
|
+
/* @__PURE__ */ jsx24(
|
|
6556
6887
|
SearchableSelect,
|
|
6557
6888
|
{
|
|
6558
6889
|
options: orderByColumnOptions,
|
|
@@ -6565,9 +6896,9 @@ function WidgetConfigForm({
|
|
|
6565
6896
|
}
|
|
6566
6897
|
)
|
|
6567
6898
|
] }),
|
|
6568
|
-
/* @__PURE__ */
|
|
6569
|
-
/* @__PURE__ */
|
|
6570
|
-
/* @__PURE__ */
|
|
6899
|
+
/* @__PURE__ */ jsxs21("div", { className: "dd-field dd-field-tight", children: [
|
|
6900
|
+
/* @__PURE__ */ jsx24(FieldLabel, { help: t("orderByDirectionHint"), children: t("orderByDirection") }),
|
|
6901
|
+
/* @__PURE__ */ jsxs21(
|
|
6571
6902
|
"select",
|
|
6572
6903
|
{
|
|
6573
6904
|
className: "dd-input",
|
|
@@ -6576,8 +6907,8 @@ function WidgetConfigForm({
|
|
|
6576
6907
|
direction: e.target.value
|
|
6577
6908
|
}),
|
|
6578
6909
|
children: [
|
|
6579
|
-
/* @__PURE__ */
|
|
6580
|
-
/* @__PURE__ */
|
|
6910
|
+
/* @__PURE__ */ jsx24("option", { value: "asc", children: t("sortAscending") }),
|
|
6911
|
+
/* @__PURE__ */ jsx24("option", { value: "desc", children: t("sortDescending") })
|
|
6581
6912
|
]
|
|
6582
6913
|
}
|
|
6583
6914
|
)
|
|
@@ -6586,14 +6917,14 @@ function WidgetConfigForm({
|
|
|
6586
6917
|
] }, `order-${index}`))
|
|
6587
6918
|
] })
|
|
6588
6919
|
] }),
|
|
6589
|
-
/* @__PURE__ */
|
|
6590
|
-
/* @__PURE__ */
|
|
6591
|
-
runningQuery ? /* @__PURE__ */
|
|
6920
|
+
/* @__PURE__ */ jsxs21("div", { className: "dd-config-run", children: [
|
|
6921
|
+
/* @__PURE__ */ jsxs21("button", { type: "button", className: "dd-btn dd-btn-primary", onClick: runPreview, disabled: !variables.ready || runningQuery, "aria-busy": runningQuery, children: [
|
|
6922
|
+
runningQuery ? /* @__PURE__ */ jsx24(LoaderCircle, { size: ICON_SIZE, className: "dd-query-spinner", "aria-hidden": "true" }) : /* @__PURE__ */ jsx24(Play, { size: ICON_SIZE }),
|
|
6592
6923
|
runningQuery ? t("runningQuery") : t("runQuery")
|
|
6593
6924
|
] }),
|
|
6594
|
-
sqlPreview && /* @__PURE__ */
|
|
6595
|
-
queryResult && /* @__PURE__ */
|
|
6596
|
-
/* @__PURE__ */
|
|
6925
|
+
sqlPreview && /* @__PURE__ */ jsx24("pre", { className: "dd-sql-preview", children: sqlPreview }),
|
|
6926
|
+
queryResult && /* @__PURE__ */ jsxs21("div", { className: "dd-query-data-panel", children: [
|
|
6927
|
+
/* @__PURE__ */ jsxs21(
|
|
6597
6928
|
"button",
|
|
6598
6929
|
{
|
|
6599
6930
|
type: "button",
|
|
@@ -6602,54 +6933,63 @@ function WidgetConfigForm({
|
|
|
6602
6933
|
onClick: () => setShowQueryData((v) => !v),
|
|
6603
6934
|
children: [
|
|
6604
6935
|
showQueryData ? t("hideQueryData") : t("viewQueryData"),
|
|
6605
|
-
/* @__PURE__ */
|
|
6936
|
+
/* @__PURE__ */ jsx24("span", { className: "dd-query-data-toggle-count", children: t("queryDataRows", { count: queryResult.rowCount ?? queryResult.rows.length }) })
|
|
6606
6937
|
]
|
|
6607
6938
|
}
|
|
6608
6939
|
),
|
|
6609
|
-
showQueryData && /* @__PURE__ */
|
|
6940
|
+
showQueryData && /* @__PURE__ */ jsx24(QueryResultTable, { data: queryResult })
|
|
6610
6941
|
] })
|
|
6611
6942
|
] }),
|
|
6612
|
-
/* @__PURE__ */
|
|
6613
|
-
/* @__PURE__ */
|
|
6614
|
-
/* @__PURE__ */
|
|
6615
|
-
/* @__PURE__ */
|
|
6943
|
+
/* @__PURE__ */ jsxs21("details", { className: "dd-config-section", children: [
|
|
6944
|
+
/* @__PURE__ */ jsxs21("summary", { children: [
|
|
6945
|
+
/* @__PURE__ */ jsx24("span", { children: "Tables & interactions" }),
|
|
6946
|
+
/* @__PURE__ */ jsx24("small", { children: "Sorting, formatting and record details" })
|
|
6616
6947
|
] }),
|
|
6617
|
-
/* @__PURE__ */
|
|
6618
|
-
["table", "bar", "pie", "timeline", "kpi"].includes(widget.type) && /* @__PURE__ */
|
|
6619
|
-
widget.type === "table" && /* @__PURE__ */
|
|
6620
|
-
/* @__PURE__ */
|
|
6948
|
+
/* @__PURE__ */ jsxs21("div", { className: "dd-config-section-body", children: [
|
|
6949
|
+
["table", "bar", "pie", "timeline", "kpi"].includes(widget.type) && /* @__PURE__ */ jsx24(TableSortEditor, { options: widget.chartOptions, columns: [.../* @__PURE__ */ new Set([...previewData?.columns ?? [], ...resultFieldOptions])], onChange: (chartOptions) => patch({ chartOptions }) }),
|
|
6950
|
+
widget.type === "table" && /* @__PURE__ */ jsxs21("label", { className: "dd-check-row", children: [
|
|
6951
|
+
/* @__PURE__ */ jsx24("input", { type: "checkbox", checked: widget.chartOptions.tableColumnFiltersEnabled === true, onChange: (e) => patch({ chartOptions: { ...widget.chartOptions, tableColumnFiltersEnabled: e.target.checked } }) }),
|
|
6621
6952
|
"Enable column filters on table headers"
|
|
6622
6953
|
] }),
|
|
6623
|
-
widget.type === "table" && /* @__PURE__ */
|
|
6624
|
-
(widget.type === "kpi" || widget.type === "timeline" || widget.type === "pie" || widget.type === "bar") && /* @__PURE__ */
|
|
6625
|
-
/* @__PURE__ */
|
|
6626
|
-
/* @__PURE__ */
|
|
6627
|
-
/* @__PURE__ */
|
|
6628
|
-
/* @__PURE__ */
|
|
6629
|
-
/* @__PURE__ */
|
|
6954
|
+
widget.type === "table" && /* @__PURE__ */ jsx24(TableFormattingEditor, { value: widget.chartOptions.conditionalFormatting, columns: [.../* @__PURE__ */ new Set([...previewData?.columns ?? [], ...resultFieldOptions, ...columnOptions])], onChange: (rules) => patch({ chartOptions: { ...widget.chartOptions, conditionalFormatting: rules } }) }),
|
|
6955
|
+
(widget.type === "kpi" || widget.type === "timeline" || widget.type === "pie" || widget.type === "bar") && /* @__PURE__ */ jsxs21("div", { className: "dd-drill-section dd-record-details-config", children: [
|
|
6956
|
+
/* @__PURE__ */ jsxs21("label", { className: "dd-record-details-toggle", children: [
|
|
6957
|
+
/* @__PURE__ */ jsx24("input", { type: "checkbox", checked: widget.type === "timeline" ? widget.chartOptions.dataPopupEnabled !== false : widget.chartOptions.dataPopupEnabled === true, onChange: (e) => patch({ chartOptions: { ...widget.chartOptions, dataPopupEnabled: e.target.checked } }) }),
|
|
6958
|
+
/* @__PURE__ */ jsxs21("span", { children: [
|
|
6959
|
+
/* @__PURE__ */ jsx24("strong", { children: "Record details" }),
|
|
6960
|
+
/* @__PURE__ */ jsxs21("span", { className: "dd-record-details-description", children: [
|
|
6630
6961
|
widget.type === "kpi" ? "Click the KPI number to open its records." : "Click a chart item to open its records.",
|
|
6631
6962
|
" Available in view mode."
|
|
6632
6963
|
] })
|
|
6633
6964
|
] })
|
|
6634
6965
|
] }),
|
|
6635
|
-
(widget.type === "timeline" ? widget.chartOptions.dataPopupEnabled !== false : widget.chartOptions.dataPopupEnabled === true) && /* @__PURE__ */
|
|
6636
|
-
/* @__PURE__ */
|
|
6637
|
-
/* @__PURE__ */
|
|
6638
|
-
/* @__PURE__ */
|
|
6639
|
-
/* @__PURE__ */
|
|
6640
|
-
/* @__PURE__ */
|
|
6641
|
-
/* @__PURE__ */
|
|
6966
|
+
(widget.type === "timeline" ? widget.chartOptions.dataPopupEnabled !== false : widget.chartOptions.dataPopupEnabled === true) && /* @__PURE__ */ jsxs21("div", { className: "dd-record-details-options", children: [
|
|
6967
|
+
/* @__PURE__ */ jsx24("label", { className: "dd-record-details-label", htmlFor: `${idPrefix}-popup-columns`, children: "Columns to display" }),
|
|
6968
|
+
/* @__PURE__ */ jsx24(SearchableSelect, { id: `${idPrefix}-popup-columns`, options: [.../* @__PURE__ */ new Set([...previewData?.columns ?? [], ...resultFieldOptions, ...popupColumns(widget.chartOptions.dataPopupColumns)])], value: popupColumns(widget.chartOptions.dataPopupColumns), onChange: (columns) => patch({ chartOptions: { ...widget.chartOptions, dataPopupColumns: columns } }), placeholder: "All returned columns" }),
|
|
6969
|
+
/* @__PURE__ */ jsx24("p", { className: "dd-hint", children: "Leave empty to show all columns. Run the query to load available columns." }),
|
|
6970
|
+
/* @__PURE__ */ jsxs21("details", { className: "dd-record-details-help", children: [
|
|
6971
|
+
/* @__PURE__ */ jsx24("summary", { children: "How record details work" }),
|
|
6972
|
+
/* @__PURE__ */ jsxs21("p", { className: "dd-hint", children: [
|
|
6642
6973
|
widget.type === "kpi" ? "Shows the loaded rows used to calculate this KPI." : "Shows loaded rows matching the selected category.",
|
|
6643
6974
|
" Frontend filters apply. Aggregated queries show only their returned results."
|
|
6644
6975
|
] }),
|
|
6645
|
-
/* @__PURE__ */
|
|
6976
|
+
/* @__PURE__ */ jsx24("p", { className: "dd-hint", children: "When enabled, record details replace dashboard drill-down on click. Custom row actions are supplied by your application." })
|
|
6646
6977
|
] })
|
|
6647
6978
|
] })
|
|
6648
6979
|
] }),
|
|
6649
|
-
|
|
6650
|
-
|
|
6651
|
-
|
|
6652
|
-
|
|
6980
|
+
["bar", "line", "pie", "table", "kpi", "timeline"].includes(widget.type) && /* @__PURE__ */ jsx24(
|
|
6981
|
+
WidgetHyperlinkEditor,
|
|
6982
|
+
{
|
|
6983
|
+
chartOptions: widget.chartOptions,
|
|
6984
|
+
onChange: (chartOptions) => patch({ chartOptions }),
|
|
6985
|
+
fields: [.../* @__PURE__ */ new Set([...previewData?.columns ?? [], ...resultFieldOptions])],
|
|
6986
|
+
allowColumn: widget.type === "table"
|
|
6987
|
+
}
|
|
6988
|
+
),
|
|
6989
|
+
widget.type !== "labelContainer" && /* @__PURE__ */ jsxs21("div", { className: `dd-drill-section ${widget.drillDown ? "is-enabled" : ""}`, children: [
|
|
6990
|
+
/* @__PURE__ */ jsxs21("div", { className: "dd-drill-toggle", children: [
|
|
6991
|
+
/* @__PURE__ */ jsxs21("label", { className: "dd-check-row", htmlFor: `${idPrefix}-drill-enable`, children: [
|
|
6992
|
+
/* @__PURE__ */ jsx24(
|
|
6653
6993
|
"input",
|
|
6654
6994
|
{
|
|
6655
6995
|
id: `${idPrefix}-drill-enable`,
|
|
@@ -6669,14 +7009,14 @@ function WidgetConfigForm({
|
|
|
6669
7009
|
}
|
|
6670
7010
|
}
|
|
6671
7011
|
),
|
|
6672
|
-
/* @__PURE__ */
|
|
7012
|
+
/* @__PURE__ */ jsx24("span", { className: "dd-check-row-text", children: t("enableDrillDown") })
|
|
6673
7013
|
] }),
|
|
6674
|
-
/* @__PURE__ */
|
|
7014
|
+
/* @__PURE__ */ jsx24(FieldHelp, { text: t("drillDownHint") })
|
|
6675
7015
|
] }),
|
|
6676
|
-
widget.drillDown && /* @__PURE__ */
|
|
6677
|
-
/* @__PURE__ */
|
|
6678
|
-
/* @__PURE__ */
|
|
6679
|
-
/* @__PURE__ */
|
|
7016
|
+
widget.drillDown && /* @__PURE__ */ jsxs21("div", { className: "dd-drill-options", children: [
|
|
7017
|
+
/* @__PURE__ */ jsxs21("div", { className: "dd-field dd-field-tight", children: [
|
|
7018
|
+
/* @__PURE__ */ jsx24(FieldLabel, { htmlFor: `${idPrefix}-drill-title`, help: t("helpDrillTitle"), children: t("drillTitle") }),
|
|
7019
|
+
/* @__PURE__ */ jsx24(
|
|
6680
7020
|
"input",
|
|
6681
7021
|
{
|
|
6682
7022
|
id: `${idPrefix}-drill-title`,
|
|
@@ -6687,9 +7027,9 @@ function WidgetConfigForm({
|
|
|
6687
7027
|
}
|
|
6688
7028
|
)
|
|
6689
7029
|
] }),
|
|
6690
|
-
/* @__PURE__ */
|
|
6691
|
-
/* @__PURE__ */
|
|
6692
|
-
/* @__PURE__ */
|
|
7030
|
+
/* @__PURE__ */ jsxs21("div", { className: "dd-field dd-field-tight", children: [
|
|
7031
|
+
/* @__PURE__ */ jsx24(FieldLabel, { htmlFor: `${idPrefix}-drill-target`, help: t("drillTargetHint"), children: t("drillTargetDashboard") }),
|
|
7032
|
+
/* @__PURE__ */ jsxs21(
|
|
6693
7033
|
"select",
|
|
6694
7034
|
{
|
|
6695
7035
|
id: `${idPrefix}-drill-target`,
|
|
@@ -6702,15 +7042,15 @@ function WidgetConfigForm({
|
|
|
6702
7042
|
}
|
|
6703
7043
|
}),
|
|
6704
7044
|
children: [
|
|
6705
|
-
/* @__PURE__ */
|
|
6706
|
-
dashboardOptions.map((d) => /* @__PURE__ */
|
|
7045
|
+
/* @__PURE__ */ jsx24("option", { value: "", children: t("drillSameDashboard") }),
|
|
7046
|
+
dashboardOptions.map((d) => /* @__PURE__ */ jsx24("option", { value: d.id, children: d.title }, d.id))
|
|
6707
7047
|
]
|
|
6708
7048
|
}
|
|
6709
7049
|
)
|
|
6710
7050
|
] }),
|
|
6711
|
-
/* @__PURE__ */
|
|
6712
|
-
/* @__PURE__ */
|
|
6713
|
-
/* @__PURE__ */
|
|
7051
|
+
/* @__PURE__ */ jsxs21("div", { className: "dd-field dd-field-tight", children: [
|
|
7052
|
+
/* @__PURE__ */ jsx24(FieldLabel, { htmlFor: `${idPrefix}-drill-fields`, help: t("helpDrillPassFields"), children: t("drillPassFields") }),
|
|
7053
|
+
/* @__PURE__ */ jsx24(
|
|
6714
7054
|
SearchableSelect,
|
|
6715
7055
|
{
|
|
6716
7056
|
id: `${idPrefix}-drill-fields`,
|
|
@@ -6727,23 +7067,23 @@ function WidgetConfigForm({
|
|
|
6727
7067
|
] })
|
|
6728
7068
|
] })
|
|
6729
7069
|
] }),
|
|
6730
|
-
["timeline", "kpi", "bar", "line"].includes(widget.type) && /* @__PURE__ */
|
|
6731
|
-
/* @__PURE__ */
|
|
6732
|
-
/* @__PURE__ */
|
|
6733
|
-
/* @__PURE__ */
|
|
7070
|
+
["timeline", "kpi", "bar", "line"].includes(widget.type) && /* @__PURE__ */ jsxs21("details", { className: "dd-config-section", children: [
|
|
7071
|
+
/* @__PURE__ */ jsxs21("summary", { children: [
|
|
7072
|
+
/* @__PURE__ */ jsx24("span", { children: "Appearance" }),
|
|
7073
|
+
/* @__PURE__ */ jsx24("small", { children: "Layout, icons and number format" })
|
|
6734
7074
|
] }),
|
|
6735
|
-
/* @__PURE__ */
|
|
6736
|
-
widget.type === "timeline" && /* @__PURE__ */
|
|
6737
|
-
/* @__PURE__ */
|
|
6738
|
-
/* @__PURE__ */
|
|
6739
|
-
/* @__PURE__ */
|
|
6740
|
-
/* @__PURE__ */
|
|
7075
|
+
/* @__PURE__ */ jsxs21("div", { className: "dd-config-section-body", children: [
|
|
7076
|
+
widget.type === "timeline" && /* @__PURE__ */ jsxs21("div", { className: "dd-field", children: [
|
|
7077
|
+
/* @__PURE__ */ jsx24("label", { htmlFor: `${idPrefix}-timeline-orientation`, children: "Timeline layout" }),
|
|
7078
|
+
/* @__PURE__ */ jsxs21("select", { id: `${idPrefix}-timeline-orientation`, className: "dd-input", value: widget.chartOptions.timelineOrientation === "vertical" ? "vertical" : "horizontal", onChange: (e) => patch({ chartOptions: { ...widget.chartOptions, timelineOrientation: e.target.value } }), children: [
|
|
7079
|
+
/* @__PURE__ */ jsx24("option", { value: "horizontal", children: "Horizontal" }),
|
|
7080
|
+
/* @__PURE__ */ jsx24("option", { value: "vertical", children: "Vertical" })
|
|
6741
7081
|
] })
|
|
6742
7082
|
] }),
|
|
6743
|
-
widget.type === "timeline" && /* @__PURE__ */
|
|
6744
|
-
(widget.type === "kpi" || widget.type === "bar" || widget.type === "line") && /* @__PURE__ */
|
|
6745
|
-
/* @__PURE__ */
|
|
6746
|
-
/* @__PURE__ */
|
|
7083
|
+
widget.type === "timeline" && /* @__PURE__ */ jsx24("p", { className: "dd-hint", children: "Each returned row counts as one record. Use a detail query; grouped queries cannot provide record details. Stages appear in query result order." }),
|
|
7084
|
+
(widget.type === "kpi" || widget.type === "bar" || widget.type === "line") && /* @__PURE__ */ jsxs21("div", { className: "dd-field", children: [
|
|
7085
|
+
/* @__PURE__ */ jsx24(FieldLabel, { htmlFor: `${idPrefix}-format`, help: t("helpValueFormat"), children: t("valueFormat") }),
|
|
7086
|
+
/* @__PURE__ */ jsxs21(
|
|
6747
7087
|
"select",
|
|
6748
7088
|
{
|
|
6749
7089
|
id: `${idPrefix}-format`,
|
|
@@ -6756,27 +7096,27 @@ function WidgetConfigForm({
|
|
|
6756
7096
|
}
|
|
6757
7097
|
}),
|
|
6758
7098
|
children: [
|
|
6759
|
-
/* @__PURE__ */
|
|
6760
|
-
/* @__PURE__ */
|
|
7099
|
+
/* @__PURE__ */ jsx24("option", { value: "number", children: t("formatNumber") }),
|
|
7100
|
+
/* @__PURE__ */ jsx24("option", { value: "currency", children: t("formatCurrency") })
|
|
6761
7101
|
]
|
|
6762
7102
|
}
|
|
6763
7103
|
)
|
|
6764
7104
|
] }),
|
|
6765
|
-
widget.type === "kpi" && /* @__PURE__ */
|
|
6766
|
-
/* @__PURE__ */
|
|
6767
|
-
/* @__PURE__ */
|
|
6768
|
-
/* @__PURE__ */
|
|
6769
|
-
Object.entries(kpiIcons).map(([name, Icon]) => /* @__PURE__ */
|
|
7105
|
+
widget.type === "kpi" && /* @__PURE__ */ jsxs21("section", { className: "dd-drill-section", children: [
|
|
7106
|
+
/* @__PURE__ */ jsx24("h3", { children: "KPI icon" }),
|
|
7107
|
+
/* @__PURE__ */ jsxs21("div", { className: "dd-kpi-icon-picker", role: "group", "aria-label": "KPI icon", children: [
|
|
7108
|
+
/* @__PURE__ */ jsx24("button", { type: "button", className: "dd-btn", "aria-pressed": !widget.chartOptions.kpiIcon, onClick: () => patch({ chartOptions: { ...widget.chartOptions, kpiIcon: void 0 } }), children: "None" }),
|
|
7109
|
+
Object.entries(kpiIcons).map(([name, Icon]) => /* @__PURE__ */ jsx24("button", { type: "button", className: "dd-btn dd-btn-icon", title: name, "aria-label": name, "aria-pressed": widget.chartOptions.kpiIcon === name, onClick: () => patch({ chartOptions: { ...widget.chartOptions, kpiIcon: name } }), children: /* @__PURE__ */ jsx24(Icon, { size: 20 }) }, name))
|
|
6770
7110
|
] }),
|
|
6771
|
-
/* @__PURE__ */
|
|
7111
|
+
/* @__PURE__ */ jsxs21("label", { children: [
|
|
6772
7112
|
"Icon color ",
|
|
6773
|
-
/* @__PURE__ */
|
|
7113
|
+
/* @__PURE__ */ jsx24("input", { type: "color", value: typeof widget.chartOptions.kpiIconColor === "string" ? widget.chartOptions.kpiIconColor : "#0d6b54", onChange: (e) => patch({ chartOptions: { ...widget.chartOptions, kpiIconColor: e.target.value } }) })
|
|
6774
7114
|
] }),
|
|
6775
|
-
/* @__PURE__ */
|
|
7115
|
+
/* @__PURE__ */ jsx24("p", { className: "dd-hint", children: "Record details show all loaded rows contributing to this KPI. To see individual records, return detail rows and aggregate them in the widget. A query returning only a total cannot expose its underlying records." })
|
|
6776
7116
|
] }),
|
|
6777
|
-
widget.type === "kpi" && /* @__PURE__ */
|
|
6778
|
-
/* @__PURE__ */
|
|
6779
|
-
/* @__PURE__ */
|
|
7117
|
+
widget.type === "kpi" && /* @__PURE__ */ jsxs21("div", { className: "dd-field", children: [
|
|
7118
|
+
/* @__PURE__ */ jsx24(FieldLabel, { htmlFor: `${idPrefix}-kpi-default`, help: t("helpKpiDefaultValue"), children: t("kpiDefaultValue") }),
|
|
7119
|
+
/* @__PURE__ */ jsx24(
|
|
6780
7120
|
"input",
|
|
6781
7121
|
{
|
|
6782
7122
|
id: `${idPrefix}-kpi-default`,
|
|
@@ -6798,7 +7138,7 @@ function WidgetConfigForm({
|
|
|
6798
7138
|
}
|
|
6799
7139
|
|
|
6800
7140
|
// src/designer/WidgetEditorModal.tsx
|
|
6801
|
-
import { jsx as
|
|
7141
|
+
import { jsx as jsx25, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
6802
7142
|
function cloneWidget(widget) {
|
|
6803
7143
|
try {
|
|
6804
7144
|
return structuredClone(widget);
|
|
@@ -6819,17 +7159,17 @@ function WidgetEditorModal({
|
|
|
6819
7159
|
onSave,
|
|
6820
7160
|
onCancel
|
|
6821
7161
|
}) {
|
|
6822
|
-
const { t } =
|
|
7162
|
+
const { t } = useTranslation15();
|
|
6823
7163
|
const variables = useVariables();
|
|
6824
7164
|
const variableSignature = JSON.stringify(variables.values);
|
|
6825
|
-
const titleId =
|
|
7165
|
+
const titleId = useId6();
|
|
6826
7166
|
const [draft, setDraft] = useState16(() => createEmptyWidget("bar"));
|
|
6827
7167
|
const [previewWidget, setPreviewWidget] = useState16(() => createEmptyWidget("bar"));
|
|
6828
7168
|
const [previewMode, setPreviewMode] = useState16("chart");
|
|
6829
7169
|
const [ranResult, setRanResult] = useState16();
|
|
6830
7170
|
const [ranVariableSignature, setRanVariableSignature] = useState16("");
|
|
6831
7171
|
const [drillPreviewMsg, setDrillPreviewMsg] = useState16(null);
|
|
6832
|
-
const initializedForOpen =
|
|
7172
|
+
const initializedForOpen = useRef11(false);
|
|
6833
7173
|
useEffect14(() => {
|
|
6834
7174
|
setRanResult(void 0);
|
|
6835
7175
|
}, [draft.query.connectionId, draft.query.rawSql, draft.query.procedureParameters, variableSignature, variables.ready]);
|
|
@@ -6885,7 +7225,7 @@ function WidgetEditorModal({
|
|
|
6885
7225
|
}
|
|
6886
7226
|
}, [data, ranResult]);
|
|
6887
7227
|
if (!open) return null;
|
|
6888
|
-
return /* @__PURE__ */
|
|
7228
|
+
return /* @__PURE__ */ jsx25("div", { className: "dd-modal-backdrop", role: "presentation", onClick: onCancel, children: /* @__PURE__ */ jsxs22(
|
|
6889
7229
|
"div",
|
|
6890
7230
|
{
|
|
6891
7231
|
className: "dd-modal",
|
|
@@ -6894,9 +7234,9 @@ function WidgetEditorModal({
|
|
|
6894
7234
|
"aria-labelledby": titleId,
|
|
6895
7235
|
onClick: (e) => e.stopPropagation(),
|
|
6896
7236
|
children: [
|
|
6897
|
-
/* @__PURE__ */
|
|
6898
|
-
/* @__PURE__ */
|
|
6899
|
-
/* @__PURE__ */
|
|
7237
|
+
/* @__PURE__ */ jsxs22("header", { className: "dd-modal-header", children: [
|
|
7238
|
+
/* @__PURE__ */ jsx25("h2", { id: titleId, children: mode === "add" ? t("addWidget") : t("editWidget") }),
|
|
7239
|
+
/* @__PURE__ */ jsx25(
|
|
6900
7240
|
"button",
|
|
6901
7241
|
{
|
|
6902
7242
|
type: "button",
|
|
@@ -6904,18 +7244,18 @@ function WidgetEditorModal({
|
|
|
6904
7244
|
onClick: onCancel,
|
|
6905
7245
|
"aria-label": t("cancel"),
|
|
6906
7246
|
title: t("cancel"),
|
|
6907
|
-
children: /* @__PURE__ */
|
|
7247
|
+
children: /* @__PURE__ */ jsx25(X5, { size: 18 })
|
|
6908
7248
|
}
|
|
6909
7249
|
)
|
|
6910
7250
|
] }),
|
|
6911
|
-
/* @__PURE__ */
|
|
6912
|
-
/* @__PURE__ */
|
|
6913
|
-
/* @__PURE__ */
|
|
6914
|
-
/* @__PURE__ */
|
|
6915
|
-
/* @__PURE__ */
|
|
6916
|
-
loading && /* @__PURE__ */
|
|
6917
|
-
/* @__PURE__ */
|
|
6918
|
-
/* @__PURE__ */
|
|
7251
|
+
/* @__PURE__ */ jsxs22("div", { className: "dd-modal-body", children: [
|
|
7252
|
+
/* @__PURE__ */ jsxs22("section", { className: "dd-modal-preview", children: [
|
|
7253
|
+
/* @__PURE__ */ jsxs22("div", { className: "dd-modal-preview-header", children: [
|
|
7254
|
+
/* @__PURE__ */ jsx25("h3", { children: t("preview") }),
|
|
7255
|
+
/* @__PURE__ */ jsxs22("div", { className: "dd-modal-preview-meta", children: [
|
|
7256
|
+
loading && /* @__PURE__ */ jsx25("span", { className: "dd-preview-status", children: t("loading") }),
|
|
7257
|
+
/* @__PURE__ */ jsxs22("div", { className: "dd-preview-mode", role: "tablist", "aria-label": t("preview"), children: [
|
|
7258
|
+
/* @__PURE__ */ jsx25(
|
|
6919
7259
|
"button",
|
|
6920
7260
|
{
|
|
6921
7261
|
type: "button",
|
|
@@ -6926,7 +7266,7 @@ function WidgetEditorModal({
|
|
|
6926
7266
|
children: t("previewChart")
|
|
6927
7267
|
}
|
|
6928
7268
|
),
|
|
6929
|
-
/* @__PURE__ */
|
|
7269
|
+
/* @__PURE__ */ jsx25(
|
|
6930
7270
|
"button",
|
|
6931
7271
|
{
|
|
6932
7272
|
type: "button",
|
|
@@ -6939,17 +7279,17 @@ function WidgetEditorModal({
|
|
|
6939
7279
|
}
|
|
6940
7280
|
)
|
|
6941
7281
|
] }),
|
|
6942
|
-
/* @__PURE__ */
|
|
6943
|
-
/* @__PURE__ */
|
|
7282
|
+
/* @__PURE__ */ jsxs22("span", { className: "dd-badge", children: [
|
|
7283
|
+
/* @__PURE__ */ jsx25(TypeIcon, { size: 12, strokeWidth: 2.25, "aria-hidden": true }),
|
|
6944
7284
|
draft.type
|
|
6945
7285
|
] })
|
|
6946
7286
|
] })
|
|
6947
7287
|
] }),
|
|
6948
|
-
/* @__PURE__ */
|
|
6949
|
-
error && /* @__PURE__ */
|
|
6950
|
-
filteredRun.error && /* @__PURE__ */
|
|
6951
|
-
drillPreviewMsg && /* @__PURE__ */
|
|
6952
|
-
!error && previewMode === "chart" && /* @__PURE__ */
|
|
7288
|
+
/* @__PURE__ */ jsxs22("div", { className: `dd-modal-preview-chart ${loading ? "is-loading" : ""}`, children: [
|
|
7289
|
+
error && /* @__PURE__ */ jsx25("div", { className: "dd-error", children: error }),
|
|
7290
|
+
filteredRun.error && /* @__PURE__ */ jsx25("div", { className: "dd-error", children: filteredRun.error }),
|
|
7291
|
+
drillPreviewMsg && /* @__PURE__ */ jsx25("div", { className: "dd-drill-preview-banner", role: "status", children: drillPreviewMsg }),
|
|
7292
|
+
!error && previewMode === "chart" && /* @__PURE__ */ jsx25(
|
|
6953
7293
|
ChartRenderer,
|
|
6954
7294
|
{
|
|
6955
7295
|
widget: chartPreviewWidget,
|
|
@@ -6997,15 +7337,15 @@ function WidgetEditorModal({
|
|
|
6997
7337
|
}
|
|
6998
7338
|
}
|
|
6999
7339
|
),
|
|
7000
|
-
!error && previewMode === "data" && (tableData ? /* @__PURE__ */
|
|
7340
|
+
!error && previewMode === "data" && (tableData ? /* @__PURE__ */ jsx25(QueryResultTable, { data: tableData, className: "dd-query-data-preview" }) : /* @__PURE__ */ jsx25("div", { className: "dd-muted", children: loading ? t("loading") : t("noData") }))
|
|
7001
7341
|
] })
|
|
7002
7342
|
] }),
|
|
7003
|
-
/* @__PURE__ */
|
|
7004
|
-
/* @__PURE__ */
|
|
7005
|
-
/* @__PURE__ */
|
|
7006
|
-
/* @__PURE__ */
|
|
7343
|
+
/* @__PURE__ */ jsxs22("aside", { className: "dd-modal-config", children: [
|
|
7344
|
+
/* @__PURE__ */ jsxs22("div", { className: "dd-config-heading", children: [
|
|
7345
|
+
/* @__PURE__ */ jsx25("h3", { children: "Widget configuration" }),
|
|
7346
|
+
/* @__PURE__ */ jsx25("p", { children: "Set up your widget and check the live preview." })
|
|
7007
7347
|
] }),
|
|
7008
|
-
/* @__PURE__ */
|
|
7348
|
+
/* @__PURE__ */ jsx25(
|
|
7009
7349
|
WidgetConfigForm,
|
|
7010
7350
|
{
|
|
7011
7351
|
widget: draft,
|
|
@@ -7026,13 +7366,13 @@ function WidgetEditorModal({
|
|
|
7026
7366
|
)
|
|
7027
7367
|
] })
|
|
7028
7368
|
] }),
|
|
7029
|
-
/* @__PURE__ */
|
|
7030
|
-
/* @__PURE__ */
|
|
7031
|
-
/* @__PURE__ */
|
|
7369
|
+
/* @__PURE__ */ jsxs22("footer", { className: "dd-modal-footer", children: [
|
|
7370
|
+
/* @__PURE__ */ jsxs22("button", { type: "button", className: "dd-btn", onClick: onCancel, children: [
|
|
7371
|
+
/* @__PURE__ */ jsx25(X5, { size: ICON_SIZE }),
|
|
7032
7372
|
t("cancel")
|
|
7033
7373
|
] }),
|
|
7034
|
-
/* @__PURE__ */
|
|
7035
|
-
/* @__PURE__ */
|
|
7374
|
+
/* @__PURE__ */ jsxs22("button", { type: "button", className: "dd-btn dd-btn-primary", onClick: () => onSave(draft), children: [
|
|
7375
|
+
/* @__PURE__ */ jsx25(Save, { size: ICON_SIZE }),
|
|
7036
7376
|
t("save")
|
|
7037
7377
|
] })
|
|
7038
7378
|
] })
|
|
@@ -7042,10 +7382,10 @@ function WidgetEditorModal({
|
|
|
7042
7382
|
}
|
|
7043
7383
|
|
|
7044
7384
|
// src/designer/HistoryPanel.tsx
|
|
7045
|
-
import
|
|
7046
|
-
import { useTranslation as
|
|
7385
|
+
import React20, { useEffect as useEffect15, useMemo as useMemo10, useState as useState17 } from "react";
|
|
7386
|
+
import { useTranslation as useTranslation16 } from "react-i18next";
|
|
7047
7387
|
import { GitBranch, History, RotateCcw as RotateCcw2, X as X6 } from "lucide-react";
|
|
7048
|
-
import { jsx as
|
|
7388
|
+
import { jsx as jsx26, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
7049
7389
|
var LANE_GAP = 18;
|
|
7050
7390
|
var ROW_H = 72;
|
|
7051
7391
|
var DOT_R = 5;
|
|
@@ -7110,7 +7450,7 @@ function HistoryPanel({
|
|
|
7110
7450
|
onClose,
|
|
7111
7451
|
onRestored
|
|
7112
7452
|
}) {
|
|
7113
|
-
const { t } =
|
|
7453
|
+
const { t } = useTranslation16();
|
|
7114
7454
|
const [versions, setVersions] = useState17([]);
|
|
7115
7455
|
const [selectedId, setSelectedId] = useState17(null);
|
|
7116
7456
|
const [preview, setPreview] = useState17(null);
|
|
@@ -7181,7 +7521,7 @@ function HistoryPanel({
|
|
|
7181
7521
|
if (!open) return null;
|
|
7182
7522
|
const selected = versions.find((v) => v.id === selectedId);
|
|
7183
7523
|
const gutterW = laneCount * LANE_GAP + 8;
|
|
7184
|
-
return /* @__PURE__ */
|
|
7524
|
+
return /* @__PURE__ */ jsx26("div", { className: "dd-modal-backdrop", role: "presentation", onClick: onClose, children: /* @__PURE__ */ jsxs23(
|
|
7185
7525
|
"div",
|
|
7186
7526
|
{
|
|
7187
7527
|
className: "dd-history-panel",
|
|
@@ -7190,44 +7530,44 @@ function HistoryPanel({
|
|
|
7190
7530
|
"aria-label": t("versionHistory"),
|
|
7191
7531
|
onClick: (e) => e.stopPropagation(),
|
|
7192
7532
|
children: [
|
|
7193
|
-
/* @__PURE__ */
|
|
7194
|
-
/* @__PURE__ */
|
|
7195
|
-
/* @__PURE__ */
|
|
7196
|
-
/* @__PURE__ */
|
|
7533
|
+
/* @__PURE__ */ jsxs23("header", { className: "dd-history-header", children: [
|
|
7534
|
+
/* @__PURE__ */ jsxs23("div", { className: "dd-history-header-title", children: [
|
|
7535
|
+
/* @__PURE__ */ jsx26(History, { size: 18, "aria-hidden": true }),
|
|
7536
|
+
/* @__PURE__ */ jsx26("h2", { children: t("versionHistory") })
|
|
7197
7537
|
] }),
|
|
7198
|
-
/* @__PURE__ */
|
|
7538
|
+
/* @__PURE__ */ jsx26(
|
|
7199
7539
|
"button",
|
|
7200
7540
|
{
|
|
7201
7541
|
type: "button",
|
|
7202
7542
|
className: "dd-btn dd-btn-ghost dd-btn-icon",
|
|
7203
7543
|
onClick: onClose,
|
|
7204
7544
|
"aria-label": t("cancel"),
|
|
7205
|
-
children: /* @__PURE__ */
|
|
7545
|
+
children: /* @__PURE__ */ jsx26(X6, { size: 18 })
|
|
7206
7546
|
}
|
|
7207
7547
|
)
|
|
7208
7548
|
] }),
|
|
7209
|
-
/* @__PURE__ */
|
|
7210
|
-
/* @__PURE__ */
|
|
7211
|
-
/* @__PURE__ */
|
|
7212
|
-
/* @__PURE__ */
|
|
7549
|
+
/* @__PURE__ */ jsxs23("div", { className: "dd-history-body", children: [
|
|
7550
|
+
/* @__PURE__ */ jsxs23("div", { className: "dd-history-tree", children: [
|
|
7551
|
+
/* @__PURE__ */ jsxs23("p", { className: "dd-hint dd-history-hint", children: [
|
|
7552
|
+
/* @__PURE__ */ jsx26(GitBranch, { size: 12, "aria-hidden": true }),
|
|
7213
7553
|
" ",
|
|
7214
7554
|
t("historyTreeHint")
|
|
7215
7555
|
] }),
|
|
7216
|
-
loading && /* @__PURE__ */
|
|
7217
|
-
error && /* @__PURE__ */
|
|
7218
|
-
!loading && versions.length === 0 && /* @__PURE__ */
|
|
7219
|
-
/* @__PURE__ */
|
|
7556
|
+
loading && /* @__PURE__ */ jsx26("div", { className: "dd-muted", children: t("loading") }),
|
|
7557
|
+
error && /* @__PURE__ */ jsx26("div", { className: "dd-error", children: error }),
|
|
7558
|
+
!loading && versions.length === 0 && /* @__PURE__ */ jsx26("div", { className: "dd-muted", children: t("noVersions") }),
|
|
7559
|
+
/* @__PURE__ */ jsx26("ul", { className: "dd-history-list", children: graph.map((row, rowIndex) => {
|
|
7220
7560
|
const v = row.version;
|
|
7221
7561
|
const isSelected = v.id === selectedId;
|
|
7222
7562
|
const svgH = ROW_H;
|
|
7223
|
-
return /* @__PURE__ */
|
|
7563
|
+
return /* @__PURE__ */ jsx26("li", { children: /* @__PURE__ */ jsxs23(
|
|
7224
7564
|
"button",
|
|
7225
7565
|
{
|
|
7226
7566
|
type: "button",
|
|
7227
7567
|
className: `dd-history-row ${isSelected ? "is-selected" : ""} ${v.isHead ? "is-head" : ""}`,
|
|
7228
7568
|
onClick: () => setSelectedId(v.id),
|
|
7229
7569
|
children: [
|
|
7230
|
-
/* @__PURE__ */
|
|
7570
|
+
/* @__PURE__ */ jsxs23(
|
|
7231
7571
|
"svg",
|
|
7232
7572
|
{
|
|
7233
7573
|
className: "dd-history-graph",
|
|
@@ -7238,8 +7578,8 @@ function HistoryPanel({
|
|
|
7238
7578
|
row.activeLanes.map((lane) => {
|
|
7239
7579
|
const x = 8 + lane * LANE_GAP;
|
|
7240
7580
|
if (lane === row.lane) {
|
|
7241
|
-
return /* @__PURE__ */
|
|
7242
|
-
/* @__PURE__ */
|
|
7581
|
+
return /* @__PURE__ */ jsxs23(React20.Fragment, { children: [
|
|
7582
|
+
/* @__PURE__ */ jsx26(
|
|
7243
7583
|
"line",
|
|
7244
7584
|
{
|
|
7245
7585
|
x1: x,
|
|
@@ -7250,7 +7590,7 @@ function HistoryPanel({
|
|
|
7250
7590
|
strokeWidth: "2"
|
|
7251
7591
|
}
|
|
7252
7592
|
),
|
|
7253
|
-
rowIndex < graph.length - 1 && /* @__PURE__ */
|
|
7593
|
+
rowIndex < graph.length - 1 && /* @__PURE__ */ jsx26(
|
|
7254
7594
|
"line",
|
|
7255
7595
|
{
|
|
7256
7596
|
x1: x,
|
|
@@ -7263,7 +7603,7 @@ function HistoryPanel({
|
|
|
7263
7603
|
)
|
|
7264
7604
|
] }, `v-${lane}`);
|
|
7265
7605
|
}
|
|
7266
|
-
return /* @__PURE__ */
|
|
7606
|
+
return /* @__PURE__ */ jsx26(
|
|
7267
7607
|
"line",
|
|
7268
7608
|
{
|
|
7269
7609
|
x1: x,
|
|
@@ -7283,7 +7623,7 @@ function HistoryPanel({
|
|
|
7283
7623
|
const y1 = svgH / 2;
|
|
7284
7624
|
const y2 = svgH;
|
|
7285
7625
|
const midY = (y1 + y2) / 2;
|
|
7286
|
-
return /* @__PURE__ */
|
|
7626
|
+
return /* @__PURE__ */ jsx26(
|
|
7287
7627
|
"path",
|
|
7288
7628
|
{
|
|
7289
7629
|
d: `M ${x1} ${y1 + DOT_R} C ${x1} ${midY}, ${x2} ${midY}, ${x2} ${y2}`,
|
|
@@ -7294,7 +7634,7 @@ function HistoryPanel({
|
|
|
7294
7634
|
`e-${ei}`
|
|
7295
7635
|
);
|
|
7296
7636
|
}),
|
|
7297
|
-
/* @__PURE__ */
|
|
7637
|
+
/* @__PURE__ */ jsx26(
|
|
7298
7638
|
"circle",
|
|
7299
7639
|
{
|
|
7300
7640
|
cx: 8 + row.lane * LANE_GAP,
|
|
@@ -7308,14 +7648,14 @@ function HistoryPanel({
|
|
|
7308
7648
|
]
|
|
7309
7649
|
}
|
|
7310
7650
|
),
|
|
7311
|
-
/* @__PURE__ */
|
|
7312
|
-
/* @__PURE__ */
|
|
7313
|
-
/* @__PURE__ */
|
|
7314
|
-
v.isHead && /* @__PURE__ */
|
|
7315
|
-
v.restoredFromId && /* @__PURE__ */
|
|
7651
|
+
/* @__PURE__ */ jsxs23("div", { className: "dd-history-row-body", children: [
|
|
7652
|
+
/* @__PURE__ */ jsxs23("div", { className: "dd-history-row-top", children: [
|
|
7653
|
+
/* @__PURE__ */ jsx26("code", { className: "dd-history-sha", children: v.shortId }),
|
|
7654
|
+
v.isHead && /* @__PURE__ */ jsx26("span", { className: "dd-history-badge", children: t("head") }),
|
|
7655
|
+
v.restoredFromId && /* @__PURE__ */ jsx26("span", { className: "dd-history-badge dd-history-badge-restore", children: t("restoreBadge") })
|
|
7316
7656
|
] }),
|
|
7317
|
-
/* @__PURE__ */
|
|
7318
|
-
/* @__PURE__ */
|
|
7657
|
+
/* @__PURE__ */ jsx26("div", { className: "dd-history-message", children: v.message }),
|
|
7658
|
+
/* @__PURE__ */ jsxs23("div", { className: "dd-history-meta", children: [
|
|
7319
7659
|
v.summary.widgetCount,
|
|
7320
7660
|
" ",
|
|
7321
7661
|
t("widgetsCount"),
|
|
@@ -7331,10 +7671,10 @@ function HistoryPanel({
|
|
|
7331
7671
|
) }, v.id);
|
|
7332
7672
|
}) })
|
|
7333
7673
|
] }),
|
|
7334
|
-
/* @__PURE__ */
|
|
7335
|
-
/* @__PURE__ */
|
|
7336
|
-
/* @__PURE__ */
|
|
7337
|
-
selected && !selected.isHead && canRestore && /* @__PURE__ */
|
|
7674
|
+
/* @__PURE__ */ jsxs23("aside", { className: "dd-history-preview", children: [
|
|
7675
|
+
/* @__PURE__ */ jsxs23("div", { className: "dd-history-preview-header", children: [
|
|
7676
|
+
/* @__PURE__ */ jsx26("h3", { children: t("versionPreview") }),
|
|
7677
|
+
selected && !selected.isHead && canRestore && /* @__PURE__ */ jsxs23(
|
|
7338
7678
|
"button",
|
|
7339
7679
|
{
|
|
7340
7680
|
type: "button",
|
|
@@ -7342,39 +7682,39 @@ function HistoryPanel({
|
|
|
7342
7682
|
disabled: restoring || previewLoading,
|
|
7343
7683
|
onClick: () => void handleRestore(),
|
|
7344
7684
|
children: [
|
|
7345
|
-
/* @__PURE__ */
|
|
7685
|
+
/* @__PURE__ */ jsx26(RotateCcw2, { size: ICON_SIZE }),
|
|
7346
7686
|
restoring ? t("loading") : t("restoreVersion")
|
|
7347
7687
|
]
|
|
7348
7688
|
}
|
|
7349
7689
|
)
|
|
7350
7690
|
] }),
|
|
7351
|
-
previewLoading && /* @__PURE__ */
|
|
7352
|
-
!previewLoading && preview && /* @__PURE__ */
|
|
7353
|
-
/* @__PURE__ */
|
|
7354
|
-
/* @__PURE__ */
|
|
7355
|
-
/* @__PURE__ */
|
|
7356
|
-
/* @__PURE__ */
|
|
7691
|
+
previewLoading && /* @__PURE__ */ jsx26("div", { className: "dd-muted", children: t("loading") }),
|
|
7692
|
+
!previewLoading && preview && /* @__PURE__ */ jsxs23("div", { className: "dd-history-preview-body", children: [
|
|
7693
|
+
/* @__PURE__ */ jsxs23("dl", { className: "dd-history-dl", children: [
|
|
7694
|
+
/* @__PURE__ */ jsxs23("div", { children: [
|
|
7695
|
+
/* @__PURE__ */ jsx26("dt", { children: t("title") }),
|
|
7696
|
+
/* @__PURE__ */ jsx26("dd", { children: preview.dashboard.title })
|
|
7357
7697
|
] }),
|
|
7358
|
-
/* @__PURE__ */
|
|
7359
|
-
/* @__PURE__ */
|
|
7360
|
-
/* @__PURE__ */
|
|
7698
|
+
/* @__PURE__ */ jsxs23("div", { children: [
|
|
7699
|
+
/* @__PURE__ */ jsx26("dt", { children: t("widgetsCount") }),
|
|
7700
|
+
/* @__PURE__ */ jsx26("dd", { children: preview.summary.widgetCount })
|
|
7361
7701
|
] }),
|
|
7362
|
-
/* @__PURE__ */
|
|
7363
|
-
/* @__PURE__ */
|
|
7364
|
-
/* @__PURE__ */
|
|
7702
|
+
/* @__PURE__ */ jsxs23("div", { children: [
|
|
7703
|
+
/* @__PURE__ */ jsx26("dt", { children: t("message") }),
|
|
7704
|
+
/* @__PURE__ */ jsx26("dd", { children: preview.message })
|
|
7365
7705
|
] }),
|
|
7366
|
-
/* @__PURE__ */
|
|
7367
|
-
/* @__PURE__ */
|
|
7368
|
-
/* @__PURE__ */
|
|
7706
|
+
/* @__PURE__ */ jsxs23("div", { children: [
|
|
7707
|
+
/* @__PURE__ */ jsx26("dt", { children: t("versionId") }),
|
|
7708
|
+
/* @__PURE__ */ jsx26("dd", { children: /* @__PURE__ */ jsx26("code", { children: preview.shortId }) })
|
|
7369
7709
|
] })
|
|
7370
7710
|
] }),
|
|
7371
|
-
/* @__PURE__ */
|
|
7372
|
-
preview.dashboard.widgets.length === 0 ? /* @__PURE__ */
|
|
7373
|
-
/* @__PURE__ */
|
|
7374
|
-
/* @__PURE__ */
|
|
7711
|
+
/* @__PURE__ */ jsx26("h4", { children: t("widgets") }),
|
|
7712
|
+
preview.dashboard.widgets.length === 0 ? /* @__PURE__ */ jsx26("p", { className: "dd-muted", children: t("emptyCanvas") }) : /* @__PURE__ */ jsx26("ul", { className: "dd-history-widget-list", children: preview.dashboard.widgets.map((w) => /* @__PURE__ */ jsxs23("li", { children: [
|
|
7713
|
+
/* @__PURE__ */ jsx26("span", { className: "dd-badge", children: w.type }),
|
|
7714
|
+
/* @__PURE__ */ jsx26("span", { children: w.title })
|
|
7375
7715
|
] }, w.id)) })
|
|
7376
7716
|
] }),
|
|
7377
|
-
!previewLoading && !preview && !loading && /* @__PURE__ */
|
|
7717
|
+
!previewLoading && !preview && !loading && /* @__PURE__ */ jsx26("div", { className: "dd-muted", children: t("selectVersion") })
|
|
7378
7718
|
] })
|
|
7379
7719
|
] })
|
|
7380
7720
|
]
|
|
@@ -7385,10 +7725,10 @@ function HistoryPanel({
|
|
|
7385
7725
|
// src/designer/SharePanel.tsx
|
|
7386
7726
|
import { useEffect as useEffect16, useState as useState18 } from "react";
|
|
7387
7727
|
import { Plus as Plus3, Trash2 as Trash22, X as X7 } from "lucide-react";
|
|
7388
|
-
import { useTranslation as
|
|
7389
|
-
import { jsx as
|
|
7728
|
+
import { useTranslation as useTranslation17 } from "react-i18next";
|
|
7729
|
+
import { jsx as jsx27, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
7390
7730
|
function SharePanel({ open, onClose, dashboardId, api }) {
|
|
7391
|
-
const { t } =
|
|
7731
|
+
const { t } = useTranslation17();
|
|
7392
7732
|
const [acl, setAcl] = useState18([]);
|
|
7393
7733
|
const [users, setUsers] = useState18([]);
|
|
7394
7734
|
const [canManage, setCanManage] = useState18(false);
|
|
@@ -7450,7 +7790,7 @@ function SharePanel({ open, onClose, dashboardId, api }) {
|
|
|
7450
7790
|
const removeEntry = (userId) => {
|
|
7451
7791
|
void persist(acl.filter((e) => e.userId !== userId));
|
|
7452
7792
|
};
|
|
7453
|
-
return /* @__PURE__ */
|
|
7793
|
+
return /* @__PURE__ */ jsx27("div", { className: "dd-modal-backdrop", role: "presentation", onClick: onClose, children: /* @__PURE__ */ jsxs24(
|
|
7454
7794
|
"div",
|
|
7455
7795
|
{
|
|
7456
7796
|
className: "dd-dialog dd-share-panel",
|
|
@@ -7459,33 +7799,33 @@ function SharePanel({ open, onClose, dashboardId, api }) {
|
|
|
7459
7799
|
"aria-labelledby": "dd-share-title",
|
|
7460
7800
|
onClick: (e) => e.stopPropagation(),
|
|
7461
7801
|
children: [
|
|
7462
|
-
/* @__PURE__ */
|
|
7463
|
-
/* @__PURE__ */
|
|
7802
|
+
/* @__PURE__ */ jsxs24("header", { className: "dd-dialog-header", children: [
|
|
7803
|
+
/* @__PURE__ */ jsxs24("h2", { id: "dd-share-title", children: [
|
|
7464
7804
|
t("shareDashboard"),
|
|
7465
|
-
/* @__PURE__ */
|
|
7805
|
+
/* @__PURE__ */ jsx27(FieldHelp, { text: t("shareHint") })
|
|
7466
7806
|
] }),
|
|
7467
|
-
/* @__PURE__ */
|
|
7807
|
+
/* @__PURE__ */ jsx27(
|
|
7468
7808
|
"button",
|
|
7469
7809
|
{
|
|
7470
7810
|
type: "button",
|
|
7471
7811
|
className: "dd-btn dd-btn-ghost dd-btn-icon",
|
|
7472
7812
|
onClick: onClose,
|
|
7473
7813
|
"aria-label": t("cancel"),
|
|
7474
|
-
children: /* @__PURE__ */
|
|
7814
|
+
children: /* @__PURE__ */ jsx27(X7, { size: ICON_SIZE })
|
|
7475
7815
|
}
|
|
7476
7816
|
)
|
|
7477
7817
|
] }),
|
|
7478
|
-
/* @__PURE__ */
|
|
7479
|
-
error && /* @__PURE__ */
|
|
7480
|
-
loading && /* @__PURE__ */
|
|
7481
|
-
!loading && acl.length === 0 && /* @__PURE__ */
|
|
7482
|
-
!loading && acl.length > 0 && /* @__PURE__ */
|
|
7483
|
-
/* @__PURE__ */
|
|
7484
|
-
/* @__PURE__ */
|
|
7485
|
-
entry.email && entry.name && /* @__PURE__ */
|
|
7818
|
+
/* @__PURE__ */ jsxs24("div", { className: "dd-dialog-body", children: [
|
|
7819
|
+
error && /* @__PURE__ */ jsx27("div", { className: "dd-error", children: error }),
|
|
7820
|
+
loading && /* @__PURE__ */ jsx27("div", { className: "dd-muted", children: t("loading") }),
|
|
7821
|
+
!loading && acl.length === 0 && /* @__PURE__ */ jsx27("div", { className: "dd-dialog-empty", children: t("noAclEntries") }),
|
|
7822
|
+
!loading && acl.length > 0 && /* @__PURE__ */ jsx27("ul", { className: "dd-share-list", children: acl.map((entry) => /* @__PURE__ */ jsxs24("li", { className: "dd-share-row", children: [
|
|
7823
|
+
/* @__PURE__ */ jsxs24("div", { className: "dd-share-user", children: [
|
|
7824
|
+
/* @__PURE__ */ jsx27("span", { className: "dd-share-name", children: entry.name || entry.email || entry.userId }),
|
|
7825
|
+
entry.email && entry.name && /* @__PURE__ */ jsx27("span", { className: "dd-muted dd-share-email", children: entry.email })
|
|
7486
7826
|
] }),
|
|
7487
|
-
canManage ? /* @__PURE__ */
|
|
7488
|
-
/* @__PURE__ */
|
|
7827
|
+
canManage ? /* @__PURE__ */ jsxs24("div", { className: "dd-share-actions", children: [
|
|
7828
|
+
/* @__PURE__ */ jsxs24(
|
|
7489
7829
|
"select",
|
|
7490
7830
|
{
|
|
7491
7831
|
className: "dd-input dd-share-perm",
|
|
@@ -7495,14 +7835,14 @@ function SharePanel({ open, onClose, dashboardId, api }) {
|
|
|
7495
7835
|
"aria-label": t("permission"),
|
|
7496
7836
|
title: t("helpPermission"),
|
|
7497
7837
|
children: [
|
|
7498
|
-
/* @__PURE__ */
|
|
7499
|
-
/* @__PURE__ */
|
|
7500
|
-
/* @__PURE__ */
|
|
7838
|
+
/* @__PURE__ */ jsx27("option", { value: "view", children: t("permView") }),
|
|
7839
|
+
/* @__PURE__ */ jsx27("option", { value: "edit", children: t("permEdit") }),
|
|
7840
|
+
/* @__PURE__ */ jsx27("option", { value: "admin", children: t("permAdmin") })
|
|
7501
7841
|
]
|
|
7502
7842
|
}
|
|
7503
7843
|
),
|
|
7504
|
-
/* @__PURE__ */
|
|
7505
|
-
/* @__PURE__ */
|
|
7844
|
+
/* @__PURE__ */ jsx27(FieldHelp, { text: t("helpPermission") }),
|
|
7845
|
+
/* @__PURE__ */ jsx27(
|
|
7506
7846
|
"button",
|
|
7507
7847
|
{
|
|
7508
7848
|
type: "button",
|
|
@@ -7511,14 +7851,14 @@ function SharePanel({ open, onClose, dashboardId, api }) {
|
|
|
7511
7851
|
"aria-label": t("remove"),
|
|
7512
7852
|
disabled: saving,
|
|
7513
7853
|
onClick: () => removeEntry(entry.userId),
|
|
7514
|
-
children: /* @__PURE__ */
|
|
7854
|
+
children: /* @__PURE__ */ jsx27(Trash22, { size: ICON_SIZE })
|
|
7515
7855
|
}
|
|
7516
7856
|
)
|
|
7517
|
-
] }) : /* @__PURE__ */
|
|
7857
|
+
] }) : /* @__PURE__ */ jsx27("span", { className: "dd-badge", children: entry.permission === "view" ? t("permView") : entry.permission === "edit" ? t("permEdit") : t("permAdmin") })
|
|
7518
7858
|
] }, entry.userId)) })
|
|
7519
7859
|
] }),
|
|
7520
|
-
canManage && /* @__PURE__ */
|
|
7521
|
-
/* @__PURE__ */
|
|
7860
|
+
canManage && /* @__PURE__ */ jsxs24("footer", { className: "dd-dialog-footer dd-share-footer", children: [
|
|
7861
|
+
/* @__PURE__ */ jsxs24(
|
|
7522
7862
|
"select",
|
|
7523
7863
|
{
|
|
7524
7864
|
className: "dd-input dd-share-user-select",
|
|
@@ -7527,8 +7867,8 @@ function SharePanel({ open, onClose, dashboardId, api }) {
|
|
|
7527
7867
|
"aria-label": t("addUser"),
|
|
7528
7868
|
disabled: saving || availableUsers.length === 0,
|
|
7529
7869
|
children: [
|
|
7530
|
-
/* @__PURE__ */
|
|
7531
|
-
availableUsers.map((u) => /* @__PURE__ */
|
|
7870
|
+
/* @__PURE__ */ jsx27("option", { value: "", children: availableUsers.length === 0 ? t("noUsersToAdd") : t("selectUser") }),
|
|
7871
|
+
availableUsers.map((u) => /* @__PURE__ */ jsxs24("option", { value: u.id, children: [
|
|
7532
7872
|
u.name,
|
|
7533
7873
|
" (",
|
|
7534
7874
|
u.email,
|
|
@@ -7537,7 +7877,7 @@ function SharePanel({ open, onClose, dashboardId, api }) {
|
|
|
7537
7877
|
]
|
|
7538
7878
|
}
|
|
7539
7879
|
),
|
|
7540
|
-
/* @__PURE__ */
|
|
7880
|
+
/* @__PURE__ */ jsxs24(
|
|
7541
7881
|
"select",
|
|
7542
7882
|
{
|
|
7543
7883
|
className: "dd-input dd-share-perm",
|
|
@@ -7546,13 +7886,13 @@ function SharePanel({ open, onClose, dashboardId, api }) {
|
|
|
7546
7886
|
"aria-label": t("permission"),
|
|
7547
7887
|
disabled: saving,
|
|
7548
7888
|
children: [
|
|
7549
|
-
/* @__PURE__ */
|
|
7550
|
-
/* @__PURE__ */
|
|
7551
|
-
/* @__PURE__ */
|
|
7889
|
+
/* @__PURE__ */ jsx27("option", { value: "view", children: t("permView") }),
|
|
7890
|
+
/* @__PURE__ */ jsx27("option", { value: "edit", children: t("permEdit") }),
|
|
7891
|
+
/* @__PURE__ */ jsx27("option", { value: "admin", children: t("permAdmin") })
|
|
7552
7892
|
]
|
|
7553
7893
|
}
|
|
7554
7894
|
),
|
|
7555
|
-
/* @__PURE__ */
|
|
7895
|
+
/* @__PURE__ */ jsxs24(
|
|
7556
7896
|
"button",
|
|
7557
7897
|
{
|
|
7558
7898
|
type: "button",
|
|
@@ -7560,26 +7900,26 @@ function SharePanel({ open, onClose, dashboardId, api }) {
|
|
|
7560
7900
|
disabled: !addUserId || saving,
|
|
7561
7901
|
onClick: addEntry,
|
|
7562
7902
|
children: [
|
|
7563
|
-
/* @__PURE__ */
|
|
7903
|
+
/* @__PURE__ */ jsx27(Plus3, { size: ICON_SIZE }),
|
|
7564
7904
|
t("add")
|
|
7565
7905
|
]
|
|
7566
7906
|
}
|
|
7567
7907
|
)
|
|
7568
7908
|
] }),
|
|
7569
|
-
!canManage && /* @__PURE__ */
|
|
7909
|
+
!canManage && /* @__PURE__ */ jsx27("footer", { className: "dd-dialog-footer dd-dialog-footer-end", children: /* @__PURE__ */ jsx27("button", { type: "button", className: "dd-btn", onClick: onClose, children: t("cancel") }) })
|
|
7570
7910
|
]
|
|
7571
7911
|
}
|
|
7572
7912
|
) });
|
|
7573
7913
|
}
|
|
7574
7914
|
|
|
7575
7915
|
// src/designer/EmailComposePanel.tsx
|
|
7576
|
-
import { useEffect as useEffect18, useId as
|
|
7916
|
+
import { useEffect as useEffect18, useId as useId7, useRef as useRef13, useState as useState19 } from "react";
|
|
7577
7917
|
import { Mail, Paperclip, Plus as Plus4, Trash2 as Trash23, X as X8 } from "lucide-react";
|
|
7578
|
-
import { useTranslation as
|
|
7918
|
+
import { useTranslation as useTranslation19 } from "react-i18next";
|
|
7579
7919
|
import { createId as createId4, resolveEmailOptions } from "@dashboard-designer/core";
|
|
7580
7920
|
|
|
7581
7921
|
// src/components/RichTextEditor.tsx
|
|
7582
|
-
import { useEffect as useEffect17, useRef as
|
|
7922
|
+
import { useEffect as useEffect17, useRef as useRef12 } from "react";
|
|
7583
7923
|
import {
|
|
7584
7924
|
Bold,
|
|
7585
7925
|
Italic,
|
|
@@ -7589,8 +7929,8 @@ import {
|
|
|
7589
7929
|
RemoveFormatting,
|
|
7590
7930
|
Underline
|
|
7591
7931
|
} from "lucide-react";
|
|
7592
|
-
import { useTranslation as
|
|
7593
|
-
import { jsx as
|
|
7932
|
+
import { useTranslation as useTranslation18 } from "react-i18next";
|
|
7933
|
+
import { jsx as jsx28, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
7594
7934
|
function escapeHtml(text) {
|
|
7595
7935
|
return text.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """);
|
|
7596
7936
|
}
|
|
@@ -7618,9 +7958,9 @@ function RichTextEditor({
|
|
|
7618
7958
|
disabled,
|
|
7619
7959
|
placeholder
|
|
7620
7960
|
}) {
|
|
7621
|
-
const { t } =
|
|
7622
|
-
const ref =
|
|
7623
|
-
const lastEmitted =
|
|
7961
|
+
const { t } = useTranslation18();
|
|
7962
|
+
const ref = useRef12(null);
|
|
7963
|
+
const lastEmitted = useRef12(valueHtml);
|
|
7624
7964
|
useEffect17(() => {
|
|
7625
7965
|
const el = ref.current;
|
|
7626
7966
|
if (!el) return;
|
|
@@ -7648,9 +7988,9 @@ function RichTextEditor({
|
|
|
7648
7988
|
if (!url) return;
|
|
7649
7989
|
format("createLink", url);
|
|
7650
7990
|
};
|
|
7651
|
-
return /* @__PURE__ */
|
|
7652
|
-
/* @__PURE__ */
|
|
7653
|
-
/* @__PURE__ */
|
|
7991
|
+
return /* @__PURE__ */ jsxs25("div", { className: `dd-rte${disabled ? " is-disabled" : ""}`, children: [
|
|
7992
|
+
/* @__PURE__ */ jsxs25("div", { className: "dd-rte-toolbar", role: "toolbar", "aria-label": t("emailFormatToolbar"), children: [
|
|
7993
|
+
/* @__PURE__ */ jsx28(
|
|
7654
7994
|
"button",
|
|
7655
7995
|
{
|
|
7656
7996
|
type: "button",
|
|
@@ -7660,10 +8000,10 @@ function RichTextEditor({
|
|
|
7660
8000
|
disabled,
|
|
7661
8001
|
onMouseDown: (e) => e.preventDefault(),
|
|
7662
8002
|
onClick: () => format("bold"),
|
|
7663
|
-
children: /* @__PURE__ */
|
|
8003
|
+
children: /* @__PURE__ */ jsx28(Bold, { size: ICON_SIZE })
|
|
7664
8004
|
}
|
|
7665
8005
|
),
|
|
7666
|
-
/* @__PURE__ */
|
|
8006
|
+
/* @__PURE__ */ jsx28(
|
|
7667
8007
|
"button",
|
|
7668
8008
|
{
|
|
7669
8009
|
type: "button",
|
|
@@ -7673,10 +8013,10 @@ function RichTextEditor({
|
|
|
7673
8013
|
disabled,
|
|
7674
8014
|
onMouseDown: (e) => e.preventDefault(),
|
|
7675
8015
|
onClick: () => format("italic"),
|
|
7676
|
-
children: /* @__PURE__ */
|
|
8016
|
+
children: /* @__PURE__ */ jsx28(Italic, { size: ICON_SIZE })
|
|
7677
8017
|
}
|
|
7678
8018
|
),
|
|
7679
|
-
/* @__PURE__ */
|
|
8019
|
+
/* @__PURE__ */ jsx28(
|
|
7680
8020
|
"button",
|
|
7681
8021
|
{
|
|
7682
8022
|
type: "button",
|
|
@@ -7686,11 +8026,11 @@ function RichTextEditor({
|
|
|
7686
8026
|
disabled,
|
|
7687
8027
|
onMouseDown: (e) => e.preventDefault(),
|
|
7688
8028
|
onClick: () => format("underline"),
|
|
7689
|
-
children: /* @__PURE__ */
|
|
8029
|
+
children: /* @__PURE__ */ jsx28(Underline, { size: ICON_SIZE })
|
|
7690
8030
|
}
|
|
7691
8031
|
),
|
|
7692
|
-
/* @__PURE__ */
|
|
7693
|
-
/* @__PURE__ */
|
|
8032
|
+
/* @__PURE__ */ jsx28("span", { className: "dd-rte-sep", "aria-hidden": true }),
|
|
8033
|
+
/* @__PURE__ */ jsx28(
|
|
7694
8034
|
"button",
|
|
7695
8035
|
{
|
|
7696
8036
|
type: "button",
|
|
@@ -7700,10 +8040,10 @@ function RichTextEditor({
|
|
|
7700
8040
|
disabled,
|
|
7701
8041
|
onMouseDown: (e) => e.preventDefault(),
|
|
7702
8042
|
onClick: () => format("insertUnorderedList"),
|
|
7703
|
-
children: /* @__PURE__ */
|
|
8043
|
+
children: /* @__PURE__ */ jsx28(List, { size: ICON_SIZE })
|
|
7704
8044
|
}
|
|
7705
8045
|
),
|
|
7706
|
-
/* @__PURE__ */
|
|
8046
|
+
/* @__PURE__ */ jsx28(
|
|
7707
8047
|
"button",
|
|
7708
8048
|
{
|
|
7709
8049
|
type: "button",
|
|
@@ -7713,11 +8053,11 @@ function RichTextEditor({
|
|
|
7713
8053
|
disabled,
|
|
7714
8054
|
onMouseDown: (e) => e.preventDefault(),
|
|
7715
8055
|
onClick: () => format("insertOrderedList"),
|
|
7716
|
-
children: /* @__PURE__ */
|
|
8056
|
+
children: /* @__PURE__ */ jsx28(ListOrdered, { size: ICON_SIZE })
|
|
7717
8057
|
}
|
|
7718
8058
|
),
|
|
7719
|
-
/* @__PURE__ */
|
|
7720
|
-
/* @__PURE__ */
|
|
8059
|
+
/* @__PURE__ */ jsx28("span", { className: "dd-rte-sep", "aria-hidden": true }),
|
|
8060
|
+
/* @__PURE__ */ jsx28(
|
|
7721
8061
|
"button",
|
|
7722
8062
|
{
|
|
7723
8063
|
type: "button",
|
|
@@ -7727,10 +8067,10 @@ function RichTextEditor({
|
|
|
7727
8067
|
disabled,
|
|
7728
8068
|
onMouseDown: (e) => e.preventDefault(),
|
|
7729
8069
|
onClick: addLink,
|
|
7730
|
-
children: /* @__PURE__ */
|
|
8070
|
+
children: /* @__PURE__ */ jsx28(Link22, { size: ICON_SIZE })
|
|
7731
8071
|
}
|
|
7732
8072
|
),
|
|
7733
|
-
/* @__PURE__ */
|
|
8073
|
+
/* @__PURE__ */ jsx28(
|
|
7734
8074
|
"button",
|
|
7735
8075
|
{
|
|
7736
8076
|
type: "button",
|
|
@@ -7740,11 +8080,11 @@ function RichTextEditor({
|
|
|
7740
8080
|
disabled,
|
|
7741
8081
|
onMouseDown: (e) => e.preventDefault(),
|
|
7742
8082
|
onClick: () => format("removeFormat"),
|
|
7743
|
-
children: /* @__PURE__ */
|
|
8083
|
+
children: /* @__PURE__ */ jsx28(RemoveFormatting, { size: ICON_SIZE })
|
|
7744
8084
|
}
|
|
7745
8085
|
)
|
|
7746
8086
|
] }),
|
|
7747
|
-
/* @__PURE__ */
|
|
8087
|
+
/* @__PURE__ */ jsx28(
|
|
7748
8088
|
"div",
|
|
7749
8089
|
{
|
|
7750
8090
|
id,
|
|
@@ -7849,7 +8189,7 @@ async function captureDashboardPdfAttachment(canvasEl, title) {
|
|
|
7849
8189
|
}
|
|
7850
8190
|
|
|
7851
8191
|
// src/designer/EmailComposePanel.tsx
|
|
7852
|
-
import { jsx as
|
|
8192
|
+
import { jsx as jsx29, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
7853
8193
|
var MAX_EXTRA_BYTES = 10 * 1024 * 1024;
|
|
7854
8194
|
function slugify2(title) {
|
|
7855
8195
|
const s = title.trim().toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "");
|
|
@@ -7884,9 +8224,9 @@ function EmailComposePanel({
|
|
|
7884
8224
|
api,
|
|
7885
8225
|
canvasElementId = "dd-canvas"
|
|
7886
8226
|
}) {
|
|
7887
|
-
const { t } =
|
|
7888
|
-
const fileInputId =
|
|
7889
|
-
const fileInputRef =
|
|
8227
|
+
const { t } = useTranslation19();
|
|
8228
|
+
const fileInputId = useId7();
|
|
8229
|
+
const fileInputRef = useRef13(null);
|
|
7890
8230
|
const emailOpts = resolveEmailOptions(dashboard.exportOptions);
|
|
7891
8231
|
const maxExtra = emailOpts.maxExtraAttachments;
|
|
7892
8232
|
const [to, setTo] = useState19("");
|
|
@@ -7972,7 +8312,7 @@ function EmailComposePanel({
|
|
|
7972
8312
|
setSending(false);
|
|
7973
8313
|
}
|
|
7974
8314
|
};
|
|
7975
|
-
return /* @__PURE__ */
|
|
8315
|
+
return /* @__PURE__ */ jsx29("div", { className: "dd-modal-backdrop", role: "presentation", onClick: onClose, children: /* @__PURE__ */ jsxs26(
|
|
7976
8316
|
"div",
|
|
7977
8317
|
{
|
|
7978
8318
|
className: "dd-dialog dd-email-panel",
|
|
@@ -7981,29 +8321,29 @@ function EmailComposePanel({
|
|
|
7981
8321
|
"aria-labelledby": "dd-email-title",
|
|
7982
8322
|
onClick: (e) => e.stopPropagation(),
|
|
7983
8323
|
children: [
|
|
7984
|
-
/* @__PURE__ */
|
|
7985
|
-
/* @__PURE__ */
|
|
7986
|
-
/* @__PURE__ */
|
|
8324
|
+
/* @__PURE__ */ jsxs26("header", { className: "dd-dialog-header", children: [
|
|
8325
|
+
/* @__PURE__ */ jsxs26("h2", { id: "dd-email-title", children: [
|
|
8326
|
+
/* @__PURE__ */ jsx29(Mail, { size: ICON_SIZE, "aria-hidden": true }),
|
|
7987
8327
|
" ",
|
|
7988
8328
|
t("composeEmail")
|
|
7989
8329
|
] }),
|
|
7990
|
-
/* @__PURE__ */
|
|
8330
|
+
/* @__PURE__ */ jsx29(
|
|
7991
8331
|
"button",
|
|
7992
8332
|
{
|
|
7993
8333
|
type: "button",
|
|
7994
8334
|
className: "dd-btn dd-btn-ghost dd-btn-icon",
|
|
7995
8335
|
onClick: onClose,
|
|
7996
8336
|
"aria-label": t("cancel"),
|
|
7997
|
-
children: /* @__PURE__ */
|
|
8337
|
+
children: /* @__PURE__ */ jsx29(X8, { size: ICON_SIZE })
|
|
7998
8338
|
}
|
|
7999
8339
|
)
|
|
8000
8340
|
] }),
|
|
8001
|
-
/* @__PURE__ */
|
|
8002
|
-
configured === false && /* @__PURE__ */
|
|
8003
|
-
/* @__PURE__ */
|
|
8004
|
-
/* @__PURE__ */
|
|
8005
|
-
/* @__PURE__ */
|
|
8006
|
-
/* @__PURE__ */
|
|
8341
|
+
/* @__PURE__ */ jsxs26("div", { className: "dd-dialog-body dd-email-body-wrap", children: [
|
|
8342
|
+
configured === false && /* @__PURE__ */ jsx29("p", { className: "dd-error", role: "alert", children: t("emailNotConfigured") }),
|
|
8343
|
+
/* @__PURE__ */ jsx29("p", { className: "dd-hint", children: t("emailComposeHint") }),
|
|
8344
|
+
/* @__PURE__ */ jsxs26("div", { className: "dd-field", children: [
|
|
8345
|
+
/* @__PURE__ */ jsx29(FieldLabel, { htmlFor: "dd-email-to", help: t("helpEmailTo"), children: t("emailTo") }),
|
|
8346
|
+
/* @__PURE__ */ jsx29(
|
|
8007
8347
|
"input",
|
|
8008
8348
|
{
|
|
8009
8349
|
id: "dd-email-to",
|
|
@@ -8016,9 +8356,9 @@ function EmailComposePanel({
|
|
|
8016
8356
|
}
|
|
8017
8357
|
)
|
|
8018
8358
|
] }),
|
|
8019
|
-
/* @__PURE__ */
|
|
8020
|
-
/* @__PURE__ */
|
|
8021
|
-
/* @__PURE__ */
|
|
8359
|
+
/* @__PURE__ */ jsxs26("div", { className: "dd-field", children: [
|
|
8360
|
+
/* @__PURE__ */ jsx29(FieldLabel, { htmlFor: "dd-email-cc", help: t("helpEmailCc"), children: t("emailCc") }),
|
|
8361
|
+
/* @__PURE__ */ jsx29(
|
|
8022
8362
|
"input",
|
|
8023
8363
|
{
|
|
8024
8364
|
id: "dd-email-cc",
|
|
@@ -8031,9 +8371,9 @@ function EmailComposePanel({
|
|
|
8031
8371
|
}
|
|
8032
8372
|
)
|
|
8033
8373
|
] }),
|
|
8034
|
-
/* @__PURE__ */
|
|
8035
|
-
/* @__PURE__ */
|
|
8036
|
-
/* @__PURE__ */
|
|
8374
|
+
/* @__PURE__ */ jsxs26("div", { className: "dd-field", children: [
|
|
8375
|
+
/* @__PURE__ */ jsx29(FieldLabel, { htmlFor: "dd-email-subject", children: t("emailSubject") }),
|
|
8376
|
+
/* @__PURE__ */ jsx29(
|
|
8037
8377
|
"input",
|
|
8038
8378
|
{
|
|
8039
8379
|
id: "dd-email-subject",
|
|
@@ -8044,9 +8384,9 @@ function EmailComposePanel({
|
|
|
8044
8384
|
}
|
|
8045
8385
|
)
|
|
8046
8386
|
] }),
|
|
8047
|
-
/* @__PURE__ */
|
|
8048
|
-
/* @__PURE__ */
|
|
8049
|
-
/* @__PURE__ */
|
|
8387
|
+
/* @__PURE__ */ jsxs26("div", { className: "dd-field", children: [
|
|
8388
|
+
/* @__PURE__ */ jsx29(FieldLabel, { htmlFor: "dd-email-body", help: t("helpEmailBody"), children: t("emailBody") }),
|
|
8389
|
+
/* @__PURE__ */ jsx29(
|
|
8050
8390
|
RichTextEditor,
|
|
8051
8391
|
{
|
|
8052
8392
|
id: "dd-email-body",
|
|
@@ -8057,18 +8397,18 @@ function EmailComposePanel({
|
|
|
8057
8397
|
}
|
|
8058
8398
|
)
|
|
8059
8399
|
] }),
|
|
8060
|
-
showAttachments && /* @__PURE__ */
|
|
8061
|
-
/* @__PURE__ */
|
|
8062
|
-
/* @__PURE__ */
|
|
8063
|
-
emailOpts.attachPdf && /* @__PURE__ */
|
|
8064
|
-
/* @__PURE__ */
|
|
8065
|
-
/* @__PURE__ */
|
|
8066
|
-
/* @__PURE__ */
|
|
8400
|
+
showAttachments && /* @__PURE__ */ jsxs26("div", { className: "dd-field dd-email-attachment-field", children: [
|
|
8401
|
+
/* @__PURE__ */ jsx29(FieldLabel, { help: t("helpEmailAttachment"), children: t("emailAttachments") }),
|
|
8402
|
+
/* @__PURE__ */ jsxs26("ul", { className: "dd-email-attach-list", children: [
|
|
8403
|
+
emailOpts.attachPdf && /* @__PURE__ */ jsxs26("li", { className: "dd-email-attachment", children: [
|
|
8404
|
+
/* @__PURE__ */ jsx29(Paperclip, { size: ICON_SIZE, "aria-hidden": true }),
|
|
8405
|
+
/* @__PURE__ */ jsx29("code", { children: dashboardPdfName }),
|
|
8406
|
+
/* @__PURE__ */ jsx29("span", { className: "dd-muted dd-email-attachment-note", children: t("emailAttachmentPdfNote") })
|
|
8067
8407
|
] }),
|
|
8068
|
-
emailOpts.allowExtraAttachments && extraAttachments.map((file) => /* @__PURE__ */
|
|
8069
|
-
/* @__PURE__ */
|
|
8070
|
-
/* @__PURE__ */
|
|
8071
|
-
/* @__PURE__ */
|
|
8408
|
+
emailOpts.allowExtraAttachments && extraAttachments.map((file) => /* @__PURE__ */ jsxs26("li", { className: "dd-email-attachment", children: [
|
|
8409
|
+
/* @__PURE__ */ jsx29(Paperclip, { size: ICON_SIZE, "aria-hidden": true }),
|
|
8410
|
+
/* @__PURE__ */ jsx29("code", { title: file.filename, children: file.filename }),
|
|
8411
|
+
/* @__PURE__ */ jsx29(
|
|
8072
8412
|
"button",
|
|
8073
8413
|
{
|
|
8074
8414
|
type: "button",
|
|
@@ -8077,13 +8417,13 @@ function EmailComposePanel({
|
|
|
8077
8417
|
"aria-label": t("remove"),
|
|
8078
8418
|
disabled: sending,
|
|
8079
8419
|
onClick: () => removeExtra(file.id),
|
|
8080
|
-
children: /* @__PURE__ */
|
|
8420
|
+
children: /* @__PURE__ */ jsx29(Trash23, { size: ICON_SIZE })
|
|
8081
8421
|
}
|
|
8082
8422
|
)
|
|
8083
8423
|
] }, file.id))
|
|
8084
8424
|
] }),
|
|
8085
|
-
emailOpts.allowExtraAttachments && maxExtra > 0 && /* @__PURE__ */
|
|
8086
|
-
/* @__PURE__ */
|
|
8425
|
+
emailOpts.allowExtraAttachments && maxExtra > 0 && /* @__PURE__ */ jsxs26("div", { className: "dd-email-attach-actions", children: [
|
|
8426
|
+
/* @__PURE__ */ jsx29(
|
|
8087
8427
|
"input",
|
|
8088
8428
|
{
|
|
8089
8429
|
ref: fileInputRef,
|
|
@@ -8095,7 +8435,7 @@ function EmailComposePanel({
|
|
|
8095
8435
|
disabled: sending || extraAttachments.length >= maxExtra
|
|
8096
8436
|
}
|
|
8097
8437
|
),
|
|
8098
|
-
/* @__PURE__ */
|
|
8438
|
+
/* @__PURE__ */ jsxs26(
|
|
8099
8439
|
"button",
|
|
8100
8440
|
{
|
|
8101
8441
|
type: "button",
|
|
@@ -8103,20 +8443,20 @@ function EmailComposePanel({
|
|
|
8103
8443
|
disabled: sending || extraAttachments.length >= maxExtra,
|
|
8104
8444
|
onClick: () => fileInputRef.current?.click(),
|
|
8105
8445
|
children: [
|
|
8106
|
-
/* @__PURE__ */
|
|
8446
|
+
/* @__PURE__ */ jsx29(Plus4, { size: ICON_SIZE }),
|
|
8107
8447
|
t("emailAddAttachment")
|
|
8108
8448
|
]
|
|
8109
8449
|
}
|
|
8110
8450
|
),
|
|
8111
|
-
/* @__PURE__ */
|
|
8451
|
+
/* @__PURE__ */ jsx29(FieldHelp, { text: t("helpEmailExtraAttachments") })
|
|
8112
8452
|
] })
|
|
8113
8453
|
] }),
|
|
8114
|
-
error && /* @__PURE__ */
|
|
8115
|
-
success && /* @__PURE__ */
|
|
8454
|
+
error && /* @__PURE__ */ jsx29("p", { className: "dd-error", role: "alert", children: error }),
|
|
8455
|
+
success && /* @__PURE__ */ jsx29("p", { className: "dd-status-ok", role: "status", children: success })
|
|
8116
8456
|
] }),
|
|
8117
|
-
/* @__PURE__ */
|
|
8118
|
-
/* @__PURE__ */
|
|
8119
|
-
/* @__PURE__ */
|
|
8457
|
+
/* @__PURE__ */ jsx29("footer", { className: "dd-dialog-footer", children: /* @__PURE__ */ jsxs26("div", { className: "dd-dialog-footer-end", children: [
|
|
8458
|
+
/* @__PURE__ */ jsx29("button", { type: "button", className: "dd-btn", onClick: onClose, disabled: sending, children: t("cancel") }),
|
|
8459
|
+
/* @__PURE__ */ jsxs26(
|
|
8120
8460
|
"button",
|
|
8121
8461
|
{
|
|
8122
8462
|
type: "button",
|
|
@@ -8124,7 +8464,7 @@ function EmailComposePanel({
|
|
|
8124
8464
|
onClick: () => void send(),
|
|
8125
8465
|
disabled: sending || !to.trim() || !subject.trim() || configured === false,
|
|
8126
8466
|
children: [
|
|
8127
|
-
/* @__PURE__ */
|
|
8467
|
+
/* @__PURE__ */ jsx29(Mail, { size: ICON_SIZE }),
|
|
8128
8468
|
sending ? t("emailSending") : t("sendEmail")
|
|
8129
8469
|
]
|
|
8130
8470
|
}
|
|
@@ -8138,7 +8478,7 @@ function EmailComposePanel({
|
|
|
8138
8478
|
// src/designer/DashboardSettingsPanel.tsx
|
|
8139
8479
|
import { useEffect as useEffect19, useMemo as useMemo11, useState as useState20 } from "react";
|
|
8140
8480
|
import { Plus as Plus5, RotateCcw as RotateCcw3, Trash2 as Trash24, X as X9 } from "lucide-react";
|
|
8141
|
-
import { useTranslation as
|
|
8481
|
+
import { useTranslation as useTranslation20 } from "react-i18next";
|
|
8142
8482
|
import {
|
|
8143
8483
|
matchThemePreset,
|
|
8144
8484
|
resolveDashboardTheme as resolveDashboardTheme2,
|
|
@@ -8147,7 +8487,7 @@ import {
|
|
|
8147
8487
|
resolveExportOptions,
|
|
8148
8488
|
THEME_PRESETS
|
|
8149
8489
|
} from "@dashboard-designer/core";
|
|
8150
|
-
import { Fragment as Fragment11, jsx as
|
|
8490
|
+
import { Fragment as Fragment11, jsx as jsx30, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
8151
8491
|
var CURRENCIES = ["USD", "EUR", "GBP", "INR", "JPY", "CAD", "AUD", "MXN"];
|
|
8152
8492
|
var TIMEZONES = [
|
|
8153
8493
|
"UTC",
|
|
@@ -8203,7 +8543,7 @@ function DashboardSettingsPanel({
|
|
|
8203
8543
|
onClose,
|
|
8204
8544
|
onChange
|
|
8205
8545
|
}) {
|
|
8206
|
-
const { t } =
|
|
8546
|
+
const { t } = useTranslation20();
|
|
8207
8547
|
const [draft, setDraft] = useState20(() => draftFromDashboard(dashboard));
|
|
8208
8548
|
const [printFields, setPrintFields] = useState20("");
|
|
8209
8549
|
useEffect19(() => {
|
|
@@ -8278,7 +8618,7 @@ function DashboardSettingsPanel({
|
|
|
8278
8618
|
});
|
|
8279
8619
|
onClose();
|
|
8280
8620
|
};
|
|
8281
|
-
return /* @__PURE__ */
|
|
8621
|
+
return /* @__PURE__ */ jsx30("div", { className: "dd-modal-backdrop", role: "presentation", onClick: onClose, children: /* @__PURE__ */ jsxs27(
|
|
8282
8622
|
"div",
|
|
8283
8623
|
{
|
|
8284
8624
|
className: "dd-dialog dd-settings-panel",
|
|
@@ -8287,64 +8627,64 @@ function DashboardSettingsPanel({
|
|
|
8287
8627
|
"aria-labelledby": "dd-settings-title",
|
|
8288
8628
|
onClick: (e) => e.stopPropagation(),
|
|
8289
8629
|
children: [
|
|
8290
|
-
/* @__PURE__ */
|
|
8291
|
-
/* @__PURE__ */
|
|
8292
|
-
/* @__PURE__ */
|
|
8630
|
+
/* @__PURE__ */ jsxs27("header", { className: "dd-dialog-header", children: [
|
|
8631
|
+
/* @__PURE__ */ jsx30("h2", { id: "dd-settings-title", children: t("dashboardSettings") }),
|
|
8632
|
+
/* @__PURE__ */ jsx30(
|
|
8293
8633
|
"button",
|
|
8294
8634
|
{
|
|
8295
8635
|
type: "button",
|
|
8296
8636
|
className: "dd-btn dd-btn-ghost dd-btn-icon",
|
|
8297
8637
|
onClick: onClose,
|
|
8298
8638
|
"aria-label": t("cancel"),
|
|
8299
|
-
children: /* @__PURE__ */
|
|
8639
|
+
children: /* @__PURE__ */ jsx30(X9, { size: ICON_SIZE })
|
|
8300
8640
|
}
|
|
8301
8641
|
)
|
|
8302
8642
|
] }),
|
|
8303
|
-
/* @__PURE__ */
|
|
8304
|
-
/* @__PURE__ */
|
|
8305
|
-
/* @__PURE__ */
|
|
8306
|
-
/* @__PURE__ */
|
|
8307
|
-
/* @__PURE__ */
|
|
8308
|
-
/* @__PURE__ */
|
|
8309
|
-
/* @__PURE__ */
|
|
8643
|
+
/* @__PURE__ */ jsxs27("div", { className: "dd-dialog-body", children: [
|
|
8644
|
+
/* @__PURE__ */ jsx30("p", { className: "dd-hint", children: t("dashboardSettingsHint") }),
|
|
8645
|
+
/* @__PURE__ */ jsxs27("section", { className: "dd-theme-section", children: [
|
|
8646
|
+
/* @__PURE__ */ jsx30("h3", { children: "Print settings" }),
|
|
8647
|
+
/* @__PURE__ */ jsx30("p", { className: "dd-hint", children: "Saved with this dashboard. Apply these settings, then save the dashboard. User and print time are filled automatically." }),
|
|
8648
|
+
/* @__PURE__ */ jsxs27("div", { className: "dd-settings-grid", children: [
|
|
8649
|
+
/* @__PURE__ */ jsxs27("label", { className: "dd-field", children: [
|
|
8310
8650
|
"Default orientation",
|
|
8311
|
-
/* @__PURE__ */
|
|
8312
|
-
/* @__PURE__ */
|
|
8313
|
-
/* @__PURE__ */
|
|
8651
|
+
/* @__PURE__ */ jsxs27("select", { className: "dd-input", value: draft.printSettings.orientation, onChange: (e) => setDraft((d) => ({ ...d, printSettings: { ...d.printSettings, orientation: e.target.value } })), children: [
|
|
8652
|
+
/* @__PURE__ */ jsx30("option", { value: "portrait", children: "Portrait" }),
|
|
8653
|
+
/* @__PURE__ */ jsx30("option", { value: "landscape", children: "Landscape" })
|
|
8314
8654
|
] })
|
|
8315
8655
|
] }),
|
|
8316
|
-
/* @__PURE__ */
|
|
8656
|
+
/* @__PURE__ */ jsxs27("label", { className: "dd-field", children: [
|
|
8317
8657
|
"Default layout",
|
|
8318
|
-
/* @__PURE__ */
|
|
8319
|
-
/* @__PURE__ */
|
|
8320
|
-
/* @__PURE__ */
|
|
8321
|
-
/* @__PURE__ */
|
|
8658
|
+
/* @__PURE__ */ jsxs27("select", { className: "dd-input", value: draft.printSettings.layout, onChange: (e) => setDraft((d) => ({ ...d, printSettings: { ...d.printSettings, layout: e.target.value } })), children: [
|
|
8659
|
+
/* @__PURE__ */ jsx30("option", { value: "designed", children: "As designed" }),
|
|
8660
|
+
/* @__PURE__ */ jsx30("option", { value: "one-column", children: "1 column" }),
|
|
8661
|
+
/* @__PURE__ */ jsx30("option", { value: "two-column", children: "2 columns" })
|
|
8322
8662
|
] })
|
|
8323
8663
|
] })
|
|
8324
8664
|
] }),
|
|
8325
8665
|
" ",
|
|
8326
|
-
/* @__PURE__ */
|
|
8327
|
-
/* @__PURE__ */
|
|
8328
|
-
/* @__PURE__ */
|
|
8329
|
-
/* @__PURE__ */
|
|
8666
|
+
/* @__PURE__ */ jsxs27("fieldset", { className: "dd-print-header-settings", children: [
|
|
8667
|
+
/* @__PURE__ */ jsx30("legend", { children: "Report header" }),
|
|
8668
|
+
/* @__PURE__ */ jsxs27("label", { className: "dd-print-header-toggle", children: [
|
|
8669
|
+
/* @__PURE__ */ jsx30("input", { type: "checkbox", checked: draft.printSettings.header?.enabled !== false, onChange: (e) => updateHeader({ enabled: e.target.checked }) }),
|
|
8330
8670
|
"Show header"
|
|
8331
8671
|
] }),
|
|
8332
|
-
draft.printSettings.header?.enabled !== false && /* @__PURE__ */
|
|
8333
|
-
/* @__PURE__ */
|
|
8672
|
+
draft.printSettings.header?.enabled !== false && /* @__PURE__ */ jsxs27(Fragment11, { children: [
|
|
8673
|
+
/* @__PURE__ */ jsxs27("label", { children: [
|
|
8334
8674
|
"Report title",
|
|
8335
|
-
/* @__PURE__ */
|
|
8675
|
+
/* @__PURE__ */ jsx30("input", { className: "dd-input", value: draft.printSettings.header?.title ?? "", onChange: (e) => updateHeader({ title: e.target.value }) })
|
|
8336
8676
|
] }),
|
|
8337
|
-
/* @__PURE__ */
|
|
8677
|
+
/* @__PURE__ */ jsxs27("label", { children: [
|
|
8338
8678
|
"Organization",
|
|
8339
|
-
/* @__PURE__ */
|
|
8679
|
+
/* @__PURE__ */ jsx30("input", { className: "dd-input", value: draft.printSettings.header?.organization ?? "", onChange: (e) => updateHeader({ organization: e.target.value }) })
|
|
8340
8680
|
] }),
|
|
8341
|
-
/* @__PURE__ */
|
|
8681
|
+
/* @__PURE__ */ jsxs27("label", { children: [
|
|
8342
8682
|
"Logo URL",
|
|
8343
|
-
/* @__PURE__ */
|
|
8683
|
+
/* @__PURE__ */ jsx30("input", { className: "dd-input", placeholder: "https://\u2026 or an image path", value: draft.printSettings.header?.logoUrl ?? "", onChange: (e) => updateHeader({ logoUrl: e.target.value }) })
|
|
8344
8684
|
] }),
|
|
8345
|
-
/* @__PURE__ */
|
|
8685
|
+
/* @__PURE__ */ jsxs27("label", { children: [
|
|
8346
8686
|
"Upload logo",
|
|
8347
|
-
/* @__PURE__ */
|
|
8687
|
+
/* @__PURE__ */ jsx30("input", { type: "file", accept: "image/png,image/jpeg,image/webp,image/svg+xml", onChange: (e) => {
|
|
8348
8688
|
const file = e.target.files?.[0];
|
|
8349
8689
|
if (!file) return;
|
|
8350
8690
|
const reader = new FileReader();
|
|
@@ -8352,33 +8692,33 @@ function DashboardSettingsPanel({
|
|
|
8352
8692
|
reader.readAsDataURL(file);
|
|
8353
8693
|
} })
|
|
8354
8694
|
] }),
|
|
8355
|
-
/* @__PURE__ */
|
|
8356
|
-
/* @__PURE__ */
|
|
8695
|
+
/* @__PURE__ */ jsxs27("label", { className: "dd-print-header-toggle", children: [
|
|
8696
|
+
/* @__PURE__ */ jsx30("input", { type: "checkbox", checked: draft.printSettings.header?.showPrintedBy !== false, onChange: (e) => updateHeader({ showPrintedBy: e.target.checked }) }),
|
|
8357
8697
|
"Show printed-by user (set automatically)"
|
|
8358
8698
|
] }),
|
|
8359
|
-
/* @__PURE__ */
|
|
8360
|
-
/* @__PURE__ */
|
|
8699
|
+
/* @__PURE__ */ jsxs27("label", { className: "dd-print-header-toggle", children: [
|
|
8700
|
+
/* @__PURE__ */ jsx30("input", { type: "checkbox", checked: draft.printSettings.header?.showPrintedOn !== false, onChange: (e) => updateHeader({ showPrintedOn: e.target.checked }) }),
|
|
8361
8701
|
"Include print date and time"
|
|
8362
8702
|
] }),
|
|
8363
|
-
/* @__PURE__ */
|
|
8364
|
-
/* @__PURE__ */
|
|
8703
|
+
/* @__PURE__ */ jsxs27("label", { className: "dd-print-header-toggle", children: [
|
|
8704
|
+
/* @__PURE__ */ jsx30("input", { type: "checkbox", checked: draft.printSettings.header?.repeat !== false, onChange: (e) => updateHeader({ repeat: e.target.checked }) }),
|
|
8365
8705
|
"Repeat on every page"
|
|
8366
8706
|
] }),
|
|
8367
|
-
/* @__PURE__ */
|
|
8707
|
+
/* @__PURE__ */ jsxs27("label", { children: [
|
|
8368
8708
|
"Additional fields",
|
|
8369
|
-
/* @__PURE__ */
|
|
8709
|
+
/* @__PURE__ */ jsx30("textarea", { className: "dd-input", rows: 3, placeholder: "Department: Quality\nReference: RPT-001", value: printFields, onChange: (e) => {
|
|
8370
8710
|
setPrintFields(e.target.value);
|
|
8371
8711
|
updateHeader({ fields: parsePrintHeaderFields(e.target.value) });
|
|
8372
8712
|
} })
|
|
8373
8713
|
] }),
|
|
8374
|
-
/* @__PURE__ */
|
|
8714
|
+
/* @__PURE__ */ jsx30("p", { className: "dd-hint", children: "One Label: value per line. The timestamp is set when Print is clicked." })
|
|
8375
8715
|
] })
|
|
8376
8716
|
] })
|
|
8377
8717
|
] }),
|
|
8378
|
-
/* @__PURE__ */
|
|
8379
|
-
/* @__PURE__ */
|
|
8380
|
-
/* @__PURE__ */
|
|
8381
|
-
/* @__PURE__ */
|
|
8718
|
+
/* @__PURE__ */ jsxs27("div", { className: "dd-settings-grid", children: [
|
|
8719
|
+
/* @__PURE__ */ jsxs27("div", { className: "dd-field", children: [
|
|
8720
|
+
/* @__PURE__ */ jsx30(FieldLabel, { htmlFor: "dd-dash-locale", help: t("helpLocale"), children: t("locale") }),
|
|
8721
|
+
/* @__PURE__ */ jsxs27(
|
|
8382
8722
|
"select",
|
|
8383
8723
|
{
|
|
8384
8724
|
id: "dd-dash-locale",
|
|
@@ -8386,30 +8726,30 @@ function DashboardSettingsPanel({
|
|
|
8386
8726
|
value: draft.locale,
|
|
8387
8727
|
onChange: (e) => setDraft((d) => ({ ...d, locale: e.target.value })),
|
|
8388
8728
|
children: [
|
|
8389
|
-
/* @__PURE__ */
|
|
8390
|
-
/* @__PURE__ */
|
|
8391
|
-
/* @__PURE__ */
|
|
8392
|
-
/* @__PURE__ */
|
|
8729
|
+
/* @__PURE__ */ jsx30("option", { value: "en", children: "English" }),
|
|
8730
|
+
/* @__PURE__ */ jsx30("option", { value: "es", children: "Espa\xF1ol" }),
|
|
8731
|
+
/* @__PURE__ */ jsx30("option", { value: "ar", children: "\u0627\u0644\u0639\u0631\u0628\u064A\u0629 (RTL)" }),
|
|
8732
|
+
/* @__PURE__ */ jsx30("option", { value: "he", children: "\u05E2\u05D1\u05E8\u05D9\u05EA (RTL)" })
|
|
8393
8733
|
]
|
|
8394
8734
|
}
|
|
8395
8735
|
)
|
|
8396
8736
|
] }),
|
|
8397
|
-
/* @__PURE__ */
|
|
8398
|
-
/* @__PURE__ */
|
|
8399
|
-
/* @__PURE__ */
|
|
8737
|
+
/* @__PURE__ */ jsxs27("div", { className: "dd-field", children: [
|
|
8738
|
+
/* @__PURE__ */ jsx30(FieldLabel, { htmlFor: "dd-dash-currency", help: t("helpCurrency"), children: t("currency") }),
|
|
8739
|
+
/* @__PURE__ */ jsx30(
|
|
8400
8740
|
"select",
|
|
8401
8741
|
{
|
|
8402
8742
|
id: "dd-dash-currency",
|
|
8403
8743
|
className: "dd-input",
|
|
8404
8744
|
value: draft.currency,
|
|
8405
8745
|
onChange: (e) => setDraft((d) => ({ ...d, currency: e.target.value })),
|
|
8406
|
-
children: CURRENCIES.map((c) => /* @__PURE__ */
|
|
8746
|
+
children: CURRENCIES.map((c) => /* @__PURE__ */ jsx30("option", { value: c, children: c }, c))
|
|
8407
8747
|
}
|
|
8408
8748
|
)
|
|
8409
8749
|
] }),
|
|
8410
|
-
/* @__PURE__ */
|
|
8411
|
-
/* @__PURE__ */
|
|
8412
|
-
/* @__PURE__ */
|
|
8750
|
+
/* @__PURE__ */ jsxs27("div", { className: "dd-field", children: [
|
|
8751
|
+
/* @__PURE__ */ jsx30(FieldLabel, { htmlFor: "dd-dash-tz", help: t("helpTimeZone"), children: t("timeZone") }),
|
|
8752
|
+
/* @__PURE__ */ jsxs27(
|
|
8413
8753
|
"select",
|
|
8414
8754
|
{
|
|
8415
8755
|
id: "dd-dash-tz",
|
|
@@ -8417,15 +8757,15 @@ function DashboardSettingsPanel({
|
|
|
8417
8757
|
value: draft.timeZone,
|
|
8418
8758
|
onChange: (e) => setDraft((d) => ({ ...d, timeZone: e.target.value })),
|
|
8419
8759
|
children: [
|
|
8420
|
-
/* @__PURE__ */
|
|
8421
|
-
TIMEZONES.map((tz) => /* @__PURE__ */
|
|
8760
|
+
/* @__PURE__ */ jsx30("option", { value: "", children: t("timeZoneBrowser") }),
|
|
8761
|
+
TIMEZONES.map((tz) => /* @__PURE__ */ jsx30("option", { value: tz, children: tz }, tz))
|
|
8422
8762
|
]
|
|
8423
8763
|
}
|
|
8424
8764
|
)
|
|
8425
8765
|
] }),
|
|
8426
|
-
/* @__PURE__ */
|
|
8427
|
-
/* @__PURE__ */
|
|
8428
|
-
/* @__PURE__ */
|
|
8766
|
+
/* @__PURE__ */ jsxs27("div", { className: "dd-field", children: [
|
|
8767
|
+
/* @__PURE__ */ jsx30(FieldLabel, { htmlFor: "dd-dash-dir", help: t("helpTextDirection"), children: t("textDirection") }),
|
|
8768
|
+
/* @__PURE__ */ jsxs27(
|
|
8429
8769
|
"select",
|
|
8430
8770
|
{
|
|
8431
8771
|
id: "dd-dash-dir",
|
|
@@ -8433,22 +8773,22 @@ function DashboardSettingsPanel({
|
|
|
8433
8773
|
value: draft.dir,
|
|
8434
8774
|
onChange: (e) => setDraft((d) => ({ ...d, dir: e.target.value })),
|
|
8435
8775
|
children: [
|
|
8436
|
-
/* @__PURE__ */
|
|
8437
|
-
/* @__PURE__ */
|
|
8438
|
-
/* @__PURE__ */
|
|
8776
|
+
/* @__PURE__ */ jsx30("option", { value: "", children: t("dirAuto") }),
|
|
8777
|
+
/* @__PURE__ */ jsx30("option", { value: "ltr", children: "LTR" }),
|
|
8778
|
+
/* @__PURE__ */ jsx30("option", { value: "rtl", children: "RTL" })
|
|
8439
8779
|
]
|
|
8440
8780
|
}
|
|
8441
8781
|
)
|
|
8442
8782
|
] })
|
|
8443
8783
|
] }),
|
|
8444
|
-
/* @__PURE__ */
|
|
8445
|
-
/* @__PURE__ */
|
|
8446
|
-
/* @__PURE__ */
|
|
8447
|
-
/* @__PURE__ */
|
|
8784
|
+
/* @__PURE__ */ jsxs27("div", { className: "dd-theme-section", children: [
|
|
8785
|
+
/* @__PURE__ */ jsx30("div", { className: "dd-theme-section-head", children: /* @__PURE__ */ jsxs27("div", { children: [
|
|
8786
|
+
/* @__PURE__ */ jsx30("h3", { className: "dd-theme-title", children: t("displayOptions") }),
|
|
8787
|
+
/* @__PURE__ */ jsx30("p", { className: "dd-hint dd-theme-hint", children: t("helpDisplayOptions") })
|
|
8448
8788
|
] }) }),
|
|
8449
|
-
/* @__PURE__ */
|
|
8450
|
-
/* @__PURE__ */
|
|
8451
|
-
/* @__PURE__ */
|
|
8789
|
+
/* @__PURE__ */ jsxs27("div", { className: "dd-field dd-check-field", children: [
|
|
8790
|
+
/* @__PURE__ */ jsxs27("label", { className: "dd-check-row", htmlFor: "dd-display-widget-badge", children: [
|
|
8791
|
+
/* @__PURE__ */ jsx30(
|
|
8452
8792
|
"input",
|
|
8453
8793
|
{
|
|
8454
8794
|
id: "dd-display-widget-badge",
|
|
@@ -8457,19 +8797,19 @@ function DashboardSettingsPanel({
|
|
|
8457
8797
|
onChange: (e) => setDraft((d) => ({ ...d, showWidgetTypeBadge: e.target.checked }))
|
|
8458
8798
|
}
|
|
8459
8799
|
),
|
|
8460
|
-
/* @__PURE__ */
|
|
8800
|
+
/* @__PURE__ */ jsx30("span", { className: "dd-check-row-text", children: t("showWidgetTypeBadge") })
|
|
8461
8801
|
] }),
|
|
8462
|
-
/* @__PURE__ */
|
|
8802
|
+
/* @__PURE__ */ jsx30(FieldHelp, { text: t("helpShowWidgetTypeBadge") })
|
|
8463
8803
|
] })
|
|
8464
8804
|
] }),
|
|
8465
|
-
/* @__PURE__ */
|
|
8466
|
-
/* @__PURE__ */
|
|
8467
|
-
/* @__PURE__ */
|
|
8468
|
-
/* @__PURE__ */
|
|
8805
|
+
/* @__PURE__ */ jsxs27("div", { className: "dd-theme-section", children: [
|
|
8806
|
+
/* @__PURE__ */ jsx30("div", { className: "dd-theme-section-head", children: /* @__PURE__ */ jsxs27("div", { children: [
|
|
8807
|
+
/* @__PURE__ */ jsx30("h3", { className: "dd-theme-title", children: t("exportOptions") }),
|
|
8808
|
+
/* @__PURE__ */ jsx30("p", { className: "dd-hint dd-theme-hint", children: t("helpExportOptions") })
|
|
8469
8809
|
] }) }),
|
|
8470
|
-
/* @__PURE__ */
|
|
8471
|
-
/* @__PURE__ */
|
|
8472
|
-
/* @__PURE__ */
|
|
8810
|
+
/* @__PURE__ */ jsxs27("div", { className: "dd-field dd-check-field", children: [
|
|
8811
|
+
/* @__PURE__ */ jsxs27("label", { className: "dd-check-row", htmlFor: "dd-export-print", children: [
|
|
8812
|
+
/* @__PURE__ */ jsx30(
|
|
8473
8813
|
"input",
|
|
8474
8814
|
{
|
|
8475
8815
|
id: "dd-export-print",
|
|
@@ -8478,13 +8818,13 @@ function DashboardSettingsPanel({
|
|
|
8478
8818
|
onChange: (e) => setDraft((d) => ({ ...d, allowPrint: e.target.checked }))
|
|
8479
8819
|
}
|
|
8480
8820
|
),
|
|
8481
|
-
/* @__PURE__ */
|
|
8821
|
+
/* @__PURE__ */ jsx30("span", { className: "dd-check-row-text", children: t("allowPrint") })
|
|
8482
8822
|
] }),
|
|
8483
|
-
/* @__PURE__ */
|
|
8823
|
+
/* @__PURE__ */ jsx30(FieldHelp, { text: t("helpAllowPrint") })
|
|
8484
8824
|
] }),
|
|
8485
|
-
/* @__PURE__ */
|
|
8486
|
-
/* @__PURE__ */
|
|
8487
|
-
/* @__PURE__ */
|
|
8825
|
+
/* @__PURE__ */ jsxs27("div", { className: "dd-field dd-check-field", children: [
|
|
8826
|
+
/* @__PURE__ */ jsxs27("label", { className: "dd-check-row", htmlFor: "dd-export-pdf", children: [
|
|
8827
|
+
/* @__PURE__ */ jsx30(
|
|
8488
8828
|
"input",
|
|
8489
8829
|
{
|
|
8490
8830
|
id: "dd-export-pdf",
|
|
@@ -8493,13 +8833,13 @@ function DashboardSettingsPanel({
|
|
|
8493
8833
|
onChange: (e) => setDraft((d) => ({ ...d, allowPdf: e.target.checked }))
|
|
8494
8834
|
}
|
|
8495
8835
|
),
|
|
8496
|
-
/* @__PURE__ */
|
|
8836
|
+
/* @__PURE__ */ jsx30("span", { className: "dd-check-row-text", children: t("allowExportPdf") })
|
|
8497
8837
|
] }),
|
|
8498
|
-
/* @__PURE__ */
|
|
8838
|
+
/* @__PURE__ */ jsx30(FieldHelp, { text: t("helpAllowExportPdf") })
|
|
8499
8839
|
] }),
|
|
8500
|
-
/* @__PURE__ */
|
|
8501
|
-
/* @__PURE__ */
|
|
8502
|
-
/* @__PURE__ */
|
|
8840
|
+
/* @__PURE__ */ jsxs27("div", { className: "dd-field dd-check-field", children: [
|
|
8841
|
+
/* @__PURE__ */ jsxs27("label", { className: "dd-check-row", htmlFor: "dd-export-json", children: [
|
|
8842
|
+
/* @__PURE__ */ jsx30(
|
|
8503
8843
|
"input",
|
|
8504
8844
|
{
|
|
8505
8845
|
id: "dd-export-json",
|
|
@@ -8508,13 +8848,13 @@ function DashboardSettingsPanel({
|
|
|
8508
8848
|
onChange: (e) => setDraft((d) => ({ ...d, allowJson: e.target.checked }))
|
|
8509
8849
|
}
|
|
8510
8850
|
),
|
|
8511
|
-
/* @__PURE__ */
|
|
8851
|
+
/* @__PURE__ */ jsx30("span", { className: "dd-check-row-text", children: t("allowExportJson") })
|
|
8512
8852
|
] }),
|
|
8513
|
-
/* @__PURE__ */
|
|
8853
|
+
/* @__PURE__ */ jsx30(FieldHelp, { text: t("helpAllowExportJson") })
|
|
8514
8854
|
] }),
|
|
8515
|
-
/* @__PURE__ */
|
|
8516
|
-
/* @__PURE__ */
|
|
8517
|
-
/* @__PURE__ */
|
|
8855
|
+
/* @__PURE__ */ jsxs27("div", { className: "dd-field dd-check-field", children: [
|
|
8856
|
+
/* @__PURE__ */ jsxs27("label", { className: "dd-check-row", htmlFor: "dd-export-email", children: [
|
|
8857
|
+
/* @__PURE__ */ jsx30(
|
|
8518
8858
|
"input",
|
|
8519
8859
|
{
|
|
8520
8860
|
id: "dd-export-email",
|
|
@@ -8523,15 +8863,15 @@ function DashboardSettingsPanel({
|
|
|
8523
8863
|
onChange: (e) => setDraft((d) => ({ ...d, allowEmail: e.target.checked }))
|
|
8524
8864
|
}
|
|
8525
8865
|
),
|
|
8526
|
-
/* @__PURE__ */
|
|
8866
|
+
/* @__PURE__ */ jsx30("span", { className: "dd-check-row-text", children: t("allowEmail") })
|
|
8527
8867
|
] }),
|
|
8528
|
-
/* @__PURE__ */
|
|
8868
|
+
/* @__PURE__ */ jsx30(FieldHelp, { text: t("helpAllowEmail") })
|
|
8529
8869
|
] }),
|
|
8530
|
-
draft.allowEmail && /* @__PURE__ */
|
|
8531
|
-
/* @__PURE__ */
|
|
8532
|
-
/* @__PURE__ */
|
|
8533
|
-
/* @__PURE__ */
|
|
8534
|
-
/* @__PURE__ */
|
|
8870
|
+
draft.allowEmail && /* @__PURE__ */ jsxs27("div", { className: "dd-email-options", children: [
|
|
8871
|
+
/* @__PURE__ */ jsx30("p", { className: "dd-hint dd-email-options-title", children: t("emailAttachmentOptions") }),
|
|
8872
|
+
/* @__PURE__ */ jsxs27("div", { className: "dd-field dd-check-field", children: [
|
|
8873
|
+
/* @__PURE__ */ jsxs27("label", { className: "dd-check-row", htmlFor: "dd-email-attach-pdf", children: [
|
|
8874
|
+
/* @__PURE__ */ jsx30(
|
|
8535
8875
|
"input",
|
|
8536
8876
|
{
|
|
8537
8877
|
id: "dd-email-attach-pdf",
|
|
@@ -8540,13 +8880,13 @@ function DashboardSettingsPanel({
|
|
|
8540
8880
|
onChange: (e) => setDraft((d) => ({ ...d, emailAttachPdf: e.target.checked }))
|
|
8541
8881
|
}
|
|
8542
8882
|
),
|
|
8543
|
-
/* @__PURE__ */
|
|
8883
|
+
/* @__PURE__ */ jsx30("span", { className: "dd-check-row-text", children: t("emailAttachPdf") })
|
|
8544
8884
|
] }),
|
|
8545
|
-
/* @__PURE__ */
|
|
8885
|
+
/* @__PURE__ */ jsx30(FieldHelp, { text: t("helpEmailAttachPdf") })
|
|
8546
8886
|
] }),
|
|
8547
|
-
/* @__PURE__ */
|
|
8548
|
-
/* @__PURE__ */
|
|
8549
|
-
/* @__PURE__ */
|
|
8887
|
+
/* @__PURE__ */ jsxs27("div", { className: "dd-field dd-check-field", children: [
|
|
8888
|
+
/* @__PURE__ */ jsxs27("label", { className: "dd-check-row", htmlFor: "dd-email-allow-extra", children: [
|
|
8889
|
+
/* @__PURE__ */ jsx30(
|
|
8550
8890
|
"input",
|
|
8551
8891
|
{
|
|
8552
8892
|
id: "dd-email-allow-extra",
|
|
@@ -8555,13 +8895,13 @@ function DashboardSettingsPanel({
|
|
|
8555
8895
|
onChange: (e) => setDraft((d) => ({ ...d, emailAllowExtra: e.target.checked }))
|
|
8556
8896
|
}
|
|
8557
8897
|
),
|
|
8558
|
-
/* @__PURE__ */
|
|
8898
|
+
/* @__PURE__ */ jsx30("span", { className: "dd-check-row-text", children: t("emailAllowExtraAttachments") })
|
|
8559
8899
|
] }),
|
|
8560
|
-
/* @__PURE__ */
|
|
8900
|
+
/* @__PURE__ */ jsx30(FieldHelp, { text: t("helpEmailAllowExtraAttachments") })
|
|
8561
8901
|
] }),
|
|
8562
|
-
draft.emailAllowExtra && /* @__PURE__ */
|
|
8563
|
-
/* @__PURE__ */
|
|
8564
|
-
/* @__PURE__ */
|
|
8902
|
+
draft.emailAllowExtra && /* @__PURE__ */ jsxs27("div", { className: "dd-field", children: [
|
|
8903
|
+
/* @__PURE__ */ jsx30(FieldLabel, { htmlFor: "dd-email-max-extra", help: t("helpEmailMaxExtraAttachments"), children: t("emailMaxExtraAttachments") }),
|
|
8904
|
+
/* @__PURE__ */ jsx30(
|
|
8565
8905
|
"input",
|
|
8566
8906
|
{
|
|
8567
8907
|
id: "dd-email-max-extra",
|
|
@@ -8582,13 +8922,13 @@ function DashboardSettingsPanel({
|
|
|
8582
8922
|
] })
|
|
8583
8923
|
] })
|
|
8584
8924
|
] }),
|
|
8585
|
-
/* @__PURE__ */
|
|
8586
|
-
/* @__PURE__ */
|
|
8587
|
-
/* @__PURE__ */
|
|
8588
|
-
/* @__PURE__ */
|
|
8589
|
-
/* @__PURE__ */
|
|
8925
|
+
/* @__PURE__ */ jsxs27("div", { className: "dd-theme-section", children: [
|
|
8926
|
+
/* @__PURE__ */ jsxs27("div", { className: "dd-theme-section-head", children: [
|
|
8927
|
+
/* @__PURE__ */ jsxs27("div", { children: [
|
|
8928
|
+
/* @__PURE__ */ jsx30("h3", { className: "dd-theme-title", children: t("themeColors") }),
|
|
8929
|
+
/* @__PURE__ */ jsx30("p", { className: "dd-hint dd-theme-hint", children: t("helpThemeColors") })
|
|
8590
8930
|
] }),
|
|
8591
|
-
/* @__PURE__ */
|
|
8931
|
+
/* @__PURE__ */ jsxs27(
|
|
8592
8932
|
"button",
|
|
8593
8933
|
{
|
|
8594
8934
|
type: "button",
|
|
@@ -8596,15 +8936,15 @@ function DashboardSettingsPanel({
|
|
|
8596
8936
|
onClick: resetTheme,
|
|
8597
8937
|
title: t("resetTheme"),
|
|
8598
8938
|
children: [
|
|
8599
|
-
/* @__PURE__ */
|
|
8939
|
+
/* @__PURE__ */ jsx30(RotateCcw3, { size: ICON_SIZE }),
|
|
8600
8940
|
t("resetTheme")
|
|
8601
8941
|
]
|
|
8602
8942
|
}
|
|
8603
8943
|
)
|
|
8604
8944
|
] }),
|
|
8605
|
-
/* @__PURE__ */
|
|
8606
|
-
/* @__PURE__ */
|
|
8607
|
-
/* @__PURE__ */
|
|
8945
|
+
/* @__PURE__ */ jsxs27("div", { className: "dd-field", children: [
|
|
8946
|
+
/* @__PURE__ */ jsx30(FieldLabel, { htmlFor: "dd-theme-preset", help: t("helpThemePreset"), children: t("themePreset") }),
|
|
8947
|
+
/* @__PURE__ */ jsxs27(
|
|
8608
8948
|
"select",
|
|
8609
8949
|
{
|
|
8610
8950
|
id: "dd-theme-preset",
|
|
@@ -8615,19 +8955,19 @@ function DashboardSettingsPanel({
|
|
|
8615
8955
|
applyPreset(e.target.value);
|
|
8616
8956
|
},
|
|
8617
8957
|
children: [
|
|
8618
|
-
/* @__PURE__ */
|
|
8619
|
-
/* @__PURE__ */
|
|
8620
|
-
/* @__PURE__ */
|
|
8621
|
-
/* @__PURE__ */
|
|
8622
|
-
/* @__PURE__ */
|
|
8958
|
+
/* @__PURE__ */ jsx30("option", { value: "default", children: t("themePresetDefault") }),
|
|
8959
|
+
/* @__PURE__ */ jsx30("option", { value: "ocean", children: t("themePresetOcean") }),
|
|
8960
|
+
/* @__PURE__ */ jsx30("option", { value: "sunset", children: t("themePresetSunset") }),
|
|
8961
|
+
/* @__PURE__ */ jsx30("option", { value: "slate", children: t("themePresetSlate") }),
|
|
8962
|
+
/* @__PURE__ */ jsx30("option", { value: "custom", disabled: presetId !== "custom", children: t("themePresetCustom") })
|
|
8623
8963
|
]
|
|
8624
8964
|
}
|
|
8625
8965
|
)
|
|
8626
8966
|
] }),
|
|
8627
|
-
/* @__PURE__ */
|
|
8628
|
-
/* @__PURE__ */
|
|
8629
|
-
/* @__PURE__ */
|
|
8630
|
-
/* @__PURE__ */
|
|
8967
|
+
/* @__PURE__ */ jsxs27("div", { className: "dd-field", children: [
|
|
8968
|
+
/* @__PURE__ */ jsx30(FieldLabel, { htmlFor: "dd-theme-accent", help: t("helpThemeAccent"), children: t("themeAccent") }),
|
|
8969
|
+
/* @__PURE__ */ jsxs27("div", { className: "dd-color-row", children: [
|
|
8970
|
+
/* @__PURE__ */ jsx30(
|
|
8631
8971
|
"input",
|
|
8632
8972
|
{
|
|
8633
8973
|
id: "dd-theme-accent",
|
|
@@ -8638,7 +8978,7 @@ function DashboardSettingsPanel({
|
|
|
8638
8978
|
"aria-label": t("themeAccent")
|
|
8639
8979
|
}
|
|
8640
8980
|
),
|
|
8641
|
-
/* @__PURE__ */
|
|
8981
|
+
/* @__PURE__ */ jsx30(
|
|
8642
8982
|
"input",
|
|
8643
8983
|
{
|
|
8644
8984
|
className: "dd-input dd-color-hex",
|
|
@@ -8649,10 +8989,10 @@ function DashboardSettingsPanel({
|
|
|
8649
8989
|
)
|
|
8650
8990
|
] })
|
|
8651
8991
|
] }),
|
|
8652
|
-
/* @__PURE__ */
|
|
8653
|
-
/* @__PURE__ */
|
|
8654
|
-
/* @__PURE__ */
|
|
8655
|
-
/* @__PURE__ */
|
|
8992
|
+
/* @__PURE__ */ jsxs27("div", { className: "dd-field", children: [
|
|
8993
|
+
/* @__PURE__ */ jsx30(FieldLabel, { help: t("helpThemeChartColors"), children: t("themeChartColors") }),
|
|
8994
|
+
/* @__PURE__ */ jsx30("div", { className: "dd-chart-color-list", children: draft.chartColors.map((color, index) => /* @__PURE__ */ jsxs27("div", { className: "dd-color-row", children: [
|
|
8995
|
+
/* @__PURE__ */ jsx30(
|
|
8656
8996
|
"input",
|
|
8657
8997
|
{
|
|
8658
8998
|
type: "color",
|
|
@@ -8669,7 +9009,7 @@ function DashboardSettingsPanel({
|
|
|
8669
9009
|
"aria-label": t("themeChartColorN", { n: index + 1 })
|
|
8670
9010
|
}
|
|
8671
9011
|
),
|
|
8672
|
-
/* @__PURE__ */
|
|
9012
|
+
/* @__PURE__ */ jsx30(
|
|
8673
9013
|
"input",
|
|
8674
9014
|
{
|
|
8675
9015
|
className: "dd-input dd-color-hex",
|
|
@@ -8682,7 +9022,7 @@ function DashboardSettingsPanel({
|
|
|
8682
9022
|
spellCheck: false
|
|
8683
9023
|
}
|
|
8684
9024
|
),
|
|
8685
|
-
/* @__PURE__ */
|
|
9025
|
+
/* @__PURE__ */ jsx30(
|
|
8686
9026
|
"button",
|
|
8687
9027
|
{
|
|
8688
9028
|
type: "button",
|
|
@@ -8694,11 +9034,11 @@ function DashboardSettingsPanel({
|
|
|
8694
9034
|
...d,
|
|
8695
9035
|
chartColors: d.chartColors.filter((_, i) => i !== index)
|
|
8696
9036
|
})),
|
|
8697
|
-
children: /* @__PURE__ */
|
|
9037
|
+
children: /* @__PURE__ */ jsx30(Trash24, { size: ICON_SIZE })
|
|
8698
9038
|
}
|
|
8699
9039
|
)
|
|
8700
9040
|
] }, index)) }),
|
|
8701
|
-
/* @__PURE__ */
|
|
9041
|
+
/* @__PURE__ */ jsxs27(
|
|
8702
9042
|
"button",
|
|
8703
9043
|
{
|
|
8704
9044
|
type: "button",
|
|
@@ -8711,12 +9051,12 @@ function DashboardSettingsPanel({
|
|
|
8711
9051
|
]
|
|
8712
9052
|
})),
|
|
8713
9053
|
children: [
|
|
8714
|
-
/* @__PURE__ */
|
|
9054
|
+
/* @__PURE__ */ jsx30(Plus5, { size: ICON_SIZE }),
|
|
8715
9055
|
t("addColor")
|
|
8716
9056
|
]
|
|
8717
9057
|
}
|
|
8718
9058
|
),
|
|
8719
|
-
/* @__PURE__ */
|
|
9059
|
+
/* @__PURE__ */ jsx30("div", { className: "dd-theme-preview", "aria-hidden": true, children: draft.chartColors.map((c, i) => /* @__PURE__ */ jsx30(
|
|
8720
9060
|
"span",
|
|
8721
9061
|
{
|
|
8722
9062
|
className: "dd-theme-preview-chip",
|
|
@@ -8727,9 +9067,9 @@ function DashboardSettingsPanel({
|
|
|
8727
9067
|
] })
|
|
8728
9068
|
] })
|
|
8729
9069
|
] }),
|
|
8730
|
-
/* @__PURE__ */
|
|
8731
|
-
/* @__PURE__ */
|
|
8732
|
-
/* @__PURE__ */
|
|
9070
|
+
/* @__PURE__ */ jsxs27("footer", { className: "dd-dialog-footer dd-dialog-footer-end", children: [
|
|
9071
|
+
/* @__PURE__ */ jsx30("button", { type: "button", className: "dd-btn", onClick: onClose, children: t("cancel") }),
|
|
9072
|
+
/* @__PURE__ */ jsx30("button", { type: "button", className: "dd-btn dd-btn-primary", onClick: apply, children: t("apply") })
|
|
8733
9073
|
] })
|
|
8734
9074
|
]
|
|
8735
9075
|
}
|
|
@@ -8737,7 +9077,7 @@ function DashboardSettingsPanel({
|
|
|
8737
9077
|
}
|
|
8738
9078
|
|
|
8739
9079
|
// src/designer/useDashboardHistory.ts
|
|
8740
|
-
import { useCallback as useCallback2, useEffect as useEffect20, useRef as
|
|
9080
|
+
import { useCallback as useCallback2, useEffect as useEffect20, useRef as useRef14, useState as useState21 } from "react";
|
|
8741
9081
|
var MAX_HISTORY = 50;
|
|
8742
9082
|
function cloneDashboard(dashboard) {
|
|
8743
9083
|
return structuredClone(dashboard);
|
|
@@ -8750,13 +9090,13 @@ function useDashboardHistory(initial, onChange, readOnly = false) {
|
|
|
8750
9090
|
const [past, setPast] = useState21([]);
|
|
8751
9091
|
const [future, setFuture] = useState21([]);
|
|
8752
9092
|
const [baseline, setBaseline] = useState21(() => cloneDashboard(initial));
|
|
8753
|
-
const presentRef =
|
|
8754
|
-
const pastRef =
|
|
8755
|
-
const futureRef =
|
|
8756
|
-
const baselineRef =
|
|
8757
|
-
const skipNextExternalSync =
|
|
8758
|
-
const layoutBeforeRef =
|
|
8759
|
-
const suppressLayoutWriteRef =
|
|
9093
|
+
const presentRef = useRef14(dashboard);
|
|
9094
|
+
const pastRef = useRef14(past);
|
|
9095
|
+
const futureRef = useRef14(future);
|
|
9096
|
+
const baselineRef = useRef14(baseline);
|
|
9097
|
+
const skipNextExternalSync = useRef14(false);
|
|
9098
|
+
const layoutBeforeRef = useRef14(null);
|
|
9099
|
+
const suppressLayoutWriteRef = useRef14(false);
|
|
8760
9100
|
presentRef.current = dashboard;
|
|
8761
9101
|
pastRef.current = past;
|
|
8762
9102
|
futureRef.current = future;
|
|
@@ -8944,7 +9284,7 @@ function useDashboardHistory(initial, onChange, readOnly = false) {
|
|
|
8944
9284
|
}
|
|
8945
9285
|
|
|
8946
9286
|
// src/designer/DashboardDesigner.tsx
|
|
8947
|
-
import { Fragment as Fragment12, jsx as
|
|
9287
|
+
import { Fragment as Fragment12, jsx as jsx31, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
8948
9288
|
function listboxFilterField(widget) {
|
|
8949
9289
|
const override = widget.chartOptions.filterField;
|
|
8950
9290
|
if (typeof override === "string" && override.trim()) return override.trim();
|
|
@@ -8986,7 +9326,7 @@ function gridResizeHandle(axis, ref) {
|
|
|
8986
9326
|
const stopBubble = (e) => {
|
|
8987
9327
|
e.stopPropagation();
|
|
8988
9328
|
};
|
|
8989
|
-
return /* @__PURE__ */
|
|
9329
|
+
return /* @__PURE__ */ jsx31(
|
|
8990
9330
|
"span",
|
|
8991
9331
|
{
|
|
8992
9332
|
ref,
|
|
@@ -8995,7 +9335,7 @@ function gridResizeHandle(axis, ref) {
|
|
|
8995
9335
|
onMouseDown: stopBubble,
|
|
8996
9336
|
onPointerDown: stopBubble,
|
|
8997
9337
|
onTouchStart: stopBubble,
|
|
8998
|
-
children: /* @__PURE__ */
|
|
9338
|
+
children: /* @__PURE__ */ jsx31(Scaling, { size: 13, strokeWidth: 2.25, className: "dd-grid-resize-handle-icon", "aria-hidden": true })
|
|
8999
9339
|
}
|
|
9000
9340
|
);
|
|
9001
9341
|
}
|
|
@@ -9023,7 +9363,7 @@ function WidgetCard({
|
|
|
9023
9363
|
onListboxSelectionChange,
|
|
9024
9364
|
chartDataRowActions
|
|
9025
9365
|
}) {
|
|
9026
|
-
const { t } =
|
|
9366
|
+
const { t } = useTranslation21();
|
|
9027
9367
|
const configuredFilters = widget.chartOptions.widgetFilters ?? [];
|
|
9028
9368
|
const [filterValues, setFilterValues] = useState22(null);
|
|
9029
9369
|
const filterSignature = JSON.stringify(configuredFilters);
|
|
@@ -9045,31 +9385,31 @@ function WidgetCard({
|
|
|
9045
9385
|
const stopDrag = (e) => {
|
|
9046
9386
|
e.stopPropagation();
|
|
9047
9387
|
};
|
|
9048
|
-
return /* @__PURE__ */
|
|
9388
|
+
return /* @__PURE__ */ jsxs28(
|
|
9049
9389
|
"div",
|
|
9050
9390
|
{
|
|
9051
9391
|
className: `dd-widget ${selected ? "selected" : ""} ${showHeader ? "" : "dd-widget-headerless"}`,
|
|
9052
9392
|
onClick: onSelect,
|
|
9053
9393
|
role: "presentation",
|
|
9054
9394
|
children: [
|
|
9055
|
-
loading && data && /* @__PURE__ */
|
|
9056
|
-
/* @__PURE__ */
|
|
9395
|
+
loading && data && /* @__PURE__ */ jsxs28("div", { className: "dd-loading-status", role: "status", children: [
|
|
9396
|
+
/* @__PURE__ */ jsx31("span", { className: "dd-loading-spinner", "aria-hidden": "true" }),
|
|
9057
9397
|
"Refreshing data\u2026"
|
|
9058
9398
|
] }),
|
|
9059
|
-
popup && data && readOnly && /* @__PURE__ */
|
|
9060
|
-
configuredFilters.length > 0 && /* @__PURE__ */
|
|
9061
|
-
showHeader && /* @__PURE__ */
|
|
9062
|
-
/* @__PURE__ */
|
|
9063
|
-
!readOnly && /* @__PURE__ */
|
|
9064
|
-
/* @__PURE__ */
|
|
9399
|
+
popup && data && readOnly && /* @__PURE__ */ jsx31(ChartDataPopup, { data: chartPopupData(data, popup.dimension, popup.category, widget.chartOptions.dataPopupColumns), widget, dashboardId, category: popup.category, actions: chartDataRowActions, onClose: closePopup }),
|
|
9400
|
+
configuredFilters.length > 0 && /* @__PURE__ */ jsx31("div", { className: "dd-widget-filters", onMouseDown: (e) => e.stopPropagation(), onClick: (e) => e.stopPropagation(), children: /* @__PURE__ */ jsx31(FilterBar, { clearable: true, suggestionRows: suggestionData?.rows, filters: widgetFilters, onChange: setFilterValues, editable: false, hideHeader: true }) }),
|
|
9401
|
+
showHeader && /* @__PURE__ */ jsxs28("div", { className: "dd-widget-header", children: [
|
|
9402
|
+
/* @__PURE__ */ jsxs28("div", { className: readOnly ? "dd-widget-title-wrap" : "dd-widget-drag", children: [
|
|
9403
|
+
!readOnly && /* @__PURE__ */ jsx31("span", { className: "dd-widget-drag-grip", "aria-hidden": true }),
|
|
9404
|
+
/* @__PURE__ */ jsx31("span", { className: "dd-widget-title", children: widget.title })
|
|
9065
9405
|
] }),
|
|
9066
|
-
(showTypeBadge || !readOnly) && /* @__PURE__ */
|
|
9067
|
-
showTypeBadge && /* @__PURE__ */
|
|
9068
|
-
/* @__PURE__ */
|
|
9406
|
+
(showTypeBadge || !readOnly) && /* @__PURE__ */ jsxs28("div", { className: "dd-widget-header-actions", children: [
|
|
9407
|
+
showTypeBadge && /* @__PURE__ */ jsxs28("span", { className: "dd-badge", title: widget.type, children: [
|
|
9408
|
+
/* @__PURE__ */ jsx31(TypeIcon, { size: 12, strokeWidth: 2.25, "aria-hidden": true }),
|
|
9069
9409
|
widget.type
|
|
9070
9410
|
] }),
|
|
9071
|
-
!readOnly && /* @__PURE__ */
|
|
9072
|
-
/* @__PURE__ */
|
|
9411
|
+
!readOnly && /* @__PURE__ */ jsxs28(Fragment12, { children: [
|
|
9412
|
+
/* @__PURE__ */ jsx31(
|
|
9073
9413
|
"button",
|
|
9074
9414
|
{
|
|
9075
9415
|
type: "button",
|
|
@@ -9083,10 +9423,10 @@ function WidgetCard({
|
|
|
9083
9423
|
e.stopPropagation();
|
|
9084
9424
|
onEdit();
|
|
9085
9425
|
},
|
|
9086
|
-
children: /* @__PURE__ */
|
|
9426
|
+
children: /* @__PURE__ */ jsx31(Pencil, { size: ICON_SIZE })
|
|
9087
9427
|
}
|
|
9088
9428
|
),
|
|
9089
|
-
/* @__PURE__ */
|
|
9429
|
+
/* @__PURE__ */ jsx31(
|
|
9090
9430
|
"button",
|
|
9091
9431
|
{
|
|
9092
9432
|
type: "button",
|
|
@@ -9100,14 +9440,14 @@ function WidgetCard({
|
|
|
9100
9440
|
e.stopPropagation();
|
|
9101
9441
|
onDelete();
|
|
9102
9442
|
},
|
|
9103
|
-
children: /* @__PURE__ */
|
|
9443
|
+
children: /* @__PURE__ */ jsx31(Trash25, { size: ICON_SIZE })
|
|
9104
9444
|
}
|
|
9105
9445
|
)
|
|
9106
9446
|
] })
|
|
9107
9447
|
] })
|
|
9108
9448
|
] }),
|
|
9109
|
-
!showHeader && !readOnly && /* @__PURE__ */
|
|
9110
|
-
/* @__PURE__ */
|
|
9449
|
+
!showHeader && !readOnly && /* @__PURE__ */ jsxs28("div", { className: "dd-widget-floating-actions", children: [
|
|
9450
|
+
/* @__PURE__ */ jsx31(
|
|
9111
9451
|
"button",
|
|
9112
9452
|
{
|
|
9113
9453
|
type: "button",
|
|
@@ -9121,10 +9461,10 @@ function WidgetCard({
|
|
|
9121
9461
|
e.stopPropagation();
|
|
9122
9462
|
onEdit();
|
|
9123
9463
|
},
|
|
9124
|
-
children: /* @__PURE__ */
|
|
9464
|
+
children: /* @__PURE__ */ jsx31(Pencil, { size: ICON_SIZE })
|
|
9125
9465
|
}
|
|
9126
9466
|
),
|
|
9127
|
-
/* @__PURE__ */
|
|
9467
|
+
/* @__PURE__ */ jsx31(
|
|
9128
9468
|
"button",
|
|
9129
9469
|
{
|
|
9130
9470
|
type: "button",
|
|
@@ -9138,11 +9478,11 @@ function WidgetCard({
|
|
|
9138
9478
|
e.stopPropagation();
|
|
9139
9479
|
onDelete();
|
|
9140
9480
|
},
|
|
9141
|
-
children: /* @__PURE__ */
|
|
9481
|
+
children: /* @__PURE__ */ jsx31(Trash25, { size: ICON_SIZE })
|
|
9142
9482
|
}
|
|
9143
9483
|
)
|
|
9144
9484
|
] }),
|
|
9145
|
-
/* @__PURE__ */
|
|
9485
|
+
/* @__PURE__ */ jsxs28(
|
|
9146
9486
|
"div",
|
|
9147
9487
|
{
|
|
9148
9488
|
className: `dd-widget-body ${!showHeader && !readOnly ? "dd-widget-drag" : ""}`,
|
|
@@ -9152,8 +9492,8 @@ function WidgetCard({
|
|
|
9152
9492
|
onEdit();
|
|
9153
9493
|
},
|
|
9154
9494
|
children: [
|
|
9155
|
-
error && /* @__PURE__ */
|
|
9156
|
-
!error && /* @__PURE__ */
|
|
9495
|
+
error && /* @__PURE__ */ jsx31("div", { className: "dd-error", children: error }),
|
|
9496
|
+
!error && /* @__PURE__ */ jsx31(
|
|
9157
9497
|
ChartRenderer,
|
|
9158
9498
|
{
|
|
9159
9499
|
widget,
|
|
@@ -9196,7 +9536,7 @@ function DashboardDesigner({
|
|
|
9196
9536
|
toolbarVisibility = {}
|
|
9197
9537
|
}) {
|
|
9198
9538
|
ensureI18n(locale);
|
|
9199
|
-
const { t, i18n: i18n2 } =
|
|
9539
|
+
const { t, i18n: i18n2 } = useTranslation21();
|
|
9200
9540
|
const api = useMemo12(() => new DashboardApiClient(apiBaseUrl, auth), [apiBaseUrl, auth]);
|
|
9201
9541
|
const seed = useMemo12(() => initial ?? createEmptyDashboard(), [initial]);
|
|
9202
9542
|
const {
|
|
@@ -9221,8 +9561,8 @@ function DashboardDesigner({
|
|
|
9221
9561
|
const [editingTitle, setEditingTitle] = useState22(false);
|
|
9222
9562
|
const [historyOpen, setHistoryOpen] = useState22(false);
|
|
9223
9563
|
const [filtersPanel, setFiltersPanel] = useState22(DEFAULT_FILTERS_PANEL);
|
|
9224
|
-
const titleInputRef =
|
|
9225
|
-
const titleFocusSnapshot =
|
|
9564
|
+
const titleInputRef = React25.useRef(null);
|
|
9565
|
+
const titleFocusSnapshot = React25.useRef(null);
|
|
9226
9566
|
useEffect21(() => {
|
|
9227
9567
|
if (!editingTitle) return;
|
|
9228
9568
|
const el = titleInputRef.current;
|
|
@@ -9282,8 +9622,8 @@ function DashboardDesigner({
|
|
|
9282
9622
|
const [drillError, setDrillError] = useState22(null);
|
|
9283
9623
|
const [listboxSelections, setListboxSelections] = useState22({});
|
|
9284
9624
|
const effectiveReadOnly = readOnly || drillTrail.length > 0;
|
|
9285
|
-
const toolbarRefreshWaiters =
|
|
9286
|
-
const currentDashboardId =
|
|
9625
|
+
const toolbarRefreshWaiters = React25.useRef([]);
|
|
9626
|
+
const currentDashboardId = React25.useRef(dashboard.id);
|
|
9287
9627
|
currentDashboardId.current = dashboard.id;
|
|
9288
9628
|
const refreshFromToolbar = useCallback3(() => {
|
|
9289
9629
|
if (currentDashboardId.current !== dashboard.id || !queryWidgets.length) return Promise.resolve();
|
|
@@ -9539,13 +9879,17 @@ function DashboardDesigner({
|
|
|
9539
9879
|
};
|
|
9540
9880
|
const handleDrillDown = async (widget, payload) => {
|
|
9541
9881
|
const clickUrl = typeof payload.clickUrl === "string" && payload.clickUrl.trim() ? payload.clickUrl.trim() : void 0;
|
|
9882
|
+
if (typeof payload.linkError === "string") {
|
|
9883
|
+
setDrillError(payload.linkError);
|
|
9884
|
+
return;
|
|
9885
|
+
}
|
|
9542
9886
|
if (clickUrl) {
|
|
9543
|
-
|
|
9544
|
-
|
|
9545
|
-
|
|
9546
|
-
} else {
|
|
9547
|
-
window.location.assign(clickUrl);
|
|
9887
|
+
if (!isSafeHyperlink(clickUrl)) {
|
|
9888
|
+
setDrillError(t("hyperlinkBlocked"));
|
|
9889
|
+
return;
|
|
9548
9890
|
}
|
|
9891
|
+
setDrillError(null);
|
|
9892
|
+
openHyperlink2(clickUrl, payload.openInNewTab !== false);
|
|
9549
9893
|
return;
|
|
9550
9894
|
}
|
|
9551
9895
|
const hasLabelTarget = typeof payload.targetDashboardId === "string" && payload.targetDashboardId.trim();
|
|
@@ -9625,22 +9969,22 @@ function DashboardDesigner({
|
|
|
9625
9969
|
}
|
|
9626
9970
|
setRefreshKey((k) => k + 1);
|
|
9627
9971
|
};
|
|
9628
|
-
return /* @__PURE__ */
|
|
9972
|
+
return /* @__PURE__ */ jsx31(
|
|
9629
9973
|
"div",
|
|
9630
9974
|
{
|
|
9631
9975
|
className: `dd-root ${effectiveReadOnly ? "dd-readonly" : ""} ${filtersPanel.open || filtersPanel.collapsed ? "dd-has-filters-side" : ""} ${filtersPanel.collapsed ? "dd-filters-side-is-collapsed" : ""} ${filtersPanel.pinned ? "dd-filters-side-is-pinned" : ""}`,
|
|
9632
9976
|
dir: textDir,
|
|
9633
9977
|
style: themeStyle,
|
|
9634
|
-
children: /* @__PURE__ */
|
|
9635
|
-
variableContext.error && /* @__PURE__ */
|
|
9636
|
-
!variableContext.ready && !variableContext.error && /* @__PURE__ */
|
|
9637
|
-
printOptionsOpen && /* @__PURE__ */
|
|
9978
|
+
children: /* @__PURE__ */ jsxs28(VariableContext.Provider, { value: variableContext, children: [
|
|
9979
|
+
variableContext.error && /* @__PURE__ */ jsx31("div", { className: "dd-error", role: "alert", children: variableContext.error }),
|
|
9980
|
+
!variableContext.ready && !variableContext.error && /* @__PURE__ */ jsx31("div", { role: "status", className: "dd-hint", children: "Loading variables\u2026" }),
|
|
9981
|
+
printOptionsOpen && /* @__PURE__ */ jsx31(PrintOptionsDialog, { defaults: { orientation: dashboard.printSettings?.orientation ?? "landscape", layout: dashboard.printSettings?.layout ?? "designed" }, header: headerDefaults, onClose: () => setPrintOptionsOpen(false), onPrint: (options) => {
|
|
9638
9982
|
setPrintOptionsOpen(false);
|
|
9639
9983
|
printDashboard(document.getElementById("dd-canvas"), dashboard.title, options);
|
|
9640
9984
|
} }),
|
|
9641
|
-
!hideToolbar && /* @__PURE__ */
|
|
9642
|
-
/* @__PURE__ */
|
|
9643
|
-
editingTitle && !effectiveReadOnly ? /* @__PURE__ */
|
|
9985
|
+
!hideToolbar && /* @__PURE__ */ jsxs28("header", { className: "dd-toolbar", children: [
|
|
9986
|
+
/* @__PURE__ */ jsxs28("div", { className: "dd-toolbar-left", children: [
|
|
9987
|
+
editingTitle && !effectiveReadOnly ? /* @__PURE__ */ jsx31(
|
|
9644
9988
|
"input",
|
|
9645
9989
|
{
|
|
9646
9990
|
ref: titleInputRef,
|
|
@@ -9670,7 +10014,7 @@ function DashboardDesigner({
|
|
|
9670
10014
|
}
|
|
9671
10015
|
}
|
|
9672
10016
|
}
|
|
9673
|
-
) : /* @__PURE__ */
|
|
10017
|
+
) : /* @__PURE__ */ jsx31(
|
|
9674
10018
|
"button",
|
|
9675
10019
|
{
|
|
9676
10020
|
type: "button",
|
|
@@ -9684,20 +10028,20 @@ function DashboardDesigner({
|
|
|
9684
10028
|
children: dashboard.title || t("title")
|
|
9685
10029
|
}
|
|
9686
10030
|
),
|
|
9687
|
-
drillTrail.length > 0 && /* @__PURE__ */
|
|
10031
|
+
drillTrail.length > 0 && /* @__PURE__ */ jsxs28("span", { className: "dd-drill-crumb dd-muted", children: [
|
|
9688
10032
|
drillTrail.map((f) => f.title).join(" \u203A "),
|
|
9689
10033
|
" \u203A ",
|
|
9690
10034
|
dashboard.title
|
|
9691
10035
|
] })
|
|
9692
10036
|
] }),
|
|
9693
|
-
/* @__PURE__ */
|
|
9694
|
-
/* @__PURE__ */
|
|
9695
|
-
drillError && /* @__PURE__ */
|
|
9696
|
-
toolbarVisibility.drillBack !== false && drillTrail.length > 0 && /* @__PURE__ */
|
|
9697
|
-
/* @__PURE__ */
|
|
10037
|
+
/* @__PURE__ */ jsxs28("div", { className: "dd-toolbar-right", children: [
|
|
10038
|
+
/* @__PURE__ */ jsx31(ToolbarButtons, { buttons: toolbarButtons, context: { dashboard, dashboardId: dashboard.id, mode: effectiveReadOnly ? "view" : "edit", variables: variableContext.values, refresh: refreshFromToolbar } }),
|
|
10039
|
+
drillError && /* @__PURE__ */ jsx31("span", { className: "dd-error dd-inline-error", children: drillError }),
|
|
10040
|
+
toolbarVisibility.drillBack !== false && drillTrail.length > 0 && /* @__PURE__ */ jsxs28("button", { type: "button", className: "dd-btn", onClick: handleDrillBack, children: [
|
|
10041
|
+
/* @__PURE__ */ jsx31(ArrowUpLeft, { size: ICON_SIZE }),
|
|
9698
10042
|
t("drillBack")
|
|
9699
10043
|
] }),
|
|
9700
|
-
toolbarVisibility.filters !== false && /* @__PURE__ */
|
|
10044
|
+
toolbarVisibility.filters !== false && /* @__PURE__ */ jsx31(
|
|
9701
10045
|
GlobalFiltersPopover,
|
|
9702
10046
|
{
|
|
9703
10047
|
filters: dashboard.globalFilters,
|
|
@@ -9707,7 +10051,7 @@ function DashboardDesigner({
|
|
|
9707
10051
|
onPanelChange: setFiltersPanel
|
|
9708
10052
|
}
|
|
9709
10053
|
),
|
|
9710
|
-
toolbarVisibility.refresh !== false && /* @__PURE__ */
|
|
10054
|
+
toolbarVisibility.refresh !== false && /* @__PURE__ */ jsx31(
|
|
9711
10055
|
"button",
|
|
9712
10056
|
{
|
|
9713
10057
|
type: "button",
|
|
@@ -9716,21 +10060,21 @@ function DashboardDesigner({
|
|
|
9716
10060
|
"aria-label": t("refreshDashboard"),
|
|
9717
10061
|
disabled: refreshing || !variableContext.ready || queryWidgets.length === 0,
|
|
9718
10062
|
onClick: () => setManualRefreshKey((key) => key + 1),
|
|
9719
|
-
children: /* @__PURE__ */
|
|
10063
|
+
children: /* @__PURE__ */ jsx31(RefreshCw2, { size: ICON_SIZE })
|
|
9720
10064
|
}
|
|
9721
10065
|
),
|
|
9722
|
-
toolbarVisibility.lastRefresh !== false && /* @__PURE__ */
|
|
10066
|
+
toolbarVisibility.lastRefresh !== false && /* @__PURE__ */ jsxs28("span", { className: "dd-hint", role: "status", title: t("lastRefreshHint"), children: [
|
|
9723
10067
|
refreshing ? t("refreshingDashboard") : refreshFailed ? t("dashboardRefreshFailed") : "",
|
|
9724
|
-
lastRefresh?.dashboardId === dashboard.id && /* @__PURE__ */
|
|
10068
|
+
lastRefresh?.dashboardId === dashboard.id && /* @__PURE__ */ jsxs28(Fragment12, { children: [
|
|
9725
10069
|
" ",
|
|
9726
10070
|
t("lastRefresh"),
|
|
9727
10071
|
": ",
|
|
9728
|
-
/* @__PURE__ */
|
|
10072
|
+
/* @__PURE__ */ jsx31("time", { dateTime: lastRefresh.value, children: new Date(lastRefresh.value).toLocaleString(effectiveLocale, { timeZone: dashboard.timeZone }) })
|
|
9729
10073
|
] })
|
|
9730
10074
|
] }),
|
|
9731
|
-
!effectiveReadOnly && toolbarVisibility.variables !== false && /* @__PURE__ */
|
|
9732
|
-
(exportOpts.print || exportOpts.pdf || exportOpts.json || exportOpts.email) && /* @__PURE__ */
|
|
9733
|
-
toolbarVisibility.print !== false && exportOpts.print && /* @__PURE__ */
|
|
10075
|
+
!effectiveReadOnly && toolbarVisibility.variables !== false && /* @__PURE__ */ jsx31("button", { type: "button", className: "dd-btn", onClick: () => setVariablesOpen(true), children: "Variables" }),
|
|
10076
|
+
(exportOpts.print || exportOpts.pdf || exportOpts.json || exportOpts.email) && /* @__PURE__ */ jsxs28("div", { className: "dd-toolbar-export", role: "group", "aria-label": t("exportOptions"), children: [
|
|
10077
|
+
toolbarVisibility.print !== false && exportOpts.print && /* @__PURE__ */ jsxs28(
|
|
9734
10078
|
"button",
|
|
9735
10079
|
{
|
|
9736
10080
|
type: "button",
|
|
@@ -9739,12 +10083,12 @@ function DashboardDesigner({
|
|
|
9739
10083
|
"aria-label": t("printDashboard"),
|
|
9740
10084
|
onClick: handlePrint,
|
|
9741
10085
|
children: [
|
|
9742
|
-
/* @__PURE__ */
|
|
10086
|
+
/* @__PURE__ */ jsx31(Printer, { size: ICON_SIZE }),
|
|
9743
10087
|
t("print")
|
|
9744
10088
|
]
|
|
9745
10089
|
}
|
|
9746
10090
|
),
|
|
9747
|
-
toolbarVisibility.pdf !== false && exportOpts.pdf && /* @__PURE__ */
|
|
10091
|
+
toolbarVisibility.pdf !== false && exportOpts.pdf && /* @__PURE__ */ jsxs28(
|
|
9748
10092
|
"button",
|
|
9749
10093
|
{
|
|
9750
10094
|
type: "button",
|
|
@@ -9753,12 +10097,12 @@ function DashboardDesigner({
|
|
|
9753
10097
|
"aria-label": t("exportPdf"),
|
|
9754
10098
|
onClick: handleExportPdf,
|
|
9755
10099
|
children: [
|
|
9756
|
-
/* @__PURE__ */
|
|
10100
|
+
/* @__PURE__ */ jsx31(FileDown, { size: ICON_SIZE }),
|
|
9757
10101
|
t("exportPdf")
|
|
9758
10102
|
]
|
|
9759
10103
|
}
|
|
9760
10104
|
),
|
|
9761
|
-
toolbarVisibility.json !== false && exportOpts.json && /* @__PURE__ */
|
|
10105
|
+
toolbarVisibility.json !== false && exportOpts.json && /* @__PURE__ */ jsxs28(
|
|
9762
10106
|
"button",
|
|
9763
10107
|
{
|
|
9764
10108
|
type: "button",
|
|
@@ -9767,12 +10111,12 @@ function DashboardDesigner({
|
|
|
9767
10111
|
"aria-label": t("exportDashboardJson"),
|
|
9768
10112
|
onClick: handleExportJson,
|
|
9769
10113
|
children: [
|
|
9770
|
-
/* @__PURE__ */
|
|
10114
|
+
/* @__PURE__ */ jsx31(Download, { size: ICON_SIZE }),
|
|
9771
10115
|
t("exportDashboardJson")
|
|
9772
10116
|
]
|
|
9773
10117
|
}
|
|
9774
10118
|
),
|
|
9775
|
-
toolbarVisibility.email !== false && exportOpts.email && /* @__PURE__ */
|
|
10119
|
+
toolbarVisibility.email !== false && exportOpts.email && /* @__PURE__ */ jsxs28(
|
|
9776
10120
|
"button",
|
|
9777
10121
|
{
|
|
9778
10122
|
type: "button",
|
|
@@ -9781,13 +10125,13 @@ function DashboardDesigner({
|
|
|
9781
10125
|
"aria-label": t("sendEmail"),
|
|
9782
10126
|
onClick: () => setEmailOpen(true),
|
|
9783
10127
|
children: [
|
|
9784
|
-
/* @__PURE__ */
|
|
10128
|
+
/* @__PURE__ */ jsx31(Mail2, { size: ICON_SIZE }),
|
|
9785
10129
|
t("emailAction")
|
|
9786
10130
|
]
|
|
9787
10131
|
}
|
|
9788
10132
|
)
|
|
9789
10133
|
] }),
|
|
9790
|
-
toolbarVisibility.edit !== false && onToggleEdit && readOnly && drillTrail.length === 0 && /* @__PURE__ */
|
|
10134
|
+
toolbarVisibility.edit !== false && onToggleEdit && readOnly && drillTrail.length === 0 && /* @__PURE__ */ jsxs28(
|
|
9791
10135
|
"button",
|
|
9792
10136
|
{
|
|
9793
10137
|
type: "button",
|
|
@@ -9796,13 +10140,13 @@ function DashboardDesigner({
|
|
|
9796
10140
|
"aria-label": t("edit"),
|
|
9797
10141
|
onClick: onToggleEdit,
|
|
9798
10142
|
children: [
|
|
9799
|
-
/* @__PURE__ */
|
|
10143
|
+
/* @__PURE__ */ jsx31(Pencil, { size: ICON_SIZE }),
|
|
9800
10144
|
t("edit")
|
|
9801
10145
|
]
|
|
9802
10146
|
}
|
|
9803
10147
|
),
|
|
9804
|
-
!effectiveReadOnly && /* @__PURE__ */
|
|
9805
|
-
toolbarVisibility.share !== false && /* @__PURE__ */
|
|
10148
|
+
!effectiveReadOnly && /* @__PURE__ */ jsxs28(Fragment12, { children: [
|
|
10149
|
+
toolbarVisibility.share !== false && /* @__PURE__ */ jsxs28(
|
|
9806
10150
|
"button",
|
|
9807
10151
|
{
|
|
9808
10152
|
type: "button",
|
|
@@ -9811,12 +10155,12 @@ function DashboardDesigner({
|
|
|
9811
10155
|
"aria-label": t("shareDashboard"),
|
|
9812
10156
|
onClick: () => setShareOpen(true),
|
|
9813
10157
|
children: [
|
|
9814
|
-
/* @__PURE__ */
|
|
10158
|
+
/* @__PURE__ */ jsx31(Share2, { size: ICON_SIZE }),
|
|
9815
10159
|
t("share")
|
|
9816
10160
|
]
|
|
9817
10161
|
}
|
|
9818
10162
|
),
|
|
9819
|
-
toolbarVisibility.settings !== false && /* @__PURE__ */
|
|
10163
|
+
toolbarVisibility.settings !== false && /* @__PURE__ */ jsx31(
|
|
9820
10164
|
"button",
|
|
9821
10165
|
{
|
|
9822
10166
|
type: "button",
|
|
@@ -9824,10 +10168,10 @@ function DashboardDesigner({
|
|
|
9824
10168
|
title: t("dashboardSettings"),
|
|
9825
10169
|
"aria-label": t("dashboardSettings"),
|
|
9826
10170
|
onClick: () => setSettingsOpen(true),
|
|
9827
|
-
children: /* @__PURE__ */
|
|
10171
|
+
children: /* @__PURE__ */ jsx31(Settings2, { size: ICON_SIZE })
|
|
9828
10172
|
}
|
|
9829
10173
|
),
|
|
9830
|
-
toolbarVisibility.history !== false && /* @__PURE__ */
|
|
10174
|
+
toolbarVisibility.history !== false && /* @__PURE__ */ jsxs28(
|
|
9831
10175
|
"button",
|
|
9832
10176
|
{
|
|
9833
10177
|
type: "button",
|
|
@@ -9836,13 +10180,13 @@ function DashboardDesigner({
|
|
|
9836
10180
|
"aria-label": t("versionHistory"),
|
|
9837
10181
|
onClick: () => setHistoryOpen(true),
|
|
9838
10182
|
children: [
|
|
9839
|
-
/* @__PURE__ */
|
|
10183
|
+
/* @__PURE__ */ jsx31(History2, { size: ICON_SIZE }),
|
|
9840
10184
|
t("history")
|
|
9841
10185
|
]
|
|
9842
10186
|
}
|
|
9843
10187
|
),
|
|
9844
|
-
/* @__PURE__ */
|
|
9845
|
-
toolbarVisibility.undo !== false && /* @__PURE__ */
|
|
10188
|
+
/* @__PURE__ */ jsxs28("div", { className: "dd-toolbar-history", role: "group", "aria-label": t("editHistory"), children: [
|
|
10189
|
+
toolbarVisibility.undo !== false && /* @__PURE__ */ jsx31(
|
|
9846
10190
|
"button",
|
|
9847
10191
|
{
|
|
9848
10192
|
type: "button",
|
|
@@ -9851,10 +10195,10 @@ function DashboardDesigner({
|
|
|
9851
10195
|
"aria-label": t("undo"),
|
|
9852
10196
|
disabled: !canUndo,
|
|
9853
10197
|
onClick: handleUndo,
|
|
9854
|
-
children: /* @__PURE__ */
|
|
10198
|
+
children: /* @__PURE__ */ jsx31(Undo2, { size: ICON_SIZE })
|
|
9855
10199
|
}
|
|
9856
10200
|
),
|
|
9857
|
-
toolbarVisibility.redo !== false && /* @__PURE__ */
|
|
10201
|
+
toolbarVisibility.redo !== false && /* @__PURE__ */ jsx31(
|
|
9858
10202
|
"button",
|
|
9859
10203
|
{
|
|
9860
10204
|
type: "button",
|
|
@@ -9863,10 +10207,10 @@ function DashboardDesigner({
|
|
|
9863
10207
|
"aria-label": t("redo"),
|
|
9864
10208
|
disabled: !canRedo,
|
|
9865
10209
|
onClick: handleRedo,
|
|
9866
|
-
children: /* @__PURE__ */
|
|
10210
|
+
children: /* @__PURE__ */ jsx31(Redo2, { size: ICON_SIZE })
|
|
9867
10211
|
}
|
|
9868
10212
|
),
|
|
9869
|
-
toolbarVisibility.reset !== false && /* @__PURE__ */
|
|
10213
|
+
toolbarVisibility.reset !== false && /* @__PURE__ */ jsx31(
|
|
9870
10214
|
"button",
|
|
9871
10215
|
{
|
|
9872
10216
|
type: "button",
|
|
@@ -9875,23 +10219,23 @@ function DashboardDesigner({
|
|
|
9875
10219
|
"aria-label": t("reset"),
|
|
9876
10220
|
disabled: !canReset,
|
|
9877
10221
|
onClick: handleReset,
|
|
9878
|
-
children: /* @__PURE__ */
|
|
10222
|
+
children: /* @__PURE__ */ jsx31(RotateCcw4, { size: ICON_SIZE })
|
|
9879
10223
|
}
|
|
9880
10224
|
)
|
|
9881
10225
|
] }),
|
|
9882
|
-
toolbarVisibility.add !== false && /* @__PURE__ */
|
|
9883
|
-
/* @__PURE__ */
|
|
10226
|
+
toolbarVisibility.add !== false && /* @__PURE__ */ jsxs28("button", { type: "button", className: "dd-btn", onClick: openAddModal, children: [
|
|
10227
|
+
/* @__PURE__ */ jsx31(Plus6, { size: ICON_SIZE }),
|
|
9884
10228
|
t("add")
|
|
9885
10229
|
] }),
|
|
9886
|
-
toolbarVisibility.save !== false && /* @__PURE__ */
|
|
9887
|
-
/* @__PURE__ */
|
|
10230
|
+
toolbarVisibility.save !== false && /* @__PURE__ */ jsxs28("button", { type: "button", className: "dd-btn dd-btn-primary", onClick: () => void handleSave(), children: [
|
|
10231
|
+
/* @__PURE__ */ jsx31(Save2, { size: ICON_SIZE }),
|
|
9888
10232
|
t("save")
|
|
9889
10233
|
] })
|
|
9890
10234
|
] })
|
|
9891
10235
|
] })
|
|
9892
10236
|
] }),
|
|
9893
|
-
/* @__PURE__ */
|
|
9894
|
-
/* @__PURE__ */
|
|
10237
|
+
/* @__PURE__ */ jsxs28("div", { className: "dd-workspace", children: [
|
|
10238
|
+
/* @__PURE__ */ jsx31(
|
|
9895
10239
|
GlobalFiltersSidePanel,
|
|
9896
10240
|
{
|
|
9897
10241
|
filters: dashboard.globalFilters,
|
|
@@ -9901,15 +10245,15 @@ function DashboardDesigner({
|
|
|
9901
10245
|
onPanelChange: setFiltersPanel
|
|
9902
10246
|
}
|
|
9903
10247
|
),
|
|
9904
|
-
/* @__PURE__ */
|
|
9905
|
-
dashboard.widgets.length === 0 && !effectiveReadOnly && /* @__PURE__ */
|
|
9906
|
-
/* @__PURE__ */
|
|
9907
|
-
/* @__PURE__ */
|
|
9908
|
-
/* @__PURE__ */
|
|
10248
|
+
/* @__PURE__ */ jsx31("div", { className: "dd-main dd-main-canvas-only", children: /* @__PURE__ */ jsxs28("div", { id: "dd-canvas", className: "dd-canvas", children: [
|
|
10249
|
+
dashboard.widgets.length === 0 && !effectiveReadOnly && /* @__PURE__ */ jsxs28("div", { className: "dd-canvas-empty", children: [
|
|
10250
|
+
/* @__PURE__ */ jsx31("p", { children: t("emptyCanvas") }),
|
|
10251
|
+
/* @__PURE__ */ jsxs28("button", { type: "button", className: "dd-btn dd-btn-primary", onClick: openAddModal, children: [
|
|
10252
|
+
/* @__PURE__ */ jsx31(Plus6, { size: ICON_SIZE }),
|
|
9909
10253
|
t("addWidget")
|
|
9910
10254
|
] })
|
|
9911
10255
|
] }),
|
|
9912
|
-
/* @__PURE__ */
|
|
10256
|
+
/* @__PURE__ */ jsx31(
|
|
9913
10257
|
GridLayout,
|
|
9914
10258
|
{
|
|
9915
10259
|
className: "layout",
|
|
@@ -9931,7 +10275,7 @@ function DashboardDesigner({
|
|
|
9931
10275
|
draggableHandle: ".dd-widget-drag",
|
|
9932
10276
|
draggableCancel: ".dd-widget-edit, .dd-widget-delete, .dd-widget-header-actions, .dd-widget-floating-actions, .dd-chart-fill, .recharts-wrapper, .dd-listbox",
|
|
9933
10277
|
compactType: "vertical",
|
|
9934
|
-
children: dashboard.widgets.map((widget) => /* @__PURE__ */
|
|
10278
|
+
children: dashboard.widgets.map((widget) => /* @__PURE__ */ jsx31("div", { children: /* @__PURE__ */ jsx31(
|
|
9935
10279
|
WidgetCard,
|
|
9936
10280
|
{
|
|
9937
10281
|
widget,
|
|
@@ -9965,7 +10309,7 @@ function DashboardDesigner({
|
|
|
9965
10309
|
)
|
|
9966
10310
|
] }) })
|
|
9967
10311
|
] }),
|
|
9968
|
-
!effectiveReadOnly && /* @__PURE__ */
|
|
10312
|
+
!effectiveReadOnly && /* @__PURE__ */ jsx31(
|
|
9969
10313
|
WidgetEditorModal,
|
|
9970
10314
|
{
|
|
9971
10315
|
open: modalOpen,
|
|
@@ -9984,7 +10328,7 @@ function DashboardDesigner({
|
|
|
9984
10328
|
}
|
|
9985
10329
|
}
|
|
9986
10330
|
),
|
|
9987
|
-
/* @__PURE__ */
|
|
10331
|
+
/* @__PURE__ */ jsx31(
|
|
9988
10332
|
HistoryPanel,
|
|
9989
10333
|
{
|
|
9990
10334
|
open: historyOpen && !effectiveReadOnly,
|
|
@@ -10001,7 +10345,7 @@ function DashboardDesigner({
|
|
|
10001
10345
|
}
|
|
10002
10346
|
}
|
|
10003
10347
|
),
|
|
10004
|
-
/* @__PURE__ */
|
|
10348
|
+
/* @__PURE__ */ jsx31(
|
|
10005
10349
|
SharePanel,
|
|
10006
10350
|
{
|
|
10007
10351
|
open: shareOpen && !effectiveReadOnly,
|
|
@@ -10010,7 +10354,7 @@ function DashboardDesigner({
|
|
|
10010
10354
|
api
|
|
10011
10355
|
}
|
|
10012
10356
|
),
|
|
10013
|
-
/* @__PURE__ */
|
|
10357
|
+
/* @__PURE__ */ jsx31(
|
|
10014
10358
|
EmailComposePanel,
|
|
10015
10359
|
{
|
|
10016
10360
|
open: emailOpen,
|
|
@@ -10019,7 +10363,7 @@ function DashboardDesigner({
|
|
|
10019
10363
|
api
|
|
10020
10364
|
}
|
|
10021
10365
|
),
|
|
10022
|
-
/* @__PURE__ */
|
|
10366
|
+
/* @__PURE__ */ jsx31(
|
|
10023
10367
|
DashboardSettingsPanel,
|
|
10024
10368
|
{
|
|
10025
10369
|
open: settingsOpen && !effectiveReadOnly,
|
|
@@ -10028,7 +10372,7 @@ function DashboardDesigner({
|
|
|
10028
10372
|
onChange: (partial) => commitDashboard({ ...dashboard, ...partial })
|
|
10029
10373
|
}
|
|
10030
10374
|
),
|
|
10031
|
-
variablesOpen && !effectiveReadOnly && /* @__PURE__ */
|
|
10375
|
+
variablesOpen && !effectiveReadOnly && /* @__PURE__ */ jsx31(
|
|
10032
10376
|
VariablesModal,
|
|
10033
10377
|
{
|
|
10034
10378
|
api,
|
|
@@ -10050,9 +10394,9 @@ function DashboardDesigner({
|
|
|
10050
10394
|
}
|
|
10051
10395
|
|
|
10052
10396
|
// src/viewer/DashboardViewer.tsx
|
|
10053
|
-
import { jsx as
|
|
10397
|
+
import { jsx as jsx32 } from "react/jsx-runtime";
|
|
10054
10398
|
function DashboardViewer({ dashboard, apiBaseUrl, auth, locale, ...variables }) {
|
|
10055
|
-
return /* @__PURE__ */
|
|
10399
|
+
return /* @__PURE__ */ jsx32(
|
|
10056
10400
|
DashboardDesigner,
|
|
10057
10401
|
{
|
|
10058
10402
|
...variables,
|