shineout 3.5.0-beta.2 → 3.5.0-beta.4
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/cascader/interface.d.ts +1 -0
- package/cjs/index.js +1 -1
- package/cjs/list/list.js +2 -1
- package/dist/shineout.js +599 -495
- package/dist/shineout.js.map +1 -1
- package/dist/shineout.min.js +1 -1
- package/dist/shineout.min.js.map +1 -1
- package/esm/cascader/interface.d.ts +1 -0
- package/esm/index.js +1 -1
- package/esm/list/list.js +3 -2
- package/package.json +5 -5
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.5.0-beta.
|
|
11987
|
+
/* harmony default export */ var version = ('3.5.0-beta.4');
|
|
11988
11988
|
;// CONCATENATED MODULE: ../shineout-style/src/jss-style/index.tsx
|
|
11989
11989
|
|
|
11990
11990
|
|
|
@@ -17009,8 +17009,6 @@ var cascaderStyle = objectSpread2_default()(objectSpread2_default()({
|
|
|
17009
17009
|
},
|
|
17010
17010
|
hideTag: {},
|
|
17011
17011
|
list: {
|
|
17012
|
-
paddingTop: 3,
|
|
17013
|
-
paddingBottom: 3,
|
|
17014
17012
|
display: 'inline-block',
|
|
17015
17013
|
overflow: 'auto'
|
|
17016
17014
|
},
|
|
@@ -17062,6 +17060,7 @@ var cascaderStyle = objectSpread2_default()(objectSpread2_default()({
|
|
|
17062
17060
|
option: {
|
|
17063
17061
|
listStyle: 'none',
|
|
17064
17062
|
lineHeight: src.lineHeightDynamic,
|
|
17063
|
+
minWidth: 64,
|
|
17065
17064
|
padding: "".concat(src.cascaderOptionPaddingY, " ").concat(src.cascaderOptionPaddingX),
|
|
17066
17065
|
'&:not($optionDisabled)': {
|
|
17067
17066
|
cursor: 'pointer'
|
|
@@ -19112,16 +19111,16 @@ var ImageStyle = objectSpread2_default()(objectSpread2_default()({}, animation),
|
|
|
19112
19111
|
},
|
|
19113
19112
|
circle: {
|
|
19114
19113
|
borderRadius: src.imageCircleBorderRadius,
|
|
19115
|
-
|
|
19114
|
+
outline: "1px solid ".concat(src.imageBorderColor)
|
|
19116
19115
|
},
|
|
19117
19116
|
rounded: {
|
|
19118
19117
|
borderRadius: src.imageBorderRadius,
|
|
19119
|
-
|
|
19118
|
+
outline: "1px solid ".concat(src.imageBorderColor)
|
|
19120
19119
|
},
|
|
19121
19120
|
thumbnail: {
|
|
19122
19121
|
borderRadius: src.imageBorderRadius,
|
|
19123
19122
|
backgroundColor: '#FFFFFF',
|
|
19124
|
-
|
|
19123
|
+
outline: "1px solid ".concat(src.imageBorderColor),
|
|
19125
19124
|
'& $inner': {
|
|
19126
19125
|
top: 4,
|
|
19127
19126
|
left: 4,
|
|
@@ -19911,6 +19910,9 @@ var listStyle = {
|
|
|
19911
19910
|
border: "".concat(src.listBorderWidth, " solid ").concat(src.listBorderColor),
|
|
19912
19911
|
borderRadius: src.listBorderRadius
|
|
19913
19912
|
},
|
|
19913
|
+
wrapperEmpty: {
|
|
19914
|
+
justifyContent: 'center'
|
|
19915
|
+
},
|
|
19914
19916
|
wrapperSmall: {},
|
|
19915
19917
|
wrapperLarge: {},
|
|
19916
19918
|
wrapperStriped: {
|
|
@@ -29030,7 +29032,7 @@ var usePositionStyle = function usePositionStyle(config) {
|
|
|
29030
29032
|
}
|
|
29031
29033
|
var targetPosition = position;
|
|
29032
29034
|
var rootContainer = getContainer() || document.body;
|
|
29033
|
-
var closestScrollContainer = getClosestScrollContainer(parentElRef.current);
|
|
29035
|
+
var closestScrollContainer = absolute ? null : getClosestScrollContainer(parentElRef.current);
|
|
29034
29036
|
var containerRect = rootContainer.getBoundingClientRect();
|
|
29035
29037
|
var bodyRect = (document.documentElement || document.body).getBoundingClientRect();
|
|
29036
29038
|
var containerScrollBarWidth = rootContainer.offsetWidth - rootContainer.clientWidth;
|
|
@@ -36379,6 +36381,428 @@ var useCascader = function useCascader(props) {
|
|
|
36379
36381
|
};
|
|
36380
36382
|
};
|
|
36381
36383
|
/* harmony default export */ var use_cascader = (useCascader);
|
|
36384
|
+
;// CONCATENATED MODULE: ../hooks/src/common/use-resize/index.ts
|
|
36385
|
+
|
|
36386
|
+
|
|
36387
|
+
|
|
36388
|
+
var useResize = function useResize(props) {
|
|
36389
|
+
var targetRef = props.targetRef,
|
|
36390
|
+
_props$timer = props.timer,
|
|
36391
|
+
timer = _props$timer === void 0 ? 100 : _props$timer;
|
|
36392
|
+
var _useState = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(0),
|
|
36393
|
+
_useState2 = slicedToArray_default()(_useState, 2),
|
|
36394
|
+
width = _useState2[0],
|
|
36395
|
+
setWidth = _useState2[1];
|
|
36396
|
+
var _useState3 = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(0),
|
|
36397
|
+
_useState4 = slicedToArray_default()(_useState3, 2),
|
|
36398
|
+
height = _useState4[0],
|
|
36399
|
+
setHeight = _useState4[1];
|
|
36400
|
+
(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
|
|
36401
|
+
if (!targetRef.current) return;
|
|
36402
|
+
var el = targetRef.current;
|
|
36403
|
+
if (el) {
|
|
36404
|
+
setWidth(el.clientWidth);
|
|
36405
|
+
setHeight(el.clientHeight);
|
|
36406
|
+
}
|
|
36407
|
+
var clean = addResizeObserver(el, function (entry) {
|
|
36408
|
+
var _props$cb;
|
|
36409
|
+
var _entry$0$contentRect = entry[0].contentRect,
|
|
36410
|
+
width = _entry$0$contentRect.width,
|
|
36411
|
+
height = _entry$0$contentRect.height;
|
|
36412
|
+
setWidth(width);
|
|
36413
|
+
setHeight(height);
|
|
36414
|
+
(_props$cb = props.cb) === null || _props$cb === void 0 || _props$cb.call(props, width, height);
|
|
36415
|
+
}, {
|
|
36416
|
+
timer: timer,
|
|
36417
|
+
direction: false
|
|
36418
|
+
});
|
|
36419
|
+
return function () {
|
|
36420
|
+
if (clean) clean();
|
|
36421
|
+
};
|
|
36422
|
+
}, [targetRef.current]);
|
|
36423
|
+
return {
|
|
36424
|
+
width: width,
|
|
36425
|
+
height: height
|
|
36426
|
+
};
|
|
36427
|
+
};
|
|
36428
|
+
/* harmony default export */ var use_resize = ((/* unused pure expression or super */ null && (useResize)));
|
|
36429
|
+
;// CONCATENATED MODULE: ../base/src/virtual-scroll/scroll.tsx
|
|
36430
|
+
|
|
36431
|
+
|
|
36432
|
+
|
|
36433
|
+
|
|
36434
|
+
|
|
36435
|
+
|
|
36436
|
+
|
|
36437
|
+
var Scroll = function Scroll(props) {
|
|
36438
|
+
var containerRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(null);
|
|
36439
|
+
var scrollRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(null);
|
|
36440
|
+
var wrapperRef = useForkRef(scrollRef, props.wrapperRef);
|
|
36441
|
+
var _useRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)({
|
|
36442
|
+
timer: null,
|
|
36443
|
+
isMouseDown: false
|
|
36444
|
+
}),
|
|
36445
|
+
context = _useRef.current;
|
|
36446
|
+
var _props$scrollHeight = props.scrollHeight,
|
|
36447
|
+
scrollHeight = _props$scrollHeight === void 0 ? 0 : _props$scrollHeight,
|
|
36448
|
+
_props$scrollWidth = props.scrollWidth,
|
|
36449
|
+
scrollWidth = _props$scrollWidth === void 0 ? 0 : _props$scrollWidth,
|
|
36450
|
+
_props$defaultHeight = props.defaultHeight,
|
|
36451
|
+
defaultHeight = _props$defaultHeight === void 0 ? 0 : _props$defaultHeight;
|
|
36452
|
+
var _useResize = useResize({
|
|
36453
|
+
targetRef: containerRef
|
|
36454
|
+
}),
|
|
36455
|
+
width = _useResize.width,
|
|
36456
|
+
h = _useResize.height;
|
|
36457
|
+
var height = h || defaultHeight;
|
|
36458
|
+
var config = useConfig();
|
|
36459
|
+
var isRtl = config.direction === 'rtl';
|
|
36460
|
+
var scrollerStyle = props.scrollerStyle || {
|
|
36461
|
+
height: '100%',
|
|
36462
|
+
width: '100%',
|
|
36463
|
+
overflow: 'auto'
|
|
36464
|
+
};
|
|
36465
|
+
var containerStyle = defineProperty_default()(defineProperty_default()({
|
|
36466
|
+
height: '100%',
|
|
36467
|
+
width: '100%',
|
|
36468
|
+
display: 'inline-flex',
|
|
36469
|
+
overflow: 'hidden',
|
|
36470
|
+
position: 'sticky'
|
|
36471
|
+
}, isRtl ? 'right' : 'left', 0), "top", 0);
|
|
36472
|
+
var paddingTop = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo)(function () {
|
|
36473
|
+
return Math.max(0, Math.floor(scrollHeight - height));
|
|
36474
|
+
}, [scrollHeight, height]);
|
|
36475
|
+
var placeStyle = {
|
|
36476
|
+
paddingTop: paddingTop,
|
|
36477
|
+
width: scrollWidth,
|
|
36478
|
+
overflow: props.isScrollY ? 'hidden' : 'auto hidden',
|
|
36479
|
+
height: props.isScrollY ? 0 : 1,
|
|
36480
|
+
marginTop: props.isScrollY ? 0 : -1,
|
|
36481
|
+
lineHeight: 0
|
|
36482
|
+
};
|
|
36483
|
+
var extractHeightValue = function extractHeightValue(num) {
|
|
36484
|
+
if (isNumber(num)) return num;
|
|
36485
|
+
var match = num.match(/(\d+)/);
|
|
36486
|
+
if (match) {
|
|
36487
|
+
return parseInt(match[0], 10);
|
|
36488
|
+
}
|
|
36489
|
+
return undefined;
|
|
36490
|
+
};
|
|
36491
|
+
var handleScroll = usePersistFn(function (e) {
|
|
36492
|
+
var onScrollToBottom = props.onScrollToBottom;
|
|
36493
|
+
var target = e.currentTarget;
|
|
36494
|
+
var scrollLeft = target.scrollLeft,
|
|
36495
|
+
scrollTop = target.scrollTop;
|
|
36496
|
+
if (props.height && onScrollToBottom) {
|
|
36497
|
+
var realHeight = extractHeightValue(props.height);
|
|
36498
|
+
if (realHeight !== undefined) {
|
|
36499
|
+
var touchBottom = target.scrollHeight === scrollTop + realHeight;
|
|
36500
|
+
if (touchBottom) onScrollToBottom();
|
|
36501
|
+
}
|
|
36502
|
+
}
|
|
36503
|
+
var maxY = target.scrollHeight - target.clientHeight;
|
|
36504
|
+
var maxX = target.scrollWidth - target.clientWidth;
|
|
36505
|
+
if (!isRtl) {
|
|
36506
|
+
// 解决浏览器缩放以后导致滚动条长度出现小数
|
|
36507
|
+
if (maxX - scrollLeft < 0 || maxX - scrollLeft < 1) scrollLeft = maxX;
|
|
36508
|
+
if (scrollLeft < 0) scrollLeft = 0;
|
|
36509
|
+
} else {
|
|
36510
|
+
if (maxX + scrollLeft < 0 || maxX + scrollLeft < 1) scrollLeft = 0 - maxX;
|
|
36511
|
+
if (scrollLeft > 0) scrollLeft = 0;
|
|
36512
|
+
}
|
|
36513
|
+
if (scrollTop > maxY || maxY - scrollTop < 1) scrollTop = maxY;
|
|
36514
|
+
if (scrollTop < 0) scrollTop = 0;
|
|
36515
|
+
var x = maxX === 0 ? 0 : Math.min(Math.abs(scrollLeft) / maxX, 1);
|
|
36516
|
+
var y = maxY === 0 ? 0 : Math.min(scrollTop / maxY, 1);
|
|
36517
|
+
if (props.onScroll) props.onScroll({
|
|
36518
|
+
scrollLeft: scrollLeft,
|
|
36519
|
+
scrollTop: scrollTop,
|
|
36520
|
+
x: x,
|
|
36521
|
+
y: y,
|
|
36522
|
+
height: height,
|
|
36523
|
+
width: width,
|
|
36524
|
+
fromDrag: context.isMouseDown
|
|
36525
|
+
});
|
|
36526
|
+
});
|
|
36527
|
+
var handleInnerScroll = usePersistFn(function (e) {
|
|
36528
|
+
var scrollTop = e.currentTarget.scrollTop;
|
|
36529
|
+
if (scrollRef.current) {
|
|
36530
|
+
e.currentTarget.scrollTop = 0;
|
|
36531
|
+
scrollRef.current.scrollTop += scrollTop;
|
|
36532
|
+
}
|
|
36533
|
+
});
|
|
36534
|
+
return /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
36535
|
+
className: props.className,
|
|
36536
|
+
style: props.style,
|
|
36537
|
+
onMouseMove: props.onMouseMove,
|
|
36538
|
+
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", objectSpread2_default()(objectSpread2_default()({}, getDataAttribute({
|
|
36539
|
+
role: 'scroll'
|
|
36540
|
+
})), {}, {
|
|
36541
|
+
style: scrollerStyle,
|
|
36542
|
+
onScroll: handleScroll,
|
|
36543
|
+
ref: wrapperRef,
|
|
36544
|
+
onMouseDown: function onMouseDown() {
|
|
36545
|
+
context.isMouseDown = true;
|
|
36546
|
+
},
|
|
36547
|
+
onMouseUp: function onMouseUp() {
|
|
36548
|
+
context.isMouseDown = false;
|
|
36549
|
+
},
|
|
36550
|
+
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", objectSpread2_default()(objectSpread2_default()({}, getDataAttribute({
|
|
36551
|
+
role: 'scroll-container'
|
|
36552
|
+
})), {}, {
|
|
36553
|
+
style: containerStyle,
|
|
36554
|
+
ref: containerRef,
|
|
36555
|
+
onScroll: handleInnerScroll,
|
|
36556
|
+
children: /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
36557
|
+
style: objectSpread2_default()({
|
|
36558
|
+
flexGrow: 1
|
|
36559
|
+
}, props.childrenStyle),
|
|
36560
|
+
children: props.children
|
|
36561
|
+
})
|
|
36562
|
+
})), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
36563
|
+
style: placeStyle,
|
|
36564
|
+
children: "\xA0"
|
|
36565
|
+
})]
|
|
36566
|
+
}))
|
|
36567
|
+
});
|
|
36568
|
+
};
|
|
36569
|
+
/* harmony default export */ var virtual_scroll_scroll = (Scroll);
|
|
36570
|
+
;// CONCATENATED MODULE: ../base/src/virtual-scroll/virtual-scroll-list.tsx
|
|
36571
|
+
|
|
36572
|
+
|
|
36573
|
+
|
|
36574
|
+
|
|
36575
|
+
|
|
36576
|
+
|
|
36577
|
+
var VirtualList = function VirtualList(props) {
|
|
36578
|
+
var rowsInView = props.rowsInView,
|
|
36579
|
+
_props$data = props.data,
|
|
36580
|
+
data = _props$data === void 0 ? [] : _props$data,
|
|
36581
|
+
groupKey = props.groupKey,
|
|
36582
|
+
style = props.style,
|
|
36583
|
+
className = props.className,
|
|
36584
|
+
lineHeight = props.lineHeight,
|
|
36585
|
+
height = props.height,
|
|
36586
|
+
renderItem = props.renderItem,
|
|
36587
|
+
customRenderItem = props.customRenderItem,
|
|
36588
|
+
_props$tag = props.tag,
|
|
36589
|
+
tag = _props$tag === void 0 ? 'div' : _props$tag,
|
|
36590
|
+
tagClassName = props.tagClassName,
|
|
36591
|
+
dynamicVirtual = props.dynamicVirtual,
|
|
36592
|
+
virtualRef = props.virtualRef,
|
|
36593
|
+
onControlTypeChange = props.onControlTypeChange;
|
|
36594
|
+
var _useState = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(0),
|
|
36595
|
+
_useState2 = slicedToArray_default()(_useState, 2),
|
|
36596
|
+
top = _useState2[0],
|
|
36597
|
+
setTop = _useState2[1];
|
|
36598
|
+
var _useState3 = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(0),
|
|
36599
|
+
_useState4 = slicedToArray_default()(_useState3, 2),
|
|
36600
|
+
offsetY = _useState4[0],
|
|
36601
|
+
setOffsetY = _useState4[1];
|
|
36602
|
+
var _useState5 = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(props.data.length * lineHeight),
|
|
36603
|
+
_useState6 = slicedToArray_default()(_useState5, 2),
|
|
36604
|
+
scrollHeight = _useState6[0],
|
|
36605
|
+
setHeight = _useState6[1];
|
|
36606
|
+
var _useState7 = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(0),
|
|
36607
|
+
_useState8 = slicedToArray_default()(_useState7, 2),
|
|
36608
|
+
startIndex = _useState8[0],
|
|
36609
|
+
setStartIndex = _useState8[1];
|
|
36610
|
+
var wrapperRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(null);
|
|
36611
|
+
var _useRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)({
|
|
36612
|
+
cachedHeight: [],
|
|
36613
|
+
controlScrollRate: null,
|
|
36614
|
+
heightCallback: null,
|
|
36615
|
+
preIndex: null,
|
|
36616
|
+
topTimer: null,
|
|
36617
|
+
rateTimer: null,
|
|
36618
|
+
shouldUpdateHeight: true
|
|
36619
|
+
}),
|
|
36620
|
+
context = _useRef.current;
|
|
36621
|
+
var getContentHeight = function getContentHeight(index) {
|
|
36622
|
+
var sum = 0;
|
|
36623
|
+
for (var i = 0; i <= index; i++) {
|
|
36624
|
+
sum += context.cachedHeight[i] || lineHeight;
|
|
36625
|
+
}
|
|
36626
|
+
return sum;
|
|
36627
|
+
};
|
|
36628
|
+
var getCurrentIndex = usePersistFn(function () {
|
|
36629
|
+
return startIndex;
|
|
36630
|
+
});
|
|
36631
|
+
var getTop = usePersistFn(function () {
|
|
36632
|
+
return top;
|
|
36633
|
+
});
|
|
36634
|
+
var setRowHeight = usePersistFn(function (index, height) {
|
|
36635
|
+
var beforeHeight = context.cachedHeight[index];
|
|
36636
|
+
if (beforeHeight && beforeHeight === height) return;
|
|
36637
|
+
context.cachedHeight[index] = height;
|
|
36638
|
+
if (context.shouldUpdateHeight) {
|
|
36639
|
+
setHeight(getContentHeight(props.data.length - 1));
|
|
36640
|
+
}
|
|
36641
|
+
var preIndex = context.preIndex;
|
|
36642
|
+
// 解决: 从下往上滚 由于高度变化会导致滚动条跳动
|
|
36643
|
+
if (preIndex && preIndex > startIndex && startIndex === index) {
|
|
36644
|
+
// 发生在顶部
|
|
36645
|
+
if (context.heightCallback) return;
|
|
36646
|
+
var offset = height - (beforeHeight || lineHeight);
|
|
36647
|
+
setOffsetY(function (s) {
|
|
36648
|
+
return s + offset;
|
|
36649
|
+
});
|
|
36650
|
+
}
|
|
36651
|
+
});
|
|
36652
|
+
var updateRateScroll = usePersistFn(function (rate) {
|
|
36653
|
+
var sumHeight = getContentHeight(props.data.length - 1);
|
|
36654
|
+
if (sumHeight === scrollHeight) return;
|
|
36655
|
+
context.shouldUpdateHeight = true;
|
|
36656
|
+
context.heightCallback = function () {
|
|
36657
|
+
if (wrapperRef && wrapperRef.current) {
|
|
36658
|
+
var _scrollHeight = wrapperRef.current.scrollHeight;
|
|
36659
|
+
var clientHeight = wrapperRef.current.clientHeight;
|
|
36660
|
+
var nowTop = wrapperRef.current.scrollTop;
|
|
36661
|
+
var max = _scrollHeight - clientHeight;
|
|
36662
|
+
var _top = rate * max;
|
|
36663
|
+
if (Math.abs(nowTop - _top) < 1) {
|
|
36664
|
+
context.controlScrollRate = null;
|
|
36665
|
+
} else {
|
|
36666
|
+
context.controlScrollRate = rate;
|
|
36667
|
+
wrapperRef.current.scrollTop = _top;
|
|
36668
|
+
}
|
|
36669
|
+
}
|
|
36670
|
+
};
|
|
36671
|
+
setHeight(sumHeight);
|
|
36672
|
+
});
|
|
36673
|
+
var updateIndexAndTopFromTop = function updateIndexAndTopFromTop(scrollTop) {
|
|
36674
|
+
var sum = 0;
|
|
36675
|
+
var nextCurrentIndex = 0;
|
|
36676
|
+
var top = 0;
|
|
36677
|
+
var maxIndex = Math.max(props.data.length - rowsInView, 0);
|
|
36678
|
+
for (var i = 0; i <= maxIndex; i++) {
|
|
36679
|
+
sum += context.cachedHeight[i] || lineHeight;
|
|
36680
|
+
if (scrollTop < sum || i === maxIndex) {
|
|
36681
|
+
nextCurrentIndex = i;
|
|
36682
|
+
var beforeHeight = i === 0 ? 0 : sum - (context.cachedHeight[i] || lineHeight);
|
|
36683
|
+
top = scrollTop - beforeHeight;
|
|
36684
|
+
break;
|
|
36685
|
+
}
|
|
36686
|
+
}
|
|
36687
|
+
if (nextCurrentIndex !== startIndex) {
|
|
36688
|
+
setStartIndex(nextCurrentIndex);
|
|
36689
|
+
}
|
|
36690
|
+
setTop(top);
|
|
36691
|
+
};
|
|
36692
|
+
var handleScrollByStep = usePersistFn(function (step, top) {
|
|
36693
|
+
var _wrapperRef$current;
|
|
36694
|
+
var next = startIndex + step;
|
|
36695
|
+
(_wrapperRef$current = wrapperRef.current) === null || _wrapperRef$current === void 0 || _wrapperRef$current.scrollTo({
|
|
36696
|
+
top: next * lineHeight + (top || 0)
|
|
36697
|
+
});
|
|
36698
|
+
});
|
|
36699
|
+
var handleMouseMove = function handleMouseMove() {
|
|
36700
|
+
onControlTypeChange === null || onControlTypeChange === void 0 || onControlTypeChange('mouse');
|
|
36701
|
+
};
|
|
36702
|
+
var handleScroll = function handleScroll(info) {
|
|
36703
|
+
var _props$onScroll;
|
|
36704
|
+
var height = info.height,
|
|
36705
|
+
y = info.y,
|
|
36706
|
+
fromDrag = info.fromDrag;
|
|
36707
|
+
var scrollTop = info.scrollTop;
|
|
36708
|
+
context.shouldUpdateHeight = !fromDrag;
|
|
36709
|
+
var sumHeight = getContentHeight(props.data.length - 1);
|
|
36710
|
+
var max = sumHeight - height;
|
|
36711
|
+
if (scrollTop > max) {
|
|
36712
|
+
scrollTop = max;
|
|
36713
|
+
}
|
|
36714
|
+
if (fromDrag) {
|
|
36715
|
+
var _top2 = y * max;
|
|
36716
|
+
updateIndexAndTopFromTop(_top2);
|
|
36717
|
+
if (context.rateTimer) clearTimeout(context.rateTimer);
|
|
36718
|
+
context.rateTimer = setTimeout(function () {
|
|
36719
|
+
updateRateScroll(y);
|
|
36720
|
+
}, 120);
|
|
36721
|
+
} else {
|
|
36722
|
+
updateIndexAndTopFromTop(scrollTop);
|
|
36723
|
+
}
|
|
36724
|
+
(_props$onScroll = props.onScroll) === null || _props$onScroll === void 0 || _props$onScroll.call(props, info);
|
|
36725
|
+
};
|
|
36726
|
+
var renderList = function renderList() {
|
|
36727
|
+
var items = data.slice(startIndex, startIndex + rowsInView);
|
|
36728
|
+
var Tag = tag;
|
|
36729
|
+
var shouldScroll = getContentHeight(data.length - 1) > height;
|
|
36730
|
+
var nextStyle = objectSpread2_default()({}, style);
|
|
36731
|
+
if (shouldScroll) nextStyle.height = height;
|
|
36732
|
+
var scrollHeight = getContentHeight(data.length - 1);
|
|
36733
|
+
return /*#__PURE__*/(0,jsx_runtime.jsx)(virtual_scroll_scroll, {
|
|
36734
|
+
className: className,
|
|
36735
|
+
style: nextStyle,
|
|
36736
|
+
height: height,
|
|
36737
|
+
scrollWidth: 0,
|
|
36738
|
+
scrollHeight: scrollHeight,
|
|
36739
|
+
wrapperRef: wrapperRef,
|
|
36740
|
+
childrenStyle: {
|
|
36741
|
+
width: '100%'
|
|
36742
|
+
},
|
|
36743
|
+
onScroll: handleScroll,
|
|
36744
|
+
onMouseMove: handleMouseMove,
|
|
36745
|
+
children: /*#__PURE__*/(0,jsx_runtime.jsx)(Tag, {
|
|
36746
|
+
className: tagClassName,
|
|
36747
|
+
style: {
|
|
36748
|
+
transform: "translate3d(0, -".concat(top, "px, 0)")
|
|
36749
|
+
},
|
|
36750
|
+
children: items.map(function (d, i) {
|
|
36751
|
+
if (d[groupKey]) {
|
|
36752
|
+
return /*#__PURE__*/(0,jsx_runtime.jsx)((external_root_React_commonjs2_react_commonjs_react_amd_react_default()).Fragment, {
|
|
36753
|
+
children: customRenderItem(d, startIndex + i, i)
|
|
36754
|
+
}, i);
|
|
36755
|
+
}
|
|
36756
|
+
return /*#__PURE__*/(0,jsx_runtime.jsx)((external_root_React_commonjs2_react_commonjs_react_amd_react_default()).Fragment, {
|
|
36757
|
+
children: renderItem(d, startIndex + i, i, setRowHeight)
|
|
36758
|
+
}, dynamicVirtual ? startIndex + i : i);
|
|
36759
|
+
})
|
|
36760
|
+
})
|
|
36761
|
+
});
|
|
36762
|
+
};
|
|
36763
|
+
(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
|
|
36764
|
+
// 记录preIndex
|
|
36765
|
+
context.preIndex = startIndex;
|
|
36766
|
+
}, [startIndex]);
|
|
36767
|
+
(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useLayoutEffect)(function () {
|
|
36768
|
+
// 数据变化的时候清空掉 preIndex, 如果之前有缓存的index, setRowHeight 会有问题
|
|
36769
|
+
setTop(0);
|
|
36770
|
+
setStartIndex(0);
|
|
36771
|
+
return function () {
|
|
36772
|
+
context.preIndex = null;
|
|
36773
|
+
};
|
|
36774
|
+
}, [data.length]);
|
|
36775
|
+
(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
|
|
36776
|
+
if (offsetY) {
|
|
36777
|
+
if (wrapperRef.current) {
|
|
36778
|
+
setOffsetY(0);
|
|
36779
|
+
setTop(function (s) {
|
|
36780
|
+
return s + offsetY;
|
|
36781
|
+
});
|
|
36782
|
+
wrapperRef.current.scrollTop += offsetY;
|
|
36783
|
+
}
|
|
36784
|
+
}
|
|
36785
|
+
}, [offsetY, startIndex]);
|
|
36786
|
+
(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
|
|
36787
|
+
setHeight(getContentHeight(props.data.length - 1));
|
|
36788
|
+
}, [data.length]);
|
|
36789
|
+
(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
|
|
36790
|
+
if (context.heightCallback) {
|
|
36791
|
+
var cb = context.heightCallback;
|
|
36792
|
+
context.heightCallback = null;
|
|
36793
|
+
cb();
|
|
36794
|
+
}
|
|
36795
|
+
}, [scrollHeight]);
|
|
36796
|
+
(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
|
|
36797
|
+
if (virtualRef !== null && virtualRef !== void 0 && virtualRef.current) {
|
|
36798
|
+
virtualRef.current.scrollByStep = handleScrollByStep;
|
|
36799
|
+
virtualRef.current.getCurrentIndex = getCurrentIndex;
|
|
36800
|
+
virtualRef.current.getTop = getTop;
|
|
36801
|
+
}
|
|
36802
|
+
}, []);
|
|
36803
|
+
return renderList();
|
|
36804
|
+
};
|
|
36805
|
+
/* harmony default export */ var virtual_scroll_list = (VirtualList);
|
|
36382
36806
|
;// CONCATENATED MODULE: ../base/src/cascader/node.tsx
|
|
36383
36807
|
|
|
36384
36808
|
|
|
@@ -36505,6 +36929,8 @@ var CascaderNode = function CascaderNode(props) {
|
|
|
36505
36929
|
|
|
36506
36930
|
|
|
36507
36931
|
|
|
36932
|
+
|
|
36933
|
+
|
|
36508
36934
|
var CascaderList = function CascaderList(props) {
|
|
36509
36935
|
var _jssStyle$cascader;
|
|
36510
36936
|
var jssStyle = props.jssStyle,
|
|
@@ -36512,7 +36938,6 @@ var CascaderList = function CascaderList(props) {
|
|
|
36512
36938
|
keygen = props.keygen,
|
|
36513
36939
|
parentId = props.parentId,
|
|
36514
36940
|
datum = props.datum,
|
|
36515
|
-
renderItem = props.renderItem,
|
|
36516
36941
|
loader = props.loader,
|
|
36517
36942
|
onChange = props.onChange,
|
|
36518
36943
|
onPathChange = props.onPathChange,
|
|
@@ -36521,8 +36946,28 @@ var CascaderList = function CascaderList(props) {
|
|
|
36521
36946
|
childrenKey = props.childrenKey,
|
|
36522
36947
|
shouldFinal = props.shouldFinal,
|
|
36523
36948
|
path = props.path,
|
|
36524
|
-
mode = props.mode
|
|
36949
|
+
mode = props.mode,
|
|
36950
|
+
size = props.size,
|
|
36951
|
+
virtual = props.virtual;
|
|
36525
36952
|
var styles = jssStyle === null || jssStyle === void 0 || (_jssStyle$cascader = jssStyle.cascader) === null || _jssStyle$cascader === void 0 ? void 0 : _jssStyle$cascader.call(jssStyle);
|
|
36953
|
+
var virtualRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)({
|
|
36954
|
+
scrollByStep: undefined,
|
|
36955
|
+
getCurrentIndex: undefined,
|
|
36956
|
+
getHoverIndex: undefined
|
|
36957
|
+
});
|
|
36958
|
+
var getLineHeight = function getLineHeight() {
|
|
36959
|
+
// if (lineHeightProp && lineHeightProp !== 'auto') return lineHeightProp;
|
|
36960
|
+
if (size === 'small') return 26;
|
|
36961
|
+
if (size === 'default') return 34;
|
|
36962
|
+
if (size === 'large') return 42;
|
|
36963
|
+
return 34;
|
|
36964
|
+
};
|
|
36965
|
+
var lineHeight = getLineHeight();
|
|
36966
|
+
var getHeight = function getHeight() {
|
|
36967
|
+
if (props.height) return props.height;
|
|
36968
|
+
return lineHeight * 7;
|
|
36969
|
+
};
|
|
36970
|
+
var height = getHeight();
|
|
36526
36971
|
|
|
36527
36972
|
// 和 datum 中的 geyKey 不一样,根据 parentId 生成唯一的 key
|
|
36528
36973
|
var getKey = function getKey(item, index) {
|
|
@@ -36541,31 +36986,46 @@ var CascaderList = function CascaderList(props) {
|
|
|
36541
36986
|
children: "noData"
|
|
36542
36987
|
});
|
|
36543
36988
|
};
|
|
36989
|
+
var renderItem = function renderItem(item, index) {
|
|
36990
|
+
var id = getKey(item, index);
|
|
36991
|
+
return /*#__PURE__*/(0,jsx_runtime.jsx)(node, {
|
|
36992
|
+
jssStyle: jssStyle,
|
|
36993
|
+
active: props.id === id,
|
|
36994
|
+
id: id,
|
|
36995
|
+
data: item,
|
|
36996
|
+
datum: datum,
|
|
36997
|
+
renderItem: props.renderItem,
|
|
36998
|
+
keygen: keygen,
|
|
36999
|
+
loader: loader,
|
|
37000
|
+
onPathChange: onPathChange,
|
|
37001
|
+
onChange: onChange,
|
|
37002
|
+
multiple: multiple,
|
|
37003
|
+
mode: mode,
|
|
37004
|
+
expandTrigger: expandTrigger,
|
|
37005
|
+
childrenKey: childrenKey,
|
|
37006
|
+
shouldFinal: shouldFinal,
|
|
37007
|
+
parentId: parentId,
|
|
37008
|
+
path: path
|
|
37009
|
+
}, id);
|
|
37010
|
+
};
|
|
37011
|
+
var renderSimpleList = function renderSimpleList() {
|
|
37012
|
+
return data.map(renderItem);
|
|
37013
|
+
};
|
|
37014
|
+
var renderVritualList = function renderVritualList() {
|
|
37015
|
+
return /*#__PURE__*/(0,jsx_runtime.jsx)(virtual_scroll_list, {
|
|
37016
|
+
virtualRef: virtualRef,
|
|
37017
|
+
data: data,
|
|
37018
|
+
keygen: keygen,
|
|
37019
|
+
renderItem: renderItem,
|
|
37020
|
+
rowsInView: 20,
|
|
37021
|
+
height: height,
|
|
37022
|
+
lineHeight: lineHeight
|
|
37023
|
+
});
|
|
37024
|
+
};
|
|
36544
37025
|
if (!data || data.length === 0) return renderEmpety();
|
|
36545
37026
|
return /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
36546
37027
|
className: classnames_default()(styles.list),
|
|
36547
|
-
children:
|
|
36548
|
-
var id = getKey(item, index);
|
|
36549
|
-
return /*#__PURE__*/(0,jsx_runtime.jsx)(node, {
|
|
36550
|
-
jssStyle: jssStyle,
|
|
36551
|
-
active: props.id === id,
|
|
36552
|
-
id: id,
|
|
36553
|
-
data: item,
|
|
36554
|
-
datum: datum,
|
|
36555
|
-
renderItem: renderItem,
|
|
36556
|
-
keygen: keygen,
|
|
36557
|
-
loader: loader,
|
|
36558
|
-
onPathChange: onPathChange,
|
|
36559
|
-
onChange: onChange,
|
|
36560
|
-
multiple: multiple,
|
|
36561
|
-
mode: mode,
|
|
36562
|
-
expandTrigger: expandTrigger,
|
|
36563
|
-
childrenKey: childrenKey,
|
|
36564
|
-
shouldFinal: shouldFinal,
|
|
36565
|
-
parentId: parentId,
|
|
36566
|
-
path: path
|
|
36567
|
-
}, id);
|
|
36568
|
-
})
|
|
37028
|
+
children: virtual ? renderVritualList() : renderSimpleList()
|
|
36569
37029
|
});
|
|
36570
37030
|
};
|
|
36571
37031
|
/* harmony default export */ var cascader_list = (CascaderList);
|
|
@@ -37330,9 +37790,12 @@ var More = function More(props) {
|
|
|
37330
37790
|
data = props.data,
|
|
37331
37791
|
showNum = props.showNum,
|
|
37332
37792
|
size = props.size,
|
|
37793
|
+
datas = props.datas,
|
|
37333
37794
|
compressed = props.compressed,
|
|
37334
37795
|
compressedClassName = props.compressedClassName,
|
|
37335
|
-
|
|
37796
|
+
renderCompressed = props.renderCompressed,
|
|
37797
|
+
classes = props.classes,
|
|
37798
|
+
onRemove = props.onRemove;
|
|
37336
37799
|
var _useState = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(false),
|
|
37337
37800
|
_useState2 = slicedToArray_default()(_useState, 2),
|
|
37338
37801
|
visible = _useState2[0],
|
|
@@ -37381,11 +37844,8 @@ var More = function More(props) {
|
|
|
37381
37844
|
}, 'hidden')]
|
|
37382
37845
|
});
|
|
37383
37846
|
}
|
|
37384
|
-
|
|
37385
|
-
|
|
37386
|
-
style: {
|
|
37387
|
-
display: 'inline-flex'
|
|
37388
|
-
},
|
|
37847
|
+
var renderCompressedTag = function renderCompressedTag() {
|
|
37848
|
+
return /*#__PURE__*/(0,jsx_runtime.jsxs)((external_root_React_commonjs2_react_commonjs_react_amd_react_default()).Fragment, {
|
|
37389
37849
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(base_src_tag_tag, {
|
|
37390
37850
|
className: styles.tag,
|
|
37391
37851
|
jssStyle: jssStyle,
|
|
@@ -37407,6 +37867,17 @@ var More = function More(props) {
|
|
|
37407
37867
|
children: [compressed === 'no-repeat' ? null : before, after]
|
|
37408
37868
|
})
|
|
37409
37869
|
})]
|
|
37870
|
+
});
|
|
37871
|
+
};
|
|
37872
|
+
return /*#__PURE__*/(0,jsx_runtime.jsxs)((external_root_React_commonjs2_react_commonjs_react_amd_react_default()).Fragment, {
|
|
37873
|
+
children: [shouldShowMore ? data : before, /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
37874
|
+
style: {
|
|
37875
|
+
display: 'inline-flex'
|
|
37876
|
+
},
|
|
37877
|
+
children: renderCompressed ? renderCompressed({
|
|
37878
|
+
data: datas,
|
|
37879
|
+
onRemove: onRemove
|
|
37880
|
+
}) : renderCompressedTag()
|
|
37410
37881
|
})]
|
|
37411
37882
|
});
|
|
37412
37883
|
};
|
|
@@ -37428,6 +37899,11 @@ var result_isObject = is_isObject,
|
|
|
37428
37899
|
result_isUnMatchedData = isUnMatchedData,
|
|
37429
37900
|
result_isFunc = isFunc,
|
|
37430
37901
|
result_isArray = isArray;
|
|
37902
|
+
var getValueArr = function getValueArr(v) {
|
|
37903
|
+
return (result_isArray(v) ? v : [v]).filter(function (v) {
|
|
37904
|
+
return v !== undefined && v !== null;
|
|
37905
|
+
});
|
|
37906
|
+
};
|
|
37431
37907
|
var result_Result = function Result(props) {
|
|
37432
37908
|
var jssStyle = props.jssStyle,
|
|
37433
37909
|
multiple = props.multiple,
|
|
@@ -37444,10 +37920,12 @@ var result_Result = function Result(props) {
|
|
|
37444
37920
|
placeholder = props.placeholder,
|
|
37445
37921
|
filterText = props.filterText,
|
|
37446
37922
|
inputText = props.inputText,
|
|
37923
|
+
inputRef = props.inputRef,
|
|
37447
37924
|
compressed = props.compressed,
|
|
37448
37925
|
compressedBound = props.compressedBound,
|
|
37449
37926
|
compressedClassName = props.compressedClassName,
|
|
37450
37927
|
renderUnmatched = props.renderUnmatched,
|
|
37928
|
+
renderCompressed = props.renderCompressed,
|
|
37451
37929
|
renderResultProp = props.renderResult,
|
|
37452
37930
|
renderResultContentProp = props.renderResultContent,
|
|
37453
37931
|
allowOnFilter = props.allowOnFilter,
|
|
@@ -37495,7 +37973,9 @@ var result_Result = function Result(props) {
|
|
|
37495
37973
|
}) >= 0;
|
|
37496
37974
|
return !hasValue;
|
|
37497
37975
|
};
|
|
37498
|
-
var empty =
|
|
37976
|
+
var empty = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo)(function () {
|
|
37977
|
+
return isEmptyResult();
|
|
37978
|
+
}, [props.value]);
|
|
37499
37979
|
var isCompressedBound = function isCompressedBound() {
|
|
37500
37980
|
return compressedBound && result_isNumber(compressedBound) && compressedBound >= 1;
|
|
37501
37981
|
};
|
|
@@ -37613,13 +38093,11 @@ var result_Result = function Result(props) {
|
|
|
37613
38093
|
children: content
|
|
37614
38094
|
}, 'single');
|
|
37615
38095
|
};
|
|
37616
|
-
var
|
|
37617
|
-
|
|
37618
|
-
|
|
37619
|
-
|
|
37620
|
-
|
|
37621
|
-
var renderMultipleResult = function renderMultipleResult() {
|
|
37622
|
-
if (isEmptyResult()) return renderNbsp();
|
|
38096
|
+
var renderMultipleResult = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo)(function () {
|
|
38097
|
+
if (isEmptyResult()) return {
|
|
38098
|
+
results: renderNbsp(),
|
|
38099
|
+
datas: undefined
|
|
38100
|
+
};
|
|
37623
38101
|
// [TODO] separator 处理逻辑后续交给 hooks 处理,此处临时处理
|
|
37624
38102
|
var nextValue = getValueArr(value);
|
|
37625
38103
|
if (separator && isString(valueProp)) {
|
|
@@ -37636,18 +38114,24 @@ var result_Result = function Result(props) {
|
|
|
37636
38114
|
}
|
|
37637
38115
|
return renderResultItem(d, i, datas, v);
|
|
37638
38116
|
});
|
|
37639
|
-
return
|
|
37640
|
-
|
|
37641
|
-
|
|
38117
|
+
return {
|
|
38118
|
+
results: result,
|
|
38119
|
+
datas: datas
|
|
38120
|
+
};
|
|
38121
|
+
}, [props.value]);
|
|
38122
|
+
var result = renderMultipleResult.results;
|
|
37642
38123
|
var moreNumber = getCompressedBound();
|
|
37643
38124
|
var renderMultipleResultMore = /*#__PURE__*/(0,jsx_runtime.jsx)(result_more, {
|
|
37644
38125
|
keygen: keygen,
|
|
38126
|
+
onRemove: onRemove,
|
|
37645
38127
|
classes: props.classes,
|
|
37646
38128
|
jssStyle: props.jssStyle,
|
|
37647
38129
|
data: result,
|
|
38130
|
+
datas: renderMultipleResult.datas,
|
|
37648
38131
|
size: size,
|
|
37649
38132
|
more: moreNumber,
|
|
37650
38133
|
compressed: compressed,
|
|
38134
|
+
renderCompressed: renderCompressed,
|
|
37651
38135
|
compressedClassName: compressedClassName,
|
|
37652
38136
|
showNum: moreNumber
|
|
37653
38137
|
}, 'more');
|
|
@@ -37657,7 +38141,7 @@ var result_Result = function Result(props) {
|
|
|
37657
38141
|
}
|
|
37658
38142
|
var result = [];
|
|
37659
38143
|
if (multiple) {
|
|
37660
|
-
result.push(compressed ? renderMultipleResultMore : renderMultipleResult
|
|
38144
|
+
result.push(compressed ? renderMultipleResultMore : renderMultipleResult.results);
|
|
37661
38145
|
if (showInput) {
|
|
37662
38146
|
result.push(renderInput());
|
|
37663
38147
|
} else if (result.length === 0) {
|
|
@@ -37688,8 +38172,18 @@ var result_Result = function Result(props) {
|
|
|
37688
38172
|
onFilter === null || onFilter === void 0 || onFilter('', 'blur');
|
|
37689
38173
|
}, 400);
|
|
37690
38174
|
}
|
|
38175
|
+
|
|
38176
|
+
// 单选场景下,焦点时自动选中input文本
|
|
38177
|
+
if (focus && showInput && mounted.current) {
|
|
38178
|
+
var nextValue = getValueArr(value);
|
|
38179
|
+
props.setInputText(nextValue[0]);
|
|
38180
|
+
setTimeout(function () {
|
|
38181
|
+
var _inputRef$current;
|
|
38182
|
+
inputRef === null || inputRef === void 0 || (_inputRef$current = inputRef.current) === null || _inputRef$current === void 0 || _inputRef$current.select();
|
|
38183
|
+
}, 10);
|
|
38184
|
+
}
|
|
37691
38185
|
mounted.current = true;
|
|
37692
|
-
}, [focus]);
|
|
38186
|
+
}, [focus, showInput]);
|
|
37693
38187
|
(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useLayoutEffect)(function () {
|
|
37694
38188
|
handleResetMore();
|
|
37695
38189
|
}, [valueProp, data]);
|
|
@@ -37755,7 +38249,7 @@ var result_Result = function Result(props) {
|
|
|
37755
38249
|
var Cascader = function Cascader(props0) {
|
|
37756
38250
|
var _jssStyle$cascader;
|
|
37757
38251
|
var props = use_with_form_config(props0);
|
|
37758
|
-
var defaultHeight =
|
|
38252
|
+
var defaultHeight = 250;
|
|
37759
38253
|
var jssStyle = props.jssStyle,
|
|
37760
38254
|
style = props.style,
|
|
37761
38255
|
_props$adjust = props.adjust,
|
|
@@ -37800,6 +38294,7 @@ var Cascader = function Cascader(props0) {
|
|
|
37800
38294
|
placeholder = props.placeholder,
|
|
37801
38295
|
_props$focusSelected = props.focusSelected,
|
|
37802
38296
|
focusSelected = _props$focusSelected === void 0 ? true : _props$focusSelected,
|
|
38297
|
+
renderCompressed = props.renderCompressed,
|
|
37803
38298
|
compressedClassName = props.compressedClassName,
|
|
37804
38299
|
resultClassName = props.resultClassName,
|
|
37805
38300
|
renderUnmatched = props.renderUnmatched,
|
|
@@ -37819,6 +38314,7 @@ var Cascader = function Cascader(props0) {
|
|
|
37819
38314
|
onFilterProp = props.onFilter,
|
|
37820
38315
|
onCollapseProp = props.onCollapse,
|
|
37821
38316
|
size = props.size,
|
|
38317
|
+
virtual = props.virtual,
|
|
37822
38318
|
filterSameChange = props.filterSameChange;
|
|
37823
38319
|
var showInput = isFunc(onFilterProp);
|
|
37824
38320
|
var styles = jssStyle === null || jssStyle === void 0 || (_jssStyle$cascader = jssStyle.cascader) === null || _jssStyle$cascader === void 0 ? void 0 : _jssStyle$cascader.call(jssStyle);
|
|
@@ -38057,13 +38553,8 @@ var Cascader = function Cascader(props0) {
|
|
|
38057
38553
|
onChange(datum.getValue(), item);
|
|
38058
38554
|
};
|
|
38059
38555
|
var getDataByValues = function getDataByValues(values) {
|
|
38060
|
-
|
|
38061
|
-
|
|
38062
|
-
}).reduce(function (acc, val) {
|
|
38063
|
-
return acc.concat(val);
|
|
38064
|
-
}, []);
|
|
38065
|
-
if (!nextValues) return [];
|
|
38066
|
-
return datum.getDataByValues(nextValues);
|
|
38556
|
+
if (!values) return [];
|
|
38557
|
+
return datum.getDataByValues(values);
|
|
38067
38558
|
};
|
|
38068
38559
|
var checkUnMatched = function checkUnMatched(item) {
|
|
38069
38560
|
return isUnMatchedData(item);
|
|
@@ -38133,6 +38624,7 @@ var Cascader = function Cascader(props0) {
|
|
|
38133
38624
|
keygen: keygen,
|
|
38134
38625
|
disabled: disabled,
|
|
38135
38626
|
compressed: compressed,
|
|
38627
|
+
renderCompressed: renderCompressed,
|
|
38136
38628
|
compressedBound: compressedBound,
|
|
38137
38629
|
compressedClassName: compressedClassName,
|
|
38138
38630
|
multiple: true,
|
|
@@ -38182,9 +38674,11 @@ var Cascader = function Cascader(props0) {
|
|
|
38182
38674
|
expandTrigger: expandTrigger,
|
|
38183
38675
|
childrenKey: childrenKey,
|
|
38184
38676
|
shouldFinal: shouldFinal,
|
|
38677
|
+
height: height,
|
|
38185
38678
|
data: tempData,
|
|
38186
38679
|
id: path[0],
|
|
38187
38680
|
parentId: "",
|
|
38681
|
+
virtual: virtual,
|
|
38188
38682
|
path: [],
|
|
38189
38683
|
mode: mode
|
|
38190
38684
|
}, 'root')];
|
|
@@ -38197,6 +38691,8 @@ var Cascader = function Cascader(props0) {
|
|
|
38197
38691
|
tempData = tempData[childrenKey];
|
|
38198
38692
|
return /*#__PURE__*/(0,jsx_runtime.jsx)(cascader_list, {
|
|
38199
38693
|
datum: datum,
|
|
38694
|
+
size: size,
|
|
38695
|
+
height: height,
|
|
38200
38696
|
jssStyle: jssStyle,
|
|
38201
38697
|
renderItem: renderItem,
|
|
38202
38698
|
keygen: keygen,
|
|
@@ -38209,6 +38705,7 @@ var Cascader = function Cascader(props0) {
|
|
|
38209
38705
|
shouldFinal: shouldFinal,
|
|
38210
38706
|
data: tempData,
|
|
38211
38707
|
id: path[i + 1],
|
|
38708
|
+
virtual: virtual,
|
|
38212
38709
|
parentId: path[i],
|
|
38213
38710
|
path: path.slice(0, i + 1)
|
|
38214
38711
|
}, p);
|
|
@@ -38880,18 +39377,37 @@ function useFormControl(props) {
|
|
|
38880
39377
|
var errors = arguments.length > 1 ? arguments[1] : undefined;
|
|
38881
39378
|
var severErrors = arguments.length > 2 ? arguments[2] : undefined;
|
|
38882
39379
|
if (!name) return;
|
|
38883
|
-
|
|
38884
|
-
|
|
38885
|
-
|
|
38886
|
-
|
|
38887
|
-
|
|
38888
|
-
|
|
38889
|
-
|
|
38890
|
-
|
|
38891
|
-
|
|
38892
|
-
|
|
39380
|
+
if (isArray(name)) {
|
|
39381
|
+
var _value = getValue(name, formValue);
|
|
39382
|
+
var _error = getError(name, errors, severErrors);
|
|
39383
|
+
if (_error !== errorState) {
|
|
39384
|
+
setErrorState(_error);
|
|
39385
|
+
}
|
|
39386
|
+
// format defaultValue
|
|
39387
|
+
var dv = isArray(defaultValue) ? defaultValue : [];
|
|
39388
|
+
var nextValue = [];
|
|
39389
|
+
name.forEach(function (n, index) {
|
|
39390
|
+
if (_value[index] === undefined && dv[index] !== undefined) {
|
|
39391
|
+
nextValue[index] = dv[index];
|
|
39392
|
+
} else {
|
|
39393
|
+
nextValue[index] = _value[index];
|
|
39394
|
+
}
|
|
39395
|
+
});
|
|
39396
|
+
setValueState(nextValue);
|
|
39397
|
+
} else {
|
|
39398
|
+
var _value2 = getValue(name, formValue);
|
|
39399
|
+
var _error2 = getError(name, errors, severErrors);
|
|
39400
|
+
if (_error2 !== errorState) {
|
|
39401
|
+
setErrorState(_error2);
|
|
39402
|
+
}
|
|
39403
|
+
if (!shallowEqual(_value2, latestInfo.valueState)) {
|
|
39404
|
+
if (_value2 === undefined && defaultValue !== undefined) {
|
|
39405
|
+
setValueState(defaultValue);
|
|
39406
|
+
} else {
|
|
39407
|
+
setValueState(_value2);
|
|
39408
|
+
}
|
|
39409
|
+
latestInfo.valueState = _value2;
|
|
38893
39410
|
}
|
|
38894
|
-
latestInfo.valueState = value;
|
|
38895
39411
|
}
|
|
38896
39412
|
});
|
|
38897
39413
|
var validateFiled = use_persist_fn(function (name, v, formV) {
|
|
@@ -41432,51 +41948,6 @@ var useDate = function useDate(props) {
|
|
|
41432
41948
|
};
|
|
41433
41949
|
};
|
|
41434
41950
|
/* harmony default export */ var use_date = (useDate);
|
|
41435
|
-
;// CONCATENATED MODULE: ../hooks/src/common/use-resize/index.ts
|
|
41436
|
-
|
|
41437
|
-
|
|
41438
|
-
|
|
41439
|
-
var useResize = function useResize(props) {
|
|
41440
|
-
var targetRef = props.targetRef,
|
|
41441
|
-
_props$timer = props.timer,
|
|
41442
|
-
timer = _props$timer === void 0 ? 100 : _props$timer;
|
|
41443
|
-
var _useState = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(0),
|
|
41444
|
-
_useState2 = slicedToArray_default()(_useState, 2),
|
|
41445
|
-
width = _useState2[0],
|
|
41446
|
-
setWidth = _useState2[1];
|
|
41447
|
-
var _useState3 = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(0),
|
|
41448
|
-
_useState4 = slicedToArray_default()(_useState3, 2),
|
|
41449
|
-
height = _useState4[0],
|
|
41450
|
-
setHeight = _useState4[1];
|
|
41451
|
-
(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
|
|
41452
|
-
if (!targetRef.current) return;
|
|
41453
|
-
var el = targetRef.current;
|
|
41454
|
-
if (el) {
|
|
41455
|
-
setWidth(el.clientWidth);
|
|
41456
|
-
setHeight(el.clientHeight);
|
|
41457
|
-
}
|
|
41458
|
-
var clean = addResizeObserver(el, function (entry) {
|
|
41459
|
-
var _props$cb;
|
|
41460
|
-
var _entry$0$contentRect = entry[0].contentRect,
|
|
41461
|
-
width = _entry$0$contentRect.width,
|
|
41462
|
-
height = _entry$0$contentRect.height;
|
|
41463
|
-
setWidth(width);
|
|
41464
|
-
setHeight(height);
|
|
41465
|
-
(_props$cb = props.cb) === null || _props$cb === void 0 || _props$cb.call(props, width, height);
|
|
41466
|
-
}, {
|
|
41467
|
-
timer: timer,
|
|
41468
|
-
direction: false
|
|
41469
|
-
});
|
|
41470
|
-
return function () {
|
|
41471
|
-
if (clean) clean();
|
|
41472
|
-
};
|
|
41473
|
-
}, [targetRef.current]);
|
|
41474
|
-
return {
|
|
41475
|
-
width: width,
|
|
41476
|
-
height: height
|
|
41477
|
-
};
|
|
41478
|
-
};
|
|
41479
|
-
/* harmony default export */ var use_resize = ((/* unused pure expression or super */ null && (useResize)));
|
|
41480
41951
|
;// CONCATENATED MODULE: ../hooks/src/components/use-datepicker/use-time.tsx
|
|
41481
41952
|
|
|
41482
41953
|
|
|
@@ -42886,11 +43357,13 @@ var Quick = function Quick(props) {
|
|
|
42886
43357
|
format = props.format,
|
|
42887
43358
|
options = props.options,
|
|
42888
43359
|
children = props.children,
|
|
42889
|
-
type = props.type
|
|
43360
|
+
type = props.type,
|
|
43361
|
+
closePop = props.closePop;
|
|
42890
43362
|
var styles = jssStyle === null || jssStyle === void 0 || (_jssStyle$datePicker = jssStyle.datePicker) === null || _jssStyle$datePicker === void 0 ? void 0 : _jssStyle$datePicker.call(jssStyle);
|
|
42891
43363
|
var quickDateCache = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)();
|
|
42892
43364
|
var quickActiveKey = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)();
|
|
42893
43365
|
var handleClick = function handleClick(item, index) {
|
|
43366
|
+
var immediate = item.immediate;
|
|
42894
43367
|
var itemV = isFunc(item.value) ? item.value() : item.value;
|
|
42895
43368
|
quickDateCache.current = itemV;
|
|
42896
43369
|
quickActiveKey.current = index;
|
|
@@ -42905,6 +43378,9 @@ var Quick = function Quick(props) {
|
|
|
42905
43378
|
});
|
|
42906
43379
|
props.setDateArr(dateArr);
|
|
42907
43380
|
props.setCurrentArr(dateArr, 'quick', item);
|
|
43381
|
+
if (immediate && closePop) {
|
|
43382
|
+
closePop();
|
|
43383
|
+
}
|
|
42908
43384
|
};
|
|
42909
43385
|
if (!(quickSelect !== null && quickSelect !== void 0 && quickSelect.length)) {
|
|
42910
43386
|
return children || null;
|
|
@@ -43282,6 +43758,7 @@ var Picker = function Picker(props) {
|
|
|
43282
43758
|
className: styles === null || styles === void 0 ? void 0 : styles.pickerBox,
|
|
43283
43759
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(quick, {
|
|
43284
43760
|
quickSelect: props.quickSelect,
|
|
43761
|
+
closePop: props.closePop,
|
|
43285
43762
|
range: props.range,
|
|
43286
43763
|
jssStyle: jssStyle,
|
|
43287
43764
|
dateArr: dateArr,
|
|
@@ -48943,383 +49420,6 @@ var usePaginationList = function usePaginationList(props) {
|
|
|
48943
49420
|
};
|
|
48944
49421
|
/* harmony default export */ var use_pagination_list = ((/* unused pure expression or super */ null && (usePaginationList)));
|
|
48945
49422
|
|
|
48946
|
-
;// CONCATENATED MODULE: ../base/src/virtual-scroll/scroll.tsx
|
|
48947
|
-
|
|
48948
|
-
|
|
48949
|
-
|
|
48950
|
-
|
|
48951
|
-
|
|
48952
|
-
|
|
48953
|
-
|
|
48954
|
-
var Scroll = function Scroll(props) {
|
|
48955
|
-
var containerRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(null);
|
|
48956
|
-
var scrollRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(null);
|
|
48957
|
-
var wrapperRef = useForkRef(scrollRef, props.wrapperRef);
|
|
48958
|
-
var _useRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)({
|
|
48959
|
-
timer: null,
|
|
48960
|
-
isMouseDown: false
|
|
48961
|
-
}),
|
|
48962
|
-
context = _useRef.current;
|
|
48963
|
-
var _props$scrollHeight = props.scrollHeight,
|
|
48964
|
-
scrollHeight = _props$scrollHeight === void 0 ? 0 : _props$scrollHeight,
|
|
48965
|
-
_props$scrollWidth = props.scrollWidth,
|
|
48966
|
-
scrollWidth = _props$scrollWidth === void 0 ? 0 : _props$scrollWidth,
|
|
48967
|
-
_props$defaultHeight = props.defaultHeight,
|
|
48968
|
-
defaultHeight = _props$defaultHeight === void 0 ? 0 : _props$defaultHeight;
|
|
48969
|
-
var _useResize = useResize({
|
|
48970
|
-
targetRef: containerRef
|
|
48971
|
-
}),
|
|
48972
|
-
width = _useResize.width,
|
|
48973
|
-
h = _useResize.height;
|
|
48974
|
-
var height = h || defaultHeight;
|
|
48975
|
-
var config = useConfig();
|
|
48976
|
-
var isRtl = config.direction === 'rtl';
|
|
48977
|
-
var scrollerStyle = props.scrollerStyle || {
|
|
48978
|
-
height: '100%',
|
|
48979
|
-
width: '100%',
|
|
48980
|
-
overflow: 'auto'
|
|
48981
|
-
};
|
|
48982
|
-
var containerStyle = defineProperty_default()(defineProperty_default()({
|
|
48983
|
-
height: '100%',
|
|
48984
|
-
width: '100%',
|
|
48985
|
-
display: 'inline-flex',
|
|
48986
|
-
overflow: 'hidden',
|
|
48987
|
-
position: 'sticky'
|
|
48988
|
-
}, isRtl ? 'right' : 'left', 0), "top", 0);
|
|
48989
|
-
var paddingTop = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo)(function () {
|
|
48990
|
-
return Math.max(0, Math.floor(scrollHeight - height));
|
|
48991
|
-
}, [scrollHeight, height]);
|
|
48992
|
-
var placeStyle = {
|
|
48993
|
-
paddingTop: paddingTop,
|
|
48994
|
-
width: scrollWidth,
|
|
48995
|
-
overflow: props.isScrollY ? 'hidden' : 'auto hidden',
|
|
48996
|
-
height: props.isScrollY ? 0 : 1,
|
|
48997
|
-
marginTop: props.isScrollY ? 0 : -1,
|
|
48998
|
-
lineHeight: 0
|
|
48999
|
-
};
|
|
49000
|
-
var extractHeightValue = function extractHeightValue(num) {
|
|
49001
|
-
if (isNumber(num)) return num;
|
|
49002
|
-
var match = num.match(/(\d+)/);
|
|
49003
|
-
if (match) {
|
|
49004
|
-
return parseInt(match[0], 10);
|
|
49005
|
-
}
|
|
49006
|
-
return undefined;
|
|
49007
|
-
};
|
|
49008
|
-
var handleScroll = usePersistFn(function (e) {
|
|
49009
|
-
var onScrollToBottom = props.onScrollToBottom;
|
|
49010
|
-
var target = e.currentTarget;
|
|
49011
|
-
var scrollLeft = target.scrollLeft,
|
|
49012
|
-
scrollTop = target.scrollTop;
|
|
49013
|
-
if (props.height && onScrollToBottom) {
|
|
49014
|
-
var realHeight = extractHeightValue(props.height);
|
|
49015
|
-
if (realHeight !== undefined) {
|
|
49016
|
-
var touchBottom = target.scrollHeight === scrollTop + realHeight;
|
|
49017
|
-
if (touchBottom) onScrollToBottom();
|
|
49018
|
-
}
|
|
49019
|
-
}
|
|
49020
|
-
var maxY = target.scrollHeight - target.clientHeight;
|
|
49021
|
-
var maxX = target.scrollWidth - target.clientWidth;
|
|
49022
|
-
if (!isRtl) {
|
|
49023
|
-
// 解决浏览器缩放以后导致滚动条长度出现小数
|
|
49024
|
-
if (maxX - scrollLeft < 0 || maxX - scrollLeft < 1) scrollLeft = maxX;
|
|
49025
|
-
if (scrollLeft < 0) scrollLeft = 0;
|
|
49026
|
-
} else {
|
|
49027
|
-
if (maxX + scrollLeft < 0 || maxX + scrollLeft < 1) scrollLeft = 0 - maxX;
|
|
49028
|
-
if (scrollLeft > 0) scrollLeft = 0;
|
|
49029
|
-
}
|
|
49030
|
-
if (scrollTop > maxY || maxY - scrollTop < 1) scrollTop = maxY;
|
|
49031
|
-
if (scrollTop < 0) scrollTop = 0;
|
|
49032
|
-
var x = maxX === 0 ? 0 : Math.min(Math.abs(scrollLeft) / maxX, 1);
|
|
49033
|
-
var y = maxY === 0 ? 0 : Math.min(scrollTop / maxY, 1);
|
|
49034
|
-
if (props.onScroll) props.onScroll({
|
|
49035
|
-
scrollLeft: scrollLeft,
|
|
49036
|
-
scrollTop: scrollTop,
|
|
49037
|
-
x: x,
|
|
49038
|
-
y: y,
|
|
49039
|
-
height: height,
|
|
49040
|
-
width: width,
|
|
49041
|
-
fromDrag: context.isMouseDown
|
|
49042
|
-
});
|
|
49043
|
-
});
|
|
49044
|
-
var handleInnerScroll = usePersistFn(function (e) {
|
|
49045
|
-
var scrollTop = e.currentTarget.scrollTop;
|
|
49046
|
-
if (scrollRef.current) {
|
|
49047
|
-
e.currentTarget.scrollTop = 0;
|
|
49048
|
-
scrollRef.current.scrollTop += scrollTop;
|
|
49049
|
-
}
|
|
49050
|
-
});
|
|
49051
|
-
return /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
49052
|
-
className: props.className,
|
|
49053
|
-
style: props.style,
|
|
49054
|
-
onMouseMove: props.onMouseMove,
|
|
49055
|
-
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", objectSpread2_default()(objectSpread2_default()({}, getDataAttribute({
|
|
49056
|
-
role: 'scroll'
|
|
49057
|
-
})), {}, {
|
|
49058
|
-
style: scrollerStyle,
|
|
49059
|
-
onScroll: handleScroll,
|
|
49060
|
-
ref: wrapperRef,
|
|
49061
|
-
onMouseDown: function onMouseDown() {
|
|
49062
|
-
context.isMouseDown = true;
|
|
49063
|
-
},
|
|
49064
|
-
onMouseUp: function onMouseUp() {
|
|
49065
|
-
context.isMouseDown = false;
|
|
49066
|
-
},
|
|
49067
|
-
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", objectSpread2_default()(objectSpread2_default()({}, getDataAttribute({
|
|
49068
|
-
role: 'scroll-container'
|
|
49069
|
-
})), {}, {
|
|
49070
|
-
style: containerStyle,
|
|
49071
|
-
ref: containerRef,
|
|
49072
|
-
onScroll: handleInnerScroll,
|
|
49073
|
-
children: /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
49074
|
-
style: objectSpread2_default()({
|
|
49075
|
-
flexGrow: 1
|
|
49076
|
-
}, props.childrenStyle),
|
|
49077
|
-
children: props.children
|
|
49078
|
-
})
|
|
49079
|
-
})), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
49080
|
-
style: placeStyle,
|
|
49081
|
-
children: "\xA0"
|
|
49082
|
-
})]
|
|
49083
|
-
}))
|
|
49084
|
-
});
|
|
49085
|
-
};
|
|
49086
|
-
/* harmony default export */ var virtual_scroll_scroll = (Scroll);
|
|
49087
|
-
;// CONCATENATED MODULE: ../base/src/virtual-scroll/virtual-scroll-list.tsx
|
|
49088
|
-
|
|
49089
|
-
|
|
49090
|
-
|
|
49091
|
-
|
|
49092
|
-
|
|
49093
|
-
|
|
49094
|
-
var VirtualList = function VirtualList(props) {
|
|
49095
|
-
var rowsInView = props.rowsInView,
|
|
49096
|
-
_props$data = props.data,
|
|
49097
|
-
data = _props$data === void 0 ? [] : _props$data,
|
|
49098
|
-
groupKey = props.groupKey,
|
|
49099
|
-
style = props.style,
|
|
49100
|
-
className = props.className,
|
|
49101
|
-
lineHeight = props.lineHeight,
|
|
49102
|
-
height = props.height,
|
|
49103
|
-
renderItem = props.renderItem,
|
|
49104
|
-
customRenderItem = props.customRenderItem,
|
|
49105
|
-
_props$tag = props.tag,
|
|
49106
|
-
tag = _props$tag === void 0 ? 'div' : _props$tag,
|
|
49107
|
-
tagClassName = props.tagClassName,
|
|
49108
|
-
dynamicVirtual = props.dynamicVirtual,
|
|
49109
|
-
virtualRef = props.virtualRef,
|
|
49110
|
-
onControlTypeChange = props.onControlTypeChange;
|
|
49111
|
-
var _useState = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(0),
|
|
49112
|
-
_useState2 = slicedToArray_default()(_useState, 2),
|
|
49113
|
-
top = _useState2[0],
|
|
49114
|
-
setTop = _useState2[1];
|
|
49115
|
-
var _useState3 = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(0),
|
|
49116
|
-
_useState4 = slicedToArray_default()(_useState3, 2),
|
|
49117
|
-
offsetY = _useState4[0],
|
|
49118
|
-
setOffsetY = _useState4[1];
|
|
49119
|
-
var _useState5 = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(props.data.length * lineHeight),
|
|
49120
|
-
_useState6 = slicedToArray_default()(_useState5, 2),
|
|
49121
|
-
scrollHeight = _useState6[0],
|
|
49122
|
-
setHeight = _useState6[1];
|
|
49123
|
-
var _useState7 = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(0),
|
|
49124
|
-
_useState8 = slicedToArray_default()(_useState7, 2),
|
|
49125
|
-
startIndex = _useState8[0],
|
|
49126
|
-
setStartIndex = _useState8[1];
|
|
49127
|
-
var wrapperRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(null);
|
|
49128
|
-
var _useRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)({
|
|
49129
|
-
cachedHeight: [],
|
|
49130
|
-
controlScrollRate: null,
|
|
49131
|
-
heightCallback: null,
|
|
49132
|
-
preIndex: null,
|
|
49133
|
-
topTimer: null,
|
|
49134
|
-
rateTimer: null,
|
|
49135
|
-
shouldUpdateHeight: true
|
|
49136
|
-
}),
|
|
49137
|
-
context = _useRef.current;
|
|
49138
|
-
var getContentHeight = function getContentHeight(index) {
|
|
49139
|
-
var sum = 0;
|
|
49140
|
-
for (var i = 0; i <= index; i++) {
|
|
49141
|
-
sum += context.cachedHeight[i] || lineHeight;
|
|
49142
|
-
}
|
|
49143
|
-
return sum;
|
|
49144
|
-
};
|
|
49145
|
-
var getCurrentIndex = usePersistFn(function () {
|
|
49146
|
-
return startIndex;
|
|
49147
|
-
});
|
|
49148
|
-
var getTop = usePersistFn(function () {
|
|
49149
|
-
return top;
|
|
49150
|
-
});
|
|
49151
|
-
var setRowHeight = usePersistFn(function (index, height) {
|
|
49152
|
-
var beforeHeight = context.cachedHeight[index];
|
|
49153
|
-
if (beforeHeight && beforeHeight === height) return;
|
|
49154
|
-
context.cachedHeight[index] = height;
|
|
49155
|
-
if (context.shouldUpdateHeight) {
|
|
49156
|
-
setHeight(getContentHeight(props.data.length - 1));
|
|
49157
|
-
}
|
|
49158
|
-
var preIndex = context.preIndex;
|
|
49159
|
-
// 解决: 从下往上滚 由于高度变化会导致滚动条跳动
|
|
49160
|
-
if (preIndex && preIndex > startIndex && startIndex === index) {
|
|
49161
|
-
// 发生在顶部
|
|
49162
|
-
if (context.heightCallback) return;
|
|
49163
|
-
var offset = height - (beforeHeight || lineHeight);
|
|
49164
|
-
setOffsetY(function (s) {
|
|
49165
|
-
return s + offset;
|
|
49166
|
-
});
|
|
49167
|
-
}
|
|
49168
|
-
});
|
|
49169
|
-
var updateRateScroll = usePersistFn(function (rate) {
|
|
49170
|
-
var sumHeight = getContentHeight(props.data.length - 1);
|
|
49171
|
-
if (sumHeight === scrollHeight) return;
|
|
49172
|
-
context.shouldUpdateHeight = true;
|
|
49173
|
-
context.heightCallback = function () {
|
|
49174
|
-
if (wrapperRef && wrapperRef.current) {
|
|
49175
|
-
var _scrollHeight = wrapperRef.current.scrollHeight;
|
|
49176
|
-
var clientHeight = wrapperRef.current.clientHeight;
|
|
49177
|
-
var nowTop = wrapperRef.current.scrollTop;
|
|
49178
|
-
var max = _scrollHeight - clientHeight;
|
|
49179
|
-
var _top = rate * max;
|
|
49180
|
-
if (Math.abs(nowTop - _top) < 1) {
|
|
49181
|
-
context.controlScrollRate = null;
|
|
49182
|
-
} else {
|
|
49183
|
-
context.controlScrollRate = rate;
|
|
49184
|
-
wrapperRef.current.scrollTop = _top;
|
|
49185
|
-
}
|
|
49186
|
-
}
|
|
49187
|
-
};
|
|
49188
|
-
setHeight(sumHeight);
|
|
49189
|
-
});
|
|
49190
|
-
var updateIndexAndTopFromTop = function updateIndexAndTopFromTop(scrollTop) {
|
|
49191
|
-
var sum = 0;
|
|
49192
|
-
var nextCurrentIndex = 0;
|
|
49193
|
-
var top = 0;
|
|
49194
|
-
var maxIndex = Math.max(props.data.length - rowsInView, 0);
|
|
49195
|
-
for (var i = 0; i <= maxIndex; i++) {
|
|
49196
|
-
sum += context.cachedHeight[i] || lineHeight;
|
|
49197
|
-
if (scrollTop < sum || i === maxIndex) {
|
|
49198
|
-
nextCurrentIndex = i;
|
|
49199
|
-
var beforeHeight = i === 0 ? 0 : sum - (context.cachedHeight[i] || lineHeight);
|
|
49200
|
-
top = scrollTop - beforeHeight;
|
|
49201
|
-
break;
|
|
49202
|
-
}
|
|
49203
|
-
}
|
|
49204
|
-
if (nextCurrentIndex !== startIndex) {
|
|
49205
|
-
setStartIndex(nextCurrentIndex);
|
|
49206
|
-
}
|
|
49207
|
-
setTop(top);
|
|
49208
|
-
};
|
|
49209
|
-
var handleScrollByStep = usePersistFn(function (step, top) {
|
|
49210
|
-
var _wrapperRef$current;
|
|
49211
|
-
var next = startIndex + step;
|
|
49212
|
-
(_wrapperRef$current = wrapperRef.current) === null || _wrapperRef$current === void 0 || _wrapperRef$current.scrollTo({
|
|
49213
|
-
top: next * lineHeight + (top || 0)
|
|
49214
|
-
});
|
|
49215
|
-
});
|
|
49216
|
-
var handleMouseMove = function handleMouseMove() {
|
|
49217
|
-
onControlTypeChange === null || onControlTypeChange === void 0 || onControlTypeChange('mouse');
|
|
49218
|
-
};
|
|
49219
|
-
var handleScroll = function handleScroll(info) {
|
|
49220
|
-
var _props$onScroll;
|
|
49221
|
-
var height = info.height,
|
|
49222
|
-
y = info.y,
|
|
49223
|
-
fromDrag = info.fromDrag;
|
|
49224
|
-
var scrollTop = info.scrollTop;
|
|
49225
|
-
context.shouldUpdateHeight = !fromDrag;
|
|
49226
|
-
var sumHeight = getContentHeight(props.data.length - 1);
|
|
49227
|
-
var max = sumHeight - height;
|
|
49228
|
-
if (scrollTop > max) {
|
|
49229
|
-
scrollTop = max;
|
|
49230
|
-
}
|
|
49231
|
-
if (fromDrag) {
|
|
49232
|
-
var _top2 = y * max;
|
|
49233
|
-
updateIndexAndTopFromTop(_top2);
|
|
49234
|
-
if (context.rateTimer) clearTimeout(context.rateTimer);
|
|
49235
|
-
context.rateTimer = setTimeout(function () {
|
|
49236
|
-
updateRateScroll(y);
|
|
49237
|
-
}, 120);
|
|
49238
|
-
} else {
|
|
49239
|
-
updateIndexAndTopFromTop(scrollTop);
|
|
49240
|
-
}
|
|
49241
|
-
(_props$onScroll = props.onScroll) === null || _props$onScroll === void 0 || _props$onScroll.call(props, info);
|
|
49242
|
-
};
|
|
49243
|
-
var renderList = function renderList() {
|
|
49244
|
-
var items = data.slice(startIndex, startIndex + rowsInView);
|
|
49245
|
-
var Tag = tag;
|
|
49246
|
-
var shouldScroll = getContentHeight(data.length - 1) > height;
|
|
49247
|
-
var nextStyle = objectSpread2_default()({}, style);
|
|
49248
|
-
if (shouldScroll) nextStyle.height = height;
|
|
49249
|
-
var scrollHeight = getContentHeight(data.length - 1);
|
|
49250
|
-
return /*#__PURE__*/(0,jsx_runtime.jsx)(virtual_scroll_scroll, {
|
|
49251
|
-
className: className,
|
|
49252
|
-
style: nextStyle,
|
|
49253
|
-
height: height,
|
|
49254
|
-
scrollWidth: 0,
|
|
49255
|
-
scrollHeight: scrollHeight,
|
|
49256
|
-
wrapperRef: wrapperRef,
|
|
49257
|
-
childrenStyle: {
|
|
49258
|
-
width: '100%'
|
|
49259
|
-
},
|
|
49260
|
-
onScroll: handleScroll,
|
|
49261
|
-
onMouseMove: handleMouseMove,
|
|
49262
|
-
children: /*#__PURE__*/(0,jsx_runtime.jsx)(Tag, {
|
|
49263
|
-
className: tagClassName,
|
|
49264
|
-
style: {
|
|
49265
|
-
transform: "translate3d(0, -".concat(top, "px, 0)")
|
|
49266
|
-
},
|
|
49267
|
-
children: items.map(function (d, i) {
|
|
49268
|
-
if (d[groupKey]) {
|
|
49269
|
-
return /*#__PURE__*/(0,jsx_runtime.jsx)((external_root_React_commonjs2_react_commonjs_react_amd_react_default()).Fragment, {
|
|
49270
|
-
children: customRenderItem(d, startIndex + i, i)
|
|
49271
|
-
}, i);
|
|
49272
|
-
}
|
|
49273
|
-
return /*#__PURE__*/(0,jsx_runtime.jsx)((external_root_React_commonjs2_react_commonjs_react_amd_react_default()).Fragment, {
|
|
49274
|
-
children: renderItem(d, startIndex + i, i, setRowHeight)
|
|
49275
|
-
}, dynamicVirtual ? startIndex + i : i);
|
|
49276
|
-
})
|
|
49277
|
-
})
|
|
49278
|
-
});
|
|
49279
|
-
};
|
|
49280
|
-
(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
|
|
49281
|
-
// 记录preIndex
|
|
49282
|
-
context.preIndex = startIndex;
|
|
49283
|
-
}, [startIndex]);
|
|
49284
|
-
(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useLayoutEffect)(function () {
|
|
49285
|
-
// 数据变化的时候清空掉 preIndex, 如果之前有缓存的index, setRowHeight 会有问题
|
|
49286
|
-
setTop(0);
|
|
49287
|
-
setStartIndex(0);
|
|
49288
|
-
return function () {
|
|
49289
|
-
context.preIndex = null;
|
|
49290
|
-
};
|
|
49291
|
-
}, [data.length]);
|
|
49292
|
-
(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
|
|
49293
|
-
if (offsetY) {
|
|
49294
|
-
if (wrapperRef.current) {
|
|
49295
|
-
setOffsetY(0);
|
|
49296
|
-
setTop(function (s) {
|
|
49297
|
-
return s + offsetY;
|
|
49298
|
-
});
|
|
49299
|
-
wrapperRef.current.scrollTop += offsetY;
|
|
49300
|
-
}
|
|
49301
|
-
}
|
|
49302
|
-
}, [offsetY, startIndex]);
|
|
49303
|
-
(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
|
|
49304
|
-
setHeight(getContentHeight(props.data.length - 1));
|
|
49305
|
-
}, [data.length]);
|
|
49306
|
-
(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
|
|
49307
|
-
if (context.heightCallback) {
|
|
49308
|
-
var cb = context.heightCallback;
|
|
49309
|
-
context.heightCallback = null;
|
|
49310
|
-
cb();
|
|
49311
|
-
}
|
|
49312
|
-
}, [scrollHeight]);
|
|
49313
|
-
(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
|
|
49314
|
-
if (virtualRef !== null && virtualRef !== void 0 && virtualRef.current) {
|
|
49315
|
-
virtualRef.current.scrollByStep = handleScrollByStep;
|
|
49316
|
-
virtualRef.current.getCurrentIndex = getCurrentIndex;
|
|
49317
|
-
virtualRef.current.getTop = getTop;
|
|
49318
|
-
}
|
|
49319
|
-
}, []);
|
|
49320
|
-
return renderList();
|
|
49321
|
-
};
|
|
49322
|
-
/* harmony default export */ var virtual_scroll_list = (VirtualList);
|
|
49323
49423
|
;// CONCATENATED MODULE: ../hooks/src/components/use-treeselect/use-tiled.tsx
|
|
49324
49424
|
|
|
49325
49425
|
|
|
@@ -51703,6 +51803,7 @@ function Select(props0) {
|
|
|
51703
51803
|
allowOnFilter: showInput,
|
|
51704
51804
|
focusSelected: focusSelected,
|
|
51705
51805
|
inputText: inputText,
|
|
51806
|
+
inputRef: inputRef,
|
|
51706
51807
|
filterText: filterText,
|
|
51707
51808
|
onFilter: handleFilter,
|
|
51708
51809
|
onRef: inputRef,
|
|
@@ -52618,6 +52719,7 @@ var list_list_List = function List(props) {
|
|
|
52618
52719
|
_props$pagination = props.pagination,
|
|
52619
52720
|
pagination = _props$pagination === void 0 ? {} : _props$pagination;
|
|
52620
52721
|
var listClasses = (_props$jssStyle = props.jssStyle) === null || _props$jssStyle === void 0 || (_props$jssStyle$list = _props$jssStyle.list) === null || _props$jssStyle$list === void 0 ? void 0 : _props$jssStyle$list.call(_props$jssStyle);
|
|
52722
|
+
var isEmpty = !isArray(data) || data.length <= 0;
|
|
52621
52723
|
var inputAble = useInputAble({
|
|
52622
52724
|
value: props.value,
|
|
52623
52725
|
onChange: props.onChange,
|
|
@@ -52741,6 +52843,7 @@ var list_list_List = function List(props) {
|
|
|
52741
52843
|
}
|
|
52742
52844
|
});
|
|
52743
52845
|
var renderList = function renderList() {
|
|
52846
|
+
if (isEmpty) return null;
|
|
52744
52847
|
if (props.fixed) return /*#__PURE__*/(0,jsx_runtime.jsxs)(jsx_runtime.Fragment, {
|
|
52745
52848
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(virtual_scroll_list, {
|
|
52746
52849
|
data: columnData,
|
|
@@ -52770,7 +52873,7 @@ var list_list_List = function List(props) {
|
|
|
52770
52873
|
}), renderFooter()]
|
|
52771
52874
|
});
|
|
52772
52875
|
};
|
|
52773
|
-
var wrapperClass = classnames_default()(props.className, listClasses === null || listClasses === void 0 ? void 0 : listClasses.wrapper, props.bordered && (listClasses === null || listClasses === void 0 ? void 0 : listClasses.wrapperBordered), props.size === 'small' && (listClasses === null || listClasses === void 0 ? void 0 : listClasses.wrapperSmall), props.size === 'large' && (listClasses === null || listClasses === void 0 ? void 0 : listClasses.wrapperLarge), props.striped && (listClasses === null || listClasses === void 0 ? void 0 : listClasses.wrapperStriped));
|
|
52876
|
+
var wrapperClass = classnames_default()(props.className, listClasses === null || listClasses === void 0 ? void 0 : listClasses.wrapper, isEmpty && (listClasses === null || listClasses === void 0 ? void 0 : listClasses.wrapperEmpty), props.bordered && (listClasses === null || listClasses === void 0 ? void 0 : listClasses.wrapperBordered), props.size === 'small' && (listClasses === null || listClasses === void 0 ? void 0 : listClasses.wrapperSmall), props.size === 'large' && (listClasses === null || listClasses === void 0 ? void 0 : listClasses.wrapperLarge), props.striped && (listClasses === null || listClasses === void 0 ? void 0 : listClasses.wrapperStriped));
|
|
52774
52877
|
var wrapperStyle = objectSpread2_default()(objectSpread2_default()({}, props.style), {}, {
|
|
52775
52878
|
height: props.height
|
|
52776
52879
|
});
|
|
@@ -52800,7 +52903,8 @@ var list_jssStyle = {
|
|
|
52800
52903
|
checkbox: useCheckboxStyle,
|
|
52801
52904
|
empty: useEmptyStyle,
|
|
52802
52905
|
spin: useSpinStyle,
|
|
52803
|
-
image: useImageStyle
|
|
52906
|
+
image: useImageStyle,
|
|
52907
|
+
select: useSelectStyle
|
|
52804
52908
|
};
|
|
52805
52909
|
/* harmony default export */ var src_list_list_0 = (function (props) {
|
|
52806
52910
|
return /*#__PURE__*/(0,jsx_runtime.jsx)(src_list_list, objectSpread2_default()({
|
|
@@ -65267,7 +65371,7 @@ var upload_interface = __webpack_require__(8821);
|
|
|
65267
65371
|
|
|
65268
65372
|
|
|
65269
65373
|
/* harmony default export */ var src_0 = ({
|
|
65270
|
-
version: '3.5.0-beta.
|
|
65374
|
+
version: '3.5.0-beta.4'
|
|
65271
65375
|
});
|
|
65272
65376
|
}();
|
|
65273
65377
|
/******/ return __webpack_exports__;
|