@digi-frontend/dgate-api-documentation 1.0.39 → 1.0.47

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 (353) hide show
  1. package/.editorconfig +12 -12
  2. package/.prettierignore +7 -7
  3. package/.prettierrc +15 -15
  4. package/dist/{a7568b270e175038.svg → 070dc6ecd197bc80.svg} +8 -8
  5. package/dist/16702d92fd6d1730.svg +6 -0
  6. package/dist/2b546d6e9fdf604a.svg +3 -0
  7. package/dist/2c3c6c2c3b835504.svg +5 -0
  8. package/dist/{43595976d1fdccbf.svg → 2e10bbdb265df50e.svg} +4 -4
  9. package/dist/55b5994c5781482b.svg +5 -0
  10. package/dist/60bef8083c55f46b.svg +6 -0
  11. package/dist/68c710e0583e19e6.svg +5 -0
  12. package/dist/731221b3f242672d.svg +4 -0
  13. package/dist/{b82c7612e73342f3.svg → 7f54eeb0bb2d1150.svg} +3 -3
  14. package/dist/8520b6792278d9df.svg +6 -0
  15. package/dist/{56dc416b683db280.svg → 8789eb84283ea95b.svg} +5 -5
  16. package/dist/9506ef7a26a74147.svg +12 -0
  17. package/dist/9b7aee27757b5036.svg +3 -0
  18. package/dist/{af16a554be8c4d69.svg → 9bdff13f8d8fa48a.svg} +3 -3
  19. package/dist/_virtual/index3.js +1 -1
  20. package/dist/_virtual/index4.js +1 -1
  21. package/dist/_virtual/index5.js +1 -1
  22. package/dist/{64efc2716808c4a4.svg → bb8b87cace25e052.svg} +3 -3
  23. package/dist/cceb1e5dc06b0b85.svg +4 -0
  24. package/dist/d140a601c85bac25.svg +3 -0
  25. package/dist/{72db3b05a96dd600.svg → d32ce84bbd78babd.svg} +3 -3
  26. package/dist/{844eba3f2e42a9eb.svg → d501922060662842.svg} +3 -3
  27. package/dist/d6d0a98ec38e6b77.svg +3 -0
  28. package/dist/e04479ad425e7d58.svg +4 -0
  29. package/dist/f4a32992f02af522.svg +5 -0
  30. package/dist/node_modules/dom-serializer/lib/foreignNames.js +2 -0
  31. package/dist/node_modules/dom-serializer/lib/foreignNames.js.map +1 -0
  32. package/dist/node_modules/dom-serializer/lib/index.js +2 -0
  33. package/dist/node_modules/dom-serializer/lib/index.js.map +1 -0
  34. package/dist/node_modules/dom-serializer/node_modules/entities/lib/decode.js +2 -0
  35. package/dist/node_modules/dom-serializer/node_modules/entities/lib/decode.js.map +1 -0
  36. package/dist/node_modules/dom-serializer/node_modules/entities/lib/decode_codepoint.js +2 -0
  37. package/dist/node_modules/dom-serializer/node_modules/entities/lib/decode_codepoint.js.map +1 -0
  38. package/dist/node_modules/dom-serializer/node_modules/entities/lib/encode.js +2 -0
  39. package/dist/node_modules/dom-serializer/node_modules/entities/lib/encode.js.map +1 -0
  40. package/dist/node_modules/dom-serializer/node_modules/entities/lib/escape.js +2 -0
  41. package/dist/node_modules/dom-serializer/node_modules/entities/lib/escape.js.map +1 -0
  42. package/dist/node_modules/dom-serializer/node_modules/entities/lib/generated/decode-data-html.js +2 -0
  43. package/dist/node_modules/dom-serializer/node_modules/entities/lib/generated/decode-data-html.js.map +1 -0
  44. package/dist/node_modules/dom-serializer/node_modules/entities/lib/generated/decode-data-xml.js +2 -0
  45. package/dist/node_modules/dom-serializer/node_modules/entities/lib/generated/decode-data-xml.js.map +1 -0
  46. package/dist/node_modules/dom-serializer/node_modules/entities/lib/generated/encode-html.js +2 -0
  47. package/dist/node_modules/dom-serializer/node_modules/entities/lib/generated/encode-html.js.map +1 -0
  48. package/dist/node_modules/dom-serializer/node_modules/entities/lib/index.js +2 -0
  49. package/dist/node_modules/dom-serializer/node_modules/entities/lib/index.js.map +1 -0
  50. package/dist/node_modules/domhandler/lib/index.js +2 -0
  51. package/dist/node_modules/domhandler/lib/index.js.map +1 -0
  52. package/dist/node_modules/domhandler/lib/node.js +2 -0
  53. package/dist/node_modules/domhandler/lib/node.js.map +1 -0
  54. package/dist/node_modules/domutils/lib/feeds.js +2 -0
  55. package/dist/node_modules/domutils/lib/feeds.js.map +1 -0
  56. package/dist/node_modules/domutils/lib/helpers.js +2 -0
  57. package/dist/node_modules/domutils/lib/helpers.js.map +1 -0
  58. package/dist/node_modules/domutils/lib/index.js +2 -0
  59. package/dist/node_modules/domutils/lib/index.js.map +1 -0
  60. package/dist/node_modules/domutils/lib/legacy.js +2 -0
  61. package/dist/node_modules/domutils/lib/legacy.js.map +1 -0
  62. package/dist/node_modules/domutils/lib/manipulation.js +2 -0
  63. package/dist/node_modules/domutils/lib/manipulation.js.map +1 -0
  64. package/dist/node_modules/domutils/lib/querying.js +2 -0
  65. package/dist/node_modules/domutils/lib/querying.js.map +1 -0
  66. package/dist/node_modules/domutils/lib/stringify.js +2 -0
  67. package/dist/node_modules/domutils/lib/stringify.js.map +1 -0
  68. package/dist/node_modules/domutils/lib/traversal.js +2 -0
  69. package/dist/node_modules/domutils/lib/traversal.js.map +1 -0
  70. package/dist/node_modules/entities/dist/commonjs/decode-codepoint.js +2 -0
  71. package/dist/node_modules/entities/dist/commonjs/decode-codepoint.js.map +1 -0
  72. package/dist/node_modules/entities/dist/commonjs/decode.js +2 -0
  73. package/dist/node_modules/entities/dist/commonjs/decode.js.map +1 -0
  74. package/dist/node_modules/entities/dist/commonjs/generated/decode-data-html.js +2 -0
  75. package/dist/node_modules/entities/dist/commonjs/generated/decode-data-html.js.map +1 -0
  76. package/dist/node_modules/entities/dist/commonjs/generated/decode-data-xml.js +2 -0
  77. package/dist/node_modules/entities/dist/commonjs/generated/decode-data-xml.js.map +1 -0
  78. package/dist/node_modules/html-dom-parser/lib/server/html-to-dom.js +1 -1
  79. package/dist/node_modules/html-dom-parser/lib/server/html-to-dom.js.map +1 -1
  80. package/dist/node_modules/html-react-parser/lib/index.js +1 -1
  81. package/dist/node_modules/html-react-parser/lib/index.js.map +1 -1
  82. package/dist/node_modules/htmlparser2/dist/commonjs/Parser.js +1 -1
  83. package/dist/node_modules/htmlparser2/dist/commonjs/Parser.js.map +1 -1
  84. package/dist/node_modules/htmlparser2/dist/commonjs/Tokenizer.js +1 -1
  85. package/dist/node_modules/htmlparser2/dist/commonjs/Tokenizer.js.map +1 -1
  86. package/dist/node_modules/htmlparser2/dist/commonjs/index.js +1 -1
  87. package/dist/node_modules/htmlparser2/dist/commonjs/index.js.map +1 -1
  88. package/dist/node_modules/style-to-object/cjs/index.js +1 -1
  89. package/dist/node_modules/toposort/index.js +1 -1
  90. package/dist/node_modules/yup/index.esm.js +1 -1
  91. package/dist/src/assets/icons/AddRow.svg.js +1 -1
  92. package/dist/src/assets/icons/AddRow.svg.js.map +1 -1
  93. package/dist/src/assets/icons/ApiIcon.svg.js +2 -0
  94. package/dist/src/assets/icons/ApiIcon.svg.js.map +1 -0
  95. package/dist/src/assets/icons/ArrowBack.svg.js +2 -0
  96. package/dist/src/assets/icons/ArrowBack.svg.js.map +1 -0
  97. package/dist/src/assets/icons/BookIcon.svg.js +2 -0
  98. package/dist/src/assets/icons/BookIcon.svg.js.map +1 -0
  99. package/dist/src/assets/icons/CopySticker.svg.js +2 -0
  100. package/dist/src/assets/icons/CopySticker.svg.js.map +1 -0
  101. package/dist/src/assets/icons/DeleteIcon.svg.js +1 -1
  102. package/dist/src/assets/icons/DeleteIcon.svg.js.map +1 -1
  103. package/dist/src/assets/icons/DeleteOutlinedIcon.svg.js +2 -0
  104. package/dist/src/assets/icons/DeleteOutlinedIcon.svg.js.map +1 -0
  105. package/dist/src/assets/icons/DownArrow.svg.js +1 -1
  106. package/dist/src/assets/icons/DownArrow.svg.js.map +1 -1
  107. package/dist/src/assets/icons/EditIcon.svg.js +1 -1
  108. package/dist/src/assets/icons/EditIcon.svg.js.map +1 -1
  109. package/dist/src/assets/icons/FilterIcon.svg.js +2 -0
  110. package/dist/src/assets/icons/FilterIcon.svg.js.map +1 -0
  111. package/dist/src/assets/icons/Plus.svg.js +2 -0
  112. package/dist/src/assets/icons/Plus.svg.js.map +1 -0
  113. package/dist/src/assets/icons/PlusSquare.svg.js +2 -0
  114. package/dist/src/assets/icons/PlusSquare.svg.js.map +1 -0
  115. package/dist/src/assets/icons/RequestOption.svg.js +2 -0
  116. package/dist/src/assets/icons/RequestOption.svg.js.map +1 -0
  117. package/dist/src/assets/icons/arrowDownGray.svg.js +2 -0
  118. package/dist/src/assets/icons/arrowDownGray.svg.js.map +1 -0
  119. package/dist/src/assets/icons/arrowRightGray.svg.js +2 -0
  120. package/dist/src/assets/icons/arrowRightGray.svg.js.map +1 -0
  121. package/dist/src/assets/icons/close-circle.svg.js +2 -0
  122. package/dist/src/assets/icons/close-circle.svg.js.map +1 -0
  123. package/dist/src/assets/icons/document.svg.js +2 -0
  124. package/dist/src/assets/icons/document.svg.js.map +1 -0
  125. package/dist/src/assets/icons/eye.svg.js +2 -0
  126. package/dist/src/assets/icons/eye.svg.js.map +1 -0
  127. package/dist/src/assets/icons/infoIcon.svg.js +2 -0
  128. package/dist/src/assets/icons/infoIcon.svg.js.map +1 -0
  129. package/dist/src/assets/icons/searchIcon.svg.js +2 -0
  130. package/dist/src/assets/icons/searchIcon.svg.js.map +1 -0
  131. package/dist/src/components/InfoForm/InfoForm.js +1 -1
  132. package/dist/src/components/InfoForm/InfoForm.js.map +1 -1
  133. package/dist/src/components/JsonInput/JsonInput.js.map +1 -1
  134. package/dist/src/components/LivePreview/LivePreview.js +1 -1
  135. package/dist/src/components/LivePreview/LivePreview.js.map +1 -1
  136. package/dist/src/components/MethodAccordion/MethodAccordion.js +1 -1
  137. package/dist/src/components/MethodAccordion/MethodAccordion.js.map +1 -1
  138. package/dist/src/components/SVGLoader/SVGLoader.js.map +1 -1
  139. package/dist/src/components/SectionHead/SectionHead.js.map +1 -1
  140. package/dist/src/components/SimpleLabelValue/SimpleLabelValue.js.map +1 -1
  141. package/dist/src/components/Tooltip/Tooltip.js.map +1 -1
  142. package/dist/src/components/dialog/index.js +1 -1
  143. package/dist/src/components/dialog/index.js.map +1 -1
  144. package/dist/src/components/table/table.js +1 -1
  145. package/dist/src/components/table/table.js.map +1 -1
  146. package/dist/src/components/table/tags-table.js.map +1 -1
  147. package/dist/src/constants/index.js +1 -1
  148. package/dist/src/constants/index.js.map +1 -1
  149. package/dist/src/constants/methods.constant.js +2 -0
  150. package/dist/src/constants/methods.constant.js.map +1 -0
  151. package/dist/src/constants/regex.js.map +1 -1
  152. package/dist/src/helpers/layout.helper.js +1 -1
  153. package/dist/src/helpers/layout.helper.js.map +1 -1
  154. package/dist/src/helpers/methodAccordion.helper.js.map +1 -1
  155. package/dist/src/index.js +1 -1
  156. package/dist/src/layout/docsComponents/DocsAside/DocsAside.js +2 -0
  157. package/dist/src/layout/docsComponents/DocsAside/DocsAside.js.map +1 -0
  158. package/dist/src/layout/docsComponents/DocsContent/DocsContent.js +2 -0
  159. package/dist/src/layout/docsComponents/DocsContent/DocsContent.js.map +1 -0
  160. package/dist/src/layout/docsComponents/DocsContent/EndpointPage/index.js +2 -0
  161. package/dist/src/layout/docsComponents/DocsContent/EndpointPage/index.js.map +1 -0
  162. package/dist/src/layout/docsComponents/DocsHeader/DocsHeader.js +2 -0
  163. package/dist/src/layout/docsComponents/DocsHeader/DocsHeader.js.map +1 -0
  164. package/dist/src/layout/docsComponents/DocsHeader/DocsHeader.module.scss.js +2 -0
  165. package/dist/src/layout/docsComponents/DocsHeader/DocsHeader.module.scss.js.map +1 -0
  166. package/dist/src/layout/docsComponents/DocsSideMenuTree/DocsSideMenuTree.js +2 -0
  167. package/dist/src/layout/docsComponents/DocsSideMenuTree/DocsSideMenuTree.js.map +1 -0
  168. package/dist/src/layout/docsComponents/index.js +2 -0
  169. package/dist/src/layout/docsComponents/index.js.map +1 -0
  170. package/dist/src/layout/docsLayout.js +2 -0
  171. package/dist/src/layout/docsLayout.js.map +1 -0
  172. package/dist/src/layout/layout.js +1 -1
  173. package/dist/src/layout/layout.js.map +1 -1
  174. package/dist/src/validator/form.scheme.js +1 -1
  175. package/dist/src/validator/form.scheme.js.map +1 -1
  176. package/dist/styles.css +1436 -368
  177. package/dist/types/assets/icons/index.d.ts +16 -1
  178. package/dist/types/components/LivePreview/LivePreview.d.ts +1 -0
  179. package/dist/types/components/MethodAccordion/MethodAccordion.d.ts +2 -1
  180. package/dist/types/components/dialog/dialog.d.ts +3 -0
  181. package/dist/types/components/table/table.d.ts +2 -1
  182. package/dist/types/constants/methods.constant.d.ts +16 -0
  183. package/dist/types/helpers/docs.helper.d.ts +3 -0
  184. package/dist/types/index.d.ts +1 -0
  185. package/dist/types/layout/docsComponents/DocsAside/DocsAside.d.ts +3 -0
  186. package/dist/types/layout/docsComponents/DocsContent/DocsContent.d.ts +3 -0
  187. package/dist/types/layout/docsComponents/DocsContent/EndpointPage/index.d.ts +2 -0
  188. package/dist/types/layout/docsComponents/DocsContent/TagPage/index.d.ts +2 -0
  189. package/dist/types/layout/docsComponents/DocsHeader/DocsHeader.d.ts +3 -0
  190. package/dist/types/layout/docsComponents/DocsSideMenuTree/DocsSideMenuTree.d.ts +8 -0
  191. package/dist/types/layout/docsComponents/index.d.ts +17 -0
  192. package/dist/types/layout/docsLayout.d.ts +33 -0
  193. package/dist/types/layout/layout.d.ts +2 -1
  194. package/dist/types/types/layout.type.d.ts +1 -0
  195. package/dist/types/types/openApi.d.ts +4 -4
  196. package/dist/types/validator/form.scheme.d.ts +10 -2
  197. package/package.json +45 -43
  198. package/rollup.config.js +35 -35
  199. package/src/assets/icons/AddRow.svg +3 -3
  200. package/src/assets/icons/ApiIcon.svg +12 -0
  201. package/src/assets/icons/ArrowBack.svg +3 -0
  202. package/src/assets/icons/BookIcon.svg +6 -0
  203. package/src/assets/icons/CheckMarkSquare.svg +5 -5
  204. package/src/assets/icons/CloseIcon.svg +4 -4
  205. package/src/assets/icons/CopySticker.svg +6 -0
  206. package/src/assets/icons/DeleteIcon.svg +3 -3
  207. package/src/assets/icons/DeleteOutlinedIcon.svg +8 -0
  208. package/src/assets/icons/DownArrow.svg +3 -3
  209. package/src/assets/icons/EditIcon.svg +3 -3
  210. package/src/assets/icons/FilterIcon.svg +4 -0
  211. package/src/assets/icons/Plus.svg +5 -0
  212. package/src/assets/icons/PlusSquare.svg +3 -0
  213. package/src/assets/icons/RequestOption.svg +5 -0
  214. package/src/assets/icons/UpArrow.svg +3 -3
  215. package/src/assets/icons/arrowDownGray.svg +3 -0
  216. package/src/assets/icons/arrowRightGray.svg +3 -0
  217. package/src/assets/icons/close-circle.svg +5 -0
  218. package/src/assets/icons/deleteOutlinedIcon.svg +8 -8
  219. package/src/assets/icons/document.svg +6 -0
  220. package/src/assets/icons/eye.svg +4 -0
  221. package/src/assets/icons/index.ts +23 -8
  222. package/src/assets/icons/infoIcon.svg +5 -0
  223. package/src/assets/icons/searchIcon.svg +4 -0
  224. package/src/components/Chips/Chips.tsx +87 -87
  225. package/src/components/Chips/style.scss +147 -147
  226. package/src/components/InfoForm/InfoForm.module.scss +165 -165
  227. package/src/components/InfoForm/InfoForm.tsx +423 -428
  228. package/src/components/JsonInput/JsonInput.tsx +149 -149
  229. package/src/components/JsonInput/style.module.scss +133 -133
  230. package/src/components/LivePreview/LivePreview.module.scss +180 -24
  231. package/src/components/LivePreview/LivePreview.tsx +226 -191
  232. package/src/components/MethodAccordion/MethodAccordion.module.scss +386 -338
  233. package/src/components/MethodAccordion/MethodAccordion.tsx +670 -514
  234. package/src/components/SVGLoader/SVGLoader.tsx +96 -94
  235. package/src/components/SectionHead/SectionHead.scss +29 -29
  236. package/src/components/SectionHead/SectionHead.tsx +22 -22
  237. package/src/components/SimpleLabelValue/SimpleLabelValue.tsx +31 -31
  238. package/src/components/SimpleLabelValue/index.ts +1 -1
  239. package/src/components/SimpleLabelValue/style.scss +30 -30
  240. package/src/components/Tooltip/Tooltip.scss +133 -133
  241. package/src/components/Tooltip/Tooltip.tsx +85 -85
  242. package/src/components/_global.scss +337 -337
  243. package/src/components/dialog/dialog.ts +57 -54
  244. package/src/components/dialog/index.tsx +86 -85
  245. package/src/components/dialog/style.scss +188 -104
  246. package/src/components/table/style.scss +217 -190
  247. package/src/components/table/table.tsx +489 -327
  248. package/src/components/table/tags-table.tsx +348 -348
  249. package/src/constants/index.ts +95 -93
  250. package/src/constants/methods.constant.ts +26 -0
  251. package/src/constants/regex.ts +7 -7
  252. package/src/global.d.ts +13 -13
  253. package/src/helpers/docs.helper.ts +28 -0
  254. package/src/helpers/layout.helper.ts +176 -174
  255. package/src/helpers/methodAccordion.helper.ts +19 -19
  256. package/src/index.ts +2 -1
  257. package/src/layout/docsComponents/DocsAside/DocsAside.tsx +8 -0
  258. package/src/layout/docsComponents/DocsAside/style.scss +3 -0
  259. package/src/layout/docsComponents/DocsContent/DocsContent.tsx +13 -0
  260. package/src/layout/docsComponents/DocsContent/EndpointPage/index.tsx +183 -0
  261. package/src/layout/docsComponents/DocsContent/EndpointPage/style.scss +230 -0
  262. package/src/layout/docsComponents/DocsContent/TagPage/index.tsx +111 -0
  263. package/src/layout/docsComponents/DocsContent/TagPage/style.scss +246 -0
  264. package/src/layout/docsComponents/DocsContent/style.scss +0 -0
  265. package/src/layout/docsComponents/DocsHeader/DocsHeader.module.scss +198 -0
  266. package/src/layout/docsComponents/DocsHeader/DocsHeader.tsx +119 -0
  267. package/src/layout/docsComponents/DocsSideMenuTree/DocsSideMenuTree.tsx +183 -0
  268. package/src/layout/docsComponents/DocsSideMenuTree/style.scss +195 -0
  269. package/src/layout/docsComponents/index.scss +47 -0
  270. package/src/layout/docsComponents/index.tsx +28 -0
  271. package/src/layout/docsLayout.tsx +69 -0
  272. package/src/layout/layout.module.css +61 -61
  273. package/src/layout/layout.tsx +162 -150
  274. package/src/types/layout.type.ts +31 -30
  275. package/src/types/openApi.ts +108 -108
  276. package/src/types/transformedOpenApi.ts +52 -52
  277. package/src/validator/form.scheme.ts +88 -70
  278. package/tsconfig.json +33 -33
  279. package/dist/_virtual/index20.js +0 -2
  280. package/dist/_virtual/index20.js.map +0 -1
  281. package/dist/_virtual/index21.js +0 -2
  282. package/dist/_virtual/index21.js.map +0 -1
  283. package/dist/_virtual/node2.js +0 -2
  284. package/dist/_virtual/node2.js.map +0 -1
  285. package/dist/_virtual/node3.js +0 -2
  286. package/dist/_virtual/node3.js.map +0 -1
  287. package/dist/node_modules/html-dom-parser/node_modules/domhandler/lib/index.js +0 -2
  288. package/dist/node_modules/html-dom-parser/node_modules/domhandler/lib/index.js.map +0 -1
  289. package/dist/node_modules/html-dom-parser/node_modules/domhandler/lib/node.js +0 -2
  290. package/dist/node_modules/html-dom-parser/node_modules/domhandler/lib/node.js.map +0 -1
  291. package/dist/node_modules/html-react-parser/node_modules/domhandler/lib/index.js +0 -2
  292. package/dist/node_modules/html-react-parser/node_modules/domhandler/lib/index.js.map +0 -1
  293. package/dist/node_modules/html-react-parser/node_modules/domhandler/lib/node.js +0 -2
  294. package/dist/node_modules/html-react-parser/node_modules/domhandler/lib/node.js.map +0 -1
  295. package/dist/node_modules/htmlparser2/node_modules/dom-serializer/lib/foreignNames.js +0 -2
  296. package/dist/node_modules/htmlparser2/node_modules/dom-serializer/lib/foreignNames.js.map +0 -1
  297. package/dist/node_modules/htmlparser2/node_modules/dom-serializer/lib/index.js +0 -2
  298. package/dist/node_modules/htmlparser2/node_modules/dom-serializer/lib/index.js.map +0 -1
  299. package/dist/node_modules/htmlparser2/node_modules/dom-serializer/node_modules/entities/lib/decode.js +0 -2
  300. package/dist/node_modules/htmlparser2/node_modules/dom-serializer/node_modules/entities/lib/decode.js.map +0 -1
  301. package/dist/node_modules/htmlparser2/node_modules/dom-serializer/node_modules/entities/lib/decode_codepoint.js +0 -2
  302. package/dist/node_modules/htmlparser2/node_modules/dom-serializer/node_modules/entities/lib/decode_codepoint.js.map +0 -1
  303. package/dist/node_modules/htmlparser2/node_modules/dom-serializer/node_modules/entities/lib/encode.js +0 -2
  304. package/dist/node_modules/htmlparser2/node_modules/dom-serializer/node_modules/entities/lib/encode.js.map +0 -1
  305. package/dist/node_modules/htmlparser2/node_modules/dom-serializer/node_modules/entities/lib/escape.js +0 -2
  306. package/dist/node_modules/htmlparser2/node_modules/dom-serializer/node_modules/entities/lib/escape.js.map +0 -1
  307. package/dist/node_modules/htmlparser2/node_modules/dom-serializer/node_modules/entities/lib/generated/decode-data-html.js +0 -2
  308. package/dist/node_modules/htmlparser2/node_modules/dom-serializer/node_modules/entities/lib/generated/decode-data-html.js.map +0 -1
  309. package/dist/node_modules/htmlparser2/node_modules/dom-serializer/node_modules/entities/lib/generated/decode-data-xml.js +0 -2
  310. package/dist/node_modules/htmlparser2/node_modules/dom-serializer/node_modules/entities/lib/generated/decode-data-xml.js.map +0 -1
  311. package/dist/node_modules/htmlparser2/node_modules/dom-serializer/node_modules/entities/lib/generated/encode-html.js +0 -2
  312. package/dist/node_modules/htmlparser2/node_modules/dom-serializer/node_modules/entities/lib/generated/encode-html.js.map +0 -1
  313. package/dist/node_modules/htmlparser2/node_modules/dom-serializer/node_modules/entities/lib/index.js +0 -2
  314. package/dist/node_modules/htmlparser2/node_modules/dom-serializer/node_modules/entities/lib/index.js.map +0 -1
  315. package/dist/node_modules/htmlparser2/node_modules/domhandler/lib/index.js +0 -2
  316. package/dist/node_modules/htmlparser2/node_modules/domhandler/lib/index.js.map +0 -1
  317. package/dist/node_modules/htmlparser2/node_modules/domhandler/lib/node.js +0 -2
  318. package/dist/node_modules/htmlparser2/node_modules/domhandler/lib/node.js.map +0 -1
  319. package/dist/node_modules/htmlparser2/node_modules/domutils/lib/feeds.js +0 -2
  320. package/dist/node_modules/htmlparser2/node_modules/domutils/lib/feeds.js.map +0 -1
  321. package/dist/node_modules/htmlparser2/node_modules/domutils/lib/helpers.js +0 -2
  322. package/dist/node_modules/htmlparser2/node_modules/domutils/lib/helpers.js.map +0 -1
  323. package/dist/node_modules/htmlparser2/node_modules/domutils/lib/index.js +0 -2
  324. package/dist/node_modules/htmlparser2/node_modules/domutils/lib/index.js.map +0 -1
  325. package/dist/node_modules/htmlparser2/node_modules/domutils/lib/legacy.js +0 -2
  326. package/dist/node_modules/htmlparser2/node_modules/domutils/lib/legacy.js.map +0 -1
  327. package/dist/node_modules/htmlparser2/node_modules/domutils/lib/manipulation.js +0 -2
  328. package/dist/node_modules/htmlparser2/node_modules/domutils/lib/manipulation.js.map +0 -1
  329. package/dist/node_modules/htmlparser2/node_modules/domutils/lib/querying.js +0 -2
  330. package/dist/node_modules/htmlparser2/node_modules/domutils/lib/querying.js.map +0 -1
  331. package/dist/node_modules/htmlparser2/node_modules/domutils/lib/stringify.js +0 -2
  332. package/dist/node_modules/htmlparser2/node_modules/domutils/lib/stringify.js.map +0 -1
  333. package/dist/node_modules/htmlparser2/node_modules/domutils/lib/traversal.js +0 -2
  334. package/dist/node_modules/htmlparser2/node_modules/domutils/lib/traversal.js.map +0 -1
  335. package/dist/node_modules/htmlparser2/node_modules/entities/dist/commonjs/decode-codepoint.js +0 -2
  336. package/dist/node_modules/htmlparser2/node_modules/entities/dist/commonjs/decode-codepoint.js.map +0 -1
  337. package/dist/node_modules/htmlparser2/node_modules/entities/dist/commonjs/decode.js +0 -2
  338. package/dist/node_modules/htmlparser2/node_modules/entities/dist/commonjs/decode.js.map +0 -1
  339. package/dist/node_modules/htmlparser2/node_modules/entities/dist/commonjs/generated/decode-data-html.js +0 -2
  340. package/dist/node_modules/htmlparser2/node_modules/entities/dist/commonjs/generated/decode-data-html.js.map +0 -1
  341. package/dist/node_modules/htmlparser2/node_modules/entities/dist/commonjs/generated/decode-data-xml.js +0 -2
  342. package/dist/node_modules/htmlparser2/node_modules/entities/dist/commonjs/generated/decode-data-xml.js.map +0 -1
  343. package/dist/src/assets/icons/CheckMarkSquare.svg.js +0 -2
  344. package/dist/src/assets/icons/CheckMarkSquare.svg.js.map +0 -1
  345. package/dist/src/assets/icons/CloseIcon.svg.js +0 -2
  346. package/dist/src/assets/icons/CloseIcon.svg.js.map +0 -1
  347. package/dist/src/assets/icons/UpArrow.svg.js +0 -2
  348. package/dist/src/assets/icons/UpArrow.svg.js.map +0 -1
  349. package/dist/src/assets/icons/deleteOutlinedIcon.svg.js +0 -2
  350. package/dist/src/assets/icons/deleteOutlinedIcon.svg.js.map +0 -1
  351. package/dist/src/components/Chips/Chips.js +0 -2
  352. package/dist/src/components/Chips/Chips.js.map +0 -1
  353. package/dist/types/types/index.d.ts +0 -18
