@tellescope/react-components 1.193.0 → 1.194.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.
@@ -1 +1 @@
1
- {"version":3,"file":"components.d.ts","sourceRoot":"","sources":["../../../src/CMS/components.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAM1C,eAAO,MAAM,UAAU,aAAc,eAAe,uBAoBnD,CAAA"}
1
+ {"version":3,"file":"components.d.ts","sourceRoot":"","sources":["../../../src/CMS/components.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAM1C,eAAO,MAAM,UAAU,aAAc,eAAe,uBAoBnD,CAAA"}
@@ -67,7 +67,7 @@ export declare const QuestionForField: ({ form, value, field, file, responses, s
67
67
  id: string;
68
68
  createdAt: Date;
69
69
  })[] | undefined;
70
- } & Pick<TellescopeFormProps, "enduserId" | "enduser" | "fields" | "rootResponseId" | "groupId" | "groupInstance" | "responses" | "submit" | "formResponseId" | "selectedFiles" | "goToPreviousField" | "goToNextField" | "isPreviousDisabled" | "handleDatabaseSelect" | "onAddFile" | "onFieldChange" | "customInputs" | "validateField">) => JSX.Element | null;
70
+ } & Pick<TellescopeFormProps, "enduserId" | "fields" | "rootResponseId" | "groupId" | "groupInstance" | "responses" | "enduser" | "submit" | "formResponseId" | "goToNextField" | "isPreviousDisabled" | "goToPreviousField" | "handleDatabaseSelect" | "onAddFile" | "onFieldChange" | "customInputs" | "selectedFiles" | "validateField">) => JSX.Element | null;
71
71
  export declare const TellescopeSingleQuestionFlow: typeof TellescopeForm;
72
72
  export declare const DEFAULT_THANKS_MESSAGE = "Your response was successfully recorded";
