@tellescope/react-components 1.232.1 → 1.233.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. package/lib/cjs/Forms/forms.js +1 -1
  2. package/lib/cjs/Forms/forms.js.map +1 -1
  3. package/lib/cjs/Forms/forms.v2.js +1 -1
  4. package/lib/cjs/Forms/forms.v2.js.map +1 -1
  5. package/lib/cjs/Forms/inputs.d.ts.map +1 -1
  6. package/lib/cjs/Forms/inputs.js +19 -11
  7. package/lib/cjs/Forms/inputs.js.map +1 -1
  8. package/lib/cjs/Forms/inputs.v2.d.ts +1 -2
  9. package/lib/cjs/Forms/inputs.v2.d.ts.map +1 -1
  10. package/lib/cjs/Forms/inputs.v2.js +4 -96
  11. package/lib/cjs/Forms/inputs.v2.js.map +1 -1
  12. package/lib/esm/CMS/components.d.ts +1 -0
  13. package/lib/esm/CMS/components.d.ts.map +1 -1
  14. package/lib/esm/Forms/form_responses.d.ts +1 -0
  15. package/lib/esm/Forms/form_responses.d.ts.map +1 -1
  16. package/lib/esm/Forms/forms.d.ts +3 -3
  17. package/lib/esm/Forms/forms.js +1 -1
  18. package/lib/esm/Forms/forms.js.map +1 -1
  19. package/lib/esm/Forms/forms.v2.d.ts +3 -3
  20. package/lib/esm/Forms/forms.v2.js +1 -1
  21. package/lib/esm/Forms/forms.v2.js.map +1 -1
  22. package/lib/esm/Forms/hooks.d.ts +1 -0
  23. package/lib/esm/Forms/hooks.d.ts.map +1 -1
  24. package/lib/esm/Forms/inputs.d.ts +1 -1
  25. package/lib/esm/Forms/inputs.d.ts.map +1 -1
  26. package/lib/esm/Forms/inputs.js +19 -11
  27. package/lib/esm/Forms/inputs.js.map +1 -1
  28. package/lib/esm/Forms/inputs.v2.d.ts +2 -3
  29. package/lib/esm/Forms/inputs.v2.d.ts.map +1 -1
  30. package/lib/esm/Forms/inputs.v2.js +3 -94
  31. package/lib/esm/Forms/inputs.v2.js.map +1 -1
  32. package/lib/esm/controls.d.ts +2 -2
  33. package/lib/esm/inputs.d.ts +1 -1
  34. package/lib/esm/inputs.native.d.ts +1 -0
  35. package/lib/esm/inputs.native.d.ts.map +1 -1
  36. package/lib/esm/state.d.ts +315 -315
  37. package/lib/tsconfig.tsbuildinfo +1 -1
  38. package/package.json +11 -11
  39. package/src/Forms/forms.tsx +2 -2
  40. package/src/Forms/forms.v2.tsx +1 -1
  41. package/src/Forms/inputs.tsx +15 -7
  42. package/src/Forms/inputs.v2.tsx +4 -118
@@ -65,8 +65,7 @@ export declare const contact_is_valid: (e: Partial<Enduser>) => "Email is invali
65
65
  export declare const RelatedContactsInput: ({ field, value: _value, onChange, error: parentError, ...props }: FormInputProps<'Related Contacts'>) => JSX.Element;
66
66
  export declare const AppointmentBookingInput: ({ formResponseId, field, value, onChange, form, responses, goToPreviousField, isPreviousDisabled, enduserId, ...props }: FormInputProps<'Appointment Booking'>) => JSX.Element;
67
67
  export declare const HeightInput: ({ field, value, onChange, ...props }: FormInputProps<'Height'>) => JSX.Element;
68
- export declare const include_current_url_parameters_if_templated: (url: string) => string;
69
- export declare const RedirectInput: ({ enduserId, groupId, groupInsance, rootResponseId, formResponseId, field, submit, value, onChange, responses, enduser, ...props }: FormInputProps<'Redirect'>) => JSX.Element | null;
68
+ export { RedirectInput } from './inputs';
70
69
  export declare const HiddenValueInput: ({ goToNextField, goToPreviousField, field, value, onChange, isSinglePage, groupFields }: FormInputProps<'email'>) => JSX.Element;
71
70
  export declare const EmotiiInput: ({ goToNextField, goToPreviousField, field, value, onChange, form, formResponseId, ...props }: FormInputProps<'email'>) => JSX.Element;
