@tellescope/react-components 1.230.1 → 1.231.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/Forms/forms.d.ts.map +1 -1
- package/lib/cjs/Forms/forms.js +30 -28
- package/lib/cjs/Forms/forms.js.map +1 -1
- package/lib/cjs/Forms/forms.v2.d.ts.map +1 -1
- package/lib/cjs/Forms/forms.v2.js +32 -30
- package/lib/cjs/Forms/forms.v2.js.map +1 -1
- package/lib/cjs/Forms/hooks.d.ts +111 -3
- package/lib/cjs/Forms/hooks.d.ts.map +1 -1
- package/lib/cjs/Forms/hooks.js +26 -8
- package/lib/cjs/Forms/hooks.js.map +1 -1
- package/lib/cjs/Forms/inputs.d.ts +1 -0
- package/lib/cjs/Forms/inputs.d.ts.map +1 -1
- package/lib/cjs/Forms/inputs.js +28 -1
- package/lib/cjs/Forms/inputs.js.map +1 -1
- package/lib/cjs/Forms/inputs.v2.d.ts +1 -0
- package/lib/cjs/Forms/inputs.v2.d.ts.map +1 -1
- package/lib/cjs/Forms/inputs.v2.js +32 -32
- package/lib/cjs/Forms/inputs.v2.js.map +1 -1
- package/lib/esm/Forms/forms.d.ts +3 -3
- package/lib/esm/Forms/forms.d.ts.map +1 -1
- package/lib/esm/Forms/forms.js +31 -29
- package/lib/esm/Forms/forms.js.map +1 -1
- package/lib/esm/Forms/forms.v2.d.ts +3 -3
- package/lib/esm/Forms/forms.v2.d.ts.map +1 -1
- package/lib/esm/Forms/forms.v2.js +33 -31
- package/lib/esm/Forms/forms.v2.js.map +1 -1
- package/lib/esm/Forms/hooks.d.ts +111 -3
- package/lib/esm/Forms/hooks.d.ts.map +1 -1
- package/lib/esm/Forms/hooks.js +28 -10
- package/lib/esm/Forms/hooks.js.map +1 -1
- package/lib/esm/Forms/inputs.d.ts +2 -1
- package/lib/esm/Forms/inputs.d.ts.map +1 -1
- package/lib/esm/Forms/inputs.js +26 -0
- package/lib/esm/Forms/inputs.js.map +1 -1
- package/lib/esm/Forms/inputs.v2.d.ts +2 -1
- package/lib/esm/Forms/inputs.v2.d.ts.map +1 -1
- package/lib/esm/Forms/inputs.v2.js +32 -33
- package/lib/esm/Forms/inputs.v2.js.map +1 -1
- package/lib/esm/controls.d.ts +2 -2
- package/lib/esm/inputs.d.ts +1 -1
- package/lib/esm/state.d.ts +319 -319
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +9 -9
- package/src/Forms/forms.tsx +6 -2
- package/src/Forms/forms.v2.tsx +16 -12
- package/src/Forms/hooks.tsx +46 -12
- package/src/Forms/inputs.tsx +158 -0
- package/src/Forms/inputs.v2.tsx +179 -65
|
@@ -64,6 +64,7 @@ export declare const DatabaseSelectInput: ({ AddToDatabase, field, value: _value
|
|
|
64
64
|
}) => JSX.Element;
|
|
65
65
|
export declare const CanvasMedicationsInput: ({ field, value, onChange }: FormInputProps<'Medications'>) => JSX.Element;
|
|
66
66
|
export declare const MedicationsInput: ({ field, value, onChange, ...props }: FormInputProps<'Medications'>) => JSX.Element;
|
|
67
|
+
export declare const BelugaPatientPreferenceInput: ({ field, value: _value, onChange }: FormInputProps<'Beluga Patient Preference'>) => JSX.Element;
|
|
67
68
|
export declare const contact_is_valid: (e: Partial<Enduser>) => "Email is invalid" | "Phone is invalid" | "Date of birth should be MM-DD-YYYY" | undefined;
|
|
68
69
|
export declare const RelatedContactsInput: ({ field, value: _value, onChange, ...props }: FormInputProps<'Related Contacts'>) => JSX.Element;
|
|
69
70
|
export declare const AppointmentBookingInput: ({ formResponseId, field, value, onChange, form, responses, goToPreviousField, isPreviousDisabled, enduserId, ...props }: FormInputProps<'Appointment Booking'>) => 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,
|
|
1
|
+
{"version":3,"file":"inputs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,+BAAmC,eAAe,aAAa,CAAC,gBAyGlG,CAAA;AAED,eAAO,MAAM,gBAAgB,yCAA0C,eAAe,aAAa,CAAC,gBAySnG,CAAA;AAED,eAAO,MAAM,4BAA4B,uCAAwC,eAAe,2BAA2B,CAAC,gBAoK3H,CAAA;AAED,eAAO,MAAM,gBAAgB,MAAO,QAAQ,OAAO,CAAC,+FAkBnD,CAAA;AAED,eAAO,MAAM,oBAAoB,iDAAkD,eAAe,kBAAkB,CAAC,gBAiLpH,CAAA;AAED,eAAO,MAAM,uBAAuB,4HAA6H,eAAe,qBAAqB,CAAC,gBAyOrM,CAAA;AAED,eAAO,MAAM,WAAW,yCAAoD,eAAe,QAAQ,CAAC,gBAenG,CAAA;AAED,eAAO,MAAM,2CAA2C,QAAS,MAAM,WAetE,CAAA;AAED,eAAO,MAAM,aAAa,uIAAkJ,eAAe,UAAU,CAAC,uBAkGrM,CAAA;AAED,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"}
|
|
@@ -97,7 +97,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
97
97
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
98
98
|
};
|
|
99
99
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
100
|
-
exports.ChargeebeeInput = exports.RichTextInput = exports.ConditionsInput = exports.AllergiesInput = exports.EmotiiInput = exports.HiddenValueInput = exports.RedirectInput = exports.include_current_url_parameters_if_templated = exports.HeightInput = exports.AppointmentBookingInput = exports.RelatedContactsInput = exports.contact_is_valid = exports.MedicationsInput = exports.CanvasMedicationsInput = exports.DatabaseSelectInput = exports.DropdownInput = exports.Progress = exports.StripeInput = exports.MultipleChoiceInput = exports.FilesInput = exports.safe_create_url = exports.FileInput = exports.convertHEIC = exports.SignatureInput = exports.ESignatureTerms = exports.AddressInput = exports.TimezoneInput = exports.TimeInput = exports.InsuranceInput = exports.NumberInput = exports.EmailInput = exports.PhoneInput = exports.StringLongInput = exports.StringInput = exports.DateStringInput = exports.AutoFocusTextField = exports.TableInput = exports.DateInput = exports.RankingInput = exports.RatingInput = exports.PdfViewer = exports.defaultButtonStyles = exports.defaultInputProps = exports.LanguageSelect = void 0;
|
|
100
|
+
exports.ChargeebeeInput = exports.RichTextInput = exports.ConditionsInput = exports.AllergiesInput = exports.EmotiiInput = exports.HiddenValueInput = exports.RedirectInput = exports.include_current_url_parameters_if_templated = exports.HeightInput = exports.AppointmentBookingInput = exports.RelatedContactsInput = exports.contact_is_valid = exports.BelugaPatientPreferenceInput = exports.MedicationsInput = exports.CanvasMedicationsInput = exports.DatabaseSelectInput = exports.DropdownInput = exports.Progress = exports.StripeInput = exports.MultipleChoiceInput = exports.FilesInput = exports.safe_create_url = exports.FileInput = exports.convertHEIC = exports.SignatureInput = exports.ESignatureTerms = exports.AddressInput = exports.TimezoneInput = exports.TimeInput = exports.InsuranceInput = exports.NumberInput = exports.EmailInput = exports.PhoneInput = exports.StringLongInput = exports.StringInput = exports.DateStringInput = exports.AutoFocusTextField = exports.TableInput = exports.DateInput = exports.RankingInput = exports.RatingInput = exports.PdfViewer = exports.defaultButtonStyles = exports.defaultInputProps = exports.LanguageSelect = void 0;
|
|
101
101
|
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
102
102
|
var react_1 = __importStar(require("react"));
|
|
103
103
|
var axios_1 = __importDefault(require("axios"));
|
|
@@ -793,7 +793,6 @@ var MultipleChoiceInput = function (_a) {
|
|
|
793
793
|
var field = _a.field, form = _a.form, _value = _a.value, onChange = _a.onChange;
|
|
794
794
|
var value = typeof _value === 'string' ? [_value] : _value; // if loading existingResponses, allows them to be a string
|
|
795
795
|
var _f = field.options, choices = _f.choices, radio = _f.radio, other = _f.other, optionDetails = _f.optionDetails;
|
|
796
|
-
var _g = (0, react_1.useState)({}), expandedDescriptions = _g[0], setExpandedDescriptions = _g[1];
|
|
797
796
|
// current other string
|
|
798
797
|
var enteringOtherStringRef = react_1.default.useRef(''); // if typing otherString as prefix of a checkbox value, don't auto-select
|
|
799
798
|
var otherString = (_b = value === null || value === void 0 ? void 0 : value.find(function (v) { var _a; return v === enteringOtherStringRef.current || !((_a = (choices !== null && choices !== void 0 ? choices : [])) === null || _a === void 0 ? void 0 : _a.find(function (c) { return c === v; })); })) !== null && _b !== void 0 ? _b : '';
|
|
@@ -803,19 +802,12 @@ var MultipleChoiceInput = function (_a) {
|
|
|
803
802
|
var _a;
|
|
804
803
|
return (_a = optionDetails === null || optionDetails === void 0 ? void 0 : optionDetails.find(function (detail) { return detail.option === choice; })) === null || _a === void 0 ? void 0 : _a.description;
|
|
805
804
|
}, [optionDetails]);
|
|
806
|
-
var toggleDescription = (0, react_1.useCallback)(function (index) {
|
|
807
|
-
setExpandedDescriptions(function (prev) {
|
|
808
|
-
var _a;
|
|
809
|
-
return (__assign(__assign({}, prev), (_a = {}, _a[index] = !prev[index], _a)));
|
|
810
|
-
});
|
|
811
|
-
}, []);
|
|
812
805
|
return ((0, jsx_runtime_1.jsxs)(material_1.Grid, __assign({ container: true, alignItems: "center", rowGap: 1.5 }, { children: [radio
|
|
813
806
|
? ((0, jsx_runtime_1.jsx)(material_1.FormControl, __assign({ fullWidth: true }, { children: (0, jsx_runtime_1.jsx)(material_1.RadioGroup, __assign({ "aria-labelledby": "radio-group-".concat(field.id, "-label"), defaultValue: "female", name: "radio-group-".concat(field.id) }, { children: (choices !== null && choices !== void 0 ? choices : []).map(function (c, i) {
|
|
814
807
|
var description = getDescriptionForChoice(c);
|
|
815
808
|
var hasDescription = !!description;
|
|
816
|
-
var isExpanded = expandedDescriptions[i];
|
|
817
809
|
var isSelected = !!(value === null || value === void 0 ? void 0 : value.includes(c)) && c !== otherString;
|
|
818
|
-
return ((0, jsx_runtime_1.jsxs)(material_1.Box, __assign({ sx: { width: '100%' } }, { children: [(0, jsx_runtime_1.
|
|
810
|
+
return ((0, jsx_runtime_1.jsxs)(material_1.Box, __assign({ sx: { width: '100%' } }, { children: [(0, jsx_runtime_1.jsx)(material_1.Box, __assign({ sx: {
|
|
819
811
|
display: 'flex',
|
|
820
812
|
alignItems: 'center',
|
|
821
813
|
width: '100%',
|
|
@@ -823,25 +815,17 @@ var MultipleChoiceInput = function (_a) {
|
|
|
823
815
|
borderColor: 'primary.main',
|
|
824
816
|
borderRadius: 1,
|
|
825
817
|
padding: '16px 16px',
|
|
826
|
-
marginBottom: '12px',
|
|
818
|
+
marginBottom: hasDescription ? '8px' : '12px',
|
|
827
819
|
cursor: 'pointer',
|
|
828
820
|
backgroundColor: 'transparent',
|
|
829
821
|
boxSizing: 'border-box',
|
|
830
822
|
'&:hover': {
|
|
831
823
|
backgroundColor: function (theme) { return "".concat(theme.palette.primary.main, "14"); },
|
|
832
824
|
},
|
|
833
|
-
}, onClick: function () { return onChange((value === null || value === void 0 ? void 0 : value.includes(c)) ? [] : [c], field.id); } }, { children:
|
|
834
|
-
e.stopPropagation();
|
|
835
|
-
toggleDescription(i);
|
|
836
|
-
}, sx: {
|
|
837
|
-
transform: isExpanded ? 'rotate(180deg)' : 'rotate(0deg)',
|
|
838
|
-
transition: 'transform 0.2s',
|
|
839
|
-
ml: 1
|
|
840
|
-
} }, { children: (0, jsx_runtime_1.jsx)(icons_material_1.ExpandMore, { fontSize: "small" }) })))] })), hasDescription && ((0, jsx_runtime_1.jsx)(material_1.Collapse, __assign({ in: isExpanded }, { children: (0, jsx_runtime_1.jsx)(material_1.Box, __assign({ sx: { pl: 2, pr: 2, pb: 1, pt: 1 } }, { children: (0, jsx_runtime_1.jsx)(material_1.Typography, __assign({ variant: "body2", color: "text.secondary" }, { children: description })) })) })))] }), i));
|
|
825
|
+
}, onClick: function () { return onChange((value === null || value === void 0 ? void 0 : value.includes(c)) ? [] : [c], field.id); } }, { children: (0, jsx_runtime_1.jsx)(material_1.Typography, __assign({ component: "span", sx: { flex: 1, color: 'primary.main', fontSize: 13, fontWeight: 600 } }, { children: c })) })), hasDescription && ((0, jsx_runtime_1.jsx)(material_1.Box, __assign({ sx: { pl: 2, pr: 2, pb: 1, mb: 1 } }, { children: (0, jsx_runtime_1.jsx)(material_1.Typography, __assign({ style: { fontSize: 14, color: '#00000099' } }, { children: description })) })))] }), i));
|
|
841
826
|
}) })) }))) : ((choices !== null && choices !== void 0 ? choices : []).map(function (c, i) {
|
|
842
827
|
var description = getDescriptionForChoice(c);
|
|
843
828
|
var hasDescription = !!description;
|
|
844
|
-
var isExpanded = expandedDescriptions[i];
|
|
845
829
|
return ((0, jsx_runtime_1.jsx)(material_1.Grid, __assign({ xs: 12 }, { children: (0, jsx_runtime_1.jsxs)(material_1.Box, __assign({ sx: { width: '100%' } }, { children: [(0, jsx_runtime_1.jsxs)(material_1.Box, __assign({ sx: {
|
|
846
830
|
display: 'flex',
|
|
847
831
|
alignItems: 'center',
|
|
@@ -850,10 +834,6 @@ var MultipleChoiceInput = function (_a) {
|
|
|
850
834
|
boxSizing: 'border-box'
|
|
851
835
|
}, onClick: function (e) {
|
|
852
836
|
var _a, _b, _d, _e;
|
|
853
|
-
// Don't trigger selection if clicking on the expand button
|
|
854
|
-
if (e.target.closest('.expand-button')) {
|
|
855
|
-
return;
|
|
856
|
-
}
|
|
857
837
|
onChange(((value === null || value === void 0 ? void 0 : value.includes(c))
|
|
858
838
|
? ((radio || ((_b = (_a = field.options) === null || _a === void 0 ? void 0 : _a.radioChoices) === null || _b === void 0 ? void 0 : _b.includes(c)))
|
|
859
839
|
? []
|
|
@@ -861,14 +841,7 @@ var MultipleChoiceInput = function (_a) {
|
|
|
861
841
|
: ((radio || ((_e = (_d = field.options) === null || _d === void 0 ? void 0 : _d.radioChoices) === null || _e === void 0 ? void 0 : _e.includes(c)))
|
|
862
842
|
? [c]
|
|
863
843
|
: __spreadArray(__spreadArray([], (value !== null && value !== void 0 ? value : []).filter(function (x) { var _a, _b; return !((_b = (_a = field.options) === null || _a === void 0 ? void 0 : _a.radioChoices) === null || _b === void 0 ? void 0 : _b.includes(x)); }), true), [c], false))), field.id);
|
|
864
|
-
} }, { children: [(0, jsx_runtime_1.jsx)(material_1.Checkbox, { color: "primary", checked: !!(value === null || value === void 0 ? void 0 : value.includes(c)) && c !== otherString, inputProps: { 'aria-label': 'primary checkbox' } }), (0, jsx_runtime_1.jsx)(material_1.Typography, __assign({ component: "span", sx: { flex: 1 } }, { children: c })), hasDescription && ((0, jsx_runtime_1.jsx)(material_1.
|
|
865
|
-
e.stopPropagation();
|
|
866
|
-
toggleDescription(i);
|
|
867
|
-
}, sx: {
|
|
868
|
-
transform: isExpanded ? 'rotate(180deg)' : 'rotate(0deg)',
|
|
869
|
-
transition: 'transform 0.2s',
|
|
870
|
-
ml: 1
|
|
871
|
-
} }, { children: (0, jsx_runtime_1.jsx)(icons_material_1.ExpandMore, { fontSize: "small" }) })))] })), hasDescription && ((0, jsx_runtime_1.jsx)(material_1.Collapse, __assign({ in: isExpanded }, { children: (0, jsx_runtime_1.jsx)(material_1.Box, __assign({ sx: { pl: '42px', pr: 2, pb: 1 } }, { children: (0, jsx_runtime_1.jsx)(material_1.Typography, __assign({ variant: "body2", color: "text.secondary" }, { children: description })) })) })))] })) }), i));
|
|
844
|
+
} }, { children: [(0, jsx_runtime_1.jsx)(material_1.Checkbox, { color: "primary", checked: !!(value === null || value === void 0 ? void 0 : value.includes(c)) && c !== otherString, inputProps: { 'aria-label': 'primary checkbox' } }), (0, jsx_runtime_1.jsx)(material_1.Typography, __assign({ component: "span", sx: { flex: 1 } }, { children: c }))] })), hasDescription && ((0, jsx_runtime_1.jsx)(material_1.Box, __assign({ sx: { pl: '42px', pr: 2, pb: 1 } }, { children: (0, jsx_runtime_1.jsx)(material_1.Typography, __assign({ style: { fontSize: 14, color: '#00000099' } }, { children: description })) })))] })) }), i));
|
|
872
845
|
})), other &&
|
|
873
846
|
(0, jsx_runtime_1.jsx)(material_1.Grid, __assign({ item: true, xs: 12 }, { children: (0, jsx_runtime_1.jsx)(material_1.TextField // className={classes.textField}
|
|
874
847
|
, { InputProps: { sx: { borderRadius: 2.5 } }, sx: { width: radio ? "calc(100% - 15px)" : '100%' }, size: "small", "aria-label": (0, __1.form_display_text_for_language)(form, "Other"), value: otherString, placeholder: (0, __1.form_display_text_for_language)(form, "Other"), variant: "outlined",
|
|
@@ -1700,6 +1673,33 @@ var MedicationsInput = function (_a) {
|
|
|
1700
1673
|
}), (0, jsx_runtime_1.jsx)(material_1.Grid, __assign({ item: true }, { children: (0, jsx_runtime_1.jsx)(material_1.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" })) }))] })));
|
|
1701
1674
|
};
|
|
1702
1675
|
exports.MedicationsInput = MedicationsInput;
|
|
1676
|
+
var BelugaPatientPreferenceInput = function (_a) {
|
|
1677
|
+
var field = _a.field, _value = _a.value, onChange = _a.onChange;
|
|
1678
|
+
var value = Array.isArray(_value) ? _value : [];
|
|
1679
|
+
return ((0, jsx_runtime_1.jsxs)(material_1.Grid, __assign({ container: true, direction: "column", sx: { mt: 2 } }, { children: [value.map(function (v, i) {
|
|
1680
|
+
var _a, _b, _d, _e, _f, _g, _h, _j;
|
|
1681
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(material_1.Grid, __assign({ item: true }, { children: (0, jsx_runtime_1.jsx)(material_1.Grid, __assign({ container: true, alignItems: "center", wrap: "nowrap" }, { children: (0, jsx_runtime_1.jsx)(material_1.Grid, __assign({ item: true, sx: { width: '100%' } }, { children: (0, jsx_runtime_1.jsxs)(material_1.Grid, __assign({ container: true, direction: "column", spacing: 1.5 }, { children: [(0, jsx_runtime_1.jsx)(material_1.Grid, __assign({ item: true }, { children: (0, jsx_runtime_1.jsx)(material_1.TextField, { label: "Medication Name", size: "small", fullWidth: true, required: true, InputProps: exports.defaultInputProps, value: (_a = v.name) !== null && _a !== void 0 ? _a : '', onChange: function (e) {
|
|
1682
|
+
return onChange(value.map(function (_v, _i) { return (i === _i ? __assign(__assign({}, _v), { name: e.target.value }) : _v); }), field.id);
|
|
1683
|
+
} }) })), (0, jsx_runtime_1.jsx)(material_1.Grid, __assign({ item: true }, { children: (0, jsx_runtime_1.jsxs)(material_1.Grid, __assign({ container: true, spacing: 1 }, { children: [(0, jsx_runtime_1.jsx)(material_1.Grid, __assign({ item: true, xs: 12, md: 6 }, { children: (0, jsx_runtime_1.jsx)(material_1.TextField, { label: "Strength", size: "small", fullWidth: true, required: true, InputProps: exports.defaultInputProps, value: (_b = v.strength) !== null && _b !== void 0 ? _b : '', onChange: function (e) {
|
|
1684
|
+
return onChange(value.map(function (_v, _i) { return (i === _i ? __assign(__assign({}, _v), { strength: e.target.value }) : _v); }), field.id);
|
|
1685
|
+
} }) })), (0, jsx_runtime_1.jsx)(material_1.Grid, __assign({ item: true, xs: 12, md: 6 }, { children: (0, jsx_runtime_1.jsx)(material_1.TextField, { label: "Dispense Unit", size: "small", fullWidth: true, required: true, InputProps: exports.defaultInputProps, value: (_d = v.dispenseUnit) !== null && _d !== void 0 ? _d : '', onChange: function (e) {
|
|
1686
|
+
return onChange(value.map(function (_v, _i) { return (i === _i ? __assign(__assign({}, _v), { dispenseUnit: e.target.value }) : _v); }), field.id);
|
|
1687
|
+
} }) }))] })) })), (0, jsx_runtime_1.jsx)(material_1.Grid, __assign({ item: true }, { children: (0, jsx_runtime_1.jsxs)(material_1.Grid, __assign({ container: true, spacing: 1 }, { children: [(0, jsx_runtime_1.jsx)(material_1.Grid, __assign({ item: true, xs: 12, md: 4 }, { children: (0, jsx_runtime_1.jsx)(material_1.TextField, { label: "Quantity", size: "small", fullWidth: true, required: true, InputProps: exports.defaultInputProps, value: (_e = v.quantity) !== null && _e !== void 0 ? _e : '', onChange: function (e) {
|
|
1688
|
+
return onChange(value.map(function (_v, _i) { return (i === _i ? __assign(__assign({}, _v), { quantity: e.target.value }) : _v); }), field.id);
|
|
1689
|
+
} }) })), (0, jsx_runtime_1.jsx)(material_1.Grid, __assign({ item: true, xs: 12, md: 4 }, { children: (0, jsx_runtime_1.jsx)(material_1.TextField, { label: "Refills", size: "small", fullWidth: true, required: true, InputProps: exports.defaultInputProps, value: (_f = v.refills) !== null && _f !== void 0 ? _f : '', onChange: function (e) {
|
|
1690
|
+
return onChange(value.map(function (_v, _i) { return (i === _i ? __assign(__assign({}, _v), { refills: e.target.value }) : _v); }), field.id);
|
|
1691
|
+
} }) })), (0, jsx_runtime_1.jsx)(material_1.Grid, __assign({ item: true, xs: 12, md: 4 }, { children: (0, jsx_runtime_1.jsx)(material_1.TextField, { label: "Days Supply", size: "small", fullWidth: true, required: true, InputProps: exports.defaultInputProps, value: (_g = v.daysSupply) !== null && _g !== void 0 ? _g : '', onChange: function (e) {
|
|
1692
|
+
return onChange(value.map(function (_v, _i) { return (i === _i ? __assign(__assign({}, _v), { daysSupply: e.target.value }) : _v); }), field.id);
|
|
1693
|
+
} }) }))] })) })), (0, jsx_runtime_1.jsx)(material_1.Grid, __assign({ item: true }, { children: (0, jsx_runtime_1.jsx)(material_1.TextField, { label: "Sig (Instructions)", size: "small", fullWidth: true, required: true, multiline: true, rows: 2, InputProps: exports.defaultInputProps, value: (_h = v.sig) !== null && _h !== void 0 ? _h : '', onChange: function (e) {
|
|
1694
|
+
return onChange(value.map(function (_v, _i) { return (i === _i ? __assign(__assign({}, _v), { sig: e.target.value }) : _v); }), field.id);
|
|
1695
|
+
} }) })), (0, jsx_runtime_1.jsx)(material_1.Grid, __assign({ item: true }, { children: (0, jsx_runtime_1.jsx)(material_1.TextField, { label: "Med ID (NDC11)", size: "small", fullWidth: true, required: true, InputProps: exports.defaultInputProps, value: (_j = v.medId) !== null && _j !== void 0 ? _j : '', onChange: function (e) {
|
|
1696
|
+
return onChange(value.map(function (_v, _i) { return (i === _i ? __assign(__assign({}, _v), { medId: e.target.value }) : _v); }), field.id);
|
|
1697
|
+
} }) })), (0, jsx_runtime_1.jsx)(material_1.Grid, __assign({ item: true }, { children: (0, jsx_runtime_1.jsx)(material_1.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), (0, jsx_runtime_1.jsx)(material_1.Grid, __assign({ item: true }, { children: (0, jsx_runtime_1.jsx)(material_1.Divider, { flexItem: true, sx: { my: 1 } }) }))] }));
|
|
1698
|
+
}), (0, jsx_runtime_1.jsx)(material_1.Grid, __assign({ item: true }, { children: (0, jsx_runtime_1.jsx)(material_1.Button, __assign({ color: "primary", variant: "outlined", onClick: function () { return onChange(__spreadArray(__spreadArray([], value, true), [
|
|
1699
|
+
{ name: '', strength: '', quantity: '', refills: '', daysSupply: '', sig: '', dispenseUnit: '', medId: '' }
|
|
1700
|
+
], false), field.id); } }, { children: "Add Medication" })) }))] })));
|
|
1701
|
+
};
|
|
1702
|
+
exports.BelugaPatientPreferenceInput = BelugaPatientPreferenceInput;
|
|
1703
1703
|
var contact_is_valid = function (e) {
|
|
1704
1704
|
if (e.email) {
|
|
1705
1705
|
try {
|