@para-ui/core 3.0.75 → 3.0.77

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.
package/Form/index.d.ts CHANGED
@@ -1,8 +1,8 @@
1
- import { HelperTextProps } from '../HelperText';
2
- import { LabelProps } from '../Label';
3
- import React, { FC, FormHTMLAttributes, ReactElement } from 'react';
4
- import { FormItemProps } from '../FormItem';
5
- import { ItemTypeProps } from '../FormItem/itemType';
1
+ import { HelperTextProps } from "../HelperText";
2
+ import { LabelProps } from "../Label";
3
+ import React, { FC, FormHTMLAttributes, ReactElement } from "react";
4
+ import { FormItemProps } from "../FormItem";
5
+ import { ItemTypeProps } from "../FormItem/itemType";
6
6
  /**
7
7
  * form 表单原始属性
8
8
  */
@@ -51,7 +51,7 @@ export interface FormProps {
51
51
  /**
52
52
  * 强制刷新表单状态方法
53
53
  */
54
- refreshForm?: (list: Array<FormItemProps> | '', bData?: {
54
+ refreshForm?: (list: Array<FormItemProps> | "", bData?: {
55
55
  [name: string]: any;
56
56
  }) => void;
57
57
  /**
@@ -59,17 +59,17 @@ export interface FormProps {
59
59
  */
60
60
  refData?: RefDataProps;
61
61
  /**
62
- * 获取生效项目的值对象,会过滤掉不显示或是不启用的项目的值,
63
- */
62
+ * 获取生效项目的值对象,会过滤掉不显示或是不启用的项目的值,
63
+ */
64
64
  getValidValues?: Function;
65
65
  /**
66
- * 重置表单
67
- */
66
+ * 重置表单
67
+ */
68
68
  reset?: Function;
69
69
  /**
70
- * 清空表单数据
71
- * 允许清空单个
72
- */
70
+ * 清空表单数据
71
+ * 允许清空单个
72
+ */
73
73
  clear?: (name?: string | string[]) => void;
74
74
  }>;
75
75
  /**
@@ -79,7 +79,7 @@ export interface FormProps {
79
79
  /**
80
80
  * 表单的主要类型 vertical 为竖布局,horizontal为横布局,默认为 horizontal.会被 configList的配置覆盖
81
81
  */
82
- type?: 'vertical' | 'horizontal';
82
+ type?: "vertical" | "horizontal";
83
83
  /**
84
84
  * 获取表单的校验方法,会传出表单的校验方法
85
85
  */
@@ -128,12 +128,12 @@ export interface FormProps {
128
128
  */
129
129
  className?: string;
130
130
  /**
131
- * 标题其他配置
132
- */
131
+ * 标题其他配置
132
+ */
133
133
  labelProps?: LabelProps;
134
134
  /**
135
- * 报错提示其他配置
136
- */
135
+ * 报错提示其他配置
136
+ */
137
137
  helperTextProps?: HelperTextProps;
138
138
  /**
139
139
  * 文字宽度, 只对 type === vertical,状态下生效
package/Form/index.js CHANGED
@@ -93,7 +93,7 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
93
93
  */
94
94
  var Form = function Form(props) {
95
95
  var _props$className = props.className,
96
- className = _props$className === void 0 ? '' : _props$className,
96
+ className = _props$className === void 0 ? "" : _props$className,
97
97
  FormProps = props.FormProps,
98
98
  requiredElement = props.requiredElement,
99
99
  disRequiredElement = props.disRequiredElement,
@@ -157,19 +157,19 @@ var Form = function Form(props) {
157
157
  var setValue = function setValue(name, type, value) {
158
158
  switch (type) {
159
159
  // 设置校验状态,自定义类型的表格设置,如果有一个是false,最终校验都不会通过
160
- case 'status':
160
+ case "status":
161
161
  refData.current.itemsCheckStatus[name] = value;
162
162
  break;
163
163
  // 存储报错信息,防止表单刷新后,报错信息和状态丢失
164
- case 'message':
164
+ case "message":
165
165
  refData.current.itemsCheckMessage[name] = value;
166
166
  break;
167
167
  // 存储加工之后的item 对象
168
- case 'item':
168
+ case "item":
169
169
  refData.current.allItems[name] = value;
170
170
  break;
171
171
  // 初始化赋值
172
- case 'initValue':
172
+ case "initValue":
173
173
  refData.current.allValues[name] = value;
174
174
  break;
175
175
  // 赋值,会触发表单的onChange事件
@@ -204,7 +204,7 @@ var Form = function Form(props) {
204
204
  var msg = validate(tItem, refData.current.allValues[key]);
205
205
  if (msg) {
206
206
  errorCount++;
207
- if (typeof msg === 'string') refData.current.itemsCheckMessage[key] = msg;
207
+ if (typeof msg === "string") refData.current.itemsCheckMessage[key] = msg;
208
208
  tItem.setErrorMsg && tItem.setErrorMsg(msg);
209
209
  }
210
210
  }
@@ -216,8 +216,8 @@ var Form = function Form(props) {
216
216
  return !errorCount && refData.current.allValues;
217
217
  };
218
218
  /**
219
- * 过滤有效值
220
- */
219
+ * 过滤有效值
220
+ */
221
221
  var getValidValues = function getValidValues() {
222
222
  var tObj = {};
223
223
  for (var i = 0; i < refData.current.configList.length; i++) {
@@ -229,8 +229,8 @@ var Form = function Form(props) {
229
229
  return tObj;
230
230
  };
231
231
  /**
232
- * 重置表单
233
- */
232
+ * 重置表单
233
+ */
234
234
  var resetForm = function resetForm() {
235
235
  var isClear = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
236
236
  var name = arguments.length > 1 ? arguments[1] : undefined;
@@ -246,15 +246,15 @@ var Form = function Form(props) {
246
246
  refData.current.allValues[key] = frstBackData.current[key];
247
247
  }
248
248
  } else {
249
- if (typeof name === 'string') {
250
- setValue(name, 'status', undefined);
251
- setValue(name, 'message', '');
252
- setValue(name, 'initValue', undefined);
249
+ if (typeof name === "string") {
250
+ setValue(name, "status", undefined);
251
+ setValue(name, "message", "");
252
+ setValue(name, "initValue", undefined);
253
253
  } else {
254
254
  name.forEach(function (key) {
255
- setValue(key, 'status', undefined);
256
- setValue(key, 'message', '');
257
- setValue(key, 'initValue', undefined);
255
+ setValue(key, "status", undefined);
256
+ setValue(key, "message", "");
257
+ setValue(key, "initValue", undefined);
258
258
  });
259
259
  }
260
260
  }
@@ -325,7 +325,13 @@ var Form = function Form(props) {
325
325
  };
326
326
  }
327
327
  }, [form]);
328
- return jsx("form", Object.assign({}, FormProps, {
328
+ var handleSubmit = function handleSubmit(event) {
329
+ event.preventDefault(); // 阻止默认的提交行为
330
+ };
331
+
332
+ return jsx("form", Object.assign({
333
+ onSubmit: handleSubmit
334
+ }, FormProps, {
329
335
  className: "".concat($prefixCls, "-form")
330
336
  }, {
331
337
  children: jsx("div", Object.assign({
@@ -333,7 +339,7 @@ var Form = function Form(props) {
333
339
  }, {
334
340
  children: itemsConfig && itemsConfig.length > 0 && itemsConfig.map(function (item, idx) {
335
341
  // 不显示则提前保存最后值
336
- item.hide && setValue(item.name, 'item', item);
342
+ item.hide && setValue(item.name, "item", item);
337
343
  return !item.hide && jsx(FormItem, Object.assign({
338
344
  type: type,
339
345
  disabled: disabled,
package/README.md CHANGED
@@ -1,3 +1,15 @@
1
+ ## 版本: 3.0.77
2
+
3
+ para-ui/core@3.0.77 发布
4
+ 【文档】更新表格,多值框,单值框文档
5
+ 【国际化】国际化文档更新
6
+ 【para-ui/icons】添加 @para-ui/icons 依赖到 peerDependencies
7
+
8
+ ## 版本: 3.0.76
9
+
10
+ para-ui/core@3.0.76 发布
11
+ 【表单-form】修复form下只有一个input元素时回车会触发页面reload的问题
12
+
1
13
  ## 版本: 3.0.75
2
14
 
3
15
  para-ui/core@3.0.75 发布
@@ -34,9 +46,9 @@
34
46
  para-ui/core@3.0.70 发布
35
47
  【组织树-tree】增加autoTips参数tipMaxWidth(提示最大高度)暴露
36
48
  【标签页-Tabs】修复IE11中Tabs出现滚动条问题、模块显示文字重叠,未展示省略收起功能
37
- 【抽屉-Drawer】修复IE11中抽屉抖动问题、修复弹窗挂载异常问题
49
+ 【抽屉-Drawer】修复IE11中抽屉抖动问题、修复弹窗挂载异常问题
38
50
  【对话框-Modal】对话框图标和标题居中对齐
39
-
51
+
40
52
 
41
53
  ## 版本: 3.0.69
42
54
 
package/index.d.ts CHANGED
@@ -142,3 +142,5 @@ export { default as Tree } from './Tree';
142
142
  export * from './Tree';
143
143
  export { default as Upload } from './Upload';
144
144
  export * from './Upload';
145
+ export { default as locale } from './locale';
146
+ export * from './locale';
package/index.js CHANGED
@@ -71,6 +71,7 @@ export { Tooltip } from './Tooltip/index.js';
71
71
  export { SSortablejs, Transfer } from './Transfer/index.js';
72
72
  export { T as Tree } from './_verture/index-22571b89.js';
73
73
  export { default as Upload } from './Upload/index.js';
74
+ export { default as locale } from './locale/index.js';
74
75
  import './_verture/slicedToArray-76060636.js';
75
76
  import './_verture/unsupportedIterableToArray-cb478f24.js';
76
77
  import 'react/jsx-runtime';
@@ -0,0 +1,153 @@
1
+ declare const _default: {
2
+ Breadcrumbs: {
3
+ back: string;
4
+ };
5
+ Button: {
6
+ moreActions: string;
7
+ };
8
+ Cascader: {
9
+ placeholder: string;
10
+ };
11
+ ComboSelect: {
12
+ searchPlaceholder: string;
13
+ cancel: string;
14
+ ok: string;
15
+ fullPath: string;
16
+ pleaseSelect: string;
17
+ selected: string;
18
+ };
19
+ DatePicker: {
20
+ lang: {
21
+ placeholder: string;
22
+ yearPlaceholder: string;
23
+ quarterPlaceholder: string;
24
+ monthPlaceholder: string;
25
+ weekPlaceholder: string;
26
+ rangePlaceholder: string;
27
+ rangeYearPlaceholder: string;
28
+ rangeMonthPlaceholder: string;
29
+ rangeWeekPlaceholder: string;
30
+ today: string;
31
+ now: string;
32
+ ok: string;
33
+ };
34
+ timePickerLocale: {};
35
+ placeholder: string;
36
+ yearPlaceholder: string;
37
+ quarterPlaceholder: string;
38
+ monthPlaceholder: string;
39
+ weekPlaceholder: string;
40
+ rangePlaceholder: string;
41
+ rangeYearPlaceholder: string;
42
+ rangeMonthPlaceholder: string;
43
+ rangeWeekPlaceholder: string;
44
+ today: string;
45
+ now: string;
46
+ ok: string;
47
+ };
48
+ DragVerify: {
49
+ tryAgain: string;
50
+ swipe: string;
51
+ };
52
+ Drawer: {
53
+ cancel: string;
54
+ ok: string;
55
+ };
56
+ DynamicMultiBox: {
57
+ add: string;
58
+ titleForm: string;
59
+ default: string;
60
+ noData: string;
61
+ };
62
+ Empty: {
63
+ noData: string;
64
+ click: string;
65
+ refresh: string;
66
+ };
67
+ Modal: {
68
+ cancel: string;
69
+ ok: string;
70
+ };
71
+ MultiBox: {
72
+ add: string;
73
+ };
74
+ OperateBtn: {
75
+ more: string;
76
+ };
77
+ Pagination: {
78
+ total: string;
79
+ linePerPage: string;
80
+ currentPage: string;
81
+ jumpTo: string;
82
+ page: string;
83
+ };
84
+ PopConfirm: {
85
+ cancel: string;
86
+ ok: string;
87
+ };
88
+ Querying: {
89
+ querying: string;
90
+ };
91
+ Select: {
92
+ searchPlaceholder: string;
93
+ selected: string;
94
+ };
95
+ Selector: {
96
+ root: string;
97
+ selectAll: string;
98
+ seeMore: string;
99
+ selected: string;
100
+ pleaseEnter: string;
101
+ searchResult: string;
102
+ detail: string;
103
+ child: string;
104
+ };
105
+ SelectorPicker: {
106
+ selected: string;
107
+ select: string;
108
+ };
109
+ SingleBox: {
110
+ add: string;
111
+ };
112
+ Table: {
113
+ empty: string;
114
+ determine: string;
115
+ restoreDefault: string;
116
+ serial: string;
117
+ loadMore: string;
118
+ refresh: string;
119
+ selectNum: string;
120
+ selectAll: string;
121
+ };
122
+ Tabs: {
123
+ confirmDelete: string;
124
+ };
125
+ Transfer: {
126
+ left: string;
127
+ right: string;
128
+ allCheck: string;
129
+ inVertCheck: string;
130
+ searchPlaceholder: string;
131
+ leftBtnTips: string;
132
+ rightBtnTips: string;
133
+ };
134
+ Tree: {
135
+ loadMore: string;
136
+ add: string;
137
+ edit: string;
138
+ disabled: string;
139
+ delete: string;
140
+ };
141
+ Upload: {
142
+ uploadError: string;
143
+ uploading: string;
144
+ clickUploadFile: string;
145
+ dragFileUpload: string;
146
+ add: string;
147
+ edit: string;
148
+ disabled: string;
149
+ delete: string;
150
+ editImage: string;
151
+ };
152
+ };
153
+ export default _default;
@@ -0,0 +1,307 @@
1
+ declare const _default: {
2
+ enUS: {
3
+ Breadcrumbs: {
4
+ back: string;
5
+ };
6
+ Button: {
7
+ moreActions: string;
8
+ };
9
+ Cascader: {
10
+ placeholder: string;
11
+ };
12
+ ComboSelect: {
13
+ searchPlaceholder: string;
14
+ cancel: string;
15
+ ok: string;
16
+ fullPath: string;
17
+ pleaseSelect: string;
18
+ selected: string;
19
+ };
20
+ DatePicker: {
21
+ lang: {
22
+ placeholder: string;
23
+ yearPlaceholder: string;
24
+ quarterPlaceholder: string;
25
+ monthPlaceholder: string;
26
+ weekPlaceholder: string;
27
+ rangePlaceholder: string;
28
+ rangeYearPlaceholder: string;
29
+ rangeMonthPlaceholder: string;
30
+ rangeWeekPlaceholder: string;
31
+ today: string;
32
+ now: string;
33
+ ok: string;
34
+ };
35
+ timePickerLocale: {};
36
+ placeholder: string;
37
+ yearPlaceholder: string;
38
+ quarterPlaceholder: string;
39
+ monthPlaceholder: string;
40
+ weekPlaceholder: string;
41
+ rangePlaceholder: string;
42
+ rangeYearPlaceholder: string;
43
+ rangeMonthPlaceholder: string;
44
+ rangeWeekPlaceholder: string;
45
+ today: string;
46
+ now: string;
47
+ ok: string;
48
+ };
49
+ DragVerify: {
50
+ tryAgain: string;
51
+ swipe: string;
52
+ };
53
+ Drawer: {
54
+ cancel: string;
55
+ ok: string;
56
+ };
57
+ DynamicMultiBox: {
58
+ add: string;
59
+ titleForm: string;
60
+ default: string;
61
+ noData: string;
62
+ };
63
+ Empty: {
64
+ noData: string;
65
+ click: string;
66
+ refresh: string;
67
+ };
68
+ Modal: {
69
+ cancel: string;
70
+ ok: string;
71
+ };
72
+ MultiBox: {
73
+ add: string;
74
+ };
75
+ OperateBtn: {
76
+ more: string;
77
+ };
78
+ Pagination: {
79
+ total: string;
80
+ linePerPage: string;
81
+ currentPage: string;
82
+ jumpTo: string;
83
+ page: string;
84
+ };
85
+ PopConfirm: {
86
+ cancel: string;
87
+ ok: string;
88
+ };
89
+ Querying: {
90
+ querying: string;
91
+ };
92
+ Select: {
93
+ searchPlaceholder: string;
94
+ selected: string;
95
+ };
96
+ Selector: {
97
+ root: string;
98
+ selectAll: string;
99
+ seeMore: string;
100
+ selected: string;
101
+ pleaseEnter: string;
102
+ searchResult: string;
103
+ detail: string;
104
+ child: string;
105
+ };
106
+ SelectorPicker: {
107
+ selected: string;
108
+ select: string;
109
+ };
110
+ SingleBox: {
111
+ add: string;
112
+ };
113
+ Table: {
114
+ empty: string;
115
+ determine: string;
116
+ restoreDefault: string;
117
+ serial: string;
118
+ loadMore: string;
119
+ refresh: string;
120
+ selectNum: string;
121
+ selectAll: string;
122
+ };
123
+ Tabs: {
124
+ confirmDelete: string;
125
+ };
126
+ Transfer: {
127
+ left: string;
128
+ right: string;
129
+ allCheck: string;
130
+ inVertCheck: string;
131
+ searchPlaceholder: string;
132
+ leftBtnTips: string;
133
+ rightBtnTips: string;
134
+ };
135
+ Tree: {
136
+ loadMore: string;
137
+ add: string;
138
+ edit: string;
139
+ disabled: string;
140
+ delete: string;
141
+ };
142
+ Upload: {
143
+ uploadError: string;
144
+ uploading: string;
145
+ clickUploadFile: string;
146
+ dragFileUpload: string;
147
+ add: string;
148
+ edit: string;
149
+ disabled: string;
150
+ delete: string;
151
+ editImage: string;
152
+ };
153
+ };
154
+ zhCN: {
155
+ Breadcrumbs: {
156
+ back: string;
157
+ };
158
+ Button: {
159
+ moreActions: string;
160
+ };
161
+ Cascader: {
162
+ placeholder: string;
163
+ };
164
+ ComboSelect: {
165
+ searchPlaceholder: string;
166
+ cancel: string;
167
+ ok: string;
168
+ fullPath: string;
169
+ pleaseSelect: string;
170
+ selected: string;
171
+ };
172
+ DatePicker: {
173
+ lang: {
174
+ placeholder: string;
175
+ yearPlaceholder: string;
176
+ quarterPlaceholder: string;
177
+ monthPlaceholder: string;
178
+ weekPlaceholder: string;
179
+ rangePlaceholder: string;
180
+ rangeYearPlaceholder: string;
181
+ rangeMonthPlaceholder: string;
182
+ rangeWeekPlaceholder: string;
183
+ today: string;
184
+ now: string;
185
+ ok: string;
186
+ };
187
+ timePickerLocale: {};
188
+ placeholder: string;
189
+ yearPlaceholder: string;
190
+ quarterPlaceholder: string;
191
+ monthPlaceholder: string;
192
+ weekPlaceholder: string;
193
+ rangePlaceholder: string;
194
+ rangeYearPlaceholder: string;
195
+ rangeMonthPlaceholder: string;
196
+ rangeWeekPlaceholder: string;
197
+ today: string;
198
+ now: string;
199
+ ok: string;
200
+ };
201
+ DragVerify: {
202
+ tryAgain: string;
203
+ swipe: string;
204
+ };
205
+ Drawer: {
206
+ cancel: string;
207
+ ok: string;
208
+ };
209
+ DynamicMultiBox: {
210
+ add: string;
211
+ titleForm: string;
212
+ default: string;
213
+ noData: string;
214
+ };
215
+ Empty: {
216
+ noData: string;
217
+ click: string;
218
+ refresh: string;
219
+ };
220
+ Modal: {
221
+ cancel: string;
222
+ ok: string;
223
+ };
224
+ MultiBox: {
225
+ add: string;
226
+ };
227
+ OperateBtn: {
228
+ more: string;
229
+ };
230
+ Pagination: {
231
+ total: string;
232
+ linePerPage: string;
233
+ currentPage: string;
234
+ jumpTo: string;
235
+ page: string;
236
+ };
237
+ PopConfirm: {
238
+ cancel: string;
239
+ ok: string;
240
+ };
241
+ Querying: {
242
+ querying: string;
243
+ };
244
+ Select: {
245
+ searchPlaceholder: string;
246
+ selected: string;
247
+ };
248
+ Selector: {
249
+ root: string;
250
+ selectAll: string;
251
+ seeMore: string;
252
+ selected: string;
253
+ pleaseEnter: string;
254
+ searchResult: string;
255
+ detail: string;
256
+ child: string;
257
+ };
258
+ SelectorPicker: {
259
+ selected: string;
260
+ select: string;
261
+ };
262
+ SingleBox: {
263
+ add: string;
264
+ };
265
+ Table: {
266
+ empty: string;
267
+ determine: string;
268
+ restoreDefault: string;
269
+ serial: string;
270
+ loadMore: string;
271
+ refresh: string;
272
+ selectNum: string;
273
+ selectAll: string;
274
+ };
275
+ Tabs: {
276
+ confirmDelete: string;
277
+ };
278
+ Transfer: {
279
+ left: string;
280
+ right: string;
281
+ allCheck: string;
282
+ inVertCheck: string;
283
+ searchPlaceholder: string;
284
+ leftBtnTips: string;
285
+ rightBtnTips: string;
286
+ };
287
+ Tree: {
288
+ loadMore: string;
289
+ add: string;
290
+ edit: string;
291
+ disabled: string;
292
+ delete: string;
293
+ };
294
+ Upload: {
295
+ uploadError: string;
296
+ uploading: string;
297
+ clickUploadFile: string;
298
+ dragFileUpload: string;
299
+ add: string;
300
+ edit: string;
301
+ disabled: string;
302
+ delete: string;
303
+ editImage: string;
304
+ };
305
+ };
306
+ };
307
+ export default _default;