@dhis2/analytics 23.11.0 → 23.12.1
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/index.js +16 -0
- package/build/cjs/locales/ar/translations.json +32 -1
- package/build/cjs/locales/ar_EG/translations.json +32 -1
- package/build/cjs/locales/ar_IQ/translations.json +32 -1
- package/build/cjs/locales/ckb/translations.json +32 -1
- package/build/cjs/locales/cs/translations.json +32 -1
- package/build/cjs/locales/da/translations.json +32 -1
- package/build/cjs/locales/en/translations.json +32 -1
- package/build/cjs/locales/es/translations.json +32 -1
- package/build/cjs/locales/fr/translations.json +32 -1
- package/build/cjs/locales/id/translations.json +32 -1
- package/build/cjs/locales/km/translations.json +32 -1
- package/build/cjs/locales/lo/translations.json +32 -1
- package/build/cjs/locales/my/translations.json +32 -1
- package/build/cjs/locales/nb/translations.json +32 -1
- package/build/cjs/locales/nl/translations.json +32 -1
- package/build/cjs/locales/or/translations.json +32 -1
- package/build/cjs/locales/prs/translations.json +32 -1
- package/build/cjs/locales/ps/translations.json +32 -1
- package/build/cjs/locales/pt/translations.json +32 -1
- package/build/cjs/locales/pt_BR/translations.json +32 -1
- package/build/cjs/locales/ro/translations.json +38 -7
- package/build/cjs/locales/ru/translations.json +32 -1
- package/build/cjs/locales/sv/translations.json +32 -1
- package/build/cjs/locales/tet/translations.json +32 -1
- package/build/cjs/locales/tg/translations.json +32 -1
- package/build/cjs/locales/uk/translations.json +32 -1
- package/build/cjs/locales/ur/translations.json +32 -1
- package/build/cjs/locales/uz/translations.json +32 -1
- package/build/cjs/locales/uz_Latn/translations.json +32 -1
- package/build/cjs/locales/vi/translations.json +32 -1
- package/build/cjs/locales/zh/translations.json +32 -1
- package/build/cjs/locales/zh_CN/translations.json +32 -1
- 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/index.js +2 -0
- package/build/es/locales/ar/translations.json +32 -1
- package/build/es/locales/ar_EG/translations.json +32 -1
- package/build/es/locales/ar_IQ/translations.json +32 -1
- package/build/es/locales/ckb/translations.json +32 -1
- package/build/es/locales/cs/translations.json +32 -1
- package/build/es/locales/da/translations.json +32 -1
- package/build/es/locales/en/translations.json +32 -1
- package/build/es/locales/es/translations.json +32 -1
- package/build/es/locales/fr/translations.json +32 -1
- package/build/es/locales/id/translations.json +32 -1
- package/build/es/locales/km/translations.json +32 -1
- package/build/es/locales/lo/translations.json +32 -1
- package/build/es/locales/my/translations.json +32 -1
- package/build/es/locales/nb/translations.json +32 -1
- package/build/es/locales/nl/translations.json +32 -1
- package/build/es/locales/or/translations.json +32 -1
- package/build/es/locales/prs/translations.json +32 -1
- package/build/es/locales/ps/translations.json +32 -1
- package/build/es/locales/pt/translations.json +32 -1
- package/build/es/locales/pt_BR/translations.json +32 -1
- package/build/es/locales/ro/translations.json +38 -7
- package/build/es/locales/ru/translations.json +32 -1
- package/build/es/locales/sv/translations.json +32 -1
- package/build/es/locales/tet/translations.json +32 -1
- package/build/es/locales/tg/translations.json +32 -1
- package/build/es/locales/uk/translations.json +32 -1
- package/build/es/locales/ur/translations.json +32 -1
- package/build/es/locales/uz/translations.json +32 -1
- package/build/es/locales/uz_Latn/translations.json +32 -1
- package/build/es/locales/vi/translations.json +32 -1
- package/build/es/locales/zh/translations.json +32 -1
- package/build/es/locales/zh_CN/translations.json +32 -1
- package/package.json +2 -1
|
@@ -0,0 +1,226 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = exports.UserMentionWrapper = void 0;
|
|
7
|
+
|
|
8
|
+
var _style = _interopRequireDefault(require("styled-jsx/style"));
|
|
9
|
+
|
|
10
|
+
var _d2I18n = _interopRequireDefault(require("@dhis2/d2-i18n"));
|
|
11
|
+
|
|
12
|
+
var _ui = require("@dhis2/ui");
|
|
13
|
+
|
|
14
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
15
|
+
|
|
16
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
17
|
+
|
|
18
|
+
var _UserMentionWrapperStyle = require("./styles/UserMentionWrapper.style.js");
|
|
19
|
+
|
|
20
|
+
var _UserList = require("./UserList.js");
|
|
21
|
+
|
|
22
|
+
var _useUserSearchResults = require("./useUserSearchResults.js");
|
|
23
|
+
|
|
24
|
+
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); }
|
|
25
|
+
|
|
26
|
+
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; }
|
|
27
|
+
|
|
28
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
29
|
+
|
|
30
|
+
const AT_SYMBOL_WIDTH = 14;
|
|
31
|
+
|
|
32
|
+
const getVirtualPopperReference = ref => {
|
|
33
|
+
const rects = ref.current.getClientRects();
|
|
34
|
+
const lastRect = rects[rects.length - 1];
|
|
35
|
+
const left = lastRect.left + lastRect.width - AT_SYMBOL_WIDTH;
|
|
36
|
+
return {
|
|
37
|
+
getBoundingClientRect: () => ({
|
|
38
|
+
top: lastRect.top,
|
|
39
|
+
right: lastRect.right,
|
|
40
|
+
bottom: lastRect.bottom,
|
|
41
|
+
left,
|
|
42
|
+
width: AT_SYMBOL_WIDTH,
|
|
43
|
+
height: lastRect.height,
|
|
44
|
+
x: left
|
|
45
|
+
})
|
|
46
|
+
};
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
const UserMentionWrapper = _ref => {
|
|
50
|
+
let {
|
|
51
|
+
children,
|
|
52
|
+
inputReference,
|
|
53
|
+
onUserSelect
|
|
54
|
+
} = _ref;
|
|
55
|
+
const [captureText, setCaptureText] = (0, _react.useState)(false);
|
|
56
|
+
const [capturedText, setCapturedText] = (0, _react.useState)('');
|
|
57
|
+
const [cloneText, setCloneText] = (0, _react.useState)('');
|
|
58
|
+
const cloneRef = (0, _react.useRef)(null);
|
|
59
|
+
const [captureStartPosition, setCaptureStartPosition] = (0, _react.useState)(null);
|
|
60
|
+
const [selectedUserIndex, setSelectedUserIndex] = (0, _react.useState)(0);
|
|
61
|
+
const {
|
|
62
|
+
users,
|
|
63
|
+
pager,
|
|
64
|
+
fetching,
|
|
65
|
+
clear
|
|
66
|
+
} = (0, _useUserSearchResults.useUserSearchResults)({
|
|
67
|
+
searchText: capturedText
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
const reset = () => {
|
|
71
|
+
setCaptureText(false);
|
|
72
|
+
setCapturedText('');
|
|
73
|
+
setCloneText('');
|
|
74
|
+
setCaptureStartPosition(null);
|
|
75
|
+
setSelectedUserIndex(0);
|
|
76
|
+
clear();
|
|
77
|
+
}; // event bubbles up from the input/textarea
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
const onInput = _ref2 => {
|
|
81
|
+
let {
|
|
82
|
+
target
|
|
83
|
+
} = _ref2;
|
|
84
|
+
const {
|
|
85
|
+
selectionEnd,
|
|
86
|
+
value
|
|
87
|
+
} = target;
|
|
88
|
+
|
|
89
|
+
if (captureText) {
|
|
90
|
+
clear();
|
|
91
|
+
const spacePosition = value.indexOf(' ', captureStartPosition - 1);
|
|
92
|
+
const filterValue = value.substring(captureStartPosition, spacePosition > 0 ? spacePosition : selectionEnd + 1);
|
|
93
|
+
|
|
94
|
+
if (filterValue !== capturedText) {
|
|
95
|
+
setCapturedText(filterValue);
|
|
96
|
+
} else if (filterValue.length === 0) {
|
|
97
|
+
setCapturedText('');
|
|
98
|
+
clear();
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
}; // event bubbles up from the wrapped input/textarea
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
const onKeyDown = _ref3 => {
|
|
105
|
+
let {
|
|
106
|
+
key,
|
|
107
|
+
target
|
|
108
|
+
} = _ref3;
|
|
109
|
+
const {
|
|
110
|
+
selectionStart
|
|
111
|
+
} = target;
|
|
112
|
+
|
|
113
|
+
if (!captureText && key === '@') {
|
|
114
|
+
setCaptureText(true);
|
|
115
|
+
setCaptureStartPosition(selectionStart + 1);
|
|
116
|
+
setCloneText(target.value.substring(0, selectionStart) + '@');
|
|
117
|
+
} else if (captureText) {
|
|
118
|
+
if (key === ' ' || key === 'Backspace' && selectionStart <= captureStartPosition) {
|
|
119
|
+
reset();
|
|
120
|
+
} else if (users.length) {
|
|
121
|
+
switch (key) {
|
|
122
|
+
case 'Enter':
|
|
123
|
+
event.preventDefault();
|
|
124
|
+
|
|
125
|
+
if (selectedUserIndex >= 0) {
|
|
126
|
+
onSelect(users[selectedUserIndex]);
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
break;
|
|
130
|
+
|
|
131
|
+
case 'ArrowDown':
|
|
132
|
+
event.preventDefault();
|
|
133
|
+
|
|
134
|
+
if (selectedUserIndex < users.length - 1) {
|
|
135
|
+
setSelectedUserIndex(selectedUserIndex + 1);
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
break;
|
|
139
|
+
|
|
140
|
+
case 'ArrowUp':
|
|
141
|
+
event.preventDefault();
|
|
142
|
+
|
|
143
|
+
if (selectedUserIndex > 0) {
|
|
144
|
+
setSelectedUserIndex(selectedUserIndex - 1);
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
break;
|
|
148
|
+
|
|
149
|
+
default: // other key strokes, typically the text typed
|
|
150
|
+
// the onInput event handler set on the input element is triggering the user lookup
|
|
151
|
+
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
};
|
|
156
|
+
|
|
157
|
+
const onSelect = user => {
|
|
158
|
+
const originalValue = inputReference.current.value;
|
|
159
|
+
const newValue = "".concat(originalValue.slice(0, captureStartPosition - 1)).concat(originalValue.slice(captureStartPosition - 1).replace(/^@\w*/, "@".concat(user.username, " ")));
|
|
160
|
+
reset(); // typically for connected components we want the state to be updated too
|
|
161
|
+
// but the logic belongs to the wrapped component, so we just invoke the supplied callback
|
|
162
|
+
|
|
163
|
+
if (onUserSelect) {
|
|
164
|
+
onUserSelect(newValue);
|
|
165
|
+
} // need to refocus on the input/textarea
|
|
166
|
+
|
|
167
|
+
|
|
168
|
+
inputReference.current.focus(); // position the cursor at the end
|
|
169
|
+
|
|
170
|
+
requestAnimationFrame(() => inputReference.current.setSelectionRange(-1, -1), 0);
|
|
171
|
+
};
|
|
172
|
+
|
|
173
|
+
const onClick = user => () => onSelect(user);
|
|
174
|
+
|
|
175
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
176
|
+
onKeyDown: onKeyDown,
|
|
177
|
+
onInput: onInput,
|
|
178
|
+
className: "jsx-".concat(_UserMentionWrapperStyle.userMentionWrapperClasses.__hash) + " " + "wrapper"
|
|
179
|
+
}, children, /*#__PURE__*/_react.default.createElement("div", {
|
|
180
|
+
className: "jsx-".concat(_UserMentionWrapperStyle.userMentionWrapperClasses.__hash) + " " + "clone"
|
|
181
|
+
}, /*#__PURE__*/_react.default.createElement("pre", {
|
|
182
|
+
ref: cloneRef,
|
|
183
|
+
className: "jsx-".concat(_UserMentionWrapperStyle.userMentionWrapperClasses.__hash)
|
|
184
|
+
}, cloneText)), captureText && /*#__PURE__*/_react.default.createElement(_ui.Portal, null, /*#__PURE__*/_react.default.createElement(_ui.Popper, {
|
|
185
|
+
reference: getVirtualPopperReference(cloneRef),
|
|
186
|
+
placement: "top-start"
|
|
187
|
+
}, /*#__PURE__*/_react.default.createElement(_ui.Card, null, /*#__PURE__*/_react.default.createElement("div", {
|
|
188
|
+
className: "jsx-".concat(_UserMentionWrapperStyle.userMentionWrapperClasses.__hash) + " " + "container"
|
|
189
|
+
}, /*#__PURE__*/_react.default.createElement(_ui.Menu, {
|
|
190
|
+
dense: true
|
|
191
|
+
}, /*#__PURE__*/_react.default.createElement(_ui.MenuSectionHeader, {
|
|
192
|
+
className: _UserMentionWrapperStyle.resolvedHeaderStyle.className,
|
|
193
|
+
dense: true,
|
|
194
|
+
hideDivider: true,
|
|
195
|
+
label: capturedText === '' ? _d2I18n.default.t('Search for a user') : _d2I18n.default.t('Searching for "{{searchText}}"', {
|
|
196
|
+
searchText: capturedText
|
|
197
|
+
})
|
|
198
|
+
}), fetching && /*#__PURE__*/_react.default.createElement(_ui.MenuItem, {
|
|
199
|
+
label: /*#__PURE__*/_react.default.createElement(_ui.CenteredContent, null, /*#__PURE__*/_react.default.createElement(_ui.CircularLoader, {
|
|
200
|
+
small: true
|
|
201
|
+
}))
|
|
202
|
+
}), !fetching && users.length > 0 && /*#__PURE__*/_react.default.createElement(_UserList.UserList, {
|
|
203
|
+
users: users,
|
|
204
|
+
selectedUserIndex: selectedUserIndex,
|
|
205
|
+
onUserClick: onClick,
|
|
206
|
+
pager: pager
|
|
207
|
+
}), capturedText && !fetching && users.length === 0 && /*#__PURE__*/_react.default.createElement(_ui.MenuItem, {
|
|
208
|
+
dense: true,
|
|
209
|
+
disabled: true,
|
|
210
|
+
label: _d2I18n.default.t('No results found')
|
|
211
|
+
})))))), /*#__PURE__*/_react.default.createElement(_style.default, {
|
|
212
|
+
id: _UserMentionWrapperStyle.userMentionWrapperClasses.__hash
|
|
213
|
+
}, _UserMentionWrapperStyle.userMentionWrapperClasses), _UserMentionWrapperStyle.resolvedHeaderStyle.styles);
|
|
214
|
+
};
|
|
215
|
+
|
|
216
|
+
exports.UserMentionWrapper = UserMentionWrapper;
|
|
217
|
+
UserMentionWrapper.defaultProps = {
|
|
218
|
+
onUserSelect: Function.prototype
|
|
219
|
+
};
|
|
220
|
+
UserMentionWrapper.propTypes = {
|
|
221
|
+
inputReference: _propTypes.default.object.isRequired,
|
|
222
|
+
onUserSelect: _propTypes.default.func.isRequired,
|
|
223
|
+
children: _propTypes.default.node
|
|
224
|
+
};
|
|
225
|
+
var _default = UserMentionWrapper;
|
|
226
|
+
exports.default = _default;
|
package/build/cjs/components/Interpretations/common/UserMention/styles/UserMentionWrapper.style.js
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.userMentionWrapperClasses = exports.resolvedHeaderStyle = void 0;
|
|
7
|
+
|
|
8
|
+
var _style = _interopRequireDefault(require("styled-jsx/style"));
|
|
9
|
+
|
|
10
|
+
var _react = _interopRequireDefault(require("react"));
|
|
11
|
+
|
|
12
|
+
var _ui = require("@dhis2/ui");
|
|
13
|
+
|
|
14
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
|
+
|
|
16
|
+
/*
|
|
17
|
+
* Note that the clone and clone > pre styles have been chosen
|
|
18
|
+
* to emulate the styles of the textarea. If we decide to make
|
|
19
|
+
* changes there, they should be refelcted here too.
|
|
20
|
+
*/
|
|
21
|
+
const userMentionWrapperClasses = [".wrapper.jsx-1289989717{position:relative;}", ".clone.jsx-1289989717{position:absolute;visibility:hidden;inset:0;box-sizing:border-box;padding:".concat(_ui.spacers.dp8, " ").concat(_ui.spacers.dp12, ";border:1px solid ").concat(_ui.colors.grey500, ";font-size:14px;line-height:").concat(_ui.spacers.dp16, ";z-index:1;pointer-events:none;}"), ".clone.jsx-1289989717>pre.jsx-1289989717{display:inline;word-wrap:break-word;overflow-wrap:break-word;font:inherit;margin:0;}", ".container.jsx-1289989717{background-color:".concat(_ui.colors.white, ";max-height:180px;overflow:auto;}")];
|
|
22
|
+
exports.userMentionWrapperClasses = userMentionWrapperClasses;
|
|
23
|
+
userMentionWrapperClasses.__hash = "1289989717";
|
|
24
|
+
const resolvedHeaderStyle = {
|
|
25
|
+
styles: /*#__PURE__*/_react.default.createElement(_style.default, {
|
|
26
|
+
id: "4275958396"
|
|
27
|
+
}, [".jsx-4275958396{position:-webkit-sticky;position:sticky;top:0;}"]),
|
|
28
|
+
className: "jsx-4275958396"
|
|
29
|
+
};
|
|
30
|
+
exports.resolvedHeaderStyle = resolvedHeaderStyle;
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.useUserSearchResults = void 0;
|
|
7
|
+
|
|
8
|
+
var _appRuntime = require("@dhis2/app-runtime");
|
|
9
|
+
|
|
10
|
+
var _debounce = _interopRequireDefault(require("lodash/debounce"));
|
|
11
|
+
|
|
12
|
+
var _react = require("react");
|
|
13
|
+
|
|
14
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
|
+
|
|
16
|
+
const usersQuery = {
|
|
17
|
+
users: {
|
|
18
|
+
resource: 'users/gist',
|
|
19
|
+
params: _ref => {
|
|
20
|
+
let {
|
|
21
|
+
searchText
|
|
22
|
+
} = _ref;
|
|
23
|
+
return {
|
|
24
|
+
fields: 'id,displayName,username',
|
|
25
|
+
order: 'firstName,surname',
|
|
26
|
+
total: true,
|
|
27
|
+
filter: "username:ilike:".concat(searchText, ",firstName:ilike:").concat(searchText, ",surname:ilike:").concat(searchText, ",email:ilike:").concat(searchText),
|
|
28
|
+
rootJunction: 'OR'
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
const useUserSearchResults = _ref2 => {
|
|
35
|
+
let {
|
|
36
|
+
searchText
|
|
37
|
+
} = _ref2;
|
|
38
|
+
const [{
|
|
39
|
+
users,
|
|
40
|
+
pager
|
|
41
|
+
}, setData] = (0, _react.useState)({
|
|
42
|
+
users: [],
|
|
43
|
+
pager: {}
|
|
44
|
+
});
|
|
45
|
+
const {
|
|
46
|
+
data,
|
|
47
|
+
fetching,
|
|
48
|
+
refetch
|
|
49
|
+
} = (0, _appRuntime.useDataQuery)(usersQuery, {
|
|
50
|
+
lazy: true
|
|
51
|
+
});
|
|
52
|
+
const debouncedRefetch = (0, _react.useCallback)((0, _debounce.default)(refetch, 250), [refetch]);
|
|
53
|
+
(0, _react.useEffect)(() => {
|
|
54
|
+
if (searchText.length) {
|
|
55
|
+
debouncedRefetch({
|
|
56
|
+
searchText
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
return () => debouncedRefetch.cancel();
|
|
61
|
+
}, [searchText]);
|
|
62
|
+
(0, _react.useEffect)(() => {
|
|
63
|
+
if (data) {
|
|
64
|
+
setData(data.users);
|
|
65
|
+
}
|
|
66
|
+
}, [data]);
|
|
67
|
+
return {
|
|
68
|
+
users,
|
|
69
|
+
pager,
|
|
70
|
+
fetching,
|
|
71
|
+
clear: () => setData({
|
|
72
|
+
users: [],
|
|
73
|
+
pager: {}
|
|
74
|
+
})
|
|
75
|
+
};
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
exports.useUserSearchResults = useUserSearchResults;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
|
|
7
|
+
var _index = require("./Interpretation/index.js");
|
|
8
|
+
|
|
9
|
+
Object.keys(_index).forEach(function (key) {
|
|
10
|
+
if (key === "default" || key === "__esModule") return;
|
|
11
|
+
if (key in exports && exports[key] === _index[key]) return;
|
|
12
|
+
Object.defineProperty(exports, key, {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function () {
|
|
15
|
+
return _index[key];
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
var _index2 = require("./Message/index.js");
|
|
21
|
+
|
|
22
|
+
Object.keys(_index2).forEach(function (key) {
|
|
23
|
+
if (key === "default" || key === "__esModule") return;
|
|
24
|
+
if (key in exports && exports[key] === _index2[key]) return;
|
|
25
|
+
Object.defineProperty(exports, key, {
|
|
26
|
+
enumerable: true,
|
|
27
|
+
get: function () {
|
|
28
|
+
return _index2[key];
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
var _index3 = require("./RichTextEditor/index.js");
|
|
34
|
+
|
|
35
|
+
Object.keys(_index3).forEach(function (key) {
|
|
36
|
+
if (key === "default" || key === "__esModule") return;
|
|
37
|
+
if (key in exports && exports[key] === _index3[key]) return;
|
|
38
|
+
Object.defineProperty(exports, key, {
|
|
39
|
+
enumerable: true,
|
|
40
|
+
get: function () {
|
|
41
|
+
return _index3[key];
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
});
|
package/build/cjs/index.js
CHANGED
|
@@ -453,6 +453,18 @@ Object.defineProperty(exports, "ITEM_PROP_ID", {
|
|
|
453
453
|
return _item.ITEM_PROP_ID;
|
|
454
454
|
}
|
|
455
455
|
});
|
|
456
|
+
Object.defineProperty(exports, "InterpretationModal", {
|
|
457
|
+
enumerable: true,
|
|
458
|
+
get: function () {
|
|
459
|
+
return _InterpretationModal.InterpretationModal;
|
|
460
|
+
}
|
|
461
|
+
});
|
|
462
|
+
Object.defineProperty(exports, "InterpretationsUnit", {
|
|
463
|
+
enumerable: true,
|
|
464
|
+
get: function () {
|
|
465
|
+
return _InterpretationsUnit.InterpretationsUnit;
|
|
466
|
+
}
|
|
467
|
+
});
|
|
456
468
|
Object.defineProperty(exports, "LAYOUT", {
|
|
457
469
|
enumerable: true,
|
|
458
470
|
get: function () {
|
|
@@ -1450,6 +1462,10 @@ var _LegendKey = _interopRequireDefault(require("./components/LegendKey/LegendKe
|
|
|
1450
1462
|
|
|
1451
1463
|
var _AboutAOUnit = _interopRequireDefault(require("./components/AboutAOUnit/AboutAOUnit.js"));
|
|
1452
1464
|
|
|
1465
|
+
var _InterpretationsUnit = require("./components/Interpretations/InterpretationsUnit/InterpretationsUnit.js");
|
|
1466
|
+
|
|
1467
|
+
var _InterpretationModal = require("./components/Interpretations/InterpretationModal/InterpretationModal.js");
|
|
1468
|
+
|
|
1453
1469
|
var _CachedDataQueryProvider = require("./components/CachedDataQueryProvider.js");
|
|
1454
1470
|
|
|
1455
1471
|
var _Analytics = _interopRequireDefault(require("./api/analytics/Analytics.js"));
|
|
@@ -87,6 +87,38 @@
|
|
|
87
87
|
"line list": "",
|
|
88
88
|
"map": "خريطة",
|
|
89
89
|
"visualization": "",
|
|
90
|
+
"Edit": "تعديل",
|
|
91
|
+
"Write a reply": "كتابة رد",
|
|
92
|
+
"Post reply": "",
|
|
93
|
+
"Could not update comment": "",
|
|
94
|
+
"Enter comment text": "",
|
|
95
|
+
"Update": "تحديث",
|
|
96
|
+
"Viewing interpretation: {{visualisationName}}": "",
|
|
97
|
+
"Could not load interpretation": "",
|
|
98
|
+
"The interpretation couldn’t be displayed. Try again or contact your system administrator.": "",
|
|
99
|
+
"Hide interpretation": "",
|
|
100
|
+
"Write an interpretation": "كتابة تفسير",
|
|
101
|
+
"Post interpretation": "",
|
|
102
|
+
"Interpretations": "التفسيرات",
|
|
103
|
+
"Unlike": "إلغاء الإعجاب",
|
|
104
|
+
"Like": "إعجاب",
|
|
105
|
+
"Reply": "رد",
|
|
106
|
+
"Share": "مشاركة",
|
|
107
|
+
"See interpretation": "",
|
|
108
|
+
"Manage sharing": "إدارة المشاركة",
|
|
109
|
+
"Could not update interpretation": "",
|
|
110
|
+
"Enter interpretation text": "",
|
|
111
|
+
"Bold text": "",
|
|
112
|
+
"Italic text": "",
|
|
113
|
+
"Link to a URL": "",
|
|
114
|
+
"Mention a user": "",
|
|
115
|
+
"Add emoji": "",
|
|
116
|
+
"Preview": "معاينة",
|
|
117
|
+
"Back to write mode": "",
|
|
118
|
+
"Too many results. Try refining the search.": "",
|
|
119
|
+
"Search for a user": "",
|
|
120
|
+
"Searching for \"{{searchText}}\"": "",
|
|
121
|
+
"No results found": "لم يتم العثور على أي نتائج",
|
|
90
122
|
"Created by": "تم الإنشاء بواسطة",
|
|
91
123
|
"Anyone": "أي شخص",
|
|
92
124
|
"Only you": "",
|
|
@@ -127,7 +159,6 @@
|
|
|
127
159
|
"New line list": "",
|
|
128
160
|
"Options": "الخيارات",
|
|
129
161
|
"Hide": "إخفاء",
|
|
130
|
-
"Update": "تحديث",
|
|
131
162
|
"{{count}} org units_0": "",
|
|
132
163
|
"{{count}} org units_1": "",
|
|
133
164
|
"{{count}} org units_2": "",
|
|
@@ -87,6 +87,38 @@
|
|
|
87
87
|
"line list": "",
|
|
88
88
|
"map": "",
|
|
89
89
|
"visualization": "",
|
|
90
|
+
"Edit": "",
|
|
91
|
+
"Write a reply": "",
|
|
92
|
+
"Post reply": "",
|
|
93
|
+
"Could not update comment": "",
|
|
94
|
+
"Enter comment text": "",
|
|
95
|
+
"Update": "",
|
|
96
|
+
"Viewing interpretation: {{visualisationName}}": "",
|
|
97
|
+
"Could not load interpretation": "",
|
|
98
|
+
"The interpretation couldn’t be displayed. Try again or contact your system administrator.": "",
|
|
99
|
+
"Hide interpretation": "",
|
|
100
|
+
"Write an interpretation": "",
|
|
101
|
+
"Post interpretation": "",
|
|
102
|
+
"Interpretations": "",
|
|
103
|
+
"Unlike": "",
|
|
104
|
+
"Like": "",
|
|
105
|
+
"Reply": "",
|
|
106
|
+
"Share": "",
|
|
107
|
+
"See interpretation": "",
|
|
108
|
+
"Manage sharing": "",
|
|
109
|
+
"Could not update interpretation": "",
|
|
110
|
+
"Enter interpretation text": "",
|
|
111
|
+
"Bold text": "",
|
|
112
|
+
"Italic text": "",
|
|
113
|
+
"Link to a URL": "",
|
|
114
|
+
"Mention a user": "",
|
|
115
|
+
"Add emoji": "",
|
|
116
|
+
"Preview": "",
|
|
117
|
+
"Back to write mode": "",
|
|
118
|
+
"Too many results. Try refining the search.": "",
|
|
119
|
+
"Search for a user": "",
|
|
120
|
+
"Searching for \"{{searchText}}\"": "",
|
|
121
|
+
"No results found": "",
|
|
90
122
|
"Created by": "",
|
|
91
123
|
"Anyone": "",
|
|
92
124
|
"Only you": "",
|
|
@@ -127,7 +159,6 @@
|
|
|
127
159
|
"New line list": "",
|
|
128
160
|
"Options": "",
|
|
129
161
|
"Hide": "",
|
|
130
|
-
"Update": "",
|
|
131
162
|
"{{count}} org units_0": "",
|
|
132
163
|
"{{count}} org units_1": "",
|
|
133
164
|
"{{count}} org units_2": "",
|
|
@@ -87,6 +87,38 @@
|
|
|
87
87
|
"line list": "",
|
|
88
88
|
"map": "",
|
|
89
89
|
"visualization": "",
|
|
90
|
+
"Edit": "تعديل",
|
|
91
|
+
"Write a reply": "",
|
|
92
|
+
"Post reply": "",
|
|
93
|
+
"Could not update comment": "",
|
|
94
|
+
"Enter comment text": "",
|
|
95
|
+
"Update": "تحديث",
|
|
96
|
+
"Viewing interpretation: {{visualisationName}}": "",
|
|
97
|
+
"Could not load interpretation": "",
|
|
98
|
+
"The interpretation couldn’t be displayed. Try again or contact your system administrator.": "",
|
|
99
|
+
"Hide interpretation": "",
|
|
100
|
+
"Write an interpretation": "",
|
|
101
|
+
"Post interpretation": "",
|
|
102
|
+
"Interpretations": "التفسيرات",
|
|
103
|
+
"Unlike": "إلغاء الإعجاب",
|
|
104
|
+
"Like": "إعجاب",
|
|
105
|
+
"Reply": "رد",
|
|
106
|
+
"Share": "مشاركة",
|
|
107
|
+
"See interpretation": "",
|
|
108
|
+
"Manage sharing": "",
|
|
109
|
+
"Could not update interpretation": "",
|
|
110
|
+
"Enter interpretation text": "",
|
|
111
|
+
"Bold text": "",
|
|
112
|
+
"Italic text": "",
|
|
113
|
+
"Link to a URL": "",
|
|
114
|
+
"Mention a user": "",
|
|
115
|
+
"Add emoji": "",
|
|
116
|
+
"Preview": "",
|
|
117
|
+
"Back to write mode": "",
|
|
118
|
+
"Too many results. Try refining the search.": "",
|
|
119
|
+
"Search for a user": "",
|
|
120
|
+
"Searching for \"{{searchText}}\"": "",
|
|
121
|
+
"No results found": "",
|
|
90
122
|
"Created by": "تم الإنشاء بواسطة",
|
|
91
123
|
"Anyone": "أي شخص",
|
|
92
124
|
"Only you": "",
|
|
@@ -127,7 +159,6 @@
|
|
|
127
159
|
"New line list": "",
|
|
128
160
|
"Options": "الخيارات",
|
|
129
161
|
"Hide": "إخفاء",
|
|
130
|
-
"Update": "تحديث",
|
|
131
162
|
"{{count}} org units_0": "",
|
|
132
163
|
"{{count}} org units_1": "",
|
|
133
164
|
"{{count}} org units_2": "",
|
|
@@ -83,6 +83,38 @@
|
|
|
83
83
|
"line list": "",
|
|
84
84
|
"map": "",
|
|
85
85
|
"visualization": "",
|
|
86
|
+
"Edit": "دةستكاري",
|
|
87
|
+
"Write a reply": "",
|
|
88
|
+
"Post reply": "",
|
|
89
|
+
"Could not update comment": "",
|
|
90
|
+
"Enter comment text": "",
|
|
91
|
+
"Update": "نوێ کردنەوە",
|
|
92
|
+
"Viewing interpretation: {{visualisationName}}": "",
|
|
93
|
+
"Could not load interpretation": "",
|
|
94
|
+
"The interpretation couldn’t be displayed. Try again or contact your system administrator.": "",
|
|
95
|
+
"Hide interpretation": "",
|
|
96
|
+
"Write an interpretation": "",
|
|
97
|
+
"Post interpretation": "",
|
|
98
|
+
"Interpretations": "",
|
|
99
|
+
"Unlike": "",
|
|
100
|
+
"Like": "",
|
|
101
|
+
"Reply": "",
|
|
102
|
+
"Share": "",
|
|
103
|
+
"See interpretation": "",
|
|
104
|
+
"Manage sharing": "",
|
|
105
|
+
"Could not update interpretation": "",
|
|
106
|
+
"Enter interpretation text": "",
|
|
107
|
+
"Bold text": "",
|
|
108
|
+
"Italic text": "",
|
|
109
|
+
"Link to a URL": "",
|
|
110
|
+
"Mention a user": "",
|
|
111
|
+
"Add emoji": "",
|
|
112
|
+
"Preview": "",
|
|
113
|
+
"Back to write mode": "",
|
|
114
|
+
"Too many results. Try refining the search.": "",
|
|
115
|
+
"Search for a user": "",
|
|
116
|
+
"Searching for \"{{searchText}}\"": "",
|
|
117
|
+
"No results found": "",
|
|
86
118
|
"Created by": "",
|
|
87
119
|
"Anyone": "هەرکەسێک",
|
|
88
120
|
"Only you": "",
|
|
@@ -123,7 +155,6 @@
|
|
|
123
155
|
"New line list": "",
|
|
124
156
|
"Options": "",
|
|
125
157
|
"Hide": "شاردنەوە",
|
|
126
|
-
"Update": "نوێ کردنەوە",
|
|
127
158
|
"{{count}} org units_0": "",
|
|
128
159
|
"{{count}} org units_1": "",
|
|
129
160
|
"{{count}} levels_0": "",
|
|
@@ -85,6 +85,38 @@
|
|
|
85
85
|
"line list": "",
|
|
86
86
|
"map": "mapa",
|
|
87
87
|
"visualization": "",
|
|
88
|
+
"Edit": "Upravit",
|
|
89
|
+
"Write a reply": "Napsat odpověď",
|
|
90
|
+
"Post reply": "",
|
|
91
|
+
"Could not update comment": "",
|
|
92
|
+
"Enter comment text": "",
|
|
93
|
+
"Update": "Aktualizovat",
|
|
94
|
+
"Viewing interpretation: {{visualisationName}}": "",
|
|
95
|
+
"Could not load interpretation": "",
|
|
96
|
+
"The interpretation couldn’t be displayed. Try again or contact your system administrator.": "",
|
|
97
|
+
"Hide interpretation": "",
|
|
98
|
+
"Write an interpretation": "Napsat interpretaci",
|
|
99
|
+
"Post interpretation": "",
|
|
100
|
+
"Interpretations": "Interpretace",
|
|
101
|
+
"Unlike": "Na rozdíl od",
|
|
102
|
+
"Like": "Jako",
|
|
103
|
+
"Reply": "Odpovědět",
|
|
104
|
+
"Share": "Sdílet",
|
|
105
|
+
"See interpretation": "",
|
|
106
|
+
"Manage sharing": "Spravovat sdílení",
|
|
107
|
+
"Could not update interpretation": "",
|
|
108
|
+
"Enter interpretation text": "",
|
|
109
|
+
"Bold text": "",
|
|
110
|
+
"Italic text": "",
|
|
111
|
+
"Link to a URL": "",
|
|
112
|
+
"Mention a user": "",
|
|
113
|
+
"Add emoji": "",
|
|
114
|
+
"Preview": "Náhled",
|
|
115
|
+
"Back to write mode": "",
|
|
116
|
+
"Too many results. Try refining the search.": "",
|
|
117
|
+
"Search for a user": "",
|
|
118
|
+
"Searching for \"{{searchText}}\"": "",
|
|
119
|
+
"No results found": "Nenalezeny žádné výsledky",
|
|
88
120
|
"Created by": "Vytvořil",
|
|
89
121
|
"Anyone": "Kdokoliv",
|
|
90
122
|
"Only you": "Jen vy",
|
|
@@ -125,7 +157,6 @@
|
|
|
125
157
|
"New line list": "Nový řádkový seznam",
|
|
126
158
|
"Options": "Možnosti",
|
|
127
159
|
"Hide": "Skrýt",
|
|
128
|
-
"Update": "Aktualizovat",
|
|
129
160
|
"{{count}} org units_0": "{{count}} organizační jednotka",
|
|
130
161
|
"{{count}} org units_1": "{{count}} organizační jednotky",
|
|
131
162
|
"{{count}} org units_2": "{{count}} organizačních jednotek",
|