@airtable/blocks 1.18.1 → 1.19.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +15 -1
- package/dist/cjs/color_utils.js +21 -23
- package/dist/cjs/colors.js +4 -60
- package/dist/cjs/error_utils.js +15 -25
- package/dist/cjs/event_tracker.js +5 -11
- package/dist/cjs/global_config.js +107 -188
- package/dist/cjs/index.js +16 -40
- package/dist/cjs/injected/airtable_interface.js +1 -6
- package/dist/cjs/models/abstract_model.js +50 -81
- package/dist/cjs/models/abstract_model_with_async_data.js +102 -177
- package/dist/cjs/models/base.js +211 -374
- package/dist/cjs/models/create_aggregators.js +53 -47
- package/dist/cjs/models/cursor.js +125 -201
- package/dist/cjs/models/field.js +256 -303
- package/dist/cjs/models/grouped_record_query_result.js +210 -286
- package/dist/cjs/models/linked_records_query_result.js +276 -454
- package/dist/cjs/models/models.js +36 -50
- package/dist/cjs/models/mutation_constants.js +5 -9
- package/dist/cjs/models/mutations.js +125 -338
- package/dist/cjs/models/object_pool.js +37 -94
- package/dist/cjs/models/record.js +132 -226
- package/dist/cjs/models/record_coloring.js +14 -19
- package/dist/cjs/models/record_query_result.js +323 -282
- package/dist/cjs/models/record_store.js +355 -688
- package/dist/cjs/models/session.js +99 -158
- package/dist/cjs/models/table.js +361 -549
- package/dist/cjs/models/table_or_view_query_result.js +410 -765
- package/dist/cjs/models/view.js +161 -204
- package/dist/cjs/models/view_data_store.js +177 -282
- package/dist/cjs/models/view_metadata_query_result.js +96 -127
- package/dist/cjs/perform_record_action.js +69 -103
- package/dist/cjs/private_utils.js +133 -223
- package/dist/cjs/sdk.js +97 -142
- package/dist/cjs/settings_button.js +30 -57
- package/dist/cjs/stats/block_stats.js +3 -15
- package/dist/cjs/testing/abstract_mock_airtable_interface.js +53 -97
- package/dist/cjs/types/airtable_interface.js +36 -8
- package/dist/cjs/types/field.js +66 -12
- package/dist/cjs/types/mutations.js +99 -6
- package/dist/cjs/types/permission_levels.js +2 -4
- package/dist/cjs/types/undo_redo.js +2 -3
- package/dist/cjs/types/view.js +16 -11
- package/dist/cjs/ui/base_provider.js +14 -9
- package/dist/cjs/ui/baymax_utils.js +107 -1102
- package/dist/cjs/ui/block_wrapper.js +30 -68
- package/dist/cjs/ui/box.js +52 -56
- package/dist/cjs/ui/button.js +60 -77
- package/dist/cjs/ui/cell_renderer.js +78 -139
- package/dist/cjs/ui/choice_token.js +45 -47
- package/dist/cjs/ui/collaborator_token.js +33 -54
- package/dist/cjs/ui/color_palette.js +58 -106
- package/dist/cjs/ui/color_palette_synced.js +41 -52
- package/dist/cjs/ui/confirmation_dialog.js +53 -69
- package/dist/cjs/ui/control_sizes.js +21 -46
- package/dist/cjs/ui/create_detect_element_resize.js +16 -50
- package/dist/cjs/ui/css_helpers.js +3 -10
- package/dist/cjs/ui/dialog.js +44 -71
- package/dist/cjs/ui/dialog_close_button.js +52 -72
- package/dist/cjs/ui/expand_record.js +4 -11
- package/dist/cjs/ui/expand_record_list.js +6 -11
- package/dist/cjs/ui/expand_record_picker_async.js +18 -35
- package/dist/cjs/ui/field_icon.js +25 -28
- package/dist/cjs/ui/field_picker.js +47 -81
- package/dist/cjs/ui/field_picker_synced.js +33 -44
- package/dist/cjs/ui/form_field.js +45 -64
- package/dist/cjs/ui/geometry/geometry.js +6 -10
- package/dist/cjs/ui/geometry/point.js +5 -13
- package/dist/cjs/ui/geometry/rect.js +7 -29
- package/dist/cjs/ui/geometry/size.js +5 -13
- package/dist/cjs/ui/global_alert.js +35 -61
- package/dist/cjs/ui/global_config_synced_component_helpers.js +4 -13
- package/dist/cjs/ui/heading.js +63 -92
- package/dist/cjs/ui/icon.js +44 -66
- package/dist/cjs/ui/icon_config.js +13 -24
- package/dist/cjs/ui/initialize_block.js +23 -36
- package/dist/cjs/ui/input.js +74 -87
- package/dist/cjs/ui/input_synced.js +34 -43
- package/dist/cjs/ui/key_codes.js +4 -9
- package/dist/cjs/ui/label.js +45 -50
- package/dist/cjs/ui/link.js +74 -89
- package/dist/cjs/ui/loader.js +26 -42
- package/dist/cjs/ui/modal.js +63 -89
- package/dist/cjs/ui/model_picker_select.js +29 -47
- package/dist/cjs/ui/popover.js +98 -180
- package/dist/cjs/ui/progress_bar.js +45 -51
- package/dist/cjs/ui/record_card.js +143 -278
- package/dist/cjs/ui/record_card_list.js +117 -165
- package/dist/cjs/ui/remote_utils.js +5 -13
- package/dist/cjs/ui/sdk_context.js +7 -9
- package/dist/cjs/ui/select.js +84 -118
- package/dist/cjs/ui/select_and_select_buttons_helpers.js +29 -45
- package/dist/cjs/ui/select_buttons.js +54 -90
- package/dist/cjs/ui/select_buttons_synced.js +32 -41
- package/dist/cjs/ui/select_synced.js +32 -42
- package/dist/cjs/ui/switch.js +66 -84
- package/dist/cjs/ui/switch_synced.js +32 -38
- package/dist/cjs/ui/synced.js +16 -43
- package/dist/cjs/ui/system/all_styles_set.js +89 -22
- package/dist/cjs/ui/system/appearance/appearance_set.js +15 -26
- package/dist/cjs/ui/system/appearance/background_color.js +6 -12
- package/dist/cjs/ui/system/appearance/border.js +6 -12
- package/dist/cjs/ui/system/appearance/border_radius.js +6 -12
- package/dist/cjs/ui/system/appearance/box_shadow.js +6 -12
- package/dist/cjs/ui/system/appearance/opacity.js +5 -11
- package/dist/cjs/ui/system/dimensions/dimensions_set.js +15 -27
- package/dist/cjs/ui/system/dimensions/height.js +5 -11
- package/dist/cjs/ui/system/dimensions/max_height.js +5 -11
- package/dist/cjs/ui/system/dimensions/max_width.js +5 -11
- package/dist/cjs/ui/system/dimensions/min_height.js +5 -11
- package/dist/cjs/ui/system/dimensions/min_width.js +5 -11
- package/dist/cjs/ui/system/dimensions/width.js +5 -11
- package/dist/cjs/ui/system/display.js +8 -9
- package/dist/cjs/ui/system/flex_container/align_content.js +6 -12
- package/dist/cjs/ui/system/flex_container/align_items.js +6 -12
- package/dist/cjs/ui/system/flex_container/flex_container_set.js +15 -27
- package/dist/cjs/ui/system/flex_container/flex_direction.js +5 -11
- package/dist/cjs/ui/system/flex_container/flex_wrap.js +5 -11
- package/dist/cjs/ui/system/flex_container/justify_content.js +5 -11
- package/dist/cjs/ui/system/flex_container/justify_items.js +5 -11
- package/dist/cjs/ui/system/flex_item/align_self.js +6 -12
- package/dist/cjs/ui/system/flex_item/flex.js +5 -11
- package/dist/cjs/ui/system/flex_item/flex_basis.js +5 -11
- package/dist/cjs/ui/system/flex_item/flex_grow.js +5 -11
- package/dist/cjs/ui/system/flex_item/flex_item_set.js +15 -28
- package/dist/cjs/ui/system/flex_item/flex_shrink.js +5 -11
- package/dist/cjs/ui/system/flex_item/justify_self.js +5 -11
- package/dist/cjs/ui/system/flex_item/order.js +5 -11
- package/dist/cjs/ui/system/index.js +310 -362
- package/dist/cjs/ui/system/overflow.js +8 -9
- package/dist/cjs/ui/system/position/bottom.js +6 -13
- package/dist/cjs/ui/system/position/left.js +5 -12
- package/dist/cjs/ui/system/position/position.js +5 -11
- package/dist/cjs/ui/system/position/position_set.js +15 -27
- package/dist/cjs/ui/system/position/right.js +5 -12
- package/dist/cjs/ui/system/position/top.js +5 -12
- package/dist/cjs/ui/system/position/z_index.js +5 -11
- package/dist/cjs/ui/system/spacing/margin.js +5 -12
- package/dist/cjs/ui/system/spacing/padding.js +5 -12
- package/dist/cjs/ui/system/spacing/spacing_set.js +15 -23
- package/dist/cjs/ui/system/typography/font_family.js +5 -11
- package/dist/cjs/ui/system/typography/font_size.js +5 -11
- package/dist/cjs/ui/system/typography/font_style.js +5 -11
- package/dist/cjs/ui/system/typography/font_weight.js +5 -11
- package/dist/cjs/ui/system/typography/letter_spacing.js +5 -11
- package/dist/cjs/ui/system/typography/line_height.js +5 -11
- package/dist/cjs/ui/system/typography/text_align.js +5 -11
- package/dist/cjs/ui/system/typography/text_color.js +5 -11
- package/dist/cjs/ui/system/typography/text_decoration.js +5 -11
- package/dist/cjs/ui/system/typography/text_transform.js +5 -11
- package/dist/cjs/ui/system/typography/typography_set.js +15 -31
- package/dist/cjs/ui/system/utils/create_responsive_prop_type.js +2 -4
- package/dist/cjs/ui/system/utils/create_style_prop_types.js +5 -13
- package/dist/cjs/ui/system/utils/ensure_numbers_are_within_scale.js +4 -14
- package/dist/cjs/ui/system/utils/get_style_props_for_responsive_prop.js +30 -70
- package/dist/cjs/ui/table_picker.js +26 -43
- package/dist/cjs/ui/table_picker_synced.js +33 -42
- package/dist/cjs/ui/text.js +59 -71
- package/dist/cjs/ui/text_button.js +80 -97
- package/dist/cjs/ui/theme/default_theme/button_variants.js +1 -5
- package/dist/cjs/ui/theme/default_theme/control_sizes.js +29 -42
- package/dist/cjs/ui/theme/default_theme/heading_styles.js +4 -5
- package/dist/cjs/ui/theme/default_theme/index.js +15 -32
- package/dist/cjs/ui/theme/default_theme/input_variants.js +1 -5
- package/dist/cjs/ui/theme/default_theme/link_variants.js +1 -5
- package/dist/cjs/ui/theme/default_theme/select_buttons_variants.js +1 -5
- package/dist/cjs/ui/theme/default_theme/select_variants.js +10 -21
- package/dist/cjs/ui/theme/default_theme/switch_variants.js +8 -20
- package/dist/cjs/ui/theme/default_theme/text_button_variants.js +1 -5
- package/dist/cjs/ui/theme/default_theme/text_styles.js +1 -2
- package/dist/cjs/ui/theme/default_theme/tokens.js +33 -35
- package/dist/cjs/ui/theme/theme_context.js +3 -6
- package/dist/cjs/ui/theme/use_theme.js +1 -7
- package/dist/cjs/ui/tooltip.js +38 -79
- package/dist/cjs/ui/types/aria_props.js +3 -7
- package/dist/cjs/ui/types/data_attributes_prop.js +8 -6
- package/dist/cjs/ui/types/tooltip_anchor_props.js +4 -5
- package/dist/cjs/ui/ui.js +97 -130
- package/dist/cjs/ui/unstable_standalone_ui.js +18 -42
- package/dist/cjs/ui/use_array_identity.js +0 -4
- package/dist/cjs/ui/use_base.js +4 -13
- package/dist/cjs/ui/use_color_scheme.js +60 -0
- package/dist/cjs/ui/use_cursor.js +3 -12
- package/dist/cjs/ui/use_form_field.js +4 -6
- package/dist/cjs/ui/use_global_config.js +3 -10
- package/dist/cjs/ui/use_loadable.js +59 -132
- package/dist/cjs/ui/use_record_action_data.js +6 -12
- package/dist/cjs/ui/use_records.js +27 -28
- package/dist/cjs/ui/use_session.js +6 -15
- package/dist/cjs/ui/use_settings_button.js +4 -11
- package/dist/cjs/ui/use_styled_system.js +12 -21
- package/dist/cjs/ui/use_synced.js +0 -7
- package/dist/cjs/ui/use_text_color_for_background_color.js +1 -5
- package/dist/cjs/ui/use_view_metadata.js +5 -8
- package/dist/cjs/ui/use_viewport.js +1 -7
- package/dist/cjs/ui/use_watchable.js +36 -74
- package/dist/cjs/ui/view_picker.js +44 -78
- package/dist/cjs/ui/view_picker_synced.js +33 -44
- package/dist/cjs/ui/viewport_constraint.js +37 -64
- package/dist/cjs/ui/with_hooks.js +17 -22
- package/dist/cjs/ui/with_styled_system.js +33 -60
- package/dist/cjs/undo_redo.js +12 -32
- package/dist/cjs/unstable_private_utils.js +6 -8
- package/dist/cjs/unstable_testing_utils.js +44 -57
- package/dist/cjs/viewport.js +127 -189
- package/dist/cjs/warning.js +5 -6
- package/dist/cjs/watchable.js +66 -148
- package/dist/types/src/colors.d.ts +1 -1
- package/dist/types/src/colors.d.ts.map +1 -1
- package/dist/types/src/global_config.d.ts +1 -1
- package/dist/types/src/global_config.d.ts.map +1 -1
- package/dist/types/src/models/base.d.ts +1 -1
- package/dist/types/src/models/base.d.ts.map +1 -1
- package/dist/types/src/models/cursor.d.ts +1 -1
- package/dist/types/src/models/cursor.d.ts.map +1 -1
- package/dist/types/src/models/field.d.ts +1 -1
- package/dist/types/src/models/field.d.ts.map +1 -1
- package/dist/types/src/models/linked_records_query_result.d.ts.map +1 -1
- package/dist/types/src/models/models.d.ts.map +1 -1
- package/dist/types/src/models/record.d.ts +1 -1
- package/dist/types/src/models/record.d.ts.map +1 -1
- package/dist/types/src/models/record_coloring.d.ts +2 -2
- package/dist/types/src/models/record_coloring.d.ts.map +1 -1
- package/dist/types/src/models/record_query_result.d.ts +3 -3
- package/dist/types/src/models/record_query_result.d.ts.map +1 -1
- package/dist/types/src/models/session.d.ts +1 -1
- package/dist/types/src/models/session.d.ts.map +1 -1
- package/dist/types/src/models/table.d.ts +1 -1
- package/dist/types/src/models/table.d.ts.map +1 -1
- package/dist/types/src/models/view.d.ts +1 -1
- package/dist/types/src/models/view.d.ts.map +1 -1
- package/dist/types/src/models/view_metadata_query_result.d.ts +2 -2
- package/dist/types/src/models/view_metadata_query_result.d.ts.map +1 -1
- package/dist/types/src/perform_record_action.d.ts +1 -1
- package/dist/types/src/perform_record_action.d.ts.map +1 -1
- package/dist/types/src/private_utils.d.ts +8 -8
- package/dist/types/src/private_utils.d.ts.map +1 -1
- package/dist/types/src/sdk.d.ts +1 -1
- package/dist/types/src/sdk.d.ts.map +1 -1
- package/dist/types/src/settings_button.d.ts +1 -1
- package/dist/types/src/settings_button.d.ts.map +1 -1
- package/dist/types/src/types/aggregators.d.ts +1 -1
- package/dist/types/src/types/aggregators.d.ts.map +1 -1
- package/dist/types/src/types/airtable_interface.d.ts +6 -6
- package/dist/types/src/types/airtable_interface.d.ts.map +1 -1
- package/dist/types/src/types/attachment.d.ts +1 -1
- package/dist/types/src/types/attachment.d.ts.map +1 -1
- package/dist/types/src/types/base.d.ts +1 -1
- package/dist/types/src/types/base.d.ts.map +1 -1
- package/dist/types/src/types/block.d.ts +1 -1
- package/dist/types/src/types/block.d.ts.map +1 -1
- package/dist/types/src/types/collaborator.d.ts +1 -1
- package/dist/types/src/types/collaborator.d.ts.map +1 -1
- package/dist/types/src/types/field.d.ts +5 -5
- package/dist/types/src/types/field.d.ts.map +1 -1
- package/dist/types/src/types/global_config.d.ts +6 -6
- package/dist/types/src/types/global_config.d.ts.map +1 -1
- package/dist/types/src/types/mutations.d.ts +4 -4
- package/dist/types/src/types/mutations.d.ts.map +1 -1
- package/dist/types/src/types/permission_levels.d.ts +1 -1
- package/dist/types/src/types/permission_levels.d.ts.map +1 -1
- package/dist/types/src/types/record.d.ts +2 -2
- package/dist/types/src/types/record.d.ts.map +1 -1
- package/dist/types/src/types/record_action_data.d.ts +1 -1
- package/dist/types/src/types/record_action_data.d.ts.map +1 -1
- package/dist/types/src/types/table.d.ts +3 -3
- package/dist/types/src/types/table.d.ts.map +1 -1
- package/dist/types/src/types/undo_redo.d.ts +1 -1
- package/dist/types/src/types/undo_redo.d.ts.map +1 -1
- package/dist/types/src/types/view.d.ts +4 -4
- package/dist/types/src/types/view.d.ts.map +1 -1
- package/dist/types/src/ui/base_provider.d.ts +1 -1
- package/dist/types/src/ui/base_provider.d.ts.map +1 -1
- package/dist/types/src/ui/block_wrapper.d.ts +2 -2
- package/dist/types/src/ui/button.d.ts +2 -2
- package/dist/types/src/ui/button.d.ts.map +1 -1
- package/dist/types/src/ui/cell_renderer.d.ts +2 -2
- package/dist/types/src/ui/choice_token.d.ts +4 -4
- package/dist/types/src/ui/choice_token.d.ts.map +1 -1
- package/dist/types/src/ui/collaborator_token.d.ts +6 -6
- package/dist/types/src/ui/collaborator_token.d.ts.map +1 -1
- package/dist/types/src/ui/color_palette.d.ts +3 -3
- package/dist/types/src/ui/color_palette.d.ts.map +1 -1
- package/dist/types/src/ui/color_palette_synced.d.ts +2 -2
- package/dist/types/src/ui/confirmation_dialog.d.ts +1 -1
- package/dist/types/src/ui/control_sizes.d.ts +2 -2
- package/dist/types/src/ui/control_sizes.d.ts.map +1 -1
- package/dist/types/src/ui/dialog.d.ts +2 -2
- package/dist/types/src/ui/dialog.d.ts.map +1 -1
- package/dist/types/src/ui/dialog_close_button.d.ts +1 -1
- package/dist/types/src/ui/field_icon.d.ts +3 -3
- package/dist/types/src/ui/field_icon.d.ts.map +1 -1
- package/dist/types/src/ui/field_picker.d.ts +2 -2
- package/dist/types/src/ui/field_picker.d.ts.map +1 -1
- package/dist/types/src/ui/form_field.d.ts +1 -1
- package/dist/types/src/ui/form_field.d.ts.map +1 -1
- package/dist/types/src/ui/global_alert.d.ts +1 -1
- package/dist/types/src/ui/global_alert.d.ts.map +1 -1
- package/dist/types/src/ui/global_config_synced_component_helpers.d.ts +1 -1
- package/dist/types/src/ui/global_config_synced_component_helpers.d.ts.map +1 -1
- package/dist/types/src/ui/heading.d.ts +4 -4
- package/dist/types/src/ui/heading.d.ts.map +1 -1
- package/dist/types/src/ui/icon.d.ts +2 -2
- package/dist/types/src/ui/icon.d.ts.map +1 -1
- package/dist/types/src/ui/icon_config.d.ts +39 -39
- package/dist/types/src/ui/icon_config.d.ts.map +1 -1
- package/dist/types/src/ui/initialize_block.d.ts +3 -3
- package/dist/types/src/ui/initialize_block.d.ts.map +1 -1
- package/dist/types/src/ui/input.d.ts +16 -16
- package/dist/types/src/ui/input.d.ts.map +1 -1
- package/dist/types/src/ui/label.d.ts +1 -1
- package/dist/types/src/ui/label.d.ts.map +1 -1
- package/dist/types/src/ui/link.d.ts +2 -2
- package/dist/types/src/ui/link.d.ts.map +1 -1
- package/dist/types/src/ui/loader.d.ts +2 -2
- package/dist/types/src/ui/loader.d.ts.map +1 -1
- package/dist/types/src/ui/model_picker_select.d.ts +1 -1
- package/dist/types/src/ui/model_picker_select.d.ts.map +1 -1
- package/dist/types/src/ui/popover.d.ts +5 -5
- package/dist/types/src/ui/popover.d.ts.map +1 -1
- package/dist/types/src/ui/progress_bar.d.ts +2 -2
- package/dist/types/src/ui/progress_bar.d.ts.map +1 -1
- package/dist/types/src/ui/record_card.d.ts +3 -3
- package/dist/types/src/ui/record_card.d.ts.map +1 -1
- package/dist/types/src/ui/record_card_list.d.ts +3 -3
- package/dist/types/src/ui/record_card_list.d.ts.map +1 -1
- package/dist/types/src/ui/select.d.ts +4 -4
- package/dist/types/src/ui/select_and_select_buttons_helpers.d.ts +4 -4
- package/dist/types/src/ui/select_and_select_buttons_helpers.d.ts.map +1 -1
- package/dist/types/src/ui/select_buttons.d.ts +5 -5
- package/dist/types/src/ui/select_buttons.d.ts.map +1 -1
- package/dist/types/src/ui/switch.d.ts +2 -2
- package/dist/types/src/ui/switch.d.ts.map +1 -1
- package/dist/types/src/ui/synced.d.ts +3 -3
- package/dist/types/src/ui/system/all_styles_set.d.ts +0 -1
- package/dist/types/src/ui/system/all_styles_set.d.ts.map +1 -1
- package/dist/types/src/ui/system/appearance/appearance_set.d.ts +0 -1
- package/dist/types/src/ui/system/appearance/appearance_set.d.ts.map +1 -1
- package/dist/types/src/ui/system/appearance/background_color.d.ts +0 -1
- package/dist/types/src/ui/system/appearance/background_color.d.ts.map +1 -1
- package/dist/types/src/ui/system/appearance/border.d.ts +0 -1
- package/dist/types/src/ui/system/appearance/border.d.ts.map +1 -1
- package/dist/types/src/ui/system/appearance/border_radius.d.ts +0 -1
- package/dist/types/src/ui/system/appearance/border_radius.d.ts.map +1 -1
- package/dist/types/src/ui/system/appearance/box_shadow.d.ts +0 -1
- package/dist/types/src/ui/system/appearance/box_shadow.d.ts.map +1 -1
- package/dist/types/src/ui/system/appearance/opacity.d.ts +0 -1
- package/dist/types/src/ui/system/appearance/opacity.d.ts.map +1 -1
- package/dist/types/src/ui/system/dimensions/dimensions_set.d.ts +0 -1
- package/dist/types/src/ui/system/dimensions/dimensions_set.d.ts.map +1 -1
- package/dist/types/src/ui/system/dimensions/height.d.ts +0 -1
- package/dist/types/src/ui/system/dimensions/height.d.ts.map +1 -1
- package/dist/types/src/ui/system/dimensions/max_height.d.ts +0 -1
- package/dist/types/src/ui/system/dimensions/max_height.d.ts.map +1 -1
- package/dist/types/src/ui/system/dimensions/max_width.d.ts +0 -1
- package/dist/types/src/ui/system/dimensions/max_width.d.ts.map +1 -1
- package/dist/types/src/ui/system/dimensions/min_height.d.ts +0 -1
- package/dist/types/src/ui/system/dimensions/min_height.d.ts.map +1 -1
- package/dist/types/src/ui/system/dimensions/min_width.d.ts +0 -1
- package/dist/types/src/ui/system/dimensions/min_width.d.ts.map +1 -1
- package/dist/types/src/ui/system/dimensions/width.d.ts +0 -1
- package/dist/types/src/ui/system/dimensions/width.d.ts.map +1 -1
- package/dist/types/src/ui/system/display.d.ts +0 -1
- package/dist/types/src/ui/system/display.d.ts.map +1 -1
- package/dist/types/src/ui/system/flex_container/align_content.d.ts +0 -1
- package/dist/types/src/ui/system/flex_container/align_content.d.ts.map +1 -1
- package/dist/types/src/ui/system/flex_container/align_items.d.ts +0 -1
- package/dist/types/src/ui/system/flex_container/align_items.d.ts.map +1 -1
- package/dist/types/src/ui/system/flex_container/flex_container_set.d.ts +0 -1
- package/dist/types/src/ui/system/flex_container/flex_container_set.d.ts.map +1 -1
- package/dist/types/src/ui/system/flex_container/flex_direction.d.ts +0 -1
- package/dist/types/src/ui/system/flex_container/flex_direction.d.ts.map +1 -1
- package/dist/types/src/ui/system/flex_container/flex_wrap.d.ts +0 -1
- package/dist/types/src/ui/system/flex_container/flex_wrap.d.ts.map +1 -1
- package/dist/types/src/ui/system/flex_container/justify_content.d.ts +0 -1
- package/dist/types/src/ui/system/flex_container/justify_content.d.ts.map +1 -1
- package/dist/types/src/ui/system/flex_container/justify_items.d.ts +0 -1
- package/dist/types/src/ui/system/flex_container/justify_items.d.ts.map +1 -1
- package/dist/types/src/ui/system/flex_item/align_self.d.ts +0 -1
- package/dist/types/src/ui/system/flex_item/align_self.d.ts.map +1 -1
- package/dist/types/src/ui/system/flex_item/flex.d.ts +0 -1
- package/dist/types/src/ui/system/flex_item/flex.d.ts.map +1 -1
- package/dist/types/src/ui/system/flex_item/flex_basis.d.ts +0 -1
- package/dist/types/src/ui/system/flex_item/flex_basis.d.ts.map +1 -1
- package/dist/types/src/ui/system/flex_item/flex_grow.d.ts +0 -1
- package/dist/types/src/ui/system/flex_item/flex_grow.d.ts.map +1 -1
- package/dist/types/src/ui/system/flex_item/flex_item_set.d.ts +0 -1
- package/dist/types/src/ui/system/flex_item/flex_item_set.d.ts.map +1 -1
- package/dist/types/src/ui/system/flex_item/flex_shrink.d.ts +0 -1
- package/dist/types/src/ui/system/flex_item/flex_shrink.d.ts.map +1 -1
- package/dist/types/src/ui/system/flex_item/justify_self.d.ts +0 -1
- package/dist/types/src/ui/system/flex_item/justify_self.d.ts.map +1 -1
- package/dist/types/src/ui/system/flex_item/order.d.ts +0 -1
- package/dist/types/src/ui/system/flex_item/order.d.ts.map +1 -1
- package/dist/types/src/ui/system/overflow.d.ts +0 -1
- package/dist/types/src/ui/system/overflow.d.ts.map +1 -1
- package/dist/types/src/ui/system/position/bottom.d.ts +0 -1
- package/dist/types/src/ui/system/position/bottom.d.ts.map +1 -1
- package/dist/types/src/ui/system/position/left.d.ts +0 -1
- package/dist/types/src/ui/system/position/left.d.ts.map +1 -1
- package/dist/types/src/ui/system/position/position.d.ts +0 -1
- package/dist/types/src/ui/system/position/position.d.ts.map +1 -1
- package/dist/types/src/ui/system/position/position_set.d.ts +0 -1
- package/dist/types/src/ui/system/position/position_set.d.ts.map +1 -1
- package/dist/types/src/ui/system/position/right.d.ts +0 -1
- package/dist/types/src/ui/system/position/right.d.ts.map +1 -1
- package/dist/types/src/ui/system/position/top.d.ts +0 -1
- package/dist/types/src/ui/system/position/top.d.ts.map +1 -1
- package/dist/types/src/ui/system/position/z_index.d.ts +0 -1
- package/dist/types/src/ui/system/position/z_index.d.ts.map +1 -1
- package/dist/types/src/ui/system/spacing/margin.d.ts +0 -1
- package/dist/types/src/ui/system/spacing/margin.d.ts.map +1 -1
- package/dist/types/src/ui/system/spacing/padding.d.ts +0 -1
- package/dist/types/src/ui/system/spacing/padding.d.ts.map +1 -1
- package/dist/types/src/ui/system/spacing/spacing_set.d.ts +0 -1
- package/dist/types/src/ui/system/spacing/spacing_set.d.ts.map +1 -1
- package/dist/types/src/ui/system/typography/font_family.d.ts +0 -1
- package/dist/types/src/ui/system/typography/font_family.d.ts.map +1 -1
- package/dist/types/src/ui/system/typography/font_size.d.ts +0 -1
- package/dist/types/src/ui/system/typography/font_size.d.ts.map +1 -1
- package/dist/types/src/ui/system/typography/font_style.d.ts +0 -1
- package/dist/types/src/ui/system/typography/font_style.d.ts.map +1 -1
- package/dist/types/src/ui/system/typography/font_weight.d.ts +0 -1
- package/dist/types/src/ui/system/typography/font_weight.d.ts.map +1 -1
- package/dist/types/src/ui/system/typography/letter_spacing.d.ts +0 -1
- package/dist/types/src/ui/system/typography/letter_spacing.d.ts.map +1 -1
- package/dist/types/src/ui/system/typography/line_height.d.ts +0 -1
- package/dist/types/src/ui/system/typography/line_height.d.ts.map +1 -1
- package/dist/types/src/ui/system/typography/text_align.d.ts +0 -1
- package/dist/types/src/ui/system/typography/text_align.d.ts.map +1 -1
- package/dist/types/src/ui/system/typography/text_color.d.ts +0 -1
- package/dist/types/src/ui/system/typography/text_color.d.ts.map +1 -1
- package/dist/types/src/ui/system/typography/text_decoration.d.ts +0 -1
- package/dist/types/src/ui/system/typography/text_decoration.d.ts.map +1 -1
- package/dist/types/src/ui/system/typography/text_transform.d.ts +0 -1
- package/dist/types/src/ui/system/typography/text_transform.d.ts.map +1 -1
- package/dist/types/src/ui/system/typography/typography_set.d.ts +0 -1
- package/dist/types/src/ui/system/typography/typography_set.d.ts.map +1 -1
- package/dist/types/src/ui/system/utils/create_style_prop_types.d.ts +1 -1
- package/dist/types/src/ui/system/utils/create_style_prop_types.d.ts.map +1 -1
- package/dist/types/src/ui/system/utils/csstype.d.ts +578 -578
- package/dist/types/src/ui/system/utils/csstype.d.ts.map +1 -1
- package/dist/types/src/ui/system/utils/types.d.ts +4 -4
- package/dist/types/src/ui/system/utils/types.d.ts.map +1 -1
- package/dist/types/src/ui/table_picker.d.ts +1 -1
- package/dist/types/src/ui/table_picker.d.ts.map +1 -1
- package/dist/types/src/ui/text.d.ts +4 -4
- package/dist/types/src/ui/text.d.ts.map +1 -1
- package/dist/types/src/ui/text_button.d.ts +2 -2
- package/dist/types/src/ui/text_button.d.ts.map +1 -1
- package/dist/types/src/ui/theme/default_theme/heading_styles.d.ts +2 -2
- package/dist/types/src/ui/theme/default_theme/heading_styles.d.ts.map +1 -1
- package/dist/types/src/ui/theme/default_theme/index.d.ts +1 -1
- package/dist/types/src/ui/theme/theme_context.d.ts +1 -3
- package/dist/types/src/ui/theme/theme_context.d.ts.map +1 -1
- package/dist/types/src/ui/theme/use_theme.d.ts +1 -1
- package/dist/types/src/ui/tooltip.d.ts +3 -3
- package/dist/types/src/ui/types/data_attributes_prop.d.ts.map +1 -1
- package/dist/types/src/ui/types/tooltip_anchor_props.d.ts +0 -1
- package/dist/types/src/ui/types/tooltip_anchor_props.d.ts.map +1 -1
- package/dist/types/src/ui/ui.d.ts +1 -0
- package/dist/types/src/ui/ui.d.ts.map +1 -1
- package/dist/types/src/ui/use_base.d.ts.map +1 -1
- package/dist/types/src/ui/use_color_scheme.d.ts +28 -0
- package/dist/types/src/ui/use_color_scheme.d.ts.map +1 -0
- package/dist/types/src/ui/use_cursor.d.ts.map +1 -1
- package/dist/types/src/ui/use_form_field.d.ts +0 -2
- package/dist/types/src/ui/use_form_field.d.ts.map +1 -1
- package/dist/types/src/ui/use_records.d.ts +2 -2
- package/dist/types/src/ui/use_records.d.ts.map +1 -1
- package/dist/types/src/ui/use_session.d.ts.map +1 -1
- package/dist/types/src/ui/view_picker.d.ts +3 -3
- package/dist/types/src/ui/view_picker.d.ts.map +1 -1
- package/dist/types/src/ui/viewport_constraint.d.ts +3 -3
- package/dist/types/src/ui/viewport_constraint.d.ts.map +1 -1
- package/dist/types/src/viewport.d.ts +2 -2
- package/dist/types/src/viewport.d.ts.map +1 -1
- package/dist/types/src/warning.d.ts +1 -1
- package/dist/types/src/warning.d.ts.map +1 -1
- package/package.json +40 -34
- package/dist/types/stories/all_controls.stories.d.ts +0 -2
- package/dist/types/stories/all_controls.stories.d.ts.map +0 -1
- package/dist/types/stories/box.appearance.stories.d.ts +0 -2
- package/dist/types/stories/box.appearance.stories.d.ts.map +0 -1
- package/dist/types/stories/box.dimensions.stories.d.ts +0 -2
- package/dist/types/stories/box.dimensions.stories.d.ts.map +0 -1
- package/dist/types/stories/box.flex_container.stories.d.ts +0 -2
- package/dist/types/stories/box.flex_container.stories.d.ts.map +0 -1
- package/dist/types/stories/box.flex_item.stories.d.ts +0 -2
- package/dist/types/stories/box.flex_item.stories.d.ts.map +0 -1
- package/dist/types/stories/box.position.stories.d.ts +0 -2
- package/dist/types/stories/box.position.stories.d.ts.map +0 -1
- package/dist/types/stories/box.spacing.stories.d.ts +0 -2
- package/dist/types/stories/box.spacing.stories.d.ts.map +0 -1
- package/dist/types/stories/box.stories.d.ts +0 -2
- package/dist/types/stories/box.stories.d.ts.map +0 -1
- package/dist/types/stories/box.typography.stories.d.ts +0 -2
- package/dist/types/stories/box.typography.stories.d.ts.map +0 -1
- package/dist/types/stories/button.stories.d.ts +0 -2
- package/dist/types/stories/button.stories.d.ts.map +0 -1
- package/dist/types/stories/cell_renderer.stories.d.ts +0 -2
- package/dist/types/stories/cell_renderer.stories.d.ts.map +0 -1
- package/dist/types/stories/choice_token.stories.d.ts +0 -2
- package/dist/types/stories/choice_token.stories.d.ts.map +0 -1
- package/dist/types/stories/collaborator_token.stories.d.ts +0 -2
- package/dist/types/stories/collaborator_token.stories.d.ts.map +0 -1
- package/dist/types/stories/color_palette.stories.d.ts +0 -2
- package/dist/types/stories/color_palette.stories.d.ts.map +0 -1
- package/dist/types/stories/confirmation_dialog.stories.d.ts +0 -2
- package/dist/types/stories/confirmation_dialog.stories.d.ts.map +0 -1
- package/dist/types/stories/dialog.stories.d.ts +0 -2
- package/dist/types/stories/dialog.stories.d.ts.map +0 -1
- package/dist/types/stories/field_icon.stories.d.ts +0 -2
- package/dist/types/stories/field_icon.stories.d.ts.map +0 -1
- package/dist/types/stories/form_field.stories.d.ts +0 -2
- package/dist/types/stories/form_field.stories.d.ts.map +0 -1
- package/dist/types/stories/heading.size.stories.d.ts +0 -2
- package/dist/types/stories/heading.size.stories.d.ts.map +0 -1
- package/dist/types/stories/heading.stories.d.ts +0 -2
- package/dist/types/stories/heading.stories.d.ts.map +0 -1
- package/dist/types/stories/helpers/attachments.d.ts +0 -4
- package/dist/types/stories/helpers/attachments.d.ts.map +0 -1
- package/dist/types/stories/helpers/categorize_style_props.d.ts +0 -14
- package/dist/types/stories/helpers/categorize_style_props.d.ts.map +0 -1
- package/dist/types/stories/helpers/choice_options.d.ts +0 -7
- package/dist/types/stories/helpers/choice_options.d.ts.map +0 -1
- package/dist/types/stories/helpers/code_block.d.ts +0 -5
- package/dist/types/stories/helpers/code_block.d.ts.map +0 -1
- package/dist/types/stories/helpers/code_utils.d.ts +0 -32
- package/dist/types/stories/helpers/code_utils.d.ts.map +0 -1
- package/dist/types/stories/helpers/collaborator_options.d.ts +0 -7
- package/dist/types/stories/helpers/collaborator_options.d.ts.map +0 -1
- package/dist/types/stories/helpers/example.d.ts +0 -39
- package/dist/types/stories/helpers/example.d.ts.map +0 -1
- package/dist/types/stories/helpers/example_code_panel.d.ts +0 -10
- package/dist/types/stories/helpers/example_code_panel.d.ts.map +0 -1
- package/dist/types/stories/helpers/fake_cell_renderer.d.ts +0 -7
- package/dist/types/stories/helpers/fake_cell_renderer.d.ts.map +0 -1
- package/dist/types/stories/helpers/fake_foreign_record.d.ts +0 -5
- package/dist/types/stories/helpers/fake_foreign_record.d.ts.map +0 -1
- package/dist/types/stories/helpers/fake_record_card.d.ts +0 -13
- package/dist/types/stories/helpers/fake_record_card.d.ts.map +0 -1
- package/dist/types/stories/helpers/field_type.d.ts +0 -6
- package/dist/types/stories/helpers/field_type.d.ts.map +0 -1
- package/dist/types/stories/helpers/raf_throttle.d.ts +0 -5
- package/dist/types/stories/helpers/raf_throttle.d.ts.map +0 -1
- package/dist/types/stories/helpers/style_prop_list.d.ts +0 -9
- package/dist/types/stories/helpers/style_prop_list.d.ts.map +0 -1
- package/dist/types/stories/helpers/sync_source_options.d.ts +0 -7
- package/dist/types/stories/helpers/sync_source_options.d.ts.map +0 -1
- package/dist/types/stories/helpers/use_resizable_panel.d.ts +0 -27
- package/dist/types/stories/helpers/use_resizable_panel.d.ts.map +0 -1
- package/dist/types/stories/icon.stories.d.ts +0 -2
- package/dist/types/stories/icon.stories.d.ts.map +0 -1
- package/dist/types/stories/icon_example.d.ts +0 -3
- package/dist/types/stories/icon_example.d.ts.map +0 -1
- package/dist/types/stories/input.stories.d.ts +0 -2
- package/dist/types/stories/input.stories.d.ts.map +0 -1
- package/dist/types/stories/label.stories.d.ts +0 -2
- package/dist/types/stories/label.stories.d.ts.map +0 -1
- package/dist/types/stories/link.stories.d.ts +0 -2
- package/dist/types/stories/link.stories.d.ts.map +0 -1
- package/dist/types/stories/loader.stories.d.ts +0 -2
- package/dist/types/stories/loader.stories.d.ts.map +0 -1
- package/dist/types/stories/model_pickers.stories.d.ts +0 -2
- package/dist/types/stories/model_pickers.stories.d.ts.map +0 -1
- package/dist/types/stories/progress_bar.stories.d.ts +0 -2
- package/dist/types/stories/progress_bar.stories.d.ts.map +0 -1
- package/dist/types/stories/record_card.stories.d.ts +0 -2
- package/dist/types/stories/record_card.stories.d.ts.map +0 -1
- package/dist/types/stories/record_card_list.stories.d.ts +0 -2
- package/dist/types/stories/record_card_list.stories.d.ts.map +0 -1
- package/dist/types/stories/select.stories.d.ts +0 -2
- package/dist/types/stories/select.stories.d.ts.map +0 -1
- package/dist/types/stories/select_buttons.stories.d.ts +0 -2
- package/dist/types/stories/select_buttons.stories.d.ts.map +0 -1
- package/dist/types/stories/switch.stories.d.ts +0 -2
- package/dist/types/stories/switch.stories.d.ts.map +0 -1
- package/dist/types/stories/text.size.stories.d.ts +0 -2
- package/dist/types/stories/text.size.stories.d.ts.map +0 -1
- package/dist/types/stories/text.stories.d.ts +0 -2
- package/dist/types/stories/text.stories.d.ts.map +0 -1
- package/dist/types/stories/text_button.stories.d.ts +0 -2
- package/dist/types/stories/text_button.stories.d.ts.map +0 -1
- package/dist/types/stories/tooltip.stories.d.ts +0 -2
- package/dist/types/stories/tooltip.stories.d.ts.map +0 -1
- package/dist/types/test/airtable_interface_mocks/fixture_data.d.ts +0 -124
- package/dist/types/test/airtable_interface_mocks/fixture_data.d.ts.map +0 -1
- package/dist/types/test/airtable_interface_mocks/linked_records.d.ts +0 -4
- package/dist/types/test/airtable_interface_mocks/linked_records.d.ts.map +0 -1
- package/dist/types/test/airtable_interface_mocks/mock_airtable_interface.d.ts +0 -61
- package/dist/types/test/airtable_interface_mocks/mock_airtable_interface.d.ts.map +0 -1
- package/dist/types/test/airtable_interface_mocks/project_tracker.d.ts +0 -4
- package/dist/types/test/airtable_interface_mocks/project_tracker.d.ts.map +0 -1
- package/dist/types/test/error_utils.test.d.ts +0 -2
- package/dist/types/test/error_utils.test.d.ts.map +0 -1
- package/dist/types/test/get_style_props_for_responsive_prop.test.d.ts +0 -2
- package/dist/types/test/get_style_props_for_responsive_prop.test.d.ts.map +0 -1
- package/dist/types/test/index.test.d.ts +0 -2
- package/dist/types/test/index.test.d.ts.map +0 -1
- package/dist/types/test/models/base.test.d.ts +0 -2
- package/dist/types/test/models/base.test.d.ts.map +0 -1
- package/dist/types/test/models/cursor.test.d.ts +0 -2
- package/dist/types/test/models/cursor.test.d.ts.map +0 -1
- package/dist/types/test/models/field.test.d.ts +0 -2
- package/dist/types/test/models/field.test.d.ts.map +0 -1
- package/dist/types/test/models/linked_records_query_result.test.d.ts +0 -2
- package/dist/types/test/models/linked_records_query_result.test.d.ts.map +0 -1
- package/dist/types/test/models/mutations.test.d.ts +0 -2
- package/dist/types/test/models/mutations.test.d.ts.map +0 -1
- package/dist/types/test/models/object_pool.test.d.ts +0 -2
- package/dist/types/test/models/object_pool.test.d.ts.map +0 -1
- package/dist/types/test/models/record.test.d.ts +0 -2
- package/dist/types/test/models/record.test.d.ts.map +0 -1
- package/dist/types/test/models/session.test.d.ts +0 -2
- package/dist/types/test/models/session.test.d.ts.map +0 -1
- package/dist/types/test/models/table.test.d.ts +0 -2
- package/dist/types/test/models/table.test.d.ts.map +0 -1
- package/dist/types/test/models/table_mutations.test.d.ts +0 -2
- package/dist/types/test/models/table_mutations.test.d.ts.map +0 -1
- package/dist/types/test/models/table_or_view_query_result.test.d.ts +0 -2
- package/dist/types/test/models/table_or_view_query_result.test.d.ts.map +0 -1
- package/dist/types/test/models/view.test.d.ts +0 -2
- package/dist/types/test/models/view.test.d.ts.map +0 -1
- package/dist/types/test/models/view_metadata_query_result.test.d.ts +0 -2
- package/dist/types/test/models/view_metadata_query_result.test.d.ts.map +0 -1
- package/dist/types/test/private_utils.test.d.ts +0 -2
- package/dist/types/test/private_utils.test.d.ts.map +0 -1
- package/dist/types/test/sdk.test.d.ts +0 -2
- package/dist/types/test/sdk.test.d.ts.map +0 -1
- package/dist/types/test/setup_enzyme.d.ts +0 -2
- package/dist/types/test/setup_enzyme.d.ts.map +0 -1
- package/dist/types/test/test_helpers.d.ts +0 -11
- package/dist/types/test/test_helpers.d.ts.map +0 -1
- package/dist/types/test/ui/base_provider.test.d.ts +0 -2
- package/dist/types/test/ui/base_provider.test.d.ts.map +0 -1
- package/dist/types/test/ui/block_wrapper.test.d.ts +0 -2
- package/dist/types/test/ui/block_wrapper.test.d.ts.map +0 -1
- package/dist/types/test/ui/box.test.d.ts +0 -2
- package/dist/types/test/ui/box.test.d.ts.map +0 -1
- package/dist/types/test/ui/button.test.d.ts +0 -2
- package/dist/types/test/ui/button.test.d.ts.map +0 -1
- package/dist/types/test/ui/cell_renderer.test.d.ts +0 -2
- package/dist/types/test/ui/cell_renderer.test.d.ts.map +0 -1
- package/dist/types/test/ui/choice_token.test.d.ts +0 -2
- package/dist/types/test/ui/choice_token.test.d.ts.map +0 -1
- package/dist/types/test/ui/collaborator_token.test.d.ts +0 -2
- package/dist/types/test/ui/collaborator_token.test.d.ts.map +0 -1
- package/dist/types/test/ui/color_palette.test.d.ts +0 -2
- package/dist/types/test/ui/color_palette.test.d.ts.map +0 -1
- package/dist/types/test/ui/color_palette_synced.test.d.ts +0 -2
- package/dist/types/test/ui/color_palette_synced.test.d.ts.map +0 -1
- package/dist/types/test/ui/confirmation_dialog.test.d.ts +0 -2
- package/dist/types/test/ui/confirmation_dialog.test.d.ts.map +0 -1
- package/dist/types/test/ui/dialog.test.d.ts +0 -2
- package/dist/types/test/ui/dialog.test.d.ts.map +0 -1
- package/dist/types/test/ui/expand_record.test.d.ts +0 -2
- package/dist/types/test/ui/expand_record.test.d.ts.map +0 -1
- package/dist/types/test/ui/expand_record_list.test.d.ts +0 -2
- package/dist/types/test/ui/expand_record_list.test.d.ts.map +0 -1
- package/dist/types/test/ui/expand_record_picker_async.test.d.ts +0 -2
- package/dist/types/test/ui/expand_record_picker_async.test.d.ts.map +0 -1
- package/dist/types/test/ui/field_icon.test.d.ts +0 -2
- package/dist/types/test/ui/field_icon.test.d.ts.map +0 -1
- package/dist/types/test/ui/field_picker.test.d.ts +0 -2
- package/dist/types/test/ui/field_picker.test.d.ts.map +0 -1
- package/dist/types/test/ui/field_picker_synced.test.d.ts +0 -2
- package/dist/types/test/ui/field_picker_synced.test.d.ts.map +0 -1
- package/dist/types/test/ui/form_field.test.d.ts +0 -2
- package/dist/types/test/ui/form_field.test.d.ts.map +0 -1
- package/dist/types/test/ui/global_alert.test.d.ts +0 -2
- package/dist/types/test/ui/global_alert.test.d.ts.map +0 -1
- package/dist/types/test/ui/heading.test.d.ts +0 -2
- package/dist/types/test/ui/heading.test.d.ts.map +0 -1
- package/dist/types/test/ui/icon.test.d.ts +0 -2
- package/dist/types/test/ui/icon.test.d.ts.map +0 -1
- package/dist/types/test/ui/initialize_block.test.d.ts +0 -2
- package/dist/types/test/ui/initialize_block.test.d.ts.map +0 -1
- package/dist/types/test/ui/input.test.d.ts +0 -2
- package/dist/types/test/ui/input.test.d.ts.map +0 -1
- package/dist/types/test/ui/input_synced.test.d.ts +0 -2
- package/dist/types/test/ui/input_synced.test.d.ts.map +0 -1
- package/dist/types/test/ui/label.test.d.ts +0 -2
- package/dist/types/test/ui/label.test.d.ts.map +0 -1
- package/dist/types/test/ui/link.test.d.ts +0 -2
- package/dist/types/test/ui/link.test.d.ts.map +0 -1
- package/dist/types/test/ui/loader.test.d.ts +0 -2
- package/dist/types/test/ui/loader.test.d.ts.map +0 -1
- package/dist/types/test/ui/modal.test.d.ts +0 -2
- package/dist/types/test/ui/modal.test.d.ts.map +0 -1
- package/dist/types/test/ui/popover.test.d.ts +0 -2
- package/dist/types/test/ui/popover.test.d.ts.map +0 -1
- package/dist/types/test/ui/progress_bar.test.d.ts +0 -2
- package/dist/types/test/ui/progress_bar.test.d.ts.map +0 -1
- package/dist/types/test/ui/record_card.test.d.ts +0 -2
- package/dist/types/test/ui/record_card.test.d.ts.map +0 -1
- package/dist/types/test/ui/record_card_list.test.d.ts +0 -2
- package/dist/types/test/ui/record_card_list.test.d.ts.map +0 -1
- package/dist/types/test/ui/remote_utils.test.d.ts +0 -2
- package/dist/types/test/ui/remote_utils.test.d.ts.map +0 -1
- package/dist/types/test/ui/select.test.d.ts +0 -2
- package/dist/types/test/ui/select.test.d.ts.map +0 -1
- package/dist/types/test/ui/select_buttons.test.d.ts +0 -2
- package/dist/types/test/ui/select_buttons.test.d.ts.map +0 -1
- package/dist/types/test/ui/select_buttons_synced.test.d.ts +0 -2
- package/dist/types/test/ui/select_buttons_synced.test.d.ts.map +0 -1
- package/dist/types/test/ui/select_synced.test.d.ts +0 -2
- package/dist/types/test/ui/select_synced.test.d.ts.map +0 -1
- package/dist/types/test/ui/switch.test.d.ts +0 -2
- package/dist/types/test/ui/switch.test.d.ts.map +0 -1
- package/dist/types/test/ui/switch_synced.test.d.ts +0 -2
- package/dist/types/test/ui/switch_synced.test.d.ts.map +0 -1
- package/dist/types/test/ui/synced.test.d.ts +0 -2
- package/dist/types/test/ui/synced.test.d.ts.map +0 -1
- package/dist/types/test/ui/table_picker.test.d.ts +0 -2
- package/dist/types/test/ui/table_picker.test.d.ts.map +0 -1
- package/dist/types/test/ui/table_picker_synced.test.d.ts +0 -2
- package/dist/types/test/ui/table_picker_synced.test.d.ts.map +0 -1
- package/dist/types/test/ui/text.test.d.ts +0 -2
- package/dist/types/test/ui/text.test.d.ts.map +0 -1
- package/dist/types/test/ui/text_button.test.d.ts +0 -2
- package/dist/types/test/ui/text_button.test.d.ts.map +0 -1
- package/dist/types/test/ui/tooltip.test.d.ts +0 -2
- package/dist/types/test/ui/tooltip.test.d.ts.map +0 -1
- package/dist/types/test/ui/ui.test.d.ts +0 -2
- package/dist/types/test/ui/ui.test.d.ts.map +0 -1
- package/dist/types/test/ui/unstable_standalone_ui.test.d.ts +0 -1
- package/dist/types/test/ui/unstable_standalone_ui.test.d.ts.map +0 -1
- package/dist/types/test/ui/use_array_identity.test.d.ts +0 -2
- package/dist/types/test/ui/use_array_identity.test.d.ts.map +0 -1
- package/dist/types/test/ui/use_loadable.test.d.ts +0 -2
- package/dist/types/test/ui/use_loadable.test.d.ts.map +0 -1
- package/dist/types/test/ui/use_record_action_data.test.d.ts +0 -2
- package/dist/types/test/ui/use_record_action_data.test.d.ts.map +0 -1
- package/dist/types/test/ui/use_records.test.d.ts +0 -2
- package/dist/types/test/ui/use_records.test.d.ts.map +0 -1
- package/dist/types/test/ui/use_view_metadata.test.d.ts +0 -2
- package/dist/types/test/ui/use_view_metadata.test.d.ts.map +0 -1
- package/dist/types/test/ui/use_watchable.test.d.ts +0 -2
- package/dist/types/test/ui/use_watchable.test.d.ts.map +0 -1
- package/dist/types/test/ui/view_picker.test.d.ts +0 -2
- package/dist/types/test/ui/view_picker.test.d.ts.map +0 -1
- package/dist/types/test/ui/view_picker_synced.test.d.ts +0 -2
- package/dist/types/test/ui/view_picker_synced.test.d.ts.map +0 -1
- package/dist/types/test/ui/viewport_constraint.test.d.ts +0 -2
- package/dist/types/test/ui/viewport_constraint.test.d.ts.map +0 -1
- package/dist/types/test/unstable_private_utils.test.d.ts +0 -1
- package/dist/types/test/unstable_private_utils.test.d.ts.map +0 -1
|
@@ -1,74 +1,50 @@
|
|
|
1
1
|
"use strict";
|
|
2
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.regexp.exec.js");
|
|
7
|
+
require("core-js/modules/es.regexp.to-string.js");
|
|
3
8
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
|
-
require("core-js/modules/es.symbol");
|
|
6
|
-
|
|
7
|
-
require("core-js/modules/es.symbol.description");
|
|
8
|
-
|
|
9
|
-
require("core-js/modules/es.array.concat");
|
|
10
|
-
|
|
11
|
-
require("core-js/modules/es.array.filter");
|
|
12
|
-
|
|
13
|
-
require("core-js/modules/es.array.iterator");
|
|
14
|
-
|
|
15
|
-
require("core-js/modules/es.array.map");
|
|
16
|
-
|
|
17
|
-
require("core-js/modules/es.array.slice");
|
|
18
|
-
|
|
19
|
-
require("core-js/modules/es.object.to-string");
|
|
20
|
-
|
|
21
|
-
require("core-js/modules/es.promise");
|
|
22
|
-
|
|
23
|
-
require("core-js/modules/es.string.starts-with");
|
|
24
|
-
|
|
25
|
-
require("core-js/modules/web.dom-collections.iterator");
|
|
26
|
-
|
|
27
9
|
Object.defineProperty(exports, "__esModule", {
|
|
28
10
|
value: true
|
|
29
11
|
});
|
|
30
|
-
exports.
|
|
31
|
-
|
|
12
|
+
exports.getLinkedTableId = exports.default = void 0;
|
|
32
13
|
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
33
|
-
|
|
34
|
-
require("
|
|
35
|
-
|
|
14
|
+
require("core-js/modules/es.array.concat.js");
|
|
15
|
+
require("core-js/modules/es.array.filter.js");
|
|
16
|
+
require("core-js/modules/es.array.iterator.js");
|
|
17
|
+
require("core-js/modules/es.array.map.js");
|
|
18
|
+
require("core-js/modules/es.array.slice.js");
|
|
19
|
+
require("core-js/modules/es.object.to-string.js");
|
|
20
|
+
require("core-js/modules/es.promise.js");
|
|
21
|
+
require("core-js/modules/es.string.starts-with.js");
|
|
22
|
+
require("core-js/modules/web.dom-collections.iterator.js");
|
|
23
|
+
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
36
24
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
37
|
-
|
|
38
25
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
39
|
-
|
|
40
26
|
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
41
|
-
|
|
42
|
-
var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
|
|
43
|
-
|
|
44
|
-
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
45
|
-
|
|
46
27
|
var _get2 = _interopRequireDefault(require("@babel/runtime/helpers/get"));
|
|
47
|
-
|
|
28
|
+
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
48
29
|
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
49
|
-
|
|
50
30
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
51
|
-
|
|
52
31
|
var _field = require("../types/field");
|
|
53
|
-
|
|
54
32
|
var _error_utils = require("../error_utils");
|
|
55
|
-
|
|
56
33
|
var _record_query_result = _interopRequireDefault(require("./record_query_result"));
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
34
|
+
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; } } }; }
|
|
35
|
+
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; } }
|
|
36
|
+
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; }
|
|
37
|
+
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)); }
|
|
38
|
+
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 */ /** */
|
|
61
39
|
var getLinkedTableId = field => {
|
|
62
40
|
var options = field.options;
|
|
63
41
|
var linkedTableId = options && options.linkedTableId;
|
|
64
42
|
(0, _error_utils.invariant)(typeof linkedTableId === 'string', 'linkedTableId must exist');
|
|
65
43
|
return linkedTableId;
|
|
66
44
|
};
|
|
67
|
-
/** internal */
|
|
68
|
-
|
|
69
45
|
|
|
46
|
+
/** internal */
|
|
70
47
|
exports.getLinkedTableId = getLinkedTableId;
|
|
71
|
-
|
|
72
48
|
/**
|
|
73
49
|
* Represents a set of records from a LinkedRecord cell value. See {@link RecordQueryResult} for main
|
|
74
50
|
* documentation.
|
|
@@ -78,75 +54,60 @@ exports.getLinkedTableId = getLinkedTableId;
|
|
|
78
54
|
*
|
|
79
55
|
* @docsPath models/query results/LinkedRecordsQueryResult
|
|
80
56
|
*/
|
|
81
|
-
var LinkedRecordsQueryResult =
|
|
82
|
-
/*#__PURE__*/
|
|
83
|
-
function (_RecordQueryResult) {
|
|
84
|
-
(0, _inherits2.default)(LinkedRecordsQueryResult, _RecordQueryResult);
|
|
85
|
-
|
|
86
|
-
/** @internal */
|
|
87
|
-
// the record containing the linked-record cell this is a query of.
|
|
88
|
-
|
|
89
|
-
/** @internal */
|
|
90
|
-
// the cell's field in the record
|
|
91
|
-
|
|
92
|
-
/** @internal */
|
|
93
|
-
// the table we're linking to
|
|
94
|
-
|
|
95
|
-
/** @internal */
|
|
96
|
-
// the records store for the origin table
|
|
97
|
-
|
|
98
|
-
/** @internal */
|
|
99
|
-
// the records store for the linked table
|
|
100
|
-
|
|
101
|
-
/** @internal */
|
|
102
|
-
// a RecordQueryResult containing all the rows in the linked table
|
|
103
|
-
|
|
104
|
-
/** @internal */
|
|
105
|
-
// is the query result currently valid. if the field config changes to link
|
|
106
|
-
// to another table or not be a linked record field at all, isValid will
|
|
107
|
-
// become false. once a LinkedRecordsQueryResult has become invalid, it will
|
|
108
|
-
// not become valid again.
|
|
109
|
-
|
|
110
|
-
/** @internal */
|
|
111
|
-
// a lazily-generated set of the record ids in the result set.
|
|
112
|
-
|
|
113
|
-
/** @internal */
|
|
114
|
-
// a lazily-generated array of the record ids in the query result.
|
|
115
|
-
|
|
116
|
-
/** @internal */
|
|
117
|
-
// how many times has each 'cellValuesInField:$FieldId' been watched?
|
|
118
|
-
|
|
119
|
-
/** @internal */
|
|
120
|
-
|
|
57
|
+
var LinkedRecordsQueryResult = /*#__PURE__*/function (_RecordQueryResult) {
|
|
121
58
|
/** @internal */
|
|
122
59
|
function LinkedRecordsQueryResult(record, field, normalizedOpts, sdk) {
|
|
123
60
|
var _this;
|
|
124
|
-
|
|
125
61
|
(0, _classCallCheck2.default)(this, LinkedRecordsQueryResult);
|
|
126
|
-
_this = (
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
(0, _defineProperty2.default)(
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
(0, _defineProperty2.default)(
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
(0, _defineProperty2.default)(
|
|
136
|
-
|
|
62
|
+
_this = _callSuper(this, LinkedRecordsQueryResult, [sdk, normalizedOpts]);
|
|
63
|
+
// the record containing the linked-record cell this is a query of.
|
|
64
|
+
/** @internal */
|
|
65
|
+
(0, _defineProperty2.default)(_this, "_record", void 0);
|
|
66
|
+
// the cell's field in the record
|
|
67
|
+
/** @internal */
|
|
68
|
+
(0, _defineProperty2.default)(_this, "_field", void 0);
|
|
69
|
+
// the table we're linking to
|
|
70
|
+
/** @internal */
|
|
71
|
+
(0, _defineProperty2.default)(_this, "_linkedTable", void 0);
|
|
72
|
+
// the records store for the origin table
|
|
73
|
+
/** @internal */
|
|
74
|
+
(0, _defineProperty2.default)(_this, "_originRecordStore", void 0);
|
|
75
|
+
// the records store for the linked table
|
|
76
|
+
/** @internal */
|
|
77
|
+
(0, _defineProperty2.default)(_this, "_linkedRecordStore", void 0);
|
|
78
|
+
// a RecordQueryResult containing all the rows in the linked table
|
|
79
|
+
/** @internal */
|
|
80
|
+
(0, _defineProperty2.default)(_this, "_linkedQueryResult", void 0);
|
|
81
|
+
// is the query result currently valid. if the field config changes to link
|
|
82
|
+
// to another table or not be a linked record field at all, isValid will
|
|
83
|
+
// become false. once a LinkedRecordsQueryResult has become invalid, it will
|
|
84
|
+
// not become valid again.
|
|
85
|
+
/** @internal */
|
|
86
|
+
(0, _defineProperty2.default)(_this, "_isValid", true);
|
|
87
|
+
// a lazily-generated set of the record ids in the result set.
|
|
88
|
+
/** @internal */
|
|
89
|
+
(0, _defineProperty2.default)(_this, "_computedRecordIdsSet", null);
|
|
90
|
+
// a lazily-generated array of the record ids in the query result.
|
|
91
|
+
/** @internal */
|
|
92
|
+
(0, _defineProperty2.default)(_this, "_computedFilteredSortedRecordIds", null);
|
|
93
|
+
// how many times has each 'cellValuesInField:$FieldId' been watched?
|
|
94
|
+
/** @internal */
|
|
95
|
+
(0, _defineProperty2.default)(_this, "_cellValueChangeHandlerByFieldId", {});
|
|
137
96
|
(0, _error_utils.invariant)(record.parentTable === field.parentTable, 'record and field must belong to the same table');
|
|
138
97
|
_this._record = record;
|
|
139
98
|
_this._field = field;
|
|
140
99
|
_this._linkedTable = normalizedOpts.table;
|
|
141
100
|
_this._originRecordStore = _this._sdk.base.__getRecordStore(_this._record.parentTable.id);
|
|
142
|
-
_this._linkedRecordStore = normalizedOpts.recordStore;
|
|
101
|
+
_this._linkedRecordStore = normalizedOpts.recordStore;
|
|
102
|
+
|
|
103
|
+
// we could rely on RecordQueryResult's reuse pool to make sure we get back
|
|
143
104
|
// the same RecordQueryResult every time, but that would make it much harder
|
|
144
105
|
// to make sure we unwatch everything from the old RecordQueryResult if e.g.
|
|
145
106
|
// the field config changes to point at a different table
|
|
146
|
-
|
|
147
107
|
_this._linkedQueryResult = _this._linkedTable.__tableOrViewQueryResultPool.getObjectForReuse(_this._sdk, _this._linkedTable, normalizedOpts);
|
|
148
108
|
return _this;
|
|
149
109
|
}
|
|
110
|
+
|
|
150
111
|
/**
|
|
151
112
|
* Is the query result currently valid? This value always starts as 'true',
|
|
152
113
|
* but can become false if the record from which this result was created is
|
|
@@ -156,213 +117,196 @@ function (_RecordQueryResult) {
|
|
|
156
117
|
* will never become true again. Many fields will throw on attempting to
|
|
157
118
|
* access them, and watches will no longer fire.
|
|
158
119
|
*/
|
|
120
|
+
(0, _inherits2.default)(LinkedRecordsQueryResult, _RecordQueryResult);
|
|
121
|
+
return (0, _createClass2.default)(LinkedRecordsQueryResult, [{
|
|
122
|
+
key: "isValid",
|
|
123
|
+
get: function get() {
|
|
124
|
+
return this._isValid;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* The table that records in this RecordQueryResult are part of
|
|
129
|
+
*
|
|
130
|
+
* @internal (since we may not be able to return parent model instances in the immutable models world)
|
|
131
|
+
*/
|
|
132
|
+
}, {
|
|
133
|
+
key: "parentTable",
|
|
134
|
+
get: function get() {
|
|
135
|
+
(0, _error_utils.invariant)(this.isValid, 'LinkedRecordsQueryResult is no longer valid');
|
|
136
|
+
return this._linkedTable;
|
|
137
|
+
}
|
|
159
138
|
|
|
139
|
+
/**
|
|
140
|
+
* Ordered array of all the linked record ids. Watchable.
|
|
141
|
+
*/
|
|
142
|
+
}, {
|
|
143
|
+
key: "recordIds",
|
|
144
|
+
get: function get() {
|
|
145
|
+
(0, _error_utils.invariant)(this.isValid, 'LinkedRecordsQueryResult is no longer valid');
|
|
146
|
+
(0, _error_utils.invariant)(this.isDataLoaded, 'LinkedRecordsQueryResult data is not loaded');
|
|
160
147
|
|
|
161
|
-
|
|
162
|
-
|
|
148
|
+
// record ids are lazily generated
|
|
149
|
+
this._generateComputedDataIfNeeded();
|
|
150
|
+
(0, _error_utils.invariant)(this._computedFilteredSortedRecordIds, 'no recordIds');
|
|
151
|
+
return this._computedFilteredSortedRecordIds;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
/**
|
|
155
|
+
* Ordered array of all the linked records. Watchable.
|
|
156
|
+
*/
|
|
157
|
+
}, {
|
|
158
|
+
key: "records",
|
|
159
|
+
get: function get() {
|
|
160
|
+
(0, _error_utils.invariant)(this.isValid, 'LinkedRecordsQueryResult is no longer valid');
|
|
161
|
+
return this.recordIds.map(recordId => {
|
|
162
|
+
var record = this._linkedRecordStore.getRecordByIdIfExists(recordId);
|
|
163
|
+
(0, _error_utils.invariant)(record, 'No record for id: %s', recordId);
|
|
164
|
+
return record;
|
|
165
|
+
});
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
/**
|
|
169
|
+
* The fields that were used to create this LinkedRecordsQueryResult.
|
|
170
|
+
*/
|
|
171
|
+
}, {
|
|
172
|
+
key: "fields",
|
|
173
|
+
get: function get() {
|
|
174
|
+
(0, _error_utils.invariant)(this.isValid, 'LinkedRecordsQueryResult is no longer valid');
|
|
175
|
+
return this._linkedQueryResult.fields;
|
|
176
|
+
}
|
|
163
177
|
|
|
164
178
|
/** @inheritdoc */
|
|
179
|
+
}, {
|
|
180
|
+
key: "watch",
|
|
165
181
|
value: function watch(keys, callback, context) {
|
|
166
182
|
(0, _error_utils.invariant)(this.isValid, 'cannot watch an invalid LinkedRecordsQueryResult');
|
|
167
183
|
var validKeys = (0, _get2.default)((0, _getPrototypeOf2.default)(LinkedRecordsQueryResult.prototype), "watch", this).call(this, keys, callback, context);
|
|
168
|
-
var
|
|
169
|
-
|
|
170
|
-
var _iteratorError = undefined;
|
|
171
|
-
|
|
184
|
+
var _iterator = _createForOfIteratorHelper(validKeys),
|
|
185
|
+
_step;
|
|
172
186
|
try {
|
|
173
|
-
for (
|
|
174
|
-
var
|
|
175
|
-
|
|
176
|
-
if (_key === _record_query_result.default.WatchableKeys.cellValues) {
|
|
187
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
188
|
+
var key = _step.value;
|
|
189
|
+
if (key === _record_query_result.default.WatchableKeys.cellValues) {
|
|
177
190
|
this._watchLinkedQueryCellValuesIfNeededAfterWatch();
|
|
178
191
|
}
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
var fieldId = _key.substring(_record_query_result.default.WatchableCellValuesInFieldKeyPrefix.length);
|
|
182
|
-
|
|
192
|
+
if (key.startsWith(_record_query_result.default.WatchableCellValuesInFieldKeyPrefix)) {
|
|
193
|
+
var fieldId = key.substring(_record_query_result.default.WatchableCellValuesInFieldKeyPrefix.length);
|
|
183
194
|
this._watchLinkedQueryCellValuesInFieldIfNeededAfterWatch(fieldId);
|
|
184
195
|
}
|
|
185
196
|
}
|
|
186
197
|
} catch (err) {
|
|
187
|
-
|
|
188
|
-
_iteratorError = err;
|
|
198
|
+
_iterator.e(err);
|
|
189
199
|
} finally {
|
|
190
|
-
|
|
191
|
-
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
192
|
-
_iterator.return();
|
|
193
|
-
}
|
|
194
|
-
} finally {
|
|
195
|
-
if (_didIteratorError) {
|
|
196
|
-
throw _iteratorError;
|
|
197
|
-
}
|
|
198
|
-
}
|
|
200
|
+
_iterator.f();
|
|
199
201
|
}
|
|
200
|
-
|
|
201
202
|
return validKeys;
|
|
202
203
|
}
|
|
203
|
-
/** @inheritdoc */
|
|
204
204
|
|
|
205
|
+
/** @inheritdoc */
|
|
205
206
|
}, {
|
|
206
207
|
key: "unwatch",
|
|
207
208
|
value: function unwatch(keys, callback, context) {
|
|
208
209
|
var arrayKeys = Array.isArray(keys) ? keys : [keys];
|
|
209
|
-
var
|
|
210
|
-
|
|
211
|
-
var _iteratorError2 = undefined;
|
|
212
|
-
|
|
210
|
+
var _iterator2 = _createForOfIteratorHelper(arrayKeys),
|
|
211
|
+
_step2;
|
|
213
212
|
try {
|
|
214
|
-
for (
|
|
215
|
-
var
|
|
216
|
-
|
|
217
|
-
if (_key2 === _record_query_result.default.WatchableKeys.cellValues) {
|
|
213
|
+
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
214
|
+
var key = _step2.value;
|
|
215
|
+
if (key === _record_query_result.default.WatchableKeys.cellValues) {
|
|
218
216
|
this._unwatchLinkedQueryCellValuesIfPossibleBeforeUnwatch();
|
|
219
217
|
}
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
var fieldId = _key2.substring(_record_query_result.default.WatchableCellValuesInFieldKeyPrefix.length);
|
|
223
|
-
|
|
218
|
+
if (key.startsWith(_record_query_result.default.WatchableCellValuesInFieldKeyPrefix)) {
|
|
219
|
+
var fieldId = key.substring(_record_query_result.default.WatchableCellValuesInFieldKeyPrefix.length);
|
|
224
220
|
this._unwatchLinkedQueryCellValuesInFieldIfPossibleBeforeUnwatch(fieldId);
|
|
225
221
|
}
|
|
226
222
|
}
|
|
227
223
|
} catch (err) {
|
|
228
|
-
|
|
229
|
-
_iteratorError2 = err;
|
|
224
|
+
_iterator2.e(err);
|
|
230
225
|
} finally {
|
|
231
|
-
|
|
232
|
-
if (!_iteratorNormalCompletion2 && _iterator2.return != null) {
|
|
233
|
-
_iterator2.return();
|
|
234
|
-
}
|
|
235
|
-
} finally {
|
|
236
|
-
if (_didIteratorError2) {
|
|
237
|
-
throw _iteratorError2;
|
|
238
|
-
}
|
|
239
|
-
}
|
|
226
|
+
_iterator2.f();
|
|
240
227
|
}
|
|
241
|
-
|
|
242
228
|
return (0, _get2.default)((0, _getPrototypeOf2.default)(LinkedRecordsQueryResult.prototype), "unwatch", this).call(this, arrayKeys, callback, context);
|
|
243
229
|
}
|
|
244
|
-
/** @inheritdoc */
|
|
245
230
|
|
|
231
|
+
/** @inheritdoc */
|
|
246
232
|
}, {
|
|
247
233
|
key: "loadDataAsync",
|
|
248
|
-
value: function
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
switch (_context.prev = _context.next) {
|
|
234
|
+
value: (function () {
|
|
235
|
+
var _loadDataAsync2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
|
|
236
|
+
return _regenerator.default.wrap(function _callee$(_context) {
|
|
237
|
+
while (1) switch (_context.prev = _context.next) {
|
|
252
238
|
case 0:
|
|
253
239
|
_context.next = 2;
|
|
254
|
-
return
|
|
255
|
-
|
|
240
|
+
return (0, _get2.default)((0, _getPrototypeOf2.default)(LinkedRecordsQueryResult.prototype), "loadDataAsync", this).call(this);
|
|
256
241
|
case 2:
|
|
257
242
|
if (this.isDataLoaded) {
|
|
258
243
|
_context.next = 6;
|
|
259
244
|
break;
|
|
260
245
|
}
|
|
261
|
-
|
|
262
246
|
_context.next = 5;
|
|
263
|
-
return
|
|
264
|
-
|
|
247
|
+
return this.loadDataAsync();
|
|
265
248
|
case 5:
|
|
266
249
|
// there has to be an unloadData call for every loadDataAsync call.
|
|
267
250
|
// call it here to offset calling loadDataAsync a second time
|
|
268
251
|
this.unloadData();
|
|
269
|
-
|
|
270
252
|
case 6:
|
|
271
253
|
case "end":
|
|
272
254
|
return _context.stop();
|
|
273
255
|
}
|
|
274
|
-
}
|
|
275
|
-
}
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
256
|
+
}, _callee, this);
|
|
257
|
+
}));
|
|
258
|
+
function loadDataAsync() {
|
|
259
|
+
return _loadDataAsync2.apply(this, arguments);
|
|
260
|
+
}
|
|
261
|
+
return loadDataAsync;
|
|
262
|
+
}() /** @internal */)
|
|
279
263
|
}, {
|
|
280
264
|
key: "_loadDataAsync",
|
|
281
|
-
value: function
|
|
282
|
-
var
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
switch (_context2.prev = _context2.next) {
|
|
265
|
+
value: (function () {
|
|
266
|
+
var _loadDataAsync3 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2() {
|
|
267
|
+
var initiallyLoaded, changedKeys, fieldIds, _iterator3, _step3, fieldId;
|
|
268
|
+
return _regenerator.default.wrap(function _callee2$(_context2) {
|
|
269
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
287
270
|
case 0:
|
|
288
271
|
this._record.__linkedRecordsQueryResultPool.registerObjectForReuseStrong(this);
|
|
289
|
-
|
|
290
272
|
this._watchOrigin();
|
|
291
|
-
|
|
292
273
|
this._watchLinkedQueryResult();
|
|
293
|
-
|
|
294
274
|
initiallyLoaded = this._linkedQueryResult.isDataLoaded;
|
|
295
275
|
_context2.next = 6;
|
|
296
|
-
return
|
|
297
|
-
|
|
276
|
+
return Promise.all([this._sdk.base.__getRecordStore(this._record.parentTable.id).loadCellValuesInFieldIdsAsync([this._field.id]), this._linkedQueryResult.loadDataAsync(), this._loadRecordColorsAsync()]);
|
|
298
277
|
case 6:
|
|
299
278
|
this._invalidateComputedData();
|
|
300
|
-
|
|
301
279
|
changedKeys = ['records', 'recordIds', 'recordColors']; // If the linked query result was not initially loaded, then the
|
|
302
280
|
// `cellValues` event will be emitted via `_onLinkedCellValuesChange`.
|
|
303
281
|
// Otherwise, it must be explicitly included here in order to promote
|
|
304
282
|
// consistency.
|
|
305
|
-
|
|
306
283
|
if (initiallyLoaded) {
|
|
307
284
|
changedKeys.push('cellValues');
|
|
308
285
|
}
|
|
309
|
-
|
|
310
286
|
fieldIds = this._normalizedOpts.fieldIdsOrNullIfAllFields || this.parentTable.fields.map(field => field.id);
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
}
|
|
320
|
-
|
|
321
|
-
_context2.next = 21;
|
|
322
|
-
break;
|
|
323
|
-
|
|
324
|
-
case 17:
|
|
325
|
-
_context2.prev = 17;
|
|
326
|
-
_context2.t0 = _context2["catch"](13);
|
|
327
|
-
_didIteratorError3 = true;
|
|
328
|
-
_iteratorError3 = _context2.t0;
|
|
329
|
-
|
|
330
|
-
case 21:
|
|
331
|
-
_context2.prev = 21;
|
|
332
|
-
_context2.prev = 22;
|
|
333
|
-
|
|
334
|
-
if (!_iteratorNormalCompletion3 && _iterator3.return != null) {
|
|
335
|
-
_iterator3.return();
|
|
336
|
-
}
|
|
337
|
-
|
|
338
|
-
case 24:
|
|
339
|
-
_context2.prev = 24;
|
|
340
|
-
|
|
341
|
-
if (!_didIteratorError3) {
|
|
342
|
-
_context2.next = 27;
|
|
343
|
-
break;
|
|
287
|
+
_iterator3 = _createForOfIteratorHelper(fieldIds);
|
|
288
|
+
try {
|
|
289
|
+
for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
|
|
290
|
+
fieldId = _step3.value;
|
|
291
|
+
changedKeys.push(_record_query_result.default.WatchableCellValuesInFieldKeyPrefix + fieldId);
|
|
292
|
+
}
|
|
293
|
+
} catch (err) {
|
|
294
|
+
_iterator3.e(err);
|
|
295
|
+
} finally {
|
|
296
|
+
_iterator3.f();
|
|
344
297
|
}
|
|
345
|
-
|
|
346
|
-
throw _iteratorError3;
|
|
347
|
-
|
|
348
|
-
case 27:
|
|
349
|
-
return _context2.finish(24);
|
|
350
|
-
|
|
351
|
-
case 28:
|
|
352
|
-
return _context2.finish(21);
|
|
353
|
-
|
|
354
|
-
case 29:
|
|
355
298
|
return _context2.abrupt("return", changedKeys);
|
|
356
|
-
|
|
357
|
-
case 30:
|
|
299
|
+
case 13:
|
|
358
300
|
case "end":
|
|
359
301
|
return _context2.stop();
|
|
360
302
|
}
|
|
361
|
-
}
|
|
362
|
-
}
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
303
|
+
}, _callee2, this);
|
|
304
|
+
}));
|
|
305
|
+
function _loadDataAsync() {
|
|
306
|
+
return _loadDataAsync3.apply(this, arguments);
|
|
307
|
+
}
|
|
308
|
+
return _loadDataAsync;
|
|
309
|
+
}() /** @internal */)
|
|
366
310
|
}, {
|
|
367
311
|
key: "_unloadData",
|
|
368
312
|
value: function _unloadData() {
|
|
@@ -371,37 +315,43 @@ function (_RecordQueryResult) {
|
|
|
371
315
|
// istanbul ignore else
|
|
372
316
|
if (this.isValid) {
|
|
373
317
|
this._record.__linkedRecordsQueryResultPool.unregisterObjectForReuseStrong(this);
|
|
374
|
-
|
|
375
318
|
this._unwatchOrigin();
|
|
376
|
-
|
|
377
319
|
this._unwatchLinkedQueryResult();
|
|
378
|
-
|
|
379
320
|
this._originRecordStore.unloadCellValuesInFieldIds([this._field.id]);
|
|
380
|
-
|
|
381
321
|
this._linkedQueryResult.unloadData();
|
|
382
|
-
|
|
383
322
|
this._unloadRecordColors();
|
|
384
|
-
|
|
385
323
|
this._invalidateComputedData();
|
|
386
324
|
}
|
|
387
325
|
}
|
|
326
|
+
|
|
388
327
|
/**
|
|
389
328
|
* the key used to identify this query result in ObjectPool
|
|
390
329
|
*
|
|
391
330
|
* @hidden
|
|
392
331
|
*/
|
|
332
|
+
}, {
|
|
333
|
+
key: "__poolKey",
|
|
334
|
+
get: function get() {
|
|
335
|
+
return "".concat(this._serializedOpts, "::").concat(this._field.id, "::").concat(this._linkedTable.id, "::").concat(this.isValid);
|
|
336
|
+
}
|
|
393
337
|
|
|
338
|
+
/** @internal */
|
|
394
339
|
}, {
|
|
395
|
-
key: "
|
|
340
|
+
key: "_cellValuesWatchCount",
|
|
341
|
+
get: function get() {
|
|
342
|
+
return (this._changeWatchersByKey[_record_query_result.default.WatchableKeys.cellValues] || []).length;
|
|
343
|
+
}
|
|
396
344
|
|
|
397
345
|
/** @internal */
|
|
346
|
+
}, {
|
|
347
|
+
key: "_watchLinkedQueryCellValuesIfNeededAfterWatch",
|
|
398
348
|
value: function _watchLinkedQueryCellValuesIfNeededAfterWatch() {
|
|
399
349
|
if (this._cellValuesWatchCount === 1) {
|
|
400
350
|
this._watchLinkedQueryCellValues();
|
|
401
351
|
}
|
|
402
352
|
}
|
|
403
|
-
/** @internal */
|
|
404
353
|
|
|
354
|
+
/** @internal */
|
|
405
355
|
}, {
|
|
406
356
|
key: "_unwatchLinkedQueryCellValuesIfPossibleBeforeUnwatch",
|
|
407
357
|
value: function _unwatchLinkedQueryCellValuesIfPossibleBeforeUnwatch() {
|
|
@@ -409,68 +359,81 @@ function (_RecordQueryResult) {
|
|
|
409
359
|
this._unwatchLinkedQueryCellValues();
|
|
410
360
|
}
|
|
411
361
|
}
|
|
412
|
-
/** @internal */
|
|
413
362
|
|
|
363
|
+
/** @internal */
|
|
414
364
|
}, {
|
|
415
|
-
key: "
|
|
365
|
+
key: "_cellValueWatchCountByFieldId",
|
|
366
|
+
get: function get() {
|
|
367
|
+
var countByFieldId = {};
|
|
368
|
+
var watchKeys = Object.keys(this._changeWatchersByKey).filter(key => {
|
|
369
|
+
return key.startsWith(_record_query_result.default.WatchableCellValuesInFieldKeyPrefix);
|
|
370
|
+
});
|
|
371
|
+
var _iterator4 = _createForOfIteratorHelper(watchKeys),
|
|
372
|
+
_step4;
|
|
373
|
+
try {
|
|
374
|
+
for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
|
|
375
|
+
var watchKey = _step4.value;
|
|
376
|
+
var fieldId = watchKey.slice(_record_query_result.default.WatchableCellValuesInFieldKeyPrefix.length);
|
|
377
|
+
countByFieldId[fieldId] = this._changeWatchersByKey[watchKey].length;
|
|
378
|
+
}
|
|
379
|
+
} catch (err) {
|
|
380
|
+
_iterator4.e(err);
|
|
381
|
+
} finally {
|
|
382
|
+
_iterator4.f();
|
|
383
|
+
}
|
|
384
|
+
return countByFieldId;
|
|
385
|
+
}
|
|
416
386
|
|
|
417
387
|
/** @internal */
|
|
388
|
+
}, {
|
|
389
|
+
key: "_watchLinkedQueryCellValuesInFieldIfNeededAfterWatch",
|
|
418
390
|
value: function _watchLinkedQueryCellValuesInFieldIfNeededAfterWatch(fieldId) {
|
|
419
391
|
if (this._cellValueWatchCountByFieldId[fieldId] === 1 && this.isValid) {
|
|
420
392
|
this._watchLinkedQueryCellValuesInField(fieldId);
|
|
421
393
|
}
|
|
422
394
|
}
|
|
423
|
-
/** @internal */
|
|
424
395
|
|
|
396
|
+
/** @internal */
|
|
425
397
|
}, {
|
|
426
398
|
key: "_unwatchLinkedQueryCellValuesInFieldIfPossibleBeforeUnwatch",
|
|
427
399
|
value: function _unwatchLinkedQueryCellValuesInFieldIfPossibleBeforeUnwatch(fieldId) {
|
|
428
400
|
(0, _error_utils.invariant)(this._cellValueWatchCountByFieldId[fieldId], "cellValuesInField:%s over-free'd", fieldId);
|
|
429
|
-
|
|
430
401
|
if (this._cellValueWatchCountByFieldId[fieldId] === 1 && this.isValid) {
|
|
431
402
|
this._unwatchLinkedQueryCellValuesInField(fieldId);
|
|
432
403
|
}
|
|
433
404
|
}
|
|
434
|
-
/** @internal */
|
|
435
405
|
|
|
406
|
+
/** @internal */
|
|
436
407
|
}, {
|
|
437
408
|
key: "_watchOrigin",
|
|
438
409
|
value: function _watchOrigin() {
|
|
439
410
|
// if the cell values in the record change, we need to invalidate our
|
|
440
411
|
// cached data and notify watchers
|
|
441
|
-
this._record.watch("cellValueInField:".concat(this._field.id), this._onOriginCellValueChange, this);
|
|
412
|
+
this._record.watch("cellValueInField:".concat(this._field.id), this._onOriginCellValueChange, this);
|
|
413
|
+
// if the field config changes, we need to invalidate cached data,
|
|
442
414
|
// and potentially start watching a different table
|
|
443
|
-
|
|
444
|
-
|
|
445
415
|
this._field.watch('type', this._onOriginFieldConfigChange, this);
|
|
446
|
-
|
|
447
|
-
|
|
416
|
+
this._field.watch('options', this._onOriginFieldConfigChange, this);
|
|
417
|
+
// if the underlying record is deleted, we need to invalidate this
|
|
448
418
|
// result
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
this._originRecordStore.watch('recordIds', this._onOriginRecordsChange, this); // if the linked field in the origin table is deleted, we need to
|
|
419
|
+
this._originRecordStore.watch('recordIds', this._onOriginRecordsChange, this);
|
|
420
|
+
// if the linked field in the origin table is deleted, we need to
|
|
452
421
|
// invalidate this result
|
|
453
|
-
|
|
454
|
-
|
|
455
422
|
this._record.parentTable.watch('fields', this._onOriginFieldsChange, this);
|
|
456
423
|
}
|
|
457
|
-
/** @internal */
|
|
458
424
|
|
|
425
|
+
/** @internal */
|
|
459
426
|
}, {
|
|
460
427
|
key: "_unwatchOrigin",
|
|
461
428
|
value: function _unwatchOrigin() {
|
|
462
429
|
this._record.unwatch("cellValueInField:".concat(this._field.id), this._onOriginCellValueChange, this);
|
|
463
|
-
|
|
464
430
|
this._field.unwatch('type', this._onOriginFieldConfigChange, this);
|
|
465
|
-
|
|
466
431
|
this._field.unwatch('options', this._onOriginFieldConfigChange, this);
|
|
467
|
-
|
|
468
432
|
this._originRecordStore.unwatch('recordIds', this._onOriginRecordsChange, this);
|
|
469
|
-
|
|
470
433
|
this._record.parentTable.unwatch('fields', this._onOriginFieldsChange, this);
|
|
471
434
|
}
|
|
472
|
-
/** @internal */
|
|
473
435
|
|
|
436
|
+
/** @internal */
|
|
474
437
|
}, {
|
|
475
438
|
key: "_watchLinkedQueryResult",
|
|
476
439
|
value: function _watchLinkedQueryResult() {
|
|
@@ -480,43 +443,43 @@ function (_RecordQueryResult) {
|
|
|
480
443
|
// watching the origin record
|
|
481
444
|
this._linkedQueryResult.watch('recordIds', this._onLinkedRecordIdsChange, this);
|
|
482
445
|
}
|
|
483
|
-
/** @internal */
|
|
484
446
|
|
|
447
|
+
/** @internal */
|
|
485
448
|
}, {
|
|
486
449
|
key: "_unwatchLinkedQueryResult",
|
|
487
450
|
value: function _unwatchLinkedQueryResult() {
|
|
488
451
|
this._linkedQueryResult.unwatch('recordIds', this._onLinkedRecordIdsChange, this);
|
|
489
452
|
}
|
|
490
|
-
/** @internal */
|
|
491
453
|
|
|
454
|
+
/** @internal */
|
|
492
455
|
}, {
|
|
493
456
|
key: "_watchLinkedQueryCellValues",
|
|
494
457
|
value: function _watchLinkedQueryCellValues() {
|
|
495
458
|
this._linkedQueryResult.watch('cellValues', this._onLinkedCellValuesChange, this);
|
|
496
459
|
}
|
|
497
|
-
/** @internal */
|
|
498
460
|
|
|
461
|
+
/** @internal */
|
|
499
462
|
}, {
|
|
500
463
|
key: "_unwatchLinkedQueryCellValues",
|
|
501
464
|
value: function _unwatchLinkedQueryCellValues() {
|
|
502
465
|
this._linkedQueryResult.unwatch('cellValues', this._onLinkedCellValuesChange, this);
|
|
503
466
|
}
|
|
504
|
-
/** @internal */
|
|
505
467
|
|
|
468
|
+
/** @internal */
|
|
506
469
|
}, {
|
|
507
470
|
key: "_watchLinkedQueryCellValuesInField",
|
|
508
471
|
value: function _watchLinkedQueryCellValuesInField(fieldId) {
|
|
509
472
|
this._linkedQueryResult.watch(_record_query_result.default.WatchableCellValuesInFieldKeyPrefix + fieldId, this._getOnLinkedCellValuesInFieldChange(fieldId), this);
|
|
510
473
|
}
|
|
511
|
-
/** @internal */
|
|
512
474
|
|
|
475
|
+
/** @internal */
|
|
513
476
|
}, {
|
|
514
477
|
key: "_unwatchLinkedQueryCellValuesInField",
|
|
515
478
|
value: function _unwatchLinkedQueryCellValuesInField(fieldId) {
|
|
516
479
|
this._linkedQueryResult.unwatch(_record_query_result.default.WatchableCellValuesInFieldKeyPrefix + fieldId, this._getOnLinkedCellValuesInFieldChange(fieldId), this);
|
|
517
480
|
}
|
|
518
|
-
/** @internal */
|
|
519
481
|
|
|
482
|
+
/** @internal */
|
|
520
483
|
}, {
|
|
521
484
|
key: "_onLinkedRecordIdsChange",
|
|
522
485
|
value: function _onLinkedRecordIdsChange() {
|
|
@@ -528,17 +491,15 @@ function (_RecordQueryResult) {
|
|
|
528
491
|
// records while keeping the behavior of isValid consistent
|
|
529
492
|
return;
|
|
530
493
|
}
|
|
531
|
-
|
|
532
494
|
(0, _error_utils.invariant)(this.isValid, 'watch key change event whilst invalid');
|
|
495
|
+
this._invalidateComputedData();
|
|
533
496
|
|
|
534
|
-
|
|
497
|
+
// we don't actually know at this stage whether anything changed or
|
|
535
498
|
// not. it may have done though, so notify watchers
|
|
536
|
-
|
|
537
|
-
|
|
538
499
|
this._onChange('records');
|
|
539
|
-
|
|
540
500
|
this._onChange('recordIds');
|
|
541
501
|
}
|
|
502
|
+
|
|
542
503
|
/**
|
|
543
504
|
* This model doesn't use the `_data` computed property it inherits from
|
|
544
505
|
* AbstractModel. It implements the following method only so that internal
|
|
@@ -547,43 +508,50 @@ function (_RecordQueryResult) {
|
|
|
547
508
|
*
|
|
548
509
|
* @internal
|
|
549
510
|
*/
|
|
550
|
-
|
|
551
511
|
}, {
|
|
552
|
-
key: "
|
|
512
|
+
key: "_dataOrNullIfDeleted",
|
|
513
|
+
get: function get() {
|
|
514
|
+
if (this._record.isDeleted || this._linkedRecordStore.isDeleted) {
|
|
515
|
+
return null;
|
|
516
|
+
}
|
|
517
|
+
return {};
|
|
518
|
+
}
|
|
553
519
|
|
|
554
520
|
/** @internal */
|
|
521
|
+
}, {
|
|
522
|
+
key: "_onLinkedCellValuesChange",
|
|
555
523
|
value: function _onLinkedCellValuesChange(queryResult, key, changes) {
|
|
556
524
|
(0, _error_utils.invariant)(this.isValid, 'watch key change event whilst invalid');
|
|
557
|
-
|
|
558
525
|
if (changes && changes.fieldIds && changes.recordIds) {
|
|
559
526
|
var recordIdsSet = this._getOrGenerateRecordIdsSet();
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
if (_recordIds.length) {
|
|
527
|
+
var recordIds = changes.recordIds.filter(id => recordIdsSet[id] === true);
|
|
528
|
+
if (recordIds.length) {
|
|
564
529
|
this._onChange('cellValues', {
|
|
565
530
|
fieldIds: changes.fieldIds,
|
|
566
|
-
recordIds
|
|
531
|
+
recordIds
|
|
567
532
|
});
|
|
568
533
|
}
|
|
569
534
|
} else {
|
|
570
535
|
this._onChange('cellValues');
|
|
571
536
|
}
|
|
572
537
|
}
|
|
573
|
-
/** @internal */
|
|
574
538
|
|
|
539
|
+
/** @internal */
|
|
575
540
|
}, {
|
|
576
541
|
key: "_getOnLinkedCellValuesInFieldChange",
|
|
577
542
|
value: function _getOnLinkedCellValuesInFieldChange(fieldId) {
|
|
578
543
|
if (!this._cellValueChangeHandlerByFieldId[fieldId]) {
|
|
579
544
|
this._cellValueChangeHandlerByFieldId[fieldId] = (queryResult, key, recordIds) => {
|
|
580
|
-
(0, _error_utils.invariant)(this.isValid, 'watch key change event whilst invalid');
|
|
545
|
+
(0, _error_utils.invariant)(this.isValid, 'watch key change event whilst invalid');
|
|
546
|
+
|
|
547
|
+
// The linked record may finish loading before its parent. In
|
|
581
548
|
// that case, the appropriate events will be triggered by the
|
|
582
549
|
// `_loadDataAsync` method.
|
|
583
|
-
|
|
584
550
|
if (!this.isDataLoaded) {
|
|
585
551
|
return;
|
|
586
|
-
}
|
|
552
|
+
}
|
|
553
|
+
|
|
554
|
+
// The `else` branch will only be reached when the underlying
|
|
587
555
|
// `RecordOrViewQueryResult` is loaded, unloaded, and then
|
|
588
556
|
// loaded again. Because that query result is not directly
|
|
589
557
|
// exposed to consumers, the condition can only be met when the
|
|
@@ -592,13 +560,9 @@ function (_RecordQueryResult) {
|
|
|
592
560
|
// situation in a logical way, but it is not tested because it
|
|
593
561
|
// is fundamentally invalid.
|
|
594
562
|
// istanbul ignore else
|
|
595
|
-
|
|
596
|
-
|
|
597
563
|
if (Array.isArray(recordIds)) {
|
|
598
564
|
var recordIdsSet = this._getOrGenerateRecordIdsSet();
|
|
599
|
-
|
|
600
565
|
var filteredRecordIds = recordIds.filter(id => typeof id === 'string' && recordIdsSet[id] === true);
|
|
601
|
-
|
|
602
566
|
if (filteredRecordIds.length) {
|
|
603
567
|
this._onChange(_record_query_result.default.WatchableCellValuesInFieldKeyPrefix + fieldId, filteredRecordIds);
|
|
604
568
|
}
|
|
@@ -607,11 +571,10 @@ function (_RecordQueryResult) {
|
|
|
607
571
|
}
|
|
608
572
|
};
|
|
609
573
|
}
|
|
610
|
-
|
|
611
574
|
return this._cellValueChangeHandlerByFieldId[fieldId];
|
|
612
575
|
}
|
|
613
|
-
/** @internal */
|
|
614
576
|
|
|
577
|
+
/** @internal */
|
|
615
578
|
}, {
|
|
616
579
|
key: "_onOriginCellValueChange",
|
|
617
580
|
value: function _onOriginCellValueChange() {
|
|
@@ -623,20 +586,19 @@ function (_RecordQueryResult) {
|
|
|
623
586
|
// records while keeping the behavior of isValid consistent
|
|
624
587
|
return;
|
|
625
588
|
}
|
|
589
|
+
(0, _error_utils.invariant)(this.isValid, 'watch key change event whilst invalid');
|
|
626
590
|
|
|
627
|
-
|
|
591
|
+
// when the origin cell value (listing all the linked records) changes,
|
|
628
592
|
// invalidate all the data we have stored - we need to completely
|
|
629
593
|
// regenerate it
|
|
594
|
+
this._invalidateComputedData();
|
|
630
595
|
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
596
|
+
// notify watchers that our set of linked records has changed
|
|
634
597
|
this._onChange('records');
|
|
635
|
-
|
|
636
598
|
this._onChange('recordIds');
|
|
637
599
|
}
|
|
638
|
-
/** @internal */
|
|
639
600
|
|
|
601
|
+
/** @internal */
|
|
640
602
|
}, {
|
|
641
603
|
key: "_onOriginRecordsChange",
|
|
642
604
|
value: function _onOriginRecordsChange() {
|
|
@@ -644,8 +606,8 @@ function (_RecordQueryResult) {
|
|
|
644
606
|
this._isValid = false;
|
|
645
607
|
}
|
|
646
608
|
}
|
|
647
|
-
/** @internal */
|
|
648
609
|
|
|
610
|
+
/** @internal */
|
|
649
611
|
}, {
|
|
650
612
|
key: "_onOriginFieldsChange",
|
|
651
613
|
value: function _onOriginFieldsChange() {
|
|
@@ -653,63 +615,52 @@ function (_RecordQueryResult) {
|
|
|
653
615
|
this._isValid = false;
|
|
654
616
|
}
|
|
655
617
|
}
|
|
656
|
-
/** @internal */
|
|
657
618
|
|
|
619
|
+
/** @internal */
|
|
658
620
|
}, {
|
|
659
621
|
key: "_onOriginFieldConfigChange",
|
|
660
622
|
value: function _onOriginFieldConfigChange() {
|
|
661
623
|
(0, _error_utils.invariant)(this.isValid, 'watch key change event whilst invalid');
|
|
662
624
|
var type = this._field.type;
|
|
663
|
-
|
|
664
625
|
if (type !== _field.FieldType.MULTIPLE_RECORD_LINKS) {
|
|
665
626
|
this._invalidateQueryResult();
|
|
666
|
-
|
|
667
627
|
return;
|
|
668
628
|
}
|
|
669
|
-
|
|
670
629
|
var linkedTableId = getLinkedTableId(this._field);
|
|
671
|
-
|
|
672
630
|
if (linkedTableId !== this._linkedTable.id) {
|
|
673
631
|
this._invalidateQueryResult();
|
|
674
|
-
|
|
675
632
|
return;
|
|
676
633
|
}
|
|
677
634
|
}
|
|
678
|
-
/** @internal */
|
|
679
635
|
|
|
636
|
+
/** @internal */
|
|
680
637
|
}, {
|
|
681
638
|
key: "_invalidateQueryResult",
|
|
682
639
|
value: function _invalidateQueryResult() {
|
|
683
640
|
if (this.isDataLoaded) {
|
|
684
641
|
this._unloadData();
|
|
685
642
|
}
|
|
686
|
-
|
|
687
643
|
if (this._cellValuesWatchCount > 0) {
|
|
688
644
|
this._unwatchLinkedQueryCellValues();
|
|
689
645
|
}
|
|
690
|
-
|
|
691
646
|
for (var _i = 0, _Object$keys = Object.keys(this._cellValueWatchCountByFieldId); _i < _Object$keys.length; _i++) {
|
|
692
647
|
var fieldId = _Object$keys[_i];
|
|
693
|
-
|
|
694
648
|
this._unwatchLinkedQueryCellValuesInField(fieldId);
|
|
695
649
|
}
|
|
696
|
-
|
|
697
650
|
this._isValid = false;
|
|
698
|
-
|
|
699
651
|
this._onChange('records');
|
|
700
|
-
|
|
701
652
|
this._onChange('recordIds');
|
|
702
653
|
}
|
|
703
|
-
/** @internal */
|
|
704
654
|
|
|
655
|
+
/** @internal */
|
|
705
656
|
}, {
|
|
706
657
|
key: "_invalidateComputedData",
|
|
707
658
|
value: function _invalidateComputedData() {
|
|
708
659
|
this._computedRecordIdsSet = null;
|
|
709
660
|
this._computedFilteredSortedRecordIds = null;
|
|
710
661
|
}
|
|
711
|
-
/** @internal */
|
|
712
662
|
|
|
663
|
+
/** @internal */
|
|
713
664
|
}, {
|
|
714
665
|
key: "_generateComputedDataIfNeeded",
|
|
715
666
|
value: function _generateComputedDataIfNeeded() {
|
|
@@ -717,52 +668,38 @@ function (_RecordQueryResult) {
|
|
|
717
668
|
this._generateComputedData();
|
|
718
669
|
}
|
|
719
670
|
}
|
|
720
|
-
/** @internal */
|
|
721
671
|
|
|
672
|
+
/** @internal */
|
|
722
673
|
}, {
|
|
723
674
|
key: "_generateComputedData",
|
|
724
675
|
value: function _generateComputedData() {
|
|
725
676
|
var recordIdsSet = {};
|
|
726
|
-
|
|
727
677
|
var rawCellValue = this._record.getCellValue(this._field);
|
|
728
|
-
|
|
729
678
|
var cellValue = rawCellValue === null ? [] : rawCellValue;
|
|
730
679
|
(0, _error_utils.invariant)(Array.isArray(cellValue), 'cellValue should be array');
|
|
731
|
-
var
|
|
732
|
-
|
|
733
|
-
var _iteratorError4 = undefined;
|
|
734
|
-
|
|
680
|
+
var _iterator5 = _createForOfIteratorHelper(cellValue),
|
|
681
|
+
_step5;
|
|
735
682
|
try {
|
|
736
|
-
for (
|
|
737
|
-
var linkedRecord =
|
|
683
|
+
for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
|
|
684
|
+
var linkedRecord = _step5.value;
|
|
738
685
|
(0, _error_utils.invariant)(linkedRecord && typeof linkedRecord === 'object', 'linked record should be object');
|
|
739
686
|
var recordId = linkedRecord.id;
|
|
740
|
-
(0, _error_utils.invariant)(typeof recordId === 'string', 'id should be present');
|
|
687
|
+
(0, _error_utils.invariant)(typeof recordId === 'string', 'id should be present');
|
|
688
|
+
|
|
689
|
+
// We need to use the query result as the source of truth for
|
|
741
690
|
// recordIds, since when the client deletes a record from the linked
|
|
742
691
|
// table, we update it optimistically but the origin cell value
|
|
743
692
|
// doesn't update until receiving the push payload.
|
|
744
|
-
|
|
745
693
|
if (this._linkedQueryResult.hasRecord(recordId)) {
|
|
746
694
|
recordIdsSet[recordId] = true;
|
|
747
695
|
}
|
|
748
696
|
}
|
|
749
697
|
} catch (err) {
|
|
750
|
-
|
|
751
|
-
_iteratorError4 = err;
|
|
698
|
+
_iterator5.e(err);
|
|
752
699
|
} finally {
|
|
753
|
-
|
|
754
|
-
if (!_iteratorNormalCompletion4 && _iterator4.return != null) {
|
|
755
|
-
_iterator4.return();
|
|
756
|
-
}
|
|
757
|
-
} finally {
|
|
758
|
-
if (_didIteratorError4) {
|
|
759
|
-
throw _iteratorError4;
|
|
760
|
-
}
|
|
761
|
-
}
|
|
700
|
+
_iterator5.f();
|
|
762
701
|
}
|
|
763
|
-
|
|
764
702
|
this._computedRecordIdsSet = recordIdsSet;
|
|
765
|
-
|
|
766
703
|
if (this._normalizedOpts.sorts && this._normalizedOpts.sorts.length) {
|
|
767
704
|
// when sorts are present, record order comes from the query result
|
|
768
705
|
this._computedFilteredSortedRecordIds = this._linkedQueryResult.recordIds.filter(recordId => recordIdsSet[recordId] === true);
|
|
@@ -774,133 +711,18 @@ function (_RecordQueryResult) {
|
|
|
774
711
|
this._computedFilteredSortedRecordIds = Object.keys(recordIdsSet);
|
|
775
712
|
}
|
|
776
713
|
}
|
|
777
|
-
/** @internal */
|
|
778
714
|
|
|
715
|
+
/** @internal */
|
|
779
716
|
}, {
|
|
780
717
|
key: "_getOrGenerateRecordIdsSet",
|
|
781
718
|
value: function _getOrGenerateRecordIdsSet() {
|
|
782
719
|
this._generateComputedDataIfNeeded();
|
|
783
|
-
|
|
784
720
|
var recordIdsSet = this._computedRecordIdsSet;
|
|
785
721
|
(0, _error_utils.invariant)(recordIdsSet, 'recordIdsSet must exist');
|
|
786
722
|
return recordIdsSet;
|
|
787
723
|
}
|
|
788
|
-
}, {
|
|
789
|
-
key: "isValid",
|
|
790
|
-
get: function get() {
|
|
791
|
-
return this._isValid;
|
|
792
|
-
}
|
|
793
|
-
/**
|
|
794
|
-
* The table that records in this RecordQueryResult are part of
|
|
795
|
-
*
|
|
796
|
-
* @internal (since we may not be able to return parent model instances in the immutable models world)
|
|
797
|
-
*/
|
|
798
|
-
|
|
799
|
-
}, {
|
|
800
|
-
key: "parentTable",
|
|
801
|
-
get: function get() {
|
|
802
|
-
(0, _error_utils.invariant)(this.isValid, 'LinkedRecordsQueryResult is no longer valid');
|
|
803
|
-
return this._linkedTable;
|
|
804
|
-
}
|
|
805
|
-
/**
|
|
806
|
-
* Ordered array of all the linked record ids. Watchable.
|
|
807
|
-
*/
|
|
808
|
-
|
|
809
|
-
}, {
|
|
810
|
-
key: "recordIds",
|
|
811
|
-
get: function get() {
|
|
812
|
-
(0, _error_utils.invariant)(this.isValid, 'LinkedRecordsQueryResult is no longer valid');
|
|
813
|
-
(0, _error_utils.invariant)(this.isDataLoaded, 'LinkedRecordsQueryResult data is not loaded'); // record ids are lazily generated
|
|
814
|
-
|
|
815
|
-
this._generateComputedDataIfNeeded();
|
|
816
|
-
|
|
817
|
-
(0, _error_utils.invariant)(this._computedFilteredSortedRecordIds, 'no recordIds');
|
|
818
|
-
return this._computedFilteredSortedRecordIds;
|
|
819
|
-
}
|
|
820
|
-
/**
|
|
821
|
-
* Ordered array of all the linked records. Watchable.
|
|
822
|
-
*/
|
|
823
|
-
|
|
824
|
-
}, {
|
|
825
|
-
key: "records",
|
|
826
|
-
get: function get() {
|
|
827
|
-
(0, _error_utils.invariant)(this.isValid, 'LinkedRecordsQueryResult is no longer valid');
|
|
828
|
-
return this.recordIds.map(recordId => {
|
|
829
|
-
var record = this._linkedRecordStore.getRecordByIdIfExists(recordId);
|
|
830
|
-
|
|
831
|
-
(0, _error_utils.invariant)(record, 'No record for id: %s', recordId);
|
|
832
|
-
return record;
|
|
833
|
-
});
|
|
834
|
-
}
|
|
835
|
-
/**
|
|
836
|
-
* The fields that were used to create this LinkedRecordsQueryResult.
|
|
837
|
-
*/
|
|
838
|
-
|
|
839
|
-
}, {
|
|
840
|
-
key: "fields",
|
|
841
|
-
get: function get() {
|
|
842
|
-
(0, _error_utils.invariant)(this.isValid, 'LinkedRecordsQueryResult is no longer valid');
|
|
843
|
-
return this._linkedQueryResult.fields;
|
|
844
|
-
}
|
|
845
|
-
}, {
|
|
846
|
-
key: "__poolKey",
|
|
847
|
-
get: function get() {
|
|
848
|
-
return "".concat(this._serializedOpts, "::").concat(this._field.id, "::").concat(this._linkedTable.id, "::").concat(this.isValid);
|
|
849
|
-
}
|
|
850
|
-
/** @internal */
|
|
851
|
-
|
|
852
|
-
}, {
|
|
853
|
-
key: "_cellValuesWatchCount",
|
|
854
|
-
get: function get() {
|
|
855
|
-
return (this._changeWatchersByKey[_record_query_result.default.WatchableKeys.cellValues] || []).length;
|
|
856
|
-
}
|
|
857
|
-
}, {
|
|
858
|
-
key: "_cellValueWatchCountByFieldId",
|
|
859
|
-
get: function get() {
|
|
860
|
-
var countByFieldId = {};
|
|
861
|
-
var watchKeys = Object.keys(this._changeWatchersByKey).filter(key => {
|
|
862
|
-
return key.startsWith(_record_query_result.default.WatchableCellValuesInFieldKeyPrefix);
|
|
863
|
-
});
|
|
864
|
-
var _iteratorNormalCompletion5 = true;
|
|
865
|
-
var _didIteratorError5 = false;
|
|
866
|
-
var _iteratorError5 = undefined;
|
|
867
|
-
|
|
868
|
-
try {
|
|
869
|
-
for (var _iterator5 = watchKeys[Symbol.iterator](), _step5; !(_iteratorNormalCompletion5 = (_step5 = _iterator5.next()).done); _iteratorNormalCompletion5 = true) {
|
|
870
|
-
var watchKey = _step5.value;
|
|
871
|
-
var fieldId = watchKey.slice(_record_query_result.default.WatchableCellValuesInFieldKeyPrefix.length);
|
|
872
|
-
countByFieldId[fieldId] = this._changeWatchersByKey[watchKey].length;
|
|
873
|
-
}
|
|
874
|
-
} catch (err) {
|
|
875
|
-
_didIteratorError5 = true;
|
|
876
|
-
_iteratorError5 = err;
|
|
877
|
-
} finally {
|
|
878
|
-
try {
|
|
879
|
-
if (!_iteratorNormalCompletion5 && _iterator5.return != null) {
|
|
880
|
-
_iterator5.return();
|
|
881
|
-
}
|
|
882
|
-
} finally {
|
|
883
|
-
if (_didIteratorError5) {
|
|
884
|
-
throw _iteratorError5;
|
|
885
|
-
}
|
|
886
|
-
}
|
|
887
|
-
}
|
|
888
|
-
|
|
889
|
-
return countByFieldId;
|
|
890
|
-
}
|
|
891
|
-
}, {
|
|
892
|
-
key: "_dataOrNullIfDeleted",
|
|
893
|
-
get: function get() {
|
|
894
|
-
if (this._record.isDeleted || this._linkedRecordStore.isDeleted) {
|
|
895
|
-
return null;
|
|
896
|
-
}
|
|
897
|
-
|
|
898
|
-
return {};
|
|
899
|
-
}
|
|
900
724
|
}]);
|
|
901
|
-
return LinkedRecordsQueryResult;
|
|
902
725
|
}(_record_query_result.default);
|
|
903
|
-
|
|
726
|
+
/** @internal */
|
|
904
727
|
(0, _defineProperty2.default)(LinkedRecordsQueryResult, "_className", 'LinkedRecordsQueryResult');
|
|
905
|
-
var _default = LinkedRecordsQueryResult;
|
|
906
|
-
exports.default = _default;
|
|
728
|
+
var _default = exports.default = LinkedRecordsQueryResult;
|