@solidstarters/solid-core-ui 1.1.69 → 1.1.71
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/dist/components/CustomFooter/CustomFooter.tsx +264 -0
- package/dist/components/CustomFooter/FooterForm.tsx +19 -0
- package/dist/components/CustomHeader/CallIcon.tsx +20 -0
- package/dist/components/CustomHeader/CustomDropdown.tsx +175 -0
- package/dist/components/CustomHeader/CustomHeader.tsx +64 -0
- package/dist/components/CustomHeader/EmailIcon.tsx +12 -0
- package/dist/components/CustomHeader/HeaderCart.tsx +15 -0
- package/dist/components/CustomHeader/productNavData.tsx +180 -0
- package/dist/components/FormView/DetailsViews.tsx +46 -0
- package/dist/components/FormView/OrderAddressDetails.tsx +70 -0
- package/dist/components/FormView/OrderPaymentDetails.tsx +18 -0
- package/dist/components/FormView/OrderTableDetails.tsx +36 -0
- package/dist/components/FormView/OrderedProductDetail.tsx +22 -0
- package/dist/components/Svg/ExcelSvg.tsx +15 -0
- package/dist/components/Svg/FileSvg.tsx +19 -0
- package/dist/components/Svg/PDFSvg.tsx +15 -0
- package/dist/components/Svg/RightArrowSvg.d.ts +2 -0
- package/dist/components/Svg/RightArrowSvg.d.ts.map +1 -0
- package/dist/components/Svg/RightArrowSvg.js +5 -0
- package/dist/components/Svg/RightArrowSvg.js.map +1 -0
- package/dist/components/Svg/RightArrowSvg.tsx +9 -0
- package/dist/components/Tag/CustomTag.tsx +50 -0
- package/dist/components/auth/AuthLayout.tsx +140 -0
- package/dist/components/auth/ForgotPasswordThankYou.tsx +48 -0
- package/dist/components/auth/GoogleAuthChecking.tsx +60 -0
- package/dist/components/auth/Login.tsx +155 -0
- package/dist/components/auth/Register.tsx +239 -0
- package/dist/components/auth/SolidChangeForcePassword.tsx +145 -0
- package/dist/components/auth/SolidForgotPassword.tsx +125 -0
- package/dist/components/auth/SolidInitialLoginOtp.tsx +152 -0
- package/dist/components/auth/SolidInitiateRegisterOtp.tsx +141 -0
- package/dist/components/auth/SolidLogin.tsx +275 -0
- package/dist/components/auth/SolidOTPVerify.tsx +132 -0
- package/dist/components/auth/SolidRegister.tsx +348 -0
- package/dist/components/auth/SolidResetPassword.tsx +162 -0
- package/dist/components/common/AuthBanner.tsx +41 -0
- package/dist/components/common/AutoCompleteField.tsx +76 -0
- package/dist/components/common/BackButton.tsx +27 -0
- package/dist/components/common/CancelButton.tsx +48 -0
- package/dist/components/common/CodeEditor.tsx +26 -0
- package/dist/components/common/CreateButton.tsx +17 -0
- package/dist/components/common/DropzonePlaceholder.tsx +31 -0
- package/dist/components/common/DropzoneUpload.tsx +11 -0
- package/dist/components/common/FileReaderExt.tsx +20 -0
- package/dist/components/common/GeneralSettings.tsx +406 -0
- package/dist/components/common/HeaderDynamicTitles.tsx +13 -0
- package/dist/components/common/MarkdownViewer.tsx +16 -0
- package/dist/components/common/MultipleSelectAutoCompleteField.tsx +62 -0
- package/dist/components/common/NotFound.tsx +22 -0
- package/dist/components/common/SingleSelectAutoCompleteField.tsx +67 -0
- package/dist/components/common/SocialMediaLogin.tsx +53 -0
- package/dist/components/common/SolidAdmin.tsx +7 -0
- package/dist/components/common/SolidBreadcrumb.tsx +103 -0
- package/dist/components/common/SolidFormHeader.tsx +22 -0
- package/dist/components/common/SolidFormStepper.tsx +213 -0
- package/dist/components/common/SolidModuleHome.tsx +61 -0
- package/dist/components/common/SolidThemeLink.tsx +5 -0
- package/dist/components/common/SolidThemeProvider.tsx +44 -0
- package/dist/components/common/error.tsx +30 -0
- package/dist/components/core/chatter/SolidChatter.d.ts +7 -0
- package/dist/components/core/chatter/SolidChatter.d.ts.map +1 -0
- package/dist/components/core/chatter/SolidChatter.js +269 -0
- package/dist/components/core/chatter/SolidChatter.js.map +1 -0
- package/dist/components/core/chatter/SolidChatter.tsx +252 -0
- package/dist/components/core/chatter/SolidChatterDateDivider.d.ts +6 -0
- package/dist/components/core/chatter/SolidChatterDateDivider.d.ts.map +1 -0
- package/dist/components/core/chatter/SolidChatterDateDivider.js +7 -0
- package/dist/components/core/chatter/SolidChatterDateDivider.js.map +1 -0
- package/dist/components/core/chatter/SolidChatterDateDivider.tsx +16 -0
- package/dist/components/core/chatter/SolidChatterHeader.d.ts +17 -0
- package/dist/components/core/chatter/SolidChatterHeader.d.ts.map +1 -0
- package/dist/components/core/chatter/SolidChatterHeader.js +67 -0
- package/dist/components/core/chatter/SolidChatterHeader.js.map +1 -0
- package/dist/components/core/chatter/SolidChatterHeader.tsx +178 -0
- package/dist/components/core/chatter/SolidChatterMessageBox.d.ts +19 -0
- package/dist/components/core/chatter/SolidChatterMessageBox.d.ts.map +1 -0
- package/dist/components/core/chatter/SolidChatterMessageBox.js +46 -0
- package/dist/components/core/chatter/SolidChatterMessageBox.js.map +1 -0
- package/dist/components/core/chatter/SolidChatterMessageBox.tsx +165 -0
- package/dist/components/core/chatter/SolidMessageComposer.d.ts +7 -0
- package/dist/components/core/chatter/SolidMessageComposer.d.ts.map +1 -0
- package/dist/components/core/chatter/SolidMessageComposer.js +119 -0
- package/dist/components/core/chatter/SolidMessageComposer.js.map +1 -0
- package/dist/components/core/chatter/SolidMessageComposer.tsx +145 -0
- package/dist/components/core/chatter/chatter.module.css +70 -0
- package/dist/components/core/common/FilterComponent.tsx +434 -0
- package/dist/components/core/common/LoadDynamicJsxComponent.tsx +70 -0
- package/dist/components/core/common/SolidCreateButton.tsx +20 -0
- package/dist/components/core/common/SolidGlobalSearchElement.tsx +843 -0
- package/dist/components/core/common/SolidLayoutViews.tsx +87 -0
- package/dist/components/core/common/SolidListViewOptions.tsx +31 -0
- package/dist/components/core/common/SolidSaveCustomFilterForm.tsx +74 -0
- package/dist/components/core/common/SolidSearchBox.tsx +17 -0
- package/dist/components/core/common/SolidViewLayoutManager.d.ts +1 -1
- package/dist/components/core/common/SolidViewLayoutManager.ts +85 -0
- package/dist/components/core/extension/solid-core/emailTemplate/emailFormTypeChangeHandler.ts +18 -0
- package/dist/components/core/extension/solid-core/emailTemplate/emailFormTypeLoad.ts +18 -0
- package/dist/components/core/extension/solid-core/modelMetadata/list/GenerateModelCodeRowAction.tsx +59 -0
- package/dist/components/core/extension/solid-core/moduleMetadata/list/GenerateModuleCodeRowAction.tsx +38 -0
- package/dist/components/core/extension/solid-core/roleMetadata/RolePermissionsManyToManyFieldWidget.d.ts +2 -2
- package/dist/components/core/extension/solid-core/roleMetadata/RolePermissionsManyToManyFieldWidget.d.ts.map +1 -1
- package/dist/components/core/extension/solid-core/roleMetadata/RolePermissionsManyToManyFieldWidget.js.map +1 -1
- package/dist/components/core/extension/solid-core/roleMetadata/RolePermissionsManyToManyFieldWidget.tsx +123 -0
- package/dist/components/core/field/FieldListViewData.tsx +312 -0
- package/dist/components/core/filter/SolidFilterFields.tsx +128 -0
- package/dist/components/core/filter/SolidManyToOneFilterElement.tsx +60 -0
- package/dist/components/core/filter/SolidSelectionDynamicFilterElement.tsx +50 -0
- package/dist/components/core/filter/SolidSelectionStaticFilterElement.tsx +32 -0
- package/dist/components/core/filter/SolidVarInputsFilterElement.tsx +180 -0
- package/dist/components/core/filter/fields/SolidBigintField.tsx +9 -0
- package/dist/components/core/filter/fields/SolidBooleanField.tsx +50 -0
- package/dist/components/core/filter/fields/SolidComputedField.tsx +23 -0
- package/dist/components/core/filter/fields/SolidDateField.tsx +58 -0
- package/dist/components/core/filter/fields/SolidDatetimeField.tsx +51 -0
- package/dist/components/core/filter/fields/SolidDecimalField.tsx +9 -0
- package/dist/components/core/filter/fields/SolidExternalIdField.tsx +46 -0
- package/dist/components/core/filter/fields/SolidFloatField.tsx +9 -0
- package/dist/components/core/filter/fields/SolidIdField.tsx +46 -0
- package/dist/components/core/filter/fields/SolidIntField.tsx +56 -0
- package/dist/components/core/filter/fields/SolidLongTextField.tsx +9 -0
- package/dist/components/core/filter/fields/SolidMediaMultipleField.tsx +54 -0
- package/dist/components/core/filter/fields/SolidMediaSingleField.tsx +56 -0
- package/dist/components/core/filter/fields/SolidRelationField.tsx +13 -0
- package/dist/components/core/filter/fields/SolidRichTextField.tsx +9 -0
- package/dist/components/core/filter/fields/SolidSelectionDynamicField.tsx +46 -0
- package/dist/components/core/filter/fields/SolidSelectionStaticField.tsx +48 -0
- package/dist/components/core/filter/fields/SolidShortTextField.tsx +54 -0
- package/dist/components/core/filter/fields/SolidTimeField.tsx +45 -0
- package/dist/components/core/filter/fields/SolidUuidField.tsx +45 -0
- package/dist/components/core/filter/fields/relations/SolidRelationManyToOneField.tsx +80 -0
- package/dist/components/core/form/SolidFormLayouts.tsx +104 -0
- package/dist/components/core/form/SolidFormUserViewLayout.tsx +85 -0
- package/dist/components/core/form/SolidFormView.d.ts.map +1 -1
- package/dist/components/core/form/SolidFormView.js +53 -46
- package/dist/components/core/form/SolidFormView.js.map +1 -1
- package/dist/components/core/form/SolidFormView.tsx +1352 -0
- package/dist/components/core/form/fields/ISolidField.tsx +69 -0
- package/dist/components/core/form/fields/SolidBooleanField.d.ts +4 -1
- package/dist/components/core/form/fields/SolidBooleanField.d.ts.map +1 -1
- package/dist/components/core/form/fields/SolidBooleanField.js +80 -29
- package/dist/components/core/form/fields/SolidBooleanField.js.map +1 -1
- package/dist/components/core/form/fields/SolidBooleanField.tsx +269 -0
- package/dist/components/core/form/fields/SolidDateField.d.ts +3 -0
- package/dist/components/core/form/fields/SolidDateField.d.ts.map +1 -1
- package/dist/components/core/form/fields/SolidDateField.js +45 -25
- package/dist/components/core/form/fields/SolidDateField.js.map +1 -1
- package/dist/components/core/form/fields/SolidDateField.tsx +153 -0
- package/dist/components/core/form/fields/SolidDateTimeField.d.ts +3 -0
- package/dist/components/core/form/fields/SolidDateTimeField.d.ts.map +1 -1
- package/dist/components/core/form/fields/SolidDateTimeField.js +44 -25
- package/dist/components/core/form/fields/SolidDateTimeField.js.map +1 -1
- package/dist/components/core/form/fields/SolidDateTimeField.tsx +154 -0
- package/dist/components/core/form/fields/SolidDecimalField.d.ts +3 -0
- package/dist/components/core/form/fields/SolidDecimalField.d.ts.map +1 -1
- package/dist/components/core/form/fields/SolidDecimalField.js +41 -21
- package/dist/components/core/form/fields/SolidDecimalField.js.map +1 -1
- package/dist/components/core/form/fields/SolidDecimalField.tsx +155 -0
- package/dist/components/core/form/fields/SolidEmailField.d.ts +3 -0
- package/dist/components/core/form/fields/SolidEmailField.d.ts.map +1 -1
- package/dist/components/core/form/fields/SolidEmailField.js +41 -21
- package/dist/components/core/form/fields/SolidEmailField.js.map +1 -1
- package/dist/components/core/form/fields/SolidEmailField.tsx +168 -0
- package/dist/components/core/form/fields/SolidIntegerField.d.ts +3 -0
- package/dist/components/core/form/fields/SolidIntegerField.d.ts.map +1 -1
- package/dist/components/core/form/fields/SolidIntegerField.js +41 -21
- package/dist/components/core/form/fields/SolidIntegerField.js.map +1 -1
- package/dist/components/core/form/fields/SolidIntegerField.tsx +158 -0
- package/dist/components/core/form/fields/SolidJsonField.d.ts +4 -0
- package/dist/components/core/form/fields/SolidJsonField.d.ts.map +1 -1
- package/dist/components/core/form/fields/SolidJsonField.js +51 -15
- package/dist/components/core/form/fields/SolidJsonField.js.map +1 -1
- package/dist/components/core/form/fields/SolidJsonField.tsx +173 -0
- package/dist/components/core/form/fields/SolidLongTextField.d.ts +3 -2
- package/dist/components/core/form/fields/SolidLongTextField.d.ts.map +1 -1
- package/dist/components/core/form/fields/SolidLongTextField.js +33 -52
- package/dist/components/core/form/fields/SolidLongTextField.js.map +1 -1
- package/dist/components/core/form/fields/SolidLongTextField.tsx +161 -0
- package/dist/components/core/form/fields/SolidMediaMultipleField.d.ts +4 -0
- package/dist/components/core/form/fields/SolidMediaMultipleField.d.ts.map +1 -1
- package/dist/components/core/form/fields/SolidMediaMultipleField.js +262 -153
- package/dist/components/core/form/fields/SolidMediaMultipleField.js.map +1 -1
- package/dist/components/core/form/fields/SolidMediaMultipleField.tsx +639 -0
- package/dist/components/core/form/fields/SolidMediaSingleField.d.ts +4 -0
- package/dist/components/core/form/fields/SolidMediaSingleField.d.ts.map +1 -1
- package/dist/components/core/form/fields/SolidMediaSingleField.js +243 -149
- package/dist/components/core/form/fields/SolidMediaSingleField.js.map +1 -1
- package/dist/components/core/form/fields/SolidMediaSingleField.tsx +522 -0
- package/dist/components/core/form/fields/SolidPasswordField.d.ts +4 -0
- package/dist/components/core/form/fields/SolidPasswordField.d.ts.map +1 -1
- package/dist/components/core/form/fields/SolidPasswordField.js +50 -20
- package/dist/components/core/form/fields/SolidPasswordField.js.map +1 -1
- package/dist/components/core/form/fields/SolidPasswordField.tsx +187 -0
- package/dist/components/core/form/fields/SolidRelationField.tsx +54 -0
- package/dist/components/core/form/fields/SolidRichTextField.d.ts +4 -0
- package/dist/components/core/form/fields/SolidRichTextField.d.ts.map +1 -1
- package/dist/components/core/form/fields/SolidRichTextField.js +49 -20
- package/dist/components/core/form/fields/SolidRichTextField.js.map +1 -1
- package/dist/components/core/form/fields/SolidRichTextField.tsx +177 -0
- package/dist/components/core/form/fields/SolidSelectionDynamicField.d.ts +4 -0
- package/dist/components/core/form/fields/SolidSelectionDynamicField.d.ts.map +1 -1
- package/dist/components/core/form/fields/SolidSelectionDynamicField.js +88 -60
- package/dist/components/core/form/fields/SolidSelectionDynamicField.js.map +1 -1
- package/dist/components/core/form/fields/SolidSelectionDynamicField.tsx +204 -0
- package/dist/components/core/form/fields/SolidSelectionStaticField.d.ts +5 -1
- package/dist/components/core/form/fields/SolidSelectionStaticField.d.ts.map +1 -1
- package/dist/components/core/form/fields/SolidSelectionStaticField.js +88 -27
- package/dist/components/core/form/fields/SolidSelectionStaticField.js.map +1 -1
- package/dist/components/core/form/fields/SolidSelectionStaticField.tsx +272 -0
- package/dist/components/core/form/fields/SolidShortTextField.d.ts +4 -0
- package/dist/components/core/form/fields/SolidShortTextField.d.ts.map +1 -1
- package/dist/components/core/form/fields/SolidShortTextField.js +57 -26
- package/dist/components/core/form/fields/SolidShortTextField.js.map +1 -1
- package/dist/components/core/form/fields/SolidShortTextField.tsx +208 -0
- package/dist/components/core/form/fields/SolidTimeField.d.ts +3 -0
- package/dist/components/core/form/fields/SolidTimeField.d.ts.map +1 -1
- package/dist/components/core/form/fields/SolidTimeField.js +44 -22
- package/dist/components/core/form/fields/SolidTimeField.js.map +1 -1
- package/dist/components/core/form/fields/SolidTimeField.tsx +147 -0
- package/dist/components/core/form/fields/relations/SolidRelationManyToManyField.d.ts +4 -1
- package/dist/components/core/form/fields/relations/SolidRelationManyToManyField.d.ts.map +1 -1
- package/dist/components/core/form/fields/relations/SolidRelationManyToManyField.js +77 -19
- package/dist/components/core/form/fields/relations/SolidRelationManyToManyField.js.map +1 -1
- package/dist/components/core/form/fields/relations/SolidRelationManyToManyField.tsx +309 -0
- package/dist/components/core/form/fields/relations/SolidRelationManyToOneField.d.ts +5 -1
- package/dist/components/core/form/fields/relations/SolidRelationManyToOneField.d.ts.map +1 -1
- package/dist/components/core/form/fields/relations/SolidRelationManyToOneField.js +136 -107
- package/dist/components/core/form/fields/relations/SolidRelationManyToOneField.js.map +1 -1
- package/dist/components/core/form/fields/relations/SolidRelationManyToOneField.tsx +291 -0
- package/dist/components/core/form/fields/relations/SolidRelationOneToManyField.d.ts +5 -1
- package/dist/components/core/form/fields/relations/SolidRelationOneToManyField.d.ts.map +1 -1
- package/dist/components/core/form/fields/relations/SolidRelationOneToManyField.js +159 -107
- package/dist/components/core/form/fields/relations/SolidRelationOneToManyField.js.map +1 -1
- package/dist/components/core/form/fields/relations/SolidRelationOneToManyField.tsx +311 -0
- package/dist/components/core/form/fields/relations/widgets/SolidRelationManyToManyAutocompleteWidget.d.ts +1 -1
- package/dist/components/core/form/fields/relations/widgets/SolidRelationManyToManyCheckboxWidget.d.ts +1 -1
- package/dist/components/core/form/fields/relations/widgets/helpers/InlineRelationEntityDialog.tsx +33 -0
- package/dist/components/core/form/fields/relations/widgets/helpers/useRelationEntityHandler.ts +64 -0
- package/dist/components/core/form/fields/widgets/SolidBooleanCheckboxFieldWidget.d.ts +1 -1
- package/dist/components/core/form/fields/widgets/SolidBooleanSelectFieldWidget.d.ts +1 -1
- package/dist/components/core/form/fields/widgets/SolidFormFieldViewMediaMultipleWidget.d.ts +1 -1
- package/dist/components/core/form/fields/widgets/SolidFormFieldViewMediaSingleWidget.d.ts +1 -1
- package/dist/components/core/form/fields/widgets/SolidRelationFieldAvatarFormWidget.d.ts +3 -0
- package/dist/components/core/form/fields/widgets/SolidRelationFieldAvatarFormWidget.d.ts.map +1 -0
- package/dist/components/core/form/fields/widgets/SolidRelationFieldAvatarFormWidget.js +29 -0
- package/dist/components/core/form/fields/widgets/SolidRelationFieldAvatarFormWidget.js.map +1 -0
- package/dist/components/core/form/fields/widgets/SolidRelationFieldAvatarFormWidget.tsx +46 -0
- package/dist/components/core/form/fields/widgets/SolidSelectionStaticAutocompleteFieldWidget.d.ts +1 -1
- package/dist/components/core/form/fields/widgets/SolidSelectionStaticRadioFieldWidget.d.ts +1 -1
- package/dist/components/core/form/widgets/CustomHtml.d.ts +1 -1
- package/dist/components/core/form/widgets/CustomHtml.tsx +19 -0
- package/dist/components/core/kanban/KanbanBoard.tsx +131 -0
- package/dist/components/core/kanban/KanbanCard.tsx +255 -0
- package/dist/components/core/kanban/KanbanColumn.tsx +139 -0
- package/dist/components/core/kanban/KanbanUserViewLayout.tsx +85 -0
- package/dist/components/core/kanban/SolidKanbanView.tsx +803 -0
- package/dist/components/core/kanban/SolidKanbanViewConfigure.tsx +146 -0
- package/dist/components/core/kanban/SolidKanbanViewFields.tsx +164 -0
- package/dist/components/core/kanban/SolidManyToOneFilterElement.tsx +59 -0
- package/dist/components/core/kanban/SolidSelectionDynamicFilterElement.tsx +50 -0
- package/dist/components/core/kanban/SolidSelectionStaticFilterElement.tsx +32 -0
- package/dist/components/core/kanban/SolidVarInputsFilterElement.tsx +184 -0
- package/dist/components/core/kanban/kanban-fields/SolidBigintKanbanField.tsx +9 -0
- package/dist/components/core/kanban/kanban-fields/SolidBooleanKanbanField.tsx +13 -0
- package/dist/components/core/kanban/kanban-fields/SolidComputedKanbanField.tsx +23 -0
- package/dist/components/core/kanban/kanban-fields/SolidDateKanbanField.tsx +14 -0
- package/dist/components/core/kanban/kanban-fields/SolidDatetimeKanbanField.tsx +13 -0
- package/dist/components/core/kanban/kanban-fields/SolidDecimalKanbanField.tsx +9 -0
- package/dist/components/core/kanban/kanban-fields/SolidExternalIdKanbanField.tsx +12 -0
- package/dist/components/core/kanban/kanban-fields/SolidFloatKanbanField.tsx +9 -0
- package/dist/components/core/kanban/kanban-fields/SolidIdKanbanField.tsx +14 -0
- package/dist/components/core/kanban/kanban-fields/SolidIntKanbanField.tsx +20 -0
- package/dist/components/core/kanban/kanban-fields/SolidLongTextKanbanField.tsx +9 -0
- package/dist/components/core/kanban/kanban-fields/SolidMediaMultipleKanbanField.tsx +136 -0
- package/dist/components/core/kanban/kanban-fields/SolidMediaSingleKanbanField.tsx +158 -0
- package/dist/components/core/kanban/kanban-fields/SolidRelationKanbanField.tsx +13 -0
- package/dist/components/core/kanban/kanban-fields/SolidRichTextKanbanField.tsx +9 -0
- package/dist/components/core/kanban/kanban-fields/SolidSelectionDynamicKanbanField.tsx +13 -0
- package/dist/components/core/kanban/kanban-fields/SolidSelectionStaticKanbanField.tsx +14 -0
- package/dist/components/core/kanban/kanban-fields/SolidShortTextKanbanField.js +6 -6
- package/dist/components/core/kanban/kanban-fields/SolidShortTextKanbanField.js.map +1 -1
- package/dist/components/core/kanban/kanban-fields/SolidShortTextKanbanField.tsx +121 -0
- package/dist/components/core/kanban/kanban-fields/SolidTimeKanbanField.tsx +12 -0
- package/dist/components/core/kanban/kanban-fields/SolidUuidKanbanField.tsx +13 -0
- package/dist/components/core/kanban/kanban-fields/relations/SolidRelationManyToOneKanbanField.tsx +16 -0
- package/dist/components/core/list/ListViewRowActionPopup.tsx +42 -0
- package/dist/components/core/list/SolidListColumnSelector.tsx +167 -0
- package/dist/components/core/list/SolidListView.js +6 -6
- package/dist/components/core/list/SolidListView.js.map +1 -1
- package/dist/components/core/list/SolidListView.tsx +961 -0
- package/dist/components/core/list/SolidListViewColumn.tsx +162 -0
- package/dist/components/core/list/SolidListViewConfigure.tsx +198 -0
- package/dist/components/core/list/SolidListingHeader.tsx +42 -0
- package/dist/components/core/list/SolidManyToOneFilterElement.tsx +59 -0
- package/dist/components/core/list/SolidSelectionDynamicFilterElement.tsx +50 -0
- package/dist/components/core/list/SolidSelectionStaticFilterElement.tsx +32 -0
- package/dist/components/core/list/SolidTableRowCell.tsx +12 -0
- package/dist/components/core/list/SolidVarInputsFilterElement.tsx +184 -0
- package/dist/components/core/list/columns/SolidBigintColumn.tsx +9 -0
- package/dist/components/core/list/columns/SolidBooleanColumn.d.ts +2 -0
- package/dist/components/core/list/columns/SolidBooleanColumn.d.ts.map +1 -1
- package/dist/components/core/list/columns/SolidBooleanColumn.js +33 -2
- package/dist/components/core/list/columns/SolidBooleanColumn.js.map +1 -1
- package/dist/components/core/list/columns/SolidBooleanColumn.tsx +89 -0
- package/dist/components/core/list/columns/SolidComputedColumn.tsx +23 -0
- package/dist/components/core/list/columns/SolidDateColumn.d.ts.map +1 -1
- package/dist/components/core/list/columns/SolidDateColumn.js +27 -3
- package/dist/components/core/list/columns/SolidDateColumn.js.map +1 -1
- package/dist/components/core/list/columns/SolidDateColumn.tsx +90 -0
- package/dist/components/core/list/columns/SolidDatetimeColumn.d.ts.map +1 -1
- package/dist/components/core/list/columns/SolidDatetimeColumn.js +27 -3
- package/dist/components/core/list/columns/SolidDatetimeColumn.js.map +1 -1
- package/dist/components/core/list/columns/SolidDatetimeColumn.tsx +79 -0
- package/dist/components/core/list/columns/SolidDecimalColumn.tsx +9 -0
- package/dist/components/core/list/columns/SolidExternalIdColumn.d.ts.map +1 -1
- package/dist/components/core/list/columns/SolidExternalIdColumn.js +27 -3
- package/dist/components/core/list/columns/SolidExternalIdColumn.js.map +1 -1
- package/dist/components/core/list/columns/SolidExternalIdColumn.tsx +80 -0
- package/dist/components/core/list/columns/SolidFloatColumn.tsx +9 -0
- package/dist/components/core/list/columns/SolidIdColumn.d.ts.map +1 -1
- package/dist/components/core/list/columns/SolidIdColumn.js +27 -3
- package/dist/components/core/list/columns/SolidIdColumn.js.map +1 -1
- package/dist/components/core/list/columns/SolidIdColumn.tsx +79 -0
- package/dist/components/core/list/columns/SolidIntColumn.d.ts.map +1 -1
- package/dist/components/core/list/columns/SolidIntColumn.js +27 -3
- package/dist/components/core/list/columns/SolidIntColumn.js.map +1 -1
- package/dist/components/core/list/columns/SolidIntColumn.tsx +87 -0
- package/dist/components/core/list/columns/SolidLongTextColumn.tsx +9 -0
- package/dist/components/core/list/columns/SolidMediaMultipleColumn.d.ts +2 -0
- package/dist/components/core/list/columns/SolidMediaMultipleColumn.d.ts.map +1 -1
- package/dist/components/core/list/columns/SolidMediaMultipleColumn.js +48 -22
- package/dist/components/core/list/columns/SolidMediaMultipleColumn.js.map +1 -1
- package/dist/components/core/list/columns/SolidMediaMultipleColumn.tsx +100 -0
- package/dist/components/core/list/columns/SolidMediaSingleColumn.d.ts +2 -0
- package/dist/components/core/list/columns/SolidMediaSingleColumn.d.ts.map +1 -1
- package/dist/components/core/list/columns/SolidMediaSingleColumn.js +41 -13
- package/dist/components/core/list/columns/SolidMediaSingleColumn.js.map +1 -1
- package/dist/components/core/list/columns/SolidMediaSingleColumn.tsx +98 -0
- package/dist/components/core/list/columns/SolidRelationColumn.d.ts.map +1 -1
- package/dist/components/core/list/columns/SolidRelationColumn.js +7 -0
- package/dist/components/core/list/columns/SolidRelationColumn.js.map +1 -1
- package/dist/components/core/list/columns/SolidRelationColumn.tsx +20 -0
- package/dist/components/core/list/columns/SolidRichTextColumn.tsx +9 -0
- package/dist/components/core/list/columns/SolidSelectionDynamicColumn.d.ts.map +1 -1
- package/dist/components/core/list/columns/SolidSelectionDynamicColumn.js +27 -3
- package/dist/components/core/list/columns/SolidSelectionDynamicColumn.js.map +1 -1
- package/dist/components/core/list/columns/SolidSelectionDynamicColumn.tsx +80 -0
- package/dist/components/core/list/columns/SolidSelectionStaticColumn.d.ts.map +1 -1
- package/dist/components/core/list/columns/SolidSelectionStaticColumn.js +27 -3
- package/dist/components/core/list/columns/SolidSelectionStaticColumn.js.map +1 -1
- package/dist/components/core/list/columns/SolidSelectionStaticColumn.tsx +81 -0
- package/dist/components/core/list/columns/SolidShortTextColumn.d.ts +2 -0
- package/dist/components/core/list/columns/SolidShortTextColumn.d.ts.map +1 -1
- package/dist/components/core/list/columns/SolidShortTextColumn.js +16 -37
- package/dist/components/core/list/columns/SolidShortTextColumn.js.map +1 -1
- package/dist/components/core/list/columns/SolidShortTextColumn.tsx +103 -0
- package/dist/components/core/list/columns/SolidTimeColumn.d.ts.map +1 -1
- package/dist/components/core/list/columns/SolidTimeColumn.js +27 -3
- package/dist/components/core/list/columns/SolidTimeColumn.js.map +1 -1
- package/dist/components/core/list/columns/SolidTimeColumn.tsx +78 -0
- package/dist/components/core/list/columns/SolidUuidColumn.d.ts.map +1 -1
- package/dist/components/core/list/columns/SolidUuidColumn.js +27 -3
- package/dist/components/core/list/columns/SolidUuidColumn.js.map +1 -1
- package/dist/components/core/list/columns/SolidUuidColumn.tsx +79 -0
- package/dist/components/core/list/columns/relations/SolidRelationManyToManyColumn.d.ts +6 -0
- package/dist/components/core/list/columns/relations/SolidRelationManyToManyColumn.d.ts.map +1 -0
- package/dist/components/core/list/columns/relations/SolidRelationManyToManyColumn.js +70 -0
- package/dist/components/core/list/columns/relations/SolidRelationManyToManyColumn.js.map +1 -0
- package/dist/components/core/list/columns/relations/SolidRelationManyToManyColumn.tsx +110 -0
- package/dist/components/core/list/columns/relations/SolidRelationManyToOneColumn.d.ts +2 -0
- package/dist/components/core/list/columns/relations/SolidRelationManyToOneColumn.d.ts.map +1 -1
- package/dist/components/core/list/columns/relations/SolidRelationManyToOneColumn.js +42 -17
- package/dist/components/core/list/columns/relations/SolidRelationManyToOneColumn.js.map +1 -1
- package/dist/components/core/list/columns/relations/SolidRelationManyToOneColumn.tsx +95 -0
- package/dist/components/core/list/columns/relations/SolidRelationOneToManyColumn.d.ts +6 -0
- package/dist/components/core/list/columns/relations/SolidRelationOneToManyColumn.d.ts.map +1 -0
- package/dist/components/core/list/columns/relations/SolidRelationOneToManyColumn.js +70 -0
- package/dist/components/core/list/columns/relations/SolidRelationOneToManyColumn.js.map +1 -0
- package/dist/components/core/list/columns/relations/SolidRelationOneToManyColumn.tsx +111 -0
- package/dist/components/core/list/widgets/SolidRelationAvatarWidget.d.ts +4 -0
- package/dist/components/core/list/widgets/SolidRelationAvatarWidget.d.ts.map +1 -0
- package/dist/components/core/list/widgets/SolidRelationAvatarWidget.js +60 -0
- package/dist/components/core/list/widgets/SolidRelationAvatarWidget.js.map +1 -0
- package/dist/components/core/list/widgets/SolidRelationAvatarWidget.tsx +89 -0
- package/dist/components/core/list/widgets/SolidShortTextAvatarWidget.d.ts +3 -0
- package/dist/components/core/list/widgets/SolidShortTextAvatarWidget.d.ts.map +1 -0
- package/dist/components/core/list/widgets/SolidShortTextAvatarWidget.js +42 -0
- package/dist/components/core/list/widgets/SolidShortTextAvatarWidget.js.map +1 -0
- package/{src/components/core/list/widgets/SolidUserNameAvatarWidget.tsx → dist/components/core/list/widgets/SolidShortTextAvatarWidget.tsx} +18 -11
- package/dist/components/core/list/widgets/SolidShortTextFieldImageRenderModeWidget.d.ts +2 -1
- package/dist/components/core/list/widgets/SolidShortTextFieldImageRenderModeWidget.d.ts.map +1 -1
- package/dist/components/core/list/widgets/SolidShortTextFieldImageRenderModeWidget.js +4 -4
- package/dist/components/core/list/widgets/SolidShortTextFieldImageRenderModeWidget.js.map +1 -1
- package/dist/components/core/list/widgets/SolidShortTextFieldImageRenderModeWidget.tsx +21 -0
- package/dist/components/core/model/CreateModel.tsx +476 -0
- package/dist/components/core/model/FieldMetaData.tsx +193 -0
- package/dist/components/core/model/FieldMetaDataForm.js +1 -1
- package/dist/components/core/model/FieldMetaDataForm.js.map +1 -1
- package/dist/components/core/model/FieldMetaDataForm.tsx +3048 -0
- package/dist/components/core/model/FieldSelector.tsx +62 -0
- package/dist/components/core/model/ModelListViewData.tsx +383 -0
- package/dist/components/core/model/ModelMetaData.tsx +840 -0
- package/dist/components/core/module/CreateModule.tsx +620 -0
- package/dist/components/core/module/ModuleListViewData.tsx +429 -0
- package/dist/components/core/users/CreateUser.tsx +434 -0
- package/dist/components/core/users/CreateUserRole.tsx +211 -0
- package/dist/components/core/users/UserListView.tsx +374 -0
- package/dist/components/layout/AdminLayout.tsx +62 -0
- package/dist/components/layout/AdminSidebar.tsx +65 -0
- package/dist/components/layout/AppConfig.d.ts +1 -1
- package/dist/components/layout/AppConfig.tsx +104 -0
- package/dist/components/layout/AppSidebar.tsx +225 -0
- package/dist/components/layout/ButtonLoader.tsx +7 -0
- package/dist/components/layout/CustomPagination.tsx +55 -0
- package/dist/components/layout/DashboardHeader.tsx +89 -0
- package/dist/components/layout/FilterMenu.tsx +122 -0
- package/dist/components/layout/Footer.tsx +13 -0
- package/dist/components/layout/GlobalSearch.tsx +37 -0
- package/dist/components/layout/Header.tsx +8 -0
- package/dist/components/layout/Layout.d.ts +1 -1
- package/dist/components/layout/Layout.tsx +136 -0
- package/dist/components/layout/ListingHeader.tsx +204 -0
- package/dist/components/layout/Loader.tsx +16 -0
- package/dist/components/layout/UserSidebar.tsx +53 -0
- package/dist/components/layout/context/layoutcontext.d.ts +1 -1
- package/dist/components/layout/context/layoutcontext.tsx +52 -0
- package/dist/components/layout/navbar-one.tsx +258 -0
- package/dist/components/layout/navbar-two-menu.tsx +73 -0
- package/dist/components/layout/navbar-two.tsx +37 -0
- package/dist/components/layout/user-profile-menu.tsx +120 -0
- package/dist/components/layout/user-profile.tsx +7 -0
- package/dist/components/modelsComponents/filterIcon.tsx +9 -0
- package/dist/components/tables/DemoData.tsx +318 -0
- package/dist/components/tables/DynamicTable.tsx +56 -0
- package/dist/components/tables/ListViewTable.tsx +156 -0
- package/dist/declarations.d.ts +19 -0
- package/dist/helpers/AppTitle.tsx +12 -0
- package/dist/helpers/ToastContainer.tsx +93 -0
- package/dist/helpers/authHeader.ts +20 -0
- package/dist/helpers/countries.tsx +260 -0
- package/dist/helpers/downloadMediaFile.tsx +19 -0
- package/dist/helpers/getAcceptedFileTypes.tsx +22 -0
- package/dist/helpers/getRandomColors.d.ts +4 -0
- package/dist/helpers/getRandomColors.d.ts.map +1 -0
- package/dist/helpers/getRandomColors.js +63 -0
- package/dist/helpers/getRandomColors.js.map +1 -0
- package/dist/helpers/getRandomColors.tsx +68 -0
- package/dist/helpers/helpers.ts +40 -0
- package/dist/helpers/menu.tsx +670 -0
- package/dist/helpers/permissions.ts +19 -0
- package/dist/helpers/registry.d.ts.map +1 -1
- package/dist/helpers/registry.js +76 -35
- package/dist/helpers/registry.js.map +1 -1
- package/dist/helpers/registry.ts +172 -0
- package/dist/helpers/revalidate.ts +7 -0
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/index.ts +642 -0
- package/dist/nextAuth/authProviders.tsx +221 -0
- package/dist/nextAuth/refreshAccessToken.tsx +27 -0
- package/dist/redux/api/articleApi.ts +55 -0
- package/dist/redux/api/authApi.ts +131 -0
- package/dist/redux/api/automationApi.ts +55 -0
- package/dist/redux/api/categoryApi.tsx +46 -0
- package/dist/redux/api/cityApi.tsx +56 -0
- package/dist/redux/api/cmsBannerImageApi.tsx +55 -0
- package/dist/redux/api/countryApi.tsx +56 -0
- package/dist/redux/api/fetchBaseQuery.tsx +15 -0
- package/dist/redux/api/fieldApi.ts +78 -0
- package/dist/redux/api/mediaApi.ts +55 -0
- package/dist/redux/api/mediaStorageProviderApi.ts +55 -0
- package/dist/redux/api/menuApi.tsx +55 -0
- package/dist/redux/api/menuItemsApi.tsx +56 -0
- package/dist/redux/api/modelApi.ts +77 -0
- package/dist/redux/api/moduleApi.ts +72 -0
- package/dist/redux/api/orderAttributeApi.tsx +37 -0
- package/dist/redux/api/permissionApi.ts +32 -0
- package/dist/redux/api/pincodeApi.tsx +56 -0
- package/dist/redux/api/productData.tsx +87 -0
- package/dist/redux/api/radixExtraModelAttributeApi.tsx +37 -0
- package/dist/redux/api/radixModelMetadataApi.tsx +62 -0
- package/dist/redux/api/radixModelsApi.tsx +64 -0
- package/dist/redux/api/ratingApi.ts +55 -0
- package/dist/redux/api/reviewApi.ts +55 -0
- package/dist/redux/api/roleApi.ts +58 -0
- package/dist/redux/api/solidActionApi.ts +66 -0
- package/dist/redux/api/solidChatterMessageApi.d.ts +7 -0
- package/dist/redux/api/solidChatterMessageApi.d.ts.map +1 -0
- package/dist/redux/api/solidChatterMessageApi.js +29 -0
- package/dist/redux/api/solidChatterMessageApi.js.map +1 -0
- package/dist/redux/api/solidChatterMessageApi.ts +30 -0
- package/dist/redux/api/solidEntityApi.tsx +110 -0
- package/dist/redux/api/solidMenuApi.ts +71 -0
- package/dist/redux/api/solidSettingsApi.tsx +47 -0
- package/dist/redux/api/solidViewApi.ts +73 -0
- package/dist/redux/api/stateApi.tsx +56 -0
- package/dist/redux/api/tagApi.ts +55 -0
- package/dist/redux/api/tagGroupApi.tsx +55 -0
- package/dist/redux/api/testApi.ts +21 -0
- package/dist/redux/api/userApi.ts +120 -0
- package/dist/redux/features/authSlice.ts +19 -0
- package/dist/redux/features/dataViewSlice.ts +26 -0
- package/dist/redux/features/navbarSlice.ts +21 -0
- package/dist/redux/features/popupSlice.ts +27 -0
- package/dist/redux/features/themeSlice.ts +17 -0
- package/dist/redux/features/userSlice.ts +28 -0
- package/dist/resources/globals.css +59 -0
- package/dist/types/index.d.ts +60 -0
- package/dist/types/layout.d.ts +94 -0
- package/dist/types/next-auth.d.ts +0 -0
- package/dist/types/next.d.ts +46 -0
- package/dist/types/solid-core.d.ts +139 -0
- package/package.json +4 -3
- package/src/components/Svg/RightArrowSvg.tsx +9 -0
- package/src/components/core/chatter/SolidChatter.tsx +252 -0
- package/src/components/core/chatter/SolidChatterDateDivider.tsx +16 -0
- package/src/components/core/chatter/SolidChatterHeader.tsx +178 -0
- package/src/components/core/chatter/SolidChatterMessageBox.tsx +165 -0
- package/src/components/core/chatter/SolidMessageComposer.tsx +145 -0
- package/src/components/core/chatter/chatter.module.css +70 -0
- package/src/components/core/extension/solid-core/roleMetadata/RolePermissionsManyToManyFieldWidget.tsx +2 -2
- package/src/components/core/form/SolidFormView.tsx +166 -136
- package/src/components/core/form/fields/SolidBooleanField.tsx +170 -48
- package/src/components/core/form/fields/SolidDateField.tsx +86 -51
- package/src/components/core/form/fields/SolidDateTimeField.tsx +89 -52
- package/src/components/core/form/fields/SolidDecimalField.tsx +84 -49
- package/src/components/core/form/fields/SolidEmailField.tsx +90 -51
- package/src/components/core/form/fields/SolidIntegerField.tsx +86 -49
- package/src/components/core/form/fields/SolidJsonField.tsx +112 -42
- package/src/components/core/form/fields/SolidLongTextField.tsx +76 -117
- package/src/components/core/form/fields/SolidMediaMultipleField.tsx +474 -258
- package/src/components/core/form/fields/SolidMediaSingleField.tsx +408 -249
- package/src/components/core/form/fields/SolidPasswordField.tsx +112 -55
- package/src/components/core/form/fields/SolidRichTextField.tsx +105 -52
- package/src/components/core/form/fields/SolidSelectionDynamicField.tsx +138 -91
- package/src/components/core/form/fields/SolidSelectionStaticField.tsx +169 -37
- package/src/components/core/form/fields/SolidShortTextField.tsx +131 -74
- package/src/components/core/form/fields/SolidTimeField.tsx +85 -53
- package/src/components/core/form/fields/relations/SolidRelationManyToManyField.tsx +193 -30
- package/src/components/core/form/fields/relations/SolidRelationManyToOneField.tsx +206 -165
- package/src/components/core/form/fields/relations/SolidRelationOneToManyField.tsx +223 -142
- package/src/components/core/form/fields/widgets/SolidRelationFieldAvatarFormWidget.tsx +46 -0
- package/src/components/core/kanban/kanban-fields/SolidShortTextKanbanField.tsx +10 -10
- package/src/components/core/list/SolidListView.tsx +5 -5
- package/src/components/core/list/columns/SolidBooleanColumn.tsx +30 -2
- package/src/components/core/list/columns/SolidDateColumn.tsx +23 -8
- package/src/components/core/list/columns/SolidDatetimeColumn.tsx +24 -8
- package/src/components/core/list/columns/SolidExternalIdColumn.tsx +23 -8
- package/src/components/core/list/columns/SolidIdColumn.tsx +22 -7
- package/src/components/core/list/columns/SolidIntColumn.tsx +22 -7
- package/src/components/core/list/columns/SolidMediaMultipleColumn.tsx +68 -45
- package/src/components/core/list/columns/SolidMediaSingleColumn.tsx +48 -26
- package/src/components/core/list/columns/SolidRelationColumn.tsx +7 -0
- package/src/components/core/list/columns/SolidSelectionDynamicColumn.tsx +22 -7
- package/src/components/core/list/columns/SolidSelectionStaticColumn.tsx +24 -9
- package/src/components/core/list/columns/SolidShortTextColumn.tsx +26 -39
- package/src/components/core/list/columns/SolidTimeColumn.tsx +22 -7
- package/src/components/core/list/columns/SolidUuidColumn.tsx +22 -7
- package/src/components/core/list/columns/relations/SolidRelationManyToManyColumn.tsx +110 -0
- package/src/components/core/list/columns/relations/SolidRelationManyToOneColumn.tsx +43 -19
- package/src/components/core/list/columns/relations/SolidRelationOneToManyColumn.tsx +111 -0
- package/src/components/core/list/widgets/SolidRelationAvatarWidget.tsx +89 -0
- package/src/components/core/list/widgets/SolidShortTextAvatarWidget.tsx +59 -0
- package/src/components/core/list/widgets/SolidShortTextFieldImageRenderModeWidget.tsx +5 -3
- package/src/components/core/model/FieldMetaDataForm.tsx +1 -1
- package/src/helpers/getRandomColors.tsx +68 -0
- package/src/helpers/registry.ts +89 -38
- package/src/index.ts +1 -0
- package/src/redux/api/solidChatterMessageApi.ts +30 -0
- package/src/resources/globals.css +59 -0
- package/src/types/solid-core.d.ts +24 -16
- package/src/components/core/form/fields/relations/widgets/SolidRelationManyToManyAutocompleteWidget.tsx +0 -74
- package/src/components/core/form/fields/relations/widgets/SolidRelationManyToManyCheckboxWidget.tsx +0 -103
- package/src/components/core/form/fields/widgets/SolidBooleanCheckboxFieldWidget.tsx +0 -79
- package/src/components/core/form/fields/widgets/SolidBooleanSelectFieldWidget.tsx +0 -68
- package/src/components/core/form/fields/widgets/SolidFormFieldJsonViewModeWidget.tsx +0 -23
- package/src/components/core/form/fields/widgets/SolidFormFieldMediaViewModeWidget.tsx +0 -13
- package/src/components/core/form/fields/widgets/SolidFormFieldPasswordViewModeWidget.tsx +0 -23
- package/src/components/core/form/fields/widgets/SolidFormFieldRelationViewModeWidget.tsx +0 -32
- package/src/components/core/form/fields/widgets/SolidFormFieldRichTextViewModeWidget.tsx +0 -17
- package/src/components/core/form/fields/widgets/SolidFormFieldViewMediaMultipleWidget.tsx +0 -174
- package/src/components/core/form/fields/widgets/SolidFormFieldViewMediaSingleWidget.tsx +0 -115
- package/src/components/core/form/fields/widgets/SolidFormFieldViewModeWidget.tsx +0 -11
- package/src/components/core/form/fields/widgets/SolidSelectionStaticAutocompleteFieldWidget.tsx +0 -72
- package/src/components/core/form/fields/widgets/SolidSelectionStaticRadioFieldWidget.tsx +0 -72
- package/src/components/core/list/widgets/SolidShortTextFieldTextRenderModeWidget.tsx +0 -11
|
@@ -0,0 +1,522 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { DropzonePlaceholder } from "@/components/common/DropzonePlaceholder";
|
|
3
|
+
import { useDeleteMediaMutation } from "@/redux/api/mediaApi";
|
|
4
|
+
import { Button } from "primereact/button";
|
|
5
|
+
import { Dialog } from "primereact/dialog";
|
|
6
|
+
import { Message } from "primereact/message";
|
|
7
|
+
import { useEffect, useState } from "react";
|
|
8
|
+
import { useDropzone } from "react-dropzone";
|
|
9
|
+
import * as Yup from 'yup';
|
|
10
|
+
import { Schema } from "yup";
|
|
11
|
+
import { FormikObject, ISolidField, SolidFieldProps } from "./ISolidField";
|
|
12
|
+
import { FileReaderExt } from "@/components/common/FileReaderExt";
|
|
13
|
+
import { ProgressBar } from "primereact/progressbar";
|
|
14
|
+
import Link from "next/link";
|
|
15
|
+
import getAcceptedFileTypes from "@/helpers/getAcceptedFileTypes";
|
|
16
|
+
import { downloadMediaFile } from "@/helpers/downloadMediaFile";
|
|
17
|
+
import { getExtensionComponent } from "@/helpers/registry";
|
|
18
|
+
import { SolidMediaFormFieldWidgetProps } from "@/types/solid-core";
|
|
19
|
+
|
|
20
|
+
export class SolidMediaSingleField implements ISolidField {
|
|
21
|
+
|
|
22
|
+
private fieldContext: SolidFieldProps;
|
|
23
|
+
private setLightboxUrls?: (urls: { src: string; downloadUrl: string }[]) => void;
|
|
24
|
+
private setOpenLightbox?: (open: boolean) => void;
|
|
25
|
+
constructor(fieldContext: SolidFieldProps, setLightboxUrls?: (urls: { src: string; downloadUrl: string }[]) => void,
|
|
26
|
+
setOpenLightbox?: (open: boolean) => void) {
|
|
27
|
+
this.fieldContext = fieldContext;
|
|
28
|
+
this.setLightboxUrls = setLightboxUrls;
|
|
29
|
+
this.setOpenLightbox = setOpenLightbox;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
updateFormData(value: any, formData: FormData): any {
|
|
33
|
+
const fieldLayoutInfo = this.fieldContext.field;
|
|
34
|
+
if (value instanceof File) {
|
|
35
|
+
formData.append(fieldLayoutInfo.attrs.name, value);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
initialValue(): any {
|
|
40
|
+
const mediaUrls = this.fieldContext.data && this.fieldContext.data._media && this.fieldContext.data._media[this.fieldContext.field.attrs.name][0];
|
|
41
|
+
return mediaUrls;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
validationSchema(): Schema {
|
|
45
|
+
// let schema: Yup.StringSchema = Yup.object();
|
|
46
|
+
|
|
47
|
+
const fieldMetadata = this.fieldContext.fieldMetadata;
|
|
48
|
+
const fieldLayoutInfo = this.fieldContext.field;
|
|
49
|
+
|
|
50
|
+
const fieldLabel = fieldLayoutInfo.attrs.label ?? fieldMetadata.displayName;
|
|
51
|
+
// Dynamically determine the base type based on the 'required' flag
|
|
52
|
+
|
|
53
|
+
// Define base schema
|
|
54
|
+
let schema: Yup.MixedSchema<File | object>;
|
|
55
|
+
|
|
56
|
+
if (fieldMetadata.required) {
|
|
57
|
+
// For required fields: disallow null and undefined
|
|
58
|
+
schema = Yup.mixed<File | object>()
|
|
59
|
+
.required(`${fieldLabel} is required.`)
|
|
60
|
+
.test(
|
|
61
|
+
"file-or-object",
|
|
62
|
+
`${fieldLabel} must be a file or an object.`,
|
|
63
|
+
(value) =>
|
|
64
|
+
value instanceof File || typeof value === "object" // Validate File or object
|
|
65
|
+
);
|
|
66
|
+
} else {
|
|
67
|
+
// For optional fields: allow null or undefined
|
|
68
|
+
schema = Yup.mixed<any>()
|
|
69
|
+
.nullable() // Allow null explicitly
|
|
70
|
+
.test(
|
|
71
|
+
"file-or-object",
|
|
72
|
+
`${fieldLabel} must be a file, an object, or empty.`,
|
|
73
|
+
(value) =>
|
|
74
|
+
value === null || // Allow null
|
|
75
|
+
value === undefined || // Allow undefined
|
|
76
|
+
value instanceof File || // Allow File
|
|
77
|
+
typeof value === "object" // Allow object
|
|
78
|
+
);
|
|
79
|
+
}
|
|
80
|
+
return schema;
|
|
81
|
+
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
render(formik: FormikObject) {
|
|
85
|
+
const fieldMetadata = this.fieldContext.fieldMetadata;
|
|
86
|
+
const fieldLayoutInfo = this.fieldContext.field;
|
|
87
|
+
const className = fieldLayoutInfo.attrs?.className || 'field col-12';
|
|
88
|
+
const isFormFieldValid = (formik: any, fieldName: string) => formik.touched[fieldName] && formik.errors[fieldName];
|
|
89
|
+
|
|
90
|
+
let viewWidget = fieldLayoutInfo.attrs.viewWidget;
|
|
91
|
+
let editWidget = fieldLayoutInfo.attrs.editWidget;
|
|
92
|
+
if (!editWidget) {
|
|
93
|
+
editWidget = 'DefaultMediaSingleFormEditWidget';
|
|
94
|
+
}
|
|
95
|
+
if (!viewWidget) {
|
|
96
|
+
viewWidget = 'DefaultMediaSingleFormViewWidget';
|
|
97
|
+
}
|
|
98
|
+
const viewMode: string = this.fieldContext.viewMode;
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
return (
|
|
102
|
+
<>
|
|
103
|
+
<div className={className}>
|
|
104
|
+
{viewMode === "view" &&
|
|
105
|
+
this.renderExtensionRenderMode(viewWidget, formik)
|
|
106
|
+
}
|
|
107
|
+
{viewMode === "edit" &&
|
|
108
|
+
<>
|
|
109
|
+
{editWidget &&
|
|
110
|
+
this.renderExtensionRenderMode(editWidget, formik)
|
|
111
|
+
}
|
|
112
|
+
{isFormFieldValid(formik, fieldLayoutInfo.attrs.name) && (
|
|
113
|
+
<div className="absolute mt-1">
|
|
114
|
+
<Message severity="error" text={formik?.errors[fieldLayoutInfo.attrs.name]?.toString()} />
|
|
115
|
+
</div>
|
|
116
|
+
)}
|
|
117
|
+
</>
|
|
118
|
+
}
|
|
119
|
+
</div>
|
|
120
|
+
</>
|
|
121
|
+
);
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
renderExtensionRenderMode(widget: string, formik: FormikObject) {
|
|
126
|
+
let DynamicWidget = getExtensionComponent(widget);
|
|
127
|
+
const widgetProps: SolidMediaFormFieldWidgetProps = {
|
|
128
|
+
formik: formik,
|
|
129
|
+
fieldContext: this.fieldContext,
|
|
130
|
+
setLightboxUrls: this.setLightboxUrls,
|
|
131
|
+
setOpenLightbox: this.setOpenLightbox
|
|
132
|
+
}
|
|
133
|
+
return (
|
|
134
|
+
<>
|
|
135
|
+
{DynamicWidget && <DynamicWidget {...widgetProps} />}
|
|
136
|
+
</>
|
|
137
|
+
)
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
|
|
142
|
+
|
|
143
|
+
|
|
144
|
+
|
|
145
|
+
export const DefaultMediaSingleFormEditWidget = ({ formik, fieldContext, setLightboxUrls, setOpenLightbox }: SolidMediaFormFieldWidgetProps) => {
|
|
146
|
+
const fieldMetadata = fieldContext.fieldMetadata;
|
|
147
|
+
const fieldLayoutInfo = fieldContext.field;
|
|
148
|
+
const className = fieldLayoutInfo.attrs?.className || 'field col-12';
|
|
149
|
+
const fieldLabel = fieldLayoutInfo.attrs.label ?? fieldMetadata.displayName;
|
|
150
|
+
const fieldDescription = fieldLayoutInfo.attrs.description ?? fieldMetadata.description;
|
|
151
|
+
const solidFormViewMetaData = fieldContext.solidFormViewMetaData;
|
|
152
|
+
const showFieldLabel = fieldLayoutInfo?.attrs?.showLabel;
|
|
153
|
+
const readOnlyPermission = fieldContext.readOnly;
|
|
154
|
+
const viewMode: string = fieldContext.viewMode;
|
|
155
|
+
|
|
156
|
+
const [isDeleteImageDialogVisible, setDeleteImageDialogVisible] = useState(false);
|
|
157
|
+
const [imageToBeDeletedData, setImageToBeDeletedData] = useState<any>();
|
|
158
|
+
const [fileDetails, setFileDetails] = useState<{ name: string; type: string, fileUrl: string, fileSize: number } | null>(null);
|
|
159
|
+
const [isReplaceImageDialogVisible, setReplaceImageDialogVisible] = useState(false);
|
|
160
|
+
const [newFileToUpload, setNewFileToUpload] = useState<any>(null);
|
|
161
|
+
const [fileSizeError, setFileSizeError] = useState<string | null>(null);
|
|
162
|
+
|
|
163
|
+
const formatFileSize = (size: number) => {
|
|
164
|
+
return size >= 1024 * 1024
|
|
165
|
+
? `${(size / (1024 * 1024)).toFixed(1)} MB`
|
|
166
|
+
: `${(size / 1024).toFixed(1)} KB`;
|
|
167
|
+
};
|
|
168
|
+
|
|
169
|
+
const [
|
|
170
|
+
deleteMedia,
|
|
171
|
+
{ isLoading: isMediaDeleted, isSuccess: isDeleteMediaSuceess, isError: isMediaDeleteError, error: mediaDeleteError, data: DeletedMedia },
|
|
172
|
+
] = useDeleteMediaMutation();
|
|
173
|
+
|
|
174
|
+
const handleCancelUpload = (e: React.MouseEvent) => {
|
|
175
|
+
e.stopPropagation();
|
|
176
|
+
if (imageToBeDeletedData) {
|
|
177
|
+
deleteMedia(imageToBeDeletedData);
|
|
178
|
+
}
|
|
179
|
+
e.stopPropagation();
|
|
180
|
+
setFileDetails(null);
|
|
181
|
+
formik.setFieldValue(fieldLayoutInfo.attrs.name, null);
|
|
182
|
+
setDeleteImageDialogVisible(false);
|
|
183
|
+
};
|
|
184
|
+
|
|
185
|
+
const handleDropImage = (acceptedFiles: any[]) => {
|
|
186
|
+
const file = acceptedFiles[0];
|
|
187
|
+
if (!file) return;
|
|
188
|
+
setFileSizeError(null);
|
|
189
|
+
if (fileDetails) {
|
|
190
|
+
// If a file is already uploaded, show the confirmation dialog
|
|
191
|
+
setNewFileToUpload(file);
|
|
192
|
+
setReplaceImageDialogVisible(true);
|
|
193
|
+
} else {
|
|
194
|
+
// If no file is present, proceed with upload
|
|
195
|
+
uploadFile(file);
|
|
196
|
+
}
|
|
197
|
+
};
|
|
198
|
+
|
|
199
|
+
const uploadFile = (file: File) => {
|
|
200
|
+
setFileDetails({
|
|
201
|
+
name: file.name,
|
|
202
|
+
type: file.type,
|
|
203
|
+
fileUrl: URL.createObjectURL(file),
|
|
204
|
+
fileSize: file.size
|
|
205
|
+
});
|
|
206
|
+
|
|
207
|
+
const reader = new FileReader();
|
|
208
|
+
reader.readAsDataURL(file);
|
|
209
|
+
formik.setFieldValue(fieldLayoutInfo.attrs.name, file);
|
|
210
|
+
};
|
|
211
|
+
|
|
212
|
+
const handleReplaceFile = () => {
|
|
213
|
+
// Delete the existing file first
|
|
214
|
+
if (imageToBeDeletedData) {
|
|
215
|
+
deleteMedia(imageToBeDeletedData);
|
|
216
|
+
}
|
|
217
|
+
setFileDetails(null);
|
|
218
|
+
formik.setFieldValue(fieldLayoutInfo.attrs.name, null);
|
|
219
|
+
|
|
220
|
+
// Proceed with uploading new file
|
|
221
|
+
if (newFileToUpload) {
|
|
222
|
+
uploadFile(newFileToUpload);
|
|
223
|
+
setNewFileToUpload(null);
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
setReplaceImageDialogVisible(false);
|
|
227
|
+
};
|
|
228
|
+
|
|
229
|
+
useEffect(() => {
|
|
230
|
+
const fieldValue = formik?.values[fieldLayoutInfo.attrs.name];
|
|
231
|
+
|
|
232
|
+
if (fieldValue && typeof fieldValue === "object") {
|
|
233
|
+
let fileUrl = "";
|
|
234
|
+
let fileName = "Unknown File";
|
|
235
|
+
let fileSize = 0;
|
|
236
|
+
|
|
237
|
+
if (fieldValue instanceof File) {
|
|
238
|
+
fileUrl = URL.createObjectURL(fieldValue);
|
|
239
|
+
fileName = fieldValue.name;
|
|
240
|
+
fileSize = fieldValue.size;
|
|
241
|
+
} else if (fieldValue._full_url) {
|
|
242
|
+
fileUrl = fieldValue._full_url;
|
|
243
|
+
fileName = fieldValue.originalFileName;
|
|
244
|
+
fileSize = fieldValue.fileSize;
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
setFileDetails({
|
|
248
|
+
name: fileName,
|
|
249
|
+
type: fieldValue.mimeType,
|
|
250
|
+
fileUrl,
|
|
251
|
+
fileSize
|
|
252
|
+
});
|
|
253
|
+
|
|
254
|
+
// Set file ID for delete operation
|
|
255
|
+
setImageToBeDeletedData(fieldValue.id);
|
|
256
|
+
|
|
257
|
+
// Ensure formik has the correct value
|
|
258
|
+
formik.setFieldValue(fieldLayoutInfo.attrs.name, fieldValue);
|
|
259
|
+
}
|
|
260
|
+
}, [formik.values, fieldLayoutInfo.attrs.name]);
|
|
261
|
+
|
|
262
|
+
const {
|
|
263
|
+
getRootProps: getRootProps,
|
|
264
|
+
getInputProps: getInputProps,
|
|
265
|
+
isDragActive: isDragActive,
|
|
266
|
+
} = useDropzone({
|
|
267
|
+
onDrop: handleDropImage,
|
|
268
|
+
onDropRejected: (fileRejections) => {
|
|
269
|
+
const rejection = fileRejections[0];
|
|
270
|
+
const sizeError = rejection.errors.find(err => err.code === 'file-too-large');
|
|
271
|
+
if (sizeError) {
|
|
272
|
+
setFileSizeError(`File is too large. Max size is ${fieldMetadata.mediaMaxSizeKb} KB.`);
|
|
273
|
+
} else {
|
|
274
|
+
setFileSizeError(rejection.errors[0]?.message || "File not accepted.");
|
|
275
|
+
}
|
|
276
|
+
},
|
|
277
|
+
accept: getAcceptedFileTypes(fieldMetadata.mediaTypes),
|
|
278
|
+
maxSize: fieldMetadata.mediaMaxSizeKb * 1024,
|
|
279
|
+
});
|
|
280
|
+
|
|
281
|
+
const isFormFieldValid = (formik: any, fieldName: string) => formik.touched[fieldName] && formik.errors[fieldName];
|
|
282
|
+
let DynamicWidget = getExtensionComponent("SolidFormFieldViewMediaSingleWidget");
|
|
283
|
+
const widgetProps = {
|
|
284
|
+
formik: formik,
|
|
285
|
+
fieldContext: fieldContext,
|
|
286
|
+
setLightboxUrls: setLightboxUrls,
|
|
287
|
+
setOpenLightbox: setOpenLightbox
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
const handleFileView = (url: any) => {
|
|
291
|
+
if (url?.type.includes('image/')) {
|
|
292
|
+
setLightboxUrls?.([
|
|
293
|
+
{ src: url.fileUrl, downloadUrl: url.fileUrl },
|
|
294
|
+
]);
|
|
295
|
+
setOpenLightbox?.(true);
|
|
296
|
+
} else {
|
|
297
|
+
const link = document.createElement('a');
|
|
298
|
+
link.href = url.fileUrl;
|
|
299
|
+
link.download = ''; // or specify a file name like 'file.pdf'
|
|
300
|
+
link.target = '_blank';
|
|
301
|
+
document.body.appendChild(link);
|
|
302
|
+
link.click();
|
|
303
|
+
document.body.removeChild(link);
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
|
|
308
|
+
return (
|
|
309
|
+
<div style={readOnlyPermission === true ? { filter: 'opacity(50%)', pointerEvents: 'none' } : {}}>
|
|
310
|
+
<div className="flex flex-column gap-2 mt-4 relative">
|
|
311
|
+
{showFieldLabel != false &&
|
|
312
|
+
<label htmlFor={fieldLayoutInfo.attrs.name} className="form-field-label">{fieldLabel}
|
|
313
|
+
{fieldMetadata.required && <span className="text-red-500"> *</span>}
|
|
314
|
+
{/* {fieldDescription && <span className="form_field_help">({fieldDescription}) </span>} */}
|
|
315
|
+
</label>
|
|
316
|
+
}
|
|
317
|
+
<div className="relative">
|
|
318
|
+
<div
|
|
319
|
+
{...getRootProps()}
|
|
320
|
+
className="solid-dropzone-wrapper"
|
|
321
|
+
>
|
|
322
|
+
<input {...getInputProps()} />
|
|
323
|
+
<DropzonePlaceholder
|
|
324
|
+
mediaTypes={fieldMetadata.mediaTypes}
|
|
325
|
+
mediaMaxSizeKb={fieldMetadata.mediaMaxSizeKb}
|
|
326
|
+
/>
|
|
327
|
+
</div>
|
|
328
|
+
{isFormFieldValid(formik, fieldLayoutInfo.attrs.name) && (
|
|
329
|
+
<div className="absolute mt-1">
|
|
330
|
+
<Message severity="error" text={formik?.errors[fieldLayoutInfo.attrs.name]?.toString()} />
|
|
331
|
+
</div>
|
|
332
|
+
)}
|
|
333
|
+
</div>
|
|
334
|
+
{
|
|
335
|
+
fileSizeError &&
|
|
336
|
+
<Message severity="error" text={fileSizeError?.toString()} />
|
|
337
|
+
}
|
|
338
|
+
{fileDetails && (
|
|
339
|
+
<div className="solid-file-upload-wrapper mt-4">
|
|
340
|
+
<div className="flex align-items-center gap-2">
|
|
341
|
+
<FileReaderExt fileDetails={fileDetails} />
|
|
342
|
+
<div className="w-full flex flex-column gap-1">
|
|
343
|
+
<div className="flex align-items-start justify-content-between">
|
|
344
|
+
<p className="font-normal w-9 text-primary m-0" style={{ cursor: 'pointer' }} onClick={() => handleFileView(fileDetails)}>{fileDetails.name}</p>
|
|
345
|
+
<div className="flex align-items-center gap-2">
|
|
346
|
+
<div>
|
|
347
|
+
<Button
|
|
348
|
+
type="button"
|
|
349
|
+
text
|
|
350
|
+
icon={"pi pi-download"}
|
|
351
|
+
size="small"
|
|
352
|
+
severity="secondary"
|
|
353
|
+
// className="p-2"
|
|
354
|
+
style={{
|
|
355
|
+
height: 16,
|
|
356
|
+
width: 16
|
|
357
|
+
}}
|
|
358
|
+
onClick={() => downloadMediaFile(fileDetails?.fileUrl, fileDetails?.name)}
|
|
359
|
+
/>
|
|
360
|
+
</div>
|
|
361
|
+
<div>
|
|
362
|
+
<Button
|
|
363
|
+
type="button"
|
|
364
|
+
text
|
|
365
|
+
icon={"pi pi-times"}
|
|
366
|
+
size="small"
|
|
367
|
+
severity="secondary"
|
|
368
|
+
// className="p-2"
|
|
369
|
+
style={{
|
|
370
|
+
height: 16,
|
|
371
|
+
width: 16
|
|
372
|
+
}}
|
|
373
|
+
onClick={() => setDeleteImageDialogVisible(true)}
|
|
374
|
+
/>
|
|
375
|
+
</div>
|
|
376
|
+
</div>
|
|
377
|
+
</div>
|
|
378
|
+
<div className="flex align-items-center gap-2 text-sm">
|
|
379
|
+
{fileDetails && formatFileSize(fileDetails.fileSize)}
|
|
380
|
+
</div>
|
|
381
|
+
</div>
|
|
382
|
+
</div>
|
|
383
|
+
</div>
|
|
384
|
+
)}
|
|
385
|
+
</div>
|
|
386
|
+
<Dialog
|
|
387
|
+
visible={isDeleteImageDialogVisible}
|
|
388
|
+
header="Confirm Delete"
|
|
389
|
+
modal
|
|
390
|
+
footer={() => (
|
|
391
|
+
<div className="flex justify-content-center">
|
|
392
|
+
<Button type="button" label="Yes" icon="pi pi-check" className='small-button' severity="danger" autoFocus onClick={handleCancelUpload} />
|
|
393
|
+
<Button type="button" label="No" icon="pi pi-times" className='small-button' onClick={() => setDeleteImageDialogVisible(false)} />
|
|
394
|
+
</div>
|
|
395
|
+
)}
|
|
396
|
+
onHide={() => setDeleteImageDialogVisible(false)}
|
|
397
|
+
>
|
|
398
|
+
<p>Are you sure you want to delete media?</p>
|
|
399
|
+
</Dialog>
|
|
400
|
+
<Dialog
|
|
401
|
+
visible={isReplaceImageDialogVisible}
|
|
402
|
+
header="Replace Image"
|
|
403
|
+
modal
|
|
404
|
+
footer={() => (
|
|
405
|
+
<div className="flex justify-content-center">
|
|
406
|
+
<Button type="button" label="Yes, Replace" icon="pi pi-check" className='small-button' severity="danger" onClick={handleReplaceFile} />
|
|
407
|
+
<Button type="button" label="Cancel" icon="pi pi-times" className='small-button' onClick={() => setReplaceImageDialogVisible(false)} />
|
|
408
|
+
</div>
|
|
409
|
+
)}
|
|
410
|
+
onHide={() => setReplaceImageDialogVisible(false)}
|
|
411
|
+
>
|
|
412
|
+
<p>An media is already uploaded. Do you want to delete it and upload a new one?</p>
|
|
413
|
+
</Dialog>
|
|
414
|
+
</div>
|
|
415
|
+
);
|
|
416
|
+
}
|
|
417
|
+
|
|
418
|
+
export const DefaultMediaSingleFormViewWidget = ({ formik, fieldContext, setLightboxUrls, setOpenLightbox }: SolidMediaFormFieldWidgetProps) => {
|
|
419
|
+
const [fileDetails, setFileDetails] = useState<{ name: string; type: string, fileUrl: string, fileSize: number } | null>(null);
|
|
420
|
+
const fieldMetadata = fieldContext.fieldMetadata;
|
|
421
|
+
const fieldLayoutInfo = fieldContext.field;
|
|
422
|
+
const className = fieldLayoutInfo.attrs?.className || 'field col-12';
|
|
423
|
+
const fieldLabel = fieldLayoutInfo.attrs.label ?? fieldMetadata.displayName;
|
|
424
|
+
const showFieldLabel = fieldLayoutInfo?.attrs?.showLabel;
|
|
425
|
+
|
|
426
|
+
useEffect(() => { formik.setFieldValue(fieldLayoutInfo.attrs.name, "false") }, [])
|
|
427
|
+
|
|
428
|
+
const isFormFieldValid = (formik: any, fieldName: string) => formik.touched[fieldName] && formik.errors[fieldName];
|
|
429
|
+
const formatFileSize = (size: number) => {
|
|
430
|
+
return size >= 1024 * 1024
|
|
431
|
+
? `${(size / (1024 * 1024)).toFixed(1)} MB`
|
|
432
|
+
: `${(size / 1024).toFixed(1)} KB`;
|
|
433
|
+
};
|
|
434
|
+
|
|
435
|
+
useEffect(() => {
|
|
436
|
+
const fieldValue = formik?.values[fieldLayoutInfo.attrs.name];
|
|
437
|
+
|
|
438
|
+
if (fieldValue && typeof fieldValue === "object") {
|
|
439
|
+
let fileUrl = "";
|
|
440
|
+
let fileName = "Unknown File";
|
|
441
|
+
let fileSize = 0;
|
|
442
|
+
|
|
443
|
+
if (fieldValue instanceof File) {
|
|
444
|
+
fileUrl = URL.createObjectURL(fieldValue);
|
|
445
|
+
fileName = fieldValue.name;
|
|
446
|
+
fileSize = fieldValue.size;
|
|
447
|
+
} else if (fieldValue._full_url) {
|
|
448
|
+
fileUrl = fieldValue._full_url;
|
|
449
|
+
fileName = fieldValue.originalFileName;
|
|
450
|
+
fileSize = fieldValue.fileSize;
|
|
451
|
+
}
|
|
452
|
+
|
|
453
|
+
setFileDetails({
|
|
454
|
+
name: fileName,
|
|
455
|
+
type: fieldValue.mimeType,
|
|
456
|
+
fileUrl,
|
|
457
|
+
fileSize
|
|
458
|
+
});
|
|
459
|
+
// Ensure formik has the correct value
|
|
460
|
+
formik.setFieldValue(fieldLayoutInfo.attrs.name, fieldValue);
|
|
461
|
+
}
|
|
462
|
+
}, [formik.values, fieldLayoutInfo.attrs.name]);
|
|
463
|
+
|
|
464
|
+
const handleFileView = (url: any) => {
|
|
465
|
+
if (url?.type.includes('image/')) {
|
|
466
|
+
setLightboxUrls?.([
|
|
467
|
+
{ src: url.fileUrl, downloadUrl: url.fileUrl },
|
|
468
|
+
]);
|
|
469
|
+
setOpenLightbox?.(true);
|
|
470
|
+
} else {
|
|
471
|
+
const link = document.createElement('a');
|
|
472
|
+
link.href = url.fileUrl;
|
|
473
|
+
link.download = ''; // or specify a file name like 'file.pdf'
|
|
474
|
+
link.target = '_blank';
|
|
475
|
+
document.body.appendChild(link);
|
|
476
|
+
link.click();
|
|
477
|
+
document.body.removeChild(link);
|
|
478
|
+
}
|
|
479
|
+
}
|
|
480
|
+
|
|
481
|
+
return (
|
|
482
|
+
<div className="flex flex-column gap-2 mt-4 relative">
|
|
483
|
+
{showFieldLabel != false &&
|
|
484
|
+
<label htmlFor={fieldLayoutInfo.attrs.name} className="form-field-label font-medium">{fieldLabel}
|
|
485
|
+
</label>
|
|
486
|
+
}
|
|
487
|
+
|
|
488
|
+
{fileDetails && (
|
|
489
|
+
<div className="solid-file-view-wrapper mt-4">
|
|
490
|
+
<div className="flex align-items-center gap-2">
|
|
491
|
+
<FileReaderExt fileDetails={fileDetails} />
|
|
492
|
+
<div className="w-full flex flex-column gap-1">
|
|
493
|
+
<div className="flex align-items-start justify-content-between">
|
|
494
|
+
<p className="font-normal w-9 text-primary m-0" style={{ cursor: 'pointer' }} onClick={() => handleFileView(fileDetails)}>{fileDetails.name}</p>
|
|
495
|
+
<div className="flex align-items-center gap-2">
|
|
496
|
+
<div>
|
|
497
|
+
<Button
|
|
498
|
+
type="button"
|
|
499
|
+
text
|
|
500
|
+
icon={"pi pi-download"}
|
|
501
|
+
size="small"
|
|
502
|
+
severity="secondary"
|
|
503
|
+
// className="p-2"
|
|
504
|
+
style={{
|
|
505
|
+
height: 16,
|
|
506
|
+
width: 16
|
|
507
|
+
}}
|
|
508
|
+
onClick={() => downloadMediaFile(fileDetails?.fileUrl, fileDetails?.name)}
|
|
509
|
+
/>
|
|
510
|
+
</div>
|
|
511
|
+
</div>
|
|
512
|
+
</div>
|
|
513
|
+
<div className="flex align-items-center gap-2 text-sm">
|
|
514
|
+
{fileDetails && formatFileSize(fileDetails.fileSize)}
|
|
515
|
+
</div>
|
|
516
|
+
</div>
|
|
517
|
+
</div>
|
|
518
|
+
</div>
|
|
519
|
+
)}
|
|
520
|
+
</div>
|
|
521
|
+
);
|
|
522
|
+
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Schema } from "yup";
|
|
2
2
|
import { FormikObject, ISolidField, SolidFieldProps } from "./ISolidField";
|
|
3
|
+
import { SolidFormFieldWidgetProps } from "../../../../types/solid-core";
|
|
3
4
|
export declare class SolidPasswordField implements ISolidField {
|
|
4
5
|
private fieldContext;
|
|
5
6
|
constructor(fieldContext: SolidFieldProps);
|
|
@@ -7,5 +8,8 @@ export declare class SolidPasswordField implements ISolidField {
|
|
|
7
8
|
initialValue(): any;
|
|
8
9
|
validationSchema(): Schema;
|
|
9
10
|
render(formik: FormikObject): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
renderExtensionRenderMode(widget: string, formik: FormikObject): import("react/jsx-runtime").JSX.Element;
|
|
10
12
|
}
|
|
13
|
+
export declare const DefaultPasswordFormEditWidget: ({ formik, fieldContext }: SolidFormFieldWidgetProps) => import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export declare const DefaultPasswordFormViewWidget: ({ formik, fieldContext }: SolidFormFieldWidgetProps) => import("react/jsx-runtime").JSX.Element;
|
|
11
15
|
//# sourceMappingURL=SolidPasswordField.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SolidPasswordField.d.ts","sourceRoot":"","sources":["../../../../../src/components/core/form/fields/SolidPasswordField.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,MAAM,EAAE,MAAM,KAAK,CAAC;AAC7B,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"SolidPasswordField.d.ts","sourceRoot":"","sources":["../../../../../src/components/core/form/fields/SolidPasswordField.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,MAAM,EAAE,MAAM,KAAK,CAAC;AAC7B,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAG3E,OAAO,EAAE,yBAAyB,EAAE,MAAM,oBAAoB,CAAC;AAG/D,qBAAa,kBAAmB,YAAW,WAAW;IAElD,OAAO,CAAC,YAAY,CAAkB;gBAE1B,YAAY,EAAE,eAAe;IAIzC,cAAc,CAAC,KAAK,EAAE,GAAG,EAAE,QAAQ,EAAE,QAAQ,GAAG,GAAG;IAOnD,YAAY,IAAI,GAAG;IASnB,gBAAgB,IAAI,MAAM;IA+B1B,MAAM,CAAC,MAAM,EAAE,YAAY;IAsC3B,yBAAyB,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,YAAY;CAYjE;AAED,eAAO,MAAM,6BAA6B,6BAA8B,yBAAyB,4CA0ChG,CAAA;AAED,eAAO,MAAM,6BAA6B,6BAA8B,yBAAyB,4CAsBhG,CAAA"}
|
|
@@ -10,11 +10,12 @@ var __assign = (this && this.__assign) || function () {
|
|
|
10
10
|
};
|
|
11
11
|
return __assign.apply(this, arguments);
|
|
12
12
|
};
|
|
13
|
-
import { jsx as _jsx,
|
|
13
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
14
14
|
import { Message } from "primereact/message";
|
|
15
15
|
import * as Yup from 'yup';
|
|
16
16
|
import { Password } from "primereact/password";
|
|
17
17
|
import { getExtensionComponent } from "../../../../helpers/registry";
|
|
18
|
+
import { useState } from "react";
|
|
18
19
|
var SolidPasswordField = /** @class */ (function () {
|
|
19
20
|
function SolidPasswordField(fieldContext) {
|
|
20
21
|
this.fieldContext = fieldContext;
|
|
@@ -61,33 +62,62 @@ var SolidPasswordField = /** @class */ (function () {
|
|
|
61
62
|
return schema;
|
|
62
63
|
};
|
|
63
64
|
SolidPasswordField.prototype.render = function (formik) {
|
|
64
|
-
var
|
|
65
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
|
65
|
+
var _a, _b;
|
|
66
66
|
var fieldMetadata = this.fieldContext.fieldMetadata;
|
|
67
67
|
var fieldLayoutInfo = this.fieldContext.field;
|
|
68
|
-
var className = ((_a = fieldLayoutInfo.attrs) === null || _a === void 0 ? void 0 : _a.className) || 'field col-12';
|
|
69
|
-
var fieldLabel = (_b = fieldLayoutInfo.attrs.label) !== null && _b !== void 0 ? _b : fieldMetadata.displayName;
|
|
70
|
-
var fieldDescription = (_c = fieldLayoutInfo.attrs.description) !== null && _c !== void 0 ? _c : fieldMetadata.description;
|
|
71
|
-
var solidFormViewMetaData = this.fieldContext.solidFormViewMetaData;
|
|
72
|
-
var showFieldLabel = (_d = fieldLayoutInfo === null || fieldLayoutInfo === void 0 ? void 0 : fieldLayoutInfo.attrs) === null || _d === void 0 ? void 0 : _d.showLabel;
|
|
73
|
-
var readOnlyPermission = this.fieldContext.readOnly;
|
|
74
68
|
var isFormFieldValid = function (formik, fieldName) { return formik.touched[fieldName] && formik.errors[fieldName]; };
|
|
75
|
-
var
|
|
76
|
-
var
|
|
77
|
-
var
|
|
78
|
-
|
|
69
|
+
var className = ((_a = fieldLayoutInfo.attrs) === null || _a === void 0 ? void 0 : _a.className) || 'field col-12';
|
|
70
|
+
var viewWidget = fieldLayoutInfo.attrs.viewWidget;
|
|
71
|
+
var editWidget = fieldLayoutInfo.attrs.editWidget;
|
|
72
|
+
if (!editWidget) {
|
|
73
|
+
editWidget = 'DefaultPasswordFormEditWidget';
|
|
74
|
+
}
|
|
75
|
+
if (!viewWidget) {
|
|
76
|
+
viewWidget = 'DefaultPasswordFormViewWidget';
|
|
77
|
+
}
|
|
79
78
|
var viewMode = this.fieldContext.viewMode;
|
|
80
|
-
|
|
79
|
+
return (_jsx(_Fragment, { children: _jsxs("div", { className: className, children: [viewMode === "view" &&
|
|
80
|
+
this.renderExtensionRenderMode(viewWidget, formik), viewMode === "edit" &&
|
|
81
|
+
_jsxs(_Fragment, { children: [editWidget &&
|
|
82
|
+
this.renderExtensionRenderMode(editWidget, formik), isFormFieldValid(formik, fieldLayoutInfo.attrs.name) && (_jsx("div", { className: "absolute mt-1", children: _jsx(Message, { severity: "error", text: (_b = formik === null || formik === void 0 ? void 0 : formik.errors[fieldLayoutInfo.attrs.name]) === null || _b === void 0 ? void 0 : _b.toString() }) }))] })] }) }));
|
|
83
|
+
};
|
|
84
|
+
SolidPasswordField.prototype.renderExtensionRenderMode = function (widget, formik) {
|
|
85
|
+
var DynamicWidget = getExtensionComponent(widget);
|
|
81
86
|
var widgetProps = {
|
|
82
|
-
|
|
83
|
-
|
|
87
|
+
formik: formik,
|
|
88
|
+
fieldContext: this.fieldContext,
|
|
84
89
|
};
|
|
85
|
-
return (
|
|
86
|
-
_jsx("div", { className: className, children: DynamicWidget && _jsx(DynamicWidget, __assign({}, widgetProps)) }), viewMode === "edit" &&
|
|
87
|
-
(_jsx("div", { className: className, children: _jsxs("div", { className: "relative", children: [_jsxs("div", { className: "flex flex-column gap-2 mt-4", children: [showFieldLabel != false &&
|
|
88
|
-
_jsxs("label", { htmlFor: fieldLayoutInfo.attrs.name, className: "form-field-label", children: [fieldLabel, fieldMetadata.required && _jsx("span", { className: "text-red-500", children: " *" })] }), _jsx(Password, { id: fieldLayoutInfo.attrs.name, name: fieldMetadata.name, value: formik.values[fieldLayoutInfo.attrs.name] || '', onChange: function (e) { return _this.fieldContext.onChange(e, 'onFieldChange'); }, onBlur: function (e) { return _this.fieldContext.onBlur(e, 'onFieldBlur'); }, readOnly: formReadonly || fieldReadonly || readOnlyPermission, disabled: formDisabled || fieldDisabled, toggleMask: true })] }), isFormFieldValid(formik, fieldLayoutInfo.attrs.name) && (_jsx("div", { className: "absolute mt-1", children: _jsx(Message, { severity: "error", text: (_o = formik === null || formik === void 0 ? void 0 : formik.errors[fieldLayoutInfo.attrs.name]) === null || _o === void 0 ? void 0 : _o.toString() }) }))] }) }))] }));
|
|
90
|
+
return (_jsx(_Fragment, { children: DynamicWidget && _jsx(DynamicWidget, __assign({}, widgetProps)) }));
|
|
89
91
|
};
|
|
90
92
|
return SolidPasswordField;
|
|
91
93
|
}());
|
|
92
94
|
export { SolidPasswordField };
|
|
95
|
+
export var DefaultPasswordFormEditWidget = function (_a) {
|
|
96
|
+
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
|
97
|
+
var formik = _a.formik, fieldContext = _a.fieldContext;
|
|
98
|
+
var fieldMetadata = fieldContext.fieldMetadata;
|
|
99
|
+
var fieldLayoutInfo = fieldContext.field;
|
|
100
|
+
var className = ((_b = fieldLayoutInfo.attrs) === null || _b === void 0 ? void 0 : _b.className) || 'field col-12';
|
|
101
|
+
var fieldLabel = (_c = fieldLayoutInfo.attrs.label) !== null && _c !== void 0 ? _c : fieldMetadata.displayName;
|
|
102
|
+
var fieldDescription = (_d = fieldLayoutInfo.attrs.description) !== null && _d !== void 0 ? _d : fieldMetadata.description;
|
|
103
|
+
var solidFormViewMetaData = fieldContext.solidFormViewMetaData;
|
|
104
|
+
var showFieldLabel = (_e = fieldLayoutInfo === null || fieldLayoutInfo === void 0 ? void 0 : fieldLayoutInfo.attrs) === null || _e === void 0 ? void 0 : _e.showLabel;
|
|
105
|
+
var readOnlyPermission = fieldContext.readOnly;
|
|
106
|
+
var isFormFieldValid = function (formik, fieldName) { return formik.touched[fieldName] && formik.errors[fieldName]; };
|
|
107
|
+
var fieldDisabled = (_f = fieldLayoutInfo.attrs) === null || _f === void 0 ? void 0 : _f.disabled;
|
|
108
|
+
var fieldReadonly = (_g = fieldLayoutInfo.attrs) === null || _g === void 0 ? void 0 : _g.readonly;
|
|
109
|
+
var formDisabled = (_k = (_j = (_h = solidFormViewMetaData.data.solidView) === null || _h === void 0 ? void 0 : _h.layout) === null || _j === void 0 ? void 0 : _j.attrs) === null || _k === void 0 ? void 0 : _k.disabled;
|
|
110
|
+
var formReadonly = (_o = (_m = (_l = solidFormViewMetaData.data.solidView) === null || _l === void 0 ? void 0 : _l.layout) === null || _m === void 0 ? void 0 : _m.attrs) === null || _o === void 0 ? void 0 : _o.readonly;
|
|
111
|
+
return (_jsx("div", { className: "relative", children: _jsxs("div", { className: "flex flex-column gap-2 mt-4", children: [showFieldLabel != false &&
|
|
112
|
+
_jsxs("label", { htmlFor: fieldLayoutInfo.attrs.name, className: "form-field-label", children: [fieldLabel, fieldMetadata.required && _jsx("span", { className: "text-red-500", children: " *" })] }), _jsx(Password, { id: fieldLayoutInfo.attrs.name, name: fieldMetadata.name, value: formik.values[fieldLayoutInfo.attrs.name] || '', onChange: function (e) { return fieldContext.onChange(e, 'onFieldChange'); }, onBlur: function (e) { return fieldContext.onBlur(e, 'onFieldBlur'); }, readOnly: formReadonly || fieldReadonly || readOnlyPermission, disabled: formDisabled || fieldDisabled, toggleMask: true })] }) }));
|
|
113
|
+
};
|
|
114
|
+
export var DefaultPasswordFormViewWidget = function (_a) {
|
|
115
|
+
var _b;
|
|
116
|
+
var formik = _a.formik, fieldContext = _a.fieldContext;
|
|
117
|
+
var fieldMetadata = fieldContext.fieldMetadata;
|
|
118
|
+
var fieldLayoutInfo = fieldContext.field;
|
|
119
|
+
var fieldLabel = (_b = fieldLayoutInfo.attrs.label) !== null && _b !== void 0 ? _b : fieldMetadata.displayName;
|
|
120
|
+
var _c = useState(false), isText = _c[0], setIsText = _c[1];
|
|
121
|
+
return (_jsxs("div", { className: "mt-2 flex-column gap-2", children: [_jsx("p", { className: "m-0 form-field-label font-medium", children: fieldLabel }), _jsxs("div", { className: "flex align-items-center gap-4", children: [_jsx("p", { className: "m-0", children: isText ? formik.values[fieldLayoutInfo.attrs.name] : "••••••••" }), _jsx("i", { className: "pi ".concat(isText ? 'pi-eye' : 'pi-eye-slash'), onClick: function () { return setIsText(!isText); }, style: { cursor: 'pointer' } })] })] }));
|
|
122
|
+
};
|
|
93
123
|
//# sourceMappingURL=SolidPasswordField.js.map
|