@alifd/next
Advanced tools
Comparing version 1.27.13 to 1.27.14
@@ -163,2 +163,4 @@ import _extends from 'babel-runtime/helpers/extends'; | ||
delay = _props.delay, | ||
mouseEnterDelay = _props.mouseEnterDelay, | ||
mouseLeaveDelay = _props.mouseLeaveDelay, | ||
needAdjust = _props.needAdjust, | ||
@@ -186,3 +188,3 @@ autoAdjust = _props.autoAdjust, | ||
placementOffset = _props$placementOffse === undefined ? 0 : _props$placementOffse, | ||
others = _objectWithoutProperties(_props, ['id', 'type', 'prefix', 'className', 'title', 'alignEdge', 'trigger', 'triggerType', 'children', 'closable', 'shouldUpdatePosition', 'delay', 'needAdjust', 'autoAdjust', 'safeId', 'autoFocus', 'safeNode', 'onClick', 'onHover', 'animation', 'offset', 'style', 'container', 'popupContainer', 'cache', 'popupStyle', 'popupClassName', 'popupProps', 'followTrigger', 'rtl', 'v2', 'arrowPointToCenter', 'placementOffset']); | ||
others = _objectWithoutProperties(_props, ['id', 'type', 'prefix', 'className', 'title', 'alignEdge', 'trigger', 'triggerType', 'children', 'closable', 'shouldUpdatePosition', 'delay', 'mouseEnterDelay', 'mouseLeaveDelay', 'needAdjust', 'autoAdjust', 'safeId', 'autoFocus', 'safeNode', 'onClick', 'onHover', 'animation', 'offset', 'style', 'container', 'popupContainer', 'cache', 'popupStyle', 'popupClassName', 'popupProps', 'followTrigger', 'rtl', 'v2', 'arrowPointToCenter', 'placementOffset']); | ||
@@ -241,2 +243,4 @@ if (container) { | ||
delay: delay, | ||
mouseEnterDelay: mouseEnterDelay, | ||
mouseLeaveDelay: mouseLeaveDelay, | ||
shouldUpdatePosition: shouldUpdatePosition, | ||
@@ -390,2 +394,10 @@ needAdjust: needAdjust, | ||
/** | ||
* 鼠标放置后的延时显示, 单位毫秒 ms | ||
*/ | ||
mouseEnterDelay: PropTypes.number, | ||
/** | ||
* 鼠标离开后的延时显示, 单位毫秒 ms | ||
*/ | ||
mouseLeaveDelay: PropTypes.number, | ||
/** | ||
* 浮层关闭后触发的事件, 如果有动画,则在动画结束后触发 | ||
@@ -392,0 +404,0 @@ */ |
@@ -106,5 +106,7 @@ import _extends from 'babel-runtime/helpers/extends'; | ||
delay = _props.delay, | ||
mouseEnterDelay = _props.mouseEnterDelay, | ||
mouseLeaveDelay = _props.mouseLeaveDelay, | ||
v2 = _props.v2, | ||
arrowPointToCenter = _props.arrowPointToCenter, | ||
others = _objectWithoutProperties(_props, ['id', 'className', 'align', 'style', 'prefix', 'trigger', 'children', 'popupContainer', 'popupProps', 'popupClassName', 'popupStyle', 'followTrigger', 'triggerType', 'autoFocus', 'alignEdge', 'autoAdjust', 'rtl', 'delay', 'v2', 'arrowPointToCenter']); | ||
others = _objectWithoutProperties(_props, ['id', 'className', 'align', 'style', 'prefix', 'trigger', 'children', 'popupContainer', 'popupProps', 'popupClassName', 'popupStyle', 'followTrigger', 'triggerType', 'autoFocus', 'alignEdge', 'autoAdjust', 'rtl', 'delay', 'mouseEnterDelay', 'mouseLeaveDelay', 'v2', 'arrowPointToCenter']); | ||
@@ -161,2 +163,4 @@ var trOrigin = 'trOrigin'; | ||
delay: delay, | ||
mouseEnterDelay: mouseEnterDelay, | ||
mouseLeaveDelay: mouseLeaveDelay, | ||
shouldUpdatePosition: true, | ||
@@ -269,2 +273,10 @@ needAdjust: false, | ||
/** | ||
* 鼠标放置后的延时显示, 单位毫秒 ms | ||
*/ | ||
mouseEnterDelay: PropTypes.number, | ||
/** | ||
* 鼠标离开后的延时显示, 单位毫秒 ms | ||
*/ | ||
mouseLeaveDelay: PropTypes.number, | ||
/** | ||
* 开启 v2 版本 | ||
@@ -271,0 +283,0 @@ */ |
@@ -334,3 +334,3 @@ import { __assign, __extends, __read, __spreadArray } from "tslib"; | ||
var _this = this; | ||
var _a = this.props, multiple = _a.multiple, onChange = _a.onChange; | ||
var _a = this.props, multiple = _a.multiple, onChange = _a.onChange, autoClearSearchValue = _a.autoClearSearchValue; | ||
var _b = this.state, searchValue = _b.searchValue, stateValue = _b.value; | ||
@@ -357,3 +357,3 @@ var st = {}; | ||
} | ||
if (!multiple && searchValue) { | ||
if (searchValue && ((multiple && autoClearSearchValue) || !multiple)) { | ||
st.searchValue = ''; | ||
@@ -638,2 +638,6 @@ } | ||
immutable: PropTypes.bool, | ||
/** | ||
* 查询选中后清除查询条件 | ||
*/ | ||
autoClearSearchValue: PropTypes.bool, | ||
}; | ||
@@ -690,2 +694,3 @@ CascaderSelect.defaultProps = { | ||
locale: zhCN.Select, | ||
autoClearSearchValue: false, | ||
}; | ||
@@ -692,0 +697,0 @@ return CascaderSelect; |
@@ -67,5 +67,6 @@ import { __assign, __extends, __read, __rest, __spreadArray } from "tslib"; | ||
var _this = this; | ||
var _a = this.props, prefix = _a.prefix, useVirtual = _a.useVirtual, className = _a.className, style = _a.style, children = _a.children, others = __rest(_a, ["prefix", "useVirtual", "className", "style", "children"]); | ||
var _a; | ||
var _b = this.props, prefix = _b.prefix, useVirtual = _b.useVirtual, className = _b.className, style = _b.style, children = _b.children, others = __rest(_b, ["prefix", "useVirtual", "className", "style", "children"]); | ||
var menuProps = __assign({ labelToggleChecked: false, className: "".concat(prefix, "cascader-menu") }, others); | ||
return (React.createElement("div", { ref: this.saveMenuRef, className: "".concat(prefix, "cascader-menu-wrapper ").concat(className ? className : ''), style: style }, useVirtual ? (React.createElement(VirtualList, { ref: this.saveVirtualRef, itemsRenderer: function (items, ref) { return _this.renderMenu(items, ref, menuProps); } }, children)) : (this.renderMenu(children, undefined, menuProps)))); | ||
return (React.createElement("div", { ref: this.saveMenuRef, className: "".concat(prefix, "cascader-menu-wrapper ").concat(className ? className : ''), style: __assign(__assign({}, style), { backgroundColor: (_a = style === null || style === void 0 ? void 0 : style.backgroundColor) !== null && _a !== void 0 ? _a : (useVirtual ? '#fff' : undefined) }) }, useVirtual ? (React.createElement(VirtualList, { ref: this.saveVirtualRef, itemsRenderer: function (items, ref) { return _this.renderMenu(items, ref, menuProps); } }, children)) : (this.renderMenu(children, undefined, menuProps)))); | ||
}; | ||
@@ -72,0 +73,0 @@ CascaderMenu.propTypes = { |
@@ -349,3 +349,3 @@ import _objectWithoutProperties from 'babel-runtime/helpers/objectWithoutProperties'; | ||
// 底部节点 | ||
var oKable = !!(isRange ? inputValue && inputValue[inputType] : inputValue); | ||
var oKable = !!(!this.checkValueDisabled(inputValue) && (isRange ? inputValue && inputValue[inputType] : inputValue)); | ||
var shouldShowFooter = showOk || preset || extraFooterRender; | ||
@@ -647,3 +647,11 @@ | ||
return values.some(function (value) { | ||
var valuesFiltered = values.filter(function (value) { | ||
return !!value; | ||
}); | ||
if (!valuesFiltered.length) { | ||
return false; | ||
} | ||
return valuesFiltered.some(function (value) { | ||
return disabledDate(value, panelMode); | ||
@@ -668,2 +676,10 @@ }); | ||
} | ||
case KEYCODE.SPACE: | ||
{ | ||
var _inputValue = _this4.state.inputValue; | ||
_this4.onClick(); | ||
_this4.handleChange(_inputValue, 'KEYDOWN_SPACE'); | ||
break; | ||
} | ||
default: | ||
@@ -701,4 +717,3 @@ return; | ||
// 3. 不需要切换输入框 | ||
var shouldHidePanel = !isRange || ['CLICK_PRESET', 'VISIBLE_CHANGE', 'INPUT_CLEAR'].includes(eventType) || !_this4.shouldSwitchInput(v); | ||
var shouldHidePanel = (!isRange || ['CLICK_PRESET', 'VISIBLE_CHANGE', 'INPUT_CLEAR'].includes(eventType) || !_this4.shouldSwitchInput(v)) && eventType !== 'KEYDOWN_SPACE'; | ||
if (shouldHidePanel) { | ||
@@ -710,2 +725,6 @@ _this4.onVisibleChange(false); | ||
} | ||
} else { | ||
if (eventType === 'KEYDOWN_SPACE' && isValueChanged(v, preValue)) { | ||
_this4.onChange(); | ||
} | ||
} | ||
@@ -712,0 +731,0 @@ }); |
@@ -103,3 +103,3 @@ import _objectWithoutProperties from 'babel-runtime/helpers/objectWithoutProperties'; | ||
_this3.handleVisibleChange(true, 'fromTrigger', e); | ||
}, this.props.delay); | ||
}, this.props.mouseEnterDelay === null || this.props.mouseEnterDelay === undefined ? this.props.delay : this.props.mouseEnterDelay); | ||
} | ||
@@ -118,3 +118,3 @@ }; | ||
_this4.handleVisibleChange(false, type || 'fromTrigger', e); | ||
}, this.props.delay); | ||
}, this.props.mouseLeaveDelay === null || this.props.mouseLeaveDelay === undefined ? this.props.delay : this.props.mouseLeaveDelay); | ||
} | ||
@@ -351,2 +351,10 @@ }; | ||
/** | ||
* 鼠标放置后的延时显示, 单位毫秒 ms | ||
*/ | ||
mouseEnterDelay: PropTypes.number, | ||
/** | ||
* 鼠标离开后的延时显示, 单位毫秒 ms | ||
*/ | ||
mouseLeaveDelay: PropTypes.number, | ||
/** | ||
* trigger 是否可以关闭弹层 | ||
@@ -353,0 +361,0 @@ */ |
@@ -252,3 +252,3 @@ import { __assign, __extends, __read, __spreadArray } from "tslib"; | ||
var itemObj = getValueDataSource(keys, this.valueDataSource.mapValueDS, this.dataStore.getMapDS()); | ||
var _a = this.props, cacheValue = _a.cacheValue, mode = _a.mode, hiddenSelected = _a.hiddenSelected; | ||
var _a = this.props, cacheValue = _a.cacheValue, mode = _a.mode, hiddenSelected = _a.hiddenSelected, autoClearSearchValue = _a.autoClearSearchValue; | ||
// cache those value maybe not exists in dataSource | ||
@@ -276,3 +276,6 @@ if (cacheValue || mode === 'tag') { | ||
// 清空搜索 | ||
if (!('searchValue' in this.props) && this.state.searchValue && !keepSearchValue) { | ||
if (!('searchValue' in this.props) && | ||
this.state.searchValue && | ||
!keepSearchValue && | ||
!(mode && ['multiple', 'tag'].includes(mode) && !autoClearSearchValue)) { | ||
// 因为 SearchValue 被 clear 后会重新渲染 Menu,所以在 Overlay 检测 safeNode 的时候 e.target 可能会找不到导致弹窗关闭 | ||
@@ -752,3 +755,3 @@ setTimeout(function () { | ||
PropTypes.string, | ||
])), hasBorder: PropTypes.bool, hasArrow: PropTypes.bool, showSearch: PropTypes.bool, onSearch: PropTypes.func, onSearchClear: PropTypes.func, hasSelectAll: PropTypes.oneOfType([PropTypes.bool, PropTypes.string]), fillProps: PropTypes.string, useDetailValue: PropTypes.bool, cacheValue: PropTypes.bool, valueRender: PropTypes.func, itemRender: PropTypes.func, notFoundContent: PropTypes.node, style: PropTypes.object, searchValue: PropTypes.string, tagInline: PropTypes.bool, tagClosable: PropTypes.bool, adjustTagSize: PropTypes.bool, maxTagCount: PropTypes.number, maxTagPlaceholder: PropTypes.func, hiddenSelected: PropTypes.bool, onRemove: PropTypes.func, onFocus: PropTypes.func, onBlur: PropTypes.func, onMouseEnter: PropTypes.func, onMouseLeave: PropTypes.func, onKeyDown: PropTypes.func, locale: PropTypes.object, popupAutoFocus: PropTypes.bool, showDataSourceChildren: PropTypes.bool }); | ||
])), hasBorder: PropTypes.bool, hasArrow: PropTypes.bool, showSearch: PropTypes.bool, onSearch: PropTypes.func, onSearchClear: PropTypes.func, hasSelectAll: PropTypes.oneOfType([PropTypes.bool, PropTypes.string]), fillProps: PropTypes.string, useDetailValue: PropTypes.bool, cacheValue: PropTypes.bool, valueRender: PropTypes.func, itemRender: PropTypes.func, notFoundContent: PropTypes.node, style: PropTypes.object, searchValue: PropTypes.string, tagInline: PropTypes.bool, tagClosable: PropTypes.bool, adjustTagSize: PropTypes.bool, maxTagCount: PropTypes.number, maxTagPlaceholder: PropTypes.func, hiddenSelected: PropTypes.bool, onRemove: PropTypes.func, onFocus: PropTypes.func, onBlur: PropTypes.func, onMouseEnter: PropTypes.func, onMouseLeave: PropTypes.func, onKeyDown: PropTypes.func, locale: PropTypes.object, popupAutoFocus: PropTypes.bool, showDataSourceChildren: PropTypes.bool, autoClearSearchValue: PropTypes.bool }); | ||
Select.defaultProps = __assign(__assign({}, Base.defaultProps), { locale: zhCN.Select, mode: 'single', showSearch: false, cacheValue: true, tagInline: false, adjustTagSize: false, onSearch: noop, onSearchClear: noop, hasArrow: true, onRemove: noop, | ||
@@ -758,3 +761,3 @@ // highlightFirstItem: true, | ||
return item && (item.label || item.value); | ||
}, onKeyDown: noop, onFocus: noop, onBlur: noop, onMouseEnter: noop, onMouseLeave: noop, popupAutoFocus: false, tagClosable: true }); | ||
}, onKeyDown: noop, onFocus: noop, onBlur: noop, onMouseEnter: noop, onMouseLeave: noop, popupAutoFocus: false, tagClosable: true, autoClearSearchValue: true }); | ||
Select.displayName = 'Select'; | ||
@@ -761,0 +764,0 @@ return Select; |
@@ -59,2 +59,4 @@ import _classCallCheck from 'babel-runtime/helpers/classCallCheck'; | ||
style.visibility = 'visible'; | ||
style.zIndex = specProps.currentSlide === specProps.activeIndex ? 1 : 0; | ||
style.transition = 'opacity ' + specProps.speed + 'ms ' + specProps.cssEase; | ||
@@ -61,0 +63,0 @@ style.WebkitTransition = 'opacity ' + specProps.speed + 'ms ' + specProps.cssEase; |
@@ -364,3 +364,3 @@ import { __assign, __extends, __read, __rest, __spreadArray } from "tslib"; | ||
var focusedKey = this.state.focusedKey; | ||
var node = this.state._k2n[key]; | ||
var node = item; | ||
var pos = this.state._k2n[key].pos; | ||
@@ -449,7 +449,5 @@ var level = pos.split('-').length - 1; | ||
} | ||
// @ts-expect-error must be NodeInstance type, but it's maybe DataNode type. | ||
onExpand(expandedKeys, { expanded: expand, node: node }); | ||
}; | ||
if (expand && loadData) { | ||
// @ts-expect-error must be NodeInstance type, but it's maybe DataNode type. | ||
return loadData(node).then(setExpandedState); | ||
@@ -476,3 +474,2 @@ } | ||
selectedNodes: this.getNodes(selectedKeys), | ||
// @ts-expect-error must be NodeInstance type, but it's maybe be DataNode type. | ||
node: node, | ||
@@ -596,3 +593,2 @@ selected: select, | ||
.filter(function (v) { return !!v; }), | ||
// @ts-expect-error must be NodeInstance type, but it's maybe be DataNode type. | ||
node: node, | ||
@@ -599,0 +595,0 @@ indeterminateKeys: indeterminateKeys, |
var next = require('./lib/index.js'); | ||
next.version = '1.27.13'; | ||
next.version = '1.27.14'; | ||
module.exports = next; |
@@ -198,2 +198,4 @@ 'use strict'; | ||
delay = _props.delay, | ||
mouseEnterDelay = _props.mouseEnterDelay, | ||
mouseLeaveDelay = _props.mouseLeaveDelay, | ||
needAdjust = _props.needAdjust, | ||
@@ -221,3 +223,3 @@ autoAdjust = _props.autoAdjust, | ||
placementOffset = _props$placementOffse === undefined ? 0 : _props$placementOffse, | ||
others = (0, _objectWithoutProperties3.default)(_props, ['id', 'type', 'prefix', 'className', 'title', 'alignEdge', 'trigger', 'triggerType', 'children', 'closable', 'shouldUpdatePosition', 'delay', 'needAdjust', 'autoAdjust', 'safeId', 'autoFocus', 'safeNode', 'onClick', 'onHover', 'animation', 'offset', 'style', 'container', 'popupContainer', 'cache', 'popupStyle', 'popupClassName', 'popupProps', 'followTrigger', 'rtl', 'v2', 'arrowPointToCenter', 'placementOffset']); | ||
others = (0, _objectWithoutProperties3.default)(_props, ['id', 'type', 'prefix', 'className', 'title', 'alignEdge', 'trigger', 'triggerType', 'children', 'closable', 'shouldUpdatePosition', 'delay', 'mouseEnterDelay', 'mouseLeaveDelay', 'needAdjust', 'autoAdjust', 'safeId', 'autoFocus', 'safeNode', 'onClick', 'onHover', 'animation', 'offset', 'style', 'container', 'popupContainer', 'cache', 'popupStyle', 'popupClassName', 'popupProps', 'followTrigger', 'rtl', 'v2', 'arrowPointToCenter', 'placementOffset']); | ||
@@ -277,2 +279,4 @@ | ||
delay: delay, | ||
mouseEnterDelay: mouseEnterDelay, | ||
mouseLeaveDelay: mouseLeaveDelay, | ||
shouldUpdatePosition: shouldUpdatePosition, | ||
@@ -426,2 +430,10 @@ needAdjust: needAdjust, | ||
/** | ||
* 鼠标放置后的延时显示, 单位毫秒 ms | ||
*/ | ||
mouseEnterDelay: _propTypes2.default.number, | ||
/** | ||
* 鼠标离开后的延时显示, 单位毫秒 ms | ||
*/ | ||
mouseLeaveDelay: _propTypes2.default.number, | ||
/** | ||
* 浮层关闭后触发的事件, 如果有动画,则在动画结束后触发 | ||
@@ -428,0 +440,0 @@ */ |
@@ -65,2 +65,12 @@ /// <reference types="react" /> | ||
/** | ||
* 鼠标放置后的延时显示, 单位毫秒 ms | ||
*/ | ||
mouseEnterDelay?: number; | ||
/** | ||
* 鼠标离开后的延时显示, 单位毫秒 ms | ||
*/ | ||
mouseLeaveDelay?: number; | ||
/** | ||
* 是否pure render | ||
@@ -180,2 +190,12 @@ */ | ||
/** | ||
* 鼠标放置后的延时显示, 单位毫秒 ms | ||
*/ | ||
mouseEnterDelay?: number; | ||
/** | ||
* 鼠标离开后的延时显示, 单位毫秒 ms | ||
*/ | ||
mouseLeaveDelay?: number; | ||
/** | ||
* 浮层关闭后触发的事件, 如果有动画,则在动画结束后触发 | ||
@@ -182,0 +202,0 @@ */ |
@@ -140,5 +140,7 @@ 'use strict'; | ||
delay = _props.delay, | ||
mouseEnterDelay = _props.mouseEnterDelay, | ||
mouseLeaveDelay = _props.mouseLeaveDelay, | ||
v2 = _props.v2, | ||
arrowPointToCenter = _props.arrowPointToCenter, | ||
others = (0, _objectWithoutProperties3.default)(_props, ['id', 'className', 'align', 'style', 'prefix', 'trigger', 'children', 'popupContainer', 'popupProps', 'popupClassName', 'popupStyle', 'followTrigger', 'triggerType', 'autoFocus', 'alignEdge', 'autoAdjust', 'rtl', 'delay', 'v2', 'arrowPointToCenter']); | ||
others = (0, _objectWithoutProperties3.default)(_props, ['id', 'className', 'align', 'style', 'prefix', 'trigger', 'children', 'popupContainer', 'popupProps', 'popupClassName', 'popupStyle', 'followTrigger', 'triggerType', 'autoFocus', 'alignEdge', 'autoAdjust', 'rtl', 'delay', 'mouseEnterDelay', 'mouseLeaveDelay', 'v2', 'arrowPointToCenter']); | ||
@@ -196,2 +198,4 @@ | ||
delay: delay, | ||
mouseEnterDelay: mouseEnterDelay, | ||
mouseLeaveDelay: mouseLeaveDelay, | ||
shouldUpdatePosition: true, | ||
@@ -304,2 +308,10 @@ needAdjust: false, | ||
/** | ||
* 鼠标放置后的延时显示, 单位毫秒 ms | ||
*/ | ||
mouseEnterDelay: _propTypes2.default.number, | ||
/** | ||
* 鼠标离开后的延时显示, 单位毫秒 ms | ||
*/ | ||
mouseLeaveDelay: _propTypes2.default.number, | ||
/** | ||
* 开启 v2 版本 | ||
@@ -306,0 +318,0 @@ */ |
@@ -64,2 +64,6 @@ import React, { Component, type KeyboardEvent, type DetailedHTMLProps, type HTMLAttributes } from 'react'; | ||
immutable: PropTypes.Requireable<boolean>; | ||
/** | ||
* 查询选中后清除查询条件 | ||
*/ | ||
autoClearSearchValue: PropTypes.Requireable<boolean>; | ||
}; | ||
@@ -108,2 +112,3 @@ static defaultProps: { | ||
}; | ||
autoClearSearchValue: boolean; | ||
}; | ||
@@ -110,0 +115,0 @@ readonly props: CascaderSelectPropsWithDefault; |
@@ -336,3 +336,3 @@ "use strict"; | ||
var _this = this; | ||
var _a = this.props, multiple = _a.multiple, onChange = _a.onChange; | ||
var _a = this.props, multiple = _a.multiple, onChange = _a.onChange, autoClearSearchValue = _a.autoClearSearchValue; | ||
var _b = this.state, searchValue = _b.searchValue, stateValue = _b.value; | ||
@@ -359,3 +359,3 @@ var st = {}; | ||
} | ||
if (!multiple && searchValue) { | ||
if (searchValue && ((multiple && autoClearSearchValue) || !multiple)) { | ||
st.searchValue = ''; | ||
@@ -640,2 +640,6 @@ } | ||
immutable: prop_types_1.default.bool, | ||
/** | ||
* 查询选中后清除查询条件 | ||
*/ | ||
autoClearSearchValue: prop_types_1.default.bool, | ||
}; | ||
@@ -692,2 +696,3 @@ CascaderSelect.defaultProps = { | ||
locale: zh_cn_1.default.Select, | ||
autoClearSearchValue: false, | ||
}; | ||
@@ -694,0 +699,0 @@ return CascaderSelect; |
@@ -185,2 +185,8 @@ import type React from 'react'; | ||
menuProps?: Omit<CascaderProps, 'onSelect' | 'onChange'>; | ||
/** | ||
* 是否在选中项后清空搜索框,只在 multiple 为 true 时有效 | ||
* @en Whether the current search will be cleared on selecting an item. Only applies when multiple is true | ||
* @defaultValue false | ||
*/ | ||
autoClearSearchValue?: boolean; | ||
} | ||
@@ -187,0 +193,0 @@ export interface CascaderSelectState { |
@@ -69,5 +69,6 @@ "use strict"; | ||
var _this = this; | ||
var _a = this.props, prefix = _a.prefix, useVirtual = _a.useVirtual, className = _a.className, style = _a.style, children = _a.children, others = tslib_1.__rest(_a, ["prefix", "useVirtual", "className", "style", "children"]); | ||
var _a; | ||
var _b = this.props, prefix = _b.prefix, useVirtual = _b.useVirtual, className = _b.className, style = _b.style, children = _b.children, others = tslib_1.__rest(_b, ["prefix", "useVirtual", "className", "style", "children"]); | ||
var menuProps = tslib_1.__assign({ labelToggleChecked: false, className: "".concat(prefix, "cascader-menu") }, others); | ||
return (react_1.default.createElement("div", { ref: this.saveMenuRef, className: "".concat(prefix, "cascader-menu-wrapper ").concat(className ? className : ''), style: style }, useVirtual ? (react_1.default.createElement(virtual_list_1.default, { ref: this.saveVirtualRef, itemsRenderer: function (items, ref) { return _this.renderMenu(items, ref, menuProps); } }, children)) : (this.renderMenu(children, undefined, menuProps)))); | ||
return (react_1.default.createElement("div", { ref: this.saveMenuRef, className: "".concat(prefix, "cascader-menu-wrapper ").concat(className ? className : ''), style: tslib_1.__assign(tslib_1.__assign({}, style), { backgroundColor: (_a = style === null || style === void 0 ? void 0 : style.backgroundColor) !== null && _a !== void 0 ? _a : (useVirtual ? '#fff' : undefined) }) }, useVirtual ? (react_1.default.createElement(virtual_list_1.default, { ref: this.saveVirtualRef, itemsRenderer: function (items, ref) { return _this.renderMenu(items, ref, menuProps); } }, children)) : (this.renderMenu(children, undefined, menuProps)))); | ||
}; | ||
@@ -74,0 +75,0 @@ CascaderMenu.propTypes = { |
@@ -398,3 +398,3 @@ 'use strict'; | ||
// 底部节点 | ||
var oKable = !!(isRange ? inputValue && inputValue[inputType] : inputValue); | ||
var oKable = !!(!this.checkValueDisabled(inputValue) && (isRange ? inputValue && inputValue[inputType] : inputValue)); | ||
var shouldShowFooter = showOk || preset || extraFooterRender; | ||
@@ -696,3 +696,11 @@ | ||
return values.some(function (value) { | ||
var valuesFiltered = values.filter(function (value) { | ||
return !!value; | ||
}); | ||
if (!valuesFiltered.length) { | ||
return false; | ||
} | ||
return valuesFiltered.some(function (value) { | ||
return disabledDate(value, panelMode); | ||
@@ -717,2 +725,10 @@ }); | ||
} | ||
case _util.KEYCODE.SPACE: | ||
{ | ||
var _inputValue = _this4.state.inputValue; | ||
_this4.onClick(); | ||
_this4.handleChange(_inputValue, 'KEYDOWN_SPACE'); | ||
break; | ||
} | ||
default: | ||
@@ -750,4 +766,3 @@ return; | ||
// 3. 不需要切换输入框 | ||
var shouldHidePanel = !isRange || ['CLICK_PRESET', 'VISIBLE_CHANGE', 'INPUT_CLEAR'].includes(eventType) || !_this4.shouldSwitchInput(v); | ||
var shouldHidePanel = (!isRange || ['CLICK_PRESET', 'VISIBLE_CHANGE', 'INPUT_CLEAR'].includes(eventType) || !_this4.shouldSwitchInput(v)) && eventType !== 'KEYDOWN_SPACE'; | ||
if (shouldHidePanel) { | ||
@@ -759,2 +774,6 @@ _this4.onVisibleChange(false); | ||
} | ||
} else { | ||
if (eventType === 'KEYDOWN_SPACE' && (0, _util2.isValueChanged)(v, preValue)) { | ||
_this4.onChange(); | ||
} | ||
} | ||
@@ -761,0 +780,0 @@ }); |
@@ -506,3 +506,3 @@ import React from 'react'; | ||
*/ | ||
selectedKeys?: string | string[]; | ||
selectedKeys?: string | string[] | null; | ||
/** | ||
@@ -512,3 +512,3 @@ * 初始选中菜单项的 key 值(非受控) | ||
*/ | ||
defaultSelectedKeys?: string | string[]; | ||
defaultSelectedKeys?: string | string[] | null; | ||
/** | ||
@@ -515,0 +515,0 @@ * 选中或取消选中菜单项触发的回调函数 |
@@ -229,3 +229,3 @@ /// <reference types="react" /> | ||
*/ | ||
selectedKeys?: string | Array<string>; | ||
selectedKeys?: string | Array<string> | null; | ||
/** | ||
@@ -236,3 +236,3 @@ * 初始选中导航项的 key 值 | ||
*/ | ||
defaultSelectedKeys?: string | Array<string>; | ||
defaultSelectedKeys?: string | Array<string> | null; | ||
/** | ||
@@ -239,0 +239,0 @@ * 选中或取消选中导航项触发的回调函数 |
@@ -184,2 +184,12 @@ /// <reference types="react" /> | ||
/** | ||
* 鼠标放置后的延时显示, 单位毫秒 ms | ||
*/ | ||
mouseEnterDelay?: number; | ||
/** | ||
* 鼠标离开后的延时显示, 单位毫秒 ms | ||
*/ | ||
mouseLeaveDelay?: number; | ||
/** | ||
* trigger 是否可以关闭弹层 | ||
@@ -186,0 +196,0 @@ */ |
@@ -134,3 +134,3 @@ 'use strict'; | ||
_this3.handleVisibleChange(true, 'fromTrigger', e); | ||
}, this.props.delay); | ||
}, this.props.mouseEnterDelay === null || this.props.mouseEnterDelay === undefined ? this.props.delay : this.props.mouseEnterDelay); | ||
} | ||
@@ -149,3 +149,3 @@ }; | ||
_this4.handleVisibleChange(false, type || 'fromTrigger', e); | ||
}, this.props.delay); | ||
}, this.props.mouseLeaveDelay === null || this.props.mouseLeaveDelay === undefined ? this.props.delay : this.props.mouseLeaveDelay); | ||
} | ||
@@ -381,2 +381,10 @@ }; | ||
/** | ||
* 鼠标放置后的延时显示, 单位毫秒 ms | ||
*/ | ||
mouseEnterDelay: _propTypes2.default.number, | ||
/** | ||
* 鼠标离开后的延时显示, 单位毫秒 ms | ||
*/ | ||
mouseLeaveDelay: _propTypes2.default.number, | ||
/** | ||
* trigger 是否可以关闭弹层 | ||
@@ -383,0 +391,0 @@ */ |
@@ -59,2 +59,3 @@ import React, { type ChangeEvent, type ReactElement, type KeyboardEvent, type UIEvent, type MouseEvent, type ReactNode } from 'react'; | ||
showDataSourceChildren: PropTypes.Requireable<boolean>; | ||
autoClearSearchValue: PropTypes.Requireable<boolean>; | ||
prefix: PropTypes.Requireable<string>; | ||
@@ -61,0 +62,0 @@ size: PropTypes.Requireable<string>; |
@@ -254,3 +254,3 @@ "use strict"; | ||
var itemObj = (0, util_2.getValueDataSource)(keys, this.valueDataSource.mapValueDS, this.dataStore.getMapDS()); | ||
var _a = this.props, cacheValue = _a.cacheValue, mode = _a.mode, hiddenSelected = _a.hiddenSelected; | ||
var _a = this.props, cacheValue = _a.cacheValue, mode = _a.mode, hiddenSelected = _a.hiddenSelected, autoClearSearchValue = _a.autoClearSearchValue; | ||
// cache those value maybe not exists in dataSource | ||
@@ -278,3 +278,6 @@ if (cacheValue || mode === 'tag') { | ||
// 清空搜索 | ||
if (!('searchValue' in this.props) && this.state.searchValue && !keepSearchValue) { | ||
if (!('searchValue' in this.props) && | ||
this.state.searchValue && | ||
!keepSearchValue && | ||
!(mode && ['multiple', 'tag'].includes(mode) && !autoClearSearchValue)) { | ||
// 因为 SearchValue 被 clear 后会重新渲染 Menu,所以在 Overlay 检测 safeNode 的时候 e.target 可能会找不到导致弹窗关闭 | ||
@@ -754,3 +757,3 @@ setTimeout(function () { | ||
prop_types_1.default.string, | ||
])), hasBorder: prop_types_1.default.bool, hasArrow: prop_types_1.default.bool, showSearch: prop_types_1.default.bool, onSearch: prop_types_1.default.func, onSearchClear: prop_types_1.default.func, hasSelectAll: prop_types_1.default.oneOfType([prop_types_1.default.bool, prop_types_1.default.string]), fillProps: prop_types_1.default.string, useDetailValue: prop_types_1.default.bool, cacheValue: prop_types_1.default.bool, valueRender: prop_types_1.default.func, itemRender: prop_types_1.default.func, notFoundContent: prop_types_1.default.node, style: prop_types_1.default.object, searchValue: prop_types_1.default.string, tagInline: prop_types_1.default.bool, tagClosable: prop_types_1.default.bool, adjustTagSize: prop_types_1.default.bool, maxTagCount: prop_types_1.default.number, maxTagPlaceholder: prop_types_1.default.func, hiddenSelected: prop_types_1.default.bool, onRemove: prop_types_1.default.func, onFocus: prop_types_1.default.func, onBlur: prop_types_1.default.func, onMouseEnter: prop_types_1.default.func, onMouseLeave: prop_types_1.default.func, onKeyDown: prop_types_1.default.func, locale: prop_types_1.default.object, popupAutoFocus: prop_types_1.default.bool, showDataSourceChildren: prop_types_1.default.bool }); | ||
])), hasBorder: prop_types_1.default.bool, hasArrow: prop_types_1.default.bool, showSearch: prop_types_1.default.bool, onSearch: prop_types_1.default.func, onSearchClear: prop_types_1.default.func, hasSelectAll: prop_types_1.default.oneOfType([prop_types_1.default.bool, prop_types_1.default.string]), fillProps: prop_types_1.default.string, useDetailValue: prop_types_1.default.bool, cacheValue: prop_types_1.default.bool, valueRender: prop_types_1.default.func, itemRender: prop_types_1.default.func, notFoundContent: prop_types_1.default.node, style: prop_types_1.default.object, searchValue: prop_types_1.default.string, tagInline: prop_types_1.default.bool, tagClosable: prop_types_1.default.bool, adjustTagSize: prop_types_1.default.bool, maxTagCount: prop_types_1.default.number, maxTagPlaceholder: prop_types_1.default.func, hiddenSelected: prop_types_1.default.bool, onRemove: prop_types_1.default.func, onFocus: prop_types_1.default.func, onBlur: prop_types_1.default.func, onMouseEnter: prop_types_1.default.func, onMouseLeave: prop_types_1.default.func, onKeyDown: prop_types_1.default.func, locale: prop_types_1.default.object, popupAutoFocus: prop_types_1.default.bool, showDataSourceChildren: prop_types_1.default.bool, autoClearSearchValue: prop_types_1.default.bool }); | ||
Select.defaultProps = tslib_1.__assign(tslib_1.__assign({}, base_1.default.defaultProps), { locale: zh_cn_1.default.Select, mode: 'single', showSearch: false, cacheValue: true, tagInline: false, adjustTagSize: false, onSearch: noop, onSearchClear: noop, hasArrow: true, onRemove: noop, | ||
@@ -760,3 +763,3 @@ // highlightFirstItem: true, | ||
return item && (item.label || item.value); | ||
}, onKeyDown: noop, onFocus: noop, onBlur: noop, onMouseEnter: noop, onMouseLeave: noop, popupAutoFocus: false, tagClosable: true }); | ||
}, onKeyDown: noop, onFocus: noop, onBlur: noop, onMouseEnter: noop, onMouseLeave: noop, popupAutoFocus: false, tagClosable: true, autoClearSearchValue: true }); | ||
Select.displayName = 'Select'; | ||
@@ -763,0 +766,0 @@ return Select; |
@@ -489,2 +489,8 @@ import type React from 'react'; | ||
/** | ||
* 是否在选中项后清空搜索框,只在 mode 为 multiple 或 tags 时有效 | ||
* @en Whether to clear the search box after selecting the selected item, only in mode multiple or tags is valid | ||
* @defaultValue true | ||
*/ | ||
autoClearSearchValue?: boolean; | ||
/** | ||
* 当搜索框值变化时回调 | ||
@@ -491,0 +497,0 @@ * @en Callback when the search box value changes |
@@ -86,2 +86,4 @@ 'use strict'; | ||
style.visibility = 'visible'; | ||
style.zIndex = specProps.currentSlide === specProps.activeIndex ? 1 : 0; | ||
style.transition = 'opacity ' + specProps.speed + 'ms ' + specProps.cssEase; | ||
@@ -88,0 +90,0 @@ style.WebkitTransition = 'opacity ' + specProps.speed + 'ms ' + specProps.cssEase; |
@@ -262,2 +262,3 @@ import type React from 'react'; | ||
* @en Data source of the tree component | ||
* @remarks item 中多余的属性会传递给 tree node 内的 <li></li> 节点 - extra attributes in item are passed to the <li></li> node in the tree node. | ||
*/ | ||
@@ -264,0 +265,0 @@ dataSource?: TreeDataType[]; |
@@ -137,5 +137,5 @@ import React, { Component } from 'react'; | ||
handleBlur(e: React.FocusEvent<HTMLUListElement>): void; | ||
handleExpand(expand: boolean, key: string, node: NodeInstance | DataNode): Promise<void> | undefined; | ||
handleSelect(select: boolean, key: string, node: NodeInstance | DataNode, e: React.KeyboardEvent | React.MouseEvent): void; | ||
handleCheck(check: boolean, key: string, node: NodeInstance | DataNode): void; | ||
handleExpand(expand: boolean, key: string, node: NodeInstance): Promise<void> | undefined; | ||
handleSelect(select: boolean, key: string, node: NodeInstance, e: React.KeyboardEvent | React.MouseEvent): void; | ||
handleCheck(check: boolean, key: string, node: NodeInstance): void; | ||
getNodeProps(key: Key): { | ||
@@ -142,0 +142,0 @@ prefix: string | undefined; |
@@ -367,3 +367,3 @@ "use strict"; | ||
var focusedKey = this.state.focusedKey; | ||
var node = this.state._k2n[key]; | ||
var node = item; | ||
var pos = this.state._k2n[key].pos; | ||
@@ -452,7 +452,5 @@ var level = pos.split('-').length - 1; | ||
} | ||
// @ts-expect-error must be NodeInstance type, but it's maybe DataNode type. | ||
onExpand(expandedKeys, { expanded: expand, node: node }); | ||
}; | ||
if (expand && loadData) { | ||
// @ts-expect-error must be NodeInstance type, but it's maybe DataNode type. | ||
return loadData(node).then(setExpandedState); | ||
@@ -479,3 +477,2 @@ } | ||
selectedNodes: this.getNodes(selectedKeys), | ||
// @ts-expect-error must be NodeInstance type, but it's maybe be DataNode type. | ||
node: node, | ||
@@ -599,3 +596,2 @@ selected: select, | ||
.filter(function (v) { return !!v; }), | ||
// @ts-expect-error must be NodeInstance type, but it's maybe be DataNode type. | ||
node: node, | ||
@@ -602,0 +598,0 @@ indeterminateKeys: indeterminateKeys, |
{ | ||
"name": "@alifd/next", | ||
"version": "1.27.13", | ||
"version": "1.27.14", | ||
"description": "A configurable component library for web built on React.", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -65,2 +65,12 @@ /// <reference types="react" /> | ||
/** | ||
* 鼠标放置后的延时显示, 单位毫秒 ms | ||
*/ | ||
mouseEnterDelay?: number; | ||
/** | ||
* 鼠标离开后的延时显示, 单位毫秒 ms | ||
*/ | ||
mouseLeaveDelay?: number; | ||
/** | ||
* 是否pure render | ||
@@ -180,2 +190,12 @@ */ | ||
/** | ||
* 鼠标放置后的延时显示, 单位毫秒 ms | ||
*/ | ||
mouseEnterDelay?: number; | ||
/** | ||
* 鼠标离开后的延时显示, 单位毫秒 ms | ||
*/ | ||
mouseLeaveDelay?: number; | ||
/** | ||
* 浮层关闭后触发的事件, 如果有动画,则在动画结束后触发 | ||
@@ -182,0 +202,0 @@ */ |
@@ -64,2 +64,6 @@ import React, { Component, type KeyboardEvent, type DetailedHTMLProps, type HTMLAttributes } from 'react'; | ||
immutable: PropTypes.Requireable<boolean>; | ||
/** | ||
* 查询选中后清除查询条件 | ||
*/ | ||
autoClearSearchValue: PropTypes.Requireable<boolean>; | ||
}; | ||
@@ -108,2 +112,3 @@ static defaultProps: { | ||
}; | ||
autoClearSearchValue: boolean; | ||
}; | ||
@@ -110,0 +115,0 @@ readonly props: CascaderSelectPropsWithDefault; |
@@ -185,2 +185,8 @@ import type React from 'react'; | ||
menuProps?: Omit<CascaderProps, 'onSelect' | 'onChange'>; | ||
/** | ||
* 是否在选中项后清空搜索框,只在 multiple 为 true 时有效 | ||
* @en Whether the current search will be cleared on selecting an item. Only applies when multiple is true | ||
* @defaultValue false | ||
*/ | ||
autoClearSearchValue?: boolean; | ||
} | ||
@@ -187,0 +193,0 @@ export interface CascaderSelectState { |
@@ -506,3 +506,3 @@ import React from 'react'; | ||
*/ | ||
selectedKeys?: string | string[]; | ||
selectedKeys?: string | string[] | null; | ||
/** | ||
@@ -512,3 +512,3 @@ * 初始选中菜单项的 key 值(非受控) | ||
*/ | ||
defaultSelectedKeys?: string | string[]; | ||
defaultSelectedKeys?: string | string[] | null; | ||
/** | ||
@@ -515,0 +515,0 @@ * 选中或取消选中菜单项触发的回调函数 |
@@ -229,3 +229,3 @@ /// <reference types="react" /> | ||
*/ | ||
selectedKeys?: string | Array<string>; | ||
selectedKeys?: string | Array<string> | null; | ||
/** | ||
@@ -236,3 +236,3 @@ * 初始选中导航项的 key 值 | ||
*/ | ||
defaultSelectedKeys?: string | Array<string>; | ||
defaultSelectedKeys?: string | Array<string> | null; | ||
/** | ||
@@ -239,0 +239,0 @@ * 选中或取消选中导航项触发的回调函数 |
@@ -184,2 +184,12 @@ /// <reference types="react" /> | ||
/** | ||
* 鼠标放置后的延时显示, 单位毫秒 ms | ||
*/ | ||
mouseEnterDelay?: number; | ||
/** | ||
* 鼠标离开后的延时显示, 单位毫秒 ms | ||
*/ | ||
mouseLeaveDelay?: number; | ||
/** | ||
* trigger 是否可以关闭弹层 | ||
@@ -186,0 +196,0 @@ */ |
@@ -59,2 +59,3 @@ import React, { type ChangeEvent, type ReactElement, type KeyboardEvent, type UIEvent, type MouseEvent, type ReactNode } from 'react'; | ||
showDataSourceChildren: PropTypes.Requireable<boolean>; | ||
autoClearSearchValue: PropTypes.Requireable<boolean>; | ||
prefix: PropTypes.Requireable<string>; | ||
@@ -61,0 +62,0 @@ size: PropTypes.Requireable<string>; |
@@ -489,2 +489,8 @@ import type React from 'react'; | ||
/** | ||
* 是否在选中项后清空搜索框,只在 mode 为 multiple 或 tags 时有效 | ||
* @en Whether to clear the search box after selecting the selected item, only in mode multiple or tags is valid | ||
* @defaultValue true | ||
*/ | ||
autoClearSearchValue?: boolean; | ||
/** | ||
* 当搜索框值变化时回调 | ||
@@ -491,0 +497,0 @@ * @en Callback when the search box value changes |
@@ -262,2 +262,3 @@ import type React from 'react'; | ||
* @en Data source of the tree component | ||
* @remarks item 中多余的属性会传递给 tree node 内的 <li></li> 节点 - extra attributes in item are passed to the <li></li> node in the tree node. | ||
*/ | ||
@@ -264,0 +265,0 @@ dataSource?: TreeDataType[]; |
@@ -137,5 +137,5 @@ import React, { Component } from 'react'; | ||
handleBlur(e: React.FocusEvent<HTMLUListElement>): void; | ||
handleExpand(expand: boolean, key: string, node: NodeInstance | DataNode): Promise<void> | undefined; | ||
handleSelect(select: boolean, key: string, node: NodeInstance | DataNode, e: React.KeyboardEvent | React.MouseEvent): void; | ||
handleCheck(check: boolean, key: string, node: NodeInstance | DataNode): void; | ||
handleExpand(expand: boolean, key: string, node: NodeInstance): Promise<void> | undefined; | ||
handleSelect(select: boolean, key: string, node: NodeInstance, e: React.KeyboardEvent | React.MouseEvent): void; | ||
handleCheck(check: boolean, key: string, node: NodeInstance): void; | ||
getNodeProps(key: Key): { | ||
@@ -142,0 +142,0 @@ prefix: string | undefined; |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
36205560
690869