shineout 3.4.2 → 3.4.3-beta.10
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 +1 -1
- package/cjs/tree/interface.d.ts +1 -0
- package/dist/shineout.js +284 -211
- package/dist/shineout.js.map +1 -1
- package/dist/shineout.min.js +1 -1
- package/dist/shineout.min.js.map +1 -1
- package/esm/index.js +1 -1
- package/esm/tree/interface.d.ts +1 -0
- package/package.json +5 -5
package/dist/shineout.js
CHANGED
|
@@ -4431,13 +4431,6 @@ const figma = [
|
|
|
4431
4431
|
token: 'Radius-1000',
|
|
4432
4432
|
locked: true,
|
|
4433
4433
|
},
|
|
4434
|
-
{
|
|
4435
|
-
name: '50%/radius',
|
|
4436
|
-
value: '50%',
|
|
4437
|
-
describe: '50% 全圆角',
|
|
4438
|
-
token: 'Radius-50%',
|
|
4439
|
-
locked: true,
|
|
4440
|
-
},
|
|
4441
4434
|
{
|
|
4442
4435
|
name: '基础阴影',
|
|
4443
4436
|
value: '0px 2px 5px rgba(2, 11, 24, 0.1)',
|
|
@@ -11991,7 +11984,7 @@ var handleStyle = function handleStyle(style) {
|
|
|
11991
11984
|
};
|
|
11992
11985
|
/* harmony default export */ var jss_style_handleStyle = (handleStyle);
|
|
11993
11986
|
;// CONCATENATED MODULE: ../shineout-style/src/version.ts
|
|
11994
|
-
/* harmony default export */ var version = ('3.4.
|
|
11987
|
+
/* harmony default export */ var version = ('3.4.3-beta.10');
|
|
11995
11988
|
;// CONCATENATED MODULE: ../shineout-style/src/jss-style/index.tsx
|
|
11996
11989
|
|
|
11997
11990
|
|
|
@@ -12357,7 +12350,6 @@ var Token = {
|
|
|
12357
12350
|
'Radius-8': '8px',
|
|
12358
12351
|
'Radius-12': '12px',
|
|
12359
12352
|
'Radius-1000': '1000px',
|
|
12360
|
-
'Radius-50%': '50%',
|
|
12361
12353
|
'Shadow-1': '0px 2px 5px rgba(2, 11, 24, 0.1)',
|
|
12362
12354
|
'Shadow-2': '0px 4px 10px rgba(2, 11, 24, 0.1)',
|
|
12363
12355
|
'Shadow-3': '0px 8px 20px rgba(2, 11, 24, 0.1)',
|
|
@@ -20673,8 +20665,10 @@ var messageStyle = objectSpread2_default()(objectSpread2_default()({}, message_a
|
|
|
20673
20665
|
position: 'fixed',
|
|
20674
20666
|
zIndex: 1060,
|
|
20675
20667
|
maxWidth: '50%',
|
|
20676
|
-
'@media screen and (max-width: 992px)
|
|
20677
|
-
'
|
|
20668
|
+
'@media screen and (max-width: 992px)': {
|
|
20669
|
+
'&': {
|
|
20670
|
+
maxWidth: 'none'
|
|
20671
|
+
}
|
|
20678
20672
|
},
|
|
20679
20673
|
margin: 'auto',
|
|
20680
20674
|
'&[data-soui-position="top"]': {
|
|
@@ -22445,9 +22439,6 @@ var selectStyle = objectSpread2_default()(objectSpread2_default()({
|
|
|
22445
22439
|
marginBottom: src.selectPlaceholderMarginY
|
|
22446
22440
|
},
|
|
22447
22441
|
multiple: {
|
|
22448
|
-
'& $optionInner': {
|
|
22449
|
-
paddingRight: src.selectOptionInnerPaddingRight
|
|
22450
|
-
},
|
|
22451
22442
|
'& $compressedWrapper': {
|
|
22452
22443
|
flexWrap: 'nowrap'
|
|
22453
22444
|
},
|
|
@@ -22459,6 +22450,11 @@ var selectStyle = objectSpread2_default()(objectSpread2_default()({
|
|
|
22459
22450
|
multipleCompressedWrapper: {
|
|
22460
22451
|
flexWrap: 'nowrap'
|
|
22461
22452
|
},
|
|
22453
|
+
multipleList: {
|
|
22454
|
+
'& $optionInner': {
|
|
22455
|
+
paddingRight: src.selectOptionInnerPaddingRight
|
|
22456
|
+
}
|
|
22457
|
+
},
|
|
22462
22458
|
loading: {
|
|
22463
22459
|
padding: 10,
|
|
22464
22460
|
display: 'flex',
|
|
@@ -28131,7 +28127,6 @@ var Badge = function Badge(props) {
|
|
|
28131
28127
|
color = props.color,
|
|
28132
28128
|
text = props.text;
|
|
28133
28129
|
var badgeStyle = (jssStyle === null || jssStyle === void 0 || (_jssStyle$badge = jssStyle.badge) === null || _jssStyle$badge === void 0 ? void 0 : _jssStyle$badge.call(jssStyle)) || {};
|
|
28134
|
-
console.log('children', children);
|
|
28135
28130
|
var isTextBadge = text !== undefined || dot && children === undefined;
|
|
28136
28131
|
var rootClass = classnames_default()(className, badgeStyle.badge, isTextBadge && badgeStyle.textBadge);
|
|
28137
28132
|
var isOverflowCount = overflowCount !== undefined && Number(count) > overflowCount;
|
|
@@ -28766,6 +28761,201 @@ function isInDocument(element) {
|
|
|
28766
28761
|
}
|
|
28767
28762
|
return is_isBrowser() && document.documentElement.contains(element);
|
|
28768
28763
|
}
|
|
28764
|
+
;// CONCATENATED MODULE: ../hooks/src/utils/func.ts
|
|
28765
|
+
// 节流函数
|
|
28766
|
+
var throttle = function throttle(func, wait) {
|
|
28767
|
+
var that = {
|
|
28768
|
+
lock: false
|
|
28769
|
+
};
|
|
28770
|
+
if (!wait) return function () {
|
|
28771
|
+
if (that.lock) return;
|
|
28772
|
+
that.lock = true;
|
|
28773
|
+
func.apply(void 0, arguments);
|
|
28774
|
+
setTimeout(function () {
|
|
28775
|
+
that.lock = false;
|
|
28776
|
+
}, wait);
|
|
28777
|
+
};
|
|
28778
|
+
};
|
|
28779
|
+
|
|
28780
|
+
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
28781
|
+
var debounce = function debounce(func, delay) {
|
|
28782
|
+
var that = {};
|
|
28783
|
+
var cleanTimer = function cleanTimer() {
|
|
28784
|
+
if (that.timer) {
|
|
28785
|
+
clearTimeout(that.timer);
|
|
28786
|
+
that.timer = null;
|
|
28787
|
+
}
|
|
28788
|
+
};
|
|
28789
|
+
if (!delay) return [func, cleanTimer];
|
|
28790
|
+
return [function () {
|
|
28791
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
28792
|
+
args[_key] = arguments[_key];
|
|
28793
|
+
}
|
|
28794
|
+
cleanTimer();
|
|
28795
|
+
that.timer = setTimeout(function () {
|
|
28796
|
+
func.apply(void 0, args);
|
|
28797
|
+
}, delay);
|
|
28798
|
+
}, cleanTimer];
|
|
28799
|
+
};
|
|
28800
|
+
;// CONCATENATED MODULE: ../hooks/src/utils/dom/element.tsx
|
|
28801
|
+
|
|
28802
|
+
var _this = undefined;
|
|
28803
|
+
|
|
28804
|
+
|
|
28805
|
+
|
|
28806
|
+
|
|
28807
|
+
/**
|
|
28808
|
+
* 判断是否是两个中文字符
|
|
28809
|
+
*
|
|
28810
|
+
* @param str 文本内容
|
|
28811
|
+
* @returns boolean
|
|
28812
|
+
*/
|
|
28813
|
+
|
|
28814
|
+
var isTwoCNChar = function isTwoCNChar(str) {
|
|
28815
|
+
return /^[\u4e00-\u9fa5]{2}$/.test(str);
|
|
28816
|
+
};
|
|
28817
|
+
var SPACE = ' ';
|
|
28818
|
+
|
|
28819
|
+
/**
|
|
28820
|
+
* 处理文本内容,如果是两个中文字符,插入空格
|
|
28821
|
+
*
|
|
28822
|
+
* @param children ReactNode
|
|
28823
|
+
* @param insertSpace 是否需要插入空格
|
|
28824
|
+
* @returns 处理后的 ReactNode
|
|
28825
|
+
*/
|
|
28826
|
+
function wrapSpan(children) {
|
|
28827
|
+
var insertSpace = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
28828
|
+
var className = arguments.length > 2 ? arguments[2] : undefined;
|
|
28829
|
+
if (!children) return children;
|
|
28830
|
+
return external_root_React_commonjs2_react_commonjs_react_amd_react_default().Children.map(children, function (item) {
|
|
28831
|
+
if (typeof item === 'string') {
|
|
28832
|
+
if (insertSpace && isTwoCNChar(item)) return /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
28833
|
+
children: item.split('').join(SPACE)
|
|
28834
|
+
});
|
|
28835
|
+
return /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
28836
|
+
className: className,
|
|
28837
|
+
children: item
|
|
28838
|
+
});
|
|
28839
|
+
}
|
|
28840
|
+
return item;
|
|
28841
|
+
});
|
|
28842
|
+
}
|
|
28843
|
+
var addResizeObserver = function addResizeObserver(el, handler) {
|
|
28844
|
+
var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
28845
|
+
var direction = options.direction,
|
|
28846
|
+
timer = options.timer;
|
|
28847
|
+
var _debounce = debounce(handler, timer),
|
|
28848
|
+
_debounce2 = slicedToArray_default()(_debounce, 2),
|
|
28849
|
+
debounceHandler = _debounce2[0],
|
|
28850
|
+
cleanTimer = _debounce2[1];
|
|
28851
|
+
var h = debounceHandler;
|
|
28852
|
+
var lastWidth;
|
|
28853
|
+
var lastHeight;
|
|
28854
|
+
if (window.ResizeObserver) {
|
|
28855
|
+
if (direction) {
|
|
28856
|
+
lastWidth = el.clientWidth;
|
|
28857
|
+
lastHeight = el.clientHeight;
|
|
28858
|
+
h = function h(entry) {
|
|
28859
|
+
var _entry$0$contentRect = entry[0].contentRect,
|
|
28860
|
+
width = _entry$0$contentRect.width,
|
|
28861
|
+
height = _entry$0$contentRect.height;
|
|
28862
|
+
if (width && direction === 'x') {
|
|
28863
|
+
if (lastWidth !== width) {
|
|
28864
|
+
debounceHandler(entry);
|
|
28865
|
+
}
|
|
28866
|
+
} else if (direction === 'y') {
|
|
28867
|
+
if (height && lastHeight !== height) {
|
|
28868
|
+
debounceHandler(entry);
|
|
28869
|
+
}
|
|
28870
|
+
} else if (lastWidth !== width || lastHeight !== height) {
|
|
28871
|
+
debounceHandler(entry, {
|
|
28872
|
+
x: lastWidth !== width,
|
|
28873
|
+
y: lastHeight !== height
|
|
28874
|
+
});
|
|
28875
|
+
}
|
|
28876
|
+
lastWidth = width;
|
|
28877
|
+
lastHeight = height;
|
|
28878
|
+
};
|
|
28879
|
+
}
|
|
28880
|
+
var observer = new ResizeObserver(h);
|
|
28881
|
+
observer.observe(el);
|
|
28882
|
+
return function () {
|
|
28883
|
+
if (observer) {
|
|
28884
|
+
observer.disconnect();
|
|
28885
|
+
}
|
|
28886
|
+
cleanTimer(_this);
|
|
28887
|
+
observer = null;
|
|
28888
|
+
};
|
|
28889
|
+
}
|
|
28890
|
+
window.addEventListener('resize', debounceHandler);
|
|
28891
|
+
return function () {
|
|
28892
|
+
window.removeEventListener('resize', handler);
|
|
28893
|
+
cleanTimer();
|
|
28894
|
+
};
|
|
28895
|
+
};
|
|
28896
|
+
function getParent(el, target) {
|
|
28897
|
+
if (!target) {
|
|
28898
|
+
return null;
|
|
28899
|
+
}
|
|
28900
|
+
var temp = el;
|
|
28901
|
+
while (temp) {
|
|
28902
|
+
if (typeof target === 'string') {
|
|
28903
|
+
if (temp.matches && temp.matches(target)) {
|
|
28904
|
+
return temp;
|
|
28905
|
+
}
|
|
28906
|
+
} else if (temp === target) {
|
|
28907
|
+
return temp;
|
|
28908
|
+
}
|
|
28909
|
+
temp = temp.parentElement;
|
|
28910
|
+
}
|
|
28911
|
+
return null;
|
|
28912
|
+
}
|
|
28913
|
+
function getClosestScrollContainer(element) {
|
|
28914
|
+
if (!element) {
|
|
28915
|
+
return null;
|
|
28916
|
+
}
|
|
28917
|
+
|
|
28918
|
+
// 检查元素是否可滚动
|
|
28919
|
+
var isScrollable = function isScrollable(el) {
|
|
28920
|
+
var style = window.getComputedStyle(el);
|
|
28921
|
+
var overflowX = style.overflowX;
|
|
28922
|
+
var overflowY = style.overflowY;
|
|
28923
|
+
return (overflowX === 'auto' || overflowX === 'scroll' || overflowY === 'auto' || overflowY === 'scroll') && (el.scrollHeight > el.clientHeight || el.scrollWidth > el.clientWidth);
|
|
28924
|
+
};
|
|
28925
|
+
|
|
28926
|
+
// 如果元素本身是可滚动的,直接返回
|
|
28927
|
+
if (isScrollable(element)) {
|
|
28928
|
+
return element;
|
|
28929
|
+
}
|
|
28930
|
+
|
|
28931
|
+
// 遍历父元素
|
|
28932
|
+
var parent = element.parentElement;
|
|
28933
|
+
while (parent) {
|
|
28934
|
+
if (isScrollable(parent)) {
|
|
28935
|
+
return parent;
|
|
28936
|
+
}
|
|
28937
|
+
parent = parent.parentElement;
|
|
28938
|
+
}
|
|
28939
|
+
|
|
28940
|
+
// 如果没有找到可滚动的祖先,返回 body 或 documentElement
|
|
28941
|
+
return document.scrollingElement || document.documentElement;
|
|
28942
|
+
}
|
|
28943
|
+
function cssSupport(attr, value) {
|
|
28944
|
+
if (is_isBrowser()) {
|
|
28945
|
+
var element = document.createElement('div');
|
|
28946
|
+
if (attr in element.style) {
|
|
28947
|
+
if (attr !== 'length' && attr !== 'parentRule') {
|
|
28948
|
+
var attrs = element.style[attr];
|
|
28949
|
+
element.style[attr] = value;
|
|
28950
|
+
}
|
|
28951
|
+
return element.style[attr] === value;
|
|
28952
|
+
}
|
|
28953
|
+
}
|
|
28954
|
+
return false;
|
|
28955
|
+
}
|
|
28956
|
+
var parsePxToNumber = function parsePxToNumber(str) {
|
|
28957
|
+
return Number(str.replace(/\s+|px/gi, ''));
|
|
28958
|
+
};
|
|
28769
28959
|
;// CONCATENATED MODULE: ../hooks/src/common/use-position-style/index.ts
|
|
28770
28960
|
|
|
28771
28961
|
|
|
@@ -28773,6 +28963,7 @@ function isInDocument(element) {
|
|
|
28773
28963
|
|
|
28774
28964
|
|
|
28775
28965
|
|
|
28966
|
+
|
|
28776
28967
|
var horizontalPosition = ['left-bottom', 'left-top', 'right-bottom', 'right-top', 'left', 'right'];
|
|
28777
28968
|
var verticalPosition = ['bottom-left', 'bottom-right', 'top-left', 'top-right', 'bottom', 'top'];
|
|
28778
28969
|
var hideStyle = {
|
|
@@ -28891,6 +29082,7 @@ var usePositionStyle = function usePositionStyle(config) {
|
|
|
28891
29082
|
}
|
|
28892
29083
|
var targetPosition = position;
|
|
28893
29084
|
var rootContainer = getContainer() || document.body;
|
|
29085
|
+
var closestScrollContainer = getClosestScrollContainer(parentElRef.current);
|
|
28894
29086
|
var containerRect = rootContainer.getBoundingClientRect();
|
|
28895
29087
|
var bodyRect = (document.documentElement || document.body).getBoundingClientRect();
|
|
28896
29088
|
var containerScrollBarWidth = rootContainer.offsetWidth - rootContainer.clientWidth;
|
|
@@ -28909,7 +29101,7 @@ var usePositionStyle = function usePositionStyle(config) {
|
|
|
28909
29101
|
var overRight = 0;
|
|
28910
29102
|
var overLeft = 0;
|
|
28911
29103
|
if (h === 'left') {
|
|
28912
|
-
style.left = rect.left - containerRect.left + containerScroll.left;
|
|
29104
|
+
style.left = rect.left - containerRect.left + containerScroll.left + ((closestScrollContainer === null || closestScrollContainer === void 0 ? void 0 : closestScrollContainer.scrollLeft) || 0);
|
|
28913
29105
|
style.transform = '';
|
|
28914
29106
|
arrayStyle.left = "8px";
|
|
28915
29107
|
if (adjust) {
|
|
@@ -30030,10 +30222,8 @@ var usePopup = function usePopup(props) {
|
|
|
30030
30222
|
var updatePosition = use_persist_fn(function () {
|
|
30031
30223
|
// if (isPositionControl) return;
|
|
30032
30224
|
// if (props.position === 'auto' || !props.position) {
|
|
30033
|
-
|
|
30034
|
-
|
|
30035
|
-
if (newPosition !== position) setPositionState(newPosition);
|
|
30036
|
-
}, 10);
|
|
30225
|
+
var newPosition = getPosition(targetRef.current, props.priorityDirection, autoMode, popupRef.current || undefined);
|
|
30226
|
+
if (newPosition !== position) setPositionState(newPosition);
|
|
30037
30227
|
});
|
|
30038
30228
|
(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
|
|
30039
30229
|
if (props.open) {
|
|
@@ -30373,171 +30563,6 @@ function extractEventHandlers(object) {
|
|
|
30373
30563
|
});
|
|
30374
30564
|
return result;
|
|
30375
30565
|
}
|
|
30376
|
-
;// CONCATENATED MODULE: ../hooks/src/utils/func.ts
|
|
30377
|
-
// 节流函数
|
|
30378
|
-
var throttle = function throttle(func, wait) {
|
|
30379
|
-
var that = {
|
|
30380
|
-
lock: false
|
|
30381
|
-
};
|
|
30382
|
-
if (!wait) return function () {
|
|
30383
|
-
if (that.lock) return;
|
|
30384
|
-
that.lock = true;
|
|
30385
|
-
func.apply(void 0, arguments);
|
|
30386
|
-
setTimeout(function () {
|
|
30387
|
-
that.lock = false;
|
|
30388
|
-
}, wait);
|
|
30389
|
-
};
|
|
30390
|
-
};
|
|
30391
|
-
|
|
30392
|
-
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
30393
|
-
var debounce = function debounce(func, delay) {
|
|
30394
|
-
var that = {};
|
|
30395
|
-
var cleanTimer = function cleanTimer() {
|
|
30396
|
-
if (that.timer) {
|
|
30397
|
-
clearTimeout(that.timer);
|
|
30398
|
-
that.timer = null;
|
|
30399
|
-
}
|
|
30400
|
-
};
|
|
30401
|
-
if (!delay) return [func, cleanTimer];
|
|
30402
|
-
return [function () {
|
|
30403
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
30404
|
-
args[_key] = arguments[_key];
|
|
30405
|
-
}
|
|
30406
|
-
cleanTimer();
|
|
30407
|
-
that.timer = setTimeout(function () {
|
|
30408
|
-
func.apply(void 0, args);
|
|
30409
|
-
}, delay);
|
|
30410
|
-
}, cleanTimer];
|
|
30411
|
-
};
|
|
30412
|
-
;// CONCATENATED MODULE: ../hooks/src/utils/dom/element.tsx
|
|
30413
|
-
|
|
30414
|
-
var _this = undefined;
|
|
30415
|
-
|
|
30416
|
-
|
|
30417
|
-
|
|
30418
|
-
|
|
30419
|
-
/**
|
|
30420
|
-
* 判断是否是两个中文字符
|
|
30421
|
-
*
|
|
30422
|
-
* @param str 文本内容
|
|
30423
|
-
* @returns boolean
|
|
30424
|
-
*/
|
|
30425
|
-
|
|
30426
|
-
var isTwoCNChar = function isTwoCNChar(str) {
|
|
30427
|
-
return /^[\u4e00-\u9fa5]{2}$/.test(str);
|
|
30428
|
-
};
|
|
30429
|
-
var SPACE = ' ';
|
|
30430
|
-
|
|
30431
|
-
/**
|
|
30432
|
-
* 处理文本内容,如果是两个中文字符,插入空格
|
|
30433
|
-
*
|
|
30434
|
-
* @param children ReactNode
|
|
30435
|
-
* @param insertSpace 是否需要插入空格
|
|
30436
|
-
* @returns 处理后的 ReactNode
|
|
30437
|
-
*/
|
|
30438
|
-
function wrapSpan(children) {
|
|
30439
|
-
var insertSpace = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
30440
|
-
var className = arguments.length > 2 ? arguments[2] : undefined;
|
|
30441
|
-
if (!children) return children;
|
|
30442
|
-
return external_root_React_commonjs2_react_commonjs_react_amd_react_default().Children.map(children, function (item) {
|
|
30443
|
-
if (typeof item === 'string') {
|
|
30444
|
-
if (insertSpace && isTwoCNChar(item)) return /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
30445
|
-
children: item.split('').join(SPACE)
|
|
30446
|
-
});
|
|
30447
|
-
return /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
30448
|
-
className: className,
|
|
30449
|
-
children: item
|
|
30450
|
-
});
|
|
30451
|
-
}
|
|
30452
|
-
return item;
|
|
30453
|
-
});
|
|
30454
|
-
}
|
|
30455
|
-
var addResizeObserver = function addResizeObserver(el, handler) {
|
|
30456
|
-
var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
30457
|
-
var direction = options.direction,
|
|
30458
|
-
timer = options.timer;
|
|
30459
|
-
var _debounce = debounce(handler, timer),
|
|
30460
|
-
_debounce2 = slicedToArray_default()(_debounce, 2),
|
|
30461
|
-
debounceHandler = _debounce2[0],
|
|
30462
|
-
cleanTimer = _debounce2[1];
|
|
30463
|
-
var h = debounceHandler;
|
|
30464
|
-
var lastWidth;
|
|
30465
|
-
var lastHeight;
|
|
30466
|
-
if (window.ResizeObserver) {
|
|
30467
|
-
if (direction) {
|
|
30468
|
-
lastWidth = el.clientWidth;
|
|
30469
|
-
lastHeight = el.clientHeight;
|
|
30470
|
-
h = function h(entry) {
|
|
30471
|
-
var _entry$0$contentRect = entry[0].contentRect,
|
|
30472
|
-
width = _entry$0$contentRect.width,
|
|
30473
|
-
height = _entry$0$contentRect.height;
|
|
30474
|
-
if (width && direction === 'x') {
|
|
30475
|
-
if (lastWidth !== width) {
|
|
30476
|
-
debounceHandler(entry);
|
|
30477
|
-
}
|
|
30478
|
-
} else if (direction === 'y') {
|
|
30479
|
-
if (height && lastHeight !== height) {
|
|
30480
|
-
debounceHandler(entry);
|
|
30481
|
-
}
|
|
30482
|
-
} else if (lastWidth !== width || lastHeight !== height) {
|
|
30483
|
-
debounceHandler(entry, {
|
|
30484
|
-
x: lastWidth !== width,
|
|
30485
|
-
y: lastHeight !== height
|
|
30486
|
-
});
|
|
30487
|
-
}
|
|
30488
|
-
lastWidth = width;
|
|
30489
|
-
lastHeight = height;
|
|
30490
|
-
};
|
|
30491
|
-
}
|
|
30492
|
-
var observer = new ResizeObserver(h);
|
|
30493
|
-
observer.observe(el);
|
|
30494
|
-
return function () {
|
|
30495
|
-
if (observer) {
|
|
30496
|
-
observer.disconnect();
|
|
30497
|
-
}
|
|
30498
|
-
cleanTimer(_this);
|
|
30499
|
-
observer = null;
|
|
30500
|
-
};
|
|
30501
|
-
}
|
|
30502
|
-
window.addEventListener('resize', debounceHandler);
|
|
30503
|
-
return function () {
|
|
30504
|
-
window.removeEventListener('resize', handler);
|
|
30505
|
-
cleanTimer();
|
|
30506
|
-
};
|
|
30507
|
-
};
|
|
30508
|
-
function getParent(el, target) {
|
|
30509
|
-
if (!target) {
|
|
30510
|
-
return null;
|
|
30511
|
-
}
|
|
30512
|
-
var temp = el;
|
|
30513
|
-
while (temp) {
|
|
30514
|
-
if (typeof target === 'string') {
|
|
30515
|
-
if (temp.matches && temp.matches(target)) {
|
|
30516
|
-
return temp;
|
|
30517
|
-
}
|
|
30518
|
-
} else if (temp === target) {
|
|
30519
|
-
return temp;
|
|
30520
|
-
}
|
|
30521
|
-
temp = temp.parentElement;
|
|
30522
|
-
}
|
|
30523
|
-
return null;
|
|
30524
|
-
}
|
|
30525
|
-
function cssSupport(attr, value) {
|
|
30526
|
-
if (is_isBrowser()) {
|
|
30527
|
-
var element = document.createElement('div');
|
|
30528
|
-
if (attr in element.style) {
|
|
30529
|
-
if (attr !== 'length' && attr !== 'parentRule') {
|
|
30530
|
-
var attrs = element.style[attr];
|
|
30531
|
-
element.style[attr] = value;
|
|
30532
|
-
}
|
|
30533
|
-
return element.style[attr] === value;
|
|
30534
|
-
}
|
|
30535
|
-
}
|
|
30536
|
-
return false;
|
|
30537
|
-
}
|
|
30538
|
-
var parsePxToNumber = function parsePxToNumber(str) {
|
|
30539
|
-
return Number(str.replace(/\s+|px/gi, ''));
|
|
30540
|
-
};
|
|
30541
30566
|
;// CONCATENATED MODULE: ../hooks/src/components/use-button/use-button.ts
|
|
30542
30567
|
|
|
30543
30568
|
|
|
@@ -32520,23 +32545,25 @@ var groupContext = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_
|
|
|
32520
32545
|
|
|
32521
32546
|
|
|
32522
32547
|
var useCheckboxInputable = function useCheckboxInputable(props) {
|
|
32523
|
-
var
|
|
32524
|
-
var _useState = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(
|
|
32548
|
+
var _props$checked;
|
|
32549
|
+
var _useState = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(undefined),
|
|
32525
32550
|
_useState2 = slicedToArray_default()(_useState, 2),
|
|
32526
32551
|
checkedState = _useState2[0],
|
|
32527
32552
|
setCheckedState = _useState2[1];
|
|
32528
|
-
|
|
32553
|
+
(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
|
|
32554
|
+
setCheckedState(!!props.value);
|
|
32555
|
+
}, [props.value]);
|
|
32529
32556
|
var onInputableCheckboxChange = function onInputableCheckboxChange(c) {
|
|
32530
32557
|
var _props$onChange;
|
|
32531
32558
|
setCheckedState(c);
|
|
32532
32559
|
props === null || props === void 0 || (_props$onChange = props.onChange) === null || _props$onChange === void 0 || _props$onChange.call(props, undefined, c, undefined);
|
|
32533
32560
|
};
|
|
32534
|
-
var onInputChange = function onInputChange(
|
|
32561
|
+
var onInputChange = function onInputChange(_value) {
|
|
32535
32562
|
var _props$onChange2;
|
|
32536
|
-
props === null || props === void 0 || (_props$onChange2 = props.onChange) === null || _props$onChange2 === void 0 || _props$onChange2.call(props,
|
|
32563
|
+
props === null || props === void 0 || (_props$onChange2 = props.onChange) === null || _props$onChange2 === void 0 || _props$onChange2.call(props, _value, true, undefined);
|
|
32537
32564
|
};
|
|
32538
32565
|
return {
|
|
32539
|
-
checked: checked,
|
|
32566
|
+
checked: (_props$checked = props.checked) !== null && _props$checked !== void 0 ? _props$checked : checkedState,
|
|
32540
32567
|
onInputableCheckboxChange: onInputableCheckboxChange,
|
|
32541
32568
|
onInputChange: onInputChange
|
|
32542
32569
|
};
|
|
@@ -33969,6 +33996,11 @@ var checkbox_Checkbox = function Checkbox(props) {
|
|
|
33969
33996
|
onInputableCheckboxChange(checked);
|
|
33970
33997
|
return;
|
|
33971
33998
|
}
|
|
33999
|
+
|
|
34000
|
+
// 兼容Checkbox在createPortal中使用时,无法改变勾选状态的问题
|
|
34001
|
+
if ('value' in props && props.checked === undefined) {
|
|
34002
|
+
onInputableCheckboxChange(checked);
|
|
34003
|
+
}
|
|
33972
34004
|
onChange === null || onChange === void 0 || onChange(checked ? htmlValue : undefined, checked, htmlValue);
|
|
33973
34005
|
});
|
|
33974
34006
|
var getChecked = function getChecked() {
|
|
@@ -35934,14 +35966,15 @@ var useTree = function useTree(props) {
|
|
|
35934
35966
|
});
|
|
35935
35967
|
|
|
35936
35968
|
// 注册节点
|
|
35937
|
-
var bindNode = function bindNode(id, update) {
|
|
35969
|
+
var bindNode = function bindNode(id, update, item) {
|
|
35938
35970
|
context.updateMap.set(id, update);
|
|
35939
35971
|
var isActive = activeProp === id;
|
|
35940
35972
|
var expandeds = expanded;
|
|
35941
35973
|
if (defaultExpandAll) {
|
|
35974
|
+
var shouldDefaultExpand = defaultExpandAll && isArray(item[childrenKey]) && item[childrenKey].length > 0;
|
|
35942
35975
|
return {
|
|
35943
35976
|
active: isActive,
|
|
35944
|
-
expanded:
|
|
35977
|
+
expanded: shouldDefaultExpand
|
|
35945
35978
|
};
|
|
35946
35979
|
}
|
|
35947
35980
|
return {
|
|
@@ -39414,9 +39447,13 @@ var checkbox_group_Group = function Group(props0) {
|
|
|
39414
39447
|
var providerValue = {
|
|
39415
39448
|
checked: isChecked,
|
|
39416
39449
|
onChange: handleItemChange,
|
|
39417
|
-
disabled: disabled,
|
|
39418
39450
|
size: size
|
|
39419
39451
|
};
|
|
39452
|
+
|
|
39453
|
+
// 没有 disabled 无需透传,否则会影响下层 disabled 覆盖优先级
|
|
39454
|
+
if ('disabled' in props0) {
|
|
39455
|
+
providerValue.disabled = disabled;
|
|
39456
|
+
}
|
|
39420
39457
|
var groupClass = classnames_default()(className, checkboxStyle === null || checkboxStyle === void 0 ? void 0 : checkboxStyle.group, !!block && (checkboxStyle === null || checkboxStyle === void 0 ? void 0 : checkboxStyle.groupBlock));
|
|
39421
39458
|
if (props.data === undefined) {
|
|
39422
39459
|
return /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
@@ -41577,11 +41614,9 @@ var useTime = function useTime(props) {
|
|
|
41577
41614
|
|
|
41578
41615
|
|
|
41579
41616
|
|
|
41580
|
-
var link_excluded = ["jssStyle", "className", "type", "underline", "disabled", "size", "icon", "href", "
|
|
41581
|
-
// import { } from '@sheinx/hooks';
|
|
41617
|
+
var link_excluded = ["jssStyle", "className", "type", "underline", "disabled", "size", "icon", "href", "children"];
|
|
41582
41618
|
|
|
41583
41619
|
|
|
41584
|
-
// import from icons
|
|
41585
41620
|
|
|
41586
41621
|
|
|
41587
41622
|
|
|
@@ -41596,16 +41631,38 @@ var Link = function Link(props) {
|
|
|
41596
41631
|
size = props.size,
|
|
41597
41632
|
icon = props.icon,
|
|
41598
41633
|
href = props.href,
|
|
41599
|
-
target = props.target,
|
|
41600
41634
|
children = props.children,
|
|
41601
41635
|
restProps = objectWithoutProperties_default()(props, link_excluded);
|
|
41602
41636
|
var linkClasses = (jssStyle === null || jssStyle === void 0 || (_jssStyle$link = jssStyle.link) === null || _jssStyle$link === void 0 ? void 0 : _jssStyle$link.call(jssStyle)) || {};
|
|
41603
41637
|
var rootClass = classnames_default()(className, linkClasses.wrapper, defineProperty_default()(defineProperty_default()(defineProperty_default()(defineProperty_default()(defineProperty_default()(defineProperty_default()(defineProperty_default()(defineProperty_default()(defineProperty_default()(defineProperty_default()({}, linkClasses.underline, underline === true), linkClasses.underlineHover, underline === 'hover'), linkClasses.disabled, disabled), linkClasses.sizeSmall, size === 'small'), linkClasses.sizeLarge, size === 'large'), linkClasses.primary, type === 'primary'), linkClasses.secondary, type === 'secondary'), linkClasses.danger, type === 'danger'), linkClasses.warning, type === 'warning'), linkClasses.success, type === 'success'));
|
|
41638
|
+
var handleClick = function handleClick(e) {
|
|
41639
|
+
if (disabled) {
|
|
41640
|
+
e.preventDefault();
|
|
41641
|
+
e.stopPropagation();
|
|
41642
|
+
} else {
|
|
41643
|
+
var _props$onClick;
|
|
41644
|
+
(_props$onClick = props.onClick) === null || _props$onClick === void 0 || _props$onClick.call(props, e);
|
|
41645
|
+
}
|
|
41646
|
+
};
|
|
41647
|
+
var handleKeyDown = function handleKeyDown(e) {
|
|
41648
|
+
if (e.key === 'Enter' && !disabled) {
|
|
41649
|
+
var _props$onClick2;
|
|
41650
|
+
(_props$onClick2 = props.onClick) === null || _props$onClick2 === void 0 || _props$onClick2.call(props, e);
|
|
41651
|
+
} else if (disabled) {
|
|
41652
|
+
e.preventDefault();
|
|
41653
|
+
e.stopPropagation();
|
|
41654
|
+
} else {
|
|
41655
|
+
var _props$onKeyDown;
|
|
41656
|
+
(_props$onKeyDown = props.onKeyDown) === null || _props$onKeyDown === void 0 || _props$onKeyDown.call(props, e);
|
|
41657
|
+
}
|
|
41658
|
+
};
|
|
41604
41659
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("a", objectSpread2_default()(objectSpread2_default()({
|
|
41605
41660
|
href: disabled ? undefined : href,
|
|
41606
|
-
|
|
41607
|
-
|
|
41661
|
+
className: rootClass,
|
|
41662
|
+
"aria-disabled": disabled
|
|
41608
41663
|
}, restProps), {}, {
|
|
41664
|
+
onClick: handleClick,
|
|
41665
|
+
onKeyDown: handleKeyDown,
|
|
41609
41666
|
children: [typeof icon === 'boolean' && icon && /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
41610
41667
|
className: linkClasses.icon,
|
|
41611
41668
|
children: icons_config.link.prefixIcon
|
|
@@ -47332,7 +47389,7 @@ var useImage = function useImage() {
|
|
|
47332
47389
|
});
|
|
47333
47390
|
}
|
|
47334
47391
|
}
|
|
47335
|
-
}, []);
|
|
47392
|
+
}, [src]);
|
|
47336
47393
|
return {
|
|
47337
47394
|
src: src,
|
|
47338
47395
|
alt: alt,
|
|
@@ -48037,7 +48094,8 @@ var Image = function Image(props) {
|
|
|
48037
48094
|
title = props.title,
|
|
48038
48095
|
style = props.style,
|
|
48039
48096
|
error = props.error,
|
|
48040
|
-
target = props.target,
|
|
48097
|
+
_props$target = props.target,
|
|
48098
|
+
target = _props$target === void 0 ? '_modal' : _props$target,
|
|
48041
48099
|
jssStyle = props.jssStyle,
|
|
48042
48100
|
className = props.className,
|
|
48043
48101
|
placeholder = props.placeholder,
|
|
@@ -48305,11 +48363,19 @@ var input_input_Input = function Input(props) {
|
|
|
48305
48363
|
size = _useWithFormConfig.size,
|
|
48306
48364
|
disabled = _useWithFormConfig.disabled,
|
|
48307
48365
|
status = _useWithFormConfig.status,
|
|
48308
|
-
error = _useWithFormConfig.error
|
|
48366
|
+
error = _useWithFormConfig.error,
|
|
48367
|
+
onBlur = _useWithFormConfig.onBlur;
|
|
48309
48368
|
var getProps = function getProps(child) {
|
|
48369
|
+
var onChildBlur = function onChildBlur(e) {
|
|
48370
|
+
var childBlurEvent = child.props.onBlur;
|
|
48371
|
+
if (childBlurEvent) {
|
|
48372
|
+
childBlurEvent(e);
|
|
48373
|
+
}
|
|
48374
|
+
onBlur === null || onBlur === void 0 || onBlur(e);
|
|
48375
|
+
};
|
|
48310
48376
|
ref.current.propsMap.set(child, {
|
|
48311
48377
|
onFocus: child.props.onFocus,
|
|
48312
|
-
onBlur:
|
|
48378
|
+
onBlur: onChildBlur
|
|
48313
48379
|
});
|
|
48314
48380
|
if (!ref.current.eventMap.get(child)) {
|
|
48315
48381
|
ref.current.eventMap.set(child, {
|
|
@@ -49378,6 +49444,7 @@ var useSelect = function useSelect(props) {
|
|
|
49378
49444
|
value: value,
|
|
49379
49445
|
multiple: multiple,
|
|
49380
49446
|
disabled: disabled,
|
|
49447
|
+
// TODO: 类型定义需要修改
|
|
49381
49448
|
onChange: onChange,
|
|
49382
49449
|
prediction: prediction,
|
|
49383
49450
|
keepCache: !noCache
|
|
@@ -49552,7 +49619,7 @@ var list_List = function List(props) {
|
|
|
49552
49619
|
onOptionClick = props.onOptionClick;
|
|
49553
49620
|
var dynamicVirtual = lineHeightProp === 'auto';
|
|
49554
49621
|
var styles = jssStyle === null || jssStyle === void 0 || (_jssStyle$select = jssStyle.select) === null || _jssStyle$select === void 0 ? void 0 : _jssStyle$select.call(jssStyle);
|
|
49555
|
-
var rootClass = classnames_default()(styles.list, defineProperty_default()(defineProperty_default()(defineProperty_default()({}, styles.controlMouse, controlType === 'mouse'), styles.controlKeyboard, controlType === 'keyboard'), styles.dynamicList, dynamicVirtual));
|
|
49622
|
+
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));
|
|
49556
49623
|
var _useState = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(hideCreateOption ? -1 : 0),
|
|
49557
49624
|
_useState2 = slicedToArray_default()(_useState, 2),
|
|
49558
49625
|
hoverIndex = _useState2[0],
|
|
@@ -50025,7 +50092,7 @@ var useTreeNode = function useTreeNode(props) {
|
|
|
50025
50092
|
return true;
|
|
50026
50093
|
};
|
|
50027
50094
|
(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
|
|
50028
|
-
var _bindNode = bindNode(id, update),
|
|
50095
|
+
var _bindNode = bindNode(id, update, data),
|
|
50029
50096
|
active = _bindNode.active,
|
|
50030
50097
|
nextExpanded = _bindNode.expanded;
|
|
50031
50098
|
setActive(active);
|
|
@@ -50352,6 +50419,7 @@ var tree_list_List = function List(props) {
|
|
|
50352
50419
|
childrenKey = props.childrenKey,
|
|
50353
50420
|
inlineNode = props.inlineNode,
|
|
50354
50421
|
highlight = props.highlight,
|
|
50422
|
+
defaultExpandAll = props.defaultExpandAll,
|
|
50355
50423
|
loader = props.loader,
|
|
50356
50424
|
onNodeClick = props.onNodeClick,
|
|
50357
50425
|
onToggle = props.onToggle,
|
|
@@ -50389,6 +50457,7 @@ var tree_list_List = function List(props) {
|
|
|
50389
50457
|
line: line,
|
|
50390
50458
|
keygen: keygen,
|
|
50391
50459
|
listComponent: List,
|
|
50460
|
+
defaultExpandAll: defaultExpandAll,
|
|
50392
50461
|
isControlled: isControlled,
|
|
50393
50462
|
mode: mode,
|
|
50394
50463
|
active: active,
|
|
@@ -50565,15 +50634,17 @@ var Tree = function Tree(props) {
|
|
|
50565
50634
|
update('expanded', tempExpandMap.has(id));
|
|
50566
50635
|
});
|
|
50567
50636
|
};
|
|
50568
|
-
var handleUpdateActive = function handleUpdateActive(active) {
|
|
50637
|
+
var handleUpdateActive = function handleUpdateActive(active, item) {
|
|
50569
50638
|
setActive(active);
|
|
50570
|
-
|
|
50639
|
+
if (active !== props.active) {
|
|
50640
|
+
propSetActive === null || propSetActive === void 0 || propSetActive(active, item);
|
|
50641
|
+
}
|
|
50571
50642
|
datum.updateMap.forEach(function (update, id) {
|
|
50572
50643
|
update('active', id === active);
|
|
50573
50644
|
});
|
|
50574
50645
|
};
|
|
50575
50646
|
var handleNodeClick = function handleNodeClick(node, id) {
|
|
50576
|
-
handleUpdateActive(id);
|
|
50647
|
+
handleUpdateActive(id, node);
|
|
50577
50648
|
if (onClick) {
|
|
50578
50649
|
onClick(node, id, datum.getPath(id));
|
|
50579
50650
|
}
|
|
@@ -50681,6 +50752,7 @@ var Tree = function Tree(props) {
|
|
|
50681
50752
|
contentClass: contentClass,
|
|
50682
50753
|
expanded: expanded,
|
|
50683
50754
|
expandIcons: expandIcons,
|
|
50755
|
+
defaultExpandAll: defaultExpandAll,
|
|
50684
50756
|
childrenClass: isFunc(childrenClass) ? childrenClass : function () {
|
|
50685
50757
|
return childrenClass;
|
|
50686
50758
|
},
|
|
@@ -52540,6 +52612,7 @@ var list_list_List = function List(props) {
|
|
|
52540
52612
|
format: props.format,
|
|
52541
52613
|
prediction: props.prediction,
|
|
52542
52614
|
disabled: props.disabled,
|
|
52615
|
+
// TODO: 类型定义需要修改
|
|
52543
52616
|
onChange: inputAble.onChange
|
|
52544
52617
|
});
|
|
52545
52618
|
var columnData = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo)(function () {
|
|
@@ -59459,7 +59532,7 @@ var TabsHeader = function TabsHeader(props) {
|
|
|
59459
59532
|
});
|
|
59460
59533
|
var currentTabRect = currentTab === null || currentTab === void 0 || (_currentTab$getBoundi = currentTab.getBoundingClientRect) === null || _currentTab$getBoundi === void 0 ? void 0 : _currentTab$getBoundi.call(currentTab);
|
|
59461
59534
|
setCurrentTabRect(currentTabRect);
|
|
59462
|
-
}, [active]);
|
|
59535
|
+
}, [active, tabs]);
|
|
59463
59536
|
var renderHeaderScrollBar = function renderHeaderScrollBar() {
|
|
59464
59537
|
if (shape !== 'line' && shape !== 'dash') return;
|
|
59465
59538
|
if (!currentTabRect) return;
|
|
@@ -65120,7 +65193,7 @@ var upload_interface = __webpack_require__(8821);
|
|
|
65120
65193
|
|
|
65121
65194
|
|
|
65122
65195
|
/* harmony default export */ var src_0 = ({
|
|
65123
|
-
version: '3.4.
|
|
65196
|
+
version: '3.4.3-beta.10'
|
|
65124
65197
|
});
|
|
65125
65198
|
}();
|
|
65126
65199
|
/******/ return __webpack_exports__;
|