@argusoft/medplat-form-engine 1.0.12 → 1.0.14

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 (121) hide show
  1. package/dist/index.css +1 -1
  2. package/dist/index.js +52390 -3
  3. package/dist/index.js.map +1 -1
  4. package/package.json +4 -1
  5. package/dist/AccessRights-sgIhYR30-Dg6B4KJM.js +0 -1238
  6. package/dist/AccessRights-sgIhYR30-Dg6B4KJM.js.map +0 -1
  7. package/dist/AddEditQueryBuilder-BaZxS2Cm-emLM3Oli.js +0 -289
  8. package/dist/AddEditQueryBuilder-BaZxS2Cm-emLM3Oli.js.map +0 -1
  9. package/dist/AddEditQueryBuilder-BaZxS2Cm.css +0 -1
  10. package/dist/AddFeatures-DLbjDGei-Dg8WYww8.js +0 -212
  11. package/dist/AddFeatures-DLbjDGei-Dg8WYww8.js.map +0 -1
  12. package/dist/AddLabelModal-DE3ploGD-BV_K8Q7c.js +0 -734
  13. package/dist/AddLabelModal-DE3ploGD-BV_K8Q7c.js.map +0 -1
  14. package/dist/AddMenuConfiguration-QWfpcnuP-TAM2c68S.js +0 -5389
  15. package/dist/AddMenuConfiguration-QWfpcnuP-TAM2c68S.js.map +0 -1
  16. package/dist/AddMenuConfiguration-QWfpcnuP.css +0 -1
  17. package/dist/AddRoleDrawer-ZK1eejxI-xMb2iVGk.js +0 -453
  18. package/dist/AddRoleDrawer-ZK1eejxI-xMb2iVGk.js.map +0 -1
  19. package/dist/AppModal-BgZyfrd--CZPgx1UG.js +0 -428
  20. package/dist/AppModal-BgZyfrd--CZPgx1UG.js.map +0 -1
  21. package/dist/ChangePasswordModal-MV7g8tkA-D6c6QM4F.js +0 -176
  22. package/dist/ChangePasswordModal-MV7g8tkA-D6c6QM4F.js.map +0 -1
  23. package/dist/ConditionConfig-GDCXIg3C-COtWwHe3.js +0 -395
  24. package/dist/ConditionConfig-GDCXIg3C-COtWwHe3.js.map +0 -1
  25. package/dist/ConditionConfig-GDCXIg3C.css +0 -1
  26. package/dist/EntityManagement-D-x6Qzal-BE01iKNR.js +0 -50
  27. package/dist/EntityManagement-D-x6Qzal-BE01iKNR.js.map +0 -1
  28. package/dist/EventConfigurations-jGCJ4LqP-B_ftXinp.js +0 -384
  29. package/dist/EventConfigurations-jGCJ4LqP-B_ftXinp.js.map +0 -1
  30. package/dist/EventConfigurations-jGCJ4LqP.css +0 -1
  31. package/dist/EventsExceptionModal-BF6E1Np7-DHT7pQsx.js +0 -200
  32. package/dist/EventsExceptionModal-BF6E1Np7-DHT7pQsx.js.map +0 -1
  33. package/dist/EventsSkeleton-BN7_0IGs-BAnd1Vug.js +0 -74
  34. package/dist/EventsSkeleton-BN7_0IGs-BAnd1Vug.js.map +0 -1
  35. package/dist/FeatureMenu-BYSRoNm0-9p5IIVx2.js +0 -249
  36. package/dist/FeatureMenu-BYSRoNm0-9p5IIVx2.js.map +0 -1
  37. package/dist/Features-CKMmuqcs-ClXAzWGV.js +0 -11
  38. package/dist/Features-CKMmuqcs-ClXAzWGV.js.map +0 -1
  39. package/dist/FlywayQuery-Cx2sly6g-B1LLSyLE.js +0 -169
  40. package/dist/FlywayQuery-Cx2sly6g-B1LLSyLE.js.map +0 -1
  41. package/dist/ImmunizationConfigurationBase-DZ8EqXlF-D645-PAk.js +0 -5162
  42. package/dist/ImmunizationConfigurationBase-DZ8EqXlF-D645-PAk.js.map +0 -1
  43. package/dist/ImmunizationConfigurationBase-DZ8EqXlF.css +0 -1
  44. package/dist/ImmunizationConfigurationsList-CQnxWa09-DIujYt0W.js +0 -335
  45. package/dist/ImmunizationConfigurationsList-CQnxWa09-DIujYt0W.js.map +0 -1
  46. package/dist/ImmunizationSkeleton-D2tdv5k--B7SY-gnr.js +0 -186
  47. package/dist/ImmunizationSkeleton-D2tdv5k--B7SY-gnr.js.map +0 -1
  48. package/dist/LanguagesModal-rk6IGQwY-BaAI1s2W.js +0 -394
  49. package/dist/LanguagesModal-rk6IGQwY-BaAI1s2W.js.map +0 -1
  50. package/dist/ManageDynamicFeature-BKkCnQvF-CinU35NS.js +0 -4189
  51. package/dist/ManageDynamicFeature-BKkCnQvF-CinU35NS.js.map +0 -1
  52. package/dist/ManageEventConfiguration-BJxS2Su0-DBdaQcPo.js +0 -1017
  53. package/dist/ManageEventConfiguration-BJxS2Su0-DBdaQcPo.js.map +0 -1
  54. package/dist/ManageEventConfiguration-BJxS2Su0.css +0 -1
  55. package/dist/ManageNotification-B4prX-9Z-B4mRuGir.js +0 -6819
  56. package/dist/ManageNotification-B4prX-9Z-B4mRuGir.js.map +0 -1
  57. package/dist/ManageRole-BjIIXAlK-DY39p0FD.js +0 -728
  58. package/dist/ManageRole-BjIIXAlK-DY39p0FD.js.map +0 -1
  59. package/dist/ManageTranslation-BTxvSYKb-C2CZwkRN.js +0 -616
  60. package/dist/ManageTranslation-BTxvSYKb-C2CZwkRN.js.map +0 -1
  61. package/dist/ManageTranslation-BTxvSYKb.css +0 -1
  62. package/dist/ManageUser-PHiTNyF8-Bm4bYqvt.js +0 -2160
  63. package/dist/ManageUser-PHiTNyF8-Bm4bYqvt.js.map +0 -1
  64. package/dist/ManageUser-PHiTNyF8.css +0 -1
  65. package/dist/MedplatFormWrapper-CEXGoLC1.js +0 -44520
  66. package/dist/MedplatFormWrapper-CEXGoLC1.js.map +0 -1
  67. package/dist/MedplatFormWrapper.css +0 -1
  68. package/dist/MobileMenuManagement-DmQU5TTo-D7n_NP0X.js +0 -108
  69. package/dist/MobileMenuManagement-DmQU5TTo-D7n_NP0X.js.map +0 -1
  70. package/dist/MobileTypeEventConfigModal-ChhO_A4f-Dpq9010c.js +0 -783
  71. package/dist/MobileTypeEventConfigModal-ChhO_A4f-Dpq9010c.js.map +0 -1
  72. package/dist/NewServerManagement-5YcAtF-g-DHV6PFTR.js +0 -1002
  73. package/dist/NewServerManagement-5YcAtF-g-DHV6PFTR.js.map +0 -1
  74. package/dist/NotificationFlywayQuery-BY8Zzml_-C7G-28dx.js +0 -244
  75. package/dist/NotificationFlywayQuery-BY8Zzml_-C7G-28dx.js.map +0 -1
  76. package/dist/NotificationList-BkpOrCpM-B-vKDGd_.js +0 -400
  77. package/dist/NotificationList-BkpOrCpM-B-vKDGd_.js.map +0 -1
  78. package/dist/OtherTypeEventConfigModal-ZnCGWm9v-CsQiv68d.js +0 -1953
  79. package/dist/OtherTypeEventConfigModal-ZnCGWm9v-CsQiv68d.js.map +0 -1
  80. package/dist/QueryBuilder-Cus_mRwZ-DLXSM32i.js +0 -378
  81. package/dist/QueryBuilder-Cus_mRwZ-DLXSM32i.js.map +0 -1
  82. package/dist/QueryBuilder-Cus_mRwZ.css +0 -1
  83. package/dist/QueryManagement-DXA73N2j-BMDEgiCy.js +0 -671
  84. package/dist/QueryManagement-DXA73N2j-BMDEgiCy.js.map +0 -1
  85. package/dist/QueryManagement-DXA73N2j.css +0 -1
  86. package/dist/RoleManagement-v5Nyp1vr-BsTLfcMm.js +0 -416
  87. package/dist/RoleManagement-v5Nyp1vr-BsTLfcMm.js.map +0 -1
  88. package/dist/ServerSyncModal-uNjGCQJz--PJ3F3xg.js +0 -869
  89. package/dist/ServerSyncModal-uNjGCQJz--PJ3F3xg.js.map +0 -1
  90. package/dist/ShowFlywayQuery-DMsAbtOW-TT9XXzUi.js +0 -130
  91. package/dist/ShowFlywayQuery-DMsAbtOW-TT9XXzUi.js.map +0 -1
  92. package/dist/ShowFlywayQuery-DVRCd384-BypXcNWX.js +0 -259
  93. package/dist/ShowFlywayQuery-DVRCd384-BypXcNWX.js.map +0 -1
  94. package/dist/ShowQueryHistory-BDN0tzHg-17BxK88Z.js +0 -190
  95. package/dist/ShowQueryHistory-BDN0tzHg-17BxK88Z.js.map +0 -1
  96. package/dist/SubMenu-BHcSNSUF-eLmX3DkH.js +0 -187
  97. package/dist/SubMenu-BHcSNSUF-eLmX3DkH.js.map +0 -1
  98. package/dist/TableDetails-DzREeJkm-B-WEBbQz.js +0 -1508
  99. package/dist/TableDetails-DzREeJkm-B-WEBbQz.js.map +0 -1
  100. package/dist/TableList-B9hr05Hs-BIsMbnIV.js +0 -428
  101. package/dist/TableList-B9hr05Hs-BIsMbnIV.js.map +0 -1
  102. package/dist/TypeConfiguration-C-lk8Szs-qaofDyyM.js +0 -117
  103. package/dist/TypeConfiguration-C-lk8Szs-qaofDyyM.js.map +0 -1
  104. package/dist/UserList-BxB1tCwM-7YIwwGQ9.js +0 -13039
  105. package/dist/UserList-BxB1tCwM-7YIwwGQ9.js.map +0 -1
  106. package/dist/UserList-BxB1tCwM.css +0 -1
  107. package/dist/UserListSkeleton-cglK2SaU-B_Tj5gUp.js +0 -184
  108. package/dist/UserListSkeleton-cglK2SaU-B_Tj5gUp.js.map +0 -1
  109. package/dist/WidgetList-BSApErov-D05f9srr.js +0 -188
  110. package/dist/WidgetList-BSApErov-D05f9srr.js.map +0 -1
  111. package/dist/_commonjsHelpers-BItOPCY9-B9tZyK9c.js +0 -29
  112. package/dist/_commonjsHelpers-BItOPCY9-B9tZyK9c.js.map +0 -1
  113. package/dist/i18next-CTOWN_jH-BKKbdDel.js +0 -1389
  114. package/dist/i18next-CTOWN_jH-BKKbdDel.js.map +0 -1
  115. package/dist/index-B4r0wjBD.js +0 -563
  116. package/dist/index-B4r0wjBD.js.map +0 -1
  117. package/dist/index-CnfGzeaj.js +0 -542
  118. package/dist/index-CnfGzeaj.js.map +0 -1
  119. package/dist/manageImmunization-B4swS745-JldexHrO.js +0 -1204
  120. package/dist/manageImmunization-B4swS745-JldexHrO.js.map +0 -1
  121. package/dist/manageImmunization-B4swS745.css +0 -1
