@digigov/ui 0.21.2 → 0.23.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 (587) hide show
  1. package/CHANGELOG.md +39 -1
  2. package/admin/AutoComplete/AccesibleAutoComplete/index.d.ts +5 -0
  3. package/admin/AutoComplete/AccesibleAutoComplete/index.js +106 -0
  4. package/admin/AutoComplete/AutoComplete.stories.d.ts +13 -0
  5. package/admin/AutoComplete/AutoComplete.stories.js +115 -0
  6. package/admin/AutoComplete/Status/index.d.ts +40 -0
  7. package/admin/AutoComplete/Status/index.js +184 -0
  8. package/{app/CopyToClipboard → admin/AutoComplete}/__stories__/Default.d.ts +0 -0
  9. package/admin/AutoComplete/__stories__/Default.js +34 -0
  10. package/admin/AutoComplete/__stories__/WithAutoSelect.d.ts +3 -0
  11. package/admin/AutoComplete/__stories__/WithAutoSelect.js +35 -0
  12. package/admin/AutoComplete/__stories__/WithDefaultValue.d.ts +3 -0
  13. package/admin/AutoComplete/__stories__/WithDefaultValue.js +33 -0
  14. package/admin/AutoComplete/__stories__/WithInLine.d.ts +3 -0
  15. package/admin/AutoComplete/__stories__/WithInLine.js +33 -0
  16. package/admin/AutoComplete/__stories__/WithMinLength.d.ts +3 -0
  17. package/admin/AutoComplete/__stories__/WithMinLength.js +35 -0
  18. package/admin/AutoComplete/__stories__/WithPlaceHolder.d.ts +3 -0
  19. package/admin/AutoComplete/__stories__/WithPlaceHolder.js +33 -0
  20. package/admin/AutoComplete/__stories__/WithShowAllValues.d.ts +3 -0
  21. package/admin/AutoComplete/__stories__/WithShowAllValues.js +33 -0
  22. package/admin/AutoComplete/index.d.ts +101 -0
  23. package/admin/AutoComplete/index.js +744 -0
  24. package/admin/AutoComplete/index.mdx +46 -0
  25. package/admin/AutoComplete/utils.d.ts +1 -0
  26. package/admin/AutoComplete/utils.js +13 -0
  27. package/admin/CopyToClipboard/CopyToClipboard.stories.d.ts +9 -0
  28. package/admin/CopyToClipboard/CopyToClipboard.stories.js +58 -0
  29. package/admin/CopyToClipboard/__stories__/Banner.d.ts +3 -0
  30. package/admin/CopyToClipboard/__stories__/Banner.js +30 -0
  31. package/admin/CopyToClipboard/__stories__/Default.d.ts +3 -0
  32. package/admin/CopyToClipboard/__stories__/Default.js +32 -0
  33. package/admin/CopyToClipboard/__stories__/MultipleCopies.d.ts +3 -0
  34. package/{app/CopyToClipboard/__stories__/Default.js → admin/CopyToClipboard/__stories__/MultipleCopies.js} +20 -18
  35. package/admin/CopyToClipboard/index.d.ts +1 -1
  36. package/admin/CopyToClipboard/index.js +3 -2
  37. package/admin/CopyToClipboard/index.mdx +22 -0
  38. package/admin/Drawer/__stories__/Default.js +1 -1
  39. package/admin/Drawer/index.mdx +12 -0
  40. package/admin/Dropdown/Dropdown.stories.d.ts +9 -0
  41. package/admin/Dropdown/Dropdown.stories.js +60 -0
  42. package/admin/Dropdown/__stories__/AlignRight.d.ts +3 -0
  43. package/admin/Dropdown/__stories__/AlignRight.js +83 -0
  44. package/admin/Dropdown/__stories__/Default.d.ts +3 -0
  45. package/admin/Dropdown/__stories__/Default.js +75 -0
  46. package/admin/Dropdown/__stories__/PlacementTop.d.ts +3 -0
  47. package/admin/Dropdown/__stories__/PlacementTop.js +83 -0
  48. package/admin/Dropdown/index.d.ts +7 -1
  49. package/admin/Dropdown/index.js +29 -1
  50. package/admin/Dropdown/index.mdx +29 -0
  51. package/admin/FilterSection/index.d.ts +1 -0
  52. package/admin/FilterSection/index.js +14 -0
  53. package/admin/Modal/Modal.stories.d.ts +8 -0
  54. package/admin/Modal/Modal.stories.js +44 -0
  55. package/admin/Modal/__stories__/AlertDialog.d.ts +3 -0
  56. package/admin/Modal/__stories__/AlertDialog.js +80 -0
  57. package/admin/Modal/__stories__/Default.d.ts +3 -0
  58. package/admin/Modal/__stories__/Default.js +79 -0
  59. package/admin/Modal/index.mdx +26 -0
  60. package/admin/Pagination/__stories__/Default.js +57 -16
  61. package/admin/Pagination/index.mdx +12 -0
  62. package/admin/index.d.ts +2 -1
  63. package/admin/index.js +17 -4
  64. package/api/fetchAPI.js +6 -4
  65. package/api/index.spec.js +18 -19
  66. package/api/useResource.js +6 -4
  67. package/api/useResourceAction.js +6 -4
  68. package/api/useResourceQuery.js +7 -4
  69. package/api/utils.js +8 -6
  70. package/app/Confirmation/Confirmation.mdx +9 -0
  71. package/app/Footer/Footer.mdx +27 -0
  72. package/app/Header/index.mdx +18 -0
  73. package/app/I18nText.js +7 -7
  74. package/app/NotFound/index.mdx +12 -0
  75. package/app/PhaseBannerHeader/index.mdx +12 -0
  76. package/core/Accordion/__stories__/Default.js +17 -1
  77. package/core/Accordion/__stories__/WithHints.js +17 -1
  78. package/core/Accordion/index.mdx +16 -84
  79. package/core/BackLink/index.mdx +16 -0
  80. package/core/Blockquote/index.mdx +17 -2
  81. package/core/Breadcrumbs/__stories__/Default.js +13 -1
  82. package/core/Breadcrumbs/breadcrumbs.mdx +22 -0
  83. package/core/Button/Button.stories.d.ts +5 -0
  84. package/core/Button/Button.stories.js +72 -0
  85. package/core/Button/__stories__/Back.d.ts +4 -0
  86. package/core/Button/__stories__/Back.js +26 -0
  87. package/core/Button/__stories__/ButtonLinkButton.d.ts +6 -0
  88. package/core/Button/__stories__/ButtonLinkButton.js +30 -0
  89. package/core/Button/__stories__/CallToActionButton.d.ts +6 -0
  90. package/core/Button/__stories__/CallToActionButton.js +30 -0
  91. package/core/Button/__stories__/Disabled.d.ts +6 -0
  92. package/core/Button/__stories__/Disabled.js +27 -0
  93. package/core/Button/__stories__/GroupingButtonsAndLinks.js +3 -1
  94. package/core/Button/__stories__/Primary.js +3 -1
  95. package/core/Button/__stories__/Secondary.js +3 -2
  96. package/core/Button/__stories__/Warning.js +2 -1
  97. package/core/Button/__stories__/WithVariantLink.d.ts +6 -0
  98. package/core/Button/__stories__/WithVariantLink.js +29 -0
  99. package/core/Button/index.mdx +97 -0
  100. package/core/Card/Card.stories.d.ts +1 -0
  101. package/core/Card/Card.stories.js +14 -0
  102. package/core/Card/__stories__/WithClickableLink.js +1 -3
  103. package/core/Card/__stories__/WithGroupButton.d.ts +3 -0
  104. package/core/Card/__stories__/WithGroupButton.js +32 -0
  105. package/core/Card/card.mdx +78 -0
  106. package/core/Checkboxes/Checkbox.stories.d.ts +1 -0
  107. package/core/Checkboxes/Checkbox.stories.js +14 -0
  108. package/core/Checkboxes/__stories__/ConditionalReveal.js +5 -1
  109. package/core/Checkboxes/__stories__/Default.js +5 -1
  110. package/core/Checkboxes/__stories__/MultipleQuestions.js +6 -2
  111. package/core/Checkboxes/__stories__/NoneAnswer.js +5 -1
  112. package/core/Checkboxes/__stories__/NoneAnswerWithError.d.ts +3 -0
  113. package/core/Checkboxes/__stories__/NoneAnswerWithError.js +57 -0
  114. package/core/Checkboxes/__stories__/WithErrorMessage.js +7 -1
  115. package/core/Checkboxes/__stories__/WithHint.js +5 -1
  116. package/core/Checkboxes/checkboxes.mdx +54 -0
  117. package/core/Confirmation/confirmation.mdx +19 -0
  118. package/core/DateInput/DateInput.stories.d.ts +1 -0
  119. package/core/DateInput/DateInput.stories.js +14 -0
  120. package/core/DateInput/__stories__/Default.js +3 -1
  121. package/core/DateInput/__stories__/MultipleQuestions.d.ts +3 -0
  122. package/core/DateInput/__stories__/MultipleQuestions.js +41 -0
  123. package/core/DateInput/index.mdx +34 -0
  124. package/core/Details/index.mdx +9 -25
  125. package/core/ErrorMessage/__stories__/Default.js +1 -1
  126. package/core/ErrorMessage/index.mdx +21 -0
  127. package/core/ErrorSummary/__stories__/LinkedToCheckbox.js +1 -1
  128. package/core/ErrorSummary/index.mdx +21 -38
  129. package/core/FileUpload/__stories__/Default.d.ts +1 -0
  130. package/core/FileUpload/__stories__/Default.js +4 -2
  131. package/core/FileUpload/index.mdx +22 -0
  132. package/core/Link/__stories__/DarkBackground.js +4 -2
  133. package/core/Link/__stories__/DarkBackgroundNoUnderline.js +4 -2
  134. package/core/Link/__stories__/Default.js +3 -1
  135. package/core/Link/__stories__/NoUnderline.js +3 -1
  136. package/core/Link/link.mdx +34 -0
  137. package/core/List/index.mdx +22 -3
  138. package/core/Masthead/masthead.mdx +14 -0
  139. package/core/NavList/NavList.d.ts +1 -14
  140. package/core/NavList/NavList.js +14 -71
  141. package/core/NavList/NavList.stories.d.ts +8 -0
  142. package/core/NavList/NavList.stories.js +44 -0
  143. package/core/NavList/NavListBase.d.ts +4 -0
  144. package/core/NavList/NavListBase.js +76 -0
  145. package/core/NavList/NavListItem.d.ts +1 -0
  146. package/core/NavList/NavListItem.js +3 -1
  147. package/core/NavList/NavListItemBase.d.ts +1 -0
  148. package/core/NavList/NavListItemBase.js +7 -3
  149. package/core/NavList/NavListSubMenu.d.ts +1 -1
  150. package/core/NavList/NavListSubMenu.js +2 -2
  151. package/core/NavList/__stories__/Default.d.ts +3 -0
  152. package/core/NavList/__stories__/Default.js +69 -0
  153. package/core/NavList/__stories__/NavHorizontalLayout.d.ts +3 -0
  154. package/core/NavList/__stories__/NavHorizontalLayout.js +67 -0
  155. package/core/NavList/index.mdx +22 -1
  156. package/core/NavList/types.d.ts +14 -0
  157. package/core/NavList/types.js +5 -0
  158. package/core/NotificationBanner/index.mdx +13 -60
  159. package/core/PhaseBanner/PhaseBanner.stories.d.ts +1 -0
  160. package/core/PhaseBanner/PhaseBanner.stories.js +14 -0
  161. package/core/PhaseBanner/__stories__/Underlined.d.ts +3 -0
  162. package/{admin/CopyToClipboardMessage/index.js → core/PhaseBanner/__stories__/Underlined.js} +21 -17
  163. package/core/PhaseBanner/index.mdx +24 -0
  164. package/core/Radios/__stories__/ConditionalReveal.js +5 -1
  165. package/core/Radios/__stories__/Default.js +1 -3
  166. package/core/Radios/__stories__/Inline.js +5 -1
  167. package/core/Radios/__stories__/MultipleQuestions.js +7 -3
  168. package/core/Radios/__stories__/WithErrorMessage.js +7 -1
  169. package/core/Radios/__stories__/WithHints.js +17 -7
  170. package/core/Radios/index.mdx +56 -0
  171. package/core/Select/Select.stories.d.ts +1 -0
  172. package/core/Select/Select.stories.js +14 -0
  173. package/core/Select/__stories__/Default.js +2 -2
  174. package/core/Select/__stories__/DisabledInput.js +3 -1
  175. package/core/Select/__stories__/WithHint.d.ts +3 -0
  176. package/core/Select/__stories__/WithHint.js +45 -0
  177. package/core/Select/index.mdx +42 -0
  178. package/core/SummaryList/SummaryList.stories.d.ts +2 -2
  179. package/core/SummaryList/SummaryList.stories.js +8 -8
  180. package/core/SummaryList/__stories__/Default.js +1 -1
  181. package/core/SummaryList/__stories__/WithActions.d.ts +3 -0
  182. package/core/SummaryList/__stories__/{SummaryListWithActions.js → WithActions.js} +10 -12
  183. package/core/SummaryList/__stories__/WithoutBorders.d.ts +3 -0
  184. package/core/SummaryList/__stories__/{SummaryListWithoutBorders.js → WithoutBorders.js} +5 -5
  185. package/core/SummaryList/index.mdx +17 -65
  186. package/core/Table/Table.stories.d.ts +1 -0
  187. package/core/Table/Table.stories.js +14 -0
  188. package/core/Table/TableFloatingScroll.d.ts +3 -0
  189. package/core/Table/TableFloatingScroll.js +105 -0
  190. package/core/Table/__stories__/DarkVariant.js +1 -1
  191. package/core/Table/__stories__/Default.js +1 -1
  192. package/core/Table/__stories__/NoData.js +3 -1
  193. package/core/Table/__stories__/TableCaptions.d.ts +3 -0
  194. package/core/Table/__stories__/TableCaptions.js +30 -0
  195. package/core/Table/__stories__/WithLoader.js +16 -12
  196. package/core/Table/index.d.ts +1 -0
  197. package/core/Table/index.js +13 -0
  198. package/core/Table/index.mdx +59 -0
  199. package/core/Tabs/__stories__/Default.d.ts +1 -0
  200. package/core/Tabs/__stories__/Default.js +6 -2
  201. package/core/Tabs/index.mdx +10 -2
  202. package/core/TextArea/index.mdx +50 -0
  203. package/core/TextInput/index.mdx +59 -0
  204. package/core/VisuallyHidden/__stories__/Default.js +14 -2
  205. package/core/VisuallyHidden/index.mdx +17 -0
  206. package/core/WarningText/index.mdx +10 -35
  207. package/es/admin/AutoComplete/AccesibleAutoComplete/index.js +87 -0
  208. package/es/admin/AutoComplete/AutoComplete.stories.js +13 -0
  209. package/es/admin/AutoComplete/Status/index.js +153 -0
  210. package/es/admin/AutoComplete/__stories__/Default.js +19 -0
  211. package/es/admin/AutoComplete/__stories__/WithAutoSelect.js +20 -0
  212. package/es/admin/AutoComplete/__stories__/WithDefaultValue.js +18 -0
  213. package/es/admin/AutoComplete/__stories__/WithInLine.js +18 -0
  214. package/es/admin/AutoComplete/__stories__/WithMinLength.js +19 -0
  215. package/es/admin/AutoComplete/__stories__/WithPlaceHolder.js +18 -0
  216. package/es/admin/AutoComplete/__stories__/WithShowAllValues.js +18 -0
  217. package/es/admin/AutoComplete/index.js +676 -0
  218. package/es/admin/AutoComplete/index.mdx +46 -0
  219. package/es/admin/AutoComplete/utils.js +6 -0
  220. package/es/admin/CopyToClipboard/CopyToClipboard.stories.js +8 -0
  221. package/es/admin/CopyToClipboard/__stories__/Banner.js +16 -0
  222. package/es/admin/CopyToClipboard/__stories__/Default.js +18 -0
  223. package/{esm/app/CopyToClipboard/__stories__/Default.js → es/admin/CopyToClipboard/__stories__/MultipleCopies.js} +10 -8
  224. package/es/admin/CopyToClipboard/index.js +3 -2
  225. package/es/admin/CopyToClipboard/index.mdx +22 -0
  226. package/es/admin/Drawer/__stories__/Default.js +1 -1
  227. package/es/admin/Drawer/index.mdx +12 -0
  228. package/es/admin/Dropdown/Dropdown.stories.js +9 -0
  229. package/es/admin/Dropdown/__stories__/AlignRight.js +56 -0
  230. package/es/admin/Dropdown/__stories__/Default.js +48 -0
  231. package/es/admin/Dropdown/__stories__/PlacementTop.js +56 -0
  232. package/es/admin/Dropdown/index.js +28 -1
  233. package/es/admin/Dropdown/index.mdx +29 -0
  234. package/es/admin/FilterSection/index.js +1 -0
  235. package/es/admin/Modal/Modal.stories.js +7 -0
  236. package/es/admin/Modal/__stories__/AlertDialog.js +58 -0
  237. package/es/admin/Modal/__stories__/Default.js +56 -0
  238. package/es/admin/Modal/index.mdx +26 -0
  239. package/es/admin/Pagination/__stories__/Default.js +56 -16
  240. package/es/admin/Pagination/index.mdx +12 -0
  241. package/es/admin/index.js +3 -2
  242. package/es/api/fetchAPI.js +6 -3
  243. package/es/api/index.spec.js +19 -17
  244. package/es/api/useResource.js +6 -3
  245. package/es/api/useResourceAction.js +6 -3
  246. package/es/api/useResourceQuery.js +6 -3
  247. package/es/api/utils.js +8 -5
  248. package/es/app/Confirmation/Confirmation.mdx +9 -0
  249. package/es/app/Footer/Footer.mdx +27 -0
  250. package/es/app/Header/index.mdx +18 -0
  251. package/es/app/I18nText.js +7 -6
  252. package/es/app/NotFound/index.mdx +12 -0
  253. package/es/app/PhaseBannerHeader/index.mdx +12 -0
  254. package/es/core/Accordion/__stories__/Default.js +17 -1
  255. package/es/core/Accordion/__stories__/WithHints.js +17 -1
  256. package/es/core/Accordion/index.mdx +16 -84
  257. package/es/core/BackLink/index.mdx +16 -0
  258. package/es/core/Blockquote/index.mdx +17 -2
  259. package/es/core/Breadcrumbs/__stories__/Default.js +13 -1
  260. package/es/core/Breadcrumbs/breadcrumbs.mdx +22 -0
  261. package/es/core/Button/Button.stories.js +7 -1
  262. package/es/core/Button/__stories__/Back.js +13 -0
  263. package/es/core/Button/__stories__/ButtonLinkButton.js +17 -0
  264. package/es/core/Button/__stories__/CallToActionButton.js +17 -0
  265. package/es/core/Button/__stories__/Disabled.js +14 -0
  266. package/es/core/Button/__stories__/GroupingButtonsAndLinks.js +3 -1
  267. package/es/core/Button/__stories__/Primary.js +3 -1
  268. package/es/core/Button/__stories__/Secondary.js +3 -2
  269. package/es/core/Button/__stories__/Warning.js +2 -1
  270. package/es/core/Button/__stories__/WithVariantLink.js +16 -0
  271. package/es/core/Button/index.mdx +97 -0
  272. package/es/core/Card/Card.stories.js +2 -1
  273. package/es/core/Card/__stories__/WithClickableLink.js +2 -3
  274. package/es/core/Card/__stories__/WithGroupButton.js +11 -0
  275. package/es/core/Card/card.mdx +78 -0
  276. package/es/core/Checkboxes/Checkbox.stories.js +1 -0
  277. package/es/core/Checkboxes/__stories__/ConditionalReveal.js +5 -1
  278. package/es/core/Checkboxes/__stories__/Default.js +5 -1
  279. package/es/core/Checkboxes/__stories__/MultipleQuestions.js +6 -2
  280. package/es/core/Checkboxes/__stories__/NoneAnswer.js +5 -1
  281. package/es/core/Checkboxes/__stories__/NoneAnswerWithError.js +34 -0
  282. package/es/core/Checkboxes/__stories__/WithErrorMessage.js +7 -1
  283. package/es/core/Checkboxes/__stories__/WithHint.js +5 -1
  284. package/es/core/Checkboxes/checkboxes.mdx +54 -0
  285. package/es/core/Confirmation/confirmation.mdx +19 -0
  286. package/es/core/DateInput/DateInput.stories.js +1 -0
  287. package/es/core/DateInput/__stories__/Default.js +3 -1
  288. package/es/core/DateInput/__stories__/MultipleQuestions.js +20 -0
  289. package/es/core/DateInput/index.mdx +34 -0
  290. package/es/core/Details/index.mdx +9 -25
  291. package/es/core/ErrorMessage/__stories__/Default.js +1 -1
  292. package/es/core/ErrorMessage/index.mdx +21 -0
  293. package/es/core/ErrorSummary/__stories__/LinkedToCheckbox.js +1 -1
  294. package/es/core/ErrorSummary/index.mdx +21 -38
  295. package/es/core/FileUpload/__stories__/Default.js +2 -1
  296. package/es/core/FileUpload/index.mdx +22 -0
  297. package/es/core/Link/__stories__/DarkBackground.js +7 -5
  298. package/es/core/Link/__stories__/DarkBackgroundNoUnderline.js +7 -5
  299. package/es/core/Link/__stories__/Default.js +5 -3
  300. package/es/core/Link/__stories__/NoUnderline.js +5 -3
  301. package/es/core/Link/link.mdx +34 -0
  302. package/es/core/List/index.mdx +22 -3
  303. package/es/core/Masthead/masthead.mdx +14 -0
  304. package/es/core/NavList/NavList.js +11 -64
  305. package/es/core/NavList/NavList.stories.js +7 -0
  306. package/es/core/NavList/NavListBase.js +60 -0
  307. package/es/core/NavList/NavListItem.js +3 -1
  308. package/es/core/NavList/NavListItemBase.js +7 -3
  309. package/es/core/NavList/NavListSubMenu.js +1 -1
  310. package/es/core/NavList/__stories__/Default.js +48 -0
  311. package/es/core/NavList/__stories__/NavHorizontalLayout.js +46 -0
  312. package/es/core/NavList/index.mdx +22 -1
  313. package/es/core/NavList/types.js +1 -0
  314. package/es/core/NotificationBanner/index.mdx +13 -60
  315. package/es/core/PhaseBanner/PhaseBanner.stories.js +2 -1
  316. package/es/core/PhaseBanner/__stories__/Underlined.js +14 -0
  317. package/es/core/PhaseBanner/index.mdx +24 -0
  318. package/es/core/Radios/__stories__/ConditionalReveal.js +5 -1
  319. package/es/core/Radios/__stories__/Default.js +1 -2
  320. package/es/core/Radios/__stories__/Inline.js +5 -1
  321. package/es/core/Radios/__stories__/MultipleQuestions.js +7 -3
  322. package/es/core/Radios/__stories__/WithErrorMessage.js +7 -1
  323. package/es/core/Radios/__stories__/WithHints.js +17 -7
  324. package/es/core/Radios/index.mdx +56 -0
  325. package/es/core/Select/Select.stories.js +2 -1
  326. package/es/core/Select/__stories__/Default.js +5 -4
  327. package/es/core/Select/__stories__/DisabledInput.js +5 -3
  328. package/es/core/Select/__stories__/WithHint.js +23 -0
  329. package/es/core/Select/index.mdx +42 -0
  330. package/es/core/SummaryList/SummaryList.stories.js +2 -2
  331. package/es/core/SummaryList/__stories__/Default.js +1 -1
  332. package/es/core/SummaryList/__stories__/WithActions.js +20 -0
  333. package/es/core/SummaryList/__stories__/WithoutBorders.js +11 -0
  334. package/es/core/SummaryList/index.mdx +17 -65
  335. package/es/core/Table/Table.stories.js +1 -0
  336. package/es/core/Table/TableFloatingScroll.js +85 -0
  337. package/es/core/Table/__stories__/DarkVariant.js +1 -1
  338. package/es/core/Table/__stories__/Default.js +1 -1
  339. package/es/core/Table/__stories__/NoData.js +3 -1
  340. package/es/core/Table/__stories__/TableCaptions.js +17 -0
  341. package/es/core/Table/__stories__/WithLoader.js +12 -10
  342. package/es/core/Table/index.js +2 -1
  343. package/es/core/Table/index.mdx +59 -0
  344. package/es/core/Tabs/__stories__/Default.js +3 -2
  345. package/es/core/Tabs/index.mdx +10 -2
  346. package/es/core/TextArea/index.mdx +50 -0
  347. package/es/core/TextInput/index.mdx +59 -0
  348. package/es/core/VisuallyHidden/__stories__/Default.js +9 -5
  349. package/es/core/VisuallyHidden/index.mdx +17 -0
  350. package/es/core/WarningText/index.mdx +10 -35
  351. package/es/govgr/Footer/index.mdx +4 -4
  352. package/es/introduction.md +4 -1
  353. package/es/layouts/Basic/Content/index.mdx +0 -12
  354. package/es/layouts/Basic/Main/index.mdx +0 -10
  355. package/es/layouts/Basic/Masthead/index.mdx +0 -12
  356. package/es/layouts/Basic/Side/index.mdx +0 -12
  357. package/es/layouts/Basic/Top/index.mdx +0 -12
  358. package/es/layouts/Basic/index.mdx +1 -15
  359. package/es/layouts/Grid/Grid.stories.js +2 -1
  360. package/es/layouts/Grid/__stories__/Default.js +26 -6
  361. package/es/layouts/Grid/__stories__/Inline.js +75 -0
  362. package/es/layouts/Grid/index.js +1 -0
  363. package/es/layouts/index.js +2 -0
  364. package/es/registry.js +66 -30
  365. package/es/test-utils/delay.js +6 -3
  366. package/es/typography/Caption/index.mdx +16 -0
  367. package/es/typography/Hint/index.mdx +16 -0
  368. package/es/typography/NormalText/index.mdx +26 -0
  369. package/es/typography/Paragraph/index.mdx +30 -0
  370. package/es/typography/Title/index.mdx +12 -0
  371. package/esm/admin/AutoComplete/AccesibleAutoComplete/index.js +87 -0
  372. package/esm/admin/AutoComplete/AutoComplete.stories.js +13 -0
  373. package/esm/admin/AutoComplete/Status/index.js +153 -0
  374. package/esm/admin/AutoComplete/__stories__/Default.js +19 -0
  375. package/esm/admin/AutoComplete/__stories__/WithAutoSelect.js +20 -0
  376. package/esm/admin/AutoComplete/__stories__/WithDefaultValue.js +18 -0
  377. package/esm/admin/AutoComplete/__stories__/WithInLine.js +18 -0
  378. package/esm/admin/AutoComplete/__stories__/WithMinLength.js +19 -0
  379. package/esm/admin/AutoComplete/__stories__/WithPlaceHolder.js +18 -0
  380. package/esm/admin/AutoComplete/__stories__/WithShowAllValues.js +18 -0
  381. package/esm/admin/AutoComplete/index.js +676 -0
  382. package/esm/admin/AutoComplete/index.mdx +46 -0
  383. package/esm/admin/AutoComplete/utils.js +6 -0
  384. package/esm/admin/CopyToClipboard/CopyToClipboard.stories.js +8 -0
  385. package/esm/admin/CopyToClipboard/__stories__/Banner.js +16 -0
  386. package/esm/admin/CopyToClipboard/__stories__/Default.js +18 -0
  387. package/{es/app/CopyToClipboard/__stories__/Default.js → esm/admin/CopyToClipboard/__stories__/MultipleCopies.js} +10 -8
  388. package/esm/admin/CopyToClipboard/index.js +3 -2
  389. package/esm/admin/CopyToClipboard/index.mdx +22 -0
  390. package/esm/admin/Drawer/__stories__/Default.js +1 -1
  391. package/esm/admin/Drawer/index.mdx +12 -0
  392. package/esm/admin/Dropdown/Dropdown.stories.js +9 -0
  393. package/esm/admin/Dropdown/__stories__/AlignRight.js +56 -0
  394. package/esm/admin/Dropdown/__stories__/Default.js +48 -0
  395. package/esm/admin/Dropdown/__stories__/PlacementTop.js +56 -0
  396. package/esm/admin/Dropdown/index.js +28 -1
  397. package/esm/admin/Dropdown/index.mdx +29 -0
  398. package/esm/admin/FilterSection/index.js +1 -0
  399. package/esm/admin/Modal/Modal.stories.js +7 -0
  400. package/esm/admin/Modal/__stories__/AlertDialog.js +58 -0
  401. package/esm/admin/Modal/__stories__/Default.js +56 -0
  402. package/esm/admin/Modal/index.mdx +26 -0
  403. package/esm/admin/Pagination/__stories__/Default.js +56 -16
  404. package/esm/admin/Pagination/index.mdx +12 -0
  405. package/esm/admin/index.js +3 -2
  406. package/esm/api/fetchAPI.js +6 -3
  407. package/esm/api/index.spec.js +19 -17
  408. package/esm/api/useResource.js +6 -3
  409. package/esm/api/useResourceAction.js +6 -3
  410. package/esm/api/useResourceQuery.js +6 -3
  411. package/esm/api/utils.js +8 -5
  412. package/esm/app/Confirmation/Confirmation.mdx +9 -0
  413. package/esm/app/Footer/Footer.mdx +27 -0
  414. package/esm/app/Header/index.mdx +18 -0
  415. package/esm/app/I18nText.js +7 -6
  416. package/esm/app/NotFound/index.mdx +12 -0
  417. package/esm/app/PhaseBannerHeader/index.mdx +12 -0
  418. package/esm/core/Accordion/__stories__/Default.js +17 -1
  419. package/esm/core/Accordion/__stories__/WithHints.js +17 -1
  420. package/esm/core/Accordion/index.mdx +16 -84
  421. package/esm/core/BackLink/index.mdx +16 -0
  422. package/esm/core/Blockquote/index.mdx +17 -2
  423. package/esm/core/Breadcrumbs/__stories__/Default.js +13 -1
  424. package/esm/core/Breadcrumbs/breadcrumbs.mdx +22 -0
  425. package/esm/core/Button/Button.stories.js +7 -1
  426. package/esm/core/Button/__stories__/Back.js +13 -0
  427. package/esm/core/Button/__stories__/ButtonLinkButton.js +17 -0
  428. package/esm/core/Button/__stories__/CallToActionButton.js +17 -0
  429. package/esm/core/Button/__stories__/Disabled.js +14 -0
  430. package/esm/core/Button/__stories__/GroupingButtonsAndLinks.js +3 -1
  431. package/esm/core/Button/__stories__/Primary.js +3 -1
  432. package/esm/core/Button/__stories__/Secondary.js +3 -2
  433. package/esm/core/Button/__stories__/Warning.js +2 -1
  434. package/esm/core/Button/__stories__/WithVariantLink.js +16 -0
  435. package/esm/core/Button/index.mdx +97 -0
  436. package/esm/core/Card/Card.stories.js +2 -1
  437. package/esm/core/Card/__stories__/WithClickableLink.js +2 -3
  438. package/esm/core/Card/__stories__/WithGroupButton.js +11 -0
  439. package/esm/core/Card/card.mdx +78 -0
  440. package/esm/core/Checkboxes/Checkbox.stories.js +1 -0
  441. package/esm/core/Checkboxes/__stories__/ConditionalReveal.js +5 -1
  442. package/esm/core/Checkboxes/__stories__/Default.js +5 -1
  443. package/esm/core/Checkboxes/__stories__/MultipleQuestions.js +6 -2
  444. package/esm/core/Checkboxes/__stories__/NoneAnswer.js +5 -1
  445. package/esm/core/Checkboxes/__stories__/NoneAnswerWithError.js +34 -0
  446. package/esm/core/Checkboxes/__stories__/WithErrorMessage.js +7 -1
  447. package/esm/core/Checkboxes/__stories__/WithHint.js +5 -1
  448. package/esm/core/Checkboxes/checkboxes.mdx +54 -0
  449. package/esm/core/Confirmation/confirmation.mdx +19 -0
  450. package/esm/core/DateInput/DateInput.stories.js +1 -0
  451. package/esm/core/DateInput/__stories__/Default.js +3 -1
  452. package/esm/core/DateInput/__stories__/MultipleQuestions.js +20 -0
  453. package/esm/core/DateInput/index.mdx +34 -0
  454. package/esm/core/Details/index.mdx +9 -25
  455. package/esm/core/ErrorMessage/__stories__/Default.js +1 -1
  456. package/esm/core/ErrorMessage/index.mdx +21 -0
  457. package/esm/core/ErrorSummary/__stories__/LinkedToCheckbox.js +1 -1
  458. package/esm/core/ErrorSummary/index.mdx +21 -38
  459. package/esm/core/FileUpload/__stories__/Default.js +2 -1
  460. package/esm/core/FileUpload/index.mdx +22 -0
  461. package/esm/core/Link/__stories__/DarkBackground.js +7 -5
  462. package/esm/core/Link/__stories__/DarkBackgroundNoUnderline.js +7 -5
  463. package/esm/core/Link/__stories__/Default.js +5 -3
  464. package/esm/core/Link/__stories__/NoUnderline.js +5 -3
  465. package/esm/core/Link/link.mdx +34 -0
  466. package/esm/core/List/index.mdx +22 -3
  467. package/esm/core/Masthead/masthead.mdx +14 -0
  468. package/esm/core/NavList/NavList.js +11 -64
  469. package/esm/core/NavList/NavList.stories.js +7 -0
  470. package/esm/core/NavList/NavListBase.js +60 -0
  471. package/esm/core/NavList/NavListItem.js +3 -1
  472. package/esm/core/NavList/NavListItemBase.js +7 -3
  473. package/esm/core/NavList/NavListSubMenu.js +1 -1
  474. package/esm/core/NavList/__stories__/Default.js +48 -0
  475. package/esm/core/NavList/__stories__/NavHorizontalLayout.js +46 -0
  476. package/esm/core/NavList/index.mdx +22 -1
  477. package/esm/core/NavList/types.js +1 -0
  478. package/esm/core/NotificationBanner/index.mdx +13 -60
  479. package/esm/core/PhaseBanner/PhaseBanner.stories.js +2 -1
  480. package/esm/core/PhaseBanner/__stories__/Underlined.js +14 -0
  481. package/esm/core/PhaseBanner/index.mdx +24 -0
  482. package/esm/core/Radios/__stories__/ConditionalReveal.js +5 -1
  483. package/esm/core/Radios/__stories__/Default.js +1 -2
  484. package/esm/core/Radios/__stories__/Inline.js +5 -1
  485. package/esm/core/Radios/__stories__/MultipleQuestions.js +7 -3
  486. package/esm/core/Radios/__stories__/WithErrorMessage.js +7 -1
  487. package/esm/core/Radios/__stories__/WithHints.js +17 -7
  488. package/esm/core/Radios/index.mdx +56 -0
  489. package/esm/core/Select/Select.stories.js +2 -1
  490. package/esm/core/Select/__stories__/Default.js +5 -4
  491. package/esm/core/Select/__stories__/DisabledInput.js +5 -3
  492. package/esm/core/Select/__stories__/WithHint.js +23 -0
  493. package/esm/core/Select/index.mdx +42 -0
  494. package/esm/core/SummaryList/SummaryList.stories.js +2 -2
  495. package/esm/core/SummaryList/__stories__/Default.js +1 -1
  496. package/esm/core/SummaryList/__stories__/WithActions.js +20 -0
  497. package/esm/core/SummaryList/__stories__/WithoutBorders.js +11 -0
  498. package/esm/core/SummaryList/index.mdx +17 -65
  499. package/esm/core/Table/Table.stories.js +1 -0
  500. package/esm/core/Table/TableFloatingScroll.js +85 -0
  501. package/esm/core/Table/__stories__/DarkVariant.js +1 -1
  502. package/esm/core/Table/__stories__/Default.js +1 -1
  503. package/esm/core/Table/__stories__/NoData.js +3 -1
  504. package/esm/core/Table/__stories__/TableCaptions.js +17 -0
  505. package/esm/core/Table/__stories__/WithLoader.js +12 -10
  506. package/esm/core/Table/index.js +2 -1
  507. package/esm/core/Table/index.mdx +59 -0
  508. package/esm/core/Tabs/__stories__/Default.js +3 -2
  509. package/esm/core/Tabs/index.mdx +10 -2
  510. package/esm/core/TextArea/index.mdx +50 -0
  511. package/esm/core/TextInput/index.mdx +59 -0
  512. package/esm/core/VisuallyHidden/__stories__/Default.js +9 -5
  513. package/esm/core/VisuallyHidden/index.mdx +17 -0
  514. package/esm/core/WarningText/index.mdx +10 -35
  515. package/esm/govgr/Footer/index.mdx +4 -4
  516. package/esm/index.js +1 -1
  517. package/esm/introduction.md +4 -1
  518. package/esm/layouts/Basic/Content/index.mdx +0 -12
  519. package/esm/layouts/Basic/Main/index.mdx +0 -10
  520. package/esm/layouts/Basic/Masthead/index.mdx +0 -12
  521. package/esm/layouts/Basic/Side/index.mdx +0 -12
  522. package/esm/layouts/Basic/Top/index.mdx +0 -12
  523. package/esm/layouts/Basic/index.mdx +1 -15
  524. package/esm/layouts/Grid/Grid.stories.js +2 -1
  525. package/esm/layouts/Grid/__stories__/Default.js +26 -6
  526. package/esm/layouts/Grid/__stories__/Inline.js +75 -0
  527. package/esm/layouts/Grid/index.js +1 -0
  528. package/esm/layouts/index.js +2 -0
  529. package/esm/registry.js +66 -30
  530. package/esm/test-utils/delay.js +6 -3
  531. package/esm/typography/Caption/index.mdx +16 -0
  532. package/esm/typography/Hint/index.mdx +16 -0
  533. package/esm/typography/NormalText/index.mdx +26 -0
  534. package/esm/typography/Paragraph/index.mdx +30 -0
  535. package/esm/typography/Title/index.mdx +12 -0
  536. package/govgr/Footer/index.mdx +4 -4
  537. package/introduction.md +4 -1
  538. package/layouts/Basic/Content/index.mdx +0 -12
  539. package/layouts/Basic/Main/index.mdx +0 -10
  540. package/layouts/Basic/Masthead/index.mdx +0 -12
  541. package/layouts/Basic/Side/index.mdx +0 -12
  542. package/layouts/Basic/Top/index.mdx +0 -12
  543. package/layouts/Basic/index.mdx +1 -15
  544. package/layouts/Grid/Grid.stories.d.ts +1 -0
  545. package/layouts/Grid/Grid.stories.js +14 -0
  546. package/layouts/Grid/__stories__/Default.js +26 -6
  547. package/layouts/Grid/__stories__/Inline.d.ts +3 -0
  548. package/layouts/Grid/__stories__/Inline.js +88 -0
  549. package/layouts/Grid/index.d.ts +1 -0
  550. package/layouts/Grid/index.js +6 -0
  551. package/layouts/index.d.ts +2 -0
  552. package/layouts/index.js +22 -1
  553. package/package.json +3 -3
  554. package/registry.d.ts +33 -15
  555. package/registry.js +99 -45
  556. package/test-utils/delay.js +5 -3
  557. package/typography/Caption/index.mdx +16 -0
  558. package/typography/Hint/index.mdx +16 -0
  559. package/typography/NormalText/index.mdx +26 -0
  560. package/typography/Paragraph/index.mdx +30 -0
  561. package/typography/Title/index.mdx +12 -0
  562. package/admin/CopyToClipboardMessage/index.d.ts +0 -3
  563. package/app/CopyToClipboard/CopyToClipboard.stories.d.ts +0 -7
  564. package/app/CopyToClipboard/CopyToClipboard.stories.js +0 -30
  565. package/app/CopyToClipboard/index.d.ts +0 -9
  566. package/app/CopyToClipboard/index.js +0 -69
  567. package/app/NotFound/NotFound.mdx +0 -5
  568. package/app/QrCodeScanner/index.mdx +0 -7
  569. package/core/Button/Button.mdx +0 -55
  570. package/core/SummaryList/__stories__/SummaryListWithActions.d.ts +0 -3
  571. package/core/SummaryList/__stories__/SummaryListWithoutBorders.d.ts +0 -3
  572. package/es/admin/CopyToClipboardMessage/index.js +0 -3
  573. package/es/app/CopyToClipboard/CopyToClipboard.stories.js +0 -6
  574. package/es/app/CopyToClipboard/index.js +0 -45
  575. package/es/app/NotFound/NotFound.mdx +0 -5
  576. package/es/app/QrCodeScanner/index.mdx +0 -7
  577. package/es/core/Button/Button.mdx +0 -55
  578. package/es/core/SummaryList/__stories__/SummaryListWithActions.js +0 -21
  579. package/es/core/SummaryList/__stories__/SummaryListWithoutBorders.js +0 -11
  580. package/esm/admin/CopyToClipboardMessage/index.js +0 -3
  581. package/esm/app/CopyToClipboard/CopyToClipboard.stories.js +0 -6
  582. package/esm/app/CopyToClipboard/index.js +0 -45
  583. package/esm/app/NotFound/NotFound.mdx +0 -5
  584. package/esm/app/QrCodeScanner/index.mdx +0 -7
  585. package/esm/core/Button/Button.mdx +0 -55
  586. package/esm/core/SummaryList/__stories__/SummaryListWithActions.js +0 -21
  587. package/esm/core/SummaryList/__stories__/SummaryListWithoutBorders.js +0 -11
