@kingteza/crud-component 1.0.28 → 1.0.30
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/common/DatePicker/DatePicker.cjs +1 -0
- package/{components/common → common}/DatePicker/DatePicker.js +1 -1
- package/common/DatePicker/TimePicker.cjs +1 -0
- package/{components/common → common}/DatePicker/TimePicker.js +1 -1
- package/common/button/Button.cjs +1 -0
- package/{components/common → common}/button/Button.js +1 -1
- package/common/button/CloneButtonTable.cjs +1 -0
- package/{components/common → common}/button/CloneButtonTable.js +1 -1
- package/common/button/DeleteButtonTable.cjs +1 -0
- package/{components/common → common}/button/DeleteButtonTable.js +1 -1
- package/common/button/ExportButton.cjs +1 -0
- package/{components/common → common}/button/ExportButton.js +1 -1
- package/common/button/HideButtonTable.cjs +1 -0
- package/{components/common → common}/button/HideButtonTable.js +1 -1
- package/common/button/ImportButton.cjs +1 -0
- package/{components/common → common}/button/ImportButton.js +1 -1
- package/common/button/NewButton.cjs +1 -0
- package/{components/common → common}/button/NewButton.js +1 -1
- package/common/button/PrintButton.cjs +1 -0
- package/{components/common → common}/button/PrintButton.js +1 -1
- package/common/button/RefreshButton.cjs +1 -0
- package/{components/common → common}/button/RefreshButton.js +1 -1
- package/common/button/UnHideButton.cjs +1 -0
- package/{components/common → common}/button/UnHideButton.js +1 -1
- package/common/button/UpdateButtonTable.cjs +1 -0
- package/{components/common → common}/button/UpdateButtonTable.js +1 -1
- package/common/button/ViewButtonTable.cjs +1 -0
- package/{components/common → common}/button/ViewButtonTable.js +1 -1
- package/common/description/DescList.cjs +1 -0
- package/{components/common → common}/description/DescList.js +1 -1
- package/common/index.cjs +1 -1
- package/common/index.js +36 -36
- package/common/loading/LoadingIndicator.cjs +1 -0
- package/{components/common → common}/loading/LoadingIndicator.js +1 -1
- package/common/picker/ImagePicker.cjs +1 -0
- package/{components/common → common}/picker/ImagePicker.js +3 -3
- package/common/select/SelectComponent.cjs +1 -0
- package/{components/common → common}/select/SelectComponent.js +1 -1
- package/common/tab/TabViewWithRoute.cjs +1 -0
- package/{components/common → common}/tab/TabViewWithRoute.js +1 -1
- package/common/tag/StatusTag.cjs +1 -0
- package/{components/common → common}/tag/StatusTag.js +1 -1
- package/common/text-field/NumberField.cjs +1 -0
- package/{components/common → common}/text-field/NumberField.js +1 -1
- package/common/text-field/PhoneNumberField.cjs +1 -0
- package/{components/common → common}/text-field/PhoneNumberField.js +1 -1
- package/common/text-field/TextArea.cjs +1 -0
- package/{components/common → common}/text-field/TextArea.js +1 -1
- package/common/text-field/TextField.cjs +1 -0
- package/{components/common → common}/text-field/TextField.js +1 -1
- package/common/wizard/WizardResult.cjs +1 -0
- package/{components/common → common}/wizard/WizardResult.js +1 -1
- package/crud/CrudComponent.cjs +1 -0
- package/{components/crud → crud}/CrudComponent.d.ts +1 -1
- package/{components/crud → crud}/CrudComponent.js +1 -1
- package/crud/CrudField.cjs +1 -0
- package/{components/crud → crud}/CrudField.js +1 -1
- package/crud/CrudFormWizard.cjs +1 -0
- package/{components/crud → crud}/CrudFormWizard.js +1 -1
- package/crud/FileCrudField.cjs +1 -0
- package/{components/crud → crud}/FileCrudField.js +2 -2
- package/crud/ImageCrudField.cjs +1 -0
- package/{components/crud → crud}/ImageCrudField.js +2 -2
- package/crud/import/CrudImportButton.cjs +1 -0
- package/{components/crud → crud}/import/CrudImportButton.js +1 -1
- package/{components/crud → crud}/import/CrudImportComponent.cjs +1 -1
- package/{components/crud → crud}/import/CrudImportComponent.js +2 -2
- package/crud/view/CrudDecListView.cjs +1 -0
- package/{components/crud → crud}/view/CrudDecListView.js +1 -1
- package/crud/view/CrudViewer.cjs +1 -0
- package/{components/crud → crud}/view/CrudViewer.js +1 -1
- package/crud/view/CrudViewerUtil.cjs +1 -0
- package/{components/crud → crud}/view/CrudViewerUtil.d.ts +1 -1
- package/{components/crud → crud}/view/CrudViewerUtil.js +3 -3
- package/index.cjs +1 -1
- package/index.d.ts +2 -2
- package/index.js +8 -8
- package/package.json +6 -6
- package/components/common/DatePicker/DatePicker.cjs +0 -1
- package/components/common/DatePicker/TimePicker.cjs +0 -1
- package/components/common/button/Button.cjs +0 -1
- package/components/common/button/CloneButtonTable.cjs +0 -1
- package/components/common/button/DeleteButtonTable.cjs +0 -1
- package/components/common/button/ExportButton.cjs +0 -1
- package/components/common/button/HideButtonTable.cjs +0 -1
- package/components/common/button/ImportButton.cjs +0 -1
- package/components/common/button/NewButton.cjs +0 -1
- package/components/common/button/PrintButton.cjs +0 -1
- package/components/common/button/RefreshButton.cjs +0 -1
- package/components/common/button/UnHideButton.cjs +0 -1
- package/components/common/button/UpdateButtonTable.cjs +0 -1
- package/components/common/button/ViewButtonTable.cjs +0 -1
- package/components/common/description/DescList.cjs +0 -1
- package/components/common/loading/LoadingIndicator.cjs +0 -1
- package/components/common/picker/ImagePicker.cjs +0 -1
- package/components/common/select/SelectComponent.cjs +0 -1
- package/components/common/tab/TabViewWithRoute.cjs +0 -1
- package/components/common/tag/StatusTag.cjs +0 -1
- package/components/common/text-field/NumberField.cjs +0 -1
- package/components/common/text-field/PhoneNumberField.cjs +0 -1
- package/components/common/text-field/TextArea.cjs +0 -1
- package/components/common/text-field/TextField.cjs +0 -1
- package/components/common/wizard/WizardResult.cjs +0 -1
- package/components/crud/CrudComponent.cjs +0 -1
- package/components/crud/CrudField.cjs +0 -1
- package/components/crud/CrudFormWizard.cjs +0 -1
- package/components/crud/FileCrudField.cjs +0 -1
- package/components/crud/ImageCrudField.cjs +0 -1
- package/components/crud/import/CrudImportButton.cjs +0 -1
- package/components/crud/view/CrudDecListView.cjs +0 -1
- package/components/crud/view/CrudViewer.cjs +0 -1
- package/components/crud/view/CrudViewerUtil.cjs +0 -1
- /package/{components/common → common}/DatePicker/DatePicker.d.ts +0 -0
- /package/{components/common → common}/DatePicker/TimePicker.d.ts +0 -0
- /package/{components/common → common}/DatePicker/index.d.ts +0 -0
- /package/{components/common → common}/appearance/Hider.cjs +0 -0
- /package/{components/common → common}/appearance/Hider.d.ts +0 -0
- /package/{components/common → common}/appearance/Hider.js +0 -0
- /package/{components/common → common}/appearance/index.d.ts +0 -0
- /package/{components/common → common}/button/Button.d.ts +0 -0
- /package/{components/common → common}/button/CloneButtonTable.d.ts +0 -0
- /package/{components/common → common}/button/DeleteButtonTable.d.ts +0 -0
- /package/{components/common → common}/button/ExportButton.d.ts +0 -0
- /package/{components/common → common}/button/HideButtonTable.d.ts +0 -0
- /package/{components/common → common}/button/ImportButton.d.ts +0 -0
- /package/{components/common → common}/button/NewButton.d.ts +0 -0
- /package/{components/common → common}/button/PrintButton.d.ts +0 -0
- /package/{components/common → common}/button/RefreshButton.d.ts +0 -0
- /package/{components/common → common}/button/UnHideButton.d.ts +0 -0
- /package/{components/common → common}/button/UpdateButtonTable.d.ts +0 -0
- /package/{components/common → common}/button/ViewButtonTable.d.ts +0 -0
- /package/{components/common → common}/button/index.d.ts +0 -0
- /package/{components/common → common}/check-box/CheckBox.cjs +0 -0
- /package/{components/common → common}/check-box/CheckBox.d.ts +0 -0
- /package/{components/common → common}/check-box/CheckBox.js +0 -0
- /package/{components/common → common}/check-box/index.d.ts +0 -0
- /package/{components/common → common}/description/DescList.d.ts +0 -0
- /package/{components/common → common}/description/DescriptionComponent.d.ts +0 -0
- /package/{components/common → common}/description/index.d.ts +0 -0
- /package/{components/common → common}/index.d.ts +0 -0
- /package/{components/common → common}/layout/VerticalSpace.cjs +0 -0
- /package/{components/common → common}/layout/VerticalSpace.d.ts +0 -0
- /package/{components/common → common}/layout/VerticalSpace.js +0 -0
- /package/{components/common → common}/layout/index.d.ts +0 -0
- /package/{components/common → common}/loading/LoadingIndicator.d.ts +0 -0
- /package/{components/common → common}/loading/index.d.ts +0 -0
- /package/{components/common → common}/picker/ImagePicker.d.ts +0 -0
- /package/{components/common → common}/picker/index.d.ts +0 -0
- /package/{components/common → common}/radio/RadioGroupComponent.cjs +0 -0
- /package/{components/common → common}/radio/RadioGroupComponent.d.ts +0 -0
- /package/{components/common → common}/radio/RadioGroupComponent.js +0 -0
- /package/{components/common → common}/radio/index.d.ts +0 -0
- /package/{components/common → common}/report/SelectFieldInReport.cjs +0 -0
- /package/{components/common → common}/report/SelectFieldInReport.d.ts +0 -0
- /package/{components/common → common}/report/SelectFieldInReport.js +0 -0
- /package/{components/common → common}/report/index.d.ts +0 -0
- /package/{components/common → common}/select/CustomSelectOption.cjs +0 -0
- /package/{components/common → common}/select/CustomSelectOption.d.ts +0 -0
- /package/{components/common → common}/select/CustomSelectOption.js +0 -0
- /package/{components/common → common}/select/SelectComponent.d.ts +0 -0
- /package/{components/common → common}/select/index.d.ts +0 -0
- /package/{components/common → common}/show-more/index.cjs +0 -0
- /package/{components/common → common}/show-more/index.d.ts +0 -0
- /package/{components/common → common}/show-more/index.js +0 -0
- /package/{components/common → common}/tab/TabViewWithRoute.d.ts +0 -0
- /package/{components/common → common}/tab/index.d.ts +0 -0
- /package/{components/common → common}/table/index.d.ts +0 -0
- /package/{components/common → common}/table/table.cjs +0 -0
- /package/{components/common → common}/table/table.d.ts +0 -0
- /package/{components/common → common}/table/table.js +0 -0
- /package/{components/common → common}/tag/StatusTag.d.ts +0 -0
- /package/{components/common → common}/tag/index.d.ts +0 -0
- /package/{components/common → common}/text/index.cjs +0 -0
- /package/{components/common → common}/text/index.d.ts +0 -0
- /package/{components/common → common}/text/index.js +0 -0
- /package/{components/common → common}/text/title/TitleWithHeadTitle.d.ts +0 -0
- /package/{components/common → common}/text/title/index.cjs +0 -0
- /package/{components/common → common}/text/title/index.d.ts +0 -0
- /package/{components/common → common}/text/title/index.js +0 -0
- /package/{components/common → common}/text-field/NumberField.d.ts +0 -0
- /package/{components/common → common}/text-field/PhoneNumberField.d.ts +0 -0
- /package/{components/common → common}/text-field/TextArea.d.ts +0 -0
- /package/{components/common → common}/text-field/TextField.d.ts +0 -0
- /package/{components/common → common}/text-field/index.d.ts +0 -0
- /package/{components/common → common}/tooltip/TooltipComponent.cjs +0 -0
- /package/{components/common → common}/tooltip/TooltipComponent.d.ts +0 -0
- /package/{components/common → common}/tooltip/TooltipComponent.js +0 -0
- /package/{components/common → common}/tooltip/index.d.ts +0 -0
- /package/{components/common → common}/wizard/WizardResult.d.ts +0 -0
- /package/{components/common → common}/wizard/WizardViewForm.cjs +0 -0
- /package/{components/common → common}/wizard/WizardViewForm.d.ts +0 -0
- /package/{components/common → common}/wizard/WizardViewForm.js +0 -0
- /package/{components/common → common}/wizard/index.d.ts +0 -0
- /package/{components/crud → crud}/CrudField.d.ts +0 -0
- /package/{components/crud → crud}/CrudForm.cjs +0 -0
- /package/{components/crud → crud}/CrudForm.d.ts +0 -0
- /package/{components/crud → crud}/CrudForm.js +0 -0
- /package/{components/crud → crud}/CrudFormWizard.d.ts +0 -0
- /package/{components/crud → crud}/CrudReportComponent.cjs +0 -0
- /package/{components/crud → crud}/CrudReportComponent.d.ts +0 -0
- /package/{components/crud → crud}/CrudReportComponent.js +0 -0
- /package/{components/crud → crud}/CrudSearchComponent.cjs +0 -0
- /package/{components/crud → crud}/CrudSearchComponent.d.ts +0 -0
- /package/{components/crud → crud}/CrudSearchComponent.js +0 -0
- /package/{components/crud → crud}/FileCrudField.d.ts +0 -0
- /package/{components/crud → crud}/ImageCrudField.d.ts +0 -0
- /package/{components/crud → crud}/import/CrudImportButton.d.ts +0 -0
- /package/{components/crud → crud}/import/CrudImportComponent.d.ts +0 -0
- /package/{components/crud → crud}/index.d.ts +0 -0
- /package/{components/crud → crud}/view/CrudDecListView.d.ts +0 -0
- /package/{components/crud → crud}/view/CrudViewer.d.ts +0 -0
- /package/{components/crud → crud}/view/index.d.ts +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const d=require("react/jsx-runtime"),s=require("antd"),t=require("dayjs"),E=require("dayjs/plugin/advancedFormat"),F=require("dayjs/plugin/customParseFormat"),I=require("dayjs/plugin/localeData"),v=require("dayjs/plugin/weekday"),S=require("dayjs/plugin/weekOfYear"),T=require("dayjs/plugin/weekYear"),Y=require("../../locale/hooks/translation-constants.cjs"),$=require("react"),L=require("react-i18next");t.extend(F);t.extend(E);t.extend(v);t.extend(I);t.extend(S);t.extend(T);const M=({type:_,required:q,label:o,rules:x=[],placeholder:a,disabledPastDays:c=!1,disableToday:i=!1,onEnter:z,disabled:f,nextFocus:B,onChange:r,range:m,showTime:l,disabledFutureDays:u,picker:k,defaultValue:O,value:y,format:P,autoComplete:G="off",enabledDates:H=[],renderExtraFooter:j,...p})=>{const{t:w}=L.useTranslation(Y.TRANSLATION_NAMESPACE),A=m?s.DatePicker.RangePicker:s.DatePicker,D=$.useCallback(e=>{if(!e)return!1;const n=t(),N=c&&e<n.startOf("day"),R=u&&e>n.endOf("day"),C=i&&e<n.endOf("day")&&n.startOf("day")<e;return N||R||C},[c,u,i]);return d.jsx(s.Form.Item,{...p,label:o,rules:[{required:q,message:`${o??a??""} ${w("err.validation.required")}`},...x],children:d.jsx(A,{renderExtraFooter:j,value:y,picker:k,defaultValue:O,format:P,onChange:e=>r==null?void 0:r(e),disabledDate:D,disabled:f,className:"w-100",placeholder:a,showTime:l})})};module.exports=M;
|
|
@@ -7,7 +7,7 @@ import S from "dayjs/plugin/localeData";
|
|
|
7
7
|
import T from "dayjs/plugin/weekday";
|
|
8
8
|
import Y from "dayjs/plugin/weekOfYear";
|
|
9
9
|
import $ from "dayjs/plugin/weekYear";
|
|
10
|
-
import { TRANSLATION_NAMESPACE as q } from "
|
|
10
|
+
import { TRANSLATION_NAMESPACE as q } from "../../locale/hooks/translation-constants.js";
|
|
11
11
|
import { useCallback as L } from "react";
|
|
12
12
|
import { useTranslation as M } from "react-i18next";
|
|
13
13
|
e.extend(R);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const l=require("react/jsx-runtime"),c=require("antd"),C=require("dayjs"),q=require("react"),F=require("react-i18next"),M=require("../../locale/hooks/translation-constants.cjs"),$=({type:v,required:T,label:r,rules:f=[],placeholder:t,disabledPast:i=!1,disableCurrent:m=!1,onEnter:w,disabled:x,use12Hours:k,nextFocus:D,onChange:s,range:n,disabledFuture:a,defaultValue:j,value:p,format:A,autoComplete:H="off",renderExtraFooter:N,...P})=>{const{t:R}=F.useTranslation(M.TRANSLATION_NAMESPACE),u=q.useMemo(()=>t||(n?["From","To"]:"Select time"),[t,n]);console.log(u);const y=n?c.TimePicker.RangePicker:c.TimePicker,E=q.useCallback(e=>{if(!e)return!1;const o=C(),I=i&&e<o,S=a&&e>o,d=m&&e<o&&o<e;return I||S||d},[m,a,i]);return l.jsx(c.Form.Item,{...P,label:r,rules:[{required:T,message:`${r??t??""} ${R("err.validation.required")}`},...f],children:l.jsx(y,{use12Hours:k,renderExtraFooter:N,value:p,defaultValue:j,format:A,onChange:e=>s==null?void 0:s(e),disabledDate:E,disabled:x,className:"w-100",placeholder:u})})};module.exports=$;
|
|
@@ -3,7 +3,7 @@ import { TimePicker as a, Form as M } from "antd";
|
|
|
3
3
|
import R from "dayjs";
|
|
4
4
|
import { useMemo as $, useCallback as q } from "react";
|
|
5
5
|
import { useTranslation as v } from "react-i18next";
|
|
6
|
-
import { TRANSLATION_NAMESPACE as w } from "
|
|
6
|
+
import { TRANSLATION_NAMESPACE as w } from "../../locale/hooks/translation-constants.js";
|
|
7
7
|
const K = ({
|
|
8
8
|
type: C,
|
|
9
9
|
required: l,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const y=require("react/jsx-runtime"),f=require("antd"),g=require("../../locale/hooks/translation-constants.cjs"),l=require("react"),A=require("react-i18next");;/* empty css */const d=require("react-router-dom"),q=({className:i,to:t,onClick:n,tooltip:o,ref:x,...r})=>{var a;const{t:e}=A.useTranslation(g.TRANSLATION_NAMESPACE);let s;try{s=(a=d.useNavigate)==null?void 0:a.call(d)}catch(u){console.error(u)}const c=l.useMemo(()=>y.jsx(f.Button,{onClick:n||(t&&s?()=>s(t):void 0),className:i,...r,children:r.children||e(`button.${r.type}`)}),[i,s,n,r,e,t]);return o?y.jsx(f.Tooltip,{title:o,children:c}):c},j=({className:i,to:t,onClick:n,tooltip:o,ref:x,...r})=>{let e;try{e=d.useNavigate()}catch(h){console.error(h)}const[s,c]=l.useState(!1),a=l.useCallback(async h=>{try{return c(!0),await n(h)}finally{c(!1)}},[n]),u=l.useMemo(()=>y.jsx(f.Button,{loading:s||r.loading,onClick:n?a:t?()=>{e?e==null||e(t):window.location.href=t}:void 0,className:i,...r}),[a,i,s,e,n,r,t]);return o?y.jsx(f.Tooltip,{title:o,children:u}):u};q.Async=j;module.exports=q;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as f } from "react/jsx-runtime";
|
|
2
2
|
import { Button as u, Tooltip as d } from "antd";
|
|
3
|
-
import { TRANSLATION_NAMESPACE as g } from "
|
|
3
|
+
import { TRANSLATION_NAMESPACE as g } from "../../locale/hooks/translation-constants.js";
|
|
4
4
|
import { useMemo as y, useState as b, useCallback as T } from "react";
|
|
5
5
|
import { useTranslation as v } from "react-i18next";
|
|
6
6
|
/* empty css */
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const t=require("react/jsx-runtime"),s=require("@ant-design/icons"),r=require("./Button.cjs"),i=require("react-i18next"),c=require("../../locale/hooks/translation-constants.cjs");function u({value:n,onClick:e}){const{t:o}=i.useTranslation(c.TRANSLATION_NAMESPACE);return t.jsx(r,{type:"link",onClick:()=>e(n),icon:t.jsx(s.CopyOutlined,{}),tooltip:o("clone")})}module.exports=u;
|
|
@@ -2,7 +2,7 @@ import { jsx as o } from "react/jsx-runtime";
|
|
|
2
2
|
import { CopyOutlined as i } from "@ant-design/icons";
|
|
3
3
|
import m from "./Button.js";
|
|
4
4
|
import { useTranslation as e } from "react-i18next";
|
|
5
|
-
import { TRANSLATION_NAMESPACE as p } from "
|
|
5
|
+
import { TRANSLATION_NAMESPACE as p } from "../../locale/hooks/translation-constants.js";
|
|
6
6
|
function s({ value: t, onClick: n }) {
|
|
7
7
|
const { t: r } = e(p);
|
|
8
8
|
return /* @__PURE__ */ o(
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const e=require("react/jsx-runtime"),q=require("@ant-design/icons"),T=require("antd"),n=require("react"),p=require("./Button.cjs"),j=require("react-i18next"),g=require("../../locale/hooks/translation-constants.cjs");function m({shouldConfirm:C=!0,block:r,value:i,loading:a,onClick:u,text:c,disabled:l,type:f="link"}){const{t}=j.useTranslation(g.TRANSLATION_NAMESPACE),o=n.useMemo(()=>c??t("str.delete"),[c,t]),[x,s]=n.useState(!1);n.useEffect(()=>{s(a??!1)},[a]);const d=n.useCallback(async()=>{try{s(!0),await u(i)}finally{s(!1)}},[u,i]);return C?e.jsx(T.Popconfirm,{title:t("qus.doYouWantToDelete"),okText:o.toUpperCase(),cancelText:t("str.no").toUpperCase(),onConfirm:d,children:e.jsx(p,{tooltip:o,icon:e.jsx(q.DeleteOutlined,{}),disabled:l,loading:x,type:f,danger:!0,block:r})}):e.jsx(p,{tooltip:o,icon:e.jsx(q.DeleteOutlined,{}),disabled:l,loading:x,type:f,danger:!0,block:r,onClick:d})}module.exports=m;
|
|
@@ -4,7 +4,7 @@ import { Popconfirm as T } from "antd";
|
|
|
4
4
|
import { useMemo as g, useState as x, useEffect as A, useCallback as _ } from "react";
|
|
5
5
|
import d from "./Button.js";
|
|
6
6
|
import { useTranslation as k } from "react-i18next";
|
|
7
|
-
import { TRANSLATION_NAMESPACE as D } from "
|
|
7
|
+
import { TRANSLATION_NAMESPACE as D } from "../../locale/hooks/translation-constants.js";
|
|
8
8
|
function P({
|
|
9
9
|
shouldConfirm: C = !0,
|
|
10
10
|
block: n,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),u=require("@ant-design/icons"),r=require("react"),a=require("react-i18next"),l=require("./Button.cjs"),x=require("../../locale/hooks/translation-constants.cjs");function p({value:t,onClick:e}){const[s,n]=r.useState(!1),{t:i}=a.useTranslation(x.TRANSLATION_NAMESPACE),c=r.useCallback(async()=>{n(!0),e(t).finally(()=>n(!1))},[e,t]);return o.jsx(l,{loading:s,type:"link",onClick:c,icon:o.jsx(u.ExportOutlined,{}),tooltip:i("str.export")})}exports.ExportButton=p;
|
|
@@ -3,7 +3,7 @@ import { ExportOutlined as p } from "@ant-design/icons";
|
|
|
3
3
|
import { useState as s, useCallback as l } from "react";
|
|
4
4
|
import { useTranslation as a } from "react-i18next";
|
|
5
5
|
import f from "./Button.js";
|
|
6
|
-
import { TRANSLATION_NAMESPACE as c } from "
|
|
6
|
+
import { TRANSLATION_NAMESPACE as c } from "../../locale/hooks/translation-constants.js";
|
|
7
7
|
function y({
|
|
8
8
|
value: t,
|
|
9
9
|
onClick: o
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const t=require("react/jsx-runtime"),C=require("@ant-design/icons"),T=require("antd"),n=require("react"),j=require("react-i18next"),g=require("../../locale/hooks/translation-constants.cjs"),q=require("./Button.cjs");function m({shouldConfirm:p=!0,block:s,value:i,loading:c,onClick:a,text:u,disabled:l,type:d="link"}){const{t:e}=j.useTranslation(g.TRANSLATION_NAMESPACE),o=n.useMemo(()=>u??e("str.hide"),[u,e]),[f,r]=n.useState(!1);n.useEffect(()=>{r(c??!1)},[c]);const x=n.useCallback(async()=>{try{r(!0),await a(i)}finally{r(!1)}},[a,i]);return p?t.jsx(T.Popconfirm,{title:e("qus.doYouWantToHide"),okText:o.toUpperCase(),cancelText:e("str.no").toUpperCase(),onConfirm:x,children:t.jsx(q,{tooltip:o,icon:t.jsx(C.DownCircleOutlined,{}),disabled:l,loading:f,type:d,danger:!0,block:s})}):t.jsx(q,{tooltip:o,icon:t.jsx(C.DownCircleOutlined,{}),disabled:l,loading:f,type:d,danger:!0,block:s,onClick:x})}module.exports=m;
|
|
@@ -3,7 +3,7 @@ import { DownCircleOutlined as p } from "@ant-design/icons";
|
|
|
3
3
|
import { Popconfirm as T } from "antd";
|
|
4
4
|
import { useMemo as g, useState as x, useEffect as A, useCallback as _ } from "react";
|
|
5
5
|
import { useTranslation as k } from "react-i18next";
|
|
6
|
-
import { TRANSLATION_NAMESPACE as E } from "
|
|
6
|
+
import { TRANSLATION_NAMESPACE as E } from "../../locale/hooks/translation-constants.js";
|
|
7
7
|
import d from "./Button.js";
|
|
8
8
|
function M({
|
|
9
9
|
shouldConfirm: C = !0,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),k=require("@ant-design/icons"),n=require("react"),q=require("react-i18next"),x=require("../../locale/hooks/translation-constants.cjs"),C=require("./Button.cjs");function S({onClick:o,children:c,accept:u,className:a,disabled:l,type:f="link"}){const[d,i]=n.useState(!1),{t:p}=q.useTranslation(x.TRANSLATION_NAMESPACE),e=n.useRef(null),y=n.useCallback(()=>{m(t=>t+1),e.current&&setTimeout(()=>{var t;(t=e==null?void 0:e.current)==null||t.click()},10)},[]),[g,m]=n.useState(0),j=n.useCallback(async t=>{i(!0);const r=t.target.files[0];r&&await o(r),i(!1)},[o]);return s.jsxs("div",{className:a,children:[s.jsx("input",{type:"file",style:{display:"none"},ref:e,onChange:j,accept:u},g),s.jsx(C,{loading:d,type:f,disabled:l,onClick:y,icon:s.jsx(k.ImportOutlined,{}),tooltip:p("str.import"),children:c})]})}exports.ImportButton=S;
|
|
@@ -2,7 +2,7 @@ import { jsxs as A, jsx as n } from "react/jsx-runtime";
|
|
|
2
2
|
import { ImportOutlined as T } from "@ant-design/icons";
|
|
3
3
|
import { useState as s, useRef as h, useCallback as l } from "react";
|
|
4
4
|
import { useTranslation as x } from "react-i18next";
|
|
5
|
-
import { TRANSLATION_NAMESPACE as N } from "
|
|
5
|
+
import { TRANSLATION_NAMESPACE as N } from "../../locale/hooks/translation-constants.js";
|
|
6
6
|
import S from "./Button.js";
|
|
7
7
|
function _({
|
|
8
8
|
onClick: e,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),a=require("@ant-design/icons"),l=require("react-i18next"),q=require("./Button.cjs"),N=require("../../locale/hooks/translation-constants.cjs"),d=({size:n,block:r,className:s,type:o="primary",onClick:t,title:u,to:i})=>{const{t:c}=l.useTranslation(N.TRANSLATION_NAMESPACE);return e.jsx(q,{type:o,className:s,to:i,block:r,size:n,onClick:t&&(()=>t(!0)),icon:e.jsx(a.PlusOutlined,{}),children:u??c("str.new")})};exports.NewButton=d;
|
|
@@ -2,7 +2,7 @@ import { jsx as r } from "react/jsx-runtime";
|
|
|
2
2
|
import { PlusOutlined as u } from "@ant-design/icons";
|
|
3
3
|
import { useTranslation as f } from "react-i18next";
|
|
4
4
|
import c from "./Button.js";
|
|
5
|
-
import { TRANSLATION_NAMESPACE as l } from "
|
|
5
|
+
import { TRANSLATION_NAMESPACE as l } from "../../locale/hooks/translation-constants.js";
|
|
6
6
|
const w = ({ size: t, block: n, className: m, type: i = "primary", onClick: o, title: e, to: p }) => {
|
|
7
7
|
const { t: s } = f(l);
|
|
8
8
|
return /* @__PURE__ */ r(
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),p=require("@ant-design/icons"),q=require("react-i18next"),P=require("./Button.cjs"),d=require("../../locale/hooks/translation-constants.cjs"),j=({disabled:e,loading:i,block:o,className:s,type:u="primary",onClick:c,title:a,to:l})=>{const{t:n}=q.useTranslation(d.TRANSLATION_NAMESPACE),t=a??n("str.print");return r.jsx(P,{type:u,className:s,to:l,loading:i,disabled:e,block:o,onClick:c,tooltip:t!=null&&t.trim()?"":n("str.print"),icon:r.jsx(p.PrinterOutlined,{}),children:t})};exports.PrintButton=j;
|
|
@@ -2,7 +2,7 @@ import { jsx as o } from "react/jsx-runtime";
|
|
|
2
2
|
import { PrinterOutlined as u } from "@ant-design/icons";
|
|
3
3
|
import { useTranslation as A } from "react-i18next";
|
|
4
4
|
import a from "./Button.js";
|
|
5
|
-
import { TRANSLATION_NAMESPACE as l } from "
|
|
5
|
+
import { TRANSLATION_NAMESPACE as l } from "../../locale/hooks/translation-constants.js";
|
|
6
6
|
const B = ({ disabled: n, loading: i, block: m, className: p, type: s = "primary", onClick: e, title: c, to: f }) => {
|
|
7
7
|
const { t } = A(l), r = c ?? t("str.print");
|
|
8
8
|
return /* @__PURE__ */ o(
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),a=require("@ant-design/icons"),l=require("react-i18next"),d=require("../../locale/hooks/translation-constants.cjs"),q=require("./Button.cjs"),R=({disabled:r,block:n,className:s,type:o="primary",onClick:e,title:i,to:u})=>{const{t:c}=l.useTranslation(d.TRANSLATION_NAMESPACE);return t.jsx(q,{type:o,disabled:r,className:s,to:u,block:n,onClick:e&&(()=>e(!0)),icon:t.jsx(a.ReloadOutlined,{}),children:i??c("str.refresh")})};exports.RefreshButton=R;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as o } from "react/jsx-runtime";
|
|
2
2
|
import { ReloadOutlined as f } from "@ant-design/icons";
|
|
3
3
|
import { useTranslation as u } from "react-i18next";
|
|
4
|
-
import { TRANSLATION_NAMESPACE as a } from "
|
|
4
|
+
import { TRANSLATION_NAMESPACE as a } from "../../locale/hooks/translation-constants.js";
|
|
5
5
|
import c from "./Button.js";
|
|
6
6
|
const R = ({ disabled: t, block: e, className: m, type: n = "primary", onClick: r, title: i, to: p }) => {
|
|
7
7
|
const { t: s } = u(a);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const t=require("react/jsx-runtime"),p=require("@ant-design/icons"),T=require("antd"),n=require("react"),g=require("react-i18next"),C=require("./Button.cjs"),U=require("../../locale/hooks/translation-constants.cjs");function m({shouldConfirm:q=!0,block:s,value:i,loading:c,onClick:u,text:a,disabled:l,type:d="link",hidden:j}){const{t:e}=g.useTranslation(U.TRANSLATION_NAMESPACE),o=n.useMemo(()=>a??e("str.unhide"),[a,e]),[f,r]=n.useState(!1);n.useEffect(()=>{r(c??!1)},[c]);const x=n.useCallback(async()=>{try{r(!0),await u(i)}finally{r(!1)}},[u,i]);return q?t.jsx(T.Popconfirm,{title:e("qus.doYouWantToHide"),okText:o.toUpperCase(),cancelText:e("str.no").toUpperCase(),onConfirm:x,children:t.jsx(C,{tooltip:o,icon:t.jsx(p.UpCircleOutlined,{}),disabled:l,loading:f,type:d,danger:!0,hidden:j,block:s})}):t.jsx(C,{tooltip:o,icon:t.jsx(p.UpCircleOutlined,{}),disabled:l,loading:f,type:d,danger:!0,block:s,onClick:x})}module.exports=m;
|
|
@@ -4,7 +4,7 @@ import { Popconfirm as g } from "antd";
|
|
|
4
4
|
import { useMemo as x, useState as A, useEffect as U, useCallback as _ } from "react";
|
|
5
5
|
import { useTranslation as k } from "react-i18next";
|
|
6
6
|
import d from "./Button.js";
|
|
7
|
-
import { TRANSLATION_NAMESPACE as E } from "
|
|
7
|
+
import { TRANSLATION_NAMESPACE as E } from "../../locale/hooks/translation-constants.js";
|
|
8
8
|
function O({
|
|
9
9
|
shouldConfirm: C = !0,
|
|
10
10
|
block: e,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const t=require("react/jsx-runtime"),o=require("@ant-design/icons"),r=require("react-i18next"),i=require("./Button.cjs"),u=require("../../locale/hooks/translation-constants.cjs");function c({value:n,onClick:e}){const{t:s}=r.useTranslation(u.TRANSLATION_NAMESPACE);return t.jsx(i,{tooltip:s("str.update"),type:"link",onClick:()=>e(n),icon:t.jsx(o.EditOutlined,{})})}module.exports=c;
|
|
@@ -2,7 +2,7 @@ import { jsx as t } from "react/jsx-runtime";
|
|
|
2
2
|
import { EditOutlined as i } from "@ant-design/icons";
|
|
3
3
|
import { useTranslation as m } from "react-i18next";
|
|
4
4
|
import p from "./Button.js";
|
|
5
|
-
import { TRANSLATION_NAMESPACE as e } from "
|
|
5
|
+
import { TRANSLATION_NAMESPACE as e } from "../../locale/hooks/translation-constants.js";
|
|
6
6
|
function d({ value: o, onClick: r }) {
|
|
7
7
|
const { t: n } = m(e);
|
|
8
8
|
return /* @__PURE__ */ t(
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const t=require("react/jsx-runtime"),i=require("@ant-design/icons"),o=require("react-i18next"),r=require("./Button.cjs"),u=require("../../locale/hooks/translation-constants.cjs");function c({value:n,onClick:e}){const{t:s}=o.useTranslation(u.TRANSLATION_NAMESPACE);return t.jsx(r,{type:"link",onClick:()=>e(n),icon:t.jsx(i.EyeOutlined,{}),tooltip:s("str.view")})}module.exports=c;
|
|
@@ -2,7 +2,7 @@ import { jsx as o } from "react/jsx-runtime";
|
|
|
2
2
|
import { EyeOutlined as n } from "@ant-design/icons";
|
|
3
3
|
import { useTranslation as e } from "react-i18next";
|
|
4
4
|
import m from "./Button.js";
|
|
5
|
-
import { TRANSLATION_NAMESPACE as p } from "
|
|
5
|
+
import { TRANSLATION_NAMESPACE as p } from "../../locale/hooks/translation-constants.js";
|
|
6
6
|
function c({ value: t, onClick: r }) {
|
|
7
7
|
const { t: i } = e(p);
|
|
8
8
|
return /* @__PURE__ */ o(
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const n=require("react/jsx-runtime"),o=require("antd"),u=require("react"),a=require("../../util/NumberUtil.cjs"),l=o.Descriptions.Item,m=({list:r,keepEmptyValues:s,...i})=>{const c=u.useMemo(()=>{const t=s?r:r.filter(e=>e&&!!e.value);return t.forEach(e=>{!e.noFormatting&&!isNaN(e.value)&&(e.value=a.default.toMoney(e.value))}),t},[s,r]);return n.jsx(o.Descriptions,{...i,children:c.map(({label:t,value:e})=>n.jsx(l,{label:t,children:e},t))})};module.exports=m;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as i } from "react/jsx-runtime";
|
|
2
2
|
import { Descriptions as n } from "antd";
|
|
3
3
|
import { useMemo as c } from "react";
|
|
4
|
-
import a from "
|
|
4
|
+
import a from "../../util/NumberUtil.js";
|
|
5
5
|
const u = n.Item, h = ({ list: t, keepEmptyValues: e, ...m }) => {
|
|
6
6
|
const s = c(() => {
|
|
7
7
|
const r = e ? t : t.filter((o) => o && !!o.value);
|
package/common/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./layout/VerticalSpace.cjs"),o=require("./text/index.cjs"),r=require("./show-more/index.cjs"),n=require("./button/CloneButtonTable.cjs"),i=require("./button/DeleteButtonTable.cjs"),u=require("./button/HideButtonTable.cjs"),c=require("./button/UnHideButton.cjs"),s=require("./button/UpdateButtonTable.cjs"),a=require("./button/ViewButtonTable.cjs"),l=require("./description/DescList.cjs"),q=require("./loading/LoadingIndicator.cjs"),d=require("./select/CustomSelectOption.cjs"),p=require("./table/table.cjs"),B=require("./tag/StatusTag.cjs"),T=require("./text-field/PhoneNumberField.cjs"),m=require("./tooltip/TooltipComponent.cjs"),b=require("./wizard/WizardResult.cjs"),C=require("./wizard/WizardViewForm.cjs"),x=require("./DatePicker/DatePicker.cjs"),S=require("./DatePicker/TimePicker.cjs"),e=require("./button/Button.cjs"),R=require("./button/ExportButton.cjs"),h=require("./button/ImportButton.cjs"),w=require("./button/NewButton.cjs"),P=require("./button/PrintButton.cjs"),F=require("./button/RefreshButton.cjs"),I=require("./check-box/CheckBox.cjs"),V=require("./picker/ImagePicker.cjs"),g=require("./radio/RadioGroupComponent.cjs"),k=require("./report/SelectFieldInReport.cjs"),f=require("./select/SelectComponent.cjs"),W=require("./tab/TabViewWithRoute.cjs"),D=require("./text/title/index.cjs"),N=require("./text-field/TextField.cjs"),z=require("./text-field/TextArea.cjs"),H=require("./text-field/NumberField.cjs");exports.VerticalSpace=t;exports.Text=o.Text;exports.ShowMore=r.ShowMore;exports.CloneButtonTable=n;exports.DeleteButtonTable=i;exports.HideButtonTable=u;exports.UnHideButton=c;exports.UpdateButtonTable=s;exports.ViewButtonTable=a;exports.DescList=l;exports.LoadingIndicator=q;exports.CustomSelectOption=d;exports.TableComponent=p;exports.StatusTag=B;exports.PhoneField=T;exports.TooltipComponent=m;exports.WizardResult=b;exports.WizardViewForm=C;exports.DatePickerComponent=x;exports.TimePickerComponent=S;exports.Button=e;exports.ButtonComponent=e;exports.ExportButton=R.ExportButton;exports.ImportButton=h.ImportButton;exports.NewButton=w.NewButton;exports.PrintButton=P.PrintButton;exports.RefreshButton=F.RefreshButton;exports.CheckBoxComponent=I;exports.ImagePicker=V.default;exports.RadioGroupComponent=g;exports.SelectFieldInReport=k.SelectFieldInReport;exports.SelectComponent=f;exports.TabViewWithRoute=W.TabViewWithRoute;exports.Title=D.Title;exports.TextField=N.default;exports.TextAreaComponent=z.default;exports.NumberTextField=H;
|
package/common/index.js
CHANGED
|
@@ -1,39 +1,39 @@
|
|
|
1
|
-
import { default as o } from "
|
|
2
|
-
import { Text as a } from "
|
|
3
|
-
import { ShowMore as p } from "
|
|
4
|
-
import { default as l } from "
|
|
5
|
-
import { default as x } from "
|
|
6
|
-
import { default as n } from "
|
|
7
|
-
import { default as i } from "
|
|
8
|
-
import { default as B } from "
|
|
9
|
-
import { default as c } from "
|
|
10
|
-
import { default as S } from "
|
|
11
|
-
import { default as w } from "
|
|
12
|
-
import { default as P } from "
|
|
13
|
-
import { default as k } from "
|
|
14
|
-
import { default as V } from "
|
|
15
|
-
import { default as D } from "
|
|
16
|
-
import { default as z } from "
|
|
17
|
-
import { default as L } from "
|
|
18
|
-
import { default as U } from "
|
|
19
|
-
import { default as E } from "
|
|
20
|
-
import { default as M } from "
|
|
21
|
-
import { default as j, default as q } from "
|
|
22
|
-
import { ExportButton as y } from "
|
|
23
|
-
import { ImportButton as K } from "
|
|
24
|
-
import { NewButton as X } from "
|
|
25
|
-
import { PrintButton as Z } from "
|
|
26
|
-
import { RefreshButton as $ } from "
|
|
27
|
-
import { default as et } from "
|
|
28
|
-
import { default as rt } from "
|
|
29
|
-
import { default as ft } from "
|
|
30
|
-
import { SelectFieldInReport as mt } from "
|
|
31
|
-
import { default as ut } from "
|
|
32
|
-
import { TabViewWithRoute as dt } from "
|
|
33
|
-
import { Title as st } from "
|
|
34
|
-
import { default as Tt } from "
|
|
35
|
-
import { default as Ct } from "
|
|
36
|
-
import { default as bt } from "
|
|
1
|
+
import { default as o } from "./layout/VerticalSpace.js";
|
|
2
|
+
import { Text as a } from "./text/index.js";
|
|
3
|
+
import { ShowMore as p } from "./show-more/index.js";
|
|
4
|
+
import { default as l } from "./button/CloneButtonTable.js";
|
|
5
|
+
import { default as x } from "./button/DeleteButtonTable.js";
|
|
6
|
+
import { default as n } from "./button/HideButtonTable.js";
|
|
7
|
+
import { default as i } from "./button/UnHideButton.js";
|
|
8
|
+
import { default as B } from "./button/UpdateButtonTable.js";
|
|
9
|
+
import { default as c } from "./button/ViewButtonTable.js";
|
|
10
|
+
import { default as S } from "./description/DescList.js";
|
|
11
|
+
import { default as w } from "./loading/LoadingIndicator.js";
|
|
12
|
+
import { default as P } from "./select/CustomSelectOption.js";
|
|
13
|
+
import { default as k } from "./table/table.js";
|
|
14
|
+
import { default as V } from "./tag/StatusTag.js";
|
|
15
|
+
import { default as D } from "./text-field/PhoneNumberField.js";
|
|
16
|
+
import { default as z } from "./tooltip/TooltipComponent.js";
|
|
17
|
+
import { default as L } from "./wizard/WizardResult.js";
|
|
18
|
+
import { default as U } from "./wizard/WizardViewForm.js";
|
|
19
|
+
import { default as E } from "./DatePicker/DatePicker.js";
|
|
20
|
+
import { default as M } from "./DatePicker/TimePicker.js";
|
|
21
|
+
import { default as j, default as q } from "./button/Button.js";
|
|
22
|
+
import { ExportButton as y } from "./button/ExportButton.js";
|
|
23
|
+
import { ImportButton as K } from "./button/ImportButton.js";
|
|
24
|
+
import { NewButton as X } from "./button/NewButton.js";
|
|
25
|
+
import { PrintButton as Z } from "./button/PrintButton.js";
|
|
26
|
+
import { RefreshButton as $ } from "./button/RefreshButton.js";
|
|
27
|
+
import { default as et } from "./check-box/CheckBox.js";
|
|
28
|
+
import { default as rt } from "./picker/ImagePicker.js";
|
|
29
|
+
import { default as ft } from "./radio/RadioGroupComponent.js";
|
|
30
|
+
import { SelectFieldInReport as mt } from "./report/SelectFieldInReport.js";
|
|
31
|
+
import { default as ut } from "./select/SelectComponent.js";
|
|
32
|
+
import { TabViewWithRoute as dt } from "./tab/TabViewWithRoute.js";
|
|
33
|
+
import { Title as st } from "./text/title/index.js";
|
|
34
|
+
import { default as Tt } from "./text-field/TextField.js";
|
|
35
|
+
import { default as Ct } from "./text-field/TextArea.js";
|
|
36
|
+
import { default as bt } from "./text-field/NumberField.js";
|
|
37
37
|
export {
|
|
38
38
|
j as Button,
|
|
39
39
|
q as ButtonComponent,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const t=require("react/jsx-runtime"),r=require("antd"),o=require("react-i18next"),i=require("../button/Button.cjs"),c=require("../../locale/hooks/translation-constants.cjs"),u=({loading:s,children:n,error:a})=>{const{t:e}=o.useTranslation(c.TRANSLATION_NAMESPACE);return t.jsx(r.Skeleton,{loading:s,paragraph:!0,className:"h-100",children:a?t.jsx(r.Result,{status:"404",title:404,subTitle:e("err.notFound"),className:"",extra:t.jsx(i,{to:-1,type:"primary",children:e("str.goBack")})}):n})};module.exports=u;
|
|
@@ -2,7 +2,7 @@ import { jsx as t } from "react/jsx-runtime";
|
|
|
2
2
|
import { Skeleton as n, Result as s } from "antd";
|
|
3
3
|
import { useTranslation as m } from "react-i18next";
|
|
4
4
|
import i from "../button/Button.js";
|
|
5
|
-
import { TRANSLATION_NAMESPACE as p } from "
|
|
5
|
+
import { TRANSLATION_NAMESPACE as p } from "../../locale/hooks/translation-constants.js";
|
|
6
6
|
const N = ({ loading: o, children: e, error: a }) => {
|
|
7
7
|
const { t: r } = m(p);
|
|
8
8
|
return (
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("react/jsx-runtime");;/* empty css */;/* empty css */const S=require("@ant-design/icons"),F=require("antd"),s=require("react"),xe=require("react-cropper"),he=require("react-i18next"),je=require("../../locale/hooks/translation-constants.cjs"),E=require("../button/Button.cjs"),we=require("../../util/ImageUtil.cjs"),Ce=F.Form.Item;function X(r){return new Promise((d,p)=>{const n=new FileReader;n.readAsDataURL(r),n.onload=()=>d(n.result),n.onerror=f=>p(f)})}const ve=({values:r=[],required:d,buttonType:p,label:n,name:f,onChange:m,aspectRatio:N,buttonTitle:j,hidePreview:w,buttonSize:g="large",showButtonText:x=!0,showOnlyIcon:D=!1,icon:y=t.jsx(S.UploadOutlined,{}),loading:O,maxCount:C=1,onAdd:l,onRemove:U,listType:I,..._})=>{const[Z,ee]=s.useState(""),[te,se]=s.useState(""),[re,z]=s.useState(!1),q=s.useRef(),a=s.useRef(),[i,M]=s.useState([]),[h,k]=s.useState(),ne=s.useRef(),oe=()=>z(!1),ae=async e=>{!e.url&&!e.preview&&(e.preview=await X(e.originFileObj)),se(e.url||e.preview),z(!0),ee(e.name)},[B,R]=s.useState(!1),ie=()=>{},T=e=>{var o;(o=a==null?void 0:a.current)==null||o.cropper.rotate(e?-90:90)};s.useEffect(()=>{m==null||m(i[0],i)},[i,m]);const ce=()=>{var b;const e=(b=a==null?void 0:a.current)==null?void 0:b.cropper.getCroppedCanvas(),{type:o,size:c,name:u,uid:v}=q.current;R(!0),e==null||e.toBlob(async me=>{const ge=Object.assign(new File([me],u,{type:o}),{uid:v}),G=await we.resizeImage(ge),K=await X(G),Q={url:K,name:u,uid:v,type:o,size:c,thumbUrl:K,originFileObj:G};if(l)try{R(!0),await l(Q)}finally{R(!1)}M([Q,...i]),R(!1)}),k(void 0)},le=()=>{k(void 0),q.current=void 0},L=s.useCallback(e=>{const o=e;if(o){q.current=o;const c=new FileReader;c.addEventListener("load",()=>{var u;if(typeof c.result=="string"){k(c.result);const v=localStorage.getItem("cropper.box"),b=v?JSON.parse(v):void 0;b&&((u=a==null?void 0:a.current)==null||u.cropper.setCropBoxData(b)),setTimeout(()=>{H()},100)}}),c.readAsDataURL(o)}},[]);s.useEffect(()=>{if(r!=null&&r.length||typeof r=="string"){const e=Array.isArray(r)?r.map(o=>[{uid:r,url:o}]):[{uid:r,url:r}];M(e)}},[r]);const{t:P}=he.useTranslation(je.TRANSLATION_NAMESPACE),de=s.useMemo(()=>d?{required:d,validator:(e,o,c)=>{h||i!=null&&i.length?c():c(`${n??""} ${P("err.validation.required")}`)}}:void 0,[d,h,i==null?void 0:i.length,n,P]),J=j??P("message.fileUploadMessage2"),V=s.useMemo(()=>t.jsx(Y,{showLoadingIndicator:B,_buttonTitle:J,buttonSize:g,buttonType:p,fileList:i,hidePreview:w,icon:y,loading:O,listType:I,maxCount:C,onChangeFile:L,onRemove:U,showButtonText:x,handlePreview:ae,setFileList:M}),[B,J,g,p,i,w,y,O,I,C,L,U,x]);ne.current=V.props.beforeUpload;const[ue,W]=s.useState(0),[pe,$]=s.useState(0),[A,fe]=s.useState();s.useEffect(()=>{const e=setTimeout(()=>{A&&localStorage.setItem("cropper.box",JSON.stringify(A))},400);return()=>clearTimeout(e)},[A]),s.useEffect(()=>{h||(W(0),$(0))},[h]);const H=s.useCallback(async()=>{var o;const e=(o=a==null?void 0:a.current)==null?void 0:o.cropper;if(e){const{width:c,height:u}=e.getCroppedCanvas();fe(e.getCropBoxData()),W(c),$(u)}},[]);return t.jsxs(t.Fragment,{children:[t.jsx(Ce,{label:n,..._,name:f,className:"mb-0",rules:[de,..._.rules??[]],children:V}),t.jsxs(F.Modal,{open:!!h,maskClosable:!1,onOk:ce,closable:!1,onCancel:le,children:[t.jsx(xe.Cropper,{ref:a,src:h,cropmove:H,viewMode:1,aspectRatio:N,cropend:()=>ie()}),t.jsx("p",{className:"text-center",children:[ue,pe].join(" ⨉ ")}),t.jsxs("div",{className:"mt-2 d-flex justify-content-center",children:[t.jsx(E,{size:"large",icon:t.jsx(S.RotateLeftOutlined,{}),onClick:()=>T(!0)}),t.jsx(E,{size:"large",icon:t.jsx(S.RotateRightOutlined,{}),onClick:()=>T(!1)})]})]}),t.jsx(F.Modal,{open:re,title:Z,footer:null,onCancel:oe,children:t.jsx("div",{className:"text-center",children:t.jsx("img",{alt:"example",style:{maxWidth:"400px"},src:te})})})]})},Y=({_buttonTitle:r,buttonSize:d,buttonType:p,fileList:n,hidePreview:f,icon:m,loading:N,maxCount:j,onChangeFile:w,onRemove:g,showButtonText:x,handlePreview:D,setFileList:y,showLoadingIndicator:O,listType:C="picture"})=>t.jsx(t.Fragment,{children:t.jsxs(F.Upload,{accept:"image/x-png,image/gif,image/jpeg",fileList:n,defaultFileList:n,onChange:()=>{},className:(n.length>=j?" hide-upload ":"")+" mb-0",multiple:!1,onPreview:f?void 0:D,onDrop:l=>(w(l.dataTransfer.files.item(0)),!1),listType:C,showUploadList:!f,onRemove:l=>{const U=n.filter(I=>l.uid!==I.uid);g==null||g(l),y(U)},beforeUpload:async l=>(w(l),!1),maxCount:j,children:[O&&t.jsx(S.LoadingOutlined,{}),t.jsx("div",{className:"d-flex flex-column",children:n.length<j&&(C==="picture-circle"?t.jsx(S.UploadOutlined,{}):t.jsx(E,{loading:N,tooltip:x?void 0:r,size:d,icon:m,type:x?p:"text",children:x?r:void 0}))})]},n.length)});exports.UploadComponent=Y;exports.default=ve;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { jsx as t, jsxs as S, Fragment as oe } from "react/jsx-runtime";
|
|
2
|
-
/* empty css
|
|
2
|
+
/* empty css */
|
|
3
3
|
/* empty css */
|
|
4
4
|
import { RotateLeftOutlined as ye, RotateRightOutlined as Ie, UploadOutlined as ne, LoadingOutlined as Oe } from "@ant-design/icons";
|
|
5
5
|
import { Form as Ue, Modal as q, Upload as Ne } from "antd";
|
|
6
6
|
import z, { useRef as B, useState as w, useEffect as R, useCallback as ee, useMemo as te } from "react";
|
|
7
7
|
import { Cropper as Fe } from "react-cropper";
|
|
8
8
|
import { useTranslation as Re } from "react-i18next";
|
|
9
|
-
import { TRANSLATION_NAMESPACE as Se } from "
|
|
9
|
+
import { TRANSLATION_NAMESPACE as Se } from "../../locale/hooks/translation-constants.js";
|
|
10
10
|
import E from "../button/Button.js";
|
|
11
|
-
import je from "
|
|
11
|
+
import je from "../../util/ImageUtil.js";
|
|
12
12
|
const ke = Ue.Item;
|
|
13
13
|
function re(r) {
|
|
14
14
|
return new Promise((l, p) => {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const r=require("react/jsx-runtime"),a=require("antd"),k=require("react"),H=require("react-i18next"),P=require("../../locale/hooks/translation-constants.cjs"),b=require("../tooltip/TooltipComponent.cjs");function B({label:l,rules:j=[],required:w,placeholder:h,notSearch:q,children:x,readOnly:s,items:o,dropdownRender:L,itemBuilder:T,loading:f,showLoadingInEmptyIndicator:N,nameFieldInArray:m="name",innerRef:_,tooltip:I,filterOption:p,tagRender:A,...n}){const{t:E}=H.useTranslation(P.TRANSLATION_NAMESPACE),M=k.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[m];return r.jsx("option",{value:t,children:r.jsx("div",{dangerouslySetInnerHTML:{__html:c}})},t)},[m]);return r.jsx(a.ConfigProvider,{renderEmpty:N&&f?()=>r.jsx(a.Spin,{}):void 0,children:r.jsx(b,{title:I,children:r.jsx(a.Form.Item,{label:l,name:n.name,help:n.help,className:n.className,rules:[...j,{required:w,message:`${l??h??""} ${E("err.validation.required")}`}],children:r.jsx(a.Select,{ref:_,loading:f,open:s?!1:void 0,onChange:!s&&n.onChange,allowClear:!s&&n.allowClear,showSearch:!q,className:`max-width ${s?"readOnly":""}`,...n,tagRender:A,placeholder:h??l,filterOption:p??((e,t)=>{var c,C,u,g;try{const i=(u=(C=(c=t==null?void 0:t.children)==null?void 0:c.props)==null?void 0:C.dangerouslySetInnerHTML)==null?void 0:u.__html,O=e.toLowerCase().split(/\s+/),S=(t==null?void 0:t.children)??"",y=typeof S=="string"?S.toLowerCase():typeof i=="string"?i.toLowerCase():"",R=(((g=t==null?void 0:t.value)==null?void 0:g.toString())??"").toLowerCase(),$=y.replace(/\s/g,"");return O.every(d=>y.indexOf(d)>=0||R.indexOf(d)>=0||$.indexOf(d)>=0)}catch(i){return console.log(i),!0}}),dropdownRender:L,children:x===null?void 0:x??(o&&(o==null?void 0:o.map(T??M)))})})})})}module.exports=B;
|
|
@@ -2,7 +2,7 @@ import { jsx as t } from "react/jsx-runtime";
|
|
|
2
2
|
import { ConfigProvider as P, Spin as b, Form as j, Select as q } from "antd";
|
|
3
3
|
import { useCallback as B } from "react";
|
|
4
4
|
import { useTranslation as D } from "react-i18next";
|
|
5
|
-
import { TRANSLATION_NAMESPACE as F } from "
|
|
5
|
+
import { TRANSLATION_NAMESPACE as F } from "../../locale/hooks/translation-constants.js";
|
|
6
6
|
import R from "../tooltip/TooltipComponent.js";
|
|
7
7
|
function Q({
|
|
8
8
|
label: m,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),c=require("antd"),g=require("../../context/WindowDimension.cjs"),i=require("react"),u=require("react-router"),q=require("react-router-dom"),{Content:T}=c.Layout,y=({positionOfRoute:n,initialKey:s="*",tabs:l,className:d="",mode:h="default"})=>{const[b,m]=i.useState(s),o=u.useNavigate(),p=e=>{o(e)},r=q.useLocation();i.useEffect(()=>{const e=r.pathname.split("/")[n];m(e??""),e||o(s,{replace:!0})},[s,r.pathname,o,n]);const{isDesktop:x}=g(),a=h==="side"&&x,f=a?"left":"top",j=a?"d-flex h-100":"";return t.jsxs("div",{className:`${d} ${j}`,children:[t.jsx(c.Tabs,{type:"card",tabPosition:f,activeKey:b,onChange:p,children:l.map(({key:e,label:v})=>t.jsx(c.Tabs.TabPane,{tab:v},e))}),t.jsx(T,{className:`max-height ${a?"overflow-auto":""}`,children:t.jsx(u.Outlet,{})})]})};exports.TabViewWithRoute=y;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsxs as v, jsx as e } from "react/jsx-runtime";
|
|
2
2
|
import { Tabs as r, Layout as x } from "antd";
|
|
3
|
-
import g from "
|
|
3
|
+
import g from "../../context/WindowDimension.js";
|
|
4
4
|
import { useState as y, useEffect as S } from "react";
|
|
5
5
|
import { useNavigate as w, Outlet as N } from "react-router";
|
|
6
6
|
import { useLocation as P } from "react-router-dom";
|
|
@@ -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;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as i } from "react/jsx-runtime";
|
|
2
2
|
import { Tag as f } from "antd";
|
|
3
|
-
import { TRANSLATION_NAMESPACE as T } from "
|
|
3
|
+
import { TRANSLATION_NAMESPACE as T } from "../../locale/hooks/translation-constants.js";
|
|
4
4
|
import { useTranslation as A } from "react-i18next";
|
|
5
5
|
const S = ({
|
|
6
6
|
onClick: e,
|
|
@@ -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;
|
|
@@ -2,7 +2,7 @@ import { jsx as i } from "react/jsx-runtime";
|
|
|
2
2
|
import { Form as P, InputNumber as R } from "antd";
|
|
3
3
|
import { forwardRef as S, useMemo as F } from "react";
|
|
4
4
|
import { useTranslation as L } from "react-i18next";
|
|
5
|
-
import { TRANSLATION_NAMESPACE as O } from "
|
|
5
|
+
import { TRANSLATION_NAMESPACE as O } from "../../locale/hooks/translation-constants.js";
|
|
6
6
|
import _ from "../tooltip/TooltipComponent.js";
|
|
7
7
|
import { onEnterInternalTextField as b } from "./TextField.js";
|
|
8
8
|
const K = S(
|
|
@@ -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 @@
|
|
|
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;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as a } from "react/jsx-runtime";
|
|
2
2
|
import { Form as m, Input as l } from "antd";
|
|
3
3
|
import { useTranslation as A } from "react-i18next";
|
|
4
|
-
import { TRANSLATION_NAMESPACE as I } from "
|
|
4
|
+
import { TRANSLATION_NAMESPACE as I } from "../../locale/hooks/translation-constants.js";
|
|
5
5
|
const T = (r, e, t, n) => {
|
|
6
6
|
var o;
|
|
7
7
|
e && t && (r.preventDefault(), (o = t == null ? void 0 : t.getFieldInstance(e)) == null || o.focus()), n && n(r);
|
|
@@ -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;
|
|
@@ -3,7 +3,7 @@ import { LoadingOutlined as O } from "@ant-design/icons";
|
|
|
3
3
|
import { Input as d, Form as S } from "antd";
|
|
4
4
|
import { useMemo as $ } from "react";
|
|
5
5
|
import { useTranslation as j } from "react-i18next";
|
|
6
|
-
import { TRANSLATION_NAMESPACE as D } from "
|
|
6
|
+
import { TRANSLATION_NAMESPACE as D } from "../../locale/hooks/translation-constants.js";
|
|
7
7
|
import R from "../tooltip/TooltipComponent.js";
|
|
8
8
|
const _ = (o, n, t, r) => {
|
|
9
9
|
var i;
|
|
@@ -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;
|
|
@@ -4,7 +4,7 @@ import { Result as C } from "antd";
|
|
|
4
4
|
import { t as m } from "i18next";
|
|
5
5
|
import { useTranslation as L } from "react-i18next";
|
|
6
6
|
import l from "../button/Button.js";
|
|
7
|
-
import { TRANSLATION_NAMESPACE as N } from "
|
|
7
|
+
import { TRANSLATION_NAMESPACE as N } from "../../locale/hooks/translation-constants.js";
|
|
8
8
|
const w = ({
|
|
9
9
|
errorChildren: u,
|
|
10
10
|
children: a,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const n=require("react/jsx-runtime"),y=require("antd"),ae=require("dayjs"),o=require("react"),le=require("react-i18next"),ie=require("../locale/hooks/translation-constants.cjs"),ce=require("./CrudForm.cjs"),re=require("./CrudFormWizard.cjs"),ue=require("./import/CrudImportButton.cjs"),de=require("./view/CrudViewer.cjs"),fe=require("../common/button/NewButton.cjs"),pe=require("../common/button/PrintButton.cjs"),{useForm:me}=y.Form;function ye({idField:C="id",onCreate:g,onDelete:M,onHide:_,onUpdate:f,fields:l,data:w,grid:D,isHiding:R,isCreating:h,isDeleting:U,isUpdating:q,paginateProps:W,onPrint:N,printing:L,viewable:H,loadingData:G,formBuilder:J,extraAction:K,minusHeight:Q,cloneable:X,fullWidthModal:Y=!0,wizard:i,extraView:Z,importable:P,onClickNew:V,...$}){const{t:v}=le.useTranslation(ie.TRANSLATION_NAMESPACE),[j,x]=o.useState(!1),[p,k]=o.useState(),[z,B]=o.useState(),[c]=me(),A=o.useCallback(async s=>{const u=i?s:await c.validateFields(),r=l.filter(e=>e.type==="color"),a={};r.forEach(e=>{var d;const t=c.getFieldValue(e.name);a[e.name]=typeof t=="string"?t:(d=t==null?void 0:t.toHexString())==null?void 0:d.toUpperCase()}),Object.assign(u,a),p&&f?(await f({...u,[C]:p[C]}),k(void 0)):!p&&g&&await g(u),B(void 0),c.resetFields(),x(!1)},[l,c,C,g,f,p,i]),[ee,I]=o.useState(!1),[te,S]=o.useState(!1);o.useEffect(()=>{j?(I(!1),S(!1)):F(void 0)},[j]);const O=o.useCallback(async s=>{I(s),S(!0)},[]),T=o.useCallback(async()=>{S(!0)},[]),[ne,E]=o.useState(!1),b=o.useCallback(async(s,u=!0,r=!1)=>{try{E(!0),x(!0),u&&F("update");const a={};for(const e of l){const t=s[e.name];if(r&&e.type==="image"){const d=t;try{const oe=await e.provider.clone(d);a[e.name]=oe;continue}catch{continue}}e.type==="date"?t&&(a[e.name]=ae(t)):e.type==="select"?e.multiple&&Array.isArray(t)?a[e.name]=t.map(d=>d[e.innerFieldId??"id"]):t&&typeof t=="object"?a[e.name]=t[e.innerFieldId??"id"]:(t&&typeof t=="string"||typeof t=="number")&&(a[e.name]=t):a[e.name]=t}c.setFieldsValue(a),B(a),u&&k(s)}finally{E(!1)}},[l,c]),[m,F]=o.useState(),se=o.useCallback(async s=>{F("clone"),b(s,!1,!0)},[b]);return n.jsxs(n.Fragment,{children:[n.jsxs(y.Space,{direction:"vertical",className:"w-100",children:[n.jsxs("div",{className:"w-100 d-flex",children:[n.jsx("div",{style:{flex:1},children:n.jsx(fe.NewButton,{onClick:()=>{V?V():(x(s=>!s),F("new"))},className:"flex-1"})}),n.jsxs(y.Space,{children:[!!N&&n.jsx(pe.PrintButton,{className:"float-right",loading:L,onClick:N}),!!P&&n.jsx(ue,{fields:l,importProps:P})]})]}),n.jsx(de,{...$,minusHeight:Q,data:w,fields:l,extraAction:K,idField:C,isDeleting:U,loadingData:G,onClickUpdate:f?b:void 0,onHide:_,isHiding:R,onDelete:M,onUpdate:f,onClickClone:X?se:void 0,paginateProps:W,viewable:H,extraView:Z})]}),n.jsx(y.Modal,{width:Y?"100%":void 0,title:v(m??"new"),open:j,confirmLoading:h||q,okText:v("str."+(m==="update"?"update":"save")),cancelText:v("str.cancel"),cancelButtonProps:{disabled:te,hidden:!!i},okButtonProps:{disabled:ee,hidden:!!i},onCancel:async()=>{try{if(m==="clone"){const s=i?p:c.getFieldsValue(),u=l.filter(r=>r.type==="image");for(const r of u)s[r.name]&&r.provider.delete(s[r.name])}}finally{}i||c.resetFields(),B(void 0),k(void 0),x(!1)},onOk:()=>A(),destroyOnClose:!0,children:n.jsxs(y.Spin,{spinning:ne,children:[!i&&n.jsx(ce.CrudForm,{purpose:m,fields:l,form:c,formBuilder:J,grid:D,onDeleteFile:T,onUploadFile:O}),i&&n.jsx(re,{submitting:h||q,className:"mt-2",onSave:A,updatingValue:z,fields:l,onDeleteFile:T,onUploadFile:O,purpose:m,wizard:i})]})})]})}module.exports=ye;
|
|
@@ -8,7 +8,7 @@ import { CrudSearchComponentProps } from './CrudSearchComponent';
|
|
|
8
8
|
import { FileCrudField } from './FileCrudField';
|
|
9
9
|
import { ImageCrudField } from './ImageCrudField';
|
|
10
10
|
import { CrudImportProps } from './import/CrudImportComponent';
|
|
11
|
-
import { SelectTagRenderProps } from '
|
|
11
|
+
import { SelectTagRenderProps } from 'common/select/SelectComponent';
|
|
12
12
|
export type SelectFieldItem = {
|
|
13
13
|
key?: string | number;
|
|
14
14
|
value: string | number;
|
|
@@ -3,7 +3,7 @@ import { Space as D, Modal as re, Spin as ce, Form as me } from "antd";
|
|
|
3
3
|
import fe from "dayjs";
|
|
4
4
|
import { useState as m, useCallback as F, useEffect as de } from "react";
|
|
5
5
|
import { useTranslation as ue } from "react-i18next";
|
|
6
|
-
import { TRANSLATION_NAMESPACE as pe } from "
|
|
6
|
+
import { TRANSLATION_NAMESPACE as pe } from "../locale/hooks/translation-constants.js";
|
|
7
7
|
import { CrudForm as ye } from "./CrudForm.js";
|
|
8
8
|
import Fe from "./CrudFormWizard.js";
|
|
9
9
|
import ge from "./import/CrudImportButton.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("react/jsx-runtime"),v=require("antd"),q=require("react"),D=require("react-highlight-words"),W=require("react-i18next"),G=require("../locale/hooks/translation-constants.cjs"),$=require("./FileCrudField.cjs"),z=require("./ImageCrudField.cjs"),J=require("../common/DatePicker/DatePicker.cjs"),K=require("../common/DatePicker/TimePicker.cjs"),Q=require("../common/check-box/CheckBox.cjs"),L=require("../common/select/SelectComponent.cjs"),X=require("../common/text-field/NumberField.cjs"),Y=require("../common/text-field/TextField.cjs"),Z=require("../common/text-field/TextArea.cjs"),V=require("../common/tooltip/TooltipComponent.cjs");function ee(F){const{label:o,name:c,type:p,required:i,hidden:N,rules:m=[],updatable:h=!0,readonly:S=!1,fieldClassName:C,customFormFieldRender:w,fieldTooltip:b,...e}=F,g=v.Form.useFormInstance();q.useEffect(()=>{if(p==="select"){const{items:a=[],onSearch:n,searchOnType:l}=e;!(a!=null&&a.length)&&!l&&(n==null||n(void 0,g,e==null?void 0:e.updatingValue))}},[g,e,p,e==null?void 0:e.updatingValue]);const{t:T}=W.useTranslation(G.TRANSLATION_NAMESPACE);if(S||N)return t.jsx(t.Fragment,{});if(w)return w(g,F);switch(p){case"text":case"email":case"password":{const{onChange:a,placeholder:n}=e;return t.jsx(Y.default,{placeholder:n,disabled:!h,rules:m,required:i,onChange:a?l=>a(l,g):void 0,type:p,name:c,tooltip:b,label:o,className:C,autoComplete:"new-password"})}case"number":{const{onChange:a,placeholder:n,allowMinus:l}=e;return t.jsx(X,{placeholder:n,disabled:!h,moneyField:!!e.formatted,type:p,onChange:a?f=>a(f,g):void 0,rules:m,autoComplete:"false",required:i,tooltip:b,className:C,min:l?null:void 0,name:c,label:o})}case"date":{const{range:a,disableToday:n,disabledFutureDays:l,disabledPastDays:f,onChange:x,placeholder:u,format:y}=e;return t.jsx(J,{placeholder:u,required:i,disabled:!h,type:p,format:y,tooltip:b,range:a,name:c,label:o,onChange:x?s=>x(s,g):void 0,className:C,disableToday:n,disabledFutureDays:l,disabledPastDays:f})}case"time":{const{range:a=!1,disableCurrent:n,disabledFuture:l,disabledPast:f,onChange:x,use12Hours:u,format:y,placeholder:s}=e;return t.jsx(K,{placeholder:s,required:i,format:y,disabled:!h,type:p,tooltip:b,range:a,use12Hours:u,name:c,label:o,onChange:x?j=>x(j,g):void 0,className:C,disableCurrent:n,disabledFuture:l,disabledPast:f})}case"textarea":{const{onChange:a,placeholder:n,rows:l,cols:f}=e;return t.jsx(Z.default,{rules:m,placeholder:n,onChange:a?x=>{var u;return a((u=x==null?void 0:x.target)==null?void 0:u.value,g)}:void 0,tooltip:b,required:i,disabled:!h,name:c,label:o,className:C,rows:l,cols:f})}case"image":return t.jsx(z.default,{...e,required:i,name:c,label:o,rules:m,fieldClassName:C,onRemoved:e.onRemoved,onUploading:e.onUploading,provider:e.provider});case"file":return t.jsx($.default,{...e,required:i,name:c,label:o,rules:m,fieldClassName:C,onRemoved:e.onRemoved,onUploading:e.onUploading,provider:e.provider});case"select":return t.jsx(B,{...e,required:i,name:c,label:o,rules:m,fieldClassName:C,form:g,updatable:h,readonly:S,fieldTooltip:b});case"enum":{const{enum:a,radio:n=!1,translation:l,onChange:f,onSearch:x,multiple:u}=e,y=Array.isArray(a)?a:Object.keys(a);return n?t.jsx(v.Form.Item,{...e,name:c,required:i,tooltip:b,rules:m,label:o,className:["w-100",C].join(" "),children:t.jsx(v.Radio.Group,{...e,onChange:f?s=>{var j;return f((j=s==null?void 0:s.target)==null?void 0:j.value,g)}:void 0,children:y.map(s=>t.jsx(v.Radio,{disabled:!h,value:s,children:l?T(l[s]):s},s))})}):t.jsx(L,{...e,onChange:f?s=>f(s,g):void 0,className:["w-100",C].join(" "),name:c,items:y,required:i,tooltip:b,rules:m,label:o,disabled:!h,onSearch:x?s=>x(s,g):void 0,allowClear:!0,mode:u?"multiple":void 0,itemBuilder:s=>t.jsx(v.Select.Option,{value:s,children:l?T(l[s]):s},s)})}case"checkbox":{const{onChange:a}=e;return t.jsx(Q,{className:C,rules:m,onChange:a?n=>a(n,g):void 0,label:o,tooltip:b,disabled:!h,name:c})}case"color":return t.jsx(H,{...e,type:"color",required:i,name:c,label:o,rules:m,fieldClassName:C,updatable:h,readonly:S,fieldTooltip:b});default:return t.jsx(t.Fragment,{children:`${p} Not Implemented`})}}function B(F){const{items:o=[],loading:c,searchOnType:p,onSearch:i,multiple:N,onChange:m,highlightSearch:h,required:S,fieldClassName:C,rules:w,fieldTooltip:b,updatable:e,label:g,name:T,tagRender:a,updatingValue:n,onSet:l,placeholder:f,allowClear:x=!0}=F,u=F.form,[y,s]=q.useState(""),j=v.Form.useWatch(T,u),[k,O]=q.useState(!0);q.useEffect(()=>{l&&k&&j&&(l==null||l(j,o,u),O(!1))},[k,u,o,T,l,j]),q.useEffect(()=>{j&&O(!0)},[j]);const M=q.useCallback(async r=>{s(r),p&&(i==null||i(r,u,n))},[u,i,p,n]);return t.jsx(L,{...F,maxTagCount:"responsive",maxTagPlaceholder:r=>t.jsxs(V,{title:t.jsx(t.Fragment,{children:r.map(d=>t.jsxs(t.Fragment,{children:[d.label," ",t.jsx("br",{})]}))}),children:["+",r==null?void 0:r.length]}),placeholder:f,onSelect:r=>{l==null||l(r==null?void 0:r.key,o,u)},onChange:m?r=>{s(""),m(r,u)}:void 0,mode:N?"multiple":void 0,className:["w-100",C].join(" "),name:T,items:o,required:S,tooltip:b,tagRender:a,rules:w,disabled:!e,label:g,allowClear:x,onSearch:M,loading:c,filterOption:h?(r,d)=>{var R,P,A;try{const I=r.toLowerCase().split(/\s+/),U=((typeof(d==null?void 0:d.children)=="string"?d==null?void 0:d.children:(P=(R=d==null?void 0:d.children)==null?void 0:R.props)==null?void 0:P.textToHighlight)??"").toLowerCase(),_=(((A=d==null?void 0:d.value)==null?void 0:A.toString())??"").toLowerCase();return I.every(E=>U.indexOf(E)>=0||_.indexOf(E)>=0)}catch{return!0}}:void 0,itemBuilder:h?r=>{const d=r.value?String(r.value):void 0;return t.jsx(v.Select.Option,{value:r.key,title:d,disabled:r.disabled,children:t.jsx(D,{highlightClassName:"highlight-text",searchWords:(y??"").split(" "),autoEscape:!0,textToHighlight:d??""})},r.key)}:r=>t.jsx(v.Select.Option,{value:r.key,title:r.value,disabled:r.disabled,children:r.value},r.key)})}function H(F){const{required:o,fieldClassName:c,rules:p,fieldTooltip:i,updatable:N,label:m,name:h}=F;return t.jsx(v.Form.Item,{label:m,name:h,required:o,rules:p,tooltip:i,children:t.jsx(v.ColorPicker,{disabledAlpha:!0,format:"hex",defaultFormat:"hex",showText:!0,trigger:"click",className:c,disabled:!N,...F.innerProps})})}exports.ColorCrudFieldComponent=H;exports.SelectCrudFieldComponent=B;exports.default=ee;
|
|
@@ -3,7 +3,7 @@ import { Form as S, Radio as q, Select as A, ColorPicker as $ } from "antd";
|
|
|
3
3
|
import { useEffect as P, useState as D, useCallback as z } from "react";
|
|
4
4
|
import J from "react-highlight-words";
|
|
5
5
|
import { useTranslation as K } from "react-i18next";
|
|
6
|
-
import { TRANSLATION_NAMESPACE as Q } from "
|
|
6
|
+
import { TRANSLATION_NAMESPACE as Q } from "../locale/hooks/translation-constants.js";
|
|
7
7
|
import X from "./FileCrudField.js";
|
|
8
8
|
import Y from "./ImageCrudField.js";
|
|
9
9
|
import Z from "../common/DatePicker/DatePicker.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const e=require("react/jsx-runtime"),g=require("@ant-design/icons"),u=require("antd"),F=require("react"),k=require("react-i18next"),S=require("../locale/hooks/translation-constants.cjs"),y=require("./CrudForm.cjs"),C=require("../common/button/Button.cjs"),T=require("../common/wizard/WizardViewForm.cjs");function v({fields:l,className:m,onDeleteFile:h,onUploadFile:i,purpose:c,wizard:r=[],updatingValue:f,onSave:x,submitting:j}){const d=F.useMemo(()=>r.map(n=>{let t=!0;const o=l.filter(s=>n.fields.includes(s.name));return o.forEach(s=>t&&(t=s.hidden??!1)),{...n,hidden:t,fieldThatShouldShowing:o}}),[l,r]),a=F.useMemo(()=>d.filter(n=>!n.hidden),[d]);return e.jsx(e.Fragment,{children:e.jsx(T,{onSubmit:(n,t)=>{console.log(t),x(t)},className:m,pages:a.map(({title:n,icon:t,fieldThatShouldShowing:o,hidden:s},b)=>({title:n,icon:t,hidden:s,component:q=>e.jsx(R,{fields:o,onDeleteFile:h,onUploadFile:i,purpose:c,i:b,updatingValue:f,backward:q.backward,forward:q.forward,wizard:a,submitting:j},b)}))})})}function R({fields:l,onDeleteFile:m,onUploadFile:h,purpose:i,wizard:c=[],i:r,forward:f,backward:x,submitting:j,updatingValue:d}){const a=c[r],{t:n}=k.useTranslation(S.TRANSLATION_NAMESPACE),[t]=u.Form.useForm();return F.useEffect(()=>{if(d&&(i==="update"||i==="clone")){const o={};for(const s of l)o[s.name]=d[s.name];t.setFieldsValue(o)}},[l,t,i,d]),e.jsxs(u.Form,{name:String(r),form:t,layout:"vertical",children:[e.jsx(y.CrudFormFields,{fields:l,formBuilder:a.formBuilder,grid:a.grid,onDeleteFile:m,onUploadFile:h,purpose:i}),e.jsx(u.Divider,{}),e.jsxs(u.Row,{gutter:[8,8],children:[r>0&&e.jsx(u.Col,{md:12,children:e.jsx(C,{block:!0,icon:e.jsx(g.LeftOutlined,{}),htmlType:"button",type:"default",size:"large",onClick:()=>x(),children:n("str.back")})}),e.jsx(u.Col,{md:r>0?12:24,children:e.jsx(C,{block:!0,icon:c.length-1===r?e.jsx(g.SaveOutlined,{}):e.jsx(g.RightOutlined,{}),htmlType:"submit",type:"primary",loading:j,size:"large",onClick:()=>{t.validateFields().then(o=>{f(o,c.length-1===r,c.length-1===r)})},children:c.length-1===r?n("str."+(i==="update"?"update":"save")):n("str.next")})})]})]})}module.exports=v;
|