@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.
@@ -6,17 +6,16 @@ type ClassProps = {
6
6
  style?: CSSProperties;
7
7
  };
8
8
  type CcsProGridProps = ClassProps & {
9
- bordered?: boolean;
9
+ gutter?: number;
10
10
  children?: ReactNode;
11
11
  };
12
12
  type ColProps = CardProps & {
13
- colSpan?: string | number;
14
- colStyle?: CSSProperties;
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: ({ colSpan, colClassName, colStyle, ...otherProps }: ColProps) => import("react/jsx-runtime").JSX.Element;
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;
@@ -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 = ["colSpan", "colClassName", "colStyle"],
3
- _excluded2 = ["bordered", "children"];
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 { Card } from 'antd';
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 colSpan = _ref.colSpan,
18
- colClassName = _ref.colClassName,
19
- colStyle = _ref.colStyle,
20
- otherProps = _objectWithoutProperties(_ref, _excluded);
21
- return /*#__PURE__*/_jsx(_Fragment, {
22
- children: /*#__PURE__*/_jsx("div", {
23
- className: classNames('ccs-pg-col', colClassName),
24
- style: colSpan ? _objectSpread({
25
- width: colSpan,
26
- flexShrink: 0
27
- }, colStyle) : _objectSpread({
28
- display: 'flex',
29
- width: 0,
30
- flex: 'auto',
31
- flexDirection: 'column'
32
- }, colStyle),
33
- children: /*#__PURE__*/_jsx(Card, _objectSpread({
34
- bodyStyle: {
35
- padding: 0
36
- }
37
- }, otherProps))
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(_ref2) {
42
- var bordered = _ref2.bordered,
43
- children = _ref2.children,
44
- restProps = _objectWithoutProperties(_ref2, _excluded2);
45
- return /*#__PURE__*/_jsx("div", _objectSpread(_objectSpread({}, restProps), {}, {
46
- className: classNames({
47
- 'ccs-pg-border': bordered
48
- }),
49
- children: /*#__PURE__*/_jsx("div", {
50
- className: "ccs-pl-table-content",
51
- children: children
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;
@@ -1,9 +1,4 @@
1
1
  .ccs-pg {
2
- &-col:not(:first-child) {
3
- // border-right: 1px solid #f0f0f0;
4
- margin-left: 10px;
5
- }
6
-
7
2
  &-col-title {
8
3
  font-size: 15px;
9
4
  }
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 !== null && pagination !== void 0 ? pagination : _objectSpread({
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
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@ccs-ui/rc-pro",
3
- "version": "1.1.19",
4
- "description": " ProTable支持拖拽改变宽度,需设置列宽",
3
+ "version": "1.1.20",
4
+ "description": "ProGrid 调整;ProTable 传入列宽度为number类型拖拽才生效;ProTable传入pagination分页显示异常",
5
5
  "license": "MIT",
6
6
  "author": {
7
7
  "name": "Hong",