@kingteza/crud-component 1.0.4 → 1.0.5
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/App.d.ts +2 -0
- package/dist/_virtual/FileSaver.min.cjs +1 -0
- package/dist/_virtual/FileSaver.min.js +5 -1
- package/dist/_virtual/FileSaver.min2.cjs +1 -0
- package/dist/_virtual/FileSaver.min2.js +4 -1
- package/dist/_virtual/ShowMoreText.cjs +1 -0
- package/dist/_virtual/ShowMoreText.js +7 -1
- package/dist/_virtual/ShowMoreText2.cjs +1 -0
- package/dist/_virtual/ShowMoreText2.js +4 -1
- package/dist/_virtual/Truncate.cjs +1 -0
- package/dist/_virtual/Truncate.js +4 -1
- package/dist/_virtual/_commonjsHelpers.cjs +1 -0
- package/dist/_virtual/_commonjsHelpers.js +8 -1
- package/dist/_virtual/advancedFormat.cjs +1 -0
- package/dist/_virtual/advancedFormat.js +7 -1
- package/dist/_virtual/advancedFormat2.cjs +1 -0
- package/dist/_virtual/advancedFormat2.js +4 -1
- package/dist/_virtual/customParseFormat.cjs +1 -0
- package/dist/_virtual/customParseFormat.js +7 -1
- package/dist/_virtual/customParseFormat2.cjs +1 -0
- package/dist/_virtual/customParseFormat2.js +4 -1
- package/dist/_virtual/dayjs.min.cjs +1 -0
- package/dist/_virtual/dayjs.min.js +7 -1
- package/dist/_virtual/dayjs.min2.cjs +1 -0
- package/dist/_virtual/dayjs.min2.js +4 -1
- package/dist/_virtual/index.cjs +1 -0
- package/dist/_virtual/index.js +7 -1
- package/dist/_virtual/index10.cjs +1 -0
- package/dist/_virtual/index10.js +4 -1
- package/dist/_virtual/index2.cjs +1 -0
- package/dist/_virtual/index2.js +4 -1
- package/dist/_virtual/index3.cjs +1 -0
- package/dist/_virtual/index3.js +4 -1
- package/dist/_virtual/index4.cjs +1 -0
- package/dist/_virtual/index4.js +4 -1
- package/dist/_virtual/index5.cjs +1 -0
- package/dist/_virtual/index5.js +7 -1
- package/dist/_virtual/index6.cjs +1 -0
- package/dist/_virtual/index6.js +2 -1
- package/dist/_virtual/index7.cjs +1 -0
- package/dist/_virtual/index7.js +7 -1
- package/dist/_virtual/index8.cjs +1 -0
- package/dist/_virtual/index8.js +7 -1
- package/dist/_virtual/index9.cjs +1 -0
- package/dist/_virtual/index9.js +4 -1
- package/dist/_virtual/jsx-runtime.cjs +1 -0
- package/dist/_virtual/jsx-runtime.js +5 -1
- package/dist/_virtual/jsx-runtime2.cjs +1 -0
- package/dist/_virtual/jsx-runtime2.js +4 -1
- package/dist/_virtual/localeData.cjs +1 -0
- package/dist/_virtual/localeData.js +7 -1
- package/dist/_virtual/localeData2.cjs +1 -0
- package/dist/_virtual/localeData2.js +4 -1
- package/dist/_virtual/main.cjs +1 -0
- package/dist/_virtual/main.js +7 -1
- package/dist/_virtual/main2.cjs +1 -0
- package/dist/_virtual/main2.js +4 -1
- package/dist/_virtual/papaparse.min.cjs +1 -0
- package/dist/_virtual/papaparse.min.js +7 -1
- package/dist/_virtual/papaparse.min2.cjs +1 -0
- package/dist/_virtual/papaparse.min2.js +4 -1
- package/dist/_virtual/react-is.development.cjs +1 -0
- package/dist/_virtual/react-is.development.js +4 -1
- package/dist/_virtual/react-is.production.min.cjs +1 -0
- package/dist/_virtual/react-is.production.min.js +4 -1
- package/dist/_virtual/react-jsx-runtime.development.cjs +1 -0
- package/dist/_virtual/react-jsx-runtime.development.js +4 -1
- package/dist/_virtual/react-jsx-runtime.production.min.cjs +1 -0
- package/dist/_virtual/react-jsx-runtime.production.min.js +4 -1
- package/dist/_virtual/weekOfYear.cjs +1 -0
- package/dist/_virtual/weekOfYear.js +7 -1
- package/dist/_virtual/weekOfYear2.cjs +1 -0
- package/dist/_virtual/weekOfYear2.js +4 -1
- package/dist/_virtual/weekYear.cjs +1 -0
- package/dist/_virtual/weekYear.js +7 -1
- package/dist/_virtual/weekYear2.cjs +1 -0
- package/dist/_virtual/weekYear2.js +4 -1
- package/dist/_virtual/weekday.cjs +1 -0
- package/dist/_virtual/weekday.js +7 -1
- package/dist/_virtual/weekday2.cjs +1 -0
- package/dist/_virtual/weekday2.js +4 -1
- package/dist/common/index.cjs +1 -0
- package/dist/common/index.js +75 -1
- package/dist/components/common/DatePicker/DatePicker.d.ts +37 -0
- package/dist/components/common/DatePicker/TimePicker.d.ts +34 -0
- package/dist/components/common/DatePicker/index.d.ts +3 -0
- package/dist/components/common/appearance/Hider.d.ts +6 -0
- package/dist/components/common/appearance/index.d.ts +0 -0
- package/dist/components/common/button/Button.d.ts +12 -0
- package/dist/components/common/button/CloneButtonTable.d.ts +6 -0
- package/dist/components/common/button/DeleteButtonTable.d.ts +13 -0
- package/dist/components/common/button/ExportButton.d.ts +4 -0
- package/dist/components/common/button/HideButtonTable.d.ts +13 -0
- package/dist/components/common/button/ImportButton.d.ts +9 -0
- package/dist/components/common/button/NewButton.d.ts +12 -0
- package/dist/components/common/button/PrintButton.d.ts +12 -0
- package/dist/components/common/button/RefreshButton.d.ts +11 -0
- package/dist/components/common/button/UnHideButton.d.ts +14 -0
- package/dist/components/common/button/UpdateButtonTable.d.ts +6 -0
- package/dist/components/common/button/ViewButtonTable.d.ts +6 -0
- package/dist/components/common/button/index.d.ts +14 -0
- package/dist/components/common/check-box/CheckBox.d.ts +9 -0
- package/dist/components/common/check-box/index.d.ts +2 -0
- package/dist/components/common/description/DescList.d.ts +18 -0
- package/dist/components/common/description/DescriptionComponent.d.ts +7 -0
- package/dist/components/common/description/index.d.ts +3 -0
- package/dist/components/common/index.d.ts +22 -0
- package/dist/components/common/layout/VerticalSpace.d.ts +5 -0
- package/dist/components/common/layout/index.d.ts +2 -0
- package/dist/components/common/loading/LoadingIndicator.d.ts +6 -0
- package/dist/components/common/loading/index.d.ts +2 -0
- package/dist/components/common/picker/ImagePicker.d.ts +56 -0
- package/dist/components/common/picker/index.d.ts +2 -0
- package/dist/components/common/radio/RadioGroupComponent.d.ts +18 -0
- package/dist/components/common/radio/index.d.ts +2 -0
- package/dist/components/common/report/SelectFieldInReport.d.ts +16 -0
- package/dist/components/common/report/index.d.ts +3 -0
- package/dist/components/common/select/CustomSelectOption.d.ts +7 -0
- package/dist/components/common/select/SelectComponent.d.ts +21 -0
- package/dist/components/common/select/index.d.ts +3 -0
- package/dist/components/common/show-more/index.d.ts +4 -0
- package/dist/components/common/tab/TabViewWithRoute.d.ts +13 -0
- package/dist/components/common/tab/index.d.ts +2 -0
- package/dist/components/common/table/index.d.ts +3 -0
- package/dist/components/common/table/table.d.ts +19 -0
- package/dist/components/common/tag/StatusTag.d.ts +14 -0
- package/dist/components/common/tag/index.d.ts +2 -0
- package/dist/components/common/text/index.d.ts +3 -0
- package/dist/components/common/text/title/TitleWithHeadTitle.d.ts +7 -0
- package/dist/components/common/text/title/index.d.ts +1 -0
- package/dist/components/common/text-field/NumberField.d.ts +13 -0
- package/dist/components/common/text-field/PhoneNumberField.d.ts +4 -0
- package/dist/components/common/text-field/TextArea.d.ts +17 -0
- package/dist/components/common/text-field/TextField.d.ts +27 -0
- package/dist/components/common/text-field/index.d.ts +5 -0
- package/dist/components/common/tooltip/TooltipComponent.d.ts +5 -0
- package/dist/components/common/tooltip/index.d.ts +2 -0
- package/dist/components/common/wizard/WizardResult.d.ts +16 -0
- package/dist/components/common/wizard/WizardViewForm.d.ts +24 -0
- package/dist/components/common/wizard/index.d.ts +3 -0
- package/dist/components/crud/CrudComponent.d.ts +237 -0
- package/dist/components/crud/CrudField.d.ts +4 -0
- package/dist/components/crud/CrudForm.d.ts +14 -0
- package/dist/components/crud/CrudFormWizard.d.ts +14 -0
- package/dist/components/crud/CrudReportComponent.d.ts +44 -0
- package/dist/components/crud/CrudSearchComponent.d.ts +21 -0
- package/dist/components/crud/FileCrudField.d.ts +25 -0
- package/dist/components/crud/ImageCrudField.d.ts +38 -0
- package/dist/components/crud/import/CrudImportButton.d.ts +3 -0
- package/dist/components/crud/import/CrudImportComponent.d.ts +14 -0
- package/dist/components/crud/index.d.ts +15 -0
- package/dist/components/crud/view/CrudDecListView.d.ts +14 -0
- package/dist/components/crud/view/CrudViewer.d.ts +43 -0
- package/dist/components/crud/view/CrudViewerUtil.d.ts +2 -0
- package/dist/components/crud/view/index.d.ts +5 -0
- package/dist/context/WindowDimension.d.ts +4 -0
- package/dist/index.cjs +1 -0
- package/dist/index.d.ts +4 -63
- package/dist/index.js +32 -1
- package/dist/locale/hooks/translation-constants.d.ts +1 -0
- package/dist/locale/index.d.ts +69 -0
- package/dist/locale/translations/en.d.ts +58 -0
- package/dist/main.d.ts +0 -0
- package/dist/src/components/common/DatePicker/DatePicker.cjs +1 -0
- package/dist/src/components/common/DatePicker/DatePicker.js +88 -0
- package/dist/src/components/common/DatePicker/TimePicker.cjs +1 -0
- package/dist/src/components/common/DatePicker/TimePicker.js +78 -0
- package/dist/src/components/common/appearance/Hider.cjs +1 -0
- package/dist/src/components/common/appearance/Hider.js +5 -0
- package/dist/src/components/common/button/Button.cjs +1 -0
- package/dist/src/components/common/button/Button.js +64 -0
- package/dist/src/components/common/button/CloneButtonTable.cjs +1 -0
- package/dist/src/components/common/button/CloneButtonTable.js +20 -0
- package/dist/src/components/common/button/DeleteButtonTable.cjs +1 -0
- package/dist/src/components/common/button/DeleteButtonTable.js +68 -0
- package/dist/src/components/common/button/ExportButton.cjs +1 -0
- package/dist/src/components/common/button/ExportButton.js +27 -0
- package/dist/src/components/common/button/HideButtonTable.cjs +1 -0
- package/dist/src/components/common/button/HideButtonTable.js +68 -0
- package/dist/src/components/common/button/ImportButton.cjs +1 -0
- package/dist/src/components/common/button/ImportButton.js +56 -0
- package/dist/src/components/common/button/NewButton.cjs +1 -0
- package/dist/src/components/common/button/NewButton.js +24 -0
- package/dist/src/components/common/button/PrintButton.cjs +1 -0
- package/dist/src/components/common/button/PrintButton.js +26 -0
- package/dist/src/components/common/button/RefreshButton.cjs +1 -0
- package/dist/src/components/common/button/RefreshButton.js +24 -0
- package/dist/src/components/common/button/UnHideButton.cjs +1 -0
- package/dist/src/components/common/button/UnHideButton.js +70 -0
- package/dist/src/components/common/button/UpdateButtonTable.cjs +1 -0
- package/dist/src/components/common/button/UpdateButtonTable.js +20 -0
- package/dist/src/components/common/button/ViewButtonTable.cjs +1 -0
- package/dist/src/components/common/button/ViewButtonTable.js +20 -0
- package/dist/src/components/common/check-box/CheckBox.cjs +1 -0
- package/dist/src/components/common/check-box/CheckBox.js +40 -0
- package/dist/src/components/common/description/DescList.cjs +1 -0
- package/dist/src/components/common/description/DescList.js +16 -0
- package/dist/src/components/common/layout/VerticalSpace.cjs +1 -0
- package/dist/src/components/common/layout/VerticalSpace.js +6 -0
- package/dist/src/components/common/loading/LoadingIndicator.cjs +1 -0
- package/dist/src/components/common/loading/LoadingIndicator.js +24 -0
- package/dist/src/components/common/picker/ImagePicker.cjs +1 -0
- package/dist/src/components/common/picker/ImagePicker.js +285 -0
- package/dist/src/components/common/radio/RadioGroupComponent.cjs +1 -0
- package/dist/src/components/common/radio/RadioGroupComponent.js +19 -0
- package/dist/src/components/common/report/SelectFieldInReport.cjs +1 -0
- package/dist/src/components/common/report/SelectFieldInReport.js +30 -0
- package/dist/src/components/common/select/CustomSelectOption.cjs +1 -0
- package/dist/src/components/common/select/CustomSelectOption.js +13 -0
- package/dist/src/components/common/select/SelectComponent.cjs +1 -0
- package/dist/src/components/common/select/SelectComponent.js +89 -0
- package/dist/src/components/common/show-more/index.cjs +1 -0
- package/dist/src/components/common/show-more/index.js +8 -0
- package/dist/src/components/common/tab/TabViewWithRoute.cjs +1 -0
- package/dist/src/components/common/tab/TabViewWithRoute.js +37 -0
- package/dist/src/components/common/table/table.cjs +1 -0
- package/dist/src/components/common/table/table.js +40 -0
- package/dist/src/components/common/tag/StatusTag.cjs +1 -0
- package/dist/src/components/common/tag/StatusTag.js +30 -0
- package/dist/src/components/common/text/index.js +5 -0
- package/dist/src/components/common/text/title/index.js +5 -0
- package/dist/src/components/common/text-field/NumberField.cjs +1 -0
- package/dist/src/components/common/text-field/NumberField.js +83 -0
- package/dist/src/components/common/text-field/PhoneNumberField.cjs +1 -0
- package/dist/src/components/common/text-field/PhoneNumberField.js +18 -0
- package/dist/src/components/common/text-field/TextArea.cjs +1 -0
- package/dist/src/components/common/text-field/TextArea.js +47 -0
- package/dist/src/components/common/text-field/TextField.cjs +1 -0
- package/dist/src/components/common/text-field/TextField.js +73 -0
- package/dist/src/components/common/tooltip/TooltipComponent.cjs +1 -0
- package/dist/src/components/common/tooltip/TooltipComponent.js +9 -0
- package/dist/src/components/common/wizard/WizardResult.cjs +1 -0
- package/dist/src/components/common/wizard/WizardResult.js +61 -0
- package/dist/src/components/common/wizard/WizardViewForm.cjs +1 -0
- package/dist/src/components/common/wizard/WizardViewForm.js +74 -0
- package/dist/src/components/crud/CrudComponent.cjs +1 -0
- package/dist/src/components/crud/CrudComponent.js +210 -0
- package/dist/src/components/crud/CrudField.cjs +1 -0
- package/dist/src/components/crud/CrudField.js +459 -0
- package/dist/src/components/crud/CrudForm.cjs +1 -0
- package/dist/src/components/crud/CrudForm.js +91 -0
- package/dist/src/components/crud/CrudFormWizard.cjs +1 -0
- package/dist/src/components/crud/CrudFormWizard.js +142 -0
- package/dist/src/components/crud/CrudReportComponent.cjs +4 -0
- package/dist/src/components/crud/CrudReportComponent.js +255 -0
- package/dist/src/components/crud/CrudSearchComponent.cjs +1 -0
- package/dist/src/components/crud/CrudSearchComponent.js +95 -0
- package/dist/src/components/crud/FileCrudField.cjs +1 -0
- package/dist/src/components/crud/FileCrudField.js +227 -0
- package/dist/src/components/crud/ImageCrudField.cjs +1 -0
- package/dist/src/components/crud/ImageCrudField.js +113 -0
- package/dist/src/components/crud/import/CrudImportButton.cjs +1 -0
- package/dist/src/components/crud/import/CrudImportButton.js +31 -0
- package/dist/{components/crud/import/CrudImportComponent.js → src/components/crud/import/CrudImportComponent.cjs} +1 -1
- package/dist/src/components/crud/import/CrudImportComponent.js +222 -0
- package/dist/src/components/crud/view/CrudDecListView.cjs +1 -0
- package/dist/src/components/crud/view/CrudDecListView.js +42 -0
- package/dist/src/components/crud/view/CrudViewer.cjs +1 -0
- package/dist/src/components/crud/view/CrudViewer.js +217 -0
- package/dist/src/components/crud/view/CrudViewerUtil.cjs +1 -0
- package/dist/src/components/crud/view/CrudViewerUtil.js +58 -0
- package/dist/src/context/WindowDimension.cjs +1 -0
- package/dist/src/context/WindowDimension.js +8 -0
- package/dist/src/locale/hooks/translation-constants.js +4 -0
- package/dist/src/locale/index.cjs +1 -0
- package/dist/src/locale/index.js +33 -0
- package/dist/src/locale/translations/en.js +60 -0
- package/dist/src/util/DateUtil.cjs +1 -0
- package/dist/src/util/DateUtil.js +6 -0
- package/dist/src/util/ImageUtil.cjs +1 -0
- package/dist/src/util/ImageUtil.js +63 -0
- package/dist/src/util/NumberUtil.js +60 -0
- package/dist/src/util/ValidationUtil.cjs +1 -0
- package/dist/src/util/ValidationUtil.js +60 -0
- package/dist/types/DialogComponentProp.d.ts +8 -0
- package/dist/types/Id.d.ts +10 -0
- package/dist/util/DateUtil.d.ts +7 -0
- package/dist/util/ImageUtil.d.ts +14 -0
- package/dist/util/NumberUtil.d.ts +17 -0
- package/dist/util/ValidationUtil.d.ts +14 -0
- package/dist/util/index.cjs +1 -0
- package/dist/util/index.js +10 -1
- package/dist/vite-env.d.ts +1 -0
- package/package.json +1 -1
- package/dist/components/common/DatePicker/DatePicker.js +0 -1
- package/dist/components/common/DatePicker/TimePicker.js +0 -1
- package/dist/components/common/appearance/Hider.js +0 -1
- package/dist/components/common/button/Button.js +0 -1
- package/dist/components/common/button/CloneButtonTable.js +0 -1
- package/dist/components/common/button/DeleteButtonTable.js +0 -1
- package/dist/components/common/button/ExportButton.js +0 -1
- package/dist/components/common/button/HideButtonTable.js +0 -1
- package/dist/components/common/button/ImportButton.js +0 -1
- package/dist/components/common/button/NewButton.js +0 -1
- package/dist/components/common/button/PrintButton.js +0 -1
- package/dist/components/common/button/RefreshButton.js +0 -1
- package/dist/components/common/button/UnHideButton.js +0 -1
- package/dist/components/common/button/UpdateButtonTable.js +0 -1
- package/dist/components/common/button/ViewButtonTable.js +0 -1
- package/dist/components/common/check-box/CheckBox.js +0 -1
- package/dist/components/common/description/DescList.js +0 -1
- package/dist/components/common/layout/VerticalSpace.js +0 -1
- package/dist/components/common/loading/LoadingIndicator.js +0 -1
- package/dist/components/common/picker/ImagePicker.js +0 -1
- package/dist/components/common/radio/RadioGroupComponent.js +0 -1
- package/dist/components/common/report/SelectFieldInReport.js +0 -1
- package/dist/components/common/select/CustomSelectOption.js +0 -1
- package/dist/components/common/select/SelectComponent.js +0 -1
- package/dist/components/common/show-more/index.js +0 -1
- package/dist/components/common/tab/TabViewWithRoute.js +0 -1
- package/dist/components/common/table/table.js +0 -1
- package/dist/components/common/tag/StatusTag.js +0 -1
- package/dist/components/common/text-field/NumberField.js +0 -1
- package/dist/components/common/text-field/PhoneNumberField.js +0 -1
- package/dist/components/common/text-field/TextArea.js +0 -1
- package/dist/components/common/text-field/TextField.js +0 -1
- package/dist/components/common/tooltip/TooltipComponent.js +0 -1
- package/dist/components/common/wizard/WizardResult.js +0 -1
- package/dist/components/common/wizard/WizardViewForm.js +0 -1
- package/dist/components/crud/CrudComponent.js +0 -1
- package/dist/components/crud/CrudField.js +0 -1
- package/dist/components/crud/CrudForm.js +0 -1
- package/dist/components/crud/CrudFormWizard.js +0 -1
- package/dist/components/crud/CrudReportComponent.js +0 -4
- package/dist/components/crud/CrudSearchComponent.js +0 -1
- package/dist/components/crud/FileCrudField.js +0 -1
- package/dist/components/crud/ImageCrudField.js +0 -1
- package/dist/components/crud/import/CrudImportButton.js +0 -1
- package/dist/components/crud/view/CrudDecListView.js +0 -1
- package/dist/components/crud/view/CrudViewer.js +0 -1
- package/dist/components/crud/view/CrudViewerUtil.js +0 -1
- package/dist/context/WindowDimension.js +0 -1
- package/dist/locale/index.js +0 -1
- package/dist/util/DateUtil.js +0 -1
- package/dist/util/ImageUtil.js +0 -1
- package/dist/util/ValidationUtil.js +0 -1
- /package/dist/{components/common/text/index.js → src/components/common/text/index.cjs} +0 -0
- /package/dist/{components/common/text/title/index.js → src/components/common/text/title/index.cjs} +0 -0
- /package/dist/{locale/hooks/translation-constants.js → src/locale/hooks/translation-constants.cjs} +0 -0
- /package/dist/{locale/translations/en.js → src/locale/translations/en.cjs} +0 -0
- /package/dist/{util/NumberUtil.js → src/util/NumberUtil.cjs} +0 -0
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
"use strict";const t=require("../../../_virtual/jsx-runtime.cjs"),r=require("antd"),a=require("react"),y=require("./CrudField.cjs"),H=require("./view/CrudViewer.cjs"),I=require("../common/button/Button.cjs"),J=require("../common/button/PrintButton.cjs"),K=require("../common/report/SelectFieldInReport.cjs"),M=require("../common/select/SelectComponent.cjs"),v=require("./view/CrudViewerUtil.cjs"),Q=require("../../../node_modules/@ant-design/icons/es/icons/FileExcelOutlined.cjs"),V={lg:6,md:8,sm:12,xs:24},W={lg:12,md:16,sm:24,xs:24};function X({fields:u,data:d,idField:A,loadingData:p,onSubmit:S,paginateProps:L,size:G,onClickPrint:f,onClickExcelExport:R,minusHeight:O,extraSearchFields:g,searchOnMount:E,summary:U}){const{searchable:_,selectable:m,sortable:B,defaultSort:c}=a.useMemo(()=>{var j,x,C,N,T;const e=[],s=[],l=[];let n;for(const o of u.filter(D=>!D.hidden))o.type==="image"||!o.report||((j=o.report)!=null&&j.searchable&&e.push(o),(x=o.report)!=null&&x.sortable&&(s.push(o),!n&&((C=o.report)!=null&&C.defaultSort)&&(n=o)),o.hideInTable||l.push({id:o.name,label:o.label,lock:(N=o.report)==null?void 0:N.lock,alreadySelected:(T=o.report)==null?void 0:T.alreadySelected}));return{defaultSort:n,searchable:e,sortable:s,selectable:l}},[u]),[b,F]=a.useState([]),h=a.useCallback(async({sortBy:e,sortByType:s,showFields:l=[],...n})=>{const j=[];e&&j.push({field:e,sort:s??"DESC"}),F(u.filter(x=>l.includes(x.name)).map(x=>({...x,hideInTable:!1}))),S({showFields:l,sortBy:j,...n})},[u,S]),[i]=r.Form.useForm(),[w,$]=a.useState(!1),[q,z]=a.useState(!0);return a.useEffect(()=>{if(E&&q){const e=setTimeout(()=>{i.validateFields().then(s=>{h(s)}),z(!1)},200);return()=>clearTimeout(e)}},[h,i,q,E]),a.useEffect(()=>{var s,l,n;!i.getFieldValue("sortBy")&&c&&(console.log((s=c.report)==null?void 0:s.defaultSort),i.setFieldsValue({sortBy:c.name,sortByType:typeof((l=c.report)==null?void 0:l.defaultSort)=="string"?(n=c.report)==null?void 0:n.defaultSort:"ASC"}))},[c,i]),a.useEffect(()=>{if(w){const e=m.filter(s=>s.alreadySelected).map(s=>s.id);F(u.filter(s=>e.includes(s.name)).map(s=>({...s,hideInTable:!1}))),$(!1)}},[u,w,m]),t.jsxRuntimeExports.jsx(t.jsxRuntimeExports.Fragment,{children:t.jsxRuntimeExports.jsxs(r.Space,{className:"w-100",direction:"vertical",children:[t.jsxRuntimeExports.jsxs(r.Form,{form:i,layout:"vertical",onFinish:h,children:[t.jsxRuntimeExports.jsxs(r.Row,{gutter:[8,8],children:[_.map(e=>{var s,l,n;return t.jsxRuntimeExports.jsx(r.Col,{...e.grid??V,style:{alignSelf:"end"},children:(s=e.report)!=null&&s.customRender?e.report.customRender(i):e.type==="date"?t.jsxRuntimeExports.jsx(y.default,{...e,type:"date",range:(l=e.report)==null?void 0:l.range,required:!!((n=e.report)!=null&&n.required),readonly:!1,fieldClassName:"mb-0"}):e.type==="select"?t.jsxRuntimeExports.jsx(y.default,{...e,type:"select",multiple:!0,required:!1,readonly:!1,fieldClassName:"mb-0"}):t.jsxRuntimeExports.jsx(y.default,{...e,readonly:!1,required:!1,fieldClassName:"mb-0"})},e.name)}),!!(m!=null&&m.length)&&t.jsxRuntimeExports.jsx(r.Col,{...W,children:t.jsxRuntimeExports.jsx(K.SelectFieldInReport,{items:m,name:"showFields",mode:"multiple",label:"Show Fields",className:"mb-0"})}),!!B.length&&t.jsxRuntimeExports.jsx(r.Col,{...V,children:t.jsxRuntimeExports.jsx(M,{label:"Sort By",name:"sortBy",items:B.map(e=>({id:e.name,label:e.label})),nameFieldInArray:"label",fieldId:"id",className:"mb-0",dropdownRender:e=>t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[e,t.jsxRuntimeExports.jsx(r.Form.Item,{name:"sortByType",noStyle:!0,className:"mt-3",children:t.jsxRuntimeExports.jsx(r.Radio.Group,{className:"w-100",defaultValue:"DESC",optionType:"button",children:t.jsxRuntimeExports.jsxs(r.Row,{children:[t.jsxRuntimeExports.jsx(r.Col,{xs:12,children:t.jsxRuntimeExports.jsx(r.Radio,{className:"w-100",style:{borderTopRightRadius:0,borderBottomRightRadius:0},value:"ASC",children:"Ascending"})}),t.jsxRuntimeExports.jsx(r.Col,{xs:12,children:t.jsxRuntimeExports.jsx(r.Radio,{className:"w-100",style:{borderTopLeftRadius:0,borderBottomLeftRadius:0},value:"DESC",children:"Descending"})})]})})})]})})}),g?g(i):null]}),t.jsxRuntimeExports.jsx(I,{className:"mt-3",type:"primary",block:!0,htmlType:"submit",disabled:p,children:"Submit"})]}),t.jsxRuntimeExports.jsxs(r.Space,{children:[!!f&&t.jsxRuntimeExports.jsx(J.PrintButton,{disabled:p||!d.length,onClick:()=>f==null?void 0:f({tableId:"#crud-table table",data:d,fields:b.map(e=>({...e,render:v.getRendererValueCrudViewer(e)}))})}),!!R&&t.jsxRuntimeExports.jsx(I,{disabled:p||!d.length,onClick:()=>R==null?void 0:R({tableId:"#crud-table table",data:d,fields:b.map(e=>({...e,render:v.getRendererValueCrudViewer(e)}))}),icon:t.jsxRuntimeExports.jsx(Q,{}),className:`group
|
|
2
|
+
${p||!d.length?"":"!bg-green-700 hover:!bg-green-600 !text-white !border-green-700 hover:!border-green-600"}
|
|
3
|
+
|
|
4
|
+
`,children:"Excel"})]}),U,t.jsxRuntimeExports.jsx(H,{minusHeight:O,data:d,size:G,fields:b,idField:A,loadingData:p,paginateProps:L,viewable:!1})]})})}module.exports=X;
|
|
@@ -0,0 +1,255 @@
|
|
|
1
|
+
import { j as r } from "../../../_virtual/jsx-runtime.js";
|
|
2
|
+
import { Form as j, Space as L, Row as G, Col as f, Radio as S } from "antd";
|
|
3
|
+
import { useMemo as X, useState as x, useCallback as Y, useEffect as B } from "react";
|
|
4
|
+
import R from "./CrudField.js";
|
|
5
|
+
import Z from "./view/CrudViewer.js";
|
|
6
|
+
import _ from "../common/button/Button.js";
|
|
7
|
+
import { PrintButton as k } from "../common/button/PrintButton.js";
|
|
8
|
+
import { SelectFieldInReport as E } from "../common/report/SelectFieldInReport.js";
|
|
9
|
+
import P from "../common/select/SelectComponent.js";
|
|
10
|
+
import { getRendererValueCrudViewer as $ } from "./view/CrudViewerUtil.js";
|
|
11
|
+
import ee from "../../../node_modules/@ant-design/icons/es/icons/FileExcelOutlined.js";
|
|
12
|
+
const z = { lg: 6, md: 8, sm: 12, xs: 24 }, re = { lg: 12, md: 16, sm: 24, xs: 24 };
|
|
13
|
+
function pe({
|
|
14
|
+
fields: n,
|
|
15
|
+
data: d,
|
|
16
|
+
idField: D,
|
|
17
|
+
loadingData: c,
|
|
18
|
+
onSubmit: w,
|
|
19
|
+
paginateProps: H,
|
|
20
|
+
size: J,
|
|
21
|
+
onClickPrint: b,
|
|
22
|
+
onClickExcelExport: h,
|
|
23
|
+
minusHeight: K,
|
|
24
|
+
extraSearchFields: F,
|
|
25
|
+
searchOnMount: N,
|
|
26
|
+
summary: M
|
|
27
|
+
}) {
|
|
28
|
+
const { searchable: O, selectable: i, sortable: T, defaultSort: m } = X(() => {
|
|
29
|
+
var p, u, V, q, A;
|
|
30
|
+
const e = [], t = [], l = [];
|
|
31
|
+
let o;
|
|
32
|
+
for (const s of n.filter((W) => !W.hidden))
|
|
33
|
+
s.type === "image" || !s.report || ((p = s.report) != null && p.searchable && e.push(s), (u = s.report) != null && u.sortable && (t.push(s), !o && ((V = s.report) != null && V.defaultSort) && (o = s)), s.hideInTable || l.push({
|
|
34
|
+
id: s.name,
|
|
35
|
+
label: s.label,
|
|
36
|
+
lock: (q = s.report) == null ? void 0 : q.lock,
|
|
37
|
+
alreadySelected: (A = s.report) == null ? void 0 : A.alreadySelected
|
|
38
|
+
}));
|
|
39
|
+
return {
|
|
40
|
+
defaultSort: o,
|
|
41
|
+
searchable: e,
|
|
42
|
+
sortable: t,
|
|
43
|
+
selectable: l
|
|
44
|
+
};
|
|
45
|
+
}, [n]), [y, I] = x(
|
|
46
|
+
[]
|
|
47
|
+
), g = Y(
|
|
48
|
+
async ({
|
|
49
|
+
sortBy: e,
|
|
50
|
+
sortByType: t,
|
|
51
|
+
showFields: l = [],
|
|
52
|
+
...o
|
|
53
|
+
}) => {
|
|
54
|
+
const p = [];
|
|
55
|
+
e && p.push({
|
|
56
|
+
field: e,
|
|
57
|
+
sort: t ?? "DESC"
|
|
58
|
+
}), I(
|
|
59
|
+
n.filter((u) => l.includes(u.name)).map((u) => ({ ...u, hideInTable: !1 }))
|
|
60
|
+
), w({ showFields: l, sortBy: p, ...o });
|
|
61
|
+
},
|
|
62
|
+
[n, w]
|
|
63
|
+
), [a] = j.useForm(), [v, Q] = x(!1), [C, U] = x(!0);
|
|
64
|
+
return B(() => {
|
|
65
|
+
if (N && C) {
|
|
66
|
+
const e = setTimeout(() => {
|
|
67
|
+
a.validateFields().then((t) => {
|
|
68
|
+
g(t);
|
|
69
|
+
}), U(!1);
|
|
70
|
+
}, 200);
|
|
71
|
+
return () => clearTimeout(e);
|
|
72
|
+
}
|
|
73
|
+
}, [g, a, C, N]), B(() => {
|
|
74
|
+
var t, l, o;
|
|
75
|
+
!a.getFieldValue("sortBy") && m && (console.log((t = m.report) == null ? void 0 : t.defaultSort), a.setFieldsValue({
|
|
76
|
+
sortBy: m.name,
|
|
77
|
+
sortByType: typeof ((l = m.report) == null ? void 0 : l.defaultSort) == "string" ? (o = m.report) == null ? void 0 : o.defaultSort : "ASC"
|
|
78
|
+
}));
|
|
79
|
+
}, [m, a]), B(() => {
|
|
80
|
+
if (v) {
|
|
81
|
+
const e = i.filter((t) => t.alreadySelected).map((t) => t.id);
|
|
82
|
+
I(
|
|
83
|
+
n.filter((t) => e.includes(t.name)).map((t) => ({ ...t, hideInTable: !1 }))
|
|
84
|
+
), Q(!1);
|
|
85
|
+
}
|
|
86
|
+
}, [n, v, i]), /* @__PURE__ */ r.jsx(r.Fragment, { children: /* @__PURE__ */ r.jsxs(L, { className: "w-100", direction: "vertical", children: [
|
|
87
|
+
/* @__PURE__ */ r.jsxs(j, { form: a, layout: "vertical", onFinish: g, children: [
|
|
88
|
+
/* @__PURE__ */ r.jsxs(G, { gutter: [8, 8], children: [
|
|
89
|
+
O.map((e) => {
|
|
90
|
+
var t, l, o;
|
|
91
|
+
return /* @__PURE__ */ r.jsx(
|
|
92
|
+
f,
|
|
93
|
+
{
|
|
94
|
+
...e.grid ?? z,
|
|
95
|
+
style: { alignSelf: "end" },
|
|
96
|
+
children: (t = e.report) != null && t.customRender ? e.report.customRender(a) : e.type === "date" ? /* @__PURE__ */ r.jsx(
|
|
97
|
+
R,
|
|
98
|
+
{
|
|
99
|
+
...e,
|
|
100
|
+
type: "date",
|
|
101
|
+
range: (l = e.report) == null ? void 0 : l.range,
|
|
102
|
+
required: !!((o = e.report) != null && o.required),
|
|
103
|
+
readonly: !1,
|
|
104
|
+
fieldClassName: "mb-0"
|
|
105
|
+
}
|
|
106
|
+
) : e.type === "select" ? /* @__PURE__ */ r.jsx(
|
|
107
|
+
R,
|
|
108
|
+
{
|
|
109
|
+
...e,
|
|
110
|
+
type: "select",
|
|
111
|
+
multiple: !0,
|
|
112
|
+
required: !1,
|
|
113
|
+
readonly: !1,
|
|
114
|
+
fieldClassName: "mb-0"
|
|
115
|
+
}
|
|
116
|
+
) : /* @__PURE__ */ r.jsx(
|
|
117
|
+
R,
|
|
118
|
+
{
|
|
119
|
+
...e,
|
|
120
|
+
readonly: !1,
|
|
121
|
+
required: !1,
|
|
122
|
+
fieldClassName: "mb-0"
|
|
123
|
+
}
|
|
124
|
+
)
|
|
125
|
+
},
|
|
126
|
+
e.name
|
|
127
|
+
);
|
|
128
|
+
}),
|
|
129
|
+
!!(i != null && i.length) && /* @__PURE__ */ r.jsx(f, { ...re, children: /* @__PURE__ */ r.jsx(
|
|
130
|
+
E,
|
|
131
|
+
{
|
|
132
|
+
items: i,
|
|
133
|
+
name: "showFields",
|
|
134
|
+
mode: "multiple",
|
|
135
|
+
label: "Show Fields",
|
|
136
|
+
className: "mb-0"
|
|
137
|
+
}
|
|
138
|
+
) }),
|
|
139
|
+
!!T.length && /* @__PURE__ */ r.jsx(f, { ...z, children: /* @__PURE__ */ r.jsx(
|
|
140
|
+
P,
|
|
141
|
+
{
|
|
142
|
+
label: "Sort By",
|
|
143
|
+
name: "sortBy",
|
|
144
|
+
items: T.map((e) => ({ id: e.name, label: e.label })),
|
|
145
|
+
nameFieldInArray: "label",
|
|
146
|
+
fieldId: "id",
|
|
147
|
+
className: "mb-0",
|
|
148
|
+
dropdownRender: (e) => /* @__PURE__ */ r.jsxs(r.Fragment, { children: [
|
|
149
|
+
e,
|
|
150
|
+
/* @__PURE__ */ r.jsx(j.Item, { name: "sortByType", noStyle: !0, className: "mt-3", children: /* @__PURE__ */ r.jsx(
|
|
151
|
+
S.Group,
|
|
152
|
+
{
|
|
153
|
+
className: "w-100",
|
|
154
|
+
defaultValue: "DESC",
|
|
155
|
+
optionType: "button",
|
|
156
|
+
children: /* @__PURE__ */ r.jsxs(G, { children: [
|
|
157
|
+
/* @__PURE__ */ r.jsx(f, { xs: 12, children: /* @__PURE__ */ r.jsx(
|
|
158
|
+
S,
|
|
159
|
+
{
|
|
160
|
+
className: "w-100",
|
|
161
|
+
style: {
|
|
162
|
+
borderTopRightRadius: 0,
|
|
163
|
+
borderBottomRightRadius: 0
|
|
164
|
+
},
|
|
165
|
+
value: "ASC",
|
|
166
|
+
children: "Ascending"
|
|
167
|
+
}
|
|
168
|
+
) }),
|
|
169
|
+
/* @__PURE__ */ r.jsx(f, { xs: 12, children: /* @__PURE__ */ r.jsx(
|
|
170
|
+
S,
|
|
171
|
+
{
|
|
172
|
+
className: "w-100",
|
|
173
|
+
style: {
|
|
174
|
+
borderTopLeftRadius: 0,
|
|
175
|
+
borderBottomLeftRadius: 0
|
|
176
|
+
},
|
|
177
|
+
value: "DESC",
|
|
178
|
+
children: "Descending"
|
|
179
|
+
}
|
|
180
|
+
) })
|
|
181
|
+
] })
|
|
182
|
+
}
|
|
183
|
+
) })
|
|
184
|
+
] })
|
|
185
|
+
}
|
|
186
|
+
) }),
|
|
187
|
+
F ? F(a) : null
|
|
188
|
+
] }),
|
|
189
|
+
/* @__PURE__ */ r.jsx(
|
|
190
|
+
_,
|
|
191
|
+
{
|
|
192
|
+
className: "mt-3",
|
|
193
|
+
type: "primary",
|
|
194
|
+
block: !0,
|
|
195
|
+
htmlType: "submit",
|
|
196
|
+
disabled: c,
|
|
197
|
+
children: "Submit"
|
|
198
|
+
}
|
|
199
|
+
)
|
|
200
|
+
] }),
|
|
201
|
+
/* @__PURE__ */ r.jsxs(L, { children: [
|
|
202
|
+
!!b && /* @__PURE__ */ r.jsx(
|
|
203
|
+
k,
|
|
204
|
+
{
|
|
205
|
+
disabled: c || !d.length,
|
|
206
|
+
onClick: () => b == null ? void 0 : b({
|
|
207
|
+
tableId: "#crud-table table",
|
|
208
|
+
data: d,
|
|
209
|
+
fields: y.map((e) => ({
|
|
210
|
+
...e,
|
|
211
|
+
render: $(e)
|
|
212
|
+
}))
|
|
213
|
+
})
|
|
214
|
+
}
|
|
215
|
+
),
|
|
216
|
+
!!h && /* @__PURE__ */ r.jsx(
|
|
217
|
+
_,
|
|
218
|
+
{
|
|
219
|
+
disabled: c || !d.length,
|
|
220
|
+
onClick: () => h == null ? void 0 : h({
|
|
221
|
+
tableId: "#crud-table table",
|
|
222
|
+
data: d,
|
|
223
|
+
fields: y.map((e) => ({
|
|
224
|
+
...e,
|
|
225
|
+
render: $(e)
|
|
226
|
+
}))
|
|
227
|
+
}),
|
|
228
|
+
icon: /* @__PURE__ */ r.jsx(ee, {}),
|
|
229
|
+
className: `group
|
|
230
|
+
${c || !d.length ? "" : "!bg-green-700 hover:!bg-green-600 !text-white !border-green-700 hover:!border-green-600"}
|
|
231
|
+
|
|
232
|
+
`,
|
|
233
|
+
children: "Excel"
|
|
234
|
+
}
|
|
235
|
+
)
|
|
236
|
+
] }),
|
|
237
|
+
M,
|
|
238
|
+
/* @__PURE__ */ r.jsx(
|
|
239
|
+
Z,
|
|
240
|
+
{
|
|
241
|
+
minusHeight: K,
|
|
242
|
+
data: d,
|
|
243
|
+
size: J,
|
|
244
|
+
fields: y,
|
|
245
|
+
idField: D,
|
|
246
|
+
loadingData: c,
|
|
247
|
+
paginateProps: H,
|
|
248
|
+
viewable: !1
|
|
249
|
+
}
|
|
250
|
+
)
|
|
251
|
+
] }) });
|
|
252
|
+
}
|
|
253
|
+
export {
|
|
254
|
+
pe as default
|
|
255
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const e=require("../../../_virtual/jsx-runtime.cjs"),o=require("react"),i=require("antd"),y=require("./CrudField.cjs"),q=require("../common/button/Button.cjs"),w=require("../../../node_modules/@ant-design/icons/es/icons/SearchOutlined.cjs");function M({searchFields:t=[],fields:m,searchOnChange:j,onSearch:x,searchDefaultValues:b,searchFieldsCustomColumnProps:g}){const R=o.useMemo(()=>t.map(n=>typeof n=="string"?{...m.find(E=>n===E.name),required:!1}:{...m.find(l=>(n==null?void 0:n.name)===l.name),...n}).filter(n=>n&&!(n!=null&&n.hidden)),[t,m]),p=o.useMemo(()=>t.length===1?{field:22,button:2}:t.length===2?{field:11,button:2}:t.length===3?{field:6,button:6}:t.length===4?{field:5,button:4}:t.length===5?{field:4,button:4}:{field:4,button:4},[t.length]),d=o.useMemo(()=>t.length===1?{field:22,button:2}:t.length===2?{field:11,button:2}:t.length===3?{field:6,button:6}:t.length===4?{field:5,button:4}:t.length===5?{field:4,button:4}:{field:4,button:4},[t.length]),s=o.useMemo(()=>t.length===1?{field:21,button:3}:t.length===2?{field:11,button:2}:t.length===3?{field:24,button:24}:t.length===4?{field:5,button:4}:t.length===5?{field:4,button:4}:{field:4,button:4},[t.length]),[u]=i.Form.useForm(),r=o.useCallback(async n=>{if((n||j)&&x){const f=await u.validateFields();x(f)}},[u,x,j]);return o.useEffect(()=>{b&&(u.setFieldsValue(b),r(!0))},[u,b]),t!=null&&t.length?e.jsxRuntimeExports.jsx(i.Form,{form:u,onFinish:()=>r(!0),layout:"vertical",className:"mb-2",onChange:()=>r(!1),children:e.jsxRuntimeExports.jsxs(i.Row,{gutter:[4,8],className:"w-100",children:[R.map((n,f)=>{const l=(g==null?void 0:g[f])??{md:p.field,sm:d.field,xs:s.field};return o.createElement(i.Col,{...l,key:`search_field_${String(n.name)}`,className:"align-self-end"},e.jsxRuntimeExports.jsx(y.default,{...n,readonly:!1,fieldClassName:"mb-0"}))}),e.jsxRuntimeExports.jsx(i.Col,{md:p.button,sm:d.button,xs:s.button,style:{alignSelf:"end"},children:e.jsxRuntimeExports.jsx(q,{type:"primary",htmlType:"submit",block:!0,icon:e.jsxRuntimeExports.jsx(w,{})})})]})}):e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{})}module.exports=M;
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { j as o } from "../../../_virtual/jsx-runtime.js";
|
|
2
|
+
import { useMemo as l, useCallback as E, useEffect as R, createElement as a } from "react";
|
|
3
|
+
import { Form as y, Row as v, Col as w } from "antd";
|
|
4
|
+
import _ from "./CrudField.js";
|
|
5
|
+
import q from "../common/button/Button.js";
|
|
6
|
+
import B from "../../../node_modules/@ant-design/icons/es/icons/SearchOutlined.js";
|
|
7
|
+
function A({
|
|
8
|
+
searchFields: t = [],
|
|
9
|
+
fields: e,
|
|
10
|
+
searchOnChange: r,
|
|
11
|
+
onSearch: b,
|
|
12
|
+
searchDefaultValues: g,
|
|
13
|
+
searchFieldsCustomColumnProps: i
|
|
14
|
+
}) {
|
|
15
|
+
const N = l(
|
|
16
|
+
() => t.map((n) => typeof n == "string" ? {
|
|
17
|
+
...e.find((k) => n === k.name),
|
|
18
|
+
required: !1
|
|
19
|
+
} : {
|
|
20
|
+
...e.find(
|
|
21
|
+
(u) => (n == null ? void 0 : n.name) === u.name
|
|
22
|
+
),
|
|
23
|
+
...n
|
|
24
|
+
}).filter((n) => n && !(n != null && n.hidden)),
|
|
25
|
+
[t, e]
|
|
26
|
+
), x = l(
|
|
27
|
+
() => t.length === 1 ? { field: 22, button: 2 } : t.length === 2 ? { field: 11, button: 2 } : t.length === 3 ? { field: 6, button: 6 } : t.length === 4 ? { field: 5, button: 4 } : t.length === 5 ? { field: 4, button: 4 } : { field: 4, button: 4 },
|
|
28
|
+
[t.length]
|
|
29
|
+
), d = l(
|
|
30
|
+
() => t.length === 1 ? { field: 22, button: 2 } : t.length === 2 ? { field: 11, button: 2 } : t.length === 3 ? { field: 6, button: 6 } : t.length === 4 ? { field: 5, button: 4 } : t.length === 5 ? { field: 4, button: 4 } : { field: 4, button: 4 },
|
|
31
|
+
[t.length]
|
|
32
|
+
), j = l(
|
|
33
|
+
() => t.length === 1 ? { field: 21, button: 3 } : t.length === 2 ? { field: 11, button: 2 } : t.length === 3 ? { field: 24, button: 24 } : t.length === 4 ? { field: 5, button: 4 } : t.length === 5 ? { field: 4, button: 4 } : { field: 4, button: 4 },
|
|
34
|
+
[t.length]
|
|
35
|
+
), [f] = y.useForm(), p = E(
|
|
36
|
+
async (n) => {
|
|
37
|
+
if ((n || r) && b) {
|
|
38
|
+
const m = await f.validateFields();
|
|
39
|
+
b(m);
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
[f, b, r]
|
|
43
|
+
);
|
|
44
|
+
return R(() => {
|
|
45
|
+
g && (f.setFieldsValue(g), p(!0));
|
|
46
|
+
}, [f, g]), t != null && t.length ? /* @__PURE__ */ o.jsx(
|
|
47
|
+
y,
|
|
48
|
+
{
|
|
49
|
+
form: f,
|
|
50
|
+
onFinish: () => p(!0),
|
|
51
|
+
layout: "vertical",
|
|
52
|
+
className: "mb-2",
|
|
53
|
+
onChange: () => p(!1),
|
|
54
|
+
children: /* @__PURE__ */ o.jsxs(v, { gutter: [4, 8], className: "w-100", children: [
|
|
55
|
+
N.map((n, m) => {
|
|
56
|
+
const u = (i == null ? void 0 : i[m]) ?? {
|
|
57
|
+
md: x.field,
|
|
58
|
+
sm: d.field,
|
|
59
|
+
xs: j.field
|
|
60
|
+
};
|
|
61
|
+
return /* @__PURE__ */ a(
|
|
62
|
+
w,
|
|
63
|
+
{
|
|
64
|
+
...u,
|
|
65
|
+
key: `search_field_${String(n.name)}`,
|
|
66
|
+
className: "align-self-end"
|
|
67
|
+
},
|
|
68
|
+
/* @__PURE__ */ o.jsx(_, { ...n, readonly: !1, fieldClassName: "mb-0" })
|
|
69
|
+
);
|
|
70
|
+
}),
|
|
71
|
+
/* @__PURE__ */ o.jsx(
|
|
72
|
+
w,
|
|
73
|
+
{
|
|
74
|
+
md: x.button,
|
|
75
|
+
sm: d.button,
|
|
76
|
+
xs: j.button,
|
|
77
|
+
style: { alignSelf: "end" },
|
|
78
|
+
children: /* @__PURE__ */ o.jsx(
|
|
79
|
+
q,
|
|
80
|
+
{
|
|
81
|
+
type: "primary",
|
|
82
|
+
htmlType: "submit",
|
|
83
|
+
block: !0,
|
|
84
|
+
icon: /* @__PURE__ */ o.jsx(B, {})
|
|
85
|
+
}
|
|
86
|
+
)
|
|
87
|
+
}
|
|
88
|
+
)
|
|
89
|
+
] })
|
|
90
|
+
}
|
|
91
|
+
) : /* @__PURE__ */ o.jsx(o.Fragment, {});
|
|
92
|
+
}
|
|
93
|
+
export {
|
|
94
|
+
A as default
|
|
95
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("../../../_virtual/jsx-runtime.cjs");;/* empty css */const f=require("antd"),I=require("../../../node_modules/mime/dist/src/index.cjs"),u=require("react"),W=require("../../locale/hooks/translation-constants.cjs"),B=require("../../util/ValidationUtil.cjs"),F=require("../common/button/Button.cjs"),H=require("../common/layout/VerticalSpace.cjs"),z=require("../../../node_modules/@ant-design/icons/es/icons/FileOutlined.cjs"),G=require("../../../node_modules/@ant-design/icons/es/icons/FilePptOutlined.cjs"),J=require("../../../node_modules/@ant-design/icons/es/icons/FileExcelOutlined.cjs"),K=require("../../../node_modules/@ant-design/icons/es/icons/FileTextOutlined.cjs"),Q=require("../../../node_modules/@ant-design/icons/es/icons/FileWordOutlined.cjs"),X=require("../../../node_modules/@ant-design/icons/es/icons/FilePdfOutlined.cjs"),Y=require("../../../node_modules/@ant-design/icons/es/icons/FileImageOutlined.cjs"),Z=require("../../../node_modules/react-i18next/dist/es/useTranslation.cjs"),m=require("../../../node_modules/@ant-design/icons/es/icons/ExportOutlined.cjs");function v({name:l,label:t,required:r,provider:s,onUploading:i,onRemoved:x,fieldClassName:h,accept:w,rules:A,maxCount:g=1,block:D,...N}){const d=f.Form.useFormInstance(),j=f.Form.useWatch(l,d),[q,C]=u.useState(!1),[P,k]=u.useState(!1),U=u.useCallback(async n=>{var o,a;try{const{file:c}=n,E=c.name;C(!0),k(!0),i==null||i(!0);const R=E??"",S=R.split("."),$=S[S.length-1],L=s.generateFileName(R),b=`${await s.getInitialPath()}/${L}.${$}`;console.log({filePath:b});const V=await s.upload({...c,originFileObj:c},b);i==null||i(!1),d.setFieldValue(l,V),(o=n.onSuccess)==null||o.call(n,V)}catch(c){(a=n.onError)==null||a.call(n,c)}finally{C(!1)}},[d,l,i,s]),[p,O]=u.useState([]);u.useEffect(()=>{!P&&j&&Promise.all((Array.isArray(j)?j:[j]).map(async n=>{const o=I.default.getType(n),a=n.split("/").pop(),c=await s.getRealUrl(n);return{uid:n,url:c,type:o,name:a}})).then(n=>O(()=>{const o=n.map(({url:a,type:c,uid:E,name:R})=>({uid:E,url:a,type:c,response:E,thumbUrl:a,name:R}));return console.log(o),o}))},[j,P,q,s]);const _=u.useCallback(async n=>{const o=n.response,a=o||d.getFieldValue(l);await s.delete(a),x==null||x(),n&&d.setFieldsValue({[l]:null})},[d,l,x,s]);return e.jsxRuntimeExports.jsxs(f.Form.Item,{label:t,required:r,name:l,className:h,rules:[...r?B.required(t):[],...A??[]],children:[e.jsxRuntimeExports.jsx("input",{hidden:!0}),e.jsxRuntimeExports.jsx(f.Upload,{...N,fileList:p,className:((p==null?void 0:p.length)??0)>=g?"hide-upload":"",maxCount:g,customRequest:U,onRemove:_,listType:"picture",onChange:({fileList:n})=>{O(n)},style:D?{width:"100%"}:void 0,children:e.jsxRuntimeExports.jsx(F,{loading:q,children:"Upload File"})})]})}const y=({provider:l,value:t})=>{const[r,s]=u.useState();return u.useEffect(()=>{t&&l.getRealUrl(t).then(i=>{s({mimeType:I.default.getType(t),url:i,fileName:t.split("/").pop()??t})})},[l,t]),r?e.jsxRuntimeExports.jsx(M,{fileName:r.fileName,url:r==null?void 0:r.url,mimeType:r==null?void 0:r.mimeType}):e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{})},M=({url:l,mimeType:t="",fileName:r})=>{const s=u.useMemo(()=>t!=null&&t.includes("image")?"image":t!=null&&t.includes("pdf")?"pdf":t!=null&&t.includes("word")?"word":t!=null&&t.includes("text")?"text":t!=null&&t.includes("presentation")?"presentation":t!=null&&t.includes("excel")||t!=null&&t.includes("spreadsheet")?"excel":"file",[t]),i=u.useMemo(()=>{switch(s){case"image":return e.jsxRuntimeExports.jsx(Y,{});case"pdf":return e.jsxRuntimeExports.jsx(X,{});case"word":return e.jsxRuntimeExports.jsx(Q,{});case"text":return e.jsxRuntimeExports.jsx(K,{});case"excel":return e.jsxRuntimeExports.jsx(J,{});case"presentation":return e.jsxRuntimeExports.jsx(G,{});default:return e.jsxRuntimeExports.jsx(z,{})}},[s]),[x,h]=u.useState(!1),{t:w}=Z.useTranslation(W.TRANSLATION_NAMESPACE);return s!=="file"&&s!=="text"?e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx(f.Modal,{open:x,title:r,onCancel:()=>h(!1),footer:e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{}),width:"100%",style:{top:"8px",minHeight:"700px"},destroyOnClose:!0,children:e.jsxRuntimeExports.jsxs(H,{children:[e.jsxRuntimeExports.jsx(F,{tooltip:r,icon:e.jsxRuntimeExports.jsx(m,{}),target:"_blank",href:l,style:{textDecoration:"none"},children:w("str.openInNewTab")}),s==="image"?e.jsxRuntimeExports.jsx("img",{src:l,alt:r,style:{width:"100%"}}):s==="pdf"?e.jsxRuntimeExports.jsxs("iframe",{title:r,src:l,width:"100%",height:"700px",children:["This browser does not support PDFs. Please download the PDF to view it:",e.jsxRuntimeExports.jsx("a",{href:l,children:"Download PDF"}),"."]}):e.jsxRuntimeExports.jsxs("iframe",{title:r,src:`https://view.officeapps.live.com/op/view.aspx?src=${encodeURIComponent(l)}`,width:"100%",height:"700px",children:["This browser does not support open ",s.toUpperCase(),". Please download the",s.toUpperCase()," to view it:",e.jsxRuntimeExports.jsxs("a",{href:l,children:["Download ",s.toUpperCase()]}),"."]})]})}),e.jsxRuntimeExports.jsx(F,{tooltip:r,icon:i,shape:"circle",onClick:()=>h(!0)})]}):e.jsxRuntimeExports.jsx(F,{tooltip:r,icon:i,target:"_blank",href:l,shape:"circle"})};exports.FileCellValue=M;exports.FileCrudCellValue=y;exports.default=v;
|
|
@@ -0,0 +1,227 @@
|
|
|
1
|
+
import { j as e } from "../../../_virtual/jsx-runtime.js";
|
|
2
|
+
/* empty css */
|
|
3
|
+
import { Form as F, Upload as W, Modal as z } from "antd";
|
|
4
|
+
import M from "../../../node_modules/mime/dist/src/index.js";
|
|
5
|
+
import { useState as d, useCallback as N, useEffect as S, useMemo as E } from "react";
|
|
6
|
+
import { TRANSLATION_NAMESPACE as G } from "../../locale/hooks/translation-constants.js";
|
|
7
|
+
import J from "../../util/ValidationUtil.js";
|
|
8
|
+
import g from "../common/button/Button.js";
|
|
9
|
+
import K from "../common/layout/VerticalSpace.js";
|
|
10
|
+
import Q from "../../../node_modules/@ant-design/icons/es/icons/FileOutlined.js";
|
|
11
|
+
import X from "../../../node_modules/@ant-design/icons/es/icons/FilePptOutlined.js";
|
|
12
|
+
import Y from "../../../node_modules/@ant-design/icons/es/icons/FileExcelOutlined.js";
|
|
13
|
+
import Z from "../../../node_modules/@ant-design/icons/es/icons/FileTextOutlined.js";
|
|
14
|
+
import m from "../../../node_modules/@ant-design/icons/es/icons/FileWordOutlined.js";
|
|
15
|
+
import v from "../../../node_modules/@ant-design/icons/es/icons/FilePdfOutlined.js";
|
|
16
|
+
import y from "../../../node_modules/@ant-design/icons/es/icons/FileImageOutlined.js";
|
|
17
|
+
import { useTranslation as T } from "../../../node_modules/react-i18next/dist/es/useTranslation.js";
|
|
18
|
+
import tt from "../../../node_modules/@ant-design/icons/es/icons/ExportOutlined.js";
|
|
19
|
+
function It({
|
|
20
|
+
name: o,
|
|
21
|
+
label: t,
|
|
22
|
+
required: r,
|
|
23
|
+
provider: s,
|
|
24
|
+
onUploading: l,
|
|
25
|
+
onRemoved: f,
|
|
26
|
+
fieldClassName: x,
|
|
27
|
+
accept: I,
|
|
28
|
+
rules: U,
|
|
29
|
+
maxCount: C = 1,
|
|
30
|
+
block: k,
|
|
31
|
+
...O
|
|
32
|
+
}) {
|
|
33
|
+
const u = F.useFormInstance(), h = F.useWatch(o, u), [P, $] = d(!1), [R, _] = d(!1), L = N(
|
|
34
|
+
async (n) => {
|
|
35
|
+
var c, a;
|
|
36
|
+
try {
|
|
37
|
+
const { file: i } = n, j = i.name;
|
|
38
|
+
$(!0), _(!0), l == null || l(!0);
|
|
39
|
+
const w = j ?? "", b = w.split("."), B = b[b.length - 1], H = s.generateFileName(w), A = `${await s.getInitialPath()}/${H}.${B}`;
|
|
40
|
+
console.log({ filePath: A });
|
|
41
|
+
const D = await s.upload(
|
|
42
|
+
{ ...i, originFileObj: i },
|
|
43
|
+
A
|
|
44
|
+
);
|
|
45
|
+
l == null || l(!1), u.setFieldValue(o, D), (c = n.onSuccess) == null || c.call(n, D);
|
|
46
|
+
} catch (i) {
|
|
47
|
+
(a = n.onError) == null || a.call(n, i);
|
|
48
|
+
} finally {
|
|
49
|
+
$(!1);
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
[u, o, l, s]
|
|
53
|
+
), [p, V] = d([]);
|
|
54
|
+
S(() => {
|
|
55
|
+
!R && h && Promise.all(
|
|
56
|
+
(Array.isArray(h) ? h : [h]).map(
|
|
57
|
+
async (n) => {
|
|
58
|
+
const c = M.getType(n), a = n.split("/").pop(), i = await s.getRealUrl(n);
|
|
59
|
+
return {
|
|
60
|
+
uid: n,
|
|
61
|
+
url: i,
|
|
62
|
+
type: c,
|
|
63
|
+
name: a
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
)
|
|
67
|
+
).then((n) => V(() => {
|
|
68
|
+
const c = n.map(({ url: a, type: i, uid: j, name: w }) => ({ uid: j, url: a, type: i, response: j, thumbUrl: a, name: w }));
|
|
69
|
+
return console.log(c), c;
|
|
70
|
+
}));
|
|
71
|
+
}, [h, R, P, s]);
|
|
72
|
+
const q = N(
|
|
73
|
+
async (n) => {
|
|
74
|
+
const c = n.response, a = c || u.getFieldValue(o);
|
|
75
|
+
await s.delete(a), f == null || f(), n && u.setFieldsValue({ [o]: null });
|
|
76
|
+
},
|
|
77
|
+
[u, o, f, s]
|
|
78
|
+
);
|
|
79
|
+
return /* @__PURE__ */ e.jsxs(
|
|
80
|
+
F.Item,
|
|
81
|
+
{
|
|
82
|
+
label: t,
|
|
83
|
+
required: r,
|
|
84
|
+
name: o,
|
|
85
|
+
className: x,
|
|
86
|
+
rules: [
|
|
87
|
+
...r ? J.required(t) : [],
|
|
88
|
+
...U ?? []
|
|
89
|
+
],
|
|
90
|
+
children: [
|
|
91
|
+
/* @__PURE__ */ e.jsx("input", { hidden: !0 }),
|
|
92
|
+
/* @__PURE__ */ e.jsx(
|
|
93
|
+
W,
|
|
94
|
+
{
|
|
95
|
+
...O,
|
|
96
|
+
fileList: p,
|
|
97
|
+
className: ((p == null ? void 0 : p.length) ?? 0) >= C ? "hide-upload" : "",
|
|
98
|
+
maxCount: C,
|
|
99
|
+
customRequest: L,
|
|
100
|
+
onRemove: q,
|
|
101
|
+
listType: "picture",
|
|
102
|
+
onChange: ({ fileList: n }) => {
|
|
103
|
+
V(n);
|
|
104
|
+
},
|
|
105
|
+
style: k ? { width: "100%" } : void 0,
|
|
106
|
+
children: /* @__PURE__ */ e.jsx(g, { loading: P, children: "Upload File" })
|
|
107
|
+
}
|
|
108
|
+
)
|
|
109
|
+
]
|
|
110
|
+
}
|
|
111
|
+
);
|
|
112
|
+
}
|
|
113
|
+
const Ct = ({ provider: o, value: t }) => {
|
|
114
|
+
const [r, s] = d();
|
|
115
|
+
return S(() => {
|
|
116
|
+
t && o.getRealUrl(t).then((l) => {
|
|
117
|
+
s({
|
|
118
|
+
mimeType: M.getType(t),
|
|
119
|
+
url: l,
|
|
120
|
+
fileName: t.split("/").pop() ?? t
|
|
121
|
+
});
|
|
122
|
+
});
|
|
123
|
+
}, [o, t]), r ? /* @__PURE__ */ e.jsx(
|
|
124
|
+
et,
|
|
125
|
+
{
|
|
126
|
+
fileName: r.fileName,
|
|
127
|
+
url: r == null ? void 0 : r.url,
|
|
128
|
+
mimeType: r == null ? void 0 : r.mimeType
|
|
129
|
+
}
|
|
130
|
+
) : /* @__PURE__ */ e.jsx(e.Fragment, {});
|
|
131
|
+
}, et = ({ url: o, mimeType: t = "", fileName: r }) => {
|
|
132
|
+
const s = E(() => t != null && t.includes("image") ? "image" : t != null && t.includes("pdf") ? "pdf" : t != null && t.includes("word") ? "word" : t != null && t.includes("text") ? "text" : t != null && t.includes("presentation") ? "presentation" : t != null && t.includes("excel") || t != null && t.includes("spreadsheet") ? "excel" : "file", [t]), l = E(() => {
|
|
133
|
+
switch (s) {
|
|
134
|
+
case "image":
|
|
135
|
+
return /* @__PURE__ */ e.jsx(y, {});
|
|
136
|
+
case "pdf":
|
|
137
|
+
return /* @__PURE__ */ e.jsx(v, {});
|
|
138
|
+
case "word":
|
|
139
|
+
return /* @__PURE__ */ e.jsx(m, {});
|
|
140
|
+
case "text":
|
|
141
|
+
return /* @__PURE__ */ e.jsx(Z, {});
|
|
142
|
+
case "excel":
|
|
143
|
+
return /* @__PURE__ */ e.jsx(Y, {});
|
|
144
|
+
case "presentation":
|
|
145
|
+
return /* @__PURE__ */ e.jsx(X, {});
|
|
146
|
+
default:
|
|
147
|
+
return /* @__PURE__ */ e.jsx(Q, {});
|
|
148
|
+
}
|
|
149
|
+
}, [s]), [f, x] = d(!1), { t: I } = T(G);
|
|
150
|
+
return s !== "file" && s !== "text" ? /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
151
|
+
/* @__PURE__ */ e.jsx(
|
|
152
|
+
z,
|
|
153
|
+
{
|
|
154
|
+
open: f,
|
|
155
|
+
title: r,
|
|
156
|
+
onCancel: () => x(!1),
|
|
157
|
+
footer: /* @__PURE__ */ e.jsx(e.Fragment, {}),
|
|
158
|
+
width: "100%",
|
|
159
|
+
style: { top: "8px", minHeight: "700px" },
|
|
160
|
+
destroyOnClose: !0,
|
|
161
|
+
children: /* @__PURE__ */ e.jsxs(K, { children: [
|
|
162
|
+
/* @__PURE__ */ e.jsx(
|
|
163
|
+
g,
|
|
164
|
+
{
|
|
165
|
+
tooltip: r,
|
|
166
|
+
icon: /* @__PURE__ */ e.jsx(tt, {}),
|
|
167
|
+
target: "_blank",
|
|
168
|
+
href: o,
|
|
169
|
+
style: { textDecoration: "none" },
|
|
170
|
+
children: I("str.openInNewTab")
|
|
171
|
+
}
|
|
172
|
+
),
|
|
173
|
+
s === "image" ? /* @__PURE__ */ e.jsx("img", { src: o, alt: r, style: { width: "100%" } }) : s === "pdf" ? /* @__PURE__ */ e.jsxs("iframe", { title: r, src: o, width: "100%", height: "700px", children: [
|
|
174
|
+
"This browser does not support PDFs. Please download the PDF to view it:",
|
|
175
|
+
/* @__PURE__ */ e.jsx("a", { href: o, children: "Download PDF" }),
|
|
176
|
+
"."
|
|
177
|
+
] }) : /* @__PURE__ */ e.jsxs(
|
|
178
|
+
"iframe",
|
|
179
|
+
{
|
|
180
|
+
title: r,
|
|
181
|
+
src: `https://view.officeapps.live.com/op/view.aspx?src=${encodeURIComponent(
|
|
182
|
+
o
|
|
183
|
+
)}`,
|
|
184
|
+
width: "100%",
|
|
185
|
+
height: "700px",
|
|
186
|
+
children: [
|
|
187
|
+
"This browser does not support open ",
|
|
188
|
+
s.toUpperCase(),
|
|
189
|
+
". Please download the",
|
|
190
|
+
s.toUpperCase(),
|
|
191
|
+
" to view it:",
|
|
192
|
+
/* @__PURE__ */ e.jsxs("a", { href: o, children: [
|
|
193
|
+
"Download ",
|
|
194
|
+
s.toUpperCase()
|
|
195
|
+
] }),
|
|
196
|
+
"."
|
|
197
|
+
]
|
|
198
|
+
}
|
|
199
|
+
)
|
|
200
|
+
] })
|
|
201
|
+
}
|
|
202
|
+
),
|
|
203
|
+
/* @__PURE__ */ e.jsx(
|
|
204
|
+
g,
|
|
205
|
+
{
|
|
206
|
+
tooltip: r,
|
|
207
|
+
icon: l,
|
|
208
|
+
shape: "circle",
|
|
209
|
+
onClick: () => x(!0)
|
|
210
|
+
}
|
|
211
|
+
)
|
|
212
|
+
] }) : /* @__PURE__ */ e.jsx(
|
|
213
|
+
g,
|
|
214
|
+
{
|
|
215
|
+
tooltip: r,
|
|
216
|
+
icon: l,
|
|
217
|
+
target: "_blank",
|
|
218
|
+
href: o,
|
|
219
|
+
shape: "circle"
|
|
220
|
+
}
|
|
221
|
+
);
|
|
222
|
+
};
|
|
223
|
+
export {
|
|
224
|
+
et as FileCellValue,
|
|
225
|
+
Ct as FileCrudCellValue,
|
|
226
|
+
It as default
|
|
227
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var S=Object.defineProperty;var _=(e,a,t)=>a in e?S(e,a,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[a]=t;var d=(e,a,t)=>_(e,typeof a!="symbol"?a+"":a,t);Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const l=require("../../../_virtual/jsx-runtime.cjs");;/* empty css */const u=require("antd"),I=require("../../../_virtual/index.cjs"),i=require("react"),O=require("../../util/NumberUtil.cjs"),k=require("../../util/ValidationUtil.cjs"),A=require("../common/picker/ImagePicker.cjs"),D=require("../../../node_modules/uuid/dist/esm-browser/v4.cjs"),M=require("../../../node_modules/@ant-design/icons/es/icons/EyeOutlined.cjs");class p{}class T extends p{constructor(t="",s=""){super();d(this,"rootPath");d(this,"subPath");this.rootPath=t,this.subPath=s}cloneFilePath(t){const s=I.parse(t),r=`${s.name}_cloned_${O.default.randInt(1e5)}`;return I.format({dir:s.dir,ext:s.ext,name:r})}generateFileName(t){return`${t.split(".")[0]}_${D().replace("-","")}`}}function W({name:e,label:a,required:t,provider:s,onUploading:r,aspectRatio:h,onRemoved:o,fieldClassName:g,hideLabel:q=!1,listType:w}){const c=u.Form.useFormInstance(),f=u.Form.useWatch(e,c),[F,C]=i.useState(!1),P=i.useCallback(async(n,N)=>{if(N){r==null||r(!0);const m=n.name,x=m.split("."),V=x[x.length-1],y=s.generateFileName(m),$=`${await s.getInitialPath()}/${y}.${V}`,b=await s.upload(n,$);C(!0),r==null||r(!1),c.setFieldValue(e,b)}else{console.log(n);const m=c.getFieldsValue(),x=await s.delete(m[e]);o==null||o(),x&&c.setFieldsValue({[e]:null})}},[c,e,o,r,s]),[j,E]=i.useState();return i.useEffect(()=>{!F&&f?s.getRealUrl(f).then(E):E(j)},[f,F,s,j]),l.jsxRuntimeExports.jsx(l.jsxRuntimeExports.Fragment,{children:l.jsxRuntimeExports.jsxs(u.Form.Item,{rules:t?k.required(a):[],label:q?null:a,required:t,name:e,children:[l.jsxRuntimeExports.jsx(A.default,{noStyle:!0,listType:w,aspectRatio:h,values:j,onRemove:n=>{n&&P(n,!1)},onAdd:async n=>{n&&await P(n,!0)},className:g}),l.jsxRuntimeExports.jsx(u.Input,{hidden:!0})]})})}const z=({provider:e,value:a})=>{const[t,s]=i.useState();return i.useEffect(()=>{a&&e.getRealUrl(a).then(s)},[e,a]),t?l.jsxRuntimeExports.jsx(R,{url:t}):l.jsxRuntimeExports.jsx(l.jsxRuntimeExports.Fragment,{})},R=({url:e})=>l.jsxRuntimeExports.jsx(u.Avatar,{className:"p-0",children:l.jsxRuntimeExports.jsx(u.Image,{className:"m-0 p-0 position-relative",src:e,preview:{mask:l.jsxRuntimeExports.jsx(M,{})}})});exports.FileDownloadProvider=p;exports.FileUploadProvider=T;exports.ImageCellValue=R;exports.ImageCrudCellValue=z;exports.default=W;
|