oa-componentbook 1.0.1-stage.82 → 1.0.1-stage.83
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.
|
@@ -116,8 +116,10 @@ function CustomDocumentViewer(_ref) {
|
|
|
116
116
|
const onMouseMove = e => {
|
|
117
117
|
if (!isDragging) return;
|
|
118
118
|
e.preventDefault();
|
|
119
|
-
|
|
120
|
-
|
|
119
|
+
const deltaX = e.pageX - startX;
|
|
120
|
+
const deltaY = e.pageY - startY;
|
|
121
|
+
container.scrollLeft = scrollLeft - deltaX;
|
|
122
|
+
container.scrollTop = scrollTop - deltaY;
|
|
121
123
|
};
|
|
122
124
|
const onMouseUp = function onMouseUp() {
|
|
123
125
|
isDragging = false;
|
|
@@ -235,9 +237,10 @@ function CustomDocumentViewer(_ref) {
|
|
|
235
237
|
pageNumber: index + 1,
|
|
236
238
|
scale: 1.0
|
|
237
239
|
}))))), fileType === "image" && /*#__PURE__*/_react.default.createElement("div", {
|
|
240
|
+
className: "oaImgCenter",
|
|
238
241
|
style: {
|
|
239
242
|
transform: "scale(".concat(scale, ") rotate(").concat(rotation, "deg)"),
|
|
240
|
-
transformOrigin: "center center"
|
|
243
|
+
transformOrigin: scale > 1.4 ? "left top" : "center center"
|
|
241
244
|
}
|
|
242
245
|
}, /*#__PURE__*/_react.default.createElement("img", {
|
|
243
246
|
src: fileUrl,
|
|
@@ -8,5 +8,5 @@ var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
|
8
8
|
var _templateObject;
|
|
9
9
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
10
10
|
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
11
|
-
const DocumentViewerContainer = _styledComponents.default.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n .customDocumentViewerOverlay {\n background-color: var(--color-primary-content);\n height: ", ";\n display: flex;\n justify-content: flex-start;\n width: 100%;\n padding: 0;\n margin: 0;\n flex-direction: column;\n overflow: auto;\n align-items: center; position: relative;\n }\n\n .documentPdfHeight{height:calc(100vh - 114px);}\n\n .customDocumentViewerOverlayHeader {\n position: fixed;\n padding: 0 16px;\n bottom: 74px;\n left: auto;\n right: auto;\n border-radius: 4px;\n z-index: 99;\n background: rgba(0, 0, 0, 0.7);\n box-shadow: 0px 2px 10px 0px rgba(0, 0, 0, 0.34);\n display: flex;\n align-items: center;\n justify-content: center;\n height: 40px;\n top:auto;\n }\n .customDocumentViewerOverlayHeaderIcons {\n display: flex;\n padding: 8px 0;\n flex-direction: row;\n gap: 16px;\n }\n\n .downloadIcon {\n border-left: solid 1px #fff;\n padding-left: 16px;\n margin-left: 16px;\n height: 100%;\n align-items: center;\n display: flex;\n }\n .pageNumber {\n border-right: solid 1px #fff;\n padding-right: 16px;\n margin-right: 16px;\n height: 100%;\n align-items: center;\n display: flex;\n }\n .ant-radio-group {\n display: flex;\n white-space: nowrap;\n }\n"])), props => props.documentViewerOverlayHeight);
|
|
11
|
+
const DocumentViewerContainer = _styledComponents.default.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n .customDocumentViewerOverlay {\n background-color: var(--color-primary-content);\n height: ", ";\n display: flex;\n justify-content: flex-start;\n width: 100%;\n padding: 0;\n margin: 0;\n flex-direction: column;\n overflow: auto;\n align-items: center; position: relative;\n }\n\n .documentPdfHeight{height:calc(100vh - 114px);}\n\n .customDocumentViewerOverlayHeader {\n position: fixed;\n padding: 0 16px;\n bottom: 74px;\n left: auto;\n right: auto;\n border-radius: 4px;\n z-index: 99;\n background: rgba(0, 0, 0, 0.7);\n box-shadow: 0px 2px 10px 0px rgba(0, 0, 0, 0.34);\n display: flex;\n align-items: center;\n justify-content: center;\n height: 40px;\n top:auto;\n }\n .customDocumentViewerOverlayHeaderIcons {\n display: flex;\n padding: 8px 0;\n flex-direction: row;\n gap: 16px;\n }\n\n .downloadIcon {\n border-left: solid 1px #fff;\n padding-left: 16px;\n margin-left: 16px;\n height: 100%;\n align-items: center;\n display: flex;\n }\n .pageNumber {\n border-right: solid 1px #fff;\n padding-right: 16px;\n margin-right: 16px;\n height: 100%;\n align-items: center;\n display: flex;\n }\n .ant-radio-group {\n display: flex;\n white-space: nowrap;\n }\n .oaImgCenter{\n height: calc(-114px + 100vh);\n display: flex;\n justify-content: center;\n align-items: center;\n position: relative;\n }\n"])), props => props.documentViewerOverlayHeight);
|
|
12
12
|
var _default = exports.default = DocumentViewerContainer;
|