@kingteza/crud-component 1.0.66 → 1.1.0

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 (236) hide show
  1. package/package.json +21 -11
  2. package/release.config.cjs +27 -0
  3. package/App.d.ts +0 -151
  4. package/Play.d.ts +0 -2
  5. package/common/appearance/Hider.cjs.js +0 -1
  6. package/common/appearance/Hider.d.ts +0 -6
  7. package/common/appearance/Hider.es.js +0 -5
  8. package/common/appearance/index.d.ts +0 -1
  9. package/common/button/Button.cjs.js +0 -1
  10. package/common/button/Button.d.ts +0 -11
  11. package/common/button/Button.es.js +0 -57
  12. package/common/button/CloneButtonTable.cjs.js +0 -1
  13. package/common/button/CloneButtonTable.d.ts +0 -6
  14. package/common/button/CloneButtonTable.es.js +0 -19
  15. package/common/button/DeleteButtonTable.cjs.js +0 -1
  16. package/common/button/DeleteButtonTable.d.ts +0 -13
  17. package/common/button/DeleteButtonTable.es.js +0 -64
  18. package/common/button/ExportButton.cjs.js +0 -1
  19. package/common/button/ExportButton.d.ts +0 -4
  20. package/common/button/ExportButton.es.js +0 -26
  21. package/common/button/HideButtonTable.cjs.js +0 -1
  22. package/common/button/HideButtonTable.d.ts +0 -13
  23. package/common/button/HideButtonTable.es.js +0 -67
  24. package/common/button/ImportButton.cjs.js +0 -1
  25. package/common/button/ImportButton.d.ts +0 -9
  26. package/common/button/ImportButton.es.js +0 -55
  27. package/common/button/NewButton.cjs.js +0 -1
  28. package/common/button/NewButton.d.ts +0 -12
  29. package/common/button/NewButton.es.js +0 -23
  30. package/common/button/PrintButton.cjs.js +0 -1
  31. package/common/button/PrintButton.d.ts +0 -12
  32. package/common/button/PrintButton.es.js +0 -25
  33. package/common/button/RefreshButton.cjs.js +0 -1
  34. package/common/button/RefreshButton.d.ts +0 -11
  35. package/common/button/RefreshButton.es.js +0 -23
  36. package/common/button/UnHideButton.cjs.js +0 -1
  37. package/common/button/UnHideButton.d.ts +0 -14
  38. package/common/button/UnHideButton.es.js +0 -69
  39. package/common/button/UpdateButtonTable.cjs.js +0 -1
  40. package/common/button/UpdateButtonTable.d.ts +0 -6
  41. package/common/button/UpdateButtonTable.es.js +0 -19
  42. package/common/button/ViewButtonTable.cjs.js +0 -1
  43. package/common/button/ViewButtonTable.d.ts +0 -6
  44. package/common/button/ViewButtonTable.es.js +0 -19
  45. package/common/button/index.d.ts +0 -14
  46. package/common/check-box/CheckBox.cjs.js +0 -1
  47. package/common/check-box/CheckBox.d.ts +0 -9
  48. package/common/check-box/CheckBox.es.js +0 -40
  49. package/common/check-box/index.d.ts +0 -2
  50. package/common/date-picker/DatePicker.cjs.js +0 -1
  51. package/common/date-picker/DatePicker.d.ts +0 -37
  52. package/common/date-picker/DatePicker.es.js +0 -87
  53. package/common/date-picker/TimePicker.cjs.js +0 -1
  54. package/common/date-picker/TimePicker.d.ts +0 -34
  55. package/common/date-picker/TimePicker.es.js +0 -77
  56. package/common/date-picker/index.d.ts +0 -3
  57. package/common/description/DescList.cjs.js +0 -1
  58. package/common/description/DescList.d.ts +0 -18
  59. package/common/description/DescList.es.js +0 -16
  60. package/common/description/DescriptionComponent.d.ts +0 -7
  61. package/common/description/index.d.ts +0 -3
  62. package/common/icon/KIcon.cjs.js +0 -1
  63. package/common/icon/KIcon.d.ts +0 -9
  64. package/common/icon/KIcon.es.js +0 -11
  65. package/common/index.cjs.js +0 -1
  66. package/common/index.d.ts +0 -20
  67. package/common/index.es.js +0 -78
  68. package/common/layout/VerticalSpace.cjs.js +0 -1
  69. package/common/layout/VerticalSpace.d.ts +0 -5
  70. package/common/layout/VerticalSpace.es.js +0 -6
  71. package/common/layout/index.d.ts +0 -2
  72. package/common/loading/LoadingIndicator.cjs.js +0 -1
  73. package/common/loading/LoadingIndicator.d.ts +0 -6
  74. package/common/loading/LoadingIndicator.es.js +0 -23
  75. package/common/loading/index.d.ts +0 -2
  76. package/common/picker/ImagePicker.cjs.js +0 -1
  77. package/common/picker/ImagePicker.d.ts +0 -56
  78. package/common/picker/ImagePicker.es.js +0 -320
  79. package/common/picker/index.d.ts +0 -2
  80. package/common/radio/RadioGroupComponent.cjs.js +0 -1
  81. package/common/radio/RadioGroupComponent.d.ts +0 -18
  82. package/common/radio/RadioGroupComponent.es.js +0 -19
  83. package/common/radio/index.d.ts +0 -2
  84. package/common/report/SelectFieldInReport.cjs.js +0 -1
  85. package/common/report/SelectFieldInReport.d.ts +0 -16
  86. package/common/report/SelectFieldInReport.es.js +0 -30
  87. package/common/report/index.d.ts +0 -3
  88. package/common/rich/index.cjs.js +0 -1
  89. package/common/rich/index.d.ts +0 -10
  90. package/common/rich/index.es.js +0 -66
  91. package/common/select/CustomSelectOption.cjs.js +0 -1
  92. package/common/select/CustomSelectOption.d.ts +0 -7
  93. package/common/select/CustomSelectOption.es.js +0 -13
  94. package/common/select/SelectComponent.cjs.js +0 -1
  95. package/common/select/SelectComponent.d.ts +0 -21
  96. package/common/select/SelectComponent.es.js +0 -85
  97. package/common/select/index.d.ts +0 -3
  98. package/common/show-more/index.cjs.js +0 -1
  99. package/common/show-more/index.d.ts +0 -4
  100. package/common/show-more/index.es.js +0 -8
  101. package/common/tab/TabViewWithRoute.cjs.js +0 -1
  102. package/common/tab/TabViewWithRoute.d.ts +0 -13
  103. package/common/tab/TabViewWithRoute.es.js +0 -38
  104. package/common/tab/index.d.ts +0 -2
  105. package/common/table/index.d.ts +0 -3
  106. package/common/table/table.cjs.js +0 -1
  107. package/common/table/table.d.ts +0 -19
  108. package/common/table/table.es.js +0 -40
  109. package/common/tag/StatusTag.cjs.js +0 -1
  110. package/common/tag/StatusTag.d.ts +0 -14
  111. package/common/tag/StatusTag.es.js +0 -29
  112. package/common/tag/index.d.ts +0 -2
  113. package/common/text/index.cjs.js +0 -1
  114. package/common/text/index.d.ts +0 -3
  115. package/common/text/index.es.js +0 -5
  116. package/common/text/title/TitleWithHeadTitle.d.ts +0 -7
  117. package/common/text/title/index.cjs.js +0 -1
  118. package/common/text/title/index.d.ts +0 -1
  119. package/common/text/title/index.es.js +0 -5
  120. package/common/text-field/NumberField.cjs.js +0 -1
  121. package/common/text-field/NumberField.d.ts +0 -13
  122. package/common/text-field/NumberField.es.js +0 -82
  123. package/common/text-field/PhoneNumberField.cjs.js +0 -1
  124. package/common/text-field/PhoneNumberField.d.ts +0 -4
  125. package/common/text-field/PhoneNumberField.es.js +0 -18
  126. package/common/text-field/TextArea.cjs.js +0 -1
  127. package/common/text-field/TextArea.d.ts +0 -17
  128. package/common/text-field/TextArea.es.js +0 -46
  129. package/common/text-field/TextField.cjs.js +0 -1
  130. package/common/text-field/TextField.d.ts +0 -27
  131. package/common/text-field/TextField.es.js +0 -72
  132. package/common/text-field/index.d.ts +0 -5
  133. package/common/tooltip/TooltipComponent.cjs.js +0 -1
  134. package/common/tooltip/TooltipComponent.d.ts +0 -5
  135. package/common/tooltip/TooltipComponent.es.js +0 -9
  136. package/common/tooltip/index.d.ts +0 -2
  137. package/common/wizard/WizardResult.cjs.js +0 -1
  138. package/common/wizard/WizardResult.d.ts +0 -16
  139. package/common/wizard/WizardResult.es.js +0 -58
  140. package/common/wizard/WizardViewForm.cjs.js +0 -1
  141. package/common/wizard/WizardViewForm.d.ts +0 -24
  142. package/common/wizard/WizardViewForm.es.js +0 -74
  143. package/common/wizard/index.d.ts +0 -3
  144. package/crud/CrudComponent.cjs.js +0 -1
  145. package/crud/CrudComponent.d.ts +0 -244
  146. package/crud/CrudComponent.es.js +0 -123
  147. package/crud/CrudField.cjs.js +0 -1
  148. package/crud/CrudField.d.ts +0 -4
  149. package/crud/CrudField.es.js +0 -449
  150. package/crud/CrudForm.cjs.js +0 -1
  151. package/crud/CrudForm.d.ts +0 -14
  152. package/crud/CrudForm.es.js +0 -103
  153. package/crud/CrudFormWizard.cjs.js +0 -1
  154. package/crud/CrudFormWizard.d.ts +0 -14
  155. package/crud/CrudFormWizard.es.js +0 -140
  156. package/crud/CrudReportComponent.cjs.js +0 -4
  157. package/crud/CrudReportComponent.d.ts +0 -44
  158. package/crud/CrudReportComponent.es.js +0 -255
  159. package/crud/CrudSearchComponent.cjs.js +0 -1
  160. package/crud/CrudSearchComponent.d.ts +0 -21
  161. package/crud/CrudSearchComponent.es.js +0 -96
  162. package/crud/CrudTextAreaComponent.cjs.js +0 -1
  163. package/crud/CrudTextAreaComponent.d.ts +0 -22
  164. package/crud/CrudTextAreaComponent.es.js +0 -52
  165. package/crud/FileCrudField.cjs.js +0 -1
  166. package/crud/FileCrudField.d.ts +0 -25
  167. package/crud/FileCrudField.es.js +0 -219
  168. package/crud/ImageCrudField.cjs.js +0 -1
  169. package/crud/ImageCrudField.d.ts +0 -38
  170. package/crud/ImageCrudField.es.js +0 -113
  171. package/crud/actions/index.cjs.js +0 -1
  172. package/crud/actions/index.d.ts +0 -26
  173. package/crud/actions/index.es.js +0 -88
  174. package/crud/import/CrudImportButton.cjs.js +0 -1
  175. package/crud/import/CrudImportButton.d.ts +0 -3
  176. package/crud/import/CrudImportButton.es.js +0 -30
  177. package/crud/import/CrudImportComponent.cjs.js +0 -2
  178. package/crud/import/CrudImportComponent.d.ts +0 -14
  179. package/crud/import/CrudImportComponent.es.js +0 -222
  180. package/crud/index.d.ts +0 -23
  181. package/crud/modal/index.cjs.js +0 -1
  182. package/crud/modal/index.d.ts +0 -24
  183. package/crud/modal/index.es.js +0 -146
  184. package/crud/view/CrudDecListView.cjs.js +0 -1
  185. package/crud/view/CrudDecListView.d.ts +0 -15
  186. package/crud/view/CrudDecListView.es.js +0 -57
  187. package/crud/view/CrudViewer.cjs.js +0 -1
  188. package/crud/view/CrudViewer.d.ts +0 -43
  189. package/crud/view/CrudViewer.es.js +0 -304
  190. package/crud/view/CrudViewerUtil.cjs.js +0 -1
  191. package/crud/view/CrudViewerUtil.d.ts +0 -2
  192. package/crud/view/CrudViewerUtil.es.js +0 -98
  193. package/crud/view/index.d.ts +0 -5
  194. package/hooks/NavigatorHooks.cjs.js +0 -1
  195. package/hooks/NavigatorHooks.d.ts +0 -1
  196. package/hooks/NavigatorHooks.es.js +0 -9
  197. package/icons/FlipHIcon.cjs.js +0 -1
  198. package/icons/FlipHIcon.d.ts +0 -3
  199. package/icons/FlipHIcon.es.js +0 -28
  200. package/icons/FlipVIcon.cjs.js +0 -1
  201. package/icons/FlipVIcon.d.ts +0 -3
  202. package/icons/FlipVIcon.es.js +0 -28
  203. package/index.cjs.js +0 -1
  204. package/index.d.ts +0 -4
  205. package/index.es.js +0 -46
  206. package/locale/hooks/translation-constants.cjs.js +0 -1
  207. package/locale/hooks/translation-constants.d.ts +0 -1
  208. package/locale/hooks/translation-constants.es.js +0 -4
  209. package/locale/index.cjs.js +0 -1
  210. package/locale/index.d.ts +0 -85
  211. package/locale/index.es.js +0 -57
  212. package/locale/translations/en.cjs.js +0 -1
  213. package/locale/translations/en.d.ts +0 -63
  214. package/locale/translations/en.es.js +0 -65
  215. package/main.d.ts +0 -0
  216. package/types/DialogComponentProp.d.ts +0 -8
  217. package/types/Id.d.ts +0 -10
  218. package/util/CrudUtil.cjs.js +0 -1
  219. package/util/CrudUtil.d.ts +0 -5
  220. package/util/CrudUtil.es.js +0 -8
  221. package/util/DateUtil.cjs.js +0 -1
  222. package/util/DateUtil.d.ts +0 -7
  223. package/util/DateUtil.es.js +0 -18
  224. package/util/ImageUtil.cjs.js +0 -1
  225. package/util/ImageUtil.d.ts +0 -14
  226. package/util/ImageUtil.es.js +0 -63
  227. package/util/NumberUtil.cjs.js +0 -1
  228. package/util/NumberUtil.d.ts +0 -17
  229. package/util/NumberUtil.es.js +0 -60
  230. package/util/ValidationUtil.cjs.js +0 -1
  231. package/util/ValidationUtil.d.ts +0 -14
  232. package/util/ValidationUtil.es.js +0 -63
  233. package/util/index.cjs.js +0 -1
  234. package/util/index.d.ts +0 -4
  235. package/util/index.es.js +0 -10
  236. package/vite-env.d.ts +0 -1
