@kingteza/crud-component 1.41.0 → 1.42.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.
- package/dist/crud/view/CrudEnumCell.cjs.js +1 -0
- package/dist/crud/view/CrudEnumCell.d.ts +6 -0
- package/dist/crud/view/CrudEnumCell.es.js +60 -0
- package/dist/crud/view/CrudViewerUtil.cjs.js +1 -1
- package/dist/crud/view/CrudViewerUtil.es.js +65 -131
- package/dist/crud/view/index.d.ts +2 -0
- package/dist/index.cjs.js +1 -1
- package/dist/index.es.js +9 -7
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),c=require("antd"),j=require("../../locale/index.cjs.js"),h=require("../../common/error/ErrorBoundaryComponent.cjs.js"),s=require("../../util/CopyUtilComponent.cjs.js");function x({field:r,value:p}){var b;if(!p)return"-";if(r.multiple){const t=(Array.isArray(p)?p:p?[p]:[]).map(o=>{var y,i;const n=(y=r.tagRender)==null?void 0:y[o],a=j.tWithOrWithoutNS(((i=r==null?void 0:r.translation)==null?void 0:i[o??""])??o,void 0,o);return{tagProps:n,translatedValue:a,item:o}});if(typeof r.tagRender=="object")return e.jsx(s.CopyToClipboardButtonWrapper,{copyable:r.copyable,value:()=>t.map(({translatedValue:o,item:n})=>o??n).join(", "),children:e.jsx(h.ErrorBoundaryComponent,{children:e.jsx(c.Space,{wrap:!0,children:t.map(({tagProps:o,translatedValue:n,item:a},y)=>o?e.jsx(c.Tag,{color:o.color,children:n},y+a):n)})})});if(r!=null&&r.translation)return e.jsx(s.CopyToClipboardButtonWrapper,{copyable:r.copyable,value:()=>t.map(({translatedValue:o,item:n})=>o??n).join(", "),children:e.jsx(h.ErrorBoundaryComponent,{children:t==null?void 0:t.map(({translatedValue:o,item:n})=>o??n).join(", ")})});{const o=t.map(({translatedValue:n,item:a})=>n??a).join(", ");return e.jsx(c.Typography.Text,{copyable:s.copyableFn(r.copyable,o),children:o})}}const l=((b=r==null?void 0:r.translation)==null?void 0:b[p??""])??p,u=j.tWithOrWithoutNS(l,void 0,p);if(typeof r.tagRender=="object"){const t=r.tagRender[p];if(t)return e.jsx(s.CopyToClipboardButtonWrapper,{copyable:r.copyable,value:u,children:e.jsx(c.Tag,{color:t.color,children:u})})}return e.jsx(c.Typography.Text,{copyable:s.copyableFn(r.copyable,u),children:u})}exports.CrudEnumCell=x;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { jsx as c } from "react/jsx-runtime";
|
|
2
|
+
import { Space as x, Tag as h, Typography as u } from "antd";
|
|
3
|
+
import { tWithOrWithoutNS as i } from "../../locale/index.es.js";
|
|
4
|
+
import { ErrorBoundaryComponent as g } from "../../common/error/ErrorBoundaryComponent.es.js";
|
|
5
|
+
import { CopyToClipboardButtonWrapper as m, copyableFn as j } from "../../util/CopyUtilComponent.es.js";
|
|
6
|
+
function B({ field: r, value: p }) {
|
|
7
|
+
var s;
|
|
8
|
+
if (!p) return "-";
|
|
9
|
+
if (r.multiple) {
|
|
10
|
+
const t = (Array.isArray(p) ? p : p ? [p] : []).map(
|
|
11
|
+
(o) => {
|
|
12
|
+
var y, b;
|
|
13
|
+
const n = (y = r.tagRender) == null ? void 0 : y[o], a = i(
|
|
14
|
+
((b = r == null ? void 0 : r.translation) == null ? void 0 : b[o ?? ""]) ?? o,
|
|
15
|
+
void 0,
|
|
16
|
+
o
|
|
17
|
+
);
|
|
18
|
+
return {
|
|
19
|
+
tagProps: n,
|
|
20
|
+
translatedValue: a,
|
|
21
|
+
item: o
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
);
|
|
25
|
+
if (typeof r.tagRender == "object")
|
|
26
|
+
return /* @__PURE__ */ c(
|
|
27
|
+
m,
|
|
28
|
+
{
|
|
29
|
+
copyable: r.copyable,
|
|
30
|
+
value: () => t.map(({ translatedValue: o, item: n }) => o ?? n).join(", "),
|
|
31
|
+
children: /* @__PURE__ */ c(g, { children: /* @__PURE__ */ c(x, { wrap: !0, children: t.map(({ tagProps: o, translatedValue: n, item: a }, y) => o ? /* @__PURE__ */ c(h, { color: o.color, children: n }, y + a) : n) }) })
|
|
32
|
+
}
|
|
33
|
+
);
|
|
34
|
+
if (r != null && r.translation)
|
|
35
|
+
return /* @__PURE__ */ c(
|
|
36
|
+
m,
|
|
37
|
+
{
|
|
38
|
+
copyable: r.copyable,
|
|
39
|
+
value: () => t.map(({ translatedValue: o, item: n }) => o ?? n).join(", "),
|
|
40
|
+
children: /* @__PURE__ */ c(g, { children: t == null ? void 0 : t.map(
|
|
41
|
+
({ translatedValue: o, item: n }) => o ?? n
|
|
42
|
+
).join(", ") })
|
|
43
|
+
}
|
|
44
|
+
);
|
|
45
|
+
{
|
|
46
|
+
const o = t.map(({ translatedValue: n, item: a }) => n ?? a).join(", ");
|
|
47
|
+
return /* @__PURE__ */ c(u.Text, { copyable: j(r.copyable, o), children: o });
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
const l = ((s = r == null ? void 0 : r.translation) == null ? void 0 : s[p ?? ""]) ?? p, e = i(l, void 0, p);
|
|
51
|
+
if (typeof r.tagRender == "object") {
|
|
52
|
+
const t = r.tagRender[p];
|
|
53
|
+
if (t)
|
|
54
|
+
return /* @__PURE__ */ c(m, { copyable: r.copyable, value: e, children: /* @__PURE__ */ c(h, { color: t.color, children: e }) });
|
|
55
|
+
}
|
|
56
|
+
return /* @__PURE__ */ c(u.Text, { copyable: j(r.copyable, e), children: e });
|
|
57
|
+
}
|
|
58
|
+
export {
|
|
59
|
+
B as CrudEnumCell
|
|
60
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),b=require("@ant-design/icons"),y=require("antd"),C=require("../FileCrudField.cjs.js"),h=require("../ImageCrudField.cjs.js"),f=require("../../util/DateUtil.cjs.js"),m=require("../../util/NumberUtil.cjs.js"),x=require("../../util/CrudUtil.cjs.js"),d=require("../../common/error/ErrorBoundaryComponent.cjs.js"),u=require("../../util/CopyUtilComponent.cjs.js"),j=require("../../util/ObjectUtil.cjs.js"),v=require("./CrudEnumCell.cjs.js");function g({type:c,render:e,...i}){try{return c==="object"?(o,n,l)=>r.jsx(u.CopyToClipboardButtonWrapper,{copyable:i.copyable,value:o,children:typeof e=="function"?e(o,n,l):""}):c==="select"?(o,n,l)=>{if(!o)return"-";const t=i,a=o||(t.items??[]).find(s=>s[t.innerFieldId??"key"]===j.getValueByPath(n,x.getRealName(i.name,"upsertFieldName"))),p=t.multiple?Array.isArray(a)?a.map(s=>s==null?void 0:s[t.innerFieldLabel??"name"]):void 0:a==null?void 0:a[t.innerFieldLabel??"value"];return r.jsx(y.Typography.Text,{copyable:u.copyableFn(t.copyable,p),children:typeof e=="function"?e(p,n,l):Array.isArray(p)?p.join(", "):p})}:c==="number"?(o,n,l)=>{const t=i;return r.jsx(y.Typography.Text,{copyable:u.copyableFn(t.copyable,o),children:typeof e=="function"?e(o,n,l):t.int?m.default.toInt(o,t.formatted):m.default.toMoney(o)})}:c==="enum"?(o,n,l)=>{const t=i;return typeof e=="function"?o?r.jsx(u.CopyToClipboardButtonWrapper,{copyable:t.copyable,value:o,children:e(o,n,l)}):"-":r.jsx(v.CrudEnumCell,{field:t,value:o})}:c==="date"?(o,n,l)=>{if(!o)return"-";const t=i,a=t.formatTime?f.formatDateTime(o):f.formatDate(o);return r.jsx(u.CopyToClipboardButtonWrapper,{copyable:t.copyable,value:a,children:r.jsx(d.ErrorBoundaryComponent,{children:typeof e=="function"?e(o,n,l):a})})}:c==="checkbox"?(o,n,l)=>typeof e=="function"?e(o,n,l):o?r.jsx(b.CheckOutlined,{}):r.jsx(b.CloseOutlined,{}):c==="image"?(o,n,l)=>o?r.jsx(d.ErrorBoundaryComponent,{children:typeof e=="function"?e(o,n,l):r.jsx(h.ImageCrudCellValue,{value:o,provider:i.provider})}):"-":c==="file"?(o,n,l)=>o?r.jsx(d.ErrorBoundaryComponent,{children:typeof e=="function"?e(o,n,l):r.jsx(C.FileCrudCellValue,{value:o,provider:i.provider})}):"":c==="time"?(o,n,l)=>{if(!o)return"-";const t=i,a=t.format,p=t.use12Hours,s=f.formatTime(o,a||(p?"hh:mm:ss A":void 0));return r.jsx(u.CopyToClipboardButtonWrapper,{copyable:t.copyable,value:s,children:r.jsx(d.ErrorBoundaryComponent,{children:typeof e=="function"?e(o,n,l):s})})}:c==="color"?(o,n,l)=>{const t=i;return o?r.jsx(u.CopyToClipboardButtonWrapper,{copyable:t.copyable,value:o,children:r.jsx(d.ErrorBoundaryComponent,{children:typeof e=="function"?e(o,n,l):typeof o=="string"&&o.startsWith("#")?r.jsx(y.Tooltip,{title:o,children:r.jsx(y.Avatar,{style:{backgroundColor:o}})}):String(o)})}):"-"}:c==="textarea"?(o,n,l)=>{if(!o)return"-";const t=i,a=t.truncated??1,p=typeof o=="string"&&o.split(" ").length<10;return typeof e=="function"?r.jsx(u.CopyToClipboardButtonWrapper,{copyable:t.copyable,value:o,children:e(o,n,l)}):a?r.jsx(d.ErrorBoundaryComponent,{children:r.jsx(y.Typography.Paragraph,{ellipsis:!p&&{rows:a===!0?1:a,expandable:"collapsible"},copyable:u.copyableFn(t.copyable,o),children:t.rich?r.jsx("div",{style:{all:"unset"},dangerouslySetInnerHTML:{__html:o}}):o})}):t.rich?r.jsx(u.CopyToClipboardButtonWrapper,{copyable:t.copyable,value:o,children:r.jsx("div",{style:{all:"unset"},dangerouslySetInnerHTML:{__html:o}})}):r.jsx(u.CopyToClipboardButtonWrapper,{copyable:t.copyable,value:o,children:o})}:typeof e=="function"?e:(o,n,l)=>{const t=i;return r.jsx(y.Typography.Text,{copyable:u.copyableFn(t.copyable,o),children:o})}}catch(o){return console.warn("An error occurred while rendering the value for field: "+String(i.name),o),"-"}}exports.getRendererValueCrudViewer=g;
|
|
@@ -1,171 +1,105 @@
|
|
|
1
1
|
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
-
import { CheckOutlined as
|
|
3
|
-
import { Typography as
|
|
4
|
-
import { FileCrudCellValue as
|
|
5
|
-
import { ImageCrudCellValue as
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
function
|
|
14
|
-
type:
|
|
15
|
-
render:
|
|
16
|
-
...
|
|
2
|
+
import { CheckOutlined as d, CloseOutlined as v } from "@ant-design/icons";
|
|
3
|
+
import { Typography as y, Tooltip as g, Avatar as C } from "antd";
|
|
4
|
+
import { FileCrudCellValue as T } from "../FileCrudField.es.js";
|
|
5
|
+
import { ImageCrudCellValue as x } from "../ImageCrudField.es.js";
|
|
6
|
+
import b from "../../util/DateUtil.es.js";
|
|
7
|
+
import h from "../../util/NumberUtil.es.js";
|
|
8
|
+
import A from "../../util/CrudUtil.es.js";
|
|
9
|
+
import { ErrorBoundaryComponent as p } from "../../common/error/ErrorBoundaryComponent.es.js";
|
|
10
|
+
import { CopyToClipboardButtonWrapper as m, copyableFn as s } from "../../util/CopyUtilComponent.es.js";
|
|
11
|
+
import { getValueByPath as F } from "../../util/ObjectUtil.es.js";
|
|
12
|
+
import { CrudEnumCell as S } from "./CrudEnumCell.es.js";
|
|
13
|
+
function M({
|
|
14
|
+
type: c,
|
|
15
|
+
render: l,
|
|
16
|
+
...a
|
|
17
17
|
}) {
|
|
18
18
|
try {
|
|
19
|
-
return
|
|
19
|
+
return c === "object" ? (t, n, i) => /* @__PURE__ */ r(
|
|
20
20
|
m,
|
|
21
21
|
{
|
|
22
|
-
copyable:
|
|
22
|
+
copyable: a.copyable,
|
|
23
23
|
value: t,
|
|
24
|
-
children: typeof
|
|
24
|
+
children: typeof l == "function" ? l(t, n, i) : ""
|
|
25
25
|
}
|
|
26
|
-
) :
|
|
26
|
+
) : c === "select" ? (t, n, i) => {
|
|
27
27
|
if (!t) return "-";
|
|
28
|
-
const o =
|
|
29
|
-
(f) => f[o.innerFieldId ?? "key"] ===
|
|
30
|
-
),
|
|
31
|
-
return /* @__PURE__ */ r(
|
|
32
|
-
} :
|
|
33
|
-
const o =
|
|
34
|
-
return /* @__PURE__ */ r(
|
|
35
|
-
} :
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
if (typeof e == "function")
|
|
40
|
-
return /* @__PURE__ */ r(
|
|
41
|
-
m,
|
|
42
|
-
{
|
|
43
|
-
copyable: o.copyable,
|
|
44
|
-
value: t,
|
|
45
|
-
children: e(t, l, n)
|
|
46
|
-
}
|
|
47
|
-
);
|
|
48
|
-
if (o.multiple) {
|
|
49
|
-
const s = (Array.isArray(t) ? t : t ? [t] : []).map((i) => {
|
|
50
|
-
var g, x;
|
|
51
|
-
const p = (g = o.tagRender) == null ? void 0 : g[i], v = A(
|
|
52
|
-
((x = o == null ? void 0 : o.translation) == null ? void 0 : x[i ?? ""]) ?? i,
|
|
53
|
-
void 0,
|
|
54
|
-
i
|
|
55
|
-
);
|
|
56
|
-
return {
|
|
57
|
-
tagProps: p,
|
|
58
|
-
translatedValue: v,
|
|
59
|
-
item: i
|
|
60
|
-
};
|
|
61
|
-
});
|
|
62
|
-
if (typeof o.tagRender == "object")
|
|
63
|
-
return /* @__PURE__ */ r(
|
|
64
|
-
m,
|
|
65
|
-
{
|
|
66
|
-
copyable: o.copyable,
|
|
67
|
-
value: () => s.map(
|
|
68
|
-
({ translatedValue: i, item: p }) => i ?? p
|
|
69
|
-
).join(", "),
|
|
70
|
-
children: /* @__PURE__ */ r(b, { children: /* @__PURE__ */ r(P, { wrap: !0, children: s.map(({ tagProps: i, translatedValue: p, item: v }, g) => i ? /* @__PURE__ */ r(C, { color: i.color, children: p }, g + v) : p) }) })
|
|
71
|
-
}
|
|
72
|
-
);
|
|
73
|
-
if (o != null && o.translation)
|
|
74
|
-
return /* @__PURE__ */ r(
|
|
75
|
-
m,
|
|
76
|
-
{
|
|
77
|
-
copyable: o.copyable,
|
|
78
|
-
value: () => s.map(
|
|
79
|
-
({ translatedValue: i, item: p }) => i ?? p
|
|
80
|
-
).join(", "),
|
|
81
|
-
children: /* @__PURE__ */ r(b, { children: s == null ? void 0 : s.map(
|
|
82
|
-
({ translatedValue: i, item: p }) => i ?? p
|
|
83
|
-
).join(", ") })
|
|
84
|
-
}
|
|
85
|
-
);
|
|
28
|
+
const o = a, e = t || (o.items ?? []).find(
|
|
29
|
+
(f) => f[o.innerFieldId ?? "key"] === F(n, A.getRealName(a.name, "upsertFieldName"))
|
|
30
|
+
), u = o.multiple ? Array.isArray(e) ? e.map((f) => f == null ? void 0 : f[o.innerFieldLabel ?? "name"]) : void 0 : e == null ? void 0 : e[o.innerFieldLabel ?? "value"];
|
|
31
|
+
return /* @__PURE__ */ r(y.Text, { copyable: s(o.copyable, u), children: typeof l == "function" ? l(u, n, i) : Array.isArray(u) ? u.join(", ") : u });
|
|
32
|
+
} : c === "number" ? (t, n, i) => {
|
|
33
|
+
const o = a;
|
|
34
|
+
return /* @__PURE__ */ r(y.Text, { copyable: s(o.copyable, t), children: typeof l == "function" ? l(t, n, i) : o.int ? h.toInt(t, o.formatted) : h.toMoney(t) });
|
|
35
|
+
} : c === "enum" ? (t, n, i) => {
|
|
36
|
+
const o = a;
|
|
37
|
+
return typeof l == "function" ? t ? /* @__PURE__ */ r(
|
|
38
|
+
m,
|
|
86
39
|
{
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
{
|
|
91
|
-
copyable: d(o.copyable, i),
|
|
92
|
-
children: i
|
|
93
|
-
}
|
|
94
|
-
);
|
|
40
|
+
copyable: o.copyable,
|
|
41
|
+
value: t,
|
|
42
|
+
children: l(t, n, i)
|
|
95
43
|
}
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
if (typeof o.tagRender == "object") {
|
|
99
|
-
const s = o.tagRender[t];
|
|
100
|
-
if (s)
|
|
101
|
-
return /* @__PURE__ */ r(
|
|
102
|
-
m,
|
|
103
|
-
{
|
|
104
|
-
copyable: o.copyable,
|
|
105
|
-
value: c,
|
|
106
|
-
children: /* @__PURE__ */ r(C, { color: s.color, children: c })
|
|
107
|
-
}
|
|
108
|
-
);
|
|
109
|
-
}
|
|
110
|
-
return /* @__PURE__ */ r(h.Text, { copyable: d(o.copyable, c), children: c });
|
|
111
|
-
} : y === "date" ? (t, l, n) => {
|
|
44
|
+
) : "-" : /* @__PURE__ */ r(S, { field: o, value: t });
|
|
45
|
+
} : c === "date" ? (t, n, i) => {
|
|
112
46
|
if (!t) return "-";
|
|
113
|
-
const o =
|
|
47
|
+
const o = a, e = o.formatTime ? b.formatDateTime(t) : b.formatDate(t);
|
|
114
48
|
return /* @__PURE__ */ r(
|
|
115
49
|
m,
|
|
116
50
|
{
|
|
117
51
|
copyable: o.copyable,
|
|
118
|
-
value:
|
|
119
|
-
children: /* @__PURE__ */ r(
|
|
52
|
+
value: e,
|
|
53
|
+
children: /* @__PURE__ */ r(p, { children: typeof l == "function" ? l(t, n, i) : e })
|
|
120
54
|
}
|
|
121
55
|
);
|
|
122
|
-
} :
|
|
123
|
-
|
|
56
|
+
} : c === "checkbox" ? (t, n, i) => typeof l == "function" ? l(t, n, i) : t ? /* @__PURE__ */ r(d, {}) : /* @__PURE__ */ r(v, {}) : c === "image" ? (t, n, i) => t ? /* @__PURE__ */ r(p, { children: typeof l == "function" ? l(t, n, i) : /* @__PURE__ */ r(
|
|
57
|
+
x,
|
|
124
58
|
{
|
|
125
59
|
value: t,
|
|
126
|
-
provider:
|
|
60
|
+
provider: a.provider
|
|
127
61
|
}
|
|
128
|
-
) }) : "-" :
|
|
129
|
-
|
|
62
|
+
) }) : "-" : c === "file" ? (t, n, i) => t ? /* @__PURE__ */ r(p, { children: typeof l == "function" ? l(t, n, i) : /* @__PURE__ */ r(
|
|
63
|
+
T,
|
|
130
64
|
{
|
|
131
65
|
value: t,
|
|
132
|
-
provider:
|
|
66
|
+
provider: a.provider
|
|
133
67
|
}
|
|
134
|
-
) }) : "" :
|
|
68
|
+
) }) : "" : c === "time" ? (t, n, i) => {
|
|
135
69
|
if (!t) return "-";
|
|
136
|
-
const o =
|
|
70
|
+
const o = a, e = o.format, u = o.use12Hours, f = b.formatTime(
|
|
137
71
|
t,
|
|
138
|
-
|
|
72
|
+
e || (u ? "hh:mm:ss A" : void 0)
|
|
139
73
|
);
|
|
140
74
|
return /* @__PURE__ */ r(
|
|
141
75
|
m,
|
|
142
76
|
{
|
|
143
77
|
copyable: o.copyable,
|
|
144
78
|
value: f,
|
|
145
|
-
children: /* @__PURE__ */ r(
|
|
79
|
+
children: /* @__PURE__ */ r(p, { children: typeof l == "function" ? l(t, n, i) : f })
|
|
146
80
|
}
|
|
147
81
|
);
|
|
148
|
-
} :
|
|
149
|
-
const o =
|
|
150
|
-
return t ? /* @__PURE__ */ r(m, { copyable: o.copyable, value: t, children: /* @__PURE__ */ r(
|
|
151
|
-
} :
|
|
82
|
+
} : c === "color" ? (t, n, i) => {
|
|
83
|
+
const o = a;
|
|
84
|
+
return t ? /* @__PURE__ */ r(m, { copyable: o.copyable, value: t, children: /* @__PURE__ */ r(p, { children: typeof l == "function" ? l(t, n, i) : typeof t == "string" && t.startsWith("#") ? /* @__PURE__ */ r(g, { title: t, children: /* @__PURE__ */ r(C, { style: { backgroundColor: t } }) }) : String(t) }) }) : "-";
|
|
85
|
+
} : c === "textarea" ? (t, n, i) => {
|
|
152
86
|
if (!t) return "-";
|
|
153
|
-
const o =
|
|
154
|
-
return typeof
|
|
87
|
+
const o = a, e = o.truncated ?? 1, u = typeof t == "string" && t.split(" ").length < 10;
|
|
88
|
+
return typeof l == "function" ? /* @__PURE__ */ r(
|
|
155
89
|
m,
|
|
156
90
|
{
|
|
157
91
|
copyable: o.copyable,
|
|
158
92
|
value: t,
|
|
159
|
-
children:
|
|
93
|
+
children: l(t, n, i)
|
|
160
94
|
}
|
|
161
|
-
) :
|
|
162
|
-
|
|
95
|
+
) : e ? /* @__PURE__ */ r(p, { children: /* @__PURE__ */ r(
|
|
96
|
+
y.Paragraph,
|
|
163
97
|
{
|
|
164
|
-
ellipsis: !
|
|
165
|
-
rows:
|
|
98
|
+
ellipsis: !u && {
|
|
99
|
+
rows: e === !0 ? 1 : e,
|
|
166
100
|
expandable: "collapsible"
|
|
167
101
|
},
|
|
168
|
-
copyable:
|
|
102
|
+
copyable: s(o.copyable, t),
|
|
169
103
|
children: o.rich ? /* @__PURE__ */ r(
|
|
170
104
|
"div",
|
|
171
105
|
{
|
|
@@ -195,17 +129,17 @@ function J({
|
|
|
195
129
|
children: t
|
|
196
130
|
}
|
|
197
131
|
);
|
|
198
|
-
} : typeof
|
|
199
|
-
const o =
|
|
200
|
-
return /* @__PURE__ */ r(
|
|
132
|
+
} : typeof l == "function" ? l : (t, n, i) => {
|
|
133
|
+
const o = a;
|
|
134
|
+
return /* @__PURE__ */ r(y.Text, { copyable: s(o.copyable, t), children: t });
|
|
201
135
|
};
|
|
202
136
|
} catch (t) {
|
|
203
137
|
return console.warn(
|
|
204
|
-
"An error occurred while rendering the value for field: " + String(
|
|
138
|
+
"An error occurred while rendering the value for field: " + String(a.name),
|
|
205
139
|
t
|
|
206
140
|
), "-";
|
|
207
141
|
}
|
|
208
142
|
}
|
|
209
143
|
export {
|
|
210
|
-
|
|
144
|
+
M as getRendererValueCrudViewer
|
|
211
145
|
};
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
export { CrudDecListView } from './CrudDecListView';
|
|
2
2
|
export type { CrudDecListViewProps, DescListColumn } from './CrudDecListView';
|
|
3
|
+
export { CrudEnumCell } from './CrudEnumCell';
|
|
4
|
+
export type { CrudEnumCellProps } from './CrudEnumCell';
|
|
3
5
|
export { default as CrudViewer } from './CrudViewer';
|
|
4
6
|
export type { CrudViewerProps } from './CrudViewer';
|
|
5
7
|
export { getRendererValueCrudViewer } from './CrudViewerUtil';
|
package/dist/index.cjs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});;/* empty css */const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});;/* empty css */const C=require("./locale/hooks/translation-constants.cjs.js"),u=require("./locale/index.cjs.js"),n=require("./crud/CrudComponent.cjs.js"),r=require("./crud/CrudField.cjs.js"),i=require("./crud/CrudFormWizard.cjs.js"),t=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"),m=require("./crud/CrudTextAreaComponent.cjs.js"),s=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/CrudEnumCell.cjs.js"),A=require("./crud/view/CrudViewerUtil.cjs.js");exports.TRANSLATION_NAMESPACE=C.TRANSLATION_NAMESPACE;exports.setupI18n=u.setupI18n;exports.updateTranslations=u.updateTranslations;exports.CrudComponent=n;exports.ColorCrudFieldComponent=r.ColorCrudFieldComponent;exports.CrudField=r.default;exports.SelectCrudFieldComponent=r.SelectCrudFieldComponent;exports.CrudFormWizard=i;exports.CrudReportComponent=t;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=m;exports.CrudImportComponent=s;exports.CrudImportButton=F;exports.CrudActions=p.default;exports.CrudViewer=c;exports.CrudComponentProvider=q.CrudComponentProvider;exports.CrudForm=d.CrudForm;exports.CrudFormFields=d.CrudFormFields;exports.CrudModal=V;exports.CrudDecListView=I.CrudDecListView;exports.CrudEnumCell=g.CrudEnumCell;exports.getRendererValueCrudViewer=A.getRendererValueCrudViewer;
|
package/dist/index.es.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/* empty css */
|
|
2
2
|
import { TRANSLATION_NAMESPACE as t } from "./locale/hooks/translation-constants.es.js";
|
|
3
|
-
import { setupI18n as
|
|
3
|
+
import { setupI18n as l, updateTranslations as u } from "./locale/index.es.js";
|
|
4
4
|
import { default as m } from "./crud/CrudComponent.es.js";
|
|
5
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";
|
|
@@ -8,7 +8,7 @@ import { default as F } from "./crud/CrudReportComponent.es.js";
|
|
|
8
8
|
import { default as I } from "./crud/CrudSearchComponent.es.js";
|
|
9
9
|
import { FileDownloadProvider as g, FileUploadProvider as c, ImageCellValue as w, ImageCrudCellValue as D, default as N } from "./crud/ImageCrudField.es.js";
|
|
10
10
|
import { FileCellValue as S, FileCrudCellValue as T, default as v } from "./crud/FileCrudField.es.js";
|
|
11
|
-
import { default as
|
|
11
|
+
import { default as R } from "./crud/FileCrudDragNDropField.es.js";
|
|
12
12
|
import { default as M } from "./crud/CrudTextAreaComponent.es.js";
|
|
13
13
|
import { default as z } from "./crud/import/CrudImportComponent.es.js";
|
|
14
14
|
import { default as O } from "./crud/import/CrudImportButton.es.js";
|
|
@@ -18,13 +18,15 @@ import { CrudComponentProvider as k } from "./context/CrudComponentProvider.es.j
|
|
|
18
18
|
import { CrudForm as y, CrudFormFields as G } from "./crud/CrudForm.es.js";
|
|
19
19
|
import { default as J } from "./crud/modal/index.es.js";
|
|
20
20
|
import { CrudDecListView as Q } from "./crud/view/CrudDecListView.es.js";
|
|
21
|
-
import {
|
|
21
|
+
import { CrudEnumCell as Y } from "./crud/view/CrudEnumCell.es.js";
|
|
22
|
+
import { getRendererValueCrudViewer as $ } from "./crud/view/CrudViewerUtil.es.js";
|
|
22
23
|
export {
|
|
23
24
|
p as ColorCrudFieldComponent,
|
|
24
25
|
W as CrudActions,
|
|
25
26
|
m as CrudComponent,
|
|
26
27
|
k as CrudComponentProvider,
|
|
27
28
|
Q as CrudDecListView,
|
|
29
|
+
Y as CrudEnumCell,
|
|
28
30
|
f as CrudField,
|
|
29
31
|
y as CrudForm,
|
|
30
32
|
G as CrudFormFields,
|
|
@@ -38,7 +40,7 @@ export {
|
|
|
38
40
|
b as CrudViewer,
|
|
39
41
|
S as FileCellValue,
|
|
40
42
|
T as FileCrudCellValue,
|
|
41
|
-
|
|
43
|
+
R as FileCrudDragNDropField,
|
|
42
44
|
v as FileCrudField,
|
|
43
45
|
g as FileDownloadProvider,
|
|
44
46
|
c as FileUploadProvider,
|
|
@@ -47,7 +49,7 @@ export {
|
|
|
47
49
|
N as ImageCrudField,
|
|
48
50
|
i as SelectCrudFieldComponent,
|
|
49
51
|
t as TRANSLATION_NAMESPACE,
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
52
|
+
$ as getRendererValueCrudViewer,
|
|
53
|
+
l as setupI18n,
|
|
54
|
+
u as updateTranslations
|
|
53
55
|
};
|