@kingteza/crud-component 1.0.24 → 1.0.25

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.
Files changed (204) hide show
  1. package/App.d.ts +2 -0
  2. package/components/common/DatePicker/DatePicker.cjs +1 -0
  3. package/components/common/DatePicker/DatePicker.d.ts +37 -0
  4. package/components/common/DatePicker/DatePicker.js +88 -0
  5. package/components/common/DatePicker/TimePicker.cjs +1 -0
  6. package/components/common/DatePicker/TimePicker.d.ts +34 -0
  7. package/components/common/DatePicker/TimePicker.js +78 -0
  8. package/components/common/DatePicker/index.d.ts +3 -0
  9. package/components/common/appearance/Hider.cjs +1 -0
  10. package/components/common/appearance/Hider.d.ts +6 -0
  11. package/components/common/appearance/Hider.js +5 -0
  12. package/components/common/appearance/index.d.ts +0 -0
  13. package/components/common/button/Button.cjs +1 -0
  14. package/components/common/button/Button.d.ts +12 -0
  15. package/components/common/button/Button.js +79 -0
  16. package/components/common/button/CloneButtonTable.cjs +1 -0
  17. package/components/common/button/CloneButtonTable.d.ts +6 -0
  18. package/components/common/button/CloneButtonTable.js +20 -0
  19. package/components/common/button/DeleteButtonTable.cjs +1 -0
  20. package/components/common/button/DeleteButtonTable.d.ts +13 -0
  21. package/components/common/button/DeleteButtonTable.js +68 -0
  22. package/components/common/button/ExportButton.cjs +1 -0
  23. package/components/common/button/ExportButton.d.ts +4 -0
  24. package/components/common/button/ExportButton.js +27 -0
  25. package/components/common/button/HideButtonTable.cjs +1 -0
  26. package/components/common/button/HideButtonTable.d.ts +13 -0
  27. package/components/common/button/HideButtonTable.js +68 -0
  28. package/components/common/button/ImportButton.cjs +1 -0
  29. package/components/common/button/ImportButton.d.ts +9 -0
  30. package/components/common/button/ImportButton.js +56 -0
  31. package/components/common/button/NewButton.cjs +1 -0
  32. package/components/common/button/NewButton.d.ts +12 -0
  33. package/components/common/button/NewButton.js +24 -0
  34. package/components/common/button/PrintButton.cjs +1 -0
  35. package/components/common/button/PrintButton.d.ts +12 -0
  36. package/components/common/button/PrintButton.js +26 -0
  37. package/components/common/button/RefreshButton.cjs +1 -0
  38. package/components/common/button/RefreshButton.d.ts +11 -0
  39. package/components/common/button/RefreshButton.js +24 -0
  40. package/components/common/button/UnHideButton.cjs +1 -0
  41. package/components/common/button/UnHideButton.d.ts +14 -0
  42. package/components/common/button/UnHideButton.js +70 -0
  43. package/components/common/button/UpdateButtonTable.cjs +1 -0
  44. package/components/common/button/UpdateButtonTable.d.ts +6 -0
  45. package/components/common/button/UpdateButtonTable.js +20 -0
  46. package/components/common/button/ViewButtonTable.cjs +1 -0
  47. package/components/common/button/ViewButtonTable.d.ts +6 -0
  48. package/components/common/button/ViewButtonTable.js +20 -0
  49. package/components/common/button/index.d.ts +14 -0
  50. package/components/common/check-box/CheckBox.cjs +1 -0
  51. package/components/common/check-box/CheckBox.d.ts +9 -0
  52. package/components/common/check-box/CheckBox.js +40 -0
  53. package/components/common/check-box/index.d.ts +2 -0
  54. package/components/common/description/DescList.cjs +1 -0
  55. package/components/common/description/DescList.d.ts +18 -0
  56. package/components/common/description/DescList.js +16 -0
  57. package/components/common/description/DescriptionComponent.d.ts +7 -0
  58. package/components/common/description/index.d.ts +3 -0
  59. package/components/common/index.d.ts +22 -0
  60. package/components/common/layout/VerticalSpace.cjs +1 -0
  61. package/components/common/layout/VerticalSpace.d.ts +5 -0
  62. package/components/common/layout/VerticalSpace.js +6 -0
  63. package/components/common/layout/index.d.ts +2 -0
  64. package/components/common/loading/LoadingIndicator.cjs +1 -0
  65. package/components/common/loading/LoadingIndicator.d.ts +6 -0
  66. package/components/common/loading/LoadingIndicator.js +24 -0
  67. package/components/common/loading/index.d.ts +2 -0
  68. package/components/common/picker/ImagePicker.cjs +1 -0
  69. package/components/common/picker/ImagePicker.d.ts +56 -0
  70. package/components/common/picker/ImagePicker.js +282 -0
  71. package/components/common/picker/index.d.ts +2 -0
  72. package/components/common/radio/RadioGroupComponent.cjs +1 -0
  73. package/components/common/radio/RadioGroupComponent.d.ts +18 -0
  74. package/components/common/radio/RadioGroupComponent.js +19 -0
  75. package/components/common/radio/index.d.ts +2 -0
  76. package/components/common/report/SelectFieldInReport.cjs +1 -0
  77. package/components/common/report/SelectFieldInReport.d.ts +16 -0
  78. package/components/common/report/SelectFieldInReport.js +30 -0
  79. package/components/common/report/index.d.ts +3 -0
  80. package/components/common/select/CustomSelectOption.cjs +1 -0
  81. package/components/common/select/CustomSelectOption.d.ts +7 -0
  82. package/components/common/select/CustomSelectOption.js +13 -0
  83. package/components/common/select/SelectComponent.cjs +1 -0
  84. package/components/common/select/SelectComponent.d.ts +21 -0
  85. package/components/common/select/SelectComponent.js +89 -0
  86. package/components/common/select/index.d.ts +3 -0
  87. package/components/common/show-more/index.cjs +1 -0
  88. package/components/common/show-more/index.d.ts +4 -0
  89. package/components/common/show-more/index.js +8 -0
  90. package/components/common/tab/TabViewWithRoute.cjs +1 -0
  91. package/components/common/tab/TabViewWithRoute.d.ts +13 -0
  92. package/components/common/tab/TabViewWithRoute.js +38 -0
  93. package/components/common/tab/index.d.ts +2 -0
  94. package/components/common/table/index.d.ts +3 -0
  95. package/components/common/table/table.cjs +1 -0
  96. package/components/common/table/table.d.ts +19 -0
  97. package/components/common/table/table.js +40 -0
  98. package/components/common/tag/StatusTag.cjs +1 -0
  99. package/components/common/tag/StatusTag.d.ts +14 -0
  100. package/components/common/tag/StatusTag.js +30 -0
  101. package/components/common/tag/index.d.ts +2 -0
  102. package/components/common/text/index.cjs +1 -0
  103. package/components/common/text/index.d.ts +3 -0
  104. package/components/common/text/index.js +5 -0
  105. package/components/common/text/title/TitleWithHeadTitle.d.ts +7 -0
  106. package/components/common/text/title/index.cjs +1 -0
  107. package/components/common/text/title/index.d.ts +1 -0
  108. package/components/common/text/title/index.js +5 -0
  109. package/components/common/text-field/NumberField.cjs +1 -0
  110. package/components/common/text-field/NumberField.d.ts +13 -0
  111. package/components/common/text-field/NumberField.js +83 -0
  112. package/components/common/text-field/PhoneNumberField.cjs +1 -0
  113. package/components/common/text-field/PhoneNumberField.d.ts +4 -0
  114. package/components/common/text-field/PhoneNumberField.js +18 -0
  115. package/components/common/text-field/TextArea.cjs +1 -0
  116. package/components/common/text-field/TextArea.d.ts +17 -0
  117. package/components/common/text-field/TextArea.js +47 -0
  118. package/components/common/text-field/TextField.cjs +1 -0
  119. package/components/common/text-field/TextField.d.ts +27 -0
  120. package/components/common/text-field/TextField.js +73 -0
  121. package/components/common/text-field/index.d.ts +5 -0
  122. package/components/common/tooltip/TooltipComponent.cjs +1 -0
  123. package/components/common/tooltip/TooltipComponent.d.ts +5 -0
  124. package/components/common/tooltip/TooltipComponent.js +9 -0
  125. package/components/common/tooltip/index.d.ts +2 -0
  126. package/components/common/wizard/WizardResult.cjs +1 -0
  127. package/components/common/wizard/WizardResult.d.ts +16 -0
  128. package/components/common/wizard/WizardResult.js +60 -0
  129. package/components/common/wizard/WizardViewForm.cjs +1 -0
  130. package/components/common/wizard/WizardViewForm.d.ts +24 -0
  131. package/components/common/wizard/WizardViewForm.js +74 -0
  132. package/components/common/wizard/index.d.ts +3 -0
  133. package/components/crud/CrudComponent.cjs +1 -0
  134. package/components/crud/CrudComponent.d.ts +237 -0
  135. package/components/crud/CrudComponent.js +210 -0
  136. package/components/crud/CrudField.cjs +1 -0
  137. package/components/crud/CrudField.d.ts +4 -0
  138. package/components/crud/CrudField.js +459 -0
  139. package/components/crud/CrudForm.cjs +1 -0
  140. package/components/crud/CrudForm.d.ts +14 -0
  141. package/components/crud/CrudForm.js +91 -0
  142. package/components/crud/CrudFormWizard.cjs +1 -0
  143. package/components/crud/CrudFormWizard.d.ts +14 -0
  144. package/components/crud/CrudFormWizard.js +140 -0
  145. package/components/crud/CrudReportComponent.cjs +4 -0
  146. package/components/crud/CrudReportComponent.d.ts +44 -0
  147. package/components/crud/CrudReportComponent.js +255 -0
  148. package/components/crud/CrudSearchComponent.cjs +1 -0
  149. package/components/crud/CrudSearchComponent.d.ts +21 -0
  150. package/components/crud/CrudSearchComponent.js +95 -0
  151. package/components/crud/FileCrudField.cjs +1 -0
  152. package/components/crud/FileCrudField.d.ts +25 -0
  153. package/components/crud/FileCrudField.js +220 -0
  154. package/components/crud/ImageCrudField.cjs +1 -0
  155. package/components/crud/ImageCrudField.d.ts +38 -0
  156. package/components/crud/ImageCrudField.js +113 -0
  157. package/components/crud/import/CrudImportButton.cjs +1 -0
  158. package/components/crud/import/CrudImportButton.d.ts +3 -0
  159. package/components/crud/import/CrudImportButton.js +31 -0
  160. package/components/crud/import/CrudImportComponent.cjs +2 -0
  161. package/components/crud/import/CrudImportComponent.d.ts +14 -0
  162. package/components/crud/import/CrudImportComponent.js +223 -0
  163. package/components/crud/index.d.ts +15 -0
  164. package/components/crud/view/CrudDecListView.cjs +1 -0
  165. package/components/crud/view/CrudDecListView.d.ts +14 -0
  166. package/components/crud/view/CrudDecListView.js +42 -0
  167. package/components/crud/view/CrudViewer.cjs +1 -0
  168. package/components/crud/view/CrudViewer.d.ts +43 -0
  169. package/components/crud/view/CrudViewer.js +217 -0
  170. package/components/crud/view/CrudViewerUtil.cjs +1 -0
  171. package/components/crud/view/CrudViewerUtil.d.ts +2 -0
  172. package/components/crud/view/CrudViewerUtil.js +57 -0
  173. package/components/crud/view/index.d.ts +5 -0
  174. package/index.cjs +1 -0
  175. package/index.d.ts +4 -0
  176. package/index.js +32 -0
  177. package/locale/hooks/translation-constants.cjs +1 -0
  178. package/locale/hooks/translation-constants.d.ts +1 -0
  179. package/locale/hooks/translation-constants.js +4 -0
  180. package/locale/index.cjs +1 -0
  181. package/locale/index.d.ts +74 -0
  182. package/locale/index.js +37 -0
  183. package/locale/translations/en.cjs +1 -0
  184. package/locale/translations/en.d.ts +58 -0
  185. package/locale/translations/en.js +60 -0
  186. package/main.d.ts +0 -0
  187. package/package.json +2 -2
  188. package/util/DateUtil.cjs +1 -0
  189. package/util/DateUtil.d.ts +7 -0
  190. package/util/DateUtil.js +6 -0
  191. package/util/ImageUtil.cjs +1 -0
  192. package/util/ImageUtil.d.ts +14 -0
  193. package/util/ImageUtil.js +63 -0
  194. package/util/NumberUtil.cjs +1 -0
  195. package/util/NumberUtil.d.ts +17 -0
  196. package/util/NumberUtil.js +60 -0
  197. package/util/ValidationUtil.cjs +1 -0
  198. package/util/ValidationUtil.d.ts +14 -0
  199. package/util/ValidationUtil.js +60 -0
  200. package/util/index.cjs +1 -0
  201. package/util/index.d.ts +4 -0
  202. package/util/index.js +10 -0
  203. package/vite-env.d.ts +1 -0
  204. package/README.md +0 -89
