shineout 3.6.0-beta.26 → 3.6.0-beta.28

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.0-beta.26'
517
+ version: '3.6.0-beta.28'
518
518
  };
package/dist/shineout.js CHANGED
@@ -7074,6 +7074,9 @@ var config = {
7074
7074
  Next: icons.ArrowRight,
7075
7075
  CollapseArrow: icons.ArrowLeft
7076
7076
  },
7077
+ textarea: {
7078
+ Close: icons.CloseFill
7079
+ },
7077
7080
  transfer: {
7078
7081
  DeleteAll: icons.Delete,
7079
7082
  DeleteItem: icons.Close,
@@ -12136,7 +12139,7 @@ var handleStyle = function handleStyle(style) {
12136
12139
  };
12137
12140
  /* harmony default export */ var jss_style_handleStyle = (handleStyle);
12138
12141
  ;// CONCATENATED MODULE: ../shineout-style/src/version.ts
12139
- /* harmony default export */ var version = ('3.6.0-beta.26');
12142
+ /* harmony default export */ var version = ('3.6.0-beta.28');
12140
12143
  ;// CONCATENATED MODULE: ../shineout-style/src/jss-style/index.tsx
12141
12144
 
12142
12145
 
@@ -13166,24 +13169,24 @@ var cardTokens = {
13166
13169
  cardBorderRadius: 'Radius-default',
13167
13170
  cardFontColor: 'Neutral-text-5',
13168
13171
  cardFontSize: 'Font-14',
13169
- cardPaddingX: 'Spacing-16',
13172
+ cardPaddingX: 'Spacing-12',
13170
13173
  cardPaddingY: 'Spacing-12',
13171
13174
  cardTitleFontColor: 'Neutral-text-5',
13172
13175
  cardTitleFontSize: 'Font-16',
13173
13176
  cardTitleFontWeight: 'Weight-medium',
13174
13177
  cardHeaderGap: '8px',
13175
- cardHeaderExtraMarginX: 'Spacing-16',
13176
- cardHeaderPaddingX: 'Spacing-16',
13178
+ cardHeaderExtraMarginX: 'Spacing-12',
13179
+ cardHeaderPaddingX: 'Spacing-12',
13177
13180
  cardHeaderPaddingY: 'Spacing-12',
13178
13181
  cardIndicatorSize: 'Size-7',
13179
13182
  cardIndicatorColor: 'Neutral-text-4',
13180
- cardBodyPaddingX: 'Spacing-16',
13183
+ cardBodyPaddingX: 'Spacing-12',
13181
13184
  cardBodyPaddingY: 'Spacing-12',
13182
13185
  cardBodyFontSize: 'Font-14',
13183
13186
  cardBodyFontColor: 'Neutral-text-5',
13184
13187
  cardBodyFontWeight: 'Weight-regular',
13185
13188
  cardBodyBorderColor: 'Neutral-border-1',
13186
- cardFooterPaddingX: 'Spacing-16',
13189
+ cardFooterPaddingX: 'Spacing-12',
13187
13190
  cardFooterPaddingY: 'Spacing-12',
13188
13191
  cardFooterBorderColor: 'Neutral-border-1'
13189
13192
  };
@@ -15001,7 +15004,12 @@ var textareaTokens = {
15001
15004
  textareaInfoBorderColor: 'Neutral-border-2',
15002
15005
  textareaInfoErrorFontColor: 'Danger-6',
15003
15006
  textareaInfoErrorBackgroundColor: 'Danger-1',
15004
- textareaInfoErrorBorderColor: 'Danger-6'
15007
+ textareaInfoErrorBorderColor: 'Danger-6',
15008
+ textareaLimitFontColor: 'Neutral-text-3',
15009
+ textareaLimitFontSize: 'Font-12',
15010
+ textareaClearColor: 'Neutral-text-3',
15011
+ textareaClearSize: 'Size-7',
15012
+ textareaClearHoverColor: 'Neutral-text-4'
15005
15013
  };
15006
15014
  /* harmony default export */ var textarea_textarea = (textareaTokens);
15007
15015
  ;// CONCATENATED MODULE: ../theme/src/textarea/index.ts
@@ -23124,7 +23132,10 @@ var selectStyle = objectSpread2_default()(objectSpread2_default()({
23124
23132
  borderRadius: src.selectPanelRadius,
23125
23133
  transformOrigin: '0 0',
23126
23134
  border: "1px solid ".concat(src.selectPanelBorder),
23127
- cursor: 'initial'
23135
+ cursor: 'initial',
23136
+ '& [data-soui-role="scroll"]': {
23137
+ overscrollBehavior: 'none'
23138
+ }
23128
23139
  },
23129
23140
  pickerSmall: {
23130
23141
  '& $optionInner': {
@@ -25643,6 +25654,7 @@ var tableStyle = objectSpread2_default()(objectSpread2_default()({
25643
25654
  },
25644
25655
  '&::after': {
25645
25656
  position: 'absolute',
25657
+ zIndex: fixedFixedIndex + 3,
25646
25658
  content: '""',
25647
25659
  display: 'block',
25648
25660
  bottom: 0,
@@ -27255,6 +27267,37 @@ var textarea_input = objectSpread2_default()(objectSpread2_default()(objectSprea
27255
27267
  borderRadius: 0,
27256
27268
  width: '100%',
27257
27269
  boxSizing: 'border-box'
27270
+ },
27271
+ limit: {
27272
+ position: 'absolute',
27273
+ right: 12,
27274
+ bottom: 6,
27275
+ color: src.textareaLimitFontColor,
27276
+ fontSize: src.textareaLimitFontSize,
27277
+ '$resize + &': {
27278
+ right: 16
27279
+ }
27280
+ },
27281
+ clear: {
27282
+ position: 'absolute',
27283
+ right: src.textareaPaddingX,
27284
+ top: src.textareaPaddingY,
27285
+ cursor: 'pointer',
27286
+ padding: 4,
27287
+ color: src.textareaClearColor,
27288
+ '&:hover': {
27289
+ color: src.textareaClearHoverColor
27290
+ },
27291
+ '& > svg': {
27292
+ display: 'block',
27293
+ width: src.textareaClearSize,
27294
+ height: src.textareaClearSize
27295
+ }
27296
+ },
27297
+ wrapperWithClear: {
27298
+ '&& $textarea': {
27299
+ paddingRight: "calc(".concat(src.textareaPaddingX, " * 4)")
27300
+ }
27258
27301
  }
27259
27302
  });
27260
27303
  /* harmony default export */ var src_textarea_textarea = (textarea_input);
@@ -28265,7 +28308,10 @@ var treeSelectStyle = objectSpread2_default()(objectSpread2_default()({
28265
28308
  transformOrigin: '0 0',
28266
28309
  width: 'max-content',
28267
28310
  maxWidth: '640px',
28268
- cursor: 'initial'
28311
+ cursor: 'initial',
28312
+ '& $tree': {
28313
+ overscrollBehavior: 'none'
28314
+ }
28269
28315
  },
28270
28316
  iconWrapper: {
28271
28317
  display: 'flex',
@@ -37851,7 +37897,6 @@ function use_tree_toArray(value) {
37851
37897
  if (!Array.isArray(value)) return [value];
37852
37898
  return value;
37853
37899
  }
37854
- var global_tree_map = new Map();
37855
37900
  var MODE = {
37856
37901
  /**
37857
37902
  * 返回全选数据,包含父节点和子节点
@@ -38254,15 +38299,6 @@ var useTree = function useTree(props) {
38254
38299
  return 2;
38255
38300
  };
38256
38301
  var setData = function setData(data) {
38257
- // if(data && global_tree_map.get(data)){
38258
- // context.cachedValue = global_tree_map.get(data)?.cachedValue || []
38259
- // context.pathMap = global_tree_map.get(data)?.pathMap || new Map()
38260
- // context.dataMap = global_tree_map.get(data)?.dataMap || new Map()
38261
- // context.valueMap = global_tree_map.get(data)?.valueMap || new Map()
38262
- // context.unmatchedValueMap = global_tree_map.get(data)?.unmatchedValueMap || new Map()
38263
- // return
38264
- // }
38265
-
38266
38302
  var prevValue = context.value || [];
38267
38303
  context.cachedValue = [];
38268
38304
  context.pathMap = new Map();
@@ -38283,8 +38319,6 @@ var useTree = function useTree(props) {
38283
38319
  }
38284
38320
  initValue();
38285
38321
  setValue(prevValue);
38286
-
38287
- // global_tree_map.set(data, context)
38288
38322
  };
38289
38323
  var set = function set(id, checked, direction) {
38290
38324
  if (!isDisabled(id)) {
@@ -38326,6 +38360,28 @@ var useTree = function useTree(props) {
38326
38360
  }
38327
38361
  return current;
38328
38362
  };
38363
+ var updateInnerCheckStatus = function updateInnerCheckStatus() {
38364
+ var _context$value;
38365
+ if (mode !== MODE.MODE_0) return;
38366
+ (_context$value = context.value) === null || _context$value === void 0 || _context$value.forEach(function (id) {
38367
+ var _ref3 = context.pathMap.get(id),
38368
+ children = _ref3.children;
38369
+ if (children.length) {
38370
+ var noCheckedChildren = children.filter(function (cid) {
38371
+ var _context$value2;
38372
+ return !((_context$value2 = context.value) !== null && _context$value2 !== void 0 && _context$value2.includes(cid));
38373
+ });
38374
+ if (noCheckedChildren.length > 0) {
38375
+ setTimeout(function () {
38376
+ setValueMap(id, 2);
38377
+ noCheckedChildren.forEach(function (cid) {
38378
+ setValueMap(cid, 0);
38379
+ });
38380
+ }, 0);
38381
+ }
38382
+ }
38383
+ });
38384
+ };
38329
38385
  var appendChildrenExpanded = function appendChildrenExpanded(child, level, pid, insertData) {
38330
38386
  if (!child) return;
38331
38387
  child.forEach(function (item, i) {
@@ -38436,6 +38492,7 @@ var useTree = function useTree(props) {
38436
38492
  if (props.datum) return;
38437
38493
  if (!dataUpdate) return;
38438
38494
  setData(data);
38495
+ updateInnerCheckStatus();
38439
38496
  }, [data]);
38440
38497
  (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
38441
38498
  if (props.datum) return;
@@ -38599,7 +38656,9 @@ var Scroll = function Scroll(props) {
38599
38656
  _props$scrollWidth = props.scrollWidth,
38600
38657
  scrollWidth = _props$scrollWidth === void 0 ? 0 : _props$scrollWidth,
38601
38658
  _props$defaultHeight = props.defaultHeight,
38602
- defaultHeight = _props$defaultHeight === void 0 ? 0 : _props$defaultHeight;
38659
+ defaultHeight = _props$defaultHeight === void 0 ? 0 : _props$defaultHeight,
38660
+ _props$keepScrollTop = props.keepScrollTop,
38661
+ keepScrollTop = _props$keepScrollTop === void 0 ? false : _props$keepScrollTop;
38603
38662
  var _useResize = useResize({
38604
38663
  targetRef: containerRef,
38605
38664
  timer: 100
@@ -38623,7 +38682,10 @@ var Scroll = function Scroll(props) {
38623
38682
  }, isRtl ? 'right' : 'left', 0), "top", 0);
38624
38683
 
38625
38684
  // 当滚动容器的高度为 0 时,paddingTop 为 0,避免滚动条抖动现象
38626
- var paddingTop = height === 0 ? 0 : Math.max(0, Math.floor(scrollHeight - height));
38685
+ var paddingTop = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo)(function () {
38686
+ if (keepScrollTop) return Math.max(0, Math.floor(scrollHeight - height));
38687
+ return height === 0 ? 0 : Math.max(0, Math.floor(scrollHeight - height));
38688
+ }, [scrollHeight, height]);
38627
38689
  var placeStyle = {
38628
38690
  paddingTop: paddingTop,
38629
38691
  width: scrollWidth,
@@ -38735,6 +38797,7 @@ var VirtualList = function VirtualList(props) {
38735
38797
  className = props.className,
38736
38798
  lineHeight = props.lineHeight,
38737
38799
  height = props.height,
38800
+ keepScrollTop = props.keepScrollTop,
38738
38801
  keepScrollHeight = props.keepScrollHeight,
38739
38802
  renderItem = props.renderItem,
38740
38803
  customRenderItem = props.customRenderItem,
@@ -38901,6 +38964,7 @@ var VirtualList = function VirtualList(props) {
38901
38964
  style: nextStyle,
38902
38965
  height: height,
38903
38966
  scrollWidth: 0,
38967
+ keepScrollTop: keepScrollTop,
38904
38968
  scrollerStyle: scrollerStyle,
38905
38969
  scrollHeight: scrollHeight,
38906
38970
  childrenStyle: {
@@ -38931,6 +38995,7 @@ var VirtualList = function VirtualList(props) {
38931
38995
  }, [startIndex]);
38932
38996
  (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useLayoutEffect)(function () {
38933
38997
  // 数据变化的时候清空掉 preIndex, 如果之前有缓存的index, setRowHeight 会有问题
38998
+ if (keepScrollTop) return;
38934
38999
  if (keepScrollHeight) return;
38935
39000
  setTop(0);
38936
39001
  setStartIndex(0);
@@ -48138,7 +48203,8 @@ var useTextarea = function useTextarea(props) {
48138
48203
 
48139
48204
 
48140
48205
 
48141
- var simple_textarea_excluded = ["jssStyle", "className", "style", "status", "size", "prefix", "suffix", "underline", "autosize", "border", "resize", "onEnterPress", "getStatus", "renderTextarea"];
48206
+ var simple_textarea_excluded = ["jssStyle", "className", "style", "status", "size", "prefix", "suffix", "underline", "autosize", "border", "resize", "onEnterPress", "onStatusChange", "renderTextarea", "limit", "clearable"];
48207
+
48142
48208
 
48143
48209
 
48144
48210
 
@@ -48161,8 +48227,10 @@ var Textarea = function Textarea(props) {
48161
48227
  _props$resize = props.resize,
48162
48228
  resize = _props$resize === void 0 ? false : _props$resize,
48163
48229
  _onEnterPress = props.onEnterPress,
48164
- getStatus = props.getStatus,
48230
+ onStatusChange = props.onStatusChange,
48165
48231
  renderTextarea = props.renderTextarea,
48232
+ limit = props.limit,
48233
+ clearable = props.clearable,
48166
48234
  rest = objectWithoutProperties_default()(props, simple_textarea_excluded);
48167
48235
  var textareaClasses = jssStyle === null || jssStyle === void 0 || (_jssStyle$textarea = jssStyle.textarea) === null || _jssStyle$textarea === void 0 ? void 0 : _jssStyle$textarea.call(jssStyle);
48168
48236
  var _useTextarea = use_textarea(objectSpread2_default()({}, rest)),
@@ -48188,8 +48256,8 @@ var Textarea = function Textarea(props) {
48188
48256
  onKeyUp: onKeyUp
48189
48257
  });
48190
48258
  (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
48191
- if (getStatus) {
48192
- getStatus({
48259
+ if (onStatusChange) {
48260
+ onStatusChange({
48193
48261
  focused: focused
48194
48262
  });
48195
48263
  }
@@ -48198,13 +48266,32 @@ var Textarea = function Textarea(props) {
48198
48266
  if (typeof renderTextarea === 'function') {
48199
48267
  textareaEl = renderTextarea(textareaEl);
48200
48268
  }
48269
+ var limitEl = null;
48270
+ if (limit) {
48271
+ var _props$value;
48272
+ limitEl = /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
48273
+ className: textareaClasses === null || textareaClasses === void 0 ? void 0 : textareaClasses.limit,
48274
+ children: typeof limit === 'number' ? "".concat(((_props$value = props.value) === null || _props$value === void 0 ? void 0 : _props$value.length) || 0, "/").concat(limit) : limit(props.value)
48275
+ });
48276
+ }
48277
+ var clearEl = null;
48278
+ if (clearable && props.value) {
48279
+ clearEl = /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
48280
+ className: textareaClasses === null || textareaClasses === void 0 ? void 0 : textareaClasses.clear,
48281
+ onClick: function onClick() {
48282
+ var _props$onChange;
48283
+ (_props$onChange = props.onChange) === null || _props$onChange === void 0 || _props$onChange.call(props, '');
48284
+ },
48285
+ children: icons_config.textarea.Close
48286
+ });
48287
+ }
48201
48288
  return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", objectSpread2_default()(objectSpread2_default()(objectSpread2_default()({
48202
48289
  id: fieldId
48203
48290
  }, getDataAttribute(defineProperty_default()({}, 'input-border', 'true'))), getRootProps({
48204
48291
  className: rootClass,
48205
48292
  style: style
48206
48293
  })), {}, {
48207
- children: [prefix, textareaEl, suffix]
48294
+ children: [prefix, textareaEl, suffix, limitEl, clearEl]
48208
48295
  }));
48209
48296
  };
48210
48297
  /* harmony default export */ var simple_textarea = (Textarea);
@@ -48303,7 +48390,7 @@ var useAutoSize = function useAutoSize(props) {
48303
48390
 
48304
48391
 
48305
48392
 
48306
- var textarea_excluded = ["info", "suffix", "renderFooter", "width", "style", "jssStyle", "onBlur", "status", "trim", "delay"];
48393
+ var textarea_excluded = ["info", "suffix", "renderFooter", "width", "style", "jssStyle", "onBlur", "status", "limit", "trim", "delay"];
48307
48394
 
48308
48395
 
48309
48396
 
@@ -48332,6 +48419,7 @@ var textarea_Textarea = function Textarea(props0) {
48332
48419
  jssStyle = props.jssStyle,
48333
48420
  onBlur = props.onBlur,
48334
48421
  status = props.status,
48422
+ limit = props.limit,
48335
48423
  trimProps = props.trim,
48336
48424
  delayProps = props.delay,
48337
48425
  resetProps = objectWithoutProperties_default()(props, textarea_excluded);
@@ -48363,7 +48451,12 @@ var textarea_Textarea = function Textarea(props0) {
48363
48451
  var inputAbleParams = {
48364
48452
  value: resetProps.value,
48365
48453
  onChange: resetProps.onChange,
48366
- beforeChange: resetProps.beforeChange,
48454
+ beforeChange: typeof limit === 'number' ? function (v) {
48455
+ var _resetProps$beforeCha;
48456
+ if (v.length > limit) return v.slice(0, limit);
48457
+ if (resetProps.beforeChange) (_resetProps$beforeCha = resetProps.beforeChange) === null || _resetProps$beforeCha === void 0 || _resetProps$beforeCha.call(resetProps, v);
48458
+ return v;
48459
+ } : resetProps.beforeChange,
48367
48460
  defaultValue: resetProps.defaultValue,
48368
48461
  delay: delay
48369
48462
  };
@@ -48472,13 +48565,14 @@ var textarea_Textarea = function Textarea(props0) {
48472
48565
  rows: 4,
48473
48566
  jssStyle: jssStyle
48474
48567
  }, forwardProps), formatProps), {}, {
48475
- className: classnames_default()(innerTitleProps.innerTitle && (textareaClasses === null || textareaClasses === void 0 ? void 0 : textareaClasses.wrapperInnerTitle), resetProps.className),
48568
+ className: classnames_default()(innerTitleProps.innerTitle && (textareaClasses === null || textareaClasses === void 0 ? void 0 : textareaClasses.wrapperInnerTitle), props.clearable && (textareaClasses === null || textareaClasses === void 0 ? void 0 : textareaClasses.wrapperWithClear), resetProps.className),
48476
48569
  renderTextarea: renderTextarea,
48570
+ limit: limit,
48477
48571
  status: tipProps.error ? 'error' : status,
48572
+ onStatusChange: onStatusChange,
48478
48573
  value: inputAbleProps.value || '',
48479
48574
  suffix: mergeSuffix,
48480
48575
  style: mergeStyle,
48481
- getStatus: onStatusChange,
48482
48576
  rootRef: rootRef,
48483
48577
  autosize: props.autosize
48484
48578
  }));
@@ -49887,6 +49981,8 @@ var Tooltip = function Tooltip(props) {
49887
49981
  className = props.className,
49888
49982
  style = props.style,
49889
49983
  zIndex = props.zIndex,
49984
+ _props$showArrow = props.showArrow,
49985
+ showArrow = _props$showArrow === void 0 ? true : _props$showArrow,
49890
49986
  persistentProp = props.persistent,
49891
49987
  _props$type = props.type,
49892
49988
  type = _props$type === void 0 ? 'default' : _props$type,
@@ -49984,7 +50080,7 @@ var Tooltip = function Tooltip(props) {
49984
50080
  ref: popupRef,
49985
50081
  onMouseLeave: events.onMouseLeave,
49986
50082
  dir: config.direction,
49987
- children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", objectSpread2_default()({
50083
+ children: [showArrow && /*#__PURE__*/(0,jsx_runtime.jsx)("span", objectSpread2_default()({
49988
50084
  ref: arrowRef,
49989
50085
  className: tooltipClasses === null || tooltipClasses === void 0 ? void 0 : tooltipClasses.arrow
49990
50086
  }, getDataAttribute({
@@ -52944,6 +53040,7 @@ var list_List = function List(props) {
52944
53040
  return /*#__PURE__*/(0,jsx_runtime.jsx)(virtual_scroll_list, {
52945
53041
  virtualRef: virtualRef,
52946
53042
  data: data,
53043
+ keepScrollTop: true,
52947
53044
  keygen: keygen,
52948
53045
  tag: 'ul',
52949
53046
  groupKey: groupKey,
@@ -55426,9 +55523,7 @@ function Select(props0) {
55426
55523
  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)),
55427
55524
  onAnimationAfterEnter: onAnimationAfterEnter,
55428
55525
  display: 'block',
55429
- type: "scale-y"
55430
- // type='fade'
55431
- ,
55526
+ type: "scale-y",
55432
55527
  duration: 'fast',
55433
55528
  style: getListStyle(),
55434
55529
  children: [renderHeader(), renderOptions(), renderFooter()]
@@ -61276,9 +61371,7 @@ var Colgroup = function Colgroup(props) {
61276
61371
  if (minWidth) {
61277
61372
  style.minWidth = minWidth;
61278
61373
  }
61279
- if (width) {
61280
- style.width = width;
61281
- }
61374
+ style.width = width;
61282
61375
  return /*#__PURE__*/(0,jsx_runtime.jsx)("col", {
61283
61376
  style: style
61284
61377
  }, columns[index].key);
@@ -69509,7 +69602,7 @@ var upload_interface = __webpack_require__(8821);
69509
69602
 
69510
69603
 
69511
69604
  /* harmony default export */ var src_0 = ({
69512
- version: '3.6.0-beta.26'
69605
+ version: '3.6.0-beta.28'
69513
69606
  });
69514
69607
  }();
69515
69608
  /******/ return __webpack_exports__;