@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,40 @@
1
+ import { jsx as l } from "react/jsx-runtime";
2
+ import { Table as m } from "antd";
3
+ import { useMemo as u } from "react";
4
+ function x({
5
+ minusHeight: f,
6
+ onRow: c,
7
+ count: d = 1,
8
+ onPageSizeChanged: h,
9
+ pagination: e = !1,
10
+ rowKey: n = "id",
11
+ columns: o,
12
+ className: i,
13
+ scroll: t,
14
+ ...r
15
+ }) {
16
+ const s = u(() => o.filter((a) => !a.hidden), [o]);
17
+ return /* @__PURE__ */ l(
18
+ m,
19
+ {
20
+ className: `custom-scroll ${i}`,
21
+ style: { width: "100%" },
22
+ columns: s,
23
+ rowKey: n,
24
+ ...r,
25
+ scroll: t || {
26
+ // y: `calc(100vh - ${minusHeight ?? 0}px)`,
27
+ x: !0
28
+ // scrollToFirstRowOnChange: true,
29
+ },
30
+ pagination: e && {
31
+ ...e,
32
+ hideOnSinglePage: !0,
33
+ showSizeChanger: !1
34
+ }
35
+ }
36
+ );
37
+ }
38
+ export {
39
+ x as default
40
+ };
@@ -0,0 +1 @@
1
+ "use strict";const p=require("react/jsx-runtime"),u=require("antd"),x=require("../../../locale/hooks/translation-constants.cjs"),T=require("react-i18next"),q=({onClick:n,clickable:o,colorFunction:s,translation:c,value:e})=>{var r;const t=s==null?void 0:s(e),{t:i}=T.useTranslation(x.TRANSLATION_NAMESPACE),a=u.Tag;return p.jsx(a,{onClick:n,color:t==null?void 0:t.color,icon:t==null?void 0:t.icon,style:{color:t==null?void 0:t.text,cursor:o?"pointer":void 0},children:(r=i(c[e]))==null?void 0:r.toUpperCase()})};module.exports=q;
@@ -0,0 +1,14 @@
1
+ import { FC, ReactElement } from 'react';
2
+ type StatusTagProps = {
3
+ translation: any;
4
+ value: string;
5
+ clickable?: boolean;
6
+ onClick?: () => void;
7
+ colorFunction?: (val: any) => {
8
+ color?: string;
9
+ text?: string;
10
+ icon?: ReactElement;
11
+ };
12
+ };
13
+ declare const StatusTag: FC<StatusTagProps>;
14
+ export default StatusTag;
@@ -0,0 +1,30 @@
1
+ import { jsx as i } from "react/jsx-runtime";
2
+ import { Tag as f } from "antd";
3
+ import { TRANSLATION_NAMESPACE as T } from "../../../locale/hooks/translation-constants.js";
4
+ import { useTranslation as A } from "react-i18next";
5
+ const S = ({
6
+ onClick: e,
7
+ clickable: m,
8
+ colorFunction: t,
9
+ translation: p,
10
+ value: r
11
+ }) => {
12
+ var s;
13
+ const o = t == null ? void 0 : t(r), { t: n } = A(T);
14
+ return /* @__PURE__ */ i(
15
+ f,
16
+ {
17
+ onClick: e,
18
+ color: o == null ? void 0 : o.color,
19
+ icon: o == null ? void 0 : o.icon,
20
+ style: {
21
+ color: o == null ? void 0 : o.text,
22
+ cursor: m ? "pointer" : void 0
23
+ },
24
+ children: (s = n(p[r])) == null ? void 0 : s.toUpperCase()
25
+ }
26
+ );
27
+ };
28
+ export {
29
+ S as default
30
+ };
@@ -0,0 +1,2 @@
1
+ import { default as StatusTag } from './StatusTag';
2
+ export { StatusTag };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("antd"),{Text:t}=e.Typography;exports.Text=t;
@@ -0,0 +1,3 @@
1
+ import { Title } from './title';
2
+ declare const Text: import('react').ForwardRefExoticComponent<import('antd/es/typography/Text').TextProps & import('react').RefAttributes<HTMLSpanElement>>;
3
+ export { Title, Text };
@@ -0,0 +1,5 @@
1
+ import { Typography as o } from "antd";
2
+ const { Text: r } = o;
3
+ export {
4
+ r as Text
5
+ };
@@ -0,0 +1,7 @@
1
+ import { default as React, CSSProperties, FC } from 'react';
2
+ declare const TitleWithHeadTitle: FC<{
3
+ children: string | React.ReactNode;
4
+ style?: CSSProperties;
5
+ level?: 3 | 5 | 1 | 2 | 4 | undefined;
6
+ }>;
7
+ export default TitleWithHeadTitle;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("antd"),{Title:t}=e.Typography;exports.Title=t;
@@ -0,0 +1 @@
1
+ export declare const Title: import('react').ForwardRefExoticComponent<import('antd/es/typography/Title').TitleProps & import('react').RefAttributes<HTMLElement>>;
@@ -0,0 +1,5 @@
1
+ import { Typography as o } from "antd";
2
+ const { Title: r } = o;
3
+ export {
4
+ r as Title
5
+ };
@@ -0,0 +1 @@
1
+ "use strict";const o=require("react/jsx-runtime"),p=require("antd"),m=require("react"),M=require("react-i18next"),P=require("../../../locale/hooks/translation-constants.cjs"),S=require("../tooltip/TooltipComponent.cjs"),L=require("./TextField.cjs"),O=m.forwardRef(function({type:b,required:i,label:e,rules:c=[],placeholder:r,onEnter:x,form:q,nextFocus:T,min:d,moneyField:n,addonAfter:f,minLength:N,defaultValue:j,pattern:l,disabled:I,readOnly:$,onChange:g,value:A,max:E,addonBefore:R,size:C,isInt:u=!1,tooltip:h,...w},B){const{t:a}=M.useTranslation(P.TRANSLATION_NAMESPACE),F=m.useMemo(()=>[...c,{required:i,message:`${e??r??""} ${a("err.validation.required")}`}],[c,e,r,a,i]);return o.jsx(S,{title:h,children:o.jsx(p.Form.Item,{...w,label:e,rules:F,children:o.jsx(p.InputNumber,{ref:B,disabled:I,defaultValue:j,value:A,readOnly:$,addonBefore:R,minLength:N,addonAfter:f,step:u?1:void 0,pattern:u?"d*":l,onChange:g,onPressEnter:t=>L.onEnterInternalTextField(t,T,q,x),className:"max-width",min:d===null?void 0:d??0,max:E,type:n?void 0:"number",size:C,formatter:n?t=>{if(t.includes(".")){const s=`${t}`.split(".");return s[0]=s[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),s.join(".")}else return`${t}`.replace(/\B(?=(\d{3})+(?!\d))/g,",")}:void 0,parser:n?t=>t==null?void 0:t.replace(/\$\s?|(,*)/g,""):void 0,placeholder:r??e})})})});module.exports=O;
@@ -0,0 +1,13 @@
1
+ import { ReactNode } from 'react';
2
+ import { TextFieldProps } from './TextField';
3
+ interface NumberTextFieldProps extends TextFieldProps {
4
+ moneyField?: boolean;
5
+ addonAfter?: ReactNode;
6
+ minLength?: number;
7
+ isInt?: boolean;
8
+ max?: number;
9
+ pattern?: string;
10
+ min?: number | null;
11
+ }
12
+ declare const NumberTextField: import('react').ForwardRefExoticComponent<NumberTextFieldProps & import('react').RefAttributes<HTMLInputElement>>;
13
+ export default NumberTextField;
@@ -0,0 +1,83 @@
1
+ import { jsx as i } from "react/jsx-runtime";
2
+ import { Form as P, InputNumber as R } from "antd";
3
+ import { forwardRef as S, useMemo as F } from "react";
4
+ import { useTranslation as L } from "react-i18next";
5
+ import { TRANSLATION_NAMESPACE as O } from "../../../locale/hooks/translation-constants.js";
6
+ import _ from "../tooltip/TooltipComponent.js";
7
+ import { onEnterInternalTextField as b } from "./TextField.js";
8
+ const K = S(
9
+ function({
10
+ // eslint-disable-next-line no-unused-vars
11
+ type: q,
12
+ required: m,
13
+ label: t,
14
+ rules: s = [],
15
+ placeholder: o,
16
+ onEnter: c,
17
+ form: a,
18
+ nextFocus: u,
19
+ min: p,
20
+ moneyField: e,
21
+ addonAfter: N,
22
+ minLength: T,
23
+ defaultValue: x,
24
+ pattern: $,
25
+ disabled: g,
26
+ readOnly: l,
27
+ onChange: A,
28
+ value: E,
29
+ max: I,
30
+ addonBefore: h,
31
+ size: j,
32
+ isInt: d = !1,
33
+ tooltip: w,
34
+ ...B
35
+ }, C) {
36
+ const { t: f } = L(O), M = F(
37
+ () => [
38
+ ...s,
39
+ {
40
+ required: m,
41
+ message: `${t ?? o ?? ""} ${f(
42
+ "err.validation.required"
43
+ )}`
44
+ }
45
+ ],
46
+ [s, t, o, f, m]
47
+ );
48
+ return /* @__PURE__ */ i(_, { title: w, children: /* @__PURE__ */ i(P.Item, { ...B, label: t, rules: M, children: /* @__PURE__ */ i(
49
+ R,
50
+ {
51
+ ref: C,
52
+ disabled: g,
53
+ defaultValue: x,
54
+ value: E,
55
+ readOnly: l,
56
+ addonBefore: h,
57
+ minLength: T,
58
+ addonAfter: N,
59
+ step: d ? 1 : void 0,
60
+ pattern: d ? "d*" : $,
61
+ onChange: A,
62
+ onPressEnter: (r) => b(r, u, a, c),
63
+ className: "max-width",
64
+ min: p === null ? void 0 : p ?? 0,
65
+ max: I,
66
+ type: e ? void 0 : "number",
67
+ size: j,
68
+ formatter: e ? (r) => {
69
+ if (r.includes(".")) {
70
+ const n = `${r}`.split(".");
71
+ return n[0] = n[0].replace(/\B(?=(\d{3})+(?!\d))/g, ","), n.join(".");
72
+ } else
73
+ return `${r}`.replace(/\B(?=(\d{3})+(?!\d))/g, ",");
74
+ } : void 0,
75
+ parser: e ? (r) => r == null ? void 0 : r.replace(/\$\s?|(,*)/g, "") : void 0,
76
+ placeholder: o ?? t
77
+ }
78
+ ) }) });
79
+ }
80
+ );
81
+ export {
82
+ K as default
83
+ };
@@ -0,0 +1 @@
1
+ "use strict";const t=require("react/jsx-runtime"),i=require("../../../util/ValidationUtil.cjs"),l=require("./TextField.cjs"),r=e=>t.jsx(l.default,{...e,rules:[...e.rules??[],...i.phoneValidation(e.label??e.placeholder??"")]});module.exports=r;
@@ -0,0 +1,4 @@
1
+ import { FC } from 'react';
2
+ import { TextFieldProps } from './TextField';
3
+ declare const PhoneNumberField: FC<TextFieldProps>;
4
+ export default PhoneNumberField;
@@ -0,0 +1,18 @@
1
+ import { jsx as l } from "react/jsx-runtime";
2
+ import t from "../../../util/ValidationUtil.js";
3
+ import i from "./TextField.js";
4
+ const m = (e) => /* @__PURE__ */ l(
5
+ i,
6
+ {
7
+ ...e,
8
+ rules: [
9
+ ...e.rules ?? [],
10
+ ...t.phoneValidation(
11
+ e.label ?? e.placeholder ?? ""
12
+ )
13
+ ]
14
+ }
15
+ );
16
+ export {
17
+ m as default
18
+ };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const a=require("react/jsx-runtime"),i=require("antd"),x=require("react-i18next"),A=require("../../../locale/hooks/translation-constants.cjs"),c=(n,e,t,r)=>{var s;e&&t&&(n.preventDefault(),(s=t==null?void 0:t.getFieldInstance(e))==null||s.focus()),r&&r(n)},q=({required:n,label:e,rules:t=[],placeholder:r,onEnter:s,nextFocus:l,className:o,...u})=>{const{t:d}=x.useTranslation(A.TRANSLATION_NAMESPACE),I=i.Form.useFormInstance();return a.jsx(i.Form.Item,{...u,className:o,label:e,rules:[...t,{required:n,message:`${e} ${d("err.validation.required")}`}],children:a.jsx(i.Input.TextArea,{...u,className:o,onPressEnter:T=>c(T,l,I,s),placeholder:r??e})})};exports.default=q;exports.onEnterInternalTextField=c;
@@ -0,0 +1,17 @@
1
+ import { FormInstance, FormItemProps } from 'antd';
2
+ import { TextAreaProps } from 'antd/lib/input';
3
+ import { InputHTMLAttributes } from 'react';
4
+ export interface TextFieldProps extends TextAreaProps, FormItemProps<any> {
5
+ type?: InputHTMLAttributes<HTMLInputElement>;
6
+ placeholder?: string;
7
+ status?: any;
8
+ onEnter?: React.KeyboardEventHandler<HTMLInputElement>;
9
+ form?: any;
10
+ nextFocus?: string;
11
+ children?: any;
12
+ name?: any;
13
+ onReset?: any;
14
+ }
15
+ export declare const onEnterInternalTextField: (e: React.KeyboardEvent<HTMLTextAreaElement>, nextFocus?: string, form?: FormInstance<any>, onEnter?: React.KeyboardEventHandler<HTMLInputElement>) => void;
16
+ declare const TextAreaComponent: React.FC<TextFieldProps>;
17
+ export default TextAreaComponent;
@@ -0,0 +1,47 @@
1
+ import { jsx as a } from "react/jsx-runtime";
2
+ import { Form as m, Input as l } from "antd";
3
+ import { useTranslation as A } from "react-i18next";
4
+ import { TRANSLATION_NAMESPACE as I } from "../../../locale/hooks/translation-constants.js";
5
+ const T = (r, e, t, n) => {
6
+ var o;
7
+ e && t && (r.preventDefault(), (o = t == null ? void 0 : t.getFieldInstance(e)) == null || o.focus()), n && n(r);
8
+ }, g = ({
9
+ required: r,
10
+ label: e,
11
+ rules: t = [],
12
+ placeholder: n,
13
+ onEnter: o,
14
+ nextFocus: u,
15
+ className: i,
16
+ ...s
17
+ }) => {
18
+ const { t: c } = A(I), d = m.useFormInstance();
19
+ return /* @__PURE__ */ a(
20
+ m.Item,
21
+ {
22
+ ...s,
23
+ className: i,
24
+ label: e,
25
+ rules: [
26
+ ...t,
27
+ {
28
+ required: r,
29
+ message: `${e} ${c("err.validation.required")}`
30
+ }
31
+ ],
32
+ children: /* @__PURE__ */ a(
33
+ l.TextArea,
34
+ {
35
+ ...s,
36
+ className: i,
37
+ onPressEnter: (p) => T(p, u, d, o),
38
+ placeholder: n ?? e
39
+ }
40
+ )
41
+ }
42
+ );
43
+ };
44
+ export {
45
+ g as default,
46
+ T as onEnterInternalTextField
47
+ };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const o=require("react/jsx-runtime"),O=require("@ant-design/icons"),c=require("antd"),R=require("react"),_=require("react-i18next"),w=require("../../../locale/hooks/translation-constants.cjs"),L=require("../tooltip/TooltipComponent.cjs"),d=(t,n,e,i)=>{var s;n&&e&&(t.preventDefault(),(s=e==null?void 0:e.getFieldInstance(n))==null||s.focus()),i&&i(t)},$=({type:t,required:n,label:e,disabled:i,rules:s=[],placeholder:a,onEnter:l,size:p,form:x,addonAfter:I,addonBefore:T,nextFocus:g,autoComplete:m="off",defaultValue:q,readOnly:f,value:j,loading:v,onBlur:A,inputRef:C,status:E,autoFocus:P,onChange:D,tooltip:F,...M})=>{const{t:u}=_.useTranslation(w.TRANSLATION_NAMESPACE),S=R.useMemo(()=>{const r=[...s,{required:n,message:`${e??a??""} ${u("err.validation.required")}`}];return t==="email"&&r.push({type:"email",message:u("err.validation.invalidEmail")}),r},[s,n,e,a,u,t]),h={disabled:i,value:j,readOnly:f,defaultValue:q,autoFocus:P,addonBefore:T,ref:C,onBlur:A,addonAfter:v?o.jsx(O.LoadingOutlined,{}):I,status:E,size:p,autoComplete:m,onPressEnter:r=>d(r,g,x,l),type:t,placeholder:a??e},N=t=="password"?c.Input.Password:c.Input;return o.jsx(L,{title:F,children:o.jsx(c.Form.Item,{...M,label:e,rules:S,children:o.jsx(N,{...h})})})};exports.default=$;exports.onEnterInternalTextField=d;
@@ -0,0 +1,27 @@
1
+ import { FormItemProps } from 'antd';
2
+ import { SizeType } from 'antd/es/config-provider/SizeContext';
3
+ import { FormInstance } from 'antd/lib/form/Form';
4
+ import { default as React } from 'react';
5
+ export interface TextFieldProps extends FormItemProps<any> {
6
+ type?: any;
7
+ placeholder?: string;
8
+ onEnter?: React.KeyboardEventHandler<HTMLInputElement>;
9
+ form?: FormInstance<any>;
10
+ addonAfter?: any;
11
+ addonBefore?: any;
12
+ nextFocus?: string;
13
+ autoComplete?: string;
14
+ defaultValue?: any;
15
+ readOnly?: boolean;
16
+ value?: any;
17
+ autoFocus?: boolean;
18
+ disabled?: boolean;
19
+ size?: SizeType;
20
+ loading?: boolean;
21
+ inputRef?: any;
22
+ onBlur?: any;
23
+ onChange?: (val: any) => void;
24
+ }
25
+ export declare const onEnterInternalTextField: (e: React.KeyboardEvent<HTMLInputElement>, nextFocus?: string, form?: FormInstance<any>, onEnter?: React.KeyboardEventHandler<HTMLInputElement>) => void;
26
+ declare const TextField: React.FC<TextFieldProps>;
27
+ export default TextField;
@@ -0,0 +1,73 @@
1
+ import { jsx as s } from "react/jsx-runtime";
2
+ import { LoadingOutlined as O } from "@ant-design/icons";
3
+ import { Input as d, Form as S } from "antd";
4
+ import { useMemo as $ } from "react";
5
+ import { useTranslation as j } from "react-i18next";
6
+ import { TRANSLATION_NAMESPACE as D } from "../../../locale/hooks/translation-constants.js";
7
+ import R from "../tooltip/TooltipComponent.js";
8
+ const _ = (o, n, t, r) => {
9
+ var i;
10
+ n && t && (o.preventDefault(), (i = t == null ? void 0 : t.getFieldInstance(n)) == null || i.focus()), r && r(o);
11
+ }, Q = ({
12
+ type: o,
13
+ required: n,
14
+ label: t,
15
+ disabled: r,
16
+ rules: i = [],
17
+ placeholder: m,
18
+ onEnter: p,
19
+ size: f,
20
+ form: l,
21
+ addonAfter: u,
22
+ addonBefore: c,
23
+ nextFocus: T,
24
+ autoComplete: g = "off",
25
+ defaultValue: A,
26
+ readOnly: I,
27
+ value: v,
28
+ loading: C,
29
+ onBlur: E,
30
+ inputRef: P,
31
+ status: h,
32
+ autoFocus: x,
33
+ onChange: k,
34
+ tooltip: F,
35
+ ...N
36
+ }) => {
37
+ const { t: a } = j(D), w = $(() => {
38
+ const e = [
39
+ ...i,
40
+ {
41
+ required: n,
42
+ message: `${t ?? m ?? ""} ${a(
43
+ "err.validation.required"
44
+ )}`
45
+ }
46
+ ];
47
+ return o === "email" && e.push({
48
+ type: "email",
49
+ message: a("err.validation.invalidEmail")
50
+ }), e;
51
+ }, [i, n, t, m, a, o]), L = {
52
+ disabled: r,
53
+ value: v,
54
+ readOnly: I,
55
+ defaultValue: A,
56
+ autoFocus: x,
57
+ addonBefore: c,
58
+ ref: P,
59
+ onBlur: E,
60
+ addonAfter: C ? /* @__PURE__ */ s(O, {}) : u,
61
+ status: h,
62
+ size: f,
63
+ autoComplete: g,
64
+ onPressEnter: (e) => _(e, T, l, p),
65
+ type: o,
66
+ placeholder: m ?? t
67
+ }, M = o == "password" ? d.Password : d;
68
+ return /* @__PURE__ */ s(R, { title: F, children: /* @__PURE__ */ s(S.Item, { ...N, label: t, rules: w, children: /* @__PURE__ */ s(M, { ...L }) }) });
69
+ };
70
+ export {
71
+ Q as default,
72
+ _ as onEnterInternalTextField
73
+ };
@@ -0,0 +1,5 @@
1
+ import { default as NumberTextField } from './NumberField';
2
+ import { default as PhoneField } from './PhoneNumberField';
3
+ import { default as TextField } from './TextField';
4
+ import { default as TextAreaComponent } from './TextArea';
5
+ export { NumberTextField, PhoneField, TextField, TextAreaComponent };
@@ -0,0 +1 @@
1
+ "use strict";const r=require("react/jsx-runtime"),e=require("antd"),n=({children:t,title:o})=>o?r.jsx(e.Tooltip,{title:o,children:t}):t;module.exports=n;
@@ -0,0 +1,5 @@
1
+ import { FC, PropsWithChildren, ReactElement } from 'react';
2
+ declare const TooltipComponent: FC<PropsWithChildren<{
3
+ title?: ReactElement;
4
+ }>>;
5
+ export default TooltipComponent;
@@ -0,0 +1,9 @@
1
+ import { jsx as t } from "react/jsx-runtime";
2
+ import { Tooltip as p } from "antd";
3
+ const n = ({
4
+ children: o,
5
+ title: r
6
+ }) => r ? /* @__PURE__ */ t(p, { title: r, children: o }) : o;
7
+ export {
8
+ n as default
9
+ };
@@ -0,0 +1,2 @@
1
+ import { default as TooltipComponent } from './TooltipComponent';
2
+ export { TooltipComponent };
@@ -0,0 +1 @@
1
+ "use strict";const t=require("react/jsx-runtime"),a=require("@ant-design/icons"),y=require("antd"),o=require("i18next"),A=require("react-i18next"),d=require("../button/Button.cjs"),T=require("../../../locale/hooks/translation-constants.cjs"),h=({errorChildren:l,children:v,onRetry:r,onClickBack:c,success:n,loading:s,error:e,successTitle:x=o.t("str.success"),successMessage:j,errorMessage:u=o.t("err.save"),errorTitle:m=o.t("str.error"),loadingTitle:p=o.t("message.loading.saving"),loadingMessage:q})=>{const{t:i}=A.useTranslation(T.TRANSLATION_NAMESPACE);return t.jsx(y.Result,{status:s?void 0:n?"success":e?["403","404","500"].includes(e==null?void 0:e.code)?e.code:e?"error":void 0:void 0,title:s?p:n?x:e?m:void 0,icon:s?t.jsx(a.LoadingOutlined,{}):void 0,subTitle:s?q:n?j:e?typeof u=="function"?u()??i("err.save"):u??i("err.save"):void 0,extra:[n?t.jsx(t.Fragment,{children:v}):e?t.jsxs(t.Fragment,{children:[!!c&&t.jsx(d,{onClick:c,htmlType:"button",type:"primary",icon:t.jsx(a.ArrowLeftOutlined,{}),children:i("str.previous")}),!!r&&t.jsx(d,{type:"primary",onClick:()=>r(void 0,void 0,!0),children:i("str.retry")},"retry"),l]}):t.jsx(t.Fragment,{})]})};module.exports=h;
@@ -0,0 +1,16 @@
1
+ import { default as React, FC, PropsWithChildren } from 'react';
2
+ declare const WizardResult: FC<{
3
+ onRetry?: (_: undefined, __: undefined, retry: true) => void;
4
+ onClickBack?: () => void;
5
+ loading: boolean;
6
+ error: any;
7
+ success: boolean;
8
+ successTitle?: string;
9
+ successMessage?: string;
10
+ errorTitle?: string;
11
+ errorMessage?: string | (() => string | undefined);
12
+ loadingTitle?: string;
13
+ loadingMessage?: string;
14
+ errorChildren?: React.ReactNode;
15
+ } & PropsWithChildren>;
16
+ export default WizardResult;
@@ -0,0 +1,60 @@
1
+ import { jsx as i, Fragment as d, jsxs as T } from "react/jsx-runtime";
2
+ import { LoadingOutlined as h, ArrowLeftOutlined as x } from "@ant-design/icons";
3
+ import { Result as C } from "antd";
4
+ import { t as m } from "i18next";
5
+ import { useTranslation as L } from "react-i18next";
6
+ import l from "../button/Button.js";
7
+ import { TRANSLATION_NAMESPACE as N } from "../../../locale/hooks/translation-constants.js";
8
+ const w = ({
9
+ errorChildren: u,
10
+ children: a,
11
+ onRetry: p,
12
+ onClickBack: r,
13
+ success: o,
14
+ loading: e,
15
+ error: t,
16
+ successTitle: v = m("str.success"),
17
+ successMessage: f,
18
+ errorMessage: s = m("err.save"),
19
+ errorTitle: c = m("str.error"),
20
+ loadingTitle: y = m("message.loading.saving"),
21
+ loadingMessage: A
22
+ }) => {
23
+ const { t: n } = L(N);
24
+ return /* @__PURE__ */ i(
25
+ C,
26
+ {
27
+ status: e ? void 0 : o ? "success" : t ? ["403", "404", "500"].includes(t == null ? void 0 : t.code) ? t.code : t ? "error" : void 0 : void 0,
28
+ title: e ? y : o ? v : t ? c : void 0,
29
+ icon: e ? /* @__PURE__ */ i(h, {}) : void 0,
30
+ subTitle: e ? A : o ? f : t ? typeof s == "function" ? s() ?? n("err.save") : s ?? n("err.save") : void 0,
31
+ extra: [
32
+ o ? /* @__PURE__ */ i(d, { children: a }) : t ? /* @__PURE__ */ T(d, { children: [
33
+ !!r && /* @__PURE__ */ i(
34
+ l,
35
+ {
36
+ onClick: r,
37
+ htmlType: "button",
38
+ type: "primary",
39
+ icon: /* @__PURE__ */ i(x, {}),
40
+ children: n("str.previous")
41
+ }
42
+ ),
43
+ !!p && /* @__PURE__ */ i(
44
+ l,
45
+ {
46
+ type: "primary",
47
+ onClick: () => p(void 0, void 0, !0),
48
+ children: n("str.retry")
49
+ },
50
+ "retry"
51
+ ),
52
+ u
53
+ ] }) : /* @__PURE__ */ i(d, {})
54
+ ]
55
+ }
56
+ );
57
+ };
58
+ export {
59
+ w as default
60
+ };
@@ -0,0 +1 @@
1
+ "use strict";const c=require("react/jsx-runtime"),w=require("antd"),o=require("react"),F=require("../appearance/Hider.cjs"),{Step:R}=w.Steps,y=o.forwardRef(({pages:d,onSubmit:u,initPosition:f=0,progressDot:v,type:b,labelPlacement:g,className:k,pageStyle:q},C)=>{const[s,i]=o.useState(0),[r,p]=o.useState([]);o.useEffect(()=>{i(f)},[f]),o.useImperativeHandle(C,()=>({gotTo:t=>i(t)}),[]);const m=o.useCallback((t,a=!1,l=!1)=>{const e=[...r];if(t!==void 0&&(e[s]=t,p(e)),l||i(s+1),a&&u){const n={};for(const x of e)for(const S in x)n[S]=x[S];u(e,n)}},[s,r,u]),h=o.useCallback(()=>{const t=[...r];t[s]=void 0,p(t),i(s-1)},[s,r]),j=o.useMemo(()=>{const t=[],a=[],l=d.filter(e=>!e.hidden);for(let e=0;e<l.length;e++){const n=l[e];a.push(c.jsx(F,{hide:s!==e,children:n.component({forward:m,backward:h},r,s===e)},`${n.title}${e}`)),t.push(c.jsx(R,{icon:n.icon,title:n.title},n.title))}return{_pages:a,steps:t}},[h,s,r,m,d]);return c.jsxs(c.Fragment,{children:[c.jsx(w.Steps,{labelPlacement:g,progressDot:v,className:[k,"pb-3"].join(" "),current:s,type:b,children:j.steps}),c.jsx("div",{style:q,children:j._pages})]})});module.exports=y;
@@ -0,0 +1,24 @@
1
+ import { default as React, ReactElement } from 'react';
2
+ interface WizardViewFormProps {
3
+ pages: {
4
+ hidden?: boolean;
5
+ icon?: React.ReactNode;
6
+ title: string;
7
+ component: (func: {
8
+ forward: (value?: any, submit?: boolean, isRetry?: boolean) => void;
9
+ backward: () => void;
10
+ }, formSubmissionData: any[], isActive: boolean) => ReactElement;
11
+ }[];
12
+ labelPlacement?: "vertical" | "horizontal";
13
+ initPosition?: number;
14
+ onSubmit?: (val: (any | undefined)[], combinedValue: any) => void;
15
+ type?: "default" | "navigation" | "inline";
16
+ className?: string;
17
+ progressDot?: boolean;
18
+ pageStyle?: React.CSSProperties;
19
+ }
20
+ export interface WizardViewFormRef {
21
+ gotTo: (index: number) => void;
22
+ }
23
+ declare const WizardViewForm: React.ForwardRefExoticComponent<WizardViewFormProps & React.RefAttributes<WizardViewFormRef>>;
24
+ export default WizardViewForm;
@@ -0,0 +1,74 @@
1
+ import { jsx as f, jsxs as H, Fragment as _ } from "react/jsx-runtime";
2
+ import { Steps as b } from "antd";
3
+ import { forwardRef as $, useState as S, useEffect as z, useImperativeHandle as E, useCallback as g, useMemo as I } from "react";
4
+ import M from "../appearance/Hider.js";
5
+ const { Step: N } = b, q = $(
6
+ ({
7
+ pages: a,
8
+ onSubmit: l,
9
+ initPosition: d = 0,
10
+ progressDot: j,
11
+ type: k,
12
+ labelPlacement: x,
13
+ className: F,
14
+ pageStyle: y
15
+ }, C) => {
16
+ const [t, n] = S(0), [r, m] = S(
17
+ []
18
+ );
19
+ z(() => {
20
+ n(d);
21
+ }, [d]), E(
22
+ C,
23
+ () => ({
24
+ gotTo: (s) => n(s)
25
+ }),
26
+ []
27
+ );
28
+ const p = g(
29
+ (s, c = !1, i = !1) => {
30
+ const e = [...r];
31
+ if (s !== void 0 && (e[t] = s, m(e)), i || n(t + 1), c && l) {
32
+ const o = {};
33
+ for (const w of e)
34
+ for (const v in w)
35
+ o[v] = w[v];
36
+ l(e, o);
37
+ }
38
+ },
39
+ [t, r, l]
40
+ ), u = g(() => {
41
+ const s = [...r];
42
+ s[t] = void 0, m(s), n(t - 1);
43
+ }, [t, r]), h = I(() => {
44
+ const s = [], c = [], i = a.filter((e) => !e.hidden);
45
+ for (let e = 0; e < i.length; e++) {
46
+ const o = i[e];
47
+ c.push(
48
+ /* @__PURE__ */ f(M, { hide: t !== e, children: o.component({ forward: p, backward: u }, r, t === e) }, `${o.title}${e}`)
49
+ ), s.push(/* @__PURE__ */ f(N, { icon: o.icon, title: o.title }, o.title));
50
+ }
51
+ return {
52
+ _pages: c,
53
+ steps: s
54
+ };
55
+ }, [u, t, r, p, a]);
56
+ return /* @__PURE__ */ H(_, { children: [
57
+ /* @__PURE__ */ f(
58
+ b,
59
+ {
60
+ labelPlacement: x,
61
+ progressDot: j,
62
+ className: [F, "pb-3"].join(" "),
63
+ current: t,
64
+ type: k,
65
+ children: h.steps
66
+ }
67
+ ),
68
+ /* @__PURE__ */ f("div", { style: y, children: h._pages })
69
+ ] });
70
+ }
71
+ );
72
+ export {
73
+ q as default
74
+ };