@inseefr/lunatic 2.0.3-v2 → 2.0.5-v2

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 (400) hide show
  1. package/lib/components/button/index.js +0 -2
  2. package/lib/components/button/lunatic-button.js +4 -18
  3. package/lib/components/checkbox/checkbox-boolean/checkbox-boolean.js +5 -12
  4. package/lib/components/checkbox/checkbox-boolean/index.js +0 -2
  5. package/lib/components/checkbox/checkbox-boolean/lunatic-checkbox-boolean.js +7 -15
  6. package/lib/components/checkbox/checkbox-group/checkbox-group.js +14 -26
  7. package/lib/components/checkbox/checkbox-group/index.js +0 -2
  8. package/lib/components/checkbox/checkbox-group/lunatic-checkbox-group.js +6 -13
  9. package/lib/components/checkbox/checkbox-one/index.js +0 -2
  10. package/lib/components/checkbox/checkbox-one/lunatic-checkbox-one.js +1 -13
  11. package/lib/components/checkbox/commons/checkbox-option.js +7 -20
  12. package/lib/components/checkbox/commons/index.js +0 -2
  13. package/lib/components/checkbox/index.js +0 -4
  14. package/lib/components/commons/build-style-object.js +2 -13
  15. package/lib/components/commons/components/combo-box/combo-box-container.js +3 -9
  16. package/lib/components/commons/components/combo-box/combo-box-content.js +6 -19
  17. package/lib/components/commons/components/combo-box/combo-box.js +30 -64
  18. package/lib/components/commons/components/combo-box/index.js +0 -2
  19. package/lib/components/commons/components/combo-box/panel/index.js +0 -2
  20. package/lib/components/commons/components/combo-box/panel/option-container.js +4 -19
  21. package/lib/components/commons/components/combo-box/panel/panel-container.js +3 -8
  22. package/lib/components/commons/components/combo-box/panel/panel.js +13 -22
  23. package/lib/components/commons/components/combo-box/selection/delete.js +3 -19
  24. package/lib/components/commons/components/combo-box/selection/displayLabelOrInput.js +2 -10
  25. package/lib/components/commons/components/combo-box/selection/index.js +0 -2
  26. package/lib/components/commons/components/combo-box/selection/input.js +8 -21
  27. package/lib/components/commons/components/combo-box/selection/label-selection.js +7 -14
  28. package/lib/components/commons/components/combo-box/selection/selection-container.js +4 -9
  29. package/lib/components/commons/components/combo-box/selection/selection.js +12 -22
  30. package/lib/components/commons/components/combo-box/state-management/actions.js +2 -21
  31. package/lib/components/commons/components/combo-box/state-management/combo-box-context.js +0 -4
  32. package/lib/components/commons/components/combo-box/state-management/index.js +0 -9
  33. package/lib/components/commons/components/combo-box/state-management/reducer/index.js +0 -2
  34. package/lib/components/commons/components/combo-box/state-management/reducer/reduce-on-blur.js +0 -5
  35. package/lib/components/commons/components/combo-box/state-management/reducer/reduce-on-change.js +0 -5
  36. package/lib/components/commons/components/combo-box/state-management/reducer/reduce-on-delete.js +0 -5
  37. package/lib/components/commons/components/combo-box/state-management/reducer/reduce-on-focus.js +0 -5
  38. package/lib/components/commons/components/combo-box/state-management/reducer/reduce-on-init.js +4 -13
  39. package/lib/components/commons/components/combo-box/state-management/reducer/reduce-on-keydown/index.js +0 -2
  40. package/lib/components/commons/components/combo-box/state-management/reducer/reduce-on-keydown/on-arrow-down.js +0 -8
  41. package/lib/components/commons/components/combo-box/state-management/reducer/reduce-on-keydown/on-arrow-up.js +0 -8
  42. package/lib/components/commons/components/combo-box/state-management/reducer/reduce-on-keydown/on-end.js +0 -6
  43. package/lib/components/commons/components/combo-box/state-management/reducer/reduce-on-keydown/on-enter.js +0 -5
  44. package/lib/components/commons/components/combo-box/state-management/reducer/reduce-on-keydown/on-escape.js +0 -5
  45. package/lib/components/commons/components/combo-box/state-management/reducer/reduce-on-keydown/on-home.js +0 -6
  46. package/lib/components/commons/components/combo-box/state-management/reducer/reduce-on-keydown/on-tab.js +0 -5
  47. package/lib/components/commons/components/combo-box/state-management/reducer/reduce-on-keydown/reduce-on-keydown.js +1 -20
  48. package/lib/components/commons/components/combo-box/state-management/reducer/reduce-on-select.js +0 -5
  49. package/lib/components/commons/components/combo-box/state-management/reducer/reducer.js +0 -22
  50. package/lib/components/commons/components/create-lunatic-component/create-lunatic-component.js +10 -21
  51. package/lib/components/commons/components/create-lunatic-component/index.js +0 -3
  52. package/lib/components/commons/components/default-label-renderer.js +4 -14
  53. package/lib/components/commons/components/default-option-renderer.js +3 -10
  54. package/lib/components/commons/components/dragger/dragger.js +19 -45
  55. package/lib/components/commons/components/dragger/index.js +0 -2
  56. package/lib/components/commons/components/errors/errors.js +3 -17
  57. package/lib/components/commons/components/errors/index.js +0 -2
  58. package/lib/components/commons/components/fab/fab.js +6 -14
  59. package/lib/components/commons/components/fab/index.js +0 -2
  60. package/lib/components/commons/components/field-container/field-container.js +3 -12
  61. package/lib/components/commons/components/field-container/index.js +0 -2
  62. package/lib/components/commons/components/fieldset.js +1 -9
  63. package/lib/components/commons/components/html-table/index.js +0 -7
  64. package/lib/components/commons/components/html-table/table.js +2 -11
  65. package/lib/components/commons/components/html-table/tbody.js +2 -11
  66. package/lib/components/commons/components/html-table/td.js +6 -15
  67. package/lib/components/commons/components/html-table/th.js +5 -14
  68. package/lib/components/commons/components/html-table/thead.js +2 -11
  69. package/lib/components/commons/components/html-table/tr.js +3 -12
  70. package/lib/components/commons/components/is-network/index.js +0 -2
  71. package/lib/components/commons/components/is-network/is-network.js +7 -26
  72. package/lib/components/commons/components/is-network/use-online-status.js +0 -9
  73. package/lib/components/commons/components/label.js +4 -12
  74. package/lib/components/commons/components/lunatic-component.js +12 -24
  75. package/lib/components/commons/components/lunatic-fieldset-component.js +9 -20
  76. package/lib/components/commons/components/md-label/index.js +0 -2
  77. package/lib/components/commons/components/md-label/link.js +8 -14
  78. package/lib/components/commons/components/md-label/md-label.js +2 -13
  79. package/lib/components/commons/components/missing/index.js +0 -2
  80. package/lib/components/commons/components/missing/missing.js +11 -25
  81. package/lib/components/commons/components/nothing-to-display.js +0 -4
  82. package/lib/components/commons/components/orchestrated-component.js +13 -25
  83. package/lib/components/commons/components/variable-status/img/index.js +0 -3
  84. package/lib/components/commons/components/variable-status/index.js +0 -2
  85. package/lib/components/commons/components/variable-status/variable-status.js +17 -34
  86. package/lib/components/commons/create-customizable-field.js +1 -12
  87. package/lib/components/commons/create-row-orchestrator.js +14 -21
  88. package/lib/components/commons/icons/checkbox-checked.icon.js +4 -9
  89. package/lib/components/commons/icons/checkbox-unchecked.icon.js +4 -9
  90. package/lib/components/commons/icons/closed.icon.js +4 -9
  91. package/lib/components/commons/icons/cross.icon.js +4 -9
  92. package/lib/components/commons/icons/index.js +0 -11
  93. package/lib/components/commons/icons/load.icon.js +4 -9
  94. package/lib/components/commons/icons/lunatic-icon.js +1 -7
  95. package/lib/components/commons/icons/network.icon.js +4 -9
  96. package/lib/components/commons/icons/on-drag.icon.js +4 -9
  97. package/lib/components/commons/icons/opened.icon.js +4 -9
  98. package/lib/components/commons/icons/radio-checked.icon.js +4 -9
  99. package/lib/components/commons/icons/radio-unchecked.icon.js +4 -9
  100. package/lib/components/commons/index.js +0 -24
  101. package/lib/components/commons/prop-types/declarations.js +0 -8
  102. package/lib/components/commons/prop-types/index.js +0 -6
  103. package/lib/components/commons/prop-types/lines.js +0 -4
  104. package/lib/components/commons/prop-types/options.js +0 -4
  105. package/lib/components/commons/prop-types/response.js +0 -4
  106. package/lib/components/commons/prop-types/value-type.js +0 -8
  107. package/lib/components/commons/safety-label.js +0 -8
  108. package/lib/components/commons/use-document-add-event-listener.js +4 -31
  109. package/lib/components/commons/use-on-handle-change.js +2 -5
  110. package/lib/components/commons/use-options-keydown.js +1 -6
  111. package/lib/components/commons/use-previous.js +0 -3
  112. package/lib/components/components.js +8 -33
  113. package/lib/components/datepicker/datepicker.js +7 -18
  114. package/lib/components/datepicker/index.js +0 -2
  115. package/lib/components/datepicker/lunatic-datepicker.js +1 -13
  116. package/lib/components/declarations/declaration.js +1 -8
  117. package/lib/components/declarations/declarations-after-text.js +0 -9
  118. package/lib/components/declarations/declarations-before-text.js +0 -9
  119. package/lib/components/declarations/declarations-detachable.js +0 -9
  120. package/lib/components/declarations/declarations.js +6 -16
  121. package/lib/components/declarations/index.js +0 -8
  122. package/lib/components/dropdown/dropdown-simple/dropdown-simple.js +7 -14
  123. package/lib/components/dropdown/dropdown-simple/index.js +0 -2
  124. package/lib/components/dropdown/dropdown-simple/simple-label-renderer.js +3 -13
  125. package/lib/components/dropdown/dropdown-simple/simple-option-renderer.js +2 -9
  126. package/lib/components/dropdown/dropdown-writable/dropdown-writable.js +10 -30
  127. package/lib/components/dropdown/dropdown-writable/filter-tools/filter-options.js +1 -12
  128. package/lib/components/dropdown/dropdown-writable/filter-tools/letters-matching.js +0 -11
  129. package/lib/components/dropdown/dropdown-writable/filter-tools/match.js +0 -5
  130. package/lib/components/dropdown/dropdown-writable/filter-tools/prepare-prefix.js +0 -4
  131. package/lib/components/dropdown/dropdown-writable/index.js +0 -2
  132. package/lib/components/dropdown/dropdown-writable/writable-label-renderer.js +3 -13
  133. package/lib/components/dropdown/dropdown-writable/writable-option-renderer.js +14 -50
  134. package/lib/components/dropdown/dropdown.js +8 -19
  135. package/lib/components/dropdown/index.js +0 -2
  136. package/lib/components/dropdown/lunatic-dropdown.js +8 -17
  137. package/lib/components/filter-description/component.js +1 -7
  138. package/lib/components/filter-description/index.js +0 -2
  139. package/lib/components/index.js +0 -4
  140. package/lib/components/input/index.js +0 -2
  141. package/lib/components/input/input.js +6 -18
  142. package/lib/components/input/lunatic-input.js +1 -14
  143. package/lib/components/input-number/index.js +0 -2
  144. package/lib/components/input-number/input-number.js +9 -20
  145. package/lib/components/input-number/lunatic-input-number.js +1 -12
  146. package/lib/components/loop/block-for-loop/block-for-loop-ochestrator.js +0 -4
  147. package/lib/components/loop/block-for-loop/block-for-loop.js +28 -61
  148. package/lib/components/loop/block-for-loop/index.js +0 -2
  149. package/lib/components/loop/block-for-loop/row.js +13 -29
  150. package/lib/components/loop/commons/get-init-length.js +0 -3
  151. package/lib/components/loop/commons/handle-row-button.js +2 -7
  152. package/lib/components/loop/commons/index.js +0 -3
  153. package/lib/components/loop/commons/row-component.js +16 -37
  154. package/lib/components/loop/index.js +0 -2
  155. package/lib/components/loop/loop.js +19 -29
  156. package/lib/components/loop/roster-for-loop/body.js +10 -24
  157. package/lib/components/loop/roster-for-loop/header.js +2 -9
  158. package/lib/components/loop/roster-for-loop/index.js +0 -2
  159. package/lib/components/loop/roster-for-loop/roster-for-loop-orchestrator.js +0 -4
  160. package/lib/components/loop/roster-for-loop/roster-for-loop.js +21 -51
  161. package/lib/components/loop/roster-for-loop/roster-table.js +10 -21
  162. package/lib/components/loop/roster-for-loop/row.js +13 -26
  163. package/lib/components/modal-controls/close-or-skip.js +3 -10
  164. package/lib/components/modal-controls/index.js +0 -2
  165. package/lib/components/modal-controls/modal-container.js +0 -5
  166. package/lib/components/modal-controls/modal-controls.js +5 -28
  167. package/lib/components/modal-controls/modal-controls.scss +7 -6
  168. package/lib/components/{pairwise/links → pairwise-links}/index.js +0 -2
  169. package/lib/components/pairwise-links/orchestrator.js +69 -0
  170. package/lib/components/{pairwise/links → pairwise-links}/pairwise-links.js +20 -27
  171. package/lib/components/{pairwise/links → pairwise-links}/row.js +50 -65
  172. package/lib/components/radio/index.js +0 -2
  173. package/lib/components/radio/lunatic-radio-group.js +6 -14
  174. package/lib/components/radio/radio-group.js +6 -13
  175. package/lib/components/radio/radio-option.js +9 -23
  176. package/lib/components/sequence/index.js +0 -2
  177. package/lib/components/sequence/sequence.js +3 -11
  178. package/lib/components/subsequence/index.js +0 -2
  179. package/lib/components/subsequence/subsequence.js +2 -9
  180. package/lib/components/suggester/check-store.js +13 -47
  181. package/lib/components/suggester/find-best-label/find-best-label.js +2 -14
  182. package/lib/components/suggester/find-best-label/index.js +0 -2
  183. package/lib/components/suggester/idb-suggester.js +13 -33
  184. package/lib/components/suggester/index.js +0 -2
  185. package/lib/components/suggester/lunatic-suggester.js +13 -27
  186. package/lib/components/suggester/searching/create-searching.js +5 -18
  187. package/lib/components/suggester/searching/index.js +0 -2
  188. package/lib/components/suggester/suggester.js +19 -53
  189. package/lib/components/suggester-loader-widget/index.js +0 -2
  190. package/lib/components/suggester-loader-widget/loader-row.js +12 -39
  191. package/lib/components/suggester-loader-widget/loader.js +14 -55
  192. package/lib/components/suggester-loader-widget/progress.js +6 -13
  193. package/lib/components/suggester-loader-widget/tools/action-tool.js +5 -12
  194. package/lib/components/suggester-loader-widget/tools/index.js +0 -3
  195. package/lib/components/suggester-loader-widget/tools/tools.js +0 -4
  196. package/lib/components/suggester-loader-widget/widget-container.js +2 -11
  197. package/lib/components/suggester-loader-widget/widget.js +20 -52
  198. package/lib/components/switch/index.js +0 -2
  199. package/lib/components/switch/lunatic-switch.js +5 -17
  200. package/lib/components/switch/switch.js +6 -20
  201. package/lib/components/table/cell.js +14 -39
  202. package/lib/components/table/components/cell.js +14 -39
  203. package/lib/components/table/components/header.js +4 -11
  204. package/lib/components/table/components/row.js +7 -13
  205. package/lib/components/table/components/table.js +3 -10
  206. package/lib/components/table/index.js +0 -2
  207. package/lib/components/table/lunatic-table.js +13 -33
  208. package/lib/components/table/table-orchestrator.js +12 -20
  209. package/lib/components/textarea/index.js +0 -2
  210. package/lib/components/textarea/lunatic-textarea.js +1 -14
  211. package/lib/components/textarea/textarea.js +7 -19
  212. package/lib/constants/declarations.js +3 -1
  213. package/lib/constants/event-types.js +2 -1
  214. package/lib/constants/index.js +0 -10
  215. package/lib/constants/supported-preferences.js +0 -5
  216. package/lib/constants/variable-types.js +2 -2
  217. package/lib/i18n/build-dictionary.js +2 -10
  218. package/lib/i18n/index.js +0 -6
  219. package/lib/index.js +0 -4
  220. package/lib/stories/checkboxBoolean/checkboxBoolean.stories.js +0 -8
  221. package/lib/stories/checkboxOne/checkboxOne.stories.js +0 -8
  222. package/lib/stories/custom-mui/checkbox-boolean-mui.js +4 -12
  223. package/lib/stories/custom-mui/checkbox-group-mui.js +9 -23
  224. package/lib/stories/custom-mui/checkbox-one-mui.js +0 -4
  225. package/lib/stories/custom-mui/index.js +0 -16
  226. package/lib/stories/custom-mui/input-mui.js +7 -17
  227. package/lib/stories/custom-mui/input-number-mui.js +7 -15
  228. package/lib/stories/custom-mui/radio-mui.js +7 -23
  229. package/lib/stories/custom-mui/suggester-mui/index.js +0 -2
  230. package/lib/stories/custom-mui/suggester-mui/suggester-mui.js +54 -92
  231. package/lib/stories/custom-mui/switch-mui.js +5 -15
  232. package/lib/stories/custom-mui/table-mui.js +2 -10
  233. package/lib/stories/custom-mui/tbody-mui.js +2 -8
  234. package/lib/stories/custom-mui/td-mui.js +4 -10
  235. package/lib/stories/custom-mui/textarea-mui.js +7 -16
  236. package/lib/stories/custom-mui/th-mui.js +3 -9
  237. package/lib/stories/custom-mui/thead-mui.js +2 -8
  238. package/lib/stories/custom-mui/tr-mui.js +3 -10
  239. package/lib/stories/date-picker/datepicker.stories.js +0 -9
  240. package/lib/stories/dropdown/dropdown.stories.js +0 -9
  241. package/lib/stories/filter-description/filter-description.stories.js +0 -12
  242. package/lib/stories/input/input.stories.js +0 -9
  243. package/lib/stories/input-number/input-number.stories.js +0 -9
  244. package/lib/stories/pairwise/data.json +4 -5
  245. package/lib/stories/pairwise/links.json +81 -18
  246. package/lib/stories/pairwise/pairwise-links.stories.js +0 -9
  247. package/lib/stories/paste-questionnaire/test.stories.js +0 -11
  248. package/lib/stories/questionnaires/logement/logement.stories.js +0 -14
  249. package/lib/stories/questionnaires/recensement/data.json +12 -0
  250. package/lib/stories/questionnaires/recensement/recensement.stories.js +55 -0
  251. package/lib/stories/questionnaires/recensement/source.json +15202 -0
  252. package/lib/stories/questionnaires/simpsons/simpsons.stories.js +0 -11
  253. package/lib/stories/questionnaires-test/controls/controls.stories.js +0 -15
  254. package/lib/stories/questionnaires-test/test.stories.js +0 -15
  255. package/lib/stories/radio/radio.stories.js +0 -8
  256. package/lib/stories/roster-for-loop/roster-for-loop.stories.js +0 -8
  257. package/lib/stories/suggester/suggester-workers.stories.js +11 -52
  258. package/lib/stories/suggester/suggester.stories.js +0 -10
  259. package/lib/stories/switch/SwitchMaterialUI.js +5 -15
  260. package/lib/stories/switch/switch.js +3 -26
  261. package/lib/stories/table/table.stories.js +0 -16
  262. package/lib/stories/utils/default-arg-types.js +0 -4
  263. package/lib/stories/utils/orchestrator.js +60 -84
  264. package/lib/stories/utils/waiting/index.js +0 -2
  265. package/lib/stories/utils/waiting/waiting.js +1 -11
  266. package/lib/use-lunatic/actions.js +8 -20
  267. package/lib/use-lunatic/commons/calculated-variables.js +15 -42
  268. package/lib/use-lunatic/commons/check-loops.js +9 -36
  269. package/lib/use-lunatic/commons/compose.js +0 -4
  270. package/lib/use-lunatic/commons/create-map-pages.js +2 -26
  271. package/lib/use-lunatic/commons/execute-condition-filter.js +0 -7
  272. package/lib/use-lunatic/commons/execute-expression/create-execute-expression.js +52 -101
  273. package/lib/use-lunatic/commons/execute-expression/create-memoizer.js +2 -26
  274. package/lib/use-lunatic/commons/execute-expression/create-refresh-calculated.js +18 -43
  275. package/lib/use-lunatic/commons/execute-expression/execute-expression.js +3 -38
  276. package/lib/use-lunatic/commons/execute-expression/get-expressions-variables.js +2 -16
  277. package/lib/use-lunatic/commons/execute-expression/get-safety-expression.js +2 -11
  278. package/lib/use-lunatic/commons/execute-expression/index.js +0 -2
  279. package/lib/use-lunatic/commons/fill-components/fill-component-expressions.js +15 -43
  280. package/lib/use-lunatic/commons/fill-components/fill-component-value.js +0 -7
  281. package/lib/use-lunatic/commons/fill-components/fill-components.js +0 -13
  282. package/lib/use-lunatic/commons/fill-components/fill-errors.js +0 -7
  283. package/lib/use-lunatic/commons/fill-components/fill-from-state.js +2 -7
  284. package/lib/use-lunatic/commons/fill-components/fill-management.js +0 -7
  285. package/lib/use-lunatic/commons/fill-components/fill-missing-response.js +1 -9
  286. package/lib/use-lunatic/commons/fill-components/fill-pagination.js +0 -5
  287. package/lib/use-lunatic/commons/fill-components/index.js +0 -2
  288. package/lib/use-lunatic/commons/get-compatible-vtl-expression.js +0 -7
  289. package/lib/use-lunatic/commons/get-component-value/get-component-value.js +22 -64
  290. package/lib/use-lunatic/commons/get-component-value/index.js +0 -2
  291. package/lib/use-lunatic/commons/get-components-from-state.js +3 -10
  292. package/lib/use-lunatic/commons/get-data.js +11 -29
  293. package/lib/use-lunatic/commons/get-errors-without-empty-value.js +2 -11
  294. package/lib/use-lunatic/commons/index.js +0 -14
  295. package/lib/use-lunatic/commons/is-First-last-page.js +1 -3
  296. package/lib/use-lunatic/commons/is-paginated-loop.js +1 -3
  297. package/lib/use-lunatic/commons/load-suggesters.js +8 -53
  298. package/lib/use-lunatic/commons/page-tag.js +10 -33
  299. package/lib/use-lunatic/commons/use-components-from-state.js +5 -18
  300. package/lib/use-lunatic/index.js +0 -2
  301. package/lib/use-lunatic/initial-state.js +0 -3
  302. package/lib/use-lunatic/reducer/commons/index.js +0 -5
  303. package/lib/use-lunatic/reducer/commons/is-empty-on-empty-page.js +1 -15
  304. package/lib/use-lunatic/reducer/commons/resize-array-variable.js +2 -12
  305. package/lib/use-lunatic/reducer/commons/validate-condition-filter.js +3 -15
  306. package/lib/use-lunatic/reducer/index.js +0 -2
  307. package/lib/use-lunatic/reducer/reduce-go-next-page.js +17 -55
  308. package/lib/use-lunatic/reducer/reduce-go-previous-page.js +25 -48
  309. package/lib/use-lunatic/reducer/reduce-go-to-page.js +4 -18
  310. package/lib/use-lunatic/reducer/reduce-handle-change/index.js +0 -2
  311. package/lib/use-lunatic/reducer/reduce-handle-change/reduce-cleaning.js +8 -27
  312. package/lib/use-lunatic/reducer/reduce-handle-change/reduce-handle-change.js +24 -40
  313. package/lib/use-lunatic/reducer/reduce-handle-change/reduce-links-variable.js +53 -28
  314. package/lib/use-lunatic/reducer/reduce-handle-change/reduce-missing.js +9 -32
  315. package/lib/use-lunatic/reducer/reduce-handle-change/reduce-resizing.js +19 -41
  316. package/lib/use-lunatic/reducer/reduce-handle-change/reduce-variables-array.js +7 -19
  317. package/lib/use-lunatic/reducer/reduce-handle-change/reduce-variables-simple.js +1 -8
  318. package/lib/use-lunatic/reducer/reduce-on-init.js +50 -96
  319. package/lib/use-lunatic/reducer/reduce-on-set-waiting.js +0 -5
  320. package/lib/use-lunatic/reducer/reducer.js +0 -20
  321. package/lib/use-lunatic/reducer/validate-controls/create-controls-reducer.js +9 -21
  322. package/lib/use-lunatic/reducer/validate-controls/create-modal-controls-reducer.js +7 -26
  323. package/lib/use-lunatic/reducer/validate-controls/index.js +0 -3
  324. package/lib/use-lunatic/reducer/validate-controls/validation-utils.js +7 -20
  325. package/lib/use-lunatic/use-lunatic.js +57 -104
  326. package/lib/utils/constants/index.js +0 -10
  327. package/lib/utils/idb-tools/clear-store.js +1 -11
  328. package/lib/utils/idb-tools/create-db-opener.js +6 -19
  329. package/lib/utils/idb-tools/create-open-db.js +1 -7
  330. package/lib/utils/idb-tools/get-entity.js +0 -4
  331. package/lib/utils/idb-tools/get-idb.js +0 -2
  332. package/lib/utils/idb-tools/idb-bulk-insert.js +11 -37
  333. package/lib/utils/idb-tools/index.js +0 -11
  334. package/lib/utils/idb-tools/insert-entity.js +0 -4
  335. package/lib/utils/idb-tools/open-db.js +1 -6
  336. package/lib/utils/idb-tools/open-or-create-db.js +3 -10
  337. package/lib/utils/is-element.js +0 -2
  338. package/lib/utils/store-tools/auto-load.js +9 -50
  339. package/lib/utils/store-tools/clear-store-data.js +1 -12
  340. package/lib/utils/store-tools/clear-store-info.js +1 -12
  341. package/lib/utils/store-tools/create/create.js +1 -18
  342. package/lib/utils/store-tools/create/index.js +0 -3
  343. package/lib/utils/store-tools/create/update-store-info.js +0 -6
  344. package/lib/utils/store-tools/get-store-count.js +0 -5
  345. package/lib/utils/store-tools/index.js +0 -12
  346. package/lib/utils/store-tools/open-or-create-store.js +1 -11
  347. package/lib/utils/store-tools/use-store-index.js +4 -26
  348. package/lib/utils/suggester-workers/append-to-index/append.js +7 -23
  349. package/lib/utils/suggester-workers/append-to-index/append.worker.js +6 -10
  350. package/lib/utils/suggester-workers/append-to-index/create-append-task.js +3 -11
  351. package/lib/utils/suggester-workers/append-to-index/index.js +0 -3
  352. package/lib/utils/suggester-workers/append-to-index/prepare-entities.js +5 -34
  353. package/lib/utils/suggester-workers/append-to-index/store-messages.js +0 -6
  354. package/lib/utils/suggester-workers/commons-tokenizer/create-entity-tokenizer.js +0 -19
  355. package/lib/utils/suggester-workers/commons-tokenizer/create-fields-tokenizer.js +11 -40
  356. package/lib/utils/suggester-workers/commons-tokenizer/create-filter-stop-words.js +0 -14
  357. package/lib/utils/suggester-workers/commons-tokenizer/filters/compose-filters.js +0 -3
  358. package/lib/utils/suggester-workers/commons-tokenizer/filters/create-filter-stop-words.js +0 -14
  359. package/lib/utils/suggester-workers/commons-tokenizer/filters/create-filter-stop-words.spec.js +0 -2
  360. package/lib/utils/suggester-workers/commons-tokenizer/filters/filter-accents.js +0 -5
  361. package/lib/utils/suggester-workers/commons-tokenizer/filters/filter-accents.spec.js +0 -2
  362. package/lib/utils/suggester-workers/commons-tokenizer/filters/filter-double.js +0 -9
  363. package/lib/utils/suggester-workers/commons-tokenizer/filters/filter-double.spec.js +0 -2
  364. package/lib/utils/suggester-workers/commons-tokenizer/filters/filter-length.js +1 -3
  365. package/lib/utils/suggester-workers/commons-tokenizer/filters/filter-length.spec.js +0 -2
  366. package/lib/utils/suggester-workers/commons-tokenizer/filters/filter-stemmer.js +3 -9
  367. package/lib/utils/suggester-workers/commons-tokenizer/filters/filter-stemmer.spec.js +0 -2
  368. package/lib/utils/suggester-workers/commons-tokenizer/filters/filter-synonyms.js +1 -21
  369. package/lib/utils/suggester-workers/commons-tokenizer/filters/filter-synonyms.spec.js +2 -3
  370. package/lib/utils/suggester-workers/commons-tokenizer/filters/filter-to-lower.js +0 -3
  371. package/lib/utils/suggester-workers/commons-tokenizer/filters/filter-to-lower.spec.js +0 -2
  372. package/lib/utils/suggester-workers/commons-tokenizer/filters/index.js +0 -3
  373. package/lib/utils/suggester-workers/commons-tokenizer/get-regexp-from-pattern.js +0 -3
  374. package/lib/utils/suggester-workers/commons-tokenizer/get-stemmer.js +0 -8
  375. package/lib/utils/suggester-workers/commons-tokenizer/index.js +0 -10
  376. package/lib/utils/suggester-workers/commons-tokenizer/prepare-string-indexation.js +0 -6
  377. package/lib/utils/suggester-workers/commons-tokenizer/soft-tokenizer.js +0 -3
  378. package/lib/utils/suggester-workers/create-worker.js +1 -11
  379. package/lib/utils/suggester-workers/find-best-label/find-best-label.js +5 -26
  380. package/lib/utils/suggester-workers/find-best-label/find-best-label.worker.js +9 -23
  381. package/lib/utils/suggester-workers/find-best-label/tokenize.js +5 -22
  382. package/lib/utils/suggester-workers/find-best-label/tokenize.spec.js +0 -2
  383. package/lib/utils/suggester-workers/searching/compute-score.js +0 -15
  384. package/lib/utils/suggester-workers/searching/get-db.js +1 -15
  385. package/lib/utils/suggester-workers/searching/index.js +0 -2
  386. package/lib/utils/suggester-workers/searching/order/create-alphanumeric-orderer.js +0 -5
  387. package/lib/utils/suggester-workers/searching/order/index.js +0 -8
  388. package/lib/utils/suggester-workers/searching/query-parser/index.js +0 -3
  389. package/lib/utils/suggester-workers/searching/query-parser/query-parser-soft.js +0 -3
  390. package/lib/utils/suggester-workers/searching/query-parser/query-parser-soft.spec.js +0 -2
  391. package/lib/utils/suggester-workers/searching/query-parser/query-parser-tokenized.js +4 -20
  392. package/lib/utils/suggester-workers/searching/resolve-query-parser.js +1 -15
  393. package/lib/utils/suggester-workers/searching/search-in-index.js +0 -3
  394. package/lib/utils/suggester-workers/searching/searching.js +2 -39
  395. package/lib/utils/suggester-workers/searching/searching.worker.js +4 -7
  396. package/lib/utils/vtl/dataset-builder.js +0 -4
  397. package/lib/utils/vtl/index.js +0 -2
  398. package/package.json +4 -2
  399. package/lib/components/pairwise/index.js +0 -15
  400. package/lib/components/pairwise/links/orchestrator.js +0 -16