@@ -1,327 +1,489 @@
1
- import React, { useState } from 'react'
2
- import './style.scss'
3
- import { Button, Input, SelectGroupV2, Switch, TextArea } from 'digitinary-ui'
4
- import Tooltip from '../Tooltip/Tooltip'
5
- import SVGLoader from '../SVGLoader/SVGLoader'
6
- import { AddRow, EditIcon, DeleteIcon } from '../../assets/icons'
7
- import styles from '../MethodAccordion/MethodAccordion.module.scss'
8
- import { useFormik } from 'formik'
9
- import * as yup from 'yup'
10
- import { capitalize } from '../../helpers/methodAccordion.helper'
11
- import regex from '../../constants/regex'
12
-
13
- const ParamterTable = ({
14
- id,
15
- headCells,
16
- data,
17
- isFormOpen,
18
- setIsFormOpen,
19
- saveNewRow,
20
- readOnly,
21
- }) => {
22
- const [text, setText] = useState('')
23
- const [tooltipRef, setTooltipRef] = useState(null)
24
- const { values, errors, setFieldValue, isValid, submitForm, resetForm } = useFormik({
25
- validateOnMount: true,
26
- initialValues: {
27
- name: '',
28
- in: 'Query',
29
- schema: {
30
- type: 'String',
31
- },
32
- required: true,
33
- description: '',
34
- },
35
- validationSchema: yup.object().shape({
36
- name: yup.string().trim().required('Parameter name is required'),
37
- in: yup.string().required('Paramter type is required'),
38
- schema: yup.object().shape({
39
- type: yup.string().required('Parameter schema type is required'),
40
- }),
41
- required: yup.boolean().optional(),
42
- description: yup.string().trim().optional(),
43
- }),
44
- onSubmit: (values) => {
45
- saveNewRow(values)
46
- setIsFormOpen(false)
47
- setText('')
48
- resetForm()
49
- },
50
- })
51
-
52
- return (
53
- <div className="tableSectionContainer">
54
- <div className="tableContainer">
55
- <table id={id || ''} className={`table borderRadiusTop borderRadiusBottom`}>
56
- <thead className="tableHead">
57
- <tr>
58
- {headCells?.map((headCell) => (
59
- <th
60
- key={headCell.id}
61
- className={`tableHeadCell ${headCell.classes || ''}`}
62
- style={{ width: headCell.width, minWidth: headCell.minWidth }}
63
- >
64
- <div
65
- className="headContainer"
66
- data-id={`${
67
- typeof headCell.label === 'string'
68
- ? headCell.label.toUpperCase().replace(/[^a-zA-Z0-9]+/g, '_')
69
- : 'UNKNOWN_LABEL'
70
- }_COLUMN`}
71
- >
72
- {headCell.label}
73
- </div>
74
- </th>
75
- ))}
76
- </tr>
77
- </thead>
78
- <tbody className="tableBody" data-id="TABLE_BODY">
79
- {data?.map((row, rowIndex) => {
80
- return (
81
- <tr key={rowIndex} data-i={rowIndex} className={`row`}>
82
- {headCells?.map((headCell) => {
83
- const cellContent = row[headCell.id] !== '_' && (
84
- <div
85
- data-id="TEXT_DESCRIPTION"
86
- className="tableData"
87
- style={{
88
- width: headCell.width,
89
- minWidth: headCell.minWidth,
90
- }}
91
- >
92
- {row[headCell.id]}
93
- </div>
94
- )
95
-
96
- return (
97
- <td
98
- key={headCell.id}
99
- style={{
100
- width: headCell.width,
101
- minWidth: headCell.minWidth,
102
- }}
103
- >
104
- {cellContent}
105
- </td>
106
- )
107
- })}
108
- </tr>
109
- )
110
- })}
111
- {data?.length === 0 && readOnly && (
112
- <tr className="fallbackTableRow">
113
- <td className="fallbackContainer" colSpan={headCells?.length}>
114
- <div className="fallbackTextContainer">
115
- <span className="fallbackText"> No Data Available</span>
116
- </div>
117
- </td>
118
- </tr>
119
- )}
120
-
121
- {isFormOpen && !readOnly ? (
122
- <tr className={`row`}>
123
- <td key={'Parameter name'}>
124
- <div data-id="TEXT_DESCRIPTION" className="tableData">
125
- <Input
126
- placeholder="Parameter name"
127
- size="large"
128
- type="text"
129
- onChange={(value) => {
130
- if (value === '' || regex.ASCII.test(value as string))
131
- setFieldValue('name', value)
132
- }}
133
- value={values.name}
134
- disabled={readOnly}
135
- />
136
- </div>
137
- </td>
138
-
139
- <td key={'parameter in'}>
140
- <div data-id="TEXT_DESCRIPTION" className="tableData">
141
- <SelectGroupV2
142
- disabled={readOnly}
143
- value={{
144
- label: capitalize(values.in),
145
- value: capitalize(values.in),
146
- }}
147
- onChange={(item) => setFieldValue('in', item?.value?.toLowerCase())} // Updates state on selection
148
- options={[
149
- {
150
- list: [
151
- { label: 'Query', value: 'query' },
152
- { label: 'Header', value: 'header' },
153
- { label: 'Path', value: 'path' },
154
- { label: 'Body', value: 'body' },
155
- ],
156
- },
157
- ]}
158
- errorMsg={!!errors.in && errors.in}
159
- isMultiple={false}
160
- withSearch={false}
161
- clearable={false}
162
- />{' '}
163
- </div>
164
- </td>
165
-
166
- <td key={'parameter schema type'}>
167
- <div data-id="TEXT_DESCRIPTION" className="tableData">
168
- <SelectGroupV2
169
- disabled={readOnly}
170
- clearable={false}
171
- value={{
172
- label: capitalize(values.schema.type),
173
- value: capitalize(values.schema.type),
174
- }}
175
- errorMsg={!!errors.schema && errors.schema}
176
- onChange={(item) => setFieldValue('schema.type', item?.value?.toLowerCase())} // Updates state on selection
177
- options={[
178
- {
179
- list: [
180
- { label: 'String', value: 'string' },
181
- { label: 'Integer', value: 'integer' },
182
- { label: 'Boolean', value: 'boolean' },
183
- { label: 'Object', value: 'object' },
184
- { label: 'Array', value: 'array' },
185
- { label: 'Number', value: 'number' },
186
- ],
187
- },
188
- ]}
189
- isMultiple={false}
190
- withSearch={false}
191
- />{' '}
192
- </div>
193
- </td>
194
-
195
- <td key={'parameter required'}>
196
- <div data-id="is required" className="tableData">
197
- {readOnly ? (
198
- <>{values.required ? 'True' : 'False'}</>
199
- ) : (
200
- <Switch
201
- checked={values.required}
202
- onClick={() => {
203
- if (readOnly) {
204
- return
205
- }
206
- setFieldValue('required', !values.required)
207
- }}
208
- />
209
- )}
210
- </div>
211
- </td>
212
-
213
- <td key={'parameter schema desc'}>
214
- <div data-id="TEXT_DESCRIPTION" className="tableData">
215
- <div className={styles.paramDescContainer}>
216
- <Tooltip
217
- arrowWithBorder
218
- placement="bottom-end"
219
- type="function"
220
- trigger="click"
221
- delay={[0, 0]}
222
- onCreate={(instance) => setTooltipRef(instance)}
223
- content={
224
- <div className={styles.editDescTooltipContent}>
225
- <p className={styles.editDescTooltipContent_header}>Description</p>
226
- <TextArea
227
- value={text || values.description}
228
- onChange={(value) => {
229
- if (value === '' || regex.ASCII.test(value)) setText(value)
230
- }}
231
- disabled={readOnly}
232
- placeholder="Describe parameter..."
233
- maxLength={120}
234
- />
235
- {!readOnly && (
236
- <Button
237
- className={styles.editDescTooltipContent_btn}
238
- variant="outlined"
239
- size="small"
240
- onClick={() => {
241
- setFieldValue('description', text?.trim())
242
- tooltipRef?.hide()
243
- }}
244
- disabled={text?.trim() === ''}
245
- >
246
- Apply
247
- </Button>
248
- )}
249
- </div>
250
- }
251
- >
252
- <Button
253
- className={styles.editDescBtn}
254
- variant="link"
255
- color="action"
256
- endIcon={<SVGLoader src={EditIcon} width="1.5rem" height="1.5rem" />}
257
- >
258
- {readOnly ? 'View ' : 'Add '} Description
259
- </Button>
260
- </Tooltip>
261
-
262
- <div className={styles.paramDescContainer_separator}></div>
263
- {!readOnly && (
264
- <Button
265
- className={styles.deleteParamBtn}
266
- variant="link"
267
- color="error"
268
- endIcon={
269
- <SVGLoader src={DeleteIcon} width="1.125rem" height="1.125rem" />
270
- }
271
- onClick={() => {
272
- resetForm()
273
- setText('')
274
- setIsFormOpen(false)
275
- }} // Correctly delete the new row
276
- />
277
- )}
278
-
279
- {!readOnly && (
280
- <Tooltip
281
- disabled={!!values.name.trim()}
282
- content={`Parameter name can't be empty `}
283
- >
284
- <Button
285
- className={styles.deleteParamBtn}
286
- variant="link"
287
- color="success"
288
- disabled={!values.name.trim()}
289
- endIcon={<SVGLoader src={AddRow} width="0.125rem" height="0.125rem" />}
290
- onClick={() => {
291
- setText('')
292
- submitForm()
293
- }} // Save the new row when clicked
294
- />
295
- </Tooltip>
296
- )}
297
- </div>{' '}
298
- </div>
299
- </td>
300
- </tr>
301
- ) : (
302
- <>
303
- {!readOnly && (
304
- <tr key={'addNew'} data-i={'addNew'} className={`row`}>
305
- <td colSpan={5}>
306
- <Button
307
- variant="link"
308
- color="primary"
309
- onClick={() => {
310
- setIsFormOpen((prev) => !prev)
311
- }}
312
- >
313
- + Add Parameter
314
- </Button>
315
- </td>
316
- </tr>
317
- )}
318
- </>
319
- )}
320
- </tbody>
321
- </table>
322
- </div>
323
- </div>
324
- )
325
- }
326
-
327
- export default ParamterTable
1
+ import React, { useState } from 'react'
2
+ import './style.scss'
3
+ import { Button, Input, SelectGroupV2, Switch, TextArea } from 'digitinary-ui'
4
+ import Tooltip from '../Tooltip/Tooltip'
5
+ import SVGLoader from '../SVGLoader/SVGLoader'
6
+ import { AddRow, EditIcon, DeleteIcon } from '../../assets/icons'
7
+ import PlusIcon from '../../assets/icons/Plus.svg'
8
+ import PlusSquare from '../../assets/icons/PlusSquare.svg'
9
+ import styles from '../MethodAccordion/MethodAccordion.module.scss'
10
+ import { useFormik } from 'formik'
11
+ import * as yup from 'yup'
12
+ import { capitalize } from '../../helpers/methodAccordion.helper'
13
+ import regex from '../../constants/regex'
14
+
15
+ const ParamterTable = ({
16
+ id,
17
+ headCells,
18
+ data,
19
+ isFormOpen,
20
+ setIsFormOpen,
21
+ saveNewRow,
22
+ readOnly,
23
+ isRequest = true,
24
+ }) => {
25
+ const [text, setText] = useState('')
26
+ const [tooltipRef, setTooltipRef] = useState(null)
27
+ const [tooltipEnumRef, setTooltipEnumRef] = useState(null)
28
+ const [enumFields, setEnumFields] = useState<string[]>([])
29
+ const { values, errors, setFieldValue, isValid, submitForm, resetForm } = useFormik({
30
+ validateOnMount: true,
31
+ initialValues: {
32
+ name: '',
33
+ in: isRequest ? 'query' : 'header',
34
+ schema: {
35
+ type: 'string',
36
+ enum: [],
37
+ items: {
38
+ type: 'string',
39
+ },
40
+ },
41
+ required: true,
42
+ description: '',
43
+ },
44
+ validationSchema: yup.object().shape({
45
+ name: yup.string().default('').trim().required('Parameter name is required'),
46
+ in: yup.string().required('Paramter type is required'),
47
+ schema: yup.object().shape({
48
+ type: yup.string().required('Parameter schema type is required'),
49
+ enum: yup.array(yup.string()).optional(),
50
+ items: yup.object().shape({
51
+ type: yup.string().optional(),
52
+ }),
53
+ }),
54
+ required: yup.boolean().optional(),
55
+ description: yup.string().default('').trim().optional(),
56
+ }),
57
+ onSubmit: (values) => {
58
+ if (values && !values?.schema?.items?.type) {
59
+ delete values?.schema?.items?.type
60
+ }
61
+ saveNewRow(values)
62
+ setIsFormOpen(undefined)
63
+ setText('')
64
+ resetForm()
65
+ },
66
+ })
67
+
68
+ return (
69
+ <div className="tableSectionContainer">
70
+ <div className="tableContainer">
71
+ <table id={id || ''} className={`table borderRadiusTop borderRadiusBottom`}>
72
+ <thead className="tableHead">
73
+ <tr>
74
+ {headCells?.map((headCell) => (
75
+ <th
76
+ key={headCell.id}
77
+ className={`tableHeadCell ${headCell.classes || ''}`}
78
+ style={{ width: headCell.width, minWidth: headCell.minWidth }}
79
+ >
80
+ <div
81
+ className="headContainer"
82
+ data-id={`${
83
+ typeof headCell.label === 'string'
84
+ ? headCell.label.toUpperCase().replace(/[^a-zA-Z0-9]+/g, '_')
85
+ : 'UNKNOWN_LABEL'
86
+ }_COLUMN`}
87
+ >
88
+ {headCell.label}
89
+ </div>
90
+ </th>
91
+ ))}
92
+ </tr>
93
+ </thead>
94
+ <tbody className="tableBody" data-id="TABLE_BODY">
95
+ {data?.map((row, rowIndex) => {
96
+ return (
97
+ <tr key={rowIndex} data-i={rowIndex} className={`row`}>
98
+ {headCells?.map((headCell) => {
99
+ const cellContent = row[headCell.id] !== '_' && (
100
+ <div
101
+ data-id="TEXT_DESCRIPTION"
102
+ className="tableData"
103
+ style={{
104
+ width: headCell.width,
105
+ minWidth: headCell.minWidth,
106
+ }}
107
+ >
108
+ {row[headCell.id]}
109
+ </div>
110
+ )
111
+
112
+ return (
113
+ <td
114
+ key={headCell.id}
115
+ style={{
116
+ width: headCell.width,
117
+ minWidth: headCell.minWidth,
118
+ }}
119
+ >
120
+ {cellContent}
121
+ </td>
122
+ )
123
+ })}
124
+ </tr>
125
+ )
126
+ })}
127
+ {data?.length === 0 && readOnly && (
128
+ <tr className="fallbackTableRow">
129
+ <td className="fallbackContainer" colSpan={headCells?.length}>
130
+ <div className="fallbackTextContainer">
131
+ <span className="fallbackText"> No Data Available</span>
132
+ </div>
133
+ </td>
134
+ </tr>
135
+ )}
136
+
137
+ {isFormOpen && !readOnly ? (
138
+ <tr className={`row`}>
139
+ <td key={'Parameter name'}>
140
+ <div data-id="TEXT_DESCRIPTION" className="tableData">
141
+ <Input
142
+ placeholder="Parameter name"
143
+ size="large"
144
+ type="text"
145
+ onChange={(value) => {
146
+ if (value === '' || regex.ASCII.test(value as string))
147
+ setFieldValue('name', value)
148
+ }}
149
+ value={values.name}
150
+ disabled={readOnly}
151
+ />
152
+ </div>
153
+ </td>
154
+
155
+ <td key={'parameter in'}>
156
+ <div data-id="TEXT_DESCRIPTION" className="tableData">
157
+ <SelectGroupV2
158
+ disabled={readOnly}
159
+ value={{
160
+ label: capitalize(values.in),
161
+ value: values.in,
162
+ }}
163
+ onChange={(item) => setFieldValue('in', item?.value?.toLowerCase())} // Updates state on selection
164
+ options={[
165
+ {
166
+ list: isRequest
167
+ ? [
168
+ { label: 'Query', value: 'query' },
169
+ { label: 'Header', value: 'header' },
170
+ { label: 'Path', value: 'path' },
171
+ { label: 'Body', value: 'body' },
172
+ ]
173
+ : [{ label: 'Header', value: 'header' }],
174
+ },
175
+ ]}
176
+ errorMsg={!!errors.in && errors.in}
177
+ isMultiple={false}
178
+ withSearch={false}
179
+ clearable={false}
180
+ />{' '}
181
+ </div>
182
+ </td>
183
+
184
+ <td key={'parameter schema type'}>
185
+ <div data-id="TEXT_DESCRIPTION" className="tableData">
186
+ <SelectGroupV2
187
+ disabled={readOnly}
188
+ clearable={false}
189
+ value={{
190
+ label: capitalize(values?.schema?.type),
191
+ value: values?.schema?.type,
192
+ }}
193
+ errorMsg={!!errors.schema && errors.schema}
194
+ onChange={(item) => setFieldValue('schema.type', item?.value?.toLowerCase())} // Updates state on selection
195
+ options={[
196
+ {
197
+ list: [
198
+ { label: 'String', value: 'string' },
199
+ { label: 'Integer', value: 'integer' },
200
+ { label: 'Boolean', value: 'boolean' },
201
+ { label: 'Object', value: 'object' },
202
+ { label: 'Array', value: 'array' },
203
+ { label: 'Number', value: 'number' },
204
+ ],
205
+ },
206
+ ]}
207
+ isMultiple={false}
208
+ withSearch={false}
209
+ />{' '}
210
+ </div>
211
+ </td>
212
+
213
+ <td key={'parameter array schema type'}>
214
+ <div data-id="TEXT_DESCRIPTION" className="tableData">
215
+ {values.schema && values.schema?.type?.toLowerCase() == 'array' ? (
216
+ <SelectGroupV2
217
+ disabled={readOnly}
218
+ clearable={false}
219
+ value={{
220
+ label: capitalize(values?.schema?.items?.type),
221
+ value: values.schema?.items?.type,
222
+ }}
223
+ errorMsg={!!errors?.schema?.items?.type && errors?.schema?.items?.type}
224
+ onChange={(item) =>
225
+ setFieldValue('schema.items.type', item?.value?.toLowerCase())
226
+ } // Updates state on selection
227
+ options={[
228
+ {
229
+ list: [
230
+ { label: 'String', value: 'string' },
231
+ { label: 'Integer', value: 'integer' },
232
+ { label: 'Boolean', value: 'boolean' },
233
+ { label: 'Object', value: 'object' },
234
+ { label: 'Array', value: 'array' },
235
+ { label: 'Number', value: 'number' },
236
+ ],
237
+ },
238
+ ]}
239
+ isMultiple={false}
240
+ withSearch={false}
241
+ />
242
+ ) : (
243
+ '-'
244
+ )}{' '}
245
+ </div>
246
+ </td>
247
+
248
+ <td key={'parameter enum'}>
249
+ <div data-id="TEXT_DESCRIPTION" className="tableData">
250
+ {values?.schema &&
251
+ values?.schema?.type?.toLowerCase() != 'array' &&
252
+ values?.schema?.type?.toLowerCase() != 'object' ? (
253
+ <Tooltip
254
+ disabled={
255
+ values?.schema?.type?.toLowerCase() == 'array' ||
256
+ values?.schema?.type?.toLowerCase() == 'object'
257
+ }
258
+ arrowWithBorder
259
+ placement="bottom-end"
260
+ type="function"
261
+ trigger="click"
262
+ delay={[0, 0]}
263
+ onCreate={(instance) => setTooltipEnumRef(instance)}
264
+ content={
265
+ <div className={styles.editDescTooltipContent}>
266
+ <p className={styles.editDescTooltipContent_header}>Enum</p>
267
+ {!!values?.schema?.enum &&
268
+ !!values?.schema?.enum.length &&
269
+ values?.schema?.enum?.map((item, index) => (
270
+ <Input
271
+ key={index}
272
+ className={'methodDescForEnum'}
273
+ required
274
+ clearable={false}
275
+ placeholder="Enter Enum value..."
276
+ value={item}
277
+ onChange={(value) => {
278
+ setFieldValue(`schema.enum[${index}]`, value)
279
+ }}
280
+ />
281
+ ))}
282
+ {enumFields &&
283
+ enumFields?.map((item, index) => (
284
+ <Input
285
+ key={index}
286
+ className={'methodDescForEnum'}
287
+ required
288
+ clearable={false}
289
+ placeholder={`Enter Enum value...`}
290
+ value={item}
291
+ onChange={(value) => {
292
+ let _values = [...enumFields]
293
+ _values[index] = value
294
+ setEnumFields(_values)
295
+ }}
296
+ />
297
+ ))}
298
+ <p
299
+ className={'addEnumButton'}
300
+ onClick={() => {
301
+ setEnumFields((prev) => [...prev, ''])
302
+ }}
303
+ >
304
+ <SVGLoader src={PlusSquare} />
305
+ Add New Enum
306
+ </p>
307
+ {!readOnly && (
308
+ <Button
309
+ className={styles.editDescTooltipContent_btn}
310
+ variant="outlined"
311
+ size="small"
312
+ type="button"
313
+ onClick={() => {
314
+ setFieldValue('schema.enum', [
315
+ ...values?.schema?.enum,
316
+ ...enumFields,
317
+ ])
318
+ setEnumFields([])
319
+ tooltipEnumRef?.hide()
320
+ }}
321
+ disabled={
322
+ (enumFields.length > 0 &&
323
+ enumFields?.filter((item) => !item).length) ||
324
+ (values?.schema?.enum.length > 0 &&
325
+ values?.schema?.enum?.filter((item) => !item).length)
326
+ }
327
+ >
328
+ Apply
329
+ </Button>
330
+ )}
331
+ </div>
332
+ }
333
+ >
334
+ <Button
335
+ className={styles.editDescBtn}
336
+ id="EnumButton"
337
+ variant="link"
338
+ color="action"
339
+ endIcon={
340
+ <SVGLoader
341
+ id="enumIcon"
342
+ src={PlusIcon}
343
+ width="1.5rem"
344
+ height="1.5rem"
345
+ />
346
+ }
347
+ >
348
+ Add
349
+ </Button>
350
+ </Tooltip>
351
+ ) : (
352
+ '-'
353
+ )}{' '}
354
+ </div>
355
+ </td>
356
+
357
+ <td key={'parameter required'}>
358
+ <div data-id="is required" className="tableData">
359
+ {readOnly ? (
360
+ <>{values.required ? 'True' : 'False'}</>
361
+ ) : (
362
+ <Switch
363
+ checked={values.required}
364
+ onClick={() => {
365
+ if (readOnly) {
366
+ return
367
+ }
368
+ setFieldValue('required', !values.required)
369
+ }}
370
+ />
371
+ )}
372
+ </div>
373
+ </td>
374
+
375
+ <td key={'parameter schema desc'}>
376
+ <div data-id="TEXT_DESCRIPTION" className="tableData">
377
+ <div className={styles.paramDescContainer}>
378
+ <Tooltip
379
+ arrowWithBorder
380
+ placement="bottom-end"
381
+ type="function"
382
+ trigger="click"
383
+ delay={[0, 0]}
384
+ onCreate={(instance) => setTooltipRef(instance)}
385
+ content={
386
+ <div className={styles.editDescTooltipContent}>
387
+ <p className={styles.editDescTooltipContent_header}>Description</p>
388
+ <TextArea
389
+ value={text || values.description}
390
+ onChange={(value) => {
391
+ if (value === '' || regex.ASCII.test(value)) setText(value)
392
+ }}
393
+ disabled={readOnly}
394
+ placeholder="Describe parameter..."
395
+ maxLength={120}
396
+ />
397
+ {!readOnly && (
398
+ <Button
399
+ className={styles.editDescTooltipContent_btn}
400
+ variant="outlined"
401
+ size="small"
402
+ onClick={() => {
403
+ setFieldValue('description', text?.trim())
404
+ tooltipRef?.hide()
405
+ }}
406
+ disabled={text?.trim() === ''}
407
+ >
408
+ Apply
409
+ </Button>
410
+ )}
411
+ </div>
412
+ }
413
+ >
414
+ <Button
415
+ className={styles.editDescBtn}
416
+ variant="link"
417
+ color="action"
418
+ endIcon={<SVGLoader src={EditIcon} width="1.5rem" height="1.5rem" />}
419
+ >
420
+ {readOnly ? 'View ' : 'Add '} Description
421
+ </Button>
422
+ </Tooltip>
423
+
424
+ <div className={styles.paramDescContainer_separator}></div>
425
+ {!readOnly && (
426
+ <Button
427
+ className={styles.deleteParamBtn}
428
+ variant="link"
429
+ color="error"
430
+ endIcon={
431
+ <SVGLoader src={DeleteIcon} width="1.125rem" height="1.125rem" />
432
+ }
433
+ onClick={() => {
434
+ resetForm()
435
+ setText('')
436
+ setIsFormOpen(undefined)
437
+ }} // Correctly delete the new row
438
+ />
439
+ )}
440
+
441
+ {!readOnly && (
442
+ <Tooltip
443
+ disabled={!!values.name.trim()}
444
+ content={`Parameter name can't be empty `}
445
+ >
446
+ <Button
447
+ className={styles.deleteParamBtn}
448
+ variant="link"
449
+ color="success"
450
+ disabled={!values.name.trim()}
451
+ endIcon={<SVGLoader src={AddRow} width="0.125rem" height="0.125rem" />}
452
+ onClick={() => {
453
+ setText('')
454
+ submitForm()
455
+ }} // Save the new row when clicked
456
+ />
457
+ </Tooltip>
458
+ )}
459
+ </div>{' '}
460
+ </div>
461
+ </td>
462
+ </tr>
463
+ ) : (
464
+ <>
465
+ {!readOnly && (
466
+ <tr key={'addNew'} data-i={'addNew'} className={`row`}>
467
+ <td colSpan={5}>
468
+ <Button
469
+ variant="link"
470
+ color="primary"
471
+ onClick={() => {
472
+ setIsFormOpen((prev) => (!prev ? (isRequest ? 'Req' : 'Res') : undefined))
473
+ }}
474
+ >
475
+ + Add Parameter
476
+ </Button>
477
+ </td>
478
+ </tr>
479
+ )}
480
+ </>
481
+ )}
482
+ </tbody>
483
+ </table>
484
+ </div>
485
+ </div>
486
+ )
487
+ }
488
+
489
+ export default ParamterTable