@feugene/granularity 0.7.0 → 0.9.0

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 (306) hide show
  1. package/dist/GrBadge.css +1 -0
  2. package/dist/chunks/{adapter-CRyH4YC8.js.map → adapter-BqqjEZGU.js.map} +1 -1
  3. package/dist/chunks/arrow-up-DZdIrpaF.js.map +1 -0
  4. package/dist/chunks/{config-Dkq0HeLe.js → config-3I3vqDW4.js} +1 -1
  5. package/dist/chunks/{config-Dkq0HeLe.js.map → config-3I3vqDW4.js.map} +1 -1
  6. package/dist/chunks/config-72sW9Bag2.js.map +1 -0
  7. package/dist/chunks/{config-B8rC_K97.js.map → config-B1kFmhpM.js.map} +1 -1
  8. package/dist/chunks/{config-BhvNm4Pp.js.map → config-B2YTEe_h.js.map} +1 -1
  9. package/dist/chunks/{config-BaMO9dQh.js → config-B61cX08u.js} +1 -1
  10. package/dist/chunks/{config-BaMO9dQh.js.map → config-B61cX08u.js.map} +1 -1
  11. package/dist/chunks/{config-C5TN9J2Z.js.map → config-BK6Odc3T.js.map} +1 -1
  12. package/dist/chunks/{config-C0rHS1-l.js.map → config-BOdu-O_B.js.map} +1 -1
  13. package/dist/chunks/{config-D27BL0H9.js.map → config-BU0olrvr.js.map} +1 -1
  14. package/dist/chunks/{config-XoANT5mU.js → config-BY81UKv0.js} +1 -1
  15. package/dist/chunks/{config-XoANT5mU.js.map → config-BY81UKv0.js.map} +1 -1
  16. package/dist/chunks/config-B_nSBc7W.js.map +1 -0
  17. package/dist/chunks/{config-DbqFk-IW.js.map → config-BbKroFtR.js.map} +1 -1
  18. package/dist/chunks/config-Bcf-8XlK2.js.map +1 -0
  19. package/dist/chunks/{config-C_AOYGBr.js.map → config-BduXEXjt.js.map} +1 -1
  20. package/dist/chunks/config-BeQuykDk2.js.map +1 -0
  21. package/dist/chunks/{config-C_-02Pu-.js.map → config-BgBWt9-A.js.map} +1 -1
  22. package/dist/chunks/{config-Dusr9jcE.js.map → config-BnWSHTEU.js.map} +1 -1
  23. package/dist/chunks/{config-C4AlNm912.js → config-Br_qI3Za.js} +1 -1
  24. package/dist/chunks/config-Br_qI3Za.js.map +1 -0
  25. package/dist/chunks/config-C6zT56Jc2.js.map +1 -0
  26. package/dist/chunks/{config-ZJVOVgqR.js → config-CFf7xaG1.js} +1 -1
  27. package/dist/chunks/{config-ZJVOVgqR.js.map → config-CFf7xaG1.js.map} +1 -1
  28. package/dist/chunks/{config-Cn8TG49a.js.map → config-CUwF4E4R.js.map} +1 -1
  29. package/dist/chunks/{config-wo-ncgTH.js.map → config-CdJpnjDj.js.map} +1 -1
  30. package/dist/chunks/config-CetsgpaZ2.js.map +1 -0
  31. package/dist/chunks/{config-D1DI3roo.js.map → config-Ci9nXGUV.js.map} +1 -1
  32. package/dist/chunks/{config-CjEplP6D.js.map → config-CpMYmvVT.js.map} +1 -1
  33. package/dist/chunks/{config-BXffa3ta.js → config-Cp_XHsze.js} +2 -2
  34. package/dist/chunks/{config-BXffa3ta.js.map → config-Cp_XHsze.js.map} +1 -1
  35. package/dist/chunks/{config-D98m8iyz.js.map → config-CvGdaXvH.js.map} +1 -1
  36. package/dist/chunks/{config-CtomKf-k.js.map → config-D4s_QWVP.js.map} +1 -1
  37. package/dist/chunks/{config-D32znLtV2.js.map → config-D6Oe3blW2.js.map} +1 -1
  38. package/dist/chunks/{config-CVnluhKO.js.map → config-DF_RlCIO.js.map} +1 -1
  39. package/dist/chunks/{config-C4qAA0Sb.js.map → config-DSBlHQVa.js.map} +1 -1
  40. package/dist/chunks/{config-Mp9DJ9Mq2.js.map → config-DaHI5bD_2.js.map} +1 -1
  41. package/dist/chunks/{config-3SftO0uG.js.map → config-Dcb7xK-C.js.map} +1 -1
  42. package/dist/chunks/config-DmjwIqx1.js.map +1 -0
  43. package/dist/chunks/{config-D6Af6WZw.js.map → config-DoBk_CzG.js.map} +1 -1
  44. package/dist/chunks/config-Dzd6BzIN2.js.map +1 -0
  45. package/dist/chunks/{config-Db4BEG8Y.js.map → config-O1_FTqD3.js.map} +1 -1
  46. package/dist/chunks/{config-C9AOlKah.js.map → config-V3LF-b_F.js.map} +1 -1
  47. package/dist/chunks/config-_3De4HFf.js.map +1 -0
  48. package/dist/chunks/{config-B44QVIge.js → config-d386uO3O.js} +1 -1
  49. package/dist/chunks/{config-B44QVIge.js.map → config-d386uO3O.js.map} +1 -1
  50. package/dist/chunks/{config-DudL02ag.js.map → config-iuMz79Mg.js.map} +1 -1
  51. package/dist/chunks/{config-DJWf0kWe.js.map → config-vcDVCYXo.js.map} +1 -1
  52. package/dist/chunks/{en-QNZhjmSJ.js.map → en-foQA8imU.js.map} +1 -1
  53. package/dist/chunks/{es-CKLPuE0h.js → es-Bx3Kuy6z.js} +3 -3
  54. package/dist/chunks/{es-CKLPuE0h.js.map → es-Bx3Kuy6z.js.map} +1 -1
  55. package/dist/chunks/{es-C1c5XsIK.js.map → es-DZFSojYL.js.map} +1 -1
  56. package/dist/chunks/{fileValidation-CwJA8Vmn.js.map → fileValidation-c_iBg74s.js.map} +1 -1
  57. package/dist/chunks/{grBadgeStyles-pqqbVgLk.js → grBadgeStyles-Cq0hH2Ls.js} +7 -5
  58. package/dist/chunks/grBadgeStyles-Cq0hH2Ls.js.map +1 -0
  59. package/dist/chunks/{grButtonStyles-BxZW2x0-.js.map → grButtonStyles-DKuXUemw.js.map} +1 -1
  60. package/dist/chunks/{grDropdownStyles-DMp7RrI9.js.map → grDropdownStyles-B41mVR1H.js.map} +1 -1
  61. package/dist/chunks/{grLoadingStyles-CrxZHFL0.js.map → grLoadingStyles-DmI-SJ3i.js.map} +1 -1
  62. package/dist/chunks/{grSelectStyles-DTAYNzxn.js.map → grSelectStyles-pUt19VGy.js.map} +1 -1
  63. package/dist/chunks/{grStyle-5EMYYctb.js.map → grStyle-CUaTmpyW.js.map} +1 -1
  64. package/dist/chunks/{granularityI18n-CXa_uN7f.js → granularityI18n-LcJ88Vce.js} +1 -1
  65. package/dist/chunks/{granularityI18n-CXa_uN7f.js.map → granularityI18n-LcJ88Vce.js.map} +1 -1
  66. package/dist/chunks/loader-circle-BUntgosj.js.map +1 -0
  67. package/dist/chunks/{ru-DcF7ciz0.js.map → ru-LhkPpPIl.js.map} +1 -1
  68. package/dist/chunks/{safelist-BY7z8fOl.js → safelist-DccvJqCE.js} +1 -1
  69. package/dist/chunks/{safelist-BY7z8fOl.js.map → safelist-DccvJqCE.js.map} +1 -1
  70. package/dist/chunks/safelist-_UVzJrgE2.js.map +1 -0
  71. package/dist/chunks/{shared-BkIIEolF.js → shared-D24hqkyM.js} +42 -42
  72. package/dist/chunks/{shared-BkIIEolF.js.map → shared-D24hqkyM.js.map} +1 -1
  73. package/dist/components/GrBadge/chunks/GrBadge-Cs_cVfuO.js +36 -0
  74. package/dist/components/GrBadge/chunks/GrBadge-Cs_cVfuO.js.map +1 -0
  75. package/dist/components/GrBadge/index.js +2 -2
  76. package/dist/components/GrBadgeWrap/chunks/{GrBadgeWrap-CxtamOZ-.js.map → GrBadgeWrap-BEnE9DyJ.js.map} +1 -1
  77. package/dist/components/GrBadgeWrap/index.js +2 -2
  78. package/dist/components/GrBottomNav/chunks/{GrBottomNav-CsmQ7mTJ.js.map → GrBottomNav-XPHwd7UQ.js.map} +1 -1
  79. package/dist/components/GrBottomNav/index.js +2 -2
  80. package/dist/components/GrButton/chunks/{GrButton-BmGdp8-4.js → GrButton-CPDKonoB.js} +2 -2
  81. package/dist/components/GrButton/chunks/{GrButton-BmGdp8-4.js.map → GrButton-CPDKonoB.js.map} +1 -1
  82. package/dist/components/GrButton/index.js +4 -4
  83. package/dist/components/GrButtonGroup/chunks/{GrButtonGroup-CBj4tpms.js.map → GrButtonGroup-CPOH6V-P.js.map} +1 -1
  84. package/dist/components/GrButtonGroup/index.js +2 -2
  85. package/dist/components/GrCard/chunks/{GrCard-xtDcXBr7.js → GrCard-6yk1RRAQ.js} +1 -1
  86. package/dist/components/GrCard/chunks/{GrCard-xtDcXBr7.js.map → GrCard-6yk1RRAQ.js.map} +1 -1
  87. package/dist/components/GrCard/index.js +1 -1
  88. package/dist/components/GrCollapse/chunks/{GrCollapse-HU20VTVn.js → GrCollapse-CU94BTAR.js} +1 -1
  89. package/dist/components/GrCollapse/chunks/{GrCollapse-HU20VTVn.js.map → GrCollapse-CU94BTAR.js.map} +1 -1
  90. package/dist/components/GrCollapse/index.js +1 -1
  91. package/dist/components/GrConfirmDialog/chunks/{GrConfirmDialog-DjGOX9Hd.js → GrConfirmDialog-BGmyfDd2.js} +32 -9
  92. package/dist/components/GrConfirmDialog/chunks/GrConfirmDialog-BGmyfDd2.js.map +1 -0
  93. package/dist/components/GrConfirmDialog/index.js +2 -2
  94. package/dist/components/GrDataTable/chunks/{GrDataTable-QDOJWmdY.js → GrDataTable-ClcYiyc8.js} +2 -2
  95. package/dist/components/GrDataTable/chunks/{GrDataTable-QDOJWmdY.js.map → GrDataTable-ClcYiyc8.js.map} +1 -1
  96. package/dist/components/GrDataTable/index.js +2 -2
  97. package/dist/components/GrDialog/chunks/{GrDialog-gObmaVEl.js → GrDialog-Ba3Ojcsq.js} +1 -1
  98. package/dist/components/GrDialog/chunks/{GrDialog-gObmaVEl.js.map → GrDialog-Ba3Ojcsq.js.map} +1 -1
  99. package/dist/components/GrDialog/index.js +2 -2
  100. package/dist/components/GrDrawer/chunks/{GrDrawer-BJL_gTxI.js → GrDrawer-BW3wtI7h.js} +2 -2
  101. package/dist/components/GrDrawer/chunks/{GrDrawer-BJL_gTxI.js.map → GrDrawer-BW3wtI7h.js.map} +1 -1
  102. package/dist/components/GrDrawer/index.js +2 -2
  103. package/dist/components/GrDropdown/chunks/{GrDropdown-BkACCXdp.js → GrDropdown-DOvHKnih.js} +1 -1
  104. package/dist/components/GrDropdown/chunks/{GrDropdown-BkACCXdp.js.map → GrDropdown-DOvHKnih.js.map} +1 -1
  105. package/dist/components/GrDropdown/index.js +2 -2
  106. package/dist/components/GrDropdownMenu/chunks/{GrDropdownMenu-BEenXrJw.js → GrDropdownMenu-CLPwbiyG.js} +1 -1
  107. package/dist/components/GrDropdownMenu/chunks/{GrDropdownMenu-BEenXrJw.js.map → GrDropdownMenu-CLPwbiyG.js.map} +1 -1
  108. package/dist/components/GrDropdownMenu/index.js +2 -2
  109. package/dist/components/GrEmptyState/chunks/{GrEmptyState-BLbMJFW-.js.map → GrEmptyState-Dj2V5GaX.js.map} +1 -1
  110. package/dist/components/GrEmptyState/index.js +2 -2
  111. package/dist/components/GrFileUpload/chunks/{GrFileUpload-DYRERhI2.js → GrFileUpload-BEKNB1RM.js} +5 -5
  112. package/dist/components/GrFileUpload/chunks/GrFileUpload-BEKNB1RM.js.map +1 -0
  113. package/dist/components/GrFileUpload/index.js +3 -3
  114. package/dist/components/GrFormField/chunks/{GrFormField-C1oWTT_0.js.map → GrFormField-U7c_aDPJ.js.map} +1 -1
  115. package/dist/components/GrFormField/index.js +2 -2
  116. package/dist/components/GrFormFile/chunks/{GrFormFile-deDPicM2.js → GrFormFile-CIleXnfr.js} +3 -3
  117. package/dist/components/GrFormFile/chunks/{GrFormFile-deDPicM2.js.map → GrFormFile-CIleXnfr.js.map} +1 -1
  118. package/dist/components/GrFormFile/index.js +2 -2
  119. package/dist/components/GrFormSection/chunks/{GrFormSection-CWBk2EUm.js.map → GrFormSection-DpGhY7MX.js.map} +1 -1
  120. package/dist/components/GrFormSection/index.js +2 -2
  121. package/dist/components/GrImageViewer/chunks/{GrImageViewer-Cpj5zyZQ.js.map → GrImageViewer-Cn1X-sWS.js.map} +1 -1
  122. package/dist/components/GrImageViewer/index.js +2 -2
  123. package/dist/components/GrInput/chunks/{GrInput-CfO2RsM-.js.map → GrInput-gwFQ1sk4.js.map} +1 -1
  124. package/dist/components/GrInput/index.js +2 -2
  125. package/dist/components/GrInputTag/chunks/{GrInputTag-G_VYJPF9.js → GrInputTag-Dcj3F6rQ.js} +2 -2
  126. package/dist/components/GrInputTag/chunks/{GrInputTag-G_VYJPF9.js.map → GrInputTag-Dcj3F6rQ.js.map} +1 -1
  127. package/dist/components/GrInputTag/index.js +2 -2
  128. package/dist/components/GrLink/chunks/{GrLink-BLPigqij.js → GrLink-BMwn2iJ9.js} +1 -1
  129. package/dist/components/GrLink/chunks/{GrLink-BLPigqij.js.map → GrLink-BMwn2iJ9.js.map} +1 -1
  130. package/dist/components/GrLink/index.js +2 -2
  131. package/dist/components/GrList/chunks/{GrList-BPjQf-72.js → GrList-D8nM1FuV.js} +1 -1
  132. package/dist/components/GrList/chunks/{GrList-BPjQf-72.js.map → GrList-D8nM1FuV.js.map} +1 -1
  133. package/dist/components/GrList/index.js +2 -2
  134. package/dist/components/GrLoading/chunks/{GrLoading-C3QZKwE-.js → GrLoading-mfyfghxs.js} +2 -2
  135. package/dist/components/GrLoading/chunks/{GrLoading-C3QZKwE-.js.map → GrLoading-mfyfghxs.js.map} +1 -1
  136. package/dist/components/GrLoading/index.js +2 -2
  137. package/dist/components/GrModal/index.js +1 -1
  138. package/dist/components/GrNavbar/chunks/{GrNavbar-BoVuSZ-V.js → GrNavbar-BH7XiF9q.js} +2 -2
  139. package/dist/components/GrNavbar/chunks/{GrNavbar-BoVuSZ-V.js.map → GrNavbar-BH7XiF9q.js.map} +1 -1
  140. package/dist/components/GrNavbar/index.js +2 -2
  141. package/dist/components/GrNumberInput/chunks/{GrNumberInput-ECtFCIKV.js → GrNumberInput-YIWhV85S.js} +1 -1
  142. package/dist/components/GrNumberInput/chunks/{GrNumberInput-ECtFCIKV.js.map → GrNumberInput-YIWhV85S.js.map} +1 -1
  143. package/dist/components/GrNumberInput/index.js +2 -2
  144. package/dist/components/GrPagination/chunks/{GrPagination-DW44c2-a.js → GrPagination-cD6rFO9W.js} +3 -3
  145. package/dist/components/GrPagination/chunks/{GrPagination-DW44c2-a.js.map → GrPagination-cD6rFO9W.js.map} +1 -1
  146. package/dist/components/GrPagination/index.js +2 -2
  147. package/dist/components/GrProgressBar/chunks/{GrProgressBar-hQQK8cYh.js → GrProgressBar-C2HdYjp4.js} +1 -1
  148. package/dist/components/GrProgressBar/chunks/{GrProgressBar-hQQK8cYh.js.map → GrProgressBar-C2HdYjp4.js.map} +1 -1
  149. package/dist/components/GrProgressBar/index.js +2 -2
  150. package/dist/components/GrPromptDialog/chunks/{GrPromptDialog-CUMW6_58.js → GrPromptDialog-Du1aLfcA.js} +55 -29
  151. package/dist/components/GrPromptDialog/chunks/GrPromptDialog-Du1aLfcA.js.map +1 -0
  152. package/dist/components/GrPromptDialog/index.js +2 -2
  153. package/dist/components/GrRadio/chunks/{GrRadio-B_t_ZNVl.js → GrRadio-IFU9Hiu2.js} +1 -1
  154. package/dist/components/GrRadio/chunks/{GrRadio-B_t_ZNVl.js.map → GrRadio-IFU9Hiu2.js.map} +1 -1
  155. package/dist/components/GrRadio/index.js +2 -2
  156. package/dist/components/GrRadioGroup/chunks/{GrRadioGroup-CVlgpUBr.js → GrRadioGroup-C8IcJuuF.js} +2 -2
  157. package/dist/components/GrRadioGroup/chunks/{GrRadioGroup-CVlgpUBr.js.map → GrRadioGroup-C8IcJuuF.js.map} +1 -1
  158. package/dist/components/GrRadioGroup/index.js +2 -2
  159. package/dist/components/GrResponseErrorBanner/chunks/GrResponseErrorBanner-BMvXREcv.js +221 -0
  160. package/dist/components/GrResponseErrorBanner/chunks/GrResponseErrorBanner-BMvXREcv.js.map +1 -0
  161. package/dist/components/GrResponseErrorBanner/chunks/GrResponseErrorBanner-CzdTh4gd.js +782 -0
  162. package/dist/components/GrResponseErrorBanner/chunks/GrResponseErrorBanner-CzdTh4gd.js.map +1 -0
  163. package/dist/components/GrResponseErrorBanner/index.js +3 -0
  164. package/dist/components/GrSegmented/chunks/{GrSegmented-BPl1koHc.js → GrSegmented-BRmwBsEG.js} +1 -1
  165. package/dist/components/GrSegmented/chunks/{GrSegmented-BPl1koHc.js.map → GrSegmented-BRmwBsEG.js.map} +1 -1
  166. package/dist/components/GrSegmented/index.js +2 -2
  167. package/dist/components/GrSelect/chunks/{GrSelect-C3NAfTqL.js → GrSelect-W9lbAjRZ.js} +2 -2
  168. package/dist/components/GrSelect/chunks/{GrSelect-C3NAfTqL.js.map → GrSelect-W9lbAjRZ.js.map} +1 -1
  169. package/dist/components/GrSelect/index.js +2 -2
  170. package/dist/components/GrSidebar/chunks/{GrSidebar-DVucgcfV.js.map → GrSidebar-BpBtAGBs.js.map} +1 -1
  171. package/dist/components/GrSidebar/index.js +2 -2
  172. package/dist/components/GrSkeleton/chunks/{GrSkeleton-CDTvCSoH.js.map → GrSkeleton-URyMkBqI.js.map} +1 -1
  173. package/dist/components/GrSkeleton/index.js +2 -2
  174. package/dist/components/GrSwitch/chunks/{GrSwitch-Bnamgqb2.js → GrSwitch-29h0QhMO.js} +1 -1
  175. package/dist/components/GrSwitch/chunks/{GrSwitch-Bnamgqb2.js.map → GrSwitch-29h0QhMO.js.map} +1 -1
  176. package/dist/components/GrSwitch/index.js +2 -2
  177. package/dist/components/GrTable/chunks/{GrTable-CyQ9uw8A.js.map → GrTable-dTWUxzRm.js.map} +1 -1
  178. package/dist/components/GrTable/index.js +2 -2
  179. package/dist/components/GrTabs/chunks/{GrTabs-CiGmcmvm.js.map → GrTabs-D3ntDdtg.js.map} +1 -1
  180. package/dist/components/GrTabs/index.js +2 -2
  181. package/dist/components/GrTextarea/chunks/{GrTextarea-VBSc6A7D.js → GrTextarea-Cv6r2GuC.js} +1 -1
  182. package/dist/components/GrTextarea/chunks/{GrTextarea-VBSc6A7D.js.map → GrTextarea-Cv6r2GuC.js.map} +1 -1
  183. package/dist/components/GrTextarea/index.js +2 -2
  184. package/dist/components/GrToaster/chunks/{GrToaster-I1e-zCpf.js → GrToaster-DluJmR5D.js} +2 -2
  185. package/dist/components/GrToaster/chunks/{GrToaster-I1e-zCpf.js.map → GrToaster-DluJmR5D.js.map} +1 -1
  186. package/dist/components/GrToaster/index.js +2 -2
  187. package/dist/components/GrTooltip/chunks/{GrTooltip-CrV1gI_c.js.map → GrTooltip-B7I1AVIC.js.map} +1 -1
  188. package/dist/components/GrTooltip/index.js +2 -2
  189. package/dist/components/GrTree/chunks/{GrTree-Dlev9oBd.js → GrTree-B2SMU5Py.js} +1 -1
  190. package/dist/components/GrTree/chunks/{GrTree-Dlev9oBd.js.map → GrTree-B2SMU5Py.js.map} +1 -1
  191. package/dist/components/GrTree/index.js +2 -2
  192. package/dist/components/GrTreeSelect/chunks/{GrTreeSelect-DkAIksRW.js → GrTreeSelect-C1abr5uH.js} +4 -4
  193. package/dist/components/GrTreeSelect/chunks/{GrTreeSelect-DkAIksRW.js.map → GrTreeSelect-C1abr5uH.js.map} +1 -1
  194. package/dist/components/GrTreeSelect/index.js +2 -2
  195. package/dist/directives/dropzone.js +1 -1
  196. package/dist/directives/loading.js +1 -1
  197. package/dist/fileValidation/index.js +1 -1
  198. package/dist/granular-provider-node.js +3 -3
  199. package/dist/granular-provider.js +1 -1
  200. package/dist/i18n/all.js +1 -1
  201. package/dist/i18n/index.js +2 -2
  202. package/dist/index.js +486 -1027
  203. package/dist/index.js.map +1 -1
  204. package/dist/types/src/components/GrBadge/grBadgeStyles.d.ts +1 -1
  205. package/dist/types/src/components/GrConfirmDialog/GrConfirmDialog.vue.d.ts +35 -2
  206. package/dist/types/src/components/GrDialogService/GrDialogServiceHost.vue.d.ts +3 -0
  207. package/dist/types/src/components/GrDialogService/config.d.ts +1 -0
  208. package/dist/types/src/components/GrDialogService/index.d.ts +4 -0
  209. package/dist/types/src/components/GrDialogService/store.d.ts +22 -0
  210. package/dist/types/src/components/GrDialogService/types.d.ts +141 -0
  211. package/dist/types/src/components/GrDialogService/useDialogService.d.ts +13 -0
  212. package/dist/types/src/components/GrFileUpload/GrFileUpload.vue.d.ts +3 -3
  213. package/dist/types/src/components/GrFormFile/GrFormFile.vue.d.ts +2 -2
  214. package/dist/types/src/components/GrInput/GrInput.vue.d.ts +3 -3
  215. package/dist/types/src/components/GrInputTag/GrInputTag.vue.d.ts +1 -1
  216. package/dist/types/src/components/GrNumberInput/GrNumberInput.vue.d.ts +4 -4
  217. package/dist/types/src/components/GrPromptDialog/GrPromptDialog.vue.d.ts +41 -2
  218. package/dist/types/src/components/GrResponseErrorBanner/GrUploadErrorBanner.vue.d.ts +1 -1
  219. package/dist/types/src/components/GrResponseErrorBanner/index.d.ts +2 -2
  220. package/dist/types/src/components/GrResponseErrorBanner/parsers/createResponseErrorClassifier.d.ts +27 -0
  221. package/dist/types/src/components/GrResponseErrorBanner/parsers/index.d.ts +2 -2
  222. package/dist/types/src/components/GrSelect/GrSelect.vue.d.ts +1 -1
  223. package/dist/types/src/components/GrTextarea/GrTextarea.vue.d.ts +2 -2
  224. package/dist/types/src/components/GrToaster/GrToaster.vue.d.ts +1 -1
  225. package/dist/types/src/index.d.ts +1 -0
  226. package/package.json +5 -1
  227. package/dist/chunks/arrow-up-DNXrMoAI.js.map +0 -1
  228. package/dist/chunks/config-C0b_3LJV.js.map +0 -1
  229. package/dist/chunks/config-C4AlNm912.js.map +0 -1
  230. package/dist/chunks/config-CxCAfXZ1.js.map +0 -1
  231. package/dist/chunks/config-DDEWvph-2.js.map +0 -1
  232. package/dist/chunks/config-DDLoUczC.js.map +0 -1
  233. package/dist/chunks/config-DQOSlWvp.js.map +0 -1
  234. package/dist/chunks/config-DnsISjD8.js.map +0 -1
  235. package/dist/chunks/config-DxqMXzNV2.js.map +0 -1
  236. package/dist/chunks/config-DxqpV-KM.js.map +0 -1
  237. package/dist/chunks/config-rxFL-6yF2.js.map +0 -1
  238. package/dist/chunks/grBadgeStyles-pqqbVgLk.js.map +0 -1
  239. package/dist/chunks/loader-circle-B2rWDk5u.js.map +0 -1
  240. package/dist/chunks/safelist-BF822K15.js.map +0 -1
  241. package/dist/components/GrBadge/chunks/GrBadge-wuIb4_2K.js +0 -32
  242. package/dist/components/GrBadge/chunks/GrBadge-wuIb4_2K.js.map +0 -1
  243. package/dist/components/GrConfirmDialog/chunks/GrConfirmDialog-DjGOX9Hd.js.map +0 -1
  244. package/dist/components/GrFileUpload/chunks/GrFileUpload-DYRERhI2.js.map +0 -1
  245. package/dist/components/GrPromptDialog/chunks/GrPromptDialog-CUMW6_58.js.map +0 -1
  246. /package/dist/chunks/{_plugin-vue_export-helper-BG_EqiDU.js → _plugin-vue_export-helper-DQR7Sy7Q.js} +0 -0
  247. /package/dist/chunks/{adapter-CRyH4YC8.js → adapter-BqqjEZGU.js} +0 -0
  248. /package/dist/chunks/{arrow-up-DNXrMoAI.js → arrow-up-DZdIrpaF.js} +0 -0
  249. /package/dist/chunks/{config-C0b_3LJV.js → config-72sW9Bag2.js} +0 -0
  250. /package/dist/chunks/{config-B8rC_K97.js → config-B1kFmhpM.js} +0 -0
  251. /package/dist/chunks/{config-BhvNm4Pp.js → config-B2YTEe_h.js} +0 -0
  252. /package/dist/chunks/{config-C5TN9J2Z.js → config-BK6Odc3T.js} +0 -0
  253. /package/dist/chunks/{config-C0rHS1-l.js → config-BOdu-O_B.js} +0 -0
  254. /package/dist/chunks/{config-D27BL0H9.js → config-BU0olrvr.js} +0 -0
  255. /package/dist/chunks/{config-DxqMXzNV2.js → config-B_nSBc7W.js} +0 -0
  256. /package/dist/chunks/{config-DbqFk-IW.js → config-BbKroFtR.js} +0 -0
  257. /package/dist/chunks/{config-DQOSlWvp.js → config-Bcf-8XlK2.js} +0 -0
  258. /package/dist/chunks/{config-C_AOYGBr.js → config-BduXEXjt.js} +0 -0
  259. /package/dist/chunks/{config-DnsISjD8.js → config-BeQuykDk2.js} +0 -0
  260. /package/dist/chunks/{config-C_-02Pu-.js → config-BgBWt9-A.js} +0 -0
  261. /package/dist/chunks/{config-Dusr9jcE.js → config-BnWSHTEU.js} +0 -0
  262. /package/dist/chunks/{config-DxqpV-KM.js → config-C6zT56Jc2.js} +0 -0
  263. /package/dist/chunks/{config-Cn8TG49a.js → config-CUwF4E4R.js} +0 -0
  264. /package/dist/chunks/{config-wo-ncgTH.js → config-CdJpnjDj.js} +0 -0
  265. /package/dist/chunks/{config-CxCAfXZ1.js → config-CetsgpaZ2.js} +0 -0
  266. /package/dist/chunks/{config-D1DI3roo.js → config-Ci9nXGUV.js} +0 -0
  267. /package/dist/chunks/{config-CjEplP6D.js → config-CpMYmvVT.js} +0 -0
  268. /package/dist/chunks/{config-D98m8iyz.js → config-CvGdaXvH.js} +0 -0
  269. /package/dist/chunks/{config-CtomKf-k.js → config-D4s_QWVP.js} +0 -0
  270. /package/dist/chunks/{config-D32znLtV2.js → config-D6Oe3blW2.js} +0 -0
  271. /package/dist/chunks/{config-CVnluhKO.js → config-DF_RlCIO.js} +0 -0
  272. /package/dist/chunks/{config-C4qAA0Sb.js → config-DSBlHQVa.js} +0 -0
  273. /package/dist/chunks/{config-Mp9DJ9Mq2.js → config-DaHI5bD_2.js} +0 -0
  274. /package/dist/chunks/{config-3SftO0uG.js → config-Dcb7xK-C.js} +0 -0
  275. /package/dist/chunks/{config-DDEWvph-2.js → config-DmjwIqx1.js} +0 -0
  276. /package/dist/chunks/{config-D6Af6WZw.js → config-DoBk_CzG.js} +0 -0
  277. /package/dist/chunks/{config-DDLoUczC.js → config-Dzd6BzIN2.js} +0 -0
  278. /package/dist/chunks/{config-Db4BEG8Y.js → config-O1_FTqD3.js} +0 -0
  279. /package/dist/chunks/{config-C9AOlKah.js → config-V3LF-b_F.js} +0 -0
  280. /package/dist/chunks/{config-rxFL-6yF2.js → config-_3De4HFf.js} +0 -0
  281. /package/dist/chunks/{config-DudL02ag.js → config-iuMz79Mg.js} +0 -0
  282. /package/dist/chunks/{config-DJWf0kWe.js → config-vcDVCYXo.js} +0 -0
  283. /package/dist/chunks/{en-QNZhjmSJ.js → en-foQA8imU.js} +0 -0
  284. /package/dist/chunks/{es-C1c5XsIK.js → es-DZFSojYL.js} +0 -0
  285. /package/dist/chunks/{fileValidation-CwJA8Vmn.js → fileValidation-c_iBg74s.js} +0 -0
  286. /package/dist/chunks/{grButtonStyles-BxZW2x0-.js → grButtonStyles-DKuXUemw.js} +0 -0
  287. /package/dist/chunks/{grDropdownStyles-DMp7RrI9.js → grDropdownStyles-B41mVR1H.js} +0 -0
  288. /package/dist/chunks/{grLoadingStyles-CrxZHFL0.js → grLoadingStyles-DmI-SJ3i.js} +0 -0
  289. /package/dist/chunks/{grSelectStyles-DTAYNzxn.js → grSelectStyles-pUt19VGy.js} +0 -0
  290. /package/dist/chunks/{grStyle-5EMYYctb.js → grStyle-CUaTmpyW.js} +0 -0
  291. /package/dist/chunks/{loader-circle-B2rWDk5u.js → loader-circle-BUntgosj.js} +0 -0
  292. /package/dist/chunks/{ru-DcF7ciz0.js → ru-LhkPpPIl.js} +0 -0
  293. /package/dist/chunks/{safelist-BF822K15.js → safelist-_UVzJrgE2.js} +0 -0
  294. /package/dist/components/GrBadgeWrap/chunks/{GrBadgeWrap-CxtamOZ-.js → GrBadgeWrap-BEnE9DyJ.js} +0 -0
  295. /package/dist/components/GrBottomNav/chunks/{GrBottomNav-CsmQ7mTJ.js → GrBottomNav-XPHwd7UQ.js} +0 -0
  296. /package/dist/components/GrButtonGroup/chunks/{GrButtonGroup-CBj4tpms.js → GrButtonGroup-CPOH6V-P.js} +0 -0
  297. /package/dist/components/GrEmptyState/chunks/{GrEmptyState-BLbMJFW-.js → GrEmptyState-Dj2V5GaX.js} +0 -0
  298. /package/dist/components/GrFormField/chunks/{GrFormField-C1oWTT_0.js → GrFormField-U7c_aDPJ.js} +0 -0
  299. /package/dist/components/GrFormSection/chunks/{GrFormSection-CWBk2EUm.js → GrFormSection-DpGhY7MX.js} +0 -0
  300. /package/dist/components/GrImageViewer/chunks/{GrImageViewer-Cpj5zyZQ.js → GrImageViewer-Cn1X-sWS.js} +0 -0
  301. /package/dist/components/GrInput/chunks/{GrInput-CfO2RsM-.js → GrInput-gwFQ1sk4.js} +0 -0
  302. /package/dist/components/GrSidebar/chunks/{GrSidebar-DVucgcfV.js → GrSidebar-BpBtAGBs.js} +0 -0
  303. /package/dist/components/GrSkeleton/chunks/{GrSkeleton-CDTvCSoH.js → GrSkeleton-URyMkBqI.js} +0 -0
  304. /package/dist/components/GrTable/chunks/{GrTable-CyQ9uw8A.js → GrTable-dTWUxzRm.js} +0 -0
  305. /package/dist/components/GrTabs/chunks/{GrTabs-CiGmcmvm.js → GrTabs-D3ntDdtg.js} +0 -0
  306. /package/dist/components/GrTooltip/chunks/{GrTooltip-CrV1gI_c.js → GrTooltip-B7I1AVIC.js} +0 -0