@@ -1,66 +1,44 @@
1
1
  "use strict";
2
2
 
3
3
  function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
4
-
5
4
  Object.defineProperty(exports, "__esModule", {
6
5
  value: true
7
6
  });
8
7
  exports["default"] = void 0;
9
-
10
8
  var _react = _interopRequireWildcard(require("react"));
11
-
12
9
  var _classnames = _interopRequireDefault(require("classnames"));
13
-
14
10
  var _storeTools = require("../../utils/store-tools");
15
-
16
11
  var _icons = require("../commons/icons");
17
-
18
12
  var _loader = _interopRequireDefault(require("./loader"));
19
-
20
13
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
21
-
22
14
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
23
-
24
15
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
25
-
26
- 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; }
27
-
16
+ 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, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $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 defineProperty(generator, "_invoke", { value: makeInvokeMethod(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; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(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); } }; } 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, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), 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 (val) { var object = Object(val), 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; }
28
17
  function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
29
-
30
18
  function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
31
-
32
19
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
33
-
34
20
  function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
35
-
36
21
  function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
37
-
38
22
  function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
39
-
40
23
  function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
41
-
42
24
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
43
-
44
25
  function LoaderRow(_ref) {
45
26
  var storeInfo = _ref.storeInfo,
46
- idbVersion = _ref.idbVersion,
47
- fetchStore = _ref.fetchStore,
48
- onRefresh = _ref.onRefresh,
49
- _ref$disabled = _ref.disabled,
50
- disabled = _ref$disabled === void 0 ? false : _ref$disabled;
27
+ idbVersion = _ref.idbVersion,
28
+ fetchStore = _ref.fetchStore,
29
+ onRefresh = _ref.onRefresh,
30
+ _ref$disabled = _ref.disabled,
31
+ disabled = _ref$disabled === void 0 ? false : _ref$disabled;
51
32
  var name = storeInfo.name;
52
33
  var db = (0, _storeTools.useStoreIndex)(storeInfo, idbVersion);
53
-
54
34
  var _useState = (0, _react.useState)(undefined),
55
- _useState2 = _slicedToArray(_useState, 2),
56
- nbEntities = _useState2[0],
57
- setNbEntities = _useState2[1];
58
-
35
+ _useState2 = _slicedToArray(_useState, 2),
36
+ nbEntities = _useState2[0],
37
+ setNbEntities = _useState2[1];
59
38
  var _useState3 = (0, _react.useState)(false),
60
- _useState4 = _slicedToArray(_useState3, 2),
61
- start = _useState4[0],
62
- setStart = _useState4[1];
63
-
39
+ _useState4 = _slicedToArray(_useState3, 2),
40
+ start = _useState4[0],
41
+ setStart = _useState4[1];
64
42
  var post = (0, _react.useCallback)(function (_, count) {
65
43
  setNbEntities(count);
66
44
  onRefresh("Store ".concat(name, " loaded."));
@@ -75,7 +53,6 @@ function LoaderRow(_ref) {
75
53
  function count() {
76
54
  return _count.apply(this, arguments);
77
55
  }
78
-
79
56
  function _count() {
80
57
  _count = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
81
58
  var c;
@@ -85,11 +62,9 @@ function LoaderRow(_ref) {
85
62
  case 0:
86
63
  _context.next = 2;
87
64
  return (0, _storeTools.getStoreCount)(db);
88
-
89
65
  case 2:
90
66
  c = _context.sent;
91
67
  setNbEntities(c);
92
-
93
68
  case 4:
94
69
  case "end":
95
70
  return _context.stop();
@@ -99,7 +74,6 @@ function LoaderRow(_ref) {
99
74
  }));
100
75
  return _count.apply(this, arguments);
101
76
  }
102
-
103
77
  if (db) {
104
78
  count();
105
79
  }
@@ -145,6 +119,5 @@ function LoaderRow(_ref) {
145
119
  className: "lunatic-suggester-icon"
146
120
  }))));
