@airtable/blocks 1.18.1 → 1.19.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (747) hide show
  1. package/CHANGELOG.md +15 -1
  2. package/dist/cjs/color_utils.js +21 -23
  3. package/dist/cjs/colors.js +4 -60
  4. package/dist/cjs/error_utils.js +15 -25
  5. package/dist/cjs/event_tracker.js +5 -11
  6. package/dist/cjs/global_config.js +107 -188
  7. package/dist/cjs/index.js +16 -40
  8. package/dist/cjs/injected/airtable_interface.js +1 -6
  9. package/dist/cjs/models/abstract_model.js +50 -81
  10. package/dist/cjs/models/abstract_model_with_async_data.js +102 -177
  11. package/dist/cjs/models/base.js +211 -374
  12. package/dist/cjs/models/create_aggregators.js +53 -47
  13. package/dist/cjs/models/cursor.js +125 -201
  14. package/dist/cjs/models/field.js +256 -303
  15. package/dist/cjs/models/grouped_record_query_result.js +210 -286
  16. package/dist/cjs/models/linked_records_query_result.js +276 -454
  17. package/dist/cjs/models/models.js +36 -50
  18. package/dist/cjs/models/mutation_constants.js +5 -9
  19. package/dist/cjs/models/mutations.js +125 -338
  20. package/dist/cjs/models/object_pool.js +37 -94
  21. package/dist/cjs/models/record.js +132 -226
  22. package/dist/cjs/models/record_coloring.js +14 -19
  23. package/dist/cjs/models/record_query_result.js +323 -282
  24. package/dist/cjs/models/record_store.js +355 -688
  25. package/dist/cjs/models/session.js +99 -158
  26. package/dist/cjs/models/table.js +361 -549
  27. package/dist/cjs/models/table_or_view_query_result.js +410 -765
  28. package/dist/cjs/models/view.js +161 -204
  29. package/dist/cjs/models/view_data_store.js +177 -282
  30. package/dist/cjs/models/view_metadata_query_result.js +96 -127
  31. package/dist/cjs/perform_record_action.js +69 -103
  32. package/dist/cjs/private_utils.js +133 -223
  33. package/dist/cjs/sdk.js +97 -142
  34. package/dist/cjs/settings_button.js +30 -57
  35. package/dist/cjs/stats/block_stats.js +3 -15
  36. package/dist/cjs/testing/abstract_mock_airtable_interface.js +53 -97
  37. package/dist/cjs/types/airtable_interface.js +36 -8
  38. package/dist/cjs/types/field.js +66 -12
  39. package/dist/cjs/types/mutations.js +99 -6
  40. package/dist/cjs/types/permission_levels.js +2 -4
  41. package/dist/cjs/types/undo_redo.js +2 -3
  42. package/dist/cjs/types/view.js +16 -11
  43. package/dist/cjs/ui/base_provider.js +14 -9
  44. package/dist/cjs/ui/baymax_utils.js +107 -1102
  45. package/dist/cjs/ui/block_wrapper.js +30 -68
  46. package/dist/cjs/ui/box.js +52 -56
  47. package/dist/cjs/ui/button.js +60 -77
  48. package/dist/cjs/ui/cell_renderer.js +78 -139
  49. package/dist/cjs/ui/choice_token.js +45 -47
  50. package/dist/cjs/ui/collaborator_token.js +33 -54
  51. package/dist/cjs/ui/color_palette.js +58 -106
  52. package/dist/cjs/ui/color_palette_synced.js +41 -52
  53. package/dist/cjs/ui/confirmation_dialog.js +53 -69
  54. package/dist/cjs/ui/control_sizes.js +21 -46
  55. package/dist/cjs/ui/create_detect_element_resize.js +16 -50
  56. package/dist/cjs/ui/css_helpers.js +3 -10
  57. package/dist/cjs/ui/dialog.js +44 -71
  58. package/dist/cjs/ui/dialog_close_button.js +52 -72
  59. package/dist/cjs/ui/expand_record.js +4 -11
  60. package/dist/cjs/ui/expand_record_list.js +6 -11
  61. package/dist/cjs/ui/expand_record_picker_async.js +18 -35
  62. package/dist/cjs/ui/field_icon.js +25 -28
  63. package/dist/cjs/ui/field_picker.js +47 -81
  64. package/dist/cjs/ui/field_picker_synced.js +33 -44
  65. package/dist/cjs/ui/form_field.js +45 -64
  66. package/dist/cjs/ui/geometry/geometry.js +6 -10
  67. package/dist/cjs/ui/geometry/point.js +5 -13
  68. package/dist/cjs/ui/geometry/rect.js +7 -29
  69. package/dist/cjs/ui/geometry/size.js +5 -13
  70. package/dist/cjs/ui/global_alert.js +35 -61
  71. package/dist/cjs/ui/global_config_synced_component_helpers.js +4 -13
  72. package/dist/cjs/ui/heading.js +63 -92
  73. package/dist/cjs/ui/icon.js +44 -66
  74. package/dist/cjs/ui/icon_config.js +13 -24
  75. package/dist/cjs/ui/initialize_block.js +23 -36
  76. package/dist/cjs/ui/input.js +74 -87
  77. package/dist/cjs/ui/input_synced.js +34 -43
  78. package/dist/cjs/ui/key_codes.js +4 -9
  79. package/dist/cjs/ui/label.js +45 -50
  80. package/dist/cjs/ui/link.js +74 -89
  81. package/dist/cjs/ui/loader.js +26 -42
  82. package/dist/cjs/ui/modal.js +63 -89
  83. package/dist/cjs/ui/model_picker_select.js +29 -47
  84. package/dist/cjs/ui/popover.js +98 -180
  85. package/dist/cjs/ui/progress_bar.js +45 -51
  86. package/dist/cjs/ui/record_card.js +143 -278
  87. package/dist/cjs/ui/record_card_list.js +117 -165
  88. package/dist/cjs/ui/remote_utils.js +5 -13
  89. package/dist/cjs/ui/sdk_context.js +7 -9
  90. package/dist/cjs/ui/select.js +84 -118
  91. package/dist/cjs/ui/select_and_select_buttons_helpers.js +29 -45
  92. package/dist/cjs/ui/select_buttons.js +54 -90
  93. package/dist/cjs/ui/select_buttons_synced.js +32 -41
  94. package/dist/cjs/ui/select_synced.js +32 -42
  95. package/dist/cjs/ui/switch.js +66 -84
  96. package/dist/cjs/ui/switch_synced.js +32 -38
  97. package/dist/cjs/ui/synced.js +16 -43
  98. package/dist/cjs/ui/system/all_styles_set.js +89 -22
  99. package/dist/cjs/ui/system/appearance/appearance_set.js +15 -26
  100. package/dist/cjs/ui/system/appearance/background_color.js +6 -12
  101. package/dist/cjs/ui/system/appearance/border.js +6 -12
  102. package/dist/cjs/ui/system/appearance/border_radius.js +6 -12
  103. package/dist/cjs/ui/system/appearance/box_shadow.js +6 -12
  104. package/dist/cjs/ui/system/appearance/opacity.js +5 -11
  105. package/dist/cjs/ui/system/dimensions/dimensions_set.js +15 -27
  106. package/dist/cjs/ui/system/dimensions/height.js +5 -11
  107. package/dist/cjs/ui/system/dimensions/max_height.js +5 -11
  108. package/dist/cjs/ui/system/dimensions/max_width.js +5 -11
  109. package/dist/cjs/ui/system/dimensions/min_height.js +5 -11
  110. package/dist/cjs/ui/system/dimensions/min_width.js +5 -11
  111. package/dist/cjs/ui/system/dimensions/width.js +5 -11
  112. package/dist/cjs/ui/system/display.js +8 -9
  113. package/dist/cjs/ui/system/flex_container/align_content.js +6 -12
  114. package/dist/cjs/ui/system/flex_container/align_items.js +6 -12
  115. package/dist/cjs/ui/system/flex_container/flex_container_set.js +15 -27
  116. package/dist/cjs/ui/system/flex_container/flex_direction.js +5 -11
  117. package/dist/cjs/ui/system/flex_container/flex_wrap.js +5 -11
  118. package/dist/cjs/ui/system/flex_container/justify_content.js +5 -11
  119. package/dist/cjs/ui/system/flex_container/justify_items.js +5 -11
  120. package/dist/cjs/ui/system/flex_item/align_self.js +6 -12
  121. package/dist/cjs/ui/system/flex_item/flex.js +5 -11
  122. package/dist/cjs/ui/system/flex_item/flex_basis.js +5 -11
  123. package/dist/cjs/ui/system/flex_item/flex_grow.js +5 -11
  124. package/dist/cjs/ui/system/flex_item/flex_item_set.js +15 -28
  125. package/dist/cjs/ui/system/flex_item/flex_shrink.js +5 -11
  126. package/dist/cjs/ui/system/flex_item/justify_self.js +5 -11
  127. package/dist/cjs/ui/system/flex_item/order.js +5 -11
  128. package/dist/cjs/ui/system/index.js +310 -362
  129. package/dist/cjs/ui/system/overflow.js +8 -9
  130. package/dist/cjs/ui/system/position/bottom.js +6 -13
  131. package/dist/cjs/ui/system/position/left.js +5 -12
  132. package/dist/cjs/ui/system/position/position.js +5 -11
  133. package/dist/cjs/ui/system/position/position_set.js +15 -27
  134. package/dist/cjs/ui/system/position/right.js +5 -12
  135. package/dist/cjs/ui/system/position/top.js +5 -12
  136. package/dist/cjs/ui/system/position/z_index.js +5 -11
  137. package/dist/cjs/ui/system/spacing/margin.js +5 -12
  138. package/dist/cjs/ui/system/spacing/padding.js +5 -12
  139. package/dist/cjs/ui/system/spacing/spacing_set.js +15 -23
  140. package/dist/cjs/ui/system/typography/font_family.js +5 -11
  141. package/dist/cjs/ui/system/typography/font_size.js +5 -11
  142. package/dist/cjs/ui/system/typography/font_style.js +5 -11
  143. package/dist/cjs/ui/system/typography/font_weight.js +5 -11
  144. package/dist/cjs/ui/system/typography/letter_spacing.js +5 -11
  145. package/dist/cjs/ui/system/typography/line_height.js +5 -11
  146. package/dist/cjs/ui/system/typography/text_align.js +5 -11
  147. package/dist/cjs/ui/system/typography/text_color.js +5 -11
  148. package/dist/cjs/ui/system/typography/text_decoration.js +5 -11
  149. package/dist/cjs/ui/system/typography/text_transform.js +5 -11
  150. package/dist/cjs/ui/system/typography/typography_set.js +15 -31
  151. package/dist/cjs/ui/system/utils/create_responsive_prop_type.js +2 -4
  152. package/dist/cjs/ui/system/utils/create_style_prop_types.js +5 -13
  153. package/dist/cjs/ui/system/utils/ensure_numbers_are_within_scale.js +4 -14
  154. package/dist/cjs/ui/system/utils/get_style_props_for_responsive_prop.js +30 -70
  155. package/dist/cjs/ui/table_picker.js +26 -43
  156. package/dist/cjs/ui/table_picker_synced.js +33 -42
  157. package/dist/cjs/ui/text.js +59 -71
  158. package/dist/cjs/ui/text_button.js +80 -97
  159. package/dist/cjs/ui/theme/default_theme/button_variants.js +1 -5
  160. package/dist/cjs/ui/theme/default_theme/control_sizes.js +29 -42
  161. package/dist/cjs/ui/theme/default_theme/heading_styles.js +4 -5
  162. package/dist/cjs/ui/theme/default_theme/index.js +15 -32
  163. package/dist/cjs/ui/theme/default_theme/input_variants.js +1 -5
  164. package/dist/cjs/ui/theme/default_theme/link_variants.js +1 -5
  165. package/dist/cjs/ui/theme/default_theme/select_buttons_variants.js +1 -5
  166. package/dist/cjs/ui/theme/default_theme/select_variants.js +10 -21
  167. package/dist/cjs/ui/theme/default_theme/switch_variants.js +8 -20
  168. package/dist/cjs/ui/theme/default_theme/text_button_variants.js +1 -5
  169. package/dist/cjs/ui/theme/default_theme/text_styles.js +1 -2
  170. package/dist/cjs/ui/theme/default_theme/tokens.js +33 -35
  171. package/dist/cjs/ui/theme/theme_context.js +3 -6
  172. package/dist/cjs/ui/theme/use_theme.js +1 -7
  173. package/dist/cjs/ui/tooltip.js +38 -79
  174. package/dist/cjs/ui/types/aria_props.js +3 -7
  175. package/dist/cjs/ui/types/data_attributes_prop.js +8 -6
  176. package/dist/cjs/ui/types/tooltip_anchor_props.js +4 -5
  177. package/dist/cjs/ui/ui.js +97 -130
  178. package/dist/cjs/ui/unstable_standalone_ui.js +18 -42
  179. package/dist/cjs/ui/use_array_identity.js +0 -4
  180. package/dist/cjs/ui/use_base.js +4 -13
  181. package/dist/cjs/ui/use_color_scheme.js +60 -0
  182. package/dist/cjs/ui/use_cursor.js +3 -12
  183. package/dist/cjs/ui/use_form_field.js +4 -6
  184. package/dist/cjs/ui/use_global_config.js +3 -10
  185. package/dist/cjs/ui/use_loadable.js +59 -132
  186. package/dist/cjs/ui/use_record_action_data.js +6 -12
  187. package/dist/cjs/ui/use_records.js +27 -28
  188. package/dist/cjs/ui/use_session.js +6 -15
  189. package/dist/cjs/ui/use_settings_button.js +4 -11
  190. package/dist/cjs/ui/use_styled_system.js +12 -21
  191. package/dist/cjs/ui/use_synced.js +0 -7
  192. package/dist/cjs/ui/use_text_color_for_background_color.js +1 -5
  193. package/dist/cjs/ui/use_view_metadata.js +5 -8
  194. package/dist/cjs/ui/use_viewport.js +1 -7
  195. package/dist/cjs/ui/use_watchable.js +36 -74
  196. package/dist/cjs/ui/view_picker.js +44 -78
  197. package/dist/cjs/ui/view_picker_synced.js +33 -44
  198. package/dist/cjs/ui/viewport_constraint.js +37 -64
  199. package/dist/cjs/ui/with_hooks.js +17 -22
  200. package/dist/cjs/ui/with_styled_system.js +33 -60
  201. package/dist/cjs/undo_redo.js +12 -32
  202. package/dist/cjs/unstable_private_utils.js +6 -8
  203. package/dist/cjs/unstable_testing_utils.js +44 -57
  204. package/dist/cjs/viewport.js +127 -189
  205. package/dist/cjs/warning.js +5 -6
  206. package/dist/cjs/watchable.js +66 -148
  207. package/dist/types/src/colors.d.ts +1 -1
  208. package/dist/types/src/colors.d.ts.map +1 -1
  209. package/dist/types/src/global_config.d.ts +1 -1
  210. package/dist/types/src/global_config.d.ts.map +1 -1
  211. package/dist/types/src/models/base.d.ts +1 -1
  212. package/dist/types/src/models/base.d.ts.map +1 -1
  213. package/dist/types/src/models/cursor.d.ts +1 -1
  214. package/dist/types/src/models/cursor.d.ts.map +1 -1
  215. package/dist/types/src/models/field.d.ts +1 -1
  216. package/dist/types/src/models/field.d.ts.map +1 -1
  217. package/dist/types/src/models/linked_records_query_result.d.ts.map +1 -1
  218. package/dist/types/src/models/models.d.ts.map +1 -1
  219. package/dist/types/src/models/record.d.ts +1 -1
  220. package/dist/types/src/models/record.d.ts.map +1 -1
  221. package/dist/types/src/models/record_coloring.d.ts +2 -2
  222. package/dist/types/src/models/record_coloring.d.ts.map +1 -1
  223. package/dist/types/src/models/record_query_result.d.ts +3 -3
  224. package/dist/types/src/models/record_query_result.d.ts.map +1 -1
  225. package/dist/types/src/models/session.d.ts +1 -1
  226. package/dist/types/src/models/session.d.ts.map +1 -1
  227. package/dist/types/src/models/table.d.ts +1 -1
  228. package/dist/types/src/models/table.d.ts.map +1 -1
  229. package/dist/types/src/models/view.d.ts +1 -1
  230. package/dist/types/src/models/view.d.ts.map +1 -1
  231. package/dist/types/src/models/view_metadata_query_result.d.ts +2 -2
  232. package/dist/types/src/models/view_metadata_query_result.d.ts.map +1 -1
  233. package/dist/types/src/perform_record_action.d.ts +1 -1
  234. package/dist/types/src/perform_record_action.d.ts.map +1 -1
  235. package/dist/types/src/private_utils.d.ts +8 -8
  236. package/dist/types/src/private_utils.d.ts.map +1 -1
  237. package/dist/types/src/sdk.d.ts +1 -1
  238. package/dist/types/src/sdk.d.ts.map +1 -1
  239. package/dist/types/src/settings_button.d.ts +1 -1
  240. package/dist/types/src/settings_button.d.ts.map +1 -1
  241. package/dist/types/src/types/aggregators.d.ts +1 -1
  242. package/dist/types/src/types/aggregators.d.ts.map +1 -1
  243. package/dist/types/src/types/airtable_interface.d.ts +6 -6
  244. package/dist/types/src/types/airtable_interface.d.ts.map +1 -1
  245. package/dist/types/src/types/attachment.d.ts +1 -1
  246. package/dist/types/src/types/attachment.d.ts.map +1 -1
  247. package/dist/types/src/types/base.d.ts +1 -1
  248. package/dist/types/src/types/base.d.ts.map +1 -1
  249. package/dist/types/src/types/block.d.ts +1 -1
  250. package/dist/types/src/types/block.d.ts.map +1 -1
  251. package/dist/types/src/types/collaborator.d.ts +1 -1
  252. package/dist/types/src/types/collaborator.d.ts.map +1 -1
  253. package/dist/types/src/types/field.d.ts +5 -5
  254. package/dist/types/src/types/field.d.ts.map +1 -1
  255. package/dist/types/src/types/global_config.d.ts +6 -6
  256. package/dist/types/src/types/global_config.d.ts.map +1 -1
  257. package/dist/types/src/types/mutations.d.ts +4 -4
  258. package/dist/types/src/types/mutations.d.ts.map +1 -1
  259. package/dist/types/src/types/permission_levels.d.ts +1 -1
  260. package/dist/types/src/types/permission_levels.d.ts.map +1 -1
  261. package/dist/types/src/types/record.d.ts +2 -2
  262. package/dist/types/src/types/record.d.ts.map +1 -1
  263. package/dist/types/src/types/record_action_data.d.ts +1 -1
  264. package/dist/types/src/types/record_action_data.d.ts.map +1 -1
  265. package/dist/types/src/types/table.d.ts +3 -3
  266. package/dist/types/src/types/table.d.ts.map +1 -1
  267. package/dist/types/src/types/undo_redo.d.ts +1 -1
  268. package/dist/types/src/types/undo_redo.d.ts.map +1 -1
  269. package/dist/types/src/types/view.d.ts +4 -4
  270. package/dist/types/src/types/view.d.ts.map +1 -1
  271. package/dist/types/src/ui/base_provider.d.ts +1 -1
  272. package/dist/types/src/ui/base_provider.d.ts.map +1 -1
  273. package/dist/types/src/ui/block_wrapper.d.ts +2 -2
  274. package/dist/types/src/ui/button.d.ts +2 -2
  275. package/dist/types/src/ui/button.d.ts.map +1 -1
  276. package/dist/types/src/ui/cell_renderer.d.ts +2 -2
  277. package/dist/types/src/ui/choice_token.d.ts +4 -4
  278. package/dist/types/src/ui/choice_token.d.ts.map +1 -1
  279. package/dist/types/src/ui/collaborator_token.d.ts +6 -6
  280. package/dist/types/src/ui/collaborator_token.d.ts.map +1 -1
  281. package/dist/types/src/ui/color_palette.d.ts +3 -3
  282. package/dist/types/src/ui/color_palette.d.ts.map +1 -1
  283. package/dist/types/src/ui/color_palette_synced.d.ts +2 -2
  284. package/dist/types/src/ui/confirmation_dialog.d.ts +1 -1
  285. package/dist/types/src/ui/control_sizes.d.ts +2 -2
  286. package/dist/types/src/ui/control_sizes.d.ts.map +1 -1
  287. package/dist/types/src/ui/dialog.d.ts +2 -2
  288. package/dist/types/src/ui/dialog.d.ts.map +1 -1
  289. package/dist/types/src/ui/dialog_close_button.d.ts +1 -1
  290. package/dist/types/src/ui/field_icon.d.ts +3 -3
  291. package/dist/types/src/ui/field_icon.d.ts.map +1 -1
  292. package/dist/types/src/ui/field_picker.d.ts +2 -2
  293. package/dist/types/src/ui/field_picker.d.ts.map +1 -1
  294. package/dist/types/src/ui/form_field.d.ts +1 -1
  295. package/dist/types/src/ui/form_field.d.ts.map +1 -1
  296. package/dist/types/src/ui/global_alert.d.ts +1 -1
  297. package/dist/types/src/ui/global_alert.d.ts.map +1 -1
  298. package/dist/types/src/ui/global_config_synced_component_helpers.d.ts +1 -1
  299. package/dist/types/src/ui/global_config_synced_component_helpers.d.ts.map +1 -1
  300. package/dist/types/src/ui/heading.d.ts +4 -4
  301. package/dist/types/src/ui/heading.d.ts.map +1 -1
  302. package/dist/types/src/ui/icon.d.ts +2 -2
  303. package/dist/types/src/ui/icon.d.ts.map +1 -1
  304. package/dist/types/src/ui/icon_config.d.ts +39 -39
  305. package/dist/types/src/ui/icon_config.d.ts.map +1 -1
  306. package/dist/types/src/ui/initialize_block.d.ts +3 -3
  307. package/dist/types/src/ui/initialize_block.d.ts.map +1 -1
  308. package/dist/types/src/ui/input.d.ts +16 -16
  309. package/dist/types/src/ui/input.d.ts.map +1 -1
  310. package/dist/types/src/ui/label.d.ts +1 -1
  311. package/dist/types/src/ui/label.d.ts.map +1 -1
  312. package/dist/types/src/ui/link.d.ts +2 -2
  313. package/dist/types/src/ui/link.d.ts.map +1 -1
  314. package/dist/types/src/ui/loader.d.ts +2 -2
  315. package/dist/types/src/ui/loader.d.ts.map +1 -1
  316. package/dist/types/src/ui/model_picker_select.d.ts +1 -1
  317. package/dist/types/src/ui/model_picker_select.d.ts.map +1 -1
  318. package/dist/types/src/ui/popover.d.ts +5 -5
  319. package/dist/types/src/ui/popover.d.ts.map +1 -1
  320. package/dist/types/src/ui/progress_bar.d.ts +2 -2
  321. package/dist/types/src/ui/progress_bar.d.ts.map +1 -1
  322. package/dist/types/src/ui/record_card.d.ts +3 -3
  323. package/dist/types/src/ui/record_card.d.ts.map +1 -1
  324. package/dist/types/src/ui/record_card_list.d.ts +3 -3
  325. package/dist/types/src/ui/record_card_list.d.ts.map +1 -1
  326. package/dist/types/src/ui/select.d.ts +4 -4
  327. package/dist/types/src/ui/select_and_select_buttons_helpers.d.ts +4 -4
  328. package/dist/types/src/ui/select_and_select_buttons_helpers.d.ts.map +1 -1
  329. package/dist/types/src/ui/select_buttons.d.ts +5 -5
  330. package/dist/types/src/ui/select_buttons.d.ts.map +1 -1
  331. package/dist/types/src/ui/switch.d.ts +2 -2
  332. package/dist/types/src/ui/switch.d.ts.map +1 -1
  333. package/dist/types/src/ui/synced.d.ts +3 -3
  334. package/dist/types/src/ui/system/all_styles_set.d.ts +0 -1
  335. package/dist/types/src/ui/system/all_styles_set.d.ts.map +1 -1
  336. package/dist/types/src/ui/system/appearance/appearance_set.d.ts +0 -1
  337. package/dist/types/src/ui/system/appearance/appearance_set.d.ts.map +1 -1
  338. package/dist/types/src/ui/system/appearance/background_color.d.ts +0 -1
  339. package/dist/types/src/ui/system/appearance/background_color.d.ts.map +1 -1
  340. package/dist/types/src/ui/system/appearance/border.d.ts +0 -1
  341. package/dist/types/src/ui/system/appearance/border.d.ts.map +1 -1
  342. package/dist/types/src/ui/system/appearance/border_radius.d.ts +0 -1
  343. package/dist/types/src/ui/system/appearance/border_radius.d.ts.map +1 -1
  344. package/dist/types/src/ui/system/appearance/box_shadow.d.ts +0 -1
  345. package/dist/types/src/ui/system/appearance/box_shadow.d.ts.map +1 -1
  346. package/dist/types/src/ui/system/appearance/opacity.d.ts +0 -1
  347. package/dist/types/src/ui/system/appearance/opacity.d.ts.map +1 -1
  348. package/dist/types/src/ui/system/dimensions/dimensions_set.d.ts +0 -1
  349. package/dist/types/src/ui/system/dimensions/dimensions_set.d.ts.map +1 -1
  350. package/dist/types/src/ui/system/dimensions/height.d.ts +0 -1
  351. package/dist/types/src/ui/system/dimensions/height.d.ts.map +1 -1
  352. package/dist/types/src/ui/system/dimensions/max_height.d.ts +0 -1
  353. package/dist/types/src/ui/system/dimensions/max_height.d.ts.map +1 -1
  354. package/dist/types/src/ui/system/dimensions/max_width.d.ts +0 -1
  355. package/dist/types/src/ui/system/dimensions/max_width.d.ts.map +1 -1
  356. package/dist/types/src/ui/system/dimensions/min_height.d.ts +0 -1
  357. package/dist/types/src/ui/system/dimensions/min_height.d.ts.map +1 -1
  358. package/dist/types/src/ui/system/dimensions/min_width.d.ts +0 -1
  359. package/dist/types/src/ui/system/dimensions/min_width.d.ts.map +1 -1
  360. package/dist/types/src/ui/system/dimensions/width.d.ts +0 -1
  361. package/dist/types/src/ui/system/dimensions/width.d.ts.map +1 -1
  362. package/dist/types/src/ui/system/display.d.ts +0 -1
  363. package/dist/types/src/ui/system/display.d.ts.map +1 -1
  364. package/dist/types/src/ui/system/flex_container/align_content.d.ts +0 -1
  365. package/dist/types/src/ui/system/flex_container/align_content.d.ts.map +1 -1
  366. package/dist/types/src/ui/system/flex_container/align_items.d.ts +0 -1
  367. package/dist/types/src/ui/system/flex_container/align_items.d.ts.map +1 -1
  368. package/dist/types/src/ui/system/flex_container/flex_container_set.d.ts +0 -1
  369. package/dist/types/src/ui/system/flex_container/flex_container_set.d.ts.map +1 -1
  370. package/dist/types/src/ui/system/flex_container/flex_direction.d.ts +0 -1
  371. package/dist/types/src/ui/system/flex_container/flex_direction.d.ts.map +1 -1
  372. package/dist/types/src/ui/system/flex_container/flex_wrap.d.ts +0 -1
  373. package/dist/types/src/ui/system/flex_container/flex_wrap.d.ts.map +1 -1
  374. package/dist/types/src/ui/system/flex_container/justify_content.d.ts +0 -1
  375. package/dist/types/src/ui/system/flex_container/justify_content.d.ts.map +1 -1
  376. package/dist/types/src/ui/system/flex_container/justify_items.d.ts +0 -1
  377. package/dist/types/src/ui/system/flex_container/justify_items.d.ts.map +1 -1
  378. package/dist/types/src/ui/system/flex_item/align_self.d.ts +0 -1
  379. package/dist/types/src/ui/system/flex_item/align_self.d.ts.map +1 -1
  380. package/dist/types/src/ui/system/flex_item/flex.d.ts +0 -1
  381. package/dist/types/src/ui/system/flex_item/flex.d.ts.map +1 -1
  382. package/dist/types/src/ui/system/flex_item/flex_basis.d.ts +0 -1
  383. package/dist/types/src/ui/system/flex_item/flex_basis.d.ts.map +1 -1
  384. package/dist/types/src/ui/system/flex_item/flex_grow.d.ts +0 -1
  385. package/dist/types/src/ui/system/flex_item/flex_grow.d.ts.map +1 -1
  386. package/dist/types/src/ui/system/flex_item/flex_item_set.d.ts +0 -1
  387. package/dist/types/src/ui/system/flex_item/flex_item_set.d.ts.map +1 -1
  388. package/dist/types/src/ui/system/flex_item/flex_shrink.d.ts +0 -1
  389. package/dist/types/src/ui/system/flex_item/flex_shrink.d.ts.map +1 -1
  390. package/dist/types/src/ui/system/flex_item/justify_self.d.ts +0 -1
  391. package/dist/types/src/ui/system/flex_item/justify_self.d.ts.map +1 -1
  392. package/dist/types/src/ui/system/flex_item/order.d.ts +0 -1
  393. package/dist/types/src/ui/system/flex_item/order.d.ts.map +1 -1
  394. package/dist/types/src/ui/system/overflow.d.ts +0 -1
  395. package/dist/types/src/ui/system/overflow.d.ts.map +1 -1
  396. package/dist/types/src/ui/system/position/bottom.d.ts +0 -1
  397. package/dist/types/src/ui/system/position/bottom.d.ts.map +1 -1
  398. package/dist/types/src/ui/system/position/left.d.ts +0 -1
  399. package/dist/types/src/ui/system/position/left.d.ts.map +1 -1
  400. package/dist/types/src/ui/system/position/position.d.ts +0 -1
  401. package/dist/types/src/ui/system/position/position.d.ts.map +1 -1
  402. package/dist/types/src/ui/system/position/position_set.d.ts +0 -1
  403. package/dist/types/src/ui/system/position/position_set.d.ts.map +1 -1
  404. package/dist/types/src/ui/system/position/right.d.ts +0 -1
  405. package/dist/types/src/ui/system/position/right.d.ts.map +1 -1
  406. package/dist/types/src/ui/system/position/top.d.ts +0 -1
  407. package/dist/types/src/ui/system/position/top.d.ts.map +1 -1
  408. package/dist/types/src/ui/system/position/z_index.d.ts +0 -1
  409. package/dist/types/src/ui/system/position/z_index.d.ts.map +1 -1
  410. package/dist/types/src/ui/system/spacing/margin.d.ts +0 -1
  411. package/dist/types/src/ui/system/spacing/margin.d.ts.map +1 -1
  412. package/dist/types/src/ui/system/spacing/padding.d.ts +0 -1
  413. package/dist/types/src/ui/system/spacing/padding.d.ts.map +1 -1
  414. package/dist/types/src/ui/system/spacing/spacing_set.d.ts +0 -1
  415. package/dist/types/src/ui/system/spacing/spacing_set.d.ts.map +1 -1
  416. package/dist/types/src/ui/system/typography/font_family.d.ts +0 -1
  417. package/dist/types/src/ui/system/typography/font_family.d.ts.map +1 -1
  418. package/dist/types/src/ui/system/typography/font_size.d.ts +0 -1
  419. package/dist/types/src/ui/system/typography/font_size.d.ts.map +1 -1
  420. package/dist/types/src/ui/system/typography/font_style.d.ts +0 -1
  421. package/dist/types/src/ui/system/typography/font_style.d.ts.map +1 -1
  422. package/dist/types/src/ui/system/typography/font_weight.d.ts +0 -1
  423. package/dist/types/src/ui/system/typography/font_weight.d.ts.map +1 -1
  424. package/dist/types/src/ui/system/typography/letter_spacing.d.ts +0 -1
  425. package/dist/types/src/ui/system/typography/letter_spacing.d.ts.map +1 -1
  426. package/dist/types/src/ui/system/typography/line_height.d.ts +0 -1
  427. package/dist/types/src/ui/system/typography/line_height.d.ts.map +1 -1
  428. package/dist/types/src/ui/system/typography/text_align.d.ts +0 -1
  429. package/dist/types/src/ui/system/typography/text_align.d.ts.map +1 -1
  430. package/dist/types/src/ui/system/typography/text_color.d.ts +0 -1
  431. package/dist/types/src/ui/system/typography/text_color.d.ts.map +1 -1
  432. package/dist/types/src/ui/system/typography/text_decoration.d.ts +0 -1
  433. package/dist/types/src/ui/system/typography/text_decoration.d.ts.map +1 -1
  434. package/dist/types/src/ui/system/typography/text_transform.d.ts +0 -1
  435. package/dist/types/src/ui/system/typography/text_transform.d.ts.map +1 -1
  436. package/dist/types/src/ui/system/typography/typography_set.d.ts +0 -1
  437. package/dist/types/src/ui/system/typography/typography_set.d.ts.map +1 -1
  438. package/dist/types/src/ui/system/utils/create_style_prop_types.d.ts +1 -1
  439. package/dist/types/src/ui/system/utils/create_style_prop_types.d.ts.map +1 -1
  440. package/dist/types/src/ui/system/utils/csstype.d.ts +578 -578
  441. package/dist/types/src/ui/system/utils/csstype.d.ts.map +1 -1
  442. package/dist/types/src/ui/system/utils/types.d.ts +4 -4
  443. package/dist/types/src/ui/system/utils/types.d.ts.map +1 -1
  444. package/dist/types/src/ui/table_picker.d.ts +1 -1
  445. package/dist/types/src/ui/table_picker.d.ts.map +1 -1
  446. package/dist/types/src/ui/text.d.ts +4 -4
  447. package/dist/types/src/ui/text.d.ts.map +1 -1
  448. package/dist/types/src/ui/text_button.d.ts +2 -2
  449. package/dist/types/src/ui/text_button.d.ts.map +1 -1
  450. package/dist/types/src/ui/theme/default_theme/heading_styles.d.ts +2 -2
  451. package/dist/types/src/ui/theme/default_theme/heading_styles.d.ts.map +1 -1
  452. package/dist/types/src/ui/theme/default_theme/index.d.ts +1 -1
  453. package/dist/types/src/ui/theme/theme_context.d.ts +1 -3
  454. package/dist/types/src/ui/theme/theme_context.d.ts.map +1 -1
  455. package/dist/types/src/ui/theme/use_theme.d.ts +1 -1
  456. package/dist/types/src/ui/tooltip.d.ts +3 -3
  457. package/dist/types/src/ui/types/data_attributes_prop.d.ts.map +1 -1
  458. package/dist/types/src/ui/types/tooltip_anchor_props.d.ts +0 -1
  459. package/dist/types/src/ui/types/tooltip_anchor_props.d.ts.map +1 -1
  460. package/dist/types/src/ui/ui.d.ts +1 -0
  461. package/dist/types/src/ui/ui.d.ts.map +1 -1
  462. package/dist/types/src/ui/use_base.d.ts.map +1 -1
  463. package/dist/types/src/ui/use_color_scheme.d.ts +28 -0
  464. package/dist/types/src/ui/use_color_scheme.d.ts.map +1 -0
  465. package/dist/types/src/ui/use_cursor.d.ts.map +1 -1
  466. package/dist/types/src/ui/use_form_field.d.ts +0 -2
  467. package/dist/types/src/ui/use_form_field.d.ts.map +1 -1
  468. package/dist/types/src/ui/use_records.d.ts +2 -2
  469. package/dist/types/src/ui/use_records.d.ts.map +1 -1
  470. package/dist/types/src/ui/use_session.d.ts.map +1 -1
  471. package/dist/types/src/ui/view_picker.d.ts +3 -3
  472. package/dist/types/src/ui/view_picker.d.ts.map +1 -1
  473. package/dist/types/src/ui/viewport_constraint.d.ts +3 -3
  474. package/dist/types/src/ui/viewport_constraint.d.ts.map +1 -1
  475. package/dist/types/src/viewport.d.ts +2 -2
  476. package/dist/types/src/viewport.d.ts.map +1 -1
  477. package/dist/types/src/warning.d.ts +1 -1
  478. package/dist/types/src/warning.d.ts.map +1 -1
  479. package/package.json +40 -34
  480. package/dist/types/stories/all_controls.stories.d.ts +0 -2
  481. package/dist/types/stories/all_controls.stories.d.ts.map +0 -1
  482. package/dist/types/stories/box.appearance.stories.d.ts +0 -2
  483. package/dist/types/stories/box.appearance.stories.d.ts.map +0 -1
  484. package/dist/types/stories/box.dimensions.stories.d.ts +0 -2
  485. package/dist/types/stories/box.dimensions.stories.d.ts.map +0 -1
  486. package/dist/types/stories/box.flex_container.stories.d.ts +0 -2
  487. package/dist/types/stories/box.flex_container.stories.d.ts.map +0 -1
  488. package/dist/types/stories/box.flex_item.stories.d.ts +0 -2
  489. package/dist/types/stories/box.flex_item.stories.d.ts.map +0 -1
  490. package/dist/types/stories/box.position.stories.d.ts +0 -2
  491. package/dist/types/stories/box.position.stories.d.ts.map +0 -1
  492. package/dist/types/stories/box.spacing.stories.d.ts +0 -2
  493. package/dist/types/stories/box.spacing.stories.d.ts.map +0 -1
  494. package/dist/types/stories/box.stories.d.ts +0 -2
  495. package/dist/types/stories/box.stories.d.ts.map +0 -1
  496. package/dist/types/stories/box.typography.stories.d.ts +0 -2
  497. package/dist/types/stories/box.typography.stories.d.ts.map +0 -1
  498. package/dist/types/stories/button.stories.d.ts +0 -2
  499. package/dist/types/stories/button.stories.d.ts.map +0 -1
  500. package/dist/types/stories/cell_renderer.stories.d.ts +0 -2
  501. package/dist/types/stories/cell_renderer.stories.d.ts.map +0 -1
  502. package/dist/types/stories/choice_token.stories.d.ts +0 -2
  503. package/dist/types/stories/choice_token.stories.d.ts.map +0 -1
  504. package/dist/types/stories/collaborator_token.stories.d.ts +0 -2
  505. package/dist/types/stories/collaborator_token.stories.d.ts.map +0 -1
  506. package/dist/types/stories/color_palette.stories.d.ts +0 -2
  507. package/dist/types/stories/color_palette.stories.d.ts.map +0 -1
  508. package/dist/types/stories/confirmation_dialog.stories.d.ts +0 -2
  509. package/dist/types/stories/confirmation_dialog.stories.d.ts.map +0 -1
  510. package/dist/types/stories/dialog.stories.d.ts +0 -2
  511. package/dist/types/stories/dialog.stories.d.ts.map +0 -1
  512. package/dist/types/stories/field_icon.stories.d.ts +0 -2
  513. package/dist/types/stories/field_icon.stories.d.ts.map +0 -1
  514. package/dist/types/stories/form_field.stories.d.ts +0 -2
  515. package/dist/types/stories/form_field.stories.d.ts.map +0 -1
  516. package/dist/types/stories/heading.size.stories.d.ts +0 -2
  517. package/dist/types/stories/heading.size.stories.d.ts.map +0 -1
  518. package/dist/types/stories/heading.stories.d.ts +0 -2
  519. package/dist/types/stories/heading.stories.d.ts.map +0 -1
  520. package/dist/types/stories/helpers/attachments.d.ts +0 -4
  521. package/dist/types/stories/helpers/attachments.d.ts.map +0 -1
  522. package/dist/types/stories/helpers/categorize_style_props.d.ts +0 -14
  523. package/dist/types/stories/helpers/categorize_style_props.d.ts.map +0 -1
  524. package/dist/types/stories/helpers/choice_options.d.ts +0 -7
  525. package/dist/types/stories/helpers/choice_options.d.ts.map +0 -1
  526. package/dist/types/stories/helpers/code_block.d.ts +0 -5
  527. package/dist/types/stories/helpers/code_block.d.ts.map +0 -1
  528. package/dist/types/stories/helpers/code_utils.d.ts +0 -32
  529. package/dist/types/stories/helpers/code_utils.d.ts.map +0 -1
  530. package/dist/types/stories/helpers/collaborator_options.d.ts +0 -7
  531. package/dist/types/stories/helpers/collaborator_options.d.ts.map +0 -1
  532. package/dist/types/stories/helpers/example.d.ts +0 -39
  533. package/dist/types/stories/helpers/example.d.ts.map +0 -1
  534. package/dist/types/stories/helpers/example_code_panel.d.ts +0 -10
  535. package/dist/types/stories/helpers/example_code_panel.d.ts.map +0 -1
  536. package/dist/types/stories/helpers/fake_cell_renderer.d.ts +0 -7
  537. package/dist/types/stories/helpers/fake_cell_renderer.d.ts.map +0 -1
  538. package/dist/types/stories/helpers/fake_foreign_record.d.ts +0 -5
  539. package/dist/types/stories/helpers/fake_foreign_record.d.ts.map +0 -1
  540. package/dist/types/stories/helpers/fake_record_card.d.ts +0 -13
  541. package/dist/types/stories/helpers/fake_record_card.d.ts.map +0 -1
  542. package/dist/types/stories/helpers/field_type.d.ts +0 -6
  543. package/dist/types/stories/helpers/field_type.d.ts.map +0 -1
  544. package/dist/types/stories/helpers/raf_throttle.d.ts +0 -5
  545. package/dist/types/stories/helpers/raf_throttle.d.ts.map +0 -1
  546. package/dist/types/stories/helpers/style_prop_list.d.ts +0 -9
  547. package/dist/types/stories/helpers/style_prop_list.d.ts.map +0 -1
  548. package/dist/types/stories/helpers/sync_source_options.d.ts +0 -7
  549. package/dist/types/stories/helpers/sync_source_options.d.ts.map +0 -1
  550. package/dist/types/stories/helpers/use_resizable_panel.d.ts +0 -27
  551. package/dist/types/stories/helpers/use_resizable_panel.d.ts.map +0 -1
  552. package/dist/types/stories/icon.stories.d.ts +0 -2
  553. package/dist/types/stories/icon.stories.d.ts.map +0 -1
  554. package/dist/types/stories/icon_example.d.ts +0 -3
  555. package/dist/types/stories/icon_example.d.ts.map +0 -1
  556. package/dist/types/stories/input.stories.d.ts +0 -2
  557. package/dist/types/stories/input.stories.d.ts.map +0 -1
  558. package/dist/types/stories/label.stories.d.ts +0 -2
  559. package/dist/types/stories/label.stories.d.ts.map +0 -1
  560. package/dist/types/stories/link.stories.d.ts +0 -2
  561. package/dist/types/stories/link.stories.d.ts.map +0 -1
  562. package/dist/types/stories/loader.stories.d.ts +0 -2
  563. package/dist/types/stories/loader.stories.d.ts.map +0 -1
  564. package/dist/types/stories/model_pickers.stories.d.ts +0 -2
  565. package/dist/types/stories/model_pickers.stories.d.ts.map +0 -1
  566. package/dist/types/stories/progress_bar.stories.d.ts +0 -2
  567. package/dist/types/stories/progress_bar.stories.d.ts.map +0 -1
  568. package/dist/types/stories/record_card.stories.d.ts +0 -2
  569. package/dist/types/stories/record_card.stories.d.ts.map +0 -1
  570. package/dist/types/stories/record_card_list.stories.d.ts +0 -2
  571. package/dist/types/stories/record_card_list.stories.d.ts.map +0 -1
  572. package/dist/types/stories/select.stories.d.ts +0 -2
  573. package/dist/types/stories/select.stories.d.ts.map +0 -1
  574. package/dist/types/stories/select_buttons.stories.d.ts +0 -2
  575. package/dist/types/stories/select_buttons.stories.d.ts.map +0 -1
  576. package/dist/types/stories/switch.stories.d.ts +0 -2
  577. package/dist/types/stories/switch.stories.d.ts.map +0 -1
  578. package/dist/types/stories/text.size.stories.d.ts +0 -2
  579. package/dist/types/stories/text.size.stories.d.ts.map +0 -1
  580. package/dist/types/stories/text.stories.d.ts +0 -2
  581. package/dist/types/stories/text.stories.d.ts.map +0 -1
  582. package/dist/types/stories/text_button.stories.d.ts +0 -2
  583. package/dist/types/stories/text_button.stories.d.ts.map +0 -1
  584. package/dist/types/stories/tooltip.stories.d.ts +0 -2
  585. package/dist/types/stories/tooltip.stories.d.ts.map +0 -1
  586. package/dist/types/test/airtable_interface_mocks/fixture_data.d.ts +0 -124
  587. package/dist/types/test/airtable_interface_mocks/fixture_data.d.ts.map +0 -1
  588. package/dist/types/test/airtable_interface_mocks/linked_records.d.ts +0 -4
  589. package/dist/types/test/airtable_interface_mocks/linked_records.d.ts.map +0 -1
  590. package/dist/types/test/airtable_interface_mocks/mock_airtable_interface.d.ts +0 -61
  591. package/dist/types/test/airtable_interface_mocks/mock_airtable_interface.d.ts.map +0 -1
  592. package/dist/types/test/airtable_interface_mocks/project_tracker.d.ts +0 -4
  593. package/dist/types/test/airtable_interface_mocks/project_tracker.d.ts.map +0 -1
  594. package/dist/types/test/error_utils.test.d.ts +0 -2
  595. package/dist/types/test/error_utils.test.d.ts.map +0 -1
  596. package/dist/types/test/get_style_props_for_responsive_prop.test.d.ts +0 -2
  597. package/dist/types/test/get_style_props_for_responsive_prop.test.d.ts.map +0 -1
  598. package/dist/types/test/index.test.d.ts +0 -2
  599. package/dist/types/test/index.test.d.ts.map +0 -1
  600. package/dist/types/test/models/base.test.d.ts +0 -2
  601. package/dist/types/test/models/base.test.d.ts.map +0 -1
  602. package/dist/types/test/models/cursor.test.d.ts +0 -2
  603. package/dist/types/test/models/cursor.test.d.ts.map +0 -1
  604. package/dist/types/test/models/field.test.d.ts +0 -2
  605. package/dist/types/test/models/field.test.d.ts.map +0 -1
  606. package/dist/types/test/models/linked_records_query_result.test.d.ts +0 -2
  607. package/dist/types/test/models/linked_records_query_result.test.d.ts.map +0 -1
  608. package/dist/types/test/models/mutations.test.d.ts +0 -2
  609. package/dist/types/test/models/mutations.test.d.ts.map +0 -1
  610. package/dist/types/test/models/object_pool.test.d.ts +0 -2
  611. package/dist/types/test/models/object_pool.test.d.ts.map +0 -1
  612. package/dist/types/test/models/record.test.d.ts +0 -2
  613. package/dist/types/test/models/record.test.d.ts.map +0 -1
  614. package/dist/types/test/models/session.test.d.ts +0 -2
  615. package/dist/types/test/models/session.test.d.ts.map +0 -1
  616. package/dist/types/test/models/table.test.d.ts +0 -2
  617. package/dist/types/test/models/table.test.d.ts.map +0 -1
  618. package/dist/types/test/models/table_mutations.test.d.ts +0 -2
  619. package/dist/types/test/models/table_mutations.test.d.ts.map +0 -1
  620. package/dist/types/test/models/table_or_view_query_result.test.d.ts +0 -2
  621. package/dist/types/test/models/table_or_view_query_result.test.d.ts.map +0 -1
  622. package/dist/types/test/models/view.test.d.ts +0 -2
  623. package/dist/types/test/models/view.test.d.ts.map +0 -1
  624. package/dist/types/test/models/view_metadata_query_result.test.d.ts +0 -2
  625. package/dist/types/test/models/view_metadata_query_result.test.d.ts.map +0 -1
  626. package/dist/types/test/private_utils.test.d.ts +0 -2
  627. package/dist/types/test/private_utils.test.d.ts.map +0 -1
  628. package/dist/types/test/sdk.test.d.ts +0 -2
  629. package/dist/types/test/sdk.test.d.ts.map +0 -1
  630. package/dist/types/test/setup_enzyme.d.ts +0 -2
  631. package/dist/types/test/setup_enzyme.d.ts.map +0 -1
  632. package/dist/types/test/test_helpers.d.ts +0 -11
  633. package/dist/types/test/test_helpers.d.ts.map +0 -1
  634. package/dist/types/test/ui/base_provider.test.d.ts +0 -2
  635. package/dist/types/test/ui/base_provider.test.d.ts.map +0 -1
  636. package/dist/types/test/ui/block_wrapper.test.d.ts +0 -2
  637. package/dist/types/test/ui/block_wrapper.test.d.ts.map +0 -1
  638. package/dist/types/test/ui/box.test.d.ts +0 -2
  639. package/dist/types/test/ui/box.test.d.ts.map +0 -1
  640. package/dist/types/test/ui/button.test.d.ts +0 -2
  641. package/dist/types/test/ui/button.test.d.ts.map +0 -1
  642. package/dist/types/test/ui/cell_renderer.test.d.ts +0 -2
  643. package/dist/types/test/ui/cell_renderer.test.d.ts.map +0 -1
  644. package/dist/types/test/ui/choice_token.test.d.ts +0 -2
  645. package/dist/types/test/ui/choice_token.test.d.ts.map +0 -1
  646. package/dist/types/test/ui/collaborator_token.test.d.ts +0 -2
  647. package/dist/types/test/ui/collaborator_token.test.d.ts.map +0 -1
  648. package/dist/types/test/ui/color_palette.test.d.ts +0 -2
  649. package/dist/types/test/ui/color_palette.test.d.ts.map +0 -1
  650. package/dist/types/test/ui/color_palette_synced.test.d.ts +0 -2
  651. package/dist/types/test/ui/color_palette_synced.test.d.ts.map +0 -1
  652. package/dist/types/test/ui/confirmation_dialog.test.d.ts +0 -2
  653. package/dist/types/test/ui/confirmation_dialog.test.d.ts.map +0 -1
  654. package/dist/types/test/ui/dialog.test.d.ts +0 -2
  655. package/dist/types/test/ui/dialog.test.d.ts.map +0 -1
  656. package/dist/types/test/ui/expand_record.test.d.ts +0 -2
  657. package/dist/types/test/ui/expand_record.test.d.ts.map +0 -1
  658. package/dist/types/test/ui/expand_record_list.test.d.ts +0 -2
  659. package/dist/types/test/ui/expand_record_list.test.d.ts.map +0 -1
  660. package/dist/types/test/ui/expand_record_picker_async.test.d.ts +0 -2
  661. package/dist/types/test/ui/expand_record_picker_async.test.d.ts.map +0 -1
  662. package/dist/types/test/ui/field_icon.test.d.ts +0 -2
  663. package/dist/types/test/ui/field_icon.test.d.ts.map +0 -1
  664. package/dist/types/test/ui/field_picker.test.d.ts +0 -2
  665. package/dist/types/test/ui/field_picker.test.d.ts.map +0 -1
  666. package/dist/types/test/ui/field_picker_synced.test.d.ts +0 -2
  667. package/dist/types/test/ui/field_picker_synced.test.d.ts.map +0 -1
  668. package/dist/types/test/ui/form_field.test.d.ts +0 -2
  669. package/dist/types/test/ui/form_field.test.d.ts.map +0 -1
  670. package/dist/types/test/ui/global_alert.test.d.ts +0 -2
  671. package/dist/types/test/ui/global_alert.test.d.ts.map +0 -1
  672. package/dist/types/test/ui/heading.test.d.ts +0 -2
  673. package/dist/types/test/ui/heading.test.d.ts.map +0 -1
  674. package/dist/types/test/ui/icon.test.d.ts +0 -2
  675. package/dist/types/test/ui/icon.test.d.ts.map +0 -1
  676. package/dist/types/test/ui/initialize_block.test.d.ts +0 -2
  677. package/dist/types/test/ui/initialize_block.test.d.ts.map +0 -1
  678. package/dist/types/test/ui/input.test.d.ts +0 -2
  679. package/dist/types/test/ui/input.test.d.ts.map +0 -1
  680. package/dist/types/test/ui/input_synced.test.d.ts +0 -2
  681. package/dist/types/test/ui/input_synced.test.d.ts.map +0 -1
  682. package/dist/types/test/ui/label.test.d.ts +0 -2
  683. package/dist/types/test/ui/label.test.d.ts.map +0 -1
  684. package/dist/types/test/ui/link.test.d.ts +0 -2
  685. package/dist/types/test/ui/link.test.d.ts.map +0 -1
  686. package/dist/types/test/ui/loader.test.d.ts +0 -2
  687. package/dist/types/test/ui/loader.test.d.ts.map +0 -1
  688. package/dist/types/test/ui/modal.test.d.ts +0 -2
  689. package/dist/types/test/ui/modal.test.d.ts.map +0 -1
  690. package/dist/types/test/ui/popover.test.d.ts +0 -2
  691. package/dist/types/test/ui/popover.test.d.ts.map +0 -1
  692. package/dist/types/test/ui/progress_bar.test.d.ts +0 -2
  693. package/dist/types/test/ui/progress_bar.test.d.ts.map +0 -1
  694. package/dist/types/test/ui/record_card.test.d.ts +0 -2
  695. package/dist/types/test/ui/record_card.test.d.ts.map +0 -1
  696. package/dist/types/test/ui/record_card_list.test.d.ts +0 -2
  697. package/dist/types/test/ui/record_card_list.test.d.ts.map +0 -1
  698. package/dist/types/test/ui/remote_utils.test.d.ts +0 -2
  699. package/dist/types/test/ui/remote_utils.test.d.ts.map +0 -1
  700. package/dist/types/test/ui/select.test.d.ts +0 -2
  701. package/dist/types/test/ui/select.test.d.ts.map +0 -1
  702. package/dist/types/test/ui/select_buttons.test.d.ts +0 -2
  703. package/dist/types/test/ui/select_buttons.test.d.ts.map +0 -1
  704. package/dist/types/test/ui/select_buttons_synced.test.d.ts +0 -2
  705. package/dist/types/test/ui/select_buttons_synced.test.d.ts.map +0 -1
  706. package/dist/types/test/ui/select_synced.test.d.ts +0 -2
  707. package/dist/types/test/ui/select_synced.test.d.ts.map +0 -1
  708. package/dist/types/test/ui/switch.test.d.ts +0 -2
  709. package/dist/types/test/ui/switch.test.d.ts.map +0 -1
  710. package/dist/types/test/ui/switch_synced.test.d.ts +0 -2
  711. package/dist/types/test/ui/switch_synced.test.d.ts.map +0 -1
  712. package/dist/types/test/ui/synced.test.d.ts +0 -2
  713. package/dist/types/test/ui/synced.test.d.ts.map +0 -1
  714. package/dist/types/test/ui/table_picker.test.d.ts +0 -2
  715. package/dist/types/test/ui/table_picker.test.d.ts.map +0 -1
  716. package/dist/types/test/ui/table_picker_synced.test.d.ts +0 -2
  717. package/dist/types/test/ui/table_picker_synced.test.d.ts.map +0 -1
  718. package/dist/types/test/ui/text.test.d.ts +0 -2
  719. package/dist/types/test/ui/text.test.d.ts.map +0 -1
  720. package/dist/types/test/ui/text_button.test.d.ts +0 -2
  721. package/dist/types/test/ui/text_button.test.d.ts.map +0 -1
  722. package/dist/types/test/ui/tooltip.test.d.ts +0 -2
  723. package/dist/types/test/ui/tooltip.test.d.ts.map +0 -1
  724. package/dist/types/test/ui/ui.test.d.ts +0 -2
  725. package/dist/types/test/ui/ui.test.d.ts.map +0 -1
  726. package/dist/types/test/ui/unstable_standalone_ui.test.d.ts +0 -1
  727. package/dist/types/test/ui/unstable_standalone_ui.test.d.ts.map +0 -1
  728. package/dist/types/test/ui/use_array_identity.test.d.ts +0 -2
  729. package/dist/types/test/ui/use_array_identity.test.d.ts.map +0 -1
  730. package/dist/types/test/ui/use_loadable.test.d.ts +0 -2
  731. package/dist/types/test/ui/use_loadable.test.d.ts.map +0 -1
  732. package/dist/types/test/ui/use_record_action_data.test.d.ts +0 -2
  733. package/dist/types/test/ui/use_record_action_data.test.d.ts.map +0 -1
  734. package/dist/types/test/ui/use_records.test.d.ts +0 -2
  735. package/dist/types/test/ui/use_records.test.d.ts.map +0 -1
  736. package/dist/types/test/ui/use_view_metadata.test.d.ts +0 -2
  737. package/dist/types/test/ui/use_view_metadata.test.d.ts.map +0 -1
  738. package/dist/types/test/ui/use_watchable.test.d.ts +0 -2
  739. package/dist/types/test/ui/use_watchable.test.d.ts.map +0 -1
  740. package/dist/types/test/ui/view_picker.test.d.ts +0 -2
  741. package/dist/types/test/ui/view_picker.test.d.ts.map +0 -1
  742. package/dist/types/test/ui/view_picker_synced.test.d.ts +0 -2
  743. package/dist/types/test/ui/view_picker_synced.test.d.ts.map +0 -1
  744. package/dist/types/test/ui/viewport_constraint.test.d.ts +0 -2
  745. package/dist/types/test/ui/viewport_constraint.test.d.ts.map +0 -1
  746. package/dist/types/test/unstable_private_utils.test.d.ts +0 -1
  747. package/dist/types/test/unstable_private_utils.test.d.ts.map +0 -1
