@platox/pivot-table 0.0.60 → 0.0.61
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.
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { jsx, Fragment, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useState } from "react";
|
|
3
3
|
import { Popover } from "antd";
|
|
4
|
+
import { PlusOutlined } from "@ant-design/icons";
|
|
4
5
|
import { useTranslation } from "react-i18next";
|
|
5
6
|
import SvgComponent from "../../icon/icon-chart-combination.js";
|
|
6
7
|
import IconBar from "../../icon/icon-bar.js";
|
|
@@ -116,12 +117,18 @@ const AddBtn = () => {
|
|
|
116
117
|
"div",
|
|
117
118
|
{
|
|
118
119
|
style: {
|
|
119
|
-
|
|
120
|
-
color: "black",
|
|
120
|
+
color: "rgba(0,0,0,0.88)",
|
|
121
121
|
lineHeight: "1.25rem",
|
|
122
|
-
|
|
122
|
+
fontSize: "14px"
|
|
123
123
|
},
|
|
124
|
-
children:
|
|
124
|
+
children: /* @__PURE__ */ jsx(
|
|
125
|
+
PlusOutlined,
|
|
126
|
+
{
|
|
127
|
+
style: {
|
|
128
|
+
color: "rgba(0,0,0,0.88)"
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
)
|
|
125
132
|
}
|
|
126
133
|
)
|
|
127
134
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../packages/dashboard-workbench/components/add-module-btn/index.tsx"],"sourcesContent":["import { useState } from 'react'\nimport { Button, Popover } from 'antd'\nimport { useTranslation } from 'react-i18next'\nimport IconChartCombination from '@platox/pivot-table/icon/icon-chart-combination'\nimport IconBar from '../../icon/icon-bar'\nimport IconCalendar from '../../icon/icon-calendar'\nimport IconEditor from '../../icon/icon-editor'\nimport IconLine from '../../icon/icon-line'\nimport IconPie from '../../icon/icon-pie'\nimport IconStatistics from '../../icon/icon-statistics'\nimport IconStripBar from '../../icon/icon-strip-bar'\nimport { useChartTypeOption } from '../add-module-modal/add-chart-modal/config'\nimport { ChartType } from '../add-module-modal/add-chart-modal/interface'\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\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 title: t('add._add5'),\n type: ChartType['chartCombination'],\n icon: <IconChartCombination />,\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 <span>\n <AddBtn />\n </span>\n </Popover>\n </>\n )\n}\n\nexport default AddModuleBtn\n\n/* ============================== split =============================== */\n\nexport const AddBtn = () => {\n return (\n <div\n style={{\n width: '1.5rem',\n height: '1.5rem',\n backgroundColor: 'var(--brand)',\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n borderRadius: '9999px',\n cursor: 'pointer',\n }}\n >\n <div\n style={{\n
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../packages/dashboard-workbench/components/add-module-btn/index.tsx"],"sourcesContent":["import { useState } from 'react'\nimport { Button, Popover } from 'antd'\nimport { PlusOutlined } from '@ant-design/icons'\nimport { useTranslation } from 'react-i18next'\nimport IconChartCombination from '@platox/pivot-table/icon/icon-chart-combination'\nimport IconBar from '../../icon/icon-bar'\nimport IconCalendar from '../../icon/icon-calendar'\nimport IconEditor from '../../icon/icon-editor'\nimport IconLine from '../../icon/icon-line'\nimport IconPie from '../../icon/icon-pie'\nimport IconStatistics from '../../icon/icon-statistics'\nimport IconStripBar from '../../icon/icon-strip-bar'\nimport { useChartTypeOption } from '../add-module-modal/add-chart-modal/config'\nimport { ChartType } from '../add-module-modal/add-chart-modal/interface'\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\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 title: t('add._add5'),\n type: ChartType['chartCombination'],\n icon: <IconChartCombination />,\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 <span>\n <AddBtn />\n </span>\n </Popover>\n </>\n )\n}\n\nexport default AddModuleBtn\n\n/* ============================== split =============================== */\n\nexport const AddBtn = () => {\n return (\n <div\n style={{\n width: '1.5rem',\n height: '1.5rem',\n backgroundColor: 'var(--brand)',\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n borderRadius: '9999px',\n cursor: 'pointer',\n }}\n >\n <div\n style={{\n color: 'rgba(0,0,0,0.88)',\n lineHeight: '1.25rem',\n fontSize: '14px',\n }}\n >\n <PlusOutlined\n style={{\n color: 'rgba(0,0,0,0.88)',\n }}\n />\n </div>\n </div>\n )\n}\n"],"names":["IconChartCombination"],"mappings":";;;;;;;;;;;;;;AA0CA,MAAM,eAA4C,CAAC,EAAE,WAAW;AACxD,QAAA,EAAE,EAAE,IAAI,eAAe;AAE7B,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,CAAA;AAAA,QAClB;AAAA,QACA;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,cAAa,CAAA,CAAA;AAAA,QACtB;AAAA,QACA;AAAA,UACE,OAAO,EAAE,WAAW;AAAA,UACpB,MAAM,UAAU,kBAAkB;AAAA,UAClC,0BAAOA,cAAqB,CAAA,CAAA;AAAA,QAAA;AAAA,MAC9B;AAAA,IAEJ;AAAA,IACA;AAAA,MAC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