@ztocwst/rc-pro-materials 0.2.14 → 0.2.16

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 (32) 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.css +1 -1
  8. package/build/lowcode/render/default/view.js +13 -8
  9. package/build/lowcode/view.css +1 -1
  10. package/build/lowcode/view.js +14 -9
  11. package/dist/SCM_Comps.css +2 -2
  12. package/dist/SCM_Comps.js +14 -9
  13. package/dist/SCM_Comps.js.map +1 -1
  14. package/es/components/z-templates-data-common/components/dim-target/index.js +1 -1
  15. package/es/components/z-templates-data-common/components/link-renderer/index.d.ts +1 -1
  16. package/es/components/z-templates-data-common/components/link-renderer/index.js +59 -38
  17. package/es/components/z-templates-data-common/components/table-renderer/table-renderer.helper.d.ts +2 -1
  18. package/es/components/z-templates-data-common/components/table-renderer/table-renderer.helper.js +26 -24
  19. package/es/components/z-templates-data-common/data-common.d.ts +4 -0
  20. package/es/components/z-templates-data-common/data-common.helper.js +3 -3
  21. package/es/style.js +2 -2
  22. package/es/utils/props/form.d.ts +1 -1
  23. package/lib/components/z-templates-data-common/components/dim-target/index.js +1 -1
  24. package/lib/components/z-templates-data-common/components/link-renderer/index.d.ts +1 -1
  25. package/lib/components/z-templates-data-common/components/link-renderer/index.js +59 -38
  26. package/lib/components/z-templates-data-common/components/table-renderer/table-renderer.helper.d.ts +2 -1
  27. package/lib/components/z-templates-data-common/components/table-renderer/table-renderer.helper.js +26 -24
  28. package/lib/components/z-templates-data-common/data-common.d.ts +4 -0
  29. package/lib/components/z-templates-data-common/data-common.helper.js +3 -3
  30. package/lib/style.js +1 -1
  31. package/lib/utils/props/form.d.ts +1 -1
  32. package/package.json +4 -4
