shineout 3.10.1-beta.4 → 3.10.1-beta.6

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.4'
548
+ version: '3.10.1-beta.6'
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.4');
13691
+ /* harmony default export */ var version = ('3.10.1-beta.6');
13690
13692
  ;// CONCATENATED MODULE: ../shineout-style/src/jss-style/index.tsx
13691
13693
 
13692
13694
 
@@ -16294,7 +16296,57 @@ var tabsTokens = {
16294
16296
  tabsExtraFillHoverBackgroundColor: 'Neutral-fill-3',
16295
16297
  tabsArrowFontColor: 'Neutral-text-4',
16296
16298
  tabsArrowFontSize: 'Font-14',
16297
- tabsBadgeMargin: 'Spacing-0'
16299
+ tabsBadgeMargin: 'Spacing-0',
16300
+ tabsSmallTabPaddingX: 'Spacing-10',
16301
+ tabsSmallTabPaddingY: 'Spacing-5',
16302
+ tabsSmallTabFontSize: 'Font-12',
16303
+ tabsSmallLinePaddingX: 'Spacing-4',
16304
+ tabsSmallLinePaddingTop: 'Spacing-4',
16305
+ tabsSmallLinePaddingBottom: 'Spacing-4',
16306
+ tabsSmallLineInnerPaddingX: 'Spacing-6',
16307
+ tabsSmallLineInnerPaddingY: 'Spacing-2',
16308
+ tabsSmallLineFontSize: 'Font-12',
16309
+ tabsSmallLineCheckedFontSize: 'Font-12',
16310
+ tabsSmallLineHoverFontSize: 'Font-12',
16311
+ tabsSmallFillPaddingX: 'Spacing-2',
16312
+ tabsSmallFillPaddingY: 'Spacing-2',
16313
+ tabsSmallFillInnerPaddingX: 'Spacing-12',
16314
+ tabsSmallFillInnerPaddingY: 'Spacing-3',
16315
+ tabsSmallFillFontSize: 'Font-12',
16316
+ tabsSmallFillActiveFontSize: 'Font-12',
16317
+ tabsSmallFillCheckedFontSize: 'Font-12',
16318
+ tabsSmallCardPaddingX: 'Spacing-10',
16319
+ tabsSmallCardPaddingY: 'Spacing-5',
16320
+ tabsSmallCardFontSize: 'Font-12',
16321
+ tabsSmallCardActiveFontSize: 'Font-12',
16322
+ tabsSmallCardCheckedFontSize: 'Font-12',
16323
+ tabsSmallDashFontSize: 'Font-12',
16324
+ tabsSmallDashActiveFontSize: 'Font-12',
16325
+ tabsLargeTabPaddingX: 'Spacing-20',
16326
+ tabsLargeTabPaddingY: 'Spacing-12',
16327
+ tabsLargeTabFontSize: 'Font-16',
16328
+ tabsLargeLinePaddingX: 'Spacing-12',
16329
+ tabsLargeLinePaddingTop: 'Spacing-8',
16330
+ tabsLargeLinePaddingBottom: 'Spacing-8',
16331
+ tabsLargeLineInnerPaddingX: 'Spacing-12',
16332
+ tabsLargeLineInnerPaddingY: 'Spacing-6',
16333
+ tabsLargeLineFontSize: 'Font-16',
16334
+ tabsLargeLineCheckedFontSize: 'Font-16',
16335
+ tabsLargeLineHoverFontSize: 'Font-16',
16336
+ tabsLargeFillPaddingX: 'Spacing-6',
16337
+ tabsLargeFillPaddingY: 'Spacing-6',
16338
+ tabsLargeFillInnerPaddingX: 'Spacing-20',
16339
+ tabsLargeFillInnerPaddingY: 'Spacing-7',
16340
+ tabsLargeFillFontSize: 'Font-16',
16341
+ tabsLargeFillActiveFontSize: 'Font-16',
16342
+ tabsLargeFillCheckedFontSize: 'Font-16',
16343
+ tabsLargeCardPaddingX: 'Spacing-20',
16344
+ tabsLargeCardPaddingY: 'Spacing-12',
16345
+ tabsLargeCardFontSize: 'Font-16',
16346
+ tabsLargeCardActiveFontSize: 'Font-16',
16347
+ tabsLargeCardCheckedFontSize: 'Font-16',
16348
+ tabsLargeDashFontSize: 'Font-16',
16349
+ tabsLargeDashActiveFontSize: 'Font-16'
16298
16350
  };
