@kingteza/crud-component 1.0.13 → 1.0.15

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 (119) hide show
  1. package/dist/components/common/DatePicker/DatePicker.cjs +1 -0
  2. package/dist/components/common/DatePicker/DatePicker.js +88 -0
  3. package/dist/components/common/DatePicker/TimePicker.cjs +1 -0
  4. package/dist/components/common/DatePicker/TimePicker.js +78 -0
  5. package/dist/components/common/appearance/Hider.cjs +1 -0
  6. package/dist/components/common/appearance/Hider.js +5 -0
  7. package/dist/components/common/button/Button.cjs +1 -0
  8. package/dist/components/common/button/Button.js +64 -0
  9. package/dist/components/common/button/CloneButtonTable.cjs +1 -0
  10. package/dist/components/common/button/CloneButtonTable.js +20 -0
  11. package/dist/components/common/button/DeleteButtonTable.cjs +1 -0
  12. package/dist/components/common/button/DeleteButtonTable.js +68 -0
  13. package/dist/components/common/button/ExportButton.cjs +1 -0
  14. package/dist/components/common/button/ExportButton.js +27 -0
  15. package/dist/components/common/button/HideButtonTable.cjs +1 -0
  16. package/dist/components/common/button/HideButtonTable.js +68 -0
  17. package/dist/components/common/button/ImportButton.cjs +1 -0
  18. package/dist/components/common/button/ImportButton.js +56 -0
  19. package/dist/components/common/button/NewButton.cjs +1 -0
  20. package/dist/components/common/button/NewButton.js +24 -0
  21. package/dist/components/common/button/PrintButton.cjs +1 -0
  22. package/dist/components/common/button/PrintButton.js +26 -0
  23. package/dist/components/common/button/RefreshButton.cjs +1 -0
  24. package/dist/components/common/button/RefreshButton.js +24 -0
  25. package/dist/components/common/button/UnHideButton.cjs +1 -0
  26. package/dist/components/common/button/UnHideButton.js +70 -0
  27. package/dist/components/common/button/UpdateButtonTable.cjs +1 -0
  28. package/dist/components/common/button/UpdateButtonTable.js +20 -0
  29. package/dist/components/common/button/ViewButtonTable.cjs +1 -0
  30. package/dist/components/common/button/ViewButtonTable.js +20 -0
  31. package/dist/components/common/check-box/CheckBox.cjs +1 -0
  32. package/dist/components/common/check-box/CheckBox.js +40 -0
  33. package/dist/components/common/description/DescList.cjs +1 -0
  34. package/dist/components/common/description/DescList.js +16 -0
  35. package/dist/components/common/layout/VerticalSpace.cjs +1 -0
  36. package/dist/components/common/layout/VerticalSpace.js +6 -0
  37. package/dist/components/common/loading/LoadingIndicator.cjs +1 -0
  38. package/dist/components/common/loading/LoadingIndicator.js +24 -0
  39. package/dist/components/common/picker/ImagePicker.cjs +1 -0
  40. package/dist/components/common/picker/ImagePicker.js +282 -0
  41. package/dist/components/common/radio/RadioGroupComponent.cjs +1 -0
  42. package/dist/components/common/radio/RadioGroupComponent.js +19 -0
  43. package/dist/components/common/report/SelectFieldInReport.cjs +1 -0
  44. package/dist/components/common/report/SelectFieldInReport.js +30 -0
  45. package/dist/components/common/select/CustomSelectOption.cjs +1 -0
  46. package/dist/components/common/select/CustomSelectOption.js +13 -0
  47. package/dist/components/common/select/SelectComponent.cjs +1 -0
  48. package/dist/components/common/select/SelectComponent.js +89 -0
  49. package/dist/components/common/show-more/index.cjs +1 -0
  50. package/dist/components/common/show-more/index.js +8 -0
  51. package/dist/components/common/tab/TabViewWithRoute.cjs +1 -0
  52. package/dist/components/common/tab/TabViewWithRoute.js +38 -0
  53. package/dist/components/common/table/table.cjs +1 -0
  54. package/dist/components/common/table/table.js +40 -0
  55. package/dist/components/common/tag/StatusTag.cjs +1 -0
  56. package/dist/components/common/tag/StatusTag.js +30 -0
  57. package/dist/components/common/text/index.cjs +1 -0
  58. package/dist/components/common/text/index.js +5 -0
  59. package/dist/components/common/text/title/index.cjs +1 -0
  60. package/dist/components/common/text/title/index.js +5 -0
  61. package/dist/components/common/text-field/NumberField.cjs +1 -0
  62. package/dist/components/common/text-field/NumberField.js +83 -0
  63. package/dist/components/common/text-field/PhoneNumberField.cjs +1 -0
  64. package/dist/components/common/text-field/PhoneNumberField.js +18 -0
  65. package/dist/components/common/text-field/TextArea.cjs +1 -0
  66. package/dist/components/common/text-field/TextArea.js +47 -0
  67. package/dist/components/common/text-field/TextField.cjs +1 -0
  68. package/dist/components/common/text-field/TextField.js +73 -0
  69. package/dist/components/common/tooltip/TooltipComponent.cjs +1 -0
  70. package/dist/components/common/tooltip/TooltipComponent.js +9 -0
  71. package/dist/components/common/wizard/WizardResult.cjs +1 -0
  72. package/dist/components/common/wizard/WizardResult.js +60 -0
  73. package/dist/components/common/wizard/WizardViewForm.cjs +1 -0
  74. package/dist/components/common/wizard/WizardViewForm.js +74 -0
  75. package/dist/components/crud/CrudComponent.cjs +1 -0
  76. package/dist/components/crud/CrudComponent.js +210 -0
  77. package/dist/components/crud/CrudField.cjs +1 -0
  78. package/dist/components/crud/CrudField.js +459 -0
  79. package/dist/components/crud/CrudForm.cjs +1 -0
  80. package/dist/components/crud/CrudForm.js +91 -0
  81. package/dist/components/crud/CrudFormWizard.cjs +1 -0
  82. package/dist/components/crud/CrudFormWizard.js +140 -0
  83. package/dist/components/crud/CrudReportComponent.cjs +4 -0
  84. package/dist/components/crud/CrudReportComponent.js +255 -0
  85. package/dist/components/crud/CrudSearchComponent.cjs +1 -0
  86. package/dist/components/crud/CrudSearchComponent.js +95 -0
  87. package/dist/components/crud/FileCrudField.cjs +1 -0
  88. package/dist/components/crud/FileCrudField.js +220 -0
  89. package/dist/components/crud/ImageCrudField.cjs +1 -0
  90. package/dist/components/crud/ImageCrudField.js +113 -0
  91. package/dist/components/crud/import/CrudImportButton.cjs +1 -0
  92. package/dist/components/crud/import/CrudImportButton.js +31 -0
  93. package/dist/components/crud/import/CrudImportComponent.cjs +2 -0
  94. package/dist/components/crud/import/CrudImportComponent.js +221 -0
  95. package/dist/components/crud/view/CrudDecListView.cjs +1 -0
  96. package/dist/components/crud/view/CrudDecListView.js +42 -0
  97. package/dist/components/crud/view/CrudViewer.cjs +1 -0
  98. package/dist/components/crud/view/CrudViewer.js +217 -0
  99. package/dist/components/crud/view/CrudViewerUtil.cjs +1 -0
  100. package/dist/components/crud/view/CrudViewerUtil.js +57 -0
  101. package/dist/index.cjs +1 -1
  102. package/dist/index.js +10 -10
  103. package/dist/locale/hooks/translation-constants.cjs +1 -0
  104. package/dist/locale/hooks/translation-constants.js +4 -0
  105. package/dist/locale/index.cjs +1 -0
  106. package/dist/locale/index.js +33 -0
  107. package/dist/locale/translations/en.cjs +1 -0
  108. package/dist/locale/translations/en.js +60 -0
  109. package/dist/util/DateUtil.cjs +1 -0
  110. package/dist/util/DateUtil.js +6 -0
  111. package/dist/util/ImageUtil.cjs +1 -0
  112. package/dist/util/ImageUtil.js +63 -0
  113. package/dist/util/NumberUtil.cjs +1 -0
  114. package/dist/util/NumberUtil.js +60 -0
  115. package/dist/util/ValidationUtil.cjs +1 -0
  116. package/dist/util/ValidationUtil.js +60 -0
  117. package/dist/util/index.cjs +1 -1
  118. package/dist/util/index.js +4 -4
  119. package/package.json +1 -1