@@ -46,7 +46,7 @@ export declare const getDimTargetData: (rcProContext: any, params: Record<string
46
46
  /**
47
47
  * 数据渲染格式处理
48
48
  */
49
- export declare const handleValueFormat: (value: valueType, record: Record<string, any>, find?: Record<string, any>, condition?: any[], onLink?: () => void) => any;
49
+ export declare const handleValueFormat: (value: valueType, record: Record<string, any>, config?: Record<string, any>, condition?: any[], onLink?: () => void) => any;
50
50
  /**
51
51
  * 条件格式
52
52
  */
@@ -60,5 +60,6 @@ export declare const handleColumns: (option: DimTargetChangeOptionType, expressi
60
60
  ellipsis: boolean;
61
61
  sorter: any;
62
62
  width: any;
63
+ fixed: any;
63
64
  render: (value: valueType, record: Record<string, any>) => any;
64
65
  }[];
@@ -149,21 +149,21 @@ var getDimTargetData = /*#__PURE__*/function () {
149
149
  * 数据渲染格式处理
150
150
  */
151
151
  exports.getDimTargetData = getDimTargetData;
152
- var handleValueFormat = function handleValueFormat(value, record, find, condition, onLink) {
152
+ var handleValueFormat = function handleValueFormat(value, record, config, condition, onLink) {
153
153
  var _val;
154
154
  var val = value;
155
155
  if (typeof value === 'number') {
156
- if (!(find !== null && find !== void 0 && find.percent) && typeof (find === null || find === void 0 ? void 0 : find.precision) === 'number') {
157
- val = (0, _dataCommon.handleDecimal)(val, find.precision);
156
+ if (!(config !== null && config !== void 0 && config.percent) && typeof (config === null || config === void 0 ? void 0 : config.precision) === 'number') {
157
+ val = (0, _dataCommon.handleDecimal)(val, config.precision);
158
158
  }
159
- if (find !== null && find !== void 0 && find.thousand) {
159
+ if (config !== null && config !== void 0 && config.thousand) {
160
160
  val = (0, _dataCommon.handleThousand)(val);
161
161
  }
162
- if (find !== null && find !== void 0 && find.percent) {
163
- val = (0, _dataCommon.handlePercent)(val, find.precision);
162
+ if (config !== null && config !== void 0 && config.percent) {
163
+ val = (0, _dataCommon.handlePercent)(val, config.precision);
164
164
  }
165
165
  }
166
- if (find !== null && find !== void 0 && find.link) {
166
+ if (config !== null && config !== void 0 && config.link) {
167
167
  val = (0, _dataCommon.handleLink)(value, onLink);
168
168
  }
169
169
  if (condition !== null && condition !== void 0 && condition.length) {
@@ -182,47 +182,49 @@ exports.handleValueFormat = handleValueFormat;
182
182
  var handleColumns = function handleColumns(option, expressions, linkPage, onLink) {
183
183
  var dimTarget = [].concat(option.dimension, option.index);
184
184
  return dimTarget.map(function (title) {
185
- var _find3, _find3$link, _find4, _find5, _find6, _title$toString;
186
- var find;
185
+ var _config3, _config3$link, _config4, _config5, _config6, _title$toString, _config7, _config8, _config9;
186
+ var config;
187
187
  var dataIndex;
188
188
  var condition;
189
- if (!find) {
190
- var _option$dimensionSour, _find;
189
+ if (!config) {
190
+ var _option$dimensionSour, _config;
191
191
  /* 通过别名或名称 查找当前维度的配置 */
192
- find = (_option$dimensionSour = option.dimensionSource) === null || _option$dimensionSour === void 0 ? void 0 : _option$dimensionSour.find(function (item) {
192
+ config = (_option$dimensionSour = option.dimensionSource) === null || _option$dimensionSour === void 0 ? void 0 : _option$dimensionSour.find(function (item) {
193
193
  return item.alias === title || item.description === title;
194
194
  });
195
- dataIndex = (_find = find) === null || _find === void 0 ? void 0 : _find.description;
195
+ dataIndex = (_config = config) === null || _config === void 0 ? void 0 : _config.description;
196
196
  }
197
- if (!find) {
198
- var _option$indexSource, _find2;
197
+ if (!config) {
198
+ var _option$indexSource, _config2;
199
199
  /* 通过别名或名称 查找当前指标的配置 */
200
- find = (_option$indexSource = option.indexSource) === null || _option$indexSource === void 0 ? void 0 : _option$indexSource.find(function (item) {
200
+ config = (_option$indexSource = option.indexSource) === null || _option$indexSource === void 0 ? void 0 : _option$indexSource.find(function (item) {
201
201
  return item.alias === title || item.name === title;
202
202
  });
203
- dataIndex = (_find2 = find) === null || _find2 === void 0 ? void 0 : _find2.name;
203
+ dataIndex = (_config2 = config) === null || _config2 === void 0 ? void 0 : _config2.name;
204
204
  }
205
205
  /* 条件格式设置 */
206
206
  // if (expressions?.length) {
207
- // condition = expressions?.filter((item) => item?.index?.includes(find?.name));
207
+ // condition = expressions?.filter((item) => item?.index?.includes(config?.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)) || [],
210
+ var _ref4 = ((_config3 = config) === null || _config3 === void 0 ? void 0 : (_config3$link = _config3.link) === null || _config3$link === void 0 ? void 0 : _config3$link.split(_dataCommon.separator)) || [],
211
211
  dataSetName = _ref4[0];
212
212
  var index;
213
- if ((_find4 = find) !== null && _find4 !== void 0 && _find4.link && linkPage !== null && linkPage !== void 0 && linkPage.length) {
213
+ if ((_config4 = config) !== null && _config4 !== void 0 && _config4.link && linkPage !== null && linkPage !== void 0 && linkPage.length) {
214
214
  index = linkPage.findIndex(function (link) {
215
- return "" + link.dataSetName + _dataCommon.separator + link.title === find.link;
215
+ return "" + link.dataSetName + _dataCommon.separator + link.title === config.link;
216
216
  });
217
217
  }
218
218
  return {
219
219
  title: title,
220
220
  dataIndex: dataIndex,
221
221
  ellipsis: true,
222
- sorter: (_find5 = find) === null || _find5 === void 0 ? void 0 : _find5.sorted,
223
- width: ((_find6 = find) === null || _find6 === void 0 ? void 0 : _find6.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),
222
+ sorter: (_config5 = config) === null || _config5 === void 0 ? void 0 : _config5.sorted,
223
+ width: ((_config6 = config) === null || _config6 === void 0 ? void 0 : _config6.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),
224
+ fixed: (_config7 = config) !== null && _config7 !== void 0 && _config7.isFixed ? ((_config8 = config) === null || _config8 === void 0 ? void 0 : _config8.fixed) || ((_config9 = config) === null || _config9 === void 0 ? void 0 : _config9.isFixed) : false,
224
225
  render: function render(value, record) {
225
- return handleValueFormat(value, record, find, condition, function () {
226
+ var _config$render, _config10;
227
+ return config.custom ? (_config$render = (_config10 = config).render) === null || _config$render === void 0 ? void 0 : _config$render.call(_config10, value, record, config, condition) : handleValueFormat(value, record, config, condition, function () {
226
228
  return onLink({
227
229
  dataSetName: dataSetName,
228
230
  index: index,
@@ -37,6 +37,10 @@ export interface TypeTargetProps {
37
37
  export interface TypeChartSettingProps {
38
38
  /** 二级页标题 */
39
39
  chartTitle?: string;
40
+ /** 自定义渲染 */
41
+ custom?: boolean;
42
+ /** 自定义渲染方法 */
43
+ child?: (p: any) => React.ReactNode;
40
44
  /** 标题 */
41
45
  title?: string;
42
46
  /** 维度配置 */
@@ -172,7 +172,7 @@ var handleCondition = function handleCondition(value, handledValue, conditions)
172
172
 
173
173
  // mock
174
174
  exports.handleCondition = handleCondition;
175
- var token = 'scm:tenant:token:2:104:177217352666D386AA01E5AF6293727D';
175
+ var token = 'scm:tenant:token:2:104:DB0D80CD71B76AF4A8858729478BA945';
176
176
 
177
177
  /** 获取维度指标 */
178
178
  var getDimTarget = /*#__PURE__*/function () {
@@ -183,7 +183,7 @@ var getDimTarget = /*#__PURE__*/function () {
183
183
  while (1) switch (_context.prev = _context.next) {
184
184
  case 0:
185
185
  _ref2 = rcProContext || {}, materialsRequest = _ref2.materialsRequest, env = _ref2.env, data_env_mapping = _ref2.data_env_mapping;
186
- __env = (_data_env_mapping$env = data_env_mapping === null || data_env_mapping === void 0 ? void 0 : data_env_mapping[env]) !== null && _data_env_mapping$env !== void 0 ? _data_env_mapping$env : data_env_mapping === null || data_env_mapping === void 0 ? void 0 : data_env_mapping['__other']; // 供应链里由子应用透传
186
+ __env = (_data_env_mapping$env = data_env_mapping === null || data_env_mapping === void 0 ? void 0 : data_env_mapping[env]) !== null && _data_env_mapping$env !== void 0 ? _data_env_mapping$env : data_env_mapping === null || data_env_mapping === void 0 ? void 0 : data_env_mapping.__other; // 供应链里由子应用透传
187
187
  if (!materialsRequest) {
188
188
  _context.next = 7;
189
189
  break;
@@ -246,7 +246,7 @@ var getReportData = /*#__PURE__*/function () {
246
246
  while (1) switch (_context2.prev = _context2.next) {
247
247
  case 0:
248
248
  _ref4 = rcProContext || {}, materialsRequest = _ref4.materialsRequest, env = _ref4.env, data_env_mapping = _ref4.data_env_mapping;
249
- __env = (_data_env_mapping$env2 = data_env_mapping === null || data_env_mapping === void 0 ? void 0 : data_env_mapping[env]) !== null && _data_env_mapping$env2 !== void 0 ? _data_env_mapping$env2 : data_env_mapping === null || data_env_mapping === void 0 ? void 0 : data_env_mapping['__other']; // 供应链里由子应用透传
249
+ __env = (_data_env_mapping$env2 = data_env_mapping === null || data_env_mapping === void 0 ? void 0 : data_env_mapping[env]) !== null && _data_env_mapping$env2 !== void 0 ? _data_env_mapping$env2 : data_env_mapping === null || data_env_mapping === void 0 ? void 0 : data_env_mapping.__other; // 供应链里由子应用透传
250
250
  if (!materialsRequest) {
251
251
  _context2.next = 7;
252
252
  break;
package/lib/style.js CHANGED
@@ -9,7 +9,7 @@ require('antd/lib/col/style');
9
9
  require('antd/lib/message/style');
10
10
  require('antd/lib/tabs/style');
11
11
  require('antd/lib/checkbox/style');
12
- require('antd/lib/radio/style');
13
12
  require('antd/lib/spin/style');
13
+ require('antd/lib/radio/style');
14
14
  require('antd/lib/carousel/style');
15
15
  require('./index.scss');
@@ -2,7 +2,7 @@
2
2
  * 处理表单默认值
3
3
  */
4
4
  import { ProFormRenderProps } from '@ztocwst/rc-pro';
5
- export declare const processFormProps: (props: Omit<import("@ant-design/pro-form/lib/components/SchemaForm").FormSchema<any, "custom" | "text" | "autoComplete" | "cardList" | "upload" | "linkage" | "asyncSelect" | "inputTextArea" | "modalSelect" | "treeSelectArea" | "inputGroup">, "columns"> & {
5
+ export declare const processFormProps: (props: Omit<import("@ant-design/pro-form/lib/components/SchemaForm").FormSchema<any, "trim" | "custom" | "text" | "autoComplete" | "cardList" | "upload" | "linkage" | "asyncSelect" | "inputTextArea" | "modalSelect" | "treeSelectArea" | "inputGroup" | "scanInput" | "timeRangePicker">, "columns"> & {
6
6
  onCollapse?: (collapsed: boolean) => void;
7
7
  defaultColsNumber?: number;
8
8
  span?: number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ztocwst/rc-pro-materials",
3
- "version": "0.2.14",
3
+ "version": "0.2.16",
4
4
  "description": "@ztocwst/rc-pro-materials",
5
5
  "main": "lib/index.js",
6
6
  "module": "es/index.js",
@@ -71,7 +71,7 @@
71
71
  "@alifd/next": "^1.25.27",
72
72
  "@alilc/build-plugin-alt": "^1.3.3",
73
73
  "@types/antd": "^1.0.0",
74
- "@ztocwst/rc-pro": "0.4.45",
74
+ "@ztocwst/rc-pro": "^0.4.64",
75
75
  "antd": "4.22.3",
76
76
  "moment": "latest",
77
77
  "prop-types": "^15.5.8",
@@ -86,9 +86,9 @@
86
86
  },
87
87
  "componentConfig": {
88
88
  "isComponentLibrary": true,
89
- "materialSchema": "https://npm.ztocwst.com/@ztocwst/rc-pro-materials@0.2.14/build/lowcode/assets-prod.json"
89
+ "materialSchema": "https://npm.ztocwst.com/@ztocwst/rc-pro-materials@0.2.16/build/lowcode/assets-prod.json"
90
90
  },
91
- "homepage": "https://unpkg.com/@ztocwst/rc-pro-materials@0.2.14/build/index.html",
91
+ "homepage": "https://unpkg.com/@ztocwst/rc-pro-materials@0.2.16/build/index.html",
92
92
  "publishConfig": {
93
93
  "registry": "https://registry.npmjs.org/",
94
94
  "access": "public"