shineout 3.6.4-beta.4 → 3.6.4-beta.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/cjs/index.js CHANGED
@@ -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.4-beta.4'
517
+ version: '3.6.4-beta.6'
518
518
  };
package/dist/shineout.js CHANGED
@@ -12217,7 +12217,7 @@ var handleStyle = function handleStyle(style) {
12217
12217
  };
12218
12218
  /* harmony default export */ var jss_style_handleStyle = (handleStyle);
12219
12219
  ;// CONCATENATED MODULE: ../shineout-style/src/version.ts
12220
- /* harmony default export */ var version = ('3.6.4-beta.4');
12220
+ /* harmony default export */ var version = ('3.6.4-beta.6');
12221
12221
  ;// CONCATENATED MODULE: ../shineout-style/src/jss-style/index.tsx
12222
12222
 
12223
12223
 
@@ -29986,19 +29986,6 @@ var usePopup = function usePopup(props) {
29986
29986
  };
29987
29987
  };
29988
29988
  /* harmony default export */ var use_popup = (usePopup);
29989
- ;// CONCATENATED MODULE: ../hooks/src/utils/attribute.ts
29990
- var getDataAttribute = function getDataAttribute(attrs) {
29991
- return Object.keys(attrs).reduce(function (acc, key) {
29992
- var ns = "data-soui-".concat(key);
29993
- if (attrs[key] !== undefined) {
29994
- acc[ns] = attrs[key];
29995
- }
29996
- return acc;
29997
- }, {});
29998
- };
29999
- var getDataAttributeName = function getDataAttributeName(name) {
30000
- return "data-soui-".concat(name);
30001
- };
30002
29989
  ;// CONCATENATED MODULE: ../hooks/src/utils/func.ts
30003
29990
  // 节流函数
