@ztocwst/rc-pro-materials 0.1.31 → 0.1.32

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.
@@ -8,7 +8,7 @@
8
8
  border: 1px solid #d9d9d9;
9
9
  min-width: 100px;
10
10
 
11
- .icon {
11
+ .z-pointer-icon {
12
12
  // color: @primary-color;
13
13
  color: var(--ant-primary-color, @primary-color);
14
14
  }
@@ -30,7 +30,7 @@ var ZPointerBlock = function ZPointerBlock(props) {
30
30
  value: value,
31
31
  groupSeparator: ""
32
32
  })), icon ? /*#__PURE__*/React.createElement(_Col, {
33
- className: "icon"
33
+ className: "z-pointer-icon"
34
34
  }, icon) : null));
35
35
  };
36
36
  export default ZPointerBlock;
@@ -3,12 +3,12 @@ import type { CheckboxValueType } from 'antd/es/checkbox/Group';
3
3
  import type { TypeChartSettingProps } from '../../data-common';
4
4
  import './index.less';
5
5
  export interface linkParamsType extends Pick<TypeChartSettingProps, 'dataSetName'> {
6
- index?: number;
6
+ index?: number | string;
7
7
  width?: number;
8
8
  dimension?: CheckboxValueType[];
9
9
  record?: Record<string, any>;
10
10
  }
11
- export interface linkStateType extends linkParamsType, Pick<TypeChartSettingProps, 'title' | 'autoLoad' | 'refreshRate'> {
11
+ export interface linkStateType extends linkParamsType, Pick<TypeChartSettingProps, 'chartTitle' | 'title' | 'autoLoad' | 'refreshRate'> {
12
12
  }
13
13
  declare const LinkRenderer: (props: Pick<TypeChartSettingProps, "onConfirm" | "chartRef" | "dimJson" | "linkPage" | "linkPageTitle"> & {
14
14
  onBack?: () => void;
@@ -59,7 +59,7 @@ var LinkRenderer = function LinkRenderer(props) {
59
59
  return function () {
60
60
  handleClearInterval();
61
61
  };
62
- }, [linkState.dataSetName, linkState.autoLoad]);
62
+ }, [linkState.dataSetName, linkState.index, linkState.autoLoad]);
63
63
 
64
64
  // 获取表头
65
65
  var handleGetColumns = function handleGetColumns(stateParams) {
@@ -208,12 +208,14 @@ var LinkRenderer = function LinkRenderer(props) {
208
208
  }
209
209
  }
210
210
  var _linkPage$index2 = linkPage[index],
211
+ chartTitle = _linkPage$index2.chartTitle,
211
212
  title = _linkPage$index2.title,
212
213
  autoLoad = _linkPage$index2.autoLoad,
213
214
  refreshRate = _linkPage$index2.refreshRate;
