@zat-design/sisyphus-react 3.7.2-beta.5 → 3.7.2-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.
@@ -52,6 +52,8 @@ var InputNumber = function InputNumber(props) {
52
52
  viewType = _ref2.viewType,
53
53
  label = _ref2.label;
54
54
  var initialConfig = useProConfig('InputNumber');
55
+ // @ts-ignore
56
+ var _valueType = valueType || rest.valueType;
55
57
  var activateRef = useRef(false);
56
58
  var isView = typeof props.isView === 'boolean' ? props.isView : isViewCon; // 组件可直接接收isView参数, 优先级高
57
59
  var valueProps = {};
@@ -84,8 +86,8 @@ var InputNumber = function InputNumber(props) {
84
86
  var num = Number(value.replace(/[\s,]+/g, ''));
85
87
  return Number.isNaN(num) || !precision && precision !== 0 ? Number.isNaN(Number(value)) ? null : value : num.toFixed(precision);
86
88
  };
87
- if (valueType) {
88
- switch (valueType) {
89
+ if (_valueType) {
90
+ switch (_valueType) {
89
91
  // 千分位
90
92
  case 'thousandth':
91
93
  case 'thousandthCNY':
@@ -261,7 +263,7 @@ var InputNumber = function InputNumber(props) {
261
263
  min: Number(_min),
262
264
  max: Number(_max)
263
265
  };
264
- switch (valueType || viewType) {
266
+ switch (_valueType || viewType) {
265
267
  // 百分比
266
268
  case 'percent':
267
269
  case 'percentage':
@@ -18,7 +18,7 @@ var transformRatio = function transformRatio(_ref) {
18
18
  return {
19
19
  normalize: function normalize(value) {
20
20
  if (!value || !value.some(function (item) {
21
- return item;
21
+ return item || item === 0;
22
22
  })) {
23
23
  return {};
24
24
  }
@@ -26,7 +26,7 @@ var transformRatio = function transformRatio(_ref) {
26
26
  },
27
27
  getValueProps: function getValueProps(value) {
28
28
  if (!value || !value.some(function (item) {
29
- return item;
29
+ return item || item === 0;
30
30
  })) {
31
31
  return {
32
32
  value: []
@@ -71,7 +71,7 @@ var ProUpload = /*#__PURE__*/React.forwardRef(function (props, ref) {
71
71
  fieldNames = props.fieldNames,
72
72
  isConfirmDelete = props.isConfirmDelete,
73
73
  residueProps = _objectWithoutProperties(props, _excluded);
74
- var isView = otherProps === null || otherProps === void 0 ? void 0 : otherProps.isView;
74
+ var isView = (props === null || props === void 0 ? void 0 : props.isView) || (otherProps === null || otherProps === void 0 ? void 0 : otherProps.isView);
75
75
  var sensor = useSensor(PointerSensor, {
76
76
  activationConstraint: {
77
77
  distance: 10
@@ -195,6 +195,11 @@ export interface ProUploadProps {
195
195
  */
196
196
  isConfirmDelete?: boolean;
197
197
  id?: string;
198
+ /**
199
+ * @description 查看模式
200
+ * @default false
201
+ */
202
+ isView?: boolean;
198
203
  }
199
204
  export interface DraggableUploadListItemProps {
200
205
  file: UploadFile<any>;
@@ -56,6 +56,8 @@ var InputNumber = function InputNumber(props) {
56
56
  viewType = _ref2.viewType,
57
57
  label = _ref2.label;
58
58
  var initialConfig = (0, _ProConfigProvider.useProConfig)('InputNumber');
59
+ // @ts-ignore
60
+ var _valueType = valueType || rest.valueType;
59
61
  var activateRef = (0, _react.useRef)(false);
60
62
  var isView = typeof props.isView === 'boolean' ? props.isView : isViewCon; // 组件可直接接收isView参数, 优先级高
61
63
  var valueProps = {};
@@ -88,8 +90,8 @@ var InputNumber = function InputNumber(props) {
88
90
  var num = Number(value.replace(/[\s,]+/g, ''));
89
91
  return Number.isNaN(num) || !precision && precision !== 0 ? Number.isNaN(Number(value)) ? null : value : num.toFixed(precision);
90
92
  };
91
- if (valueType) {
92
- switch (valueType) {
93
+ if (_valueType) {
94
+ switch (_valueType) {
93
95
  // 千分位
94
96
  case 'thousandth':
95
97
  case 'thousandthCNY':
@@ -265,7 +267,7 @@ var InputNumber = function InputNumber(props) {
265
267
  min: Number(_min),
266
268
  max: Number(_max)
267
269
  };
268
- switch (valueType || viewType) {
270
+ switch (_valueType || viewType) {
269
271
  // 百分比
270
272
  case 'percent':
271
273
  case 'percentage':
@@ -25,7 +25,7 @@ var transformRatio = function transformRatio(_ref) {
25
25
  return {
26
26
  normalize: function normalize(value) {
27
27
  if (!value || !value.some(function (item) {
28
- return item;
28
+ return item || item === 0;
29
29
  })) {
30
30
  return {};
31
31
  }
@@ -33,7 +33,7 @@ var transformRatio = function transformRatio(_ref) {
33
33
  },
34
34
  getValueProps: function getValueProps(value) {
35
35
  if (!value || !value.some(function (item) {
36
- return item;
36
+ return item || item === 0;
37
37
  })) {
38
38
  return {
39
39
  value: []
@@ -78,7 +78,7 @@ var ProUpload = /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
78
78
  fieldNames = props.fieldNames,
79
79
  isConfirmDelete = props.isConfirmDelete,
80
80
  residueProps = (0, _objectWithoutProperties2.default)(props, _excluded);
81
- var isView = otherProps === null || otherProps === void 0 ? void 0 : otherProps.isView;
81
+ var isView = (props === null || props === void 0 ? void 0 : props.isView) || (otherProps === null || otherProps === void 0 ? void 0 : otherProps.isView);
82
82
  var sensor = (0, _core.useSensor)(_core.PointerSensor, {
83
83
  activationConstraint: {
84
84
  distance: 10
@@ -195,6 +195,11 @@ export interface ProUploadProps {
195
195
  */
196
196
  isConfirmDelete?: boolean;
197
197
  id?: string;
198
+ /**
199
+ * @description 查看模式
200
+ * @default false
201
+ */
202
+ isView?: boolean;
198
203
  }
199
204
  export interface DraggableUploadListItemProps {
200
205
  file: UploadFile<any>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zat-design/sisyphus-react",
3
- "version": "3.7.2-beta.5",
3
+ "version": "3.7.2-beta.7",
4
4
  "license": "Apache-2.0",
5
5
  "main": "lib/index.js",
6
6
  "module": "es/index.js",