72
71
  export declare const AllergiesInput: ({ goToNextField, goToPreviousField, field, value, onChange, form, formResponseId, ...props }: FormInputProps<'Allergies'>) => 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,C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AAC,+FAkBnD,CAAA;AAED,eAAO,MAAM,oBAAoB,qEAAsE,eAAe,kBAAkB,CAAC,gBAiLxI,CAAA;AAED,eAAO,MAAM,uBAAuB,4HAA6H,eAAe,qBAAqB,CAAC,gBAyOrM,CAAA;AAED,eAAO,MAAM,WAAW,yCAAoD,eAAe,QAAQ,CAAC,gBAenG,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"}
@@ -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.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;
100
+ exports.ChargeebeeInput = exports.RichTextInput = exports.ConditionsInput = exports.AllergiesInput = exports.EmotiiInput = exports.HiddenValueInput = exports.RedirectInput = 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"));
@@ -1518,101 +1518,9 @@ var HeightInput = function (_a) {
1518
1518
  return ((0, jsx_runtime_1.jsxs)(material_1.Grid, __assign({ container: true, alignItems: 'center', wrap: "nowrap", spacing: 1, style: { marginTop: 5 } }, { children: [(0, jsx_runtime_1.jsx)(material_1.Grid, __assign({ item: true, sx: { width: '100%' } }, { children: (0, jsx_runtime_1.jsx)(material_1.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); } }) })), (0, jsx_runtime_1.jsx)(material_1.Grid, __assign({ item: true, sx: { width: '100%' } }, { children: (0, jsx_runtime_1.jsx)(material_1.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); } }) }))] })));
1519
1519
  };
1520
1520
  exports.HeightInput = HeightInput;