147
121
  }
148
-
149
122
  var _default = LoaderRow;
150
123
  exports["default"] = _default;
@@ -1,70 +1,47 @@
1
1
  "use strict";
2
2
 
3
3
  function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
4
-
5
4
  Object.defineProperty(exports, "__esModule", {
6
5
  value: true
7
6
  });
8
7
  exports["default"] = void 0;
9
-
10
8
  var _react = _interopRequireWildcard(require("react"));
11
-
12
9
  var _appendToIndex = require("../../utils/suggester-workers/append-to-index");
13
-
14
10
  var _progress = _interopRequireDefault(require("./progress"));
15
-
16
11
  var _storeTools = require("../../utils/store-tools");
17
-
18
12
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
19
-
20
13
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
21
-
22
14
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
23
-
24
- 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; }
25
-
15
+ 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, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $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 defineProperty(generator, "_invoke", { value: makeInvokeMethod(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; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(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); } }; } 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, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), 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 (val) { var object = Object(val), 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; }
26
16
  function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
27
-
28
17
  function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
29
-
30
18
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
31
-
32
19
  function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
33
-
34
20
  function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
35
-
36
21
  function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
37
-
38
22
  function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
39
-
40
23
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
41
-
42
24
  function empty() {}
43
-
44
25
  function Loader(_ref) {
45
26
  var start = _ref.start,
46
- db = _ref.db,
47
- store = _ref.store,
48
- idbVersion = _ref.idbVersion,
49
- fetch = _ref.fetch,
50
- post = _ref.post,
51
- handleClick = _ref.handleClick;
52
-
27
+ db = _ref.db,
28
+ store = _ref.store,
29
+ idbVersion = _ref.idbVersion,
30
+ fetch = _ref.fetch,
31
+ post = _ref.post,
32
+ handleClick = _ref.handleClick;
53
33
  var _useState = (0, _react.useState)(0),
54
- _useState2 = _slicedToArray(_useState, 2),
55
- progress = _useState2[0],
56
- setProgress = _useState2[1];
57
-
34
+ _useState2 = _slicedToArray(_useState, 2),
35
+ progress = _useState2[0],
36
+ setProgress = _useState2[1];
58
37
  var _useState3 = (0, _react.useState)(undefined),
59
- _useState4 = _slicedToArray(_useState3, 2),
60
- entities = _useState4[0],
61
- setEntities = _useState4[1];
62
-
38
+ _useState4 = _slicedToArray(_useState3, 2),
39
+ entities = _useState4[0],
40
+ setEntities = _useState4[1];
63
41
  (0, _react.useEffect)(function () {
64
42
  function load() {
65
43
  return _load.apply(this, arguments);
66
44
  }
67
-
68
45
  function _load() {
69
46
  _load = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
70
47
  var e;
@@ -76,14 +53,11 @@ function Loader(_ref) {
76
53
  _context.next = 5;
77
54
  break;
78
55
  }
79
-
80
56
  _context.next = 3;
81
57
  return fetch();
82
-
83
58
  case 3:
84
59
  e = _context.sent;
85
60
  setEntities(e);
86
-
87
61
  case 5:
88
62
  case "end":
89
63
  return _context.stop();
@@ -93,60 +67,47 @@ function Loader(_ref) {
93
67
  }));
94
68
  return _load.apply(this, arguments);
95
69
  }
96
-
97
70
  load();
98
71
  }, [fetch, start]);
