@kdcloudjs/kdesign 1.6.37 → 1.6.38

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.
@@ -371,6 +371,7 @@ declare const compDefaultProps: {
371
371
  viewMode: number;
372
372
  aspectRatio: number;
373
373
  okText: string;
374
+ autoCropArea: number;
374
375
  };
375
376
  Anchor: {
376
377
  type: string;
@@ -384,7 +384,8 @@ var compDefaultProps = {
384
384
  dragMode: 'crop',
385
385
  viewMode: 0,
386
386
  aspectRatio: NaN,
387
- okText: '确认裁剪'
387
+ okText: '确认裁剪',
388
+ autoCropArea: 0.5
388
389
  },
389
390
  Anchor: {
390
391
  type: 'bookmarks',
@@ -19,7 +19,8 @@ export interface CropperProps {
19
19
  modal?: boolean;
20
20
  zoomOnWheel?: boolean;
21
21
  cropBoxMovable?: boolean;
22
+ autoCropArea?: number;
22
23
  onCropSuccess?: () => void;
23
24
  }
24
- declare const Cropper: React.ForwardRefExoticComponent<Pick<CropperProps, "className" | "modal" | "imgSrc" | "dragMode" | "viewMode" | "aspectRatio" | "zoomOnWheel" | "cropBoxMovable" | "onCropSuccess"> & React.RefAttributes<CropperInstance | null>>;
25
+ declare const Cropper: React.ForwardRefExoticComponent<Pick<CropperProps, "className" | "modal" | "imgSrc" | "dragMode" | "viewMode" | "aspectRatio" | "zoomOnWheel" | "cropBoxMovable" | "autoCropArea" | "onCropSuccess"> & React.RefAttributes<CropperInstance | null>>;
25
26
  export default Cropper;
@@ -27,6 +27,7 @@ var Cropper = /*#__PURE__*/forwardRef(function (props, forwardedRef) {
27
27
  dragMode = props.dragMode,
28
28
  viewMode = props.viewMode,
29
29
  aspectRatio = props.aspectRatio,
30
+ autoCropArea = props.autoCropArea,
30
31
  _props$modal = props.modal,
31
32
  modal = _props$modal === void 0 ? true : _props$modal,
32
33
  _props$zoomOnWheel = props.zoomOnWheel,
@@ -43,9 +44,9 @@ var Cropper = /*#__PURE__*/forwardRef(function (props, forwardedRef) {
43
44
  dragMode: dragMode,
44
45
  cropBoxMovable: cropBoxMovable,
45
46
  modal: modal,
46
- autoCropArea: 0.5
47
+ autoCropArea: autoCropArea
47
48
  };
48
- }, [aspectRatio, viewMode, zoomOnWheel, dragMode, modal, cropBoxMovable]);
49
+ }, [aspectRatio, viewMode, zoomOnWheel, dragMode, cropBoxMovable, modal, autoCropArea]);
49
50
  useEffect(function () {
50
51
  if (!imgRef.current) return;
51
52
  if (!imgSrc) return;
@@ -24,6 +24,7 @@ export interface ImageCropperProps {
24
24
  customComponents?: customComponentsProps;
25
25
  showDeaultToolbar?: boolean;
26
26
  cropBoxMovable?: boolean;
27
+ autoCropArea?: number;
27
28
  onClose?: () => void;
28
29
  onCropSuccess?: (file: File) => void;
29
30
  onCropFailed?: () => void;
@@ -78,7 +78,8 @@ var InternalImageCropper = function InternalImageCropper(props, forwardedRef) {
78
78
  cropBoxMovable = _a.cropBoxMovable,
79
79
  customComponents = _a.customComponents,
80
80
  showDeaultToolbar = _a.showDeaultToolbar,
81
- restProps = __rest(_a, ["prefixCls", "containerWidth", "containerHeight", "title", "visible", "onClose", "onCropSuccess", "onCropFailed", "dragMode", "viewMode", "aspectRatio", "modal", "okText", "okBtn", "image", "zoomOnWheel", "imageMaxSize", "cropBoxMovable", "customComponents", "showDeaultToolbar"]);
81
+ autoCropArea = _a.autoCropArea,
82
+ restProps = __rest(_a, ["prefixCls", "containerWidth", "containerHeight", "title", "visible", "onClose", "onCropSuccess", "onCropFailed", "dragMode", "viewMode", "aspectRatio", "modal", "okText", "okBtn", "image", "zoomOnWheel", "imageMaxSize", "cropBoxMovable", "customComponents", "showDeaultToolbar", "autoCropArea"]);
82
83
  var prefixCls = getPrefixCls(pkgPrefixCls, 'image-cropper', customPrefixcls);
83
84
  var handleOkClick = function handleOkClick() {
84
85
  return __awaiter(void 0, void 0, void 0, /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
@@ -125,6 +126,7 @@ var InternalImageCropper = function InternalImageCropper(props, forwardedRef) {
125
126
  zoomOnWheel: zoomOnWheel,
126
127
  cropBoxMovable: cropBoxMovable,
127
128
  imgSrc: cropperSrc,
129
+ autoCropArea: autoCropArea,
128
130
  ref: cropperRef
129
131
  });
130
132
  var OperationBarNode = /*#__PURE__*/React.createElement(OperationBar, {
package/es/radio/group.js CHANGED
@@ -12,14 +12,14 @@ var RadioGroup = /*#__PURE__*/React.forwardRef(function (props, ref) {
12
12
  getPrefixCls = _React$useContext.getPrefixCls,
13
13
  prefixCls = _React$useContext.prefixCls,
14
14
  userDefaultProps = _React$useContext.compDefaultProps;
15
- var initValue = props.value === undefined ? props.defaultValue : props.value;
15
+ var initValue = typeof props.value === 'undefined' ? props.defaultValue : props.value;
16
16
  var _React$useState = React.useState(initValue),
17
17
  _React$useState2 = _slicedToArray(_React$useState, 2),
18
18
  value = _React$useState2[0],
19
19
  setValue = _React$useState2[1];
20
20
  // 从props更新value值
21
21
  React.useEffect(function () {
22
- if (props.value !== undefined) {
22
+ if (typeof props.value !== 'undefined') {
23
23
  setValue(props.value);
24
24
  }
25
25
  }, [props.value]);
package/es/radio/radio.js CHANGED
@@ -57,7 +57,9 @@ var InternalRadio = function InternalRadio(props, ref) {
57
57
  }, [checked, defaultChecked, context === null || context === void 0 ? void 0 : context.value]);
58
58
  var onChange = function onChange(e) {
59
59
  if (disabled) return;
60
- setIsChecked(e.target.checked);
60
+ if (typeof (context === null || context === void 0 ? void 0 : context.value) === 'undefined') {
61
+ setIsChecked(e.target.checked);
62
+ }
61
63
  if (props.onChange) {
62
64
  props.onChange(e);
63
65
  }
@@ -371,6 +371,7 @@ declare const compDefaultProps: {
371
371
  viewMode: number;
372
372
  aspectRatio: number;
373
373
  okText: string;
374
+ autoCropArea: number;
374
375
  };
375
376
  Anchor: {
376
377
  type: string;
@@ -395,7 +395,8 @@ var compDefaultProps = {
395
395
  dragMode: 'crop',
396
396
  viewMode: 0,
397
397
  aspectRatio: NaN,
398
- okText: '确认裁剪'
398
+ okText: '确认裁剪',
399
+ autoCropArea: 0.5
399
400
  },
400
401
  Anchor: {
401
402
  type: 'bookmarks',
@@ -19,7 +19,8 @@ export interface CropperProps {
19
19
  modal?: boolean;
20
20
  zoomOnWheel?: boolean;
21
21
  cropBoxMovable?: boolean;
22
+ autoCropArea?: number;
22
23
  onCropSuccess?: () => void;
23
24
  }
24
- declare const Cropper: React.ForwardRefExoticComponent<Pick<CropperProps, "className" | "modal" | "imgSrc" | "dragMode" | "viewMode" | "aspectRatio" | "zoomOnWheel" | "cropBoxMovable" | "onCropSuccess"> & React.RefAttributes<CropperInstance | null>>;
25
+ declare const Cropper: React.ForwardRefExoticComponent<Pick<CropperProps, "className" | "modal" | "imgSrc" | "dragMode" | "viewMode" | "aspectRatio" | "zoomOnWheel" | "cropBoxMovable" | "autoCropArea" | "onCropSuccess"> & React.RefAttributes<CropperInstance | null>>;
25
26
  export default Cropper;
@@ -40,6 +40,7 @@ var Cropper = /*#__PURE__*/(0, _react.forwardRef)(function (props, forwardedRef)
40
40
  dragMode = props.dragMode,
41
41
  viewMode = props.viewMode,
42
42
  aspectRatio = props.aspectRatio,
43
+ autoCropArea = props.autoCropArea,
43
44
  _props$modal = props.modal,
44
45
  modal = _props$modal === void 0 ? true : _props$modal,
45
46
  _props$zoomOnWheel = props.zoomOnWheel,
@@ -56,9 +57,9 @@ var Cropper = /*#__PURE__*/(0, _react.forwardRef)(function (props, forwardedRef)
56
57
  dragMode: dragMode,
57
58
  cropBoxMovable: cropBoxMovable,
58
59
  modal: modal,
59
- autoCropArea: 0.5
60
+ autoCropArea: autoCropArea
60
61
  };
61
- }, [aspectRatio, viewMode, zoomOnWheel, dragMode, modal, cropBoxMovable]);
62
+ }, [aspectRatio, viewMode, zoomOnWheel, dragMode, cropBoxMovable, modal, autoCropArea]);
62
63
  (0, _react.useEffect)(function () {
63
64
  if (!imgRef.current) return;
64
65
  if (!imgSrc) return;
@@ -24,6 +24,7 @@ export interface ImageCropperProps {
24
24
  customComponents?: customComponentsProps;
25
25
  showDeaultToolbar?: boolean;
26
26
  cropBoxMovable?: boolean;
27
+ autoCropArea?: number;
27
28
  onClose?: () => void;
28
29
  onCropSuccess?: (file: File) => void;
29
30
  onCropFailed?: () => void;
@@ -90,7 +90,8 @@ var InternalImageCropper = function InternalImageCropper(props, forwardedRef) {
90
90
  cropBoxMovable = _a.cropBoxMovable,
91
91
  customComponents = _a.customComponents,
92
92
  showDeaultToolbar = _a.showDeaultToolbar,
93
- restProps = __rest(_a, ["prefixCls", "containerWidth", "containerHeight", "title", "visible", "onClose", "onCropSuccess", "onCropFailed", "dragMode", "viewMode", "aspectRatio", "modal", "okText", "okBtn", "image", "zoomOnWheel", "imageMaxSize", "cropBoxMovable", "customComponents", "showDeaultToolbar"]);
93
+ autoCropArea = _a.autoCropArea,
94
+ restProps = __rest(_a, ["prefixCls", "containerWidth", "containerHeight", "title", "visible", "onClose", "onCropSuccess", "onCropFailed", "dragMode", "viewMode", "aspectRatio", "modal", "okText", "okBtn", "image", "zoomOnWheel", "imageMaxSize", "cropBoxMovable", "customComponents", "showDeaultToolbar", "autoCropArea"]);
94
95
  var prefixCls = getPrefixCls(pkgPrefixCls, 'image-cropper', customPrefixcls);
95
96
  var handleOkClick = function handleOkClick() {
96
97
  return __awaiter(void 0, void 0, void 0, /*#__PURE__*/_regenerator.default.mark(function _callee() {
@@ -137,6 +138,7 @@ var InternalImageCropper = function InternalImageCropper(props, forwardedRef) {
137
138
  zoomOnWheel: zoomOnWheel,
138
139
  cropBoxMovable: cropBoxMovable,
139
140
  imgSrc: cropperSrc,
141
+ autoCropArea: autoCropArea,
140
142
  ref: cropperRef
141
143
  });
142
144
  var OperationBarNode = /*#__PURE__*/_react.default.createElement(_operationBar.default, {
@@ -24,14 +24,14 @@ var RadioGroup = /*#__PURE__*/React.forwardRef(function (props, ref) {
24
24
  getPrefixCls = _React$useContext.getPrefixCls,
25
25
  prefixCls = _React$useContext.prefixCls,
26
26
  userDefaultProps = _React$useContext.compDefaultProps;
27
- var initValue = props.value === undefined ? props.defaultValue : props.value;
27
+ var initValue = typeof props.value === 'undefined' ? props.defaultValue : props.value;
28
28
  var _React$useState = React.useState(initValue),
29
29
  _React$useState2 = (0, _slicedToArray2.default)(_React$useState, 2),
30
30
  value = _React$useState2[0],
31
31
  setValue = _React$useState2[1];
32
32
  // 从props更新value值
33
33
  React.useEffect(function () {
34
- if (props.value !== undefined) {
34
+ if (typeof props.value !== 'undefined') {
35
35
  setValue(props.value);
36
36
  }
37
37
  }, [props.value]);
@@ -69,7 +69,9 @@ var InternalRadio = function InternalRadio(props, ref) {
69
69
  }, [checked, defaultChecked, context === null || context === void 0 ? void 0 : context.value]);
70
70
  var onChange = function onChange(e) {
71
71
  if (disabled) return;
72
- setIsChecked(e.target.checked);
72
+ if (typeof (context === null || context === void 0 ? void 0 : context.value) === 'undefined') {
73
+ setIsChecked(e.target.checked);
74
+ }
73
75
  if (props.onChange) {
74
76
  props.onChange(e);
75
77
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kdcloudjs/kdesign",
3
- "version": "1.6.37",
3
+ "version": "1.6.38",
4
4
  "description": "KDesign 金蝶前端react 组件库",
5
5
  "title": "kdesign",
6
6
  "keywords": [
@@ -241,7 +241,8 @@
241
241
  },
242
242
  "resolutions": {
243
243
  "@types/babel__traverse": "7.17.1",
244
- "@types/node": "17.0.41"
244
+ "@types/node": "17.0.41",
245
+ "prettier": "2.8.0"
245
246
  },
246
247
  "license": "Apache-2.0"
247
248
  }