@@ -1,82 +1,56 @@
1
1
  "use strict";
2
2
 
3
- var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard");
4
-
3
+ require("core-js/modules/es.symbol.js");
4
+ require("core-js/modules/es.symbol.description.js");
5
+ require("core-js/modules/es.array.from.js");
6
+ require("core-js/modules/es.array.slice.js");
7
+ require("core-js/modules/es.object.get-own-property-descriptors.js");
8
+ require("core-js/modules/es.regexp.exec.js");
9
+ require("core-js/modules/es.regexp.to-string.js");
10
+ require("core-js/modules/es.weak-map.js");
11
+ require("core-js/modules/web.dom-collections.for-each.js");
5
12
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
6
-
7
- require("core-js/modules/es.symbol");
8
-
9
- require("core-js/modules/es.symbol.description");
10
-
11
- require("core-js/modules/es.array.concat");
12
-
13
- require("core-js/modules/es.array.filter");
14
-
15
- require("core-js/modules/es.array.iterator");
16
-
17
- require("core-js/modules/es.array.map");
18
-
19
- require("core-js/modules/es.object.get-own-property-descriptors");
20
-
21
- require("core-js/modules/es.object.to-string");
22
-
23
- require("core-js/modules/es.promise");
24
-
25
- require("core-js/modules/es.set");
26
-
27
- require("core-js/modules/es.string.starts-with");
28
-
29
- require("core-js/modules/web.dom-collections.for-each");
30
-
31
- require("core-js/modules/web.dom-collections.iterator");
32
-
33
13
  Object.defineProperty(exports, "__esModule", {
34
14
  value: true
35
15
  });
