@chaoswise/ui 3.1.3 → 3.1.5
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/lib/AbreastLayout/index.js +2 -2
- package/lib/AdaptiveLayout/index.js +2 -2
- package/lib/Alert/index.js +2 -2
- package/lib/Alert/index.style.js +2 -0
- package/lib/Antd5/alert/Alert.js +2 -2
- package/lib/Antd5/avatar/avatar.js +2 -2
- package/lib/Antd5/badge/ScrollNumber.js +2 -2
- package/lib/Antd5/badge/index.js +2 -2
- package/lib/Antd5/breadcrumb/Breadcrumb.js +2 -2
- package/lib/Antd5/breadcrumb/BreadcrumbItem.js +2 -2
- package/lib/Antd5/breadcrumb/useItemRender.js +2 -2
- package/lib/Antd5/breadcrumb/useItems.js +2 -2
- package/lib/Antd5/button/button-group.js +2 -2
- package/lib/Antd5/button/button.js +2 -2
- package/lib/Antd5/card/Card.js +2 -2
- package/lib/Antd5/card/Grid.js +2 -2
- package/lib/Antd5/card/Meta.js +2 -2
- package/lib/Antd5/carousel/index.js +2 -2
- package/lib/Antd5/cascader/index.js +2 -2
- package/lib/Antd5/checkbox/Checkbox.js +2 -2
- package/lib/Antd5/checkbox/Group.js +2 -2
- package/lib/Antd5/color-picker/ColorPicker.js +2 -2
- package/lib/Antd5/color-picker/components/ColorSlider.js +2 -2
- package/lib/Antd5/color-picker/components/ColorTrigger.js +2 -2
- package/lib/Antd5/color-picker/components/PanelPicker/index.js +2 -2
- package/lib/Antd5/config-provider/index.js +2 -2
- package/lib/Antd5/date-picker/generatePicker/generateRangePicker.js +2 -2
- package/lib/Antd5/date-picker/generatePicker/generateSinglePicker.js +2 -2
- package/lib/Antd5/descriptions/hooks/useItems.js +2 -2
- package/lib/Antd5/descriptions/hooks/useRow.js +2 -2
- package/lib/Antd5/descriptions/index.js +2 -2
- package/lib/Antd5/divider/index.js +2 -2
- package/lib/Antd5/drawer/index.js +2 -2
- package/lib/Antd5/dropdown/dropdown-button.js +2 -2
- package/lib/Antd5/empty/index.js +2 -2
- package/lib/Antd5/flex/index.js +2 -2
- package/lib/Antd5/float-button/BackTop.js +2 -2
- package/lib/Antd5/float-button/FloatButton.js +2 -2
- package/lib/Antd5/float-button/FloatButtonGroup.js +2 -2
- package/lib/Antd5/float-button/PurePanel.js +2 -2
- package/lib/Antd5/form/Form.js +2 -2
- package/lib/Antd5/form/FormItem/ItemHolder.js +2 -2
- package/lib/Antd5/form/FormItemInput.js +2 -2
- package/lib/Antd5/form/FormItemLabel.js +2 -2
- package/lib/Antd5/form/FormList.js +2 -2
- package/lib/Antd5/grid/col.js +2 -2
- package/lib/Antd5/grid/row.js +2 -2
- package/lib/Antd5/image/PreviewGroup.js +2 -2
- package/lib/Antd5/image/index.js +2 -2
- package/lib/Antd5/input/Input.js +2 -2
- package/lib/Antd5/input/OTP/OTPInput.js +2 -2
- package/lib/Antd5/input/OTP/index.js +2 -2
- package/lib/Antd5/input/Password.js +2 -2
- package/lib/Antd5/input/Search.js +2 -2
- package/lib/Antd5/input/TextArea.js +2 -2
- package/lib/Antd5/input-number/index.js +2 -2
- package/lib/Antd5/layout/Sider.js +2 -2
- package/lib/Antd5/layout/layout.js +2 -2
- package/lib/Antd5/list/Item.js +2 -2
- package/lib/Antd5/list/index.js +2 -2
- package/lib/Antd5/mentions/index.js +2 -2
- package/lib/Antd5/menu/MenuDivider.js +2 -2
- package/lib/Antd5/menu/MenuItem.js +1 -0
- package/lib/Antd5/menu/OverrideContext.js +2 -2
- package/lib/Antd5/menu/menu.js +2 -2
- package/lib/Antd5/message/PurePanel.js +2 -2
- package/lib/Antd5/message/useMessage.js +2 -2
- package/lib/Antd5/modal/ConfirmDialog.js +2 -2
- package/lib/Antd5/modal/Modal.js +2 -2
- package/lib/Antd5/modal/PurePanel.js +2 -2
- package/lib/Antd5/modal/useModal/HookModal.js +2 -2
- package/lib/Antd5/notification/PurePanel.js +2 -2
- package/lib/Antd5/notification/useNotification.js +2 -2
- package/lib/Antd5/pagination/Pagination.js +2 -2
- package/lib/Antd5/popconfirm/PurePanel.js +2 -2
- package/lib/Antd5/popconfirm/index.js +2 -2
- package/lib/Antd5/popover/PurePanel.js +2 -2
- package/lib/Antd5/popover/index.js +2 -2
- package/lib/Antd5/progress/Line.js +2 -2
- package/lib/Antd5/progress/progress.js +2 -2
- package/lib/Antd5/qr-code/index.js +2 -2
- package/lib/Antd5/radio/radio.js +2 -2
- package/lib/Antd5/radio/radioButton.js +2 -2
- package/lib/Antd5/rate/index.js +2 -2
- package/lib/Antd5/segmented/index.js +2 -2
- package/lib/Antd5/select/index.js +2 -2
- package/lib/Antd5/slider/index.js +2 -2
- package/lib/Antd5/space/Compact.js +2 -2
- package/lib/Antd5/space/index.js +2 -2
- package/lib/Antd5/spin/index.js +2 -2
- package/lib/Antd5/splitter/hooks/useItems.js +2 -2
- package/lib/Antd5/splitter/hooks/useResize.js +2 -2
- package/lib/Antd5/statistic/Countdown.js +2 -2
- package/lib/Antd5/statistic/Statistic.js +2 -2
- package/lib/Antd5/steps/index.js +2 -2
- package/lib/Antd5/switch/index.js +2 -2
- package/lib/Antd5/table/hooks/usePagination.js +2 -2
- package/lib/Antd5/tabs/hooks/useLegacyItems.js +2 -2
- package/lib/Antd5/tabs/index.js +2 -2
- package/lib/Antd5/tag/CheckableTag.js +2 -2
- package/lib/Antd5/tag/index.js +2 -2
- package/lib/Antd5/theme/useToken.js +2 -2
- package/lib/Antd5/theme/util/alias.js +2 -2
- package/lib/Antd5/time-picker/index.js +2 -2
- package/lib/Antd5/timeline/Timeline.js +2 -2
- package/lib/Antd5/timeline/TimelineItem.js +2 -2
- package/lib/Antd5/timeline/TimelineItemList.js +2 -2
- package/lib/Antd5/tooltip/index.js +2 -2
- package/lib/Antd5/tour/PurePanel.js +2 -2
- package/lib/Antd5/tour/index.js +2 -2
- package/lib/Antd5/tree/DirectoryTree.js +2 -2
- package/lib/Antd5/tree-select/index.js +2 -2
- package/lib/Antd5/typography/Base/index.js +2 -2
- package/lib/Antd5/typography/Link.js +2 -2
- package/lib/Antd5/typography/Text.js +2 -2
- package/lib/Antd5/typography/Title.js +2 -2
- package/lib/Antd5/typography/Typography.js +2 -2
- package/lib/Antd5/upload/Dragger.js +2 -2
- package/lib/Badge/index.style.js +9 -7
- package/lib/BasicLayout/Breadcrumb.js +2 -2
- package/lib/BasicLayout/Footer.js +2 -2
- package/lib/BasicLayout/Sider.js +2 -2
- package/lib/Button/index.js +2 -2
- package/lib/Button/index.style.js +3 -1
- package/lib/CWCascader/Cascader/index.js +3 -3
- package/lib/CWCascader/rc-cascader/Cascader.js +2 -2
- package/lib/CWMessage/index.js +2 -2
- package/lib/CWRadioTabs/index.js +2 -2
- package/lib/CWRangePicker/DropdownMenu/index.js +2 -2
- package/lib/CWRangePicker/Refresh/index.js +2 -2
- package/lib/CWRangePicker/index.js +2 -2
- package/lib/CWSelect/DragTag.js +48 -0
- package/lib/CWSelect/Tag.js +43 -0
- package/lib/CWSelect/index.js +323 -9
- package/lib/CWSelect/index.style.js +62 -10
- package/lib/CWTable/CWTable.js +2 -2
- package/lib/CWTable/header.js +2 -2
- package/lib/CWTable/index.style.js +2 -0
- package/lib/CWTree/index.js +2 -2
- package/lib/CardSelect/index.js +2 -2
- package/lib/CardSelect/index.style.js +3 -1
- package/lib/Collapse/index.js +2 -2
- package/lib/Collapse/index.style.js +2 -0
- package/lib/ConfigProvider/ConfigProvider.js +2 -2
- package/lib/ConfigProvider/theme/common.js +3 -0
- package/lib/ConfigProvider/theme/default.js +2 -1
- package/lib/ConfigProvider/theme/utils.js +2 -2
- package/lib/CustomScrollBar/index.js +2 -2
- package/lib/DataView/index.style.js +2 -0
- package/lib/Drawer/index.js +2 -2
- package/lib/Drawer/index.style.js +3 -1
- package/lib/Dropdown/DropdownButton.js +2 -2
- package/lib/Dropdown/index.js +2 -2
- package/lib/Dropdown/index.style.js +2 -0
- package/lib/EchartsArea/index.js +2 -2
- package/lib/EchartsBar/index.js +2 -2
- package/lib/EchartsBarRow/index.js +2 -2
- package/lib/EchartsBase/index.js +2 -2
- package/lib/EchartsLine/index.js +2 -2
- package/lib/EchartsPie/index.js +2 -2
- package/lib/EchartsRing/index.js +2 -2
- package/lib/Empty/index.js +2 -2
- package/lib/Empty/index.style.js +2 -0
- package/lib/Flow/BasicLayout/Chain.js +2 -2
- package/lib/Flow/Flow.js +2 -2
- package/lib/Form/FormItem.js +2 -2
- package/lib/Form/index.js +2 -2
- package/lib/Form/index.style.js +2 -0
- package/lib/FormItemWrapper/index.js +2 -2
- package/lib/GlobalTabs/index.js +2 -2
- package/lib/GlobalTabs/index.style.js +3 -1
- package/lib/Header/CommonDropMenu.js +2 -2
- package/lib/Header/LocaleSwitcher.js +2 -2
- package/lib/Header/Message/index.js +2 -2
- package/lib/Icon/index.js +2 -2
- package/lib/Input/InputComponent.js +2 -2
- package/lib/Input/index.style.js +2 -0
- package/lib/InputNumber/index.js +2 -2
- package/lib/Joyride/index.js +2 -2
- package/lib/LayoutBreadcrumb/index.js +2 -2
- package/lib/LayoutWrapper/Footer.js +2 -2
- package/lib/LayoutWrapper/Header.js +2 -2
- package/lib/Modal/Modal.js +2 -2
- package/lib/Modal/index.js +2 -2
- package/lib/Modal/index.style.js +3 -1
- package/lib/ModuleFederation/react-dynamic-remote-component/RemoteComponent.js +2 -2
- package/lib/ModuleTitle/index.js +2 -2
- package/lib/Pagination/index.js +3 -4
- package/lib/Pagination/index.style.js +3 -1
- package/lib/QuickRangePicker/index.js +2 -2
- package/lib/QuickTransfer/index.js +2 -2
- package/lib/RangePicker/index.js +2 -2
- package/lib/ScrollLoad/index.js +2 -2
- package/lib/SearchBar/index.js +2 -2
- package/lib/SiderMenu/index.js +2 -2
- package/lib/SiderMenu/index.style.js +20 -4
- package/lib/SimpleCard/index.js +2 -2
- package/lib/SimplePagination/index.js +2 -0
- package/lib/SimplePagination/index.style.js +2 -1
- package/lib/SingleSpa/index.js +2 -2
- package/lib/Slider/index.js +2 -2
- package/lib/Tabs/index.js +2 -2
- package/lib/Tag/CheckableTag.js +2 -2
- package/lib/Tag/index.js +2 -2
- package/lib/Tag/index.style.js +2 -2
- package/lib/ThemeProvider/main.js +2 -2
- package/lib/TimeRangeSlider/Refresh/index.js +2 -2
- package/lib/TimeRangeSlider/index.js +2 -2
- package/lib/TimeZoneSelect/index.js +2 -2
- package/lib/Tooltip/index.js +2 -2
- package/lib/TooltipText/index.js +2 -2
- package/lib/WangEditor/editor4.js +2 -2
- package/lib/WangEditor/index.js +2 -2
- package/lib/antd-style/factories/createStyleProvider/index.js +2 -2
- package/lib/antd-style/factories/createStyles/index.js +2 -2
- package/lib/antd-style/factories/createThemeProvider/AntdProvider.js +2 -2
- package/lib/antd-style/factories/createThemeProvider/TokenContainer.js +2 -2
- package/lib/antd-style/factories/createThemeProvider/index.js +2 -2
- package/lib/configHoc/index.js +2 -2
- package/lib/locales/en_US.json +3 -0
- package/lib/locales/zh_CN.json +3 -0
- package/lib/locales/zh_TW.json +3 -0
- package/lib/useLocale/index.js +2 -2
- package/package.json +8 -3
- package/lib/CWTree/locale/en_US.js +0 -3
- package/lib/CWTree/locale/index.js +0 -11
- package/lib/CWTree/locale/zh_CN.js +0 -3
- package/lib/CWTree/locale/zh_TW.js +0 -3
- package/lib/ConfigProvider/customTheme.js +0 -266
- package/lib/ConfigProvider/customToken.js +0 -43
package/lib/CWSelect/index.js
CHANGED
|
@@ -1,24 +1,73 @@
|
|
|
1
|
-
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
import _Checkbox from "@chaoswise/ui/lib/Checkbox";
|
|
3
|
+
import _Tooltip from "@chaoswise/ui/lib/Tooltip";
|
|
4
|
+
import _Tag from "@chaoswise/ui/lib/Tag";
|
|
5
|
+
var _excluded = ["selectLabel", "label", "prefix", "defaultValue", "mode", "value", "labelInValue", "onChange", "onSelect", "onDeselect", "onDragEnd", "tagRender", "allowDrag", "maxTagCount", "showCheckbox", "tagLabelRender", "maxTagTextLength", "dropdownRender", "multipleOptions", "children", "maxCount"];
|
|
2
6
|
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
7
|
+
function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }
|
|
8
|
+
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."); }
|
|
9
|
+
function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); }
|
|
10
|
+
function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }
|
|
11
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
12
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
13
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
14
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
15
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
3
16
|
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
4
17
|
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."); }
|
|
5
18
|
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
6
19
|
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
7
20
|
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
8
21
|
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
9
|
-
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var
|
|
10
|
-
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (e.
|
|
11
|
-
import React, { forwardRef, useMemo } from "react";
|
|
22
|
+
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
23
|
+
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
24
|
+
import React, { forwardRef, useState, useEffect, useMemo, useRef, useCallback } from "react";
|
|
12
25
|
import Select from "../Antd5/select";
|
|
13
|
-
import
|
|
26
|
+
import DragTag from "./DragTag";
|
|
27
|
+
import CustomTag from "./Tag";
|
|
14
28
|
import useConfigContext from "../useConfigContext";
|
|
29
|
+
import { HTML5Backend } from "react-dnd-html5-backend";
|
|
30
|
+
import { DndProvider } from "react-dnd";
|
|
15
31
|
import { cloneComProps } from "../utils";
|
|
32
|
+
import update from "immutability-helper";
|
|
33
|
+
import PropTypes from "prop-types";
|
|
34
|
+
import { useIntl } from "../locales";
|
|
16
35
|
import useStyle from "./index.style";
|
|
17
36
|
var CWSelect = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
18
37
|
var selectLabel = props.selectLabel,
|
|
19
38
|
label = props.label,
|
|
20
39
|
prefix = props.prefix,
|
|
40
|
+
defaultValue = props.defaultValue,
|
|
41
|
+
mode = props.mode,
|
|
42
|
+
value = props.value,
|
|
43
|
+
labelInValue = props.labelInValue,
|
|
44
|
+
_props$onChange = props.onChange,
|
|
45
|
+
onChange = _props$onChange === void 0 ? function () {} : _props$onChange,
|
|
46
|
+
_props$onSelect = props.onSelect,
|
|
47
|
+
onSelect = _props$onSelect === void 0 ? function () {} : _props$onSelect,
|
|
48
|
+
_props$onDeselect = props.onDeselect,
|
|
49
|
+
onDeselect = _props$onDeselect === void 0 ? function () {} : _props$onDeselect,
|
|
50
|
+
_props$onDragEnd = props.onDragEnd,
|
|
51
|
+
onDragEnd = _props$onDragEnd === void 0 ? function () {} : _props$onDragEnd,
|
|
52
|
+
tagRender = props.tagRender,
|
|
53
|
+
_props$allowDrag = props.allowDrag,
|
|
54
|
+
allowDrag = _props$allowDrag === void 0 ? false : _props$allowDrag,
|
|
55
|
+
maxTagCount = props.maxTagCount,
|
|
56
|
+
_props$showCheckbox = props.showCheckbox,
|
|
57
|
+
showCheckbox = _props$showCheckbox === void 0 ? false : _props$showCheckbox,
|
|
58
|
+
tagLabelRender = props.tagLabelRender,
|
|
59
|
+
maxTagTextLength = props.maxTagTextLength,
|
|
60
|
+
dropdownRender = props.dropdownRender,
|
|
61
|
+
_props$multipleOption = props.multipleOptions,
|
|
62
|
+
multipleOptions = _props$multipleOption === void 0 ? {
|
|
63
|
+
showCheckbox: false,
|
|
64
|
+
showSelectAll: true,
|
|
65
|
+
isCheckboxMultipleHasSelectAll: true
|
|
66
|
+
} : _props$multipleOption,
|
|
67
|
+
children = props.children,
|
|
68
|
+
maxCount = props.maxCount,
|
|
21
69
|
rest = _objectWithoutProperties(props, _excluded);
|
|
70
|
+
var intl = useIntl();
|
|
22
71
|
var _useConfigContext = useConfigContext(),
|
|
23
72
|
getPrefixCls = _useConfigContext.getPrefixCls;
|
|
24
73
|
var prefixCls = getPrefixCls("select");
|
|
@@ -27,14 +76,279 @@ var CWSelect = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
27
76
|
wrapCSSVar = _useStyle2[0],
|
|
28
77
|
hashId = _useStyle2[1],
|
|
29
78
|
cssVarCls = _useStyle2[2];
|
|
79
|
+
var keyIndexMap = useRef({});
|
|
80
|
+
var _useState = useState([]),
|
|
81
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
82
|
+
allInstance = _useState2[0],
|
|
83
|
+
setAllInstance = _useState2[1];
|
|
84
|
+
var _useState3 = useState([]),
|
|
85
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
86
|
+
allOptions = _useState4[0],
|
|
87
|
+
setAllOptions = _useState4[1];
|
|
88
|
+
var _useState5 = useState([]),
|
|
89
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
90
|
+
activeKey = _useState6[0],
|
|
91
|
+
setActiveKey = _useState6[1];
|
|
30
92
|
var _prefix = useMemo(function () {
|
|
31
93
|
return prefix || label || selectLabel;
|
|
32
94
|
}, [prefix, label, selectLabel]);
|
|
33
|
-
|
|
95
|
+
var _showCheckbox = useMemo(function () {
|
|
96
|
+
return mode === "multiple" && (showCheckbox || multipleOptions.showCheckbox);
|
|
97
|
+
}, [mode, showCheckbox, multipleOptions.showCheckbox]);
|
|
98
|
+
var _showCheckAll = useMemo(function () {
|
|
99
|
+
return multipleOptions.isCheckboxMultipleHasSelectAll && !("maxCount" in props);
|
|
100
|
+
}, [multipleOptions.isCheckboxMultipleHasSelectAll, maxCount]);
|
|
101
|
+
useEffect(function () {
|
|
102
|
+
if (mode) {
|
|
103
|
+
getMapFromArray(defaultValue);
|
|
104
|
+
}
|
|
105
|
+
}, [defaultValue]);
|
|
106
|
+
useEffect(function () {
|
|
107
|
+
if (mode) {
|
|
108
|
+
getMapFromArray(value);
|
|
109
|
+
}
|
|
110
|
+
}, [value]);
|
|
111
|
+
var getMapFromArray = useCallback(function (_value) {
|
|
112
|
+
setActiveKey(_value || []);
|
|
113
|
+
if (!_value) return;
|
|
114
|
+
var value = Array.isArray(_value) ? _value : [_value];
|
|
115
|
+
keyIndexMap.current = {};
|
|
116
|
+
var allKeys = value.map(function (item, index) {
|
|
117
|
+
var key = labelInValue ? item.value : item;
|
|
118
|
+
keyIndexMap.current[key] = {
|
|
119
|
+
index: index
|
|
120
|
+
};
|
|
121
|
+
return key;
|
|
122
|
+
});
|
|
123
|
+
setTimeout(function () {
|
|
124
|
+
return setAllInstance(allKeys);
|
|
125
|
+
});
|
|
126
|
+
}, [labelInValue]);
|
|
127
|
+
var _onChange = function _onChange(newValue, option) {
|
|
128
|
+
onChange(newValue, option);
|
|
129
|
+
setAllOptions(option);
|
|
130
|
+
if (value) return;
|
|
131
|
+
if (mode) {
|
|
132
|
+
getMapFromArray(newValue);
|
|
133
|
+
}
|
|
134
|
+
};
|
|
135
|
+
var onPreventMouseDown = function onPreventMouseDown(e) {
|
|
136
|
+
e.preventDefault();
|
|
137
|
+
e.stopPropagation();
|
|
138
|
+
};
|
|
139
|
+
var renderTag = useCallback(function (props) {
|
|
140
|
+
var _disabled = rest.disabled || props.disabled;
|
|
141
|
+
return /*#__PURE__*/React.createElement(CustomTag, {
|
|
142
|
+
tagProps: props,
|
|
143
|
+
key: props.value,
|
|
144
|
+
maxTagTextLength: maxTagTextLength,
|
|
145
|
+
tagLabelRender: tagLabelRender,
|
|
146
|
+
closeIcon: !_disabled
|
|
147
|
+
});
|
|
148
|
+
}, [maxTagTextLength, tagLabelRender, rest.disabled]);
|
|
149
|
+
var moveNode = useCallback(function (dragIndex, hoverIndex) {
|
|
150
|
+
var dropChange = allInstance[dragIndex];
|
|
151
|
+
var dragChange = allInstance[hoverIndex];
|
|
152
|
+
var dragSortInstance = update(allInstance, {
|
|
153
|
+
$splice: [[dragIndex, 1, dragChange], [hoverIndex, 1, dropChange]]
|
|
154
|
+
});
|
|
155
|
+
var dragAllOptions = dragSortInstance.map(function (item) {
|
|
156
|
+
var findOption = allOptions.find(function (i) {
|
|
157
|
+
return i.value === item;
|
|
158
|
+
});
|
|
159
|
+
return findOption;
|
|
160
|
+
});
|
|
161
|
+
onDragEnd(dragSortInstance);
|
|
162
|
+
_onChange(dragSortInstance, dragAllOptions, true);
|
|
163
|
+
}, [allInstance]);
|
|
164
|
+
var tagDropdownOverlay = useMemo(function () {
|
|
165
|
+
return allInstance.slice(maxTagCount).map(function (key) {
|
|
166
|
+
var props = keyIndexMap.current[key];
|
|
167
|
+
if (!props) return null;
|
|
168
|
+
var _disabled = rest.disabled || props.disabled;
|
|
169
|
+
return /*#__PURE__*/React.createElement(CustomTag, {
|
|
170
|
+
tagProps: props,
|
|
171
|
+
key: key,
|
|
172
|
+
maxTagTextLength: maxTagTextLength,
|
|
173
|
+
tagLabelRender: tagLabelRender,
|
|
174
|
+
closeIcon: !_disabled
|
|
175
|
+
});
|
|
176
|
+
});
|
|
177
|
+
}, [allInstance, maxTagCount, tagLabelRender, maxTagTextLength, rest.disabled]);
|
|
178
|
+
var _tagRender = function _tagRender(props) {
|
|
179
|
+
var node = keyIndexMap.current[props.value];
|
|
180
|
+
if (node) {
|
|
181
|
+
keyIndexMap.current[props.value] = _objectSpread(_objectSpread({}, keyIndexMap.current[props.value]), props);
|
|
182
|
+
}
|
|
183
|
+
if (allowDrag) {
|
|
184
|
+
var _disabled = rest.disabled || props.disabled;
|
|
185
|
+
return /*#__PURE__*/React.createElement(DragTag, {
|
|
186
|
+
tagProps: keyIndexMap.current[props.value],
|
|
187
|
+
maxTagTextLength: maxTagTextLength,
|
|
188
|
+
tagLabelRender: tagLabelRender,
|
|
189
|
+
closeIcon: !_disabled,
|
|
190
|
+
moveNode: moveNode
|
|
191
|
+
});
|
|
192
|
+
}
|
|
193
|
+
if (maxTagCount === undefined) {
|
|
194
|
+
return renderTag(props);
|
|
195
|
+
}
|
|
196
|
+
if (node && node.index === maxTagCount) {
|
|
197
|
+
return /*#__PURE__*/React.createElement(_Tooltip, {
|
|
198
|
+
overlayClassName: "".concat(prefixCls, "-tag-tooltip-wrapper"),
|
|
199
|
+
overlay: tagDropdownOverlay,
|
|
200
|
+
placement: "bottomRight"
|
|
201
|
+
}, /*#__PURE__*/React.createElement(_Tag, {
|
|
202
|
+
className: "".concat(prefixCls, "-custom-tag"),
|
|
203
|
+
type: "custom_type01",
|
|
204
|
+
closeIcon: !rest.disabled,
|
|
205
|
+
onMouseDown: onPreventMouseDown,
|
|
206
|
+
onClose: function onClose(e) {
|
|
207
|
+
var filterAllInstance = activeKey.slice(0, maxTagCount);
|
|
208
|
+
var filterAllOptions = allOptions.slice(0, maxTagCount);
|
|
209
|
+
_onChange(filterAllInstance, filterAllOptions);
|
|
210
|
+
onDeselect(activeKey.slice(maxTagCount), allOptions.slice(maxTagCount));
|
|
211
|
+
}
|
|
212
|
+
}, "+", Object.keys(keyIndexMap.current).slice(maxTagCount).length));
|
|
213
|
+
}
|
|
214
|
+
if (node && node.index < maxTagCount) {
|
|
215
|
+
return renderTag(props);
|
|
216
|
+
}
|
|
217
|
+
};
|
|
218
|
+
var onCheckAllChange = function onCheckAllChange(e, currentDataSource, originDataSource) {
|
|
219
|
+
var _activeKey = [];
|
|
220
|
+
var activeDataSource = [];
|
|
221
|
+
var originActiveDataSource = originDataSource.filter(function (item) {
|
|
222
|
+
return activeKey.find(function (i) {
|
|
223
|
+
return labelInValue ? i.value === item.value : i === item.value;
|
|
224
|
+
});
|
|
225
|
+
});
|
|
226
|
+
var currentDataSourceKey = currentDataSource.map(function (item) {
|
|
227
|
+
return labelInValue ? {
|
|
228
|
+
value: item.value,
|
|
229
|
+
label: item.children
|
|
230
|
+
} : item.value;
|
|
231
|
+
});
|
|
232
|
+
if (e.target.checked) {
|
|
233
|
+
activeDataSource = Array.from(new Set([].concat(_toConsumableArray(originActiveDataSource), _toConsumableArray(currentDataSource))));
|
|
234
|
+
_activeKey = Array.from(new Set([].concat(_toConsumableArray(activeKey), _toConsumableArray(currentDataSourceKey))));
|
|
235
|
+
onSelect(currentDataSourceKey, currentDataSource);
|
|
236
|
+
} else {
|
|
237
|
+
activeDataSource = originActiveDataSource.filter(function (item) {
|
|
238
|
+
return !currentDataSource.find(function (i) {
|
|
239
|
+
return i.value === item.value;
|
|
240
|
+
});
|
|
241
|
+
});
|
|
242
|
+
_activeKey = activeKey.filter(function (item) {
|
|
243
|
+
return !currentDataSourceKey.find(function (i) {
|
|
244
|
+
return labelInValue ? item.value === i.value : item === i;
|
|
245
|
+
});
|
|
246
|
+
});
|
|
247
|
+
onDeselect(currentDataSourceKey, currentDataSource);
|
|
248
|
+
}
|
|
249
|
+
_onChange(_activeKey, activeDataSource);
|
|
250
|
+
};
|
|
251
|
+
var customDropdownRender = function customDropdownRender(originNode) {
|
|
252
|
+
var _originNode$_owner, _originNode$_owner2, _originNode$_owner3;
|
|
253
|
+
var flattenOptions = (originNode === null || originNode === void 0 || (_originNode$_owner = originNode._owner) === null || _originNode$_owner === void 0 || (_originNode$_owner = _originNode$_owner.dependencies) === null || _originNode$_owner === void 0 || (_originNode$_owner = _originNode$_owner.firstContext) === null || _originNode$_owner === void 0 || (_originNode$_owner = _originNode$_owner.memoizedValue) === null || _originNode$_owner === void 0 ? void 0 : _originNode$_owner.flattenOptions) || [];
|
|
254
|
+
var originDataSource = (originNode === null || originNode === void 0 || (_originNode$_owner2 = originNode._owner) === null || _originNode$_owner2 === void 0 || (_originNode$_owner2 = _originNode$_owner2.dependencies) === null || _originNode$_owner2 === void 0 || (_originNode$_owner2 = _originNode$_owner2.firstContext) === null || _originNode$_owner2 === void 0 || (_originNode$_owner2 = _originNode$_owner2.memoizedValue) === null || _originNode$_owner2 === void 0 ? void 0 : _originNode$_owner2.options) || [];
|
|
255
|
+
var dataSource = flattenOptions.filter(function (item) {
|
|
256
|
+
return item.hasOwnProperty("groupOption");
|
|
257
|
+
}).map(function (item) {
|
|
258
|
+
return item.data;
|
|
259
|
+
});
|
|
260
|
+
var activeValues = Array.from(originNode === null || originNode === void 0 || (_originNode$_owner3 = originNode._owner) === null || _originNode$_owner3 === void 0 || (_originNode$_owner3 = _originNode$_owner3.dependencies) === null || _originNode$_owner3 === void 0 || (_originNode$_owner3 = _originNode$_owner3.firstContext) === null || _originNode$_owner3 === void 0 || (_originNode$_owner3 = _originNode$_owner3.memoizedValue) === null || _originNode$_owner3 === void 0 ? void 0 : _originNode$_owner3.rawValues);
|
|
261
|
+
var filterActiveValues = dataSource.map(function (item) {
|
|
262
|
+
return item.value;
|
|
263
|
+
}).filter(function (item) {
|
|
264
|
+
return activeValues.includes(item);
|
|
265
|
+
});
|
|
266
|
+
var notFoundContent = rest.notFoundContent || /*#__PURE__*/React.createElement("div", {
|
|
267
|
+
className: "".concat(prefixCls, "-show-checkbox-empty")
|
|
268
|
+
}, intl.get("812f44fc-ed3c-4bd3-8ad5-35cd2996c5ae").d("未查找到任何结果"));
|
|
269
|
+
return !dataSource.length ? notFoundContent : /*#__PURE__*/React.createElement(React.Fragment, null, _showCheckAll && /*#__PURE__*/React.createElement("div", {
|
|
270
|
+
className: "".concat(prefixCls, "-check-all"),
|
|
271
|
+
onMouseDown: onPreventMouseDown
|
|
272
|
+
}, /*#__PURE__*/React.createElement(_Checkbox, {
|
|
273
|
+
indeterminate: filterActiveValues.length && filterActiveValues.length !== dataSource.length,
|
|
274
|
+
checked: filterActiveValues.length === dataSource.length,
|
|
275
|
+
onChange: function onChange(e) {
|
|
276
|
+
return onCheckAllChange(e, dataSource, originDataSource);
|
|
277
|
+
},
|
|
278
|
+
style: {
|
|
279
|
+
width: "100%"
|
|
280
|
+
}
|
|
281
|
+
}, intl.get("3991a1d0-65a8-45ca-94a4-f89fbd9f8555").d("全选"), "\uFF08", filterActiveValues.length, "/", dataSource.length, "\uFF09")), originNode);
|
|
282
|
+
};
|
|
283
|
+
var renderCheckboxItem = function renderCheckboxItem(child) {
|
|
284
|
+
var isChecked = labelInValue ? activeKey.map(function (item) {
|
|
285
|
+
return item.value;
|
|
286
|
+
}).includes(child.props.value) : activeKey.includes(child.props.value);
|
|
287
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
288
|
+
key: child.key,
|
|
289
|
+
className: "".concat(prefixCls, "-checkbox-item")
|
|
290
|
+
}, /*#__PURE__*/React.createElement(_Checkbox, {
|
|
291
|
+
disabled: child.props.disabled,
|
|
292
|
+
checked: isChecked
|
|
293
|
+
}), /*#__PURE__*/React.createElement("span", {
|
|
294
|
+
className: "".concat(prefixCls, "-item-children")
|
|
295
|
+
}, child.props.children));
|
|
296
|
+
};
|
|
297
|
+
var finalChildren = children;
|
|
298
|
+
if (_showCheckbox) {
|
|
299
|
+
finalChildren = React.Children.map(children, function (child) {
|
|
300
|
+
if (Array.isArray(child.props.children)) {
|
|
301
|
+
var groupChildren = React.Children.map(child.props.children, function (optGroupChild) {
|
|
302
|
+
return /*#__PURE__*/React.cloneElement(optGroupChild, {}, renderCheckboxItem(optGroupChild));
|
|
303
|
+
});
|
|
304
|
+
return /*#__PURE__*/React.cloneElement(child, {}, groupChildren);
|
|
305
|
+
}
|
|
306
|
+
return /*#__PURE__*/React.cloneElement(child, {}, renderCheckboxItem(child));
|
|
307
|
+
});
|
|
308
|
+
}
|
|
309
|
+
return wrapCSSVar(/*#__PURE__*/React.createElement(DndProvider, {
|
|
310
|
+
backend: HTML5Backend
|
|
311
|
+
}, /*#__PURE__*/React.createElement(Select, _extends({
|
|
34
312
|
ref: ref,
|
|
35
|
-
prefix: _prefix
|
|
36
|
-
|
|
313
|
+
prefix: _prefix,
|
|
314
|
+
defaultValue: defaultValue,
|
|
315
|
+
value: "value" in props ? value : showCheckbox || allowDrag ? activeKey : value,
|
|
316
|
+
mode: mode,
|
|
317
|
+
onChange: _onChange,
|
|
318
|
+
tagRender: tagRender || _tagRender,
|
|
319
|
+
menuItemSelectedIcon: null,
|
|
320
|
+
onSelect: onSelect,
|
|
321
|
+
onDeselect: onDeselect,
|
|
322
|
+
children: finalChildren,
|
|
323
|
+
dropdownRender: dropdownRender !== null && dropdownRender !== void 0 ? dropdownRender : _showCheckbox ? customDropdownRender : null,
|
|
324
|
+
labelInValue: labelInValue,
|
|
325
|
+
maxCount: maxCount
|
|
326
|
+
}, rest))));
|
|
37
327
|
});
|
|
38
|
-
CWSelect.propTypes = {
|
|
328
|
+
CWSelect.propTypes = {
|
|
329
|
+
allowClear: PropTypes.bool,
|
|
330
|
+
disabled: PropTypes.bool,
|
|
331
|
+
dropdownRender: PropTypes.func,
|
|
332
|
+
labelInValue: PropTypes.bool,
|
|
333
|
+
maxTagCount: PropTypes.number,
|
|
334
|
+
maxTagTextLength: PropTypes.number,
|
|
335
|
+
mode: PropTypes.oneOf(["multiple", "tags"]),
|
|
336
|
+
notFoundContent: PropTypes.node,
|
|
337
|
+
tagLabelRender: PropTypes.func,
|
|
338
|
+
menuItemSelectedIcon: PropTypes.node,
|
|
339
|
+
onChange: PropTypes.func,
|
|
340
|
+
onDeselect: PropTypes.func,
|
|
341
|
+
onPopupScroll: PropTypes.func,
|
|
342
|
+
onSearch: PropTypes.func,
|
|
343
|
+
onSelect: PropTypes.func,
|
|
344
|
+
loading: PropTypes.bool,
|
|
345
|
+
tagRender: PropTypes.func,
|
|
346
|
+
allowDrag: PropTypes.bool,
|
|
347
|
+
onDragEnd: PropTypes.func,
|
|
348
|
+
showCheckbox: PropTypes.bool,
|
|
349
|
+
listHeight: PropTypes.number,
|
|
350
|
+
selectLabel: PropTypes.oneOfType([PropTypes.string, PropTypes.node]),
|
|
351
|
+
label: PropTypes.oneOfType([PropTypes.string, PropTypes.node])
|
|
352
|
+
};
|
|
39
353
|
cloneComProps(Select, CWSelect);
|
|
40
354
|
export default CWSelect;
|
|
@@ -3,14 +3,13 @@ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object
|
|
|
3
3
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
4
4
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
5
5
|
import { genStyleHooks, mergeToken } from "../Antd5/theme/internal";
|
|
6
|
+
import { prepareComponentToken } from "../Antd5/select/style/token";
|
|
6
7
|
var genCustomSelectStyle = function genCustomSelectStyle(token) {
|
|
7
|
-
var prefixCls = token.antCls
|
|
8
|
-
inputPaddingHorizontalBase = token.inputPaddingHorizontalBase;
|
|
8
|
+
var prefixCls = token.antCls;
|
|
9
9
|
var componentCls = "".concat(prefixCls, "-select");
|
|
10
|
-
return _defineProperty(_defineProperty(_defineProperty({}, "".concat(componentCls), _defineProperty({}, "".concat(componentCls, "-selector"), _defineProperty(_defineProperty({}, "".concat(componentCls, "-prefix"), {
|
|
10
|
+
return _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, "".concat(componentCls), _defineProperty({}, "".concat(componentCls, "-selector"), _defineProperty(_defineProperty({}, "".concat(componentCls, "-prefix"), {
|
|
11
11
|
display: "flex",
|
|
12
12
|
alignItems: "center"
|
|
13
|
-
// paddingRight: inputPaddingHorizontalBase,
|
|
14
13
|
}), "".concat(componentCls, "-selection-wrap"), {
|
|
15
14
|
display: "flex",
|
|
16
15
|
position: "relative",
|
|
@@ -21,19 +20,72 @@ var genCustomSelectStyle = function genCustomSelectStyle(token) {
|
|
|
21
20
|
}))), "".concat(componentCls).concat(componentCls, "-single"), _defineProperty({}, "".concat(componentCls, "-selector"), _defineProperty({}, "".concat(componentCls, "-selection-wrap"), _defineProperty({}, "".concat(componentCls, "-selection-search"), {
|
|
22
21
|
left: "0",
|
|
23
22
|
marginLeft: "0"
|
|
24
|
-
})))), "".concat(componentCls).concat(componentCls, "-multiple"), _defineProperty({}, "".concat(componentCls, "-selector"), _defineProperty(_defineProperty({}, "".concat(componentCls, "-selection-wrap"), _defineProperty({}, "".concat(componentCls, "-selection-
|
|
25
|
-
|
|
26
|
-
|
|
23
|
+
})))), "".concat(componentCls).concat(componentCls, "-multiple"), _defineProperty({}, "".concat(componentCls, "-selector"), _defineProperty(_defineProperty({}, "".concat(componentCls, "-selection-wrap"), _defineProperty({}, "".concat(componentCls, "-selection-overflow"), _defineProperty({}, "".concat(componentCls, "-selection-overflow-item"), {
|
|
24
|
+
">span": _defineProperty({
|
|
25
|
+
maxWidth: "100%"
|
|
26
|
+
}, "".concat(componentCls, "-custom-tag"), _defineProperty({
|
|
27
|
+
margin: "2px 4px 2px 0",
|
|
28
|
+
maxWidth: "126px",
|
|
29
|
+
display: "flex"
|
|
30
|
+
}, "".concat(componentCls, "-custom-tag-content"), _defineProperty({
|
|
31
|
+
display: "flex",
|
|
32
|
+
flex: "1",
|
|
33
|
+
overflow: "auto"
|
|
34
|
+
}, "".concat(componentCls, "-checkbox-item"), _defineProperty({}, "".concat(prefixCls, "-checkbox-wrapper"), {
|
|
35
|
+
display: "none"
|
|
36
|
+
}))))
|
|
37
|
+
}))), "&:has(".concat(componentCls, "-prefix)"), _defineProperty({}, "".concat(componentCls, "-selection-wrap"), _defineProperty(_defineProperty({}, "".concat(componentCls, "-selection-placeholder"), {
|
|
27
38
|
left: 0,
|
|
28
39
|
transform: "translateY(-50%)"
|
|
29
40
|
}), "".concat(componentCls, "-selection-search"), {
|
|
30
41
|
marginLeft: "0"
|
|
31
|
-
})))))
|
|
42
|
+
}))))), "".concat(componentCls, "-tag-tooltip-wrapper"), _defineProperty({}, "".concat(prefixCls, "-tooltip-content"), _defineProperty({}, "".concat(prefixCls, "-tooltip-inner"), _defineProperty({
|
|
43
|
+
padding: "1px 4px",
|
|
44
|
+
display: "flex",
|
|
45
|
+
flexWrap: "wrap"
|
|
46
|
+
}, "".concat(componentCls, "-custom-tag"), _defineProperty({
|
|
47
|
+
margin: "2px 4px 2px 0",
|
|
48
|
+
maxWidth: "126px",
|
|
49
|
+
display: "flex"
|
|
50
|
+
}, "".concat(componentCls, "-custom-tag-content"), _defineProperty({
|
|
51
|
+
display: "flex",
|
|
52
|
+
flex: "1",
|
|
53
|
+
overflow: "auto"
|
|
54
|
+
}, "".concat(prefixCls, "-checkbox-wrapper"), {
|
|
55
|
+
display: "none"
|
|
56
|
+
})))))), "".concat(componentCls, "-dropdown"), _defineProperty(_defineProperty(_defineProperty({
|
|
57
|
+
padding: "0"
|
|
58
|
+
}, "".concat(componentCls, "-check-all"), {
|
|
59
|
+
padding: token.optionPadding
|
|
60
|
+
}), "".concat(componentCls, "-item").concat(componentCls, "-item-option"), _defineProperty(_defineProperty({}, "&".concat(componentCls, "-item-option-grouped"), {
|
|
61
|
+
padding: token.optionPadding
|
|
62
|
+
}), "".concat(componentCls, "-item-option-content"), _defineProperty({}, "".concat(componentCls, "-checkbox-item"), _defineProperty({}, "".concat(prefixCls, "-checkbox-wrapper"), {
|
|
63
|
+
marginRight: "8px"
|
|
64
|
+
})))), "".concat(componentCls, "-show-checkbox-empty"), {
|
|
65
|
+
display: "flex",
|
|
66
|
+
justifyContent: "center",
|
|
67
|
+
alignItems: "center",
|
|
68
|
+
padding: "9px 0",
|
|
69
|
+
lineHeight: "20px",
|
|
70
|
+
color: token.colorTextTertiary
|
|
71
|
+
})), "".concat(componentCls, "-checkbox-item"), _defineProperty({
|
|
72
|
+
display: "flex",
|
|
73
|
+
width: "100%"
|
|
74
|
+
}, "".concat(componentCls, "-item-children"), {
|
|
75
|
+
flex: "1",
|
|
76
|
+
overflow: "auto"
|
|
77
|
+
}));
|
|
32
78
|
};
|
|
33
79
|
// ============================== Export ==============================
|
|
34
|
-
export default genStyleHooks("CWSelect", function (token) {
|
|
80
|
+
export default genStyleHooks("CWSelect", function (token, _ref2) {
|
|
81
|
+
var rootPrefixCls = _ref2.rootPrefixCls;
|
|
35
82
|
var selectToken = mergeToken(token, {
|
|
36
|
-
|
|
83
|
+
rootPrefixCls: rootPrefixCls,
|
|
84
|
+
inputPaddingHorizontalBase: token.calc(token.paddingSM).sub(1).equal(),
|
|
85
|
+
multipleSelectItemHeight: token.multipleItemHeight,
|
|
86
|
+
selectHeight: token.controlHeight
|
|
37
87
|
});
|
|
38
88
|
return [genCustomSelectStyle(selectToken)];
|
|
89
|
+
}, prepareComponentToken, {
|
|
90
|
+
resetStyle: false
|
|
39
91
|
});
|
package/lib/CWTable/CWTable.js
CHANGED
|
@@ -24,8 +24,8 @@ function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r)
|
|
|
24
24
|
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
25
25
|
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
26
26
|
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
27
|
-
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var
|
|
28
|
-
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (e.
|
|
27
|
+
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
28
|
+
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
29
29
|
import React, { useState, useEffect, useRef, useMemo, forwardRef } from "react";
|
|
30
30
|
import Icon, { LoadingOutlined, DownOutlined, RightOutlined } from "@ant-design/icons";
|
|
31
31
|
import classnames from "classnames";
|
package/lib/CWTable/header.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
var _excluded = ["onResize", "width", "onClick"];
|
|
2
2
|
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
3
|
-
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var
|
|
4
|
-
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (e.
|
|
3
|
+
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
4
|
+
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
5
5
|
import React, { useRef } from "react";
|
|
6
6
|
import { Resizable } from "react-resizable";
|
|
7
7
|
// 自定义表头单元格
|
package/lib/CWTree/index.js
CHANGED
|
@@ -12,8 +12,8 @@ function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r)
|
|
|
12
12
|
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
13
13
|
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
14
14
|
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
15
|
-
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var
|
|
16
|
-
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (e.
|
|
15
|
+
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
16
|
+
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
17
17
|
import React, { Fragment, useState, useEffect, useMemo, useCallback } from "react";
|
|
18
18
|
import { EllipsisOutlined, DownOutlined } from "@ant-design/icons";
|
|
19
19
|
import PropTypes from "prop-types";
|
package/lib/CardSelect/index.js
CHANGED
|
@@ -12,8 +12,8 @@ function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r)
|
|
|
12
12
|
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
13
13
|
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
14
14
|
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
15
|
-
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var
|
|
16
|
-
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (e.
|
|
15
|
+
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
16
|
+
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
17
17
|
import React, { useState } from "react";
|
|
18
18
|
import PropTypes from "prop-types";
|
|
19
19
|
import useStyle from "./index.style";
|
|
@@ -3,7 +3,7 @@ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object
|
|
|
3
3
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
4
4
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
5
5
|
import { genStyleHooks } from "../Antd5/theme/internal";
|
|
6
|
-
import { unit } from
|
|
6
|
+
import { unit } from "@ant-design/cssinjs";
|
|
7
7
|
var genCustomCardSelectStyle = function genCustomCardSelectStyle(token) {
|
|
8
8
|
var prefixCls = token.antCls;
|
|
9
9
|
var cardSelectPrefix = "".concat(prefixCls, "-card-select-dropdown-menu");
|
|
@@ -73,4 +73,6 @@ export default genStyleHooks("CardSelect", function (token) {
|
|
|
73
73
|
return [
|
|
74
74
|
//
|
|
75
75
|
genCustomCardSelectStyle(token)];
|
|
76
|
+
}, null, {
|
|
77
|
+
resetStyle: false
|
|
76
78
|
});
|
package/lib/Collapse/index.js
CHANGED
|
@@ -10,8 +10,8 @@ function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r)
|
|
|
10
10
|
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
11
11
|
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
12
12
|
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
13
|
-
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var
|
|
14
|
-
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (e.
|
|
13
|
+
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
14
|
+
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
15
15
|
import React, { forwardRef } from "react";
|
|
16
16
|
import Collapse from "../Antd5/collapse";
|
|
17
17
|
import { RightOutlined } from "@ant-design/icons";
|
|
@@ -8,8 +8,8 @@ function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r)
|
|
|
8
8
|
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
9
9
|
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
10
10
|
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
11
|
-
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var
|
|
12
|
-
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (e.
|
|
11
|
+
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
12
|
+
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
13
13
|
// 导出全部 Antd5/config-provider 下的内容
|
|
14
14
|
import React, { useState, useEffect, useMemo } from "react";
|
|
15
15
|
import ConfigProvider from "../Antd5/config-provider";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _Theme from "@chaoswise/ui/lib/Theme";
|
|
2
2
|
var _excluded = ["token", "components"];
|
|
3
|
-
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var
|
|
4
|
-
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (e.
|
|
3
|
+
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
4
|
+
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
5
5
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
6
6
|
import { commonToken, commonComponentToken } from "./common";
|
|
7
7
|
import { defaultToken, defaultComponentToken, undeletableComponentToken } from "./default";
|
|
@@ -8,8 +8,8 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
8
8
|
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
9
9
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
10
10
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
11
|
-
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var
|
|
12
|
-
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (e.
|
|
11
|
+
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
12
|
+
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
13
13
|
import React, { useRef } from 'react';
|
|
14
14
|
import { Scrollbars } from 'react-custom-scrollbars';
|
|
15
15
|
import PropTypes from 'prop-types';
|