@fixefy/fixefy-ui-components 0.3.108 → 0.3.110
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/FxAsyncDropdown/FxAsyncDropdown.js +3 -3
- package/dist/FxDatesProgress/styles/progress.styles.js +1 -1
- package/dist/FxUserImage/FxUserImage.js +2 -2
- package/dist/fixefy-ui-components/src/FxActionsTray/FxActionsTray.js +111 -0
- package/dist/fixefy-ui-components/src/FxActionsTray/index.js +11 -0
- package/dist/fixefy-ui-components/src/FxActionsTray/styles/actionsTray.style.js +114 -0
- package/dist/fixefy-ui-components/src/FxAggregationsBar/FxAggregations.js +41 -0
- package/dist/fixefy-ui-components/src/FxAggregationsBar/helpers/structureReader.js +80 -0
- package/dist/fixefy-ui-components/src/FxAggregationsBar/index.js +22 -0
- package/dist/fixefy-ui-components/src/FxAggregationsBar/operations/query.js +73 -0
- package/dist/fixefy-ui-components/src/FxAsyncDropdown/FxAsyncDropdown.js +500 -0
- package/dist/fixefy-ui-components/src/FxAsyncDropdown/components/CheckboxIcon.js +44 -0
- package/dist/fixefy-ui-components/src/FxAsyncDropdown/components/ChipOption.js +35 -0
- package/dist/fixefy-ui-components/src/FxAsyncDropdown/components/ChosenIcon.js +45 -0
- package/dist/fixefy-ui-components/src/FxAsyncDropdown/components/DeleteButton.js +37 -0
- package/dist/fixefy-ui-components/src/FxAsyncDropdown/components/LogoOption.js +101 -0
- package/dist/fixefy-ui-components/src/FxAsyncDropdown/components/TextOption.js +74 -0
- package/dist/fixefy-ui-components/src/FxAsyncDropdown/components/index.js +36 -0
- package/dist/fixefy-ui-components/src/FxAsyncDropdown/helpers/helpers.js +233 -0
- package/dist/fixefy-ui-components/src/FxAsyncDropdown/index.js +11 -0
- package/dist/fixefy-ui-components/src/FxAsyncDropdown/styles/dropdown.styles.js +211 -0
- package/dist/fixefy-ui-components/src/FxAsyncDropdown/types.js +4 -0
- package/dist/fixefy-ui-components/src/FxAvatar/FxAvatar.js +145 -0
- package/dist/fixefy-ui-components/src/FxAvatar/helpers/stringToColor.js +23 -0
- package/dist/fixefy-ui-components/src/FxAvatar/index.js +22 -0
- package/dist/fixefy-ui-components/src/FxAvatar/styles/avatar.styles.js +233 -0
- package/dist/fixefy-ui-components/src/FxButton/FxButton.js +106 -0
- package/dist/fixefy-ui-components/src/FxButton/index.js +19 -0
- package/dist/fixefy-ui-components/src/FxButton/styles/button.styles.js +28 -0
- package/dist/fixefy-ui-components/src/FxButtonModalWithComponent/FxButtonModalWithComponent.js +118 -0
- package/dist/fixefy-ui-components/src/FxButtonModalWithComponent/index.js +11 -0
- package/dist/fixefy-ui-components/src/FxButtonModalWithMenu/FxButtonModalWithMenu.js +126 -0
- package/dist/fixefy-ui-components/src/FxButtonModalWithMenu/index.js +11 -0
- package/dist/fixefy-ui-components/src/FxChip/FxChip.js +75 -0
- package/dist/fixefy-ui-components/src/FxChip/index.js +19 -0
- package/dist/fixefy-ui-components/src/FxChip/styles/chip.styles.js +147 -0
- package/dist/fixefy-ui-components/src/FxDatesProgress/FxDatesProgress.js +126 -0
- package/dist/fixefy-ui-components/src/FxDatesProgress/index.js +11 -0
- package/dist/fixefy-ui-components/src/FxDatesProgress/styles/progress.styles.js +24 -0
- package/dist/fixefy-ui-components/src/FxGeneralModal/FxGeneralModal.js +107 -0
- package/dist/fixefy-ui-components/src/FxGeneralModal/index.js +11 -0
- package/dist/fixefy-ui-components/src/FxGridEmptyState/FxGridEmptyState.js +86 -0
- package/dist/fixefy-ui-components/src/FxGridEmptyState/index.js +11 -0
- package/dist/fixefy-ui-components/src/FxGridError/FxGridError.js +91 -0
- package/dist/fixefy-ui-components/src/FxGridError/index.js +11 -0
- package/dist/fixefy-ui-components/src/FxIcon/FxIcon.js +118 -0
- package/dist/fixefy-ui-components/src/FxIcon/content/dynamic_icon.js +20 -0
- package/dist/fixefy-ui-components/src/FxIcon/content/index.js +20 -0
- package/dist/fixefy-ui-components/src/FxIcon/content/lazy_icon.js +87 -0
- package/dist/fixefy-ui-components/src/FxIcon/index.js +11 -0
- package/dist/fixefy-ui-components/src/FxMenuItemWithIcon/FxMenuItemWithIcon.js +84 -0
- package/dist/fixefy-ui-components/src/FxMenuItemWithIcon/index.js +11 -0
- package/dist/fixefy-ui-components/src/FxModal/FxModal.js +171 -0
- package/dist/fixefy-ui-components/src/FxModal/index.js +19 -0
- package/dist/fixefy-ui-components/src/FxModal/styles/modal.style.js +66 -0
- package/dist/fixefy-ui-components/src/FxNotes/FxNotes.js +216 -0
- package/dist/fixefy-ui-components/src/FxNotes/helpers/stringToColor.js +26 -0
- package/dist/fixefy-ui-components/src/FxNotes/index.js +22 -0
- package/dist/fixefy-ui-components/src/FxNotes/operations/queries.js +35 -0
- package/dist/fixefy-ui-components/src/FxNotes/styles/notes.styles.js +168 -0
- package/dist/fixefy-ui-components/src/FxNumberField/FxNumberField.js +108 -0
- package/dist/fixefy-ui-components/src/FxNumberField/index.js +19 -0
- package/dist/fixefy-ui-components/src/FxNumberField/styles/number_field.styles.js +99 -0
- package/dist/fixefy-ui-components/src/FxObjStaticDropdown/FxObjStaticDropdown.js +548 -0
- package/dist/fixefy-ui-components/src/FxObjStaticDropdown/index.js +25 -0
- package/dist/fixefy-ui-components/src/FxObjStaticDropdown/styles/dropdown.styles.js +211 -0
- package/dist/fixefy-ui-components/src/FxPopper/Popper.js +139 -0
- package/dist/fixefy-ui-components/src/FxPopper/PopperWithOutside.js +116 -0
- package/dist/fixefy-ui-components/src/FxPopper/content/PopperHeader.js +36 -0
- package/dist/fixefy-ui-components/src/FxPopper/content/index.js +11 -0
- package/dist/fixefy-ui-components/src/FxPopper/index.js +24 -0
- package/dist/fixefy-ui-components/src/FxPopper/styles/popper.styles.js +138 -0
- package/dist/fixefy-ui-components/src/FxProgressCircle/FxProgressCircle.js +65 -0
- package/dist/fixefy-ui-components/src/FxProgressCircle/index.js +19 -0
- package/dist/fixefy-ui-components/src/FxProgressCircle/styles/progress_circle.styles.js +106 -0
- package/dist/fixefy-ui-components/src/FxProgressCounter/ProgressCounter.js +168 -0
- package/dist/fixefy-ui-components/src/FxProgressCounter/index.js +19 -0
- package/dist/fixefy-ui-components/src/FxProgressCounter/styles/progress_counter.styles.js +66 -0
- package/dist/fixefy-ui-components/src/FxScore/FxScore.js +215 -0
- package/dist/fixefy-ui-components/src/FxScore/index.js +19 -0
- package/dist/fixefy-ui-components/src/FxScore/styles/score.styles.js +102 -0
- package/dist/fixefy-ui-components/src/FxShowMore/FxShowMore.js +80 -0
- package/dist/fixefy-ui-components/src/FxShowMore/index.js +19 -0
- package/dist/fixefy-ui-components/src/FxShowMore/styles/show_more.styles.js +143 -0
- package/dist/fixefy-ui-components/src/FxSlider/FxSlider.js +49 -0
- package/dist/fixefy-ui-components/src/FxSlider/index.js +19 -0
- package/dist/fixefy-ui-components/src/FxStatisticsBar/FxStatisticsBar.js +198 -0
- package/dist/fixefy-ui-components/src/FxStatisticsBar/index.js +19 -0
- package/dist/fixefy-ui-components/src/FxStatisticsBar/styles/statistics.styles.js +103 -0
- package/dist/fixefy-ui-components/src/FxStatusBar/FxStatusBar.js +149 -0
- package/dist/fixefy-ui-components/src/FxStatusBar/helpers/constants.js +22 -0
- package/dist/fixefy-ui-components/src/FxStatusBar/index.js +22 -0
- package/dist/fixefy-ui-components/src/FxStatusBar/styles/statusBar.styles.js +138 -0
- package/dist/fixefy-ui-components/src/FxStrStaticDropdown/FxStrStaticDropdown.js +382 -0
- package/dist/fixefy-ui-components/src/FxStrStaticDropdown/helpers/helpers.js +22 -0
- package/dist/fixefy-ui-components/src/FxStrStaticDropdown/index.js +11 -0
- package/dist/fixefy-ui-components/src/FxStrStaticDropdown/styles/dropdown.styles.js +190 -0
- package/dist/fixefy-ui-components/src/FxStyledButton/FxStyledButton.js +57 -0
- package/dist/fixefy-ui-components/src/FxStyledButton/index.js +11 -0
- package/dist/fixefy-ui-components/src/FxStyledComponents/index.js +319 -0
- package/dist/fixefy-ui-components/src/FxSwitch/FxSwitch.js +106 -0
- package/dist/fixefy-ui-components/src/FxSwitch/index.js +19 -0
- package/dist/fixefy-ui-components/src/FxSwitch/styles/switch.styles.js +42 -0
- package/dist/fixefy-ui-components/src/FxTabs/FxTabs.js +79 -0
- package/dist/fixefy-ui-components/src/FxTabs/index.js +11 -0
- package/dist/fixefy-ui-components/src/FxTag/FxTag.js +50 -0
- package/dist/fixefy-ui-components/src/FxTag/index.js +19 -0
- package/dist/fixefy-ui-components/src/FxTag/styles/tag.styles.js +106 -0
- package/dist/fixefy-ui-components/src/FxTextField/FxTextField.js +211 -0
- package/dist/fixefy-ui-components/src/FxTextField/index.js +19 -0
- package/dist/fixefy-ui-components/src/FxTodo/FxTodo.js +95 -0
- package/dist/fixefy-ui-components/src/FxTodo/index.js +22 -0
- package/dist/fixefy-ui-components/src/FxTodo/styles/todo.styles.js +183 -0
- package/dist/fixefy-ui-components/src/FxToggleButtons/FxToggleButtons.js +69 -0
- package/dist/fixefy-ui-components/src/FxToggleButtons/index.js +11 -0
- package/dist/fixefy-ui-components/src/FxUserImage/FxUserImage.js +236 -0
- package/dist/fixefy-ui-components/src/FxUserImage/index.js +11 -0
- package/dist/fixefy-ui-components/src/FxWizard/FxWizard.js +50 -0
- package/dist/fixefy-ui-components/src/FxWizard/index.js +19 -0
- package/dist/fixefy-ui-components/src/FxWizard/steps launcher/StepsLauncher.js +52 -0
- package/dist/fixefy-ui-components/src/FxWizard/steps launcher/index.js +18 -0
- package/dist/fixefy-ui-components/src/index.js +277 -0
- package/package.json +4 -5
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "FxToggleButtons", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
8
|
+
return FxToggleButtons;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
const _jsxruntime = require("react/jsx-runtime");
|
|
12
|
+
const _react = /*#__PURE__*/ _interop_require_default(require("react"));
|
|
13
|
+
const _Typography = /*#__PURE__*/ _interop_require_default(require("@mui/material/Typography"));
|
|
14
|
+
const _ToggleButtonGroup = /*#__PURE__*/ _interop_require_default(require("@mui/material/ToggleButtonGroup"));
|
|
15
|
+
const _ToggleButton = /*#__PURE__*/ _interop_require_default(require("@mui/material/ToggleButton"));
|
|
16
|
+
function _interop_require_default(obj) {
|
|
17
|
+
return obj && obj.__esModule ? obj : {
|
|
18
|
+
default: obj
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
const FxToggleButtons = ({ activeTab, tabsData, onChange, darkMode })=>{
|
|
22
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_ToggleButtonGroup.default, {
|
|
23
|
+
sx: {
|
|
24
|
+
height: '40px',
|
|
25
|
+
backgroundColor: darkMode ? '#323232' : '#fff'
|
|
26
|
+
},
|
|
27
|
+
color: "primary",
|
|
28
|
+
value: activeTab,
|
|
29
|
+
exclusive: true,
|
|
30
|
+
onChange: (e, val)=>{
|
|
31
|
+
e.preventDefault();
|
|
32
|
+
setTimeout(()=>{
|
|
33
|
+
onChange(val);
|
|
34
|
+
}, 500);
|
|
35
|
+
},
|
|
36
|
+
children: tabsData.map((tab, i)=>{
|
|
37
|
+
const { value, show, label, maxWidth, minWidth } = tab;
|
|
38
|
+
return show && /*#__PURE__*/ (0, _jsxruntime.jsx)(_ToggleButton.default, {
|
|
39
|
+
disabled: activeTab === value,
|
|
40
|
+
sx: {
|
|
41
|
+
'&.Mui-disabled': {
|
|
42
|
+
border: '1px solid #568793 !important'
|
|
43
|
+
},
|
|
44
|
+
'&.MuiToggleButtonGroup-grouped': {
|
|
45
|
+
borderRadius: 'inherit',
|
|
46
|
+
maxWidth: maxWidth || '161px',
|
|
47
|
+
minWidth: minWidth || '161px'
|
|
48
|
+
},
|
|
49
|
+
'&.Mui-selected': {
|
|
50
|
+
backgroundColor: darkMode ? '#568793' : '#F1FBFE',
|
|
51
|
+
border: '1px solid #568793'
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
value: value,
|
|
55
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_Typography.default, {
|
|
56
|
+
sx: {
|
|
57
|
+
textTransform: 'none'
|
|
58
|
+
},
|
|
59
|
+
lineHeight: '24px',
|
|
60
|
+
fontSize: '12px',
|
|
61
|
+
fontWeight: 500,
|
|
62
|
+
color: darkMode ? '#fff' : '#000',
|
|
63
|
+
variant: "button",
|
|
64
|
+
children: label
|
|
65
|
+
})
|
|
66
|
+
}, i);
|
|
67
|
+
})
|
|
68
|
+
});
|
|
69
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "FxToggleButtons", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
8
|
+
return _FxToggleButtons.FxToggleButtons;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
const _FxToggleButtons = require("./FxToggleButtons");
|
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "FxUserImage", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
8
|
+
return FxUserImage;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
const _jsxruntime = require("react/jsx-runtime");
|
|
12
|
+
const _react = /*#__PURE__*/ _interop_require_wildcard(require("react"));
|
|
13
|
+
const _image = /*#__PURE__*/ _interop_require_default(require("next/image"));
|
|
14
|
+
const _fixefycookies = require("@fixefy/fixefy-cookies");
|
|
15
|
+
const _FxIcon = require("../FxIcon");
|
|
16
|
+
const _nexts3upload = require("@fixefy/next-s3-upload");
|
|
17
|
+
const _fixefyuiutils = require("@fixefy/fixefy-ui-utils");
|
|
18
|
+
const _fixefyhooks = require("@fixefy/fixefy-hooks");
|
|
19
|
+
const _CircularProgress = /*#__PURE__*/ _interop_require_default(require("@mui/material/CircularProgress"));
|
|
20
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
|
21
|
+
try {
|
|
22
|
+
var info = gen[key](arg);
|
|
23
|
+
var value = info.value;
|
|
24
|
+
} catch (error) {
|
|
25
|
+
reject(error);
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
if (info.done) {
|
|
29
|
+
resolve(value);
|
|
30
|
+
} else {
|
|
31
|
+
Promise.resolve(value).then(_next, _throw);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
function _async_to_generator(fn) {
|
|
35
|
+
return function() {
|
|
36
|
+
var self = this, args = arguments;
|
|
37
|
+
return new Promise(function(resolve, reject) {
|
|
38
|
+
var gen = fn.apply(self, args);
|
|
39
|
+
function _next(value) {
|
|
40
|
+
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
|
|
41
|
+
}
|
|
42
|
+
function _throw(err) {
|
|
43
|
+
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
|
|
44
|
+
}
|
|
45
|
+
_next(undefined);
|
|
46
|
+
});
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
function _interop_require_default(obj) {
|
|
50
|
+
return obj && obj.__esModule ? obj : {
|
|
51
|
+
default: obj
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
function _getRequireWildcardCache(nodeInterop) {
|
|
55
|
+
if (typeof WeakMap !== "function") return null;
|
|
56
|
+
var cacheBabelInterop = new WeakMap();
|
|
57
|
+
var cacheNodeInterop = new WeakMap();
|
|
58
|
+
return (_getRequireWildcardCache = function(nodeInterop) {
|
|
59
|
+
return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
|
|
60
|
+
})(nodeInterop);
|
|
61
|
+
}
|
|
62
|
+
function _interop_require_wildcard(obj, nodeInterop) {
|
|
63
|
+
if (!nodeInterop && obj && obj.__esModule) {
|
|
64
|
+
return obj;
|
|
65
|
+
}
|
|
66
|
+
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
|
|
67
|
+
return {
|
|
68
|
+
default: obj
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
var cache = _getRequireWildcardCache(nodeInterop);
|
|
72
|
+
if (cache && cache.has(obj)) {
|
|
73
|
+
return cache.get(obj);
|
|
74
|
+
}
|
|
75
|
+
var newObj = {
|
|
76
|
+
__proto__: null
|
|
77
|
+
};
|
|
78
|
+
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
79
|
+
for(var key in obj){
|
|
80
|
+
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
81
|
+
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
|
82
|
+
if (desc && (desc.get || desc.set)) {
|
|
83
|
+
Object.defineProperty(newObj, key, desc);
|
|
84
|
+
} else {
|
|
85
|
+
newObj[key] = obj[key];
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
newObj.default = obj;
|
|
90
|
+
if (cache) {
|
|
91
|
+
cache.set(obj, newObj);
|
|
92
|
+
}
|
|
93
|
+
return newObj;
|
|
94
|
+
}
|
|
95
|
+
const FxUserImage = ({ bucketAddress, user, loading, setLoading, assetUrl })=>{
|
|
96
|
+
const getRandomColor = (0, _fixefyhooks.useRandomColor)();
|
|
97
|
+
const { listS3Bucket } = (0, _nexts3upload.useS3ListBucket)();
|
|
98
|
+
const { downloadFromS3 } = (0, _nexts3upload.useS3Download)('download-bytearray');
|
|
99
|
+
const { email, full_name, first_name, last_name } = user;
|
|
100
|
+
var _ref;
|
|
101
|
+
// @ts-expect-error try to write in a good manner - no trick no hacks
|
|
102
|
+
const initials = (0, _fixefyuiutils.toInitials)((_ref = full_name !== null && full_name !== void 0 ? full_name : first_name && last_name) !== null && _ref !== void 0 ? _ref : 'unknown').slice(0, 2);
|
|
103
|
+
const [file, setFile] = (0, _react.useState)(null);
|
|
104
|
+
const [files, setFiles] = (0, _react.useState)([]);
|
|
105
|
+
(0, _react.useEffect)(()=>{
|
|
106
|
+
fetchFiles();
|
|
107
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
108
|
+
}, []);
|
|
109
|
+
(0, _react.useEffect)(()=>{
|
|
110
|
+
if (file) {
|
|
111
|
+
setLoading(false);
|
|
112
|
+
}
|
|
113
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
114
|
+
}, [
|
|
115
|
+
file
|
|
116
|
+
]);
|
|
117
|
+
(0, _react.useEffect)(()=>{
|
|
118
|
+
fetchFile(files);
|
|
119
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
120
|
+
}, []);
|
|
121
|
+
//// fetch single file from s3
|
|
122
|
+
const fetchFile = function() {
|
|
123
|
+
var _ref = _async_to_generator(function*(files) {
|
|
124
|
+
if (files.length) {
|
|
125
|
+
try {
|
|
126
|
+
var _files_, _files__Key, _files_1;
|
|
127
|
+
const data = yield downloadFromS3({
|
|
128
|
+
path: (_files_ = files[0]) === null || _files_ === void 0 ? void 0 : _files_.Key,
|
|
129
|
+
bucketName: `fixefy-${bucketAddress}`
|
|
130
|
+
});
|
|
131
|
+
const fileNames = (_files_1 = files[0]) === null || _files_1 === void 0 ? void 0 : (_files__Key = _files_1.Key) === null || _files__Key === void 0 ? void 0 : _files__Key.split('/').filter((part)=>part != '');
|
|
132
|
+
const fileName = fileNames[(fileNames === null || fileNames === void 0 ? void 0 : fileNames.length) - 1];
|
|
133
|
+
const fileType = fileName.split('.').pop();
|
|
134
|
+
const currentFile = {
|
|
135
|
+
data: data.content,
|
|
136
|
+
type: fileType,
|
|
137
|
+
name: fileName
|
|
138
|
+
};
|
|
139
|
+
setFile(currentFile);
|
|
140
|
+
setLoading(false);
|
|
141
|
+
} catch (err) {
|
|
142
|
+
console.error(err, err.stack, 'err');
|
|
143
|
+
setLoading(false);
|
|
144
|
+
}
|
|
145
|
+
setLoading(false);
|
|
146
|
+
}
|
|
147
|
+
});
|
|
148
|
+
return function fetchFile(files) {
|
|
149
|
+
return _ref.apply(this, arguments);
|
|
150
|
+
};
|
|
151
|
+
}();
|
|
152
|
+
/// fetch files from s3
|
|
153
|
+
const fetchFiles = function() {
|
|
154
|
+
var _ref = _async_to_generator(function*() {
|
|
155
|
+
setLoading(true);
|
|
156
|
+
const { ws, user } = _fixefycookies.CookieHelper.getAll(null);
|
|
157
|
+
let { workspaces } = JSON.parse(user);
|
|
158
|
+
if (typeof workspaces === 'string') {
|
|
159
|
+
workspaces = JSON.parse(workspaces);
|
|
160
|
+
}
|
|
161
|
+
const currentWorkspace = workspaces.find((workspace)=>(workspace === null || workspace === void 0 ? void 0 : workspace._id) === ws);
|
|
162
|
+
if (!currentWorkspace) {
|
|
163
|
+
console.log('Workspace not found.');
|
|
164
|
+
setLoading(false);
|
|
165
|
+
return;
|
|
166
|
+
}
|
|
167
|
+
const bucket = `fixefy-${bucketAddress}`;
|
|
168
|
+
const startAfter = `${currentWorkspace.readable_id}/${email}`;
|
|
169
|
+
const data = yield listS3Bucket({
|
|
170
|
+
bucketName: bucket,
|
|
171
|
+
prefix: startAfter,
|
|
172
|
+
startAfter
|
|
173
|
+
});
|
|
174
|
+
try {
|
|
175
|
+
if (data.contents.length) {
|
|
176
|
+
setFiles(data.contents);
|
|
177
|
+
fetchFile(data.contents);
|
|
178
|
+
} else {
|
|
179
|
+
setLoading(false);
|
|
180
|
+
}
|
|
181
|
+
} catch (err) {
|
|
182
|
+
console.error(err, err.stack, 'err');
|
|
183
|
+
}
|
|
184
|
+
});
|
|
185
|
+
return function fetchFiles() {
|
|
186
|
+
return _ref.apply(this, arguments);
|
|
187
|
+
};
|
|
188
|
+
}();
|
|
189
|
+
if (loading) return /*#__PURE__*/ (0, _jsxruntime.jsx)(_CircularProgress.default, {
|
|
190
|
+
size: 24
|
|
191
|
+
});
|
|
192
|
+
if (!file && !loading) return /*#__PURE__*/ (0, _jsxruntime.jsx)(_FxIcon.FxIcon, {
|
|
193
|
+
assetUrl: assetUrl,
|
|
194
|
+
icon: 'users',
|
|
195
|
+
width: 24,
|
|
196
|
+
height: 24,
|
|
197
|
+
variant: "rounded",
|
|
198
|
+
fontSize: 12,
|
|
199
|
+
initials: initials,
|
|
200
|
+
background: getRandomColor()
|
|
201
|
+
});
|
|
202
|
+
return file && !loading && /*#__PURE__*/ (0, _jsxruntime.jsx)(ImageView, {
|
|
203
|
+
data: file.data,
|
|
204
|
+
fileName: file.name,
|
|
205
|
+
type: file.type
|
|
206
|
+
});
|
|
207
|
+
};
|
|
208
|
+
const ImageView = ({ data, fileName, type })=>{
|
|
209
|
+
const [imageSrc, setImageSrc] = (0, _react.useState)(null);
|
|
210
|
+
(0, _react.useEffect)(()=>{
|
|
211
|
+
if (data instanceof Uint8Array) {
|
|
212
|
+
const blob = new Blob([
|
|
213
|
+
data
|
|
214
|
+
], {
|
|
215
|
+
type: `image/${type == 'svg' ? 'svg+xml' : type}`
|
|
216
|
+
});
|
|
217
|
+
const url = URL.createObjectURL(blob);
|
|
218
|
+
setImageSrc(url);
|
|
219
|
+
return ()=>{
|
|
220
|
+
URL.revokeObjectURL(url);
|
|
221
|
+
};
|
|
222
|
+
} else {
|
|
223
|
+
setImageSrc(null);
|
|
224
|
+
return;
|
|
225
|
+
}
|
|
226
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
227
|
+
}, [
|
|
228
|
+
data
|
|
229
|
+
]);
|
|
230
|
+
return imageSrc && /*#__PURE__*/ (0, _jsxruntime.jsx)(_image.default, {
|
|
231
|
+
width: 24,
|
|
232
|
+
height: 24,
|
|
233
|
+
src: imageSrc,
|
|
234
|
+
alt: fileName
|
|
235
|
+
});
|
|
236
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "FxUserImage", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
8
|
+
return _FxUserImage.FxUserImage;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
const _FxUserImage = require("./FxUserImage");
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
function _export(target, all) {
|
|
6
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: all[name]
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
_export(exports, {
|
|
12
|
+
FxWizard: function() {
|
|
13
|
+
return FxWizard;
|
|
14
|
+
},
|
|
15
|
+
default: function() {
|
|
16
|
+
return _default;
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
const _jsxruntime = require("react/jsx-runtime");
|
|
20
|
+
const _react = /*#__PURE__*/ _interop_require_default(require("react"));
|
|
21
|
+
const _reactusewizard = require("react-use-wizard");
|
|
22
|
+
function _interop_require_default(obj) {
|
|
23
|
+
return obj && obj.__esModule ? obj : {
|
|
24
|
+
default: obj
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
const FxWizard = ({ config, footer })=>{
|
|
28
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_reactusewizard.Wizard, {
|
|
29
|
+
footer: footer,
|
|
30
|
+
children: config === null || config === void 0 ? void 0 : config.steps.map((step, i)=>/*#__PURE__*/ (0, _jsxruntime.jsx)(WizardStepWrapper, {
|
|
31
|
+
props: step,
|
|
32
|
+
Component: step.component
|
|
33
|
+
}, i))
|
|
34
|
+
});
|
|
35
|
+
};
|
|
36
|
+
const WizardStepWrapper = ({ Component, props })=>{
|
|
37
|
+
console.log('WizardStepWrapper', JSON.stringify(props));
|
|
38
|
+
const { goToStep, isLastStep } = (0, _reactusewizard.useWizard)();
|
|
39
|
+
const handleNext = ()=>{
|
|
40
|
+
if (!isLastStep) {
|
|
41
|
+
goToStep(props.nextStepPath);
|
|
42
|
+
} else {
|
|
43
|
+
console.log('Reached the final step');
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsx)(Component, {
|
|
47
|
+
onHandleNext: handleNext
|
|
48
|
+
});
|
|
49
|
+
};
|
|
50
|
+
const _default = FxWizard;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
_export_star(require("./FxWizard"), exports);
|
|
6
|
+
_export_star(require("./steps launcher"), exports);
|
|
7
|
+
function _export_star(from, to) {
|
|
8
|
+
Object.keys(from).forEach(function(k) {
|
|
9
|
+
if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
|
|
10
|
+
Object.defineProperty(to, k, {
|
|
11
|
+
enumerable: true,
|
|
12
|
+
get: function() {
|
|
13
|
+
return from[k];
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
return from;
|
|
19
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
function _export(target, all) {
|
|
6
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: all[name]
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
_export(exports, {
|
|
12
|
+
StepsLauncher: function() {
|
|
13
|
+
return StepsLauncher;
|
|
14
|
+
},
|
|
15
|
+
default: function() {
|
|
16
|
+
return _default;
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
const _jsxruntime = require("react/jsx-runtime");
|
|
20
|
+
const _react = /*#__PURE__*/ _interop_require_default(require("react"));
|
|
21
|
+
const _FxWizard = /*#__PURE__*/ _interop_require_default(require("../FxWizard"));
|
|
22
|
+
function _interop_require_default(obj) {
|
|
23
|
+
return obj && obj.__esModule ? obj : {
|
|
24
|
+
default: obj
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
const StepsLauncher = (steps, footer)=>{
|
|
28
|
+
/* each config-step has a path, component, and nextStepPath
|
|
29
|
+
example:
|
|
30
|
+
steps = [
|
|
31
|
+
{
|
|
32
|
+
path: '/file-type-selection-page',
|
|
33
|
+
component: FileTypeSelectionPage,
|
|
34
|
+
nextStepPath: '/choose-and-display-files',
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
path: '/choose-and-display-files',
|
|
38
|
+
component: ChosenFilesDisplayPage,
|
|
39
|
+
nextStepPath: '/uploader-page',
|
|
40
|
+
},
|
|
41
|
+
]
|
|
42
|
+
|
|
43
|
+
footer is a component
|
|
44
|
+
*/ const config = {
|
|
45
|
+
steps
|
|
46
|
+
};
|
|
47
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_FxWizard.default, {
|
|
48
|
+
config: config,
|
|
49
|
+
footer: footer
|
|
50
|
+
});
|
|
51
|
+
};
|
|
52
|
+
const _default = StepsLauncher;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
_export_star(require("./StepsLauncher"), exports);
|
|
6
|
+
function _export_star(from, to) {
|
|
7
|
+
Object.keys(from).forEach(function(k) {
|
|
8
|
+
if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
|
|
9
|
+
Object.defineProperty(to, k, {
|
|
10
|
+
enumerable: true,
|
|
11
|
+
get: function() {
|
|
12
|
+
return from[k];
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
});
|
|
17
|
+
return from;
|
|
18
|
+
}
|