ztxkui 3.1.7 → 3.1.8

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.
@@ -78,8 +78,8 @@ var EditableTable = function () {
78
78
  useEffect(function () {
79
79
  setTimeout(function () {
80
80
  setTableConfig({
81
- test1: { isChangeable: 1, isDisplay: 1, isRequired: 0 },
82
- test2: { isChangeable: 1, isDisplay: 1, isRequired: 0 },
81
+ test1: { isChangeable: 1, isDisplay: 1, isRequired: 1 },
82
+ test2: { isChangeable: 1, isDisplay: 1, isRequired: 1 },
83
83
  });
84
84
  }, 5000);
85
85
  }, []);
@@ -135,12 +135,22 @@ function useColumns(props) {
135
135
  var res = _column.required();
136
136
  var _res = typeof res === 'boolean' ? res : res === 1 || res === '1';
137
137
  if (_res) {
138
+ if (_column.validate) {
139
+ _column.validate.title = _column.validate.title
140
+ ? _column.validate.title
141
+ : _column.title;
142
+ }
138
143
  _column.title = (React.createElement(React.Fragment, null,
139
144
  React.createElement("i", { className: "zt-column--required" }, "*"),
140
145
  _column.title));
141
146
  }
142
147
  }
143
148
  else if (_column.required) {
149
+ if (_column.validate) {
150
+ _column.validate.title = _column.validate.title
151
+ ? _column.validate.title
152
+ : _column.title;
153
+ }
144
154
  _column.title = (React.createElement(React.Fragment, null,
145
155
  React.createElement("i", { className: "zt-column--required" }, "*"),
146
156
  _column.title));
@@ -111,7 +111,7 @@ export function tableValidate(dataSource, mergeColumns, restParams) {
111
111
  return [4 /*yield*/, Promise.reject({
112
112
  errorFields: [
113
113
  {
114
- errors: (tableName || '') + " \u7B2C" + (i + 1) + "\u884C" + title + " " + (((_j = validate) === null || _j === void 0 ? void 0 : _j.message) || '填写错误!'),
114
+ errors: (tableName || '') + " \u7B2C" + (i + 1) + "\u884C " + title + " " + (((_j = validate) === null || _j === void 0 ? void 0 : _j.message) || '填写错误!'),
115
115
  },
116
116
  ],
117
117
  })];
@@ -129,7 +129,7 @@ export function tableValidate(dataSource, mergeColumns, restParams) {
129
129
  return [4 /*yield*/, Promise.reject({
130
130
  errorFields: [
131
131
  {
132
- errors: (tableName || '') + " \u7B2C" + (i + 1) + "\u884C" + title + "\u4E3A\u7A7A!",
132
+ errors: (tableName || '') + " \u7B2C" + (i + 1) + "\u884C " + title + " \u4E3A\u7A7A!",
133
133
  rowIndex: i,
134
134
  colIndex: index,
135
135
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ztxkui",
3
- "version": "3.1.7",
3
+ "version": "3.1.8",
4
4
  "private": false,
5
5
  "description": "React components library",
6
6
  "author": "zt-front-end",