99
-
100
72
  function log(_ref2) {
101
73
  var message = _ref2.message;
102
74
  var type = message.type,
103
- percent = message.percent;
104
-
75
+ percent = message.percent;
105
76
  if (type === 'bulk-insert/complete') {
106
77
  setProgress(percent);
107
78
  }
108
79
  }
109
-
110
80
  (0, _react.useEffect)(function () {
111
81
  var abort;
112
-
113
82
  function go() {
114
83
  return _go.apply(this, arguments);
115
84
  }
116
-
117
85
  function _go() {
118
86
  _go = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
119
87
  var _createAppendTask, _createAppendTask2, startT, abort_;
120
-
121
88
  return _regeneratorRuntime().wrap(function _callee2$(_context2) {
122
89
  while (1) {
123
90
  switch (_context2.prev = _context2.next) {
124
91
  case 0:
125
92
  _context2.prev = 0;
126
-
127
93
  if (!(entities && db && idbVersion && store)) {
128
94
  _context2.next = 8;
129
95
  break;
130
96
  }
131
-
132
97
  _createAppendTask = (0, _appendToIndex.createAppendTask)(store, idbVersion, log), _createAppendTask2 = _slicedToArray(_createAppendTask, 2), startT = _createAppendTask2[0], abort_ = _createAppendTask2[1];
133
98
  abort = abort_;
134
99
  (0, _storeTools.clearStoreData)(db);
135
100
  _context2.next = 7;
136
101
  return startT(entities);
137
-
138
102
  case 7:
139
103
  post(store.name, entities.length);
140
-
141
104
  case 8:
142
105
  _context2.next = 13;
143
106
  break;
144
-
145
107
  case 10:
146
108
  _context2.prev = 10;
147
109
  _context2.t0 = _context2["catch"](0);
148
110
  console.warn(_context2.t0);
149
-
150
111
  case 13:
151
112
  case "end":
152
113
  return _context2.stop();
@@ -156,7 +117,6 @@ function Loader(_ref) {
156
117
  }));
157
118
  return _go.apply(this, arguments);
158
119
  }
159
-
160
120
  go();
161
121
  return function () {
162
122
  if (abort) {
@@ -170,7 +130,6 @@ function Loader(_ref) {
170
130
  handleClick: handleClick
171
131
  });
172
132
  }
173
-
174
133
  Loader.defaultProps = {
175
134
  idbVersion: '1',
176
135
  post: empty,
@@ -4,22 +4,17 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports["default"] = void 0;
7
-
8
7
  var _react = _interopRequireDefault(require("react"));
9
-
10
8
  var _classnames = _interopRequireDefault(require("classnames"));
11
-
12
9
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
13
-
14
10
  function Progress(_ref) {
15
11
  var display = _ref.display,
16
- _ref$percent = _ref.percent,
17
- percent = _ref$percent === void 0 ? 0 : _ref$percent,
18
- _ref$handleClick = _ref.handleClick,
19
- handleClick = _ref$handleClick === void 0 ? function () {
20
- return null;
21
- } : _ref$handleClick;
22
-
12
+ _ref$percent = _ref.percent,
13
+ percent = _ref$percent === void 0 ? 0 : _ref$percent,
14
+ _ref$handleClick = _ref.handleClick,
15
+ handleClick = _ref$handleClick === void 0 ? function () {
16
+ return null;
17
+ } : _ref$handleClick;
23
18
  if (display) {
24
19
  return /*#__PURE__*/_react["default"].createElement("div", {
25
20
  className: (0, _classnames["default"])('lunatic-suggester-loader-progress', {
@@ -37,9 +32,7 @@ function Progress(_ref) {
37
32
  }
38
33
  })));
39
34
  }
40
-
41
35
  return null;
42
36
  }
43
-
44
37
  var _default = Progress;
45
38
  exports["default"] = _default;
@@ -4,21 +4,16 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports["default"] = void 0;
7
-
8
7
  var _react = _interopRequireDefault(require("react"));
9
-
10
8
  var _classnames = _interopRequireDefault(require("classnames"));
11
-
12
9
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
13
-
14
10
  function ActionTool(_ref) {
15
11
  var children = _ref.children,
16
- ariaLabel = _ref.ariaLabel,
17
- className = _ref.className,
18
- title = _ref.title,
19
- _ref$display = _ref.display,
20
- display = _ref$display === void 0 ? true : _ref$display;
21
-
12
+ ariaLabel = _ref.ariaLabel,
13
+ className = _ref.className,
14
+ title = _ref.title,
15
+ _ref$display = _ref.display,
16
+ display = _ref$display === void 0 ? true : _ref$display;
22
17
  if (display) {
23
18
  return /*#__PURE__*/_react["default"].createElement("div", {
24
19
  "aria-label": ariaLabel,
@@ -27,9 +22,7 @@ function ActionTool(_ref) {
27
22
  title: title
28
23
  }, children);
29
24
  }
30
-
31
25
  return null;
32
26
  }
33
-
34
27
  var _default = ActionTool;
35
28
  exports["default"] = _default;
@@ -15,9 +15,6 @@ Object.defineProperty(exports, "Tools", {
15
15
  return _tools["default"];
16
16
  }
17
17
  });
18
-
19
18
  var _actionTool = _interopRequireDefault(require("./action-tool"));
20
-
21
19
  var _tools = _interopRequireDefault(require("./tools"));
22
-
23
20
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
@@ -4,17 +4,13 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports["default"] = void 0;
7
-
8
7
  var _react = _interopRequireDefault(require("react"));
9
-
10
8
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
11
-
12
9
  function Tools(_ref) {
13
10
  var children = _ref.children;
14
11
  return /*#__PURE__*/_react["default"].createElement("div", {
15
12
  className: "lunatic-widget-tools"
16
13
  }, children);
17
14
  }
18
-
19
15
  var _default = Tools;
20
16
  exports["default"] = _default;
@@ -4,20 +4,14 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports["default"] = void 0;
7
-
8
7
  var _react = _interopRequireDefault(require("react"));
9
-
10
8
  var _reactDom = _interopRequireDefault(require("react-dom"));
11
-
12
9
  var _classnames = _interopRequireDefault(require("classnames"));
13
-
14
10
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
15
-
16
11
  function WidgetContainer(_ref, containerEl) {
17
12
  var children = _ref.children,
18
- drag = _ref.drag,
19
- absolute = _ref.absolute;
20
-
13
+ drag = _ref.drag,
14
+ absolute = _ref.absolute;
21
15
  if (absolute) {
22
16
  return /*#__PURE__*/_reactDom["default"].createPortal( /*#__PURE__*/_react["default"].createElement("div", {
23
17
  className: (0, _classnames["default"])('lunatic-suggester-widget-container', {
@@ -30,7 +24,6 @@ function WidgetContainer(_ref, containerEl) {
30
24
  })
31
25
  }, children)), document.body);
32
26
  }
33
-
34
27
  return /*#__PURE__*/_react["default"].createElement("div", {
35
28
  className: (0, _classnames["default"])('lunatic-suggester-widget-container', {
36
29
  absolute: absolute
@@ -42,7 +35,5 @@ function WidgetContainer(_ref, containerEl) {
42
35
  })
43
36
  }, children));
44
37
  }
45
-
46
38
  var _default = /*#__PURE__*/_react["default"].forwardRef(WidgetContainer);
47
-
48
39
  exports["default"] = _default;