@para-ui/core 3.0.74 → 3.0.76

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
@@ -3,7 +3,7 @@ import { _ as _slicedToArray } from '../_verture/slicedToArray-76060636.js';
3
3
  import { jsx } from 'react/jsx-runtime';
4
4
  import { DeepClone } from '@paraview/lib';
5
5
  import React__default from 'react';
6
- import { F as FormItem, v as validate } from '../_verture/index-e5af68b5.js';
6
+ import { F as FormItem, v as validate } from '../_verture/index-e7fd3a50.js';
7
7
  import { $ as $prefixCls } from '../_verture/constant-66aa48a1.js';
8
8
  import '../_verture/unsupportedIterableToArray-cb478f24.js';
9
9
  import '../TextField/index.js';
@@ -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/FormItem/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import 'react/jsx-runtime';
2
2
  import 'react';
3
- export { F as default } from '../_verture/index-e5af68b5.js';
3
+ export { F as default } from '../_verture/index-e7fd3a50.js';
4
4
  import 'clsx';
5
5
  import '../Label/index.js';
6
6
  import '../_verture/constant-66aa48a1.js';
@@ -4,6 +4,7 @@
4
4
  * @description 多值框
5
5
  */
6
6
  import React, { FunctionComponent, ReactNode } from 'react';
7
+ import { TextFieldProps } from '../TextField';
7
8
  import { LabelTooltipProps } from "../Label";
8
9
  import { HelperTextDetailProps } from "../HelperText";
9
10
  import './index.scss';
@@ -54,6 +55,10 @@ export interface MultiBoxProps extends HelperTextDetailProps {
54
55
  fetchSuggestionsKey?: (val: string, cb: (data: any[]) => void) => void;
55
56
  /** 值索引匹配 */
56
57
  fetchSuggestionsValue?: (val: string, cb: (data: any[]) => void) => void;
58
+ /** 自定义键值Props */
59
+ keyOtherProps?: (index: number, val: string) => TextFieldProps;
60
+ /** 自定义值Props */
61
+ valueOtherProps?: (index: number, val: string) => TextFieldProps;
57
62
  [name: string]: any;
58
63
  }
59
64
  export declare const MultiBox: FunctionComponent<MultiBoxProps>;
package/MultiBox/index.js CHANGED
@@ -77,7 +77,9 @@ var MultiBox = function MultiBox(props) {
77
77
  replaceFields = props.replaceFields,
78
78
  onChange = props.onChange,
79
79
  fetchSuggestionsKey = props.fetchSuggestionsKey,
80
- fetchSuggestionsValue = props.fetchSuggestionsValue;
80
+ fetchSuggestionsValue = props.fetchSuggestionsValue,
81
+ keyOtherProps = props.keyOtherProps,
82
+ valueOtherProps = props.valueOtherProps;
81
83
  var isError = helperText && typeof helperText === 'string' ? true : false;
82
84
  var isErrorArr = helperText instanceof Array;
83
85
  var intl = useFormatMessage('MultiBox', localeJson);
@@ -185,7 +187,7 @@ var MultiBox = function MultiBox(props) {
185
187
  onChange: changeValue(replaceFieldsCom.key || '', index),
186
188
  fetchSuggestions: fetchSuggestionsKey ? fetchSuggestions('key') : undefined,
187
189
  onSelect: selectValue(replaceFieldsCom.key || '', index)
188
- })), separator && jsx("span", Object.assign({
190
+ }, keyOtherProps && keyOtherProps(index, keyValue))), separator && jsx("span", Object.assign({
189
191
  className: 'multi-box-separator'
190
192
  }, {
191
193
  children: separator
@@ -199,7 +201,7 @@ var MultiBox = function MultiBox(props) {
199
201
  onChange: changeValue(replaceFieldsCom.value || '', index),
200
202
  fetchSuggestions: fetchSuggestionsValue ? fetchSuggestions('value') : undefined,
201
203
  onSelect: selectValue(replaceFieldsCom.value || '', index)
202
- }))]
204
+ }, valueOtherProps && valueOtherProps(index, valValue)))]
203
205
  }));
204
206
  };
205
207
  /** 处理内容 */
package/README.md CHANGED
@@ -1,3 +1,14 @@
1
+ ## 版本: 3.0.76
2
+
3
+ para-ui/core@3.0.76 发布
4
+ 【表单-form】修复form下只有一个input元素时回车会触发页面reload的问题
5
+ ## 版本: 3.0.75
6
+
7
+ para-ui/core@3.0.75 发布
8
+ 【表格-Table】修复表格左下角,全选全量数据不全问题
9
+ 【多值框-MultiBox】增加自定义输入框props
10
+ 【单值框-SingleBox】增加自定义输入框props
11
+
1
12
  ## 版本: 3.0.74
