Comparing version 5.4.0 to 5.5.0
@@ -17,4 +17,5 @@ import * as React from 'react'; | ||
}; | ||
countRender?: (current: number, total: number) => string; | ||
} | ||
declare const Preview: React.FC<PreviewProps>; | ||
export default Preview; |
@@ -6,3 +6,3 @@ import _extends from "@babel/runtime/helpers/esm/extends"; | ||
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties"; | ||
var _excluded = ["prefixCls", "src", "alt", "onClose", "afterClose", "visible", "icons", "rootClassName"]; | ||
var _excluded = ["prefixCls", "src", "alt", "onClose", "afterClose", "visible", "icons", "rootClassName", "countRender"]; | ||
import * as React from 'react'; | ||
@@ -28,2 +28,4 @@ import Dialog from 'rc-dialog'; | ||
var Preview = function Preview(props) { | ||
var _countRender; | ||
var prefixCls = props.prefixCls, | ||
@@ -38,2 +40,3 @@ src = props.src, | ||
rootClassName = props.rootClassName, | ||
countRender = props.countRender, | ||
restProps = _objectWithoutProperties(props, _excluded); | ||
@@ -299,3 +302,5 @@ | ||
className: "".concat(prefixCls, "-operations") | ||
}, tools.map(function (_ref) { | ||
}, showLeftOrRightSwitches && /*#__PURE__*/React.createElement("li", { | ||
className: "".concat(prefixCls, "-operations-progress") | ||
}, (_countRender = countRender === null || countRender === void 0 ? void 0 : countRender(currentPreviewIndex + 1, previewGroupCount)) !== null && _countRender !== void 0 ? _countRender : "".concat(currentPreviewIndex + 1, " / ").concat(previewGroupCount)), tools.map(function (_ref) { | ||
var icon = _ref.icon, | ||
@@ -302,0 +307,0 @@ onClick = _ref.onClick, |
@@ -10,2 +10,3 @@ import * as React from 'react'; | ||
current?: number; | ||
countRender?: (current: number, total: number) => string; | ||
} | ||
@@ -12,0 +13,0 @@ export interface GroupConsumerProps { |
@@ -5,3 +5,3 @@ import _extends from "@babel/runtime/helpers/esm/extends"; | ||
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties"; | ||
var _excluded = ["visible", "onVisibleChange", "getContainer", "current"]; | ||
var _excluded = ["visible", "onVisibleChange", "getContainer", "current", "countRender"]; | ||
import * as React from 'react'; | ||
@@ -54,2 +54,4 @@ import { useState } from 'react'; | ||
currentIndex = _ref2$current === void 0 ? 0 : _ref2$current, | ||
_ref2$countRender = _ref2.countRender, | ||
countRender = _ref2$countRender === void 0 ? undefined : _ref2$countRender, | ||
dialogProps = _objectWithoutProperties(_ref2, _excluded); | ||
@@ -149,3 +151,4 @@ | ||
icons: icons, | ||
getContainer: getContainer | ||
getContainer: getContainer, | ||
countRender: countRender | ||
}, dialogProps))); | ||
@@ -152,0 +155,0 @@ }; |
@@ -17,4 +17,5 @@ import * as React from 'react'; | ||
}; | ||
countRender?: (current: number, total: number) => string; | ||
} | ||
declare const Preview: React.FC<PreviewProps>; | ||
export default Preview; |
@@ -40,3 +40,3 @@ "use strict"; | ||
var _excluded = ["prefixCls", "src", "alt", "onClose", "afterClose", "visible", "icons", "rootClassName"]; | ||
var _excluded = ["prefixCls", "src", "alt", "onClose", "afterClose", "visible", "icons", "rootClassName", "countRender"]; | ||
var useState = React.useState, | ||
@@ -53,2 +53,4 @@ useEffect = React.useEffect, | ||
var Preview = function Preview(props) { | ||
var _countRender; | ||
var prefixCls = props.prefixCls, | ||
@@ -63,2 +65,3 @@ src = props.src, | ||
rootClassName = props.rootClassName, | ||
countRender = props.countRender, | ||
restProps = (0, _objectWithoutProperties2.default)(props, _excluded); | ||
@@ -323,3 +326,5 @@ var rotateLeft = icons.rotateLeft, | ||
className: "".concat(prefixCls, "-operations") | ||
}, tools.map(function (_ref) { | ||
}, showLeftOrRightSwitches && /*#__PURE__*/React.createElement("li", { | ||
className: "".concat(prefixCls, "-operations-progress") | ||
}, (_countRender = countRender === null || countRender === void 0 ? void 0 : countRender(currentPreviewIndex + 1, previewGroupCount)) !== null && _countRender !== void 0 ? _countRender : "".concat(currentPreviewIndex + 1, " / ").concat(previewGroupCount)), tools.map(function (_ref) { | ||
var icon = _ref.icon, | ||
@@ -326,0 +331,0 @@ onClick = _ref.onClick, |
@@ -10,2 +10,3 @@ import * as React from 'react'; | ||
current?: number; | ||
countRender?: (current: number, total: number) => string; | ||
} | ||
@@ -12,0 +13,0 @@ export interface GroupConsumerProps { |
@@ -26,3 +26,3 @@ "use strict"; | ||
var _excluded = ["visible", "onVisibleChange", "getContainer", "current"]; | ||
var _excluded = ["visible", "onVisibleChange", "getContainer", "current", "countRender"]; | ||
@@ -72,2 +72,4 @@ /* istanbul ignore next */ | ||
currentIndex = _ref2$current === void 0 ? 0 : _ref2$current, | ||
_ref2$countRender = _ref2.countRender, | ||
countRender = _ref2$countRender === void 0 ? undefined : _ref2$countRender, | ||
dialogProps = (0, _objectWithoutProperties2.default)(_ref2, _excluded); | ||
@@ -167,3 +169,4 @@ | ||
icons: icons, | ||
getContainer: getContainer | ||
getContainer: getContainer, | ||
countRender: countRender | ||
}, dialogProps))); | ||
@@ -170,0 +173,0 @@ }; |
{ | ||
"name": "rc-image", | ||
"version": "5.4.0", | ||
"version": "5.5.0", | ||
"description": "React easy to use image component", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -58,3 +58,3 @@ # rc-image | ||
| --- | --- | --- | --- | | ||
| preview | boolean \| {visible: boolean,onVisibleChange:function(value, prevValue),getContainer: string \| HTMLElement \| (() => HTMLElement) \| false } | true | Whether to show preview | | ||
| preview | boolean \| { visible: boolean, onVisibleChange: function(value, prevValue), getContainer: string \| HTMLElement \| (() => HTMLElement) \| false } | true | Whether to show preview | | ||
| prefixCls | string | rc-image | Classname prefix | | ||
@@ -85,4 +85,5 @@ | placeholder | boolean \| ReactElement | - | if `true` will set default placeholder or use `ReactElement` set customize placeholder | | ||
| --- | --- | --- | --- | | ||
| preview | boolean \| {visible: boolean,onVisibleChange:function(value, prevValue),getContainer: string \| HTMLElement \| (() => HTMLElement) \| false } | true | Whether to show preview | | ||
| current | number | 0 | If Preview the show img index | | ||
| preview | boolean \|<br> { visible: boolean, onVisibleChange: function(value, prevValue), getContainer: string \| HTMLElement \| (() => HTMLElement) \| false, countRender?: (current: number, total: number) => string, current: number } | true | Whether to show preview, <br> current: If Preview the show img index, default 0 | | ||
| previewPrefixCls | string | rc-image-preview | Preview classname prefix | | ||
| icons | { [iconKey]?: ReactNode } | - | Icons in the top operation bar, iconKey: 'rotateLeft' \| 'rotateRight' \| 'zoomIn' \| 'zoomOut' \| 'close' \| 'left' \| 'right' | ||
@@ -89,0 +90,0 @@ ## Example |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
83747
2045
107