authscape 1.0.124 → 1.0.126

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/index.js CHANGED
@@ -201,9 +201,8 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
201
201
  Object.defineProperty(exports, "__esModule", {
202
202
  value: true
203
203
  });
204
- exports["default"] = FileUploader;
204
+ exports.FileUploader = void 0;
205
205
  var _react = _interopRequireWildcard(require("react"));
206
- var _authscape = require("authscape");
207
206
  var _LinearProgress = _interopRequireDefault(require("@mui/material/LinearProgress"));
208
207
  var _system = require("@mui/system");
209
208
  var _material = require("@mui/material");
@@ -235,7 +234,7 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
235
234
  function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
236
235
  function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
237
236
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
238
- function FileUploader(_ref) {
237
+ var FileUploader = function FileUploader(_ref) {
239
238
  var url = _ref.url,
240
239
  params = _ref.params,
241
240
  _ref$multiple = _ref.multiple,
@@ -326,7 +325,7 @@ function FileUploader(_ref) {
326
325
  }
327
326
  _context.prev = 17;
328
327
  _context.next = 20;
329
- return (0, _authscape.apiService)().post(url, data, {
328
+ return apiService().post(url, data, {
330
329
  onUploadProgress: function onUploadProgress(ProgressEvent) {
331
330
  var loadedTotal = Math.round(ProgressEvent.loaded / ProgressEvent.total * 100);
332
331
  var percent = fileIndex / fileCount * 100;
@@ -391,7 +390,7 @@ function FileUploader(_ref) {
391
390
  while (1) switch (_context2.prev = _context2.next) {
392
391
  case 0:
393
392
  _context2.next = 2;
394
- return (0, _authscape.apiService)().get(fileLoaderUri);
393
+ return apiService().get(fileLoaderUri);
395
394
  case 2:
396
395
  response = _context2.sent;
397
396
  if (response != null && response.status == 200) {
@@ -627,7 +626,8 @@ function FileUploader(_ref) {
627
626
  }, /*#__PURE__*/_react["default"].createElement(_CircularProgress["default"], {
628
627
  color: "inherit"
629
628
  })));
630
- }
629
+ };
630
+ exports.FileUploader = FileUploader;
631
631
  "use strict";
632
632
 
633
633
  function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "authscape",
3
- "version": "1.0.124",
3
+ "version": "1.0.126",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -1,5 +1,4 @@
1
1
  import React, { useState, useRef, useEffect } from "react";
2
- import { apiService } from "authscape";
3
2
  import LinearProgress from "@mui/material/LinearProgress";
4
3
  import { Box } from "@mui/system";
5
4
  import { Grid } from "@mui/material";
@@ -20,7 +19,8 @@ import Tooltip from '@mui/material/Tooltip';
20
19
  import Backdrop from '@mui/material/Backdrop';
21
20
  import CircularProgress from '@mui/material/CircularProgress';
22
21
 
23
- export default function FileUploader({
22
+
23
+ export const FileUploader = ({
24
24
  url,
25
25
  params,
26
26
  multiple = false,
@@ -30,7 +30,7 @@ export default function FileUploader({
30
30
  refOveride = null,
31
31
  primaryColor = "#000",
32
32
  onConfirmDelete = null
33
- }) {
33
+ }) => {
34
34
  // Declare a new state variable, which we'll call "count"
35
35
  const [message, setMessage] = useState("");
36
36
  const [loaded, setLoaded] = useState(0);
@@ -340,4 +340,4 @@ export default function FileUploader({
340
340
  </Backdrop>
341
341
  </Box>
342
342
  );
343
- }
343
+ }