@kingteza/crud-component 1.0.11 → 1.0.13
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/package.json +10 -3
- package/dist/_virtual/FileSaver.min.cjs +0 -1
- package/dist/_virtual/FileSaver.min.js +0 -5
- package/dist/_virtual/FileSaver.min2.cjs +0 -1
- package/dist/_virtual/FileSaver.min2.js +0 -4
- package/dist/_virtual/ShowMoreText.cjs +0 -1
- package/dist/_virtual/ShowMoreText.js +0 -7
- package/dist/_virtual/ShowMoreText2.cjs +0 -1
- package/dist/_virtual/ShowMoreText2.js +0 -4
- package/dist/_virtual/Truncate.cjs +0 -1
- package/dist/_virtual/Truncate.js +0 -4
- package/dist/_virtual/_commonjsHelpers.cjs +0 -1
- package/dist/_virtual/_commonjsHelpers.js +0 -8
- package/dist/_virtual/advancedFormat.cjs +0 -1
- package/dist/_virtual/advancedFormat.js +0 -7
- package/dist/_virtual/advancedFormat2.cjs +0 -1
- package/dist/_virtual/advancedFormat2.js +0 -4
- package/dist/_virtual/customParseFormat.cjs +0 -1
- package/dist/_virtual/customParseFormat.js +0 -7
- package/dist/_virtual/customParseFormat2.cjs +0 -1
- package/dist/_virtual/customParseFormat2.js +0 -4
- package/dist/_virtual/dayjs.min.cjs +0 -1
- package/dist/_virtual/dayjs.min.js +0 -7
- package/dist/_virtual/dayjs.min2.cjs +0 -1
- package/dist/_virtual/dayjs.min2.js +0 -4
- package/dist/_virtual/index.cjs +0 -1
- package/dist/_virtual/index.js +0 -7
- package/dist/_virtual/index10.cjs +0 -1
- package/dist/_virtual/index10.js +0 -4
- package/dist/_virtual/index2.cjs +0 -1
- package/dist/_virtual/index2.js +0 -4
- package/dist/_virtual/index3.cjs +0 -1
- package/dist/_virtual/index3.js +0 -4
- package/dist/_virtual/index4.cjs +0 -1
- package/dist/_virtual/index4.js +0 -2
- package/dist/_virtual/index5.cjs +0 -1
- package/dist/_virtual/index5.js +0 -4
- package/dist/_virtual/index6.cjs +0 -1
- package/dist/_virtual/index6.js +0 -7
- package/dist/_virtual/index7.cjs +0 -1
- package/dist/_virtual/index7.js +0 -7
- package/dist/_virtual/index8.cjs +0 -1
- package/dist/_virtual/index8.js +0 -7
- package/dist/_virtual/index9.cjs +0 -1
- package/dist/_virtual/index9.js +0 -4
- package/dist/_virtual/jsx-runtime.cjs +0 -1
- package/dist/_virtual/jsx-runtime.js +0 -5
- package/dist/_virtual/jsx-runtime2.cjs +0 -1
- package/dist/_virtual/jsx-runtime2.js +0 -4
- package/dist/_virtual/localeData.cjs +0 -1
- package/dist/_virtual/localeData.js +0 -7
- package/dist/_virtual/localeData2.cjs +0 -1
- package/dist/_virtual/localeData2.js +0 -4
- package/dist/_virtual/main.cjs +0 -1
- package/dist/_virtual/main.js +0 -7
- package/dist/_virtual/main2.cjs +0 -1
- package/dist/_virtual/main2.js +0 -4
- package/dist/_virtual/papaparse.min.cjs +0 -1
- package/dist/_virtual/papaparse.min.js +0 -7
- package/dist/_virtual/papaparse.min2.cjs +0 -1
- package/dist/_virtual/papaparse.min2.js +0 -4
- package/dist/_virtual/react-is.development.cjs +0 -1
- package/dist/_virtual/react-is.development.js +0 -4
- package/dist/_virtual/react-is.production.min.cjs +0 -1
- package/dist/_virtual/react-is.production.min.js +0 -4
- package/dist/_virtual/react-jsx-runtime.development.cjs +0 -1
- package/dist/_virtual/react-jsx-runtime.development.js +0 -4
- package/dist/_virtual/react-jsx-runtime.production.min.cjs +0 -1
- package/dist/_virtual/react-jsx-runtime.production.min.js +0 -4
- package/dist/_virtual/weekOfYear.cjs +0 -1
- package/dist/_virtual/weekOfYear.js +0 -7
- package/dist/_virtual/weekOfYear2.cjs +0 -1
- package/dist/_virtual/weekOfYear2.js +0 -4
- package/dist/_virtual/weekYear.cjs +0 -1
- package/dist/_virtual/weekYear.js +0 -7
- package/dist/_virtual/weekYear2.cjs +0 -1
- package/dist/_virtual/weekYear2.js +0 -4
- package/dist/_virtual/weekday.cjs +0 -1
- package/dist/_virtual/weekday.js +0 -7
- package/dist/_virtual/weekday2.cjs +0 -1
- package/dist/_virtual/weekday2.js +0 -4
- package/dist/common/index.cjs +0 -1
- package/dist/common/index.js +0 -75
- package/dist/context/WindowDimension.d.ts +0 -4
- package/dist/crud-component.css +0 -9
- package/dist/src/components/common/DatePicker/DatePicker.cjs +0 -1
- package/dist/src/components/common/DatePicker/DatePicker.js +0 -88
- package/dist/src/components/common/DatePicker/TimePicker.cjs +0 -1
- package/dist/src/components/common/DatePicker/TimePicker.js +0 -78
- package/dist/src/components/common/appearance/Hider.cjs +0 -1
- package/dist/src/components/common/appearance/Hider.js +0 -5
- package/dist/src/components/common/button/Button.cjs +0 -1
- package/dist/src/components/common/button/Button.js +0 -64
- package/dist/src/components/common/button/CloneButtonTable.cjs +0 -1
- package/dist/src/components/common/button/CloneButtonTable.js +0 -20
- package/dist/src/components/common/button/DeleteButtonTable.cjs +0 -1
- package/dist/src/components/common/button/DeleteButtonTable.js +0 -68
- package/dist/src/components/common/button/ExportButton.cjs +0 -1
- package/dist/src/components/common/button/ExportButton.js +0 -27
- package/dist/src/components/common/button/HideButtonTable.cjs +0 -1
- package/dist/src/components/common/button/HideButtonTable.js +0 -68
- package/dist/src/components/common/button/ImportButton.cjs +0 -1
- package/dist/src/components/common/button/ImportButton.js +0 -56
- package/dist/src/components/common/button/NewButton.cjs +0 -1
- package/dist/src/components/common/button/NewButton.js +0 -24
- package/dist/src/components/common/button/PrintButton.cjs +0 -1
- package/dist/src/components/common/button/PrintButton.js +0 -26
- package/dist/src/components/common/button/RefreshButton.cjs +0 -1
- package/dist/src/components/common/button/RefreshButton.js +0 -24
- package/dist/src/components/common/button/UnHideButton.cjs +0 -1
- package/dist/src/components/common/button/UnHideButton.js +0 -70
- package/dist/src/components/common/button/UpdateButtonTable.cjs +0 -1
- package/dist/src/components/common/button/UpdateButtonTable.js +0 -20
- package/dist/src/components/common/button/ViewButtonTable.cjs +0 -1
- package/dist/src/components/common/button/ViewButtonTable.js +0 -20
- package/dist/src/components/common/check-box/CheckBox.cjs +0 -1
- package/dist/src/components/common/check-box/CheckBox.js +0 -40
- package/dist/src/components/common/description/DescList.cjs +0 -1
- package/dist/src/components/common/description/DescList.js +0 -16
- package/dist/src/components/common/layout/VerticalSpace.cjs +0 -1
- package/dist/src/components/common/layout/VerticalSpace.js +0 -6
- package/dist/src/components/common/loading/LoadingIndicator.cjs +0 -1
- package/dist/src/components/common/loading/LoadingIndicator.js +0 -24
- package/dist/src/components/common/picker/ImagePicker.cjs +0 -1
- package/dist/src/components/common/picker/ImagePicker.js +0 -285
- package/dist/src/components/common/radio/RadioGroupComponent.cjs +0 -1
- package/dist/src/components/common/radio/RadioGroupComponent.js +0 -19
- package/dist/src/components/common/report/SelectFieldInReport.cjs +0 -1
- package/dist/src/components/common/report/SelectFieldInReport.js +0 -30
- package/dist/src/components/common/select/CustomSelectOption.cjs +0 -1
- package/dist/src/components/common/select/CustomSelectOption.js +0 -13
- package/dist/src/components/common/select/SelectComponent.cjs +0 -1
- package/dist/src/components/common/select/SelectComponent.js +0 -89
- package/dist/src/components/common/show-more/index.cjs +0 -1
- package/dist/src/components/common/show-more/index.js +0 -8
- package/dist/src/components/common/tab/TabViewWithRoute.cjs +0 -1
- package/dist/src/components/common/tab/TabViewWithRoute.js +0 -37
- package/dist/src/components/common/table/table.cjs +0 -1
- package/dist/src/components/common/table/table.js +0 -40
- package/dist/src/components/common/tag/StatusTag.cjs +0 -1
- package/dist/src/components/common/tag/StatusTag.js +0 -30
- package/dist/src/components/common/text/index.cjs +0 -1
- package/dist/src/components/common/text/index.js +0 -5
- package/dist/src/components/common/text/title/index.cjs +0 -1
- package/dist/src/components/common/text/title/index.js +0 -5
- package/dist/src/components/common/text-field/NumberField.cjs +0 -1
- package/dist/src/components/common/text-field/NumberField.js +0 -83
- package/dist/src/components/common/text-field/PhoneNumberField.cjs +0 -1
- package/dist/src/components/common/text-field/PhoneNumberField.js +0 -18
- package/dist/src/components/common/text-field/TextArea.cjs +0 -1
- package/dist/src/components/common/text-field/TextArea.js +0 -47
- package/dist/src/components/common/text-field/TextField.cjs +0 -1
- package/dist/src/components/common/text-field/TextField.js +0 -73
- package/dist/src/components/common/tooltip/TooltipComponent.cjs +0 -1
- package/dist/src/components/common/tooltip/TooltipComponent.js +0 -9
- package/dist/src/components/common/wizard/WizardResult.cjs +0 -1
- package/dist/src/components/common/wizard/WizardResult.js +0 -61
- package/dist/src/components/common/wizard/WizardViewForm.cjs +0 -1
- package/dist/src/components/common/wizard/WizardViewForm.js +0 -74
- package/dist/src/components/crud/CrudComponent.cjs +0 -1
- package/dist/src/components/crud/CrudComponent.js +0 -210
- package/dist/src/components/crud/CrudField.cjs +0 -1
- package/dist/src/components/crud/CrudField.js +0 -459
- package/dist/src/components/crud/CrudForm.cjs +0 -1
- package/dist/src/components/crud/CrudForm.js +0 -91
- package/dist/src/components/crud/CrudFormWizard.cjs +0 -1
- package/dist/src/components/crud/CrudFormWizard.js +0 -142
- package/dist/src/components/crud/CrudReportComponent.cjs +0 -4
- package/dist/src/components/crud/CrudReportComponent.js +0 -255
- package/dist/src/components/crud/CrudSearchComponent.cjs +0 -1
- package/dist/src/components/crud/CrudSearchComponent.js +0 -95
- package/dist/src/components/crud/FileCrudField.cjs +0 -1
- package/dist/src/components/crud/FileCrudField.js +0 -227
- package/dist/src/components/crud/ImageCrudField.cjs +0 -1
- package/dist/src/components/crud/ImageCrudField.js +0 -113
- package/dist/src/components/crud/import/CrudImportButton.cjs +0 -1
- package/dist/src/components/crud/import/CrudImportButton.js +0 -31
- package/dist/src/components/crud/import/CrudImportComponent.cjs +0 -2
- package/dist/src/components/crud/import/CrudImportComponent.js +0 -222
- package/dist/src/components/crud/view/CrudDecListView.cjs +0 -1
- package/dist/src/components/crud/view/CrudDecListView.js +0 -42
- package/dist/src/components/crud/view/CrudViewer.cjs +0 -1
- package/dist/src/components/crud/view/CrudViewer.js +0 -217
- package/dist/src/components/crud/view/CrudViewerUtil.cjs +0 -1
- package/dist/src/components/crud/view/CrudViewerUtil.js +0 -58
- package/dist/src/context/WindowDimension.cjs +0 -1
- package/dist/src/context/WindowDimension.js +0 -8
- package/dist/src/locale/hooks/translation-constants.cjs +0 -1
- package/dist/src/locale/hooks/translation-constants.js +0 -4
- package/dist/src/locale/index.cjs +0 -1
- package/dist/src/locale/index.js +0 -33
- package/dist/src/locale/translations/en.cjs +0 -1
- package/dist/src/locale/translations/en.js +0 -60
- package/dist/src/util/DateUtil.cjs +0 -1
- package/dist/src/util/DateUtil.js +0 -6
- package/dist/src/util/ImageUtil.cjs +0 -1
- package/dist/src/util/ImageUtil.js +0 -63
- package/dist/src/util/NumberUtil.cjs +0 -1
- package/dist/src/util/NumberUtil.js +0 -60
- package/dist/src/util/ValidationUtil.cjs +0 -1
- package/dist/src/util/ValidationUtil.js +0 -60
- package/dist/types/DialogComponentProp.d.ts +0 -8
- package/dist/types/Id.d.ts +0 -10
- package/dist/vite.svg +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const s=require("../../../_virtual/jsx-runtime.cjs"),f=require("antd"),ae=require("../../../_virtual/dayjs.min.cjs"),o=require("react"),ie=require("../../locale/hooks/translation-constants.cjs"),le=require("./CrudForm.cjs"),re=require("./CrudFormWizard.cjs"),ce=require("./import/CrudImportButton.cjs"),ue=require("./view/CrudViewer.cjs"),de=require("../common/button/NewButton.cjs"),pe=require("../common/button/PrintButton.cjs"),me=require("../../../node_modules/react-i18next/dist/es/useTranslation.cjs"),{useForm:xe}=f.Form;function fe({idField:j="id",onCreate:F,onDelete:_,onHide:I,onUpdate:p,fields:i,data:M,grid:w,isHiding:D,isCreating:S,isDeleting:U,isUpdating:b,paginateProps:W,onPrint:h,printing:L,viewable:H,loadingData:G,formBuilder:J,extraAction:K,minusHeight:Q,cloneable:X,fullWidthModal:Y=!0,wizard:l,extraView:Z,importable:q,onClickNew:N,...$}){const{t:g}=me.useTranslation(ie.TRANSLATION_NAMESPACE),[v,y]=o.useState(!1),[m,E]=o.useState(),[z,k]=o.useState(),[r]=xe(),P=o.useCallback(async n=>{const u=l?n:await r.validateFields(),c=i.filter(e=>e.type==="color"),a={};c.forEach(e=>{var d;const t=r.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),m&&p?(await p({...u,[j]:m[j]}),E(void 0)):!m&&F&&await F(u),k(void 0),r.resetFields(),y(!1)},[i,r,j,F,p,m,l]),[ee,V]=o.useState(!1),[te,B]=o.useState(!1);o.useEffect(()=>{v?(V(!1),B(!1)):C(void 0)},[v]);const A=o.useCallback(async n=>{V(n),B(!0)},[]),T=o.useCallback(async()=>{B(!0)},[]),[se,O]=o.useState(!1),R=o.useCallback(async(n,u=!0,c=!1)=>{try{O(!0),y(!0),u&&C("update");const a={};for(const e of i){const t=n[e.name];if(c&&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}r.setFieldsValue(a),k(a),u&&E(n)}finally{O(!1)}},[i,r]),[x,C]=o.useState(),ne=o.useCallback(async n=>{C("clone"),R(n,!1,!0)},[R]);return s.jsxRuntimeExports.jsxs(s.jsxRuntimeExports.Fragment,{children:[s.jsxRuntimeExports.jsxs(f.Space,{direction:"vertical",className:"w-100",children:[s.jsxRuntimeExports.jsxs("div",{className:"w-100 d-flex",children:[s.jsxRuntimeExports.jsx("div",{style:{flex:1},children:s.jsxRuntimeExports.jsx(de.NewButton,{onClick:()=>{N?N():(y(n=>!n),C("new"))},className:"flex-1"})}),s.jsxRuntimeExports.jsxs(f.Space,{children:[!!h&&s.jsxRuntimeExports.jsx(pe.PrintButton,{className:"float-right",loading:L,onClick:h}),!!q&&s.jsxRuntimeExports.jsx(ce,{fields:i,importProps:q})]})]}),s.jsxRuntimeExports.jsx(ue,{...$,minusHeight:Q,data:M,fields:i,extraAction:K,idField:j,isDeleting:U,loadingData:G,onClickUpdate:p?R:void 0,onHide:I,isHiding:D,onDelete:_,onUpdate:p,onClickClone:X?ne:void 0,paginateProps:W,viewable:H,extraView:Z})]}),s.jsxRuntimeExports.jsx(f.Modal,{width:Y?"100%":void 0,title:g(x??"new"),open:v,confirmLoading:S||b,okText:g("str."+(x==="update"?"update":"save")),cancelText:g("str.cancel"),cancelButtonProps:{disabled:te,hidden:!!l},okButtonProps:{disabled:ee,hidden:!!l},onCancel:async()=>{try{if(x==="clone"){const n=l?m:r.getFieldsValue(),u=i.filter(c=>c.type==="image");for(const c of u)n[c.name]&&c.provider.delete(n[c.name])}}finally{}l||r.resetFields(),k(void 0),E(void 0),y(!1)},onOk:()=>P(),destroyOnClose:!0,children:s.jsxRuntimeExports.jsxs(f.Spin,{spinning:se,children:[!l&&s.jsxRuntimeExports.jsx(le.CrudForm,{purpose:x,fields:i,form:r,formBuilder:J,grid:w,onDeleteFile:T,onUploadFile:A}),l&&s.jsxRuntimeExports.jsx(re,{submitting:S||b,className:"mt-2",onSave:P,updatingValue:z,fields:i,onDeleteFile:T,onUploadFile:A,purpose:x,wizard:l})]})})]})}module.exports=fe;
|
|
@@ -1,210 +0,0 @@
|
|
|
1
|
-
import { j as o } from "../../../_virtual/jsx-runtime.js";
|
|
2
|
-
import { Space as _, Modal as ae, Spin as ie, Form as re } from "antd";
|
|
3
|
-
import ce from "../../../_virtual/dayjs.min.js";
|
|
4
|
-
import { useState as m, useCallback as y, useEffect as me } from "react";
|
|
5
|
-
import { TRANSLATION_NAMESPACE as fe } from "../../locale/hooks/translation-constants.js";
|
|
6
|
-
import { CrudForm as de } from "./CrudForm.js";
|
|
7
|
-
import ue from "./CrudFormWizard.js";
|
|
8
|
-
import pe from "./import/CrudImportButton.js";
|
|
9
|
-
import ye from "./view/CrudViewer.js";
|
|
10
|
-
import { NewButton as xe } from "../common/button/NewButton.js";
|
|
11
|
-
import { PrintButton as Fe } from "../common/button/PrintButton.js";
|
|
12
|
-
import { useTranslation as ge } from "../../../node_modules/react-i18next/dist/es/useTranslation.js";
|
|
13
|
-
const { useForm: je } = re;
|
|
14
|
-
function Oe({
|
|
15
|
-
idField: x = "id",
|
|
16
|
-
onCreate: j,
|
|
17
|
-
onDelete: D,
|
|
18
|
-
onHide: U,
|
|
19
|
-
onUpdate: d,
|
|
20
|
-
fields: l,
|
|
21
|
-
data: W,
|
|
22
|
-
grid: w,
|
|
23
|
-
isHiding: L,
|
|
24
|
-
isCreating: S,
|
|
25
|
-
isDeleting: R,
|
|
26
|
-
isUpdating: N,
|
|
27
|
-
paginateProps: H,
|
|
28
|
-
onPrint: V,
|
|
29
|
-
printing: q,
|
|
30
|
-
viewable: G,
|
|
31
|
-
loadingData: J,
|
|
32
|
-
formBuilder: K,
|
|
33
|
-
extraAction: Q,
|
|
34
|
-
minusHeight: X,
|
|
35
|
-
cloneable: Y,
|
|
36
|
-
fullWidthModal: Z = !0,
|
|
37
|
-
wizard: a,
|
|
38
|
-
extraView: $,
|
|
39
|
-
importable: P,
|
|
40
|
-
onClickNew: A,
|
|
41
|
-
...z
|
|
42
|
-
}) {
|
|
43
|
-
const { t: v } = ge(fe), [C, F] = m(!1), [u, B] = m(), [ee, h] = m(), [i] = je(), E = y(
|
|
44
|
-
async (n) => {
|
|
45
|
-
const c = a ? n : await i.validateFields(), r = l.filter((e) => e.type === "color"), s = {};
|
|
46
|
-
r.forEach((e) => {
|
|
47
|
-
var f;
|
|
48
|
-
const t = i.getFieldValue(e.name);
|
|
49
|
-
s[e.name] = typeof t == "string" ? t : (f = t == null ? void 0 : t.toHexString()) == null ? void 0 : f.toUpperCase();
|
|
50
|
-
}), Object.assign(c, s), u && d ? (await d({
|
|
51
|
-
...c,
|
|
52
|
-
[x]: u[x]
|
|
53
|
-
}), B(void 0)) : !u && j && await j(c), h(void 0), i.resetFields(), F(!1);
|
|
54
|
-
},
|
|
55
|
-
[l, i, x, j, d, u, a]
|
|
56
|
-
), [te, O] = m(!1), [oe, k] = m(!1);
|
|
57
|
-
me(() => {
|
|
58
|
-
C ? (O(!1), k(!1)) : g(void 0);
|
|
59
|
-
}, [C]);
|
|
60
|
-
const T = y(async (n) => {
|
|
61
|
-
O(n), k(!0);
|
|
62
|
-
}, []), I = y(async () => {
|
|
63
|
-
k(!0);
|
|
64
|
-
}, []), [ne, M] = m(!1), b = y(
|
|
65
|
-
async (n, c = !0, r = !1) => {
|
|
66
|
-
try {
|
|
67
|
-
M(!0), F(!0), c && g("update");
|
|
68
|
-
const s = {};
|
|
69
|
-
for (const e of l) {
|
|
70
|
-
const t = n[e.name];
|
|
71
|
-
if (r && e.type === "image") {
|
|
72
|
-
const f = t;
|
|
73
|
-
try {
|
|
74
|
-
const le = await e.provider.clone(f);
|
|
75
|
-
s[e.name] = le;
|
|
76
|
-
continue;
|
|
77
|
-
} catch {
|
|
78
|
-
continue;
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
e.type === "date" ? t && (s[e.name] = ce(t)) : e.type === "select" ? e.multiple && Array.isArray(t) ? s[e.name] = t.map(
|
|
82
|
-
(f) => f[e.innerFieldId ?? "id"]
|
|
83
|
-
) : t && typeof t == "object" ? s[e.name] = t[e.innerFieldId ?? "id"] : (t && typeof t == "string" || typeof t == "number") && (s[e.name] = t) : s[e.name] = t;
|
|
84
|
-
}
|
|
85
|
-
i.setFieldsValue(s), h(s), c && B(n);
|
|
86
|
-
} finally {
|
|
87
|
-
M(!1);
|
|
88
|
-
}
|
|
89
|
-
},
|
|
90
|
-
[l, i]
|
|
91
|
-
), [p, g] = m(), se = y(
|
|
92
|
-
async (n) => {
|
|
93
|
-
g("clone"), b(n, !1, !0);
|
|
94
|
-
},
|
|
95
|
-
[b]
|
|
96
|
-
);
|
|
97
|
-
return /* @__PURE__ */ o.jsxs(o.Fragment, { children: [
|
|
98
|
-
/* @__PURE__ */ o.jsxs(_, { direction: "vertical", className: "w-100", children: [
|
|
99
|
-
/* @__PURE__ */ o.jsxs("div", { className: "w-100 d-flex", children: [
|
|
100
|
-
/* @__PURE__ */ o.jsx("div", { style: { flex: 1 }, children: /* @__PURE__ */ o.jsx(
|
|
101
|
-
xe,
|
|
102
|
-
{
|
|
103
|
-
onClick: () => {
|
|
104
|
-
A ? A() : (F((n) => !n), g("new"));
|
|
105
|
-
},
|
|
106
|
-
className: "flex-1"
|
|
107
|
-
}
|
|
108
|
-
) }),
|
|
109
|
-
/* @__PURE__ */ o.jsxs(_, { children: [
|
|
110
|
-
!!V && /* @__PURE__ */ o.jsx(
|
|
111
|
-
Fe,
|
|
112
|
-
{
|
|
113
|
-
className: "float-right",
|
|
114
|
-
loading: q,
|
|
115
|
-
onClick: V
|
|
116
|
-
}
|
|
117
|
-
),
|
|
118
|
-
!!P && /* @__PURE__ */ o.jsx(pe, { fields: l, importProps: P })
|
|
119
|
-
] })
|
|
120
|
-
] }),
|
|
121
|
-
/* @__PURE__ */ o.jsx(
|
|
122
|
-
ye,
|
|
123
|
-
{
|
|
124
|
-
...z,
|
|
125
|
-
minusHeight: X,
|
|
126
|
-
data: W,
|
|
127
|
-
fields: l,
|
|
128
|
-
extraAction: Q,
|
|
129
|
-
idField: x,
|
|
130
|
-
isDeleting: R,
|
|
131
|
-
loadingData: J,
|
|
132
|
-
onClickUpdate: d ? b : void 0,
|
|
133
|
-
onHide: U,
|
|
134
|
-
isHiding: L,
|
|
135
|
-
onDelete: D,
|
|
136
|
-
onUpdate: d,
|
|
137
|
-
onClickClone: Y ? se : void 0,
|
|
138
|
-
paginateProps: H,
|
|
139
|
-
viewable: G,
|
|
140
|
-
extraView: $
|
|
141
|
-
}
|
|
142
|
-
)
|
|
143
|
-
] }),
|
|
144
|
-
/* @__PURE__ */ o.jsx(
|
|
145
|
-
ae,
|
|
146
|
-
{
|
|
147
|
-
width: Z ? "100%" : void 0,
|
|
148
|
-
title: v(p ?? "new"),
|
|
149
|
-
open: C,
|
|
150
|
-
confirmLoading: S || N,
|
|
151
|
-
okText: v("str." + (p === "update" ? "update" : "save")),
|
|
152
|
-
cancelText: v("str.cancel"),
|
|
153
|
-
cancelButtonProps: {
|
|
154
|
-
disabled: oe,
|
|
155
|
-
hidden: !!a
|
|
156
|
-
},
|
|
157
|
-
okButtonProps: {
|
|
158
|
-
disabled: te,
|
|
159
|
-
hidden: !!a
|
|
160
|
-
},
|
|
161
|
-
onCancel: async () => {
|
|
162
|
-
try {
|
|
163
|
-
if (p === "clone") {
|
|
164
|
-
const n = a ? u : i.getFieldsValue(), c = l.filter((r) => r.type === "image");
|
|
165
|
-
for (const r of c)
|
|
166
|
-
n[r.name] && r.provider.delete(
|
|
167
|
-
n[r.name]
|
|
168
|
-
);
|
|
169
|
-
}
|
|
170
|
-
} finally {
|
|
171
|
-
}
|
|
172
|
-
a || i.resetFields(), h(void 0), B(void 0), F(!1);
|
|
173
|
-
},
|
|
174
|
-
onOk: () => E(),
|
|
175
|
-
destroyOnClose: !0,
|
|
176
|
-
children: /* @__PURE__ */ o.jsxs(ie, { spinning: ne, children: [
|
|
177
|
-
!a && /* @__PURE__ */ o.jsx(
|
|
178
|
-
de,
|
|
179
|
-
{
|
|
180
|
-
purpose: p,
|
|
181
|
-
fields: l,
|
|
182
|
-
form: i,
|
|
183
|
-
formBuilder: K,
|
|
184
|
-
grid: w,
|
|
185
|
-
onDeleteFile: I,
|
|
186
|
-
onUploadFile: T
|
|
187
|
-
}
|
|
188
|
-
),
|
|
189
|
-
a && /* @__PURE__ */ o.jsx(
|
|
190
|
-
ue,
|
|
191
|
-
{
|
|
192
|
-
submitting: S || N,
|
|
193
|
-
className: "mt-2",
|
|
194
|
-
onSave: E,
|
|
195
|
-
updatingValue: ee,
|
|
196
|
-
fields: l,
|
|
197
|
-
onDeleteFile: I,
|
|
198
|
-
onUploadFile: T,
|
|
199
|
-
purpose: p,
|
|
200
|
-
wizard: a
|
|
201
|
-
}
|
|
202
|
-
)
|
|
203
|
-
] })
|
|
204
|
-
}
|
|
205
|
-
)
|
|
206
|
-
] });
|
|
207
|
-
}
|
|
208
|
-
export {
|
|
209
|
-
Oe as default
|
|
210
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("../../../_virtual/jsx-runtime.cjs"),E=require("antd"),y=require("react"),H=require("../../../_virtual/main.cjs"),W=require("../../locale/hooks/translation-constants.cjs"),G=require("./FileCrudField.cjs"),$=require("./ImageCrudField.cjs"),z=require("../common/DatePicker/DatePicker.cjs"),J=require("../common/DatePicker/TimePicker.cjs"),K=require("../common/check-box/CheckBox.cjs"),L=require("../common/select/SelectComponent.cjs"),Q=require("../common/text-field/NumberField.cjs"),X=require("../common/text-field/TextField.cjs"),Y=require("../common/text-field/TextArea.cjs"),Z=require("../common/tooltip/TooltipComponent.cjs"),V=require("../../../node_modules/react-i18next/dist/es/useTranslation.cjs");function ee(b){const{label:a,name:d,type:C,required:l,hidden:T,rules:x=[],updatable:m=!0,readonly:q=!1,fieldClassName:h,customFormFieldRender:N,fieldTooltip:f,...e}=b,p=E.Form.useFormInstance();y.useEffect(()=>{if(C==="select"){const{items:r=[],onSearch:i,searchOnType:n}=e;!(r!=null&&r.length)&&!n&&(i==null||i(void 0,p,e==null?void 0:e.updatingValue))}},[p,e,C,e==null?void 0:e.updatingValue]);const{t:F}=V.useTranslation(W.TRANSLATION_NAMESPACE);if(q||T)return t.jsxRuntimeExports.jsx(t.jsxRuntimeExports.Fragment,{});if(N)return N(p,b);switch(C){case"text":case"email":case"password":{const{onChange:r,placeholder:i}=e;return t.jsxRuntimeExports.jsx(X.default,{placeholder:i,disabled:!m,rules:x,required:l,onChange:r?n=>r(n,p):void 0,type:C,name:d,tooltip:f,label:a,className:h,autoComplete:"new-password"})}case"number":{const{onChange:r,placeholder:i,allowMinus:n}=e;return t.jsxRuntimeExports.jsx(Q,{placeholder:i,disabled:!m,moneyField:!!e.formatted,type:C,onChange:r?j=>r(j,p):void 0,rules:x,autoComplete:"false",required:l,tooltip:f,className:h,min:n?null:void 0,name:d,label:a})}case"date":{const{range:r,disableToday:i,disabledFutureDays:n,disabledPastDays:j,onChange:g,placeholder:c,format:v}=e;return t.jsxRuntimeExports.jsx(z,{placeholder:c,required:l,disabled:!m,type:C,format:v,tooltip:f,range:r,name:d,label:a,onChange:g?o=>g(o,p):void 0,className:h,disableToday:i,disabledFutureDays:n,disabledPastDays:j})}case"time":{const{range:r=!1,disableCurrent:i,disabledFuture:n,disabledPast:j,onChange:g,use12Hours:c,format:v,placeholder:o}=e;return t.jsxRuntimeExports.jsx(J,{placeholder:o,required:l,format:v,disabled:!m,type:C,tooltip:f,range:r,use12Hours:c,name:d,label:a,onChange:g?R=>g(R,p):void 0,className:h,disableCurrent:i,disabledFuture:n,disabledPast:j})}case"textarea":{const{onChange:r,placeholder:i,rows:n,cols:j}=e;return t.jsxRuntimeExports.jsx(Y.default,{rules:x,placeholder:i,onChange:r?g=>{var c;return r((c=g==null?void 0:g.target)==null?void 0:c.value,p)}:void 0,tooltip:f,required:l,disabled:!m,name:d,label:a,className:h,rows:n,cols:j})}case"image":return t.jsxRuntimeExports.jsx($.default,{...e,required:l,name:d,label:a,rules:x,fieldClassName:h,onRemoved:e.onRemoved,onUploading:e.onUploading,provider:e.provider});case"file":return t.jsxRuntimeExports.jsx(G.default,{...e,required:l,name:d,label:a,rules:x,fieldClassName:h,onRemoved:e.onRemoved,onUploading:e.onUploading,provider:e.provider});case"select":return t.jsxRuntimeExports.jsx(B,{...e,required:l,name:d,label:a,rules:x,fieldClassName:h,form:p,updatable:m,readonly:q,fieldTooltip:f});case"enum":{const{enum:r,radio:i=!1,translation:n,onChange:j,onSearch:g,multiple:c}=e,v=Array.isArray(r)?r:Object.keys(r);return i?t.jsxRuntimeExports.jsx(E.Form.Item,{...e,name:d,required:l,tooltip:f,rules:x,label:a,className:["w-100",h].join(" "),children:t.jsxRuntimeExports.jsx(E.Radio.Group,{...e,onChange:j?o=>{var R;return j((R=o==null?void 0:o.target)==null?void 0:R.value,p)}:void 0,children:v.map(o=>t.jsxRuntimeExports.jsx(E.Radio,{disabled:!m,value:o,children:n?F(n[o]):o},o))})}):t.jsxRuntimeExports.jsx(L,{...e,onChange:j?o=>j(o,p):void 0,className:["w-100",h].join(" "),name:d,items:v,required:l,tooltip:f,rules:x,label:a,disabled:!m,onSearch:g?o=>g(o,p):void 0,allowClear:!0,mode:c?"multiple":void 0,itemBuilder:o=>t.jsxRuntimeExports.jsx(E.Select.Option,{value:o,children:n?F(n[o]):o},o)})}case"checkbox":{const{onChange:r}=e;return t.jsxRuntimeExports.jsx(K,{className:h,rules:x,onChange:r?i=>r(i,p):void 0,label:a,tooltip:f,disabled:!m,name:d})}case"color":return t.jsxRuntimeExports.jsx(M,{...e,type:"color",required:l,name:d,label:a,rules:x,fieldClassName:h,updatable:m,readonly:q,fieldTooltip:f});default:return t.jsxRuntimeExports.jsx(t.jsxRuntimeExports.Fragment,{children:`${C} Not Implemented`})}}function B(b){const{items:a=[],loading:d,searchOnType:C,onSearch:l,multiple:T,onChange:x,highlightSearch:m,required:q,fieldClassName:h,rules:N,fieldTooltip:f,updatable:e,label:p,name:F,tagRender:r,updatingValue:i,onSet:n,placeholder:j,allowClear:g=!0}=b,c=b.form,[v,o]=y.useState(""),R=E.Form.useWatch(F,c),[S,w]=y.useState(!0);y.useEffect(()=>{n&&S&&R&&(n==null||n(R,a,c),w(!1))},[S,c,a,F,n,R]),y.useEffect(()=>{R&&w(!0)},[R]);const U=y.useCallback(async s=>{o(s),C&&(l==null||l(s,c,i))},[c,l,C,i]);return t.jsxRuntimeExports.jsx(L,{...b,maxTagCount:"responsive",maxTagPlaceholder:s=>t.jsxRuntimeExports.jsxs(Z,{title:t.jsxRuntimeExports.jsx(t.jsxRuntimeExports.Fragment,{children:s.map(u=>t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[u.label," ",t.jsxRuntimeExports.jsx("br",{})]}))}),children:["+",s==null?void 0:s.length]}),placeholder:j,onSelect:s=>{n==null||n(s==null?void 0:s.key,a,c)},onChange:x?s=>{o(""),x(s,c)}:void 0,mode:T?"multiple":void 0,className:["w-100",h].join(" "),name:F,items:a,required:q,tooltip:f,tagRender:r,rules:N,disabled:!e,label:p,allowClear:g,onSearch:U,loading:d,filterOption:m?(s,u)=>{var k,O,P;try{const A=s.toLowerCase().split(/\s+/),_=((typeof(u==null?void 0:u.children)=="string"?u==null?void 0:u.children:(O=(k=u==null?void 0:u.children)==null?void 0:k.props)==null?void 0:O.textToHighlight)??"").toLowerCase(),D=(((P=u==null?void 0:u.value)==null?void 0:P.toString())??"").toLowerCase();return A.every(I=>_.indexOf(I)>=0||D.indexOf(I)>=0)}catch{return!0}}:void 0,itemBuilder:m?s=>{const u=s.value?String(s.value):void 0;return t.jsxRuntimeExports.jsx(E.Select.Option,{value:s.key,title:u,disabled:s.disabled,children:t.jsxRuntimeExports.jsx(H,{highlightClassName:"highlight-text",searchWords:(v??"").split(" "),autoEscape:!0,textToHighlight:u??""})},s.key)}:s=>t.jsxRuntimeExports.jsx(E.Select.Option,{value:s.key,title:s.value,disabled:s.disabled,children:s.value},s.key)})}function M(b){const{required:a,fieldClassName:d,rules:C,fieldTooltip:l,updatable:T,label:x,name:m}=b;return t.jsxRuntimeExports.jsx(E.Form.Item,{label:x,name:m,required:a,rules:C,tooltip:l,children:t.jsxRuntimeExports.jsx(E.ColorPicker,{disabledAlpha:!0,format:"hex",defaultFormat:"hex",showText:!0,trigger:"click",className:d,disabled:!T,...b.innerProps})})}exports.ColorCrudFieldComponent=M;exports.SelectCrudFieldComponent=B;exports.default=ee;
|
|
@@ -1,459 +0,0 @@
|
|
|
1
|
-
import { j as t } from "../../../_virtual/jsx-runtime.js";
|
|
2
|
-
import { Form as k, Radio as H, Select as O, ColorPicker as _ } from "antd";
|
|
3
|
-
import { useEffect as R, useState as U, useCallback as G } from "react";
|
|
4
|
-
import $ from "../../../_virtual/main.js";
|
|
5
|
-
import { TRANSLATION_NAMESPACE as z } from "../../locale/hooks/translation-constants.js";
|
|
6
|
-
import J from "./FileCrudField.js";
|
|
7
|
-
import K from "./ImageCrudField.js";
|
|
8
|
-
import Q from "../common/DatePicker/DatePicker.js";
|
|
9
|
-
import X from "../common/DatePicker/TimePicker.js";
|
|
10
|
-
import Y from "../common/check-box/CheckBox.js";
|
|
11
|
-
import q from "../common/select/SelectComponent.js";
|
|
12
|
-
import Z from "../common/text-field/NumberField.js";
|
|
13
|
-
import V from "../common/text-field/TextField.js";
|
|
14
|
-
import ee from "../common/text-field/TextArea.js";
|
|
15
|
-
import te from "../common/tooltip/TooltipComponent.js";
|
|
16
|
-
import { useTranslation as re } from "../../../node_modules/react-i18next/dist/es/useTranslation.js";
|
|
17
|
-
function ve(v) {
|
|
18
|
-
const {
|
|
19
|
-
label: i,
|
|
20
|
-
name: m,
|
|
21
|
-
type: x,
|
|
22
|
-
required: s,
|
|
23
|
-
hidden: T,
|
|
24
|
-
rules: u = [],
|
|
25
|
-
updatable: h = !0,
|
|
26
|
-
readonly: N = !1,
|
|
27
|
-
fieldClassName: g,
|
|
28
|
-
customFormFieldRender: w,
|
|
29
|
-
fieldTooltip: b,
|
|
30
|
-
...e
|
|
31
|
-
} = v, p = k.useFormInstance();
|
|
32
|
-
R(() => {
|
|
33
|
-
if (x === "select") {
|
|
34
|
-
const {
|
|
35
|
-
items: o = [],
|
|
36
|
-
onSearch: n,
|
|
37
|
-
searchOnType: a
|
|
38
|
-
} = e;
|
|
39
|
-
!(o != null && o.length) && !a && (n == null || n(void 0, p, e == null ? void 0 : e.updatingValue));
|
|
40
|
-
}
|
|
41
|
-
}, [p, e, x, e == null ? void 0 : e.updatingValue]);
|
|
42
|
-
const { t: F } = re(z);
|
|
43
|
-
if (N || T) return /* @__PURE__ */ t.jsx(t.Fragment, {});
|
|
44
|
-
if (w)
|
|
45
|
-
return w(p, v);
|
|
46
|
-
switch (x) {
|
|
47
|
-
case "text":
|
|
48
|
-
case "email":
|
|
49
|
-
case "password": {
|
|
50
|
-
const { onChange: o, placeholder: n } = e;
|
|
51
|
-
return /* @__PURE__ */ t.jsx(
|
|
52
|
-
V,
|
|
53
|
-
{
|
|
54
|
-
placeholder: n,
|
|
55
|
-
disabled: !h,
|
|
56
|
-
rules: u,
|
|
57
|
-
required: s,
|
|
58
|
-
onChange: o ? (a) => o(a, p) : void 0,
|
|
59
|
-
type: x,
|
|
60
|
-
name: m,
|
|
61
|
-
tooltip: b,
|
|
62
|
-
label: i,
|
|
63
|
-
className: g,
|
|
64
|
-
autoComplete: "new-password"
|
|
65
|
-
}
|
|
66
|
-
);
|
|
67
|
-
}
|
|
68
|
-
case "number": {
|
|
69
|
-
const { onChange: o, placeholder: n, allowMinus: a } = e;
|
|
70
|
-
return /* @__PURE__ */ t.jsx(
|
|
71
|
-
Z,
|
|
72
|
-
{
|
|
73
|
-
placeholder: n,
|
|
74
|
-
disabled: !h,
|
|
75
|
-
moneyField: !!e.formatted,
|
|
76
|
-
type: x,
|
|
77
|
-
onChange: o ? (f) => o(f, p) : void 0,
|
|
78
|
-
rules: u,
|
|
79
|
-
autoComplete: "false",
|
|
80
|
-
required: s,
|
|
81
|
-
tooltip: b,
|
|
82
|
-
className: g,
|
|
83
|
-
min: a ? null : void 0,
|
|
84
|
-
name: m,
|
|
85
|
-
label: i
|
|
86
|
-
}
|
|
87
|
-
);
|
|
88
|
-
}
|
|
89
|
-
case "date": {
|
|
90
|
-
const {
|
|
91
|
-
range: o,
|
|
92
|
-
disableToday: n,
|
|
93
|
-
disabledFutureDays: a,
|
|
94
|
-
disabledPastDays: f,
|
|
95
|
-
onChange: C,
|
|
96
|
-
placeholder: c,
|
|
97
|
-
format: y
|
|
98
|
-
} = e;
|
|
99
|
-
return /* @__PURE__ */ t.jsx(
|
|
100
|
-
Q,
|
|
101
|
-
{
|
|
102
|
-
placeholder: c,
|
|
103
|
-
required: s,
|
|
104
|
-
disabled: !h,
|
|
105
|
-
type: x,
|
|
106
|
-
format: y,
|
|
107
|
-
tooltip: b,
|
|
108
|
-
range: o,
|
|
109
|
-
name: m,
|
|
110
|
-
label: i,
|
|
111
|
-
onChange: C ? (l) => C(l, p) : void 0,
|
|
112
|
-
className: g,
|
|
113
|
-
disableToday: n,
|
|
114
|
-
disabledFutureDays: a,
|
|
115
|
-
disabledPastDays: f
|
|
116
|
-
}
|
|
117
|
-
);
|
|
118
|
-
}
|
|
119
|
-
case "time": {
|
|
120
|
-
const {
|
|
121
|
-
range: o = !1,
|
|
122
|
-
disableCurrent: n,
|
|
123
|
-
disabledFuture: a,
|
|
124
|
-
disabledPast: f,
|
|
125
|
-
onChange: C,
|
|
126
|
-
use12Hours: c,
|
|
127
|
-
format: y,
|
|
128
|
-
placeholder: l
|
|
129
|
-
} = e;
|
|
130
|
-
return /* @__PURE__ */ t.jsx(
|
|
131
|
-
X,
|
|
132
|
-
{
|
|
133
|
-
placeholder: l,
|
|
134
|
-
required: s,
|
|
135
|
-
format: y,
|
|
136
|
-
disabled: !h,
|
|
137
|
-
type: x,
|
|
138
|
-
tooltip: b,
|
|
139
|
-
range: o,
|
|
140
|
-
use12Hours: c,
|
|
141
|
-
name: m,
|
|
142
|
-
label: i,
|
|
143
|
-
onChange: C ? (j) => C(j, p) : void 0,
|
|
144
|
-
className: g,
|
|
145
|
-
disableCurrent: n,
|
|
146
|
-
disabledFuture: a,
|
|
147
|
-
disabledPast: f
|
|
148
|
-
}
|
|
149
|
-
);
|
|
150
|
-
}
|
|
151
|
-
case "textarea": {
|
|
152
|
-
const { onChange: o, placeholder: n, rows: a, cols: f } = e;
|
|
153
|
-
return /* @__PURE__ */ t.jsx(
|
|
154
|
-
ee,
|
|
155
|
-
{
|
|
156
|
-
rules: u,
|
|
157
|
-
placeholder: n,
|
|
158
|
-
onChange: o ? (C) => {
|
|
159
|
-
var c;
|
|
160
|
-
return o((c = C == null ? void 0 : C.target) == null ? void 0 : c.value, p);
|
|
161
|
-
} : void 0,
|
|
162
|
-
tooltip: b,
|
|
163
|
-
required: s,
|
|
164
|
-
disabled: !h,
|
|
165
|
-
name: m,
|
|
166
|
-
label: i,
|
|
167
|
-
className: g,
|
|
168
|
-
rows: a,
|
|
169
|
-
cols: f
|
|
170
|
-
}
|
|
171
|
-
);
|
|
172
|
-
}
|
|
173
|
-
case "image":
|
|
174
|
-
return /* @__PURE__ */ t.jsx(
|
|
175
|
-
K,
|
|
176
|
-
{
|
|
177
|
-
...e,
|
|
178
|
-
required: s,
|
|
179
|
-
name: m,
|
|
180
|
-
label: i,
|
|
181
|
-
rules: u,
|
|
182
|
-
fieldClassName: g,
|
|
183
|
-
onRemoved: e.onRemoved,
|
|
184
|
-
onUploading: e.onUploading,
|
|
185
|
-
provider: e.provider
|
|
186
|
-
}
|
|
187
|
-
);
|
|
188
|
-
case "file":
|
|
189
|
-
return /* @__PURE__ */ t.jsx(
|
|
190
|
-
J,
|
|
191
|
-
{
|
|
192
|
-
...e,
|
|
193
|
-
required: s,
|
|
194
|
-
name: m,
|
|
195
|
-
label: i,
|
|
196
|
-
rules: u,
|
|
197
|
-
fieldClassName: g,
|
|
198
|
-
onRemoved: e.onRemoved,
|
|
199
|
-
onUploading: e.onUploading,
|
|
200
|
-
provider: e.provider
|
|
201
|
-
}
|
|
202
|
-
);
|
|
203
|
-
case "select":
|
|
204
|
-
return /* @__PURE__ */ t.jsx(
|
|
205
|
-
oe,
|
|
206
|
-
{
|
|
207
|
-
...e,
|
|
208
|
-
required: s,
|
|
209
|
-
name: m,
|
|
210
|
-
label: i,
|
|
211
|
-
rules: u,
|
|
212
|
-
fieldClassName: g,
|
|
213
|
-
form: p,
|
|
214
|
-
updatable: h,
|
|
215
|
-
readonly: N,
|
|
216
|
-
fieldTooltip: b
|
|
217
|
-
}
|
|
218
|
-
);
|
|
219
|
-
case "enum": {
|
|
220
|
-
const {
|
|
221
|
-
enum: o,
|
|
222
|
-
radio: n = !1,
|
|
223
|
-
translation: a,
|
|
224
|
-
onChange: f,
|
|
225
|
-
onSearch: C,
|
|
226
|
-
multiple: c
|
|
227
|
-
} = e, y = Array.isArray(o) ? o : Object.keys(o);
|
|
228
|
-
return n ? /* @__PURE__ */ t.jsx(
|
|
229
|
-
k.Item,
|
|
230
|
-
{
|
|
231
|
-
...e,
|
|
232
|
-
name: m,
|
|
233
|
-
required: s,
|
|
234
|
-
tooltip: b,
|
|
235
|
-
rules: u,
|
|
236
|
-
label: i,
|
|
237
|
-
className: ["w-100", g].join(" "),
|
|
238
|
-
children: /* @__PURE__ */ t.jsx(
|
|
239
|
-
H.Group,
|
|
240
|
-
{
|
|
241
|
-
...e,
|
|
242
|
-
onChange: f ? (l) => {
|
|
243
|
-
var j;
|
|
244
|
-
return f((j = l == null ? void 0 : l.target) == null ? void 0 : j.value, p);
|
|
245
|
-
} : void 0,
|
|
246
|
-
children: y.map((l) => /* @__PURE__ */ t.jsx(H, { disabled: !h, value: l, children: a ? F(a[l]) : l }, l))
|
|
247
|
-
}
|
|
248
|
-
)
|
|
249
|
-
}
|
|
250
|
-
) : /* @__PURE__ */ t.jsx(
|
|
251
|
-
q,
|
|
252
|
-
{
|
|
253
|
-
...e,
|
|
254
|
-
onChange: f ? (l) => f(l, p) : void 0,
|
|
255
|
-
className: ["w-100", g].join(" "),
|
|
256
|
-
name: m,
|
|
257
|
-
items: y,
|
|
258
|
-
required: s,
|
|
259
|
-
tooltip: b,
|
|
260
|
-
rules: u,
|
|
261
|
-
label: i,
|
|
262
|
-
disabled: !h,
|
|
263
|
-
onSearch: C ? (l) => C(l, p) : void 0,
|
|
264
|
-
allowClear: !0,
|
|
265
|
-
mode: c ? "multiple" : void 0,
|
|
266
|
-
itemBuilder: (l) => /* @__PURE__ */ t.jsx(O.Option, { value: l, children: a ? F(a[l]) : l }, l)
|
|
267
|
-
}
|
|
268
|
-
);
|
|
269
|
-
}
|
|
270
|
-
case "checkbox": {
|
|
271
|
-
const { onChange: o } = e;
|
|
272
|
-
return /* @__PURE__ */ t.jsx(
|
|
273
|
-
Y,
|
|
274
|
-
{
|
|
275
|
-
className: g,
|
|
276
|
-
rules: u,
|
|
277
|
-
onChange: o ? (n) => o(n, p) : void 0,
|
|
278
|
-
label: i,
|
|
279
|
-
tooltip: b,
|
|
280
|
-
disabled: !h,
|
|
281
|
-
name: m
|
|
282
|
-
}
|
|
283
|
-
);
|
|
284
|
-
}
|
|
285
|
-
case "color":
|
|
286
|
-
return /* @__PURE__ */ t.jsx(
|
|
287
|
-
ae,
|
|
288
|
-
{
|
|
289
|
-
...e,
|
|
290
|
-
type: "color",
|
|
291
|
-
required: s,
|
|
292
|
-
name: m,
|
|
293
|
-
label: i,
|
|
294
|
-
rules: u,
|
|
295
|
-
fieldClassName: g,
|
|
296
|
-
updatable: h,
|
|
297
|
-
readonly: N,
|
|
298
|
-
fieldTooltip: b
|
|
299
|
-
}
|
|
300
|
-
);
|
|
301
|
-
default:
|
|
302
|
-
return /* @__PURE__ */ t.jsx(t.Fragment, { children: `${x} Not Implemented` });
|
|
303
|
-
}
|
|
304
|
-
}
|
|
305
|
-
function oe(v) {
|
|
306
|
-
const {
|
|
307
|
-
items: i = [],
|
|
308
|
-
loading: m,
|
|
309
|
-
searchOnType: x,
|
|
310
|
-
onSearch: s,
|
|
311
|
-
multiple: T,
|
|
312
|
-
onChange: u,
|
|
313
|
-
highlightSearch: h,
|
|
314
|
-
required: N,
|
|
315
|
-
fieldClassName: g,
|
|
316
|
-
rules: w,
|
|
317
|
-
fieldTooltip: b,
|
|
318
|
-
updatable: e,
|
|
319
|
-
label: p,
|
|
320
|
-
name: F,
|
|
321
|
-
tagRender: o,
|
|
322
|
-
updatingValue: n,
|
|
323
|
-
onSet: a,
|
|
324
|
-
placeholder: f,
|
|
325
|
-
allowClear: C = !0
|
|
326
|
-
} = v, c = v.form, [y, l] = U(""), j = k.useWatch(F, c), [S, A] = U(!0);
|
|
327
|
-
R(() => {
|
|
328
|
-
a && S && j && (a == null || a(j, i, c), A(!1));
|
|
329
|
-
}, [S, c, i, F, a, j]), R(() => {
|
|
330
|
-
j && A(!0);
|
|
331
|
-
}, [j]);
|
|
332
|
-
const D = G(
|
|
333
|
-
async (r) => {
|
|
334
|
-
l(r), x && (s == null || s(r, c, n));
|
|
335
|
-
},
|
|
336
|
-
[c, s, x, n]
|
|
337
|
-
);
|
|
338
|
-
return /* @__PURE__ */ t.jsx(
|
|
339
|
-
q,
|
|
340
|
-
{
|
|
341
|
-
...v,
|
|
342
|
-
maxTagCount: "responsive",
|
|
343
|
-
maxTagPlaceholder: (r) => /* @__PURE__ */ t.jsxs(
|
|
344
|
-
te,
|
|
345
|
-
{
|
|
346
|
-
title: /* @__PURE__ */ t.jsx(t.Fragment, { children: r.map((d) => /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
|
|
347
|
-
d.label,
|
|
348
|
-
" ",
|
|
349
|
-
/* @__PURE__ */ t.jsx("br", {})
|
|
350
|
-
] })) }),
|
|
351
|
-
children: [
|
|
352
|
-
"+",
|
|
353
|
-
r == null ? void 0 : r.length
|
|
354
|
-
]
|
|
355
|
-
}
|
|
356
|
-
),
|
|
357
|
-
placeholder: f,
|
|
358
|
-
onSelect: (r) => {
|
|
359
|
-
a == null || a(r == null ? void 0 : r.key, i, c);
|
|
360
|
-
},
|
|
361
|
-
onChange: u ? (r) => {
|
|
362
|
-
l(""), u(r, c);
|
|
363
|
-
} : void 0,
|
|
364
|
-
mode: T ? "multiple" : void 0,
|
|
365
|
-
className: ["w-100", g].join(" "),
|
|
366
|
-
name: F,
|
|
367
|
-
items: i,
|
|
368
|
-
required: N,
|
|
369
|
-
tooltip: b,
|
|
370
|
-
tagRender: o,
|
|
371
|
-
rules: w,
|
|
372
|
-
disabled: !e,
|
|
373
|
-
label: p,
|
|
374
|
-
allowClear: C,
|
|
375
|
-
onSearch: D,
|
|
376
|
-
loading: m,
|
|
377
|
-
filterOption: h ? (r, d) => {
|
|
378
|
-
var P, I, E;
|
|
379
|
-
try {
|
|
380
|
-
const L = r.toLowerCase().split(/\s+/), M = ((typeof (d == null ? void 0 : d.children) == "string" ? d == null ? void 0 : d.children : (I = (P = d == null ? void 0 : d.children) == null ? void 0 : P.props) == null ? void 0 : I.textToHighlight) ?? "").toLowerCase(), W = (((E = d == null ? void 0 : d.value) == null ? void 0 : E.toString()) ?? "").toLowerCase();
|
|
381
|
-
return L.every(
|
|
382
|
-
(B) => M.indexOf(B) >= 0 || W.indexOf(B) >= 0
|
|
383
|
-
);
|
|
384
|
-
} catch {
|
|
385
|
-
return !0;
|
|
386
|
-
}
|
|
387
|
-
} : void 0,
|
|
388
|
-
itemBuilder: h ? (r) => {
|
|
389
|
-
const d = r.value ? String(r.value) : void 0;
|
|
390
|
-
return /* @__PURE__ */ t.jsx(
|
|
391
|
-
O.Option,
|
|
392
|
-
{
|
|
393
|
-
value: r.key,
|
|
394
|
-
title: d,
|
|
395
|
-
disabled: r.disabled,
|
|
396
|
-
children: /* @__PURE__ */ t.jsx(
|
|
397
|
-
$,
|
|
398
|
-
{
|
|
399
|
-
highlightClassName: "highlight-text",
|
|
400
|
-
searchWords: (y ?? "").split(" "),
|
|
401
|
-
autoEscape: !0,
|
|
402
|
-
textToHighlight: d ?? ""
|
|
403
|
-
}
|
|
404
|
-
)
|
|
405
|
-
},
|
|
406
|
-
r.key
|
|
407
|
-
);
|
|
408
|
-
} : (r) => /* @__PURE__ */ t.jsx(
|
|
409
|
-
O.Option,
|
|
410
|
-
{
|
|
411
|
-
value: r.key,
|
|
412
|
-
title: r.value,
|
|
413
|
-
disabled: r.disabled,
|
|
414
|
-
children: r.value
|
|
415
|
-
},
|
|
416
|
-
r.key
|
|
417
|
-
)
|
|
418
|
-
}
|
|
419
|
-
);
|
|
420
|
-
}
|
|
421
|
-
function ae(v) {
|
|
422
|
-
const {
|
|
423
|
-
required: i,
|
|
424
|
-
fieldClassName: m,
|
|
425
|
-
rules: x,
|
|
426
|
-
fieldTooltip: s,
|
|
427
|
-
updatable: T,
|
|
428
|
-
label: u,
|
|
429
|
-
name: h
|
|
430
|
-
} = v;
|
|
431
|
-
return /* @__PURE__ */ t.jsx(
|
|
432
|
-
k.Item,
|
|
433
|
-
{
|
|
434
|
-
label: u,
|
|
435
|
-
name: h,
|
|
436
|
-
required: i,
|
|
437
|
-
rules: x,
|
|
438
|
-
tooltip: s,
|
|
439
|
-
children: /* @__PURE__ */ t.jsx(
|
|
440
|
-
_,
|
|
441
|
-
{
|
|
442
|
-
disabledAlpha: !0,
|
|
443
|
-
format: "hex",
|
|
444
|
-
defaultFormat: "hex",
|
|
445
|
-
showText: !0,
|
|
446
|
-
trigger: "click",
|
|
447
|
-
className: m,
|
|
448
|
-
disabled: !T,
|
|
449
|
-
...v.innerProps
|
|
450
|
-
}
|
|
451
|
-
)
|
|
452
|
-
}
|
|
453
|
-
);
|
|
454
|
-
}
|
|
455
|
-
export {
|
|
456
|
-
ae as ColorCrudFieldComponent,
|
|
457
|
-
oe as SelectCrudFieldComponent,
|
|
458
|
-
ve as default
|
|
459
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("../../../_virtual/jsx-runtime.cjs"),u=require("react"),a=require("antd"),j=require("./CrudField.cjs");function R({form:i,purpose:x="new",...d}){return n.jsxRuntimeExports.jsx(n.jsxRuntimeExports.Fragment,{children:n.jsxRuntimeExports.jsx(a.Form,{form:i,layout:"vertical",children:n.jsxRuntimeExports.jsx(p,{...d,purpose:x})})})}function p({fields:i,formBuilder:x,grid:d,onDeleteFile:o,onUploadFile:c,purpose:m}){const l=u.useMemo(()=>i.filter(t=>!t.readonly).map(t=>{const s={onUploading:e=>{var r;t.onUploading&&((r=t.onUploading)==null||r.call(t,e)),c==null||c(e)},onDelete:e=>{var r;t.onUploading&&((r=t.onDelete)==null||r.call(t,e)),o==null||o(e)}};return n.jsxRuntimeExports.jsx(u.Fragment,{children:t.grid&&d?n.jsxRuntimeExports.jsx(a.Col,{...t.grid,children:u.createElement(j.default,{...t,...s,key:typeof t.name=="string"?t.name:String(t.name),updatable:m!=="update"?!0:t.updatable})}):u.createElement(j.default,{...t,...s,key:typeof t.name=="string"?t.name:String(t.name),updatable:m!=="update"?!0:t.updatable})},t.name)}),[i,d,o,c,m]),E=u.useCallback((t,s={})=>{const e=i.find(r=>r.name===t);if(e!=null&&e.hidden)return n.jsxRuntimeExports.jsx(n.jsxRuntimeExports.Fragment,{});if(e){const r=u.createElement(j.default,{...e,...s,key:typeof e.name=="string"?e.name:String(e.name),updatable:m!=="update"?!0:e.updatable});return s.render?s.render(r):r}return n.jsxRuntimeExports.jsx(n.jsxRuntimeExports.Fragment,{})},[i,m]);return n.jsxRuntimeExports.jsx(n.jsxRuntimeExports.Fragment,{children:x?n.jsxRuntimeExports.jsxs(n.jsxRuntimeExports.Fragment,{children:[x(E,{isAnyFieldHidden(...t){const s=Array.isArray(t)?t:[t];return i.filter(r=>s.includes(r.name)).some(r=>r.hidden)},isAllFieldsHidden(...t){const s=Array.isArray(t)?t:[t];return i.filter(r=>s.includes(r.name)).every(r=>r.hidden)}}),n.jsxRuntimeExports.jsxs(a.Form.Item,{hidden:!0,noStyle:!0,children:[n.jsxRuntimeExports.jsx(a.Input,{name:"id"}),n.jsxRuntimeExports.jsx(a.Input,{})]})]}):d?n.jsxRuntimeExports.jsx(a.Row,{gutter:[8,8],children:l}):l})}exports.CrudForm=R;exports.CrudFormFields=p;
|