@zat-design/sisyphus-react 3.4.13 → 3.5.0-beta.2
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/LICENSE +201 -21
- package/dist/index.esm.css +60 -0
- package/dist/less.esm.css +60 -0
- package/es/ProEditTable/components/DndWrapper/index.js +1 -0
- package/es/ProEditTable/index.d.ts +1 -1
- package/es/ProEditTable/index.js +8 -3
- package/es/ProEditTable/propsType.d.ts +1 -0
- package/es/ProForm/components/combination/FormList/components/ActionButton.js +1 -1
- package/es/ProForm/components/combination/FormList/components/ToolbarButton.js +1 -1
- package/es/ProForm/components/combination/ProModalSelect/index.js +1 -1
- package/es/ProForm/components/combination/ProNumberRange/index.js +28 -7
- package/es/ProForm/components/combination/ProNumberRange/propsType.d.ts +1 -2
- package/es/ProForm/utils/useForm.d.ts +5 -1
- package/es/ProForm/utils/useForm.js +22 -14
- package/es/ProForm/utils/valueType.d.ts +0 -6
- package/es/ProForm/utils/valueType.js +30 -2
- package/es/ProLayout/index.js +6 -2
- package/es/ProLayout/propTypes.d.ts +4 -0
- package/es/ProSelect/index.js +52 -45
- package/es/ProSelect/index.less +6 -0
- package/es/ProTable/components/DndWrapper/index.d.ts +15 -0
- package/es/ProTable/components/DndWrapper/index.js +94 -0
- package/es/ProTable/components/index.d.ts +1 -0
- package/es/ProTable/components/index.js +2 -1
- package/es/ProTable/index.d.ts +3 -0
- package/es/ProTable/index.js +177 -74
- package/es/ProTable/propsType.d.ts +5 -1
- package/es/ProTable/style/index.less +90 -0
- package/es/ProTree/utils.d.ts +1 -1
- package/es/ProTree/utils.js +1 -1
- package/es/ProTreeModal/index.js +10 -4
- package/es/ProTreeModal/style/index.less +1 -0
- package/lib/ProEditTable/components/DndWrapper/index.js +1 -0
- package/lib/ProEditTable/index.d.ts +1 -1
- package/lib/ProEditTable/index.js +8 -3
- package/lib/ProEditTable/propsType.d.ts +1 -0
- package/lib/ProForm/components/combination/FormList/components/ActionButton.js +1 -1
- package/lib/ProForm/components/combination/FormList/components/ToolbarButton.js +1 -1
- package/lib/ProForm/components/combination/ProModalSelect/index.js +1 -1
- package/lib/ProForm/components/combination/ProNumberRange/index.js +28 -7
- package/lib/ProForm/components/combination/ProNumberRange/propsType.d.ts +1 -2
- package/lib/ProForm/utils/useForm.d.ts +5 -1
- package/lib/ProForm/utils/useForm.js +22 -14
- package/lib/ProForm/utils/valueType.d.ts +0 -6
- package/lib/ProForm/utils/valueType.js +30 -2
- package/lib/ProLayout/index.js +6 -2
- package/lib/ProLayout/propTypes.d.ts +4 -0
- package/lib/ProSelect/index.js +54 -45
- package/lib/ProSelect/index.less +6 -0
- package/lib/ProTable/components/DndWrapper/index.d.ts +15 -0
- package/lib/ProTable/components/DndWrapper/index.js +101 -0
- package/lib/ProTable/components/index.d.ts +1 -0
- package/lib/ProTable/components/index.js +15 -1
- package/lib/ProTable/index.d.ts +3 -0
- package/lib/ProTable/index.js +173 -70
- package/lib/ProTable/propsType.d.ts +5 -1
- package/lib/ProTable/style/index.less +90 -0
- package/lib/ProTree/utils.d.ts +1 -1
- package/lib/ProTree/utils.js +1 -1
- package/lib/ProTreeModal/index.js +10 -4
- package/lib/ProTreeModal/style/index.less +1 -0
- package/package.json +2 -2
package/lib/ProTable/index.js
CHANGED
|
@@ -6,6 +6,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.defaultPage = exports.default = exports.TableContext = void 0;
|
|
8
8
|
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
|
|
9
|
+
var _regeneratorRuntime2 = _interopRequireDefault(require("@babel/runtime/helpers/regeneratorRuntime"));
|
|
10
|
+
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
9
11
|
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
10
12
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
13
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
@@ -28,7 +30,7 @@ var _reset = _interopRequireDefault(require("../assets/reset.svg"));
|
|
|
28
30
|
var _customColumn = _interopRequireDefault(require("../assets/customColumn.svg"));
|
|
29
31
|
var _utils3 = require("./utils");
|
|
30
32
|
var _locale = _interopRequireDefault(require("../locale"));
|
|
31
|
-
var _excluded = ["tableId", "headerRender", "footerRender", "quickConfig", "stripe", "columns", "className", "summary", "emptyText", "originalDataSource"],
|
|
33
|
+
var _excluded = ["tableId", "headerRender", "footerRender", "quickConfig", "stripe", "columns", "className", "draggable", "disabled", "isView", "rowDisabled", "summary", "emptyText", "originalDataSource"],
|
|
32
34
|
_excluded2 = ["resizeColumn", "columnConfig", "cacheTime", "storage"];
|
|
33
35
|
var defaultCacheTime = 1; // columns 配置保存时间为一天
|
|
34
36
|
// 全局上下文
|
|
@@ -53,6 +55,10 @@ function ProTable(props) {
|
|
|
53
55
|
_props$columns = props.columns,
|
|
54
56
|
propsColumns = _props$columns === void 0 ? [] : _props$columns,
|
|
55
57
|
className = props.className,
|
|
58
|
+
draggable = props.draggable,
|
|
59
|
+
disabled = props.disabled,
|
|
60
|
+
isView = props.isView,
|
|
61
|
+
rowDisabled = props.rowDisabled,
|
|
56
62
|
summary = props.summary,
|
|
57
63
|
_props$emptyText = props.emptyText,
|
|
58
64
|
emptyText = _props$emptyText === void 0 ? _locale.default === null || _locale.default === void 0 ? void 0 : (_locale$ProTable = _locale.default.ProTable) === null || _locale$ProTable === void 0 ? void 0 : _locale$ProTable.noData : _props$emptyText,
|
|
@@ -78,8 +84,24 @@ function ProTable(props) {
|
|
|
78
84
|
pagination = _ref3.pagination,
|
|
79
85
|
dataSource = _ref3.dataSource,
|
|
80
86
|
rowKey = _ref3.rowKey;
|
|
87
|
+
var initDataSource = dataSource === null || dataSource === void 0 ? void 0 : dataSource.map(function (item) {
|
|
88
|
+
return (0, _objectSpread4.default)((0, _objectSpread4.default)({}, item), {}, {
|
|
89
|
+
rowKey: item === null || item === void 0 ? void 0 : item[rowKey]
|
|
90
|
+
});
|
|
91
|
+
});
|
|
92
|
+
var _useSetState = (0, _ahooks.useSetState)({
|
|
93
|
+
dataSource: initDataSource
|
|
94
|
+
}),
|
|
95
|
+
_useSetState2 = (0, _slicedToArray2.default)(_useSetState, 2),
|
|
96
|
+
_dataSource = _useSetState2[0].dataSource,
|
|
97
|
+
setState = _useSetState2[1];
|
|
98
|
+
(0, _ahooks.useDeepCompareEffect)(function () {
|
|
99
|
+
setState({
|
|
100
|
+
dataSource: initDataSource
|
|
101
|
+
});
|
|
102
|
+
}, [initDataSource]);
|
|
81
103
|
var originalObj = originalDataSource ? (0, _lodash.keyBy)(originalDataSource, rowKey) : undefined;
|
|
82
|
-
var dataSourceObj =
|
|
104
|
+
var dataSourceObj = _dataSource ? (0, _lodash.keyBy)(_dataSource, rowKey) : {};
|
|
83
105
|
var propsColumnObj = (0, _react.useMemo)(function () {
|
|
84
106
|
return propsColumns.reduce(function (acc, cur) {
|
|
85
107
|
// @ts-ignore
|
|
@@ -226,7 +248,7 @@ function ProTable(props) {
|
|
|
226
248
|
var _ref6 = tableProps || {},
|
|
227
249
|
dataSource = _ref6.dataSource;
|
|
228
250
|
// 没有数据时,不展示合计栏
|
|
229
|
-
if (!(
|
|
251
|
+
if (!(_dataSource === null || _dataSource === void 0 ? void 0 : _dataSource.length)) {
|
|
230
252
|
return null;
|
|
231
253
|
}
|
|
232
254
|
return (0, _jsxRuntime.jsx)(_antd.Table.Summary, {
|
|
@@ -247,7 +269,7 @@ function ProTable(props) {
|
|
|
247
269
|
} else if (total && key) {
|
|
248
270
|
var _dataSource$reduce;
|
|
249
271
|
var format = _utils2.valueTypeRender === null || _utils2.valueTypeRender === void 0 ? void 0 : _utils2.valueTypeRender[valueType];
|
|
250
|
-
var sum =
|
|
272
|
+
var sum = _dataSource === null || _dataSource === void 0 ? void 0 : (_dataSource$reduce = _dataSource.reduce) === null || _dataSource$reduce === void 0 ? void 0 : _dataSource$reduce.call(_dataSource, function (pre, cur) {
|
|
251
273
|
var _get;
|
|
252
274
|
return _utils.tools.calc(pre, '+', (_get = (0, _lodash.get)(cur, key)) !== null && _get !== void 0 ? _get : 0);
|
|
253
275
|
}, 0);
|
|
@@ -265,91 +287,172 @@ function ProTable(props) {
|
|
|
265
287
|
};
|
|
266
288
|
var cls = (0, _classnames2.default)((0, _defineProperty2.default)({
|
|
267
289
|
'pro-table': true,
|
|
268
|
-
'pro-table-no-stripe': !stripe
|
|
290
|
+
'pro-table-no-stripe': !stripe,
|
|
291
|
+
'pro-table-draggable-only': draggable && !(tableProps === null || tableProps === void 0 ? void 0 : tableProps.rowSelection)
|
|
269
292
|
}, className, className));
|
|
293
|
+
// 复选框
|
|
294
|
+
var _rowSelection = tableProps.rowSelection ? (0, _objectSpread4.default)({
|
|
295
|
+
fixed: draggable,
|
|
296
|
+
getCheckboxProps: function getCheckboxProps(record) {
|
|
297
|
+
if (rowDisabled) {
|
|
298
|
+
var _disabled = rowDisabled(record);
|
|
299
|
+
return {
|
|
300
|
+
disabled: _disabled
|
|
301
|
+
};
|
|
302
|
+
}
|
|
303
|
+
return {};
|
|
304
|
+
},
|
|
305
|
+
hideSelectAll: disabled || isView
|
|
306
|
+
}, tableProps.rowSelection) : undefined;
|
|
307
|
+
/**
|
|
308
|
+
* 渲染表格选择器
|
|
309
|
+
* @returns rowSelection
|
|
310
|
+
*/
|
|
311
|
+
var renderRowSelection = function renderRowSelection() {
|
|
312
|
+
if (disabled || isView) {
|
|
313
|
+
return null;
|
|
314
|
+
}
|
|
315
|
+
if (draggable && !tableProps.rowSelection) {
|
|
316
|
+
return {
|
|
317
|
+
fixed: true,
|
|
318
|
+
hideSelectAll: true,
|
|
319
|
+
renderCell: function renderCell() {
|
|
320
|
+
return (0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {});
|
|
321
|
+
}
|
|
322
|
+
};
|
|
323
|
+
}
|
|
324
|
+
return _rowSelection;
|
|
325
|
+
};
|
|
326
|
+
var onDataSourceChange = /*#__PURE__*/function () {
|
|
327
|
+
var _ref8 = (0, _asyncToGenerator2.default)( /*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee(nextDataSource) {
|
|
328
|
+
return (0, _regeneratorRuntime2.default)().wrap(function _callee$(_context) {
|
|
329
|
+
while (1) switch (_context.prev = _context.next) {
|
|
330
|
+
case 0:
|
|
331
|
+
setState({
|
|
332
|
+
dataSource: nextDataSource
|
|
333
|
+
});
|
|
334
|
+
// 覆盖引用值
|
|
335
|
+
(0, _lodash.assign)(dataSource, nextDataSource);
|
|
336
|
+
case 2:
|
|
337
|
+
case "end":
|
|
338
|
+
return _context.stop();
|
|
339
|
+
}
|
|
340
|
+
}, _callee);
|
|
341
|
+
}));
|
|
342
|
+
return function onDataSourceChange(_x) {
|
|
343
|
+
return _ref8.apply(this, arguments);
|
|
344
|
+
};
|
|
345
|
+
}();
|
|
346
|
+
var renderComponents = function renderComponents() {
|
|
347
|
+
if (draggable) {
|
|
348
|
+
return {
|
|
349
|
+
body: {
|
|
350
|
+
row: _components.Row
|
|
351
|
+
}
|
|
352
|
+
};
|
|
353
|
+
}
|
|
354
|
+
if (resizeColumn) {
|
|
355
|
+
return _components.TableResizable.components;
|
|
356
|
+
}
|
|
357
|
+
return null;
|
|
358
|
+
};
|
|
270
359
|
return (0, _jsxRuntime.jsx)(TableContext.Provider, {
|
|
271
360
|
value: {
|
|
272
361
|
pathKey: pathKey,
|
|
273
362
|
tableConfig: tableConfig,
|
|
274
363
|
Storage: Storage
|
|
275
364
|
},
|
|
276
|
-
children: (0, _jsxRuntime.
|
|
365
|
+
children: (0, _jsxRuntime.jsx)("div", {
|
|
277
366
|
className: cls,
|
|
278
|
-
children:
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
className: "
|
|
285
|
-
children: [
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
onClick: resetColumnWidth,
|
|
292
|
-
children: _locale.default === null || _locale.default === void 0 ? void 0 : (_locale$ProTable2 = _locale.default.ProTable) === null || _locale$ProTable2 === void 0 ? void 0 : _locale$ProTable2.resetColumnWidth
|
|
293
|
-
}), columnConfig && (0, _jsxRuntime.jsx)(_index.ProTreeModal, {
|
|
294
|
-
title: _locale.default === null || _locale.default === void 0 ? void 0 : (_locale$ProTable3 = _locale.default.ProTable) === null || _locale$ProTable3 === void 0 ? void 0 : _locale$ProTable3.customColumns,
|
|
295
|
-
span: 8,
|
|
296
|
-
mode: "list",
|
|
297
|
-
draggable: true,
|
|
298
|
-
dataSource: customColumns,
|
|
299
|
-
value: checkColumns,
|
|
300
|
-
allValue: "all",
|
|
301
|
-
onChange: handleColumnConfig,
|
|
302
|
-
trigger: (0, _jsxRuntime.jsx)(_antd.Button, {
|
|
303
|
-
className: "custom-column-btn",
|
|
367
|
+
children: (0, _jsxRuntime.jsxs)(_components.DndWrapper, {
|
|
368
|
+
value: _dataSource,
|
|
369
|
+
onChange: onDataSourceChange,
|
|
370
|
+
disabled: false,
|
|
371
|
+
draggable: draggable,
|
|
372
|
+
children: [(headerRender || columnConfig || resizeColumn) && (0, _jsxRuntime.jsxs)("div", {
|
|
373
|
+
className: "column-config",
|
|
374
|
+
children: [(0, _jsxRuntime.jsx)("div", {
|
|
375
|
+
className: "left-contain",
|
|
376
|
+
children: headerRender ? typeof headerRender === 'function' ? headerRender() : headerRender : null
|
|
377
|
+
}), (0, _jsxRuntime.jsxs)("div", {
|
|
378
|
+
className: "right-actions",
|
|
379
|
+
children: [resizeColumn && (0, _jsxRuntime.jsx)(_antd.Button, {
|
|
304
380
|
icon: (0, _jsxRuntime.jsx)(_reactSvg.ReactSVG, {
|
|
305
381
|
className: "anticon",
|
|
306
382
|
wrapper: "span",
|
|
307
|
-
src:
|
|
383
|
+
src: _reset.default
|
|
308
384
|
}),
|
|
309
|
-
|
|
310
|
-
|
|
385
|
+
onClick: resetColumnWidth,
|
|
386
|
+
children: _locale.default === null || _locale.default === void 0 ? void 0 : (_locale$ProTable2 = _locale.default.ProTable) === null || _locale$ProTable2 === void 0 ? void 0 : _locale$ProTable2.resetColumnWidth
|
|
387
|
+
}), columnConfig && (0, _jsxRuntime.jsx)(_index.ProTreeModal, {
|
|
388
|
+
title: _locale.default === null || _locale.default === void 0 ? void 0 : (_locale$ProTable3 = _locale.default.ProTable) === null || _locale$ProTable3 === void 0 ? void 0 : _locale$ProTable3.customColumns,
|
|
389
|
+
span: 8,
|
|
390
|
+
mode: "list",
|
|
391
|
+
draggable: true,
|
|
392
|
+
dataSource: customColumns,
|
|
393
|
+
value: checkColumns,
|
|
394
|
+
allValue: "all",
|
|
395
|
+
onChange: handleColumnConfig,
|
|
396
|
+
trigger: (0, _jsxRuntime.jsx)(_antd.Button, {
|
|
397
|
+
className: "custom-column-btn",
|
|
398
|
+
icon: (0, _jsxRuntime.jsx)(_reactSvg.ReactSVG, {
|
|
399
|
+
className: "anticon",
|
|
400
|
+
wrapper: "span",
|
|
401
|
+
src: _customColumn.default
|
|
402
|
+
}),
|
|
403
|
+
children: _locale.default === null || _locale.default === void 0 ? void 0 : (_locale$ProTable4 = _locale.default.ProTable) === null || _locale$ProTable4 === void 0 ? void 0 : _locale$ProTable4.customColumns
|
|
404
|
+
})
|
|
405
|
+
})]
|
|
311
406
|
})]
|
|
312
|
-
})
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
407
|
+
}), (0, _jsxRuntime.jsxs)("div", {
|
|
408
|
+
className: "pro-table-container",
|
|
409
|
+
children: [(0, _jsxRuntime.jsx)(_antd.Table, (0, _objectSpread4.default)((0, _objectSpread4.default)({
|
|
410
|
+
className: draggable ? 'pro-edit-table-drag' : '',
|
|
411
|
+
// components={resizeColumn ? TableResizable.components : undefined}
|
|
412
|
+
components: renderComponents(),
|
|
413
|
+
// @ts-ignore
|
|
414
|
+
columns: columns,
|
|
415
|
+
locale: {
|
|
416
|
+
emptyText: (0, _jsxRuntime.jsxs)("div", {
|
|
417
|
+
className: "pro-table-empty",
|
|
418
|
+
children: [(0, _jsxRuntime.jsx)("div", {
|
|
419
|
+
className: "empty-image",
|
|
420
|
+
children: (0, _jsxRuntime.jsx)("img", {
|
|
421
|
+
src: _empty.default,
|
|
422
|
+
alt: _locale.default === null || _locale.default === void 0 ? void 0 : (_locale$ProTable5 = _locale.default.ProTable) === null || _locale$ProTable5 === void 0 ? void 0 : _locale$ProTable5.noData
|
|
423
|
+
})
|
|
424
|
+
}), (0, _jsxRuntime.jsx)("div", {
|
|
425
|
+
className: "empty-description",
|
|
426
|
+
children: typeof emptyText === 'function' ? emptyText() : emptyText
|
|
427
|
+
})]
|
|
428
|
+
})
|
|
429
|
+
},
|
|
430
|
+
summary: (0, _typeof2.default)(summary) === 'object' ? function () {
|
|
431
|
+
return renderSummary();
|
|
432
|
+
} : summary,
|
|
433
|
+
rowClassName: function rowClassName(record, index) {
|
|
434
|
+
if (originalDataSource && !originalObj.hasOwnProperty((0, _lodash.get)(record, rowKey))) {
|
|
435
|
+
return 'new-cell';
|
|
436
|
+
}
|
|
340
437
|
}
|
|
341
|
-
}
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
438
|
+
}, tableProps), {}, {
|
|
439
|
+
dataSource: _dataSource,
|
|
440
|
+
rowSelection: renderRowSelection()
|
|
441
|
+
})), (0, _jsxRuntime.jsx)(_components.ResizableLine, {})]
|
|
442
|
+
}), footerRender ? (0, _jsxRuntime.jsx)("div", {
|
|
443
|
+
className: "pro-table-footer ".concat(pagination && !!(_dataSource === null || _dataSource === void 0 ? void 0 : _dataSource.length) ? 'has-page' : 'no-page'),
|
|
444
|
+
children: typeof footerRender === 'function' ? footerRender() : footerRender
|
|
445
|
+
}) : null]
|
|
446
|
+
})
|
|
347
447
|
})
|
|
348
448
|
});
|
|
349
449
|
}
|
|
350
450
|
ProTable.defaultProps = {
|
|
351
451
|
quickConfig: false,
|
|
352
|
-
stripe: true
|
|
452
|
+
stripe: true,
|
|
453
|
+
draggable: false,
|
|
454
|
+
disabled: false,
|
|
455
|
+
isView: false
|
|
353
456
|
};
|
|
354
457
|
ProTable.useAntdTable = _useAntdTable.default;
|
|
355
458
|
var _default = exports.default = ProTable;
|
|
@@ -35,7 +35,7 @@ export interface ProTableColumn extends Omit<ColumnType<any>, 'dataIndex'> {
|
|
|
35
35
|
};
|
|
36
36
|
transform?: (value: any, record?: any) => string[];
|
|
37
37
|
}
|
|
38
|
-
export interface ProTableProps extends Omit<TableProps<any>, 'summary' | 'columns'> {
|
|
38
|
+
export interface ProTableProps<T = any> extends Omit<TableProps<any>, 'summary' | 'columns'> {
|
|
39
39
|
tableId?: string;
|
|
40
40
|
rowKey?: string | GetRowKey<any>;
|
|
41
41
|
headerRender?: ReactNode | (() => ReactNode);
|
|
@@ -49,6 +49,10 @@ export interface ProTableProps extends Omit<TableProps<any>, 'summary' | 'column
|
|
|
49
49
|
footerRender?: ReactNode | (() => ReactNode);
|
|
50
50
|
emptyText?: string | ReactNode | (() => ReactNode);
|
|
51
51
|
summary?: ProTableSummaryProps | TableProps<any>['summary'];
|
|
52
|
+
draggable?: boolean;
|
|
53
|
+
disabled?: boolean;
|
|
54
|
+
isView?: boolean;
|
|
55
|
+
rowDisabled?: (record?: T) => string | boolean;
|
|
52
56
|
/**
|
|
53
57
|
* 斑马纹设置
|
|
54
58
|
*/
|
|
@@ -2,6 +2,90 @@
|
|
|
2
2
|
@import (reference) '~antd/es/style/themes/index.less';
|
|
3
3
|
|
|
4
4
|
.pro-table {
|
|
5
|
+
&.pro-table-draggable-only{
|
|
6
|
+
.ant-table-tbody{
|
|
7
|
+
.anticon {
|
|
8
|
+
margin-right: 0;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.@{ant-prefix}-table-content {
|
|
14
|
+
>table {
|
|
15
|
+
.@{ant-prefix}-table-summary {
|
|
16
|
+
background-color: var(--zaui-table-header-bg, #f2f3f5);
|
|
17
|
+
color : var(--zaui-text, #343434);
|
|
18
|
+
font-weight : 600;
|
|
19
|
+
|
|
20
|
+
.@{ant-prefix}-table-cell-fix-left,
|
|
21
|
+
.@{ant-prefix}-table-cell-fix-right {
|
|
22
|
+
background-color: var(--zaui-table-header-bg, #f2f3f5);
|
|
23
|
+
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
th.@{ant-prefix}-table-selection-column {
|
|
28
|
+
width: 48px;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
td {
|
|
32
|
+
.pro-form-view-container_nowrap {
|
|
33
|
+
white-space: normal;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.@{ant-prefix}-table-thead>tr>th:not(.@{ant-prefix}-table-selection-column):not(.@{ant-prefix}-table-row-expand-icon-cell):not([colspan]).is-required {
|
|
38
|
+
&.is-required-right {
|
|
39
|
+
.pro-edit-table-title {
|
|
40
|
+
&::before {
|
|
41
|
+
position : static;
|
|
42
|
+
top : 0;
|
|
43
|
+
display : inline-block;
|
|
44
|
+
text-indent: -8px;
|
|
45
|
+
color : #ff5050;
|
|
46
|
+
font-size : var(--zaui-font-size-md, 14px);
|
|
47
|
+
line-height: 1;
|
|
48
|
+
content : "*";
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
&.is-required-left {
|
|
53
|
+
.pro-edit-table-title {
|
|
54
|
+
&::after {
|
|
55
|
+
width: auto;
|
|
56
|
+
position : static;
|
|
57
|
+
top : 0;
|
|
58
|
+
display : inline-block;
|
|
59
|
+
margin-left: var(--zaui-space-size-xs, 4px);
|
|
60
|
+
color : #ff5050;
|
|
61
|
+
font-size : 14px;
|
|
62
|
+
line-height: 1;
|
|
63
|
+
content : "*";
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
.drag-wrapper {
|
|
71
|
+
display: flex;
|
|
72
|
+
width: 20px;
|
|
73
|
+
.anticon {
|
|
74
|
+
cursor: pointer;
|
|
75
|
+
margin-right: 12px;
|
|
76
|
+
.drag-icon{
|
|
77
|
+
margin-right: 0;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
.drag-wrapper.no-check {
|
|
82
|
+
.anticon {
|
|
83
|
+
margin-right: 0;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
|
|
5
89
|
&.pro-table-bordered {
|
|
6
90
|
.@{ant-prefix}-table .@{ant-prefix}-table-thead > tr > th {
|
|
7
91
|
border-bottom: 1px solid #f0f0f0;
|
|
@@ -465,3 +549,9 @@
|
|
|
465
549
|
}
|
|
466
550
|
}
|
|
467
551
|
}
|
|
552
|
+
|
|
553
|
+
.pro-edit-table-drag {
|
|
554
|
+
table tr th.@{ant-prefix}-table-selection-column.@{ant-prefix}-table-cell-fix-left{
|
|
555
|
+
text-align: right;
|
|
556
|
+
}
|
|
557
|
+
}
|
package/lib/ProTree/utils.d.ts
CHANGED
|
@@ -22,7 +22,7 @@ export declare function getAllKeys(data: TreeDataProps[], fieldNames: FieldNames
|
|
|
22
22
|
export declare const getParentKey: (key: string, tree: TreeDataProps[], fieldNames: FieldNamesType) => string;
|
|
23
23
|
export declare function findTreeNodeByKey(treeData: TreeDataProps[], key: string, fieldNames: FieldNamesType): TreeDataProps[];
|
|
24
24
|
/**
|
|
25
|
-
*
|
|
25
|
+
* 过滤掉每一层假值(例如 false、null、0、""、undefined 等)
|
|
26
26
|
* @param data
|
|
27
27
|
* @param checkedKeys
|
|
28
28
|
* @returns
|
package/lib/ProTree/utils.js
CHANGED
|
@@ -260,10 +260,16 @@ var ProTreeModal = function ProTreeModal(props) {
|
|
|
260
260
|
}
|
|
261
261
|
onChange === null || onChange === void 0 ? void 0 : onChange(values);
|
|
262
262
|
}
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
263
|
+
// fix: 当有 openChange 时候、点击确定应该由关闭 openChange 控制
|
|
264
|
+
if (!openChange || open === undefined) {
|
|
265
|
+
setState({
|
|
266
|
+
open: false
|
|
267
|
+
});
|
|
268
|
+
openChange === null || openChange === void 0 ? void 0 : openChange(false);
|
|
269
|
+
}
|
|
270
|
+
if (openChange && open !== undefined) {
|
|
271
|
+
openChange === null || openChange === void 0 ? void 0 : openChange(true);
|
|
272
|
+
}
|
|
267
273
|
};
|
|
268
274
|
/**
|
|
269
275
|
* clear all checked
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zat-design/sisyphus-react",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.5.0-beta.2",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "es/index.js",
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
"@dnd-kit/sortable": "^7.0.2",
|
|
59
59
|
"@dnd-kit/utilities": "^3.2.1",
|
|
60
60
|
"@pansy/react-watermark": "^3.1.13",
|
|
61
|
-
"@zat-design/utils": "^1.1.
|
|
61
|
+
"@zat-design/utils": "^1.1.23",
|
|
62
62
|
"ahooks": "3.7.4",
|
|
63
63
|
"antd": "4.24.8",
|
|
64
64
|
"big.js": "^6.2.1",
|