@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.
Files changed (146) hide show
  1. package/dist/_virtual/FileSaver.min.cjs +1 -0
  2. package/dist/_virtual/FileSaver.min.js +5 -0
  3. package/dist/_virtual/FileSaver.min2.cjs +1 -0
  4. package/dist/_virtual/FileSaver.min2.js +4 -0
  5. package/dist/_virtual/ShowMoreText.cjs +1 -0
  6. package/dist/_virtual/ShowMoreText.js +7 -0
  7. package/dist/_virtual/ShowMoreText2.cjs +1 -0
  8. package/dist/_virtual/ShowMoreText2.js +4 -0
  9. package/dist/_virtual/Truncate.cjs +1 -0
  10. package/dist/_virtual/Truncate.js +4 -0
  11. package/dist/_virtual/_commonjsHelpers.cjs +1 -1
  12. package/dist/_virtual/_commonjsHelpers.js +5 -3
  13. package/dist/_virtual/index.cjs +1 -1
  14. package/dist/_virtual/index.js +4 -4
  15. package/dist/_virtual/index10.cjs +1 -0
  16. package/dist/_virtual/index10.js +7 -0
  17. package/dist/_virtual/index11.cjs +1 -0
  18. package/dist/_virtual/index11.js +7 -0
  19. package/dist/_virtual/index12.cjs +1 -0
  20. package/dist/_virtual/index12.js +4 -0
  21. package/dist/_virtual/index13.cjs +1 -0
  22. package/dist/_virtual/index13.js +4 -0
  23. package/dist/_virtual/index2.cjs +1 -1
  24. package/dist/_virtual/index2.js +3 -5
  25. package/dist/_virtual/index3.cjs +1 -1
  26. package/dist/_virtual/index3.js +5 -2
  27. package/dist/_virtual/index4.cjs +1 -1
  28. package/dist/_virtual/index4.js +2 -2
  29. package/dist/_virtual/index5.js +2 -2
  30. package/dist/_virtual/index6.cjs +1 -0
  31. package/dist/_virtual/index6.js +4 -0
  32. package/dist/_virtual/index7.cjs +1 -0
  33. package/dist/_virtual/index7.js +4 -0
  34. package/dist/_virtual/index8.cjs +1 -0
  35. package/dist/_virtual/index8.js +2 -0
  36. package/dist/_virtual/index9.cjs +1 -0
  37. package/dist/_virtual/index9.js +7 -0
  38. package/dist/_virtual/main.cjs +1 -0
  39. package/dist/_virtual/main.js +7 -0
  40. package/dist/_virtual/main2.cjs +1 -0
  41. package/dist/_virtual/main2.js +4 -0
  42. package/dist/_virtual/papaparse.min.cjs +1 -0
  43. package/dist/_virtual/papaparse.min.js +7 -0
  44. package/dist/_virtual/papaparse.min2.cjs +1 -0
  45. package/dist/_virtual/papaparse.min2.js +4 -0
  46. package/dist/_virtual/react-is.development2.cjs +1 -0
  47. package/dist/_virtual/react-is.development2.js +4 -0
  48. package/dist/_virtual/react-is.production.min2.cjs +1 -0
  49. package/dist/_virtual/react-is.production.min2.js +4 -0
  50. package/dist/src/components/common/DatePicker/DatePicker.cjs +1 -1
  51. package/dist/src/components/common/DatePicker/DatePicker.js +23 -22
  52. package/dist/src/components/common/DatePicker/TimePicker.cjs +1 -1
  53. package/dist/src/components/common/DatePicker/TimePicker.js +14 -13
  54. package/dist/src/components/common/button/Button.cjs +1 -1
  55. package/dist/src/components/common/button/Button.js +32 -31
  56. package/dist/src/components/common/button/CloneButtonTable.cjs +1 -1
  57. package/dist/src/components/common/button/CloneButtonTable.js +7 -7
  58. package/dist/src/components/common/button/DeleteButtonTable.cjs +1 -1
  59. package/dist/src/components/common/button/DeleteButtonTable.js +22 -22
  60. package/dist/src/components/common/button/ExportButton.cjs +1 -1
  61. package/dist/src/components/common/button/ExportButton.js +13 -13
  62. package/dist/src/components/common/button/HideButtonTable.cjs +1 -1
  63. package/dist/src/components/common/button/HideButtonTable.js +20 -20
  64. package/dist/src/components/common/button/ImportButton.cjs +1 -1
  65. package/dist/src/components/common/button/ImportButton.js +25 -25
  66. package/dist/src/components/common/button/NewButton.cjs +1 -1
  67. package/dist/src/components/common/button/NewButton.js +15 -15
  68. package/dist/src/components/common/button/PrintButton.cjs +1 -1
  69. package/dist/src/components/common/button/PrintButton.js +14 -14
  70. package/dist/src/components/common/button/RefreshButton.cjs +1 -1
  71. package/dist/src/components/common/button/RefreshButton.js +12 -12
  72. package/dist/src/components/common/button/UnHideButton.cjs +1 -1
  73. package/dist/src/components/common/button/UnHideButton.js +31 -31
  74. package/dist/src/components/common/button/UpdateButtonTable.cjs +1 -1
  75. package/dist/src/components/common/button/UpdateButtonTable.js +9 -9
  76. package/dist/src/components/common/button/ViewButtonTable.cjs +1 -1
  77. package/dist/src/components/common/button/ViewButtonTable.js +11 -11
  78. package/dist/src/components/common/check-box/CheckBox.cjs +1 -1
  79. package/dist/src/components/common/check-box/CheckBox.js +17 -15
  80. package/dist/src/components/common/description/DescList.cjs +1 -1
  81. package/dist/src/components/common/description/DescList.js +1 -1
  82. package/dist/src/components/common/layout/VerticalSpace.cjs +1 -1
  83. package/dist/src/components/common/layout/VerticalSpace.js +1 -1
  84. package/dist/src/components/common/loading/LoadingIndicator.cjs +1 -1
  85. package/dist/src/components/common/loading/LoadingIndicator.js +11 -10
  86. package/dist/src/components/common/picker/ImagePicker.cjs +1 -1
  87. package/dist/src/components/common/picker/ImagePicker.js +95 -90
  88. package/dist/src/components/common/radio/RadioGroupComponent.cjs +1 -1
  89. package/dist/src/components/common/radio/RadioGroupComponent.js +17 -16
  90. package/dist/src/components/common/report/SelectFieldInReport.cjs +1 -1
  91. package/dist/src/components/common/report/SelectFieldInReport.js +17 -16
  92. package/dist/src/components/common/select/CustomSelectOption.cjs +1 -1
  93. package/dist/src/components/common/select/CustomSelectOption.js +1 -1
  94. package/dist/src/components/common/select/SelectComponent.cjs +1 -1
  95. package/dist/src/components/common/select/SelectComponent.js +36 -33
  96. package/dist/src/components/common/show-more/index.cjs +1 -1
  97. package/dist/src/components/common/show-more/index.js +1 -1
  98. package/dist/src/components/common/tab/TabViewWithRoute.cjs +1 -1
  99. package/dist/src/components/common/tab/TabViewWithRoute.js +10 -10
  100. package/dist/src/components/common/table/table.cjs +1 -1
  101. package/dist/src/components/common/table/table.js +16 -16
  102. package/dist/src/components/common/tag/StatusTag.cjs +1 -1
  103. package/dist/src/components/common/tag/StatusTag.js +4 -4
  104. package/dist/src/components/common/text/index.cjs +1 -1
  105. package/dist/src/components/common/text/index.js +1 -1
  106. package/dist/src/components/common/text/title/index.cjs +1 -1
  107. package/dist/src/components/common/text/title/index.js +1 -1
  108. package/dist/src/components/common/text-field/NumberField.cjs +1 -1
  109. package/dist/src/components/common/text-field/NumberField.js +20 -19
  110. package/dist/src/components/common/text-field/TextArea.cjs +1 -1
  111. package/dist/src/components/common/text-field/TextArea.js +19 -18
  112. package/dist/src/components/common/text-field/TextField.cjs +1 -1
  113. package/dist/src/components/common/text-field/TextField.js +37 -36
  114. package/dist/src/components/common/tooltip/TooltipComponent.cjs +1 -1
  115. package/dist/src/components/common/tooltip/TooltipComponent.js +1 -1
  116. package/dist/src/components/common/wizard/WizardResult.cjs +1 -1
  117. package/dist/src/components/common/wizard/WizardResult.js +37 -36
  118. package/dist/src/components/common/wizard/WizardViewForm.cjs +1 -1
  119. package/dist/src/components/common/wizard/WizardViewForm.js +1 -1
  120. package/dist/src/components/crud/CrudComponent.cjs +1 -1
  121. package/dist/src/components/crud/CrudComponent.js +74 -71
  122. package/dist/src/components/crud/CrudField.cjs +1 -1
  123. package/dist/src/components/crud/CrudField.js +111 -108
  124. package/dist/src/components/crud/CrudForm.cjs +1 -1
  125. package/dist/src/components/crud/CrudForm.js +36 -33
  126. package/dist/src/components/crud/CrudFormWizard.cjs +1 -1
  127. package/dist/src/components/crud/CrudFormWizard.js +78 -73
  128. package/dist/src/components/crud/CrudReportComponent.cjs +3 -3
  129. package/dist/src/components/crud/CrudReportComponent.js +75 -71
  130. package/dist/src/components/crud/CrudSearchComponent.cjs +1 -1
  131. package/dist/src/components/crud/CrudSearchComponent.js +17 -15
  132. package/dist/src/components/crud/FileCrudField.cjs +1 -1
  133. package/dist/src/components/crud/FileCrudField.js +103 -94
  134. package/dist/src/components/crud/ImageCrudField.cjs +1 -1
  135. package/dist/src/components/crud/ImageCrudField.js +58 -55
  136. package/dist/src/components/crud/import/CrudImportButton.cjs +1 -1
  137. package/dist/src/components/crud/import/CrudImportButton.js +10 -10
  138. package/dist/src/components/crud/import/CrudImportComponent.cjs +2 -2
  139. package/dist/src/components/crud/import/CrudImportComponent.js +111 -106
  140. package/dist/src/components/crud/view/CrudViewer.cjs +1 -1
  141. package/dist/src/components/crud/view/CrudViewer.js +30 -30
  142. package/dist/src/components/crud/view/CrudViewerUtil.cjs +1 -1
  143. package/dist/src/components/crud/view/CrudViewerUtil.js +35 -33
  144. package/dist/src/util/ImageUtil.cjs +1 -1
  145. package/dist/src/util/ImageUtil.js +1 -1
  146. package/package.json +7 -9
