shineout 3.6.0-beta.27 → 3.6.0-beta.29
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/dist/shineout.js +53 -31
- 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/package.json +5 -5
package/cjs/index.js
CHANGED
|
@@ -514,5 +514,5 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
514
514
|
// 此文件由脚本自动生成,请勿直接修改。
|
|
515
515
|
// This file was generated automatically by a script. Please do not modify it directly.
|
|
516
516
|
var _default = exports.default = {
|
|
517
|
-
version: '3.6.0-beta.
|
|
517
|
+
version: '3.6.0-beta.29'
|
|
518
518
|
};
|
package/dist/shineout.js
CHANGED
|
@@ -12139,7 +12139,7 @@ var handleStyle = function handleStyle(style) {
|
|
|
12139
12139
|
};
|
|
12140
12140
|
/* harmony default export */ var jss_style_handleStyle = (handleStyle);
|
|
12141
12141
|
;// CONCATENATED MODULE: ../shineout-style/src/version.ts
|
|
12142
|
-
/* harmony default export */ var version = ('3.6.0-beta.
|
|
12142
|
+
/* harmony default export */ var version = ('3.6.0-beta.29');
|
|
12143
12143
|
;// CONCATENATED MODULE: ../shineout-style/src/jss-style/index.tsx
|
|
12144
12144
|
|
|
12145
12145
|
|
|
@@ -25654,6 +25654,7 @@ var tableStyle = objectSpread2_default()(objectSpread2_default()({
|
|
|
25654
25654
|
},
|
|
25655
25655
|
'&::after': {
|
|
25656
25656
|
position: 'absolute',
|
|
25657
|
+
zIndex: fixedFixedIndex + 3,
|
|
25657
25658
|
content: '""',
|
|
25658
25659
|
display: 'block',
|
|
25659
25660
|
bottom: 0,
|
|
@@ -27762,6 +27763,9 @@ var treeStyle = {
|
|
|
27762
27763
|
notTree: {
|
|
27763
27764
|
'&$root > $node$leaf': {
|
|
27764
27765
|
paddingLeft: 0
|
|
27766
|
+
},
|
|
27767
|
+
'& $content': {
|
|
27768
|
+
marginLeft: 0
|
|
27765
27769
|
}
|
|
27766
27770
|
},
|
|
27767
27771
|
line: {
|
|
@@ -27912,14 +27916,16 @@ var treeStyle = {
|
|
|
27912
27916
|
flex: 1,
|
|
27913
27917
|
display: 'flex',
|
|
27914
27918
|
alignItems: 'center',
|
|
27919
|
+
marginLeft: 4,
|
|
27915
27920
|
// 'label&': {
|
|
27916
27921
|
// cursor: 'pointer',
|
|
27917
27922
|
// userSelect: 'none',
|
|
27918
27923
|
// },
|
|
27919
27924
|
|
|
27920
|
-
'$iconWrapper + &': {
|
|
27921
|
-
|
|
27922
|
-
},
|
|
27925
|
+
// '$iconWrapper + &': {
|
|
27926
|
+
// marginLeft: 4,
|
|
27927
|
+
// },
|
|
27928
|
+
|
|
27923
27929
|
'$contentDisabled &': {
|
|
27924
27930
|
'& $text': {
|
|
27925
27931
|
color: src.treeContentDisabledFontColor
|
|
@@ -37896,7 +37902,6 @@ function use_tree_toArray(value) {
|
|
|
37896
37902
|
if (!Array.isArray(value)) return [value];
|
|
37897
37903
|
return value;
|
|
37898
37904
|
}
|
|
37899
|
-
var global_tree_map = new Map();
|
|
37900
37905
|
var MODE = {
|
|
37901
37906
|
/**
|
|
37902
37907
|
* 返回全选数据,包含父节点和子节点
|
|
@@ -38299,15 +38304,6 @@ var useTree = function useTree(props) {
|
|
|
38299
38304
|
return 2;
|
|
38300
38305
|
};
|
|
38301
38306
|
var setData = function setData(data) {
|
|
38302
|
-
// if(data && global_tree_map.get(data)){
|
|
38303
|
-
// context.cachedValue = global_tree_map.get(data)?.cachedValue || []
|
|
38304
|
-
// context.pathMap = global_tree_map.get(data)?.pathMap || new Map()
|
|
38305
|
-
// context.dataMap = global_tree_map.get(data)?.dataMap || new Map()
|
|
38306
|
-
// context.valueMap = global_tree_map.get(data)?.valueMap || new Map()
|
|
38307
|
-
// context.unmatchedValueMap = global_tree_map.get(data)?.unmatchedValueMap || new Map()
|
|
38308
|
-
// return
|
|
38309
|
-
// }
|
|
38310
|
-
|
|
38311
38307
|
var prevValue = context.value || [];
|
|
38312
38308
|
context.cachedValue = [];
|
|
38313
38309
|
context.pathMap = new Map();
|
|
@@ -38328,8 +38324,6 @@ var useTree = function useTree(props) {
|
|
|
38328
38324
|
}
|
|
38329
38325
|
initValue();
|
|
38330
38326
|
setValue(prevValue);
|
|
38331
|
-
|
|
38332
|
-
// global_tree_map.set(data, context)
|
|
38333
38327
|
};
|
|
38334
38328
|
var set = function set(id, checked, direction) {
|
|
38335
38329
|
if (!isDisabled(id)) {
|
|
@@ -38371,6 +38365,28 @@ var useTree = function useTree(props) {
|
|
|
38371
38365
|
}
|
|
38372
38366
|
return current;
|
|
38373
38367
|
};
|
|
38368
|
+
var updateInnerCheckStatus = function updateInnerCheckStatus() {
|
|
38369
|
+
var _context$value;
|
|
38370
|
+
if (mode !== MODE.MODE_0) return;
|
|
38371
|
+
(_context$value = context.value) === null || _context$value === void 0 || _context$value.forEach(function (id) {
|
|
38372
|
+
var _ref3 = context.pathMap.get(id),
|
|
38373
|
+
children = _ref3.children;
|
|
38374
|
+
if (children.length) {
|
|
38375
|
+
var noCheckedChildren = children.filter(function (cid) {
|
|
38376
|
+
var _context$value2;
|
|
38377
|
+
return !((_context$value2 = context.value) !== null && _context$value2 !== void 0 && _context$value2.includes(cid));
|
|
38378
|
+
});
|
|
38379
|
+
if (noCheckedChildren.length > 0) {
|
|
38380
|
+
setTimeout(function () {
|
|
38381
|
+
setValueMap(id, 2);
|
|
38382
|
+
noCheckedChildren.forEach(function (cid) {
|
|
38383
|
+
setValueMap(cid, 0);
|
|
38384
|
+
});
|
|
38385
|
+
}, 0);
|
|
38386
|
+
}
|
|
38387
|
+
}
|
|
38388
|
+
});
|
|
38389
|
+
};
|
|
38374
38390
|
var appendChildrenExpanded = function appendChildrenExpanded(child, level, pid, insertData) {
|
|
38375
38391
|
if (!child) return;
|
|
38376
38392
|
child.forEach(function (item, i) {
|
|
@@ -38481,6 +38497,7 @@ var useTree = function useTree(props) {
|
|
|
38481
38497
|
if (props.datum) return;
|
|
38482
38498
|
if (!dataUpdate) return;
|
|
38483
38499
|
setData(data);
|
|
38500
|
+
updateInnerCheckStatus();
|
|
38484
38501
|
}, [data]);
|
|
38485
38502
|
(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
|
|
38486
38503
|
if (props.datum) return;
|
|
@@ -38644,7 +38661,9 @@ var Scroll = function Scroll(props) {
|
|
|
38644
38661
|
_props$scrollWidth = props.scrollWidth,
|
|
38645
38662
|
scrollWidth = _props$scrollWidth === void 0 ? 0 : _props$scrollWidth,
|
|
38646
38663
|
_props$defaultHeight = props.defaultHeight,
|
|
38647
|
-
defaultHeight = _props$defaultHeight === void 0 ? 0 : _props$defaultHeight
|
|
38664
|
+
defaultHeight = _props$defaultHeight === void 0 ? 0 : _props$defaultHeight,
|
|
38665
|
+
_props$keepScrollTop = props.keepScrollTop,
|
|
38666
|
+
keepScrollTop = _props$keepScrollTop === void 0 ? false : _props$keepScrollTop;
|
|
38648
38667
|
var _useResize = useResize({
|
|
38649
38668
|
targetRef: containerRef,
|
|
38650
38669
|
timer: 100
|
|
@@ -38668,7 +38687,10 @@ var Scroll = function Scroll(props) {
|
|
|
38668
38687
|
}, isRtl ? 'right' : 'left', 0), "top", 0);
|
|
38669
38688
|
|
|
38670
38689
|
// 当滚动容器的高度为 0 时,paddingTop 为 0,避免滚动条抖动现象
|
|
38671
|
-
var paddingTop =
|
|
38690
|
+
var paddingTop = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo)(function () {
|
|
38691
|
+
if (keepScrollTop) return Math.max(0, Math.floor(scrollHeight - height));
|
|
38692
|
+
return height === 0 ? 0 : Math.max(0, Math.floor(scrollHeight - height));
|
|
38693
|
+
}, [scrollHeight, height]);
|
|
38672
38694
|
var placeStyle = {
|
|
38673
38695
|
paddingTop: paddingTop,
|
|
38674
38696
|
width: scrollWidth,
|
|
@@ -38780,6 +38802,7 @@ var VirtualList = function VirtualList(props) {
|
|
|
38780
38802
|
className = props.className,
|
|
38781
38803
|
lineHeight = props.lineHeight,
|
|
38782
38804
|
height = props.height,
|
|
38805
|
+
keepScrollTop = props.keepScrollTop,
|
|
38783
38806
|
keepScrollHeight = props.keepScrollHeight,
|
|
38784
38807
|
renderItem = props.renderItem,
|
|
38785
38808
|
customRenderItem = props.customRenderItem,
|
|
@@ -38946,6 +38969,7 @@ var VirtualList = function VirtualList(props) {
|
|
|
38946
38969
|
style: nextStyle,
|
|
38947
38970
|
height: height,
|
|
38948
38971
|
scrollWidth: 0,
|
|
38972
|
+
keepScrollTop: keepScrollTop,
|
|
38949
38973
|
scrollerStyle: scrollerStyle,
|
|
38950
38974
|
scrollHeight: scrollHeight,
|
|
38951
38975
|
childrenStyle: {
|
|
@@ -38976,6 +39000,7 @@ var VirtualList = function VirtualList(props) {
|
|
|
38976
39000
|
}, [startIndex]);
|
|
38977
39001
|
(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useLayoutEffect)(function () {
|
|
38978
39002
|
// 数据变化的时候清空掉 preIndex, 如果之前有缓存的index, setRowHeight 会有问题
|
|
39003
|
+
if (keepScrollTop) return;
|
|
38979
39004
|
if (keepScrollHeight) return;
|
|
38980
39005
|
setTop(0);
|
|
38981
39006
|
setStartIndex(0);
|
|
@@ -53020,6 +53045,7 @@ var list_List = function List(props) {
|
|
|
53020
53045
|
return /*#__PURE__*/(0,jsx_runtime.jsx)(virtual_scroll_list, {
|
|
53021
53046
|
virtualRef: virtualRef,
|
|
53022
53047
|
data: data,
|
|
53048
|
+
keepScrollTop: true,
|
|
53023
53049
|
keygen: keygen,
|
|
53024
53050
|
tag: 'ul',
|
|
53025
53051
|
groupKey: groupKey,
|
|
@@ -54111,7 +54137,7 @@ var TreeVirtual = function TreeVirtual(props) {
|
|
|
54111
54137
|
|
|
54112
54138
|
|
|
54113
54139
|
|
|
54114
|
-
var tree_excluded = ["jssStyle", "line", "childrenKey", "data", "value", "mode", "keygen", "virtual", "expanded", "expandIcons", "iconClass", "leafClass", "nodeClass", "contentClass", "rootStyle", "renderItem", "defaultValue", "dataUpdate", "childrenClass", "defaultExpandAll", "defaultExpanded", "parentClickExpand", "doubleClickExpand", "dragImageSelector", "dragImageStyle", "dragSibling", "unmatch", "ignoreSetFlat", "dragHoverExpand", "active", "setActive", "disabled", "inlineNode", "highlight", "className", "onClick", "loader", "getDatum", "onDrop", "onExpand", "onChange", "onDragEnd", "onDragLeave", "onDragOver", "onDragStart", "datum", "actionOnClick"];
|
|
54140
|
+
var tree_excluded = ["jssStyle", "line", "childrenKey", "data", "value", "mode", "keygen", "virtual", "expanded", "expandIcons", "iconClass", "leafClass", "nodeClass", "contentClass", "rootStyle", "renderItem", "defaultValue", "dataUpdate", "childrenClass", "defaultExpandAll", "defaultExpanded", "parentClickExpand", "doubleClickExpand", "dragImageSelector", "dragImageStyle", "dragSibling", "unmatch", "ignoreSetFlat", "dragHoverExpand", "active", "setActive", "disabled", "inlineNode", "highlight", "className", "onClick", "loader", "getDatum", "onDrop", "onExpand", "onChange", "onDragEnd", "onDragLeave", "onDragOver", "onDragStart", "datum", "actionOnClick", "tiledData"];
|
|
54115
54141
|
|
|
54116
54142
|
|
|
54117
54143
|
|
|
@@ -54174,6 +54200,7 @@ var Tree = function Tree(props) {
|
|
|
54174
54200
|
onDragStart = props.onDragStart,
|
|
54175
54201
|
propsDatum = props.datum,
|
|
54176
54202
|
actionOnClick = props.actionOnClick,
|
|
54203
|
+
tiledData = props.tiledData,
|
|
54177
54204
|
rest = objectWithoutProperties_default()(props, tree_excluded);
|
|
54178
54205
|
var _useState = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(propActive),
|
|
54179
54206
|
_useState2 = slicedToArray_default()(_useState, 2),
|
|
@@ -54341,7 +54368,6 @@ var Tree = function Tree(props) {
|
|
|
54341
54368
|
actionOnClick: actionOnClick
|
|
54342
54369
|
}));
|
|
54343
54370
|
}
|
|
54344
|
-
console.log('data', data);
|
|
54345
54371
|
return /*#__PURE__*/(0,jsx_runtime.jsx)(tree_root, {
|
|
54346
54372
|
rootStyle: rootStyle,
|
|
54347
54373
|
isControlled: 'expanded' in props,
|
|
@@ -55502,9 +55528,7 @@ function Select(props0) {
|
|
|
55502
55528
|
className: classnames_default()(styles === null || styles === void 0 ? void 0 : styles.pickerWrapper, size === 'small' && (styles === null || styles === void 0 ? void 0 : styles.pickerSmall), size === 'large' && (styles === null || styles === void 0 ? void 0 : styles.pickerLarge)),
|
|
55503
55529
|
onAnimationAfterEnter: onAnimationAfterEnter,
|
|
55504
55530
|
display: 'block',
|
|
55505
|
-
type: "scale-y"
|
|
55506
|
-
// type='fade'
|
|
55507
|
-
,
|
|
55531
|
+
type: "scale-y",
|
|
55508
55532
|
duration: 'fast',
|
|
55509
55533
|
style: getListStyle(),
|
|
55510
55534
|
children: [renderHeader(), renderOptions(), renderFooter()]
|
|
@@ -65440,6 +65464,10 @@ var TreeSelect = function TreeSelect(props0) {
|
|
|
65440
65464
|
tiledData = _useTiled.data,
|
|
65441
65465
|
onTiledFilter = _useTiled.onFilter,
|
|
65442
65466
|
tiledExpandIcons = _useTiled.expandIcons;
|
|
65467
|
+
var handleExpanded = function handleExpanded(id) {
|
|
65468
|
+
setVirtualExpanded(id);
|
|
65469
|
+
onExpand === null || onExpand === void 0 || onExpand(id);
|
|
65470
|
+
};
|
|
65443
65471
|
var _useTree = use_tree({
|
|
65444
65472
|
mode: mode,
|
|
65445
65473
|
value: value,
|
|
@@ -65451,14 +65479,13 @@ var TreeSelect = function TreeSelect(props0) {
|
|
|
65451
65479
|
active: multiple ? undefined : value[0],
|
|
65452
65480
|
childrenKey: childrenKey,
|
|
65453
65481
|
keygen: keygen,
|
|
65454
|
-
onExpand:
|
|
65482
|
+
onExpand: handleExpanded,
|
|
65455
65483
|
expanded: controlExpanded,
|
|
65456
65484
|
defaultExpanded: defaultExpanded,
|
|
65457
65485
|
defaultExpandAll: defaultExpandAll,
|
|
65458
65486
|
isControlled: controlExpanded !== undefined
|
|
65459
65487
|
}),
|
|
65460
65488
|
datum = _useTree.datum,
|
|
65461
|
-
onExpandTree = _useTree.onExpand,
|
|
65462
65489
|
unControlExpanded = _useTree.expanded;
|
|
65463
65490
|
var onCollapse = usePersistFn(function (collapse) {
|
|
65464
65491
|
onCollapseProp === null || onCollapseProp === void 0 || onCollapseProp(collapse);
|
|
@@ -65526,10 +65553,6 @@ var TreeSelect = function TreeSelect(props0) {
|
|
|
65526
65553
|
openPop();
|
|
65527
65554
|
}
|
|
65528
65555
|
});
|
|
65529
|
-
var handleExpanded = function handleExpanded(id) {
|
|
65530
|
-
setVirtualExpanded(id);
|
|
65531
|
-
onExpandTree(id);
|
|
65532
|
-
};
|
|
65533
65556
|
var focusAndOpen = function focusAndOpen() {
|
|
65534
65557
|
if (!focused) {
|
|
65535
65558
|
var _inputRef$current2;
|
|
@@ -65667,7 +65690,6 @@ var TreeSelect = function TreeSelect(props0) {
|
|
|
65667
65690
|
};
|
|
65668
65691
|
(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
|
|
65669
65692
|
if (virtual && expanded) {
|
|
65670
|
-
console.log(expanded);
|
|
65671
65693
|
setVirtualExpanded(expanded);
|
|
65672
65694
|
}
|
|
65673
65695
|
}, [expanded]);
|
|
@@ -69583,7 +69605,7 @@ var upload_interface = __webpack_require__(8821);
|
|
|
69583
69605
|
|
|
69584
69606
|
|
|
69585
69607
|
/* harmony default export */ var src_0 = ({
|
|
69586
|
-
version: '3.6.0-beta.
|
|
69608
|
+
version: '3.6.0-beta.29'
|
|
69587
69609
|
});
|
|
69588
69610
|
}();
|
|
69589
69611
|
/******/ return __webpack_exports__;
|