@plusscommunities/pluss-core-web 1.6.2-beta.0 → 1.6.2
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/index.cjs.js +9 -7
- package/dist/index.esm.js +9 -7
- package/dist/index.umd.js +9 -7
- package/package.json +1 -1
- package/src/components/FileInput.js +14 -8
package/dist/index.cjs.js
CHANGED
|
@@ -5107,13 +5107,14 @@ var FileInputComponent = /*#__PURE__*/function (_Component) {
|
|
|
5107
5107
|
onDrop: function onDrop(files) {
|
|
5108
5108
|
return _this3.onDrop(files, true);
|
|
5109
5109
|
}
|
|
5110
|
-
}, function (
|
|
5111
|
-
var getRootProps =
|
|
5110
|
+
}, function (state) {
|
|
5111
|
+
var getRootProps = state.getRootProps,
|
|
5112
|
+
getInputProps = state.getInputProps;
|
|
5112
5113
|
return /*#__PURE__*/React__default['default'].createElement("div", _extends__default['default']({
|
|
5113
5114
|
style: {
|
|
5114
5115
|
padding: 10
|
|
5115
5116
|
}
|
|
5116
|
-
}, getRootProps()), /*#__PURE__*/React__default['default'].createElement(Button, {
|
|
5117
|
+
}, getRootProps()), /*#__PURE__*/React__default['default'].createElement("input", getInputProps()), /*#__PURE__*/React__default['default'].createElement(Button, {
|
|
5117
5118
|
buttonType: "secondary",
|
|
5118
5119
|
className: "imageInput_button",
|
|
5119
5120
|
disabled: true
|
|
@@ -5158,13 +5159,14 @@ var FileInputComponent = /*#__PURE__*/function (_Component) {
|
|
|
5158
5159
|
}, /*#__PURE__*/React__default['default'].createElement(Dropzone__default['default'], {
|
|
5159
5160
|
accept: this.getAccept(),
|
|
5160
5161
|
onDrop: this.onDrop
|
|
5161
|
-
}, function (
|
|
5162
|
-
var getRootProps =
|
|
5163
|
-
|
|
5162
|
+
}, function (state) {
|
|
5163
|
+
var getRootProps = state.getRootProps,
|
|
5164
|
+
getInputProps = state.getInputProps,
|
|
5165
|
+
isDragActive = state.isDragActive;
|
|
5164
5166
|
return /*#__PURE__*/React__default['default'].createElement("div", _extends__default['default']({
|
|
5165
5167
|
className: "imageInput_upload ".concat(_this3.getErrorState()),
|
|
5166
5168
|
style: _objectSpread$f({}, _this3.props.style)
|
|
5167
|
-
}, getRootProps()), /*#__PURE__*/React__default['default'].createElement("div", {
|
|
5169
|
+
}, getRootProps()), /*#__PURE__*/React__default['default'].createElement("input", getInputProps()), /*#__PURE__*/React__default['default'].createElement("div", {
|
|
5168
5170
|
className: "".concat(isDragActive ? 'imageInput_dropZoneActive' : '')
|
|
5169
5171
|
}, !_this3.props.simpleStyle && /*#__PURE__*/React__default['default'].createElement("img", {
|
|
5170
5172
|
src: "https://s3-ap-southeast-2.amazonaws.com/pluss60-dev-media/pluss/document.svg",
|
package/dist/index.esm.js
CHANGED
|
@@ -5077,13 +5077,14 @@ var FileInputComponent = /*#__PURE__*/function (_Component) {
|
|
|
5077
5077
|
onDrop: function onDrop(files) {
|
|
5078
5078
|
return _this3.onDrop(files, true);
|
|
5079
5079
|
}
|
|
5080
|
-
}, function (
|
|
5081
|
-
var getRootProps =
|
|
5080
|
+
}, function (state) {
|
|
5081
|
+
var getRootProps = state.getRootProps,
|
|
5082
|
+
getInputProps = state.getInputProps;
|
|
5082
5083
|
return /*#__PURE__*/React.createElement("div", _extends({
|
|
5083
5084
|
style: {
|
|
5084
5085
|
padding: 10
|
|
5085
5086
|
}
|
|
5086
|
-
}, getRootProps()), /*#__PURE__*/React.createElement(Button, {
|
|
5087
|
+
}, getRootProps()), /*#__PURE__*/React.createElement("input", getInputProps()), /*#__PURE__*/React.createElement(Button, {
|
|
5087
5088
|
buttonType: "secondary",
|
|
5088
5089
|
className: "imageInput_button",
|
|
5089
5090
|
disabled: true
|
|
@@ -5128,13 +5129,14 @@ var FileInputComponent = /*#__PURE__*/function (_Component) {
|
|
|
5128
5129
|
}, /*#__PURE__*/React.createElement(Dropzone, {
|
|
5129
5130
|
accept: this.getAccept(),
|
|
5130
5131
|
onDrop: this.onDrop
|
|
5131
|
-
}, function (
|
|
5132
|
-
var getRootProps =
|
|
5133
|
-
|
|
5132
|
+
}, function (state) {
|
|
5133
|
+
var getRootProps = state.getRootProps,
|
|
5134
|
+
getInputProps = state.getInputProps,
|
|
5135
|
+
isDragActive = state.isDragActive;
|
|
5134
5136
|
return /*#__PURE__*/React.createElement("div", _extends({
|
|
5135
5137
|
className: "imageInput_upload ".concat(_this3.getErrorState()),
|
|
5136
5138
|
style: _objectSpread$f({}, _this3.props.style)
|
|
5137
|
-
}, getRootProps()), /*#__PURE__*/React.createElement("div", {
|
|
5139
|
+
}, getRootProps()), /*#__PURE__*/React.createElement("input", getInputProps()), /*#__PURE__*/React.createElement("div", {
|
|
5138
5140
|
className: "".concat(isDragActive ? 'imageInput_dropZoneActive' : '')
|
|
5139
5141
|
}, !_this3.props.simpleStyle && /*#__PURE__*/React.createElement("img", {
|
|
5140
5142
|
src: "https://s3-ap-southeast-2.amazonaws.com/pluss60-dev-media/pluss/document.svg",
|
package/dist/index.umd.js
CHANGED
|
@@ -5075,13 +5075,14 @@
|
|
|
5075
5075
|
onDrop: function onDrop(files) {
|
|
5076
5076
|
return _this3.onDrop(files, true);
|
|
5077
5077
|
}
|
|
5078
|
-
}, function (
|
|
5079
|
-
var getRootProps =
|
|
5078
|
+
}, function (state) {
|
|
5079
|
+
var getRootProps = state.getRootProps,
|
|
5080
|
+
getInputProps = state.getInputProps;
|
|
5080
5081
|
return /*#__PURE__*/React__default['default'].createElement("div", _extends__default['default']({
|
|
5081
5082
|
style: {
|
|
5082
5083
|
padding: 10
|
|
5083
5084
|
}
|
|
5084
|
-
}, getRootProps()), /*#__PURE__*/React__default['default'].createElement(Button, {
|
|
5085
|
+
}, getRootProps()), /*#__PURE__*/React__default['default'].createElement("input", getInputProps()), /*#__PURE__*/React__default['default'].createElement(Button, {
|
|
5085
5086
|
buttonType: "secondary",
|
|
5086
5087
|
className: "imageInput_button",
|
|
5087
5088
|
disabled: true
|
|
@@ -5126,13 +5127,14 @@
|
|
|
5126
5127
|
}, /*#__PURE__*/React__default['default'].createElement(Dropzone__default['default'], {
|
|
5127
5128
|
accept: this.getAccept(),
|
|
5128
5129
|
onDrop: this.onDrop
|
|
5129
|
-
}, function (
|
|
5130
|
-
var getRootProps =
|
|
5131
|
-
|
|
5130
|
+
}, function (state) {
|
|
5131
|
+
var getRootProps = state.getRootProps,
|
|
5132
|
+
getInputProps = state.getInputProps,
|
|
5133
|
+
isDragActive = state.isDragActive;
|
|
5132
5134
|
return /*#__PURE__*/React__default['default'].createElement("div", _extends__default['default']({
|
|
5133
5135
|
className: "imageInput_upload ".concat(_this3.getErrorState()),
|
|
5134
5136
|
style: _objectSpread$f({}, _this3.props.style)
|
|
5135
|
-
}, getRootProps()), /*#__PURE__*/React__default['default'].createElement("div", {
|
|
5137
|
+
}, getRootProps()), /*#__PURE__*/React__default['default'].createElement("input", getInputProps()), /*#__PURE__*/React__default['default'].createElement("div", {
|
|
5136
5138
|
className: "".concat(isDragActive ? 'imageInput_dropZoneActive' : '')
|
|
5137
5139
|
}, !_this3.props.simpleStyle && /*#__PURE__*/React__default['default'].createElement("img", {
|
|
5138
5140
|
src: "https://s3-ap-southeast-2.amazonaws.com/pluss60-dev-media/pluss/document.svg",
|
package/package.json
CHANGED
|
@@ -225,13 +225,17 @@ class FileInputComponent extends Component {
|
|
|
225
225
|
<p className="imageInput_text">{getFileName(input.value)}</p>
|
|
226
226
|
</div>
|
|
227
227
|
<Dropzone accept={this.getAccept()} onDrop={(files) => this.onDrop(files, true)}>
|
|
228
|
-
{(
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
228
|
+
{(state) => {
|
|
229
|
+
const { getRootProps, getInputProps } = state;
|
|
230
|
+
return (
|
|
231
|
+
<div style={{ padding: 10 }} {...getRootProps()}>
|
|
232
|
+
<input {...getInputProps()} />
|
|
233
|
+
<Button buttonType="secondary" className="imageInput_button" disabled>
|
|
234
|
+
Change file
|
|
235
|
+
</Button>
|
|
236
|
+
</div>
|
|
237
|
+
);
|
|
238
|
+
}}
|
|
235
239
|
</Dropzone>
|
|
236
240
|
</div>
|
|
237
241
|
);
|
|
@@ -269,9 +273,11 @@ class FileInputComponent extends Component {
|
|
|
269
273
|
return (
|
|
270
274
|
<div key={index} className={this.getClassNames(input, inputsLength)} style={{ ...this.props.style }}>
|
|
271
275
|
<Dropzone accept={this.getAccept()} onDrop={this.onDrop}>
|
|
272
|
-
{(
|
|
276
|
+
{(state) => {
|
|
277
|
+
const { getRootProps, getInputProps, isDragActive } = state;
|
|
273
278
|
return (
|
|
274
279
|
<div className={`imageInput_upload ${this.getErrorState()}`} style={{ ...this.props.style }} {...getRootProps()}>
|
|
280
|
+
<input {...getInputProps()} />
|
|
275
281
|
<div className={`${isDragActive ? 'imageInput_dropZoneActive' : ''}`}>
|
|
276
282
|
{!this.props.simpleStyle && (
|
|
277
283
|
<img
|