@airtable/blocks 0.0.0-experimental-e5ab33b68-20250905 → 0.0.0-experimental-e625869e5-20251002
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 +9 -0
- package/dist/esm/base/index.js +42 -0
- package/dist/{cjs → esm}/base/models/abstract_model_with_async_data.js +8 -15
- package/dist/{cjs → esm}/base/models/base.js +42 -22
- package/dist/{cjs → esm}/base/models/create_aggregators.js +11 -24
- package/dist/{cjs → esm}/base/models/cursor.js +21 -28
- package/dist/{cjs → esm}/base/models/field.js +16 -24
- package/dist/{cjs → esm}/base/models/grouped_record_query_result.js +9 -15
- package/dist/{cjs → esm}/base/models/linked_records_query_result.js +42 -50
- package/dist/esm/base/models/models.js +19 -0
- package/dist/{cjs → esm}/base/models/mutations.js +68 -74
- package/dist/{cjs → esm}/base/models/object_pool.js +4 -11
- package/dist/{cjs → esm}/base/models/record.js +18 -25
- package/dist/{cjs → esm}/base/models/record_coloring.js +3 -10
- package/dist/{cjs → esm}/base/models/record_query_result.js +52 -61
- package/dist/{cjs → esm}/base/models/record_store.js +33 -42
- package/dist/{cjs → esm}/base/models/session.js +7 -12
- package/dist/{cjs → esm}/base/models/table.js +31 -39
- package/dist/{cjs → esm}/base/models/table_or_view_query_result.js +74 -82
- package/dist/{cjs → esm}/base/models/view.js +17 -25
- package/dist/{cjs → esm}/base/models/view_data_store.js +19 -26
- package/dist/{cjs → esm}/base/models/view_metadata_query_result.js +9 -16
- package/dist/{cjs → esm}/base/perform_record_action.js +9 -19
- package/dist/{cjs → esm}/base/sdk.js +20 -27
- package/dist/{cjs → esm}/base/settings_button.js +5 -13
- package/dist/esm/base/types/aggregators.js +1 -0
- package/dist/{cjs → esm}/base/types/airtable_interface.js +18 -10
- package/dist/esm/base/types/backend_fetch_types.js +1 -0
- package/dist/esm/base/types/base.js +1 -0
- package/dist/esm/base/types/cursor.js +1 -0
- package/dist/esm/base/types/field.js +1 -0
- package/dist/{cjs → esm}/base/types/mutations.js +3 -9
- package/dist/esm/base/types/record.js +1 -0
- package/dist/esm/base/types/record_action_data.js +1 -0
- package/dist/esm/base/types/table.js +1 -0
- package/dist/esm/base/types/undo_redo.js +6 -0
- package/dist/{cjs → esm}/base/types/view.js +7 -8
- package/dist/esm/base/types/viewport.js +1 -0
- package/dist/esm/base/ui/base_provider.js +41 -0
- package/dist/esm/base/ui/block_wrapper.js +143 -0
- package/dist/esm/base/ui/cell_renderer.js +19 -0
- package/dist/{cjs → esm}/base/ui/expand_record.js +1 -7
- package/dist/{cjs → esm}/base/ui/expand_record_list.js +4 -10
- package/dist/{cjs → esm}/base/ui/expand_record_picker_async.js +4 -10
- package/dist/esm/base/ui/global_alert.js +65 -0
- package/dist/esm/base/ui/global_css_helpers.js +28 -0
- package/dist/esm/base/ui/initialize_block.js +110 -0
- package/dist/esm/base/ui/ui.js +32 -0
- package/dist/esm/base/ui/unstable_standalone_ui.js +29 -0
- package/dist/{cjs → esm}/base/ui/use_base.js +4 -10
- package/dist/{cjs → esm}/base/ui/use_cursor.js +5 -12
- package/dist/{cjs → esm}/base/ui/use_loadable.js +13 -21
- package/dist/{cjs → esm}/base/ui/use_record_action_data.js +9 -15
- package/dist/{cjs → esm}/base/ui/use_records.js +21 -33
- package/dist/{cjs → esm}/base/ui/use_session.js +4 -10
- package/dist/{cjs → esm}/base/ui/use_settings_button.js +7 -15
- package/dist/{cjs → esm}/base/ui/use_view_metadata.js +8 -14
- package/dist/{cjs → esm}/base/ui/use_viewport.js +5 -12
- package/dist/esm/base/undo_redo.js +31 -0
- package/dist/esm/base/unstable_testing_utils.js +6 -0
- package/dist/{cjs → esm}/base/viewport.js +9 -17
- package/dist/{cjs → esm}/injected/airtable_interface.js +3 -9
- package/dist/esm/interface/assert_run_context.js +9 -0
- package/dist/esm/interface/index.js +16 -0
- package/dist/{cjs → esm}/interface/models/base.js +7 -13
- package/dist/{cjs → esm}/interface/models/field.js +3 -9
- package/dist/esm/interface/models/models.js +9 -0
- package/dist/{cjs → esm}/interface/models/mutations.js +6 -13
- package/dist/{cjs → esm}/interface/models/record.js +9 -16
- package/dist/esm/interface/models/record_store.js +42 -0
- package/dist/{cjs → esm}/interface/models/session.js +2 -8
- package/dist/{cjs → esm}/interface/models/table.js +7 -13
- package/dist/{cjs → esm}/interface/sdk.js +9 -16
- package/dist/{cjs → esm}/interface/types/airtable_interface.js +13 -12
- package/dist/esm/interface/types/base.js +1 -0
- package/dist/esm/interface/types/field.js +1 -0
- package/dist/esm/interface/types/mutations.js +12 -0
- package/dist/esm/interface/types/record.js +1 -0
- package/dist/esm/interface/types/table.js +1 -0
- package/dist/esm/interface/ui/block_wrapper.js +49 -0
- package/dist/esm/interface/ui/cell_renderer.js +19 -0
- package/dist/{cjs → esm}/interface/ui/expand_record.js +1 -7
- package/dist/esm/interface/ui/global_css_helpers.js +17 -0
- package/dist/esm/interface/ui/initialize_block.js +83 -0
- package/dist/esm/interface/ui/ui.js +20 -0
- package/dist/{cjs → esm}/interface/ui/use_base.js +3 -10
- package/dist/{cjs → esm}/interface/ui/use_custom_properties.js +61 -39
- package/dist/{cjs → esm}/interface/ui/use_records.js +5 -12
- package/dist/{cjs → esm}/interface/ui/use_run_info.js +4 -9
- package/dist/{cjs → esm}/interface/ui/use_session.js +3 -10
- package/dist/esm/sdk_mode.js +1 -0
- package/dist/esm/shared/color_utils.js +50 -0
- package/dist/{cjs → esm}/shared/colors.js +4 -8
- package/dist/{cjs → esm}/shared/error_utils.js +5 -15
- package/dist/esm/shared/event_tracker.js +20 -0
- package/dist/{cjs → esm}/shared/global_config.js +13 -19
- package/dist/{cjs → esm}/shared/models/abstract_model.js +6 -14
- package/dist/{cjs → esm}/shared/models/base_core.js +22 -29
- package/dist/{cjs → esm}/shared/models/field_core.js +9 -16
- package/dist/{cjs → esm}/shared/models/mutations_core.js +36 -43
- package/dist/{cjs → esm}/shared/models/record_core.js +17 -25
- package/dist/{cjs → esm}/shared/models/record_store_core.js +15 -22
- package/dist/{cjs → esm}/shared/models/session_core.js +9 -17
- package/dist/{cjs → esm}/shared/models/table_core.js +29 -36
- package/dist/{cjs → esm}/shared/private_utils.js +85 -71
- package/dist/{cjs → esm}/shared/sdk_core.js +6 -13
- package/dist/esm/shared/types/airtable_interface_core.js +1 -0
- package/dist/esm/shared/types/attachment.js +1 -0
- package/dist/esm/shared/types/base_core.js +1 -0
- package/dist/esm/shared/types/collaborator.js +1 -0
- package/dist/{cjs → esm}/shared/types/field_core.js +51 -8
- package/dist/esm/shared/types/global_config.js +1 -0
- package/dist/esm/shared/types/hyper_ids.js +1 -0
- package/dist/esm/shared/types/mutation_constants.js +5 -0
- package/dist/{cjs → esm}/shared/types/mutations_core.js +1 -7
- package/dist/esm/shared/types/permission_levels.js +11 -0
- 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/esm/shared/ui/cell_renderer.js +137 -0
- package/dist/esm/shared/ui/global_config_synced_component_helpers.js +21 -0
- package/dist/{cjs → esm}/shared/ui/loader.js +2 -10
- package/dist/{cjs → esm}/shared/ui/remote_utils.js +7 -15
- package/dist/esm/shared/ui/sdk_context.js +8 -0
- package/dist/{cjs → esm}/shared/ui/use_array_identity.js +3 -8
- package/dist/esm/shared/ui/use_base.js +16 -0
- package/dist/{cjs → esm}/shared/ui/use_color_scheme.js +4 -10
- package/dist/{cjs → esm}/shared/ui/use_global_config.js +7 -13
- package/dist/esm/shared/ui/use_session.js +15 -0
- package/dist/{cjs → esm}/shared/ui/use_synced.js +5 -11
- package/dist/{cjs → esm}/shared/ui/use_watchable.js +11 -19
- package/dist/{cjs → esm}/shared/ui/with_hooks.js +7 -13
- package/dist/esm/shared/unstable_private_utils.js +4 -0
- package/dist/{cjs → esm}/shared/warning.js +3 -11
- package/dist/{cjs → esm}/shared/watchable.js +5 -11
- package/dist/{cjs → esm}/stats/block_stats.js +8 -14
- package/dist/{cjs → esm}/testing/base/abstract_mock_airtable_interface.js +8 -17
- package/dist/{cjs → esm}/testing/interface/abstract_mock_airtable_interface.js +8 -17
- package/dist/types/src/base/index.d.ts +0 -2
- package/dist/types/src/base/index.d.ts.map +1 -1
- package/dist/types/src/base/models/abstract_model_with_async_data.d.ts +3 -3
- package/dist/types/src/base/models/abstract_model_with_async_data.d.ts.map +1 -1
- package/dist/types/src/base/models/base.d.ts +21 -3
- package/dist/types/src/base/models/base.d.ts.map +1 -1
- package/dist/types/src/base/models/create_aggregators.d.ts +7 -8
- package/dist/types/src/base/models/create_aggregators.d.ts.map +1 -1
- package/dist/types/src/base/models/cursor.d.ts +2 -2
- package/dist/types/src/base/models/cursor.d.ts.map +1 -1
- package/dist/types/src/base/models/field.d.ts +9 -8
- package/dist/types/src/base/models/field.d.ts.map +1 -1
- package/dist/types/src/base/models/grouped_record_query_result.d.ts +6 -6
- package/dist/types/src/base/models/grouped_record_query_result.d.ts.map +1 -1
- package/dist/types/src/base/models/linked_records_query_result.d.ts +4 -4
- package/dist/types/src/base/models/linked_records_query_result.d.ts.map +1 -1
- package/dist/types/src/base/models/models.d.ts +2 -3
- package/dist/types/src/base/models/models.d.ts.map +1 -1
- package/dist/types/src/base/models/mutations.d.ts +1 -1
- package/dist/types/src/base/models/mutations.d.ts.map +1 -1
- package/dist/types/src/base/models/record.d.ts +8 -8
- package/dist/types/src/base/models/record.d.ts.map +1 -1
- package/dist/types/src/base/models/record_coloring.d.ts +3 -3
- package/dist/types/src/base/models/record_coloring.d.ts.map +1 -1
- package/dist/types/src/base/models/record_query_result.d.ts +5 -5
- package/dist/types/src/base/models/record_query_result.d.ts.map +1 -1
- package/dist/types/src/base/models/session.d.ts +2 -2
- package/dist/types/src/base/models/session.d.ts.map +1 -1
- package/dist/types/src/base/models/table.d.ts +7 -7
- package/dist/types/src/base/models/table.d.ts.map +1 -1
- package/dist/types/src/base/models/table_or_view_query_result.d.ts +5 -5
- package/dist/types/src/base/models/table_or_view_query_result.d.ts.map +1 -1
- package/dist/types/src/base/models/view.d.ts +6 -6
- package/dist/types/src/base/models/view.d.ts.map +1 -1
- package/dist/types/src/base/models/view_metadata_query_result.d.ts +5 -5
- package/dist/types/src/base/models/view_metadata_query_result.d.ts.map +1 -1
- package/dist/types/src/base/perform_record_action.d.ts +2 -2
- package/dist/types/src/base/perform_record_action.d.ts.map +1 -1
- package/dist/types/src/base/sdk.d.ts +3 -3
- package/dist/types/src/base/sdk.d.ts.map +1 -1
- package/dist/types/src/base/settings_button.d.ts +1 -1
- package/dist/types/src/base/settings_button.d.ts.map +1 -1
- package/dist/types/src/base/types/airtable_interface.d.ts +16 -18
- package/dist/types/src/base/types/airtable_interface.d.ts.map +1 -1
- package/dist/types/src/base/types/base.d.ts +4 -4
- package/dist/types/src/base/types/base.d.ts.map +1 -1
- package/dist/types/src/base/types/cursor.d.ts +2 -2
- package/dist/types/src/base/types/cursor.d.ts.map +1 -1
- package/dist/types/src/base/types/field.d.ts +1 -1
- package/dist/types/src/base/types/field.d.ts.map +1 -1
- package/dist/types/src/base/types/mutations.d.ts +5 -5
- package/dist/types/src/base/types/mutations.d.ts.map +1 -1
- package/dist/types/src/base/types/record.d.ts +1 -1
- package/dist/types/src/base/types/record.d.ts.map +1 -1
- package/dist/types/src/base/types/record_action_data.d.ts +1 -1
- package/dist/types/src/base/types/record_action_data.d.ts.map +1 -1
- package/dist/types/src/base/types/table.d.ts +6 -6
- package/dist/types/src/base/types/table.d.ts.map +1 -1
- package/dist/types/src/base/types/undo_redo.d.ts +1 -1
- package/dist/types/src/base/types/undo_redo.d.ts.map +1 -1
- package/dist/types/src/base/types/view.d.ts +3 -3
- package/dist/types/src/base/types/view.d.ts.map +1 -1
- package/dist/types/src/base/ui/base_provider.d.ts +1 -1
- package/dist/types/src/base/ui/base_provider.d.ts.map +1 -1
- package/dist/types/src/base/ui/block_wrapper.d.ts +3 -17
- package/dist/types/src/base/ui/block_wrapper.d.ts.map +1 -1
- package/dist/types/src/base/ui/cell_renderer.d.ts +6 -58
- package/dist/types/src/base/ui/cell_renderer.d.ts.map +1 -1
- package/dist/types/src/base/ui/expand_record.d.ts +1 -1
- package/dist/types/src/base/ui/expand_record.d.ts.map +1 -1
- package/dist/types/src/base/ui/expand_record_list.d.ts +2 -2
- package/dist/types/src/base/ui/expand_record_list.d.ts.map +1 -1
- package/dist/types/src/base/ui/expand_record_picker_async.d.ts +2 -2
- package/dist/types/src/base/ui/expand_record_picker_async.d.ts.map +1 -1
- package/dist/types/src/base/ui/global_alert.d.ts +1 -1
- package/dist/types/src/base/ui/global_alert.d.ts.map +1 -1
- package/dist/types/src/base/ui/global_css_helpers.d.ts +4 -0
- package/dist/types/src/base/ui/global_css_helpers.d.ts.map +1 -0
- package/dist/types/src/base/ui/initialize_block.d.ts +3 -3
- package/dist/types/src/base/ui/initialize_block.d.ts.map +1 -1
- package/dist/types/src/base/ui/ui.d.ts +1 -21
- package/dist/types/src/base/ui/ui.d.ts.map +1 -1
- package/dist/types/src/base/ui/unstable_standalone_ui.d.ts +2 -22
- package/dist/types/src/base/ui/unstable_standalone_ui.d.ts.map +1 -1
- package/dist/types/src/base/ui/use_cursor.d.ts +1 -1
- package/dist/types/src/base/ui/use_cursor.d.ts.map +1 -1
- package/dist/types/src/base/ui/use_loadable.d.ts.map +1 -1
- package/dist/types/src/base/ui/use_record_action_data.d.ts +1 -1
- package/dist/types/src/base/ui/use_record_action_data.d.ts.map +1 -1
- package/dist/types/src/base/ui/use_records.d.ts +5 -5
- package/dist/types/src/base/ui/use_records.d.ts.map +1 -1
- package/dist/types/src/base/ui/use_settings_button.d.ts +1 -1
- package/dist/types/src/base/ui/use_settings_button.d.ts.map +1 -1
- package/dist/types/src/base/ui/use_view_metadata.d.ts +1 -1
- package/dist/types/src/base/ui/use_view_metadata.d.ts.map +1 -1
- package/dist/types/src/base/ui/use_viewport.d.ts +1 -1
- package/dist/types/src/base/ui/use_viewport.d.ts.map +1 -1
- package/dist/types/src/base/undo_redo.d.ts +2 -2
- package/dist/types/src/base/undo_redo.d.ts.map +1 -1
- package/dist/types/src/base/unstable_testing_utils.d.ts +13 -11
- package/dist/types/src/base/unstable_testing_utils.d.ts.map +1 -1
- package/dist/types/src/base/viewport.d.ts +2 -2
- package/dist/types/src/base/viewport.d.ts.map +1 -1
- package/dist/types/src/injected/airtable_interface.d.ts +1 -1
- package/dist/types/src/injected/airtable_interface.d.ts.map +1 -1
- package/dist/types/src/interface/models/base.d.ts +1 -1
- package/dist/types/src/interface/models/base.d.ts.map +1 -1
- package/dist/types/src/interface/models/field.d.ts +1 -1
- package/dist/types/src/interface/models/field.d.ts.map +1 -1
- package/dist/types/src/interface/models/models.d.ts +2 -1
- package/dist/types/src/interface/models/models.d.ts.map +1 -1
- package/dist/types/src/interface/models/mutations.d.ts +1 -1
- package/dist/types/src/interface/models/mutations.d.ts.map +1 -1
- package/dist/types/src/interface/models/record.d.ts +4 -4
- package/dist/types/src/interface/models/record.d.ts.map +1 -1
- package/dist/types/src/interface/models/session.d.ts +1 -1
- package/dist/types/src/interface/models/session.d.ts.map +1 -1
- package/dist/types/src/interface/models/table.d.ts +2 -2
- package/dist/types/src/interface/models/table.d.ts.map +1 -1
- package/dist/types/src/interface/sdk.d.ts +2 -2
- package/dist/types/src/interface/sdk.d.ts.map +1 -1
- package/dist/types/src/interface/types/airtable_interface.d.ts +11 -9
- package/dist/types/src/interface/types/airtable_interface.d.ts.map +1 -1
- package/dist/types/src/interface/types/base.d.ts +2 -2
- package/dist/types/src/interface/types/base.d.ts.map +1 -1
- package/dist/types/src/interface/types/field.d.ts +1 -1
- package/dist/types/src/interface/types/field.d.ts.map +1 -1
- package/dist/types/src/interface/types/mutations.d.ts +2 -2
- package/dist/types/src/interface/types/mutations.d.ts.map +1 -1
- package/dist/types/src/interface/types/record.d.ts +1 -1
- package/dist/types/src/interface/types/record.d.ts.map +1 -1
- package/dist/types/src/interface/types/table.d.ts +5 -5
- package/dist/types/src/interface/types/table.d.ts.map +1 -1
- package/dist/types/src/interface/ui/block_wrapper.d.ts +2 -5
- package/dist/types/src/interface/ui/block_wrapper.d.ts.map +1 -1
- package/dist/types/src/interface/ui/cell_renderer.d.ts +19 -0
- package/dist/types/src/interface/ui/cell_renderer.d.ts.map +1 -0
- package/dist/types/src/interface/ui/expand_record.d.ts +1 -1
- package/dist/types/src/interface/ui/expand_record.d.ts.map +1 -1
- package/dist/types/src/interface/ui/global_css_helpers.d.ts +3 -0
- package/dist/types/src/interface/ui/global_css_helpers.d.ts.map +1 -0
- package/dist/types/src/interface/ui/initialize_block.d.ts +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 -1
- package/dist/types/src/interface/ui/ui.d.ts.map +1 -1
- package/dist/types/src/interface/ui/use_base.d.ts +1 -1
- package/dist/types/src/interface/ui/use_base.d.ts.map +1 -1
- package/dist/types/src/interface/ui/use_custom_properties.d.ts +10 -3
- package/dist/types/src/interface/ui/use_custom_properties.d.ts.map +1 -1
- package/dist/types/src/interface/ui/use_records.d.ts +2 -2
- package/dist/types/src/interface/ui/use_records.d.ts.map +1 -1
- package/dist/types/src/interface/ui/use_session.d.ts +1 -1
- package/dist/types/src/interface/ui/use_session.d.ts.map +1 -1
- package/dist/types/src/sdk_mode.d.ts +26 -26
- package/dist/types/src/sdk_mode.d.ts.map +1 -1
- package/dist/types/src/shared/color_utils.d.ts +1 -1
- package/dist/types/src/shared/color_utils.d.ts.map +1 -1
- package/dist/types/src/shared/colors.d.ts +1 -1
- package/dist/types/src/shared/colors.d.ts.map +1 -1
- package/dist/types/src/shared/global_config.d.ts +2 -2
- package/dist/types/src/shared/global_config.d.ts.map +1 -1
- package/dist/types/src/shared/models/abstract_model.d.ts +1 -1
- package/dist/types/src/shared/models/abstract_model.d.ts.map +1 -1
- package/dist/types/src/shared/models/base_core.d.ts +4 -4
- package/dist/types/src/shared/models/base_core.d.ts.map +1 -1
- package/dist/types/src/shared/models/field_core.d.ts +4 -4
- package/dist/types/src/shared/models/field_core.d.ts.map +1 -1
- package/dist/types/src/shared/models/mutations_core.d.ts +4 -4
- package/dist/types/src/shared/models/mutations_core.d.ts.map +1 -1
- package/dist/types/src/shared/models/record_core.d.ts +3 -3
- package/dist/types/src/shared/models/record_core.d.ts.map +1 -1
- package/dist/types/src/shared/models/session_core.d.ts +5 -5
- package/dist/types/src/shared/models/session_core.d.ts.map +1 -1
- package/dist/types/src/shared/models/table_core.d.ts +4 -4
- package/dist/types/src/shared/models/table_core.d.ts.map +1 -1
- package/dist/types/src/shared/private_utils.d.ts +9 -1
- package/dist/types/src/shared/private_utils.d.ts.map +1 -1
- package/dist/types/src/shared/sdk_core.d.ts +2 -2
- package/dist/types/src/shared/sdk_core.d.ts.map +1 -1
- package/dist/types/src/shared/types/airtable_interface_core.d.ts +9 -9
- package/dist/types/src/shared/types/airtable_interface_core.d.ts.map +1 -1
- package/dist/types/src/shared/types/attachment.d.ts +1 -1
- package/dist/types/src/shared/types/attachment.d.ts.map +1 -1
- package/dist/types/src/shared/types/base_core.d.ts +6 -6
- package/dist/types/src/shared/types/base_core.d.ts.map +1 -1
- package/dist/types/src/shared/types/collaborator.d.ts +1 -1
- package/dist/types/src/shared/types/collaborator.d.ts.map +1 -1
- package/dist/types/src/shared/types/field_core.d.ts +2 -2
- package/dist/types/src/shared/types/field_core.d.ts.map +1 -1
- package/dist/types/src/shared/types/mutations_core.d.ts +3 -3
- package/dist/types/src/shared/types/mutations_core.d.ts.map +1 -1
- package/dist/types/src/shared/types/permission_levels.d.ts +1 -1
- package/dist/types/src/shared/types/permission_levels.d.ts.map +1 -1
- package/dist/types/src/shared/types/record.d.ts +2 -2
- package/dist/types/src/shared/types/record.d.ts.map +1 -1
- package/dist/types/src/shared/types/table_core.d.ts +1 -1
- package/dist/types/src/shared/types/table_core.d.ts.map +1 -1
- package/dist/types/src/shared/ui/cell_renderer.d.ts +32 -0
- package/dist/types/src/shared/ui/cell_renderer.d.ts.map +1 -0
- package/dist/types/src/shared/ui/global_config_synced_component_helpers.d.ts +1 -1
- package/dist/types/src/shared/ui/global_config_synced_component_helpers.d.ts.map +1 -1
- package/dist/types/src/shared/ui/sdk_context.d.ts +1 -1
- package/dist/types/src/shared/ui/sdk_context.d.ts.map +1 -1
- package/dist/types/src/shared/ui/use_base.d.ts +1 -1
- package/dist/types/src/shared/ui/use_base.d.ts.map +1 -1
- package/dist/types/src/shared/ui/use_global_config.d.ts +1 -1
- package/dist/types/src/shared/ui/use_global_config.d.ts.map +1 -1
- package/dist/types/src/shared/ui/use_synced.d.ts +1 -1
- package/dist/types/src/shared/ui/use_synced.d.ts.map +1 -1
- package/dist/types/src/shared/ui/use_watchable.d.ts +1 -1
- package/dist/types/src/shared/ui/use_watchable.d.ts.map +1 -1
- package/dist/types/src/shared/warning.d.ts +2 -2
- package/dist/types/src/shared/warning.d.ts.map +1 -1
- package/dist/types/src/shared/watchable.d.ts +1 -1
- package/dist/types/src/shared/watchable.d.ts.map +1 -1
- package/dist/types/src/testing/base/abstract_mock_airtable_interface.d.ts +15 -16
- package/dist/types/src/testing/base/abstract_mock_airtable_interface.d.ts.map +1 -1
- package/dist/types/src/testing/interface/abstract_mock_airtable_interface.d.ts +8 -9
- package/dist/types/src/testing/interface/abstract_mock_airtable_interface.d.ts.map +1 -1
- package/models.js +1 -1
- package/package.json +23 -55
- package/types.js +1 -1
- package/dist/cjs/base/assert_run_context.js +0 -12
- package/dist/cjs/base/index.js +0 -96
- package/dist/cjs/base/models/models.js +0 -134
- package/dist/cjs/base/types/aggregators.js +0 -1
- package/dist/cjs/base/types/backend_fetch_types.js +0 -1
- package/dist/cjs/base/types/base.js +0 -1
- package/dist/cjs/base/types/cursor.js +0 -1
- package/dist/cjs/base/types/field.js +0 -1
- package/dist/cjs/base/types/record.js +0 -1
- package/dist/cjs/base/types/record_action_data.js +0 -1
- package/dist/cjs/base/types/table.js +0 -1
- package/dist/cjs/base/types/undo_redo.js +0 -12
- package/dist/cjs/base/types/viewport.js +0 -1
- package/dist/cjs/base/ui/base_provider.js +0 -48
- package/dist/cjs/base/ui/baymax_utils.js +0 -461
- package/dist/cjs/base/ui/block_wrapper.js +0 -118
- package/dist/cjs/base/ui/box.js +0 -84
- package/dist/cjs/base/ui/button.js +0 -152
- package/dist/cjs/base/ui/cell_renderer.js +0 -198
- package/dist/cjs/base/ui/choice_token.js +0 -93
- package/dist/cjs/base/ui/collaborator_token.js +0 -123
- package/dist/cjs/base/ui/color_palette.js +0 -196
- package/dist/cjs/base/ui/color_palette_synced.js +0 -69
- package/dist/cjs/base/ui/confirmation_dialog.js +0 -103
- package/dist/cjs/base/ui/control_sizes.js +0 -104
- package/dist/cjs/base/ui/create_detect_element_resize.js +0 -203
- package/dist/cjs/base/ui/css_helpers.js +0 -23
- package/dist/cjs/base/ui/dialog.js +0 -101
- package/dist/cjs/base/ui/dialog_close_button.js +0 -106
- package/dist/cjs/base/ui/field_icon.js +0 -44
- package/dist/cjs/base/ui/field_picker.js +0 -98
- package/dist/cjs/base/ui/field_picker_synced.js +0 -66
- package/dist/cjs/base/ui/form_field.js +0 -109
- package/dist/cjs/base/ui/geometry/geometry.js +0 -27
- package/dist/cjs/base/ui/geometry/point.js +0 -19
- package/dist/cjs/base/ui/geometry/rect.js +0 -51
- package/dist/cjs/base/ui/geometry/size.js +0 -19
- package/dist/cjs/base/ui/global_alert.js +0 -71
- package/dist/cjs/base/ui/heading.js +0 -132
- package/dist/cjs/base/ui/icon.js +0 -109
- package/dist/cjs/base/ui/icon_config.js +0 -428
- package/dist/cjs/base/ui/initialize_block.js +0 -122
- package/dist/cjs/base/ui/input.js +0 -161
- package/dist/cjs/base/ui/input_synced.js +0 -66
- package/dist/cjs/base/ui/key_codes.js +0 -73
- package/dist/cjs/base/ui/label.js +0 -80
- package/dist/cjs/base/ui/link.js +0 -196
- package/dist/cjs/base/ui/loader.js +0 -61
- package/dist/cjs/base/ui/modal.js +0 -145
- package/dist/cjs/base/ui/model_picker_select.js +0 -57
- package/dist/cjs/base/ui/popover.js +0 -315
- package/dist/cjs/base/ui/progress_bar.js +0 -115
- package/dist/cjs/base/ui/record_card.js +0 -564
- package/dist/cjs/base/ui/record_card_list.js +0 -303
- package/dist/cjs/base/ui/select.js +0 -191
- package/dist/cjs/base/ui/select_and_select_buttons_helpers.js +0 -63
- package/dist/cjs/base/ui/select_buttons.js +0 -159
- package/dist/cjs/base/ui/select_buttons_synced.js +0 -62
- package/dist/cjs/base/ui/select_synced.js +0 -65
- package/dist/cjs/base/ui/switch.js +0 -167
- package/dist/cjs/base/ui/switch_synced.js +0 -53
- package/dist/cjs/base/ui/synced.js +0 -49
- package/dist/cjs/base/ui/system/all_styles_set.js +0 -92
- package/dist/cjs/base/ui/system/appearance/appearance_set.js +0 -27
- package/dist/cjs/base/ui/system/appearance/background_color.js +0 -18
- package/dist/cjs/base/ui/system/appearance/border.js +0 -54
- package/dist/cjs/base/ui/system/appearance/border_radius.js +0 -18
- package/dist/cjs/base/ui/system/appearance/box_shadow.js +0 -18
- package/dist/cjs/base/ui/system/appearance/opacity.js +0 -18
- package/dist/cjs/base/ui/system/dimensions/dimensions_set.js +0 -29
- package/dist/cjs/base/ui/system/dimensions/height.js +0 -18
- package/dist/cjs/base/ui/system/dimensions/max_height.js +0 -18
- package/dist/cjs/base/ui/system/dimensions/max_width.js +0 -18
- package/dist/cjs/base/ui/system/dimensions/min_height.js +0 -18
- package/dist/cjs/base/ui/system/dimensions/min_width.js +0 -18
- package/dist/cjs/base/ui/system/dimensions/width.js +0 -18
- package/dist/cjs/base/ui/system/display.js +0 -19
- package/dist/cjs/base/ui/system/flex_container/align_content.js +0 -15
- package/dist/cjs/base/ui/system/flex_container/align_items.js +0 -15
- package/dist/cjs/base/ui/system/flex_container/flex_container_set.js +0 -29
- package/dist/cjs/base/ui/system/flex_container/flex_direction.js +0 -15
- package/dist/cjs/base/ui/system/flex_container/flex_wrap.js +0 -15
- package/dist/cjs/base/ui/system/flex_container/justify_content.js +0 -15
- package/dist/cjs/base/ui/system/flex_container/justify_items.js +0 -16
- package/dist/cjs/base/ui/system/flex_item/align_self.js +0 -15
- package/dist/cjs/base/ui/system/flex_item/flex.js +0 -15
- package/dist/cjs/base/ui/system/flex_item/flex_basis.js +0 -15
- package/dist/cjs/base/ui/system/flex_item/flex_grow.js +0 -15
- package/dist/cjs/base/ui/system/flex_item/flex_item_set.js +0 -31
- package/dist/cjs/base/ui/system/flex_item/flex_shrink.js +0 -15
- package/dist/cjs/base/ui/system/flex_item/justify_self.js +0 -16
- package/dist/cjs/base/ui/system/flex_item/order.js +0 -15
- package/dist/cjs/base/ui/system/index.js +0 -681
- package/dist/cjs/base/ui/system/overflow.js +0 -21
- package/dist/cjs/base/ui/system/position/bottom.js +0 -24
- package/dist/cjs/base/ui/system/position/left.js +0 -24
- package/dist/cjs/base/ui/system/position/position.js +0 -15
- package/dist/cjs/base/ui/system/position/position_set.js +0 -29
- package/dist/cjs/base/ui/system/position/right.js +0 -24
- package/dist/cjs/base/ui/system/position/top.js +0 -24
- package/dist/cjs/base/ui/system/position/z_index.js +0 -18
- package/dist/cjs/base/ui/system/spacing/margin.js +0 -72
- package/dist/cjs/base/ui/system/spacing/padding.js +0 -65
- package/dist/cjs/base/ui/system/spacing/spacing_set.js +0 -21
- package/dist/cjs/base/ui/system/typography/font_family.js +0 -18
- package/dist/cjs/base/ui/system/typography/font_size.js +0 -18
- package/dist/cjs/base/ui/system/typography/font_style.js +0 -15
- package/dist/cjs/base/ui/system/typography/font_weight.js +0 -18
- package/dist/cjs/base/ui/system/typography/letter_spacing.js +0 -18
- package/dist/cjs/base/ui/system/typography/line_height.js +0 -15
- package/dist/cjs/base/ui/system/typography/text_align.js +0 -15
- package/dist/cjs/base/ui/system/typography/text_color.js +0 -18
- package/dist/cjs/base/ui/system/typography/text_decoration.js +0 -15
- package/dist/cjs/base/ui/system/typography/text_transform.js +0 -15
- package/dist/cjs/base/ui/system/typography/typography_set.js +0 -37
- package/dist/cjs/base/ui/system/utils/csstype.js +0 -1
- package/dist/cjs/base/ui/system/utils/ensure_numbers_are_within_scale.js +0 -41
- package/dist/cjs/base/ui/system/utils/get_style_props_for_responsive_prop.js +0 -73
- package/dist/cjs/base/ui/system/utils/types.js +0 -1
- package/dist/cjs/base/ui/table_picker.js +0 -71
- package/dist/cjs/base/ui/table_picker_synced.js +0 -62
- package/dist/cjs/base/ui/text.js +0 -117
- package/dist/cjs/base/ui/text_button.js +0 -196
- package/dist/cjs/base/ui/theme/default_theme/button_variants.js +0 -59
- package/dist/cjs/base/ui/theme/default_theme/control_sizes.js +0 -102
- package/dist/cjs/base/ui/theme/default_theme/heading_styles.js +0 -99
- package/dist/cjs/base/ui/theme/default_theme/index.js +0 -42
- package/dist/cjs/base/ui/theme/default_theme/input_variants.js +0 -38
- package/dist/cjs/base/ui/theme/default_theme/link_variants.js +0 -35
- package/dist/cjs/base/ui/theme/default_theme/select_buttons_variants.js +0 -72
- package/dist/cjs/base/ui/theme/default_theme/select_variants.js +0 -50
- package/dist/cjs/base/ui/theme/default_theme/switch_variants.js +0 -85
- package/dist/cjs/base/ui/theme/default_theme/text_button_variants.js +0 -44
- package/dist/cjs/base/ui/theme/default_theme/text_styles.js +0 -81
- package/dist/cjs/base/ui/theme/default_theme/tokens.js +0 -211
- package/dist/cjs/base/ui/theme/theme_context.js +0 -13
- package/dist/cjs/base/ui/theme/use_theme.js +0 -11
- package/dist/cjs/base/ui/tooltip.js +0 -175
- package/dist/cjs/base/ui/types/aria_props.js +0 -1
- package/dist/cjs/base/ui/types/data_attributes_prop.js +0 -1
- package/dist/cjs/base/ui/types/tooltip_anchor_props.js +0 -1
- package/dist/cjs/base/ui/ui.js +0 -382
- package/dist/cjs/base/ui/unstable_standalone_ui.js +0 -179
- package/dist/cjs/base/ui/use_form_field.js +0 -20
- package/dist/cjs/base/ui/use_styled_system.js +0 -25
- package/dist/cjs/base/ui/use_text_color_for_background_color.js +0 -15
- package/dist/cjs/base/ui/view_picker.js +0 -89
- package/dist/cjs/base/ui/view_picker_synced.js +0 -66
- package/dist/cjs/base/ui/viewport_constraint.js +0 -129
- package/dist/cjs/base/ui/with_styled_system.js +0 -129
- package/dist/cjs/base/undo_redo.js +0 -37
- package/dist/cjs/base/unstable_testing_utils.js +0 -171
- package/dist/cjs/interface/assert_run_context.js +0 -12
- package/dist/cjs/interface/index.js +0 -22
- package/dist/cjs/interface/models/models.js +0 -54
- package/dist/cjs/interface/models/record_store.js +0 -51
- package/dist/cjs/interface/types/base.js +0 -1
- package/dist/cjs/interface/types/field.js +0 -1
- package/dist/cjs/interface/types/mutations.js +0 -17
- package/dist/cjs/interface/types/record.js +0 -1
- package/dist/cjs/interface/types/table.js +0 -1
- package/dist/cjs/interface/ui/block_wrapper.js +0 -69
- package/dist/cjs/interface/ui/initialize_block.js +0 -95
- package/dist/cjs/interface/ui/ui.js +0 -125
- package/dist/cjs/sdk_mode.js +0 -1
- package/dist/cjs/shared/color_utils.js +0 -58
- package/dist/cjs/shared/event_tracker.js +0 -28
- package/dist/cjs/shared/types/airtable_interface_core.js +0 -1
- package/dist/cjs/shared/types/attachment.js +0 -1
- package/dist/cjs/shared/types/base_core.js +0 -1
- package/dist/cjs/shared/types/collaborator.js +0 -1
- package/dist/cjs/shared/types/global_config.js +0 -1
- package/dist/cjs/shared/types/hyper_ids.js +0 -1
- package/dist/cjs/shared/types/mutation_constants.js +0 -11
- package/dist/cjs/shared/types/permission_levels.js +0 -17
- package/dist/cjs/shared/types/record.js +0 -1
- package/dist/cjs/shared/types/stat.js +0 -1
- package/dist/cjs/shared/types/table_core.js +0 -1
- package/dist/cjs/shared/ui/global_config_synced_component_helpers.js +0 -27
- package/dist/cjs/shared/ui/sdk_context.js +0 -17
- package/dist/cjs/shared/ui/use_base.js +0 -22
- package/dist/cjs/shared/ui/use_session.js +0 -21
- package/dist/cjs/shared/unstable_private_utils.js +0 -49
- package/dist/types/src/base/ui/baymax_utils.d.ts +0 -2
- package/dist/types/src/base/ui/baymax_utils.d.ts.map +0 -1
- package/dist/types/src/base/ui/box.d.ts +0 -35
- package/dist/types/src/base/ui/box.d.ts.map +0 -1
- package/dist/types/src/base/ui/button.d.ts +0 -86
- package/dist/types/src/base/ui/button.d.ts.map +0 -1
- package/dist/types/src/base/ui/choice_token.d.ts +0 -49
- package/dist/types/src/base/ui/choice_token.d.ts.map +0 -1
- package/dist/types/src/base/ui/collaborator_token.d.ts +0 -45
- package/dist/types/src/base/ui/collaborator_token.d.ts.map +0 -1
- package/dist/types/src/base/ui/color_palette.d.ts +0 -77
- package/dist/types/src/base/ui/color_palette.d.ts.map +0 -1
- package/dist/types/src/base/ui/color_palette_synced.d.ts +0 -30
- package/dist/types/src/base/ui/color_palette_synced.d.ts.map +0 -1
- package/dist/types/src/base/ui/confirmation_dialog.d.ts +0 -66
- package/dist/types/src/base/ui/confirmation_dialog.d.ts.map +0 -1
- package/dist/types/src/base/ui/control_sizes.d.ts +0 -16
- package/dist/types/src/base/ui/control_sizes.d.ts.map +0 -1
- package/dist/types/src/base/ui/css_helpers.d.ts +0 -6
- package/dist/types/src/base/ui/css_helpers.d.ts.map +0 -1
- package/dist/types/src/base/ui/dialog.d.ts +0 -58
- package/dist/types/src/base/ui/dialog.d.ts.map +0 -1
- package/dist/types/src/base/ui/dialog_close_button.d.ts +0 -40
- package/dist/types/src/base/ui/dialog_close_button.d.ts.map +0 -1
- package/dist/types/src/base/ui/field_icon.d.ts +0 -25
- package/dist/types/src/base/ui/field_icon.d.ts.map +0 -1
- package/dist/types/src/base/ui/field_picker.d.ts +0 -34
- package/dist/types/src/base/ui/field_picker.d.ts.map +0 -1
- package/dist/types/src/base/ui/field_picker_synced.d.ts +0 -18
- package/dist/types/src/base/ui/field_picker_synced.d.ts.map +0 -1
- package/dist/types/src/base/ui/form_field.d.ts +0 -42
- package/dist/types/src/base/ui/form_field.d.ts.map +0 -1
- package/dist/types/src/base/ui/geometry/geometry.d.ts +0 -3
- package/dist/types/src/base/ui/geometry/geometry.d.ts.map +0 -1
- package/dist/types/src/base/ui/geometry/point.d.ts +0 -2
- package/dist/types/src/base/ui/geometry/point.d.ts.map +0 -1
- package/dist/types/src/base/ui/geometry/rect.d.ts +0 -2
- package/dist/types/src/base/ui/geometry/rect.d.ts.map +0 -1
- package/dist/types/src/base/ui/geometry/size.d.ts +0 -2
- package/dist/types/src/base/ui/geometry/size.d.ts.map +0 -1
- package/dist/types/src/base/ui/heading.d.ts +0 -64
- package/dist/types/src/base/ui/heading.d.ts.map +0 -1
- package/dist/types/src/base/ui/icon.d.ts +0 -45
- package/dist/types/src/base/ui/icon.d.ts.map +0 -1
- package/dist/types/src/base/ui/icon_config.d.ts +0 -424
- package/dist/types/src/base/ui/icon_config.d.ts.map +0 -1
- package/dist/types/src/base/ui/input.d.ts +0 -120
- package/dist/types/src/base/ui/input.d.ts.map +0 -1
- package/dist/types/src/base/ui/input_synced.d.ts +0 -18
- package/dist/types/src/base/ui/input_synced.d.ts.map +0 -1
- package/dist/types/src/base/ui/key_codes.d.ts +0 -2
- package/dist/types/src/base/ui/key_codes.d.ts.map +0 -1
- package/dist/types/src/base/ui/label.d.ts +0 -35
- package/dist/types/src/base/ui/label.d.ts.map +0 -1
- package/dist/types/src/base/ui/link.d.ts +0 -84
- package/dist/types/src/base/ui/link.d.ts.map +0 -1
- package/dist/types/src/base/ui/loader.d.ts +0 -38
- package/dist/types/src/base/ui/loader.d.ts.map +0 -1
- package/dist/types/src/base/ui/modal.d.ts +0 -54
- package/dist/types/src/base/ui/modal.d.ts.map +0 -1
- package/dist/types/src/base/ui/model_picker_select.d.ts +0 -19
- package/dist/types/src/base/ui/model_picker_select.d.ts.map +0 -1
- package/dist/types/src/base/ui/popover.d.ts +0 -106
- package/dist/types/src/base/ui/popover.d.ts.map +0 -1
- package/dist/types/src/base/ui/progress_bar.d.ts +0 -60
- package/dist/types/src/base/ui/progress_bar.d.ts.map +0 -1
- package/dist/types/src/base/ui/record_card.d.ts +0 -80
- package/dist/types/src/base/ui/record_card.d.ts.map +0 -1
- package/dist/types/src/base/ui/record_card_list.d.ts +0 -88
- package/dist/types/src/base/ui/record_card_list.d.ts.map +0 -1
- package/dist/types/src/base/ui/select.d.ts +0 -82
- package/dist/types/src/base/ui/select.d.ts.map +0 -1
- package/dist/types/src/base/ui/select_and_select_buttons_helpers.d.ts +0 -25
- package/dist/types/src/base/ui/select_and_select_buttons_helpers.d.ts.map +0 -1
- package/dist/types/src/base/ui/select_buttons.d.ts +0 -56
- package/dist/types/src/base/ui/select_buttons.d.ts.map +0 -1
- package/dist/types/src/base/ui/select_buttons_synced.d.ts +0 -18
- package/dist/types/src/base/ui/select_buttons_synced.d.ts.map +0 -1
- package/dist/types/src/base/ui/select_synced.d.ts +0 -18
- package/dist/types/src/base/ui/select_synced.d.ts.map +0 -1
- package/dist/types/src/base/ui/switch.d.ts +0 -82
- package/dist/types/src/base/ui/switch.d.ts.map +0 -1
- package/dist/types/src/base/ui/switch_synced.d.ts +0 -18
- package/dist/types/src/base/ui/switch_synced.d.ts.map +0 -1
- package/dist/types/src/base/ui/synced.d.ts +0 -23
- package/dist/types/src/base/ui/synced.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/all_styles_set.d.ts +0 -85
- package/dist/types/src/base/ui/system/all_styles_set.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/appearance/appearance_set.d.ts +0 -14
- package/dist/types/src/base/ui/system/appearance/appearance_set.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/appearance/background_color.d.ts +0 -12
- package/dist/types/src/base/ui/system/appearance/background_color.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/appearance/border.d.ts +0 -30
- package/dist/types/src/base/ui/system/appearance/border.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/appearance/border_radius.d.ts +0 -12
- package/dist/types/src/base/ui/system/appearance/border_radius.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/appearance/box_shadow.d.ts +0 -12
- package/dist/types/src/base/ui/system/appearance/box_shadow.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/appearance/opacity.d.ts +0 -12
- package/dist/types/src/base/ui/system/appearance/opacity.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/dimensions/dimensions_set.d.ts +0 -15
- package/dist/types/src/base/ui/system/dimensions/dimensions_set.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/dimensions/height.d.ts +0 -12
- package/dist/types/src/base/ui/system/dimensions/height.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/dimensions/max_height.d.ts +0 -12
- package/dist/types/src/base/ui/system/dimensions/max_height.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/dimensions/max_width.d.ts +0 -12
- package/dist/types/src/base/ui/system/dimensions/max_width.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/dimensions/min_height.d.ts +0 -12
- package/dist/types/src/base/ui/system/dimensions/min_height.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/dimensions/min_width.d.ts +0 -12
- package/dist/types/src/base/ui/system/dimensions/min_width.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/dimensions/width.d.ts +0 -12
- package/dist/types/src/base/ui/system/dimensions/width.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/display.d.ts +0 -13
- package/dist/types/src/base/ui/system/display.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/flex_container/align_content.d.ts +0 -12
- package/dist/types/src/base/ui/system/flex_container/align_content.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/flex_container/align_items.d.ts +0 -12
- package/dist/types/src/base/ui/system/flex_container/align_items.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/flex_container/flex_container_set.d.ts +0 -15
- package/dist/types/src/base/ui/system/flex_container/flex_container_set.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/flex_container/flex_direction.d.ts +0 -12
- package/dist/types/src/base/ui/system/flex_container/flex_direction.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/flex_container/flex_wrap.d.ts +0 -12
- package/dist/types/src/base/ui/system/flex_container/flex_wrap.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/flex_container/justify_content.d.ts +0 -12
- package/dist/types/src/base/ui/system/flex_container/justify_content.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/flex_container/justify_items.d.ts +0 -12
- package/dist/types/src/base/ui/system/flex_container/justify_items.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/flex_item/align_self.d.ts +0 -12
- package/dist/types/src/base/ui/system/flex_item/align_self.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/flex_item/flex.d.ts +0 -12
- package/dist/types/src/base/ui/system/flex_item/flex.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/flex_item/flex_basis.d.ts +0 -12
- package/dist/types/src/base/ui/system/flex_item/flex_basis.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/flex_item/flex_grow.d.ts +0 -12
- package/dist/types/src/base/ui/system/flex_item/flex_grow.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/flex_item/flex_item_set.d.ts +0 -16
- package/dist/types/src/base/ui/system/flex_item/flex_item_set.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/flex_item/flex_shrink.d.ts +0 -12
- package/dist/types/src/base/ui/system/flex_item/flex_shrink.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/flex_item/justify_self.d.ts +0 -12
- package/dist/types/src/base/ui/system/flex_item/justify_self.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/flex_item/order.d.ts +0 -12
- package/dist/types/src/base/ui/system/flex_item/order.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/index.d.ts +0 -54
- package/dist/types/src/base/ui/system/index.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/overflow.d.ts +0 -17
- package/dist/types/src/base/ui/system/overflow.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/position/bottom.d.ts +0 -12
- package/dist/types/src/base/ui/system/position/bottom.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/position/left.d.ts +0 -12
- package/dist/types/src/base/ui/system/position/left.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/position/position.d.ts +0 -12
- package/dist/types/src/base/ui/system/position/position.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/position/position_set.d.ts +0 -15
- package/dist/types/src/base/ui/system/position/position_set.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/position/right.d.ts +0 -12
- package/dist/types/src/base/ui/system/position/right.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/position/top.d.ts +0 -12
- package/dist/types/src/base/ui/system/position/top.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/position/z_index.d.ts +0 -12
- package/dist/types/src/base/ui/system/position/z_index.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/spacing/margin.d.ts +0 -24
- package/dist/types/src/base/ui/system/spacing/margin.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/spacing/padding.d.ts +0 -24
- package/dist/types/src/base/ui/system/spacing/padding.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/spacing/spacing_set.d.ts +0 -11
- package/dist/types/src/base/ui/system/spacing/spacing_set.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/typography/font_family.d.ts +0 -12
- package/dist/types/src/base/ui/system/typography/font_family.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/typography/font_size.d.ts +0 -12
- package/dist/types/src/base/ui/system/typography/font_size.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/typography/font_style.d.ts +0 -12
- package/dist/types/src/base/ui/system/typography/font_style.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/typography/font_weight.d.ts +0 -12
- package/dist/types/src/base/ui/system/typography/font_weight.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/typography/letter_spacing.d.ts +0 -12
- package/dist/types/src/base/ui/system/typography/letter_spacing.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/typography/line_height.d.ts +0 -12
- package/dist/types/src/base/ui/system/typography/line_height.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/typography/text_align.d.ts +0 -12
- package/dist/types/src/base/ui/system/typography/text_align.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/typography/text_color.d.ts +0 -16
- package/dist/types/src/base/ui/system/typography/text_color.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/typography/text_decoration.d.ts +0 -14
- package/dist/types/src/base/ui/system/typography/text_decoration.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/typography/text_transform.d.ts +0 -12
- package/dist/types/src/base/ui/system/typography/text_transform.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/typography/typography_set.d.ts +0 -19
- package/dist/types/src/base/ui/system/typography/typography_set.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/utils/csstype.d.ts +0 -3977
- package/dist/types/src/base/ui/system/utils/csstype.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/utils/ensure_numbers_are_within_scale.d.ts +0 -2
- package/dist/types/src/base/ui/system/utils/ensure_numbers_are_within_scale.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/utils/get_style_props_for_responsive_prop.d.ts +0 -2
- package/dist/types/src/base/ui/system/utils/get_style_props_for_responsive_prop.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/utils/types.d.ts +0 -31
- package/dist/types/src/base/ui/system/utils/types.d.ts.map +0 -1
- package/dist/types/src/base/ui/table_picker.d.ts +0 -28
- package/dist/types/src/base/ui/table_picker.d.ts.map +0 -1
- package/dist/types/src/base/ui/table_picker_synced.d.ts +0 -18
- package/dist/types/src/base/ui/table_picker_synced.d.ts.map +0 -1
- package/dist/types/src/base/ui/text.d.ts +0 -66
- package/dist/types/src/base/ui/text.d.ts.map +0 -1
- package/dist/types/src/base/ui/text_button.d.ts +0 -83
- package/dist/types/src/base/ui/text_button.d.ts.map +0 -1
- package/dist/types/src/base/ui/theme/default_theme/button_variants.d.ts +0 -8
- package/dist/types/src/base/ui/theme/default_theme/button_variants.d.ts.map +0 -1
- package/dist/types/src/base/ui/theme/default_theme/control_sizes.d.ts +0 -107
- package/dist/types/src/base/ui/theme/default_theme/control_sizes.d.ts.map +0 -1
- package/dist/types/src/base/ui/theme/default_theme/heading_styles.d.ts +0 -11
- package/dist/types/src/base/ui/theme/default_theme/heading_styles.d.ts.map +0 -1
- package/dist/types/src/base/ui/theme/default_theme/index.d.ts +0 -342
- package/dist/types/src/base/ui/theme/default_theme/index.d.ts.map +0 -1
- package/dist/types/src/base/ui/theme/default_theme/input_variants.d.ts +0 -5
- package/dist/types/src/base/ui/theme/default_theme/input_variants.d.ts.map +0 -1
- package/dist/types/src/base/ui/theme/default_theme/link_variants.d.ts +0 -7
- package/dist/types/src/base/ui/theme/default_theme/link_variants.d.ts.map +0 -1
- package/dist/types/src/base/ui/theme/default_theme/select_buttons_variants.d.ts +0 -8
- package/dist/types/src/base/ui/theme/default_theme/select_buttons_variants.d.ts.map +0 -1
- package/dist/types/src/base/ui/theme/default_theme/select_variants.d.ts +0 -5
- package/dist/types/src/base/ui/theme/default_theme/select_variants.d.ts.map +0 -1
- package/dist/types/src/base/ui/theme/default_theme/switch_variants.d.ts +0 -16
- package/dist/types/src/base/ui/theme/default_theme/switch_variants.d.ts.map +0 -1
- package/dist/types/src/base/ui/theme/default_theme/text_button_variants.d.ts +0 -7
- package/dist/types/src/base/ui/theme/default_theme/text_button_variants.d.ts.map +0 -1
- package/dist/types/src/base/ui/theme/default_theme/text_styles.d.ts +0 -76
- package/dist/types/src/base/ui/theme/default_theme/text_styles.d.ts.map +0 -1
- package/dist/types/src/base/ui/theme/default_theme/tokens.d.ts +0 -111
- package/dist/types/src/base/ui/theme/default_theme/tokens.d.ts.map +0 -1
- package/dist/types/src/base/ui/theme/theme_context.d.ts +0 -342
- package/dist/types/src/base/ui/theme/theme_context.d.ts.map +0 -1
- package/dist/types/src/base/ui/theme/use_theme.d.ts +0 -342
- package/dist/types/src/base/ui/theme/use_theme.d.ts.map +0 -1
- package/dist/types/src/base/ui/tooltip.d.ts +0 -64
- package/dist/types/src/base/ui/tooltip.d.ts.map +0 -1
- package/dist/types/src/base/ui/types/aria_props.d.ts +0 -22
- package/dist/types/src/base/ui/types/aria_props.d.ts.map +0 -1
- package/dist/types/src/base/ui/types/data_attributes_prop.d.ts +0 -10
- package/dist/types/src/base/ui/types/data_attributes_prop.d.ts.map +0 -1
- package/dist/types/src/base/ui/types/tooltip_anchor_props.d.ts +0 -13
- package/dist/types/src/base/ui/types/tooltip_anchor_props.d.ts.map +0 -1
- package/dist/types/src/base/ui/use_form_field.d.ts +0 -2
- package/dist/types/src/base/ui/use_form_field.d.ts.map +0 -1
- package/dist/types/src/base/ui/use_styled_system.d.ts +0 -2
- package/dist/types/src/base/ui/use_styled_system.d.ts.map +0 -1
- package/dist/types/src/base/ui/use_text_color_for_background_color.d.ts +0 -2
- package/dist/types/src/base/ui/use_text_color_for_background_color.d.ts.map +0 -1
- package/dist/types/src/base/ui/view_picker.d.ts +0 -34
- package/dist/types/src/base/ui/view_picker.d.ts.map +0 -1
- package/dist/types/src/base/ui/view_picker_synced.d.ts +0 -18
- package/dist/types/src/base/ui/view_picker_synced.d.ts.map +0 -1
- package/dist/types/src/base/ui/viewport_constraint.d.ts +0 -57
- package/dist/types/src/base/ui/viewport_constraint.d.ts.map +0 -1
- package/dist/types/src/base/ui/with_styled_system.d.ts +0 -2
- package/dist/types/src/base/ui/with_styled_system.d.ts.map +0 -1
- package/types/styled-system__core.d.ts +0 -41
|
@@ -1,11 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
import { SessionCore } from '../../shared/models/session_core';
|
|
2
|
+
import { MutationTypes } from '../types/mutations';
|
|
2
3
|
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
var _session_core = require("../../shared/models/session_core");
|
|
8
|
-
var _mutations = require("../types/mutations");
|
|
9
4
|
/**
|
|
10
5
|
* Model class representing the current user's session.
|
|
11
6
|
*
|
|
@@ -25,7 +20,7 @@ var _mutations = require("../types/mutations");
|
|
|
25
20
|
* ```
|
|
26
21
|
* @docsPath models/Session
|
|
27
22
|
*/
|
|
28
|
-
class Session extends
|
|
23
|
+
class Session extends SessionCore {
|
|
29
24
|
/** @internal */
|
|
30
25
|
static _className = 'Session';
|
|
31
26
|
/**
|
|
@@ -57,7 +52,7 @@ class Session extends _session_core.SessionCore {
|
|
|
57
52
|
*/
|
|
58
53
|
checkPermissionsForUpdateRecords() {
|
|
59
54
|
return this._sdk.__mutations.checkPermissionsForMutation({
|
|
60
|
-
type:
|
|
55
|
+
type: MutationTypes.SET_MULTIPLE_RECORDS_CELL_VALUES,
|
|
61
56
|
tableId: undefined,
|
|
62
57
|
records: undefined
|
|
63
58
|
});
|
|
@@ -98,7 +93,7 @@ class Session extends _session_core.SessionCore {
|
|
|
98
93
|
*/
|
|
99
94
|
checkPermissionsForCreateRecords() {
|
|
100
95
|
return this._sdk.__mutations.checkPermissionsForMutation({
|
|
101
|
-
type:
|
|
96
|
+
type: MutationTypes.CREATE_MULTIPLE_RECORDS,
|
|
102
97
|
tableId: undefined,
|
|
103
98
|
records: undefined
|
|
104
99
|
});
|
|
@@ -138,7 +133,7 @@ class Session extends _session_core.SessionCore {
|
|
|
138
133
|
*/
|
|
139
134
|
checkPermissionsForDeleteRecords() {
|
|
140
135
|
return this._sdk.__mutations.checkPermissionsForMutation({
|
|
141
|
-
type:
|
|
136
|
+
type: MutationTypes.DELETE_MULTIPLE_RECORDS,
|
|
142
137
|
tableId: undefined,
|
|
143
138
|
recordIds: undefined
|
|
144
139
|
});
|
|
@@ -151,4 +146,4 @@ class Session extends _session_core.SessionCore {
|
|
|
151
146
|
return this.checkPermissionsForDeleteRecords().hasPermission;
|
|
152
147
|
}
|
|
153
148
|
}
|
|
154
|
-
|
|
149
|
+
export default Session;
|
|
@@ -1,25 +1,17 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = exports.WatchableTableKeys = void 0;
|
|
7
|
-
var _table_core = require("../../shared/models/table_core");
|
|
8
|
-
var _error_utils = require("../../shared/error_utils");
|
|
9
|
-
var _private_utils = require("../../shared/private_utils");
|
|
10
|
-
var _mutations = require("../types/mutations");
|
|
11
|
-
var _record_query_result = _interopRequireDefault(require("./record_query_result"));
|
|
12
|
-
var _field = _interopRequireDefault(require("./field"));
|
|
13
|
-
var _table_or_view_query_result = _interopRequireDefault(require("./table_or_view_query_result"));
|
|
14
|
-
var _view = _interopRequireDefault(require("./view"));
|
|
15
|
-
var _object_pool = _interopRequireDefault(require("./object_pool"));
|
|
16
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
17
1
|
/** @module @airtable/blocks/models: Table */ /** */
|
|
18
|
-
|
|
2
|
+
import { TableCore, WatchableTableKeysCore } from '../../shared/models/table_core';
|
|
3
|
+
import { spawnError } from '../../shared/error_utils';
|
|
4
|
+
import { entries, cast, isEnumValue } from '../../shared/private_utils';
|
|
5
|
+
import { MutationTypes } from '../types/mutations';
|
|
6
|
+
import RecordQueryResult from './record_query_result';
|
|
7
|
+
import Field from './field';
|
|
8
|
+
import TableOrViewQueryResult from './table_or_view_query_result';
|
|
9
|
+
import View from './view';
|
|
10
|
+
import ObjectPool from './object_pool';
|
|
19
11
|
// This doesn't follow our enum naming conventions because we want the keys
|
|
20
12
|
// to mirror the method/getter names on the model class.
|
|
21
|
-
const WatchableTableKeys =
|
|
22
|
-
...
|
|
13
|
+
export const WatchableTableKeys = Object.freeze({
|
|
14
|
+
...WatchableTableKeysCore,
|
|
23
15
|
views: 'views'
|
|
24
16
|
});
|
|
25
17
|
|
|
@@ -36,12 +28,12 @@ const WatchableTableKeys = exports.WatchableTableKeys = Object.freeze({
|
|
|
36
28
|
*
|
|
37
29
|
* @docsPath models/Table
|
|
38
30
|
*/
|
|
39
|
-
class Table extends
|
|
31
|
+
class Table extends TableCore {
|
|
40
32
|
/** @internal */
|
|
41
33
|
static _className = 'Table';
|
|
42
34
|
/** @internal */
|
|
43
35
|
static _isWatchableKey(key) {
|
|
44
|
-
return
|
|
36
|
+
return isEnumValue(WatchableTableKeys, key);
|
|
45
37
|
}
|
|
46
38
|
/** @internal */
|
|
47
39
|
|
|
@@ -51,12 +43,12 @@ class Table extends _table_core.TableCore {
|
|
|
51
43
|
constructor(parentBase, recordStore, tableId, sdk) {
|
|
52
44
|
super(parentBase, recordStore, tableId, sdk);
|
|
53
45
|
this._viewModelsById = {}; // View instances are lazily created by getViewById.
|
|
54
|
-
this.__tableOrViewQueryResultPool = new
|
|
46
|
+
this.__tableOrViewQueryResultPool = new ObjectPool(TableOrViewQueryResult);
|
|
55
47
|
}
|
|
56
48
|
|
|
57
49
|
/** @internal */
|
|
58
50
|
_constructField(fieldId) {
|
|
59
|
-
return new
|
|
51
|
+
return new Field(this.parentBase.__sdk, this, fieldId);
|
|
60
52
|
}
|
|
61
53
|
|
|
62
54
|
/**
|
|
@@ -122,7 +114,7 @@ class Table extends _table_core.TableCore {
|
|
|
122
114
|
return null;
|
|
123
115
|
} else {
|
|
124
116
|
if (!this._viewModelsById[viewId]) {
|
|
125
|
-
this._viewModelsById[viewId] = new
|
|
117
|
+
this._viewModelsById[viewId] = new View(this._sdk, this, this._recordStore.getViewDataStore(viewId), viewId);
|
|
126
118
|
}
|
|
127
119
|
return this._viewModelsById[viewId];
|
|
128
120
|
}
|
|
@@ -144,7 +136,7 @@ class Table extends _table_core.TableCore {
|
|
|
144
136
|
getViewById(viewId) {
|
|
145
137
|
const view = this.getViewByIdIfExists(viewId);
|
|
146
138
|
if (!view) {
|
|
147
|
-
throw
|
|
139
|
+
throw spawnError("No view with ID %s in table '%s'", viewId, this.name);
|
|
148
140
|
}
|
|
149
141
|
return view;
|
|
150
142
|
}
|
|
@@ -164,7 +156,7 @@ class Table extends _table_core.TableCore {
|
|
|
164
156
|
* ```
|
|
165
157
|
*/
|
|
166
158
|
getViewByNameIfExists(viewName) {
|
|
167
|
-
for (const [viewId, viewData] of
|
|
159
|
+
for (const [viewId, viewData] of entries(this._data.viewsById)) {
|
|
168
160
|
if (viewData.name === viewName) {
|
|
169
161
|
return this.getViewByIdIfExists(viewId);
|
|
170
162
|
}
|
|
@@ -187,7 +179,7 @@ class Table extends _table_core.TableCore {
|
|
|
187
179
|
getViewByName(viewName) {
|
|
188
180
|
const view = this.getViewByNameIfExists(viewName);
|
|
189
181
|
if (!view) {
|
|
190
|
-
throw
|
|
182
|
+
throw spawnError("No view named '%s' in table '%s'", viewName, this.name);
|
|
191
183
|
}
|
|
192
184
|
return view;
|
|
193
185
|
}
|
|
@@ -218,7 +210,7 @@ class Table extends _table_core.TableCore {
|
|
|
218
210
|
getView(viewIdOrName) {
|
|
219
211
|
const view = this.getViewIfExists(viewIdOrName);
|
|
220
212
|
if (!view) {
|
|
221
|
-
throw
|
|
213
|
+
throw spawnError("No view with ID or name '%s' in table '%s'", viewIdOrName, this.name);
|
|
222
214
|
}
|
|
223
215
|
return view;
|
|
224
216
|
}
|
|
@@ -256,7 +248,7 @@ class Table extends _table_core.TableCore {
|
|
|
256
248
|
* ```
|
|
257
249
|
*/
|
|
258
250
|
selectRecords(opts) {
|
|
259
|
-
const normalizedOpts =
|
|
251
|
+
const normalizedOpts = RecordQueryResult._normalizeOpts(this, this._recordStore, opts || {});
|
|
260
252
|
return this.__tableOrViewQueryResultPool.getObjectForReuse(this._sdk, this, normalizedOpts);
|
|
261
253
|
}
|
|
262
254
|
/**
|
|
@@ -305,7 +297,7 @@ class Table extends _table_core.TableCore {
|
|
|
305
297
|
*/
|
|
306
298
|
getFirstViewOfType(allowedViewTypes, preferredViewOrViewId) {
|
|
307
299
|
if (!Array.isArray(allowedViewTypes)) {
|
|
308
|
-
allowedViewTypes =
|
|
300
|
+
allowedViewTypes = cast([allowedViewTypes]);
|
|
309
301
|
}
|
|
310
302
|
if (preferredViewOrViewId) {
|
|
311
303
|
const preferredView = this.getViewByIdIfExists(typeof preferredViewOrViewId === 'string' ? preferredViewOrViewId : preferredViewOrViewId.id);
|
|
@@ -322,19 +314,19 @@ class Table extends _table_core.TableCore {
|
|
|
322
314
|
*/
|
|
323
315
|
__getViewMatching(viewOrViewIdOrViewName) {
|
|
324
316
|
let view;
|
|
325
|
-
if (viewOrViewIdOrViewName instanceof
|
|
317
|
+
if (viewOrViewIdOrViewName instanceof View) {
|
|
326
318
|
if (viewOrViewIdOrViewName.parentTable.id !== this.id) {
|
|
327
|
-
throw
|
|
319
|
+
throw spawnError("View '%s' is from a different table than table '%s'", viewOrViewIdOrViewName.name, this.name);
|
|
328
320
|
}
|
|
329
321
|
view = viewOrViewIdOrViewName;
|
|
330
322
|
} else {
|
|
331
323
|
view = this.getViewByIdIfExists(viewOrViewIdOrViewName) || this.getViewByNameIfExists(viewOrViewIdOrViewName);
|
|
332
324
|
if (view === null) {
|
|
333
|
-
throw
|
|
325
|
+
throw spawnError("View '%s' does not exist in table '%s'", viewOrViewIdOrViewName, this.name);
|
|
334
326
|
}
|
|
335
327
|
}
|
|
336
328
|
if (view.isDeleted) {
|
|
337
|
-
throw
|
|
329
|
+
throw spawnError("View '%s' was deleted from table '%s'", view.name, this.name);
|
|
338
330
|
}
|
|
339
331
|
return view;
|
|
340
332
|
}
|
|
@@ -364,7 +356,7 @@ class Table extends _table_core.TableCore {
|
|
|
364
356
|
*/
|
|
365
357
|
checkPermissionsForCreateField(name, type, options, description) {
|
|
366
358
|
return this._sdk.__mutations.checkPermissionsForMutation({
|
|
367
|
-
type:
|
|
359
|
+
type: MutationTypes.CREATE_SINGLE_FIELD,
|
|
368
360
|
tableId: this.id,
|
|
369
361
|
id: undefined,
|
|
370
362
|
// Generated in createFieldAsync.
|
|
@@ -462,7 +454,7 @@ class Table extends _table_core.TableCore {
|
|
|
462
454
|
async createFieldAsync(name, type, options, description) {
|
|
463
455
|
const fieldId = this._sdk.__airtableInterface.idGenerator.generateFieldId();
|
|
464
456
|
await this._sdk.__mutations.applyMutationAsync({
|
|
465
|
-
type:
|
|
457
|
+
type: MutationTypes.CREATE_SINGLE_FIELD,
|
|
466
458
|
tableId: this.id,
|
|
467
459
|
id: fieldId,
|
|
468
460
|
name,
|
|
@@ -494,14 +486,14 @@ class Table extends _table_core.TableCore {
|
|
|
494
486
|
didTableSchemaChange = true;
|
|
495
487
|
|
|
496
488
|
// Clean up deleted views
|
|
497
|
-
for (const [viewId, viewModel] of
|
|
489
|
+
for (const [viewId, viewModel] of entries(this._viewModelsById)) {
|
|
498
490
|
if (viewModel.isDeleted) {
|
|
499
491
|
delete this._viewModelsById[viewId];
|
|
500
492
|
}
|
|
501
493
|
}
|
|
502
494
|
}
|
|
503
495
|
if (dirtyPaths.viewsById) {
|
|
504
|
-
for (const [viewId, dirtyViewPaths] of
|
|
496
|
+
for (const [viewId, dirtyViewPaths] of entries(dirtyPaths.viewsById)) {
|
|
505
497
|
// Directly access from _viewModelsById to avoid creating
|
|
506
498
|
// a view model if it doesn't already exist. If it doesn't exist,
|
|
507
499
|
// nothing can be subscribed to any events on it.
|
|
@@ -517,4 +509,4 @@ class Table extends _table_core.TableCore {
|
|
|
517
509
|
return didTableSchemaChange;
|
|
518
510
|
}
|
|
519
511
|
}
|
|
520
|
-
|
|
512
|
+
export default Table;
|
|
@@ -1,23 +1,15 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
var _private_utils = require("../../shared/private_utils");
|
|
8
|
-
var _error_utils = require("../../shared/error_utils");
|
|
9
|
-
var _table = _interopRequireWildcard(require("./table"));
|
|
10
|
-
var _record_query_result = _interopRequireDefault(require("./record_query_result"));
|
|
11
|
-
var _record_coloring = require("./record_coloring");
|
|
12
|
-
var _object_pool = _interopRequireDefault(require("./object_pool"));
|
|
13
|
-
var _record_store = require("./record_store");
|
|
14
|
-
var _view_data_store = _interopRequireWildcard(require("./view_data_store"));
|
|
15
|
-
var _grouped_record_query_result = _interopRequireDefault(require("./grouped_record_query_result"));
|
|
16
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
17
|
-
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
18
|
-
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; }
|
|
19
1
|
/** @module @airtable/blocks/models: RecordQueryResult */ /** */
|
|
20
2
|
|
|
3
|
+
import { has, arrayDifference } from '../../shared/private_utils';
|
|
4
|
+
import { invariant, spawnError } from '../../shared/error_utils';
|
|
5
|
+
import Table, { WatchableTableKeys } from './table';
|
|
6
|
+
import RecordQueryResult from './record_query_result';
|
|
7
|
+
import { ModeTypes as RecordColorModeTypes } from './record_coloring';
|
|
8
|
+
import ObjectPool from './object_pool';
|
|
9
|
+
import { WatchableRecordStoreKeys } from './record_store';
|
|
10
|
+
import ViewDataStore, { WatchableViewDataStoreKeys } from './view_data_store';
|
|
11
|
+
import GroupedRecordQueryResult from './grouped_record_query_result';
|
|
12
|
+
|
|
21
13
|
/** @hidden */
|
|
22
14
|
|
|
23
15
|
/**
|
|
@@ -29,7 +21,7 @@ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e;
|
|
|
29
21
|
*
|
|
30
22
|
* @docsPath models/query results/TableOrViewQueryResult
|
|
31
23
|
*/
|
|
32
|
-
class TableOrViewQueryResult extends
|
|
24
|
+
class TableOrViewQueryResult extends RecordQueryResult {
|
|
33
25
|
/** @internal */
|
|
34
26
|
static _className = 'TableOrViewQueryResult';
|
|
35
27
|
|
|
@@ -119,12 +111,12 @@ class TableOrViewQueryResult extends _record_query_result.default {
|
|
|
119
111
|
// }
|
|
120
112
|
|
|
121
113
|
const recordColorMode = this._normalizedOpts.recordColorMode;
|
|
122
|
-
if (recordColorMode && recordColorMode.type ===
|
|
114
|
+
if (recordColorMode && recordColorMode.type === RecordColorModeTypes.BY_SELECT_FIELD) {
|
|
123
115
|
fieldIdsSetToLoadOrNullIfAllFields[recordColorMode.selectField.id] = true;
|
|
124
116
|
}
|
|
125
117
|
}
|
|
126
118
|
this._fieldIdsSetToLoadOrNullIfAllFields = fieldIdsSetToLoadOrNullIfAllFields;
|
|
127
|
-
this.__groupedRecordQueryResultPool = new
|
|
119
|
+
this.__groupedRecordQueryResultPool = new ObjectPool(GroupedRecordQueryResult);
|
|
128
120
|
Object.seal(this);
|
|
129
121
|
}
|
|
130
122
|
/** @internal */
|
|
@@ -163,7 +155,7 @@ class TableOrViewQueryResult extends _record_query_result.default {
|
|
|
163
155
|
* `table.selectRecords`.
|
|
164
156
|
*/
|
|
165
157
|
get parentView() {
|
|
166
|
-
return this._sourceModel instanceof
|
|
158
|
+
return this._sourceModel instanceof Table ? null : this._sourceModel;
|
|
167
159
|
}
|
|
168
160
|
/**
|
|
169
161
|
* The record IDs in this RecordQueryResult.
|
|
@@ -176,8 +168,8 @@ class TableOrViewQueryResult extends _record_query_result.default {
|
|
|
176
168
|
const {
|
|
177
169
|
recordIds
|
|
178
170
|
} = this._data; // Throws when the model has been deleted.
|
|
179
|
-
|
|
180
|
-
|
|
171
|
+
invariant(this.isDataLoaded, 'RecordQueryResult data is not loaded');
|
|
172
|
+
invariant(recordIds, 'No recordIds');
|
|
181
173
|
return recordIds;
|
|
182
174
|
}
|
|
183
175
|
/**
|
|
@@ -193,7 +185,7 @@ class TableOrViewQueryResult extends _record_query_result.default {
|
|
|
193
185
|
const {
|
|
194
186
|
groups
|
|
195
187
|
} = this._data; // Throws when the model has been deleted.
|
|
196
|
-
|
|
188
|
+
invariant(this.isDataLoaded, 'RecordQueryResult data is not loaded');
|
|
197
189
|
return groups ?? null;
|
|
198
190
|
}
|
|
199
191
|
/**
|
|
@@ -207,7 +199,7 @@ class TableOrViewQueryResult extends _record_query_result.default {
|
|
|
207
199
|
const {
|
|
208
200
|
groupLevels
|
|
209
201
|
} = this._data; // Throws when the model has been deleted.
|
|
210
|
-
|
|
202
|
+
invariant(this.isDataLoaded, 'RecordQueryResult data is not loaded');
|
|
211
203
|
return groupLevels ? groupLevels.map(singleLevel => ({
|
|
212
204
|
...singleLevel,
|
|
213
205
|
field: this.parentTable.getFieldById(singleLevel.fieldId)
|
|
@@ -267,19 +259,19 @@ class TableOrViewQueryResult extends _record_query_result.default {
|
|
|
267
259
|
}
|
|
268
260
|
/** @internal */
|
|
269
261
|
get _sourceModelRecordIds() {
|
|
270
|
-
return this._sourceModel instanceof
|
|
262
|
+
return this._sourceModel instanceof Table ? this._recordStore.recordIds : this._recordStore.getViewDataStore(this._sourceModel.id).visibleRecordIds;
|
|
271
263
|
}
|
|
272
264
|
/** @internal */
|
|
273
265
|
get _sourceModelGroups() {
|
|
274
|
-
return this._sourceModel instanceof
|
|
266
|
+
return this._sourceModel instanceof Table ? null : this._recordStore.getViewDataStore(this._sourceModel.id).groups;
|
|
275
267
|
}
|
|
276
268
|
/** @internal */
|
|
277
269
|
get _sourceModelGroupLevels() {
|
|
278
|
-
return this._sourceModel instanceof
|
|
270
|
+
return this._sourceModel instanceof Table ? null : this._recordStore.getViewDataStore(this._sourceModel.id).groupLevels;
|
|
279
271
|
}
|
|
280
272
|
/** @internal */
|
|
281
273
|
get _sourceModelRecords() {
|
|
282
|
-
return this._sourceModel instanceof
|
|
274
|
+
return this._sourceModel instanceof Table ? this._recordStore.records : this._recordStore.getViewDataStore(this._sourceModel.id).visibleRecords;
|
|
283
275
|
}
|
|
284
276
|
/** @internal */
|
|
285
277
|
_incrementCellValueKeyWatchCountAndWatchIfNecessary(key, watchCallback) {
|
|
@@ -307,17 +299,17 @@ class TableOrViewQueryResult extends _record_query_result.default {
|
|
|
307
299
|
watch(keys, callback, context) {
|
|
308
300
|
const validKeys = super.watch(keys, callback, context);
|
|
309
301
|
for (const key of validKeys) {
|
|
310
|
-
if (key.startsWith(
|
|
311
|
-
const fieldId = key.substring(
|
|
312
|
-
if (this._fieldIdsSetToLoadOrNullIfAllFields && !
|
|
313
|
-
throw
|
|
302
|
+
if (key.startsWith(RecordQueryResult.WatchableCellValuesInFieldKeyPrefix)) {
|
|
303
|
+
const fieldId = key.substring(RecordQueryResult.WatchableCellValuesInFieldKeyPrefix.length);
|
|
304
|
+
if (this._fieldIdsSetToLoadOrNullIfAllFields && !has(this._fieldIdsSetToLoadOrNullIfAllFields, fieldId)) {
|
|
305
|
+
throw spawnError("Can't watch field because it wasn't included in RecordQueryResult fields: %s", fieldId);
|
|
314
306
|
}
|
|
315
307
|
this._incrementCellValueKeyWatchCountAndWatchIfNecessary(key, this._onCellValuesInFieldChanged);
|
|
316
308
|
}
|
|
317
|
-
if (key ===
|
|
309
|
+
if (key === RecordQueryResult.WatchableKeys.cellValues) {
|
|
318
310
|
if (this._fieldIdsSetToLoadOrNullIfAllFields) {
|
|
319
311
|
for (const fieldId of Object.keys(this._fieldIdsSetToLoadOrNullIfAllFields)) {
|
|
320
|
-
this._incrementCellValueKeyWatchCountAndWatchIfNecessary(
|
|
312
|
+
this._incrementCellValueKeyWatchCountAndWatchIfNecessary(RecordQueryResult.WatchableCellValuesInFieldKeyPrefix + fieldId, this._onCellValuesChanged);
|
|
321
313
|
}
|
|
322
314
|
} else {
|
|
323
315
|
this._incrementCellValueKeyWatchCountAndWatchIfNecessary(key, this._onCellValuesChanged);
|
|
@@ -330,13 +322,13 @@ class TableOrViewQueryResult extends _record_query_result.default {
|
|
|
330
322
|
unwatch(keys, callback, context) {
|
|
331
323
|
const validKeys = super.unwatch(keys, callback, context);
|
|
332
324
|
for (const key of validKeys) {
|
|
333
|
-
if (key.startsWith(
|
|
325
|
+
if (key.startsWith(RecordQueryResult.WatchableCellValuesInFieldKeyPrefix)) {
|
|
334
326
|
this._decrementCellValueKeyWatchCountAndUnwatchIfPossible(key, this._onCellValuesInFieldChanged);
|
|
335
327
|
}
|
|
336
|
-
if (key ===
|
|
328
|
+
if (key === RecordQueryResult.WatchableKeys.cellValues) {
|
|
337
329
|
if (this._fieldIdsSetToLoadOrNullIfAllFields) {
|
|
338
330
|
for (const fieldId of Object.keys(this._fieldIdsSetToLoadOrNullIfAllFields)) {
|
|
339
|
-
this._decrementCellValueKeyWatchCountAndUnwatchIfPossible(
|
|
331
|
+
this._decrementCellValueKeyWatchCountAndUnwatchIfPossible(RecordQueryResult.WatchableCellValuesInFieldKeyPrefix + fieldId, this._onCellValuesChanged);
|
|
340
332
|
}
|
|
341
333
|
} else {
|
|
342
334
|
this._decrementCellValueKeyWatchCountAndUnwatchIfPossible(key, this._onCellValuesChanged);
|
|
@@ -358,7 +350,7 @@ class TableOrViewQueryResult extends _record_query_result.default {
|
|
|
358
350
|
// Load all fields.
|
|
359
351
|
cellValuesInFieldsLoadPromise = this._recordStore.loadDataAsync();
|
|
360
352
|
}
|
|
361
|
-
if (this._sourceModel instanceof
|
|
353
|
+
if (this._sourceModel instanceof Table) {
|
|
362
354
|
if (this._fieldIdsSetToLoadOrNullIfAllFields) {
|
|
363
355
|
sourceModelLoadPromise = this._recordStore.loadRecordMetadataAsync();
|
|
364
356
|
} else {
|
|
@@ -377,10 +369,10 @@ class TableOrViewQueryResult extends _record_query_result.default {
|
|
|
377
369
|
* @internal
|
|
378
370
|
*/
|
|
379
371
|
_getChangedKeysOnLoad() {
|
|
380
|
-
const changedKeys = [
|
|
372
|
+
const changedKeys = [RecordQueryResult.WatchableKeys.records, RecordQueryResult.WatchableKeys.recordIds, RecordQueryResult.WatchableKeys.cellValues, RecordQueryResult.WatchableKeys.groups, RecordQueryResult.WatchableKeys.groupLevels];
|
|
381
373
|
const fieldIds = this._normalizedOpts.fieldIdsOrNullIfAllFields || this._table.fields.map(field => field.id);
|
|
382
374
|
for (const fieldId of fieldIds) {
|
|
383
|
-
changedKeys.push(
|
|
375
|
+
changedKeys.push(RecordQueryResult.WatchableCellValuesInFieldKeyPrefix + fieldId);
|
|
384
376
|
}
|
|
385
377
|
return changedKeys;
|
|
386
378
|
}
|
|
@@ -388,7 +380,7 @@ class TableOrViewQueryResult extends _record_query_result.default {
|
|
|
388
380
|
/** @internal */
|
|
389
381
|
async _loadDataAsync() {
|
|
390
382
|
this._table.__tableOrViewQueryResultPool.registerObjectForReuseStrong(this);
|
|
391
|
-
|
|
383
|
+
invariant(this._mostRecentSourceModelLoadPromise, 'No source model load promises');
|
|
392
384
|
await this._mostRecentSourceModelLoadPromise;
|
|
393
385
|
if (this._sorts) {
|
|
394
386
|
this._replaceVisList();
|
|
@@ -397,17 +389,17 @@ class TableOrViewQueryResult extends _record_query_result.default {
|
|
|
397
389
|
this._orderedGroups = this._generateAndLoadOrderedGroups();
|
|
398
390
|
// The server provided value and developer supplied value are the same, no conversion needed
|
|
399
391
|
this._loadedGroupLevels = this._sourceModelGroupLevels;
|
|
400
|
-
if (this._sourceModel instanceof
|
|
401
|
-
this._recordStore.watch(
|
|
392
|
+
if (this._sourceModel instanceof Table) {
|
|
393
|
+
this._recordStore.watch(WatchableRecordStoreKeys.records, this._onRecordsChanged, this);
|
|
402
394
|
} else {
|
|
403
395
|
const viewDataStore = this._recordStore.getViewDataStore(this._sourceModel.id);
|
|
404
|
-
viewDataStore.watch(
|
|
405
|
-
viewDataStore.watch(
|
|
406
|
-
viewDataStore.watch(
|
|
396
|
+
viewDataStore.watch(WatchableViewDataStoreKeys.visibleRecords, this._onRecordsChanged, this);
|
|
397
|
+
viewDataStore.watch(WatchableViewDataStoreKeys.groups, this._onGroupsChanged, this);
|
|
398
|
+
viewDataStore.watch(WatchableViewDataStoreKeys.groupLevels, this._onGroupLevelsChanged, this);
|
|
407
399
|
}
|
|
408
400
|
this._recordStore.watch(this._cellValuesForSortWatchKeys, this._onCellValuesForSortChanged, this);
|
|
409
401
|
this._recordStore.watch(this._cellValuesForGroupWatchKeys, this._onCellValuesForGroupChanged, this);
|
|
410
|
-
this._table.watch(
|
|
402
|
+
this._table.watch(WatchableTableKeys.fields, this._onTableFieldsChanged, this);
|
|
411
403
|
if (this._sorts) {
|
|
412
404
|
for (const sort of this._sorts) {
|
|
413
405
|
const field = this._table.getFieldByIdIfExists(sort.fieldId);
|
|
@@ -422,7 +414,7 @@ class TableOrViewQueryResult extends _record_query_result.default {
|
|
|
422
414
|
/** @inheritdoc */
|
|
423
415
|
unloadData() {
|
|
424
416
|
super.unloadData();
|
|
425
|
-
if (this._sourceModel instanceof
|
|
417
|
+
if (this._sourceModel instanceof Table) {
|
|
426
418
|
if (this._fieldIdsSetToLoadOrNullIfAllFields) {
|
|
427
419
|
this._recordStore.unloadRecordMetadata();
|
|
428
420
|
} else {
|
|
@@ -442,19 +434,19 @@ class TableOrViewQueryResult extends _record_query_result.default {
|
|
|
442
434
|
/** @internal */
|
|
443
435
|
_unloadData() {
|
|
444
436
|
this._mostRecentSourceModelLoadPromise = null;
|
|
445
|
-
if (this._sourceModel instanceof
|
|
446
|
-
this._recordStore.unwatch(
|
|
437
|
+
if (this._sourceModel instanceof Table) {
|
|
438
|
+
this._recordStore.unwatch(WatchableRecordStoreKeys.records, this._onRecordsChanged, this);
|
|
447
439
|
} else {
|
|
448
440
|
if (!this._sourceModel.isDeleted) {
|
|
449
441
|
const viewDataStore = this._recordStore.getViewDataStore(this._sourceModel.id);
|
|
450
|
-
viewDataStore.unwatch(
|
|
451
|
-
viewDataStore.unwatch(
|
|
452
|
-
viewDataStore.unwatch(
|
|
442
|
+
viewDataStore.unwatch(WatchableViewDataStoreKeys.visibleRecords, this._onRecordsChanged, this);
|
|
443
|
+
viewDataStore.unwatch(WatchableViewDataStoreKeys.groups, this._onGroupsChanged, this);
|
|
444
|
+
viewDataStore.unwatch(WatchableViewDataStoreKeys.groupLevels, this._onGroupLevelsChanged, this);
|
|
453
445
|
}
|
|
454
446
|
}
|
|
455
447
|
this._recordStore.unwatch(this._cellValuesForSortWatchKeys, this._onCellValuesForSortChanged, this);
|
|
456
448
|
this._recordStore.unwatch(this._cellValuesForGroupWatchKeys, this._onCellValuesForGroupChanged, this);
|
|
457
|
-
this._table.unwatch(
|
|
449
|
+
this._table.unwatch(WatchableTableKeys.fields, this._onTableFieldsChanged, this);
|
|
458
450
|
|
|
459
451
|
// If the table is deleted, can't call getFieldById on it below.
|
|
460
452
|
if (!this._table.isDeleted && this._sorts) {
|
|
@@ -475,10 +467,10 @@ class TableOrViewQueryResult extends _record_query_result.default {
|
|
|
475
467
|
/** @internal */
|
|
476
468
|
_addRecordIdsToVisList(recordIds) {
|
|
477
469
|
const visList = this._visList;
|
|
478
|
-
|
|
470
|
+
invariant(visList, 'No vis list');
|
|
479
471
|
for (const recordId of recordIds) {
|
|
480
472
|
const record = this._recordStore.getRecordByIdIfExists(recordId);
|
|
481
|
-
|
|
473
|
+
invariant(record, 'Record missing in table');
|
|
482
474
|
visList.addRecordData(record._data);
|
|
483
475
|
}
|
|
484
476
|
}
|
|
@@ -486,7 +478,7 @@ class TableOrViewQueryResult extends _record_query_result.default {
|
|
|
486
478
|
_onGroupLevelsChanged(model, key, updates) {
|
|
487
479
|
this._loadedGroupLevels = this._sourceModelGroupLevels;
|
|
488
480
|
this._unloadRemovedGroupsAndLoadNewGroupsAndTriggerWatches();
|
|
489
|
-
this._onChange(
|
|
481
|
+
this._onChange(RecordQueryResult.WatchableKeys.groupLevels);
|
|
490
482
|
}
|
|
491
483
|
/** @internal */
|
|
492
484
|
_onGroupsChanged(model, key, updates) {
|
|
@@ -494,14 +486,14 @@ class TableOrViewQueryResult extends _record_query_result.default {
|
|
|
494
486
|
}
|
|
495
487
|
/** @internal */
|
|
496
488
|
_onRecordsChanged(model, key, updates) {
|
|
497
|
-
if (model instanceof
|
|
489
|
+
if (model instanceof ViewDataStore) {
|
|
498
490
|
// For a view model, we don't get updates sent with the onChange event,
|
|
499
491
|
// so we need to manually generate updates based on the old and new
|
|
500
492
|
// recordIds.
|
|
501
|
-
|
|
493
|
+
invariant(this._orderedRecordIds, '_orderedRecordIds unset');
|
|
502
494
|
const visibleRecordIds = this._recordStore.getViewDataStore(model.viewId).visibleRecordIds;
|
|
503
|
-
const addedRecordIds =
|
|
504
|
-
const removedRecordIds =
|
|
495
|
+
const addedRecordIds = arrayDifference(visibleRecordIds, this._orderedRecordIds);
|
|
496
|
+
const removedRecordIds = arrayDifference(this._orderedRecordIds, visibleRecordIds);
|
|
505
497
|
updates = {
|
|
506
498
|
addedRecordIds,
|
|
507
499
|
removedRecordIds
|
|
@@ -519,7 +511,7 @@ class TableOrViewQueryResult extends _record_query_result.default {
|
|
|
519
511
|
} = updates;
|
|
520
512
|
if (this._sorts) {
|
|
521
513
|
const visList = this._visList;
|
|
522
|
-
|
|
514
|
+
invariant(visList, 'No vis list');
|
|
523
515
|
if (removedRecordIds.length > 0) {
|
|
524
516
|
visList.removeRecordIds(removedRecordIds);
|
|
525
517
|
}
|
|
@@ -538,8 +530,8 @@ class TableOrViewQueryResult extends _record_query_result.default {
|
|
|
538
530
|
|
|
539
531
|
// Now that we've applied our changes (if applicable), let's regenerate our recordIds.
|
|
540
532
|
this._orderedRecordIds = this._generateOrderedRecordIds();
|
|
541
|
-
this._onChange(
|
|
542
|
-
this._onChange(
|
|
533
|
+
this._onChange(RecordQueryResult.WatchableKeys.records, updates);
|
|
534
|
+
this._onChange(RecordQueryResult.WatchableKeys.recordIds, updates);
|
|
543
535
|
}
|
|
544
536
|
/** @internal */
|
|
545
537
|
// istanbul ignore next
|
|
@@ -562,8 +554,8 @@ class TableOrViewQueryResult extends _record_query_result.default {
|
|
|
562
554
|
// NOTE: this will only ever be called if we have sorts, so it's safe to assert that we have
|
|
563
555
|
// a vis list here.
|
|
564
556
|
const visList = this._visList;
|
|
565
|
-
|
|
566
|
-
|
|
557
|
+
invariant(visList, 'No vis list');
|
|
558
|
+
invariant(recordIds.length > 0, 'field ID set without a corresponding record ID');
|
|
567
559
|
|
|
568
560
|
// Only move recordIds that are already in the visList.
|
|
569
561
|
// It's possible to have recordId that is not currently in the visList since
|
|
@@ -581,8 +573,8 @@ class TableOrViewQueryResult extends _record_query_result.default {
|
|
|
581
573
|
addedRecordIds: [],
|
|
582
574
|
removedRecordIds: []
|
|
583
575
|
};
|
|
584
|
-
this._onChange(
|
|
585
|
-
this._onChange(
|
|
576
|
+
this._onChange(RecordQueryResult.WatchableKeys.records, changeData);
|
|
577
|
+
this._onChange(RecordQueryResult.WatchableKeys.recordIds, changeData);
|
|
586
578
|
}
|
|
587
579
|
/** @internal */
|
|
588
580
|
_onFieldConfigChanged(_field, _key) {
|
|
@@ -615,7 +607,7 @@ class TableOrViewQueryResult extends _record_query_result.default {
|
|
|
615
607
|
if (fieldIdsSet.has(fieldId)) {
|
|
616
608
|
wereAnyFieldsCreatedOrDeleted = true;
|
|
617
609
|
const field = this._table.getFieldByIdIfExists(fieldId);
|
|
618
|
-
|
|
610
|
+
invariant(field, 'Created field does not exist');
|
|
619
611
|
field.watch('type', this._onFieldConfigChanged, this);
|
|
620
612
|
field.watch('options', this._onFieldConfigChanged, this);
|
|
621
613
|
}
|
|
@@ -637,8 +629,8 @@ class TableOrViewQueryResult extends _record_query_result.default {
|
|
|
637
629
|
addedRecordIds: [],
|
|
638
630
|
removedRecordIds: []
|
|
639
631
|
};
|
|
640
|
-
this._onChange(
|
|
641
|
-
this._onChange(
|
|
632
|
+
this._onChange(RecordQueryResult.WatchableKeys.records, changeData);
|
|
633
|
+
this._onChange(RecordQueryResult.WatchableKeys.recordIds, changeData);
|
|
642
634
|
|
|
643
635
|
// We do not unload/reload groupQueryResults if it's field is deleted as
|
|
644
636
|
// it is responsible for failing to load if the field doesn't exist
|
|
@@ -652,7 +644,7 @@ class TableOrViewQueryResult extends _record_query_result.default {
|
|
|
652
644
|
// a cellValues change twice with no data).
|
|
653
645
|
return;
|
|
654
646
|
}
|
|
655
|
-
this._onChange(
|
|
647
|
+
this._onChange(RecordQueryResult.WatchableKeys.cellValues, updates);
|
|
656
648
|
}
|
|
657
649
|
/** @internal */
|
|
658
650
|
_onCellValuesInFieldChanged(table, key, recordIds, fieldId) {
|
|
@@ -667,7 +659,7 @@ class TableOrViewQueryResult extends _record_query_result.default {
|
|
|
667
659
|
/** @internal */
|
|
668
660
|
_generateOrderedRecordIds() {
|
|
669
661
|
if (this._sorts) {
|
|
670
|
-
|
|
662
|
+
invariant(this._visList, 'Cannot generate record ids without a vis list');
|
|
671
663
|
return this._visList.getOrderedRecordIds();
|
|
672
664
|
} else {
|
|
673
665
|
return this._sourceModelRecordIds;
|
|
@@ -677,8 +669,8 @@ class TableOrViewQueryResult extends _record_query_result.default {
|
|
|
677
669
|
_generateAndLoadOrderedGroups() {
|
|
678
670
|
// istanbul ignore next
|
|
679
671
|
if (this._groupLevels) {
|
|
680
|
-
|
|
681
|
-
throw
|
|
672
|
+
invariant(this._visList, 'Cannot generate record ids without a vis list');
|
|
673
|
+
throw spawnError('custom group configs not supported');
|
|
682
674
|
} else {
|
|
683
675
|
// Get the group from the view itself
|
|
684
676
|
const groupLevels = this._sourceModelGroupLevels;
|
|
@@ -716,7 +708,7 @@ class TableOrViewQueryResult extends _record_query_result.default {
|
|
|
716
708
|
_unloadRemovedGroupsAndLoadNewGroupsAndTriggerWatches() {
|
|
717
709
|
this._unloadOrderedGroupsIfNeeded();
|
|
718
710
|
this._orderedGroups = this._generateAndLoadOrderedGroups();
|
|
719
|
-
this._onChange(
|
|
711
|
+
this._onChange(RecordQueryResult.WatchableKeys.groups);
|
|
720
712
|
}
|
|
721
713
|
/** @internal */
|
|
722
714
|
_replaceVisList() {
|
|
@@ -729,7 +721,7 @@ class TableOrViewQueryResult extends _record_query_result.default {
|
|
|
729
721
|
}
|
|
730
722
|
/** @internal */
|
|
731
723
|
_getSortsWithDeletedFieldsFiltered() {
|
|
732
|
-
|
|
724
|
+
invariant(this._sorts, 'No sorts');
|
|
733
725
|
|
|
734
726
|
// Filter out any sorts levels that rely on deleted fields.
|
|
735
727
|
// NOTE: we keep deleted fields around (rather than filtering them out
|
|
@@ -742,8 +734,8 @@ class TableOrViewQueryResult extends _record_query_result.default {
|
|
|
742
734
|
}
|
|
743
735
|
/** @internal */
|
|
744
736
|
_spawnErrorForDeletion() {
|
|
745
|
-
const sourceModelName = this._sourceModel instanceof
|
|
746
|
-
return
|
|
737
|
+
const sourceModelName = this._sourceModel instanceof Table ? 'table' : 'view';
|
|
738
|
+
return spawnError("RecordQueryResult's underlying %s has been deleted", sourceModelName);
|
|
747
739
|
}
|
|
748
740
|
}
|
|
749
|
-
|
|
741
|
+
export default TableOrViewQueryResult;
|