@para-ui/core 3.0.93 → 3.0.94

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.
@@ -10,7 +10,7 @@ import SearchIcon from '@para-ui/icons/Search';
10
10
  import CloseIcon from '@para-ui/icons/Close';
11
11
  import CloseCircle from '@para-ui/icons/CloseCircle';
12
12
  import Table from '../Table/index.js';
13
- import { T as Tree } from '../_verture/index-fbe34f08.js';
13
+ import { T as Tree } from '../_verture/index-be25b2bc.js';
14
14
  import { Button } from '../Button/index.js';
15
15
  import { D as Dropdown } from '../_verture/index-77f9e0fb.js';
16
16
  import { Popover } from '../Popover/index.js';
@@ -74,7 +74,7 @@ import '@para-ui/icons/Left';
74
74
  import 'rc-pagination';
75
75
  import '@para-ui/icons/Right';
76
76
  import '@para-ui/icons/DoubleRight';
77
- import '../_verture/index-fbe34f08.js';
77
+ import '../_verture/index-be25b2bc.js';
78
78
  import 'rc-tree';
79
79
  import '@para-ui/icons/Document';
80
80
  import 'react-dom';
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, l as localeJson, v as validate } from '../_verture/index-5012c592.js';
6
+ import { F as FormItem, l as localeJson, v as validate } from '../_verture/index-7aa7f54c.js';
7
7
  import { u as useFormatMessage } from '../_verture/useFormatMessage-703f8b20.js';
8
8
  import { $ as $prefixCls } from '../_verture/constant-66aa48a1.js';
9
9
  import '../_verture/unsupportedIterableToArray-cb478f24.js';
@@ -70,7 +70,7 @@ import '@para-ui/icons/Left';
70
70
  import 'rc-pagination';
71
71
  import '@para-ui/icons/Right';
72
72
  import '@para-ui/icons/DoubleRight';
73
- import '../_verture/index-fbe34f08.js';
73
+ import '../_verture/index-be25b2bc.js';
74
74
  import 'rc-tree';
75
75
  import '@para-ui/icons/Document';
76
76
  import 'react-dom';
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-5012c592.js';
3
+ export { F as default } from '../_verture/index-7aa7f54c.js';
4
4
  import 'clsx';
5
5
  import '../Label/index.js';
6
6
  import '../_verture/constant-66aa48a1.js';
@@ -70,7 +70,7 @@ import '@para-ui/icons/Left';
70
70
  import 'rc-pagination';
71
71
  import '@para-ui/icons/Right';
72
72
  import '@para-ui/icons/DoubleRight';
73
- import '../_verture/index-fbe34f08.js';
73
+ import '../_verture/index-be25b2bc.js';
74
74
  import 'rc-tree';
75
75
  import '@para-ui/icons/Document';
76
76
  import 'react-dom';
package/README.md CHANGED
@@ -1,8 +1,16 @@
1
+ ## 版本: 3.0.94
2
+
3
+ para-ui/core@3.0.94 发布
4
+ 【树-tree】修复树空状态和loading同时出现的问题
5
+ 【表格-Table】修复表格右侧固定,滚动不对齐问题
6
+ 【下拉框-Select】修改下拉框初始值延迟问题
7
+
1
8
  ## 版本: 3.0.93
2
9
 
3
10
  para-ui/core@3.0.93 发布
4
11
  【下拉框-Select】修复下拉框在tab切换不收起
5
12
  【FormItem】增加isComponent参数,来判断是否是自定义组件
13
+ 【para-ui-doc】动态编辑文档内置paraUi,解决单独写import的问题
6
14
 
7
15
  ## 版本: 3.0.92
8
16
 
package/Select/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { _ as _defineProperty } from '../_verture/defineProperty-62acccfc.js';
2
2
  import { _ as _toConsumableArray } from '../_verture/toConsumableArray-81040c9e.js';