16299
16351
  /* harmony default export */ var tabs = (tabsTokens);
16300
16352
  ;// CONCATENATED MODULE: ../theme/src/tabs/index.ts
@@ -29716,7 +29768,99 @@ var tabsStyle = {
29716
29768
  }
29717
29769
  }
29718
29770
  },
29719
- sticky: {}
29771
+ sticky: {},
29772
+ small: {
29773
+ '& $tab': {
29774
+ fontSize: src.tabsSmallTabFontSize
29775
+ },
29776
+ // card
29777
+ '& $headerWrapper[data-soui-shape="card"] $header $tab': {
29778
+ padding: "".concat(src.tabsSmallCardPaddingY, " ").concat(src.tabsSmallCardPaddingX),
29779
+ fontSize: src.tabsSmallCardFontSize,
29780
+ '&[data-soui-state="active"]': {
29781
+ fontSize: src.tabsSmallCardCheckedFontSize
29782
+ }
29783
+ },
29784
+ // line
29785
+ '& $headerWrapper[data-soui-shape="line"] $header $tab': {
29786
+ padding: "".concat(src.tabsSmallLinePaddingTop, " ").concat(src.tabsSmallLinePaddingX, " ").concat(src.tabsSmallLinePaddingBottom),
29787
+ fontSize: src.tabsSmallLineFontSize,
29788
+ '&[data-soui-state="active"]': {
29789
+ fontSize: src.tabsSmallLineCheckedFontSize
29790
+ }
29791
+ },
29792
+ '& $lineInner': {
29793
+ padding: "".concat(src.tabsSmallLineInnerPaddingY, " ").concat(src.tabsSmallLineInnerPaddingX)
29794
+ },
29795
+ // dash
29796
+ '& $headerWrapper[data-soui-shape="dash"] $header $tab': {
29797
+ padding: "".concat(src.tabsSmallLinePaddingTop, " ").concat(src.tabsSmallLinePaddingX, " ").concat(src.tabsSmallLinePaddingBottom),
29798
+ fontSize: src.tabsSmallDashFontSize,
29799
+ '&[data-soui-state="active"]': {
29800
+ fontSize: src.tabsSmallDashActiveFontSize
29801
+ }
29802
+ },
29803
+ // fill
29804
+ '& $headerWrapper[data-soui-shape="fill"] $header $tab': {
29805
+ fontSize: src.tabsSmallFillFontSize,
29806
+ padding: "".concat(src.tabsSmallFillPaddingY, " 0"),
29807
+ '&:first-child': {
29808
+ paddingLeft: src.tabsSmallFillPaddingX
29809
+ },
29810
+ '&:last-child': {
29811
+ paddingRight: src.tabsSmallFillPaddingX
29812
+ }
29813
+ },
29814
+ '& $fillInner': {
29815
+ padding: "".concat(src.tabsSmallFillInnerPaddingY, " ").concat(src.tabsSmallFillInnerPaddingX)
29816
+ }
29817
+ },
29818
+ large: {
29819
+ '& $tab': {
29820
+ fontSize: src.tabsLargeTabFontSize
29821
+ },
29822
+ // card
29823
+ '& $headerWrapper[data-soui-shape="card"] $header $tab': {
29824
+ padding: "".concat(src.tabsLargeCardPaddingY, " ").concat(src.tabsLargeCardPaddingX),
29825
+ fontSize: src.tabsLargeCardFontSize,
29826
+ '&[data-soui-state="active"]': {
29827
+ fontSize: src.tabsLargeCardCheckedFontSize
29828
+ }
29829
+ },
29830
+ // line
29831
+ '& $headerWrapper[data-soui-shape="line"] $header $tab': {
29832
+ padding: "".concat(src.tabsLargeLinePaddingTop, " ").concat(src.tabsLargeLinePaddingX, " ").concat(src.tabsLargeLinePaddingBottom),
29833
+ fontSize: src.tabsLargeLineFontSize,
29834
+ '&[data-soui-state="active"]': {
29835
+ fontSize: src.tabsLargeLineCheckedFontSize
29836
+ }
29837
+ },
29838
+ '& $lineInner': {
29839
+ padding: "".concat(src.tabsLargeLineInnerPaddingY, " ").concat(src.tabsLargeLineInnerPaddingX)
29840
+ },
29841
+ // dash
29842
+ '& $headerWrapper[data-soui-shape="dash"] $header $tab': {
29843
+ padding: "".concat(src.tabsLargeLinePaddingTop, " ").concat(src.tabsLargeLinePaddingX, " ").concat(src.tabsLargeLinePaddingBottom),
29844
+ fontSize: src.tabsLargeDashFontSize,
29845
+ '&[data-soui-state="active"]': {
29846
+ fontSize: src.tabsLargeDashActiveFontSize
29847
+ }
29848
+ },
29849
+ // fill
29850
+ '& $headerWrapper[data-soui-shape="fill"] $header $tab': {
29851
+ fontSize: src.tabsLargeFillFontSize,
29852
+ padding: "".concat(src.tabsLargeFillPaddingY, " 0"),
29853
+ '&:first-child': {
29854
+ paddingLeft: src.tabsLargeFillPaddingX
29855
+ },
29856
+ '&:last-child': {
29857
+ paddingRight: src.tabsLargeFillPaddingX
29858
+ }
29859
+ },
29860
+ '& $fillInner': {
29861
+ padding: "".concat(src.tabsLargeFillInnerPaddingY, " ").concat(src.tabsLargeFillInnerPaddingX)
29862
+ }
29863
+ }
29720
29864
  };