2
13
 
3
14
  para-ui/core@3.0.74 发布
@@ -27,9 +38,9 @@
27
38
  para-ui/core@3.0.70 发布
28
39
  【组织树-tree】增加autoTips参数tipMaxWidth(提示最大高度)暴露
29
40
  【标签页-Tabs】修复IE11中Tabs出现滚动条问题、模块显示文字重叠,未展示省略收起功能
30
- 【抽屉-Drawer】修复IE11中抽屉抖动问题、修复弹窗挂载异常问题
41
+ 【抽屉-Drawer】修复IE11中抽屉抖动问题、修复弹窗挂载异常问题
31
42
  【对话框-Modal】对话框图标和标题居中对齐
32
-
43
+
33
44
 
34
45
  ## 版本: 3.0.69
35
46
 
@@ -4,6 +4,7 @@
4
4
  * @description 单值框
5
5
  */
6
6
  import React, { FunctionComponent, ReactNode } from 'react';
7
+ import { TextFieldProps } from '../TextField';
7
8
  import { LabelTooltipProps } from "../Label";
8
9
  import { HelperTextDetailProps } from "../HelperText";
9
10
  import './index.scss';
@@ -38,6 +39,8 @@ export interface SingleBoxProps extends HelperTextDetailProps {
38
39
  onChange?: (val: string[]) => void;
39
40
  /** 匹配 */
40
41
  fetchSuggestions?: (val: string, cb: (data: any[]) => void) => void;
42
+ /** 输入框其他参数 */
43
+ otherProps?: (index: number, val: string) => TextFieldProps;
41
44
  [name: string]: any;
42
45
  }
43
46
  export declare const SingleBox: FunctionComponent<SingleBoxProps>;
@@ -69,7 +69,8 @@ var SingleBox = function SingleBox(props) {
69
69
  helperText = _props$helperText === void 0 ? '' : _props$helperText,
70
70
  value = props.value,
71
71
  onChange = props.onChange,
72
- fetchSuggestions = props.fetchSuggestions;
72
+ fetchSuggestions = props.fetchSuggestions,
73
+ otherProps = props.otherProps;
73
74
  var isError = helperText && typeof helperText === 'string' ? true : false;
74
75
  var isErrorArr = helperText instanceof Array;
75
76
  var intl = useFormatMessage('SingleBox', localeJson);
@@ -190,7 +191,7 @@ var SingleBox = function SingleBox(props) {
190
191
  onChange: changeInput(index),
191
192
  fetchSuggestions: fetchSuggestions,
192
193
  onSelect: selectValue(index)
193
- }))
194
+ }, otherProps && otherProps(index, item)))
194
195
  })), !disabled && jsx("div", Object.assign({
195
196
  className: "opera-box"
196
197
  }, {
package/Table/index.js CHANGED
@@ -3034,7 +3034,7 @@ var Table = function Table(propsInit) {
3034
3034
  selectAll: setAllCheck,
3035
3035
  checkNumber: Object.keys(checkJson).length
3036
3036
  });
3037
- }, [total, pageCom, sizeCom, sizeArrCom, pagination, loadMore, autoPagination, paginationType, flippingArrow, refreshInside, checkCount, headSelectStatus, rowData, checkJson, disabledJson]);
3037
+ }, [total, pageCom, sizeCom, sizeArrCom, pagination, loadMore, autoPagination, paginationType, flippingArrow, refreshInside, checkCount, headSelectStatus, rowData, checkJson, disabledJson, totalDataJson]);
3038
3038
  // 表格内容滚动
3039
3039
  var tableBoxScroll = function tableBoxScroll(e) {
3040
3040
  var dom = tableRef.current;
package/index.js CHANGED
@@ -22,7 +22,7 @@ export { D as Dropdown } from './_verture/index-77f9e0fb.js';
22
22
  export { default as DynamicMultiBox } from './DynamicMultiBox/index.js';
23
23
  export { default as Empty } from './Empty/index.js';
24
24
  export { default as Form } from './Form/index.js';
25
- export { F as FormItem } from './_verture/index-e5af68b5.js';
25
+ export { F as FormItem } from './_verture/index-e7fd3a50.js';
26
26
  export { u as FunctionModal, F as FunctionModalProvider, a as useClose } from './_verture/modalContext-20780c9a.js';
27
27
  export { default as GlobalContext, changeConfirmLocale, getConfirmLocale } from './GlobalContext/index.js';
28
28
  export { default as Help } from './Help/index.js';
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@para-ui/core",
3
3
  "private": false,
4
- "version": "3.0.74",
4
+ "version": "3.0.76",
5
5
  "main": "./index.js",
6
6
  "typings": "./index.d.ts",
7
7
  "description": "Powered by Para FED",