@tellescope/react-components 1.157.1 → 1.159.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/lib/cjs/CMS/components.d.ts +1 -0
- package/lib/cjs/CMS/components.d.ts.map +1 -1
- package/lib/cjs/Forms/form_responses.d.ts +1 -0
- package/lib/cjs/Forms/form_responses.d.ts.map +1 -1
- package/lib/cjs/Forms/forms.js +1 -1
- package/lib/cjs/Forms/forms.js.map +1 -1
- package/lib/cjs/Forms/hooks.d.ts +2 -0
- package/lib/cjs/Forms/hooks.d.ts.map +1 -1
- package/lib/cjs/Forms/hooks.js +11 -3
- package/lib/cjs/Forms/hooks.js.map +1 -1
- package/lib/cjs/Forms/inputs.d.ts.map +1 -1
- package/lib/cjs/Forms/inputs.js +78 -28
- package/lib/cjs/Forms/inputs.js.map +1 -1
- package/lib/cjs/controls.d.ts +2 -2
- package/lib/cjs/inputs.native.d.ts +1 -0
- package/lib/cjs/inputs.native.d.ts.map +1 -1
- package/lib/cjs/mui.d.ts +2 -1
- package/lib/cjs/mui.d.ts.map +1 -1
- package/lib/cjs/mui.js +2 -2
- package/lib/cjs/mui.js.map +1 -1
- package/lib/cjs/state.js +1 -1
- package/lib/cjs/state.js.map +1 -1
- package/lib/esm/CMS/components.d.ts +1 -0
- package/lib/esm/CMS/components.d.ts.map +1 -1
- package/lib/esm/Forms/forms.d.ts +3 -3
- package/lib/esm/Forms/forms.js +1 -1
- package/lib/esm/Forms/forms.js.map +1 -1
- package/lib/esm/Forms/hooks.d.ts +1 -0
- package/lib/esm/Forms/hooks.d.ts.map +1 -1
- package/lib/esm/Forms/hooks.js +11 -3
- package/lib/esm/Forms/hooks.js.map +1 -1
- package/lib/esm/Forms/inputs.d.ts +1 -1
- package/lib/esm/Forms/inputs.d.ts.map +1 -1
- package/lib/esm/Forms/inputs.js +78 -28
- package/lib/esm/Forms/inputs.js.map +1 -1
- package/lib/esm/Forms/inputs.native.d.ts +1 -0
- package/lib/esm/Forms/inputs.native.d.ts.map +1 -1
- package/lib/esm/controls.d.ts +2 -2
- package/lib/esm/inputs.d.ts +1 -1
- package/lib/esm/layout.d.ts +1 -1
- package/lib/esm/mui.d.ts +2 -1
- package/lib/esm/mui.d.ts.map +1 -1
- package/lib/esm/mui.js +2 -2
- package/lib/esm/mui.js.map +1 -1
- package/lib/esm/state.d.ts +256 -256
- package/lib/esm/state.js +1 -1
- package/lib/esm/state.js.map +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +9 -9
- package/src/Forms/forms.tsx +1 -1
- package/src/Forms/hooks.tsx +8 -0
- package/src/Forms/inputs.tsx +109 -37
- package/src/mui.tsx +3 -2
- package/src/state.tsx +1 -1
package/lib/esm/Forms/inputs.js
CHANGED
|
@@ -291,10 +291,11 @@ export var NumberInput = function (_a) {
|
|
|
291
291
|
} })));
|
|
292
292
|
};
|
|
293
293
|
export var InsuranceInput = function (_a) {
|
|
294
|
-
var _b, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
|
294
|
+
var _b, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s;
|
|
295
295
|
var field = _a.field, value = _a.value, onChange = _a.onChange, form = _a.form, responses = _a.responses, enduser = _a.enduser, props = __rest(_a, ["field", "value", "onChange", "form", "responses", "enduser"]);
|
|
296
296
|
var session = useResolvedSession();
|
|
297
|
-
var
|
|
297
|
+
var _t = useState([]), payers = _t[0], setPayers = _t[1];
|
|
298
|
+
var _u = useState(''), query = _u[0], setQuery = _u[1];
|
|
298
299
|
var addressQuestion = useMemo(function () { return responses === null || responses === void 0 ? void 0 : responses.find(function (r) {
|
|
299
300
|
var _a;
|
|
300
301
|
if (r.answer.type !== 'Address')
|
|
@@ -312,6 +313,9 @@ export var InsuranceInput = function (_a) {
|
|
|
312
313
|
}, [enduser === null || enduser === void 0 ? void 0 : enduser.state, addressQuestion]);
|
|
313
314
|
var loadRef = useRef(false); // so session changes don't cause
|
|
314
315
|
useEffect(function () {
|
|
316
|
+
var _a;
|
|
317
|
+
if (((_a = field === null || field === void 0 ? void 0 : field.options) === null || _a === void 0 ? void 0 : _a.dataSource) === CANVAS_TITLE)
|
|
318
|
+
return; // instead, look-up while typing against Canvas Search API
|
|
315
319
|
if (loadRef.current)
|
|
316
320
|
return;
|
|
317
321
|
loadRef.current = true;
|
|
@@ -332,33 +336,75 @@ export var InsuranceInput = function (_a) {
|
|
|
332
336
|
.filter(function (c) { return !c.state || !state || (c.state === state); }));
|
|
333
337
|
})
|
|
334
338
|
.catch(console.error);
|
|
335
|
-
}, [session, state]);
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
339
|
+
}, [session, state, (_b = field === null || field === void 0 ? void 0 : field.options) === null || _b === void 0 ? void 0 : _b.dataSource]);
|
|
340
|
+
var searchRef = useRef(query);
|
|
341
|
+
useEffect(function () {
|
|
342
|
+
var _a;
|
|
343
|
+
if (((_a = field === null || field === void 0 ? void 0 : field.options) === null || _a === void 0 ? void 0 : _a.dataSource) !== CANVAS_TITLE) {
|
|
344
|
+
return;
|
|
345
|
+
}
|
|
346
|
+
if (!query)
|
|
347
|
+
return;
|
|
348
|
+
if (searchRef.current === query)
|
|
349
|
+
return;
|
|
350
|
+
searchRef.current = query;
|
|
351
|
+
session.api.integrations.proxy_read({
|
|
352
|
+
integration: CANVAS_TITLE,
|
|
353
|
+
query: query,
|
|
354
|
+
type: 'organizations',
|
|
355
|
+
})
|
|
356
|
+
.then(function (_a) {
|
|
357
|
+
var data = _a.data;
|
|
358
|
+
try {
|
|
359
|
+
setPayers(data.map(function (d) { return ({
|
|
360
|
+
id: d.resource.id,
|
|
361
|
+
name: d.resource.name,
|
|
362
|
+
}); }));
|
|
363
|
+
}
|
|
364
|
+
catch (err) {
|
|
365
|
+
console.error;
|
|
366
|
+
}
|
|
367
|
+
})
|
|
368
|
+
.catch(console.error);
|
|
369
|
+
}, [session, (_d = field === null || field === void 0 ? void 0 : field.options) === null || _d === void 0 ? void 0 : _d.dataSource, query]);
|
|
370
|
+
return (_jsxs(Grid, __assign({ container: true, spacing: 2, sx: { mt: '0' } }, { children: [_jsx(Grid, __assign({ item: true, xs: 12, sm: 6 }, { children: _jsx(Autocomplete, { freeSolo: !((_e = field.options) === null || _e === void 0 ? void 0 : _e.requirePredefinedInsurer), options: payers.map(function (p) { return p.name; }), value: (value === null || value === void 0 ? void 0 : value.payerName) || '', onChange: function (e, v) {
|
|
340
371
|
var _a, _b;
|
|
341
372
|
return onChange(__assign(__assign({}, value), { payerName: v || '', payerId: ((_a = payers.find(function (p) { return p.name === v; })) === null || _a === void 0 ? void 0 : _a.id) || '', payerType: ((_b = payers.find(function (p) { return p.name === v; })) === null || _b === void 0 ? void 0 : _b.type) || '' }), field.id);
|
|
342
|
-
},
|
|
373
|
+
}, onInputChange: ((_f = field.options) === null || _f === void 0 ? void 0 : _f.requirePredefinedInsurer)
|
|
374
|
+
? function (e, v) { if (v) {
|
|
375
|
+
setQuery(v);
|
|
376
|
+
} }
|
|
377
|
+
: function (e, v) {
|
|
378
|
+
var _a, _b;
|
|
379
|
+
if (v) {
|
|
380
|
+
setQuery(v);
|
|
381
|
+
}
|
|
382
|
+
onChange(__assign(__assign({}, value), { payerName: v || '', payerId: ((_a = payers.find(function (p) { return p.name === v; })) === null || _a === void 0 ? void 0 : _a.id) || '', payerType: ((_b = payers.find(function (p) { return p.name === v; })) === null || _b === void 0 ? void 0 : _b.type) || '' }), field.id);
|
|
383
|
+
}, renderInput: function (params) { return (_jsx(TextField, __assign({}, params, { InputProps: __assign(__assign({}, params.InputProps), { sx: defaultInputProps.sx }), required: !field.isOptional, size: "small", label: "Insurer" }))); } }) })), _jsx(Grid, __assign({ item: true, xs: 12, sm: 6 }, { children: _jsx(TextField, { InputProps: defaultInputProps, required: !field.isOptional, fullWidth: true, value: (_g = value === null || value === void 0 ? void 0 : value.memberId) !== null && _g !== void 0 ? _g : '', onChange: function (e) { return onChange(__assign(__assign({}, value), { memberId: e.target.value }), field.id); }, label: form_display_text_for_language(form, "Member ID", ''), size: "small" }) })), _jsx(Grid, __assign({ item: true, xs: 12, sm: 6 }, { children: _jsx(TextField, { InputProps: defaultInputProps, required: false, fullWidth: true, value: (_h = value === null || value === void 0 ? void 0 : value.planName) !== null && _h !== void 0 ? _h : '', onChange: function (e) { return onChange(__assign(__assign({}, value), { planName: e.target.value }), field.id); }, label: form_display_text_for_language(form, "Plan Name", ''), size: "small" }) })), _jsx(Grid, __assign({ item: true, xs: 12, sm: 6 }, { children: _jsx(DateStringInput, { size: "small", label: "Plan Start Date", field: __assign(__assign({}, field), { isOptional: true }), value: (value === null || value === void 0 ? void 0 : value.startDate) || '', onChange: function (startDate) {
|
|
343
384
|
return onChange(__assign(__assign({}, value), { startDate: startDate }), field.id);
|
|
344
|
-
} }) })), ((
|
|
345
|
-
_jsx(Grid, __assign({ item: true, xs: 12 }, { children: _jsx(TextField, { InputProps: defaultInputProps, fullWidth: true, value: (
|
|
385
|
+
} }) })), ((_j = field.options) === null || _j === void 0 ? void 0 : _j.includeGroupNumber) &&
|
|
386
|
+
_jsx(Grid, __assign({ item: true, xs: 12 }, { children: _jsx(TextField, { InputProps: defaultInputProps, fullWidth: true, value: (_k = value === null || value === void 0 ? void 0 : value.groupNumber) !== null && _k !== void 0 ? _k : '', onChange: function (e) { return onChange(__assign(__assign({}, value), { groupNumber: e.target.value }), field.id); }, label: form_display_text_for_language(form, "Group Number", ''), size: "small" }) })), _jsx(Grid, __assign({ item: true, xs: 12 }, { children: _jsx(StringSelector, { size: "small", label: "Relationship to Policy Owner", options: ((((_l = field.options) === null || _l === void 0 ? void 0 : _l.billingProvider) === CANVAS_TITLE || ((_m = field.options) === null || _m === void 0 ? void 0 : _m.dataSource) === CANVAS_TITLE)
|
|
387
|
+
? INSURANCE_RELATIONSHIPS_CANVAS
|
|
388
|
+
: INSURANCE_RELATIONSHIPS)
|
|
346
389
|
.sort(function (x, y) { return x.localeCompare(y); }), value: (value === null || value === void 0 ? void 0 : value.relationship) || 'Self', onChange: function (relationship) {
|
|
347
390
|
return onChange(__assign(__assign({}, value), { relationship: relationship || 'Self' }), field.id);
|
|
348
391
|
} }) })), ((value === null || value === void 0 ? void 0 : value.relationship) || 'Self') !== 'Self' &&
|
|
349
|
-
_jsxs(_Fragment, { children: [_jsx(Grid, __assign({ item: true, xs: 12 }, { children: _jsx(Typography, __assign({ sx: { fontWeight: 'bold' } }, { children: "Policy Owner Details" })) })), _jsx(Grid, __assign({ item: true, xs: 6 }, { children: _jsx(TextField, { label: "First Name", size: "small", InputProps: defaultInputProps, fullWidth: true, value: ((
|
|
392
|
+
_jsxs(_Fragment, { children: [_jsx(Grid, __assign({ item: true, xs: 12 }, { children: _jsx(Typography, __assign({ sx: { fontWeight: 'bold' } }, { children: "Policy Owner Details" })) })), _jsx(Grid, __assign({ item: true, xs: 6 }, { children: _jsx(TextField, { label: "First Name", size: "small", InputProps: defaultInputProps, fullWidth: true, value: ((_o = value === null || value === void 0 ? void 0 : value.relationshipDetails) === null || _o === void 0 ? void 0 : _o.fname) || '', required: !field.isOptional, onChange: function (e) {
|
|
350
393
|
return onChange(__assign(__assign({}, value), { relationshipDetails: __assign(__assign({}, value === null || value === void 0 ? void 0 : value.relationshipDetails), { fname: e.target.value }) }), field.id);
|
|
351
|
-
} }) })), _jsx(Grid, __assign({ item: true, xs: 6 }, { children: _jsx(TextField, { label: "Last Name", size: "small", InputProps: defaultInputProps, fullWidth: true, value: ((
|
|
394
|
+
} }) })), _jsx(Grid, __assign({ item: true, xs: 6 }, { children: _jsx(TextField, { label: "Last Name", size: "small", InputProps: defaultInputProps, fullWidth: true, value: ((_p = value === null || value === void 0 ? void 0 : value.relationshipDetails) === null || _p === void 0 ? void 0 : _p.lname) || '', required: !field.isOptional, onChange: function (e) {
|
|
352
395
|
return onChange(__assign(__assign({}, value), { relationshipDetails: __assign(__assign({}, value === null || value === void 0 ? void 0 : value.relationshipDetails), { lname: e.target.value }) }), field.id);
|
|
353
|
-
} }) })), _jsx(Grid, __assign({ item: true, xs: 6 }, { children: _jsx(StringSelector, { options: TELLESCOPE_GENDERS, size: "small", label: "Gender", value: ((
|
|
396
|
+
} }) })), _jsx(Grid, __assign({ item: true, xs: 6 }, { children: _jsx(StringSelector, { options: TELLESCOPE_GENDERS, size: "small", label: "Gender", value: ((_q = value === null || value === void 0 ? void 0 : value.relationshipDetails) === null || _q === void 0 ? void 0 : _q.gender) || '', required: !field.isOptional, onChange: function (v) {
|
|
354
397
|
return onChange(__assign(__assign({}, value), { relationshipDetails: __assign(__assign({}, value === null || value === void 0 ? void 0 : value.relationshipDetails), { gender: v }) }), field.id);
|
|
355
|
-
} }) })), _jsx(Grid, __assign({ item: true, xs: 6 }, { children: _jsx(DateStringInput, { size: "small", label: "Date of Birth", field: __assign(__assign({}, field), { isOptional: field.isOptional || ((
|
|
398
|
+
} }) })), _jsx(Grid, __assign({ item: true, xs: 6 }, { children: _jsx(DateStringInput, { size: "small", label: "Date of Birth", field: __assign(__assign({}, field), { isOptional: field.isOptional || ((_r = field.options) === null || _r === void 0 ? void 0 : _r.billingProvider) === 'Candid' }), value: ((_s = value === null || value === void 0 ? void 0 : value.relationshipDetails) === null || _s === void 0 ? void 0 : _s.dateOfBirth) || '', onChange: function (dateOfBirth) {
|
|
356
399
|
return onChange(__assign(__assign({}, value), { relationshipDetails: __assign(__assign({}, value === null || value === void 0 ? void 0 : value.relationshipDetails), { dateOfBirth: dateOfBirth }) }), field.id);
|
|
357
400
|
} }) }))] })] })));
|
|
358
401
|
};
|
|
359
402
|
var StringSelector = function (_a) {
|
|
360
|
-
var options = _a.options, value = _a.value, onChange = _a.onChange, required = _a.required, props = __rest(_a, ["options", "value", "onChange", "required"]);
|
|
361
|
-
return (_jsxs(FormControl, __assign({ fullWidth: true, size: props.size, required: required }, { children: [_jsx(InputLabel, { children: props.label }), _jsx(Select, __assign({}, props, { value: value, onChange: function (e) { return onChange(e.target.value); }, fullWidth: true, sx: defaultInputProps.sx }, { children: options.map(function (o, i) {
|
|
403
|
+
var options = _a.options, value = _a.value, onChange = _a.onChange, required = _a.required, getDisplayValue = _a.getDisplayValue, props = __rest(_a, ["options", "value", "onChange", "required", "getDisplayValue"]);
|
|
404
|
+
return (_jsxs(FormControl, __assign({ fullWidth: true, size: props.size, required: required }, { children: [_jsx(InputLabel, { children: props.label }), _jsx(Select, __assign({}, props, { value: value, onChange: function (e) { return onChange(e.target.value); }, fullWidth: true, sx: defaultInputProps.sx }, { children: options.map(function (o, i) {
|
|
405
|
+
var _a;
|
|
406
|
+
return (_jsx(MenuItem, __assign({ value: o }, { children: (_a = getDisplayValue === null || getDisplayValue === void 0 ? void 0 : getDisplayValue(o)) !== null && _a !== void 0 ? _a : o }), o || i));
|
|
407
|
+
}) }))] })));
|
|
362
408
|
};
|
|
363
409
|
var HourSelector = function (props) { return (_jsx(StringSelector, __assign({}, props, { options: Array(12).fill('').map(function (_, i) { return (i + 1) <= 9 ? "0".concat(i + 1) : (i + 1).toString(); }) }))); };
|
|
364
410
|
var MinuteSelector = function (props) { return (_jsx(StringSelector, __assign({}, props, { options: Array(60).fill('').map(function (_, i) { return i <= 9 ? "0".concat(i) : i.toString(); }) }))); };
|
|
@@ -376,7 +422,10 @@ export var AddressInput = function (_a) {
|
|
|
376
422
|
// state only
|
|
377
423
|
((_d = (_b = field.options) === null || _b === void 0 ? void 0 : _b.addressFields) === null || _d === void 0 ? void 0 : _d.includes('state'))
|
|
378
424
|
? (_jsx(Autocomplete, __assign({ value: value === null || value === void 0 ? void 0 : value.state, options: ((_f = (_e = field.options) === null || _e === void 0 ? void 0 : _e.validStates) === null || _f === void 0 ? void 0 : _f.length) ? field.options.validStates : VALID_STATES, disablePortal: true, onChange: function (e, v) { return v &&
|
|
379
|
-
onChange(__assign(__assign({}, value), { state: v !== null && v !== void 0 ? v : '' }), field.id); }, renderInput: function (params) { return (_jsx(TextField, __assign({}, params, { InputProps: __assign(__assign({}, params.InputProps), { sx: defaultInputProps.sx }),
|
|
425
|
+
onChange(__assign(__assign({}, value), { state: v !== null && v !== void 0 ? v : '' }), field.id); }, renderInput: function (params) { return (_jsx(TextField, __assign({}, params, { InputProps: __assign(__assign({}, params.InputProps), { sx: defaultInputProps.sx }), required: !field.isOptional,
|
|
426
|
+
// don't use 'small' so as to be consistent with other text fields, in case this is used in a group
|
|
427
|
+
// size={'small'}
|
|
428
|
+
label: form_display_text_for_language(form, "State") }))); } }, props)))
|
|
380
429
|
: (_jsxs(Grid, __assign({ container: true, direction: "column", spacing: 2, sx: { mt: 0 } }, { children: [_jsx(Grid, __assign({ item: true }, { children: _jsx(AutoFocusTextField, __assign({}, props, { size: "small", required: !field.isOptional, fullWidth: true, value: (_g = value === null || value === void 0 ? void 0 : value.addressLineOne) !== null && _g !== void 0 ? _g : '', label: form_display_text_for_language(form, "Address Line 1"), placeholder: form_display_text_for_language(form, "Address Line 1"), onChange: function (e) {
|
|
381
430
|
var _a;
|
|
382
431
|
return onChange(__assign(__assign({}, value), { addressLineOne: (_a = e.target.value) !== null && _a !== void 0 ? _a : '' }), field.id);
|
|
@@ -1617,16 +1666,17 @@ export var AllergiesInput = function (_a) {
|
|
|
1617
1666
|
}, 200);
|
|
1618
1667
|
return function () { clearTimeout(t); };
|
|
1619
1668
|
}, [session, query, (_b = field === null || field === void 0 ? void 0 : field.options) === null || _b === void 0 ? void 0 : _b.dataSource]);
|
|
1620
|
-
return (_jsx(Autocomplete, { multiple: true, value: value || [], options: results, style: { marginTop: 5 }, noOptionsText: query.length ? 'No results found' : 'Type to start search', onChange: function (e, v) {
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
|
|
1669
|
+
return (_jsxs(Grid, __assign({ container: true, direction: "column", spacing: 1 }, { children: [_jsx(Grid, __assign({ item: true }, { children: _jsx(Autocomplete, { multiple: true, value: value || [], options: results, style: { marginTop: 5 }, noOptionsText: query.length ? 'No results found' : 'Type to start search', onChange: function (e, v) {
|
|
1670
|
+
if (!v) {
|
|
1671
|
+
return;
|
|
1672
|
+
}
|
|
1673
|
+
onChange(v, field.id);
|
|
1674
|
+
setResults([]);
|
|
1675
|
+
}, getOptionLabel: function (v) { return first_letter_capitalized(v.display); }, filterOptions: function (o) { return o; }, inputValue: query, onInputChange: function (e, v) { return e && setQuery(v); }, renderInput: function (params) { return (_jsx(TextField, __assign({}, params, { InputProps: __assign(__assign({}, params.InputProps), { sx: defaultInputProps.sx }), required: !field.isOptional, size: "small", label: "", placeholder: "Search allergies..." }))); }, renderTags: function (value, getTagProps) {
|
|
1676
|
+
return value.map(function (value, index) { return (_jsx(Chip, __assign({ label: _jsx(Typography, __assign({ style: { whiteSpace: 'normal' } }, { children: value.display })) }, getTagProps({ index: index }), { sx: { height: "100%", py: 0.5 } }))); });
|
|
1677
|
+
} }) })), (value || []).map(function (allergy, i) { return (_jsx(Grid, __assign({ item: true }, { children: _jsxs(Grid, __assign({ container: true, alignItems: "center", wrap: "nowrap", columnGap: 0.5, justifyContent: "space-between" }, { children: [_jsx(Grid, __assign({ item: true }, { children: _jsx(Typography, __assign({ noWrap: true, sx: { width: 85, fontSize: 14 } }, { children: allergy.display })) })), _jsx(Grid, __assign({ item: true, sx: { width: 140 } }, { children: _jsx(StringSelector, { options: ['mild', 'moderate', 'severe'], size: "small", label: "Severity", value: allergy.severity || '', onChange: function (severity) { return onChange((value || []).map(function (v, _i) { return i === _i ? __assign(__assign({}, v), { severity: severity }) : v; }), field.id); }, getDisplayValue: first_letter_capitalized }) })), _jsx(Grid, __assign({ item: true, sx: { width: "50%" } }, { children: _jsx(TextField, { InputProps: { sx: defaultInputProps.sx }, fullWidth: true, size: "small", label: "Note", value: allergy.note || '', onChange: function (e) { return onChange((value || []).map(function (v, _i) { return i === _i ? __assign(__assign({}, v), { note: e.target.value }) : v; }), field.id); } }) }))] })) }), i)); })] })));
|
|
1629
1678
|
};
|
|
1679
|
+
var display_with_code = function (v) { return "".concat(v.code, ": ").concat(first_letter_capitalized(v.display)); };
|
|
1630
1680
|
export var ConditionsInput = function (_a) {
|
|
1631
1681
|
var goToNextField = _a.goToNextField, goToPreviousField = _a.goToPreviousField, field = _a.field, value = _a.value, onChange = _a.onChange, form = _a.form, formResponseId = _a.formResponseId, props = __rest(_a, ["goToNextField", "goToPreviousField", "field", "value", "onChange", "form", "formResponseId"]);
|
|
1632
1682
|
var session = useResolvedSession();
|
|
@@ -1664,8 +1714,8 @@ export var ConditionsInput = function (_a) {
|
|
|
1664
1714
|
}
|
|
1665
1715
|
onChange(v, field.id);
|
|
1666
1716
|
setResults([]);
|
|
1667
|
-
}, getOptionLabel:
|
|
1668
|
-
return value.map(function (value, index) { return (_jsx(Chip, __assign({ label: _jsx(Typography, __assign({ style: { whiteSpace: 'normal' } }, { children: value
|
|
1717
|
+
}, getOptionLabel: display_with_code, filterOptions: function (o) { return o; }, inputValue: query, onInputChange: function (e, v) { return e && setQuery(v); }, renderInput: function (params) { return (_jsx(TextField, __assign({}, params, { InputProps: __assign(__assign({}, params.InputProps), { sx: defaultInputProps.sx }), required: !field.isOptional, size: "small", label: "", placeholder: "Search conditions..." }))); }, renderTags: function (value, getTagProps) {
|
|
1718
|
+
return value.map(function (value, index) { return (_jsx(Chip, __assign({ label: _jsx(Typography, __assign({ style: { whiteSpace: 'normal' } }, { children: display_with_code(value) })) }, getTagProps({ index: index }), { sx: { height: "100%", py: 0.5 } }))); });
|
|
1669
1719
|
} }));
|
|
1670
1720
|
};
|
|
1671
1721
|
var templateObject_1, templateObject_2;
|