@@ -0,0 +1,26 @@
1
+ ---
2
+ id: modal
3
+ title: Modal
4
+ ---
5
+
6
+ ```bash
7
+ import Modal, {ModalHeading, ModalContent, ModalAction} from "@digigov/ui/admin/Modal";
8
+ ```
9
+
10
+ ## How to use
11
+
12
+ ### As a Dialog
13
+
14
+ <Story packageName="@digigov/ui" component="admin/Modal" story="Default.tsx" />
15
+
16
+ ### As an Alert Dialog
17
+
18
+ <Story packageName="@digigov/ui" component="admin/Modal" story="AlertDialog.tsx" />
19
+
20
+
21
+ ## Accessibility
22
+
23
+ You can read more about the accessibility patterns used in our Modal
24
+ implementation in the ARIA Authoring Practices Guide (APG) at
25
+ [Dialog](https://www.w3.org/WAI/ARIA/apg/patterns/dialogmodal/) and
26
+ [Alert Dialog](https://www.w3.org/WAI/ARIA/apg/patterns/alertdialog/) sections.
@@ -3,10 +3,9 @@ import Pagination, { PaginationList, PaginationListItem, PaginationLabel } from
3
3
  import ArrowIcon from '@digigov/react-core/ArrowIcon';
4
4
  import Link from '@digigov/ui/core/Link';
5
5
  import Divider from '@digigov/ui/core/Divider';
6
+ import { I18NProvider } from '@digigov/ui/app';
6
7
 
7
- var _ref = /*#__PURE__*/React.createElement("div", {
8
- className: "example"
9
- }, /*#__PURE__*/React.createElement(Pagination, null, /*#__PURE__*/React.createElement(PaginationLabel, {
8
+ var _ref = /*#__PURE__*/React.createElement(Pagination, null, /*#__PURE__*/React.createElement(PaginationLabel, {
10
9
  start: 10,
11
10
  end: 20,
12
11
  total: 10000
@@ -28,10 +27,14 @@ var _ref = /*#__PURE__*/React.createElement("div", {
28
27
  href: "/page7"
29
28
  }, "7")), /*#__PURE__*/React.createElement(PaginationListItem, null, /*#__PURE__*/React.createElement(Link, null, "\u0395\u03C0\u03CC\u03BC\u03B5\u03BD\u03BF", /*#__PURE__*/React.createElement(ArrowIcon, {
30
29
  direction: "right"
31
- }))))), /*#__PURE__*/React.createElement(Divider, {
30
+ })))));
31
+
32
+ var _ref2 = /*#__PURE__*/React.createElement(Divider, {
32
33
  visible: true,
33
34
  size: "l"
34
- }), /*#__PURE__*/React.createElement(Pagination, null, /*#__PURE__*/React.createElement(PaginationLabel, {
35
+ });
36
+
37
+ var _ref3 = /*#__PURE__*/React.createElement(Pagination, null, /*#__PURE__*/React.createElement(PaginationLabel, {
35
38
  start: 10,
36
39
  end: 20,
37
40
  total: 10000
@@ -55,10 +58,14 @@ var _ref = /*#__PURE__*/React.createElement("div", {
55
58
  href: "/page7"
56
59
  }, "7")), /*#__PURE__*/React.createElement(PaginationListItem, null, /*#__PURE__*/React.createElement(Link, null, "\u0395\u03C0\u03CC\u03BC\u03B5\u03BD\u03BF", /*#__PURE__*/React.createElement(ArrowIcon, {
57
60
  direction: "right"
58
- }))))), /*#__PURE__*/React.createElement(Divider, {
61
+ })))));
62
+
63
+ var _ref4 = /*#__PURE__*/React.createElement(Divider, {
59
64
  visible: true,
60
65
  size: "l"
61
- }), /*#__PURE__*/React.createElement(Pagination, null, /*#__PURE__*/React.createElement(PaginationLabel, {
66
+ });
67
+
68
+ var _ref5 = /*#__PURE__*/React.createElement(Pagination, null, /*#__PURE__*/React.createElement(PaginationLabel, {
62
69
  start: 10,
63
70
  end: 20,
64
71
  total: 10000
@@ -80,13 +87,17 @@ var _ref = /*#__PURE__*/React.createElement("div", {
80
87
  inactive: true
81
88
  }, /*#__PURE__*/React.createElement(Link, null, "\u0395\u03C0\u03CC\u03BC\u03B5\u03BD\u03BF", /*#__PURE__*/React.createElement(ArrowIcon, {
82
89
  direction: "right"
83
- }))))), /*#__PURE__*/React.createElement(Divider, {
90
+ })))));
91
+
92
+ var _ref6 = /*#__PURE__*/React.createElement(Divider, {
84
93
  visible: true,
85
94
  size: "l"
86
- }), /*#__PURE__*/React.createElement(Pagination, null, /*#__PURE__*/React.createElement(PaginationLabel, {
87
- start: 10,
88
- end: 20,
89
- total: 10000
95
+ });
96
+
97
+ var _ref7 = /*#__PURE__*/React.createElement(Pagination, null, /*#__PURE__*/React.createElement(PaginationLabel, {
98
+ start: 1,
99
+ end: 10,
100
+ total: 15
90
101
  }), /*#__PURE__*/React.createElement(PaginationList, null, /*#__PURE__*/React.createElement(PaginationListItem, null, /*#__PURE__*/React.createElement(Link, null, /*#__PURE__*/React.createElement(ArrowIcon, {
91
102
  direction: "left"
92
103
  }), "\u03A0\u03C1\u03BF\u03B7\u03B3\u03BF\u03CD\u03BC\u03B5\u03BD\u03BF")), /*#__PURE__*/React.createElement(PaginationListItem, null, /*#__PURE__*/React.createElement(Link, {
@@ -95,7 +106,7 @@ var _ref = /*#__PURE__*/React.createElement("div", {
95
106
  variant: "dots"
96
107
  }), /*#__PURE__*/React.createElement(PaginationListItem, null, /*#__PURE__*/React.createElement(Link, {
97
108
  href: "/page7"
98
- }, "7")), /*#__PURE__*/React.createElement(PaginationListItem, {
109
+ }, "2")), /*#__PURE__*/React.createElement(PaginationListItem, {
99
110
  currentPage: true
100
111
  }, "8"), /*#__PURE__*/React.createElement(PaginationListItem, null, /*#__PURE__*/React.createElement(Link, {
101
112
  href: "/page9"
@@ -105,12 +116,41 @@ var _ref = /*#__PURE__*/React.createElement("div", {
105
116
  href: "/page20"
106
117
  }, "20")), /*#__PURE__*/React.createElement(PaginationListItem, null, /*#__PURE__*/React.createElement(Link, null, "\u0395\u03C0\u03CC\u03BC\u03B5\u03BD\u03BF", /*#__PURE__*/React.createElement(ArrowIcon, {
107
118
  direction: "right"
108
- }))))), /*#__PURE__*/React.createElement(Divider, {
119
+ })))));
120
+
121
+ var _ref8 = /*#__PURE__*/React.createElement(Divider, {
122
+ visible: true,
123
+ size: "l"
124
+ });
125
+
126
+ var _ref9 = /*#__PURE__*/React.createElement(Pagination, null, /*#__PURE__*/React.createElement(PaginationLabel, {
127
+ start: 1,
128
+ end: 10,
129
+ total: 15
130
+ }), /*#__PURE__*/React.createElement(PaginationList, null, /*#__PURE__*/React.createElement(PaginationListItem, {
131
+ inactive: true
132
+ }, /*#__PURE__*/React.createElement(Link, null, /*#__PURE__*/React.createElement(ArrowIcon, {
133
+ direction: "left"
134
+ }))), /*#__PURE__*/React.createElement(PaginationListItem, {
135
+ currentPage: true
136
+ }, "1"), /*#__PURE__*/React.createElement(PaginationListItem, null, /*#__PURE__*/React.createElement(Link, {
137
+ href: "/page7"
138
+ }, "2")), /*#__PURE__*/React.createElement(PaginationListItem, null, /*#__PURE__*/React.createElement(Link, null, /*#__PURE__*/React.createElement(ArrowIcon, {
139
+ direction: "right"
140
+ })))));
141
+
142
+ var _ref10 = /*#__PURE__*/React.createElement(Divider, {
109
143
  visible: true,
110
144
  size: "l"
111
- }));
145
+ });
112
146
 
