@teamix/pro 1.5.16 → 1.5.18-beta
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/dist/fonts/txddinmedium.woff +0 -0
- package/dist/pro.all.min.css +1 -0
- package/dist/pro.css +1 -0
- package/dist/pro.js +114772 -0
- package/dist/pro.min.css +1 -0
- package/dist/pro.min.js +2 -0
- package/dist/pro.min.js.LICENSE.txt +47 -0
- package/dist/pro.xconsole.min.css +1 -0
- package/es/actions/dialog-component.js +1 -4
- package/es/actions/dialog-form.js +4 -3
- package/es/actions/dialog.js +2 -1
- package/es/actions/index.js +35 -22
- package/es/actions/quick.js +1 -4
- package/es/card/card-container.js +12 -5
- package/es/card/divider.js +2 -4
- package/es/card/index.js +18 -7
- package/es/card/selectable.js +2 -4
- package/es/card/tab.js +2 -4
- package/es/form/Components/Editable/index.js +1 -1
- package/es/form/Components/FormGroup/index.js +4 -3
- package/es/form/Components/LightFilter/index.js +11 -2
- package/es/form/Components/ProField/index.js +2 -4
- package/es/form/Components/Text/index.js +2 -4
- package/es/form/Filter/AdvancedFilter.js +16 -14
- package/es/form/Filter/LightFilter.js +13 -9
- package/es/form/Filter/SimpleFilter.js +8 -5
- package/es/form/Filter/index.js +24 -7
- package/es/form/Filter/index.scss +1 -0
- package/es/form/Filter/index2.js +22 -17
- package/es/form/Filter/index2.scss +1 -0
- package/es/form/Filter/useBindUrl.js +3 -0
- package/es/form/Filter/useSpecialProps.js +1 -0
- package/es/form/ProForm/index.js +5 -2
- package/es/form/ProForm/useAutoLayout.js +4 -0
- package/es/form/ProForm/useFormDisplayValues.js +1 -0
- package/es/form/SchemaForm/adapterComponent.js +1 -0
- package/es/form/SchemaForm/adapterDecorator.js +1 -0
- package/es/form/SchemaForm/adapterType.js +1 -0
- package/es/form/SchemaForm/index.js +13 -0
- package/es/form/SchemaForm/initializeFormButton.js +2 -0
- package/es/form/SchemaForm/initializeReactions.js +1 -0
- package/es/form/SchemaForm/initializeSelectTable.js +1 -0
- package/es/form/SchemaForm/reactions.js +5 -0
- package/es/form/index.js +4 -0
- package/es/form/utils.js +12 -0
- package/es/form/warning.js +2 -0
- package/es/index.js +3 -1
- package/es/info/components/InfoGroup/index.js +2 -4
- package/es/info/components/InfoValueItem/index.js +32 -20
- package/es/info/components/ProInfoItem/index.js +1 -0
- package/es/info/components/baseInfo/index.js +3 -0
- package/es/info/components/tableInfo/index.js +6 -4
- package/es/info/index.js +11 -5
- package/es/info/utils/index.js +3 -0
- package/es/layout/index.js +2 -0
- package/es/nocode/index.js +2 -0
- package/es/nocode/pages/index.js +3 -0
- package/es/nocode/pages/playground.js +3 -5
- package/es/nocode/pages/renderer.js +4 -6
- package/es/nocode/playground.js +2 -4
- package/es/page-header/index.js +12 -7
- package/es/sidebar/components/sidebar-container/index.js +10 -7
- package/es/sidebar/components/tree/index.js +22 -4
- package/es/sidebar/components/tree-node/components/HoverTooltip/index.js +3 -4
- package/es/sidebar/components/tree-node/components/IconAction/index.js +4 -2
- package/es/sidebar/components/tree-node/components/IconSwitch/index.js +1 -0
- package/es/sidebar/components/tree-node/index.js +29 -16
- package/es/sidebar/index.js +15 -4
- package/es/sidebar/utils/index.js +19 -11
- package/es/table/components/CardView/index.js +29 -13
- package/es/table/components/Filter/index.js +11 -0
- package/es/table/components/Layout/index.js +13 -8
- package/es/table/components/LoadMore/index.js +3 -0
- package/es/table/components/Pagination/index.js +12 -10
- package/es/table/components/QuickAction/index.js +3 -2
- package/es/table/components/ToolBar/CardSwitch.js +2 -0
- package/es/table/components/ToolBar/DensityIcon.js +7 -2
- package/es/table/components/ToolBar/FilterColumnIcon.js +9 -0
- package/es/table/components/ToolBar/FullScreenIcon.js +1 -0
- package/es/table/components/ToolBar/Fullscreen.js +3 -0
- package/es/table/components/ToolBar/RefreshIcon.js +11 -0
- package/es/table/components/ToolBar/index.js +13 -10
- package/es/table/index.js +138 -51
- package/es/table/index.scss +26 -0
- package/es/table/utils/columnRender.js +78 -27
- package/es/table/utils/genAutoWidthColumns.js +340 -0
- package/es/table/utils/index.js +6 -0
- package/es/table/utils/pureColumnRender.js +9 -1
- package/es/templates/List/index.js +4 -6
- package/es/templates/index.js +2 -1
- package/es/timeline/ProTimeLineItem/index.js +8 -4
- package/es/timeline/index.js +5 -5
- package/es/utils/message.js +3 -5
- package/es/xconsole.scss +23 -0
- package/lib/form/Filter/index.scss +1 -0
- package/lib/form/Filter/index2.scss +1 -0
- package/lib/index.d.ts +1 -1
- package/lib/index.js +1 -1
- package/lib/table/components/CardView/index.js +5 -10
- package/lib/table/components/ToolBar/index.js +10 -7
- package/lib/table/index.js +72 -25
- package/lib/table/index.scss +26 -0
- package/lib/table/typing.d.ts +11 -1
- package/lib/table/utils/columnRender.d.ts +1 -0
- package/lib/table/utils/columnRender.js +51 -4
- package/lib/table/utils/genAutoWidthColumns.d.ts +35 -0
- package/lib/table/utils/genAutoWidthColumns.js +345 -0
- package/lib/xconsole.scss +23 -0
- package/package.json +1 -1
- package/es/actions/base.d.ts +0 -24
- package/es/actions/confirm.d.ts +0 -7
- package/es/actions/danger-confirm.d.ts +0 -7
- package/es/actions/danger-pop-confirm.d.ts +0 -5
- package/es/actions/dialog-component.d.ts +0 -10
- package/es/actions/dialog-form.d.ts +0 -29
- package/es/actions/dialog-info.d.ts +0 -9
- package/es/actions/dialog-table.d.ts +0 -9
- package/es/actions/dialog.d.ts +0 -40
- package/es/actions/drawer-form.d.ts +0 -6
- package/es/actions/drawer-info.d.ts +0 -6
- package/es/actions/drawer-table.d.ts +0 -6
- package/es/actions/drawer.d.ts +0 -6
- package/es/actions/error.d.ts +0 -7
- package/es/actions/index.d.ts +0 -114
- package/es/actions/link.d.ts +0 -8
- package/es/actions/notice.d.ts +0 -7
- package/es/actions/pop-confirm.d.ts +0 -9
- package/es/actions/quick.d.ts +0 -2
- package/es/actions/request.d.ts +0 -9
- package/es/actions/utils.d.ts +0 -1
- package/es/card/card-container.d.ts +0 -18
- package/es/card/divider.d.ts +0 -6
- package/es/card/index.d.ts +0 -109
- package/es/card/selectable.d.ts +0 -13
- package/es/card/tab.d.ts +0 -6
- package/es/card/utils.d.ts +0 -9
- package/es/field/index.d.ts +0 -3
- package/es/form/Components/Editable/index.d.ts +0 -20
- package/es/form/Components/FormGroup/index.d.ts +0 -14
- package/es/form/Components/LightFilter/componentMap.d.ts +0 -3
- package/es/form/Components/LightFilter/index.d.ts +0 -17
- package/es/form/Components/ProField/index.d.ts +0 -2
- package/es/form/Components/ProField/mapDateFormat.d.ts +0 -3
- package/es/form/Components/Text/index.d.ts +0 -8
- package/es/form/Filter/AdvancedFilter.d.ts +0 -7
- package/es/form/Filter/Layout.d.ts +0 -5
- package/es/form/Filter/LightFilter.d.ts +0 -7
- package/es/form/Filter/SimpleFilter.d.ts +0 -7
- package/es/form/Filter/index.d.ts +0 -9
- package/es/form/Filter/index2.d.ts +0 -13
- package/es/form/Filter/useBindUrl.d.ts +0 -2
- package/es/form/Filter/useSpecialProps.d.ts +0 -6
- package/es/form/ProForm/addCascadeEffect.d.ts +0 -2
- package/es/form/ProForm/customComponent.d.ts +0 -3
- package/es/form/ProForm/index.d.ts +0 -5
- package/es/form/ProForm/useAutoLayout.d.ts +0 -9
- package/es/form/ProForm/useAutoSubmit.d.ts +0 -6
- package/es/form/ProForm/useFieldRequest.d.ts +0 -5
- package/es/form/ProForm/useFormDisplayValues.d.ts +0 -4
- package/es/form/ProForm/useInitialRequest.d.ts +0 -6
- package/es/form/SchemaForm/adapterComponent.d.ts +0 -5
- package/es/form/SchemaForm/adapterDecorator.d.ts +0 -6
- package/es/form/SchemaForm/adapterType.d.ts +0 -5
- package/es/form/SchemaForm/index.d.ts +0 -4
- package/es/form/SchemaForm/initializeArrayCards.d.ts +0 -3
- package/es/form/SchemaForm/initializeArrayCollapse.d.ts +0 -3
- package/es/form/SchemaForm/initializeArrayItems.d.ts +0 -3
- package/es/form/SchemaForm/initializeArrayTable.d.ts +0 -3
- package/es/form/SchemaForm/initializeDataSource.d.ts +0 -15
- package/es/form/SchemaForm/initializeFormButton.d.ts +0 -3
- package/es/form/SchemaForm/initializeFormCollapse.d.ts +0 -3
- package/es/form/SchemaForm/initializeFormGroup.d.ts +0 -3
- package/es/form/SchemaForm/initializeFormStep.d.ts +0 -5
- package/es/form/SchemaForm/initializeFormTab.d.ts +0 -3
- package/es/form/SchemaForm/initializeReactions.d.ts +0 -2
- package/es/form/SchemaForm/initializeRequest.d.ts +0 -11
- package/es/form/SchemaForm/initializeRules.d.ts +0 -11
- package/es/form/SchemaForm/initializeSelectTable.d.ts +0 -3
- package/es/form/SchemaForm/reactions.d.ts +0 -6
- package/es/form/docs/ActionResponse.d.ts +0 -8
- package/es/form/fieldTypeMap.d.ts +0 -7
- package/es/form/index.d.ts +0 -125
- package/es/form/locales/validate.d.ts +0 -159
- package/es/form/schemaNameMap.d.ts +0 -5
- package/es/form/typing.d.ts +0 -194
- package/es/form/utils.d.ts +0 -55
- package/es/form/warning.d.ts +0 -3
- package/es/hooks/index.d.ts +0 -2
- package/es/index-without-icon.d.ts +0 -32
- package/es/index.d.ts +0 -32
- package/es/info/components/InfoGroup/index.d.ts +0 -5
- package/es/info/components/InfoValueItem/index.d.ts +0 -5
- package/es/info/components/ProInfoItem/index.d.ts +0 -5
- package/es/info/components/baseInfo/index.d.ts +0 -8
- package/es/info/components/headerInfo/index.d.ts +0 -8
- package/es/info/components/tableInfo/index.d.ts +0 -7
- package/es/info/index.d.ts +0 -10
- package/es/info/typing.d.ts +0 -220
- package/es/info/utils/index.d.ts +0 -20
- package/es/info/utils/layout.d.ts +0 -2
- package/es/info/utils/utils.d.ts +0 -1
- package/es/layout/index.d.ts +0 -2
- package/es/nocode/configurators/Card.d.ts +0 -3
- package/es/nocode/configurators/PageHeader.d.ts +0 -3
- package/es/nocode/configurators/ProTable.d.ts +0 -3
- package/es/nocode/configurators/common.d.ts +0 -280
- package/es/nocode/configurators/index.d.ts +0 -15
- package/es/nocode/configurators/map.d.ts +0 -2
- package/es/nocode/index.d.ts +0 -8
- package/es/nocode/pages/editor.d.ts +0 -12
- package/es/nocode/pages/index.d.ts +0 -14
- package/es/nocode/pages/playground.d.ts +0 -11
- package/es/nocode/pages/renderer.d.ts +0 -10
- package/es/nocode/playground.d.ts +0 -14
- package/es/page-container/index.d.ts +0 -3
- package/es/page-header/index.d.ts +0 -74
- package/es/sidebar/components/sidebar-container/index.d.ts +0 -5
- package/es/sidebar/components/tree/index.d.ts +0 -6
- package/es/sidebar/components/tree-node/components/HoverTooltip/index.d.ts +0 -15
- package/es/sidebar/components/tree-node/components/IconAction/index.d.ts +0 -12
- package/es/sidebar/components/tree-node/components/IconSwitch/index.d.ts +0 -23
- package/es/sidebar/components/tree-node/index.d.ts +0 -7
- package/es/sidebar/index.d.ts +0 -9
- package/es/sidebar/typing.d.ts +0 -141
- package/es/sidebar/utils/action-ref.d.ts +0 -3
- package/es/sidebar/utils/index.d.ts +0 -364
- package/es/skeleton/index.d.ts +0 -3
- package/es/table/components/CardView/index.d.ts +0 -5
- package/es/table/components/EmptyContent/index.d.ts +0 -2
- package/es/table/components/Filter/index.d.ts +0 -12
- package/es/table/components/Layout/index.d.ts +0 -5
- package/es/table/components/LoadMore/index.d.ts +0 -20
- package/es/table/components/Pagination/index.d.ts +0 -7
- package/es/table/components/QuickAction/index.d.ts +0 -11
- package/es/table/components/ToolBar/CardSwitch.d.ts +0 -8
- package/es/table/components/ToolBar/DensityIcon.d.ts +0 -4
- package/es/table/components/ToolBar/FilterColumnIcon.d.ts +0 -4
- package/es/table/components/ToolBar/FullScreenIcon.d.ts +0 -4
- package/es/table/components/ToolBar/Fullscreen.d.ts +0 -10
- package/es/table/components/ToolBar/RefreshIcon.d.ts +0 -4
- package/es/table/components/ToolBar/index.d.ts +0 -5
- package/es/table/index.d.ts +0 -5
- package/es/table/typing.d.ts +0 -418
- package/es/table/utils/columnRender.d.ts +0 -13
- package/es/table/utils/genProColumnToColumn.d.ts +0 -13
- package/es/table/utils/getTableProps.d.ts +0 -2
- package/es/table/utils/getTableSortIcons.d.ts +0 -3
- package/es/table/utils/index.d.ts +0 -19
- package/es/table/utils/pureColumnRender.d.ts +0 -9
- package/es/table/utils/pureGenProColumnToColumn.d.ts +0 -7
- package/es/table/utils/useTableSelection.d.ts +0 -3
- package/es/table/utils/util.d.ts +0 -5
- package/es/templates/Detail/index.d.ts +0 -2
- package/es/templates/Form/index.d.ts +0 -2
- package/es/templates/List/index.d.ts +0 -9
- package/es/templates/index.d.ts +0 -3
- package/es/timeline/ProTimeLineItem/index.d.ts +0 -5
- package/es/timeline/index.d.ts +0 -10
- package/es/timeline/typing.d.ts +0 -107
- package/es/utils/index.d.ts +0 -3
- package/es/utils/message.d.ts +0 -3
@@ -4,7 +4,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
5
5
|
value: true
|
6
6
|
});
|
7
|
-
exports.renderColumnsTitle = exports.renderCell = void 0;
|
7
|
+
exports.renderColumnsTitle = exports.renderCellSmartWidth = exports.renderCell = void 0;
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
9
9
|
var _utils = require("@teamix/utils");
|
10
10
|
var _actions = require("../../actions");
|
@@ -186,14 +186,61 @@ dataTeamixSpm) {
|
|
186
186
|
});
|
187
187
|
}
|
188
188
|
// 渲染 ProField
|
189
|
-
return /*#__PURE__*/_react.default.createElement(_field.default
|
189
|
+
return /*#__PURE__*/_react.default.createElement(_field.default
|
190
|
+
// style={{width: `${width}px`}}
|
191
|
+
, _objectSpread({
|
192
|
+
// style={{width: `${width}px`}}
|
190
193
|
type: valueType || 'text',
|
191
194
|
value: value,
|
192
195
|
render: newRender,
|
193
196
|
dataSource: newDataSource,
|
194
|
-
format: format
|
197
|
+
format: format,
|
198
|
+
proFieldWidthType: valueType
|
195
199
|
}, props));
|
196
200
|
};
|
201
|
+
exports.renderCell = renderCell;
|
202
|
+
var renderCellSmartWidth = function renderCellSmartWidth(value, item, index, record, actionRef, /** 接收外部比如 dialog-table 传过来的 context,用于弹窗关闭等 */
|
203
|
+
context) {
|
204
|
+
var _item$valueType2 = item.valueType,
|
205
|
+
valueType = _item$valueType2 === void 0 ? 'text' : _item$valueType2,
|
206
|
+
render = item.render,
|
207
|
+
actionSchema = item.actionSchema,
|
208
|
+
dataIndex = item.dataIndex,
|
209
|
+
format = item.format;
|
210
|
+
var newRender = null;
|
211
|
+
var newDataSource = null;
|
212
|
+
var props = item.props;
|
213
|
+
// 如果 render 直接传函数
|
214
|
+
if (typeof render === 'function') {
|
215
|
+
newRender = function newRender() {
|
216
|
+
return render === null || render === void 0 ? void 0 : render(value, index, record);
|
217
|
+
};
|
218
|
+
} else {
|
219
|
+
newRender = processBuriedPoint(processRenderFunction(render, value, index, record), record, value, index);
|
220
|
+
if (valueType === 'selectGroup') {
|
221
|
+
newRender = _objectSpread(_objectSpread({
|
222
|
+
maxShowNumber: 'auto',
|
223
|
+
foldText: 'more',
|
224
|
+
editOnClick: function editOnClick() {},
|
225
|
+
edit: true
|
226
|
+
}, newRender), {}, {
|
227
|
+
ellipsis: false
|
228
|
+
});
|
229
|
+
props = _objectSpread({
|
230
|
+
valueAlias: {
|
231
|
+
value: 'TagValue',
|
232
|
+
key: 'TagKey'
|
233
|
+
}
|
234
|
+
}, props);
|
235
|
+
}
|
236
|
+
if ((render === null || render === void 0 ? void 0 : render.type) === 'step') {
|
237
|
+
newRender = _objectSpread(_objectSpread({}, newRender), {}, {
|
238
|
+
ellipsis: false
|
239
|
+
});
|
240
|
+
}
|
241
|
+
}
|
242
|
+
// return getProFieldWidthBox(valueType, newRender)?.minWidth || undefined
|
243
|
+
};
|
197
244
|
/**
|
198
245
|
* 处理 render 配置项是函数的情况
|
199
246
|
* @param render ProFieldRender
|
@@ -202,7 +249,7 @@ dataTeamixSpm) {
|
|
202
249
|
* @param record table cell record
|
203
250
|
* @returns
|
204
251
|
*/
|
205
|
-
exports.
|
252
|
+
exports.renderCellSmartWidth = renderCellSmartWidth;
|
206
253
|
var processRenderFunction = function processRenderFunction() {
|
207
254
|
var render = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
208
255
|
var value = arguments.length > 1 ? arguments[1] : undefined;
|
@@ -0,0 +1,35 @@
|
|
1
|
+
import { MutableRefObject } from 'react';
|
2
|
+
import { ProTableColumnProps } from '../typing';
|
3
|
+
/**
|
4
|
+
* @param fileteredColumns
|
5
|
+
* @param ref
|
6
|
+
* @param data
|
7
|
+
* @returns
|
8
|
+
*/
|
9
|
+
export declare function genAutoWidthColumns(fileteredColumns: ProTableColumnProps[], ref: MutableRefObject<HTMLDivElement | null>, data: any[], size: 'small' | 'medium', useRowSelection?: boolean | undefined, actionColumnRef?: MutableRefObject<HTMLDivElement | null>): ProTableColumnProps[];
|
10
|
+
interface IShadowContainerProps {
|
11
|
+
columns: ProTableColumnProps[];
|
12
|
+
data: any[];
|
13
|
+
shadowContainerRef: MutableRefObject<null>;
|
14
|
+
}
|
15
|
+
export declare const shadowContainer: (props: IShadowContainerProps) => JSX.Element;
|
16
|
+
export declare const shadowActionColumnContainer: (columns: ProTableColumnProps[], shadowActionColumnContainerRef: MutableRefObject<null>) => JSX.Element | undefined;
|
17
|
+
export declare const computeableWidthTypeList: {};
|
18
|
+
export declare const fixedWidthTypeList: {
|
19
|
+
dateTime: number;
|
20
|
+
dateMonth: number;
|
21
|
+
dateWeek: number;
|
22
|
+
date: number;
|
23
|
+
dateYear: number;
|
24
|
+
dateQuarter: number;
|
25
|
+
dateRange: number;
|
26
|
+
dateWeekRange: number;
|
27
|
+
dateMonthRange: number;
|
28
|
+
dateYearRange: number;
|
29
|
+
dateQuarterRange: number;
|
30
|
+
dateTimeRange: number;
|
31
|
+
time: number;
|
32
|
+
timeRange: number;
|
33
|
+
};
|
34
|
+
export declare const fieldTypeShrink: any;
|
35
|
+
export {};
|
@@ -0,0 +1,345 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
5
|
+
value: true
|
6
|
+
});
|
7
|
+
exports.fixedWidthTypeList = exports.fieldTypeShrink = exports.computeableWidthTypeList = void 0;
|
8
|
+
exports.genAutoWidthColumns = genAutoWidthColumns;
|
9
|
+
exports.shadowContainer = exports.shadowActionColumnContainer = void 0;
|
10
|
+
var _react = _interopRequireWildcard(require("react"));
|
11
|
+
var _utils = require("@teamix/utils");
|
12
|
+
var _pureColumnRender = require("./pureColumnRender");
|
13
|
+
var _columnRender = require("./columnRender");
|
14
|
+
var _actions = require("../../actions");
|
15
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
16
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
17
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
18
|
+
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
19
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
20
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
21
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
22
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
23
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
24
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
25
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
26
|
+
// 最大宽度
|
27
|
+
var maxColumnWidth = 600;
|
28
|
+
// 最小宽度
|
29
|
+
var minColumnWidth = 48;
|
30
|
+
// 每个列可以缩减的最大宽度
|
31
|
+
var columnShrinkMaxWidth = 100;
|
32
|
+
/**
|
33
|
+
* @param fileteredColumns
|
34
|
+
* @param ref
|
35
|
+
* @param data
|
36
|
+
* @returns
|
37
|
+
*/
|
38
|
+
function genAutoWidthColumns(fileteredColumns, ref, data, size, useRowSelection, actionColumnRef) {
|
39
|
+
if (!ref.current) {
|
40
|
+
return fileteredColumns;
|
41
|
+
}
|
42
|
+
var hasLockFlag = false;
|
43
|
+
var dom = ref.current;
|
44
|
+
var actionColumnDom = actionColumnRef === null || actionColumnRef === void 0 ? void 0 : actionColumnRef.current;
|
45
|
+
var childNodes = dom.children;
|
46
|
+
var finalColumns = [];
|
47
|
+
fileteredColumns.forEach(function (column, index) {
|
48
|
+
var render = column.render,
|
49
|
+
_column$valueType = column.valueType,
|
50
|
+
valueType = _column$valueType === void 0 ? 'text' : _column$valueType,
|
51
|
+
_column$autoWidth = column.autoWidth,
|
52
|
+
autoWidth = _column$autoWidth === void 0 ? true : _column$autoWidth,
|
53
|
+
actionSchema = column.actionSchema,
|
54
|
+
sortable = column.sortable,
|
55
|
+
lock = column.lock;
|
56
|
+
if (lock) {
|
57
|
+
hasLockFlag = true;
|
58
|
+
}
|
59
|
+
//@ts-ignore
|
60
|
+
var type = render === null || render === void 0 ? void 0 : render.type;
|
61
|
+
var finalType = type || valueType || '';
|
62
|
+
var shrink = fieldTypeShrink[finalType];
|
63
|
+
column.shrink = column.shrink || (shrink !== undefined ? shrink : 1);
|
64
|
+
//@ts-ignore
|
65
|
+
// if (!autoWidth) {
|
66
|
+
// finalColumns.push(column);
|
67
|
+
// return;
|
68
|
+
// }
|
69
|
+
if (actionSchema) {
|
70
|
+
// TODO 操作列暂时未处理,但是应该根据actionSchema的数量直接推测出操作列的宽度
|
71
|
+
// console.log('column', column);
|
72
|
+
column.shrink = 0;
|
73
|
+
// column.width = 280;
|
74
|
+
// console.log(
|
75
|
+
// 'actionColumnDom',
|
76
|
+
// actionColumnDom?.childNodes[0].scrollWidth,
|
77
|
+
// );
|
78
|
+
if (actionColumnDom === null || actionColumnDom === void 0 ? void 0 : actionColumnDom.childNodes[0]) {
|
79
|
+
//@ts-ignore
|
80
|
+
var width = actionColumnDom === null || actionColumnDom === void 0 ? void 0 : actionColumnDom.childNodes[0].scrollWidth;
|
81
|
+
if (width >= 280) {
|
82
|
+
width = 280;
|
83
|
+
}
|
84
|
+
console.log('actionWidth', width);
|
85
|
+
column.width = defaultPaddingFixer(width, size, false);
|
86
|
+
}
|
87
|
+
finalColumns.push(column);
|
88
|
+
return;
|
89
|
+
}
|
90
|
+
// @ts-ignore
|
91
|
+
var titleWidth = childNodes[index].children[0].scrollWidth;
|
92
|
+
// @ts-ignore
|
93
|
+
if (fixedWidthTypeList[finalType]) {
|
94
|
+
// console.log(
|
95
|
+
// 'fixedWidthTypeList[finalType]',
|
96
|
+
// fixedWidthTypeList[finalType],
|
97
|
+
// );
|
98
|
+
// 固定宽度
|
99
|
+
column.width = defaultPaddingFixer(
|
100
|
+
// @ts-ignore
|
101
|
+
Math.max(titleWidth, fixedWidthTypeList[finalType]), size, index === 0 && useRowSelection);
|
102
|
+
// @ts-ignore
|
103
|
+
} else if (computeableWidthTypeList[finalType]) {
|
104
|
+
// 可计算宽度
|
105
|
+
column.width = defaultPaddingFixer(
|
106
|
+
// @ts-ignore
|
107
|
+
Math.max(titleWidth, computeableWidthTypeList[finalType](data, render)), size, index === 0 && useRowSelection);
|
108
|
+
} else {
|
109
|
+
// 直接根据 dom 计算
|
110
|
+
column.width = defaultPaddingFixer(Math.max(titleWidth,
|
111
|
+
// @ts-ignore
|
112
|
+
calcWidthWithParentDOM(childNodes[index], column.shrink)), size, index === 0 && useRowSelection);
|
113
|
+
}
|
114
|
+
if (index === 0) {
|
115
|
+
// 首列不会被挤占
|
116
|
+
column.shrink = 0;
|
117
|
+
}
|
118
|
+
finalColumns.push(column);
|
119
|
+
});
|
120
|
+
if (!hasLockFlag) {
|
121
|
+
// 如果没有锁列的情况,需要将所有列放到一屏内,此时需要将所有列放到一起计算一次
|
122
|
+
var containerWidth = dom.offsetWidth;
|
123
|
+
var comboColumns = calcMultiColumnLength(finalColumns, useRowSelection ? containerWidth - 50 : containerWidth);
|
124
|
+
return comboColumns;
|
125
|
+
}
|
126
|
+
console.log('[ finalColumns ] >', finalColumns);
|
127
|
+
return finalColumns;
|
128
|
+
}
|
129
|
+
var shadowContainer = function shadowContainer(props) {
|
130
|
+
var ref = (0, _react.useRef)();
|
131
|
+
var columns = props.columns,
|
132
|
+
data = props.data,
|
133
|
+
shadowContainerRef = props.shadowContainerRef;
|
134
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
135
|
+
ref: shadowContainerRef,
|
136
|
+
className: "teamix-pro-table-shadow-container"
|
137
|
+
}, columns.map(function (column, index) {
|
138
|
+
var dataIndex = column.dataIndex,
|
139
|
+
valueType = column.valueType;
|
140
|
+
if (!(column === null || column === void 0 ? void 0 : column.actionSchema)) {
|
141
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
142
|
+
className: "teamix-pro-table-shadow-container-columns",
|
143
|
+
key: index
|
144
|
+
}, /*#__PURE__*/_react.default.createElement("div", null, (0, _columnRender.renderColumnsTitle)(column, ref)),
|
145
|
+
//@ts-ignore
|
146
|
+
!computeableWidthTypeList[valueType] &&
|
147
|
+
//@ts-ignore
|
148
|
+
!fixedWidthTypeList[valueType] && data.map(function (item, index) {
|
149
|
+
return (0, _pureColumnRender.renderCell)(getValueFromRecord(dataIndex, item), column, index, item);
|
150
|
+
}));
|
151
|
+
}
|
152
|
+
}));
|
153
|
+
};
|
154
|
+
exports.shadowContainer = shadowContainer;
|
155
|
+
var shadowActionColumnContainer = function shadowActionColumnContainer(columns, shadowActionColumnContainerRef) {
|
156
|
+
var actionColumn = columns.find(function (column) {
|
157
|
+
return column === null || column === void 0 ? void 0 : column.actionSchema;
|
158
|
+
});
|
159
|
+
if (actionColumn === null || actionColumn === void 0 ? void 0 : actionColumn.actionSchema) {
|
160
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
161
|
+
ref: shadowActionColumnContainerRef,
|
162
|
+
className: "teamix-pro-table-action-column-shadow-container"
|
163
|
+
}, /*#__PURE__*/_react.default.createElement(_actions.ProActionGroup, _objectSpread(_objectSpread({
|
164
|
+
type: "text"
|
165
|
+
}, actionColumn === null || actionColumn === void 0 ? void 0 : actionColumn.actionSchema), {}, {
|
166
|
+
context: _objectSpread({}, actionColumn === null || actionColumn === void 0 ? void 0 : actionColumn.actionSchema.context)
|
167
|
+
})));
|
168
|
+
}
|
169
|
+
};
|
170
|
+
// 计算操作列的宽度
|
171
|
+
exports.shadowActionColumnContainer = shadowActionColumnContainer;
|
172
|
+
function getValueFromRecord(dataIndex, record) {
|
173
|
+
if (!dataIndex) {
|
174
|
+
return null;
|
175
|
+
}
|
176
|
+
if (Array.isArray(dataIndex)) {
|
177
|
+
var value = dataIndex.map(function (item) {
|
178
|
+
return (0, _utils.getTargetValue)("{{".concat(item, "}}"), _objectSpread(_objectSpread({}, record), {}, {
|
179
|
+
record: record
|
180
|
+
}));
|
181
|
+
});
|
182
|
+
return value;
|
183
|
+
} else {
|
184
|
+
var result = record;
|
185
|
+
var array = dataIndex.split('.');
|
186
|
+
array.forEach(function (item) {
|
187
|
+
return result = result ? result[item] : undefined;
|
188
|
+
});
|
189
|
+
return result;
|
190
|
+
}
|
191
|
+
}
|
192
|
+
// TODO 某些可以直接算出结果的 profield 类型白名单,待补充,每个类型下支持一个函数,用当前值和渲染类型算出一个结果
|
193
|
+
var computeableWidthTypeList = {
|
194
|
+
// text: (data: any[], render: ITableCellRender) => {
|
195
|
+
// }
|
196
|
+
};
|
197
|
+
// TODO 某些固定宽度的 profield 类型白名单,这里的数据可能需要综合考虑 dataFold 和 render.rows
|
198
|
+
exports.computeableWidthTypeList = computeableWidthTypeList;
|
199
|
+
var fixedWidthTypeList = {
|
200
|
+
// 时间日期
|
201
|
+
dateTime: 160,
|
202
|
+
dateMonth: 74,
|
203
|
+
dateWeek: 74,
|
204
|
+
date: 100,
|
205
|
+
dateYear: 46,
|
206
|
+
dateQuarter: 64,
|
207
|
+
dateRange: 212,
|
208
|
+
dateWeekRange: 156,
|
209
|
+
dateMonthRange: 156,
|
210
|
+
dateYearRange: 102,
|
211
|
+
dateQuarterRange: 136,
|
212
|
+
dateTimeRange: 326,
|
213
|
+
time: 38,
|
214
|
+
timeRange: 124
|
215
|
+
};
|
216
|
+
// TODO 不同类型的 profield 的 shrink,0表示不可以省略号,数字越大越容易被挤占空间
|
217
|
+
exports.fixedWidthTypeList = fixedWidthTypeList;
|
218
|
+
var fieldTypeShrink = {
|
219
|
+
tag: 0,
|
220
|
+
statusTag: 0,
|
221
|
+
statusIconTag: 0,
|
222
|
+
circle: 0,
|
223
|
+
rank: 0,
|
224
|
+
progress: 0,
|
225
|
+
money: 0,
|
226
|
+
number: 0,
|
227
|
+
percent: 0,
|
228
|
+
dateTime: 0,
|
229
|
+
ip: 0
|
230
|
+
};
|
231
|
+
exports.fieldTypeShrink = fieldTypeShrink;
|
232
|
+
function calcWidthWithParentDOM(dom, shrink) {
|
233
|
+
var childNodes = _toConsumableArray(dom.children);
|
234
|
+
childNodes.shift();
|
235
|
+
return calcSingleColumnLength(childNodes.map(function (node) {
|
236
|
+
return node.scrollWidth;
|
237
|
+
}), shrink);
|
238
|
+
}
|
239
|
+
function calcSingleColumnLength() {
|
240
|
+
var list = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
241
|
+
var shrink = arguments.length > 1 ? arguments[1] : undefined;
|
242
|
+
if (shrink === 0) {
|
243
|
+
return Math.ceil(Math.max.apply(null, list));
|
244
|
+
}
|
245
|
+
return getConfidence90UpperBound(list);
|
246
|
+
}
|
247
|
+
/**
|
248
|
+
* 根据所有列的宽度和权重,结合总宽度,计算出各个列合适的宽度
|
249
|
+
* 目前算法:
|
250
|
+
* 当前需要的总宽度-总宽度=需要降低的宽度
|
251
|
+
* 从后往前,将shrink不为0的列,降低一些宽度到最小宽度
|
252
|
+
* 最小宽度可以用百分比去算
|
253
|
+
* TODO 当前shrink只用了0,其他的权重也要考虑一下
|
254
|
+
* @param list
|
255
|
+
* @param max
|
256
|
+
* @returns
|
257
|
+
*/
|
258
|
+
function calcMultiColumnLength() {
|
259
|
+
var list = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
260
|
+
var max = arguments.length > 1 ? arguments[1] : undefined;
|
261
|
+
var result = _toConsumableArray(list);
|
262
|
+
var targetList = [];
|
263
|
+
var needWidth = 0;
|
264
|
+
var canShrink = 0;
|
265
|
+
list.forEach(function (item) {
|
266
|
+
//@ts-ignore
|
267
|
+
needWidth += item.width;
|
268
|
+
console.log('item.width', item.width);
|
269
|
+
if (item.shrink !== 0) {
|
270
|
+
targetList.push(item);
|
271
|
+
//@ts-ignore
|
272
|
+
canShrink += Math.min(item.width - minColumnWidth, columnShrinkMaxWidth);
|
273
|
+
}
|
274
|
+
});
|
275
|
+
console.log('needWidth', needWidth);
|
276
|
+
console.log('max', max);
|
277
|
+
var widthToBeRemoved = needWidth - max;
|
278
|
+
if (widthToBeRemoved <= 0) {
|
279
|
+
return list;
|
280
|
+
}
|
281
|
+
console.log('canShrink', canShrink);
|
282
|
+
console.log('widthToBeRemoved', widthToBeRemoved);
|
283
|
+
// TODO 超过的特别多直接加锁列,这个逻辑怎么设计
|
284
|
+
// 目前用可以缩小的宽度加起来比较一下
|
285
|
+
if (canShrink < widthToBeRemoved) {
|
286
|
+
console.log('canShrink', canShrink);
|
287
|
+
console.log('widthToBeRemoved', widthToBeRemoved);
|
288
|
+
list[0].lock = 'left';
|
289
|
+
if (list[list.length - 1].actionSchema) {
|
290
|
+
list[list.length - 1].lock = 'right';
|
291
|
+
}
|
292
|
+
return list;
|
293
|
+
}
|
294
|
+
//@ts-ignore
|
295
|
+
var sortedList = targetList.sort(function (a, b) {
|
296
|
+
return a.width - b.width;
|
297
|
+
});
|
298
|
+
var shrinkedWidth = 0;
|
299
|
+
for (var i = sortedList.length - 1; i >= 0; i--) {
|
300
|
+
if (shrinkedWidth >= widthToBeRemoved) {
|
301
|
+
break;
|
302
|
+
}
|
303
|
+
var singleShrinkedWidth = Math.min(sortedList[i].width - minColumnWidth, columnShrinkMaxWidth, widthToBeRemoved - shrinkedWidth);
|
304
|
+
sortedList[i].width = sortedList[i].width - singleShrinkedWidth;
|
305
|
+
shrinkedWidth += singleShrinkedWidth;
|
306
|
+
}
|
307
|
+
return result;
|
308
|
+
}
|
309
|
+
/**
|
310
|
+
* 修正内容放在table中默认的padding
|
311
|
+
* @param width
|
312
|
+
* @returns
|
313
|
+
*/
|
314
|
+
function defaultPaddingFixer(width) {
|
315
|
+
var size = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'medium';
|
316
|
+
var half = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
317
|
+
return size === 'medium' ? width + (half ? 16 : 32) + 0.5 : width + (half ? 8 : 16) + 0.5;
|
318
|
+
}
|
319
|
+
function sum() {
|
320
|
+
var list = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
321
|
+
return list.reduce(function (a, b) {
|
322
|
+
return a + b;
|
323
|
+
});
|
324
|
+
}
|
325
|
+
/**
|
326
|
+
* 假设样本正态分布,取 90% 置信区间的上界
|
327
|
+
* 当上界与最大值差距不大(目前是20)的时候,直接用最大值
|
328
|
+
* TODO 这里没考虑是否可以直接用标准差做评判依据,如标准差过大时,直接排序并展示前90%,或标准差很小时直接用最大值
|
329
|
+
* TODO 这里极限情况是不是会挂? 如:长度为9个100和2个10000,估计会挂,是否置信区间这个不靠谱。。。最差情况就直接展示90%的数据算了
|
330
|
+
*/
|
331
|
+
function getConfidence90UpperBound() {
|
332
|
+
var list = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
333
|
+
var max = Math.max.apply(null, list);
|
334
|
+
var length = list.length;
|
335
|
+
var mean = sum(list) / length;
|
336
|
+
var std = Math.sqrt(sum(list.map(function (n) {
|
337
|
+
return (n - mean) * (n - mean);
|
338
|
+
})) / length);
|
339
|
+
var interval = length > 30 ? 1.65 * std / Math.sqrt(length) : 2.2622 * std / Math.sqrt(length);
|
340
|
+
var bound = Math.ceil(mean + interval);
|
341
|
+
if (max - bound < 20) {
|
342
|
+
return Math.min(max, maxColumnWidth);
|
343
|
+
}
|
344
|
+
return Math.min(bound, maxColumnWidth);
|
345
|
+
}
|
package/lib/xconsole.scss
CHANGED
@@ -500,4 +500,27 @@
|
|
500
500
|
border: 0 solid #d9d9d9;
|
501
501
|
border: var(--colortag-border-width,0) solid var(--color-line1-2,#d9d9d9);
|
502
502
|
}
|
503
|
+
.teamix-pro-table-toolbar-filter-column-all-select {
|
504
|
+
.next-menu-item-inner {
|
505
|
+
display: flex;
|
506
|
+
}
|
507
|
+
}
|
508
|
+
.next-dialog-centered {
|
509
|
+
text-align: center;
|
510
|
+
}
|
511
|
+
.next-dialog-wrapper {
|
512
|
+
position: fixed;
|
513
|
+
left: 0;
|
514
|
+
top: 0;
|
515
|
+
right: 0;
|
516
|
+
bottom: 0;
|
517
|
+
|
518
|
+
.next-dialog-v2 {
|
519
|
+
margin: 40px 0;
|
520
|
+
display: inline-block;
|
521
|
+
text-align: left;
|
522
|
+
vertical-align: middle;
|
523
|
+
position: relative;
|
524
|
+
}
|
525
|
+
}
|
503
526
|
}
|
package/package.json
CHANGED
package/es/actions/base.d.ts
DELETED
@@ -1,24 +0,0 @@
|
|
1
|
-
/// <reference types="react" />
|
2
|
-
import { MaybePromise } from '@teamix/utils';
|
3
|
-
export interface BaseAction {
|
4
|
-
/** 事件触发方式,默认是 onClick */
|
5
|
-
trigger?: string;
|
6
|
-
/** 事件发生时,是否执行 e.preventDefault() 方法 */
|
7
|
-
preventDefault?: boolean;
|
8
|
-
/** 事件发生时,是否执行 e.stopPropagation() 方法 */
|
9
|
-
stopPropagation?: boolean;
|
10
|
-
/** 事件执行前的处理函数
|
11
|
-
* 如果返回 false 或者 Promise<false>,则停止 Action 执行。
|
12
|
-
* 如果返回 true 或者 Promise<true>,则正常执行 Action。
|
13
|
-
* 如果返回其他对象,则正常执行 Action,并把返回的对象放到接下来 Action 的上下文中。
|
14
|
-
*/
|
15
|
-
beforeAction?: () => MaybePromise<any>;
|
16
|
-
/** 事件开始执行后的回调函数 */
|
17
|
-
onTrigger?: () => void;
|
18
|
-
/** 事件开始执行完毕的回调函数 */
|
19
|
-
onFinish?: (params?: any) => any;
|
20
|
-
}
|
21
|
-
export declare function eventHandler(action: BaseAction, actionContext: any, onTrigger: (context: any, e: React.MouseEvent<HTMLElement>) => void): {
|
22
|
-
[x: string]: (e: React.MouseEvent<HTMLElement>) => Promise<void>;
|
23
|
-
};
|
24
|
-
export default eventHandler;
|
package/es/actions/confirm.d.ts
DELETED
@@ -1,7 +0,0 @@
|
|
1
|
-
import { DialogAction } from './dialog';
|
2
|
-
export interface ConfirmAction extends DialogAction {
|
3
|
-
}
|
4
|
-
export declare function useConfirmAction(action: DialogAction, context?: any): {
|
5
|
-
[x: string]: (e: import("react").MouseEvent<HTMLElement, MouseEvent>) => Promise<void>;
|
6
|
-
};
|
7
|
-
export default useConfirmAction;
|
@@ -1,7 +0,0 @@
|
|
1
|
-
import { DialogAction } from './dialog';
|
2
|
-
export interface DangerConfirmAction extends DialogAction {
|
3
|
-
}
|
4
|
-
export declare function useDangerConfirmAction(action: DialogAction, context?: any): {
|
5
|
-
[x: string]: (e: import("react").MouseEvent<HTMLElement, MouseEvent>) => Promise<void>;
|
6
|
-
};
|
7
|
-
export default useDangerConfirmAction;
|
@@ -1,5 +0,0 @@
|
|
1
|
-
import { PopConfirmAction } from './pop-confirm';
|
2
|
-
export declare function useDangerPopConfirmAction(action: PopConfirmAction, context?: any): {
|
3
|
-
[x: string]: (e: import("react").MouseEvent<HTMLElement, MouseEvent>) => Promise<void>;
|
4
|
-
};
|
5
|
-
export default useDangerPopConfirmAction;
|
@@ -1,10 +0,0 @@
|
|
1
|
-
import React from 'react';
|
2
|
-
import { DialogAction } from './dialog';
|
3
|
-
export interface DialogComponentAction extends DialogAction {
|
4
|
-
schema: any;
|
5
|
-
component: React.FC<any>;
|
6
|
-
}
|
7
|
-
export declare function useDialogComponentAction(action: DialogComponentAction, context?: any): {
|
8
|
-
[x: string]: (e: React.MouseEvent<HTMLElement, MouseEvent>) => Promise<void>;
|
9
|
-
};
|
10
|
-
export default useDialogComponentAction;
|
@@ -1,29 +0,0 @@
|
|
1
|
-
import React from 'react';
|
2
|
-
import { ProFormProps, ProFormSchema, ProFormType } from '../form';
|
3
|
-
import { RequestAction } from './request';
|
4
|
-
import { DialogAction } from './dialog';
|
5
|
-
export interface DialogFormAction extends DialogAction {
|
6
|
-
/** 表单初始值 */
|
7
|
-
initialValues?: any;
|
8
|
-
/** 表单初始化数据请求 */
|
9
|
-
initialRequest?: RequestAction;
|
10
|
-
/** 表单提交发送数据请求时,是否携带全部表单数据。默认携带 */
|
11
|
-
useFieldValuesForRequest?: boolean;
|
12
|
-
/**
|
13
|
-
* @deprecated 建议使用 schema 配置 ProFormProps 代替
|
14
|
-
*/
|
15
|
-
formProps?: Omit<ProFormProps, 'schema' | 'form'>;
|
16
|
-
/** 同时支持两种配置方式:
|
17
|
-
* 如果想完整定制表单,可使用完整的表单配置项 ProFormProps,但不可以传 form 字段,可以通过 formRef 获取内部 form 实例。
|
18
|
-
* 否则可以只配置 ProFormSchema
|
19
|
-
*/
|
20
|
-
schema: ProFormSchema | Omit<ProFormProps, 'form'>;
|
21
|
-
/** 外部传来的 formRef,用于获取内置 form 实例 */
|
22
|
-
formRef?: React.MutableRefObject<ProFormType | undefined>;
|
23
|
-
/** 是否开启懒惰校验,只校验第一个非法规则,默认开启 */
|
24
|
-
validateFirst?: boolean;
|
25
|
-
}
|
26
|
-
export declare function useDialogFormAction(action: DialogFormAction, context?: any): {
|
27
|
-
[x: string]: (e: React.MouseEvent<HTMLElement, MouseEvent>) => Promise<void>;
|
28
|
-
};
|
29
|
-
export default useDialogFormAction;
|
@@ -1,9 +0,0 @@
|
|
1
|
-
import { DialogAction } from './dialog';
|
2
|
-
import { ProInfoProps } from '..';
|
3
|
-
export interface DialogInfoAction extends DialogAction {
|
4
|
-
schema: ProInfoProps;
|
5
|
-
}
|
6
|
-
export declare function useDialogInfoAction(action: DialogInfoAction, context?: any): {
|
7
|
-
[x: string]: (e: import("react").MouseEvent<HTMLElement, MouseEvent>) => Promise<void>;
|
8
|
-
};
|
9
|
-
export default useDialogInfoAction;
|
@@ -1,9 +0,0 @@
|
|
1
|
-
import { DialogAction } from './dialog';
|
2
|
-
import { ProTableProps } from '..';
|
3
|
-
export interface DialogTableAction extends DialogAction {
|
4
|
-
schema: ProTableProps;
|
5
|
-
}
|
6
|
-
export declare function useDialogTableAction(action: DialogTableAction, context?: any): {
|
7
|
-
[x: string]: (e: import("react").MouseEvent<HTMLElement, MouseEvent>) => Promise<void>;
|
8
|
-
};
|
9
|
-
export default useDialogTableAction;
|
package/es/actions/dialog.d.ts
DELETED
@@ -1,40 +0,0 @@
|
|
1
|
-
import React from 'react';
|
2
|
-
import { QuickShowConfig } from '@alicloudfe/components/types/dialog';
|
3
|
-
import { quickShowDrawerProps } from '@alicloudfe/components/types/drawer';
|
4
|
-
import { ProFormSchema, ProFormSchemaItem } from '../form';
|
5
|
-
import { ProMessageProps } from '../utils/message';
|
6
|
-
import { RequestAction } from './request';
|
7
|
-
export interface DialogAction extends Omit<RequestAction, 'url'>, Omit<QuickShowConfig, 'onError' | 'type'>, Omit<quickShowDrawerProps, 'trigger' | 'animation' | 'height' | 'locale' | 'onError'> {
|
8
|
-
/** 点击「确认按钮」后的数据请求地址,非必填,不填就不发请求 */
|
9
|
-
url?: string;
|
10
|
-
/** 弹窗类型,支持普通弹窗和抽屉两种模式,默认为普通弹窗 */
|
11
|
-
dialogType?: 'dialog' | 'drawer' | 'pop';
|
12
|
-
/** 弹窗快捷调用类型 */
|
13
|
-
dialogQuickShowType?: 'alert' | 'confirm';
|
14
|
-
/** 弹窗消息类型 */
|
15
|
-
messageType?: 'success' | 'warning' | 'error' | 'notice' | 'help' | 'loading';
|
16
|
-
/** 位于弹窗内容最上方的自定义内容区 */
|
17
|
-
beforeContent?: React.ReactNode;
|
18
|
-
/** 位于弹窗内容上方的消息提示区 */
|
19
|
-
message?: ProMessageProps;
|
20
|
-
/** 位于弹窗内容下方的自定义内容区 */
|
21
|
-
afterContent?: React.ReactNode;
|
22
|
-
/** 弹窗页脚描述区,位于按钮组的对面 */
|
23
|
-
footerDescription?: React.ReactNode | ProFormSchema | ProFormSchemaItem;
|
24
|
-
/** 弹窗内容组件的 schema */
|
25
|
-
schema?: any;
|
26
|
-
/** 弹窗内容区的组件 */
|
27
|
-
component?: any;
|
28
|
-
/** 点击确定自定义回调函数 */
|
29
|
-
onOk?: any;
|
30
|
-
/** 点击取消自定义回调函数 */
|
31
|
-
onCancel?: any;
|
32
|
-
/** 隐藏footer区域 */
|
33
|
-
hideFooter?: boolean;
|
34
|
-
/** 支持通过传函数自定义底部按钮 */
|
35
|
-
footer?: any;
|
36
|
-
}
|
37
|
-
export declare function useDialogAction(action: DialogAction, actionContext?: any, hasForm?: boolean): {
|
38
|
-
[x: string]: (e: React.MouseEvent<HTMLElement, MouseEvent>) => Promise<void>;
|
39
|
-
};
|
40
|
-
export default useDialogAction;
|
@@ -1,6 +0,0 @@
|
|
1
|
-
import { DialogFormAction } from './dialog-form';
|
2
|
-
export declare type DrawerFormAction = DialogFormAction;
|
3
|
-
export declare function useDrawerFormAction(action: DrawerFormAction, context?: any): {
|
4
|
-
[x: string]: (e: import("react").MouseEvent<HTMLElement, MouseEvent>) => Promise<void>;
|
5
|
-
};
|
6
|
-
export default useDrawerFormAction;
|
@@ -1,6 +0,0 @@
|
|
1
|
-
import { DialogInfoAction } from './dialog-info';
|
2
|
-
export declare type DrawerInfoAction = DialogInfoAction;
|
3
|
-
export declare function useDrawerInfoAction(action: DrawerInfoAction, context?: any): {
|
4
|
-
[x: string]: (e: import("react").MouseEvent<HTMLElement, MouseEvent>) => Promise<void>;
|
5
|
-
};
|
6
|
-
export default useDrawerInfoAction;
|