@@ -0,0 +1 @@
1
+ "use strict";const d=require("react/jsx-runtime"),s=require("antd"),t=require("dayjs"),E=require("../../../_virtual/advancedFormat.cjs"),F=require("../../../_virtual/customParseFormat.cjs"),I=require("../../../_virtual/localeData.cjs"),v=require("../../../_virtual/weekday.cjs"),S=require("../../../_virtual/weekOfYear.cjs"),T=require("../../../_virtual/weekYear.cjs"),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,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 "../../../_virtual/advancedFormat.js";
5
+ import R from "../../../_virtual/customParseFormat.js";
6
+ import S from "../../../_virtual/localeData.js";
7
+ import T from "../../../_virtual/weekday.js";
8
+ import Y from "../../../_virtual/weekOfYear.js";
9
+ import $ from "../../../_virtual/weekYear.js";
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,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 @@
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,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
+ };
@@ -0,0 +1 @@
1
+ "use strict";const d=require("react/jsx-runtime"),g=require("antd"),y=require("../../../locale/hooks/translation-constants.cjs"),l=require("react"),f=require("react-i18next"),c=require("react-router-dom");;/* empty css */const x=({className:s,to:e,onClick:t,tooltip:a,ref:q,...n})=>{var u;const{t:o}=f.useTranslation(y.TRANSLATION_NAMESPACE),i=l.useContext(c.UNSAFE_NavigationContext)?(u=c.useNavigate)==null?void 0:u.call(c):void 0,r=l.useMemo(()=>d.jsx(g.Button,{onClick:t||(e&&i?()=>i(e):void 0),className:s,...n,children:n.children||o(`button.${n.type}`)}),[s,i,t,n,o,e]);return a?d.jsx(g.Tooltip,{title:a,children:r}):r},j=({className:s,to:e,onClick:t,tooltip:a,ref:q,...n})=>{const o=c.useNavigate(),[v,i]=l.useState(!1),r=l.useCallback(async A=>{try{return i(!0),await t(A)}finally{i(!1)}},[t]),u=l.useMemo(()=>d.jsx(g.Button,{loading:v||n.loading,onClick:t?r:e?()=>o(e):void 0,className:s,...n}),[r,s,v,o,t,n,e]);return a?d.jsx(g.Tooltip,{title:a,children:u}):u};x.Async=j;module.exports=x;
@@ -0,0 +1,64 @@
1
+ import { jsx as u } from "react/jsx-runtime";
2
+ import { Button as d, Tooltip as f } from "antd";
3
+ import { TRANSLATION_NAMESPACE as y } from "../../../locale/hooks/translation-constants.js";
4
+ import { useContext as b, useMemo as l, useState as h, useCallback as x } from "react";
5
+ import { useTranslation as N } from "react-i18next";
6
+ import { UNSAFE_NavigationContext as S, useNavigate as g } from "react-router-dom";
7
+ /* empty css */
8
+ const T = ({
9
+ className: i,
10
+ to: e,
11
+ onClick: t,
12
+ tooltip: a,
13
+ ref: v,
14
+ ...n
15
+ }) => {
16
+ var c;
17
+ const { t: r } = N(y), o = b(S) ? (c = g) == null ? void 0 : c() : void 0, s = l(
18
+ () => /* @__PURE__ */ u(
19
+ d,
20
+ {
21
+ onClick: t || (e && o ? () => o(e) : void 0),
22
+ className: i,
23
+ ...n,
24
+ children: n.children || r(`button.${n.type}`)
25
+ }
26
+ ),
27
+ [i, o, t, n, r, e]
28
+ );
29
+ return a ? /* @__PURE__ */ u(f, { title: a, children: s }) : s;
30
+ }, C = ({
31
+ className: i,
32
+ to: e,
33
+ onClick: t,
34
+ tooltip: a,
35
+ ref: v,
36
+ ...n
37
+ }) => {
38
+ const r = g(), [m, o] = h(!1), s = x(
39
+ async (A) => {
40
+ try {
41
+ return o(!0), await t(A);
42
+ } finally {
43
+ o(!1);
44
+ }
45
+ },
46
+ [t]
47
+ ), c = l(
48
+ () => /* @__PURE__ */ u(
49
+ d,
50
+ {
51
+ loading: m || n.loading,
52
+ onClick: t ? s : e ? () => r(e) : void 0,
53
+ className: i,
54
+ ...n
55
+ }
56
+ ),
57
+ [s, i, m, r, t, n, e]
58
+ );
59
+ return a ? /* @__PURE__ */ u(f, { title: a, children: c }) : c;
60
+ };
61
+ T.Async = C;
62
+ export {
63
+ T as default
64
+ };
@@ -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,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,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,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,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,56 @@
1
+ import { jsxs as A, jsx as n } from "react/jsx-runtime";
2
+ import { ImportOutlined as T } from "@ant-design/icons";
3
+ import { useState as s, useRef as h, useCallback as l } from "react";
4
+ import { useTranslation as x } from "react-i18next";
5
+ import { TRANSLATION_NAMESPACE as N } from "../../../locale/hooks/translation-constants.js";
6
+ import S from "./Button.js";
7
+ function _({
8
+ onClick: e,
9
+ children: c,
10
+ accept: m,
11
+ className: a,
12
+ disabled: f,
13
+ type: p = "link"
14
+ }) {
15
+ const [u, i] = s(!1), { t: d } = x(N), o = h(null), y = l(() => {
16
+ k((t) => t + 1), o.current && setTimeout(() => {
17
+ var t;
18
+ (t = o == null ? void 0 : o.current) == null || t.click();
19
+ }, 10);
20
+ }, []), [g, k] = s(0), C = l(
21
+ async (t) => {
22
+ i(!0);
23
+ const r = t.target.files[0];
24
+ r && await e(r), i(!1);
25
+ },
26
+ [e]
27
+ );
28
+ return /* @__PURE__ */ A("div", { className: a, children: [
29
+ /* @__PURE__ */ n(
30
+ "input",
31
+ {
32
+ type: "file",
33
+ style: { display: "none" },
34
+ ref: o,
35
+ onChange: C,
36
+ accept: m
37
+ },
38
+ g
39
+ ),
40
+ /* @__PURE__ */ n(
41
+ S,
42
+ {
43
+ loading: u,
44
+ type: p,
45
+ disabled: f,
46
+ onClick: y,
47
+ icon: /* @__PURE__ */ n(T, {}),
48
+ tooltip: d("str.import"),
49
+ children: c
50
+ }
51
+ )
52
+ ] });
53
+ }
54
+ export {
55
+ _ as ImportButton
56
+ };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),a=require("@ant-design/icons"),l=require("react-i18next"),q=require("./Button.cjs"),N=require("../../../locale/hooks/translation-constants.cjs"),d=({size:n,block:r,className:s,type:o="primary",onClick:t,title:u,to:i})=>{const{t:c}=l.useTranslation(N.TRANSLATION_NAMESPACE);return e.jsx(q,{type:o,className:s,to:i,block:r,size:n,onClick:t&&(()=>t(!0)),icon:e.jsx(a.PlusOutlined,{}),children:u??c("str.new")})};exports.NewButton=d;
@@ -0,0 +1,24 @@
1
+ import { jsx as r } from "react/jsx-runtime";
2
+ import { PlusOutlined as u } from "@ant-design/icons";
3
+ import { useTranslation as f } from "react-i18next";
4
+ import c from "./Button.js";
5
+ import { TRANSLATION_NAMESPACE as l } from "../../../locale/hooks/translation-constants.js";
6
+ const w = ({ size: t, block: n, className: m, type: i = "primary", onClick: o, title: e, to: p }) => {
7
+ const { t: s } = f(l);
8
+ return /* @__PURE__ */ r(
9
+ c,
10
+ {
11
+ type: i,
12
+ className: m,
13
+ to: p,
14
+ block: n,
15
+ size: t,
16
+ onClick: o && (() => o(!0)),
17
+ icon: /* @__PURE__ */ r(u, {}),
18
+ children: e ?? s("str.new")
19
+ }
20
+ );
21
+ };
22
+ export {
23
+ w as NewButton
24
+ };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),p=require("@ant-design/icons"),q=require("react-i18next"),P=require("./Button.cjs"),d=require("../../../locale/hooks/translation-constants.cjs"),j=({disabled:e,loading:i,block:o,className:s,type:u="primary",onClick:c,title:a,to:l})=>{const{t:n}=q.useTranslation(d.TRANSLATION_NAMESPACE),t=a??n("str.print");return r.jsx(P,{type:u,className:s,to:l,loading:i,disabled:e,block:o,onClick:c,tooltip:t!=null&&t.trim()?"":n("str.print"),icon:r.jsx(p.PrinterOutlined,{}),children:t})};exports.PrintButton=j;
@@ -0,0 +1,26 @@
1
+ import { jsx as o } from "react/jsx-runtime";
2
+ import { PrinterOutlined as u } from "@ant-design/icons";
3
+ import { useTranslation as A } from "react-i18next";
4
+ import a from "./Button.js";
5
+ import { TRANSLATION_NAMESPACE as l } from "../../../locale/hooks/translation-constants.js";
6
+ const B = ({ disabled: n, loading: i, block: m, className: p, type: s = "primary", onClick: e, title: c, to: f }) => {
7
+ const { t } = A(l), r = c ?? t("str.print");
8
+ return /* @__PURE__ */ o(
9
+ a,
10
+ {
11
+ type: s,
12
+ className: p,
13
+ to: f,
14
+ loading: i,
15
+ disabled: n,
16
+ block: m,
17
+ onClick: e,
18
+ tooltip: r != null && r.trim() ? "" : t("str.print"),
19
+ icon: /* @__PURE__ */ o(u, {}),
20
+ children: r
21
+ }
22
+ );
23
+ };
24
+ export {
25
+ B as PrintButton
26
+ };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),a=require("@ant-design/icons"),l=require("react-i18next"),d=require("../../../locale/hooks/translation-constants.cjs"),q=require("./Button.cjs"),R=({disabled:r,block:n,className:s,type:o="primary",onClick:e,title:i,to:u})=>{const{t:c}=l.useTranslation(d.TRANSLATION_NAMESPACE);return t.jsx(q,{type:o,disabled:r,className:s,to:u,block:n,onClick:e&&(()=>e(!0)),icon:t.jsx(a.ReloadOutlined,{}),children:i??c("str.refresh")})};exports.RefreshButton=R;
@@ -0,0 +1,24 @@
1
+ import { jsx as o } from "react/jsx-runtime";
2
+ import { ReloadOutlined as f } from "@ant-design/icons";
3
+ import { useTranslation as u } from "react-i18next";
4
+ import { TRANSLATION_NAMESPACE as a } from "../../../locale/hooks/translation-constants.js";
5
+ import c from "./Button.js";
6
+ const R = ({ disabled: t, block: e, className: m, type: n = "primary", onClick: r, title: i, to: p }) => {
7
+ const { t: s } = u(a);
8
+ return /* @__PURE__ */ o(
9
+ c,
10
+ {
11
+ type: n,
12
+ disabled: t,
13
+ className: m,
14
+ to: p,
15
+ block: e,
16
+ onClick: r && (() => r(!0)),
17
+ icon: /* @__PURE__ */ o(f, {}),
18
+ children: i ?? s("str.refresh")
19
+ }
20
+ );
21
+ };
22
+ export {
23
+ R as RefreshButton
24
+ };
@@ -0,0 +1 @@
1
+ "use strict";const t=require("react/jsx-runtime"),p=require("@ant-design/icons"),T=require("antd"),n=require("react"),g=require("react-i18next"),C=require("./Button.cjs"),U=require("../../../locale/hooks/translation-constants.cjs");function m({shouldConfirm:q=!0,block:s,value:i,loading:c,onClick:u,text:a,disabled:l,type:d="link",hidden:j}){const{t:e}=g.useTranslation(U.TRANSLATION_NAMESPACE),o=n.useMemo(()=>a??e("str.unhide"),[a,e]),[f,r]=n.useState(!1);n.useEffect(()=>{r(c??!1)},[c]);const x=n.useCallback(async()=>{try{r(!0),await u(i)}finally{r(!1)}},[u,i]);return q?t.jsx(T.Popconfirm,{title:e("qus.doYouWantToHide"),okText:o.toUpperCase(),cancelText:e("str.no").toUpperCase(),onConfirm:x,children:t.jsx(C,{tooltip:o,icon:t.jsx(p.UpCircleOutlined,{}),disabled:l,loading:f,type:d,danger:!0,hidden:j,block:s})}):t.jsx(C,{tooltip:o,icon:t.jsx(p.UpCircleOutlined,{}),disabled:l,loading:f,type:d,danger:!0,block:s,onClick:x})}module.exports=m;