@harshshahcg/survey-render 1.0.8 → 1.1.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/README.md CHANGED
@@ -234,7 +234,7 @@ const config: SurveyConfig = {
234
234
  - Optional: `options` / `optionsEN`, `textInputType`, `textLimitCharacter`, `minValue` / `maxValue`, `childrenQuestions`, `tableHeaderValue`, `tableQuestionValue`, `userAnswer` (prefill), etc.
235
235
 
236
236
  - **Media config** (`data.config`)
237
- - Keys: e.g. `"image-response"`, `"video-response"`, `"voice-response"`
237
+ - Keys: e.g. `"image-response"`, `"video-response"`, `"voice-response"`, `"document-response"`, `"pdf-response"`
238
238
  - Values: `supportedType` (or legacy `suppotedType`) and `supportedSize` (MB). Used for allowed MIME types and max file size.
239
239
 
240
240
  ## Supported question types
@@ -249,6 +249,8 @@ const config: SurveyConfig = {
249
249
  | `image-response` | Image upload (base64) |
250
250
  | `video-response` | Video upload (base64) |
251
251
  | `voice-response` | Audio upload (base64) |
252
+ | `document-response` | Document upload (PDF, Word, etc.; base64) |
253
+ | `pdf-response` | PDF-only upload (base64) |
252
254
  | `tabular-text-input` | Rows with text fields |
253
255
  | `tabular-drop-down` | Rows with dropdowns |
254
256
  | `tabular-check-box` | Rows with checkboxes |
@@ -0,0 +1,12 @@
1
+ import type { SurveyQuestion, FileObject } from "../../types/survey.types";
2
+ import type { EffectiveMediaConfig } from "../../utils/fileUtils";
3
+ export interface DocumentResponseProps {
4
+ question: SurveyQuestion;
5
+ value: FileObject | null;
6
+ onChange: (value: FileObject | null) => void;
7
+ error?: string;
8
+ disabled?: boolean;
9
+ mediaConfig?: EffectiveMediaConfig | null;
10
+ className?: string;
11
+ }
12
+ export declare function DocumentResponse({ question: _question, value, onChange, error, disabled, mediaConfig, className, }: DocumentResponseProps): import("react/jsx-runtime").JSX.Element;
@@ -1,12 +1,13 @@
1
1
  import type { FileObject } from "../../types/survey.types";
2
2
  import type { EffectiveMediaConfig } from "../../utils/fileUtils";
3
- export type MediaType = "image" | "video" | "audio";
3
+ /** Question types that use file upload; config comes from DEFAULT_MEDIA_ALLOWED_TYPES / survey config. */
4
+ export type MediaQuestionType = "image-response" | "video-response" | "voice-response" | "document-response" | "pdf-response";
4
5
  export interface MediaUploadProps {
5
- mediaType: MediaType;
6
+ questionType: MediaQuestionType;
6
7
  value: FileObject | null;
7
8
  onChange: (value: FileObject | null) => void;
8
9
  className?: string;
9
10
  disabled?: boolean;
10
11
  mediaConfig?: EffectiveMediaConfig | null;
11
12
  }
12
- export default function MediaUpload({ mediaType, value, onChange, className, disabled, mediaConfig, }: MediaUploadProps): import("react/jsx-runtime").JSX.Element;
13
+ export default function MediaUpload({ questionType, value, onChange, className, disabled, mediaConfig, }: MediaUploadProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,12 @@
1
+ import type { SurveyQuestion, FileObject } from "../../types/survey.types";
2
+ import type { EffectiveMediaConfig } from "../../utils/fileUtils";
3
+ export interface PdfResponseProps {
4
+ question: SurveyQuestion;
5
+ value: FileObject | null;
6
+ onChange: (value: FileObject | null) => void;
7
+ error?: string;
8
+ disabled?: boolean;
9
+ mediaConfig?: EffectiveMediaConfig | null;
10
+ className?: string;
11
+ }
12
+ export declare function PdfResponse({ question: _question, value, onChange, error, disabled, mediaConfig, className, }: PdfResponseProps): import("react/jsx-runtime").JSX.Element;