36
16
  exports.default = void 0;
37
-
38
17
  var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
39
-
40
- require("regenerator-runtime/runtime");
41
-
18
+ require("core-js/modules/es.array.concat.js");
19
+ require("core-js/modules/es.array.filter.js");
20
+ require("core-js/modules/es.array.iterator.js");
21
+ require("core-js/modules/es.array.map.js");
22
+ require("core-js/modules/es.object.to-string.js");
23
+ require("core-js/modules/es.promise.js");
24
+ require("core-js/modules/es.set.js");
25
+ require("core-js/modules/es.string.starts-with.js");
26
+ require("core-js/modules/web.dom-collections.iterator.js");
27
+ var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
42
28
  var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
43
-
44
29
  var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
45
-
46
30
  var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
47
-
48
- var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
49
-
50
- var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
51
-
52
31
  var _get2 = _interopRequireDefault(require("@babel/runtime/helpers/get"));
53
-
32
+ var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
54
33
  var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
55
-
56
34
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
57
-
58
35
  var _private_utils = require("../private_utils");
59
-
60
36
  var _error_utils = require("../error_utils");
61
-
62
37
  var _table = _interopRequireWildcard(require("./table"));
63
-
64
38
  var _record_query_result = _interopRequireDefault(require("./record_query_result"));
