@kingteza/crud-component 1.0.26 → 1.0.27

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 (203) 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 +4 -4
  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
package/App.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ declare function App(): import("react/jsx-runtime").JSX.Element;
2
+ export default App;
@@ -0,0 +1 @@
1
+ "use strict";const d=require("react/jsx-runtime"),s=require("antd"),t=require("dayjs"),E=require("dayjs/plugin/advancedFormat"),F=require("dayjs/plugin/customParseFormat"),I=require("dayjs/plugin/localeData"),v=require("dayjs/plugin/weekday"),S=require("dayjs/plugin/weekOfYear"),T=require("dayjs/plugin/weekYear"),Y=require("../../../locale/hooks/translation-constants.cjs"),$=require("react"),L=require("react-i18next");t.extend(F);t.extend(E);t.extend(v);t.extend(I);t.extend(S);t.extend(T);const M=({type:_,required:q,label:o,rules:x=[],placeholder:a,disabledPastDays:c=!1,disableToday:i=!1,onEnter:z,disabled:f,nextFocus:B,onChange:r,range:m,showTime:l,disabledFutureDays:u,picker:k,defaultValue:O,value:y,format:P,autoComplete:G="off",enabledDates:H=[],renderExtraFooter:j,...p})=>{const{t:w}=L.useTranslation(Y.TRANSLATION_NAMESPACE),A=m?s.DatePicker.RangePicker:s.DatePicker,D=$.useCallback(e=>{if(!e)return!1;const n=t(),N=c&&e<n.startOf("day"),R=u&&e>n.endOf("day"),C=i&&e<n.endOf("day")&&n.startOf("day")<e;return N||R||C},[c,u,i]);return d.jsx(s.Form.Item,{...p,label:o,rules:[{required:q,message:`${o??a??""} ${w("err.validation.required")}`},...x],children:d.jsx(A,{renderExtraFooter:j,value:y,picker:k,defaultValue:O,format:P,onChange:e=>r==null?void 0:r(e),disabledDate:D,disabled:f,className:"w-100",placeholder:a,showTime:l})})};module.exports=M;
@@ -0,0 +1,37 @@
1
+ import { FormItemProps } from 'antd/lib/form';
2
+ import { Dayjs } from 'dayjs';
3
+ import { default as React, FC } from 'react';
4
+ export type DateRange = [Dayjs | null, Dayjs | null];
5
+ export interface DatePickerComponentProps extends FormItemProps<any> {
6
+ type?: any;
7
+ placeholder?: string;
8
+ onEnter?: React.KeyboardEventHandler<HTMLInputElement>;
9
+ nextFocus?: string;
10
+ disableToday?: boolean;
11
+ autoComplete?: string;
12
+ disabled?: boolean;
13
+ enabledDates?: Date[];
14
+ disabledPastDays?: boolean;
15
+ disabledFutureDays?: boolean;
16
+ renderExtraFooter?: () => React.ReactElement;
17
+ }
18
+ export interface DateRangePickerProps extends DatePickerComponentProps {
19
+ onChange?: (date: DateRange) => void;
20
+ range: true;
21
+ defaultValue?: DateRange | boolean;
22
+ value?: DateRange;
23
+ format?: string;
24
+ picker?: string;
25
+ showTime?: boolean;
26
+ }
27
+ export interface DatePickerProps extends DatePickerComponentProps {
28
+ onChange?: (date: Dayjs | null) => void;
29
+ defaultValue?: Dayjs;
30
+ value?: Dayjs;
31
+ range?: false;
32
+ format?: string;
33
+ picker?: string;
34
+ showTime?: never;
35
+ }
36
+ declare const DatePickerComponent: FC<DateRangePickerProps | DatePickerProps>;
37
+ export default DatePickerComponent;
@@ -0,0 +1,88 @@
1
+ import { jsx as i } from "react/jsx-runtime";
2
+ import { DatePicker as d, Form as C } from "antd";
3
+ import e from "dayjs";
4
+ import I from "dayjs/plugin/advancedFormat";
5
+ import R from "dayjs/plugin/customParseFormat";
6
+ import S from "dayjs/plugin/localeData";
7
+ import T from "dayjs/plugin/weekday";
8
+ import Y from "dayjs/plugin/weekOfYear";
9
+ import $ from "dayjs/plugin/weekYear";
10
+ import { TRANSLATION_NAMESPACE as q } from "../../../locale/hooks/translation-constants.js";
11
+ import { useCallback as L } from "react";
12
+ import { useTranslation as M } from "react-i18next";
13
+ e.extend(R);
14
+ e.extend(I);
15
+ e.extend(T);
16
+ e.extend(S);
17
+ e.extend(Y);
18
+ e.extend($);
19
+ const et = ({
20
+ type: _,
21
+ required: c,
22
+ label: m,
23
+ rules: p = [],
24
+ placeholder: a,
25
+ disabledPastDays: n = !1,
26
+ disableToday: f = !1,
27
+ onEnter: z,
28
+ disabled: l,
29
+ nextFocus: B,
30
+ onChange: r,
31
+ range: x,
32
+ showTime: k,
33
+ disabledFutureDays: s,
34
+ picker: O,
35
+ defaultValue: u,
36
+ value: y,
37
+ format: w,
38
+ autoComplete: G = "off",
39
+ enabledDates: H = [],
40
+ renderExtraFooter: A,
41
+ ...N
42
+ }) => {
43
+ const { t: P } = M(q), D = x ? d.RangePicker : d, E = L(
44
+ (t) => {
45
+ if (!t)
46
+ return !1;
47
+ const o = e(), F = n && t < o.startOf("day"), j = s && t > o.endOf("day"), v = f && t < o.endOf("day") && o.startOf("day") < t;
48
+ return F || j || v;
49
+ },
50
+ [n, s, f]
51
+ // Dependencies for useCallback
52
+ );
53
+ return /* @__PURE__ */ i(
54
+ C.Item,
55
+ {
56
+ ...N,
57
+ label: m,
58
+ rules: [
59
+ {
60
+ required: c,
61
+ message: `${m ?? a ?? ""} ${P(
62
+ "err.validation.required"
63
+ )}`
64
+ },
65
+ ...p
66
+ ],
67
+ children: /* @__PURE__ */ i(
68
+ D,
69
+ {
70
+ renderExtraFooter: A,
71
+ value: y,
72
+ picker: O,
73
+ defaultValue: u,
74
+ format: w,
75
+ onChange: (t) => r == null ? void 0 : r(t),
76
+ disabledDate: E,
77
+ disabled: l,
78
+ className: "w-100",
79
+ placeholder: a,
80
+ showTime: k
81
+ }
82
+ )
83
+ }
84
+ );
85
+ };
86
+ export {
87
+ et as default
88
+ };
@@ -0,0 +1 @@
1
+ "use strict";const l=require("react/jsx-runtime"),c=require("antd"),C=require("dayjs"),q=require("react"),F=require("react-i18next"),M=require("../../../locale/hooks/translation-constants.cjs"),$=({type:v,required:T,label:r,rules:f=[],placeholder:t,disabledPast:i=!1,disableCurrent:m=!1,onEnter:w,disabled:x,use12Hours:k,nextFocus:D,onChange:s,range:n,disabledFuture:a,defaultValue:j,value:p,format:A,autoComplete:H="off",renderExtraFooter:N,...P})=>{const{t:R}=F.useTranslation(M.TRANSLATION_NAMESPACE),u=q.useMemo(()=>t||(n?["From","To"]:"Select time"),[t,n]);console.log(u);const y=n?c.TimePicker.RangePicker:c.TimePicker,E=q.useCallback(e=>{if(!e)return!1;const o=C(),I=i&&e<o,S=a&&e>o,d=m&&e<o&&o<e;return I||S||d},[m,a,i]);return l.jsx(c.Form.Item,{...P,label:r,rules:[{required:T,message:`${r??t??""} ${R("err.validation.required")}`},...f],children:l.jsx(y,{use12Hours:k,renderExtraFooter:N,value:p,defaultValue:j,format:A,onChange:e=>s==null?void 0:s(e),disabledDate:E,disabled:x,className:"w-100",placeholder:u})})};module.exports=$;
@@ -0,0 +1,34 @@
1
+ import { FormItemProps } from 'antd/lib/form';
2
+ import { Dayjs } from 'dayjs';
3
+ import { default as React, FC } from 'react';
4
+ export type DateRange = [Dayjs | null, Dayjs | null];
5
+ export interface TimePickerComponentProps extends FormItemProps<any> {
6
+ type?: any;
7
+ onEnter?: React.KeyboardEventHandler<HTMLInputElement>;
8
+ nextFocus?: string;
9
+ disableCurrent?: boolean;
10
+ use12Hours?: boolean;
11
+ autoComplete?: string;
12
+ disabled?: boolean;
13
+ disabledPast?: boolean;
14
+ disabledFuture?: boolean;
15
+ renderExtraFooter?: () => React.ReactElement;
16
+ }
17
+ export interface TimeRangePickerProps extends TimePickerComponentProps {
18
+ onChange?: (date: DateRange) => void;
19
+ range: true;
20
+ defaultValue?: DateRange;
21
+ value?: DateRange;
22
+ format?: string;
23
+ placeholder?: [string, string];
24
+ }
25
+ export interface TimePickerProps extends TimePickerComponentProps {
26
+ onChange?: (date: Dayjs | null) => void;
27
+ range: false;
28
+ defaultValue?: Dayjs;
29
+ value?: Dayjs;
30
+ format?: string;
31
+ placeholder?: string;
32
+ }
33
+ declare const TimePickerComponent: FC<TimeRangePickerProps | TimePickerProps>;
34
+ export default TimePickerComponent;
@@ -0,0 +1,78 @@
1
+ import { jsx as p } from "react/jsx-runtime";
2
+ import { TimePicker as a, Form as M } from "antd";
3
+ import R from "dayjs";
4
+ import { useMemo as $, useCallback as q } from "react";
5
+ import { useTranslation as v } from "react-i18next";
6
+ import { TRANSLATION_NAMESPACE as w } from "../../../locale/hooks/translation-constants.js";
7
+ const K = ({
8
+ type: C,
9
+ required: l,
10
+ label: r,
11
+ rules: T = [],
12
+ placeholder: t,
13
+ disabledPast: c = !1,
14
+ disableCurrent: i = !1,
15
+ onEnter: D,
16
+ disabled: k,
17
+ use12Hours: u,
18
+ nextFocus: H,
19
+ onChange: e,
20
+ range: s,
21
+ disabledFuture: n,
22
+ defaultValue: A,
23
+ value: N,
24
+ format: x,
25
+ autoComplete: L = "off",
26
+ renderExtraFooter: y,
27
+ ...E
28
+ }) => {
29
+ const { t: P } = v(w), f = $(
30
+ () => t || (s ? ["From", "To"] : "Select time"),
31
+ [t, s]
32
+ );
33
+ console.log(f);
34
+ const S = s ? a.RangePicker : a, d = q(
35
+ (o) => {
36
+ if (!o)
37
+ return !1;
38
+ const m = R(), j = c && o < m, F = n && o > m, I = i && o < m && m < o;
39
+ return j || F || I;
40
+ },
41
+ [i, n, c]
42
+ // Dependencies for useCallback
43
+ );
44
+ return /* @__PURE__ */ p(
45
+ M.Item,
46
+ {
47
+ ...E,
48
+ label: r,
49
+ rules: [
50
+ {
51
+ required: l,
52
+ message: `${r ?? t ?? ""} ${P(
53
+ "err.validation.required"
54
+ )}`
55
+ },
56
+ ...T
57
+ ],
58
+ children: /* @__PURE__ */ p(
59
+ S,
60
+ {
61
+ use12Hours: u,
62
+ renderExtraFooter: y,
63
+ value: N,
64
+ defaultValue: A,
65
+ format: x,
66
+ onChange: (o) => e == null ? void 0 : e(o),
67
+ disabledDate: d,
68
+ disabled: k,
69
+ className: "w-100",
70
+ placeholder: f
71
+ }
72
+ )
73
+ }
74
+ );
75
+ };
76
+ export {
77
+ K as default
78
+ };
@@ -0,0 +1,3 @@
1
+ import { default as DatePickerComponent } from './DatePicker';
2
+ import { default as TimePickerComponent } from './TimePicker';
3
+ export { DatePickerComponent, TimePickerComponent };
@@ -0,0 +1 @@
1
+ "use strict";const r=require("react/jsx-runtime"),t=({children:e,hide:s})=>r.jsx("div",{className:s?"d-none":"",children:e});module.exports=t;
@@ -0,0 +1,6 @@
1
+ import { FC } from 'react';
2
+ declare const Hider: FC<{
3
+ children: any;
4
+ hide: boolean;
5
+ }>;
6
+ export default Hider;
@@ -0,0 +1,5 @@
1
+ import { jsx as o } from "react/jsx-runtime";
2
+ const t = ({ children: e, hide: r }) => /* @__PURE__ */ o("div", { className: r ? "d-none" : "", children: e });
3
+ export {
4
+ t as default
5
+ };
File without changes
@@ -0,0 +1 @@
1
+ "use strict";const y=require("react/jsx-runtime"),f=require("antd"),g=require("../../../locale/hooks/translation-constants.cjs"),l=require("react"),A=require("react-i18next");;/* empty css */const d=require("react-router-dom"),q=({className:i,to:t,onClick:n,tooltip:o,ref:x,...r})=>{var a;const{t:e}=A.useTranslation(g.TRANSLATION_NAMESPACE);let s;try{s=(a=d.useNavigate)==null?void 0:a.call(d)}catch(u){console.error(u)}const c=l.useMemo(()=>y.jsx(f.Button,{onClick:n||(t&&s?()=>s(t):void 0),className:i,...r,children:r.children||e(`button.${r.type}`)}),[i,s,n,r,e,t]);return o?y.jsx(f.Tooltip,{title:o,children:c}):c},j=({className:i,to:t,onClick:n,tooltip:o,ref:x,...r})=>{let e;try{e=d.useNavigate()}catch(h){console.error(h)}const[s,c]=l.useState(!1),a=l.useCallback(async h=>{try{return c(!0),await n(h)}finally{c(!1)}},[n]),u=l.useMemo(()=>y.jsx(f.Button,{loading:s||r.loading,onClick:n?a:t?()=>{e?e==null||e(t):window.location.href=t}:void 0,className:i,...r}),[a,i,s,e,n,r,t]);return o?y.jsx(f.Tooltip,{title:o,children:u}):u};q.Async=j;module.exports=q;
@@ -0,0 +1,12 @@
1
+ import { ButtonProps } from 'antd';
2
+ import { default as React } from 'react';
3
+ export interface ButtonComponentProps extends ButtonProps {
4
+ to?: string | number;
5
+ tooltip?: string | undefined;
6
+ ref?: any;
7
+ }
8
+ type ComponentType = React.FC<ButtonComponentProps> & {
9
+ Async: React.FC<ButtonComponentProps>;
10
+ };
11
+ declare const _default: ComponentType;
12
+ export default _default;
@@ -0,0 +1,79 @@
1
+ import { jsx as f } from "react/jsx-runtime";
2
+ import { Button as u, Tooltip as d } from "antd";
3
+ import { TRANSLATION_NAMESPACE as g } from "../../../locale/hooks/translation-constants.js";
4
+ import { useMemo as y, useState as b, useCallback as T } from "react";
5
+ import { useTranslation as v } from "react-i18next";
6
+ /* empty css */
7
+ import { useNavigate as h } from "react-router-dom";
8
+ const w = ({
9
+ className: i,
10
+ to: r,
11
+ onClick: e,
12
+ tooltip: a,
13
+ ref: A,
14
+ ...n
15
+ }) => {
16
+ var l;
17
+ const { t } = v(g);
18
+ let o;
19
+ try {
20
+ o = (l = h) == null ? void 0 : l();
21
+ } catch (s) {
22
+ console.error(s);
23
+ }
24
+ const c = y(
25
+ () => /* @__PURE__ */ f(
26
+ u,
27
+ {
28
+ onClick: e || (r && o ? () => o(r) : void 0),
29
+ className: i,
30
+ ...n,
31
+ children: n.children || t(`button.${n.type}`)
32
+ }
33
+ ),
34
+ [i, o, e, n, t, r]
35
+ );
36
+ return a ? /* @__PURE__ */ f(d, { title: a, children: c }) : c;
37
+ }, S = ({
38
+ className: i,
39
+ to: r,
40
+ onClick: e,
41
+ tooltip: a,
42
+ ref: A,
43
+ ...n
44
+ }) => {
45
+ let t;
46
+ try {
47
+ t = h();
48
+ } catch (m) {
49
+ console.error(m);
50
+ }
51
+ const [o, c] = b(!1), l = T(
52
+ async (m) => {
53
+ try {
54
+ return c(!0), await e(m);
55
+ } finally {
56
+ c(!1);
57
+ }
58
+ },
59
+ [e]
60
+ ), s = y(
61
+ () => /* @__PURE__ */ f(
62
+ u,
63
+ {
64
+ loading: o || n.loading,
65
+ onClick: e ? l : r ? () => {
66
+ t ? t == null || t(r) : window.location.href = r;
67
+ } : void 0,
68
+ className: i,
69
+ ...n
70
+ }
71
+ ),
72
+ [l, i, o, t, e, n, r]
73
+ );
74
+ return a ? /* @__PURE__ */ f(d, { title: a, children: s }) : s;
75
+ };
76
+ w.Async = S;
77
+ export {
78
+ w as default
79
+ };
@@ -0,0 +1 @@
1
+ "use strict";const t=require("react/jsx-runtime"),s=require("@ant-design/icons"),r=require("./Button.cjs"),i=require("react-i18next"),c=require("../../../locale/hooks/translation-constants.cjs");function u({value:n,onClick:e}){const{t:o}=i.useTranslation(c.TRANSLATION_NAMESPACE);return t.jsx(r,{type:"link",onClick:()=>e(n),icon:t.jsx(s.CopyOutlined,{}),tooltip:o("clone")})}module.exports=u;
@@ -0,0 +1,6 @@
1
+ interface Props<T> {
2
+ value: T;
3
+ onClick: (value: T) => void;
4
+ }
5
+ declare function CloneButtonTable<T>({ value, onClick }: Props<T>): import("react/jsx-runtime").JSX.Element;
6
+ export default CloneButtonTable;
@@ -0,0 +1,20 @@
1
+ import { jsx as o } from "react/jsx-runtime";
2
+ import { CopyOutlined as i } from "@ant-design/icons";
3
+ import m from "./Button.js";
4
+ import { useTranslation as e } from "react-i18next";
5
+ import { TRANSLATION_NAMESPACE as p } from "../../../locale/hooks/translation-constants.js";
6
+ function s({ value: t, onClick: n }) {
7
+ const { t: r } = e(p);
8
+ return /* @__PURE__ */ o(
9
+ m,
10
+ {
11
+ type: "link",
12
+ onClick: () => n(t),
13
+ icon: /* @__PURE__ */ o(i, {}),
14
+ tooltip: r("clone")
15
+ }
16
+ );
17
+ }
18
+ export {
19
+ s as default
20
+ };
@@ -0,0 +1 @@
1
+ "use strict";const e=require("react/jsx-runtime"),q=require("@ant-design/icons"),T=require("antd"),n=require("react"),p=require("./Button.cjs"),j=require("react-i18next"),g=require("../../../locale/hooks/translation-constants.cjs");function m({shouldConfirm:C=!0,block:r,value:i,loading:a,onClick:u,text:c,disabled:l,type:f="link"}){const{t}=j.useTranslation(g.TRANSLATION_NAMESPACE),o=n.useMemo(()=>c??t("str.delete"),[c,t]),[x,s]=n.useState(!1);n.useEffect(()=>{s(a??!1)},[a]);const d=n.useCallback(async()=>{try{s(!0),await u(i)}finally{s(!1)}},[u,i]);return C?e.jsx(T.Popconfirm,{title:t("qus.doYouWantToDelete"),okText:o.toUpperCase(),cancelText:t("str.no").toUpperCase(),onConfirm:d,children:e.jsx(p,{tooltip:o,icon:e.jsx(q.DeleteOutlined,{}),disabled:l,loading:x,type:f,danger:!0,block:r})}):e.jsx(p,{tooltip:o,icon:e.jsx(q.DeleteOutlined,{}),disabled:l,loading:x,type:f,danger:!0,block:r,onClick:d})}module.exports=m;
@@ -0,0 +1,13 @@
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
+ }
12
+ declare function DeleteButtonTable<T>({ shouldConfirm, block, value, loading, onClick, text, disabled, type, }: Props<T>): import("react/jsx-runtime").JSX.Element;
13
+ export default DeleteButtonTable;
@@ -0,0 +1,68 @@
1
+ import { jsx as t } from "react/jsx-runtime";
2
+ import { DeleteOutlined as c } from "@ant-design/icons";
3
+ import { Popconfirm as T } from "antd";
4
+ import { useMemo as g, useState as x, useEffect as A, useCallback as _ } from "react";
5
+ import d from "./Button.js";
6
+ import { useTranslation as k } from "react-i18next";
7
+ import { TRANSLATION_NAMESPACE as D } from "../../../locale/hooks/translation-constants.js";
8
+ function P({
9
+ shouldConfirm: C = !0,
10
+ block: n,
11
+ value: i,
12
+ loading: a,
13
+ onClick: l,
14
+ text: s,
15
+ disabled: f,
16
+ type: m = "link"
17
+ }) {
18
+ const { t: o } = k(D), e = g(() => s ?? o("str.delete"), [s, o]), [u, r] = x(!1);
19
+ A(() => {
20
+ r(a ?? !1);
21
+ }, [a]);
22
+ const p = _(
23
+ async () => {
24
+ try {
25
+ r(!0), await l(i);
26
+ } finally {
27
+ r(!1);
28
+ }
29
+ },
30
+ [l, i]
31
+ );
32
+ return C ? /* @__PURE__ */ t(
33
+ T,
34
+ {
35
+ title: o("qus.doYouWantToDelete"),
36
+ okText: e.toUpperCase(),
37
+ cancelText: o("str.no").toUpperCase(),
38
+ onConfirm: p,
39
+ children: /* @__PURE__ */ t(
40
+ d,
41
+ {
42
+ tooltip: e,
43
+ icon: /* @__PURE__ */ t(c, {}),
44
+ disabled: f,
45
+ loading: u,
46
+ type: m,
47
+ danger: !0,
48
+ block: n
49
+ }
50
+ )
51
+ }
52
+ ) : /* @__PURE__ */ t(
53
+ d,
54
+ {
55
+ tooltip: e,
56
+ icon: /* @__PURE__ */ t(c, {}),
57
+ disabled: f,
58
+ loading: u,
59
+ type: m,
60
+ danger: !0,
61
+ block: n,
62
+ onClick: p
63
+ }
64
+ );
65
+ }
66
+ export {
67
+ P as default
68
+ };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),u=require("@ant-design/icons"),r=require("react"),a=require("react-i18next"),l=require("./Button.cjs"),x=require("../../../locale/hooks/translation-constants.cjs");function p({value:t,onClick:e}){const[s,n]=r.useState(!1),{t:i}=a.useTranslation(x.TRANSLATION_NAMESPACE),c=r.useCallback(async()=>{n(!0),e(t).finally(()=>n(!1))},[e,t]);return o.jsx(l,{loading:s,type:"link",onClick:c,icon:o.jsx(u.ExportOutlined,{}),tooltip:i("str.export")})}exports.ExportButton=p;
@@ -0,0 +1,4 @@
1
+ export declare function ExportButton<T>({ value, onClick, }: {
2
+ value: T;
3
+ onClick: (value: T) => Promise<any>;
4
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,27 @@
1
+ import { jsx as n } from "react/jsx-runtime";
2
+ import { ExportOutlined as p } from "@ant-design/icons";
3
+ import { useState as s, useCallback as l } from "react";
4
+ import { useTranslation as a } from "react-i18next";
5
+ import f from "./Button.js";
6
+ import { TRANSLATION_NAMESPACE as c } from "../../../locale/hooks/translation-constants.js";
7
+ function y({
8
+ value: t,
9
+ onClick: o
10
+ }) {
11
+ const [i, r] = s(!1), { t: e } = a(c), m = l(async () => {
12
+ r(!0), o(t).finally(() => r(!1));
13
+ }, [o, t]);
14
+ return /* @__PURE__ */ n(
15
+ f,
16
+ {
17
+ loading: i,
18
+ type: "link",
19
+ onClick: m,
20
+ icon: /* @__PURE__ */ n(p, {}),
21
+ tooltip: e("str.export")
22
+ }
23
+ );
24
+ }
25
+ export {
26
+ y as ExportButton
27
+ };
@@ -0,0 +1 @@
1
+ "use strict";const t=require("react/jsx-runtime"),C=require("@ant-design/icons"),T=require("antd"),n=require("react"),j=require("react-i18next"),g=require("../../../locale/hooks/translation-constants.cjs"),q=require("./Button.cjs");function m({shouldConfirm:p=!0,block:s,value:i,loading:c,onClick:a,text:u,disabled:l,type:d="link"}){const{t:e}=j.useTranslation(g.TRANSLATION_NAMESPACE),o=n.useMemo(()=>u??e("str.hide"),[u,e]),[f,r]=n.useState(!1);n.useEffect(()=>{r(c??!1)},[c]);const x=n.useCallback(async()=>{try{r(!0),await a(i)}finally{r(!1)}},[a,i]);return p?t.jsx(T.Popconfirm,{title:e("qus.doYouWantToHide"),okText:o.toUpperCase(),cancelText:e("str.no").toUpperCase(),onConfirm:x,children:t.jsx(q,{tooltip:o,icon:t.jsx(C.DownCircleOutlined,{}),disabled:l,loading:f,type:d,danger:!0,block:s})}):t.jsx(q,{tooltip:o,icon:t.jsx(C.DownCircleOutlined,{}),disabled:l,loading:f,type:d,danger:!0,block:s,onClick:x})}module.exports=m;
@@ -0,0 +1,13 @@
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
+ }
12
+ declare function HideButtonTable<T>({ shouldConfirm, block, value, loading, onClick, text, disabled, type, }: Props<T>): import("react/jsx-runtime").JSX.Element;
13
+ export default HideButtonTable;
@@ -0,0 +1,68 @@
1
+ import { jsx as o } from "react/jsx-runtime";
2
+ import { DownCircleOutlined as p } from "@ant-design/icons";
3
+ import { Popconfirm as T } from "antd";
4
+ import { useMemo as g, useState as x, useEffect as A, useCallback as _ } from "react";
5
+ import { useTranslation as k } from "react-i18next";
6
+ import { TRANSLATION_NAMESPACE as E } from "../../../locale/hooks/translation-constants.js";
7
+ import d from "./Button.js";
8
+ function M({
9
+ shouldConfirm: C = !0,
10
+ block: n,
11
+ value: i,
12
+ loading: a,
13
+ onClick: s,
14
+ text: l,
15
+ disabled: f,
16
+ type: m = "link"
17
+ }) {
18
+ const { t } = k(E), r = g(() => l ?? t("str.hide"), [l, t]), [u, e] = x(!1);
19
+ A(() => {
20
+ e(a ?? !1);
21
+ }, [a]);
22
+ const c = _(
23
+ async () => {
24
+ try {
25
+ e(!0), await s(i);
26
+ } finally {
27
+ e(!1);
28
+ }
29
+ },
30
+ [s, i]
31
+ );
32
+ return C ? /* @__PURE__ */ o(
33
+ T,
34
+ {
35
+ title: t("qus.doYouWantToHide"),
36
+ okText: r.toUpperCase(),
37
+ cancelText: t("str.no").toUpperCase(),
38
+ onConfirm: c,
39
+ children: /* @__PURE__ */ o(
40
+ d,
41
+ {
42
+ tooltip: r,
43
+ icon: /* @__PURE__ */ o(p, {}),
44
+ disabled: f,
45
+ loading: u,
46
+ type: m,
47
+ danger: !0,
48
+ block: n
49
+ }
50
+ )
51
+ }
52
+ ) : /* @__PURE__ */ o(
53
+ d,
54
+ {
55
+ tooltip: r,
56
+ icon: /* @__PURE__ */ o(p, {}),
57
+ disabled: f,
58
+ loading: u,
59
+ type: m,
60
+ danger: !0,
61
+ block: n,
62
+ onClick: c
63
+ }
64
+ );
65
+ }
66
+ export {
67
+ M as default
68
+ };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),k=require("@ant-design/icons"),n=require("react"),q=require("react-i18next"),x=require("../../../locale/hooks/translation-constants.cjs"),C=require("./Button.cjs");function S({onClick:o,children:c,accept:u,className:a,disabled:l,type:f="link"}){const[d,i]=n.useState(!1),{t:p}=q.useTranslation(x.TRANSLATION_NAMESPACE),e=n.useRef(null),y=n.useCallback(()=>{m(t=>t+1),e.current&&setTimeout(()=>{var t;(t=e==null?void 0:e.current)==null||t.click()},10)},[]),[g,m]=n.useState(0),j=n.useCallback(async t=>{i(!0);const r=t.target.files[0];r&&await o(r),i(!1)},[o]);return s.jsxs("div",{className:a,children:[s.jsx("input",{type:"file",style:{display:"none"},ref:e,onChange:j,accept:u},g),s.jsx(C,{loading:d,type:f,disabled:l,onClick:y,icon:s.jsx(k.ImportOutlined,{}),tooltip:p("str.import"),children:c})]})}exports.ImportButton=S;
@@ -0,0 +1,9 @@
1
+ import { BaseButtonProps } from 'antd/es/button/button';
2
+ import { PropsWithChildren } from 'react';
3
+ export declare function ImportButton({ onClick, children, accept, className, disabled, type, }: PropsWithChildren<{
4
+ className?: string;
5
+ accept?: string;
6
+ disabled?: boolean;
7
+ onClick: (file: File) => Promise<any>;
8
+ type?: BaseButtonProps["type"];
9
+ }>): import("react/jsx-runtime").JSX.Element;