@@ -1,20 +1,20 @@
1
1
  import { j as r } from "../../../../_virtual/jsx-runtime.js";
2
- import { Modal as k } from "antd";
3
- import H from "../../common/button/CloneButtonTable.js";
4
- import U from "../../common/button/DeleteButtonTable.js";
5
- import { ExportButton as F } from "../../common/button/ExportButton.js";
6
- import rr from "../../common/button/HideButtonTable.js";
7
- import { RefreshButton as or } from "../../common/button/RefreshButton.js";
8
- import tr from "../../common/button/UpdateButtonTable.js";
9
- import sr from "../../common/button/ViewButtonTable.js";
10
- import mr from "../../common/layout/VerticalSpace.js";
11
- import ur from "../../common/table/table.js";
12
- import { useMemo as L, useState as _, useEffect as nr, useCallback as er } from "react";
13
- import { useTranslation as fr } from "react-i18next";
14
- import { TRANSLATION_NAMESPACE as cr } from "../../../locale/hooks/translation-constants.js";
15
- import lr from "../CrudSearchComponent.js";
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(cr), N = L(
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
- nr(() => {
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 = er(
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
- tr,
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(H, { value: o, onClick: (u) => T(u) }),
87
+ T && /* @__PURE__ */ r.jsx(k, { value: o, onClick: (u) => T(u) }),
88
88
  S && /* @__PURE__ */ r.jsx(
89
- F,
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
- rr,
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
- U,
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
- k,
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
- jr,
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(lr, { fields: f, ...Z }),
175
- /* @__PURE__ */ r.jsxs(mr, { children: [
176
- !!C && /* @__PURE__ */ r.jsx(or, { onClick: C }),
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
- ur,
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(sr, { value: t, onClick: x }),
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 c=require("../../../../_virtual/jsx-runtime.cjs"),m=require("@ant-design/icons"),s=require("antd"),j=require("../../common/show-more/index.cjs"),d=require("../FileCrudField.cjs"),v=require("../ImageCrudField.cjs"),y=require("../../../locale/hooks/translation-constants.cjs"),C=require("i18next"),r=require("../../../util/DateUtil.cjs"),x=require("../../../util/NumberUtil.cjs");function g({type:a,render:i,...n}){return a==="object"?(t,u,e)=>typeof i=="function"?i(t,u,e):"":a==="select"?(t,u,e)=>{const o=n;let l=o.multiple?Array.isArray(t)?t.map(f=>f==null?void 0:f[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,u,e):Array.isArray(l)?l.join(", "):l}:a==="number"?(t,u,e)=>typeof i=="function"?i(t,u,e):n!=null&&n.int?x.default.toInt(t,n.formatted):x.default.toMoney(t):a==="enum"?(t,u,e)=>{var l;const o=C.t(((l=n==null?void 0:n.translation)==null?void 0:l[t??""])??t,{ns:y.TRANSLATION_NAMESPACE});return typeof i=="function"?i(t,u,e):o}:a==="date"?(t,u,e)=>{if(!t)return"-";const o=n!=null&&n.formatTime?r.default.formatDateTime(t):r.default.formatDate(t);return typeof i=="function"?i(t,u,e):o}:a==="checkbox"?(t,u,e)=>typeof i=="function"?i(t,u,e):t?c.jsxRuntimeExports.jsx(m.CheckOutlined,{}):c.jsxRuntimeExports.jsx(m.CloseOutlined,{}):a==="image"?(t,u,e)=>typeof i=="function"?i(t,u,e):c.jsxRuntimeExports.jsx(v.ImageCrudCellValue,{value:t,provider:n.provider}):a==="file"?(t,u,e)=>typeof i=="function"?i(t,u,e):c.jsxRuntimeExports.jsx(d.FileCrudCellValue,{value:t,provider:n.provider}):a==="time"?(t,u,e)=>{if(!t)return"-";const o=n==null?void 0:n.format,l=n==null?void 0:n.use12Hours,f=r.default.formatTime(t,o||(l?"hh:mm:ss A":void 0));return typeof i=="function"?i(t,u,e):f}:a==="color"?(t,u,e)=>typeof i=="function"?i(t,u,e):typeof t=="string"&&t.startsWith("#")?c.jsxRuntimeExports.jsx(s.Tooltip,{title:t,children:c.jsxRuntimeExports.jsx(s.Avatar,{style:{backgroundColor:t}})}):String(t):a==="textarea"?(t,u,e)=>{const o=(n==null?void 0:n.truncated)??1;return typeof i=="function"?i(t,u,e):o?c.jsxRuntimeExports.jsx(j.ShowMore,{lines:o===!0?1:o,children:t}):t}:typeof i=="function"?i:t=>t}exports.getRendererValueCrudViewer=g;
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 l } from "../../../../_virtual/jsx-runtime.js";
2
- import { CheckOutlined as x, CloseOutlined as j } from "@ant-design/icons";
3
- import { Tooltip as y, Avatar as e } from "antd";
4
- import { ShowMore as A } from "../../common/show-more/index.js";
5
- import { FileCrudCellValue as C } from "../FileCrudField.js";
6
- import { ImageCrudCellValue as b } from "../ImageCrudField.js";
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
- function L({
12
- type: m,
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 m === "object" ? (t, n, f) => typeof i == "function" ? i(t, n, f) : "" : m === "select" ? (t, n, f) => {
17
- const u = o;
18
- let a = u.multiple ? Array.isArray(t) ? t.map((c) => c == null ? void 0 : c[u.innerFieldLabel ?? "name"]) : void 0 : t == null ? void 0 : t[u.innerFieldLabel ?? "name"];
19
- return (!a && typeof t == "string" || typeof t == "number") && (a = t), typeof i == "function" ? i(a, n, f) : Array.isArray(a) ? a.join(", ") : a;
20
- } : m === "number" ? (t, n, f) => typeof i == "function" ? i(t, n, f) : o != null && o.int ? v.toInt(t, o.formatted) : v.toMoney(t) : m === "enum" ? (t, n, f) => {
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 u = h(
24
+ const m = b(
23
25
  ((a = o == null ? void 0 : o.translation) == null ? void 0 : a[t ?? ""]) ?? t,
24
- { ns: g }
26
+ { ns: A }
25
27
  );
26
- return typeof i == "function" ? i(t, n, f) : u;
27
- } : m === "date" ? (t, n, f) => {
28
+ return typeof i == "function" ? i(t, f, n) : m;
29
+ } : u === "date" ? (t, f, n) => {
28
30
  if (!t) return "-";
29
- const u = o != null && o.formatTime ? r.formatDateTime(t) : r.formatDate(t);
30
- return typeof i == "function" ? i(t, n, f) : u;
31
- } : m === "checkbox" ? (t, n, f) => typeof i == "function" ? i(t, n, f) : t ? /* @__PURE__ */ l.jsx(x, {}) : /* @__PURE__ */ l.jsx(j, {}) : m === "image" ? (t, n, f) => typeof i == "function" ? i(t, n, f) : /* @__PURE__ */ l.jsx(
32
- b,
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
- ) : m === "file" ? (t, n, f) => typeof i == "function" ? i(t, n, f) : /* @__PURE__ */ l.jsx(
38
- C,
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
- ) : m === "time" ? (t, n, f) => {
45
+ ) : u === "time" ? (t, f, n) => {
44
46
  if (!t) return "-";
45
- const u = o == null ? void 0 : o.format, a = o == null ? void 0 : o.use12Hours, c = r.formatTime(
47
+ const m = o == null ? void 0 : o.format, a = o == null ? void 0 : o.use12Hours, l = r.formatTime(
46
48
  t,
47
- u || (a ? "hh:mm:ss A" : void 0)
49
+ m || (a ? "hh:mm:ss A" : void 0)
48
50
  );
49
- return typeof i == "function" ? i(t, n, f) : c;
50
- } : m === "color" ? (t, n, f) => typeof i == "function" ? i(t, n, f) : typeof t == "string" && t.startsWith("#") ? /* @__PURE__ */ l.jsx(y, { title: t, children: /* @__PURE__ */ l.jsx(e, { style: { backgroundColor: t } }) }) : String(t) : m === "textarea" ? (t, n, f) => {
51
- const u = (o == null ? void 0 : o.truncated) ?? 1;
52
- return typeof i == "function" ? i(t, n, f) : u ? /* @__PURE__ */ l.jsx(A, { lines: u === !0 ? 1 : u, children: t }) : 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
- L as getRendererValueCrudViewer
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;
@@ -1,4 +1,4 @@
1
- import c from "browser-image-compression";
1
+ import c from "../../node_modules/browser-image-compression/dist/browser-image-compression.js";
2
2
  class g {
3
3
  async resizeImage(t) {
4
4
  const e = await c(t, {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@kingteza/crud-component",
3
3
  "private": false,
4
- "version": "1.0.6",
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
  }