@ccs-ui/rc-pro 1.1.0 → 1.1.1-rc1
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/es/auth/auth-button.js +25 -12
- package/es/auth/auth-dropdown.js +13 -5
- package/es/auth/index.d.ts +10 -10
- package/es/auth/index.js +86 -65
- package/es/cascader/index.js +2 -2
- package/es/color-picker/index.js +30 -26
- package/es/date-picker/index.js +9 -3
- package/es/dialog/button.d.ts +2 -1
- package/es/dialog/button.js +20 -11
- package/es/dialog/dialog.js +11 -11
- package/es/drawer/buttons.js +31 -21
- package/es/drawer/open/content.js +27 -21
- package/es/drawer/open/form.js +5 -3
- package/es/drawer/open/index.js +41 -27
- package/es/interval-button/index.js +11 -5
- package/es/keep-alive-tabs/index.js +45 -40
- package/es/keep-alive-tabs/page.js +19 -15
- package/es/modal/buttons.js +28 -18
- package/es/modal/open/drag.js +14 -11
- package/es/modal/open/form.js +11 -3
- package/es/modal/open/index.js +9 -6
- package/es/pro-grid/index.js +48 -35
- package/es/pro-table/index.js +0 -2
- package/es/pro-tabs/index.js +6 -3
- package/es/select/index.js +2 -2
- package/es/table/index.js +60 -54
- package/es/time-picker/index.js +9 -3
- package/es/trigger/index.js +77 -67
- package/es/upload/index.js +15 -6
- package/es/upload/upload-image.js +23 -11
- package/es/virtual-list/index.js +33 -28
- package/es/water-mark/index.js +20 -17
- package/package.json +2 -2
package/es/modal/open/drag.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
var _excluded = ["title"];
|
|
2
2
|
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
3
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
4
3
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
5
4
|
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."); }
|
|
6
5
|
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); }
|
|
@@ -18,6 +17,7 @@ import { Modal } from 'antd';
|
|
|
18
17
|
import classNames from 'classnames';
|
|
19
18
|
import React, { useRef, useState } from 'react';
|
|
20
19
|
import Draggable from 'react-draggable';
|
|
20
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
21
21
|
var DragModal = function DragModal(_ref) {
|
|
22
22
|
var modal = _ref.modal,
|
|
23
23
|
dragState = _ref.dragState,
|
|
@@ -43,15 +43,17 @@ var DragModal = function DragModal(_ref) {
|
|
|
43
43
|
});
|
|
44
44
|
});
|
|
45
45
|
};
|
|
46
|
-
return /*#__PURE__*/
|
|
46
|
+
return /*#__PURE__*/_jsx(Draggable, {
|
|
47
47
|
disabled: dragState.disabled,
|
|
48
48
|
bounds: dragState.bounds,
|
|
49
49
|
onStart: function onStart(event, uiData) {
|
|
50
50
|
return _onStart(event, uiData);
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
51
|
+
},
|
|
52
|
+
children: /*#__PURE__*/_jsx("div", {
|
|
53
|
+
ref: draggleRef,
|
|
54
|
+
children: modal
|
|
55
|
+
})
|
|
56
|
+
});
|
|
55
57
|
};
|
|
56
58
|
export default function InternalDragModal(_ref2) {
|
|
57
59
|
var title = _ref2.title,
|
|
@@ -68,9 +70,9 @@ export default function InternalDragModal(_ref2) {
|
|
|
68
70
|
_useState2 = _slicedToArray(_useState, 2),
|
|
69
71
|
dragState = _useState2[0],
|
|
70
72
|
setDragState = _useState2[1];
|
|
71
|
-
return /*#__PURE__*/
|
|
73
|
+
return /*#__PURE__*/_jsx(Modal, _objectSpread(_objectSpread({}, restProps), {}, {
|
|
72
74
|
className: classNames(restProps.className, 'ccs-drag-modal'),
|
|
73
|
-
title: /*#__PURE__*/
|
|
75
|
+
title: /*#__PURE__*/_jsx("div", {
|
|
74
76
|
style: {
|
|
75
77
|
width: '100%',
|
|
76
78
|
cursor: 'move'
|
|
@@ -90,11 +92,12 @@ export default function InternalDragModal(_ref2) {
|
|
|
90
92
|
disabled: true
|
|
91
93
|
});
|
|
92
94
|
});
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
+
},
|
|
96
|
+
children: title
|
|
97
|
+
}),
|
|
95
98
|
closeIcon: null,
|
|
96
99
|
modalRender: function modalRender(modal) {
|
|
97
|
-
return /*#__PURE__*/
|
|
100
|
+
return /*#__PURE__*/_jsx(DragModal, {
|
|
98
101
|
modal: modal,
|
|
99
102
|
dragState: dragState,
|
|
100
103
|
onDragState: setDragState
|
package/es/modal/open/form.js
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
1
2
|
var _excluded = ["labelCol", "wrapperCol"];
|
|
2
|
-
function
|
|
3
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
4
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
5
|
+
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; }
|
|
6
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
7
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
3
8
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
4
9
|
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."); }
|
|
5
10
|
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); }
|
|
@@ -10,6 +15,7 @@ function _objectWithoutProperties(source, excluded) { if (source == null) return
|
|
|
10
15
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
11
16
|
import { Form } from 'antd';
|
|
12
17
|
import React from 'react';
|
|
18
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
19
|
/**
|
|
14
20
|
* 添加form实例
|
|
15
21
|
* @returns
|
|
@@ -23,7 +29,7 @@ export default function ModalForm(_ref) {
|
|
|
23
29
|
var _Form$useForm = Form.useForm(),
|
|
24
30
|
_Form$useForm2 = _slicedToArray(_Form$useForm, 1),
|
|
25
31
|
form = _Form$useForm2[0];
|
|
26
|
-
return /*#__PURE__*/
|
|
32
|
+
return /*#__PURE__*/_jsx(Form, _objectSpread(_objectSpread({
|
|
27
33
|
form: form,
|
|
28
34
|
labelCol: labelCol || {
|
|
29
35
|
span: 7
|
|
@@ -31,5 +37,7 @@ export default function ModalForm(_ref) {
|
|
|
31
37
|
wrapperCol: wrapperCol || {
|
|
32
38
|
span: 14
|
|
33
39
|
}
|
|
34
|
-
}, restProps),
|
|
40
|
+
}, restProps), {}, {
|
|
41
|
+
children: children
|
|
42
|
+
}));
|
|
35
43
|
}
|
package/es/modal/open/index.js
CHANGED
|
@@ -12,6 +12,7 @@ import FnContent from "../../drawer/open/content";
|
|
|
12
12
|
import destroyModalFns from "./destory-fns";
|
|
13
13
|
import DragModal from "./drag";
|
|
14
14
|
import ModalForm from "./form";
|
|
15
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
15
16
|
export var classPrefix = 'ccs-modal';
|
|
16
17
|
export default function ModalOpen(config) {
|
|
17
18
|
var container = document.createDocumentFragment();
|
|
@@ -56,14 +57,16 @@ export default function ModalOpen(config) {
|
|
|
56
57
|
function render(props) {
|
|
57
58
|
clearTimeout(timeoutId);
|
|
58
59
|
timeoutId = setTimeout(function () {
|
|
59
|
-
var Rc = /*#__PURE__*/
|
|
60
|
+
var Rc = /*#__PURE__*/_jsx(FnContent, {
|
|
60
61
|
form: config.form,
|
|
61
62
|
close: onModalClose,
|
|
62
|
-
locationKey: locationKey
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
63
|
+
locationKey: locationKey,
|
|
64
|
+
children: isDrag ? /*#__PURE__*/_jsx(DragModal, _objectSpread({}, props)) : /*#__PURE__*/_jsx(Modal, _objectSpread({}, props))
|
|
65
|
+
});
|
|
66
|
+
reactRender(config.form ? /*#__PURE__*/_jsx(ModalForm, {
|
|
67
|
+
formProps: config.form,
|
|
68
|
+
children: Rc
|
|
69
|
+
}) : Rc, container);
|
|
67
70
|
});
|
|
68
71
|
}
|
|
69
72
|
function close(open) {
|
package/es/pro-grid/index.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
2
2
|
var _excluded = ["colSpan", "colClassName", "colStyle"],
|
|
3
3
|
_excluded2 = ["title", "titleStyle", "titleExtra", "hideTitle", "bordered", "children"];
|
|
4
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
5
4
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
6
5
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
7
6
|
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; }
|
|
@@ -14,23 +13,29 @@ import classNames from 'classnames';
|
|
|
14
13
|
import React from 'react';
|
|
15
14
|
import { GridContext } from "./context";
|
|
16
15
|
import "./index.less";
|
|
16
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
17
|
+
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
18
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
17
19
|
var GridCol = function GridCol(_ref) {
|
|
18
20
|
var colSpan = _ref.colSpan,
|
|
19
21
|
colClassName = _ref.colClassName,
|
|
20
22
|
colStyle = _ref.colStyle,
|
|
21
23
|
otherProps = _objectWithoutProperties(_ref, _excluded);
|
|
22
|
-
return /*#__PURE__*/
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
24
|
+
return /*#__PURE__*/_jsx(_Fragment, {
|
|
25
|
+
children: /*#__PURE__*/_jsx("div", {
|
|
26
|
+
className: classNames('ccs-pg-col', colClassName),
|
|
27
|
+
style: colSpan ? _objectSpread({
|
|
28
|
+
width: colSpan,
|
|
29
|
+
flexShrink: 0
|
|
30
|
+
}, colStyle) : _objectSpread({
|
|
31
|
+
display: 'flex',
|
|
32
|
+
width: 0,
|
|
33
|
+
flex: 'auto',
|
|
34
|
+
flexDirection: 'column'
|
|
35
|
+
}, colStyle),
|
|
36
|
+
children: /*#__PURE__*/_jsx(Card, _objectSpread({}, otherProps))
|
|
37
|
+
})
|
|
38
|
+
});
|
|
34
39
|
};
|
|
35
40
|
var Grid = function Grid(_ref2) {
|
|
36
41
|
var title = _ref2.title,
|
|
@@ -41,30 +46,38 @@ var Grid = function Grid(_ref2) {
|
|
|
41
46
|
bordered = _ref2.bordered,
|
|
42
47
|
children = _ref2.children,
|
|
43
48
|
restProps = _objectWithoutProperties(_ref2, _excluded2);
|
|
44
|
-
return /*#__PURE__*/
|
|
49
|
+
return /*#__PURE__*/_jsx(GridContext.Provider, {
|
|
45
50
|
value: {
|
|
46
51
|
inProGrid: true
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
52
|
+
},
|
|
53
|
+
children: /*#__PURE__*/_jsxs("div", _objectSpread(_objectSpread({}, restProps), {}, {
|
|
54
|
+
className: classNames({
|
|
55
|
+
'ccs-pg-border': bordered
|
|
56
|
+
}),
|
|
57
|
+
children: [!hideTitle && title ? /*#__PURE__*/_jsxs("div", {
|
|
58
|
+
style: _objectSpread({
|
|
59
|
+
display: 'flex',
|
|
60
|
+
justifyContent: 'space-between'
|
|
61
|
+
}, titleStyle),
|
|
62
|
+
className: "ccs-pl-title",
|
|
63
|
+
children: [/*#__PURE__*/_jsx("div", {
|
|
64
|
+
children: title
|
|
65
|
+
}), /*#__PURE__*/_jsx("div", {
|
|
66
|
+
className: "ccs-pg-extra",
|
|
67
|
+
children: titleExtra
|
|
68
|
+
})]
|
|
69
|
+
}) : null, /*#__PURE__*/_jsx("div", {
|
|
70
|
+
className: "ccs-pl-table-content",
|
|
71
|
+
children: /*#__PURE__*/_jsx("div", {
|
|
72
|
+
style: {
|
|
73
|
+
display: 'flex',
|
|
74
|
+
padding: 10
|
|
75
|
+
},
|
|
76
|
+
children: children
|
|
77
|
+
})
|
|
78
|
+
})]
|
|
79
|
+
}))
|
|
80
|
+
});
|
|
68
81
|
};
|
|
69
82
|
var ProGrid = Grid;
|
|
70
83
|
ProGrid.Col = GridCol;
|
package/es/pro-table/index.js
CHANGED
|
@@ -494,8 +494,6 @@ var ProTable = function ProTable(props) {
|
|
|
494
494
|
}
|
|
495
495
|
onRequest('changePage', paginationTable.current || 0, paginationTable.pageSize || 10);
|
|
496
496
|
};
|
|
497
|
-
|
|
498
|
-
// 发布订阅、组件通信模式
|
|
499
497
|
var event$ = useEventEmitter();
|
|
500
498
|
var onExpand = function onExpand(expanded, record) {
|
|
501
499
|
var _table$asyncTree;
|
package/es/pro-tabs/index.js
CHANGED
|
@@ -9,6 +9,8 @@ import update from 'immutability-helper';
|
|
|
9
9
|
import React, { cloneElement, useState } from 'react';
|
|
10
10
|
import { TabsContext } from "../context";
|
|
11
11
|
import "./index.less";
|
|
12
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
+
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
12
14
|
export default (function (_ref) {
|
|
13
15
|
var _children$items;
|
|
14
16
|
var children = _ref.children;
|
|
@@ -136,13 +138,14 @@ export default (function (_ref) {
|
|
|
136
138
|
}
|
|
137
139
|
}));
|
|
138
140
|
};
|
|
139
|
-
return children ? /*#__PURE__*/
|
|
141
|
+
return children ? /*#__PURE__*/_jsx(TabsContext.Provider, {
|
|
140
142
|
value: {
|
|
141
143
|
activeKey: tabsProps.activeKey,
|
|
142
144
|
options: tabsProps.options,
|
|
143
145
|
onTabChange: onHooksChange,
|
|
144
146
|
onRemoveTabs: onRemoveTabs,
|
|
145
147
|
onAddTabs: onAddTabs
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
+
},
|
|
149
|
+
children: /*#__PURE__*/cloneElement(children, addOptions)
|
|
150
|
+
}) : /*#__PURE__*/_jsx(_Fragment, {});
|
|
148
151
|
});
|
package/es/select/index.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
2
2
|
var _excluded = ["onQuery", "cache", "defaultParams"];
|
|
3
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
4
3
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
5
4
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
6
5
|
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; }
|
|
@@ -15,6 +14,7 @@ import { useRequest } from 'ahooks';
|
|
|
15
14
|
import { Select } from 'antd';
|
|
16
15
|
import _isArray from 'lodash/isArray';
|
|
17
16
|
import React, { useEffect } from 'react';
|
|
17
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
18
18
|
/**
|
|
19
19
|
* 基于接口查询的select组件
|
|
20
20
|
* @param CcsSelectProps
|
|
@@ -62,7 +62,7 @@ export default function CcsApiSelect(_ref) {
|
|
|
62
62
|
useEffect(function () {
|
|
63
63
|
if (onQuery) run(defaultParams);
|
|
64
64
|
}, [JSON.stringify(defaultParams)]);
|
|
65
|
-
return /*#__PURE__*/
|
|
65
|
+
return /*#__PURE__*/_jsx(Select, _objectSpread({
|
|
66
66
|
options: data,
|
|
67
67
|
loading: loading,
|
|
68
68
|
style: {
|
package/es/table/index.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
2
2
|
var _excluded = ["data", "style", "scroll", "event$", "rowKey", "columns", "pagination", "rowSelection", "className"];
|
|
3
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
4
3
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
5
4
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
6
5
|
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; }
|
|
@@ -13,6 +12,9 @@ import { Pagination, Table, Tooltip } from 'antd';
|
|
|
13
12
|
import classNames from 'classnames';
|
|
14
13
|
import React, { useEffect, useRef } from 'react';
|
|
15
14
|
import "./index.less";
|
|
15
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
16
|
+
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
17
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
16
18
|
var DEFAULT_PAGE = {
|
|
17
19
|
totalNum: 0,
|
|
18
20
|
result: [],
|
|
@@ -107,67 +109,71 @@ var CustomTable = function CustomTable(props) {
|
|
|
107
109
|
showTitle: false
|
|
108
110
|
};
|
|
109
111
|
sc.render = function (e) {
|
|
110
|
-
return /*#__PURE__*/
|
|
112
|
+
return /*#__PURE__*/_jsx(Tooltip, {
|
|
111
113
|
zIndex: 2020,
|
|
112
114
|
title: e,
|
|
113
115
|
placement: "bottomLeft",
|
|
114
|
-
destroyTooltipOnHide: true
|
|
115
|
-
|
|
116
|
+
destroyTooltipOnHide: true,
|
|
117
|
+
children: e
|
|
118
|
+
});
|
|
116
119
|
};
|
|
117
120
|
}
|
|
118
121
|
});
|
|
119
122
|
return cls;
|
|
120
123
|
};
|
|
121
|
-
return /*#__PURE__*/
|
|
124
|
+
return /*#__PURE__*/_jsx("div", {
|
|
122
125
|
className: "ccs-table-card",
|
|
123
|
-
style: _objectSpread({}, style)
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
126
|
+
style: _objectSpread({}, style),
|
|
127
|
+
children: restProps.render ? /*#__PURE__*/_jsxs(_Fragment, {
|
|
128
|
+
children: [restProps.render(result || []), pagination === false ? null : /*#__PURE__*/_jsx(Pagination, _objectSpread({}, _objectSpread({
|
|
129
|
+
total: totalNum,
|
|
130
|
+
pageSize: pageSize,
|
|
131
|
+
size: restProps.size === 'small' ? 'small' : 'default',
|
|
132
|
+
simple: restProps.size === 'small',
|
|
133
|
+
current: pageNo,
|
|
134
|
+
showSizeChanger: true,
|
|
135
|
+
showQuickJumper: true,
|
|
136
|
+
showTotal: function showTotal() {
|
|
137
|
+
return "\u5171".concat(totalNum, "\u6761\u8BB0\u5F55");
|
|
138
|
+
},
|
|
139
|
+
pageSizeOptions: ['10', '20', '30', '50', '100'],
|
|
140
|
+
onChange: function onChange(page, size) {
|
|
141
|
+
return restProps.onChange && restProps.onChange({
|
|
142
|
+
pageSize: size,
|
|
143
|
+
current: page
|
|
144
|
+
}, {}, {}, {
|
|
145
|
+
currentDataSource: [],
|
|
146
|
+
action: 'paginate'
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
}, pagination)))]
|
|
150
|
+
}) : /*#__PURE__*/_jsx(Table, _objectSpread(_objectSpread({}, _objectSpread(_objectSpread({
|
|
151
|
+
rowKey: rowKey,
|
|
152
|
+
dataSource: result,
|
|
153
|
+
pagination: pagination === false ? false : _objectSpread({
|
|
154
|
+
total: totalNum,
|
|
155
|
+
pageSize: pageSize,
|
|
156
|
+
current: pageNo,
|
|
157
|
+
showSizeChanger: true,
|
|
158
|
+
showQuickJumper: true,
|
|
159
|
+
showTotal: function showTotal() {
|
|
160
|
+
return "\u5171".concat(totalNum, "\u6761\u8BB0\u5F55");
|
|
161
|
+
},
|
|
162
|
+
pageSizeOptions: ['10', '20', '30', '50', '100'],
|
|
163
|
+
size: restProps.size === 'small' ? 'small' : 'default',
|
|
164
|
+
simple: restProps.size === 'small'
|
|
165
|
+
}, pagination),
|
|
166
|
+
rowSelection: rowSelection ? _objectSpread(_objectSpread({}, rowSelection), {}, {
|
|
167
|
+
columnWidth: 60
|
|
168
|
+
}) : undefined,
|
|
169
|
+
columns: filterColumns()
|
|
170
|
+
}, restProps), {}, {
|
|
171
|
+
size: restProps.size || 'middle',
|
|
172
|
+
className: classNames("".concat(!rowSelection ? 'ccs-table-noselection' : ''), !totalNum ? 'ccs-table-nodata' : '', className),
|
|
173
|
+
scroll: scroll
|
|
174
|
+
})), {}, {
|
|
175
|
+
ref: ref
|
|
176
|
+
}))
|
|
177
|
+
});
|
|
172
178
|
};
|
|
173
179
|
export default CustomTable;
|
package/es/time-picker/index.js
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
1
2
|
var _excluded = ["value", "onChange"],
|
|
2
3
|
_excluded2 = ["value", "onChange"];
|
|
3
|
-
function
|
|
4
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
5
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
6
|
+
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; }
|
|
7
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
8
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
4
9
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
5
10
|
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."); }
|
|
6
11
|
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); }
|
|
@@ -14,6 +19,7 @@ import dayjs from 'dayjs';
|
|
|
14
19
|
import customParseFormat from 'dayjs/plugin/customParseFormat';
|
|
15
20
|
import _isArray from 'lodash/isArray';
|
|
16
21
|
import React, { useState } from 'react';
|
|
22
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
17
23
|
dayjs.extend(customParseFormat);
|
|
18
24
|
function CcsDatePicker(_ref) {
|
|
19
25
|
var value = _ref.value,
|
|
@@ -31,7 +37,7 @@ function CcsDatePicker(_ref) {
|
|
|
31
37
|
setDateValue(date || undefined);
|
|
32
38
|
if (onChange) onChange(dateString);
|
|
33
39
|
};
|
|
34
|
-
return /*#__PURE__*/
|
|
40
|
+
return /*#__PURE__*/_jsx(TimePicker, _objectSpread({
|
|
35
41
|
value: dateValue,
|
|
36
42
|
onChange: handleOnChange
|
|
37
43
|
}, restProps));
|
|
@@ -52,7 +58,7 @@ function RangePicker(_ref2) {
|
|
|
52
58
|
setDateValue(date);
|
|
53
59
|
if (onChange) onChange(dateString);
|
|
54
60
|
};
|
|
55
|
-
return /*#__PURE__*/
|
|
61
|
+
return /*#__PURE__*/_jsx(TimePicker.RangePicker, _objectSpread({
|
|
56
62
|
value: dateValue,
|
|
57
63
|
onChange: handleOnChange
|
|
58
64
|
}, restProps));
|