@ccs-ui/rc-pro 1.1.19 → 1.1.20
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/pro-grid/index.d.ts +4 -5
- package/es/pro-grid/index.js +41 -38
- package/es/pro-grid/index.less +0 -5
- package/es/table/index.js +3 -3
- package/package.json +2 -2
package/es/pro-grid/index.d.ts
CHANGED
|
@@ -6,17 +6,16 @@ type ClassProps = {
|
|
|
6
6
|
style?: CSSProperties;
|
|
7
7
|
};
|
|
8
8
|
type CcsProGridProps = ClassProps & {
|
|
9
|
-
|
|
9
|
+
gutter?: number;
|
|
10
10
|
children?: ReactNode;
|
|
11
11
|
};
|
|
12
12
|
type ColProps = CardProps & {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
colClassName?: string;
|
|
13
|
+
colWidth?: number;
|
|
14
|
+
children?: ReactNode;
|
|
16
15
|
};
|
|
17
16
|
type GridInstance = FC<CcsProGridProps> & {
|
|
18
17
|
Col: typeof GridCol;
|
|
19
18
|
};
|
|
20
|
-
declare const GridCol: ({
|
|
19
|
+
declare const GridCol: ({ children, colWidth, style, className, ...restProps }: ColProps) => import("react/jsx-runtime").JSX.Element;
|
|
21
20
|
declare const ProGrid: GridInstance;
|
|
22
21
|
export default ProGrid;
|
package/es/pro-grid/index.js
CHANGED
|
@@ -1,6 +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
|
-
var _excluded = ["
|
|
3
|
-
_excluded2 = ["
|
|
2
|
+
var _excluded = ["children", "colWidth", "style", "className"],
|
|
3
|
+
_excluded2 = ["children", "gutter"];
|
|
4
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
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
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; }
|
|
@@ -8,48 +8,51 @@ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _ty
|
|
|
8
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); }
|
|
9
9
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
10
10
|
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
|
-
import
|
|
12
|
-
import classNames from 'classnames';
|
|
11
|
+
import React from 'react';
|
|
13
12
|
import "./index.less";
|
|
14
13
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
15
14
|
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
16
15
|
var GridCol = function GridCol(_ref) {
|
|
17
|
-
var
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
16
|
+
var children = _ref.children,
|
|
17
|
+
colWidth = _ref.colWidth,
|
|
18
|
+
style = _ref.style,
|
|
19
|
+
className = _ref.className,
|
|
20
|
+
restProps = _objectWithoutProperties(_ref, _excluded);
|
|
21
|
+
console.log('restProps', restProps);
|
|
22
|
+
var styles = _objectSpread({}, style);
|
|
23
|
+
if (colWidth) {
|
|
24
|
+
styles.width = colWidth;
|
|
25
|
+
styles.flex = "0 0 ".concat(colWidth, "px");
|
|
26
|
+
} else {
|
|
27
|
+
styles.flex = "1 1 auto";
|
|
28
|
+
}
|
|
29
|
+
var _ref2 = restProps,
|
|
30
|
+
gutter = _ref2.gutter;
|
|
31
|
+
if (gutter) {
|
|
32
|
+
styles.marginLeft = gutter;
|
|
33
|
+
}
|
|
34
|
+
return /*#__PURE__*/_jsx("div", {
|
|
35
|
+
style: styles,
|
|
36
|
+
className: className,
|
|
37
|
+
children: children
|
|
39
38
|
});
|
|
40
39
|
};
|
|
41
|
-
var Grid = function Grid(
|
|
42
|
-
var
|
|
43
|
-
|
|
44
|
-
restProps = _objectWithoutProperties(
|
|
45
|
-
return /*#__PURE__*/_jsx("div", _objectSpread(_objectSpread({
|
|
46
|
-
|
|
47
|
-
'
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
40
|
+
var Grid = function Grid(_ref3) {
|
|
41
|
+
var children = _ref3.children,
|
|
42
|
+
gutter = _ref3.gutter,
|
|
43
|
+
restProps = _objectWithoutProperties(_ref3, _excluded2);
|
|
44
|
+
return /*#__PURE__*/_jsx("div", _objectSpread(_objectSpread({
|
|
45
|
+
style: {
|
|
46
|
+
display: 'flex'
|
|
47
|
+
}
|
|
48
|
+
}, restProps), {}, {
|
|
49
|
+
children: gutter ? React.Children.map(children, function (child, index) {
|
|
50
|
+
return /*#__PURE__*/_jsx(_Fragment, {
|
|
51
|
+
children: /*#__PURE__*/React.isValidElement(child) && /*#__PURE__*/React.cloneElement(child, {
|
|
52
|
+
gutter: index !== 0 ? gutter : 0
|
|
53
|
+
})
|
|
54
|
+
});
|
|
55
|
+
}) : children
|
|
53
56
|
}));
|
|
54
57
|
};
|
|
55
58
|
var ProGrid = Grid;
|
package/es/pro-grid/index.less
CHANGED
package/es/table/index.js
CHANGED
|
@@ -25,7 +25,7 @@ var ResizableTitle = function ResizableTitle(props) {
|
|
|
25
25
|
var onResize = props.onResize,
|
|
26
26
|
width = props.width,
|
|
27
27
|
restProps = _objectWithoutProperties(props, _excluded);
|
|
28
|
-
if (!width) {
|
|
28
|
+
if (!width || typeof width !== 'number') {
|
|
29
29
|
return /*#__PURE__*/_jsx("th", _objectSpread({}, restProps));
|
|
30
30
|
}
|
|
31
31
|
return /*#__PURE__*/_jsx(Resizable, {
|
|
@@ -175,7 +175,7 @@ var CustomTable = function CustomTable(props) {
|
|
|
175
175
|
children: /*#__PURE__*/_jsx(Table, _objectSpread(_objectSpread({
|
|
176
176
|
rowKey: rowKey,
|
|
177
177
|
dataSource: result,
|
|
178
|
-
pagination: pagination
|
|
178
|
+
pagination: pagination === false ? false : _objectSpread({
|
|
179
179
|
total: totalNum,
|
|
180
180
|
pageSize: pageSize,
|
|
181
181
|
current: pageNo,
|
|
@@ -187,7 +187,7 @@ var CustomTable = function CustomTable(props) {
|
|
|
187
187
|
pageSizeOptions: ['10', '20', '30', '50', '100'],
|
|
188
188
|
size: restProps.size === 'small' ? 'small' : 'default',
|
|
189
189
|
simple: restProps.size === 'small'
|
|
190
|
-
}, pagination
|
|
190
|
+
}, pagination),
|
|
191
191
|
rowSelection: rowSelection ? _objectSpread(_objectSpread({}, rowSelection), {}, {
|
|
192
192
|
columnWidth: 60
|
|
193
193
|
}) : undefined,
|
package/package.json
CHANGED