@kingteza/crud-component 1.0.11 → 1.0.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (204) hide show
  1. package/package.json +10 -3
  2. package/dist/_virtual/FileSaver.min.cjs +0 -1
  3. package/dist/_virtual/FileSaver.min.js +0 -5
  4. package/dist/_virtual/FileSaver.min2.cjs +0 -1
  5. package/dist/_virtual/FileSaver.min2.js +0 -4
  6. package/dist/_virtual/ShowMoreText.cjs +0 -1
  7. package/dist/_virtual/ShowMoreText.js +0 -7
  8. package/dist/_virtual/ShowMoreText2.cjs +0 -1
  9. package/dist/_virtual/ShowMoreText2.js +0 -4
  10. package/dist/_virtual/Truncate.cjs +0 -1
  11. package/dist/_virtual/Truncate.js +0 -4
  12. package/dist/_virtual/_commonjsHelpers.cjs +0 -1
  13. package/dist/_virtual/_commonjsHelpers.js +0 -8
  14. package/dist/_virtual/advancedFormat.cjs +0 -1
  15. package/dist/_virtual/advancedFormat.js +0 -7
  16. package/dist/_virtual/advancedFormat2.cjs +0 -1
  17. package/dist/_virtual/advancedFormat2.js +0 -4
  18. package/dist/_virtual/customParseFormat.cjs +0 -1
  19. package/dist/_virtual/customParseFormat.js +0 -7
  20. package/dist/_virtual/customParseFormat2.cjs +0 -1
  21. package/dist/_virtual/customParseFormat2.js +0 -4
  22. package/dist/_virtual/dayjs.min.cjs +0 -1
  23. package/dist/_virtual/dayjs.min.js +0 -7
  24. package/dist/_virtual/dayjs.min2.cjs +0 -1
  25. package/dist/_virtual/dayjs.min2.js +0 -4
  26. package/dist/_virtual/index.cjs +0 -1
  27. package/dist/_virtual/index.js +0 -7
  28. package/dist/_virtual/index10.cjs +0 -1
  29. package/dist/_virtual/index10.js +0 -4
  30. package/dist/_virtual/index2.cjs +0 -1
  31. package/dist/_virtual/index2.js +0 -4
  32. package/dist/_virtual/index3.cjs +0 -1
  33. package/dist/_virtual/index3.js +0 -4
  34. package/dist/_virtual/index4.cjs +0 -1
  35. package/dist/_virtual/index4.js +0 -2
  36. package/dist/_virtual/index5.cjs +0 -1
  37. package/dist/_virtual/index5.js +0 -4
  38. package/dist/_virtual/index6.cjs +0 -1
  39. package/dist/_virtual/index6.js +0 -7
  40. package/dist/_virtual/index7.cjs +0 -1
  41. package/dist/_virtual/index7.js +0 -7
  42. package/dist/_virtual/index8.cjs +0 -1
  43. package/dist/_virtual/index8.js +0 -7
  44. package/dist/_virtual/index9.cjs +0 -1
  45. package/dist/_virtual/index9.js +0 -4
  46. package/dist/_virtual/jsx-runtime.cjs +0 -1
  47. package/dist/_virtual/jsx-runtime.js +0 -5
  48. package/dist/_virtual/jsx-runtime2.cjs +0 -1
  49. package/dist/_virtual/jsx-runtime2.js +0 -4
  50. package/dist/_virtual/localeData.cjs +0 -1
  51. package/dist/_virtual/localeData.js +0 -7
  52. package/dist/_virtual/localeData2.cjs +0 -1
  53. package/dist/_virtual/localeData2.js +0 -4
  54. package/dist/_virtual/main.cjs +0 -1
  55. package/dist/_virtual/main.js +0 -7
  56. package/dist/_virtual/main2.cjs +0 -1
  57. package/dist/_virtual/main2.js +0 -4
  58. package/dist/_virtual/papaparse.min.cjs +0 -1
  59. package/dist/_virtual/papaparse.min.js +0 -7
  60. package/dist/_virtual/papaparse.min2.cjs +0 -1
  61. package/dist/_virtual/papaparse.min2.js +0 -4
  62. package/dist/_virtual/react-is.development.cjs +0 -1
  63. package/dist/_virtual/react-is.development.js +0 -4
  64. package/dist/_virtual/react-is.production.min.cjs +0 -1
  65. package/dist/_virtual/react-is.production.min.js +0 -4
  66. package/dist/_virtual/react-jsx-runtime.development.cjs +0 -1
  67. package/dist/_virtual/react-jsx-runtime.development.js +0 -4
  68. package/dist/_virtual/react-jsx-runtime.production.min.cjs +0 -1
  69. package/dist/_virtual/react-jsx-runtime.production.min.js +0 -4
  70. package/dist/_virtual/weekOfYear.cjs +0 -1
  71. package/dist/_virtual/weekOfYear.js +0 -7
  72. package/dist/_virtual/weekOfYear2.cjs +0 -1
  73. package/dist/_virtual/weekOfYear2.js +0 -4
  74. package/dist/_virtual/weekYear.cjs +0 -1
  75. package/dist/_virtual/weekYear.js +0 -7
  76. package/dist/_virtual/weekYear2.cjs +0 -1
  77. package/dist/_virtual/weekYear2.js +0 -4
  78. package/dist/_virtual/weekday.cjs +0 -1
  79. package/dist/_virtual/weekday.js +0 -7
  80. package/dist/_virtual/weekday2.cjs +0 -1
  81. package/dist/_virtual/weekday2.js +0 -4
  82. package/dist/common/index.cjs +0 -1
  83. package/dist/common/index.js +0 -75
  84. package/dist/context/WindowDimension.d.ts +0 -4
  85. package/dist/crud-component.css +0 -9
  86. package/dist/src/components/common/DatePicker/DatePicker.cjs +0 -1
  87. package/dist/src/components/common/DatePicker/DatePicker.js +0 -88
  88. package/dist/src/components/common/DatePicker/TimePicker.cjs +0 -1
  89. package/dist/src/components/common/DatePicker/TimePicker.js +0 -78
  90. package/dist/src/components/common/appearance/Hider.cjs +0 -1
  91. package/dist/src/components/common/appearance/Hider.js +0 -5
  92. package/dist/src/components/common/button/Button.cjs +0 -1
  93. package/dist/src/components/common/button/Button.js +0 -64
  94. package/dist/src/components/common/button/CloneButtonTable.cjs +0 -1
  95. package/dist/src/components/common/button/CloneButtonTable.js +0 -20
  96. package/dist/src/components/common/button/DeleteButtonTable.cjs +0 -1
  97. package/dist/src/components/common/button/DeleteButtonTable.js +0 -68
  98. package/dist/src/components/common/button/ExportButton.cjs +0 -1
  99. package/dist/src/components/common/button/ExportButton.js +0 -27
  100. package/dist/src/components/common/button/HideButtonTable.cjs +0 -1
  101. package/dist/src/components/common/button/HideButtonTable.js +0 -68
  102. package/dist/src/components/common/button/ImportButton.cjs +0 -1
  103. package/dist/src/components/common/button/ImportButton.js +0 -56
  104. package/dist/src/components/common/button/NewButton.cjs +0 -1
  105. package/dist/src/components/common/button/NewButton.js +0 -24
  106. package/dist/src/components/common/button/PrintButton.cjs +0 -1
  107. package/dist/src/components/common/button/PrintButton.js +0 -26
  108. package/dist/src/components/common/button/RefreshButton.cjs +0 -1
  109. package/dist/src/components/common/button/RefreshButton.js +0 -24
  110. package/dist/src/components/common/button/UnHideButton.cjs +0 -1
  111. package/dist/src/components/common/button/UnHideButton.js +0 -70
  112. package/dist/src/components/common/button/UpdateButtonTable.cjs +0 -1
  113. package/dist/src/components/common/button/UpdateButtonTable.js +0 -20
  114. package/dist/src/components/common/button/ViewButtonTable.cjs +0 -1
  115. package/dist/src/components/common/button/ViewButtonTable.js +0 -20
  116. package/dist/src/components/common/check-box/CheckBox.cjs +0 -1
  117. package/dist/src/components/common/check-box/CheckBox.js +0 -40
  118. package/dist/src/components/common/description/DescList.cjs +0 -1
  119. package/dist/src/components/common/description/DescList.js +0 -16
  120. package/dist/src/components/common/layout/VerticalSpace.cjs +0 -1
  121. package/dist/src/components/common/layout/VerticalSpace.js +0 -6
  122. package/dist/src/components/common/loading/LoadingIndicator.cjs +0 -1
  123. package/dist/src/components/common/loading/LoadingIndicator.js +0 -24
  124. package/dist/src/components/common/picker/ImagePicker.cjs +0 -1
  125. package/dist/src/components/common/picker/ImagePicker.js +0 -285
  126. package/dist/src/components/common/radio/RadioGroupComponent.cjs +0 -1
  127. package/dist/src/components/common/radio/RadioGroupComponent.js +0 -19
  128. package/dist/src/components/common/report/SelectFieldInReport.cjs +0 -1
  129. package/dist/src/components/common/report/SelectFieldInReport.js +0 -30
  130. package/dist/src/components/common/select/CustomSelectOption.cjs +0 -1
  131. package/dist/src/components/common/select/CustomSelectOption.js +0 -13
  132. package/dist/src/components/common/select/SelectComponent.cjs +0 -1
  133. package/dist/src/components/common/select/SelectComponent.js +0 -89
  134. package/dist/src/components/common/show-more/index.cjs +0 -1
  135. package/dist/src/components/common/show-more/index.js +0 -8
  136. package/dist/src/components/common/tab/TabViewWithRoute.cjs +0 -1
  137. package/dist/src/components/common/tab/TabViewWithRoute.js +0 -37
  138. package/dist/src/components/common/table/table.cjs +0 -1
  139. package/dist/src/components/common/table/table.js +0 -40
  140. package/dist/src/components/common/tag/StatusTag.cjs +0 -1
  141. package/dist/src/components/common/tag/StatusTag.js +0 -30
  142. package/dist/src/components/common/text/index.cjs +0 -1
  143. package/dist/src/components/common/text/index.js +0 -5
  144. package/dist/src/components/common/text/title/index.cjs +0 -1
  145. package/dist/src/components/common/text/title/index.js +0 -5
  146. package/dist/src/components/common/text-field/NumberField.cjs +0 -1
  147. package/dist/src/components/common/text-field/NumberField.js +0 -83
  148. package/dist/src/components/common/text-field/PhoneNumberField.cjs +0 -1
  149. package/dist/src/components/common/text-field/PhoneNumberField.js +0 -18
  150. package/dist/src/components/common/text-field/TextArea.cjs +0 -1
  151. package/dist/src/components/common/text-field/TextArea.js +0 -47
  152. package/dist/src/components/common/text-field/TextField.cjs +0 -1
  153. package/dist/src/components/common/text-field/TextField.js +0 -73
  154. package/dist/src/components/common/tooltip/TooltipComponent.cjs +0 -1
  155. package/dist/src/components/common/tooltip/TooltipComponent.js +0 -9
  156. package/dist/src/components/common/wizard/WizardResult.cjs +0 -1
  157. package/dist/src/components/common/wizard/WizardResult.js +0 -61
  158. package/dist/src/components/common/wizard/WizardViewForm.cjs +0 -1
  159. package/dist/src/components/common/wizard/WizardViewForm.js +0 -74
  160. package/dist/src/components/crud/CrudComponent.cjs +0 -1
  161. package/dist/src/components/crud/CrudComponent.js +0 -210
  162. package/dist/src/components/crud/CrudField.cjs +0 -1
  163. package/dist/src/components/crud/CrudField.js +0 -459
  164. package/dist/src/components/crud/CrudForm.cjs +0 -1
  165. package/dist/src/components/crud/CrudForm.js +0 -91
  166. package/dist/src/components/crud/CrudFormWizard.cjs +0 -1
  167. package/dist/src/components/crud/CrudFormWizard.js +0 -142
  168. package/dist/src/components/crud/CrudReportComponent.cjs +0 -4
  169. package/dist/src/components/crud/CrudReportComponent.js +0 -255
  170. package/dist/src/components/crud/CrudSearchComponent.cjs +0 -1
  171. package/dist/src/components/crud/CrudSearchComponent.js +0 -95
  172. package/dist/src/components/crud/FileCrudField.cjs +0 -1
  173. package/dist/src/components/crud/FileCrudField.js +0 -227
  174. package/dist/src/components/crud/ImageCrudField.cjs +0 -1
  175. package/dist/src/components/crud/ImageCrudField.js +0 -113
  176. package/dist/src/components/crud/import/CrudImportButton.cjs +0 -1
  177. package/dist/src/components/crud/import/CrudImportButton.js +0 -31
  178. package/dist/src/components/crud/import/CrudImportComponent.cjs +0 -2
  179. package/dist/src/components/crud/import/CrudImportComponent.js +0 -222
  180. package/dist/src/components/crud/view/CrudDecListView.cjs +0 -1
  181. package/dist/src/components/crud/view/CrudDecListView.js +0 -42
  182. package/dist/src/components/crud/view/CrudViewer.cjs +0 -1
  183. package/dist/src/components/crud/view/CrudViewer.js +0 -217
  184. package/dist/src/components/crud/view/CrudViewerUtil.cjs +0 -1
  185. package/dist/src/components/crud/view/CrudViewerUtil.js +0 -58
  186. package/dist/src/context/WindowDimension.cjs +0 -1
  187. package/dist/src/context/WindowDimension.js +0 -8
  188. package/dist/src/locale/hooks/translation-constants.cjs +0 -1
  189. package/dist/src/locale/hooks/translation-constants.js +0 -4
  190. package/dist/src/locale/index.cjs +0 -1
  191. package/dist/src/locale/index.js +0 -33
  192. package/dist/src/locale/translations/en.cjs +0 -1
  193. package/dist/src/locale/translations/en.js +0 -60
  194. package/dist/src/util/DateUtil.cjs +0 -1
  195. package/dist/src/util/DateUtil.js +0 -6
  196. package/dist/src/util/ImageUtil.cjs +0 -1
  197. package/dist/src/util/ImageUtil.js +0 -63
  198. package/dist/src/util/NumberUtil.cjs +0 -1
  199. package/dist/src/util/NumberUtil.js +0 -60
  200. package/dist/src/util/ValidationUtil.cjs +0 -1
  201. package/dist/src/util/ValidationUtil.js +0 -60
  202. package/dist/types/DialogComponentProp.d.ts +0 -8
  203. package/dist/types/Id.d.ts +0 -10
  204. package/dist/vite.svg +0 -1
