@steedos-widgets/devextreme 6.10.25 → 6.10.27
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/assets-dev.json +8 -2
- package/dist/assets.json +12 -6
- package/dist/components/DataGrid.d.ts +10 -2
- package/dist/components/Gantt.d.ts +11 -2
- package/dist/components/PivotGrid.d.ts +10 -1
- package/dist/components/Scheduler.d.ts +14 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/devextreme.umd.js +277 -219
- package/dist/meta.js +168 -66
- package/dist/metas/Scheduler.d.ts +2 -0
- package/dist/types/components/DataGrid.d.ts +10 -2
- package/dist/types/components/Gantt.d.ts +11 -2
- package/dist/types/components/PivotGrid.d.ts +10 -1
- package/dist/types/components/Scheduler.d.ts +14 -0
- package/dist/types/components/index.d.ts +1 -0
- package/dist/types/metas/Scheduler.d.ts +2 -0
- package/package.json +2 -2
package/dist/assets-dev.json
CHANGED
|
@@ -1,10 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"packages": [
|
|
3
|
+
{
|
|
4
|
+
"package": "devextreme-dist",
|
|
5
|
+
"urls": [
|
|
6
|
+
"https://unpkg.steedos.cn/devextreme-dist@23.2.15/js/dx.all.js",
|
|
7
|
+
"https://unpkg.steedos.cn/devextreme-dist@23.2.15/css/dx.material.blue.light.compact.css"
|
|
8
|
+
],
|
|
9
|
+
"library": "DevExtreme"
|
|
10
|
+
},
|
|
3
11
|
{
|
|
4
12
|
"package": "@steedos-widgets/devextreme",
|
|
5
13
|
"urls": [
|
|
6
|
-
"https://unpkg.steedos.cn/devextreme-dist@25.1.7/js/dx.all.js",
|
|
7
|
-
"https://unpkg.steedos.cn/devextreme-dist@25.1.7/css/dx.material.blue.light.compact.css",
|
|
8
14
|
"http://127.0.0.1:8080/@steedos-widgets/devextreme/dist/devextreme.umd.js"
|
|
9
15
|
],
|
|
10
16
|
"library": "BuilderDevExtreme"
|
package/dist/assets.json
CHANGED
|
@@ -1,11 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"packages": [
|
|
3
|
+
{
|
|
4
|
+
"package": "devextreme-dist",
|
|
5
|
+
"urls": [
|
|
6
|
+
"https://unpkg.com/devextreme-dist@23.2.15/js/dx.all.js",
|
|
7
|
+
"https://unpkg.com/devextreme-dist@23.2.15/css/dx.material.blue.light.compact.css"
|
|
8
|
+
],
|
|
9
|
+
"library": "DevExtreme"
|
|
10
|
+
},
|
|
3
11
|
{
|
|
4
12
|
"package": "@steedos-widgets/devextreme",
|
|
5
13
|
"urls": [
|
|
6
|
-
"https://unpkg.com/devextreme
|
|
7
|
-
"https://unpkg.com/devextreme-dist@25.1.7/css/dx.material.blue.light.compact.css",
|
|
8
|
-
"https://unpkg.com/@steedos-widgets/devextreme@6.10.25/dist/devextreme.umd.js"
|
|
14
|
+
"https://unpkg.com/@steedos-widgets/devextreme@6.10.27/dist/devextreme.umd.js"
|
|
9
15
|
],
|
|
10
16
|
"library": "BuilderDevExtreme"
|
|
11
17
|
}
|
|
@@ -16,10 +22,10 @@
|
|
|
16
22
|
"npm": {
|
|
17
23
|
"package": "@steedos-widgets/devextreme"
|
|
18
24
|
},
|
|
19
|
-
"url": "https://unpkg.com/@steedos-widgets/devextreme@6.10.
|
|
25
|
+
"url": "https://unpkg.com/@steedos-widgets/devextreme@6.10.27/dist/meta.js",
|
|
20
26
|
"urls": {
|
|
21
|
-
"default": "https://unpkg.com/@steedos-widgets/devextreme@6.10.
|
|
22
|
-
"design": "https://unpkg.com/@steedos-widgets/devextreme@6.10.
|
|
27
|
+
"default": "https://unpkg.com/@steedos-widgets/devextreme@6.10.27/dist/meta.js",
|
|
28
|
+
"design": "https://unpkg.com/@steedos-widgets/devextreme@6.10.27/dist/meta.js"
|
|
23
29
|
}
|
|
24
30
|
}
|
|
25
31
|
]
|
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
interface AmisDataGridProps {
|
|
3
|
+
data: any;
|
|
4
|
+
className?: string;
|
|
5
|
+
config?: object;
|
|
6
|
+
configAdaptor?: string;
|
|
7
|
+
onConfigAdaptor?: (config: any, data: any) => any;
|
|
8
|
+
[key: string]: any;
|
|
9
|
+
}
|
|
2
10
|
/**
|
|
3
11
|
* React 包装组件,用于渲染 UMD 格式的 DevExtreme DataGrid。
|
|
4
|
-
* @param {object} props - 组件属性,包括 Grid 配置、数据等。
|
|
5
12
|
*/
|
|
6
|
-
export declare const AmisDataGrid: (props:
|
|
13
|
+
export declare const AmisDataGrid: ({ data: amisData, className, config, configAdaptor, onConfigAdaptor, ...props }: AmisDataGridProps) => React.JSX.Element;
|
|
14
|
+
export {};
|
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
interface AmisGanttProps {
|
|
3
|
+
data: any;
|
|
4
|
+
className?: string;
|
|
5
|
+
config?: object;
|
|
6
|
+
configAdaptor?: string;
|
|
7
|
+
onConfigAdaptor?: (config: any, data: any) => any;
|
|
8
|
+
[key: string]: any;
|
|
9
|
+
}
|
|
2
10
|
/**
|
|
3
|
-
* React 包装组件,用于渲染 UMD 格式的 DevExtreme Gantt
|
|
11
|
+
* React 包装组件,用于渲染 UMD 格式的 DevExtreme Gantt 图。
|
|
4
12
|
*/
|
|
5
|
-
export declare const AmisGantt: ({ data: amisData, config,
|
|
13
|
+
export declare const AmisGantt: ({ data: amisData, className, config, configAdaptor, onConfigAdaptor, ...props }: AmisGanttProps) => React.JSX.Element;
|
|
14
|
+
export {};
|
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
interface AmisPivotGridProps {
|
|
3
|
+
data: any;
|
|
4
|
+
className?: string;
|
|
5
|
+
config?: object;
|
|
6
|
+
configAdaptor?: string;
|
|
7
|
+
onConfigAdaptor?: (DevExpress: any, data: any) => any;
|
|
8
|
+
[key: string]: any;
|
|
9
|
+
}
|
|
2
10
|
/**
|
|
3
11
|
* React 包装组件,用于渲染 UMD 格式的 DevExtreme PivotGrid 和 Chart。
|
|
4
12
|
*/
|
|
5
|
-
export declare const AmisPivotGrid: ({ data: amisData, config,
|
|
13
|
+
export declare const AmisPivotGrid: ({ data: amisData, className, config, configAdaptor, onConfigAdaptor, ...props }: AmisPivotGridProps) => React.JSX.Element;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface AmisSchedulerProps {
|
|
3
|
+
data: any;
|
|
4
|
+
className?: string;
|
|
5
|
+
config?: object;
|
|
6
|
+
configAdaptor?: string;
|
|
7
|
+
onConfigAdaptor?: (config: any, data: any) => any;
|
|
8
|
+
[key: string]: any;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* React 包装组件,用于渲染 UMD 格式的 DevExtreme Scheduler 日程表。
|
|
12
|
+
*/
|
|
13
|
+
export declare const AmisScheduler: ({ data: amisData, className, config, configAdaptor, onConfigAdaptor, ...props }: AmisSchedulerProps) => React.JSX.Element;
|
|
14
|
+
export {};
|
package/dist/devextreme.umd.js
CHANGED
|
@@ -41,173 +41,176 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
41
41
|
}
|
|
42
42
|
return t;
|
|
43
43
|
}
|
|
44
|
-
function __read(o, n) {
|
|
45
|
-
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
46
|
-
if (!m) return o;
|
|
47
|
-
var i = m.call(o),
|
|
48
|
-
r,
|
|
49
|
-
ar = [],
|
|
50
|
-
e;
|
|
51
|
-
try {
|
|
52
|
-
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
53
|
-
} catch (error) {
|
|
54
|
-
e = {
|
|
55
|
-
error: error
|
|
56
|
-
};
|
|
57
|
-
} finally {
|
|
58
|
-
try {
|
|
59
|
-
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
60
|
-
} finally {
|
|
61
|
-
if (e) throw e.error;
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
return ar;
|
|
65
|
-
}
|
|
66
44
|
typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
|
67
45
|
var e = new Error(message);
|
|
68
46
|
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
69
47
|
};
|
|
70
|
-
var _a$
|
|
71
|
-
// 假设 UMD
|
|
72
|
-
|
|
73
|
-
// 明确定义 DevExtreme Grid UMD 类的类型(简单起见,使用 any,实际应用中建议导入 DevExtreme 类型)
|
|
74
|
-
var DxDataGrid = (_b$2 = (_a$2 = window.DevExpress) === null || _a$2 === void 0 ? void 0 : _a$2.ui) === null || _b$2 === void 0 ? void 0 : _b$2.dxDataGrid;
|
|
48
|
+
var _a$3, _b$3;
|
|
49
|
+
// 假设 UMD 脚本已加载,并获取全局的 DevExtreme DataGrid 构造函数
|
|
50
|
+
var DxDataGrid = (_b$3 = (_a$3 = window.DevExpress) === null || _a$3 === void 0 ? void 0 : _a$3.ui) === null || _b$3 === void 0 ? void 0 : _b$3.dxDataGrid;
|
|
75
51
|
if (!DxDataGrid) {
|
|
76
52
|
console.warn("DevExtreme DataGrid UMD 模块未找到。请确保 UMD 脚本已正确加载。");
|
|
77
53
|
}
|
|
78
54
|
/**
|
|
79
55
|
* React 包装组件,用于渲染 UMD 格式的 DevExtreme DataGrid。
|
|
80
|
-
* @param {object} props - 组件属性,包括 Grid 配置、数据等。
|
|
81
56
|
*/
|
|
82
|
-
var AmisDataGrid = function AmisDataGrid(
|
|
83
|
-
var
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
var
|
|
91
|
-
//
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
var
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
57
|
+
var AmisDataGrid = function AmisDataGrid(_a) {
|
|
58
|
+
var amisData = _a.data,
|
|
59
|
+
className = _a.className,
|
|
60
|
+
config = _a.config,
|
|
61
|
+
configAdaptor = _a.configAdaptor,
|
|
62
|
+
onConfigAdaptor = _a.onConfigAdaptor,
|
|
63
|
+
props = __rest(_a, ["data", "className", "config", "configAdaptor", "onConfigAdaptor"]);
|
|
64
|
+
// 1. DOM 引用:用于挂载 DataGrid
|
|
65
|
+
var dataGridContainerRef = React.useRef(null);
|
|
66
|
+
// 2. DevExtreme DataGrid 实例引用
|
|
67
|
+
var dataGridInstanceRef = React.useRef(null);
|
|
68
|
+
// 3. 处理配置和数据过滤 (与 PivotGrid 保持一致的配置处理逻辑)
|
|
69
|
+
var fullConfig = React.useMemo(function () {
|
|
70
|
+
var baseConfig = config;
|
|
71
|
+
// 统一处理 configAdaptor / onConfigAdaptor 逻辑
|
|
72
|
+
var filterFn = onConfigAdaptor;
|
|
73
|
+
if (!filterFn) {
|
|
74
|
+
if (typeof configAdaptor === 'string') {
|
|
75
|
+
// configAdaptor 是字符串,尝试创建函数
|
|
76
|
+
try {
|
|
77
|
+
// 使用 new Function 代替 eval,用于执行字符串代码
|
|
78
|
+
// 函数签名: function(config, data)
|
|
79
|
+
filterFn = new Function('config', 'data', configAdaptor);
|
|
80
|
+
} catch (e) {
|
|
81
|
+
console.warn("configAdaptor 字符串函数创建失败:", e);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
// 执行配置过滤函数(如果存在)
|
|
86
|
+
try {
|
|
87
|
+
if (filterFn) {
|
|
88
|
+
// 使用执行结果,如果返回非空值,则覆盖 baseConfig
|
|
89
|
+
// 注意:这里传递的是当前 baseConfig 和 amisData
|
|
90
|
+
var newConfig = filterFn(baseConfig, amisData);
|
|
91
|
+
if (newConfig) {
|
|
92
|
+
baseConfig = newConfig;
|
|
93
|
+
}
|
|
94
|
+
// console.log("最终 DataGrid 配置:", newConfig); // 可选的调试信息
|
|
95
|
+
}
|
|
96
|
+
} catch (e) {
|
|
97
|
+
console.warn("configAdaptor 执行错误:", e);
|
|
98
|
+
}
|
|
99
|
+
// 合并最终配置,并明确设置 dataSource
|
|
100
|
+
var finalConfig = _assign(_assign(_assign({
|
|
101
|
+
// 默认设置:例如,启用条纹、列宽自适应
|
|
102
|
+
showBorders: true,
|
|
103
|
+
rowAlternationEnabled: true,
|
|
104
|
+
columnAutoWidth: true
|
|
105
|
+
}, baseConfig), props), {
|
|
106
|
+
// 明确设置 DataGrid 的数据源
|
|
107
|
+
dataSource: amisData
|
|
108
|
+
});
|
|
109
|
+
return finalConfig;
|
|
110
|
+
}, [configAdaptor, onConfigAdaptor, props, amisData, config]); // 依赖项包含所有配置和数据源
|
|
103
111
|
// ==========================================
|
|
104
|
-
//
|
|
112
|
+
// I. 挂载和实例化 (Mount)
|
|
105
113
|
// ==========================================
|
|
106
114
|
React.useEffect(function () {
|
|
107
|
-
if (!DxDataGrid || !
|
|
115
|
+
if (!DxDataGrid || !dataGridContainerRef.current) {
|
|
108
116
|
return;
|
|
109
117
|
}
|
|
110
|
-
// 实例化
|
|
111
|
-
|
|
112
|
-
|
|
118
|
+
// --- 1. 实例化 DataGrid ---
|
|
119
|
+
// fullConfig 已经包含了 dataSource
|
|
120
|
+
var instance = new DxDataGrid(dataGridContainerRef.current, fullConfig);
|
|
121
|
+
dataGridInstanceRef.current = instance;
|
|
113
122
|
// ==========================================
|
|
114
|
-
//
|
|
123
|
+
// II. 卸载 (Unmount) - 销毁实例
|
|
115
124
|
// ==========================================
|
|
116
125
|
return function () {
|
|
117
|
-
if (
|
|
118
|
-
//
|
|
119
|
-
|
|
120
|
-
|
|
126
|
+
if (dataGridInstanceRef.current) {
|
|
127
|
+
// 销毁 DataGrid 实例
|
|
128
|
+
dataGridInstanceRef.current.dispose();
|
|
129
|
+
dataGridInstanceRef.current = null;
|
|
121
130
|
}
|
|
122
131
|
};
|
|
123
|
-
|
|
124
|
-
// 所以我们只依赖于 UMD 模块和容器引用。
|
|
125
|
-
}, []);
|
|
132
|
+
}, []); // 仅在挂载时执行一次
|
|
126
133
|
// ==========================================
|
|
127
|
-
//
|
|
128
|
-
// 仅在 Grid 实例存在时调用 .option()
|
|
134
|
+
// III. 更新 (Update)
|
|
129
135
|
// ==========================================
|
|
130
136
|
React.useEffect(function () {
|
|
131
|
-
var instance =
|
|
137
|
+
var instance = dataGridInstanceRef.current;
|
|
132
138
|
if (instance) {
|
|
133
|
-
//
|
|
134
|
-
// 注意:这将会触发 DevExtreme 的内部更新机制,比手动检查每个属性更有效率。
|
|
139
|
+
// 当配置或数据变化时,更新 DataGrid 实例的配置
|
|
135
140
|
instance.option(fullConfig);
|
|
136
141
|
}
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
142
|
+
}, [fullConfig]); // 依赖于 fullConfig 变化
|
|
143
|
+
// ==========================================
|
|
144
|
+
// IV. 渲染
|
|
145
|
+
// ==========================================
|
|
141
146
|
return React__default["default"].createElement("div", {
|
|
142
|
-
ref:
|
|
143
|
-
|
|
144
|
-
// 可以在 config 或 restConfig 中控制样式,但此处为了示例保持了硬编码样式
|
|
147
|
+
ref: dataGridContainerRef,
|
|
148
|
+
// DataGrid 容器
|
|
145
149
|
style: {
|
|
146
150
|
width: '100%',
|
|
147
|
-
height: '
|
|
148
|
-
}
|
|
151
|
+
height: '100%'
|
|
152
|
+
},
|
|
153
|
+
className: className
|
|
149
154
|
});
|
|
150
155
|
};
|
|
151
|
-
var _a$
|
|
156
|
+
var _a$2, _b$2, _c, _d;
|
|
152
157
|
// 假设 UMD 脚本已加载,并获取全局的 DevExtreme 构造函数
|
|
153
|
-
var DxPivotGrid = (_b$
|
|
158
|
+
var DxPivotGrid = (_b$2 = (_a$2 = window.DevExpress) === null || _a$2 === void 0 ? void 0 : _a$2.ui) === null || _b$2 === void 0 ? void 0 : _b$2.dxPivotGrid;
|
|
154
159
|
var DxChart = (_d = (_c = window.DevExpress) === null || _c === void 0 ? void 0 : _c.viz) === null || _d === void 0 ? void 0 : _d.dxChart;
|
|
155
160
|
if (!DxPivotGrid || !DxChart) {
|
|
156
161
|
console.warn("DevExtreme PivotGrid 或 Chart UMD 模块未找到。请确保 UMD 脚本已正确加载。");
|
|
157
162
|
}
|
|
158
|
-
// 帮助函数:安全地解析配置
|
|
159
|
-
var parseConfig$1 = function parseConfig$1(config) {
|
|
160
|
-
if (typeof config === 'string') {
|
|
161
|
-
try {
|
|
162
|
-
return JSON.parse(config);
|
|
163
|
-
} catch (e) {
|
|
164
|
-
console.warn("配置解析失败:", e);
|
|
165
|
-
return {};
|
|
166
|
-
}
|
|
167
|
-
}
|
|
168
|
-
return _typeof(config) === 'object' && config !== null ? config : {};
|
|
169
|
-
};
|
|
170
163
|
/**
|
|
171
164
|
* React 包装组件,用于渲染 UMD 格式的 DevExtreme PivotGrid 和 Chart。
|
|
172
165
|
*/
|
|
173
166
|
var AmisPivotGrid = function AmisPivotGrid(_a) {
|
|
174
167
|
var amisData = _a.data,
|
|
175
|
-
config = _a.config,
|
|
176
168
|
className = _a.className,
|
|
177
|
-
|
|
169
|
+
config = _a.config,
|
|
170
|
+
configAdaptor = _a.configAdaptor,
|
|
171
|
+
// 解构出来以便统一处理
|
|
172
|
+
onConfigAdaptor = _a.onConfigAdaptor,
|
|
173
|
+
// 解构出来以便统一处理
|
|
174
|
+
props = __rest(_a, ["data", "className", "config", "configAdaptor", "onConfigAdaptor"]);
|
|
178
175
|
// 1. DOM 引用:用于挂载 PivotGrid 和 Chart
|
|
179
176
|
var chartContainerRef = React.useRef(null);
|
|
180
177
|
var pivotGridContainerRef = React.useRef(null);
|
|
181
178
|
// 2. DevExtreme 实例引用
|
|
182
179
|
var chartInstanceRef = React.useRef(null);
|
|
183
180
|
var pivotGridInstanceRef = React.useRef(null);
|
|
184
|
-
// 3. 处理配置和数据过滤 (
|
|
185
|
-
var
|
|
186
|
-
var baseConfig =
|
|
187
|
-
//
|
|
188
|
-
var
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
181
|
+
// 3. 处理配置和数据过滤 (优化后的逻辑)
|
|
182
|
+
var fullConfig = React.useMemo(function () {
|
|
183
|
+
var baseConfig = config;
|
|
184
|
+
// 统一处理 configAdaptor / onConfigAdaptor 逻辑
|
|
185
|
+
var filterFn = onConfigAdaptor;
|
|
186
|
+
if (!filterFn) {
|
|
187
|
+
if (typeof configAdaptor === 'string') {
|
|
188
|
+
// configAdaptor 是字符串,尝试创建函数
|
|
189
|
+
try {
|
|
190
|
+
// 使用 new Function 代替 eval,用于执行字符串代码
|
|
191
|
+
filterFn = new Function('config', 'data', configAdaptor);
|
|
192
|
+
} catch (e) {
|
|
193
|
+
console.warn("DataFilter 字符串函数创建失败:", e);
|
|
194
|
+
}
|
|
196
195
|
}
|
|
197
196
|
}
|
|
197
|
+
// 执行数据过滤函数(如果存在)
|
|
198
198
|
try {
|
|
199
|
-
|
|
199
|
+
if (filterFn) {
|
|
200
|
+
// 使用执行结果,如果返回非空值,则覆盖 baseConfig
|
|
201
|
+
var newConfig = filterFn(baseConfig, amisData);
|
|
202
|
+
if (newConfig) {
|
|
203
|
+
baseConfig = newConfig;
|
|
204
|
+
}
|
|
205
|
+
console.log("最终 PivotGrid 配置:", newConfig);
|
|
206
|
+
}
|
|
200
207
|
} catch (e) {
|
|
201
208
|
console.warn("DataFilter 执行错误:", e);
|
|
202
209
|
}
|
|
203
210
|
// 合并最终配置,并明确设置 dataSource
|
|
204
|
-
var finalConfig = _assign(_assign(
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
return [baseConfig, finalConfig];
|
|
208
|
-
}, [config, props, amisData]), 2);
|
|
209
|
-
_b[0];
|
|
210
|
-
var fullConfig = _b[1];
|
|
211
|
+
var finalConfig = _assign(_assign({}, baseConfig), props);
|
|
212
|
+
return finalConfig;
|
|
213
|
+
}, [configAdaptor, onConfigAdaptor, props, amisData]); // 依赖项包含所有配置和数据源
|
|
211
214
|
// ==========================================
|
|
212
215
|
// I. 挂载和实例化 (Mount)
|
|
213
216
|
// ==========================================
|
|
@@ -216,7 +219,7 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
216
219
|
return;
|
|
217
220
|
}
|
|
218
221
|
// --- 1. 实例化 PivotGrid ---
|
|
219
|
-
var pivotGridConfig = _assign(
|
|
222
|
+
var pivotGridConfig = _assign({
|
|
220
223
|
// 保持原组件中的默认配置,除非被 fullConfig 覆盖
|
|
221
224
|
allowSortingBySummary: true,
|
|
222
225
|
allowFiltering: true,
|
|
@@ -224,13 +227,9 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
224
227
|
showColumnTotals: false,
|
|
225
228
|
showColumnGrandTotals: false,
|
|
226
229
|
showRowTotals: false,
|
|
227
|
-
showRowGrandTotals: false
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
enabled: true,
|
|
231
|
-
height: 400
|
|
232
|
-
}
|
|
233
|
-
});
|
|
230
|
+
showRowGrandTotals: false
|
|
231
|
+
}, fullConfig);
|
|
232
|
+
// 注意:这里使用 pivotGridConfig 而非 fullConfig
|
|
234
233
|
var pivotInstance = new DxPivotGrid(pivotGridContainerRef.current, pivotGridConfig);
|
|
235
234
|
pivotGridInstanceRef.current = pivotInstance;
|
|
236
235
|
// --- 2. 实例化 Chart ---
|
|
@@ -252,7 +251,7 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
252
251
|
adaptiveLayout: {
|
|
253
252
|
width: 450
|
|
254
253
|
}
|
|
255
|
-
// Chart
|
|
254
|
+
// Chart 实例的配置可以从 fullConfig 中获取,但为了保持示例简洁,使用默认配置
|
|
256
255
|
};
|
|
257
256
|
var chartInstance = new DxChart(chartContainerRef.current, chartConfig);
|
|
258
257
|
chartInstanceRef.current = chartInstance;
|
|
@@ -303,124 +302,78 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
303
302
|
}
|
|
304
303
|
}), React__default["default"].createElement("div", {
|
|
305
304
|
ref: pivotGridContainerRef,
|
|
306
|
-
id
|
|
307
|
-
,
|
|
305
|
+
// 移除 id="pivotgrid" 以更符合 React 最佳实践(除非 DevExtreme 严格依赖它)
|
|
308
306
|
style: {
|
|
309
307
|
width: '100%'
|
|
310
|
-
}
|
|
311
|
-
className: className
|
|
308
|
+
}
|
|
312
309
|
}));
|
|
313
310
|
};
|
|
314
|
-
var _a, _b;
|
|
315
|
-
// 假设 UMD 脚本已加载,并获取全局的 DevExtreme
|
|
316
|
-
var DxGantt = (_b = (_a = window.DevExpress) === null || _a === void 0 ? void 0 : _a.ui) === null || _b === void 0 ? void 0 : _b.dxGantt;
|
|
311
|
+
var _a$1, _b$1;
|
|
312
|
+
// 假设 UMD 脚本已加载,并获取全局的 DevExtreme Gantt 构造函数
|
|
313
|
+
var DxGantt = (_b$1 = (_a$1 = window.DevExpress) === null || _a$1 === void 0 ? void 0 : _a$1.ui) === null || _b$1 === void 0 ? void 0 : _b$1.dxGantt;
|
|
317
314
|
if (!DxGantt) {
|
|
318
315
|
console.warn("DevExtreme Gantt UMD 模块未找到。请确保 UMD 脚本已正确加载。");
|
|
319
316
|
}
|
|
320
|
-
// 帮助函数:安全地解析配置
|
|
321
|
-
var parseConfig = function parseConfig(config) {
|
|
322
|
-
if (typeof config === 'string') {
|
|
323
|
-
try {
|
|
324
|
-
return JSON.parse(config);
|
|
325
|
-
} catch (e) {
|
|
326
|
-
console.warn("配置解析失败:", e);
|
|
327
|
-
return {};
|
|
328
|
-
}
|
|
329
|
-
}
|
|
330
|
-
return _typeof(config) === 'object' && config !== null ? config : {};
|
|
331
|
-
};
|
|
332
317
|
/**
|
|
333
|
-
* React 包装组件,用于渲染 UMD 格式的 DevExtreme Gantt
|
|
318
|
+
* React 包装组件,用于渲染 UMD 格式的 DevExtreme Gantt 图。
|
|
334
319
|
*/
|
|
335
320
|
var AmisGantt = function AmisGantt(_a) {
|
|
336
321
|
var amisData = _a.data,
|
|
337
|
-
config = _a.config,
|
|
338
322
|
className = _a.className,
|
|
339
|
-
|
|
340
|
-
|
|
323
|
+
config = _a.config,
|
|
324
|
+
configAdaptor = _a.configAdaptor,
|
|
325
|
+
onConfigAdaptor = _a.onConfigAdaptor,
|
|
326
|
+
props = __rest(_a, ["data", "className", "config", "configAdaptor", "onConfigAdaptor"]);
|
|
327
|
+
// 1. DOM 引用:用于挂载 Gantt 图
|
|
341
328
|
var ganttContainerRef = React.useRef(null);
|
|
342
|
-
// 2. DevExtreme 实例引用
|
|
329
|
+
// 2. DevExtreme Gantt 实例引用
|
|
343
330
|
var ganttInstanceRef = React.useRef(null);
|
|
344
|
-
// 3.
|
|
331
|
+
// 3. 处理配置和数据过滤 (保持与 DataGrid/PivotGrid 一致的逻辑)
|
|
345
332
|
var fullConfig = React.useMemo(function () {
|
|
346
|
-
var baseConfig =
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
333
|
+
var baseConfig = config;
|
|
334
|
+
var filterFn = onConfigAdaptor;
|
|
335
|
+
if (!filterFn) {
|
|
336
|
+
if (typeof configAdaptor === 'string') {
|
|
337
|
+
try {
|
|
338
|
+
filterFn = new Function('config', 'data', configAdaptor);
|
|
339
|
+
} catch (e) {
|
|
340
|
+
console.warn("configAdaptor 字符串函数创建失败:", e);
|
|
341
|
+
}
|
|
355
342
|
}
|
|
356
343
|
}
|
|
357
344
|
try {
|
|
358
|
-
|
|
359
|
-
|
|
345
|
+
if (filterFn) {
|
|
346
|
+
var newConfig = filterFn(baseConfig, amisData);
|
|
347
|
+
if (newConfig) {
|
|
348
|
+
baseConfig = newConfig;
|
|
349
|
+
}
|
|
350
|
+
}
|
|
360
351
|
} catch (e) {
|
|
361
|
-
console.warn("
|
|
352
|
+
console.warn("configAdaptor 执行错误:", e);
|
|
362
353
|
}
|
|
363
|
-
//
|
|
364
|
-
var finalConfig = _assign(_assign(_assign({
|
|
365
|
-
//
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
height: 700
|
|
354
|
+
// DevExtreme Gantt 需要一个 height,通常设置为 100% 或固定值
|
|
355
|
+
var finalConfig = _assign(_assign(_assign(_assign({
|
|
356
|
+
// 默认设置:例如,允许编辑、默认高度
|
|
357
|
+
allowSelection: true,
|
|
358
|
+
height: '100%'
|
|
369
359
|
}, baseConfig), props), {
|
|
370
|
-
//
|
|
371
|
-
//
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
//
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
}
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
// 字段列配置
|
|
384
|
-
columns: [{
|
|
385
|
-
dataField: "title",
|
|
386
|
-
caption: "Subject",
|
|
387
|
-
width: 300
|
|
388
|
-
}, {
|
|
389
|
-
dataField: "start",
|
|
390
|
-
caption: "Start Date"
|
|
391
|
-
}, {
|
|
392
|
-
dataField: "end",
|
|
393
|
-
caption: "End Date"
|
|
394
|
-
}],
|
|
395
|
-
// 工具栏配置
|
|
396
|
-
toolbar: {
|
|
397
|
-
items: [{
|
|
398
|
-
name: "undo"
|
|
399
|
-
}, {
|
|
400
|
-
name: "redo"
|
|
401
|
-
}, {
|
|
402
|
-
name: "separator"
|
|
403
|
-
}, {
|
|
404
|
-
name: "collapseAll"
|
|
405
|
-
}, {
|
|
406
|
-
name: "expandAll"
|
|
407
|
-
}, {
|
|
408
|
-
name: "separator"
|
|
409
|
-
}, {
|
|
410
|
-
name: "addTask"
|
|
411
|
-
}, {
|
|
412
|
-
name: "deleteTask"
|
|
413
|
-
}, {
|
|
414
|
-
name: "separator"
|
|
415
|
-
}, {
|
|
416
|
-
name: "zoomIn"
|
|
417
|
-
}, {
|
|
418
|
-
name: "zoomOut"
|
|
419
|
-
}]
|
|
360
|
+
// Gantt 的数据源通常包含在 amisData 中,
|
|
361
|
+
// 但我们需要将其作为配置的一部分传入。
|
|
362
|
+
// DevExtreme Gantt 通常将数据源分为 tasks, dependencies, resources 等。
|
|
363
|
+
// 为了与amisData适配,我们假设 amisData 包含了所有所需的数据配置。
|
|
364
|
+
// 如果 amisData 是一个对象且包含 'tasks' 属性,则使用它。
|
|
365
|
+
// 如果 amisData 是一个数组,则假设它是任务数据,并手动创建 dataSource.
|
|
366
|
+
// 这是一个简化的假设,实际应用中可能需要更复杂的适配逻辑:
|
|
367
|
+
tasks: Array.isArray(amisData) ? {
|
|
368
|
+
dataSource: amisData
|
|
369
|
+
} : props === null || props === void 0 ? void 0 : props.tasks
|
|
370
|
+
}), Array.isArray(amisData) && {
|
|
371
|
+
tasks: {
|
|
372
|
+
dataSource: amisData
|
|
420
373
|
}
|
|
421
374
|
});
|
|
422
375
|
return finalConfig;
|
|
423
|
-
}, [
|
|
376
|
+
}, [configAdaptor, onConfigAdaptor, props, amisData, config]);
|
|
424
377
|
// ==========================================
|
|
425
378
|
// I. 挂载和实例化 (Mount)
|
|
426
379
|
// ==========================================
|
|
@@ -428,7 +381,7 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
428
381
|
if (!DxGantt || !ganttContainerRef.current) {
|
|
429
382
|
return;
|
|
430
383
|
}
|
|
431
|
-
// 实例化
|
|
384
|
+
// --- 1. 实例化 Gantt ---
|
|
432
385
|
var instance = new DxGantt(ganttContainerRef.current, fullConfig);
|
|
433
386
|
ganttInstanceRef.current = instance;
|
|
434
387
|
// ==========================================
|
|
@@ -436,7 +389,7 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
436
389
|
// ==========================================
|
|
437
390
|
return function () {
|
|
438
391
|
if (ganttInstanceRef.current) {
|
|
439
|
-
//
|
|
392
|
+
// 销毁 Gantt 实例
|
|
440
393
|
ganttInstanceRef.current.dispose();
|
|
441
394
|
ganttInstanceRef.current = null;
|
|
442
395
|
}
|
|
@@ -457,16 +410,121 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
457
410
|
// ==========================================
|
|
458
411
|
return React__default["default"].createElement("div", {
|
|
459
412
|
ref: ganttContainerRef,
|
|
460
|
-
|
|
413
|
+
// 必须设置高度,否则 Gantt 组件可能不显示
|
|
461
414
|
style: {
|
|
462
415
|
width: '100%',
|
|
463
|
-
height:
|
|
416
|
+
height: '500px'
|
|
417
|
+
},
|
|
418
|
+
className: className
|
|
419
|
+
});
|
|
420
|
+
};
|
|
421
|
+
var _a, _b;
|
|
422
|
+
// 假设 UMD 脚本已加载,并获取全局的 DevExtreme Scheduler 构造函数
|
|
423
|
+
var DxScheduler = (_b = (_a = window.DevExpress) === null || _a === void 0 ? void 0 : _a.ui) === null || _b === void 0 ? void 0 : _b.dxScheduler;
|
|
424
|
+
if (!DxScheduler) {
|
|
425
|
+
console.warn("DevExtreme Scheduler UMD 模块未找到。请确保 UMD 脚本已正确加载。");
|
|
426
|
+
}
|
|
427
|
+
/**
|
|
428
|
+
* React 包装组件,用于渲染 UMD 格式的 DevExtreme Scheduler 日程表。
|
|
429
|
+
*/
|
|
430
|
+
var AmisScheduler = function AmisScheduler(_a) {
|
|
431
|
+
var amisData = _a.data,
|
|
432
|
+
className = _a.className,
|
|
433
|
+
config = _a.config,
|
|
434
|
+
configAdaptor = _a.configAdaptor,
|
|
435
|
+
onConfigAdaptor = _a.onConfigAdaptor,
|
|
436
|
+
props = __rest(_a, ["data", "className", "config", "configAdaptor", "onConfigAdaptor"]);
|
|
437
|
+
// 1. DOM 引用:用于挂载 Scheduler
|
|
438
|
+
var schedulerContainerRef = React.useRef(null);
|
|
439
|
+
// 2. DevExtreme Scheduler 实例引用
|
|
440
|
+
var schedulerInstanceRef = React.useRef(null);
|
|
441
|
+
// 3. 处理配置和数据过滤
|
|
442
|
+
var fullConfig = React.useMemo(function () {
|
|
443
|
+
var baseConfig = config;
|
|
444
|
+
var filterFn = onConfigAdaptor;
|
|
445
|
+
if (!filterFn) {
|
|
446
|
+
if (typeof configAdaptor === 'string') {
|
|
447
|
+
try {
|
|
448
|
+
filterFn = new Function('config', 'data', configAdaptor);
|
|
449
|
+
} catch (e) {
|
|
450
|
+
console.warn("configAdaptor 字符串函数创建失败:", e);
|
|
451
|
+
}
|
|
452
|
+
}
|
|
453
|
+
}
|
|
454
|
+
try {
|
|
455
|
+
if (filterFn) {
|
|
456
|
+
var newConfig = filterFn(baseConfig, amisData);
|
|
457
|
+
if (newConfig) {
|
|
458
|
+
baseConfig = newConfig;
|
|
459
|
+
}
|
|
460
|
+
}
|
|
461
|
+
} catch (e) {
|
|
462
|
+
console.warn("configAdaptor 执行错误:", e);
|
|
464
463
|
}
|
|
464
|
+
// Scheduler 的关键配置,例如数据源、当前日期、视图等
|
|
465
|
+
var finalConfig = _assign(_assign({
|
|
466
|
+
// 默认设置:
|
|
467
|
+
// 设置数据源为传入的 amisData
|
|
468
|
+
dataSource: amisData,
|
|
469
|
+
// 默认视图:Day
|
|
470
|
+
currentView: 'Day',
|
|
471
|
+
// 默认日期:当前日期
|
|
472
|
+
currentDate: new Date(),
|
|
473
|
+
// 默认允许编辑
|
|
474
|
+
editing: true,
|
|
475
|
+
height: '100%'
|
|
476
|
+
}, baseConfig), props);
|
|
477
|
+
return finalConfig;
|
|
478
|
+
}, [configAdaptor, onConfigAdaptor, props, amisData, config]);
|
|
479
|
+
// ==========================================
|
|
480
|
+
// I. 挂载和实例化 (Mount)
|
|
481
|
+
// ==========================================
|
|
482
|
+
React.useEffect(function () {
|
|
483
|
+
if (!DxScheduler || !schedulerContainerRef.current) {
|
|
484
|
+
return;
|
|
485
|
+
}
|
|
486
|
+
// --- 1. 实例化 Scheduler ---
|
|
487
|
+
// fullConfig 已经包含了 dataSource
|
|
488
|
+
var instance = new DxScheduler(schedulerContainerRef.current, fullConfig);
|
|
489
|
+
schedulerInstanceRef.current = instance;
|
|
490
|
+
// ==========================================
|
|
491
|
+
// II. 卸载 (Unmount) - 销毁实例
|
|
492
|
+
// ==========================================
|
|
493
|
+
return function () {
|
|
494
|
+
if (schedulerInstanceRef.current) {
|
|
495
|
+
// 销毁 Scheduler 实例
|
|
496
|
+
schedulerInstanceRef.current.dispose();
|
|
497
|
+
schedulerInstanceRef.current = null;
|
|
498
|
+
}
|
|
499
|
+
};
|
|
500
|
+
}, []); // 仅在挂载时执行一次
|
|
501
|
+
// ==========================================
|
|
502
|
+
// III. 更新 (Update)
|
|
503
|
+
// ==========================================
|
|
504
|
+
React.useEffect(function () {
|
|
505
|
+
var instance = schedulerInstanceRef.current;
|
|
506
|
+
if (instance) {
|
|
507
|
+
// 当配置或数据变化时,更新 Scheduler 实例的配置
|
|
508
|
+
instance.option(fullConfig);
|
|
509
|
+
}
|
|
510
|
+
}, [fullConfig]); // 依赖于 fullConfig 变化
|
|
511
|
+
// ==========================================
|
|
512
|
+
// IV. 渲染
|
|
513
|
+
// ==========================================
|
|
514
|
+
return React__default["default"].createElement("div", {
|
|
515
|
+
ref: schedulerContainerRef,
|
|
516
|
+
// 必须设置高度,否则组件可能不显示
|
|
517
|
+
style: {
|
|
518
|
+
width: '100%',
|
|
519
|
+
height: '600px'
|
|
520
|
+
},
|
|
521
|
+
className: className
|
|
465
522
|
});
|
|
466
523
|
};
|
|
467
524
|
exports.AmisDataGrid = AmisDataGrid;
|
|
468
525
|
exports.AmisGantt = AmisGantt;
|
|
469
526
|
exports.AmisPivotGrid = AmisPivotGrid;
|
|
527
|
+
exports.AmisScheduler = AmisScheduler;
|
|
470
528
|
Object.defineProperty(exports, '__esModule', {
|
|
471
529
|
value: true
|
|
472
530
|
});
|
package/dist/meta.js
CHANGED
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
36
36
|
};
|
|
37
37
|
|
|
38
|
-
var config$
|
|
38
|
+
var config$3 = {
|
|
39
39
|
group: "DevExtreme",
|
|
40
40
|
componentName: "AmisDataGrid",
|
|
41
41
|
title: "DataGrid",
|
|
@@ -59,30 +59,30 @@
|
|
|
59
59
|
icon: "fa-fw fa fa-list-alt"
|
|
60
60
|
}
|
|
61
61
|
};
|
|
62
|
-
var DataGrid = __assign(__assign({}, config$
|
|
62
|
+
var DataGrid = __assign(__assign({}, config$3), { snippets: [
|
|
63
63
|
{
|
|
64
|
-
title: config$
|
|
64
|
+
title: config$3.title,
|
|
65
65
|
screenshot: "",
|
|
66
66
|
schema: {
|
|
67
|
-
componentName: config$
|
|
68
|
-
props: config$
|
|
67
|
+
componentName: config$3.componentName,
|
|
68
|
+
props: config$3.preview
|
|
69
69
|
}
|
|
70
70
|
}
|
|
71
71
|
], amis: {
|
|
72
72
|
render: {
|
|
73
|
-
type: config$
|
|
74
|
-
usage: "
|
|
73
|
+
type: config$3.amis.name,
|
|
74
|
+
usage: "renderer", //使用 renderer 会无法监听到onEvent中配置的事件
|
|
75
75
|
weight: 1,
|
|
76
76
|
framework: "react"
|
|
77
77
|
},
|
|
78
78
|
plugin: {
|
|
79
|
-
rendererName: config$
|
|
79
|
+
rendererName: config$3.amis.name,
|
|
80
80
|
$schema: '/schemas/UnkownSchema.json',
|
|
81
|
-
name: config$
|
|
82
|
-
description: config$
|
|
83
|
-
tags: [config$
|
|
81
|
+
name: config$3.title,
|
|
82
|
+
description: config$3.title,
|
|
83
|
+
tags: [config$3.group],
|
|
84
84
|
order: -9999,
|
|
85
|
-
icon: config$
|
|
85
|
+
icon: config$3.amis.icon,
|
|
86
86
|
scaffold: {
|
|
87
87
|
"type": "service",
|
|
88
88
|
"api": {
|
|
@@ -91,7 +91,7 @@
|
|
|
91
91
|
},
|
|
92
92
|
"body": [
|
|
93
93
|
{
|
|
94
|
-
type: config$
|
|
94
|
+
type: config$3.amis.name,
|
|
95
95
|
dataSource: "${items}",
|
|
96
96
|
config: {
|
|
97
97
|
keyExpr: "_id",
|
|
@@ -123,15 +123,12 @@
|
|
|
123
123
|
},
|
|
124
124
|
"body": [
|
|
125
125
|
{
|
|
126
|
-
type: config$
|
|
126
|
+
type: config$3.amis.name,
|
|
127
127
|
dataSource: "${items}",
|
|
128
128
|
config: {
|
|
129
129
|
keyExpr: "_id",
|
|
130
130
|
// Column Definitions: Defines & controls grid columns.
|
|
131
|
-
columns: [
|
|
132
|
-
{ dataField: "_id", caption: "ID" },
|
|
133
|
-
{ dataField: "name" },
|
|
134
|
-
]
|
|
131
|
+
columns: []
|
|
135
132
|
},
|
|
136
133
|
}
|
|
137
134
|
]
|
|
@@ -139,10 +136,27 @@
|
|
|
139
136
|
panelTitle: "设置",
|
|
140
137
|
panelControls: [
|
|
141
138
|
{
|
|
142
|
-
type: "
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
139
|
+
type: "editor",
|
|
140
|
+
"language": "json",
|
|
141
|
+
name: "config",
|
|
142
|
+
label: "DataGrid 配置",
|
|
143
|
+
pipeOut: function (value) {
|
|
144
|
+
try {
|
|
145
|
+
return value ? JSON.parse(value) : null;
|
|
146
|
+
}
|
|
147
|
+
catch (e) {
|
|
148
|
+
}
|
|
149
|
+
return value;
|
|
150
|
+
}
|
|
151
|
+
},
|
|
152
|
+
{
|
|
153
|
+
type: "editor",
|
|
154
|
+
"language": "javascript",
|
|
155
|
+
name: "configAdaptor",
|
|
156
|
+
label: "配置适配器",
|
|
157
|
+
description: "通过函数扩展配置。\
|
|
158
|
+
签名:(config, data) => config \
|
|
159
|
+
"
|
|
146
160
|
},
|
|
147
161
|
{
|
|
148
162
|
type: "text",
|
|
@@ -150,11 +164,75 @@
|
|
|
150
164
|
label: "CSS类名",
|
|
151
165
|
value: "bg-gray-100 border-b sm:rounded sm:border border-gray-300 p-4 mb-4"
|
|
152
166
|
},
|
|
167
|
+
],
|
|
168
|
+
events: [{}],
|
|
169
|
+
},
|
|
170
|
+
} });
|
|
171
|
+
|
|
172
|
+
var config$2 = {
|
|
173
|
+
group: "DevExtreme",
|
|
174
|
+
componentName: "AmisPivotGrid",
|
|
175
|
+
title: "PivotGrid",
|
|
176
|
+
docUrl: "",
|
|
177
|
+
screenshot: "",
|
|
178
|
+
npm: {
|
|
179
|
+
package: "@steedos-widgets/devextreme",
|
|
180
|
+
version: "{{version}}",
|
|
181
|
+
exportName: "AmisPivotGrid",
|
|
182
|
+
main: "",
|
|
183
|
+
destructuring: true,
|
|
184
|
+
subName: ""
|
|
185
|
+
},
|
|
186
|
+
props: [],
|
|
187
|
+
preview: {},
|
|
188
|
+
targets: ["steedos__RecordPage", "steedos__AppPage", "steedos__HomePage"],
|
|
189
|
+
engines: ["amis"],
|
|
190
|
+
// settings for amis.
|
|
191
|
+
amis: {
|
|
192
|
+
name: 'devextreme-pivotgrid',
|
|
193
|
+
icon: "fa-fw fa fa-list-alt"
|
|
194
|
+
}
|
|
195
|
+
};
|
|
196
|
+
var PivotGrid = __assign(__assign({}, config$2), { snippets: [
|
|
197
|
+
{
|
|
198
|
+
title: config$2.title,
|
|
199
|
+
screenshot: "",
|
|
200
|
+
schema: {
|
|
201
|
+
componentName: config$2.componentName,
|
|
202
|
+
props: config$2.preview
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
], amis: {
|
|
206
|
+
render: {
|
|
207
|
+
type: config$2.amis.name,
|
|
208
|
+
usage: "renderer", //使用 renderer 会无法监听到onEvent中配置的事件
|
|
209
|
+
weight: 1,
|
|
210
|
+
framework: "react"
|
|
211
|
+
},
|
|
212
|
+
plugin: {
|
|
213
|
+
rendererName: config$2.amis.name,
|
|
214
|
+
$schema: '/schemas/UnkownSchema.json',
|
|
215
|
+
name: config$2.title,
|
|
216
|
+
description: config$2.title,
|
|
217
|
+
tags: [config$2.group],
|
|
218
|
+
order: -9999,
|
|
219
|
+
icon: config$2.amis.icon,
|
|
220
|
+
scaffold: {
|
|
221
|
+
type: config$2.amis.name,
|
|
222
|
+
className: "",
|
|
223
|
+
config: {},
|
|
224
|
+
},
|
|
225
|
+
previewSchema: {
|
|
226
|
+
type: config$2.amis.name,
|
|
227
|
+
config: {},
|
|
228
|
+
},
|
|
229
|
+
panelTitle: "设置",
|
|
230
|
+
panelControls: [
|
|
153
231
|
{
|
|
154
232
|
type: "editor",
|
|
155
233
|
"language": "json",
|
|
156
234
|
name: "config",
|
|
157
|
-
label: "
|
|
235
|
+
label: "PivotGrid 配置",
|
|
158
236
|
pipeOut: function (value) {
|
|
159
237
|
try {
|
|
160
238
|
return value ? JSON.parse(value) : null;
|
|
@@ -167,12 +245,18 @@
|
|
|
167
245
|
{
|
|
168
246
|
type: "editor",
|
|
169
247
|
"language": "javascript",
|
|
170
|
-
name: "
|
|
171
|
-
label: "
|
|
172
|
-
description: "
|
|
173
|
-
签名:(config,
|
|
248
|
+
name: "configAdaptor",
|
|
249
|
+
label: "配置适配器",
|
|
250
|
+
description: "通过函数扩展配置。\
|
|
251
|
+
签名:(config, data) => config \
|
|
174
252
|
"
|
|
175
253
|
},
|
|
254
|
+
{
|
|
255
|
+
type: "text",
|
|
256
|
+
name: "className",
|
|
257
|
+
label: "CSS类名",
|
|
258
|
+
value: "bg-gray-100 border-b sm:rounded sm:border border-gray-300 p-4 mb-4"
|
|
259
|
+
},
|
|
176
260
|
],
|
|
177
261
|
events: [{}],
|
|
178
262
|
},
|
|
@@ -180,14 +264,14 @@
|
|
|
180
264
|
|
|
181
265
|
var config$1 = {
|
|
182
266
|
group: "DevExtreme",
|
|
183
|
-
componentName: "
|
|
184
|
-
title: "
|
|
267
|
+
componentName: "AmisGantt",
|
|
268
|
+
title: "Gantt",
|
|
185
269
|
docUrl: "",
|
|
186
270
|
screenshot: "",
|
|
187
271
|
npm: {
|
|
188
272
|
package: "@steedos-widgets/devextreme",
|
|
189
273
|
version: "{{version}}",
|
|
190
|
-
exportName: "
|
|
274
|
+
exportName: "AmisGantt",
|
|
191
275
|
main: "",
|
|
192
276
|
destructuring: true,
|
|
193
277
|
subName: ""
|
|
@@ -198,11 +282,11 @@
|
|
|
198
282
|
engines: ["amis"],
|
|
199
283
|
// settings for amis.
|
|
200
284
|
amis: {
|
|
201
|
-
name: 'devextreme-
|
|
285
|
+
name: 'devextreme-gantt',
|
|
202
286
|
icon: "fa-fw fa fa-list-alt"
|
|
203
287
|
}
|
|
204
288
|
};
|
|
205
|
-
var
|
|
289
|
+
var Gantt = __assign(__assign({}, config$1), { snippets: [
|
|
206
290
|
{
|
|
207
291
|
title: config$1.title,
|
|
208
292
|
screenshot: "",
|
|
@@ -214,7 +298,7 @@
|
|
|
214
298
|
], amis: {
|
|
215
299
|
render: {
|
|
216
300
|
type: config$1.amis.name,
|
|
217
|
-
usage: "
|
|
301
|
+
usage: "renderer", //使用 renderer 会无法监听到onEvent中配置的事件
|
|
218
302
|
weight: 1,
|
|
219
303
|
framework: "react"
|
|
220
304
|
},
|
|
@@ -237,17 +321,11 @@
|
|
|
237
321
|
},
|
|
238
322
|
panelTitle: "设置",
|
|
239
323
|
panelControls: [
|
|
240
|
-
{
|
|
241
|
-
type: "text",
|
|
242
|
-
name: "className",
|
|
243
|
-
label: "CSS类名",
|
|
244
|
-
value: "bg-gray-100 border-b sm:rounded sm:border border-gray-300 p-4 mb-4"
|
|
245
|
-
},
|
|
246
324
|
{
|
|
247
325
|
type: "editor",
|
|
248
326
|
"language": "json",
|
|
249
327
|
name: "config",
|
|
250
|
-
label: "
|
|
328
|
+
label: "Gantt 配置",
|
|
251
329
|
pipeOut: function (value) {
|
|
252
330
|
try {
|
|
253
331
|
return value ? JSON.parse(value) : null;
|
|
@@ -260,12 +338,18 @@
|
|
|
260
338
|
{
|
|
261
339
|
type: "editor",
|
|
262
340
|
"language": "javascript",
|
|
263
|
-
name: "
|
|
264
|
-
label: "
|
|
265
|
-
description: "
|
|
266
|
-
签名:(config,
|
|
341
|
+
name: "configAdaptor",
|
|
342
|
+
label: "配置适配器",
|
|
343
|
+
description: "通过函数扩展配置。\
|
|
344
|
+
签名:(config, data) => config \
|
|
267
345
|
"
|
|
268
346
|
},
|
|
347
|
+
{
|
|
348
|
+
type: "text",
|
|
349
|
+
name: "className",
|
|
350
|
+
label: "CSS类名",
|
|
351
|
+
value: "bg-gray-100 border-b sm:rounded sm:border border-gray-300 p-4 mb-4"
|
|
352
|
+
},
|
|
269
353
|
],
|
|
270
354
|
events: [{}],
|
|
271
355
|
},
|
|
@@ -273,14 +357,14 @@
|
|
|
273
357
|
|
|
274
358
|
var config = {
|
|
275
359
|
group: "DevExtreme",
|
|
276
|
-
componentName: "
|
|
277
|
-
title: "
|
|
360
|
+
componentName: "AmisScheduler",
|
|
361
|
+
title: "Scheduler",
|
|
278
362
|
docUrl: "",
|
|
279
363
|
screenshot: "",
|
|
280
364
|
npm: {
|
|
281
365
|
package: "@steedos-widgets/devextreme",
|
|
282
366
|
version: "{{version}}",
|
|
283
|
-
exportName: "
|
|
367
|
+
exportName: "AmisScheduler",
|
|
284
368
|
main: "",
|
|
285
369
|
destructuring: true,
|
|
286
370
|
subName: ""
|
|
@@ -291,11 +375,11 @@
|
|
|
291
375
|
engines: ["amis"],
|
|
292
376
|
// settings for amis.
|
|
293
377
|
amis: {
|
|
294
|
-
name: 'devextreme-
|
|
378
|
+
name: 'devextreme-scheduler',
|
|
295
379
|
icon: "fa-fw fa fa-list-alt"
|
|
296
380
|
}
|
|
297
381
|
};
|
|
298
|
-
var
|
|
382
|
+
var Scheduler = __assign(__assign({}, config), { snippets: [
|
|
299
383
|
{
|
|
300
384
|
title: config.title,
|
|
301
385
|
screenshot: "",
|
|
@@ -307,7 +391,7 @@
|
|
|
307
391
|
], amis: {
|
|
308
392
|
render: {
|
|
309
393
|
type: config.amis.name,
|
|
310
|
-
usage: "
|
|
394
|
+
usage: "renderer", //使用 renderer 会无法监听到onEvent中配置的事件
|
|
311
395
|
weight: 1,
|
|
312
396
|
framework: "react"
|
|
313
397
|
},
|
|
@@ -321,26 +405,38 @@
|
|
|
321
405
|
icon: config.amis.icon,
|
|
322
406
|
scaffold: {
|
|
323
407
|
type: config.amis.name,
|
|
324
|
-
|
|
325
|
-
|
|
408
|
+
config: {
|
|
409
|
+
views: ['week', 'month'],
|
|
410
|
+
currentView: 'week',
|
|
411
|
+
currentDate: new Date(2021, 2, 28),
|
|
412
|
+
startDayHour: 9,
|
|
413
|
+
height: 730,
|
|
414
|
+
},
|
|
326
415
|
},
|
|
327
416
|
previewSchema: {
|
|
328
|
-
type:
|
|
329
|
-
|
|
417
|
+
"type": "service",
|
|
418
|
+
"api": {
|
|
419
|
+
"url": "${context.rootUrl}/api/v1/events",
|
|
420
|
+
"method": "get"
|
|
421
|
+
},
|
|
422
|
+
"body": [{
|
|
423
|
+
type: config.amis.name,
|
|
424
|
+
config: {
|
|
425
|
+
views: ['week', 'month'],
|
|
426
|
+
currentView: 'week',
|
|
427
|
+
currentDate: new Date(2021, 2, 28),
|
|
428
|
+
startDayHour: 9,
|
|
429
|
+
height: 730,
|
|
430
|
+
},
|
|
431
|
+
}]
|
|
330
432
|
},
|
|
331
433
|
panelTitle: "设置",
|
|
332
434
|
panelControls: [
|
|
333
|
-
{
|
|
334
|
-
type: "text",
|
|
335
|
-
name: "className",
|
|
336
|
-
label: "CSS类名",
|
|
337
|
-
value: "bg-gray-100 border-b sm:rounded sm:border border-gray-300 p-4 mb-4"
|
|
338
|
-
},
|
|
339
435
|
{
|
|
340
436
|
type: "editor",
|
|
341
437
|
"language": "json",
|
|
342
438
|
name: "config",
|
|
343
|
-
label: "
|
|
439
|
+
label: "Scheduler 配置",
|
|
344
440
|
pipeOut: function (value) {
|
|
345
441
|
try {
|
|
346
442
|
return value ? JSON.parse(value) : null;
|
|
@@ -353,12 +449,18 @@
|
|
|
353
449
|
{
|
|
354
450
|
type: "editor",
|
|
355
451
|
"language": "javascript",
|
|
356
|
-
name: "
|
|
357
|
-
label: "
|
|
358
|
-
description: "
|
|
359
|
-
签名:(config,
|
|
452
|
+
name: "configAdaptor",
|
|
453
|
+
label: "配置适配器",
|
|
454
|
+
description: "通过函数扩展配置。\
|
|
455
|
+
签名:(config, data) => config \
|
|
360
456
|
"
|
|
361
457
|
},
|
|
458
|
+
{
|
|
459
|
+
type: "text",
|
|
460
|
+
name: "className",
|
|
461
|
+
label: "CSS类名",
|
|
462
|
+
value: "bg-gray-100 border-b sm:rounded sm:border border-gray-300 p-4 mb-4"
|
|
463
|
+
},
|
|
362
464
|
],
|
|
363
465
|
events: [{}],
|
|
364
466
|
},
|
|
@@ -371,7 +473,7 @@
|
|
|
371
473
|
* @LastEditTime: 2022-09-01 18:46:29
|
|
372
474
|
* @Description:
|
|
373
475
|
*/
|
|
374
|
-
var components = [DataGrid, PivotGrid, Gantt];
|
|
476
|
+
var components = [DataGrid, PivotGrid, Gantt, Scheduler];
|
|
375
477
|
var componentList = [
|
|
376
478
|
{
|
|
377
479
|
title: "DevExtreme",
|
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
interface AmisDataGridProps {
|
|
3
|
+
data: any;
|
|
4
|
+
className?: string;
|
|
5
|
+
config?: object;
|
|
6
|
+
configAdaptor?: string;
|
|
7
|
+
onConfigAdaptor?: (config: any, data: any) => any;
|
|
8
|
+
[key: string]: any;
|
|
9
|
+
}
|
|
2
10
|
/**
|
|
3
11
|
* React 包装组件,用于渲染 UMD 格式的 DevExtreme DataGrid。
|
|
4
|
-
* @param {object} props - 组件属性,包括 Grid 配置、数据等。
|
|
5
12
|
*/
|
|
6
|
-
export declare const AmisDataGrid: (props:
|
|
13
|
+
export declare const AmisDataGrid: ({ data: amisData, className, config, configAdaptor, onConfigAdaptor, ...props }: AmisDataGridProps) => React.JSX.Element;
|
|
14
|
+
export {};
|
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
interface AmisGanttProps {
|
|
3
|
+
data: any;
|
|
4
|
+
className?: string;
|
|
5
|
+
config?: object;
|
|
6
|
+
configAdaptor?: string;
|
|
7
|
+
onConfigAdaptor?: (config: any, data: any) => any;
|
|
8
|
+
[key: string]: any;
|
|
9
|
+
}
|
|
2
10
|
/**
|
|
3
|
-
* React 包装组件,用于渲染 UMD 格式的 DevExtreme Gantt
|
|
11
|
+
* React 包装组件,用于渲染 UMD 格式的 DevExtreme Gantt 图。
|
|
4
12
|
*/
|
|
5
|
-
export declare const AmisGantt: ({ data: amisData, config,
|
|
13
|
+
export declare const AmisGantt: ({ data: amisData, className, config, configAdaptor, onConfigAdaptor, ...props }: AmisGanttProps) => React.JSX.Element;
|
|
14
|
+
export {};
|
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
interface AmisPivotGridProps {
|
|
3
|
+
data: any;
|
|
4
|
+
className?: string;
|
|
5
|
+
config?: object;
|
|
6
|
+
configAdaptor?: string;
|
|
7
|
+
onConfigAdaptor?: (DevExpress: any, data: any) => any;
|
|
8
|
+
[key: string]: any;
|
|
9
|
+
}
|
|
2
10
|
/**
|
|
3
11
|
* React 包装组件,用于渲染 UMD 格式的 DevExtreme PivotGrid 和 Chart。
|
|
4
12
|
*/
|
|
5
|
-
export declare const AmisPivotGrid: ({ data: amisData, config,
|
|
13
|
+
export declare const AmisPivotGrid: ({ data: amisData, className, config, configAdaptor, onConfigAdaptor, ...props }: AmisPivotGridProps) => React.JSX.Element;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface AmisSchedulerProps {
|
|
3
|
+
data: any;
|
|
4
|
+
className?: string;
|
|
5
|
+
config?: object;
|
|
6
|
+
configAdaptor?: string;
|
|
7
|
+
onConfigAdaptor?: (config: any, data: any) => any;
|
|
8
|
+
[key: string]: any;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* React 包装组件,用于渲染 UMD 格式的 DevExtreme Scheduler 日程表。
|
|
12
|
+
*/
|
|
13
|
+
export declare const AmisScheduler: ({ data: amisData, className, config, configAdaptor, onConfigAdaptor, ...props }: AmisSchedulerProps) => React.JSX.Element;
|
|
14
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@steedos-widgets/devextreme",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "6.10.
|
|
4
|
+
"version": "6.10.27",
|
|
5
5
|
"main": "dist/devextreme.cjs.js",
|
|
6
6
|
"module": "dist/devextreme.esm.js",
|
|
7
7
|
"unpkg": "dist/devextreme.umd.js",
|
|
@@ -51,5 +51,5 @@
|
|
|
51
51
|
"@rollup/plugin-replace": "^5.0.2",
|
|
52
52
|
"rollup-plugin-copy": "^3.5.0"
|
|
53
53
|
},
|
|
54
|
-
"gitHead": "
|
|
54
|
+
"gitHead": "f7462d40de26cac7dc35a6e3b3b828de55ee3edb"
|
|
55
55
|
}
|