shineout 3.7.1-beta.9 → 3.7.2-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/cjs/index.js CHANGED
@@ -522,5 +522,5 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
522
522
  // 此文件由脚本自动生成,请勿直接修改。
523
523
  // This file was generated automatically by a script. Please do not modify it directly.
524
524
  var _default = exports.default = {
525
- version: '3.7.1-beta.9'
525
+ version: '3.7.2-beta.1'
526
526
  };
package/dist/shineout.js CHANGED
@@ -12227,7 +12227,7 @@ var handleStyle = function handleStyle(style) {
12227
12227
  };
12228
12228
  /* harmony default export */ var jss_style_handleStyle = (handleStyle);
12229
12229
  ;// CONCATENATED MODULE: ../shineout-style/src/version.ts
12230
- /* harmony default export */ var version = ('3.7.1-beta.9');
12230
+ /* harmony default export */ var version = ('3.7.2-beta.1');
12231
12231
  ;// CONCATENATED MODULE: ../shineout-style/src/jss-style/index.tsx
12232
12232
 
12233
12233
 
@@ -29086,7 +29086,7 @@ var treeSelectStyle = objectSpread2_default()(objectSpread2_default()({
29086
29086
  color: src.treeSelectOptionDisabledColor,
29087
29087
  backgroundColor: src.treeSelectOptionDisabledBackgroundColor
29088
29088
  },
29089
- '&&:not([data-active="true"]):hover > div': {
29089
+ '&&:not([data-active="true"]) > [data-role="text"]:hover': {
29090
29090
  backgroundColor: src.treeSelectContentDisabledHoverBackgroundColor
29091
29091
  }
29092
29092
  },
@@ -39842,11 +39842,14 @@ var CascaderNode = function CascaderNode(props) {
39842
39842
  shouldFinal = props.shouldFinal,
39843
39843
  onChange = props.onChange,
39844
39844
  onPathChange = props.onPathChange,
39845
- mode = props.mode;
39845
+ mode = props.mode,
39846
+ activeLeaf = props.activeLeaf,
39847
+ setActiveLeaf = props.setActiveLeaf;
39846
39848
  var _useState = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(false),
39847
39849
  _useState2 = slicedToArray_default()(_useState, 2),
39848
39850
  loading = _useState2[0],
39849
39851
  setLoading = _useState2[1];
39852
+ // const [activeState, setActiveState] = useState(false);
39850
39853
  var checkboxRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)();
39851
39854
  var isDisabled = datum.isDisabled(id);
39852
39855
  var children = data[childrenKey];
@@ -39854,7 +39857,7 @@ var CascaderNode = function CascaderNode(props) {
39854
39857
  var uncertainChildren = loader && !loading && children === undefined;
39855
39858
  var styles = jssStyle === null || jssStyle === void 0 || (_jssStyle$cascader = jssStyle.cascader) === null || _jssStyle$cascader === void 0 ? void 0 : _jssStyle$cascader.call(jssStyle);
39856
39859
  var commonStyles = jssStyle === null || jssStyle === void 0 || (_jssStyle$common = jssStyle.common) === null || _jssStyle$common === void 0 ? void 0 : _jssStyle$common.call(jssStyle);
39857
- var rootClass = classnames_default()(styles.option, active && styles.activeOption, isDisabled && mode !== 4 && styles.optionDisabled);
39860
+ var rootClass = classnames_default()(styles.option, (active || activeLeaf === id) && styles.activeOption, isDisabled && mode !== 4 && styles.optionDisabled);
39858
39861
  var handlePathChange = function handlePathChange() {
39859
39862
  onPathChange === null || onPathChange === void 0 || onPathChange(id, data, path);
39860
39863
  };
@@ -39878,6 +39881,9 @@ var CascaderNode = function CascaderNode(props) {
39878
39881
  if (getParent(e.target, checkboxRef.current)) return;
39879
39882
  var checked = datum.getChecked(id);
39880
39883
  handleChange(null, !checked);
39884
+ if (setActiveLeaf) {
39885
+ setActiveLeaf(id);
39886
+ }
39881
39887
  };
39882
39888
  var isHoverAble = expandTrigger === 'hover' || expandTrigger === 'hover-only';
39883
39889
  var isRealLeafNode = !hasChildren && !uncertainChildren;
@@ -39960,6 +39966,7 @@ var CascaderNode = function CascaderNode(props) {
39960
39966
 
39961
39967
 
39962
39968
 
39969
+
39963
39970
  var list_devUseWarning = devUseWarning;
39964
39971
  var CascaderList = function CascaderList(props) {
39965
39972
  var _jssStyle$cascader;
@@ -40016,11 +40023,18 @@ var CascaderList = function CascaderList(props) {
40016
40023
  children: "noData"
40017
40024
  });
40018
40025
  };
40026
+ var _useState = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(),
40027
+ _useState2 = slicedToArray_default()(_useState, 2),
40028
+ activeLeaf = _useState2[0],
40029
+ setActiveLeaf = _useState2[1];
40030
+ var needSetActiveLeaf = (multiple || mode !== undefined) && props.id === undefined;
40019
40031
  var renderItem = function renderItem(item, index) {
40020
40032
  var id = getKey(item, index);
40021
40033
  return /*#__PURE__*/(0,jsx_runtime.jsx)(node, {
40022
40034
  jssStyle: jssStyle,
40023
40035
  active: props.id === id,
40036
+ activeLeaf: activeLeaf,
40037
+ setActiveLeaf: needSetActiveLeaf ? setActiveLeaf : undefined,
40024
40038
  id: id,
40025
40039
  data: item,
40026
40040
  datum: datum,
@@ -54374,6 +54388,7 @@ var NodeContent = function NodeContent(props) {
54374
54388
  children: [onChange && renderCheckbox(), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
54375
54389
  dir: config.direction,
54376
54390
  className: contentStyle.text,
54391
+ "data-role": "text",
54377
54392
  onDoubleClick: onNodeDoubleClick,
54378
54393
  onClick: handleNodeClick,
54379
54394
  children: renderNode()
@@ -71339,7 +71354,7 @@ var upload_interface = __webpack_require__(8821);
71339
71354
 
71340
71355
 
71341
71356
  /* harmony default export */ var src_0 = ({
71342
- version: '3.7.1-beta.9'
71357
+ version: '3.7.2-beta.1'
71343
71358
  });
71344
71359
  }();
71345
71360
  /******/ return __webpack_exports__;