vap1 0.4.2 → 0.4.4
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/_mixin.scss +89 -0
- package/components/Box/Box.d.ts +3 -3
- package/components/Box/Box.js +39 -30
- package/components/Box/SelectBar.d.ts +3 -3
- package/components/Lists/SList.d.ts +4 -5
- package/components/Lists/SList.js +1 -2
- package/components/SearchBar/ActionButtons.d.ts +4 -4
- package/components/SearchBar/ActionButtons.js +26 -3
- package/components/SearchBar/ByField.d.ts +1 -1
- package/components/SearchBar/ByField.js +2 -2
- package/components/SearchBar/ByKeyword.d.ts +2 -2
- package/components/SearchBar/ByKeyword.js +2 -2
- package/components/SearchBar/SearchField.d.ts +2 -2
- package/components/SearchBar/index.js +1 -1
- package/components/Tables/Components/ActionBar.d.ts +2 -3
- package/components/Tables/Components/Actions.d.ts +7 -7
- package/components/Tables/Components/Actions.js +4 -4
- package/components/Tables/Components/index.d.ts +6 -6
- package/components/Tables/TopTable.d.ts +2 -2
- package/components/Tables/TopTable.js +5 -19
- package/components/Tables/TopTableModal.d.ts +2 -2
- package/components/Tables/TopTableModal.js +1 -1
- package/components/Tables/Util.d.ts +5 -1
- package/components/Tables/Util.js +69 -2
- package/components/Tables/VTable.js +45 -74
- package/components/Tables/index.d.ts +5 -4
- package/components/TreeSelect/BaseTreeSelect.d.ts +3 -3
- package/components/TreeSelect/BaseTreeSelect.js +8 -5
- package/components/TreeSelect/DTreeSelect.d.ts +2 -2
- package/components/TreeSelect/DTreeSelect.js +1 -1
- package/components/TreeSelect/FTreeSelect.d.ts +2 -2
- package/components/TreeSelect/STreeSelect.d.ts +2 -2
- package/components/Trees/BaseTree.d.ts +2 -2
- package/components/Trees/COTree/COButton.js +1 -1
- package/components/Trees/COTree/COSelect.js +1 -1
- package/components/Trees/COTree/COTreeUtil.d.ts +2 -1
- package/components/Trees/COTree/COTreeUtil.js +1 -1
- package/components/Trees/DTree.d.ts +7 -0
- package/components/Trees/FTree.d.ts +2 -3
- package/components/Trees/STree.d.ts +2 -2
- package/components/UForm/FormWrapper.d.ts +2 -3
- package/components/UForm/UDescriptions.d.ts +2 -1
- package/components/UForm/UDescriptions.js +28 -5
- package/components/UForm/UForm.js +4 -4
- package/components/UForm/UFormModal.d.ts +2 -2
- package/components/UForm/UInfo.d.ts +2 -2
- package/components/UForm/UInfoModal.d.ts +2 -2
- package/components/UForm/UInfoModal.js +1 -1
- package/components/UForm/UModal.d.ts +2 -2
- package/components/UForm/_FieldType.d.ts +1 -1
- package/components/UForm/_FieldType.js +4 -0
- package/components/UForm/_input.d.ts +3 -3
- package/components/UForm/_input.js +2 -2
- package/components/UForm/_register.d.ts +2 -3
- package/components/UForm/index.d.ts +16 -13
- package/components/Upload/UploadFile.d.ts +2 -2
- package/components/Upload/UploadImage.d.ts +2 -2
- package/components/Upload/UploadImage.js +1 -1
- package/components/Upload/UploadModal.d.ts +4 -4
- package/components/Upload/UploadModal.js +2 -2
- package/components/Upload/useUpload.d.ts +2 -2
- package/components/Upload/useUpload.js +1 -1
- package/components/_RegisterUtil.d.ts +1 -1
- package/components/_RegisterUtil.js +2 -2
- package/components/_adapt/Alert.d.ts +2 -3
- package/components/_adapt/Button.d.ts +3 -4
- package/components/_adapt/Col.d.ts +8 -8
- package/components/_adapt/ColorPicker.js +2 -2
- package/components/_adapt/ConfigProvider.d.ts +3 -3
- package/components/_adapt/Drawer.d.ts +2 -3
- package/components/_adapt/Drawer.js +2 -2
- package/components/_adapt/FloatButton.d.ts +5 -5
- package/components/_adapt/Form.js +3 -3
- package/components/_adapt/Icon.d.ts +2 -1
- package/components/_adapt/Image.js +1 -1
- package/components/_adapt/Layout.d.ts +1 -2
- package/components/_adapt/Layout.js +1 -1
- package/components/_adapt/Menu.d.ts +5 -6
- package/components/_adapt/Menu.js +25 -2
- package/components/_adapt/Modal.d.ts +2 -1
- package/components/_adapt/Modal.js +1 -1
- package/components/_adapt/Progress.d.ts +3 -2
- package/components/_adapt/Progress.js +1 -1
- package/components/_adapt/Row.d.ts +2 -2
- package/components/_adapt/Select.js +1 -1
- package/components/_adapt/Slider.d.ts +7 -7
- package/components/_adapt/Space.d.ts +4 -3
- package/components/_adapt/Table.d.ts +5 -5
- package/components/_adapt/Tabs.d.ts +2 -3
- package/components/_adapt/Tag.js +25 -2
- package/components/_adapt/utils.js +10 -10
- package/components/_common/AutoComplete.d.ts +3 -3
- package/components/_common/CountUp.d.ts +3 -3
- package/components/_common/CountUp.js +1 -1
- package/components/_common/DateRange.d.ts +2 -2
- package/components/_common/HighLight.d.ts +2 -2
- package/components/_common/HighLight.js +1 -1
- package/components/_common/I18N.d.ts +2 -2
- package/components/_common/Loading.d.ts +3 -3
- package/components/_common/MonthRange.d.ts +2 -2
- package/components/_common/PromiseLabel.d.ts +4 -4
- package/components/_common/UTitle.d.ts +6 -5
- package/components/_common/UTitle.js +25 -2
- package/components/_common/Upagination.d.ts +2 -2
- package/deps/JsonView.d.ts +2 -2
- package/deps/JsonView.js +5 -2
- package/deps/app-audit/LookUp.d.ts +3 -3
- package/deps/app-audit/LookUp.js +2 -2
- package/deps/app-data/useSource.js +2 -2
- package/deps/echarts.d.ts +2 -2
- package/deps/editor/Article.d.ts +3 -3
- package/deps/editor/support/buttons/ImageButton.d.ts +2 -2
- package/deps/editor/support/buttons/ImageButton.js +1 -1
- package/deps/editor/tools/Button.d.ts +2 -2
- package/deps/editor/tools/Button.js +1 -1
- package/deps/editor/tools/ToolBar.d.ts +2 -2
- package/deps/editor/tools/_BlockButton.d.ts +2 -2
- package/deps/editor/tools/_InsertButton.d.ts +4 -4
- package/deps/editor/tools/_MarkButton.d.ts +2 -2
- package/deps/editor/tools/_TxtButton.d.ts +6 -6
- package/deps/editor/tools/_TxtButton.js +25 -5
- package/deps/editor/types.d.ts +2 -2
- package/deps/editor/utils/index.js +0 -5
- package/hooks/useApiBase.js +1 -1
- package/hooks/useApp.d.ts +4 -4
- package/hooks/useApp.js +1 -1
- package/hooks/useArray.js +5 -7
- package/hooks/useHover.d.ts +3 -3
- package/hooks/useHover.js +2 -25
- package/package.json +1 -1
- package/screen/Comment.d.ts +3 -3
- package/screen/EchartContent.js +2 -2
- package/screen/Page.d.ts +2 -2
- package/screen/render.d.ts +2 -2
- package/uform/FormEditor.d.ts +2 -2
- package/uform/FormEditor.js +3 -2
- package/uform/inputs/_date.js +1 -1
- package/uform/inputs/_input.js +1 -1
- package/uform/inputs/_select.js +1 -1
- package/uform/inputs/register.d.ts +2 -2
- package/uform/panel/Editor/GroupEditor.js +3 -3
- package/uform/panel/Editor/_GroupCollapse.js +3 -3
- package/uform/panel/Editor/_GroupDefault.js +24 -4
- package/uform/panel/Editor/_GroupStep.js +28 -5
- package/uform/panel/Editor/_GroupTab.js +25 -2
- package/uform/panel/Editor/index.js +1 -1
- package/uform/panel/Items/Fields.d.ts +2 -2
- package/uform/panel/Items/Fields.js +3 -1
- package/uform/panel/Items/InputSelector.d.ts +2 -2
- package/uform/panel/Items/InputSelector.js +2 -1
- package/uform/panel/Items/Inputs.d.ts +2 -1
- package/uform/panel/Items/Inputs.js +24 -4
- package/uform/panel/Propreties/CanvasProperties.js +25 -2
- package/uform/panel/Propreties/Component/FieldPlugin.d.ts +2 -2
- package/uform/panel/Propreties/Component/FieldPlugin.js +1 -1
- package/uform/panel/Propreties/Component/LinkAsyncFunction.d.ts +2 -2
- package/uform/panel/Propreties/Component/LinkAsyncFunction.js +1 -1
- package/uform/panel/Propreties/Component/LinkSyncFunction.d.ts +2 -2
- package/uform/panel/Propreties/Component/LinkSyncFunction.js +1 -1
- package/uform/panel/Propreties/Component/Links.js +1 -1
- package/uform/panel/Propreties/Component/OptionTable.js +25 -5
- package/uform/panel/Propreties/Component/RegexpModal.d.ts +2 -2
- package/uform/panel/Propreties/Component/Validate.js +1 -1
- package/uform/panel/Propreties/Component/ValidateAsyncFunction.d.ts +2 -2
- package/uform/panel/Propreties/Component/ValidateAsyncFunction.js +25 -2
- package/uform/panel/Propreties/Component/ValidateSyncFunction.d.ts +2 -2
- package/uform/panel/Propreties/Component/ValidateSyncFunction.js +25 -2
- package/uform/panel/Propreties/FieldProperties.js +1 -1
- package/uform/panel/Propreties/_ItemAdvance.js +25 -2
- package/uform/panel/Propreties/_ItemBase.js +1 -1
- package/uform/panel/Propreties/_ItemLink.js +24 -4
- package/uform/panel/Propreties/_ItemValidate.js +24 -4
- package/uform/utils/Convert.js +9 -9
- package/utils/CacheUtil.d.ts +4 -4
- package/utils/CacheUtil.js +15 -15
- package/utils/Const.d.ts +3 -2
- package/utils/Const.js +26 -5
- package/utils/CustomApp.d.ts +3 -3
- package/utils/Format.js +2 -1
- package/utils/Renders/ApiGetRender.js +24 -19
- package/utils/Renders/ApiPostRender.js +2 -2
- package/utils/Renders/CondictionRender.d.ts +5 -0
- package/utils/Renders/CondictionRender.js +163 -0
- package/utils/Renders/DateRender.js +5 -5
- package/utils/Renders/DictRender.js +5 -6
- package/utils/Renders/FileRender.d.ts +2 -1
- package/utils/Renders/FileRender.js +5 -5
- package/utils/Renders/ListRender.js +10 -10
- package/utils/Renders/NumberRender.js +4 -4
- package/utils/Renders/StatusRender.js +2 -2
- package/utils/Renders/StringRender.js +4 -4
- package/utils/Renders/_DictBaseRender.d.ts +1 -1
- package/utils/Renders/_DictBaseRender.js +23 -23
- package/utils/Renders/_define.d.ts +16 -6
- package/utils/Renders/_define.js +9 -14
- package/utils/Renders/index.d.ts +1 -0
- package/utils/Renders/index.js +3 -1
- package/utils/StringUtil.d.ts +4 -4
- package/utils/StringUtil.js +15 -14
- package/utils/VAP.d.ts +4 -4
- package/utils/VAP.js +8 -40
- package/utils/i18n.d.ts +3 -3
- package/widget/index.d.ts +2 -2
package/_mixin.scss
ADDED
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
@use "sass:math";
|
|
2
|
+
@use "sass:map";
|
|
3
|
+
@use 'sass:list';
|
|
4
|
+
@use "sass:string";
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* 本文件提供一些常用的 sass 工具。
|
|
8
|
+
目前仅提供一个 @mixin : field-width : Table Column 列宽度稳定器。
|
|
9
|
+
支持 3-4 个参数 ($font-setting, $field-name, $min, $max)
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
/***
|
|
13
|
+
宽度设置说明:
|
|
14
|
+
正常(紧凑皮肤系列)版本,每个 汉字 12px 每个数字约 7.2px , 每个英文字母约 7.8px
|
|
15
|
+
暗色系皮肤 +1px
|
|
16
|
+
说明,以最小字数 = MIN(标题,内容),例如,标题为 ”性别“,内容只可能是 一个字,时,以两个字为最小字数
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
@function classNames($fileds) {
|
|
20
|
+
$clazz: '';
|
|
21
|
+
|
|
22
|
+
@each $field in $fileds {
|
|
23
|
+
$clazz: "#{$clazz},.table-col-#{$field}"
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
@return string.slice($clazz, 2);
|
|
27
|
+
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
@function columnBaseWidth($font, $count) {
|
|
32
|
+
$charWidth: map.get($font, "char");
|
|
33
|
+
$letterWidth: map.get($font, "letter");
|
|
34
|
+
$numberWidth: map.get($font, "number");
|
|
35
|
+
$paddingWidth: map.get($font, "padding");
|
|
36
|
+
|
|
37
|
+
$charCount: 0;
|
|
38
|
+
$letterCount: 0;
|
|
39
|
+
$numberCount: 0;
|
|
40
|
+
|
|
41
|
+
@if map-has-key($count , "char") {
|
|
42
|
+
$charCount: map.get($count, "char");
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
@if map-has-key($count , "letter") {
|
|
46
|
+
$letterCount: map.get($count, "letter");
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
@if map-has-key($count , "number") {
|
|
50
|
+
$numberCount: map.get($count, "number");
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
@return ($charCount * $charWidth)+($numberCount * $numberWidth)+($letterCount * $letterWidth)+$paddingWidth;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
@function columnDefine($count) {
|
|
57
|
+
@if type-of($count)=='map' {
|
|
58
|
+
@return $count;
|
|
59
|
+
}
|
|
60
|
+
@return (char :$count, number: 0, letter :0)
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
@mixin field-width($font, $field, $min, $max : null) {
|
|
65
|
+
$clazz : "";
|
|
66
|
+
$minWidth : columnBaseWidth($font, columnDefine($min));
|
|
67
|
+
|
|
68
|
+
@if type-of($field)=="list" {
|
|
69
|
+
$clazz : classNames($field);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
@else {
|
|
73
|
+
$clazz: ".table-col-#{$field}";
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
#{$clazz} {
|
|
77
|
+
min-width: math.ceil($minWidth + 6px);
|
|
78
|
+
|
|
79
|
+
@if type-of($max) !='null' {
|
|
80
|
+
max-width: columnBaseWidth($font, columnDefine($max));
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
&.c-table-col-has-sorter {
|
|
84
|
+
min-width: math.ceil($minWidth + 18px);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
}
|
|
89
|
+
|
package/components/Box/Box.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type { MutableRefObject } from 'react';
|
|
2
|
+
import type { MutableRefObject, ReactNode, CSSProperties } from 'react';
|
|
3
3
|
import type { SelectBarProps } from './SelectBar';
|
|
4
4
|
import type { SearchBarProps } from '../SearchBar';
|
|
5
5
|
import type { ActButton } from '../SearchBar/ActionButtons';
|
|
@@ -78,7 +78,7 @@ export type BoxProps = {
|
|
|
78
78
|
/**
|
|
79
79
|
* 自定义 className
|
|
80
80
|
*/
|
|
81
|
-
style?:
|
|
81
|
+
style?: CSSProperties;
|
|
82
82
|
/**
|
|
83
83
|
* 展示模式
|
|
84
84
|
*/
|
|
@@ -94,7 +94,7 @@ export type BoxProps = {
|
|
|
94
94
|
/**
|
|
95
95
|
* 操作区域
|
|
96
96
|
*/
|
|
97
|
-
actionBar?: (ActButton[]) |
|
|
97
|
+
actionBar?: (ActButton[]) | ReactNode;
|
|
98
98
|
/**
|
|
99
99
|
* 分页区域
|
|
100
100
|
*/
|
package/components/Box/Box.js
CHANGED
|
@@ -94,36 +94,45 @@ exports.Box = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
94
94
|
var rootRef = (0, react_1.useRef)(null);
|
|
95
95
|
var contextRef = (0, react_1.useRef)(null);
|
|
96
96
|
var selectRef = (0, react_1.useRef)(null);
|
|
97
|
-
var
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
var
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
97
|
+
var mode = (0, react_1.useMemo)(function () {
|
|
98
|
+
return props.mode || 'common';
|
|
99
|
+
}, [props.mode]);
|
|
100
|
+
var className = (0, react_1.useMemo)(function () {
|
|
101
|
+
var clazz = ['c-box'];
|
|
102
|
+
clazz.push('c-box-nobg');
|
|
103
|
+
clazz.push('c-box-' + mode);
|
|
104
|
+
if (props.className)
|
|
105
|
+
clazz.push(props.className);
|
|
106
|
+
return clazz.join(' ');
|
|
107
|
+
}, [props.className, props.nobg, mode]);
|
|
108
|
+
var style = (0, react_1.useMemo)(function () {
|
|
109
|
+
var css = __assign({}, props.style);
|
|
110
|
+
if (mode == 'inner') {
|
|
111
|
+
if (rootRef.current == null) {
|
|
112
|
+
css.display = 'none';
|
|
113
|
+
}
|
|
114
|
+
else {
|
|
115
|
+
var container = utils_1.PageUtil.getParentByClassName(rootRef.current.parentElement, 'c-box');
|
|
116
|
+
css.height = Math.floor(container.parentElement.getBoundingClientRect().height);
|
|
117
|
+
}
|
|
115
118
|
}
|
|
116
|
-
else {
|
|
117
|
-
|
|
119
|
+
else if (mode == 'fixed') {
|
|
120
|
+
if (app != null) {
|
|
121
|
+
css.height = app.theme.contentHeight;
|
|
122
|
+
}
|
|
123
|
+
else {
|
|
124
|
+
css.height = '100%';
|
|
125
|
+
}
|
|
118
126
|
}
|
|
119
|
-
|
|
127
|
+
return css;
|
|
128
|
+
}, [props.style, mode, state === null || state === void 0 ? void 0 : state.height]);
|
|
120
129
|
(0, react_1.useEffect)(function () {
|
|
121
130
|
if (state && state.height && contextRef && contextRef.current) {
|
|
122
131
|
contextRef.current.style.height = (state.height + 'px');
|
|
123
132
|
}
|
|
124
133
|
}, [state === null || state === void 0 ? void 0 : state.height]);
|
|
125
|
-
var resize = function () {
|
|
126
|
-
if (
|
|
134
|
+
var resize = (0, react_1.useCallback)(function () {
|
|
135
|
+
if (mode == 'common' || app == null) {
|
|
127
136
|
if (state === null)
|
|
128
137
|
setState({});
|
|
129
138
|
return;
|
|
@@ -134,7 +143,7 @@ exports.Box = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
134
143
|
return;
|
|
135
144
|
document.body.classList.add('v-resizing');
|
|
136
145
|
var total = el.getBoundingClientRect().height;
|
|
137
|
-
if (
|
|
146
|
+
if (mode == 'inner') {
|
|
138
147
|
total = el.parentElement.parentElement.getBoundingClientRect().height;
|
|
139
148
|
}
|
|
140
149
|
var children = el.children;
|
|
@@ -147,15 +156,15 @@ exports.Box = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
147
156
|
total -= child.getBoundingClientRect().height;
|
|
148
157
|
}
|
|
149
158
|
}
|
|
150
|
-
setState({ height: Math.floor(total) });
|
|
151
159
|
document.body.classList.remove('v-resizing');
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
(0, react_1.
|
|
160
|
+
setState({ height: Math.floor(total) });
|
|
161
|
+
}, [mode]);
|
|
162
|
+
(0, react_1.useEffect)(function () { setTimeout(resize, 120); }, [app === null || app === void 0 ? void 0 : app.theme.contentHeight]); // 1.5 版本:延时 120ms
|
|
163
|
+
(0, react_1.useImperativeHandle)(ref, function () { return ({ resize: resize }); }, [mode]);
|
|
155
164
|
(0, react_1.useLayoutEffect)(function () {
|
|
156
165
|
setTimeout(resize, 5);
|
|
157
166
|
}, []);
|
|
158
|
-
return react_1.default.createElement(Layout_1.Layout, { id: domId, className:
|
|
167
|
+
return react_1.default.createElement(Layout_1.Layout, { id: domId, className: className, style: style, ref: _layoutRef },
|
|
159
168
|
props.selectBar && (0, _register_1.getSelectBar)(props.selectBar.type) != null && react_1.default.createElement(SelectBar_1.SelectBar, __assign({}, props.selectBar, { ref: props.selectBar.selectRef ? props.selectBar.selectRef : selectRef, onSelect: function () {
|
|
160
169
|
var args = [];
|
|
161
170
|
for (var _a = 0; _a < arguments.length; _a++) {
|
|
@@ -178,7 +187,7 @@ exports.Box = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
178
187
|
} },
|
|
179
188
|
(props.searchBar ||
|
|
180
189
|
(props.actionBar && ((lodash_1.default.isArray(props.actionBar) && props.actionBar.length > 0)
|
|
181
|
-
|| (!lodash_1.default.isArray(props.actionBar) && react_1.
|
|
190
|
+
|| (!lodash_1.default.isArray(props.actionBar) && (0, react_1.isValidElement)(props.actionBar))))) && react_1.default.createElement(SearchBar_1.SearchBar, __assign({}, props.searchBar, { default: props.default, className: HEIGHT_OMIT, onExpand: function (isExpand) {
|
|
182
191
|
resize();
|
|
183
192
|
if (lodash_1.default.isFunction(props.searchBar.onExpand)) {
|
|
184
193
|
props.searchBar.onExpand(isExpand);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type { ComponentType } from 'react';
|
|
2
|
+
import type { ComponentType, MutableRefObject, ReactNode } from 'react';
|
|
3
3
|
import type { Key, BaseItem, PlainObject } from '../../basetype';
|
|
4
4
|
import type { STreeProps } from '../Trees/STree';
|
|
5
5
|
import type { DTreeProps } from '../Trees/DTree';
|
|
@@ -21,7 +21,7 @@ type SelectBarAction = BaseItem & {
|
|
|
21
21
|
/**
|
|
22
22
|
* 如需二次确定,传提示消息
|
|
23
23
|
*/
|
|
24
|
-
confirm?:
|
|
24
|
+
confirm?: ReactNode;
|
|
25
25
|
};
|
|
26
26
|
type _BoxSelectBarProps = BaseItem & {
|
|
27
27
|
/**
|
|
@@ -63,7 +63,7 @@ type _BoxSelectBarProps = BaseItem & {
|
|
|
63
63
|
/**
|
|
64
64
|
* 选择区映射,用于一些特殊场景
|
|
65
65
|
*/
|
|
66
|
-
selectRef?:
|
|
66
|
+
selectRef?: MutableRefObject<any>;
|
|
67
67
|
};
|
|
68
68
|
/**
|
|
69
69
|
* 说明: 内置 stree/dtree/ftree 三种树类型,和 list 类型
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import
|
|
1
|
+
import type { FC, CSSProperties, ReactNode } from 'react';
|
|
2
2
|
import type { PlainObject, Key } from '../../basetype';
|
|
3
|
-
import type { ReactNode } from 'react';
|
|
4
3
|
import type { IconProps } from '../_adapt/Icon';
|
|
5
4
|
type ItemRenderFunction = (record: PlainObject, searchValue?: string) => ReactNode;
|
|
6
5
|
export type SListProps = {
|
|
7
|
-
style?:
|
|
6
|
+
style?: CSSProperties;
|
|
8
7
|
className?: string;
|
|
9
8
|
/**
|
|
10
9
|
* key 字段,默认为ID
|
|
@@ -38,7 +37,7 @@ export type SListProps = {
|
|
|
38
37
|
*
|
|
39
38
|
*/
|
|
40
39
|
renders?: {
|
|
41
|
-
icon?: (record: PlainObject, searchValue?: string) => IconProps | string |
|
|
40
|
+
icon?: (record: PlainObject, searchValue?: string) => IconProps | string | ReactNode;
|
|
42
41
|
title: ItemRenderFunction;
|
|
43
42
|
value?: ItemRenderFunction;
|
|
44
43
|
action?: ItemRenderFunction;
|
|
@@ -56,5 +55,5 @@ export type SListProps = {
|
|
|
56
55
|
*/
|
|
57
56
|
mustSelect?: true | ((list: PlainObject[]) => PlainObject);
|
|
58
57
|
};
|
|
59
|
-
export declare const SList:
|
|
58
|
+
export declare const SList: FC<SListProps>;
|
|
60
59
|
export {};
|
|
@@ -78,7 +78,7 @@ var ItemIcon = function (props) {
|
|
|
78
78
|
}
|
|
79
79
|
return react_1.default.createElement(Icon_1.Icon, __assign({}, props_1));
|
|
80
80
|
}
|
|
81
|
-
if (react_1.
|
|
81
|
+
if ((0, react_1.isValidElement)(value)) {
|
|
82
82
|
return value;
|
|
83
83
|
}
|
|
84
84
|
return utils_1.Const.NONE;
|
|
@@ -113,7 +113,6 @@ var buildRenderByField = function (props) {
|
|
|
113
113
|
valueField && react_1.default.createElement("span", { className: 'v-select-list-item-value' }, item[valueField]));
|
|
114
114
|
};
|
|
115
115
|
};
|
|
116
|
-
// export const SList: React.FC<SListPorps> = memo((props) => {
|
|
117
116
|
exports.SList = (0, react_1.memo)(function (props) {
|
|
118
117
|
var searchValue = props.searchValue, onSelect = props.onSelect, keyField = props.keyField;
|
|
119
118
|
var _a = __read((0, react_1.useState)((lodash_1.default.has(props, 'list') && lodash_1.default.isArray(props.list)) ? props.list : []), 2), list = _a[0], setList = _a[1];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import type { FC, ReactNode } from 'react';
|
|
2
2
|
import type { ButtonType } from '../_adapt/_Antd5';
|
|
3
3
|
import type { ButtonProps } from '../_adapt/Button';
|
|
4
4
|
import type { ButtonSize } from 'antd/es/button';
|
|
@@ -6,7 +6,7 @@ export type ActButton = {
|
|
|
6
6
|
/**
|
|
7
7
|
* Icon 图标
|
|
8
8
|
*/
|
|
9
|
-
icon?: string |
|
|
9
|
+
icon?: string | ReactNode;
|
|
10
10
|
/**
|
|
11
11
|
* 按钮样式类型
|
|
12
12
|
*/
|
|
@@ -26,7 +26,7 @@ export type ActButton = {
|
|
|
26
26
|
/**
|
|
27
27
|
* 提示信息
|
|
28
28
|
*/
|
|
29
|
-
confirm?: string | ((props?: any) => string |
|
|
29
|
+
confirm?: string | ((props?: any) => string | ReactNode);
|
|
30
30
|
/**
|
|
31
31
|
* 自定义的按钮属性
|
|
32
32
|
*/
|
|
@@ -44,7 +44,7 @@ export type ActButton = {
|
|
|
44
44
|
*/
|
|
45
45
|
children?: ActButton[];
|
|
46
46
|
};
|
|
47
|
-
export declare const ActionButtons:
|
|
47
|
+
export declare const ActionButtons: FC<{
|
|
48
48
|
buttons: (ActButton | null | false)[];
|
|
49
49
|
size?: ButtonSize;
|
|
50
50
|
}>;
|
|
@@ -10,6 +10,29 @@ var __assign = (this && this.__assign) || function () {
|
|
|
10
10
|
};
|
|
11
11
|
return __assign.apply(this, arguments);
|
|
12
12
|
};
|
|
13
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
14
|
+
if (k2 === undefined) k2 = k;
|
|
15
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
16
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
17
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
18
|
+
}
|
|
19
|
+
Object.defineProperty(o, k2, desc);
|
|
20
|
+
}) : (function(o, m, k, k2) {
|
|
21
|
+
if (k2 === undefined) k2 = k;
|
|
22
|
+
o[k2] = m[k];
|
|
23
|
+
}));
|
|
24
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
25
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
26
|
+
}) : function(o, v) {
|
|
27
|
+
o["default"] = v;
|
|
28
|
+
});
|
|
29
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
30
|
+
if (mod && mod.__esModule) return mod;
|
|
31
|
+
var result = {};
|
|
32
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
33
|
+
__setModuleDefault(result, mod);
|
|
34
|
+
return result;
|
|
35
|
+
};
|
|
13
36
|
var __values = (this && this.__values) || function(o) {
|
|
14
37
|
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
15
38
|
if (m) return m.call(o);
|
|
@@ -26,7 +49,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
26
49
|
};
|
|
27
50
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
28
51
|
exports.ActionButtons = void 0;
|
|
29
|
-
var react_1 =
|
|
52
|
+
var react_1 = __importStar(require("react"));
|
|
30
53
|
var lodash_1 = __importDefault(require("lodash"));
|
|
31
54
|
var Popconfirm_1 = require("../_adapt/Popconfirm");
|
|
32
55
|
var Icon_1 = require("../_adapt/Icon");
|
|
@@ -96,7 +119,7 @@ var ActionButtons = function (props) {
|
|
|
96
119
|
var e_1, _a;
|
|
97
120
|
var _b;
|
|
98
121
|
if (((_b = props.buttons) === null || _b === void 0 ? void 0 : _b.length) <= 0)
|
|
99
|
-
return
|
|
122
|
+
return utils_1.Const.NONE;
|
|
100
123
|
var groups = [[]];
|
|
101
124
|
try {
|
|
102
125
|
for (var _c = __values(props.buttons), _d = _c.next(); !_d.done; _d = _c.next()) {
|
|
@@ -124,6 +147,6 @@ var ActionButtons = function (props) {
|
|
|
124
147
|
var groupProps = {};
|
|
125
148
|
if (props.size)
|
|
126
149
|
groupProps.size = props.size;
|
|
127
|
-
return react_1.default.createElement(react_1.
|
|
150
|
+
return react_1.default.createElement(react_1.Fragment, null, groups.map(function (group, gi) { return react_1.default.createElement(Button_1.Button.Group, __assign({ key: gi }, groupProps), group.map(function (btn, bi) { return react_1.default.createElement(ActionButton, __assign({ key: bi }, btn)); })); }));
|
|
128
151
|
};
|
|
129
152
|
exports.ActionButtons = ActionButtons;
|
|
@@ -191,7 +191,7 @@ exports.InnerSearchBarByField = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
191
191
|
var btnRender = function (rowSize, isExpand) {
|
|
192
192
|
if (props.hideAction || isExpand || isAwaysExpand)
|
|
193
193
|
return utils_1.Const.NONE;
|
|
194
|
-
return react_1.default.createElement(react_1.
|
|
194
|
+
return react_1.default.createElement(react_1.Fragment, null,
|
|
195
195
|
react_1.default.createElement(Button_1.Button, { disabled: props.disabled, icon: 'search', type: "primary", onClick: function (e) { return utils_1.PageUtil.stopEvent(e, search); } }),
|
|
196
196
|
react_1.default.createElement(Button_1.Button, { disabled: props.disabled, icon: 'redo', onClick: function (e) { return utils_1.PageUtil.stopEvent(e, clear); } }),
|
|
197
197
|
rowSize > 1 && !utils_1.GLOBAL.CONFIG.SEARCHBAR.USE_MODAL && react_1.default.createElement(Button_1.Button, { disabled: props.disabled, icon: 'filter', onClick: function (e) { return utils_1.PageUtil.stopEvent(e, function () { return setIsExpand(true); }); } }),
|
|
@@ -234,7 +234,7 @@ exports.InnerSearchBarByField = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
234
234
|
}, [layout.rows]);
|
|
235
235
|
if (layout == null)
|
|
236
236
|
return react_1.default.createElement("div", { className: 'c-searchbar-fields' });
|
|
237
|
-
return react_1.default.createElement("div", { className: 'c-searchbar-fields', style: fieldsStyle }, layout.rows.length && react_1.default.createElement(react_1.
|
|
237
|
+
return react_1.default.createElement("div", { className: 'c-searchbar-fields', style: fieldsStyle }, layout.rows.length && react_1.default.createElement(react_1.Fragment, null,
|
|
238
238
|
layout.isOutSide ? react_1.default.createElement("div", { className: "c-searchbar-outgroup c-searchbar-fixgroup" },
|
|
239
239
|
rowRender(layout.rows[0]),
|
|
240
240
|
btnRender(layout.rows.length, isExpand)) : react_1.default.createElement(antd_1.Input.Group, { compact: true, className: "c-searchbar-fixgroup" },
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import
|
|
1
|
+
import type { FC } from 'react';
|
|
2
2
|
import type { SearchBarProps } from './index';
|
|
3
|
-
export declare const SearchBarByKeyword:
|
|
3
|
+
export declare const SearchBarByKeyword: FC<SearchBarProps>;
|
|
@@ -81,9 +81,9 @@ var SearchBarByKeyword = function (props) {
|
|
|
81
81
|
}, [open]);
|
|
82
82
|
var suffixProps = {};
|
|
83
83
|
if (props.fields && props.fields.length) {
|
|
84
|
-
suffixProps.suffix = react_1.default.createElement(react_1.
|
|
84
|
+
suffixProps.suffix = react_1.default.createElement(react_1.Fragment, null,
|
|
85
85
|
react_1.default.createElement("span", { ref: spanRef, onClick: function () { return setOpen(true); }, style: { pointerEvents: props.disabled ? 'none' : 'unset' }, className: 'vicon vicon-menu', title: utils_1.i18n.txt(_i18n_1.V.INPUT_SEARCH_ADVANCE) }, "\u00A0"),
|
|
86
|
-
react_1.default.createElement(Popover_1.Popover, { open: open, onOpenChange: setOpen, trigger: "click", placement: "bottom", content: react_1.default.createElement(react_1.
|
|
86
|
+
react_1.default.createElement(Popover_1.Popover, { open: open, onOpenChange: setOpen, trigger: "click", placement: "bottom", content: react_1.default.createElement(react_1.Fragment, null,
|
|
87
87
|
react_1.default.createElement("h3", null, utils_1.i18n.txt(_i18n_1.V.INPUT_SEARCH_ADVANCE)),
|
|
88
88
|
react_1.default.createElement("div", { className: 'c-searchbar' },
|
|
89
89
|
react_1.default.createElement(ByField_1.InnerSearchBarByField, __assign({}, props, { ref: barRef, __innerExpand: true, __innerOutside: true, __innnerPopup: true, onSearch: function (param) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import { SearchFieldComponent } from './_register';
|
|
2
|
+
import type { FC } from 'react';
|
|
3
3
|
import type { Field } from './index';
|
|
4
|
-
export type FieldInput =
|
|
4
|
+
export type FieldInput = FC<{
|
|
5
5
|
SearchField: SearchFieldComponent;
|
|
6
6
|
disabled: boolean;
|
|
7
7
|
field: Field;
|
|
@@ -31,7 +31,7 @@ var _SearchBar = function (props) {
|
|
|
31
31
|
react_1.default.createElement(ByKeyword_1.SearchBarByKeyword, __assign({}, props)),
|
|
32
32
|
react_1.default.createElement("div", { className: 'c-searchbar-actions' }, props.children));
|
|
33
33
|
if (!lodash_1.default.has(props, 'children'))
|
|
34
|
-
return
|
|
34
|
+
return utils_1.Const.NONE;
|
|
35
35
|
return react_1.default.createElement("div", { className: utils_1.StringUtil.className(clazz, props.className) },
|
|
36
36
|
react_1.default.createElement("div", { className: 'c-searchbar-fields' }),
|
|
37
37
|
react_1.default.createElement("div", { className: 'c-searchbar-actions' }, props.children));
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import
|
|
1
|
+
import type { FC, MutableRefObject } from 'react';
|
|
2
2
|
import type { Key, PlainObject } from '../../../basetype';
|
|
3
3
|
import type { ActButton } from '../../SearchBar/ActionButtons';
|
|
4
|
-
import type { MutableRefObject } from 'react';
|
|
5
4
|
export type TableAction = (ids?: Key[], objs?: PlainObject[], param?: PlainObject) => void;
|
|
6
5
|
/**
|
|
7
6
|
* VTable Button 区域点击后的方法,支持三个参数
|
|
@@ -32,7 +31,7 @@ type TableActionBar = {
|
|
|
32
31
|
queryParam: PlainObject;
|
|
33
32
|
selectedRef: MutableRefObject<SelectFunction>;
|
|
34
33
|
};
|
|
35
|
-
export declare const ActionBar:
|
|
34
|
+
export declare const ActionBar: FC<TableActionBar>;
|
|
36
35
|
/**
|
|
37
36
|
* 通用添加按钮
|
|
38
37
|
*/
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import type { FC, ReactNode } from 'react';
|
|
2
2
|
import type { TableColumn } from '../index';
|
|
3
3
|
import type { BaseItem } from '../../../basetype';
|
|
4
4
|
/**
|
|
@@ -38,10 +38,10 @@ export type CustomAcitonProps = ActionPorps & {
|
|
|
38
38
|
/**
|
|
39
39
|
* 自定义操作的二次确认提示
|
|
40
40
|
*/
|
|
41
|
-
confrim?:
|
|
41
|
+
confrim?: ReactNode;
|
|
42
42
|
};
|
|
43
|
-
export declare const INFO:
|
|
44
|
-
export declare const EDIT:
|
|
45
|
-
export declare const DELETE:
|
|
46
|
-
export declare const ACTION:
|
|
47
|
-
export declare const COL_OPERACTION: (props: TableColumn | ((value: any, record: any, index: number) =>
|
|
43
|
+
export declare const INFO: FC<ActionPorps>;
|
|
44
|
+
export declare const EDIT: FC<ActionPorps>;
|
|
45
|
+
export declare const DELETE: FC<ActionPorps>;
|
|
46
|
+
export declare const ACTION: FC<CustomAcitonProps>;
|
|
47
|
+
export declare const COL_OPERACTION: (props: TableColumn | ((value: any, record: any, index: number) => ReactNode)) => TableColumn;
|
|
@@ -28,7 +28,7 @@ var DEFAULT_CLASS = {
|
|
|
28
28
|
};
|
|
29
29
|
var INFO = function (props) {
|
|
30
30
|
if (props.roleCode && !utils_1.PageUtil.hasRole(props.roleCode))
|
|
31
|
-
return
|
|
31
|
+
return utils_1.Const.NONE;
|
|
32
32
|
var title = utils_1.i18n.getText(props.ik, props.title, _i18n_1.V.BTN_INFO);
|
|
33
33
|
return react_1.default.createElement("span", { className: DEFAULT_CLASS.INFO, onClick: function (evt) { return utils_1.PageUtil.stopEvent(evt, props.onClick); }, title: "".concat(title, " ").concat(props.name || '') },
|
|
34
34
|
react_1.default.createElement(Icon_1.Icon, { type: 'search' }),
|
|
@@ -37,7 +37,7 @@ var INFO = function (props) {
|
|
|
37
37
|
exports.INFO = INFO;
|
|
38
38
|
var EDIT = function (props) {
|
|
39
39
|
if (props.roleCode && !utils_1.PageUtil.hasRole(props.roleCode))
|
|
40
|
-
return
|
|
40
|
+
return utils_1.Const.NONE;
|
|
41
41
|
var title = utils_1.i18n.getText(props.ik, props.title, _i18n_1.V.ACT_UPDATE);
|
|
42
42
|
return react_1.default.createElement("span", { className: DEFAULT_CLASS.EDIT, onClick: function (evt) { return utils_1.PageUtil.stopEvent(evt, props.onClick); }, title: "".concat(title, " ").concat(props.name || '') },
|
|
43
43
|
react_1.default.createElement(Icon_1.Icon, { type: 'edit' }),
|
|
@@ -46,7 +46,7 @@ var EDIT = function (props) {
|
|
|
46
46
|
exports.EDIT = EDIT;
|
|
47
47
|
var DELETE = function (props) {
|
|
48
48
|
if (props.roleCode && !utils_1.PageUtil.hasRole(props.roleCode))
|
|
49
|
-
return
|
|
49
|
+
return utils_1.Const.NONE;
|
|
50
50
|
var title = utils_1.i18n.getText(props.ik, props.title, _i18n_1.V.ACT_DELETE);
|
|
51
51
|
var popTitle = utils_1.i18n.txt(_i18n_1.V.ACT_DELETE_CONFIRM, props.name || '');
|
|
52
52
|
return react_1.default.createElement(Popconfirm_1.Popconfirm, { onConfirm: function (e) { return utils_1.PageUtil.stopEvent(e, function () { return props.onClick(); }); }, placement: "right", title: react_1.default.createElement("span", null, popTitle), overlayClassName: 'c-table-action-confirm' },
|
|
@@ -57,7 +57,7 @@ var DELETE = function (props) {
|
|
|
57
57
|
exports.DELETE = DELETE;
|
|
58
58
|
var ACTION = function (props) {
|
|
59
59
|
if (props.roleCode && !utils_1.PageUtil.hasRole(props.roleCode))
|
|
60
|
-
return
|
|
60
|
+
return utils_1.Const.NONE;
|
|
61
61
|
var title = utils_1.i18n.getText(props.ik, props.title);
|
|
62
62
|
var className = lodash_1.default.has(DEFAULT_CLASS, props.type) ? DEFAULT_CLASS[props.type] : DEFAULT_CLASS.EDIT;
|
|
63
63
|
if (!lodash_1.default.has(props, 'confrim')) {
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
|
|
1
|
+
import type { FC, ReactNode } from 'react';
|
|
2
2
|
import type { TableColumn } from '../index';
|
|
3
3
|
import type { ActionPorps, CustomAcitonProps } from './Actions';
|
|
4
4
|
import type { TableAction, TableActionButton } from './ActionBar';
|
|
5
5
|
export declare const defineTable: (table: TableDefined) => void;
|
|
6
6
|
export type TableDefined = {
|
|
7
|
-
INFO:
|
|
8
|
-
EDIT:
|
|
9
|
-
DELETE:
|
|
10
|
-
ACTION:
|
|
11
|
-
COL_OPERACTION: (props: TableColumn | ((value: any, record: any, index: number) =>
|
|
7
|
+
INFO: FC<ActionPorps>;
|
|
8
|
+
EDIT: FC<ActionPorps>;
|
|
9
|
+
DELETE: FC<ActionPorps>;
|
|
10
|
+
ACTION: FC<CustomAcitonProps>;
|
|
11
|
+
COL_OPERACTION: (props: TableColumn | ((value: any, record: any, index: number) => ReactNode)) => TableColumn;
|
|
12
12
|
BUTTON_ADD: (onClick: TableAction, props?: Partial<TableActionButton>) => TableActionButton;
|
|
13
13
|
BUTTON_DELETE: (onClick: TableAction, props?: Partial<TableActionButton>) => TableActionButton;
|
|
14
14
|
BUTTON_IMPORT: (onClick: TableAction, props?: Partial<TableActionButton>) => TableActionButton;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import type { FC } from 'react';
|
|
2
2
|
import type { BaseTableProps, TableColumn } from './index';
|
|
3
3
|
import type { PlainObject } from '../../basetype';
|
|
4
4
|
import type { ListModel } from '../../hooks/_list';
|
|
@@ -22,4 +22,4 @@ export type TopTableProps = Omit<BaseTableProps, 'mode' | 'columns' | 'select' |
|
|
|
22
22
|
onRowSelect?: (row: PlainObject) => void;
|
|
23
23
|
columns: TableColumn[];
|
|
24
24
|
};
|
|
25
|
-
export declare const TopTable:
|
|
25
|
+
export declare const TopTable: FC<TopTableProps>;
|
|
@@ -90,25 +90,7 @@ var TopTable = function (props) {
|
|
|
90
90
|
var _c = __read((0, react_1.useState)(undefined), 2), scroll = _c[0], setScroll = _c[1];
|
|
91
91
|
var _d = __read((0, react_1.useState)(null), 2), selected = _d[0], setSelected = _d[1];
|
|
92
92
|
(0, react_1.useEffect)(function () {
|
|
93
|
-
|
|
94
|
-
if (props.showIndex !== false) {
|
|
95
|
-
cols.push((0, Util_1.getIdxColumn)({ current: 0 }, props.showIndex, true));
|
|
96
|
-
}
|
|
97
|
-
props.columns.map(function (col) {
|
|
98
|
-
if (col.roleCode) {
|
|
99
|
-
if (!utils_1.PageUtil.hasRole(col.roleCode)) {
|
|
100
|
-
return;
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
if (col.ik) {
|
|
104
|
-
var title = utils_1.i18n.txt(col.ik);
|
|
105
|
-
cols.push(__assign(__assign({}, col), { title: title == '' ? col.title : title }));
|
|
106
|
-
}
|
|
107
|
-
else {
|
|
108
|
-
cols.push(col);
|
|
109
|
-
}
|
|
110
|
-
});
|
|
111
|
-
setColumns(cols);
|
|
93
|
+
setColumns((0, Util_1.convertColumns)(props, { ref: { current: 0 }, isRank: true }));
|
|
112
94
|
}, [props.columns]);
|
|
113
95
|
var onRowSelect = (0, react_1.useCallback)(function (data) {
|
|
114
96
|
if (selected == null || data[rowKey] != selected[rowKey]) {
|
|
@@ -127,6 +109,9 @@ var TopTable = function (props) {
|
|
|
127
109
|
return;
|
|
128
110
|
clearTimeout(resizePid.current);
|
|
129
111
|
resizePid.current = setTimeout(function () {
|
|
112
|
+
if (tableRef.current == null)
|
|
113
|
+
return;
|
|
114
|
+
clearTimeout(resizePid.current);
|
|
130
115
|
var thead = (0, VTable_1.getHeightByTagName)(tableRef.current, 'thead') || 40;
|
|
131
116
|
tableRef.current.style.display = 'none';
|
|
132
117
|
var height = tableRef.current.parentElement.getBoundingClientRect().height;
|
|
@@ -164,6 +149,7 @@ var TopTable = function (props) {
|
|
|
164
149
|
}
|
|
165
150
|
}); };
|
|
166
151
|
}
|
|
152
|
+
console.log(scroll);
|
|
167
153
|
return react_1.default.createElement("div", { ref: tableRef, className: 'c-table-top-container' },
|
|
168
154
|
react_1.default.createElement(Table_1.Table, __assign({}, tableProps, props, { rowClassName: function (record, i) {
|
|
169
155
|
var clazz = [];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import type { FC } from 'react';
|
|
2
2
|
import type { ModalProps } from '../_adapt/Modal';
|
|
3
3
|
import type { TopTableProps } from './TopTable';
|
|
4
4
|
export type TopTableModalProps = TopTableProps & ModalProps;
|
|
5
|
-
export declare const TopTableModal:
|
|
5
|
+
export declare const TopTableModal: FC<TopTableModalProps>;
|
|
@@ -25,7 +25,7 @@ var TOP_TABLE_PROPERTIES = [
|
|
|
25
25
|
var TopTableModal = function (props) {
|
|
26
26
|
var modalProps = lodash_1.default.omit(props, TOP_TABLE_PROPERTIES);
|
|
27
27
|
var tableProps = lodash_1.default.pick(props, TOP_TABLE_PROPERTIES);
|
|
28
|
-
return react_1.default.createElement(Modal_1.Modal, __assign({}, modalProps),
|
|
28
|
+
return react_1.default.createElement(Modal_1.Modal, __assign({ footer: null }, modalProps),
|
|
29
29
|
react_1.default.createElement(TopTable_1.TopTable, __assign({}, tableProps)));
|
|
30
30
|
};
|
|
31
31
|
exports.TopTableModal = TopTableModal;
|
|
@@ -1,3 +1,7 @@
|
|
|
1
1
|
import type { MutableRefObject } from 'react';
|
|
2
|
+
import type { BaseTableProps } from './index';
|
|
2
3
|
import type { ColumnProps } from 'antd/es/table/interface';
|
|
3
|
-
export declare const
|
|
4
|
+
export declare const convertColumns: (props: BaseTableProps, rank: {
|
|
5
|
+
ref: MutableRefObject<number>;
|
|
6
|
+
isRank?: boolean;
|
|
7
|
+
}) => ColumnProps<any>[];
|