shineout 3.3.3-beta.7 → 3.3.3

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'
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');
11972
11972
  ;// CONCATENATED MODULE: ../shineout-style/src/jss-style/index.tsx
11973
11973
 
11974
11974
 
@@ -16813,6 +16813,13 @@ var cascaderStyle = objectSpread2_default()(objectSpread2_default()({
16813
16813
  marginTop: src.cascaderPlaceholderMarginY,
16814
16814
  marginBottom: src.cascaderPlaceholderMarginY
16815
16815
  },
16816
+ inputPlaceholder: {
16817
+ pointerEvents: 'none',
16818
+ opacity: 0.5,
16819
+ inset: 0,
16820
+ position: 'absolute',
16821
+ padding: "".concat(src.selectOptionInnerPaddingY, " ").concat(src.selectOptionInnerPaddingX)
16822
+ },
16816
16823
  inputMirror: {
16817
16824
  position: 'absolute',
16818
16825
  left: 0,
@@ -22136,6 +22143,13 @@ var selectStyle = objectSpread2_default()(objectSpread2_default()({
22136
22143
  marginTop: src.selectPlaceholderMarginY,
22137
22144
  marginBottom: src.selectPlaceholderMarginY
22138
22145
  },
22146
+ inputPlaceholder: {
22147
+ pointerEvents: 'none',
22148
+ opacity: 0.5,
22149
+ inset: 0,
22150
+ position: 'absolute',
22151
+ padding: "".concat(src.selectOptionInnerPaddingY, " ").concat(src.selectOptionInnerPaddingX)
22152
+ },
22139
22153
  inputMirror: {
22140
22154
  position: 'absolute',
22141
22155
  left: 0,
@@ -27042,6 +27056,13 @@ var treeSelectStyle = objectSpread2_default()(objectSpread2_default()({
27042
27056
  marginTop: src.treeSelectPlaceholderMarginY,
27043
27057
  marginBottom: src.treeSelectPlaceholderMarginY
27044
27058
  },
27059
+ inputPlaceholder: {
27060
+ pointerEvents: 'none',
27061
+ opacity: 0.5,
27062
+ inset: 0,
27063
+ position: 'absolute',
27064
+ padding: "".concat(src.selectOptionInnerPaddingY, " ").concat(src.selectOptionInnerPaddingX)
27065
+ },
27045
27066
  inputMirror: {
27046
27067
  position: 'absolute',
27047
27068
  left: 0,
@@ -29854,7 +29875,7 @@ var addResizeObserver = function addResizeObserver(el, handler) {
29854
29875
  if (height && lastHeight !== height) {
29855
29876
  debounceHandler(entry);
29856
29877
  }
29857
- } else if (width && height) {
29878
+ } else if (lastWidth !== width || lastHeight !== height) {
29858
29879
  debounceHandler(entry, {
29859
29880
  x: lastWidth !== width,
29860
29881
  y: lastHeight !== height
@@ -36002,6 +36023,14 @@ var result_Input = function Input(props) {
36002
36023
  _useState2 = slicedToArray_default()(_useState, 2),
36003
36024
  value = _useState2[0],
36004
36025
  setValue = _useState2[1];
36026
+ var updateValue = function updateValue() {
36027
+ setValue(props.value);
36028
+ };
36029
+ if (props.inputRef) {
36030
+ props.inputRef.current = {
36031
+ updateValue: updateValue
36032
+ };
36033
+ }
36005
36034
  (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
36006
36035
  setValue(props.value);
36007
36036
  }, [props.value, props.open]);
@@ -36040,6 +36069,7 @@ var Result = function Result(props) {
36040
36069
  range = props.range,
36041
36070
  placeholder = props.placeholder,
36042
36071
  _onChange = props.onChange,
36072
+ _onRef = props.onRef,
36043
36073
  disabledLeft = props.disabledLeft,
36044
36074
  disabledRight = props.disabledRight,
36045
36075
  _props$activeIndex = props.activeIndex,
@@ -36053,6 +36083,7 @@ var Result = function Result(props) {
36053
36083
  clickIndex: 0
36054
36084
  }),
36055
36085
  context = _useRef.current;
36086
+ var inputRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)({});
36056
36087
  (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
36057
36088
  if (open) {
36058
36089
  if (context.inputRefs[activeIndex]) {
@@ -36105,10 +36136,12 @@ var Result = function Result(props) {
36105
36136
  className: styles === null || styles === void 0 ? void 0 : styles.resultTextPadding,
36106
36137
  children: info.inputable ? /*#__PURE__*/(0,jsx_runtime.jsx)(result_Input, {
36107
36138
  onRef: function onRef(el) {
36139
+ _onRef.current.inputRef = el;
36108
36140
  context.inputRefs[info.index] = el;
36109
36141
  },
36110
36142
  disabled: dis,
36111
36143
  open: !!open,
36144
+ inputRef: inputRef,
36112
36145
  value: info.target || info.value || '',
36113
36146
  placeholder: info.place,
36114
36147
  onChange: function onChange(s) {
@@ -36118,10 +36151,11 @@ var Result = function Result(props) {
36118
36151
  context.clickIndex = info.index;
36119
36152
  },
36120
36153
  onBlur: function onBlur(e) {
36121
- var _props$onBlur;
36154
+ var _props$onBlur, _inputRef$current$upd, _inputRef$current;
36122
36155
  e.stopPropagation();
36123
36156
  if (e.relatedTarget === context.inputRefs[1 - info.index]) return;
36124
36157
  (_props$onBlur = props.onBlur) === null || _props$onBlur === void 0 || _props$onBlur.call(props, e);
36158
+ if (inputRef.current) (_inputRef$current$upd = (_inputRef$current = inputRef.current).updateValue) === null || _inputRef$current$upd === void 0 || _inputRef$current$upd.call(_inputRef$current);
36125
36159
  context.clickIndex = 0;
36126
36160
  },
36127
36161
  onFocus: function onFocus(e) {
@@ -36223,6 +36257,13 @@ var ResultInput = function ResultInput(props) {
36223
36257
  onRef.current = inputRef.current;
36224
36258
  onBindInput === null || onBindInput === void 0 || onBindInput(inputRef.current);
36225
36259
  }, []);
36260
+ var renderResultPlaceholder = function renderResultPlaceholder() {
36261
+ if (inputText || !focus || typeof props.placeholder === 'string') return null;
36262
+ return /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
36263
+ className: styles.inputPlaceholder,
36264
+ children: props.placeholder
36265
+ });
36266
+ };
36226
36267
  var style = {};
36227
36268
  if (!multiple) {
36228
36269
  style.width = '100%';
@@ -36236,7 +36277,7 @@ var ResultInput = function ResultInput(props) {
36236
36277
  children: [/*#__PURE__*/(0,jsx_runtime.jsx)(result_Input, {
36237
36278
  onRef: bindInputRef,
36238
36279
  style: style,
36239
- placeholder: props.placeholder,
36280
+ placeholder: typeof props.placeholder === 'string' ? props.placeholder : undefined,
36240
36281
  value: inputText,
36241
36282
  maxLength: maxLength,
36242
36283
  onChange: onChange,
@@ -36248,7 +36289,7 @@ var ResultInput = function ResultInput(props) {
36248
36289
  className: styles.inputMirror,
36249
36290
  ref: mirrorRef,
36250
36291
  children: inputText || value
36251
- })]
36292
+ }), renderResultPlaceholder()]
36252
36293
  });
36253
36294
  };
36254
36295
  /* harmony default export */ var result_input = (ResultInput);
@@ -36777,14 +36818,10 @@ var result_Result = function Result(props) {
36777
36818
  onResultItemClick === null || onResultItemClick === void 0 || onResultItemClick(e, item);
36778
36819
  };
36779
36820
  var renderInput = function renderInput() {
36780
- var placeholder2 = empty ? placeholder : '';
36821
+ var _placeholder = empty ? placeholder : '';
36781
36822
  if (!multiple && valueProp && valueProp !== 0) {
36782
36823
  var _result = getDataByValues(value);
36783
- // 获取合法的 content
36784
- var content = renderResultContent(_result[0]);
36785
- if (typeof content === 'string') {
36786
- placeholder2 = content;
36787
- }
36824
+ _placeholder = renderResultContent(_result[0]);
36788
36825
  }
36789
36826
  return /*#__PURE__*/(0,jsx_runtime.jsx)((external_root_React_commonjs2_react_commonjs_react_amd_react_default()).Fragment, {
36790
36827
  children: /*#__PURE__*/(0,jsx_runtime.jsx)(result_input, {
@@ -36802,7 +36839,7 @@ var result_Result = function Result(props) {
36802
36839
  convertBr: convertBr,
36803
36840
  onInputBlur: onInputBlur,
36804
36841
  onClearCreatedData: onClearCreatedData,
36805
- placeholder: placeholder2,
36842
+ placeholder: _placeholder,
36806
36843
  disabled: isFunc(disabled) ? false : !!disabled
36807
36844
  })
36808
36845
  }, 'input');
@@ -42443,6 +42480,9 @@ var DatePicker = function DatePicker(props0) {
42443
42480
  _React$useState2 = slicedToArray_default()(_React$useState, 2),
42444
42481
  activeIndex = _React$useState2[0],
42445
42482
  setActiveIndex = _React$useState2[1];
42483
+ var inputRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)({
42484
+ inputRef: null
42485
+ });
42446
42486
  var styles = jssStyle === null || jssStyle === void 0 || (_jssStyle$datePicker = jssStyle.datePicker) === null || _jssStyle$datePicker === void 0 ? void 0 : _jssStyle$datePicker.call(jssStyle);
42447
42487
  var isRTL = direction === 'rtl';
42448
42488
  var dfp = isRTL ? 'bottom-right' : 'bottom-left';
@@ -42541,6 +42581,11 @@ var DatePicker = function DatePicker(props0) {
42541
42581
  setFocused(false);
42542
42582
  (_props$onBlur = props.onBlur) === null || _props$onBlur === void 0 || _props$onBlur.call(props, e);
42543
42583
  });
42584
+ var handleClose = function handleClose() {
42585
+ var _inputRef$current$inp;
42586
+ closePop();
42587
+ (_inputRef$current$inp = inputRef.current.inputRef) === null || _inputRef$current$inp === void 0 || _inputRef$current$inp.blur();
42588
+ };
42544
42589
  var handleResultClick = usePersistFn(function () {
42545
42590
  if (disabledStatus === 'all') return;
42546
42591
  openPop();
@@ -42553,6 +42598,7 @@ var DatePicker = function DatePicker(props0) {
42553
42598
  activeIndex: activeIndex,
42554
42599
  type: type,
42555
42600
  range: range,
42601
+ onRef: inputRef,
42556
42602
  inputable: props.inputable && !props.formatResult,
42557
42603
  disabledLeft: disabledStatus === 'left',
42558
42604
  disabledRight: disabledStatus === 'right',
@@ -42581,7 +42627,7 @@ var DatePicker = function DatePicker(props0) {
42581
42627
  onKeyDown: function onKeyDown(e) {
42582
42628
  if (e.key === 'Enter') {
42583
42629
  if (open) {
42584
- closePop();
42630
+ handleClose();
42585
42631
  } else {
42586
42632
  openPop();
42587
42633
  }
@@ -42638,7 +42684,7 @@ var DatePicker = function DatePicker(props0) {
42638
42684
  options: options,
42639
42685
  disabled: disabled,
42640
42686
  jssStyle: jssStyle,
42641
- closePop: closePop,
42687
+ closePop: handleClose,
42642
42688
  defaultTime: props.defaultTime,
42643
42689
  min: props.min,
42644
42690
  max: props.max,
@@ -63686,7 +63732,7 @@ var upload_interface = __webpack_require__(8821);
63686
63732
 
63687
63733
 
63688
63734
  /* harmony default export */ var src_0 = ({
63689
- version: '3.3.3-beta.7'
63735
+ version: '3.3.3'
63690
63736
  });
63691
63737
  }();
63692
63738
  /******/ return __webpack_exports__;