1521
- var include_current_url_parameters_if_templated = function (url) {
1522
- try {
1523
- // get parameters from the current URL, and replace all values where {{URL_PARAM.paramName}} is used
1524
- var params_1 = new URL(window.location.href).searchParams;
1525
- return url.replace(/{{URL_PARAM\.(.*?)}}/g, function (_, paramName) {
1526
- var value = params_1.get(paramName);
1527
- console.log(paramName, value);
1528
- if (value === null)
1529
- return '';
1530
- return value;
1531
- });
1532
- }
1533
- catch (err) {
1534
- console.error(err);
1535
- }
1536
- return url;
1537
- };
1538
- exports.include_current_url_parameters_if_templated = include_current_url_parameters_if_templated;
1539
- var RedirectInput = function (_a) {
1540
- var _b, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
1541
- var enduserId = _a.enduserId, groupId = _a.groupId, groupInsance = _a.groupInsance, rootResponseId = _a.rootResponseId, formResponseId = _a.formResponseId, field = _a.field, submit = _a.submit, _u = _a.value, value = _u === void 0 ? {} : _u, onChange = _a.onChange, responses = _a.responses, enduser = _a.enduser, props = __rest(_a, ["enduserId", "groupId", "groupInsance", "rootResponseId", "formResponseId", "field", "submit", "value", "onChange", "responses", "enduser"]);
1542
- var session = (0, __1.useResolvedSession)();
1543
- var eId = '';
1544
- try {
1545
- eId = new URL(window.location.href).searchParams.get('eId') || enduserId || (enduser === null || enduser === void 0 ? void 0 : enduser.id) || '';
1546
- }
1547
- catch (err) { }
1548
- var email = (((_d = (_b = responses === null || responses === void 0 ? void 0 : responses.find(function (r) { return r.intakeField === 'email'; })) === null || _b === void 0 ? void 0 : _b.answer) === null || _d === void 0 ? void 0 : _d.value)
1549
- || (enduser === null || enduser === void 0 ? void 0 : enduser.email)
1550
- || session.userInfo.email);
1551
- var phone = (((_f = (_e = responses === null || responses === void 0 ? void 0 : responses.find(function (r) { return r.intakeField === 'phone'; })) === null || _e === void 0 ? void 0 : _e.answer) === null || _f === void 0 ? void 0 : _f.value)
1552
- || (enduser === null || enduser === void 0 ? void 0 : enduser.phone)
1553
- || session.userInfo.phone);
1554
- var fname = (((_h = (_g = responses === null || responses === void 0 ? void 0 : responses.find(function (r) { return r.intakeField === 'fname'; })) === null || _g === void 0 ? void 0 : _g.answer) === null || _h === void 0 ? void 0 : _h.value)
1555
- || (enduser === null || enduser === void 0 ? void 0 : enduser.fname)
1556
- || ((_j = session.userInfo) === null || _j === void 0 ? void 0 : _j.fname));
1557
- var lname = (((_l = (_k = responses === null || responses === void 0 ? void 0 : responses.find(function (r) { return r.intakeField === 'lname'; })) === null || _k === void 0 ? void 0 : _k.answer) === null || _l === void 0 ? void 0 : _l.value)
1558
- || (enduser === null || enduser === void 0 ? void 0 : enduser.lname)
1559
- || ((_m = session.userInfo) === null || _m === void 0 ? void 0 : _m.lname));
1560
- var state = (((_p = (_o = responses === null || responses === void 0 ? void 0 : responses.find(function (r) { return r.intakeField === 'state'; })) === null || _o === void 0 ? void 0 : _o.answer) === null || _p === void 0 ? void 0 : _p.value)
1561
- || ((_s = (_r = (_q = responses === null || responses === void 0 ? void 0 : responses.find(function (r) { return r.intakeField === 'Address'; })) === null || _q === void 0 ? void 0 : _q.answer) === null || _r === void 0 ? void 0 : _r.value) === null || _s === void 0 ? void 0 : _s.state)
1562
- || (enduser === null || enduser === void 0 ? void 0 : enduser.state)
1563
- || ((_t = session.userInfo) === null || _t === void 0 ? void 0 : _t.state));
1564
- (0, react_1.useEffect)(function () {
1565
- var _a, _b;
1566
- if (session.type === 'user') {
1567
- return;
1568
- }
1569
- if ((_a = field.options) === null || _a === void 0 ? void 0 : _a.redirectExternalUrl) {
1570
- submit === null || submit === void 0 ? void 0 : submit().finally(function () {
1571
- var _a;
1572
- if (!((_a = field.options) === null || _a === void 0 ? void 0 : _a.redirectExternalUrl)) {
1573
- return;
1574
- }
1575
- window.location.href = ((0, exports.include_current_url_parameters_if_templated)((0, utilities_1.replace_enduser_template_values)(field.options.redirectExternalUrl, __assign(__assign({}, session.userInfo), { id: eId, email: email, fname: fname, lname: lname, state: state, phone: phone }))));
1576
- }).catch(console.error);
1577
- return;
1578
- }
1579
- if (!((_b = field.options) === null || _b === void 0 ? void 0 : _b.redirectFormId)) {
1580
- return;
1581
- }
1582
- session.api.form_responses.prepare_form_response({
1583
- enduserId: session.userInfo.id || eId,
1584
- formId: field.options.redirectFormId,
1585
- rootResponseId: rootResponseId || formResponseId,
1586
- parentResponseId: formResponseId,
1587
- })
1588
- .then(function (_a) {
1589
- var fullURL = _a.fullURL;
1590
- return (
1591
- // we should still redirect even if submission fails
1592
- submit === null || submit === void 0 ? void 0 : submit().catch(console.error).finally(function () {
1593
- // if accessing form group in portal
1594
- if (window.location.href.includes('/documents') && groupId && groupInsance) {
1595
- var toRedirect = "".concat(window.location.origin, "/documents?groupId=").concat(groupId, "&groupInstance=").concat(groupInsance);
1596
- if (fullURL.endsWith('&')) {
1597
- window.location.replace(fullURL + "back=".concat(toRedirect, "&"));
1598
- }
1599
- else {
1600
- window.location.replace(fullURL + "&back=".concat(toRedirect));
1601
- }
1602
- }
1603
- else {
1604
- window.location.replace(fullURL);
1605
- }
1606
- }));
1607
- })
1608
- .catch(console.error);
1609
- }, [session, email, fname, lname, state, phone]);
1610
- if (session.type === 'user') {
1611
- return ((0, jsx_runtime_1.jsx)(material_1.Typography, { children: "Redirect is for patient-facing forms only" }));
1612
- }
1613
- return null;
1614
- };
1615
- exports.RedirectInput = RedirectInput;
1521
+ // Re-export from V1 to follow DRY principles
1522
+ var inputs_3 = require("./inputs");
1523
+ Object.defineProperty(exports, "RedirectInput", { enumerable: true, get: function () { return inputs_3.RedirectInput; } });
1616
1524
  var HiddenValueInput = function (_a) {
1617
1525
  var goToNextField = _a.goToNextField, goToPreviousField = _a.goToPreviousField, field = _a.field, value = _a.value, onChange = _a.onChange, isSinglePage = _a.isSinglePage, groupFields = _a.groupFields;
1618
1526
  var lastRef = (0, react_1.useRef)(0);