@123usmanhaider321/ui 0.1.8 → 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/README.md +416 -31
- package/dist/images/icon/1LINK.svg +50 -0
- package/dist/images/icon/CreditCard.svg +83 -0
- package/dist/images/icon/Easypaisa.png +0 -0
- package/dist/images/icon/MobileWallet.png +0 -0
- package/dist/images/icon/Raast-Logo.png +0 -0
- package/dist/images/icon/VISA.png +0 -0
- package/dist/images/icon/add-circle-1.svg +5 -0
- package/dist/images/icon/check-circle-broken.svg +3 -0
- package/dist/images/icon/close-circle.svg +5 -0
- package/dist/images/icon/jazzcash.png +0 -0
- package/dist/images/icon/loading_icon.json +3347 -0
- package/dist/images/icon/mastercard-logo.webp +0 -0
- package/dist/images/icon/paymo.jpeg +0 -0
- package/dist/images/icon/preview-svgrepo-com.svg +36 -0
- package/dist/images/icon/trash.svg +7 -0
- package/dist/images/icon/unionpay-logo.svg +9 -0
- package/dist/index-87FQZHOs.js +11119 -0
- package/dist/index-87FQZHOs.js.map +1 -0
- package/dist/index-Tl9g213f.js +60475 -0
- package/dist/index-Tl9g213f.js.map +1 -0
- package/dist/index.d.ts +1 -10
- package/dist/index.es-CpgTaa1Y.js +16734 -0
- package/dist/index.es-CpgTaa1Y.js.map +1 -0
- package/dist/index.js +40 -12
- package/dist/index.js.map +1 -1
- package/dist/loading_icon-n5H5dQBl.js +3375 -0
- package/dist/loading_icon-n5H5dQBl.js.map +1 -0
- package/dist/src/components/Alert/ErrorAlert.d.ts +6 -0
- package/dist/src/components/Alert/SuccessAlert.d.ts +6 -0
- package/dist/{components → src/components}/FormBuilder/DiscountInput.d.ts +3 -6
- package/dist/{components → src/components}/FormBuilder/FormBuilder.d.ts +2 -11
- package/dist/{components → src/components}/FormBuilder/QuestionCard.d.ts +0 -5
- package/dist/{components → src/components}/FormBuilder/QuestionEditor.d.ts +0 -5
- package/dist/{components → src/components}/FormBuilder/SortableQuestionList.d.ts +0 -5
- package/dist/src/components/FormBuilder/questionIcons.d.ts +5 -0
- package/dist/{components/EventAddForm → src/components/NewAddEvent}/AddEventLayout.d.ts +2 -1
- package/dist/{components/EventAddForm → src/components/NewAddEvent}/AddEventStepper.d.ts +2 -2
- package/dist/{components/EventAddForm → src/components/NewAddEvent}/common/ConfirmationModal.d.ts +1 -1
- package/dist/src/components/NewAddEvent/components/EventSubmissionConfirmationModal.d.ts +14 -0
- package/dist/{components/EventAddForm → src/components/NewAddEvent}/components/StepTwo/TicketTierSection.d.ts +1 -1
- package/dist/{components/EventAddForm → src/components/NewAddEvent}/components/TicketTierForm.d.ts +1 -1
- package/dist/{components/EventAddForm → src/components/NewAddEvent}/hooks/useStepperForm.d.ts +22 -22
- package/dist/{components/EventAddForm → src/components/NewAddEvent}/hooks/useTicketTierForm.d.ts +63 -15
- package/dist/src/components/NewAddEvent/schemas/step1.d.ts +211 -0
- package/dist/src/components/NewAddEvent/schemas/step2.d.ts +411 -0
- package/dist/{components/EventAddForm → src/components/NewAddEvent}/schemas/utils.d.ts +8 -2
- package/dist/{components/EventAddForm → src/components/NewAddEvent}/steps/IndividualFormStep.d.ts +1 -1
- package/dist/{components/EventAddForm → src/components/NewAddEvent}/steps/SocialProfilesStep.d.ts +1 -1
- package/dist/{components/EventAddForm → src/components/NewAddEvent}/steps/TeamFormStep.d.ts +1 -1
- package/dist/src/components/Spinner/spinner.d.ts +4 -0
- package/dist/src/components/TicketlyUIProvider.d.ts +35 -0
- package/dist/src/components/common/Loader/index.d.ts +8 -0
- package/dist/src/components/common/Modals/ConfirmationModal.d.ts +7 -0
- package/dist/{components/FormInput → src/components/ui}/FormInput.d.ts +1 -1
- package/dist/src/components/ui/Loader.d.ts +4 -0
- package/dist/{components/Button/Button.d.ts → src/components/ui/button.d.ts} +1 -1
- package/dist/src/index.d.ts +10 -0
- package/dist/{lib → src/lib}/actions.d.ts +0 -126
- package/dist/src/lib/dom-utils.d.ts +2 -0
- package/dist/src/lib/storage-utils.d.ts +5 -0
- package/dist/src/lib/types.d.ts +258 -0
- package/dist/src/redux/baseQuery.d.ts +16 -0
- package/dist/{services → src/redux/features}/eventApi.d.ts +1053 -1745
- package/dist/src/redux/features/globalSlice.d.ts +17 -0
- package/dist/{services → src/redux/features/single-event}/single-event-api.d.ts +856 -1190
- package/dist/src/redux/types.d.ts +2 -0
- package/dist/src/services/library-services.d.ts +15 -0
- package/dist/src/services/remote-config.d.ts +27 -0
- package/dist/{services → src/services}/utils.d.ts +1 -1
- package/dist/src/theme/colors.d.ts +127 -0
- package/dist/src/theme/typography.d.ts +13 -0
- package/dist/src/types/api.d.ts +18 -0
- package/dist/style.css +2984 -0
- package/dist/styles.css +3758 -4012
- package/package.json +78 -68
- package/dist/_virtual/_commonjsHelpers.js +0 -9
- package/dist/_virtual/_commonjsHelpers.js.map +0 -1
- package/dist/_virtual/customParseFormat.js +0 -5
- package/dist/_virtual/customParseFormat.js.map +0 -1
- package/dist/_virtual/dayjs.min.js +0 -5
- package/dist/_virtual/dayjs.min.js.map +0 -1
- package/dist/_virtual/duration.js +0 -5
- package/dist/_virtual/duration.js.map +0 -1
- package/dist/_virtual/index.js +0 -5
- package/dist/_virtual/index.js.map +0 -1
- package/dist/_virtual/isBetween.js +0 -5
- package/dist/_virtual/isBetween.js.map +0 -1
- package/dist/_virtual/relativeTime.js +0 -5
- package/dist/_virtual/relativeTime.js.map +0 -1
- package/dist/_virtual/use-sync-external-store-shim.development.js +0 -5
- package/dist/_virtual/use-sync-external-store-shim.development.js.map +0 -1
- package/dist/_virtual/use-sync-external-store-shim.production.js +0 -5
- package/dist/_virtual/use-sync-external-store-shim.production.js.map +0 -1
- package/dist/_virtual/with-selector.development.js +0 -5
- package/dist/_virtual/with-selector.development.js.map +0 -1
- package/dist/_virtual/with-selector.js +0 -5
- package/dist/_virtual/with-selector.js.map +0 -1
- package/dist/_virtual/with-selector.production.js +0 -5
- package/dist/_virtual/with-selector.production.js.map +0 -1
- package/dist/components/Alert/Alert.js +0 -51
- package/dist/components/Alert/Alert.js.map +0 -1
- package/dist/components/Button/Button.js +0 -52
- package/dist/components/Button/Button.js.map +0 -1
- package/dist/components/Button/Button.test.d.ts +0 -1
- package/dist/components/Button/index.d.ts +0 -1
- package/dist/components/Checkbox/Checkbox.js +0 -50
- package/dist/components/Checkbox/Checkbox.js.map +0 -1
- package/dist/components/Checkbox/Checkbox.test.d.ts +0 -1
- package/dist/components/Checkbox/index.d.ts +0 -1
- package/dist/components/CheckboxGroup/CheckboxGroup.d.ts +0 -25
- package/dist/components/CheckboxGroup/CheckboxGroup.js +0 -99
- package/dist/components/CheckboxGroup/CheckboxGroup.js.map +0 -1
- package/dist/components/ConfirmationModal/ConfirmationModal.d.ts +0 -15
- package/dist/components/ConfirmationModal/ConfirmationModal.js +0 -136
- package/dist/components/ConfirmationModal/ConfirmationModal.js.map +0 -1
- package/dist/components/ConfirmationModal/index.d.ts +0 -2
- package/dist/components/CustomSelect/CustomSelect.js +0 -259
- package/dist/components/CustomSelect/CustomSelect.js.map +0 -1
- package/dist/components/EventAddForm/AddEventLayout.js +0 -227
- package/dist/components/EventAddForm/AddEventLayout.js.map +0 -1
- package/dist/components/EventAddForm/AddEventStepper.js +0 -719
- package/dist/components/EventAddForm/AddEventStepper.js.map +0 -1
- package/dist/components/EventAddForm/common/ConfirmationModal.js +0 -136
- package/dist/components/EventAddForm/common/ConfirmationModal.js.map +0 -1
- package/dist/components/EventAddForm/common/DescriptionModal.js +0 -70
- package/dist/components/EventAddForm/common/DescriptionModal.js.map +0 -1
- package/dist/components/EventAddForm/components/AnimatedBackground.d.ts +0 -8
- package/dist/components/EventAddForm/components/ApprovalConfirmationModal.d.ts +0 -7
- package/dist/components/EventAddForm/components/CheckboxGroup.js +0 -92
- package/dist/components/EventAddForm/components/CheckboxGroup.js.map +0 -1
- package/dist/components/EventAddForm/components/CustomMeetingForm.js +0 -237
- package/dist/components/EventAddForm/components/CustomMeetingForm.js.map +0 -1
- package/dist/components/EventAddForm/components/DateTimeField.js +0 -173
- package/dist/components/EventAddForm/components/DateTimeField.js.map +0 -1
- package/dist/components/EventAddForm/components/EventSubmissionConfirmationModal.d.ts +0 -33
- package/dist/components/EventAddForm/components/EventSubmissionConfirmationModal.js +0 -366
- package/dist/components/EventAddForm/components/EventSubmissionConfirmationModal.js.map +0 -1
- package/dist/components/EventAddForm/components/FileUpload.js +0 -412
- package/dist/components/EventAddForm/components/FileUpload.js.map +0 -1
- package/dist/components/EventAddForm/components/FormBuilderProceedModal.js +0 -197
- package/dist/components/EventAddForm/components/FormBuilderProceedModal.js.map +0 -1
- package/dist/components/EventAddForm/components/GoogleMapsAutocompleteInput.js +0 -1179
- package/dist/components/EventAddForm/components/GoogleMapsAutocompleteInput.js.map +0 -1
- package/dist/components/EventAddForm/components/InputField.d.ts +0 -15
- package/dist/components/EventAddForm/components/RadioGroupButton.d.ts +0 -14
- package/dist/components/EventAddForm/components/SelectField.d.ts +0 -19
- package/dist/components/EventAddForm/components/SingleDateTimeInput.js +0 -102
- package/dist/components/EventAddForm/components/SingleDateTimeInput.js.map +0 -1
- package/dist/components/EventAddForm/components/StepTwo/CustomFormSection.js +0 -277
- package/dist/components/EventAddForm/components/StepTwo/CustomFormSection.js.map +0 -1
- package/dist/components/EventAddForm/components/StepTwo/TicketTierSection.js +0 -148
- package/dist/components/EventAddForm/components/StepTwo/TicketTierSection.js.map +0 -1
- package/dist/components/EventAddForm/components/TicketTierForm.js +0 -418
- package/dist/components/EventAddForm/components/TicketTierForm.js.map +0 -1
- package/dist/components/EventAddForm/components/TicketTypeSelection.js +0 -93
- package/dist/components/EventAddForm/components/TicketTypeSelection.js.map +0 -1
- package/dist/components/EventAddForm/hooks/useStepperForm.js +0 -371
- package/dist/components/EventAddForm/hooks/useStepperForm.js.map +0 -1
- package/dist/components/EventAddForm/hooks/useTicketTierForm.js +0 -237
- package/dist/components/EventAddForm/hooks/useTicketTierForm.js.map +0 -1
- package/dist/components/EventAddForm/index.d.ts +0 -3
- package/dist/components/EventAddForm/index.js +0 -41
- package/dist/components/EventAddForm/index.js.map +0 -1
- package/dist/components/EventAddForm/schemas/index.d.ts +0 -2
- package/dist/components/EventAddForm/schemas/step1.d.ts +0 -47
- package/dist/components/EventAddForm/schemas/step1.js +0 -135
- package/dist/components/EventAddForm/schemas/step1.js.map +0 -1
- package/dist/components/EventAddForm/schemas/step2.d.ts +0 -138
- package/dist/components/EventAddForm/schemas/step2.js +0 -94
- package/dist/components/EventAddForm/schemas/step2.js.map +0 -1
- package/dist/components/EventAddForm/schemas/utils.js +0 -28
- package/dist/components/EventAddForm/schemas/utils.js.map +0 -1
- package/dist/components/EventAddForm/steps/IndividualFormStep.js +0 -85
- package/dist/components/EventAddForm/steps/IndividualFormStep.js.map +0 -1
- package/dist/components/EventAddForm/steps/SocialProfilesStep.js +0 -123
- package/dist/components/EventAddForm/steps/SocialProfilesStep.js.map +0 -1
- package/dist/components/EventAddForm/steps/StepOne.js +0 -462
- package/dist/components/EventAddForm/steps/StepOne.js.map +0 -1
- package/dist/components/EventAddForm/steps/StepTwo.js +0 -173
- package/dist/components/EventAddForm/steps/StepTwo.js.map +0 -1
- package/dist/components/EventAddForm/steps/TeamFormStep.js +0 -13
- package/dist/components/EventAddForm/steps/TeamFormStep.js.map +0 -1
- package/dist/components/FormBuilder/CategoryList.js +0 -242
- package/dist/components/FormBuilder/CategoryList.js.map +0 -1
- package/dist/components/FormBuilder/DiscountInput.js +0 -366
- package/dist/components/FormBuilder/DiscountInput.js.map +0 -1
- package/dist/components/FormBuilder/FormBuilder.js +0 -918
- package/dist/components/FormBuilder/FormBuilder.js.map +0 -1
- package/dist/components/FormBuilder/OptionList.js +0 -120
- package/dist/components/FormBuilder/OptionList.js.map +0 -1
- package/dist/components/FormBuilder/PaymentPreview.d.ts +0 -12
- package/dist/components/FormBuilder/PaymentPreview.js +0 -70
- package/dist/components/FormBuilder/PaymentPreview.js.map +0 -1
- package/dist/components/FormBuilder/PreviewInput.d.ts +0 -10
- package/dist/components/FormBuilder/PreviewInput.js +0 -143
- package/dist/components/FormBuilder/PreviewInput.js.map +0 -1
- package/dist/components/FormBuilder/QuestionCard.js +0 -252
- package/dist/components/FormBuilder/QuestionCard.js.map +0 -1
- package/dist/components/FormBuilder/QuestionEditor.js +0 -166
- package/dist/components/FormBuilder/QuestionEditor.js.map +0 -1
- package/dist/components/FormBuilder/RequiredToggle.js +0 -43
- package/dist/components/FormBuilder/RequiredToggle.js.map +0 -1
- package/dist/components/FormBuilder/SortableQuestionList.js +0 -137
- package/dist/components/FormBuilder/SortableQuestionList.js.map +0 -1
- package/dist/components/FormBuilder/index.d.ts +0 -4
- package/dist/components/FormBuilder/utils.js +0 -229
- package/dist/components/FormBuilder/utils.js.map +0 -1
- package/dist/components/FormInput/FormInput.js +0 -126
- package/dist/components/FormInput/FormInput.js.map +0 -1
- package/dist/components/FormInput/FormInput.test.d.ts +0 -1
- package/dist/components/FormInput/index.d.ts +0 -2
- package/dist/components/ImageCropModal/index.js +0 -464
- package/dist/components/ImageCropModal/index.js.map +0 -1
- package/dist/components/InformationPopover/InformationPopover.d.ts +0 -7
- package/dist/components/InformationPopover/InformationPopover.js +0 -19
- package/dist/components/InformationPopover/InformationPopover.js.map +0 -1
- package/dist/components/InformationPopover.js +0 -19
- package/dist/components/InformationPopover.js.map +0 -1
- package/dist/components/InputErrorMessage/InputErrorMessage.js +0 -21
- package/dist/components/InputErrorMessage/InputErrorMessage.js.map +0 -1
- package/dist/components/Modal/Modal.d.ts +0 -15
- package/dist/components/Modal/Modal.js +0 -73
- package/dist/components/Modal/Modal.js.map +0 -1
- package/dist/components/Radio/Radio.js +0 -35
- package/dist/components/Radio/Radio.js.map +0 -1
- package/dist/components/Spinner/spinner.d.ts +0 -2
- package/dist/components/Spinner/spinner.js +0 -22
- package/dist/components/Spinner/spinner.js.map +0 -1
- package/dist/components/Toggle/Toggle.d.ts +0 -16
- package/dist/components/Toggle/index.d.ts +0 -2
- package/dist/components/Tooltip/Tooltip.d.ts +0 -12
- package/dist/components/Tooltip/Tooltip.js +0 -134
- package/dist/components/Tooltip/Tooltip.js.map +0 -1
- package/dist/components/common/FallbackImage.js +0 -47
- package/dist/components/common/FallbackImage.js.map +0 -1
- package/dist/components/ui/Calendar/calendar-utils.js +0 -51
- package/dist/components/ui/Calendar/calendar-utils.js.map +0 -1
- package/dist/components/ui/Calendar/index.js +0 -142
- package/dist/components/ui/Calendar/index.js.map +0 -1
- package/dist/components/ui/Checkbox.d.ts +0 -9
- package/dist/components/ui/Checkbox.js +0 -50
- package/dist/components/ui/Checkbox.js.map +0 -1
- package/dist/components/ui/DatePicker/index.js +0 -188
- package/dist/components/ui/DatePicker/index.js.map +0 -1
- package/dist/components/ui/FormInput.js +0 -129
- package/dist/components/ui/FormInput.js.map +0 -1
- package/dist/components/ui/InputErrorMessage.d.ts +0 -7
- package/dist/components/ui/InputErrorMessage.js +0 -21
- package/dist/components/ui/InputErrorMessage.js.map +0 -1
- package/dist/components/ui/Modal/index.js +0 -73
- package/dist/components/ui/Modal/index.js.map +0 -1
- package/dist/components/ui/Radio.d.ts +0 -6
- package/dist/components/ui/Radio.js +0 -35
- package/dist/components/ui/Radio.js.map +0 -1
- package/dist/components/ui/RichTextEditor.js +0 -242
- package/dist/components/ui/RichTextEditor.js.map +0 -1
- package/dist/components/ui/TimePicker/index.js +0 -215
- package/dist/components/ui/TimePicker/index.js.map +0 -1
- package/dist/components/ui/TimeSelector/index.js +0 -138
- package/dist/components/ui/TimeSelector/index.js.map +0 -1
- package/dist/components/ui/Tooltip.d.ts +0 -12
- package/dist/components/ui/Tooltip.js +0 -136
- package/dist/components/ui/Tooltip.js.map +0 -1
- package/dist/hooks/useDropdownPosition.d.ts +0 -11
- package/dist/hooks/useFirebaseAuthState.d.ts +0 -6
- package/dist/hooks/useFirebaseAuthState.js +0 -23
- package/dist/hooks/useFirebaseAuthState.js.map +0 -1
- package/dist/hooks/useTicketTierForm.d.ts +0 -61
- package/dist/lib/actions.js +0 -32
- package/dist/lib/actions.js.map +0 -1
- package/dist/lib/cropImage.js +0 -113
- package/dist/lib/cropImage.js.map +0 -1
- package/dist/lib/imageAnalysis.js +0 -58
- package/dist/lib/imageAnalysis.js.map +0 -1
- package/dist/lib/utils.js +0 -9
- package/dist/lib/utils.js.map +0 -1
- package/dist/node_modules/@dnd-kit/accessibility/dist/accessibility.esm.js +0 -60
- package/dist/node_modules/@dnd-kit/accessibility/dist/accessibility.esm.js.map +0 -1
- package/dist/node_modules/@dnd-kit/core/dist/core.esm.js +0 -3458
- package/dist/node_modules/@dnd-kit/core/dist/core.esm.js.map +0 -1
- package/dist/node_modules/@dnd-kit/sortable/dist/sortable.esm.js +0 -593
- package/dist/node_modules/@dnd-kit/sortable/dist/sortable.esm.js.map +0 -1
- package/dist/node_modules/@dnd-kit/utilities/dist/utilities.esm.js +0 -302
- package/dist/node_modules/@dnd-kit/utilities/dist/utilities.esm.js.map +0 -1
- package/dist/node_modules/@firebase/app/dist/esm/index.esm.js +0 -768
- package/dist/node_modules/@firebase/app/dist/esm/index.esm.js.map +0 -1
- package/dist/node_modules/@firebase/component/dist/esm/index.esm.js +0 -340
- package/dist/node_modules/@firebase/component/dist/esm/index.esm.js.map +0 -1
- package/dist/node_modules/@firebase/logger/dist/esm/index.esm.js +0 -123
- package/dist/node_modules/@firebase/logger/dist/esm/index.esm.js.map +0 -1
- package/dist/node_modules/@firebase/storage/dist/index.esm.js +0 -2623
- package/dist/node_modules/@firebase/storage/dist/index.esm.js.map +0 -1
- package/dist/node_modules/@firebase/util/dist/index.esm.js +0 -658
- package/dist/node_modules/@firebase/util/dist/index.esm.js.map +0 -1
- package/dist/node_modules/@firebase/util/dist/postinstall.js +0 -5
- package/dist/node_modules/@firebase/util/dist/postinstall.js.map +0 -1
- package/dist/node_modules/@fortawesome/fontawesome-svg-core/index.js +0 -3179
- package/dist/node_modules/@fortawesome/fontawesome-svg-core/index.js.map +0 -1
- package/dist/node_modules/@fortawesome/free-solid-svg-icons/index.js +0 -60
- package/dist/node_modules/@fortawesome/free-solid-svg-icons/index.js.map +0 -1
- package/dist/node_modules/@fortawesome/react-fontawesome/dist/index.js +0 -400
- package/dist/node_modules/@fortawesome/react-fontawesome/dist/index.js.map +0 -1
- package/dist/node_modules/@heroicons/react/20/solid/esm/CheckIcon.js +0 -27
- package/dist/node_modules/@heroicons/react/20/solid/esm/CheckIcon.js.map +0 -1
- package/dist/node_modules/@heroicons/react/20/solid/esm/ChevronDownIcon.js +0 -27
- package/dist/node_modules/@heroicons/react/20/solid/esm/ChevronDownIcon.js.map +0 -1
- package/dist/node_modules/@heroicons/react/24/outline/esm/ArrowRightIcon.js +0 -29
- package/dist/node_modules/@heroicons/react/24/outline/esm/ArrowRightIcon.js.map +0 -1
- package/dist/node_modules/@heroicons/react/24/outline/esm/ClockIcon.js +0 -29
- package/dist/node_modules/@heroicons/react/24/outline/esm/ClockIcon.js.map +0 -1
- package/dist/node_modules/@heroicons/react/24/outline/esm/DocumentDuplicateIcon.js +0 -29
- package/dist/node_modules/@heroicons/react/24/outline/esm/DocumentDuplicateIcon.js.map +0 -1
- package/dist/node_modules/@heroicons/react/24/outline/esm/InformationCircleIcon.js +0 -29
- package/dist/node_modules/@heroicons/react/24/outline/esm/InformationCircleIcon.js.map +0 -1
- package/dist/node_modules/@heroicons/react/24/outline/esm/LinkIcon.js +0 -29
- package/dist/node_modules/@heroicons/react/24/outline/esm/LinkIcon.js.map +0 -1
- package/dist/node_modules/@heroicons/react/24/outline/esm/MagnifyingGlassIcon.js +0 -29
- package/dist/node_modules/@heroicons/react/24/outline/esm/MagnifyingGlassIcon.js.map +0 -1
- package/dist/node_modules/@heroicons/react/24/outline/esm/MapPinIcon.js +0 -33
- package/dist/node_modules/@heroicons/react/24/outline/esm/MapPinIcon.js.map +0 -1
- package/dist/node_modules/@heroicons/react/24/outline/esm/VideoCameraIcon.js +0 -29
- package/dist/node_modules/@heroicons/react/24/outline/esm/VideoCameraIcon.js.map +0 -1
- package/dist/node_modules/@heroicons/react/24/outline/esm/XMarkIcon.js +0 -29
- package/dist/node_modules/@heroicons/react/24/outline/esm/XMarkIcon.js.map +0 -1
- package/dist/node_modules/@tiptap/core/dist/index.js +0 -5446
- package/dist/node_modules/@tiptap/core/dist/index.js.map +0 -1
- package/dist/node_modules/@tiptap/core/dist/jsx-runtime/jsx-runtime.js +0 -21
- package/dist/node_modules/@tiptap/core/dist/jsx-runtime/jsx-runtime.js.map +0 -1
- package/dist/node_modules/@tiptap/extension-blockquote/dist/index.js +0 -78
- package/dist/node_modules/@tiptap/extension-blockquote/dist/index.js.map +0 -1
- package/dist/node_modules/@tiptap/extension-bold/dist/index.js +0 -100
- package/dist/node_modules/@tiptap/extension-bold/dist/index.js.map +0 -1
- package/dist/node_modules/@tiptap/extension-code/dist/index.js +0 -70
- package/dist/node_modules/@tiptap/extension-code/dist/index.js.map +0 -1
- package/dist/node_modules/@tiptap/extension-code-block/dist/index.js +0 -317
- package/dist/node_modules/@tiptap/extension-code-block/dist/index.js.map +0 -1
- package/dist/node_modules/@tiptap/extension-document/dist/index.js +0 -16
- package/dist/node_modules/@tiptap/extension-document/dist/index.js.map +0 -1
- package/dist/node_modules/@tiptap/extension-hard-break/dist/index.js +0 -66
- package/dist/node_modules/@tiptap/extension-hard-break/dist/index.js.map +0 -1
- package/dist/node_modules/@tiptap/extension-heading/dist/index.js +0 -86
- package/dist/node_modules/@tiptap/extension-heading/dist/index.js.map +0 -1
- package/dist/node_modules/@tiptap/extension-horizontal-rule/dist/index.js +0 -80
- package/dist/node_modules/@tiptap/extension-horizontal-rule/dist/index.js.map +0 -1
- package/dist/node_modules/@tiptap/extension-italic/dist/index.js +0 -98
- package/dist/node_modules/@tiptap/extension-italic/dist/index.js.map +0 -1
- package/dist/node_modules/@tiptap/extension-link/dist/index.js +0 -423
- package/dist/node_modules/@tiptap/extension-link/dist/index.js.map +0 -1
- package/dist/node_modules/@tiptap/extension-list/dist/index.js +0 -1039
- package/dist/node_modules/@tiptap/extension-list/dist/index.js.map +0 -1
- package/dist/node_modules/@tiptap/extension-paragraph/dist/index.js +0 -61
- package/dist/node_modules/@tiptap/extension-paragraph/dist/index.js.map +0 -1
- package/dist/node_modules/@tiptap/extension-placeholder/dist/index.js +0 -7
- package/dist/node_modules/@tiptap/extension-placeholder/dist/index.js.map +0 -1
- package/dist/node_modules/@tiptap/extension-strike/dist/index.js +0 -79
- package/dist/node_modules/@tiptap/extension-strike/dist/index.js.map +0 -1
- package/dist/node_modules/@tiptap/extension-text/dist/index.js +0 -16
- package/dist/node_modules/@tiptap/extension-text/dist/index.js.map +0 -1
- package/dist/node_modules/@tiptap/extension-underline/dist/index.js +0 -76
- package/dist/node_modules/@tiptap/extension-underline/dist/index.js.map +0 -1
- package/dist/node_modules/@tiptap/extensions/dist/index.js +0 -376
- package/dist/node_modules/@tiptap/extensions/dist/index.js.map +0 -1
- package/dist/node_modules/@tiptap/react/dist/index.js +0 -650
- package/dist/node_modules/@tiptap/react/dist/index.js.map +0 -1
- package/dist/node_modules/@tiptap/starter-kit/dist/index.js +0 -97
- package/dist/node_modules/@tiptap/starter-kit/dist/index.js.map +0 -1
- package/dist/node_modules/dayjs/dayjs.min.js +0 -283
- package/dist/node_modules/dayjs/dayjs.min.js.map +0 -1
- package/dist/node_modules/dayjs/plugin/customParseFormat.js +0 -130
- package/dist/node_modules/dayjs/plugin/customParseFormat.js.map +0 -1
- package/dist/node_modules/dayjs/plugin/duration.js +0 -137
- package/dist/node_modules/dayjs/plugin/duration.js.map +0 -1
- package/dist/node_modules/dayjs/plugin/isBetween.js +0 -20
- package/dist/node_modules/dayjs/plugin/isBetween.js.map +0 -1
- package/dist/node_modules/dayjs/plugin/relativeTime.js +0 -49
- package/dist/node_modules/dayjs/plugin/relativeTime.js.map +0 -1
- package/dist/node_modules/fast-equals/dist/es/index.js +0 -442
- package/dist/node_modules/fast-equals/dist/es/index.js.map +0 -1
- package/dist/node_modules/idb/build/index.js +0 -70
- package/dist/node_modules/idb/build/index.js.map +0 -1
- package/dist/node_modules/idb/build/wrap-idb-value.js +0 -149
- package/dist/node_modules/idb/build/wrap-idb-value.js.map +0 -1
- package/dist/node_modules/linkifyjs/dist/linkify.js +0 -1159
- package/dist/node_modules/linkifyjs/dist/linkify.js.map +0 -1
- package/dist/node_modules/orderedmap/dist/index.js +0 -120
- package/dist/node_modules/orderedmap/dist/index.js.map +0 -1
- package/dist/node_modules/prosemirror-commands/dist/index.js +0 -527
- package/dist/node_modules/prosemirror-commands/dist/index.js.map +0 -1
- package/dist/node_modules/prosemirror-dropcursor/dist/index.js +0 -137
- package/dist/node_modules/prosemirror-dropcursor/dist/index.js.map +0 -1
- package/dist/node_modules/prosemirror-gapcursor/dist/index.js +0 -221
- package/dist/node_modules/prosemirror-gapcursor/dist/index.js.map +0 -1
- package/dist/node_modules/prosemirror-history/dist/index.js +0 -357
- package/dist/node_modules/prosemirror-history/dist/index.js.map +0 -1
- package/dist/node_modules/prosemirror-keymap/dist/index.js +0 -84
- package/dist/node_modules/prosemirror-keymap/dist/index.js.map +0 -1
- package/dist/node_modules/prosemirror-model/dist/index.js +0 -3209
- package/dist/node_modules/prosemirror-model/dist/index.js.map +0 -1
- package/dist/node_modules/prosemirror-schema-list/dist/index.js +0 -131
- package/dist/node_modules/prosemirror-schema-list/dist/index.js.map +0 -1
- package/dist/node_modules/prosemirror-state/dist/index.js +0 -936
- package/dist/node_modules/prosemirror-state/dist/index.js.map +0 -1
- package/dist/node_modules/prosemirror-transform/dist/index.js +0 -1881
- package/dist/node_modules/prosemirror-transform/dist/index.js.map +0 -1
- package/dist/node_modules/prosemirror-view/dist/index.js +0 -5232
- package/dist/node_modules/prosemirror-view/dist/index.js.map +0 -1
- package/dist/node_modules/rope-sequence/dist/index.js +0 -184
- package/dist/node_modules/rope-sequence/dist/index.js.map +0 -1
- package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.development.js +0 -82
- package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.development.js.map +0 -1
- package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.production.js +0 -78
- package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.production.js.map +0 -1
- package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js +0 -78
- package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js.map +0 -1
- package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.js +0 -63
- package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.js.map +0 -1
- package/dist/node_modules/use-sync-external-store/shim/index.js +0 -13
- package/dist/node_modules/use-sync-external-store/shim/index.js.map +0 -1
- package/dist/node_modules/use-sync-external-store/shim/with-selector.js +0 -13
- package/dist/node_modules/use-sync-external-store/shim/with-selector.js.map +0 -1
- package/dist/node_modules/w3c-keyname/index.js +0 -106
- package/dist/node_modules/w3c-keyname/index.js.map +0 -1
- package/dist/node_modules/zod/v4/classic/coerce.js +0 -10
- package/dist/node_modules/zod/v4/classic/coerce.js.map +0 -1
- package/dist/node_modules/zod/v4/classic/compat.js +0 -8
- package/dist/node_modules/zod/v4/classic/compat.js.map +0 -1
- package/dist/node_modules/zod/v4/classic/errors.js +0 -45
- package/dist/node_modules/zod/v4/classic/errors.js.map +0 -1
- package/dist/node_modules/zod/v4/classic/iso.js +0 -44
- package/dist/node_modules/zod/v4/classic/iso.js.map +0 -1
- package/dist/node_modules/zod/v4/classic/parse.js +0 -30
- package/dist/node_modules/zod/v4/classic/parse.js.map +0 -1
- package/dist/node_modules/zod/v4/classic/schemas.js +0 -711
- package/dist/node_modules/zod/v4/classic/schemas.js.map +0 -1
- package/dist/node_modules/zod/v4/core/api.js +0 -588
- package/dist/node_modules/zod/v4/core/api.js.map +0 -1
- package/dist/node_modules/zod/v4/core/checks.js +0 -411
- package/dist/node_modules/zod/v4/core/checks.js.map +0 -1
- package/dist/node_modules/zod/v4/core/core.js +0 -75
- package/dist/node_modules/zod/v4/core/core.js.map +0 -1
- package/dist/node_modules/zod/v4/core/doc.js +0 -38
- package/dist/node_modules/zod/v4/core/doc.js.map +0 -1
- package/dist/node_modules/zod/v4/core/errors.js +0 -73
- package/dist/node_modules/zod/v4/core/errors.js.map +0 -1
- package/dist/node_modules/zod/v4/core/json-schema-processors.js +0 -359
- package/dist/node_modules/zod/v4/core/json-schema-processors.js.map +0 -1
- package/dist/node_modules/zod/v4/core/parse.js +0 -96
- package/dist/node_modules/zod/v4/core/parse.js.map +0 -1
- package/dist/node_modules/zod/v4/core/regexes.js +0 -84
- package/dist/node_modules/zod/v4/core/regexes.js.map +0 -1
- package/dist/node_modules/zod/v4/core/registries.js +0 -52
- package/dist/node_modules/zod/v4/core/registries.js.map +0 -1
- package/dist/node_modules/zod/v4/core/schemas.js +0 -1391
- package/dist/node_modules/zod/v4/core/schemas.js.map +0 -1
- package/dist/node_modules/zod/v4/core/to-json-schema.js +0 -363
- package/dist/node_modules/zod/v4/core/to-json-schema.js.map +0 -1
- package/dist/node_modules/zod/v4/core/util.js +0 -431
- package/dist/node_modules/zod/v4/core/util.js.map +0 -1
- package/dist/node_modules/zod/v4/core/versions.js +0 -9
- package/dist/node_modules/zod/v4/core/versions.js.map +0 -1
- package/dist/redux/baseQuery.d.ts +0 -1
- package/dist/redux/baseQuery.js +0 -24
- package/dist/redux/baseQuery.js.map +0 -1
- package/dist/services/eventApi.js +0 -411
- package/dist/services/eventApi.js.map +0 -1
- package/dist/services/helpers.js +0 -115
- package/dist/services/helpers.js.map +0 -1
- package/dist/services/initialize-firebase.d.ts +0 -2
- package/dist/services/initialize-firebase.js +0 -20
- package/dist/services/initialize-firebase.js.map +0 -1
- package/dist/services/process-image-on-server.js +0 -30
- package/dist/services/process-image-on-server.js.map +0 -1
- package/dist/services/remote-config.d.ts +0 -5
- package/dist/services/remote-config.js +0 -9
- package/dist/services/remote-config.js.map +0 -1
- package/dist/services/single-event-api.js +0 -301
- package/dist/services/single-event-api.js.map +0 -1
- package/dist/services/utils.js +0 -107
- package/dist/services/utils.js.map +0 -1
- package/dist/setupTests.d.ts +0 -1
- package/dist/stories/Alert.stories.d.ts +0 -10
- package/dist/stories/Button.stories.d.ts +0 -13
- package/dist/types/redux-types.d.ts +0 -15
- package/dist/types/types.d.ts +0 -60
- package/dist/types/types.js +0 -10
- package/dist/types/types.js.map +0 -1
- package/dist/utils/cn.d.ts +0 -6
- package/dist/utils/cn.js +0 -9
- package/dist/utils/cn.js.map +0 -1
- package/dist/utils/date-range.d.ts +0 -4
- package/dist/utils/date-range.js +0 -13
- package/dist/utils/date-range.js.map +0 -1
- package/dist/utils/single-event-helpers.d.ts +0 -50
- package/dist/utils/single-event-helpers.js +0 -18
- package/dist/utils/single-event-helpers.js.map +0 -1
- package/dist/utils/social-validation.js +0 -42
- package/dist/utils/social-validation.js.map +0 -1
- package/dist/utils/utils.js +0 -20
- package/dist/utils/utils.js.map +0 -1
- /package/dist/{components/Alert/Alert.d.ts → src/components/Alert/index.d.ts} +0 -0
- /package/dist/{components → src/components}/FormBuilder/CategoryList.d.ts +0 -0
- /package/dist/{components → src/components}/FormBuilder/OptionList.d.ts +0 -0
- /package/dist/{components → src/components}/FormBuilder/RequiredToggle.d.ts +0 -0
- /package/dist/{components → src/components}/FormBuilder/types.d.ts +0 -0
- /package/dist/{components → src/components}/FormBuilder/utils.d.ts +0 -0
- /package/dist/{components → src/components}/ImageCropModal/index.d.ts +0 -0
- /package/dist/{components → src/components}/InformationPopover.d.ts +0 -0
- /package/dist/{components/EventAddForm → src/components/NewAddEvent}/common/DescriptionModal.d.ts +0 -0
- /package/dist/{components/ui/FormInput.d.ts → src/components/NewAddEvent/components/AddEventFormInput.d.ts} +0 -0
- /package/dist/{components/EventAddForm → src/components/NewAddEvent}/components/CheckboxGroup.d.ts +0 -0
- /package/dist/{components/EventAddForm → src/components/NewAddEvent}/components/CustomMeetingForm.d.ts +0 -0
- /package/dist/{components/EventAddForm → src/components/NewAddEvent}/components/DateTimeField.d.ts +0 -0
- /package/dist/{components/EventAddForm → src/components/NewAddEvent}/components/FileUpload.d.ts +0 -0
- /package/dist/{components/EventAddForm → src/components/NewAddEvent}/components/FormBuilderProceedModal.d.ts +0 -0
- /package/dist/{components/EventAddForm → src/components/NewAddEvent}/components/GoogleMapsAutocompleteInput.d.ts +0 -0
- /package/dist/{components/EventAddForm → src/components/NewAddEvent}/components/SingleDateTimeInput.d.ts +0 -0
- /package/dist/{components/EventAddForm → src/components/NewAddEvent}/components/StepTwo/CustomFormSection.d.ts +0 -0
- /package/dist/{components/EventAddForm → src/components/NewAddEvent}/components/TicketTypeSelection.d.ts +0 -0
- /package/dist/{components/EventAddForm → src/components/NewAddEvent}/steps/StepOne.d.ts +0 -0
- /package/dist/{components/EventAddForm → src/components/NewAddEvent}/steps/StepTwo.d.ts +0 -0
- /package/dist/{components/EventAddForm → src/components/NewAddEvent}/types.d.ts +0 -0
- /package/dist/{components → src/components}/common/FallbackImage.d.ts +0 -0
- /package/dist/{components → src/components}/ui/Calendar/calendar-utils.d.ts +0 -0
- /package/dist/{components → src/components}/ui/Calendar/index.d.ts +0 -0
- /package/dist/{components/Checkbox → src/components/ui}/Checkbox.d.ts +0 -0
- /package/dist/{components/CustomSelect → src/components/ui}/CustomSelect.d.ts +0 -0
- /package/dist/{components → src/components}/ui/DatePicker/index.d.ts +0 -0
- /package/dist/{components/InputErrorMessage → src/components/ui}/InputErrorMessage.d.ts +0 -0
- /package/dist/{components → src/components}/ui/Modal/index.d.ts +0 -0
- /package/dist/{components/Radio → src/components/ui}/Radio.d.ts +0 -0
- /package/dist/{components → src/components}/ui/RichTextEditor.d.ts +0 -0
- /package/dist/{components → src/components}/ui/TimePicker/index.d.ts +0 -0
- /package/dist/{components → src/components}/ui/TimeSelector/index.d.ts +0 -0
- /package/dist/{components → src/components}/ui/Tooltip/index.d.ts +0 -0
- /package/dist/{lib → src/lib}/constants.d.ts +0 -0
- /package/dist/{lib → src/lib}/cropImage.d.ts +0 -0
- /package/dist/{lib → src/lib}/imageAnalysis.d.ts +0 -0
- /package/dist/{utils → src/lib}/social-validation.d.ts +0 -0
- /package/dist/{lib/utils.d.ts → src/lib/tailwind-merge.d.ts} +0 -0
- /package/dist/{utils → src/lib}/utils.d.ts +0 -0
- /package/dist/{services → src/redux/features/single-event}/helpers.d.ts +0 -0
- /package/dist/{services → src/services}/process-image-on-server.d.ts +0 -0
- /package/dist/{types → src/types}/events.d.ts +0 -0
- /package/dist/{types → src/types}/question.d.ts +0 -0
|
@@ -1,252 +0,0 @@
|
|
|
1
|
-
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { memo } from "react";
|
|
3
|
-
import QuestionEditor from "./QuestionEditor.js";
|
|
4
|
-
import { FontAwesomeIcon } from "../../node_modules/@fortawesome/react-fontawesome/dist/index.js";
|
|
5
|
-
import { FiUploadCloud } from "react-icons/fi";
|
|
6
|
-
import { faGripHorizontal, faTrash } from "../../node_modules/@fortawesome/free-solid-svg-icons/index.js";
|
|
7
|
-
import { Info, Copy } from "lucide-react";
|
|
8
|
-
import { cn } from "../../utils/cn.js";
|
|
9
|
-
import RequiredToggle from "./RequiredToggle.js";
|
|
10
|
-
import PreviewInput from "./PreviewInput.js";
|
|
11
|
-
import PaymentPreview from "./PaymentPreview.js";
|
|
12
|
-
import { Tooltip } from "../Tooltip/Tooltip.js";
|
|
13
|
-
import { Button } from "../Button/Button.js";
|
|
14
|
-
const QuestionCard = ({
|
|
15
|
-
question,
|
|
16
|
-
formId,
|
|
17
|
-
eventId,
|
|
18
|
-
userUid,
|
|
19
|
-
isLocked,
|
|
20
|
-
isOpen,
|
|
21
|
-
onToggle,
|
|
22
|
-
dragHandleProps,
|
|
23
|
-
onDelete,
|
|
24
|
-
onUpdate,
|
|
25
|
-
onSave,
|
|
26
|
-
onDuplicate,
|
|
27
|
-
onCancel,
|
|
28
|
-
isDirty = false,
|
|
29
|
-
isSaving = false,
|
|
30
|
-
isNew = false,
|
|
31
|
-
isValid = true,
|
|
32
|
-
disabled = false,
|
|
33
|
-
errorMessage,
|
|
34
|
-
scope,
|
|
35
|
-
participationType,
|
|
36
|
-
disableDiscountOption,
|
|
37
|
-
showValidationErrors,
|
|
38
|
-
storageService
|
|
39
|
-
}) => {
|
|
40
|
-
var _a;
|
|
41
|
-
const handleDelete = (e) => {
|
|
42
|
-
e.stopPropagation();
|
|
43
|
-
if (onDelete) {
|
|
44
|
-
onDelete(question.id);
|
|
45
|
-
}
|
|
46
|
-
};
|
|
47
|
-
const handleDuplicate = (e) => {
|
|
48
|
-
e.stopPropagation();
|
|
49
|
-
if (onDuplicate) {
|
|
50
|
-
onDuplicate(question.id);
|
|
51
|
-
}
|
|
52
|
-
};
|
|
53
|
-
const isSystemQuestion = ["TEAM_SIZE", "NAME_ON_TICKET"].includes(question.kind);
|
|
54
|
-
const DragHandle = /* @__PURE__ */ jsx(
|
|
55
|
-
"div",
|
|
56
|
-
{
|
|
57
|
-
...!disabled ? dragHandleProps : {},
|
|
58
|
-
className: cn(
|
|
59
|
-
"absolute top-0 left-1/2 -translate-x-1/2 --mt-3 w-12 h-6 flex items-center justify-center bg-white border border-gray-300 rounded-full shadow-sm z-10 transition-opacity",
|
|
60
|
-
"opacity-0 group-hover:opacity-100",
|
|
61
|
-
disabled ? "cursor-not-allowed text-gray-300" : "cursor-move text-gray-400 hover:text-gray-600"
|
|
62
|
-
),
|
|
63
|
-
title: disabled ? "" : "Drag to move",
|
|
64
|
-
children: /* @__PURE__ */ jsx(FontAwesomeIcon, { icon: faGripHorizontal, className: "transform rotate-90" })
|
|
65
|
-
}
|
|
66
|
-
);
|
|
67
|
-
return /* @__PURE__ */ jsxs(
|
|
68
|
-
"div",
|
|
69
|
-
{
|
|
70
|
-
onClick: () => !isOpen && onToggle(),
|
|
71
|
-
className: cn(
|
|
72
|
-
"bg-white border border-gray-200 hover:border-gray-300 transition-all duration-200 relative group rounded-lg",
|
|
73
|
-
isOpen ? "shadow-md" : "",
|
|
74
|
-
disabled ? "opacity-70" : ""
|
|
75
|
-
),
|
|
76
|
-
children: [
|
|
77
|
-
!isLocked && !isSystemQuestion && !isNew && !isOpen && !disabled && DragHandle,
|
|
78
|
-
/* @__PURE__ */ jsxs("div", { className: "relative w-full rounded-lg px-4", children: [
|
|
79
|
-
/* @__PURE__ */ jsx("div", { className: cn(
|
|
80
|
-
"absolute top-0 left-0 w-1.5 h-full transition-all overflow-hidden rounded-l-full"
|
|
81
|
-
), children: /* @__PURE__ */ jsx("div", { className: cn(
|
|
82
|
-
"w-full h-full bg-primaryx-600 transition-all duration-75 ease-in-out",
|
|
83
|
-
isOpen ? "translate-x-0" : "-translate-x-full"
|
|
84
|
-
) }) }),
|
|
85
|
-
/* @__PURE__ */ jsx("div", { className: "relative w-full py-4", children: isOpen ? /* @__PURE__ */ jsx(
|
|
86
|
-
QuestionEditor,
|
|
87
|
-
{
|
|
88
|
-
question,
|
|
89
|
-
formId,
|
|
90
|
-
eventId,
|
|
91
|
-
userUid,
|
|
92
|
-
onClose: onToggle,
|
|
93
|
-
onUpdate,
|
|
94
|
-
errorMessage,
|
|
95
|
-
scope,
|
|
96
|
-
participationType,
|
|
97
|
-
isNew,
|
|
98
|
-
disableDiscountOption,
|
|
99
|
-
showValidationErrors,
|
|
100
|
-
storageService
|
|
101
|
-
}
|
|
102
|
-
) : /* @__PURE__ */ jsxs("div", { className: "w-full flex justify-between items-start", children: [
|
|
103
|
-
/* @__PURE__ */ jsxs("div", { className: "w-full flex-1", children: [
|
|
104
|
-
/* @__PURE__ */ jsxs("h3", { className: "text-sm font-medium text-gray-900 mb-1 flex items-center gap-1", children: [
|
|
105
|
-
question.label || /* @__PURE__ */ jsx("span", { className: "text-gray-400 italic", children: "Untitled Question" }),
|
|
106
|
-
question.required && /* @__PURE__ */ jsx("span", { className: "text-red-500", children: "*" }),
|
|
107
|
-
["TEAM_SIZE", "NAME_ON_TICKET"].includes(question.kind) && /* @__PURE__ */ jsx(
|
|
108
|
-
Tooltip,
|
|
109
|
-
{
|
|
110
|
-
placement: "bottom",
|
|
111
|
-
content: "This question is mandatory and cannot be removed.",
|
|
112
|
-
children: /* @__PURE__ */ jsx(Info, { className: "h-4 w-4 text-gray-400" })
|
|
113
|
-
}
|
|
114
|
-
)
|
|
115
|
-
] }),
|
|
116
|
-
["INPUT_STR", "INPUT_INT", "INPUT_FLOAT", "EMAIL", "PHONE", "CNIC", "DATE", "NAME_ON_TICKET", "TEAM_SIZE"].includes(question.kind) && /* @__PURE__ */ jsx("div", { className: "mt-2 w-full", children: /* @__PURE__ */ jsx(PreviewInput, { type: question.kind, placeholder: question.placeholder }) }),
|
|
117
|
-
["PAYMENT", "PAYMENT_CHECKBOX"].includes(question == null ? void 0 : question.kind) && /* @__PURE__ */ jsx("div", { className: "mt-2 w-full", children: /* @__PURE__ */ jsx(
|
|
118
|
-
PaymentPreview,
|
|
119
|
-
{
|
|
120
|
-
categories: (question == null ? void 0 : question.Categories) || [],
|
|
121
|
-
isCheckbox: question.kind === "PAYMENT_CHECKBOX"
|
|
122
|
-
}
|
|
123
|
-
) }),
|
|
124
|
-
question.kind === "DISCOUNT" && /* @__PURE__ */ jsxs("div", { className: "mt-2 w-full", children: [
|
|
125
|
-
/* @__PURE__ */ jsx("div", { className: "flex gap-2 mb-2", children: /* @__PURE__ */ jsx("div", { className: "flex-1 h-9 rounded-md border border-gray-300 bg-gray-50 px-3 flex items-center text-gray-400 text-sm italic cursor-default", children: "Enter discount code" }) }),
|
|
126
|
-
question.applies_on && question.applies_on.length > 0 && /* @__PURE__ */ jsxs("div", { className: "text-[10px] text-gray-400 flex items-center gap-1.5 px-1", children: [
|
|
127
|
-
/* @__PURE__ */ jsx("div", { className: "w-1 h-1 rounded-full bg-gray-300" }),
|
|
128
|
-
"Applies to ",
|
|
129
|
-
question.applies_on.length,
|
|
130
|
-
" item(s): ",
|
|
131
|
-
question.applies_on.join(", ")
|
|
132
|
-
] })
|
|
133
|
-
] }),
|
|
134
|
-
(question.kind === "MULTIPLE_CHOICE" || question.kind === "CHECKBOX" || question.kind === "DROPDOWN") && /* @__PURE__ */ jsxs("div", { className: "mt-2 text-sm text-gray-500", children: [
|
|
135
|
-
(_a = question.options) == null ? void 0 : _a.map((opt, i) => /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 mb-1", children: [
|
|
136
|
-
question.kind === "MULTIPLE_CHOICE" && /* @__PURE__ */ jsx("div", { className: "w-4 h-4 rounded-full border border-gray-300" }),
|
|
137
|
-
question.kind === "CHECKBOX" && /* @__PURE__ */ jsx("div", { className: "w-4 h-4 rounded border border-gray-300" }),
|
|
138
|
-
question.kind === "DROPDOWN" && /* @__PURE__ */ jsxs("span", { className: "text-xs text-gray-400", children: [
|
|
139
|
-
i + 1,
|
|
140
|
-
"."
|
|
141
|
-
] }),
|
|
142
|
-
/* @__PURE__ */ jsx("span", { children: opt.label })
|
|
143
|
-
] }, opt.id || i)),
|
|
144
|
-
(!question.options || question.options.length === 0) && /* @__PURE__ */ jsx("span", { className: "italic", children: "No options defined" })
|
|
145
|
-
] }),
|
|
146
|
-
question.kind === "FILE_UPLOAD" && /* @__PURE__ */ jsxs("div", { className: "mt-2 w-full flex flex-col items-center justify-center p-6 border-2 border-dashed border-gray-300 rounded-lg bg-gray-50", children: [
|
|
147
|
-
/* @__PURE__ */ jsx("div", { className: "bg-gray-200 p-2 rounded-full mb-2", children: /* @__PURE__ */ jsx("div", { className: "bg-gray-300 p-3 rounded-full", children: /* @__PURE__ */ jsx(FiUploadCloud, { className: "text-gray-700 text-xl" }) }) }),
|
|
148
|
-
/* @__PURE__ */ jsxs("div", { className: "text-primaryx-500 text-sm", children: [
|
|
149
|
-
"Click to upload ",
|
|
150
|
-
/* @__PURE__ */ jsx("span", { className: "text-gray-500 font-normal", children: "or drag and drop" })
|
|
151
|
-
] }),
|
|
152
|
-
/* @__PURE__ */ jsx("div", { className: "text-xs text-gray-400 mt-1", children: "JPG or JPEG (max. 5MB)" })
|
|
153
|
-
] })
|
|
154
|
-
] }),
|
|
155
|
-
!isLocked && !isSystemQuestion && /* @__PURE__ */ jsx("div", { className: "absolute top-2 right-0 opacity-0 group-hover:opacity-100 transition-opacity flex gap-2 flex-shrink-0", children: /* @__PURE__ */ jsx(
|
|
156
|
-
"button",
|
|
157
|
-
{
|
|
158
|
-
onClick: handleDelete,
|
|
159
|
-
className: "w-8 h-8 text-gray-400 hover:text-red-500 rounded-full hover:bg-red-50 transition-colors flex-shrink-0 flex justify-center items-center",
|
|
160
|
-
title: "Delete",
|
|
161
|
-
children: /* @__PURE__ */ jsx(FontAwesomeIcon, { icon: faTrash })
|
|
162
|
-
}
|
|
163
|
-
) })
|
|
164
|
-
] }) }),
|
|
165
|
-
isOpen && !isLocked && /* @__PURE__ */ jsx("div", { className: "border-t border-gray-300 py-2 flex items-center justify-end bg-gray-50 rounded-b-lg gap-4", children: /* @__PURE__ */ jsxs("div", { className: "flex items-center sm:flex-nowrap flex-wrap justify-end", children: [
|
|
166
|
-
!isSystemQuestion && /* @__PURE__ */ jsx(Fragment, { children: !(disableDiscountOption && question.kind === "DISCOUNT") && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
167
|
-
/* @__PURE__ */ jsx(
|
|
168
|
-
"button",
|
|
169
|
-
{
|
|
170
|
-
onClick: handleDuplicate,
|
|
171
|
-
disabled: !isValid,
|
|
172
|
-
className: cn(
|
|
173
|
-
"p-2 transition-colors duration-200 rounded-full",
|
|
174
|
-
!isValid ? "text-gray-300 cursor-not-allowed" : "text-gray-400 hover:text-primaryx-600 hover:bg-gray-100"
|
|
175
|
-
),
|
|
176
|
-
title: !isValid ? "Fix errors to duplicate" : "Duplicate",
|
|
177
|
-
children: /* @__PURE__ */ jsx(Copy, { className: "w-4 h-4" })
|
|
178
|
-
}
|
|
179
|
-
),
|
|
180
|
-
/* @__PURE__ */ jsx("div", { className: "h-6 w-px bg-gray-300 mx-2" })
|
|
181
|
-
] }) }),
|
|
182
|
-
/* @__PURE__ */ jsx("div", { className: "flex items-center pb-1", children: /* @__PURE__ */ jsx(
|
|
183
|
-
RequiredToggle,
|
|
184
|
-
{
|
|
185
|
-
checked: question.required,
|
|
186
|
-
onChange: (checked) => onUpdate(question.id, { required: checked }),
|
|
187
|
-
id: `req-${question.id}`,
|
|
188
|
-
disabled: isSystemQuestion
|
|
189
|
-
}
|
|
190
|
-
) }),
|
|
191
|
-
(question.kind === "PAYMENT" || question.kind === "PAYMENT_CHECKBOX") && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
192
|
-
/* @__PURE__ */ jsx("div", { className: "hidden sm:block h-6 w-px bg-gray-300 mx-2" }),
|
|
193
|
-
/* @__PURE__ */ jsx("div", { className: "flex items-center pb-1", children: /* @__PURE__ */ jsx(
|
|
194
|
-
Tooltip,
|
|
195
|
-
{
|
|
196
|
-
placement: "top",
|
|
197
|
-
content: question.Categories && question.Categories.length > 1 ? "Enable this to allow users to select multiple options." : "Add more than one category to enable multiple selections.",
|
|
198
|
-
children: /* @__PURE__ */ jsx(
|
|
199
|
-
RequiredToggle,
|
|
200
|
-
{
|
|
201
|
-
label: "Multiple Selections",
|
|
202
|
-
checked: question.kind === "PAYMENT_CHECKBOX",
|
|
203
|
-
onChange: (checked) => onUpdate(question.id, { kind: checked ? "PAYMENT_CHECKBOX" : "PAYMENT" }),
|
|
204
|
-
id: `multiple-${question.id}`,
|
|
205
|
-
disabled: !question.Categories || question.Categories.length <= 1
|
|
206
|
-
}
|
|
207
|
-
)
|
|
208
|
-
}
|
|
209
|
-
) })
|
|
210
|
-
] }),
|
|
211
|
-
/* @__PURE__ */ jsx("div", { className: "hidden sm:block h-6 w-px bg-gray-300 mx-2" }),
|
|
212
|
-
/* @__PURE__ */ jsxs("div", { className: "w-full sm:w-fit flex items-center justify-end gap-2", children: [
|
|
213
|
-
/* @__PURE__ */ jsx(
|
|
214
|
-
Button,
|
|
215
|
-
{
|
|
216
|
-
type: "button",
|
|
217
|
-
onClick: (e) => {
|
|
218
|
-
e.stopPropagation();
|
|
219
|
-
onCancel == null ? void 0 : onCancel();
|
|
220
|
-
},
|
|
221
|
-
variant: "outline",
|
|
222
|
-
size: "sm",
|
|
223
|
-
className: "min-w-[80px]",
|
|
224
|
-
children: "Cancel"
|
|
225
|
-
}
|
|
226
|
-
),
|
|
227
|
-
/* @__PURE__ */ jsx(
|
|
228
|
-
Button,
|
|
229
|
-
{
|
|
230
|
-
type: "button",
|
|
231
|
-
onClick: (e) => {
|
|
232
|
-
e.stopPropagation();
|
|
233
|
-
onSave == null ? void 0 : onSave(question.id);
|
|
234
|
-
},
|
|
235
|
-
variant: "default",
|
|
236
|
-
size: "sm",
|
|
237
|
-
className: "min-w-[80px]",
|
|
238
|
-
children: isNew ? "Add" : "Save"
|
|
239
|
-
}
|
|
240
|
-
)
|
|
241
|
-
] })
|
|
242
|
-
] }) })
|
|
243
|
-
] })
|
|
244
|
-
]
|
|
245
|
-
}
|
|
246
|
-
);
|
|
247
|
-
};
|
|
248
|
-
const QuestionCard$1 = memo(QuestionCard);
|
|
249
|
-
export {
|
|
250
|
-
QuestionCard$1 as default
|
|
251
|
-
};
|
|
252
|
-
//# sourceMappingURL=QuestionCard.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"QuestionCard.js","sources":["../../../src/components/FormBuilder/QuestionCard.tsx"],"sourcesContent":["import React, { memo } from 'react';\r\nimport { QuestionDraft } from \"./types\";\r\nimport QuestionEditor from './QuestionEditor';\r\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\r\nimport { FiUploadCloud } from \"react-icons/fi\";\r\nimport { faGripHorizontal, faTrash } from '@fortawesome/free-solid-svg-icons';\r\nimport { Copy } from 'lucide-react';\r\nimport { Button } from '../Button';\r\nimport { cn } from '../../utils/cn';\r\nimport RequiredToggle from './RequiredToggle';\r\nimport PreviewInput from './PreviewInput';\r\nimport PaymentPreview from './PaymentPreview';\r\nimport { Tooltip } from '../Tooltip/Tooltip';\r\nimport { Info } from 'lucide-react';\r\n\r\ninterface QuestionCardProps {\r\n question: QuestionDraft;\r\n formId: string;\r\n eventId: string;\r\n userUid?: string;\r\n isLocked: boolean;\r\n isOpen: boolean;\r\n onToggle: () => void;\r\n dragHandleProps?: React.HTMLAttributes<any>;\r\n onDelete?: (questionId: string) => void;\r\n onUpdate: (questionId: string, updates: Partial<QuestionDraft>) => void;\r\n onSave?: (questionId: string) => void;\r\n onDuplicate?: (questionId: string) => void;\r\n onCancel?: () => void;\r\n isDirty?: boolean;\r\n isSaving?: boolean;\r\n isNew?: boolean;\r\n isValid?: boolean;\r\n disabled?: boolean;\r\n errorMessage?: string;\r\n participationType?: string;\r\n disableDiscountOption?: boolean;\r\n showValidationErrors?: boolean;\r\n scope?: \"INDIVIDUAL\" | \"TEAM\";\r\n storageService?: {\r\n uploadFile: (path: string, file: File) => Promise<void>;\r\n downloadFile: (path: string) => Promise<Blob>;\r\n };\r\n}\r\n\r\nconst QuestionCard: React.FC<QuestionCardProps> = ({\r\n question,\r\n formId,\r\n eventId,\r\n userUid,\r\n isLocked,\r\n isOpen,\r\n onToggle,\r\n dragHandleProps,\r\n onDelete,\r\n onUpdate,\r\n onSave,\r\n onDuplicate,\r\n onCancel,\r\n isDirty = false,\r\n isSaving = false,\r\n isNew = false,\r\n isValid = true,\r\n disabled = false,\r\n errorMessage,\r\n scope,\r\n participationType,\r\n disableDiscountOption,\r\n showValidationErrors,\r\n storageService\r\n}) => {\r\n\r\n const handleDelete = (e: React.MouseEvent) => {\r\n e.stopPropagation();\r\n if (onDelete) {\r\n onDelete(question.id);\r\n }\r\n };\r\n\r\n const handleDuplicate = (e: React.MouseEvent) => {\r\n e.stopPropagation();\r\n if (onDuplicate) {\r\n onDuplicate(question.id);\r\n }\r\n };\r\n\r\n const isSystemQuestion = ['TEAM_SIZE', 'NAME_ON_TICKET'].includes(question.kind);\r\n\r\n const DragHandle = (\r\n <div\r\n {...(!disabled ? dragHandleProps : {})}\r\n className={cn(\r\n \"absolute top-0 left-1/2 -translate-x-1/2 --mt-3 w-12 h-6 flex items-center justify-center bg-white border border-gray-300 rounded-full shadow-sm z-10 transition-opacity\",\r\n \"opacity-0 group-hover:opacity-100\",\r\n disabled ? \"cursor-not-allowed text-gray-300\" : \"cursor-move text-gray-400 hover:text-gray-600\"\r\n )}\r\n title={disabled ? \"\" : \"Drag to move\"}\r\n >\r\n <FontAwesomeIcon icon={faGripHorizontal} className=\"transform rotate-90\" />\r\n </div>\r\n );\r\n\r\n return (\r\n <div\r\n onClick={() => !isOpen && onToggle()}\r\n className={cn(\r\n \"bg-white border border-gray-200 hover:border-gray-300 transition-all duration-200 relative group rounded-lg\",\r\n isOpen ? \"shadow-md\" : \"\",\r\n disabled ? \"opacity-70\" : \"\" \r\n )}\r\n >\r\n {/* Drag Handle - Only show when not editing any question */}\r\n {(!isLocked && !isSystemQuestion && !isNew && !isOpen && !disabled) && (\r\n DragHandle\r\n )}\r\n\r\n <div className=\"relative w-full rounded-lg px-4\">\r\n <div className={cn(\r\n \"absolute top-0 left-0 w-1.5 h-full transition-all overflow-hidden rounded-l-full\",\r\n )}>\r\n <div className={cn(\r\n \"w-full h-full bg-primaryx-600 transition-all duration-75 ease-in-out\",\r\n isOpen ? 'translate-x-0' : '-translate-x-full'\r\n )} />\r\n </div>\r\n\r\n <div className=\"relative w-full py-4\">\r\n {isOpen ? (\r\n <QuestionEditor\r\n question={question}\r\n formId={formId}\r\n eventId={eventId}\r\n userUid={userUid}\r\n onClose={onToggle}\r\n onUpdate={onUpdate}\r\n errorMessage={errorMessage}\r\n scope={scope}\r\n participationType={participationType}\r\n isNew={isNew}\r\n disableDiscountOption={disableDiscountOption}\r\n showValidationErrors={showValidationErrors}\r\n storageService={storageService}\r\n />\r\n ) : (\r\n <div className=\"w-full flex justify-between items-start\">\r\n {/* View Mode */}\r\n <div className=\"w-full flex-1\">\r\n <h3 className=\"text-sm font-medium text-gray-900 mb-1 flex items-center gap-1\">\r\n {question.label || <span className=\"text-gray-400 italic\">Untitled Question</span>}\r\n {question.required && <span className=\"text-red-500\">*</span>}\r\n {\r\n [\"TEAM_SIZE\", \"NAME_ON_TICKET\"].includes(question.kind) && (\r\n <Tooltip\r\n placement=\"bottom\"\r\n content=\"This question is mandatory and cannot be removed.\"\r\n >\r\n <Info className=\"h-4 w-4 text-gray-400\" />\r\n </Tooltip>\r\n )\r\n }\r\n </h3>\r\n {['INPUT_STR', 'INPUT_INT', 'INPUT_FLOAT', 'EMAIL', 'PHONE', 'CNIC', 'DATE', 'NAME_ON_TICKET', 'TEAM_SIZE'].includes(question.kind) && (\r\n <div className=\"mt-2 w-full\">\r\n <PreviewInput type={question.kind} placeholder={question.placeholder} />\r\n </div>\r\n )}\r\n {['PAYMENT', 'PAYMENT_CHECKBOX'].includes(question?.kind) && (\r\n <div className=\"mt-2 w-full\">\r\n <PaymentPreview\r\n categories={question?.Categories || []}\r\n isCheckbox={question.kind === 'PAYMENT_CHECKBOX'}\r\n />\r\n </div>\r\n )}\r\n {question.kind === 'DISCOUNT' && (\r\n <div className=\"mt-2 w-full\">\r\n <div className=\"flex gap-2 mb-2\">\r\n <div className=\"flex-1 h-9 rounded-md border border-gray-300 bg-gray-50 px-3 flex items-center text-gray-400 text-sm italic cursor-default\">\r\n Enter discount code\r\n </div>\r\n </div>\r\n {question.applies_on && question.applies_on.length > 0 && (\r\n <div className=\"text-[10px] text-gray-400 flex items-center gap-1.5 px-1\">\r\n <div className=\"w-1 h-1 rounded-full bg-gray-300\" />\r\n Applies to {question.applies_on.length} item(s): {question.applies_on.join(\", \")}\r\n </div>\r\n )}\r\n </div>\r\n )}\r\n {(question.kind === 'MULTIPLE_CHOICE' || question.kind === 'CHECKBOX' || question.kind === 'DROPDOWN') && (\r\n <div className=\"mt-2 text-sm text-gray-500\">\r\n {question.options?.map((opt, i) => (\r\n <div key={opt.id || i} className=\"flex items-center gap-2 mb-1\">\r\n {question.kind === 'MULTIPLE_CHOICE' && <div className=\"w-4 h-4 rounded-full border border-gray-300\"></div>}\r\n {question.kind === 'CHECKBOX' && <div className=\"w-4 h-4 rounded border border-gray-300\"></div>}\r\n {question.kind === 'DROPDOWN' && <span className=\"text-xs text-gray-400\">{i + 1}.</span>}\r\n <span>{opt.label}</span>\r\n </div>\r\n ))}\r\n {(!question.options || question.options.length === 0) && <span className=\"italic\">No options defined</span>}\r\n </div>\r\n )}\r\n {question.kind === 'FILE_UPLOAD' && (\r\n <div className=\"mt-2 w-full flex flex-col items-center justify-center p-6 border-2 border-dashed border-gray-300 rounded-lg bg-gray-50\">\r\n <div className=\"bg-gray-200 p-2 rounded-full mb-2\">\r\n <div className=\"bg-gray-300 p-3 rounded-full\">\r\n <FiUploadCloud className=\"text-gray-700 text-xl\" />\r\n </div>\r\n </div>\r\n <div className=\"text-primaryx-500 text-sm\">Click to upload <span className=\"text-gray-500 font-normal\">or drag and drop</span></div>\r\n <div className=\"text-xs text-gray-400 mt-1\">JPG or JPEG (max. 5MB)</div>\r\n </div>\r\n )}\r\n </div>\r\n\r\n {!isLocked && !isSystemQuestion && (\r\n <div className=\"absolute top-2 right-0 opacity-0 group-hover:opacity-100 transition-opacity flex gap-2 flex-shrink-0\">\r\n <button\r\n onClick={handleDelete}\r\n className=\"w-8 h-8 text-gray-400 hover:text-red-500 rounded-full hover:bg-red-50 transition-colors flex-shrink-0 flex justify-center items-center\"\r\n title=\"Delete\"\r\n >\r\n <FontAwesomeIcon icon={faTrash} />\r\n </button>\r\n </div>\r\n )}\r\n </div>\r\n )}\r\n </div>\r\n\r\n {/* Footer for expanded state */}\r\n {isOpen && !isLocked && (\r\n <div className=\"border-t border-gray-300 py-2 flex items-center justify-end bg-gray-50 rounded-b-lg gap-4\">\r\n <div className=\"flex items-center sm:flex-nowrap flex-wrap justify-end\">\r\n {!isSystemQuestion && (\r\n <>\r\n {!(disableDiscountOption && question.kind === 'DISCOUNT') && (\r\n <>\r\n <button\r\n onClick={handleDuplicate}\r\n disabled={!isValid}\r\n className={cn(\r\n \"p-2 transition-colors duration-200 rounded-full\",\r\n !isValid ? \"text-gray-300 cursor-not-allowed\" : \"text-gray-400 hover:text-primaryx-600 hover:bg-gray-100\"\r\n )}\r\n title={!isValid ? \"Fix errors to duplicate\" : \"Duplicate\"}\r\n >\r\n <Copy className=\"w-4 h-4\" />\r\n </button>\r\n <div className=\"h-6 w-px bg-gray-300 mx-2\"></div>\r\n </>\r\n )}\r\n </>\r\n )}\r\n\r\n <div className=\"flex items-center pb-1\">\r\n <RequiredToggle\r\n checked={question.required}\r\n onChange={(checked) => onUpdate(question.id, { required: checked })}\r\n id={`req-${question.id}`}\r\n disabled={isSystemQuestion}\r\n />\r\n </div>\r\n\r\n {(question.kind === 'PAYMENT' || question.kind === 'PAYMENT_CHECKBOX') && (\r\n <>\r\n <div className=\"hidden sm:block h-6 w-px bg-gray-300 mx-2\"></div>\r\n <div className=\"flex items-center pb-1\">\r\n <Tooltip\r\n placement=\"top\"\r\n content={question.Categories && question.Categories.length > 1 ? \"Enable this to allow users to select multiple options.\" : \"Add more than one category to enable multiple selections.\"}\r\n >\r\n <RequiredToggle\r\n label=\"Multiple Selections\"\r\n checked={question.kind === 'PAYMENT_CHECKBOX'}\r\n onChange={(checked) => onUpdate(question.id, { kind: checked ? 'PAYMENT_CHECKBOX' : 'PAYMENT' })}\r\n id={`multiple-${question.id}`}\r\n disabled={!question.Categories || question.Categories.length <= 1}\r\n />\r\n </Tooltip>\r\n </div>\r\n </>\r\n )}\r\n\r\n <div className=\"hidden sm:block h-6 w-px bg-gray-300 mx-2\"></div>\r\n\r\n <div className=\"w-full sm:w-fit flex items-center justify-end gap-2\">\r\n <Button\r\n type=\"button\"\r\n onClick={(e) => { e.stopPropagation(); onCancel?.(); }}\r\n variant=\"outline\"\r\n size=\"sm\"\r\n className=\"min-w-[80px]\"\r\n >\r\n Cancel\r\n </Button>\r\n <Button\r\n type=\"button\"\r\n onClick={(e) => { e.stopPropagation(); onSave?.(question.id); }}\r\n variant=\"default\"\r\n size=\"sm\"\r\n className=\"min-w-[80px]\"\r\n >\r\n {isNew ? \"Add\" : \"Save\"}\r\n </Button>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AAA,EAAI,WAAU,uDACX,UAAA;AAAA,cAAA;AAAA,gBAAC;AAAA,gBAAA;AAAA,kBACG,MAAK;AAAA,kBACL,SAAS,CAAC,MAAM;AAAE,sBAAE,gBAAA;AAAmB;AAAA,kBAAc;AAAA,kBACrD,SAAQ;AAAA,kBACR,MAAK;AAAA,kBACL,WAAU;AAAA,kBACb,UAAA;AAAA,gBAAA;AAAA,cAAA;AAAA,cAGD;AAAA,gBAAC;AAAA,gBAAA;AAAA,kBACG,MAAK;AAAA,kBACL,SAAS,CAAC,MAAM;AAAE,sBAAE,gBAAA;AAAmB,qDAAS,SAAS;AAAA,kBAAK;AAAA,kBAC9D,SAAQ;AAAA,kBACR,MAAK;AAAA,kBACL,WAAU;AAAA,kBAET,kBAAQ,QAAQ;AAAA,gBAAA;AAAA,cAAA;AAAA,YACrB,EAAA,CACJ;AAAA,UAAA,EAAA,CACJ,EAAA,CAEJ;AAAA,QAAA,EAAA,CAER;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGZ;AAEA,MAAA,iBAAe,KAAK,YAAY;"}
|
|
@@ -1,166 +0,0 @@
|
|
|
1
|
-
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
-
import { memo } from "react";
|
|
3
|
-
import { sanitizeQuestionData } from "./utils.js";
|
|
4
|
-
import { OptionList } from "./OptionList.js";
|
|
5
|
-
import { CategoryList } from "./CategoryList.js";
|
|
6
|
-
import CustomSelect from "../CustomSelect/CustomSelect.js";
|
|
7
|
-
import FormInput from "../FormInput/FormInput.js";
|
|
8
|
-
import DiscountInput from "./DiscountInput.js";
|
|
9
|
-
import InputErrorMessage from "../InputErrorMessage/InputErrorMessage.js";
|
|
10
|
-
const QUESTION_TYPES = [
|
|
11
|
-
{ label: "Text", value: "INPUT_STR", src: "/icons/questions-custom-select-box/pencil-01.svg" },
|
|
12
|
-
{ label: "Number", value: "INPUT_INT", src: "/icons/questions-custom-select-box/users-03.svg" },
|
|
13
|
-
{ label: "Email", value: "EMAIL", src: "/icons/questions-custom-select-box/mail-04.svg" },
|
|
14
|
-
{ label: "Phone", value: "PHONE", src: "/icons/questions-custom-select-box/phone-call-01.svg" },
|
|
15
|
-
{ label: "CNIC", value: "CNIC", src: "/icons/questions-custom-select-box/credit-card-01.svg" },
|
|
16
|
-
{ label: "Multiple Choice", value: "MULTIPLE_CHOICE", src: "/icons/questions-custom-select-box/grid-01.svg" },
|
|
17
|
-
{ label: "Dropdown", value: "DROPDOWN", src: "/icons/questions-custom-select-box/arrow-square-down.svg" },
|
|
18
|
-
{ label: "File Upload", value: "FILE_UPLOAD", src: "/icons/questions-custom-select-box/upload-01.svg" },
|
|
19
|
-
{ label: "Checkbox", value: "CHECKBOX", src: "/icons/questions-custom-select-box/check-square-broken.svg" },
|
|
20
|
-
{ label: "Date", value: "DATE", src: "/icons/questions-custom-select-box/calendar-date.svg" },
|
|
21
|
-
{ label: "Discount", value: "DISCOUNT", src: "/icons/questions-custom-select-box/sale-03.svg" },
|
|
22
|
-
{ label: "Payment", value: "PAYMENT", src: "/icons/questions-custom-select-box/coins-stacked-01.svg" }
|
|
23
|
-
];
|
|
24
|
-
const QuestionEditor = ({
|
|
25
|
-
question,
|
|
26
|
-
formId,
|
|
27
|
-
eventId,
|
|
28
|
-
userUid,
|
|
29
|
-
event,
|
|
30
|
-
storageService,
|
|
31
|
-
onUpdate,
|
|
32
|
-
errorMessage,
|
|
33
|
-
scope,
|
|
34
|
-
participationType,
|
|
35
|
-
isNew,
|
|
36
|
-
isSaving,
|
|
37
|
-
disableDiscountOption,
|
|
38
|
-
showValidationErrors
|
|
39
|
-
}) => {
|
|
40
|
-
const handleDiscountFileChange = (file) => {
|
|
41
|
-
onUpdate(question.id, { file });
|
|
42
|
-
};
|
|
43
|
-
const handleUpdate = (updates) => {
|
|
44
|
-
onUpdate(question.id, updates);
|
|
45
|
-
};
|
|
46
|
-
const handleLabelChange = (value) => {
|
|
47
|
-
handleUpdate({ label: value });
|
|
48
|
-
};
|
|
49
|
-
const PLACEHOLDER_TYPES = [
|
|
50
|
-
"INPUT_STR",
|
|
51
|
-
"INPUT_INT",
|
|
52
|
-
"EMAIL",
|
|
53
|
-
"PHONE",
|
|
54
|
-
"CNIC",
|
|
55
|
-
"DATE",
|
|
56
|
-
"TEAM_SIZE",
|
|
57
|
-
"NAME_ON_TICKET",
|
|
58
|
-
"INPUT_FLOAT"
|
|
59
|
-
];
|
|
60
|
-
const needsPlaceholder = PLACEHOLDER_TYPES.includes(question.kind);
|
|
61
|
-
const handleTypeChange = (value) => {
|
|
62
|
-
const newKind = value;
|
|
63
|
-
const sanitized = sanitizeQuestionData(question, newKind);
|
|
64
|
-
const choiceTypes = ["MULTIPLE_CHOICE", "DROPDOWN", "CHECKBOX"];
|
|
65
|
-
let newOptions = sanitized.options;
|
|
66
|
-
if (choiceTypes.includes(newKind)) {
|
|
67
|
-
if (!newOptions || newOptions.length === 0) {
|
|
68
|
-
newOptions = [{ id: crypto.randomUUID(), label: "" }];
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
let newCategories = sanitized.Categories;
|
|
72
|
-
if (newKind === "PAYMENT" || newKind === "PAYMENT_CHECKBOX") {
|
|
73
|
-
if (!newCategories || newCategories.length === 0) {
|
|
74
|
-
newCategories = [{ id: crypto.randomUUID(), name: "", price: 0 }];
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
handleUpdate({ ...sanitized, options: newOptions, Categories: newCategories });
|
|
78
|
-
};
|
|
79
|
-
const handlePlaceholderChange = (value) => {
|
|
80
|
-
handleUpdate({ placeholder: value });
|
|
81
|
-
};
|
|
82
|
-
const isSystemQuestion = ["TEAM_SIZE", "NAME_ON_TICKET"].includes(question.kind);
|
|
83
|
-
const isOptionError = errorMessage && (errorMessage.toLowerCase().includes("option") || errorMessage.toLowerCase().includes("category") || errorMessage.toLowerCase().includes("categories") || errorMessage.toLowerCase().includes("csv") || errorMessage.toLowerCase().includes("file") || errorMessage.toLowerCase().includes("applies on"));
|
|
84
|
-
const titleError = isOptionError ? void 0 : errorMessage;
|
|
85
|
-
const listError = isOptionError ? errorMessage : void 0;
|
|
86
|
-
return /* @__PURE__ */ jsxs("div", { className: "flex flex-col space-y-1.5 w-full", children: [
|
|
87
|
-
/* @__PURE__ */ jsxs("div", { className: "flex flex-col justify-center md:flex-row gap-x-4 gap-y-2", children: [
|
|
88
|
-
/* @__PURE__ */ jsx("div", { className: "flex-1 text-sm w-full", children: /* @__PURE__ */ jsx(
|
|
89
|
-
FormInput,
|
|
90
|
-
{
|
|
91
|
-
type: "text",
|
|
92
|
-
onChange: (e) => handleLabelChange(typeof e === "string" ? e : e.target.value),
|
|
93
|
-
value: question.label,
|
|
94
|
-
placeholder: "Question Title",
|
|
95
|
-
autoFocus: true,
|
|
96
|
-
error: titleError,
|
|
97
|
-
inputClassName: "h-10"
|
|
98
|
-
}
|
|
99
|
-
) }),
|
|
100
|
-
/* @__PURE__ */ jsx("div", { className: "w-full md:w-60", children: /* @__PURE__ */ jsx(
|
|
101
|
-
CustomSelect,
|
|
102
|
-
{
|
|
103
|
-
value: question.kind === "NAME_ON_TICKET" ? "INPUT_STR" : question.kind === "TEAM_SIZE" ? "INPUT_INT" : question.kind === "PAYMENT_CHECKBOX" ? "PAYMENT" : question.kind,
|
|
104
|
-
onChange: handleTypeChange,
|
|
105
|
-
options: QUESTION_TYPES.filter((q) => {
|
|
106
|
-
if (disableDiscountOption && q.value === "DISCOUNT" && question.kind !== "DISCOUNT") return false;
|
|
107
|
-
const isTeamEvent = participationType === "2" || participationType === "TEAM" || participationType === "3" || participationType === "BOTH";
|
|
108
|
-
const isTeamMemberSection = (scope === "TEAM" || !scope && isTeamEvent) && question.individual === true;
|
|
109
|
-
if (isTeamMemberSection && q.value === "DISCOUNT") return false;
|
|
110
|
-
return true;
|
|
111
|
-
}),
|
|
112
|
-
placeholder: "Select Type",
|
|
113
|
-
disabled: isSystemQuestion,
|
|
114
|
-
enableTooltip: false,
|
|
115
|
-
triggerClassName: "text-sm h-10"
|
|
116
|
-
}
|
|
117
|
-
) })
|
|
118
|
-
] }),
|
|
119
|
-
needsPlaceholder && /* @__PURE__ */ jsx("div", { className: "w-full text-sm", children: /* @__PURE__ */ jsx(
|
|
120
|
-
FormInput,
|
|
121
|
-
{
|
|
122
|
-
type: "text",
|
|
123
|
-
onChange: (e) => handlePlaceholderChange(typeof e === "string" ? e : e.target.value),
|
|
124
|
-
value: question.placeholder || "",
|
|
125
|
-
placeholder: "Question Placeholder",
|
|
126
|
-
inputClassName: "h-10"
|
|
127
|
-
}
|
|
128
|
-
) }),
|
|
129
|
-
(question.kind === "MULTIPLE_CHOICE" || question.kind === "CHECKBOX" || question.kind === "DROPDOWN") && /* @__PURE__ */ jsxs("div", { className: "mt-2", children: [
|
|
130
|
-
/* @__PURE__ */ jsx(OptionList, { question, onUpdate, showError: showValidationErrors || !!listError }),
|
|
131
|
-
listError && listError.toLowerCase().includes("option") && /* @__PURE__ */ jsx(InputErrorMessage, { error: listError || "", className: "mt-1" })
|
|
132
|
-
] }),
|
|
133
|
-
(question.kind === "PAYMENT" || question.kind === "PAYMENT_CHECKBOX") && /* @__PURE__ */ jsxs("div", { className: "mt-2", children: [
|
|
134
|
-
/* @__PURE__ */ jsx(
|
|
135
|
-
CategoryList,
|
|
136
|
-
{
|
|
137
|
-
categories: question.Categories || [],
|
|
138
|
-
onChange: (newCategories) => handleUpdate({ Categories: newCategories }),
|
|
139
|
-
showError: showValidationErrors || !!listError
|
|
140
|
-
}
|
|
141
|
-
),
|
|
142
|
-
listError && (listError.toLowerCase().includes("category") || listError.toLowerCase().includes("categories")) && /* @__PURE__ */ jsx(InputErrorMessage, { error: listError || "", className: "mt-1" })
|
|
143
|
-
] }),
|
|
144
|
-
question.kind === "DISCOUNT" && /* @__PURE__ */ jsx("div", { className: "mt-2", children: /* @__PURE__ */ jsx(
|
|
145
|
-
DiscountInput,
|
|
146
|
-
{
|
|
147
|
-
question,
|
|
148
|
-
eventId,
|
|
149
|
-
userUid,
|
|
150
|
-
event,
|
|
151
|
-
storageService,
|
|
152
|
-
onUpdate,
|
|
153
|
-
setDiscountFile: handleDiscountFileChange,
|
|
154
|
-
error: listError,
|
|
155
|
-
scope,
|
|
156
|
-
participationType,
|
|
157
|
-
isSaving
|
|
158
|
-
}
|
|
159
|
-
) })
|
|
160
|
-
] });
|
|
161
|
-
};
|
|
162
|
-
const QuestionEditor$1 = memo(QuestionEditor);
|
|
163
|
-
export {
|
|
164
|
-
QuestionEditor$1 as default
|
|
165
|
-
};
|
|
166
|
-
//# sourceMappingURL=QuestionEditor.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"QuestionEditor.js","sources":["../../../src/components/FormBuilder/QuestionEditor.tsx"],"sourcesContent":["import React, { memo } from 'react';\r\nimport { QuestionDraft, QuestionKind } from \"./types\";\r\nimport { sanitizeQuestionData } from './utils';\r\nimport { OptionList } from './OptionList';\r\nimport { CategoryList } from './CategoryList';\r\nimport CustomSelect from '../CustomSelect/CustomSelect';\r\nimport FormInput from '../FormInput/FormInput';\r\nimport DiscountInput from './DiscountInput';\r\nimport InputErrorMessage from '../InputErrorMessage/InputErrorMessage';\r\n\r\ninterface QuestionEditorProps {\r\n question: QuestionDraft;\r\n formId: string;\r\n eventId: string;\r\n userUid?: string;\r\n event?: any;\r\n storageService?: {\r\n downloadFile: (path: string) => Promise<Blob>;\r\n };\r\n onClose: () => void;\r\n onUpdate: (questionId: string, updates: Partial<QuestionDraft>) => void;\r\n errorMessage?: string;\r\n scope?: 'INDIVIDUAL' | 'TEAM';\r\n participationType?: string;\r\n isNew?: boolean;\r\n isSaving?: boolean;\r\n disableDiscountOption?: boolean;\r\n showValidationErrors?: boolean;\r\n}\r\n\r\nconst QUESTION_TYPES: { value: QuestionKind; label: string; src?: string }[] = [\r\n { label: \"Text\", value: \"INPUT_STR\", src: \"/icons/questions-custom-select-box/pencil-01.svg\" },\r\n { label: \"Number\", value: \"INPUT_INT\", src: \"/icons/questions-custom-select-box/users-03.svg\" },\r\n { label: \"Email\", value: \"EMAIL\", src: \"/icons/questions-custom-select-box/mail-04.svg\" },\r\n { label: \"Phone\", value: \"PHONE\", src: \"/icons/questions-custom-select-box/phone-call-01.svg\" },\r\n { label: \"CNIC\", value: \"CNIC\", src: \"/icons/questions-custom-select-box/credit-card-01.svg\" },\r\n { label: \"Multiple Choice\", value: \"MULTIPLE_CHOICE\", src: \"/icons/questions-custom-select-box/grid-01.svg\" },\r\n { label: \"Dropdown\", value: \"DROPDOWN\", src: \"/icons/questions-custom-select-box/arrow-square-down.svg\" },\r\n { label: \"File Upload\", value: \"FILE_UPLOAD\", src: \"/icons/questions-custom-select-box/upload-01.svg\" },\r\n { label: \"Checkbox\", value: \"CHECKBOX\", src: \"/icons/questions-custom-select-box/check-square-broken.svg\" },\r\n { label: \"Date\", value: \"DATE\", src: \"/icons/questions-custom-select-box/calendar-date.svg\" },\r\n { label: \"Discount\", value: \"DISCOUNT\", src: \"/icons/questions-custom-select-box/sale-03.svg\" },\r\n { label: \"Payment\", value: \"PAYMENT\", src: \"/icons/questions-custom-select-box/coins-stacked-01.svg\" }\r\n];\r\n\r\nconst QuestionEditor: React.FC<QuestionEditorProps> = ({ \r\n question, \r\n formId, \r\n eventId, \r\n userUid,\r\n event,\r\n storageService,\r\n onUpdate, \r\n errorMessage, \r\n scope, \r\n participationType, \r\n isNew, \r\n isSaving, \r\n disableDiscountOption, \r\n showValidationErrors \r\n}) => {\r\n\r\n const handleDiscountFileChange = (file: File | null) => {\r\n onUpdate(question.id, { file: file } as any);\r\n };\r\n\r\n const handleUpdate = (updates: Partial<QuestionDraft>) => {\r\n onUpdate(question.id, updates);\r\n };\r\n\r\n const handleLabelChange = (value: string) => {\r\n handleUpdate({ label: value });\r\n };\r\n\r\n const PLACEHOLDER_TYPES: QuestionKind[] = [\r\n 'INPUT_STR', 'INPUT_INT', 'EMAIL', 'PHONE', 'CNIC', 'DATE',\r\n 'TEAM_SIZE', 'NAME_ON_TICKET', 'INPUT_FLOAT'\r\n ];\r\n\r\n const needsPlaceholder = PLACEHOLDER_TYPES.includes(question.kind);\r\n\r\n const handleTypeChange = (value: string) => {\r\n const newKind = value as QuestionKind;\r\n const sanitized = sanitizeQuestionData(question, newKind);\r\n\r\n const choiceTypes: QuestionKind[] = ['MULTIPLE_CHOICE', 'DROPDOWN', 'CHECKBOX'];\r\n\r\n let newOptions = sanitized.options;\r\n if (choiceTypes.includes(newKind)) {\r\n if (!newOptions || newOptions.length === 0) {\r\n newOptions = [{ id: crypto.randomUUID(), label: '' }];\r\n }\r\n }\r\n\r\n let newCategories = sanitized.Categories;\r\n if (newKind === 'PAYMENT' || newKind === 'PAYMENT_CHECKBOX') {\r\n if (!newCategories || newCategories.length === 0) {\r\n newCategories = [{ id: crypto.randomUUID(), name: '', price: 0 }];\r\n }\r\n }\r\n\r\n handleUpdate({ ...sanitized, options: newOptions, Categories: newCategories });\r\n };\r\n\r\n const handlePlaceholderChange = (value: string) => {\r\n handleUpdate({ placeholder: value });\r\n };\r\n\r\n const isSystemQuestion = ['TEAM_SIZE', 'NAME_ON_TICKET'].includes(question.kind);\r\n\r\n const isOptionError = errorMessage && (\r\n errorMessage.toLowerCase().includes(\"option\") ||\r\n errorMessage.toLowerCase().includes(\"category\") ||\r\n errorMessage.toLowerCase().includes(\"categories\") ||\r\n errorMessage.toLowerCase().includes(\"csv\") ||\r\n errorMessage.toLowerCase().includes(\"file\") ||\r\n errorMessage.toLowerCase().includes(\"applies on\")\r\n );\r\n\r\n const titleError = isOptionError ? undefined : errorMessage;\r\n const listError = isOptionError ? errorMessage : undefined;\r\n\r\n return (\r\n <div className=\"flex flex-col space-y-1.5 w-full\">\r\n <div className=\"flex flex-col justify-center md:flex-row gap-x-4 gap-y-2\">\r\n <div className=\"flex-1 text-sm w-full\">\r\n <FormInput\r\n type='text'\r\n onChange={(e: any) => handleLabelChange(typeof e === 'string' ? e : e.target.value)}\r\n value={question.label}\r\n placeholder=\"Question Title\"\r\n autoFocus\r\n error={titleError}\r\n inputClassName=\"h-10\"\r\n />\r\n </div>\r\n\r\n <div className=\"w-full md:w-60\">\r\n <CustomSelect\r\n value={\r\n question.kind === 'NAME_ON_TICKET' ? 'INPUT_STR' :\r\n question.kind === \"TEAM_SIZE\" ? \"INPUT_INT\" :\r\n question.kind === \"PAYMENT_CHECKBOX\" ? \"PAYMENT\" :\r\n question.kind\r\n }\r\n onChange={handleTypeChange}\r\n options={QUESTION_TYPES.filter(q => {\r\n if (disableDiscountOption && q.value === \"DISCOUNT\" && question.kind !== \"DISCOUNT\") return false;\r\n\r\n const isTeamEvent = participationType === '2' || participationType === 'TEAM' || participationType === '3' || participationType === 'BOTH';\r\n const isTeamMemberSection = (scope === 'TEAM' || (!scope && isTeamEvent)) && question.individual === true;\r\n\r\n if (isTeamMemberSection && q.value === \"DISCOUNT\") return false;\r\n\r\n return true;\r\n })}\r\n placeholder=\"Select Type\"\r\n disabled={isSystemQuestion}\r\n enableTooltip={false}\r\n triggerClassName=\"text-sm h-10\"\r\n />\r\n </div>\r\n </div>\r\n\r\n {/* Placeholder Input */}\r\n {needsPlaceholder && (\r\n <div className=\"w-full text-sm\">\r\n <FormInput\r\n type='text'\r\n onChange={(e: any) => handlePlaceholderChange(typeof e === 'string' ? e : e.target.value)}\r\n value={question.placeholder || ''}\r\n placeholder=\"Question Placeholder\"\r\n inputClassName='h-10'\r\n />\r\n </div>\r\n )}\r\n\r\n {/* Options Area */}\r\n {(question.kind === 'MULTIPLE_CHOICE' || question.kind === 'CHECKBOX' || question.kind === 'DROPDOWN') && (\r\n <div className=\"mt-2\">\r\n <OptionList question={question} onUpdate={onUpdate} showError={showValidationErrors || !!listError} />\r\n {listError && listError.toLowerCase().includes(\"option\") && (\r\n <InputErrorMessage error={listError || \"\"} className=\"mt-1\" />\r\n )}\r\n </div>\r\n )}\r\n\r\n {/* Payment Categories Area */}\r\n {(question.kind === 'PAYMENT' || question.kind === 'PAYMENT_CHECKBOX') && (\r\n <div className=\"mt-2\">\r\n <CategoryList\r\n categories={question.Categories || []}\r\n onChange={(newCategories) => handleUpdate({ Categories: newCategories })}\r\n showError={showValidationErrors || !!listError}\r\n />\r\n {listError && (listError.toLowerCase().includes(\"category\") || listError.toLowerCase().includes(\"categories\")) && (\r\n <InputErrorMessage error={listError || \"\"} className=\"mt-1\" />\r\n )}\r\n </div>\r\n )}\r\n\r\n {/* Discount Area */}\r\n {question.kind === 'DISCOUNT' && (\r\n <div className=\"mt-2\">\r\n <DiscountInput\r\n question={question}\r\n eventId={eventId}\r\n userUid={userUid}\r\n event={event}\r\n storageService={storageService}\r\n onUpdate={onUpdate}\r\n setDiscountFile={handleDiscountFileChange}\r\n error={listError}\r\n scope={scope}\r\n participationType={participationType}\r\n isSaving={isSaving}\r\n />\r\n </div>\r\n )}\r\n\r\n </div>\r\n );\r\n};\r\n\r\nexport default memo(QuestionEditor)\r\n"],"names":[],"mappings":";;;;;;;;;AA8BA,MAAM,iBAAyE;AAAA,EAC3E,EAAE,OAAO,QAAQ,OAAO,aAAa,KAAK,mDAAA;AAAA,EAC1C,EAAE,OAAO,UAAU,OAAO,aAAa,KAAK,kDAAA;AAAA,EAC5C,EAAE,OAAO,SAAS,OAAO,SAAS,KAAK,iDAAA;AAAA,EACvC,EAAE,OAAO,SAAS,OAAO,SAAS,KAAK,uDAAA;AAAA,EACvC,EAAE,OAAO,QAAQ,OAAO,QAAQ,KAAK,wDAAA;AAAA,EACrC,EAAE,OAAO,mBAAmB,OAAO,mBAAmB,KAAK,iDAAA;AAAA,EAC3D,EAAE,OAAO,YAAY,OAAO,YAAY,KAAK,2DAAA;AAAA,EAC7C,EAAE,OAAO,eAAe,OAAO,eAAe,KAAK,mDAAA;AAAA,EACnD,EAAE,OAAO,YAAY,OAAO,YAAY,KAAK,6DAAA;AAAA,EAC7C,EAAE,OAAO,QAAQ,OAAO,QAAQ,KAAK,uDAAA;AAAA,EACrC,EAAE,OAAO,YAAY,OAAO,YAAY,KAAK,iDAAA;AAAA,EAC7C,EA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AAA,EAAkB,OAAO,aAAa,IAAI,WAAU,OAAA,CAAO;AAAA,IAAA,GAEpE;AAAA,IAIH,SAAS,SAAS,cACf,oBAAC,OAAA,EAAI,WAAU,QACX,UAAA;AAAA,MAAC;AAAA,MAAA;AAAA,QACG;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA,iBAAiB;AAAA,QACjB,OAAO;AAAA,QACP;AAAA,QACA;AAAA,QACA;AAAA,MAAA;AAAA,IAAA,EACJ,CACJ;AAAA,EAAA,GAGR;AAER;AAEA,MAAA,mBAAe,KAAK,cAAc;"}
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
-
import { memo } from "react";
|
|
3
|
-
import { cn } from "../../utils/cn.js";
|
|
4
|
-
const RequiredToggle = ({ label, checked, onChange, id, disabled }) => {
|
|
5
|
-
return /* @__PURE__ */ jsxs(
|
|
6
|
-
"label",
|
|
7
|
-
{
|
|
8
|
-
htmlFor: id,
|
|
9
|
-
className: cn(
|
|
10
|
-
"flex items-center gap-3 cursor-pointer select-none",
|
|
11
|
-
disabled && "cursor-not-allowed"
|
|
12
|
-
),
|
|
13
|
-
children: [
|
|
14
|
-
/* @__PURE__ */ jsx("span", { className: "text-sm text-gray-700 font-medium", children: label || "Required" }),
|
|
15
|
-
/* @__PURE__ */ jsxs("div", { className: cn("relative", disabled && "opacity-50 pointer-events-none"), children: [
|
|
16
|
-
/* @__PURE__ */ jsx(
|
|
17
|
-
"input",
|
|
18
|
-
{
|
|
19
|
-
type: "checkbox",
|
|
20
|
-
id,
|
|
21
|
-
className: "sr-only",
|
|
22
|
-
checked,
|
|
23
|
-
onChange: (e) => !disabled && onChange(e.target.checked)
|
|
24
|
-
}
|
|
25
|
-
),
|
|
26
|
-
/* @__PURE__ */ jsx("div", { className: cn(
|
|
27
|
-
"block w-10 h-6 rounded-full transition-colors duration-200 ease-in-out",
|
|
28
|
-
checked ? "bg-primaryx-600" : "bg-gray-300"
|
|
29
|
-
) }),
|
|
30
|
-
/* @__PURE__ */ jsx("div", { className: cn(
|
|
31
|
-
"absolute left-1 top-1 bg-white w-4 h-4 rounded-full transition-transform duration-200 ease-in-out shadow-sm",
|
|
32
|
-
checked ? "translate-x-4" : "translate-x-0"
|
|
33
|
-
) })
|
|
34
|
-
] })
|
|
35
|
-
]
|
|
36
|
-
}
|
|
37
|
-
);
|
|
38
|
-
};
|
|
39
|
-
const RequiredToggle$1 = memo(RequiredToggle);
|
|
40
|
-
export {
|
|
41
|
-
RequiredToggle$1 as default
|
|
42
|
-
};
|
|
43
|
-
//# sourceMappingURL=RequiredToggle.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"RequiredToggle.js","sources":["../../../src/components/FormBuilder/RequiredToggle.tsx"],"sourcesContent":["import React, { memo } from 'react';\r\nimport { cn } from '../../utils/cn';\r\n\r\ninterface RequiredToggleProps {\r\n checked: boolean;\r\n label?: string;\r\n onChange: (checked: boolean) => void;\r\n id?: string;\r\n disabled?: boolean;\r\n}\r\n\r\nconst RequiredToggle: React.FC<RequiredToggleProps> = ({ label, checked, onChange, id, disabled }) => {\r\n return (\r\n <label\r\n htmlFor={id}\r\n className={cn(\r\n \"flex items-center gap-3 cursor-pointer select-none\",\r\n disabled && \"cursor-not-allowed\"\r\n )}\r\n >\r\n <span className=\"text-sm text-gray-700 font-medium\">{label || \"Required\"}</span>\r\n <div className={cn(\"relative\", disabled && \"opacity-50 pointer-events-none\")}>\r\n <input\r\n type=\"checkbox\"\r\n id={id}\r\n className=\"sr-only\"\r\n checked={checked}\r\n onChange={(e) => !disabled && onChange(e.target.checked)}\r\n />\r\n <div className={cn(\r\n \"block w-10 h-6 rounded-full transition-colors duration-200 ease-in-out\",\r\n checked ? \"bg-primaryx-600\" : \"bg-gray-300\"\r\n )}></div>\r\n <div className={cn(\r\n \"absolute left-1 top-1 bg-white w-4 h-4 rounded-full transition-transform duration-200 ease-in-out shadow-sm\",\r\n checked ? \"translate-x-4\" : \"translate-x-0\"\r\n )}></div>\r\n </div>\r\n </label>\r\n );\r\n};\r\n\r\n\r\nexport default memo(RequiredToggle);\r\n"],"names":[],"mappings":";;;AAWA,MAAM,iBAAgD,CAAC,EAAE,OAAO,SAAS,UAAU,IAAI,eAAe;AAClG,SACI;AAAA,IAAC;AAAA,IAAA;AAAA,MACG,SAAS;AAAA,MACT,WAAW;AAAA,QACP;AAAA,QACA,YAAY;AAAA,MAAA;AAAA,MAGhB,UAAA;AAAA,QAAA,oBAAC,QAAA,EAAK,WAAU,qCAAqC,UAAA,SAAS,YAAW;AAAA,6BACxE,OAAA,EAAI,WAAW,GAAG,YAAY,YAAY,gCAAgC,GACvE,UAAA;AAAA,UAAA;AAAA,YAAC;AAAA,YAAA;AAAA,cACG,MAAK;AAAA,cACL;AAAA,cACA,WAAU;AAAA,cACV;AAAA,cACA,UAAU,CAAC,MAAM,CAAC,YAAY,SAAS,EAAE,OAAO,OAAO;AAAA,YAAA;AAAA,UAAA;AAAA,UAE3D,oBAAC,SAAI,WAAW;AAAA,YACZ;AAAA,YACA,UAAU,oBAAoB;AAAA,UAAA,GAC/B;AAAA,UACH,oBAAC,SAAI,WAAW;AAAA,YACZ;AAAA,YACA,UAAU,kBAAkB;AAAA,UAAA,EAChC,CAAG;AAAA,QAAA,EAAA,CACP;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGZ;AAGA,MAAA,mBAAe,KAAK,cAAc;"}
|