@aloudata/aloudata-design 0.1.0-beta.2
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 +82 -0
- package/es/Button/demo/Icon/index.d.ts +3 -0
- package/es/Button/demo/Icon/index.js +67 -0
- package/es/Button/demo/Icon/index.less +6 -0
- package/es/Button/demo/basic/index.d.ts +4 -0
- package/es/Button/demo/basic/index.js +57 -0
- package/es/Button/demo/basic/index.less +7 -0
- package/es/Button/demo/disable/index.d.ts +3 -0
- package/es/Button/demo/disable/index.js +23 -0
- package/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/es/Button/demo/loading/index.less +6 -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/es/Button/style/index.less +255 -0
- 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/es/Dropdown/demo/button/index.less +9 -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/es/Dropdown/style/index.less +40 -0
- package/es/Icon/iconfont/demo.css +539 -0
- package/es/Icon/iconfont/demo_index.html +628 -0
- package/es/Icon/iconfont/iconfont.css +93 -0
- package/es/Icon/iconfont/iconfont.js +46 -0
- package/es/Icon/iconfont/iconfont.json +142 -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/es/Icon/index.less +32 -0
- 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/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/es/Input/demo/basic/index.less +6 -0
- 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/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/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/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/es/Input/style/index.less +62 -0
- 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/es/Menu/style/index.less +33 -0
- package/es/Select/BaseSelect.d.ts +5 -0
- package/es/Select/BaseSelect.js +400 -0
- package/es/Select/OptionsList/OptGroup.d.ts +7 -0
- package/es/Select/OptionsList/OptGroup.js +6 -0
- package/es/Select/OptionsList/OptionItem.d.ts +35 -0
- package/es/Select/OptionsList/OptionItem.js +157 -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 +249 -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 +2 -0
- package/es/Select/demo/single/index.js +86 -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 +221 -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/es/Select/style/index.less +539 -0
- 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/es/Tabs/demo/adaptHeight/index.less +3 -0
- package/es/Tabs/demo/basic/index.d.ts +4 -0
- package/es/Tabs/demo/basic/index.js +44 -0
- package/es/Tabs/demo/basic/index.less +5 -0
- package/es/Tabs/demo/horizontalScroll/index.d.ts +3 -0
- package/es/Tabs/demo/horizontalScroll/index.js +30 -0
- package/es/Tabs/demo/horizontalScroll/index.less +3 -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/es/Tabs/style/index.less +61 -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/es/Tooltip/demo/placement/index.less +7 -0
- package/es/Tooltip/demo/trigger/index.d.ts +3 -0
- package/es/Tooltip/demo/trigger/index.js +20 -0
- package/es/Tooltip/demo/trigger/index.less +5 -0
- package/es/Tooltip/index.d.ts +63 -0
- package/es/Tooltip/index.js +31 -0
- package/es/Tooltip/style/index.d.ts +2 -0
- package/es/Tooltip/style/index.js +2 -0
- package/es/Tooltip/style/index.less +14 -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/es/index.js +8 -0
- package/es/style/index.d.ts +2 -0
- package/es/style/index.js +2 -0
- package/es/style/index.less +3 -0
- package/es/style/mixins/index.less +0 -0
- package/es/style/themes/default/index.less +36 -0
- package/es/style/themes/default/themeColor.less +259 -0
- package/lib/Button/demo/Icon/index.d.ts +3 -0
- package/lib/Button/demo/Icon/index.js +82 -0
- package/lib/Button/demo/Icon/index.less +6 -0
- package/lib/Button/demo/basic/index.d.ts +4 -0
- package/lib/Button/demo/basic/index.js +73 -0
- package/lib/Button/demo/basic/index.less +7 -0
- package/lib/Button/demo/disable/index.d.ts +3 -0
- package/lib/Button/demo/disable/index.js +37 -0
- package/lib/Button/demo/disable/index.less +0 -0
- package/lib/Button/demo/href/index.d.ts +2 -0
- package/lib/Button/demo/href/index.js +30 -0
- package/lib/Button/demo/loading/index.d.ts +3 -0
- package/lib/Button/demo/loading/index.js +51 -0
- package/lib/Button/demo/loading/index.less +6 -0
- package/lib/Button/index.d.ts +50 -0
- package/lib/Button/index.js +124 -0
- package/lib/Button/style/index.d.ts +2 -0
- package/lib/Button/style/index.js +5 -0
- package/lib/Button/style/index.less +255 -0
- package/lib/Dropdown/Button.d.ts +69 -0
- package/lib/Dropdown/Button.js +52 -0
- package/lib/Dropdown/demo/basic/index.d.ts +4 -0
- package/lib/Dropdown/demo/basic/index.js +35 -0
- package/lib/Dropdown/demo/button/index.d.ts +3 -0
- package/lib/Dropdown/demo/button/index.js +182 -0
- package/lib/Dropdown/demo/button/index.less +9 -0
- package/lib/Dropdown/demo/placement/index.d.ts +2 -0
- package/lib/Dropdown/demo/placement/index.js +56 -0
- package/lib/Dropdown/demo/subMenu/index.d.ts +2 -0
- package/lib/Dropdown/demo/subMenu/index.js +59 -0
- package/lib/Dropdown/demo/trigger/index.d.ts +2 -0
- package/lib/Dropdown/demo/trigger/index.js +32 -0
- package/lib/Dropdown/index.d.ts +59 -0
- package/lib/Dropdown/index.js +47 -0
- package/lib/Dropdown/style/index.d.ts +2 -0
- package/lib/Dropdown/style/index.js +5 -0
- package/lib/Dropdown/style/index.less +40 -0
- package/lib/Icon/iconfont/demo.css +539 -0
- package/lib/Icon/iconfont/demo_index.html +628 -0
- package/lib/Icon/iconfont/iconfont.css +93 -0
- package/lib/Icon/iconfont/iconfont.js +48 -0
- package/lib/Icon/iconfont/iconfont.json +142 -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.d.ts +11 -0
- package/lib/Icon/index.js +54 -0
- package/lib/Icon/index.less +32 -0
- package/lib/Input/components/Group/index.d.ts +15 -0
- package/lib/Input/components/Group/index.js +24 -0
- package/lib/Input/components/Password/index.d.ts +10 -0
- package/lib/Input/components/Password/index.js +33 -0
- package/lib/Input/components/TextArea/index.d.ts +52 -0
- package/lib/Input/components/TextArea/index.js +26 -0
- package/lib/Input/demo/allowClear/index.d.ts +3 -0
- package/lib/Input/demo/allowClear/index.js +25 -0
- package/lib/Input/demo/allowClear/index.less +0 -0
- package/lib/Input/demo/basic/index.d.ts +4 -0
- package/lib/Input/demo/basic/index.js +80 -0
- package/lib/Input/demo/basic/index.less +6 -0
- package/lib/Input/demo/gourp/index.d.ts +2 -0
- package/lib/Input/demo/gourp/index.js +81 -0
- package/lib/Input/demo/password/index.d.ts +3 -0
- package/lib/Input/demo/password/index.js +35 -0
- package/lib/Input/demo/password/index.less +0 -0
- package/lib/Input/demo/prefix/index.d.ts +3 -0
- package/lib/Input/demo/prefix/index.js +32 -0
- package/lib/Input/demo/prefix/index.less +0 -0
- package/lib/Input/demo/showCount/index.d.ts +3 -0
- package/lib/Input/demo/showCount/index.js +31 -0
- package/lib/Input/demo/showCount/index.less +0 -0
- package/lib/Input/demo/textArea/autoSize.d.ts +2 -0
- package/lib/Input/demo/textArea/autoSize.js +63 -0
- package/lib/Input/index.d.ts +65 -0
- package/lib/Input/index.js +63 -0
- package/lib/Input/style/index.d.ts +2 -0
- package/lib/Input/style/index.js +5 -0
- package/lib/Input/style/index.less +62 -0
- package/lib/Menu/Divider.d.ts +5 -0
- package/lib/Menu/Divider.js +28 -0
- package/lib/Menu/MenuItem.d.ts +17 -0
- package/lib/Menu/MenuItem.js +28 -0
- package/lib/Menu/SubMenu.d.ts +26 -0
- package/lib/Menu/SubMenu.js +44 -0
- package/lib/Menu/index.d.ts +20 -0
- package/lib/Menu/index.js +49 -0
- package/lib/Menu/style/index.d.ts +2 -0
- package/lib/Menu/style/index.js +5 -0
- package/lib/Menu/style/index.less +33 -0
- package/lib/Select/BaseSelect.d.ts +5 -0
- package/lib/Select/BaseSelect.js +433 -0
- package/lib/Select/OptionsList/OptGroup.d.ts +7 -0
- package/lib/Select/OptionsList/OptGroup.js +14 -0
- package/lib/Select/OptionsList/OptionItem.d.ts +35 -0
- package/lib/Select/OptionsList/OptionItem.js +185 -0
- package/lib/Select/OptionsList/Options.d.ts +7 -0
- package/lib/Select/OptionsList/Options.js +14 -0
- package/lib/Select/OptionsList/index.d.ts +4 -0
- package/lib/Select/OptionsList/index.js +207 -0
- package/lib/Select/Selector/index.d.ts +4 -0
- package/lib/Select/Selector/index.js +273 -0
- package/lib/Select/VirtualList.d.ts +5 -0
- package/lib/Select/VirtualList.js +42 -0
- package/lib/Select/demo/disabled/index.d.ts +2 -0
- package/lib/Select/demo/disabled/index.js +64 -0
- package/lib/Select/demo/multiple/index.d.ts +2 -0
- package/lib/Select/demo/multiple/index.js +154 -0
- package/lib/Select/demo/options/index.d.ts +2 -0
- package/lib/Select/demo/options/index.js +69 -0
- package/lib/Select/demo/single/index.d.ts +2 -0
- package/lib/Select/demo/single/index.js +99 -0
- package/lib/Select/hooks/useCacheOption.d.ts +9 -0
- package/lib/Select/hooks/useCacheOption.js +113 -0
- package/lib/Select/index.d.ts +12 -0
- package/lib/Select/index.js +34 -0
- package/lib/Select/interface.d.ts +221 -0
- package/lib/Select/interface.js +5 -0
- package/lib/Select/style/index.d.ts +2 -0
- package/lib/Select/style/index.js +5 -0
- package/lib/Select/style/index.less +539 -0
- package/lib/Select/utils.d.ts +21 -0
- package/lib/Select/utils.js +233 -0
- package/lib/Tabs/TabPane.d.ts +21 -0
- package/lib/Tabs/TabPane.js +24 -0
- package/lib/Tabs/demo/adaptHeight/index.d.ts +3 -0
- package/lib/Tabs/demo/adaptHeight/index.js +34 -0
- package/lib/Tabs/demo/adaptHeight/index.less +3 -0
- package/lib/Tabs/demo/basic/index.d.ts +4 -0
- package/lib/Tabs/demo/basic/index.js +67 -0
- package/lib/Tabs/demo/basic/index.less +5 -0
- package/lib/Tabs/demo/horizontalScroll/index.d.ts +3 -0
- package/lib/Tabs/demo/horizontalScroll/index.js +45 -0
- package/lib/Tabs/demo/horizontalScroll/index.less +3 -0
- package/lib/Tabs/index.d.ts +41 -0
- package/lib/Tabs/index.js +58 -0
- package/lib/Tabs/style/index.d.ts +2 -0
- package/lib/Tabs/style/index.js +5 -0
- package/lib/Tabs/style/index.less +61 -0
- package/lib/Tooltip/demo/basic/index.d.ts +2 -0
- package/lib/Tooltip/demo/basic/index.js +20 -0
- package/lib/Tooltip/demo/overflow/index.d.ts +2 -0
- package/lib/Tooltip/demo/overflow/index.js +20 -0
- package/lib/Tooltip/demo/placement/index.d.ts +6 -0
- package/lib/Tooltip/demo/placement/index.js +86 -0
- package/lib/Tooltip/demo/placement/index.less +7 -0
- package/lib/Tooltip/demo/trigger/index.d.ts +3 -0
- package/lib/Tooltip/demo/trigger/index.js +34 -0
- package/lib/Tooltip/demo/trigger/index.less +5 -0
- package/lib/Tooltip/index.d.ts +63 -0
- package/lib/Tooltip/index.js +44 -0
- package/lib/Tooltip/style/index.d.ts +2 -0
- package/lib/Tooltip/style/index.js +5 -0
- package/lib/Tooltip/style/index.less +14 -0
- package/lib/_utils/hooks/useControlledState.d.ts +2 -0
- package/lib/_utils/hooks/useControlledState.js +63 -0
- package/lib/_utils/hooks/usePrefixCls.d.ts +2 -0
- package/lib/_utils/hooks/usePrefixCls.js +27 -0
- package/lib/index.d.ts +8 -0
- package/lib/index.js +63 -0
- package/lib/style/index.d.ts +2 -0
- package/lib/style/index.js +5 -0
- package/lib/style/index.less +3 -0
- package/lib/style/mixins/index.less +0 -0
- package/lib/style/themes/default/index.less +36 -0
- package/lib/style/themes/default/themeColor.less +259 -0
- package/package.json +87 -0
|
@@ -0,0 +1,140 @@
|
|
|
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 from "react"; // import { Select } from '@aloudata/aloudata-design';
|
|
14
|
+
|
|
15
|
+
import Select from '../../index';
|
|
16
|
+
import Icon from '../../../Icon';
|
|
17
|
+
var Option = Select.Option;
|
|
18
|
+
export default (function () {
|
|
19
|
+
var _React$useState = React.useState(''),
|
|
20
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
21
|
+
value = _React$useState2[0],
|
|
22
|
+
setValue = _React$useState2[1];
|
|
23
|
+
|
|
24
|
+
var _onChange = function onChange(value) {
|
|
25
|
+
console.log(value);
|
|
26
|
+
setValue(value);
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
30
|
+
className: 'ald-select-demo'
|
|
31
|
+
}, /*#__PURE__*/React.createElement(Select, {
|
|
32
|
+
className: 'ald-select',
|
|
33
|
+
style: {
|
|
34
|
+
width: 200
|
|
35
|
+
},
|
|
36
|
+
size: 'large',
|
|
37
|
+
multiple: true,
|
|
38
|
+
placeholder: "large size"
|
|
39
|
+
}, /*#__PURE__*/React.createElement(Option, {
|
|
40
|
+
key: 'a',
|
|
41
|
+
value: "Example Text"
|
|
42
|
+
}, "Example TexExample TextExample TextExample TextExample TextExample Textt"), /*#__PURE__*/React.createElement(Option, {
|
|
43
|
+
key: 'b',
|
|
44
|
+
value: "b"
|
|
45
|
+
}, "b"), /*#__PURE__*/React.createElement(Option, {
|
|
46
|
+
key: 'c',
|
|
47
|
+
value: "c"
|
|
48
|
+
}, "c"), /*#__PURE__*/React.createElement(Option, {
|
|
49
|
+
key: 'd',
|
|
50
|
+
value: "d"
|
|
51
|
+
}, "d"), /*#__PURE__*/React.createElement(Option, {
|
|
52
|
+
key: 'e',
|
|
53
|
+
value: "e"
|
|
54
|
+
}, "e"), /*#__PURE__*/React.createElement(Option, {
|
|
55
|
+
key: "f",
|
|
56
|
+
value: "f"
|
|
57
|
+
}, "f"), /*#__PURE__*/React.createElement(Option, {
|
|
58
|
+
key: "g",
|
|
59
|
+
value: "g"
|
|
60
|
+
}, "g")), /*#__PURE__*/React.createElement(Select, {
|
|
61
|
+
className: 'ald-select',
|
|
62
|
+
style: {
|
|
63
|
+
width: 200
|
|
64
|
+
},
|
|
65
|
+
size: 'default',
|
|
66
|
+
label: 'Label:',
|
|
67
|
+
multiple: true,
|
|
68
|
+
listHeight: 100,
|
|
69
|
+
placeholder: "default"
|
|
70
|
+
}, /*#__PURE__*/React.createElement(Option, {
|
|
71
|
+
key: 'a',
|
|
72
|
+
value: "Example Text"
|
|
73
|
+
}, "Example Text"), /*#__PURE__*/React.createElement(Option, {
|
|
74
|
+
key: 'b',
|
|
75
|
+
value: "b"
|
|
76
|
+
}, "b"), /*#__PURE__*/React.createElement(Option, {
|
|
77
|
+
key: 'c',
|
|
78
|
+
value: "c"
|
|
79
|
+
}, "c"), /*#__PURE__*/React.createElement(Option, {
|
|
80
|
+
key: 'd',
|
|
81
|
+
value: "d"
|
|
82
|
+
}, "d"), /*#__PURE__*/React.createElement(Option, {
|
|
83
|
+
key: 'e',
|
|
84
|
+
value: "e"
|
|
85
|
+
}, "e"), /*#__PURE__*/React.createElement(Option, {
|
|
86
|
+
key: "f",
|
|
87
|
+
value: "f"
|
|
88
|
+
}, "f"), /*#__PURE__*/React.createElement(Option, {
|
|
89
|
+
key: "g",
|
|
90
|
+
value: "g"
|
|
91
|
+
}, "g")), /*#__PURE__*/React.createElement(Select, {
|
|
92
|
+
className: 'ald-select',
|
|
93
|
+
style: {
|
|
94
|
+
width: 200
|
|
95
|
+
},
|
|
96
|
+
size: 'small',
|
|
97
|
+
multiple: true,
|
|
98
|
+
value: value,
|
|
99
|
+
// @ts-ignore
|
|
100
|
+
onChange: function onChange(v) {
|
|
101
|
+
_onChange(v);
|
|
102
|
+
},
|
|
103
|
+
placeholder: "small"
|
|
104
|
+
}, /*#__PURE__*/React.createElement(Option, {
|
|
105
|
+
key: 'a',
|
|
106
|
+
value: "Example Text"
|
|
107
|
+
}, "Example Text")), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement(Select, {
|
|
108
|
+
className: 'ald-select',
|
|
109
|
+
style: {
|
|
110
|
+
width: 200
|
|
111
|
+
},
|
|
112
|
+
size: 'large',
|
|
113
|
+
multiple: true,
|
|
114
|
+
label: /*#__PURE__*/React.createElement(Icon, {
|
|
115
|
+
type: 'view_Partial_line'
|
|
116
|
+
}),
|
|
117
|
+
placeholder: "large size"
|
|
118
|
+
}, /*#__PURE__*/React.createElement(Option, {
|
|
119
|
+
key: 'a',
|
|
120
|
+
value: "Example Text"
|
|
121
|
+
}, "Example TexExample TextExample TextExample TextExample TextExample Textt"), /*#__PURE__*/React.createElement(Option, {
|
|
122
|
+
key: 'b',
|
|
123
|
+
value: "b"
|
|
124
|
+
}, "b"), /*#__PURE__*/React.createElement(Option, {
|
|
125
|
+
key: 'c',
|
|
126
|
+
value: "c"
|
|
127
|
+
}, "c"), /*#__PURE__*/React.createElement(Option, {
|
|
128
|
+
key: 'd',
|
|
129
|
+
value: "d"
|
|
130
|
+
}, "d"), /*#__PURE__*/React.createElement(Option, {
|
|
131
|
+
key: 'e',
|
|
132
|
+
value: "e"
|
|
133
|
+
}, "e"), /*#__PURE__*/React.createElement(Option, {
|
|
134
|
+
key: "f",
|
|
135
|
+
value: "f"
|
|
136
|
+
}, "f"), /*#__PURE__*/React.createElement(Option, {
|
|
137
|
+
key: "g",
|
|
138
|
+
value: "g"
|
|
139
|
+
}, "g")));
|
|
140
|
+
});
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import React from "react"; // import { Select } from '@aloudata/aloudata-design';
|
|
2
|
+
|
|
3
|
+
import Select from '../../index';
|
|
4
|
+
var Option = Select.Option;
|
|
5
|
+
export default (function () {
|
|
6
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
7
|
+
className: 'ald-select-demo'
|
|
8
|
+
}, /*#__PURE__*/React.createElement(Select, {
|
|
9
|
+
className: 'ald-select',
|
|
10
|
+
style: {
|
|
11
|
+
width: 200
|
|
12
|
+
},
|
|
13
|
+
size: 'large',
|
|
14
|
+
multiple: true,
|
|
15
|
+
placeholder: "large",
|
|
16
|
+
options: [{
|
|
17
|
+
label: 'Option 1',
|
|
18
|
+
value: 'Option 1'
|
|
19
|
+
}, {
|
|
20
|
+
label: 'Option 2',
|
|
21
|
+
value: 'Option 2'
|
|
22
|
+
}]
|
|
23
|
+
}), /*#__PURE__*/React.createElement(Select, {
|
|
24
|
+
className: 'ald-select',
|
|
25
|
+
style: {
|
|
26
|
+
width: 200
|
|
27
|
+
},
|
|
28
|
+
multiple: true,
|
|
29
|
+
label: 'Label:',
|
|
30
|
+
placeholder: "placeholder",
|
|
31
|
+
options: [{
|
|
32
|
+
label: 'Option 1',
|
|
33
|
+
value: 'Option 1'
|
|
34
|
+
}, {
|
|
35
|
+
label: 'Option 2',
|
|
36
|
+
value: 'Option 2'
|
|
37
|
+
}]
|
|
38
|
+
}), /*#__PURE__*/React.createElement(Select, {
|
|
39
|
+
className: 'ald-select',
|
|
40
|
+
style: {
|
|
41
|
+
width: 200
|
|
42
|
+
},
|
|
43
|
+
multiple: true,
|
|
44
|
+
size: "small",
|
|
45
|
+
label: 'Label:',
|
|
46
|
+
placeholder: "normal",
|
|
47
|
+
options: [{
|
|
48
|
+
label: 'Option 1',
|
|
49
|
+
value: 'Option 1'
|
|
50
|
+
}, {
|
|
51
|
+
label: 'Option 2',
|
|
52
|
+
value: 'Option 2'
|
|
53
|
+
}]
|
|
54
|
+
}));
|
|
55
|
+
});
|
|
@@ -0,0 +1,86 @@
|
|
|
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 from "react"; // import { Select } from '@aloudata/aloudata-design';
|
|
14
|
+
|
|
15
|
+
import Select from '../../index';
|
|
16
|
+
var Option = Select.Option;
|
|
17
|
+
export default (function () {
|
|
18
|
+
var _React$useState = React.useState(''),
|
|
19
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
20
|
+
value = _React$useState2[0],
|
|
21
|
+
setValue = _React$useState2[1];
|
|
22
|
+
|
|
23
|
+
var _onChange = function onChange(value) {
|
|
24
|
+
console.log(value);
|
|
25
|
+
setValue(value);
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
29
|
+
className: 'ald-select-demo'
|
|
30
|
+
}, /*#__PURE__*/React.createElement(Select, {
|
|
31
|
+
className: 'ald-select',
|
|
32
|
+
style: {
|
|
33
|
+
width: 200
|
|
34
|
+
},
|
|
35
|
+
size: 'large',
|
|
36
|
+
allowClear: true,
|
|
37
|
+
placeholder: "large size"
|
|
38
|
+
}, /*#__PURE__*/React.createElement(Option, {
|
|
39
|
+
key: 'a',
|
|
40
|
+
value: "Example Text"
|
|
41
|
+
}, "Example Text"), /*#__PURE__*/React.createElement(Option, {
|
|
42
|
+
key: 'b',
|
|
43
|
+
value: "b"
|
|
44
|
+
}, "Menu item"), /*#__PURE__*/React.createElement(Option, {
|
|
45
|
+
key: 'c',
|
|
46
|
+
value: "c"
|
|
47
|
+
}, "c"), /*#__PURE__*/React.createElement(Option, {
|
|
48
|
+
key: 'd',
|
|
49
|
+
value: "d"
|
|
50
|
+
}, "d"), /*#__PURE__*/React.createElement(Option, {
|
|
51
|
+
key: 'e',
|
|
52
|
+
value: "e"
|
|
53
|
+
}, "e"), /*#__PURE__*/React.createElement(Option, {
|
|
54
|
+
key: "f",
|
|
55
|
+
value: "f"
|
|
56
|
+
}, "f"), /*#__PURE__*/React.createElement(Option, {
|
|
57
|
+
key: "g",
|
|
58
|
+
value: "g"
|
|
59
|
+
}, "g")), /*#__PURE__*/React.createElement(Select, {
|
|
60
|
+
className: 'ald-select',
|
|
61
|
+
style: {
|
|
62
|
+
width: 200
|
|
63
|
+
},
|
|
64
|
+
size: 'default',
|
|
65
|
+
placeholder: "default"
|
|
66
|
+
}, /*#__PURE__*/React.createElement(Option, {
|
|
67
|
+
key: 'a',
|
|
68
|
+
value: "Example Text"
|
|
69
|
+
}, "Example Text")), /*#__PURE__*/React.createElement(Select, {
|
|
70
|
+
className: 'ald-select',
|
|
71
|
+
style: {
|
|
72
|
+
width: 200
|
|
73
|
+
},
|
|
74
|
+
size: 'small',
|
|
75
|
+
label: 'Label:',
|
|
76
|
+
placeholder: "small",
|
|
77
|
+
value: value,
|
|
78
|
+
// @ts-ignore
|
|
79
|
+
onChange: function onChange(v) {
|
|
80
|
+
_onChange(v);
|
|
81
|
+
}
|
|
82
|
+
}, /*#__PURE__*/React.createElement(Option, {
|
|
83
|
+
key: 'a',
|
|
84
|
+
value: "Example Text"
|
|
85
|
+
}, "Example Text")));
|
|
86
|
+
});
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { TMaybeArray, IOption } from '../interface';
|
|
2
|
+
export default function useCacheOptions(): {
|
|
3
|
+
setCacheOptions: (options: IOption[]) => void;
|
|
4
|
+
getOptionByValue: (optValue: string | number) => IOption;
|
|
5
|
+
getOptionsByValue: (optValue: TMaybeArray<string | number>) => TMaybeArray<IOption>;
|
|
6
|
+
updateGroup: (value: boolean) => void;
|
|
7
|
+
cacheOptionsMap: Map<any, any>;
|
|
8
|
+
hasGroup: boolean;
|
|
9
|
+
};
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
var _excluded = ["options"];
|
|
2
|
+
|
|
3
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
4
|
+
|
|
5
|
+
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."); }
|
|
6
|
+
|
|
7
|
+
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); }
|
|
8
|
+
|
|
9
|
+
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; }
|
|
10
|
+
|
|
11
|
+
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; }
|
|
12
|
+
|
|
13
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
14
|
+
|
|
15
|
+
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; }
|
|
16
|
+
|
|
17
|
+
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; }
|
|
18
|
+
|
|
19
|
+
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; }
|
|
20
|
+
|
|
21
|
+
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; }
|
|
22
|
+
|
|
23
|
+
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; }
|
|
24
|
+
|
|
25
|
+
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
|
|
26
|
+
import { useCallback, useRef, useState } from 'react';
|
|
27
|
+
|
|
28
|
+
var optionSet = function optionSet(map, key, value) {
|
|
29
|
+
map.set(key, value);
|
|
30
|
+
}; // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
var groupOptionSet = function groupOptionSet(map, key, option) {
|
|
34
|
+
if (map.get(key)) {
|
|
35
|
+
var _map$get = map.get(key),
|
|
36
|
+
_map$get$options = _map$get.options,
|
|
37
|
+
groupOptions = _map$get$options === void 0 ? new Map() : _map$get$options,
|
|
38
|
+
rest = _objectWithoutProperties(_map$get, _excluded);
|
|
39
|
+
|
|
40
|
+
map.set(key, _objectSpread({
|
|
41
|
+
options: groupOptions.set(option.value, option)
|
|
42
|
+
}, rest));
|
|
43
|
+
} else {
|
|
44
|
+
map.set(key, {
|
|
45
|
+
label: option.groupLabel,
|
|
46
|
+
value: option.groupValue,
|
|
47
|
+
isSelectOptGroup: true,
|
|
48
|
+
options: new Map([[option.value, option]])
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
map.set(option.value, option);
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
export default function useCacheOptions() {
|
|
56
|
+
var cacheOptions = useRef(new Map());
|
|
57
|
+
var cacheOptionsMap = cacheOptions.current;
|
|
58
|
+
|
|
59
|
+
var _useState = useState(false),
|
|
60
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
61
|
+
isGroup = _useState2[0],
|
|
62
|
+
setIsGroup = _useState2[1];
|
|
63
|
+
|
|
64
|
+
var setCacheOptions = function setCacheOptions(options) {
|
|
65
|
+
if (!isGroup) {
|
|
66
|
+
options.forEach(function (option) {
|
|
67
|
+
return optionSet(cacheOptionsMap, option.value, option);
|
|
68
|
+
});
|
|
69
|
+
} else {
|
|
70
|
+
options.forEach(function (option) {
|
|
71
|
+
return groupOptionSet(cacheOptionsMap, option.groupValue, option);
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
var updateGroup = function updateGroup(value) {
|
|
77
|
+
if (value !== isGroup) {
|
|
78
|
+
setIsGroup(value);
|
|
79
|
+
}
|
|
80
|
+
}; // value to option || options
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
var getOptionByValue = useCallback(function (optValue) {
|
|
84
|
+
return cacheOptionsMap.get(optValue);
|
|
85
|
+
}, [cacheOptionsMap]);
|
|
86
|
+
|
|
87
|
+
var getOptionsByValue = function getOptionsByValue(optValue) {
|
|
88
|
+
return Array.isArray(optValue) ? optValue.reduce(function (prev, v) {
|
|
89
|
+
var op = getOptionByValue(v);
|
|
90
|
+
|
|
91
|
+
if (op) {
|
|
92
|
+
prev.push(op);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
return prev;
|
|
96
|
+
}, []) : getOptionByValue(optValue);
|
|
97
|
+
};
|
|
98
|
+
|
|
99
|
+
return {
|
|
100
|
+
setCacheOptions: setCacheOptions,
|
|
101
|
+
getOptionByValue: getOptionByValue,
|
|
102
|
+
getOptionsByValue: getOptionsByValue,
|
|
103
|
+
updateGroup: updateGroup,
|
|
104
|
+
cacheOptionsMap: cacheOptionsMap,
|
|
105
|
+
hasGroup: isGroup
|
|
106
|
+
};
|
|
107
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import BaseSelect from './BaseSelect';
|
|
2
|
+
import { IOption as Option, ISelectProps as SelectProps, IOptGroupProps as OptGroupProps, IOptionProps as OptionProps } from './interface';
|
|
3
|
+
import Options from './OptionsList/Options';
|
|
4
|
+
import OptGroup from './OptionsList/OptGroup';
|
|
5
|
+
import './style';
|
|
6
|
+
export declare type TSelect = typeof BaseSelect & {
|
|
7
|
+
Group: typeof OptGroup;
|
|
8
|
+
Option: typeof Options;
|
|
9
|
+
};
|
|
10
|
+
declare const Select: TSelect;
|
|
11
|
+
export { Options as Option, OptGroup as Group, SelectProps, OptionProps, Option as SelectOptions, OptGroupProps as GroupProps, };
|
|
12
|
+
export default Select;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import BaseSelect from './BaseSelect';
|
|
2
|
+
import Options from './OptionsList/Options';
|
|
3
|
+
import OptGroup from './OptionsList/OptGroup';
|
|
4
|
+
import './style';
|
|
5
|
+
var Select = BaseSelect;
|
|
6
|
+
Select.Option = Options;
|
|
7
|
+
Select.Group = OptGroup;
|
|
8
|
+
export { Options as Option, OptGroup as Group };
|
|
9
|
+
export default Select;
|
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
import _ from 'lodash';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
declare type TSize = 'small' | 'default' | 'large';
|
|
4
|
+
export declare type TMaybeArray<T> = T | T[];
|
|
5
|
+
export declare type modeType = 'string' | 'tags' | undefined;
|
|
6
|
+
export declare type searchType = 'normal' | 'inner' | 'no-search';
|
|
7
|
+
export interface IOption {
|
|
8
|
+
/**
|
|
9
|
+
列表单项主要文字
|
|
10
|
+
*/
|
|
11
|
+
label: string | React.ReactNode;
|
|
12
|
+
/**
|
|
13
|
+
作为列表的 `key` 来使用
|
|
14
|
+
*/
|
|
15
|
+
value: string | number;
|
|
16
|
+
/**
|
|
17
|
+
列表次要文字
|
|
18
|
+
*/
|
|
19
|
+
description?: string;
|
|
20
|
+
/**
|
|
21
|
+
是否禁用
|
|
22
|
+
*/
|
|
23
|
+
disabled?: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* 选中该 Option 后,Select 的 title
|
|
26
|
+
*/
|
|
27
|
+
title?: string;
|
|
28
|
+
/**
|
|
29
|
+
`tooltip` 描述
|
|
30
|
+
*/
|
|
31
|
+
tooltip?: string;
|
|
32
|
+
/**
|
|
33
|
+
分组的 `key` ,与 `groupLabel` 一起使用
|
|
34
|
+
*/
|
|
35
|
+
groupValue?: string;
|
|
36
|
+
/**
|
|
37
|
+
分组的标题
|
|
38
|
+
*/
|
|
39
|
+
groupLabel?: string;
|
|
40
|
+
options?: Map<string | number, IOption>;
|
|
41
|
+
isSelectOptGroup?: boolean;
|
|
42
|
+
}
|
|
43
|
+
export interface IOptGroupProps {
|
|
44
|
+
children?: React.ReactNode;
|
|
45
|
+
label: string | React.ReactNode;
|
|
46
|
+
value: string | number;
|
|
47
|
+
}
|
|
48
|
+
export interface IOptionProps {
|
|
49
|
+
children?: React.ReactNode;
|
|
50
|
+
value: string | number;
|
|
51
|
+
disabled?: boolean;
|
|
52
|
+
title?: string;
|
|
53
|
+
}
|
|
54
|
+
export interface ISelectProps {
|
|
55
|
+
/**
|
|
56
|
+
* @description 输入框尺寸
|
|
57
|
+
* @default default
|
|
58
|
+
* @type 'small' | 'default' | 'large';
|
|
59
|
+
*/
|
|
60
|
+
size?: TSize;
|
|
61
|
+
customizePrefixCls?: string;
|
|
62
|
+
/**
|
|
63
|
+
* @description 多选模式
|
|
64
|
+
* @default false
|
|
65
|
+
*/
|
|
66
|
+
multiple?: boolean;
|
|
67
|
+
/**
|
|
68
|
+
* @description 选择框默认文本
|
|
69
|
+
*/
|
|
70
|
+
placeholder?: string;
|
|
71
|
+
/**
|
|
72
|
+
* @description 是否禁用
|
|
73
|
+
* @default false
|
|
74
|
+
*/
|
|
75
|
+
disabled?: boolean;
|
|
76
|
+
/**
|
|
77
|
+
* @description 是否默认展开下拉菜单
|
|
78
|
+
* @default false
|
|
79
|
+
*/
|
|
80
|
+
defaultOpen?: boolean;
|
|
81
|
+
className?: string;
|
|
82
|
+
/**
|
|
83
|
+
* @description 下拉菜单的 className 属性
|
|
84
|
+
*/
|
|
85
|
+
dropDownClassName?: string;
|
|
86
|
+
style?: React.CSSProperties;
|
|
87
|
+
groupStyle?: React.CSSProperties;
|
|
88
|
+
optionStyle?: React.CSSProperties;
|
|
89
|
+
/**
|
|
90
|
+
* @description 下拉菜单的 style 属性
|
|
91
|
+
*/
|
|
92
|
+
dropDownStyle?: React.CSSProperties;
|
|
93
|
+
/**
|
|
94
|
+
* @description 指定默认选中的条目
|
|
95
|
+
*/
|
|
96
|
+
defaultValue?: TMaybeArray<string | number> | null;
|
|
97
|
+
/**
|
|
98
|
+
* @description 指定当前选中的条目,多选时为一个数组。
|
|
99
|
+
*/
|
|
100
|
+
value?: TMaybeArray<string | number> | null;
|
|
101
|
+
/**
|
|
102
|
+
* @description 数据化配置选项内容,相比 jsx 定义会获得更好的渲染性能
|
|
103
|
+
*/
|
|
104
|
+
options?: IOption[];
|
|
105
|
+
/**
|
|
106
|
+
* @description 设置弹窗滚动高度
|
|
107
|
+
* @default 256
|
|
108
|
+
*/
|
|
109
|
+
listHeight?: number;
|
|
110
|
+
listRowHeight?: number;
|
|
111
|
+
labelRenderer?: (input: string) => (option: IOption, isGroup: boolean) => React.ReactNode;
|
|
112
|
+
searchPredicate?: (input: string) => _.ListIterateeCustom<IOption, boolean>;
|
|
113
|
+
matchPredicate?: (input: string) => _.ListIterateeCustom<IOption, boolean>;
|
|
114
|
+
optionLabelRenderer?: (value: string | number, option?: IOption) => React.ReactNode;
|
|
115
|
+
/**
|
|
116
|
+
* @description 选中值改变时的回调
|
|
117
|
+
*/
|
|
118
|
+
onChange?: (value: TMaybeArray<string | number> | null, options?: TMaybeArray<IOption> | null) => void;
|
|
119
|
+
/**
|
|
120
|
+
* @description 被选中时调用,参数为选中项的 value
|
|
121
|
+
*/
|
|
122
|
+
onSelect?: (value: string | number, option: IOption) => void;
|
|
123
|
+
/**
|
|
124
|
+
* @description 开启清除功能
|
|
125
|
+
*/
|
|
126
|
+
allowClear?: boolean;
|
|
127
|
+
/**
|
|
128
|
+
* @description 清除的回调
|
|
129
|
+
*/
|
|
130
|
+
onClear?: () => void;
|
|
131
|
+
/**
|
|
132
|
+
* 浮层渲染父节点,默认渲染到 body 上
|
|
133
|
+
*/
|
|
134
|
+
getContainer?: (node: HTMLElement) => HTMLElement;
|
|
135
|
+
/**
|
|
136
|
+
* @description 是否展开下拉菜单
|
|
137
|
+
*/
|
|
138
|
+
open?: boolean;
|
|
139
|
+
/**
|
|
140
|
+
* dropdown visible 值改变时的回调
|
|
141
|
+
*/
|
|
142
|
+
onDropDownVisibleChange?: (visible: boolean) => void;
|
|
143
|
+
/** *
|
|
144
|
+
* @description 下拉菜单和选择器同宽
|
|
145
|
+
* @default true
|
|
146
|
+
*/
|
|
147
|
+
dropdownMatchSelectWidth?: boolean;
|
|
148
|
+
/**
|
|
149
|
+
* @description 下拉菜单内置标签
|
|
150
|
+
*/
|
|
151
|
+
label?: React.ReactNode;
|
|
152
|
+
children?: React.ReactNode[] | React.ReactNode;
|
|
153
|
+
}
|
|
154
|
+
export interface ISelectorProps {
|
|
155
|
+
input: string;
|
|
156
|
+
disabled: boolean;
|
|
157
|
+
prefix: string;
|
|
158
|
+
size: 'small' | 'default' | 'large';
|
|
159
|
+
multiple: boolean;
|
|
160
|
+
bordered: boolean;
|
|
161
|
+
isFocused: boolean;
|
|
162
|
+
className?: string | undefined;
|
|
163
|
+
visible: boolean;
|
|
164
|
+
style?: React.CSSProperties | undefined;
|
|
165
|
+
allowClear: boolean;
|
|
166
|
+
mode?: modeType;
|
|
167
|
+
label?: React.ReactNode;
|
|
168
|
+
value?: TMaybeArray<string | number> | undefined | null;
|
|
169
|
+
filteredOptions: IOption[];
|
|
170
|
+
searchType: searchType;
|
|
171
|
+
placeholder?: string;
|
|
172
|
+
optionLabelRenderer: (value: string | number, option?: IOption) => React.ReactNode;
|
|
173
|
+
getOptionByValue: (optValue: string | number) => IOption;
|
|
174
|
+
onInputChange: (value: string) => void;
|
|
175
|
+
onAllowClear: () => void;
|
|
176
|
+
deleteValue: (value: React.ReactText[], v: string | number) => void;
|
|
177
|
+
arrowComponent?: React.ReactElement | undefined;
|
|
178
|
+
closeComponent?: React.ReactElement | undefined;
|
|
179
|
+
}
|
|
180
|
+
export interface IVirtualListProps {
|
|
181
|
+
itemHeight?: number;
|
|
182
|
+
height?: number;
|
|
183
|
+
prefixCls?: string;
|
|
184
|
+
children: React.ReactNode;
|
|
185
|
+
data: IOption[];
|
|
186
|
+
virtual?: boolean;
|
|
187
|
+
itemKey: string | number | ((item: never) => React.ReactText);
|
|
188
|
+
}
|
|
189
|
+
export interface IOptionsListProps {
|
|
190
|
+
style?: React.CSSProperties;
|
|
191
|
+
input: string;
|
|
192
|
+
prefixCls: string;
|
|
193
|
+
groupStyle?: React.CSSProperties;
|
|
194
|
+
optionStyle?: React.CSSProperties;
|
|
195
|
+
selected?: TMaybeArray<React.ReactText> | null;
|
|
196
|
+
multiple: boolean;
|
|
197
|
+
isMode?: boolean;
|
|
198
|
+
optionChecked?: TMaybeArray<React.ReactText>;
|
|
199
|
+
visible?: boolean;
|
|
200
|
+
isUseAll?: boolean;
|
|
201
|
+
data: IOption[];
|
|
202
|
+
hasGroup: boolean;
|
|
203
|
+
searchType: searchType;
|
|
204
|
+
placeholder?: string;
|
|
205
|
+
notFoundContent?: React.ReactElement;
|
|
206
|
+
onTempValueChange: (tempValue: React.ReactText[]) => void;
|
|
207
|
+
setTempValue: (values: React.ReactText[]) => void;
|
|
208
|
+
value?: TMaybeArray<React.ReactText> | null;
|
|
209
|
+
tempValue: React.ReactText[];
|
|
210
|
+
isFooter?: boolean;
|
|
211
|
+
labelRenderer: (option: IOption, isGruop: false) => React.ReactNode;
|
|
212
|
+
onOptionClick: (selectedValue: string | number) => void;
|
|
213
|
+
getContainer?: (node: HTMLElement) => HTMLElement;
|
|
214
|
+
onValueChange?: (optionValues: TMaybeArray<string | number> | null) => void;
|
|
215
|
+
onInputChange: (value: string) => void;
|
|
216
|
+
height?: number | undefined;
|
|
217
|
+
itemHeight?: number | undefined;
|
|
218
|
+
activeIndex: number;
|
|
219
|
+
setActiveIndex: React.Dispatch<React.SetStateAction<number>>;
|
|
220
|
+
}
|
|
221
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|