@platox/pivot-table 0.0.32 → 0.0.34

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.
Files changed (148) hide show
  1. package/es/dashboard-workbench/components/add-module-btn/index.d.ts +11 -0
  2. package/es/dashboard-workbench/components/add-module-btn/index.js +97 -0
  3. package/es/dashboard-workbench/components/add-module-btn/index.js.map +1 -0
  4. package/es/dashboard-workbench/components/add-module-modal/add-calendar-modal/custome-data.d.ts +20 -0
  5. package/es/dashboard-workbench/components/add-module-modal/add-calendar-modal/custome-data.js +178 -0
  6. package/es/dashboard-workbench/components/add-module-modal/add-calendar-modal/custome-data.js.map +1 -0
  7. package/es/dashboard-workbench/components/add-module-modal/add-calendar-modal/index.d.ts +17 -0
  8. package/es/dashboard-workbench/components/add-module-modal/add-calendar-modal/index.js +91 -0
  9. package/es/dashboard-workbench/components/add-module-modal/add-calendar-modal/index.js.map +1 -0
  10. package/es/dashboard-workbench/components/add-module-modal/add-chart-modal/custome-data.d.ts +27 -0
  11. package/es/dashboard-workbench/components/add-module-modal/add-chart-modal/custome-data.js +328 -0
  12. package/es/dashboard-workbench/components/add-module-modal/add-chart-modal/custome-data.js.map +1 -0
  13. package/es/dashboard-workbench/components/add-module-modal/add-chart-modal/custome-styles.d.ts +15 -0
  14. package/es/dashboard-workbench/components/add-module-modal/add-chart-modal/custome-styles.js +58 -0
  15. package/es/dashboard-workbench/components/add-module-modal/add-chart-modal/custome-styles.js.map +1 -0
  16. package/es/dashboard-workbench/components/add-module-modal/add-chart-modal/index.d.ts +20 -0
  17. package/es/dashboard-workbench/components/add-module-modal/add-chart-modal/index.js +123 -0
  18. package/es/dashboard-workbench/components/add-module-modal/add-chart-modal/index.js.map +1 -0
  19. package/es/dashboard-workbench/components/add-module-modal/add-statistics-modal/custome-data.d.ts +20 -0
  20. package/es/dashboard-workbench/components/add-module-modal/add-statistics-modal/custome-data.js +180 -0
  21. package/es/dashboard-workbench/components/add-module-modal/add-statistics-modal/custome-data.js.map +1 -0
  22. package/es/dashboard-workbench/components/add-module-modal/add-statistics-modal/custome-styles.d.ts +13 -0
  23. package/es/dashboard-workbench/components/add-module-modal/add-statistics-modal/custome-styles.js +119 -0
  24. package/es/dashboard-workbench/components/add-module-modal/add-statistics-modal/custome-styles.js.map +1 -0
  25. package/es/dashboard-workbench/components/add-module-modal/add-statistics-modal/index.d.ts +19 -0
  26. package/es/dashboard-workbench/components/add-module-modal/add-statistics-modal/index.js +120 -0
  27. package/es/dashboard-workbench/components/add-module-modal/add-statistics-modal/index.js.map +1 -0
  28. package/es/dashboard-workbench/components/add-module-modal/components/condition-modal/debounce-select.d.ts +12 -0
  29. package/es/dashboard-workbench/components/add-module-modal/components/condition-modal/debounce-select.js +44 -0
  30. package/es/dashboard-workbench/components/add-module-modal/components/condition-modal/debounce-select.js.map +1 -0
  31. package/es/dashboard-workbench/components/add-module-modal/components/condition-modal/index.d.ts +21 -0
  32. package/es/dashboard-workbench/components/add-module-modal/components/condition-modal/index.js +510 -0
  33. package/es/dashboard-workbench/components/add-module-modal/components/condition-modal/index.js.map +1 -0
  34. package/es/dashboard-workbench/components/add-module-modal/components/condition-modal/utils.d.ts +25 -0
  35. package/es/dashboard-workbench/components/add-module-modal/components/select-color/index.d.ts +12 -0
  36. package/es/dashboard-workbench/components/add-module-modal/components/select-color/index.js +45 -0
  37. package/es/dashboard-workbench/components/add-module-modal/components/select-color/index.js.map +1 -0
  38. package/es/dashboard-workbench/components/module-content/calendar-module/index.d.ts +14 -0
  39. package/es/dashboard-workbench/components/module-content/calendar-module/index.js +231 -0
  40. package/es/dashboard-workbench/components/module-content/calendar-module/index.js.map +1 -0
  41. package/es/dashboard-workbench/components/module-content/chart-module/base-chart/index.d.ts +8 -0
  42. package/es/dashboard-workbench/components/module-content/chart-module/base-chart/index.js +62 -0
  43. package/es/dashboard-workbench/components/module-content/chart-module/base-chart/index.js.map +1 -0
  44. package/es/dashboard-workbench/components/module-content/chart-module/index.d.ts +14 -0
  45. package/es/dashboard-workbench/components/module-content/chart-module/index.js +384 -0
  46. package/es/dashboard-workbench/components/module-content/chart-module/index.js.map +1 -0
  47. package/es/dashboard-workbench/components/module-content/chart-module/utils.d.ts +9 -0
  48. package/es/dashboard-workbench/components/module-content/chart-module/utils.js +200 -0
  49. package/es/dashboard-workbench/components/module-content/chart-module/utils.js.map +1 -0
  50. package/es/dashboard-workbench/components/module-content/index.d.ts +31 -0
  51. package/es/dashboard-workbench/components/module-content/index.js +81 -0
  52. package/es/dashboard-workbench/components/module-content/index.js.map +1 -0
  53. package/es/dashboard-workbench/components/module-content/statistics-module/index.d.ts +15 -0
  54. package/es/dashboard-workbench/components/module-content/statistics-module/index.js +305 -0
  55. package/es/dashboard-workbench/components/module-content/statistics-module/index.js.map +1 -0
  56. package/es/dashboard-workbench/components/module-content/statistics-module/utils.d.ts +4 -0
  57. package/es/dashboard-workbench/components/module-content/statistics-module/utils.js +41 -0
  58. package/es/dashboard-workbench/components/module-content/statistics-module/utils.js.map +1 -0
  59. package/es/dashboard-workbench/components/module-content/text-module/editor/index.d.ts +7 -0
  60. package/es/dashboard-workbench/components/module-content/text-module/editor/index.js +224 -0
  61. package/es/dashboard-workbench/components/module-content/text-module/editor/index.js.map +1 -0
  62. package/es/dashboard-workbench/components/module-content/text-module/editor/useDebounce.d.ts +2 -0
  63. package/es/dashboard-workbench/components/module-content/text-module/editor/useDebounce.js +24 -0
  64. package/es/dashboard-workbench/components/module-content/text-module/editor/useDebounce.js.map +1 -0
  65. package/es/dashboard-workbench/components/module-content/text-module/index.d.ts +7 -0
  66. package/es/dashboard-workbench/components/module-content/text-module/index.js +11 -0
  67. package/es/dashboard-workbench/components/module-content/text-module/index.js.map +1 -0
  68. package/es/dashboard-workbench/components/module-content/utils.d.ts +15 -0
  69. package/es/dashboard-workbench/components/module-content/utils.js +113 -0
  70. package/es/dashboard-workbench/components/module-content/utils.js.map +1 -0
  71. package/es/dashboard-workbench/components/module-header/index.d.ts +12 -0
  72. package/es/dashboard-workbench/components/module-header/index.js +115 -0
  73. package/es/dashboard-workbench/components/module-header/index.js.map +1 -0
  74. package/es/dashboard-workbench/context.d.ts +16 -0
  75. package/es/dashboard-workbench/context.js +21 -0
  76. package/es/dashboard-workbench/context.js.map +1 -0
  77. package/es/dashboard-workbench/icon/icon-bar-percentage.d.ts +2 -0
  78. package/es/dashboard-workbench/icon/icon-bar-percentage.js +17 -0
  79. package/es/dashboard-workbench/icon/icon-bar-percentage.js.map +1 -0
  80. package/es/dashboard-workbench/icon/icon-bar-pile.d.ts +2 -0
  81. package/es/dashboard-workbench/icon/icon-bar-pile.js +17 -0
  82. package/es/dashboard-workbench/icon/icon-bar-pile.js.map +1 -0
  83. package/es/dashboard-workbench/icon/icon-bar.d.ts +2 -0
  84. package/es/dashboard-workbench/icon/icon-bar.js +13 -0
  85. package/es/dashboard-workbench/icon/icon-bar.js.map +1 -0
  86. package/es/dashboard-workbench/icon/icon-calendar.d.ts +2 -0
  87. package/es/dashboard-workbench/icon/icon-calendar.js +40 -0
  88. package/es/dashboard-workbench/icon/icon-calendar.js.map +1 -0
  89. package/es/dashboard-workbench/icon/icon-drag.d.ts +2 -0
  90. package/es/dashboard-workbench/icon/icon-drag.js +25 -0
  91. package/es/dashboard-workbench/icon/icon-drag.js.map +1 -0
  92. package/es/dashboard-workbench/icon/icon-editor.d.ts +2 -0
  93. package/es/dashboard-workbench/icon/icon-editor.js +40 -0
  94. package/es/dashboard-workbench/icon/icon-editor.js.map +1 -0
  95. package/es/dashboard-workbench/icon/icon-line-smooth.d.ts +2 -0
  96. package/es/dashboard-workbench/icon/icon-line-smooth.js +28 -0
  97. package/es/dashboard-workbench/icon/icon-line-smooth.js.map +1 -0
  98. package/es/dashboard-workbench/icon/icon-line.d.ts +2 -0
  99. package/es/dashboard-workbench/icon/icon-line.js +28 -0
  100. package/es/dashboard-workbench/icon/icon-line.js.map +1 -0
  101. package/es/dashboard-workbench/icon/icon-move.d.ts +2 -0
  102. package/es/dashboard-workbench/icon/icon-move.js +25 -0
  103. package/es/dashboard-workbench/icon/icon-move.js.map +1 -0
  104. package/es/dashboard-workbench/icon/icon-pie-circular.d.ts +2 -0
  105. package/es/dashboard-workbench/icon/icon-pie-circular.js +30 -0
  106. package/es/dashboard-workbench/icon/icon-pie-circular.js.map +1 -0
  107. package/es/dashboard-workbench/icon/icon-pie.d.ts +2 -0
  108. package/es/dashboard-workbench/icon/icon-pie.js +24 -0
  109. package/es/dashboard-workbench/icon/icon-pie.js.map +1 -0
  110. package/es/dashboard-workbench/icon/icon-statistics.d.ts +2 -0
  111. package/es/dashboard-workbench/icon/icon-statistics.js +37 -0
  112. package/es/dashboard-workbench/icon/icon-statistics.js.map +1 -0
  113. package/es/dashboard-workbench/icon/icon-strip-bar-percentage.d.ts +2 -0
  114. package/es/dashboard-workbench/icon/icon-strip-bar-percentage.js +105 -0
  115. package/es/dashboard-workbench/icon/icon-strip-bar-percentage.js.map +1 -0
  116. package/es/dashboard-workbench/icon/icon-strip-bar-pile.d.ts +2 -0
  117. package/es/dashboard-workbench/icon/icon-strip-bar-pile.js +105 -0
  118. package/es/dashboard-workbench/icon/icon-strip-bar-pile.js.map +1 -0
  119. package/es/dashboard-workbench/icon/icon-strip-bar.d.ts +2 -0
  120. package/es/dashboard-workbench/icon/icon-strip-bar.js +57 -0
  121. package/es/dashboard-workbench/icon/icon-strip-bar.js.map +1 -0
  122. package/es/dashboard-workbench/index.d.ts +33 -0
  123. package/es/dashboard-workbench/index.js +435 -0
  124. package/es/dashboard-workbench/index.js.map +1 -0
  125. package/es/dashboard-workbench/lang/en-US.d.ts +146 -0
  126. package/es/dashboard-workbench/lang/en-US.js +157 -0
  127. package/es/dashboard-workbench/lang/en-US.js.map +1 -0
  128. package/es/dashboard-workbench/lang/index.d.ts +2 -0
  129. package/es/dashboard-workbench/lang/index.js +25 -0
  130. package/es/dashboard-workbench/lang/index.js.map +1 -0
  131. package/es/dashboard-workbench/lang/zh-CN.d.ts +146 -0
  132. package/es/dashboard-workbench/lang/zh-CN.js +157 -0
  133. package/es/dashboard-workbench/lang/zh-CN.js.map +1 -0
  134. package/es/dashboard-workbench/types.d.ts +22 -0
  135. package/es/dashboard-workbench/utils/index.d.ts +9 -0
  136. package/es/dashboard-workbench/utils/index.js +30 -0
  137. package/es/dashboard-workbench/utils/index.js.map +1 -0
  138. package/es/index.d.ts +1 -0
  139. package/es/index.js +5 -0
  140. package/es/index.js.map +1 -0
  141. package/es/style.css +1 -0
  142. package/package.json +27 -24
  143. package/umd/pivot-table.umd.cjs +178 -0
  144. package/umd/style.css +1 -0
  145. package/index.d.ts +0 -98
  146. package/lib/index.js +0 -52233
  147. package/lib/index.umd.cjs +0 -178
  148. 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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AEC,SAAS,MAAM;AACb,oBAAM,MAAM,IAA+B;AAAA,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;"}
