datasync-blob 1.1.4 → 1.1.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/dist/DsBlob.js CHANGED
@@ -9,6 +9,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
9
  };
10
10
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
11
11
  import { Component } from "react";
12
+ import "./DsBlob.css";
12
13
  export class DsBlob extends Component {
13
14
  constructor(props) {
14
15
  super(props);
@@ -131,39 +132,12 @@ export class DsBlob extends Component {
131
132
  this.debugging = false;
132
133
  }
133
134
  render() {
134
- const upload_picture_label = {
135
- cursor: "pointer"
136
- };
137
- const upload_picture_label_input = {
138
- opacity: "0",
139
- width: "0px",
140
- height: "0px"
141
- };
142
- const div_show_image_hover = {
143
- position: "relative",
144
- margin: "0px",
145
- opacity: "0.5"
146
- };
147
- const div_show_image = {
148
- position: "relative",
149
- margin: "0px"
150
- };
151
- const div_show_image_hover_input = {
152
- display: "block",
153
- top: "0px",
154
- left: "0px",
155
- position: "absolute"
156
- };
157
- const div_show_image_input = {
158
- position: "absolute",
159
- display: "none",
160
- cursor: "pointer"
161
- };
135
+ // Styles moved to external CSS file: DsBlob.css
162
136
  return (_jsxs("div", { children: [(!this.props.data) &&
163
- _jsxs("label", { id: "upload-picture-label", className: this.props.buttonStyle, style: upload_picture_label, children: [this.props.Caption, _jsx("input", { style: upload_picture_label_input, id: "nested-input", type: "file", accept: "image/*", onChange: this.onInputChange, multiple: true })] }), (this.props.data && this.props.data.length > 0) &&
164
- _jsxs("div", { className: "show-image", style: div_show_image, onMouseOver: () => { this.setState({ hover_input: true, hover_image: true }, () => { if (this.debugging)
137
+ _jsxs("label", { id: "upload-picture-label", className: `upload-picture-label ${this.props.buttonStyle}`, children: [this.props.Caption, _jsx("input", { className: "upload-picture-label-input", id: "nested-input", type: "file", accept: "image/*", onChange: this.onInputChange, multiple: true })] }), (this.props.data && this.props.data.length > 0) &&
138
+ _jsxs("div", { className: "show-image", onMouseOver: () => { this.setState({ hover_input: true, hover_image: true }, () => { if (this.debugging)
165
139
  console.log("onMouseOver"); }); }, onMouseLeave: () => { this.setState({ hover_input: false, hover_image: false }, () => { if (this.debugging)
166
- console.log("onMouseLeave"); }); }, children: [_jsx("img", { style: this.state.hover_image ? div_show_image_hover : div_show_image, src: (this.props.removebase64) ? "data:image/png;base64" : "" + this.props.data, className: this.props.pictureStyle }), !this.props.readOnly &&
167
- _jsx("input", { style: this.state.hover_input ? div_show_image_hover_input : div_show_image_input, className: "btn btn-primary delete", type: "button", value: "Effacer", onClick: this.resetUpload })] })] }));
140
+ console.log("onMouseLeave"); }); }, children: [_jsx("img", { className: `${this.state.hover_image ? "div-show-image-hover" : "div-show-image"} ${this.props.pictureStyle}`, src: (this.props.removebase64) ? "data:image/png;base64" : "" + this.props.data, alt: this.props.Caption || "uploaded image" }), !this.props.readOnly &&
141
+ _jsx("input", { className: `btn btn-primary delete ${this.state.hover_input ? "div-show-image-hover-input" : "div-show-image-input"}`, type: "button", value: "Effacer", onClick: this.resetUpload })] })] }));
168
142
  }
169
143
  }
@@ -1,4 +1,5 @@
1
1
  import { Component, ChangeEvent } from "react";
2
+ import "./DsBlob.css";
2
3
  interface DsBlobProps {
3
4
  width?: number;
4
5
  height?: number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "datasync-blob",
3
- "version": "1.1.4",
3
+ "version": "1.1.5",
4
4
  "description": "Datasync Blob component",
5
5
  "main": "./dist/DsBlob.js",
6
6
  "module": "./dist/DsBlob.js",