@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.
Files changed (123) hide show
  1. package/dist/FxAsyncDropdown/FxAsyncDropdown.js +3 -3
  2. package/dist/FxDatesProgress/styles/progress.styles.js +1 -1
  3. package/dist/FxUserImage/FxUserImage.js +2 -2
  4. package/dist/fixefy-ui-components/src/FxActionsTray/FxActionsTray.js +111 -0
  5. package/dist/fixefy-ui-components/src/FxActionsTray/index.js +11 -0
  6. package/dist/fixefy-ui-components/src/FxActionsTray/styles/actionsTray.style.js +114 -0
  7. package/dist/fixefy-ui-components/src/FxAggregationsBar/FxAggregations.js +41 -0
  8. package/dist/fixefy-ui-components/src/FxAggregationsBar/helpers/structureReader.js +80 -0
  9. package/dist/fixefy-ui-components/src/FxAggregationsBar/index.js +22 -0
  10. package/dist/fixefy-ui-components/src/FxAggregationsBar/operations/query.js +73 -0
  11. package/dist/fixefy-ui-components/src/FxAsyncDropdown/FxAsyncDropdown.js +500 -0
  12. package/dist/fixefy-ui-components/src/FxAsyncDropdown/components/CheckboxIcon.js +44 -0
  13. package/dist/fixefy-ui-components/src/FxAsyncDropdown/components/ChipOption.js +35 -0
  14. package/dist/fixefy-ui-components/src/FxAsyncDropdown/components/ChosenIcon.js +45 -0
  15. package/dist/fixefy-ui-components/src/FxAsyncDropdown/components/DeleteButton.js +37 -0
  16. package/dist/fixefy-ui-components/src/FxAsyncDropdown/components/LogoOption.js +101 -0
  17. package/dist/fixefy-ui-components/src/FxAsyncDropdown/components/TextOption.js +74 -0
  18. package/dist/fixefy-ui-components/src/FxAsyncDropdown/components/index.js +36 -0
  19. package/dist/fixefy-ui-components/src/FxAsyncDropdown/helpers/helpers.js +233 -0
  20. package/dist/fixefy-ui-components/src/FxAsyncDropdown/index.js +11 -0
  21. package/dist/fixefy-ui-components/src/FxAsyncDropdown/styles/dropdown.styles.js +211 -0
  22. package/dist/fixefy-ui-components/src/FxAsyncDropdown/types.js +4 -0
  23. package/dist/fixefy-ui-components/src/FxAvatar/FxAvatar.js +145 -0
  24. package/dist/fixefy-ui-components/src/FxAvatar/helpers/stringToColor.js +23 -0
  25. package/dist/fixefy-ui-components/src/FxAvatar/index.js +22 -0
  26. package/dist/fixefy-ui-components/src/FxAvatar/styles/avatar.styles.js +233 -0
  27. package/dist/fixefy-ui-components/src/FxButton/FxButton.js +106 -0
  28. package/dist/fixefy-ui-components/src/FxButton/index.js +19 -0
  29. package/dist/fixefy-ui-components/src/FxButton/styles/button.styles.js +28 -0
  30. package/dist/fixefy-ui-components/src/FxButtonModalWithComponent/FxButtonModalWithComponent.js +118 -0
  31. package/dist/fixefy-ui-components/src/FxButtonModalWithComponent/index.js +11 -0
  32. package/dist/fixefy-ui-components/src/FxButtonModalWithMenu/FxButtonModalWithMenu.js +126 -0
  33. package/dist/fixefy-ui-components/src/FxButtonModalWithMenu/index.js +11 -0
  34. package/dist/fixefy-ui-components/src/FxChip/FxChip.js +75 -0
  35. package/dist/fixefy-ui-components/src/FxChip/index.js +19 -0
  36. package/dist/fixefy-ui-components/src/FxChip/styles/chip.styles.js +147 -0
  37. package/dist/fixefy-ui-components/src/FxDatesProgress/FxDatesProgress.js +126 -0
  38. package/dist/fixefy-ui-components/src/FxDatesProgress/index.js +11 -0
  39. package/dist/fixefy-ui-components/src/FxDatesProgress/styles/progress.styles.js +24 -0
  40. package/dist/fixefy-ui-components/src/FxGeneralModal/FxGeneralModal.js +107 -0
  41. package/dist/fixefy-ui-components/src/FxGeneralModal/index.js +11 -0
  42. package/dist/fixefy-ui-components/src/FxGridEmptyState/FxGridEmptyState.js +86 -0
  43. package/dist/fixefy-ui-components/src/FxGridEmptyState/index.js +11 -0
  44. package/dist/fixefy-ui-components/src/FxGridError/FxGridError.js +91 -0
  45. package/dist/fixefy-ui-components/src/FxGridError/index.js +11 -0
  46. package/dist/fixefy-ui-components/src/FxIcon/FxIcon.js +118 -0
  47. package/dist/fixefy-ui-components/src/FxIcon/content/dynamic_icon.js +20 -0
  48. package/dist/fixefy-ui-components/src/FxIcon/content/index.js +20 -0
  49. package/dist/fixefy-ui-components/src/FxIcon/content/lazy_icon.js +87 -0
  50. package/dist/fixefy-ui-components/src/FxIcon/index.js +11 -0
  51. package/dist/fixefy-ui-components/src/FxMenuItemWithIcon/FxMenuItemWithIcon.js +84 -0
  52. package/dist/fixefy-ui-components/src/FxMenuItemWithIcon/index.js +11 -0
  53. package/dist/fixefy-ui-components/src/FxModal/FxModal.js +171 -0
  54. package/dist/fixefy-ui-components/src/FxModal/index.js +19 -0
  55. package/dist/fixefy-ui-components/src/FxModal/styles/modal.style.js +66 -0
  56. package/dist/fixefy-ui-components/src/FxNotes/FxNotes.js +216 -0
  57. package/dist/fixefy-ui-components/src/FxNotes/helpers/stringToColor.js +26 -0
  58. package/dist/fixefy-ui-components/src/FxNotes/index.js +22 -0
  59. package/dist/fixefy-ui-components/src/FxNotes/operations/queries.js +35 -0
  60. package/dist/fixefy-ui-components/src/FxNotes/styles/notes.styles.js +168 -0
  61. package/dist/fixefy-ui-components/src/FxNumberField/FxNumberField.js +108 -0
  62. package/dist/fixefy-ui-components/src/FxNumberField/index.js +19 -0
  63. package/dist/fixefy-ui-components/src/FxNumberField/styles/number_field.styles.js +99 -0
  64. package/dist/fixefy-ui-components/src/FxObjStaticDropdown/FxObjStaticDropdown.js +548 -0
  65. package/dist/fixefy-ui-components/src/FxObjStaticDropdown/index.js +25 -0
  66. package/dist/fixefy-ui-components/src/FxObjStaticDropdown/styles/dropdown.styles.js +211 -0
  67. package/dist/fixefy-ui-components/src/FxPopper/Popper.js +139 -0
  68. package/dist/fixefy-ui-components/src/FxPopper/PopperWithOutside.js +116 -0
  69. package/dist/fixefy-ui-components/src/FxPopper/content/PopperHeader.js +36 -0
  70. package/dist/fixefy-ui-components/src/FxPopper/content/index.js +11 -0
  71. package/dist/fixefy-ui-components/src/FxPopper/index.js +24 -0
  72. package/dist/fixefy-ui-components/src/FxPopper/styles/popper.styles.js +138 -0
  73. package/dist/fixefy-ui-components/src/FxProgressCircle/FxProgressCircle.js +65 -0
  74. package/dist/fixefy-ui-components/src/FxProgressCircle/index.js +19 -0
  75. package/dist/fixefy-ui-components/src/FxProgressCircle/styles/progress_circle.styles.js +106 -0
  76. package/dist/fixefy-ui-components/src/FxProgressCounter/ProgressCounter.js +168 -0
  77. package/dist/fixefy-ui-components/src/FxProgressCounter/index.js +19 -0
  78. package/dist/fixefy-ui-components/src/FxProgressCounter/styles/progress_counter.styles.js +66 -0
  79. package/dist/fixefy-ui-components/src/FxScore/FxScore.js +215 -0
  80. package/dist/fixefy-ui-components/src/FxScore/index.js +19 -0
  81. package/dist/fixefy-ui-components/src/FxScore/styles/score.styles.js +102 -0
  82. package/dist/fixefy-ui-components/src/FxShowMore/FxShowMore.js +80 -0
  83. package/dist/fixefy-ui-components/src/FxShowMore/index.js +19 -0
  84. package/dist/fixefy-ui-components/src/FxShowMore/styles/show_more.styles.js +143 -0
  85. package/dist/fixefy-ui-components/src/FxSlider/FxSlider.js +49 -0
  86. package/dist/fixefy-ui-components/src/FxSlider/index.js +19 -0
  87. package/dist/fixefy-ui-components/src/FxStatisticsBar/FxStatisticsBar.js +198 -0
  88. package/dist/fixefy-ui-components/src/FxStatisticsBar/index.js +19 -0
  89. package/dist/fixefy-ui-components/src/FxStatisticsBar/styles/statistics.styles.js +103 -0
  90. package/dist/fixefy-ui-components/src/FxStatusBar/FxStatusBar.js +149 -0
  91. package/dist/fixefy-ui-components/src/FxStatusBar/helpers/constants.js +22 -0
  92. package/dist/fixefy-ui-components/src/FxStatusBar/index.js +22 -0
  93. package/dist/fixefy-ui-components/src/FxStatusBar/styles/statusBar.styles.js +138 -0
  94. package/dist/fixefy-ui-components/src/FxStrStaticDropdown/FxStrStaticDropdown.js +382 -0
  95. package/dist/fixefy-ui-components/src/FxStrStaticDropdown/helpers/helpers.js +22 -0
  96. package/dist/fixefy-ui-components/src/FxStrStaticDropdown/index.js +11 -0
  97. package/dist/fixefy-ui-components/src/FxStrStaticDropdown/styles/dropdown.styles.js +190 -0
  98. package/dist/fixefy-ui-components/src/FxStyledButton/FxStyledButton.js +57 -0
  99. package/dist/fixefy-ui-components/src/FxStyledButton/index.js +11 -0
  100. package/dist/fixefy-ui-components/src/FxStyledComponents/index.js +319 -0
  101. package/dist/fixefy-ui-components/src/FxSwitch/FxSwitch.js +106 -0
  102. package/dist/fixefy-ui-components/src/FxSwitch/index.js +19 -0
  103. package/dist/fixefy-ui-components/src/FxSwitch/styles/switch.styles.js +42 -0
  104. package/dist/fixefy-ui-components/src/FxTabs/FxTabs.js +79 -0
  105. package/dist/fixefy-ui-components/src/FxTabs/index.js +11 -0
  106. package/dist/fixefy-ui-components/src/FxTag/FxTag.js +50 -0
  107. package/dist/fixefy-ui-components/src/FxTag/index.js +19 -0
  108. package/dist/fixefy-ui-components/src/FxTag/styles/tag.styles.js +106 -0
  109. package/dist/fixefy-ui-components/src/FxTextField/FxTextField.js +211 -0
  110. package/dist/fixefy-ui-components/src/FxTextField/index.js +19 -0
  111. package/dist/fixefy-ui-components/src/FxTodo/FxTodo.js +95 -0
  112. package/dist/fixefy-ui-components/src/FxTodo/index.js +22 -0
  113. package/dist/fixefy-ui-components/src/FxTodo/styles/todo.styles.js +183 -0
  114. package/dist/fixefy-ui-components/src/FxToggleButtons/FxToggleButtons.js +69 -0
  115. package/dist/fixefy-ui-components/src/FxToggleButtons/index.js +11 -0
  116. package/dist/fixefy-ui-components/src/FxUserImage/FxUserImage.js +236 -0
  117. package/dist/fixefy-ui-components/src/FxUserImage/index.js +11 -0
  118. package/dist/fixefy-ui-components/src/FxWizard/FxWizard.js +50 -0
  119. package/dist/fixefy-ui-components/src/FxWizard/index.js +19 -0
  120. package/dist/fixefy-ui-components/src/FxWizard/steps launcher/StepsLauncher.js +52 -0
  121. package/dist/fixefy-ui-components/src/FxWizard/steps launcher/index.js +18 -0
  122. package/dist/fixefy-ui-components/src/index.js +277 -0
  123. package/package.json +4 -5