@@ -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,178 @@
1
+ import { jsxs, Fragment, jsx } from "react/jsx-runtime";
2
+ import { Form, Select, Button, Divider } from "antd";
3
+ import { 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
+ const CustomData = ({
8
+ selectModuleData,
9
+ onAllValuesChange,
10
+ enumDataApi
11
+ }) => {
12
+ const { globalData } = useAppContext();
13
+ const [form] = Form.useForm();
14
+ const [fieldOptions, setFieldOptions] = useState();
15
+ const [isModalOpen, setIsModalOpen] = useState(false);
16
+ const conditionDataRef = useRef();
17
+ const [conditionData, setConditionData] = useState({
18
+ conditionList: [],
19
+ conditionType: "all"
20
+ });
21
+ const [conditionDataNum, setConditionDataNum] = useState(0);
22
+ const [timeFieldOptions, setTimeFieldOptions] = useState();
23
+ const { t } = useTranslation();
24
+ const initialValues = {
25
+ dataSourceId: "",
26
+ startDateField: "",
27
+ endDateField: "",
28
+ titleField: ""
29
+ };
30
+ const allValuesChange = () => {
31
+ setTimeout(() => {
32
+ onAllValuesChange == null ? void 0 : onAllValuesChange({
33
+ ...form.getFieldsValue(),
34
+ conditionData: conditionDataRef.current
35
+ });
36
+ });
37
+ };
38
+ const getFieldOptions = (name) => {
39
+ var _a, _b;
40
+ const list = (_b = (_a = globalData == null ? void 0 : globalData.sourceData) == null ? void 0 : _a.find((item) => item.value === name)) == null ? void 0 : _b.fields;
41
+ setFieldOptions(list);
42
+ let timeFieldOptions2 = list == null ? void 0 : list.filter((item) => item.type === "timestamp");
43
+ setTimeFieldOptions(list == null ? void 0 : list.filter((item) => item.type === "timestamp"));
44
+ return {
45
+ list,
46
+ timeFieldOptions: timeFieldOptions2
47
+ };
48
+ };
49
+ const setCondition = (val) => {
50
+ var _a;
51
+ setConditionData(val);
52
+ conditionDataRef.current = val;
53
+ setConditionDataNum(((_a = val == null ? void 0 : val.conditionList) == null ? void 0 : _a.length) || 0);
54
+ };
55
+ useEffect(() => {
56
+ var _a, _b, _c, _d, _e, _f;
57
+ if (selectModuleData == null ? void 0 : selectModuleData.customData) {
58
+ form.setFieldsValue(selectModuleData.customData);
59
+ getFieldOptions((_a = selectModuleData == null ? void 0 : selectModuleData.customData) == null ? void 0 : _a.dataSourceId);
60
+ } else {
61
+ const list = (_b = globalData == null ? void 0 : globalData.sourceData) == null ? void 0 : _b[0];
62
+ const times = (_c = list == null ? void 0 : list.fields) == null ? void 0 : _c.filter((item) => item.type === "timestamp");
63
+ form.setFieldsValue({
64
+ ...initialValues,
65
+ dataSourceId: list == null ? void 0 : list.value,
66
+ titleField: (_e = (_d = list == null ? void 0 : list.fields) == null ? void 0 : _d[0]) == null ? void 0 : _e.value,
67
+ startDateField: times == null ? void 0 : times[0].value,
68
+ endDateField: times == null ? void 0 : times[0].value
69
+ });
70
+ getFieldOptions(list == null ? void 0 : list.value);
71
+ allValuesChange();
72
+ }
73
+ setCondition((_f = selectModuleData == null ? void 0 : selectModuleData.customData) == null ? void 0 : _f.conditionData);
74
+ }, [selectModuleData, globalData]);
75
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
76
+ /* @__PURE__ */ jsxs(
77
+ Form,
78
+ {
79
+ form,
80
+ name: "customData",
81
+ labelCol: { span: 8 },
82
+ wrapperCol: { span: 16 },
83
+ labelAlign: "left",
84
+ initialValues,
85
+ children: [
86
+ /* @__PURE__ */ jsx(
87
+ "div",
88
+ {
89
+ style: {
90
+ fontSize: "14px",
91
+ marginBottom: "5px"
92
+ },
93
+ children: t("data")
94
+ }
95
+ ),
96
+ /* @__PURE__ */ jsx(Form.Item, { label: t("dataSource"), name: "dataSourceId", children: /* @__PURE__ */ jsx(
97
+ Select,
98
+ {
99
+ options: globalData == null ? void 0 : globalData.sourceData,
100
+ onChange: (val) => {
101
+ var _a, _b, _c;
102
+ const { list, timeFieldOptions: timeFieldOptions2 } = getFieldOptions(val);
103
+ form.setFieldsValue({
104
+ titleField: (_a = list == null ? void 0 : list[0]) == null ? void 0 : _a.value,
105
+ startDateField: (_b = timeFieldOptions2 == null ? void 0 : timeFieldOptions2[0]) == null ? void 0 : _b.value,
106
+ endDateField: (_c = timeFieldOptions2 == null ? void 0 : timeFieldOptions2[0]) == null ? void 0 : _c.value
107
+ });
108
+ allValuesChange();
109
+ }
110
+ }
111
+ ) }),
112
+ /* @__PURE__ */ jsxs(Form.Item, { label: t("dataRange"), children: [
113
+ /* @__PURE__ */ jsx(
114
+ Button,
115
+ {
116
+ style: { marginLeft: "-15px" },
117
+ onClick: () => {
118
+ setIsModalOpen(true);
119
+ },
120
+ type: "link",
121
+ children: t("filterData")
122
+ }
123
+ ),
124
+ conditionDataNum > 0 ? `${t("selectNcondition", { n: conditionDataNum })}` : null
125
+ ] }),
126
+ /* @__PURE__ */ jsx(Divider, { orientation: "left", orientationMargin: "0", children: t("calendar.t1") }),
127
+ /* @__PURE__ */ jsx(Form.Item, { label: t("calendar.t2"), name: "startDateField", children: /* @__PURE__ */ jsx(
128
+ Select,
129
+ {
130
+ onChange: () => {
131
+ allValuesChange();
132
+ },
133
+ options: timeFieldOptions
134
+ }
135
+ ) }),
136
+ /* @__PURE__ */ jsx(Form.Item, { label: t("calendar.t3"), name: "endDateField", children: /* @__PURE__ */ jsx(
137
+ Select,
138
+ {
139
+ onChange: () => {
140
+ allValuesChange();
141
+ },
142
+ options: timeFieldOptions
143
+ }
144
+ ) }),
145
+ /* @__PURE__ */ jsx(Form.Item, { label: t("calendar.t4"), name: "titleField", children: /* @__PURE__ */ jsx(
146
+ Select,
147
+ {
148
+ onChange: () => {
149
+ allValuesChange();
150
+ },
151
+ options: fieldOptions
152
+ }
153
+ ) })
154
+ ]
155
+ }
156
+ ),
157
+ /* @__PURE__ */ jsx(
158
+ ConditionModal,
159
+ {
160
+ open: isModalOpen,
161
+ value: conditionData,
162
+ fieldOptions,
163
+ enumDataApi,
164
+ onClose: () => {
165
+ setIsModalOpen(false);
166
+ },
167
+ onOk: (val) => {
168
+ setCondition(val);
169
+ allValuesChange();
170
+ }
171
+ }
172
+ )
173
+ ] });
174
+ };
175
+ export {
176
+ CustomData as default
177
+ };
178
+ //# sourceMappingURL=custome-data.js.map
@@ -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, useRef, useState } from 'react'\nimport { useAppContext } from '../../../context'\nimport { ModuleData } from '../../module-content'\nimport { EnumDataApi, SourceDataFieldsTypes } from '../../../types'\nimport { useTranslation } from 'react-i18next'\nimport ConditionModal, { ConditionListItemTypes } from '../components/condition-modal'\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 const { globalData } = useAppContext()\n const [form] = Form.useForm()\n const [fieldOptions, setFieldOptions] = useState<SourceDataFieldsTypes[]>()\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 const [timeFieldOptions, setTimeFieldOptions] = useState<SourceDataFieldsTypes[]>()\n const { t } = useTranslation()\n\n const initialValues = {\n dataSourceId: '',\n startDateField: '',\n endDateField: '',\n titleField: '',\n }\n\n const allValuesChange = () => {\n setTimeout(() => {\n onAllValuesChange?.({\n ...form.getFieldsValue(),\n conditionData: conditionDataRef.current,\n })\n })\n }\n\n const getFieldOptions = (name?: string) => {\n const list = globalData?.sourceData?.find(item => item.value === name)?.fields\n setFieldOptions(list)\n let timeFieldOptions = list?.filter(item => item.type === 'timestamp')\n setTimeFieldOptions(list?.filter(item => item.type === 'timestamp'))\n return {\n list,\n timeFieldOptions,\n }\n }\n\n const setCondition = (val: any) => {\n setConditionData(val)\n conditionDataRef.current = val\n setConditionDataNum(val?.conditionList?.length || 0)\n }\n\n useEffect(() => {\n if (selectModuleData?.customData) {\n form.setFieldsValue(selectModuleData.customData)\n getFieldOptions(selectModuleData?.customData?.dataSourceId)\n } else {\n const list = globalData?.sourceData?.[0]\n const times = list?.fields?.filter(item => item.type === 'timestamp')\n form.setFieldsValue({\n ...initialValues,\n dataSourceId: list?.value,\n titleField: list?.fields?.[0]?.value,\n startDateField: times?.[0].value,\n endDateField: times?.[0].value,\n })\n getFieldOptions(list?.value)\n allValuesChange()\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 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\n options={globalData?.sourceData}\n onChange={val => {\n const { list, timeFieldOptions } = getFieldOptions(val)\n form.setFieldsValue({\n titleField: list?.[0]?.value,\n startDateField: timeFieldOptions?.[0]?.value,\n endDateField: timeFieldOptions?.[0]?.value,\n })\n allValuesChange()\n }}\n />\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\n onChange={() => {\n allValuesChange()\n }}\n options={timeFieldOptions}\n />\n </Form.Item>\n\n <Form.Item<CalendarCustomeDataTypes> label={t('calendar.t3')} name=\"endDateField\">\n <Select\n onChange={() => {\n allValuesChange()\n }}\n options={timeFieldOptions}\n />\n </Form.Item>\n\n <Form.Item<CalendarCustomeDataTypes> label={t('calendar.t4')} name=\"titleField\">\n <Select\n onChange={() => {\n allValuesChange()\n }}\n options={fieldOptions}\n />\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 allValuesChange()\n }}\n />\n </>\n )\n}\nexport default CustomData\n"],"names":["timeFieldOptions"],"mappings":";;;;;;AA0BA,MAAM,aAAwC,CAAC;AAAA,EAC7C;AAAA,EACA;AAAA,EACA;AACF,MAAM;AACE,QAAA,EAAE,WAAW,IAAI,cAAc;AACrC,QAAM,CAAC,IAAI,IAAI,KAAK,QAAQ;AAC5B,QAAM,CAAC,cAAc,eAAe,IAAI,SAAkC;AAC1E,QAAM,CAAC,aAAa,cAAc,IAAI,SAAS,KAAK;AACpD,QAAM,mBAAmB,OAAO;AAChC,QAAM,CAAC,eAAe,gBAAgB,IAAI,SAAc;AAAA,IACtD,eAAe,CAAC;AAAA,IAChB,eAAe;AAAA,EAAA,CAChB;AACD,QAAM,CAAC,kBAAkB,mBAAmB,IAAI,SAAS,CAAC;AAC1D,QAAM,CAAC,kBAAkB,mBAAmB,IAAI,SAAkC;AAC5E,QAAA,EAAE,EAAE,IAAI,eAAe;AAE7B,QAAM,gBAAgB;AAAA,IACpB,cAAc;AAAA,IACd,gBAAgB;AAAA,IAChB,cAAc;AAAA,IACd,YAAY;AAAA,EACd;AAEA,QAAM,kBAAkB,MAAM;AAC5B,eAAW,MAAM;AACK,6DAAA;AAAA,QAClB,GAAG,KAAK,eAAe;AAAA,QACvB,eAAe,iBAAiB;AAAA,MAAA;AAAA,IACjC,CACF;AAAA,EACH;AAEM,QAAA,kBAAkB,CAAC,SAAkB;;AACnC,UAAA,QAAO,oDAAY,eAAZ,mBAAwB,KAAK,UAAQ,KAAK,UAAU,UAApD,mBAA2D;AACxE,oBAAgB,IAAI;AACpB,QAAIA,oBAAmB,6BAAM,OAAO,CAAQ,SAAA,KAAK,SAAS;AAC1D,wBAAoB,6BAAM,OAAO,CAAA,SAA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;AAAA,UAEA,oBAAC,KAAK,MAAL,EAAoC,OAAO,EAAE,aAAa,GAAG,MAAK,cACjE,UAAA;AAAA,YAAC;AAAA,YAAA;AAAA,cACC,UAAU,MAAM;AACE,gCAAA;AAAA,cAClB;AAAA,cACA,SAAS;AAAA,YAAA;AAAA,UAAA,EAEb,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;AACA,0BAAA;AAAA,QAAA;AAAA,MAClB;AAAA,IAAA;AAAA,EACF,GACF;AAEJ;"}
@@ -0,0 +1,17 @@
1
+ import { default as React } from 'react';
2
+ import { CalendarCustomeDataTypes } from './custome-data';
3
+ import { EnumDataApi, ModuleDataApi } from '../../../types';
4
+ import { ModuleData } from '../../module-content';
5
+ interface AddStatisticsModalProps {
6
+ open: boolean;
7
+ onClose?: () => void;
8
+ selectModuleData?: ModuleData;
9
+ onOk?: ({ id, customData, }: {
10
+ id?: ModuleData['id'];
11
+ customData?: CalendarCustomeDataTypes;
12
+ }) => void;
13
+ moduleDataApi?: ModuleDataApi;
14
+ enumDataApi?: EnumDataApi;
15
+ }
16
+ declare const AddStatisticsModal: React.FC<AddStatisticsModalProps>;
17
+ export default AddStatisticsModal;
@@ -0,0 +1,91 @@
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
+ const AddStatisticsModal = ({
9
+ open,
10
+ onClose,
11
+ onOk,
12
+ moduleDataApi,
13
+ selectModuleData,
14
+ enumDataApi
15
+ }) => {
16
+ const { t } = useTranslation();
17
+ const [customData, setCustomData] = useState();
18
+ const handleOk = () => {
19
+ onClose == null ? void 0 : onClose();
20
+ };
21
+ useEffect(() => {
22
+ if (selectModuleData) {
23
+ setCustomData(selectModuleData == null ? void 0 : selectModuleData.customData);
24
+ }
25
+ }, [selectModuleData]);
26
+ return /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
27
+ Modal,
28
+ {
29
+ width: "65%",
30
+ title: t("calendarText"),
31
+ footer: null,
32
+ open,
33
+ onOk: handleOk,
34
+ onCancel: onClose,
35
+ closeIcon: /* @__PURE__ */ jsx(CloseOutlined, {}),
36
+ classNames: {
37
+ content: "ow"
38
+ },
39
+ styles: {
40
+ header: {
41
+ padding: "10px",
42
+ borderBottom: "1px solid #dee0e3",
43
+ marginBottom: "10px"
44
+ },
45
+ body: {
46
+ overflowY: "auto",
47
+ flex: 1
48
+ }
49
+ },
50
+ children: /* @__PURE__ */ jsxs("div", { className: "config-widget-dialog-container", children: [
51
+ /* @__PURE__ */ jsx("div", { className: "config-widget-dialog-content", children: /* @__PURE__ */ jsx(
52
+ "div",
53
+ {
54
+ className: "config-widget-dialog-preview",
55
+ style: { borderRight: "1px solid #e0e0e0" },
56
+ children: /* @__PURE__ */ jsx(CalendarModule, { customData, moduleDataApi })
57
+ }
58
+ ) }),
59
+ /* @__PURE__ */ jsxs("div", { className: "config-widget-dialog-panel", style: { borderLeft: "none" }, children: [
60
+ /* @__PURE__ */ jsx("div", { className: "bitable-dashboard edit-panel-container", style: { paddingTop: "20px" }, children: /* @__PURE__ */ jsx(
61
+ CustomData,
62
+ {
63
+ enumDataApi,
64
+ selectModuleData,
65
+ onAllValuesChange: (allVal) => {
66
+ setCustomData(allVal);
67
+ }
68
+ }
69
+ ) }),
70
+ /* @__PURE__ */ jsx("div", { className: "button-container", children: /* @__PURE__ */ jsx(
71
+ Button,
72
+ {
73
+ type: "primary",
74
+ onClick: () => {
75
+ onOk == null ? void 0 : onOk({
76
+ id: selectModuleData == null ? void 0 : selectModuleData.id,
77
+ customData
78
+ });
79
+ },
80
+ children: t("confirm")
81
+ }
82
+ ) })
83
+ ] })
84
+ ] })
85
+ }
86
+ ) });
87
+ };
88
+ export {
89
+ AddStatisticsModal as default
90
+ };
91
+ //# 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'\n\ninterface AddStatisticsModalProps {\n open: boolean\n onClose?: () => void\n selectModuleData?: ModuleData\n onOk?: ({\n id,\n customData,\n }: {\n id?: ModuleData['id']\n customData?: CalendarCustomeDataTypes\n }) => void\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 const handleOk = () => {\n onClose?.()\n }\n\n useEffect(() => {\n if (selectModuleData) {\n setCustomData(selectModuleData?.customData)\n }\n }, [selectModuleData])\n\n return (\n <>\n <Modal\n width=\"65%\"\n title={t('calendarText')}\n footer={null}\n open={open}\n onOk={handleOk}\n onCancel={onClose}\n closeIcon={<CloseOutlined />}\n classNames={{\n content: 'ow',\n }}\n styles={{\n header: {\n padding: '10px',\n borderBottom: '1px solid #dee0e3',\n marginBottom: '10px',\n },\n body: {\n overflowY: 'auto',\n flex: 1,\n },\n }}\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 })\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":";;;;;;;AAwBA,MAAM,qBAAwD,CAAC;AAAA,EAC7D;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,MAAM;AACE,QAAA,EAAE,EAAE,IAAI,eAAe;AAC7B,QAAM,CAAC,YAAY,aAAa,IAAI,SAAmC;AACvE,QAAM,WAAW,MAAM;AACX;AAAA,EACZ;AAEA,YAAU,MAAM;AACd,QAAI,kBAAkB;AACpB,oBAAc,qDAAkB,UAAU;AAAA,IAAA;AAAA,EAC5C,GACC,CAAC,gBAAgB,CAAC;AAErB,SAEI,oBAAA,UAAA,EAAA,UAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,OAAM;AAAA,MACN,OAAO,EAAE,cAAc;AAAA,MACvB,QAAQ;AAAA,MACR;AAAA,MACA,MAAM;AAAA,MACN,UAAU;AAAA,MACV,+BAAY,eAAc,EAAA;AAAA,MAC1B,YAAY;AAAA,QACV,SAAS;AAAA,MACX;AAAA,MACA,QAAQ;AAAA,QACN,QAAQ;AAAA,UACN,SAAS;AAAA,UACT,cAAc;AAAA,UACd,cAAc;AAAA,QAChB;AAAA,QACA,MAAM;AAAA,UACJ,WAAW;AAAA,UACX,MAAM;AAAA,QAAA;AAAA,MAEV;AAAA,MAEA,UAAA,qBAAC,OAAI,EAAA,WAAU,kCACb,UAAA;AAAA,QAAC,oBAAA,OAAA,EAAI,WAAU,gCACb,UAAA;AAAA,UAAC;AAAA,UAAA;AAAA,YACC,WAAU;AAAA,YACV,OAAO,EAAE,aAAa,oBAAoB;AAAA,YAE1C,UAAA,oBAAC,gBAAe,EAAA,YAAwB,cAA8B,CAAA;AAAA,UAAA;AAAA,QAAA,GAE1E;AAAA,QACA,qBAAC,SAAI,WAAU,8BAA6B,OAAO,EAAE,YAAY,OAC/D,GAAA,UAAA;AAAA,UAAA,oBAAC,SAAI,WAAU,0CAAyC,OAAO,EAAE,YAAY,UAC3E,UAAA;AAAA,YAAC;AAAA,YAAA;AAAA,cACC;AAAA,cACA;AAAA,cACA,mBAAmB,CAAU,WAAA;AAC3B,8BAAc,MAAM;AAAA,cAAA;AAAA,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,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,27 @@
1
+ import { ModuleData } from '../../module-content';
2
+ import { EnumDataApi } from '../../../types';
3
+ import { ConditionListItemTypes } from '../components/condition-modal';
4
+ export type ChartCustomeDataTypes = {
5
+ conditionData?: {
6
+ conditionList: ConditionListItemTypes[];
7
+ conditionType: 'all' | 'any';
8
+ };
9
+ dataSourceId?: string;
10
+ 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';
11
+ xAxis: string;
12
+ yAxis: string;
13
+ yAxisField: string;
14
+ yAxisFieldType: 'sum' | 'max' | 'min' | 'avg';
15
+ groupField: string;
16
+ isGroup: boolean;
17
+ chartOptions: any;
18
+ sortField: 'xAxis' | 'yAxisField' | 'recordValue';
19
+ sortOrder: 'asc' | 'desc';
20
+ };
21
+ interface CustomDataProps {
22
+ selectModuleData?: ModuleData;
23
+ onAllValuesChange?: ((values: any) => void) | undefined;
24
+ enumDataApi?: EnumDataApi;
25
+ }
26
+ declare const CustomData: React.FC<CustomDataProps>;
27
+ export default CustomData;