@ztocwst/rc-pro-materials 0.1.24 → 0.1.25

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.
@@ -7,7 +7,7 @@
7
7
  padding: 16px;
8
8
  overflow: hidden;
9
9
 
10
- &.animate :hover {
10
+ &.animate:hover {
11
11
  transform: scale(1.05);
12
12
  transition: all 0.3s ease-in;
13
13
  }
@@ -16,7 +16,8 @@
16
16
  .pointer-block-title {
17
17
  display: flex;
18
18
  // color: #487ffb;
19
- color: @primary-color;
19
+ // color: @primary-color;
20
+ color: var(--ant-primary-color, @primary-color);
20
21
 
21
22
  .ant-typography {
22
23
  color: inherit;
@@ -46,6 +47,12 @@
46
47
  grid-gap: 10px;
47
48
  grid-template-columns: repeat(1, 1fr);
48
49
 
50
+ .z-pointer-block.animate:hover {
51
+ box-shadow: 0 4px 16px 2px rgba(0, 0, 0, 0.1);
52
+ transform: scale(1.05);
53
+ transition: all 0.3s ease-in;
54
+ }
55
+
49
56
  // 流程指标块
50
57
  &.process .z-pointer-block,
51
58
  &.process > * {
@@ -75,8 +82,8 @@
75
82
  width: 10px;
76
83
  height: 10px;
77
84
  background: #fff;
78
- border: 2px solid @primary-color;
79
- // border: 2px solid var(--ant-primary-color);
85
+ // border: 2px solid @primary-color;
86
+ border: 2px solid var(--ant-primary-color, @primary-color);
80
87
  border-radius: 50%;
81
88
  content: '';
82
89
  }
@@ -110,8 +117,8 @@
110
117
  width: 10px;
111
118
  height: 10px;
112
119
  background: #fff;
113
- border: 2px solid @primary-color;
114
- // border: 2px solid var(--ant-primary-color);
120
+ // border: 2px solid @primary-color;
121
+ border: 2px solid var(--ant-primary-color, @primary-color);
115
122
  border-radius: 50%;
116
123
  content: '';
117
124
  }
@@ -7,8 +7,6 @@ export interface TypeAggBlockProps {
7
7
  start: string;
8
8
  end: string;
9
9
  };
10
- /** 开启动画 */
11
- animate?: boolean;
12
10
  /** 标题 */
13
11
  title?: React.ReactNode;
14
12
  /** 副标题 */
@@ -23,6 +21,7 @@ export interface TypeAggBlockProps {
23
21
  /** 一行几列 */
24
22
  column?: number;
25
23
  items?: TypeZPointerBlockProps[] | React.ReactNode;
24
+ onClick?: (item: any) => void;
26
25
  }
27
26
  declare const ZAggBlock: React.FC<TypeAggBlockProps>;
28
27
  export default ZAggBlock;
@@ -1,6 +1,6 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
2
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/objectWithoutPropertiesLoose";
3
- var _excluded = ["color", "animate", "title", "subTitle", "extra", "process", "direction", "column"];
3
+ var _excluded = ["color", "title", "subTitle", "extra", "process", "direction", "column", "onClick"];
4
4
  import React from 'react';
5
5
  import classnames from 'classnames';
6
6
  import "./index.less";
@@ -8,21 +8,24 @@ import ZPointerBlock from "../z-pointer-block";
8
8
  var ZAggBlock = function ZAggBlock(_ref) {
9
9
  var _rest$items;
10
10
  var color = _ref.color,
11
- animate = _ref.animate,
12
11
  title = _ref.title,
13
12
  subTitle = _ref.subTitle,
14
13
  extra = _ref.extra,
15
14
  process = _ref.process,
16
15
  direction = _ref.direction,
17
16
  column = _ref.column,
17
+ _onClick = _ref.onClick,
18
18
  rest = _objectWithoutPropertiesLoose(_ref, _excluded);
19
19
  return /*#__PURE__*/React.createElement("div", {
20
20
  className: classnames('pointer-block-wrap', {
21
- animate: !!animate
21
+ animate: !!_onClick
22
22
  }),
23
23
  style: _extends({
24
24
  background: "linear-gradient(180deg, " + ((color === null || color === void 0 ? void 0 : color.start) || '#eaf0ff') + " 0%, " + ((color === null || color === void 0 ? void 0 : color.end) || '#fafeff') + " 100%)"
25
- }, rest.style || {})
25
+ }, rest.style || {}),
26
+ onClick: function onClick() {
27
+ _onClick === null || _onClick === void 0 ? void 0 : _onClick(rest.items);
28
+ }
26
29
  }, /*#__PURE__*/React.createElement("div", {
27
30
  className: "pointer-block-title"
28
31
  }, /*#__PURE__*/React.createElement("div", {
@@ -43,6 +46,7 @@ var ZAggBlock = function ZAggBlock(_ref) {
43
46
  }
44
47
  }, /*#__PURE__*/React.isValidElement(rest.items) ? rest.items : (_rest$items = rest.items) === null || _rest$items === void 0 ? void 0 : _rest$items.map(function (e, index) {
45
48
  if ( /*#__PURE__*/React.isValidElement(e)) {
49
+ // todo 统一处理点击事件
46
50
  return e;
47
51
  }
48
52
  return /*#__PURE__*/React.createElement(ZPointerBlock, _extends({
@@ -9,7 +9,7 @@
9
9
  min-width: 100px;
10
10
 
11
11
  .icon {
12
- color: @primary-color;
13
- // color: var(--ant-primary-color);
12
+ // color: @primary-color;
13
+ color: var(--ant-primary-color, @primary-color);
14
14
  }
15
15
  }
@@ -9,6 +9,7 @@ export interface TypeZPointerBlockProps {
9
9
  icon?: React.ReactNode;
10
10
  align?: 'top' | 'middle' | 'bottom';
11
11
  style?: React.CSSProperties;
12
+ onClick?: (item?: any) => void;
12
13
  }
13
- declare const ZPointerBlock: ({ style, title, value, icon, align }: TypeZPointerBlockProps) => import("react").JSX.Element;
14
+ declare const ZPointerBlock: (props: TypeZPointerBlockProps) => import("react").JSX.Element;
14
15
  export default ZPointerBlock;
@@ -3,15 +3,23 @@ import _Col from "antd/es/col";
3
3
  import _Statistic from "antd/es/statistic";
4
4
  import _extends from "@babel/runtime/helpers/extends";
5
5
  import "./index.less";
6
- var ZPointerBlock = function ZPointerBlock(_ref) {
7
- var style = _ref.style,
8
- title = _ref.title,
9
- value = _ref.value,
10
- icon = _ref.icon,
11
- align = _ref.align;
6
+ import classnames from 'classnames';
7
+ var ZPointerBlock = function ZPointerBlock(props) {
8
+ var style = props.style,
9
+ title = props.title,
10
+ value = props.value,
11
+ icon = props.icon,
12
+ align = props.align,
13
+ _onClick = props.onClick;
12
14
  return /*#__PURE__*/React.createElement("div", {
13
- className: "z-pointer-block",
14
- style: _extends({}, style)
15
+ className: classnames('z-pointer-block', {
16
+ // 聚合指标里可点击时添加css动效
17
+ animate: !!_onClick
18
+ }),
19
+ style: _extends({}, style),
20
+ onClick: function onClick() {
21
+ _onClick === null || _onClick === void 0 ? void 0 : _onClick(props);
22
+ }
15
23
  }, /*#__PURE__*/React.createElement(_Row, {
16
24
  align: align,
17
25
  gutter: 8
@@ -1,3 +1,6 @@
1
+ @root-entry-name: 'default';
2
+ @import (reference) '~antd/es/style/themes/index.less';
3
+
1
4
  .ranking-list .ant-table .ant-table-thead > tr > th {
2
5
  border-bottom: none;
3
6
  font-size: 13px;
@@ -33,7 +36,8 @@
33
36
 
34
37
  &.highlight {
35
38
  color: #fff;
36
- background: #1890ff;
39
+ // background: #1890ff;
40
+ background: var(--ant-primary-color, @primary-color);
37
41
  }
38
42
  }
39
43
 
package/es/style.js CHANGED
@@ -4,6 +4,8 @@ import 'antd/lib/table/style';
4
4
  import 'antd/lib/typography/style';
5
5
  import 'antd/lib/config-provider/style';
6
6
  import 'antd/es/config-provider/style';
7
+ import 'antd/lib/row/style';
8
+ import 'antd/lib/col/style';
7
9
  import 'antd/es/statistic/style';
8
10
  import 'antd/es/progress/style';
9
11
  import 'antd/es/table/style';
@@ -7,7 +7,7 @@
7
7
  padding: 16px;
8
8
  overflow: hidden;
9
9
 
10
- &.animate :hover {
10
+ &.animate:hover {
11
11
  transform: scale(1.05);
12
12
  transition: all 0.3s ease-in;
13
13
  }
@@ -16,7 +16,8 @@
16
16
  .pointer-block-title {
17
17
  display: flex;
18
18
  // color: #487ffb;
19
- color: @primary-color;
19
+ // color: @primary-color;
20
+ color: var(--ant-primary-color, @primary-color);
20
21
 
21
22
  .ant-typography {
22
23
  color: inherit;
@@ -46,6 +47,12 @@
46
47
  grid-gap: 10px;
47
48
  grid-template-columns: repeat(1, 1fr);
48
49
 
50
+ .z-pointer-block.animate:hover {
51
+ box-shadow: 0 4px 16px 2px rgba(0, 0, 0, 0.1);
52
+ transform: scale(1.05);
53
+ transition: all 0.3s ease-in;
54
+ }
55
+
49
56
  // 流程指标块
50
57
  &.process .z-pointer-block,
51
58
  &.process > * {
@@ -75,8 +82,8 @@
75
82
  width: 10px;
76
83
  height: 10px;
77
84
  background: #fff;
78
- border: 2px solid @primary-color;
79
- // border: 2px solid var(--ant-primary-color);
85
+ // border: 2px solid @primary-color;
86
+ border: 2px solid var(--ant-primary-color, @primary-color);
80
87
  border-radius: 50%;
81
88
  content: '';
82
89
  }
@@ -110,8 +117,8 @@
110
117
  width: 10px;
111
118
  height: 10px;
112
119
  background: #fff;
113
- border: 2px solid @primary-color;
114
- // border: 2px solid var(--ant-primary-color);
120
+ // border: 2px solid @primary-color;
121
+ border: 2px solid var(--ant-primary-color, @primary-color);
115
122
  border-radius: 50%;
116
123
  content: '';
117
124
  }
@@ -7,8 +7,6 @@ export interface TypeAggBlockProps {
7
7
  start: string;
8
8
  end: string;
9
9
  };
10
- /** 开启动画 */
11
- animate?: boolean;
12
10
  /** 标题 */
13
11
  title?: React.ReactNode;
14
12
  /** 副标题 */
@@ -23,6 +21,7 @@ export interface TypeAggBlockProps {
23
21
  /** 一行几列 */
24
22
  column?: number;
25
23
  items?: TypeZPointerBlockProps[] | React.ReactNode;
24
+ onClick?: (item: any) => void;
26
25
  }
27
26
  declare const ZAggBlock: React.FC<TypeAggBlockProps>;
28
27
  export default ZAggBlock;
@@ -9,25 +9,28 @@ var _react = _interopRequireDefault(require("react"));
9
9
  var _classnames = _interopRequireDefault(require("classnames"));
10
10
  require("./index.less");
11
11
  var _zPointerBlock = _interopRequireDefault(require("../z-pointer-block"));
12
- var _excluded = ["color", "animate", "title", "subTitle", "extra", "process", "direction", "column"];
12
+ var _excluded = ["color", "title", "subTitle", "extra", "process", "direction", "column", "onClick"];
13
13
  var ZAggBlock = function ZAggBlock(_ref) {
14
14
  var _rest$items;
15
15
  var color = _ref.color,
16
- animate = _ref.animate,
17
16
  title = _ref.title,
18
17
  subTitle = _ref.subTitle,
19
18
  extra = _ref.extra,
20
19
  process = _ref.process,
21
20
  direction = _ref.direction,
22
21
  column = _ref.column,
22
+ _onClick = _ref.onClick,
23
23
  rest = (0, _objectWithoutPropertiesLoose2["default"])(_ref, _excluded);
24
24
  return /*#__PURE__*/_react["default"].createElement("div", {
25
25
  className: (0, _classnames["default"])('pointer-block-wrap', {
26
- animate: !!animate
26
+ animate: !!_onClick
27
27
  }),
28
28
  style: (0, _extends2["default"])({
29
29
  background: "linear-gradient(180deg, " + ((color === null || color === void 0 ? void 0 : color.start) || '#eaf0ff') + " 0%, " + ((color === null || color === void 0 ? void 0 : color.end) || '#fafeff') + " 100%)"
30
- }, rest.style || {})
30
+ }, rest.style || {}),
31
+ onClick: function onClick() {
32
+ _onClick === null || _onClick === void 0 ? void 0 : _onClick(rest.items);
33
+ }
31
34
  }, /*#__PURE__*/_react["default"].createElement("div", {
32
35
  className: "pointer-block-title"
33
36
  }, /*#__PURE__*/_react["default"].createElement("div", {
@@ -48,6 +51,7 @@ var ZAggBlock = function ZAggBlock(_ref) {
48
51
  }
49
52
  }, /*#__PURE__*/_react["default"].isValidElement(rest.items) ? rest.items : (_rest$items = rest.items) === null || _rest$items === void 0 ? void 0 : _rest$items.map(function (e, index) {
50
53
  if ( /*#__PURE__*/_react["default"].isValidElement(e)) {
54
+ // todo 统一处理点击事件
51
55
  return e;
52
56
  }
53
57
  return /*#__PURE__*/_react["default"].createElement(_zPointerBlock["default"], (0, _extends2["default"])({
@@ -9,7 +9,7 @@
9
9
  min-width: 100px;
10
10
 
11
11
  .icon {
12
- color: @primary-color;
13
- // color: var(--ant-primary-color);
12
+ // color: @primary-color;
13
+ color: var(--ant-primary-color, @primary-color);
14
14
  }
15
15
  }
@@ -9,6 +9,7 @@ export interface TypeZPointerBlockProps {
9
9
  icon?: React.ReactNode;
10
10
  align?: 'top' | 'middle' | 'bottom';
11
11
  style?: React.CSSProperties;
12
+ onClick?: (item?: any) => void;
12
13
  }
13
- declare const ZPointerBlock: ({ style, title, value, icon, align }: TypeZPointerBlockProps) => import("react").JSX.Element;
14
+ declare const ZPointerBlock: (props: TypeZPointerBlockProps) => import("react").JSX.Element;
14
15
  export default ZPointerBlock;
@@ -8,15 +8,23 @@ var _col = _interopRequireDefault(require("antd/lib/col"));
8
8
  var _statistic = _interopRequireDefault(require("antd/lib/statistic"));
9
9
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
10
10
  require("./index.less");
11
- var ZPointerBlock = function ZPointerBlock(_ref) {
12
- var style = _ref.style,
13
- title = _ref.title,
14
- value = _ref.value,
15
- icon = _ref.icon,
16
- align = _ref.align;
11
+ var _classnames = _interopRequireDefault(require("classnames"));
12
+ var ZPointerBlock = function ZPointerBlock(props) {
13
+ var style = props.style,
14
+ title = props.title,
15
+ value = props.value,
16
+ icon = props.icon,
17
+ align = props.align,
18
+ _onClick = props.onClick;
17
19
  return /*#__PURE__*/React.createElement("div", {
18
- className: "z-pointer-block",
19
- style: (0, _extends2["default"])({}, style)
20
+ className: (0, _classnames["default"])('z-pointer-block', {
21
+ // 聚合指标里可点击时添加css动效
22
+ animate: !!_onClick
23
+ }),
24
+ style: (0, _extends2["default"])({}, style),
25
+ onClick: function onClick() {
26
+ _onClick === null || _onClick === void 0 ? void 0 : _onClick(props);
27
+ }
20
28
  }, /*#__PURE__*/React.createElement(_row["default"], {
21
29
  align: align,
22
30
  gutter: 8
@@ -1,3 +1,6 @@
1
+ @root-entry-name: 'default';
2
+ @import (reference) '~antd/es/style/themes/index.less';
3
+
1
4
  .ranking-list .ant-table .ant-table-thead > tr > th {
2
5
  border-bottom: none;
3
6
  font-size: 13px;
@@ -33,7 +36,8 @@
33
36
 
34
37
  &.highlight {
35
38
  color: #fff;
36
- background: #1890ff;
39
+ // background: #1890ff;
40
+ background: var(--ant-primary-color, @primary-color);
37
41
  }
38
42
  }
39
43
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ztocwst/rc-pro-materials",
3
- "version": "0.1.24",
3
+ "version": "0.1.25",
4
4
  "description": "@ztocwst/rc-pro-materials",
5
5
  "main": "lib/index.js",
6
6
  "module": "es/index.js",
@@ -85,9 +85,9 @@
85
85
  },
86
86
  "componentConfig": {
87
87
  "isComponentLibrary": true,
88
- "materialSchema": "https://unpkg.com/@ztocwst/rc-pro-materials@0.1.24/build/lowcode/assets-prod.json"
88
+ "materialSchema": "https://unpkg.com/@ztocwst/rc-pro-materials@0.1.25/build/lowcode/assets-prod.json"
89
89
  },
90
- "homepage": "https://unpkg.com/@ztocwst/rc-pro-materials@0.1.24/build/index.html",
90
+ "homepage": "https://unpkg.com/@ztocwst/rc-pro-materials@0.1.25/build/index.html",
91
91
  "publishConfig": {
92
92
  "registry": "https://registry.npmjs.org/",
93
93
  "access": "public"