@kingteza/crud-component 1.0.6 → 1.0.9
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/_virtual/FileSaver.min.cjs +1 -0
- package/dist/_virtual/FileSaver.min.js +5 -0
- package/dist/_virtual/FileSaver.min2.cjs +1 -0
- package/dist/_virtual/FileSaver.min2.js +4 -0
- package/dist/_virtual/ShowMoreText.cjs +1 -0
- package/dist/_virtual/ShowMoreText.js +7 -0
- package/dist/_virtual/ShowMoreText2.cjs +1 -0
- package/dist/_virtual/ShowMoreText2.js +4 -0
- package/dist/_virtual/Truncate.cjs +1 -0
- package/dist/_virtual/Truncate.js +4 -0
- package/dist/_virtual/_commonjsHelpers.cjs +1 -1
- package/dist/_virtual/_commonjsHelpers.js +5 -3
- package/dist/_virtual/index.cjs +1 -1
- package/dist/_virtual/index.js +4 -4
- package/dist/_virtual/index10.cjs +1 -0
- package/dist/_virtual/index10.js +7 -0
- package/dist/_virtual/index11.cjs +1 -0
- package/dist/_virtual/index11.js +7 -0
- package/dist/_virtual/index12.cjs +1 -0
- package/dist/_virtual/index12.js +4 -0
- package/dist/_virtual/index13.cjs +1 -0
- package/dist/_virtual/index13.js +4 -0
- package/dist/_virtual/index2.cjs +1 -1
- package/dist/_virtual/index2.js +3 -5
- package/dist/_virtual/index3.cjs +1 -1
- package/dist/_virtual/index3.js +5 -2
- package/dist/_virtual/index4.cjs +1 -1
- package/dist/_virtual/index4.js +2 -2
- package/dist/_virtual/index5.js +2 -2
- package/dist/_virtual/index6.cjs +1 -0
- package/dist/_virtual/index6.js +4 -0
- package/dist/_virtual/index7.cjs +1 -0
- package/dist/_virtual/index7.js +4 -0
- package/dist/_virtual/index8.cjs +1 -0
- package/dist/_virtual/index8.js +2 -0
- package/dist/_virtual/index9.cjs +1 -0
- package/dist/_virtual/index9.js +7 -0
- package/dist/_virtual/main.cjs +1 -0
- package/dist/_virtual/main.js +7 -0
- package/dist/_virtual/main2.cjs +1 -0
- package/dist/_virtual/main2.js +4 -0
- package/dist/_virtual/papaparse.min.cjs +1 -0
- package/dist/_virtual/papaparse.min.js +7 -0
- package/dist/_virtual/papaparse.min2.cjs +1 -0
- package/dist/_virtual/papaparse.min2.js +4 -0
- package/dist/_virtual/react-is.development2.cjs +1 -0
- package/dist/_virtual/react-is.development2.js +4 -0
- package/dist/_virtual/react-is.production.min2.cjs +1 -0
- package/dist/_virtual/react-is.production.min2.js +4 -0
- package/dist/src/components/common/DatePicker/DatePicker.cjs +1 -1
- package/dist/src/components/common/DatePicker/DatePicker.js +23 -22
- package/dist/src/components/common/DatePicker/TimePicker.cjs +1 -1
- package/dist/src/components/common/DatePicker/TimePicker.js +14 -13
- package/dist/src/components/common/button/Button.cjs +1 -1
- package/dist/src/components/common/button/Button.js +32 -31
- package/dist/src/components/common/button/CloneButtonTable.cjs +1 -1
- package/dist/src/components/common/button/CloneButtonTable.js +7 -7
- package/dist/src/components/common/button/DeleteButtonTable.cjs +1 -1
- package/dist/src/components/common/button/DeleteButtonTable.js +22 -22
- package/dist/src/components/common/button/ExportButton.cjs +1 -1
- package/dist/src/components/common/button/ExportButton.js +13 -13
- package/dist/src/components/common/button/HideButtonTable.cjs +1 -1
- package/dist/src/components/common/button/HideButtonTable.js +20 -20
- package/dist/src/components/common/button/ImportButton.cjs +1 -1
- package/dist/src/components/common/button/ImportButton.js +25 -25
- package/dist/src/components/common/button/NewButton.cjs +1 -1
- package/dist/src/components/common/button/NewButton.js +15 -15
- package/dist/src/components/common/button/PrintButton.cjs +1 -1
- package/dist/src/components/common/button/PrintButton.js +14 -14
- package/dist/src/components/common/button/RefreshButton.cjs +1 -1
- package/dist/src/components/common/button/RefreshButton.js +12 -12
- package/dist/src/components/common/button/UnHideButton.cjs +1 -1
- package/dist/src/components/common/button/UnHideButton.js +31 -31
- package/dist/src/components/common/button/UpdateButtonTable.cjs +1 -1
- package/dist/src/components/common/button/UpdateButtonTable.js +9 -9
- package/dist/src/components/common/button/ViewButtonTable.cjs +1 -1
- package/dist/src/components/common/button/ViewButtonTable.js +11 -11
- package/dist/src/components/common/check-box/CheckBox.cjs +1 -1
- package/dist/src/components/common/check-box/CheckBox.js +17 -15
- package/dist/src/components/common/description/DescList.cjs +1 -1
- package/dist/src/components/common/description/DescList.js +1 -1
- package/dist/src/components/common/layout/VerticalSpace.cjs +1 -1
- package/dist/src/components/common/layout/VerticalSpace.js +1 -1
- package/dist/src/components/common/loading/LoadingIndicator.cjs +1 -1
- package/dist/src/components/common/loading/LoadingIndicator.js +11 -10
- package/dist/src/components/common/picker/ImagePicker.cjs +1 -1
- package/dist/src/components/common/picker/ImagePicker.js +95 -90
- package/dist/src/components/common/radio/RadioGroupComponent.cjs +1 -1
- package/dist/src/components/common/radio/RadioGroupComponent.js +17 -16
- package/dist/src/components/common/report/SelectFieldInReport.cjs +1 -1
- package/dist/src/components/common/report/SelectFieldInReport.js +17 -16
- package/dist/src/components/common/select/CustomSelectOption.cjs +1 -1
- package/dist/src/components/common/select/CustomSelectOption.js +1 -1
- package/dist/src/components/common/select/SelectComponent.cjs +1 -1
- package/dist/src/components/common/select/SelectComponent.js +36 -33
- package/dist/src/components/common/show-more/index.cjs +1 -1
- package/dist/src/components/common/show-more/index.js +1 -1
- package/dist/src/components/common/tab/TabViewWithRoute.cjs +1 -1
- package/dist/src/components/common/tab/TabViewWithRoute.js +10 -10
- package/dist/src/components/common/table/table.cjs +1 -1
- package/dist/src/components/common/table/table.js +16 -16
- package/dist/src/components/common/tag/StatusTag.cjs +1 -1
- package/dist/src/components/common/tag/StatusTag.js +4 -4
- package/dist/src/components/common/text/index.cjs +1 -1
- package/dist/src/components/common/text/index.js +1 -1
- package/dist/src/components/common/text/title/index.cjs +1 -1
- package/dist/src/components/common/text/title/index.js +1 -1
- package/dist/src/components/common/text-field/NumberField.cjs +1 -1
- package/dist/src/components/common/text-field/NumberField.js +20 -19
- package/dist/src/components/common/text-field/TextArea.cjs +1 -1
- package/dist/src/components/common/text-field/TextArea.js +19 -18
- package/dist/src/components/common/text-field/TextField.cjs +1 -1
- package/dist/src/components/common/text-field/TextField.js +37 -36
- package/dist/src/components/common/tooltip/TooltipComponent.cjs +1 -1
- package/dist/src/components/common/tooltip/TooltipComponent.js +1 -1
- package/dist/src/components/common/wizard/WizardResult.cjs +1 -1
- package/dist/src/components/common/wizard/WizardResult.js +37 -36
- package/dist/src/components/common/wizard/WizardViewForm.cjs +1 -1
- package/dist/src/components/common/wizard/WizardViewForm.js +1 -1
- package/dist/src/components/crud/CrudComponent.cjs +1 -1
- package/dist/src/components/crud/CrudComponent.js +74 -71
- package/dist/src/components/crud/CrudField.cjs +1 -1
- package/dist/src/components/crud/CrudField.js +111 -108
- package/dist/src/components/crud/CrudForm.cjs +1 -1
- package/dist/src/components/crud/CrudForm.js +36 -33
- package/dist/src/components/crud/CrudFormWizard.cjs +1 -1
- package/dist/src/components/crud/CrudFormWizard.js +78 -73
- package/dist/src/components/crud/CrudReportComponent.cjs +3 -3
- package/dist/src/components/crud/CrudReportComponent.js +75 -71
- package/dist/src/components/crud/CrudSearchComponent.cjs +1 -1
- package/dist/src/components/crud/CrudSearchComponent.js +17 -15
- package/dist/src/components/crud/FileCrudField.cjs +1 -1
- package/dist/src/components/crud/FileCrudField.js +103 -94
- package/dist/src/components/crud/ImageCrudField.cjs +1 -1
- package/dist/src/components/crud/ImageCrudField.js +58 -55
- package/dist/src/components/crud/import/CrudImportButton.cjs +1 -1
- package/dist/src/components/crud/import/CrudImportButton.js +10 -10
- package/dist/src/components/crud/import/CrudImportComponent.cjs +2 -2
- package/dist/src/components/crud/import/CrudImportComponent.js +111 -106
- package/dist/src/components/crud/view/CrudViewer.cjs +1 -1
- package/dist/src/components/crud/view/CrudViewer.js +30 -30
- package/dist/src/components/crud/view/CrudViewerUtil.cjs +1 -1
- package/dist/src/components/crud/view/CrudViewerUtil.js +35 -33
- package/dist/src/util/ImageUtil.cjs +1 -1
- package/dist/src/util/ImageUtil.js +1 -1
- package/package.json +7 -9
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import { j as r } from "../../../../_virtual/jsx-runtime.js";
|
|
2
|
-
import
|
|
3
|
-
import H from "../../common/button/
|
|
4
|
-
import U from "../../common/button/
|
|
5
|
-
import
|
|
6
|
-
import rr from "../../common/button/
|
|
7
|
-
import
|
|
8
|
-
import tr from "../../common/button/
|
|
9
|
-
import sr from "../../common/
|
|
10
|
-
import mr from "../../common/
|
|
11
|
-
import ur from "
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import
|
|
15
|
-
import lr from "
|
|
16
|
-
import { CrudDecListView as jr } from "./CrudDecListView.js";
|
|
2
|
+
import k from "../../common/button/CloneButtonTable.js";
|
|
3
|
+
import H from "../../common/button/DeleteButtonTable.js";
|
|
4
|
+
import { ExportButton as U } from "../../common/button/ExportButton.js";
|
|
5
|
+
import F from "../../common/button/HideButtonTable.js";
|
|
6
|
+
import { RefreshButton as rr } from "../../common/button/RefreshButton.js";
|
|
7
|
+
import or from "../../common/button/UpdateButtonTable.js";
|
|
8
|
+
import tr from "../../common/button/ViewButtonTable.js";
|
|
9
|
+
import sr from "../../common/layout/VerticalSpace.js";
|
|
10
|
+
import mr from "../../common/table/table.js";
|
|
11
|
+
import { useMemo as L, useState as _, useEffect as ur, useCallback as nr } from "react";
|
|
12
|
+
import { useTranslation as er } from "react-i18next";
|
|
13
|
+
import { TRANSLATION_NAMESPACE as fr } from "../../../locale/hooks/translation-constants.js";
|
|
14
|
+
import cr from "../CrudSearchComponent.js";
|
|
15
|
+
import { CrudDecListView as lr } from "./CrudDecListView.js";
|
|
17
16
|
import { getRendererValueCrudViewer as V } from "./CrudViewerUtil.js";
|
|
17
|
+
import jr from "../../../../node_modules/antd/es/modal/index.js";
|
|
18
18
|
function Or({
|
|
19
19
|
idField: s = "id",
|
|
20
20
|
loadingData: $,
|
|
@@ -49,7 +49,7 @@ function Or({
|
|
|
49
49
|
actionWidth: Y = 190,
|
|
50
50
|
...Z
|
|
51
51
|
}) {
|
|
52
|
-
const { t: d } = fr
|
|
52
|
+
const { t: d } = er(fr), N = L(
|
|
53
53
|
() => f.map(
|
|
54
54
|
({ hideInTable: o, hidden: t, width: c, name: u, label: w, halign: D, ...z }) => ({
|
|
55
55
|
title: w,
|
|
@@ -63,20 +63,20 @@ function Or({
|
|
|
63
63
|
),
|
|
64
64
|
[f]
|
|
65
65
|
), [m, x] = _(), [b, g] = _();
|
|
66
|
-
|
|
66
|
+
ur(() => {
|
|
67
67
|
v && x((o) => {
|
|
68
68
|
if (o)
|
|
69
69
|
return v.find((t) => t[s] === o[s]);
|
|
70
70
|
});
|
|
71
71
|
}, [v, s, m]);
|
|
72
|
-
const O =
|
|
72
|
+
const O = nr(
|
|
73
73
|
(o) => {
|
|
74
74
|
var c;
|
|
75
75
|
const t = a == null ? void 0 : a(o);
|
|
76
76
|
return (Array.isArray(t) ? (c = t == null ? void 0 : t.filter(Boolean)) != null && c.length : t) || h || e || T || j ? /* @__PURE__ */ r.jsxs(r.Fragment, { children: [
|
|
77
77
|
t,
|
|
78
78
|
(h || e) && /* @__PURE__ */ r.jsx(
|
|
79
|
-
|
|
79
|
+
or,
|
|
80
80
|
{
|
|
81
81
|
value: o,
|
|
82
82
|
onClick: (u) => {
|
|
@@ -84,16 +84,16 @@ function Or({
|
|
|
84
84
|
}
|
|
85
85
|
}
|
|
86
86
|
),
|
|
87
|
-
T && /* @__PURE__ */ r.jsx(
|
|
87
|
+
T && /* @__PURE__ */ r.jsx(k, { value: o, onClick: (u) => T(u) }),
|
|
88
88
|
S && /* @__PURE__ */ r.jsx(
|
|
89
|
-
|
|
89
|
+
U,
|
|
90
90
|
{
|
|
91
91
|
value: o,
|
|
92
92
|
onClick: async (u) => await S(u)
|
|
93
93
|
}
|
|
94
94
|
),
|
|
95
95
|
p && /* @__PURE__ */ r.jsx(
|
|
96
|
-
|
|
96
|
+
F,
|
|
97
97
|
{
|
|
98
98
|
value: o,
|
|
99
99
|
disabled: B,
|
|
@@ -105,7 +105,7 @@ function Or({
|
|
|
105
105
|
}
|
|
106
106
|
),
|
|
107
107
|
j && /* @__PURE__ */ r.jsx(
|
|
108
|
-
|
|
108
|
+
H,
|
|
109
109
|
{
|
|
110
110
|
value: o,
|
|
111
111
|
disabled: y,
|
|
@@ -148,7 +148,7 @@ function Or({
|
|
|
148
148
|
}, [n, m, f]);
|
|
149
149
|
return /* @__PURE__ */ r.jsxs("div", { children: [
|
|
150
150
|
n && /* @__PURE__ */ r.jsx(
|
|
151
|
-
|
|
151
|
+
jr,
|
|
152
152
|
{
|
|
153
153
|
width: "100%",
|
|
154
154
|
open: !!m,
|
|
@@ -158,7 +158,7 @@ function Or({
|
|
|
158
158
|
onCancel: () => x(void 0),
|
|
159
159
|
children: !!m && /* @__PURE__ */ r.jsxs("div", { children: [
|
|
160
160
|
/* @__PURE__ */ r.jsx(
|
|
161
|
-
|
|
161
|
+
lr,
|
|
162
162
|
{
|
|
163
163
|
layout: W,
|
|
164
164
|
descListColumn: Q,
|
|
@@ -171,11 +171,11 @@ function Or({
|
|
|
171
171
|
] }, m == null ? void 0 : m[s])
|
|
172
172
|
}
|
|
173
173
|
),
|
|
174
|
-
/* @__PURE__ */ r.jsx(
|
|
175
|
-
/* @__PURE__ */ r.jsxs(
|
|
176
|
-
!!C && /* @__PURE__ */ r.jsx(
|
|
174
|
+
/* @__PURE__ */ r.jsx(cr, { fields: f, ...Z }),
|
|
175
|
+
/* @__PURE__ */ r.jsxs(sr, { children: [
|
|
176
|
+
!!C && /* @__PURE__ */ r.jsx(rr, { onClick: C }),
|
|
177
177
|
/* @__PURE__ */ r.jsx(
|
|
178
|
-
|
|
178
|
+
mr,
|
|
179
179
|
{
|
|
180
180
|
rowClassName: X,
|
|
181
181
|
className: A,
|
|
@@ -202,7 +202,7 @@ function Or({
|
|
|
202
202
|
fixed: "right",
|
|
203
203
|
width: Y,
|
|
204
204
|
render: (o, t) => /* @__PURE__ */ r.jsxs(r.Fragment, { children: [
|
|
205
|
-
n && /* @__PURE__ */ r.jsx(
|
|
205
|
+
n && /* @__PURE__ */ r.jsx(tr, { value: t, onClick: x }),
|
|
206
206
|
O(t)
|
|
207
207
|
] })
|
|
208
208
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("../../../../_virtual/jsx-runtime.cjs"),s=require("../../common/show-more/index.cjs"),x=require("../FileCrudField.cjs"),d=require("../ImageCrudField.cjs"),j=require("../../../locale/hooks/translation-constants.cjs"),v=require("i18next"),r=require("../../../util/DateUtil.cjs"),m=require("../../../util/NumberUtil.cjs"),y=require("../../../../node_modules/@ant-design/icons/es/icons/CheckOutlined.cjs"),C=require("../../../../node_modules/@ant-design/icons/es/icons/CloseOutlined.cjs"),g=require("../../../../node_modules/antd/es/tooltip/index.cjs"),q=require("../../../../node_modules/antd/es/avatar/index.cjs");function R({type:a,render:i,...u}){return a==="object"?(t,n,e)=>typeof i=="function"?i(t,n,e):"":a==="select"?(t,n,e)=>{const o=u;let l=o.multiple?Array.isArray(t)?t.map(c=>c==null?void 0:c[o.innerFieldLabel??"name"]):void 0:t==null?void 0:t[o.innerFieldLabel??"name"];return(!l&&typeof t=="string"||typeof t=="number")&&(l=t),typeof i=="function"?i(l,n,e):Array.isArray(l)?l.join(", "):l}:a==="number"?(t,n,e)=>typeof i=="function"?i(t,n,e):u!=null&&u.int?m.default.toInt(t,u.formatted):m.default.toMoney(t):a==="enum"?(t,n,e)=>{var l;const o=v.t(((l=u==null?void 0:u.translation)==null?void 0:l[t??""])??t,{ns:j.TRANSLATION_NAMESPACE});return typeof i=="function"?i(t,n,e):o}:a==="date"?(t,n,e)=>{if(!t)return"-";const o=u!=null&&u.formatTime?r.default.formatDateTime(t):r.default.formatDate(t);return typeof i=="function"?i(t,n,e):o}:a==="checkbox"?(t,n,e)=>typeof i=="function"?i(t,n,e):t?f.jsxRuntimeExports.jsx(y.default,{}):f.jsxRuntimeExports.jsx(C.default,{}):a==="image"?(t,n,e)=>typeof i=="function"?i(t,n,e):f.jsxRuntimeExports.jsx(d.ImageCrudCellValue,{value:t,provider:u.provider}):a==="file"?(t,n,e)=>typeof i=="function"?i(t,n,e):f.jsxRuntimeExports.jsx(x.FileCrudCellValue,{value:t,provider:u.provider}):a==="time"?(t,n,e)=>{if(!t)return"-";const o=u==null?void 0:u.format,l=u==null?void 0:u.use12Hours,c=r.default.formatTime(t,o||(l?"hh:mm:ss A":void 0));return typeof i=="function"?i(t,n,e):c}:a==="color"?(t,n,e)=>typeof i=="function"?i(t,n,e):typeof t=="string"&&t.startsWith("#")?f.jsxRuntimeExports.jsx(g.default,{title:t,children:f.jsxRuntimeExports.jsx(q.default,{style:{backgroundColor:t}})}):String(t):a==="textarea"?(t,n,e)=>{const o=(u==null?void 0:u.truncated)??1;return typeof i=="function"?i(t,n,e):o?f.jsxRuntimeExports.jsx(s.ShowMore,{lines:o===!0?1:o,children:t}):t}:typeof i=="function"?i:t=>t}exports.getRendererValueCrudViewer=R;
|
|
@@ -1,57 +1,59 @@
|
|
|
1
|
-
import { j as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { TRANSLATION_NAMESPACE as g } from "../../../locale/hooks/translation-constants.js";
|
|
8
|
-
import { t as h } from "i18next";
|
|
1
|
+
import { j as c } from "../../../../_virtual/jsx-runtime.js";
|
|
2
|
+
import { ShowMore as x } from "../../common/show-more/index.js";
|
|
3
|
+
import { FileCrudCellValue as j } from "../FileCrudField.js";
|
|
4
|
+
import { ImageCrudCellValue as y } from "../ImageCrudField.js";
|
|
5
|
+
import { TRANSLATION_NAMESPACE as A } from "../../../locale/hooks/translation-constants.js";
|
|
6
|
+
import { t as b } from "i18next";
|
|
9
7
|
import r from "../../../util/DateUtil.js";
|
|
10
8
|
import v from "../../../util/NumberUtil.js";
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
import e from "../../../../node_modules/@ant-design/icons/es/icons/CheckOutlined.js";
|
|
10
|
+
import g from "../../../../node_modules/@ant-design/icons/es/icons/CloseOutlined.js";
|
|
11
|
+
import h from "../../../../node_modules/antd/es/tooltip/index.js";
|
|
12
|
+
import C from "../../../../node_modules/antd/es/avatar/index.js";
|
|
13
|
+
function k({
|
|
14
|
+
type: u,
|
|
13
15
|
render: i,
|
|
14
16
|
...o
|
|
15
17
|
}) {
|
|
16
|
-
return
|
|
17
|
-
const
|
|
18
|
-
let a =
|
|
19
|
-
return (!a && typeof t == "string" || typeof t == "number") && (a = t), typeof i == "function" ? i(a,
|
|
20
|
-
} :
|
|
18
|
+
return u === "object" ? (t, f, n) => typeof i == "function" ? i(t, f, n) : "" : u === "select" ? (t, f, n) => {
|
|
19
|
+
const m = o;
|
|
20
|
+
let a = m.multiple ? Array.isArray(t) ? t.map((l) => l == null ? void 0 : l[m.innerFieldLabel ?? "name"]) : void 0 : t == null ? void 0 : t[m.innerFieldLabel ?? "name"];
|
|
21
|
+
return (!a && typeof t == "string" || typeof t == "number") && (a = t), typeof i == "function" ? i(a, f, n) : Array.isArray(a) ? a.join(", ") : a;
|
|
22
|
+
} : u === "number" ? (t, f, n) => typeof i == "function" ? i(t, f, n) : o != null && o.int ? v.toInt(t, o.formatted) : v.toMoney(t) : u === "enum" ? (t, f, n) => {
|
|
21
23
|
var a;
|
|
22
|
-
const
|
|
24
|
+
const m = b(
|
|
23
25
|
((a = o == null ? void 0 : o.translation) == null ? void 0 : a[t ?? ""]) ?? t,
|
|
24
|
-
{ ns:
|
|
26
|
+
{ ns: A }
|
|
25
27
|
);
|
|
26
|
-
return typeof i == "function" ? i(t,
|
|
27
|
-
} :
|
|
28
|
+
return typeof i == "function" ? i(t, f, n) : m;
|
|
29
|
+
} : u === "date" ? (t, f, n) => {
|
|
28
30
|
if (!t) return "-";
|
|
29
|
-
const
|
|
30
|
-
return typeof i == "function" ? i(t,
|
|
31
|
-
} :
|
|
32
|
-
|
|
31
|
+
const m = o != null && o.formatTime ? r.formatDateTime(t) : r.formatDate(t);
|
|
32
|
+
return typeof i == "function" ? i(t, f, n) : m;
|
|
33
|
+
} : u === "checkbox" ? (t, f, n) => typeof i == "function" ? i(t, f, n) : t ? /* @__PURE__ */ c.jsx(e, {}) : /* @__PURE__ */ c.jsx(g, {}) : u === "image" ? (t, f, n) => typeof i == "function" ? i(t, f, n) : /* @__PURE__ */ c.jsx(
|
|
34
|
+
y,
|
|
33
35
|
{
|
|
34
36
|
value: t,
|
|
35
37
|
provider: o.provider
|
|
36
38
|
}
|
|
37
|
-
) :
|
|
38
|
-
|
|
39
|
+
) : u === "file" ? (t, f, n) => typeof i == "function" ? i(t, f, n) : /* @__PURE__ */ c.jsx(
|
|
40
|
+
j,
|
|
39
41
|
{
|
|
40
42
|
value: t,
|
|
41
43
|
provider: o.provider
|
|
42
44
|
}
|
|
43
|
-
) :
|
|
45
|
+
) : u === "time" ? (t, f, n) => {
|
|
44
46
|
if (!t) return "-";
|
|
45
|
-
const
|
|
47
|
+
const m = o == null ? void 0 : o.format, a = o == null ? void 0 : o.use12Hours, l = r.formatTime(
|
|
46
48
|
t,
|
|
47
|
-
|
|
49
|
+
m || (a ? "hh:mm:ss A" : void 0)
|
|
48
50
|
);
|
|
49
|
-
return typeof i == "function" ? i(t,
|
|
50
|
-
} :
|
|
51
|
-
const
|
|
52
|
-
return typeof i == "function" ? i(t,
|
|
51
|
+
return typeof i == "function" ? i(t, f, n) : l;
|
|
52
|
+
} : u === "color" ? (t, f, n) => typeof i == "function" ? i(t, f, n) : typeof t == "string" && t.startsWith("#") ? /* @__PURE__ */ c.jsx(h, { title: t, children: /* @__PURE__ */ c.jsx(C, { style: { backgroundColor: t } }) }) : String(t) : u === "textarea" ? (t, f, n) => {
|
|
53
|
+
const m = (o == null ? void 0 : o.truncated) ?? 1;
|
|
54
|
+
return typeof i == "function" ? i(t, f, n) : m ? /* @__PURE__ */ c.jsx(x, { lines: m === !0 ? 1 : m, children: t }) : t;
|
|
53
55
|
} : typeof i == "function" ? i : (t) => t;
|
|
54
56
|
}
|
|
55
57
|
export {
|
|
56
|
-
|
|
58
|
+
k as getRendererValueCrudViewer
|
|
57
59
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const c=require("browser-image-compression");class d{async resizeImage(t){const e=await c(t,{maxSizeMB:1,maxWidthOrHeight:1920,useWebWorker:!0}),a=t.uid;return Object.assign(e,{uid:a,lastModifiedDate:new Date})}async getImageData(t){const e=await this.getImageData0(t);if(e){const a=new Image;a.src=e.data;const o=await new Promise(n=>{a.onload=function(){n({height:a.height,width:a.width})}});return Object.assign(e,o),e}else return null}async getImageData0(t){try{if(t.startsWith("data:image/")){const e=t.match(/^data:image\/(png|jpeg|jpg);base64,(.*)$/);if(!e)throw new Error("Invalid base64 image data");return{data:t,type:e[1]}}else{const e=await fetch(t);if(!e.ok)throw new Error("Network response was not ok");const a=await e.blob();return new Promise((o,n)=>{const s=new FileReader;s.onloadend=function(){const r=s.result,i=r.match(/^data:image\/(png|jpeg|jpg);base64,/);i?o({data:r,type:i[1]}):n(new Error("Could not determine image type"))},s.onerror=n,s.readAsDataURL(a)})}}catch(e){return console.warn(e),null}}}const g=new d;exports.default=g;
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const c=require("../../node_modules/browser-image-compression/dist/browser-image-compression.cjs");class d{async resizeImage(t){const e=await c.default(t,{maxSizeMB:1,maxWidthOrHeight:1920,useWebWorker:!0}),a=t.uid;return Object.assign(e,{uid:a,lastModifiedDate:new Date})}async getImageData(t){const e=await this.getImageData0(t);if(e){const a=new Image;a.src=e.data;const o=await new Promise(n=>{a.onload=function(){n({height:a.height,width:a.width})}});return Object.assign(e,o),e}else return null}async getImageData0(t){try{if(t.startsWith("data:image/")){const e=t.match(/^data:image\/(png|jpeg|jpg);base64,(.*)$/);if(!e)throw new Error("Invalid base64 image data");return{data:t,type:e[1]}}else{const e=await fetch(t);if(!e.ok)throw new Error("Network response was not ok");const a=await e.blob();return new Promise((o,n)=>{const s=new FileReader;s.onloadend=function(){const r=s.result,i=r.match(/^data:image\/(png|jpeg|jpg);base64,/);i?o({data:r,type:i[1]}):n(new Error("Could not determine image type"))},s.onerror=n,s.readAsDataURL(a)})}}catch(e){return console.warn(e),null}}}const g=new d;exports.default=g;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kingteza/crud-component",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.9",
|
|
5
5
|
"description": "React CRUD component library with Ant Design",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"react",
|
|
@@ -59,9 +59,7 @@
|
|
|
59
59
|
"mime": "^4.0.6",
|
|
60
60
|
"papaparse": "^5.4.1",
|
|
61
61
|
"path-browserify": "^1.0.1",
|
|
62
|
-
"react": "^18.3.1",
|
|
63
62
|
"react-cropper": "^2.3.3",
|
|
64
|
-
"react-dom": "^18.3.1",
|
|
65
63
|
"react-highlight-words": "^0.20.0",
|
|
66
64
|
"react-responsive": "^10.0.0",
|
|
67
65
|
"react-router": "^7.1.1",
|
|
@@ -69,6 +67,12 @@
|
|
|
69
67
|
"react-show-more-text": "^1.7.1",
|
|
70
68
|
"uuid": "^11.0.3"
|
|
71
69
|
},
|
|
70
|
+
"peerDependencies": {
|
|
71
|
+
"i18next": ">=21.0.0",
|
|
72
|
+
"react": ">=16.8.0",
|
|
73
|
+
"react-dom": ">=16.8.0",
|
|
74
|
+
"react-i18next": ">=11.0.0"
|
|
75
|
+
},
|
|
72
76
|
"devDependencies": {
|
|
73
77
|
"@eslint/js": "^9.17.0",
|
|
74
78
|
"@types/file-saver": "^2.0.7",
|
|
@@ -93,11 +97,5 @@
|
|
|
93
97
|
"vite": "^6.0.5",
|
|
94
98
|
"vite-plugin-dts": "^4.4.0",
|
|
95
99
|
"vite-tsconfig-paths": "^5.1.4"
|
|
96
|
-
},
|
|
97
|
-
"peerDependencies": {
|
|
98
|
-
"i18next": ">=21.0.0",
|
|
99
|
-
"react": ">=16.8.0",
|
|
100
|
-
"react-dom": ">=16.8.0",
|
|
101
|
-
"react-i18next": ">=11.0.0"
|
|
102
100
|
}
|
|
103
101
|
}
|