shineout 3.3.3-beta.7 → 3.3.3-beta.8

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
@@ -476,5 +476,5 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
476
476
  // 此文件由脚本自动生成,请勿直接修改。
477
477
  // This file was generated automatically by a script. Please do not modify it directly.
478
478
  var _default = exports.default = {
479
- version: '3.3.3-beta.7'
479
+ version: '3.3.3-beta.8'
480
480
  };
package/dist/shineout.js CHANGED
@@ -11968,7 +11968,7 @@ var handleStyle = function handleStyle(style) {
11968
11968
  };
11969
11969
  /* harmony default export */ var jss_style_handleStyle = (handleStyle);
11970
11970
  ;// CONCATENATED MODULE: ../shineout-style/src/version.ts
11971
- /* harmony default export */ var version = ('3.3.3-beta.7');
11971
+ /* harmony default export */ var version = ('3.3.3-beta.8');
11972
11972
  ;// CONCATENATED MODULE: ../shineout-style/src/jss-style/index.tsx
11973
11973
 
11974
11974
 
@@ -36002,6 +36002,14 @@ var result_Input = function Input(props) {
36002
36002
  _useState2 = slicedToArray_default()(_useState, 2),
36003
36003
  value = _useState2[0],
36004
36004
  setValue = _useState2[1];
36005
+ var updateValue = function updateValue() {
36006
+ setValue(props.value);
36007
+ };
36008
+ if (props.inputRef) {
36009
+ props.inputRef.current = {
36010
+ updateValue: updateValue
36011
+ };
36012
+ }
36005
36013
  (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
36006
36014
  setValue(props.value);
36007
36015
  }, [props.value, props.open]);
@@ -36040,6 +36048,7 @@ var Result = function Result(props) {
36040
36048
  range = props.range,
36041
36049
  placeholder = props.placeholder,
36042
36050
  _onChange = props.onChange,
36051
+ _onRef = props.onRef,
36043
36052
  disabledLeft = props.disabledLeft,
36044
36053
  disabledRight = props.disabledRight,
36045
36054
  _props$activeIndex = props.activeIndex,
@@ -36053,6 +36062,7 @@ var Result = function Result(props) {
36053
36062
  clickIndex: 0
36054
36063
  }),
36055
36064
  context = _useRef.current;
36065
+ var inputRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)({});
36056
36066
  (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
36057
36067
  if (open) {
36058
36068
  if (context.inputRefs[activeIndex]) {
@@ -36105,10 +36115,12 @@ var Result = function Result(props) {
36105
36115
  className: styles === null || styles === void 0 ? void 0 : styles.resultTextPadding,
36106
36116
  children: info.inputable ? /*#__PURE__*/(0,jsx_runtime.jsx)(result_Input, {
36107
36117
  onRef: function onRef(el) {
36118
+ _onRef.current.inputRef = el;
36108
36119
  context.inputRefs[info.index] = el;
36109
36120
  },
36110
36121
  disabled: dis,
36111
36122
  open: !!open,
36123
+ inputRef: inputRef,
36112
36124
  value: info.target || info.value || '',
36113
36125
  placeholder: info.place,
36114
36126
  onChange: function onChange(s) {
@@ -36118,10 +36130,11 @@ var Result = function Result(props) {
36118
36130
  context.clickIndex = info.index;
36119
36131
  },
36120
36132
  onBlur: function onBlur(e) {
36121
- var _props$onBlur;
36133
+ var _props$onBlur, _inputRef$current$upd, _inputRef$current;
36122
36134
  e.stopPropagation();
36123
36135
  if (e.relatedTarget === context.inputRefs[1 - info.index]) return;
36124
36136
  (_props$onBlur = props.onBlur) === null || _props$onBlur === void 0 || _props$onBlur.call(props, e);
36137
+ if (inputRef.current) (_inputRef$current$upd = (_inputRef$current = inputRef.current).updateValue) === null || _inputRef$current$upd === void 0 || _inputRef$current$upd.call(_inputRef$current);
36125
36138
  context.clickIndex = 0;
36126
36139
  },
36127
36140
  onFocus: function onFocus(e) {
@@ -42443,6 +42456,9 @@ var DatePicker = function DatePicker(props0) {
42443
42456
  _React$useState2 = slicedToArray_default()(_React$useState, 2),
42444
42457
  activeIndex = _React$useState2[0],
42445
42458
  setActiveIndex = _React$useState2[1];
42459
+ var inputRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)({
42460
+ inputRef: null
42461
+ });
42446
42462
  var styles = jssStyle === null || jssStyle === void 0 || (_jssStyle$datePicker = jssStyle.datePicker) === null || _jssStyle$datePicker === void 0 ? void 0 : _jssStyle$datePicker.call(jssStyle);
42447
42463
  var isRTL = direction === 'rtl';
42448
42464
  var dfp = isRTL ? 'bottom-right' : 'bottom-left';
@@ -42541,6 +42557,11 @@ var DatePicker = function DatePicker(props0) {
42541
42557
  setFocused(false);
42542
42558
  (_props$onBlur = props.onBlur) === null || _props$onBlur === void 0 || _props$onBlur.call(props, e);
42543
42559
  });
42560
+ var handleClose = function handleClose() {
42561
+ var _inputRef$current$inp;
42562
+ closePop();
42563
+ (_inputRef$current$inp = inputRef.current.inputRef) === null || _inputRef$current$inp === void 0 || _inputRef$current$inp.blur();
42564
+ };
42544
42565
  var handleResultClick = usePersistFn(function () {
42545
42566
  if (disabledStatus === 'all') return;
42546
42567
  openPop();
@@ -42553,6 +42574,7 @@ var DatePicker = function DatePicker(props0) {
42553
42574
  activeIndex: activeIndex,
42554
42575
  type: type,
42555
42576
  range: range,
42577
+ onRef: inputRef,
42556
42578
  inputable: props.inputable && !props.formatResult,
42557
42579
  disabledLeft: disabledStatus === 'left',
42558
42580
  disabledRight: disabledStatus === 'right',
@@ -42581,7 +42603,7 @@ var DatePicker = function DatePicker(props0) {
42581
42603
  onKeyDown: function onKeyDown(e) {
42582
42604
  if (e.key === 'Enter') {
42583
42605
  if (open) {
42584
- closePop();
42606
+ handleClose();
42585
42607
  } else {
42586
42608
  openPop();
42587
42609
  }
@@ -42638,7 +42660,7 @@ var DatePicker = function DatePicker(props0) {
42638
42660
  options: options,
42639
42661
  disabled: disabled,
42640
42662
  jssStyle: jssStyle,
42641
- closePop: closePop,
42663
+ closePop: handleClose,
42642
42664
  defaultTime: props.defaultTime,
42643
42665
  min: props.min,
42644
42666
  max: props.max,
@@ -63686,7 +63708,7 @@ var upload_interface = __webpack_require__(8821);
63686
63708
 
63687
63709
 
63688
63710
  /* harmony default export */ var src_0 = ({
63689
- version: '3.3.3-beta.7'
63711
+ version: '3.3.3-beta.8'
63690
63712
  });
63691
63713
  }();
63692
63714
  /******/ return __webpack_exports__;