@harshshahcg/survey-render 1.0.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/LICENSE +21 -0
- package/README.md +195 -0
- package/dist/components/ExitConfirmationDialog.d.ts +8 -0
- package/dist/components/QuestionListCarousel.d.ts +13 -0
- package/dist/components/QuestionMapper.d.ts +13 -0
- package/dist/components/QuestionOverviewPanel.d.ts +12 -0
- package/dist/components/QuestionRenderer.d.ts +16 -0
- package/dist/components/SubmissionLoadingOverlay.d.ts +4 -0
- package/dist/components/SurveyContainer.d.ts +11 -0
- package/dist/components/SurveyRenderer.d.ts +15 -0
- package/dist/components/ValidationDialog.d.ts +9 -0
- package/dist/components/custom/DatePicker.d.ts +10 -0
- package/dist/components/custom/Dropdown.d.ts +17 -0
- package/dist/components/custom/ImageResponse.d.ts +12 -0
- package/dist/components/custom/MCQSelect.d.ts +13 -0
- package/dist/components/custom/MediaUpload.d.ts +12 -0
- package/dist/components/custom/TabularInput.d.ts +38 -0
- package/dist/components/custom/TextResponse.d.ts +11 -0
- package/dist/components/custom/VideoResponse.d.ts +12 -0
- package/dist/components/custom/VoiceResponse.d.ts +12 -0
- package/dist/components/ui/alert.d.ts +9 -0
- package/dist/components/ui/badge.d.ts +9 -0
- package/dist/components/ui/button-variants.d.ts +4 -0
- package/dist/components/ui/button.d.ts +13 -0
- package/dist/components/ui/card.d.ts +9 -0
- package/dist/components/ui/dialog.d.ts +15 -0
- package/dist/components/ui/input.d.ts +3 -0
- package/dist/components/ui/label.d.ts +6 -0
- package/dist/components/ui/pagination.d.ts +13 -0
- package/dist/components/ui/popover.d.ts +7 -0
- package/dist/components/ui/progress.d.ts +4 -0
- package/dist/components/ui/select.d.ts +15 -0
- package/dist/components/ui/tabs.d.ts +7 -0
- package/dist/components/ui/textarea.d.ts +3 -0
- package/dist/helpers/constants.d.ts +7 -0
- package/dist/index.d.ts +33 -0
- package/dist/lib/utils.d.ts +2 -0
- package/dist/surveyRender.js +7458 -0
- package/dist/surveyRender.js.map +1 -0
- package/dist/surveyRender.umd.cjs +100 -0
- package/dist/surveyRender.umd.cjs.map +1 -0
- package/dist/types/survey.types.d.ts +80 -0
- package/dist/utils/conditionalLogic.d.ts +25 -0
- package/dist/utils/fileUtils.d.ts +34 -0
- package/dist/utils/questionStatus.d.ts +11 -0
- package/dist/utils/responseFormatter.d.ts +12 -0
- package/dist/utils/validation.d.ts +20 -0
- package/package.json +67 -0
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Default media validation constants.
|
|
3
|
+
* Used when survey data.config does not provide per-type settings.
|
|
4
|
+
* Size in MB for readability; fileUtils converts to bytes.
|
|
5
|
+
*/
|
|
6
|
+
export declare const DEFAULT_MEDIA_ALLOWED_TYPES: Record<string, string[]>;
|
|
7
|
+
export declare const DEFAULT_MEDIA_MAX_SIZE_MB: Record<string, number>;
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* surveyRender – Reusable Survey Rendering Library
|
|
3
|
+
* Renders surveys from JSON config; supports conditional logic, validation, file uploads (base64).
|
|
4
|
+
* Returns responses in required array format. No offline sync or storage.
|
|
5
|
+
*/
|
|
6
|
+
export { SurveyRenderer } from "./components/SurveyRenderer";
|
|
7
|
+
export { SurveyContainer } from "./components/SurveyContainer";
|
|
8
|
+
export { QuestionRenderer } from "./components/QuestionRenderer";
|
|
9
|
+
export { QuestionListCarousel } from "./components/QuestionListCarousel";
|
|
10
|
+
export { QuestionOverviewPanel } from "./components/QuestionOverviewPanel";
|
|
11
|
+
export { ValidationDialog } from "./components/ValidationDialog";
|
|
12
|
+
export { ExitConfirmationDialog } from "./components/ExitConfirmationDialog";
|
|
13
|
+
export { SubmissionLoadingOverlay } from "./components/SubmissionLoadingOverlay";
|
|
14
|
+
export type { SurveyRendererProps } from "./components/SurveyRenderer";
|
|
15
|
+
export type { SurveyContainerProps } from "./components/SurveyContainer";
|
|
16
|
+
export type { QuestionRendererProps } from "./components/QuestionRenderer";
|
|
17
|
+
export type { QuestionListCarouselProps, QuestionStatus as CarouselQuestionStatus } from "./components/QuestionListCarousel";
|
|
18
|
+
export type { QuestionOverviewPanelProps } from "./components/QuestionOverviewPanel";
|
|
19
|
+
export type { ValidationDialogProps } from "./components/ValidationDialog";
|
|
20
|
+
export type { ExitConfirmationDialogProps } from "./components/ExitConfirmationDialog";
|
|
21
|
+
export type { SubmissionLoadingOverlayProps } from "./components/SubmissionLoadingOverlay";
|
|
22
|
+
export { type SurveyConfig, type SurveyMediaConfigItem, type SurveyQuestion, type SurveyResponseArray, type SurveyResponseItem, type SurveySubmitPayload, type RowAnswer, type FileObject, type SupportedQuestionType, SUPPORTED_QUESTION_TYPES, isSupportedQuestionType, getDefaultValue, } from "./types/survey.types";
|
|
23
|
+
export { calculateVisibility, clearHiddenResponses, } from "./utils/conditionalLogic";
|
|
24
|
+
export type { VisibilityResult } from "./utils/conditionalLogic";
|
|
25
|
+
export { validateResponses, canSubmit, } from "./utils/validation";
|
|
26
|
+
export type { ValidationErrorItem } from "./utils/validation";
|
|
27
|
+
export { formatResponses } from "./utils/responseFormatter";
|
|
28
|
+
export type { InternalResponses } from "./utils/responseFormatter";
|
|
29
|
+
export { getQuestionStatusMap } from "./utils/questionStatus";
|
|
30
|
+
export type { QuestionStatus } from "./utils/questionStatus";
|
|
31
|
+
export { validateFile, validateFileType, validateFileSize, fileToFileObject, getEffectiveMediaConfig, MEDIA_ALLOWED_TYPES, MEDIA_MAX_SIZE_MB, } from "./utils/fileUtils";
|
|
32
|
+
export type { FileValidationResult, EffectiveMediaConfig } from "./utils/fileUtils";
|
|
33
|
+
export { DEFAULT_MEDIA_ALLOWED_TYPES, DEFAULT_MEDIA_MAX_SIZE_MB, } from "./helpers/constants";
|