@airtable/blocks 1.18.0 → 1.18.2
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 +552 -0
- 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 +27 -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 +2 -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 +89 -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_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 +23 -24
- 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 +1 -1
- 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 +3 -3
- package/dist/types/src/ui/choice_token.d.ts.map +1 -1
- package/dist/types/src/ui/collaborator_token.d.ts +5 -5
- package/dist/types/src/ui/collaborator_token.d.ts.map +1 -1
- package/dist/types/src/ui/color_palette.d.ts +2 -2
- 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 +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 +3 -3
- package/dist/types/src/ui/heading.d.ts.map +1 -1
- package/dist/types/src/ui/icon.d.ts +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 +15 -15
- package/dist/types/src/ui/input.d.ts.map +1 -1
- package/dist/types/src/ui/link.d.ts +1 -1
- package/dist/types/src/ui/link.d.ts.map +1 -1
- package/dist/types/src/ui/loader.d.ts +1 -1
- 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 +1 -1
- package/dist/types/src/ui/progress_bar.d.ts.map +1 -1
- package/dist/types/src/ui/record_card.d.ts +2 -2
- package/dist/types/src/ui/record_card.d.ts.map +1 -1
- package/dist/types/src/ui/record_card_list.d.ts +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 +4 -4
- package/dist/types/src/ui/switch.d.ts +1 -1
- 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/text.d.ts +3 -3
- package/dist/types/src/ui/text.d.ts.map +1 -1
- package/dist/types/src/ui/text_button.d.ts +1 -1
- 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/use_base.d.ts.map +1 -1
- 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 +2 -2
- 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/dist/types/stories/helpers/code_block.d.ts +2 -2
- package/dist/types/stories/helpers/code_block.d.ts.map +1 -1
- package/dist/types/stories/helpers/example.d.ts +5 -5
- package/dist/types/stories/helpers/example.d.ts.map +1 -1
- package/dist/types/stories/helpers/example_code_panel.d.ts +2 -2
- package/dist/types/stories/helpers/example_code_panel.d.ts.map +1 -1
- package/dist/types/stories/helpers/fake_cell_renderer.d.ts +2 -2
- package/dist/types/stories/helpers/fake_cell_renderer.d.ts.map +1 -1
- package/dist/types/stories/helpers/fake_foreign_record.d.ts +1 -1
- package/dist/types/stories/helpers/fake_foreign_record.d.ts.map +1 -1
- package/dist/types/stories/helpers/fake_record_card.d.ts +2 -2
- package/dist/types/stories/helpers/fake_record_card.d.ts.map +1 -1
- package/dist/types/stories/helpers/style_prop_list.d.ts +2 -2
- package/dist/types/stories/helpers/style_prop_list.d.ts.map +1 -1
- package/dist/types/stories/icon_example.d.ts +2 -2
- package/dist/types/stories/icon_example.d.ts.map +1 -1
- package/dist/types/test/airtable_interface_mocks/mock_airtable_interface.d.ts +0 -1
- package/dist/types/test/airtable_interface_mocks/mock_airtable_interface.d.ts.map +1 -1
- package/package.json +26 -25
package/dist/cjs/models/view.js
CHANGED
|
@@ -1,119 +1,158 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
require("core-js/modules/es.symbol.js");
|
|
4
|
+
require("core-js/modules/es.array.filter.js");
|
|
5
|
+
require("core-js/modules/es.array.iterator.js");
|
|
6
|
+
require("core-js/modules/es.object.get-own-property-descriptors.js");
|
|
7
|
+
require("core-js/modules/es.object.to-string.js");
|
|
8
|
+
require("core-js/modules/es.weak-map.js");
|
|
9
|
+
require("core-js/modules/web.dom-collections.for-each.js");
|
|
10
|
+
require("core-js/modules/web.dom-collections.iterator.js");
|
|
5
11
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
6
|
-
|
|
7
|
-
require("core-js/modules/es.symbol");
|
|
8
|
-
|
|
9
|
-
require("core-js/modules/es.array.filter");
|
|
10
|
-
|
|
11
|
-
require("core-js/modules/es.object.get-own-property-descriptors");
|
|
12
|
-
|
|
13
|
-
require("core-js/modules/es.object.to-string");
|
|
14
|
-
|
|
15
|
-
require("core-js/modules/es.promise");
|
|
16
|
-
|
|
17
|
-
require("core-js/modules/web.dom-collections.for-each");
|
|
18
|
-
|
|
19
12
|
Object.defineProperty(exports, "__esModule", {
|
|
20
13
|
value: true
|
|
21
14
|
});
|
|
22
15
|
exports.default = void 0;
|
|
23
|
-
|
|
24
16
|
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
25
|
-
|
|
26
|
-
require("regenerator-runtime/runtime");
|
|
27
|
-
|
|
17
|
+
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
28
18
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
29
|
-
|
|
19
|
+
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
30
20
|
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
31
|
-
|
|
32
21
|
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
33
|
-
|
|
34
|
-
var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
|
|
35
|
-
|
|
36
|
-
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
37
|
-
|
|
38
22
|
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
39
|
-
|
|
40
23
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
41
|
-
|
|
42
24
|
var _private_utils = require("../private_utils");
|
|
43
|
-
|
|
44
25
|
var _mutations = require("../types/mutations");
|
|
45
|
-
|
|
46
26
|
var _abstract_model = _interopRequireDefault(require("./abstract_model"));
|
|
47
|
-
|
|
48
27
|
var _object_pool = _interopRequireDefault(require("./object_pool"));
|
|
49
|
-
|
|
50
28
|
var _record_query_result = _interopRequireWildcard(require("./record_query_result"));
|
|
51
|
-
|
|
52
29
|
var _view_metadata_query_result = _interopRequireDefault(require("./view_metadata_query_result"));
|
|
53
|
-
|
|
54
30
|
var RecordColoring = _interopRequireWildcard(require("./record_coloring"));
|
|
55
|
-
|
|
56
|
-
function
|
|
57
|
-
|
|
58
|
-
function _objectSpread(
|
|
59
|
-
|
|
31
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
32
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
33
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
34
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
35
|
+
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)); }
|
|
36
|
+
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: View */ /** */
|
|
60
37
|
// This doesn't follow our enum naming conventions because we want the keys
|
|
61
38
|
// to mirror the method/getter names on the model class.
|
|
62
39
|
var WatchableViewKeys = Object.freeze({
|
|
63
40
|
name: 'name',
|
|
64
41
|
isLockedView: 'isLockedView'
|
|
65
42
|
});
|
|
43
|
+
|
|
66
44
|
/**
|
|
67
45
|
* A key in {@link View} that can be watched.
|
|
68
46
|
* - `name`
|
|
69
47
|
*/
|
|
70
|
-
|
|
71
48
|
/**
|
|
72
49
|
* A class that represents an Airtable view. Every {@link Table} has one or more views.
|
|
73
50
|
*
|
|
74
51
|
* @docsPath models/View
|
|
75
52
|
*/
|
|
76
|
-
var View =
|
|
77
|
-
/*#__PURE__*/
|
|
78
|
-
function (_AbstractModel) {
|
|
79
|
-
(0, _inherits2.default)(View, _AbstractModel);
|
|
80
|
-
(0, _createClass2.default)(View, null, [{
|
|
81
|
-
key: "_isWatchableKey",
|
|
82
|
-
|
|
83
|
-
/** @internal */
|
|
84
|
-
|
|
85
|
-
/** @internal */
|
|
86
|
-
value: function _isWatchableKey(key) {
|
|
87
|
-
return (0, _private_utils.isEnumValue)(WatchableViewKeys, key);
|
|
88
|
-
}
|
|
89
|
-
/** @internal */
|
|
90
|
-
|
|
91
|
-
}]);
|
|
92
|
-
|
|
53
|
+
var View = /*#__PURE__*/function (_AbstractModel) {
|
|
93
54
|
/**
|
|
94
55
|
* @internal
|
|
95
56
|
*/
|
|
96
57
|
function View(sdk, parentTable, viewDataStore, viewId) {
|
|
97
58
|
var _this;
|
|
98
|
-
|
|
99
59
|
(0, _classCallCheck2.default)(this, View);
|
|
100
|
-
_this = (
|
|
101
|
-
|
|
102
|
-
(0, _defineProperty2.default)(
|
|
103
|
-
|
|
60
|
+
_this = _callSuper(this, View, [sdk, viewId]);
|
|
61
|
+
/** @internal */
|
|
62
|
+
(0, _defineProperty2.default)(_this, "_parentTable", void 0);
|
|
63
|
+
/** @internal */
|
|
64
|
+
(0, _defineProperty2.default)(_this, "_viewDataStore", void 0);
|
|
65
|
+
/** @internal */
|
|
66
|
+
(0, _defineProperty2.default)(_this, "__viewMetadataQueryResultPool", void 0);
|
|
104
67
|
_this._parentTable = parentTable;
|
|
105
68
|
_this._viewDataStore = viewDataStore;
|
|
106
69
|
_this.__viewMetadataQueryResultPool = new _object_pool.default(_view_metadata_query_result.default);
|
|
107
70
|
return _this;
|
|
108
71
|
}
|
|
72
|
+
|
|
109
73
|
/**
|
|
110
74
|
* @internal
|
|
111
75
|
*/
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
76
|
+
(0, _inherits2.default)(View, _AbstractModel);
|
|
77
|
+
return (0, _createClass2.default)(View, [{
|
|
78
|
+
key: "_dataOrNullIfDeleted",
|
|
79
|
+
get: function get() {
|
|
80
|
+
var _tableData$viewsById$;
|
|
81
|
+
var tableData = this._baseData.tablesById[this.parentTable.id];
|
|
82
|
+
return (_tableData$viewsById$ = tableData === null || tableData === void 0 ? void 0 : tableData.viewsById[this._id]) !== null && _tableData$viewsById$ !== void 0 ? _tableData$viewsById$ : null;
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* The table that this view belongs to. Should never change because views aren't moved between tables.
|
|
86
|
+
*
|
|
87
|
+
* @internal (since we may not be able to return parent model instances in the immutable models world)
|
|
88
|
+
* @example
|
|
89
|
+
* ```js
|
|
90
|
+
* const view = myTable.getViewByName('Grid View');
|
|
91
|
+
* console.log(view.parentTable.id === myTable.id);
|
|
92
|
+
* // => true
|
|
93
|
+
* ```
|
|
94
|
+
*/
|
|
95
|
+
}, {
|
|
96
|
+
key: "parentTable",
|
|
97
|
+
get: function get() {
|
|
98
|
+
return this._parentTable;
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* The name of the view. Can be watched.
|
|
102
|
+
*
|
|
103
|
+
* @example
|
|
104
|
+
* ```js
|
|
105
|
+
* console.log(myView.name);
|
|
106
|
+
* // => 'Grid view'
|
|
107
|
+
* ```
|
|
108
|
+
*/
|
|
109
|
+
}, {
|
|
110
|
+
key: "name",
|
|
111
|
+
get: function get() {
|
|
112
|
+
return this._data.name;
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* The type of the view, such as Grid, Calendar, or Kanban. Should never change because view types cannot be modified.
|
|
116
|
+
*
|
|
117
|
+
* @example
|
|
118
|
+
* ```js
|
|
119
|
+
* console.log(myView.type);
|
|
120
|
+
* // => 'kanban'
|
|
121
|
+
* ```
|
|
122
|
+
*/
|
|
123
|
+
}, {
|
|
124
|
+
key: "type",
|
|
125
|
+
get: function get() {
|
|
126
|
+
return this._data.type;
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* If the view is locked. Can be watched.
|
|
130
|
+
*
|
|
131
|
+
* @example
|
|
132
|
+
* ```js
|
|
133
|
+
* console.log(myView.isLockedView);
|
|
134
|
+
* // => false
|
|
135
|
+
* ```
|
|
136
|
+
*/
|
|
137
|
+
}, {
|
|
138
|
+
key: "isLockedView",
|
|
139
|
+
get: function get() {
|
|
140
|
+
return this._data.isLockedView;
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* The URL for the view. You can visit this URL in the browser to be taken to the view in the Airtable UI.
|
|
144
|
+
*
|
|
145
|
+
* @example
|
|
146
|
+
* ```js
|
|
147
|
+
* console.log(myView.url);
|
|
148
|
+
* // => 'https://airtable.com/appxxxxxxxxxxxxxx/tblxxxxxxxxxxxxxx/viwxxxxxxxxxxxxxx'
|
|
149
|
+
* ```
|
|
150
|
+
*/
|
|
151
|
+
}, {
|
|
152
|
+
key: "url",
|
|
153
|
+
get: function get() {
|
|
154
|
+
return this._sdk.__airtableInterface.urlConstructor.getViewUrl(this.id, this.parentTable.id);
|
|
155
|
+
}
|
|
117
156
|
/**
|
|
118
157
|
* Select records from the view. Returns a {@link RecordQueryResult}.
|
|
119
158
|
*
|
|
@@ -149,13 +188,13 @@ function (_AbstractModel) {
|
|
|
149
188
|
* }
|
|
150
189
|
* ```
|
|
151
190
|
*/
|
|
191
|
+
}, {
|
|
192
|
+
key: "selectRecords",
|
|
152
193
|
value: function selectRecords() {
|
|
153
194
|
var opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
154
|
-
|
|
155
|
-
var normalizedOpts = _record_query_result.default._normalizeOpts(this.parentTable, this._viewDataStore.parentRecordStore, _objectSpread({}, opts, {
|
|
195
|
+
var normalizedOpts = _record_query_result.default._normalizeOpts(this.parentTable, this._viewDataStore.parentRecordStore, _objectSpread(_objectSpread({}, opts), {}, {
|
|
156
196
|
recordColorMode: opts.recordColorMode === undefined ? RecordColoring.modes.byView(this) : opts.recordColorMode
|
|
157
197
|
}));
|
|
158
|
-
|
|
159
198
|
return this.parentTable.__tableOrViewQueryResultPool.getObjectForReuse(this._sdk, this, normalizedOpts);
|
|
160
199
|
}
|
|
161
200
|
/**
|
|
@@ -181,32 +220,33 @@ function (_AbstractModel) {
|
|
|
181
220
|
* }
|
|
182
221
|
* ```
|
|
183
222
|
*/
|
|
184
|
-
|
|
185
223
|
}, {
|
|
186
224
|
key: "selectRecordsAsync",
|
|
187
|
-
value: function
|
|
188
|
-
var
|
|
225
|
+
value: (function () {
|
|
226
|
+
var _selectRecordsAsync = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
|
|
227
|
+
var opts,
|
|
189
228
|
queryResult,
|
|
190
229
|
_args = arguments;
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
switch (_context.prev = _context.next) {
|
|
230
|
+
return _regenerator.default.wrap(function _callee$(_context) {
|
|
231
|
+
while (1) switch (_context.prev = _context.next) {
|
|
194
232
|
case 0:
|
|
195
233
|
opts = _args.length > 0 && _args[0] !== undefined ? _args[0] : {};
|
|
196
234
|
queryResult = this.selectRecords(opts);
|
|
197
235
|
_context.next = 4;
|
|
198
|
-
return
|
|
199
|
-
|
|
236
|
+
return queryResult.loadDataAsync();
|
|
200
237
|
case 4:
|
|
201
238
|
return _context.abrupt("return", queryResult);
|
|
202
|
-
|
|
203
239
|
case 5:
|
|
204
240
|
case "end":
|
|
205
241
|
return _context.stop();
|
|
206
242
|
}
|
|
207
|
-
}
|
|
208
|
-
}
|
|
209
|
-
|
|
243
|
+
}, _callee, this);
|
|
244
|
+
}));
|
|
245
|
+
function selectRecordsAsync() {
|
|
246
|
+
return _selectRecordsAsync.apply(this, arguments);
|
|
247
|
+
}
|
|
248
|
+
return selectRecordsAsync;
|
|
249
|
+
}()
|
|
210
250
|
/**
|
|
211
251
|
* Select the field order and visible fields from the view. Returns a
|
|
212
252
|
* {@link ViewMetadataQueryResult}.
|
|
@@ -233,7 +273,7 @@ function (_AbstractModel) {
|
|
|
233
273
|
* }
|
|
234
274
|
* ```
|
|
235
275
|
*/
|
|
236
|
-
|
|
276
|
+
)
|
|
237
277
|
}, {
|
|
238
278
|
key: "selectMetadata",
|
|
239
279
|
value: function selectMetadata() {
|
|
@@ -264,36 +304,37 @@ function (_AbstractModel) {
|
|
|
264
304
|
* }
|
|
265
305
|
* ```
|
|
266
306
|
*/
|
|
267
|
-
|
|
268
307
|
}, {
|
|
269
308
|
key: "selectMetadataAsync",
|
|
270
|
-
value: function
|
|
271
|
-
var
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
switch (_context2.prev = _context2.next) {
|
|
309
|
+
value: (function () {
|
|
310
|
+
var _selectMetadataAsync = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2() {
|
|
311
|
+
var queryResult;
|
|
312
|
+
return _regenerator.default.wrap(function _callee2$(_context2) {
|
|
313
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
275
314
|
case 0:
|
|
276
315
|
queryResult = this.selectMetadata();
|
|
277
316
|
_context2.next = 3;
|
|
278
|
-
return
|
|
279
|
-
|
|
317
|
+
return queryResult.loadDataAsync();
|
|
280
318
|
case 3:
|
|
281
319
|
return _context2.abrupt("return", queryResult);
|
|
282
|
-
|
|
283
320
|
case 4:
|
|
284
321
|
case "end":
|
|
285
322
|
return _context2.stop();
|
|
286
323
|
}
|
|
287
|
-
}
|
|
288
|
-
}
|
|
289
|
-
|
|
324
|
+
}, _callee2, this);
|
|
325
|
+
}));
|
|
326
|
+
function selectMetadataAsync() {
|
|
327
|
+
return _selectMetadataAsync.apply(this, arguments);
|
|
328
|
+
}
|
|
329
|
+
return selectMetadataAsync;
|
|
330
|
+
}()
|
|
290
331
|
/**
|
|
291
332
|
* Checks whether the current user has permission to update view metadata.
|
|
292
333
|
*
|
|
293
334
|
* @param viewMetadata
|
|
294
335
|
* @hidden
|
|
295
336
|
*/
|
|
296
|
-
|
|
337
|
+
)
|
|
297
338
|
}, {
|
|
298
339
|
key: "checkPermissionsForUpdateMetadata",
|
|
299
340
|
value: function checkPermissionsForUpdateMetadata(viewMetadata) {
|
|
@@ -307,6 +348,7 @@ function (_AbstractModel) {
|
|
|
307
348
|
metadata
|
|
308
349
|
});
|
|
309
350
|
}
|
|
351
|
+
|
|
310
352
|
/**
|
|
311
353
|
* An alias for `checkPermissionsForUpdateMetadata(viewMetadata).hasPermission`.
|
|
312
354
|
*
|
|
@@ -315,12 +357,12 @@ function (_AbstractModel) {
|
|
|
315
357
|
* @param viewMetadata
|
|
316
358
|
* @hidden
|
|
317
359
|
*/
|
|
318
|
-
|
|
319
360
|
}, {
|
|
320
361
|
key: "hasPermissionToUpdateMetadata",
|
|
321
362
|
value: function hasPermissionToUpdateMetadata(viewMetadata) {
|
|
322
363
|
return this.checkPermissionsForUpdateMetadata(viewMetadata).hasPermission;
|
|
323
364
|
}
|
|
365
|
+
|
|
324
366
|
/**
|
|
325
367
|
* Updates view metadata, this is currently only supported from block views
|
|
326
368
|
* altering their own view's grouping config.
|
|
@@ -328,147 +370,62 @@ function (_AbstractModel) {
|
|
|
328
370
|
* @param ViewMetadataForUpdate
|
|
329
371
|
* @hidden
|
|
330
372
|
*/
|
|
331
|
-
|
|
332
373
|
}, {
|
|
333
374
|
key: "updateMetadataAsync",
|
|
334
|
-
value: function
|
|
335
|
-
var
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
switch (_context3.prev = _context3.next) {
|
|
375
|
+
value: (function () {
|
|
376
|
+
var _updateMetadataAsync = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3(viewMetadata) {
|
|
377
|
+
var metadata;
|
|
378
|
+
return _regenerator.default.wrap(function _callee3$(_context3) {
|
|
379
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
339
380
|
case 0:
|
|
340
381
|
metadata = {
|
|
341
382
|
groupLevels: (0, _record_query_result.normalizeSortsOrGroups)(this.parentTable, viewMetadata.groupLevels)
|
|
342
383
|
};
|
|
343
384
|
_context3.next = 3;
|
|
344
|
-
return
|
|
385
|
+
return this._sdk.__mutations.applyMutationAsync({
|
|
345
386
|
type: _mutations.MutationTypes.UPDATE_VIEW_METADATA,
|
|
346
387
|
tableId: this.parentTable.id,
|
|
347
388
|
viewId: this.id,
|
|
348
389
|
metadata
|
|
349
|
-
})
|
|
350
|
-
|
|
390
|
+
});
|
|
351
391
|
case 3:
|
|
352
392
|
case "end":
|
|
353
393
|
return _context3.stop();
|
|
354
394
|
}
|
|
355
|
-
}
|
|
356
|
-
}
|
|
357
|
-
|
|
395
|
+
}, _callee3, this);
|
|
396
|
+
}));
|
|
397
|
+
function updateMetadataAsync(_x) {
|
|
398
|
+
return _updateMetadataAsync.apply(this, arguments);
|
|
399
|
+
}
|
|
400
|
+
return updateMetadataAsync;
|
|
401
|
+
}()
|
|
358
402
|
/**
|
|
359
403
|
* @internal
|
|
360
404
|
*/
|
|
361
|
-
|
|
405
|
+
)
|
|
362
406
|
}, {
|
|
363
407
|
key: "__triggerOnChangeForDirtyPaths",
|
|
364
408
|
value: function __triggerOnChangeForDirtyPaths(dirtyPaths) {
|
|
365
409
|
var didViewSchemaChange = false;
|
|
366
|
-
|
|
367
410
|
this._viewDataStore.triggerOnChangeForDirtyPaths(dirtyPaths);
|
|
368
|
-
|
|
369
411
|
if (dirtyPaths.name) {
|
|
370
412
|
this._onChange(WatchableViewKeys.name);
|
|
371
|
-
|
|
372
413
|
didViewSchemaChange = true;
|
|
373
414
|
}
|
|
374
|
-
|
|
375
415
|
if (dirtyPaths.isLocked) {
|
|
376
416
|
this._onChange(WatchableViewKeys.isLockedView);
|
|
377
|
-
|
|
378
417
|
didViewSchemaChange = true;
|
|
379
418
|
}
|
|
380
|
-
|
|
381
419
|
return didViewSchemaChange;
|
|
382
420
|
}
|
|
383
|
-
}, {
|
|
384
|
-
key: "
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
var tableData = this._baseData.tablesById[this.parentTable.id];
|
|
389
|
-
return (_ref = tableData === null || tableData === void 0 ? void 0 : tableData.viewsById[this._id]) !== null && _ref !== void 0 ? _ref : null;
|
|
390
|
-
}
|
|
391
|
-
/**
|
|
392
|
-
* The table that this view belongs to. Should never change because views aren't moved between tables.
|
|
393
|
-
*
|
|
394
|
-
* @internal (since we may not be able to return parent model instances in the immutable models world)
|
|
395
|
-
* @example
|
|
396
|
-
* ```js
|
|
397
|
-
* const view = myTable.getViewByName('Grid View');
|
|
398
|
-
* console.log(view.parentTable.id === myTable.id);
|
|
399
|
-
* // => true
|
|
400
|
-
* ```
|
|
401
|
-
*/
|
|
402
|
-
|
|
403
|
-
}, {
|
|
404
|
-
key: "parentTable",
|
|
405
|
-
get: function get() {
|
|
406
|
-
return this._parentTable;
|
|
407
|
-
}
|
|
408
|
-
/**
|
|
409
|
-
* The name of the view. Can be watched.
|
|
410
|
-
*
|
|
411
|
-
* @example
|
|
412
|
-
* ```js
|
|
413
|
-
* console.log(myView.name);
|
|
414
|
-
* // => 'Grid view'
|
|
415
|
-
* ```
|
|
416
|
-
*/
|
|
417
|
-
|
|
418
|
-
}, {
|
|
419
|
-
key: "name",
|
|
420
|
-
get: function get() {
|
|
421
|
-
return this._data.name;
|
|
422
|
-
}
|
|
423
|
-
/**
|
|
424
|
-
* The type of the view, such as Grid, Calendar, or Kanban. Should never change because view types cannot be modified.
|
|
425
|
-
*
|
|
426
|
-
* @example
|
|
427
|
-
* ```js
|
|
428
|
-
* console.log(myView.type);
|
|
429
|
-
* // => 'kanban'
|
|
430
|
-
* ```
|
|
431
|
-
*/
|
|
432
|
-
|
|
433
|
-
}, {
|
|
434
|
-
key: "type",
|
|
435
|
-
get: function get() {
|
|
436
|
-
return this._data.type;
|
|
437
|
-
}
|
|
438
|
-
/**
|
|
439
|
-
* If the view is locked. Can be watched.
|
|
440
|
-
*
|
|
441
|
-
* @example
|
|
442
|
-
* ```js
|
|
443
|
-
* console.log(myView.isLockedView);
|
|
444
|
-
* // => false
|
|
445
|
-
* ```
|
|
446
|
-
*/
|
|
447
|
-
|
|
448
|
-
}, {
|
|
449
|
-
key: "isLockedView",
|
|
450
|
-
get: function get() {
|
|
451
|
-
return this._data.isLockedView;
|
|
452
|
-
}
|
|
453
|
-
/**
|
|
454
|
-
* The URL for the view. You can visit this URL in the browser to be taken to the view in the Airtable UI.
|
|
455
|
-
*
|
|
456
|
-
* @example
|
|
457
|
-
* ```js
|
|
458
|
-
* console.log(myView.url);
|
|
459
|
-
* // => 'https://airtable.com/appxxxxxxxxxxxxxx/tblxxxxxxxxxxxxxx/viwxxxxxxxxxxxxxx'
|
|
460
|
-
* ```
|
|
461
|
-
*/
|
|
462
|
-
|
|
463
|
-
}, {
|
|
464
|
-
key: "url",
|
|
465
|
-
get: function get() {
|
|
466
|
-
return this._sdk.__airtableInterface.urlConstructor.getViewUrl(this.id, this.parentTable.id);
|
|
421
|
+
}], [{
|
|
422
|
+
key: "_isWatchableKey",
|
|
423
|
+
value: /** @internal */
|
|
424
|
+
function _isWatchableKey(key) {
|
|
425
|
+
return (0, _private_utils.isEnumValue)(WatchableViewKeys, key);
|
|
467
426
|
}
|
|
468
427
|
}]);
|
|
469
|
-
return View;
|
|
470
428
|
}(_abstract_model.default);
|
|
471
|
-
|
|
429
|
+
/** @internal */
|
|
472
430
|
(0, _defineProperty2.default)(View, "_className", 'View');
|
|
473
|
-
var _default = View;
|
|
474
|
-
exports.default = _default;
|
|
431
|
+
var _default = exports.default = View;
|