3
- import { _ as _typeof } from '../_verture/typeof-498dd2b1.js';
4
3
  import { _ as _slicedToArray } from '../_verture/slicedToArray-76060636.js';
4
+ import { _ as _typeof } from '../_verture/typeof-498dd2b1.js';
5
5
  import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
6
6
  import React__default, { useRef, useState, useEffect, useMemo } from 'react';
7
7
  import Empty from '../Empty/index.js';
@@ -84,6 +84,13 @@ var textSize = function textSize(fontSize, fontFamily, text) {
84
84
  document.body.removeChild(span);
85
85
  return result;
86
86
  };
87
+ var useDidMountEffect = function useDidMountEffect(func, deps) {
88
+ var didMount = React__default.useRef(false);
89
+ React__default.useEffect(function () {
90
+ if (didMount.current) func();else didMount.current = true;
91
+ // eslint-disable-next-line
92
+ }, deps);
93
+ };
87
94
  var Select = function Select(props) {
88
95
  var _useGlobalProps = useGlobalProps(props, 'Select'),
89
96
  className = _useGlobalProps.className,
@@ -143,6 +150,66 @@ var Select = function Select(props) {
143
150
  renderContent = _useGlobalProps.renderContent,
144
151
  _useGlobalProps$selec = _useGlobalProps.selectCheckIcon,
145
152
  selectCheckIcon = _useGlobalProps$selec === void 0 ? true : _useGlobalProps$selec;
153
+ /**
154
+ * 处理初始化数据,让list支持传入字符串
155
+ * 把数组转换成,组件能接收的格式
156
+ * */
157
+ var handList = function handList(arr) {
158
+ var handArr = [];
159
+ for (var i = 0, l = arr.length; i < l; i++) {
160
+ var item = arr[i];
161
+ if (_typeof(item) === 'object' && item !== null) {
162
+ handArr.push(item);
163
+ } else {
164
+ var obj = {};
165
+ obj[showName] = item;
166
+ obj[showValue] = item;
167
+ handArr.push(obj);
168
+ }
169
+ }
170
+ return handArr;
171
+ };
172
+ var handleInitValue = function handleInitValue() {
173
+ var valArr = [];
174
+ if (props.defaultValue !== undefined) {
175
+ if (props.multiple) {
176
+ // 多选
177
+ valArr = DeepClone(props.defaultValue || []);
178
+ } else {
179
+ // 单选
180
+ valArr = props.defaultValue === '' ? [] : [props.defaultValue];
181
+ }
182
+ }
183
+ if (value !== undefined) {
184
+ if (multiple) {
185
+ // 多选
186
+ valArr = DeepClone(value || []);
187
+ } else {
188
+ // 单选
189
+ valArr = value === '' ? [] : [value];
190
+ }
191
+ }
192
+ return valArr;
193
+ };
194
+ var handleIntlList = function handleIntlList() {
195
+ var listHand = handList(list);
196
+ var json = {};
197
+ for (var i = 0, l = listHand.length; i < l; i++) {
198
+ var item = listHand[i];
199
+ if (item[childrenName] && item[childrenName].length > 0) {
200
+ var childArr = item[childrenName];
201
+ for (var j = 0, k = childArr.length; j < k; j++) {
202
+ var childItem = childArr[j];
203
+ var key = childItem[showValue];
204
+ json[key] = childItem;
205
+ }
206
+ } else {
207
+ var _key = item[showValue];
208
+ json[_key] = item;
209
+ }
210
+ }
211
+ return json;
212
+ };
146
213
  var posDom = useRef(null);
147
214
  var _useState = useState($prefixCls + '-select-' + UUID()),
148
215
  _useState2 = _slicedToArray(_useState, 1),
@@ -158,7 +225,7 @@ var Select = function Select(props) {
158
225
  _useState8 = _slicedToArray(_useState7, 2),
159
226
  showText = _useState8[0],
160
227
  setShowText = _useState8[1]; // 是否显示lable,placeholder, true不显示
161
- var _useState9 = useState([]),
228
+ var _useState9 = useState(handleInitValue()),
162
229
  _useState10 = _slicedToArray(_useState9, 2),
163
230
  valueCom = _useState10[0],
164
231
  setValueCom = _useState10[1]; // 值
@@ -166,7 +233,7 @@ var Select = function Select(props) {
166
233
  _useState12 = _slicedToArray(_useState11, 2),
167
234
  listCom = _useState12[0],
168
235
  setListCom = _useState12[1]; // 下拉框渲染
169
- var _useState13 = useState({}),
236
+ var _useState13 = useState(handleIntlList()),
170
237
  _useState14 = _slicedToArray(_useState13, 2),
171
238
  listJson = _useState14[0],
172
239
  setListJson = _useState14[1]; // 下拉选项对象
@@ -202,15 +269,6 @@ var Select = function Select(props) {
202
269
  constData.listCom = listCom;
203
270
  constData.searchModel = searchModel;
204
271
  useEffect(function () {
205
- if (props.defaultValue !== undefined) {
206
- if (props.multiple) {
207
- // 多选
208
- setValueCom(DeepClone(props.defaultValue || []));
209
- } else {
210
- // 单选
211
- setValueCom(props.defaultValue === '' ? [] : [props.defaultValue]);
212
- }
213
- }
214
272
  return function () {
215
273
  clearTimeout(constData.searchTimer);
216
274
  clearTimeout(constData.timer);
@@ -218,7 +276,7 @@ var Select = function Select(props) {
218
276
  };
219
277
  }, []);
220
278
  // 赋值value
221
- useEffect(function () {
279
+ useDidMountEffect(function () {
222
280
  if (value !== undefined) {
223
281
  if (multiple) {
224
282
  // 多选
@@ -239,24 +297,8 @@ var Select = function Select(props) {
239
297
  setOverLineCom(overLine);
240
298
  }, [overLine, searchModel, multiple, input]);
241
299
  // 计算下拉选项,处理下拉选项json
242
- useEffect(function () {
243
- var listHand = handList(list);
244
- var json = {};
245
- for (var i = 0, l = listHand.length; i < l; i++) {
246
- var item = listHand[i];
247
- if (item[childrenName] && item[childrenName].length > 0) {
248
- var childArr = item[childrenName];
249
- for (var j = 0, k = childArr.length; j < k; j++) {
250
- var childItem = childArr[j];
251
- var key = childItem[showValue];
252
- json[key] = childItem;
253
- }
254
- } else {
255
- var _key = item[showValue];
256
- json[_key] = item;
257
- }
258
- }
259
- setListJson(json);
300
+ useDidMountEffect(function () {
301
+ setListJson(handleIntlList());
260
302
  }, [list]);
261
303
  useEffect(function () {
262
304
  if (multiple) {
@@ -331,25 +373,6 @@ var Select = function Select(props) {
331
373
  if (disabled === true) return;
332
374
  if (multiple && searchModel === 'outside') handInputLength(searchValue);
333
375
  }, [searchValue, multiple, disabled, searchModel, input]);
334
- /**
335
- * 处理初始化数据,让list支持传入字符串
336
- * 把数组转换成,组件能接收的格式
337
- * */
338
- var handList = function handList(arr) {
339
- var handArr = [];
340
- for (var i = 0, l = arr.length; i < l; i++) {
341
- var item = arr[i];
342
- if (_typeof(item) === 'object' && item !== null) {
343
- handArr.push(item);
344
- } else {
345
- var obj = {};
346
- obj[showName] = item;
347
- obj[showValue] = item;
348
- handArr.push(obj);
349
- }
350
- }
351
- return handArr;
352
- };
353
376
  /**
354
377
  * 处理下拉内容
355
378
  * @param listData 数据源
package/Table/index.js CHANGED
@@ -1451,15 +1451,19 @@ var TableBody = function TableBody(props) {
1451
1451
  var colSpan = 1;
1452
1452
  if (item.render) text = item.render(row, item, row[item.name], index, rowIndex);
1453
1453
  if (formatter) text = formatter(row, item, row[item.name], index, rowIndex);
1454
+ var itemStyle = handStyle(item);
1454
1455
  // 存在显示列,最后一列占两格
1455
1456
  if (showColumns === 'inside' && !operate && index === headData.length - 1) {
1456
1457
  colSpan = 2;
1458
+ if (itemStyle.right) {
1459
+ itemStyle.right = '0px';
1460
+ }
1457
1461
  }
1458
1462
  return jsx(TdElement, Object.assign({
1459
1463
  align: item.align || align,
1460
1464
  className: handContentClass(item),
1461
1465
  colSpan: colSpan,
1462
- style: handStyle(item)
1466
+ style: itemStyle
1463
1467
  }, {
1464
1468
  children: item.autoTips === undefined || item.autoTips === true ? jsx(AutoTips, Object.assign({
1465
1469
  beyondText: item.beyondText === undefined ? beyondText : item.beyondText,
@@ -2559,8 +2563,8 @@ var Table = function Table(propsInit) {
2559
2563
  var _itemWidth2 = getStringInNumber(_handW2);
2560
2564
  _item2.paraui_right_width = rightOps;
2561
2565
  rightOps += _itemWidth2;
2562
- // 最后一个
2563
- if (_i2 === rightArr.length - 1) {
2566
+ // 第一个
2567
+ if (_i2 === 0) {
2564
2568
  _item2.paraui_fixed_right_first = true;
2565
2569
  } else {
2566
2570
  _item2.paraui_fixed_right_first = false;
package/Tree/index.js CHANGED
@@ -1,5 +1,5 @@
1
- import { T as Tree } from '../_verture/index-fbe34f08.js';
2
- export { T as default } from '../_verture/index-fbe34f08.js';
1
+ import { T as Tree } from '../_verture/index-be25b2bc.js';
2
+ export { T as default } from '../_verture/index-be25b2bc.js';
3
3
  import '../_verture/toConsumableArray-81040c9e.js';
4
4
  import '../_verture/unsupportedIterableToArray-cb478f24.js';
5
5
  import '../_verture/defineProperty-62acccfc.js';
@@ -1274,7 +1274,7 @@ var Tree = /*#__PURE__*/React__default.forwardRef(function (props, ref) {
1274
1274
  firstRender.current = false;
1275
1275
  return null;
1276
1276
  } else if (!(treeData === null || treeData === void 0 ? void 0 : treeData.length)) {
1277
- return renderEmpty;
1277
+ return !loading ? renderEmpty : null;
1278
1278
  }
1279
1279
  var tCheckedKeys = inCheckedKeys;
1280
1280
  if (checkStrictly) {
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-5012c592.js';
25
+ export { F as FormItem } from './_verture/index-7aa7f54c.js';
26
26
  export { u as FunctionModal, F as FunctionModalProvider, a as useClose } from './_verture/modalContext-630bdb73.js';
27
27
  export { default as GlobalContext, changeConfirmLocale, getConfirmLocale } from './GlobalContext/index.js';
28
28
  export { default as Help } from './Help/index.js';
@@ -69,7 +69,7 @@ export { Title } from './Title/index.js';
69
69
  export { ToggleButton, ToggleButtonGroup } from './ToggleButton/index.js';
70
70
  export { Tooltip } from './Tooltip/index.js';
71
71
  export { SSortablejs, Transfer } from './Transfer/index.js';
72
- export { T as Tree } from './_verture/index-fbe34f08.js';
72
+ export { T as Tree } from './_verture/index-be25b2bc.js';
73
73
  export { default as Upload } from './Upload/index.js';
74
74
  export { default as locale } from './locale/index.js';
75
75
  import './_verture/slicedToArray-76060636.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.93",
4
+ "version": "3.0.94",
5
5
  "main": "./index.js",
6
6
  "typings": "./index.d.ts",
7
7
  "description": "Powered by Para FED",