29721
29865
  /* harmony default export */ var tabs_tabs = (tabsStyle);
29722
29866
  ;// CONCATENATED MODULE: ../shineout-style/src/tabs/index.ts
@@ -32402,7 +32546,8 @@ var usePopup = function usePopup(props) {
32402
32546
  mouseLeaveDelay = props.mouseLeaveDelay,
32403
32547
  targetEvents = props.targetEvents,
32404
32548
  _props$defaultOpen = props.defaultOpen,
32405
- defaultOpen = _props$defaultOpen === void 0 ? false : _props$defaultOpen;
32549
+ defaultOpen = _props$defaultOpen === void 0 ? false : _props$defaultOpen,
32550
+ esc = props.esc;
32406
32551
  var _useState = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(defaultOpen),
32407
32552
  _useState2 = slicedToArray_default()(_useState, 2),
32408
32553
  openState = _useState2[0],
@@ -32563,6 +32708,24 @@ var usePopup = function usePopup(props) {
32563
32708
  effect: (trigger === 'click' || trigger === 'hover') && open,
32564
32709
  event: 'mousedown'
32565
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]);
32566
32729
  var providerValue = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo)(function () {
32567
32730
  return {
32568
32731
  addParent: handleAddParent,
@@ -34006,7 +34169,8 @@ var Popover = function Popover(props) {
34006
34169
  autoMode: 'popover',
34007
34170
  priorityDirection: priorityDirection,
34008
34171
  mouseEnterDelay: props.mouseEnterDelay,
34009
- mouseLeaveDelay: props.mouseLeaveDelay
34172
+ mouseLeaveDelay: props.mouseLeaveDelay,
34173
+ esc: config.popupEsc
34010
34174
  }),
34011
34175
  open = _usePopup.open,
34012
34176
  position = _usePopup.position,
@@ -36447,7 +36611,7 @@ var spin_Spin = function Spin() {
36447
36611
 
36448
36612
 
36449
36613
 
36450
- 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"],
36451
36615
  button_excluded2 = ["htmlType", "onRef"];
36452
36616
 
36453
36617
 
@@ -36464,6 +36628,8 @@ var Button = function Button(props) {
36464
36628
  var _jssStyle$button, _React$Children$map;
36465
36629
  var jssStyle = props.jssStyle,
36466
36630
  className = props.className,
36631
+ classNamesProp = props.classNames,
36632
+ stylesProp = props.styles,
36467
36633
  style = props.style,
36468
36634
  children = props.children,
36469
36635
  loading = props.loading,
@@ -36507,7 +36673,7 @@ var Button = function Button(props) {
36507
36673
  disabled: !!disabled,
36508
36674
  loading: !!loading
36509
36675
  };
36510
- var _useSemantic = useSemantic(props.classNames, props.styles, globalSemanticConfig, semInfo),
36676
+ var _useSemantic = useSemantic(classNamesProp, stylesProp, globalSemanticConfig, semInfo),
36511
36677
  _useSemantic2 = slicedToArray_default()(_useSemantic, 2),
36512
36678
  semClass = _useSemantic2[0],
36513
36679
  semStyle = _useSemantic2[1];
@@ -44666,7 +44832,8 @@ var Cascader = function Cascader(props0) {
44666
44832
  onCollapse: onCollapse,
44667
44833
  disabled: false,
44668
44834
  trigger: 'click',
44669
- position: getRTLPosition(positionProp, direction === 'rtl')
44835
+ position: getRTLPosition(positionProp, direction === 'rtl'),
44836
+ esc: config.popupEsc
44670
44837
  }),
44671
44838
  open = _usePopup.open,
44672
44839
  position = _usePopup.position,
@@ -50859,7 +51026,8 @@ var DatePicker = function DatePicker(props0) {
50859
51026
  onCollapse: onCollapse,
50860
51027
  disabled: disabledStatus === 'all',
50861
51028
  trigger: 'click',
50862
- position: getRTLPosition(listPosition, direction === 'rtl')
51029
+ position: getRTLPosition(listPosition, direction === 'rtl'),
51030
+ esc: config.popupEsc
50863
51031
  }),
50864
51032
  open = _usePopup.open,
50865
51033
  position = _usePopup.position,
@@ -52625,7 +52793,8 @@ var Dropdown = function Dropdown(props) {
52625
52793
  position: getRTLPosition(props.position || dfp, isRtl),
52626
52794
  autoMode: 'menu',
52627
52795
  priorityDirection: 'vertical',
52628
- mouseLeaveDelay: 200
52796
+ mouseLeaveDelay: 200,
52797
+ esc: config.popupEsc
52629
52798
  }),
52630
52799
  open = _usePopup.open,
52631
52800
  position = _usePopup.position,
@@ -60594,7 +60763,8 @@ function Select(props0) {
60594
60763
  onCollapse: onCollapse,
60595
60764
  disabled: false,
60596
60765
  trigger: trigger,
60597
- position: getRTLPosition(positionProp, direction === 'rtl')
60766
+ position: getRTLPosition(positionProp, direction === 'rtl'),
60767
+ esc: config.popupEsc
60598
60768
  }),