30004
29991
  var throttle = function throttle(func, wait) {
@@ -30217,6 +30204,19 @@ var getFieldId = function getFieldId(name, formName) {
30217
30204
  if (!name) return undefined;
30218
30205
  return "".concat(formName ? "".concat(formName, "_") : '').concat(name);
30219
30206
  };
30207
+ ;// CONCATENATED MODULE: ../hooks/src/utils/attribute.ts
30208
+ var getDataAttribute = function getDataAttribute(attrs) {
30209
+ return Object.keys(attrs).reduce(function (acc, key) {
30210
+ var ns = "data-soui-".concat(key);
30211
+ if (attrs[key] !== undefined) {
30212
+ acc[ns] = attrs[key];
30213
+ }
30214
+ return acc;
30215
+ }, {});
30216
+ };
30217
+ var getDataAttributeName = function getDataAttributeName(name) {
30218
+ return "data-soui-".concat(name);
30219
+ };
30220
30220
  ;// CONCATENATED MODULE: ../hooks/src/common/use-position-style/get-position-style.ts
30221
30221
 
30222
30222
  var ReverseDir = {
@@ -30658,13 +30658,6 @@ var usePositionStyle = function usePositionStyle(config) {
30658
30658
  style.right = containerRect.right - rect.right + containerScrollBarWidth - containerScroll.left - (offset ? offset[0] : 0);
30659
30659
  style.left = 'auto';
30660
30660
  style.transform = '';
30661
- if (adjust) {
30662
- overLeft = bodyRect.left - (rect.right - context.popUpWidth);
30663
- if (style.right < 0 && targetRect) {
30664
- style.left = bodyRect.width - targetRect.width;
30665
- style.right = 'auto';
30666
- }
30667
- }
30668
30661
  } else {
30669
30662
  // 居中对齐
30670
30663
  style.left = rect.left + rect.width / 2 - containerRect.left + containerScroll.left;
@@ -31536,6 +31529,7 @@ var AbsoluteList = function AbsoluteList(props) {
31536
31529
 
31537
31530
 
31538
31531
 
31532
+
31539
31533
  var emptyEvent = function emptyEvent(e) {
31540
31534
  return e.stopPropagation();
31541
31535
  };
@@ -31594,7 +31588,17 @@ var Popover = function Popover(props) {
31594
31588
  Provider = _usePopup.Provider,
31595
31589
  providerValue = _usePopup.providerValue;
31596
31590
  var events = getTargetProps();
31591
+ var _React$useState = external_root_React_commonjs2_react_commonjs_react_amd_react_default().useState(0),
31592
+ _React$useState2 = slicedToArray_default()(_React$useState, 2),
31593
+ updateKey = _React$useState2[0],
31594
+ setUpdateKey = _React$useState2[1];
31595
+ var handleUpdateKey = function handleUpdateKey() {
31596
+ setUpdateKey(function (prev) {
31597
+ return (prev + 1) % 2;
31598
+ });
31599
+ };
31597
31600
  var bindEvents = function bindEvents() {
31601
+ var _window;
31598
31602
  var targetEl = targetRef.current;
31599
31603
  if (!targetEl) return;
31600
31604
  if (events.onMouseEnter) targetEl.addEventListener('mouseenter', events.onMouseEnter);
@@ -31604,8 +31608,14 @@ var Popover = function Popover(props) {
31604
31608
  if (trigger === 'hover' && props.clickToCancelDelay && props.mouseEnterDelay) {
31605
31609
  targetEl.addEventListener('click', closePop);
31606
31610
  }
31611
+ (_window = window) === null || _window === void 0 || _window.addEventListener('resize', handleUpdateKey);
31612
+ var scrollContainer = getClosestScrollContainer(targetEl);
31613
+ if (scrollContainer) {
31614
+ scrollContainer.addEventListener('scroll', handleUpdateKey);
31615
+ }
31607
31616
  };
31608
31617
  var unbindEvents = function unbindEvents() {
31618
+ var _window2;
31609
31619
  var targetEl = targetRef.current;
31610
31620
  if (!targetEl) return;
31611
31621
  var events = getTargetProps();
@@ -31613,6 +31623,11 @@ var Popover = function Popover(props) {
31613
31623
  if (events.onMouseLeave) targetEl.removeEventListener('mouseleave', events.onMouseLeave);
31614
31624
  if (events.onClick) targetEl.removeEventListener('click', events.onClick);
31615
31625
  targetEl.removeEventListener('click', closePop);
31626
+ (_window2 = window) === null || _window2 === void 0 || _window2.removeEventListener('resize', handleUpdateKey);
31627
+ var scrollContainer = getClosestScrollContainer(targetEl);
31628
+ if (scrollContainer) {
31629
+ scrollContainer.addEventListener('scroll', handleUpdateKey);
31630
+ }
31616
31631
  };
31617
31632
  (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
31618
31633
  bindEvents();
@@ -31673,6 +31688,7 @@ var Popover = function Popover(props) {
31673
31688
  adjust: props.adjust,
31674
31689
  lazy: props.lazy,
31675
31690
  offset: props.offset,
31691
+ updateKey: updateKey,
31676
31692
  children: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", objectSpread2_default()(objectSpread2_default()(objectSpread2_default()({
31677
31693
  className: classnames_default()(className, popoverStyle === null || popoverStyle === void 0 ? void 0 : popoverStyle.rootClass, popoverStyle === null || popoverStyle === void 0 ? void 0 : popoverStyle.wrapper, open && (popoverStyle === null || popoverStyle === void 0 ? void 0 : popoverStyle.wrapperOpen), !showArrow && (popoverStyle === null || popoverStyle === void 0 ? void 0 : popoverStyle.hideArrow)),
31678
31694
  style: containerStyle
@@ -41385,8 +41401,9 @@ var Cascader = function Cascader(props0) {
41385
41401
  (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
41386
41402
  if (!value) return;
41387
41403
  datum.setValue(value);
41404
+ if (!open) return;
41388
41405
  updatePathByValue();
41389
- }, [value]);
41406
+ }, [value, open]);
41390
41407
  (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
41391
41408
  if (filterText !== undefined) {
41392
41409
  updatePath();
@@ -41897,6 +41914,7 @@ var validate = function validate(value, formData, rules, p) {
41897
41914
 
41898
41915
 
41899
41916
 
41917
+
41900
41918
  var getValue = function getValue(name, formValue) {
41901
41919
  if (!name) return undefined;
41902
41920
  if (isArray(name)) {
@@ -41936,6 +41954,10 @@ function useFormControl(props) {
41936
41954
  _React$useState2 = slicedToArray_default()(_React$useState, 2),
41937
41955
  errorState = _React$useState2[0],
41938
41956
  setErrorState = _React$useState2[1];
41957
+ var _React$useRef = external_root_React_commonjs2_react_commonjs_react_amd_react_default().useRef({
41958
+ mounted: false
41959
+ }),
41960
+ context = _React$useRef.current;
41939
41961
  var value;
41940
41962
  var error = errorState;
41941
41963
  var inForm = false;
@@ -42095,7 +42117,11 @@ function useFormControl(props) {
42095
42117
  } else {
42096
42118
  controlFunc.bind(name, defaultValue, validateField, update);
42097
42119
  }
42120
+ if (context.mounted) {
42121
+ devUseWarning.warn('Please avoid modifying the name property after the component has mounted, as this may result in unintended behavior or errors.');
42122
+ }
42098
42123
  }
42124
+ context.mounted = true;
42099
42125
  return function () {
42100
42126
  if (inForm && controlFunc) {
42101
42127
  if (isArray(name)) {
@@ -49792,8 +49818,10 @@ var useForm = function useForm(props) {
49792
49818
  context.updateMap[n] = new Set();
49793
49819
  }
49794
49820
  context.updateMap[n].add(updateFn);
49821
+ var shouldTriggerResetChange = context.removeArr.has(n);
49795
49822
  context.removeArr.delete(n);
49796
- if (df !== undefined && deepGet(context.value, n) === undefined) {
49823
+ var shouldTriggerDefaultChange = df !== undefined && deepGet(context.value, n) === undefined;
49824
+ if (shouldTriggerDefaultChange || shouldTriggerResetChange) {
49797
49825
  if (!context.mounted) context.defaultValues[n] = df;
49798
49826
  onChange(function (v) {
49799
49827
  deepSet(v, n, df, deepSetOptions);
@@ -50161,6 +50189,7 @@ var UseFormItem = function UseFormItem() {
50161
50189
 
50162
50190
 
50163
50191
 
50192
+
50164
50193
  var tooltip_devUseWarning = devUseWarning;
50165
50194
  var defaultDelay = 0;
50166
50195
  var Tooltip = function Tooltip(props) {
@@ -50202,14 +50231,30 @@ var Tooltip = function Tooltip(props) {
50202
50231
  popupRef = _usePopup.popupRef,
50203
50232
  closePop = _usePopup.closePop;
50204
50233
  var events = getTargetProps();
50234
+ var _React$useState = external_root_React_commonjs2_react_commonjs_react_amd_react_default().useState(0),
50235
+ _React$useState2 = slicedToArray_default()(_React$useState, 2),
50236
+ updateKey = _React$useState2[0],
50237
+ setUpdateKey = _React$useState2[1];
50238
+ var handleUpdateKey = function handleUpdateKey() {
50239
+ setUpdateKey(function (prev) {
50240
+ return (prev + 1) % 2;
50241
+ });
50242
+ };
50205
50243
  var bindEvents = function bindEvents() {
50244
+ var _window;
50206
50245
  var targetEl = targetRef.current;
50207
50246
  if (!targetEl) return;
50208
50247
  if (events.onMouseEnter) targetEl.addEventListener('mouseenter', events.onMouseEnter);
50209
50248
  if (events.onMouseLeave) targetEl.addEventListener('mouseleave', events.onMouseLeave);
50210
50249
  if (events.onClick) targetEl.addEventListener('click', events.onClick);
50250
+ (_window = window) === null || _window === void 0 || _window.addEventListener('resize', handleUpdateKey);
50251
+ var scrollContainer = getClosestScrollContainer(targetEl);
50252
+ if (scrollContainer) {
50253
+ scrollContainer.addEventListener('scroll', handleUpdateKey);
50254
+ }
50211
50255
  };
50212
50256
  var unbindEvents = function unbindEvents() {
50257
+ var _window2;
50213
50258
  var targetEl = targetRef.current;
50214
50259
  if (!targetEl) return;
50215
50260
  var events = getTargetProps();
@@ -50217,6 +50262,11 @@ var Tooltip = function Tooltip(props) {
50217
50262
  if (events.onMouseLeave) targetEl.removeEventListener('mouseleave', events.onMouseLeave);
50218
50263
  if (events.onClick) targetEl.removeEventListener('click', events.onClick);
50219
50264
  targetEl.removeEventListener('click', closePop);
50265
+ (_window2 = window) === null || _window2 === void 0 || _window2.removeEventListener('resize', handleUpdateKey);
50266
+ var scrollContainer = getClosestScrollContainer(targetEl);
50267
+ if (scrollContainer) {
50268
+ scrollContainer.addEventListener('scroll', handleUpdateKey);
50269
+ }
50220
50270
  };
50221
50271
  (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
50222
50272
  if (!persistent) return;
@@ -50260,6 +50310,7 @@ var Tooltip = function Tooltip(props) {
50260
50310
  popupGap: 0,
50261
50311
  zIndex: zIndex,
50262
50312
  adjust: popsitionProps === 'auto',
50313
+ updateKey: updateKey,
50263
50314
  children: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", objectSpread2_default()(objectSpread2_default()({
50264
50315
  className: classnames_default()(className, tooltipClasses === null || tooltipClasses === void 0 ? void 0 : tooltipClasses.rootClass, tooltipClasses === null || tooltipClasses === void 0 ? void 0 : tooltipClasses.wrapper, open && (tooltipClasses === null || tooltipClasses === void 0 ? void 0 : tooltipClasses.wrapperOpen)),
50265
50316
  style: {
@@ -54257,6 +54308,7 @@ var TreeVirtual = function TreeVirtual(props) {
54257
54308
  height = props.height,
54258
54309
  _props$lineHeight = props.lineHeight,
54259
54310
  lineHeight = _props$lineHeight === void 0 ? 36 : _props$lineHeight,
54311
+ rowsInView = props.rowsInView,
54260
54312
  line = props.line,
54261
54313
  mode = props.mode,
54262
54314
  contentClass = props.contentClass,
@@ -54318,7 +54370,7 @@ var TreeVirtual = function TreeVirtual(props) {
54318
54370
  return /*#__PURE__*/(0,jsx_runtime.jsx)(virtual_scroll_list, {
54319
54371
  data: datum.dataFlat,
54320
54372
  height: height,
54321
- rowsInView: 10,
54373
+ rowsInView: rowsInView,
54322
54374
  scrollerStyle: {
54323
54375
  height: '100%',
54324
54376
  width: '100%',
@@ -54338,7 +54390,7 @@ var TreeVirtual = function TreeVirtual(props) {
54338
54390
 
54339
54391
 
54340
54392
 
54341
- 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"];
54393
+ 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", "rowsInView", "actionOnClick", "tiledData"];
54342
54394
 
54343
54395
 
54344
54396
 
@@ -54400,6 +54452,8 @@ var Tree = function Tree(props) {
54400
54452
  onDragOver = props.onDragOver,
54401
54453
  onDragStart = props.onDragStart,
54402
54454
  propsDatum = props.datum,
54455
+ _props$rowsInView = props.rowsInView,
54456
+ rowsInView = _props$rowsInView === void 0 ? 20 : _props$rowsInView,
54403
54457
  actionOnClick = props.actionOnClick,
54404
54458
  tiledData = props.tiledData,
54405
54459
  rest = objectWithoutProperties_default()(props, tree_excluded);
@@ -54559,6 +54613,7 @@ var Tree = function Tree(props) {
54559
54613
  return /*#__PURE__*/(0,jsx_runtime.jsx)(tree_virtual, objectSpread2_default()(objectSpread2_default()({}, props), {}, {
54560
54614
  data: data,
54561
54615
  line: line,
54616
+ rowsInView: rowsInView,
54562
54617
  expanded: expanded,
54563
54618
  height: realHeight,
54564
54619
  childrenKey: props.childrenKey || 'children',
@@ -69869,7 +69924,7 @@ var upload_interface = __webpack_require__(8821);
69869
69924
 
69870
69925
 
69871
69926
  /* harmony default export */ var src_0 = ({
69872
- version: '3.6.4-beta.4'
69927
+ version: '3.6.4-beta.6'
69873
69928
  });
69874
69929
  }();
69875
69930
  /******/ return __webpack_exports__;