shineout 3.10.1-beta.5 → 3.10.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/cjs/index.js CHANGED
@@ -545,5 +545,5 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
545
545
  // 此文件由脚本自动生成,请勿直接修改。
546
546
  // This file was generated automatically by a script. Please do not modify it directly.
547
547
  var _default = exports.default = {
548
- version: '3.10.1-beta.5'
548
+ version: '3.10.1'
549
549
  };
package/dist/shineout.js CHANGED
@@ -8674,7 +8674,8 @@ var defaultConfig = {
8674
8674
  input: {},
8675
8675
  avatar: {},
8676
8676
  direction: 'ltr',
8677
- popupContainer: null
8677
+ popupContainer: null,
8678
+ popupEsc: true
8678
8679
  };
8679
8680
  var state = createWithHooks(defaultConfig);
8680
8681
  var config_config = snapshot(state.mutate);
@@ -8712,7 +8713,7 @@ var setConfig = function setConfig(option) {
8712
8713
 
8713
8714
 
8714
8715
 
8715
- var _excluded = ["jssStyle", "type", "className", "children", "icon", "iconClassName", "title", "titleStyle", "iconSize", "closable", "hideClose", "bordered", "closeItem", "onClose", "classNames", "styles"];
8716
+ var _excluded = ["jssStyle", "type", "className", "children", "icon", "iconClassName", "title", "titleClassName", "titleStyle", "iconSize", "closable", "hideClose", "bordered", "closeItem", "onClose", "classNames", "styles"];
8716
8717
 
8717
8718
 
8718
8719
 
@@ -8736,6 +8737,7 @@ var Alert = function Alert(props) {
8736
8737
  icon = props.icon,
8737
8738
  iconClassName = props.iconClassName,
8738
8739
  title = props.title,
8740
+ titleClassName = props.titleClassName,
8739
8741
  titleStyle = props.titleStyle,
8740
8742
  iconSize = props.iconSize,
8741
8743
  closable = props.closable,
@@ -8815,7 +8817,7 @@ var Alert = function Alert(props) {
8815
8817
  };
8816
8818
  var renderTitle = function renderTitle() {
8817
8819
  return /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
8818
- className: classnames_default()(alertStyle.title, props.titleClassName, semClass('title')),
8820
+ className: classnames_default()(alertStyle.title, titleClassName, semClass('title')),
8819
8821
  style: objectSpread2_default()(objectSpread2_default()({}, titleStyle), semStyle('title')),
8820
8822
  children: title
8821
8823
  });
@@ -13686,7 +13688,7 @@ var handleStyle = function handleStyle(style) {
13686
13688
  };
13687
13689
  /* harmony default export */ var jss_style_handleStyle = (handleStyle);
13688
13690
  ;// CONCATENATED MODULE: ../shineout-style/src/version.ts
13689
- /* harmony default export */ var version = ('3.10.1-beta.5');
13691
+ /* harmony default export */ var version = ('3.10.1');
13690
13692
  ;// CONCATENATED MODULE: ../shineout-style/src/jss-style/index.tsx
13691
13693
 
13692
13694
 
@@ -32544,7 +32546,8 @@ var usePopup = function usePopup(props) {
32544
32546
  mouseLeaveDelay = props.mouseLeaveDelay,
32545
32547
  targetEvents = props.targetEvents,
32546
32548
  _props$defaultOpen = props.defaultOpen,
32547
- defaultOpen = _props$defaultOpen === void 0 ? false : _props$defaultOpen;
32549
+ defaultOpen = _props$defaultOpen === void 0 ? false : _props$defaultOpen,
32550
+ esc = props.esc;
32548
32551
  var _useState = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(defaultOpen),
32549
32552
  _useState2 = slicedToArray_default()(_useState, 2),
32550
32553
  openState = _useState2[0],
@@ -32705,6 +32708,24 @@ var usePopup = function usePopup(props) {
32705
32708
  effect: (trigger === 'click' || trigger === 'hover') && open,
32706
32709
  event: 'mousedown'
32707
32710
  });
32711
+
32712
+ // ESC 关闭弹出层(仅 click 触发)
32713
+ // 使用 capturing 阶段确保优先于 Modal 的 bubbling 阶段 handler
32714
+ // hover/focus 触发的弹出层不参与 ESC 处理,避免拦截 Modal 等上层组件的 ESC 事件
32715
+ var enableEsc = (esc !== null && esc !== void 0 ? esc : true) && trigger === 'click';
32716
+ (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
32717
+ if (!open || !enableEsc) return;
32718
+ var handleEsc = function handleEsc(e) {
32719
+ if (e.key === 'Escape' || e.keyCode === 27) {
32720
+ e.stopPropagation();
32721
+ handleBlur();
32722
+ }
32723
+ };
32724
+ document.addEventListener('keydown', handleEsc, true);
32725
+ return function () {
32726
+ document.removeEventListener('keydown', handleEsc, true);
32727
+ };
32728
+ }, [open, enableEsc]);
32708
32729
  var providerValue = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo)(function () {
32709
32730
  return {
32710
32731
  addParent: handleAddParent,
@@ -34148,7 +34169,8 @@ var Popover = function Popover(props) {
34148
34169
  autoMode: 'popover',
34149
34170
  priorityDirection: priorityDirection,
34150
34171
  mouseEnterDelay: props.mouseEnterDelay,
34151
- mouseLeaveDelay: props.mouseLeaveDelay
34172
+ mouseLeaveDelay: props.mouseLeaveDelay,
34173
+ esc: config.popupEsc
34152
34174
  }),
34153
34175
  open = _usePopup.open,
34154
34176
  position = _usePopup.position,
@@ -36589,7 +36611,7 @@ var spin_Spin = function Spin() {
36589
36611
 
36590
36612
 
36591
36613
 
36592
- var button_excluded = ["jssStyle", "className", "style", "children", "loading", "href", "text", "outline", "shape", "size", "type", "space", "target", "mode", "htmlType", "renderLoading"],
36614
+ var button_excluded = ["jssStyle", "className", "classNames", "styles", "style", "children", "loading", "href", "text", "outline", "shape", "size", "type", "space", "target", "mode", "htmlType", "renderLoading"],
36593
36615
  button_excluded2 = ["htmlType", "onRef"];
36594
36616
 
36595
36617
 
@@ -36606,6 +36628,8 @@ var Button = function Button(props) {
36606
36628
  var _jssStyle$button, _React$Children$map;
36607
36629
  var jssStyle = props.jssStyle,
36608
36630
  className = props.className,
36631
+ classNamesProp = props.classNames,
36632
+ stylesProp = props.styles,
36609
36633
  style = props.style,
36610
36634
  children = props.children,
36611
36635
  loading = props.loading,
@@ -36649,7 +36673,7 @@ var Button = function Button(props) {
36649
36673
  disabled: !!disabled,
36650
36674
  loading: !!loading
36651
36675
  };
36652
- var _useSemantic = useSemantic(props.classNames, props.styles, globalSemanticConfig, semInfo),
36676
+ var _useSemantic = useSemantic(classNamesProp, stylesProp, globalSemanticConfig, semInfo),
36653
36677
  _useSemantic2 = slicedToArray_default()(_useSemantic, 2),
36654
36678
  semClass = _useSemantic2[0],
36655
36679
  semStyle = _useSemantic2[1];
@@ -44808,7 +44832,8 @@ var Cascader = function Cascader(props0) {
44808
44832
  onCollapse: onCollapse,
44809
44833
  disabled: false,
44810
44834
  trigger: 'click',
44811
- position: getRTLPosition(positionProp, direction === 'rtl')
44835
+ position: getRTLPosition(positionProp, direction === 'rtl'),
44836
+ esc: config.popupEsc
44812
44837
  }),
44813
44838
  open = _usePopup.open,
44814
44839
  position = _usePopup.position,
@@ -51001,7 +51026,8 @@ var DatePicker = function DatePicker(props0) {
51001
51026
  onCollapse: onCollapse,
51002
51027
  disabled: disabledStatus === 'all',
51003
51028
  trigger: 'click',
51004
- position: getRTLPosition(listPosition, direction === 'rtl')
51029
+ position: getRTLPosition(listPosition, direction === 'rtl'),
51030
+ esc: config.popupEsc
51005
51031
  }),
51006
51032
  open = _usePopup.open,
51007
51033
  position = _usePopup.position,
@@ -52767,7 +52793,8 @@ var Dropdown = function Dropdown(props) {
52767
52793
  position: getRTLPosition(props.position || dfp, isRtl),
52768
52794
  autoMode: 'menu',
52769
52795
  priorityDirection: 'vertical',
52770
- mouseLeaveDelay: 200
52796
+ mouseLeaveDelay: 200,
52797
+ esc: config.popupEsc
52771
52798
  }),
52772
52799
  open = _usePopup.open,
52773
52800
  position = _usePopup.position,
@@ -60736,7 +60763,8 @@ function Select(props0) {
60736
60763
  onCollapse: onCollapse,
60737
60764
  disabled: false,
60738
60765
  trigger: trigger,
60739
- position: getRTLPosition(positionProp, direction === 'rtl')
60766
+ position: getRTLPosition(positionProp, direction === 'rtl'),
60767
+ esc: config.popupEsc
60740
60768
  }),
60741
60769
  open = _usePopup.open,
60742
60770
  position = _usePopup.position,
@@ -73647,7 +73675,8 @@ var TreeSelect = function TreeSelect(props0) {
73647
73675
  onCollapse: onCollapse,
73648
73676
  disabled: false,
73649
73677
  trigger: 'click',
73650
- position: getRTLPosition(positionProp, direction === 'rtl')
73678
+ position: getRTLPosition(positionProp, direction === 'rtl'),
73679
+ esc: config.popupEsc
73651
73680
  }),
73652
73681
  open = _usePopup.open,
73653
73682
  position = _usePopup.position,
@@ -79938,7 +79967,7 @@ var watermark_interface = __webpack_require__(6640);
79938
79967
 
79939
79968
 
79940
79969
  /* harmony default export */ var src_0 = ({
79941
- version: '3.10.1-beta.5'
79970
+ version: '3.10.1'
79942
79971
  });
79943
79972
  }();
79944
79973
  /******/ return __webpack_exports__;