214
215
  var stateData = _extends({}, state, {
215
216
  width: width,
216
217
  index: index,
218
+ chartTitle: chartTitle,
217
219
  title: title,
218
220
  autoLoad: autoLoad,
219
221
  refreshRate: refreshRate
@@ -250,12 +252,14 @@ var LinkRenderer = function LinkRenderer(props) {
250
252
  dataSetName = _ref6[0],
251
253
  index = _ref6[1];
252
254
  var _linkPage$index3 = linkPage[index],
255
+ chartTitle = _linkPage$index3.chartTitle,
253
256
  title = _linkPage$index3.title,
254
257
  autoLoad = _linkPage$index3.autoLoad,
255
258
  refreshRate = _linkPage$index3.refreshRate;
256
259
  var stateData = _extends({}, linkState, {
257
260
  dataSetName: dataSetName,
258
261
  index: index,
262
+ chartTitle: chartTitle,
259
263
  title: title,
260
264
  autoLoad: autoLoad,
261
265
  refreshRate: refreshRate
@@ -270,10 +274,10 @@ var LinkRenderer = function LinkRenderer(props) {
270
274
  }, /*#__PURE__*/React.createElement(ArrowLeftOutlined, {
271
275
  className: "arrow-left",
272
276
  onClick: onBack
273
- }), /*#__PURE__*/React.createElement("span", null, linkPageTitle)), (linkPage === null || linkPage === void 0 ? void 0 : (_linkPage$filter = linkPage.filter(function (field) {
277
+ }), /*#__PURE__*/React.createElement("span", null, linkState.chartTitle || linkPageTitle)), (linkPage === null || linkPage === void 0 ? void 0 : (_linkPage$filter = linkPage.filter(function (field) {
274
278
  return (field === null || field === void 0 ? void 0 : field.dataSetName) === linkState.dataSetName;
275
279
  })) === null || _linkPage$filter === void 0 ? void 0 : _linkPage$filter.length) <= 1 ? null : /*#__PURE__*/React.createElement(_Radio.Group, {
276
- value: "" + (linkState === null || linkState === void 0 ? void 0 : linkState.title) + separator + linkState.index,
280
+ value: "" + (linkState === null || linkState === void 0 ? void 0 : linkState.dataSetName) + separator + linkState.index,
277
281
  onChange: handleLinkChange
278
282
  }, linkPage === null || linkPage === void 0 ? void 0 : linkPage.map(function (field, index) {
279
283
  return (field === null || field === void 0 ? void 0 : field.dataSetName) === linkState.dataSetName ? /*#__PURE__*/React.createElement(_Radio.Button, {
@@ -3,7 +3,7 @@ import _regeneratorRuntime from "@babel/runtime/regenerator";
3
3
  function _createForOfIteratorHelperLoose(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (it) return (it = it.call(o)).next.bind(it); if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; return function () { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
4
4
  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
5
  function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
6
- import { computeWidth, handleDecimal, handleThousand, handlePercent, handleLink, handleCondition, getDimTarget } from "../../data-common.helper";
6
+ import { separator, computeWidth, handleDecimal, handleThousand, handlePercent, handleLink, handleCondition, getDimTarget } from "../../data-common.helper";
7
7
  export var stringTrim = function stringTrim(str) {
8
8
  if (!str) return '';
9
9
  return str.replace(/`|'|"/g, '');
@@ -174,7 +174,7 @@ export var handleValueFormat = function handleValueFormat(value, record, find, c
174
174
  export var handleColumns = function handleColumns(option, expressions, onLink) {
175
175
  var dimTarget = [].concat(option.dimension, option.index);
176
176
  return dimTarget.map(function (title) {
177
- var _find3, _find4, _title$toString;
177
+ var _find3, _find3$link, _find4, _find5, _title$toString;
178
178
  var find;
179
179
  var dataIndex;
180
180
  var condition;
@@ -199,17 +199,18 @@ export var handleColumns = function handleColumns(option, expressions, onLink) {
199
199
  // condition = expressions?.filter((item) => item?.index?.includes(find?.name));
200
200
  // }
201
201
 
202
+ var _ref4 = ((_find3 = find) === null || _find3 === void 0 ? void 0 : (_find3$link = _find3.link) === null || _find3$link === void 0 ? void 0 : _find3$link.split(separator)) || [],
203
+ dataSetName = _ref4[0];
202
204
  return {
203
205
  title: title,
204
206
  dataIndex: dataIndex,
205
207
  ellipsis: true,
206
- sorter: (_find3 = find) === null || _find3 === void 0 ? void 0 : _find3.sorted,
207
- width: ((_find4 = find) === null || _find4 === void 0 ? void 0 : _find4.width) || computeWidth(title === null || title === void 0 ? void 0 : (_title$toString = title.toString()) === null || _title$toString === void 0 ? void 0 : _title$toString.length),
208
+ sorter: (_find4 = find) === null || _find4 === void 0 ? void 0 : _find4.sorted,
209
+ width: ((_find5 = find) === null || _find5 === void 0 ? void 0 : _find5.width) || computeWidth(title === null || title === void 0 ? void 0 : (_title$toString = title.toString()) === null || _title$toString === void 0 ? void 0 : _title$toString.length),
208
210
  render: function render(value, record) {
209
211
  return handleValueFormat(value, record, find, condition, function () {
210
- var _find5;
211
212
  return onLink({
212
- dataSetName: (_find5 = find) === null || _find5 === void 0 ? void 0 : _find5.link,
213
+ dataSetName: dataSetName,
213
214
  record: record
214
215
  });
215
216
  });
@@ -35,6 +35,8 @@ export interface TypeTargetProps {
35
35
  }
36
36
  /** 表格相关配置 */
37
37
  export interface TypeChartSettingProps {
38
+ /** 二级页标题 */
39
+ chartTitle?: string;
38
40
  /** 标题 */
39
41
  title?: string;
40
42
  /** 维度配置 */
@@ -8,7 +8,7 @@
8
8
  border: 1px solid #d9d9d9;
9
9
  min-width: 100px;
10
10
 
11
- .icon {
11
+ .z-pointer-icon {
12
12
  // color: @primary-color;
13
13
  color: var(--ant-primary-color, @primary-color);
14
14
  }
@@ -35,7 +35,7 @@ var ZPointerBlock = function ZPointerBlock(props) {
35
35
  value: value,
36
36
  groupSeparator: ""
37
37
  })), icon ? /*#__PURE__*/React.createElement(_col["default"], {
38
- className: "icon"
38
+ className: "z-pointer-icon"
39
39
  }, icon) : null));
40
40
  };
41
41
  var _default = ZPointerBlock;
@@ -3,12 +3,12 @@ import type { CheckboxValueType } from 'antd/es/checkbox/Group';
3
3
  import type { TypeChartSettingProps } from '../../data-common';
4
4
  import './index.less';
5
5
  export interface linkParamsType extends Pick<TypeChartSettingProps, 'dataSetName'> {
6
- index?: number;
6
+ index?: number | string;
7
7
  width?: number;
8
8
  dimension?: CheckboxValueType[];
9
9
  record?: Record<string, any>;
10
10
  }
11
- export interface linkStateType extends linkParamsType, Pick<TypeChartSettingProps, 'title' | 'autoLoad' | 'refreshRate'> {
11
+ export interface linkStateType extends linkParamsType, Pick<TypeChartSettingProps, 'chartTitle' | 'title' | 'autoLoad' | 'refreshRate'> {
12
12
  }
13
13
  declare const LinkRenderer: (props: Pick<TypeChartSettingProps, "onConfirm" | "chartRef" | "dimJson" | "linkPage" | "linkPageTitle"> & {
14
14
  onBack?: () => void;
@@ -64,7 +64,7 @@ var LinkRenderer = function LinkRenderer(props) {
64
64
  return function () {
65
65
  handleClearInterval();
66
66
  };
67
- }, [linkState.dataSetName, linkState.autoLoad]);
67
+ }, [linkState.dataSetName, linkState.index, linkState.autoLoad]);
68
68
 
69
69
  // 获取表头
70
70
  var handleGetColumns = function handleGetColumns(stateParams) {
@@ -213,12 +213,14 @@ var LinkRenderer = function LinkRenderer(props) {
213
213
  }
214
214
  }
215
215
  var _linkPage$index2 = linkPage[index],
216
+ chartTitle = _linkPage$index2.chartTitle,
216
217
  title = _linkPage$index2.title,
217
218
  autoLoad = _linkPage$index2.autoLoad,
218
219
  refreshRate = _linkPage$index2.refreshRate;
219
220
  var stateData = (0, _extends2["default"])({}, state, {
220
221
  width: width,
221
222
  index: index,
223
+ chartTitle: chartTitle,
222
224
  title: title,
223
225
  autoLoad: autoLoad,
224
226
  refreshRate: refreshRate
@@ -255,12 +257,14 @@ var LinkRenderer = function LinkRenderer(props) {
255
257
  dataSetName = _ref6[0],
256
258
  index = _ref6[1];
257
259
  var _linkPage$index3 = linkPage[index],
260
+ chartTitle = _linkPage$index3.chartTitle,
258
261
  title = _linkPage$index3.title,
259
262
  autoLoad = _linkPage$index3.autoLoad,
260
263
  refreshRate = _linkPage$index3.refreshRate;
261
264
  var stateData = (0, _extends2["default"])({}, linkState, {
262
265
  dataSetName: dataSetName,
263
266
  index: index,
267
+ chartTitle: chartTitle,
264
268
  title: title,
265
269
  autoLoad: autoLoad,
266
270
  refreshRate: refreshRate
@@ -275,10 +279,10 @@ var LinkRenderer = function LinkRenderer(props) {
275
279
  }, /*#__PURE__*/React.createElement(_icons.ArrowLeftOutlined, {
276
280
  className: "arrow-left",
277
281
  onClick: onBack
278
- }), /*#__PURE__*/React.createElement("span", null, linkPageTitle)), (linkPage === null || linkPage === void 0 ? void 0 : (_linkPage$filter = linkPage.filter(function (field) {
282
+ }), /*#__PURE__*/React.createElement("span", null, linkState.chartTitle || linkPageTitle)), (linkPage === null || linkPage === void 0 ? void 0 : (_linkPage$filter = linkPage.filter(function (field) {
279
283
  return (field === null || field === void 0 ? void 0 : field.dataSetName) === linkState.dataSetName;
280
284
  })) === null || _linkPage$filter === void 0 ? void 0 : _linkPage$filter.length) <= 1 ? null : /*#__PURE__*/React.createElement(_radio["default"].Group, {
281
- value: "" + (linkState === null || linkState === void 0 ? void 0 : linkState.title) + _dataCommon.separator + linkState.index,
285
+ value: "" + (linkState === null || linkState === void 0 ? void 0 : linkState.dataSetName) + _dataCommon.separator + linkState.index,
282
286
  onChange: handleLinkChange
283
287
  }, linkPage === null || linkPage === void 0 ? void 0 : linkPage.map(function (field, index) {
284
288
  return (field === null || field === void 0 ? void 0 : field.dataSetName) === linkState.dataSetName ? /*#__PURE__*/React.createElement(_radio["default"].Button, {
@@ -182,7 +182,7 @@ exports.handleValueFormat = handleValueFormat;
182
182
  var handleColumns = function handleColumns(option, expressions, onLink) {
183
183
  var dimTarget = [].concat(option.dimension, option.index);
184
184
  return dimTarget.map(function (title) {
185
- var _find3, _find4, _title$toString;
185
+ var _find3, _find3$link, _find4, _find5, _title$toString;
186
186
  var find;
187
187
  var dataIndex;
188
188
  var condition;
@@ -207,17 +207,18 @@ var handleColumns = function handleColumns(option, expressions, onLink) {
207
207
  // condition = expressions?.filter((item) => item?.index?.includes(find?.name));
208
208
  // }
209
209
 
210
+ var _ref4 = ((_find3 = find) === null || _find3 === void 0 ? void 0 : (_find3$link = _find3.link) === null || _find3$link === void 0 ? void 0 : _find3$link.split(_dataCommon.separator)) || [],
211
+ dataSetName = _ref4[0];
210
212
  return {
211
213
  title: title,
212
214
  dataIndex: dataIndex,
213
215
  ellipsis: true,
214
- sorter: (_find3 = find) === null || _find3 === void 0 ? void 0 : _find3.sorted,
215
- width: ((_find4 = find) === null || _find4 === void 0 ? void 0 : _find4.width) || (0, _dataCommon.computeWidth)(title === null || title === void 0 ? void 0 : (_title$toString = title.toString()) === null || _title$toString === void 0 ? void 0 : _title$toString.length),
216
+ sorter: (_find4 = find) === null || _find4 === void 0 ? void 0 : _find4.sorted,
217
+ width: ((_find5 = find) === null || _find5 === void 0 ? void 0 : _find5.width) || (0, _dataCommon.computeWidth)(title === null || title === void 0 ? void 0 : (_title$toString = title.toString()) === null || _title$toString === void 0 ? void 0 : _title$toString.length),
216
218
  render: function render(value, record) {
217
219
  return handleValueFormat(value, record, find, condition, function () {
218
- var _find5;
219
220
  return onLink({
220
- dataSetName: (_find5 = find) === null || _find5 === void 0 ? void 0 : _find5.link,
221
+ dataSetName: dataSetName,
221
222
  record: record
222
223
  });
223
224
  });
@@ -35,6 +35,8 @@ export interface TypeTargetProps {
35
35
  }
36
36
  /** 表格相关配置 */
37
37
  export interface TypeChartSettingProps {
38
+ /** 二级页标题 */
39
+ chartTitle?: string;
38
40
  /** 标题 */
39
41
  title?: string;
40
42
  /** 维度配置 */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ztocwst/rc-pro-materials",
3
- "version": "0.1.31",
3
+ "version": "0.1.32",
4
4
  "description": "@ztocwst/rc-pro-materials",
5
5
  "main": "lib/index.js",
6
6
  "module": "es/index.js",
@@ -86,9 +86,9 @@
86
86
  },
87
87
  "componentConfig": {
88
88
  "isComponentLibrary": true,
89
- "materialSchema": "https://npm.onmicrosoft.cn/@ztocwst/rc-pro-materials@0.1.31/build/lowcode/assets-prod.json"
89
+ "materialSchema": "https://npm.onmicrosoft.cn/@ztocwst/rc-pro-materials@0.1.32/build/lowcode/assets-prod.json"
90
90
  },
91
- "homepage": "https://unpkg.com/@ztocwst/rc-pro-materials@0.1.31/build/index.html",
91
+ "homepage": "https://unpkg.com/@ztocwst/rc-pro-materials@0.1.32/build/index.html",
92
92
  "publishConfig": {
93
93
  "registry": "https://registry.npmjs.org/",
94
94
  "access": "public"