@@ -1,70 +0,0 @@
1
- import { j as o } from "../../../../_virtual/jsx-runtime.js";
2
- import { Popconfirm as C } from "antd";
3
- import { useMemo as T, useState as g, useEffect as A, useCallback as E } from "react";
4
- import c from "./Button.js";
5
- import { TRANSLATION_NAMESPACE as _ } from "../../../locale/hooks/translation-constants.js";
6
- import { useTranslation as k } from "../../../../node_modules/react-i18next/dist/es/useTranslation.js";
7
- import x from "../../../../node_modules/@ant-design/icons/es/icons/UpCircleOutlined.js";
8
- function H({
9
- shouldConfirm: d = !0,
10
- block: e,
11
- value: i,
12
- loading: s,
13
- onClick: a,
14
- text: f,
15
- disabled: m,
16
- type: u = "link",
17
- hidden: j
18
- }) {
19
- const { t } = k(_), n = T(() => f ?? t("str.unhide"), [f, t]), [l, r] = g(!1);
20
- A(() => {
21
- r(s ?? !1);
22
- }, [s]);
23
- const p = E(
24
- async () => {
25
- try {
26
- r(!0), await a(i);
27
- } finally {
28
- r(!1);
29
- }
30
- },
31
- [a, i]
32
- );
33
- return d ? /* @__PURE__ */ o.jsx(
34
- C,
35
- {
36
- title: t("qus.doYouWantToHide"),
37
- okText: n.toUpperCase(),
38
- cancelText: t("str.no").toUpperCase(),
39
- onConfirm: p,
40
- children: /* @__PURE__ */ o.jsx(
41
- c,
42
- {
43
- tooltip: n,
44
- icon: /* @__PURE__ */ o.jsx(x, {}),
45
- disabled: m,
46
- loading: l,
47
- type: u,
48
- danger: !0,
49
- hidden: j,
50
- block: e
51
- }
52
- )
53
- }
54
- ) : /* @__PURE__ */ o.jsx(
55
- c,
56
- {
57
- tooltip: n,
58
- icon: /* @__PURE__ */ o.jsx(x, {}),
59
- disabled: m,
60
- loading: l,
61
- type: u,
62
- danger: !0,
63
- block: e,
64
- onClick: p
65
- }
66
- );
67
- }
68
- export {
69
- H as default
70
- };
@@ -1 +0,0 @@
1
- "use strict";const t=require("../../../../_virtual/jsx-runtime.cjs"),o=require("./Button.cjs"),r=require("../../../locale/hooks/translation-constants.cjs"),i=require("../../../../node_modules/react-i18next/dist/es/useTranslation.cjs"),u=require("../../../../node_modules/@ant-design/icons/es/icons/EditOutlined.cjs");function a({value:n,onClick:s}){const{t:e}=i.useTranslation(r.TRANSLATION_NAMESPACE);return t.jsxRuntimeExports.jsx(o,{tooltip:e("str.update"),type:"link",onClick:()=>s(n),icon:t.jsxRuntimeExports.jsx(u,{})})}module.exports=a;
@@ -1,20 +0,0 @@
1
- import { j as t } from "../../../../_virtual/jsx-runtime.js";
2
- import i from "./Button.js";
3
- import { TRANSLATION_NAMESPACE as m } from "../../../locale/hooks/translation-constants.js";
4
- import { useTranslation as p } from "../../../../node_modules/react-i18next/dist/es/useTranslation.js";
5
- import e from "../../../../node_modules/@ant-design/icons/es/icons/EditOutlined.js";
6
- function c({ value: o, onClick: r }) {
7
- const { t: n } = p(m);
8
- return /* @__PURE__ */ t.jsx(
9
- i,
10
- {
11
- tooltip: n("str.update"),
12
- type: "link",
13
- onClick: () => r(o),
14
- icon: /* @__PURE__ */ t.jsx(e, {})
15
- }
16
- );
17
- }
18
- export {
19
- c as default
20
- };
@@ -1 +0,0 @@
1
- "use strict";const t=require("../../../../_virtual/jsx-runtime.cjs"),i=require("./Button.cjs"),o=require("../../../locale/hooks/translation-constants.cjs"),r=require("../../../../node_modules/react-i18next/dist/es/useTranslation.cjs"),u=require("../../../../node_modules/@ant-design/icons/es/icons/EyeOutlined.cjs");function c({value:n,onClick:e}){const{t:s}=r.useTranslation(o.TRANSLATION_NAMESPACE);return t.jsxRuntimeExports.jsx(i,{type:"link",onClick:()=>e(n),icon:t.jsxRuntimeExports.jsx(u,{}),tooltip:s("str.view")})}module.exports=c;
@@ -1,20 +0,0 @@
1
- import { j as o } from "../../../../_virtual/jsx-runtime.js";
2
- import i from "./Button.js";
3
- import { TRANSLATION_NAMESPACE as m } from "../../../locale/hooks/translation-constants.js";
4
- import { useTranslation as e } from "../../../../node_modules/react-i18next/dist/es/useTranslation.js";
5
- import p from "../../../../node_modules/@ant-design/icons/es/icons/EyeOutlined.js";
6
- function c({ value: t, onClick: r }) {
7
- const { t: n } = e(m);
8
- return /* @__PURE__ */ o.jsx(
9
- i,
10
- {
11
- type: "link",
12
- onClick: () => r(t),
13
- icon: /* @__PURE__ */ o.jsx(p, {}),
14
- tooltip: n("str.view")
15
- }
16
- );
17
- }
18
- export {
19
- c as default
20
- };
@@ -1 +0,0 @@
1
- "use strict";const r=require("../../../../_virtual/jsx-runtime.cjs"),c=require("antd"),u=c.Form.Item,d=({onChange:e,label:x,initialValue:t=!1,disabled:n,switch:s=!1,...m})=>r.jsxRuntimeExports.jsxs(u,{...m,valuePropName:"checked",initialValue:t,label:s?x:void 0,children:[!!s&&r.jsxRuntimeExports.jsx(c.Switch,{disabled:n,defaultChecked:t,onChange:e&&(o=>e(o))}),!s&&r.jsxRuntimeExports.jsx(c.Checkbox,{disabled:n,defaultChecked:t,onChange:e&&(o=>e(o.target.checked)),children:x})]});module.exports=d;
@@ -1,40 +0,0 @@
1
- import { j as c } from "../../../../_virtual/jsx-runtime.js";
2
- import { Form as x, Switch as f, Checkbox as h } from "antd";
3
- const k = x.Item, n = ({
4
- onChange: e,
5
- label: m,
6
- initialValue: o = !1,
7
- disabled: s,
8
- switch: r = !1,
9
- ...d
10
- }) => /* @__PURE__ */ c.jsxs(
11
- k,
12
- {
13
- ...d,
14
- valuePropName: "checked",
15
- initialValue: o,
16
- label: r ? m : void 0,
17
- children: [
18
- !!r && /* @__PURE__ */ c.jsx(
19
- f,
20
- {
21
- disabled: s,
22
- defaultChecked: o,
23
- onChange: e && ((t) => e(t))
24
- }
25
- ),
26
- !r && /* @__PURE__ */ c.jsx(
27
- h,
28
- {
29
- disabled: s,
30
- defaultChecked: o,
31
- onChange: e && ((t) => e(t.target.checked)),
32
- children: m
33
- }
34
- )
35
- ]
36
- }
37
- );
38
- export {
39
- n as default
40
- };
@@ -1 +0,0 @@
1
- "use strict";const n=require("../../../../_virtual/jsx-runtime.cjs"),o=require("antd"),u=require("react"),a=require("../../../util/NumberUtil.cjs"),m=o.Descriptions.Item,x=({list:s,keepEmptyValues:r,...i})=>{const c=u.useMemo(()=>{const t=r?s:s.filter(e=>e&&!!e.value);return t.forEach(e=>{!e.noFormatting&&!isNaN(e.value)&&(e.value=a.default.toMoney(e.value))}),t},[r,s]);return n.jsxRuntimeExports.jsx(o.Descriptions,{...i,children:c.map(({label:t,value:e})=>n.jsxRuntimeExports.jsx(m,{label:t,children:e},t))})};module.exports=x;
@@ -1,16 +0,0 @@
1
- import { j as i } from "../../../../_virtual/jsx-runtime.js";
2
- import { Descriptions as s } from "antd";
3
- import { useMemo as a } from "react";
4
- import c from "../../../util/NumberUtil.js";
5
- const u = s.Item, j = ({ list: t, keepEmptyValues: e, ...n }) => {
6
- const m = a(() => {
7
- const r = e ? t : t.filter((o) => o && !!o.value);
8
- return r.forEach((o) => {
9
- !o.noFormatting && !isNaN(o.value) && (o.value = c.toMoney(o.value));
10
- }), r;
11
- }, [e, t]);
12
- return /* @__PURE__ */ i.jsx(s, { ...n, children: m.map(({ label: r, value: o }) => /* @__PURE__ */ i.jsx(u, { label: r, children: o }, r)) });
13
- };
14
- export {
15
- j as default
16
- };
@@ -1 +0,0 @@
1
- "use strict";const r=require("../../../../_virtual/jsx-runtime.cjs"),s=require("antd"),c=({children:e,className:t=""})=>r.jsxRuntimeExports.jsx(s.Space,{direction:"vertical",className:[t,"w-100"].join(" "),children:e});module.exports=c;
@@ -1,6 +0,0 @@
1
- import { j as e } from "../../../../_virtual/jsx-runtime.js";
2
- import { Space as a } from "antd";
3
- const s = ({ children: r, className: t = "" }) => /* @__PURE__ */ e.jsx(a, { direction: "vertical", className: [t, "w-100"].join(" "), children: r });
4
- export {
5
- s as default
6
- };
@@ -1 +0,0 @@
1
- "use strict";const t=require("../../../../_virtual/jsx-runtime.cjs"),e=require("antd"),a=require("../button/Button.cjs"),i=require("../../../locale/hooks/translation-constants.cjs"),u=require("../../../../node_modules/react-i18next/dist/es/useTranslation.cjs"),c=({loading:r,children:n,error:o})=>{const{t:s}=u.useTranslation(i.TRANSLATION_NAMESPACE);return t.jsxRuntimeExports.jsx(e.Skeleton,{loading:r,paragraph:!0,className:"h-100",children:o?t.jsxRuntimeExports.jsx(e.Result,{status:"404",title:404,subTitle:s("err.notFound"),className:"",extra:t.jsxRuntimeExports.jsx(a,{to:-1,type:"primary",children:s("str.goBack")})}):n})};module.exports=c;
@@ -1,24 +0,0 @@
1
- import { j as t } from "../../../../_virtual/jsx-runtime.js";
2
- import { Skeleton as a, Result as n } from "antd";
3
- import m from "../button/Button.js";
4
- import { TRANSLATION_NAMESPACE as i } from "../../../locale/hooks/translation-constants.js";
5
- import { useTranslation as p } from "../../../../node_modules/react-i18next/dist/es/useTranslation.js";
6
- const f = ({ loading: o, children: s, error: e }) => {
7
- const { t: r } = p(i);
8
- return (
9
- // <Spin spinning={loading} className="h-100">
10
- /* @__PURE__ */ t.jsx(a, { loading: o, paragraph: !0, className: "h-100", children: e ? /* @__PURE__ */ t.jsx(
11
- n,
12
- {
13
- status: "404",
14
- title: 404,
15
- subTitle: r("err.notFound"),
16
- className: "",
17
- extra: /* @__PURE__ */ t.jsx(m, { to: -1, type: "primary", children: r("str.goBack") })
18
- }
19
- ) : s })
20
- );
21
- };
22
- export {
23
- f as default
24
- };
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("../../../../_virtual/jsx-runtime.cjs");;/* empty css */;/* empty css */const O=require("antd"),s=require("react"),fe=require("../../../../node_modules/react-cropper/dist/react-cropper.es.cjs"),ge=require("../../../locale/hooks/translation-constants.cjs"),P=require("../button/Button.cjs"),Re=require("../../../util/ImageUtil.cjs"),he=require("../../../../node_modules/react-i18next/dist/es/useTranslation.cjs"),Ee=require("../../../../node_modules/@ant-design/icons/es/icons/RotateLeftOutlined.cjs"),we=require("../../../../node_modules/@ant-design/icons/es/icons/RotateRightOutlined.cjs"),X=require("../../../../node_modules/@ant-design/icons/es/icons/UploadOutlined.cjs"),Ce=require("../../../../node_modules/@ant-design/icons/es/icons/LoadingOutlined.cjs"),ve=O.Form.Item;function Q(r){return new Promise((u,x)=>{const n=new FileReader;n.readAsDataURL(r),n.onload=()=>u(n.result),n.onerror=p=>x(p)})}const be=({values:r=[],required:u,buttonType:x,label:n,name:p,onChange:m,aspectRatio:U,buttonTitle:R,hidePreview:h,buttonSize:j="large",showButtonText:f=!0,showOnlyIcon:A=!1,icon:v=t.jsxRuntimeExports.jsx(X,{}),loading:b,maxCount:E=1,onAdd:l,onRemove:S,listType:y,..._})=>{const[Z,ee]=s.useState(""),[te,se]=s.useState(""),[re,D]=s.useState(!1),I=s.useRef(),i=s.useRef(),[a,F]=s.useState([]),[g,N]=s.useState(),ne=s.useRef(),oe=()=>D(!1),ie=async e=>{!e.url&&!e.preview&&(e.preview=await Q(e.originFileObj)),se(e.url||e.preview),D(!0),ee(e.name)},[z,q]=s.useState(!1),ae=()=>{},B=e=>{var o;(o=i==null?void 0:i.current)==null||o.cropper.rotate(e?-90:90)};s.useEffect(()=>{m==null||m(a[0],a)},[a,m]);const ce=()=>{var C;const e=(C=i==null?void 0:i.current)==null?void 0:C.cropper.getCroppedCanvas(),{type:o,size:c,name:d,uid:w}=I.current;q(!0),e==null||e.toBlob(async me=>{const je=Object.assign(new File([me],d,{type:o}),{uid:w}),H=await Re.resizeImage(je),G=await Q(H),K={url:G,name:d,uid:w,type:o,size:c,thumbUrl:G,originFileObj:H};if(l)try{q(!0),await l(K)}finally{q(!1)}F([K,...a]),q(!1)}),N(void 0)},le=()=>{N(void 0),I.current=void 0},T=s.useCallback(e=>{const o=e;if(o){I.current=o;const c=new FileReader;c.addEventListener("load",()=>{var d;if(typeof c.result=="string"){N(c.result);const w=localStorage.getItem("cropper.box"),C=w?JSON.parse(w):void 0;C&&((d=i==null?void 0:i.current)==null||d.cropper.setCropBoxData(C)),setTimeout(()=>{$()},100)}}),c.readAsDataURL(o)}},[]);s.useEffect(()=>{if(r!=null&&r.length||typeof r=="string"){const e=Array.isArray(r)?r.map(o=>[{uid:r,url:o}]):[{uid:r,url:r}];F(e)}},[r]);const{t:M}=he.useTranslation(ge.TRANSLATION_NAMESPACE),ue=s.useMemo(()=>u?{required:u,validator:(e,o,c)=>{g||a!=null&&a.length?c():c(`${n??""} ${M("err.validation.required")}`)}}:void 0,[u,g,a==null?void 0:a.length,n,M]),L=R??M("message.fileUploadMessage2"),J=s.useMemo(()=>t.jsxRuntimeExports.jsx(Y,{showLoadingIndicator:z,_buttonTitle:L,buttonSize:j,buttonType:x,fileList:a,hidePreview:h,icon:v,loading:b,listType:y,maxCount:E,onChangeFile:T,onRemove:S,showButtonText:f,handlePreview:ie,setFileList:F}),[z,L,j,x,a,h,v,b,y,E,T,S,f]);ne.current=J.props.beforeUpload;const[de,V]=s.useState(0),[xe,W]=s.useState(0),[k,pe]=s.useState();s.useEffect(()=>{const e=setTimeout(()=>{k&&localStorage.setItem("cropper.box",JSON.stringify(k))},400);return()=>clearTimeout(e)},[k]),s.useEffect(()=>{g||(V(0),W(0))},[g]);const $=s.useCallback(async()=>{var o;const e=(o=i==null?void 0:i.current)==null?void 0:o.cropper;if(e){const{width:c,height:d}=e.getCroppedCanvas();pe(e.getCropBoxData()),V(c),W(d)}},[]);return t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsx(ve,{label:n,..._,name:p,className:"mb-0",rules:[ue,..._.rules??[]],children:J}),t.jsxRuntimeExports.jsxs(O.Modal,{open:!!g,maskClosable:!1,onOk:ce,closable:!1,onCancel:le,children:[t.jsxRuntimeExports.jsx(fe.Cropper,{ref:i,src:g,cropmove:$,viewMode:1,aspectRatio:U,cropend:()=>ae()}),t.jsxRuntimeExports.jsx("p",{className:"text-center",children:[de,xe].join(" ⨉ ")}),t.jsxRuntimeExports.jsxs("div",{className:"mt-2 d-flex justify-content-center",children:[t.jsxRuntimeExports.jsx(P,{size:"large",icon:t.jsxRuntimeExports.jsx(Ee,{}),onClick:()=>B(!0)}),t.jsxRuntimeExports.jsx(P,{size:"large",icon:t.jsxRuntimeExports.jsx(we,{}),onClick:()=>B(!1)})]})]}),t.jsxRuntimeExports.jsx(O.Modal,{open:re,title:Z,footer:null,onCancel:oe,children:t.jsxRuntimeExports.jsx("div",{className:"text-center",children:t.jsxRuntimeExports.jsx("img",{alt:"example",style:{maxWidth:"400px"},src:te})})})]})},Y=({_buttonTitle:r,buttonSize:u,buttonType:x,fileList:n,hidePreview:p,icon:m,loading:U,maxCount:R,onChangeFile:h,onRemove:j,showButtonText:f,handlePreview:A,setFileList:v,showLoadingIndicator:b,listType:E="picture"})=>t.jsxRuntimeExports.jsx(t.jsxRuntimeExports.Fragment,{children:t.jsxRuntimeExports.jsxs(O.Upload,{accept:"image/x-png,image/gif,image/jpeg",fileList:n,defaultFileList:n,onChange:()=>{},className:(n.length>=R?" hide-upload ":"")+" mb-0",multiple:!1,onPreview:p?void 0:A,onDrop:l=>(h(l.dataTransfer.files.item(0)),!1),listType:E,showUploadList:!p,onRemove:l=>{const S=n.filter(y=>l.uid!==y.uid);j==null||j(l),v(S)},beforeUpload:async l=>(h(l),!1),maxCount:R,children:[b&&t.jsxRuntimeExports.jsx(Ce,{}),t.jsxRuntimeExports.jsx("div",{className:"d-flex flex-column",children:n.length<R&&(E==="picture-circle"?t.jsxRuntimeExports.jsx(X,{}):t.jsxRuntimeExports.jsx(P,{loading:U,tooltip:f?void 0:r,size:u,icon:m,type:f?x:"text",children:f?r:void 0}))})]},n.length)});exports.UploadComponent=Y;exports.default=be;
@@ -1,285 +0,0 @@
1
- import { j as t } from "../../../../_virtual/jsx-runtime.js";
2
- /* empty css */
3
- /* empty css */
4
- import { Form as Ce, Modal as Z, Upload as ve } from "antd";
5
- import M, { useRef as _, useState as h, useEffect as U, useCallback as q, useMemo as ee } from "react";
6
- import { Cropper as Ie } from "../../../../node_modules/react-cropper/dist/react-cropper.es.js";
7
- import { TRANSLATION_NAMESPACE as be } from "../../../locale/hooks/translation-constants.js";
8
- import z from "../button/Button.js";
9
- import ye from "../../../util/ImageUtil.js";
10
- import { useTranslation as Re } from "../../../../node_modules/react-i18next/dist/es/useTranslation.js";
11
- import Fe from "../../../../node_modules/@ant-design/icons/es/icons/RotateLeftOutlined.js";
12
- import Ne from "../../../../node_modules/@ant-design/icons/es/icons/RotateRightOutlined.js";
13
- import re from "../../../../node_modules/@ant-design/icons/es/icons/UploadOutlined.js";
14
- import Ue from "../../../../node_modules/@ant-design/icons/es/icons/LoadingOutlined.js";
15
- const Se = Ce.Item;
16
- function te(r) {
17
- return new Promise((l, m) => {
18
- const o = new FileReader();
19
- o.readAsDataURL(r), o.onload = () => l(o.result), o.onerror = (p) => m(p);
20
- });
21
- }
22
- const He = ({
23
- values: r = [],
24
- required: l,
25
- buttonType: m,
26
- label: o,
27
- name: p,
28
- onChange: f,
29
- aspectRatio: S,
30
- buttonTitle: j,
31
- hidePreview: w,
32
- buttonSize: u = "large",
33
- showButtonText: g = !0,
34
- showOnlyIcon: B = !1,
35
- icon: b = /* @__PURE__ */ t.jsx(re, {}),
36
- loading: y,
37
- maxCount: C = 1,
38
- onAdd: c,
39
- onRemove: R,
40
- listType: F,
41
- ...E
42
- }) => {
43
- const [oe, se] = M.useState(""), [ne, ie] = M.useState(""), [ae, $] = M.useState(!1), O = _(), n = _(), [i, k] = h([]), [x, A] = h(), ce = _(), le = () => $(!1), de = async (e) => {
44
- !e.url && !e.preview && (e.preview = await te(e.originFileObj)), ie(e.url || e.preview), $(!0), se(e.name);
45
- }, [T, N] = h(!1), me = () => {
46
- }, J = (e) => {
47
- var s;
48
- (s = n == null ? void 0 : n.current) == null || s.cropper.rotate(e ? -90 : 90);
49
- };
50
- U(() => {
51
- f == null || f(i[0], i);
52
- }, [i, f]);
53
- const pe = () => {
54
- var I;
55
- const e = (I = n == null ? void 0 : n.current) == null ? void 0 : I.cropper.getCroppedCanvas(), { type: s, size: a, name: d, uid: v } = O.current;
56
- N(!0), e == null || e.toBlob(async (je) => {
57
- const we = Object.assign(new File([je], d, { type: s }), {
58
- uid: v
59
- }), Q = await ye.resizeImage(we), X = await te(Q), Y = {
60
- url: X,
61
- name: d,
62
- uid: v,
63
- type: s,
64
- size: a,
65
- thumbUrl: X,
66
- originFileObj: Q
67
- };
68
- if (c)
69
- try {
70
- N(!0), await c(Y);
71
- } finally {
72
- N(!1);
73
- }
74
- k([Y, ...i]), N(!1);
75
- }), A(void 0);
76
- }, fe = () => {
77
- A(void 0), O.current = void 0;
78
- }, V = q((e) => {
79
- const s = e;
80
- if (s) {
81
- O.current = s;
82
- const a = new FileReader();
83
- a.addEventListener("load", () => {
84
- var d;
85
- if (typeof a.result == "string") {
86
- A(a.result);
87
- const v = localStorage.getItem("cropper.box"), I = v ? JSON.parse(v) : void 0;
88
- I && ((d = n == null ? void 0 : n.current) == null || d.cropper.setCropBoxData(I)), setTimeout(() => {
89
- K();
90
- }, 100);
91
- }
92
- }), a.readAsDataURL(s);
93
- }
94
- }, []);
95
- U(() => {
96
- if (r != null && r.length || typeof r == "string") {
97
- const e = Array.isArray(r) ? r.map((s) => [{ uid: r, url: s }]) : [{ uid: r, url: r }];
98
- k(e);
99
- }
100
- }, [r]);
101
- const { t: P } = Re(be), ue = ee(
102
- () => l ? {
103
- required: l,
104
- validator: (e, s, a) => {
105
- x || i != null && i.length ? a() : a(`${o ?? ""} ${P("err.validation.required")}`);
106
- }
107
- } : void 0,
108
- [l, x, i == null ? void 0 : i.length, o, P]
109
- ), W = j ?? P("message.fileUploadMessage2"), H = ee(
110
- () => /* @__PURE__ */ t.jsx(
111
- Oe,
112
- {
113
- showLoadingIndicator: T,
114
- _buttonTitle: W,
115
- buttonSize: u,
116
- buttonType: m,
117
- fileList: i,
118
- hidePreview: w,
119
- icon: b,
120
- loading: y,
121
- listType: F,
122
- maxCount: C,
123
- onChangeFile: V,
124
- onRemove: R,
125
- showButtonText: g,
126
- handlePreview: de,
127
- setFileList: k
128
- }
129
- ),
130
- [
131
- T,
132
- W,
133
- u,
134
- m,
135
- i,
136
- w,
137
- b,
138
- y,
139
- F,
140
- C,
141
- V,
142
- R,
143
- g
144
- ]
145
- );
146
- ce.current = H.props.beforeUpload;
147
- const [ge, L] = h(0), [xe, G] = h(0), [D, he] = h();
148
- U(() => {
149
- const e = setTimeout(() => {
150
- D && localStorage.setItem("cropper.box", JSON.stringify(D));
151
- }, 400);
152
- return () => clearTimeout(e);
153
- }, [D]), U(() => {
154
- x || (L(0), G(0));
155
- }, [x]);
156
- const K = q(async () => {
157
- var s;
158
- const e = (s = n == null ? void 0 : n.current) == null ? void 0 : s.cropper;
159
- if (e) {
160
- const { width: a, height: d } = e.getCroppedCanvas();
161
- he(e.getCropBoxData()), L(a), G(d);
162
- }
163
- }, []);
164
- return /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
165
- /* @__PURE__ */ t.jsx(
166
- Se,
167
- {
168
- label: o,
169
- ...E,
170
- name: p,
171
- className: "mb-0",
172
- rules: [ue, ...E.rules ?? []],
173
- children: H
174
- }
175
- ),
176
- /* @__PURE__ */ t.jsxs(
177
- Z,
178
- {
179
- open: !!x,
180
- maskClosable: !1,
181
- onOk: pe,
182
- closable: !1,
183
- onCancel: fe,
184
- children: [
185
- /* @__PURE__ */ t.jsx(
186
- Ie,
187
- {
188
- ref: n,
189
- src: x,
190
- cropmove: K,
191
- viewMode: 1,
192
- aspectRatio: S,
193
- cropend: () => me()
194
- }
195
- ),
196
- /* @__PURE__ */ t.jsx("p", { className: "text-center", children: [ge, xe].join(" ⨉ ") }),
197
- /* @__PURE__ */ t.jsxs("div", { className: "mt-2 d-flex justify-content-center", children: [
198
- /* @__PURE__ */ t.jsx(
199
- z,
200
- {
201
- size: "large",
202
- icon: /* @__PURE__ */ t.jsx(Fe, {}),
203
- onClick: () => J(!0)
204
- }
205
- ),
206
- /* @__PURE__ */ t.jsx(
207
- z,
208
- {
209
- size: "large",
210
- icon: /* @__PURE__ */ t.jsx(Ne, {}),
211
- onClick: () => J(!1)
212
- }
213
- )
214
- ] })
215
- ]
216
- }
217
- ),
218
- /* @__PURE__ */ t.jsx(
219
- Z,
220
- {
221
- open: ae,
222
- title: oe,
223
- footer: null,
224
- onCancel: le,
225
- children: /* @__PURE__ */ t.jsx("div", { className: "text-center", children: /* @__PURE__ */ t.jsx("img", { alt: "example", style: { maxWidth: "400px" }, src: ne }) })
226
- }
227
- )
228
- ] });
229
- }, Oe = ({
230
- _buttonTitle: r,
231
- buttonSize: l,
232
- buttonType: m,
233
- fileList: o,
234
- hidePreview: p,
235
- icon: f,
236
- loading: S,
237
- maxCount: j,
238
- onChangeFile: w,
239
- onRemove: u,
240
- showButtonText: g,
241
- handlePreview: B,
242
- setFileList: b,
243
- showLoadingIndicator: y,
244
- listType: C = "picture"
245
- }) => /* @__PURE__ */ t.jsx(t.Fragment, { children: /* @__PURE__ */ t.jsxs(
246
- ve,
247
- {
248
- accept: "image/x-png,image/gif,image/jpeg",
249
- fileList: o,
250
- defaultFileList: o,
251
- onChange: () => {
252
- },
253
- className: (o.length >= j ? " hide-upload " : "") + " mb-0",
254
- multiple: !1,
255
- onPreview: p ? void 0 : B,
256
- onDrop: (c) => (w(c.dataTransfer.files.item(0)), !1),
257
- listType: C,
258
- showUploadList: !p,
259
- onRemove: (c) => {
260
- const R = o.filter((F) => c.uid !== F.uid);
261
- u == null || u(c), b(R);
262
- },
263
- beforeUpload: async (c) => (w(c), !1),
264
- maxCount: j,
265
- children: [
266
- y && /* @__PURE__ */ t.jsx(Ue, {}),
267
- /* @__PURE__ */ t.jsx("div", { className: "d-flex flex-column", children: o.length < j && (C === "picture-circle" ? /* @__PURE__ */ t.jsx(re, {}) : /* @__PURE__ */ t.jsx(
268
- z,
269
- {
270
- loading: S,
271
- tooltip: g ? void 0 : r,
272
- size: l,
273
- icon: f,
274
- type: g ? m : "text",
275
- children: g ? r : void 0
276
- }
277
- )) })
278
- ]
279
- },
280
- o.length
281
- ) });
282
- export {
283
- Oe as UploadComponent,
284
- He as default
285
- };
@@ -1 +0,0 @@
1
- "use strict";const s=require("../../../../_virtual/jsx-runtime.cjs"),n=require("antd"),i=require("react"),l=({button:m,disabled:c,...t})=>{const a=i.useMemo(()=>{const{enum:e,translations:o}=t;if(e){const r=[];for(const u of e)r.push({key:u,value:(o==null?void 0:o[u])??u.toUpperCase()});return r}else return t.values},[t]),x=m?n.Radio.Button:n.Radio;return s.jsxRuntimeExports.jsx(n.Form.Item,{...t,children:s.jsxRuntimeExports.jsx(n.Radio.Group,{disabled:c,children:a.map(({key:e,value:o})=>s.jsxRuntimeExports.jsx(x,{value:e,children:o},e))})})},R=i.memo(l);module.exports=R;
@@ -1,19 +0,0 @@
1
- import { j as u } from "../../../../_virtual/jsx-runtime.js";
2
- import { Radio as m, Form as i } from "antd";
3
- import { memo as p, useMemo as d } from "react";
4
- const f = ({ button: s, disabled: a, ...n }) => {
5
- const l = d(() => {
6
- const { enum: e, translations: o } = n;
7
- if (e) {
8
- const r = [];
9
- for (const t of e)
10
- r.push({ key: t, value: (o == null ? void 0 : o[t]) ?? t.toUpperCase() });
11
- return r;
12
- } else
13
- return n.values;
14
- }, [n]), c = s ? m.Button : m;
15
- return /* @__PURE__ */ u.jsx(i.Item, { ...n, children: /* @__PURE__ */ u.jsx(m.Group, { disabled: a, children: l.map(({ key: e, value: o }) => /* @__PURE__ */ u.jsx(c, { value: e, children: o }, e)) }) });
16
- }, h = p(f);
17
- export {
18
- h as default
19
- };
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("../../../../_virtual/jsx-runtime.cjs"),o=require("antd"),u=require("react"),j=require("../select/SelectComponent.cjs"),F=({className:a,onSelect:d,label:p,required:S,name:s,mode:l,items:t})=>{const r=o.Form.useFormInstance(),[n,x]=u.useState(!0);return u.useEffect(()=>{if(t&&n){const e=t.filter(i=>i.alreadySelected).map(i=>i.id);r==null||r.setFieldsValue({[s]:l==="multiple"?e:e==null?void 0:e[0]}),x(!1)}},[n,r,t,l,s]),c.jsxRuntimeExports.jsx(j,{required:S,label:p,mode:l,className:a,name:s,onSelect:d,items:t,itemBuilder:e=>c.jsxRuntimeExports.jsx(o.Select.Option,{value:e.id,disabled:e.lock,children:e.label},e.id)})};exports.SelectFieldInReport=F;
@@ -1,30 +0,0 @@
1
- import { j as c } from "../../../../_virtual/jsx-runtime.js";
2
- import { Form as f, Select as m } from "antd";
3
- import { useState as x, useEffect as F } from "react";
4
- import S from "../select/SelectComponent.js";
5
- const R = ({ className: n, onSelect: p, label: u, required: a, name: l, mode: o, items: e }) => {
6
- const r = f.useFormInstance(), [s, d] = x(!0);
7
- return F(() => {
8
- if (e && s) {
9
- const t = e.filter((i) => i.alreadySelected).map((i) => i.id);
10
- r == null || r.setFieldsValue({
11
- [l]: o === "multiple" ? t : t == null ? void 0 : t[0]
12
- }), d(!1);
13
- }
14
- }, [s, r, e, o, l]), /* @__PURE__ */ c.jsx(
15
- S,
16
- {
17
- required: a,
18
- label: u,
19
- mode: o,
20
- className: n,
21
- name: l,
22
- onSelect: p,
23
- items: e,
24
- itemBuilder: (t) => /* @__PURE__ */ c.jsx(m.Option, { value: t.id, disabled: t.lock, children: t.label }, t.id)
25
- }
26
- );
27
- };
28
- export {
29
- R as SelectFieldInReport
30
- };
@@ -1 +0,0 @@
1
- "use strict";const t=require("../../../../_virtual/jsx-runtime.cjs"),s=require("antd"),r=s.List.Item.Meta,x=s.List.Item,o=({title:e,description:i,children:n})=>t.jsxRuntimeExports.jsxs(x,{className:"",children:[t.jsxRuntimeExports.jsx("div",{children:t.jsxRuntimeExports.jsx(r,{title:e,description:i})}),t.jsxRuntimeExports.jsx("div",{className:"float-right",children:n})]});module.exports=o;
@@ -1,13 +0,0 @@
1
- import { j as t } from "../../../../_virtual/jsx-runtime.js";
2
- import { List as s } from "antd";
3
- const r = s.Item.Meta, a = s.Item, n = ({
4
- title: e,
5
- description: o,
6
- children: m
7
- }) => /* @__PURE__ */ t.jsxs(a, { className: "", children: [
8
- /* @__PURE__ */ t.jsx("div", { children: /* @__PURE__ */ t.jsx(r, { title: e, description: o }) }),
9
- /* @__PURE__ */ t.jsx("div", { className: "float-right", children: m })
10
- ] });
11
- export {
12
- n as default
13
- };
@@ -1 +0,0 @@
1
- "use strict";const r=require("../../../../_virtual/jsx-runtime.cjs"),x=require("antd"),k=require("react"),H=require("../../../locale/hooks/translation-constants.cjs"),P=require("../tooltip/TooltipComponent.cjs"),b=require("../../../../node_modules/react-i18next/dist/es/useTranslation.cjs");function B({label:a,rules:E=[],required:R,placeholder:m,notSearch:S,children:u,readOnly:n,items:o,dropdownRender:y,itemBuilder:w,loading:d,showLoadingInEmptyIndicator:T,nameFieldInArray:h="name",innerRef:q,tooltip:L,filterOption:N,tagRender:_,...s}){const{t:A}=b.useTranslation(H.TRANSLATION_NAMESPACE),I=k.useCallback(e=>{const t=typeof e=="string"||typeof e=="number"?e:e==null?void 0:e.id,c=typeof e=="string"||typeof e=="number"?e:e==null?void 0:e[h];return r.jsxRuntimeExports.jsx("option",{value:t,children:r.jsxRuntimeExports.jsx("div",{dangerouslySetInnerHTML:{__html:c}})},t)},[h]);return r.jsxRuntimeExports.jsx(x.ConfigProvider,{renderEmpty:T&&d?()=>r.jsxRuntimeExports.jsx(x.Spin,{}):void 0,children:r.jsxRuntimeExports.jsx(P,{title:L,children:r.jsxRuntimeExports.jsx(x.Form.Item,{label:a,name:s.name,help:s.help,className:s.className,rules:[...E,{required:R,message:`${a??m??""} ${A("err.validation.required")}`}],children:r.jsxRuntimeExports.jsx(x.Select,{ref:q,loading:d,open:n?!1:void 0,onChange:!n&&s.onChange,allowClear:!n&&s.allowClear,showSearch:!S,className:`max-width ${n?"readOnly":""}`,...s,tagRender:_,placeholder:m??a,filterOption:N??((e,t)=>{var c,j,f,C;try{const i=(f=(j=(c=t==null?void 0:t.children)==null?void 0:c.props)==null?void 0:j.dangerouslySetInnerHTML)==null?void 0:f.__html,M=e.toLowerCase().split(/\s+/),g=(t==null?void 0:t.children)??"",p=typeof g=="string"?g.toLowerCase():typeof i=="string"?i.toLowerCase():"",O=(((C=t==null?void 0:t.value)==null?void 0:C.toString())??"").toLowerCase(),$=p.replace(/\s/g,"");return M.every(l=>p.indexOf(l)>=0||O.indexOf(l)>=0||$.indexOf(l)>=0)}catch(i){return console.log(i),!0}}),dropdownRender:y,children:u===null?void 0:u??(o&&(o==null?void 0:o.map(w??I)))})})})})}module.exports=B;