@fixefy/fixefy-ui-components 0.0.41 → 0.0.42
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/build/FxActionsTray/FxActionsTray.js +351 -0
- package/build/FxActionsTray/actions_tray_types.d.js +4 -0
- package/build/FxActionsTray/index.js +11 -0
- package/build/FxActionsTray/styles/actions_tray.styles.js +160 -0
- package/build/FxAggregationsBar/FxAggregations.js +41 -0
- package/build/FxAggregationsBar/aggregations_types.d.js +4 -0
- package/build/FxAggregationsBar/helpers/structureReader.js +78 -0
- package/build/FxAggregationsBar/index.js +11 -0
- package/build/FxAggregationsBar/operations/query.js +73 -0
- package/build/FxAsyncDropdown/FxAsyncDropdown.js +456 -0
- package/build/FxAsyncDropdown/async_dropdown_types.d.js +4 -0
- package/build/FxAsyncDropdown/helpers/helpers.js +151 -0
- package/build/FxAsyncDropdown/index.js +11 -0
- package/build/FxAsyncDropdown/styles/dropdown.styles.js +230 -0
- package/build/FxAvatar/FxAvatar.js +145 -0
- package/build/FxAvatar/avatar_types.d.js +4 -0
- package/build/FxAvatar/helpers/stringToColor.js +23 -0
- package/build/FxAvatar/index.js +11 -0
- package/build/FxAvatar/styles/avatar.styles.js +193 -0
- package/build/FxButton/FxButton.js +106 -0
- package/build/FxButton/index.js +11 -0
- package/build/FxButton/styles/button.styles.js +24 -0
- package/build/FxChip/FxChip.js +37 -0
- package/build/FxChip/chip_types.d.js +4 -0
- package/build/FxChip/index.js +11 -0
- package/build/FxChip/styles/chip.styles.js +62 -0
- package/build/FxIcon/FxIcon.js +147 -0
- package/build/FxIcon/content/dynamic_icon.js +20 -0
- package/build/FxIcon/content/index.js +20 -0
- package/build/FxIcon/content/lazy_icon.js +137 -0
- package/build/FxIcon/icon_types.d.js +4 -0
- package/build/FxIcon/index.js +20 -0
- package/build/FxModal/FxModal.js +171 -0
- package/build/FxModal/index.js +11 -0
- package/build/FxModal/modal_types.d.js +4 -0
- package/build/FxModal/styles/modal.style.js +59 -0
- package/build/FxNotes/FxNotes.js +216 -0
- package/build/FxNotes/helpers/stringToColor.js +26 -0
- package/build/FxNotes/index.js +11 -0
- package/build/FxNotes/note_types.d.js +4 -0
- package/build/FxNotes/operations/queries.js +35 -0
- package/build/FxNotes/styles/notes.styles.js +169 -0
- package/build/FxNumberField/FxNumberField.js +109 -0
- package/build/FxNumberField/index.js +11 -0
- package/build/FxNumberField/number_field_types.d.js +4 -0
- package/build/FxNumberField/styles/number_field.styles.js +94 -0
- package/build/FxProgressCircle/FxProgressCircle.js +65 -0
- package/build/FxProgressCircle/index.js +11 -0
- package/build/FxProgressCircle/progress_circle_types.d.js +4 -0
- package/build/FxProgressCircle/styles/progress_circle.styles.js +106 -0
- package/build/FxProgressCounter/ProgressCounter.js +168 -0
- package/build/FxProgressCounter/index.js +11 -0
- package/build/FxProgressCounter/progress_counter_types.d.js +4 -0
- package/build/FxProgressCounter/styles/progress_counter.styles.js +61 -0
- package/build/FxScore/FxScore.js +207 -0
- package/build/FxScore/index.js +11 -0
- package/build/FxScore/score_types.d.js +4 -0
- package/build/FxScore/styles/score.styles.js +96 -0
- package/build/FxShowMore/FxShowMore.js +80 -0
- package/build/FxShowMore/index.js +11 -0
- package/build/FxShowMore/show_more_types.d.js +4 -0
- package/build/FxShowMore/styles/show_more.styles.js +134 -0
- package/build/FxSlider/FxSlider.js +49 -0
- package/build/FxSlider/index.js +11 -0
- package/build/FxSlider/slider_types.d.js +4 -0
- package/build/FxStatisticsBar/FxStatisticsBar.js +191 -0
- package/build/FxStatisticsBar/index.js +11 -0
- package/build/FxStatisticsBar/statistics_bar_types.d.js +4 -0
- package/build/FxStatisticsBar/styles/statistics.styles.js +98 -0
- package/build/FxStatusBar/FxStatusBar.js +143 -0
- package/build/FxStatusBar/helpers/constants.js +22 -0
- package/build/FxStatusBar/index.js +20 -0
- package/build/FxStatusBar/status_bar_types.d.js +4 -0
- package/build/FxStatusBar/styles/statusBar.styles.js +131 -0
- package/build/FxStyledComponents/index.js +311 -0
- package/build/FxTextField/FxTextField.js +208 -0
- package/build/FxTextField/index.js +11 -0
- package/build/FxTextField/text_field_types.d.js +4 -0
- package/build/FxTodo/FxTodo.js +95 -0
- package/build/FxTodo/index.js +23 -0
- package/build/FxTodo/styles/todo.styles.js +183 -0
- package/build/FxTodo/todo_types.d.js +4 -0
- package/build/FxWizard/FxWizard.js +179 -0
- package/build/FxWizard/WizardContext.js +207 -0
- package/build/FxWizard/index.js +23 -0
- package/build/FxWizard/styles/wizard.styles.js +89 -0
- package/build/FxWizard/wizard_types.d.js +4 -0
- package/build/index.js +182 -0
- package/package.json +2 -2
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "FxModal", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
8
|
+
return FxModal;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
const _jsxruntime = require("react/jsx-runtime");
|
|
12
|
+
const _react = /*#__PURE__*/ _interop_require_default(require("react"));
|
|
13
|
+
const _material = require("@mui/material");
|
|
14
|
+
const _modalstyle = require("./styles/modal.style");
|
|
15
|
+
function _define_property(obj, key, value) {
|
|
16
|
+
if (key in obj) {
|
|
17
|
+
Object.defineProperty(obj, key, {
|
|
18
|
+
value: value,
|
|
19
|
+
enumerable: true,
|
|
20
|
+
configurable: true,
|
|
21
|
+
writable: true
|
|
22
|
+
});
|
|
23
|
+
} else {
|
|
24
|
+
obj[key] = value;
|
|
25
|
+
}
|
|
26
|
+
return obj;
|
|
27
|
+
}
|
|
28
|
+
function _interop_require_default(obj) {
|
|
29
|
+
return obj && obj.__esModule ? obj : {
|
|
30
|
+
default: obj
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
function _object_spread(target) {
|
|
34
|
+
for(var i = 1; i < arguments.length; i++){
|
|
35
|
+
var source = arguments[i] != null ? arguments[i] : {};
|
|
36
|
+
var ownKeys = Object.keys(source);
|
|
37
|
+
if (typeof Object.getOwnPropertySymbols === "function") {
|
|
38
|
+
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
39
|
+
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
40
|
+
}));
|
|
41
|
+
}
|
|
42
|
+
ownKeys.forEach(function(key) {
|
|
43
|
+
_define_property(target, key, source[key]);
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
return target;
|
|
47
|
+
}
|
|
48
|
+
function ownKeys(object, enumerableOnly) {
|
|
49
|
+
var keys = Object.keys(object);
|
|
50
|
+
if (Object.getOwnPropertySymbols) {
|
|
51
|
+
var symbols = Object.getOwnPropertySymbols(object);
|
|
52
|
+
if (enumerableOnly) {
|
|
53
|
+
symbols = symbols.filter(function(sym) {
|
|
54
|
+
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
keys.push.apply(keys, symbols);
|
|
58
|
+
}
|
|
59
|
+
return keys;
|
|
60
|
+
}
|
|
61
|
+
function _object_spread_props(target, source) {
|
|
62
|
+
source = source != null ? source : {};
|
|
63
|
+
if (Object.getOwnPropertyDescriptors) {
|
|
64
|
+
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
65
|
+
} else {
|
|
66
|
+
ownKeys(Object(source)).forEach(function(key) {
|
|
67
|
+
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
return target;
|
|
71
|
+
}
|
|
72
|
+
function _object_without_properties(source, excluded) {
|
|
73
|
+
if (source == null) return {};
|
|
74
|
+
var target = _object_without_properties_loose(source, excluded);
|
|
75
|
+
var key, i;
|
|
76
|
+
if (Object.getOwnPropertySymbols) {
|
|
77
|
+
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
78
|
+
for(i = 0; i < sourceSymbolKeys.length; i++){
|
|
79
|
+
key = sourceSymbolKeys[i];
|
|
80
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
81
|
+
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
82
|
+
target[key] = source[key];
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
return target;
|
|
86
|
+
}
|
|
87
|
+
function _object_without_properties_loose(source, excluded) {
|
|
88
|
+
if (source == null) return {};
|
|
89
|
+
var target = {};
|
|
90
|
+
var sourceKeys = Object.keys(source);
|
|
91
|
+
var key, i;
|
|
92
|
+
for(i = 0; i < sourceKeys.length; i++){
|
|
93
|
+
key = sourceKeys[i];
|
|
94
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
95
|
+
target[key] = source[key];
|
|
96
|
+
}
|
|
97
|
+
return target;
|
|
98
|
+
}
|
|
99
|
+
//////////////
|
|
100
|
+
const FxDialogTitle = (props)=>{
|
|
101
|
+
const { children } = props, other = _object_without_properties(props, [
|
|
102
|
+
"children"
|
|
103
|
+
]);
|
|
104
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_modalstyle.StyledDialogTitle, _object_spread_props(_object_spread({}, other), {
|
|
105
|
+
children: children
|
|
106
|
+
}));
|
|
107
|
+
};
|
|
108
|
+
const FxInlineDialogTitle = (props)=>{
|
|
109
|
+
const { children } = props, other = _object_without_properties(props, [
|
|
110
|
+
"children"
|
|
111
|
+
]);
|
|
112
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_modalstyle.StyledInlineDialogTitle, _object_spread_props(_object_spread({}, other), {
|
|
113
|
+
children: children
|
|
114
|
+
}));
|
|
115
|
+
};
|
|
116
|
+
const IconTitle = ({ icon, title, inline })=>{
|
|
117
|
+
const renderObject = inline ? /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Box, {
|
|
118
|
+
sx: {
|
|
119
|
+
display: 'flex',
|
|
120
|
+
alignItems: 'center'
|
|
121
|
+
},
|
|
122
|
+
children: [
|
|
123
|
+
icon,
|
|
124
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(FxInlineDialogTitle, {
|
|
125
|
+
id: "customized-dialog-title",
|
|
126
|
+
children: title
|
|
127
|
+
})
|
|
128
|
+
]
|
|
129
|
+
}) : /*#__PURE__*/ (0, _jsxruntime.jsxs)(_jsxruntime.Fragment, {
|
|
130
|
+
children: [
|
|
131
|
+
icon && icon,
|
|
132
|
+
title && /*#__PURE__*/ (0, _jsxruntime.jsx)(FxDialogTitle, {
|
|
133
|
+
id: "customized-dialog-title",
|
|
134
|
+
children: title
|
|
135
|
+
})
|
|
136
|
+
]
|
|
137
|
+
});
|
|
138
|
+
return renderObject;
|
|
139
|
+
};
|
|
140
|
+
const FxModal = (_param)=>{
|
|
141
|
+
var { isOpen = false, isIconTitleInline = false, icon, onClose, children, title, actions } = _param, rest = _object_without_properties(_param, [
|
|
142
|
+
"isOpen",
|
|
143
|
+
"isIconTitleInline",
|
|
144
|
+
"icon",
|
|
145
|
+
"onClose",
|
|
146
|
+
"children",
|
|
147
|
+
"title",
|
|
148
|
+
"actions"
|
|
149
|
+
]);
|
|
150
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsx)("div", {
|
|
151
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsxs)(_modalstyle.FxDialog, _object_spread_props(_object_spread({}, rest), {
|
|
152
|
+
fullWidth: true,
|
|
153
|
+
onClose: onClose,
|
|
154
|
+
"aria-labelledby": "customized-dialog-title",
|
|
155
|
+
open: isOpen,
|
|
156
|
+
children: [
|
|
157
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(IconTitle, {
|
|
158
|
+
icon: icon,
|
|
159
|
+
title: title,
|
|
160
|
+
inline: isIconTitleInline
|
|
161
|
+
}),
|
|
162
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.DialogContent, {
|
|
163
|
+
children: children
|
|
164
|
+
}),
|
|
165
|
+
actions && /*#__PURE__*/ (0, _jsxruntime.jsx)(_modalstyle.DialogActionsStyled, {
|
|
166
|
+
children: actions
|
|
167
|
+
})
|
|
168
|
+
]
|
|
169
|
+
}))
|
|
170
|
+
});
|
|
171
|
+
};
|
|
@@ -0,0 +1,59 @@
|
|
|
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
|
+
DialogActionsStyled: function() {
|
|
13
|
+
return DialogActionsStyled;
|
|
14
|
+
},
|
|
15
|
+
FxDialog: function() {
|
|
16
|
+
return FxDialog;
|
|
17
|
+
},
|
|
18
|
+
StyledDialogTitle: function() {
|
|
19
|
+
return StyledDialogTitle;
|
|
20
|
+
},
|
|
21
|
+
StyledInlineDialogTitle: function() {
|
|
22
|
+
return StyledInlineDialogTitle;
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
const _styles = require("@mui/material/styles");
|
|
26
|
+
const _material = require("@mui/material");
|
|
27
|
+
const FxDialog = (0, _styles.styled)(_material.Dialog)(()=>({
|
|
28
|
+
'& .MuiDialog-paper': {
|
|
29
|
+
borderRadius: 8,
|
|
30
|
+
padding: '24px',
|
|
31
|
+
// minWidth: "370px",
|
|
32
|
+
maxWidth: 'fit-content'
|
|
33
|
+
},
|
|
34
|
+
'& .MuiDialogContent-root': {
|
|
35
|
+
padding: 0
|
|
36
|
+
},
|
|
37
|
+
// "& .MuiDialogTitle-root": {
|
|
38
|
+
// margin: "8px 0",
|
|
39
|
+
// },
|
|
40
|
+
'& .MuiDialogActions-root': {
|
|
41
|
+
margin: '24px 0 0 0',
|
|
42
|
+
padding: 0
|
|
43
|
+
}
|
|
44
|
+
}));
|
|
45
|
+
const StyledDialogTitle = (0, _styles.styled)(_material.DialogTitle)(()=>({
|
|
46
|
+
fontSize: 14,
|
|
47
|
+
fontWeight: 900,
|
|
48
|
+
margin: '8px 0'
|
|
49
|
+
}));
|
|
50
|
+
const StyledInlineDialogTitle = (0, _styles.styled)(_material.DialogTitle)(()=>({
|
|
51
|
+
fontSize: 19,
|
|
52
|
+
fontWeight: 600,
|
|
53
|
+
color: '#568793',
|
|
54
|
+
margin: '8px 16px',
|
|
55
|
+
padding: 0
|
|
56
|
+
}));
|
|
57
|
+
const DialogActionsStyled = (0, _styles.styled)(_material.DialogActions)(({})=>({
|
|
58
|
+
justifyContent: 'flex-start'
|
|
59
|
+
}));
|
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "FxNotes", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
8
|
+
return FxNotes;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
const _jsxruntime = require("react/jsx-runtime");
|
|
12
|
+
const _react = /*#__PURE__*/ _interop_require_wildcard(require("react"));
|
|
13
|
+
const _notesstyles = require("./styles/notes.styles");
|
|
14
|
+
const _queries = require("./operations/queries");
|
|
15
|
+
const _client = require("@apollo/client");
|
|
16
|
+
const _stringToColor = require("./helpers/stringToColor");
|
|
17
|
+
const _fixefyuiutils = require("@fixefy/fixefy-ui-utils");
|
|
18
|
+
function _define_property(obj, key, value) {
|
|
19
|
+
if (key in obj) {
|
|
20
|
+
Object.defineProperty(obj, key, {
|
|
21
|
+
value: value,
|
|
22
|
+
enumerable: true,
|
|
23
|
+
configurable: true,
|
|
24
|
+
writable: true
|
|
25
|
+
});
|
|
26
|
+
} else {
|
|
27
|
+
obj[key] = value;
|
|
28
|
+
}
|
|
29
|
+
return obj;
|
|
30
|
+
}
|
|
31
|
+
function _getRequireWildcardCache(nodeInterop) {
|
|
32
|
+
if (typeof WeakMap !== "function") return null;
|
|
33
|
+
var cacheBabelInterop = new WeakMap();
|
|
34
|
+
var cacheNodeInterop = new WeakMap();
|
|
35
|
+
return (_getRequireWildcardCache = function(nodeInterop) {
|
|
36
|
+
return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
|
|
37
|
+
})(nodeInterop);
|
|
38
|
+
}
|
|
39
|
+
function _interop_require_wildcard(obj, nodeInterop) {
|
|
40
|
+
if (!nodeInterop && obj && obj.__esModule) {
|
|
41
|
+
return obj;
|
|
42
|
+
}
|
|
43
|
+
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
|
|
44
|
+
return {
|
|
45
|
+
default: obj
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
var cache = _getRequireWildcardCache(nodeInterop);
|
|
49
|
+
if (cache && cache.has(obj)) {
|
|
50
|
+
return cache.get(obj);
|
|
51
|
+
}
|
|
52
|
+
var newObj = {
|
|
53
|
+
__proto__: null
|
|
54
|
+
};
|
|
55
|
+
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
56
|
+
for(var key in obj){
|
|
57
|
+
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
58
|
+
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
|
59
|
+
if (desc && (desc.get || desc.set)) {
|
|
60
|
+
Object.defineProperty(newObj, key, desc);
|
|
61
|
+
} else {
|
|
62
|
+
newObj[key] = obj[key];
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
newObj.default = obj;
|
|
67
|
+
if (cache) {
|
|
68
|
+
cache.set(obj, newObj);
|
|
69
|
+
}
|
|
70
|
+
return newObj;
|
|
71
|
+
}
|
|
72
|
+
function _object_spread(target) {
|
|
73
|
+
for(var i = 1; i < arguments.length; i++){
|
|
74
|
+
var source = arguments[i] != null ? arguments[i] : {};
|
|
75
|
+
var ownKeys = Object.keys(source);
|
|
76
|
+
if (typeof Object.getOwnPropertySymbols === "function") {
|
|
77
|
+
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
78
|
+
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
79
|
+
}));
|
|
80
|
+
}
|
|
81
|
+
ownKeys.forEach(function(key) {
|
|
82
|
+
_define_property(target, key, source[key]);
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
return target;
|
|
86
|
+
}
|
|
87
|
+
function ownKeys(object, enumerableOnly) {
|
|
88
|
+
var keys = Object.keys(object);
|
|
89
|
+
if (Object.getOwnPropertySymbols) {
|
|
90
|
+
var symbols = Object.getOwnPropertySymbols(object);
|
|
91
|
+
if (enumerableOnly) {
|
|
92
|
+
symbols = symbols.filter(function(sym) {
|
|
93
|
+
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
keys.push.apply(keys, symbols);
|
|
97
|
+
}
|
|
98
|
+
return keys;
|
|
99
|
+
}
|
|
100
|
+
function _object_spread_props(target, source) {
|
|
101
|
+
source = source != null ? source : {};
|
|
102
|
+
if (Object.getOwnPropertyDescriptors) {
|
|
103
|
+
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
104
|
+
} else {
|
|
105
|
+
ownKeys(Object(source)).forEach(function(key) {
|
|
106
|
+
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
return target;
|
|
110
|
+
}
|
|
111
|
+
const FxNotes = ({ notes, onChange, onSend })=>{
|
|
112
|
+
const [comment, setComment] = (0, _react.useState)('');
|
|
113
|
+
const [backgroundcolors, setBackgroundColors] = (0, _react.useState)({});
|
|
114
|
+
// const [anchorEl] = React.useState<HTMLButtonElement | null>(null)
|
|
115
|
+
const inputRef = (0, _react.useRef)();
|
|
116
|
+
const { data } = (0, _client.useQuery)(_queries.ME);
|
|
117
|
+
const { me } = data;
|
|
118
|
+
// const handleClick = (event: React.MouseEvent<HTMLButtonElement>) => {
|
|
119
|
+
// setAnchorEl(event.currentTarget)
|
|
120
|
+
// }
|
|
121
|
+
// const handleClose = () => {
|
|
122
|
+
// setAnchorEl(null)
|
|
123
|
+
// }
|
|
124
|
+
const handleEnterKeyPressed = ()=>{
|
|
125
|
+
setComment((prevState)=>{
|
|
126
|
+
if (prevState) {
|
|
127
|
+
onSend && onSend({
|
|
128
|
+
created_at: new Date().getTime(),
|
|
129
|
+
created_by: me.username,
|
|
130
|
+
text: prevState
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
return '';
|
|
134
|
+
});
|
|
135
|
+
};
|
|
136
|
+
(0, _react.useEffect)(()=>{
|
|
137
|
+
onChange && onChange(comment);
|
|
138
|
+
}, [
|
|
139
|
+
comment
|
|
140
|
+
]);
|
|
141
|
+
(0, _react.useEffect)(()=>{
|
|
142
|
+
if (inputRef.current) {
|
|
143
|
+
inputRef.current.addEventListener('keyup', (event)=>{
|
|
144
|
+
if (event.keyCode === 13) {
|
|
145
|
+
event.preventDefault();
|
|
146
|
+
handleEnterKeyPressed();
|
|
147
|
+
}
|
|
148
|
+
});
|
|
149
|
+
}
|
|
150
|
+
return inputRef && inputRef.current && inputRef.current.removeEventListener('keyup', handleEnterKeyPressed);
|
|
151
|
+
}, []);
|
|
152
|
+
// const open = Boolean(anchorEl)
|
|
153
|
+
// const id = open ? 'simple-popover' : undefined
|
|
154
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_notesstyles.CommentsContainer, {
|
|
155
|
+
children: [
|
|
156
|
+
/*#__PURE__*/ (0, _jsxruntime.jsxs)(_notesstyles.CommentWrapper, {
|
|
157
|
+
children: [
|
|
158
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_notesstyles.StyledAvatar, {
|
|
159
|
+
sx: {
|
|
160
|
+
backgroundColor: backgroundcolors[me.username] ? backgroundcolors[me.username] : (0, _stringToColor.stringToColor)(me.username, (color)=>{
|
|
161
|
+
setBackgroundColors(_object_spread_props(_object_spread({}, backgroundcolors), {
|
|
162
|
+
[me.username]: color
|
|
163
|
+
}));
|
|
164
|
+
})
|
|
165
|
+
},
|
|
166
|
+
src: me && me.image_url,
|
|
167
|
+
children: me && (0, _fixefyuiutils.titleCase)(me.username.slice(0, 1))
|
|
168
|
+
}),
|
|
169
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_notesstyles.CommentInput, {
|
|
170
|
+
type: "text",
|
|
171
|
+
value: comment,
|
|
172
|
+
ref: inputRef,
|
|
173
|
+
onChange: (e)=>{
|
|
174
|
+
setComment(e.currentTarget.value);
|
|
175
|
+
}
|
|
176
|
+
})
|
|
177
|
+
]
|
|
178
|
+
}),
|
|
179
|
+
notes && notes.length ? /*#__PURE__*/ (0, _jsxruntime.jsx)(_notesstyles.CommentsWrapper, {
|
|
180
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_notesstyles.CommentsScrollWrapper, {
|
|
181
|
+
children: notes.slice().reverse().map((comment, index)=>{
|
|
182
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_notesstyles.UserCommentWrapper, {
|
|
183
|
+
children: [
|
|
184
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_notesstyles.StyledAvatar, {
|
|
185
|
+
sx: {
|
|
186
|
+
backgroundColor: backgroundcolors[comment.created_by] ? backgroundcolors[comment.created_by] : (0, _stringToColor.stringToColor)(comment.created_by, (color)=>{
|
|
187
|
+
setBackgroundColors(_object_spread_props(_object_spread({}, backgroundcolors), {
|
|
188
|
+
[comment.created_by]: color
|
|
189
|
+
}));
|
|
190
|
+
})
|
|
191
|
+
},
|
|
192
|
+
children: (0, _fixefyuiutils.titleCase)(comment.created_by.slice(0, 1))
|
|
193
|
+
}),
|
|
194
|
+
/*#__PURE__*/ (0, _jsxruntime.jsxs)(_notesstyles.UserComment, {
|
|
195
|
+
children: [
|
|
196
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_notesstyles.CommentUserTitle, {
|
|
197
|
+
children: comment.created_by
|
|
198
|
+
}),
|
|
199
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_notesstyles.CommentDate, {
|
|
200
|
+
children: (0, _fixefyuiutils.normalizeTimestamp)(comment.created_at, {
|
|
201
|
+
dateOnly: true
|
|
202
|
+
})
|
|
203
|
+
}),
|
|
204
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_notesstyles.CommentDesc, {
|
|
205
|
+
children: comment.text
|
|
206
|
+
})
|
|
207
|
+
]
|
|
208
|
+
})
|
|
209
|
+
]
|
|
210
|
+
}, index);
|
|
211
|
+
})
|
|
212
|
+
})
|
|
213
|
+
}) : null
|
|
214
|
+
]
|
|
215
|
+
});
|
|
216
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "stringToColor", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
8
|
+
return stringToColor;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
const stringToColor = (string, callBack)=>{
|
|
12
|
+
let hash = 0;
|
|
13
|
+
let color = '#';
|
|
14
|
+
if (!string) {
|
|
15
|
+
return '#000';
|
|
16
|
+
}
|
|
17
|
+
/* eslint-disable no-bitwise */ for(let i = 0; i < string.length; i += 1){
|
|
18
|
+
hash = string.charCodeAt(i) + ((hash << 5) - hash);
|
|
19
|
+
}
|
|
20
|
+
for(let i = 0; i < 3; i += 1){
|
|
21
|
+
const value = hash >> i * 8 & 0xff;
|
|
22
|
+
color += `00${value.toString(16)}`.substr(-2);
|
|
23
|
+
}
|
|
24
|
+
/* eslint-enable no-bitwise */ callBack && callBack(color);
|
|
25
|
+
return color;
|
|
26
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "ME", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
8
|
+
return ME;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
const _graphqltag = /*#__PURE__*/ _interop_require_default(require("graphql-tag"));
|
|
12
|
+
function _interop_require_default(obj) {
|
|
13
|
+
return obj && obj.__esModule ? obj : {
|
|
14
|
+
default: obj
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
const ME = (0, _graphqltag.default)`
|
|
18
|
+
query ME {
|
|
19
|
+
me {
|
|
20
|
+
_id
|
|
21
|
+
username
|
|
22
|
+
first_name
|
|
23
|
+
last_name
|
|
24
|
+
email
|
|
25
|
+
workspaces {
|
|
26
|
+
...InsideWorkspace
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
fragment InsideWorkspace on Workspace {
|
|
32
|
+
_id
|
|
33
|
+
title
|
|
34
|
+
}
|
|
35
|
+
`;
|