@@ -1,616 +0,0 @@
1
- import { jsxs as u, jsx as a } from "react/jsx-runtime";
2
- import { useRef as ye, useState as r, useEffect as be, useCallback as fa, useMemo as q, Suspense as M, createElement as va, lazy as U } from "react";
3
- import { api as m } from "@/common/interceptors/AxiosInterceptor";
4
- import { execute as ya, executeQuery as j } from "@/common/services/GlobalApis";
5
- import { showToast as v } from "@/common/toaster/toaster";
6
- import c from "@mui/material/Grid2";
7
- import { getAssignedFeatures as ba } from "@/utils/feature";
8
- import { FormControl as H, Typography as C, Select as xa, MenuItem as wa, Autocomplete as ka, TextField as xe, Chip as Na, Box as we, Button as A, FormGroup as Ca, FormControlLabel as Aa, Checkbox as Sa } from "@mui/material";
9
- import Ta from "@/hooks/usePagination";
10
- import La from "@/views/custom-components/CustomConfirmationModal";
11
- import { useTranslateProvider as _a } from "@/common/languageTranslator/TranslationContext";
12
- import g from "prop-types";
13
- import { useSelector as F } from "react-redux";
14
- import { getUseSkeleton as E } from "@/store/reducers/SkeletonReducer";
15
- import Ia from "@/views/custom-components/CustomizedTable/CustomizedTableV2";
16
- import { faPen as za, faBars as Ma } from "@fortawesome/free-solid-svg-icons";
17
- import { FontAwesomeIcon as ke } from "@fortawesome/react-fontawesome";
18
- import './ManageTranslation-BTxvSYKb.css';const rl = (n) => m.post("/translation/languages", n), sl = (n) => m.put("/translation/languages", n), ja = () => m.get("/translation/languages"), ol = (n) => m.post("/translation/apps", n), dl = (n) => m.post("/translation/apps", n), Fa = () => m.get("/translation/apps"), cl = (n) => m.post("/translation/labels", n), ul = (n) => m.post("/translation/map", n), pl = (n) => m.post("/translation/mapUpdate", n), Ea = (n, o, h) => {
19
- const O = new URLSearchParams({
20
- key: n,
21
- isActive: o,
22
- app: h
23
- }).toString();
24
- return m.put(`/translation/toggleActive?${O}`, { key: n, isActive: o, app: h });
25
- }, ml = (n, o) => m.get("/translation/translate", { params: { targetLangs: n, englishText: o } }), Ne = ({ children: n, isLoading: o }) => !F(E) || !o ? n : /* @__PURE__ */ u("div", { className: "flex flex-col mt-6 gap-2 w-full", children: [
26
- /* @__PURE__ */ u("div", { className: "flex w-full items-center justify-between space-x-2", children: [
27
- /* @__PURE__ */ u("div", { className: "flex space-x-2", children: [
28
- /* @__PURE__ */ a("div", { className: "bg-gray-300 animate-pulse rounded-sm w-40 h-10" }),
29
- /* @__PURE__ */ a("div", { className: "bg-gray-300 animate-pulse rounded-sm w-40 h-10" }),
30
- /* @__PURE__ */ a("div", { className: "bg-gray-300 animate-pulse rounded-sm w-60 h-10" })
31
- ] }),
32
- /* @__PURE__ */ u("div", { className: "flex space-x-2", children: [
33
- /* @__PURE__ */ a("div", { className: "bg-gray-300 rounded-sm animate-pulse w-40 h-10" }),
34
- /* @__PURE__ */ a("div", { className: "bg-gray-300 rounded-sm animate-pulse w-20 h-10" }),
35
- /* @__PURE__ */ a("div", { className: "bg-gray-300 rounded-sm animate-pulse w-20 h-10" }),
36
- /* @__PURE__ */ a("div", { className: "bg-gray-300 rounded-sm animate-pulse w-20 h-10" })
37
- ] })
38
- ] }),
39
- /* @__PURE__ */ a("div", { className: "bg-gray-300 animate-pulse rounded-sm w-full h-100" })
40
- ] });
41
- Ne.propTypes = {
42
- children: g.any,
43
- isLoading: g.any
44
- };
45
- const Oa = ({ children: n, isLoading: o = !0 }) => !F(E) || !o ? n : /* @__PURE__ */ u("div", { className: "flex flex-col absolute top-10 left-1/2 -translate-x-1/2 w-[95%] sm:w-[600px] md:w-[700px] lg:w-[800px] bg-white shadow-2xl border border-gray-300 rounded-sm h-[60vh]", children: [
46
- /* @__PURE__ */ a("div", { className: "h-15 w-full bg-gray-200 rounded mb-6" }),
47
- /* @__PURE__ */ a("div", { className: "h-10 w-[90%] bg-gray-200 rounded m-4" }),
48
- /* @__PURE__ */ a("div", { className: "h-10 w-[90%] bg-gray-200 rounded m-4" }),
49
- /* @__PURE__ */ a("div", { className: "h-10 w-[90%] bg-gray-200 rounded m-4 " }),
50
- /* @__PURE__ */ a("div", { className: "h-9 w-1/3 bg-gray-200 rounded mt-auto ml-auto mb-2 mr-3" })
51
- ] });
52
- Oa.propTypes = {
53
- children: g.any,
54
- isLoading: g.any
55
- };
56
- const Pa = ({ children: n, isLoading: o = !0 }) => !F(E) || !o ? n : /* @__PURE__ */ a("div", { className: "w-full flex justify-end pb-[10px]", children: /* @__PURE__ */ a("div", { className: "bg-gray-300 animate-pulse rounded-sm h-[32px] w-[100px]" }) });
57
- Pa.propTypes = {
58
- children: g.any,
59
- isLoading: g.any
60
- };
61
- const Va = ({ children: n, isLoading: o = !0 }) => !F(E) || !o ? n : /* @__PURE__ */ a("div", { className: "flex justify-end w-full", children: /* @__PURE__ */ a("div", { className: "bg-gray-300 animate-pulse rounded-sm h-[32px] w-[120px]" }) });
62
- Va.propTypes = {
63
- children: g.any,
64
- isLoading: g.any
65
- };
66
- g.any, g.any;
67
- const Wa = U(() => import("./AppModal-BgZyfrd--CZPgx1UG.js")), Ba = U(() => import("./LanguagesModal-rk6IGQwY-BaAI1s2W.js")), Ra = U(() => import("./AddLabelModal-DE3ploGD-BV_K8Q7c.js"));
68
- function $a() {
69
- const { translate: n } = _a(), o = ye(null), [h, O] = r([]), S = ye(!1), [Ce, G] = r([]), [Ae, J] = r(!1), [Se, P] = r(null), [Te, V] = r(!1), [X, Le] = r([]), [Y, Z] = r(!1), [ee, ae] = r(!1), [le, _e] = r(!0), [f, W] = r(""), [T, Ie] = r([]), [te, k] = r(!1), [ze, B] = r(null), [N, ne] = r(""), [y, ie] = r(""), [x, re] = r(!1), [L, Me] = r({}), [je, R] = r(!1), [Fe, Ee] = r(""), [Oe, Pe] = r(""), [d, Ve] = r({}), [We, se] = r(!1), [Be, oe] = r(null), [de, $] = r(!1), [Re, ce] = r(!1), [_, $e] = r(!1), [De, D] = r(!1), [ue, Ke] = r([]), [b, pe] = r([]), Qe = async () => {
70
- var e;
71
- try {
72
- const l = await ya({
73
- code: "get_distinct_namespce",
74
- parameters: {}
75
- });
76
- Ke((e = l == null ? void 0 : l.data) == null ? void 0 : e.result);
77
- } catch (l) {
78
- console.error(l);
79
- }
80
- };
81
- be(() => {
82
- qe(), Qe();
83
- }, []);
84
- const qe = async () => {
85
- try {
86
- await K();
87
- const { data: e } = await ba(
88
- "techo.manage.manageTranslation"
89
- );
90
- Me(JSON.parse(e));
91
- } catch (e) {
92
- console.error(e), v({ message: "Error in manage Translation", type: "error" });
93
- }
94
- }, K = async () => {
95
- var e, l;
96
- try {
97
- let t = await Fa();
98
- const s = (e = t == null ? void 0 : t.data) == null ? void 0 : e.filter((p) => p.isActive === !0);
99
- O(s), t = await ja();
100
- const i = (l = t == null ? void 0 : t.data) == null ? void 0 : l.filter((p) => p.active === !0);
101
- Ie(i);
102
- } catch (t) {
103
- console.error(t), v({ message: "Error in manage Translation", type: "error" });
104
- }
105
- }, He = (e) => {
106
- var l;
107
- W((l = e == null ? void 0 : e.target) == null ? void 0 : l.value);
108
- }, me = fa((e) => {
109
- const l = (e.match(/{/g) || []).length, t = (e.match(/}/g) || []).length;
110
- l > t || ne(e);
111
- }, []), Ue = (e, l) => {
112
- let t;
113
- return (...s) => {
114
- t && clearTimeout(t), t = setTimeout(() => {
115
- e(...s);
116
- }, l);
117
- };
118
- }, Ge = q(
119
- () => Ue(me, 300),
120
- [me]
121
- ), Je = (e) => {
122
- const { value: l } = e.target;
123
- Ge(l);
124
- }, ge = (e) => {
125
- ie(e);
126
- }, he = [
127
- { field: "Sr. No.", label: "Sr.No", align: "left" },
128
- { field: "Actions", label: "Actions" },
129
- { field: "app", label: "App", align: "left" },
130
- { field: "state", label: "State", align: "left" },
131
- { field: "key", label: "Key", align: "left" }
132
- ];
133
- T == null || T.map(
134
- (e) => {
135
- var l;
136
- return he.push({
137
- field: (l = e == null ? void 0 : e.languageValue) == null ? void 0 : l.toLowerCase(),
138
- label: e == null ? void 0 : e.languageValue,
139
- align: "left"
140
- });
141
- }
142
- );
143
- const Xe = (e) => {
144
- Ee(
145
- (e == null ? void 0 : e.state) === "Active" ? "Mark as Inactive" : "Mark as Active"
146
- ), Pe(
147
- (e == null ? void 0 : e.state) === "Active" ? "Are you sure you want to change the state from active to inactive?" : "Are you sure you want to change the state from inactive to active?"
148
- ), Ve(e);
149
- }, Ye = () => {
150
- R((e) => !e);
151
- }, Ze = async () => {
152
- try {
153
- P({ key: d == null ? void 0 : d.key }), ce(!0), k((e) => !e);
154
- } catch (e) {
155
- console.error(e), v({ message: "Error in opening Add App Modal", type: "error" });
156
- }
157
- }, ea = async () => {
158
- var e, l, t;
159
- try {
160
- let s = {
161
- code: "labels_selected_apps_for_editing",
162
- parameters: { key: d == null ? void 0 : d.key.replace(/'/g, "''") }
163
- };
164
- const i = await j(s);
165
- let p = (e = i == null ? void 0 : i.data) == null ? void 0 : e.result;
166
- B((l = i == null ? void 0 : i.data) == null ? void 0 : l.result);
167
- let ma = {
168
- code: "labels_app_data_for_prepopulating",
169
- parameters: {
170
- key: d == null ? void 0 : d.key,
171
- appValue: d == null ? void 0 : d.app
172
- }
173
- }, ga = p.map((w) => w.app), ve = h.filter((w) => ga.indexOf(w.id) === -1);
174
- if (ve.length > 0) {
175
- const w = await j(ma);
176
- P((t = w == null ? void 0 : w.data) == null ? void 0 : t.result), G(ve), J(!0), k((ha) => !ha);
177
- } else
178
- v({
179
- message: "Label already present in all apps",
180
- type: "info"
181
- });
182
- } catch (s) {
183
- console.error(s), v({ message: "Error in opening Add App Modal", type: "error" });
184
- }
185
- }, aa = async () => {
186
- try {
187
- let e = (d == null ? void 0 : d.state) === "Active";
188
- await Ea(d == null ? void 0 : d.key, !e, d == null ? void 0 : d.appId), z(), R((l) => !l);
189
- } catch (e) {
190
- console.error(e), v({ message: "Error in Toggle State", type: "error" });
191
- }
192
- }, la = async (e) => {
193
- var l;
194
- try {
195
- V(!0), k((i) => !i), se((i) => !i);
196
- let t = e == null ? void 0 : e.key.replace(/'/g, "''");
197
- oe(t);
198
- const s = await j({
199
- code: "labels_selected_apps_for_editing",
200
- parameters: { key: t }
201
- });
202
- B((l = s == null ? void 0 : s.data) == null ? void 0 : l.result), V(!1);
203
- } catch (t) {
204
- console.error(t), v({ message: "Error in Editing label", type: "error" }), V(!1);
205
- }
206
- }, ta = [
207
- { label: n(Fe), onClick: Ye },
208
- { label: n("Add app"), onClick: ea },
209
- { label: n("Add Namespace"), onClick: Ze }
210
- ], na = [
211
- {
212
- label: "",
213
- icon: /* @__PURE__ */ a(ke, { icon: za }),
214
- onClick: la,
215
- condition: (e) => (e == null ? void 0 : e.state) !== "Inactive",
216
- dataTestId: "manage-translation-edit-icon"
217
- },
218
- {
219
- label: "",
220
- icon: /* @__PURE__ */ a(ke, { icon: Ma }),
221
- menuClick: Xe,
222
- dataTestId: "manage-translation-menu-icon",
223
- menuItems: ta
224
- }
225
- ], ia = () => {
226
- Z((e) => !e);
227
- }, ra = () => {
228
- ae((e) => !e);
229
- }, sa = () => {
230
- k((e) => !e), G(h);
231
- }, Q = (e) => e == null ? e : e.replace(/'/g, "''"), oa = async (e, l) => {
232
- var t;
233
- try {
234
- l && !_ ? (S.current = !0, $(!0)) : l && _ && D(!0);
235
- let s = {
236
- code: "fetch_labels_translation_translation_master",
237
- parameters: {
238
- appId: f || null,
239
- searchString: Q(N || ""),
240
- startsWith: Q(y || ""),
241
- namespaceArray: b.length > 0 ? b.map((p) => Q(p)).join(",") : "",
242
- showInactive: x || !1,
243
- limit: (e == null ? void 0 : e.limit) || 100,
244
- offset: (e == null ? void 0 : e.offset) || 0
245
- }
246
- };
247
- const i = await j(s);
248
- return (t = i == null ? void 0 : i.data) == null ? void 0 : t.result;
249
- } catch (s) {
250
- S.current = !1, console.error(s), D(!1), $(!1), v({ message: "Error in loading data", type: "error" });
251
- }
252
- }, fe = q(() => N === "" && y === "" && x === !1 && f === "" && b.length === 0, [N, y, x, f, b]), da = q(
253
- () => [
254
- "translation",
255
- f,
256
- N,
257
- y,
258
- x,
259
- b
260
- ],
261
- [f, N, y, x, b]
262
- ), {
263
- data: I,
264
- fetchNextPage: ca,
265
- hasNextPage: ua,
266
- refetch: z
267
- } = Ta({
268
- key: da,
269
- queryFn: ({ pageParam: e }) => {
270
- const l = !_, t = (!(e != null && e.offset) || (e == null ? void 0 : e.offset) === 0) && l;
271
- return oa(e, t);
272
- },
273
- limit: 100
274
- });
275
- be(() => {
276
- var e;
277
- if (I) {
278
- let l = ((e = I == null ? void 0 : I.pages) == null ? void 0 : e.flat()) || [];
279
- const t = Object.values(
280
- l == null ? void 0 : l.reduce((s, i) => {
281
- const p = (i == null ? void 0 : i.key) + "-" + (i == null ? void 0 : i.app);
282
- return s[p] || (s[p] = {
283
- appId: i == null ? void 0 : i.appid,
284
- key: i == null ? void 0 : i.key,
285
- app: i == null ? void 0 : i.app,
286
- state: i != null && i.is_active ? "Active" : "Inactive"
287
- }), s[p][i == null ? void 0 : i.language.toLowerCase()] = i == null ? void 0 : i.value, i != null && i.is_active && (s[p].state = "Active"), s;
288
- }, {})
289
- );
290
- _e(ua), Le(t), S.current && (_ ? D(!1) : ($(!1), $e(!0)), S.current = !1);
291
- }
292
- }, [I]);
293
- const pa = () => {
294
- ne(""), ie(""), re(!1), W(""), pe([]), o.current.value = "";
295
- };
296
- return /* @__PURE__ */ u(c, { container: !0, mt: 3, spacing: 2, children: [
297
- /* @__PURE__ */ a(M, { children: Y && /* @__PURE__ */ a(
298
- Wa,
299
- {
300
- open: Y,
301
- handleClose: () => Z((e) => !e),
302
- languages: T,
303
- refresh: K,
304
- refetch: z,
305
- selectedApp: f,
306
- setSelectedApp: W
307
- }
308
- ) }),
309
- /* @__PURE__ */ a(M, { children: ee && /* @__PURE__ */ a(
310
- Ba,
311
- {
312
- open: ee,
313
- handleClose: () => {
314
- ae((e) => !e);
315
- },
316
- refresh: K,
317
- refetch: z
318
- }
319
- ) }),
320
- /* @__PURE__ */ a(M, { children: te && /* @__PURE__ */ a(
321
- Ra,
322
- {
323
- open: te,
324
- handleClose: () => {
325
- k((e) => !e), J(!1), ce(!1), B(null), P(null), se(!1), oe(null);
326
- },
327
- apps: Ce,
328
- addAppFlag: Ae,
329
- addNameSpaceFlag: Re,
330
- languageList: T,
331
- editLabel: ze,
332
- fieldsData: Se,
333
- editLabelFlag: We,
334
- labelKey: Be,
335
- refetch: z,
336
- isLoading: Te
337
- }
338
- ) }),
339
- /* @__PURE__ */ a(M, {}),
340
- /* @__PURE__ */ a(
341
- La,
342
- {
343
- description: Oe,
344
- title: "CONFIRM ACTION",
345
- handleClick: aa,
346
- open: je,
347
- handleClose: () => {
348
- R((e) => !e);
349
- },
350
- "data-testid": "manageTranslation-modal-customconfirmation"
351
- }
352
- ),
353
- /* @__PURE__ */ a(c, { container: !0, spacing: 1, className: "grow", children: /* @__PURE__ */ u(Ne, { isLoading: de, children: [
354
- /* @__PURE__ */ a(c, { size: { xs: 6, sm: 6, md: 3 }, children: /* @__PURE__ */ u(H, { variant: "outlined", fullWidth: !0, children: [
355
- /* @__PURE__ */ a(C, { className: "pl-2", children: /* @__PURE__ */ a("span", { children: n("App") }) }),
356
- /* @__PURE__ */ a(
357
- xa,
358
- {
359
- value: f,
360
- onChange: He,
361
- size: "small",
362
- displayEmpty: !0,
363
- sx: {
364
- bgcolor: "background.paper",
365
- color: f ? "text.primary" : "text.disabled"
366
- // gray when empty
367
- },
368
- renderValue: (e) => {
369
- var l;
370
- return e ? (l = h.find((t) => t.id === e)) == null ? void 0 : l.appValue : "Select App";
371
- },
372
- children: h == null ? void 0 : h.map((e) => /* @__PURE__ */ a(wa, { value: e == null ? void 0 : e.id, children: e == null ? void 0 : e.appValue }, e == null ? void 0 : e.id))
373
- }
374
- )
375
- ] }) }),
376
- /* @__PURE__ */ a(c, { size: { xs: 6, sm: 6, md: 3 }, children: /* @__PURE__ */ u(H, { variant: "outlined", fullWidth: !0, children: [
377
- /* @__PURE__ */ a(C, { className: "", children: /* @__PURE__ */ a("span", { children: n("Name Spaces") }) }),
378
- /* @__PURE__ */ a(
379
- ka,
380
- {
381
- multiple: !0,
382
- options: ue ?? [],
383
- getOptionLabel: (e) => (e == null ? void 0 : e.label) ?? "",
384
- value: ue.filter(
385
- (e) => b.includes(e.value)
386
- ),
387
- onChange: (e, l) => {
388
- pe(l.map((t) => t.value));
389
- },
390
- filterSelectedOptions: !0,
391
- disableCloseOnSelect: !0,
392
- size: "small",
393
- renderTags: (e, l) => e.map((t, s) => /* @__PURE__ */ va(
394
- Na,
395
- {
396
- variant: "outlined",
397
- size: "small",
398
- label: t.label,
399
- ...l({ index: s }),
400
- key: t.label,
401
- sx: {
402
- bgcolor: "action.hover"
403
- }
404
- }
405
- )),
406
- renderInput: (e) => /* @__PURE__ */ a(
407
- xe,
408
- {
409
- ...e,
410
- placeholder: "Select Name Space",
411
- sx: { bgcolor: "background.paper" },
412
- "data-testid": "autocomplete-namespace"
413
- }
414
- )
415
- }
416
- )
417
- ] }) }),
418
- /* @__PURE__ */ a(c, { size: { xs: 6, sm: 6, md: 3 }, children: /* @__PURE__ */ u(H, { variant: "outlined", fullWidth: !0, children: [
419
- /* @__PURE__ */ a(C, { sx: { pl: 1 }, children: /* @__PURE__ */ u("span", { children: [
420
- n("Search For"),
421
- ":"
422
- ] }) }),
423
- /* @__PURE__ */ a(
424
- xe,
425
- {
426
- inputRef: o,
427
- name: "searchQuery",
428
- id: "searchQuery",
429
- placeholder: "Enter Search Value",
430
- size: "small",
431
- onChange: Je,
432
- sx: { bgcolor: "background.paper" },
433
- "data-testid": "managetranslation-search-textfield"
434
- }
435
- )
436
- ] }) }),
437
- /* @__PURE__ */ a(
438
- c,
439
- {
440
- size: { xs: 12, sm: 12, md: 2 },
441
- sx: {
442
- display: "flex",
443
- mt: 3,
444
- justifyContent: "end",
445
- alignItems: "center"
446
- },
447
- children: /* @__PURE__ */ a(we, { children: /* @__PURE__ */ a(
448
- A,
449
- {
450
- variant: "contained",
451
- disabled: fe,
452
- sx: {
453
- lineHeight: "35px",
454
- ml: 1,
455
- mt: 1,
456
- display: "inline-block",
457
- ...fe ? {} : {
458
- bgcolor: "error.main",
459
- color: "error.contrastText",
460
- "&:hover": { bgcolor: "error.dark" }
461
- }
462
- },
463
- onClick: pa,
464
- children: "Clear All Filters"
465
- }
466
- ) })
467
- }
468
- ),
469
- /* @__PURE__ */ a(
470
- c,
471
- {
472
- size: { xs: 12, sm: 12, md: 6.5 },
473
- sx: {
474
- pl: 1,
475
- display: "flex",
476
- justifyContent: "start",
477
- alignItems: "center"
478
- },
479
- children: /* @__PURE__ */ u(we, { className: "overflow-x-auto whitespace-nowrap", children: [
480
- /* @__PURE__ */ a(C, { className: "pb-[7px]", children: /* @__PURE__ */ u("span", { children: [
481
- n("Starts With"),
482
- ":"
483
- ] }) }),
484
- Array.from({ length: 26 }, (e, l) => {
485
- const t = String.fromCharCode(65 + l);
486
- return /* @__PURE__ */ a(
487
- C,
488
- {
489
- component: "span",
490
- className: `${y === t ? "selected-letter" : "letter-style"} inline-block cursor-pointer`,
491
- onClick: () => ge(t),
492
- children: t
493
- },
494
- t
495
- );
496
- }),
497
- /* @__PURE__ */ a(
498
- A,
499
- {
500
- variant: "contained",
501
- color: "secondary",
502
- disabled: y.length === 0,
503
- className: "x-button ml-2 inline-block",
504
- onClick: () => ge(""),
505
- children: "×"
506
- }
507
- )
508
- ] })
509
- }
510
- ),
511
- /* @__PURE__ */ a(
512
- c,
513
- {
514
- size: { xs: 12, sm: 12, md: 5.5 },
515
- display: "flex",
516
- alignItems: "center",
517
- children: /* @__PURE__ */ u(
518
- c,
519
- {
520
- container: !0,
521
- justifyContent: "flex-end",
522
- alignItems: "center",
523
- spacing: 1,
524
- children: [
525
- /* @__PURE__ */ a(c, { item: "true", children: /* @__PURE__ */ a(Ca, { children: /* @__PURE__ */ a(
526
- Aa,
527
- {
528
- control: /* @__PURE__ */ a(
529
- Sa,
530
- {
531
- checked: x,
532
- onChange: (e) => re(e.target.checked)
533
- }
534
- ),
535
- label: `${n("Show Inactive")}`,
536
- labelPlacement: "end",
537
- className: "translation-inactive"
538
- }
539
- ) }) }),
540
- /* @__PURE__ */ a(c, { item: "true", children: (L == null ? void 0 : L.canManage) && /* @__PURE__ */ a(
541
- A,
542
- {
543
- size: "small",
544
- variant: "contained",
545
- "data-testid": "manageTranslation-manage-apps-button",
546
- color: "primary",
547
- onClick: ia,
548
- children: n("Manage Apps")
549
- }
550
- ) }),
551
- /* @__PURE__ */ a(c, { item: "true", children: (L == null ? void 0 : L.canManage) && /* @__PURE__ */ a(
552
- A,
553
- {
554
- size: "small",
555
- variant: "contained",
556
- "data-testid": "managetranslation-manage-language-button",
557
- onClick: ra,
558
- children: n("Manage Language")
559
- }
560
- ) }),
561
- /* @__PURE__ */ a(c, { item: "true", children: /* @__PURE__ */ a(
562
- A,
563
- {
564
- size: "small",
565
- variant: "contained",
566
- "data-testid": "manageTranalation-add-label-button",
567
- onClick: sa,
568
- children: n("Add Label")
569
- }
570
- ) })
571
- ]
572
- }
573
- )
574
- }
575
- ),
576
- /* @__PURE__ */ a(c, { className: "mt-2", size: { xs: 12 }, children: /* @__PURE__ */ a(
577
- Ia,
578
- {
579
- columns: he,
580
- tableData: X,
581
- actions: na,
582
- paginationConfig: {
583
- pagination: !0,
584
- paginationType: "infinite-scroll",
585
- loadMore: () => le && ca({ cancelRefetch: !1 }),
586
- hasMore: le
587
- },
588
- dataTestId: "manageTranslation-table",
589
- isLoading: X ? de || De : !1,
590
- styleConfig: { tableStyle: { maxHeight: 120 } }
591
- }
592
- ) })
593
- ] }) })
594
- ] });
595
- }
596
- const gl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
597
- __proto__: null,
598
- default: $a
599
- }, Symbol.toStringTag, { value: "Module" }));
600
- export {
601
- Pa as A,
602
- Va as L,
603
- gl as M,
604
- ja as a,
605
- sl as b,
606
- ol as c,
607
- rl as d,
608
- Oa as e,
609
- cl as f,
610
- Fa as g,
611
- ul as h,
612
- pl as i,
613
- ml as t,
614
- dl as u
615
- };
616
- //# sourceMappingURL=ManageTranslation-BTxvSYKb-C2CZwkRN.js.map