@ztocwst/rc-pro-materials 0.2.26 → 0.2.28

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.
Files changed (25) hide show
  1. package/build/lowcode/assets-daily.json +11 -11
  2. package/build/lowcode/assets-dev.json +2 -2
  3. package/build/lowcode/assets-prod.json +11 -11
  4. package/build/lowcode/index.js +1 -1
  5. package/build/lowcode/meta.js +1 -1
  6. package/build/lowcode/preview.js +5 -5
  7. package/build/lowcode/render/default/view.js +9 -9
  8. package/build/lowcode/view.js +10 -10
  9. package/dist/SCM_Comps.js +10 -10
  10. package/dist/SCM_Comps.js.map +1 -1
  11. package/es/components/z-data-table/components/link-renderer/index.js +2 -1
  12. package/es/components/z-data-table/components/table-renderer/index.js +5 -4
  13. package/es/components/z-data-table/components/table-renderer/table-renderer.helper.d.ts +2 -15
  14. package/es/components/z-data-table/components/table-renderer/table-renderer.helper.js +27 -40
  15. package/es/components/z-data-table/data-table.d.ts +2 -1
  16. package/es/components/z-data-table/data-table.helper.d.ts +1 -7
  17. package/es/components/z-data-table/data-table.helper.js +35 -45
  18. package/lib/components/z-data-table/components/link-renderer/index.js +2 -1
  19. package/lib/components/z-data-table/components/table-renderer/index.js +5 -4
  20. package/lib/components/z-data-table/components/table-renderer/table-renderer.helper.d.ts +2 -15
  21. package/lib/components/z-data-table/components/table-renderer/table-renderer.helper.js +27 -39
  22. package/lib/components/z-data-table/data-table.d.ts +2 -1
  23. package/lib/components/z-data-table/data-table.helper.d.ts +1 -7
  24. package/lib/components/z-data-table/data-table.helper.js +38 -50
  25. package/package.json +5 -4
@@ -3,6 +3,7 @@
3
3
  export declare const tableConfigDefault: {
4
4
  manual: boolean;
5
5
  toolBars: boolean;
6
+ resizable: boolean;
6
7
  hideDefRowSelection: boolean;
7
8
  columns: any[];
8
9
  };
@@ -13,7 +14,6 @@ export declare const separator = "***";
13
14
  /** 时间单位 */
14
15
  export declare const timeUnit: number;
15
16
  /** 介于 前闭后开 */
16
- export declare const BETWEEN = "<=,<";
17
17
  /** 默认排序 */
18
18
  export declare const defaultSort = "asc";
19
19
  /** 数据类型 */
@@ -56,12 +56,6 @@ export declare const handlePercent: (value: valueType, decimal?: number, unit?:
56
56
  * link外链处理
57
57
  */
58
58
  export declare const handleLink: (value: valueType, onLink?: () => void) => import("react").JSX.Element;
59
- /**
60
- * 条件格式设置
61
- * @param value 处理前的值
62
- * @param handledValue 被处理后的值 可能会是link标签
63
- */
64
- export declare const handleCondition: (value: valueType, handledValue: any, conditions: any[]) => any;
65
59
  /** 获取维度指标 */
66
60
  export declare const getDimTarget: (rcProContext: any, params: any) => Promise<any>;
67
61
  /** 获取报表数据 */
@@ -2,18 +2,16 @@
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
4
  exports.__esModule = true;
5
- exports.timeUnit = exports.tableConfigDefault = exports.separator = exports.saveDimTarget = exports.handleThousand = exports.handleQueryParams = exports.handlePercent = exports.handleLink = exports.handleDecimal = exports.handleCondition = exports.getType = exports.getReportData = exports.getMaxWidth = exports.getDimTarget = exports.defaultSort = exports.dateStart = exports.computeWidth = exports.BETWEEN = void 0;
5
+ exports.timeUnit = exports.tableConfigDefault = exports.separator = exports.saveDimTarget = exports.handleThousand = exports.handleQueryParams = exports.handlePercent = exports.handleLink = exports.handleDecimal = exports.getType = exports.getReportData = exports.getMaxWidth = exports.getDimTarget = exports.defaultSort = exports.dateStart = exports.computeWidth = void 0;
6
6
  var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
7
7
  var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
8
8
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
9
9
  var _rcProRequest = _interopRequireDefault(require("../../utils/rcProRequest"));
10
- 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."); }
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); }
12
- 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; }
13
10
  /** table config */
