shineout 3.4.4-beta.6 → 3.4.4-beta.7

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
@@ -492,5 +492,5 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
492
492
  // 此文件由脚本自动生成,请勿直接修改。
493
493
  // This file was generated automatically by a script. Please do not modify it directly.
494
494
  var _default = exports.default = {
495
- version: '3.4.4-beta.6'
495
+ version: '3.4.4-beta.7'
496
496
  };
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.4.4-beta.6');
11987
+ /* harmony default export */ var version = ('3.4.4-beta.7');
11988
11988
  ;// CONCATENATED MODULE: ../shineout-style/src/jss-style/index.tsx
11989
11989
 
11990
11990
 
@@ -26226,71 +26226,8 @@ var textarea_input = objectSpread2_default()(objectSpread2_default()(objectSprea
26226
26226
  resize: 'vertical'
26227
26227
  },
26228
26228
  info: {
26229
- position: 'absolute',
26230
- zIndex: 1000,
26231
- '&[dir=ltr]': {
26232
- right: '0'
26233
- },
26234
- '&[dir=rtl]': {
26235
- left: '0'
26236
- },
26237
- '&$bottomLeft': {
26238
- right: 'auto'
26239
- },
26240
- '&$bottomRight': {
26241
- left: 'auto'
26242
- },
26243
- top: '100%',
26244
- transformOrigin: '100% 0',
26245
- marginTop: '10px',
26246
- animation: 'so-input-fade .16s ease-in',
26247
- maxWidth: '400px',
26248
- padding: '5px 8px',
26249
26229
  background: src.textareaInfoBackgroundColor,
26250
- borderRadius: src.textareaBorderRadius,
26251
- boxShadow: "0 0 0 1px ".concat(src.textareaBorderColor),
26252
- fontSize: '12px',
26253
- color: src.textareaInfoFontColor,
26254
- '&::before': {
26255
- display: 'block',
26256
- position: 'absolute',
26257
- bottom: '100%',
26258
- transform: 'rotate(45deg) translateY(3px)',
26259
- width: '6px',
26260
- height: '6px',
26261
- borderTop: "1px solid ".concat(src.textareaBorderColor),
26262
- borderLeft: "1px solid ".concat(src.textareaBorderColor),
26263
- background: 'inherit',
26264
- content: "' '"
26265
- },
26266
- '&[dir=ltr]::before': {
26267
- right: '4px'
26268
- },
26269
- '&[dir=rtl]::before': {
26270
- left: '8px'
26271
- },
26272
- '&$bottomLeft::before': {
26273
- left: '8px',
26274
- right: 'auto'
26275
- },
26276
- '&$bottomRight::before': {
26277
- right: '4px',
26278
- left: 'auto'
26279
- }
26280
- },
26281
- bottomLeft: {
26282
- left: 0
26283
- },
26284
- bottomRight: {
26285
- right: 0
26286
- },
26287
- infoError: {
26288
- boxShadow: "0 0 0 1px ".concat(src.textareaInfoErrorBorderColor),
26289
- color: src.textareaInfoErrorFontColor,
26290
- background: src.textareaInfoErrorBackgroundColor,
26291
- '&::before': {
26292
- borderColor: src.textareaInfoErrorBorderColor
26293
- }
26230
+ color: src.textareaInfoFontColor
26294
26231
  },
26295
26232
  shadow: {
26296
26233
  position: 'absolute',
@@ -33797,6 +33734,9 @@ var useTip = function useTip(props) {
33797
33734
  jssStyle = props.jssStyle;
33798
33735
  var config = useConfig();
33799
33736
  var dfp = config.direction === 'rtl' ? 'bottom-right' : 'bottom-left';
33737
+ if (typeof popover === 'string') {
33738
+ dfp = popover;
33739
+ }
33800
33740
  var styles = popoverProps !== null && popoverProps !== void 0 && popoverProps.style && popoverProps !== null && popoverProps !== void 0 && (_popoverProps$style = popoverProps.style) !== null && _popoverProps$style !== void 0 && _popoverProps$style.width ? popoverProps === null || popoverProps === void 0 ? void 0 : popoverProps.style : Object.assign({
33801
33741
  minWidth: 200,
33802
33742
  maxWidth: 400
@@ -39473,8 +39413,18 @@ var useListSelectMultiple = function useListSelectMultiple(props) {
39473
39413
 
39474
39414
 
39475
39415
 
39416
+ var defaultFormat = function defaultFormat(d) {
39417
+ return d;
39418
+ };
39419
+ var defaultRenderItem = function defaultRenderItem(d) {
39420
+ return d;
39421
+ };
39476
39422
  var checkbox_group_Group = function Group(props0) {
39477
39423
  var _jssStyle$checkbox;
39424
+ var _props0$format = props0.format,
39425
+ format = _props0$format === void 0 ? defaultFormat : _props0$format,
39426
+ _props0$renderItem = props0.renderItem,
39427
+ renderItem = _props0$renderItem === void 0 ? defaultRenderItem : _props0$renderItem;
39478
39428
  var props = use_with_form_config(props0);
39479
39429
  var children = props.children,
39480
39430
  className = props.className,
@@ -39498,7 +39448,7 @@ var checkbox_group_Group = function Group(props0) {
39498
39448
  prediction: props.prediction,
39499
39449
  separator: props.separator,
39500
39450
  disabled: disabled,
39501
- format: props.format,
39451
+ format: format,
39502
39452
  keygen: props.keygen,
39503
39453
  data: props.data || []
39504
39454
  };
@@ -39518,7 +39468,6 @@ var checkbox_group_Group = function Group(props0) {
39518
39468
  return datum.check(d);
39519
39469
  });
39520
39470
  var getContent = function getContent(d, index) {
39521
- var renderItem = props.renderItem;
39522
39471
  if (typeof renderItem === 'string' && d) {
39523
39472
  return d[renderItem];
39524
39473
  }
@@ -39565,14 +39514,6 @@ var checkbox_group_Group = function Group(props0) {
39565
39514
  });
39566
39515
  }
39567
39516
  };
39568
- checkbox_group_Group.defaultProps = {
39569
- format: function format(d) {
39570
- return d;
39571
- },
39572
- renderItem: function renderItem(d) {
39573
- return d;
39574
- }
39575
- };
39576
39517
  /* harmony default export */ var checkbox_group = (checkbox_group_Group);
39577
39518
  ;// CONCATENATED MODULE: ./src/checkbox/group.tsx
39578
39519
 
@@ -45309,7 +45250,7 @@ var textarea_defaultInfo = function defaultInfo(num, msg) {
45309
45250
  return new Error(text);
45310
45251
  };
45311
45252
  var textarea_Textarea = function Textarea(props0) {
45312
- var _jssStyle$textarea, _ref, _ref2;
45253
+ var _jssStyle$textarea, _ref, _ref2, _infoState$error;
45313
45254
  var props = use_with_form_config(props0);
45314
45255
  var info = props.info,
45315
45256
  suffix = props.suffix,
@@ -45400,36 +45341,48 @@ var textarea_Textarea = function Textarea(props0) {
45400
45341
 
45401
45342
  // forwardProps
45402
45343
  var forwardProps = removeProps(resetProps, objectSpread2_default()(objectSpread2_default()(objectSpread2_default()(objectSpread2_default()(objectSpread2_default()({}, inputAbleParams), autosizeParams), tipProps), formatParams), innerTitleProps));
45403
- var getInfo = function getInfo() {
45344
+ var getInfoState = function getInfoState() {
45404
45345
  var notNumber = typeof info !== 'number';
45405
45346
  if (typeof info !== 'function' && typeof_default()(info) !== 'object' && notNumber) return null;
45406
45347
  var infoContent;
45407
- var infoPosition;
45408
45348
  if (typeof_default()(info) === 'object') {
45409
45349
  infoContent = info.content;
45410
- infoPosition = info.position;
45411
45350
  } else {
45412
45351
  infoContent = info;
45413
45352
  }
45414
45353
  var notContentNumber = typeof infoContent !== 'number';
45415
45354
  var textInfo = notContentNumber ? infoContent : textarea_defaultInfo.bind(null, infoContent);
45416
- var res = textInfo(inputAbleProps.value);
45417
- // empty
45418
- if (!res) return null;
45419
- var isError = res instanceof Error;
45420
- var text = isError ? res.message : res;
45355
+ var error = textInfo(inputAbleProps.value);
45356
+ if (!error) return null;
45357
+ var isError = error instanceof Error;
45358
+ var text = isError ? error.message : error;
45421
45359
  if (!isError && !focused) return null;
45422
- return /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
45360
+ return {
45361
+ text: text,
45362
+ error: error
45363
+ };
45364
+ };
45365
+ var infoState = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo)(getInfoState, [info, inputAbleProps.value, focused]);
45366
+ var infoPopoverProps = {
45367
+ popover: resetProps.popover || (typeof_default()(info) === 'object' ? info.position : 'bottom-right'),
45368
+ popoverProps: Object.assign({
45423
45369
  style: {
45424
- minWidth: 'auto'
45425
- },
45426
- dir: config.direction,
45427
- className: classnames_default()(textareaClasses === null || textareaClasses === void 0 ? void 0 : textareaClasses.info, !!isError && (textareaClasses === null || textareaClasses === void 0 ? void 0 : textareaClasses.infoError), infoPosition === 'bottom-left' && (textareaClasses === null || textareaClasses === void 0 ? void 0 : textareaClasses.bottomLeft), infoPosition === 'bottom-right' && (textareaClasses === null || textareaClasses === void 0 ? void 0 : textareaClasses.bottomRight)),
45428
- children: text
45429
- }, 'info');
45370
+ width: 'auto'
45371
+ }
45372
+ }, resetProps.popoverProps),
45373
+ error: infoState !== null && infoState !== void 0 && infoState.error && (infoState === null || infoState === void 0 ? void 0 : infoState.error) instanceof Error ? infoState === null || infoState === void 0 || (_infoState$error = infoState.error) === null || _infoState$error === void 0 ? void 0 : _infoState$error.message : undefined,
45374
+ tip: /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
45375
+ className: textareaClasses === null || textareaClasses === void 0 ? void 0 : textareaClasses.info,
45376
+ children: infoState === null || infoState === void 0 ? void 0 : infoState.text
45377
+ })
45430
45378
  };
45379
+ var infoPopoverNode = use_tip(objectSpread2_default()(objectSpread2_default()({}, infoPopoverProps), {}, {
45380
+ focused: focused,
45381
+ rootRef: rootRef,
45382
+ jssStyle: jssStyle
45383
+ }));
45431
45384
  var mergeSuffix = /*#__PURE__*/(0,jsx_runtime.jsxs)((external_root_React_commonjs2_react_commonjs_react_amd_react_default()).Fragment, {
45432
- children: [suffix, getInfo(), tipNode, isFunc(renderFooter) && /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
45385
+ children: [suffix, tipNode, (infoState === null || infoState === void 0 ? void 0 : infoState.text) && infoPopoverNode, isFunc(renderFooter) && /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
45433
45386
  onMouseDown: function onMouseDown(e) {
45434
45387
  e.preventDefault();
45435
45388
  },
@@ -54583,8 +54536,18 @@ var useListSelectSingle = function useListSelectSingle(props) {
54583
54536
 
54584
54537
 
54585
54538
 
54539
+ var radio_group_defaultFormat = function defaultFormat(d) {
54540
+ return d;
54541
+ };
54542
+ var radio_group_defaultRenderItem = function defaultRenderItem(d) {
54543
+ return d;
54544
+ };
54586
54545
  var radio_group_Group = function Group(props0) {
54587
54546
  var _jssStyle$radio;
54547
+ var _props0$format = props0.format,
54548
+ format = _props0$format === void 0 ? radio_group_defaultFormat : _props0$format,
54549
+ _props0$renderItem = props0.renderItem,
54550
+ renderItem = _props0$renderItem === void 0 ? radio_group_defaultRenderItem : _props0$renderItem;
54588
54551
  var props = use_with_form_config(props0);
54589
54552
  var children = props.children,
54590
54553
  className = props.className,
@@ -54608,7 +54571,7 @@ var radio_group_Group = function Group(props0) {
54608
54571
  onChange: inputAbleProps.onChange,
54609
54572
  prediction: props.prediction,
54610
54573
  disabled: disabled,
54611
- format: props.format,
54574
+ format: format,
54612
54575
  keygen: props.keygen,
54613
54576
  data: props.data || []
54614
54577
  };
@@ -54623,7 +54586,6 @@ var radio_group_Group = function Group(props0) {
54623
54586
  return datum.check(d);
54624
54587
  });
54625
54588
  var getContent = function getContent(d, index) {
54626
- var renderItem = props.renderItem;
54627
54589
  if (typeof renderItem === 'string') {
54628
54590
  return d[renderItem];
54629
54591
  }
@@ -54698,14 +54660,6 @@ var radio_group_Group = function Group(props0) {
54698
54660
  children: Radios
54699
54661
  });
54700
54662
  };
54701
- radio_group_Group.defaultProps = {
54702
- format: function format(d) {
54703
- return d;
54704
- },
54705
- renderItem: function renderItem(d) {
54706
- return d;
54707
- }
54708
- };
54709
54663
  /* harmony default export */ var radio_group = (radio_group_Group);
54710
54664
  ;// CONCATENATED MODULE: ./src/radio/group.tsx
54711
54665
 
@@ -65280,7 +65234,7 @@ var upload_interface = __webpack_require__(8821);
65280
65234
 
65281
65235
 
65282
65236
  /* harmony default export */ var src_0 = ({
65283
- version: '3.4.4-beta.6'
65237
+ version: '3.4.4-beta.7'
65284
65238
  });
65285
65239
  }();
65286
65240
  /******/ return __webpack_exports__;