@titaui/pc 1.15.40-beta.13 → 1.15.40-beta.14
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.
|
@@ -162,7 +162,8 @@ var App = function App(_ref2) {
|
|
|
162
162
|
action: "click",
|
|
163
163
|
mode: "checkbox",
|
|
164
164
|
height: 292,
|
|
165
|
-
onChange: onColumnsHideOrShow
|
|
165
|
+
onChange: onColumnsHideOrShow,
|
|
166
|
+
autoClose: false
|
|
166
167
|
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
167
168
|
className: "".concat(preCls, "__column-ctl")
|
|
168
169
|
}, /*#__PURE__*/_react["default"].createElement("span", {
|
|
@@ -30,7 +30,16 @@
|
|
|
30
30
|
transition: background-color .3s, color .3s;
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
-
.titaui-popup-select__menu-list__item
|
|
33
|
+
.titaui-popup-select__menu-list__item--disable {
|
|
34
|
+
opacity: .8;
|
|
35
|
+
cursor: not-allowed;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.titaui-popup-select__menu-list__item--disable .titaui-popup-select__checkbox-icon--checked {
|
|
39
|
+
color: #6F7886 !important;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.titaui-popup-select__menu-list__item:hover:not(.titaui-popup-select__menu-list__item--disable) {
|
|
34
43
|
background: #F7F8FA;
|
|
35
44
|
}
|
|
36
45
|
|
|
@@ -15,7 +15,7 @@ var _popup = _interopRequireDefault(require("../popup"));
|
|
|
15
15
|
|
|
16
16
|
require("./index.css");
|
|
17
17
|
|
|
18
|
-
var _excluded = ["className", "style", "children", "menuData", "onChange", "visible", "action", "onVisableChange", "mode", "height"];
|
|
18
|
+
var _excluded = ["className", "style", "children", "menuData", "onChange", "visible", "action", "onVisableChange", "mode", "height", "autoClose"];
|
|
19
19
|
|
|
20
20
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
21
21
|
|
|
@@ -75,6 +75,8 @@ var PopupSelect = function PopupSelect(_ref) {
|
|
|
75
75
|
_ref$mode = _ref.mode,
|
|
76
76
|
mode = _ref$mode === void 0 ? 'list' : _ref$mode,
|
|
77
77
|
height = _ref.height,
|
|
78
|
+
_ref$autoClose = _ref.autoClose,
|
|
79
|
+
autoClose = _ref$autoClose === void 0 ? true : _ref$autoClose,
|
|
78
80
|
restProps = _objectWithoutProperties(_ref, _excluded);
|
|
79
81
|
|
|
80
82
|
var _useState = (0, _react.useState)(visible),
|
|
@@ -87,7 +89,9 @@ var PopupSelect = function PopupSelect(_ref) {
|
|
|
87
89
|
}, [visible]);
|
|
88
90
|
var menuList = (0, _react.useMemo)(function () {
|
|
89
91
|
var onSelectItem = function onSelectItem(value, item, idx) {
|
|
92
|
+
if (item.disable) return;
|
|
90
93
|
if (onChange) onChange(value, item, idx);
|
|
94
|
+
if (autoClose) setSelfVisable(false);
|
|
91
95
|
};
|
|
92
96
|
|
|
93
97
|
var getLi = function getLi(item, idx) {
|
|
@@ -99,7 +103,7 @@ var PopupSelect = function PopupSelect(_ref) {
|
|
|
99
103
|
return /*#__PURE__*/_react["default"].createElement("li", {
|
|
100
104
|
key: item.value,
|
|
101
105
|
onClick: onSelectItem.bind(null, item.value, item, idx),
|
|
102
|
-
className: "".concat(preCls, "__menu-list__item")
|
|
106
|
+
className: (0, _classnames["default"])("".concat(preCls, "__menu-list__item"), _defineProperty({}, "".concat(preCls, "__menu-list__item--disable"), item.disable))
|
|
103
107
|
}, getItem(item, mode));
|
|
104
108
|
}
|
|
105
109
|
|
|
@@ -119,7 +123,7 @@ var PopupSelect = function PopupSelect(_ref) {
|
|
|
119
123
|
height: height
|
|
120
124
|
}
|
|
121
125
|
}, menuData.map(getLi));
|
|
122
|
-
}, [menuData, onChange]);
|
|
126
|
+
}, [menuData, onChange, autoClose]);
|
|
123
127
|
var onPopupVisableChange = (0, _react.useCallback)(function (visible) {
|
|
124
128
|
setSelfVisable(visible);
|
|
125
129
|
if (onVisableChange) onVisableChange(visible);
|