@airtable/blocks 0.0.0-experimental-f52bc4e5e-20250709 → 0.0.0-experimental-3649c7162-20250904
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.
- package/dist/esm/base/assert_run_context.js +12 -0
- package/dist/{cjs → esm}/base/index.js +30 -32
- package/dist/esm/base/models/abstract_model_with_async_data.js +190 -0
- package/dist/esm/base/models/base.js +252 -0
- package/dist/esm/base/models/create_aggregators.js +90 -0
- package/dist/esm/base/models/cursor.js +305 -0
- package/dist/esm/base/models/field.js +338 -0
- package/dist/esm/base/models/grouped_record_query_result.js +280 -0
- package/dist/esm/base/models/linked_records_query_result.js +553 -0
- package/dist/{cjs → esm}/base/models/models.js +19 -40
- package/dist/esm/base/models/mutations.js +312 -0
- package/dist/esm/base/models/object_pool.js +145 -0
- package/dist/esm/base/models/record.js +239 -0
- package/dist/{cjs → esm}/base/models/record_coloring.js +6 -6
- package/dist/esm/base/models/record_query_result.js +657 -0
- package/dist/esm/base/models/record_store.js +475 -0
- package/dist/esm/base/models/session.js +154 -0
- package/dist/esm/base/models/table.js +520 -0
- package/dist/esm/base/models/table_or_view_query_result.js +749 -0
- package/dist/esm/base/models/view.js +326 -0
- package/dist/esm/base/models/view_data_store.js +265 -0
- package/dist/esm/base/models/view_metadata_query_result.js +176 -0
- package/dist/esm/base/perform_record_action.js +215 -0
- package/dist/esm/base/sdk.js +178 -0
- package/dist/esm/base/settings_button.js +118 -0
- package/dist/{cjs → esm}/base/types/airtable_interface.js +1 -1
- package/dist/{cjs → esm}/base/types/mutations.js +5 -11
- package/dist/{cjs → esm}/base/types/undo_redo.js +1 -1
- package/dist/{cjs → esm}/base/types/view.js +1 -1
- package/dist/{cjs → esm}/base/ui/base_provider.js +6 -8
- package/dist/esm/base/ui/baymax_utils.js +461 -0
- package/dist/esm/base/ui/block_wrapper.js +118 -0
- package/dist/esm/base/ui/box.js +84 -0
- package/dist/esm/base/ui/button.js +152 -0
- package/dist/esm/base/ui/cell_renderer.js +198 -0
- package/dist/esm/base/ui/choice_token.js +93 -0
- package/dist/esm/base/ui/collaborator_token.js +123 -0
- package/dist/esm/base/ui/color_palette.js +196 -0
- package/dist/esm/base/ui/color_palette_synced.js +69 -0
- package/dist/esm/base/ui/confirmation_dialog.js +103 -0
- package/dist/{cjs → esm}/base/ui/control_sizes.js +24 -22
- package/dist/{cjs → esm}/base/ui/create_detect_element_resize.js +6 -10
- package/dist/{cjs → esm}/base/ui/css_helpers.js +1 -1
- package/dist/esm/base/ui/dialog.js +101 -0
- package/dist/esm/base/ui/dialog_close_button.js +106 -0
- package/dist/{cjs → esm}/base/ui/expand_record.js +1 -2
- package/dist/{cjs → esm}/base/ui/expand_record_list.js +3 -4
- package/dist/esm/base/ui/expand_record_picker_async.js +71 -0
- package/dist/esm/base/ui/field_icon.js +44 -0
- package/dist/esm/base/ui/field_picker.js +98 -0
- package/dist/esm/base/ui/field_picker_synced.js +66 -0
- package/dist/esm/base/ui/form_field.js +109 -0
- package/dist/{cjs → esm}/base/ui/geometry/geometry.js +5 -5
- package/dist/esm/base/ui/geometry/point.js +19 -0
- package/dist/esm/base/ui/geometry/rect.js +51 -0
- package/dist/esm/base/ui/geometry/size.js +19 -0
- package/dist/esm/base/ui/global_alert.js +71 -0
- package/dist/esm/base/ui/heading.js +132 -0
- package/dist/esm/base/ui/icon.js +109 -0
- package/dist/{cjs → esm}/base/ui/icon_config.js +6 -12
- package/dist/{cjs → esm}/base/ui/initialize_block.js +16 -35
- package/dist/esm/base/ui/input.js +161 -0
- package/dist/esm/base/ui/input_synced.js +66 -0
- package/dist/{cjs → esm}/base/ui/key_codes.js +2 -3
- package/dist/esm/base/ui/label.js +80 -0
- package/dist/esm/base/ui/link.js +196 -0
- package/dist/esm/base/ui/loader.js +61 -0
- package/dist/esm/base/ui/modal.js +145 -0
- package/dist/esm/base/ui/model_picker_select.js +57 -0
- package/dist/esm/base/ui/popover.js +315 -0
- package/dist/esm/base/ui/progress_bar.js +115 -0
- package/dist/esm/base/ui/record_card.js +564 -0
- package/dist/esm/base/ui/record_card_list.js +303 -0
- package/dist/esm/base/ui/select.js +191 -0
- package/dist/esm/base/ui/select_and_select_buttons_helpers.js +63 -0
- package/dist/esm/base/ui/select_buttons.js +159 -0
- package/dist/esm/base/ui/select_buttons_synced.js +62 -0
- package/dist/esm/base/ui/select_synced.js +65 -0
- package/dist/esm/base/ui/switch.js +167 -0
- package/dist/esm/base/ui/switch_synced.js +53 -0
- package/dist/esm/base/ui/synced.js +49 -0
- package/dist/{cjs → esm}/base/ui/system/all_styles_set.js +4 -12
- package/dist/esm/base/ui/system/appearance/appearance_set.js +27 -0
- package/dist/esm/base/ui/system/appearance/background_color.js +18 -0
- package/dist/{cjs → esm}/base/ui/system/appearance/border.js +3 -6
- package/dist/esm/base/ui/system/appearance/border_radius.js +18 -0
- package/dist/esm/base/ui/system/appearance/box_shadow.js +18 -0
- package/dist/esm/base/ui/system/appearance/opacity.js +18 -0
- package/dist/esm/base/ui/system/dimensions/dimensions_set.js +29 -0
- package/dist/esm/base/ui/system/dimensions/height.js +18 -0
- package/dist/esm/base/ui/system/dimensions/max_height.js +18 -0
- package/dist/esm/base/ui/system/dimensions/max_width.js +18 -0
- package/dist/esm/base/ui/system/dimensions/min_height.js +18 -0
- package/dist/esm/base/ui/system/dimensions/min_width.js +18 -0
- package/dist/esm/base/ui/system/dimensions/width.js +18 -0
- package/dist/esm/base/ui/system/display.js +19 -0
- package/dist/esm/base/ui/system/flex_container/align_content.js +15 -0
- package/dist/esm/base/ui/system/flex_container/align_items.js +15 -0
- package/dist/esm/base/ui/system/flex_container/flex_container_set.js +29 -0
- package/dist/esm/base/ui/system/flex_container/flex_direction.js +15 -0
- package/dist/esm/base/ui/system/flex_container/flex_wrap.js +15 -0
- package/dist/esm/base/ui/system/flex_container/justify_content.js +15 -0
- package/dist/esm/base/ui/system/flex_container/justify_items.js +16 -0
- package/dist/esm/base/ui/system/flex_item/align_self.js +15 -0
- package/dist/esm/base/ui/system/flex_item/flex.js +15 -0
- package/dist/esm/base/ui/system/flex_item/flex_basis.js +15 -0
- package/dist/esm/base/ui/system/flex_item/flex_grow.js +15 -0
- package/dist/esm/base/ui/system/flex_item/flex_item_set.js +31 -0
- package/dist/esm/base/ui/system/flex_item/flex_shrink.js +15 -0
- package/dist/esm/base/ui/system/flex_item/justify_self.js +16 -0
- package/dist/esm/base/ui/system/flex_item/order.js +15 -0
- package/dist/{cjs → esm}/base/ui/system/index.js +104 -416
- package/dist/esm/base/ui/system/overflow.js +21 -0
- package/dist/{cjs → esm}/base/ui/system/position/bottom.js +4 -6
- package/dist/{cjs → esm}/base/ui/system/position/left.js +4 -6
- package/dist/esm/base/ui/system/position/position.js +15 -0
- package/dist/esm/base/ui/system/position/position_set.js +29 -0
- package/dist/{cjs → esm}/base/ui/system/position/right.js +4 -6
- package/dist/{cjs → esm}/base/ui/system/position/top.js +4 -6
- package/dist/esm/base/ui/system/position/z_index.js +18 -0
- package/dist/{cjs → esm}/base/ui/system/spacing/margin.js +4 -6
- package/dist/{cjs → esm}/base/ui/system/spacing/padding.js +4 -6
- package/dist/esm/base/ui/system/spacing/spacing_set.js +21 -0
- package/dist/esm/base/ui/system/typography/font_family.js +18 -0
- package/dist/esm/base/ui/system/typography/font_size.js +18 -0
- package/dist/esm/base/ui/system/typography/font_style.js +15 -0
- package/dist/esm/base/ui/system/typography/font_weight.js +18 -0
- package/dist/esm/base/ui/system/typography/letter_spacing.js +18 -0
- package/dist/esm/base/ui/system/typography/line_height.js +15 -0
- package/dist/esm/base/ui/system/typography/text_align.js +15 -0
- package/dist/esm/base/ui/system/typography/text_color.js +18 -0
- package/dist/esm/base/ui/system/typography/text_decoration.js +15 -0
- package/dist/esm/base/ui/system/typography/text_transform.js +15 -0
- package/dist/esm/base/ui/system/typography/typography_set.js +37 -0
- package/dist/{cjs → esm}/base/ui/system/utils/ensure_numbers_are_within_scale.js +3 -4
- package/dist/esm/base/ui/system/utils/get_style_props_for_responsive_prop.js +73 -0
- package/dist/esm/base/ui/table_picker.js +71 -0
- package/dist/esm/base/ui/table_picker_synced.js +62 -0
- package/dist/esm/base/ui/text.js +117 -0
- package/dist/esm/base/ui/text_button.js +196 -0
- package/dist/{cjs → esm}/base/ui/theme/default_theme/button_variants.js +3 -3
- package/dist/esm/base/ui/theme/default_theme/control_sizes.js +102 -0
- package/dist/{cjs → esm}/base/ui/theme/default_theme/heading_styles.js +1 -1
- package/dist/{cjs → esm}/base/ui/theme/default_theme/index.js +9 -15
- package/dist/{cjs → esm}/base/ui/theme/default_theme/input_variants.js +3 -3
- package/dist/{cjs → esm}/base/ui/theme/default_theme/link_variants.js +3 -3
- package/dist/{cjs → esm}/base/ui/theme/default_theme/select_buttons_variants.js +4 -4
- package/dist/esm/base/ui/theme/default_theme/select_variants.js +50 -0
- package/dist/esm/base/ui/theme/default_theme/switch_variants.js +85 -0
- package/dist/{cjs → esm}/base/ui/theme/default_theme/text_button_variants.js +5 -5
- package/dist/{cjs → esm}/base/ui/theme/default_theme/text_styles.js +1 -1
- package/dist/{cjs → esm}/base/ui/theme/default_theme/tokens.js +14 -14
- package/dist/{cjs → esm}/base/ui/theme/theme_context.js +2 -2
- package/dist/{cjs → esm}/base/ui/theme/use_theme.js +2 -2
- package/dist/esm/base/ui/tooltip.js +175 -0
- package/dist/{cjs → esm}/base/ui/ui.js +48 -49
- package/dist/{cjs → esm}/base/ui/unstable_standalone_ui.js +27 -27
- package/dist/{cjs → esm}/base/ui/use_base.js +1 -1
- package/dist/{cjs → esm}/base/ui/use_cursor.js +5 -4
- package/dist/{cjs → esm}/base/ui/use_form_field.js +1 -1
- package/dist/{cjs → esm}/base/ui/use_loadable.js +25 -91
- package/dist/{cjs → esm}/base/ui/use_record_action_data.js +4 -3
- package/dist/{cjs → esm}/base/ui/use_records.js +9 -13
- package/dist/{cjs → esm}/base/ui/use_session.js +1 -1
- package/dist/{cjs → esm}/base/ui/use_settings_button.js +4 -3
- package/dist/esm/base/ui/use_styled_system.js +25 -0
- package/dist/{cjs → esm}/base/ui/use_text_color_for_background_color.js +4 -3
- package/dist/{cjs → esm}/base/ui/use_view_metadata.js +4 -4
- package/dist/{cjs → esm}/base/ui/use_viewport.js +2 -2
- package/dist/esm/base/ui/view_picker.js +89 -0
- package/dist/esm/base/ui/view_picker_synced.js +66 -0
- package/dist/esm/base/ui/viewport_constraint.js +129 -0
- package/dist/esm/base/ui/with_styled_system.js +129 -0
- package/dist/esm/base/undo_redo.js +37 -0
- package/dist/{cjs → esm}/base/unstable_testing_utils.js +27 -27
- package/dist/esm/base/viewport.js +353 -0
- package/dist/esm/injected/airtable_interface.js +22 -0
- package/dist/esm/interface/assert_run_context.js +12 -0
- package/dist/esm/interface/index.js +22 -0
- package/dist/esm/interface/models/base.js +35 -0
- package/dist/esm/interface/models/field.js +28 -0
- package/dist/{cjs → esm}/interface/models/models.js +8 -7
- package/dist/esm/interface/models/mutations.js +63 -0
- package/dist/esm/interface/models/record.js +51 -0
- package/dist/esm/interface/models/record_store.js +51 -0
- package/dist/esm/interface/models/session.js +28 -0
- package/dist/esm/interface/models/table.js +97 -0
- package/dist/esm/interface/sdk.js +78 -0
- package/dist/{cjs → esm}/interface/types/airtable_interface.js +2 -2
- package/dist/esm/interface/types/mutations.js +17 -0
- package/dist/esm/interface/ui/block_wrapper.js +69 -0
- package/dist/{cjs → esm}/interface/ui/initialize_block.js +13 -28
- package/dist/{cjs → esm}/interface/ui/ui.js +20 -19
- package/dist/{cjs → esm}/interface/ui/use_base.js +1 -1
- package/dist/{cjs → esm}/interface/ui/use_custom_properties.js +19 -35
- package/dist/{cjs → esm}/interface/ui/use_records.js +6 -5
- package/dist/{cjs → esm}/interface/ui/use_run_info.js +2 -2
- package/dist/{cjs → esm}/interface/ui/use_session.js +1 -1
- package/dist/{cjs → esm}/shared/color_utils.js +9 -16
- package/dist/{cjs → esm}/shared/colors.js +2 -2
- package/dist/{cjs → esm}/shared/error_utils.js +9 -11
- package/dist/{cjs → esm}/shared/event_tracker.js +3 -3
- package/dist/esm/shared/global_config.js +399 -0
- package/dist/esm/shared/models/abstract_model.js +94 -0
- package/dist/esm/shared/models/base_core.js +482 -0
- package/dist/esm/shared/models/field_core.js +288 -0
- package/dist/esm/shared/models/mutations_core.js +343 -0
- package/dist/esm/shared/models/record_core.js +215 -0
- package/dist/esm/shared/models/record_store_core.js +160 -0
- package/dist/esm/shared/models/session_core.js +160 -0
- package/dist/esm/shared/models/table_core.js +1318 -0
- package/dist/{cjs → esm}/shared/private_utils.js +54 -124
- package/dist/esm/shared/sdk_core.js +113 -0
- package/dist/{cjs → esm}/shared/types/field_core.js +1 -1
- package/dist/esm/shared/types/mutation_constants.js +11 -0
- package/dist/{cjs → esm}/shared/types/mutations_core.js +1 -1
- package/dist/{cjs → esm}/shared/types/permission_levels.js +1 -1
- package/dist/esm/shared/types/record.js +1 -0
- package/dist/esm/shared/types/stat.js +1 -0
- package/dist/esm/shared/types/table_core.js +1 -0
- package/dist/{cjs → esm}/shared/ui/global_config_synced_component_helpers.js +9 -9
- package/dist/esm/shared/ui/loader.js +47 -0
- package/dist/{cjs → esm}/shared/ui/remote_utils.js +5 -7
- package/dist/{cjs → esm}/shared/ui/sdk_context.js +4 -8
- package/dist/{cjs → esm}/shared/ui/use_array_identity.js +2 -2
- package/dist/{cjs → esm}/shared/ui/use_base.js +6 -5
- package/dist/{cjs → esm}/shared/ui/use_color_scheme.js +3 -8
- package/dist/{cjs → esm}/shared/ui/use_global_config.js +5 -4
- package/dist/{cjs → esm}/shared/ui/use_session.js +6 -5
- package/dist/{cjs → esm}/shared/ui/use_synced.js +7 -5
- package/dist/{cjs → esm}/shared/ui/use_watchable.js +13 -42
- package/dist/{cjs → esm}/shared/ui/with_hooks.js +6 -13
- package/dist/{cjs → esm}/shared/unstable_private_utils.js +4 -6
- package/dist/{cjs → esm}/shared/warning.js +5 -5
- package/dist/esm/shared/watchable.js +150 -0
- package/dist/esm/stats/block_stats.js +73 -0
- package/dist/esm/testing/base/abstract_mock_airtable_interface.js +208 -0
- package/dist/esm/testing/interface/abstract_mock_airtable_interface.js +124 -0
- package/dist/types/src/base/assert_run_context.d.ts +2 -0
- package/dist/types/src/base/assert_run_context.d.ts.map +1 -0
- package/dist/types/src/base/index.d.ts +1 -0
- package/dist/types/src/base/index.d.ts.map +1 -1
- package/dist/types/src/base/models/base.d.ts +19 -0
- package/dist/types/src/base/models/base.d.ts.map +1 -1
- package/dist/types/src/base/models/create_aggregators.d.ts +3 -4
- package/dist/types/src/base/models/create_aggregators.d.ts.map +1 -1
- package/dist/types/src/base/models/field.d.ts +3 -2
- package/dist/types/src/base/models/field.d.ts.map +1 -1
- package/dist/types/src/base/models/models.d.ts +1 -2
- package/dist/types/src/base/models/models.d.ts.map +1 -1
- package/dist/types/src/base/models/mutations.d.ts.map +1 -1
- package/dist/types/src/base/sdk.d.ts.map +1 -1
- package/dist/types/src/base/ui/block_wrapper.d.ts +1 -1
- package/dist/types/src/base/ui/box.d.ts.map +1 -1
- package/dist/types/src/base/ui/button.d.ts +0 -5
- package/dist/types/src/base/ui/button.d.ts.map +1 -1
- package/dist/types/src/base/ui/cell_renderer.d.ts +1 -22
- package/dist/types/src/base/ui/cell_renderer.d.ts.map +1 -1
- package/dist/types/src/base/ui/choice_token.d.ts +1 -21
- package/dist/types/src/base/ui/choice_token.d.ts.map +1 -1
- package/dist/types/src/base/ui/collaborator_token.d.ts +0 -20
- package/dist/types/src/base/ui/collaborator_token.d.ts.map +1 -1
- package/dist/types/src/base/ui/color_palette.d.ts +1 -32
- package/dist/types/src/base/ui/color_palette.d.ts.map +1 -1
- package/dist/types/src/base/ui/color_palette_synced.d.ts +0 -14
- package/dist/types/src/base/ui/color_palette_synced.d.ts.map +1 -1
- package/dist/types/src/base/ui/confirmation_dialog.d.ts +0 -17
- package/dist/types/src/base/ui/confirmation_dialog.d.ts.map +1 -1
- package/dist/types/src/base/ui/control_sizes.d.ts +0 -1
- package/dist/types/src/base/ui/control_sizes.d.ts.map +1 -1
- package/dist/types/src/base/ui/dialog.d.ts +1 -23
- package/dist/types/src/base/ui/dialog.d.ts.map +1 -1
- package/dist/types/src/base/ui/dialog_close_button.d.ts +2 -24
- package/dist/types/src/base/ui/dialog_close_button.d.ts.map +1 -1
- package/dist/types/src/base/ui/field_icon.d.ts +1 -17
- package/dist/types/src/base/ui/field_icon.d.ts.map +1 -1
- package/dist/types/src/base/ui/field_picker.d.ts +0 -23
- package/dist/types/src/base/ui/field_picker.d.ts.map +1 -1
- package/dist/types/src/base/ui/field_picker_synced.d.ts.map +1 -1
- package/dist/types/src/base/ui/form_field.d.ts +0 -4
- package/dist/types/src/base/ui/form_field.d.ts.map +1 -1
- package/dist/types/src/base/ui/heading.d.ts +1 -1
- package/dist/types/src/base/ui/heading.d.ts.map +1 -1
- package/dist/types/src/base/ui/icon.d.ts +0 -16
- package/dist/types/src/base/ui/icon.d.ts.map +1 -1
- package/dist/types/src/base/ui/icon_config.d.ts +50 -51
- package/dist/types/src/base/ui/icon_config.d.ts.map +1 -1
- package/dist/types/src/base/ui/initialize_block.d.ts.map +1 -1
- package/dist/types/src/base/ui/input.d.ts +12 -46
- package/dist/types/src/base/ui/input.d.ts.map +1 -1
- package/dist/types/src/base/ui/input_synced.d.ts.map +1 -1
- package/dist/types/src/base/ui/label.d.ts.map +1 -1
- package/dist/types/src/base/ui/link.d.ts +1 -5
- package/dist/types/src/base/ui/link.d.ts.map +1 -1
- package/dist/types/src/base/ui/loader.d.ts +3 -20
- package/dist/types/src/base/ui/loader.d.ts.map +1 -1
- package/dist/types/src/base/ui/modal.d.ts +1 -14
- package/dist/types/src/base/ui/modal.d.ts.map +1 -1
- package/dist/types/src/base/ui/model_picker_select.d.ts.map +1 -1
- package/dist/types/src/base/ui/popover.d.ts +1 -17
- package/dist/types/src/base/ui/popover.d.ts.map +1 -1
- package/dist/types/src/base/ui/progress_bar.d.ts +1 -24
- package/dist/types/src/base/ui/progress_bar.d.ts.map +1 -1
- package/dist/types/src/base/ui/record_card.d.ts +1 -23
- package/dist/types/src/base/ui/record_card.d.ts.map +1 -1
- package/dist/types/src/base/ui/record_card_list.d.ts +1 -18
- package/dist/types/src/base/ui/record_card_list.d.ts.map +1 -1
- package/dist/types/src/base/ui/select.d.ts +0 -44
- package/dist/types/src/base/ui/select.d.ts.map +1 -1
- package/dist/types/src/base/ui/select_and_select_buttons_helpers.d.ts +0 -2
- package/dist/types/src/base/ui/select_and_select_buttons_helpers.d.ts.map +1 -1
- package/dist/types/src/base/ui/select_buttons.d.ts +0 -22
- package/dist/types/src/base/ui/select_buttons.d.ts.map +1 -1
- package/dist/types/src/base/ui/select_buttons_synced.d.ts.map +1 -1
- package/dist/types/src/base/ui/select_synced.d.ts.map +1 -1
- package/dist/types/src/base/ui/switch.d.ts +0 -22
- package/dist/types/src/base/ui/switch.d.ts.map +1 -1
- package/dist/types/src/base/ui/switch_synced.d.ts.map +1 -1
- package/dist/types/src/base/ui/synced.d.ts +2 -8
- package/dist/types/src/base/ui/synced.d.ts.map +1 -1
- package/dist/types/src/base/ui/system/all_styles_set.d.ts +0 -3
- package/dist/types/src/base/ui/system/all_styles_set.d.ts.map +1 -1
- package/dist/types/src/base/ui/system/appearance/appearance_set.d.ts +0 -1
- package/dist/types/src/base/ui/system/appearance/appearance_set.d.ts.map +1 -1
- package/dist/types/src/base/ui/system/appearance/background_color.d.ts +0 -1
- package/dist/types/src/base/ui/system/appearance/background_color.d.ts.map +1 -1
- package/dist/types/src/base/ui/system/appearance/border.d.ts +0 -1
- package/dist/types/src/base/ui/system/appearance/border.d.ts.map +1 -1
- package/dist/types/src/base/ui/system/appearance/border_radius.d.ts +0 -1
- package/dist/types/src/base/ui/system/appearance/border_radius.d.ts.map +1 -1
- package/dist/types/src/base/ui/system/appearance/box_shadow.d.ts +0 -1
- package/dist/types/src/base/ui/system/appearance/box_shadow.d.ts.map +1 -1
- package/dist/types/src/base/ui/system/appearance/opacity.d.ts +0 -1
- package/dist/types/src/base/ui/system/appearance/opacity.d.ts.map +1 -1
- package/dist/types/src/base/ui/system/dimensions/dimensions_set.d.ts +0 -1
- package/dist/types/src/base/ui/system/dimensions/dimensions_set.d.ts.map +1 -1
- package/dist/types/src/base/ui/system/dimensions/height.d.ts +0 -1
- package/dist/types/src/base/ui/system/dimensions/height.d.ts.map +1 -1
- package/dist/types/src/base/ui/system/dimensions/max_height.d.ts +0 -1
- package/dist/types/src/base/ui/system/dimensions/max_height.d.ts.map +1 -1
- package/dist/types/src/base/ui/system/dimensions/max_width.d.ts +0 -1
- package/dist/types/src/base/ui/system/dimensions/max_width.d.ts.map +1 -1
- package/dist/types/src/base/ui/system/dimensions/min_height.d.ts +0 -1
- package/dist/types/src/base/ui/system/dimensions/min_height.d.ts.map +1 -1
- package/dist/types/src/base/ui/system/dimensions/min_width.d.ts +0 -1
- package/dist/types/src/base/ui/system/dimensions/min_width.d.ts.map +1 -1
- package/dist/types/src/base/ui/system/dimensions/width.d.ts +0 -1
- package/dist/types/src/base/ui/system/dimensions/width.d.ts.map +1 -1
- package/dist/types/src/base/ui/system/display.d.ts +0 -1
- package/dist/types/src/base/ui/system/display.d.ts.map +1 -1
- package/dist/types/src/base/ui/system/flex_container/align_content.d.ts +0 -1
- package/dist/types/src/base/ui/system/flex_container/align_content.d.ts.map +1 -1
- package/dist/types/src/base/ui/system/flex_container/align_items.d.ts +0 -1
- package/dist/types/src/base/ui/system/flex_container/align_items.d.ts.map +1 -1
- package/dist/types/src/base/ui/system/flex_container/flex_container_set.d.ts +0 -1
- package/dist/types/src/base/ui/system/flex_container/flex_container_set.d.ts.map +1 -1
- package/dist/types/src/base/ui/system/flex_container/flex_direction.d.ts +0 -1
- package/dist/types/src/base/ui/system/flex_container/flex_direction.d.ts.map +1 -1
- package/dist/types/src/base/ui/system/flex_container/flex_wrap.d.ts +0 -1
- package/dist/types/src/base/ui/system/flex_container/flex_wrap.d.ts.map +1 -1
- package/dist/types/src/base/ui/system/flex_container/justify_content.d.ts +0 -1
- package/dist/types/src/base/ui/system/flex_container/justify_content.d.ts.map +1 -1
- package/dist/types/src/base/ui/system/flex_container/justify_items.d.ts +0 -1
- package/dist/types/src/base/ui/system/flex_container/justify_items.d.ts.map +1 -1
- package/dist/types/src/base/ui/system/flex_item/align_self.d.ts +0 -1
- package/dist/types/src/base/ui/system/flex_item/align_self.d.ts.map +1 -1
- package/dist/types/src/base/ui/system/flex_item/flex.d.ts +0 -1
- package/dist/types/src/base/ui/system/flex_item/flex.d.ts.map +1 -1
- package/dist/types/src/base/ui/system/flex_item/flex_basis.d.ts +0 -1
- package/dist/types/src/base/ui/system/flex_item/flex_basis.d.ts.map +1 -1
- package/dist/types/src/base/ui/system/flex_item/flex_grow.d.ts +0 -1
- package/dist/types/src/base/ui/system/flex_item/flex_grow.d.ts.map +1 -1
- package/dist/types/src/base/ui/system/flex_item/flex_item_set.d.ts +0 -1
- package/dist/types/src/base/ui/system/flex_item/flex_item_set.d.ts.map +1 -1
- package/dist/types/src/base/ui/system/flex_item/flex_shrink.d.ts +0 -1
- package/dist/types/src/base/ui/system/flex_item/flex_shrink.d.ts.map +1 -1
- package/dist/types/src/base/ui/system/flex_item/justify_self.d.ts +0 -1
- package/dist/types/src/base/ui/system/flex_item/justify_self.d.ts.map +1 -1
- package/dist/types/src/base/ui/system/flex_item/order.d.ts +0 -1
- package/dist/types/src/base/ui/system/flex_item/order.d.ts.map +1 -1
- package/dist/types/src/base/ui/system/index.d.ts +52 -52
- package/dist/types/src/base/ui/system/index.d.ts.map +1 -1
- package/dist/types/src/base/ui/system/overflow.d.ts +0 -1
- package/dist/types/src/base/ui/system/overflow.d.ts.map +1 -1
- package/dist/types/src/base/ui/system/position/bottom.d.ts +0 -1
- package/dist/types/src/base/ui/system/position/bottom.d.ts.map +1 -1
- package/dist/types/src/base/ui/system/position/left.d.ts +0 -1
- package/dist/types/src/base/ui/system/position/left.d.ts.map +1 -1
- package/dist/types/src/base/ui/system/position/position.d.ts +0 -1
- package/dist/types/src/base/ui/system/position/position.d.ts.map +1 -1
- package/dist/types/src/base/ui/system/position/position_set.d.ts +0 -1
- package/dist/types/src/base/ui/system/position/position_set.d.ts.map +1 -1
- package/dist/types/src/base/ui/system/position/right.d.ts +0 -1
- package/dist/types/src/base/ui/system/position/right.d.ts.map +1 -1
- package/dist/types/src/base/ui/system/position/top.d.ts +0 -1
- package/dist/types/src/base/ui/system/position/top.d.ts.map +1 -1
- package/dist/types/src/base/ui/system/position/z_index.d.ts +0 -1
- package/dist/types/src/base/ui/system/position/z_index.d.ts.map +1 -1
- package/dist/types/src/base/ui/system/spacing/margin.d.ts +0 -1
- package/dist/types/src/base/ui/system/spacing/margin.d.ts.map +1 -1
- package/dist/types/src/base/ui/system/spacing/padding.d.ts +0 -1
- package/dist/types/src/base/ui/system/spacing/padding.d.ts.map +1 -1
- package/dist/types/src/base/ui/system/spacing/spacing_set.d.ts +0 -1
- package/dist/types/src/base/ui/system/spacing/spacing_set.d.ts.map +1 -1
- package/dist/types/src/base/ui/system/typography/font_family.d.ts +0 -1
- package/dist/types/src/base/ui/system/typography/font_family.d.ts.map +1 -1
- package/dist/types/src/base/ui/system/typography/font_size.d.ts +0 -1
- package/dist/types/src/base/ui/system/typography/font_size.d.ts.map +1 -1
- package/dist/types/src/base/ui/system/typography/font_style.d.ts +0 -1
- package/dist/types/src/base/ui/system/typography/font_style.d.ts.map +1 -1
- package/dist/types/src/base/ui/system/typography/font_weight.d.ts +0 -1
- package/dist/types/src/base/ui/system/typography/font_weight.d.ts.map +1 -1
- package/dist/types/src/base/ui/system/typography/letter_spacing.d.ts +0 -1
- package/dist/types/src/base/ui/system/typography/letter_spacing.d.ts.map +1 -1
- package/dist/types/src/base/ui/system/typography/line_height.d.ts +0 -1
- package/dist/types/src/base/ui/system/typography/line_height.d.ts.map +1 -1
- package/dist/types/src/base/ui/system/typography/text_align.d.ts +0 -1
- package/dist/types/src/base/ui/system/typography/text_align.d.ts.map +1 -1
- package/dist/types/src/base/ui/system/typography/text_color.d.ts +0 -1
- package/dist/types/src/base/ui/system/typography/text_color.d.ts.map +1 -1
- package/dist/types/src/base/ui/system/typography/text_decoration.d.ts +0 -1
- package/dist/types/src/base/ui/system/typography/text_decoration.d.ts.map +1 -1
- package/dist/types/src/base/ui/system/typography/text_transform.d.ts +0 -1
- package/dist/types/src/base/ui/system/typography/text_transform.d.ts.map +1 -1
- package/dist/types/src/base/ui/system/typography/typography_set.d.ts +0 -1
- package/dist/types/src/base/ui/system/typography/typography_set.d.ts.map +1 -1
- package/dist/types/src/base/ui/table_picker.d.ts +0 -21
- package/dist/types/src/base/ui/table_picker.d.ts.map +1 -1
- package/dist/types/src/base/ui/table_picker_synced.d.ts.map +1 -1
- package/dist/types/src/base/ui/text.d.ts +0 -3
- package/dist/types/src/base/ui/text.d.ts.map +1 -1
- package/dist/types/src/base/ui/text_button.d.ts +1 -5
- package/dist/types/src/base/ui/text_button.d.ts.map +1 -1
- package/dist/types/src/base/ui/theme/default_theme/index.d.ts +1 -1
- package/dist/types/src/base/ui/theme/theme_context.d.ts +1 -1
- package/dist/types/src/base/ui/theme/use_theme.d.ts +1 -1
- package/dist/types/src/base/ui/tooltip.d.ts +0 -16
- package/dist/types/src/base/ui/tooltip.d.ts.map +1 -1
- package/dist/types/src/base/ui/types/aria_props.d.ts.map +1 -1
- package/dist/types/src/base/ui/types/data_attributes_prop.d.ts +0 -4
- package/dist/types/src/base/ui/types/data_attributes_prop.d.ts.map +1 -1
- package/dist/types/src/base/ui/types/tooltip_anchor_props.d.ts +0 -7
- package/dist/types/src/base/ui/types/tooltip_anchor_props.d.ts.map +1 -1
- package/dist/types/src/base/ui/ui.d.ts +1 -0
- package/dist/types/src/base/ui/ui.d.ts.map +1 -1
- package/dist/types/src/base/ui/view_picker.d.ts +0 -23
- package/dist/types/src/base/ui/view_picker.d.ts.map +1 -1
- package/dist/types/src/base/ui/view_picker_synced.d.ts.map +1 -1
- package/dist/types/src/base/ui/viewport_constraint.d.ts +1 -14
- package/dist/types/src/base/ui/viewport_constraint.d.ts.map +1 -1
- package/dist/types/src/base/unstable_testing_utils.d.ts +1 -1
- package/dist/types/src/base/unstable_testing_utils.d.ts.map +1 -1
- package/dist/types/src/interface/assert_run_context.d.ts +2 -0
- package/dist/types/src/interface/assert_run_context.d.ts.map +1 -0
- package/dist/types/src/interface/index.d.ts +1 -6
- package/dist/types/src/interface/index.d.ts.map +1 -1
- package/dist/types/src/interface/models/models.d.ts +1 -0
- package/dist/types/src/interface/models/models.d.ts.map +1 -1
- package/dist/types/src/interface/models/mutations.d.ts.map +1 -1
- package/dist/types/src/interface/ui/initialize_block.d.ts.map +1 -1
- package/dist/types/src/interface/ui/ui.d.ts +1 -0
- package/dist/types/src/interface/ui/ui.d.ts.map +1 -1
- package/dist/types/src/interface/ui/use_custom_properties.d.ts +1 -1
- package/dist/types/src/shared/models/mutations_core.d.ts.map +1 -1
- package/dist/types/src/shared/private_utils.d.ts +0 -9
- package/dist/types/src/shared/private_utils.d.ts.map +1 -1
- package/dist/types/src/shared/ui/global_config_synced_component_helpers.d.ts +0 -2
- package/dist/types/src/shared/ui/global_config_synced_component_helpers.d.ts.map +1 -1
- package/dist/types/src/shared/ui/loader.d.ts.map +1 -1
- package/dist/types/src/shared/ui/with_hooks.d.ts +2 -2
- package/dist/types/src/shared/ui/with_hooks.d.ts.map +1 -1
- package/dist/types/src/testing/{abstract_mock_airtable_interface.d.ts → base/abstract_mock_airtable_interface.d.ts} +13 -13
- package/dist/types/src/testing/base/abstract_mock_airtable_interface.d.ts.map +1 -0
- package/dist/types/src/testing/interface/abstract_mock_airtable_interface.d.ts +51 -0
- package/dist/types/src/testing/interface/abstract_mock_airtable_interface.d.ts.map +1 -0
- package/models.js +1 -1
- package/package.json +24 -23
- package/types.js +1 -1
- package/dist/cjs/base/models/abstract_model_with_async_data.js +0 -273
- package/dist/cjs/base/models/base.js +0 -306
- package/dist/cjs/base/models/create_aggregators.js +0 -115
- package/dist/cjs/base/models/cursor.js +0 -393
- package/dist/cjs/base/models/field.js +0 -427
- package/dist/cjs/base/models/grouped_record_query_result.js +0 -399
- package/dist/cjs/base/models/linked_records_query_result.js +0 -728
- package/dist/cjs/base/models/mutations.js +0 -338
- package/dist/cjs/base/models/object_pool.js +0 -184
- package/dist/cjs/base/models/record.js +0 -304
- package/dist/cjs/base/models/record_query_result.js +0 -741
- package/dist/cjs/base/models/record_store.js +0 -825
- package/dist/cjs/base/models/session.js +0 -182
- package/dist/cjs/base/models/table.js +0 -668
- package/dist/cjs/base/models/table_or_view_query_result.js +0 -1013
- package/dist/cjs/base/models/view.js +0 -431
- package/dist/cjs/base/models/view_data_store.js +0 -403
- package/dist/cjs/base/models/view_metadata_query_result.js +0 -224
- package/dist/cjs/base/perform_record_action.js +0 -257
- package/dist/cjs/base/sdk.js +0 -233
- package/dist/cjs/base/settings_button.js +0 -138
- package/dist/cjs/base/ui/baymax_utils.js +0 -133
- package/dist/cjs/base/ui/block_wrapper.js +0 -143
- package/dist/cjs/base/ui/box.js +0 -110
- package/dist/cjs/base/ui/button.js +0 -182
- package/dist/cjs/base/ui/cell_renderer.js +0 -255
- package/dist/cjs/base/ui/choice_token.js +0 -110
- package/dist/cjs/base/ui/collaborator_token.js +0 -145
- package/dist/cjs/base/ui/color_palette.js +0 -239
- package/dist/cjs/base/ui/color_palette_synced.js +0 -98
- package/dist/cjs/base/ui/confirmation_dialog.js +0 -153
- package/dist/cjs/base/ui/dialog.js +0 -142
- package/dist/cjs/base/ui/dialog_close_button.js +0 -152
- package/dist/cjs/base/ui/expand_record_picker_async.js +0 -100
- package/dist/cjs/base/ui/field_icon.js +0 -62
- package/dist/cjs/base/ui/field_picker.js +0 -143
- package/dist/cjs/base/ui/field_picker_synced.js +0 -88
- package/dist/cjs/base/ui/form_field.js +0 -137
- package/dist/cjs/base/ui/geometry/point.js +0 -21
- package/dist/cjs/base/ui/geometry/rect.js +0 -67
- package/dist/cjs/base/ui/geometry/size.js +0 -21
- package/dist/cjs/base/ui/global_alert.js +0 -92
- package/dist/cjs/base/ui/heading.js +0 -181
- package/dist/cjs/base/ui/icon.js +0 -129
- package/dist/cjs/base/ui/input.js +0 -200
- package/dist/cjs/base/ui/input_synced.js +0 -89
- package/dist/cjs/base/ui/label.js +0 -105
- package/dist/cjs/base/ui/link.js +0 -229
- package/dist/cjs/base/ui/loader.js +0 -82
- package/dist/cjs/base/ui/modal.js +0 -184
- package/dist/cjs/base/ui/model_picker_select.js +0 -83
- package/dist/cjs/base/ui/popover.js +0 -407
- package/dist/cjs/base/ui/progress_bar.js +0 -128
- package/dist/cjs/base/ui/record_card.js +0 -653
- package/dist/cjs/base/ui/record_card_list.js +0 -377
- package/dist/cjs/base/ui/select.js +0 -247
- package/dist/cjs/base/ui/select_and_select_buttons_helpers.js +0 -87
- package/dist/cjs/base/ui/select_buttons.js +0 -192
- package/dist/cjs/base/ui/select_buttons_synced.js +0 -84
- package/dist/cjs/base/ui/select_synced.js +0 -87
- package/dist/cjs/base/ui/switch.js +0 -196
- package/dist/cjs/base/ui/switch_synced.js +0 -75
- package/dist/cjs/base/ui/synced.js +0 -70
- package/dist/cjs/base/ui/system/appearance/appearance_set.js +0 -30
- package/dist/cjs/base/ui/system/appearance/background_color.js +0 -21
- package/dist/cjs/base/ui/system/appearance/border_radius.js +0 -21
- package/dist/cjs/base/ui/system/appearance/box_shadow.js +0 -21
- package/dist/cjs/base/ui/system/appearance/opacity.js +0 -21
- package/dist/cjs/base/ui/system/dimensions/dimensions_set.js +0 -31
- package/dist/cjs/base/ui/system/dimensions/height.js +0 -21
- package/dist/cjs/base/ui/system/dimensions/max_height.js +0 -21
- package/dist/cjs/base/ui/system/dimensions/max_width.js +0 -21
- package/dist/cjs/base/ui/system/dimensions/min_height.js +0 -21
- package/dist/cjs/base/ui/system/dimensions/min_width.js +0 -21
- package/dist/cjs/base/ui/system/dimensions/width.js +0 -21
- package/dist/cjs/base/ui/system/display.js +0 -22
- package/dist/cjs/base/ui/system/flex_container/align_content.js +0 -18
- package/dist/cjs/base/ui/system/flex_container/align_items.js +0 -18
- package/dist/cjs/base/ui/system/flex_container/flex_container_set.js +0 -31
- package/dist/cjs/base/ui/system/flex_container/flex_direction.js +0 -18
- package/dist/cjs/base/ui/system/flex_container/flex_wrap.js +0 -18
- package/dist/cjs/base/ui/system/flex_container/justify_content.js +0 -18
- package/dist/cjs/base/ui/system/flex_container/justify_items.js +0 -19
- package/dist/cjs/base/ui/system/flex_item/align_self.js +0 -18
- package/dist/cjs/base/ui/system/flex_item/flex.js +0 -18
- package/dist/cjs/base/ui/system/flex_item/flex_basis.js +0 -18
- package/dist/cjs/base/ui/system/flex_item/flex_grow.js +0 -18
- package/dist/cjs/base/ui/system/flex_item/flex_item_set.js +0 -32
- package/dist/cjs/base/ui/system/flex_item/flex_shrink.js +0 -18
- package/dist/cjs/base/ui/system/flex_item/justify_self.js +0 -19
- package/dist/cjs/base/ui/system/flex_item/order.js +0 -18
- package/dist/cjs/base/ui/system/overflow.js +0 -24
- package/dist/cjs/base/ui/system/position/position.js +0 -18
- package/dist/cjs/base/ui/system/position/position_set.js +0 -31
- package/dist/cjs/base/ui/system/position/z_index.js +0 -21
- package/dist/cjs/base/ui/system/spacing/spacing_set.js +0 -27
- package/dist/cjs/base/ui/system/typography/font_family.js +0 -21
- package/dist/cjs/base/ui/system/typography/font_size.js +0 -21
- package/dist/cjs/base/ui/system/typography/font_style.js +0 -18
- package/dist/cjs/base/ui/system/typography/font_weight.js +0 -21
- package/dist/cjs/base/ui/system/typography/letter_spacing.js +0 -21
- package/dist/cjs/base/ui/system/typography/line_height.js +0 -18
- package/dist/cjs/base/ui/system/typography/text_align.js +0 -18
- package/dist/cjs/base/ui/system/typography/text_color.js +0 -21
- package/dist/cjs/base/ui/system/typography/text_decoration.js +0 -18
- package/dist/cjs/base/ui/system/typography/text_transform.js +0 -18
- package/dist/cjs/base/ui/system/typography/typography_set.js +0 -35
- package/dist/cjs/base/ui/system/utils/create_responsive_prop_type.js +0 -19
- package/dist/cjs/base/ui/system/utils/create_style_prop_types.js +0 -24
- package/dist/cjs/base/ui/system/utils/enum_prop_type_utils.js +0 -35
- package/dist/cjs/base/ui/system/utils/get_style_props_for_responsive_prop.js +0 -113
- package/dist/cjs/base/ui/table_picker.js +0 -95
- package/dist/cjs/base/ui/table_picker_synced.js +0 -84
- package/dist/cjs/base/ui/text.js +0 -150
- package/dist/cjs/base/ui/text_button.js +0 -228
- package/dist/cjs/base/ui/theme/default_theme/control_sizes.js +0 -96
- package/dist/cjs/base/ui/theme/default_theme/select_variants.js +0 -59
- package/dist/cjs/base/ui/theme/default_theme/switch_variants.js +0 -91
- package/dist/cjs/base/ui/tooltip.js +0 -215
- package/dist/cjs/base/ui/types/aria_props.js +0 -23
- package/dist/cjs/base/ui/types/data_attributes_prop.js +0 -18
- package/dist/cjs/base/ui/types/tooltip_anchor_props.js +0 -17
- package/dist/cjs/base/ui/use_styled_system.js +0 -32
- package/dist/cjs/base/ui/view_picker.js +0 -133
- package/dist/cjs/base/ui/view_picker_synced.js +0 -88
- package/dist/cjs/base/ui/viewport_constraint.js +0 -176
- package/dist/cjs/base/ui/with_styled_system.js +0 -165
- package/dist/cjs/base/undo_redo.js +0 -48
- package/dist/cjs/base/viewport.js +0 -397
- package/dist/cjs/injected/airtable_interface.js +0 -22
- package/dist/cjs/interface/index.js +0 -36
- package/dist/cjs/interface/models/base.js +0 -54
- package/dist/cjs/interface/models/field.js +0 -42
- package/dist/cjs/interface/models/mutations.js +0 -79
- package/dist/cjs/interface/models/record.js +0 -71
- package/dist/cjs/interface/models/record_store.js +0 -83
- package/dist/cjs/interface/models/session.js +0 -42
- package/dist/cjs/interface/models/table.js +0 -126
- package/dist/cjs/interface/sdk.js +0 -104
- package/dist/cjs/interface/types/mutations.js +0 -24
- package/dist/cjs/interface/ui/block_wrapper.js +0 -61
- package/dist/cjs/shared/global_config.js +0 -511
- package/dist/cjs/shared/models/abstract_model.js +0 -119
- package/dist/cjs/shared/models/base_core.js +0 -602
- package/dist/cjs/shared/models/field_core.js +0 -331
- package/dist/cjs/shared/models/mutations_core.js +0 -439
- package/dist/cjs/shared/models/record_core.js +0 -272
- package/dist/cjs/shared/models/record_store_core.js +0 -213
- package/dist/cjs/shared/models/session_core.js +0 -214
- package/dist/cjs/shared/models/table_core.js +0 -1561
- package/dist/cjs/shared/sdk_core.js +0 -115
- package/dist/cjs/shared/types/mutation_constants.js +0 -11
- package/dist/cjs/shared/ui/loader.js +0 -68
- package/dist/cjs/shared/watchable.js +0 -216
- package/dist/cjs/stats/block_stats.js +0 -96
- package/dist/cjs/testing/abstract_mock_airtable_interface.js +0 -277
- package/dist/types/src/base/ui/system/utils/create_responsive_prop_type.d.ts +0 -2
- package/dist/types/src/base/ui/system/utils/create_responsive_prop_type.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/utils/create_style_prop_types.d.ts +0 -4
- package/dist/types/src/base/ui/system/utils/create_style_prop_types.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/utils/enum_prop_type_utils.d.ts +0 -21
- package/dist/types/src/base/ui/system/utils/enum_prop_type_utils.d.ts.map +0 -1
- package/dist/types/src/testing/abstract_mock_airtable_interface.d.ts.map +0 -1
- /package/dist/{cjs → esm}/base/types/aggregators.js +0 -0
- /package/dist/{cjs → esm}/base/types/backend_fetch_types.js +0 -0
- /package/dist/{cjs → esm}/base/types/base.js +0 -0
- /package/dist/{cjs → esm}/base/types/cursor.js +0 -0
- /package/dist/{cjs → esm}/base/types/field.js +0 -0
- /package/dist/{cjs → esm}/base/types/record.js +0 -0
- /package/dist/{cjs → esm}/base/types/record_action_data.js +0 -0
- /package/dist/{cjs → esm}/base/types/table.js +0 -0
- /package/dist/{cjs → esm}/base/types/viewport.js +0 -0
- /package/dist/{cjs → esm}/base/ui/system/utils/csstype.js +0 -0
- /package/dist/{cjs → esm}/base/ui/system/utils/types.js +0 -0
- /package/dist/{cjs/interface/types/base.js → esm/base/ui/types/aria_props.js} +0 -0
- /package/dist/{cjs/interface/types/field.js → esm/base/ui/types/data_attributes_prop.js} +0 -0
- /package/dist/{cjs/interface/types/record.js → esm/base/ui/types/tooltip_anchor_props.js} +0 -0
- /package/dist/{cjs/interface/types/table.js → esm/interface/types/base.js} +0 -0
- /package/dist/{cjs/sdk_mode.js → esm/interface/types/field.js} +0 -0
- /package/dist/{cjs/shared → esm/interface}/types/record.js +0 -0
- /package/dist/{cjs/shared/types/airtable_interface_core.js → esm/interface/types/table.js} +0 -0
- /package/dist/{cjs → esm}/interface/ui/expand_record.js +0 -0
- /package/dist/{cjs/shared/types/attachment.js → esm/sdk_mode.js} +0 -0
- /package/dist/{cjs/shared/types/base_core.js → esm/shared/types/airtable_interface_core.js} +0 -0
- /package/dist/{cjs/shared/types/collaborator.js → esm/shared/types/attachment.js} +0 -0
- /package/dist/{cjs/shared/types/global_config.js → esm/shared/types/base_core.js} +0 -0
- /package/dist/{cjs/shared/types/hyper_ids.js → esm/shared/types/collaborator.js} +0 -0
- /package/dist/{cjs/shared/types/stat.js → esm/shared/types/global_config.js} +0 -0
- /package/dist/{cjs/shared/types/table_core.js → esm/shared/types/hyper_ids.js} +0 -0
|
@@ -1,1013 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
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");
|
|
12
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
13
|
-
Object.defineProperty(exports, "__esModule", {
|
|
14
|
-
value: true
|
|
15
|
-
});
|
|
16
|
-
exports.default = void 0;
|
|
17
|
-
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
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"));
|
|
28
|
-
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
29
|
-
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
30
|
-
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
31
|
-
var _get2 = _interopRequireDefault(require("@babel/runtime/helpers/get"));
|
|
32
|
-
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
33
|
-
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
34
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
35
|
-
var _private_utils = require("../../shared/private_utils");
|
|
36
|
-
var _error_utils = require("../../shared/error_utils");
|
|
37
|
-
var _table = _interopRequireWildcard(require("./table"));
|
|
38
|
-
var _record_query_result = _interopRequireDefault(require("./record_query_result"));
|
|
39
|
-
var _record_coloring = require("./record_coloring");
|
|
40
|
-
var _object_pool = _interopRequireDefault(require("./object_pool"));
|
|
41
|
-
var _record_store = require("./record_store");
|
|
42
|
-
var _view_data_store = _interopRequireWildcard(require("./view_data_store"));
|
|
43
|
-
var _grouped_record_query_result = _interopRequireDefault(require("./grouped_record_query_result"));
|
|
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 */
|
|
54
|
-
/**
|
|
55
|
-
* Represents a set of records directly from a view or table. See {@link RecordQueryResult} for main
|
|
56
|
-
* documentation.
|
|
57
|
-
*
|
|
58
|
-
* Do not instantiate. You can get instances of this class by calling
|
|
59
|
-
* `table.selectRecords` or `view.selectRecords`.
|
|
60
|
-
*
|
|
61
|
-
* @docsPath models/query results/TableOrViewQueryResult
|
|
62
|
-
*/
|
|
63
|
-
var TableOrViewQueryResult = /*#__PURE__*/function (_RecordQueryResult) {
|
|
64
|
-
/** @internal */
|
|
65
|
-
function TableOrViewQueryResult(sdk, sourceModel, normalizedOpts) {
|
|
66
|
-
var _this;
|
|
67
|
-
(0, _classCallCheck2.default)(this, TableOrViewQueryResult);
|
|
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);
|
|
115
|
-
_this._sourceModel = sourceModel;
|
|
116
|
-
_this._mostRecentSourceModelLoadPromise = null;
|
|
117
|
-
_this._table = normalizedOpts.table;
|
|
118
|
-
var sorts = _this._normalizedOpts.sorts;
|
|
119
|
-
_this._sorts = sorts !== null && sorts !== void 0 ? sorts : null;
|
|
120
|
-
// TODO (SeanKeenan): Placeholder until we support groups from normalizedOpts
|
|
121
|
-
_this._groupLevels = null;
|
|
122
|
-
_this._visList = null;
|
|
123
|
-
_this._orderedRecordIds = null;
|
|
124
|
-
_this._orderedGroups = null;
|
|
125
|
-
_this._loadedGroupLevels = null;
|
|
126
|
-
_this._cellValueKeyWatchCounts = {};
|
|
127
|
-
var fieldIdsSetToLoadOrNullIfAllFields = null;
|
|
128
|
-
if (_this._normalizedOpts.fieldIdsOrNullIfAllFields) {
|
|
129
|
-
fieldIdsSetToLoadOrNullIfAllFields = {};
|
|
130
|
-
var _iterator = _createForOfIteratorHelper(_this._normalizedOpts.fieldIdsOrNullIfAllFields),
|
|
131
|
-
_step;
|
|
132
|
-
try {
|
|
133
|
-
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
134
|
-
var fieldId = _step.value;
|
|
135
|
-
fieldIdsSetToLoadOrNullIfAllFields[fieldId] = true;
|
|
136
|
-
}
|
|
137
|
-
// Need to load data for fields we're sorting by, even if
|
|
138
|
-
// they're not explicitly requested in the `fields` opt.
|
|
139
|
-
} catch (err) {
|
|
140
|
-
_iterator.e(err);
|
|
141
|
-
} finally {
|
|
142
|
-
_iterator.f();
|
|
143
|
-
}
|
|
144
|
-
if (_this._sorts !== null) {
|
|
145
|
-
var _iterator2 = _createForOfIteratorHelper(_this._sorts),
|
|
146
|
-
_step2;
|
|
147
|
-
try {
|
|
148
|
-
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
149
|
-
var sort = _step2.value;
|
|
150
|
-
fieldIdsSetToLoadOrNullIfAllFields[sort.fieldId] = true;
|
|
151
|
-
}
|
|
152
|
-
} catch (err) {
|
|
153
|
-
_iterator2.e(err);
|
|
154
|
-
} finally {
|
|
155
|
-
_iterator2.f();
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
-
// TODO (SeanKeenan): Comment back in when enabling groups
|
|
159
|
-
// Same for group configs
|
|
160
|
-
// if (this._groupLevels !== null) {
|
|
161
|
-
// for (const group of this._groupLevels) {
|
|
162
|
-
// fieldIdsSetToLoadOrNullIfAllFields[group.fieldId] = true;
|
|
163
|
-
// }
|
|
164
|
-
// }
|
|
165
|
-
|
|
166
|
-
var recordColorMode = _this._normalizedOpts.recordColorMode;
|
|
167
|
-
if (recordColorMode && recordColorMode.type === _record_coloring.ModeTypes.BY_SELECT_FIELD) {
|
|
168
|
-
fieldIdsSetToLoadOrNullIfAllFields[recordColorMode.selectField.id] = true;
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
|
-
_this._fieldIdsSetToLoadOrNullIfAllFields = fieldIdsSetToLoadOrNullIfAllFields;
|
|
172
|
-
_this.__groupedRecordQueryResultPool = new _object_pool.default(_grouped_record_query_result.default);
|
|
173
|
-
Object.seal(_this);
|
|
174
|
-
return _this;
|
|
175
|
-
}
|
|
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
|
-
}
|
|
197
|
-
|
|
198
|
-
/** @internal */
|
|
199
|
-
}, {
|
|
200
|
-
key: "__poolKey",
|
|
201
|
-
get: function get() {
|
|
202
|
-
return "".concat(this._serializedOpts, "::").concat(this._sourceModel.id);
|
|
203
|
-
}
|
|
204
|
-
|
|
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
|
-
}
|
|
272
|
-
/**
|
|
273
|
-
* The set of record IDs in this RecordQueryResult.
|
|
274
|
-
* Throws if data is not loaded yet.
|
|
275
|
-
*
|
|
276
|
-
* @internal
|
|
277
|
-
*/
|
|
278
|
-
}, {
|
|
279
|
-
key: "_getOrGenerateRecordIdsSet",
|
|
280
|
-
value: function _getOrGenerateRecordIdsSet() {
|
|
281
|
-
if (!this._recordIdsSet) {
|
|
282
|
-
var recordIdsSet = {};
|
|
283
|
-
var _iterator3 = _createForOfIteratorHelper(this.recordIds),
|
|
284
|
-
_step3;
|
|
285
|
-
try {
|
|
286
|
-
for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
|
|
287
|
-
var recordId = _step3.value;
|
|
288
|
-
recordIdsSet[recordId] = true;
|
|
289
|
-
}
|
|
290
|
-
} catch (err) {
|
|
291
|
-
_iterator3.e(err);
|
|
292
|
-
} finally {
|
|
293
|
-
_iterator3.f();
|
|
294
|
-
}
|
|
295
|
-
this._recordIdsSet = recordIdsSet;
|
|
296
|
-
}
|
|
297
|
-
return this._recordIdsSet;
|
|
298
|
-
}
|
|
299
|
-
/**
|
|
300
|
-
* The fields that were used to create this RecordQueryResult.
|
|
301
|
-
* Null if fields were not specified, which means the RecordQueryResult
|
|
302
|
-
* will load all fields in the table.
|
|
303
|
-
*/
|
|
304
|
-
}, {
|
|
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
|
-
}
|
|
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",
|
|
375
|
-
value: function _incrementCellValueKeyWatchCountAndWatchIfNecessary(key, watchCallback) {
|
|
376
|
-
if (!this._cellValueKeyWatchCounts[key]) {
|
|
377
|
-
this._cellValueKeyWatchCounts[key] = 0;
|
|
378
|
-
this._recordStore.watch(key, watchCallback, this);
|
|
379
|
-
}
|
|
380
|
-
this._cellValueKeyWatchCounts[key]++;
|
|
381
|
-
}
|
|
382
|
-
/** @internal */
|
|
383
|
-
}, {
|
|
384
|
-
key: "_decrementCellValueKeyWatchCountAndUnwatchIfPossible",
|
|
385
|
-
value: function _decrementCellValueKeyWatchCountAndUnwatchIfPossible(key, watchCallback) {
|
|
386
|
-
if (!this._cellValueKeyWatchCounts[key]) {
|
|
387
|
-
// Key isn't watched, so just skip it. This matches behavior of Watchable,
|
|
388
|
-
// where calling unwatch on a key that isn't watched just no-ops.
|
|
389
|
-
return;
|
|
390
|
-
}
|
|
391
|
-
this._cellValueKeyWatchCounts[key]--;
|
|
392
|
-
if (this._cellValueKeyWatchCounts[key] === 0) {
|
|
393
|
-
// We're down to zero watches for this key, so we can actually unwatch it now.
|
|
394
|
-
this._recordStore.unwatch(key, watchCallback, this);
|
|
395
|
-
delete this._cellValueKeyWatchCounts[key];
|
|
396
|
-
}
|
|
397
|
-
}
|
|
398
|
-
/** @inheritdoc */
|
|
399
|
-
}, {
|
|
400
|
-
key: "watch",
|
|
401
|
-
value: function watch(keys, callback, context) {
|
|
402
|
-
var validKeys = (0, _get2.default)((0, _getPrototypeOf2.default)(TableOrViewQueryResult.prototype), "watch", this).call(this, keys, callback, context);
|
|
403
|
-
var _iterator5 = _createForOfIteratorHelper(validKeys),
|
|
404
|
-
_step5;
|
|
405
|
-
try {
|
|
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);
|
|
410
|
-
if (this._fieldIdsSetToLoadOrNullIfAllFields && !(0, _private_utils.has)(this._fieldIdsSetToLoadOrNullIfAllFields, fieldId)) {
|
|
411
|
-
throw (0, _error_utils.spawnError)("Can't watch field because it wasn't included in RecordQueryResult fields: %s", fieldId);
|
|
412
|
-
}
|
|
413
|
-
this._incrementCellValueKeyWatchCountAndWatchIfNecessary(key, this._onCellValuesInFieldChanged);
|
|
414
|
-
}
|
|
415
|
-
if (key === _record_query_result.default.WatchableKeys.cellValues) {
|
|
416
|
-
if (this._fieldIdsSetToLoadOrNullIfAllFields) {
|
|
417
|
-
for (var _i = 0, _Object$keys = Object.keys(this._fieldIdsSetToLoadOrNullIfAllFields); _i < _Object$keys.length; _i++) {
|
|
418
|
-
var _fieldId = _Object$keys[_i];
|
|
419
|
-
this._incrementCellValueKeyWatchCountAndWatchIfNecessary(_record_query_result.default.WatchableCellValuesInFieldKeyPrefix + _fieldId, this._onCellValuesChanged);
|
|
420
|
-
}
|
|
421
|
-
} else {
|
|
422
|
-
this._incrementCellValueKeyWatchCountAndWatchIfNecessary(key, this._onCellValuesChanged);
|
|
423
|
-
}
|
|
424
|
-
}
|
|
425
|
-
}
|
|
426
|
-
} catch (err) {
|
|
427
|
-
_iterator5.e(err);
|
|
428
|
-
} finally {
|
|
429
|
-
_iterator5.f();
|
|
430
|
-
}
|
|
431
|
-
return validKeys;
|
|
432
|
-
}
|
|
433
|
-
/** @inheritdoc */
|
|
434
|
-
}, {
|
|
435
|
-
key: "unwatch",
|
|
436
|
-
value: function unwatch(keys, callback, context) {
|
|
437
|
-
var validKeys = (0, _get2.default)((0, _getPrototypeOf2.default)(TableOrViewQueryResult.prototype), "unwatch", this).call(this, keys, callback, context);
|
|
438
|
-
var _iterator6 = _createForOfIteratorHelper(validKeys),
|
|
439
|
-
_step6;
|
|
440
|
-
try {
|
|
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);
|
|
445
|
-
}
|
|
446
|
-
if (key === _record_query_result.default.WatchableKeys.cellValues) {
|
|
447
|
-
if (this._fieldIdsSetToLoadOrNullIfAllFields) {
|
|
448
|
-
for (var _i2 = 0, _Object$keys2 = Object.keys(this._fieldIdsSetToLoadOrNullIfAllFields); _i2 < _Object$keys2.length; _i2++) {
|
|
449
|
-
var fieldId = _Object$keys2[_i2];
|
|
450
|
-
this._decrementCellValueKeyWatchCountAndUnwatchIfPossible(_record_query_result.default.WatchableCellValuesInFieldKeyPrefix + fieldId, this._onCellValuesChanged);
|
|
451
|
-
}
|
|
452
|
-
} else {
|
|
453
|
-
this._decrementCellValueKeyWatchCountAndUnwatchIfPossible(key, this._onCellValuesChanged);
|
|
454
|
-
}
|
|
455
|
-
}
|
|
456
|
-
}
|
|
457
|
-
} catch (err) {
|
|
458
|
-
_iterator6.e(err);
|
|
459
|
-
} finally {
|
|
460
|
-
_iterator6.f();
|
|
461
|
-
}
|
|
462
|
-
return validKeys;
|
|
463
|
-
}
|
|
464
|
-
/** @inheritdoc */
|
|
465
|
-
}, {
|
|
466
|
-
key: "loadDataAsync",
|
|
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) {
|
|
472
|
-
case 0:
|
|
473
|
-
if (!this._sourceModel.isDeleted) {
|
|
474
|
-
_context.next = 2;
|
|
475
|
-
break;
|
|
476
|
-
}
|
|
477
|
-
throw this._spawnErrorForDeletion();
|
|
478
|
-
case 2:
|
|
479
|
-
if (this._fieldIdsSetToLoadOrNullIfAllFields) {
|
|
480
|
-
cellValuesInFieldsLoadPromise = this._recordStore.loadCellValuesInFieldIdsAsync(Object.keys(this._fieldIdsSetToLoadOrNullIfAllFields));
|
|
481
|
-
} else {
|
|
482
|
-
// Load all fields.
|
|
483
|
-
cellValuesInFieldsLoadPromise = this._recordStore.loadDataAsync();
|
|
484
|
-
}
|
|
485
|
-
if (this._sourceModel instanceof _table.default) {
|
|
486
|
-
if (this._fieldIdsSetToLoadOrNullIfAllFields) {
|
|
487
|
-
sourceModelLoadPromise = this._recordStore.loadRecordMetadataAsync();
|
|
488
|
-
} else {
|
|
489
|
-
// table.loadDataAsync is a superset of loadRecordMetadataAsync,
|
|
490
|
-
// so no need to load record metadata again.
|
|
491
|
-
sourceModelLoadPromise = null;
|
|
492
|
-
}
|
|
493
|
-
} else {
|
|
494
|
-
sourceModelLoadPromise = this._recordStore.getViewDataStore(this._sourceModel.id).loadDataAsync();
|
|
495
|
-
}
|
|
496
|
-
this._mostRecentSourceModelLoadPromise = Promise.all([sourceModelLoadPromise, cellValuesInFieldsLoadPromise, this._loadRecordColorsAsync()]);
|
|
497
|
-
_context.next = 7;
|
|
498
|
-
return (0, _get2.default)((0, _getPrototypeOf2.default)(TableOrViewQueryResult.prototype), "loadDataAsync", this).call(this);
|
|
499
|
-
case 7:
|
|
500
|
-
case "end":
|
|
501
|
-
return _context.stop();
|
|
502
|
-
}
|
|
503
|
-
}, _callee, this);
|
|
504
|
-
}));
|
|
505
|
-
function loadDataAsync() {
|
|
506
|
-
return _loadDataAsync2.apply(this, arguments);
|
|
507
|
-
}
|
|
508
|
-
return loadDataAsync;
|
|
509
|
-
}()
|
|
510
|
-
/**
|
|
511
|
-
* @internal
|
|
512
|
-
*/
|
|
513
|
-
)
|
|
514
|
-
}, {
|
|
515
|
-
key: "_getChangedKeysOnLoad",
|
|
516
|
-
value: function _getChangedKeysOnLoad() {
|
|
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];
|
|
518
|
-
var fieldIds = this._normalizedOpts.fieldIdsOrNullIfAllFields || this._table.fields.map(field => field.id);
|
|
519
|
-
var _iterator7 = _createForOfIteratorHelper(fieldIds),
|
|
520
|
-
_step7;
|
|
521
|
-
try {
|
|
522
|
-
for (_iterator7.s(); !(_step7 = _iterator7.n()).done;) {
|
|
523
|
-
var fieldId = _step7.value;
|
|
524
|
-
changedKeys.push(_record_query_result.default.WatchableCellValuesInFieldKeyPrefix + fieldId);
|
|
525
|
-
}
|
|
526
|
-
} catch (err) {
|
|
527
|
-
_iterator7.e(err);
|
|
528
|
-
} finally {
|
|
529
|
-
_iterator7.f();
|
|
530
|
-
}
|
|
531
|
-
return changedKeys;
|
|
532
|
-
}
|
|
533
|
-
|
|
534
|
-
/** @internal */
|
|
535
|
-
}, {
|
|
536
|
-
key: "_loadDataAsync",
|
|
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) {
|
|
542
|
-
case 0:
|
|
543
|
-
this._table.__tableOrViewQueryResultPool.registerObjectForReuseStrong(this);
|
|
544
|
-
(0, _error_utils.invariant)(this._mostRecentSourceModelLoadPromise, 'No source model load promises');
|
|
545
|
-
_context2.next = 4;
|
|
546
|
-
return this._mostRecentSourceModelLoadPromise;
|
|
547
|
-
case 4:
|
|
548
|
-
if (this._sorts) {
|
|
549
|
-
this._replaceVisList();
|
|
550
|
-
}
|
|
551
|
-
this._orderedRecordIds = this._generateOrderedRecordIds();
|
|
552
|
-
this._orderedGroups = this._generateAndLoadOrderedGroups();
|
|
553
|
-
// The server provided value and developer supplied value are the same, no conversion needed
|
|
554
|
-
this._loadedGroupLevels = this._sourceModelGroupLevels;
|
|
555
|
-
if (this._sourceModel instanceof _table.default) {
|
|
556
|
-
this._recordStore.watch(_record_store.WatchableRecordStoreKeys.records, this._onRecordsChanged, this);
|
|
557
|
-
} else {
|
|
558
|
-
viewDataStore = this._recordStore.getViewDataStore(this._sourceModel.id);
|
|
559
|
-
viewDataStore.watch(_view_data_store.WatchableViewDataStoreKeys.visibleRecords, this._onRecordsChanged, this);
|
|
560
|
-
viewDataStore.watch(_view_data_store.WatchableViewDataStoreKeys.groups, this._onGroupsChanged, this);
|
|
561
|
-
viewDataStore.watch(_view_data_store.WatchableViewDataStoreKeys.groupLevels, this._onGroupLevelsChanged, this);
|
|
562
|
-
}
|
|
563
|
-
this._recordStore.watch(this._cellValuesForSortWatchKeys, this._onCellValuesForSortChanged, this);
|
|
564
|
-
this._recordStore.watch(this._cellValuesForGroupWatchKeys, this._onCellValuesForGroupChanged, this);
|
|
565
|
-
this._table.watch(_table.WatchableTableKeys.fields, this._onTableFieldsChanged, 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();
|
|
581
|
-
}
|
|
582
|
-
}
|
|
583
|
-
return _context2.abrupt("return", this._getChangedKeysOnLoad());
|
|
584
|
-
case 14:
|
|
585
|
-
case "end":
|
|
586
|
-
return _context2.stop();
|
|
587
|
-
}
|
|
588
|
-
}, _callee2, this);
|
|
589
|
-
}));
|
|
590
|
-
function _loadDataAsync() {
|
|
591
|
-
return _loadDataAsync3.apply(this, arguments);
|
|
592
|
-
}
|
|
593
|
-
return _loadDataAsync;
|
|
594
|
-
}() /** @inheritdoc */)
|
|
595
|
-
}, {
|
|
596
|
-
key: "unloadData",
|
|
597
|
-
value: function unloadData() {
|
|
598
|
-
(0, _get2.default)((0, _getPrototypeOf2.default)(TableOrViewQueryResult.prototype), "unloadData", this).call(this);
|
|
599
|
-
if (this._sourceModel instanceof _table.default) {
|
|
600
|
-
if (this._fieldIdsSetToLoadOrNullIfAllFields) {
|
|
601
|
-
this._recordStore.unloadRecordMetadata();
|
|
602
|
-
} else {
|
|
603
|
-
this._recordStore.unloadData();
|
|
604
|
-
}
|
|
605
|
-
} else {
|
|
606
|
-
// If the view is deleted, we can't get a data store for it.
|
|
607
|
-
if (!this._sourceModel.isDeleted) {
|
|
608
|
-
this._recordStore.getViewDataStore(this._sourceModel.id).unloadData();
|
|
609
|
-
}
|
|
610
|
-
}
|
|
611
|
-
if (this._fieldIdsSetToLoadOrNullIfAllFields) {
|
|
612
|
-
this._recordStore.unloadCellValuesInFieldIds(Object.keys(this._fieldIdsSetToLoadOrNullIfAllFields));
|
|
613
|
-
}
|
|
614
|
-
this._unloadRecordColors();
|
|
615
|
-
}
|
|
616
|
-
/** @internal */
|
|
617
|
-
}, {
|
|
618
|
-
key: "_unloadData",
|
|
619
|
-
value: function _unloadData() {
|
|
620
|
-
this._mostRecentSourceModelLoadPromise = null;
|
|
621
|
-
if (this._sourceModel instanceof _table.default) {
|
|
622
|
-
this._recordStore.unwatch(_record_store.WatchableRecordStoreKeys.records, this._onRecordsChanged, this);
|
|
623
|
-
} else {
|
|
624
|
-
if (!this._sourceModel.isDeleted) {
|
|
625
|
-
var viewDataStore = this._recordStore.getViewDataStore(this._sourceModel.id);
|
|
626
|
-
viewDataStore.unwatch(_view_data_store.WatchableViewDataStoreKeys.visibleRecords, this._onRecordsChanged, this);
|
|
627
|
-
viewDataStore.unwatch(_view_data_store.WatchableViewDataStoreKeys.groups, this._onGroupsChanged, this);
|
|
628
|
-
viewDataStore.unwatch(_view_data_store.WatchableViewDataStoreKeys.groupLevels, this._onGroupLevelsChanged, this);
|
|
629
|
-
}
|
|
630
|
-
}
|
|
631
|
-
this._recordStore.unwatch(this._cellValuesForSortWatchKeys, this._onCellValuesForSortChanged, this);
|
|
632
|
-
this._recordStore.unwatch(this._cellValuesForGroupWatchKeys, this._onCellValuesForGroupChanged, this);
|
|
633
|
-
this._table.unwatch(_table.WatchableTableKeys.fields, this._onTableFieldsChanged, this);
|
|
634
|
-
|
|
635
|
-
// If the table is deleted, can't call getFieldById on it below.
|
|
636
|
-
if (!this._table.isDeleted && this._sorts) {
|
|
637
|
-
var _iterator9 = _createForOfIteratorHelper(this._sorts),
|
|
638
|
-
_step9;
|
|
639
|
-
try {
|
|
640
|
-
for (_iterator9.s(); !(_step9 = _iterator9.n()).done;) {
|
|
641
|
-
var sort = _step9.value;
|
|
642
|
-
var field = this._table.getFieldByIdIfExists(sort.fieldId);
|
|
643
|
-
if (field) {
|
|
644
|
-
field.unwatch('type', this._onFieldConfigChanged, this);
|
|
645
|
-
field.unwatch('options', this._onFieldConfigChanged, this);
|
|
646
|
-
}
|
|
647
|
-
}
|
|
648
|
-
} catch (err) {
|
|
649
|
-
_iterator9.e(err);
|
|
650
|
-
} finally {
|
|
651
|
-
_iterator9.f();
|
|
652
|
-
}
|
|
653
|
-
}
|
|
654
|
-
this._unloadOrderedGroupsIfNeeded();
|
|
655
|
-
this._visList = null;
|
|
656
|
-
this._orderedRecordIds = null;
|
|
657
|
-
this._recordIdsSet = null;
|
|
658
|
-
this._table.__tableOrViewQueryResultPool.unregisterObjectForReuseStrong(this);
|
|
659
|
-
}
|
|
660
|
-
/** @internal */
|
|
661
|
-
}, {
|
|
662
|
-
key: "_addRecordIdsToVisList",
|
|
663
|
-
value: function _addRecordIdsToVisList(recordIds) {
|
|
664
|
-
var visList = this._visList;
|
|
665
|
-
(0, _error_utils.invariant)(visList, 'No vis list');
|
|
666
|
-
var _iterator10 = _createForOfIteratorHelper(recordIds),
|
|
667
|
-
_step10;
|
|
668
|
-
try {
|
|
669
|
-
for (_iterator10.s(); !(_step10 = _iterator10.n()).done;) {
|
|
670
|
-
var recordId = _step10.value;
|
|
671
|
-
var record = this._recordStore.getRecordByIdIfExists(recordId);
|
|
672
|
-
(0, _error_utils.invariant)(record, 'Record missing in table');
|
|
673
|
-
visList.addRecordData(record._data);
|
|
674
|
-
}
|
|
675
|
-
} catch (err) {
|
|
676
|
-
_iterator10.e(err);
|
|
677
|
-
} finally {
|
|
678
|
-
_iterator10.f();
|
|
679
|
-
}
|
|
680
|
-
}
|
|
681
|
-
/** @internal */
|
|
682
|
-
}, {
|
|
683
|
-
key: "_onGroupLevelsChanged",
|
|
684
|
-
value: function _onGroupLevelsChanged(model, key, updates) {
|
|
685
|
-
this._loadedGroupLevels = this._sourceModelGroupLevels;
|
|
686
|
-
this._unloadRemovedGroupsAndLoadNewGroupsAndTriggerWatches();
|
|
687
|
-
this._onChange(_record_query_result.default.WatchableKeys.groupLevels);
|
|
688
|
-
}
|
|
689
|
-
/** @internal */
|
|
690
|
-
}, {
|
|
691
|
-
key: "_onGroupsChanged",
|
|
692
|
-
value: function _onGroupsChanged(model, key, updates) {
|
|
693
|
-
this._unloadRemovedGroupsAndLoadNewGroupsAndTriggerWatches();
|
|
694
|
-
}
|
|
695
|
-
/** @internal */
|
|
696
|
-
}, {
|
|
697
|
-
key: "_onRecordsChanged",
|
|
698
|
-
value: function _onRecordsChanged(model, key, updates) {
|
|
699
|
-
if (model instanceof _view_data_store.default) {
|
|
700
|
-
// For a view model, we don't get updates sent with the onChange event,
|
|
701
|
-
// so we need to manually generate updates based on the old and new
|
|
702
|
-
// recordIds.
|
|
703
|
-
(0, _error_utils.invariant)(this._orderedRecordIds, '_orderedRecordIds unset');
|
|
704
|
-
var visibleRecordIds = this._recordStore.getViewDataStore(model.viewId).visibleRecordIds;
|
|
705
|
-
var _addedRecordIds = (0, _private_utils.arrayDifference)(visibleRecordIds, this._orderedRecordIds);
|
|
706
|
-
var _removedRecordIds = (0, _private_utils.arrayDifference)(this._orderedRecordIds, visibleRecordIds);
|
|
707
|
-
updates = {
|
|
708
|
-
addedRecordIds: _addedRecordIds,
|
|
709
|
-
removedRecordIds: _removedRecordIds
|
|
710
|
-
};
|
|
711
|
-
}
|
|
712
|
-
if (!updates) {
|
|
713
|
-
// If there are no updates, do nothing, since we'll handle the initial
|
|
714
|
-
// callback when the record set is loaded (and we don't want to fire
|
|
715
|
-
// a records change twice with no data).
|
|
716
|
-
return;
|
|
717
|
-
}
|
|
718
|
-
var _updates = updates,
|
|
719
|
-
addedRecordIds = _updates.addedRecordIds,
|
|
720
|
-
removedRecordIds = _updates.removedRecordIds;
|
|
721
|
-
if (this._sorts) {
|
|
722
|
-
var visList = this._visList;
|
|
723
|
-
(0, _error_utils.invariant)(visList, 'No vis list');
|
|
724
|
-
if (removedRecordIds.length > 0) {
|
|
725
|
-
visList.removeRecordIds(removedRecordIds);
|
|
726
|
-
}
|
|
727
|
-
if (addedRecordIds.length > 0) {
|
|
728
|
-
this._addRecordIdsToVisList(addedRecordIds);
|
|
729
|
-
}
|
|
730
|
-
}
|
|
731
|
-
if (this._recordIdsSet) {
|
|
732
|
-
var _iterator11 = _createForOfIteratorHelper(addedRecordIds),
|
|
733
|
-
_step11;
|
|
734
|
-
try {
|
|
735
|
-
for (_iterator11.s(); !(_step11 = _iterator11.n()).done;) {
|
|
736
|
-
var recordId = _step11.value;
|
|
737
|
-
this._recordIdsSet[recordId] = true;
|
|
738
|
-
}
|
|
739
|
-
} catch (err) {
|
|
740
|
-
_iterator11.e(err);
|
|
741
|
-
} finally {
|
|
742
|
-
_iterator11.f();
|
|
743
|
-
}
|
|
744
|
-
var _iterator12 = _createForOfIteratorHelper(removedRecordIds),
|
|
745
|
-
_step12;
|
|
746
|
-
try {
|
|
747
|
-
for (_iterator12.s(); !(_step12 = _iterator12.n()).done;) {
|
|
748
|
-
var _recordId = _step12.value;
|
|
749
|
-
this._recordIdsSet[_recordId] = undefined;
|
|
750
|
-
}
|
|
751
|
-
} catch (err) {
|
|
752
|
-
_iterator12.e(err);
|
|
753
|
-
} finally {
|
|
754
|
-
_iterator12.f();
|
|
755
|
-
}
|
|
756
|
-
}
|
|
757
|
-
|
|
758
|
-
// Now that we've applied our changes (if applicable), let's regenerate our recordIds.
|
|
759
|
-
this._orderedRecordIds = this._generateOrderedRecordIds();
|
|
760
|
-
this._onChange(_record_query_result.default.WatchableKeys.records, updates);
|
|
761
|
-
this._onChange(_record_query_result.default.WatchableKeys.recordIds, updates);
|
|
762
|
-
}
|
|
763
|
-
/** @internal */
|
|
764
|
-
// istanbul ignore next
|
|
765
|
-
}, {
|
|
766
|
-
key: "_onCellValuesForGroupChanged",
|
|
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
|
-
}
|
|
774
|
-
/** @internal */
|
|
775
|
-
}, {
|
|
776
|
-
key: "_onCellValuesForSortChanged",
|
|
777
|
-
value: function _onCellValuesForSortChanged(recordStore, key, recordIds, fieldId) {
|
|
778
|
-
if (!recordIds || !fieldId) {
|
|
779
|
-
// If there are no updates, do nothing, since we'll handle the initial
|
|
780
|
-
// callback when the record set is loaded (and we don't want to fire
|
|
781
|
-
// a records change twice with no data).
|
|
782
|
-
return;
|
|
783
|
-
}
|
|
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.
|
|
787
|
-
var visList = this._visList;
|
|
788
|
-
(0, _error_utils.invariant)(visList, 'No vis list');
|
|
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.
|
|
792
|
-
// It's possible to have recordId that is not currently in the visList since
|
|
793
|
-
// this callback can run before onRecordsChanged. (eg. when a deleted record is
|
|
794
|
-
// restored, this is triggered for that record but the record is not yet in the visList:
|
|
795
|
-
// onRecordsChanged actually adds it)
|
|
796
|
-
// Note: cell value changes that result in the records being filtered out trigger
|
|
797
|
-
// onRecordsChanged on the View model, so we don't have to worry about that here.
|
|
798
|
-
var visListRecordIdsSet = new Set(visList.getOrderedRecordIds());
|
|
799
|
-
var recordIdsToMove = recordIds.filter(recordId => visListRecordIdsSet.has(recordId));
|
|
800
|
-
visList.removeRecordIds(recordIdsToMove);
|
|
801
|
-
this._addRecordIdsToVisList(recordIdsToMove);
|
|
802
|
-
this._orderedRecordIds = this._generateOrderedRecordIds();
|
|
803
|
-
var changeData = {
|
|
804
|
-
addedRecordIds: [],
|
|
805
|
-
removedRecordIds: []
|
|
806
|
-
};
|
|
807
|
-
this._onChange(_record_query_result.default.WatchableKeys.records, changeData);
|
|
808
|
-
this._onChange(_record_query_result.default.WatchableKeys.recordIds, changeData);
|
|
809
|
-
}
|
|
810
|
-
/** @internal */
|
|
811
|
-
}, {
|
|
812
|
-
key: "_onFieldConfigChanged",
|
|
813
|
-
value: function _onFieldConfigChanged(_field, _key) {
|
|
814
|
-
// Field config changed for a field we rely on, so we need to replace our vis list.
|
|
815
|
-
// NOTE: this will only ever be called if we have sorts, so it's safe to assume we
|
|
816
|
-
// are using a vis list here.
|
|
817
|
-
this._replaceVisList();
|
|
818
|
-
this._orderedRecordIds = this._generateOrderedRecordIds();
|
|
819
|
-
}
|
|
820
|
-
/** @internal */
|
|
821
|
-
}, {
|
|
822
|
-
key: "_onTableFieldsChanged",
|
|
823
|
-
value: function _onTableFieldsChanged(table, key, updates) {
|
|
824
|
-
if (!this._sorts) {
|
|
825
|
-
// If we don't have any sorts, we don't have to do anything in response to field changes.
|
|
826
|
-
return;
|
|
827
|
-
}
|
|
828
|
-
var addedFieldIds = updates.addedFieldIds,
|
|
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,
|
|
833
|
-
// replace our vis list.
|
|
834
|
-
// NOTE: we need to check for created, since a field that we rely on can be
|
|
835
|
-
// deleted and then undeleted.
|
|
836
|
-
var wereAnyFieldsCreatedOrDeleted = false;
|
|
837
|
-
var _iterator13 = _createForOfIteratorHelper(addedFieldIds),
|
|
838
|
-
_step13;
|
|
839
|
-
try {
|
|
840
|
-
for (_iterator13.s(); !(_step13 = _iterator13.n()).done;) {
|
|
841
|
-
var fieldId = _step13.value;
|
|
842
|
-
// If a field that we rely on was created (i.e. it was undeleted), we need to
|
|
843
|
-
// make sure we're watching it's config.
|
|
844
|
-
if (fieldIdsSet.has(fieldId)) {
|
|
845
|
-
wereAnyFieldsCreatedOrDeleted = true;
|
|
846
|
-
var field = this._table.getFieldByIdIfExists(fieldId);
|
|
847
|
-
(0, _error_utils.invariant)(field, 'Created field does not exist');
|
|
848
|
-
field.watch('type', this._onFieldConfigChanged, this);
|
|
849
|
-
field.watch('options', this._onFieldConfigChanged, this);
|
|
850
|
-
}
|
|
851
|
-
}
|
|
852
|
-
|
|
853
|
-
// coverage analysis
|
|
854
|
-
// istanbul ignore else
|
|
855
|
-
} catch (err) {
|
|
856
|
-
_iterator13.e(err);
|
|
857
|
-
} finally {
|
|
858
|
-
_iterator13.f();
|
|
859
|
-
}
|
|
860
|
-
if (!wereAnyFieldsCreatedOrDeleted) {
|
|
861
|
-
wereAnyFieldsCreatedOrDeleted = removedFieldIds.some(fieldId => fieldIdsSet.has(fieldId));
|
|
862
|
-
}
|
|
863
|
-
if (wereAnyFieldsCreatedOrDeleted) {
|
|
864
|
-
// One of the fields we're relying on was deleted,
|
|
865
|
-
this._replaceVisList();
|
|
866
|
-
this._orderedRecordIds = this._generateOrderedRecordIds();
|
|
867
|
-
|
|
868
|
-
// Make sure we fire onChange events since the order may have changed
|
|
869
|
-
// as a result.
|
|
870
|
-
var changeData = {
|
|
871
|
-
addedRecordIds: [],
|
|
872
|
-
removedRecordIds: []
|
|
873
|
-
};
|
|
874
|
-
this._onChange(_record_query_result.default.WatchableKeys.records, changeData);
|
|
875
|
-
this._onChange(_record_query_result.default.WatchableKeys.recordIds, changeData);
|
|
876
|
-
|
|
877
|
-
// We do not unload/reload groupQueryResults if it's field is deleted as
|
|
878
|
-
// it is responsible for failing to load if the field doesn't exist
|
|
879
|
-
}
|
|
880
|
-
}
|
|
881
|
-
/** @internal */
|
|
882
|
-
}, {
|
|
883
|
-
key: "_onCellValuesChanged",
|
|
884
|
-
value: function _onCellValuesChanged(table, key, updates) {
|
|
885
|
-
if (!updates) {
|
|
886
|
-
// If there are no updates, do nothing, since we'll handle the initial
|
|
887
|
-
// callback when the record set is loaded (and we don't want to fire
|
|
888
|
-
// a cellValues change twice with no data).
|
|
889
|
-
return;
|
|
890
|
-
}
|
|
891
|
-
this._onChange(_record_query_result.default.WatchableKeys.cellValues, updates);
|
|
892
|
-
}
|
|
893
|
-
/** @internal */
|
|
894
|
-
}, {
|
|
895
|
-
key: "_onCellValuesInFieldChanged",
|
|
896
|
-
value: function _onCellValuesInFieldChanged(table, key, recordIds, fieldId) {
|
|
897
|
-
if (!recordIds && !fieldId) {
|
|
898
|
-
// If there are no updates, do nothing, since we'll handle the initial
|
|
899
|
-
// callback when the record set is loaded (and we don't want to fire
|
|
900
|
-
// a cellValuesInField change twice with no data).
|
|
901
|
-
return;
|
|
902
|
-
}
|
|
903
|
-
this._onChange(key, recordIds, fieldId);
|
|
904
|
-
}
|
|
905
|
-
/** @internal */
|
|
906
|
-
}, {
|
|
907
|
-
key: "_generateOrderedRecordIds",
|
|
908
|
-
value: function _generateOrderedRecordIds() {
|
|
909
|
-
if (this._sorts) {
|
|
910
|
-
(0, _error_utils.invariant)(this._visList, 'Cannot generate record ids without a vis list');
|
|
911
|
-
return this._visList.getOrderedRecordIds();
|
|
912
|
-
} else {
|
|
913
|
-
return this._sourceModelRecordIds;
|
|
914
|
-
}
|
|
915
|
-
}
|
|
916
|
-
/** @internal */
|
|
917
|
-
}, {
|
|
918
|
-
key: "_generateAndLoadOrderedGroups",
|
|
919
|
-
value: function _generateAndLoadOrderedGroups() {
|
|
920
|
-
// istanbul ignore next
|
|
921
|
-
if (this._groupLevels) {
|
|
922
|
-
(0, _error_utils.invariant)(this._visList, 'Cannot generate record ids without a vis list');
|
|
923
|
-
throw (0, _error_utils.spawnError)('custom group configs not supported');
|
|
924
|
-
} else {
|
|
925
|
-
// Get the group from the view itself
|
|
926
|
-
var groupLevels = this._sourceModelGroupLevels;
|
|
927
|
-
if (!this._sourceModelGroups || !groupLevels) {
|
|
928
|
-
return null;
|
|
929
|
-
}
|
|
930
|
-
return this._sourceModelGroups.map(groupData => {
|
|
931
|
-
var group = this.__groupedRecordQueryResultPool.getObjectForReuse(this, groupData, groupLevels, this._normalizedOpts, this._sdk);
|
|
932
|
-
// Don't await the loading, let others check isDataLoaded.
|
|
933
|
-
// (it doesn't take any time anyway). Loading also strong retains.
|
|
934
|
-
group.loadDataAsync();
|
|
935
|
-
return group;
|
|
936
|
-
});
|
|
937
|
-
}
|
|
938
|
-
}
|
|
939
|
-
/** @internal */
|
|
940
|
-
}, {
|
|
941
|
-
key: "_unloadOrderedGroupsIfNeeded",
|
|
942
|
-
value: function _unloadOrderedGroupsIfNeeded() {
|
|
943
|
-
if (this._orderedGroups) {
|
|
944
|
-
var _iterator14 = _createForOfIteratorHelper(this._orderedGroups),
|
|
945
|
-
_step14;
|
|
946
|
-
try {
|
|
947
|
-
for (_iterator14.s(); !(_step14 = _iterator14.n()).done;) {
|
|
948
|
-
var group = _step14.value;
|
|
949
|
-
group.unloadData();
|
|
950
|
-
}
|
|
951
|
-
} catch (err) {
|
|
952
|
-
_iterator14.e(err);
|
|
953
|
-
} finally {
|
|
954
|
-
_iterator14.f();
|
|
955
|
-
}
|
|
956
|
-
}
|
|
957
|
-
}
|
|
958
|
-
/**
|
|
959
|
-
* If groupings change then some groups will need to be created, and some removed
|
|
960
|
-
* This (TODO: will) handle the diffing necessary to unload, and reload only the changed groups.
|
|
961
|
-
* Also triggers the WatchableKeys.group, as by necessity this will have changed.
|
|
962
|
-
*
|
|
963
|
-
* @internal
|
|
964
|
-
*/
|
|
965
|
-
// TODO: (SeanKeenan) Properly diff and only unload groups that need to be unloaded
|
|
966
|
-
// In the meantime it's not too expensive to just unload everything, and GroupedRecordQueryResults
|
|
967
|
-
// don't yet properly watch changes relevant to updating, so this isn't too bad.
|
|
968
|
-
// (They do invalidate their recordId caches, which is some very cheap work that we could remove)
|
|
969
|
-
}, {
|
|
970
|
-
key: "_unloadRemovedGroupsAndLoadNewGroupsAndTriggerWatches",
|
|
971
|
-
value: function _unloadRemovedGroupsAndLoadNewGroupsAndTriggerWatches() {
|
|
972
|
-
this._unloadOrderedGroupsIfNeeded();
|
|
973
|
-
this._orderedGroups = this._generateAndLoadOrderedGroups();
|
|
974
|
-
this._onChange(_record_query_result.default.WatchableKeys.groups);
|
|
975
|
-
}
|
|
976
|
-
/** @internal */
|
|
977
|
-
}, {
|
|
978
|
-
key: "_replaceVisList",
|
|
979
|
-
value: function _replaceVisList() {
|
|
980
|
-
var airtableInterface = this._sdk.__airtableInterface;
|
|
981
|
-
var appInterface = this._sdk.__appInterface;
|
|
982
|
-
var recordDatas = this._sourceModelRecords.map(record => record._data);
|
|
983
|
-
var fieldDatas = this._table.fields.map(field => field._data);
|
|
984
|
-
var filteredSorts = this._getSortsWithDeletedFieldsFiltered();
|
|
985
|
-
this._visList = airtableInterface.createVisList(appInterface, recordDatas, fieldDatas, filteredSorts);
|
|
986
|
-
}
|
|
987
|
-
/** @internal */
|
|
988
|
-
}, {
|
|
989
|
-
key: "_getSortsWithDeletedFieldsFiltered",
|
|
990
|
-
value: function _getSortsWithDeletedFieldsFiltered() {
|
|
991
|
-
(0, _error_utils.invariant)(this._sorts, 'No sorts');
|
|
992
|
-
|
|
993
|
-
// Filter out any sorts levels that rely on deleted fields.
|
|
994
|
-
// NOTE: we keep deleted fields around (rather than filtering them out
|
|
995
|
-
// in realtime) in case a field gets undeleted, in which case we want to
|
|
996
|
-
// keep using it.
|
|
997
|
-
return this._sorts.filter(sort => {
|
|
998
|
-
var field = this._table.getFieldByIdIfExists(sort.fieldId);
|
|
999
|
-
return !!field;
|
|
1000
|
-
});
|
|
1001
|
-
}
|
|
1002
|
-
/** @internal */
|
|
1003
|
-
}, {
|
|
1004
|
-
key: "_spawnErrorForDeletion",
|
|
1005
|
-
value: function _spawnErrorForDeletion() {
|
|
1006
|
-
var sourceModelName = this._sourceModel instanceof _table.default ? 'table' : 'view';
|
|
1007
|
-
return (0, _error_utils.spawnError)("RecordQueryResult's underlying %s has been deleted", sourceModelName);
|
|
1008
|
-
}
|
|
1009
|
-
}]);
|
|
1010
|
-
}(_record_query_result.default);
|
|
1011
|
-
/** @internal */
|
|
1012
|
-
(0, _defineProperty2.default)(TableOrViewQueryResult, "_className", 'TableOrViewQueryResult');
|
|
1013
|
-
var _default = exports.default = TableOrViewQueryResult;
|