@dhis2/analytics 23.10.4 → 23.12.0
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/CHANGELOG.md +21 -0
- package/build/cjs/components/Interpretations/InterpretationModal/Comment.js +64 -0
- package/build/cjs/components/Interpretations/InterpretationModal/CommentAddForm.js +93 -0
- package/build/cjs/components/Interpretations/InterpretationModal/CommentDeleteButton.js +62 -0
- package/build/cjs/components/Interpretations/InterpretationModal/CommentUpdateForm.js +95 -0
- package/build/cjs/components/Interpretations/InterpretationModal/InterpretationModal.js +187 -0
- package/build/cjs/components/Interpretations/InterpretationModal/InterpretationThread.js +100 -0
- package/build/cjs/components/Interpretations/InterpretationModal/index.js +13 -0
- package/build/cjs/components/Interpretations/InterpretationModal/useModalContentWidth.js +39 -0
- package/build/cjs/components/Interpretations/InterpretationsUnit/InterpretationForm.js +94 -0
- package/build/cjs/components/Interpretations/InterpretationsUnit/InterpretationList.js +94 -0
- package/build/cjs/components/Interpretations/InterpretationsUnit/InterpretationsUnit.js +135 -0
- package/build/cjs/components/Interpretations/InterpretationsUnit/index.js +13 -0
- package/build/cjs/components/Interpretations/common/Interpretation/Interpretation.js +110 -0
- package/build/cjs/components/Interpretations/common/Interpretation/InterpretationDeleteButton.js +58 -0
- package/build/cjs/components/Interpretations/common/Interpretation/InterpretationSharingLink.js +50 -0
- package/build/cjs/components/Interpretations/common/Interpretation/InterpretationUpdateForm.js +108 -0
- package/build/cjs/components/Interpretations/common/Interpretation/index.js +21 -0
- package/build/cjs/components/Interpretations/common/Interpretation/useLike.js +53 -0
- package/build/cjs/components/Interpretations/common/Message/Message.js +55 -0
- package/build/cjs/components/Interpretations/common/Message/MessageButtonStrip.js +33 -0
- package/build/cjs/components/Interpretations/common/Message/MessageEditorContainer.js +42 -0
- package/build/cjs/components/Interpretations/common/Message/MessageIconButton.js +67 -0
- package/build/cjs/components/Interpretations/common/Message/MessageInput.js +31 -0
- package/build/cjs/components/Interpretations/common/Message/MessageStatsBar.js +33 -0
- package/build/cjs/components/Interpretations/common/Message/index.js +53 -0
- package/build/cjs/components/Interpretations/common/RichTextEditor/RichTextEditor.js +262 -0
- package/build/cjs/components/Interpretations/common/RichTextEditor/index.js +13 -0
- package/build/cjs/components/Interpretations/common/RichTextEditor/markdownHandler.js +148 -0
- package/build/cjs/components/Interpretations/common/RichTextEditor/styles/RichTextEditor.style.js +21 -0
- package/build/cjs/components/Interpretations/common/UserMention/UserList.js +48 -0
- package/build/cjs/components/Interpretations/common/UserMention/UserMentionWrapper.js +226 -0
- package/build/cjs/components/Interpretations/common/UserMention/styles/UserMentionWrapper.style.js +30 -0
- package/build/cjs/components/Interpretations/common/UserMention/useUserSearchResults.js +78 -0
- package/build/cjs/components/Interpretations/common/index.js +44 -0
- package/build/cjs/components/LegendKey/styles/LegendKey.style.js +2 -2
- package/build/cjs/index.js +22 -0
- package/build/cjs/locales/en/translations.json +32 -1
- package/build/cjs/locales/ro/translations.json +6 -6
- package/build/cjs/modules/legends.js +6 -2
- package/build/es/components/Interpretations/InterpretationModal/Comment.js +45 -0
- package/build/es/components/Interpretations/InterpretationModal/CommentAddForm.js +70 -0
- package/build/es/components/Interpretations/InterpretationModal/CommentDeleteButton.js +47 -0
- package/build/es/components/Interpretations/InterpretationModal/CommentUpdateForm.js +73 -0
- package/build/es/components/Interpretations/InterpretationModal/InterpretationModal.js +165 -0
- package/build/es/components/Interpretations/InterpretationModal/InterpretationThread.js +79 -0
- package/build/es/components/Interpretations/InterpretationModal/index.js +1 -0
- package/build/es/components/Interpretations/InterpretationModal/useModalContentWidth.js +28 -0
- package/build/es/components/Interpretations/InterpretationsUnit/InterpretationForm.js +71 -0
- package/build/es/components/Interpretations/InterpretationsUnit/InterpretationList.js +78 -0
- package/build/es/components/Interpretations/InterpretationsUnit/InterpretationsUnit.js +112 -0
- package/build/es/components/Interpretations/InterpretationsUnit/index.js +1 -0
- package/build/es/components/Interpretations/common/Interpretation/Interpretation.js +87 -0
- package/build/es/components/Interpretations/common/Interpretation/InterpretationDeleteButton.js +43 -0
- package/build/es/components/Interpretations/common/Interpretation/InterpretationSharingLink.js +33 -0
- package/build/es/components/Interpretations/common/Interpretation/InterpretationUpdateForm.js +85 -0
- package/build/es/components/Interpretations/common/Interpretation/index.js +2 -0
- package/build/es/components/Interpretations/common/Interpretation/useLike.js +45 -0
- package/build/es/components/Interpretations/common/Message/Message.js +41 -0
- package/build/es/components/Interpretations/common/Message/MessageButtonStrip.js +21 -0
- package/build/es/components/Interpretations/common/Message/MessageEditorContainer.js +30 -0
- package/build/es/components/Interpretations/common/Message/MessageIconButton.js +54 -0
- package/build/es/components/Interpretations/common/Message/MessageInput.js +16 -0
- package/build/es/components/Interpretations/common/Message/MessageStatsBar.js +21 -0
- package/build/es/components/Interpretations/common/Message/index.js +6 -0
- package/build/es/components/Interpretations/common/RichTextEditor/RichTextEditor.js +240 -0
- package/build/es/components/Interpretations/common/RichTextEditor/index.js +1 -0
- package/build/es/components/Interpretations/common/RichTextEditor/markdownHandler.js +128 -0
- package/build/es/components/Interpretations/common/RichTextEditor/styles/RichTextEditor.style.js +9 -0
- package/build/es/components/Interpretations/common/UserMention/UserList.js +33 -0
- package/build/es/components/Interpretations/common/UserMention/UserMentionWrapper.js +202 -0
- package/build/es/components/Interpretations/common/UserMention/styles/UserMentionWrapper.style.js +17 -0
- package/build/es/components/Interpretations/common/UserMention/useUserSearchResults.js +63 -0
- package/build/es/components/Interpretations/common/index.js +3 -0
- package/build/es/components/LegendKey/styles/LegendKey.style.js +2 -2
- package/build/es/index.js +3 -1
- package/build/es/locales/en/translations.json +32 -1
- package/build/es/locales/ro/translations.json +6 -6
- package/build/es/modules/legends.js +6 -2
- package/package.json +3 -2
package/build/cjs/components/Interpretations/common/Interpretation/InterpretationUpdateForm.js
ADDED
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.InterpretationUpdateForm = void 0;
|
|
7
|
+
|
|
8
|
+
var _style = _interopRequireDefault(require("styled-jsx/style"));
|
|
9
|
+
|
|
10
|
+
var _appRuntime = require("@dhis2/app-runtime");
|
|
11
|
+
|
|
12
|
+
var _d2I18n = _interopRequireDefault(require("@dhis2/d2-i18n"));
|
|
13
|
+
|
|
14
|
+
var _ui = require("@dhis2/ui");
|
|
15
|
+
|
|
16
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
17
|
+
|
|
18
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
19
|
+
|
|
20
|
+
var _index = require("../index.js");
|
|
21
|
+
|
|
22
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
23
|
+
|
|
24
|
+
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; }
|
|
25
|
+
|
|
26
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
27
|
+
|
|
28
|
+
const mutation = {
|
|
29
|
+
resource: 'interpretations',
|
|
30
|
+
type: 'update',
|
|
31
|
+
partial: false,
|
|
32
|
+
id: _ref => {
|
|
33
|
+
let {
|
|
34
|
+
id
|
|
35
|
+
} = _ref;
|
|
36
|
+
return id;
|
|
37
|
+
},
|
|
38
|
+
data: _ref2 => {
|
|
39
|
+
let {
|
|
40
|
+
interpretationText
|
|
41
|
+
} = _ref2;
|
|
42
|
+
return interpretationText;
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
const InterpretationUpdateForm = _ref3 => {
|
|
47
|
+
let {
|
|
48
|
+
close,
|
|
49
|
+
currentUser,
|
|
50
|
+
id,
|
|
51
|
+
onComplete,
|
|
52
|
+
showSharingLink,
|
|
53
|
+
text
|
|
54
|
+
} = _ref3;
|
|
55
|
+
const [interpretationText, setInterpretationText] = (0, _react.useState)(text || '');
|
|
56
|
+
const [update, {
|
|
57
|
+
loading,
|
|
58
|
+
error
|
|
59
|
+
}] = (0, _appRuntime.useDataMutation)(mutation, {
|
|
60
|
+
onComplete: () => {
|
|
61
|
+
onComplete();
|
|
62
|
+
close();
|
|
63
|
+
},
|
|
64
|
+
variables: {
|
|
65
|
+
id
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
const errorText = error ? error.message || _d2I18n.default.t('Could not update interpretation') : '';
|
|
69
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
70
|
+
className: _style.default.dynamic([["2690082310", [_ui.spacers.dp8, _ui.spacers.dp8, _ui.colors.grey100]]]) + " " + "message"
|
|
71
|
+
}, /*#__PURE__*/_react.default.createElement(_index.MessageEditorContainer, {
|
|
72
|
+
currentUser: currentUser
|
|
73
|
+
}, /*#__PURE__*/_react.default.createElement(_index.RichTextEditor, {
|
|
74
|
+
inputPlaceholder: _d2I18n.default.t('Enter interpretation text'),
|
|
75
|
+
onChange: setInterpretationText,
|
|
76
|
+
value: interpretationText,
|
|
77
|
+
disabled: loading,
|
|
78
|
+
errorText: errorText
|
|
79
|
+
}), showSharingLink && /*#__PURE__*/_react.default.createElement(_index.InterpretationSharingLink, {
|
|
80
|
+
id: id,
|
|
81
|
+
type: "interpretation"
|
|
82
|
+
}), /*#__PURE__*/_react.default.createElement(_index.MessageButtonStrip, null, /*#__PURE__*/_react.default.createElement(_ui.Button, {
|
|
83
|
+
loading: loading,
|
|
84
|
+
primary: true,
|
|
85
|
+
small: true,
|
|
86
|
+
onClick: () => update({
|
|
87
|
+
interpretationText
|
|
88
|
+
})
|
|
89
|
+
}, _d2I18n.default.t('Update')), /*#__PURE__*/_react.default.createElement(_ui.Button, {
|
|
90
|
+
disabled: loading,
|
|
91
|
+
secondary: true,
|
|
92
|
+
small: true,
|
|
93
|
+
onClick: close
|
|
94
|
+
}, _d2I18n.default.t('Cancel')))), /*#__PURE__*/_react.default.createElement(_style.default, {
|
|
95
|
+
id: "2690082310",
|
|
96
|
+
dynamic: [_ui.spacers.dp8, _ui.spacers.dp8, _ui.colors.grey100]
|
|
97
|
+
}, [".message.__jsx-style-dynamic-selector{padding:0 ".concat(_ui.spacers.dp8, " ").concat(_ui.spacers.dp8, ";background-color:").concat(_ui.colors.grey100, ";border-radius:5px;}")]));
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
exports.InterpretationUpdateForm = InterpretationUpdateForm;
|
|
101
|
+
InterpretationUpdateForm.propTypes = {
|
|
102
|
+
close: _propTypes.default.func.isRequired,
|
|
103
|
+
currentUser: _propTypes.default.object.isRequired,
|
|
104
|
+
id: _propTypes.default.string.isRequired,
|
|
105
|
+
onComplete: _propTypes.default.func.isRequired,
|
|
106
|
+
showSharingLink: _propTypes.default.bool,
|
|
107
|
+
text: _propTypes.default.string
|
|
108
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "Interpretation", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function () {
|
|
9
|
+
return _Interpretation.Interpretation;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
Object.defineProperty(exports, "InterpretationSharingLink", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function () {
|
|
15
|
+
return _InterpretationSharingLink.InterpretationSharingLink;
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
var _Interpretation = require("./Interpretation.js");
|
|
20
|
+
|
|
21
|
+
var _InterpretationSharingLink = require("./InterpretationSharingLink.js");
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.useLike = void 0;
|
|
7
|
+
|
|
8
|
+
var _appRuntime = require("@dhis2/app-runtime");
|
|
9
|
+
|
|
10
|
+
var _react = require("react");
|
|
11
|
+
|
|
12
|
+
const useLike = _ref => {
|
|
13
|
+
let {
|
|
14
|
+
interpretation,
|
|
15
|
+
currentUser,
|
|
16
|
+
onComplete
|
|
17
|
+
} = _ref;
|
|
18
|
+
const resource = "interpretations/".concat(interpretation.id, "/like");
|
|
19
|
+
const likeMutationRef = (0, _react.useRef)({
|
|
20
|
+
resource,
|
|
21
|
+
type: 'create'
|
|
22
|
+
});
|
|
23
|
+
const unlikeMutationRef = (0, _react.useRef)({
|
|
24
|
+
resource,
|
|
25
|
+
type: 'delete'
|
|
26
|
+
});
|
|
27
|
+
const [like, {
|
|
28
|
+
loading: likeLoading
|
|
29
|
+
}] = (0, _appRuntime.useDataMutation)(likeMutationRef.current, {
|
|
30
|
+
onComplete
|
|
31
|
+
});
|
|
32
|
+
const [unlike, {
|
|
33
|
+
loading: unlikeLoading
|
|
34
|
+
}] = (0, _appRuntime.useDataMutation)(unlikeMutationRef.current, {
|
|
35
|
+
onComplete
|
|
36
|
+
});
|
|
37
|
+
const [isLikedByCurrentUser, setIsLikedByCurrentUser] = (0, _react.useState)(false);
|
|
38
|
+
|
|
39
|
+
const toggleLike = () => {
|
|
40
|
+
isLikedByCurrentUser ? unlike() : like();
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
(0, _react.useEffect)(() => {
|
|
44
|
+
setIsLikedByCurrentUser(interpretation.likedBy.some(likedBy => likedBy.id === currentUser.id));
|
|
45
|
+
}, [currentUser, interpretation]);
|
|
46
|
+
return {
|
|
47
|
+
isLikedByCurrentUser,
|
|
48
|
+
toggleLike,
|
|
49
|
+
toggleLikeInProgress: likeLoading || unlikeLoading
|
|
50
|
+
};
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
exports.useLike = useLike;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.Message = void 0;
|
|
7
|
+
|
|
8
|
+
var _style = _interopRequireDefault(require("styled-jsx/style"));
|
|
9
|
+
|
|
10
|
+
var _d2UiRichText = require("@dhis2/d2-ui-rich-text");
|
|
11
|
+
|
|
12
|
+
var _ui = require("@dhis2/ui");
|
|
13
|
+
|
|
14
|
+
var _moment = _interopRequireDefault(require("moment"));
|
|
15
|
+
|
|
16
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
17
|
+
|
|
18
|
+
var _react = _interopRequireDefault(require("react"));
|
|
19
|
+
|
|
20
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
21
|
+
|
|
22
|
+
const Message = _ref => {
|
|
23
|
+
let {
|
|
24
|
+
children,
|
|
25
|
+
text,
|
|
26
|
+
created,
|
|
27
|
+
username
|
|
28
|
+
} = _ref;
|
|
29
|
+
return /*#__PURE__*/_react.default.createElement("li", {
|
|
30
|
+
className: _style.default.dynamic([["2436588813", [_ui.spacers.dp8, _ui.colors.grey100, _ui.spacers.dp8, _ui.colors.grey900, _ui.colors.grey600, _ui.colors.grey900, _ui.spacers.dp8]]]) + " " + "container"
|
|
31
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
32
|
+
className: _style.default.dynamic([["2436588813", [_ui.spacers.dp8, _ui.colors.grey100, _ui.spacers.dp8, _ui.colors.grey900, _ui.colors.grey600, _ui.colors.grey900, _ui.spacers.dp8]]]) + " " + "header"
|
|
33
|
+
}, /*#__PURE__*/_react.default.createElement(_ui.UserAvatar, {
|
|
34
|
+
name: username,
|
|
35
|
+
extrasmall: true
|
|
36
|
+
}), username, /*#__PURE__*/_react.default.createElement("time", {
|
|
37
|
+
dateTime: created,
|
|
38
|
+
className: _style.default.dynamic([["2436588813", [_ui.spacers.dp8, _ui.colors.grey100, _ui.spacers.dp8, _ui.colors.grey900, _ui.colors.grey600, _ui.colors.grey900, _ui.spacers.dp8]]])
|
|
39
|
+
}, (0, _moment.default)(created).format('lll'))), /*#__PURE__*/_react.default.createElement("div", {
|
|
40
|
+
className: _style.default.dynamic([["2436588813", [_ui.spacers.dp8, _ui.colors.grey100, _ui.spacers.dp8, _ui.colors.grey900, _ui.colors.grey600, _ui.colors.grey900, _ui.spacers.dp8]]]) + " " + "content"
|
|
41
|
+
}, /*#__PURE__*/_react.default.createElement(_d2UiRichText.Parser, null, text)), /*#__PURE__*/_react.default.createElement("div", {
|
|
42
|
+
className: _style.default.dynamic([["2436588813", [_ui.spacers.dp8, _ui.colors.grey100, _ui.spacers.dp8, _ui.colors.grey900, _ui.colors.grey600, _ui.colors.grey900, _ui.spacers.dp8]]]) + " " + "footer"
|
|
43
|
+
}, children), /*#__PURE__*/_react.default.createElement(_style.default, {
|
|
44
|
+
id: "2436588813",
|
|
45
|
+
dynamic: [_ui.spacers.dp8, _ui.colors.grey100, _ui.spacers.dp8, _ui.colors.grey900, _ui.colors.grey600, _ui.colors.grey900, _ui.spacers.dp8]
|
|
46
|
+
}, [".container.__jsx-style-dynamic-selector{padding:".concat(_ui.spacers.dp8, ";background-color:").concat(_ui.colors.grey100, ";border-radius:5px;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;gap:").concat(_ui.spacers.dp8, ";}"), ".header.__jsx-style-dynamic-selector{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;gap:6px;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;font-size:13px;line-height:16px;color:".concat(_ui.colors.grey900, ";}"), ".header.__jsx-style-dynamic-selector time.__jsx-style-dynamic-selector{font-size:12px;color:".concat(_ui.colors.grey600, ";}"), ".content.__jsx-style-dynamic-selector{font-size:14px;line-height:19px;color:".concat(_ui.colors.grey900, ";}"), ".content.__jsx-style-dynamic-selector p:first-child{margin:0;}", ".footer.__jsx-style-dynamic-selector{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;-webkit-align-items:flex-start;-webkit-box-align:flex-start;-ms-flex-align:flex-start;align-items:flex-start;gap:".concat(_ui.spacers.dp8, ";}")]));
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
exports.Message = Message;
|
|
50
|
+
Message.propTypes = {
|
|
51
|
+
children: _propTypes.default.node.isRequired,
|
|
52
|
+
created: _propTypes.default.string.isRequired,
|
|
53
|
+
text: _propTypes.default.string.isRequired,
|
|
54
|
+
username: _propTypes.default.string.isRequired
|
|
55
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.MessageButtonStrip = void 0;
|
|
7
|
+
|
|
8
|
+
var _style = _interopRequireDefault(require("styled-jsx/style"));
|
|
9
|
+
|
|
10
|
+
var _ui = require("@dhis2/ui");
|
|
11
|
+
|
|
12
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
13
|
+
|
|
14
|
+
var _react = _interopRequireDefault(require("react"));
|
|
15
|
+
|
|
16
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
|
+
|
|
18
|
+
const MessageButtonStrip = _ref => {
|
|
19
|
+
let {
|
|
20
|
+
children
|
|
21
|
+
} = _ref;
|
|
22
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
23
|
+
className: _style.default.dynamic([["1819118406", [_ui.spacers.dp8, _ui.spacers.dp8]]]) + " " + "container"
|
|
24
|
+
}, children, /*#__PURE__*/_react.default.createElement(_style.default, {
|
|
25
|
+
id: "1819118406",
|
|
26
|
+
dynamic: [_ui.spacers.dp8, _ui.spacers.dp8]
|
|
27
|
+
}, [".container.__jsx-style-dynamic-selector{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;gap:".concat(_ui.spacers.dp8, ";margin-top:").concat(_ui.spacers.dp8, ";}")]));
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
exports.MessageButtonStrip = MessageButtonStrip;
|
|
31
|
+
MessageButtonStrip.propTypes = {
|
|
32
|
+
children: _propTypes.default.node.isRequired
|
|
33
|
+
};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.MessageEditorContainer = void 0;
|
|
7
|
+
|
|
8
|
+
var _style = _interopRequireDefault(require("styled-jsx/style"));
|
|
9
|
+
|
|
10
|
+
var _ui = require("@dhis2/ui");
|
|
11
|
+
|
|
12
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
13
|
+
|
|
14
|
+
var _react = _interopRequireDefault(require("react"));
|
|
15
|
+
|
|
16
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
|
+
|
|
18
|
+
const MessageEditorContainer = _ref => {
|
|
19
|
+
let {
|
|
20
|
+
children,
|
|
21
|
+
currentUser
|
|
22
|
+
} = _ref;
|
|
23
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
24
|
+
className: _style.default.dynamic([["3807884305", [_ui.spacers.dp8, _ui.spacers.dp12]]]) + " " + "container"
|
|
25
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
26
|
+
className: _style.default.dynamic([["3807884305", [_ui.spacers.dp8, _ui.spacers.dp12]]]) + " " + "avatar"
|
|
27
|
+
}, /*#__PURE__*/_react.default.createElement(_ui.UserAvatar, {
|
|
28
|
+
name: currentUser.name,
|
|
29
|
+
medium: true
|
|
30
|
+
})), /*#__PURE__*/_react.default.createElement("div", {
|
|
31
|
+
className: _style.default.dynamic([["3807884305", [_ui.spacers.dp8, _ui.spacers.dp12]]]) + " " + "editor"
|
|
32
|
+
}, children), /*#__PURE__*/_react.default.createElement(_style.default, {
|
|
33
|
+
id: "3807884305",
|
|
34
|
+
dynamic: [_ui.spacers.dp8, _ui.spacers.dp12]
|
|
35
|
+
}, [".container.__jsx-style-dynamic-selector{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;gap:".concat(_ui.spacers.dp8, ";margin-top:").concat(_ui.spacers.dp12, ";}"), ".avatar.__jsx-style-dynamic-selector{-webkit-box-flex:0;-webkit-flex-grow:0;-ms-flex-positive:0;flex-grow:0;}", ".editor.__jsx-style-dynamic-selector{-webkit-box-flex:1;-webkit-flex-grow:1;-ms-flex-positive:1;flex-grow:1;}"]));
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
exports.MessageEditorContainer = MessageEditorContainer;
|
|
39
|
+
MessageEditorContainer.propTypes = {
|
|
40
|
+
currentUser: _propTypes.default.object.isRequired,
|
|
41
|
+
children: _propTypes.default.node
|
|
42
|
+
};
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.MessageIconButton = void 0;
|
|
7
|
+
|
|
8
|
+
var _style = _interopRequireDefault(require("styled-jsx/style"));
|
|
9
|
+
|
|
10
|
+
var _ui = require("@dhis2/ui");
|
|
11
|
+
|
|
12
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
13
|
+
|
|
14
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
15
|
+
|
|
16
|
+
var _react = _interopRequireDefault(require("react"));
|
|
17
|
+
|
|
18
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19
|
+
|
|
20
|
+
const MessageIconButton = _ref => {
|
|
21
|
+
let {
|
|
22
|
+
tooltipContent,
|
|
23
|
+
disabled,
|
|
24
|
+
onClick,
|
|
25
|
+
selected,
|
|
26
|
+
count,
|
|
27
|
+
iconComponent: Icon
|
|
28
|
+
} = _ref;
|
|
29
|
+
return /*#__PURE__*/_react.default.createElement(_ui.Tooltip, {
|
|
30
|
+
closeDelay: 200,
|
|
31
|
+
content: tooltipContent
|
|
32
|
+
}, _ref2 => {
|
|
33
|
+
let {
|
|
34
|
+
ref,
|
|
35
|
+
onMouseOver,
|
|
36
|
+
onMouseOut
|
|
37
|
+
} = _ref2;
|
|
38
|
+
return /*#__PURE__*/_react.default.createElement("span", {
|
|
39
|
+
ref: ref,
|
|
40
|
+
onMouseOver: onMouseOver,
|
|
41
|
+
onMouseOut: onMouseOut,
|
|
42
|
+
className: _style.default.dynamic([["3807261824", [_ui.spacers.dp4, _ui.colors.grey700, _ui.colors.teal600, _ui.colors.grey900, _ui.colors.teal800, _ui.colors.teal500, _ui.colors.teal700]]]) + " " + "wrapper"
|
|
43
|
+
}, /*#__PURE__*/_react.default.createElement("button", {
|
|
44
|
+
onClick: event => {
|
|
45
|
+
event.stopPropagation();
|
|
46
|
+
onClick();
|
|
47
|
+
},
|
|
48
|
+
disabled: disabled,
|
|
49
|
+
className: _style.default.dynamic([["3807261824", [_ui.spacers.dp4, _ui.colors.grey700, _ui.colors.teal600, _ui.colors.grey900, _ui.colors.teal800, _ui.colors.teal500, _ui.colors.teal700]]]) + " " + ((0, _classnames.default)('button', {
|
|
50
|
+
selected
|
|
51
|
+
}) || "")
|
|
52
|
+
}, count && count, /*#__PURE__*/_react.default.createElement(Icon, null)), /*#__PURE__*/_react.default.createElement(_style.default, {
|
|
53
|
+
id: "3807261824",
|
|
54
|
+
dynamic: [_ui.spacers.dp4, _ui.colors.grey700, _ui.colors.teal600, _ui.colors.grey900, _ui.colors.teal800, _ui.colors.teal500, _ui.colors.teal700]
|
|
55
|
+
}, [".wrapper.__jsx-style-dynamic-selector{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;}", ".button.__jsx-style-dynamic-selector{all:unset;cursor:pointer;display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;-webkit-flex-direction:row;-ms-flex-direction:row;flex-direction:row;gap:".concat(_ui.spacers.dp4, ";-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;font-size:12px;line-height:14px;color:").concat(_ui.colors.grey700, ";}"), ".button.selected.__jsx-style-dynamic-selector{color:".concat(_ui.colors.teal600, ";font-weight:500;}"), ".button.__jsx-style-dynamic-selector:hover{color:".concat(_ui.colors.grey900, ";}"), ".button.selected.__jsx-style-dynamic-selector:hover{color:".concat(_ui.colors.teal800, ";}"), ".button.selected.__jsx-style-dynamic-selector svg{color:".concat(_ui.colors.teal500, ";}"), ".button.selected.__jsx-style-dynamic-selector:hover svg{color:".concat(_ui.colors.teal700, ";}")]));
|
|
56
|
+
});
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
exports.MessageIconButton = MessageIconButton;
|
|
60
|
+
MessageIconButton.propTypes = {
|
|
61
|
+
iconComponent: _propTypes.default.oneOfType([_propTypes.default.object, _propTypes.default.func]).isRequired,
|
|
62
|
+
tooltipContent: _propTypes.default.string.isRequired,
|
|
63
|
+
count: _propTypes.default.number,
|
|
64
|
+
disabled: _propTypes.default.bool,
|
|
65
|
+
selected: _propTypes.default.bool,
|
|
66
|
+
onClick: _propTypes.default.func
|
|
67
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.MessageInput = void 0;
|
|
7
|
+
|
|
8
|
+
var _style = _interopRequireDefault(require("styled-jsx/style"));
|
|
9
|
+
|
|
10
|
+
var _ui = require("@dhis2/ui");
|
|
11
|
+
|
|
12
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
13
|
+
|
|
14
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
15
|
+
|
|
16
|
+
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; }
|
|
17
|
+
|
|
18
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19
|
+
|
|
20
|
+
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
21
|
+
|
|
22
|
+
const MessageInput = /*#__PURE__*/(0, _react.forwardRef)((props, ref) => /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("input", _extends({
|
|
23
|
+
ref: ref
|
|
24
|
+
}, props, {
|
|
25
|
+
className: _style.default.dynamic([["2769305849", [_ui.colors.grey900, _ui.colors.grey500, _ui.theme.focus, _ui.colors.grey100, _ui.colors.grey500, _ui.theme.disabled]]]) + " " + (props && props.className != null && props.className || "input")
|
|
26
|
+
})), /*#__PURE__*/_react.default.createElement(_style.default, {
|
|
27
|
+
id: "2769305849",
|
|
28
|
+
dynamic: [_ui.colors.grey900, _ui.colors.grey500, _ui.theme.focus, _ui.colors.grey100, _ui.colors.grey500, _ui.theme.disabled]
|
|
29
|
+
}, [".input.__jsx-style-dynamic-selector{width:100%;box-sizing:border-box;font-size:14px;line-height:16px;-webkit-user-select:text;-moz-user-select:text;-ms-user-select:text;user-select:text;color:".concat(_ui.colors.grey900, ";background-color:white;padding:12px 11px 10px;outline:0;border:1px solid ").concat(_ui.colors.grey500, ";border-radius:3px;box-shadow:inset 0 1px 2px 0 rgba(48,54,60,0.1);text-overflow:ellipsis;}"), "input.__jsx-style-dynamic-selector:focus{outline:none;box-shadow:0 0 0 3px ".concat(_ui.theme.focus, ";}"), "input.disabled.__jsx-style-dynamic-selector{background-color:".concat(_ui.colors.grey100, ";border-color:").concat(_ui.colors.grey500, ";color:").concat(_ui.theme.disabled, ";cursor:not-allowed;}")])));
|
|
30
|
+
exports.MessageInput = MessageInput;
|
|
31
|
+
MessageInput.displayName = 'MessageInput';
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.MessageStatsBar = void 0;
|
|
7
|
+
|
|
8
|
+
var _style = _interopRequireDefault(require("styled-jsx/style"));
|
|
9
|
+
|
|
10
|
+
var _ui = require("@dhis2/ui");
|
|
11
|
+
|
|
12
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
13
|
+
|
|
14
|
+
var _react = _interopRequireDefault(require("react"));
|
|
15
|
+
|
|
16
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
|
+
|
|
18
|
+
const MessageStatsBar = _ref => {
|
|
19
|
+
let {
|
|
20
|
+
children
|
|
21
|
+
} = _ref;
|
|
22
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
23
|
+
className: _style.default.dynamic([["2534339265", [_ui.spacers.dp12]]]) + " " + "container"
|
|
24
|
+
}, children, /*#__PURE__*/_react.default.createElement(_style.default, {
|
|
25
|
+
id: "2534339265",
|
|
26
|
+
dynamic: [_ui.spacers.dp12]
|
|
27
|
+
}, [".container.__jsx-style-dynamic-selector{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;gap:".concat(_ui.spacers.dp12, ";}")]));
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
exports.MessageStatsBar = MessageStatsBar;
|
|
31
|
+
MessageStatsBar.propTypes = {
|
|
32
|
+
children: _propTypes.default.node.isRequired
|
|
33
|
+
};
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "Message", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function () {
|
|
9
|
+
return _Message.Message;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
Object.defineProperty(exports, "MessageButtonStrip", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function () {
|
|
15
|
+
return _MessageButtonStrip.MessageButtonStrip;
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
Object.defineProperty(exports, "MessageEditorContainer", {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: function () {
|
|
21
|
+
return _MessageEditorContainer.MessageEditorContainer;
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
Object.defineProperty(exports, "MessageIconButton", {
|
|
25
|
+
enumerable: true,
|
|
26
|
+
get: function () {
|
|
27
|
+
return _MessageIconButton.MessageIconButton;
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
Object.defineProperty(exports, "MessageInput", {
|
|
31
|
+
enumerable: true,
|
|
32
|
+
get: function () {
|
|
33
|
+
return _MessageInput.MessageInput;
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
Object.defineProperty(exports, "MessageStatsBar", {
|
|
37
|
+
enumerable: true,
|
|
38
|
+
get: function () {
|
|
39
|
+
return _MessageStatsBar.MessageStatsBar;
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
var _Message = require("./Message.js");
|
|
44
|
+
|
|
45
|
+
var _MessageButtonStrip = require("./MessageButtonStrip.js");
|
|
46
|
+
|
|
47
|
+
var _MessageIconButton = require("./MessageIconButton.js");
|
|
48
|
+
|
|
49
|
+
var _MessageInput = require("./MessageInput.js");
|
|
50
|
+
|
|
51
|
+
var _MessageEditorContainer = require("./MessageEditorContainer.js");
|
|
52
|
+
|
|
53
|
+
var _MessageStatsBar = require("./MessageStatsBar.js");
|