@aloudata/aloudata-design 0.1.0-beta1 → 0.1.1
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/README.md +22 -13
- package/es/Button/demo/Icon/index.d.ts +3 -0
- package/es/Button/demo/Icon/index.js +67 -0
- package/{src → es}/Button/demo/Icon/index.less +0 -0
- package/es/Button/demo/basic/index.d.ts +4 -0
- package/es/Button/demo/basic/index.js +57 -0
- package/{src → es}/Button/demo/basic/index.less +0 -1
- package/es/Button/demo/disable/index.d.ts +3 -0
- package/es/Button/demo/disable/index.js +23 -0
- package/{src → es}/Button/demo/disable/index.less +0 -0
- package/es/Button/demo/href/index.d.ts +2 -0
- package/es/Button/demo/href/index.js +17 -0
- package/es/Button/demo/loading/index.d.ts +3 -0
- package/es/Button/demo/loading/index.js +37 -0
- package/{src → es}/Button/demo/loading/index.less +0 -0
- package/es/Button/index.d.ts +50 -0
- package/es/Button/index.js +108 -0
- package/es/Button/style/index.d.ts +2 -0
- package/es/Button/style/index.js +2 -0
- package/{src → es}/Button/style/index.less +5 -5
- package/es/Dropdown/Button.d.ts +69 -0
- package/es/Dropdown/Button.js +39 -0
- package/es/Dropdown/demo/basic/index.d.ts +4 -0
- package/es/Dropdown/demo/basic/index.js +18 -0
- package/es/Dropdown/demo/button/index.d.ts +3 -0
- package/es/Dropdown/demo/button/index.js +159 -0
- package/{src → es}/Dropdown/demo/button/index.less +0 -0
- package/es/Dropdown/demo/placement/index.d.ts +2 -0
- package/es/Dropdown/demo/placement/index.js +40 -0
- package/es/Dropdown/demo/subMenu/index.d.ts +2 -0
- package/es/Dropdown/demo/subMenu/index.js +42 -0
- package/es/Dropdown/demo/trigger/index.d.ts +2 -0
- package/es/Dropdown/demo/trigger/index.js +17 -0
- package/es/Dropdown/index.d.ts +59 -0
- package/es/Dropdown/index.js +33 -0
- package/es/Dropdown/style/index.d.ts +2 -0
- package/es/Dropdown/style/index.js +2 -0
- package/{src → es}/Dropdown/style/index.less +0 -0
- package/{src → es}/Icon/iconfont/demo.css +0 -0
- package/{src → es}/Icon/iconfont/demo_index.html +49 -3
- package/es/Icon/iconfont/iconfont.css +101 -0
- package/es/Icon/iconfont/iconfont.js +46 -0
- package/{src → es}/Icon/iconfont/iconfont.json +14 -0
- package/es/Icon/iconfont/iconfont.ttf +0 -0
- package/es/Icon/iconfont/iconfont.woff +0 -0
- package/es/Icon/iconfont/iconfont.woff2 +0 -0
- package/es/Icon/index.d.ts +11 -0
- package/es/Icon/index.js +42 -0
- package/{src → es}/Icon/index.less +3 -3
- package/es/Input/components/Group/index.d.ts +15 -0
- package/es/Input/components/Group/index.js +12 -0
- package/es/Input/components/Password/index.d.ts +10 -0
- package/es/Input/components/Password/index.js +20 -0
- package/es/Input/components/TextArea/index.d.ts +52 -0
- package/es/Input/components/TextArea/index.js +14 -0
- package/es/Input/demo/allowClear/index.d.ts +3 -0
- package/es/Input/demo/allowClear/index.js +11 -0
- package/{src → es}/Input/demo/allowClear/index.less +0 -0
- package/es/Input/demo/basic/index.d.ts +4 -0
- package/es/Input/demo/basic/index.js +65 -0
- package/{src → es}/Input/demo/basic/index.less +1 -1
- package/es/Input/demo/gourp/index.d.ts +2 -0
- package/es/Input/demo/gourp/index.js +67 -0
- package/es/Input/demo/password/index.d.ts +3 -0
- package/es/Input/demo/password/index.js +21 -0
- package/{src → es}/Input/demo/password/index.less +0 -0
- package/es/Input/demo/prefix/index.d.ts +3 -0
- package/es/Input/demo/prefix/index.js +17 -0
- package/{src → es}/Input/demo/prefix/index.less +0 -0
- package/es/Input/demo/showCount/index.d.ts +3 -0
- package/es/Input/demo/showCount/index.js +17 -0
- package/{src → es}/Input/demo/showCount/index.less +0 -0
- package/es/Input/demo/textArea/autoSize.d.ts +2 -0
- package/es/Input/demo/textArea/autoSize.js +50 -0
- package/es/Input/index.d.ts +65 -0
- package/es/Input/index.js +46 -0
- package/es/Input/style/index.d.ts +2 -0
- package/es/Input/style/index.js +2 -0
- package/{src → es}/Input/style/index.less +4 -1
- package/es/Menu/Divider.d.ts +5 -0
- package/es/Menu/Divider.js +15 -0
- package/es/Menu/MenuItem.d.ts +17 -0
- package/es/Menu/MenuItem.js +15 -0
- package/es/Menu/SubMenu.d.ts +26 -0
- package/es/Menu/SubMenu.js +29 -0
- package/es/Menu/index.d.ts +20 -0
- package/es/Menu/index.js +31 -0
- package/es/Menu/style/index.d.ts +2 -0
- package/es/Menu/style/index.js +2 -0
- package/{src → es}/Menu/style/index.less +0 -0
- package/es/Select/BaseSelect.d.ts +5 -0
- package/es/Select/BaseSelect.js +400 -0
- package/{src/Select/OptionsList/OptGroup.tsx → es/Select/OptionsList/OptGroup.d.ts} +2 -4
- package/es/Select/OptionsList/OptGroup.js +6 -0
- package/es/Select/OptionsList/OptionItem/RenderGroup.d.ts +9 -0
- package/es/Select/OptionsList/OptionItem/RenderGroup.js +16 -0
- package/es/Select/OptionsList/OptionItem/RenderLabelIcon.d.ts +8 -0
- package/es/Select/OptionsList/OptionItem/RenderLabelIcon.js +44 -0
- package/es/Select/OptionsList/OptionItem/RenderOption.d.ts +16 -0
- package/es/Select/OptionsList/OptionItem/RenderOption.js +79 -0
- package/es/Select/OptionsList/OptionItem/RenderTooltip.d.ts +8 -0
- package/es/Select/OptionsList/OptionItem/RenderTooltip.js +25 -0
- package/es/Select/OptionsList/OptionItem.d.ts +4 -0
- package/es/Select/OptionsList/OptionItem.js +4 -0
- package/es/Select/OptionsList/Options.d.ts +7 -0
- package/es/Select/OptionsList/Options.js +6 -0
- package/es/Select/OptionsList/index.d.ts +4 -0
- package/es/Select/OptionsList/index.js +187 -0
- package/es/Select/Selector/index.d.ts +4 -0
- package/es/Select/Selector/index.js +252 -0
- package/es/Select/VirtualList.d.ts +5 -0
- package/es/Select/VirtualList.js +29 -0
- package/es/Select/demo/disabled/index.d.ts +2 -0
- package/es/Select/demo/disabled/index.js +50 -0
- package/es/Select/demo/multiple/index.d.ts +2 -0
- package/es/Select/demo/multiple/index.js +140 -0
- package/es/Select/demo/options/index.d.ts +2 -0
- package/es/Select/demo/options/index.js +55 -0
- package/es/Select/demo/single/index.d.ts +3 -0
- package/es/Select/demo/single/index.js +89 -0
- package/es/Select/demo/single/index.less +5 -0
- package/es/Select/hooks/useCacheOption.d.ts +9 -0
- package/es/Select/hooks/useCacheOption.js +107 -0
- package/es/Select/index.d.ts +12 -0
- package/es/Select/index.js +9 -0
- package/es/Select/interface.d.ts +227 -0
- package/es/Select/interface.js +1 -0
- package/es/Select/style/index.d.ts +2 -0
- package/es/Select/style/index.js +2 -0
- package/{src → es}/Select/style/index.less +3 -10
- package/es/Select/utils.d.ts +21 -0
- package/es/Select/utils.js +193 -0
- package/es/Tabs/TabPane.d.ts +21 -0
- package/es/Tabs/TabPane.js +12 -0
- package/es/Tabs/demo/adaptHeight/index.d.ts +3 -0
- package/es/Tabs/demo/adaptHeight/index.js +19 -0
- package/{src → es}/Tabs/demo/adaptHeight/index.less +0 -0
- package/es/Tabs/demo/basic/index.d.ts +4 -0
- package/es/Tabs/demo/basic/index.js +44 -0
- package/{src → es}/Tabs/demo/basic/index.less +0 -0
- package/es/Tabs/demo/horizontalScroll/index.d.ts +3 -0
- package/es/Tabs/demo/horizontalScroll/index.js +30 -0
- package/{src → es}/Tabs/demo/horizontalScroll/index.less +0 -0
- package/es/Tabs/index.d.ts +41 -0
- package/es/Tabs/index.js +42 -0
- package/es/Tabs/style/index.d.ts +2 -0
- package/es/Tabs/style/index.js +2 -0
- package/{src → es}/Tabs/style/index.less +0 -0
- package/es/Tooltip/demo/basic/index.d.ts +2 -0
- package/es/Tooltip/demo/basic/index.js +7 -0
- package/es/Tooltip/demo/overflow/index.d.ts +2 -0
- package/es/Tooltip/demo/overflow/index.js +7 -0
- package/es/Tooltip/demo/placement/index.d.ts +6 -0
- package/es/Tooltip/demo/placement/index.js +70 -0
- package/{src → es}/Tooltip/demo/placement/index.less +0 -0
- package/es/Tooltip/demo/trigger/index.d.ts +3 -0
- package/es/Tooltip/demo/trigger/index.js +20 -0
- package/{src → es}/Tooltip/demo/trigger/index.less +0 -0
- package/es/Tooltip/index.d.ts +64 -0
- package/es/Tooltip/index.js +33 -0
- package/es/Tooltip/style/index.d.ts +2 -0
- package/es/Tooltip/style/index.js +2 -0
- package/{src → es}/Tooltip/style/index.less +0 -0
- package/es/_utils/hooks/useControlledState.d.ts +2 -0
- package/es/_utils/hooks/useControlledState.js +54 -0
- package/es/_utils/hooks/usePrefixCls.d.ts +2 -0
- package/es/_utils/hooks/usePrefixCls.js +14 -0
- package/es/index.d.ts +8 -0
- package/{src/index.ts → es/index.js} +0 -0
- package/es/style/index.d.ts +2 -0
- package/{src/style/index.ts → es/style/index.js} +0 -0
- package/{src → es}/style/index.less +0 -0
- package/{src → es}/style/mixins/index.less +0 -0
- package/{src → es}/style/themes/default/index.less +1 -1
- package/{lib/style/themes/default/themeColor.less → es/style/themes/default/themeColor.module.less} +0 -0
- package/es/style/themes/default/themeColor.module.less.d.ts +108 -0
- package/lib/Button/demo/basic/index.less +0 -1
- package/lib/Button/index.js +2 -2
- package/lib/Button/style/index.less +5 -5
- package/lib/Dropdown/demo/button/index.js +1 -1
- package/lib/Icon/iconfont/demo_index.html +49 -3
- package/lib/Icon/iconfont/iconfont.css +11 -3
- package/lib/Icon/iconfont/iconfont.js +1 -1
- package/lib/Icon/iconfont/iconfont.json +14 -0
- package/lib/Icon/iconfont/iconfont.ttf +0 -0
- package/lib/Icon/iconfont/iconfont.woff +0 -0
- package/lib/Icon/iconfont/iconfont.woff2 +0 -0
- package/lib/Icon/index.less +3 -3
- package/lib/Input/demo/basic/index.less +1 -1
- package/lib/Input/style/index.less +4 -1
- package/lib/Select/OptionsList/OptionItem/RenderGroup.d.ts +9 -0
- package/lib/Select/OptionsList/OptionItem/RenderGroup.js +27 -0
- package/lib/Select/OptionsList/OptionItem/RenderLabelIcon.d.ts +8 -0
- package/lib/Select/OptionsList/OptionItem/RenderLabelIcon.js +58 -0
- package/lib/Select/OptionsList/OptionItem/RenderOption.d.ts +16 -0
- package/lib/Select/OptionsList/OptionItem/RenderOption.js +94 -0
- package/lib/Select/OptionsList/OptionItem/RenderTooltip.d.ts +8 -0
- package/lib/Select/OptionsList/OptionItem/RenderTooltip.js +37 -0
- package/lib/Select/OptionsList/OptionItem.d.ts +4 -35
- package/lib/Select/OptionsList/OptionItem.js +26 -172
- package/lib/Select/OptionsList/Options.d.ts +2 -2
- package/lib/Select/OptionsList/index.js +1 -1
- package/lib/Select/Selector/index.d.ts +2 -2
- package/lib/Select/Selector/index.js +13 -10
- package/lib/Select/demo/single/index.d.ts +1 -0
- package/lib/Select/demo/single/index.js +5 -1
- package/lib/Select/demo/single/index.less +5 -0
- package/lib/Select/interface.d.ts +8 -2
- package/lib/Select/style/index.less +3 -10
- package/lib/Tooltip/index.d.ts +1 -0
- package/lib/Tooltip/index.js +3 -1
- package/lib/style/themes/default/index.less +1 -1
- package/{src/style/themes/default/themeColor.less → lib/style/themes/default/themeColor.module.less} +0 -0
- package/lib/style/themes/default/themeColor.module.less.d.ts +108 -0
- package/package.json +17 -7
- package/.editorconfig +0 -16
- package/.eslintrc.js +0 -43
- package/.fatherrc.ts +0 -16
- package/.prettierignore +0 -7
- package/.prettierrc.js +0 -1
- package/.stylelintrc.json +0 -36
- package/.umirc.ts +0 -15
- package/commitlint.config.js +0 -21
- package/docs/index.md +0 -21
- package/jest/setupTests.js +0 -1
- package/public/favicon.ico +0 -0
- package/src/Button/demo/Icon/index.tsx +0 -41
- package/src/Button/demo/basic/index.tsx +0 -26
- package/src/Button/demo/disable/index.tsx +0 -16
- package/src/Button/demo/href/index.tsx +0 -14
- package/src/Button/demo/loading/index.tsx +0 -21
- package/src/Button/index.md +0 -25
- package/src/Button/index.test.tsx +0 -58
- package/src/Button/index.tsx +0 -136
- package/src/Button/style/index.ts +0 -2
- package/src/Dropdown/Button.tsx +0 -93
- package/src/Dropdown/demo/basic/index.tsx +0 -20
- package/src/Dropdown/demo/button/index.tsx +0 -98
- package/src/Dropdown/demo/placement/index.tsx +0 -47
- package/src/Dropdown/demo/subMenu/index.tsx +0 -35
- package/src/Dropdown/demo/trigger/index.tsx +0 -19
- package/src/Dropdown/index.md +0 -35
- package/src/Dropdown/index.test.tsx +0 -185
- package/src/Dropdown/index.tsx +0 -71
- package/src/Dropdown/style/index.ts +0 -2
- package/src/Icon/iconfont/iconfont.css +0 -93
- package/src/Icon/iconfont/iconfont.js +0 -1
- package/src/Icon/iconfont/iconfont.ttf +0 -0
- package/src/Icon/iconfont/iconfont.woff +0 -0
- package/src/Icon/iconfont/iconfont.woff2 +0 -0
- package/src/Icon/index.tsx +0 -38
- package/src/Input/components/Group/index.tsx +0 -21
- package/src/Input/components/Password/index.tsx +0 -23
- package/src/Input/components/TextArea/index.tsx +0 -57
- package/src/Input/demo/allowClear/index.tsx +0 -10
- package/src/Input/demo/basic/index.tsx +0 -25
- package/src/Input/demo/gourp/index.tsx +0 -30
- package/src/Input/demo/password/index.tsx +0 -11
- package/src/Input/demo/prefix/index.tsx +0 -13
- package/src/Input/demo/showCount/index.tsx +0 -16
- package/src/Input/demo/textArea/autoSize.tsx +0 -21
- package/src/Input/index.md +0 -37
- package/src/Input/index.test.tsx +0 -78
- package/src/Input/index.tsx +0 -91
- package/src/Input/style/index.ts +0 -2
- package/src/Menu/Divider.tsx +0 -12
- package/src/Menu/MenuItem.tsx +0 -24
- package/src/Menu/SubMenu.tsx +0 -37
- package/src/Menu/index.md +0 -36
- package/src/Menu/index.test.tsx +0 -144
- package/src/Menu/index.tsx +0 -27
- package/src/Menu/style/index.ts +0 -2
- package/src/Select/BaseSelect.tsx +0 -321
- package/src/Select/OptionsList/OptionItem.tsx +0 -151
- package/src/Select/OptionsList/Options.tsx +0 -11
- package/src/Select/OptionsList/index.tsx +0 -169
- package/src/Select/Selector/index.tsx +0 -211
- package/src/Select/VirtualList.tsx +0 -36
- package/src/Select/demo/disabled/index.tsx +0 -44
- package/src/Select/demo/multiple/index.tsx +0 -77
- package/src/Select/demo/options/index.tsx +0 -63
- package/src/Select/demo/single/index.tsx +0 -50
- package/src/Select/hooks/useCacheOption.ts +0 -67
- package/src/Select/index.md +0 -72
- package/src/Select/index.tsx +0 -23
- package/src/Select/interface.ts +0 -231
- package/src/Select/style/index.ts +0 -2
- package/src/Select/utils.tsx +0 -133
- package/src/Tabs/TabPane.tsx +0 -28
- package/src/Tabs/demo/adaptHeight/index.tsx +0 -33
- package/src/Tabs/demo/basic/index.tsx +0 -30
- package/src/Tabs/demo/horizontalScroll/index.tsx +0 -36
- package/src/Tabs/index.md +0 -30
- package/src/Tabs/index.test.tsx +0 -100
- package/src/Tabs/index.tsx +0 -64
- package/src/Tabs/style/index.ts +0 -2
- package/src/Tooltip/demo/basic/index.tsx +0 -10
- package/src/Tooltip/demo/overflow/index.tsx +0 -10
- package/src/Tooltip/demo/placement/index.tsx +0 -60
- package/src/Tooltip/demo/trigger/index.tsx +0 -22
- package/src/Tooltip/index.md +0 -28
- package/src/Tooltip/index.test.tsx +0 -152
- package/src/Tooltip/index.tsx +0 -113
- package/src/Tooltip/style/index.ts +0 -2
- package/src/_utils/hooks/useControlledState.ts +0 -39
- package/src/_utils/hooks/usePrefixCls.ts +0 -11
- package/tsconfig.json +0 -13
- package/typings.d.ts +0 -3
|
@@ -130,7 +130,8 @@
|
|
|
130
130
|
// box-shadow: 0 0 6px 0 @color-box-shadow-focused;
|
|
131
131
|
|
|
132
132
|
.@{select-prefix-cls-legacy} {
|
|
133
|
-
&-item-all
|
|
133
|
+
&-item-all,
|
|
134
|
+
&-item {
|
|
134
135
|
opacity: 0.5;
|
|
135
136
|
}
|
|
136
137
|
}
|
|
@@ -165,6 +166,7 @@
|
|
|
165
166
|
line-height: 22px;
|
|
166
167
|
white-space: nowrap;
|
|
167
168
|
text-overflow: ellipsis;
|
|
169
|
+
color: @NL0;
|
|
168
170
|
}
|
|
169
171
|
}
|
|
170
172
|
|
|
@@ -351,15 +353,6 @@
|
|
|
351
353
|
}
|
|
352
354
|
}
|
|
353
355
|
|
|
354
|
-
&-single,
|
|
355
|
-
&-focused {
|
|
356
|
-
.@{select-prefix-cls-legacy} {
|
|
357
|
-
&-item {
|
|
358
|
-
opacity: 0.5;
|
|
359
|
-
}
|
|
360
|
-
}
|
|
361
|
-
}
|
|
362
|
-
|
|
363
356
|
// rc-trigger
|
|
364
357
|
&-dropdown {
|
|
365
358
|
position: absolute;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { IOption } from './interface';
|
|
3
|
+
interface IGroup {
|
|
4
|
+
groupLabel?: string;
|
|
5
|
+
groupValue?: string | number;
|
|
6
|
+
}
|
|
7
|
+
export declare const customOptionKeyPrefix = "select_custom_option_";
|
|
8
|
+
export declare const customOptionKey: string;
|
|
9
|
+
export declare function convertNodeToOption(node: React.ReactElement, group: IGroup): IOption;
|
|
10
|
+
export declare const getFlattenOptions: (data: IOption[], hasGroup: boolean) => IOption[];
|
|
11
|
+
export declare function convertChildrenToData(nodes: React.ReactElement[], group?: {}): IOption[];
|
|
12
|
+
export declare function handleOptions(mergedOptions: IOption[], setCacheOptions: (options: IOption[]) => void, updateGroup: (value: boolean) => void): {
|
|
13
|
+
flattenOptions: IOption[];
|
|
14
|
+
isGroup: boolean;
|
|
15
|
+
};
|
|
16
|
+
export declare const defaultLabelRenderer: (input: string, prefix: string) => (option: IOption, isGroup: boolean) => React.ReactNode;
|
|
17
|
+
export declare const defaultOptionLabelRenderer: (value: string | number, option?: IOption | undefined) => {};
|
|
18
|
+
export declare const defaultSearchPredicate: (input: string) => (o: IOption) => boolean;
|
|
19
|
+
export declare const defaultMatchPredicate: (input: string) => (o: IOption) => boolean;
|
|
20
|
+
export declare const CustomOption: (value: string | number, withGroup?: boolean, id?: string) => IOption;
|
|
21
|
+
export {};
|
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
var _excluded = ["value", "children"],
|
|
2
|
+
_excluded2 = ["options"];
|
|
3
|
+
|
|
4
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
5
|
+
|
|
6
|
+
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."); }
|
|
7
|
+
|
|
8
|
+
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); }
|
|
9
|
+
|
|
10
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
11
|
+
|
|
12
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
13
|
+
|
|
14
|
+
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; }
|
|
15
|
+
|
|
16
|
+
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; }
|
|
17
|
+
|
|
18
|
+
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; }
|
|
19
|
+
|
|
20
|
+
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; }
|
|
21
|
+
|
|
22
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
23
|
+
|
|
24
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
25
|
+
|
|
26
|
+
import React from 'react';
|
|
27
|
+
import { concat, uniqueId } from 'lodash';
|
|
28
|
+
var ZERO_INDEX = 0;
|
|
29
|
+
var ungroupedOptionKeyPrefix = 'select_isungrouped_option_';
|
|
30
|
+
var ungroupedOptionKey = uniqueId(ungroupedOptionKeyPrefix);
|
|
31
|
+
var ungroupedOptionLabel = '未分组';
|
|
32
|
+
export var customOptionKeyPrefix = 'select_custom_option_';
|
|
33
|
+
export var customOptionKey = uniqueId(customOptionKeyPrefix); // ReactNode To Options
|
|
34
|
+
|
|
35
|
+
export function convertNodeToOption(node, group) {
|
|
36
|
+
var _node$props = node.props,
|
|
37
|
+
value = _node$props.value,
|
|
38
|
+
children = _node$props.children,
|
|
39
|
+
restProps = _objectWithoutProperties(_node$props, _excluded);
|
|
40
|
+
|
|
41
|
+
var groupValue = group.groupValue,
|
|
42
|
+
groupLabel = group.groupLabel;
|
|
43
|
+
|
|
44
|
+
if (groupLabel && groupLabel) {
|
|
45
|
+
return _objectSpread({
|
|
46
|
+
value: value,
|
|
47
|
+
label: children !== undefined ? children : value,
|
|
48
|
+
groupValue: groupValue,
|
|
49
|
+
groupLabel: groupLabel
|
|
50
|
+
}, restProps);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
return _objectSpread({
|
|
54
|
+
value: value,
|
|
55
|
+
label: children !== undefined ? children : value
|
|
56
|
+
}, restProps);
|
|
57
|
+
}
|
|
58
|
+
export var getFlattenOptions = function getFlattenOptions(data, hasGroup) {
|
|
59
|
+
var groupMap = new Map();
|
|
60
|
+
|
|
61
|
+
if (!hasGroup) {
|
|
62
|
+
return data;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
data === null || data === void 0 ? void 0 : data.map(function (cur) {
|
|
66
|
+
var gValue = groupMap.get(cur.groupValue);
|
|
67
|
+
|
|
68
|
+
if (gValue) {
|
|
69
|
+
var options = gValue.options,
|
|
70
|
+
rest = _objectWithoutProperties(gValue, _excluded2);
|
|
71
|
+
|
|
72
|
+
return groupMap.set(cur.groupValue, _objectSpread({
|
|
73
|
+
options: [].concat(_toConsumableArray(options), [cur])
|
|
74
|
+
}, rest));
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
return groupMap.set(cur.groupValue, {
|
|
78
|
+
label: cur.groupLabel,
|
|
79
|
+
value: cur.groupValue,
|
|
80
|
+
isSelectOptGroup: true,
|
|
81
|
+
options: [cur]
|
|
82
|
+
});
|
|
83
|
+
});
|
|
84
|
+
var flattenOption = [];
|
|
85
|
+
groupMap.forEach(function (value) {
|
|
86
|
+
flattenOption.push(value); // @ts-ignore
|
|
87
|
+
|
|
88
|
+
flattenOption.push.apply(flattenOption, _toConsumableArray(value.options));
|
|
89
|
+
});
|
|
90
|
+
return flattenOption;
|
|
91
|
+
};
|
|
92
|
+
export function convertChildrenToData(nodes) {
|
|
93
|
+
var group = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
94
|
+
var nodeOptions = [];
|
|
95
|
+
React.Children.forEach(nodes, function (node) {
|
|
96
|
+
if (! /*#__PURE__*/React.isValidElement(node)) {
|
|
97
|
+
return;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
var isSelectOptGroup = node.type.isSelectOptGroup,
|
|
101
|
+
_node$props2 = node.props,
|
|
102
|
+
children = _node$props2.children,
|
|
103
|
+
label = _node$props2.label,
|
|
104
|
+
value = _node$props2.value; // 联合类型
|
|
105
|
+
|
|
106
|
+
if (!isSelectOptGroup) {
|
|
107
|
+
// option
|
|
108
|
+
nodeOptions.push(convertNodeToOption(node, group));
|
|
109
|
+
} else {
|
|
110
|
+
// Group
|
|
111
|
+
nodeOptions = concat(nodeOptions, convertChildrenToData(children, {
|
|
112
|
+
groupLabel: label,
|
|
113
|
+
groupValue: value
|
|
114
|
+
}));
|
|
115
|
+
}
|
|
116
|
+
});
|
|
117
|
+
return nodeOptions;
|
|
118
|
+
} // optionsMap flattenOptions
|
|
119
|
+
|
|
120
|
+
export function handleOptions(mergedOptions, setCacheOptions, updateGroup) {
|
|
121
|
+
var isGroup = !!mergedOptions.find(function (v) {
|
|
122
|
+
return Object.prototype.hasOwnProperty.call(v, 'groupValue');
|
|
123
|
+
});
|
|
124
|
+
var flattenOptions = [];
|
|
125
|
+
mergedOptions.forEach(function (option) {
|
|
126
|
+
var optionGroupLabel = option.groupLabel,
|
|
127
|
+
optionGroupValue = option.groupValue;
|
|
128
|
+
|
|
129
|
+
if (isGroup && !optionGroupValue && !optionGroupLabel) {
|
|
130
|
+
var ungroupedOption = _objectSpread(_objectSpread({}, option), {}, {
|
|
131
|
+
groupLabel: ungroupedOptionLabel,
|
|
132
|
+
groupValue: ungroupedOptionKey
|
|
133
|
+
});
|
|
134
|
+
|
|
135
|
+
flattenOptions.push(ungroupedOption);
|
|
136
|
+
} else {
|
|
137
|
+
flattenOptions.push(option);
|
|
138
|
+
}
|
|
139
|
+
});
|
|
140
|
+
updateGroup(isGroup);
|
|
141
|
+
setCacheOptions(flattenOptions);
|
|
142
|
+
return {
|
|
143
|
+
flattenOptions: flattenOptions,
|
|
144
|
+
isGroup: isGroup
|
|
145
|
+
};
|
|
146
|
+
} // provide search matching hightlight;
|
|
147
|
+
|
|
148
|
+
export var defaultLabelRenderer = function defaultLabelRenderer(input, prefix) {
|
|
149
|
+
return function (option, isGroup) {
|
|
150
|
+
var title = option.title,
|
|
151
|
+
label = option.label;
|
|
152
|
+
|
|
153
|
+
if (isGroup || typeof label !== 'string') {
|
|
154
|
+
return title || label;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
var index = label.indexOf(input);
|
|
158
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
159
|
+
style: {
|
|
160
|
+
display: 'inline-block',
|
|
161
|
+
lineHeight: '40px'
|
|
162
|
+
}
|
|
163
|
+
}, label.slice(ZERO_INDEX, index), /*#__PURE__*/React.createElement("span", {
|
|
164
|
+
className: "".concat(prefix, "-search-highlight")
|
|
165
|
+
}, label.slice(index, index + input.length)), label.slice(index + input.length));
|
|
166
|
+
};
|
|
167
|
+
};
|
|
168
|
+
export var defaultOptionLabelRenderer = function defaultOptionLabelRenderer(value, option) {
|
|
169
|
+
return (option === null || option === void 0 ? void 0 : option.title) || (option === null || option === void 0 ? void 0 : option.label) || value;
|
|
170
|
+
};
|
|
171
|
+
export var defaultSearchPredicate = function defaultSearchPredicate(input) {
|
|
172
|
+
return function (o) {
|
|
173
|
+
return typeof o.label === 'string' ? o.label.includes(input) : true;
|
|
174
|
+
};
|
|
175
|
+
};
|
|
176
|
+
export var defaultMatchPredicate = function defaultMatchPredicate(input) {
|
|
177
|
+
return function (o) {
|
|
178
|
+
return o.label === input;
|
|
179
|
+
};
|
|
180
|
+
};
|
|
181
|
+
export var CustomOption = function CustomOption(value) {
|
|
182
|
+
var withGroup = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
183
|
+
var id = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : customOptionKeyPrefix;
|
|
184
|
+
return withGroup ? {
|
|
185
|
+
value: value,
|
|
186
|
+
label: value.toString(),
|
|
187
|
+
groupValue: id,
|
|
188
|
+
groupLabel: '自由输入'
|
|
189
|
+
} : {
|
|
190
|
+
value: value,
|
|
191
|
+
label: value.toString()
|
|
192
|
+
};
|
|
193
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export interface ITabPaneProps {
|
|
3
|
+
/**
|
|
4
|
+
* @description 被隐藏时是否渲染 DOM 结构
|
|
5
|
+
* @default false
|
|
6
|
+
*/
|
|
7
|
+
forceRender?: boolean;
|
|
8
|
+
/**
|
|
9
|
+
* @description 对应 activeKey
|
|
10
|
+
* @default -
|
|
11
|
+
*/
|
|
12
|
+
key?: string;
|
|
13
|
+
/**
|
|
14
|
+
* @description 选项卡头显示的内容
|
|
15
|
+
* @default -
|
|
16
|
+
*/
|
|
17
|
+
tab: ReactNode;
|
|
18
|
+
className?: string;
|
|
19
|
+
children?: ReactNode;
|
|
20
|
+
}
|
|
21
|
+
export default function TabPane(props: ITabPaneProps): JSX.Element;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
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; }
|
|
2
|
+
|
|
3
|
+
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; }
|
|
4
|
+
|
|
5
|
+
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; }
|
|
6
|
+
|
|
7
|
+
import React from 'react';
|
|
8
|
+
import AntdTabs from 'antd/lib/tabs';
|
|
9
|
+
var AntdTabPane = AntdTabs.TabPane;
|
|
10
|
+
export default function TabPane(props) {
|
|
11
|
+
return /*#__PURE__*/React.createElement(AntdTabPane, _objectSpread({}, props));
|
|
12
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import './index.less';
|
|
3
|
+
import { Tabs } from '@aloudata/aloudata-design';
|
|
4
|
+
var TabPane = Tabs.TabPane;
|
|
5
|
+
export default (function () {
|
|
6
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
7
|
+
className: "demo-adapt-height"
|
|
8
|
+
}, /*#__PURE__*/React.createElement(Tabs, {
|
|
9
|
+
adaptHeight: true
|
|
10
|
+
}, /*#__PURE__*/React.createElement(TabPane, {
|
|
11
|
+
tab: "Tab 1",
|
|
12
|
+
key: "1",
|
|
13
|
+
className: "demo-tabpane"
|
|
14
|
+
}, "Content of Tab Pane 1"), /*#__PURE__*/React.createElement(TabPane, {
|
|
15
|
+
tab: "Tab 2",
|
|
16
|
+
key: "2",
|
|
17
|
+
className: "demo-tabpane"
|
|
18
|
+
}, /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", null, "Content of Tab Pane 2"), /*#__PURE__*/React.createElement("div", null, "Content of Tab Pane 2"), /*#__PURE__*/React.createElement("div", null, "Content of Tab Pane 2"), /*#__PURE__*/React.createElement("div", null, "Content of Tab Pane 2"), /*#__PURE__*/React.createElement("div", null, "Content of Tab Pane 2"), /*#__PURE__*/React.createElement("div", null, "Content of Tab Pane 2"), /*#__PURE__*/React.createElement("div", null, "Content of Tab Pane 2"), /*#__PURE__*/React.createElement("div", null, "Content of Tab Pane 2"), /*#__PURE__*/React.createElement("div", null, "Content of Tab Pane 2"), /*#__PURE__*/React.createElement("div", null, "Content of Tab Pane 2"), /*#__PURE__*/React.createElement("div", null, "Content of Tab Pane 2")))));
|
|
19
|
+
});
|
|
File without changes
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
2
|
+
|
|
3
|
+
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."); }
|
|
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 _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; }
|
|
8
|
+
|
|
9
|
+
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_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; }
|
|
10
|
+
|
|
11
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
12
|
+
|
|
13
|
+
import React, { useState } from 'react';
|
|
14
|
+
import Switch from 'antd/lib/switch';
|
|
15
|
+
import 'antd/lib//switch/style/index.less';
|
|
16
|
+
import './index.less';
|
|
17
|
+
import { Tabs } from '@aloudata/aloudata-design';
|
|
18
|
+
var TabPane = Tabs.TabPane;
|
|
19
|
+
export default (function () {
|
|
20
|
+
var _useState = useState('default'),
|
|
21
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
22
|
+
size = _useState2[0],
|
|
23
|
+
setSize = _useState2[1];
|
|
24
|
+
|
|
25
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
26
|
+
className: "demo-basic"
|
|
27
|
+
}, /*#__PURE__*/React.createElement("div", null, "large size: ", /*#__PURE__*/React.createElement(Switch, {
|
|
28
|
+
checked: size === 'large',
|
|
29
|
+
onChange: function onChange(checked) {
|
|
30
|
+
return setSize(checked ? 'large' : 'default');
|
|
31
|
+
}
|
|
32
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
33
|
+
className: "tabs-container"
|
|
34
|
+
}, /*#__PURE__*/React.createElement(Tabs, {
|
|
35
|
+
size: size,
|
|
36
|
+
destroyInactiveTabPane: true
|
|
37
|
+
}, /*#__PURE__*/React.createElement(TabPane, {
|
|
38
|
+
tab: "Tab 1",
|
|
39
|
+
key: "1"
|
|
40
|
+
}, "Content of Tab Pane 1"), /*#__PURE__*/React.createElement(TabPane, {
|
|
41
|
+
tab: "Tab 2",
|
|
42
|
+
key: "2"
|
|
43
|
+
}, "Content of Tab Pane 2"))));
|
|
44
|
+
});
|
|
File without changes
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import './index.less';
|
|
3
|
+
import { Tabs } from '@aloudata/aloudata-design';
|
|
4
|
+
var TabPane = Tabs.TabPane;
|
|
5
|
+
export default (function () {
|
|
6
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
7
|
+
className: "demo-horizontal-scroll"
|
|
8
|
+
}, /*#__PURE__*/React.createElement(Tabs, null, /*#__PURE__*/React.createElement(TabPane, {
|
|
9
|
+
tab: "Tab 1",
|
|
10
|
+
key: "1"
|
|
11
|
+
}, "Content of Tab Pane 1"), /*#__PURE__*/React.createElement(TabPane, {
|
|
12
|
+
tab: "Tab 2",
|
|
13
|
+
key: "2"
|
|
14
|
+
}, "Content of Tab Pane 2"), /*#__PURE__*/React.createElement(TabPane, {
|
|
15
|
+
tab: "Tab 3",
|
|
16
|
+
key: "3"
|
|
17
|
+
}, "Content of Tab Pane 3"), /*#__PURE__*/React.createElement(TabPane, {
|
|
18
|
+
tab: "Tab 4",
|
|
19
|
+
key: "4"
|
|
20
|
+
}, "Content of Tab Pane 4"), /*#__PURE__*/React.createElement(TabPane, {
|
|
21
|
+
tab: "Tab 5",
|
|
22
|
+
key: "5"
|
|
23
|
+
}, "Content of Tab Pane 5"), /*#__PURE__*/React.createElement(TabPane, {
|
|
24
|
+
tab: "Tab 6",
|
|
25
|
+
key: "6"
|
|
26
|
+
}, "Content of Tab Pane 6"), /*#__PURE__*/React.createElement(TabPane, {
|
|
27
|
+
tab: "Tab 7",
|
|
28
|
+
key: "7"
|
|
29
|
+
}, "Content of Tab Pane 7")));
|
|
30
|
+
});
|
|
File without changes
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import './style';
|
|
3
|
+
export interface ITabsProps {
|
|
4
|
+
/**
|
|
5
|
+
* @description 大小
|
|
6
|
+
* @default default
|
|
7
|
+
*/
|
|
8
|
+
size?: 'large' | 'default';
|
|
9
|
+
/**
|
|
10
|
+
* @description 当前激活 tab 面板的 key
|
|
11
|
+
* @default -
|
|
12
|
+
*/
|
|
13
|
+
activeKey?: string;
|
|
14
|
+
/**
|
|
15
|
+
* @description 初始化选中面板的 key,如果没有设置 activeKey
|
|
16
|
+
* @default 第一个面板的 key
|
|
17
|
+
*/
|
|
18
|
+
defaultActiveKey?: string;
|
|
19
|
+
/**
|
|
20
|
+
* @description 切换面板的回调
|
|
21
|
+
* @default -
|
|
22
|
+
*/
|
|
23
|
+
onChange?: (activeKey: string) => void;
|
|
24
|
+
/**
|
|
25
|
+
* @description 被隐藏时是否销毁 DOM 结构
|
|
26
|
+
* @default false
|
|
27
|
+
*/
|
|
28
|
+
destroyInactiveTabPane?: boolean;
|
|
29
|
+
/**
|
|
30
|
+
* @description 撑满容器的高度
|
|
31
|
+
* @default false
|
|
32
|
+
*/
|
|
33
|
+
adaptHeight?: boolean;
|
|
34
|
+
className?: string;
|
|
35
|
+
children?: React.ReactNode;
|
|
36
|
+
}
|
|
37
|
+
declare function Tabs(props: ITabsProps): JSX.Element;
|
|
38
|
+
declare namespace Tabs {
|
|
39
|
+
var TabPane: typeof import("./TabPane").default;
|
|
40
|
+
}
|
|
41
|
+
export default Tabs;
|
package/es/Tabs/index.js
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
var _excluded = ["size", "className", "adaptHeight"];
|
|
2
|
+
|
|
3
|
+
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; }
|
|
4
|
+
|
|
5
|
+
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; }
|
|
6
|
+
|
|
7
|
+
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; }
|
|
8
|
+
|
|
9
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
10
|
+
|
|
11
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
12
|
+
|
|
13
|
+
import React from 'react';
|
|
14
|
+
import AntdTabs from 'antd/lib/tabs';
|
|
15
|
+
import Icon from '../Icon';
|
|
16
|
+
import TabPane from './TabPane';
|
|
17
|
+
import classNames from 'classnames';
|
|
18
|
+
import './style';
|
|
19
|
+
export default function Tabs(props) {
|
|
20
|
+
var size = props.size,
|
|
21
|
+
className = props.className,
|
|
22
|
+
adaptHeight = props.adaptHeight,
|
|
23
|
+
otherProps = _objectWithoutProperties(props, _excluded);
|
|
24
|
+
|
|
25
|
+
var tabsProps = _objectSpread({}, otherProps);
|
|
26
|
+
|
|
27
|
+
if (size === 'large') {
|
|
28
|
+
tabsProps.size = size;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
return /*#__PURE__*/React.createElement(AntdTabs, _objectSpread({
|
|
32
|
+
moreIcon: /*#__PURE__*/React.createElement(Icon, {
|
|
33
|
+
type: "more_vert",
|
|
34
|
+
size: 18
|
|
35
|
+
}),
|
|
36
|
+
tabBarGutter: 24,
|
|
37
|
+
className: classNames('ald-tabs', className, {
|
|
38
|
+
'ald-adapt-height': adaptHeight
|
|
39
|
+
})
|
|
40
|
+
}, tabsProps));
|
|
41
|
+
}
|
|
42
|
+
Tabs.TabPane = TabPane;
|
|
File without changes
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Tooltip } from '@aloudata/aloudata-design';
|
|
3
|
+
export default (function () {
|
|
4
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Tooltip, {
|
|
5
|
+
title: "Tooltip"
|
|
6
|
+
}, /*#__PURE__*/React.createElement("span", null, "Tooltip will show on mouse enter")));
|
|
7
|
+
});
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Tooltip } from '@aloudata/aloudata-design';
|
|
3
|
+
export default (function () {
|
|
4
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Tooltip, {
|
|
5
|
+
title: "longMsglongMsglongMsglongMsglongMsglongMsglongMsglongMsglongMsglongMsglongMsglongMsglongMsglongMsglongMsglongMsglongMsglongMsglongMsglongMsglongMsg"
|
|
6
|
+
}, /*#__PURE__*/React.createElement("span", null, "Tooltip will show on mouse enter")));
|
|
7
|
+
});
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* title: 调整位置
|
|
3
|
+
*/
|
|
4
|
+
import React from 'react';
|
|
5
|
+
import { Tooltip, Button } from '@aloudata/aloudata-design';
|
|
6
|
+
import './index.less';
|
|
7
|
+
var text = /*#__PURE__*/React.createElement("span", null, "prompt text");
|
|
8
|
+
var buttonWidth = 70;
|
|
9
|
+
export default (function () {
|
|
10
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
11
|
+
className: "demo-placement"
|
|
12
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
13
|
+
style: {
|
|
14
|
+
marginLeft: buttonWidth,
|
|
15
|
+
whiteSpace: 'nowrap'
|
|
16
|
+
}
|
|
17
|
+
}, /*#__PURE__*/React.createElement(Tooltip, {
|
|
18
|
+
placement: "topLeft",
|
|
19
|
+
title: text
|
|
20
|
+
}, /*#__PURE__*/React.createElement(Button, null, "TL")), /*#__PURE__*/React.createElement(Tooltip, {
|
|
21
|
+
placement: "top",
|
|
22
|
+
title: text
|
|
23
|
+
}, /*#__PURE__*/React.createElement(Button, null, "Top")), /*#__PURE__*/React.createElement(Tooltip, {
|
|
24
|
+
placement: "topRight",
|
|
25
|
+
title: text
|
|
26
|
+
}, /*#__PURE__*/React.createElement(Button, null, "TR"))), /*#__PURE__*/React.createElement("div", {
|
|
27
|
+
style: {
|
|
28
|
+
width: buttonWidth,
|
|
29
|
+
float: 'left'
|
|
30
|
+
}
|
|
31
|
+
}, /*#__PURE__*/React.createElement(Tooltip, {
|
|
32
|
+
placement: "leftTop",
|
|
33
|
+
title: text
|
|
34
|
+
}, /*#__PURE__*/React.createElement(Button, null, "LT")), /*#__PURE__*/React.createElement(Tooltip, {
|
|
35
|
+
placement: "left",
|
|
36
|
+
title: text
|
|
37
|
+
}, /*#__PURE__*/React.createElement(Button, null, "Left")), /*#__PURE__*/React.createElement(Tooltip, {
|
|
38
|
+
placement: "leftBottom",
|
|
39
|
+
title: text
|
|
40
|
+
}, /*#__PURE__*/React.createElement(Button, null, "LB"))), /*#__PURE__*/React.createElement("div", {
|
|
41
|
+
style: {
|
|
42
|
+
width: buttonWidth,
|
|
43
|
+
marginLeft: buttonWidth * 4 + 24
|
|
44
|
+
}
|
|
45
|
+
}, /*#__PURE__*/React.createElement(Tooltip, {
|
|
46
|
+
placement: "rightTop",
|
|
47
|
+
title: text
|
|
48
|
+
}, /*#__PURE__*/React.createElement(Button, null, "RT")), /*#__PURE__*/React.createElement(Tooltip, {
|
|
49
|
+
placement: "right",
|
|
50
|
+
title: text
|
|
51
|
+
}, /*#__PURE__*/React.createElement(Button, null, "Right")), /*#__PURE__*/React.createElement(Tooltip, {
|
|
52
|
+
placement: "rightBottom",
|
|
53
|
+
title: text
|
|
54
|
+
}, /*#__PURE__*/React.createElement(Button, null, "RB"))), /*#__PURE__*/React.createElement("div", {
|
|
55
|
+
style: {
|
|
56
|
+
marginLeft: buttonWidth,
|
|
57
|
+
clear: 'both',
|
|
58
|
+
whiteSpace: 'nowrap'
|
|
59
|
+
}
|
|
60
|
+
}, /*#__PURE__*/React.createElement(Tooltip, {
|
|
61
|
+
placement: "bottomLeft",
|
|
62
|
+
title: text
|
|
63
|
+
}, /*#__PURE__*/React.createElement(Button, null, "BL")), /*#__PURE__*/React.createElement(Tooltip, {
|
|
64
|
+
placement: "bottom",
|
|
65
|
+
title: text
|
|
66
|
+
}, /*#__PURE__*/React.createElement(Button, null, "Bottom")), /*#__PURE__*/React.createElement(Tooltip, {
|
|
67
|
+
placement: "bottomRight",
|
|
68
|
+
title: text
|
|
69
|
+
}, /*#__PURE__*/React.createElement(Button, null, "BR"))));
|
|
70
|
+
});
|
|
File without changes
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Tooltip, Button } from '@aloudata/aloudata-design';
|
|
3
|
+
import './index.less';
|
|
4
|
+
export default (function () {
|
|
5
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
6
|
+
className: "demo-trigger"
|
|
7
|
+
}, /*#__PURE__*/React.createElement(Tooltip, {
|
|
8
|
+
title: "Tooltip",
|
|
9
|
+
trigger: "hover"
|
|
10
|
+
}, /*#__PURE__*/React.createElement(Button, null, "hover")), /*#__PURE__*/React.createElement(Tooltip, {
|
|
11
|
+
title: "Tooltip",
|
|
12
|
+
trigger: "click"
|
|
13
|
+
}, /*#__PURE__*/React.createElement(Button, null, "click")), /*#__PURE__*/React.createElement(Tooltip, {
|
|
14
|
+
title: "Tooltip",
|
|
15
|
+
trigger: "contextMenu"
|
|
16
|
+
}, /*#__PURE__*/React.createElement(Button, null, "contextMenu")), /*#__PURE__*/React.createElement(Tooltip, {
|
|
17
|
+
title: "Tooltip",
|
|
18
|
+
trigger: "focus"
|
|
19
|
+
}, /*#__PURE__*/React.createElement(Button, null, "focus"))));
|
|
20
|
+
});
|
|
File without changes
|