@wecode-team/we0-cms 1.0.37 → 1.1.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.css +2 -2
- package/dist/index.esm.js +4 -9
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +4 -9
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
- package/dist/components/dashboard/DashboardContainer.d.ts +0 -11
- package/dist/components/dashboard/WidgetRenderer.d.ts +0 -7
- package/dist/components/dashboard/charts/BarChartWidget.d.ts +0 -7
- package/dist/components/dashboard/charts/LineChartWidget.d.ts +0 -7
- package/dist/components/dashboard/charts/PieChartWidget.d.ts +0 -7
- package/dist/components/dashboard/charts/StatCardWidget.d.ts +0 -7
- package/dist/components/dashboard/charts/TableWidget.d.ts +0 -7
- package/dist/components/dashboard/hooks/useWidgetData.d.ts +0 -8
- package/dist/components/dashboard/mockData.d.ts +0 -6
- package/dist/components/dashboard/types.d.ts +0 -61
- package/dist/components/dashboard/utils/export.d.ts +0 -12
- package/dist/components/page.d.ts +0 -9
- package/dist/components/pages/dashboard.d.ts +0 -2
- package/dist/components/pages/welcome.d.ts +0 -2
- package/dist/request.d.ts +0 -14
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wecode-team/we0-cms",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.10",
|
|
4
4
|
"description": "A CMS component for React applications with shadcn/ui",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.esm.js",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"README.md"
|
|
21
21
|
],
|
|
22
22
|
"scripts": {
|
|
23
|
-
"build": "rollup -c --bundleConfigAsCjs",
|
|
23
|
+
"build": "rollup -c --bundleConfigAsCjs && node -e \"try { require('fs').unlinkSync('dist/request.d.ts'); } catch(e) {}\"",
|
|
24
24
|
"prepublishOnly": "npm run build",
|
|
25
25
|
"publish:public": "npm run build && NPM_CONFIG_USERCONFIG=$(node -e \"process.stdout.write(require('fs').existsSync('.npmrc.public.local') ? '.npmrc.public.local' : '.npmrc.public')\") npm publish --access public --ignore-scripts",
|
|
26
26
|
"publish:private": "npm run build && NPM_CONFIG_USERCONFIG=$(node -e \"process.stdout.write(require('fs').existsSync('.npmrc.private.local') ? '.npmrc.private.local' : '.npmrc.private')\") npm publish --access public --ignore-scripts",
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { Layout } from 'react-grid-layout';
|
|
3
|
-
import 'react-grid-layout/css/styles.css';
|
|
4
|
-
import 'react-resizable/css/styles.css';
|
|
5
|
-
import { Dashboard } from './types';
|
|
6
|
-
interface DashboardContainerProps {
|
|
7
|
-
dashboard: Dashboard;
|
|
8
|
-
onLayoutChange?: (layout: Layout[]) => void;
|
|
9
|
-
}
|
|
10
|
-
export declare function DashboardContainer({ dashboard, onLayoutChange }: DashboardContainerProps): React.JSX.Element;
|
|
11
|
-
export {};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { DataSourceConfig } from '../types';
|
|
2
|
-
interface UseWidgetDataResult {
|
|
3
|
-
data: any[];
|
|
4
|
-
loading: boolean;
|
|
5
|
-
error: Error | null;
|
|
6
|
-
}
|
|
7
|
-
export declare function useWidgetData(dataSource: DataSourceConfig, enableMock?: boolean): UseWidgetDataResult;
|
|
8
|
-
export {};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { DataSourceConfig } from './types';
|
|
2
|
-
export declare class MockDataService {
|
|
3
|
-
static getAggregateData(table: string, config: DataSourceConfig): Promise<any[]>;
|
|
4
|
-
static getTableData(table: string, config: DataSourceConfig): Promise<any[]>;
|
|
5
|
-
static getTimeSeriesData(table: string, config: DataSourceConfig): Promise<any[]>;
|
|
6
|
-
}
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
export interface Dashboard {
|
|
2
|
-
id: number | string;
|
|
3
|
-
name: string;
|
|
4
|
-
description?: string;
|
|
5
|
-
layout_config: {
|
|
6
|
-
columns: number;
|
|
7
|
-
rowHeight: number;
|
|
8
|
-
gap: number;
|
|
9
|
-
};
|
|
10
|
-
widgets: WidgetConfig[];
|
|
11
|
-
is_public?: boolean;
|
|
12
|
-
created_at?: string;
|
|
13
|
-
updated_at?: string;
|
|
14
|
-
}
|
|
15
|
-
export type WidgetType = 'stat-card' | 'line-chart' | 'bar-chart' | 'pie-chart' | 'area-chart' | 'table';
|
|
16
|
-
export interface WidgetConfig {
|
|
17
|
-
id: string;
|
|
18
|
-
type: WidgetType;
|
|
19
|
-
title: string;
|
|
20
|
-
position: {
|
|
21
|
-
x: number;
|
|
22
|
-
y: number;
|
|
23
|
-
w: number;
|
|
24
|
-
h: number;
|
|
25
|
-
};
|
|
26
|
-
dataSource: DataSourceConfig;
|
|
27
|
-
chartConfig?: ChartConfig;
|
|
28
|
-
refreshInterval?: number;
|
|
29
|
-
}
|
|
30
|
-
export interface DataSourceConfig {
|
|
31
|
-
table: string;
|
|
32
|
-
aggregation?: {
|
|
33
|
-
type: 'count' | 'sum' | 'avg' | 'max' | 'min';
|
|
34
|
-
field?: string;
|
|
35
|
-
groupBy?: string | string[];
|
|
36
|
-
timeUnit?: 'day' | 'week' | 'month' | 'year';
|
|
37
|
-
};
|
|
38
|
-
filters?: Array<{
|
|
39
|
-
column: string;
|
|
40
|
-
operator: 'eq' | 'neq' | 'gt' | 'gte' | 'lt' | 'lte' | 'like' | 'in' | 'is';
|
|
41
|
-
value: any;
|
|
42
|
-
}>;
|
|
43
|
-
dateRange?: {
|
|
44
|
-
field: string;
|
|
45
|
-
start: string;
|
|
46
|
-
end: string;
|
|
47
|
-
};
|
|
48
|
-
limit?: number;
|
|
49
|
-
orderBy?: {
|
|
50
|
-
field: string;
|
|
51
|
-
direction: 'asc' | 'desc';
|
|
52
|
-
};
|
|
53
|
-
}
|
|
54
|
-
export interface ChartConfig {
|
|
55
|
-
xAxis?: string;
|
|
56
|
-
yAxis?: string | string[];
|
|
57
|
-
colors?: string[];
|
|
58
|
-
showLegend?: boolean;
|
|
59
|
-
showGrid?: boolean;
|
|
60
|
-
previousValue?: number;
|
|
61
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 导出 Dashboard 为图片
|
|
3
|
-
*/
|
|
4
|
-
export declare function exportDashboardAsImage(elementId: string, filename?: string): Promise<void>;
|
|
5
|
-
/**
|
|
6
|
-
* 导出 Dashboard 为 PDF
|
|
7
|
-
*/
|
|
8
|
-
export declare function exportDashboardAsPDF(elementId: string, filename?: string, title?: string): Promise<void>;
|
|
9
|
-
/**
|
|
10
|
-
* 导出单个 Widget 为图片
|
|
11
|
-
*/
|
|
12
|
-
export declare function exportWidgetAsImage(element: HTMLElement, filename?: string): Promise<void>;
|
package/dist/request.d.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* CMS Request 网络请求工具
|
|
3
|
-
* 专用于CMS系统的独立请求实例
|
|
4
|
-
* 基于 axios 封装
|
|
5
|
-
*/
|
|
6
|
-
import { AxiosInstance, AxiosRequestConfig } from 'axios';
|
|
7
|
-
declare const request: {
|
|
8
|
-
get: (url: string, params?: any, config?: AxiosRequestConfig) => Promise<any>;
|
|
9
|
-
post: (url: string, data?: any, config?: AxiosRequestConfig) => Promise<any>;
|
|
10
|
-
put: (url: string, data?: any, config?: AxiosRequestConfig) => Promise<any>;
|
|
11
|
-
delete: (url: string, config?: AxiosRequestConfig) => Promise<any>;
|
|
12
|
-
instance: AxiosInstance;
|
|
13
|
-
};
|
|
14
|
-
export default request;
|