authscape 1.0.582 → 1.0.586
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 +104 -1
- package/package.json +1 -1
- package/src/components/AuthScapeApp.js +16 -1
- package/src/components/dropzone.js +89 -0
package/index.js
CHANGED
|
@@ -364,6 +364,17 @@ function AuthScapeApp(_ref) {
|
|
|
364
364
|
}
|
|
365
365
|
}
|
|
366
366
|
};
|
|
367
|
+
_signedInUser.hasRoleId = function (id) {
|
|
368
|
+
if (_signedInUser.roles != null) {
|
|
369
|
+
if (_signedInUser.roles.find(function (r) {
|
|
370
|
+
return r.id === id;
|
|
371
|
+
}) != null) {
|
|
372
|
+
return true;
|
|
373
|
+
} else {
|
|
374
|
+
return false;
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
};
|
|
367
378
|
_signedInUser.hasPermission = function (name) {
|
|
368
379
|
if (_signedInUser.permissions != null) {
|
|
369
380
|
if (_signedInUser.permissions.find(function (r) {
|
|
@@ -429,7 +440,7 @@ function AuthScapeApp(_ref) {
|
|
|
429
440
|
setSuccessToastMessage: setSuccessToastMessage,
|
|
430
441
|
setWarnToastMessage: setWarnToastMessage,
|
|
431
442
|
setErrorToastMessage: setErrorToastMessage
|
|
432
|
-
}))), /*#__PURE__*/_react["default"].createElement(_reactToastify.ToastContainer, null)), loadingLayout && /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, loadingLayout(isLoadingShow)),
|
|
443
|
+
}))), /*#__PURE__*/_react["default"].createElement(_reactToastify.ToastContainer, null)), loadingLayout && /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, loadingLayout(isLoadingShow)), frontEndLoadedState && process.env.microsoftClarityTrackingCode != null && /*#__PURE__*/_react["default"].createElement("script", {
|
|
433
444
|
dangerouslySetInnerHTML: {
|
|
434
445
|
__html: "\n (function(c,l,a,r,i,t,y){\n c[a] = c[a] || function () { (c[a].q = c[a].q || []).push(arguments) };\n t=l.createElement(r);\n t.async=1;\n t.src=\"https://www.clarity.ms/tag/\"+i;\n y=l.getElementsByTagName(r)[0];\n y.parentNode.insertBefore(t,y);\n })(window, document, \"clarity\", \"script\", \"" + process.env.microsoftClarityTrackingCode + "\");"
|
|
435
446
|
}
|
|
@@ -1484,6 +1495,98 @@ var DocumentManager = function DocumentManager(_ref) {
|
|
|
1484
1495
|
exports.DocumentManager = DocumentManager;
|
|
1485
1496
|
"use strict";
|
|
1486
1497
|
|
|
1498
|
+
Object.defineProperty(exports, "__esModule", {
|
|
1499
|
+
value: true
|
|
1500
|
+
});
|
|
1501
|
+
exports.Dropzone = void 0;
|
|
1502
|
+
var _material = require("@mui/material");
|
|
1503
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
1504
|
+
var _reactDropzone = require("react-dropzone");
|
|
1505
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
1506
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
1507
|
+
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); }
|
|
1508
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
1509
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
1510
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
1511
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
1512
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
1513
|
+
var baseStyle = {
|
|
1514
|
+
flex: 1,
|
|
1515
|
+
display: 'flex',
|
|
1516
|
+
flexDirection: 'column',
|
|
1517
|
+
alignItems: 'center',
|
|
1518
|
+
padding: '20px',
|
|
1519
|
+
paddingTop: "50px",
|
|
1520
|
+
paddingBottom: "50px",
|
|
1521
|
+
borderWidth: 2,
|
|
1522
|
+
borderRadius: 2,
|
|
1523
|
+
borderColor: '#eeeeee',
|
|
1524
|
+
borderStyle: 'dashed',
|
|
1525
|
+
backgroundColor: '#fafafa',
|
|
1526
|
+
color: '#bdbdbd',
|
|
1527
|
+
outline: 'none',
|
|
1528
|
+
transition: 'border .24s ease-in-out'
|
|
1529
|
+
};
|
|
1530
|
+
var focusedStyle = {
|
|
1531
|
+
borderColor: '#2196f3'
|
|
1532
|
+
};
|
|
1533
|
+
var acceptStyle = {
|
|
1534
|
+
borderColor: '#00e676'
|
|
1535
|
+
};
|
|
1536
|
+
var rejectStyle = {
|
|
1537
|
+
borderColor: '#ff1744'
|
|
1538
|
+
};
|
|
1539
|
+
var Dropzone = function Dropzone(_ref) {
|
|
1540
|
+
var _ref$text = _ref.text,
|
|
1541
|
+
text = _ref$text === void 0 ? "Drag 'n' drop some files here, or click to select files" : _ref$text,
|
|
1542
|
+
_ref$styleOverride = _ref.styleOverride,
|
|
1543
|
+
styleOverride = _ref$styleOverride === void 0 ? null : _ref$styleOverride,
|
|
1544
|
+
_ref$onDrop = _ref.onDrop,
|
|
1545
|
+
_onDrop = _ref$onDrop === void 0 ? null : _ref$onDrop,
|
|
1546
|
+
_ref$maxFiles = _ref.maxFiles,
|
|
1547
|
+
maxFiles = _ref$maxFiles === void 0 ? 1 : _ref$maxFiles,
|
|
1548
|
+
_ref$multiple = _ref.multiple,
|
|
1549
|
+
multiple = _ref$multiple === void 0 ? false : _ref$multiple,
|
|
1550
|
+
_ref$accept = _ref.accept,
|
|
1551
|
+
accept = _ref$accept === void 0 ? {
|
|
1552
|
+
'image/*': []
|
|
1553
|
+
} : _ref$accept;
|
|
1554
|
+
if (styleOverride != null) {
|
|
1555
|
+
var combined = _objectSpread(_objectSpread({}, baseStyle), styleOverride);
|
|
1556
|
+
baseStyle = combined;
|
|
1557
|
+
}
|
|
1558
|
+
var _useDropzone = (0, _reactDropzone.useDropzone)({
|
|
1559
|
+
accept: accept,
|
|
1560
|
+
maxFiles: maxFiles,
|
|
1561
|
+
multiple: multiple,
|
|
1562
|
+
onDrop: function onDrop(files) {
|
|
1563
|
+
if (multiple) {
|
|
1564
|
+
_onDrop(files);
|
|
1565
|
+
} else {
|
|
1566
|
+
_onDrop(files[0]);
|
|
1567
|
+
}
|
|
1568
|
+
}
|
|
1569
|
+
}),
|
|
1570
|
+
getRootProps = _useDropzone.getRootProps,
|
|
1571
|
+
getInputProps = _useDropzone.getInputProps,
|
|
1572
|
+
isFocused = _useDropzone.isFocused,
|
|
1573
|
+
isDragAccept = _useDropzone.isDragAccept,
|
|
1574
|
+
isDragReject = _useDropzone.isDragReject;
|
|
1575
|
+
var style = (0, _react.useMemo)(function () {
|
|
1576
|
+
return _objectSpread(_objectSpread(_objectSpread(_objectSpread({}, baseStyle), isFocused ? focusedStyle : {}), isDragAccept ? acceptStyle : {}), isDragReject ? rejectStyle : {});
|
|
1577
|
+
}, [isFocused, isDragAccept, isDragReject]);
|
|
1578
|
+
return /*#__PURE__*/_react["default"].createElement(_material.Box, {
|
|
1579
|
+
className: "container",
|
|
1580
|
+
sx: {
|
|
1581
|
+
cursor: "pointer"
|
|
1582
|
+
}
|
|
1583
|
+
}, /*#__PURE__*/_react["default"].createElement(_material.Box, getRootProps({
|
|
1584
|
+
style: style
|
|
1585
|
+
}), /*#__PURE__*/_react["default"].createElement("input", getInputProps()), /*#__PURE__*/_react["default"].createElement(_material.Box, null, text)));
|
|
1586
|
+
};
|
|
1587
|
+
exports.Dropzone = Dropzone;
|
|
1588
|
+
"use strict";
|
|
1589
|
+
|
|
1487
1590
|
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); }
|
|
1488
1591
|
Object.defineProperty(exports, "__esModule", {
|
|
1489
1592
|
value: true
|
package/package.json
CHANGED
|
@@ -358,6 +358,21 @@ export function AuthScapeApp ({Component, layout, loadingLayout, pageProps, muiT
|
|
|
358
358
|
}
|
|
359
359
|
};
|
|
360
360
|
|
|
361
|
+
_signedInUser.hasRoleId = function(id) {
|
|
362
|
+
|
|
363
|
+
if (_signedInUser.roles != null)
|
|
364
|
+
{
|
|
365
|
+
if (_signedInUser.roles.find(r => r.id === id) != null)
|
|
366
|
+
{
|
|
367
|
+
return true;
|
|
368
|
+
}
|
|
369
|
+
else
|
|
370
|
+
{
|
|
371
|
+
return false;
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
};
|
|
375
|
+
|
|
361
376
|
_signedInUser.hasPermission = function(name) {
|
|
362
377
|
|
|
363
378
|
if (_signedInUser.permissions != null)
|
|
@@ -430,7 +445,7 @@ export function AuthScapeApp ({Component, layout, loadingLayout, pageProps, muiT
|
|
|
430
445
|
</>
|
|
431
446
|
}
|
|
432
447
|
|
|
433
|
-
{(
|
|
448
|
+
{(frontEndLoadedState && process.env.microsoftClarityTrackingCode != null) &&
|
|
434
449
|
<script
|
|
435
450
|
dangerouslySetInnerHTML={{
|
|
436
451
|
__html: `
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { Box } from '@mui/material';
|
|
2
|
+
import React, {useMemo} from 'react';
|
|
3
|
+
import {useDropzone} from 'react-dropzone';
|
|
4
|
+
|
|
5
|
+
let baseStyle = {
|
|
6
|
+
flex: 1,
|
|
7
|
+
display: 'flex',
|
|
8
|
+
flexDirection: 'column',
|
|
9
|
+
alignItems: 'center',
|
|
10
|
+
padding: '20px',
|
|
11
|
+
paddingTop: "50px",
|
|
12
|
+
paddingBottom: "50px",
|
|
13
|
+
borderWidth: 2,
|
|
14
|
+
borderRadius: 2,
|
|
15
|
+
borderColor: '#eeeeee',
|
|
16
|
+
borderStyle: 'dashed',
|
|
17
|
+
backgroundColor: '#fafafa',
|
|
18
|
+
color: '#bdbdbd',
|
|
19
|
+
outline: 'none',
|
|
20
|
+
transition: 'border .24s ease-in-out'
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
const focusedStyle = {
|
|
24
|
+
borderColor: '#2196f3'
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
const acceptStyle = {
|
|
28
|
+
borderColor: '#00e676'
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
const rejectStyle = {
|
|
32
|
+
borderColor: '#ff1744'
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
export const Dropzone = ({text = "Drag 'n' drop some files here, or click to select files", styleOverride = null, onDrop = null, maxFiles = 1, multiple = false, accept = {
|
|
36
|
+
'image/*': []
|
|
37
|
+
}}) => {
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
if (styleOverride != null)
|
|
41
|
+
{
|
|
42
|
+
let combined = { ...baseStyle, ...styleOverride }
|
|
43
|
+
baseStyle = combined;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
const {
|
|
47
|
+
getRootProps,
|
|
48
|
+
getInputProps,
|
|
49
|
+
isFocused,
|
|
50
|
+
isDragAccept,
|
|
51
|
+
isDragReject
|
|
52
|
+
} = useDropzone({
|
|
53
|
+
accept: accept,
|
|
54
|
+
maxFiles: maxFiles,
|
|
55
|
+
multiple: multiple,
|
|
56
|
+
onDrop: files => {
|
|
57
|
+
|
|
58
|
+
if (multiple)
|
|
59
|
+
{
|
|
60
|
+
onDrop(files);
|
|
61
|
+
}
|
|
62
|
+
else
|
|
63
|
+
{
|
|
64
|
+
onDrop(files[0]);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
const style = useMemo(() => ({
|
|
71
|
+
...baseStyle,
|
|
72
|
+
...(isFocused ? focusedStyle : {}),
|
|
73
|
+
...(isDragAccept ? acceptStyle : {}),
|
|
74
|
+
...(isDragReject ? rejectStyle : {})
|
|
75
|
+
}), [
|
|
76
|
+
isFocused,
|
|
77
|
+
isDragAccept,
|
|
78
|
+
isDragReject
|
|
79
|
+
]);
|
|
80
|
+
|
|
81
|
+
return (
|
|
82
|
+
<Box className="container" sx={{cursor:"pointer"}}>
|
|
83
|
+
<Box {...getRootProps({style})}>
|
|
84
|
+
<input {...getInputProps()} />
|
|
85
|
+
<Box>{text}</Box>
|
|
86
|
+
</Box>
|
|
87
|
+
</Box>
|
|
88
|
+
);
|
|
89
|
+
}
|