shineout 3.3.3-beta.8 → 3.3.3-fix.1

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.8'
479
+ version: '3.3.3-fix.1'
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.8');
11971
+ /* harmony default export */ var version = ('3.3.3-fix.1');
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
@@ -31828,19 +31849,18 @@ function useInputAble(props) {
31828
31849
  var render = useRender(syncValue);
31829
31850
  var shouldUseState = delay || !control;
31830
31851
  var value = shouldUseState ? stateValue : valuePo;
31831
- (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
31832
- if (context.timer) {
31852
+ (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useLayoutEffect)(function () {
31853
+ if (delay && control && props.value !== stateValue) {
31854
+ changeStateValue(props.value);
31855
+ } else if (context.timer) {
31833
31856
  clearTimeout(context.timer);
31834
31857
  context.timer = null;
31835
31858
  }
31836
- if (delay && props.value !== stateValue) {
31837
- changeStateValue(props.value);
31838
- }
31839
- }, [props.value, delay]);
31859
+ }, [props.value, delay, control]);
31840
31860
  var forceDelayChange = use_persist_fn(function () {
31841
- if (context.timer && context.delayChange) {
31861
+ if (context.delayChange) context.delayChange();
31862
+ if (context.timer) {
31842
31863
  clearTimeout(context.timer);
31843
- context.delayChange();
31844
31864
  context.timer = null;
31845
31865
  context.delayChange = null;
31846
31866
  }
@@ -36236,6 +36256,13 @@ var ResultInput = function ResultInput(props) {
36236
36256
  onRef.current = inputRef.current;
36237
36257
  onBindInput === null || onBindInput === void 0 || onBindInput(inputRef.current);
36238
36258
  }, []);
36259
+ var renderResultPlaceholder = function renderResultPlaceholder() {
36260
+ if (inputText || !focus || typeof props.placeholder === 'string') return null;
36261
+ return /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
36262
+ className: styles.inputPlaceholder,
36263
+ children: props.placeholder
36264
+ });
36265
+ };
36239
36266
  var style = {};
36240
36267
  if (!multiple) {
36241
36268
  style.width = '100%';
@@ -36249,7 +36276,7 @@ var ResultInput = function ResultInput(props) {
36249
36276
  children: [/*#__PURE__*/(0,jsx_runtime.jsx)(result_Input, {
36250
36277
  onRef: bindInputRef,
36251
36278
  style: style,
36252
- placeholder: props.placeholder,
36279
+ placeholder: typeof props.placeholder === 'string' ? props.placeholder : undefined,
36253
36280
  value: inputText,
36254
36281
  maxLength: maxLength,
36255
36282
  onChange: onChange,
@@ -36261,7 +36288,7 @@ var ResultInput = function ResultInput(props) {
36261
36288
  className: styles.inputMirror,
36262
36289
  ref: mirrorRef,
36263
36290
  children: inputText || value
36264
- })]
36291
+ }), renderResultPlaceholder()]
36265
36292
  });
36266
36293
  };
36267
36294
  /* harmony default export */ var result_input = (ResultInput);
@@ -36790,14 +36817,10 @@ var result_Result = function Result(props) {
36790
36817
  onResultItemClick === null || onResultItemClick === void 0 || onResultItemClick(e, item);
36791
36818
  };
36792
36819
  var renderInput = function renderInput() {
36793
- var placeholder2 = empty ? placeholder : '';
36820
+ var _placeholder = empty ? placeholder : '';
36794
36821
  if (!multiple && valueProp && valueProp !== 0) {
36795
36822
  var _result = getDataByValues(value);
36796
- // 获取合法的 content
36797
- var content = renderResultContent(_result[0]);
36798
- if (typeof content === 'string') {
36799
- placeholder2 = content;
36800
- }
36823
+ _placeholder = renderResultContent(_result[0]);
36801
36824
  }
36802
36825
  return /*#__PURE__*/(0,jsx_runtime.jsx)((external_root_React_commonjs2_react_commonjs_react_amd_react_default()).Fragment, {
36803
36826
  children: /*#__PURE__*/(0,jsx_runtime.jsx)(result_input, {
@@ -36815,7 +36838,7 @@ var result_Result = function Result(props) {
36815
36838
  convertBr: convertBr,
36816
36839
  onInputBlur: onInputBlur,
36817
36840
  onClearCreatedData: onClearCreatedData,
36818
- placeholder: placeholder2,
36841
+ placeholder: _placeholder,
36819
36842
  disabled: isFunc(disabled) ? false : !!disabled
36820
36843
  })
36821
36844
  }, 'input');
@@ -63708,7 +63731,7 @@ var upload_interface = __webpack_require__(8821);
63708
63731
 
63709
63732
 
63710
63733
  /* harmony default export */ var src_0 = ({
63711
- version: '3.3.3-beta.8'
63734
+ version: '3.3.3-fix.1'
63712
63735
  });
63713
63736
  }();
63714
63737
  /******/ return __webpack_exports__;