@kingteza/crud-component 1.0.12 → 1.0.14
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.
- package/dist/components/common/DatePicker/DatePicker.cjs +1 -0
- package/dist/components/common/DatePicker/DatePicker.js +88 -0
- package/dist/components/common/DatePicker/TimePicker.cjs +1 -0
- package/dist/components/common/DatePicker/TimePicker.js +78 -0
- package/dist/components/common/appearance/Hider.cjs +1 -0
- package/dist/components/common/appearance/Hider.js +5 -0
- package/dist/components/common/button/Button.cjs +1 -0
- package/dist/components/common/button/Button.js +64 -0
- package/dist/components/common/button/CloneButtonTable.cjs +1 -0
- package/dist/components/common/button/CloneButtonTable.js +20 -0
- package/dist/components/common/button/DeleteButtonTable.cjs +1 -0
- package/dist/components/common/button/DeleteButtonTable.js +68 -0
- package/dist/components/common/button/ExportButton.cjs +1 -0
- package/dist/components/common/button/ExportButton.js +27 -0
- package/dist/components/common/button/HideButtonTable.cjs +1 -0
- package/dist/components/common/button/HideButtonTable.js +68 -0
- package/dist/components/common/button/ImportButton.cjs +1 -0
- package/dist/components/common/button/ImportButton.js +56 -0
- package/dist/components/common/button/NewButton.cjs +1 -0
- package/dist/components/common/button/NewButton.js +24 -0
- package/dist/components/common/button/PrintButton.cjs +1 -0
- package/dist/components/common/button/PrintButton.js +26 -0
- package/dist/components/common/button/RefreshButton.cjs +1 -0
- package/dist/components/common/button/RefreshButton.js +24 -0
- package/dist/components/common/button/UnHideButton.cjs +1 -0
- package/dist/components/common/button/UnHideButton.js +70 -0
- package/dist/components/common/button/UpdateButtonTable.cjs +1 -0
- package/dist/components/common/button/UpdateButtonTable.js +20 -0
- package/dist/components/common/button/ViewButtonTable.cjs +1 -0
- package/dist/components/common/button/ViewButtonTable.js +20 -0
- package/dist/components/common/check-box/CheckBox.cjs +1 -0
- package/dist/components/common/check-box/CheckBox.js +40 -0
- package/dist/components/common/description/DescList.cjs +1 -0
- package/dist/components/common/description/DescList.js +16 -0
- package/dist/components/common/layout/VerticalSpace.cjs +1 -0
- package/dist/components/common/layout/VerticalSpace.js +6 -0
- package/dist/components/common/loading/LoadingIndicator.cjs +1 -0
- package/dist/components/common/loading/LoadingIndicator.js +24 -0
- package/dist/components/common/picker/ImagePicker.cjs +1 -0
- package/dist/components/common/picker/ImagePicker.js +285 -0
- package/dist/components/common/radio/RadioGroupComponent.cjs +1 -0
- package/dist/components/common/radio/RadioGroupComponent.js +19 -0
- package/dist/components/common/report/SelectFieldInReport.cjs +1 -0
- package/dist/components/common/report/SelectFieldInReport.js +30 -0
- package/dist/components/common/select/CustomSelectOption.cjs +1 -0
- package/dist/components/common/select/CustomSelectOption.js +13 -0
- package/dist/components/common/select/SelectComponent.cjs +1 -0
- package/dist/components/common/select/SelectComponent.js +89 -0
- package/dist/components/common/show-more/index.cjs +1 -0
- package/dist/components/common/show-more/index.js +8 -0
- package/dist/components/common/tab/TabViewWithRoute.cjs +1 -0
- package/dist/components/common/tab/TabViewWithRoute.js +37 -0
- package/dist/components/common/table/table.cjs +1 -0
- package/dist/components/common/table/table.js +40 -0
- package/dist/components/common/tag/StatusTag.cjs +1 -0
- package/dist/components/common/tag/StatusTag.js +30 -0
- package/dist/components/common/text/index.cjs +1 -0
- package/dist/components/common/text/index.js +5 -0
- package/dist/components/common/text/title/index.cjs +1 -0
- package/dist/components/common/text/title/index.js +5 -0
- package/dist/components/common/text-field/NumberField.cjs +1 -0
- package/dist/components/common/text-field/NumberField.js +83 -0
- package/dist/components/common/text-field/PhoneNumberField.cjs +1 -0
- package/dist/components/common/text-field/PhoneNumberField.js +18 -0
- package/dist/components/common/text-field/TextArea.cjs +1 -0
- package/dist/components/common/text-field/TextArea.js +47 -0
- package/dist/components/common/text-field/TextField.cjs +1 -0
- package/dist/components/common/text-field/TextField.js +73 -0
- package/dist/components/common/tooltip/TooltipComponent.cjs +1 -0
- package/dist/components/common/tooltip/TooltipComponent.js +9 -0
- package/dist/components/common/wizard/WizardResult.cjs +1 -0
- package/dist/components/common/wizard/WizardResult.js +61 -0
- package/dist/components/common/wizard/WizardViewForm.cjs +1 -0
- package/dist/components/common/wizard/WizardViewForm.js +74 -0
- package/dist/components/crud/CrudComponent.cjs +1 -0
- package/dist/components/crud/CrudComponent.js +210 -0
- package/dist/components/crud/CrudField.cjs +1 -0
- package/dist/components/crud/CrudField.js +459 -0
- package/dist/components/crud/CrudForm.cjs +1 -0
- package/dist/components/crud/CrudForm.js +91 -0
- package/dist/components/crud/CrudFormWizard.cjs +1 -0
- package/dist/components/crud/CrudFormWizard.js +142 -0
- package/dist/components/crud/CrudReportComponent.cjs +4 -0
- package/dist/components/crud/CrudReportComponent.js +255 -0
- package/dist/components/crud/CrudSearchComponent.cjs +1 -0
- package/dist/components/crud/CrudSearchComponent.js +95 -0
- package/dist/components/crud/FileCrudField.cjs +1 -0
- package/dist/components/crud/FileCrudField.js +227 -0
- package/dist/components/crud/ImageCrudField.cjs +1 -0
- package/dist/components/crud/ImageCrudField.js +113 -0
- package/dist/components/crud/import/CrudImportButton.cjs +1 -0
- package/dist/components/crud/import/CrudImportButton.js +31 -0
- package/dist/components/crud/import/CrudImportComponent.cjs +2 -0
- package/dist/components/crud/import/CrudImportComponent.js +222 -0
- package/dist/components/crud/view/CrudDecListView.cjs +1 -0
- package/dist/components/crud/view/CrudDecListView.js +42 -0
- package/dist/components/crud/view/CrudViewer.cjs +1 -0
- package/dist/components/crud/view/CrudViewer.js +217 -0
- package/dist/components/crud/view/CrudViewerUtil.cjs +1 -0
- package/dist/components/crud/view/CrudViewerUtil.js +58 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +10 -10
- package/dist/locale/hooks/translation-constants.cjs +1 -0
- package/dist/locale/hooks/translation-constants.js +4 -0
- package/dist/locale/index.cjs +1 -0
- package/dist/locale/index.js +33 -0
- package/dist/locale/translations/en.cjs +1 -0
- package/dist/locale/translations/en.js +60 -0
- package/dist/util/DateUtil.cjs +1 -0
- package/dist/util/DateUtil.js +6 -0
- package/dist/util/ImageUtil.cjs +1 -0
- package/dist/util/ImageUtil.js +63 -0
- package/dist/util/NumberUtil.cjs +1 -0
- package/dist/util/NumberUtil.js +60 -0
- package/dist/util/ValidationUtil.cjs +1 -0
- package/dist/util/ValidationUtil.js +60 -0
- package/dist/util/index.cjs +1 -1
- package/dist/util/index.js +4 -4
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const d=require("../../../_virtual/jsx-runtime.cjs"),r=require("antd"),t=require("../../../_virtual/dayjs.min.cjs"),C=require("../../../_virtual/advancedFormat.cjs"),F=require("../../../_virtual/customParseFormat.cjs"),T=require("../../../_virtual/localeData.cjs"),v=require("../../../_virtual/weekday.cjs"),I=require("../../../_virtual/weekOfYear.cjs"),S=require("../../../_virtual/weekYear.cjs"),Y=require("../../../locale/hooks/translation-constants.cjs"),_=require("react"),$=require("../../../node_modules/react-i18next/dist/es/useTranslation.cjs");t.extend(F);t.extend(C);t.extend(v);t.extend(T);t.extend(I);t.extend(S);const L=({type:M,required:x,label:o,rules:m=[],placeholder:a,disabledPastDays:c=!1,disableToday:i=!1,onEnter:z,disabled:q,nextFocus:B,onChange:s,range:f,showTime:l,disabledFutureDays:u,picker:k,defaultValue:j,value:p,format:O,autoComplete:G="off",enabledDates:H=[],renderExtraFooter:R,...y})=>{const{t:E}=$.useTranslation(Y.TRANSLATION_NAMESPACE),P=f?r.DatePicker.RangePicker:r.DatePicker,w=_.useCallback(e=>{if(!e)return!1;const n=t(),A=c&&e<n.startOf("day"),D=u&&e>n.endOf("day"),N=i&&e<n.endOf("day")&&n.startOf("day")<e;return A||D||N},[c,u,i]);return d.jsxRuntimeExports.jsx(r.Form.Item,{...y,label:o,rules:[{required:x,message:`${o??a??""} ${E("err.validation.required")}`},...m],children:d.jsxRuntimeExports.jsx(P,{renderExtraFooter:R,value:p,picker:k,defaultValue:j,format:O,onChange:e=>s==null?void 0:s(e),disabledDate:w,disabled:q,className:"w-100",placeholder:a,showTime:l})})};module.exports=L;
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { j as i } from "../../../_virtual/jsx-runtime.js";
|
|
2
|
+
import { DatePicker as d, Form as v } from "antd";
|
|
3
|
+
import e from "../../../_virtual/dayjs.min.js";
|
|
4
|
+
import C from "../../../_virtual/advancedFormat.js";
|
|
5
|
+
import I 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 "../../../node_modules/react-i18next/dist/es/useTranslation.js";
|
|
13
|
+
e.extend(I);
|
|
14
|
+
e.extend(C);
|
|
15
|
+
e.extend(T);
|
|
16
|
+
e.extend(S);
|
|
17
|
+
e.extend(Y);
|
|
18
|
+
e.extend($);
|
|
19
|
+
const et = ({
|
|
20
|
+
type: _,
|
|
21
|
+
required: p,
|
|
22
|
+
label: m,
|
|
23
|
+
rules: c = [],
|
|
24
|
+
placeholder: a,
|
|
25
|
+
disabledPastDays: n = !1,
|
|
26
|
+
disableToday: s = !1,
|
|
27
|
+
onEnter: z,
|
|
28
|
+
disabled: x,
|
|
29
|
+
nextFocus: B,
|
|
30
|
+
onChange: r,
|
|
31
|
+
range: l,
|
|
32
|
+
showTime: k,
|
|
33
|
+
disabledFutureDays: f,
|
|
34
|
+
picker: u,
|
|
35
|
+
defaultValue: O,
|
|
36
|
+
value: j,
|
|
37
|
+
format: y,
|
|
38
|
+
autoComplete: G = "off",
|
|
39
|
+
enabledDates: H = [],
|
|
40
|
+
renderExtraFooter: w,
|
|
41
|
+
...A
|
|
42
|
+
}) => {
|
|
43
|
+
const { t: E } = M(q), N = l ? d.RangePicker : d, P = L(
|
|
44
|
+
(t) => {
|
|
45
|
+
if (!t)
|
|
46
|
+
return !1;
|
|
47
|
+
const o = e(), D = n && t < o.startOf("day"), F = f && t > o.endOf("day"), R = s && t < o.endOf("day") && o.startOf("day") < t;
|
|
48
|
+
return D || F || R;
|
|
49
|
+
},
|
|
50
|
+
[n, f, s]
|
|
51
|
+
// Dependencies for useCallback
|
|
52
|
+
);
|
|
53
|
+
return /* @__PURE__ */ i.jsx(
|
|
54
|
+
v.Item,
|
|
55
|
+
{
|
|
56
|
+
...A,
|
|
57
|
+
label: m,
|
|
58
|
+
rules: [
|
|
59
|
+
{
|
|
60
|
+
required: p,
|
|
61
|
+
message: `${m ?? a ?? ""} ${E(
|
|
62
|
+
"err.validation.required"
|
|
63
|
+
)}`
|
|
64
|
+
},
|
|
65
|
+
...c
|
|
66
|
+
],
|
|
67
|
+
children: /* @__PURE__ */ i.jsx(
|
|
68
|
+
N,
|
|
69
|
+
{
|
|
70
|
+
renderExtraFooter: w,
|
|
71
|
+
value: j,
|
|
72
|
+
picker: u,
|
|
73
|
+
defaultValue: O,
|
|
74
|
+
format: y,
|
|
75
|
+
onChange: (t) => r == null ? void 0 : r(t),
|
|
76
|
+
disabledDate: P,
|
|
77
|
+
disabled: x,
|
|
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("../../../_virtual/jsx-runtime.cjs"),c=require("antd"),F=require("../../../_virtual/dayjs.min.cjs"),x=require("react"),I=require("../../../locale/hooks/translation-constants.cjs"),M=require("../../../node_modules/react-i18next/dist/es/useTranslation.cjs"),_=({type:$,required:T,label:i,rules:q=[],placeholder:s,disabledPast:r=!1,disableCurrent:m=!1,onEnter:v,disabled:f,use12Hours:j,nextFocus:w,onChange:o,range:n,disabledFuture:a,defaultValue:p,value:R,format:k,autoComplete:D="off",renderExtraFooter:E,...A})=>{const{t:N}=M.useTranslation(I.TRANSLATION_NAMESPACE),u=x.useMemo(()=>s||(n?["From","To"]:"Select time"),[s,n]);console.log(u);const P=n?c.TimePicker.RangePicker:c.TimePicker,y=x.useCallback(e=>{if(!e)return!1;const t=F(),S=r&&e<t,d=a&&e>t,C=m&&e<t&&t<e;return S||d||C},[m,a,r]);return l.jsxRuntimeExports.jsx(c.Form.Item,{...A,label:i,rules:[{required:T,message:`${i??s??""} ${N("err.validation.required")}`},...q],children:l.jsxRuntimeExports.jsx(P,{use12Hours:j,renderExtraFooter:E,value:R,defaultValue:p,format:k,onChange:e=>o==null?void 0:o(e),disabledDate:y,disabled:f,className:"w-100",placeholder:u})})};module.exports=_;
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { j as p } from "../../../_virtual/jsx-runtime.js";
|
|
2
|
+
import { TimePicker as a, Form as I } from "antd";
|
|
3
|
+
import M from "../../../_virtual/dayjs.min.js";
|
|
4
|
+
import { useMemo as $, useCallback as q } from "react";
|
|
5
|
+
import { TRANSLATION_NAMESPACE as v } from "../../../locale/hooks/translation-constants.js";
|
|
6
|
+
import { useTranslation as w } from "../../../node_modules/react-i18next/dist/es/useTranslation.js";
|
|
7
|
+
const K = ({
|
|
8
|
+
type: C,
|
|
9
|
+
required: l,
|
|
10
|
+
label: r,
|
|
11
|
+
rules: x = [],
|
|
12
|
+
placeholder: t,
|
|
13
|
+
disabledPast: i = !1,
|
|
14
|
+
disableCurrent: c = !1,
|
|
15
|
+
onEnter: D,
|
|
16
|
+
disabled: T,
|
|
17
|
+
use12Hours: j,
|
|
18
|
+
nextFocus: H,
|
|
19
|
+
onChange: m,
|
|
20
|
+
range: e,
|
|
21
|
+
disabledFuture: n,
|
|
22
|
+
defaultValue: u,
|
|
23
|
+
value: k,
|
|
24
|
+
format: A,
|
|
25
|
+
autoComplete: L = "off",
|
|
26
|
+
renderExtraFooter: E,
|
|
27
|
+
...N
|
|
28
|
+
}) => {
|
|
29
|
+
const { t: y } = w(v), f = $(
|
|
30
|
+
() => t || (e ? ["From", "To"] : "Select time"),
|
|
31
|
+
[t, e]
|
|
32
|
+
);
|
|
33
|
+
console.log(f);
|
|
34
|
+
const P = e ? a.RangePicker : a, R = q(
|
|
35
|
+
(o) => {
|
|
36
|
+
if (!o)
|
|
37
|
+
return !1;
|
|
38
|
+
const s = M(), S = i && o < s, d = n && o > s, F = c && o < s && s < o;
|
|
39
|
+
return S || d || F;
|
|
40
|
+
},
|
|
41
|
+
[c, n, i]
|
|
42
|
+
// Dependencies for useCallback
|
|
43
|
+
);
|
|
44
|
+
return /* @__PURE__ */ p.jsx(
|
|
45
|
+
I.Item,
|
|
46
|
+
{
|
|
47
|
+
...N,
|
|
48
|
+
label: r,
|
|
49
|
+
rules: [
|
|
50
|
+
{
|
|
51
|
+
required: l,
|
|
52
|
+
message: `${r ?? t ?? ""} ${y(
|
|
53
|
+
"err.validation.required"
|
|
54
|
+
)}`
|
|
55
|
+
},
|
|
56
|
+
...x
|
|
57
|
+
],
|
|
58
|
+
children: /* @__PURE__ */ p.jsx(
|
|
59
|
+
P,
|
|
60
|
+
{
|
|
61
|
+
use12Hours: j,
|
|
62
|
+
renderExtraFooter: E,
|
|
63
|
+
value: k,
|
|
64
|
+
defaultValue: u,
|
|
65
|
+
format: A,
|
|
66
|
+
onChange: (o) => m == null ? void 0 : m(o),
|
|
67
|
+
disabledDate: R,
|
|
68
|
+
disabled: T,
|
|
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 t=require("../../../_virtual/jsx-runtime.cjs"),r=({children:s,hide:e})=>t.jsxRuntimeExports.jsx("div",{className:e?"d-none":"",children:s});module.exports=r;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const l=require("../../../_virtual/jsx-runtime.cjs"),d=require("antd"),R=require("../../../locale/hooks/translation-constants.cjs"),x=require("react");;/* empty css */const m=require("../../../node_modules/react-i18next/dist/es/useTranslation.cjs"),c=require("../../../node_modules/react-router/dist/development/chunk-K6AXKMTT.cjs"),v=({className:i,to:e,onClick:t,tooltip:o,ref:j,...n})=>{var u;const{t:a}=m.useTranslation(R.TRANSLATION_NAMESPACE),s=x.useContext(c.NavigationContext)?(u=c.useNavigate)==null?void 0:u.call(c):void 0,r=x.useMemo(()=>l.jsxRuntimeExports.jsx(d.Button,{onClick:t||(e&&s?()=>s(e):void 0),className:i,...n,children:n.children||a(`button.${n.type}`)}),[i,s,t,n,a,e]);return o?l.jsxRuntimeExports.jsx(d.Tooltip,{title:o,children:r}):r},y=({className:i,to:e,onClick:t,tooltip:o,ref:j,...n})=>{const a=c.useNavigate(),[g,s]=x.useState(!1),r=x.useCallback(async q=>{try{return s(!0),await t(q)}finally{s(!1)}},[t]),u=x.useMemo(()=>l.jsxRuntimeExports.jsx(d.Button,{loading:g||n.loading,onClick:t?r:e?()=>a(e):void 0,className:i,...n}),[r,i,g,a,t,n,e]);return o?l.jsxRuntimeExports.jsx(d.Tooltip,{title:o,children:u}):u};v.Async=y;module.exports=v;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { j as c } from "../../../_virtual/jsx-runtime.js";
|
|
2
|
+
import { Button as d, Tooltip as f } from "antd";
|
|
3
|
+
import { TRANSLATION_NAMESPACE as j } from "../../../locale/hooks/translation-constants.js";
|
|
4
|
+
import { useContext as y, useMemo as l, useState as A, useCallback as b } from "react";
|
|
5
|
+
/* empty css */
|
|
6
|
+
import { useTranslation as h } from "../../../node_modules/react-i18next/dist/es/useTranslation.js";
|
|
7
|
+
import { NavigationContext as T, useNavigate as g } from "../../../node_modules/react-router/dist/development/chunk-K6AXKMTT.js";
|
|
8
|
+
const C = ({
|
|
9
|
+
className: i,
|
|
10
|
+
to: e,
|
|
11
|
+
onClick: t,
|
|
12
|
+
tooltip: a,
|
|
13
|
+
ref: v,
|
|
14
|
+
...n
|
|
15
|
+
}) => {
|
|
16
|
+
var u;
|
|
17
|
+
const { t: r } = h(j), o = y(T) ? (u = g) == null ? void 0 : u() : void 0, s = l(
|
|
18
|
+
() => /* @__PURE__ */ c.jsx(
|
|
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__ */ c.jsx(f, { title: a, children: s }) : s;
|
|
30
|
+
}, E = ({
|
|
31
|
+
className: i,
|
|
32
|
+
to: e,
|
|
33
|
+
onClick: t,
|
|
34
|
+
tooltip: a,
|
|
35
|
+
ref: v,
|
|
36
|
+
...n
|
|
37
|
+
}) => {
|
|
38
|
+
const r = g(), [m, o] = A(!1), s = b(
|
|
39
|
+
async (x) => {
|
|
40
|
+
try {
|
|
41
|
+
return o(!0), await t(x);
|
|
42
|
+
} finally {
|
|
43
|
+
o(!1);
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
[t]
|
|
47
|
+
), u = l(
|
|
48
|
+
() => /* @__PURE__ */ c.jsx(
|
|
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__ */ c.jsx(f, { title: a, children: u }) : u;
|
|
60
|
+
};
|
|
61
|
+
C.Async = E;
|
|
62
|
+
export {
|
|
63
|
+
C as default
|
|
64
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const t=require("../../../_virtual/jsx-runtime.cjs"),s=require("./Button.cjs"),r=require("../../../locale/hooks/translation-constants.cjs"),i=require("../../../node_modules/react-i18next/dist/es/useTranslation.cjs"),u=require("../../../node_modules/@ant-design/icons/es/icons/CopyOutlined.cjs");function c({value:n,onClick:e}){const{t:o}=i.useTranslation(r.TRANSLATION_NAMESPACE);return t.jsxRuntimeExports.jsx(s,{type:"link",onClick:()=>e(n),icon:t.jsxRuntimeExports.jsx(u,{}),tooltip:o("clone")})}module.exports=c;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { j as o } from "../../../_virtual/jsx-runtime.js";
|
|
2
|
+
import i from "./Button.js";
|
|
3
|
+
import { TRANSLATION_NAMESPACE as m } from "../../../locale/hooks/translation-constants.js";
|
|
4
|
+
import { useTranslation as e } from "../../../node_modules/react-i18next/dist/es/useTranslation.js";
|
|
5
|
+
import p from "../../../node_modules/@ant-design/icons/es/icons/CopyOutlined.js";
|
|
6
|
+
function c({ value: t, onClick: n }) {
|
|
7
|
+
const { t: r } = e(m);
|
|
8
|
+
return /* @__PURE__ */ o.jsx(
|
|
9
|
+
i,
|
|
10
|
+
{
|
|
11
|
+
type: "link",
|
|
12
|
+
onClick: () => n(t),
|
|
13
|
+
icon: /* @__PURE__ */ o.jsx(p, {}),
|
|
14
|
+
tooltip: r("clone")
|
|
15
|
+
}
|
|
16
|
+
);
|
|
17
|
+
}
|
|
18
|
+
export {
|
|
19
|
+
c as default
|
|
20
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const t=require("../../../_virtual/jsx-runtime.cjs"),q=require("antd"),n=require("react"),f=require("./Button.cjs"),E=require("../../../locale/hooks/translation-constants.cjs"),R=require("../../../node_modules/react-i18next/dist/es/useTranslation.cjs"),m=require("../../../node_modules/@ant-design/icons/es/icons/DeleteOutlined.cjs");function T({shouldConfirm:d=!0,block:r,value:i,loading:u,onClick:a,text:c,disabled:l,type:x="link"}){const{t:e}=R.useTranslation(E.TRANSLATION_NAMESPACE),s=n.useMemo(()=>c??e("str.delete"),[c,e]),[p,o]=n.useState(!1);n.useEffect(()=>{o(u??!1)},[u]);const j=n.useCallback(async()=>{try{o(!0),await a(i)}finally{o(!1)}},[a,i]);return d?t.jsxRuntimeExports.jsx(q.Popconfirm,{title:e("qus.doYouWantToDelete"),okText:s.toUpperCase(),cancelText:e("str.no").toUpperCase(),onConfirm:j,children:t.jsxRuntimeExports.jsx(f,{tooltip:s,icon:t.jsxRuntimeExports.jsx(m,{}),disabled:l,loading:p,type:x,danger:!0,block:r})}):t.jsxRuntimeExports.jsx(f,{tooltip:s,icon:t.jsxRuntimeExports.jsx(m,{}),disabled:l,loading:p,type:x,danger:!0,block:r,onClick:j})}module.exports=T;
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { j as t } from "../../../_virtual/jsx-runtime.js";
|
|
2
|
+
import { Popconfirm as j } from "antd";
|
|
3
|
+
import { useMemo as C, useState as T, useEffect as g, useCallback as A } from "react";
|
|
4
|
+
import c from "./Button.js";
|
|
5
|
+
import { TRANSLATION_NAMESPACE as E } from "../../../locale/hooks/translation-constants.js";
|
|
6
|
+
import { useTranslation as _ } from "../../../node_modules/react-i18next/dist/es/useTranslation.js";
|
|
7
|
+
import x from "../../../node_modules/@ant-design/icons/es/icons/DeleteOutlined.js";
|
|
8
|
+
function I({
|
|
9
|
+
shouldConfirm: d = !0,
|
|
10
|
+
block: n,
|
|
11
|
+
value: s,
|
|
12
|
+
loading: i,
|
|
13
|
+
onClick: a,
|
|
14
|
+
text: l,
|
|
15
|
+
disabled: f,
|
|
16
|
+
type: m = "link"
|
|
17
|
+
}) {
|
|
18
|
+
const { t: o } = _(E), e = C(() => l ?? o("str.delete"), [l, o]), [u, r] = T(!1);
|
|
19
|
+
g(() => {
|
|
20
|
+
r(i ?? !1);
|
|
21
|
+
}, [i]);
|
|
22
|
+
const p = A(
|
|
23
|
+
async () => {
|
|
24
|
+
try {
|
|
25
|
+
r(!0), await a(s);
|
|
26
|
+
} finally {
|
|
27
|
+
r(!1);
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
[a, s]
|
|
31
|
+
);
|
|
32
|
+
return d ? /* @__PURE__ */ t.jsx(
|
|
33
|
+
j,
|
|
34
|
+
{
|
|
35
|
+
title: o("qus.doYouWantToDelete"),
|
|
36
|
+
okText: e.toUpperCase(),
|
|
37
|
+
cancelText: o("str.no").toUpperCase(),
|
|
38
|
+
onConfirm: p,
|
|
39
|
+
children: /* @__PURE__ */ t.jsx(
|
|
40
|
+
c,
|
|
41
|
+
{
|
|
42
|
+
tooltip: e,
|
|
43
|
+
icon: /* @__PURE__ */ t.jsx(x, {}),
|
|
44
|
+
disabled: f,
|
|
45
|
+
loading: u,
|
|
46
|
+
type: m,
|
|
47
|
+
danger: !0,
|
|
48
|
+
block: n
|
|
49
|
+
}
|
|
50
|
+
)
|
|
51
|
+
}
|
|
52
|
+
) : /* @__PURE__ */ t.jsx(
|
|
53
|
+
c,
|
|
54
|
+
{
|
|
55
|
+
tooltip: e,
|
|
56
|
+
icon: /* @__PURE__ */ t.jsx(x, {}),
|
|
57
|
+
disabled: f,
|
|
58
|
+
loading: u,
|
|
59
|
+
type: m,
|
|
60
|
+
danger: !0,
|
|
61
|
+
block: n,
|
|
62
|
+
onClick: p
|
|
63
|
+
}
|
|
64
|
+
);
|
|
65
|
+
}
|
|
66
|
+
export {
|
|
67
|
+
I as default
|
|
68
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("../../../_virtual/jsx-runtime.cjs"),s=require("react"),a=require("./Button.cjs"),c=require("../../../locale/hooks/translation-constants.cjs"),l=require("../../../node_modules/react-i18next/dist/es/useTranslation.cjs"),x=require("../../../node_modules/@ant-design/icons/es/icons/ExportOutlined.cjs");function p({value:t,onClick:e}){const[r,n]=s.useState(!1),{t:i}=l.useTranslation(c.TRANSLATION_NAMESPACE),u=s.useCallback(async()=>{n(!0),e(t).finally(()=>n(!1))},[e,t]);return o.jsxRuntimeExports.jsx(a,{loading:r,type:"link",onClick:u,icon:o.jsxRuntimeExports.jsx(x,{}),tooltip:i("str.export")})}exports.ExportButton=p;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { j as n } from "../../../_virtual/jsx-runtime.js";
|
|
2
|
+
import { useState as m, useCallback as p } from "react";
|
|
3
|
+
import a from "./Button.js";
|
|
4
|
+
import { TRANSLATION_NAMESPACE as f } from "../../../locale/hooks/translation-constants.js";
|
|
5
|
+
import { useTranslation as c } from "../../../node_modules/react-i18next/dist/es/useTranslation.js";
|
|
6
|
+
import l from "../../../node_modules/@ant-design/icons/es/icons/ExportOutlined.js";
|
|
7
|
+
function y({
|
|
8
|
+
value: o,
|
|
9
|
+
onClick: t
|
|
10
|
+
}) {
|
|
11
|
+
const [s, r] = m(!1), { t: i } = c(f), e = p(async () => {
|
|
12
|
+
r(!0), t(o).finally(() => r(!1));
|
|
13
|
+
}, [t, o]);
|
|
14
|
+
return /* @__PURE__ */ n.jsx(
|
|
15
|
+
a,
|
|
16
|
+
{
|
|
17
|
+
loading: s,
|
|
18
|
+
type: "link",
|
|
19
|
+
onClick: e,
|
|
20
|
+
icon: /* @__PURE__ */ n.jsx(l, {}),
|
|
21
|
+
tooltip: i("str.export")
|
|
22
|
+
}
|
|
23
|
+
);
|
|
24
|
+
}
|
|
25
|
+
export {
|
|
26
|
+
y as ExportButton
|
|
27
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const t=require("../../../_virtual/jsx-runtime.cjs"),q=require("antd"),n=require("react"),C=require("../../../locale/hooks/translation-constants.cjs"),d=require("./Button.cjs"),E=require("../../../node_modules/react-i18next/dist/es/useTranslation.cjs"),f=require("../../../node_modules/@ant-design/icons/es/icons/DownCircleOutlined.cjs");function R({shouldConfirm:m=!0,block:r,value:i,loading:u,onClick:a,text:c,disabled:l,type:x="link"}){const{t:e}=E.useTranslation(C.TRANSLATION_NAMESPACE),s=n.useMemo(()=>c??e("str.hide"),[c,e]),[p,o]=n.useState(!1);n.useEffect(()=>{o(u??!1)},[u]);const j=n.useCallback(async()=>{try{o(!0),await a(i)}finally{o(!1)}},[a,i]);return m?t.jsxRuntimeExports.jsx(q.Popconfirm,{title:e("qus.doYouWantToHide"),okText:s.toUpperCase(),cancelText:e("str.no").toUpperCase(),onConfirm:j,children:t.jsxRuntimeExports.jsx(d,{tooltip:s,icon:t.jsxRuntimeExports.jsx(f,{}),disabled:l,loading:p,type:x,danger:!0,block:r})}):t.jsxRuntimeExports.jsx(d,{tooltip:s,icon:t.jsxRuntimeExports.jsx(f,{}),disabled:l,loading:p,type:x,danger:!0,block:r,onClick:j})}module.exports=R;
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { j as o } from "../../../_virtual/jsx-runtime.js";
|
|
2
|
+
import { Popconfirm as j } from "antd";
|
|
3
|
+
import { useMemo as C, useState as T, useEffect as g, useCallback as A } from "react";
|
|
4
|
+
import { TRANSLATION_NAMESPACE as E } from "../../../locale/hooks/translation-constants.js";
|
|
5
|
+
import c from "./Button.js";
|
|
6
|
+
import { useTranslation as _ } from "../../../node_modules/react-i18next/dist/es/useTranslation.js";
|
|
7
|
+
import x from "../../../node_modules/@ant-design/icons/es/icons/DownCircleOutlined.js";
|
|
8
|
+
function H({
|
|
9
|
+
shouldConfirm: d = !0,
|
|
10
|
+
block: n,
|
|
11
|
+
value: i,
|
|
12
|
+
loading: s,
|
|
13
|
+
onClick: a,
|
|
14
|
+
text: f,
|
|
15
|
+
disabled: m,
|
|
16
|
+
type: l = "link"
|
|
17
|
+
}) {
|
|
18
|
+
const { t } = _(E), r = C(() => f ?? t("str.hide"), [f, t]), [u, e] = T(!1);
|
|
19
|
+
g(() => {
|
|
20
|
+
e(s ?? !1);
|
|
21
|
+
}, [s]);
|
|
22
|
+
const p = A(
|
|
23
|
+
async () => {
|
|
24
|
+
try {
|
|
25
|
+
e(!0), await a(i);
|
|
26
|
+
} finally {
|
|
27
|
+
e(!1);
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
[a, i]
|
|
31
|
+
);
|
|
32
|
+
return d ? /* @__PURE__ */ o.jsx(
|
|
33
|
+
j,
|
|
34
|
+
{
|
|
35
|
+
title: t("qus.doYouWantToHide"),
|
|
36
|
+
okText: r.toUpperCase(),
|
|
37
|
+
cancelText: t("str.no").toUpperCase(),
|
|
38
|
+
onConfirm: p,
|
|
39
|
+
children: /* @__PURE__ */ o.jsx(
|
|
40
|
+
c,
|
|
41
|
+
{
|
|
42
|
+
tooltip: r,
|
|
43
|
+
icon: /* @__PURE__ */ o.jsx(x, {}),
|
|
44
|
+
disabled: m,
|
|
45
|
+
loading: u,
|
|
46
|
+
type: l,
|
|
47
|
+
danger: !0,
|
|
48
|
+
block: n
|
|
49
|
+
}
|
|
50
|
+
)
|
|
51
|
+
}
|
|
52
|
+
) : /* @__PURE__ */ o.jsx(
|
|
53
|
+
c,
|
|
54
|
+
{
|
|
55
|
+
tooltip: r,
|
|
56
|
+
icon: /* @__PURE__ */ o.jsx(x, {}),
|
|
57
|
+
disabled: m,
|
|
58
|
+
loading: u,
|
|
59
|
+
type: l,
|
|
60
|
+
danger: !0,
|
|
61
|
+
block: n,
|
|
62
|
+
onClick: p
|
|
63
|
+
}
|
|
64
|
+
);
|
|
65
|
+
}
|
|
66
|
+
export {
|
|
67
|
+
H as default
|
|
68
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("../../../_virtual/jsx-runtime.cjs"),s=require("react"),g=require("../../../locale/hooks/translation-constants.cjs"),R=require("./Button.cjs"),k=require("../../../node_modules/react-i18next/dist/es/useTranslation.cjs"),q=require("../../../node_modules/@ant-design/icons/es/icons/ImportOutlined.cjs");function C({onClick:o,children:u,accept:c,className:a,disabled:l,type:x="link"}){const[p,i]=s.useState(!1),{t:m}=k.useTranslation(g.TRANSLATION_NAMESPACE),e=s.useRef(null),j=s.useCallback(()=>{d(t=>t+1),e.current&&setTimeout(()=>{var t;(t=e==null?void 0:e.current)==null||t.click()},10)},[]),[f,d]=s.useState(0),y=s.useCallback(async t=>{i(!0);const r=t.target.files[0];r&&await o(r),i(!1)},[o]);return n.jsxRuntimeExports.jsxs("div",{className:a,children:[n.jsxRuntimeExports.jsx("input",{type:"file",style:{display:"none"},ref:e,onChange:y,accept:c},f),n.jsxRuntimeExports.jsx(R,{loading:p,type:x,disabled:l,onClick:j,icon:n.jsxRuntimeExports.jsx(q,{}),tooltip:m("str.import"),children:u})]})}exports.ImportButton=C;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { j as n } from "../../../_virtual/jsx-runtime.js";
|
|
2
|
+
import { useState as r, useRef as k, useCallback as c } from "react";
|
|
3
|
+
import { TRANSLATION_NAMESPACE as C } from "../../../locale/hooks/translation-constants.js";
|
|
4
|
+
import A from "./Button.js";
|
|
5
|
+
import { useTranslation as T } from "../../../node_modules/react-i18next/dist/es/useTranslation.js";
|
|
6
|
+
import h from "../../../node_modules/@ant-design/icons/es/icons/ImportOutlined.js";
|
|
7
|
+
function L({
|
|
8
|
+
onClick: e,
|
|
9
|
+
children: l,
|
|
10
|
+
accept: a,
|
|
11
|
+
className: m,
|
|
12
|
+
disabled: f,
|
|
13
|
+
type: p = "link"
|
|
14
|
+
}) {
|
|
15
|
+
const [u, s] = r(!1), { t: x } = T(C), o = k(null), j = c(() => {
|
|
16
|
+
d((t) => t + 1), o.current && setTimeout(() => {
|
|
17
|
+
var t;
|
|
18
|
+
(t = o == null ? void 0 : o.current) == null || t.click();
|
|
19
|
+
}, 10);
|
|
20
|
+
}, []), [y, d] = r(0), g = c(
|
|
21
|
+
async (t) => {
|
|
22
|
+
s(!0);
|
|
23
|
+
const i = t.target.files[0];
|
|
24
|
+
i && await e(i), s(!1);
|
|
25
|
+
},
|
|
26
|
+
[e]
|
|
27
|
+
);
|
|
28
|
+
return /* @__PURE__ */ n.jsxs("div", { className: m, children: [
|
|
29
|
+
/* @__PURE__ */ n.jsx(
|
|
30
|
+
"input",
|
|
31
|
+
{
|
|
32
|
+
type: "file",
|
|
33
|
+
style: { display: "none" },
|
|
34
|
+
ref: o,
|
|
35
|
+
onChange: g,
|
|
36
|
+
accept: a
|
|
37
|
+
},
|
|
38
|
+
y
|
|
39
|
+
),
|
|
40
|
+
/* @__PURE__ */ n.jsx(
|
|
41
|
+
A,
|
|
42
|
+
{
|
|
43
|
+
loading: u,
|
|
44
|
+
type: p,
|
|
45
|
+
disabled: f,
|
|
46
|
+
onClick: j,
|
|
47
|
+
icon: /* @__PURE__ */ n.jsx(h, {}),
|
|
48
|
+
tooltip: x("str.import"),
|
|
49
|
+
children: l
|
|
50
|
+
}
|
|
51
|
+
)
|
|
52
|
+
] });
|
|
53
|
+
}
|
|
54
|
+
export {
|
|
55
|
+
L as ImportButton
|
|
56
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../../../_virtual/jsx-runtime.cjs"),a=require("./Button.cjs"),l=require("../../../locale/hooks/translation-constants.cjs"),x=require("../../../node_modules/react-i18next/dist/es/useTranslation.cjs"),j=require("../../../node_modules/@ant-design/icons/es/icons/PlusOutlined.cjs"),m=({size:n,block:r,className:s,type:o="primary",onClick:t,title:u,to:i})=>{const{t:c}=x.useTranslation(l.TRANSLATION_NAMESPACE);return e.jsxRuntimeExports.jsx(a,{type:o,className:s,to:i,block:r,size:n,onClick:t&&(()=>t(!0)),icon:e.jsxRuntimeExports.jsx(j,{}),children:u??c("str.new")})};exports.NewButton=m;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { j as r } from "../../../_virtual/jsx-runtime.js";
|
|
2
|
+
import f from "./Button.js";
|
|
3
|
+
import { TRANSLATION_NAMESPACE as u } from "../../../locale/hooks/translation-constants.js";
|
|
4
|
+
import { useTranslation as c } from "../../../node_modules/react-i18next/dist/es/useTranslation.js";
|
|
5
|
+
import x from "../../../node_modules/@ant-design/icons/es/icons/PlusOutlined.js";
|
|
6
|
+
const R = ({ size: t, block: n, className: m, type: e = "primary", onClick: o, title: i, to: s }) => {
|
|
7
|
+
const { t: p } = c(u);
|
|
8
|
+
return /* @__PURE__ */ r.jsx(
|
|
9
|
+
f,
|
|
10
|
+
{
|
|
11
|
+
type: e,
|
|
12
|
+
className: m,
|
|
13
|
+
to: s,
|
|
14
|
+
block: n,
|
|
15
|
+
size: t,
|
|
16
|
+
onClick: o && (() => o(!0)),
|
|
17
|
+
icon: /* @__PURE__ */ r.jsx(x, {}),
|
|
18
|
+
children: i ?? p("str.new")
|
|
19
|
+
}
|
|
20
|
+
);
|
|
21
|
+
};
|
|
22
|
+
export {
|
|
23
|
+
R as NewButton
|
|
24
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("../../../_virtual/jsx-runtime.cjs"),p=require("./Button.cjs"),x=require("../../../locale/hooks/translation-constants.cjs"),j=require("../../../node_modules/react-i18next/dist/es/useTranslation.cjs"),m=require("../../../node_modules/@ant-design/icons/es/icons/PrinterOutlined.cjs"),q=({disabled:s,loading:e,block:i,className:o,type:u="primary",onClick:c,title:a,to:l})=>{const{t:n}=j.useTranslation(x.TRANSLATION_NAMESPACE),t=a??n("str.print");return r.jsxRuntimeExports.jsx(p,{type:u,className:o,to:l,loading:e,disabled:s,block:i,onClick:c,tooltip:t!=null&&t.trim()?"":n("str.print"),icon:r.jsxRuntimeExports.jsx(m,{}),children:t})};exports.PrintButton=q;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { j as r } from "../../../_virtual/jsx-runtime.js";
|
|
2
|
+
import u from "./Button.js";
|
|
3
|
+
import { TRANSLATION_NAMESPACE as x } from "../../../locale/hooks/translation-constants.js";
|
|
4
|
+
import { useTranslation as a } from "../../../node_modules/react-i18next/dist/es/useTranslation.js";
|
|
5
|
+
import j from "../../../node_modules/@ant-design/icons/es/icons/PrinterOutlined.js";
|
|
6
|
+
const l = ({ disabled: n, loading: i, block: m, className: p, type: s = "primary", onClick: c, title: e, to: f }) => {
|
|
7
|
+
const { t: o } = a(x), t = e ?? o("str.print");
|
|
8
|
+
return /* @__PURE__ */ r.jsx(
|
|
9
|
+
u,
|
|
10
|
+
{
|
|
11
|
+
type: s,
|
|
12
|
+
className: p,
|
|
13
|
+
to: f,
|
|
14
|
+
loading: i,
|
|
15
|
+
disabled: n,
|
|
16
|
+
block: m,
|
|
17
|
+
onClick: c,
|
|
18
|
+
tooltip: t != null && t.trim() ? "" : o("str.print"),
|
|
19
|
+
icon: /* @__PURE__ */ r.jsx(j, {}),
|
|
20
|
+
children: t
|
|
21
|
+
}
|
|
22
|
+
);
|
|
23
|
+
};
|
|
24
|
+
export {
|
|
25
|
+
l as PrintButton
|
|
26
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../../../_virtual/jsx-runtime.cjs"),c=require("../../../locale/hooks/translation-constants.cjs"),l=require("./Button.cjs"),x=require("../../../node_modules/react-i18next/dist/es/useTranslation.cjs"),R=require("../../../node_modules/@ant-design/icons/es/icons/ReloadOutlined.cjs"),j=({disabled:r,block:n,className:s,type:o="primary",onClick:t,title:u,to:i})=>{const{t:a}=x.useTranslation(c.TRANSLATION_NAMESPACE);return e.jsxRuntimeExports.jsx(l,{type:o,disabled:r,className:s,to:i,block:n,onClick:t&&(()=>t(!0)),icon:e.jsxRuntimeExports.jsx(R,{}),children:u??a("str.refresh")})};exports.RefreshButton=j;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { j as o } from "../../../_virtual/jsx-runtime.js";
|
|
2
|
+
import { TRANSLATION_NAMESPACE as f } from "../../../locale/hooks/translation-constants.js";
|
|
3
|
+
import u from "./Button.js";
|
|
4
|
+
import { useTranslation as c } from "../../../node_modules/react-i18next/dist/es/useTranslation.js";
|
|
5
|
+
import x from "../../../node_modules/@ant-design/icons/es/icons/ReloadOutlined.js";
|
|
6
|
+
const E = ({ disabled: t, block: m, className: n, type: e = "primary", onClick: r, title: s, to: i }) => {
|
|
7
|
+
const { t: p } = c(f);
|
|
8
|
+
return /* @__PURE__ */ o.jsx(
|
|
9
|
+
u,
|
|
10
|
+
{
|
|
11
|
+
type: e,
|
|
12
|
+
disabled: t,
|
|
13
|
+
className: n,
|
|
14
|
+
to: i,
|
|
15
|
+
block: m,
|
|
16
|
+
onClick: r && (() => r(!0)),
|
|
17
|
+
icon: /* @__PURE__ */ o.jsx(x, {}),
|
|
18
|
+
children: s ?? p("str.refresh")
|
|
19
|
+
}
|
|
20
|
+
);
|
|
21
|
+
};
|
|
22
|
+
export {
|
|
23
|
+
E as RefreshButton
|
|
24
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const t=require("../../../_virtual/jsx-runtime.cjs"),C=require("antd"),n=require("react"),d=require("./Button.cjs"),E=require("../../../locale/hooks/translation-constants.cjs"),R=require("../../../node_modules/react-i18next/dist/es/useTranslation.cjs"),f=require("../../../node_modules/@ant-design/icons/es/icons/UpCircleOutlined.cjs");function T({shouldConfirm:m=!0,block:r,value:i,loading:u,onClick:a,text:c,disabled:l,type:x="link",hidden:q}){const{t:e}=R.useTranslation(E.TRANSLATION_NAMESPACE),s=n.useMemo(()=>c??e("str.unhide"),[c,e]),[p,o]=n.useState(!1);n.useEffect(()=>{o(u??!1)},[u]);const j=n.useCallback(async()=>{try{o(!0),await a(i)}finally{o(!1)}},[a,i]);return m?t.jsxRuntimeExports.jsx(C.Popconfirm,{title:e("qus.doYouWantToHide"),okText:s.toUpperCase(),cancelText:e("str.no").toUpperCase(),onConfirm:j,children:t.jsxRuntimeExports.jsx(d,{tooltip:s,icon:t.jsxRuntimeExports.jsx(f,{}),disabled:l,loading:p,type:x,danger:!0,hidden:q,block:r})}):t.jsxRuntimeExports.jsx(d,{tooltip:s,icon:t.jsxRuntimeExports.jsx(f,{}),disabled:l,loading:p,type:x,danger:!0,block:r,onClick:j})}module.exports=T;
|