fan-standard-comp 3.1.2 → 3.1.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/package.json +1 -1
- package/dist/f26952c118ab6cdcd23dc0028ee98c11.svg +0 -173
- package/dist/fan-standard-comp.umd.js +0 -597
- package/dist/fonts/iconfont.eot +0 -0
- package/dist/fonts/iconfont.ttf +0 -0
- package/dist/fonts/iconfont.woff +0 -0
- package/es/ButtonGroup/ButtonList.d.ts +0 -2
- package/es/ButtonGroup/ButtonList.js +0 -37
- package/es/ButtonGroup/ButtonMenu.d.ts +0 -2
- package/es/ButtonGroup/ButtonMenu.js +0 -38
- package/es/ButtonGroup/PopConfirmTitle.d.ts +0 -9
- package/es/ButtonGroup/PopConfirmTitle.js +0 -37
- package/es/ButtonGroup/index.d.ts +0 -30
- package/es/ButtonGroup/index.js +0 -374
- package/es/ButtonGroup/style/index.less +0 -36
- package/es/DragContent/DragBar.js +0 -21
- package/es/DragContent/index.d.ts +0 -14
- package/es/DragContent/index.js +0 -173
- package/es/DragContent/index.less +0 -44
- package/es/FormComp/ChunkUploader/api.js +0 -76
- package/es/FormComp/ChunkUploader/index.js +0 -391
- package/es/FormComp/ChunkUploader/lib.js +0 -96
- package/es/FormComp/ChunkUploader/style/style.less +0 -3
- package/es/FormComp/ChunkUploader/upload-queue.class.js +0 -167
- package/es/FormComp/ChunkUploader/worker.js +0 -23
- package/es/FormComp/EditButton/index.d.ts +0 -26
- package/es/FormComp/EditButton/index.js +0 -140
- package/es/FormComp/FieldComponent/ReUpload.d.ts +0 -3
- package/es/FormComp/FieldComponent/ReUpload.js +0 -131
- package/es/FormComp/FieldComponent/RefactorTreeSelect.js +0 -245
- package/es/FormComp/FieldComponent/TitleNode.d.ts +0 -6
- package/es/FormComp/FieldComponent/TitleNode.js +0 -9
- package/es/FormComp/FieldComponent/index.d.ts +0 -38
- package/es/FormComp/FieldComponent/index.js +0 -413
- package/es/FormComp/FieldComponent/setReadonlyValues.js +0 -236
- package/es/FormComp/FieldComponent/style/index.less +0 -116
- package/es/FormComp/RenderItemGroup/index.d.ts +0 -37
- package/es/FormComp/RenderItemGroup/index.js +0 -234
- package/es/FormComp/Uploader/index.d.ts +0 -19
- package/es/FormComp/Uploader/index.js +0 -275
- package/es/FormComp/Uploader/style/index.less +0 -14
- package/es/FormComp/Uploader/util.d.ts +0 -8
- package/es/FormComp/Uploader/util.js +0 -38
- package/es/FormComp/VarTemplate/index.js +0 -293
- package/es/FormComp/index.d.ts +0 -1
- package/es/FormComp/index.js +0 -1
- package/es/NavLeafScroll/index.js +0 -379
- package/es/NavLeafScroll/style/index.less +0 -119
- package/es/RefactorTree/data.d.ts +0 -7
- package/es/RefactorTree/index.d.ts +0 -40
- package/es/RefactorTree/index.js +0 -167
- package/es/RefactorTree/indexTreeNode.d.ts +0 -39
- package/es/RefactorTree/indexTreeNode.js +0 -237
- package/es/RefactorTree/style/index.d.ts +0 -1
- package/es/RefactorTree/style/index.js +0 -1
- package/es/RefactorTree/style/index.less +0 -22
- package/es/RefactorTree/util.d.ts +0 -42
- package/es/RefactorTree/util.js +0 -187
- package/es/SpecIcon/fonts/demo.css +0 -539
- package/es/SpecIcon/fonts/demo_index.html +0 -1315
- package/es/SpecIcon/fonts/iconfont.css +0 -211
- package/es/SpecIcon/fonts/iconfont.eot +0 -0
- package/es/SpecIcon/fonts/iconfont.js +0 -41
- package/es/SpecIcon/fonts/iconfont.json +0 -352
- package/es/SpecIcon/fonts/iconfont.svg +0 -173
- package/es/SpecIcon/fonts/iconfont.ttf +0 -0
- package/es/SpecIcon/fonts/iconfont.woff +0 -0
- package/es/SpecIcon/fonts/iconfont.woff2 +0 -0
- package/es/SpecIcon/index.d.ts +0 -17
- package/es/SpecIcon/index.js +0 -77
- package/es/SpecIcon/style/iconfont.less +0 -213
- package/es/SpecIcon/style/index.less +0 -98
- package/es/SplitterLayout/Pane.d.ts +0 -13
- package/es/SplitterLayout/Pane.js +0 -36
- package/es/SplitterLayout/index.js +0 -375
- package/es/SplitterLayout/index.less +0 -58
- package/es/StandardContent/SplitterLayout/Pane.js +0 -50
- package/es/StandardContent/SplitterLayout/index.js +0 -374
- package/es/StandardContent/SplitterLayout/index.less +0 -58
- package/es/StandardContent/SubfieldContent.d.ts +0 -17
- package/es/StandardContent/SubfieldContent.js +0 -41
- package/es/StandardContent/WrapperContent.d.ts +0 -13
- package/es/StandardContent/WrapperContent.js +0 -29
- package/es/StandardContent/data.d.ts +0 -101
- package/es/StandardContent/style/index.less +0 -80
- package/es/StandardDragModal/index.d.ts +0 -11
- package/es/StandardDragModal/index.js +0 -30
- package/es/StandardFilter/index.d.ts +0 -35
- package/es/StandardFilter/index.js +0 -253
- package/es/StandardFilter/style/index.less +0 -62
- package/es/StandardForm/ActionList.js +0 -44
- package/es/StandardForm/StepForm.d.ts +0 -19
- package/es/StandardForm/StepForm.js +0 -267
- package/es/StandardForm/TabForm.d.ts +0 -19
- package/es/StandardForm/TabForm.js +0 -122
- package/es/StandardForm/index.d.ts +0 -32
- package/es/StandardForm/index.js +0 -170
- package/es/StandardForm/style/index.less +0 -58
- package/es/StandardModal/UpdateFormRef.js +0 -18
- package/es/StandardModal/index.d.ts +0 -44
- package/es/StandardModal/index.js +0 -495
- package/es/StandardModal/style/index.less +0 -50
- package/es/StandardPanel/index.d.ts +0 -28
- package/es/StandardPanel/index.js +0 -134
- package/es/StandardPanel/style/index.less +0 -135
- package/es/StandardTable/index.d.ts +0 -22
- package/es/StandardTable/index.js +0 -126
- package/es/StandardTable/style/index.d.ts +0 -1
- package/es/StandardTable/style/index.js +0 -1
- package/es/StandardTable/style/index.less +0 -206
- package/es/components/IconNode/index.d.ts +0 -16
- package/es/components/IconNode/index.js +0 -28
- package/es/components/index.d.ts +0 -2
- package/es/components/index.js +0 -2
- package/es/data/func.code.js +0 -112
- package/es/data/general.config.js +0 -172
- package/es/data/index.js +0 -3
- package/es/index.d.ts +0 -24
- package/es/index.js +0 -31
- package/es/styles/index.less +0 -0
- package/es/theme/spec-variable.less +0 -48
- package/es/utils/ValueFormat.js +0 -50
- package/es/utils/filterPermission.js +0 -111
- package/es/utils/getParentNodes.js +0 -215
- package/es/utils/index.js +0 -3
- package/lib/ButtonGroup/ButtonList.d.ts +0 -2
- package/lib/ButtonGroup/ButtonList.js +0 -55
- package/lib/ButtonGroup/ButtonMenu.d.ts +0 -2
- package/lib/ButtonGroup/ButtonMenu.js +0 -51
- package/lib/ButtonGroup/PopConfirmTitle.d.ts +0 -9
- package/lib/ButtonGroup/PopConfirmTitle.js +0 -48
- package/lib/ButtonGroup/index.d.ts +0 -30
- package/lib/ButtonGroup/index.js +0 -405
- package/lib/ButtonGroup/style/index.less +0 -36
- package/lib/DragContent/DragBar.js +0 -33
- package/lib/DragContent/index.d.ts +0 -14
- package/lib/DragContent/index.js +0 -191
- package/lib/DragContent/index.less +0 -44
- package/lib/FormComp/ChunkUploader/api.js +0 -89
- package/lib/FormComp/ChunkUploader/index.js +0 -410
- package/lib/FormComp/ChunkUploader/lib.js +0 -113
- package/lib/FormComp/ChunkUploader/style/style.less +0 -3
- package/lib/FormComp/ChunkUploader/upload-queue.class.js +0 -174
- package/lib/FormComp/ChunkUploader/worker.js +0 -28
- package/lib/FormComp/EditButton/index.d.ts +0 -26
- package/lib/FormComp/EditButton/index.js +0 -159
- package/lib/FormComp/FieldComponent/ReUpload.d.ts +0 -3
- package/lib/FormComp/FieldComponent/ReUpload.js +0 -151
- package/lib/FormComp/FieldComponent/RefactorTreeSelect.js +0 -268
- package/lib/FormComp/FieldComponent/TitleNode.d.ts +0 -6
- package/lib/FormComp/FieldComponent/TitleNode.js +0 -19
- package/lib/FormComp/FieldComponent/index.d.ts +0 -38
- package/lib/FormComp/FieldComponent/index.js +0 -457
- package/lib/FormComp/FieldComponent/setReadonlyValues.js +0 -263
- package/lib/FormComp/FieldComponent/style/index.less +0 -116
- package/lib/FormComp/RenderItemGroup/index.d.ts +0 -37
- package/lib/FormComp/RenderItemGroup/index.js +0 -255
- package/lib/FormComp/Uploader/index.d.ts +0 -19
- package/lib/FormComp/Uploader/index.js +0 -301
- package/lib/FormComp/Uploader/style/index.less +0 -14
- package/lib/FormComp/Uploader/util.d.ts +0 -8
- package/lib/FormComp/Uploader/util.js +0 -47
- package/lib/FormComp/VarTemplate/index.js +0 -308
- package/lib/FormComp/index.d.ts +0 -1
- package/lib/FormComp/index.js +0 -15
- package/lib/NavLeafScroll/index.js +0 -397
- package/lib/NavLeafScroll/style/index.less +0 -119
- package/lib/RefactorTree/data.d.ts +0 -7
- package/lib/RefactorTree/index.d.ts +0 -40
- package/lib/RefactorTree/index.js +0 -190
- package/lib/RefactorTree/indexTreeNode.d.ts +0 -39
- package/lib/RefactorTree/indexTreeNode.js +0 -260
- package/lib/RefactorTree/style/index.d.ts +0 -1
- package/lib/RefactorTree/style/index.js +0 -3
- package/lib/RefactorTree/style/index.less +0 -22
- package/lib/RefactorTree/util.d.ts +0 -42
- package/lib/RefactorTree/util.js +0 -195
- package/lib/SpecIcon/fonts/demo.css +0 -539
- package/lib/SpecIcon/fonts/demo_index.html +0 -1315
- package/lib/SpecIcon/fonts/iconfont.css +0 -211
- package/lib/SpecIcon/fonts/iconfont.eot +0 -0
- package/lib/SpecIcon/fonts/iconfont.js +0 -43
- package/lib/SpecIcon/fonts/iconfont.json +0 -352
- package/lib/SpecIcon/fonts/iconfont.svg +0 -173
- package/lib/SpecIcon/fonts/iconfont.ttf +0 -0
- package/lib/SpecIcon/fonts/iconfont.woff +0 -0
- package/lib/SpecIcon/fonts/iconfont.woff2 +0 -0
- package/lib/SpecIcon/index.d.ts +0 -17
- package/lib/SpecIcon/index.js +0 -90
- package/lib/SpecIcon/style/iconfont.less +0 -213
- package/lib/SpecIcon/style/index.less +0 -98
- package/lib/SplitterLayout/Pane.d.ts +0 -13
- package/lib/SplitterLayout/Pane.js +0 -48
- package/lib/SplitterLayout/index.js +0 -386
- package/lib/SplitterLayout/index.less +0 -58
- package/lib/StandardContent/SplitterLayout/Pane.js +0 -62
- package/lib/StandardContent/SplitterLayout/index.js +0 -387
- package/lib/StandardContent/SplitterLayout/index.less +0 -58
- package/lib/StandardContent/SubfieldContent.d.ts +0 -17
- package/lib/StandardContent/SubfieldContent.js +0 -56
- package/lib/StandardContent/WrapperContent.d.ts +0 -13
- package/lib/StandardContent/WrapperContent.js +0 -43
- package/lib/StandardContent/data.d.ts +0 -101
- package/lib/StandardContent/style/index.less +0 -80
- package/lib/StandardDragModal/index.d.ts +0 -11
- package/lib/StandardDragModal/index.js +0 -43
- package/lib/StandardFilter/index.d.ts +0 -35
- package/lib/StandardFilter/index.js +0 -272
- package/lib/StandardFilter/style/index.less +0 -62
- package/lib/StandardForm/ActionList.js +0 -57
- package/lib/StandardForm/StepForm.d.ts +0 -19
- package/lib/StandardForm/StepForm.js +0 -295
- package/lib/StandardForm/TabForm.d.ts +0 -19
- package/lib/StandardForm/TabForm.js +0 -148
- package/lib/StandardForm/index.d.ts +0 -32
- package/lib/StandardForm/index.js +0 -197
- package/lib/StandardForm/style/index.less +0 -58
- package/lib/StandardModal/UpdateFormRef.js +0 -32
- package/lib/StandardModal/index.d.ts +0 -44
- package/lib/StandardModal/index.js +0 -525
- package/lib/StandardModal/style/index.less +0 -50
- package/lib/StandardPanel/index.d.ts +0 -28
- package/lib/StandardPanel/index.js +0 -155
- package/lib/StandardPanel/style/index.less +0 -135
- package/lib/StandardTable/index.d.ts +0 -22
- package/lib/StandardTable/index.js +0 -143
- package/lib/StandardTable/style/index.d.ts +0 -1
- package/lib/StandardTable/style/index.js +0 -3
- package/lib/StandardTable/style/index.less +0 -206
- package/lib/components/IconNode/index.d.ts +0 -16
- package/lib/components/IconNode/index.js +0 -39
- package/lib/components/index.d.ts +0 -2
- package/lib/components/index.js +0 -15
- package/lib/data/func.code.js +0 -119
- package/lib/data/general.config.js +0 -179
- package/lib/data/index.js +0 -23
- package/lib/index.d.ts +0 -24
- package/lib/index.js +0 -236
- package/lib/styles/index.less +0 -0
- package/lib/theme/spec-variable.less +0 -48
- package/lib/utils/ValueFormat.js +0 -58
- package/lib/utils/filterPermission.js +0 -127
- package/lib/utils/getParentNodes.js +0 -226
- package/lib/utils/index.js +0 -35
package/dist/fonts/iconfont.eot
DELETED
|
Binary file
|
package/dist/fonts/iconfont.ttf
DELETED
|
Binary file
|
package/dist/fonts/iconfont.woff
DELETED
|
Binary file
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import "antd/es/button/style";
|
|
2
|
-
import _Button from "antd/es/button";
|
|
3
|
-
import "antd/es/dropdown/style";
|
|
4
|
-
import _Dropdown from "antd/es/dropdown";
|
|
5
|
-
// 渲染按钮形式 (用于筛选)
|
|
6
|
-
import React from "react";
|
|
7
|
-
import SpecIcon from "@/SpecIcon";
|
|
8
|
-
import buttonMenu from './ButtonMenu';
|
|
9
|
-
import IconNode from "@/components/IconNode";
|
|
10
|
-
import { btnIsDisabled } from "@/utils/filterPermission";
|
|
11
|
-
|
|
12
|
-
var RenderButtonList = function RenderButtonList(item) {
|
|
13
|
-
if (Array.isArray(item.children) && item.children.length > 0) {
|
|
14
|
-
return /*#__PURE__*/React.createElement(_Dropdown, {
|
|
15
|
-
overlay: buttonMenu(item.children),
|
|
16
|
-
placement: "bottomRight"
|
|
17
|
-
}, /*#__PURE__*/React.createElement(_Button, {
|
|
18
|
-
type: "primary"
|
|
19
|
-
}, item.exName || item.name, " ", /*#__PURE__*/React.createElement(SpecIcon, {
|
|
20
|
-
name: "down"
|
|
21
|
-
})));
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
return /*#__PURE__*/React.createElement(_Button, {
|
|
25
|
-
type: item.type ? item.type : 'primary',
|
|
26
|
-
danger: item.danger,
|
|
27
|
-
icon: /*#__PURE__*/React.createElement(IconNode, {
|
|
28
|
-
icon: item.icon
|
|
29
|
-
}),
|
|
30
|
-
disabled: btnIsDisabled(item.disabled, item.rowParams),
|
|
31
|
-
onClick: item.fn ? function () {
|
|
32
|
-
return item.fn(item);
|
|
33
|
-
} : null
|
|
34
|
-
}, item.exName || item.name);
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
export default RenderButtonList;
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import "antd/es/menu/style";
|
|
2
|
-
import _Menu from "antd/es/menu";
|
|
3
|
-
// 渲染按钮多层级形式 (用于筛选)
|
|
4
|
-
import React from "react";
|
|
5
|
-
import IconNode from "@/components/IconNode";
|
|
6
|
-
|
|
7
|
-
var RenderButtonList = function RenderButtonList(group) {
|
|
8
|
-
return /*#__PURE__*/React.createElement(_Menu, null, group.map(function (item, index) {
|
|
9
|
-
if (item.children) {
|
|
10
|
-
return /*#__PURE__*/React.createElement(_Menu.SubMenu, {
|
|
11
|
-
title: item.exName || item.name,
|
|
12
|
-
key: index
|
|
13
|
-
}, item.children.map(function (child, childIndex) {
|
|
14
|
-
return /*#__PURE__*/React.createElement(_Menu.Item, {
|
|
15
|
-
key: childIndex
|
|
16
|
-
}, /*#__PURE__*/React.createElement("a", {
|
|
17
|
-
onClick: child.fn ? function () {
|
|
18
|
-
return child.fn(child);
|
|
19
|
-
} : null
|
|
20
|
-
}, /*#__PURE__*/React.createElement(IconNode, {
|
|
21
|
-
icon: child.icon
|
|
22
|
-
}), " ", child.exName || child.name));
|
|
23
|
-
}));
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
return /*#__PURE__*/React.createElement(_Menu.Item, {
|
|
27
|
-
key: index
|
|
28
|
-
}, /*#__PURE__*/React.createElement("a", {
|
|
29
|
-
onClick: item.fn ? function () {
|
|
30
|
-
return item.fn(item);
|
|
31
|
-
} : null
|
|
32
|
-
}, /*#__PURE__*/React.createElement(IconNode, {
|
|
33
|
-
icon: item.icon
|
|
34
|
-
}), " ", item.exName || item.name));
|
|
35
|
-
}));
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
export default RenderButtonList;
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
2
|
-
|
|
3
|
-
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."); }
|
|
4
|
-
|
|
5
|
-
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); }
|
|
6
|
-
|
|
7
|
-
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter); }
|
|
8
|
-
|
|
9
|
-
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
10
|
-
|
|
11
|
-
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; }
|
|
12
|
-
|
|
13
|
-
import React from "react"; // 气泡确认框标题配置
|
|
14
|
-
|
|
15
|
-
var PopConfirmTitle = function PopConfirmTitle(propsData) {
|
|
16
|
-
var confirmConfig = propsData.confirmConfig,
|
|
17
|
-
confirmText = propsData.confirmText,
|
|
18
|
-
extraRow = propsData.extraRow;
|
|
19
|
-
|
|
20
|
-
if (propsData.hasOwnProperty('confirmConfig') && confirmConfig.title) {
|
|
21
|
-
var title = confirmConfig.title;
|
|
22
|
-
if (!title) return /*#__PURE__*/React.createElement(React.Fragment, null, null);
|
|
23
|
-
return typeof title === "function" ? title.apply(void 0, _toConsumableArray(Object.keys(extraRow).map(function (pItem) {
|
|
24
|
-
return extraRow[pItem];
|
|
25
|
-
}))) : title;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
if (confirmText) {
|
|
29
|
-
return typeof confirmText === "function" ? confirmText.apply(void 0, _toConsumableArray(Object.keys(extraRow).map(function (pItem) {
|
|
30
|
-
return extraRow[pItem];
|
|
31
|
-
}))) : confirmText;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, null);
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
export default PopConfirmTitle;
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import './style/index.less';
|
|
3
|
-
interface ButtonGroupRowParamsProps {
|
|
4
|
-
text?: any;
|
|
5
|
-
record?: object;
|
|
6
|
-
rowIndex?: number;
|
|
7
|
-
}
|
|
8
|
-
export interface ButtonGroupOptionsProps {
|
|
9
|
-
name?: string;
|
|
10
|
-
code?: string;
|
|
11
|
-
exName?: string;
|
|
12
|
-
isHide?: boolean;
|
|
13
|
-
disabled?: boolean;
|
|
14
|
-
icon?: React.ReactNode | string | string[];
|
|
15
|
-
fn?: any;
|
|
16
|
-
children?: ButtonGroupOptionsProps[];
|
|
17
|
-
render?: (() => React.ReactNode) | React.ReactNode;
|
|
18
|
-
confirmText?: any;
|
|
19
|
-
confirmConfig?: any;
|
|
20
|
-
}
|
|
21
|
-
interface ButtonGroupProps {
|
|
22
|
-
type?: 'button' | 'text';
|
|
23
|
-
rowParams?: ButtonGroupRowParamsProps;
|
|
24
|
-
codes?: object[];
|
|
25
|
-
permissionCodes?: string[];
|
|
26
|
-
options?: ButtonGroupOptionsProps[];
|
|
27
|
-
min?: number;
|
|
28
|
-
}
|
|
29
|
-
declare const ButtonGroup: (props: ButtonGroupProps) => JSX.Element;
|
|
30
|
-
export default ButtonGroup;
|
package/es/ButtonGroup/index.js
DELETED
|
@@ -1,374 +0,0 @@
|
|
|
1
|
-
import "antd/es/popconfirm/style";
|
|
2
|
-
import _Popconfirm from "antd/es/popconfirm";
|
|
3
|
-
import "antd/es/button/style";
|
|
4
|
-
import _Button from "antd/es/button";
|
|
5
|
-
import "antd/es/dropdown/style";
|
|
6
|
-
import _Dropdown from "antd/es/dropdown";
|
|
7
|
-
import "antd/es/menu/style";
|
|
8
|
-
import _Menu from "antd/es/menu";
|
|
9
|
-
|
|
10
|
-
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
11
|
-
|
|
12
|
-
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."); }
|
|
13
|
-
|
|
14
|
-
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter); }
|
|
15
|
-
|
|
16
|
-
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
17
|
-
|
|
18
|
-
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
19
|
-
|
|
20
|
-
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
21
|
-
|
|
22
|
-
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); }
|
|
23
|
-
|
|
24
|
-
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; }
|
|
25
|
-
|
|
26
|
-
function _iterableToArrayLimit(arr, i) { if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return; var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
27
|
-
|
|
28
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
29
|
-
|
|
30
|
-
import { __rest } from "tslib";
|
|
31
|
-
import React, { useState, useEffect } from "react";
|
|
32
|
-
import { IconNode } from "../components/index";
|
|
33
|
-
import SpecIcon from "../SpecIcon/index";
|
|
34
|
-
import PopConfirmTitle from './PopConfirmTitle';
|
|
35
|
-
import { funcCode } from "../data/index";
|
|
36
|
-
import { DownOutlined, QuestionCircleOutlined } from "@ant-design/icons";
|
|
37
|
-
import { removeNoPermission, btnIsDisabled } from '../utils/filterPermission.js';
|
|
38
|
-
import './style/index.less';
|
|
39
|
-
|
|
40
|
-
var ButtonGroup = function ButtonGroup(props) {
|
|
41
|
-
var _props$type = props.type,
|
|
42
|
-
type = _props$type === void 0 ? 'button' : _props$type,
|
|
43
|
-
_props$rowParams = props.rowParams,
|
|
44
|
-
rowParams = _props$rowParams === void 0 ? {
|
|
45
|
-
text: undefined,
|
|
46
|
-
record: undefined,
|
|
47
|
-
rowIndex: undefined
|
|
48
|
-
} : _props$rowParams,
|
|
49
|
-
_props$codes = props.codes,
|
|
50
|
-
codes = _props$codes === void 0 ? funcCode.btnFuncCodes : _props$codes,
|
|
51
|
-
permissionCodes = props.permissionCodes;
|
|
52
|
-
var _props$options = props.options,
|
|
53
|
-
options = _props$options === void 0 ? [] : _props$options,
|
|
54
|
-
_props$min = props.min,
|
|
55
|
-
min = _props$min === void 0 ? 3 : _props$min; // 最小展示长度不能小于2
|
|
56
|
-
|
|
57
|
-
if (!options) return null; // 没有配置list返回null
|
|
58
|
-
|
|
59
|
-
var _useState = useState(-1),
|
|
60
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
61
|
-
popVisibleIndex = _useState2[0],
|
|
62
|
-
setPopVisibleIndex = _useState2[1];
|
|
63
|
-
|
|
64
|
-
var _useState3 = useState({}),
|
|
65
|
-
_useState4 = _slicedToArray(_useState3, 2),
|
|
66
|
-
popRow = _useState4[0],
|
|
67
|
-
setPopRow = _useState4[1];
|
|
68
|
-
|
|
69
|
-
var _useState5 = useState([]),
|
|
70
|
-
_useState6 = _slicedToArray(_useState5, 2),
|
|
71
|
-
resetList = _useState6[0],
|
|
72
|
-
setResetList = _useState6[1];
|
|
73
|
-
|
|
74
|
-
useEffect(function () {
|
|
75
|
-
// 重组选项options集合数据,排除:无权限(有配置code,并且不包含permissionCodes内)的数据及,isHide 为true的数据
|
|
76
|
-
setResetList(_toConsumableArray(removeNoPermission(options, permissionCodes, codes, rowParams)) || []);
|
|
77
|
-
return function () {
|
|
78
|
-
setResetList([]);
|
|
79
|
-
};
|
|
80
|
-
}, [options, codes, permissionCodes]);
|
|
81
|
-
useEffect(function () {
|
|
82
|
-
setPopVisibleIndex(-1);
|
|
83
|
-
}, [rowParams]); // 渲染按钮多层级形式 (用于筛选)
|
|
84
|
-
|
|
85
|
-
var buttonMenu = function buttonMenu(group) {
|
|
86
|
-
return /*#__PURE__*/React.createElement(_Menu, null, group.map(function (item, index) {
|
|
87
|
-
if (item.children) {
|
|
88
|
-
return /*#__PURE__*/React.createElement(_Menu.SubMenu, {
|
|
89
|
-
title: item.exName || item.name,
|
|
90
|
-
key: index
|
|
91
|
-
}, item.children.map(function (child, childIndex) {
|
|
92
|
-
return /*#__PURE__*/React.createElement(_Menu.Item, {
|
|
93
|
-
key: childIndex
|
|
94
|
-
}, /*#__PURE__*/React.createElement("a", {
|
|
95
|
-
onClick: child.fn ? function () {
|
|
96
|
-
return child.fn(child);
|
|
97
|
-
} : null
|
|
98
|
-
}, /*#__PURE__*/React.createElement(IconNode, {
|
|
99
|
-
icon: child.icon
|
|
100
|
-
}), " ", child.exName || child.name));
|
|
101
|
-
}));
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
return /*#__PURE__*/React.createElement(_Menu.Item, {
|
|
105
|
-
key: index
|
|
106
|
-
}, /*#__PURE__*/React.createElement("a", {
|
|
107
|
-
onClick: item.fn ? function () {
|
|
108
|
-
return item.fn(item);
|
|
109
|
-
} : null
|
|
110
|
-
}, /*#__PURE__*/React.createElement(IconNode, {
|
|
111
|
-
icon: item.icon
|
|
112
|
-
}), " ", item.exName || item.name));
|
|
113
|
-
}));
|
|
114
|
-
}; // 渲染按钮形式 (用于筛选)
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
var RenderButtonList = function RenderButtonList(item) {
|
|
118
|
-
var exName = item.exName,
|
|
119
|
-
name = item.name,
|
|
120
|
-
type = item.type,
|
|
121
|
-
icon = item.icon,
|
|
122
|
-
ghost = item.ghost,
|
|
123
|
-
danger = item.danger,
|
|
124
|
-
disabled = item.disabled,
|
|
125
|
-
loading = item.loading,
|
|
126
|
-
fn = item.fn,
|
|
127
|
-
code = item.code,
|
|
128
|
-
rowParams = item.rowParams,
|
|
129
|
-
others = __rest(item, ["exName", "name", "type", "icon", "ghost", "danger", "disabled", "loading", "fn", "code", "rowParams"]);
|
|
130
|
-
|
|
131
|
-
if (Array.isArray(item.children) && item.children.length > 0) {
|
|
132
|
-
return /*#__PURE__*/React.createElement(_Dropdown, {
|
|
133
|
-
overlay: buttonMenu(item.children),
|
|
134
|
-
placement: "bottomRight"
|
|
135
|
-
}, /*#__PURE__*/React.createElement(_Button, {
|
|
136
|
-
type: "primary"
|
|
137
|
-
}, item.exName || item.name, " ", /*#__PURE__*/React.createElement(SpecIcon, {
|
|
138
|
-
name: "down"
|
|
139
|
-
})));
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
return /*#__PURE__*/React.createElement(_Button, Object.assign({
|
|
143
|
-
type: type || 'primary',
|
|
144
|
-
danger: danger,
|
|
145
|
-
ghost: ghost,
|
|
146
|
-
onClick: fn ? function () {
|
|
147
|
-
return fn(item);
|
|
148
|
-
} : null
|
|
149
|
-
}, others, {
|
|
150
|
-
icon: /*#__PURE__*/React.createElement(IconNode, {
|
|
151
|
-
icon: icon
|
|
152
|
-
}),
|
|
153
|
-
disabled: btnIsDisabled(disabled, rowParams)
|
|
154
|
-
}), exName || name);
|
|
155
|
-
}; // 渲染文本形式多级菜单列表(用于表格)
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
var textMenu = function textMenu(group) {
|
|
159
|
-
return /*#__PURE__*/React.createElement(_Menu, {
|
|
160
|
-
className: "spec-button-text-dropdown"
|
|
161
|
-
}, group.map(function (gItem, gIndex) {
|
|
162
|
-
if (gItem.children) {
|
|
163
|
-
return /*#__PURE__*/React.createElement(_Menu.SubMenu, {
|
|
164
|
-
title: gItem.exName || gItem.name,
|
|
165
|
-
key: gItem
|
|
166
|
-
}, gItem.children.map(function (child, childIndex) {
|
|
167
|
-
return /*#__PURE__*/React.createElement(_Menu.Item, {
|
|
168
|
-
key: childIndex
|
|
169
|
-
}, /*#__PURE__*/React.createElement("a", {
|
|
170
|
-
onClick: child.fn ? function () {
|
|
171
|
-
return child.fn.apply(child, _toConsumableArray(Object.keys(rowParams).map(function (pItem) {
|
|
172
|
-
return rowParams[pItem];
|
|
173
|
-
})));
|
|
174
|
-
} : null
|
|
175
|
-
}, child.render ? child.render.apply(child, _toConsumableArray(Object.keys(rowParams).map(function (pItem) {
|
|
176
|
-
return rowParams[pItem];
|
|
177
|
-
}))) : child.exName || child.name));
|
|
178
|
-
}));
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
return /*#__PURE__*/React.createElement(_Menu.Item, {
|
|
182
|
-
key: gIndex,
|
|
183
|
-
disabled: btnIsDisabled(gItem.disabled, rowParams)
|
|
184
|
-
}, gItem.hasOwnProperty('confirmText') || gItem.hasOwnProperty('confirmConfig') ?
|
|
185
|
-
/*#__PURE__*/
|
|
186
|
-
// @ts-ignore
|
|
187
|
-
React.createElement("a", {
|
|
188
|
-
disabled: btnIsDisabled(gItem.disabled, rowParams),
|
|
189
|
-
onClick: gItem.fn ? function () {
|
|
190
|
-
setPopVisibleIndex(rowParams.rowIndex);
|
|
191
|
-
setPopRow(gItem);
|
|
192
|
-
} : null
|
|
193
|
-
}, gItem.render ? gItem.render.apply(gItem, _toConsumableArray(Object.keys(rowParams).map(function (pItem) {
|
|
194
|
-
return rowParams[pItem];
|
|
195
|
-
}))) : gItem.exName || gItem.name) : /*#__PURE__*/React.createElement("a", {
|
|
196
|
-
className: "spec-button-group-text",
|
|
197
|
-
onClick: gItem.fn ? function () {
|
|
198
|
-
return gItem.fn.apply(gItem, _toConsumableArray(Object.keys(rowParams).map(function (pItem) {
|
|
199
|
-
return rowParams[pItem];
|
|
200
|
-
})));
|
|
201
|
-
} : null,
|
|
202
|
-
// @ts-ignore
|
|
203
|
-
disabled: btnIsDisabled(gItem.disabled, rowParams)
|
|
204
|
-
}, gItem.render ? gItem.render.apply(gItem, _toConsumableArray(Object.keys(rowParams).map(function (pItem) {
|
|
205
|
-
return rowParams[pItem];
|
|
206
|
-
}))) : gItem.exName || gItem.name));
|
|
207
|
-
}));
|
|
208
|
-
}; // 渲染文本形式 列表(用于表格)
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
var RenderTextList = function RenderTextList(item) {
|
|
212
|
-
if (Array.isArray(item.children) && item.children.length > 0) {
|
|
213
|
-
return /*#__PURE__*/React.createElement(_Dropdown, {
|
|
214
|
-
overlay: textMenu(item.children),
|
|
215
|
-
placement: "bottomRight"
|
|
216
|
-
}, /*#__PURE__*/React.createElement("a", {
|
|
217
|
-
className: "spec-button-group-text"
|
|
218
|
-
}, item.render ? item.render.apply(item, _toConsumableArray(Object.keys(rowParams).map(function (pItem) {
|
|
219
|
-
return rowParams[pItem];
|
|
220
|
-
}))) : item.exName || item.name, " ", /*#__PURE__*/React.createElement(SpecIcon, {
|
|
221
|
-
name: "down"
|
|
222
|
-
})));
|
|
223
|
-
}
|
|
224
|
-
|
|
225
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, item.hasOwnProperty('confirmText') || item.hasOwnProperty('confirmConfig') ? /*#__PURE__*/React.createElement(_Popconfirm, Object.assign({
|
|
226
|
-
placement: "topRight",
|
|
227
|
-
icon: /*#__PURE__*/React.createElement(QuestionCircleOutlined, null)
|
|
228
|
-
}, item.hasOwnProperty('confirmConfig') ? item.confirmConfig : {}, {
|
|
229
|
-
title: /*#__PURE__*/React.createElement(PopConfirmTitle, Object.assign({}, item, {
|
|
230
|
-
extraRow: rowParams
|
|
231
|
-
})),
|
|
232
|
-
onCancel: function onCancel() {
|
|
233
|
-
if (item.hasOwnProperty('confirmConfig') && item.confirmConfig.onCancel) {
|
|
234
|
-
var _item$confirmConfig;
|
|
235
|
-
|
|
236
|
-
(_item$confirmConfig = item.confirmConfig).onCancel.apply(_item$confirmConfig, _toConsumableArray(Object.keys(rowParams).map(function (pItem) {
|
|
237
|
-
return rowParams[pItem];
|
|
238
|
-
})));
|
|
239
|
-
}
|
|
240
|
-
},
|
|
241
|
-
onConfirm: function onConfirm() {
|
|
242
|
-
if (item.hasOwnProperty('confirmConfig') && item.confirmConfig.onConfirm) {
|
|
243
|
-
var _item$confirmConfig2;
|
|
244
|
-
|
|
245
|
-
(_item$confirmConfig2 = item.confirmConfig).onConfirm.apply(_item$confirmConfig2, _toConsumableArray(Object.keys(rowParams).map(function (pItem) {
|
|
246
|
-
return rowParams[pItem];
|
|
247
|
-
})));
|
|
248
|
-
} else if (item.fn) {
|
|
249
|
-
item.fn.apply(item, _toConsumableArray(Object.keys(rowParams).map(function (pItem) {
|
|
250
|
-
return rowParams[pItem];
|
|
251
|
-
})));
|
|
252
|
-
}
|
|
253
|
-
}
|
|
254
|
-
}), /*#__PURE__*/React.createElement("a", {
|
|
255
|
-
className: "spec-button-group-text",
|
|
256
|
-
key: item.index,
|
|
257
|
-
title: item.exName || item.name,
|
|
258
|
-
// @ts-ignore
|
|
259
|
-
disabled: btnIsDisabled(item.disabled, rowParams)
|
|
260
|
-
}, item.render ? item.render.apply(item, _toConsumableArray(Object.keys(rowParams).map(function (pItem) {
|
|
261
|
-
return rowParams[pItem];
|
|
262
|
-
}))) : item.exName || item.name)) : /*#__PURE__*/React.createElement("a", {
|
|
263
|
-
className: "spec-button-group-text",
|
|
264
|
-
title: item.exName || item.name,
|
|
265
|
-
key: item.index,
|
|
266
|
-
// @ts-ignore
|
|
267
|
-
disabled: btnIsDisabled(item.disabled, rowParams),
|
|
268
|
-
onClick: item.fn ? function () {
|
|
269
|
-
return item.fn.apply(item, _toConsumableArray(Object.keys(rowParams).map(function (pItem) {
|
|
270
|
-
return rowParams[pItem];
|
|
271
|
-
})));
|
|
272
|
-
} : null
|
|
273
|
-
}, item.render ? item.render.apply(item, _toConsumableArray(Object.keys(rowParams).map(function (pItem) {
|
|
274
|
-
return rowParams[pItem];
|
|
275
|
-
}))) : item.exName || item.name));
|
|
276
|
-
}; // 渲染展示的按钮列表
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
var renderDisplayButton = function renderDisplayButton(item, index) {
|
|
280
|
-
/*渲染自定义*/
|
|
281
|
-
if (item.render) {
|
|
282
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, typeof item.render === 'function' ? item.render.apply(item, _toConsumableArray(Object.keys(rowParams).map(function (pItem) {
|
|
283
|
-
return rowParams[pItem];
|
|
284
|
-
}))) : item.render);
|
|
285
|
-
}
|
|
286
|
-
/*渲染按钮形式*/
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
if (type === 'button') {
|
|
290
|
-
return /*#__PURE__*/React.createElement(RenderButtonList, Object.assign({
|
|
291
|
-
key: index
|
|
292
|
-
}, item, {
|
|
293
|
-
rowParams: rowParams
|
|
294
|
-
}));
|
|
295
|
-
}
|
|
296
|
-
/*渲染文本形式*/
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
return /*#__PURE__*/React.createElement(RenderTextList, Object.assign({
|
|
300
|
-
key: index
|
|
301
|
-
}, item));
|
|
302
|
-
};
|
|
303
|
-
|
|
304
|
-
if (min < 2) min = 2;
|
|
305
|
-
|
|
306
|
-
if (resetList.length === 0) {
|
|
307
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, type !== 'button' ? '-' : null);
|
|
308
|
-
}
|
|
309
|
-
|
|
310
|
-
if (resetList.length > min) {
|
|
311
|
-
var forGroup = resetList.slice(0, min - 1);
|
|
312
|
-
var forDrop = resetList.slice(min - 1);
|
|
313
|
-
return /*#__PURE__*/React.createElement("span", {
|
|
314
|
-
className: "spec-button-group"
|
|
315
|
-
}, forGroup.map(function (item, index) {
|
|
316
|
-
return index < min - 1 ? renderDisplayButton(item, index) : null;
|
|
317
|
-
}), type === 'button' ? /*#__PURE__*/React.createElement(_Dropdown, {
|
|
318
|
-
overlay: buttonMenu(forDrop),
|
|
319
|
-
placement: "bottomRight"
|
|
320
|
-
}, /*#__PURE__*/React.createElement(_Button, {
|
|
321
|
-
type: "primary"
|
|
322
|
-
}, "\u66F4\u591A ", /*#__PURE__*/React.createElement(SpecIcon, {
|
|
323
|
-
name: "down"
|
|
324
|
-
}))) : /*#__PURE__*/React.createElement(_Popconfirm, Object.assign({
|
|
325
|
-
placement: "topRight",
|
|
326
|
-
visible: popVisibleIndex === rowParams.rowIndex,
|
|
327
|
-
icon: /*#__PURE__*/React.createElement(QuestionCircleOutlined, null),
|
|
328
|
-
trigger: "click"
|
|
329
|
-
}, popRow.hasOwnProperty('confirmConfig') ? popRow.confirmConfig : {}, {
|
|
330
|
-
title: /*#__PURE__*/React.createElement(PopConfirmTitle, Object.assign({}, popRow, {
|
|
331
|
-
extraRow: rowParams
|
|
332
|
-
})),
|
|
333
|
-
onCancel: function onCancel() {
|
|
334
|
-
setPopVisibleIndex(-1); // 优先调用其 confirmConfig 配置的 onCancel 事件
|
|
335
|
-
|
|
336
|
-
if (popRow.hasOwnProperty('confirmConfig') && popRow.confirmConfig.onCancel) {
|
|
337
|
-
var _popRow$confirmConfig;
|
|
338
|
-
|
|
339
|
-
(_popRow$confirmConfig = popRow.confirmConfig).onCancel.apply(_popRow$confirmConfig, _toConsumableArray(Object.keys(rowParams).map(function (pItem) {
|
|
340
|
-
return rowParams[pItem];
|
|
341
|
-
})));
|
|
342
|
-
}
|
|
343
|
-
},
|
|
344
|
-
onConfirm: function onConfirm() {
|
|
345
|
-
setPopVisibleIndex(-1); // 优先调用其 confirmConfig 配置的 onConfirm 事件
|
|
346
|
-
|
|
347
|
-
if (popRow.hasOwnProperty('confirmConfig') && popRow.confirmConfig.onConfirm) {
|
|
348
|
-
var _popRow$confirmConfig2;
|
|
349
|
-
|
|
350
|
-
(_popRow$confirmConfig2 = popRow.confirmConfig).onConfirm.apply(_popRow$confirmConfig2, _toConsumableArray(Object.keys(rowParams).map(function (pItem) {
|
|
351
|
-
return rowParams[pItem];
|
|
352
|
-
})));
|
|
353
|
-
} else if (popRow.fn) {
|
|
354
|
-
popRow.fn.apply(popRow, _toConsumableArray(Object.keys(rowParams).map(function (pItem) {
|
|
355
|
-
return rowParams[pItem];
|
|
356
|
-
})));
|
|
357
|
-
}
|
|
358
|
-
}
|
|
359
|
-
}), /*#__PURE__*/React.createElement(_Dropdown, {
|
|
360
|
-
overlay: textMenu(forDrop),
|
|
361
|
-
placement: "bottomRight"
|
|
362
|
-
}, /*#__PURE__*/React.createElement("a", {
|
|
363
|
-
className: "spec-button-group-text"
|
|
364
|
-
}, "\u66F4\u591A ", /*#__PURE__*/React.createElement(DownOutlined, null)))));
|
|
365
|
-
}
|
|
366
|
-
|
|
367
|
-
return /*#__PURE__*/React.createElement("span", {
|
|
368
|
-
className: "spec-button-group"
|
|
369
|
-
}, resetList.map(function (item, index) {
|
|
370
|
-
return renderDisplayButton(item, index);
|
|
371
|
-
}));
|
|
372
|
-
};
|
|
373
|
-
|
|
374
|
-
export default ButtonGroup;
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
@root-entry-name: default;
|
|
2
|
-
@import (reference) '~antd/es/style/themes/index';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
.spec-button-group {
|
|
6
|
-
display: inline-block;
|
|
7
|
-
vertical-align: middle;
|
|
8
|
-
.ant-btn + .ant-btn {
|
|
9
|
-
margin-left: @padding-sm;
|
|
10
|
-
}
|
|
11
|
-
.spec-button-group-text + .spec-button-group-text {
|
|
12
|
-
position: relative;
|
|
13
|
-
margin-left: @padding-sm;
|
|
14
|
-
&:before {
|
|
15
|
-
position: absolute;
|
|
16
|
-
content: '';
|
|
17
|
-
top: 50%;
|
|
18
|
-
left: -@padding-sm/2;
|
|
19
|
-
transform: translate(0, -50%);
|
|
20
|
-
display: inline-block;
|
|
21
|
-
height: .9em;
|
|
22
|
-
vertical-align: middle;
|
|
23
|
-
border-left: 1px solid @border-color-base;
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
//& when (@theme = dark) {
|
|
27
|
-
// .ant-btn + .ant-btn {
|
|
28
|
-
// background: #795da3 !important;
|
|
29
|
-
// }
|
|
30
|
-
//}
|
|
31
|
-
//& when not (@theme = dark) {
|
|
32
|
-
// .ant-btn + .ant-btn {
|
|
33
|
-
// background: #c81313 !important;
|
|
34
|
-
// }
|
|
35
|
-
//}
|
|
36
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import classNames from 'classnames';
|
|
3
|
-
import './index.less';
|
|
4
|
-
|
|
5
|
-
var DragBar = function DragBar(props) {
|
|
6
|
-
var direction = props.direction,
|
|
7
|
-
className = props.className,
|
|
8
|
-
onMouseDown = props.onMouseDown;
|
|
9
|
-
var directionStyle = direction === 'left' ? "spec-grid-dragbar-left-horizontal" : direction === 'right' ? "spec-grid-dragbar-right-horizontal" : direction === 'top' ? "spec-grid-dragbar-up-vertical" : "spec-grid-dragbar-down-vertical";
|
|
10
|
-
|
|
11
|
-
var handleMouseDown = function handleMouseDown(e) {
|
|
12
|
-
onMouseDown(e, direction);
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
16
|
-
className: classNames(directionStyle, className),
|
|
17
|
-
onMouseDown: handleMouseDown
|
|
18
|
-
});
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
export default DragBar;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
interface DragContentProps {
|
|
3
|
-
children?: React.ReactNode;
|
|
4
|
-
className?: string;
|
|
5
|
-
direction?: string[];
|
|
6
|
-
moveMaxWidth?: number;
|
|
7
|
-
moveMaxHeight?: number;
|
|
8
|
-
style?: React.CSSProperties;
|
|
9
|
-
dragMouseDown?: (evt: any, direction?: string) => void;
|
|
10
|
-
dragMouseMove?: (evt: any, direction?: string) => void;
|
|
11
|
-
dragMouseUp?: (evt: any, direction?: string) => void;
|
|
12
|
-
}
|
|
13
|
-
declare const DragContent: (props: DragContentProps) => JSX.Element;
|
|
14
|
-
export default DragContent;
|