@@ -0,0 +1,782 @@
1
+ import { t as GrAlert_default } from "../../GrAlert/chunks/GrAlert-HyCjYJeL.js";
2
+ import { t as GrButton_default } from "../../GrButton/chunks/GrButton-CPDKonoB.js";
3
+ import { t as useGranularityTranslations } from "../../../chunks/granularityI18n-LcJ88Vce.js";
4
+ import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, openBlock, renderList, toDisplayString, withCtx } from "vue";
5
+ //#region src/components/GrResponseErrorBanner/responseError.defaults.ts
6
+ /**
7
+ * Default English texts. Any field can be overridden via the `texts` prop
8
+ * on `GrResponseErrorBanner` or the `texts` option of `useResponseError`.
9
+ */
10
+ var DEFAULT_RESPONSE_ERROR_TEXTS = {
11
+ networkTitle: "No connection to the server",
12
+ networkMessage: "Check your internet connection and try again.",
13
+ abortedTitle: "Request cancelled",
14
+ abortedMessage: "The request was cancelled.",
15
+ validationTitle: "Check the data",
16
+ validationMessage: "The server returned a validation error. Fix the fields and try again.",
17
+ clientTitle: "Request error",
18
+ clientMessage: "The server rejected the request.",
19
+ serverTitle: "Server error",
20
+ serverMessage: "A server error occurred. Please try again.",
21
+ unknownTitle: "Something went wrong",
22
+ unknownMessage: "The operation could not be completed. Please try again.",
23
+ retryLabel: "Retry",
24
+ dismissLabel: "Dismiss"
25
+ };
26
+ /**
27
+ * Маппинг `kind` → `tone` по умолчанию. Применяется внутри баннера, если
28
+ * пользователь не передал `tone` или `toneByKind`. Цель — визуально отделить
29
+ * «исправь ввод» (warning) от «упало по сети/серверу» (danger).
30
+ */
31
+ var DEFAULT_TONE_BY_KIND = {
32
+ network: "danger",
33
+ aborted: "info",
34
+ validation: "warning",
35
+ client: "warning",
36
+ server: "danger",
37
+ unknown: "danger"
38
+ };
39
+ /**
40
+ * `kind`'ы, которые по умолчанию не показываются (баннер скрыт).
41
+ * Семантика: отмена пользователем — не «ошибка», UI обычно тихо проглатывает.
42
+ * Пользователь может переопределить через `autoHideKinds: []`, чтобы показать info-плашку.
43
+ */
44
+ var DEFAULT_AUTO_HIDE_KINDS = [];
45
+ //#endregion
46
+ //#region src/components/GrResponseErrorBanner/parsers/abortErrorParser.ts
47
+ /**
48
+ * Распознаёт отмену запроса клиентом.
49
+ *
50
+ * Триггеры:
51
+ * - `ctx.isAbort === true` (выставляется `normalizeError` для `AbortError`,
52
+ * axios `isCancel`/`ERR_CANCELED`, xhr `status === 0 && readyState === 4`).
53
+ *
54
+ * Возвращает `kind: 'aborted'` и `stop: true` — другие парсеры пропускаются,
55
+ * чтобы случайный `status === 0` не интерпретировался как сетевая ошибка.
56
+ *
57
+ * По умолчанию `aborted` показывается info-плашкой; чтобы скрыть совсем —
58
+ * добавьте `'aborted'` в `autoHideKinds`.
59
+ */
60
+ var abortErrorParser = (ctx) => {
61
+ if (!ctx.isAbort) return null;
62
+ return {
63
+ kind: "aborted",
64
+ message: ctx.texts.abortedMessage,
65
+ stop: true
66
+ };
67
+ };
68
+ //#endregion
69
+ //#region src/components/GrResponseErrorBanner/parsers/fileValidationParser.ts
70
+ /**
71
+ * Распознаёт `FileValidationError` от `GrFileUpload` (или совместимый по форме
72
+ * объект). Не зависит от жёсткого импорта класса — определяет по `name`.
73
+ *
74
+ * Активируется, если `ctx.raw.name === 'FileValidationError'` и есть массив
75
+ * `issues`/`errors` с полями `{ file?, code?, message }`.
76
+ *
77
+ * Возвращает `kind: 'validation'` и `stop: true` — это локальная клиентская
78
+ * валидация, незачем дальше идти по HTTP-парсерам.
79
+ */
80
+ var fileValidationParser = (ctx) => {
81
+ const raw = ctx.raw;
82
+ if (!raw || typeof raw !== "object") return null;
83
+ if (raw.name !== "FileValidationError") return null;
84
+ const list = raw.issues ?? raw.errors ?? [];
85
+ const details = [];
86
+ for (const it of list) {
87
+ if (!it || typeof it !== "object") continue;
88
+ const msg = typeof it.message === "string" ? it.message : "";
89
+ if (!msg) continue;
90
+ const fileName = it.file?.name;
91
+ details.push(fileName ? `${fileName}: ${msg}` : msg);
92
+ }
93
+ return {
94
+ kind: "validation",
95
+ message: raw.message || ctx.texts.validationMessage,
96
+ details: details.length ? details : void 0,
97
+ stop: true
98
+ };
99
+ };
100
+ //#endregion
101
+ //#region src/components/GrResponseErrorBanner/parsers/httpStatusParser.ts
102
+ /**
103
+ * Базовая классификация по HTTP-статусу.
104
+ *
105
+ * Правила:
106
+ * - `400` / `422` ⇒ `kind: 'validation'`,
107
+ * - остальные `4xx` ⇒ `kind: 'client'`,
108
+ * - `>= 500` ⇒ `kind: 'server'`.
109
+ *
110
+ * Не использует `stop` — даёт более специализированным парсерам
111
+ * (Laravel/JSON:API/RFC 7807) уточнить сообщение и `fieldErrors`.
112
+ *
113
+ * `message` берёт из `ctx.texts` как осмысленный фолбэк.
114
+ */
115
+ var httpStatusParser = (ctx) => {
116
+ const status = ctx.status;
117
+ if (typeof status !== "number") return null;
118
+ if (status >= 500) return {
119
+ kind: "server",
120
+ status,
121
+ message: ctx.texts.serverMessage
122
+ };
123
+ if (status === 400 || status === 422) return {
124
+ kind: "validation",
125
+ status,
126
+ message: ctx.texts.validationMessage
127
+ };
128
+ if (status >= 400) return {
129
+ kind: "client",
130
+ status,
131
+ message: ctx.texts.clientMessage
132
+ };
133
+ return null;
134
+ };
135
+ //#endregion
136
+ //#region src/components/GrResponseErrorBanner/parsers/jsonApiErrorParser.ts
137
+ /**
138
+ * Парсер JSON:API-стиля:
139
+ *
140
+ * ```json
141
+ * { "errors": [
142
+ * { "status": "422", "title": "Invalid Attribute",
143
+ * "detail": "Email is required.",
144
+ * "source": { "pointer": "/data/attributes/email" } }
145
+ * ] }
146
+ * ```
147
+ *
148
+ * Активируется, когда `ctx.body.errors` — массив объектов с `title`/`detail`.
149
+ * Поле извлекается из последнего сегмента `source.pointer`. Все `detail`
150
+ * собираются в `details`, первый `title` — в `message`.
151
+ */
152
+ var jsonApiErrorParser = (ctx) => {
153
+ const body = ctx.body;
154
+ if (!body || typeof body !== "object") return null;
155
+ const errors = body.errors;
156
+ if (!Array.isArray(errors) || errors.length === 0) return null;
157
+ const first = errors[0];
158
+ if (!first || typeof first !== "object") return null;
159
+ const has = (key) => key in first;
160
+ if (!has("title") && !has("detail") && !has("source")) return null;
161
+ const fieldErrorsMap = /* @__PURE__ */ new Map();
162
+ const details = [];
163
+ let message;
164
+ for (const e of errors) {
165
+ if (!e || typeof e !== "object") continue;
166
+ const eo = e;
167
+ const text = typeof eo.detail === "string" && eo.detail || typeof eo.title === "string" && eo.title || "";
168
+ if (!text) continue;
169
+ if (!message && typeof eo.title === "string") message = eo.title;
170
+ const pointer = typeof eo.source?.pointer === "string" ? eo.source.pointer : "";
171
+ const field = pointer ? pointer.split("/").filter(Boolean).pop() : void 0;
172
+ if (field) {
173
+ const list = fieldErrorsMap.get(field) ?? [];
174
+ list.push(text);
175
+ fieldErrorsMap.set(field, list);
176
+ }
177
+ details.push(text);
178
+ }
179
+ if (!details.length) return null;
180
+ const fieldErrors = Array.from(fieldErrorsMap, ([field, messages]) => ({
181
+ field,
182
+ messages
183
+ }));
184
+ const kind = fieldErrors.length ? "validation" : void 0;
185
+ return {
186
+ kind,
187
+ message: message || (kind === "validation" ? ctx.texts.validationMessage : ctx.texts.clientMessage),
188
+ details,
189
+ fieldErrors: fieldErrors.length ? fieldErrors : void 0
190
+ };
191
+ };
192
+ //#endregion
193
+ //#region src/components/GrResponseErrorBanner/parsers/laravelValidationParser.ts
194
+ /**
195
+ * Парсит Laravel-формат ответа об ошибке валидации:
196
+ *
197
+ * ```json
198
+ * { "message": "The given data was invalid.",
199
+ * "errors": { "file": ["The file is required."], "amount": ["..."] } }
200
+ * ```
201
+ *
202
+ * Активируется при наличии `ctx.body.errors` как plain-объекта (значения —
203
+ * массив строк или строка). Если есть `fieldErrors`, повышает `kind` до
204
+ * `validation` независимо от статуса (полезно, когда сервер прислал 200/4xx
205
+ * без 422). `message` берётся из `body.message` / `body.error`.
206
+ */
207
+ var laravelValidationParser = (ctx) => {
208
+ const body = ctx.body;
209
+ if (!body || typeof body !== "object" || Array.isArray(body)) return null;
210
+ const data = body;
211
+ const errors = data.errors;
212
+ if (!errors || typeof errors !== "object" || Array.isArray(errors)) return null;
213
+ const fieldErrors = [];
214
+ for (const [field, raw] of Object.entries(errors)) {
215
+ const messages = Array.isArray(raw) ? raw.filter((m) => typeof m === "string") : typeof raw === "string" ? [raw] : [];
216
+ if (messages.length) fieldErrors.push({
217
+ field,
218
+ messages
219
+ });
220
+ }
221
+ if (!fieldErrors.length) return null;
222
+ return {
223
+ kind: "validation",
224
+ message: typeof data.message === "string" && data.message || typeof data.error === "string" && data.error || ctx.texts.validationMessage,
225
+ details: fieldErrors.flatMap((fe) => fe.messages),
226
+ fieldErrors
227
+ };
228
+ };
229
+ //#endregion
230
+ //#region src/components/GrResponseErrorBanner/parsers/networkErrorParser.ts
231
+ /**
232
+ * Распознаёт транспортные ошибки **без ответа сервера**: отсутствие интернета,
233
+ * DNS-фейл, CORS-preflight, fetch `TypeError('Failed to fetch')`,
234
+ * axios `ERR_NETWORK`/`ECONNABORTED`.
235
+ *
236
+ * Триггеры:
237
+ * - `ctx.isNetwork === true` (выставлено `normalizeError`),
238
+ * - либо нет ни `status`, ни `body`, ни признака отмены, но есть исходная
239
+ * ошибка с `code === 'ERR_NETWORK'` / `message ~ /network|fetch/i/`.
240
+ *
241
+ * Возвращает `kind: 'network'` и `stop: true`.
242
+ */
243
+ var networkErrorParser = (ctx) => {
244
+ if (ctx.isAbort) return null;
245
+ if (ctx.isNetwork) return {
246
+ kind: "network",
247
+ message: ctx.texts.networkMessage,
248
+ stop: true
249
+ };
250
+ if (typeof ctx.status !== "number" && ctx.body == null && ctx.raw && typeof ctx.raw === "object") {
251
+ const r = ctx.raw;
252
+ if (r.code === "ERR_NETWORK" || typeof r.message === "string" && /network|failed to fetch/i.test(r.message)) return {
253
+ kind: "network",
254
+ message: ctx.texts.networkMessage,
255
+ stop: true
256
+ };
257
+ }
258
+ return null;
259
+ };
260
+ //#endregion
261
+ //#region src/components/GrResponseErrorBanner/parsers/normalizeError.ts
262
+ /**
263
+ * Универсально приводит «сырой» вход к {@link NormalizedRawError}.
264
+ *
265
+ * Поддерживаемые источники:
266
+ * - **axios** — `AxiosError` с `response.status`/`response.data`/`response.headers`,
267
+ * либо `request` без `response` + `code === 'ERR_NETWORK'`, либо `code === 'ERR_CANCELED'`.
268
+ * - **fetch `Response`** — объект `Response` с `ok=false`. Тело читается через
269
+ * `clone().json()` (с фолбэком на `.text()`); поэтому функция асинхронная.
270
+ * - **fetch `TypeError`** — `TypeError('Failed to fetch')` ⇒ `isNetwork=true`.
271
+ * - **`{ response: Response, body: unknown }`** — если потребитель уже прочитал тело сам.
272
+ * - **`XMLHttpRequest`** / `{ status, responseText, response }` — пара полей.
273
+ * - **`AbortError` / `DOMException`** ⇒ `isAbort=true`.
274
+ * - **`Error`/строка/произвольный объект** — кладётся в `body`/`raw` как есть.
275
+ *
276
+ * Цель — отделить «откуда пришла ошибка» от «как её классифицировать»: парсеры
277
+ * работают только с нормализованным `ResponseErrorContext`, не зная о транспорте.
278
+ */
279
+ async function normalizeError(raw) {
280
+ if (isPlainNormalized(raw)) return {
281
+ ...raw,
282
+ raw
283
+ };
284
+ if (isResponseEnvelope(raw)) {
285
+ const res = raw.response;
286
+ return {
287
+ raw,
288
+ status: res.status,
289
+ body: raw.body,
290
+ headers: readHeaders(res)
291
+ };
292
+ }
293
+ if (isFetchResponse(raw)) {
294
+ const body = await readFetchBody(raw);
295
+ return {
296
+ raw,
297
+ status: raw.status,
298
+ body,
299
+ headers: readHeaders(raw)
300
+ };
301
+ }
302
+ if (isXhr(raw)) {
303
+ const body = parseMaybeJson(raw.responseText) ?? raw.response;
304
+ return {
305
+ raw,
306
+ status: typeof raw.status === "number" ? raw.status : void 0,
307
+ body,
308
+ isAbort: raw.status === 0 && raw.readyState === 4
309
+ };
310
+ }
311
+ if (isAxiosLike(raw)) {
312
+ const e = raw;
313
+ const status = e.response?.status;
314
+ const code = e.code;
315
+ const isAbort = code === "ERR_CANCELED" || code === "CANCELED" || e.__CANCEL__ === true;
316
+ const isNetwork = !e.response && (code === "ERR_NETWORK" || code === "ECONNABORTED");
317
+ return {
318
+ raw,
319
+ status,
320
+ body: e.response?.data,
321
+ headers: normalizeHeaderRecord(e.response?.headers),
322
+ isAbort,
323
+ isNetwork
324
+ };
325
+ }
326
+ if (isAbortError(raw)) return {
327
+ raw,
328
+ isAbort: true
329
+ };
330
+ if (raw instanceof TypeError && /fetch|network/i.test(raw.message || "")) return {
331
+ raw,
332
+ isNetwork: true
333
+ };
334
+ if (raw instanceof Error) return {
335
+ raw,
336
+ body: { message: raw.message }
337
+ };
338
+ if (typeof raw === "string") return {
339
+ raw,
340
+ body: { message: raw }
341
+ };
342
+ if (raw && typeof raw === "object") return {
343
+ raw,
344
+ body: raw
345
+ };
346
+ return { raw };
347
+ }
348
+ function isPlainNormalized(v) {
349
+ if (!v || typeof v !== "object") return false;
350
+ const o = v;
351
+ return "raw" in o && ("status" in o || "body" in o || "isAbort" in o || "isNetwork" in o || "headers" in o);
352
+ }
353
+ function isResponseEnvelope(v) {
354
+ return !!v && typeof v === "object" && "response" in v && isFetchResponse(v.response);
355
+ }
356
+ function isFetchResponse(v) {
357
+ return typeof Response !== "undefined" && v instanceof Response;
358
+ }
359
+ function isXhr(v) {
360
+ return typeof XMLHttpRequest !== "undefined" && v instanceof XMLHttpRequest;
361
+ }
362
+ function isAxiosLike(v) {
363
+ if (!v || typeof v !== "object") return false;
364
+ const o = v;
365
+ return o.isAxiosError === true || "response" in o && typeof o.response === "object" && o.response !== null || "code" in o && typeof o.code === "string";
366
+ }
367
+ function isAbortError(v) {
368
+ if (!v || typeof v !== "object") return false;
369
+ const o = v;
370
+ return o.name === "AbortError" || o.name === "CanceledError" || o.code === "ERR_CANCELED";
371
+ }
372
+ async function readFetchBody(res) {
373
+ if (res.bodyUsed) return void 0;
374
+ try {
375
+ const text = await res.clone().text();
376
+ return parseMaybeJson(text) ?? text;
377
+ } catch {
378
+ return;
379
+ }
380
+ }
381
+ function readHeaders(res) {
382
+ const out = {};
383
+ res.headers.forEach((value, key) => {
384
+ out[key.toLowerCase()] = value;
385
+ });
386
+ return out;
387
+ }
388
+ function normalizeHeaderRecord(h) {
389
+ if (!h || typeof h !== "object") return void 0;
390
+ const out = {};
391
+ for (const [k, v] of Object.entries(h)) if (typeof v === "string") out[k.toLowerCase()] = v;
392
+ return out;
393
+ }
394
+ function parseMaybeJson(text) {
395
+ if (typeof text !== "string" || !text) return void 0;
396
+ try {
397
+ return JSON.parse(text);
398
+ } catch {
399
+ return;
400
+ }
401
+ }
402
+ //#endregion
403
+ //#region src/components/GrResponseErrorBanner/parsers/plainMessageParser.ts
404
+ /**
405
+ * Финальный фолбэк-парсер. Достаёт хоть какое-нибудь человекочитаемое
406
+ * сообщение, чтобы баннер не был пустым.
407
+ *
408
+ * Источники (по приоритету):
409
+ * 1. `ctx.body` — если строка ⇒ message,
410
+ * 2. `ctx.body[messageKey]` (default `'message'`),
411
+ * 3. `ctx.body.error` (строка),
412
+ * 4. `ctx.raw.message` (для голых `Error`).
413
+ *
414
+ * Не выставляет `kind` — оставляет на усмотрение классификатора.
415
+ * Использует ключ `messageKey` из `ctx.meta._messageKey`, если задан.
416
+ */
417
+ var plainMessageParser = (ctx) => {
418
+ const messageKey = ctx.meta._messageKey || "message";
419
+ if (typeof ctx.body === "string" && ctx.body.trim()) return { message: ctx.body };
420
+ if (ctx.body && typeof ctx.body === "object") {
421
+ const data = ctx.body;
422
+ const fromKey = data[messageKey];
423
+ if (typeof fromKey === "string" && fromKey) return { message: fromKey };
424
+ if (typeof data.error === "string" && data.error) return { message: data.error };
425
+ }
426
+ if (ctx.raw instanceof Error && ctx.raw.message) return { message: ctx.raw.message };
427
+ return null;
428
+ };
429
+ //#endregion
430
+ //#region src/components/GrResponseErrorBanner/parsers/problemDetailsParser.ts
431
+ /**
432
+ * Парсер RFC 7807 «Problem Details for HTTP APIs»:
433
+ *
434
+ * ```json
435
+ * { "type": "https://example.com/probs/out-of-credit",
436
+ * "title": "You do not have enough credit.",
437
+ * "status": 403,
438
+ * "detail": "Your current balance is 30.",
439
+ * "errors": { "balance": ["..."] } }
440
+ * ```
441
+ *
442
+ * Активируется, если есть `body.type` + `body.title`, либо
443
+ * Content-Type заголовка `application/problem+json`. Берёт `title` как
444
+ * `message`, `detail` — в `details[0]`, status — в `status`.
445
+ */
446
+ var problemDetailsParser = (ctx) => {
447
+ const body = ctx.body;
448
+ if (!body || typeof body !== "object" || Array.isArray(body)) return null;
449
+ const data = body;
450
+ const isProblemContentType = ctx.headers?.["content-type"]?.includes("application/problem+json");
451
+ const hasShape = typeof data.title === "string" && (typeof data.type === "string" || typeof data.status === "number");
452
+ if (!isProblemContentType && !hasShape) return null;
453
+ const message = typeof data.title === "string" ? data.title : ctx.texts.unknownMessage;
454
+ const details = [];
455
+ if (typeof data.detail === "string" && data.detail) details.push(data.detail);
456
+ const status = typeof data.status === "number" ? data.status : ctx.status;
457
+ return {
458
+ message,
459
+ details: details.length ? details : void 0,
460
+ status
461
+ };
462
+ };
463
+ //#endregion
464
+ //#region src/components/GrResponseErrorBanner/parsers/createResponseErrorClassifier.ts
465
+ /**
466
+ * Дефолтная цепочка парсеров. Порядок важен:
467
+ * `abort → network → fileValidation → laravel → problemDetails → jsonApi → httpStatus → plainMessage`.
468
+ *
469
+ * - Ранние специализированные парсеры могут поставить `stop` (abort/file).
470
+ * - HTTP-парсер даёт fallback-kind/message, чтобы остальное могло уточнить.
471
+ * - `plainMessage` всегда последний — добывает хоть какое-то сообщение.
472
+ */
473
+ var defaultResponseErrorParsers = [
474
+ abortErrorParser,
475
+ networkErrorParser,
476
+ fileValidationParser,
477
+ laravelValidationParser,
478
+ problemDetailsParser,
479
+ jsonApiErrorParser,
480
+ httpStatusParser,
481
+ plainMessageParser
482
+ ];
483
+ /**
484
+ * Универсальное «ядро» парсеров — транспортно-независимый набор, безопасный
485
+ * для любого бэкенда (Laravel / Symfony / Go / …). Не делает формат-специфичных
486
+ * допущений: разбирает только отмену, сетевые ошибки, HTTP-статус и «плоское»
487
+ * сообщение из тела. Используется как дефолт в `useDialogService`.
488
+ *
489
+ * Порядок: `abort → network → httpStatus → plainMessage`.
490
+ */
491
+ var coreResponseErrorParsers = [
492
+ abortErrorParser,
493
+ networkErrorParser,
494
+ httpStatusParser,
495
+ plainMessageParser
496
+ ];
497
+ /** Объект пресетов, передаётся builder-функции `errorParsers`. */
498
+ var responseErrorParserPresets = {
499
+ core: coreResponseErrorParsers,
500
+ all: defaultResponseErrorParsers,
501
+ laravel: laravelValidationParser,
502
+ problemDetails: problemDetailsParser,
503
+ jsonApi: jsonApiErrorParser,
504
+ fileValidation: fileValidationParser
505
+ };
506
+ /** Добавляет пользовательские парсеры в начало дефолтной цепочки. */
507
+ function extendDefaultParsers(extra) {
508
+ return [...extra, ...defaultResponseErrorParsers];
509
+ }
510
+ /**
511
+ * Фабрика классификатора. Возвращает функцию `(raw, meta?) => Promise<ResponseErrorInfo>`,
512
+ * которая:
513
+ * 1. нормализует вход через `normalizeError`,
514
+ * 2. строит `ResponseErrorContext`,
515
+ * 3. прогоняет цепочку парсеров (с поддержкой `stop`),
516
+ * 4. собирает финальный `ResponseErrorInfo` с фолбэками из `texts`.
517
+ */
518
+ function createResponseErrorClassifier(options = {}) {
519
+ const parsers = options.parsers ?? defaultResponseErrorParsers;
520
+ const texts = {
521
+ ...DEFAULT_RESPONSE_ERROR_TEXTS,
522
+ ...options.texts ?? {}
523
+ };
524
+ const messageKey = options.messageKey ?? "message";
525
+ return async function classify(raw, meta = {}) {
526
+ const ctx = {
527
+ ...await normalizeError(raw),
528
+ meta: {
529
+ ...meta,
530
+ _messageKey: messageKey
531
+ },
532
+ texts
533
+ };
534
+ let kind;
535
+ let status = ctx.status;
536
+ let message;
537
+ let details;
538
+ let fieldErrors;
539
+ for (const parser of parsers) {
540
+ const result = parser(ctx);
541
+ if (!result) continue;
542
+ if (result.kind) kind = result.kind;
543
+ if (typeof result.status === "number") status = result.status;
544
+ if (result.message) message = result.message;
545
+ if (result.details?.length) details = result.details;
546
+ if (result.fieldErrors?.length) fieldErrors = result.fieldErrors;
547
+ if (result.stop) break;
548
+ }
549
+ if (!kind) kind = "unknown";
550
+ if (!message) message = resolveDefaultMessage(kind, texts);
551
+ return {
552
+ kind,
553
+ status,
554
+ message,
555
+ details,
556
+ fieldErrors,
557
+ raw,
558
+ meta
559
+ };
560
+ };
561
+ }
562
+ function resolveDefaultMessage(kind, texts) {
563
+ switch (kind) {
564
+ case "network": return texts.networkMessage;
565
+ case "aborted": return texts.abortedMessage;
566
+ case "validation": return texts.validationMessage;
567
+ case "client": return texts.clientMessage;
568
+ case "server": return texts.serverMessage;
569
+ default: return texts.unknownMessage;
570
+ }
571
+ }
572
+ function resolveResponseErrorTitle(kind, texts) {
573
+ switch (kind) {
574
+ case "network": return texts.networkTitle;
575
+ case "aborted": return texts.abortedTitle;
576
+ case "validation": return texts.validationTitle;
577
+ case "client": return texts.clientTitle;
578
+ case "server": return texts.serverTitle;
579
+ default: return texts.unknownTitle;
580
+ }
581
+ }
582
+ //#endregion
583
+ //#region src/components/GrResponseErrorBanner/GrResponseErrorBanner.vue?vue&type=script&setup=true&lang.ts
584
+ var _hoisted_1 = { class: "flex flex-col gap-2" };
585
+ var _hoisted_2 = { class: "flex flex-wrap items-center gap-2" };
586
+ var _hoisted_3 = ["data-testid"];
587
+ var _hoisted_4 = ["data-testid"];
588
+ var _hoisted_5 = ["data-testid"];
589
+ var _hoisted_6 = {
590
+ key: 1,
591
+ class: "mt-1 flex flex-wrap items-center gap-2"
592
+ };
593
+ //#endregion
594
+ //#region src/components/GrResponseErrorBanner/GrResponseErrorBanner.vue
595
+ var GrResponseErrorBanner_default = /* @__PURE__ */ defineComponent({
596
+ __name: "GrResponseErrorBanner",
597
+ props: {
598
+ error: {},
599
+ texts: { default: () => ({}) },
600
+ tone: { default: void 0 },
601
+ toneByKind: { default: () => ({}) },
602
+ showDetails: {
603
+ type: Boolean,
604
+ default: true
605
+ },
606
+ showFieldLabels: {
607
+ type: Boolean,
608
+ default: true
609
+ },
610
+ fieldLabels: { default: () => ({}) },
611
+ dedupeDetails: {
612
+ type: Boolean,
613
+ default: true
614
+ },
615
+ canRetry: {
616
+ type: Boolean,
617
+ default: false
618
+ },
619
+ canDismiss: {
620
+ type: Boolean,
621
+ default: true
622
+ },
623
+ autoHideKinds: { default: () => DEFAULT_AUTO_HIDE_KINDS },
624
+ showStatus: {
625
+ type: Boolean,
626
+ default: true
627
+ },
628
+ testIdPrefix: { default: "response-error" }
629
+ },
630
+ emits: ["retry", "dismiss"],
631
+ setup(__props, { emit: __emit }) {
632
+ const props = __props;
633
+ const emit = __emit;
634
+ const { t } = useGranularityTranslations();
635
+ const i18nTexts = computed(() => {
636
+ const out = {};
637
+ for (const key of Object.keys(DEFAULT_RESPONSE_ERROR_TEXTS)) out[key] = t(`gr.responseError.${key}`, DEFAULT_RESPONSE_ERROR_TEXTS[key]);
638
+ return out;
639
+ });
640
+ const mergedTexts = computed(() => ({
641
+ ...DEFAULT_RESPONSE_ERROR_TEXTS,
642
+ ...i18nTexts.value,
643
+ ...props.texts
644
+ }));
645
+ const mergedToneByKind = computed(() => ({
646
+ ...DEFAULT_TONE_BY_KIND,
647
+ ...props.toneByKind
648
+ }));
649
+ const isHidden = computed(() => {
650
+ if (!props.error) return true;
651
+ return props.autoHideKinds.includes(props.error.kind);
652
+ });
653
+ const tone = computed(() => {
654
+ if (props.tone) return props.tone;
655
+ if (!props.error) return "danger";
656
+ return mergedToneByKind.value[props.error.kind] ?? "danger";
657
+ });
658
+ const title = computed(() => {
659
+ if (!props.error) return "";
660
+ return resolveResponseErrorTitle(props.error.kind, mergedTexts.value);
661
+ });
662
+ /**
663
+ * Маппинг `kind` → ключ поля сообщения в `ResponseErrorTexts`.
664
+ * Используется, чтобы подменить «дефолтное английское» fallback-сообщение
665
+ * классификатора на i18n-перевод (или текущий `mergedTexts.<kind>Message`).
666
+ */
667
+ const KIND_MESSAGE_KEY = {
668
+ network: "networkMessage",
669
+ aborted: "abortedMessage",
670
+ validation: "validationMessage",
671
+ client: "clientMessage",
672
+ server: "serverMessage",
673
+ unknown: "unknownMessage"
674
+ };
675
+ const DEFAULT_FALLBACK_MESSAGES = new Set([
676
+ DEFAULT_RESPONSE_ERROR_TEXTS.networkMessage,
677
+ DEFAULT_RESPONSE_ERROR_TEXTS.abortedMessage,
678
+ DEFAULT_RESPONSE_ERROR_TEXTS.validationMessage,
679
+ DEFAULT_RESPONSE_ERROR_TEXTS.clientMessage,
680
+ DEFAULT_RESPONSE_ERROR_TEXTS.serverMessage,
681
+ DEFAULT_RESPONSE_ERROR_TEXTS.unknownMessage
682
+ ]);
683
+ const message = computed(() => {
684
+ const raw = props.error?.message ?? "";
685
+ if (!props.error) return raw;
686
+ if (!raw || DEFAULT_FALLBACK_MESSAGES.has(raw)) return mergedTexts.value[KIND_MESSAGE_KEY[props.error.kind]];
687
+ return raw;
688
+ });
689
+ /**
690
+ * Сводный список «деталей» под основным `message`.
691
+ * Предпочитаем `fieldErrors` (поле → сообщения), затем — плоский `details`.
692
+ * Дедуплицируем и убираем повтор с `message`.
693
+ */
694
+ const detailEntries = computed(() => {
695
+ if (!props.error || !props.showDetails) return [];
696
+ const seen = /* @__PURE__ */ new Set();
697
+ if (props.dedupeDetails) {
698
+ const main = message.value.trim();
699
+ if (main) seen.add(main);
700
+ }
701
+ const result = [];
702
+ const fieldErrors = props.error.fieldErrors;
703
+ if (fieldErrors?.length) {
704
+ for (const fe of fieldErrors) for (const m of fe.messages) {
705
+ const text = m.trim();
706
+ if (!text || seen.has(text)) continue;
707
+ seen.add(text);
708
+ result.push({
709
+ field: fe.field,
710
+ text
711
+ });
712
+ }
713
+ if (result.length) return result;
714
+ }
715
+ const details = props.error.details;
716
+ if (details?.length) for (const d of details) {
717
+ const text = (d ?? "").trim();
718
+ if (!text || seen.has(text)) continue;
719
+ seen.add(text);
720
+ result.push({ text });
721
+ }
722
+ return result;
723
+ });
724
+ function fieldLabel(field) {
725
+ if (!field) return void 0;
726
+ return props.fieldLabels[field] ?? field;
727
+ }
728
+ function onRetry() {
729
+ if (props.error) emit("retry", props.error);
730
+ }
731
+ function onDismiss() {
732
+ emit("dismiss");
733
+ }
734
+ return (_ctx, _cache) => {
735
+ return !isHidden.value && props.error ? (openBlock(), createBlock(GrAlert_default, {
736
+ key: 0,
737
+ tone: tone.value,
738
+ title: title.value,
739
+ closable: props.canDismiss,
740
+ "data-testid": `${props.testIdPrefix}-banner`,
741
+ "data-kind": props.error.kind,
742
+ onClose: onDismiss
743
+ }, {
744
+ default: withCtx(() => [createElementVNode("div", _hoisted_1, [
745
+ createElementVNode("div", _hoisted_2, [props.showStatus && typeof props.error.status === "number" ? (openBlock(), createElementBlock("span", {
746
+ key: 0,
747
+ class: "inline-flex items-center rounded-[var(--ds-radius-sm)] bg-[color-mix(in_srgb,currentColor_12%,transparent)] px-1.5 py-0.5 text-[11px] font-700 leading-none",
748
+ "data-testid": `${props.testIdPrefix}-status`
749
+ }, " HTTP " + toDisplayString(props.error.status), 9, _hoisted_3)) : createCommentVNode("", true), createElementVNode("span", {
750
+ class: "text-[13px]",
751
+ "data-testid": `${props.testIdPrefix}-message`
752
+ }, toDisplayString(message.value), 9, _hoisted_4)]),
753
+ detailEntries.value.length ? (openBlock(), createElementBlock("ul", {
754
+ key: 0,
755
+ class: "m-0 list-disc pl-5 text-[12px]",
756
+ "data-testid": `${props.testIdPrefix}-details`
757
+ }, [(openBlock(true), createElementBlock(Fragment, null, renderList(detailEntries.value, (entry, idx) => {
758
+ return openBlock(), createElementBlock("li", { key: `${entry.field ?? ""}:${idx}` }, [props.showFieldLabels && entry.field ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [createElementVNode("strong", null, toDisplayString(fieldLabel(entry.field)) + ":", 1), _cache[0] || (_cache[0] = createTextVNode("\xA0 ", -1))], 64)) : createCommentVNode("", true), createTextVNode(toDisplayString(entry.text), 1)]);
759
+ }), 128))], 8, _hoisted_5)) : createCommentVNode("", true),
760
+ props.canRetry ? (openBlock(), createElementBlock("div", _hoisted_6, [createVNode(GrButton_default, {
761
+ size: "sm",
762
+ variant: "outline",
763
+ "data-testid": `${props.testIdPrefix}-retry`,
764
+ onClick: onRetry
765
+ }, {
766
+ default: withCtx(() => [createTextVNode(toDisplayString(mergedTexts.value.retryLabel), 1)]),
767
+ _: 1
768
+ }, 8, ["data-testid"])])) : createCommentVNode("", true)
769
+ ])]),
770
+ _: 1
771
+ }, 8, [
772
+ "tone",
773
+ "title",
774
+ "closable",
775
+ "data-testid",
776
+ "data-kind"
777
+ ])) : createCommentVNode("", true);
778
+ };
779
+ }
780
+ });
781
+ //#endregion
782
+ export { DEFAULT_AUTO_HIDE_KINDS as _, extendDefaultParsers as a, problemDetailsParser as c, networkErrorParser as d, laravelValidationParser as f, abortErrorParser as g, fileValidationParser as h, defaultResponseErrorParsers as i, plainMessageParser as l, httpStatusParser as m, coreResponseErrorParsers as n, resolveResponseErrorTitle as o, jsonApiErrorParser as p, createResponseErrorClassifier as r, responseErrorParserPresets as s, GrResponseErrorBanner_default as t, normalizeError as u, DEFAULT_RESPONSE_ERROR_TEXTS as v, DEFAULT_TONE_BY_KIND as y };