shineout 3.7.6-beta.2 → 3.7.6-beta.3

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.
@@ -17,7 +17,8 @@ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol"
17
17
  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); }
18
18
  var jssStyle = {
19
19
  breadcrumb: _shineoutStyle.useBreadcrumbStyle,
20
- popover: _shineoutStyle.usePopoverStyle
20
+ popover: _shineoutStyle.usePopoverStyle,
21
+ tooltip: _shineoutStyle.useTooltipStyle
21
22
  };
22
23
  var _default = exports.default = function _default(props) {
23
24
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_base.Breadcrumb, _objectSpread({
package/cjs/index.js CHANGED
@@ -522,5 +522,5 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
522
522
  // 此文件由脚本自动生成,请勿直接修改。
523
523
  // This file was generated automatically by a script. Please do not modify it directly.
524
524
  var _default = exports.default = {
525
- version: '3.7.6-beta.2'
525
+ version: '3.7.6-beta.3'
526
526
  };
package/dist/shineout.js CHANGED
@@ -12234,7 +12234,7 @@ var handleStyle = function handleStyle(style) {
12234
12234
  };
12235
12235
  /* harmony default export */ var jss_style_handleStyle = (handleStyle);
12236
12236
  ;// CONCATENATED MODULE: ../shineout-style/src/version.ts
12237
- /* harmony default export */ var version = ('3.7.6-beta.2');
12237
+ /* harmony default export */ var version = ('3.7.6-beta.3');
12238
12238
  ;// CONCATENATED MODULE: ../shineout-style/src/jss-style/index.tsx
12239
12239
 
12240
12240
 
@@ -15910,6 +15910,9 @@ var breadcrumbStyle = {
15910
15910
  }
15911
15911
  }
15912
15912
  },
15913
+ wrapperPopover: {
15914
+ flexWrap: 'wrap'
15915
+ },
15913
15916
  content: {
15914
15917
  '&&': {
15915
15918
  display: 'flex',
@@ -15919,10 +15922,23 @@ var breadcrumbStyle = {
15919
15922
  color: src.breadcrumbDefaultLinkActiveColor
15920
15923
  }
15921
15924
  },
15925
+ contentMaxWidth: {
15926
+ maxWidth: '150px',
15927
+ overflow: 'hidden',
15928
+ textOverflow: 'ellipsis',
15929
+ whiteSpace: 'nowrap',
15930
+ '&&': {
15931
+ display: 'block'
15932
+ }
15933
+ },
15922
15934
  ellipsis: {
15923
15935
  color: src.breadcrumbLinkColor,
15924
15936
  position: 'relative',
15925
- top: '-3px'
15937
+ top: '-0.25em',
15938
+ cursor: 'pointer',
15939
+ '&:hover': {
15940
+ color: src.breadcrumbLinkHoverColor
15941
+ }
15926
15942
  },
15927
15943
  itemWrapper: {
15928
15944
  // padding: `0 ${token.breadcrumbListItemWrapperPaddingX}`,
@@ -27812,6 +27828,16 @@ var tooltipStyle = objectSpread2_default()(objectSpread2_default()({
27812
27828
  },
27813
27829
  '&[data-soui-position^="bottom"] $arrow': {
27814
27830
  transform: 'translate(0, calc(-100% + 1px)) rotate(0deg)'
27831
+ },
27832
+ '& $arrow:before': {
27833
+ clipPath: 'none',
27834
+ borderTop: "1px solid ".concat(src.tooltipLightBorderColor),
27835
+ borderLeft: "1px solid ".concat(src.tooltipLightBorderColor),
27836
+ borderRight: 'transparent',
27837
+ borderBottom: 'transparent',
27838
+ width: 8.4,
27839
+ height: 8.4,
27840
+ transform: 'translate(50%, 27.5%) rotate(45deg)'
27815
27841
  }
27816
27842
  },
27817
27843
  '&[data-soui-type^="primary"]': {
@@ -32954,6 +32980,223 @@ var List = function List(props) {
32954
32980
  }));
32955
32981
  };
32956
32982
  /* harmony default export */ var breadcrumb_list = (List);
32983
+ ;// CONCATENATED MODULE: ../base/src/tooltip/tooltip.tsx
32984
+
32985
+
32986
+
32987
+
32988
+
32989
+
32990
+
32991
+
32992
+
32993
+
32994
+ var tooltip_devUseWarning = devUseWarning;
32995
+ var defaultDelay = 0;
32996
+ var Tooltip = function Tooltip(props) {
32997
+ var _jssStyle$tooltip, _config$tooltip;
32998
+ var _props$trigger = props.trigger,
32999
+ trigger = _props$trigger === void 0 ? 'hover' : _props$trigger,
33000
+ priorityDirection = props.priorityDirection,
33001
+ children = props.children,
33002
+ tip = props.tip,
33003
+ disabledChild = props.disabledChild,
33004
+ jssStyle = props.jssStyle,
33005
+ className = props.className,
33006
+ style = props.style,
33007
+ zIndex = props.zIndex,
33008
+ _props$showArrow = props.showArrow,
33009
+ showArrow = _props$showArrow === void 0 ? true : _props$showArrow,
33010
+ persistentProp = props.persistent,
33011
+ _props$type = props.type,
33012
+ type = _props$type === void 0 ? 'default' : _props$type,
33013
+ _props$position = props.position,
33014
+ popsitionProps = _props$position === void 0 ? 'auto' : _props$position;
33015
+ var tooltipClasses = jssStyle === null || jssStyle === void 0 || (_jssStyle$tooltip = jssStyle.tooltip) === null || _jssStyle$tooltip === void 0 ? void 0 : _jssStyle$tooltip.call(jssStyle);
33016
+ var config = useConfig();
33017
+ var persistent = persistentProp !== null && persistentProp !== void 0 ? persistentProp : (_config$tooltip = config.tooltip) === null || _config$tooltip === void 0 ? void 0 : _config$tooltip.persistent;
33018
+ var childrenProps = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.isValidElement)(children) ? children === null || children === void 0 ? void 0 : children.props : {};
33019
+ var delay = props.delay || props.mouseEnterDelay || defaultDelay;
33020
+ var _usePopup = use_popup({
33021
+ position: popsitionProps,
33022
+ trigger: trigger,
33023
+ autoMode: 'popover',
33024
+ priorityDirection: priorityDirection,
33025
+ mouseEnterDelay: delay,
33026
+ targetEvents: disabledChild ? {} : childrenProps
33027
+ }),
33028
+ open = _usePopup.open,
33029
+ position = _usePopup.position,
33030
+ getTargetProps = _usePopup.getTargetProps,
33031
+ targetRef = _usePopup.targetRef,
33032
+ popupRef = _usePopup.popupRef,
33033
+ closePop = _usePopup.closePop;
33034
+ var events = getTargetProps();
33035
+ var _React$useState = external_root_React_commonjs2_react_commonjs_react_amd_react_default().useState(0),
33036
+ _React$useState2 = slicedToArray_default()(_React$useState, 2),
33037
+ updateKey = _React$useState2[0],
33038
+ setUpdateKey = _React$useState2[1];
33039
+ var handleUpdateKey = usePersistFn(function () {
33040
+ setUpdateKey(function (prev) {
33041
+ return (prev + 1) % 2;
33042
+ });
33043
+ });
33044
+ var bindEvents = function bindEvents() {
33045
+ var _window;
33046
+ var targetEl = targetRef.current;
33047
+ if (!targetEl) return;
33048
+ if (events.onMouseEnter) targetEl.addEventListener('mouseenter', events.onMouseEnter);
33049
+ if (events.onMouseLeave) targetEl.addEventListener('mouseleave', events.onMouseLeave);
33050
+ if (events.onClick) targetEl.addEventListener('click', events.onClick);
33051
+ (_window = window) === null || _window === void 0 || _window.addEventListener('resize', handleUpdateKey);
33052
+ };
33053
+ var unbindEvents = function unbindEvents() {
33054
+ var _window2;
33055
+ var targetEl = targetRef.current;
33056
+ if (!targetEl) return;
33057
+ var events = getTargetProps();
33058
+ if (events.onMouseEnter) targetEl.removeEventListener('mouseenter', events.onMouseEnter);
33059
+ if (events.onMouseLeave) targetEl.removeEventListener('mouseleave', events.onMouseLeave);
33060
+ if (events.onClick) targetEl.removeEventListener('click', events.onClick);
33061
+ targetEl.removeEventListener('click', closePop);
33062
+ (_window2 = window) === null || _window2 === void 0 || _window2.removeEventListener('resize', handleUpdateKey);
33063
+ };
33064
+ (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
33065
+ if (!persistent) return;
33066
+ bindEvents();
33067
+ return function () {
33068
+ unbindEvents();
33069
+ };
33070
+ }, [persistent]);
33071
+ if (! /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.isValidElement)(children)) {
33072
+ tooltip_devUseWarning.error('Tooltip children expect a single ReactElement.');
33073
+ return null;
33074
+ }
33075
+ if (!tip) return children;
33076
+ var inner = disabledChild ? /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
33077
+ className: tooltipClasses === null || tooltipClasses === void 0 ? void 0 : tooltipClasses.target,
33078
+ style: {
33079
+ cursor: 'not-allowed'
33080
+ },
33081
+ children: /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.cloneElement)(children, {
33082
+ style: objectSpread2_default()(objectSpread2_default()({}, childrenProps.style), {}, {
33083
+ pointerEvents: 'none'
33084
+ })
33085
+ })
33086
+ }) : children;
33087
+ return /*#__PURE__*/(0,jsx_runtime.jsxs)(jsx_runtime.Fragment, {
33088
+ children: [/*#__PURE__*/(0,jsx_runtime.jsx)("noscript", {
33089
+ ref: function ref(el) {
33090
+ if (!el) return;
33091
+ var targetEl = el.nextElementSibling;
33092
+ if (!targetEl) return;
33093
+ if (targetRef.current === targetEl) return;
33094
+ targetRef.current = targetEl;
33095
+ }
33096
+ }, 'ns'), /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.cloneElement)(inner, events), /*#__PURE__*/(0,jsx_runtime.jsx)(absolute_list, {
33097
+ focus: open,
33098
+ parentElRef: targetRef,
33099
+ popupElRef: popupRef,
33100
+ absolute: true,
33101
+ position: position,
33102
+ fixedWidth: false,
33103
+ popupGap: 0,
33104
+ zIndex: zIndex,
33105
+ adjust: popsitionProps === 'auto',
33106
+ updateKey: updateKey,
33107
+ children: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", objectSpread2_default()(objectSpread2_default()({
33108
+ className: classnames_default()(className, tooltipClasses === null || tooltipClasses === void 0 ? void 0 : tooltipClasses.rootClass, tooltipClasses === null || tooltipClasses === void 0 ? void 0 : tooltipClasses.wrapper, open && (tooltipClasses === null || tooltipClasses === void 0 ? void 0 : tooltipClasses.wrapperOpen)),
33109
+ style: {
33110
+ pointerEvents: persistent ? 'initial' : undefined
33111
+ }
33112
+ }, getDataAttribute({
33113
+ type: type,
33114
+ position: position
33115
+ })), {}, {
33116
+ ref: popupRef,
33117
+ onMouseLeave: events.onMouseLeave,
33118
+ dir: config.direction,
33119
+ children: [showArrow && /*#__PURE__*/(0,jsx_runtime.jsx)("span", objectSpread2_default()({
33120
+ className: tooltipClasses === null || tooltipClasses === void 0 ? void 0 : tooltipClasses.arrow
33121
+ }, getDataAttribute({
33122
+ role: 'arrow'
33123
+ }))), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
33124
+ style: style,
33125
+ className: classnames_default()(tooltipClasses === null || tooltipClasses === void 0 ? void 0 : tooltipClasses.content),
33126
+ children: tip
33127
+ })]
33128
+ }))
33129
+ })]
33130
+ });
33131
+ };
33132
+ /* harmony default export */ var src_tooltip_tooltip = (Tooltip);
33133
+ ;// CONCATENATED MODULE: ../base/src/breadcrumb/breadcrumb-item.tsx
33134
+
33135
+
33136
+
33137
+
33138
+
33139
+
33140
+
33141
+
33142
+ var BreadcrumbItem = function BreadcrumbItem(_ref) {
33143
+ var _jssStyle$breadcrumb;
33144
+ var dataItem = _ref.dataItem,
33145
+ renderItem = _ref.renderItem,
33146
+ jssStyle = _ref.jssStyle,
33147
+ max = _ref.max;
33148
+ var contentRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(null);
33149
+ var _useState = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(false),
33150
+ _useState2 = slicedToArray_default()(_useState, 2),
33151
+ isOverflow = _useState2[0],
33152
+ setIsOverflow = _useState2[1];
33153
+ (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useLayoutEffect)(function () {
33154
+ if (contentRef.current && max !== undefined) {
33155
+ setIsOverflow(contentRef.current.offsetWidth > 150);
33156
+ }
33157
+ }, [max, dataItem]);
33158
+ var breadcrumbClasses = jssStyle === null || jssStyle === void 0 || (_jssStyle$breadcrumb = jssStyle.breadcrumb) === null || _jssStyle$breadcrumb === void 0 ? void 0 : _jssStyle$breadcrumb.call(jssStyle);
33159
+ var contentClass = classnames_default()(breadcrumbClasses.content, isOverflow && (breadcrumbClasses === null || breadcrumbClasses === void 0 ? void 0 : breadcrumbClasses.contentMaxWidth));
33160
+ var d = dataItem;
33161
+ var item = d.title;
33162
+ if (! /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().isValidElement(item)) {
33163
+ if (d.onClick || d.url) {
33164
+ var props = {
33165
+ onClick: d.onClick
33166
+ };
33167
+ if (d.url) props.href = d.url;
33168
+ item = /*#__PURE__*/(0,jsx_runtime.jsxs)("a", objectSpread2_default()(objectSpread2_default()({}, props), {}, {
33169
+ className: contentClass,
33170
+ role: "button",
33171
+ ref: contentRef,
33172
+ children: [d.icon, d.icon && d.title && /*#__PURE__*/(0,jsx_runtime.jsx)(jsx_runtime.Fragment, {
33173
+ children: "\xA0"
33174
+ }), d.title]
33175
+ }));
33176
+ } else {
33177
+ item = /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
33178
+ className: contentClass,
33179
+ ref: contentRef,
33180
+ children: [d.icon, d.icon && d.title && /*#__PURE__*/(0,jsx_runtime.jsx)(jsx_runtime.Fragment, {
33181
+ children: "\xA0"
33182
+ }), d.title]
33183
+ });
33184
+ }
33185
+ }
33186
+ if (renderItem) {
33187
+ return renderItem(dataItem);
33188
+ }
33189
+ if (isOverflow && d.title && max !== undefined) {
33190
+ return /*#__PURE__*/(0,jsx_runtime.jsx)(src_tooltip_tooltip, {
33191
+ jssStyle: jssStyle,
33192
+ type: "light",
33193
+ tip: d.title,
33194
+ children: item
33195
+ });
33196
+ }
33197
+ return item;
33198
+ };
33199
+ /* harmony default export */ var breadcrumb_item = (BreadcrumbItem);
32957
33200
  ;// CONCATENATED MODULE: ../base/src/breadcrumb/breadcrumb.tsx
