@platox/pivot-table 0.0.33 → 0.0.35
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/es/dashboard-workbench/components/add-module-btn/index.d.ts +11 -0
- package/es/dashboard-workbench/components/add-module-btn/index.js +97 -0
- package/es/dashboard-workbench/components/add-module-btn/index.js.map +1 -0
- package/es/dashboard-workbench/components/add-module-modal/add-calendar-modal/custome-data.d.ts +20 -0
- package/es/dashboard-workbench/components/add-module-modal/add-calendar-modal/custome-data.js +169 -0
- package/es/dashboard-workbench/components/add-module-modal/add-calendar-modal/custome-data.js.map +1 -0
- package/es/dashboard-workbench/components/add-module-modal/add-calendar-modal/index.d.ts +13 -0
- package/es/dashboard-workbench/components/add-module-modal/add-calendar-modal/index.js +82 -0
- package/es/dashboard-workbench/components/add-module-modal/add-calendar-modal/index.js.map +1 -0
- package/es/dashboard-workbench/components/add-module-modal/add-chart-modal/custome-data.d.ts +29 -0
- package/es/dashboard-workbench/components/add-module-modal/add-chart-modal/custome-data.js +328 -0
- package/es/dashboard-workbench/components/add-module-modal/add-chart-modal/custome-data.js.map +1 -0
- package/es/dashboard-workbench/components/add-module-modal/add-chart-modal/custome-styles.d.ts +15 -0
- package/es/dashboard-workbench/components/add-module-modal/add-chart-modal/custome-styles.js +58 -0
- package/es/dashboard-workbench/components/add-module-modal/add-chart-modal/custome-styles.js.map +1 -0
- package/es/dashboard-workbench/components/add-module-modal/add-chart-modal/index.d.ts +13 -0
- package/es/dashboard-workbench/components/add-module-modal/add-chart-modal/index.js +114 -0
- package/es/dashboard-workbench/components/add-module-modal/add-chart-modal/index.js.map +1 -0
- package/es/dashboard-workbench/components/add-module-modal/add-statistics-modal/custome-data.d.ts +20 -0
- package/es/dashboard-workbench/components/add-module-modal/add-statistics-modal/custome-data.js +180 -0
- package/es/dashboard-workbench/components/add-module-modal/add-statistics-modal/custome-data.js.map +1 -0
- package/es/dashboard-workbench/components/add-module-modal/add-statistics-modal/custome-styles.d.ts +13 -0
- package/es/dashboard-workbench/components/add-module-modal/add-statistics-modal/custome-styles.js +119 -0
- package/es/dashboard-workbench/components/add-module-modal/add-statistics-modal/custome-styles.js.map +1 -0
- package/es/dashboard-workbench/components/add-module-modal/add-statistics-modal/index.d.ts +13 -0
- package/es/dashboard-workbench/components/add-module-modal/add-statistics-modal/index.js +111 -0
- package/es/dashboard-workbench/components/add-module-modal/add-statistics-modal/index.js.map +1 -0
- package/es/dashboard-workbench/components/add-module-modal/components/condition-modal/debounce-select.d.ts +12 -0
- package/es/dashboard-workbench/components/add-module-modal/components/condition-modal/debounce-select.js +44 -0
- package/es/dashboard-workbench/components/add-module-modal/components/condition-modal/debounce-select.js.map +1 -0
- package/es/dashboard-workbench/components/add-module-modal/components/condition-modal/index.d.ts +21 -0
- package/es/dashboard-workbench/components/add-module-modal/components/condition-modal/index.js +510 -0
- package/es/dashboard-workbench/components/add-module-modal/components/condition-modal/index.js.map +1 -0
- package/es/dashboard-workbench/components/add-module-modal/components/condition-modal/utils.d.ts +25 -0
- package/es/dashboard-workbench/components/add-module-modal/components/select-color/index.d.ts +12 -0
- package/es/dashboard-workbench/components/add-module-modal/components/select-color/index.js +45 -0
- package/es/dashboard-workbench/components/add-module-modal/components/select-color/index.js.map +1 -0
- package/es/dashboard-workbench/components/module-content/calendar-module/index.d.ts +14 -0
- package/es/dashboard-workbench/components/module-content/calendar-module/index.js +229 -0
- package/es/dashboard-workbench/components/module-content/calendar-module/index.js.map +1 -0
- package/es/dashboard-workbench/components/module-content/calendar-module/locales/en.d.ts +7 -0
- package/es/dashboard-workbench/components/module-content/calendar-module/locales/en.js +10 -0
- package/es/dashboard-workbench/components/module-content/calendar-module/locales/en.js.map +1 -0
- package/es/dashboard-workbench/components/module-content/calendar-module/locales/zh.d.ts +22 -0
- package/es/dashboard-workbench/components/module-content/calendar-module/locales/zh.js +29 -0
- package/es/dashboard-workbench/components/module-content/calendar-module/locales/zh.js.map +1 -0
- package/es/dashboard-workbench/components/module-content/chart-module/Empty.d.ts +5 -0
- package/es/dashboard-workbench/components/module-content/chart-module/Empty.js +30 -0
- package/es/dashboard-workbench/components/module-content/chart-module/Empty.js.map +1 -0
- package/es/dashboard-workbench/components/module-content/chart-module/base-chart/index.d.ts +8 -0
- package/es/dashboard-workbench/components/module-content/chart-module/base-chart/index.js +62 -0
- package/es/dashboard-workbench/components/module-content/chart-module/base-chart/index.js.map +1 -0
- package/es/dashboard-workbench/components/module-content/chart-module/index.d.ts +14 -0
- package/es/dashboard-workbench/components/module-content/chart-module/index.js +406 -0
- package/es/dashboard-workbench/components/module-content/chart-module/index.js.map +1 -0
- package/es/dashboard-workbench/components/module-content/chart-module/utils.d.ts +9 -0
- package/es/dashboard-workbench/components/module-content/chart-module/utils.js +200 -0
- package/es/dashboard-workbench/components/module-content/chart-module/utils.js.map +1 -0
- package/es/dashboard-workbench/components/module-content/index.d.ts +31 -0
- package/es/dashboard-workbench/components/module-content/index.js +81 -0
- package/es/dashboard-workbench/components/module-content/index.js.map +1 -0
- package/es/dashboard-workbench/components/module-content/statistics-module/index.d.ts +15 -0
- package/es/dashboard-workbench/components/module-content/statistics-module/index.js +305 -0
- package/es/dashboard-workbench/components/module-content/statistics-module/index.js.map +1 -0
- package/es/dashboard-workbench/components/module-content/statistics-module/utils.d.ts +4 -0
- package/es/dashboard-workbench/components/module-content/statistics-module/utils.js +41 -0
- package/es/dashboard-workbench/components/module-content/statistics-module/utils.js.map +1 -0
- package/es/dashboard-workbench/components/module-content/text-module/editor/index.d.ts +7 -0
- package/es/dashboard-workbench/components/module-content/text-module/editor/index.js +224 -0
- package/es/dashboard-workbench/components/module-content/text-module/editor/index.js.map +1 -0
- package/es/dashboard-workbench/components/module-content/text-module/editor/useDebounce.d.ts +2 -0
- package/es/dashboard-workbench/components/module-content/text-module/editor/useDebounce.js +24 -0
- package/es/dashboard-workbench/components/module-content/text-module/editor/useDebounce.js.map +1 -0
- package/es/dashboard-workbench/components/module-content/text-module/index.d.ts +7 -0
- package/es/dashboard-workbench/components/module-content/text-module/index.js +11 -0
- package/es/dashboard-workbench/components/module-content/text-module/index.js.map +1 -0
- package/es/dashboard-workbench/components/module-content/utils.d.ts +15 -0
- package/es/dashboard-workbench/components/module-content/utils.js +113 -0
- package/es/dashboard-workbench/components/module-content/utils.js.map +1 -0
- package/es/dashboard-workbench/components/module-header/index.d.ts +12 -0
- package/es/dashboard-workbench/components/module-header/index.js +115 -0
- package/es/dashboard-workbench/components/module-header/index.js.map +1 -0
- package/es/dashboard-workbench/components/ui/modal/editor-header.d.ts +12 -0
- package/es/dashboard-workbench/components/ui/modal/editor-header.js +59 -0
- package/es/dashboard-workbench/components/ui/modal/editor-header.js.map +1 -0
- package/es/dashboard-workbench/components/ui/modal/index.module.less.js +9 -0
- package/es/dashboard-workbench/components/ui/modal/index.module.less.js.map +1 -0
- package/es/dashboard-workbench/context.d.ts +16 -0
- package/es/dashboard-workbench/context.js +21 -0
- package/es/dashboard-workbench/context.js.map +1 -0
- package/es/dashboard-workbench/icon/icon-bar-percentage.d.ts +2 -0
- package/es/dashboard-workbench/icon/icon-bar-percentage.js +17 -0
- package/es/dashboard-workbench/icon/icon-bar-percentage.js.map +1 -0
- package/es/dashboard-workbench/icon/icon-bar-pile.d.ts +2 -0
- package/es/dashboard-workbench/icon/icon-bar-pile.js +17 -0
- package/es/dashboard-workbench/icon/icon-bar-pile.js.map +1 -0
- package/es/dashboard-workbench/icon/icon-bar.d.ts +2 -0
- package/es/dashboard-workbench/icon/icon-bar.js +13 -0
- package/es/dashboard-workbench/icon/icon-bar.js.map +1 -0
- package/es/dashboard-workbench/icon/icon-calendar.d.ts +2 -0
- package/es/dashboard-workbench/icon/icon-calendar.js +40 -0
- package/es/dashboard-workbench/icon/icon-calendar.js.map +1 -0
- package/es/dashboard-workbench/icon/icon-drag.d.ts +2 -0
- package/es/dashboard-workbench/icon/icon-drag.js +25 -0
- package/es/dashboard-workbench/icon/icon-drag.js.map +1 -0
- package/es/dashboard-workbench/icon/icon-editor.d.ts +2 -0
- package/es/dashboard-workbench/icon/icon-editor.js +40 -0
- package/es/dashboard-workbench/icon/icon-editor.js.map +1 -0
- package/es/dashboard-workbench/icon/icon-empty.d.ts +2 -0
- package/es/dashboard-workbench/icon/icon-empty.js +139 -0
- package/es/dashboard-workbench/icon/icon-empty.js.map +1 -0
- package/es/dashboard-workbench/icon/icon-line-smooth.d.ts +2 -0
- package/es/dashboard-workbench/icon/icon-line-smooth.js +28 -0
- package/es/dashboard-workbench/icon/icon-line-smooth.js.map +1 -0
- package/es/dashboard-workbench/icon/icon-line.d.ts +2 -0
- package/es/dashboard-workbench/icon/icon-line.js +28 -0
- package/es/dashboard-workbench/icon/icon-line.js.map +1 -0
- package/es/dashboard-workbench/icon/icon-move.d.ts +2 -0
- package/es/dashboard-workbench/icon/icon-move.js +25 -0
- package/es/dashboard-workbench/icon/icon-move.js.map +1 -0
- package/es/dashboard-workbench/icon/icon-pie-circular.d.ts +2 -0
- package/es/dashboard-workbench/icon/icon-pie-circular.js +30 -0
- package/es/dashboard-workbench/icon/icon-pie-circular.js.map +1 -0
- package/es/dashboard-workbench/icon/icon-pie.d.ts +2 -0
- package/es/dashboard-workbench/icon/icon-pie.js +24 -0
- package/es/dashboard-workbench/icon/icon-pie.js.map +1 -0
- package/es/dashboard-workbench/icon/icon-statistics.d.ts +2 -0
- package/es/dashboard-workbench/icon/icon-statistics.js +37 -0
- package/es/dashboard-workbench/icon/icon-statistics.js.map +1 -0
- package/es/dashboard-workbench/icon/icon-strip-bar-percentage.d.ts +2 -0
- package/es/dashboard-workbench/icon/icon-strip-bar-percentage.js +105 -0
- package/es/dashboard-workbench/icon/icon-strip-bar-percentage.js.map +1 -0
- package/es/dashboard-workbench/icon/icon-strip-bar-pile.d.ts +2 -0
- package/es/dashboard-workbench/icon/icon-strip-bar-pile.js +105 -0
- package/es/dashboard-workbench/icon/icon-strip-bar-pile.js.map +1 -0
- package/es/dashboard-workbench/icon/icon-strip-bar.d.ts +2 -0
- package/es/dashboard-workbench/icon/icon-strip-bar.js +57 -0
- package/es/dashboard-workbench/icon/icon-strip-bar.js.map +1 -0
- package/es/dashboard-workbench/index.d.ts +33 -0
- package/es/dashboard-workbench/index.js +414 -0
- package/es/dashboard-workbench/index.js.map +1 -0
- package/es/dashboard-workbench/lang/en-US.d.ts +147 -0
- package/es/dashboard-workbench/lang/en-US.js +158 -0
- package/es/dashboard-workbench/lang/en-US.js.map +1 -0
- package/es/dashboard-workbench/lang/index.d.ts +2 -0
- package/es/dashboard-workbench/lang/index.js +25 -0
- package/es/dashboard-workbench/lang/index.js.map +1 -0
- package/es/dashboard-workbench/lang/zh-CN.d.ts +147 -0
- package/es/dashboard-workbench/lang/zh-CN.js +158 -0
- package/es/dashboard-workbench/lang/zh-CN.js.map +1 -0
- package/es/dashboard-workbench/types.d.ts +22 -0
- package/es/dashboard-workbench/utils/index.d.ts +9 -0
- package/es/dashboard-workbench/utils/index.js +30 -0
- package/es/dashboard-workbench/utils/index.js.map +1 -0
- package/es/index.d.ts +1 -0
- package/es/index.js +5 -0
- package/es/index.js.map +1 -0
- package/es/style.css +1 -0
- package/package.json +25 -24
- package/umd/pivot-table.umd.cjs +178 -0
- package/umd/style.css +1 -0
- package/index.d.ts +0 -98
- package/lib/index.js +0 -52222
- package/lib/index.umd.cjs +0 -178
- package/lib/style.css +0 -1
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export interface ModuleValueType {
|
|
2
|
+
id?: any;
|
|
3
|
+
type?: 'text' | 'statistics' | 'chart-bar' | 'chart-bar-pile' | 'chart-bar-percentage' | 'chart-line' | 'chart-line-smooth' | 'chart-strip-bar' | 'chart-strip-bar-pile' | 'chart-strip-bar-percentage' | 'chart-pie' | 'chart-pie-circular' | 'calendar';
|
|
4
|
+
customData?: any;
|
|
5
|
+
customeStyle?: any;
|
|
6
|
+
}
|
|
7
|
+
interface AddModuleBtnProps {
|
|
8
|
+
onOk?: (type: ModuleValueType['type']) => void;
|
|
9
|
+
}
|
|
10
|
+
declare const AddModuleBtn: React.FC<AddModuleBtnProps>;
|
|
11
|
+
export default AddModuleBtn;
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { jsx, Fragment, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Popover, Button } from "antd";
|
|
3
|
+
import { useState } from "react";
|
|
4
|
+
import IconBar from "../../icon/icon-bar.js";
|
|
5
|
+
import IconLine from "../../icon/icon-line.js";
|
|
6
|
+
import IconPie from "../../icon/icon-pie.js";
|
|
7
|
+
import IconStripBar from "../../icon/icon-strip-bar.js";
|
|
8
|
+
import IconStatistics from "../../icon/icon-statistics.js";
|
|
9
|
+
import IconEditor from "../../icon/icon-editor.js";
|
|
10
|
+
import IconCalendar from "../../icon/icon-calendar.js";
|
|
11
|
+
import { useTranslation } from "react-i18next";
|
|
12
|
+
const AddModuleBtn = ({ onOk }) => {
|
|
13
|
+
const { t } = useTranslation();
|
|
14
|
+
const navs = [
|
|
15
|
+
{
|
|
16
|
+
title: t("add.add1"),
|
|
17
|
+
child: [
|
|
18
|
+
{
|
|
19
|
+
title: t("add.add2"),
|
|
20
|
+
type: "chart-bar",
|
|
21
|
+
icon: /* @__PURE__ */ jsx(IconBar, {})
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
title: t("add.add3"),
|
|
25
|
+
type: "chart-line",
|
|
26
|
+
icon: /* @__PURE__ */ jsx(IconLine, {})
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
title: t("add.add4"),
|
|
30
|
+
type: "chart-pie",
|
|
31
|
+
icon: /* @__PURE__ */ jsx(IconPie, {})
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
title: t("add.add5"),
|
|
35
|
+
type: "chart-strip-bar",
|
|
36
|
+
icon: /* @__PURE__ */ jsx(IconStripBar, {})
|
|
37
|
+
}
|
|
38
|
+
]
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
title: t("add.add6"),
|
|
42
|
+
child: [
|
|
43
|
+
{
|
|
44
|
+
title: t("add.add7"),
|
|
45
|
+
type: "statistics",
|
|
46
|
+
icon: /* @__PURE__ */ jsx(IconStatistics, {})
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
title: t("add.add8"),
|
|
50
|
+
type: "text",
|
|
51
|
+
icon: /* @__PURE__ */ jsx(IconEditor, {})
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
title: t("add.add9"),
|
|
55
|
+
type: "calendar",
|
|
56
|
+
icon: /* @__PURE__ */ jsx(IconCalendar, {})
|
|
57
|
+
}
|
|
58
|
+
]
|
|
59
|
+
}
|
|
60
|
+
];
|
|
61
|
+
const [open, setOpen] = useState(false);
|
|
62
|
+
const onAdd = (value) => {
|
|
63
|
+
setOpen(false);
|
|
64
|
+
onOk == null ? void 0 : onOk(value);
|
|
65
|
+
};
|
|
66
|
+
return /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
|
|
67
|
+
Popover,
|
|
68
|
+
{
|
|
69
|
+
placement: "bottomRight",
|
|
70
|
+
open,
|
|
71
|
+
onOpenChange: setOpen,
|
|
72
|
+
content: /* @__PURE__ */ jsx("div", { className: "pivot-table-modal box-widget-popover-item-container", children: navs.map((item, key) => /* @__PURE__ */ jsxs("div", { className: "box-widget-popover-item-group", children: [
|
|
73
|
+
/* @__PURE__ */ jsx("p", { className: "box-widget-popover-item-group-header", children: item.title }),
|
|
74
|
+
/* @__PURE__ */ jsx("div", { className: "box-widget-popover-item-group-content", children: item.child.map((child, childKey) => /* @__PURE__ */ jsxs(
|
|
75
|
+
"div",
|
|
76
|
+
{
|
|
77
|
+
onClick: () => {
|
|
78
|
+
onAdd(child.type);
|
|
79
|
+
},
|
|
80
|
+
className: "box-widget-popover-item",
|
|
81
|
+
children: [
|
|
82
|
+
/* @__PURE__ */ jsx("div", { className: "img", children: child.icon }),
|
|
83
|
+
/* @__PURE__ */ jsx("div", { className: "title", children: child.title })
|
|
84
|
+
]
|
|
85
|
+
},
|
|
86
|
+
childKey
|
|
87
|
+
)) })
|
|
88
|
+
] }, key)) }),
|
|
89
|
+
trigger: "click",
|
|
90
|
+
children: /* @__PURE__ */ jsx(Button, { children: t("add.add10") })
|
|
91
|
+
}
|
|
92
|
+
) });
|
|
93
|
+
};
|
|
94
|
+
export {
|
|
95
|
+
AddModuleBtn as default
|
|
96
|
+
};
|
|
97
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../packages/dashboard-workbench/components/add-module-btn/index.tsx"],"sourcesContent":["import { Button, Popover } from 'antd'\nimport { useState } from 'react'\nimport IconBar from '../../icon/icon-bar'\nimport IconLine from '../../icon/icon-line'\nimport IconPie from '../../icon/icon-pie'\nimport IconStripBar from '../../icon/icon-strip-bar'\nimport IconStatistics from '../../icon/icon-statistics'\nimport IconEditor from '../../icon/icon-editor'\nimport IconCalendar from '../../icon/icon-calendar'\nimport { useTranslation } from 'react-i18next'\n\nexport interface ModuleValueType {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n id?: any\n type?:\n | 'text'\n | 'statistics'\n | 'chart-bar'\n | 'chart-bar-pile'\n | 'chart-bar-percentage'\n | 'chart-line'\n | 'chart-line-smooth'\n | 'chart-strip-bar'\n | 'chart-strip-bar-pile'\n | 'chart-strip-bar-percentage'\n | 'chart-pie'\n | 'chart-pie-circular'\n | 'calendar'\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n customData?: any\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n customeStyle?: any\n}\n\ninterface AddModuleBtnProps {\n onOk?: (type: ModuleValueType['type']) => void\n}\n\nconst AddModuleBtn: React.FC<AddModuleBtnProps> = ({ onOk }) => {\n const { t } = useTranslation()\n const navs = [\n {\n title: t('add.add1'),\n child: [\n {\n title: t('add.add2'),\n type: 'chart-bar',\n icon: <IconBar />,\n },\n {\n title: t('add.add3'),\n type: 'chart-line',\n icon: <IconLine />,\n },\n {\n title: t('add.add4'),\n type: 'chart-pie',\n icon: <IconPie />,\n },\n {\n title: t('add.add5'),\n type: 'chart-strip-bar',\n icon: <IconStripBar />,\n },\n ],\n },\n {\n title: t('add.add6'),\n child: [\n {\n title: t('add.add7'),\n type: 'statistics',\n icon: <IconStatistics />,\n },\n {\n title: t('add.add8'),\n type: 'text',\n icon: <IconEditor />,\n },\n {\n title: t('add.add9'),\n type: 'calendar',\n icon: <IconCalendar />,\n },\n ],\n },\n ]\n\n const [open, setOpen] = useState(false)\n const onAdd = (value: ModuleValueType['type']) => {\n setOpen(false)\n onOk?.(value)\n }\n\n return (\n <>\n <Popover\n placement=\"bottomRight\"\n open={open}\n onOpenChange={setOpen}\n content={\n <div className=\"pivot-table-modal box-widget-popover-item-container\">\n {navs.map((item, key) => (\n <div key={key} className=\"box-widget-popover-item-group\">\n <p className=\"box-widget-popover-item-group-header\">{item.title}</p>\n <div className=\"box-widget-popover-item-group-content\">\n {item.child.map((child, childKey) => (\n <div\n key={childKey}\n onClick={() => {\n onAdd(child.type as ModuleValueType['type'])\n }}\n className=\"box-widget-popover-item\"\n >\n <div className=\"img\">{child.icon}</div>\n <div className=\"title\">{child.title}</div>\n </div>\n ))}\n </div>\n </div>\n ))}\n </div>\n }\n trigger=\"click\"\n >\n <Button>{t('add.add10')}</Button>\n </Popover>\n </>\n )\n}\n\nexport default AddModuleBtn\n"],"names":[],"mappings":";;;;;;;;;;;AAsCA,MAAM,eAA4C,CAAC,EAAE,WAAW;AACxD,QAAA,EAAE,EAAE,IAAI,eAAe;AAC7B,QAAM,OAAO;AAAA,IACX;AAAA,MACE,OAAO,EAAE,UAAU;AAAA,MACnB,OAAO;AAAA,QACL;AAAA,UACE,OAAO,EAAE,UAAU;AAAA,UACnB,MAAM;AAAA,UACN,0BAAO,SAAQ,CAAA,CAAA;AAAA,QACjB;AAAA,QACA;AAAA,UACE,OAAO,EAAE,UAAU;AAAA,UACnB,MAAM;AAAA,UACN,0BAAO,UAAS,CAAA,CAA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,YAC7C;AAAA,YACA,WAAU;AAAA,YAEV,UAAA;AAAA,cAAA,oBAAC,OAAI,EAAA,WAAU,OAAO,UAAA,MAAM,MAAK;AAAA,cAChC,oBAAA,OAAA,EAAI,WAAU,SAAS,gBAAM,MAAM,CAAA;AAAA,YAAA;AAAA,UAAA;AAAA,UAP/B;AAAA,QAAA,CASR,EACH,CAAA;AAAA,MAAA,KAfQ,GAgBV,CACD,GACH;AAAA,MAEF,SAAQ;AAAA,MAER,UAAC,oBAAA,QAAA,EAAQ,UAAE,EAAA,WAAW,EAAE,CAAA;AAAA,IAAA;AAAA,EAAA,GAE5B;AAEJ;"}
|
package/es/dashboard-workbench/components/add-module-modal/add-calendar-modal/custome-data.d.ts
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { ModuleData } from '../../module-content';
|
|
2
|
+
import { EnumDataApi } from '../../../types';
|
|
3
|
+
import { ConditionListItemTypes } from '../components/condition-modal';
|
|
4
|
+
export type CalendarCustomeDataTypes = {
|
|
5
|
+
dataSourceId?: string;
|
|
6
|
+
conditionData?: {
|
|
7
|
+
conditionList: ConditionListItemTypes[];
|
|
8
|
+
conditionType: 'all' | 'any';
|
|
9
|
+
};
|
|
10
|
+
startDateField?: string;
|
|
11
|
+
endDateField?: string;
|
|
12
|
+
titleField: string;
|
|
13
|
+
};
|
|
14
|
+
interface CustomDataProps {
|
|
15
|
+
selectModuleData?: ModuleData;
|
|
16
|
+
onAllValuesChange?: ((values: any) => void) | undefined;
|
|
17
|
+
enumDataApi?: EnumDataApi;
|
|
18
|
+
}
|
|
19
|
+
declare const CustomData: React.FC<CustomDataProps>;
|
|
20
|
+
export default CustomData;
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
import { jsxs, Fragment, jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Form, Select, Button, Divider } from "antd";
|
|
3
|
+
import { useMemo, useState, useRef, useEffect } from "react";
|
|
4
|
+
import { useAppContext } from "../../../context.js";
|
|
5
|
+
import { useTranslation } from "react-i18next";
|
|
6
|
+
import ConditionModal from "../components/condition-modal/index.js";
|
|
7
|
+
import { useMemoizedFn, useDebounceFn } from "ahooks";
|
|
8
|
+
const CustomData = ({
|
|
9
|
+
selectModuleData,
|
|
10
|
+
onAllValuesChange,
|
|
11
|
+
enumDataApi
|
|
12
|
+
}) => {
|
|
13
|
+
const { globalData } = useAppContext();
|
|
14
|
+
const { t } = useTranslation();
|
|
15
|
+
const initialValues = {
|
|
16
|
+
dataSourceId: "",
|
|
17
|
+
startDateField: "",
|
|
18
|
+
endDateField: "",
|
|
19
|
+
titleField: ""
|
|
20
|
+
};
|
|
21
|
+
const [form] = Form.useForm();
|
|
22
|
+
const dataSourceId = Form.useWatch("dataSourceId", form);
|
|
23
|
+
const getDataSourceOption = useMemoizedFn(() => {
|
|
24
|
+
const filterField = ["customers", "vendors", "payees"];
|
|
25
|
+
let ret = ((globalData == null ? void 0 : globalData.sourceData) ?? []).filter((v) => {
|
|
26
|
+
return !filterField.includes(v.value);
|
|
27
|
+
});
|
|
28
|
+
return ret;
|
|
29
|
+
});
|
|
30
|
+
const dataSourceOptions = useMemo(() => {
|
|
31
|
+
return getDataSourceOption();
|
|
32
|
+
}, [globalData == null ? void 0 : globalData.sourceData]);
|
|
33
|
+
const getFieldOptions = useMemoizedFn((dataSourceId2) => {
|
|
34
|
+
var _a, _b;
|
|
35
|
+
const list = ((_b = (_a = globalData == null ? void 0 : globalData.sourceData) == null ? void 0 : _a.find((item) => item.value === dataSourceId2)) == null ? void 0 : _b.fields) ?? [];
|
|
36
|
+
return list;
|
|
37
|
+
});
|
|
38
|
+
const { fieldOptions, timeFieldOptions } = useMemo(() => {
|
|
39
|
+
const fieldOptions2 = getFieldOptions(dataSourceId);
|
|
40
|
+
const timeFieldOptions2 = fieldOptions2 == null ? void 0 : fieldOptions2.filter((item) => item.type === "timestamp");
|
|
41
|
+
return {
|
|
42
|
+
fieldOptions: fieldOptions2,
|
|
43
|
+
timeFieldOptions: timeFieldOptions2
|
|
44
|
+
};
|
|
45
|
+
}, [dataSourceId]);
|
|
46
|
+
const [isModalOpen, setIsModalOpen] = useState(false);
|
|
47
|
+
const conditionDataRef = useRef();
|
|
48
|
+
const [conditionData, setConditionData] = useState({
|
|
49
|
+
conditionList: [],
|
|
50
|
+
conditionType: "all"
|
|
51
|
+
});
|
|
52
|
+
const [conditionDataNum, setConditionDataNum] = useState(0);
|
|
53
|
+
const setCondition = (val) => {
|
|
54
|
+
var _a;
|
|
55
|
+
setConditionData(val);
|
|
56
|
+
conditionDataRef.current = val;
|
|
57
|
+
setConditionDataNum(((_a = val == null ? void 0 : val.conditionList) == null ? void 0 : _a.length) || 0);
|
|
58
|
+
};
|
|
59
|
+
const { run: debounceSubmit } = useDebounceFn(
|
|
60
|
+
useMemoizedFn(() => {
|
|
61
|
+
onAllValuesChange == null ? void 0 : onAllValuesChange({
|
|
62
|
+
...form.getFieldsValue(),
|
|
63
|
+
conditionData: conditionDataRef.current
|
|
64
|
+
});
|
|
65
|
+
}),
|
|
66
|
+
{
|
|
67
|
+
wait: 100
|
|
68
|
+
}
|
|
69
|
+
);
|
|
70
|
+
const handleValuesChange = useMemoizedFn((changedValues, allValues) => {
|
|
71
|
+
var _a, _b, _c;
|
|
72
|
+
if (changedValues.dataSourceId) {
|
|
73
|
+
const newFieldOptions = getFieldOptions(changedValues.dataSourceId);
|
|
74
|
+
const timeFieldOptions2 = fieldOptions.filter((item) => item.type === "timestamp");
|
|
75
|
+
form.setFieldsValue({
|
|
76
|
+
titleField: (_a = newFieldOptions == null ? void 0 : newFieldOptions[0]) == null ? void 0 : _a.value,
|
|
77
|
+
startDateField: (_b = timeFieldOptions2 == null ? void 0 : timeFieldOptions2[0]) == null ? void 0 : _b.value,
|
|
78
|
+
endDateField: (_c = timeFieldOptions2 == null ? void 0 : timeFieldOptions2[0]) == null ? void 0 : _c.value
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
debounceSubmit();
|
|
82
|
+
});
|
|
83
|
+
useEffect(() => {
|
|
84
|
+
var _a, _b, _c;
|
|
85
|
+
if (selectModuleData == null ? void 0 : selectModuleData.customData) {
|
|
86
|
+
const customData = selectModuleData.customData;
|
|
87
|
+
form.setFieldsValue(customData);
|
|
88
|
+
} else {
|
|
89
|
+
const dataSourceOptions2 = getDataSourceOption();
|
|
90
|
+
const dataSourceId2 = (_a = dataSourceOptions2 == null ? void 0 : dataSourceOptions2[0]) == null ? void 0 : _a.value;
|
|
91
|
+
const fieldOptions2 = getFieldOptions(dataSourceId2);
|
|
92
|
+
const timeFieldOptions2 = fieldOptions2.filter((item) => item.type === "timestamp");
|
|
93
|
+
form.setFieldsValue({
|
|
94
|
+
...initialValues,
|
|
95
|
+
dataSourceId: dataSourceOptions2,
|
|
96
|
+
titleField: (_b = fieldOptions2 == null ? void 0 : fieldOptions2[0]) == null ? void 0 : _b.value,
|
|
97
|
+
startDateField: timeFieldOptions2 == null ? void 0 : timeFieldOptions2[0].value,
|
|
98
|
+
endDateField: timeFieldOptions2 == null ? void 0 : timeFieldOptions2[0].value
|
|
99
|
+
});
|
|
100
|
+
debounceSubmit();
|
|
101
|
+
}
|
|
102
|
+
setCondition((_c = selectModuleData == null ? void 0 : selectModuleData.customData) == null ? void 0 : _c.conditionData);
|
|
103
|
+
}, [selectModuleData, globalData]);
|
|
104
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
105
|
+
/* @__PURE__ */ jsxs(
|
|
106
|
+
Form,
|
|
107
|
+
{
|
|
108
|
+
form,
|
|
109
|
+
name: "customData",
|
|
110
|
+
labelCol: { span: 8 },
|
|
111
|
+
wrapperCol: { span: 16 },
|
|
112
|
+
labelAlign: "left",
|
|
113
|
+
onValuesChange: handleValuesChange,
|
|
114
|
+
initialValues,
|
|
115
|
+
children: [
|
|
116
|
+
/* @__PURE__ */ jsx(
|
|
117
|
+
"div",
|
|
118
|
+
{
|
|
119
|
+
style: {
|
|
120
|
+
fontSize: "14px",
|
|
121
|
+
marginBottom: "5px"
|
|
122
|
+
},
|
|
123
|
+
children: t("data")
|
|
124
|
+
}
|
|
125
|
+
),
|
|
126
|
+
/* @__PURE__ */ jsx(Form.Item, { label: t("dataSource"), name: "dataSourceId", children: /* @__PURE__ */ jsx(Select, { options: dataSourceOptions }) }),
|
|
127
|
+
/* @__PURE__ */ jsxs(Form.Item, { label: t("dataRange"), children: [
|
|
128
|
+
/* @__PURE__ */ jsx(
|
|
129
|
+
Button,
|
|
130
|
+
{
|
|
131
|
+
style: { marginLeft: "-15px" },
|
|
132
|
+
onClick: () => {
|
|
133
|
+
setIsModalOpen(true);
|
|
134
|
+
},
|
|
135
|
+
type: "link",
|
|
136
|
+
children: t("filterData")
|
|
137
|
+
}
|
|
138
|
+
),
|
|
139
|
+
conditionDataNum > 0 ? `${t("selectNcondition", { n: conditionDataNum })}` : null
|
|
140
|
+
] }),
|
|
141
|
+
/* @__PURE__ */ jsx(Divider, { orientation: "left", orientationMargin: "0", children: t("calendar.t1") }),
|
|
142
|
+
/* @__PURE__ */ jsx(Form.Item, { label: t("calendar.t2"), name: "startDateField", children: /* @__PURE__ */ jsx(Select, { options: timeFieldOptions }) }),
|
|
143
|
+
/* @__PURE__ */ jsx(Form.Item, { label: t("calendar.t3"), name: "endDateField", children: /* @__PURE__ */ jsx(Select, { options: timeFieldOptions }) }),
|
|
144
|
+
/* @__PURE__ */ jsx(Form.Item, { label: t("calendar.t4"), name: "titleField", children: /* @__PURE__ */ jsx(Select, { options: fieldOptions }) })
|
|
145
|
+
]
|
|
146
|
+
}
|
|
147
|
+
),
|
|
148
|
+
/* @__PURE__ */ jsx(
|
|
149
|
+
ConditionModal,
|
|
150
|
+
{
|
|
151
|
+
open: isModalOpen,
|
|
152
|
+
value: conditionData,
|
|
153
|
+
fieldOptions,
|
|
154
|
+
enumDataApi,
|
|
155
|
+
onClose: () => {
|
|
156
|
+
setIsModalOpen(false);
|
|
157
|
+
},
|
|
158
|
+
onOk: (val) => {
|
|
159
|
+
setCondition(val);
|
|
160
|
+
debounceSubmit();
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
)
|
|
164
|
+
] });
|
|
165
|
+
};
|
|
166
|
+
export {
|
|
167
|
+
CustomData as default
|
|
168
|
+
};
|
|
169
|
+
//# sourceMappingURL=custome-data.js.map
|
package/es/dashboard-workbench/components/add-module-modal/add-calendar-modal/custome-data.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"custome-data.js","sources":["../../../../../packages/dashboard-workbench/components/add-module-modal/add-calendar-modal/custome-data.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { Button, Divider, Form, Select } from 'antd'\n\nimport { useEffect, useMemo, useRef, useState } from 'react'\nimport { useAppContext } from '../../../context'\nimport { ModuleData } from '../../module-content'\nimport { EnumDataApi } from '../../../types'\nimport { useTranslation } from 'react-i18next'\nimport ConditionModal, { ConditionListItemTypes } from '../components/condition-modal'\nimport { useDebounceFn, useMemoizedFn } from 'ahooks'\n\nexport type CalendarCustomeDataTypes = {\n dataSourceId?: string\n conditionData?: {\n conditionList: ConditionListItemTypes[]\n conditionType: 'all' | 'any'\n }\n startDateField?: string\n endDateField?: string\n titleField: string\n}\n\ninterface CustomDataProps {\n selectModuleData?: ModuleData\n onAllValuesChange?: ((values: any) => void) | undefined\n enumDataApi?: EnumDataApi\n}\nconst CustomData: React.FC<CustomDataProps> = ({\n selectModuleData,\n onAllValuesChange,\n enumDataApi,\n}) => {\n /* ============================== split =============================== */\n const { globalData } = useAppContext()\n const { t } = useTranslation()\n\n /* ============================== split =============================== */\n const initialValues = {\n dataSourceId: '',\n startDateField: '',\n endDateField: '',\n titleField: '',\n }\n const [form] = Form.useForm()\n const dataSourceId = Form.useWatch('dataSourceId', form)\n\n const getDataSourceOption = useMemoizedFn(() => {\n // 产品约定过滤字段\n const filterField: string[] = ['customers', 'vendors', 'payees']\n let ret = (globalData?.sourceData ?? []).filter(v => {\n return !filterField.includes(v.value)\n })\n return ret\n })\n\n const dataSourceOptions = useMemo(() => {\n return getDataSourceOption()\n }, [globalData?.sourceData])\n\n const getFieldOptions = useMemoizedFn((dataSourceId?: string) => {\n const list = globalData?.sourceData?.find(item => item.value === dataSourceId)?.fields ?? []\n return list\n })\n const { fieldOptions, timeFieldOptions } = useMemo(() => {\n const fieldOptions = getFieldOptions(dataSourceId)\n const timeFieldOptions = fieldOptions?.filter(item => item.type === 'timestamp')\n return {\n fieldOptions,\n timeFieldOptions,\n }\n }, [dataSourceId])\n\n /* ============================== split =============================== */\n const [isModalOpen, setIsModalOpen] = useState(false)\n const conditionDataRef = useRef()\n const [conditionData, setConditionData] = useState<any>({\n conditionList: [],\n conditionType: 'all',\n })\n const [conditionDataNum, setConditionDataNum] = useState(0)\n\n const setCondition = (val: any) => {\n setConditionData(val)\n conditionDataRef.current = val\n setConditionDataNum(val?.conditionList?.length || 0)\n }\n\n /* ============================== split =============================== */\n // debounc 2个作用 一个默认值的设置会延后,另一个是防止多次请求\n const { run: debounceSubmit } = useDebounceFn(\n useMemoizedFn(() => {\n onAllValuesChange?.({\n ...form.getFieldsValue(),\n conditionData: conditionDataRef.current,\n })\n }),\n {\n wait: 100,\n }\n )\n\n const handleValuesChange = useMemoizedFn((changedValues, allValues) => {\n if (changedValues.dataSourceId) {\n const newFieldOptions = getFieldOptions(changedValues.dataSourceId)\n const timeFieldOptions = fieldOptions.filter(item => item.type === 'timestamp')\n form.setFieldsValue({\n titleField: newFieldOptions?.[0]?.value,\n startDateField: timeFieldOptions?.[0]?.value,\n endDateField: timeFieldOptions?.[0]?.value,\n })\n }\n\n debounceSubmit()\n })\n\n useEffect(() => {\n if (selectModuleData?.customData) {\n const customData = selectModuleData.customData\n form.setFieldsValue(customData)\n } else {\n const dataSourceOptions = getDataSourceOption()\n const dataSourceId = dataSourceOptions?.[0]?.value\n const fieldOptions = getFieldOptions(dataSourceId)\n const timeFieldOptions = fieldOptions.filter(item => item.type === 'timestamp')\n form.setFieldsValue({\n ...initialValues,\n dataSourceId: dataSourceOptions,\n titleField: fieldOptions?.[0]?.value,\n startDateField: timeFieldOptions?.[0].value,\n endDateField: timeFieldOptions?.[0].value,\n })\n debounceSubmit()\n }\n setCondition(selectModuleData?.customData?.conditionData)\n }, [selectModuleData, globalData])\n\n return (\n <>\n <Form\n form={form}\n name=\"customData\"\n labelCol={{ span: 8 }}\n wrapperCol={{ span: 16 }}\n labelAlign=\"left\"\n onValuesChange={handleValuesChange}\n initialValues={initialValues}\n >\n <div\n style={{\n fontSize: '14px',\n marginBottom: '5px',\n }}\n >\n {t('data')}\n </div>\n\n <Form.Item<CalendarCustomeDataTypes> label={t('dataSource')} name=\"dataSourceId\">\n <Select options={dataSourceOptions} />\n </Form.Item>\n\n <Form.Item<CalendarCustomeDataTypes> label={t('dataRange')}>\n <Button\n style={{ marginLeft: '-15px' }}\n onClick={() => {\n setIsModalOpen(true)\n }}\n type=\"link\"\n >\n {t('filterData')}\n </Button>\n {conditionDataNum > 0 ? `${t('selectNcondition', { n: conditionDataNum })}` : null}\n </Form.Item>\n\n <Divider orientation=\"left\" orientationMargin=\"0\">\n {t('calendar.t1')}\n </Divider>\n\n <Form.Item<CalendarCustomeDataTypes> label={t('calendar.t2')} name=\"startDateField\">\n <Select options={timeFieldOptions} />\n </Form.Item>\n\n <Form.Item<CalendarCustomeDataTypes> label={t('calendar.t3')} name=\"endDateField\">\n <Select options={timeFieldOptions} />\n </Form.Item>\n\n <Form.Item<CalendarCustomeDataTypes> label={t('calendar.t4')} name=\"titleField\">\n <Select options={fieldOptions} />\n </Form.Item>\n </Form>\n <ConditionModal\n open={isModalOpen}\n value={conditionData}\n fieldOptions={fieldOptions}\n enumDataApi={enumDataApi}\n onClose={() => {\n setIsModalOpen(false)\n }}\n onOk={val => {\n setCondition(val)\n debounceSubmit()\n }}\n />\n </>\n )\n}\nexport default CustomData\n"],"names":["dataSourceId","fieldOptions","timeFieldOptions","dataSourceOptions"],"mappings":";;;;;;;AA2BA,MAAM,aAAwC,C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rC;AAAA,UAEC,oBAAA,KAAK,MAAL,EAAoC,OAAO,EAAE,aAAa,GAAG,MAAK,gBACjE,UAAA,oBAAC,QAAO,EAAA,SAAS,iBAAkB,CAAA,GACrC;AAAA,UAEC,oBAAA,KAAK,MAAL,EAAoC,OAAO,EAAE,aAAa,GAAG,MAAK,cACjE,UAAA,oBAAC,QAAO,EAAA,SAAS,cAAc,EACjC,CAAA;AAAA,QAAA;AAAA,MAAA;AAAA,IACF;AAAA,IACA;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,MAAM;AAAA,QACN,OAAO;AAAA,QACP;AAAA,QACA;AAAA,QACA,SAAS,MAAM;AACb,yBAAe,KAAK;AAAA,QACtB;AAAA,QACA,MAAM,CAAO,QAAA;AACX,uBAAa,GAAG;AACD,yBAAA;AAAA,QAAA;AAAA,MACjB;AAAA,IAAA;AAAA,EACF,GACF;AAEJ;"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { EnumDataApi, ModuleDataApi } from '../../../types';
|
|
3
|
+
import { ModuleData } from '../../module-content';
|
|
4
|
+
interface AddStatisticsModalProps {
|
|
5
|
+
open: boolean;
|
|
6
|
+
onClose?: () => void;
|
|
7
|
+
onOk?: (data: Partial<ModuleData>) => void;
|
|
8
|
+
selectModuleData?: ModuleData;
|
|
9
|
+
moduleDataApi?: ModuleDataApi;
|
|
10
|
+
enumDataApi?: EnumDataApi;
|
|
11
|
+
}
|
|
12
|
+
declare const AddStatisticsModal: React.FC<AddStatisticsModalProps>;
|
|
13
|
+
export default AddStatisticsModal;
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { jsx, Fragment, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useState, useEffect } from "react";
|
|
3
|
+
import { Modal, Button } from "antd";
|
|
4
|
+
import { CloseOutlined } from "@ant-design/icons";
|
|
5
|
+
import CustomData from "./custome-data.js";
|
|
6
|
+
import CalendarModule from "../../module-content/calendar-module/index.js";
|
|
7
|
+
import { useTranslation } from "react-i18next";
|
|
8
|
+
import { EditorHeader } from "../../ui/modal/editor-header.js";
|
|
9
|
+
const AddStatisticsModal = ({
|
|
10
|
+
open,
|
|
11
|
+
onClose,
|
|
12
|
+
onOk,
|
|
13
|
+
moduleDataApi,
|
|
14
|
+
selectModuleData,
|
|
15
|
+
enumDataApi
|
|
16
|
+
}) => {
|
|
17
|
+
const { t } = useTranslation();
|
|
18
|
+
const [customData, setCustomData] = useState();
|
|
19
|
+
useEffect(() => {
|
|
20
|
+
if (selectModuleData) {
|
|
21
|
+
setCustomData(selectModuleData == null ? void 0 : selectModuleData.customData);
|
|
22
|
+
}
|
|
23
|
+
}, [selectModuleData]);
|
|
24
|
+
const [title, setTitle] = useState("");
|
|
25
|
+
useEffect(() => {
|
|
26
|
+
if (open) {
|
|
27
|
+
setTitle((selectModuleData == null ? void 0 : selectModuleData.title) ? selectModuleData == null ? void 0 : selectModuleData.title : t("calendarText"));
|
|
28
|
+
}
|
|
29
|
+
}, [open]);
|
|
30
|
+
return /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
|
|
31
|
+
Modal,
|
|
32
|
+
{
|
|
33
|
+
width: "65%",
|
|
34
|
+
title: /* @__PURE__ */ jsx(EditorHeader, { value: title, onChange: setTitle }),
|
|
35
|
+
footer: null,
|
|
36
|
+
open,
|
|
37
|
+
onCancel: onClose,
|
|
38
|
+
closeIcon: /* @__PURE__ */ jsx(CloseOutlined, {}),
|
|
39
|
+
className: "ow",
|
|
40
|
+
children: /* @__PURE__ */ jsxs("div", { className: "config-widget-dialog-container", children: [
|
|
41
|
+
/* @__PURE__ */ jsx("div", { className: "config-widget-dialog-content", children: /* @__PURE__ */ jsx(
|
|
42
|
+
"div",
|
|
43
|
+
{
|
|
44
|
+
className: "config-widget-dialog-preview",
|
|
45
|
+
style: { borderRight: "1px solid #e0e0e0" },
|
|
46
|
+
children: /* @__PURE__ */ jsx(CalendarModule, { customData, moduleDataApi })
|
|
47
|
+
}
|
|
48
|
+
) }),
|
|
49
|
+
/* @__PURE__ */ jsxs("div", { className: "config-widget-dialog-panel", style: { borderLeft: "none" }, children: [
|
|
50
|
+
/* @__PURE__ */ jsx("div", { className: "bitable-dashboard edit-panel-container", style: { paddingTop: "20px" }, children: /* @__PURE__ */ jsx(
|
|
51
|
+
CustomData,
|
|
52
|
+
{
|
|
53
|
+
enumDataApi,
|
|
54
|
+
selectModuleData,
|
|
55
|
+
onAllValuesChange: (allVal) => {
|
|
56
|
+
setCustomData(allVal);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
) }),
|
|
60
|
+
/* @__PURE__ */ jsx("div", { className: "button-container", children: /* @__PURE__ */ jsx(
|
|
61
|
+
Button,
|
|
62
|
+
{
|
|
63
|
+
type: "primary",
|
|
64
|
+
onClick: () => {
|
|
65
|
+
onOk == null ? void 0 : onOk({
|
|
66
|
+
id: selectModuleData == null ? void 0 : selectModuleData.id,
|
|
67
|
+
customData,
|
|
68
|
+
title
|
|
69
|
+
});
|
|
70
|
+
},
|
|
71
|
+
children: t("confirm")
|
|
72
|
+
}
|
|
73
|
+
) })
|
|
74
|
+
] })
|
|
75
|
+
] })
|
|
76
|
+
}
|
|
77
|
+
) });
|
|
78
|
+
};
|
|
79
|
+
export {
|
|
80
|
+
AddStatisticsModal as default
|
|
81
|
+
};
|
|
82
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../../packages/dashboard-workbench/components/add-module-modal/add-calendar-modal/index.tsx"],"sourcesContent":["import React, { useEffect, useState } from 'react'\nimport { Button, Modal } from 'antd'\nimport { CloseOutlined } from '@ant-design/icons'\nimport CustomData, { CalendarCustomeDataTypes } from './custome-data'\nimport { EnumDataApi, ModuleDataApi } from '../../../types'\nimport CalendarModule from '../../module-content/calendar-module'\nimport { ModuleData } from '../../module-content'\nimport { useTranslation } from 'react-i18next'\nimport EditorHeader from '@platox/pivot-table/dashboard-workbench/components/ui/modal/editor-header'\n\ninterface AddStatisticsModalProps {\n open: boolean\n onClose?: () => void\n onOk?: (data: Partial<ModuleData>) => void\n\n selectModuleData?: ModuleData\n moduleDataApi?: ModuleDataApi\n enumDataApi?: EnumDataApi\n}\n\nconst AddStatisticsModal: React.FC<AddStatisticsModalProps> = ({\n open,\n onClose,\n onOk,\n moduleDataApi,\n selectModuleData,\n enumDataApi,\n}) => {\n const { t } = useTranslation()\n const [customData, setCustomData] = useState<CalendarCustomeDataTypes>()\n\n useEffect(() => {\n if (selectModuleData) {\n setCustomData(selectModuleData?.customData)\n }\n }, [selectModuleData])\n\n /* ============================== split =============================== */\n const [title, setTitle] = useState<string>('')\n useEffect(() => {\n if (open) {\n setTitle(selectModuleData?.title ? selectModuleData?.title : t('calendarText'))\n }\n }, [open])\n\n return (\n <>\n <Modal\n width=\"65%\"\n title={<EditorHeader value={title} onChange={setTitle} />}\n footer={null}\n open={open}\n onCancel={onClose}\n closeIcon={<CloseOutlined />}\n className=\"ow\"\n >\n <div className=\"config-widget-dialog-container\">\n <div className=\"config-widget-dialog-content\">\n <div\n className=\"config-widget-dialog-preview\"\n style={{ borderRight: '1px solid #e0e0e0' }}\n >\n <CalendarModule customData={customData} moduleDataApi={moduleDataApi} />\n </div>\n </div>\n <div className=\"config-widget-dialog-panel\" style={{ borderLeft: 'none' }}>\n <div className=\"bitable-dashboard edit-panel-container\" style={{ paddingTop: '20px' }}>\n <CustomData\n enumDataApi={enumDataApi}\n selectModuleData={selectModuleData}\n onAllValuesChange={allVal => {\n setCustomData(allVal)\n }}\n />\n </div>\n <div className=\"button-container\">\n <Button\n type=\"primary\"\n onClick={() => {\n onOk?.({\n id: selectModuleData?.id,\n customData,\n title,\n })\n }}\n >\n {t('confirm')}\n </Button>\n </div>\n </div>\n </div>\n </Modal>\n </>\n )\n}\n\nexport default AddStatisticsModal\n"],"names":[],"mappings":";;;;;;;;AAoBA,MAAM,qBAAwD,CAAC;AAAA,EA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,YACtB;AAAA,UAAA,GAEJ;AAAA,UACA,oBAAC,OAAI,EAAA,WAAU,oBACb,UAAA;AAAA,YAAC;AAAA,YAAA;AAAA,cACC,MAAK;AAAA,cACL,SAAS,MAAM;AACN,6CAAA;AAAA,kBACL,IAAI,qDAAkB;AAAA,kBACtB;AAAA,kBACA;AAAA,gBAAA;AAAA,cAEJ;AAAA,cAEC,YAAE,SAAS;AAAA,YAAA;AAAA,UAAA,EAEhB,CAAA;AAAA,QAAA,EACF,CAAA;AAAA,MAAA,EACF,CAAA;AAAA,IAAA;AAAA,EAAA,GAEJ;AAEJ;"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { ModuleData } from '../../module-content';
|
|
2
|
+
import { EnumDataApi } from '../../../types';
|
|
3
|
+
import { ConditionListItemTypes } from '../components/condition-modal';
|
|
4
|
+
declare const chartOption: readonly ["legend", "label", "axis", "splitLine"];
|
|
5
|
+
type ChartOptionItem = (typeof chartOption)[number];
|
|
6
|
+
export type ChartCustomeDataTypes = {
|
|
7
|
+
conditionData?: {
|
|
8
|
+
conditionList: ConditionListItemTypes[];
|
|
9
|
+
conditionType: 'all' | 'any';
|
|
10
|
+
};
|
|
11
|
+
dataSourceId?: string;
|
|
12
|
+
type: 'chart-bar' | 'chart-bar-pile' | 'chart-bar-percentage' | 'chart-line' | 'chart-line-smooth' | 'chart-strip-bar' | 'chart-strip-bar-pile' | 'chart-strip-bar-percentage' | 'chart-pie' | 'chart-pie-circular';
|
|
13
|
+
xAxis: string;
|
|
14
|
+
yAxis: 'recordTotal' | 'fieldValue';
|
|
15
|
+
yAxisField: string;
|
|
16
|
+
yAxisFieldType: 'sum' | 'max' | 'min' | 'avg';
|
|
17
|
+
groupField: string;
|
|
18
|
+
isGroup: boolean;
|
|
19
|
+
chartOptions: ChartOptionItem[];
|
|
20
|
+
sortField: 'xAxis' | 'yAxisField' | 'recordValue';
|
|
21
|
+
sortOrder: 'asc' | 'desc';
|
|
22
|
+
};
|
|
23
|
+
interface CustomDataProps {
|
|
24
|
+
selectModuleData?: ModuleData;
|
|
25
|
+
onAllValuesChange?: ((values: any) => void) | undefined;
|
|
26
|
+
enumDataApi?: EnumDataApi;
|
|
27
|
+
}
|
|
28
|
+
declare const CustomData: React.FC<CustomDataProps>;
|
|
29
|
+
export default CustomData;
|