14
11
  var tableConfigDefault = {
15
12
  manual: true,
16
13
  toolBars: false,
14
+ resizable: true,
17
15
  hideDefRowSelection: true,
18
16
  columns: []
19
17
  };
@@ -31,11 +29,10 @@ exports.separator = separator;
31
29
  var timeUnit = 60 * 1000;
32
30
 
33
31
  /** 介于 前闭后开 */
34
- exports.timeUnit = timeUnit;
35
- var BETWEEN = '<=,<';
32
+ // export const BETWEEN = '<=,<';
36
33
 
37
34
  /** 默认排序 */
38
- exports.BETWEEN = BETWEEN;
35
+ exports.timeUnit = timeUnit;
39
36
  var defaultSort = 'asc';
40
37
 
41
38
  /** 数据类型 */
@@ -121,7 +118,7 @@ var handleDecimal = function handleDecimal(value, decimal) {
121
118
  if (decimal === void 0) {
122
119
  decimal = 2;
123
120
  }
124
- if (value === null || value === undefined) return;
121
+ if (value === null || value === undefined) return null;
125
122
  return Number(value).toFixed(decimal);
126
123
  };
127
124
 
@@ -136,7 +133,7 @@ var handlePercent = function handlePercent(value, decimal, unit) {
136
133
  if (unit === void 0) {
137
134
  unit = 100;
138
135
  }
139
- if (value === null || value === undefined) return;
136
+ if (value === null || value === undefined) return null;
140
137
  return (Number(value) * unit).toFixed(decimal) + "%";
141
138
  };
142
139
 