@@ -1,17 +0,0 @@
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;
@@ -1,46 +0,0 @@
1
- import { jsx as a } from "react/jsx-runtime";
2
- import { Form as u, Input as p } from "antd";
3
- import { useTranslationLib as I } from "../../locale/index.es.js";
4
- const f = (n, e, t, r) => {
5
- var o;
6
- e && t && (n.preventDefault(), (o = t == null ? void 0 : t.getFieldInstance(e)) == null || o.focus()), r && r(n);
7
- }, g = ({
8
- required: n,
9
- label: e,
10
- rules: t = [],
11
- placeholder: r,
12
- onEnter: o,
13
- nextFocus: c,
14
- className: i,
15
- ...s
16
- }) => {
17
- const { t: d } = I(), l = u.useFormInstance();
18
- return /* @__PURE__ */ a(
19
- u.Item,
20
- {
21
- ...s,
22
- className: i,
23
- label: e,
24
- rules: [
25
- ...t,
26
- {
27
- required: n,
28
- message: `${e} ${d("err.validation.required")}`
29
- }
30
- ],
31
- children: /* @__PURE__ */ a(
32
- p.TextArea,
33
- {
34
- ...s,
35
- className: i,
36
- onPressEnter: (m) => f(m, c, l, o),
37
- placeholder: r ?? e
38
- }
39
- )
40
- }
41
- );
42
- };
43
- export {
44
- g as default,
45
- f as onEnterInternalTextField
46
- };
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const o=require("react/jsx-runtime"),R=require("@ant-design/icons"),d=require("antd"),S=require("react"),_=require("../../locale/index.cjs.js"),$=require("../tooltip/TooltipComponent.cjs.js"),c=(n,t,e,i)=>{var s;t&&e&&(n.preventDefault(),(s=e==null?void 0:e.getFieldInstance(t))==null||s.focus()),i&&i(n)},A=({type:n,required:t,label:e,disabled:i,rules:s=[],placeholder:u,onEnter:l,size:p,form:x,addonAfter:g,addonBefore:m,nextFocus:I,autoComplete:f="off",defaultValue:j,readOnly:q,value:v,loading:T,onBlur:F,inputRef:P,status:h,autoFocus:C,onChange:D,tooltip:E,...M})=>{const{t:a}=_.useTranslationLib(),w=S.useMemo(()=>{const r=[...s,{required:t,message:`${e??u??""} ${a("err.validation.required")}`}];return n==="email"&&r.push({type:"email",message:a("err.validation.invalidEmail")}),r},[s,t,e,u,a,n]),L={disabled:i,value:v,readOnly:q,defaultValue:j,autoFocus:C,addonBefore:m,ref:P,onBlur:F,addonAfter:T?o.jsx(R.LoadingOutlined,{}):g,status:h,size:p,autoComplete:f,onPressEnter:r=>c(r,I,x,l),type:n,placeholder:u??e},O=n=="password"?d.Input.Password:d.Input;return o.jsx($,{title:E,children:o.jsx(d.Form.Item,{...M,label:e,rules:w,children:o.jsx(O,{...L})})})};exports.default=A;exports.onEnterInternalTextField=c;
@@ -1,27 +0,0 @@
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;
@@ -1,72 +0,0 @@
1
- import { jsx as s } from "react/jsx-runtime";
2
- import { LoadingOutlined as D } from "@ant-design/icons";
3
- import { Input as d, Form as M } from "antd";
4
- import { useMemo as O } from "react";
5
- import { useTranslationLib as k } from "../../locale/index.es.js";
6
- import q from "../tooltip/TooltipComponent.es.js";
7
- const z = (n, o, t, e) => {
8
- var i;
9
- o && t && (n.preventDefault(), (i = t == null ? void 0 : t.getFieldInstance(o)) == null || i.focus()), e && e(n);
10
- }, R = ({
11
- type: n,
12
- required: o,
13
- label: t,
14
- disabled: e,
15
- rules: i = [],
16
- placeholder: a,
17
- onEnter: p,
18
- size: f,
19
- form: l,
20
- addonAfter: u,
21
- addonBefore: c,
22
- nextFocus: g,
23
- autoComplete: v = "off",
24
- defaultValue: I,
25
- readOnly: T,
26
- value: h,
27
- loading: x,
28
- onBlur: C,
29
- inputRef: F,
30
- status: P,
31
- autoFocus: w,
32
- onChange: B,
33
- tooltip: E,
34
- ...L
35
- }) => {
36
- const { t: m } = k(), $ = O(() => {
37
- const r = [
38
- ...i,
39
- {
40
- required: o,
41
- message: `${t ?? a ?? ""} ${m(
42
- "err.validation.required"
43
- )}`
44
- }
45
- ];
46
- return n === "email" && r.push({
47
- type: "email",
48
- message: m("err.validation.invalidEmail")
49
- }), r;
50
- }, [i, o, t, a, m, n]), j = {
51
- disabled: e,
52
- value: h,
53
- readOnly: T,
54
- defaultValue: I,
55
- autoFocus: w,
56
- addonBefore: c,
57
- ref: F,
58
- onBlur: C,
59
- addonAfter: x ? /* @__PURE__ */ s(D, {}) : u,
60
- status: P,
61
- size: f,
62
- autoComplete: v,
63
- onPressEnter: (r) => z(r, g, l, p),
64
- type: n,
65
- placeholder: a ?? t
66
- }, A = n == "password" ? d.Password : d;
67
- return /* @__PURE__ */ s(q, { title: E, children: /* @__PURE__ */ s(M.Item, { ...L, label: t, rules: $, children: /* @__PURE__ */ s(A, { ...j }) }) });
68
- };
69
- export {
70
- R as default,
71
- z as onEnterInternalTextField
72
- };
@@ -1,5 +0,0 @@
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 };
@@ -1 +0,0 @@
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;
@@ -1,5 +0,0 @@
1
- import { FC, PropsWithChildren, ReactElement } from 'react';
2
- declare const TooltipComponent: FC<PropsWithChildren<{
3
- title?: ReactElement;
4
- }>>;
5
- export default TooltipComponent;
@@ -1,9 +0,0 @@
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
- };
@@ -1,2 +0,0 @@
1
- import { default as TooltipComponent } from './TooltipComponent';
2
- export { TooltipComponent };
@@ -1 +0,0 @@
1
- "use strict";const t=require("react/jsx-runtime"),l=require("@ant-design/icons"),r=require("antd"),x=require("../button/Button.cjs.js"),b=require("../../locale/index.cjs.js"),F=({errorChildren:v,children:a,onRetry:c,onClickBack:u,success:e,loading:o,error:i,successTitle:j,successMessage:p,errorMessage:n,errorTitle:m,loadingTitle:y,loadingMessage:T})=>{const{t:s}=b.useTranslationLib(),f=j??s("str.success"),q=m??s("str.error"),d=n?typeof n=="function"?n():n:s("err.save"),h=y??s("message.loading.saving");return t.jsx(r.Result,{status:o?void 0:e?"success":i?["403","404","500"].includes(i==null?void 0:i.code)?i.code:i?"error":void 0:void 0,title:o?h:e?f:i?q:void 0,icon:o?t.jsx(l.LoadingOutlined,{}):void 0,subTitle:o?T:e?p:i?typeof n=="function"?n()??d:n??d:void 0,extra:[e?t.jsx(t.Fragment,{children:a}):i?t.jsxs(t.Fragment,{children:[!!u&&t.jsx(x,{onClick:u,htmlType:"button",type:"primary",icon:t.jsx(l.ArrowLeftOutlined,{}),children:s("str.previous")}),!!c&&t.jsx(x,{type:"primary",onClick:()=>c(void 0,void 0,!0),children:s("str.retry")},"retry"),v]}):t.jsx(t.Fragment,{})]})};module.exports=F;
@@ -1,16 +0,0 @@
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;
@@ -1,58 +0,0 @@
1
- import { jsx as o, jsxs as j, Fragment as s } from "react/jsx-runtime";
2
- import { ArrowLeftOutlined as B, LoadingOutlined as C } from "@ant-design/icons";
3
- import { Result as O } from "antd";
4
- import e from "../button/Button.es.js";
5
- import { useTranslationLib as r } from "../../locale/index.es.js";
6
- const W = ({
7
- errorChildren: p,
8
- children: f,
9
- onRetry: c,
10
- onClickBack: m,
11
- success: d,
12
- loading: l,
13
- error: t,
14
- successTitle: v,
15
- successMessage: a,
16
- errorMessage: i,
17
- errorTitle: y,
18
- loadingTitle: T,
19
- loadingMessage: h
20
- }) => {
21
- const { t: n } = r(), x = v ?? n("str.success"), b = y ?? n("str.error"), u = i ? typeof i == "function" ? i() : i : n("err.save"), L = T ?? n("message.loading.saving");
22
- return /* @__PURE__ */ o(
23
- O,
24
- {
25
- status: l ? void 0 : d ? "success" : t ? ["403", "404", "500"].includes(t == null ? void 0 : t.code) ? t.code : t ? "error" : void 0 : void 0,
26
- title: l ? L : d ? x : t ? b : void 0,
27
- icon: l ? /* @__PURE__ */ o(C, {}) : void 0,
28
- subTitle: l ? h : d ? a : t ? typeof i == "function" ? i() ?? u : i ?? u : void 0,
29
- extra: [
30
- d ? /* @__PURE__ */ o(s, { children: f }) : t ? /* @__PURE__ */ j(s, { children: [
31
- !!m && /* @__PURE__ */ o(
32
- e,
33
- {
34
- onClick: m,
35
- htmlType: "button",
36
- type: "primary",
37
- icon: /* @__PURE__ */ o(B, {}),
38
- children: n("str.previous")
39
- }
40
- ),
41
- !!c && /* @__PURE__ */ o(
42
- e,
43
- {
44
- type: "primary",
45
- onClick: () => c(void 0, void 0, !0),
46
- children: n("str.retry")
47
- },
48
- "retry"
49
- ),
50
- p
51
- ] }) : /* @__PURE__ */ o(s, {})
52
- ]
53
- }
54
- );
55
- };
56
- export {
57
- W as default
58
- };
@@ -1 +0,0 @@
1
- "use strict";const c=require("react/jsx-runtime"),w=require("antd"),o=require("react"),F=require("../appearance/Hider.cjs.js"),{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;
@@ -1,24 +0,0 @@
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;
@@ -1,74 +0,0 @@
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.es.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
- };
@@ -1,3 +0,0 @@
1
- import { default as WizardResult } from './WizardResult';
2
- import { default as WizardViewForm } from './WizardViewForm';
3
- export { WizardResult, WizardViewForm };
@@ -1 +0,0 @@
1
- "use strict";const e=require("react/jsx-runtime"),l=require("antd"),t=require("react"),H=require("./modal/index.cjs.js"),J=require("./import/CrudImportButton.cjs.js"),K=require("./view/CrudViewer.cjs.js"),L=require("../common/button/NewButton.cjs.js"),M=require("../common/button/PrintButton.cjs.js"),{useForm:Q}=l.Form;function O({idField:a="id",onCreate:C,onDelete:j,onHide:m,onUpdate:n,fields:r,data:f,grid:k,isHiding:q,isCreating:h,isDeleting:p,isUpdating:B,paginateProps:w,onPrint:i,printing:N,viewable:v,loadingData:R,formBuilder:g,extraAction:y,minusHeight:b,cloneable:F,fullWidthModal:P=!0,wizard:S,extraView:I,importable:u,onClickNew:d,size:V,...z}){const c=t.useRef(null),A=t.useCallback(()=>{var s;(s=c.current)==null||s.create()},[]),o=t.useCallback(async(s,E=!0,G=!1)=>{var x;await((x=c.current)==null?void 0:x.update(s,E,G))},[]),D=t.useCallback(async s=>{o(s,!1,!0)},[o]);return e.jsxs(e.Fragment,{children:[e.jsxs(l.Space,{direction:"vertical",className:"w-100",children:[e.jsxs("div",{className:"w-100 d-flex",children:[e.jsx("div",{style:{flex:1},children:e.jsx(L.NewButton,{onClick:()=>{d?d():A()},className:"flex-1"})}),e.jsxs(l.Space,{children:[!!i&&e.jsx(M.PrintButton,{className:"float-right",loading:N,onClick:i}),!!u&&e.jsx(J,{fields:r,importProps:u})]})]}),e.jsx(K,{...z,minusHeight:b,data:f,size:V,fields:r,extraAction:y,idField:a,isDeleting:p,loadingData:R,onClickUpdate:n?o:void 0,onHide:m,isHiding:q,onDelete:j,onUpdate:n,onClickClone:F?D:void 0,paginateProps:w,viewable:v,extraView:I})]}),e.jsx(H,{ref:c,fields:r,wizard:S,grid:k,fullWidthModal:P,isCreating:h,isUpdating:B,onCreate:C,onUpdate:n,idField:a,formBuilder:g})]})}module.exports=O;
@@ -1,244 +0,0 @@
1
- import { ColorPickerProps } from 'antd';
2
- import { Rule } from 'antd/es/form';
3
- import { FormInstance } from 'antd/lib';
4
- import { Dayjs } from 'dayjs';
5
- import { default as React, ReactElement, ReactNode } from 'react';
6
- import { CrudSearchComponentProps } from './CrudSearchComponent';
7
- import { FileCrudField } from './FileCrudField';
8
- import { ImageCrudField } from './ImageCrudField';
9
- import { CrudImportProps } from './import/CrudImportComponent';
10
- import { CrudDragableProps, CrudViewableProps } from './view/CrudViewer';
11
- import { SelectTagRenderProps } from '../common/select/SelectComponent';
12
- import { default as IdProps } from '../types/Id';
13
- import { TextAreaBasedFieldProps } from './CrudTextAreaComponent';
14
- import { SizeType } from 'antd/es/config-provider/SizeContext';
15
- export type SelectFieldItem = {
16
- key?: string | number;
17
- value: string | number;
18
- disabled?: boolean;
19
- };
20
- export interface InitialCrudField<T> {
21
- label: string;
22
- updatingValue?: T;
23
- render?: (value: any, obj: T, index: number) => any;
24
- required?: boolean;
25
- updatable?: boolean;
26
- fieldTooltip?: string;
27
- hideInTable?: boolean;
28
- hideInDescList?: boolean;
29
- readonly?: boolean;
30
- fieldClassName?: string;
31
- halign?: "right" | "left";
32
- /**
33
- * Indicates the fields is visible or not
34
- */
35
- hidden?: boolean;
36
- width?: number | string;
37
- name: keyof T | (string | number)[];
38
- rules?: Rule[];
39
- grid?: CrudFieldGrid;
40
- report?: {
41
- searchable?: boolean;
42
- sortable?: boolean;
43
- defaultSort?: boolean | "ASC" | "DESC";
44
- lock?: boolean;
45
- alreadySelected?: boolean;
46
- customRender?: (form: FormInstance<any>) => ReactElement;
47
- };
48
- customFormFieldRender?: (form: FormInstance<T>, props: InitialCrudField<T>) => React.ReactElement;
49
- importProps?: {
50
- extraFields?: string[];
51
- hidden?: boolean;
52
- };
53
- hideLabel?: boolean;
54
- }
55
- export type CrudFieldGrid = {
56
- xs?: number;
57
- sm?: number;
58
- md?: number;
59
- lg?: number;
60
- xl?: number;
61
- xxl?: number;
62
- };
63
- export interface SelectCrudField<T, ItemType extends SelectFieldItem = SelectFieldItem> extends Omit<InitialCrudField<T>, "name">, AddonFieldProps {
64
- name: InitialCrudField<T>["name"] | {
65
- name: keyof T | (string | number)[];
66
- upsertFieldName: keyof T | (string | number)[];
67
- };
68
- type: "select";
69
- placeholder?: string;
70
- /**
71
- * @default true
72
- */
73
- allowClear?: boolean;
74
- /**
75
- * Used when the type is 'select'
76
- */
77
- innerFieldId?: string;
78
- innerFieldLabel?: string;
79
- /**
80
- * Used when the type is 'select'
81
- */
82
- items: ItemType[];
83
- tagRender?: SelectTagRenderProps;
84
- /**
85
- * Whether the search should be highlighted
86
- */
87
- highlightSearch?: boolean;
88
- /**
89
- * Used when the type is 'select'
90
- */
91
- loading?: boolean;
92
- /**
93
- * Used when the type is 'select'
94
- */
95
- onSearch?: (keyword: any, form: FormInstance<T>, record: T | undefined) => void;
96
- /**
97
- * Used when the type is 'select'. Wether the result should refresh if the search value is changed.
98
- */
99
- searchOnType?: boolean;
100
- multiple?: boolean;
101
- report?: InitialCrudField<T>["report"] & {
102
- multiple?: boolean;
103
- };
104
- onChange?: (value: any, form: FormInstance<T>) => void;
105
- onSet?: (value: any | any[], items: SelectFieldItem[], form: FormInstance<T>) => void;
106
- }
107
- export interface EnumCrudField<T> extends InitialCrudField<T> {
108
- type: "enum";
109
- placeholder?: string;
110
- name: keyof T;
111
- enum: object | object[];
112
- radio?: boolean;
113
- translation?: object;
114
- multiple?: boolean;
115
- tagRender?: Record<string, {
116
- color: string;
117
- }> | SelectTagRenderProps;
118
- onChange?: (value: T[keyof T], form: FormInstance<T>) => void;
119
- onSearch?: (keyword: string, form: FormInstance<T>) => void;
120
- }
121
- export type AddonFieldProps = {
122
- addonAfter?: ReactNode;
123
- addonBefore?: ReactNode;
124
- };
125
- export interface ObjectCrudField<T> extends InitialCrudField<T> {
126
- type: "object";
127
- render: (value: any, obj: T, index: number) => any;
128
- translation?: object;
129
- }
130
- export interface TextBasedFieldProps<T> extends InitialCrudField<T>, AddonFieldProps {
131
- placeholder?: string;
132
- type: "text" | "time" | "email" | "password";
133
- onChange?: (value: string, form: FormInstance<T>) => void;
134
- }
135
- export interface ColorPickerFieldProps<T> extends Omit<InitialCrudField<T>, "placeholder"> {
136
- type: "color";
137
- innerProps?: ColorPickerProps;
138
- }
139
- export interface CheckboxBasedFieldProps<T> extends InitialCrudField<T> {
140
- type: "checkbox";
141
- onChange?: (value: boolean, form: FormInstance<T>) => void;
142
- }
143
- export interface NumberBasedFieldProps<T> extends InitialCrudField<T>, AddonFieldProps {
144
- type: "number";
145
- placeholder?: string;
146
- allowMinus?: boolean;
147
- min?: number;
148
- max?: number;
149
- /**
150
- * If it is number field making this true will convert the value to comma separated number field
151
- */
152
- formatted?: boolean;
153
- int?: boolean;
154
- onChange?: (value: number, form: FormInstance<T>) => void;
155
- }
156
- export interface DateBasedFieldProps<T> extends InitialCrudField<T> {
157
- type: "date";
158
- format?: string;
159
- placeholder?: string;
160
- /**
161
- * If it is number field making this true will convert the value to comma separated number field
162
- */
163
- formatTime?: boolean;
164
- range?: boolean;
165
- disableToday?: boolean;
166
- disabledFutureDays?: boolean;
167
- disabledPastDays?: boolean;
168
- report?: InitialCrudField<T>["report"] & {
169
- range?: boolean;
170
- required?: boolean;
171
- };
172
- onChange?: (value: Dayjs | undefined, form: FormInstance<T>) => void;
173
- }
174
- export interface TimeBasedFieldProps<T> extends InitialCrudField<T> {
175
- type: "time";
176
- placeholder?: string;
177
- use12Hours?: boolean;
178
- range?: boolean;
179
- format?: "h:mm:ss" | "h:mm:ss A" | "h:mm" | "h:mm A" | "mm" | "h" | "h A";
180
- disableCurrent?: boolean;
181
- disabledFuture?: boolean;
182
- disabledPast?: boolean;
183
- report?: InitialCrudField<T>["report"] & {
184
- range?: boolean;
185
- };
186
- onChange?: (value: Dayjs | undefined, form: FormInstance<T>) => void;
187
- }
188
- export type CrudPurpose = "new" | "clone" | "update";
189
- export type GetFormFieldOptions = {
190
- onChange?: (value: any) => void;
191
- render?: (component: React.JSX.Element) => React.ReactElement;
192
- };
193
- export type FormBuilderFunc0<T> = (name: keyof T, options?: GetFormFieldOptions) => ReactElement;
194
- export type FormBuilderFunc<T> = (i: FormBuilderFunc0<T>, otherUtils: {
195
- isAnyFieldHidden: (...name: Array<keyof T>) => boolean;
196
- isAllFieldsHidden: (...name: Array<keyof T>) => boolean;
197
- purpose?: CrudPurpose;
198
- }) => ReactElement;
199
- export type CrudFieldProps<T> = SelectCrudField<T> | TextBasedFieldProps<T> | TextAreaBasedFieldProps<T> | ImageCrudField<T> | EnumCrudField<T> | DateBasedFieldProps<T> | TimeBasedFieldProps<T> | ObjectCrudField<T> | NumberBasedFieldProps<T> | CheckboxBasedFieldProps<T> | ColorPickerFieldProps<T> | FileCrudField<T>;
200
- export type CrudPaginateProps = false | {
201
- page?: number;
202
- setPage?: (page: number, pageSize?: number) => void;
203
- pageSize?: number;
204
- count?: number;
205
- };
206
- export type CrudWizardProp<T> = {
207
- title: string;
208
- fields: Array<keyof T>;
209
- icon?: ReactElement;
210
- formBuilder?: FormBuilderFunc<T>;
211
- grid?: boolean;
212
- };
213
- export type CrudComponentProps<T, FormType = T> = {
214
- fields: CrudFieldProps<T>[];
215
- data: T[] | undefined;
216
- idField?: string;
217
- grid?: boolean;
218
- onPrint?: () => void;
219
- printing?: boolean;
220
- onCreate?: (t: FormType) => Promise<any>;
221
- onHide?: (id: any) => Promise<any>;
222
- onDelete?: (id: any) => Promise<any>;
223
- onUpdate?: (t: FormType & IdProps) => Promise<any>;
224
- loadingData?: boolean;
225
- isCreating?: boolean;
226
- isHiding?: boolean;
227
- isDeleting?: boolean;
228
- isUpdating?: boolean;
229
- viewable?: CrudViewableProps<T>;
230
- extraAction?: (t: T) => ReactElement;
231
- paginateProps?: CrudPaginateProps;
232
- formBuilder?: FormBuilderFunc<T>;
233
- minusHeight?: string;
234
- cloneable?: boolean;
235
- fullWidthModal?: boolean;
236
- wizard?: CrudWizardProp<T>[];
237
- extraView?: (t: T) => React.ReactElement;
238
- importable?: CrudImportProps<T>;
239
- onClickNew?: () => void;
240
- draggable?: CrudDragableProps<T>;
241
- size?: SizeType;
242
- } & CrudSearchComponentProps<T, FormType>;
243
- declare function CrudComponent<T, FormType = T>({ idField, onCreate, onDelete, onHide, onUpdate, fields, data, grid, isHiding, isCreating, isDeleting, isUpdating, paginateProps, onPrint, printing, viewable, loadingData, formBuilder, extraAction, minusHeight, cloneable, fullWidthModal, wizard, extraView, importable, onClickNew, size, ...props }: CrudComponentProps<T, FormType>): import("react/jsx-runtime").JSX.Element;
244
- export default CrudComponent;