@kingteza/crud-component 1.0.3 → 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 +5 -4
- 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,56 @@
|
|
|
1
|
+
import { j as n } from "../../../../_virtual/jsx-runtime.js";
|
|
2
|
+
import { useState as r, useRef as k, useCallback as c } from "react";
|
|
3
|
+
import { TRANSLATION_NAMESPACE as C } from "../../../locale/hooks/translation-constants.js";
|
|
4
|
+
import A from "./Button.js";
|
|
5
|
+
import { useTranslation as T } from "../../../../node_modules/react-i18next/dist/es/useTranslation.js";
|
|
6
|
+
import h from "../../../../node_modules/@ant-design/icons/es/icons/ImportOutlined.js";
|
|
7
|
+
function L({
|
|
8
|
+
onClick: e,
|
|
9
|
+
children: l,
|
|
10
|
+
accept: a,
|
|
11
|
+
className: m,
|
|
12
|
+
disabled: f,
|
|
13
|
+
type: p = "link"
|
|
14
|
+
}) {
|
|
15
|
+
const [u, s] = r(!1), { t: x } = T(C), o = k(null), j = c(() => {
|
|
16
|
+
d((t) => t + 1), o.current && setTimeout(() => {
|
|
17
|
+
var t;
|
|
18
|
+
(t = o == null ? void 0 : o.current) == null || t.click();
|
|
19
|
+
}, 10);
|
|
20
|
+
}, []), [y, d] = r(0), g = c(
|
|
21
|
+
async (t) => {
|
|
22
|
+
s(!0);
|
|
23
|
+
const i = t.target.files[0];
|
|
24
|
+
i && await e(i), s(!1);
|
|
25
|
+
},
|
|
26
|
+
[e]
|
|
27
|
+
);
|
|
28
|
+
return /* @__PURE__ */ n.jsxs("div", { className: m, children: [
|
|
29
|
+
/* @__PURE__ */ n.jsx(
|
|
30
|
+
"input",
|
|
31
|
+
{
|
|
32
|
+
type: "file",
|
|
33
|
+
style: { display: "none" },
|
|
34
|
+
ref: o,
|
|
35
|
+
onChange: g,
|
|
36
|
+
accept: a
|
|
37
|
+
},
|
|
38
|
+
y
|
|
39
|
+
),
|
|
40
|
+
/* @__PURE__ */ n.jsx(
|
|
41
|
+
A,
|
|
42
|
+
{
|
|
43
|
+
loading: u,
|
|
44
|
+
type: p,
|
|
45
|
+
disabled: f,
|
|
46
|
+
onClick: j,
|
|
47
|
+
icon: /* @__PURE__ */ n.jsx(h, {}),
|
|
48
|
+
tooltip: x("str.import"),
|
|
49
|
+
children: l
|
|
50
|
+
}
|
|
51
|
+
)
|
|
52
|
+
] });
|
|
53
|
+
}
|
|
54
|
+
export {
|
|
55
|
+
L as ImportButton
|
|
56
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../../../../_virtual/jsx-runtime.cjs"),a=require("./Button.cjs"),l=require("../../../locale/hooks/translation-constants.cjs"),x=require("../../../../node_modules/react-i18next/dist/es/useTranslation.cjs"),j=require("../../../../node_modules/@ant-design/icons/es/icons/PlusOutlined.cjs"),m=({size:n,block:r,className:s,type:o="primary",onClick:t,title:u,to:i})=>{const{t:c}=x.useTranslation(l.TRANSLATION_NAMESPACE);return e.jsxRuntimeExports.jsx(a,{type:o,className:s,to:i,block:r,size:n,onClick:t&&(()=>t(!0)),icon:e.jsxRuntimeExports.jsx(j,{}),children:u??c("str.new")})};exports.NewButton=m;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { j as r } from "../../../../_virtual/jsx-runtime.js";
|
|
2
|
+
import f from "./Button.js";
|
|
3
|
+
import { TRANSLATION_NAMESPACE as u } from "../../../locale/hooks/translation-constants.js";
|
|
4
|
+
import { useTranslation as c } from "../../../../node_modules/react-i18next/dist/es/useTranslation.js";
|
|
5
|
+
import x from "../../../../node_modules/@ant-design/icons/es/icons/PlusOutlined.js";
|
|
6
|
+
const R = ({ size: t, block: n, className: m, type: e = "primary", onClick: o, title: i, to: s }) => {
|
|
7
|
+
const { t: p } = c(u);
|
|
8
|
+
return /* @__PURE__ */ r.jsx(
|
|
9
|
+
f,
|
|
10
|
+
{
|
|
11
|
+
type: e,
|
|
12
|
+
className: m,
|
|
13
|
+
to: s,
|
|
14
|
+
block: n,
|
|
15
|
+
size: t,
|
|
16
|
+
onClick: o && (() => o(!0)),
|
|
17
|
+
icon: /* @__PURE__ */ r.jsx(x, {}),
|
|
18
|
+
children: i ?? p("str.new")
|
|
19
|
+
}
|
|
20
|
+
);
|
|
21
|
+
};
|
|
22
|
+
export {
|
|
23
|
+
R as NewButton
|
|
24
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("../../../../_virtual/jsx-runtime.cjs"),p=require("./Button.cjs"),x=require("../../../locale/hooks/translation-constants.cjs"),j=require("../../../../node_modules/react-i18next/dist/es/useTranslation.cjs"),m=require("../../../../node_modules/@ant-design/icons/es/icons/PrinterOutlined.cjs"),q=({disabled:s,loading:e,block:i,className:o,type:u="primary",onClick:c,title:a,to:l})=>{const{t:n}=j.useTranslation(x.TRANSLATION_NAMESPACE),t=a??n("str.print");return r.jsxRuntimeExports.jsx(p,{type:u,className:o,to:l,loading:e,disabled:s,block:i,onClick:c,tooltip:t!=null&&t.trim()?"":n("str.print"),icon:r.jsxRuntimeExports.jsx(m,{}),children:t})};exports.PrintButton=q;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { j as r } from "../../../../_virtual/jsx-runtime.js";
|
|
2
|
+
import u from "./Button.js";
|
|
3
|
+
import { TRANSLATION_NAMESPACE as x } from "../../../locale/hooks/translation-constants.js";
|
|
4
|
+
import { useTranslation as a } from "../../../../node_modules/react-i18next/dist/es/useTranslation.js";
|
|
5
|
+
import j from "../../../../node_modules/@ant-design/icons/es/icons/PrinterOutlined.js";
|
|
6
|
+
const l = ({ disabled: n, loading: i, block: m, className: p, type: s = "primary", onClick: c, title: e, to: f }) => {
|
|
7
|
+
const { t: o } = a(x), t = e ?? o("str.print");
|
|
8
|
+
return /* @__PURE__ */ r.jsx(
|
|
9
|
+
u,
|
|
10
|
+
{
|
|
11
|
+
type: s,
|
|
12
|
+
className: p,
|
|
13
|
+
to: f,
|
|
14
|
+
loading: i,
|
|
15
|
+
disabled: n,
|
|
16
|
+
block: m,
|
|
17
|
+
onClick: c,
|
|
18
|
+
tooltip: t != null && t.trim() ? "" : o("str.print"),
|
|
19
|
+
icon: /* @__PURE__ */ r.jsx(j, {}),
|
|
20
|
+
children: t
|
|
21
|
+
}
|
|
22
|
+
);
|
|
23
|
+
};
|
|
24
|
+
export {
|
|
25
|
+
l as PrintButton
|
|
26
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../../../../_virtual/jsx-runtime.cjs"),c=require("../../../locale/hooks/translation-constants.cjs"),l=require("./Button.cjs"),x=require("../../../../node_modules/react-i18next/dist/es/useTranslation.cjs"),R=require("../../../../node_modules/@ant-design/icons/es/icons/ReloadOutlined.cjs"),j=({disabled:r,block:n,className:s,type:o="primary",onClick:t,title:u,to:i})=>{const{t:a}=x.useTranslation(c.TRANSLATION_NAMESPACE);return e.jsxRuntimeExports.jsx(l,{type:o,disabled:r,className:s,to:i,block:n,onClick:t&&(()=>t(!0)),icon:e.jsxRuntimeExports.jsx(R,{}),children:u??a("str.refresh")})};exports.RefreshButton=j;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { j as o } from "../../../../_virtual/jsx-runtime.js";
|
|
2
|
+
import { TRANSLATION_NAMESPACE as f } from "../../../locale/hooks/translation-constants.js";
|
|
3
|
+
import u from "./Button.js";
|
|
4
|
+
import { useTranslation as c } from "../../../../node_modules/react-i18next/dist/es/useTranslation.js";
|
|
5
|
+
import x from "../../../../node_modules/@ant-design/icons/es/icons/ReloadOutlined.js";
|
|
6
|
+
const E = ({ disabled: t, block: m, className: n, type: e = "primary", onClick: r, title: s, to: i }) => {
|
|
7
|
+
const { t: p } = c(f);
|
|
8
|
+
return /* @__PURE__ */ o.jsx(
|
|
9
|
+
u,
|
|
10
|
+
{
|
|
11
|
+
type: e,
|
|
12
|
+
disabled: t,
|
|
13
|
+
className: n,
|
|
14
|
+
to: i,
|
|
15
|
+
block: m,
|
|
16
|
+
onClick: r && (() => r(!0)),
|
|
17
|
+
icon: /* @__PURE__ */ o.jsx(x, {}),
|
|
18
|
+
children: s ?? p("str.refresh")
|
|
19
|
+
}
|
|
20
|
+
);
|
|
21
|
+
};
|
|
22
|
+
export {
|
|
23
|
+
E as RefreshButton
|
|
24
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const t=require("../../../../_virtual/jsx-runtime.cjs"),C=require("antd"),n=require("react"),d=require("./Button.cjs"),E=require("../../../locale/hooks/translation-constants.cjs"),R=require("../../../../node_modules/react-i18next/dist/es/useTranslation.cjs"),f=require("../../../../node_modules/@ant-design/icons/es/icons/UpCircleOutlined.cjs");function T({shouldConfirm:m=!0,block:r,value:i,loading:u,onClick:a,text:c,disabled:l,type:x="link",hidden:q}){const{t:e}=R.useTranslation(E.TRANSLATION_NAMESPACE),s=n.useMemo(()=>c??e("str.unhide"),[c,e]),[p,o]=n.useState(!1);n.useEffect(()=>{o(u??!1)},[u]);const j=n.useCallback(async()=>{try{o(!0),await a(i)}finally{o(!1)}},[a,i]);return m?t.jsxRuntimeExports.jsx(C.Popconfirm,{title:e("qus.doYouWantToHide"),okText:s.toUpperCase(),cancelText:e("str.no").toUpperCase(),onConfirm:j,children:t.jsxRuntimeExports.jsx(d,{tooltip:s,icon:t.jsxRuntimeExports.jsx(f,{}),disabled:l,loading:p,type:x,danger:!0,hidden:q,block:r})}):t.jsxRuntimeExports.jsx(d,{tooltip:s,icon:t.jsxRuntimeExports.jsx(f,{}),disabled:l,loading:p,type:x,danger:!0,block:r,onClick:j})}module.exports=T;
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { j as o } from "../../../../_virtual/jsx-runtime.js";
|
|
2
|
+
import { Popconfirm as C } from "antd";
|
|
3
|
+
import { useMemo as T, useState as g, useEffect as A, useCallback as E } from "react";
|
|
4
|
+
import c from "./Button.js";
|
|
5
|
+
import { TRANSLATION_NAMESPACE as _ } from "../../../locale/hooks/translation-constants.js";
|
|
6
|
+
import { useTranslation as k } from "../../../../node_modules/react-i18next/dist/es/useTranslation.js";
|
|
7
|
+
import x from "../../../../node_modules/@ant-design/icons/es/icons/UpCircleOutlined.js";
|
|
8
|
+
function H({
|
|
9
|
+
shouldConfirm: d = !0,
|
|
10
|
+
block: e,
|
|
11
|
+
value: i,
|
|
12
|
+
loading: s,
|
|
13
|
+
onClick: a,
|
|
14
|
+
text: f,
|
|
15
|
+
disabled: m,
|
|
16
|
+
type: u = "link",
|
|
17
|
+
hidden: j
|
|
18
|
+
}) {
|
|
19
|
+
const { t } = k(_), n = T(() => f ?? t("str.unhide"), [f, t]), [l, r] = g(!1);
|
|
20
|
+
A(() => {
|
|
21
|
+
r(s ?? !1);
|
|
22
|
+
}, [s]);
|
|
23
|
+
const p = E(
|
|
24
|
+
async () => {
|
|
25
|
+
try {
|
|
26
|
+
r(!0), await a(i);
|
|
27
|
+
} finally {
|
|
28
|
+
r(!1);
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
[a, i]
|
|
32
|
+
);
|
|
33
|
+
return d ? /* @__PURE__ */ o.jsx(
|
|
34
|
+
C,
|
|
35
|
+
{
|
|
36
|
+
title: t("qus.doYouWantToHide"),
|
|
37
|
+
okText: n.toUpperCase(),
|
|
38
|
+
cancelText: t("str.no").toUpperCase(),
|
|
39
|
+
onConfirm: p,
|
|
40
|
+
children: /* @__PURE__ */ o.jsx(
|
|
41
|
+
c,
|
|
42
|
+
{
|
|
43
|
+
tooltip: n,
|
|
44
|
+
icon: /* @__PURE__ */ o.jsx(x, {}),
|
|
45
|
+
disabled: m,
|
|
46
|
+
loading: l,
|
|
47
|
+
type: u,
|
|
48
|
+
danger: !0,
|
|
49
|
+
hidden: j,
|
|
50
|
+
block: e
|
|
51
|
+
}
|
|
52
|
+
)
|
|
53
|
+
}
|
|
54
|
+
) : /* @__PURE__ */ o.jsx(
|
|
55
|
+
c,
|
|
56
|
+
{
|
|
57
|
+
tooltip: n,
|
|
58
|
+
icon: /* @__PURE__ */ o.jsx(x, {}),
|
|
59
|
+
disabled: m,
|
|
60
|
+
loading: l,
|
|
61
|
+
type: u,
|
|
62
|
+
danger: !0,
|
|
63
|
+
block: e,
|
|
64
|
+
onClick: p
|
|
65
|
+
}
|
|
66
|
+
);
|
|
67
|
+
}
|
|
68
|
+
export {
|
|
69
|
+
H as default
|
|
70
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const t=require("../../../../_virtual/jsx-runtime.cjs"),o=require("./Button.cjs"),r=require("../../../locale/hooks/translation-constants.cjs"),i=require("../../../../node_modules/react-i18next/dist/es/useTranslation.cjs"),u=require("../../../../node_modules/@ant-design/icons/es/icons/EditOutlined.cjs");function a({value:n,onClick:s}){const{t:e}=i.useTranslation(r.TRANSLATION_NAMESPACE);return t.jsxRuntimeExports.jsx(o,{tooltip:e("str.update"),type:"link",onClick:()=>s(n),icon:t.jsxRuntimeExports.jsx(u,{})})}module.exports=a;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { j as t } from "../../../../_virtual/jsx-runtime.js";
|
|
2
|
+
import i from "./Button.js";
|
|
3
|
+
import { TRANSLATION_NAMESPACE as m } from "../../../locale/hooks/translation-constants.js";
|
|
4
|
+
import { useTranslation as p } from "../../../../node_modules/react-i18next/dist/es/useTranslation.js";
|
|
5
|
+
import e from "../../../../node_modules/@ant-design/icons/es/icons/EditOutlined.js";
|
|
6
|
+
function c({ value: o, onClick: r }) {
|
|
7
|
+
const { t: n } = p(m);
|
|
8
|
+
return /* @__PURE__ */ t.jsx(
|
|
9
|
+
i,
|
|
10
|
+
{
|
|
11
|
+
tooltip: n("str.update"),
|
|
12
|
+
type: "link",
|
|
13
|
+
onClick: () => r(o),
|
|
14
|
+
icon: /* @__PURE__ */ t.jsx(e, {})
|
|
15
|
+
}
|
|
16
|
+
);
|
|
17
|
+
}
|
|
18
|
+
export {
|
|
19
|
+
c as default
|
|
20
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const t=require("../../../../_virtual/jsx-runtime.cjs"),i=require("./Button.cjs"),o=require("../../../locale/hooks/translation-constants.cjs"),r=require("../../../../node_modules/react-i18next/dist/es/useTranslation.cjs"),u=require("../../../../node_modules/@ant-design/icons/es/icons/EyeOutlined.cjs");function c({value:n,onClick:e}){const{t:s}=r.useTranslation(o.TRANSLATION_NAMESPACE);return t.jsxRuntimeExports.jsx(i,{type:"link",onClick:()=>e(n),icon:t.jsxRuntimeExports.jsx(u,{}),tooltip:s("str.view")})}module.exports=c;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { j as o } from "../../../../_virtual/jsx-runtime.js";
|
|
2
|
+
import i from "./Button.js";
|
|
3
|
+
import { TRANSLATION_NAMESPACE as m } from "../../../locale/hooks/translation-constants.js";
|
|
4
|
+
import { useTranslation as e } from "../../../../node_modules/react-i18next/dist/es/useTranslation.js";
|
|
5
|
+
import p from "../../../../node_modules/@ant-design/icons/es/icons/EyeOutlined.js";
|
|
6
|
+
function c({ value: t, onClick: r }) {
|
|
7
|
+
const { t: n } = e(m);
|
|
8
|
+
return /* @__PURE__ */ o.jsx(
|
|
9
|
+
i,
|
|
10
|
+
{
|
|
11
|
+
type: "link",
|
|
12
|
+
onClick: () => r(t),
|
|
13
|
+
icon: /* @__PURE__ */ o.jsx(p, {}),
|
|
14
|
+
tooltip: n("str.view")
|
|
15
|
+
}
|
|
16
|
+
);
|
|
17
|
+
}
|
|
18
|
+
export {
|
|
19
|
+
c as default
|
|
20
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const r=require("../../../../_virtual/jsx-runtime.cjs"),c=require("antd"),u=c.Form.Item,d=({onChange:e,label:x,initialValue:t=!1,disabled:n,switch:s=!1,...m})=>r.jsxRuntimeExports.jsxs(u,{...m,valuePropName:"checked",initialValue:t,label:s?x:void 0,children:[!!s&&r.jsxRuntimeExports.jsx(c.Switch,{disabled:n,defaultChecked:t,onChange:e&&(o=>e(o))}),!s&&r.jsxRuntimeExports.jsx(c.Checkbox,{disabled:n,defaultChecked:t,onChange:e&&(o=>e(o.target.checked)),children:x})]});module.exports=d;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { j as c } from "../../../../_virtual/jsx-runtime.js";
|
|
2
|
+
import { Form as x, Switch as f, Checkbox as h } from "antd";
|
|
3
|
+
const k = x.Item, n = ({
|
|
4
|
+
onChange: e,
|
|
5
|
+
label: m,
|
|
6
|
+
initialValue: o = !1,
|
|
7
|
+
disabled: s,
|
|
8
|
+
switch: r = !1,
|
|
9
|
+
...d
|
|
10
|
+
}) => /* @__PURE__ */ c.jsxs(
|
|
11
|
+
k,
|
|
12
|
+
{
|
|
13
|
+
...d,
|
|
14
|
+
valuePropName: "checked",
|
|
15
|
+
initialValue: o,
|
|
16
|
+
label: r ? m : void 0,
|
|
17
|
+
children: [
|
|
18
|
+
!!r && /* @__PURE__ */ c.jsx(
|
|
19
|
+
f,
|
|
20
|
+
{
|
|
21
|
+
disabled: s,
|
|
22
|
+
defaultChecked: o,
|
|
23
|
+
onChange: e && ((t) => e(t))
|
|
24
|
+
}
|
|
25
|
+
),
|
|
26
|
+
!r && /* @__PURE__ */ c.jsx(
|
|
27
|
+
h,
|
|
28
|
+
{
|
|
29
|
+
disabled: s,
|
|
30
|
+
defaultChecked: o,
|
|
31
|
+
onChange: e && ((t) => e(t.target.checked)),
|
|
32
|
+
children: m
|
|
33
|
+
}
|
|
34
|
+
)
|
|
35
|
+
]
|
|
36
|
+
}
|
|
37
|
+
);
|
|
38
|
+
export {
|
|
39
|
+
n as default
|
|
40
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const n=require("../../../../_virtual/jsx-runtime.cjs"),o=require("antd"),u=require("react"),a=require("../../../util/NumberUtil.cjs"),m=o.Descriptions.Item,x=({list:s,keepEmptyValues:r,...i})=>{const c=u.useMemo(()=>{const t=r?s:s.filter(e=>e&&!!e.value);return t.forEach(e=>{!e.noFormatting&&!isNaN(e.value)&&(e.value=a.default.toMoney(e.value))}),t},[r,s]);return n.jsxRuntimeExports.jsx(o.Descriptions,{...i,children:c.map(({label:t,value:e})=>n.jsxRuntimeExports.jsx(m,{label:t,children:e},t))})};module.exports=x;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { j as i } from "../../../../_virtual/jsx-runtime.js";
|
|
2
|
+
import { Descriptions as s } from "antd";
|
|
3
|
+
import { useMemo as a } from "react";
|
|
4
|
+
import c from "../../../util/NumberUtil.js";
|
|
5
|
+
const u = s.Item, j = ({ list: t, keepEmptyValues: e, ...n }) => {
|
|
6
|
+
const m = a(() => {
|
|
7
|
+
const r = e ? t : t.filter((o) => o && !!o.value);
|
|
8
|
+
return r.forEach((o) => {
|
|
9
|
+
!o.noFormatting && !isNaN(o.value) && (o.value = c.toMoney(o.value));
|
|
10
|
+
}), r;
|
|
11
|
+
}, [e, t]);
|
|
12
|
+
return /* @__PURE__ */ i.jsx(s, { ...n, children: m.map(({ label: r, value: o }) => /* @__PURE__ */ i.jsx(u, { label: r, children: o }, r)) });
|
|
13
|
+
};
|
|
14
|
+
export {
|
|
15
|
+
j as default
|
|
16
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const r=require("../../../../_virtual/jsx-runtime.cjs"),s=require("antd"),c=({children:e,className:t=""})=>r.jsxRuntimeExports.jsx(s.Space,{direction:"vertical",className:[t,"w-100"].join(" "),children:e});module.exports=c;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { j as e } from "../../../../_virtual/jsx-runtime.js";
|
|
2
|
+
import { Space as a } from "antd";
|
|
3
|
+
const s = ({ children: r, className: t = "" }) => /* @__PURE__ */ e.jsx(a, { direction: "vertical", className: [t, "w-100"].join(" "), children: r });
|
|
4
|
+
export {
|
|
5
|
+
s as default
|
|
6
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const t=require("../../../../_virtual/jsx-runtime.cjs"),e=require("antd"),a=require("../button/Button.cjs"),i=require("../../../locale/hooks/translation-constants.cjs"),u=require("../../../../node_modules/react-i18next/dist/es/useTranslation.cjs"),c=({loading:r,children:n,error:o})=>{const{t:s}=u.useTranslation(i.TRANSLATION_NAMESPACE);return t.jsxRuntimeExports.jsx(e.Skeleton,{loading:r,paragraph:!0,className:"h-100",children:o?t.jsxRuntimeExports.jsx(e.Result,{status:"404",title:404,subTitle:s("err.notFound"),className:"",extra:t.jsxRuntimeExports.jsx(a,{to:-1,type:"primary",children:s("str.goBack")})}):n})};module.exports=c;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { j as t } from "../../../../_virtual/jsx-runtime.js";
|
|
2
|
+
import { Skeleton as a, Result as n } from "antd";
|
|
3
|
+
import m from "../button/Button.js";
|
|
4
|
+
import { TRANSLATION_NAMESPACE as i } from "../../../locale/hooks/translation-constants.js";
|
|
5
|
+
import { useTranslation as p } from "../../../../node_modules/react-i18next/dist/es/useTranslation.js";
|
|
6
|
+
const f = ({ loading: o, children: s, error: e }) => {
|
|
7
|
+
const { t: r } = p(i);
|
|
8
|
+
return (
|
|
9
|
+
// <Spin spinning={loading} className="h-100">
|
|
10
|
+
/* @__PURE__ */ t.jsx(a, { loading: o, paragraph: !0, className: "h-100", children: e ? /* @__PURE__ */ t.jsx(
|
|
11
|
+
n,
|
|
12
|
+
{
|
|
13
|
+
status: "404",
|
|
14
|
+
title: 404,
|
|
15
|
+
subTitle: r("err.notFound"),
|
|
16
|
+
className: "",
|
|
17
|
+
extra: /* @__PURE__ */ t.jsx(m, { to: -1, type: "primary", children: r("str.goBack") })
|
|
18
|
+
}
|
|
19
|
+
) : s })
|
|
20
|
+
);
|
|
21
|
+
};
|
|
22
|
+
export {
|
|
23
|
+
f as default
|
|
24
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("../../../../_virtual/jsx-runtime.cjs");;/* empty css */;/* empty css */const O=require("antd"),s=require("react"),fe=require("../../../../node_modules/react-cropper/dist/react-cropper.es.cjs"),ge=require("../../../locale/hooks/translation-constants.cjs"),P=require("../button/Button.cjs"),Re=require("../../../util/ImageUtil.cjs"),he=require("../../../../node_modules/react-i18next/dist/es/useTranslation.cjs"),Ee=require("../../../../node_modules/@ant-design/icons/es/icons/RotateLeftOutlined.cjs"),we=require("../../../../node_modules/@ant-design/icons/es/icons/RotateRightOutlined.cjs"),X=require("../../../../node_modules/@ant-design/icons/es/icons/UploadOutlined.cjs"),Ce=require("../../../../node_modules/@ant-design/icons/es/icons/LoadingOutlined.cjs"),ve=O.Form.Item;function Q(r){return new Promise((u,x)=>{const n=new FileReader;n.readAsDataURL(r),n.onload=()=>u(n.result),n.onerror=p=>x(p)})}const be=({values:r=[],required:u,buttonType:x,label:n,name:p,onChange:m,aspectRatio:U,buttonTitle:R,hidePreview:h,buttonSize:j="large",showButtonText:f=!0,showOnlyIcon:A=!1,icon:v=t.jsxRuntimeExports.jsx(X,{}),loading:b,maxCount:E=1,onAdd:l,onRemove:S,listType:y,..._})=>{const[Z,ee]=s.useState(""),[te,se]=s.useState(""),[re,D]=s.useState(!1),I=s.useRef(),i=s.useRef(),[a,F]=s.useState([]),[g,N]=s.useState(),ne=s.useRef(),oe=()=>D(!1),ie=async e=>{!e.url&&!e.preview&&(e.preview=await Q(e.originFileObj)),se(e.url||e.preview),D(!0),ee(e.name)},[z,q]=s.useState(!1),ae=()=>{},B=e=>{var o;(o=i==null?void 0:i.current)==null||o.cropper.rotate(e?-90:90)};s.useEffect(()=>{m==null||m(a[0],a)},[a,m]);const ce=()=>{var C;const e=(C=i==null?void 0:i.current)==null?void 0:C.cropper.getCroppedCanvas(),{type:o,size:c,name:d,uid:w}=I.current;q(!0),e==null||e.toBlob(async me=>{const je=Object.assign(new File([me],d,{type:o}),{uid:w}),H=await Re.resizeImage(je),G=await Q(H),K={url:G,name:d,uid:w,type:o,size:c,thumbUrl:G,originFileObj:H};if(l)try{q(!0),await l(K)}finally{q(!1)}F([K,...a]),q(!1)}),N(void 0)},le=()=>{N(void 0),I.current=void 0},T=s.useCallback(e=>{const o=e;if(o){I.current=o;const c=new FileReader;c.addEventListener("load",()=>{var d;if(typeof c.result=="string"){N(c.result);const w=localStorage.getItem("cropper.box"),C=w?JSON.parse(w):void 0;C&&((d=i==null?void 0:i.current)==null||d.cropper.setCropBoxData(C)),setTimeout(()=>{$()},100)}}),c.readAsDataURL(o)}},[]);s.useEffect(()=>{if(r!=null&&r.length||typeof r=="string"){const e=Array.isArray(r)?r.map(o=>[{uid:r,url:o}]):[{uid:r,url:r}];F(e)}},[r]);const{t:M}=he.useTranslation(ge.TRANSLATION_NAMESPACE),ue=s.useMemo(()=>u?{required:u,validator:(e,o,c)=>{g||a!=null&&a.length?c():c(`${n??""} ${M("err.validation.required")}`)}}:void 0,[u,g,a==null?void 0:a.length,n,M]),L=R??M("message.fileUploadMessage2"),J=s.useMemo(()=>t.jsxRuntimeExports.jsx(Y,{showLoadingIndicator:z,_buttonTitle:L,buttonSize:j,buttonType:x,fileList:a,hidePreview:h,icon:v,loading:b,listType:y,maxCount:E,onChangeFile:T,onRemove:S,showButtonText:f,handlePreview:ie,setFileList:F}),[z,L,j,x,a,h,v,b,y,E,T,S,f]);ne.current=J.props.beforeUpload;const[de,V]=s.useState(0),[xe,W]=s.useState(0),[k,pe]=s.useState();s.useEffect(()=>{const e=setTimeout(()=>{k&&localStorage.setItem("cropper.box",JSON.stringify(k))},400);return()=>clearTimeout(e)},[k]),s.useEffect(()=>{g||(V(0),W(0))},[g]);const $=s.useCallback(async()=>{var o;const e=(o=i==null?void 0:i.current)==null?void 0:o.cropper;if(e){const{width:c,height:d}=e.getCroppedCanvas();pe(e.getCropBoxData()),V(c),W(d)}},[]);return t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsx(ve,{label:n,..._,name:p,className:"mb-0",rules:[ue,..._.rules??[]],children:J}),t.jsxRuntimeExports.jsxs(O.Modal,{open:!!g,maskClosable:!1,onOk:ce,closable:!1,onCancel:le,children:[t.jsxRuntimeExports.jsx(fe.Cropper,{ref:i,src:g,cropmove:$,viewMode:1,aspectRatio:U,cropend:()=>ae()}),t.jsxRuntimeExports.jsx("p",{className:"text-center",children:[de,xe].join(" ⨉ ")}),t.jsxRuntimeExports.jsxs("div",{className:"mt-2 d-flex justify-content-center",children:[t.jsxRuntimeExports.jsx(P,{size:"large",icon:t.jsxRuntimeExports.jsx(Ee,{}),onClick:()=>B(!0)}),t.jsxRuntimeExports.jsx(P,{size:"large",icon:t.jsxRuntimeExports.jsx(we,{}),onClick:()=>B(!1)})]})]}),t.jsxRuntimeExports.jsx(O.Modal,{open:re,title:Z,footer:null,onCancel:oe,children:t.jsxRuntimeExports.jsx("div",{className:"text-center",children:t.jsxRuntimeExports.jsx("img",{alt:"example",style:{maxWidth:"400px"},src:te})})})]})},Y=({_buttonTitle:r,buttonSize:u,buttonType:x,fileList:n,hidePreview:p,icon:m,loading:U,maxCount:R,onChangeFile:h,onRemove:j,showButtonText:f,handlePreview:A,setFileList:v,showLoadingIndicator:b,listType:E="picture"})=>t.jsxRuntimeExports.jsx(t.jsxRuntimeExports.Fragment,{children:t.jsxRuntimeExports.jsxs(O.Upload,{accept:"image/x-png,image/gif,image/jpeg",fileList:n,defaultFileList:n,onChange:()=>{},className:(n.length>=R?" hide-upload ":"")+" mb-0",multiple:!1,onPreview:p?void 0:A,onDrop:l=>(h(l.dataTransfer.files.item(0)),!1),listType:E,showUploadList:!p,onRemove:l=>{const S=n.filter(y=>l.uid!==y.uid);j==null||j(l),v(S)},beforeUpload:async l=>(h(l),!1),maxCount:R,children:[b&&t.jsxRuntimeExports.jsx(Ce,{}),t.jsxRuntimeExports.jsx("div",{className:"d-flex flex-column",children:n.length<R&&(E==="picture-circle"?t.jsxRuntimeExports.jsx(X,{}):t.jsxRuntimeExports.jsx(P,{loading:U,tooltip:f?void 0:r,size:u,icon:m,type:f?x:"text",children:f?r:void 0}))})]},n.length)});exports.UploadComponent=Y;exports.default=be;
|