@kingteza/crud-component 1.2.0 → 1.2.2
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/Play.d.ts +2 -0
- package/dist/README.md +89 -0
- package/dist/common/appearance/Hider.cjs.js +1 -0
- package/dist/common/appearance/Hider.d.ts +6 -0
- package/dist/common/appearance/Hider.es.js +5 -0
- package/dist/common/appearance/index.d.ts +1 -0
- package/dist/common/button/Button.cjs.js +1 -0
- package/dist/common/button/Button.d.ts +11 -0
- package/dist/common/button/Button.es.js +57 -0
- package/dist/common/button/CloneButtonTable.cjs.js +1 -0
- package/dist/common/button/CloneButtonTable.d.ts +6 -0
- package/dist/common/button/CloneButtonTable.es.js +19 -0
- package/dist/common/button/DeleteButtonTable.cjs.js +1 -0
- package/dist/common/button/DeleteButtonTable.d.ts +13 -0
- package/dist/common/button/DeleteButtonTable.es.js +64 -0
- package/dist/common/button/ExportButton.cjs.js +1 -0
- package/dist/common/button/ExportButton.d.ts +4 -0
- package/dist/common/button/ExportButton.es.js +26 -0
- package/dist/common/button/HideButtonTable.cjs.js +1 -0
- package/dist/common/button/HideButtonTable.d.ts +13 -0
- package/dist/common/button/HideButtonTable.es.js +67 -0
- package/dist/common/button/ImportButton.cjs.js +1 -0
- package/dist/common/button/ImportButton.d.ts +9 -0
- package/dist/common/button/ImportButton.es.js +55 -0
- package/dist/common/button/NewButton.cjs.js +1 -0
- package/dist/common/button/NewButton.d.ts +12 -0
- package/dist/common/button/NewButton.es.js +23 -0
- package/dist/common/button/PrintButton.cjs.js +1 -0
- package/dist/common/button/PrintButton.d.ts +12 -0
- package/dist/common/button/PrintButton.es.js +25 -0
- package/dist/common/button/RefreshButton.cjs.js +1 -0
- package/dist/common/button/RefreshButton.d.ts +11 -0
- package/dist/common/button/RefreshButton.es.js +23 -0
- package/dist/common/button/UnHideButton.cjs.js +1 -0
- package/dist/common/button/UnHideButton.d.ts +14 -0
- package/dist/common/button/UnHideButton.es.js +69 -0
- package/dist/common/button/UpdateButtonTable.cjs.js +1 -0
- package/dist/common/button/UpdateButtonTable.d.ts +6 -0
- package/dist/common/button/UpdateButtonTable.es.js +19 -0
- package/dist/common/button/ViewButtonTable.cjs.js +1 -0
- package/dist/common/button/ViewButtonTable.d.ts +6 -0
- package/dist/common/button/ViewButtonTable.es.js +19 -0
- package/dist/common/button/index.d.ts +14 -0
- package/dist/common/check-box/CheckBox.cjs.js +1 -0
- package/dist/common/check-box/CheckBox.d.ts +9 -0
- package/dist/common/check-box/CheckBox.es.js +40 -0
- package/dist/common/check-box/index.d.ts +2 -0
- package/dist/common/date-picker/DatePicker.cjs.js +1 -0
- package/dist/common/date-picker/DatePicker.d.ts +37 -0
- package/dist/common/date-picker/DatePicker.es.js +87 -0
- package/dist/common/date-picker/TimePicker.cjs.js +1 -0
- package/dist/common/date-picker/TimePicker.d.ts +34 -0
- package/dist/common/date-picker/TimePicker.es.js +77 -0
- package/dist/common/date-picker/index.d.ts +3 -0
- package/dist/common/description/DescList.cjs.js +1 -0
- package/dist/common/description/DescList.d.ts +18 -0
- package/dist/common/description/DescList.es.js +16 -0
- package/dist/common/description/DescriptionComponent.d.ts +7 -0
- package/dist/common/description/index.d.ts +3 -0
- package/dist/common/icon/KIcon.cjs.js +1 -0
- package/dist/common/icon/KIcon.d.ts +9 -0
- package/dist/common/icon/KIcon.es.js +11 -0
- package/dist/common/index.cjs.js +1 -0
- package/dist/common/index.d.ts +20 -0
- package/dist/common/index.es.js +78 -0
- package/dist/common/layout/VerticalSpace.cjs.js +1 -0
- package/dist/common/layout/VerticalSpace.d.ts +5 -0
- package/dist/common/layout/VerticalSpace.es.js +6 -0
- package/dist/common/layout/index.d.ts +2 -0
- package/dist/common/loading/LoadingIndicator.cjs.js +1 -0
- package/dist/common/loading/LoadingIndicator.d.ts +6 -0
- package/dist/common/loading/LoadingIndicator.es.js +23 -0
- package/dist/common/loading/index.d.ts +2 -0
- package/dist/common/picker/ImagePicker.cjs.js +1 -0
- package/dist/common/picker/ImagePicker.d.ts +56 -0
- package/dist/common/picker/ImagePicker.es.js +320 -0
- package/dist/common/picker/index.d.ts +2 -0
- package/dist/common/radio/RadioGroupComponent.cjs.js +1 -0
- package/dist/common/radio/RadioGroupComponent.d.ts +18 -0
- package/dist/common/radio/RadioGroupComponent.es.js +19 -0
- package/dist/common/radio/index.d.ts +2 -0
- package/dist/common/report/SelectFieldInReport.cjs.js +1 -0
- package/dist/common/report/SelectFieldInReport.d.ts +16 -0
- package/dist/common/report/SelectFieldInReport.es.js +30 -0
- package/dist/common/report/index.d.ts +3 -0
- package/dist/common/rich/index.cjs.js +1 -0
- package/dist/common/rich/index.d.ts +10 -0
- package/dist/common/rich/index.es.js +66 -0
- package/dist/common/select/CustomSelectOption.cjs.js +1 -0
- package/dist/common/select/CustomSelectOption.d.ts +7 -0
- package/dist/common/select/CustomSelectOption.es.js +13 -0
- package/dist/common/select/SelectComponent.cjs.js +1 -0
- package/dist/common/select/SelectComponent.d.ts +21 -0
- package/dist/common/select/SelectComponent.es.js +85 -0
- package/dist/common/select/index.d.ts +3 -0
- package/dist/common/show-more/index.cjs.js +1 -0
- package/dist/common/show-more/index.d.ts +4 -0
- package/dist/common/show-more/index.es.js +8 -0
- package/dist/common/tab/TabViewWithRoute.cjs.js +1 -0
- package/dist/common/tab/TabViewWithRoute.d.ts +13 -0
- package/dist/common/tab/TabViewWithRoute.es.js +38 -0
- package/dist/common/tab/index.d.ts +2 -0
- package/dist/common/table/index.d.ts +3 -0
- package/dist/common/table/table.cjs.js +1 -0
- package/dist/common/table/table.d.ts +19 -0
- package/dist/common/table/table.es.js +40 -0
- package/dist/common/tag/StatusTag.cjs.js +1 -0
- package/dist/common/tag/StatusTag.d.ts +14 -0
- package/dist/common/tag/StatusTag.es.js +29 -0
- package/dist/common/tag/index.d.ts +2 -0
- package/dist/common/text/index.cjs.js +1 -0
- package/dist/common/text/index.d.ts +3 -0
- package/dist/common/text/index.es.js +5 -0
- package/dist/common/text/title/TitleWithHeadTitle.d.ts +7 -0
- package/dist/common/text/title/index.cjs.js +1 -0
- package/dist/common/text/title/index.d.ts +1 -0
- package/dist/common/text/title/index.es.js +5 -0
- package/dist/common/text-field/NumberField.cjs.js +1 -0
- package/dist/common/text-field/NumberField.d.ts +13 -0
- package/dist/common/text-field/NumberField.es.js +83 -0
- package/dist/common/text-field/PhoneNumberField.cjs.js +1 -0
- package/dist/common/text-field/PhoneNumberField.d.ts +4 -0
- package/dist/common/text-field/PhoneNumberField.es.js +18 -0
- package/dist/common/text-field/TextArea.cjs.js +1 -0
- package/dist/common/text-field/TextArea.d.ts +17 -0
- package/dist/common/text-field/TextArea.es.js +46 -0
- package/dist/common/text-field/TextField.cjs.js +1 -0
- package/dist/common/text-field/TextField.d.ts +27 -0
- package/dist/common/text-field/TextField.es.js +72 -0
- package/dist/common/text-field/index.d.ts +5 -0
- package/dist/common/tooltip/TooltipComponent.cjs.js +1 -0
- package/dist/common/tooltip/TooltipComponent.d.ts +5 -0
- package/dist/common/tooltip/TooltipComponent.es.js +9 -0
- package/dist/common/tooltip/index.d.ts +2 -0
- package/dist/common/wizard/WizardResult.cjs.js +1 -0
- package/dist/common/wizard/WizardResult.d.ts +16 -0
- package/dist/common/wizard/WizardResult.es.js +58 -0
- package/dist/common/wizard/WizardViewForm.cjs.js +1 -0
- package/dist/common/wizard/WizardViewForm.d.ts +24 -0
- package/dist/common/wizard/WizardViewForm.es.js +74 -0
- package/dist/common/wizard/index.d.ts +3 -0
- package/dist/context/WindowDimension.cjs.js +1 -0
- package/dist/context/WindowDimension.d.ts +4 -0
- package/dist/context/WindowDimension.es.js +8 -0
- package/dist/context/index.d.ts +1 -0
- package/dist/crud/CrudComponent.cjs.js +1 -0
- package/dist/crud/CrudComponent.d.ts +245 -0
- package/dist/crud/CrudComponent.es.js +123 -0
- package/dist/crud/CrudField.cjs.js +1 -0
- package/dist/crud/CrudField.d.ts +4 -0
- package/dist/crud/CrudField.es.js +461 -0
- package/dist/crud/CrudForm.cjs.js +1 -0
- package/dist/crud/CrudForm.d.ts +14 -0
- package/dist/crud/CrudForm.es.js +103 -0
- package/dist/crud/CrudFormWizard.cjs.js +1 -0
- package/dist/crud/CrudFormWizard.d.ts +14 -0
- package/dist/crud/CrudFormWizard.es.js +140 -0
- package/dist/crud/CrudReportComponent.cjs.js +4 -0
- package/dist/crud/CrudReportComponent.d.ts +44 -0
- package/dist/crud/CrudReportComponent.es.js +255 -0
- package/dist/crud/CrudSearchComponent.cjs.js +1 -0
- package/dist/crud/CrudSearchComponent.d.ts +21 -0
- package/dist/crud/CrudSearchComponent.es.js +96 -0
- package/dist/crud/CrudTextAreaComponent.cjs.js +1 -0
- package/dist/crud/CrudTextAreaComponent.d.ts +22 -0
- package/dist/crud/CrudTextAreaComponent.es.js +52 -0
- package/dist/crud/FileCrudField.cjs.js +1 -0
- package/dist/crud/FileCrudField.d.ts +25 -0
- package/dist/crud/FileCrudField.es.js +221 -0
- package/dist/crud/ImageCrudField.cjs.js +1 -0
- package/dist/crud/ImageCrudField.d.ts +38 -0
- package/dist/crud/ImageCrudField.es.js +115 -0
- package/dist/crud/actions/index.cjs.js +1 -0
- package/dist/crud/actions/index.d.ts +26 -0
- package/dist/crud/actions/index.es.js +88 -0
- package/dist/crud/import/CrudImportButton.cjs.js +1 -0
- package/dist/crud/import/CrudImportButton.d.ts +3 -0
- package/dist/crud/import/CrudImportButton.es.js +30 -0
- package/dist/crud/import/CrudImportComponent.cjs.js +2 -0
- package/dist/crud/import/CrudImportComponent.d.ts +14 -0
- package/dist/crud/import/CrudImportComponent.es.js +222 -0
- package/dist/crud/index.d.ts +23 -0
- package/dist/crud/modal/index.cjs.js +1 -0
- package/dist/crud/modal/index.d.ts +24 -0
- package/dist/crud/modal/index.es.js +146 -0
- package/dist/crud/view/CrudDecListView.cjs.js +1 -0
- package/dist/crud/view/CrudDecListView.d.ts +15 -0
- package/dist/crud/view/CrudDecListView.es.js +57 -0
- package/dist/crud/view/CrudViewer.cjs.js +1 -0
- package/dist/crud/view/CrudViewer.d.ts +43 -0
- package/dist/crud/view/CrudViewer.es.js +304 -0
- package/dist/crud/view/CrudViewerUtil.cjs.js +1 -0
- package/dist/crud/view/CrudViewerUtil.d.ts +2 -0
- package/dist/crud/view/CrudViewerUtil.es.js +98 -0
- package/dist/crud/view/index.d.ts +5 -0
- package/dist/crud-component.css +6 -0
- package/dist/hooks/NavigatorHooks.cjs.js +1 -0
- package/dist/hooks/NavigatorHooks.d.ts +1 -0
- package/dist/hooks/NavigatorHooks.es.js +9 -0
- package/dist/icons/FlipHIcon.cjs.js +1 -0
- package/dist/icons/FlipHIcon.d.ts +3 -0
- package/dist/icons/FlipHIcon.es.js +28 -0
- package/dist/icons/FlipVIcon.cjs.js +1 -0
- package/dist/icons/FlipVIcon.d.ts +3 -0
- package/dist/icons/FlipVIcon.es.js +28 -0
- package/dist/index.cjs.js +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.es.js +46 -0
- package/dist/locale/hooks/translation-constants.cjs.js +1 -0
- package/dist/locale/hooks/translation-constants.d.ts +1 -0
- package/dist/locale/hooks/translation-constants.es.js +4 -0
- package/dist/locale/index.cjs.js +1 -0
- package/dist/locale/index.d.ts +85 -0
- package/dist/locale/index.es.js +57 -0
- package/dist/locale/translations/en.cjs.js +1 -0
- package/dist/locale/translations/en.d.ts +63 -0
- package/dist/locale/translations/en.es.js +65 -0
- package/dist/package.json +122 -0
- package/dist/types/DialogComponentProp.d.ts +8 -0
- package/dist/types/Id.d.ts +10 -0
- package/dist/util/CrudUtil.cjs.js +1 -0
- package/dist/util/CrudUtil.d.ts +5 -0
- package/dist/util/CrudUtil.es.js +8 -0
- package/dist/util/DateUtil.cjs.js +1 -0
- package/dist/util/DateUtil.d.ts +7 -0
- package/dist/util/DateUtil.es.js +18 -0
- package/dist/util/ImageUtil.cjs.js +1 -0
- package/dist/util/ImageUtil.d.ts +14 -0
- package/dist/util/ImageUtil.es.js +63 -0
- package/dist/util/NumberUtil.cjs.js +1 -0
- package/dist/util/NumberUtil.d.ts +17 -0
- package/dist/util/NumberUtil.es.js +60 -0
- package/dist/util/ValidationUtil.cjs.js +1 -0
- package/dist/util/ValidationUtil.d.ts +14 -0
- package/dist/util/ValidationUtil.es.js +63 -0
- package/dist/util/index.cjs.js +1 -0
- package/dist/util/index.d.ts +4 -0
- package/dist/util/index.es.js +10 -0
- package/dist/vite-env.d.ts +1 -0
- package/package.json +5 -12
- package/release.config.cjs +0 -27
package/dist/Play.d.ts
ADDED
package/dist/README.md
ADDED
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
# @kingteza/crud-component
|
|
2
|
+
|
|
3
|
+
React CRUD component library built with Ant Design and TypeScript.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @kingteza/crud-component
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Prerequisites
|
|
12
|
+
|
|
13
|
+
This library has the following peer dependencies that need to be installed:
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
npm install antd@^5.22.6 react@^18.3.1 react-dom@^18.3.1 react-router-dom@^7.0.0
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Setup
|
|
20
|
+
|
|
21
|
+
### 1. Initialize translations
|
|
22
|
+
|
|
23
|
+
The library uses i18next for internationalization. You need to set it up before using the components:
|
|
24
|
+
|
|
25
|
+
```typescript
|
|
26
|
+
import { setupI18n } from '@kingteza/crud-component';
|
|
27
|
+
|
|
28
|
+
// Basic setup with default English translations
|
|
29
|
+
setupI18n();
|
|
30
|
+
|
|
31
|
+
// Or with custom options
|
|
32
|
+
setupI18n({
|
|
33
|
+
language: 'en', // default language
|
|
34
|
+
translations: {
|
|
35
|
+
en: {
|
|
36
|
+
'crud-component': {
|
|
37
|
+
// your custom translations
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
i18nInstance: existingI18nInstance // optional: use your existing i18n instance
|
|
42
|
+
});
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
### 2. Usage
|
|
46
|
+
|
|
47
|
+
```typescript
|
|
48
|
+
import { CrudComponent } from '@kingteza/crud-component';
|
|
49
|
+
import { Button } from '@kingteza/crud-component/common';
|
|
50
|
+
|
|
51
|
+
function App() {
|
|
52
|
+
return (
|
|
53
|
+
<CrudComponent
|
|
54
|
+
fields={[
|
|
55
|
+
{ type: "text", name: "name", label: "Name", required: true },
|
|
56
|
+
{ type: "select", name: "status", label: "Status", options: [
|
|
57
|
+
{ value: "active", label: "Active" },
|
|
58
|
+
{ value: "inactive", label: "Inactive" }
|
|
59
|
+
]}
|
|
60
|
+
]}
|
|
61
|
+
data={[]}
|
|
62
|
+
onSave={(data) => console.log(data)}
|
|
63
|
+
/>
|
|
64
|
+
);
|
|
65
|
+
}
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
### 3. Available Imports
|
|
69
|
+
|
|
70
|
+
The library provides several entry points for importing components:
|
|
71
|
+
|
|
72
|
+
```typescript
|
|
73
|
+
// Main CRUD component
|
|
74
|
+
import { CrudComponent } from '@kingteza/crud-component';
|
|
75
|
+
|
|
76
|
+
// Common components
|
|
77
|
+
import { Button, Select, DatePicker } from '@kingteza/crud-component/common';
|
|
78
|
+
|
|
79
|
+
// Utility functions
|
|
80
|
+
import { DateUtil } from '@kingteza/crud-component/util';
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
## Documentation
|
|
84
|
+
|
|
85
|
+
For detailed documentation of components and their props, please visit our [GitHub repository](https://github.com/kingteza/crud-component).
|
|
86
|
+
|
|
87
|
+
## License
|
|
88
|
+
|
|
89
|
+
MIT
|
|
@@ -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 @@
|
|
|
1
|
+
export { default as Hider } from './Hider';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const l=require("react/jsx-runtime"),d=require("antd"),s=require("react"),j=require("../../locale/index.cjs.js");;/* empty css */const x=require("../../hooks/NavigatorHooks.cjs.js"),y=s.forwardRef(({className:r,to:n,onClick:e,tooltip:a,...t},u)=>{const{t:i}=j.useTranslationLib(),o=x.useNavigateOptional(),c=s.useMemo(()=>l.jsx(d.Button,{ref:u,onClick:e??(n&&o?()=>o(n):void 0),className:r,...t,children:t.children}),[r,o,e,t,i,n]);return a?l.jsx(d.Tooltip,{title:a,children:c}):c}),q=s.forwardRef(({className:r,to:n,onClick:e,tooltip:a,...t},u)=>{const i=x.useNavigateOptional(),[o,c]=s.useState(!1),f=s.useCallback(async h=>{try{return c(!0),await e(h)}finally{c(!1)}},[e]),g=s.useMemo(()=>l.jsx(d.Button,{ref:u,loading:o||t.loading,onClick:e?f:n?()=>{i?i==null||i(n):window.location.href=n}:void 0,className:r,...t}),[f,r,o,i,e,t,n,u]);return a?l.jsx(d.Tooltip,{title:a,children:g}):g});q.displayName="ButtonComponent.Async";y.Async=q;module.exports=y;
|
|
@@ -0,0 +1,11 @@
|
|
|
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
|
+
}
|
|
7
|
+
type ComponentType = React.ForwardRefExoticComponent<ButtonComponentProps & React.RefAttributes<HTMLElement>> & {
|
|
8
|
+
Async: React.ForwardRefExoticComponent<ButtonComponentProps & React.RefAttributes<HTMLElement>>;
|
|
9
|
+
};
|
|
10
|
+
declare const _default: ComponentType;
|
|
11
|
+
export default _default;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { jsx as c } from "react/jsx-runtime";
|
|
2
|
+
import { Button as u, Tooltip as f } from "antd";
|
|
3
|
+
import { forwardRef as y, useMemo as g, useState as v, useCallback as A } from "react";
|
|
4
|
+
import { useTranslationLib as B } from "../../locale/index.es.js";
|
|
5
|
+
/* empty css */
|
|
6
|
+
import { useNavigateOptional as h } from "../../hooks/NavigatorHooks.es.js";
|
|
7
|
+
const p = y(
|
|
8
|
+
({ className: r, to: n, onClick: t, tooltip: a, ...o }, l) => {
|
|
9
|
+
const { t: e } = B(), i = h(), s = g(
|
|
10
|
+
() => /* @__PURE__ */ c(
|
|
11
|
+
u,
|
|
12
|
+
{
|
|
13
|
+
ref: l,
|
|
14
|
+
onClick: t ?? (n && i ? () => i(n) : void 0),
|
|
15
|
+
className: r,
|
|
16
|
+
...o,
|
|
17
|
+
children: o.children
|
|
18
|
+
}
|
|
19
|
+
),
|
|
20
|
+
[r, i, t, o, e, n]
|
|
21
|
+
);
|
|
22
|
+
return a ? /* @__PURE__ */ c(f, { title: a, children: s }) : s;
|
|
23
|
+
}
|
|
24
|
+
), b = y(
|
|
25
|
+
({ className: r, to: n, onClick: t, tooltip: a, ...o }, l) => {
|
|
26
|
+
const e = h(), [i, s] = v(!1), d = A(
|
|
27
|
+
async (w) => {
|
|
28
|
+
try {
|
|
29
|
+
return s(!0), await t(w);
|
|
30
|
+
} finally {
|
|
31
|
+
s(!1);
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
[t]
|
|
35
|
+
), m = g(
|
|
36
|
+
() => /* @__PURE__ */ c(
|
|
37
|
+
u,
|
|
38
|
+
{
|
|
39
|
+
ref: l,
|
|
40
|
+
loading: i || o.loading,
|
|
41
|
+
onClick: t ? d : n ? () => {
|
|
42
|
+
e ? e == null || e(n) : window.location.href = n;
|
|
43
|
+
} : void 0,
|
|
44
|
+
className: r,
|
|
45
|
+
...o
|
|
46
|
+
}
|
|
47
|
+
),
|
|
48
|
+
[d, r, i, e, t, o, n, l]
|
|
49
|
+
);
|
|
50
|
+
return a ? /* @__PURE__ */ c(f, { title: a, children: m }) : m;
|
|
51
|
+
}
|
|
52
|
+
);
|
|
53
|
+
b.displayName = "ButtonComponent.Async";
|
|
54
|
+
p.Async = b;
|
|
55
|
+
export {
|
|
56
|
+
p as default
|
|
57
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const n=require("react/jsx-runtime"),i=require("@ant-design/icons"),r=require("./Button.cjs.js"),s=require("../../locale/index.cjs.js");function u({value:t,onClick:e}){const{t:o}=s.useTranslationLib();return n.jsx(r,{type:"link",onClick:()=>e(t),icon:n.jsx(i.CopyOutlined,{}),tooltip:o("clone")})}module.exports=u;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { CopyOutlined as r } from "@ant-design/icons";
|
|
3
|
+
import e from "./Button.es.js";
|
|
4
|
+
import { useTranslationLib as l } from "../../locale/index.es.js";
|
|
5
|
+
function a({ value: t, onClick: n }) {
|
|
6
|
+
const { t: i } = l();
|
|
7
|
+
return /* @__PURE__ */ o(
|
|
8
|
+
e,
|
|
9
|
+
{
|
|
10
|
+
type: "link",
|
|
11
|
+
onClick: () => n(t),
|
|
12
|
+
icon: /* @__PURE__ */ o(r, {}),
|
|
13
|
+
tooltip: i("clone")
|
|
14
|
+
}
|
|
15
|
+
);
|
|
16
|
+
}
|
|
17
|
+
export {
|
|
18
|
+
a as default
|
|
19
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const e=require("react/jsx-runtime"),p=require("@ant-design/icons"),g=require("antd"),n=require("react"),q=require("./Button.cjs.js"),C=require("../../locale/index.cjs.js");function T({shouldConfirm:j=!0,block:r,value:i,loading:u,onClick:c,text:l,disabled:a,type:d="link"}){const{t}=C.useTranslationLib(),o=n.useMemo(()=>l??t("str.delete"),[l,t]),[f,s]=n.useState(!1);n.useEffect(()=>{s(u??!1)},[u]);const x=n.useCallback(async()=>{try{s(!0),await c(i)}finally{s(!1)}},[c,i]);return j?e.jsx(g.Popconfirm,{title:t("qus.doYouWantToDelete"),okText:o.toUpperCase(),cancelText:t("str.no").toUpperCase(),onConfirm:x,children:e.jsx(q,{tooltip:o,icon:e.jsx(p.DeleteOutlined,{}),disabled:a,loading:f,type:d,danger:!0,block:r})}):e.jsx(q,{tooltip:o,icon:e.jsx(p.DeleteOutlined,{}),disabled:a,loading:f,type:d,danger:!0,block:r,onClick:x})}module.exports=T;
|
|
@@ -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,64 @@
|
|
|
1
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { DeleteOutlined as p } from "@ant-design/icons";
|
|
3
|
+
import { Popconfirm as g } from "antd";
|
|
4
|
+
import { useMemo as T, useState as x, useEffect as k, useCallback as D } from "react";
|
|
5
|
+
import d from "./Button.es.js";
|
|
6
|
+
import { useTranslationLib as _ } from "../../locale/index.es.js";
|
|
7
|
+
function q({
|
|
8
|
+
shouldConfirm: C = !0,
|
|
9
|
+
block: r,
|
|
10
|
+
value: i,
|
|
11
|
+
loading: a,
|
|
12
|
+
onClick: l,
|
|
13
|
+
text: s,
|
|
14
|
+
disabled: f,
|
|
15
|
+
type: u = "link"
|
|
16
|
+
}) {
|
|
17
|
+
const { t: o } = _(), e = T(() => s ?? o("str.delete"), [s, o]), [m, n] = x(!1);
|
|
18
|
+
k(() => {
|
|
19
|
+
n(a ?? !1);
|
|
20
|
+
}, [a]);
|
|
21
|
+
const c = D(async () => {
|
|
22
|
+
try {
|
|
23
|
+
n(!0), await l(i);
|
|
24
|
+
} finally {
|
|
25
|
+
n(!1);
|
|
26
|
+
}
|
|
27
|
+
}, [l, i]);
|
|
28
|
+
return C ? /* @__PURE__ */ t(
|
|
29
|
+
g,
|
|
30
|
+
{
|
|
31
|
+
title: o("qus.doYouWantToDelete"),
|
|
32
|
+
okText: e.toUpperCase(),
|
|
33
|
+
cancelText: o("str.no").toUpperCase(),
|
|
34
|
+
onConfirm: c,
|
|
35
|
+
children: /* @__PURE__ */ t(
|
|
36
|
+
d,
|
|
37
|
+
{
|
|
38
|
+
tooltip: e,
|
|
39
|
+
icon: /* @__PURE__ */ t(p, {}),
|
|
40
|
+
disabled: f,
|
|
41
|
+
loading: m,
|
|
42
|
+
type: u,
|
|
43
|
+
danger: !0,
|
|
44
|
+
block: r
|
|
45
|
+
}
|
|
46
|
+
)
|
|
47
|
+
}
|
|
48
|
+
) : /* @__PURE__ */ t(
|
|
49
|
+
d,
|
|
50
|
+
{
|
|
51
|
+
tooltip: e,
|
|
52
|
+
icon: /* @__PURE__ */ t(p, {}),
|
|
53
|
+
disabled: f,
|
|
54
|
+
loading: m,
|
|
55
|
+
type: u,
|
|
56
|
+
danger: !0,
|
|
57
|
+
block: r,
|
|
58
|
+
onClick: c
|
|
59
|
+
}
|
|
60
|
+
);
|
|
61
|
+
}
|
|
62
|
+
export {
|
|
63
|
+
q as default
|
|
64
|
+
};
|
|
@@ -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"),l=require("../../locale/index.cjs.js"),a=require("./Button.cjs.js");function x({value:t,onClick:e}){const[s,n]=r.useState(!1),{t:i}=l.useTranslationLib(),c=r.useCallback(async()=>{n(!0),e(t).finally(()=>n(!1))},[e,t]);return o.jsx(a,{loading:s,type:"link",onClick:c,icon:o.jsx(u.ExportOutlined,{}),tooltip:i("str.export")})}exports.ExportButton=x;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { ExportOutlined as p } from "@ant-design/icons";
|
|
3
|
+
import { useState as l, useCallback as m } from "react";
|
|
4
|
+
import { useTranslationLib as a } from "../../locale/index.es.js";
|
|
5
|
+
import c from "./Button.es.js";
|
|
6
|
+
function y({
|
|
7
|
+
value: t,
|
|
8
|
+
onClick: o
|
|
9
|
+
}) {
|
|
10
|
+
const [i, n] = l(!1), { t: e } = a(), s = m(async () => {
|
|
11
|
+
n(!0), o(t).finally(() => n(!1));
|
|
12
|
+
}, [o, t]);
|
|
13
|
+
return /* @__PURE__ */ r(
|
|
14
|
+
c,
|
|
15
|
+
{
|
|
16
|
+
loading: i,
|
|
17
|
+
type: "link",
|
|
18
|
+
onClick: s,
|
|
19
|
+
icon: /* @__PURE__ */ r(p, {}),
|
|
20
|
+
tooltip: e("str.export")
|
|
21
|
+
}
|
|
22
|
+
);
|
|
23
|
+
}
|
|
24
|
+
export {
|
|
25
|
+
y as ExportButton
|
|
26
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const e=require("react/jsx-runtime"),p=require("@ant-design/icons"),j=require("antd"),n=require("react"),g=require("../../locale/index.cjs.js"),q=require("./Button.cjs.js");function T({shouldConfirm:C=!0,block:i,value:s,loading:c,onClick:u,text:a,disabled:l,type:d="link"}){const{t}=g.useTranslationLib(),o=n.useMemo(()=>a??t("str.hide"),[a,t]),[f,r]=n.useState(!1);n.useEffect(()=>{r(c??!1)},[c]);const x=n.useCallback(async()=>{try{r(!0),await u(s)}finally{r(!1)}},[u,s]);return C?e.jsx(j.Popconfirm,{title:t("qus.doYouWantToHide"),okText:o.toUpperCase(),cancelText:t("str.no").toUpperCase(),onConfirm:x,children:e.jsx(q,{tooltip:o,icon:e.jsx(p.DownCircleOutlined,{}),disabled:l,loading:f,type:d,danger:!0,block:i})}):e.jsx(q,{tooltip:o,icon:e.jsx(p.DownCircleOutlined,{}),disabled:l,loading:f,type:d,danger:!0,block:i,onClick:x})}module.exports=T;
|
|
@@ -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,67 @@
|
|
|
1
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { DownCircleOutlined as p } from "@ant-design/icons";
|
|
3
|
+
import { Popconfirm as g } from "antd";
|
|
4
|
+
import { useMemo as T, useState as x, useEffect as k, useCallback as _ } from "react";
|
|
5
|
+
import { useTranslationLib as h } from "../../locale/index.es.js";
|
|
6
|
+
import d from "./Button.es.js";
|
|
7
|
+
function j({
|
|
8
|
+
shouldConfirm: C = !0,
|
|
9
|
+
block: r,
|
|
10
|
+
value: i,
|
|
11
|
+
loading: a,
|
|
12
|
+
onClick: s,
|
|
13
|
+
text: l,
|
|
14
|
+
disabled: f,
|
|
15
|
+
type: u = "link"
|
|
16
|
+
}) {
|
|
17
|
+
const { t } = h(), e = T(() => l ?? t("str.hide"), [l, t]), [m, n] = x(!1);
|
|
18
|
+
k(() => {
|
|
19
|
+
n(a ?? !1);
|
|
20
|
+
}, [a]);
|
|
21
|
+
const c = _(
|
|
22
|
+
async () => {
|
|
23
|
+
try {
|
|
24
|
+
n(!0), await s(i);
|
|
25
|
+
} finally {
|
|
26
|
+
n(!1);
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
[s, i]
|
|
30
|
+
);
|
|
31
|
+
return C ? /* @__PURE__ */ o(
|
|
32
|
+
g,
|
|
33
|
+
{
|
|
34
|
+
title: t("qus.doYouWantToHide"),
|
|
35
|
+
okText: e.toUpperCase(),
|
|
36
|
+
cancelText: t("str.no").toUpperCase(),
|
|
37
|
+
onConfirm: c,
|
|
38
|
+
children: /* @__PURE__ */ o(
|
|
39
|
+
d,
|
|
40
|
+
{
|
|
41
|
+
tooltip: e,
|
|
42
|
+
icon: /* @__PURE__ */ o(p, {}),
|
|
43
|
+
disabled: f,
|
|
44
|
+
loading: m,
|
|
45
|
+
type: u,
|
|
46
|
+
danger: !0,
|
|
47
|
+
block: r
|
|
48
|
+
}
|
|
49
|
+
)
|
|
50
|
+
}
|
|
51
|
+
) : /* @__PURE__ */ o(
|
|
52
|
+
d,
|
|
53
|
+
{
|
|
54
|
+
tooltip: e,
|
|
55
|
+
icon: /* @__PURE__ */ o(p, {}),
|
|
56
|
+
disabled: f,
|
|
57
|
+
loading: m,
|
|
58
|
+
type: u,
|
|
59
|
+
danger: !0,
|
|
60
|
+
block: r,
|
|
61
|
+
onClick: c
|
|
62
|
+
}
|
|
63
|
+
);
|
|
64
|
+
}
|
|
65
|
+
export {
|
|
66
|
+
j as default
|
|
67
|
+
};
|
|
@@ -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"),x=require("../../locale/index.cjs.js"),b=require("./Button.cjs.js");function q({onClick:o,children:c,accept:u,className:l,disabled:a,type:d="link"}){const[f,i]=n.useState(!1),{t:p}=x.useTranslationLib(),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:l,children:[s.jsx("input",{type:"file",style:{display:"none"},ref:e,onChange:j,accept:u},g),s.jsx(b,{loading:f,type:d,disabled:a,onClick:y,icon:s.jsx(k.ImportOutlined,{}),tooltip:p("str.import"),children:c})]})}exports.ImportButton=q;
|
|
@@ -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;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { jsxs as h, jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import { ImportOutlined as x } from "@ant-design/icons";
|
|
3
|
+
import { useState as s, useRef as b, useCallback as l } from "react";
|
|
4
|
+
import { useTranslationLib as j } from "../../locale/index.es.js";
|
|
5
|
+
import B from "./Button.es.js";
|
|
6
|
+
function I({
|
|
7
|
+
onClick: e,
|
|
8
|
+
children: c,
|
|
9
|
+
accept: a,
|
|
10
|
+
className: m,
|
|
11
|
+
disabled: u,
|
|
12
|
+
type: f = "link"
|
|
13
|
+
}) {
|
|
14
|
+
const [p, i] = s(!1), { t: d } = j(), o = b(null), y = l(() => {
|
|
15
|
+
k((t) => t + 1), o.current && setTimeout(() => {
|
|
16
|
+
var t;
|
|
17
|
+
(t = o == null ? void 0 : o.current) == null || t.click();
|
|
18
|
+
}, 10);
|
|
19
|
+
}, []), [g, k] = s(0), C = l(
|
|
20
|
+
async (t) => {
|
|
21
|
+
i(!0);
|
|
22
|
+
const r = t.target.files[0];
|
|
23
|
+
r && await e(r), i(!1);
|
|
24
|
+
},
|
|
25
|
+
[e]
|
|
26
|
+
);
|
|
27
|
+
return /* @__PURE__ */ h("div", { className: m, children: [
|
|
28
|
+
/* @__PURE__ */ n(
|
|
29
|
+
"input",
|
|
30
|
+
{
|
|
31
|
+
type: "file",
|
|
32
|
+
style: { display: "none" },
|
|
33
|
+
ref: o,
|
|
34
|
+
onChange: C,
|
|
35
|
+
accept: a
|
|
36
|
+
},
|
|
37
|
+
g
|
|
38
|
+
),
|
|
39
|
+
/* @__PURE__ */ n(
|
|
40
|
+
B,
|
|
41
|
+
{
|
|
42
|
+
loading: p,
|
|
43
|
+
type: f,
|
|
44
|
+
disabled: u,
|
|
45
|
+
onClick: y,
|
|
46
|
+
icon: /* @__PURE__ */ n(x, {}),
|
|
47
|
+
tooltip: d("str.import"),
|
|
48
|
+
children: c
|
|
49
|
+
}
|
|
50
|
+
)
|
|
51
|
+
] });
|
|
52
|
+
}
|
|
53
|
+
export {
|
|
54
|
+
I as ImportButton
|
|
55
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),l=require("@ant-design/icons"),a=require("../../locale/index.cjs.js"),d=require("./Button.cjs.js"),j=({size:n,block:r,className:o,type:u="primary",onClick:e,title:i,to:s})=>{const{t:c}=a.useTranslationLib();return t.jsx(d,{type:u,className:o,to:s,block:r,size:n,onClick:e&&(()=>e(!0)),icon:t.jsx(l.PlusOutlined,{}),children:i??c("str.new")})};exports.NewButton=j;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { SizeType } from 'antd/es/config-provider/SizeContext';
|
|
2
|
+
import { ButtonType } from 'antd/lib/button';
|
|
3
|
+
import { FC } from 'react';
|
|
4
|
+
export declare const NewButton: FC<{
|
|
5
|
+
to?: string;
|
|
6
|
+
onClick?: (value: boolean) => void;
|
|
7
|
+
title?: string;
|
|
8
|
+
type?: ButtonType;
|
|
9
|
+
block?: boolean;
|
|
10
|
+
className?: string;
|
|
11
|
+
size?: SizeType;
|
|
12
|
+
}>;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { PlusOutlined as u } from "@ant-design/icons";
|
|
3
|
+
import { useTranslationLib as c } from "../../locale/index.es.js";
|
|
4
|
+
import f from "./Button.es.js";
|
|
5
|
+
const x = ({ size: r, block: n, className: i, type: m = "primary", onClick: t, title: e, to: p }) => {
|
|
6
|
+
const { t: s } = c();
|
|
7
|
+
return /* @__PURE__ */ o(
|
|
8
|
+
f,
|
|
9
|
+
{
|
|
10
|
+
type: m,
|
|
11
|
+
className: i,
|
|
12
|
+
to: p,
|
|
13
|
+
block: n,
|
|
14
|
+
size: r,
|
|
15
|
+
onClick: t && (() => t(!0)),
|
|
16
|
+
icon: /* @__PURE__ */ o(u, {}),
|
|
17
|
+
children: e ?? s("str.new")
|
|
18
|
+
}
|
|
19
|
+
);
|
|
20
|
+
};
|
|
21
|
+
export {
|
|
22
|
+
x as NewButton
|
|
23
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),d=require("@ant-design/icons"),p=require("../../locale/index.cjs.js"),j=require("./Button.cjs.js"),m=({disabled:e,loading:i,block:o,className:s,type:u="primary",onClick:c,title:l,to:a})=>{const{t:r}=p.useTranslationLib(),t=l??r("str.print");return n.jsx(j,{type:u,className:s,to:a,loading:i,disabled:e,block:o,onClick:c,tooltip:t!=null&&t.trim()?"":r("str.print"),icon:n.jsx(d.PrinterOutlined,{}),children:t})};exports.PrintButton=m;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ButtonType } from 'antd/lib/button';
|
|
2
|
+
import { FC } from 'react';
|
|
3
|
+
export declare const PrintButton: FC<{
|
|
4
|
+
to?: string;
|
|
5
|
+
loading?: boolean;
|
|
6
|
+
onClick?: () => void;
|
|
7
|
+
title?: string;
|
|
8
|
+
type?: ButtonType;
|
|
9
|
+
block?: boolean;
|
|
10
|
+
className?: string;
|
|
11
|
+
disabled?: boolean;
|
|
12
|
+
}>;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { PrinterOutlined as f } from "@ant-design/icons";
|
|
3
|
+
import { useTranslationLib as a } from "../../locale/index.es.js";
|
|
4
|
+
import l from "./Button.es.js";
|
|
5
|
+
const b = ({ disabled: n, loading: i, block: m, className: p, type: s = "primary", onClick: e, title: c, to: u }) => {
|
|
6
|
+
const { t: r } = a(), t = c ?? r("str.print");
|
|
7
|
+
return /* @__PURE__ */ o(
|
|
8
|
+
l,
|
|
9
|
+
{
|
|
10
|
+
type: s,
|
|
11
|
+
className: p,
|
|
12
|
+
to: u,
|
|
13
|
+
loading: i,
|
|
14
|
+
disabled: n,
|
|
15
|
+
block: m,
|
|
16
|
+
onClick: e,
|
|
17
|
+
tooltip: t != null && t.trim() ? "" : r("str.print"),
|
|
18
|
+
icon: /* @__PURE__ */ o(f, {}),
|
|
19
|
+
children: t
|
|
20
|
+
}
|
|
21
|
+
);
|
|
22
|
+
};
|
|
23
|
+
export {
|
|
24
|
+
b as PrintButton
|
|
25
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),l=require("@ant-design/icons"),a=require("../../locale/index.cjs.js"),d=require("./Button.cjs.js"),f=({disabled:r,block:n,className:o,type:s="primary",onClick:e,title:i,to:u})=>{const{t:c}=a.useTranslationLib();return t.jsx(d,{type:s,disabled:r,className:o,to:u,block:n,onClick:e&&(()=>e(!0)),icon:t.jsx(l.ReloadOutlined,{}),children:i??c("str.refresh")})};exports.RefreshButton=f;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ButtonType } from 'antd/lib/button';
|
|
2
|
+
import { FC } from 'react';
|
|
3
|
+
export declare const RefreshButton: FC<{
|
|
4
|
+
to?: string;
|
|
5
|
+
onClick?: (value: boolean) => void;
|
|
6
|
+
title?: string;
|
|
7
|
+
type?: ButtonType;
|
|
8
|
+
block?: boolean;
|
|
9
|
+
className?: string;
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
}>;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { ReloadOutlined as f } from "@ant-design/icons";
|
|
3
|
+
import { useTranslationLib as u } from "../../locale/index.es.js";
|
|
4
|
+
import a from "./Button.es.js";
|
|
5
|
+
const x = ({ disabled: t, block: e, className: n, type: i = "primary", onClick: r, title: m, to: s }) => {
|
|
6
|
+
const { t: p } = u();
|
|
7
|
+
return /* @__PURE__ */ o(
|
|
8
|
+
a,
|
|
9
|
+
{
|
|
10
|
+
type: i,
|
|
11
|
+
disabled: t,
|
|
12
|
+
className: n,
|
|
13
|
+
to: s,
|
|
14
|
+
block: e,
|
|
15
|
+
onClick: r && (() => r(!0)),
|
|
16
|
+
icon: /* @__PURE__ */ o(f, {}),
|
|
17
|
+
children: m ?? p("str.refresh")
|
|
18
|
+
}
|
|
19
|
+
);
|
|
20
|
+
};
|
|
21
|
+
export {
|
|
22
|
+
x as RefreshButton
|
|
23
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const e=require("react/jsx-runtime"),p=require("@ant-design/icons"),g=require("antd"),n=require("react"),U=require("../../locale/index.cjs.js"),q=require("./Button.cjs.js");function m({shouldConfirm:C=!0,block:i,value:s,loading:u,onClick:c,text:a,disabled:l,type:d="link",hidden:j}){const{t}=U.useTranslationLib(),o=n.useMemo(()=>a??t("str.unhide"),[a,t]),[f,r]=n.useState(!1);n.useEffect(()=>{r(u??!1)},[u]);const x=n.useCallback(async()=>{try{r(!0),await c(s)}finally{r(!1)}},[c,s]);return C?e.jsx(g.Popconfirm,{title:t("qus.doYouWantToHide"),okText:o.toUpperCase(),cancelText:t("str.no").toUpperCase(),onConfirm:x,children:e.jsx(q,{tooltip:o,icon:e.jsx(p.UpCircleOutlined,{}),disabled:l,loading:f,type:d,danger:!0,hidden:j,block:i})}):e.jsx(q,{tooltip:o,icon:e.jsx(p.UpCircleOutlined,{}),disabled:l,loading:f,type:d,danger:!0,block:i,onClick:x})}module.exports=m;
|
|
@@ -0,0 +1,14 @@
|
|
|
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
|
+
hidden?: boolean;
|
|
12
|
+
}
|
|
13
|
+
declare function UnHideButton<T>({ shouldConfirm, block, value, loading, onClick, text, disabled, type, hidden }: Props<T>): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export default UnHideButton;
|