@@ -145,55 +142,46 @@ var handlePercent = function handlePercent(value, decimal, unit) {
145
142
  */
146
143
  exports.handlePercent = handlePercent;
147
144
  var handleLink = function handleLink(value, onLink) {
148
- if (value === null || value === undefined) return;
145
+ if (value === null || value === undefined) return null;
149
146
  return /*#__PURE__*/React.createElement("a", {
150
147
  href: "javascript:void(0);",
151
148
  onClick: onLink
152
149
  }, value);
153
150
  };
154
151
 
155
- /**
156
- * 条件格式设置
157
- * @param value 处理前的值
158
- * @param handledValue 被处理后的值 可能会是link标签
159
- */
160
- exports.handleLink = handleLink;
161
- var handleCondition = function handleCondition(value, handledValue, conditions) {
162
- if (value === null || value === undefined) return;
163
- var val = handledValue;
164
- for (var _iterator = _createForOfIteratorHelperLoose(conditions), _step; !(_step = _iterator()).done;) {
165
- var cur = _step.value;
166
- var condition = cur === null || cur === void 0 ? void 0 : cur.condition;
167
- if ((condition === null || condition === void 0 ? void 0 : condition.type) === BETWEEN) {
168
- var _condition$type;
169
- var _condition$type$split = condition === null || condition === void 0 ? void 0 : (_condition$type = condition.type) === null || _condition$type === void 0 ? void 0 : _condition$type.split(','),
170
- start = _condition$type$split[0],
171
- end = _condition$type$split[1];
172
- if (eval("" + (condition === null || condition === void 0 ? void 0 : condition.start) + start + value) && eval("" + value + end + (condition === null || condition === void 0 ? void 0 : condition.end))) {
173
- var style = {
174
- color: cur === null || cur === void 0 ? void 0 : cur.fontColor,
175
- background: cur === null || cur === void 0 ? void 0 : cur.backgroundColor
176
- };
177
- val = /*#__PURE__*/React.createElement("div", {
178
- style: style
179
- }, handledValue);
180
- }
181
- } else if (eval("" + value + (condition === null || condition === void 0 ? void 0 : condition.type) + (condition === null || condition === void 0 ? void 0 : condition.value))) {
182
- var _style = {
183
- color: cur === null || cur === void 0 ? void 0 : cur.fontColor,
184
- background: cur === null || cur === void 0 ? void 0 : cur.backgroundColor
185
- };
186
- val = /*#__PURE__*/React.createElement("div", {
187
- style: _style
188
- }, handledValue);
189
- }
190
- }
191
- return val;
192
- };
152
+ // /**
153
+ // * 条件格式设置
154
+ // * @param value 处理前的值
155
+ // * @param handledValue 被处理后的值 可能会是link标签
156
+ // */
157
+ // export const handleCondition = (value: valueType, handledValue: any, conditions: any[]) => {
158
+ // if (value === null || value === undefined) return;
159
+ // let val: any = handledValue;
160
+ // for (const cur of conditions) {
161
+ // const condition = cur?.condition;
162
+ // if (condition?.type === BETWEEN) {
163
+ // const [start, end] = condition?.type?.split(',');
164
+ // if (eval(`${condition?.start}${start}${value}`) && eval(`${value}${end}${condition?.end}`)) {
165
+ // const style = {
166
+ // color: cur?.fontColor,
167
+ // background: cur?.backgroundColor,
168
+ // };
169
+ // val = <div style={style}>{handledValue}</div>;
170
+ // }
171
+ // } else if (eval(`${value}${condition?.type}${condition?.value}`)) {
172
+ // const style = {
173
+ // color: cur?.fontColor,
174
+ // background: cur?.backgroundColor,
175
+ // };
176
+ // val = <div style={style}>{handledValue}</div>;
177
+ // }
178
+ // }
179
+ // return val;
180
+ // };
193
181
 
194
182
  // mock
195
- exports.handleCondition = handleCondition;
196
- var token = 'scm:tenant:token:2:104:7c454641-c65c-4459-b5a3-d4be9fb16ffd';
183
+ exports.handleLink = handleLink;
184
+ var token = 'scm:tenant:token:2:104:9e53d7bb-7dac-4e2e-a371-060007dc9f76';
197
185
 
198
186
  /** 获取维度指标 */
199
187
  var getDimTarget = /*#__PURE__*/function () {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ztocwst/rc-pro-materials",
3
- "version": "0.2.26",
3
+ "version": "0.2.28",
4
4
  "description": "@ztocwst/rc-pro-materials",
5
5
  "main": "lib/index.js",
6
6
  "module": "es/index.js",
@@ -22,6 +22,7 @@
22
22
  "f2elint-fix": "f2elint fix",
23
23
  "dumi": "cross-env APP_ROOT=docs dumi dev",
24
24
  "dumi:build": "cross-env APP_ROOT=docs dumi build",
25
+ "prepublishOnly": "npm run build && npm run lowcode:build",
25
26
  "ding": "node ./scripts/notify",
26
27
  "postpublish": "npm run ding"
27
28
  },
@@ -85,11 +86,11 @@
85
86
  },
86
87
  "componentConfig": {
87
88
  "isComponentLibrary": true,
88
- "materialSchema": "https://npm.ztocwst.com/@ztocwst/rc-pro-materials@0.2.26/build/lowcode/assets-prod.json"
89
+ "materialSchema": "https://npm.ztocwst.com/@ztocwst/rc-pro-materials@0.2.28/build/lowcode/assets-prod.json"
89
90
  },
90
- "homepage": "https://unpkg.com/@ztocwst/rc-pro-materials@0.2.26/build/index.html",
91
+ "homepage": "https://unpkg.com/@ztocwst/rc-pro-materials@0.2.28/build/index.html",
91
92
  "publishConfig": {
92
93
  "registry": "https://registry.npmjs.org/",
93
94
  "access": "public"
94
95
  }
95
- }
96
+ }