@kingteza/crud-component 1.0.26 → 1.0.28
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/App.d.ts +2 -0
- package/common/index.cjs +1 -0
- package/common/index.js +75 -0
- package/components/common/DatePicker/DatePicker.cjs +1 -0
- package/components/common/DatePicker/DatePicker.d.ts +37 -0
- package/components/common/DatePicker/DatePicker.js +88 -0
- package/components/common/DatePicker/TimePicker.cjs +1 -0
- package/components/common/DatePicker/TimePicker.d.ts +34 -0
- package/components/common/DatePicker/TimePicker.js +78 -0
- package/components/common/DatePicker/index.d.ts +3 -0
- package/components/common/appearance/Hider.cjs +1 -0
- package/components/common/appearance/Hider.d.ts +6 -0
- package/components/common/appearance/Hider.js +5 -0
- package/components/common/appearance/index.d.ts +0 -0
- package/components/common/button/Button.cjs +1 -0
- package/components/common/button/Button.d.ts +12 -0
- package/components/common/button/Button.js +79 -0
- package/components/common/button/CloneButtonTable.cjs +1 -0
- package/components/common/button/CloneButtonTable.d.ts +6 -0
- package/components/common/button/CloneButtonTable.js +20 -0
- package/components/common/button/DeleteButtonTable.cjs +1 -0
- package/components/common/button/DeleteButtonTable.d.ts +13 -0
- package/components/common/button/DeleteButtonTable.js +68 -0
- package/components/common/button/ExportButton.cjs +1 -0
- package/components/common/button/ExportButton.d.ts +4 -0
- package/components/common/button/ExportButton.js +27 -0
- package/components/common/button/HideButtonTable.cjs +1 -0
- package/components/common/button/HideButtonTable.d.ts +13 -0
- package/components/common/button/HideButtonTable.js +68 -0
- package/components/common/button/ImportButton.cjs +1 -0
- package/components/common/button/ImportButton.d.ts +9 -0
- package/components/common/button/ImportButton.js +56 -0
- package/components/common/button/NewButton.cjs +1 -0
- package/components/common/button/NewButton.d.ts +12 -0
- package/components/common/button/NewButton.js +24 -0
- package/components/common/button/PrintButton.cjs +1 -0
- package/components/common/button/PrintButton.d.ts +12 -0
- package/components/common/button/PrintButton.js +26 -0
- package/components/common/button/RefreshButton.cjs +1 -0
- package/components/common/button/RefreshButton.d.ts +11 -0
- package/components/common/button/RefreshButton.js +24 -0
- package/components/common/button/UnHideButton.cjs +1 -0
- package/components/common/button/UnHideButton.d.ts +14 -0
- package/components/common/button/UnHideButton.js +70 -0
- package/components/common/button/UpdateButtonTable.cjs +1 -0
- package/components/common/button/UpdateButtonTable.d.ts +6 -0
- package/components/common/button/UpdateButtonTable.js +20 -0
- package/components/common/button/ViewButtonTable.cjs +1 -0
- package/components/common/button/ViewButtonTable.d.ts +6 -0
- package/components/common/button/ViewButtonTable.js +20 -0
- package/components/common/button/index.d.ts +14 -0
- package/components/common/check-box/CheckBox.cjs +1 -0
- package/components/common/check-box/CheckBox.d.ts +9 -0
- package/components/common/check-box/CheckBox.js +40 -0
- package/components/common/check-box/index.d.ts +2 -0
- package/components/common/description/DescList.cjs +1 -0
- package/components/common/description/DescList.d.ts +18 -0
- package/components/common/description/DescList.js +16 -0
- package/components/common/description/DescriptionComponent.d.ts +7 -0
- package/components/common/description/index.d.ts +3 -0
- package/components/common/index.d.ts +22 -0
- package/components/common/layout/VerticalSpace.cjs +1 -0
- package/components/common/layout/VerticalSpace.d.ts +5 -0
- package/components/common/layout/VerticalSpace.js +6 -0
- package/components/common/layout/index.d.ts +2 -0
- package/components/common/loading/LoadingIndicator.cjs +1 -0
- package/components/common/loading/LoadingIndicator.d.ts +6 -0
- package/components/common/loading/LoadingIndicator.js +24 -0
- package/components/common/loading/index.d.ts +2 -0
- package/components/common/picker/ImagePicker.cjs +1 -0
- package/components/common/picker/ImagePicker.d.ts +56 -0
- package/components/common/picker/ImagePicker.js +282 -0
- package/components/common/picker/index.d.ts +2 -0
- package/components/common/radio/RadioGroupComponent.cjs +1 -0
- package/components/common/radio/RadioGroupComponent.d.ts +18 -0
- package/components/common/radio/RadioGroupComponent.js +19 -0
- package/components/common/radio/index.d.ts +2 -0
- package/components/common/report/SelectFieldInReport.cjs +1 -0
- package/components/common/report/SelectFieldInReport.d.ts +16 -0
- package/components/common/report/SelectFieldInReport.js +30 -0
- package/components/common/report/index.d.ts +3 -0
- package/components/common/select/CustomSelectOption.cjs +1 -0
- package/components/common/select/CustomSelectOption.d.ts +7 -0
- package/components/common/select/CustomSelectOption.js +13 -0
- package/components/common/select/SelectComponent.cjs +1 -0
- package/components/common/select/SelectComponent.d.ts +21 -0
- package/components/common/select/SelectComponent.js +89 -0
- package/components/common/select/index.d.ts +3 -0
- package/components/common/show-more/index.cjs +1 -0
- package/components/common/show-more/index.d.ts +4 -0
- package/components/common/show-more/index.js +8 -0
- package/components/common/tab/TabViewWithRoute.cjs +1 -0
- package/components/common/tab/TabViewWithRoute.d.ts +13 -0
- package/components/common/tab/TabViewWithRoute.js +38 -0
- package/components/common/tab/index.d.ts +2 -0
- package/components/common/table/index.d.ts +3 -0
- package/components/common/table/table.cjs +1 -0
- package/components/common/table/table.d.ts +19 -0
- package/components/common/table/table.js +40 -0
- package/components/common/tag/StatusTag.cjs +1 -0
- package/components/common/tag/StatusTag.d.ts +14 -0
- package/components/common/tag/StatusTag.js +30 -0
- package/components/common/tag/index.d.ts +2 -0
- package/components/common/text/index.cjs +1 -0
- package/components/common/text/index.d.ts +3 -0
- package/components/common/text/index.js +5 -0
- package/components/common/text/title/TitleWithHeadTitle.d.ts +7 -0
- package/components/common/text/title/index.cjs +1 -0
- package/components/common/text/title/index.d.ts +1 -0
- package/components/common/text/title/index.js +5 -0
- package/components/common/text-field/NumberField.cjs +1 -0
- package/components/common/text-field/NumberField.d.ts +13 -0
- package/components/common/text-field/NumberField.js +83 -0
- package/components/common/text-field/PhoneNumberField.cjs +1 -0
- package/components/common/text-field/PhoneNumberField.d.ts +4 -0
- package/components/common/text-field/PhoneNumberField.js +18 -0
- package/components/common/text-field/TextArea.cjs +1 -0
- package/components/common/text-field/TextArea.d.ts +17 -0
- package/components/common/text-field/TextArea.js +47 -0
- package/components/common/text-field/TextField.cjs +1 -0
- package/components/common/text-field/TextField.d.ts +27 -0
- package/components/common/text-field/TextField.js +73 -0
- package/components/common/text-field/index.d.ts +5 -0
- package/components/common/tooltip/TooltipComponent.cjs +1 -0
- package/components/common/tooltip/TooltipComponent.d.ts +5 -0
- package/components/common/tooltip/TooltipComponent.js +9 -0
- package/components/common/tooltip/index.d.ts +2 -0
- package/components/common/wizard/WizardResult.cjs +1 -0
- package/components/common/wizard/WizardResult.d.ts +16 -0
- package/components/common/wizard/WizardResult.js +60 -0
- package/components/common/wizard/WizardViewForm.cjs +1 -0
- package/components/common/wizard/WizardViewForm.d.ts +24 -0
- package/components/common/wizard/WizardViewForm.js +74 -0
- package/components/common/wizard/index.d.ts +3 -0
- package/components/crud/CrudComponent.cjs +1 -0
- package/components/crud/CrudComponent.d.ts +237 -0
- package/components/crud/CrudComponent.js +210 -0
- package/components/crud/CrudField.cjs +1 -0
- package/components/crud/CrudField.d.ts +4 -0
- package/components/crud/CrudField.js +459 -0
- package/components/crud/CrudForm.cjs +1 -0
- package/components/crud/CrudForm.d.ts +14 -0
- package/components/crud/CrudForm.js +91 -0
- package/components/crud/CrudFormWizard.cjs +1 -0
- package/components/crud/CrudFormWizard.d.ts +14 -0
- package/components/crud/CrudFormWizard.js +140 -0
- package/components/crud/CrudReportComponent.cjs +4 -0
- package/components/crud/CrudReportComponent.d.ts +44 -0
- package/components/crud/CrudReportComponent.js +255 -0
- package/components/crud/CrudSearchComponent.cjs +1 -0
- package/components/crud/CrudSearchComponent.d.ts +21 -0
- package/components/crud/CrudSearchComponent.js +95 -0
- package/components/crud/FileCrudField.cjs +1 -0
- package/components/crud/FileCrudField.d.ts +25 -0
- package/components/crud/FileCrudField.js +220 -0
- package/components/crud/ImageCrudField.cjs +1 -0
- package/components/crud/ImageCrudField.d.ts +38 -0
- package/components/crud/ImageCrudField.js +113 -0
- package/components/crud/import/CrudImportButton.cjs +1 -0
- package/components/crud/import/CrudImportButton.d.ts +3 -0
- package/components/crud/import/CrudImportButton.js +31 -0
- package/components/crud/import/CrudImportComponent.cjs +2 -0
- package/components/crud/import/CrudImportComponent.d.ts +14 -0
- package/components/crud/import/CrudImportComponent.js +223 -0
- package/components/crud/index.d.ts +15 -0
- package/components/crud/view/CrudDecListView.cjs +1 -0
- package/components/crud/view/CrudDecListView.d.ts +14 -0
- package/components/crud/view/CrudDecListView.js +42 -0
- package/components/crud/view/CrudViewer.cjs +1 -0
- package/components/crud/view/CrudViewer.d.ts +43 -0
- package/components/crud/view/CrudViewer.js +217 -0
- package/components/crud/view/CrudViewerUtil.cjs +1 -0
- package/components/crud/view/CrudViewerUtil.d.ts +2 -0
- package/components/crud/view/CrudViewerUtil.js +57 -0
- package/components/crud/view/index.d.ts +5 -0
- package/index.cjs +1 -0
- package/index.d.ts +4 -0
- package/index.js +32 -0
- package/locale/hooks/translation-constants.cjs +1 -0
- package/locale/hooks/translation-constants.d.ts +1 -0
- package/locale/hooks/translation-constants.js +4 -0
- package/locale/index.cjs +1 -0
- package/locale/index.d.ts +74 -0
- package/locale/index.js +37 -0
- package/locale/translations/en.cjs +1 -0
- package/locale/translations/en.d.ts +58 -0
- package/locale/translations/en.js +60 -0
- package/main.d.ts +0 -0
- package/package.json +5 -4
- package/util/DateUtil.cjs +1 -0
- package/util/DateUtil.d.ts +7 -0
- package/util/DateUtil.js +6 -0
- package/util/ImageUtil.cjs +1 -0
- package/util/ImageUtil.d.ts +14 -0
- package/util/ImageUtil.js +63 -0
- package/util/NumberUtil.cjs +1 -0
- package/util/NumberUtil.d.ts +17 -0
- package/util/NumberUtil.js +60 -0
- package/util/ValidationUtil.cjs +1 -0
- package/util/ValidationUtil.d.ts +14 -0
- package/util/ValidationUtil.js +60 -0
- package/util/index.cjs +1 -0
- package/util/index.d.ts +4 -0
- package/util/index.js +10 -0
- package/vite-env.d.ts +1 -0
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { jsxs as v, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { Tabs as r, Layout as x } from "antd";
|
|
3
|
+
import g from "../../../context/WindowDimension.js";
|
|
4
|
+
import { useState as y, useEffect as S } from "react";
|
|
5
|
+
import { useNavigate as w, Outlet as N } from "react-router";
|
|
6
|
+
import { useLocation as P } from "react-router-dom";
|
|
7
|
+
const { Content: T } = x, A = ({
|
|
8
|
+
positionOfRoute: c,
|
|
9
|
+
initialKey: o = "*",
|
|
10
|
+
tabs: i,
|
|
11
|
+
className: m = "",
|
|
12
|
+
mode: l = "default"
|
|
13
|
+
}) => {
|
|
14
|
+
const [p, u] = y(o), s = w(), f = (t) => {
|
|
15
|
+
s(t);
|
|
16
|
+
}, n = P();
|
|
17
|
+
S(() => {
|
|
18
|
+
const t = n.pathname.split("/")[c];
|
|
19
|
+
u(t ?? ""), t || s(o, { replace: !0 });
|
|
20
|
+
}, [o, n.pathname, s, c]);
|
|
21
|
+
const { isDesktop: d } = g(), a = l === "side" && d, h = a ? "left" : "top";
|
|
22
|
+
return /* @__PURE__ */ v("div", { className: `${m} ${a ? "d-flex h-100" : ""}`, children: [
|
|
23
|
+
/* @__PURE__ */ e(
|
|
24
|
+
r,
|
|
25
|
+
{
|
|
26
|
+
type: "card",
|
|
27
|
+
tabPosition: h,
|
|
28
|
+
activeKey: p,
|
|
29
|
+
onChange: f,
|
|
30
|
+
children: i.map(({ key: t, label: b }) => /* @__PURE__ */ e(r.TabPane, { tab: b }, t))
|
|
31
|
+
}
|
|
32
|
+
),
|
|
33
|
+
/* @__PURE__ */ e(T, { className: `max-height ${a ? "overflow-auto" : ""}`, children: /* @__PURE__ */ e(N, {}) })
|
|
34
|
+
] });
|
|
35
|
+
};
|
|
36
|
+
export {
|
|
37
|
+
A 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';
|
|
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 p=require("react/jsx-runtime"),u=require("antd"),x=require("../../../locale/hooks/translation-constants.cjs"),T=require("react-i18next"),q=({onClick:n,clickable:o,colorFunction:s,translation:c,value:e})=>{var r;const t=s==null?void 0:s(e),{t:i}=T.useTranslation(x.TRANSLATION_NAMESPACE),a=u.Tag;return p.jsx(a,{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=i(c[e]))==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,30 @@
|
|
|
1
|
+
import { jsx as i } from "react/jsx-runtime";
|
|
2
|
+
import { Tag as f } from "antd";
|
|
3
|
+
import { TRANSLATION_NAMESPACE as T } from "../../../locale/hooks/translation-constants.js";
|
|
4
|
+
import { useTranslation as A } from "react-i18next";
|
|
5
|
+
const S = ({
|
|
6
|
+
onClick: e,
|
|
7
|
+
clickable: m,
|
|
8
|
+
colorFunction: t,
|
|
9
|
+
translation: p,
|
|
10
|
+
value: r
|
|
11
|
+
}) => {
|
|
12
|
+
var s;
|
|
13
|
+
const o = t == null ? void 0 : t(r), { t: n } = A(T);
|
|
14
|
+
return /* @__PURE__ */ i(
|
|
15
|
+
f,
|
|
16
|
+
{
|
|
17
|
+
onClick: e,
|
|
18
|
+
color: o == null ? void 0 : o.color,
|
|
19
|
+
icon: o == null ? void 0 : o.icon,
|
|
20
|
+
style: {
|
|
21
|
+
color: o == null ? void 0 : o.text,
|
|
22
|
+
cursor: m ? "pointer" : void 0
|
|
23
|
+
},
|
|
24
|
+
children: (s = n(p[r])) == null ? void 0 : s.toUpperCase()
|
|
25
|
+
}
|
|
26
|
+
);
|
|
27
|
+
};
|
|
28
|
+
export {
|
|
29
|
+
S as default
|
|
30
|
+
};
|
|
@@ -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 o=require("react/jsx-runtime"),p=require("antd"),m=require("react"),M=require("react-i18next"),P=require("../../../locale/hooks/translation-constants.cjs"),S=require("../tooltip/TooltipComponent.cjs"),L=require("./TextField.cjs"),O=m.forwardRef(function({type:b,required:i,label:e,rules:c=[],placeholder:r,onEnter:x,form:q,nextFocus:T,min:d,moneyField:n,addonAfter:f,minLength:N,defaultValue:j,pattern:l,disabled:I,readOnly:$,onChange:g,value:A,max:E,addonBefore:R,size:C,isInt:u=!1,tooltip:h,...w},B){const{t:a}=M.useTranslation(P.TRANSLATION_NAMESPACE),F=m.useMemo(()=>[...c,{required:i,message:`${e??r??""} ${a("err.validation.required")}`}],[c,e,r,a,i]);return o.jsx(S,{title:h,children:o.jsx(p.Form.Item,{...w,label:e,rules:F,children:o.jsx(p.InputNumber,{ref:B,disabled:I,defaultValue:j,value:A,readOnly:$,addonBefore:R,minLength:N,addonAfter:f,step:u?1:void 0,pattern:u?"d*":l,onChange:g,onPressEnter:t=>L.onEnterInternalTextField(t,T,q,x),className:"max-width",min:d===null?void 0:d??0,max:E,type:n?void 0:"number",size:C,formatter:n?t=>{if(t.includes(".")){const s=`${t}`.split(".");return s[0]=s[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),s.join(".")}else return`${t}`.replace(/\B(?=(\d{3})+(?!\d))/g,",")}:void 0,parser:n?t=>t==null?void 0:t.replace(/\$\s?|(,*)/g,""):void 0,placeholder:r??e})})})});module.exports=O;
|
|
@@ -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 P, InputNumber as R } from "antd";
|
|
3
|
+
import { forwardRef as S, useMemo as F } from "react";
|
|
4
|
+
import { useTranslation as L } from "react-i18next";
|
|
5
|
+
import { TRANSLATION_NAMESPACE as O } from "../../../locale/hooks/translation-constants.js";
|
|
6
|
+
import _ from "../tooltip/TooltipComponent.js";
|
|
7
|
+
import { onEnterInternalTextField as b } from "./TextField.js";
|
|
8
|
+
const K = S(
|
|
9
|
+
function({
|
|
10
|
+
// eslint-disable-next-line no-unused-vars
|
|
11
|
+
type: q,
|
|
12
|
+
required: m,
|
|
13
|
+
label: t,
|
|
14
|
+
rules: s = [],
|
|
15
|
+
placeholder: o,
|
|
16
|
+
onEnter: c,
|
|
17
|
+
form: a,
|
|
18
|
+
nextFocus: u,
|
|
19
|
+
min: p,
|
|
20
|
+
moneyField: e,
|
|
21
|
+
addonAfter: N,
|
|
22
|
+
minLength: T,
|
|
23
|
+
defaultValue: x,
|
|
24
|
+
pattern: $,
|
|
25
|
+
disabled: g,
|
|
26
|
+
readOnly: l,
|
|
27
|
+
onChange: A,
|
|
28
|
+
value: E,
|
|
29
|
+
max: I,
|
|
30
|
+
addonBefore: h,
|
|
31
|
+
size: j,
|
|
32
|
+
isInt: d = !1,
|
|
33
|
+
tooltip: w,
|
|
34
|
+
...B
|
|
35
|
+
}, C) {
|
|
36
|
+
const { t: f } = L(O), M = F(
|
|
37
|
+
() => [
|
|
38
|
+
...s,
|
|
39
|
+
{
|
|
40
|
+
required: m,
|
|
41
|
+
message: `${t ?? o ?? ""} ${f(
|
|
42
|
+
"err.validation.required"
|
|
43
|
+
)}`
|
|
44
|
+
}
|
|
45
|
+
],
|
|
46
|
+
[s, t, o, f, m]
|
|
47
|
+
);
|
|
48
|
+
return /* @__PURE__ */ i(_, { title: w, children: /* @__PURE__ */ i(P.Item, { ...B, label: t, rules: M, children: /* @__PURE__ */ i(
|
|
49
|
+
R,
|
|
50
|
+
{
|
|
51
|
+
ref: C,
|
|
52
|
+
disabled: g,
|
|
53
|
+
defaultValue: x,
|
|
54
|
+
value: E,
|
|
55
|
+
readOnly: l,
|
|
56
|
+
addonBefore: h,
|
|
57
|
+
minLength: T,
|
|
58
|
+
addonAfter: N,
|
|
59
|
+
step: d ? 1 : void 0,
|
|
60
|
+
pattern: d ? "d*" : $,
|
|
61
|
+
onChange: A,
|
|
62
|
+
onPressEnter: (r) => b(r, u, a, c),
|
|
63
|
+
className: "max-width",
|
|
64
|
+
min: p === null ? void 0 : p ?? 0,
|
|
65
|
+
max: I,
|
|
66
|
+
type: e ? void 0 : "number",
|
|
67
|
+
size: j,
|
|
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
|
+
K as default
|
|
83
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const t=require("react/jsx-runtime"),i=require("../../../util/ValidationUtil.cjs"),l=require("./TextField.cjs"),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.js";
|
|
3
|
+
import i from "./TextField.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"),x=require("react-i18next"),A=require("../../../locale/hooks/translation-constants.cjs"),c=(n,e,t,r)=>{var s;e&&t&&(n.preventDefault(),(s=t==null?void 0:t.getFieldInstance(e))==null||s.focus()),r&&r(n)},q=({required:n,label:e,rules:t=[],placeholder:r,onEnter:s,nextFocus:l,className:o,...u})=>{const{t:d}=x.useTranslation(A.TRANSLATION_NAMESPACE),I=i.Form.useFormInstance();return a.jsx(i.Form.Item,{...u,className:o,label:e,rules:[...t,{required:n,message:`${e} ${d("err.validation.required")}`}],children:a.jsx(i.Input.TextArea,{...u,className:o,onPressEnter:T=>c(T,l,I,s),placeholder:r??e})})};exports.default=q;exports.onEnterInternalTextField=c;
|
|
@@ -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;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import { Form as m, Input as l } from "antd";
|
|
3
|
+
import { useTranslation as A } from "react-i18next";
|
|
4
|
+
import { TRANSLATION_NAMESPACE as I } from "../../../locale/hooks/translation-constants.js";
|
|
5
|
+
const T = (r, e, t, n) => {
|
|
6
|
+
var o;
|
|
7
|
+
e && t && (r.preventDefault(), (o = t == null ? void 0 : t.getFieldInstance(e)) == null || o.focus()), n && n(r);
|
|
8
|
+
}, g = ({
|
|
9
|
+
required: r,
|
|
10
|
+
label: e,
|
|
11
|
+
rules: t = [],
|
|
12
|
+
placeholder: n,
|
|
13
|
+
onEnter: o,
|
|
14
|
+
nextFocus: u,
|
|
15
|
+
className: i,
|
|
16
|
+
...s
|
|
17
|
+
}) => {
|
|
18
|
+
const { t: c } = A(I), d = m.useFormInstance();
|
|
19
|
+
return /* @__PURE__ */ a(
|
|
20
|
+
m.Item,
|
|
21
|
+
{
|
|
22
|
+
...s,
|
|
23
|
+
className: i,
|
|
24
|
+
label: e,
|
|
25
|
+
rules: [
|
|
26
|
+
...t,
|
|
27
|
+
{
|
|
28
|
+
required: r,
|
|
29
|
+
message: `${e} ${c("err.validation.required")}`
|
|
30
|
+
}
|
|
31
|
+
],
|
|
32
|
+
children: /* @__PURE__ */ a(
|
|
33
|
+
l.TextArea,
|
|
34
|
+
{
|
|
35
|
+
...s,
|
|
36
|
+
className: i,
|
|
37
|
+
onPressEnter: (p) => T(p, u, d, o),
|
|
38
|
+
placeholder: n ?? e
|
|
39
|
+
}
|
|
40
|
+
)
|
|
41
|
+
}
|
|
42
|
+
);
|
|
43
|
+
};
|
|
44
|
+
export {
|
|
45
|
+
g as default,
|
|
46
|
+
T as onEnterInternalTextField
|
|
47
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const o=require("react/jsx-runtime"),O=require("@ant-design/icons"),c=require("antd"),R=require("react"),_=require("react-i18next"),w=require("../../../locale/hooks/translation-constants.cjs"),L=require("../tooltip/TooltipComponent.cjs"),d=(t,n,e,i)=>{var s;n&&e&&(t.preventDefault(),(s=e==null?void 0:e.getFieldInstance(n))==null||s.focus()),i&&i(t)},$=({type:t,required:n,label:e,disabled:i,rules:s=[],placeholder:a,onEnter:l,size:p,form:x,addonAfter:I,addonBefore:T,nextFocus:g,autoComplete:m="off",defaultValue:q,readOnly:f,value:j,loading:v,onBlur:A,inputRef:C,status:E,autoFocus:P,onChange:D,tooltip:F,...M})=>{const{t:u}=_.useTranslation(w.TRANSLATION_NAMESPACE),S=R.useMemo(()=>{const r=[...s,{required:n,message:`${e??a??""} ${u("err.validation.required")}`}];return t==="email"&&r.push({type:"email",message:u("err.validation.invalidEmail")}),r},[s,n,e,a,u,t]),h={disabled:i,value:j,readOnly:f,defaultValue:q,autoFocus:P,addonBefore:T,ref:C,onBlur:A,addonAfter:v?o.jsx(O.LoadingOutlined,{}):I,status:E,size:p,autoComplete:m,onPressEnter:r=>d(r,g,x,l),type:t,placeholder:a??e},N=t=="password"?c.Input.Password:c.Input;return o.jsx(L,{title:F,children:o.jsx(c.Form.Item,{...M,label:e,rules:S,children:o.jsx(N,{...h})})})};exports.default=$;exports.onEnterInternalTextField=d;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { FormItemProps } from 'antd';
|
|
2
|
+
import { SizeType } from 'antd/es/config-provider/SizeContext';
|
|
3
|
+
import { FormInstance } from 'antd/lib/form/Form';
|
|
4
|
+
import { default as React } from 'react';
|
|
5
|
+
export interface TextFieldProps extends FormItemProps<any> {
|
|
6
|
+
type?: any;
|
|
7
|
+
placeholder?: string;
|
|
8
|
+
onEnter?: React.KeyboardEventHandler<HTMLInputElement>;
|
|
9
|
+
form?: FormInstance<any>;
|
|
10
|
+
addonAfter?: any;
|
|
11
|
+
addonBefore?: any;
|
|
12
|
+
nextFocus?: string;
|
|
13
|
+
autoComplete?: string;
|
|
14
|
+
defaultValue?: any;
|
|
15
|
+
readOnly?: boolean;
|
|
16
|
+
value?: any;
|
|
17
|
+
autoFocus?: boolean;
|
|
18
|
+
disabled?: boolean;
|
|
19
|
+
size?: SizeType;
|
|
20
|
+
loading?: boolean;
|
|
21
|
+
inputRef?: any;
|
|
22
|
+
onBlur?: any;
|
|
23
|
+
onChange?: (val: any) => void;
|
|
24
|
+
}
|
|
25
|
+
export declare const onEnterInternalTextField: (e: React.KeyboardEvent<HTMLInputElement>, nextFocus?: string, form?: FormInstance<any>, onEnter?: React.KeyboardEventHandler<HTMLInputElement>) => void;
|
|
26
|
+
declare const TextField: React.FC<TextFieldProps>;
|
|
27
|
+
export default TextField;
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { jsx as s } from "react/jsx-runtime";
|
|
2
|
+
import { LoadingOutlined as O } from "@ant-design/icons";
|
|
3
|
+
import { Input as d, Form as S } from "antd";
|
|
4
|
+
import { useMemo as $ } from "react";
|
|
5
|
+
import { useTranslation as j } from "react-i18next";
|
|
6
|
+
import { TRANSLATION_NAMESPACE as D } from "../../../locale/hooks/translation-constants.js";
|
|
7
|
+
import R from "../tooltip/TooltipComponent.js";
|
|
8
|
+
const _ = (o, n, t, r) => {
|
|
9
|
+
var i;
|
|
10
|
+
n && t && (o.preventDefault(), (i = t == null ? void 0 : t.getFieldInstance(n)) == null || i.focus()), r && r(o);
|
|
11
|
+
}, Q = ({
|
|
12
|
+
type: o,
|
|
13
|
+
required: n,
|
|
14
|
+
label: t,
|
|
15
|
+
disabled: r,
|
|
16
|
+
rules: i = [],
|
|
17
|
+
placeholder: m,
|
|
18
|
+
onEnter: p,
|
|
19
|
+
size: f,
|
|
20
|
+
form: l,
|
|
21
|
+
addonAfter: u,
|
|
22
|
+
addonBefore: c,
|
|
23
|
+
nextFocus: T,
|
|
24
|
+
autoComplete: g = "off",
|
|
25
|
+
defaultValue: A,
|
|
26
|
+
readOnly: I,
|
|
27
|
+
value: v,
|
|
28
|
+
loading: C,
|
|
29
|
+
onBlur: E,
|
|
30
|
+
inputRef: P,
|
|
31
|
+
status: h,
|
|
32
|
+
autoFocus: x,
|
|
33
|
+
onChange: k,
|
|
34
|
+
tooltip: F,
|
|
35
|
+
...N
|
|
36
|
+
}) => {
|
|
37
|
+
const { t: a } = j(D), w = $(() => {
|
|
38
|
+
const e = [
|
|
39
|
+
...i,
|
|
40
|
+
{
|
|
41
|
+
required: n,
|
|
42
|
+
message: `${t ?? m ?? ""} ${a(
|
|
43
|
+
"err.validation.required"
|
|
44
|
+
)}`
|
|
45
|
+
}
|
|
46
|
+
];
|
|
47
|
+
return o === "email" && e.push({
|
|
48
|
+
type: "email",
|
|
49
|
+
message: a("err.validation.invalidEmail")
|
|
50
|
+
}), e;
|
|
51
|
+
}, [i, n, t, m, a, o]), L = {
|
|
52
|
+
disabled: r,
|
|
53
|
+
value: v,
|
|
54
|
+
readOnly: I,
|
|
55
|
+
defaultValue: A,
|
|
56
|
+
autoFocus: x,
|
|
57
|
+
addonBefore: c,
|
|
58
|
+
ref: P,
|
|
59
|
+
onBlur: E,
|
|
60
|
+
addonAfter: C ? /* @__PURE__ */ s(O, {}) : u,
|
|
61
|
+
status: h,
|
|
62
|
+
size: f,
|
|
63
|
+
autoComplete: g,
|
|
64
|
+
onPressEnter: (e) => _(e, T, l, p),
|
|
65
|
+
type: o,
|
|
66
|
+
placeholder: m ?? t
|
|
67
|
+
}, M = o == "password" ? d.Password : d;
|
|
68
|
+
return /* @__PURE__ */ s(R, { title: F, children: /* @__PURE__ */ s(S.Item, { ...N, label: t, rules: w, children: /* @__PURE__ */ s(M, { ...L }) }) });
|
|
69
|
+
};
|
|
70
|
+
export {
|
|
71
|
+
Q as default,
|
|
72
|
+
_ as onEnterInternalTextField
|
|
73
|
+
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { default as NumberTextField } from './NumberField';
|
|
2
|
+
import { default as PhoneField } from './PhoneNumberField';
|
|
3
|
+
import { default as TextField } from './TextField';
|
|
4
|
+
import { default as TextAreaComponent } from './TextArea';
|
|
5
|
+
export { NumberTextField, PhoneField, TextField, TextAreaComponent };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const r=require("react/jsx-runtime"),e=require("antd"),n=({children:t,title:o})=>o?r.jsx(e.Tooltip,{title:o,children:t}):t;module.exports=n;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const t=require("react/jsx-runtime"),a=require("@ant-design/icons"),y=require("antd"),o=require("i18next"),A=require("react-i18next"),d=require("../button/Button.cjs"),T=require("../../../locale/hooks/translation-constants.cjs"),h=({errorChildren:l,children:v,onRetry:r,onClickBack:c,success:n,loading:s,error:e,successTitle:x=o.t("str.success"),successMessage:j,errorMessage:u=o.t("err.save"),errorTitle:m=o.t("str.error"),loadingTitle:p=o.t("message.loading.saving"),loadingMessage:q})=>{const{t:i}=A.useTranslation(T.TRANSLATION_NAMESPACE);return t.jsx(y.Result,{status:s?void 0:n?"success":e?["403","404","500"].includes(e==null?void 0:e.code)?e.code:e?"error":void 0:void 0,title:s?p:n?x:e?m:void 0,icon:s?t.jsx(a.LoadingOutlined,{}):void 0,subTitle:s?q:n?j:e?typeof u=="function"?u()??i("err.save"):u??i("err.save"):void 0,extra:[n?t.jsx(t.Fragment,{children:v}):e?t.jsxs(t.Fragment,{children:[!!c&&t.jsx(d,{onClick:c,htmlType:"button",type:"primary",icon:t.jsx(a.ArrowLeftOutlined,{}),children:i("str.previous")}),!!r&&t.jsx(d,{type:"primary",onClick:()=>r(void 0,void 0,!0),children:i("str.retry")},"retry"),l]}):t.jsx(t.Fragment,{})]})};module.exports=h;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { default as React, FC, PropsWithChildren } from 'react';
|
|
2
|
+
declare const WizardResult: FC<{
|
|
3
|
+
onRetry?: (_: undefined, __: undefined, retry: true) => void;
|
|
4
|
+
onClickBack?: () => void;
|
|
5
|
+
loading: boolean;
|
|
6
|
+
error: any;
|
|
7
|
+
success: boolean;
|
|
8
|
+
successTitle?: string;
|
|
9
|
+
successMessage?: string;
|
|
10
|
+
errorTitle?: string;
|
|
11
|
+
errorMessage?: string | (() => string | undefined);
|
|
12
|
+
loadingTitle?: string;
|
|
13
|
+
loadingMessage?: string;
|
|
14
|
+
errorChildren?: React.ReactNode;
|
|
15
|
+
} & PropsWithChildren>;
|
|
16
|
+
export default WizardResult;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { jsx as i, Fragment as d, jsxs as T } from "react/jsx-runtime";
|
|
2
|
+
import { LoadingOutlined as h, ArrowLeftOutlined as x } from "@ant-design/icons";
|
|
3
|
+
import { Result as C } from "antd";
|
|
4
|
+
import { t as m } from "i18next";
|
|
5
|
+
import { useTranslation as L } from "react-i18next";
|
|
6
|
+
import l from "../button/Button.js";
|
|
7
|
+
import { TRANSLATION_NAMESPACE as N } from "../../../locale/hooks/translation-constants.js";
|
|
8
|
+
const w = ({
|
|
9
|
+
errorChildren: u,
|
|
10
|
+
children: a,
|
|
11
|
+
onRetry: p,
|
|
12
|
+
onClickBack: r,
|
|
13
|
+
success: o,
|
|
14
|
+
loading: e,
|
|
15
|
+
error: t,
|
|
16
|
+
successTitle: v = m("str.success"),
|
|
17
|
+
successMessage: f,
|
|
18
|
+
errorMessage: s = m("err.save"),
|
|
19
|
+
errorTitle: c = m("str.error"),
|
|
20
|
+
loadingTitle: y = m("message.loading.saving"),
|
|
21
|
+
loadingMessage: A
|
|
22
|
+
}) => {
|
|
23
|
+
const { t: n } = L(N);
|
|
24
|
+
return /* @__PURE__ */ i(
|
|
25
|
+
C,
|
|
26
|
+
{
|
|
27
|
+
status: e ? void 0 : o ? "success" : t ? ["403", "404", "500"].includes(t == null ? void 0 : t.code) ? t.code : t ? "error" : void 0 : void 0,
|
|
28
|
+
title: e ? y : o ? v : t ? c : void 0,
|
|
29
|
+
icon: e ? /* @__PURE__ */ i(h, {}) : void 0,
|
|
30
|
+
subTitle: e ? A : o ? f : t ? typeof s == "function" ? s() ?? n("err.save") : s ?? n("err.save") : void 0,
|
|
31
|
+
extra: [
|
|
32
|
+
o ? /* @__PURE__ */ i(d, { children: a }) : t ? /* @__PURE__ */ T(d, { children: [
|
|
33
|
+
!!r && /* @__PURE__ */ i(
|
|
34
|
+
l,
|
|
35
|
+
{
|
|
36
|
+
onClick: r,
|
|
37
|
+
htmlType: "button",
|
|
38
|
+
type: "primary",
|
|
39
|
+
icon: /* @__PURE__ */ i(x, {}),
|
|
40
|
+
children: n("str.previous")
|
|
41
|
+
}
|
|
42
|
+
),
|
|
43
|
+
!!p && /* @__PURE__ */ i(
|
|
44
|
+
l,
|
|
45
|
+
{
|
|
46
|
+
type: "primary",
|
|
47
|
+
onClick: () => p(void 0, void 0, !0),
|
|
48
|
+
children: n("str.retry")
|
|
49
|
+
},
|
|
50
|
+
"retry"
|
|
51
|
+
),
|
|
52
|
+
u
|
|
53
|
+
] }) : /* @__PURE__ */ i(d, {})
|
|
54
|
+
]
|
|
55
|
+
}
|
|
56
|
+
);
|
|
57
|
+
};
|
|
58
|
+
export {
|
|
59
|
+
w as default
|
|
60
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const c=require("react/jsx-runtime"),w=require("antd"),o=require("react"),F=require("../appearance/Hider.cjs"),{Step:R}=w.Steps,y=o.forwardRef(({pages:d,onSubmit:u,initPosition:f=0,progressDot:v,type:b,labelPlacement:g,className:k,pageStyle:q},C)=>{const[s,i]=o.useState(0),[r,p]=o.useState([]);o.useEffect(()=>{i(f)},[f]),o.useImperativeHandle(C,()=>({gotTo:t=>i(t)}),[]);const m=o.useCallback((t,a=!1,l=!1)=>{const e=[...r];if(t!==void 0&&(e[s]=t,p(e)),l||i(s+1),a&&u){const n={};for(const x of e)for(const S in x)n[S]=x[S];u(e,n)}},[s,r,u]),h=o.useCallback(()=>{const t=[...r];t[s]=void 0,p(t),i(s-1)},[s,r]),j=o.useMemo(()=>{const t=[],a=[],l=d.filter(e=>!e.hidden);for(let e=0;e<l.length;e++){const n=l[e];a.push(c.jsx(F,{hide:s!==e,children:n.component({forward:m,backward:h},r,s===e)},`${n.title}${e}`)),t.push(c.jsx(R,{icon:n.icon,title:n.title},n.title))}return{_pages:a,steps:t}},[h,s,r,m,d]);return c.jsxs(c.Fragment,{children:[c.jsx(w.Steps,{labelPlacement:g,progressDot:v,className:[k,"pb-3"].join(" "),current:s,type:b,children:j.steps}),c.jsx("div",{style:q,children:j._pages})]})});module.exports=y;
|