shineout 3.7.6-beta.1 → 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.1'
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.1');
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()({
@@ -39992,6 +40237,7 @@ var VirtualList = function VirtualList(props) {
39992
40237
 
39993
40238
 
39994
40239
 
40240
+
39995
40241
  function getHighlightText(_ref) {
39996
40242
  var nodeList = _ref.nodeList,
39997
40243
  searchWords = _ref.searchWords,
@@ -40000,22 +40246,31 @@ function getHighlightText(_ref) {
40000
40246
  if (!enable || !searchWords) {
40001
40247
  return nodeList;
40002
40248
  }
40003
- var transformNode = function transformNode(node) {
40004
- var _node$props;
40005
- if (node && typeof ((_node$props = node.props) === null || _node$props === void 0 ? void 0 : _node$props.children) === 'string') {
40006
- return /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.cloneElement)(node, undefined, /*#__PURE__*/(0,jsx_runtime.jsx)(HighlightText, {
40007
- textToHighlight: node.props.children,
40249
+
40250
+ // 递归转换节点
40251
+ var transformNode = function transformNode(node, index) {
40252
+ // 如果是合法的 React 元素
40253
+ if ( /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().isValidElement(node) && node.props && node.props.children) {
40254
+ // 对 children 递归调用 getHighlightText 进行转换
40255
+ var transformedChildren = getHighlightText({
40256
+ nodeList: node.props.children,
40008
40257
  searchWords: searchWords,
40009
- highlightClassName: highlightClassName
40010
- }));
40258
+ highlightClassName: highlightClassName,
40259
+ enable: enable
40260
+ });
40261
+ return /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.cloneElement)(node, objectSpread2_default()(objectSpread2_default()({}, node.props), {}, {
40262
+ key: index
40263
+ }), transformedChildren);
40011
40264
  }
40012
- if (node && typeof node === 'string') {
40265
+ // 如果节点为字符串,则直接高亮替换
40266
+ if (typeof node === 'string') {
40013
40267
  return /*#__PURE__*/(0,jsx_runtime.jsx)(HighlightText, {
40014
40268
  textToHighlight: node,
40015
40269
  searchWords: searchWords,
40016
40270
  highlightClassName: highlightClassName
40017
40271
  });
40018
40272
  }
40273
+ // 其他情况直接返回原节点
40019
40274
  return node;
40020
40275
  };
40021
40276
  return isArray(nodeList) ? nodeList.map(transformNode) : transformNode(nodeList);
@@ -40031,8 +40286,7 @@ function HighlightText(_ref2) {
40031
40286
  searchWords = searchWords.slice(0, 500);
40032
40287
  }
40033
40288
 
40034
- // 注意这里的括号,这里使用了带capture group功能的正则,来split字符串
40035
- // 从而在strArr中可以保留匹配文本
40289
+ // capture group 的正则用于 split 保留匹配文本
40036
40290
  var re = new RegExp("(".concat(escapeRegExp(searchWords), ")"), 'i');
40037
40291
  var strArr = textToHighlight.split(re);
40038
40292
  return /*#__PURE__*/(0,jsx_runtime.jsx)(jsx_runtime.Fragment, {
@@ -51179,156 +51433,6 @@ var UseFormItem = function UseFormItem() {
51179
51433
  };
51180
51434
  };
51181
51435
  /* harmony default export */ var use_form_item = (UseFormItem);
51182
- ;// CONCATENATED MODULE: ../base/src/tooltip/tooltip.tsx
51183
-
51184
-
51185
-
51186
-
51187
-
51188
-
51189
-
51190
-
51191
-
51192
-
51193
- var tooltip_devUseWarning = devUseWarning;
51194
- var defaultDelay = 0;
51195
- var Tooltip = function Tooltip(props) {
51196
- var _jssStyle$tooltip, _config$tooltip;
51197
- var _props$trigger = props.trigger,
51198
- trigger = _props$trigger === void 0 ? 'hover' : _props$trigger,
51199
- priorityDirection = props.priorityDirection,
51200
- children = props.children,
51201
- tip = props.tip,
51202
- disabledChild = props.disabledChild,
51203
- jssStyle = props.jssStyle,
51204
- className = props.className,
51205
- style = props.style,
51206
- zIndex = props.zIndex,
51207
- _props$showArrow = props.showArrow,
51208
- showArrow = _props$showArrow === void 0 ? true : _props$showArrow,
51209
- persistentProp = props.persistent,
51210
- _props$type = props.type,
51211
- type = _props$type === void 0 ? 'default' : _props$type,
51212
- _props$position = props.position,
51213
- popsitionProps = _props$position === void 0 ? 'auto' : _props$position;
51214
- var tooltipClasses = jssStyle === null || jssStyle === void 0 || (_jssStyle$tooltip = jssStyle.tooltip) === null || _jssStyle$tooltip === void 0 ? void 0 : _jssStyle$tooltip.call(jssStyle);
51215
- var config = useConfig();
51216
- var persistent = persistentProp !== null && persistentProp !== void 0 ? persistentProp : (_config$tooltip = config.tooltip) === null || _config$tooltip === void 0 ? void 0 : _config$tooltip.persistent;
51217
- var childrenProps = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.isValidElement)(children) ? children === null || children === void 0 ? void 0 : children.props : {};
51218
- var delay = props.delay || props.mouseEnterDelay || defaultDelay;
51219
- var _usePopup = use_popup({
51220
- position: popsitionProps,
51221
- trigger: trigger,
51222
- autoMode: 'popover',
51223
- priorityDirection: priorityDirection,
51224
- mouseEnterDelay: delay,
51225
- targetEvents: disabledChild ? {} : childrenProps
51226
- }),
51227
- open = _usePopup.open,
51228
- position = _usePopup.position,
51229
- getTargetProps = _usePopup.getTargetProps,
51230
- targetRef = _usePopup.targetRef,
51231
- popupRef = _usePopup.popupRef,
51232
- closePop = _usePopup.closePop;
51233
- var events = getTargetProps();
51234
- var _React$useState = external_root_React_commonjs2_react_commonjs_react_amd_react_default().useState(0),
51235
- _React$useState2 = slicedToArray_default()(_React$useState, 2),
51236
- updateKey = _React$useState2[0],
51237
- setUpdateKey = _React$useState2[1];
51238
- var handleUpdateKey = usePersistFn(function () {
51239
- setUpdateKey(function (prev) {
51240
- return (prev + 1) % 2;
51241
- });
51242
- });
51243
- var bindEvents = function bindEvents() {
51244
- var _window;
51245
- var targetEl = targetRef.current;
51246
- if (!targetEl) return;
51247
- if (events.onMouseEnter) targetEl.addEventListener('mouseenter', events.onMouseEnter);
51248
- if (events.onMouseLeave) targetEl.addEventListener('mouseleave', events.onMouseLeave);
51249
- if (events.onClick) targetEl.addEventListener('click', events.onClick);
51250
- (_window = window) === null || _window === void 0 || _window.addEventListener('resize', handleUpdateKey);
51251
- };
51252
- var unbindEvents = function unbindEvents() {
51253
- var _window2;
51254
- var targetEl = targetRef.current;
51255
- if (!targetEl) return;
51256
- var events = getTargetProps();
51257
- if (events.onMouseEnter) targetEl.removeEventListener('mouseenter', events.onMouseEnter);
51258
- if (events.onMouseLeave) targetEl.removeEventListener('mouseleave', events.onMouseLeave);
51259
- if (events.onClick) targetEl.removeEventListener('click', events.onClick);
51260
- targetEl.removeEventListener('click', closePop);
51261
- (_window2 = window) === null || _window2 === void 0 || _window2.removeEventListener('resize', handleUpdateKey);
51262
- };
51263
- (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
51264
- if (!persistent) return;
51265
- bindEvents();
51266
- return function () {
51267
- unbindEvents();
51268
- };
51269
- }, [persistent]);
51270
- if (! /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.isValidElement)(children)) {
51271
- tooltip_devUseWarning.error('Tooltip children expect a single ReactElement.');
51272
- return null;
51273
- }
51274
- if (!tip) return children;
51275
- var inner = disabledChild ? /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
51276
- className: tooltipClasses === null || tooltipClasses === void 0 ? void 0 : tooltipClasses.target,
51277
- style: {
51278
- cursor: 'not-allowed'
51279
- },
51280
- children: /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.cloneElement)(children, {
51281
- style: objectSpread2_default()(objectSpread2_default()({}, childrenProps.style), {}, {
51282
- pointerEvents: 'none'
51283
- })
51284
- })
51285
- }) : children;
51286
- return /*#__PURE__*/(0,jsx_runtime.jsxs)(jsx_runtime.Fragment, {
51287
- children: [/*#__PURE__*/(0,jsx_runtime.jsx)("noscript", {
51288
- ref: function ref(el) {
51289
- if (!el) return;
51290
- var targetEl = el.nextElementSibling;
51291
- if (!targetEl) return;
51292
- if (targetRef.current === targetEl) return;
51293
- targetRef.current = targetEl;
51294
- }
51295
- }, 'ns'), /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.cloneElement)(inner, events), /*#__PURE__*/(0,jsx_runtime.jsx)(absolute_list, {
51296
- focus: open,
51297
- parentElRef: targetRef,
51298
- popupElRef: popupRef,
51299
- absolute: true,
51300
- position: position,
51301
- fixedWidth: false,
51302
- popupGap: 0,
51303
- zIndex: zIndex,
51304
- adjust: popsitionProps === 'auto',
51305
- updateKey: updateKey,
51306
- children: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", objectSpread2_default()(objectSpread2_default()({
51307
- 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)),
51308
- style: {
51309
- pointerEvents: persistent ? 'initial' : undefined
51310
- }
51311
- }, getDataAttribute({
51312
- type: type,
51313
- position: position
51314
- })), {}, {
51315
- ref: popupRef,
51316
- onMouseLeave: events.onMouseLeave,
51317
- dir: config.direction,
51318
- children: [showArrow && /*#__PURE__*/(0,jsx_runtime.jsx)("span", objectSpread2_default()({
51319
- className: tooltipClasses === null || tooltipClasses === void 0 ? void 0 : tooltipClasses.arrow
51320
- }, getDataAttribute({
51321
- role: 'arrow'
51322
- }))), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
51323
- style: style,
51324
- className: classnames_default()(tooltipClasses === null || tooltipClasses === void 0 ? void 0 : tooltipClasses.content),
51325
- children: tip
51326
- })]
51327
- }))
51328
- })]
51329
- });
51330
- };
51331
- /* harmony default export */ var src_tooltip_tooltip = (Tooltip);
51332
51436
  ;// CONCATENATED MODULE: ../base/src/form/form-item.tsx
51333
51437
 
51334
51438
 
@@ -71660,7 +71764,7 @@ var upload_interface = __webpack_require__(8821);
71660
71764
 
71661
71765
 
71662
71766
  /* harmony default export */ var src_0 = ({
71663
- version: '3.7.6-beta.1'
71767
+ version: '3.7.6-beta.3'
71664
71768
  });
71665
71769
  }();
71666
71770
  /******/ return __webpack_exports__;