@ccs-ui/rc-pro 2.3.6-beta-40 → 2.4.0-beta.1
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/docs-dist/154.1dfbf448.async.js +137 -0
- package/docs-dist/27.cf0e6aaf.async.js +11 -0
- package/docs-dist/272.98b3528d.async.js +15 -0
- package/docs-dist/272.e8c51481.chunk.css +5 -0
- package/docs-dist/313.ee13d2ba.async.js +5 -0
- package/docs-dist/387.c3734c23.async.js +573 -0
- package/docs-dist/404.html +15 -0
- package/docs-dist/859.2ac4ce6d.async.js +18 -0
- package/docs-dist/auth__demos.106c6ce7.async.js +1 -0
- package/docs-dist/button__demos.4c22be73.async.js +1 -0
- package/docs-dist/cascader__demos.46cb399e.async.js +1 -0
- package/docs-dist/date-picker__demos.cb7b5f00.async.js +1 -0
- package/docs-dist/dialog__demos.e4f54d6e.async.js +1 -0
- package/docs-dist/docs__guide.md.33be0665.chunk.css +1 -0
- package/docs-dist/docs__guide.md.fa186b09.async.js +1 -0
- package/docs-dist/docs__index.md.22217718.async.js +1 -0
- package/docs-dist/docs__index.md.33be0665.chunk.css +1 -0
- package/docs-dist/dumi__tmp-production__dumi__theme__ContextWrapper.a5f4a8dc.async.js +1 -0
- package/docs-dist/editor__demos.0b8f6819.async.js +6 -0
- package/docs-dist/favicon.png +0 -0
- package/docs-dist/group-form-item__demos.121f2381.async.js +1 -0
- package/docs-dist/guide/index.html +15 -0
- package/docs-dist/index.html +15 -0
- package/docs-dist/interval-button__demos.a9fa2598.async.js +1 -0
- package/docs-dist/loading__demos.0b2a0a1e.async.js +1 -0
- package/docs-dist/logo.svg +48 -0
- package/docs-dist/meta__docs.58d867fc.async.js +1 -0
- package/docs-dist/meta__packages.20ad7ce8.async.js +10079 -0
- package/docs-dist/meta__packages.9ed2b563.chunk.css +1 -0
- package/docs-dist/nm__dumi__dist__client__pages__404.28f3e467.async.js +1 -0
- package/docs-dist/nm__dumi__dist__client__pages__404.8b85f2d9.chunk.css +1 -0
- package/docs-dist/nm__dumi__dist__client__pages__Demo__index.1d26abae.async.js +1 -0
- package/docs-dist/nm__dumi__dist__client__pages__Demo__index.578aa5c0.chunk.css +1 -0
- package/docs-dist/nm__dumi__theme-default__layouts__DocLayout__index.626881d5.async.js +1 -0
- package/docs-dist/packages__rc-pro__src__auth__index.md.33be0665.chunk.css +1 -0
- package/docs-dist/packages__rc-pro__src__auth__index.md.80345bcc.async.js +1 -0
- package/docs-dist/packages__rc-pro__src__button__index.md.05cb5ebc.async.js +1 -0
- package/docs-dist/packages__rc-pro__src__button__index.md.33be0665.chunk.css +1 -0
- package/docs-dist/packages__rc-pro__src__cascader__index.md.33be0665.chunk.css +1 -0
- package/docs-dist/packages__rc-pro__src__cascader__index.md.d8535a05.async.js +1 -0
- package/docs-dist/packages__rc-pro__src__date-picker__index.md.33be0665.chunk.css +1 -0
- package/docs-dist/packages__rc-pro__src__date-picker__index.md.bab3c69e.async.js +1 -0
- package/docs-dist/packages__rc-pro__src__dialog__index.md.33be0665.chunk.css +1 -0
- package/docs-dist/packages__rc-pro__src__dialog__index.md.64ec2666.async.js +1 -0
- package/docs-dist/packages__rc-pro__src__editor__index.md.33be0665.chunk.css +1 -0
- package/docs-dist/packages__rc-pro__src__editor__index.md.a18cb4dc.async.js +1 -0
- package/docs-dist/packages__rc-pro__src__group-form-item__index.md.33be0665.chunk.css +1 -0
- package/docs-dist/packages__rc-pro__src__group-form-item__index.md.7d1da762.async.js +1 -0
- package/docs-dist/packages__rc-pro__src__index.md.33be0665.chunk.css +1 -0
- package/docs-dist/packages__rc-pro__src__index.md.d9449737.async.js +1 -0
- package/docs-dist/packages__rc-pro__src__interval-button__index.md.33be0665.chunk.css +1 -0
- package/docs-dist/packages__rc-pro__src__interval-button__index.md.c725522b.async.js +1 -0
- package/docs-dist/packages__rc-pro__src__layout-keep-alive__index.md.33be0665.chunk.css +1 -0
- package/docs-dist/packages__rc-pro__src__layout-keep-alive__index.md.d39a1325.async.js +1 -0
- package/docs-dist/packages__rc-pro__src__loading__index.md.33be0665.chunk.css +1 -0
- package/docs-dist/packages__rc-pro__src__loading__index.md.893eb1e0.async.js +1 -0
- package/docs-dist/packages__rc-pro__src__pro-table__index.md.33be0665.chunk.css +1 -0
- package/docs-dist/packages__rc-pro__src__pro-table__index.md.352db0a4.async.js +1 -0
- package/docs-dist/packages__rc-pro__src__pro-tabs__index.md.33be0665.chunk.css +1 -0
- package/docs-dist/packages__rc-pro__src__pro-tabs__index.md.f6578fee.async.js +1 -0
- package/docs-dist/packages__rc-pro__src__result__index.md.33be0665.chunk.css +1 -0
- package/docs-dist/packages__rc-pro__src__result__index.md.737b704c.async.js +2 -0
- package/docs-dist/packages__rc-pro__src__select__index.md.33be0665.chunk.css +1 -0
- package/docs-dist/packages__rc-pro__src__select__index.md.35981c54.async.js +2 -0
- package/docs-dist/packages__rc-pro__src__time-picker__index.md.33be0665.chunk.css +1 -0
- package/docs-dist/packages__rc-pro__src__time-picker__index.md.b525b352.async.js +1 -0
- package/docs-dist/packages__rc-pro__src__water-mark__index.md.33be0665.chunk.css +1 -0
- package/docs-dist/packages__rc-pro__src__water-mark__index.md.8e548df5.async.js +1 -0
- package/docs-dist/preload_helper.5f80f118.js +1 -0
- package/docs-dist/pro-table__demos.09e87ab4.async.js +1 -0
- package/docs-dist/pro-tabs__demos.eff953d6.async.js +1 -0
- package/docs-dist/rc-pros/auth/index.html +15 -0
- package/docs-dist/rc-pros/button/index.html +15 -0
- package/docs-dist/rc-pros/cascader/index.html +15 -0
- package/docs-dist/rc-pros/date-picker/index.html +15 -0
- package/docs-dist/rc-pros/dialog/index.html +15 -0
- package/docs-dist/rc-pros/editor/index.html +15 -0
- package/docs-dist/rc-pros/group-form-item/index.html +15 -0
- package/docs-dist/rc-pros/index.html +15 -0
- package/docs-dist/rc-pros/interval-button/index.html +15 -0
- package/docs-dist/rc-pros/layout-keep-alive/index.html +15 -0
- package/docs-dist/rc-pros/loading/index.html +15 -0
- package/docs-dist/rc-pros/pro-table/index.html +15 -0
- package/docs-dist/rc-pros/pro-tabs/index.html +15 -0
- package/docs-dist/rc-pros/result/index.html +15 -0
- package/docs-dist/rc-pros/select/index.html +15 -0
- package/docs-dist/rc-pros/time-picker/index.html +15 -0
- package/docs-dist/rc-pros/water-mark/index.html +15 -0
- package/docs-dist/result__demos.4832bcb4.async.js +1 -0
- package/docs-dist/select__demos.e57e694a.async.js +1 -0
- package/docs-dist/time-picker__demos.518f8acb.async.js +1 -0
- package/docs-dist/umi.4e0bcd92.css +1 -0
- package/docs-dist/umi.cc941610.js +108 -0
- package/docs-dist/water-mark__demos.4e7773cd.async.js +1 -0
- package/docs-dist/~demos/:id/index.html +15 -0
- package/docs-dist/~demos/auth-demo-basic/index.html +15 -0
- package/docs-dist/~demos/button-demo-button/index.html +15 -0
- package/docs-dist/~demos/button-demo-group/index.html +15 -0
- package/docs-dist/~demos/cascader-demo-basic/index.html +15 -0
- package/docs-dist/~demos/cascader-demo-cache/index.html +15 -0
- package/docs-dist/~demos/date-picker-demo-basic/index.html +15 -0
- package/docs-dist/~demos/date-picker-demo-range/index.html +15 -0
- package/docs-dist/~demos/dialog-demo-demos/index.html +15 -0
- package/docs-dist/~demos/editor-demo-demos/index.html +15 -0
- package/docs-dist/~demos/group-form-item-demo-basic/index.html +15 -0
- package/docs-dist/~demos/interval-button-demo-basic/index.html +15 -0
- package/docs-dist/~demos/loading-demo-basic/index.html +15 -0
- package/docs-dist/~demos/pro-table-demo-basic/index.html +15 -0
- package/docs-dist/~demos/pro-table-demo-fixed/index.html +15 -0
- package/docs-dist/~demos/pro-table-demo-selection/index.html +15 -0
- package/docs-dist/~demos/pro-tabs-demo-basic/index.html +15 -0
- package/docs-dist/~demos/pro-tabs-demo-tab/index.html +15 -0
- package/docs-dist/~demos/result-demo-basic/index.html +15 -0
- package/docs-dist/~demos/select-demo-api/index.html +15 -0
- package/docs-dist/~demos/select-demo-basic/index.html +15 -0
- package/docs-dist/~demos/select-demo-customize/index.html +15 -0
- package/docs-dist/~demos/select-demo-customize-label/index.html +15 -0
- package/docs-dist/~demos/time-picker-demo-basic/index.html +15 -0
- package/docs-dist/~demos/water-mark-demo-basic/index.html +15 -0
- package/es/Foo/d +0 -0
- package/es/aj-captcha/index.less +9 -23
- package/es/auth/index.d.ts +7 -0
- package/es/auth/index.js +14 -0
- package/es/cascader/index.js +4 -4
- package/es/ccs.d.ts +7 -13
- package/es/config.js +33 -11
- package/es/context/index.d.ts +2 -2
- package/es/date-picker/index.js +20 -0
- package/es/dialog/button.d.ts +1 -1
- package/es/dialog/button.js +4 -4
- package/es/dialog/index.d.ts +0 -1
- package/es/dialog/index.js +0 -1
- package/es/ellipsis/index.js +4 -2
- package/es/ellipsis/useResizeEffect.js +10 -24
- package/es/group-form-item/index.d.ts +11 -0
- package/es/group-form-item/index.js +124 -0
- package/es/hooks/use-page.d.ts +1 -1
- package/es/hooks/use-selection.d.ts +12 -23
- package/es/hooks/use-selection.js +51 -25
- package/es/index.d.ts +1 -3
- package/es/index.js +1 -3
- package/es/interval-button/index.js +4 -4
- package/es/layout-keep-alive/index.d.ts +1 -1
- package/es/layout-keep-alive/index.js +26 -20
- package/es/layout-keep-alive/index.less +19 -23
- package/es/layout-keep-alive/page.d.ts +3 -2
- package/es/layout-keep-alive/page.js +4 -3
- package/es/layout-single-page/index.d.ts +5 -3
- package/es/layout-single-page/index.js +12 -5
- package/es/layout-single-page/index.less +2 -8
- package/es/layout-single-page/page.d.ts +3 -1
- package/es/layout-single-page/page.js +2 -1
- package/es/pro-table/_utils.d.ts +1 -1
- package/es/pro-table/_utils.js +7 -7
- package/es/pro-table/form-item.d.ts +5 -3
- package/es/pro-table/form-item.js +28 -11
- package/es/pro-table/head.js +88 -63
- package/es/pro-table/index.less +20 -175
- package/es/pro-table/selection-alert.d.ts +4 -2
- package/es/pro-table/selection-alert.js +16 -4
- package/es/pro-table/table.d.ts +13 -24
- package/es/pro-table/table.js +128 -250
- package/es/pro-table/tree.d.ts +3 -3
- package/es/pro-table/tree.js +28 -17
- package/es/select/ modal.d.ts +3 -9
- package/es/select/ modal.js +63 -22
- package/es/select/customize.d.ts +7 -15
- package/es/select/customize.js +58 -48
- package/es/select/index.d.ts +2 -1
- package/es/select/index.js +9 -9
- package/es/table/index.js +12 -14
- package/es/table/index.less +0 -129
- package/package.json +13 -32
- package/LICENSE +0 -21
- package/README.md +0 -37
- package/es/breadcrumb.d.ts +0 -8
- package/es/breadcrumb.js +0 -40
- package/es/dialog/index.less +0 -16
- package/es/pro-grid/index.d.ts +0 -15
- package/es/pro-grid/index.js +0 -58
- package/es/trigger/index.d.ts +0 -43
- package/es/trigger/index.js +0 -298
- package/es/trigger/index.less +0 -42
- package/es/virtual-list/index.d.ts +0 -51
- package/es/virtual-list/index.js +0 -132
package/es/pro-table/head.js
CHANGED
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
5
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
6
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
1
7
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
2
8
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
3
9
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
@@ -5,11 +11,11 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
5
11
|
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
6
12
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
7
13
|
import { DownOutlined, UpOutlined } from '@ant-design/icons';
|
|
8
|
-
import { useUpdateEffect } from 'ahooks';
|
|
9
14
|
import { Button, Form, theme } from 'antd';
|
|
10
15
|
import _debounce from 'lodash.debounce';
|
|
11
16
|
import React, { useEffect, useImperativeHandle, useMemo, useRef, useState } from 'react';
|
|
12
17
|
import { CcsResizeObserver } from '..';
|
|
18
|
+
import { getDataByNamePath } from "../select";
|
|
13
19
|
import { getShowDpends } from "./_utils";
|
|
14
20
|
import HeadFormItem from "./form-item";
|
|
15
21
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
@@ -33,8 +39,10 @@ function HeadComponent(_ref) {
|
|
|
33
39
|
var formItemsRef = useRef(null);
|
|
34
40
|
// 根据位置判断是否换行ref
|
|
35
41
|
var endItemRef = useRef(null);
|
|
42
|
+
// 查询按钮ref
|
|
43
|
+
var searchBtnRef = useRef(null);
|
|
36
44
|
// 查询条件是否展开
|
|
37
|
-
var _useState = useState(
|
|
45
|
+
var _useState = useState(false),
|
|
38
46
|
_useState2 = _slicedToArray(_useState, 2),
|
|
39
47
|
isExpand = _useState2[0],
|
|
40
48
|
setIsExpand = _useState2[1];
|
|
@@ -42,9 +50,11 @@ function HeadComponent(_ref) {
|
|
|
42
50
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
43
51
|
hasMore = _useState4[0],
|
|
44
52
|
onToggle = _useState4[1];
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
53
|
+
useEffect(function () {
|
|
54
|
+
if (hasMore && expandForm) {
|
|
55
|
+
setIsExpand(true);
|
|
56
|
+
}
|
|
57
|
+
}, [hasMore]);
|
|
48
58
|
useImperativeHandle(formRef, function () {
|
|
49
59
|
return form;
|
|
50
60
|
});
|
|
@@ -62,9 +72,19 @@ function HeadComponent(_ref) {
|
|
|
62
72
|
|
|
63
73
|
// 判断是否有更多条件无法一行显示
|
|
64
74
|
var onEventMore = function onEventMore() {
|
|
65
|
-
var _endItemRef$current, _formItemsRef$current;
|
|
66
|
-
if (!endItemRef.current || !formItemsRef.current
|
|
67
|
-
var
|
|
75
|
+
var _endItemRef$current, _formItemsRef$current, _searchBtnRef$current, _endItemRef$current2, _formItemsRef$current2;
|
|
76
|
+
if (!endItemRef.current || !formItemsRef.current) return;
|
|
77
|
+
var endTop = (_endItemRef$current = endItemRef.current) === null || _endItemRef$current === void 0 || (_endItemRef$current = _endItemRef$current.getClientRects()[0]) === null || _endItemRef$current === void 0 ? void 0 : _endItemRef$current.top;
|
|
78
|
+
var formTop = (_formItemsRef$current = formItemsRef.current) === null || _formItemsRef$current === void 0 || (_formItemsRef$current = _formItemsRef$current.getClientRects()[0]) === null || _formItemsRef$current === void 0 ? void 0 : _formItemsRef$current.top;
|
|
79
|
+
var searchtTop = (_searchBtnRef$current = searchBtnRef.current) === null || _searchBtnRef$current === void 0 || (_searchBtnRef$current = _searchBtnRef$current.getClientRects()[0]) === null || _searchBtnRef$current === void 0 ? void 0 : _searchBtnRef$current.top;
|
|
80
|
+
|
|
81
|
+
// 都在一行,则没有更多和展开
|
|
82
|
+
if (endTop === formTop && endTop === searchtTop) {
|
|
83
|
+
onToggle(false);
|
|
84
|
+
setIsExpand(false);
|
|
85
|
+
}
|
|
86
|
+
if (isExpand) return;
|
|
87
|
+
var hasMore = ((_endItemRef$current2 = endItemRef.current) === null || _endItemRef$current2 === void 0 || (_endItemRef$current2 = _endItemRef$current2.getClientRects()[0]) === null || _endItemRef$current2 === void 0 ? void 0 : _endItemRef$current2.top) !== ((_formItemsRef$current2 = formItemsRef.current) === null || _formItemsRef$current2 === void 0 || (_formItemsRef$current2 = _formItemsRef$current2.getClientRects()[0]) === null || _formItemsRef$current2 === void 0 ? void 0 : _formItemsRef$current2.top);
|
|
68
88
|
onToggle(hasMore);
|
|
69
89
|
};
|
|
70
90
|
|
|
@@ -86,6 +106,7 @@ function HeadComponent(_ref) {
|
|
|
86
106
|
textAlign: 'right',
|
|
87
107
|
flex: isExpand && hasMore ? '1 1 auto' : '0 0 auto'
|
|
88
108
|
},
|
|
109
|
+
ref: searchBtnRef,
|
|
89
110
|
children: [hasMore && /*#__PURE__*/_jsx(Button, {
|
|
90
111
|
type: "link",
|
|
91
112
|
icon: isExpand ? /*#__PURE__*/_jsx(UpOutlined, {}) : /*#__PURE__*/_jsx(DownOutlined, {}),
|
|
@@ -105,58 +126,57 @@ function HeadComponent(_ref) {
|
|
|
105
126
|
}), toolbar ? null : tableOperation]
|
|
106
127
|
});
|
|
107
128
|
var renderFormItems = function renderFormItems() {
|
|
108
|
-
return allFormItems.map(function (
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
129
|
+
return allFormItems.map(function (_ref2, index) {
|
|
130
|
+
var depends = _ref2.depends,
|
|
131
|
+
showDepends = _ref2.showDepends,
|
|
132
|
+
name = _ref2.name,
|
|
133
|
+
isGroupItem = _ref2.isGroupItem,
|
|
134
|
+
label = _ref2.label,
|
|
135
|
+
rules = _ref2.rules,
|
|
136
|
+
value = _ref2.value;
|
|
137
|
+
var itemProps = {
|
|
138
|
+
name: name,
|
|
139
|
+
label: label,
|
|
140
|
+
rules: rules,
|
|
141
|
+
value: value,
|
|
142
|
+
formItemLabelWidth: formItemLabelWidth,
|
|
143
|
+
groupItemNames: isGroupItem ? name : undefined
|
|
144
|
+
};
|
|
145
|
+
var itemContent = /*#__PURE__*/_jsx(React.Fragment, {
|
|
146
|
+
children: /*#__PURE__*/_jsx(HeadFormItem, _objectSpread({}, itemProps))
|
|
147
|
+
}, index);
|
|
148
|
+
if (depends || showDepends) {
|
|
149
|
+
return /*#__PURE__*/_jsx(Form.Item, {
|
|
150
|
+
noStyle: true,
|
|
151
|
+
shouldUpdate: function shouldUpdate(l, n) {
|
|
152
|
+
return (depends === null || depends === void 0 ? void 0 : depends.some(function (i) {
|
|
153
|
+
return getDataByNamePath(l, i) !== getDataByNamePath(n, i);
|
|
154
|
+
})) || (showDepends === null || showDepends === void 0 ? void 0 : showDepends.some(function (i) {
|
|
155
|
+
return getDataByNamePath(l, i.name) !== getDataByNamePath(n, i.name);
|
|
156
|
+
})) || false;
|
|
157
|
+
},
|
|
158
|
+
children: function children(_ref3) {
|
|
159
|
+
var getFieldValue = _ref3.getFieldValue;
|
|
160
|
+
var dependParam = {};
|
|
161
|
+
depends === null || depends === void 0 || depends.forEach(function (i) {
|
|
162
|
+
var value = getFieldValue(i);
|
|
163
|
+
dependParam[i] = value;
|
|
164
|
+
});
|
|
165
|
+
var isShow = true;
|
|
166
|
+
if (showDepends && showDepends.length > 0) {
|
|
167
|
+
isShow = showDepends === null || showDepends === void 0 ? void 0 : showDepends.every(function (i) {
|
|
168
|
+
return getFieldValue(i.name) === i.value;
|
|
143
169
|
});
|
|
144
|
-
if (!isShow) return null;
|
|
145
|
-
return itemContent;
|
|
146
170
|
}
|
|
147
|
-
|
|
148
|
-
|
|
171
|
+
var itemContent = /*#__PURE__*/_jsx(HeadFormItem, _objectSpread(_objectSpread({}, itemProps), {}, {
|
|
172
|
+
dependParam: dependParam
|
|
173
|
+
}));
|
|
174
|
+
if (!isShow) return null;
|
|
175
|
+
return itemContent;
|
|
176
|
+
}
|
|
177
|
+
}, index);
|
|
149
178
|
}
|
|
150
|
-
|
|
151
|
-
name: item.name,
|
|
152
|
-
value: item.value,
|
|
153
|
-
rules: item.rules,
|
|
154
|
-
label: item.label,
|
|
155
|
-
formItemLabelWidth: formItemLabelWidth
|
|
156
|
-
});
|
|
157
|
-
return /*#__PURE__*/_jsx(React.Fragment, {
|
|
158
|
-
children: itemContent
|
|
159
|
-
}, item.name);
|
|
179
|
+
return itemContent;
|
|
160
180
|
});
|
|
161
181
|
};
|
|
162
182
|
var formStyles = {
|
|
@@ -177,16 +197,21 @@ function HeadComponent(_ref) {
|
|
|
177
197
|
onFinish: onSearch,
|
|
178
198
|
layout: "inline",
|
|
179
199
|
style: formStyles,
|
|
180
|
-
children: [/*#__PURE__*/
|
|
200
|
+
children: [/*#__PURE__*/_jsx("div", {
|
|
181
201
|
style: {
|
|
182
|
-
justifyContent: isExpand && hasMore ? 'flex-start' : 'flex-end',
|
|
183
202
|
height: isExpand ? 'auto' : controlHeight
|
|
184
203
|
},
|
|
185
204
|
className: "ccs-pl-adaptation-form",
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
ref:
|
|
189
|
-
|
|
205
|
+
children: /*#__PURE__*/_jsxs("div", {
|
|
206
|
+
className: "ccs-pl-form-".concat(isExpand && hasMore ? 'expand' : 'collapse'),
|
|
207
|
+
ref: formItemsRef,
|
|
208
|
+
children: [renderFormItems(), /*#__PURE__*/_jsx("div", {
|
|
209
|
+
style: {
|
|
210
|
+
height: 1
|
|
211
|
+
},
|
|
212
|
+
ref: endItemRef
|
|
213
|
+
}), isExpand && renderSearchBtn]
|
|
214
|
+
})
|
|
190
215
|
}), !isExpand && /*#__PURE__*/_jsx("div", {
|
|
191
216
|
style: {
|
|
192
217
|
flex: '0 0 auto'
|
package/es/pro-table/index.less
CHANGED
|
@@ -28,19 +28,16 @@
|
|
|
28
28
|
z-index: 9999;
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
+
.ccs-table-pagination {
|
|
32
|
+
margin: 0 !important;
|
|
33
|
+
padding: 12px 16px;
|
|
34
|
+
text-align: right;
|
|
35
|
+
}
|
|
36
|
+
|
|
31
37
|
.ccs-pl {
|
|
32
|
-
flex: auto;
|
|
33
38
|
display: flex;
|
|
34
39
|
flex-direction: column;
|
|
35
40
|
|
|
36
|
-
.ant-pagination {
|
|
37
|
-
margin: 0 !important;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
&-tradition-toolbar {
|
|
41
|
-
padding: 10px 16px;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
41
|
&-icon {
|
|
45
42
|
// color: rgb(0 0 0 / 75%);
|
|
46
43
|
font-size: 16;
|
|
@@ -49,189 +46,37 @@
|
|
|
49
46
|
&-table-content {
|
|
50
47
|
position: relative;
|
|
51
48
|
flex: auto;
|
|
52
|
-
|
|
53
|
-
.ant-table-title {
|
|
54
|
-
padding: 0 !important;
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
&-adaptation {
|
|
59
|
-
.ant-form-item {
|
|
60
|
-
// margin-bottom: 0;
|
|
61
|
-
margin-inline-end: 0;
|
|
62
|
-
}
|
|
63
49
|
}
|
|
64
50
|
|
|
65
|
-
&-
|
|
66
|
-
flex: 1 1 auto;
|
|
51
|
+
&-form-collapse {
|
|
67
52
|
display: flex;
|
|
68
53
|
justify-content: flex-end;
|
|
69
54
|
flex-wrap: wrap;
|
|
70
|
-
gap:
|
|
71
|
-
overflow: hidden;
|
|
72
|
-
|
|
73
|
-
&::-webkit-scrollbar {
|
|
74
|
-
display: none;
|
|
75
|
-
}
|
|
55
|
+
column-gap: 10px;
|
|
76
56
|
}
|
|
77
57
|
|
|
78
|
-
|
|
79
|
-
|
|
58
|
+
&-form-expand {
|
|
59
|
+
display: flex;
|
|
60
|
+
justify-content: flex-start;
|
|
61
|
+
flex-wrap: wrap;
|
|
62
|
+
column-gap: 10px;
|
|
80
63
|
}
|
|
81
64
|
|
|
82
|
-
&-form {
|
|
83
|
-
flex:
|
|
65
|
+
&-adaptation-form {
|
|
66
|
+
flex: 1 1 auto;
|
|
84
67
|
overflow: hidden;
|
|
85
|
-
display: flex;
|
|
86
|
-
flex-direction: row;
|
|
87
|
-
align-items: flex-end;
|
|
88
|
-
// justify-content: space-between;
|
|
89
|
-
// flex-wrap: wrap;
|
|
90
|
-
gap: 8px;
|
|
91
|
-
|
|
92
|
-
.ant-form-item {
|
|
93
|
-
flex: 0 1 auto;
|
|
94
|
-
}
|
|
95
68
|
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
.ant-form-item .ant-form-item-label {
|
|
101
|
-
padding: 0;
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
label {
|
|
105
|
-
white-space: nowrap;
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
.ant-form-item-label {
|
|
109
|
-
flex: 0 0 auto !important;
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
.ant-form-item-control {
|
|
113
|
-
flex: 0 1 auto !important;
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
.ant-form-inline {
|
|
117
|
-
flex-wrap: nowrap;
|
|
118
|
-
align-items: flex-end;
|
|
119
|
-
justify-content: end;
|
|
120
|
-
overflow: hidden;
|
|
121
|
-
|
|
122
|
-
.ant-form-item:last-child {
|
|
123
|
-
margin-inline-end: 0;
|
|
124
|
-
}
|
|
69
|
+
&::-webkit-scrollbar {
|
|
70
|
+
display: none;
|
|
125
71
|
}
|
|
126
72
|
}
|
|
127
73
|
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
.ant-input-number {
|
|
133
|
-
width: 100%;
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
.ant-picker {
|
|
137
|
-
width: 100%;
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
.ant-drawer-right.ant-drawer-open {
|
|
141
|
-
width: 100%;
|
|
142
|
-
transition: none;
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
.ant-drawer.ant-drawer-open .ant-drawer-mask {
|
|
146
|
-
animation: none;
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
&-form-label {
|
|
150
|
-
.ant-col-24.ant-form-item-label {
|
|
151
|
-
padding: 0;
|
|
152
|
-
}
|
|
74
|
+
&-form-item {
|
|
75
|
+
margin-bottom: 10px !important;
|
|
76
|
+
margin-inline-end: 0 !important;
|
|
153
77
|
}
|
|
154
78
|
|
|
155
79
|
&-toolbar {
|
|
156
80
|
flex: 0 0 auto;
|
|
157
81
|
}
|
|
158
|
-
|
|
159
|
-
&-header {
|
|
160
|
-
display: flex;
|
|
161
|
-
gap: 10px;
|
|
162
|
-
justify-content: space-between;
|
|
163
|
-
align-items: center;
|
|
164
|
-
// background-color: #fff;
|
|
165
|
-
width: 100%;
|
|
166
|
-
|
|
167
|
-
.ant-form-item-explain {
|
|
168
|
-
position: absolute;
|
|
169
|
-
bottom: -20px;
|
|
170
|
-
z-index: 101;
|
|
171
|
-
height: 0;
|
|
172
|
-
overflow: hidden;
|
|
173
|
-
white-space: nowrap;
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
&-buttons {
|
|
177
|
-
// margin-left: 6px;
|
|
178
|
-
white-space: nowrap;
|
|
179
|
-
}
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
.ant-table-wrapper .ant-table > .ant-table-container {
|
|
183
|
-
border-inline-start: 0;
|
|
184
|
-
border-top: 0;
|
|
185
|
-
|
|
186
|
-
& > .ant-table-header > table > thead > tr {
|
|
187
|
-
& > th:last-child {
|
|
188
|
-
border-inline-end: 0;
|
|
189
|
-
border-start-start-radius: 0;
|
|
190
|
-
border-start-end-radius: 0;
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
& > th:first-child {
|
|
194
|
-
border-start-start-radius: 0;
|
|
195
|
-
}
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
& > .ant-table-body > table > tbody > tr > td:last-child {
|
|
199
|
-
border-inline-end: 0;
|
|
200
|
-
}
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
.ant-table-wrapper table {
|
|
204
|
-
border-radius: 0;
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
.ant-table-wrapper .ant-table .ant-table-header {
|
|
208
|
-
border-radius: 0;
|
|
209
|
-
}
|
|
210
|
-
}
|
|
211
|
-
|
|
212
|
-
// modal drawer ccs-pl 中取消table content padding
|
|
213
|
-
.ant-modal-body,
|
|
214
|
-
.ant-drawer-body,
|
|
215
|
-
.ccs-trigger-container,
|
|
216
|
-
.ccs-pg-col {
|
|
217
|
-
.ccs-pl-table-content {
|
|
218
|
-
margin: 0;
|
|
219
|
-
}
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
.colorful-theme {
|
|
223
|
-
.ccs-pl-toolbar,
|
|
224
|
-
.ccs-pl-form {
|
|
225
|
-
.ant-btn-sm {
|
|
226
|
-
border-radius: 12px;
|
|
227
|
-
}
|
|
228
|
-
|
|
229
|
-
.ant-btn {
|
|
230
|
-
border-radius: 16px;
|
|
231
|
-
}
|
|
232
|
-
|
|
233
|
-
.ant-btn-lg {
|
|
234
|
-
border-radius: 20px;
|
|
235
|
-
}
|
|
236
|
-
}
|
|
237
82
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { TagProps } from 'antd';
|
|
2
|
-
import React from 'react';
|
|
2
|
+
import React, { CSSProperties } from 'react';
|
|
3
3
|
interface PropsType {
|
|
4
4
|
data: any[];
|
|
5
5
|
color?: TagProps['color'];
|
|
@@ -8,11 +8,13 @@ interface PropsType {
|
|
|
8
8
|
label: string;
|
|
9
9
|
};
|
|
10
10
|
onClear: (key?: React.Key) => void;
|
|
11
|
+
style?: CSSProperties;
|
|
12
|
+
className?: string;
|
|
11
13
|
}
|
|
12
14
|
/**
|
|
13
15
|
* 显示table行选中项
|
|
14
16
|
* @param PropsType
|
|
15
17
|
* @returns
|
|
16
18
|
*/
|
|
17
|
-
export default function SelectionAlert({ data, color, fieldNames, onClear, }: PropsType): import("react/jsx-runtime").JSX.Element | undefined;
|
|
19
|
+
export default function SelectionAlert({ data, color, style, className, fieldNames, onClear, }: PropsType): import("react/jsx-runtime").JSX.Element | undefined;
|
|
18
20
|
export {};
|
|
@@ -1,5 +1,11 @@
|
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
5
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
6
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
1
7
|
import { DeleteOutlined } from '@ant-design/icons';
|
|
2
|
-
import { Button, Space, Tag } from 'antd';
|
|
8
|
+
import { Button, Space, Tag, theme } from 'antd';
|
|
3
9
|
import React from 'react';
|
|
4
10
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
5
11
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
@@ -11,21 +17,27 @@ import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
11
17
|
export default function SelectionAlert(_ref) {
|
|
12
18
|
var data = _ref.data,
|
|
13
19
|
color = _ref.color,
|
|
20
|
+
style = _ref.style,
|
|
21
|
+
className = _ref.className,
|
|
14
22
|
_ref$fieldNames = _ref.fieldNames,
|
|
15
23
|
fieldNames = _ref$fieldNames === void 0 ? {
|
|
16
24
|
key: 'key',
|
|
17
25
|
label: 'label'
|
|
18
26
|
} : _ref$fieldNames,
|
|
19
27
|
onClear = _ref.onClear;
|
|
28
|
+
var _theme$useToken = theme.useToken(),
|
|
29
|
+
token = _theme$useToken.token;
|
|
20
30
|
if (!data || data.length === 0) {
|
|
21
31
|
return undefined;
|
|
22
32
|
}
|
|
33
|
+
var px = "".concat(token.paddingSM, "px");
|
|
23
34
|
return /*#__PURE__*/_jsxs(Space, {
|
|
24
35
|
size: 4,
|
|
25
|
-
style: {
|
|
26
|
-
padding: '6px 12px'
|
|
27
|
-
},
|
|
28
36
|
wrap: true,
|
|
37
|
+
style: _objectSpread({
|
|
38
|
+
padding: "0 ".concat(px, " ").concat(px, " ").concat(px)
|
|
39
|
+
}, style),
|
|
40
|
+
className: className,
|
|
29
41
|
children: [data.map(function () {
|
|
30
42
|
var row = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
31
43
|
return /*#__PURE__*/_jsx(Tag, {
|
package/es/pro-table/table.d.ts
CHANGED
|
@@ -13,14 +13,16 @@ export type ShowDependType = {
|
|
|
13
13
|
value: any;
|
|
14
14
|
};
|
|
15
15
|
export declare enum TableEvent {
|
|
16
|
-
Search = "search"
|
|
17
|
-
Reset = "reset"
|
|
18
|
-
Reload = "reload"
|
|
19
|
-
ChangePage = "changePage"
|
|
20
|
-
InitSearch = "initSearch"
|
|
21
|
-
FullScreen = "fullScreen"
|
|
22
|
-
ColumnFilter = "columnFilter"
|
|
23
|
-
SelectedRows = "SelectedRows"
|
|
16
|
+
Search = "search",// 查询
|
|
17
|
+
Reset = "reset",// 重置
|
|
18
|
+
Reload = "reload",// 刷新
|
|
19
|
+
ChangePage = "changePage",// 分页
|
|
20
|
+
InitSearch = "initSearch",// 初始化查询
|
|
21
|
+
FullScreen = "fullScreen",// 全屏
|
|
22
|
+
ColumnFilter = "columnFilter",// 列过滤
|
|
23
|
+
SelectedRows = "SelectedRows",// 选中行
|
|
24
|
+
Expand = "Expand",// 异步树展开
|
|
25
|
+
PartialReload = "PartialReload"
|
|
24
26
|
}
|
|
25
27
|
export type TableColumn<RecordType = any> = (Omit<ColumnGroupType<RecordType>, 'ellipsis'> | Omit<ColumnType<RecordType>, 'ellipsis'>) & {
|
|
26
28
|
dataIndex?: keyof RecordType;
|
|
@@ -29,18 +31,7 @@ export type TableColumn<RecordType = any> = (Omit<ColumnGroupType<RecordType>, '
|
|
|
29
31
|
/** 省略显示行数,最大支持10行 */
|
|
30
32
|
ellipsis?: Omit<EllipsisProps, 'content'> | boolean | number;
|
|
31
33
|
};
|
|
32
|
-
type
|
|
33
|
-
/** 选中Key */
|
|
34
|
-
selectedRowKeys?: React.Key[];
|
|
35
|
-
/** 选中记录 */
|
|
36
|
-
selectedRows?: T[];
|
|
37
|
-
/** table datasource */
|
|
38
|
-
data: T[];
|
|
39
|
-
/** 清空选择,传入key取消指定选中,否清空所有 */
|
|
40
|
-
onClear: (key?: React.Key) => void;
|
|
41
|
-
};
|
|
42
|
-
export type TableExtraNode<T> = ReactNode | (({ selectedRowKeys, selectedRows, data, onClear, }: TableTitleType<T>) => ReactNode);
|
|
43
|
-
export type CcsTableProps<T> = Omit<TableProps<T>, 'columns' | 'title' | 'summary'> & {
|
|
34
|
+
export type CcsTableProps<T> = Omit<TableProps<T>, 'columns' | 'summary'> & {
|
|
44
35
|
data?: CCS.TableData<T>;
|
|
45
36
|
/** 为空时,默认一条数据 */
|
|
46
37
|
emptyDefaultOne?: boolean;
|
|
@@ -58,8 +49,6 @@ export type CcsTableProps<T> = Omit<TableProps<T>, 'columns' | 'title' | 'summar
|
|
|
58
49
|
hideOperation?: boolean;
|
|
59
50
|
/** 列配置 */
|
|
60
51
|
columns?: TableColumns<T>;
|
|
61
|
-
/** table title */
|
|
62
|
-
title?: TableExtraNode<T>;
|
|
63
52
|
/** table summary */
|
|
64
53
|
summary?: (data: readonly T[], columns: TableColumn<T>[]) => React.ReactNode;
|
|
65
54
|
};
|
|
@@ -78,7 +67,7 @@ export type CcsProTableProps<RecordType = any> = Pick<PropsWithCss, 'className'>
|
|
|
78
67
|
/** 查询form 初始值 */
|
|
79
68
|
formInitValues?: ParamType;
|
|
80
69
|
/** 按钮 操作部分 */
|
|
81
|
-
toolbar?:
|
|
70
|
+
toolbar?: ReactNode;
|
|
82
71
|
/** 边框 */
|
|
83
72
|
bordered?: boolean;
|
|
84
73
|
/** 展开查询条件,默认false */
|
|
@@ -111,5 +100,5 @@ export declare const classPrefix = "ccs-pl";
|
|
|
111
100
|
* @param ref
|
|
112
101
|
* @returns
|
|
113
102
|
*/
|
|
114
|
-
declare const InternalProTable: <
|
|
103
|
+
declare const InternalProTable: <RecordType extends object = any>(props: CcsProTableProps<RecordType>) => import("react/jsx-runtime").JSX.Element;
|
|
115
104
|
export default InternalProTable;
|