react-jsonschema-rxnt-extras 0.4.5 → 0.5.0-alpha.190053
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/form-with-extras.js +2 -2
- package/dist/form-with-extras.js.map +1 -1
- package/lib/index.js +3 -4
- package/lib/rxntTypeaheadAPI.js +21 -7
- package/package.json +2 -2
package/lib/index.js
CHANGED
|
@@ -121,13 +121,12 @@ var AsyncMultiTypeaheadWrap = function (_Component2) {
|
|
|
121
121
|
|
|
122
122
|
// Map asyncMultiTypeahead config to multiTypeahead that the base component expects
|
|
123
123
|
if (this.props.uiSchema.asyncMultiTypeahead) {
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
124
|
+
var withFilter = this.props.uiSchema.asyncMultiTypeahead.withFilter;
|
|
125
|
+
var searchFn = withFilter ? _rxntTypeaheadAPI.searchWithFilter : _rxntTypeaheadAPI.search;
|
|
127
126
|
// Create a new uiSchema object with the config mapped to multiTypeahead
|
|
128
127
|
var newUiSchema = _extends({}, this.props.uiSchema, {
|
|
129
128
|
multiTypeahead: _extends({}, this.props.uiSchema.asyncMultiTypeahead, {
|
|
130
|
-
search:
|
|
129
|
+
search: searchFn
|
|
131
130
|
})
|
|
132
131
|
});
|
|
133
132
|
|
package/lib/rxntTypeaheadAPI.js
CHANGED
|
@@ -3,30 +3,44 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.search =
|
|
6
|
+
exports.searchWithFilter = exports.search = undefined;
|
|
7
7
|
|
|
8
8
|
var _utils = require("./utils");
|
|
9
9
|
|
|
10
10
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } /* global encounterTemplateV2User, encounterTemplateV2EncounterInfo, encounterTemplateV2PatientInfo*/
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
function search(url, query) {
|
|
14
|
-
var key = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "Name";
|
|
15
|
-
|
|
12
|
+
function getAuthObj() {
|
|
16
13
|
var user = JSON.parse(encounterTemplateV2User);
|
|
17
14
|
var encounterInfo = JSON.parse(encounterTemplateV2EncounterInfo);
|
|
18
15
|
var patientInfo = JSON.parse(encounterTemplateV2PatientInfo);
|
|
19
16
|
var patientId = patientInfo ? patientInfo.PatientId : 0;
|
|
20
17
|
var doctorInfo = JSON.parse(window.encounterTemplateV2DoctorInfo);
|
|
21
|
-
|
|
18
|
+
return {
|
|
22
19
|
DoctorCompanyId: user.DoctorCompanyId,
|
|
23
20
|
DoctorGroupId: encounterInfo.DoctorGroupId,
|
|
24
21
|
Token: user.AppLoginTokens[0].Token,
|
|
25
22
|
PatientId: patientId,
|
|
26
23
|
DoctorId: doctorInfo.DoctorId
|
|
27
24
|
};
|
|
25
|
+
} // Correct closing brace for getAuthObj function
|
|
26
|
+
|
|
27
|
+
function search(url, query) {
|
|
28
|
+
var key = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "Name";
|
|
28
29
|
|
|
30
|
+
var authObj = getAuthObj();
|
|
29
31
|
return (0, _utils.fetchFromRxNT)(url, authObj, _defineProperty({}, key, query)).then(function (resp) {
|
|
30
32
|
return resp.json();
|
|
31
33
|
});
|
|
32
|
-
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
function searchWithFilter(url, query) {
|
|
37
|
+
var key = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "Name";
|
|
38
|
+
|
|
39
|
+
var authObj = getAuthObj();
|
|
40
|
+
return (0, _utils.fetchFromRxNT)(url, authObj, { filter: _defineProperty({}, key, query) }).then(function (resp) {
|
|
41
|
+
return resp.json();
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
exports.search = search;
|
|
46
|
+
exports.searchWithFilter = searchWithFilter;
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"description": "RxNT Extra widgets for Mozilla's react-jsonschema-form",
|
|
4
4
|
"private": false,
|
|
5
5
|
"author": "mavarazy@gmail.com",
|
|
6
|
-
"version": "0.
|
|
6
|
+
"version": "0.5.0-alpha.190053",
|
|
7
7
|
"scripts": {
|
|
8
8
|
"prepare": "husky install",
|
|
9
9
|
"pre-commit": "lint-staged",
|
|
@@ -111,7 +111,7 @@
|
|
|
111
111
|
"style-loader": "^1.3.0",
|
|
112
112
|
"webpack": "^4.46.0",
|
|
113
113
|
"webpack-cli": "^4.10.0",
|
|
114
|
-
"webpack-dev-server": "^
|
|
114
|
+
"webpack-dev-server": "^4.15.2",
|
|
115
115
|
"webpack-hot-middleware": "^2.18.2"
|
|
116
116
|
},
|
|
117
117
|
"directories": {
|