@kingteza/crud-component 1.23.1 → 1.25.0

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.
@@ -0,0 +1 @@
1
+ "use strict";const s=require("react/jsx-runtime"),c=require("@ant-design/icons"),f=require("antd"),L=require("mime"),o=require("react"),Z=require("../util/ValidationUtil.cjs.js"),{Dragger:_}=f.Upload;function G({name:S,label:M,required:N,provider:a,onUploading:m,onRemoved:p,fieldClassName:W,accept:i,rules:k,maxCount:r=1,block:B,showInGrid:$=!1,gridConfig:q={draggerSpan:12,previewSpan:12},fieldHelper:R,formLayoutProps:C,...I}){const u=f.Form.useFormInstance(),n=o.useMemo(()=>S,[S]),y=f.Form.useWatch(n,u),[A,H]=o.useState(!1),[j,h]=o.useState([]),T=o.useCallback(async e=>{var x,w;const l=e.file,t=(l==null?void 0:l.name)??"",d=`${Date.now()}-${Math.random().toString(36).substring(2,9)}`;h(F=>[...F,{uid:d,name:t,status:"uploading",originFileObj:l}]);try{H(!0),m==null||m(!0);const F=t??"",V=F.split("."),O=V[V.length-1],Q=a.generateFileName(F),X=`${await a.getInitialPath()}/${Q}.${O}`,g=await a.upload({...l,originFileObj:l},X),D=await a.getRealUrl(g),Y=L.getType(g),P=u.getFieldValue(n);if(r>1){const b=[...Array.isArray(P)?P:P?[P]:[],g].filter(Boolean);u.setFieldValue(n,b)}else u.setFieldValue(n,g);h(E=>E.map(b=>b.uid===d?{uid:g,url:D,type:Y,name:F,status:"done",response:g,thumbUrl:D}:b)),(x=e.onSuccess)==null||x.call(e,g)}catch(F){(w=e.onError)==null||w.call(e,F),h(V=>V.filter(O=>O.uid!==d))}finally{m==null||m(!1)}},[u,r,m,a,n]);o.useEffect(()=>{!A&&y&&Promise.all((Array.isArray(y)?y:[y]).map(async e=>{const l=L.getType(e),t=e.split("/").pop(),d=await a.getRealUrl(e);return{uid:e,url:d,type:l,name:t,response:e,thumbUrl:d}})).then(e=>h(e))},[y,A,a]);const z=o.useCallback(async e=>{const l=e.response??e.uid;await a.delete(l),p==null||p();const t=u.getFieldValue(n);if(r>1){const x=(Array.isArray(t)?t:t?[t]:[]).filter(w=>w!==l);u.setFieldValue(n,x.length?x:void 0)}else u.setFieldValue(n,void 0);h(d=>d.filter(x=>x.uid!==e.uid))},[u,r,p,a,n]),U=o.useMemo(()=>{if(!i)return"all files";const e=i.split(",").map(l=>{const t=l.trim().toLowerCase();return t.startsWith("image/")?"images":t===".pdf"||t==="application/pdf"?"PDF files":t.includes("excel")||t.includes(".xls")?"Excel files":t.includes("word")||t.includes(".doc")?"Word files":t.includes("text")||t===".txt"?"text files":t.includes("presentation")||t.includes(".ppt")?"PowerPoint files":t.replace(".","").toUpperCase()});return[...new Set(e)].join(", ")},[i]),J=o.useMemo(()=>i?i.includes("image")?s.jsx(c.FileImageOutlined,{}):i.includes("pdf")?s.jsx(c.FilePdfOutlined,{}):i.includes("word")||i.includes(".doc")?s.jsx(c.FileWordOutlined,{}):i.includes("text")||i.includes(".txt")?s.jsx(c.FileTextOutlined,{}):i.includes("excel")||i.includes(".xls")?s.jsx(c.FileExcelOutlined,{}):i.includes("presentation")||i.includes(".ppt")?s.jsx(c.FilePptOutlined,{}):s.jsx(c.FileOutlined,{}):s.jsx(c.InboxOutlined,{}),[i]),K=((j==null?void 0:j.length)??0)>=r;return s.jsxs(f.Form.Item,{label:M,required:N,name:n,...C,className:W,rules:[...N?Z.required(M):[],...k??[]],help:R,children:[s.jsx("input",{hidden:!0}),s.jsxs(f.Row,{gutter:[8,8],align:"top",style:{width:"100%",margin:0},children:[s.jsx(f.Col,{span:$?q.draggerSpan:24,xs:24,sm:24,children:s.jsxs(_,{...I,accept:i,disabled:K,fileList:[],multiple:r>1,maxCount:r,customRequest:T,onRemove:z,onChange:({file:e})=>{e.status==="error"&&h(l=>l.filter(t=>t.uid!==e.uid))},style:B?{width:"100%"}:void 0,children:[s.jsx("p",{className:"ant-upload-drag-icon",children:J}),s.jsx("p",{className:"ant-upload-text",children:"Click or drag file to this area to upload"}),s.jsx("p",{className:"ant-upload-hint",children:`Maximum file size: 10 MB. Supported formats: ${U}. ${r>1?`Maximum number of files: ${r}`:""}`})]})}),j.length>0&&s.jsx(f.Col,{span:$?q.previewSpan:24,xs:24,sm:24,children:s.jsx(f.Upload,{...I,accept:i,fileList:j,maxCount:r,customRequest:T,onRemove:z,listType:"picture",onChange:({fileList:e})=>h(e),style:{width:"100%"}})})]})]})}module.exports=G;
@@ -0,0 +1,24 @@
1
+ import { UploadProps } from 'antd';
2
+ import { ReactNode } from 'react';
3
+ import { InitialCrudField } from './CrudComponent';
4
+ import { FileUploadProvider } from './ImageCrudField';
5
+ export interface FileCrudDragNDropField<T> extends _FileCrudDragNDropField<T> {
6
+ type: "file";
7
+ }
8
+ export interface _FileCrudDragNDropField<T> extends InitialCrudField<T> {
9
+ provider: FileUploadProvider;
10
+ onUploading?: (isUploading: boolean) => void;
11
+ onRemoved?: () => void;
12
+ fieldClassName?: string;
13
+ accept?: string;
14
+ maxCount?: number;
15
+ block?: boolean;
16
+ fieldHelper?: ReactNode;
17
+ formLayoutProps?: InitialCrudField<T>["formLayoutProps"];
18
+ showInGrid?: boolean;
19
+ gridConfig?: {
20
+ draggerSpan?: number;
21
+ previewSpan?: number;
22
+ };
23
+ }
24
+ export default function FileCrudDragNDropFieldComponent<T>({ name, label, required, provider, onUploading, onRemoved, fieldClassName, accept, rules, maxCount, block, showInGrid, gridConfig, fieldHelper: help, formLayoutProps, ...props }: Readonly<_FileCrudDragNDropField<T>> & Omit<UploadProps, "customRequest">): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,162 @@
1
+ import { jsx as s, jsxs as O } from "react/jsx-runtime";
2
+ import { InboxOutlined as ee, FileImageOutlined as te, FilePdfOutlined as ie, FileWordOutlined as le, FileTextOutlined as se, FileExcelOutlined as re, FilePptOutlined as ne, FileOutlined as ae } from "@ant-design/icons";
3
+ import { Form as b, Row as ue, Col as W, Upload as H } from "antd";
4
+ import k from "mime";
5
+ import { useMemo as S, useState as B, useCallback as q, useEffect as de } from "react";
6
+ import ce from "../util/ValidationUtil.es.js";
7
+ const { Dragger: fe } = H;
8
+ function Fe({
9
+ name: N,
10
+ label: $,
11
+ required: A,
12
+ provider: a,
13
+ onUploading: c,
14
+ onRemoved: y,
15
+ fieldClassName: J,
16
+ accept: i,
17
+ rules: K,
18
+ maxCount: r = 1,
19
+ block: Q,
20
+ showInGrid: I = !1,
21
+ gridConfig: M = {
22
+ draggerSpan: 12,
23
+ previewSpan: 12
24
+ },
25
+ fieldHelper: R,
26
+ formLayoutProps: U,
27
+ ...T
28
+ }) {
29
+ const u = b.useFormInstance(), n = S(() => N, [N]), p = b.useWatch(n, u), [j, X] = B(!1), [g, f] = B([]), z = q(
30
+ async (e) => {
31
+ var o, F;
32
+ const l = e.file, t = (l == null ? void 0 : l.name) ?? "", d = `${Date.now()}-${Math.random().toString(36).substring(2, 9)}`;
33
+ f((m) => [
34
+ ...m,
35
+ {
36
+ uid: d,
37
+ name: t,
38
+ status: "uploading",
39
+ originFileObj: l
40
+ }
41
+ ]);
42
+ try {
43
+ X(!0), c == null || c(!0);
44
+ const m = t ?? "", w = m.split("."), P = w[w.length - 1], C = a.generateFileName(m), G = `${await a.getInitialPath()}/${C}.${P}`, h = await a.upload(
45
+ { ...l, originFileObj: l },
46
+ G
47
+ ), E = await a.getRealUrl(h), v = k.getType(h), x = u.getFieldValue(n);
48
+ if (r > 1) {
49
+ const V = [...Array.isArray(x) ? x : x ? [x] : [], h].filter(Boolean);
50
+ u.setFieldValue(n, V);
51
+ } else
52
+ u.setFieldValue(n, h);
53
+ f(
54
+ (L) => L.map(
55
+ (V) => V.uid === d ? {
56
+ uid: h,
57
+ url: E,
58
+ type: v,
59
+ name: m,
60
+ status: "done",
61
+ response: h,
62
+ thumbUrl: E
63
+ } : V
64
+ )
65
+ ), (o = e.onSuccess) == null || o.call(e, h);
66
+ } catch (m) {
67
+ (F = e.onError) == null || F.call(e, m), f((w) => w.filter((P) => P.uid !== d));
68
+ } finally {
69
+ c == null || c(!1);
70
+ }
71
+ },
72
+ [u, r, c, a, n]
73
+ );
74
+ de(() => {
75
+ !j && p && Promise.all(
76
+ (Array.isArray(p) ? p : [p]).map(async (e) => {
77
+ const l = k.getType(e), t = e.split("/").pop(), d = await a.getRealUrl(e);
78
+ return { uid: e, url: d, type: l, name: t, response: e, thumbUrl: d };
79
+ })
80
+ ).then((e) => f(e));
81
+ }, [p, j, a]);
82
+ const D = q(
83
+ async (e) => {
84
+ const l = e.response ?? e.uid;
85
+ await a.delete(l), y == null || y();
86
+ const t = u.getFieldValue(n);
87
+ if (r > 1) {
88
+ const o = (Array.isArray(t) ? t : t ? [t] : []).filter((F) => F !== l);
89
+ u.setFieldValue(n, o.length ? o : void 0);
90
+ } else
91
+ u.setFieldValue(n, void 0);
92
+ f((d) => d.filter((o) => o.uid !== e.uid));
93
+ },
94
+ [u, r, y, a, n]
95
+ ), Y = S(() => {
96
+ if (!i) return "all files";
97
+ const e = i.split(",").map((l) => {
98
+ const t = l.trim().toLowerCase();
99
+ return t.startsWith("image/") ? "images" : t === ".pdf" || t === "application/pdf" ? "PDF files" : t.includes("excel") || t.includes(".xls") ? "Excel files" : t.includes("word") || t.includes(".doc") ? "Word files" : t.includes("text") || t === ".txt" ? "text files" : t.includes("presentation") || t.includes(".ppt") ? "PowerPoint files" : t.replace(".", "").toUpperCase();
100
+ });
101
+ return [...new Set(e)].join(", ");
102
+ }, [i]), Z = S(() => i ? i.includes("image") ? /* @__PURE__ */ s(te, {}) : i.includes("pdf") ? /* @__PURE__ */ s(ie, {}) : i.includes("word") || i.includes(".doc") ? /* @__PURE__ */ s(le, {}) : i.includes("text") || i.includes(".txt") ? /* @__PURE__ */ s(se, {}) : i.includes("excel") || i.includes(".xls") ? /* @__PURE__ */ s(re, {}) : i.includes("presentation") || i.includes(".ppt") ? /* @__PURE__ */ s(ne, {}) : /* @__PURE__ */ s(ae, {}) : /* @__PURE__ */ s(ee, {}), [i]), _ = ((g == null ? void 0 : g.length) ?? 0) >= r;
103
+ return /* @__PURE__ */ O(
104
+ b.Item,
105
+ {
106
+ label: $,
107
+ required: A,
108
+ name: n,
109
+ ...U,
110
+ className: J,
111
+ rules: [
112
+ ...A ? ce.required($) : [],
113
+ ...K ?? []
114
+ ],
115
+ help: R,
116
+ children: [
117
+ /* @__PURE__ */ s("input", { hidden: !0 }),
118
+ /* @__PURE__ */ O(ue, { gutter: [8, 8], align: "top", style: { width: "100%", margin: 0 }, children: [
119
+ /* @__PURE__ */ s(W, { span: I ? M.draggerSpan : 24, xs: 24, sm: 24, children: /* @__PURE__ */ O(
120
+ fe,
121
+ {
122
+ ...T,
123
+ accept: i,
124
+ disabled: _,
125
+ fileList: [],
126
+ multiple: r > 1,
127
+ maxCount: r,
128
+ customRequest: z,
129
+ onRemove: D,
130
+ onChange: ({ file: e }) => {
131
+ e.status === "error" && f((l) => l.filter((t) => t.uid !== e.uid));
132
+ },
133
+ style: Q ? { width: "100%" } : void 0,
134
+ children: [
135
+ /* @__PURE__ */ s("p", { className: "ant-upload-drag-icon", children: Z }),
136
+ /* @__PURE__ */ s("p", { className: "ant-upload-text", children: "Click or drag file to this area to upload" }),
137
+ /* @__PURE__ */ s("p", { className: "ant-upload-hint", children: `Maximum file size: 10 MB. Supported formats: ${Y}. ${r > 1 ? `Maximum number of files: ${r}` : ""}` })
138
+ ]
139
+ }
140
+ ) }),
141
+ g.length > 0 && /* @__PURE__ */ s(W, { span: I ? M.previewSpan : 24, xs: 24, sm: 24, children: /* @__PURE__ */ s(
142
+ H,
143
+ {
144
+ ...T,
145
+ accept: i,
146
+ fileList: g,
147
+ maxCount: r,
148
+ customRequest: z,
149
+ onRemove: D,
150
+ listType: "picture",
151
+ onChange: ({ fileList: e }) => f(e),
152
+ style: { width: "100%" }
153
+ }
154
+ ) })
155
+ ] })
156
+ ]
157
+ }
158
+ );
159
+ }
160
+ export {
161
+ Fe as default
162
+ };
@@ -1 +1 @@
1
- "use strict";var D=Object.defineProperty;var H=(s,e,t)=>e in s?D(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t;var g=(s,e,t)=>H(s,typeof e!="symbol"?e+"":e,t);Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const n=require("react/jsx-runtime"),R=require("@ant-design/icons"),f=require("antd"),q=require("path-browserify"),i=require("react"),T=require("../util/NumberUtil.cjs.js"),W=require("../util/ValidationUtil.cjs.js"),v=require("uuid"),z=require("../common/picker/ImagePicker.cjs.js"),G=require("../util/ImageUtil.cjs.js");class V{}class J extends V{constructor(t="",a=""){super();g(this,"rootPath");g(this,"subPath");this.rootPath=t,this.subPath=a}cloneFilePath(t){const a=q.parse(t),r=`${a.name}_cloned_${T.default.randInt(1e5)}`;return q.format({dir:a.dir,ext:a.ext,name:r})}generateFileName(t){return`${t.split(".")[0]}_${v.v4().replace("-","")}`}}function K({formLayoutProps:s,name:e,label:t,required:a,provider:r,onUploading:u,aspectRatio:C,onRemoved:d,fieldClassName:x,hideLabel:N=!1,listType:b,fieldHelper:S,showSkipCropButton:$=!1,skipResize:p=!1,asyncUpload:O=!1},_){const m=f.Form.useFormInstance(),I=f.Form.useWatch(e,m),[w,k]=i.useState(!1),h=i.useCallback(async(l,F)=>{if(F){u==null||u(!0);const c=l.name,o=c.split("."),E=o[o.length-1],M=r.generateFileName(c),A=`${await r.getInitialPath()}/${M}.${E}`,B=await r.upload(l,A);k(!0),u==null||u(!1),m.setFieldValue(e,B)}else{const c=m.getFieldsValue(),o=await r.delete(c[e]);d==null||d(),o&&m.setFieldsValue({[e]:null})}},[m,e,d,u,r]),[P,j]=i.useState();return i.useEffect(()=>{!w&&I?r.getRealUrl(I).then(j):j(P)},[I,w,r,P]),i.useImperativeHandle(_,()=>({async uploadBlob(l,F){const c=await G.getBase64(l),o={name:F,uid:F+Math.random().toString(36).substring(2,15),url:c,originFileObj:l};return h(o,!0)}}),[h]),n.jsxs(f.Form.Item,{rules:a?W.required(t):[],label:N?null:t,required:a,name:e,help:S,...s,className:x,children:[n.jsx(z.default,{noStyle:!0,asyncUpload:O,listType:b,aspectRatio:C,values:P,onRemove:l=>{l&&h(l,!1)},onAdd:async l=>{l&&await h(l,!0)},className:x,showSkipCropButton:$,skipResize:p}),n.jsx(f.Input,{hidden:!0})]})}const L=i.forwardRef(K),Q=({provider:s,value:e})=>{const[t,a]=i.useState();return i.useEffect(()=>{e&&s.getRealUrl(e).then(a)},[s,e]),t?n.jsx(y,{url:t}):n.jsx(n.Fragment,{})},y=({url:s})=>n.jsx(f.Avatar,{className:"p-0",children:n.jsx(f.Image,{className:"m-0 p-0 position-relative",src:s,preview:{mask:n.jsx(R.EyeOutlined,{})}})});exports.FileDownloadProvider=V;exports.FileUploadProvider=J;exports.ImageCellValue=y;exports.ImageCrudCellValue=Q;exports.default=L;
1
+ "use strict";var H=Object.defineProperty;var R=(s,e,t)=>e in s?H(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t;var g=(s,e,t)=>R(s,typeof e!="symbol"?e+"":e,t);Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const n=require("react/jsx-runtime"),T=require("@ant-design/icons"),f=require("antd"),q=require("path-browserify"),i=require("react"),W=require("../util/NumberUtil.cjs.js"),v=require("../util/ValidationUtil.cjs.js"),z=require("uuid"),G=require("../common/picker/ImagePicker.cjs.js"),J=require("../util/ImageUtil.cjs.js");class V{}class K extends V{constructor(t="",a=""){super();g(this,"rootPath");g(this,"subPath");this.rootPath=t,this.subPath=a}cloneFilePath(t){const a=q.parse(t),r=`${a.name}_cloned_${W.default.randInt(1e5)}`;return q.format({dir:a.dir,ext:a.ext,name:r})}generateFileName(t){return`${t.split(".")[0]}_${z.v4().replace("-","")}`}}function L({formLayoutProps:s,name:e,label:t,required:a,provider:r,onUploading:u,aspectRatio:C,onRemoved:d,fieldClassName:x,hideLabel:N=!1,listType:b,fieldHelper:S,showSkipCropButton:$=!1,skipResize:p=!1,asyncUpload:O=!1,maxCount:_=1},k){const m=f.Form.useFormInstance(),I=f.Form.useWatch(e,m),[w,E]=i.useState(!1),h=i.useCallback(async(l,F)=>{if(F){u==null||u(!0);const c=l.name,o=c.split("."),M=o[o.length-1],A=r.generateFileName(c),B=`${await r.getInitialPath()}/${A}.${M}`,D=await r.upload(l,B);E(!0),u==null||u(!1),m.setFieldValue(e,D)}else{const c=m.getFieldsValue(),o=await r.delete(c[e]);d==null||d(),o&&m.setFieldsValue({[e]:null})}},[m,e,d,u,r]),[P,j]=i.useState();return i.useEffect(()=>{!w&&I?r.getRealUrl(I).then(j):j(P)},[I,w,r,P]),i.useImperativeHandle(k,()=>({async uploadBlob(l,F){const c=await J.getBase64(l),o={name:F,uid:F+Math.random().toString(36).substring(2,15),url:c,originFileObj:l};return h(o,!0)}}),[h]),n.jsxs(f.Form.Item,{rules:a?v.required(t):[],label:N?null:t,required:a,name:e,help:S,...s,className:x,children:[n.jsx(G.default,{noStyle:!0,asyncUpload:O,listType:b,aspectRatio:C,values:P,onRemove:l=>{l&&h(l,!1)},onAdd:async l=>{l&&await h(l,!0)},className:x,showSkipCropButton:$,skipResize:p,maxCount:_}),n.jsx(f.Input,{hidden:!0})]})}const Q=i.forwardRef(L),U=({provider:s,value:e})=>{const[t,a]=i.useState();return i.useEffect(()=>{e&&s.getRealUrl(e).then(a)},[s,e]),t?n.jsx(y,{url:t}):n.jsx(n.Fragment,{})},y=({url:s})=>n.jsx(f.Avatar,{className:"p-0",children:n.jsx(f.Image,{className:"m-0 p-0 position-relative",src:s,preview:{mask:n.jsx(T.EyeOutlined,{})}})});exports.FileDownloadProvider=V;exports.FileUploadProvider=K;exports.ImageCellValue=y;exports.ImageCrudCellValue=U;exports.default=Q;
@@ -12,6 +12,7 @@ export interface _ImageCrudField<T> extends InitialCrudField<T> {
12
12
  showSkipCropButton?: boolean;
13
13
  skipResize?: boolean;
14
14
  asyncUpload?: boolean;
15
+ maxCount?: number;
15
16
  }
16
17
  export interface ImageCrudField<T> extends _ImageCrudField<T> {
17
18
  type: "image";
@@ -1,19 +1,19 @@
1
- var D = Object.defineProperty;
2
- var M = (a, e, t) => e in a ? D(a, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : a[e] = t;
3
- var I = (a, e, t) => M(a, typeof e != "symbol" ? e + "" : e, t);
4
- import { jsx as i, Fragment as W, jsxs as q } from "react/jsx-runtime";
5
- import { EyeOutlined as z } from "@ant-design/icons";
6
- import { Avatar as G, Image as J, Form as d, Input as K } from "antd";
1
+ var M = Object.defineProperty;
2
+ var W = (a, e, t) => e in a ? M(a, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : a[e] = t;
3
+ var I = (a, e, t) => W(a, typeof e != "symbol" ? e + "" : e, t);
4
+ import { jsx as i, Fragment as q, jsxs as z } from "react/jsx-runtime";
5
+ import { EyeOutlined as G } from "@ant-design/icons";
6
+ import { Avatar as J, Image as K, Form as d, Input as L } from "antd";
7
7
  import y from "path-browserify";
8
- import L, { useState as P, useEffect as V, useCallback as Q, useImperativeHandle as R } from "react";
9
- import T from "../util/NumberUtil.es.js";
10
- import X from "../util/ValidationUtil.es.js";
11
- import { v4 as Y } from "uuid";
12
- import Z from "../common/picker/ImagePicker.es.js";
13
- import U from "../util/ImageUtil.es.js";
14
- class v {
8
+ import Q, { useState as P, useEffect as V, useCallback as R, useImperativeHandle as T } from "react";
9
+ import X from "../util/NumberUtil.es.js";
10
+ import Y from "../util/ValidationUtil.es.js";
11
+ import { v4 as Z } from "uuid";
12
+ import U from "../common/picker/ImagePicker.es.js";
13
+ import v from "../util/ImageUtil.es.js";
14
+ class ee {
15
15
  }
16
- class he extends v {
16
+ class Fe extends ee {
17
17
  constructor(t = "", s = "") {
18
18
  super();
19
19
  I(this, "rootPath");
@@ -21,7 +21,7 @@ class he extends v {
21
21
  this.rootPath = t, this.subPath = s;
22
22
  }
23
23
  cloneFilePath(t) {
24
- const s = y.parse(t), l = `${s.name}_cloned_${T.randInt(1e5)}`;
24
+ const s = y.parse(t), l = `${s.name}_cloned_${X.randInt(1e5)}`;
25
25
  return y.format({
26
26
  dir: s.dir,
27
27
  ext: s.ext,
@@ -29,10 +29,10 @@ class he extends v {
29
29
  });
30
30
  }
31
31
  generateFileName(t) {
32
- return `${t.split(".")[0]}_${Y().replace("-", "")}`;
32
+ return `${t.split(".")[0]}_${Z().replace("-", "")}`;
33
33
  }
34
34
  }
35
- function ee({
35
+ function te({
36
36
  formLayoutProps: a,
37
37
  name: e,
38
38
  label: t,
@@ -47,14 +47,15 @@ function ee({
47
47
  fieldHelper: b,
48
48
  showSkipCropButton: O = !1,
49
49
  skipResize: j = !1,
50
- asyncUpload: k = !1
51
- }, S) {
52
- const o = d.useFormInstance(), F = d.useWatch(e, o), [g, _] = P(!1), f = Q(
50
+ asyncUpload: k = !1,
51
+ maxCount: S = 1
52
+ }, _) {
53
+ const o = d.useFormInstance(), F = d.useWatch(e, o), [g, A] = P(!1), f = R(
53
54
  async (r, h) => {
54
55
  if (h) {
55
56
  n == null || n(!0);
56
- const c = r.name, u = c.split("."), A = u[u.length - 1], B = l.generateFileName(c), E = `${await l.getInitialPath()}/${B}.${A}`, H = await l.upload(r, E);
57
- _(!0), n == null || n(!1), o.setFieldValue(e, H);
57
+ const c = r.name, u = c.split("."), B = u[u.length - 1], E = l.generateFileName(c), H = `${await l.getInitialPath()}/${E}.${B}`, D = await l.upload(r, H);
58
+ A(!0), n == null || n(!1), o.setFieldValue(e, D);
58
59
  } else {
59
60
  const c = o.getFieldsValue(), u = await l.delete(c[e]);
60
61
  m == null || m(), u && o.setFieldsValue({ [e]: null });
@@ -64,11 +65,11 @@ function ee({
64
65
  ), [p, N] = P();
65
66
  return V(() => {
66
67
  !g && F ? l.getRealUrl(F).then(N) : N(p);
67
- }, [F, g, l, p]), R(
68
- S,
68
+ }, [F, g, l, p]), T(
69
+ _,
69
70
  () => ({
70
71
  async uploadBlob(r, h) {
71
- const c = await U.getBase64(r), u = {
72
+ const c = await v.getBase64(r), u = {
72
73
  name: h,
73
74
  uid: h + Math.random().toString(36).substring(2, 15),
74
75
  url: c,
@@ -78,10 +79,10 @@ function ee({
78
79
  }
79
80
  }),
80
81
  [f]
81
- ), /* @__PURE__ */ q(
82
+ ), /* @__PURE__ */ z(
82
83
  d.Item,
83
84
  {
84
- rules: s ? X.required(t) : [],
85
+ rules: s ? Y.required(t) : [],
85
86
  label: $ ? null : t,
86
87
  required: s,
87
88
  name: e,
@@ -90,7 +91,7 @@ function ee({
90
91
  className: w,
91
92
  children: [
92
93
  /* @__PURE__ */ i(
93
- Z,
94
+ U,
94
95
  {
95
96
  noStyle: !0,
96
97
  asyncUpload: k,
@@ -105,33 +106,34 @@ function ee({
105
106
  },
106
107
  className: w,
107
108
  showSkipCropButton: O,
108
- skipResize: j
109
+ skipResize: j,
110
+ maxCount: S
109
111
  }
110
112
  ),
111
- /* @__PURE__ */ i(K, { hidden: !0 })
113
+ /* @__PURE__ */ i(L, { hidden: !0 })
112
114
  ]
113
115
  }
114
116
  );
115
117
  }
116
- const Fe = L.forwardRef(ee), pe = ({ provider: a, value: e }) => {
118
+ const pe = Q.forwardRef(te), Ie = ({ provider: a, value: e }) => {
117
119
  const [t, s] = P();
118
120
  return V(() => {
119
121
  e && a.getRealUrl(e).then(s);
120
- }, [a, e]), t ? /* @__PURE__ */ i(te, { url: t }) : /* @__PURE__ */ i(W, {});
121
- }, te = ({ url: a }) => /* @__PURE__ */ i(G, { className: "p-0", children: /* @__PURE__ */ i(
122
- J,
122
+ }, [a, e]), t ? /* @__PURE__ */ i(ae, { url: t }) : /* @__PURE__ */ i(q, {});
123
+ }, ae = ({ url: a }) => /* @__PURE__ */ i(J, { className: "p-0", children: /* @__PURE__ */ i(
124
+ K,
123
125
  {
124
126
  className: "m-0 p-0 position-relative",
125
127
  src: a,
126
128
  preview: {
127
- mask: /* @__PURE__ */ i(z, {})
129
+ mask: /* @__PURE__ */ i(G, {})
128
130
  }
129
131
  }
130
132
  ) });
131
133
  export {
132
- v as FileDownloadProvider,
133
- he as FileUploadProvider,
134
- te as ImageCellValue,
135
- pe as ImageCrudCellValue,
136
- Fe as default
134
+ ee as FileDownloadProvider,
135
+ Fe as FileUploadProvider,
136
+ ae as ImageCellValue,
137
+ Ie as ImageCrudCellValue,
138
+ pe as default
137
139
  };
@@ -13,6 +13,8 @@ export { default as ImageCrudField, FileDownloadProvider, FileUploadProvider, Im
13
13
  export type { ImageCrudField as ImageCrudFieldProps } from './ImageCrudField';
14
14
  export { default as FileCrudField, FileCellValue, FileCrudCellValue, } from './FileCrudField';
15
15
  export type { FileCrudField as FileCrudFieldProps } from './FileCrudField';
16
+ export { default as FileCrudDragNDropField } from './FileCrudDragNDropField';
17
+ export type { FileCrudDragNDropField as FileCrudDragNDropFieldProps, } from './FileCrudDragNDropField';
16
18
  export { default as CrudTextAreaComponent } from './CrudTextAreaComponent';
17
19
  export type { TextAreaBasedFieldProps } from './CrudTextAreaComponent';
18
20
  export { default as CrudImportComponent } from './import/CrudImportComponent';
@@ -1 +1 @@
1
- "use strict";const n=require("react/jsx-runtime"),jt=require("antd"),yt=require("@dnd-kit/core"),ht=require("@dnd-kit/modifiers"),qt=require("@dnd-kit/utilities"),d=require("@dnd-kit/sortable"),Ct=require("../../common/button/Button.cjs.js"),lt=require("../../common/button/RefreshButton.cjs.js"),It=require("../../common/button/ViewButtonTable.cjs.js"),St=require("../actions/index.cjs.js"),Rt=require("../../common/table/table.cjs.js"),s=require("react"),Mt=require("../../locale/index.cjs.js"),dt=require("../CrudSearchComponent.cjs.js"),Tt=require("./CrudDecListView.cjs.js"),et=require("./CrudViewerUtil.cjs.js"),Vt=require("@ant-design/icons"),nt=require("../../util/CrudUtil.cjs.js"),Bt=require("../../common/layout/VerticalSpace.cjs.js"),Dt=s.memo(Rt);function Nt({idField:o="id",loadingData:h,fields:m,isDeleting:T,isHiding:R,viewable:c=!1,paginateProps:x,onDelete:q,onHide:V,onUpdate:C,data:l=[],extraAction:B,onClickUpdate:D,minusHeight:k,scroll:O,onClickClone:v,className:z,expandable:$,size:A,bordered:_,descListColumn:st,extraView:E,decListLayout:rt,scrollToTop:Lt,onClickRefresh:G,closeViewOnClickUpdate:J,onExport:K,confirmHiding:Q,confirmDeleting:X,rowClassName:Y,actionWidth:Z=190,draggable:t,rowSelection:W,...ct}){const{t:p}=Mt.useTranslationLib(),P=s.useMemo(()=>m.map(({hideInTable:e,hidden:r,width:u,label:f,halign:I,...S})=>{const N=nt.getRealName(S.name);return{title:f,width:u,key:N,dataIndex:N,hidden:e||r,align:I??(S.type==="number"?"right":void 0),render:et.getRendererValueCrudViewer(S),sorter:S.sorter}}),[m]),[i,M]=s.useState(),[H,U]=s.useState(),[y,w]=s.useState([]),ut=s.useCallback(e=>{M(e)},[]);s.useEffect(()=>{l&&w(l)},[l]),s.useEffect(()=>{l&&M(e=>{if(e)return l.find(r=>r[o]===e[o])})},[l,o,i]);const a=s.useCallback(e=>{var f;const{active:r,over:u}=e;if(t!=null&&t.onDragEnd&&(t==null||t.onDragEnd(e)),r.id!==(u==null?void 0:u.id)){const I=y.findIndex(j=>j[o]===r.id),S=y.findIndex(j=>j[o]===(u==null?void 0:u.id)),N=d.arrayMove(y,I,S);w(j=>{const xt=j.findIndex(L=>L[o]===(r==null?void 0:r.id)),ft=j.findIndex(L=>L[o]===(u==null?void 0:u.id));return d.arrayMove(j,xt,ft)}),(f=t==null?void 0:t.onDrag)==null||f.call(t,{newOrder:N.map(j=>j[o])})}},[y,o,t]),it=s.useMemo(()=>{let e=typeof c=="string"?i==null?void 0:i[c]:void 0;if(typeof e=="object"){const r=m.find(u=>nt.getRealName(u.name)===c);e=et.getRendererValueCrudViewer(r)(e,i,0)}return e},[c,i,m]),F=s.useMemo(()=>({rowSelection:W,rowClassName:Y,className:z,scroll:O??(k?{y:`calc(100vh - ${k})`}:void 0),id:"crud-table",bordered:_,size:A,expandable:$}),[W,Y,z,O,k,_,A,$]),b=s.useMemo(()=>x?{...x,total:x.count,onChange:x.setPage,current:x.page,pageSize:x.pageSize}:void 0,[x]),g=s.useMemo(()=>{const e=C||D||q||B||c,r=[];return t&&r.push({key:"key",align:"center",width:5,title:t==null?void 0:t.columnLabel,render:()=>n.jsx(kt,{tooltip:t==null?void 0:t.tooltip})}),r.push(...P),e&&e&&r.push({title:p("str.action"),fixed:"right",width:Z,render:(u,f)=>n.jsxs(n.Fragment,{children:[c&&n.jsx(It,{value:f,onClick:typeof c=="object"?()=>{var I;return(I=c.onClick)==null?void 0:I.call(c,f)}:ut}),n.jsx(St,{data:f,idField:o,extraAction:B,onUpdate:C,onClickUpdate:D,onClickClone:v,onDelete:q,onHide:V,onExport:K,isHiding:R,isDeleting:T,confirmHiding:Q,confirmDeleting:X,closeViewOnClickUpdate:J,recentUpdateOrDeleteId:H,setRecentUpdateOrDeleteId:U,setOpenView:M})]})}),r},[P,C,D,q,B,c,p,Z]),tt=s.useMemo(()=>y.map(e=>e[o]),[y,o]),mt=s.useCallback(()=>{const e=n.jsx(Dt,{...F,dataSource:y,loading:h,components:t?{body:{row:Et}}:void 0,pagination:b,columns:g});return t?n.jsx(yt.DndContext,{modifiers:[ht.restrictToVerticalAxis],onDragEnd:a,children:n.jsx(d.SortableContext,{items:tt,strategy:d.verticalListSortingStrategy,children:e})}):e},[F,y,h,b,g,t,tt,a]);return n.jsxs("div",{children:[(typeof c=="boolean"||typeof c=="string")&&n.jsx(jt.Modal,{width:"100%",open:!!i,title:it??n.jsx("div",{children:" "}),footer:n.jsx(n.Fragment,{}),closable:!0,onCancel:()=>M(void 0),children:!!i&&n.jsxs("div",{children:[n.jsx(Tt.CrudDecListView,{layout:rt,descListColumn:st,data:i,fields:m,idField:o,extraAction:B,onUpdate:C,onClickUpdate:D,onClickClone:v,onDelete:q,onHide:V,onExport:K,isHiding:R,isDeleting:T,confirmHiding:Q,confirmDeleting:X,closeViewOnClickUpdate:J,recentUpdateOrDeleteId:H,setRecentUpdateOrDeleteId:U,setOpenView:M}),E==null?void 0:E(i)]},i==null?void 0:i[o])}),n.jsx(dt,{fields:m,...ct}),n.jsxs(Bt,{children:[!!G&&n.jsx(lt.RefreshButton,{onClick:G}),mt()]})]})}const ot=s.createContext({}),kt=({tooltip:o})=>{const{setActivatorNodeRef:h,listeners:m}=s.useContext(ot);return n.jsx(Ct,{type:"text",size:"small",tooltip:o,icon:n.jsx(Vt.HolderOutlined,{}),style:{cursor:"move",border:"none"},ref:h,...m})},Et=o=>{const{attributes:h,listeners:m,setNodeRef:T,setActivatorNodeRef:R,transform:c,transition:x,isDragging:q}=d.useSortable({id:o["data-row-key"]}),V={...o.style,transform:qt.CSS.Translate.toString(c),transition:x,...q?{position:"relative",zIndex:9999}:{}},C=s.useMemo(()=>({setActivatorNodeRef:R,listeners:m}),[R,m]);return n.jsx(ot.Provider,{value:C,children:n.jsx("tr",{...o,ref:T,style:V,...h})})};module.exports=Nt;
1
+ "use strict";const n=require("react/jsx-runtime"),ht=require("antd"),yt=require("@dnd-kit/core"),qt=require("@dnd-kit/modifiers"),Ct=require("@dnd-kit/utilities"),d=require("@dnd-kit/sortable"),lt=require("../../common/button/Button.cjs.js"),It=require("../../common/button/RefreshButton.cjs.js"),St=require("../../common/button/ViewButtonTable.cjs.js"),Rt=require("../actions/index.cjs.js"),Mt=require("../../common/table/table.cjs.js"),s=require("react"),dt=require("../../locale/index.cjs.js"),Tt=require("../CrudSearchComponent.cjs.js"),Vt=require("./CrudDecListView.cjs.js"),nt=require("./CrudViewerUtil.cjs.js"),Bt=require("@ant-design/icons"),ot=require("../../util/CrudUtil.cjs.js"),Dt=require("../../common/layout/VerticalSpace.cjs.js"),Nt=s.memo(Mt);function kt({summary:j,idField:o="id",loadingData:q,fields:h,isDeleting:R,isHiding:T,viewable:c=!1,paginateProps:m,onDelete:C,onHide:V,onUpdate:B,data:l=[],extraAction:D,onClickUpdate:N,minusHeight:E,scroll:v,onClickClone:z,className:$,expandable:A,size:_,bordered:G,descListColumn:rt,extraView:L,decListLayout:ct,scrollToTop:Ot,onClickRefresh:J,closeViewOnClickUpdate:K,onExport:Q,confirmHiding:X,confirmDeleting:Y,rowClassName:Z,actionWidth:W=190,draggable:t,rowSelection:p,...ut}){const{t:P}=dt.useTranslationLib(),H=s.useMemo(()=>h.map(({hideInTable:e,hidden:r,width:u,label:x,halign:I,...S})=>{const k=ot.getRealName(S.name);return{title:x,width:u,key:k,dataIndex:k,hidden:e||r,align:I??(S.type==="number"?"right":void 0),render:nt.getRendererValueCrudViewer(S),sorter:S.sorter}}),[h]),[i,M]=s.useState(),[U,w]=s.useState(),[y,F]=s.useState([]),it=s.useCallback(e=>{M(e)},[]);s.useEffect(()=>{l&&F(l)},[l]),s.useEffect(()=>{l&&M(e=>{if(e)return l.find(r=>r[o]===e[o])})},[l,o,i]);const a=s.useCallback(e=>{var x;const{active:r,over:u}=e;if(t!=null&&t.onDragEnd&&(t==null||t.onDragEnd(e)),r.id!==(u==null?void 0:u.id)){const I=y.findIndex(f=>f[o]===r.id),S=y.findIndex(f=>f[o]===(u==null?void 0:u.id)),k=d.arrayMove(y,I,S);F(f=>{const ft=f.findIndex(O=>O[o]===(r==null?void 0:r.id)),jt=f.findIndex(O=>O[o]===(u==null?void 0:u.id));return d.arrayMove(f,ft,jt)}),(x=t==null?void 0:t.onDrag)==null||x.call(t,{newOrder:k.map(f=>f[o])})}},[y,o,t]),mt=s.useMemo(()=>{let e=typeof c=="string"?i==null?void 0:i[c]:void 0;if(typeof e=="object"){const r=h.find(u=>ot.getRealName(u.name)===c);e=nt.getRendererValueCrudViewer(r)(e,i,0)}return e},[c,i,h]),b=s.useMemo(()=>({rowSelection:p,rowClassName:Z,className:$,scroll:v??(E?{y:`calc(100vh - ${E})`}:void 0),id:"crud-table",bordered:G,size:_,expandable:A}),[p,Z,$,v,E,G,_,A]),g=s.useMemo(()=>m?{...m,total:m.count,onChange:m.setPage,current:m.page,pageSize:m.pageSize}:void 0,[m]),tt=s.useMemo(()=>{const e=B||N||C||D||c,r=[];return t&&r.push({key:"key",align:"center",width:5,title:t==null?void 0:t.columnLabel,render:()=>n.jsx(Et,{tooltip:t==null?void 0:t.tooltip})}),r.push(...H),e&&e&&r.push({title:P("str.action"),fixed:"right",width:W,render:(u,x)=>n.jsxs(n.Fragment,{children:[c&&n.jsx(St,{value:x,onClick:typeof c=="object"?()=>{var I;return(I=c.onClick)==null?void 0:I.call(c,x)}:it}),n.jsx(Rt,{data:x,idField:o,extraAction:D,onUpdate:B,onClickUpdate:N,onClickClone:z,onDelete:C,onHide:V,onExport:Q,isHiding:T,isDeleting:R,confirmHiding:X,confirmDeleting:Y,closeViewOnClickUpdate:K,recentUpdateOrDeleteId:U,setRecentUpdateOrDeleteId:w,setOpenView:M})]})}),r},[H,B,N,C,D,c,P,W]),et=s.useMemo(()=>y.map(e=>e[o]),[y,o]),xt=s.useCallback(()=>{const e=n.jsx(Nt,{...b,summary:j,dataSource:y,loading:q,components:t?{body:{row:Lt}}:void 0,pagination:g,columns:tt});return t?n.jsx(yt.DndContext,{modifiers:[qt.restrictToVerticalAxis],onDragEnd:a,children:n.jsx(d.SortableContext,{items:et,strategy:d.verticalListSortingStrategy,children:e})}):e},[b,y,q,g,tt,j,t,et,a]);return n.jsxs("div",{children:[(typeof c=="boolean"||typeof c=="string")&&n.jsx(ht.Modal,{width:"100%",open:!!i,title:mt??n.jsx("div",{children:" "}),footer:n.jsx(n.Fragment,{}),closable:!0,onCancel:()=>M(void 0),children:!!i&&n.jsxs("div",{children:[n.jsx(Vt.CrudDecListView,{layout:ct,descListColumn:rt,data:i,fields:h,idField:o,extraAction:D,onUpdate:B,onClickUpdate:N,onClickClone:z,onDelete:C,onHide:V,onExport:Q,isHiding:T,isDeleting:R,confirmHiding:X,confirmDeleting:Y,closeViewOnClickUpdate:K,recentUpdateOrDeleteId:U,setRecentUpdateOrDeleteId:w,setOpenView:M}),L==null?void 0:L(i)]},i==null?void 0:i[o])}),n.jsx(Tt,{fields:h,...ut}),n.jsxs(Dt,{children:[!!J&&n.jsx(It.RefreshButton,{onClick:J}),xt()]})]})}const st=s.createContext({}),Et=({tooltip:j})=>{const{setActivatorNodeRef:o,listeners:q}=s.useContext(st);return n.jsx(lt,{type:"text",size:"small",tooltip:j,icon:n.jsx(Bt.HolderOutlined,{}),style:{cursor:"move",border:"none"},ref:o,...q})},Lt=j=>{const{attributes:o,listeners:q,setNodeRef:h,setActivatorNodeRef:R,transform:T,transition:c,isDragging:m}=d.useSortable({id:j["data-row-key"]}),C={...j.style,transform:Ct.CSS.Translate.toString(T),transition:c,...m?{position:"relative",zIndex:9999}:{}},V=s.useMemo(()=>({setActivatorNodeRef:R,listeners:q}),[R,q]);return n.jsx(st.Provider,{value:V,children:n.jsx("tr",{...j,ref:h,style:C,...o})})};module.exports=kt;
@@ -20,6 +20,7 @@ export type CrudViewableProps<T> = boolean | keyof T | {
20
20
  onClick: (t: T) => void;
21
21
  };
22
22
  export type CrudViewerProps<T, FormType> = {
23
+ summary?: TableProps<T>["summary"];
23
24
  fields: CrudFieldProps<T>[];
24
25
  decListLayout?: "horizontal" | "vertical";
25
26
  viewable?: CrudViewableProps<T>;
@@ -41,5 +42,5 @@ export type CrudViewerProps<T, FormType> = {
41
42
  actionWidth?: string | number;
42
43
  draggable?: CrudDragableProps<T>;
43
44
  } & CrudActionsProps<T, FormType> & CrudSearchComponentProps<T, FormType>;
44
- declare function CrudViewer<T, FormType = T>({ idField, loadingData, fields, isDeleting, isHiding, viewable, paginateProps, onDelete, onHide, onUpdate, data, extraAction, onClickUpdate, minusHeight, scroll, onClickClone, className, expandable, size, bordered, descListColumn, extraView, decListLayout, scrollToTop, onClickRefresh, closeViewOnClickUpdate, onExport, confirmHiding, confirmDeleting, rowClassName, actionWidth, draggable, rowSelection, ...props }: CrudViewerProps<T, FormType>): import("react/jsx-runtime").JSX.Element;
45
+ declare function CrudViewer<T, FormType = T>({ summary, idField, loadingData, fields, isDeleting, isHiding, viewable, paginateProps, onDelete, onHide, onUpdate, data, extraAction, onClickUpdate, minusHeight, scroll, onClickClone, className, expandable, size, bordered, descListColumn, extraView, decListLayout, scrollToTop, onClickRefresh, closeViewOnClickUpdate, onExport, confirmHiding, confirmDeleting, rowClassName, actionWidth, draggable, rowSelection, ...props }: CrudViewerProps<T, FormType>): import("react/jsx-runtime").JSX.Element;
45
46
  export default CrudViewer;
@@ -1,319 +1,322 @@
1
- import { jsx as e, jsxs as E, Fragment as rt } from "react/jsx-runtime";
2
- import { Modal as Tt } from "antd";
3
- import { DndContext as Rt } from "@dnd-kit/core";
4
- import { restrictToVerticalAxis as lt } from "@dnd-kit/modifiers";
5
- import { CSS as Bt } from "@dnd-kit/utilities";
6
- import { arrayMove as et, SortableContext as Dt, verticalListSortingStrategy as Nt, useSortable as Ot } from "@dnd-kit/sortable";
7
- import dt from "../../common/button/Button.es.js";
8
- import { RefreshButton as jt } from "../../common/button/RefreshButton.es.js";
9
- import Et from "../../common/button/ViewButtonTable.es.js";
10
- import Lt from "../actions/index.es.js";
11
- import Mt from "../../common/table/table.es.js";
12
- import ut, { useMemo as p, useState as k, useCallback as z, useEffect as ct, useContext as Vt } from "react";
13
- import { useTranslationLib as kt } from "../../locale/index.es.js";
14
- import zt from "../CrudSearchComponent.es.js";
15
- import { CrudDecListView as vt } from "./CrudDecListView.es.js";
16
- import { getRendererValueCrudViewer as st } from "./CrudViewerUtil.es.js";
17
- import { HolderOutlined as At } from "@ant-design/icons";
18
- import mt from "../../util/CrudUtil.es.js";
19
- import _t from "../../common/layout/VerticalSpace.es.js";
20
- const $t = ut.memo(Mt);
21
- function co({
1
+ import { jsx as e, jsxs as L, Fragment as et } from "react/jsx-runtime";
2
+ import { Modal as Rt } from "antd";
3
+ import { DndContext as lt } from "@dnd-kit/core";
4
+ import { restrictToVerticalAxis as Bt } from "@dnd-kit/modifiers";
5
+ import { CSS as Dt } from "@dnd-kit/utilities";
6
+ import { arrayMove as ct, SortableContext as Nt, verticalListSortingStrategy as Ot, useSortable as dt } from "@dnd-kit/sortable";
7
+ import jt from "../../common/button/Button.es.js";
8
+ import { RefreshButton as Et } from "../../common/button/RefreshButton.es.js";
9
+ import Lt from "../../common/button/ViewButtonTable.es.js";
10
+ import Mt from "../actions/index.es.js";
11
+ import Vt from "../../common/table/table.es.js";
12
+ import ft, { useMemo as x, useState as z, useCallback as v, useEffect as st, useContext as kt } from "react";
13
+ import { useTranslationLib as zt } from "../../locale/index.es.js";
14
+ import vt from "../CrudSearchComponent.es.js";
15
+ import { CrudDecListView as At } from "./CrudDecListView.es.js";
16
+ import { getRendererValueCrudViewer as mt } from "./CrudViewerUtil.es.js";
17
+ import { HolderOutlined as _t } from "@ant-design/icons";
18
+ import ut from "../../util/CrudUtil.es.js";
19
+ import $t from "../../common/layout/VerticalSpace.es.js";
20
+ const qt = ft.memo(Vt);
21
+ function so({
22
+ summary: h,
22
23
  idField: n = "id",
23
24
  loadingData: C,
24
- fields: u,
25
- isDeleting: D,
26
- isHiding: l,
25
+ fields: p,
26
+ isDeleting: l,
27
+ isHiding: D,
27
28
  viewable: c = !1,
28
- paginateProps: f,
29
- onDelete: x,
29
+ paginateProps: u,
30
+ onDelete: I,
30
31
  onHide: N,
31
- onUpdate: I,
32
+ onUpdate: O,
32
33
  data: S = [],
33
- extraAction: O,
34
- onClickUpdate: d,
35
- minusHeight: L,
36
- scroll: v,
37
- onClickClone: A,
38
- className: _,
39
- expandable: $,
40
- size: q,
41
- bordered: G,
42
- descListColumn: it,
43
- extraView: M,
44
- decListLayout: yt,
45
- scrollToTop: Jt,
46
- onClickRefresh: J,
47
- closeViewOnClickUpdate: K,
48
- onExport: Q,
49
- confirmHiding: X,
50
- confirmDeleting: Y,
51
- rowClassName: Z,
52
- actionWidth: W = 190,
34
+ extraAction: d,
35
+ onClickUpdate: j,
36
+ minusHeight: M,
37
+ scroll: A,
38
+ onClickClone: _,
39
+ className: $,
40
+ expandable: q,
41
+ size: G,
42
+ bordered: J,
43
+ descListColumn: ht,
44
+ extraView: V,
45
+ decListLayout: pt,
46
+ scrollToTop: Kt,
47
+ onClickRefresh: K,
48
+ closeViewOnClickUpdate: Q,
49
+ onExport: X,
50
+ confirmHiding: Y,
51
+ confirmDeleting: Z,
52
+ rowClassName: W,
53
+ actionWidth: P = 190,
53
54
  draggable: t,
54
- rowSelection: P,
55
- ...ht
55
+ rowSelection: H,
56
+ ...yt
56
57
  }) {
57
- const { t: H } = kt(), U = p(
58
- () => u.map(({ hideInTable: o, hidden: r, width: s, label: i, halign: T, ...R }) => {
59
- const j = mt.getRealName(R.name);
58
+ const { t: U } = zt(), w = x(
59
+ () => p.map(({ hideInTable: o, hidden: r, width: s, label: f, halign: T, ...R }) => {
60
+ const E = ut.getRealName(R.name);
60
61
  return {
61
- title: i,
62
+ title: f,
62
63
  width: s,
63
- key: j,
64
- dataIndex: j,
64
+ key: E,
65
+ dataIndex: E,
65
66
  hidden: o || r,
66
67
  align: T ?? (R.type === "number" ? "right" : void 0),
67
- render: st(R),
68
+ render: mt(R),
68
69
  sorter: R.sorter
69
70
  };
70
71
  }),
71
- [u]
72
- ), [m, B] = k(), [w, F] = k(), [h, a] = k([]), pt = z((o) => {
72
+ [p]
73
+ ), [m, B] = z(), [F, a] = z(), [y, b] = z([]), Ct = v((o) => {
73
74
  B(o);
74
75
  }, []);
75
- ct(() => {
76
- S && a(S);
77
- }, [S]), ct(() => {
76
+ st(() => {
77
+ S && b(S);
78
+ }, [S]), st(() => {
78
79
  S && B((o) => {
79
80
  if (o)
80
81
  return S.find((r) => r[n] === o[n]);
81
82
  });
82
83
  }, [S, n, m]);
83
- const b = z(
84
+ const g = v(
84
85
  (o) => {
85
- var i;
86
+ var f;
86
87
  const { active: r, over: s } = o;
87
88
  if (t != null && t.onDragEnd && (t == null || t.onDragEnd(o)), r.id !== (s == null ? void 0 : s.id)) {
88
- const T = h.findIndex(
89
- (y) => y[n] === r.id
90
- ), R = h.findIndex(
91
- (y) => y[n] === (s == null ? void 0 : s.id)
92
- ), j = et(h, T, R);
93
- a((y) => {
94
- const It = y.findIndex(
95
- (V) => V[n] === (r == null ? void 0 : r.id)
96
- ), St = y.findIndex(
97
- (V) => V[n] === (s == null ? void 0 : s.id)
89
+ const T = y.findIndex(
90
+ (i) => i[n] === r.id
91
+ ), R = y.findIndex(
92
+ (i) => i[n] === (s == null ? void 0 : s.id)
93
+ ), E = ct(y, T, R);
94
+ b((i) => {
95
+ const St = i.findIndex(
96
+ (k) => k[n] === (r == null ? void 0 : r.id)
97
+ ), Tt = i.findIndex(
98
+ (k) => k[n] === (s == null ? void 0 : s.id)
98
99
  );
99
- return et(y, It, St);
100
- }), (i = t == null ? void 0 : t.onDrag) == null || i.call(t, {
101
- newOrder: j.map((y) => y[n])
100
+ return ct(i, St, Tt);
101
+ }), (f = t == null ? void 0 : t.onDrag) == null || f.call(t, {
102
+ newOrder: E.map((i) => i[n])
102
103
  });
103
104
  }
104
105
  },
105
- [h, n, t]
106
- ), Ct = p(() => {
106
+ [y, n, t]
107
+ ), xt = x(() => {
107
108
  let o = typeof c == "string" ? m == null ? void 0 : m[c] : void 0;
108
109
  if (typeof o == "object") {
109
- const r = u.find((s) => mt.getRealName(s.name) === c);
110
- o = st(r)(
110
+ const r = p.find((s) => ut.getRealName(s.name) === c);
111
+ o = mt(r)(
111
112
  o,
112
113
  m,
113
114
  0
114
115
  );
115
116
  }
116
117
  return o;
117
- }, [c, m, u]), g = p(
118
+ }, [c, m, p]), tt = x(
118
119
  () => ({
119
- rowSelection: P,
120
- rowClassName: Z,
121
- className: _,
122
- scroll: v ?? (L ? { y: `calc(100vh - ${L})` } : void 0),
120
+ rowSelection: H,
121
+ rowClassName: W,
122
+ className: $,
123
+ scroll: A ?? (M ? { y: `calc(100vh - ${M})` } : void 0),
123
124
  id: "crud-table",
124
- bordered: G,
125
- size: q,
126
- expandable: $
125
+ bordered: J,
126
+ size: G,
127
+ expandable: q
127
128
  }),
128
129
  [
129
- P,
130
- Z,
131
- _,
132
- v,
133
- L,
130
+ H,
131
+ W,
132
+ $,
133
+ A,
134
+ M,
135
+ J,
134
136
  G,
135
- q,
136
- $
137
+ q
137
138
  ]
138
- ), tt = p(
139
- () => f ? {
140
- ...f,
141
- total: f.count,
142
- onChange: f.setPage,
143
- current: f.page,
144
- pageSize: f.pageSize
139
+ ), ot = x(
140
+ () => u ? {
141
+ ...u,
142
+ total: u.count,
143
+ onChange: u.setPage,
144
+ current: u.page,
145
+ pageSize: u.pageSize
145
146
  } : void 0,
146
- [f]
147
- ), ot = p(() => {
148
- const o = I || d || x || O || c, r = [];
147
+ [u]
148
+ ), nt = x(() => {
149
+ const o = O || j || I || d || c, r = [];
149
150
  return t && r.push({
150
151
  key: "key",
151
152
  align: "center",
152
153
  width: 5,
153
154
  title: t == null ? void 0 : t.columnLabel,
154
- render: () => /* @__PURE__ */ e(qt, { tooltip: t == null ? void 0 : t.tooltip })
155
- }), r.push(...U), o && o && r.push({
156
- title: H("str.action"),
155
+ render: () => /* @__PURE__ */ e(Gt, { tooltip: t == null ? void 0 : t.tooltip })
156
+ }), r.push(...w), o && o && r.push({
157
+ title: U("str.action"),
157
158
  fixed: "right",
158
- width: W,
159
- render: (s, i) => /* @__PURE__ */ E(rt, { children: [
159
+ width: P,
160
+ render: (s, f) => /* @__PURE__ */ L(et, { children: [
160
161
  c && /* @__PURE__ */ e(
161
- Et,
162
+ Lt,
162
163
  {
163
- value: i,
164
+ value: f,
164
165
  onClick: typeof c == "object" ? () => {
165
166
  var T;
166
- return (T = c.onClick) == null ? void 0 : T.call(c, i);
167
- } : pt
167
+ return (T = c.onClick) == null ? void 0 : T.call(c, f);
168
+ } : Ct
168
169
  }
169
170
  ),
170
171
  /* @__PURE__ */ e(
171
- Lt,
172
+ Mt,
172
173
  {
173
- data: i,
174
+ data: f,
174
175
  idField: n,
175
- extraAction: O,
176
- onUpdate: I,
177
- onClickUpdate: d,
178
- onClickClone: A,
179
- onDelete: x,
176
+ extraAction: d,
177
+ onUpdate: O,
178
+ onClickUpdate: j,
179
+ onClickClone: _,
180
+ onDelete: I,
180
181
  onHide: N,
181
- onExport: Q,
182
- isHiding: l,
183
- isDeleting: D,
184
- confirmHiding: X,
185
- confirmDeleting: Y,
186
- closeViewOnClickUpdate: K,
187
- recentUpdateOrDeleteId: w,
188
- setRecentUpdateOrDeleteId: F,
182
+ onExport: X,
183
+ isHiding: D,
184
+ isDeleting: l,
185
+ confirmHiding: Y,
186
+ confirmDeleting: Z,
187
+ closeViewOnClickUpdate: Q,
188
+ recentUpdateOrDeleteId: F,
189
+ setRecentUpdateOrDeleteId: a,
189
190
  setOpenView: B
190
191
  }
191
192
  )
192
193
  ] })
193
194
  }), r;
194
195
  }, [
195
- U,
196
+ w,
197
+ O,
198
+ j,
196
199
  I,
197
200
  d,
198
- x,
199
- O,
200
201
  c,
201
- H,
202
- W
203
- ]), nt = p(
204
- () => h.map((o) => o[n]),
205
- [h, n]
206
- ), xt = z(() => {
202
+ U,
203
+ P
204
+ ]), rt = x(
205
+ () => y.map((o) => o[n]),
206
+ [y, n]
207
+ ), It = v(() => {
207
208
  const o = /* @__PURE__ */ e(
208
- $t,
209
+ qt,
209
210
  {
210
- ...g,
211
- dataSource: h,
211
+ ...tt,
212
+ summary: h,
213
+ dataSource: y,
212
214
  loading: C,
213
- components: t ? { body: { row: Gt } } : void 0,
214
- pagination: tt,
215
- columns: ot
215
+ components: t ? { body: { row: Jt } } : void 0,
216
+ pagination: ot,
217
+ columns: nt
216
218
  }
217
219
  );
218
- return t ? /* @__PURE__ */ e(Rt, { modifiers: [lt], onDragEnd: b, children: /* @__PURE__ */ e(
219
- Dt,
220
+ return t ? /* @__PURE__ */ e(lt, { modifiers: [Bt], onDragEnd: g, children: /* @__PURE__ */ e(
221
+ Nt,
220
222
  {
221
- items: nt,
222
- strategy: Nt,
223
+ items: rt,
224
+ strategy: Ot,
223
225
  children: o
224
226
  }
225
227
  ) }) : o;
226
228
  }, [
227
- g,
228
- h,
229
- C,
230
229
  tt,
230
+ y,
231
+ C,
231
232
  ot,
232
- t,
233
233
  nt,
234
- b
234
+ h,
235
+ t,
236
+ rt,
237
+ g
235
238
  ]);
236
- return /* @__PURE__ */ E("div", { children: [
239
+ return /* @__PURE__ */ L("div", { children: [
237
240
  (typeof c == "boolean" || typeof c == "string") && /* @__PURE__ */ e(
238
- Tt,
241
+ Rt,
239
242
  {
240
243
  width: "100%",
241
244
  open: !!m,
242
- title: Ct ?? /* @__PURE__ */ e("div", { children: " " }),
243
- footer: /* @__PURE__ */ e(rt, {}),
245
+ title: xt ?? /* @__PURE__ */ e("div", { children: " " }),
246
+ footer: /* @__PURE__ */ e(et, {}),
244
247
  closable: !0,
245
248
  onCancel: () => B(void 0),
246
- children: !!m && /* @__PURE__ */ E("div", { children: [
249
+ children: !!m && /* @__PURE__ */ L("div", { children: [
247
250
  /* @__PURE__ */ e(
248
- vt,
251
+ At,
249
252
  {
250
- layout: yt,
251
- descListColumn: it,
253
+ layout: pt,
254
+ descListColumn: ht,
252
255
  data: m,
253
- fields: u,
256
+ fields: p,
254
257
  idField: n,
255
- extraAction: O,
256
- onUpdate: I,
257
- onClickUpdate: d,
258
- onClickClone: A,
259
- onDelete: x,
258
+ extraAction: d,
259
+ onUpdate: O,
260
+ onClickUpdate: j,
261
+ onClickClone: _,
262
+ onDelete: I,
260
263
  onHide: N,
261
- onExport: Q,
262
- isHiding: l,
263
- isDeleting: D,
264
- confirmHiding: X,
265
- confirmDeleting: Y,
266
- closeViewOnClickUpdate: K,
267
- recentUpdateOrDeleteId: w,
268
- setRecentUpdateOrDeleteId: F,
264
+ onExport: X,
265
+ isHiding: D,
266
+ isDeleting: l,
267
+ confirmHiding: Y,
268
+ confirmDeleting: Z,
269
+ closeViewOnClickUpdate: Q,
270
+ recentUpdateOrDeleteId: F,
271
+ setRecentUpdateOrDeleteId: a,
269
272
  setOpenView: B
270
273
  }
271
274
  ),
272
- M == null ? void 0 : M(m)
275
+ V == null ? void 0 : V(m)
273
276
  ] }, m == null ? void 0 : m[n])
274
277
  }
275
278
  ),
276
- /* @__PURE__ */ e(zt, { fields: u, ...ht }),
277
- /* @__PURE__ */ E(_t, { children: [
278
- !!J && /* @__PURE__ */ e(jt, { onClick: J }),
279
- xt()
279
+ /* @__PURE__ */ e(vt, { fields: p, ...yt }),
280
+ /* @__PURE__ */ L($t, { children: [
281
+ !!K && /* @__PURE__ */ e(Et, { onClick: K }),
282
+ It()
280
283
  ] })
281
284
  ] });
282
285
  }
283
- const ft = ut.createContext({}), qt = ({ tooltip: n }) => {
284
- const { setActivatorNodeRef: C, listeners: u } = Vt(ft);
286
+ const it = ft.createContext({}), Gt = ({ tooltip: h }) => {
287
+ const { setActivatorNodeRef: n, listeners: C } = kt(it);
285
288
  return /* @__PURE__ */ e(
286
- dt,
289
+ jt,
287
290
  {
288
291
  type: "text",
289
292
  size: "small",
290
- tooltip: n,
291
- icon: /* @__PURE__ */ e(At, {}),
293
+ tooltip: h,
294
+ icon: /* @__PURE__ */ e(_t, {}),
292
295
  style: { cursor: "move", border: "none" },
293
- ref: C,
294
- ...u
296
+ ref: n,
297
+ ...C
295
298
  }
296
299
  );
297
- }, Gt = (n) => {
300
+ }, Jt = (h) => {
298
301
  const {
299
- attributes: C,
300
- listeners: u,
301
- setNodeRef: D,
302
+ attributes: n,
303
+ listeners: C,
304
+ setNodeRef: p,
302
305
  setActivatorNodeRef: l,
303
- transform: c,
304
- transition: f,
305
- isDragging: x
306
- } = Ot({ id: n["data-row-key"] }), N = {
307
- ...n.style,
308
- transform: Bt.Translate.toString(c),
309
- transition: f,
310
- ...x ? { position: "relative", zIndex: 9999 } : {}
311
- }, I = p(
312
- () => ({ setActivatorNodeRef: l, listeners: u }),
313
- [l, u]
306
+ transform: D,
307
+ transition: c,
308
+ isDragging: u
309
+ } = dt({ id: h["data-row-key"] }), I = {
310
+ ...h.style,
311
+ transform: Dt.Translate.toString(D),
312
+ transition: c,
313
+ ...u ? { position: "relative", zIndex: 9999 } : {}
314
+ }, N = x(
315
+ () => ({ setActivatorNodeRef: l, listeners: C }),
316
+ [l, C]
314
317
  );
315
- return /* @__PURE__ */ e(ft.Provider, { value: I, children: /* @__PURE__ */ e("tr", { ...n, ref: D, style: N, ...C }) });
318
+ return /* @__PURE__ */ e(it.Provider, { value: N, children: /* @__PURE__ */ e("tr", { ...h, ref: p, style: I, ...n }) });
316
319
  };
317
320
  export {
318
- co as default
321
+ so as default
319
322
  };
package/dist/index.cjs.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});;/* empty css */const t=require("./locale/hooks/translation-constants.cjs.js"),u=require("./locale/index.cjs.js"),C=require("./crud/CrudComponent.cjs.js"),r=require("./crud/CrudField.cjs.js"),n=require("./crud/CrudFormWizard.cjs.js"),i=require("./crud/CrudReportComponent.cjs.js"),l=require("./crud/CrudSearchComponent.cjs.js"),e=require("./crud/ImageCrudField.cjs.js"),o=require("./crud/FileCrudField.cjs.js"),a=require("./crud/CrudTextAreaComponent.cjs.js"),s=require("./crud/import/CrudImportComponent.cjs.js"),m=require("./crud/import/CrudImportButton.cjs.js"),p=require("./crud/actions/index.cjs.js"),c=require("./crud/view/CrudViewer.cjs.js"),F=require("./context/CrudComponentProvider.cjs.js"),d=require("./crud/CrudForm.cjs.js"),q=require("./crud/modal/index.cjs.js"),V=require("./crud/view/CrudDecListView.cjs.js"),I=require("./crud/view/CrudViewerUtil.cjs.js");exports.TRANSLATION_NAMESPACE=t.TRANSLATION_NAMESPACE;exports.setupI18n=u.setupI18n;exports.updateTranslations=u.updateTranslations;exports.CrudComponent=C;exports.ColorCrudFieldComponent=r.ColorCrudFieldComponent;exports.CrudField=r.default;exports.SelectCrudFieldComponent=r.SelectCrudFieldComponent;exports.CrudFormWizard=n;exports.CrudReportComponent=i;exports.CrudSearchComponent=l;exports.FileDownloadProvider=e.FileDownloadProvider;exports.FileUploadProvider=e.FileUploadProvider;exports.ImageCellValue=e.ImageCellValue;exports.ImageCrudCellValue=e.ImageCrudCellValue;exports.ImageCrudField=e.default;exports.FileCellValue=o.FileCellValue;exports.FileCrudCellValue=o.FileCrudCellValue;exports.FileCrudField=o.default;exports.CrudTextAreaComponent=a;exports.CrudImportComponent=s;exports.CrudImportButton=m;exports.CrudActions=p;exports.CrudViewer=c;exports.CrudComponentProvider=F.CrudComponentProvider;exports.CrudForm=d.CrudForm;exports.CrudFormFields=d.CrudFormFields;exports.CrudModal=q;exports.CrudDecListView=V.CrudDecListView;exports.getRendererValueCrudViewer=I.getRendererValueCrudViewer;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});;/* empty css */const i=require("./locale/hooks/translation-constants.cjs.js"),u=require("./locale/index.cjs.js"),C=require("./crud/CrudComponent.cjs.js"),r=require("./crud/CrudField.cjs.js"),t=require("./crud/CrudFormWizard.cjs.js"),n=require("./crud/CrudReportComponent.cjs.js"),l=require("./crud/CrudSearchComponent.cjs.js"),e=require("./crud/ImageCrudField.cjs.js"),o=require("./crud/FileCrudField.cjs.js"),a=require("./crud/FileCrudDragNDropField.cjs.js"),s=require("./crud/CrudTextAreaComponent.cjs.js"),m=require("./crud/import/CrudImportComponent.cjs.js"),F=require("./crud/import/CrudImportButton.cjs.js"),p=require("./crud/actions/index.cjs.js"),c=require("./crud/view/CrudViewer.cjs.js"),q=require("./context/CrudComponentProvider.cjs.js"),d=require("./crud/CrudForm.cjs.js"),V=require("./crud/modal/index.cjs.js"),I=require("./crud/view/CrudDecListView.cjs.js"),g=require("./crud/view/CrudViewerUtil.cjs.js");exports.TRANSLATION_NAMESPACE=i.TRANSLATION_NAMESPACE;exports.setupI18n=u.setupI18n;exports.updateTranslations=u.updateTranslations;exports.CrudComponent=C;exports.ColorCrudFieldComponent=r.ColorCrudFieldComponent;exports.CrudField=r.default;exports.SelectCrudFieldComponent=r.SelectCrudFieldComponent;exports.CrudFormWizard=t;exports.CrudReportComponent=n;exports.CrudSearchComponent=l;exports.FileDownloadProvider=e.FileDownloadProvider;exports.FileUploadProvider=e.FileUploadProvider;exports.ImageCellValue=e.ImageCellValue;exports.ImageCrudCellValue=e.ImageCrudCellValue;exports.ImageCrudField=e.default;exports.FileCellValue=o.FileCellValue;exports.FileCrudCellValue=o.FileCrudCellValue;exports.FileCrudField=o.default;exports.FileCrudDragNDropField=a;exports.CrudTextAreaComponent=s;exports.CrudImportComponent=m;exports.CrudImportButton=F;exports.CrudActions=p;exports.CrudViewer=c;exports.CrudComponentProvider=q.CrudComponentProvider;exports.CrudForm=d.CrudForm;exports.CrudFormFields=d.CrudFormFields;exports.CrudModal=V;exports.CrudDecListView=I.CrudDecListView;exports.getRendererValueCrudViewer=g.getRendererValueCrudViewer;
package/dist/index.es.js CHANGED
@@ -2,50 +2,52 @@
2
2
  import { TRANSLATION_NAMESPACE as t } from "./locale/hooks/translation-constants.es.js";
3
3
  import { setupI18n as a, updateTranslations as l } from "./locale/index.es.js";
4
4
  import { default as m } from "./crud/CrudComponent.es.js";
5
- import { ColorCrudFieldComponent as p, default as f, SelectCrudFieldComponent as n } from "./crud/CrudField.es.js";
5
+ import { ColorCrudFieldComponent as p, default as f, SelectCrudFieldComponent as i } from "./crud/CrudField.es.js";
6
6
  import { default as x } from "./crud/CrudFormWizard.es.js";
7
7
  import { default as F } from "./crud/CrudReportComponent.es.js";
8
8
  import { default as I } from "./crud/CrudSearchComponent.es.js";
9
- import { FileDownloadProvider as c, FileUploadProvider as g, ImageCellValue as w, ImageCrudCellValue as P, default as S } from "./crud/ImageCrudField.es.js";
10
- import { FileCellValue as v, FileCrudCellValue as N, default as R } from "./crud/FileCrudField.es.js";
11
- import { default as E } from "./crud/CrudTextAreaComponent.es.js";
12
- import { default as M } from "./crud/import/CrudImportComponent.es.js";
13
- import { default as z } from "./crud/import/CrudImportButton.es.js";
14
- import { default as O } from "./crud/actions/index.es.js";
15
- import { default as W } from "./crud/view/CrudViewer.es.js";
16
- import { CrudComponentProvider as b } from "./context/CrudComponentProvider.es.js";
17
- import { CrudForm as k, CrudFormFields as q } from "./crud/CrudForm.es.js";
18
- import { default as G } from "./crud/modal/index.es.js";
19
- import { CrudDecListView as J } from "./crud/view/CrudDecListView.es.js";
20
- import { getRendererValueCrudViewer as Q } from "./crud/view/CrudViewerUtil.es.js";
9
+ import { FileDownloadProvider as g, FileUploadProvider as c, ImageCellValue as w, ImageCrudCellValue as D, default as N } from "./crud/ImageCrudField.es.js";
10
+ import { FileCellValue as S, FileCrudCellValue as T, default as v } from "./crud/FileCrudField.es.js";
11
+ import { default as E } from "./crud/FileCrudDragNDropField.es.js";
12
+ import { default as M } from "./crud/CrudTextAreaComponent.es.js";
13
+ import { default as z } from "./crud/import/CrudImportComponent.es.js";
14
+ import { default as O } from "./crud/import/CrudImportButton.es.js";
15
+ import { default as W } from "./crud/actions/index.es.js";
16
+ import { default as b } from "./crud/view/CrudViewer.es.js";
17
+ import { CrudComponentProvider as k } from "./context/CrudComponentProvider.es.js";
18
+ import { CrudForm as y, CrudFormFields as G } from "./crud/CrudForm.es.js";
19
+ import { default as J } from "./crud/modal/index.es.js";
20
+ import { CrudDecListView as Q } from "./crud/view/CrudDecListView.es.js";
21
+ import { getRendererValueCrudViewer as Y } from "./crud/view/CrudViewerUtil.es.js";
21
22
  export {
22
23
  p as ColorCrudFieldComponent,
23
- O as CrudActions,
24
+ W as CrudActions,
24
25
  m as CrudComponent,
25
- b as CrudComponentProvider,
26
- J as CrudDecListView,
26
+ k as CrudComponentProvider,
27
+ Q as CrudDecListView,
27
28
  f as CrudField,
28
- k as CrudForm,
29
- q as CrudFormFields,
29
+ y as CrudForm,
30
+ G as CrudFormFields,
30
31
  x as CrudFormWizard,
31
- z as CrudImportButton,
32
- M as CrudImportComponent,
33
- G as CrudModal,
32
+ O as CrudImportButton,
33
+ z as CrudImportComponent,
34
+ J as CrudModal,
34
35
  F as CrudReportComponent,
35
36
  I as CrudSearchComponent,
36
- E as CrudTextAreaComponent,
37
- W as CrudViewer,
38
- v as FileCellValue,
39
- N as FileCrudCellValue,
40
- R as FileCrudField,
41
- c as FileDownloadProvider,
42
- g as FileUploadProvider,
37
+ M as CrudTextAreaComponent,
38
+ b as CrudViewer,
39
+ S as FileCellValue,
40
+ T as FileCrudCellValue,
41
+ E as FileCrudDragNDropField,
42
+ v as FileCrudField,
43
+ g as FileDownloadProvider,
44
+ c as FileUploadProvider,
43
45
  w as ImageCellValue,
44
- P as ImageCrudCellValue,
45
- S as ImageCrudField,
46
- n as SelectCrudFieldComponent,
46
+ D as ImageCrudCellValue,
47
+ N as ImageCrudField,
48
+ i as SelectCrudFieldComponent,
47
49
  t as TRANSLATION_NAMESPACE,
48
- Q as getRendererValueCrudViewer,
50
+ Y as getRendererValueCrudViewer,
49
51
  a as setupI18n,
50
52
  l as updateTranslations
51
53
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@kingteza/crud-component",
3
3
  "private": false,
4
- "version": "1.23.1",
4
+ "version": "1.25.0",
5
5
  "description": "React CRUD component library with Ant Design",
6
6
  "keywords": [
7
7
  "react",