32958
33201
 
32959
33202
 
@@ -32964,6 +33207,7 @@ var List = function List(props) {
32964
33207
 
32965
33208
 
32966
33209
 
33210
+
32967
33211
  var breadcrumb_getKey = getKey;
32968
33212
  var Breadcrumb = function Breadcrumb(props) {
32969
33213
  var _props$jssStyle, _props$jssStyle$bread;
@@ -32974,32 +33218,14 @@ var Breadcrumb = function Breadcrumb(props) {
32974
33218
  _props$maxHeight = props.maxHeight,
32975
33219
  maxHeight = _props$maxHeight === void 0 ? '50vh' : _props$maxHeight;
32976
33220
  var breadcrumbClasses = (_props$jssStyle = props.jssStyle) === null || _props$jssStyle === void 0 || (_props$jssStyle$bread = _props$jssStyle.breadcrumb) === null || _props$jssStyle$bread === void 0 ? void 0 : _props$jssStyle$bread.call(_props$jssStyle);
33221
+ var maxCount = props.max ? Math.max(2, props.max) : undefined;
32977
33222
  var renderItem = function renderItem(dataItem) {
32978
- var d = dataItem;
32979
- var item = d.title;
32980
- if (! /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().isValidElement(item)) {
32981
- if (d.onClick || d.url) {
32982
- var _props = {
32983
- onClick: d.onClick
32984
- };
32985
- if (d.url) _props.href = d.url;
32986
- item = /*#__PURE__*/(0,jsx_runtime.jsxs)("a", objectSpread2_default()(objectSpread2_default()({}, _props), {}, {
32987
- className: breadcrumbClasses === null || breadcrumbClasses === void 0 ? void 0 : breadcrumbClasses.content,
32988
- role: "button",
32989
- children: [d.icon, d.icon && d.title && /*#__PURE__*/(0,jsx_runtime.jsx)(jsx_runtime.Fragment, {
32990
- children: "\xA0"
32991
- }), d.title]
32992
- }));
32993
- } else {
32994
- item = /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
32995
- className: breadcrumbClasses === null || breadcrumbClasses === void 0 ? void 0 : breadcrumbClasses.content,
32996
- children: [d.icon, d.icon && d.title && /*#__PURE__*/(0,jsx_runtime.jsx)(jsx_runtime.Fragment, {
32997
- children: "\xA0"
32998
- }), d.title]
32999
- });
33000
- }
33001
- }
33002
- return props.renderItem ? props.renderItem(dataItem) : item;
33223
+ return /*#__PURE__*/(0,jsx_runtime.jsx)(breadcrumb_item, {
33224
+ dataItem: dataItem,
33225
+ renderItem: props.renderItem,
33226
+ jssStyle: props.jssStyle,
33227
+ max: maxCount
33228
+ });
33003
33229
  };
33004
33230
  var renderArray = function renderArray(data) {
33005
33231
  return /*#__PURE__*/(0,jsx_runtime.jsx)(breadcrumb_list, {
@@ -33011,14 +33237,27 @@ var Breadcrumb = function Breadcrumb(props) {
33011
33237
  };
33012
33238
  var className = classnames_default()(breadcrumbClasses === null || breadcrumbClasses === void 0 ? void 0 : breadcrumbClasses.rootClass, breadcrumbClasses === null || breadcrumbClasses === void 0 ? void 0 : breadcrumbClasses.wrapper, props.className);
33013
33239
  var getRenderData = function getRenderData() {
33014
- if (!props.max) return data;
33015
- if (data.length <= props.max) return data;
33240
+ if (!maxCount) return data;
33241
+ if (data.length <= maxCount) return data;
33016
33242
  var first = data[0];
33017
- var reset = data.slice(data.length - props.max + 1);
33243
+ var sliceIndex = data.length - maxCount + 1;
33244
+ var reset = data.slice(sliceIndex);
33245
+ var moreData = data.slice(1, sliceIndex);
33246
+ var moreClassName = classnames_default()(props.className, breadcrumbClasses.wrapperPopover);
33018
33247
  var more = {
33019
- title: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
33248
+ title: /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
33020
33249
  className: classnames_default()(breadcrumbClasses === null || breadcrumbClasses === void 0 ? void 0 : breadcrumbClasses.content, breadcrumbClasses === null || breadcrumbClasses === void 0 ? void 0 : breadcrumbClasses.ellipsis),
33021
- children: "..."
33250
+ children: ["...", /*#__PURE__*/(0,jsx_runtime.jsx)(src_popover_popover, {
33251
+ jssStyle: props.jssStyle,
33252
+ useTextStyle: true,
33253
+ offset: [8, 0],
33254
+ popupGap: -4,
33255
+ children: /*#__PURE__*/(0,jsx_runtime.jsx)(Breadcrumb, objectSpread2_default()(objectSpread2_default()({}, props), {}, {
33256
+ className: moreClassName,
33257
+ data: moreData,
33258
+ max: undefined
33259
+ }))
33260
+ })]
33022
33261
  })
33023
33262
  };
33024
33263
  return [first, more].concat(toConsumableArray_default()(reset));
@@ -33028,10 +33267,15 @@ var Breadcrumb = function Breadcrumb(props) {
33028
33267
  style: props.style,
33029
33268
  children: data && getRenderData().map(function (d, index) {
33030
33269
  var itemFirst = Array.isArray(d) ? d[0] : d;
33031
- var isLastItem = index === (props.max !== undefined ? props.max : data.length - 1);
33270
+ var isLastItem = index === (maxCount !== undefined ? maxCount : data.length - 1);
33032
33271
  return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
33033
33272
  className: breadcrumbClasses === null || breadcrumbClasses === void 0 ? void 0 : breadcrumbClasses.item,
33034
- children: [Array.isArray(d) ? renderArray(d) : renderItem(d), !isLastItem && /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
33273
+ children: [Array.isArray(d) ? renderArray(d) : /*#__PURE__*/(0,jsx_runtime.jsx)(breadcrumb_item, {
33274
+ dataItem: d,
33275
+ renderItem: renderItem,
33276
+ jssStyle: props.jssStyle,
33277
+ max: maxCount
33278
+ }), !isLastItem && /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
33035
33279
  className: breadcrumbClasses === null || breadcrumbClasses === void 0 ? void 0 : breadcrumbClasses.separator,
33036
33280
  children: separator
33037
33281
  })]
@@ -33048,7 +33292,8 @@ var Breadcrumb = function Breadcrumb(props) {
33048
33292
 
33049
33293
  var breadcrumb_jssStyle = {
33050
33294
  breadcrumb: useBreadcrumbStyle,
33051
- popover: usePopoverStyle
33295
+ popover: usePopoverStyle,
33296
+ tooltip: useTooltipStyle
33052
33297
  };
33053
33298
  /* harmony default export */ var src_breadcrumb_breadcrumb_0 = (function (props) {
33054
33299
  return /*#__PURE__*/(0,jsx_runtime.jsx)(src_breadcrumb_breadcrumb, objectSpread2_default()({
@@ -51188,156 +51433,6 @@ var UseFormItem = function UseFormItem() {
51188
51433
  };
51189
51434
  };
51190
51435
  /* harmony default export */ var use_form_item = (UseFormItem);
51191
- ;// CONCATENATED MODULE: ../base/src/tooltip/tooltip.tsx
51192
-
51193
-
51194
-
51195
-
51196
-
51197
-
51198
-
51199
-
51200
-
51201
-
51202
- var tooltip_devUseWarning = devUseWarning;
51203
- var defaultDelay = 0;
51204
- var Tooltip = function Tooltip(props) {
51205
- var _jssStyle$tooltip, _config$tooltip;
51206
- var _props$trigger = props.trigger,
51207
- trigger = _props$trigger === void 0 ? 'hover' : _props$trigger,
51208
- priorityDirection = props.priorityDirection,
51209
- children = props.children,
51210
- tip = props.tip,
51211
- disabledChild = props.disabledChild,
51212
- jssStyle = props.jssStyle,
51213
- className = props.className,
51214
- style = props.style,
51215
- zIndex = props.zIndex,
51216
- _props$showArrow = props.showArrow,
51217
- showArrow = _props$showArrow === void 0 ? true : _props$showArrow,
51218
- persistentProp = props.persistent,
51219
- _props$type = props.type,
51220
- type = _props$type === void 0 ? 'default' : _props$type,
51221
- _props$position = props.position,
51222
- popsitionProps = _props$position === void 0 ? 'auto' : _props$position;
51223
- var tooltipClasses = jssStyle === null || jssStyle === void 0 || (_jssStyle$tooltip = jssStyle.tooltip) === null || _jssStyle$tooltip === void 0 ? void 0 : _jssStyle$tooltip.call(jssStyle);
51224
- var config = useConfig();
51225
- var persistent = persistentProp !== null && persistentProp !== void 0 ? persistentProp : (_config$tooltip = config.tooltip) === null || _config$tooltip === void 0 ? void 0 : _config$tooltip.persistent;
51226
- var childrenProps = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.isValidElement)(children) ? children === null || children === void 0 ? void 0 : children.props : {};
51227
- var delay = props.delay || props.mouseEnterDelay || defaultDelay;
51228
- var _usePopup = use_popup({
51229
- position: popsitionProps,
51230
- trigger: trigger,
51231
- autoMode: 'popover',
51232
- priorityDirection: priorityDirection,
51233
- mouseEnterDelay: delay,
51234
- targetEvents: disabledChild ? {} : childrenProps
51235
- }),
51236
- open = _usePopup.open,
51237
- position = _usePopup.position,
51238
- getTargetProps = _usePopup.getTargetProps,
51239
- targetRef = _usePopup.targetRef,
51240
- popupRef = _usePopup.popupRef,
51241
- closePop = _usePopup.closePop;
51242
- var events = getTargetProps();
51243
- var _React$useState = external_root_React_commonjs2_react_commonjs_react_amd_react_default().useState(0),
51244
- _React$useState2 = slicedToArray_default()(_React$useState, 2),
51245
- updateKey = _React$useState2[0],
51246
- setUpdateKey = _React$useState2[1];
51247
- var handleUpdateKey = usePersistFn(function () {
51248
- setUpdateKey(function (prev) {
51249
- return (prev + 1) % 2;
51250
- });
51251
- });
51252
- var bindEvents = function bindEvents() {
51253
- var _window;
51254
- var targetEl = targetRef.current;
51255
- if (!targetEl) return;
51256
- if (events.onMouseEnter) targetEl.addEventListener('mouseenter', events.onMouseEnter);
51257
- if (events.onMouseLeave) targetEl.addEventListener('mouseleave', events.onMouseLeave);
51258
- if (events.onClick) targetEl.addEventListener('click', events.onClick);
51259
- (_window = window) === null || _window === void 0 || _window.addEventListener('resize', handleUpdateKey);
51260
- };
51261
- var unbindEvents = function unbindEvents() {
51262
- var _window2;
51263
- var targetEl = targetRef.current;
51264
- if (!targetEl) return;
51265
- var events = getTargetProps();
51266
- if (events.onMouseEnter) targetEl.removeEventListener('mouseenter', events.onMouseEnter);
51267
- if (events.onMouseLeave) targetEl.removeEventListener('mouseleave', events.onMouseLeave);
51268
- if (events.onClick) targetEl.removeEventListener('click', events.onClick);
51269
- targetEl.removeEventListener('click', closePop);
51270
- (_window2 = window) === null || _window2 === void 0 || _window2.removeEventListener('resize', handleUpdateKey);
51271
- };
51272
- (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
51273
- if (!persistent) return;
51274
- bindEvents();
51275
- return function () {
51276
- unbindEvents();
51277
- };
51278
- }, [persistent]);
51279
- if (! /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.isValidElement)(children)) {
51280
- tooltip_devUseWarning.error('Tooltip children expect a single ReactElement.');
51281
- return null;
51282
- }
51283
- if (!tip) return children;
51284
- var inner = disabledChild ? /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
51285
- className: tooltipClasses === null || tooltipClasses === void 0 ? void 0 : tooltipClasses.target,
51286
- style: {
51287
- cursor: 'not-allowed'
51288
- },
51289
- children: /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.cloneElement)(children, {
51290
- style: objectSpread2_default()(objectSpread2_default()({}, childrenProps.style), {}, {
51291
- pointerEvents: 'none'
51292
- })
51293
- })
51294
- }) : children;
51295
- return /*#__PURE__*/(0,jsx_runtime.jsxs)(jsx_runtime.Fragment, {
51296
- children: [/*#__PURE__*/(0,jsx_runtime.jsx)("noscript", {
51297
- ref: function ref(el) {
51298
- if (!el) return;
51299
- var targetEl = el.nextElementSibling;
51300
- if (!targetEl) return;
51301
- if (targetRef.current === targetEl) return;
51302
- targetRef.current = targetEl;
51303
- }
51304
- }, 'ns'), /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.cloneElement)(inner, events), /*#__PURE__*/(0,jsx_runtime.jsx)(absolute_list, {
51305
- focus: open,
51306
- parentElRef: targetRef,
51307
- popupElRef: popupRef,
51308
- absolute: true,
51309
- position: position,
51310
- fixedWidth: false,
51311
- popupGap: 0,
51312
- zIndex: zIndex,
51313
- adjust: popsitionProps === 'auto',
51314
- updateKey: updateKey,
51315
- children: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", objectSpread2_default()(objectSpread2_default()({
51316
- className: classnames_default()(className, tooltipClasses === null || tooltipClasses === void 0 ? void 0 : tooltipClasses.rootClass, tooltipClasses === null || tooltipClasses === void 0 ? void 0 : tooltipClasses.wrapper, open && (tooltipClasses === null || tooltipClasses === void 0 ? void 0 : tooltipClasses.wrapperOpen)),
51317
- style: {
51318
- pointerEvents: persistent ? 'initial' : undefined
51319
- }
51320
- }, getDataAttribute({
51321
- type: type,
51322
- position: position
51323
- })), {}, {
51324
- ref: popupRef,
51325
- onMouseLeave: events.onMouseLeave,
51326
- dir: config.direction,
51327
- children: [showArrow && /*#__PURE__*/(0,jsx_runtime.jsx)("span", objectSpread2_default()({
51328
- className: tooltipClasses === null || tooltipClasses === void 0 ? void 0 : tooltipClasses.arrow
51329
- }, getDataAttribute({
51330
- role: 'arrow'
51331
- }))), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
51332
- style: style,
51333
- className: classnames_default()(tooltipClasses === null || tooltipClasses === void 0 ? void 0 : tooltipClasses.content),
51334
- children: tip
51335
- })]
51336
- }))
51337
- })]
51338
- });
51339
- };
51340
- /* harmony default export */ var src_tooltip_tooltip = (Tooltip);
51341
51436
  ;// CONCATENATED MODULE: ../base/src/form/form-item.tsx
51342
51437
 
51343
51438
 
@@ -71669,7 +71764,7 @@ var upload_interface = __webpack_require__(8821);
71669
71764
 
71670
71765
 
71671
71766
  /* harmony default export */ var src_0 = ({
71672
- version: '3.7.6-beta.2'
71767
+ version: '3.7.6-beta.3'
71673
71768
  });
71674
71769
  }();
71675
71770
  /******/ return __webpack_exports__;