@kingteza/crud-component 1.2.1 → 1.2.3
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/App.d.ts +151 -0
- package/dist/Play.d.ts +2 -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/main.d.ts +0 -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/dist/vite.svg +1 -0
- package/package.json +14 -22
- package/release.config.cjs +0 -27
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { jsx as l } from "react/jsx-runtime";
|
|
2
|
+
/* empty css */
|
|
3
|
+
/* empty css */
|
|
4
|
+
import { Form as a } from "antd";
|
|
5
|
+
import V, { useState as g, useEffect as u, useMemo as w, Suspense as F } from "react";
|
|
6
|
+
import x from "../../util/ValidationUtil.es.js";
|
|
7
|
+
const R = V.lazy(async () => {
|
|
8
|
+
const { default: e } = await import("react-quill");
|
|
9
|
+
return { default: (o) => /* @__PURE__ */ l(e, { ...o }) };
|
|
10
|
+
}), S = ({
|
|
11
|
+
name: e,
|
|
12
|
+
label: o,
|
|
13
|
+
required: d,
|
|
14
|
+
rules: c = [],
|
|
15
|
+
disabled: p
|
|
16
|
+
}) => {
|
|
17
|
+
const r = a.useFormInstance(), [n, s] = g(""), m = {
|
|
18
|
+
toolbar: [
|
|
19
|
+
["bold", "italic", "underline", "strike", "blockquote"],
|
|
20
|
+
[{ list: "ordered" }, { list: "bullet" }],
|
|
21
|
+
["link"],
|
|
22
|
+
["clean"]
|
|
23
|
+
]
|
|
24
|
+
}, f = [
|
|
25
|
+
"bold",
|
|
26
|
+
"italic",
|
|
27
|
+
"underline",
|
|
28
|
+
"strike",
|
|
29
|
+
"blockquote",
|
|
30
|
+
"list",
|
|
31
|
+
"bullet",
|
|
32
|
+
"link"
|
|
33
|
+
];
|
|
34
|
+
u(() => {
|
|
35
|
+
const t = r.getFieldValue(e);
|
|
36
|
+
t && t !== "<p></p>" && t !== "<p><br></p>" && s(t);
|
|
37
|
+
}, [r, e]);
|
|
38
|
+
const i = a.useWatch(e, r);
|
|
39
|
+
u(() => {
|
|
40
|
+
i !== n && s(!i || i === "<p></p>" || i === "<p><br></p>" ? "" : i);
|
|
41
|
+
}, [i, n]);
|
|
42
|
+
const h = (t) => {
|
|
43
|
+
s(t);
|
|
44
|
+
const k = !t || t === "<p></p>" || t.trim() === "<p><br></p>" ? void 0 : t;
|
|
45
|
+
r.setFieldValue(e, k), r.validateFields([e]).catch(() => {
|
|
46
|
+
});
|
|
47
|
+
}, b = w(
|
|
48
|
+
() => d ? [...c, ...x.required(o ?? "")] : c,
|
|
49
|
+
[d, c, o]
|
|
50
|
+
);
|
|
51
|
+
return /* @__PURE__ */ l(a.Item, { name: e, label: o, rules: b, children: /* @__PURE__ */ l(F, { fallback: /* @__PURE__ */ l("div", { children: "Loading editor..." }), children: /* @__PURE__ */ l(
|
|
52
|
+
R,
|
|
53
|
+
{
|
|
54
|
+
readOnly: p,
|
|
55
|
+
value: n,
|
|
56
|
+
onChange: h,
|
|
57
|
+
theme: "snow",
|
|
58
|
+
className: "bg-white dark:!bg-[#141414] dark:text-white dark:!fill-white",
|
|
59
|
+
modules: m,
|
|
60
|
+
formats: f
|
|
61
|
+
}
|
|
62
|
+
) }) });
|
|
63
|
+
};
|
|
64
|
+
export {
|
|
65
|
+
S as RichTextEditor
|
|
66
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const t=require("react/jsx-runtime"),s=require("antd"),n=s.List.Item.Meta,r=s.List.Item,o=({title:e,description:i,children:c})=>t.jsxs(r,{className:"",children:[t.jsx("div",{children:t.jsx(n,{title:e,description:i})}),t.jsx("div",{className:"float-right",children:c})]});module.exports=o;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { jsxs as r, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { List as e } from "antd";
|
|
3
|
+
const a = e.Item.Meta, i = e.Item, n = ({
|
|
4
|
+
title: s,
|
|
5
|
+
description: o,
|
|
6
|
+
children: m
|
|
7
|
+
}) => /* @__PURE__ */ r(i, { className: "", children: [
|
|
8
|
+
/* @__PURE__ */ t("div", { children: /* @__PURE__ */ t(a, { title: s, description: o }) }),
|
|
9
|
+
/* @__PURE__ */ t("div", { className: "float-right", children: m })
|
|
10
|
+
] });
|
|
11
|
+
export {
|
|
12
|
+
n as default
|
|
13
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const n=require("react/jsx-runtime"),l=require("antd"),O=require("react"),V=require("../../locale/index.cjs.js"),B=require("../tooltip/TooltipComponent.cjs.js"),D=require("../../util/ValidationUtil.cjs.js");function E({label:a,rules:S=[],required:h,placeholder:x,notSearch:L,children:f,readOnly:s,items:o,dropdownRender:p,itemBuilder:q,loading:m,showLoadingInEmptyIndicator:T,nameFieldInArray:u="name",innerRef:_,tooltip:b,filterOption:N,tagRender:R,...r}){const{t:P}=V.useTranslationLib(),k=O.useCallback(e=>{const t=typeof e=="string"||typeof e=="number"?e:e==null?void 0:e.id,c=typeof e=="string"||typeof e=="number"?e:e==null?void 0:e[u];return n.jsx("option",{value:t,children:n.jsx("div",{dangerouslySetInnerHTML:{__html:c}})},t)},[u]),F=a??x??"";return n.jsx(l.ConfigProvider,{renderEmpty:T&&m?()=>n.jsx(l.Spin,{}):void 0,children:n.jsx(B,{title:b,children:n.jsx(l.Form.Item,{label:a,name:r.name,help:r.help,className:r.className,required:h,rules:[...S,...h?D.required(F):[]],children:n.jsx(l.Select,{ref:_,loading:m,open:s?!1:void 0,onChange:!s&&r.onChange,allowClear:!s&&r.allowClear,showSearch:!L,className:`max-width ${s?"readOnly":""}`,...r,tagRender:R,placeholder:x??a,filterOption:N??((e,t)=>{var c,g,C,j;try{const i=(C=(g=(c=t==null?void 0:t.children)==null?void 0:c.props)==null?void 0:g.dangerouslySetInnerHTML)==null?void 0:C.__html,H=e.toLowerCase().split(/\s+/),y=(t==null?void 0:t.children)??"",w=typeof y=="string"?y.toLowerCase():typeof i=="string"?i.toLowerCase():"",I=(((j=t==null?void 0:t.value)==null?void 0:j.toString())??"").toLowerCase(),M=w.replace(/\s/g,"");return H.every(d=>w.indexOf(d)>=0||I.indexOf(d)>=0||M.indexOf(d)>=0)}catch(i){return console.log(i),!0}}),popupRender:p,children:f===null?void 0:f??(o?o==null?void 0:o.map(q??k):n.jsx(n.Fragment,{}))})})})})}module.exports=E;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { FormItemProps, SelectProps } from 'antd';
|
|
2
|
+
import { RefSelectProps } from 'antd/lib/select';
|
|
3
|
+
import { ReactElement } from 'react';
|
|
4
|
+
export type SelectTagRenderProps = SelectProps["tagRender"];
|
|
5
|
+
interface SelectComponentProps<T> extends SelectProps<any>, FormItemProps<any> {
|
|
6
|
+
children?: any[] | null;
|
|
7
|
+
required?: boolean;
|
|
8
|
+
notSearch?: boolean;
|
|
9
|
+
readOnly?: boolean;
|
|
10
|
+
status?: any;
|
|
11
|
+
nameFieldInArray?: string;
|
|
12
|
+
items?: T[];
|
|
13
|
+
showLoadingInEmptyIndicator?: boolean;
|
|
14
|
+
itemBuilder?: (t: T) => ReactElement;
|
|
15
|
+
dropdownRender?: (menu: ReactElement) => ReactElement;
|
|
16
|
+
innerRef?: React.Ref<RefSelectProps>;
|
|
17
|
+
filterOption?: SelectProps["filterOption"];
|
|
18
|
+
tagRender?: SelectTagRenderProps;
|
|
19
|
+
}
|
|
20
|
+
declare function SelectComponent<T = any>({ label, rules, required, placeholder, notSearch, children, readOnly, items, dropdownRender, itemBuilder, loading, showLoadingInEmptyIndicator, nameFieldInArray, innerRef, tooltip, filterOption, tagRender, ...props }: Readonly<SelectComponentProps<T>>): import("react/jsx-runtime").JSX.Element;
|
|
21
|
+
export default SelectComponent;
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { jsx as t, Fragment as j } from "react/jsx-runtime";
|
|
2
|
+
import { ConfigProvider as B, Form as D, Select as E, Spin as P } from "antd";
|
|
3
|
+
import { useCallback as R } from "react";
|
|
4
|
+
import { useTranslationLib as U } from "../../locale/index.es.js";
|
|
5
|
+
import W from "../tooltip/TooltipComponent.es.js";
|
|
6
|
+
import $ from "../../util/ValidationUtil.es.js";
|
|
7
|
+
function Y({
|
|
8
|
+
label: m,
|
|
9
|
+
rules: S = [],
|
|
10
|
+
required: f,
|
|
11
|
+
placeholder: a,
|
|
12
|
+
notSearch: L,
|
|
13
|
+
children: d,
|
|
14
|
+
readOnly: o,
|
|
15
|
+
items: s,
|
|
16
|
+
dropdownRender: u,
|
|
17
|
+
itemBuilder: T,
|
|
18
|
+
loading: h,
|
|
19
|
+
showLoadingInEmptyIndicator: _,
|
|
20
|
+
nameFieldInArray: g = "name",
|
|
21
|
+
innerRef: b,
|
|
22
|
+
tooltip: N,
|
|
23
|
+
filterOption: k,
|
|
24
|
+
tagRender: F,
|
|
25
|
+
...n
|
|
26
|
+
}) {
|
|
27
|
+
const { t: q } = U(), H = R(
|
|
28
|
+
(e) => {
|
|
29
|
+
const r = typeof e == "string" || typeof e == "number" ? e : e == null ? void 0 : e.id, c = typeof e == "string" || typeof e == "number" ? e : e == null ? void 0 : e[g];
|
|
30
|
+
return /* @__PURE__ */ t("option", { value: r, children: /* @__PURE__ */ t("div", { dangerouslySetInnerHTML: { __html: c } }) }, r);
|
|
31
|
+
},
|
|
32
|
+
[g]
|
|
33
|
+
), I = m ?? a ?? "";
|
|
34
|
+
return /* @__PURE__ */ t(
|
|
35
|
+
B,
|
|
36
|
+
{
|
|
37
|
+
renderEmpty: _ && h ? () => /* @__PURE__ */ t(P, {}) : void 0,
|
|
38
|
+
children: /* @__PURE__ */ t(W, { title: N, children: /* @__PURE__ */ t(
|
|
39
|
+
D.Item,
|
|
40
|
+
{
|
|
41
|
+
label: m,
|
|
42
|
+
name: n.name,
|
|
43
|
+
help: n.help,
|
|
44
|
+
className: n.className,
|
|
45
|
+
required: f,
|
|
46
|
+
rules: [
|
|
47
|
+
...S,
|
|
48
|
+
...f ? $.required(I) : []
|
|
49
|
+
],
|
|
50
|
+
children: /* @__PURE__ */ t(
|
|
51
|
+
E,
|
|
52
|
+
{
|
|
53
|
+
ref: b,
|
|
54
|
+
loading: h,
|
|
55
|
+
open: o ? !1 : void 0,
|
|
56
|
+
onChange: !o && n.onChange,
|
|
57
|
+
allowClear: !o && n.allowClear,
|
|
58
|
+
showSearch: !L,
|
|
59
|
+
className: `max-width ${o ? "readOnly" : ""}`,
|
|
60
|
+
...n,
|
|
61
|
+
tagRender: F,
|
|
62
|
+
placeholder: a ?? m,
|
|
63
|
+
filterOption: k ?? ((e, r) => {
|
|
64
|
+
var c, p, C, y;
|
|
65
|
+
try {
|
|
66
|
+
const i = (C = (p = (c = r == null ? void 0 : r.children) == null ? void 0 : c.props) == null ? void 0 : p.dangerouslySetInnerHTML) == null ? void 0 : C.__html, M = e.toLowerCase().split(/\s+/), w = (r == null ? void 0 : r.children) ?? "", x = typeof w == "string" ? w.toLowerCase() : typeof i == "string" ? i.toLowerCase() : "", O = (((y = r == null ? void 0 : r.value) == null ? void 0 : y.toString()) ?? "").toLowerCase(), V = x.replace(/\s/g, "");
|
|
67
|
+
return M.every(
|
|
68
|
+
(l) => x.indexOf(l) >= 0 || O.indexOf(l) >= 0 || V.indexOf(l) >= 0
|
|
69
|
+
);
|
|
70
|
+
} catch (i) {
|
|
71
|
+
return console.log(i), !0;
|
|
72
|
+
}
|
|
73
|
+
}),
|
|
74
|
+
popupRender: u,
|
|
75
|
+
children: d === null ? void 0 : d ?? (s ? s == null ? void 0 : s.map(T ?? H) : /* @__PURE__ */ t(j, {}))
|
|
76
|
+
}
|
|
77
|
+
)
|
|
78
|
+
}
|
|
79
|
+
) })
|
|
80
|
+
}
|
|
81
|
+
);
|
|
82
|
+
}
|
|
83
|
+
export {
|
|
84
|
+
Y as default
|
|
85
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("react/jsx-runtime"),o=require("react-show-more-text");;/* empty css */const e=r=>t.jsx(o,{...r});exports.ShowMore=e;exports.default=e;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),n=require("antd"),i=require("react"),u=require("react-router-dom"),T=require("../../hooks/NavigatorHooks.cjs.js"),y=require("../../context/WindowDimension.cjs.js"),{Content:S}=n.Layout,v=({positionOfRoute:a,initialKey:o="*",tabs:l,className:d="",mode:h="default"})=>{const[b,m]=i.useState(o),e=T.useNavigateOptional(),p=t=>{e==null||e(t)},r=u.useLocation();i.useEffect(()=>{const t=r.pathname.split("/")[a];m(t??""),t||e==null||e(o,{replace:!0})},[o,r.pathname,e,a]);const{isDesktop:x}=y(),c=h==="side"&&x,f=c?"left":"top",j=c?"d-flex h-100":"";return s.jsxs("div",{className:`${d} ${j}`,children:[s.jsx(n.Tabs,{type:"card",tabPosition:f,activeKey:b,onChange:p,children:l.map(({key:t,label:q})=>s.jsx(n.Tabs.TabPane,{tab:q},t))}),s.jsx(S,{className:`max-height ${c?"overflow-auto":""}`,children:s.jsx(u.Outlet,{})})]})};exports.TabViewWithRoute=v;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
interface TabViewWithRouteProps {
|
|
3
|
+
initialKey?: string;
|
|
4
|
+
positionOfRoute: number;
|
|
5
|
+
className?: string;
|
|
6
|
+
tabs: {
|
|
7
|
+
label: React.ReactNode;
|
|
8
|
+
key: string;
|
|
9
|
+
}[];
|
|
10
|
+
mode?: 'side' | 'default';
|
|
11
|
+
}
|
|
12
|
+
export declare const TabViewWithRoute: React.FC<TabViewWithRouteProps>;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { jsxs as x, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { Tabs as a, Layout as y } from "antd";
|
|
3
|
+
import { useState as S, useEffect as w } from "react";
|
|
4
|
+
import { useLocation as N, Outlet as P } from "react-router-dom";
|
|
5
|
+
import { useNavigateOptional as T } from "../../hooks/NavigatorHooks.es.js";
|
|
6
|
+
import $ from "../../context/WindowDimension.es.js";
|
|
7
|
+
const { Content: j } = y, E = ({
|
|
8
|
+
positionOfRoute: r,
|
|
9
|
+
initialKey: s = "*",
|
|
10
|
+
tabs: i,
|
|
11
|
+
className: m = "",
|
|
12
|
+
mode: l = "default"
|
|
13
|
+
}) => {
|
|
14
|
+
const [p, u] = S(s), t = T(), f = (o) => {
|
|
15
|
+
t == null || t(o);
|
|
16
|
+
}, n = N();
|
|
17
|
+
w(() => {
|
|
18
|
+
const o = n.pathname.split("/")[r];
|
|
19
|
+
u(o ?? ""), o || t == null || t(s, { replace: !0 });
|
|
20
|
+
}, [s, n.pathname, t, r]);
|
|
21
|
+
const { isDesktop: d } = $(), c = l === "side" && d, h = c ? "left" : "top";
|
|
22
|
+
return /* @__PURE__ */ x("div", { className: `${m} ${c ? "d-flex h-100" : ""}`, children: [
|
|
23
|
+
/* @__PURE__ */ e(
|
|
24
|
+
a,
|
|
25
|
+
{
|
|
26
|
+
type: "card",
|
|
27
|
+
tabPosition: h,
|
|
28
|
+
activeKey: p,
|
|
29
|
+
onChange: f,
|
|
30
|
+
children: i.map(({ key: o, label: b }) => /* @__PURE__ */ e(a.TabPane, { tab: b }, o))
|
|
31
|
+
}
|
|
32
|
+
),
|
|
33
|
+
/* @__PURE__ */ e(j, { className: `max-height ${c ? "overflow-auto" : ""}`, children: /* @__PURE__ */ e(P, {}) })
|
|
34
|
+
] });
|
|
35
|
+
};
|
|
36
|
+
export {
|
|
37
|
+
E as TabViewWithRoute
|
|
38
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const a=require("react/jsx-runtime"),c=require("antd"),l=require("react");function d({minusHeight:h,onRow:g,count:m=1,onPageSizeChanged:f,pagination:e=!1,rowKey:s="id",columns:t,className:o,scroll:n,...i}){const r=l.useMemo(()=>t.filter(u=>!u.hidden),[t]);return a.jsx(c.Table,{className:`custom-scroll ${o}`,style:{width:"100%"},columns:r,rowKey:s,...i,scroll:n||{x:!0},pagination:e&&{...e,hideOnSinglePage:!0,showSizeChanger:!1}})}module.exports=d;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ColumnsType, TableProps } from 'antd/lib/table';
|
|
2
|
+
import { default as React } from 'react';
|
|
3
|
+
export type TableComponentColumnProp<T> = {
|
|
4
|
+
dataIndex?: keyof T;
|
|
5
|
+
render?: (value: any, record: T, index: number) => React.ReactNode;
|
|
6
|
+
hidden?: boolean;
|
|
7
|
+
title?: any;
|
|
8
|
+
align?: 'right' | 'left' | 'center';
|
|
9
|
+
width?: number | string;
|
|
10
|
+
}[] & ColumnsType<T>;
|
|
11
|
+
export interface TableComponentProps<T> extends TableProps<T> {
|
|
12
|
+
minusHeight?: number;
|
|
13
|
+
count?: number;
|
|
14
|
+
dataSource?: T[];
|
|
15
|
+
columns: TableComponentColumnProp<T>;
|
|
16
|
+
onPageSizeChanged?: (page: number, pageSize: number) => void;
|
|
17
|
+
}
|
|
18
|
+
declare function TableComponent<T>({ minusHeight, onRow, count, onPageSizeChanged, pagination, rowKey, columns, className, scroll, ...props }: TableComponentProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
export default TableComponent;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { jsx as l } from "react/jsx-runtime";
|
|
2
|
+
import { Table as m } from "antd";
|
|
3
|
+
import { useMemo as u } from "react";
|
|
4
|
+
function x({
|
|
5
|
+
minusHeight: f,
|
|
6
|
+
onRow: c,
|
|
7
|
+
count: d = 1,
|
|
8
|
+
onPageSizeChanged: h,
|
|
9
|
+
pagination: e = !1,
|
|
10
|
+
rowKey: n = "id",
|
|
11
|
+
columns: o,
|
|
12
|
+
className: i,
|
|
13
|
+
scroll: t,
|
|
14
|
+
...r
|
|
15
|
+
}) {
|
|
16
|
+
const s = u(() => o.filter((a) => !a.hidden), [o]);
|
|
17
|
+
return /* @__PURE__ */ l(
|
|
18
|
+
m,
|
|
19
|
+
{
|
|
20
|
+
className: `custom-scroll ${i}`,
|
|
21
|
+
style: { width: "100%" },
|
|
22
|
+
columns: s,
|
|
23
|
+
rowKey: n,
|
|
24
|
+
...r,
|
|
25
|
+
scroll: t || {
|
|
26
|
+
// y: `calc(100vh - ${minusHeight ?? 0}px)`,
|
|
27
|
+
x: !0
|
|
28
|
+
// scrollToFirstRowOnChange: true,
|
|
29
|
+
},
|
|
30
|
+
pagination: e && {
|
|
31
|
+
...e,
|
|
32
|
+
hideOnSinglePage: !0,
|
|
33
|
+
showSizeChanger: !1
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
);
|
|
37
|
+
}
|
|
38
|
+
export {
|
|
39
|
+
x as default
|
|
40
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const x=require("react/jsx-runtime"),d=require("antd"),u=require("../../locale/index.cjs.js"),q=({onClick:n,clickable:o,colorFunction:e,translation:i,value:s})=>{var r;const t=e==null?void 0:e(s),{t:c}=u.useTranslationLib(),p=d.Tag;return x.jsx(p,{onClick:n,color:t==null?void 0:t.color,icon:t==null?void 0:t.icon,style:{color:t==null?void 0:t.text,cursor:o?"pointer":void 0},children:(r=c(i[s]))==null?void 0:r.toUpperCase()})};module.exports=q;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { FC, ReactElement } from 'react';
|
|
2
|
+
type StatusTagProps = {
|
|
3
|
+
translation: any;
|
|
4
|
+
value: string;
|
|
5
|
+
clickable?: boolean;
|
|
6
|
+
onClick?: () => void;
|
|
7
|
+
colorFunction?: (val: any) => {
|
|
8
|
+
color?: string;
|
|
9
|
+
text?: string;
|
|
10
|
+
icon?: ReactElement;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
declare const StatusTag: FC<StatusTagProps>;
|
|
14
|
+
export default StatusTag;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { jsx as i } from "react/jsx-runtime";
|
|
2
|
+
import { Tag as f } from "antd";
|
|
3
|
+
import { useTranslationLib as c } from "../../locale/index.es.js";
|
|
4
|
+
const a = ({
|
|
5
|
+
onClick: e,
|
|
6
|
+
clickable: p,
|
|
7
|
+
colorFunction: o,
|
|
8
|
+
translation: m,
|
|
9
|
+
value: r
|
|
10
|
+
}) => {
|
|
11
|
+
var s;
|
|
12
|
+
const t = o == null ? void 0 : o(r), { t: n } = c();
|
|
13
|
+
return /* @__PURE__ */ i(
|
|
14
|
+
f,
|
|
15
|
+
{
|
|
16
|
+
onClick: e,
|
|
17
|
+
color: t == null ? void 0 : t.color,
|
|
18
|
+
icon: t == null ? void 0 : t.icon,
|
|
19
|
+
style: {
|
|
20
|
+
color: t == null ? void 0 : t.text,
|
|
21
|
+
cursor: p ? "pointer" : void 0
|
|
22
|
+
},
|
|
23
|
+
children: (s = n(m[r])) == null ? void 0 : s.toUpperCase()
|
|
24
|
+
}
|
|
25
|
+
);
|
|
26
|
+
};
|
|
27
|
+
export {
|
|
28
|
+
a as default
|
|
29
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("antd"),{Text:t}=e.Typography;exports.Text=t;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("antd"),{Title:t}=e.Typography;exports.Title=t;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const Title: import('react').ForwardRefExoticComponent<import('antd/es/typography/Title').TitleProps & import('react').RefAttributes<HTMLElement>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const i=require("react/jsx-runtime"),a=require("antd"),m=require("react"),L=require("../../locale/index.cjs.js"),M=require("../tooltip/TooltipComponent.cjs.js"),P=require("./TextField.cjs.js"),k=m.forwardRef(function({type:y,required:o,label:t,rules:c=[],placeholder:r,onEnter:x,form:f,nextFocus:q,min:d,moneyField:n,addonAfter:j,minLength:l,defaultValue:T,pattern:$,disabled:g,readOnly:h,onChange:I,value:N,max:R,addonBefore:w,size:B,isInt:p=!1,tooltip:E,help:z,...F},b){const{t:u}=L.useTranslationLib(),C=m.useMemo(()=>[...c,{required:o,message:`${t??r??""} ${u("err.validation.required")}`}],[c,t,r,u,o]);return i.jsx(M,{title:E,children:i.jsx(a.Form.Item,{...F,label:t,rules:C,children:i.jsx(a.InputNumber,{ref:b,disabled:g,defaultValue:T,value:N,readOnly:h,addonBefore:w,minLength:l,addonAfter:j,step:p?1:void 0,pattern:p?"d*":$,onChange:I,onPressEnter:e=>P.onEnterInternalTextField(e,q,f,x),className:"max-width",min:d===null?void 0:d??0,max:R,type:n?void 0:"number",size:B,formatter:n?e=>{if(e.includes(".")){const s=`${e}`.split(".");return s[0]=s[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),s.join(".")}else return`${e}`.replace(/\B(?=(\d{3})+(?!\d))/g,",")}:void 0,parser:n?e=>e==null?void 0:e.replace(/\$\s?|(,*)/g,""):void 0,placeholder:r??t})})})});module.exports=k;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { TextFieldProps } from './TextField';
|
|
3
|
+
interface NumberTextFieldProps extends TextFieldProps {
|
|
4
|
+
moneyField?: boolean;
|
|
5
|
+
addonAfter?: ReactNode;
|
|
6
|
+
minLength?: number;
|
|
7
|
+
isInt?: boolean;
|
|
8
|
+
max?: number;
|
|
9
|
+
pattern?: string;
|
|
10
|
+
min?: number | null;
|
|
11
|
+
}
|
|
12
|
+
declare const NumberTextField: import('react').ForwardRefExoticComponent<NumberTextFieldProps & import('react').RefAttributes<HTMLInputElement>>;
|
|
13
|
+
export default NumberTextField;
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { jsx as i } from "react/jsx-runtime";
|
|
2
|
+
import { Form as L, InputNumber as M } from "antd";
|
|
3
|
+
import { forwardRef as P, useMemo as R } from "react";
|
|
4
|
+
import { useTranslationLib as k } from "../../locale/index.es.js";
|
|
5
|
+
import q from "../tooltip/TooltipComponent.es.js";
|
|
6
|
+
import { onEnterInternalTextField as v } from "./TextField.es.js";
|
|
7
|
+
const Q = P(
|
|
8
|
+
function({
|
|
9
|
+
// eslint-disable-next-line no-unused-vars
|
|
10
|
+
type: z,
|
|
11
|
+
required: s,
|
|
12
|
+
label: t,
|
|
13
|
+
rules: m = [],
|
|
14
|
+
placeholder: o,
|
|
15
|
+
onEnter: c,
|
|
16
|
+
form: a,
|
|
17
|
+
nextFocus: u,
|
|
18
|
+
min: p,
|
|
19
|
+
moneyField: e,
|
|
20
|
+
addonAfter: l,
|
|
21
|
+
minLength: x,
|
|
22
|
+
defaultValue: $,
|
|
23
|
+
pattern: g,
|
|
24
|
+
disabled: T,
|
|
25
|
+
readOnly: h,
|
|
26
|
+
onChange: I,
|
|
27
|
+
value: N,
|
|
28
|
+
max: j,
|
|
29
|
+
addonBefore: w,
|
|
30
|
+
size: B,
|
|
31
|
+
isInt: d = !1,
|
|
32
|
+
tooltip: E,
|
|
33
|
+
help: A,
|
|
34
|
+
...b
|
|
35
|
+
}, C) {
|
|
36
|
+
const { t: f } = k(), F = R(
|
|
37
|
+
() => [
|
|
38
|
+
...m,
|
|
39
|
+
{
|
|
40
|
+
required: s,
|
|
41
|
+
message: `${t ?? o ?? ""} ${f(
|
|
42
|
+
"err.validation.required"
|
|
43
|
+
)}`
|
|
44
|
+
}
|
|
45
|
+
],
|
|
46
|
+
[m, t, o, f, s]
|
|
47
|
+
);
|
|
48
|
+
return /* @__PURE__ */ i(q, { title: E, children: /* @__PURE__ */ i(L.Item, { ...b, label: t, rules: F, children: /* @__PURE__ */ i(
|
|
49
|
+
M,
|
|
50
|
+
{
|
|
51
|
+
ref: C,
|
|
52
|
+
disabled: T,
|
|
53
|
+
defaultValue: $,
|
|
54
|
+
value: N,
|
|
55
|
+
readOnly: h,
|
|
56
|
+
addonBefore: w,
|
|
57
|
+
minLength: x,
|
|
58
|
+
addonAfter: l,
|
|
59
|
+
step: d ? 1 : void 0,
|
|
60
|
+
pattern: d ? "d*" : g,
|
|
61
|
+
onChange: I,
|
|
62
|
+
onPressEnter: (r) => v(r, u, a, c),
|
|
63
|
+
className: "max-width",
|
|
64
|
+
min: p === null ? void 0 : p ?? 0,
|
|
65
|
+
max: j,
|
|
66
|
+
type: e ? void 0 : "number",
|
|
67
|
+
size: B,
|
|
68
|
+
formatter: e ? (r) => {
|
|
69
|
+
if (r.includes(".")) {
|
|
70
|
+
const n = `${r}`.split(".");
|
|
71
|
+
return n[0] = n[0].replace(/\B(?=(\d{3})+(?!\d))/g, ","), n.join(".");
|
|
72
|
+
} else
|
|
73
|
+
return `${r}`.replace(/\B(?=(\d{3})+(?!\d))/g, ",");
|
|
74
|
+
} : void 0,
|
|
75
|
+
parser: e ? (r) => r == null ? void 0 : r.replace(/\$\s?|(,*)/g, "") : void 0,
|
|
76
|
+
placeholder: o ?? t
|
|
77
|
+
}
|
|
78
|
+
) }) });
|
|
79
|
+
}
|
|
80
|
+
);
|
|
81
|
+
export {
|
|
82
|
+
Q as default
|
|
83
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const t=require("react/jsx-runtime"),i=require("../../util/ValidationUtil.cjs.js"),l=require("./TextField.cjs.js"),r=e=>t.jsx(l.default,{...e,rules:[...e.rules??[],...i.phoneValidation(e.label??e.placeholder??"")]});module.exports=r;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { jsx as l } from "react/jsx-runtime";
|
|
2
|
+
import t from "../../util/ValidationUtil.es.js";
|
|
3
|
+
import i from "./TextField.es.js";
|
|
4
|
+
const m = (e) => /* @__PURE__ */ l(
|
|
5
|
+
i,
|
|
6
|
+
{
|
|
7
|
+
...e,
|
|
8
|
+
rules: [
|
|
9
|
+
...e.rules ?? [],
|
|
10
|
+
...t.phoneValidation(
|
|
11
|
+
e.label ?? e.placeholder ?? ""
|
|
12
|
+
)
|
|
13
|
+
]
|
|
14
|
+
}
|
|
15
|
+
);
|
|
16
|
+
export {
|
|
17
|
+
m as default
|
|
18
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const a=require("react/jsx-runtime"),i=require("antd"),T=require("../../locale/index.cjs.js"),d=(n,e,t,r)=>{var s;e&&t&&(n.preventDefault(),(s=t==null?void 0:t.getFieldInstance(e))==null||s.focus()),r&&r(n)},F=({required:n,label:e,rules:t=[],placeholder:r,onEnter:s,nextFocus:l,className:u,...o})=>{const{t:c}=T.useTranslationLib(),x=i.Form.useFormInstance();return a.jsx(i.Form.Item,{...o,className:u,label:e,rules:[...t,{required:n,message:`${e} ${c("err.validation.required")}`}],children:a.jsx(i.Input.TextArea,{...o,className:u,onPressEnter:I=>d(I,l,x,s),placeholder:r??e})})};exports.default=F;exports.onEnterInternalTextField=d;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { FormInstance, FormItemProps } from 'antd';
|
|
2
|
+
import { TextAreaProps } from 'antd/lib/input';
|
|
3
|
+
import { InputHTMLAttributes } from 'react';
|
|
4
|
+
export interface TextFieldProps extends TextAreaProps, FormItemProps<any> {
|
|
5
|
+
type?: InputHTMLAttributes<HTMLInputElement>;
|
|
6
|
+
placeholder?: string;
|
|
7
|
+
status?: any;
|
|
8
|
+
onEnter?: React.KeyboardEventHandler<HTMLInputElement>;
|
|
9
|
+
form?: any;
|
|
10
|
+
nextFocus?: string;
|
|
11
|
+
children?: any;
|
|
12
|
+
name?: any;
|
|
13
|
+
onReset?: any;
|
|
14
|
+
}
|
|
15
|
+
export declare const onEnterInternalTextField: (e: React.KeyboardEvent<HTMLTextAreaElement>, nextFocus?: string, form?: FormInstance<any>, onEnter?: React.KeyboardEventHandler<HTMLInputElement>) => void;
|
|
16
|
+
declare const TextAreaComponent: React.FC<TextFieldProps>;
|
|
17
|
+
export default TextAreaComponent;
|