@@ -0,0 +1,56 @@
1
+ import { jsxs as A, jsx as n } from "react/jsx-runtime";
2
+ import { ImportOutlined as T } from "@ant-design/icons";
3
+ import { useState as s, useRef as h, useCallback as l } from "react";
4
+ import { useTranslation as x } from "react-i18next";
5
+ import { TRANSLATION_NAMESPACE as N } from "../../../locale/hooks/translation-constants.js";
6
+ import S from "./Button.js";
7
+ function _({
8
+ onClick: e,
9
+ children: c,
10
+ accept: m,
11
+ className: a,
12
+ disabled: f,
13
+ type: p = "link"
14
+ }) {
15
+ const [u, i] = s(!1), { t: d } = x(N), o = h(null), y = l(() => {
16
+ k((t) => t + 1), o.current && setTimeout(() => {
17
+ var t;
18
+ (t = o == null ? void 0 : o.current) == null || t.click();
19
+ }, 10);
20
+ }, []), [g, k] = s(0), C = l(
21
+ async (t) => {
22
+ i(!0);
23
+ const r = t.target.files[0];
24
+ r && await e(r), i(!1);
25
+ },
26
+ [e]
27
+ );
28
+ return /* @__PURE__ */ A("div", { className: a, children: [
29
+ /* @__PURE__ */ n(
30
+ "input",
31
+ {
32
+ type: "file",
33
+ style: { display: "none" },
34
+ ref: o,
35
+ onChange: C,
36
+ accept: m
37
+ },
38
+ g
39
+ ),
40
+ /* @__PURE__ */ n(
41
+ S,
42
+ {
43
+ loading: u,
44
+ type: p,
45
+ disabled: f,
46
+ onClick: y,
47
+ icon: /* @__PURE__ */ n(T, {}),
48
+ tooltip: d("str.import"),
49
+ children: c
50
+ }
51
+ )
52
+ ] });
53
+ }
54
+ export {
55
+ _ as ImportButton
56
+ };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),a=require("@ant-design/icons"),l=require("react-i18next"),q=require("./Button.cjs"),N=require("../../../locale/hooks/translation-constants.cjs"),d=({size:n,block:r,className:s,type:o="primary",onClick:t,title:u,to:i})=>{const{t:c}=l.useTranslation(N.TRANSLATION_NAMESPACE);return e.jsx(q,{type:o,className:s,to:i,block:r,size:n,onClick:t&&(()=>t(!0)),icon:e.jsx(a.PlusOutlined,{}),children:u??c("str.new")})};exports.NewButton=d;
@@ -0,0 +1,12 @@
1
+ import { SizeType } from 'antd/es/config-provider/SizeContext';
2
+ import { ButtonType } from 'antd/lib/button';
3
+ import { FC } from 'react';
4
+ export declare const NewButton: FC<{
5
+ to?: string;
6
+ onClick?: (value: boolean) => void;
7
+ title?: string;
8
+ type?: ButtonType;
9
+ block?: boolean;
10
+ className?: string;
11
+ size?: SizeType;
12
+ }>;
@@ -0,0 +1,24 @@
1
+ import { jsx as r } from "react/jsx-runtime";
2
+ import { PlusOutlined as u } from "@ant-design/icons";
3
+ import { useTranslation as f } from "react-i18next";
4
+ import c from "./Button.js";
5
+ import { TRANSLATION_NAMESPACE as l } from "../../../locale/hooks/translation-constants.js";
6
+ const w = ({ size: t, block: n, className: m, type: i = "primary", onClick: o, title: e, to: p }) => {
7
+ const { t: s } = f(l);
8
+ return /* @__PURE__ */ r(
9
+ c,
10
+ {
11
+ type: i,
12
+ className: m,
13
+ to: p,
14
+ block: n,
15
+ size: t,
16
+ onClick: o && (() => o(!0)),
17
+ icon: /* @__PURE__ */ r(u, {}),
18
+ children: e ?? s("str.new")
19
+ }
20
+ );
21
+ };
22
+ export {
23
+ w as NewButton
24
+ };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),p=require("@ant-design/icons"),q=require("react-i18next"),P=require("./Button.cjs"),d=require("../../../locale/hooks/translation-constants.cjs"),j=({disabled:e,loading:i,block:o,className:s,type:u="primary",onClick:c,title:a,to:l})=>{const{t:n}=q.useTranslation(d.TRANSLATION_NAMESPACE),t=a??n("str.print");return r.jsx(P,{type:u,className:s,to:l,loading:i,disabled:e,block:o,onClick:c,tooltip:t!=null&&t.trim()?"":n("str.print"),icon:r.jsx(p.PrinterOutlined,{}),children:t})};exports.PrintButton=j;
@@ -0,0 +1,12 @@
1
+ import { ButtonType } from 'antd/lib/button';
2
+ import { FC } from 'react';
3
+ export declare const PrintButton: FC<{
4
+ to?: string;
5
+ loading?: boolean;
6
+ onClick?: () => void;
7
+ title?: string;
8
+ type?: ButtonType;
9
+ block?: boolean;
10
+ className?: string;
11
+ disabled?: boolean;
12
+ }>;
@@ -0,0 +1,26 @@
1
+ import { jsx as o } from "react/jsx-runtime";
2
+ import { PrinterOutlined as u } from "@ant-design/icons";
3
+ import { useTranslation as A } from "react-i18next";
4
+ import a from "./Button.js";
5
+ import { TRANSLATION_NAMESPACE as l } from "../../../locale/hooks/translation-constants.js";
6
+ const B = ({ disabled: n, loading: i, block: m, className: p, type: s = "primary", onClick: e, title: c, to: f }) => {
7
+ const { t } = A(l), r = c ?? t("str.print");
8
+ return /* @__PURE__ */ o(
9
+ a,
10
+ {
11
+ type: s,
12
+ className: p,
13
+ to: f,
14
+ loading: i,
15
+ disabled: n,
16
+ block: m,
17
+ onClick: e,
18
+ tooltip: r != null && r.trim() ? "" : t("str.print"),
19
+ icon: /* @__PURE__ */ o(u, {}),
20
+ children: r
21
+ }
22
+ );
23
+ };
24
+ export {
25
+ B as PrintButton
26
+ };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),a=require("@ant-design/icons"),l=require("react-i18next"),d=require("../../../locale/hooks/translation-constants.cjs"),q=require("./Button.cjs"),R=({disabled:r,block:n,className:s,type:o="primary",onClick:e,title:i,to:u})=>{const{t:c}=l.useTranslation(d.TRANSLATION_NAMESPACE);return t.jsx(q,{type:o,disabled:r,className:s,to:u,block:n,onClick:e&&(()=>e(!0)),icon:t.jsx(a.ReloadOutlined,{}),children:i??c("str.refresh")})};exports.RefreshButton=R;
@@ -0,0 +1,11 @@
1
+ import { ButtonType } from 'antd/lib/button';
2
+ import { FC } from 'react';
3
+ export declare const RefreshButton: FC<{
4
+ to?: string;
5
+ onClick?: (value: boolean) => void;
6
+ title?: string;
7
+ type?: ButtonType;
8
+ block?: boolean;
9
+ className?: string;
10
+ disabled?: boolean;
11
+ }>;
@@ -0,0 +1,24 @@
1
+ import { jsx as o } from "react/jsx-runtime";
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 c from "./Button.js";
6
+ const R = ({ disabled: t, block: e, className: m, type: n = "primary", onClick: r, title: i, to: p }) => {
7
+ const { t: s } = u(a);
8
+ return /* @__PURE__ */ o(
9
+ c,
10
+ {
11
+ type: n,
12
+ disabled: t,
13
+ className: m,
14
+ to: p,
15
+ block: e,
16
+ onClick: r && (() => r(!0)),
17
+ icon: /* @__PURE__ */ o(f, {}),
18
+ children: i ?? s("str.refresh")
19
+ }
20
+ );
21
+ };
22
+ export {
23
+ R as RefreshButton
24
+ };
@@ -0,0 +1 @@
1
+ "use strict";const t=require("react/jsx-runtime"),p=require("@ant-design/icons"),T=require("antd"),n=require("react"),g=require("react-i18next"),C=require("./Button.cjs"),U=require("../../../locale/hooks/translation-constants.cjs");function m({shouldConfirm:q=!0,block:s,value:i,loading:c,onClick:u,text:a,disabled:l,type:d="link",hidden:j}){const{t:e}=g.useTranslation(U.TRANSLATION_NAMESPACE),o=n.useMemo(()=>a??e("str.unhide"),[a,e]),[f,r]=n.useState(!1);n.useEffect(()=>{r(c??!1)},[c]);const x=n.useCallback(async()=>{try{r(!0),await u(i)}finally{r(!1)}},[u,i]);return q?t.jsx(T.Popconfirm,{title:e("qus.doYouWantToHide"),okText:o.toUpperCase(),cancelText:e("str.no").toUpperCase(),onConfirm:x,children:t.jsx(C,{tooltip:o,icon:t.jsx(p.UpCircleOutlined,{}),disabled:l,loading:f,type:d,danger:!0,hidden:j,block:s})}):t.jsx(C,{tooltip:o,icon:t.jsx(p.UpCircleOutlined,{}),disabled:l,loading:f,type:d,danger:!0,block:s,onClick:x})}module.exports=m;
@@ -0,0 +1,14 @@
1
+ import { ButtonType } from 'antd/es/button';
2
+ interface Props<T> {
3
+ value: T;
4
+ onClick: (value: T) => Promise<void>;
5
+ text?: string;
6
+ loading?: boolean;
7
+ disabled?: boolean;
8
+ type?: ButtonType;
9
+ block?: boolean;
10
+ shouldConfirm?: boolean;
11
+ hidden?: boolean;
12
+ }
13
+ declare function UnHideButton<T>({ shouldConfirm, block, value, loading, onClick, text, disabled, type, hidden }: Props<T>): import("react/jsx-runtime").JSX.Element;
14
+ export default UnHideButton;
@@ -0,0 +1,70 @@
1
+ import { jsx as o } from "react/jsx-runtime";
2
+ import { UpCircleOutlined as c } from "@ant-design/icons";
3
+ import { Popconfirm as g } from "antd";
4
+ import { useMemo as x, useState as A, useEffect as U, useCallback as _ } from "react";
5
+ import { useTranslation as k } from "react-i18next";
6
+ import d from "./Button.js";
7
+ import { TRANSLATION_NAMESPACE as E } from "../../../locale/hooks/translation-constants.js";
8
+ function O({
9
+ shouldConfirm: C = !0,
10
+ block: e,
11
+ value: i,
12
+ loading: a,
13
+ onClick: s,
14
+ text: f,
15
+ disabled: l,
16
+ type: m = "link",
17
+ hidden: T
18
+ }) {
19
+ const { t } = k(E), n = x(() => f ?? t("str.unhide"), [f, t]), [u, r] = A(!1);
20
+ U(() => {
21
+ r(a ?? !1);
22
+ }, [a]);
23
+ const p = _(
24
+ async () => {
25
+ try {
26
+ r(!0), await s(i);
27
+ } finally {
28
+ r(!1);
29
+ }
30
+ },
31
+ [s, i]
32
+ );
33
+ return C ? /* @__PURE__ */ o(
34
+ g,
35
+ {
36
+ title: t("qus.doYouWantToHide"),
37
+ okText: n.toUpperCase(),
38
+ cancelText: t("str.no").toUpperCase(),
39
+ onConfirm: p,
40
+ children: /* @__PURE__ */ o(
41
+ d,
42
+ {
43
+ tooltip: n,
44
+ icon: /* @__PURE__ */ o(c, {}),
45
+ disabled: l,
46
+ loading: u,
47
+ type: m,
48
+ danger: !0,
49
+ hidden: T,
50
+ block: e
51
+ }
52
+ )
53
+ }
54
+ ) : /* @__PURE__ */ o(
55
+ d,
56
+ {
57
+ tooltip: n,
58
+ icon: /* @__PURE__ */ o(c, {}),
59
+ disabled: l,
60
+ loading: u,
61
+ type: m,
62
+ danger: !0,
63
+ block: e,
64
+ onClick: p
65
+ }
66
+ );
67
+ }
68
+ export {
69
+ O as default
70
+ };
@@ -0,0 +1 @@
1
+ "use strict";const t=require("react/jsx-runtime"),o=require("@ant-design/icons"),r=require("react-i18next"),i=require("./Button.cjs"),u=require("../../../locale/hooks/translation-constants.cjs");function c({value:n,onClick:e}){const{t:s}=r.useTranslation(u.TRANSLATION_NAMESPACE);return t.jsx(i,{tooltip:s("str.update"),type:"link",onClick:()=>e(n),icon:t.jsx(o.EditOutlined,{})})}module.exports=c;
@@ -0,0 +1,6 @@
1
+ interface Props<T> {
2
+ value: T;
3
+ onClick: (value: T) => void;
4
+ }
5
+ declare function UpdateButtonTable<T>({ value, onClick }: Props<T>): import("react/jsx-runtime").JSX.Element;
6
+ export default UpdateButtonTable;
@@ -0,0 +1,20 @@
1
+ import { jsx as t } from "react/jsx-runtime";
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(
9
+ p,
10
+ {
11
+ tooltip: n("str.update"),
12
+ type: "link",
13
+ onClick: () => r(o),
14
+ icon: /* @__PURE__ */ t(i, {})
15
+ }
16
+ );
17
+ }
18
+ export {
19
+ d as default
20
+ };
@@ -0,0 +1 @@
1
+ "use strict";const t=require("react/jsx-runtime"),i=require("@ant-design/icons"),o=require("react-i18next"),r=require("./Button.cjs"),u=require("../../../locale/hooks/translation-constants.cjs");function c({value:n,onClick:e}){const{t:s}=o.useTranslation(u.TRANSLATION_NAMESPACE);return t.jsx(r,{type:"link",onClick:()=>e(n),icon:t.jsx(i.EyeOutlined,{}),tooltip:s("str.view")})}module.exports=c;
@@ -0,0 +1,6 @@
1
+ interface Props<T> {
2
+ value: T;
3
+ onClick: (value: T) => void;
4
+ }
5
+ declare function ViewButtonTable<T>({ value, onClick }: Props<T>): import("react/jsx-runtime").JSX.Element;
6
+ export default ViewButtonTable;
@@ -0,0 +1,20 @@
1
+ import { jsx as o } from "react/jsx-runtime";
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 c({ value: t, onClick: r }) {
7
+ const { t: i } = e(p);
8
+ return /* @__PURE__ */ o(
9
+ m,
10
+ {
11
+ type: "link",
12
+ onClick: () => r(t),
13
+ icon: /* @__PURE__ */ o(n, {}),
14
+ tooltip: i("str.view")
15
+ }
16
+ );
17
+ }
18
+ export {
19
+ c as default
20
+ };
@@ -0,0 +1,14 @@
1
+ import { default as ButtonComponent, ButtonComponentProps } from './Button';
2
+ import { default as CloneButtonTable } from './CloneButtonTable';
3
+ import { default as DeleteButtonTable } from './DeleteButtonTable';
4
+ import { ExportButton } from './ExportButton';
5
+ import { default as HideButtonTable } from './HideButtonTable';
6
+ import { ImportButton } from './ImportButton';
7
+ import { NewButton } from './NewButton';
8
+ import { PrintButton } from './PrintButton';
9
+ import { RefreshButton } from './RefreshButton';
10
+ import { default as UnHideButton } from './UnHideButton';
11
+ import { default as UpdateButtonTable } from './UpdateButtonTable';
12
+ import { default as ViewButtonTable } from './ViewButtonTable';
13
+ export { ButtonComponent, CloneButtonTable, DeleteButtonTable, ExportButton, HideButtonTable, ImportButton, NewButton, PrintButton, RefreshButton, UnHideButton, UpdateButtonTable, ViewButtonTable, };
14
+ export type { ButtonComponentProps };
@@ -0,0 +1 @@
1
+ "use strict";const r=require("react/jsx-runtime"),s=require("antd"),m=s.Form.Item,x=({onChange:e,label:d,initialValue:c=!1,disabled:n,switch:t=!1,...h})=>r.jsxs(m,{...h,valuePropName:"checked",initialValue:c,label:t?d:void 0,children:[!!t&&r.jsx(s.Switch,{disabled:n,defaultChecked:c,onChange:e&&(o=>e(o))}),!t&&r.jsx(s.Checkbox,{disabled:n,defaultChecked:c,onChange:e&&(o=>e(o.target.checked)),children:d})]});module.exports=x;
@@ -0,0 +1,9 @@
1
+ import { FormItemProps } from 'antd';
2
+ import { FC } from 'react';
3
+ interface Props extends FormItemProps {
4
+ onChange?: (evt: boolean) => void;
5
+ disabled?: boolean;
6
+ switch?: boolean;
7
+ }
8
+ declare const CheckBoxComponent: FC<Props>;
9
+ export default CheckBoxComponent;
@@ -0,0 +1,40 @@
1
+ import { jsxs as h, jsx as d } from "react/jsx-runtime";
2
+ import { Form as k, Switch as s, Checkbox as p } from "antd";
3
+ const x = k.Item, C = ({
4
+ onChange: e,
5
+ label: t,
6
+ initialValue: o = !1,
7
+ disabled: m,
8
+ switch: r = !1,
9
+ ...f
10
+ }) => /* @__PURE__ */ h(
11
+ x,
12
+ {
13
+ ...f,
14
+ valuePropName: "checked",
15
+ initialValue: o,
16
+ label: r ? t : void 0,
17
+ children: [
18
+ !!r && /* @__PURE__ */ d(
19
+ s,
20
+ {
21
+ disabled: m,
22
+ defaultChecked: o,
23
+ onChange: e && ((c) => e(c))
24
+ }
25
+ ),
26
+ !r && /* @__PURE__ */ d(
27
+ p,
28
+ {
29
+ disabled: m,
30
+ defaultChecked: o,
31
+ onChange: e && ((c) => e(c.target.checked)),
32
+ children: t
33
+ }
34
+ )
35
+ ]
36
+ }
37
+ );
38
+ export {
39
+ C as default
40
+ };
@@ -0,0 +1,2 @@
1
+ import { default as CheckBoxComponent } from './CheckBox';
2
+ export { CheckBoxComponent };
@@ -0,0 +1 @@
1
+ "use strict";const n=require("react/jsx-runtime"),o=require("antd"),u=require("react"),a=require("../../../util/NumberUtil.cjs"),l=o.Descriptions.Item,m=({list:r,keepEmptyValues:s,...i})=>{const c=u.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 n.jsx(o.Descriptions,{...i,children:c.map(({label:t,value:e})=>n.jsx(l,{label:t,children:e},t))})};module.exports=m;
@@ -0,0 +1,18 @@
1
+ import { DescriptionsProps } from 'antd/lib/descriptions';
2
+ import { default as React, FC } from 'react';
3
+ export type DescPropsNullable = {
4
+ label?: string | React.ReactElement;
5
+ value?: any;
6
+ noFormatting?: boolean;
7
+ };
8
+ export type DescProps = {
9
+ label?: string;
10
+ value: any;
11
+ noFormatting?: boolean;
12
+ };
13
+ export interface DescListProps extends DescriptionsProps {
14
+ list: (DescPropsNullable | null | undefined | boolean)[];
15
+ keepEmptyValues?: boolean;
16
+ }
17
+ declare const DescList: FC<DescListProps>;
18
+ export default DescList;
@@ -0,0 +1,16 @@
1
+ import { jsx as i } from "react/jsx-runtime";
2
+ import { Descriptions as n } from "antd";
3
+ import { useMemo as c } from "react";
4
+ import a from "../../../util/NumberUtil.js";
5
+ const u = n.Item, h = ({ list: t, keepEmptyValues: e, ...m }) => {
6
+ const s = c(() => {
7
+ const r = e ? t : t.filter((o) => o && !!o.value);
8
+ return r.forEach((o) => {
9
+ !o.noFormatting && !isNaN(o.value) && (o.value = a.toMoney(o.value));
10
+ }), r;
11
+ }, [e, t]);
12
+ return /* @__PURE__ */ i(n, { ...m, children: s.map(({ label: r, value: o }) => /* @__PURE__ */ i(u, { label: r, children: o }, r)) });
13
+ };
14
+ export {
15
+ h as default
16
+ };
@@ -0,0 +1,7 @@
1
+ import { FC } from 'react';
2
+ interface DescriptionComponentProps {
3
+ title: string;
4
+ description: string;
5
+ }
6
+ declare const DescriptionComponent: FC<DescriptionComponentProps>;
7
+ export default DescriptionComponent;
@@ -0,0 +1,3 @@
1
+ import { DescPropsNullable, default as DescList } from './DescList';
2
+ export { DescList };
3
+ export type { DescPropsNullable };
@@ -0,0 +1,22 @@
1
+ export { DatePickerComponent, TimePickerComponent } from './DatePicker';
2
+ export { ButtonComponent, ButtonComponent as Button, CloneButtonTable, DeleteButtonTable, ExportButton, HideButtonTable, ImportButton, NewButton, PrintButton, RefreshButton, UnHideButton, UpdateButtonTable, ViewButtonTable, } from './button';
3
+ export { CheckBoxComponent } from './check-box';
4
+ export { DescList } from './description';
5
+ export type { DescPropsNullable } from './description';
6
+ export { default as VerticalSpace } from './layout/VerticalSpace';
7
+ export { LoadingIndicator } from './loading';
8
+ export { ImagePicker } from './picker';
9
+ export { RadioGroupComponent } from './radio';
10
+ export { SelectFieldInReport } from './report';
11
+ export type { ReportSelectFieldItems } from './report';
12
+ export { SelectComponent, CustomSelectOption } from './select';
13
+ export { TabViewWithRoute } from './tab';
14
+ export { TableComponent } from './table';
15
+ export { StatusTag } from './tag';
16
+ export { Title } from './text';
17
+ export { Text } from './text';
18
+ export { ShowMore } from './show-more';
19
+ export { PhoneField, TextField, TextAreaComponent, NumberTextField, } from './text-field';
20
+ export { TooltipComponent } from './tooltip';
21
+ export { WizardResult } from './wizard';
22
+ export { WizardViewForm } from './wizard';
@@ -0,0 +1 @@
1
+ "use strict";const r=require("react/jsx-runtime"),c=require("antd"),s=({children:e,className:t=""})=>r.jsx(c.Space,{direction:"vertical",className:[t,"w-100"].join(" "),children:e});module.exports=s;
@@ -0,0 +1,5 @@
1
+ import { FC, PropsWithChildren } from 'react';
2
+ declare const VerticalSpace: FC<PropsWithChildren & {
3
+ className?: string;
4
+ }>;
5
+ export default VerticalSpace;
@@ -0,0 +1,6 @@
1
+ import { jsx as t } from "react/jsx-runtime";
2
+ import { Space as a } from "antd";
3
+ const i = ({ children: r, className: e = "" }) => /* @__PURE__ */ t(a, { direction: "vertical", className: [e, "w-100"].join(" "), children: r });
4
+ export {
5
+ i as default
6
+ };
@@ -0,0 +1,2 @@
1
+ import { default as VerticalSpace } from './VerticalSpace';
2
+ export { VerticalSpace };
@@ -0,0 +1 @@
1
+ "use strict";const t=require("react/jsx-runtime"),r=require("antd"),o=require("react-i18next"),i=require("../button/Button.cjs"),c=require("../../../locale/hooks/translation-constants.cjs"),u=({loading:s,children:n,error:a})=>{const{t:e}=o.useTranslation(c.TRANSLATION_NAMESPACE);return t.jsx(r.Skeleton,{loading:s,paragraph:!0,className:"h-100",children:a?t.jsx(r.Result,{status:"404",title:404,subTitle:e("err.notFound"),className:"",extra:t.jsx(i,{to:-1,type:"primary",children:e("str.goBack")})}):n})};module.exports=u;
@@ -0,0 +1,6 @@
1
+ import { FC, PropsWithChildren } from 'react';
2
+ declare const LoadingIndicator: FC<PropsWithChildren<{
3
+ loading: boolean;
4
+ error?: any;
5
+ }>>;
6
+ export default LoadingIndicator;
@@ -0,0 +1,24 @@
1
+ import { jsx as t } from "react/jsx-runtime";
2
+ import { Skeleton as n, Result as s } 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 N = ({ loading: o, children: e, error: a }) => {
7
+ const { t: r } = m(p);
8
+ return (
9
+ // <Spin spinning={loading} className="h-100">
10
+ /* @__PURE__ */ t(n, { loading: o, paragraph: !0, className: "h-100", children: a ? /* @__PURE__ */ t(
11
+ s,
12
+ {
13
+ status: "404",
14
+ title: 404,
15
+ subTitle: r("err.notFound"),
16
+ className: "",
17
+ extra: /* @__PURE__ */ t(i, { to: -1, type: "primary", children: r("str.goBack") })
18
+ }
19
+ ) : e })
20
+ );
21
+ };
22
+ export {
23
+ N as default
24
+ };
@@ -0,0 +1,2 @@
1
+ import { default as LoadingIndicator } from './LoadingIndicator';
2
+ export { LoadingIndicator };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("react/jsx-runtime");;/* empty css */;/* empty css */const S=require("@ant-design/icons"),F=require("antd"),s=require("react"),xe=require("react-cropper"),he=require("react-i18next"),je=require("../../../locale/hooks/translation-constants.cjs"),E=require("../button/Button.cjs"),we=require("../../../util/ImageUtil.cjs"),Ce=F.Form.Item;function X(r){return new Promise((d,p)=>{const n=new FileReader;n.readAsDataURL(r),n.onload=()=>d(n.result),n.onerror=f=>p(f)})}const ve=({values:r=[],required:d,buttonType:p,label:n,name:f,onChange:m,aspectRatio:N,buttonTitle:j,hidePreview:w,buttonSize:g="large",showButtonText:x=!0,showOnlyIcon:D=!1,icon:y=t.jsx(S.UploadOutlined,{}),loading:O,maxCount:C=1,onAdd:l,onRemove:U,listType:I,..._})=>{const[Z,ee]=s.useState(""),[te,se]=s.useState(""),[re,z]=s.useState(!1),q=s.useRef(),a=s.useRef(),[i,M]=s.useState([]),[h,k]=s.useState(),ne=s.useRef(),oe=()=>z(!1),ae=async e=>{!e.url&&!e.preview&&(e.preview=await X(e.originFileObj)),se(e.url||e.preview),z(!0),ee(e.name)},[B,R]=s.useState(!1),ie=()=>{},T=e=>{var o;(o=a==null?void 0:a.current)==null||o.cropper.rotate(e?-90:90)};s.useEffect(()=>{m==null||m(i[0],i)},[i,m]);const ce=()=>{var b;const e=(b=a==null?void 0:a.current)==null?void 0:b.cropper.getCroppedCanvas(),{type:o,size:c,name:u,uid:v}=q.current;R(!0),e==null||e.toBlob(async me=>{const ge=Object.assign(new File([me],u,{type:o}),{uid:v}),G=await we.resizeImage(ge),K=await X(G),Q={url:K,name:u,uid:v,type:o,size:c,thumbUrl:K,originFileObj:G};if(l)try{R(!0),await l(Q)}finally{R(!1)}M([Q,...i]),R(!1)}),k(void 0)},le=()=>{k(void 0),q.current=void 0},L=s.useCallback(e=>{const o=e;if(o){q.current=o;const c=new FileReader;c.addEventListener("load",()=>{var u;if(typeof c.result=="string"){k(c.result);const v=localStorage.getItem("cropper.box"),b=v?JSON.parse(v):void 0;b&&((u=a==null?void 0:a.current)==null||u.cropper.setCropBoxData(b)),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}];M(e)}},[r]);const{t:P}=he.useTranslation(je.TRANSLATION_NAMESPACE),de=s.useMemo(()=>d?{required:d,validator:(e,o,c)=>{h||i!=null&&i.length?c():c(`${n??""} ${P("err.validation.required")}`)}}:void 0,[d,h,i==null?void 0:i.length,n,P]),J=j??P("message.fileUploadMessage2"),V=s.useMemo(()=>t.jsx(Y,{showLoadingIndicator:B,_buttonTitle:J,buttonSize:g,buttonType:p,fileList:i,hidePreview:w,icon:y,loading:O,listType:I,maxCount:C,onChangeFile:L,onRemove:U,showButtonText:x,handlePreview:ae,setFileList:M}),[B,J,g,p,i,w,y,O,I,C,L,U,x]);ne.current=V.props.beforeUpload;const[ue,W]=s.useState(0),[pe,$]=s.useState(0),[A,fe]=s.useState();s.useEffect(()=>{const e=setTimeout(()=>{A&&localStorage.setItem("cropper.box",JSON.stringify(A))},400);return()=>clearTimeout(e)},[A]),s.useEffect(()=>{h||(W(0),$(0))},[h]);const H=s.useCallback(async()=>{var o;const e=(o=a==null?void 0:a.current)==null?void 0:o.cropper;if(e){const{width:c,height:u}=e.getCroppedCanvas();fe(e.getCropBoxData()),W(c),$(u)}},[]);return t.jsxs(t.Fragment,{children:[t.jsx(Ce,{label:n,..._,name:f,className:"mb-0",rules:[de,..._.rules??[]],children:V}),t.jsxs(F.Modal,{open:!!h,maskClosable:!1,onOk:ce,closable:!1,onCancel:le,children:[t.jsx(xe.Cropper,{ref:a,src:h,cropmove:H,viewMode:1,aspectRatio:N,cropend:()=>ie()}),t.jsx("p",{className:"text-center",children:[ue,pe].join(" ⨉ ")}),t.jsxs("div",{className:"mt-2 d-flex justify-content-center",children:[t.jsx(E,{size:"large",icon:t.jsx(S.RotateLeftOutlined,{}),onClick:()=>T(!0)}),t.jsx(E,{size:"large",icon:t.jsx(S.RotateRightOutlined,{}),onClick:()=>T(!1)})]})]}),t.jsx(F.Modal,{open:re,title:Z,footer:null,onCancel:oe,children:t.jsx("div",{className:"text-center",children:t.jsx("img",{alt:"example",style:{maxWidth:"400px"},src:te})})})]})},Y=({_buttonTitle:r,buttonSize:d,buttonType:p,fileList:n,hidePreview:f,icon:m,loading:N,maxCount:j,onChangeFile:w,onRemove:g,showButtonText:x,handlePreview:D,setFileList:y,showLoadingIndicator:O,listType:C="picture"})=>t.jsx(t.Fragment,{children:t.jsxs(F.Upload,{accept:"image/x-png,image/gif,image/jpeg",fileList:n,defaultFileList:n,onChange:()=>{},className:(n.length>=j?" hide-upload ":"")+" mb-0",multiple:!1,onPreview:f?void 0:D,onDrop:l=>(w(l.dataTransfer.files.item(0)),!1),listType:C,showUploadList:!f,onRemove:l=>{const U=n.filter(I=>l.uid!==I.uid);g==null||g(l),y(U)},beforeUpload:async l=>(w(l),!1),maxCount:j,children:[O&&t.jsx(S.LoadingOutlined,{}),t.jsx("div",{className:"d-flex flex-column",children:n.length<j&&(C==="picture-circle"?t.jsx(S.UploadOutlined,{}):t.jsx(E,{loading:N,tooltip:x?void 0:r,size:d,icon:m,type:x?p:"text",children:x?r:void 0}))})]},n.length)});exports.UploadComponent=Y;exports.default=ve;
@@ -0,0 +1,56 @@
1
+ import { FormItemProps } from 'antd';
2
+ import { UploadFile } from 'antd/lib/upload/interface';
3
+ import { FC, ReactElement } from 'react';
4
+ import { UploadListType } from 'antd/es/upload/interface';
5
+ export declare function dataURLtoFile({ url, name }: {
6
+ url: any;
7
+ name: any;
8
+ }): File;
9
+ interface Props extends FormItemProps {
10
+ values?: string[] | string;
11
+ maxCount?: number;
12
+ onChange?: (file?: UploadFile, allFiles?: UploadFile[]) => void;
13
+ buttonTitle?: string;
14
+ listType?: UploadListType;
15
+ hidePreview?: boolean;
16
+ buttonSize?: string;
17
+ showButtonText?: boolean;
18
+ aspectRatio?: number;
19
+ showOnlyIcon?: boolean;
20
+ icon?: ReactElement;
21
+ loading?: boolean;
22
+ buttonType?: string;
23
+ onAdd?: (file?: UploadFile) => Promise<void>;
24
+ onRemove?: (file?: UploadFile) => void;
25
+ }
26
+ /**
27
+ * When submitting Uploader
28
+ * ```
29
+ * if(field === undefined)
30
+ * "There is no file uploaded"
31
+ * else if(field.fileList.length === 0)
32
+ * "The initial file is deleted"
33
+ * else if(field.fileList.length > 1)
34
+ * "A new file has been uploaded"
35
+ * ```
36
+ *
37
+ */
38
+ declare const ImagePicker: FC<Props>;
39
+ export declare const UploadComponent: FC<{
40
+ _buttonTitle: any;
41
+ buttonSize: any;
42
+ buttonType: any;
43
+ fileList: any;
44
+ hidePreview: any;
45
+ icon: any;
46
+ loading: any;
47
+ maxCount: any;
48
+ onChangeFile: any;
49
+ onRemove: any;
50
+ showButtonText: any;
51
+ handlePreview: any;
52
+ setFileList: any;
53
+ showLoadingIndicator?: boolean;
54
+ listType?: UploadListType;
55
+ }>;
56
+ export default ImagePicker;