65
-
66
39
  var _record_coloring = require("./record_coloring");
67
-
68
40
  var _object_pool = _interopRequireDefault(require("./object_pool"));
69
-
70
41
  var _record_store = require("./record_store");
71
-
72
42
  var _view_data_store = _interopRequireWildcard(require("./view_data_store"));
73
-
74
43
  var _grouped_record_query_result = _interopRequireDefault(require("./grouped_record_query_result"));
75
-
76
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
77
-
78
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
79
-
44
+ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
45
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
46
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
47
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
48
+ function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t.return || t.return(); } finally { if (u) throw o; } } }; }
49
+ function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
50
+ function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
51
+ function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); }
52
+ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } /** @module @airtable/blocks/models: RecordQueryResult */ /** */
53
+ /** @hidden */
80
54
  /**
81
55
  * Represents a set of records directly from a view or table. See {@link RecordQueryResult} for main
82
56
  * documentation.
@@ -86,84 +60,64 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
86
60
  *
87
61
  * @docsPath models/query results/TableOrViewQueryResult
88
62
  */
89
- var TableOrViewQueryResult =
90
- /*#__PURE__*/
91
- function (_RecordQueryResult) {
92
- (0, _inherits2.default)(TableOrViewQueryResult, _RecordQueryResult);
93
-
94
- /** @internal */
95
-
96
- /** @internal */
97
-
98
- /** @internal */
99
-
100
- /** @internal */
101
-
102
- /** @internal */
103
- // If custom sorts or groups are specified, we'll use a VisList to handle sorting.
104
- // If no sorts are specified, we'll use the underlying row order of the source model.
105
- // Note: we're currently handling visibility tracking for view query results within this class,
106
- // not in the VisList. In other words, only visible records are added to the visList.
107
-
108
- /** @internal */
109
-
110
- /** @internal */
111
- // These is the groupLevels provided to us by the user when executing a query
112
-
113
- /** @internal */
114
- // This is the ordered list of record ids.
115
-
116
- /** @internal */
117
- // This is the ordered list of groups.
118
-
119
- /** @internal */
120
- // An ordered list of group levels returned to us from hyperbase, this should not be
121
- // read from directly, but instead via this.data.groupLevels (Writing to this on hyperbase updates).
122
- // (which check's that this model has not been not deleted)
123
-
124
- /** @internal */
125
- // lazily generated set of record ids
126
-
127
- /** @internal */
128
- // NOTE: when a cellValue key (cellValues or cellValuesInField:) is watched, we want
129
- // to make sure we watch the associated key on the table. However, we need to make
130
- // sure that we only watch the table once for each key. Otherwise, the callbacks
131
- // for each key will get called more than once for each change event. This is because
132
- // Watchable stores references to callbacks for each key, and on each _onChange event
133
- // calls each callback for that key. If we watch the table more than once, then we'll
134
- // call _onChange more than once, and each callback will be called more than once, which
135
- // is undesirable. Instead, we'll store watch counts for each key to make sure we only
136
- // watch the table once.
137
-
138
- /** @internal */
139
-
140
- /** @internal */
141
-
63
+ var TableOrViewQueryResult = /*#__PURE__*/function (_RecordQueryResult) {
142
64
  /** @internal */
143
65
  function TableOrViewQueryResult(sdk, sourceModel, normalizedOpts) {
144
66
  var _this;
145
-
146
67
  (0, _classCallCheck2.default)(this, TableOrViewQueryResult);
147
- _this = (0, _possibleConstructorReturn2.default)(this, (0, _getPrototypeOf2.default)(TableOrViewQueryResult).call(this, sdk, normalizedOpts));
148
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "_sourceModel", void 0);
149
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "_mostRecentSourceModelLoadPromise", void 0);
150
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "_table", void 0);
151
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "_fieldIdsSetToLoadOrNullIfAllFields", void 0);
152
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "_visList", void 0);
153
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "_sorts", void 0);
154
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "_groupLevels", void 0);
155
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "_orderedRecordIds", void 0);
156
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "_orderedGroups", void 0);
157
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "_loadedGroupLevels", void 0);
158
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "_recordIdsSet", null);
159
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "_cellValueKeyWatchCounts", void 0);
160
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "__groupedRecordQueryResultPool", void 0);
68
+ _this = _callSuper(this, TableOrViewQueryResult, [sdk, normalizedOpts]);
69
+ /** @internal */
70
+ (0, _defineProperty2.default)(_this, "_sourceModel", void 0);
71
+ /** @internal */
72
+ (0, _defineProperty2.default)(_this, "_mostRecentSourceModelLoadPromise", void 0);
73
+ /** @internal */
74
+ (0, _defineProperty2.default)(_this, "_table", void 0);
75
+ /** @internal */
76
+ (0, _defineProperty2.default)(_this, "_fieldIdsSetToLoadOrNullIfAllFields", void 0);
77
+ // If custom sorts or groups are specified, we'll use a VisList to handle sorting.
78
+ // If no sorts are specified, we'll use the underlying row order of the source model.
79
+ // Note: we're currently handling visibility tracking for view query results within this class,
80
+ // not in the VisList. In other words, only visible records are added to the visList.
81
+ /** @internal */
82
+ (0, _defineProperty2.default)(_this, "_visList", void 0);
83
+ /** @internal */
84
+ (0, _defineProperty2.default)(_this, "_sorts", void 0);
85
+ // These is the groupLevels provided to us by the user when executing a query
86
+ /** @internal */
87
+ (0, _defineProperty2.default)(_this, "_groupLevels", void 0);
88
+ // This is the ordered list of record ids.
89
+ /** @internal */
90
+ (0, _defineProperty2.default)(_this, "_orderedRecordIds", void 0);
91
+ // This is the ordered list of groups.
92
+ /** @internal */
93
+ (0, _defineProperty2.default)(_this, "_orderedGroups", void 0);
94
+ // An ordered list of group levels returned to us from hyperbase, this should not be
95
+ // read from directly, but instead via this.data.groupLevels (Writing to this on hyperbase updates).
96
+ // (which check's that this model has not been not deleted)
97
+ /** @internal */
98
+ (0, _defineProperty2.default)(_this, "_loadedGroupLevels", void 0);
99
+ // lazily generated set of record ids
100
+ /** @internal */
101
+ (0, _defineProperty2.default)(_this, "_recordIdsSet", null);
102
+ // NOTE: when a cellValue key (cellValues or cellValuesInField:) is watched, we want
103
+ // to make sure we watch the associated key on the table. However, we need to make
104
+ // sure that we only watch the table once for each key. Otherwise, the callbacks
105
+ // for each key will get called more than once for each change event. This is because
106
+ // Watchable stores references to callbacks for each key, and on each _onChange event
107
+ // calls each callback for that key. If we watch the table more than once, then we'll
108
+ // call _onChange more than once, and each callback will be called more than once, which
109
+ // is undesirable. Instead, we'll store watch counts for each key to make sure we only
110
+ // watch the table once.
111
+ /** @internal */
112
+ (0, _defineProperty2.default)(_this, "_cellValueKeyWatchCounts", void 0);
113
+ /** @internal */
114
+ (0, _defineProperty2.default)(_this, "__groupedRecordQueryResultPool", void 0);
161
115
  _this._sourceModel = sourceModel;