60599
60769
  open = _usePopup.open,
60600
60770
  position = _usePopup.position,
@@ -71593,6 +71763,7 @@ var TabsHeader = function TabsHeader(props) {
71593
71763
  splitColor = props.splitColor,
71594
71764
  tabBarStyle = props.tabBarStyle,
71595
71765
  getPosition = props.getPosition,
71766
+ size = props.size,
71596
71767
  semClass = props.semClass,
71597
71768
  semStyle = props.semStyle;
71598
71769
  var headerRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(null);
@@ -71740,7 +71911,7 @@ var TabsHeader = function TabsHeader(props) {
71740
71911
  });
71741
71912
  }, 0);
71742
71913
  }
71743
- }, [active, tabs]);
71914
+ }, [active, tabs, size]);
71744
71915
  var renderHeaderScrollBar = function renderHeaderScrollBar() {
71745
71916
  if (shape !== 'line' && shape !== 'dash') return;
71746
71917
  if (!currentTabSize.width || !currentTabSize.height) return;
@@ -71878,7 +72049,7 @@ var TabsHeader = function TabsHeader(props) {
71878
72049
 
71879
72050
 
71880
72051
 
71881
- var tabs_excluded = ["jssStyle", "align", "children", "shape", "position", "lazy", "autoFill", "hideSplit", "collapsible", "defaultCollapsed", "onChange", "extra", "border", "splitColor", "tabBarExtraContent", "background", "activeBackground", "inactiveBackground", "defaultActive", "tabBarStyle", "color", "sticky", "allowNonPanel", "renderTabsHeader", "className", "classNames", "styles", "style"];
72052
+ var tabs_excluded = ["jssStyle", "align", "children", "shape", "position", "size", "lazy", "autoFill", "hideSplit", "collapsible", "defaultCollapsed", "onChange", "extra", "border", "splitColor", "tabBarExtraContent", "background", "activeBackground", "inactiveBackground", "defaultActive", "tabBarStyle", "color", "sticky", "allowNonPanel", "renderTabsHeader", "className", "classNames", "styles", "style"];
71882
72053
 
71883
72054
 
71884
72055
 
@@ -71916,6 +72087,7 @@ var Tabs = function Tabs(props) {
71916
72087
  children = props.children,
71917
72088
  shapeProps = props.shape,
71918
72089
  position = props.position,
72090
+ size = props.size,
71919
72091
  _props$lazy = props.lazy,
71920
72092
  lazy = _props$lazy === void 0 ? true : _props$lazy,
71921
72093
  autoFill = props.autoFill,
@@ -71972,7 +72144,7 @@ var Tabs = function Tabs(props) {
71972
72144
  _useSemantic2 = slicedToArray_default()(_useSemantic, 2),
71973
72145
  semClass = _useSemantic2[0],
71974
72146
  semStyle = _useSemantic2[1];
71975
- var rootClass = classnames_default()(tabsStyle.rootClass, tabsStyle.tabs, tabsClassName, defineProperty_default()(defineProperty_default()({}, tabsStyle.autoFill, isVertical || autoFill), tabsStyle.collapsed, collapse), semClass('root'));
72147
+ var rootClass = classnames_default()(tabsStyle.rootClass, tabsStyle.tabs, tabsClassName, defineProperty_default()(defineProperty_default()(defineProperty_default()(defineProperty_default()({}, tabsStyle.autoFill, isVertical || autoFill), tabsStyle.collapsed, collapse), tabsStyle.small, size === 'small'), tabsStyle.large, size === 'large'), semClass('root'));
71976
72148
  var getRootProps = function getRootProps() {
71977
72149
  return rest;
71978
72150
  };
@@ -72012,7 +72184,8 @@ var Tabs = function Tabs(props) {
72012
72184
  var getDataProps = function getDataProps() {
72013
72185
  return getDataAttribute({
72014
72186
  position: getPosition(),
72015
- shape: shape
72187
+ shape: shape,
72188
+ size: size || 'default'
72016
72189
  });
72017
72190
  };
72018
72191
  var handleCollapsible = function handleCollapsible() {
@@ -72086,6 +72259,7 @@ var Tabs = function Tabs(props) {
72086
72259
  align: align,
72087
72260
  jssStyle: jssStyle,
72088
72261
  position: position,
72262
+ size: size,
72089
72263
  hideSplit: hideSplit,
72090
72264
  extra: getExtra(),
72091
72265
  splitColor: border,
@@ -73501,7 +73675,8 @@ var TreeSelect = function TreeSelect(props0) {
73501
73675
  onCollapse: onCollapse,
73502
73676
  disabled: false,
73503
73677
  trigger: 'click',
73504
- position: getRTLPosition(positionProp, direction === 'rtl')
73678
+ position: getRTLPosition(positionProp, direction === 'rtl'),
73679
+ esc: config.popupEsc
73505
73680
  }),
73506
73681
  open = _usePopup.open,
73507
73682
  position = _usePopup.position,
@@ -79792,7 +79967,7 @@ var watermark_interface = __webpack_require__(6640);
79792
79967
 
79793
79968
 
79794
79969
  /* harmony default export */ var src_0 = ({
79795
- version: '3.10.1-beta.4'
79970
+ version: '3.10.1-beta.6'
79796
79971
  });
79797
79972
  }();
79798
79973
  /******/ return __webpack_exports__;