vap1 0.5.4 → 0.5.7
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/components/Box/Box.d.ts +4 -0
- package/components/Box/Box.js +17 -7
- package/components/Box/SelectBar.d.ts +1 -4
- package/components/Box/SelectBar.js +3 -6
- package/components/Lists/Grid/index.js +0 -1
- package/components/SearchTool/SearchBar/ActionButtons.js +3 -16
- package/components/SearchTool/SearchBar/ByKeyword.js +1 -1
- package/components/Tables/Components/ActionBar.js +0 -36
- package/components/Tables/Components/useTableContext.js +0 -1
- package/components/Tables/Util.d.ts +2 -2
- package/components/Tables/VTable.js +4 -2
- package/components/Trees/ActionTree.js +5 -1
- package/components/Trees/BaseTree.js +1 -1
- package/components/Trees/STree.js +1 -1
- package/components/UForm/FormWrapper.js +5 -0
- package/components/UForm/UFormModal.js +2 -2
- package/components/UForm/_FieldType.js +2 -1
- package/components/UForm/index.d.ts +1 -1
- package/package.json +1 -1
- package/utils/Global.d.ts +5 -0
- package/utils/Global.js +1 -1
- package/components/Tables/VTableBack.d.ts +0 -0
- package/components/Tables/VTableBack.js +0 -269
- package/deps/app-data/Const.d.ts +0 -71
- package/deps/app-data/Const.js +0 -54
- package/deps/app-data/SourceTable.d.ts +0 -0
- package/deps/app-data/SourceTable.js +0 -137
- package/deps/app-data/TimeConst.d.ts +0 -0
- package/deps/app-data/TimeConst.js +0 -58
- package/deps/app-data/useSource.d.ts +0 -22
- package/deps/app-data/useSource.js +0 -253
package/components/Box/Box.d.ts
CHANGED
|
@@ -6,6 +6,10 @@ import type { ActButton } from '../SearchTool/SearchBar/ActionButtons';
|
|
|
6
6
|
import type { Key, PlainObject } from '../../basetype';
|
|
7
7
|
import type { UPaginationProps } from '../_common/Upagination';
|
|
8
8
|
type BoxState = {
|
|
9
|
+
/**
|
|
10
|
+
* 是否折叠
|
|
11
|
+
*/
|
|
12
|
+
collapsed?: boolean;
|
|
9
13
|
/**
|
|
10
14
|
* 内容区域高度
|
|
11
15
|
*/
|
package/components/Box/Box.js
CHANGED
|
@@ -106,17 +106,22 @@ exports.Box = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
106
106
|
var rootRef = (0, react_1.useRef)(null);
|
|
107
107
|
var contextRef = (0, react_1.useRef)(null);
|
|
108
108
|
var selectRef = (0, react_1.useRef)(null);
|
|
109
|
+
var _b = __read((0, react_1.useState)(function () {
|
|
110
|
+
if (props.selectBar == null)
|
|
111
|
+
return true;
|
|
112
|
+
return props.selectBar.defaultCollapse || false;
|
|
113
|
+
}), 2), collapsed = _b[0], setCollapsed = _b[1];
|
|
109
114
|
var mode = (0, react_1.useMemo)(function () {
|
|
110
115
|
return props.mode || 'common';
|
|
111
116
|
}, [props.mode]);
|
|
112
117
|
var className = (0, react_1.useMemo)(function () {
|
|
113
|
-
var clazz = ['c-box'];
|
|
114
|
-
|
|
115
|
-
|
|
118
|
+
var clazz = ['c-box', 'c-box-' + mode];
|
|
119
|
+
if (props.nobg)
|
|
120
|
+
clazz.push('c-box-nobg');
|
|
116
121
|
if (props.className)
|
|
117
122
|
clazz.push(props.className);
|
|
118
123
|
return clazz.join(' ');
|
|
119
|
-
}, [
|
|
124
|
+
}, [mode, collapsed]);
|
|
120
125
|
var style = (0, react_1.useMemo)(function () {
|
|
121
126
|
var css = __assign({}, props.style);
|
|
122
127
|
if (mode == 'inner') {
|
|
@@ -174,8 +179,13 @@ exports.Box = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
174
179
|
(0, react_1.useEffect)(function () { setTimeout(resize, 120); }, [app === null || app === void 0 ? void 0 : app.theme.contentHeight]); // 1.5 版本:延时 120ms
|
|
175
180
|
(0, react_1.useImperativeHandle)(ref, function () { return ({ resize: resize }); }, [mode]);
|
|
176
181
|
(0, react_1.useLayoutEffect)(function () {
|
|
177
|
-
setTimeout(resize,
|
|
182
|
+
setTimeout(resize, 10);
|
|
178
183
|
}, []);
|
|
184
|
+
var maxWidth = (0, react_1.useMemo)(function () {
|
|
185
|
+
if (collapsed)
|
|
186
|
+
return undefined;
|
|
187
|
+
return "calc(100% - ".concat(props.selectBar.width || utils_1.GLOBAL.CONFIG.BOX.SELECTBAR_WIDTH || 250, "px)");
|
|
188
|
+
}, [collapsed]);
|
|
179
189
|
var SearchTool = (0, react_1.useMemo)(function () {
|
|
180
190
|
var hasBar = lodash_1.default.has(props, 'searchBar'),
|
|
181
191
|
// hasBand = _.has(props, 'searchBand'),
|
|
@@ -228,8 +238,8 @@ exports.Box = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
228
238
|
args[_a] = arguments[_a];
|
|
229
239
|
}
|
|
230
240
|
return setState({ selected: args });
|
|
231
|
-
} })),
|
|
232
|
-
react_1.default.createElement(Layout_1.Layout.Content, { style: { overflow: props.overflowAuto ? 'auto' : 'hidden' }, ref: function () {
|
|
241
|
+
}, onSelectCollapse: setCollapsed })),
|
|
242
|
+
react_1.default.createElement(Layout_1.Layout.Content, { style: { overflow: props.overflowAuto ? 'auto' : 'hidden', maxWidth: maxWidth }, ref: function () {
|
|
233
243
|
if (_layoutRef.current == null) {
|
|
234
244
|
var layout = document.getElementById(domId);
|
|
235
245
|
if (layout) {
|
|
@@ -56,10 +56,6 @@ type _BoxSelectBarProps = BaseItem & {
|
|
|
56
56
|
* 初始为收起状态,默认不收起
|
|
57
57
|
*/
|
|
58
58
|
defaultCollapse?: boolean;
|
|
59
|
-
/**
|
|
60
|
-
* 边栏状态变更触发
|
|
61
|
-
*/
|
|
62
|
-
onSelectCollapse?: (boolean: any) => void;
|
|
63
59
|
/**
|
|
64
60
|
* 选择区映射,用于一些特殊场景
|
|
65
61
|
*/
|
|
@@ -94,5 +90,6 @@ type ExtendSelectProps = {
|
|
|
94
90
|
export type SelectBarProps = _BoxSelectBarProps & ExtendSelectProps;
|
|
95
91
|
export declare const SelectBar: React.ForwardRefExoticComponent<Omit<SelectBarProps, "onSelect"> & {
|
|
96
92
|
onSelect: (key: Key, object?: PlainObject, ...args: any[]) => void;
|
|
93
|
+
onSelectCollapse: (boolean: any) => void;
|
|
97
94
|
} & React.RefAttributes<any>>;
|
|
98
95
|
export {};
|
|
@@ -75,12 +75,9 @@ var Icon_1 = require("../_adapt/Icon");
|
|
|
75
75
|
exports.SelectBar = (0, react_1.forwardRef)(function (props, ref) {
|
|
76
76
|
var _a = __read((0, react_1.useState)(null), 2), keyword = _a[0], setKeyword = _a[1];
|
|
77
77
|
var _b = __read((0, hooks_1.useToggle)(props.defaultCollapse || false), 2), collapsed = _b[0], setCollapsed = _b[1];
|
|
78
|
-
// const setKeyword = _.debounce(_setKeyword, 100);
|
|
79
78
|
var component = (0, _register_1.getSelectBar)(props.type);
|
|
80
79
|
(0, react_1.useLayoutEffect)(function () {
|
|
81
|
-
|
|
82
|
-
props.onSelectCollapse(collapsed);
|
|
83
|
-
}
|
|
80
|
+
props.onSelectCollapse(collapsed);
|
|
84
81
|
}, [collapsed]);
|
|
85
82
|
if (component == undefined) {
|
|
86
83
|
console.warn('SelectBar Type is not registerd ', props.type);
|
|
@@ -88,7 +85,7 @@ exports.SelectBar = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
88
85
|
}
|
|
89
86
|
if (props.roleCode && !utils_1.PageUtil.hasRole(props.roleCode))
|
|
90
87
|
return utils_1.Const.NONE;
|
|
91
|
-
var width = lodash_1.default.isNumber(props.width) ? props.width :
|
|
88
|
+
var width = lodash_1.default.isNumber(props.width) ? props.width : utils_1.GLOBAL.CONFIG.BOX.SELECTBAR_WIDTH;
|
|
92
89
|
var renderContent = function () {
|
|
93
90
|
if (props.type == 'custom') {
|
|
94
91
|
if (!lodash_1.default.has(props, 'content')) {
|
|
@@ -117,7 +114,7 @@ exports.SelectBar = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
117
114
|
return react_1.default.createElement(antd_1.Popconfirm, { placement: "right", title: props.confirm, onConfirm: props.onClick },
|
|
118
115
|
react_1.default.createElement(Icon_1.Icon, __assign({}, iconProps, { evt: true })));
|
|
119
116
|
};
|
|
120
|
-
return react_1.default.createElement(antd_1.Layout.Sider, { className: 'c-selectbar-' + utils_1.GLOBAL.CONFIG.BOX.
|
|
117
|
+
return react_1.default.createElement(antd_1.Layout.Sider, { className: 'c-selectbar-' + utils_1.GLOBAL.CONFIG.BOX.SELECTBAR_CLOSE, collapsed: collapsed, collapsedWidth: utils_1.GLOBAL.CONFIG.BOX.SELECTBAR_CLOSE == 1 ? 6 : 0, width: width },
|
|
121
118
|
react_1.default.createElement("div", { className: 'c-selectbar-closed', onClick: setCollapsed, title: utils_1.i18n.txt(_i18n_1.V.TXT_EXPAND) }),
|
|
122
119
|
react_1.default.createElement("div", { className: 'c-selectbar' },
|
|
123
120
|
react_1.default.createElement("div", { className: 'c-selectbar-head' },
|
|
@@ -41,7 +41,6 @@ var GridList = function (props) {
|
|
|
41
41
|
var grids = props.grids, dataSource = props.dataSource, loading = props.loading;
|
|
42
42
|
var itemRender = (0, react_1.useMemo)(function () {
|
|
43
43
|
if (grids.ratio) {
|
|
44
|
-
// console.log(grids.ratio)
|
|
45
44
|
}
|
|
46
45
|
return function (record, i) { return react_1.default.createElement(antd_1.List.Item, null, grids.itemRender(record, i)); };
|
|
47
46
|
}, [grids]);
|
|
@@ -73,16 +73,10 @@ var getIcon = function (icon) {
|
|
|
73
73
|
return icon;
|
|
74
74
|
};
|
|
75
75
|
var ActionButton = function (props) {
|
|
76
|
+
var btnParam = lodash_1.default.pick(props, ['type', 'danger', 'disabled']);
|
|
76
77
|
if (props.children && props.children.length > 0) {
|
|
77
|
-
var btnParam_1 = {};
|
|
78
|
-
if (lodash_1.default.has(props, 'type'))
|
|
79
|
-
btnParam_1.type = props.type;
|
|
80
|
-
if (props.danger)
|
|
81
|
-
btnParam_1.danger = true;
|
|
82
|
-
if (props.disabled)
|
|
83
|
-
btnParam_1.disabled = true;
|
|
84
78
|
if (lodash_1.default.isFunction(props.onClick))
|
|
85
|
-
|
|
79
|
+
btnParam.onClick = function (evt) { return utils_1.PageUtil.stopEvent(evt, props.onClick); };
|
|
86
80
|
var menus_1 = [];
|
|
87
81
|
props.children.map(function (item, key) {
|
|
88
82
|
if (item.roleCode && !utils_1.PageUtil.hasRole(item.roleCode))
|
|
@@ -104,20 +98,13 @@ var ActionButton = function (props) {
|
|
|
104
98
|
if (menus_1.length == 0)
|
|
105
99
|
return utils_1.Const.NONE;
|
|
106
100
|
return react_1.default.createElement(Dropdown_1.Dropdown, { menu: { items: menus_1 } },
|
|
107
|
-
react_1.default.createElement(Button_1.Button, __assign({},
|
|
101
|
+
react_1.default.createElement(Button_1.Button, __assign({}, btnParam),
|
|
108
102
|
props.label,
|
|
109
103
|
" ",
|
|
110
104
|
react_1.default.createElement(Icon_1.Icon, { type: "down" })));
|
|
111
105
|
}
|
|
112
|
-
var btnParam = {};
|
|
113
106
|
if (props.icon)
|
|
114
107
|
btnParam.icon = getIcon(props.icon);
|
|
115
|
-
if (lodash_1.default.has(props, 'type'))
|
|
116
|
-
btnParam.type = props.type;
|
|
117
|
-
if (props.disabled)
|
|
118
|
-
btnParam.disabled = true;
|
|
119
|
-
if (props.danger)
|
|
120
|
-
btnParam.danger = true;
|
|
121
108
|
if (props.confirm && props.disabled !== true) {
|
|
122
109
|
return react_1.default.createElement(Popconfirm_1.Popconfirm, { key: Math.floor(lodash_1.default.random() * 1000000) + '', trigger: "click", placement: "bottomLeft", onConfirm: props.onClick, title: lodash_1.default.isString(props.confirm) ? props.confirm : props.confirm() },
|
|
123
110
|
react_1.default.createElement(Button_1.Button, __assign({}, props.config, btnParam), props.label));
|
|
@@ -75,7 +75,7 @@ var SearchBarByKeyword = function (props) {
|
|
|
75
75
|
var searchProps = {
|
|
76
76
|
className: "c-searchbar-keyword",
|
|
77
77
|
placeholder: utils_1.i18n.txt(_i18n_1.V.INPUT_SEARCH_KEYWORD),
|
|
78
|
-
allowClear:
|
|
78
|
+
allowClear: false,
|
|
79
79
|
};
|
|
80
80
|
if (props.keyword !== true) {
|
|
81
81
|
if (props.keyword.placeholder) {
|
|
@@ -125,39 +125,3 @@ exports.BUTTON_IMPORT = BUTTON_IMPORT;
|
|
|
125
125
|
*/
|
|
126
126
|
var BUTTON_EXPORT = function (onClick, props) { return (__assign(__assign({ label: (0, i18n_1.txt)(_i18n_1.V.BTN_EXPORT), icon: 'export' }, props), { onClick: onClick })); };
|
|
127
127
|
exports.BUTTON_EXPORT = BUTTON_EXPORT;
|
|
128
|
-
// import { useLayoutEffect } from 'react';
|
|
129
|
-
// import { useUpdate } from '../../../hooks'
|
|
130
|
-
// type TableActionBar = {
|
|
131
|
-
// buttons: (TableActionButton | null | false)[],
|
|
132
|
-
// queryParam: PlainObject
|
|
133
|
-
// selectedRef: MutableRefObject<any>
|
|
134
|
-
// }
|
|
135
|
-
// export const ActionBar: FC<TableActionBar> = props => {
|
|
136
|
-
// const update = useUpdate();
|
|
137
|
-
// useLayoutEffect(() => {
|
|
138
|
-
// props.selectedRef.current.onSelected = () => {
|
|
139
|
-
// update();
|
|
140
|
-
// }
|
|
141
|
-
// }, [])
|
|
142
|
-
// const [selectedRowKeys, selectedObjects] = props.selectedRef.current.selected;
|
|
143
|
-
// const buttons = useMemo(() => {
|
|
144
|
-
// const btns = [];
|
|
145
|
-
// (props.buttons || []).map(btn => {
|
|
146
|
-
// if (btn === false) return;
|
|
147
|
-
// if (btn === null) {
|
|
148
|
-
// btns.push(null);
|
|
149
|
-
// return;
|
|
150
|
-
// }
|
|
151
|
-
// let sub = convertButton(btn, selectedRowKeys, selectedObjects, props.queryParam);
|
|
152
|
-
// if (_.isArray(btn.children) && btn.children.length > 0) {
|
|
153
|
-
// sub.children = [];
|
|
154
|
-
// btn.children.map(item => {
|
|
155
|
-
// sub.children.push(convertButton(item, selectedRowKeys, selectedObjects, props.queryParam))
|
|
156
|
-
// })
|
|
157
|
-
// }
|
|
158
|
-
// btns.push(sub);
|
|
159
|
-
// });
|
|
160
|
-
// return btns;
|
|
161
|
-
// }, [selectedRowKeys, props.buttons, props.queryParam])
|
|
162
|
-
// return <ActionButtons buttons={buttons} />
|
|
163
|
-
// }
|
|
@@ -108,7 +108,6 @@ var TableContextWrapper = function (props) {
|
|
|
108
108
|
var toRemove = new Set(diff);
|
|
109
109
|
return __assign(__assign({}, prev), { selectedRowKeys: prev.selectedRowKeys.filter(function (key) { return !toRemove.has(key); }), selectedObjects: prev.selectedObjects.filter(function (item) { return !toRemove.has(item[rowKey]); }) });
|
|
110
110
|
}); }, []);
|
|
111
|
-
// console.log(state)
|
|
112
111
|
return react_1.default.createElement(TableContext.Provider, { value: __assign(__assign({}, state), { setParam: setParam, setSelection: setSelection, initObjects: initObjects, reflushPage: reflushPage }) }, props.children);
|
|
113
112
|
};
|
|
114
113
|
exports.TableContextWrapper = TableContextWrapper;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { MutableRefObject } from 'react';
|
|
2
2
|
import type { BaseTableProps } from './index';
|
|
3
|
-
import type { ColumnProps as
|
|
3
|
+
import type { ColumnProps as ColumnType } from 'antd/es/table/interface';
|
|
4
4
|
export declare const convertColumns: (props: BaseTableProps, rank: {
|
|
5
5
|
ref: MutableRefObject<number>;
|
|
6
6
|
isRank?: boolean;
|
|
7
|
-
}) => Array<
|
|
7
|
+
}) => Array<ColumnType<any>>;
|
|
@@ -240,7 +240,6 @@ var _VTable = (0, react_1.forwardRef)(function (props) {
|
|
|
240
240
|
var VTableRoot = (0, react_1.forwardRef)(function (props, ref) {
|
|
241
241
|
var _a = props.model, isQuerying = _a.isQuerying, pageNo = _a.pageNo, pageSize = _a.pageSize, total = _a.total, totalAcc = _a.totalAcc, pageTo = _a.pageTo, query = _a.query, cost = _a.cost;
|
|
242
242
|
var _b = (0, useTableContext_1.useTableContext)(), selectedRowKeys = _b.selectedRowKeys, selectedObjects = _b.selectedObjects, param = _b.param, setSelection = _b.setSelection, setParam = _b.setParam;
|
|
243
|
-
// console.log(selectedRowKeys)
|
|
244
243
|
(0, react_1.useImperativeHandle)(ref, function () {
|
|
245
244
|
return {
|
|
246
245
|
clearSelected: function () { return setSelection([], []); },
|
|
@@ -261,7 +260,9 @@ var VTableRoot = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
261
260
|
}
|
|
262
261
|
}
|
|
263
262
|
if (props.searchBar) {
|
|
264
|
-
boxProps.searchBar = __assign(__assign({}, props.searchBar), {
|
|
263
|
+
boxProps.searchBar = __assign(__assign({}, props.searchBar), {
|
|
264
|
+
// disabled: isQuerying,
|
|
265
|
+
onSearch: function (data) {
|
|
265
266
|
var queryParam = lodash_1.default.extend({}, props.model.param, data);
|
|
266
267
|
query(queryParam, true);
|
|
267
268
|
setParam(queryParam, utils_1.GLOBAL.CONFIG.TABLE.UNSELECT_ON_QUERY);
|
|
@@ -283,6 +284,7 @@ var VTableRoot = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
283
284
|
// props.searchBand,
|
|
284
285
|
props.actionBar,
|
|
285
286
|
props.selectBar,
|
|
287
|
+
// isQuerying
|
|
286
288
|
// props.className,
|
|
287
289
|
// props.style,
|
|
288
290
|
// props.mode
|
|
@@ -193,7 +193,11 @@ var _Actiontree = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
193
193
|
var treeData = treeState.treeData;
|
|
194
194
|
var node = lodash_1.default.get(treeData, nodePath);
|
|
195
195
|
if (node == null) {
|
|
196
|
-
|
|
196
|
+
if (props.canAddRoot != true) {
|
|
197
|
+
// message.error('No parent found')
|
|
198
|
+
return;
|
|
199
|
+
}
|
|
200
|
+
addRoot(data, { pos: INSER_POS.AFTER, position: [] });
|
|
197
201
|
return;
|
|
198
202
|
}
|
|
199
203
|
add(data, { pos: INSER_POS.INNER, node: node, position: position });
|
|
@@ -117,7 +117,7 @@ var BaseTree = function (props) {
|
|
|
117
117
|
langs: null,
|
|
118
118
|
folderChecker: null,
|
|
119
119
|
};
|
|
120
|
-
if (props
|
|
120
|
+
if (lodash_1.default.has(props, 'rootCode'))
|
|
121
121
|
DEFAULT.rootCode = props.rootCode;
|
|
122
122
|
if (props.keyField)
|
|
123
123
|
DEFAULT.keyField = props.keyField;
|
|
@@ -119,7 +119,7 @@ var _Stree = function (props) {
|
|
|
119
119
|
// 如果根节点只有一个,则自动展开这个根结点
|
|
120
120
|
treeProps.defaultExpandedKeys = [treeState.treeData[0][treeState.keyField]];
|
|
121
121
|
}
|
|
122
|
-
return react_1.default.createElement(antd_1.Tree, __assign({}, baseProps, treeProps, { disabled: props.disabled, selectedKeys: treeState.selectedKeys, onSelect: onSelect }), renderRoot(props, treeState));
|
|
122
|
+
return react_1.default.createElement(antd_1.Tree, __assign({}, baseProps, treeProps, { showLine: true, disabled: props.disabled, selectedKeys: treeState.selectedKeys, onSelect: onSelect }), renderRoot(props, treeState));
|
|
123
123
|
};
|
|
124
124
|
var renderNode = function (node, position, state, search, disabledNode, folderChecker) {
|
|
125
125
|
if (search.keyword && !search.match.has(position.join('-')))
|
|
@@ -71,6 +71,7 @@ var LAYOUTS = {
|
|
|
71
71
|
compress: [1080, 3, 9],
|
|
72
72
|
};
|
|
73
73
|
var COLS_SPLIT = 8;
|
|
74
|
+
// const FONT_SIZE = 12;
|
|
74
75
|
var getDefault = function (props) {
|
|
75
76
|
var _a, _b;
|
|
76
77
|
var isGroup = lodash_1.default.has(props.fields[0], 'fields');
|
|
@@ -88,6 +89,8 @@ var getDefault = function (props) {
|
|
|
88
89
|
}
|
|
89
90
|
_b = __read((col > COLS_SPLIT) ? LAYOUTS.common : LAYOUTS.simple, 3), width = _b[0], cols = _b[1], colMax = _b[2];
|
|
90
91
|
}
|
|
92
|
+
if (lodash_1.default.isNumber(props.width))
|
|
93
|
+
width = props.width;
|
|
91
94
|
return [isGroup, width, cols, colMax];
|
|
92
95
|
};
|
|
93
96
|
exports.getDefault = getDefault;
|
|
@@ -135,6 +138,8 @@ var getFormLayout = function (props, root) {
|
|
|
135
138
|
return [isGroup, cols, width, colMax, isInfo, isEdit, isAdd];
|
|
136
139
|
};
|
|
137
140
|
var getMaxTitleWidth = function (field) {
|
|
141
|
+
if (field.dataType == 'NONE')
|
|
142
|
+
return 0;
|
|
138
143
|
if (field.type && (0, _register_1.getUFormInput)(field.type).breakTitle)
|
|
139
144
|
return 0;
|
|
140
145
|
var title = null;
|
|
@@ -93,7 +93,7 @@ var UForm_1 = require("./UForm");
|
|
|
93
93
|
var utils_1 = require("../../utils");
|
|
94
94
|
var _i18n_1 = require("../_i18n");
|
|
95
95
|
var FormWrapper_1 = require("./FormWrapper");
|
|
96
|
-
var FORM_FIELDS = ['layout', 'fields', 'groupType', 'isEdit', 'tip', 'default', 'data', 'mode', 'size'];
|
|
96
|
+
var FORM_FIELDS = ['layout', 'fields', 'groupType', 'isEdit', 'tip', 'default', 'data', 'mode', 'size', 'width'];
|
|
97
97
|
var UFormModal = function (props) {
|
|
98
98
|
var ref = (0, react_1.useRef)(null);
|
|
99
99
|
var modalProps = {
|
|
@@ -208,7 +208,7 @@ var UFormModal = function (props) {
|
|
|
208
208
|
});
|
|
209
209
|
}
|
|
210
210
|
}
|
|
211
|
-
return react_1.default.createElement(Modal_1.Modal, __assign({ maskClosable: utils_1.GLOBAL.CONFIG.FORM.maskClosable, destroyOnClose: true }, lodash_1.default.omit(props, FORM_FIELDS), { className: utils_1.StringUtil.className(['u-form-modal'], props.className), onCancel: function () { return props.onCancel(); } }, modalProps),
|
|
211
|
+
return react_1.default.createElement(Modal_1.Modal, __assign({ maskClosable: utils_1.GLOBAL.CONFIG.FORM.maskClosable, destroyOnClose: true, width: props.width }, lodash_1.default.omit(props, FORM_FIELDS), { className: utils_1.StringUtil.className(['u-form-modal'], props.className), onCancel: function () { return props.onCancel(); } }, modalProps),
|
|
212
212
|
react_1.default.createElement(UForm_1.UForm, __assign({}, lodash_1.default.pick(props, FORM_FIELDS), { ref: ref })));
|
|
213
213
|
};
|
|
214
214
|
exports.UFormModal = UFormModal;
|
|
@@ -74,6 +74,7 @@ exports._FieldType = [
|
|
|
74
74
|
'radio',
|
|
75
75
|
'radio-button',
|
|
76
76
|
'radio-with-more',
|
|
77
|
+
// 'segmented', 仅2.0
|
|
77
78
|
'checkbox',
|
|
78
79
|
'checkbox-with-all',
|
|
79
80
|
'icon',
|
|
@@ -115,6 +116,6 @@ exports._FieldType = [
|
|
|
115
116
|
'role',
|
|
116
117
|
'roles',
|
|
117
118
|
// CEMS 专用
|
|
118
|
-
// 'cems-org', // org 为2.0 专属
|
|
119
|
+
// 'cems-org', // cems-org 为2.0 专属
|
|
119
120
|
'cems-org-button',
|
|
120
121
|
];
|
|
@@ -312,7 +312,7 @@ export type UFromAction = ButtonProps & {
|
|
|
312
312
|
* 新版本 ModalProps 只支持 open 且必传,
|
|
313
313
|
* 不使用 deprecated 属性
|
|
314
314
|
*/
|
|
315
|
-
export type UModalProps = UFromProps & Omit<ModalProps, 'children'> & {
|
|
315
|
+
export type UModalProps = UFromProps & Omit<ModalProps, 'children' | 'width'> & {
|
|
316
316
|
/**
|
|
317
317
|
* open 为必填项,不使用废弃的 visable 属性
|
|
318
318
|
*/
|
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"vap1","version":"0.5.
|
|
1
|
+
{"name":"vap1","version":"0.5.7","description":"vap1, Both support MicroService and SAP FrameWork, Support IE>9","main":"index.js","author":"Xiang da","license":"ISC"}
|
package/utils/Global.d.ts
CHANGED
|
@@ -122,7 +122,12 @@ export type GlobalSetting = {
|
|
|
122
122
|
TIME_FORMAT: string;
|
|
123
123
|
};
|
|
124
124
|
BOX: {
|
|
125
|
+
/**
|
|
126
|
+
* @deprecated
|
|
127
|
+
*/
|
|
125
128
|
SELECT_CLOSE: 1 | 2;
|
|
129
|
+
SELECTBAR_CLOSE: 1 | 2;
|
|
130
|
+
SELECTBAR_WIDTH: number;
|
|
126
131
|
};
|
|
127
132
|
/**
|
|
128
133
|
* 通用上传服务,默认为微服务版的配置,单机版需要在 portal 里面定制一下
|
package/utils/Global.js
CHANGED
|
@@ -59,7 +59,7 @@ var DEFAULT = {
|
|
|
59
59
|
RESULT: { code: 'code', message: 'message', success: '0' },
|
|
60
60
|
VLIST: { list: 'list', total: 'total', totalAcc: 'totalAcc', start: 'start_', count: 'count_', order: 'order_', by: 'by_' },
|
|
61
61
|
VDATA: { data: 'data' },
|
|
62
|
-
BOX: { SELECT_CLOSE: 2 },
|
|
62
|
+
BOX: { SELECT_CLOSE: 2, SELECTBAR_CLOSE: 2, SELECTBAR_WIDTH: 250 },
|
|
63
63
|
AJAX: {
|
|
64
64
|
timeout: 30000,
|
|
65
65
|
beforeSend: null,
|
|
File without changes
|