@kingteza/crud-component 1.0.4 → 1.0.6
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/_commonjsHelpers.cjs +1 -0
- package/dist/_virtual/_commonjsHelpers.js +6 -1
- package/dist/_virtual/advancedFormat.cjs +1 -0
- package/dist/_virtual/advancedFormat.js +7 -1
- 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.js +4 -1
- package/dist/_virtual/dayjs.min.cjs +1 -0
- package/dist/_virtual/dayjs.min.js +7 -1
- 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/index2.cjs +1 -0
- package/dist/_virtual/index2.js +7 -1
- package/dist/_virtual/index3.cjs +1 -0
- package/dist/_virtual/index3.js +4 -1
- package/dist/_virtual/index4.js +4 -1
- package/dist/_virtual/index5.cjs +1 -0
- package/dist/_virtual/index5.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/react-is.development.js +4 -1
- package/dist/_virtual/react-is.production.min.js +4 -1
- 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 +282 -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 +38 -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 +60 -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 +140 -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 +220 -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/src/components/crud/import/CrudImportComponent.cjs +2 -0
- package/dist/src/components/crud/import/CrudImportComponent.js +221 -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 +57 -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.cjs +1 -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/_virtual/FileSaver.min.js +0 -1
- package/dist/_virtual/ShowMoreText.js +0 -1
- package/dist/_virtual/index6.js +0 -1
- package/dist/_virtual/index7.js +0 -1
- package/dist/_virtual/index8.js +0 -1
- package/dist/_virtual/main.js +0 -1
- package/dist/_virtual/papaparse.min.js +0 -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/import/CrudImportComponent.js +0 -2
- 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/locale/translations/en.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/_virtual/{FileSaver.min2.js → advancedFormat2.cjs} +0 -0
- /package/dist/_virtual/{main2.js → customParseFormat2.cjs} +0 -0
- /package/dist/_virtual/{papaparse.min2.js → dayjs.min2.cjs} +0 -0
- /package/dist/_virtual/{ShowMoreText2.js → index4.cjs} +0 -0
- /package/dist/_virtual/{Truncate.js → react-is.development.cjs} +0 -0
- /package/dist/_virtual/{index10.js → react-is.production.min.cjs} +0 -0
- /package/dist/_virtual/{index9.js → react-jsx-runtime.development.cjs} +0 -0
- /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/{util/NumberUtil.js → src/util/NumberUtil.cjs} +0 -0
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { j as o } from "../../../../_virtual/jsx-runtime.js";
|
|
2
|
+
import { PlusOutlined as u } from "@ant-design/icons";
|
|
3
|
+
import { useTranslation as f } from "react-i18next";
|
|
4
|
+
import x from "./Button.js";
|
|
5
|
+
import { TRANSLATION_NAMESPACE as a } from "../../../locale/hooks/translation-constants.js";
|
|
6
|
+
const E = ({ size: r, block: n, className: m, type: i = "primary", onClick: t, title: s, to: e }) => {
|
|
7
|
+
const { t: p } = f(a);
|
|
8
|
+
return /* @__PURE__ */ o.jsx(
|
|
9
|
+
x,
|
|
10
|
+
{
|
|
11
|
+
type: i,
|
|
12
|
+
className: m,
|
|
13
|
+
to: e,
|
|
14
|
+
block: n,
|
|
15
|
+
size: r,
|
|
16
|
+
onClick: t && (() => t(!0)),
|
|
17
|
+
icon: /* @__PURE__ */ o.jsx(u, {}),
|
|
18
|
+
children: s ?? p("str.new")
|
|
19
|
+
}
|
|
20
|
+
);
|
|
21
|
+
};
|
|
22
|
+
export {
|
|
23
|
+
E as NewButton
|
|
24
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("../../../../_virtual/jsx-runtime.cjs"),x=require("@ant-design/icons"),p=require("react-i18next"),j=require("./Button.cjs"),m=require("../../../locale/hooks/translation-constants.cjs"),d=({disabled:e,loading:s,block:i,className:o,type:u="primary",onClick:c,title:a,to:l})=>{const{t:n}=p.useTranslation(m.TRANSLATION_NAMESPACE),t=a??n("str.print");return r.jsxRuntimeExports.jsx(j.default,{type:u,className:o,to:l,loading:s,disabled:e,block:i,onClick:c,tooltip:t!=null&&t.trim()?"":n("str.print"),icon:r.jsxRuntimeExports.jsx(x.PrinterOutlined,{}),children:t})};exports.PrintButton=d;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { j as o } from "../../../../_virtual/jsx-runtime.js";
|
|
2
|
+
import { PrinterOutlined as f } from "@ant-design/icons";
|
|
3
|
+
import { useTranslation as x } from "react-i18next";
|
|
4
|
+
import a from "./Button.js";
|
|
5
|
+
import { TRANSLATION_NAMESPACE as j } from "../../../locale/hooks/translation-constants.js";
|
|
6
|
+
const T = ({ disabled: n, loading: i, block: m, className: p, type: s = "primary", onClick: e, title: u, to: c }) => {
|
|
7
|
+
const { t: r } = x(j), t = u ?? r("str.print");
|
|
8
|
+
return /* @__PURE__ */ o.jsx(
|
|
9
|
+
a,
|
|
10
|
+
{
|
|
11
|
+
type: s,
|
|
12
|
+
className: p,
|
|
13
|
+
to: c,
|
|
14
|
+
loading: i,
|
|
15
|
+
disabled: n,
|
|
16
|
+
block: m,
|
|
17
|
+
onClick: e,
|
|
18
|
+
tooltip: t != null && t.trim() ? "" : r("str.print"),
|
|
19
|
+
icon: /* @__PURE__ */ o.jsx(f, {}),
|
|
20
|
+
children: t
|
|
21
|
+
}
|
|
22
|
+
);
|
|
23
|
+
};
|
|
24
|
+
export {
|
|
25
|
+
T as PrintButton
|
|
26
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../../../../_virtual/jsx-runtime.cjs"),a=require("@ant-design/icons"),l=require("react-i18next"),x=require("../../../locale/hooks/translation-constants.cjs"),R=require("./Button.cjs"),d=({disabled:r,block:n,className:s,type:o="primary",onClick:t,title:u,to:i})=>{const{t:c}=l.useTranslation(x.TRANSLATION_NAMESPACE);return e.jsxRuntimeExports.jsx(R.default,{type:o,disabled:r,className:s,to:i,block:n,onClick:t&&(()=>t(!0)),icon:e.jsxRuntimeExports.jsx(a.ReloadOutlined,{}),children:u??c("str.refresh")})};exports.RefreshButton=d;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { j as o } from "../../../../_virtual/jsx-runtime.js";
|
|
2
|
+
import { ReloadOutlined as f } from "@ant-design/icons";
|
|
3
|
+
import { useTranslation as u } from "react-i18next";
|
|
4
|
+
import { TRANSLATION_NAMESPACE as a } from "../../../locale/hooks/translation-constants.js";
|
|
5
|
+
import x from "./Button.js";
|
|
6
|
+
const d = ({ disabled: t, block: e, className: m, type: n = "primary", onClick: r, title: s, to: i }) => {
|
|
7
|
+
const { t: p } = u(a);
|
|
8
|
+
return /* @__PURE__ */ o.jsx(
|
|
9
|
+
x,
|
|
10
|
+
{
|
|
11
|
+
type: n,
|
|
12
|
+
disabled: t,
|
|
13
|
+
className: m,
|
|
14
|
+
to: i,
|
|
15
|
+
block: e,
|
|
16
|
+
onClick: r && (() => r(!0)),
|
|
17
|
+
icon: /* @__PURE__ */ o.jsx(f, {}),
|
|
18
|
+
children: s ?? p("str.refresh")
|
|
19
|
+
}
|
|
20
|
+
);
|
|
21
|
+
};
|
|
22
|
+
export {
|
|
23
|
+
d as RefreshButton
|
|
24
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("../../../../_virtual/jsx-runtime.cjs"),p=require("@ant-design/icons"),q=require("antd"),n=require("react"),E=require("react-i18next"),j=require("./Button.cjs"),R=require("../../../locale/hooks/translation-constants.cjs");function g({shouldConfirm:m=!0,block:r,value:i,loading:u,onClick:a,text:c,disabled:l,type:x="link",hidden:C}){const{t:e}=E.useTranslation(R.TRANSLATION_NAMESPACE),s=n.useMemo(()=>c??e("str.unhide"),[c,e]),[d,o]=n.useState(!1);n.useEffect(()=>{o(u??!1)},[u]);const f=n.useCallback(async()=>{try{o(!0),await a(i)}finally{o(!1)}},[a,i]);return m?t.jsxRuntimeExports.jsx(q.Popconfirm,{title:e("qus.doYouWantToHide"),okText:s.toUpperCase(),cancelText:e("str.no").toUpperCase(),onConfirm:f,children:t.jsxRuntimeExports.jsx(j.default,{tooltip:s,icon:t.jsxRuntimeExports.jsx(p.UpCircleOutlined,{}),disabled:l,loading:d,type:x,danger:!0,hidden:C,block:r})}):t.jsxRuntimeExports.jsx(j.default,{tooltip:s,icon:t.jsxRuntimeExports.jsx(p.UpCircleOutlined,{}),disabled:l,loading:d,type:x,danger:!0,block:r,onClick:f})}exports.default=g;
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { j as t } from "../../../../_virtual/jsx-runtime.js";
|
|
2
|
+
import { UpCircleOutlined as c } from "@ant-design/icons";
|
|
3
|
+
import { Popconfirm as j } from "antd";
|
|
4
|
+
import { useMemo as T, useState as g, useEffect as A, useCallback as E } from "react";
|
|
5
|
+
import { useTranslation as U } from "react-i18next";
|
|
6
|
+
import d from "./Button.js";
|
|
7
|
+
import { TRANSLATION_NAMESPACE as _ } from "../../../locale/hooks/translation-constants.js";
|
|
8
|
+
function M({
|
|
9
|
+
shouldConfirm: x = !0,
|
|
10
|
+
block: e,
|
|
11
|
+
value: i,
|
|
12
|
+
loading: s,
|
|
13
|
+
onClick: a,
|
|
14
|
+
text: m,
|
|
15
|
+
disabled: u,
|
|
16
|
+
type: f = "link",
|
|
17
|
+
hidden: C
|
|
18
|
+
}) {
|
|
19
|
+
const { t: o } = U(_), n = T(() => m ?? o("str.unhide"), [m, o]), [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 x ? /* @__PURE__ */ t.jsx(
|
|
34
|
+
j,
|
|
35
|
+
{
|
|
36
|
+
title: o("qus.doYouWantToHide"),
|
|
37
|
+
okText: n.toUpperCase(),
|
|
38
|
+
cancelText: o("str.no").toUpperCase(),
|
|
39
|
+
onConfirm: p,
|
|
40
|
+
children: /* @__PURE__ */ t.jsx(
|
|
41
|
+
d,
|
|
42
|
+
{
|
|
43
|
+
tooltip: n,
|
|
44
|
+
icon: /* @__PURE__ */ t.jsx(c, {}),
|
|
45
|
+
disabled: u,
|
|
46
|
+
loading: l,
|
|
47
|
+
type: f,
|
|
48
|
+
danger: !0,
|
|
49
|
+
hidden: C,
|
|
50
|
+
block: e
|
|
51
|
+
}
|
|
52
|
+
)
|
|
53
|
+
}
|
|
54
|
+
) : /* @__PURE__ */ t.jsx(
|
|
55
|
+
d,
|
|
56
|
+
{
|
|
57
|
+
tooltip: n,
|
|
58
|
+
icon: /* @__PURE__ */ t.jsx(c, {}),
|
|
59
|
+
disabled: u,
|
|
60
|
+
loading: l,
|
|
61
|
+
type: f,
|
|
62
|
+
danger: !0,
|
|
63
|
+
block: e,
|
|
64
|
+
onClick: p
|
|
65
|
+
}
|
|
66
|
+
);
|
|
67
|
+
}
|
|
68
|
+
export {
|
|
69
|
+
M as default
|
|
70
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("../../../../_virtual/jsx-runtime.cjs"),s=require("@ant-design/icons"),r=require("react-i18next"),u=require("./Button.cjs"),i=require("../../../locale/hooks/translation-constants.cjs");function a({value:e,onClick:n}){const{t:o}=r.useTranslation(i.TRANSLATION_NAMESPACE);return t.jsxRuntimeExports.jsx(u.default,{tooltip:o("str.update"),type:"link",onClick:()=>n(e),icon:t.jsxRuntimeExports.jsx(s.EditOutlined,{})})}exports.default=a;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { j as t } from "../../../../_virtual/jsx-runtime.js";
|
|
2
|
+
import { EditOutlined as i } from "@ant-design/icons";
|
|
3
|
+
import { useTranslation as m } from "react-i18next";
|
|
4
|
+
import p from "./Button.js";
|
|
5
|
+
import { TRANSLATION_NAMESPACE as e } from "../../../locale/hooks/translation-constants.js";
|
|
6
|
+
function d({ value: o, onClick: r }) {
|
|
7
|
+
const { t: n } = m(e);
|
|
8
|
+
return /* @__PURE__ */ t.jsx(
|
|
9
|
+
p,
|
|
10
|
+
{
|
|
11
|
+
tooltip: n("str.update"),
|
|
12
|
+
type: "link",
|
|
13
|
+
onClick: () => r(o),
|
|
14
|
+
icon: /* @__PURE__ */ t.jsx(i, {})
|
|
15
|
+
}
|
|
16
|
+
);
|
|
17
|
+
}
|
|
18
|
+
export {
|
|
19
|
+
d as default
|
|
20
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("../../../../_virtual/jsx-runtime.cjs"),s=require("@ant-design/icons"),i=require("react-i18next"),r=require("./Button.cjs"),u=require("../../../locale/hooks/translation-constants.cjs");function l({value:e,onClick:n}){const{t:o}=i.useTranslation(u.TRANSLATION_NAMESPACE);return t.jsxRuntimeExports.jsx(r.default,{type:"link",onClick:()=>n(e),icon:t.jsxRuntimeExports.jsx(s.EyeOutlined,{}),tooltip:o("str.view")})}exports.default=l;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { j as t } from "../../../../_virtual/jsx-runtime.js";
|
|
2
|
+
import { EyeOutlined as n } from "@ant-design/icons";
|
|
3
|
+
import { useTranslation as e } from "react-i18next";
|
|
4
|
+
import m from "./Button.js";
|
|
5
|
+
import { TRANSLATION_NAMESPACE as p } from "../../../locale/hooks/translation-constants.js";
|
|
6
|
+
function x({ value: o, onClick: r }) {
|
|
7
|
+
const { t: i } = e(p);
|
|
8
|
+
return /* @__PURE__ */ t.jsx(
|
|
9
|
+
m,
|
|
10
|
+
{
|
|
11
|
+
type: "link",
|
|
12
|
+
onClick: () => r(o),
|
|
13
|
+
icon: /* @__PURE__ */ t.jsx(n, {}),
|
|
14
|
+
tooltip: i("str.view")
|
|
15
|
+
}
|
|
16
|
+
);
|
|
17
|
+
}
|
|
18
|
+
export {
|
|
19
|
+
x as default
|
|
20
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const s=require("../../../../_virtual/jsx-runtime.cjs"),c=require("antd"),x=c.Form.Item,m=({onChange:e,label:u,initialValue:t=!1,disabled:n,switch:o=!1,...d})=>s.jsxRuntimeExports.jsxs(x,{...d,valuePropName:"checked",initialValue:t,label:o?u:void 0,children:[!!o&&s.jsxRuntimeExports.jsx(c.Switch,{disabled:n,defaultChecked:t,onChange:e&&(r=>e(r))}),!o&&s.jsxRuntimeExports.jsx(c.Checkbox,{disabled:n,defaultChecked:t,onChange:e&&(r=>e(r.target.checked)),children:u})]});exports.default=m;
|
|
@@ -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";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const o=require("../../../../_virtual/jsx-runtime.cjs"),n=require("antd"),c=require("react"),a=require("../../../util/NumberUtil.cjs"),l=n.Descriptions.Item,m=({list:r,keepEmptyValues:s,...i})=>{const u=c.useMemo(()=>{const t=s?r:r.filter(e=>e&&!!e.value);return t.forEach(e=>{!e.noFormatting&&!isNaN(e.value)&&(e.value=a.default.toMoney(e.value))}),t},[s,r]);return o.jsxRuntimeExports.jsx(n.Descriptions,{...i,children:u.map(({label:t,value:e})=>o.jsxRuntimeExports.jsx(l,{label:t,children:e},t))})};exports.default=m;
|
|
@@ -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";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const r=require("../../../../_virtual/jsx-runtime.cjs"),i=require("antd"),s=({children:e,className:t=""})=>r.jsxRuntimeExports.jsx(i.Space,{direction:"vertical",className:[t,"w-100"].join(" "),children:e});exports.default=s;
|
|
@@ -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";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("../../../../_virtual/jsx-runtime.cjs"),r=require("antd"),a=require("react-i18next"),u=require("../button/Button.cjs"),i=require("../../../locale/hooks/translation-constants.cjs"),l=({loading:s,children:n,error:o})=>{const{t:e}=a.useTranslation(i.TRANSLATION_NAMESPACE);return t.jsxRuntimeExports.jsx(r.Skeleton,{loading:s,paragraph:!0,className:"h-100",children:o?t.jsxRuntimeExports.jsx(r.Result,{status:"404",title:404,subTitle:e("err.notFound"),className:"",extra:t.jsxRuntimeExports.jsx(u.default,{to:-1,type:"primary",children:e("str.goBack")})}):n})};exports.default=l;
|
|
@@ -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 { useTranslation as m } from "react-i18next";
|
|
4
|
+
import i from "../button/Button.js";
|
|
5
|
+
import { TRANSLATION_NAMESPACE as p } from "../../../locale/hooks/translation-constants.js";
|
|
6
|
+
const f = ({ loading: o, children: s, error: e }) => {
|
|
7
|
+
const { t: r } = m(p);
|
|
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(i, { 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 v=require("@ant-design/icons"),I=require("antd"),s=require("react"),je=require("react-cropper"),ge=require("react-i18next"),Re=require("../../../locale/hooks/translation-constants.cjs"),A=require("../button/Button.cjs"),he=require("../../../util/ImageUtil.cjs"),Ee=I.Form.Item;function X(r){return new Promise((u,x)=>{const n=new FileReader;n.readAsDataURL(r),n.onload=()=>u(n.result),n.onerror=p=>x(p)})}const we=({values:r=[],required:u,buttonType:x,label:n,name:p,onChange:m,aspectRatio:F,buttonTitle:R,hidePreview:h,buttonSize:f="large",showButtonText:j=!0,showOnlyIcon:D=!1,icon:b=t.jsxRuntimeExports.jsx(v.UploadOutlined,{}),loading:S,maxCount:E=1,onAdd:l,onRemove:y,listType:O,..._})=>{const[Z,ee]=s.useState(""),[te,se]=s.useState(""),[re,z]=s.useState(!1),N=s.useRef(),i=s.useRef(),[a,q]=s.useState([]),[g,M]=s.useState(),ne=s.useRef(),oe=()=>z(!1),ie=async e=>{!e.url&&!e.preview&&(e.preview=await X(e.originFileObj)),se(e.url||e.preview),z(!0),ee(e.name)},[B,U]=s.useState(!1),ae=()=>{},T=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}=N.current;U(!0),e==null||e.toBlob(async me=>{const fe=Object.assign(new File([me],d,{type:o}),{uid:w}),G=await he.default.resizeImage(fe),K=await X(G),Q={url:K,name:d,uid:w,type:o,size:c,thumbUrl:K,originFileObj:G};if(l)try{U(!0),await l(Q)}finally{U(!1)}q([Q,...a]),U(!1)}),M(void 0)},le=()=>{M(void 0),N.current=void 0},L=s.useCallback(e=>{const o=e;if(o){N.current=o;const c=new FileReader;c.addEventListener("load",()=>{var d;if(typeof c.result=="string"){M(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(()=>{H()},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}];q(e)}},[r]);const{t:k}=ge.useTranslation(Re.TRANSLATION_NAMESPACE),ue=s.useMemo(()=>u?{required:u,validator:(e,o,c)=>{g||a!=null&&a.length?c():c(`${n??""} ${k("err.validation.required")}`)}}:void 0,[u,g,a==null?void 0:a.length,n,k]),J=R??k("message.fileUploadMessage2"),V=s.useMemo(()=>t.jsxRuntimeExports.jsx(Y,{showLoadingIndicator:B,_buttonTitle:J,buttonSize:f,buttonType:x,fileList:a,hidePreview:h,icon:b,loading:S,listType:O,maxCount:E,onChangeFile:L,onRemove:y,showButtonText:j,handlePreview:ie,setFileList:q}),[B,J,f,x,a,h,b,S,O,E,L,y,j]);ne.current=V.props.beforeUpload;const[de,W]=s.useState(0),[xe,$]=s.useState(0),[P,pe]=s.useState();s.useEffect(()=>{const e=setTimeout(()=>{P&&localStorage.setItem("cropper.box",JSON.stringify(P))},400);return()=>clearTimeout(e)},[P]),s.useEffect(()=>{g||(W(0),$(0))},[g]);const H=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()),W(c),$(d)}},[]);return t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsx(Ee,{label:n,..._,name:p,className:"mb-0",rules:[ue,..._.rules??[]],children:V}),t.jsxRuntimeExports.jsxs(I.Modal,{open:!!g,maskClosable:!1,onOk:ce,closable:!1,onCancel:le,children:[t.jsxRuntimeExports.jsx(je.Cropper,{ref:i,src:g,cropmove:H,viewMode:1,aspectRatio:F,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(A.default,{size:"large",icon:t.jsxRuntimeExports.jsx(v.RotateLeftOutlined,{}),onClick:()=>T(!0)}),t.jsxRuntimeExports.jsx(A.default,{size:"large",icon:t.jsxRuntimeExports.jsx(v.RotateRightOutlined,{}),onClick:()=>T(!1)})]})]}),t.jsxRuntimeExports.jsx(I.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:F,maxCount:R,onChangeFile:h,onRemove:f,showButtonText:j,handlePreview:D,setFileList:b,showLoadingIndicator:S,listType:E="picture"})=>t.jsxRuntimeExports.jsx(t.jsxRuntimeExports.Fragment,{children:t.jsxRuntimeExports.jsxs(I.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:D,onDrop:l=>(h(l.dataTransfer.files.item(0)),!1),listType:E,showUploadList:!p,onRemove:l=>{const y=n.filter(O=>l.uid!==O.uid);f==null||f(l),b(y)},beforeUpload:async l=>(h(l),!1),maxCount:R,children:[S&&t.jsxRuntimeExports.jsx(v.LoadingOutlined,{}),t.jsxRuntimeExports.jsx("div",{className:"d-flex flex-column",children:n.length<R&&(E==="picture-circle"?t.jsxRuntimeExports.jsx(v.UploadOutlined,{}):t.jsxRuntimeExports.jsx(A.default,{loading:F,tooltip:j?void 0:r,size:u,icon:m,type:j?x:"text",children:j?r:void 0}))})]},n.length)});exports.UploadComponent=Y;exports.default=we;
|
|
@@ -0,0 +1,282 @@
|
|
|
1
|
+
import { j as t } from "../../../../_virtual/jsx-runtime.js";
|
|
2
|
+
/* empty css */
|
|
3
|
+
/* empty css */
|
|
4
|
+
import { RotateLeftOutlined as Ce, RotateRightOutlined as ve, UploadOutlined as re, LoadingOutlined as be } from "@ant-design/icons";
|
|
5
|
+
import { Form as ye, Modal as Z, Upload as Ie } from "antd";
|
|
6
|
+
import M, { useRef as z, useState as h, useEffect as N, useCallback as q, useMemo as ee } from "react";
|
|
7
|
+
import { Cropper as Oe } from "react-cropper";
|
|
8
|
+
import { useTranslation as Ue } from "react-i18next";
|
|
9
|
+
import { TRANSLATION_NAMESPACE as Fe } from "../../../locale/hooks/translation-constants.js";
|
|
10
|
+
import B from "../button/Button.js";
|
|
11
|
+
import Ne from "../../../util/ImageUtil.js";
|
|
12
|
+
const Re = ye.Item;
|
|
13
|
+
function te(r) {
|
|
14
|
+
return new Promise((l, m) => {
|
|
15
|
+
const o = new FileReader();
|
|
16
|
+
o.readAsDataURL(r), o.onload = () => l(o.result), o.onerror = (p) => m(p);
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
const Je = ({
|
|
20
|
+
values: r = [],
|
|
21
|
+
required: l,
|
|
22
|
+
buttonType: m,
|
|
23
|
+
label: o,
|
|
24
|
+
name: p,
|
|
25
|
+
onChange: f,
|
|
26
|
+
aspectRatio: R,
|
|
27
|
+
buttonTitle: j,
|
|
28
|
+
hidePreview: w,
|
|
29
|
+
buttonSize: u = "large",
|
|
30
|
+
showButtonText: g = !0,
|
|
31
|
+
showOnlyIcon: E = !1,
|
|
32
|
+
icon: y = /* @__PURE__ */ t.jsx(re, {}),
|
|
33
|
+
loading: I,
|
|
34
|
+
maxCount: C = 1,
|
|
35
|
+
onAdd: c,
|
|
36
|
+
onRemove: O,
|
|
37
|
+
listType: U,
|
|
38
|
+
..._
|
|
39
|
+
}) => {
|
|
40
|
+
const [oe, se] = M.useState(""), [ne, ie] = M.useState(""), [ae, L] = M.useState(!1), S = z(), n = z(), [i, k] = h([]), [x, A] = h(), ce = z(), le = () => L(!1), de = async (e) => {
|
|
41
|
+
!e.url && !e.preview && (e.preview = await te(e.originFileObj)), ie(e.url || e.preview), L(!0), se(e.name);
|
|
42
|
+
}, [T, F] = h(!1), me = () => {
|
|
43
|
+
}, J = (e) => {
|
|
44
|
+
var s;
|
|
45
|
+
(s = n == null ? void 0 : n.current) == null || s.cropper.rotate(e ? -90 : 90);
|
|
46
|
+
};
|
|
47
|
+
N(() => {
|
|
48
|
+
f == null || f(i[0], i);
|
|
49
|
+
}, [i, f]);
|
|
50
|
+
const pe = () => {
|
|
51
|
+
var b;
|
|
52
|
+
const e = (b = n == null ? void 0 : n.current) == null ? void 0 : b.cropper.getCroppedCanvas(), { type: s, size: a, name: d, uid: v } = S.current;
|
|
53
|
+
F(!0), e == null || e.toBlob(async (je) => {
|
|
54
|
+
const we = Object.assign(new File([je], d, { type: s }), {
|
|
55
|
+
uid: v
|
|
56
|
+
}), Q = await Ne.resizeImage(we), X = await te(Q), Y = {
|
|
57
|
+
url: X,
|
|
58
|
+
name: d,
|
|
59
|
+
uid: v,
|
|
60
|
+
type: s,
|
|
61
|
+
size: a,
|
|
62
|
+
thumbUrl: X,
|
|
63
|
+
originFileObj: Q
|
|
64
|
+
};
|
|
65
|
+
if (c)
|
|
66
|
+
try {
|
|
67
|
+
F(!0), await c(Y);
|
|
68
|
+
} finally {
|
|
69
|
+
F(!1);
|
|
70
|
+
}
|
|
71
|
+
k([Y, ...i]), F(!1);
|
|
72
|
+
}), A(void 0);
|
|
73
|
+
}, fe = () => {
|
|
74
|
+
A(void 0), S.current = void 0;
|
|
75
|
+
}, V = q((e) => {
|
|
76
|
+
const s = e;
|
|
77
|
+
if (s) {
|
|
78
|
+
S.current = s;
|
|
79
|
+
const a = new FileReader();
|
|
80
|
+
a.addEventListener("load", () => {
|
|
81
|
+
var d;
|
|
82
|
+
if (typeof a.result == "string") {
|
|
83
|
+
A(a.result);
|
|
84
|
+
const v = localStorage.getItem("cropper.box"), b = v ? JSON.parse(v) : void 0;
|
|
85
|
+
b && ((d = n == null ? void 0 : n.current) == null || d.cropper.setCropBoxData(b)), setTimeout(() => {
|
|
86
|
+
K();
|
|
87
|
+
}, 100);
|
|
88
|
+
}
|
|
89
|
+
}), a.readAsDataURL(s);
|
|
90
|
+
}
|
|
91
|
+
}, []);
|
|
92
|
+
N(() => {
|
|
93
|
+
if (r != null && r.length || typeof r == "string") {
|
|
94
|
+
const e = Array.isArray(r) ? r.map((s) => [{ uid: r, url: s }]) : [{ uid: r, url: r }];
|
|
95
|
+
k(e);
|
|
96
|
+
}
|
|
97
|
+
}, [r]);
|
|
98
|
+
const { t: P } = Ue(Fe), ue = ee(
|
|
99
|
+
() => l ? {
|
|
100
|
+
required: l,
|
|
101
|
+
validator: (e, s, a) => {
|
|
102
|
+
x || i != null && i.length ? a() : a(`${o ?? ""} ${P("err.validation.required")}`);
|
|
103
|
+
}
|
|
104
|
+
} : void 0,
|
|
105
|
+
[l, x, i == null ? void 0 : i.length, o, P]
|
|
106
|
+
), W = j ?? P("message.fileUploadMessage2"), $ = ee(
|
|
107
|
+
() => /* @__PURE__ */ t.jsx(
|
|
108
|
+
Se,
|
|
109
|
+
{
|
|
110
|
+
showLoadingIndicator: T,
|
|
111
|
+
_buttonTitle: W,
|
|
112
|
+
buttonSize: u,
|
|
113
|
+
buttonType: m,
|
|
114
|
+
fileList: i,
|
|
115
|
+
hidePreview: w,
|
|
116
|
+
icon: y,
|
|
117
|
+
loading: I,
|
|
118
|
+
listType: U,
|
|
119
|
+
maxCount: C,
|
|
120
|
+
onChangeFile: V,
|
|
121
|
+
onRemove: O,
|
|
122
|
+
showButtonText: g,
|
|
123
|
+
handlePreview: de,
|
|
124
|
+
setFileList: k
|
|
125
|
+
}
|
|
126
|
+
),
|
|
127
|
+
[
|
|
128
|
+
T,
|
|
129
|
+
W,
|
|
130
|
+
u,
|
|
131
|
+
m,
|
|
132
|
+
i,
|
|
133
|
+
w,
|
|
134
|
+
y,
|
|
135
|
+
I,
|
|
136
|
+
U,
|
|
137
|
+
C,
|
|
138
|
+
V,
|
|
139
|
+
O,
|
|
140
|
+
g
|
|
141
|
+
]
|
|
142
|
+
);
|
|
143
|
+
ce.current = $.props.beforeUpload;
|
|
144
|
+
const [ge, H] = h(0), [xe, G] = h(0), [D, he] = h();
|
|
145
|
+
N(() => {
|
|
146
|
+
const e = setTimeout(() => {
|
|
147
|
+
D && localStorage.setItem("cropper.box", JSON.stringify(D));
|
|
148
|
+
}, 400);
|
|
149
|
+
return () => clearTimeout(e);
|
|
150
|
+
}, [D]), N(() => {
|
|
151
|
+
x || (H(0), G(0));
|
|
152
|
+
}, [x]);
|
|
153
|
+
const K = q(async () => {
|
|
154
|
+
var s;
|
|
155
|
+
const e = (s = n == null ? void 0 : n.current) == null ? void 0 : s.cropper;
|
|
156
|
+
if (e) {
|
|
157
|
+
const { width: a, height: d } = e.getCroppedCanvas();
|
|
158
|
+
he(e.getCropBoxData()), H(a), G(d);
|
|
159
|
+
}
|
|
160
|
+
}, []);
|
|
161
|
+
return /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
|
|
162
|
+
/* @__PURE__ */ t.jsx(
|
|
163
|
+
Re,
|
|
164
|
+
{
|
|
165
|
+
label: o,
|
|
166
|
+
..._,
|
|
167
|
+
name: p,
|
|
168
|
+
className: "mb-0",
|
|
169
|
+
rules: [ue, ..._.rules ?? []],
|
|
170
|
+
children: $
|
|
171
|
+
}
|
|
172
|
+
),
|
|
173
|
+
/* @__PURE__ */ t.jsxs(
|
|
174
|
+
Z,
|
|
175
|
+
{
|
|
176
|
+
open: !!x,
|
|
177
|
+
maskClosable: !1,
|
|
178
|
+
onOk: pe,
|
|
179
|
+
closable: !1,
|
|
180
|
+
onCancel: fe,
|
|
181
|
+
children: [
|
|
182
|
+
/* @__PURE__ */ t.jsx(
|
|
183
|
+
Oe,
|
|
184
|
+
{
|
|
185
|
+
ref: n,
|
|
186
|
+
src: x,
|
|
187
|
+
cropmove: K,
|
|
188
|
+
viewMode: 1,
|
|
189
|
+
aspectRatio: R,
|
|
190
|
+
cropend: () => me()
|
|
191
|
+
}
|
|
192
|
+
),
|
|
193
|
+
/* @__PURE__ */ t.jsx("p", { className: "text-center", children: [ge, xe].join(" ⨉ ") }),
|
|
194
|
+
/* @__PURE__ */ t.jsxs("div", { className: "mt-2 d-flex justify-content-center", children: [
|
|
195
|
+
/* @__PURE__ */ t.jsx(
|
|
196
|
+
B,
|
|
197
|
+
{
|
|
198
|
+
size: "large",
|
|
199
|
+
icon: /* @__PURE__ */ t.jsx(Ce, {}),
|
|
200
|
+
onClick: () => J(!0)
|
|
201
|
+
}
|
|
202
|
+
),
|
|
203
|
+
/* @__PURE__ */ t.jsx(
|
|
204
|
+
B,
|
|
205
|
+
{
|
|
206
|
+
size: "large",
|
|
207
|
+
icon: /* @__PURE__ */ t.jsx(ve, {}),
|
|
208
|
+
onClick: () => J(!1)
|
|
209
|
+
}
|
|
210
|
+
)
|
|
211
|
+
] })
|
|
212
|
+
]
|
|
213
|
+
}
|
|
214
|
+
),
|
|
215
|
+
/* @__PURE__ */ t.jsx(
|
|
216
|
+
Z,
|
|
217
|
+
{
|
|
218
|
+
open: ae,
|
|
219
|
+
title: oe,
|
|
220
|
+
footer: null,
|
|
221
|
+
onCancel: le,
|
|
222
|
+
children: /* @__PURE__ */ t.jsx("div", { className: "text-center", children: /* @__PURE__ */ t.jsx("img", { alt: "example", style: { maxWidth: "400px" }, src: ne }) })
|
|
223
|
+
}
|
|
224
|
+
)
|
|
225
|
+
] });
|
|
226
|
+
}, Se = ({
|
|
227
|
+
_buttonTitle: r,
|
|
228
|
+
buttonSize: l,
|
|
229
|
+
buttonType: m,
|
|
230
|
+
fileList: o,
|
|
231
|
+
hidePreview: p,
|
|
232
|
+
icon: f,
|
|
233
|
+
loading: R,
|
|
234
|
+
maxCount: j,
|
|
235
|
+
onChangeFile: w,
|
|
236
|
+
onRemove: u,
|
|
237
|
+
showButtonText: g,
|
|
238
|
+
handlePreview: E,
|
|
239
|
+
setFileList: y,
|
|
240
|
+
showLoadingIndicator: I,
|
|
241
|
+
listType: C = "picture"
|
|
242
|
+
}) => /* @__PURE__ */ t.jsx(t.Fragment, { children: /* @__PURE__ */ t.jsxs(
|
|
243
|
+
Ie,
|
|
244
|
+
{
|
|
245
|
+
accept: "image/x-png,image/gif,image/jpeg",
|
|
246
|
+
fileList: o,
|
|
247
|
+
defaultFileList: o,
|
|
248
|
+
onChange: () => {
|
|
249
|
+
},
|
|
250
|
+
className: (o.length >= j ? " hide-upload " : "") + " mb-0",
|
|
251
|
+
multiple: !1,
|
|
252
|
+
onPreview: p ? void 0 : E,
|
|
253
|
+
onDrop: (c) => (w(c.dataTransfer.files.item(0)), !1),
|
|
254
|
+
listType: C,
|
|
255
|
+
showUploadList: !p,
|
|
256
|
+
onRemove: (c) => {
|
|
257
|
+
const O = o.filter((U) => c.uid !== U.uid);
|
|
258
|
+
u == null || u(c), y(O);
|
|
259
|
+
},
|
|
260
|
+
beforeUpload: async (c) => (w(c), !1),
|
|
261
|
+
maxCount: j,
|
|
262
|
+
children: [
|
|
263
|
+
I && /* @__PURE__ */ t.jsx(be, {}),
|
|
264
|
+
/* @__PURE__ */ t.jsx("div", { className: "d-flex flex-column", children: o.length < j && (C === "picture-circle" ? /* @__PURE__ */ t.jsx(re, {}) : /* @__PURE__ */ t.jsx(
|
|
265
|
+
B,
|
|
266
|
+
{
|
|
267
|
+
loading: R,
|
|
268
|
+
tooltip: g ? void 0 : r,
|
|
269
|
+
size: l,
|
|
270
|
+
icon: f,
|
|
271
|
+
type: g ? m : "text",
|
|
272
|
+
children: g ? r : void 0
|
|
273
|
+
}
|
|
274
|
+
)) })
|
|
275
|
+
]
|
|
276
|
+
},
|
|
277
|
+
o.length
|
|
278
|
+
) });
|
|
279
|
+
export {
|
|
280
|
+
Se as UploadComponent,
|
|
281
|
+
Je as default
|
|
282
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const s=require("../../../../_virtual/jsx-runtime.cjs"),u=require("antd"),i=require("react"),d=({button:a,disabled:m,...t})=>{const c=i.useMemo(()=>{const{enum:e,translations:o}=t;if(e){const r=[];for(const n of e)r.push({key:n,value:(o==null?void 0:o[n])??n.toUpperCase()});return r}else return t.values},[t]),l=a?u.Radio.Button:u.Radio;return s.jsxRuntimeExports.jsx(u.Form.Item,{...t,children:s.jsxRuntimeExports.jsx(u.Radio.Group,{disabled:m,children:c.map(({key:e,value:o})=>s.jsxRuntimeExports.jsx(l,{value:e,children:o},e))})})},x=i.memo(d);exports.default=x;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { j as u } from "../../../../_virtual/jsx-runtime.js";
|
|
2
|
+
import { Radio as m, Form as i } from "antd";
|
|
3
|
+
import { memo as p, useMemo as d } from "react";
|
|
4
|
+
const f = ({ button: s, disabled: a, ...n }) => {
|
|
5
|
+
const l = d(() => {
|
|
6
|
+
const { enum: e, translations: o } = n;
|
|
7
|
+
if (e) {
|
|
8
|
+
const r = [];
|
|
9
|
+
for (const t of e)
|
|
10
|
+
r.push({ key: t, value: (o == null ? void 0 : o[t]) ?? t.toUpperCase() });
|
|
11
|
+
return r;
|
|
12
|
+
} else
|
|
13
|
+
return n.values;
|
|
14
|
+
}, [n]), c = s ? m.Button : m;
|
|
15
|
+
return /* @__PURE__ */ u.jsx(i.Item, { ...n, children: /* @__PURE__ */ u.jsx(m.Group, { disabled: a, children: l.map(({ key: e, value: o }) => /* @__PURE__ */ u.jsx(c, { value: e, children: o }, e)) }) });
|
|
16
|
+
}, h = p(f);
|
|
17
|
+
export {
|
|
18
|
+
h as default
|
|
19
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("../../../../_virtual/jsx-runtime.cjs"),u=require("antd"),o=require("react"),f=require("../select/SelectComponent.cjs"),j=({className:a,onSelect:d,label:p,required:S,name:l,mode:s,items:t})=>{const r=u.Form.useFormInstance(),[n,x]=o.useState(!0);return o.useEffect(()=>{if(t&&n){const e=t.filter(i=>i.alreadySelected).map(i=>i.id);r==null||r.setFieldsValue({[l]:s==="multiple"?e:e==null?void 0:e[0]}),x(!1)}},[n,r,t,s,l]),c.jsxRuntimeExports.jsx(f.default,{required:S,label:p,mode:s,className:a,name:l,onSelect:d,items:t,itemBuilder:e=>c.jsxRuntimeExports.jsx(u.Select.Option,{value:e.id,disabled:e.lock,children:e.label},e.id)})};exports.SelectFieldInReport=j;
|