@@ -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 _Box = /*#__PURE__*/ _interop_require_default(require("@mui/material/Box"));
14
+ const _DialogContent = /*#__PURE__*/ _interop_require_default(require("@mui/material/DialogContent"));
15
+ const _modalstyle = require("./styles/modal.style");
16
+ function _define_property(obj, key, value) {
17
+ if (key in obj) {
18
+ Object.defineProperty(obj, key, {
19
+ value: value,
20
+ enumerable: true,
21
+ configurable: true,
22
+ writable: true
23
+ });
24
+ } else {
25
+ obj[key] = value;
26
+ }
27
+ return obj;
28
+ }
29
+ function _interop_require_default(obj) {
30
+ return obj && obj.__esModule ? obj : {
31
+ default: obj
32
+ };
33
+ }
34
+ function _object_spread(target) {
35
+ for(var i = 1; i < arguments.length; i++){
36
+ var source = arguments[i] != null ? arguments[i] : {};
37
+ var ownKeys = Object.keys(source);
38
+ if (typeof Object.getOwnPropertySymbols === "function") {
39
+ ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
40
+ return Object.getOwnPropertyDescriptor(source, sym).enumerable;
41
+ }));
42
+ }
43
+ ownKeys.forEach(function(key) {
44
+ _define_property(target, key, source[key]);
45
+ });
46
+ }
47
+ return target;
48
+ }
49
+ function ownKeys(object, enumerableOnly) {
50
+ var keys = Object.keys(object);
51
+ if (Object.getOwnPropertySymbols) {
52
+ var symbols = Object.getOwnPropertySymbols(object);
53
+ if (enumerableOnly) {
54
+ symbols = symbols.filter(function(sym) {
55
+ return Object.getOwnPropertyDescriptor(object, sym).enumerable;
56
+ });
57
+ }
58
+ keys.push.apply(keys, symbols);
59
+ }
60
+ return keys;
61
+ }
62
+ function _object_spread_props(target, source) {
63
+ source = source != null ? source : {};
64
+ if (Object.getOwnPropertyDescriptors) {
65
+ Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
66
+ } else {
67
+ ownKeys(Object(source)).forEach(function(key) {
68
+ Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
69
+ });
70
+ }
71
+ return target;
72
+ }
73
+ function _object_without_properties(source, excluded) {
74
+ if (source == null) return {};
75
+ var target = _object_without_properties_loose(source, excluded);
76
+ var key, i;
77
+ if (Object.getOwnPropertySymbols) {
78
+ var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
79
+ for(i = 0; i < sourceSymbolKeys.length; i++){
80
+ key = sourceSymbolKeys[i];
81
+ if (excluded.indexOf(key) >= 0) continue;
82
+ if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
83
+ target[key] = source[key];
84
+ }
85
+ }
86
+ return target;
87
+ }
88
+ function _object_without_properties_loose(source, excluded) {
89
+ if (source == null) return {};
90
+ var target = {};
91
+ var sourceKeys = Object.keys(source);
92
+ var key, i;
93
+ for(i = 0; i < sourceKeys.length; i++){
94
+ key = sourceKeys[i];
95
+ if (excluded.indexOf(key) >= 0) continue;
96
+ target[key] = source[key];
97
+ }
98
+ return target;
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)(_Box.default, {
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)(_DialogContent.default, {
163
+ children: children
164
+ }),
165
+ actions && /*#__PURE__*/ (0, _jsxruntime.jsx)(_modalstyle.DialogActionsStyled, {
166
+ children: actions
167
+ })
168
+ ]
169
+ }))
170
+ });
171
+ };
@@ -0,0 +1,19 @@
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
+ FxModal: function() {
13
+ return _FxModal.FxModal;
14
+ },
15
+ ModalPropsType: function() {
16
+ return _FxModal.ModalPropsType;
17
+ }
18
+ });
19
+ const _FxModal = require("./FxModal");
@@ -0,0 +1,66 @@
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 _Dialog = /*#__PURE__*/ _interop_require_default(require("@mui/material/Dialog"));
27
+ const _DialogActions = /*#__PURE__*/ _interop_require_default(require("@mui/material/DialogActions"));
28
+ const _DialogTitle = /*#__PURE__*/ _interop_require_default(require("@mui/material/DialogTitle"));
29
+ function _interop_require_default(obj) {
30
+ return obj && obj.__esModule ? obj : {
31
+ default: obj
32
+ };
33
+ }
34
+ const FxDialog = (0, _styles.styled)(_Dialog.default)(()=>({
35
+ '& .MuiDialog-paper': {
36
+ borderRadius: 8,
37
+ padding: '24px',
38
+ // minWidth: "370px",
39
+ maxWidth: 'fit-content'
40
+ },
41
+ '& .MuiDialogContent-root': {
42
+ padding: 0
43
+ },
44
+ // "& .MuiDialogTitle-root": {
45
+ // margin: "8px 0",
46
+ // },
47
+ '& .MuiDialogActions-root': {
48
+ margin: '24px 0 0 0',
49
+ padding: 0
50
+ }
51
+ }));
52
+ const StyledDialogTitle = (0, _styles.styled)(_DialogTitle.default)(()=>({
53
+ fontSize: 14,
54
+ fontWeight: 900,
55
+ margin: '8px 0'
56
+ }));
57
+ const StyledInlineDialogTitle = (0, _styles.styled)(_DialogTitle.default)(()=>({
58
+ fontSize: 19,
59
+ fontWeight: 600,
60
+ color: '#568793',
61
+ margin: '8px 16px',
62
+ padding: 0
63
+ }));
64
+ const DialogActionsStyled = (0, _styles.styled)(_DialogActions.default)(({})=>({
65
+ justifyContent: 'flex-start'
66
+ }));
@@ -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 _hooks = require("@apollo/client/react/hooks");
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, _hooks.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
+ 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
+ callBack && callBack(color);
25
+ return color;
26
+ };
@@ -0,0 +1,22 @@
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
+ FxNotes: function() {
13
+ return _FxNotes.FxNotes;
14
+ },
15
+ NoteCreateInput: function() {
16
+ return _FxNotes.NoteCreateInput;
17
+ },
18
+ NotesPropsType: function() {
19
+ return _FxNotes.NotesPropsType;
20
+ }
21
+ });
22
+ const _FxNotes = require("./FxNotes");
@@ -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
+ `;