113
147
  export var Default = function Default() {
114
- return _ref;
148
+ return /*#__PURE__*/React.createElement("div", {
149
+ className: "example"
150
+ }, /*#__PURE__*/React.createElement(I18NProvider, {
151
+ t: function t(str) {
152
+ return str;
153
+ }
154
+ }, _ref, _ref2, _ref3, _ref4, _ref5, _ref6, _ref7, _ref8, _ref9, _ref10));
115
155
  };
116
156
  export default Default;
@@ -0,0 +1,12 @@
1
+ ---
2
+ id: pagination
3
+ title: Pagination
4
+ ---
5
+
6
+ ```bash
7
+ import Pagination from '@digigov/ui/app/Pagination';
8
+ ```
9
+
10
+ ## How to use
11
+
12
+ <Story packageName="@digigov/ui" component="admin/Pagination" story="Default.tsx" />
package/es/admin/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  export * from '@digigov/ui/admin/Dropdown';
2
2
  export * from '@digigov/ui/admin/Chip';
3
- export * from '@digigov/ui/admin/CopyToClipboardMessage';
3
+ export * from '@digigov/ui/admin/CopyToClipboard';
4
4
  export * from '@digigov/ui/admin/FillableText';
5
5
  export * from '@digigov/ui/admin/Drawer';