73
73
  export declare const ThanksMessage: ({ thanksMessage, htmlThanksMessage, showRestartAtEnd, downloadComponent, }: {
@@ -76,7 +76,7 @@ export declare const ThanksMessage: ({ thanksMessage, htmlThanksMessage, showRes
76
76
  showRestartAtEnd?: boolean | undefined;
77
77
  downloadComponent?: React.ReactNode;
78
78
  }) => JSX.Element;
79
- export declare const SaveDraft: ({ selectedFiles, enduserId, responses, existingResponses, fields, onSuccess, formResponseId, includedFieldIds, formId, style, disabled, getResponsesWithQuestionGroupAnswers, isInternalNote, formTitle, rootResponseId, parentResponseId, }: Styled & Pick<TellescopeFormProps, "enduserId" | "onSuccess" | "fields" | "responses" | "existingResponses" | "selectedFiles" | "getResponsesWithQuestionGroupAnswers"> & {
79
+ export declare const SaveDraft: ({ selectedFiles, enduserId, responses, existingResponses, fields, onSuccess, formResponseId, includedFieldIds, formId, style, disabled, getResponsesWithQuestionGroupAnswers, isInternalNote, formTitle, rootResponseId, parentResponseId, }: Styled & Pick<TellescopeFormProps, "enduserId" | "fields" | "responses" | "onSuccess" | "existingResponses" | "selectedFiles" | "getResponsesWithQuestionGroupAnswers"> & {
80
80
  disabled?: boolean | undefined;
81
81
  formResponseId?: string | undefined;
82
82
  formId: string;
@@ -86,7 +86,7 @@ export declare const SaveDraft: ({ selectedFiles, enduserId, responses, existing
86
86
  rootResponseId?: string | undefined;
87
87
  parentResponseId?: string | undefined;
88
88
  }) => JSX.Element;
89
- export declare const UpdateResponse: ({ selectedFiles, enduserId, responses, onSuccess, formResponseId, includedFieldIds, formId, style, disabled, getResponsesWithQuestionGroupAnswers, existingResponses, fields, }: Styled & Pick<TellescopeFormProps, "enduserId" | "onSuccess" | "fields" | "responses" | "existingResponses" | "selectedFiles" | "getResponsesWithQuestionGroupAnswers"> & {
89
+ export declare const UpdateResponse: ({ selectedFiles, enduserId, responses, onSuccess, formResponseId, includedFieldIds, formId, style, disabled, getResponsesWithQuestionGroupAnswers, existingResponses, fields, }: Styled & Pick<TellescopeFormProps, "enduserId" | "fields" | "responses" | "onSuccess" | "existingResponses" | "selectedFiles" | "getResponsesWithQuestionGroupAnswers"> & {
90
90
  disabled?: boolean | undefined;
91
91
  formResponseId?: string | undefined;
92
92
  formId: string;
@@ -20,7 +20,7 @@ export declare const RatingInput: ({ field, value, onChange }: FormInputProps<'r
20
20
  export declare const RankingInput: ({ field, value, onChange }: FormInputProps<'ranking'>) => JSX.Element;
21
21
  export declare const DateInput: ({ field, value, onChange, placement, ...props }: {
22
22
  field: FormField;
23
- placement?: "left" | "right" | "bottom" | "top" | undefined;
23
+ placement?: "top" | "right" | "bottom" | "left" | undefined;
24
24
  } & FormInputProps<"date"> & Styled) => JSX.Element;
25
25
  export declare const TableInput: ({ field, value, onChange, ...props }: FormInputProps<'Input Table'>) => JSX.Element;
26
26
  export declare const AutoFocusTextField: (props: TextFieldProps) => JSX.Element;
@@ -724,13 +724,16 @@ export var MultipleChoiceInput = function (_a) {
724
724
  return (_jsxs(Grid, __assign({ container: true, alignItems: "center" }, { children: [radio
725
725
  ? (_jsxs(FormControl, __assign({ fullWidth: true }, { children: [_jsx(FormLabel, __assign({ id: "radio-group-".concat(field.id, "-label") }, { children: form_display_text_for_language(form, "Select One") })), _jsx(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) {
726
726
  return _jsx(FormControlLabel, { color: "primary", label: c, sx: multipleChoiceItemSx, style: { marginLeft: '0px' }, checked: !!(value === null || value === void 0 ? void 0 : value.includes(c)) && c !== otherString, control: _jsx(Radio, { onClick: function () { return onChange((value === null || value === void 0 ? void 0 : value.includes(c)) ? [] : [c], field.id); } }) }, i);
727
- }) }))] }))) : ((choices !== null && choices !== void 0 ? choices : []).map(function (c, i) { return (_jsx(Grid, __assign({ xs: 12, onClick: function () { return onChange(((value === null || value === void 0 ? void 0 : value.includes(c))
728
- ? (radio
729
- ? []
730
- : value.filter(function (v) { return v !== c; }))
731
- : (radio
732
- ? [c]
733
- : __spreadArray(__spreadArray([], (value !== null && value !== void 0 ? value : []), true), [c], false))), field.id); } }, { children: _jsxs(Grid, __assign({ container: true, alignItems: "center", wrap: "nowrap", sx: multipleChoiceItemSx }, { children: [_jsx(Checkbox, { color: "primary", checked: !!(value === null || value === void 0 ? void 0 : value.includes(c)) && c !== otherString, inputProps: { 'aria-label': 'primary checkbox' } }), _jsxs(Typography, __assign({ component: "span" }, { children: [" ", c, " "] }))] })) }), i)); })), other &&
727
+ }) }))] }))) : ((choices !== null && choices !== void 0 ? choices : []).map(function (c, i) { return (_jsx(Grid, __assign({ xs: 12, onClick: function () {
728
+ var _a, _b, _d, _e;
729
+ return onChange(((value === null || value === void 0 ? void 0 : value.includes(c))
730
+ ? ((radio || ((_b = (_a = field.options) === null || _a === void 0 ? void 0 : _a.radioChoices) === null || _b === void 0 ? void 0 : _b.includes(c)))
731
+ ? []
732
+ : value.filter(function (v) { return v !== c; }))
733
+ : ((radio || ((_e = (_d = field.options) === null || _d === void 0 ? void 0 : _d.radioChoices) === null || _e === void 0 ? void 0 : _e.includes(c)))
734
+ ? [c]
735
+ : __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);
736
+ } }, { children: _jsxs(Grid, __assign({ container: true, alignItems: "center", wrap: "nowrap", sx: multipleChoiceItemSx }, { children: [_jsx(Checkbox, { color: "primary", checked: !!(value === null || value === void 0 ? void 0 : value.includes(c)) && c !== otherString, inputProps: { 'aria-label': 'primary checkbox' } }), _jsxs(Typography, __assign({ component: "span" }, { children: [" ", c, " "] }))] })) }), i)); })), other &&
734
737
  _jsx(Grid, __assign({ item: true, xs: 12 }, { children: _jsx(TextField // className={classes.textField}
735
738
  , { InputProps: { sx: { borderRadius: 2.5 } }, sx: { width: radio ? "calc(100% - 15px)" : '100%' }, size: "small", "aria-label": form_display_text_for_language(form, "Other"), value: otherString, placeholder: form_display_text_for_language(form, "Other"), variant: "outlined",
736
739
  // onClick={() => !otherChecked && handleOtherChecked()} // allow click to enable when disabled