shineout 3.9.1-beta.3 → 3.9.1-beta.5

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
@@ -522,5 +522,5 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
522
522
  // 此文件由脚本自动生成,请勿直接修改。
523
523
  // This file was generated automatically by a script. Please do not modify it directly.
524
524
  var _default = exports.default = {
525
- version: '3.9.1-beta.3'
525
+ version: '3.9.1-beta.5'
526
526
  };
package/dist/shineout.js CHANGED
@@ -12400,7 +12400,7 @@ var handleStyle = function handleStyle(style) {
12400
12400
  };
12401
12401
  /* harmony default export */ var jss_style_handleStyle = (handleStyle);
12402
12402
  ;// CONCATENATED MODULE: ../shineout-style/src/version.ts
12403
- /* harmony default export */ var version = ('3.9.1-beta.3');
12403
+ /* harmony default export */ var version = ('3.9.1-beta.5');
12404
12404
  ;// CONCATENATED MODULE: ../shineout-style/src/jss-style/index.tsx
12405
12405
 
12406
12406
 
@@ -37036,15 +37036,15 @@ function useInputAble(props) {
37036
37036
  changeStateValue(vv);
37037
37037
  }
37038
37038
  if (!isFunc(onChange)) return;
37039
- context.delayChange = function () {
37040
- context.timer = null;
37041
- context.delayChange = null;
37042
- onChange.apply(void 0, [vv].concat(other));
37043
- render();
37044
- };
37045
37039
  if (!delay) {
37046
37040
  onChange.apply(void 0, [vv].concat(other));
37047
37041
  } else {
37042
+ context.delayChange = function () {
37043
+ context.timer = null;
37044
+ context.delayChange = null;
37045
+ onChange.apply(void 0, [vv].concat(other));
37046
+ render();
37047
+ };
37048
37048
  if (context.timer) clearTimeout(context.timer);
37049
37049
  context.timer = setTimeout(context.delayChange, delay);
37050
37050
  }
@@ -62177,7 +62177,7 @@ var Rate = function Rate(props0) {
62177
62177
  var currentIndex = Math.ceil(showValue) - 1;
62178
62178
  var frontItem = Array.isArray(front) ? front[repeat ? currentIndex : index] : front;
62179
62179
  var backItem = Array.isArray(back) ? back[index] : back;
62180
- var isHalfChecked = props.allowHalf && showValue % 1 > 0 && index === currentIndex;
62180
+ var isHalfChecked = (props.allowHalf || props.disabled) && showValue % 1 > 0 && index === currentIndex;
62181
62181
  var isChecked = !isHalfChecked && index <= currentIndex;
62182
62182
  var handleChange = function handleChange(val) {
62183
62183
  if (clearable && value === val) {
@@ -62189,6 +62189,11 @@ var Rate = function Rate(props0) {
62189
62189
  }
62190
62190
  };
62191
62191
  var showAnimation = animationIndex && index < currentIndex;
62192
+
62193
+ // 只读状态下支持 0.6 这样的小数显示具体百分比的半颗星,而非固定的 50% 半星显示
62194
+ var halfStyle = props.disabled && value % 1 > 0 ? {
62195
+ width: value % 1 * 100 + '%'
62196
+ } : undefined;
62192
62197
  return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
62193
62198
  className: classnames_default()(rateClasses === null || rateClasses === void 0 ? void 0 : rateClasses.item, isHalfChecked && (rateClasses === null || rateClasses === void 0 ? void 0 : rateClasses.itemCheckedHalf), isChecked && (rateClasses === null || rateClasses === void 0 ? void 0 : rateClasses.itemChecked), props.disabled && (rateClasses === null || rateClasses === void 0 ? void 0 : rateClasses.itemDisabled), showAnimation && (rateClasses === null || rateClasses === void 0 ? void 0 : rateClasses.itemAnimation)),
62194
62199
  style: {
@@ -62211,7 +62216,7 @@ var Rate = function Rate(props0) {
62211
62216
  handleChange(index + 1);
62212
62217
  } : undefined,
62213
62218
  children: frontItem
62214
- }), props.allowHalf && /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
62219
+ }), (props.allowHalf || props.disabled) && /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
62215
62220
  onMouseEnter: !props.disabled ? function () {
62216
62221
  setHoverValue(index + 0.5);
62217
62222
  } : undefined,
@@ -62219,6 +62224,7 @@ var Rate = function Rate(props0) {
62219
62224
  handleChange(index + 0.5);
62220
62225
  } : undefined,
62221
62226
  className: rateClasses === null || rateClasses === void 0 ? void 0 : rateClasses.itemHalf,
62227
+ style: halfStyle,
62222
62228
  dir: config.direction,
62223
62229
  children: frontItem
62224
62230
  })]
@@ -74412,7 +74418,7 @@ var upload_interface = __webpack_require__(8821);
74412
74418
 
74413
74419
 
74414
74420
  /* harmony default export */ var src_0 = ({
74415
- version: '3.9.1-beta.3'
74421
+ version: '3.9.1-beta.5'
74416
74422
  });
74417
74423
  }();
74418
74424
  /******/ return __webpack_exports__;