@tellescope/react-components 1.237.3 → 1.237.5
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/Forms/hooks.d.ts +2 -0
- package/lib/cjs/Forms/hooks.d.ts.map +1 -1
- package/lib/cjs/Forms/inputs.d.ts +12 -12
- package/lib/cjs/Forms/inputs.d.ts.map +1 -1
- package/lib/cjs/Forms/inputs.js +73 -73
- package/lib/cjs/Forms/inputs.js.map +1 -1
- package/lib/cjs/Forms/inputs.v2.d.ts +11 -11
- package/lib/cjs/Forms/inputs.v2.d.ts.map +1 -1
- package/lib/cjs/Forms/inputs.v2.js +47 -47
- package/lib/cjs/Forms/inputs.v2.js.map +1 -1
- package/lib/cjs/Forms/localization.d.ts +2 -1
- package/lib/cjs/Forms/localization.d.ts.map +1 -1
- package/lib/cjs/Forms/localization.js +198 -61
- package/lib/cjs/Forms/localization.js.map +1 -1
- package/lib/cjs/state.d.ts +0 -4
- package/lib/cjs/state.d.ts.map +1 -1
- package/lib/cjs/state.js +2 -26
- package/lib/cjs/state.js.map +1 -1
- package/lib/esm/Forms/hooks.d.ts +2 -0
- package/lib/esm/Forms/hooks.d.ts.map +1 -1
- package/lib/esm/Forms/inputs.d.ts +12 -12
- package/lib/esm/Forms/inputs.d.ts.map +1 -1
- package/lib/esm/Forms/inputs.js +73 -73
- package/lib/esm/Forms/inputs.js.map +1 -1
- package/lib/esm/Forms/inputs.v2.d.ts +11 -11
- package/lib/esm/Forms/inputs.v2.d.ts.map +1 -1
- package/lib/esm/Forms/inputs.v2.js +47 -47
- package/lib/esm/Forms/inputs.v2.js.map +1 -1
- package/lib/esm/Forms/localization.d.ts +2 -1
- package/lib/esm/Forms/localization.d.ts.map +1 -1
- package/lib/esm/Forms/localization.js +196 -60
- package/lib/esm/Forms/localization.js.map +1 -1
- package/lib/esm/state.d.ts +0 -4
- package/lib/esm/state.d.ts.map +1 -1
- package/lib/esm/state.js +0 -23
- package/lib/esm/state.js.map +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +9 -9
- package/src/Forms/inputs.tsx +116 -116
- package/src/Forms/inputs.v2.tsx +78 -79
- package/src/Forms/localization.ts +232 -30
- package/src/state.tsx +0 -30
|
@@ -17,14 +17,14 @@ export declare const PdfViewer: ({ url, height }: {
|
|
|
17
17
|
height?: number | undefined;
|
|
18
18
|
}) => JSX.Element;
|
|
19
19
|
export declare const RatingInput: ({ field, value, onChange }: FormInputProps<'rating'>) => JSX.Element;
|
|
20
|
-
export declare const RankingInput: ({ field, value, onChange }: FormInputProps<'ranking'>) => JSX.Element;
|
|
20
|
+
export declare const RankingInput: ({ field, value, onChange, form }: FormInputProps<'ranking'>) => JSX.Element;
|
|
21
21
|
export declare const DateInput: ({ field, value, onChange, placement, ...props }: {
|
|
22
22
|
field: FormField;
|
|
23
23
|
placement?: "left" | "right" | "bottom" | "top" | undefined;
|
|
24
24
|
} & FormInputProps<"date"> & Styled) => JSX.Element;
|
|
25
|
-
export declare const TableInput: ({ field, value, onChange, ...props }: FormInputProps<'Input Table'>) => JSX.Element;
|
|
25
|
+
export declare const TableInput: ({ field, value, onChange, form, ...props }: FormInputProps<'Input Table'>) => JSX.Element;
|
|
26
26
|
export declare const AutoFocusTextField: (props: TextFieldProps) => JSX.Element;
|
|
27
|
-
export declare const DateStringInput: ({ field, value, onChange, ...props }: FormInputProps<'string'>) => JSX.Element;
|
|
27
|
+
export declare const DateStringInput: ({ field, value, onChange, form, ...props }: FormInputProps<'string'>) => JSX.Element;
|
|
28
28
|
export declare const StringInput: ({ field, value, form, onChange, ...props }: FormInputProps<'string'>) => JSX.Element;
|
|
29
29
|
export declare const StringLongInput: ({ field, value, onChange, form, ...props }: FormInputProps<'string'>) => JSX.Element;
|
|
30
30
|
export declare const PhoneInput: ({ field, value, onChange, form, ...props }: FormInputProps<'phone'>) => JSX.Element;
|
|
@@ -36,13 +36,13 @@ export declare const TimeInput: ({ field, value, onChange, ...props }: FormInput
|
|
|
36
36
|
export declare const TimezoneInput: ({ value, field, onChange, ...props }: FormInputProps<'Timezone'>) => JSX.Element;
|
|
37
37
|
export declare const AddressInput: ({ field, form, value, onChange, ...props }: FormInputProps<'Address'>) => JSX.Element;
|
|
38
38
|
export declare const ESignatureTerms: () => JSX.Element;
|
|
39
|
-
export declare const SignatureInput: ({ value, field, autoFocus, enduser, onChange }: FormInputProps<'signature'>) => JSX.Element;
|
|
39
|
+
export declare const SignatureInput: ({ value, field, autoFocus, enduser, onChange, form }: FormInputProps<'signature'>) => JSX.Element;
|
|
40
40
|
export declare function convertHEIC(file: FileBlob | string): Promise<string>;
|
|
41
|
-
export declare const FileInput: ({ value, onChange, field, existingFileName, uploadingFiles, handleFileUpload, setUploadingFiles }: FormInputProps<"file"> & {
|
|
41
|
+
export declare const FileInput: ({ value, onChange, field, existingFileName, uploadingFiles, handleFileUpload, setUploadingFiles, form }: FormInputProps<"file"> & {
|
|
42
42
|
existingFileName?: string | undefined;
|
|
43
43
|
}) => JSX.Element;
|
|
44
44
|
export declare const safe_create_url: (file: any) => string | null;
|
|
45
|
-
export declare const FilesInput: ({ value, onChange, field, existingFileName, uploadingFiles, handleFileUpload, setUploadingFiles }: FormInputProps<"files"> & {
|
|
45
|
+
export declare const FilesInput: ({ value, onChange, field, existingFileName, uploadingFiles, handleFileUpload, setUploadingFiles, form }: FormInputProps<"files"> & {
|
|
46
46
|
existingFileName?: string | undefined;
|
|
47
47
|
}) => JSX.Element;
|
|
48
48
|
export declare const MultipleChoiceInput: ({ field, form, value: _value, onChange }: FormInputProps<'multiple_choice'>) => JSX.Element;
|
|
@@ -59,13 +59,13 @@ export declare const DatabaseSelectInput: (props: FormInputProps<'Database Selec
|
|
|
59
59
|
responses: FormResponseValue[];
|
|
60
60
|
AddToDatabase?: React.JSXElementConstructor<AddToDatabaseProps>;
|
|
61
61
|
}) => JSX.Element;
|
|
62
|
-
export declare const CanvasMedicationsInput: ({ field, value, onChange }: FormInputProps<'Medications'>) => JSX.Element;
|
|
63
|
-
export declare const MedicationsInput: ({ field, value, onChange, ...props }: FormInputProps<'Medications'>) => JSX.Element;
|
|
64
|
-
export declare const BelugaPatientPreferenceInput: ({ field, value: _value, onChange }: FormInputProps<'Beluga Patient Preference'>) => JSX.Element;
|
|
62
|
+
export declare const CanvasMedicationsInput: ({ field, value, onChange, form }: FormInputProps<'Medications'>) => JSX.Element;
|
|
63
|
+
export declare const MedicationsInput: ({ field, value, onChange, form, ...props }: FormInputProps<'Medications'>) => JSX.Element;
|
|
64
|
+
export declare const BelugaPatientPreferenceInput: ({ field, value: _value, onChange, form }: FormInputProps<'Beluga Patient Preference'>) => JSX.Element;
|
|
65
65
|
export declare const contact_is_valid: (e: Partial<Enduser>) => "Email is invalid" | "Phone is invalid" | "Date of birth should be MM-DD-YYYY" | undefined;
|
|
66
|
-
export declare const RelatedContactsInput: ({ field, value: _value, onChange, error: parentError, ...props }: FormInputProps<'Related Contacts'>) => JSX.Element;
|
|
66
|
+
export declare const RelatedContactsInput: ({ field, value: _value, onChange, error: parentError, form, ...props }: FormInputProps<'Related Contacts'>) => JSX.Element;
|
|
67
67
|
export declare const AppointmentBookingInput: (props: FormInputProps<'Appointment Booking'>) => JSX.Element;
|
|
68
|
-
export declare const HeightInput: ({ field, value, onChange, ...props }: FormInputProps<'Height'>) => JSX.Element;
|
|
68
|
+
export declare const HeightInput: ({ field, value, onChange, form, ...props }: FormInputProps<'Height'>) => JSX.Element;
|
|
69
69
|
export { RedirectInput } from './inputs';
|
|
70
70
|
export declare const HiddenValueInput: ({ goToNextField, goToPreviousField, field, value, onChange, isSinglePage, groupFields }: FormInputProps<'email'>) => JSX.Element;
|
|
71
71
|
export declare const EmotiiInput: ({ goToNextField, goToPreviousField, field, value, onChange, form, formResponseId, ...props }: FormInputProps<'email'>) => JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inputs.v2.d.ts","sourceRoot":"","sources":["../../../src/Forms/inputs.v2.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAwE,MAAM,OAAO,CAAA;AAE5F,OAAO,EAAmH,OAAO,EAAa,cAAc,EAAc,MAAM,eAAe,CAAA;AAC/L,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAIxC,OAAO,EAAE,OAAO,EAAuB,iBAAiB,EAAqG,MAAM,0BAA0B,CAAA;AAO7L,OAAO,EAAc,QAAQ,EAAgD,MAAM,EAAoE,MAAM,IAAI,CAAA;AACjK,OAAO,EAAiC,SAAS,EAAE,MAAM,0BAA0B,CAAA;AAWnF,eAAO,MAAM,cAAc;WAAkC,MAAM;kBAAgB,MAAM,KAAK,IAAI;iBAgBjG,CAAA;AAED,eAAO,MAAM,iBAAiB,EAAE;IAAE,EAAE,EAAE,OAAO,CAAA;CAgB3C,CAAA;AACF,eAAO,MAAM,mBAAmB,EAAE,KAAK,CAAC,aAEvC,CAAA;AAED,eAAO,MAAM,SAAS;SAAiC,MAAM;;iBAoE5D,CAAA;AAED,eAAO,MAAM,WAAW,+BAAgC,eAAe,QAAQ,CAAC,gBA0B/E,CAAA;AAkCD,eAAO,MAAM,YAAY
|
|
1
|
+
{"version":3,"file":"inputs.v2.d.ts","sourceRoot":"","sources":["../../../src/Forms/inputs.v2.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAwE,MAAM,OAAO,CAAA;AAE5F,OAAO,EAAmH,OAAO,EAAa,cAAc,EAAc,MAAM,eAAe,CAAA;AAC/L,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAIxC,OAAO,EAAE,OAAO,EAAuB,iBAAiB,EAAqG,MAAM,0BAA0B,CAAA;AAO7L,OAAO,EAAc,QAAQ,EAAgD,MAAM,EAAoE,MAAM,IAAI,CAAA;AACjK,OAAO,EAAiC,SAAS,EAAE,MAAM,0BAA0B,CAAA;AAWnF,eAAO,MAAM,cAAc;WAAkC,MAAM;kBAAgB,MAAM,KAAK,IAAI;iBAgBjG,CAAA;AAED,eAAO,MAAM,iBAAiB,EAAE;IAAE,EAAE,EAAE,OAAO,CAAA;CAgB3C,CAAA;AACF,eAAO,MAAM,mBAAmB,EAAE,KAAK,CAAC,aAEvC,CAAA;AAED,eAAO,MAAM,SAAS;SAAiC,MAAM;;iBAoE5D,CAAA;AAED,eAAO,MAAM,WAAW,+BAAgC,eAAe,QAAQ,CAAC,gBA0B/E,CAAA;AAkCD,eAAO,MAAM,YAAY,qCAAsC,eAAe,SAAS,CAAC,gBAuDvF,CAAA;AAOD,eAAO,MAAM,SAAS;WAGb,SAAS;;mDAoBjB,CAAA;AAED,eAAO,MAAM,UAAU,+CAAmD,eAAe,aAAa,CAAC,gBAgItG,CAAA;AAED,eAAO,MAAM,kBAAkB,UAAW,cAAc,gBAEvD,CAAA;AAOD,eAAO,MAAM,eAAe,+CAAgD,eAAe,QAAQ,CAAC,gBAqDnG,CAAA;AACD,eAAO,MAAM,WAAW,+CAAgD,eAAe,QAAQ,CAAC,gBAK/F,CAAA;AACD,eAAO,MAAM,eAAe,+CAAgD,eAAe,QAAQ,CAAC,gBAKnG,CAAA;AAED,eAAO,MAAM,UAAU,+CAAgD,eAAe,OAAO,CAAC,gBAK7F,CAAA;AAED,eAAO,MAAM,UAAU,+CAAgD,eAAe,OAAO,CAAC,gBAK7F,CAAA;AAED,eAAO,MAAM,WAAW,+CAAgD,eAAe,QAAQ,CAAC,gBA0C/F,CAAA;AAMD,eAAO,MAAM,cAAc,UAAW,eAAe,WAAW,CAAC,gBAEhE,CAAA;AAGD,eAAO,MAAM,sBAAsB,UAAW,eAAe,oBAAoB,CAAC,gBAEjF,CAAA;AAuCD,eAAO,MAAM,SAAS,yCAA0C,eAAe,QAAQ,CAAC,gBAyBvF,CAAA;AAED,eAAO,MAAM,aAAa,yCAA6C,eAAe,UAAU,CAAC,gBAEhG,CAAA;AAED,eAAO,MAAM,YAAY,+CAAgD,eAAe,SAAS,CAAC,gBAuIjG,CAAA;AAED,eAAO,MAAM,eAAe,mBAoC3B,CAAA;AAED,eAAO,MAAM,cAAc,yDAA+D,eAAe,WAAW,CAAC,gBA6EpH,CAAA;AAUD,wBAAsB,WAAW,CAAE,IAAI,EAAE,QAAQ,GAAG,MAAM,mBAmBzD;AAGD,eAAO,MAAM,SAAS;;iBA8GrB,CAAA;AAED,eAAO,MAAM,eAAe,SAAU,GAAG,kBAOxC,CAAA;AAED,eAAO,MAAM,UAAU;;iBA0HtB,CAAA;AAED,eAAO,MAAM,mBAAmB,6CAA8C,eAAe,iBAAiB,CAAC,gBA4J9G,CAAA;AAOD,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAA;AAEtC,eAAO,MAAM,QAAQ;eAA4D,MAAM;iBAAe,MAAM;;0BAuB3G,CAAA;AAED,eAAO,MAAM,aAAa,+BAAgC,eAAe,UAAU,CAAC,gBAwDnF,CAAA;AAID,OAAO,EAAE,kBAAkB,IAAI,0BAA0B,EAAoD,MAAM,UAAU,CAAA;AAG7H,MAAM,MAAM,kBAAkB,GAAG,0BAA0B,CAAA;AAG3D,eAAO,MAAM,mBAAmB,UAAW,eAAe,iBAAiB,CAAC,GAAG;IAC7E,SAAS,EAAE,iBAAiB,EAAE,CAAC;IAC/B,aAAa,CAAC,EAAE,MAAM,qBAAqB,CAAC,kBAAkB,CAAC,CAAC;CACjE,gBAGA,CAAA;AAgID,eAAO,MAAM,sBAAsB,qCAAyC,eAAe,aAAa,CAAC,gBAyGxG,CAAA;AAED,eAAO,MAAM,gBAAgB,+CAAgD,eAAe,aAAa,CAAC,gBAySzG,CAAA;AAED,eAAO,MAAM,4BAA4B,6CAA8C,eAAe,2BAA2B,CAAC,gBAoKjI,CAAA;AAED,eAAO,MAAM,gBAAgB,MAAO,QAAQ,OAAO,CAAC,+FAkBnD,CAAA;AAED,eAAO,MAAM,oBAAoB,2EAA4E,eAAe,kBAAkB,CAAC,gBAiL9I,CAAA;AAGD,eAAO,MAAM,uBAAuB,UAAW,eAAe,qBAAqB,CAAC,gBAEnF,CAAA;AAED,eAAO,MAAM,WAAW,+CAA0D,eAAe,QAAQ,CAAC,gBAezG,CAAA;AAGD,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AAExC,eAAO,MAAM,gBAAgB,4FAA6F,eAAe,OAAO,CAAC,gBA+ChJ,CAAA;AAED,eAAO,MAAM,WAAW,iGAAkG,eAAe,OAAO,CAAC,gBA8ChJ,CAAA;AAMD,eAAO,MAAM,cAAc,iGAAkG,eAAe,WAAW,CAAC,gBAqHvJ,CAAA;AAGD,eAAO,MAAM,eAAe,iGAAkG,eAAe,YAAY,CAAC,gBAsDzJ,CAAA;AAED,eAAO,MAAM,aAAa,+BAAgC,eAAe,WAAW,CAAC,gBAEpF,CAAA;AAED,eAAO,MAAM,eAAe;mBACX,MAAM,QAAQ,CAAC,MAAM,cAAc,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC;iBA6CxE,CAAA"}
|
|
@@ -176,7 +176,7 @@ var getListStyle = function (isDraggingOver) { return ({
|
|
|
176
176
|
// width: '250px'
|
|
177
177
|
}); };
|
|
178
178
|
export var RankingInput = function (_a) {
|
|
179
|
-
var field = _a.field, value = _a.value, onChange = _a.onChange;
|
|
179
|
+
var field = _a.field, value = _a.value, onChange = _a.onChange, form = _a.form;
|
|
180
180
|
return (_jsxs(Grid, __assign({ container: true, direction: 'column' }, { children: [_jsx(DragDropContext, __assign({ onDragEnd: function (result) {
|
|
181
181
|
if (!value)
|
|
182
182
|
return;
|
|
@@ -184,7 +184,7 @@ export var RankingInput = function (_a) {
|
|
|
184
184
|
return;
|
|
185
185
|
}
|
|
186
186
|
onChange(reorder(value, result.source.index, result.destination.index), field.id);
|
|
187
|
-
} }, { children: _jsx(Droppable, __assign({ droppableId: "droppable" }, { children: function (provided, snapshot) { return (_jsxs(Box, __assign({}, provided.droppableProps, { ref: provided.innerRef, sx: getListStyle(snapshot.isDraggingOver) }, { children: [(value !== null && value !== void 0 ? value : []).map(function (item, index) { return (_jsx(Draggable, __assign({ draggableId: item, index: index }, { children: function (provided, snapshot) { return (_jsxs(Grid, __assign({ container: true, alignItems: "center", justifyContent: "space-between", ref: provided.innerRef }, provided.draggableProps, provided.dragHandleProps, { sx: getItemStyle(snapshot.isDragging, provided.draggableProps.style) }, { children: [item, _jsx(DragIndicatorIcon, { color: "primary" })] }))); } }), item)); }), provided.placeholder] }))); } })) })), _jsx(Typography, __assign({ color: "primary", style: { marginTop: 3 } }, { children: "Drag and drop to re-order the above options" }))] })));
|
|
187
|
+
} }, { children: _jsx(Droppable, __assign({ droppableId: "droppable" }, { children: function (provided, snapshot) { return (_jsxs(Box, __assign({}, provided.droppableProps, { ref: provided.innerRef, sx: getListStyle(snapshot.isDraggingOver) }, { children: [(value !== null && value !== void 0 ? value : []).map(function (item, index) { return (_jsx(Draggable, __assign({ draggableId: item, index: index }, { children: function (provided, snapshot) { return (_jsxs(Grid, __assign({ container: true, alignItems: "center", justifyContent: "space-between", ref: provided.innerRef }, provided.draggableProps, provided.dragHandleProps, { sx: getItemStyle(snapshot.isDragging, provided.draggableProps.style) }, { children: [item, _jsx(DragIndicatorIcon, { color: "primary" })] }))); } }), item)); }), provided.placeholder] }))); } })) })), _jsx(Typography, __assign({ color: "primary", style: { marginTop: 3 } }, { children: form_display_text_for_language(form, "Drag and drop to re-order the above options") }))] })));
|
|
188
188
|
};
|
|
189
189
|
var CustomDateInput = forwardRef(function (props, ref) { return (_jsx(TextField, __assign({ InputProps: defaultInputProps, fullWidth: true, inputRef: ref }, props))); });
|
|
190
190
|
export var DateInput = function (_a) {
|
|
@@ -197,7 +197,7 @@ export var DateInput = function (_a) {
|
|
|
197
197
|
};
|
|
198
198
|
export var TableInput = function (_a) {
|
|
199
199
|
var _b;
|
|
200
|
-
var field = _a.field, _d = _a.value, value = _d === void 0 ? [] : _d, onChange = _a.onChange, props = __rest(_a, ["field", "value", "onChange"]);
|
|
200
|
+
var field = _a.field, _d = _a.value, value = _d === void 0 ? [] : _d, onChange = _a.onChange, form = _a.form, props = __rest(_a, ["field", "value", "onChange", "form"]);
|
|
201
201
|
var choices = (_b = field.options) === null || _b === void 0 ? void 0 : _b.tableChoices;
|
|
202
202
|
var handleNewRow = useCallback(function () {
|
|
203
203
|
if (!(choices === null || choices === void 0 ? void 0 : choices.length))
|
|
@@ -225,7 +225,7 @@ export var TableInput = function (_a) {
|
|
|
225
225
|
handleNewRow();
|
|
226
226
|
}, [field.isOptional, value, handleNewRow]);
|
|
227
227
|
if (!(choices === null || choices === void 0 ? void 0 : choices.length)) {
|
|
228
|
-
return _jsx(Typography, __assign({ color: "error" }, { children: "No input choices available" }));
|
|
228
|
+
return _jsx(Typography, __assign({ color: "error" }, { children: form_display_text_for_language(form, "No input choices available") }));
|
|
229
229
|
}
|
|
230
230
|
var length = choices.length || 1;
|
|
231
231
|
var iconWidth = '35px';
|
|
@@ -245,13 +245,13 @@ export var TableInput = function (_a) {
|
|
|
245
245
|
recordId: JSON.parse(((_h = row.find(function (_, _i) { return columnIndex === _i; })) === null || _h === void 0 ? void 0 : _h.entry) || '{}').recordId || '',
|
|
246
246
|
}] : [], onChange: function (records) { var _a; return handleChange(i, columnIndex, { label: v.label, entry: JSON.stringify((_a = records === null || records === void 0 ? void 0 : records[0]) !== null && _a !== void 0 ? _a : '') }); } }))
|
|
247
247
|
: null }), v.label));
|
|
248
|
-
}), _jsx(Grid, __assign({ item: true, sx: { ml: 'auto', width: iconWidth } }, { children: _jsx(LabeledIconButton, { Icon: CancelIcon, label: "Remove", onClick: function () { return handleRemove(i); }, disabled: !field.isOptional && value.length === 1 }) }))] }), i), _jsx(Divider, { flexItem: true, sx: { my: 1 } })] })); }), _jsx(Button, __assign({ variant: "outlined", size: "small", onClick: handleNewRow, sx: { width: 200 } }, { children: "Add new entry" }))] })));
|
|
248
|
+
}), _jsx(Grid, __assign({ item: true, sx: { ml: 'auto', width: iconWidth } }, { children: _jsx(LabeledIconButton, { Icon: CancelIcon, label: form_display_text_for_language(form, "Remove"), onClick: function () { return handleRemove(i); }, disabled: !field.isOptional && value.length === 1 }) }))] }), i), _jsx(Divider, { flexItem: true, sx: { my: 1 } })] })); }), _jsx(Button, __assign({ variant: "outlined", size: "small", onClick: handleNewRow, sx: { width: 200 } }, { children: form_display_text_for_language(form, "Add new entry") }))] })));
|
|
249
249
|
};
|
|
250
250
|
export var AutoFocusTextField = function (props) { return (_jsx(TextField, __assign({ InputProps: defaultInputProps }, props))); };
|
|
251
251
|
var CustomDateStringInput = forwardRef(function (props, ref) { return (_jsx(TextField, __assign({ InputProps: defaultInputProps, fullWidth: true, inputRef: ref }, props))); });
|
|
252
252
|
export var DateStringInput = function (_a) {
|
|
253
253
|
var _b;
|
|
254
|
-
var field = _a.field, value = _a.value, onChange = _a.onChange, props = __rest(_a, ["field", "value", "onChange"]);
|
|
254
|
+
var field = _a.field, value = _a.value, onChange = _a.onChange, form = _a.form, props = __rest(_a, ["field", "value", "onChange", "form"]);
|
|
255
255
|
var inputRef = useRef(null);
|
|
256
256
|
// if (value && isDateString(value)) {
|
|
257
257
|
// console.log(value, new Date(
|
|
@@ -268,7 +268,7 @@ export var DateStringInput = function (_a) {
|
|
|
268
268
|
: undefined, onChange: function (d) { return onChange === null || onChange === void 0 ? void 0 : onChange(mm_dd_yyyy(d), field.id); }, showTimeSelect: false, required: !field.isOptional, autoComplete: "off", dateFormat: "MM-dd-yyyy", customInput: _jsx(CustomDateStringInput, __assign({ inputRef: inputRef }, props, { label: (!field.title && field.placeholder) ? field.placeholder : props.label })),
|
|
269
269
|
// className={css`width: 100%;`}
|
|
270
270
|
className: css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["", ""], ["", ""])), datepickerCSS) }))
|
|
271
|
-
: (_jsx(AutoFocusTextField, __assign({}, props, { required: !field.isOptional, fullWidth: true, placeholder: "MM-DD-YYYY", value: value, label: (!field.title && field.placeholder) ? field.placeholder : props.label, onChange: function (e) {
|
|
271
|
+
: (_jsx(AutoFocusTextField, __assign({}, props, { required: !field.isOptional, fullWidth: true, placeholder: form_display_text_for_language(form, "MM-DD-YYYY"), value: value, label: (!field.title && field.placeholder) ? field.placeholder : props.label, onChange: function (e) {
|
|
272
272
|
var v = e.target.value || '';
|
|
273
273
|
onChange((v.length === 2 && /\d{2}/.test(v) && (value === null || value === void 0 ? void 0 : value.length) !== 3 // allow deletion
|
|
274
274
|
? v + '-'
|
|
@@ -383,7 +383,7 @@ export var AddressInput = function (_a) {
|
|
|
383
383
|
var _a;
|
|
384
384
|
return onChange(__assign(__assign({}, value), { zipCode: (_a = e.target.value) !== null && _a !== void 0 ? _a : '' }), field.id);
|
|
385
385
|
} })) })), field.fullZIP &&
|
|
386
|
-
_jsx(Grid, __assign({ item: true, xs: 3 }, { children: _jsx(TextField, __assign({}, props, { size: "small", label: "ZIP+4", required: !field.isOptional && field.fullZIP, InputProps: defaultInputProps, value: (_o = value === null || value === void 0 ? void 0 : value.zipPlusFour) !== null && _o !== void 0 ? _o : '', placeholder: "ZIP + 4", onChange: function (e) {
|
|
386
|
+
_jsx(Grid, __assign({ item: true, xs: 3 }, { children: _jsx(TextField, __assign({}, props, { size: "small", label: form_display_text_for_language(form, "ZIP+4"), required: !field.isOptional && field.fullZIP, InputProps: defaultInputProps, value: (_o = value === null || value === void 0 ? void 0 : value.zipPlusFour) !== null && _o !== void 0 ? _o : '', placeholder: form_display_text_for_language(form, "ZIP + 4"), onChange: function (e) {
|
|
387
387
|
var _a;
|
|
388
388
|
return onChange(__assign(__assign({}, value), { zipPlusFour: (_a = e.target.value) !== null && _a !== void 0 ? _a : '' }), field.id);
|
|
389
389
|
} })) }))] })) }))] }))));
|
|
@@ -404,7 +404,7 @@ export var ESignatureTerms = function () {
|
|
|
404
404
|
};
|
|
405
405
|
export var SignatureInput = function (_a) {
|
|
406
406
|
var _b, _d, _e, _f, _g;
|
|
407
|
-
var value = _a.value, field = _a.field, _h = _a.autoFocus, autoFocus = _h === void 0 ? true : _h, enduser = _a.enduser, onChange = _a.onChange;
|
|
407
|
+
var value = _a.value, field = _a.field, _h = _a.autoFocus, autoFocus = _h === void 0 ? true : _h, enduser = _a.enduser, onChange = _a.onChange, form = _a.form;
|
|
408
408
|
var prefill = (((_b = field.options) === null || _b === void 0 ? void 0 : _b.prefillSignature) && (enduser === null || enduser === void 0 ? void 0 : enduser.fname) && enduser.lname
|
|
409
409
|
? "".concat(enduser.fname, " ").concat(enduser.lname)
|
|
410
410
|
: undefined);
|
|
@@ -434,7 +434,7 @@ export var SignatureInput = function (_a) {
|
|
|
434
434
|
height: 400,
|
|
435
435
|
width: '100%',
|
|
436
436
|
marginBottom: '5px'
|
|
437
|
-
} }), _jsx("a", __assign({ href: field.options.signatureUrl, target: "_blank", rel: "noopener noreferrer" }, { children: "View document in new tab" }))] })), _jsxs(Grid, __assign({ item: true, xs: 12 }, { children: [_jsx(Checkbox, { style: { margin: 0, marginTop: 5, padding: 0, paddingRight: 3 }, color: "primary", checked: !!(value === null || value === void 0 ? void 0 : value.signed), onClick: function () { return handleConsentChange(); }, inputProps: { 'aria-label': 'consent to e-signature checkbox' } }), _jsxs(Typography, __assign({ component: "span", style: { position: 'relative', top: 5, left: 2 } }, { children: ["I consent to use ",
|
|
437
|
+
} }), _jsx("a", __assign({ href: field.options.signatureUrl, target: "_blank", rel: "noopener noreferrer" }, { children: form_display_text_for_language(form, "View document in new tab") }))] })), _jsxs(Grid, __assign({ item: true, xs: 12 }, { children: [_jsx(Checkbox, { style: { margin: 0, marginTop: 5, padding: 0, paddingRight: 3 }, color: "primary", checked: !!(value === null || value === void 0 ? void 0 : value.signed), onClick: function () { return handleConsentChange(); }, inputProps: { 'aria-label': 'consent to e-signature checkbox' } }), _jsxs(Typography, __assign({ component: "span", style: { position: 'relative', top: 5, left: 2 } }, { children: [form_display_text_for_language(form, "I consent to use"), " ", _jsxs("a", __assign({ href: "/e-signature-terms?name=".concat(((_g = field.options) === null || _g === void 0 ? void 0 : _g.esignatureTermsCompanyName) || ''), target: "_blank", rel: "noopener noreferrer" }, { children: [" ", form_display_text_for_language(form, "electronic signatures"), " "] }))] }))] })), _jsxs(Grid, __assign({ item: true, xs: 12, style: { marginTop: 12 } }, { children: [_jsx(TextField, { disabled: !(value === null || value === void 0 ? void 0 : value.signed), autoFocus: autoFocus, style: { width: '100%' }, size: "small", "aria-label": form_display_text_for_language(form, "Full Name"), value: value === null || value === void 0 ? void 0 : value.fullName, placeholder: prefill || form_display_text_for_language(form, "Full Name"), variant: "outlined", onChange: function (e) { return handleNameChange(e.target.value); }, InputProps: defaultInputProps }), _jsx(Typography, __assign({ color: "primary", style: { fontSize: 15, marginTop: 2 } }, { children: form_display_text_for_language(form, "Enter your legal full name to complete the signature") }))] }))] })));
|
|
438
438
|
};
|
|
439
439
|
var formatBytes = function (bytes) {
|
|
440
440
|
if (bytes === 0)
|
|
@@ -476,7 +476,7 @@ export function convertHEIC(file) {
|
|
|
476
476
|
var value_is_image = function (f) { var _a; return (_a = f === null || f === void 0 ? void 0 : f.type) === null || _a === void 0 ? void 0 : _a.includes('image'); };
|
|
477
477
|
export var FileInput = function (_a) {
|
|
478
478
|
var _b;
|
|
479
|
-
var value = _a.value, onChange = _a.onChange, field = _a.field, existingFileName = _a.existingFileName, uploadingFiles = _a.uploadingFiles, handleFileUpload = _a.handleFileUpload, setUploadingFiles = _a.setUploadingFiles;
|
|
479
|
+
var value = _a.value, onChange = _a.onChange, field = _a.field, existingFileName = _a.existingFileName, uploadingFiles = _a.uploadingFiles, handleFileUpload = _a.handleFileUpload, setUploadingFiles = _a.setUploadingFiles, form = _a.form;
|
|
480
480
|
var _d = useState(''), error = _d[0], setError = _d[1];
|
|
481
481
|
var _e = useDropzone({
|
|
482
482
|
onDrop: useCallback(function (acceptedFiles) {
|
|
@@ -534,8 +534,8 @@ export var FileInput = function (_a) {
|
|
|
534
534
|
? _jsx("img", { src: preview, style: { paddingLeft: '10%', width: '80%', maxHeight: 200 } })
|
|
535
535
|
: "".concat(truncate_string(value.name, { length: 30, showEllipsis: true }), " selected!"))
|
|
536
536
|
: capture_is_supported()
|
|
537
|
-
? (_jsxs(Grid, __assign({ container: true, direction: "column", alignItems: "center" }, { children: [_jsx(Grid, __assign({ item: true }, { children: _jsx(AddPhotoAlternateIcon, { color: "primary" }) })), _jsx(Grid, __assign({ item: true }, { children: _jsx(Typography, __assign({ sx: { fontSize: 14, textAlign: 'center' } }, { children: "Select file or take picture" })) }))] })))
|
|
538
|
-
: _jsxs(Grid, __assign({ container: true, direction: "column", alignItems: "center", rowGap: 2 }, { children: [_jsx(UploadFile, { color: "primary", sx: { fontSize: 25 } }), _jsx(Typography, { children: isDragActive ? "Drop to select file" : "Click or drag and drop" })] })) })] })), _jsx(Grid, __assign({ item: true, alignSelf: "center", sx: { mt: 0.5 } }, { children: (!(value === null || value === void 0 ? void 0 : value.name) && existingFileName) &&
|
|
537
|
+
? (_jsxs(Grid, __assign({ container: true, direction: "column", alignItems: "center" }, { children: [_jsx(Grid, __assign({ item: true }, { children: _jsx(AddPhotoAlternateIcon, { color: "primary" }) })), _jsx(Grid, __assign({ item: true }, { children: _jsx(Typography, __assign({ sx: { fontSize: 14, textAlign: 'center' } }, { children: form_display_text_for_language(form, "Select file or take picture") })) }))] })))
|
|
538
|
+
: _jsxs(Grid, __assign({ container: true, direction: "column", alignItems: "center", rowGap: 2 }, { children: [_jsx(UploadFile, { color: "primary", sx: { fontSize: 25 } }), _jsx(Typography, { children: isDragActive ? form_display_text_for_language(form, "Drop to select file") : form_display_text_for_language(form, "Click or drag and drop") })] })) })] })), _jsx(Grid, __assign({ item: true, alignSelf: "center", sx: { mt: 0.5 } }, { children: (!(value === null || value === void 0 ? void 0 : value.name) && existingFileName) &&
|
|
539
539
|
_jsxs(Typography, { children: [existingFileName, " selected!"] }) })), error &&
|
|
540
540
|
_jsx(Grid, __assign({ item: true, alignSelf: "center", sx: { mt: 0.5 } }, { children: _jsx(Typography, __assign({ color: "error" }, { children: error })) }))] })));
|
|
541
541
|
};
|
|
@@ -550,7 +550,7 @@ export var safe_create_url = function (file) {
|
|
|
550
550
|
};
|
|
551
551
|
export var FilesInput = function (_a) {
|
|
552
552
|
var _b;
|
|
553
|
-
var value = _a.value, onChange = _a.onChange, field = _a.field, existingFileName = _a.existingFileName, uploadingFiles = _a.uploadingFiles, handleFileUpload = _a.handleFileUpload, setUploadingFiles = _a.setUploadingFiles;
|
|
553
|
+
var value = _a.value, onChange = _a.onChange, field = _a.field, existingFileName = _a.existingFileName, uploadingFiles = _a.uploadingFiles, handleFileUpload = _a.handleFileUpload, setUploadingFiles = _a.setUploadingFiles, form = _a.form;
|
|
554
554
|
var _d = useState(''), error = _d[0], setError = _d[1];
|
|
555
555
|
var _e = useDropzone({
|
|
556
556
|
onDrop: useCallback(function (acceptedFiles) { return __awaiter(void 0, void 0, void 0, function () {
|
|
@@ -619,11 +619,11 @@ export var FilesInput = function (_a) {
|
|
|
619
619
|
cursor: 'pointer',
|
|
620
620
|
}
|
|
621
621
|
}, alignItems: "center", justifyContent: "center" }, { children: [_jsx("input", __assign({}, getInputProps({ multiple: false }))), _jsx("p", { children: capture_is_supported()
|
|
622
|
-
? (_jsxs(Grid, __assign({ container: true, direction: "column", alignItems: "center" }, { children: [_jsx(Grid, __assign({ item: true }, { children: _jsx(AddPhotoAlternateIcon, { color: "primary" }) })), _jsx(Grid, __assign({ item: true }, { children: _jsx(Typography, __assign({ sx: { fontSize: 14, textAlign: 'center' } }, { children: "Select files or take pictures" })) }))] })))
|
|
623
|
-
: _jsxs(Grid, __assign({ container: true, direction: "column", alignItems: "center", rowGap: 2 }, { children: [_jsx(UploadFile, { color: "primary", sx: { fontSize: 25 } }), _jsx(Typography, { children: isDragActive ? "Drop to select files" : "Click or drag and drop" })] })) })] })), _jsx(Grid, __assign({ container: true, direction: "column", sx: { overflowY: 'auto', maxHeight: '250px', mt: 1 }, wrap: "nowrap" }, { children: value === null || value === void 0 ? void 0 : value.map(function (file, i) {
|
|
622
|
+
? (_jsxs(Grid, __assign({ container: true, direction: "column", alignItems: "center" }, { children: [_jsx(Grid, __assign({ item: true }, { children: _jsx(AddPhotoAlternateIcon, { color: "primary" }) })), _jsx(Grid, __assign({ item: true }, { children: _jsx(Typography, __assign({ sx: { fontSize: 14, textAlign: 'center' } }, { children: form_display_text_for_language(form, "Select files or take pictures") })) }))] })))
|
|
623
|
+
: _jsxs(Grid, __assign({ container: true, direction: "column", alignItems: "center", rowGap: 2 }, { children: [_jsx(UploadFile, { color: "primary", sx: { fontSize: 25 } }), _jsx(Typography, { children: isDragActive ? form_display_text_for_language(form, "Drop to select files") : form_display_text_for_language(form, "Click or drag and drop") })] })) })] })), _jsx(Grid, __assign({ container: true, direction: "column", sx: { overflowY: 'auto', maxHeight: '250px', mt: 1 }, wrap: "nowrap" }, { children: value === null || value === void 0 ? void 0 : value.map(function (file, i) {
|
|
624
624
|
var _a;
|
|
625
625
|
return (_jsx(Grid, __assign({ item: true, sx: { mt: 0.5 } }, { children: _jsxs(Grid, __assign({ container: true, alignItems: "center", justifyContent: "space-between", wrap: "nowrap" }, { children: [_jsx(Grid, __assign({ item: true }, { children: _jsxs(Grid, __assign({ container: true, alignItems: "center" }, { children: [_jsx(Typography, __assign({ sx: { mr: 1 } }, { children: file.name })), ((_a = file.type) === null || _a === void 0 ? void 0 : _a.includes('image')) && previews[i] &&
|
|
626
|
-
_jsx(Grid, __assign({ item: true }, { children: _jsx("img", { src: previews[i], style: { maxWidth: '45%', maxHeight: 80, height: '100%' } }) }))] })) })), _jsx(Grid, __assign({ item: true }, { children: _jsx(LabeledIconButton, { label: "Remove", Icon: Delete, onClick: function () { return onChange(value.filter(function (f, _i) { return i !== _i; }), field.id); } }) }))] })) }), i));
|
|
626
|
+
_jsx(Grid, __assign({ item: true }, { children: _jsx("img", { src: previews[i], style: { maxWidth: '45%', maxHeight: 80, height: '100%' } }) }))] })) })), _jsx(Grid, __assign({ item: true }, { children: _jsx(LabeledIconButton, { label: form_display_text_for_language(form, "Remove"), Icon: Delete, onClick: function () { return onChange(value.filter(function (f, _i) { return i !== _i; }), field.id); } }) }))] })) }), i));
|
|
627
627
|
}) })), error &&
|
|
628
628
|
_jsx(Grid, __assign({ item: true, alignSelf: "center", sx: { mt: 0.5 } }, { children: _jsx(Typography, __assign({ color: "error" }, { children: error })) }))] })));
|
|
629
629
|
};
|
|
@@ -882,7 +882,7 @@ var filterOptions = function (options, _a) {
|
|
|
882
882
|
var FDB_URL = "http://www.fdbhealth.com/";
|
|
883
883
|
export var CanvasMedicationsInput = function (_a) {
|
|
884
884
|
var _b;
|
|
885
|
-
var field = _a.field, _d = _a.value, value = _d === void 0 ? [] : _d, onChange = _a.onChange;
|
|
885
|
+
var field = _a.field, _d = _a.value, value = _d === void 0 ? [] : _d, onChange = _a.onChange, form = _a.form;
|
|
886
886
|
var session = useResolvedSession();
|
|
887
887
|
var _e = useState(''), query = _e[0], setQuery = _e[1];
|
|
888
888
|
var _f = useState([]), results = _f[0], setResults = _f[1];
|
|
@@ -920,17 +920,17 @@ export var CanvasMedicationsInput = function (_a) {
|
|
|
920
920
|
}, 200);
|
|
921
921
|
return function () { clearTimeout(t); };
|
|
922
922
|
}, [session, query, (_b = field === null || field === void 0 ? void 0 : field.options) === null || _b === void 0 ? void 0 : _b.dataSource]);
|
|
923
|
-
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) {
|
|
923
|
+
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 ? form_display_text_for_language(form, 'No results found') : form_display_text_for_language(form, 'Type to start search'), onChange: function (e, v) {
|
|
924
924
|
if (!v) {
|
|
925
925
|
return;
|
|
926
926
|
}
|
|
927
927
|
onChange(v, field.id);
|
|
928
928
|
setResults([]);
|
|
929
|
-
}, getOptionLabel: function (v) { return first_letter_capitalized(v.displayTerm); }, 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 medications..." }))); }, renderTags: function (value, getTagProps) {
|
|
929
|
+
}, getOptionLabel: function (v) { return first_letter_capitalized(v.displayTerm); }, 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: form_display_text_for_language(form, "Search medications...") }))); }, renderTags: function (value, getTagProps) {
|
|
930
930
|
return value.map(function (value, index) { return (_jsx(Chip, __assign({ label: _jsx(Typography, __assign({ style: { whiteSpace: 'normal' } }, { children: value.displayTerm })) }, getTagProps({ index: index }), { sx: { height: "100%", py: 0.5 } }))); });
|
|
931
931
|
} }) })), (value || []).map(function (medication, i) {
|
|
932
932
|
var _a;
|
|
933
|
-
return (_jsx(Grid, __assign({ item: true }, { children: _jsxs(Grid, __assign({ container: true, direction: "column", spacing: 0.75 }, { children: [_jsx(Grid, __assign({ item: true }, { children: _jsx(Typography, __assign({ noWrap: true, sx: { fontSize: 14 } }, { children: medication.drugName })) })), _jsx(Grid, __assign({ item: true }, { children: _jsx(TextField, { InputProps: { sx: defaultInputProps.sx }, fullWidth: true, size: "small", label: "Medication instructions: how much you take, how often, and when", value: ((_a = medication.dosage) === null || _a === void 0 ? void 0 : _a.description) || '', onChange: function (e) { return (onChange((value || []).map(function (v, _i) {
|
|
933
|
+
return (_jsx(Grid, __assign({ item: true }, { children: _jsxs(Grid, __assign({ container: true, direction: "column", spacing: 0.75 }, { children: [_jsx(Grid, __assign({ item: true }, { children: _jsx(Typography, __assign({ noWrap: true, sx: { fontSize: 14 } }, { children: medication.drugName })) })), _jsx(Grid, __assign({ item: true }, { children: _jsx(TextField, { InputProps: { sx: defaultInputProps.sx }, fullWidth: true, size: "small", label: form_display_text_for_language(form, "Medication instructions: how much you take, how often, and when"), value: ((_a = medication.dosage) === null || _a === void 0 ? void 0 : _a.description) || '', onChange: function (e) { return (onChange((value || []).map(function (v, _i) {
|
|
934
934
|
return i === _i
|
|
935
935
|
? __assign(__assign({}, v), { dosage: __assign(__assign({}, v.dosage), { description: e.target.value }) }) : v;
|
|
936
936
|
}), field.id)); } }) })), _jsx(Grid, __assign({ item: true }, { children: _jsx(Divider, { flexItem: true, sx: { my: 0.5 } }) }))] })) }), i));
|
|
@@ -938,7 +938,7 @@ export var CanvasMedicationsInput = function (_a) {
|
|
|
938
938
|
};
|
|
939
939
|
export var MedicationsInput = function (_a) {
|
|
940
940
|
var _b, _d;
|
|
941
|
-
var field = _a.field, value = _a.value, onChange = _a.onChange, props = __rest(_a, ["field", "value", "onChange"]);
|
|
941
|
+
var field = _a.field, value = _a.value, onChange = _a.onChange, form = _a.form, props = __rest(_a, ["field", "value", "onChange", "form"]);
|
|
942
942
|
var _e = useMedications({
|
|
943
943
|
dontFetch: ((_b = field.options) === null || _b === void 0 ? void 0 : _b.dataSource) === CANVAS_TITLE
|
|
944
944
|
}), displayTerms = _e.displayTerms, doneLoading = _e.doneLoading, getCodesForDrug = _e.getCodesForDrug, getDrugsForDisplayTerm = _e.getDrugsForDisplayTerm;
|
|
@@ -1012,7 +1012,7 @@ export var MedicationsInput = function (_a) {
|
|
|
1012
1012
|
}
|
|
1013
1013
|
});
|
|
1014
1014
|
}); }, renderInput: function (params) {
|
|
1015
|
-
return _jsx(TextField, __assign({}, params, { InputProps: __assign(__assign({}, params.InputProps), { sx: defaultInputProps.sx }), required: !field.isOptional, label: "Search", size: "small", fullWidth: true }));
|
|
1015
|
+
return _jsx(TextField, __assign({}, params, { InputProps: __assign(__assign({}, params.InputProps), { sx: defaultInputProps.sx }), required: !field.isOptional, label: form_display_text_for_language(form, "Search"), size: "small", fullWidth: true }));
|
|
1016
1016
|
} }) })), v.displayTerm && v.drugName !== "Unknown" && !v.otherDrug &&
|
|
1017
1017
|
_jsx(Grid, __assign({ item: true, sx: { mt: 1.5 } }, { children: _jsx(Autocomplete, { freeSolo: false, options: drugs[v.displayTerm]
|
|
1018
1018
|
? drugs[v.displayTerm].length
|
|
@@ -1043,9 +1043,9 @@ export var MedicationsInput = function (_a) {
|
|
|
1043
1043
|
}
|
|
1044
1044
|
});
|
|
1045
1045
|
}); }, renderInput: function (params) {
|
|
1046
|
-
return _jsx(TextField, __assign({}, params, { InputProps: __assign(__assign({}, params.InputProps), { sx: defaultInputProps.sx }), required: !field.isOptional, label: "Drug Select", size: "small", fullWidth: true }));
|
|
1046
|
+
return _jsx(TextField, __assign({}, params, { InputProps: __assign(__assign({}, params.InputProps), { sx: defaultInputProps.sx }), required: !field.isOptional, label: form_display_text_for_language(form, "Drug Select"), size: "small", fullWidth: true }));
|
|
1047
1047
|
} }) })), v.displayTerm && (v.drugName === "Unknown" || !v.drugName) &&
|
|
1048
|
-
_jsx(Grid, __assign({ item: true, sx: { mt: 1 } }, { children: _jsx(TextField, { label: 'Other Drug', fullWidth: true, size: "small", required: true, InputProps: defaultInputProps, value: (_g = (_f = value === null || value === void 0 ? void 0 : value.find(function (v, _i) { return _i === i; })) === null || _f === void 0 ? void 0 : _f.otherDrug) !== null && _g !== void 0 ? _g : '', onChange: function (e) { return (onChange((value !== null && value !== void 0 ? value : []).map(function (_v, _i) { return (i === _i
|
|
1048
|
+
_jsx(Grid, __assign({ item: true, sx: { mt: 1 } }, { children: _jsx(TextField, { label: form_display_text_for_language(form, 'Other Drug'), fullWidth: true, size: "small", required: true, InputProps: defaultInputProps, value: (_g = (_f = value === null || value === void 0 ? void 0 : value.find(function (v, _i) { return _i === i; })) === null || _f === void 0 ? void 0 : _f.otherDrug) !== null && _g !== void 0 ? _g : '', onChange: function (e) { return (onChange((value !== null && value !== void 0 ? value : []).map(function (_v, _i) { return (i === _i
|
|
1049
1049
|
? __assign(__assign({}, _v), { otherDrug: e.target.value }) : _v); }), field.id)); } }) })), v.displayTerm &&
|
|
1050
1050
|
_jsxs(Grid, __assign({ container: true, spacing: 1, sx: { mt: 0 } }, { children: [_jsxs(Grid, __assign({ item: true, xs: 12, md: 6 }, { children: [_jsx(Typography, __assign({ sx: { fontSize: 13.5 } }, { children: "Units (e.g. capsule, table, puff) per dose?" })), _jsx(TextField, { type: "number", size: "small", fullWidth: true, InputProps: defaultInputProps, value: (_h = v.dosage) === null || _h === void 0 ? void 0 : _h.quantity, onChange: function (e) {
|
|
1051
1051
|
return onChange((value !== null && value !== void 0 ? value : []).map(function (_v, _i) { return (i === _i
|
|
@@ -1071,15 +1071,15 @@ export var MedicationsInput = function (_a) {
|
|
|
1071
1071
|
return [2 /*return*/];
|
|
1072
1072
|
});
|
|
1073
1073
|
}); } })] }))] })), v.displayTerm &&
|
|
1074
|
-
_jsx(Grid, __assign({ item: true, sx: { mt: 1.25 } }, { children: _jsx(TextField, { label: "Reason for taking medication", size: "small", fullWidth: true, InputProps: defaultInputProps, value: (_l = v.reasonForTaking) !== null && _l !== void 0 ? _l : '', onChange: function (e) {
|
|
1074
|
+
_jsx(Grid, __assign({ item: true, sx: { mt: 1.25 } }, { children: _jsx(TextField, { label: form_display_text_for_language(form, "Reason for taking medication"), size: "small", fullWidth: true, InputProps: defaultInputProps, value: (_l = v.reasonForTaking) !== null && _l !== void 0 ? _l : '', onChange: function (e) {
|
|
1075
1075
|
return onChange((value !== null && value !== void 0 ? value : []).map(function (_v, _i) { return (i === _i
|
|
1076
1076
|
? __assign(__assign({}, _v), { reasonForTaking: e.target.value }) : _v); }), field.id);
|
|
1077
|
-
} }) })), _jsx(Grid, __assign({ item: true }, { children: _jsx(Typography, __assign({ color: "primary", sx: { textDecoration: 'underline', cursor: 'pointer' }, onClick: function () { return onChange((value !== null && value !== void 0 ? value : []).filter(function (_, _i) { return i !== _i; }), field.id); } }, { children: "Remove medication" })) })), window.location.origin.includes(':300') && i === 0 &&
|
|
1077
|
+
} }) })), _jsx(Grid, __assign({ item: true }, { children: _jsx(Typography, __assign({ color: "primary", sx: { textDecoration: 'underline', cursor: 'pointer' }, onClick: function () { return onChange((value !== null && value !== void 0 ? value : []).filter(function (_, _i) { return i !== _i; }), field.id); } }, { children: form_display_text_for_language(form, "Remove medication") })) })), window.location.origin.includes(':300') && i === 0 &&
|
|
1078
1078
|
_jsxs(Grid, __assign({ item: true, sx: { mt: 3 } }, { children: [_jsx("strong", { children: "DEBUG:" }), " ", _jsx("br", {}), _jsx("pre", __assign({ style: { wordWrap: 'break-word' } }, { children: JSON.stringify(value !== null && value !== void 0 ? value : {}, null, 2) }))] })), _jsx(Grid, __assign({ item: true }, { children: _jsx(Grid, { container: true }) }))] })) })) })) }), i), _jsx(Grid, __assign({ item: true }, { children: _jsx(Divider, { flexItem: true, sx: { my: 1 } }) }))] }));
|
|
1079
|
-
}), _jsx(Grid, __assign({ item: true }, { children: _jsx(Button, __assign({ color: "primary", variant: "outlined", onClick: function () { return onChange(__spreadArray(__spreadArray([], (value !== null && value !== void 0 ? value : []), true), [{ displayTerm: '', drugName: '' }], false), field.id); } }, { children: "Add Medication" })) }))] })));
|
|
1079
|
+
}), _jsx(Grid, __assign({ item: true }, { children: _jsx(Button, __assign({ color: "primary", variant: "outlined", onClick: function () { return onChange(__spreadArray(__spreadArray([], (value !== null && value !== void 0 ? value : []), true), [{ displayTerm: '', drugName: '' }], false), field.id); } }, { children: form_display_text_for_language(form, "Add Medication") })) }))] })));
|
|
1080
1080
|
};
|
|
1081
1081
|
export var BelugaPatientPreferenceInput = function (_a) {
|
|
1082
|
-
var field = _a.field, _value = _a.value, onChange = _a.onChange;
|
|
1082
|
+
var field = _a.field, _value = _a.value, onChange = _a.onChange, form = _a.form;
|
|
1083
1083
|
var value = Array.isArray(_value) ? _value : [];
|
|
1084
1084
|
return (_jsxs(Grid, __assign({ container: true, direction: "column", sx: { mt: 2 } }, { children: [value.map(function (v, i) {
|
|
1085
1085
|
var _a, _b, _d, _e, _f, _g, _h, _j;
|
|
@@ -1099,10 +1099,10 @@ export var BelugaPatientPreferenceInput = function (_a) {
|
|
|
1099
1099
|
return onChange(value.map(function (_v, _i) { return (i === _i ? __assign(__assign({}, _v), { sig: e.target.value }) : _v); }), field.id);
|
|
1100
1100
|
} }) })), _jsx(Grid, __assign({ item: true }, { children: _jsx(TextField, { label: "Med ID (NDC11)", size: "small", fullWidth: true, required: true, InputProps: defaultInputProps, value: (_j = v.medId) !== null && _j !== void 0 ? _j : '', onChange: function (e) {
|
|
1101
1101
|
return onChange(value.map(function (_v, _i) { return (i === _i ? __assign(__assign({}, _v), { medId: e.target.value }) : _v); }), field.id);
|
|
1102
|
-
} }) })), _jsx(Grid, __assign({ item: true }, { children: _jsx(Typography, __assign({ color: "primary", sx: { textDecoration: 'underline', cursor: 'pointer' }, onClick: function () { return onChange(value.filter(function (_, _i) { return i !== _i; }), field.id); } }, { children: "Remove medication" })) }))] })) })) })) }), i), _jsx(Grid, __assign({ item: true }, { children: _jsx(Divider, { flexItem: true, sx: { my: 1 } }) }))] }));
|
|
1102
|
+
} }) })), _jsx(Grid, __assign({ item: true }, { children: _jsx(Typography, __assign({ color: "primary", sx: { textDecoration: 'underline', cursor: 'pointer' }, onClick: function () { return onChange(value.filter(function (_, _i) { return i !== _i; }), field.id); } }, { children: form_display_text_for_language(form, "Remove medication") })) }))] })) })) })) }), i), _jsx(Grid, __assign({ item: true }, { children: _jsx(Divider, { flexItem: true, sx: { my: 1 } }) }))] }));
|
|
1103
1103
|
}), _jsx(Grid, __assign({ item: true }, { children: _jsx(Button, __assign({ color: "primary", variant: "outlined", onClick: function () { return onChange(__spreadArray(__spreadArray([], value, true), [
|
|
1104
1104
|
{ name: '', strength: '', quantity: '', refills: '', daysSupply: '', sig: '', dispenseUnit: '', medId: '' }
|
|
1105
|
-
], false), field.id); } }, { children: "Add Medication" })) }))] })));
|
|
1105
|
+
], false), field.id); } }, { children: form_display_text_for_language(form, "Add Medication") })) }))] })));
|
|
1106
1106
|
};
|
|
1107
1107
|
export var contact_is_valid = function (e) {
|
|
1108
1108
|
if (e.email) {
|
|
@@ -1127,7 +1127,7 @@ export var contact_is_valid = function (e) {
|
|
|
1127
1127
|
};
|
|
1128
1128
|
export var RelatedContactsInput = function (_a) {
|
|
1129
1129
|
var _b, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _w, _x;
|
|
1130
|
-
var field = _a.field, _value = _a.value, onChange = _a.onChange, parentError = _a.error, props = __rest(_a, ["field", "value", "onChange", "error"]);
|
|
1130
|
+
var field = _a.field, _value = _a.value, onChange = _a.onChange, parentError = _a.error, form = _a.form, props = __rest(_a, ["field", "value", "onChange", "error", "form"]);
|
|
1131
1131
|
// safeguard against any rogue values like empty string
|
|
1132
1132
|
var value = Array.isArray(_value) ? _value : [];
|
|
1133
1133
|
var _y = useState(value.length === 1 ? 0 : -1), editing = _y[0], setEditing = _y[1];
|
|
@@ -1142,11 +1142,11 @@ export var RelatedContactsInput = function (_a) {
|
|
|
1142
1142
|
var _z = value[editing], fname = _z.fname, lname = _z.lname, email = _z.email, phone = _z.phone, _0 = _z.fields, fields_1 = _0 === void 0 ? {} : _0, _1 = _z.dateOfBirth, dateOfBirth = _1 === void 0 ? '' : _1, relationships = _z.relationships;
|
|
1143
1143
|
var errorMessage = contact_is_valid(value[editing]);
|
|
1144
1144
|
return (_jsxs(Grid, __assign({ container: true, direction: "column", spacing: 1 }, { children: [_jsx(Grid, __assign({ item: true }, { children: _jsxs(Grid, __assign({ container: true, alignItems: "center", wrap: "nowrap", spacing: 1 }, { children: [!((_e = (_d = field.options) === null || _d === void 0 ? void 0 : _d.hiddenDefaultFields) === null || _e === void 0 ? void 0 : _e.includes('First Name')) &&
|
|
1145
|
-
_jsx(Grid, __assign({ item: true, xs: 4 }, { children: _jsx(TextField, { label: "First Name", size: "small", fullWidth: true, InputProps: defaultInputProps, value: fname, onChange: function (e) { return onChange(value.map(function (v, i) { return i === editing ? __assign(__assign({}, v), { fname: e.target.value }) : v; }), field.id); } }) })), !((_g = (_f = field.options) === null || _f === void 0 ? void 0 : _f.hiddenDefaultFields) === null || _g === void 0 ? void 0 : _g.includes('Last Name')) &&
|
|
1146
|
-
_jsx(Grid, __assign({ item: true, xs: 4 }, { children: _jsx(TextField, { label: "Last Name", size: "small", fullWidth: true, InputProps: defaultInputProps, value: lname, onChange: function (e) { return onChange(value.map(function (v, i) { return i === editing ? __assign(__assign({}, v), { lname: e.target.value }) : v; }), field.id); } }) })), _jsx(Grid, __assign({ item: true, xs: 4 }, { children: _jsx(StringSelector, { options: ((_j = (_h = field.options) === null || _h === void 0 ? void 0 : _h.relatedContactTypes) === null || _j === void 0 ? void 0 : _j.length) ? field.options.relatedContactTypes : RELATIONSHIP_TYPES, label: "Relationship", size: "small", disabled: ((_l = (_k = field === null || field === void 0 ? void 0 : field.options) === null || _k === void 0 ? void 0 : _k.relatedContactTypes) === null || _l === void 0 ? void 0 : _l.length) === 1, value: (_o = (_m = relationships === null || relationships === void 0 ? void 0 : relationships[0]) === null || _m === void 0 ? void 0 : _m.type) !== null && _o !== void 0 ? _o : '', onChange: function (type) { return onChange(value.map(function (v, i) { return i === editing ? __assign(__assign({}, v), { relationships: [{ type: type, id: '' /* to be filled on server-side */ }] }) : v; }), field.id); } }) }))] })) })), _jsx(Grid, __assign({ item: true }, { children: _jsxs(Grid, __assign({ container: true, alignItems: "center", wrap: "nowrap", spacing: 1 }, { children: [!((_q = (_p = field.options) === null || _p === void 0 ? void 0 : _p.hiddenDefaultFields) === null || _q === void 0 ? void 0 : _q.includes('Date of Birth')) &&
|
|
1147
|
-
_jsx(Grid, __assign({ item: true, xs: 4 }, { children: _jsx(DateStringInput, { value: dateOfBirth, field: __assign(__assign({}, field), { isOptional: true }), size: "small", label: "Date of Birth (MM-DD-YYYY)", onChange: function (dateOfBirth) { return onChange(value.map(function (v, i) { return i === editing ? __assign(__assign({}, v), { dateOfBirth: dateOfBirth }) : v; }), field.id); } }) })), !((_s = (_r = field.options) === null || _r === void 0 ? void 0 : _r.hiddenDefaultFields) === null || _s === void 0 ? void 0 : _s.includes('Email')) &&
|
|
1148
|
-
_jsx(Grid, __assign({ item: true, xs: 4 }, { children: _jsx(TextField, { label: "Email", size: "small", fullWidth: true, type: "email", InputProps: defaultInputProps, value: email, onChange: function (e) { return onChange(value.map(function (v, i) { return i === editing ? __assign(__assign({}, v), { email: e.target.value }) : v; }), field.id); } }) })), !((_u = (_t = field.options) === null || _t === void 0 ? void 0 : _t.hiddenDefaultFields) === null || _u === void 0 ? void 0 : _u.includes('Phone Number')) &&
|
|
1149
|
-
_jsx(Grid, __assign({ item: true, xs: 4 }, { children: _jsx(TextField, { label: "Phone Number", size: "small", fullWidth: true, InputProps: defaultInputProps, value: phone, onChange: function (e) { return onChange(value.map(function (v, i) { return i === editing ? __assign(__assign({}, v), { phone: e.target.value.trim() }) : v; }), field.id); } }) }))] })) })), (((_w = field.options) === null || _w === void 0 ? void 0 : _w.tableChoices) || []).length > 0 &&
|
|
1145
|
+
_jsx(Grid, __assign({ item: true, xs: 4 }, { children: _jsx(TextField, { label: form_display_text_for_language(form, "First Name"), size: "small", fullWidth: true, InputProps: defaultInputProps, value: fname, onChange: function (e) { return onChange(value.map(function (v, i) { return i === editing ? __assign(__assign({}, v), { fname: e.target.value }) : v; }), field.id); } }) })), !((_g = (_f = field.options) === null || _f === void 0 ? void 0 : _f.hiddenDefaultFields) === null || _g === void 0 ? void 0 : _g.includes('Last Name')) &&
|
|
1146
|
+
_jsx(Grid, __assign({ item: true, xs: 4 }, { children: _jsx(TextField, { label: form_display_text_for_language(form, "Last Name"), size: "small", fullWidth: true, InputProps: defaultInputProps, value: lname, onChange: function (e) { return onChange(value.map(function (v, i) { return i === editing ? __assign(__assign({}, v), { lname: e.target.value }) : v; }), field.id); } }) })), _jsx(Grid, __assign({ item: true, xs: 4 }, { children: _jsx(StringSelector, { options: ((_j = (_h = field.options) === null || _h === void 0 ? void 0 : _h.relatedContactTypes) === null || _j === void 0 ? void 0 : _j.length) ? field.options.relatedContactTypes : RELATIONSHIP_TYPES, label: form_display_text_for_language(form, "Relationship"), size: "small", disabled: ((_l = (_k = field === null || field === void 0 ? void 0 : field.options) === null || _k === void 0 ? void 0 : _k.relatedContactTypes) === null || _l === void 0 ? void 0 : _l.length) === 1, value: (_o = (_m = relationships === null || relationships === void 0 ? void 0 : relationships[0]) === null || _m === void 0 ? void 0 : _m.type) !== null && _o !== void 0 ? _o : '', onChange: function (type) { return onChange(value.map(function (v, i) { return i === editing ? __assign(__assign({}, v), { relationships: [{ type: type, id: '' /* to be filled on server-side */ }] }) : v; }), field.id); } }) }))] })) })), _jsx(Grid, __assign({ item: true }, { children: _jsxs(Grid, __assign({ container: true, alignItems: "center", wrap: "nowrap", spacing: 1 }, { children: [!((_q = (_p = field.options) === null || _p === void 0 ? void 0 : _p.hiddenDefaultFields) === null || _q === void 0 ? void 0 : _q.includes('Date of Birth')) &&
|
|
1147
|
+
_jsx(Grid, __assign({ item: true, xs: 4 }, { children: _jsx(DateStringInput, { value: dateOfBirth, field: __assign(__assign({}, field), { isOptional: true }), size: "small", label: form_display_text_for_language(form, "Date of Birth (MM-DD-YYYY)"), onChange: function (dateOfBirth) { return onChange(value.map(function (v, i) { return i === editing ? __assign(__assign({}, v), { dateOfBirth: dateOfBirth }) : v; }), field.id); } }) })), !((_s = (_r = field.options) === null || _r === void 0 ? void 0 : _r.hiddenDefaultFields) === null || _s === void 0 ? void 0 : _s.includes('Email')) &&
|
|
1148
|
+
_jsx(Grid, __assign({ item: true, xs: 4 }, { children: _jsx(TextField, { label: form_display_text_for_language(form, "Email"), size: "small", fullWidth: true, type: "email", InputProps: defaultInputProps, value: email, onChange: function (e) { return onChange(value.map(function (v, i) { return i === editing ? __assign(__assign({}, v), { email: e.target.value }) : v; }), field.id); } }) })), !((_u = (_t = field.options) === null || _t === void 0 ? void 0 : _t.hiddenDefaultFields) === null || _u === void 0 ? void 0 : _u.includes('Phone Number')) &&
|
|
1149
|
+
_jsx(Grid, __assign({ item: true, xs: 4 }, { children: _jsx(TextField, { label: form_display_text_for_language(form, "Phone Number"), size: "small", fullWidth: true, InputProps: defaultInputProps, value: phone, onChange: function (e) { return onChange(value.map(function (v, i) { return i === editing ? __assign(__assign({}, v), { phone: e.target.value.trim() }) : v; }), field.id); } }) }))] })) })), (((_w = field.options) === null || _w === void 0 ? void 0 : _w.tableChoices) || []).length > 0 &&
|
|
1150
1150
|
_jsx(Grid, __assign({ item: true }, { children: _jsx(Grid, __assign({ container: true, spacing: 1 }, { children: (((_x = field.options) === null || _x === void 0 ? void 0 : _x.tableChoices) || []).map(function (_a, i) {
|
|
1151
1151
|
var info = _a.info, label = _a.label, type = _a.type;
|
|
1152
1152
|
return (_jsx(Grid, __assign({ item: true, xs: 6 }, { children: type === 'Text'
|
|
@@ -1166,10 +1166,10 @@ export var RelatedContactsInput = function (_a) {
|
|
|
1166
1166
|
return i === editing ? __assign(__assign({}, v), { fields: __assign(__assign({}, fields_1), (_a = {}, _a[label] = e.target.value, _a)) }) : v;
|
|
1167
1167
|
}), field.id); } }, { children: [_jsx(MenuItem, __assign({ value: "" }, { children: _jsx("em", { children: "None" }) })), info.choices.map(function (c) { return (_jsx(MenuItem, __assign({ value: c }, { children: c }), c)); })] }))] })))
|
|
1168
1168
|
: null }), i));
|
|
1169
|
-
}) })) })), _jsx(Grid, __assign({ item: true, sx: { my: 0.75 } }, { children: _jsx(Button, __assign({ variant: "outlined", onClick: function () { return setEditing(-1); }, size: "small", disabled: !!errorMessage || !!parentError }, { children: "Save Contact" })) })), errorMessage &&
|
|
1169
|
+
}) })) })), _jsx(Grid, __assign({ item: true, sx: { my: 0.75 } }, { children: _jsx(Button, __assign({ variant: "outlined", onClick: function () { return setEditing(-1); }, size: "small", disabled: !!errorMessage || !!parentError }, { children: form_display_text_for_language(form, "Save Contact") })) })), errorMessage &&
|
|
1170
1170
|
_jsx(Grid, __assign({ item: true }, { children: _jsx(Typography, __assign({ color: "error" }, { children: errorMessage })) }))] })));
|
|
1171
1171
|
}
|
|
1172
|
-
return (_jsxs(Grid, __assign({ container: true, direction: "column", spacing: 1 }, { children: [_jsx(Grid, __assign({ item: true }, { children: value.map(function (contact, i) { return (_jsx(Grid, __assign({ item: true }, { children: _jsxs(Grid, __assign({ container: true, alignItems: "center", justifyContent: "space-between", wrap: "nowrap", spacing: 1 }, { children: [_jsx(Grid, __assign({ item: true }, { children: _jsxs(Grid, __assign({ container: true, alignItems: "center" }, { children: [_jsx(IconButton, __assign({ onClick: function () { return setEditing(i); }, color: "primary", size: "small" }, { children: _jsx(Edit, {}) })), _jsx(Typography, __assign({ noWrap: true }, { children: user_display_name(contact) || "Unnamed Contact ".concat(i + 1) }))] })) })), _jsx(Grid, __assign({ item: true }, { children: _jsx(LabeledIconButton, { Icon: Delete, label: "Remove", onClick: function () { return onChange(value.filter(function (v, _i) { return i !== _i; }), field.id); } }) }))] })) }), i)); }) })), _jsx(Grid, __assign({ item: true }, { children: _jsx(Button, __assign({ variant: "contained", onClick: handleAddContact }, { children: "Add Contact" })) }))] })));
|
|
1172
|
+
return (_jsxs(Grid, __assign({ container: true, direction: "column", spacing: 1 }, { children: [_jsx(Grid, __assign({ item: true }, { children: value.map(function (contact, i) { return (_jsx(Grid, __assign({ item: true }, { children: _jsxs(Grid, __assign({ container: true, alignItems: "center", justifyContent: "space-between", wrap: "nowrap", spacing: 1 }, { children: [_jsx(Grid, __assign({ item: true }, { children: _jsxs(Grid, __assign({ container: true, alignItems: "center" }, { children: [_jsx(IconButton, __assign({ onClick: function () { return setEditing(i); }, color: "primary", size: "small" }, { children: _jsx(Edit, {}) })), _jsx(Typography, __assign({ noWrap: true }, { children: user_display_name(contact) || "".concat(form_display_text_for_language(form, "Unnamed Contact"), " ").concat(i + 1) }))] })) })), _jsx(Grid, __assign({ item: true }, { children: _jsx(LabeledIconButton, { Icon: Delete, label: form_display_text_for_language(form, "Remove"), onClick: function () { return onChange(value.filter(function (v, _i) { return i !== _i; }), field.id); } }) }))] })) }), i)); }) })), _jsx(Grid, __assign({ item: true }, { children: _jsx(Button, __assign({ variant: "contained", onClick: handleAddContact }, { children: form_display_text_for_language(form, "Add Contact") })) }))] })));
|
|
1173
1173
|
};
|
|
1174
1174
|
// AppointmentBookingInput logic is shared with inputs.tsx to avoid duplication
|
|
1175
1175
|
export var AppointmentBookingInput = function (props) {
|
|
@@ -1177,8 +1177,8 @@ export var AppointmentBookingInput = function (props) {
|
|
|
1177
1177
|
};
|
|
1178
1178
|
export var HeightInput = function (_a) {
|
|
1179
1179
|
var _b;
|
|
1180
|
-
var field = _a.field, _d = _a.value, value = _d === void 0 ? {} : _d, onChange = _a.onChange, props = __rest(_a, ["field", "value", "onChange"]);
|
|
1181
|
-
return (_jsxs(Grid, __assign({ container: true, alignItems: 'center', wrap: "nowrap", spacing: 1, style: { marginTop: 5 } }, { children: [_jsx(Grid, __assign({ item: true, sx: { width: '100%' } }, { children: _jsx(TextField, { fullWidth: true, size: "small", label: "Feet", type: "number", value: (value === null || value === void 0 ? void 0 : value.feet) || '', onChange: function (e) { return onChange(__assign(__assign({}, value), { feet: parseInt(e.target.value) }), field.id); } }) })), _jsx(Grid, __assign({ item: true, sx: { width: '100%' } }, { children: _jsx(TextField, { fullWidth: true, size: "small", label: "Inches", type: "number", value: (_b = value === null || value === void 0 ? void 0 : value.inches) !== null && _b !== void 0 ? _b : '', onChange: function (e) { return onChange(__assign(__assign({}, value), { inches: parseInt(e.target.value) }), field.id); } }) }))] })));
|
|
1180
|
+
var field = _a.field, _d = _a.value, value = _d === void 0 ? {} : _d, onChange = _a.onChange, form = _a.form, props = __rest(_a, ["field", "value", "onChange", "form"]);
|
|
1181
|
+
return (_jsxs(Grid, __assign({ container: true, alignItems: 'center', wrap: "nowrap", spacing: 1, style: { marginTop: 5 } }, { children: [_jsx(Grid, __assign({ item: true, sx: { width: '100%' } }, { children: _jsx(TextField, { fullWidth: true, size: "small", label: form_display_text_for_language(form, "Feet"), type: "number", value: (value === null || value === void 0 ? void 0 : value.feet) || '', onChange: function (e) { return onChange(__assign(__assign({}, value), { feet: parseInt(e.target.value) }), field.id); } }) })), _jsx(Grid, __assign({ item: true, sx: { width: '100%' } }, { children: _jsx(TextField, { fullWidth: true, size: "small", label: form_display_text_for_language(form, "Inches"), type: "number", value: (_b = value === null || value === void 0 ? void 0 : value.inches) !== null && _b !== void 0 ? _b : '', onChange: function (e) { return onChange(__assign(__assign({}, value), { inches: parseInt(e.target.value) }), field.id); } }) }))] })));
|
|
1182
1182
|
};
|
|
1183
1183
|
// Re-export from V1 to follow DRY principles
|
|
1184
1184
|
export { RedirectInput } from './inputs';
|
|
@@ -1257,7 +1257,7 @@ export var EmotiiInput = function (_a) {
|
|
|
1257
1257
|
onChange(requestIdRef.current, field.id);
|
|
1258
1258
|
}, [loadCount]);
|
|
1259
1259
|
if (value || loadCount === 2)
|
|
1260
|
-
return (_jsxs(Grid, __assign({ container: true, alignItems: "center", wrap: "nowrap" }, { children: [_jsx(CheckCircleOutline, { color: "success" }), _jsx(Typography, __assign({ sx: { ml: 1, fontSize: 20 } }, { children: "Please click Next or Submit to continue." }))] })));
|
|
1260
|
+
return (_jsxs(Grid, __assign({ container: true, alignItems: "center", wrap: "nowrap" }, { children: [_jsx(CheckCircleOutline, { color: "success" }), _jsx(Typography, __assign({ sx: { ml: 1, fontSize: 20 } }, { children: form_display_text_for_language(form, "Please click Next or Submit to continue.") }))] })));
|
|
1261
1261
|
if (!data) {
|
|
1262
1262
|
return _jsx(LinearProgress, {});
|
|
1263
1263
|
}
|
|
@@ -1329,15 +1329,15 @@ export var AllergiesInput = function (_a) {
|
|
|
1329
1329
|
}, 200);
|
|
1330
1330
|
return function () { clearTimeout(t); };
|
|
1331
1331
|
}, [session, query, (_b = field === null || field === void 0 ? void 0 : field.options) === null || _b === void 0 ? void 0 : _b.dataSource]);
|
|
1332
|
-
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) {
|
|
1332
|
+
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 ? form_display_text_for_language(form, 'No results found') : form_display_text_for_language(form, 'Type to start search'), onChange: function (e, v) {
|
|
1333
1333
|
if (!v) {
|
|
1334
1334
|
return;
|
|
1335
1335
|
}
|
|
1336
1336
|
onChange(v, field.id);
|
|
1337
1337
|
setResults([]);
|
|
1338
|
-
}, 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) {
|
|
1338
|
+
}, 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: form_display_text_for_language(form, "Search allergies...") }))); }, renderTags: function (value, getTagProps) {
|
|
1339
1339
|
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 } }))); });
|
|
1340
|
-
} }) })), (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)); })] })));
|
|
1340
|
+
} }) })), (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: form_display_text_for_language(form, "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: form_display_text_for_language(form, "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)); })] })));
|
|
1341
1341
|
};
|
|
1342
1342
|
var display_with_code = function (v) { return "".concat(v.code, ": ").concat(first_letter_capitalized(v.display)); };
|
|
1343
1343
|
export var ConditionsInput = function (_a) {
|
|
@@ -1371,13 +1371,13 @@ export var ConditionsInput = function (_a) {
|
|
|
1371
1371
|
}, 200);
|
|
1372
1372
|
return function () { clearTimeout(t); };
|
|
1373
1373
|
}, [session, query]);
|
|
1374
|
-
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) {
|
|
1374
|
+
return (_jsx(Autocomplete, { multiple: true, value: value || [], options: results, style: { marginTop: 5 }, noOptionsText: query.length ? form_display_text_for_language(form, 'No results found') : form_display_text_for_language(form, 'Type to start search'), onChange: function (e, v) {
|
|
1375
1375
|
if (!v) {
|
|
1376
1376
|
return;
|
|
1377
1377
|
}
|
|
1378
1378
|
onChange(v, field.id);
|
|
1379
1379
|
setResults([]);
|
|
1380
|
-
}, 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) {
|
|
1380
|
+
}, 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: form_display_text_for_language(form, "Search conditions...") }))); }, renderTags: function (value, getTagProps) {
|
|
1381
1381
|
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 } }))); });
|
|
1382
1382
|
} }));
|
|
1383
1383
|
};
|