shineout 3.4.3-beta.4 → 3.4.3-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
@@ -492,5 +492,5 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
492
492
  // 此文件由脚本自动生成,请勿直接修改。
493
493
  // This file was generated automatically by a script. Please do not modify it directly.
494
494
  var _default = exports.default = {
495
- version: '3.4.3-beta.4'
495
+ version: '3.4.3-beta.6'
496
496
  };
package/dist/shineout.js CHANGED
@@ -11984,7 +11984,7 @@ var handleStyle = function handleStyle(style) {
11984
11984
  };
11985
11985
  /* harmony default export */ var jss_style_handleStyle = (handleStyle);
11986
11986
  ;// CONCATENATED MODULE: ../shineout-style/src/version.ts
11987
- /* harmony default export */ var version = ('3.4.3-beta.4');
11987
+ /* harmony default export */ var version = ('3.4.3-beta.6');
11988
11988
  ;// CONCATENATED MODULE: ../shineout-style/src/jss-style/index.tsx
11989
11989
 
11990
11990
 
@@ -20665,8 +20665,10 @@ var messageStyle = objectSpread2_default()(objectSpread2_default()({}, message_a
20665
20665
  position: 'fixed',
20666
20666
  zIndex: 1060,
20667
20667
  maxWidth: '50%',
20668
- '@media screen and (max-width: 992px) &': {
20669
- 'max-width': 'none'
20668
+ '@media screen and (max-width: 992px)': {
20669
+ '&': {
20670
+ maxWidth: 'none'
20671
+ }
20670
20672
  },
20671
20673
  margin: 'auto',
20672
20674
  '&[data-soui-position="top"]': {
@@ -22437,9 +22439,6 @@ var selectStyle = objectSpread2_default()(objectSpread2_default()({
22437
22439
  marginBottom: src.selectPlaceholderMarginY
22438
22440
  },
22439
22441
  multiple: {
22440
- '& $optionInner': {
22441
- paddingRight: src.selectOptionInnerPaddingRight
22442
- },
22443
22442
  '& $compressedWrapper': {
22444
22443
  flexWrap: 'nowrap'
22445
22444
  },
@@ -22451,6 +22450,11 @@ var selectStyle = objectSpread2_default()(objectSpread2_default()({
22451
22450
  multipleCompressedWrapper: {
22452
22451
  flexWrap: 'nowrap'
22453
22452
  },
22453
+ multipleList: {
22454
+ '& $optionInner': {
22455
+ paddingRight: src.selectOptionInnerPaddingRight
22456
+ }
22457
+ },
22454
22458
  loading: {
22455
22459
  padding: 10,
22456
22460
  display: 'flex',
@@ -28758,6 +28762,201 @@ function isInDocument(element) {
28758
28762
  }
28759
28763
  return is_isBrowser() && document.documentElement.contains(element);
28760
28764
  }
28765
+ ;// CONCATENATED MODULE: ../hooks/src/utils/func.ts
28766
+ // 节流函数
28767
+ var throttle = function throttle(func, wait) {
28768
+ var that = {
28769
+ lock: false
28770
+ };
28771
+ if (!wait) return function () {
28772
+ if (that.lock) return;
28773
+ that.lock = true;
28774
+ func.apply(void 0, arguments);
28775
+ setTimeout(function () {
28776
+ that.lock = false;
28777
+ }, wait);
28778
+ };
28779
+ };
28780
+
28781
+ // eslint-disable-next-line @typescript-eslint/ban-types
28782
+ var debounce = function debounce(func, delay) {
28783
+ var that = {};
28784
+ var cleanTimer = function cleanTimer() {
28785
+ if (that.timer) {
28786
+ clearTimeout(that.timer);
28787
+ that.timer = null;
28788
+ }
28789
+ };
28790
+ if (!delay) return [func, cleanTimer];
28791
+ return [function () {
28792
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
28793
+ args[_key] = arguments[_key];
28794
+ }
28795
+ cleanTimer();
28796
+ that.timer = setTimeout(function () {
28797
+ func.apply(void 0, args);
28798
+ }, delay);
28799
+ }, cleanTimer];
28800
+ };
28801
+ ;// CONCATENATED MODULE: ../hooks/src/utils/dom/element.tsx
28802
+
28803
+ var _this = undefined;
28804
+
28805
+
28806
+
28807
+
28808
+ /**
28809
+ * 判断是否是两个中文字符
28810
+ *
28811
+ * @param str 文本内容
28812
+ * @returns boolean
28813
+ */
28814
+
28815
+ var isTwoCNChar = function isTwoCNChar(str) {
28816
+ return /^[\u4e00-\u9fa5]{2}$/.test(str);
28817
+ };
28818
+ var SPACE = ' ';
28819
+
28820
+ /**
28821
+ * 处理文本内容,如果是两个中文字符,插入空格
28822
+ *
28823
+ * @param children ReactNode
28824
+ * @param insertSpace 是否需要插入空格
28825
+ * @returns 处理后的 ReactNode
28826
+ */
28827
+ function wrapSpan(children) {
28828
+ var insertSpace = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
28829
+ var className = arguments.length > 2 ? arguments[2] : undefined;
28830
+ if (!children) return children;
28831
+ return external_root_React_commonjs2_react_commonjs_react_amd_react_default().Children.map(children, function (item) {
28832
+ if (typeof item === 'string') {
28833
+ if (insertSpace && isTwoCNChar(item)) return /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
28834
+ children: item.split('').join(SPACE)
28835
+ });
28836
+ return /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
28837
+ className: className,
28838
+ children: item
28839
+ });
28840
+ }
28841
+ return item;
28842
+ });
28843
+ }
28844
+ var addResizeObserver = function addResizeObserver(el, handler) {
28845
+ var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
28846
+ var direction = options.direction,
28847
+ timer = options.timer;
28848
+ var _debounce = debounce(handler, timer),
28849
+ _debounce2 = slicedToArray_default()(_debounce, 2),
28850
+ debounceHandler = _debounce2[0],
28851
+ cleanTimer = _debounce2[1];
28852
+ var h = debounceHandler;
28853
+ var lastWidth;
28854
+ var lastHeight;
28855
+ if (window.ResizeObserver) {
28856
+ if (direction) {
28857
+ lastWidth = el.clientWidth;
28858
+ lastHeight = el.clientHeight;
28859
+ h = function h(entry) {
28860
+ var _entry$0$contentRect = entry[0].contentRect,
28861
+ width = _entry$0$contentRect.width,
28862
+ height = _entry$0$contentRect.height;
28863
+ if (width && direction === 'x') {
28864
+ if (lastWidth !== width) {
28865
+ debounceHandler(entry);
28866
+ }
28867
+ } else if (direction === 'y') {
28868
+ if (height && lastHeight !== height) {
28869
+ debounceHandler(entry);
28870
+ }
28871
+ } else if (lastWidth !== width || lastHeight !== height) {
28872
+ debounceHandler(entry, {
28873
+ x: lastWidth !== width,
28874
+ y: lastHeight !== height
28875
+ });
28876
+ }
28877
+ lastWidth = width;
28878
+ lastHeight = height;
28879
+ };
28880
+ }
28881
+ var observer = new ResizeObserver(h);
28882
+ observer.observe(el);
28883
+ return function () {
28884
+ if (observer) {
28885
+ observer.disconnect();
28886
+ }
28887
+ cleanTimer(_this);
28888
+ observer = null;
28889
+ };
28890
+ }
28891
+ window.addEventListener('resize', debounceHandler);
28892
+ return function () {
28893
+ window.removeEventListener('resize', handler);
28894
+ cleanTimer();
28895
+ };
28896
+ };
28897
+ function getParent(el, target) {
28898
+ if (!target) {
28899
+ return null;
28900
+ }
28901
+ var temp = el;
28902
+ while (temp) {
28903
+ if (typeof target === 'string') {
28904
+ if (temp.matches && temp.matches(target)) {
28905
+ return temp;
28906
+ }
28907
+ } else if (temp === target) {
28908
+ return temp;
28909
+ }
28910
+ temp = temp.parentElement;
28911
+ }
28912
+ return null;
28913
+ }
28914
+ function getClosestScrollContainer(element) {
28915
+ if (!element) {
28916
+ return null;
28917
+ }
28918
+
28919
+ // 检查元素是否可滚动
28920
+ var isScrollable = function isScrollable(el) {
28921
+ var style = window.getComputedStyle(el);
28922
+ var overflowX = style.overflowX;
28923
+ var overflowY = style.overflowY;
28924
+ return (overflowX === 'auto' || overflowX === 'scroll' || overflowY === 'auto' || overflowY === 'scroll') && (el.scrollHeight > el.clientHeight || el.scrollWidth > el.clientWidth);
28925
+ };
28926
+
28927
+ // 如果元素本身是可滚动的,直接返回
28928
+ if (isScrollable(element)) {
28929
+ return element;
28930
+ }
28931
+
28932
+ // 遍历父元素
28933
+ var parent = element.parentElement;
28934
+ while (parent) {
28935
+ if (isScrollable(parent)) {
28936
+ return parent;
28937
+ }
28938
+ parent = parent.parentElement;
28939
+ }
28940
+
28941
+ // 如果没有找到可滚动的祖先,返回 body 或 documentElement
28942
+ return document.scrollingElement || document.documentElement;
28943
+ }
28944
+ function cssSupport(attr, value) {
28945
+ if (is_isBrowser()) {
28946
+ var element = document.createElement('div');
28947
+ if (attr in element.style) {
28948
+ if (attr !== 'length' && attr !== 'parentRule') {
28949
+ var attrs = element.style[attr];
28950
+ element.style[attr] = value;
28951
+ }
28952
+ return element.style[attr] === value;
28953
+ }
28954
+ }
28955
+ return false;
28956
+ }
28957
+ var parsePxToNumber = function parsePxToNumber(str) {
28958
+ return Number(str.replace(/\s+|px/gi, ''));
28959
+ };
28761
28960
  ;// CONCATENATED MODULE: ../hooks/src/common/use-position-style/index.ts
28762
28961
 
28763
28962
 
@@ -28765,6 +28964,7 @@ function isInDocument(element) {
28765
28964
 
28766
28965
 
28767
28966
 
28967
+
28768
28968
  var horizontalPosition = ['left-bottom', 'left-top', 'right-bottom', 'right-top', 'left', 'right'];
28769
28969
  var verticalPosition = ['bottom-left', 'bottom-right', 'top-left', 'top-right', 'bottom', 'top'];
28770
28970
  var hideStyle = {
@@ -28883,6 +29083,7 @@ var usePositionStyle = function usePositionStyle(config) {
28883
29083
  }
28884
29084
  var targetPosition = position;
28885
29085
  var rootContainer = getContainer() || document.body;
29086
+ var closestScrollContainer = getClosestScrollContainer(parentElRef.current);
28886
29087
  var containerRect = rootContainer.getBoundingClientRect();
28887
29088
  var bodyRect = (document.documentElement || document.body).getBoundingClientRect();
28888
29089
  var containerScrollBarWidth = rootContainer.offsetWidth - rootContainer.clientWidth;
@@ -28901,7 +29102,7 @@ var usePositionStyle = function usePositionStyle(config) {
28901
29102
  var overRight = 0;
28902
29103
  var overLeft = 0;
28903
29104
  if (h === 'left') {
28904
- style.left = rect.left - containerRect.left + containerScroll.left;
29105
+ style.left = rect.left - containerRect.left + containerScroll.left + ((closestScrollContainer === null || closestScrollContainer === void 0 ? void 0 : closestScrollContainer.scrollLeft) || 0);
28905
29106
  style.transform = '';
28906
29107
  arrayStyle.left = "8px";
28907
29108
  if (adjust) {
@@ -29086,6 +29287,7 @@ var usePositionStyle = function usePositionStyle(config) {
29086
29287
  newStyle = _getStyle.newStyle,
29087
29288
  newArrayStyle = _getStyle.newArrayStyle;
29088
29289
  if (newStyle && !shallow_equal(style, newStyle)) {
29290
+ console.log('show, position, absolute, updateKey, fixedWidth: >>', show, position, absolute, updateKey, fixedWidth);
29089
29291
  setStyle(newStyle);
29090
29292
  setArrayStyle(newArrayStyle || {});
29091
29293
  }
@@ -30022,10 +30224,8 @@ var usePopup = function usePopup(props) {
30022
30224
  var updatePosition = use_persist_fn(function () {
30023
30225
  // if (isPositionControl) return;
30024
30226
  // if (props.position === 'auto' || !props.position) {
30025
- setTimeout(function () {
30026
- var newPosition = getPosition(targetRef.current, props.priorityDirection, autoMode, popupRef.current || undefined);
30027
- if (newPosition !== position) setPositionState(newPosition);
30028
- }, 10);
30227
+ var newPosition = getPosition(targetRef.current, props.priorityDirection, autoMode, popupRef.current || undefined);
30228
+ if (newPosition !== position) setPositionState(newPosition);
30029
30229
  });
30030
30230
  (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
30031
30231
  if (props.open) {
@@ -30365,171 +30565,6 @@ function extractEventHandlers(object) {
30365
30565
  });
30366
30566
  return result;
30367
30567
  }
30368
- ;// CONCATENATED MODULE: ../hooks/src/utils/func.ts
30369
- // 节流函数
30370
- var throttle = function throttle(func, wait) {
30371
- var that = {
30372
- lock: false
30373
- };
30374
- if (!wait) return function () {
30375
- if (that.lock) return;
30376
- that.lock = true;
30377
- func.apply(void 0, arguments);
30378
- setTimeout(function () {
30379
- that.lock = false;
30380
- }, wait);
30381
- };
30382
- };
30383
-
30384
- // eslint-disable-next-line @typescript-eslint/ban-types
30385
- var debounce = function debounce(func, delay) {
30386
- var that = {};
30387
- var cleanTimer = function cleanTimer() {
30388
- if (that.timer) {
30389
- clearTimeout(that.timer);
30390
- that.timer = null;
30391
- }
30392
- };
30393
- if (!delay) return [func, cleanTimer];
30394
- return [function () {
30395
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
30396
- args[_key] = arguments[_key];
30397
- }
30398
- cleanTimer();
30399
- that.timer = setTimeout(function () {
30400
- func.apply(void 0, args);
30401
- }, delay);
30402
- }, cleanTimer];
30403
- };
30404
- ;// CONCATENATED MODULE: ../hooks/src/utils/dom/element.tsx
30405
-
30406
- var _this = undefined;
30407
-
30408
-
30409
-
30410
-
30411
- /**
30412
- * 判断是否是两个中文字符
30413
- *
30414
- * @param str 文本内容
30415
- * @returns boolean
30416
- */
30417
-
30418
- var isTwoCNChar = function isTwoCNChar(str) {
30419
- return /^[\u4e00-\u9fa5]{2}$/.test(str);
30420
- };
30421
- var SPACE = ' ';
30422
-
30423
- /**
30424
- * 处理文本内容,如果是两个中文字符,插入空格
30425
- *
30426
- * @param children ReactNode
30427
- * @param insertSpace 是否需要插入空格
30428
- * @returns 处理后的 ReactNode
30429
- */
30430
- function wrapSpan(children) {
30431
- var insertSpace = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
30432
- var className = arguments.length > 2 ? arguments[2] : undefined;
30433
- if (!children) return children;
30434
- return external_root_React_commonjs2_react_commonjs_react_amd_react_default().Children.map(children, function (item) {
30435
- if (typeof item === 'string') {
30436
- if (insertSpace && isTwoCNChar(item)) return /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
30437
- children: item.split('').join(SPACE)
30438
- });
30439
- return /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
30440
- className: className,
30441
- children: item
30442
- });
30443
- }
30444
- return item;
30445
- });
30446
- }
30447
- var addResizeObserver = function addResizeObserver(el, handler) {
30448
- var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
30449
- var direction = options.direction,
30450
- timer = options.timer;
30451
- var _debounce = debounce(handler, timer),
30452
- _debounce2 = slicedToArray_default()(_debounce, 2),
30453
- debounceHandler = _debounce2[0],
30454
- cleanTimer = _debounce2[1];
30455
- var h = debounceHandler;
30456
- var lastWidth;
30457
- var lastHeight;
30458
- if (window.ResizeObserver) {
30459
- if (direction) {
30460
- lastWidth = el.clientWidth;
30461
- lastHeight = el.clientHeight;
30462
- h = function h(entry) {
30463
- var _entry$0$contentRect = entry[0].contentRect,
30464
- width = _entry$0$contentRect.width,
30465
- height = _entry$0$contentRect.height;
30466
- if (width && direction === 'x') {
30467
- if (lastWidth !== width) {
30468
- debounceHandler(entry);
30469
- }
30470
- } else if (direction === 'y') {
30471
- if (height && lastHeight !== height) {
30472
- debounceHandler(entry);
30473
- }
30474
- } else if (lastWidth !== width || lastHeight !== height) {
30475
- debounceHandler(entry, {
30476
- x: lastWidth !== width,
30477
- y: lastHeight !== height
30478
- });
30479
- }
30480
- lastWidth = width;
30481
- lastHeight = height;
30482
- };
30483
- }
30484
- var observer = new ResizeObserver(h);
30485
- observer.observe(el);
30486
- return function () {
30487
- if (observer) {
30488
- observer.disconnect();
30489
- }
30490
- cleanTimer(_this);
30491
- observer = null;
30492
- };
30493
- }
30494
- window.addEventListener('resize', debounceHandler);
30495
- return function () {
30496
- window.removeEventListener('resize', handler);
30497
- cleanTimer();
30498
- };
30499
- };
30500
- function getParent(el, target) {
30501
- if (!target) {
30502
- return null;
30503
- }
30504
- var temp = el;
30505
- while (temp) {
30506
- if (typeof target === 'string') {
30507
- if (temp.matches && temp.matches(target)) {
30508
- return temp;
30509
- }
30510
- } else if (temp === target) {
30511
- return temp;
30512
- }
30513
- temp = temp.parentElement;
30514
- }
30515
- return null;
30516
- }
30517
- function cssSupport(attr, value) {
30518
- if (is_isBrowser()) {
30519
- var element = document.createElement('div');
30520
- if (attr in element.style) {
30521
- if (attr !== 'length' && attr !== 'parentRule') {
30522
- var attrs = element.style[attr];
30523
- element.style[attr] = value;
30524
- }
30525
- return element.style[attr] === value;
30526
- }
30527
- }
30528
- return false;
30529
- }
30530
- var parsePxToNumber = function parsePxToNumber(str) {
30531
- return Number(str.replace(/\s+|px/gi, ''));
30532
- };
30533
30568
  ;// CONCATENATED MODULE: ../hooks/src/components/use-button/use-button.ts
30534
30569
 
30535
30570
 
@@ -49403,6 +49438,7 @@ var useSelect = function useSelect(props) {
49403
49438
  value: value,
49404
49439
  multiple: multiple,
49405
49440
  disabled: disabled,
49441
+ // TODO: 类型定义需要修改
49406
49442
  onChange: onChange,
49407
49443
  prediction: prediction,
49408
49444
  keepCache: !noCache
@@ -49577,7 +49613,7 @@ var list_List = function List(props) {
49577
49613
  onOptionClick = props.onOptionClick;
49578
49614
  var dynamicVirtual = lineHeightProp === 'auto';
49579
49615
  var styles = jssStyle === null || jssStyle === void 0 || (_jssStyle$select = jssStyle.select) === null || _jssStyle$select === void 0 ? void 0 : _jssStyle$select.call(jssStyle);
49580
- var rootClass = classnames_default()(styles.list, defineProperty_default()(defineProperty_default()(defineProperty_default()({}, styles.controlMouse, controlType === 'mouse'), styles.controlKeyboard, controlType === 'keyboard'), styles.dynamicList, dynamicVirtual));
49616
+ var rootClass = classnames_default()(styles.list, defineProperty_default()(defineProperty_default()(defineProperty_default()(defineProperty_default()({}, styles.controlMouse, controlType === 'mouse'), styles.controlKeyboard, controlType === 'keyboard'), styles.dynamicList, dynamicVirtual), styles.multipleList, multiple));
49581
49617
  var _useState = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(hideCreateOption ? -1 : 0),
49582
49618
  _useState2 = slicedToArray_default()(_useState, 2),
49583
49619
  hoverIndex = _useState2[0],
@@ -52570,6 +52606,7 @@ var list_list_List = function List(props) {
52570
52606
  format: props.format,
52571
52607
  prediction: props.prediction,
52572
52608
  disabled: props.disabled,
52609
+ // TODO: 类型定义需要修改
52573
52610
  onChange: inputAble.onChange
52574
52611
  });
52575
52612
  var columnData = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo)(function () {
@@ -65150,7 +65187,7 @@ var upload_interface = __webpack_require__(8821);
65150
65187
 
65151
65188
 
65152
65189
  /* harmony default export */ var src_0 = ({
65153
- version: '3.4.3-beta.4'
65190
+ version: '3.4.3-beta.6'
65154
65191
  });
65155
65192
  }();
65156
65193
  /******/ return __webpack_exports__;