6
6
  export * from '@digigov/ui/admin/Modal';
@@ -13,4 +13,5 @@ export * from '@digigov/ui/admin/LabeledText';
13
13
  export * from '@digigov/ui/admin/AdminLayout';
14
14
  export * from '@digigov/ui/admin/ResultsHeading';
15
15
  export * from '@digigov/ui/admin/SearchSection';
16
- export * from '@digigov/ui/admin/FilterSection';
16
+ export * from '@digigov/ui/admin/FilterSection';
17
+ export * from '@digigov/ui/admin/AutoComplete';
@@ -1,16 +1,19 @@
1
- import _regeneratorRuntime from "@babel/runtime/regenerator";
1
+ import _typeof from "@babel/runtime/helpers/typeof";
2
2
  import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
3
3
  import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
4
+
5
+ function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return generator._invoke = function (innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; }(innerFn, self, context), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; this._invoke = function (method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); }; } function maybeInvokeDelegate(delegate, context) { var method = delegate.iterator[context.method]; if (undefined === method) { if (context.delegate = null, "throw" === context.method) { if (delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method)) return ContinueSentinel; context.method = "throw", context.arg = new TypeError("The iterator does not provide a 'throw' method"); } return ContinueSentinel; } var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) { if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; } return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, define(Gp, "constructor", GeneratorFunctionPrototype), define(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (object) { var keys = []; for (var key in object) { keys.push(key); } return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) { "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); } }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, "catch": function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
6
+
4
7
  import { getArgs, processResponse } from '@digigov/ui/api/utils';
5
8
  export function fetchAPI(_x, _x2, _x3) {
6
9
  return _fetchAPI.apply(this, arguments);
7
10
  }
8
11
 
9
12
  function _fetchAPI() {
10
- _fetchAPI = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(resource, _ref, apiConfig) {
13
+ _fetchAPI = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(resource, _ref, apiConfig) {
11
14
  var _ref$query, query, _ref$path, path, _ref$method, method, _ref$body, body, baseURL, token, _getArgs, _getArgs2, url, options, response, _yield$processRespons, data, error, status;
12
15
 
13
- return _regeneratorRuntime.wrap(function _callee$(_context) {
16
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
14
17
  while (1) {
15
18
  switch (_context.prev = _context.next) {
16
19
  case 0:
@@ -1,8 +1,10 @@
1
- import _regeneratorRuntime from "@babel/runtime/regenerator";
1
+ import _typeof from "@babel/runtime/helpers/typeof";
2
2
  import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
3
3
  import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
4
4
  import _extends from "@babel/runtime/helpers/extends";
5
5
 
6
+ function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return generator._invoke = function (innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; }(innerFn, self, context), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; this._invoke = function (method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); }; } function maybeInvokeDelegate(delegate, context) { var method = delegate.iterator[context.method]; if (undefined === method) { if (context.delegate = null, "throw" === context.method) { if (delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method)) return ContinueSentinel; context.method = "throw", context.arg = new TypeError("The iterator does not provide a 'throw' method"); } return ContinueSentinel; } var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) { if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; } return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, define(Gp, "constructor", GeneratorFunctionPrototype), define(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (object) { var keys = []; for (var key in object) { keys.push(key); } return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) { "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); } }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, "catch": function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
7
+
6
8
  /* eslint-disable @typescript-eslint/explicit-function-return-type */
7
9
  import React, { Suspense, useEffect } from 'react';
8
10
  import { render, fireEvent } from '@testing-library/react';
@@ -95,10 +97,10 @@ describe('fetchAPI', function () {
95
97
  });
96
98
  beforeEach(fetchMock.resetBehavior);
97
99
  beforeEach(fetchMock.resetHistory);
98
- it('fetchAPI gets', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
100
+ it('fetchAPI gets', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
99
101
  var resource, path, _yield$fetchAPI, data;
100
102
 
101
- return _regeneratorRuntime.wrap(function _callee$(_context) {
103
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
102
104
  while (1) {
103
105
  switch (_context.prev = _context.next) {
104
106
  case 0:
@@ -136,10 +138,10 @@ describe('useResource', function () {
136
138
  });
137
139
  beforeEach(fetchMock.resetBehavior);
138
140
  beforeEach(fetchMock.resetHistory);
139
- it('useResource should return data', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
141
+ it('useResource should return data', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
140
142
  var resource, Page, _render, container, _container$firstChild, _container$firstChild2;
141
143
 
142
- return _regeneratorRuntime.wrap(function _callee2$(_context2) {
144
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
143
145
  while (1) {
144
146
  switch (_context2.prev = _context2.next) {
145
147
  case 0:
@@ -184,12 +186,12 @@ describe('useResource', function () {
184
186
  }
185
187
  }, _callee2);
186
188
  })));
187
- it('should run duplicate request once', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3() {
189
+ it('should run duplicate request once', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
188
190
  var _container$firstChild3, _container$firstChild4;
189
191
 
190
192
  var resource, Page, _render2, container;
191
193
 
192
- return _regeneratorRuntime.wrap(function _callee3$(_context3) {
194
+ return _regeneratorRuntime().wrap(function _callee3$(_context3) {
193
195
  while (1) {
194
196
  switch (_context3.prev = _context3.next) {
195
197
  case 0:
@@ -236,12 +238,12 @@ describe('useResourceAction', function () {
236
238
  });
237
239
  beforeEach(fetchMock.resetBehavior);
238
240
  beforeEach(fetchMock.resetHistory);
239
- it('useResourceAction should return result ', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4() {
241
+ it('useResourceAction should return result ', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
240
242
  var _container$firstChild5, _container$firstChild6;
241
243
 
242
244
  var resource, Page, _render3, container;
243
245
 
244
- return _regeneratorRuntime.wrap(function _callee4$(_context4) {
246
+ return _regeneratorRuntime().wrap(function _callee4$(_context4) {
245
247
  while (1) {
246
248
  switch (_context4.prev = _context4.next) {
247
249
  case 0:
@@ -285,12 +287,12 @@ describe('useResourceAction', function () {
285
287
  }
286
288
  }, _callee4);
287
289
  })));
288
- it('useResourceAction should be invalidated and run twice', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee5() {
290
+ it('useResourceAction should be invalidated and run twice', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5() {
289
291
  var _container$firstChild7, _container$firstChild8, _container$firstChild9, _container$firstChild10;
290
292
 
291
293
  var resource, Page, _render4, container;
292
294
 
293
- return _regeneratorRuntime.wrap(function _callee5$(_context5) {
295
+ return _regeneratorRuntime().wrap(function _callee5$(_context5) {
294
296
  while (1) {
295
297
  switch (_context5.prev = _context5.next) {
296
298
  case 0:
@@ -362,12 +364,12 @@ describe('useResourceMany', function () {
362
364
  beforeEach(fetchMock.resetBehavior);
363
365
  beforeEach(fetchMock.resetHistory); //check this test again (loading/hello)
364
366
 
365
- it('useResourceMany should return data', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee6() {
367
+ it('useResourceMany should return data', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6() {
366
368
  var _container$firstChild11, _container$firstChild12;
367
369
 
368
370
  var resource, Page, _render5, container;
369
371
 
370
- return _regeneratorRuntime.wrap(function _callee6$(_context6) {
372
+ return _regeneratorRuntime().wrap(function _callee6$(_context6) {
371
373
  while (1) {
372
374
  switch (_context6.prev = _context6.next) {
373
375
  case 0:
@@ -412,12 +414,12 @@ describe('useResourceMany', function () {
412
414
  }
413
415
  }, _callee6);
414
416
  })));
415
- it('useResourceMany should handle hasNext, hasPrevious', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee7() {
417
+ it('useResourceMany should handle hasNext, hasPrevious', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7() {
416
418
  var _container$firstChild13, _container$firstChild14;
417
419
 
418
420
  var resource, Page, _render6, container;
419
421
 
420
- return _regeneratorRuntime.wrap(function _callee7$(_context7) {
422
+ return _regeneratorRuntime().wrap(function _callee7$(_context7) {
421
423
  while (1) {
422
424
  switch (_context7.prev = _context7.next) {
423
425
  case 0:
@@ -463,12 +465,12 @@ describe('useResourceMany', function () {
463
465
  }
464
466
  }, _callee7);
465
467
  })));
466
- it('useResourceMany should handle setPage with custom limit option', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee8() {
468
+ it('useResourceMany should handle setPage with custom limit option', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8() {
467
469
  var _container$firstChild15, _container$firstChild16, _container$firstChild17;
468
470
 
469
471
  var resource, Page, _render7, container, getByText;
470
472
 
471
- return _regeneratorRuntime.wrap(function _callee8$(_context8) {
473
+ return _regeneratorRuntime().wrap(function _callee8$(_context8) {
472
474
  while (1) {
473
475
  switch (_context8.prev = _context8.next) {
474
476
  case 0:
@@ -1,6 +1,9 @@
1
- import _regeneratorRuntime from "@babel/runtime/regenerator";
1
+ import _typeof from "@babel/runtime/helpers/typeof";
2
2
  import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
3
3
  import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
4
+
5
+ function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return generator._invoke = function (innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; }(innerFn, self, context), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; this._invoke = function (method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); }; } function maybeInvokeDelegate(delegate, context) { var method = delegate.iterator[context.method]; if (undefined === method) { if (context.delegate = null, "throw" === context.method) { if (delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method)) return ContinueSentinel; context.method = "throw", context.arg = new TypeError("The iterator does not provide a 'throw' method"); } return ContinueSentinel; } var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) { if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; } return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, define(Gp, "constructor", GeneratorFunctionPrototype), define(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (object) { var keys = []; for (var key in object) { keys.push(key); } return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) { "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); } }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, "catch": function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
6
+
4
7
  import { getQueryKey, processResponse } from '@digigov/ui/api/utils';
5
8
  import { useQuery, queryCache } from 'react-query';
6
9
  import { useAPI } from '@digigov/ui/api';
@@ -25,10 +28,10 @@ export function useResource(resource, id, query, options, suspense) {
25
28
  }
26
29
 
27
30
  function _customFetcher() {
28
- _customFetcher = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(fetchUrl, options) {
31
+ _customFetcher = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(fetchUrl, options) {
29
32
  var response, _yield$processRespons, _data, _error;
30
33
 
31
- return _regeneratorRuntime.wrap(function _callee$(_context) {
34
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
32
35
  while (1) {
33
36
  switch (_context.prev = _context.next) {
34
37
  case 0:
@@ -1,6 +1,9 @@
1
- import _regeneratorRuntime from "@babel/runtime/regenerator";
1
+ import _typeof from "@babel/runtime/helpers/typeof";
2
2
  import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
3
3
  import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
4
+
5
+ function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return generator._invoke = function (innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; }(innerFn, self, context), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; this._invoke = function (method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); }; } function maybeInvokeDelegate(delegate, context) { var method = delegate.iterator[context.method]; if (undefined === method) { if (context.delegate = null, "throw" === context.method) { if (delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method)) return ContinueSentinel; context.method = "throw", context.arg = new TypeError("The iterator does not provide a 'throw' method"); } return ContinueSentinel; } var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) { if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; } return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, define(Gp, "constructor", GeneratorFunctionPrototype), define(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (object) { var keys = []; for (var key in object) { keys.push(key); } return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) { "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); } }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, "catch": function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
6
+
4
7
  import { useState, useEffect } from 'react';
5
8
  import { getQueryKey, processResponse } from '@digigov/ui/api/utils';
6
9
  import { useMutation } from 'react-query';
@@ -35,7 +38,7 @@ export function useResourceAction(resource, id) {
35
38
  }
36
39
 
37
40
  function _customFetcher() {
38
- _customFetcher = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
41
+ _customFetcher = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
39
42
  var _ref,
40
43
  _ref2,
41
44
  fetchUrl,
@@ -45,7 +48,7 @@ export function useResourceAction(resource, id) {
45
48
  _data2,
46
49
  _args = arguments;
47
50
 
48
- return _regeneratorRuntime.wrap(function _callee$(_context) {
51
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
49
52
  while (1) {
50
53
  switch (_context.prev = _context.next) {
51
54
  case 0:
@@ -1,9 +1,12 @@
1
+ import _typeof from "@babel/runtime/helpers/typeof";
1
2
  import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
2
3
  import _extends from "@babel/runtime/helpers/extends";
3
- import _regeneratorRuntime from "@babel/runtime/regenerator";
4
4
  import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
5
5
  import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
6
6
  var _excluded = ["data"];
7
+
8
+ function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return generator._invoke = function (innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; }(innerFn, self, context), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; this._invoke = function (method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); }; } function maybeInvokeDelegate(delegate, context) { var method = delegate.iterator[context.method]; if (undefined === method) { if (context.delegate = null, "throw" === context.method) { if (delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method)) return ContinueSentinel; context.method = "throw", context.arg = new TypeError("The iterator does not provide a 'throw' method"); } return ContinueSentinel; } var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) { if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; } return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, define(Gp, "constructor", GeneratorFunctionPrototype), define(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (object) { var keys = []; for (var key in object) { keys.push(key); } return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) { "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); } }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, "catch": function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
9
+
7
10
  import { useEffect, useMemo, useState, useCallback } from 'react';
8
11
  import { getQueryKey, processResponse } from '@digigov/ui/api/utils';
9
12
  import { usePaginatedQuery, queryCache } from 'react-query';
@@ -26,10 +29,10 @@ export function useResourceManyBase(resource, query, options) {
26
29
  setFetchOpts = _useState2[1];
27
30
 
28
31
  var customFetcher = useCallback( /*#__PURE__*/function () {
29
- var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(fetchUrl, options) {
32
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(fetchUrl, options) {
30
33
  var response, _yield$processRespons, _data;
31
34
 
32
- return _regeneratorRuntime.wrap(function _callee$(_context) {
35
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
33
36
  while (1) {
34
37
  switch (_context.prev = _context.next) {
35
38
  case 0:
package/es/api/utils.js CHANGED
@@ -1,15 +1,18 @@
1
- import _regeneratorRuntime from "@babel/runtime/regenerator";
1
+ import _typeof from "@babel/runtime/helpers/typeof";
2
2
  import _extends from "@babel/runtime/helpers/extends";
3
3
  import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
4
+
5
+ function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return generator._invoke = function (innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; }(innerFn, self, context), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; this._invoke = function (method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); }; } function maybeInvokeDelegate(delegate, context) { var method = delegate.iterator[context.method]; if (undefined === method) { if (context.delegate = null, "throw" === context.method) { if (delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method)) return ContinueSentinel; context.method = "throw", context.arg = new TypeError("The iterator does not provide a 'throw' method"); } return ContinueSentinel; } var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) { if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; } return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, define(Gp, "constructor", GeneratorFunctionPrototype), define(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (object) { var keys = []; for (var key in object) { keys.push(key); } return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) { "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); } }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, "catch": function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
6
+
4
7
  import { APIError } from '@digigov/ui/api/APIErrors';
5
8
  export function parseErrors(_x) {
6
9
  return _parseErrors.apply(this, arguments);
7
10
  }
8
11
 
9
12
  function _parseErrors() {
10
- _parseErrors = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(response) {
13
+ _parseErrors = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(response) {
11
14
  var errors, error, json, apiErrors, text;
12
- return _regeneratorRuntime.wrap(function _callee$(_context) {
15
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
13
16
  while (1) {
14
17
  switch (_context.prev = _context.next) {
15
18
  case 0:
@@ -76,7 +79,7 @@ export function processResponse(_x2) {
76
79
  }
77
80
 
78
81
  function _processResponse() {
79
- _processResponse = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(response) {
82
+ _processResponse = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(response) {
80
83
  var raiseError,
81
84
  status,
82
85
  errors,
@@ -85,7 +88,7 @@ function _processResponse() {
85
88
  _data,
86
89
  _args2 = arguments;
87
90
 
88
- return _regeneratorRuntime.wrap(function _callee2$(_context2) {
91
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
89
92
  while (1) {
90
93
  switch (_context2.prev = _context2.next) {
91
94
  case 0: