@para-ui/core 3.0.42 → 3.0.43
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/Button/SplitButton.d.ts +2 -0
- package/Button/index.js +9 -2
- package/Form/index.js +1 -1
- package/FormItem/index.js +1 -1
- package/FunctionModal/index.js +2 -2
- package/README.md +6 -0
- package/Table/index.js +38 -11
- package/Table/interface.d.ts +21 -1
- package/Transfer/index.js +8 -0
- package/index.js +2 -2
- package/package.json +1 -1
- package/umd/AutoBox.js +7 -7
- package/umd/AutoTips.js +3 -3
- package/umd/Breadcrumbs.js +4 -4
- package/umd/Button.js +3 -3
- package/umd/ButtonGroup.js +5 -5
- package/umd/Checkbox.js +3 -3
- package/umd/CheckboxGroup.js +2 -2
- package/umd/ComboSelect.js +3 -3
- package/umd/DatePicker.js +2 -2
- package/umd/Desktop.js +2 -2
- package/umd/Drawer.js +4 -4
- package/umd/DynamicMultiBox.js +2 -2
- package/umd/Form.js +2 -2
- package/umd/FormItem.js +4 -4
- package/umd/FunctionModal.js +4 -4
- package/umd/Help.js +5 -5
- package/umd/InputLang.js +2 -2
- package/umd/InputNumber.js +4 -4
- package/umd/Label.js +3 -3
- package/umd/Modal.js +4 -4
- package/umd/MultiBox.js +2 -2
- package/umd/OperateBtn.js +4 -4
- package/umd/PageHeader.js +2 -2
- package/umd/Pagination.js +4 -4
- package/umd/PopConfirm.js +4 -4
- package/umd/Popover.js +3 -3
- package/umd/Radio.js +6 -6
- package/umd/RadioGroup.js +4 -4
- package/umd/Search.js +2 -2
- package/umd/Select.js +2 -2
- package/umd/SelectInput.js +2 -2
- package/umd/Selector.js +2 -2
- package/umd/SelectorPicker.js +4 -4
- package/umd/SingleBox.js +4 -4
- package/umd/Slider.js +2 -2
- package/umd/Switch.js +3 -3
- package/umd/Table.js +5 -5
- package/umd/Tabs.js +2 -2
- package/umd/Tag.js +2 -2
- package/umd/TextEditor.js +2 -2
- package/umd/TextField.js +4 -4
- package/umd/TimePicker.js +3 -3
- package/umd/ToggleButton.js +3 -3
- package/umd/Tooltip.js +2 -2
- package/umd/Transfer.js +5 -5
- package/umd/Tree.js +7 -7
- package/umd/Upload.js +8 -8
- /package/_verture/{index-95dffbeb.js → index-694b816f.js} +0 -0
- /package/_verture/{modalContext-44e0b3ea.js → modalContext-d01400f6.js} +0 -0
package/Button/SplitButton.d.ts
CHANGED
|
@@ -57,6 +57,8 @@ export interface SplitButtonProps {
|
|
|
57
57
|
optionRender?: (option: Option) => React.ReactNode;
|
|
58
58
|
/** 图标按钮 */
|
|
59
59
|
iconButton?: boolean;
|
|
60
|
+
/** 浮层渲染容器,默认body */
|
|
61
|
+
getPopupContainer?: (triggerNode: HTMLElement) => HTMLElement;
|
|
60
62
|
}
|
|
61
63
|
export default function SplitButton(props: SplitButtonProps): JSX.Element;
|
|
62
64
|
export {};
|
package/Button/index.js
CHANGED
|
@@ -51,7 +51,11 @@ function SplitButton(props) {
|
|
|
51
51
|
placement = _props$placement === void 0 ? 'bottomRight' : _props$placement,
|
|
52
52
|
buttonProps = props.buttonProps,
|
|
53
53
|
_props$iconButton = props.iconButton,
|
|
54
|
-
iconButton = _props$iconButton === void 0 ? false : _props$iconButton
|
|
54
|
+
iconButton = _props$iconButton === void 0 ? false : _props$iconButton,
|
|
55
|
+
popperStyle = props.popperStyle,
|
|
56
|
+
_props$popperClassNam = props.popperClassName,
|
|
57
|
+
popperClassName = _props$popperClassNam === void 0 ? '' : _props$popperClassNam,
|
|
58
|
+
getPopupContainer = props.getPopupContainer;
|
|
55
59
|
var intl = useFormatMessage('Button', localeJson);
|
|
56
60
|
var btnRef = useRef();
|
|
57
61
|
var _useState = useState(),
|
|
@@ -140,7 +144,10 @@ function SplitButton(props) {
|
|
|
140
144
|
}, {
|
|
141
145
|
children: jsx(Dropdown, Object.assign({
|
|
142
146
|
overlay: renderButtonList(),
|
|
143
|
-
placement: placement
|
|
147
|
+
placement: placement,
|
|
148
|
+
overlayStyle: popperStyle,
|
|
149
|
+
overlayClassName: popperClassName,
|
|
150
|
+
getPopupContainer: getPopupContainer
|
|
144
151
|
}, {
|
|
145
152
|
children: renderButton()
|
|
146
153
|
}))
|
package/Form/index.js
CHANGED
|
@@ -3,7 +3,7 @@ import { _ as _slicedToArray } from '../_verture/slicedToArray-708dbb18.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-
|
|
6
|
+
import { F as FormItem, v as validate } from '../_verture/index-694b816f.js';
|
|
7
7
|
import { $ as $prefixCls } from '../_verture/constant-66aa48a1.js';
|
|
8
8
|
import '../TextField/index.js';
|
|
9
9
|
import '../_verture/typeof-498dd2b1.js';
|
package/FormItem/index.js
CHANGED
package/FunctionModal/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { u as useModal } from '../_verture/modalContext-
|
|
2
|
-
export { F as FunctionModalProvider, u as default, a as useClose } from '../_verture/modalContext-
|
|
1
|
+
import { u as useModal } from '../_verture/modalContext-d01400f6.js';
|
|
2
|
+
export { F as FunctionModalProvider, u as default, a as useClose } from '../_verture/modalContext-d01400f6.js';
|
|
3
3
|
import '../_verture/toConsumableArray-57dd2e23.js';
|
|
4
4
|
import '../_verture/slicedToArray-708dbb18.js';
|
|
5
5
|
import '../_verture/index-beef914f.js';
|
package/README.md
CHANGED
package/Table/index.js
CHANGED
|
@@ -1742,7 +1742,9 @@ var Table = function Table(propsInit) {
|
|
|
1742
1742
|
filterSearchCallback = props.filterSearchCallback,
|
|
1743
1743
|
onClickRow = props.onClickRow,
|
|
1744
1744
|
rowClassMapping = props.rowClassMapping,
|
|
1745
|
-
getPopupContainer = props.getPopupContainer
|
|
1745
|
+
getPopupContainer = props.getPopupContainer,
|
|
1746
|
+
onSort = props.onSort,
|
|
1747
|
+
onError = props.onError;
|
|
1746
1748
|
var intl = useFormatMessage('Table', localeJson);
|
|
1747
1749
|
var dayNum = props.expirationTime ? props.expirationTime === 0 ? 100000000 : props.expirationTime : 7; // 过期天数
|
|
1748
1750
|
var _useState = useState(props.page !== undefined ? props.page : 1),
|
|
@@ -1855,6 +1857,7 @@ var Table = function Table(propsInit) {
|
|
|
1855
1857
|
constData.current.data = data;
|
|
1856
1858
|
constData.current.searchKeyName = searchKeyName;
|
|
1857
1859
|
constData.current.filterSearchCallback = filterSearchCallback;
|
|
1860
|
+
constData.current.onError = onError;
|
|
1858
1861
|
useEffect(function () {
|
|
1859
1862
|
window.addEventListener('resize', changeResize);
|
|
1860
1863
|
return function () {
|
|
@@ -2452,7 +2455,7 @@ var Table = function Table(propsInit) {
|
|
|
2452
2455
|
*/
|
|
2453
2456
|
var requestData = function requestData(obj) {
|
|
2454
2457
|
return __awaiter(void 0, void 0, void 0, /*#__PURE__*/regenerator.mark(function _callee() {
|
|
2455
|
-
var _yield$requestFunc, data, err;
|
|
2458
|
+
var _yield$requestFunc, data, err, onErrorFlag;
|
|
2456
2459
|
return regenerator.wrap(function _callee$(_context) {
|
|
2457
2460
|
while (1) switch (_context.prev = _context.next) {
|
|
2458
2461
|
case 0:
|
|
@@ -2471,18 +2474,37 @@ var Table = function Table(propsInit) {
|
|
|
2471
2474
|
return _context.abrupt("return");
|
|
2472
2475
|
case 9:
|
|
2473
2476
|
if (!err) {
|
|
2474
|
-
_context.next =
|
|
2477
|
+
_context.next = 23;
|
|
2475
2478
|
break;
|
|
2476
2479
|
}
|
|
2477
2480
|
if (props.loading === undefined) setLoadState(false);
|
|
2478
|
-
// cancel
|
|
2479
|
-
if (
|
|
2480
|
-
|
|
2481
|
-
|
|
2482
|
-
|
|
2481
|
+
// cancel的接口 不清除上次展示的数据
|
|
2482
|
+
if (err.__CANCEL__) {
|
|
2483
|
+
_context.next = 22;
|
|
2484
|
+
break;
|
|
2485
|
+
}
|
|
2486
|
+
onErrorFlag = false;
|
|
2487
|
+
if (!constData.current.onError) {
|
|
2488
|
+
_context.next = 17;
|
|
2489
|
+
break;
|
|
2483
2490
|
}
|
|
2491
|
+
_context.next = 16;
|
|
2492
|
+
return constData.current.onError(err);
|
|
2493
|
+
case 16:
|
|
2494
|
+
onErrorFlag = _context.sent;
|
|
2495
|
+
case 17:
|
|
2496
|
+
if (onErrorFlag) {
|
|
2497
|
+
_context.next = 19;
|
|
2498
|
+
break;
|
|
2499
|
+
}
|
|
2500
|
+
return _context.abrupt("return");
|
|
2501
|
+
case 19:
|
|
2502
|
+
setRowData([]);
|
|
2503
|
+
setTotal(0);
|
|
2504
|
+
setRowDataJson({});
|
|
2505
|
+
case 22:
|
|
2484
2506
|
return _context.abrupt("return", false);
|
|
2485
|
-
case
|
|
2507
|
+
case 23:
|
|
2486
2508
|
if (requestCallback) {
|
|
2487
2509
|
requestCallback(data, function (handData) {
|
|
2488
2510
|
if (handData) {
|
|
@@ -2496,7 +2518,7 @@ var Table = function Table(propsInit) {
|
|
|
2496
2518
|
handReqData(data);
|
|
2497
2519
|
if (props.loading === undefined) setLoadState(false);
|
|
2498
2520
|
}
|
|
2499
|
-
case
|
|
2521
|
+
case 24:
|
|
2500
2522
|
case "end":
|
|
2501
2523
|
return _context.stop();
|
|
2502
2524
|
}
|
|
@@ -2639,6 +2661,11 @@ var Table = function Table(propsInit) {
|
|
|
2639
2661
|
setOrderTypeArr(orderTypeArrHand);
|
|
2640
2662
|
constData.current.orderFieldArr = orderFieldArrHand;
|
|
2641
2663
|
constData.current.orderTypeArr = orderTypeArrHand;
|
|
2664
|
+
// 只试用与本地数据
|
|
2665
|
+
if (onSort) onSort({
|
|
2666
|
+
orderField: orderFieldArrHand,
|
|
2667
|
+
orderType: orderTypeArrHand
|
|
2668
|
+
});
|
|
2642
2669
|
if (constData.current.loadMoreUrl) {
|
|
2643
2670
|
constData.current.historyData = [];
|
|
2644
2671
|
handPage(1);
|
|
@@ -2816,7 +2843,7 @@ var Table = function Table(propsInit) {
|
|
|
2816
2843
|
changeColumnWidth: changeColumnWidth,
|
|
2817
2844
|
getPopupContainer: getPopupContainer
|
|
2818
2845
|
});
|
|
2819
|
-
}, [totalDataJson, showColumns, rowKey, rowData, checkJson, disabledJson, orderTypeArr, orderFieldArr, sortTable, filter, expandable, check, headSelectStatus, radio, align, showHeadList, headDataCom, selectFilterCom, operate, onClickColumns, sortTableRadio, fixedTable, posFixed, beyondText, fixedColumn, lineWidth, dragColumn, headDataConfig, getPopupContainer]);
|
|
2846
|
+
}, [totalDataJson, showColumns, rowKey, rowData, checkJson, disabledJson, orderTypeArr, orderFieldArr, sortTable, filter, expandable, check, headSelectStatus, radio, align, showHeadList, headDataCom, selectFilterCom, operate, onClickColumns, sortTableRadio, fixedTable, posFixed, beyondText, fixedColumn, lineWidth, dragColumn, headDataConfig, getPopupContainer, onSort]);
|
|
2820
2847
|
// 表格内容memo
|
|
2821
2848
|
var TableBodyMemo = useMemo(function () {
|
|
2822
2849
|
return jsx(TableBody, {
|
package/Table/interface.d.ts
CHANGED
|
@@ -21,6 +21,13 @@ export type SelectStatus = 'all' | 'half' | 'not';
|
|
|
21
21
|
export type ExpandableStatus = 'develop' | 'retract' | undefined;
|
|
22
22
|
/** 对齐方式 */
|
|
23
23
|
export type AlignType = 'left' | 'center' | 'right';
|
|
24
|
+
export interface FilterEnumsProps {
|
|
25
|
+
/** 显示名 */
|
|
26
|
+
displayName?: ReactNode;
|
|
27
|
+
/** 值 */
|
|
28
|
+
value?: any;
|
|
29
|
+
[name: string]: any;
|
|
30
|
+
}
|
|
24
31
|
/** 渲染数据参数 */
|
|
25
32
|
export interface HeadDataProps {
|
|
26
33
|
/** 样式class */
|
|
@@ -61,7 +68,7 @@ export interface HeadDataProps {
|
|
|
61
68
|
}) => void;
|
|
62
69
|
}) => ReactNode;
|
|
63
70
|
/** 枚举 */
|
|
64
|
-
enums?:
|
|
71
|
+
enums?: FilterEnumsProps[];
|
|
65
72
|
/** 是否显示字段 */
|
|
66
73
|
selected?: boolean;
|
|
67
74
|
/** 滚动定位方向, 必须配合width使用 */
|
|
@@ -261,6 +268,19 @@ export interface TableProps extends TableHeadBodyPublicProps {
|
|
|
261
268
|
}) => boolean;
|
|
262
269
|
/** 下拉框弹窗内容 */
|
|
263
270
|
getPopupContainer?: (triggerNode: HTMLElement) => HTMLElement;
|
|
271
|
+
/** 排序(注:只试用与本地数据)
|
|
272
|
+
* orderField: 排序字段
|
|
273
|
+
* orderType: 排序类型
|
|
274
|
+
* */
|
|
275
|
+
onSort?: (data: {
|
|
276
|
+
orderField?: string[];
|
|
277
|
+
orderType: OrderType[];
|
|
278
|
+
}) => void;
|
|
279
|
+
/** 接口错误回调
|
|
280
|
+
* 返回true,走组件内部错误处理
|
|
281
|
+
* 不返回或者返回false,走外部逻辑
|
|
282
|
+
* */
|
|
283
|
+
onError?: (err: any) => (Promise<boolean | void> | (boolean | void));
|
|
264
284
|
[key: string]: any;
|
|
265
285
|
}
|
|
266
286
|
export interface ExpandableRowItem {
|
package/Transfer/index.js
CHANGED
|
@@ -169,6 +169,14 @@ var Box = function Box(props) {
|
|
|
169
169
|
onChange: function onChange(val) {
|
|
170
170
|
onSearch(val, direction);
|
|
171
171
|
},
|
|
172
|
+
onClickRightIcon: function onClickRightIcon(val) {
|
|
173
|
+
onSearch(val, direction);
|
|
174
|
+
},
|
|
175
|
+
onEnter: function onEnter(event) {
|
|
176
|
+
var _a;
|
|
177
|
+
var val = ((_a = event.target) === null || _a === void 0 ? void 0 : _a.value) || '';
|
|
178
|
+
onSearch(val, direction);
|
|
179
|
+
},
|
|
172
180
|
allowClear: false
|
|
173
181
|
}), jsx("div", Object.assign({
|
|
174
182
|
className: "context",
|
package/index.js
CHANGED
|
@@ -22,8 +22,8 @@ export { D as Dropdown } from './_verture/index-be4faaee.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-
|
|
26
|
-
export { u as FunctionModal, F as FunctionModalProvider, a as useClose } from './_verture/modalContext-
|
|
25
|
+
export { F as FormItem } from './_verture/index-694b816f.js';
|
|
26
|
+
export { u as FunctionModal, F as FunctionModalProvider, a as useClose } from './_verture/modalContext-d01400f6.js';
|
|
27
27
|
export { default as GlobalContext, changeConfirmLocale, getConfirmLocale } from './GlobalContext/index.js';
|
|
28
28
|
export { default as Help } from './Help/index.js';
|
|
29
29
|
export { default as HelperText } from './HelperText/index.js';
|