162
116
  _this._mostRecentSourceModelLoadPromise = null;
163
117
  _this._table = normalizedOpts.table;
164
118
  var sorts = _this._normalizedOpts.sorts;
165
- _this._sorts = sorts !== null && sorts !== void 0 ? sorts : null; // TODO (SeanKeenan): Placeholder until we support groups from normalizedOpts
166
-
119
+ _this._sorts = sorts !== null && sorts !== void 0 ? sorts : null;
120
+ // TODO (SeanKeenan): Placeholder until we support groups from normalizedOpts
167
121
  _this._groupLevels = null;
168
122
  _this._visList = null;
169
123
  _this._orderedRecordIds = null;
@@ -171,60 +125,37 @@ function (_RecordQueryResult) {
171
125
  _this._loadedGroupLevels = null;
172
126
  _this._cellValueKeyWatchCounts = {};
173
127
  var fieldIdsSetToLoadOrNullIfAllFields = null;
174
-
175
128
  if (_this._normalizedOpts.fieldIdsOrNullIfAllFields) {
176
129
  fieldIdsSetToLoadOrNullIfAllFields = {};
177
- var _iteratorNormalCompletion = true;
178
- var _didIteratorError = false;
179
- var _iteratorError = undefined;
180
-
130
+ var _iterator = _createForOfIteratorHelper(_this._normalizedOpts.fieldIdsOrNullIfAllFields),
131
+ _step;
181
132
  try {
182
- for (var _iterator = _this._normalizedOpts.fieldIdsOrNullIfAllFields[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
133
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
183
134
  var fieldId = _step.value;
184
135
  fieldIdsSetToLoadOrNullIfAllFields[fieldId] = true;
185
- } // Need to load data for fields we're sorting by, even if
136
+ }
137
+ // Need to load data for fields we're sorting by, even if
186
138
  // they're not explicitly requested in the `fields` opt.
187
-
188
139
  } catch (err) {
189
- _didIteratorError = true;
190
- _iteratorError = err;
140
+ _iterator.e(err);
191
141
  } finally {
192
- try {
193
- if (!_iteratorNormalCompletion && _iterator.return != null) {
194
- _iterator.return();
195
- }
196
- } finally {
197
- if (_didIteratorError) {
198
- throw _iteratorError;
199
- }
200
- }
142
+ _iterator.f();
201
143
  }
202
-
203
144
  if (_this._sorts !== null) {
204
- var _iteratorNormalCompletion2 = true;
205
- var _didIteratorError2 = false;
206
- var _iteratorError2 = undefined;
207
-
145
+ var _iterator2 = _createForOfIteratorHelper(_this._sorts),
146
+ _step2;
208
147
  try {
209
- for (var _iterator2 = _this._sorts[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {
148
+ for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
210
149
  var sort = _step2.value;
211
150
  fieldIdsSetToLoadOrNullIfAllFields[sort.fieldId] = true;
212
151
  }
213
152
  } catch (err) {
214
- _didIteratorError2 = true;
215
- _iteratorError2 = err;
153
+ _iterator2.e(err);
216
154
  } finally {
217
- try {
218
- if (!_iteratorNormalCompletion2 && _iterator2.return != null) {
219
- _iterator2.return();
220
- }
221
- } finally {
222
- if (_didIteratorError2) {
223
- throw _iteratorError2;
224
- }
225
- }
155
+ _iterator2.f();
226
156
  }
227
- } // TODO (SeanKeenan): Comment back in when enabling groups
157
+ }
158
+ // TODO (SeanKeenan): Comment back in when enabling groups
228
159
  // Same for group configs
229
160
  // if (this._groupLevels !== null) {
230
161
  // for (const group of this._groupLevels) {
@@ -232,61 +163,137 @@ function (_RecordQueryResult) {
232
163
  // }
233
164
  // }
234
165
 
235
-
236
166
  var recordColorMode = _this._normalizedOpts.recordColorMode;
237
-
238
167
  if (recordColorMode && recordColorMode.type === _record_coloring.ModeTypes.BY_SELECT_FIELD) {
239
168
  fieldIdsSetToLoadOrNullIfAllFields[recordColorMode.selectField.id] = true;
240
169
  }
241
170
  }
242
-
243
171
  _this._fieldIdsSetToLoadOrNullIfAllFields = fieldIdsSetToLoadOrNullIfAllFields;
244
172
  _this.__groupedRecordQueryResultPool = new _object_pool.default(_grouped_record_query_result.default);
245
- Object.seal((0, _assertThisInitialized2.default)(_this));
173
+ Object.seal(_this);
246
174
  return _this;
247
175
  }
248
176
  /** @internal */
177
+ (0, _inherits2.default)(TableOrViewQueryResult, _RecordQueryResult);
178
+ return (0, _createClass2.default)(TableOrViewQueryResult, [{
179
+ key: "_dataOrNullIfDeleted",
180
+ get: function get() {
181
+ if (this._sourceModel.isDeleted || this._recordStore.isDeleted) {
182
+ return null;
183
+ }
184
+ return {
185
+ recordIds: this._orderedRecordIds,
186
+ groups: this._orderedGroups,
187
+ groupLevels: this._loadedGroupLevels
188
+ };
189
+ }
190
+ /** @internal */
191
+ // istanbul ignore next
192
+ }, {
193
+ key: "__sourceModelId",
194
+ get: function get() {
195
+ return this._sourceModel.id;
196
+ }
249
197
 
198
+ /** @internal */
199
+ }, {
200
+ key: "__poolKey",
201
+ get: function get() {
202
+ return "".concat(this._serializedOpts, "::").concat(this._sourceModel.id);
203
+ }
250
204
 
251
- (0, _createClass2.default)(TableOrViewQueryResult, [{
252
- key: "_getOrGenerateRecordIdsSet",
253
-
205
+ /**
206
+ * @internal (since we may not be able to return parent model instances in the immutable models world)
207
+ * The table that records in this RecordQueryResult are part of
208
+ */
209
+ }, {
210
+ key: "parentTable",
211
+ get: function get() {
212
+ return this._table;
213
+ }
214
+ /**
215
+ * @internal (since we may not be able to return parent model instances in the immutable models world)
216
+ * The view that was used to obtain this RecordQueryResult by calling
217
+ * `view.selectRecords`. Null if the RecordQueryResult was obtained by calling
218
+ * `table.selectRecords`.
219
+ */
220
+ }, {
221
+ key: "parentView",
222
+ get: function get() {
223
+ return this._sourceModel instanceof _table.default ? null : this._sourceModel;
224
+ }
225
+ /**
226
+ * The record IDs in this RecordQueryResult.
227
+ * Throws if data is not loaded yet.
228
+ * Can be watched.
229
+ */
230
+ }, {
231
+ key: "recordIds",
232
+ get: function get() {
233
+ // The following statements have been carefully sequenced to ensure
234
+ // that when this method fails, it reports the most salient error.
235
+ var recordIds = this._data.recordIds; // Throws when the model has been deleted.
236
+ (0, _error_utils.invariant)(this.isDataLoaded, 'RecordQueryResult data is not loaded');
237
+ (0, _error_utils.invariant)(recordIds, 'No recordIds');
238
+ return recordIds;
239
+ }
240
+ /**
241
+ * The ordered GroupedRecordQueryResult's in this RecordQueryResult.
242
+ * Throws if data is not loaded yet.
243
+ * Can be watched.
244
+ *
245
+ * @hidden
246
+ */
247
+ }, {
248
+ key: "groups",
249
+ get: function get() {
250
+ // The following statements have been carefully sequenced to ensure
251
+ // that when this method fails, it reports the most salient error.
252
+ var groups = this._data.groups; // Throws when the model has been deleted.
253
+ (0, _error_utils.invariant)(this.isDataLoaded, 'RecordQueryResult data is not loaded');
254
+ return groups !== null && groups !== void 0 ? groups : null;
255
+ }
256
+ /**
257
+ * The GroupLevels in this RecordQueryResult.
258
+ * Throws if data is not loaded yet.
259
+ * Can be watched.
260
+ *
261
+ * @hidden
262
+ */
263
+ }, {
264
+ key: "groupLevels",
265
+ get: function get() {
266
+ var groupLevels = this._data.groupLevels; // Throws when the model has been deleted.
267
+ (0, _error_utils.invariant)(this.isDataLoaded, 'RecordQueryResult data is not loaded');
268
+ return groupLevels ? groupLevels.map(singleLevel => _objectSpread(_objectSpread({}, singleLevel), {}, {
269
+ field: this.parentTable.getFieldById(singleLevel.fieldId)
270
+ })) : null;
271
+ }
254
272
  /**
255
273
  * The set of record IDs in this RecordQueryResult.
256
274
  * Throws if data is not loaded yet.
257
275
  *
258
276
  * @internal
259
277
  */
278
+ }, {
279
+ key: "_getOrGenerateRecordIdsSet",
260
280
  value: function _getOrGenerateRecordIdsSet() {
261
281
  if (!this._recordIdsSet) {
262
282
  var recordIdsSet = {};
263
- var _iteratorNormalCompletion3 = true;
264
- var _didIteratorError3 = false;
265
- var _iteratorError3 = undefined;
266
-
283
+ var _iterator3 = _createForOfIteratorHelper(this.recordIds),
284
+ _step3;
267
285
  try {
268
- for (var _iterator3 = this.recordIds[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) {
286
+ for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
269
287
  var recordId = _step3.value;
270
288
  recordIdsSet[recordId] = true;
271
289
  }
272
290
  } catch (err) {
273
- _didIteratorError3 = true;
274
- _iteratorError3 = err;
291
+ _iterator3.e(err);
275
292
  } finally {
276
- try {
277
- if (!_iteratorNormalCompletion3 && _iterator3.return != null) {
278
- _iterator3.return();
279
- }
280
- } finally {
281
- if (_didIteratorError3) {
282
- throw _iteratorError3;
283
- }
284
- }
293
+ _iterator3.f();
285
294
  }
286
-
287
295
  this._recordIdsSet = recordIdsSet;
288
296
  }
289
-
290
297
  return this._recordIdsSet;
291
298
  }
292
299
  /**
@@ -294,22 +301,85 @@ function (_RecordQueryResult) {
294
301
  * Null if fields were not specified, which means the RecordQueryResult
295
302
  * will load all fields in the table.
296
303
  */
297
-
298
304
  }, {
299
- key: "_incrementCellValueKeyWatchCountAndWatchIfNecessary",
300
-
305
+ key: "fields",
306
+ get: function get() {
307
+ var fieldIdsOrNullIfAllFields = this._normalizedOpts.fieldIdsOrNullIfAllFields;
308
+ if (fieldIdsOrNullIfAllFields) {
309
+ var fields = [];
310
+ // Filter out any deleted fields, since RecordQueryResult is "live".
311
+ // It would be too cumbersome (and defeat part of the purpose of
312
+ // using RecordQueryResult) if the user had to manually watch for deletion
313
+ // on all the fields and recreate the RecordQueryResult.
314
+ var _iterator4 = _createForOfIteratorHelper(fieldIdsOrNullIfAllFields),
315
+ _step4;
316
+ try {
317
+ for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
318
+ var fieldId = _step4.value;
319
+ var field = this._table.getFieldByIdIfExists(fieldId);
320
+ if (field !== null) {
321
+ fields.push(field);
322
+ }
323
+ }
324
+ } catch (err) {
325
+ _iterator4.e(err);
326
+ } finally {
327
+ _iterator4.f();
328
+ }
329
+ return fields;
330
+ } else {
331
+ return null;
332
+ }
333
+ }
301
334
  /** @internal */
335
+ }, {
336
+ key: "_cellValuesForSortWatchKeys",
337
+ get: function get() {
338
+ return this._sorts ? this._sorts.map(sort => "cellValuesInField:".concat(sort.fieldId)) : [];
339
+ }
340
+ /** @internal */
341
+ }, {
342
+ key: "_cellValuesForGroupWatchKeys",
343
+ get: function get() {
344
+ // _groupLevels can not be specified by the user during the query yet
345
+ // istanbul ignore next
346
+ return this._groupLevels ? this._groupLevels.map(group => "cellValuesInField:".concat(group.fieldId)) : [];
347
+ }
348
+ /** @internal */
349
+ }, {
350
+ key: "_sourceModelRecordIds",
351
+ get: function get() {
352
+ return this._sourceModel instanceof _table.default ? this._recordStore.recordIds : this._recordStore.getViewDataStore(this._sourceModel.id).visibleRecordIds;
353
+ }
354
+ /** @internal */
355
+ }, {
356
+ key: "_sourceModelGroups",
357
+ get: function get() {
358
+ return this._sourceModel instanceof _table.default ? null : this._recordStore.getViewDataStore(this._sourceModel.id).groups;
359
+ }
360
+ /** @internal */
361
+ }, {
362
+ key: "_sourceModelGroupLevels",
363
+ get: function get() {
364
+ return this._sourceModel instanceof _table.default ? null : this._recordStore.getViewDataStore(this._sourceModel.id).groupLevels;
365
+ }
366
+ /** @internal */
367
+ }, {
368
+ key: "_sourceModelRecords",
369
+ get: function get() {
370
+ return this._sourceModel instanceof _table.default ? this._recordStore.records : this._recordStore.getViewDataStore(this._sourceModel.id).visibleRecords;
371
+ }
372
+ /** @internal */
373
+ }, {
374
+ key: "_incrementCellValueKeyWatchCountAndWatchIfNecessary",
302
375
  value: function _incrementCellValueKeyWatchCountAndWatchIfNecessary(key, watchCallback) {
303
376
  if (!this._cellValueKeyWatchCounts[key]) {
304
377
  this._cellValueKeyWatchCounts[key] = 0;
305
-
306
378
  this._recordStore.watch(key, watchCallback, this);
307
379
  }
308
-
309
380
  this._cellValueKeyWatchCounts[key]++;
310
381
  }
311
382
  /** @internal */
312
-
313
383
  }, {
314
384
  key: "_decrementCellValueKeyWatchCountAndUnwatchIfPossible",
315
385
  value: function _decrementCellValueKeyWatchCountAndUnwatchIfPossible(key, watchCallback) {
@@ -318,133 +388,93 @@ function (_RecordQueryResult) {
318
388
  // where calling unwatch on a key that isn't watched just no-ops.
319
389
  return;
320
390
  }
321
-
322
391
  this._cellValueKeyWatchCounts[key]--;
323
-
324
392
  if (this._cellValueKeyWatchCounts[key] === 0) {
325
393
  // We're down to zero watches for this key, so we can actually unwatch it now.
326
394
  this._recordStore.unwatch(key, watchCallback, this);
327
-
328
395
  delete this._cellValueKeyWatchCounts[key];
329
396
  }
330
397
  }
331
398
  /** @inheritdoc */
332
-
333
399
  }, {
334
400
  key: "watch",
335
401
  value: function watch(keys, callback, context) {
336
402
  var validKeys = (0, _get2.default)((0, _getPrototypeOf2.default)(TableOrViewQueryResult.prototype), "watch", this).call(this, keys, callback, context);
337
- var _iteratorNormalCompletion4 = true;
338
- var _didIteratorError4 = false;
339
- var _iteratorError4 = undefined;
340
-
403
+ var _iterator5 = _createForOfIteratorHelper(validKeys),
404
+ _step5;
341
405
  try {
342
- for (var _iterator4 = validKeys[Symbol.iterator](), _step4; !(_iteratorNormalCompletion4 = (_step4 = _iterator4.next()).done); _iteratorNormalCompletion4 = true) {
343
- var _key2 = _step4.value;
344
-
345
- if (_key2.startsWith(_record_query_result.default.WatchableCellValuesInFieldKeyPrefix)) {
346
- var fieldId = _key2.substring(_record_query_result.default.WatchableCellValuesInFieldKeyPrefix.length);
347
-
406
+ for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
407
+ var key = _step5.value;
408
+ if (key.startsWith(_record_query_result.default.WatchableCellValuesInFieldKeyPrefix)) {
409
+ var fieldId = key.substring(_record_query_result.default.WatchableCellValuesInFieldKeyPrefix.length);
348
410
  if (this._fieldIdsSetToLoadOrNullIfAllFields && !(0, _private_utils.has)(this._fieldIdsSetToLoadOrNullIfAllFields, fieldId)) {
349
411
  throw (0, _error_utils.spawnError)("Can't watch field because it wasn't included in RecordQueryResult fields: %s", fieldId);
350
412
  }
351
-
352
- this._incrementCellValueKeyWatchCountAndWatchIfNecessary(_key2, this._onCellValuesInFieldChanged);
413
+ this._incrementCellValueKeyWatchCountAndWatchIfNecessary(key, this._onCellValuesInFieldChanged);
353
414
  }
354
-
355
- if (_key2 === _record_query_result.default.WatchableKeys.cellValues) {
415
+ if (key === _record_query_result.default.WatchableKeys.cellValues) {
356
416
  if (this._fieldIdsSetToLoadOrNullIfAllFields) {
357
417
  for (var _i = 0, _Object$keys = Object.keys(this._fieldIdsSetToLoadOrNullIfAllFields); _i < _Object$keys.length; _i++) {
358
418
  var _fieldId = _Object$keys[_i];
359
-
360
419
  this._incrementCellValueKeyWatchCountAndWatchIfNecessary(_record_query_result.default.WatchableCellValuesInFieldKeyPrefix + _fieldId, this._onCellValuesChanged);
361
420
  }
362
421
  } else {
363
- this._incrementCellValueKeyWatchCountAndWatchIfNecessary(_key2, this._onCellValuesChanged);
422
+ this._incrementCellValueKeyWatchCountAndWatchIfNecessary(key, this._onCellValuesChanged);
364
423
  }
365
424
  }
366
425
  }
367
426
  } catch (err) {
368
- _didIteratorError4 = true;
369
- _iteratorError4 = err;
427
+ _iterator5.e(err);
370
428
  } finally {
371
- try {
372
- if (!_iteratorNormalCompletion4 && _iterator4.return != null) {
373
- _iterator4.return();
374
- }
375
- } finally {
376
- if (_didIteratorError4) {
377
- throw _iteratorError4;
378
- }
379
- }
429
+ _iterator5.f();
380
430
  }
381
-
382
431
  return validKeys;
383
432
  }
384
433
  /** @inheritdoc */
385
-
386
434
  }, {
387
435
  key: "unwatch",
388
436
  value: function unwatch(keys, callback, context) {
389
437
  var validKeys = (0, _get2.default)((0, _getPrototypeOf2.default)(TableOrViewQueryResult.prototype), "unwatch", this).call(this, keys, callback, context);
390
- var _iteratorNormalCompletion5 = true;
391
- var _didIteratorError5 = false;
392
- var _iteratorError5 = undefined;
393
-
438
+ var _iterator6 = _createForOfIteratorHelper(validKeys),
439
+ _step6;
394
440
  try {
395
- for (var _iterator5 = validKeys[Symbol.iterator](), _step5; !(_iteratorNormalCompletion5 = (_step5 = _iterator5.next()).done); _iteratorNormalCompletion5 = true) {
396
- var _key3 = _step5.value;
397
-
398
- if (_key3.startsWith(_record_query_result.default.WatchableCellValuesInFieldKeyPrefix)) {
399
- this._decrementCellValueKeyWatchCountAndUnwatchIfPossible(_key3, this._onCellValuesInFieldChanged);
441
+ for (_iterator6.s(); !(_step6 = _iterator6.n()).done;) {
442
+ var key = _step6.value;
443
+ if (key.startsWith(_record_query_result.default.WatchableCellValuesInFieldKeyPrefix)) {
444
+ this._decrementCellValueKeyWatchCountAndUnwatchIfPossible(key, this._onCellValuesInFieldChanged);
400
445
  }
401
-
402
- if (_key3 === _record_query_result.default.WatchableKeys.cellValues) {
446
+ if (key === _record_query_result.default.WatchableKeys.cellValues) {
403
447
  if (this._fieldIdsSetToLoadOrNullIfAllFields) {
404
448
  for (var _i2 = 0, _Object$keys2 = Object.keys(this._fieldIdsSetToLoadOrNullIfAllFields); _i2 < _Object$keys2.length; _i2++) {
405
449
  var fieldId = _Object$keys2[_i2];
406
-
407
450
  this._decrementCellValueKeyWatchCountAndUnwatchIfPossible(_record_query_result.default.WatchableCellValuesInFieldKeyPrefix + fieldId, this._onCellValuesChanged);
408
451
  }
409
452
  } else {
410
- this._decrementCellValueKeyWatchCountAndUnwatchIfPossible(_key3, this._onCellValuesChanged);
453
+ this._decrementCellValueKeyWatchCountAndUnwatchIfPossible(key, this._onCellValuesChanged);
411
454
  }
412
455
  }
413
456
  }
414
457
  } catch (err) {
415
- _didIteratorError5 = true;
416
- _iteratorError5 = err;
458
+ _iterator6.e(err);
417
459
  } finally {
418
- try {
419
- if (!_iteratorNormalCompletion5 && _iterator5.return != null) {
420
- _iterator5.return();
421
- }
422
- } finally {
423
- if (_didIteratorError5) {
424
- throw _iteratorError5;
425
- }
426
- }
460
+ _iterator6.f();
427
461
  }
428
-
429
462
  return validKeys;
430
463
  }
431
464
  /** @inheritdoc */
432
-
433
465
  }, {
434
466
  key: "loadDataAsync",
435
- value: function loadDataAsync() {
436
- var sourceModelLoadPromise, cellValuesInFieldsLoadPromise;
437
- return _regenerator.default.async(function loadDataAsync$(_context) {
438
- while (1) {
439
- switch (_context.prev = _context.next) {
467
+ value: (function () {
468
+ var _loadDataAsync2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
469
+ var sourceModelLoadPromise, cellValuesInFieldsLoadPromise;
470
+ return _regenerator.default.wrap(function _callee$(_context) {
471
+ while (1) switch (_context.prev = _context.next) {
440
472
  case 0:
441
473
  if (!this._sourceModel.isDeleted) {
442
474
  _context.next = 2;
443
475
  break;
444
476
  }
445
-
446
477
  throw this._spawnErrorForDeletion();
447
-
448
478
  case 2:
449
479
  if (this._fieldIdsSetToLoadOrNullIfAllFields) {
450
480
  cellValuesInFieldsLoadPromise = this._recordStore.loadCellValuesInFieldIdsAsync(Object.keys(this._fieldIdsSetToLoadOrNullIfAllFields));
@@ -452,7 +482,6 @@ function (_RecordQueryResult) {
452
482
  // Load all fields.
453
483
  cellValuesInFieldsLoadPromise = this._recordStore.loadDataAsync();
454
484
  }
455
-
456
485
  if (this._sourceModel instanceof _table.default) {
457
486
  if (this._fieldIdsSetToLoadOrNullIfAllFields) {
458
487
  sourceModelLoadPromise = this._recordStore.loadRecordMetadataAsync();
@@ -464,82 +493,65 @@ function (_RecordQueryResult) {
464
493
  } else {
465
494
  sourceModelLoadPromise = this._recordStore.getViewDataStore(this._sourceModel.id).loadDataAsync();
466
495
  }
467
-
468
496
  this._mostRecentSourceModelLoadPromise = Promise.all([sourceModelLoadPromise, cellValuesInFieldsLoadPromise, this._loadRecordColorsAsync()]);
469
497
  _context.next = 7;
470
- return _regenerator.default.awrap((0, _get2.default)((0, _getPrototypeOf2.default)(TableOrViewQueryResult.prototype), "loadDataAsync", this).call(this));
471
-
498
+ return (0, _get2.default)((0, _getPrototypeOf2.default)(TableOrViewQueryResult.prototype), "loadDataAsync", this).call(this);
472
499
  case 7:
473
500
  case "end":
474
501
  return _context.stop();
475
502
  }
476
- }
477
- }, null, this);
478
- }
503
+ }, _callee, this);
504
+ }));
505
+ function loadDataAsync() {
506
+ return _loadDataAsync2.apply(this, arguments);
507
+ }
508
+ return loadDataAsync;
509
+ }()
479
510
  /**
480
511
  * @internal
481
512
  */
482
-
513
+ )
483
514
  }, {
484
515
  key: "_getChangedKeysOnLoad",
485
516
  value: function _getChangedKeysOnLoad() {
486
517
  var changedKeys = [_record_query_result.default.WatchableKeys.records, _record_query_result.default.WatchableKeys.recordIds, _record_query_result.default.WatchableKeys.cellValues, _record_query_result.default.WatchableKeys.groups, _record_query_result.default.WatchableKeys.groupLevels];
487
-
488
518
  var fieldIds = this._normalizedOpts.fieldIdsOrNullIfAllFields || this._table.fields.map(field => field.id);
489
-
490
- var _iteratorNormalCompletion6 = true;
491
- var _didIteratorError6 = false;
492
- var _iteratorError6 = undefined;
493
-
519
+ var _iterator7 = _createForOfIteratorHelper(fieldIds),
520
+ _step7;
494
521
  try {
495
- for (var _iterator6 = fieldIds[Symbol.iterator](), _step6; !(_iteratorNormalCompletion6 = (_step6 = _iterator6.next()).done); _iteratorNormalCompletion6 = true) {
496
- var fieldId = _step6.value;
522
+ for (_iterator7.s(); !(_step7 = _iterator7.n()).done;) {
523
+ var fieldId = _step7.value;
497
524
  changedKeys.push(_record_query_result.default.WatchableCellValuesInFieldKeyPrefix + fieldId);
498
525
  }
499
526
  } catch (err) {
500
- _didIteratorError6 = true;
501
- _iteratorError6 = err;
527
+ _iterator7.e(err);
502
528
  } finally {
503
- try {
504
- if (!_iteratorNormalCompletion6 && _iterator6.return != null) {
505
- _iterator6.return();
506
- }
507
- } finally {
508
- if (_didIteratorError6) {
509
- throw _iteratorError6;
510
- }
511
- }
529
+ _iterator7.f();
512
530
  }
513
-
514
531
  return changedKeys;
515
532
  }
516
- /** @internal */
517
533
 
534
+ /** @internal */
518
535
  }, {
519
536
  key: "_loadDataAsync",
520
- value: function _loadDataAsync() {
521
- var viewDataStore, _iteratorNormalCompletion7, _didIteratorError7, _iteratorError7, _iterator7, _step7, sort, field;
522
-
523
- return _regenerator.default.async(function _loadDataAsync$(_context2) {
524
- while (1) {
525
- switch (_context2.prev = _context2.next) {
537
+ value: (function () {
538
+ var _loadDataAsync3 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2() {
539
+ var viewDataStore, _iterator8, _step8, sort, field;
540
+ return _regenerator.default.wrap(function _callee2$(_context2) {
541
+ while (1) switch (_context2.prev = _context2.next) {
526
542
  case 0:
527
543
  this._table.__tableOrViewQueryResultPool.registerObjectForReuseStrong(this);
528
-
529
544
  (0, _error_utils.invariant)(this._mostRecentSourceModelLoadPromise, 'No source model load promises');
530
545
  _context2.next = 4;
531
- return _regenerator.default.awrap(this._mostRecentSourceModelLoadPromise);
532
-
546
+ return this._mostRecentSourceModelLoadPromise;
533
547
  case 4:
534
548
  if (this._sorts) {
535
549
  this._replaceVisList();
536
550
  }
537
-
538
551
  this._orderedRecordIds = this._generateOrderedRecordIds();
539
- this._orderedGroups = this._generateAndLoadOrderedGroups(); // The server provided value and developer supplied value are the same, no conversion needed
540
-
552
+ this._orderedGroups = this._generateAndLoadOrderedGroups();
553
+ // The server provided value and developer supplied value are the same, no conversion needed
541
554
  this._loadedGroupLevels = this._sourceModelGroupLevels;
542
-
543
555
  if (this._sourceModel instanceof _table.default) {
544
556
  this._recordStore.watch(_record_store.WatchableRecordStoreKeys.records, this._onRecordsChanged, this);
545
557
  } else {
@@ -548,83 +560,42 @@ function (_RecordQueryResult) {
548
560
  viewDataStore.watch(_view_data_store.WatchableViewDataStoreKeys.groups, this._onGroupsChanged, this);
549
561
  viewDataStore.watch(_view_data_store.WatchableViewDataStoreKeys.groupLevels, this._onGroupLevelsChanged, this);
550
562
  }
551
-
552
563
  this._recordStore.watch(this._cellValuesForSortWatchKeys, this._onCellValuesForSortChanged, this);
553
-
554
564
  this._recordStore.watch(this._cellValuesForGroupWatchKeys, this._onCellValuesForGroupChanged, this);
555
-
556
565
  this._table.watch(_table.WatchableTableKeys.fields, this._onTableFieldsChanged, this);
557
-
558
- if (!this._sorts) {
559
- _context2.next = 32;
560
- break;
561
- }
562
-
563
- _iteratorNormalCompletion7 = true;
564
- _didIteratorError7 = false;
565
- _iteratorError7 = undefined;
566
- _context2.prev = 16;
567
-
568
- for (_iterator7 = this._sorts[Symbol.iterator](); !(_iteratorNormalCompletion7 = (_step7 = _iterator7.next()).done); _iteratorNormalCompletion7 = true) {
569
- sort = _step7.value;
570
- field = this._table.getFieldByIdIfExists(sort.fieldId);
571
-
572
- if (field) {
573
- field.watch('type', this._onFieldConfigChanged, this);
574
- field.watch('options', this._onFieldConfigChanged, this);
566
+ if (this._sorts) {
567
+ _iterator8 = _createForOfIteratorHelper(this._sorts);
568
+ try {
569
+ for (_iterator8.s(); !(_step8 = _iterator8.n()).done;) {
570
+ sort = _step8.value;
571
+ field = this._table.getFieldByIdIfExists(sort.fieldId);
572
+ if (field) {
573
+ field.watch('type', this._onFieldConfigChanged, this);
574
+ field.watch('options', this._onFieldConfigChanged, this);
575
+ }
576
+ }
577
+ } catch (err) {
578
+ _iterator8.e(err);
579
+ } finally {
580
+ _iterator8.f();
575
581
  }
576
582
  }
577
-
578
- _context2.next = 24;
579
- break;
580
-
581
- case 20:
582
- _context2.prev = 20;
583
- _context2.t0 = _context2["catch"](16);
584
- _didIteratorError7 = true;
585
- _iteratorError7 = _context2.t0;
586
-
587
- case 24:
588
- _context2.prev = 24;
589
- _context2.prev = 25;
590
-
591
- if (!_iteratorNormalCompletion7 && _iterator7.return != null) {
592
- _iterator7.return();
593
- }
594
-
595
- case 27:
596
- _context2.prev = 27;
597
-
598
- if (!_didIteratorError7) {
599
- _context2.next = 30;
600
- break;
601
- }
602
-
603
- throw _iteratorError7;
604
-
605
- case 30:
606
- return _context2.finish(27);
607
-
608
- case 31:
609
- return _context2.finish(24);
610
-
611
- case 32:
612
583
  return _context2.abrupt("return", this._getChangedKeysOnLoad());
613
-
614
- case 33:
584
+ case 14:
615
585
  case "end":
616
586
  return _context2.stop();
617
587
  }
618
- }
619
- }, null, this, [[16, 20, 24, 32], [25,, 27, 31]]);
620
- }
621
- /** @inheritdoc */
622
-
588
+ }, _callee2, this);
589
+ }));
590
+ function _loadDataAsync() {
591
+ return _loadDataAsync3.apply(this, arguments);
592
+ }
593
+ return _loadDataAsync;
594
+ }() /** @inheritdoc */)
623
595
  }, {
624
596
  key: "unloadData",
625
597
  value: function unloadData() {
626
598
  (0, _get2.default)((0, _getPrototypeOf2.default)(TableOrViewQueryResult.prototype), "unloadData", this).call(this);
627
-
628
599
  if (this._sourceModel instanceof _table.default) {
629
600
  if (this._fieldIdsSetToLoadOrNullIfAllFields) {
630
601
  this._recordStore.unloadRecordMetadata();
@@ -637,134 +608,91 @@ function (_RecordQueryResult) {
637
608
  this._recordStore.getViewDataStore(this._sourceModel.id).unloadData();
638
609
  }
639
610
  }
640
-
641
611
  if (this._fieldIdsSetToLoadOrNullIfAllFields) {
642
612
  this._recordStore.unloadCellValuesInFieldIds(Object.keys(this._fieldIdsSetToLoadOrNullIfAllFields));
643
613
  }
644
-
645
614
  this._unloadRecordColors();
646
615
  }
647
616
  /** @internal */
648
-
649
617
  }, {
650
618
  key: "_unloadData",
651
619
  value: function _unloadData() {
652
620
  this._mostRecentSourceModelLoadPromise = null;
653
-
654
621
  if (this._sourceModel instanceof _table.default) {
655
622
  this._recordStore.unwatch(_record_store.WatchableRecordStoreKeys.records, this._onRecordsChanged, this);
656
623
  } else {
657
624
  if (!this._sourceModel.isDeleted) {
658
625
  var viewDataStore = this._recordStore.getViewDataStore(this._sourceModel.id);
659
-
660
626
  viewDataStore.unwatch(_view_data_store.WatchableViewDataStoreKeys.visibleRecords, this._onRecordsChanged, this);
661
627
  viewDataStore.unwatch(_view_data_store.WatchableViewDataStoreKeys.groups, this._onGroupsChanged, this);
662
628
  viewDataStore.unwatch(_view_data_store.WatchableViewDataStoreKeys.groupLevels, this._onGroupLevelsChanged, this);
663
629
  }
664
630
  }
665
-
666
631
  this._recordStore.unwatch(this._cellValuesForSortWatchKeys, this._onCellValuesForSortChanged, this);
667
-
668
632
  this._recordStore.unwatch(this._cellValuesForGroupWatchKeys, this._onCellValuesForGroupChanged, this);
633
+ this._table.unwatch(_table.WatchableTableKeys.fields, this._onTableFieldsChanged, this);
669
634
 
670
- this._table.unwatch(_table.WatchableTableKeys.fields, this._onTableFieldsChanged, this); // If the table is deleted, can't call getFieldById on it below.
671
-
672
-
635
+ // If the table is deleted, can't call getFieldById on it below.
673
636
  if (!this._table.isDeleted && this._sorts) {
674
- var _iteratorNormalCompletion8 = true;
675
- var _didIteratorError8 = false;
676
- var _iteratorError8 = undefined;
677
-
637
+ var _iterator9 = _createForOfIteratorHelper(this._sorts),
638
+ _step9;
678
639
  try {
679
- for (var _iterator8 = this._sorts[Symbol.iterator](), _step8; !(_iteratorNormalCompletion8 = (_step8 = _iterator8.next()).done); _iteratorNormalCompletion8 = true) {
680
- var sort = _step8.value;
681
-
640
+ for (_iterator9.s(); !(_step9 = _iterator9.n()).done;) {
641
+ var sort = _step9.value;
682
642
  var field = this._table.getFieldByIdIfExists(sort.fieldId);
683
-
684
643
  if (field) {
685
644
  field.unwatch('type', this._onFieldConfigChanged, this);
686
645
  field.unwatch('options', this._onFieldConfigChanged, this);
687
646
  }
688
647
  }
689
648
  } catch (err) {
690
- _didIteratorError8 = true;
691
- _iteratorError8 = err;
649
+ _iterator9.e(err);
692
650
  } finally {
693
- try {
694
- if (!_iteratorNormalCompletion8 && _iterator8.return != null) {
695
- _iterator8.return();
696
- }
697
- } finally {
698
- if (_didIteratorError8) {
699
- throw _iteratorError8;
700
- }
701
- }
651
+ _iterator9.f();
702
652
  }
703
653
  }
704
-
705
654
  this._unloadOrderedGroupsIfNeeded();
706
-
707
655
  this._visList = null;
708
656
  this._orderedRecordIds = null;
709
657
  this._recordIdsSet = null;
710
-
711
658
  this._table.__tableOrViewQueryResultPool.unregisterObjectForReuseStrong(this);
712
659
  }
713
660
  /** @internal */
714
-
715
661
  }, {
716
662
  key: "_addRecordIdsToVisList",
717
663
  value: function _addRecordIdsToVisList(recordIds) {
718
664
  var visList = this._visList;
719
665
  (0, _error_utils.invariant)(visList, 'No vis list');
720
- var _iteratorNormalCompletion9 = true;
721
- var _didIteratorError9 = false;
722
- var _iteratorError9 = undefined;
723
-
666
+ var _iterator10 = _createForOfIteratorHelper(recordIds),
667
+ _step10;
724
668
  try {
725
- for (var _iterator9 = recordIds[Symbol.iterator](), _step9; !(_iteratorNormalCompletion9 = (_step9 = _iterator9.next()).done); _iteratorNormalCompletion9 = true) {
726
- var recordId = _step9.value;
727
-
669
+ for (_iterator10.s(); !(_step10 = _iterator10.n()).done;) {
670
+ var recordId = _step10.value;
728
671
  var record = this._recordStore.getRecordByIdIfExists(recordId);
729
-
730
672
  (0, _error_utils.invariant)(record, 'Record missing in table');
731
673
  visList.addRecordData(record._data);
732
674
  }
733
675
  } catch (err) {
734
- _didIteratorError9 = true;
735
- _iteratorError9 = err;
676
+ _iterator10.e(err);
736
677
  } finally {
737
- try {
738
- if (!_iteratorNormalCompletion9 && _iterator9.return != null) {
739
- _iterator9.return();
740
- }
741
- } finally {
742
- if (_didIteratorError9) {
743
- throw _iteratorError9;
744
- }
745
- }
678
+ _iterator10.f();
746
679
  }
747
680
  }
748
681
  /** @internal */
749
-
750
682
  }, {
751
683
  key: "_onGroupLevelsChanged",
752
684
  value: function _onGroupLevelsChanged(model, key, updates) {
753
685
  this._loadedGroupLevels = this._sourceModelGroupLevels;
754
-
755
686
  this._unloadRemovedGroupsAndLoadNewGroupsAndTriggerWatches();
756
-
757
687
  this._onChange(_record_query_result.default.WatchableKeys.groupLevels);
758
688
  }
759
689
  /** @internal */
760
-
761
690
  }, {
762
691
  key: "_onGroupsChanged",
763
692
  value: function _onGroupsChanged(model, key, updates) {
764
693
  this._unloadRemovedGroupsAndLoadNewGroupsAndTriggerWatches();
765
694
  }
766
695
  /** @internal */
767
-
768
696
  }, {
769
697
  key: "_onRecordsChanged",
770
698
  value: function _onRecordsChanged(model, key, updates) {
@@ -773,113 +701,77 @@ function (_RecordQueryResult) {
773
701
  // so we need to manually generate updates based on the old and new
774
702
  // recordIds.
775
703
  (0, _error_utils.invariant)(this._orderedRecordIds, '_orderedRecordIds unset');
776
-
777
704
  var visibleRecordIds = this._recordStore.getViewDataStore(model.viewId).visibleRecordIds;
778
-
779
705
  var _addedRecordIds = (0, _private_utils.arrayDifference)(visibleRecordIds, this._orderedRecordIds);
780
-
781
706
  var _removedRecordIds = (0, _private_utils.arrayDifference)(this._orderedRecordIds, visibleRecordIds);
782
-
783
707
  updates = {
784
708
  addedRecordIds: _addedRecordIds,
785
709
  removedRecordIds: _removedRecordIds
786
710
  };
787
711
  }
788
-
789
712
  if (!updates) {
790
713
  // If there are no updates, do nothing, since we'll handle the initial
791
714
  // callback when the record set is loaded (and we don't want to fire
792
715
  // a records change twice with no data).
793
716
  return;
794
717
  }
795
-
796
718
  var _updates = updates,
797
- addedRecordIds = _updates.addedRecordIds,
798
- removedRecordIds = _updates.removedRecordIds;
799
-
719
+ addedRecordIds = _updates.addedRecordIds,
720
+ removedRecordIds = _updates.removedRecordIds;
800
721
  if (this._sorts) {
801
722
  var visList = this._visList;
802
723
  (0, _error_utils.invariant)(visList, 'No vis list');
803
-
804
724
  if (removedRecordIds.length > 0) {
805
725
  visList.removeRecordIds(removedRecordIds);
806
726
  }
807
-
808
727
  if (addedRecordIds.length > 0) {
809
728
  this._addRecordIdsToVisList(addedRecordIds);
810
729
  }
811
730
  }
812
-
813
731
  if (this._recordIdsSet) {
814
- var _iteratorNormalCompletion10 = true;
815
- var _didIteratorError10 = false;
816
- var _iteratorError10 = undefined;
817
-
732
+ var _iterator11 = _createForOfIteratorHelper(addedRecordIds),
733
+ _step11;
818
734
  try {
819
- for (var _iterator10 = addedRecordIds[Symbol.iterator](), _step10; !(_iteratorNormalCompletion10 = (_step10 = _iterator10.next()).done); _iteratorNormalCompletion10 = true) {
820
- var recordId = _step10.value;
735
+ for (_iterator11.s(); !(_step11 = _iterator11.n()).done;) {
736
+ var recordId = _step11.value;
821
737
  this._recordIdsSet[recordId] = true;
822
738
  }
823
739
  } catch (err) {
824
- _didIteratorError10 = true;
825
- _iteratorError10 = err;
740
+ _iterator11.e(err);
826
741
  } finally {
827
- try {
828
- if (!_iteratorNormalCompletion10 && _iterator10.return != null) {
829
- _iterator10.return();
830
- }
831
- } finally {
832
- if (_didIteratorError10) {
833
- throw _iteratorError10;
834
- }
835
- }
742
+ _iterator11.f();
836
743
  }
837
-
838
- var _iteratorNormalCompletion11 = true;
839
- var _didIteratorError11 = false;
840
- var _iteratorError11 = undefined;
841
-
744
+ var _iterator12 = _createForOfIteratorHelper(removedRecordIds),
745
+ _step12;
842
746
  try {
843
- for (var _iterator11 = removedRecordIds[Symbol.iterator](), _step11; !(_iteratorNormalCompletion11 = (_step11 = _iterator11.next()).done); _iteratorNormalCompletion11 = true) {
844
- var _recordId = _step11.value;
747
+ for (_iterator12.s(); !(_step12 = _iterator12.n()).done;) {
748
+ var _recordId = _step12.value;
845
749
  this._recordIdsSet[_recordId] = undefined;
846
750
  }
847
751
  } catch (err) {
848
- _didIteratorError11 = true;
849
- _iteratorError11 = err;
752
+ _iterator12.e(err);
850
753
  } finally {
851
- try {
852
- if (!_iteratorNormalCompletion11 && _iterator11.return != null) {
853
- _iterator11.return();
854
- }
855
- } finally {
856
- if (_didIteratorError11) {
857
- throw _iteratorError11;
858
- }
859
- }
754
+ _iterator12.f();
860
755
  }
861
- } // Now that we've applied our changes (if applicable), let's regenerate our recordIds.
862
-
756
+ }
863
757
 
758
+ // Now that we've applied our changes (if applicable), let's regenerate our recordIds.
864
759
  this._orderedRecordIds = this._generateOrderedRecordIds();
865
-
866
760
  this._onChange(_record_query_result.default.WatchableKeys.records, updates);
867
-
868
761
  this._onChange(_record_query_result.default.WatchableKeys.recordIds, updates);
869
762
  }
870
763
  /** @internal */
871
764
  // istanbul ignore next
872
-
873
765
  }, {
874
766
  key: "_onCellValuesForGroupChanged",
875
- value: function _onCellValuesForGroupChanged(recordStore, key, recordIds, fieldId) {} // TODO(SeanKeenan): This isn't yet required as we don't yet support
876
- // specifying groups for a custom query, and this will only be called
877
- // if we specify groups (same as _onCellValuesForSortChanged)
878
- // This functionality and _onCellValuesForSortChanged should be
879
- // identical, but testing, validation, and careful thought is required.
880
-
767
+ value: function _onCellValuesForGroupChanged(recordStore, key, recordIds, fieldId) {
768
+ // TODO(SeanKeenan): This isn't yet required as we don't yet support
769
+ // specifying groups for a custom query, and this will only be called
770
+ // if we specify groups (same as _onCellValuesForSortChanged)
771
+ // This functionality and _onCellValuesForSortChanged should be
772
+ // identical, but testing, validation, and careful thought is required.
773
+ }
881
774
  /** @internal */
882
-
883
775
  }, {
884
776
  key: "_onCellValuesForSortChanged",
885
777
  value: function _onCellValuesForSortChanged(recordStore, key, recordIds, fieldId) {
@@ -888,38 +780,34 @@ function (_RecordQueryResult) {
888
780
  // callback when the record set is loaded (and we don't want to fire
889
781
  // a records change twice with no data).
890
782
  return;
891
- } // NOTE: this will only ever be called if we have sorts, so it's safe to assert that we have
892
- // a vis list here.
893
-
783
+ }
894
784
 
785
+ // NOTE: this will only ever be called if we have sorts, so it's safe to assert that we have
786
+ // a vis list here.
895
787
  var visList = this._visList;
896
788
  (0, _error_utils.invariant)(visList, 'No vis list');
897
- (0, _error_utils.invariant)(recordIds.length > 0, 'field ID set without a corresponding record ID'); // Only move recordIds that are already in the visList.
789
+ (0, _error_utils.invariant)(recordIds.length > 0, 'field ID set without a corresponding record ID');
790
+
791
+ // Only move recordIds that are already in the visList.
898
792
  // It's possible to have recordId that is not currently in the visList since
899
793
  // this callback can run before onRecordsChanged. (eg. when a deleted record is
900
794
  // restored, this is triggered for that record but the record is not yet in the visList:
901
795
  // onRecordsChanged actually adds it)
902
796
  // Note: cell value changes that result in the records being filtered out trigger
903
797
  // onRecordsChanged on the View model, so we don't have to worry about that here.
904
-
905
798
  var visListRecordIdsSet = new Set(visList.getOrderedRecordIds());
906
799
  var recordIdsToMove = recordIds.filter(recordId => visListRecordIdsSet.has(recordId));
907
800
  visList.removeRecordIds(recordIdsToMove);
908
-
909
801
  this._addRecordIdsToVisList(recordIdsToMove);
910
-
911
802
  this._orderedRecordIds = this._generateOrderedRecordIds();
912
803
  var changeData = {
913
804
  addedRecordIds: [],
914
805
  removedRecordIds: []
915
806
  };
916
-
917
807
  this._onChange(_record_query_result.default.WatchableKeys.records, changeData);
918
-
919
808
  this._onChange(_record_query_result.default.WatchableKeys.recordIds, changeData);
920
809
  }
921
810
  /** @internal */
922
-
923
811
  }, {
924
812
  key: "_onFieldConfigChanged",
925
813
  value: function _onFieldConfigChanged(_field, _key) {
@@ -927,11 +815,9 @@ function (_RecordQueryResult) {
927
815
  // NOTE: this will only ever be called if we have sorts, so it's safe to assume we
928
816
  // are using a vis list here.
929
817
  this._replaceVisList();
930
-
931
818
  this._orderedRecordIds = this._generateOrderedRecordIds();
932
819
  }
933
820
  /** @internal */
934
-
935
821
  }, {
936
822
  key: "_onTableFieldsChanged",
937
823
  value: function _onTableFieldsChanged(table, key, updates) {
@@ -939,77 +825,60 @@ function (_RecordQueryResult) {
939
825
  // If we don't have any sorts, we don't have to do anything in response to field changes.
940
826
  return;
941
827
  }
942
-
943
828
  var addedFieldIds = updates.addedFieldIds,
944
- removedFieldIds = updates.removedFieldIds;
945
- var fieldIdsSet = new Set(this._sorts.map(sort => sort.fieldId)); // Check if any fields that we rely on were created or deleted. If they were,
829
+ removedFieldIds = updates.removedFieldIds;
830
+ var fieldIdsSet = new Set(this._sorts.map(sort => sort.fieldId));
831
+
832
+ // Check if any fields that we rely on were created or deleted. If they were,
946
833
  // replace our vis list.
947
834
  // NOTE: we need to check for created, since a field that we rely on can be
948
835
  // deleted and then undeleted.
949
-
950
836
  var wereAnyFieldsCreatedOrDeleted = false;
951
- var _iteratorNormalCompletion12 = true;
952
- var _didIteratorError12 = false;
953
- var _iteratorError12 = undefined;
954
-
837
+ var _iterator13 = _createForOfIteratorHelper(addedFieldIds),
838
+ _step13;
955
839
  try {
956
- for (var _iterator12 = addedFieldIds[Symbol.iterator](), _step12; !(_iteratorNormalCompletion12 = (_step12 = _iterator12.next()).done); _iteratorNormalCompletion12 = true) {
957
- var fieldId = _step12.value;
958
-
840
+ for (_iterator13.s(); !(_step13 = _iterator13.n()).done;) {
841
+ var fieldId = _step13.value;
959
842
  // If a field that we rely on was created (i.e. it was undeleted), we need to
960
843
  // make sure we're watching it's config.
961
844
  if (fieldIdsSet.has(fieldId)) {
962
845
  wereAnyFieldsCreatedOrDeleted = true;
963
-
964
846
  var field = this._table.getFieldByIdIfExists(fieldId);
965
-
966
847
  (0, _error_utils.invariant)(field, 'Created field does not exist');
967
848
  field.watch('type', this._onFieldConfigChanged, this);
968
849
  field.watch('options', this._onFieldConfigChanged, this);
969
850
  }
970
- } // coverage analysis
971
- // istanbul ignore else
851
+ }
972
852
 
853
+ // coverage analysis
854
+ // istanbul ignore else
973
855
  } catch (err) {
974
- _didIteratorError12 = true;
975
- _iteratorError12 = err;
856
+ _iterator13.e(err);
976
857
  } finally {
977
- try {
978
- if (!_iteratorNormalCompletion12 && _iterator12.return != null) {
979
- _iterator12.return();
980
- }
981
- } finally {
982
- if (_didIteratorError12) {
983
- throw _iteratorError12;
984
- }
985
- }
858
+ _iterator13.f();
986
859
  }
987
-
988
860
  if (!wereAnyFieldsCreatedOrDeleted) {
989
861
  wereAnyFieldsCreatedOrDeleted = removedFieldIds.some(fieldId => fieldIdsSet.has(fieldId));
990
862
  }
991
-
992
863
  if (wereAnyFieldsCreatedOrDeleted) {
993
864
  // One of the fields we're relying on was deleted,
994
865
  this._replaceVisList();
866
+ this._orderedRecordIds = this._generateOrderedRecordIds();
995
867
 
996
- this._orderedRecordIds = this._generateOrderedRecordIds(); // Make sure we fire onChange events since the order may have changed
868
+ // Make sure we fire onChange events since the order may have changed
997
869
  // as a result.
998
-
999
870
  var changeData = {
1000
871
  addedRecordIds: [],
1001
872
  removedRecordIds: []
1002
873
  };
1003
-
1004
874
  this._onChange(_record_query_result.default.WatchableKeys.records, changeData);
875
+ this._onChange(_record_query_result.default.WatchableKeys.recordIds, changeData);
1005
876
 
1006
- this._onChange(_record_query_result.default.WatchableKeys.recordIds, changeData); // We do not unload/reload groupQueryResults if it's field is deleted as
877
+ // We do not unload/reload groupQueryResults if it's field is deleted as
1007
878
  // it is responsible for failing to load if the field doesn't exist
1008
-
1009
879
  }
1010
880
  }
1011
881
  /** @internal */
1012
-
1013
882
  }, {
1014
883
  key: "_onCellValuesChanged",
1015
884
  value: function _onCellValuesChanged(table, key, updates) {
@@ -1019,11 +888,9 @@ function (_RecordQueryResult) {
1019
888
  // a cellValues change twice with no data).
1020
889
  return;
1021
890
  }
1022
-
1023
891
  this._onChange(_record_query_result.default.WatchableKeys.cellValues, updates);
1024
892
  }
1025
893
  /** @internal */
1026
-
1027
894
  }, {
1028
895
  key: "_onCellValuesInFieldChanged",
1029
896
  value: function _onCellValuesInFieldChanged(table, key, recordIds, fieldId) {
@@ -1033,11 +900,9 @@ function (_RecordQueryResult) {
1033
900
  // a cellValuesInField change twice with no data).
1034
901
  return;
1035
902
  }
1036
-
1037
903
  this._onChange(key, recordIds, fieldId);
1038
904
  }
1039
905
  /** @internal */
1040
-
1041
906
  }, {
1042
907
  key: "_generateOrderedRecordIds",
1043
908
  value: function _generateOrderedRecordIds() {
@@ -1049,7 +914,6 @@ function (_RecordQueryResult) {
1049
914
  }
1050
915
  }
1051
916
  /** @internal */
1052
-
1053
917
  }, {
1054
918
  key: "_generateAndLoadOrderedGroups",
1055
919
  value: function _generateAndLoadOrderedGroups() {
@@ -1060,49 +924,34 @@ function (_RecordQueryResult) {
1060
924
  } else {
1061
925
  // Get the group from the view itself
1062
926
  var groupLevels = this._sourceModelGroupLevels;
1063
-
1064
927
  if (!this._sourceModelGroups || !groupLevels) {
1065
928
  return null;
1066
929
  }
1067
-
1068
930
  return this._sourceModelGroups.map(groupData => {
1069
- var group = this.__groupedRecordQueryResultPool.getObjectForReuse(this, groupData, groupLevels, this._normalizedOpts, this._sdk); // Don't await the loading, let others check isDataLoaded.
931
+ var group = this.__groupedRecordQueryResultPool.getObjectForReuse(this, groupData, groupLevels, this._normalizedOpts, this._sdk);
932
+ // Don't await the loading, let others check isDataLoaded.
1070
933
  // (it doesn't take any time anyway). Loading also strong retains.
1071
-
1072
-
1073
934
  group.loadDataAsync();
1074
935
  return group;
1075
936
  });
1076
937
  }
1077
938
  }
1078
939
  /** @internal */
1079
-
1080
940
  }, {
1081
941
  key: "_unloadOrderedGroupsIfNeeded",
1082
942
  value: function _unloadOrderedGroupsIfNeeded() {
1083
943
  if (this._orderedGroups) {
1084
- var _iteratorNormalCompletion13 = true;
1085
- var _didIteratorError13 = false;
1086
- var _iteratorError13 = undefined;
1087
-
944
+ var _iterator14 = _createForOfIteratorHelper(this._orderedGroups),
945
+ _step14;
1088
946
  try {
1089
- for (var _iterator13 = this._orderedGroups[Symbol.iterator](), _step13; !(_iteratorNormalCompletion13 = (_step13 = _iterator13.next()).done); _iteratorNormalCompletion13 = true) {
1090
- var group = _step13.value;
947
+ for (_iterator14.s(); !(_step14 = _iterator14.n()).done;) {
948
+ var group = _step14.value;
1091
949
  group.unloadData();
1092
950
  }
1093
951
  } catch (err) {
1094
- _didIteratorError13 = true;
1095
- _iteratorError13 = err;
952
+ _iterator14.e(err);
1096
953
  } finally {
1097
- try {
1098
- if (!_iteratorNormalCompletion13 && _iterator13.return != null) {
1099
- _iterator13.return();
1100
- }
1101
- } finally {
1102
- if (_didIteratorError13) {
1103
- throw _iteratorError13;
1104
- }
1105
- }
954
+ _iterator14.f();
1106
955
  }
1107
956
  }
1108
957
  }
@@ -1117,252 +966,48 @@ function (_RecordQueryResult) {
1117
966
  // In the meantime it's not too expensive to just unload everything, and GroupedRecordQueryResults
1118
967
  // don't yet properly watch changes relevant to updating, so this isn't too bad.
1119
968
  // (They do invalidate their recordId caches, which is some very cheap work that we could remove)
1120
-
1121
969
  }, {
1122
970
  key: "_unloadRemovedGroupsAndLoadNewGroupsAndTriggerWatches",
1123
971
  value: function _unloadRemovedGroupsAndLoadNewGroupsAndTriggerWatches() {
1124
972
  this._unloadOrderedGroupsIfNeeded();
1125
-
1126
973
  this._orderedGroups = this._generateAndLoadOrderedGroups();
1127
-
1128
974
  this._onChange(_record_query_result.default.WatchableKeys.groups);
1129
975
  }
1130
976
  /** @internal */
1131
-
1132
977
  }, {
1133
978
  key: "_replaceVisList",
1134
979
  value: function _replaceVisList() {
1135
980
  var airtableInterface = this._sdk.__airtableInterface;
1136
981
  var appInterface = this._sdk.__appInterface;
1137
-
1138
982
  var recordDatas = this._sourceModelRecords.map(record => record._data);
1139
-
1140
983
  var fieldDatas = this._table.fields.map(field => field._data);
1141
-
1142
984
  var filteredSorts = this._getSortsWithDeletedFieldsFiltered();
1143
-
1144
985
  this._visList = airtableInterface.createVisList(appInterface, recordDatas, fieldDatas, filteredSorts);
1145
986
  }
1146
987
  /** @internal */
1147
-
1148
988
  }, {
1149
989
  key: "_getSortsWithDeletedFieldsFiltered",
1150
990
  value: function _getSortsWithDeletedFieldsFiltered() {
1151
- (0, _error_utils.invariant)(this._sorts, 'No sorts'); // Filter out any sorts levels that rely on deleted fields.
991
+ (0, _error_utils.invariant)(this._sorts, 'No sorts');
992
+
993
+ // Filter out any sorts levels that rely on deleted fields.
1152
994
  // NOTE: we keep deleted fields around (rather than filtering them out
1153
995
  // in realtime) in case a field gets undeleted, in which case we want to
1154
996
  // keep using it.
1155
-
1156
997
  return this._sorts.filter(sort => {
1157
998
  var field = this._table.getFieldByIdIfExists(sort.fieldId);
1158
-
1159
999
  return !!field;
1160
1000
  });
1161
1001
  }
1162
1002
  /** @internal */
1163
-
1164
1003
  }, {
1165
1004
  key: "_spawnErrorForDeletion",
1166
1005
  value: function _spawnErrorForDeletion() {
1167
1006
  var sourceModelName = this._sourceModel instanceof _table.default ? 'table' : 'view';
1168
1007
  return (0, _error_utils.spawnError)("RecordQueryResult's underlying %s has been deleted", sourceModelName);
1169
1008
  }
1170
- }, {
1171
- key: "_dataOrNullIfDeleted",
1172
- get: function get() {
1173
- if (this._sourceModel.isDeleted || this._recordStore.isDeleted) {
1174
- return null;
1175
- }
1176
-
1177
- return {
1178
- recordIds: this._orderedRecordIds,
1179
- groups: this._orderedGroups,
1180
- groupLevels: this._loadedGroupLevels
1181
- };
1182
- }
1183
- /** @internal */
1184
- // istanbul ignore next
1185
-
1186
- }, {
1187
- key: "__sourceModelId",
1188
- get: function get() {
1189
- return this._sourceModel.id;
1190
- }
1191
- /** @internal */
1192
-
1193
- }, {
1194
- key: "__poolKey",
1195
- get: function get() {
1196
- return "".concat(this._serializedOpts, "::").concat(this._sourceModel.id);
1197
- }
1198
- /**
1199
- * @internal (since we may not be able to return parent model instances in the immutable models world)
1200
- * The table that records in this RecordQueryResult are part of
1201
- */
1202
-
1203
- }, {
1204
- key: "parentTable",
1205
- get: function get() {
1206
- return this._table;
1207
- }
1208
- /**
1209
- * @internal (since we may not be able to return parent model instances in the immutable models world)
1210
- * The view that was used to obtain this RecordQueryResult by calling
1211
- * `view.selectRecords`. Null if the RecordQueryResult was obtained by calling
1212
- * `table.selectRecords`.
1213
- */
1214
-
1215
- }, {
1216
- key: "parentView",
1217
- get: function get() {
1218
- return this._sourceModel instanceof _table.default ? null : this._sourceModel;
1219
- }
1220
- /**
1221
- * The record IDs in this RecordQueryResult.
1222
- * Throws if data is not loaded yet.
1223
- * Can be watched.
1224
- */
1225
-
1226
- }, {
1227
- key: "recordIds",
1228
- get: function get() {
1229
- // The following statements have been carefully sequenced to ensure
1230
- // that when this method fails, it reports the most salient error.
1231
- var recordIds = this._data.recordIds; // Throws when the model has been deleted.
1232
-
1233
- (0, _error_utils.invariant)(this.isDataLoaded, 'RecordQueryResult data is not loaded');
1234
- (0, _error_utils.invariant)(recordIds, 'No recordIds');
1235
- return recordIds;
1236
- }
1237
- /**
1238
- * The ordered GroupedRecordQueryResult's in this RecordQueryResult.
1239
- * Throws if data is not loaded yet.
1240
- * Can be watched.
1241
- *
1242
- * @hidden
1243
- */
1244
-
1245
- }, {
1246
- key: "groups",
1247
- get: function get() {
1248
- // The following statements have been carefully sequenced to ensure
1249
- // that when this method fails, it reports the most salient error.
1250
- var groups = this._data.groups; // Throws when the model has been deleted.
1251
-
1252
- (0, _error_utils.invariant)(this.isDataLoaded, 'RecordQueryResult data is not loaded');
1253
- return groups !== null && groups !== void 0 ? groups : null;
1254
- }
1255
- /**
1256
- * The GroupLevels in this RecordQueryResult.
1257
- * Throws if data is not loaded yet.
1258
- * Can be watched.
1259
- *
1260
- * @hidden
1261
- */
1262
-
1263
- }, {
1264
- key: "groupLevels",
1265
- get: function get() {
1266
- var groupLevels = this._data.groupLevels; // Throws when the model has been deleted.
1267
-
1268
- (0, _error_utils.invariant)(this.isDataLoaded, 'RecordQueryResult data is not loaded');
1269
- return groupLevels ? groupLevels.map(singleLevel => _objectSpread({}, singleLevel, {
1270
- field: this.parentTable.getFieldById(singleLevel.fieldId)
1271
- })) : null;
1272
- }
1273
- }, {
1274
- key: "fields",
1275
- get: function get() {
1276
- var fieldIdsOrNullIfAllFields = this._normalizedOpts.fieldIdsOrNullIfAllFields;
1277
-
1278
- if (fieldIdsOrNullIfAllFields) {
1279
- var fields = []; // Filter out any deleted fields, since RecordQueryResult is "live".
1280
- // It would be too cumbersome (and defeat part of the purpose of
1281
- // using RecordQueryResult) if the user had to manually watch for deletion
1282
- // on all the fields and recreate the RecordQueryResult.
1283
-
1284
- var _iteratorNormalCompletion14 = true;
1285
- var _didIteratorError14 = false;
1286
- var _iteratorError14 = undefined;
1287
-
1288
- try {
1289
- for (var _iterator14 = fieldIdsOrNullIfAllFields[Symbol.iterator](), _step14; !(_iteratorNormalCompletion14 = (_step14 = _iterator14.next()).done); _iteratorNormalCompletion14 = true) {
1290
- var fieldId = _step14.value;
1291
-
1292
- var field = this._table.getFieldByIdIfExists(fieldId);
1293
-
1294
- if (field !== null) {
1295
- fields.push(field);
1296
- }
1297
- }
1298
- } catch (err) {
1299
- _didIteratorError14 = true;
1300
- _iteratorError14 = err;
1301
- } finally {
1302
- try {
1303
- if (!_iteratorNormalCompletion14 && _iterator14.return != null) {
1304
- _iterator14.return();
1305
- }
1306
- } finally {
1307
- if (_didIteratorError14) {
1308
- throw _iteratorError14;
1309
- }
1310
- }
1311
- }
1312
-
1313
- return fields;
1314
- } else {
1315
- return null;
1316
- }
1317
- }
1318
- /** @internal */
1319
-
1320
- }, {
1321
- key: "_cellValuesForSortWatchKeys",
1322
- get: function get() {
1323
- return this._sorts ? this._sorts.map(sort => "cellValuesInField:".concat(sort.fieldId)) : [];
1324
- }
1325
- /** @internal */
1326
-
1327
- }, {
1328
- key: "_cellValuesForGroupWatchKeys",
1329
- get: function get() {
1330
- // _groupLevels can not be specified by the user during the query yet
1331
- // istanbul ignore next
1332
- return this._groupLevels ? this._groupLevels.map(group => "cellValuesInField:".concat(group.fieldId)) : [];
1333
- }
1334
- /** @internal */
1335
-
1336
- }, {
1337
- key: "_sourceModelRecordIds",
1338
- get: function get() {
1339
- return this._sourceModel instanceof _table.default ? this._recordStore.recordIds : this._recordStore.getViewDataStore(this._sourceModel.id).visibleRecordIds;
1340
- }
1341
- /** @internal */
1342
-
1343
- }, {
1344
- key: "_sourceModelGroups",
1345
- get: function get() {
1346
- return this._sourceModel instanceof _table.default ? null : this._recordStore.getViewDataStore(this._sourceModel.id).groups;
1347
- }
1348
- /** @internal */
1349
-
1350
- }, {
1351
- key: "_sourceModelGroupLevels",
1352
- get: function get() {
1353
- return this._sourceModel instanceof _table.default ? null : this._recordStore.getViewDataStore(this._sourceModel.id).groupLevels;
1354
- }
1355
- /** @internal */
1356
-
1357
- }, {
1358
- key: "_sourceModelRecords",
1359
- get: function get() {
1360
- return this._sourceModel instanceof _table.default ? this._recordStore.records : this._recordStore.getViewDataStore(this._sourceModel.id).visibleRecords;
1361
- }
1362
1009
  }]);
1363
- return TableOrViewQueryResult;
1364
1010
  }(_record_query_result.default);
1365
-
1011
+ /** @internal */
1366
1012
  (0, _defineProperty2.default)(TableOrViewQueryResult, "_className", 'TableOrViewQueryResult');
1367
- var _default = TableOrViewQueryResult;
1368
- exports.default = _default;
1013
+ var _default = exports.default = TableOrViewQueryResult;