@airtable/blocks 0.0.0-experimental-20e3506bd-20250428
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/README.md +28 -0
- package/dist/cjs/base/index.js +96 -0
- package/dist/cjs/base/models/abstract_model_with_async_data.js +273 -0
- package/dist/cjs/base/models/base.js +306 -0
- package/dist/cjs/base/models/create_aggregators.js +115 -0
- package/dist/cjs/base/models/cursor.js +393 -0
- package/dist/cjs/base/models/field.js +427 -0
- package/dist/cjs/base/models/grouped_record_query_result.js +399 -0
- package/dist/cjs/base/models/linked_records_query_result.js +728 -0
- package/dist/cjs/base/models/models.js +137 -0
- package/dist/cjs/base/models/mutations.js +516 -0
- package/dist/cjs/base/models/object_pool.js +184 -0
- package/dist/cjs/base/models/record.js +304 -0
- package/dist/cjs/base/models/record_coloring.js +112 -0
- package/dist/cjs/base/models/record_query_result.js +741 -0
- package/dist/cjs/base/models/record_store.js +825 -0
- package/dist/cjs/base/models/session.js +182 -0
- package/dist/cjs/base/models/table.js +1737 -0
- package/dist/cjs/base/models/table_or_view_query_result.js +1013 -0
- package/dist/cjs/base/models/view.js +431 -0
- package/dist/cjs/base/models/view_data_store.js +403 -0
- package/dist/cjs/base/models/view_metadata_query_result.js +224 -0
- package/dist/cjs/base/perform_record_action.js +257 -0
- package/dist/cjs/base/sdk.js +230 -0
- package/dist/cjs/base/settings_button.js +138 -0
- package/dist/cjs/base/types/aggregators.js +1 -0
- package/dist/cjs/base/types/airtable_interface.js +39 -0
- package/dist/cjs/base/types/backend_fetch_types.js +1 -0
- package/dist/cjs/base/types/base.js +1 -0
- package/dist/cjs/base/types/cursor.js +1 -0
- package/dist/cjs/base/types/mutations.js +112 -0
- package/dist/cjs/base/types/record.js +1 -0
- package/dist/cjs/base/types/record_action_data.js +1 -0
- package/dist/cjs/base/types/table.js +1 -0
- package/dist/cjs/base/types/undo_redo.js +12 -0
- package/dist/cjs/base/types/view.js +41 -0
- package/dist/cjs/base/types/viewport.js +1 -0
- package/dist/cjs/base/ui/base_provider.js +50 -0
- package/dist/cjs/base/ui/baymax_utils.js +133 -0
- package/dist/cjs/base/ui/block_wrapper.js +143 -0
- package/dist/cjs/base/ui/box.js +110 -0
- package/dist/cjs/base/ui/button.js +182 -0
- package/dist/cjs/base/ui/cell_renderer.js +255 -0
- package/dist/cjs/base/ui/choice_token.js +110 -0
- package/dist/cjs/base/ui/collaborator_token.js +145 -0
- package/dist/cjs/base/ui/color_palette.js +239 -0
- package/dist/cjs/base/ui/color_palette_synced.js +98 -0
- package/dist/cjs/base/ui/confirmation_dialog.js +153 -0
- package/dist/cjs/base/ui/control_sizes.js +102 -0
- package/dist/cjs/base/ui/create_detect_element_resize.js +207 -0
- package/dist/cjs/base/ui/css_helpers.js +23 -0
- package/dist/cjs/base/ui/dialog.js +142 -0
- package/dist/cjs/base/ui/dialog_close_button.js +152 -0
- package/dist/cjs/base/ui/expand_record.js +40 -0
- package/dist/cjs/base/ui/expand_record_list.js +47 -0
- package/dist/cjs/base/ui/expand_record_picker_async.js +100 -0
- package/dist/cjs/base/ui/field_icon.js +62 -0
- package/dist/cjs/base/ui/field_picker.js +143 -0
- package/dist/cjs/base/ui/field_picker_synced.js +88 -0
- package/dist/cjs/base/ui/form_field.js +137 -0
- package/dist/cjs/base/ui/geometry/geometry.js +27 -0
- package/dist/cjs/base/ui/geometry/point.js +21 -0
- package/dist/cjs/base/ui/geometry/rect.js +67 -0
- package/dist/cjs/base/ui/geometry/size.js +21 -0
- package/dist/cjs/base/ui/global_alert.js +92 -0
- package/dist/cjs/base/ui/heading.js +181 -0
- package/dist/cjs/base/ui/icon.js +129 -0
- package/dist/cjs/base/ui/icon_config.js +434 -0
- package/dist/cjs/base/ui/initialize_block.js +126 -0
- package/dist/cjs/base/ui/input.js +200 -0
- package/dist/cjs/base/ui/input_synced.js +89 -0
- package/dist/cjs/base/ui/key_codes.js +74 -0
- package/dist/cjs/base/ui/label.js +105 -0
- package/dist/cjs/base/ui/link.js +229 -0
- package/dist/cjs/base/ui/loader.js +82 -0
- package/dist/cjs/base/ui/modal.js +184 -0
- package/dist/cjs/base/ui/model_picker_select.js +83 -0
- package/dist/cjs/base/ui/popover.js +407 -0
- package/dist/cjs/base/ui/progress_bar.js +128 -0
- package/dist/cjs/base/ui/record_card.js +653 -0
- package/dist/cjs/base/ui/record_card_list.js +377 -0
- package/dist/cjs/base/ui/select.js +247 -0
- package/dist/cjs/base/ui/select_and_select_buttons_helpers.js +85 -0
- package/dist/cjs/base/ui/select_buttons.js +192 -0
- package/dist/cjs/base/ui/select_buttons_synced.js +84 -0
- package/dist/cjs/base/ui/select_synced.js +87 -0
- package/dist/cjs/base/ui/switch.js +196 -0
- package/dist/cjs/base/ui/switch_synced.js +75 -0
- package/dist/cjs/base/ui/synced.js +70 -0
- package/dist/cjs/base/ui/system/all_styles_set.js +100 -0
- package/dist/cjs/base/ui/system/appearance/appearance_set.js +30 -0
- package/dist/cjs/base/ui/system/appearance/background_color.js +21 -0
- package/dist/cjs/base/ui/system/appearance/border.js +57 -0
- package/dist/cjs/base/ui/system/appearance/border_radius.js +21 -0
- package/dist/cjs/base/ui/system/appearance/box_shadow.js +21 -0
- package/dist/cjs/base/ui/system/appearance/opacity.js +21 -0
- package/dist/cjs/base/ui/system/dimensions/dimensions_set.js +31 -0
- package/dist/cjs/base/ui/system/dimensions/height.js +21 -0
- package/dist/cjs/base/ui/system/dimensions/max_height.js +21 -0
- package/dist/cjs/base/ui/system/dimensions/max_width.js +21 -0
- package/dist/cjs/base/ui/system/dimensions/min_height.js +21 -0
- package/dist/cjs/base/ui/system/dimensions/min_width.js +21 -0
- package/dist/cjs/base/ui/system/dimensions/width.js +21 -0
- package/dist/cjs/base/ui/system/display.js +22 -0
- package/dist/cjs/base/ui/system/flex_container/align_content.js +18 -0
- package/dist/cjs/base/ui/system/flex_container/align_items.js +18 -0
- package/dist/cjs/base/ui/system/flex_container/flex_container_set.js +31 -0
- package/dist/cjs/base/ui/system/flex_container/flex_direction.js +18 -0
- package/dist/cjs/base/ui/system/flex_container/flex_wrap.js +18 -0
- package/dist/cjs/base/ui/system/flex_container/justify_content.js +18 -0
- package/dist/cjs/base/ui/system/flex_container/justify_items.js +19 -0
- package/dist/cjs/base/ui/system/flex_item/align_self.js +18 -0
- package/dist/cjs/base/ui/system/flex_item/flex.js +18 -0
- package/dist/cjs/base/ui/system/flex_item/flex_basis.js +18 -0
- package/dist/cjs/base/ui/system/flex_item/flex_grow.js +18 -0
- package/dist/cjs/base/ui/system/flex_item/flex_item_set.js +32 -0
- package/dist/cjs/base/ui/system/flex_item/flex_shrink.js +18 -0
- package/dist/cjs/base/ui/system/flex_item/justify_self.js +19 -0
- package/dist/cjs/base/ui/system/flex_item/order.js +18 -0
- package/dist/cjs/base/ui/system/index.js +993 -0
- package/dist/cjs/base/ui/system/overflow.js +24 -0
- package/dist/cjs/base/ui/system/position/bottom.js +26 -0
- package/dist/cjs/base/ui/system/position/left.js +26 -0
- package/dist/cjs/base/ui/system/position/position.js +18 -0
- package/dist/cjs/base/ui/system/position/position_set.js +31 -0
- package/dist/cjs/base/ui/system/position/right.js +26 -0
- package/dist/cjs/base/ui/system/position/top.js +26 -0
- package/dist/cjs/base/ui/system/position/z_index.js +21 -0
- package/dist/cjs/base/ui/system/spacing/margin.js +74 -0
- package/dist/cjs/base/ui/system/spacing/padding.js +67 -0
- package/dist/cjs/base/ui/system/spacing/spacing_set.js +27 -0
- package/dist/cjs/base/ui/system/typography/font_family.js +21 -0
- package/dist/cjs/base/ui/system/typography/font_size.js +21 -0
- package/dist/cjs/base/ui/system/typography/font_style.js +18 -0
- package/dist/cjs/base/ui/system/typography/font_weight.js +21 -0
- package/dist/cjs/base/ui/system/typography/letter_spacing.js +21 -0
- package/dist/cjs/base/ui/system/typography/line_height.js +18 -0
- package/dist/cjs/base/ui/system/typography/text_align.js +18 -0
- package/dist/cjs/base/ui/system/typography/text_color.js +21 -0
- package/dist/cjs/base/ui/system/typography/text_decoration.js +18 -0
- package/dist/cjs/base/ui/system/typography/text_transform.js +18 -0
- package/dist/cjs/base/ui/system/typography/typography_set.js +35 -0
- package/dist/cjs/base/ui/system/utils/create_responsive_prop_type.js +19 -0
- package/dist/cjs/base/ui/system/utils/create_style_prop_types.js +24 -0
- package/dist/cjs/base/ui/system/utils/csstype.js +1 -0
- package/dist/cjs/base/ui/system/utils/ensure_numbers_are_within_scale.js +40 -0
- package/dist/cjs/base/ui/system/utils/enum_prop_type_utils.js +35 -0
- package/dist/cjs/base/ui/system/utils/get_style_props_for_responsive_prop.js +113 -0
- package/dist/cjs/base/ui/system/utils/types.js +1 -0
- package/dist/cjs/base/ui/table_picker.js +95 -0
- package/dist/cjs/base/ui/table_picker_synced.js +84 -0
- package/dist/cjs/base/ui/text.js +150 -0
- package/dist/cjs/base/ui/text_button.js +228 -0
- package/dist/cjs/base/ui/theme/default_theme/button_variants.js +59 -0
- package/dist/cjs/base/ui/theme/default_theme/control_sizes.js +96 -0
- package/dist/cjs/base/ui/theme/default_theme/heading_styles.js +99 -0
- package/dist/cjs/base/ui/theme/default_theme/index.js +48 -0
- package/dist/cjs/base/ui/theme/default_theme/input_variants.js +38 -0
- package/dist/cjs/base/ui/theme/default_theme/link_variants.js +35 -0
- package/dist/cjs/base/ui/theme/default_theme/select_buttons_variants.js +72 -0
- package/dist/cjs/base/ui/theme/default_theme/select_variants.js +59 -0
- package/dist/cjs/base/ui/theme/default_theme/switch_variants.js +91 -0
- package/dist/cjs/base/ui/theme/default_theme/text_button_variants.js +44 -0
- package/dist/cjs/base/ui/theme/default_theme/text_styles.js +81 -0
- package/dist/cjs/base/ui/theme/default_theme/tokens.js +211 -0
- package/dist/cjs/base/ui/theme/theme_context.js +13 -0
- package/dist/cjs/base/ui/theme/use_theme.js +11 -0
- package/dist/cjs/base/ui/tooltip.js +215 -0
- package/dist/cjs/base/ui/types/aria_props.js +23 -0
- package/dist/cjs/base/ui/types/data_attributes_prop.js +18 -0
- package/dist/cjs/base/ui/types/tooltip_anchor_props.js +17 -0
- package/dist/cjs/base/ui/ui.js +375 -0
- package/dist/cjs/base/ui/unstable_standalone_ui.js +179 -0
- package/dist/cjs/base/ui/use_base.js +44 -0
- package/dist/cjs/base/ui/use_cursor.js +46 -0
- package/dist/cjs/base/ui/use_form_field.js +20 -0
- package/dist/cjs/base/ui/use_record_action_data.js +80 -0
- package/dist/cjs/base/ui/use_records.js +265 -0
- package/dist/cjs/base/ui/use_session.js +42 -0
- package/dist/cjs/base/ui/use_settings_button.js +53 -0
- package/dist/cjs/base/ui/use_styled_system.js +32 -0
- package/dist/cjs/base/ui/use_text_color_for_background_color.js +14 -0
- package/dist/cjs/base/ui/use_view_metadata.js +49 -0
- package/dist/cjs/base/ui/use_viewport.js +47 -0
- package/dist/cjs/base/ui/view_picker.js +133 -0
- package/dist/cjs/base/ui/view_picker_synced.js +88 -0
- package/dist/cjs/base/ui/viewport_constraint.js +176 -0
- package/dist/cjs/base/ui/with_styled_system.js +165 -0
- package/dist/cjs/base/undo_redo.js +48 -0
- package/dist/cjs/base/unstable_testing_utils.js +170 -0
- package/dist/cjs/base/viewport.js +397 -0
- package/dist/cjs/injected/airtable_interface.js +22 -0
- package/dist/cjs/interface/index.js +36 -0
- package/dist/cjs/interface/models/base.js +54 -0
- package/dist/cjs/interface/models/field.js +42 -0
- package/dist/cjs/interface/models/mutations.js +65 -0
- package/dist/cjs/interface/models/record.js +46 -0
- package/dist/cjs/interface/models/record_store.js +83 -0
- package/dist/cjs/interface/models/session.js +42 -0
- package/dist/cjs/interface/models/table.js +47 -0
- package/dist/cjs/interface/sdk.js +119 -0
- package/dist/cjs/interface/types/airtable_interface.js +36 -0
- package/dist/cjs/interface/types/base.js +1 -0
- package/dist/cjs/interface/types/mutations.js +24 -0
- package/dist/cjs/interface/types/record.js +1 -0
- package/dist/cjs/interface/types/table.js +1 -0
- package/dist/cjs/interface/ui/block_wrapper.js +61 -0
- package/dist/cjs/interface/ui/expand_record.js +26 -0
- package/dist/cjs/interface/ui/initialize_block.js +98 -0
- package/dist/cjs/interface/ui/ui.js +105 -0
- package/dist/cjs/interface/ui/use_base.js +43 -0
- package/dist/cjs/interface/ui/use_custom_properties.js +158 -0
- package/dist/cjs/interface/ui/use_records.js +55 -0
- package/dist/cjs/interface/ui/use_run_info.js +42 -0
- package/dist/cjs/interface/ui/use_session.js +40 -0
- package/dist/cjs/sdk_mode.js +1 -0
- package/dist/cjs/shared/color_utils.js +65 -0
- package/dist/cjs/shared/colors.js +184 -0
- package/dist/cjs/shared/error_utils.js +96 -0
- package/dist/cjs/shared/event_tracker.js +28 -0
- package/dist/cjs/shared/global_config.js +506 -0
- package/dist/cjs/shared/models/abstract_model.js +119 -0
- package/dist/cjs/shared/models/base_core.js +579 -0
- package/dist/cjs/shared/models/field_core.js +329 -0
- package/dist/cjs/shared/models/mutations_core.js +171 -0
- package/dist/cjs/shared/models/record_core.js +272 -0
- package/dist/cjs/shared/models/record_store_core.js +213 -0
- package/dist/cjs/shared/models/session_core.js +214 -0
- package/dist/cjs/shared/models/table_core.js +460 -0
- package/dist/cjs/shared/private_utils.js +455 -0
- package/dist/cjs/shared/sdk_core.js +115 -0
- package/dist/cjs/shared/types/airtable_interface_core.js +1 -0
- package/dist/cjs/shared/types/attachment.js +1 -0
- package/dist/cjs/shared/types/base_core.js +1 -0
- package/dist/cjs/shared/types/collaborator.js +1 -0
- package/dist/cjs/shared/types/field.js +119 -0
- package/dist/cjs/shared/types/global_config.js +1 -0
- package/dist/cjs/shared/types/hyper_ids.js +1 -0
- package/dist/cjs/shared/types/mutation_constants.js +11 -0
- package/dist/cjs/shared/types/mutations_core.js +34 -0
- package/dist/cjs/shared/types/permission_levels.js +17 -0
- package/dist/cjs/shared/types/record.js +1 -0
- package/dist/cjs/shared/types/stat.js +1 -0
- package/dist/cjs/shared/types/table_core.js +1 -0
- package/dist/cjs/shared/ui/global_config_synced_component_helpers.js +27 -0
- package/dist/cjs/shared/ui/loader.js +68 -0
- package/dist/cjs/shared/ui/remote_utils.js +92 -0
- package/dist/cjs/shared/ui/sdk_context.js +21 -0
- package/dist/cjs/shared/ui/use_array_identity.js +32 -0
- package/dist/cjs/shared/ui/use_base.js +21 -0
- package/dist/cjs/shared/ui/use_global_config.js +47 -0
- package/dist/cjs/shared/ui/use_loadable.js +240 -0
- package/dist/cjs/shared/ui/use_session.js +20 -0
- package/dist/cjs/shared/ui/use_synced.js +45 -0
- package/dist/cjs/shared/ui/use_watchable.js +169 -0
- package/dist/cjs/shared/ui/with_hooks.js +151 -0
- package/dist/cjs/shared/unstable_private_utils.js +51 -0
- package/dist/cjs/shared/warning.js +26 -0
- package/dist/cjs/shared/watchable.js +216 -0
- package/dist/cjs/stats/block_stats.js +96 -0
- package/dist/cjs/testing/abstract_mock_airtable_interface.js +277 -0
- package/dist/types/src/base/index.d.ts +13 -0
- package/dist/types/src/base/index.d.ts.map +1 -0
- package/dist/types/src/base/models/abstract_model_with_async_data.d.ts +47 -0
- package/dist/types/src/base/models/abstract_model_with_async_data.d.ts.map +1 -0
- package/dist/types/src/base/models/base.d.ts +142 -0
- package/dist/types/src/base/models/base.d.ts.map +1 -0
- package/dist/types/src/base/models/create_aggregators.d.ts +59 -0
- package/dist/types/src/base/models/create_aggregators.d.ts.map +1 -0
- package/dist/types/src/base/models/cursor.d.ts +143 -0
- package/dist/types/src/base/models/cursor.d.ts.map +1 -0
- package/dist/types/src/base/models/field.d.ts +249 -0
- package/dist/types/src/base/models/field.d.ts.map +1 -0
- package/dist/types/src/base/models/grouped_record_query_result.d.ts +60 -0
- package/dist/types/src/base/models/grouped_record_query_result.d.ts.map +1 -0
- package/dist/types/src/base/models/linked_records_query_result.d.ts +55 -0
- package/dist/types/src/base/models/linked_records_query_result.d.ts.map +1 -0
- package/dist/types/src/base/models/models.d.ts +20 -0
- package/dist/types/src/base/models/models.d.ts.map +1 -0
- package/dist/types/src/base/models/mutations.d.ts +7 -0
- package/dist/types/src/base/models/mutations.d.ts.map +1 -0
- package/dist/types/src/base/models/object_pool.d.ts +17 -0
- package/dist/types/src/base/models/object_pool.d.ts.map +1 -0
- package/dist/types/src/base/models/record.d.ts +144 -0
- package/dist/types/src/base/models/record.d.ts.map +1 -0
- package/dist/types/src/base/models/record_coloring.d.ts +97 -0
- package/dist/types/src/base/models/record_coloring.d.ts.map +1 -0
- package/dist/types/src/base/models/record_query_result.d.ts +341 -0
- package/dist/types/src/base/models/record_query_result.d.ts.map +1 -0
- package/dist/types/src/base/models/record_store.d.ts +6 -0
- package/dist/types/src/base/models/record_store.d.ts.map +1 -0
- package/dist/types/src/base/models/session.d.ts +124 -0
- package/dist/types/src/base/models/session.d.ts.map +1 -0
- package/dist/types/src/base/models/table.d.ts +1146 -0
- package/dist/types/src/base/models/table.d.ts.map +1 -0
- package/dist/types/src/base/models/table_or_view_query_result.d.ts +61 -0
- package/dist/types/src/base/models/table_or_view_query_result.d.ts.map +1 -0
- package/dist/types/src/base/models/view.d.ts +203 -0
- package/dist/types/src/base/models/view.d.ts.map +1 -0
- package/dist/types/src/base/models/view_data_store.d.ts +10 -0
- package/dist/types/src/base/models/view_data_store.d.ts.map +1 -0
- package/dist/types/src/base/models/view_metadata_query_result.d.ts +79 -0
- package/dist/types/src/base/models/view_metadata_query_result.d.ts.map +1 -0
- package/dist/types/src/base/perform_record_action.d.ts +72 -0
- package/dist/types/src/base/perform_record_action.d.ts.map +1 -0
- package/dist/types/src/base/sdk.d.ts +35 -0
- package/dist/types/src/base/sdk.d.ts.map +1 -0
- package/dist/types/src/base/settings_button.d.ts +66 -0
- package/dist/types/src/base/settings_button.d.ts.map +1 -0
- package/dist/types/src/base/types/aggregators.d.ts +4 -0
- package/dist/types/src/base/types/aggregators.d.ts.map +1 -0
- package/dist/types/src/base/types/airtable_interface.d.ts +160 -0
- package/dist/types/src/base/types/airtable_interface.d.ts.map +1 -0
- package/dist/types/src/base/types/backend_fetch_types.d.ts +17 -0
- package/dist/types/src/base/types/backend_fetch_types.d.ts.map +1 -0
- package/dist/types/src/base/types/base.d.ts +11 -0
- package/dist/types/src/base/types/base.d.ts.map +1 -0
- package/dist/types/src/base/types/cursor.d.ts +8 -0
- package/dist/types/src/base/types/cursor.d.ts.map +1 -0
- package/dist/types/src/base/types/mutations.d.ts +270 -0
- package/dist/types/src/base/types/mutations.d.ts.map +1 -0
- package/dist/types/src/base/types/record.d.ts +7 -0
- package/dist/types/src/base/types/record.d.ts.map +1 -0
- package/dist/types/src/base/types/record_action_data.d.ts +22 -0
- package/dist/types/src/base/types/record_action_data.d.ts.map +1 -0
- package/dist/types/src/base/types/table.d.ts +13 -0
- package/dist/types/src/base/types/table.d.ts.map +1 -0
- package/dist/types/src/base/types/undo_redo.d.ts +8 -0
- package/dist/types/src/base/types/undo_redo.d.ts.map +1 -0
- package/dist/types/src/base/types/view.d.ts +70 -0
- package/dist/types/src/base/types/view.d.ts.map +1 -0
- package/dist/types/src/base/types/viewport.d.ts +9 -0
- package/dist/types/src/base/types/viewport.d.ts.map +1 -0
- package/dist/types/src/base/ui/base_provider.d.ts +37 -0
- package/dist/types/src/base/ui/base_provider.d.ts.map +1 -0
- package/dist/types/src/base/ui/baymax_utils.d.ts +2 -0
- package/dist/types/src/base/ui/baymax_utils.d.ts.map +1 -0
- package/dist/types/src/base/ui/block_wrapper.d.ts +24 -0
- package/dist/types/src/base/ui/block_wrapper.d.ts.map +1 -0
- package/dist/types/src/base/ui/box.d.ts +35 -0
- package/dist/types/src/base/ui/box.d.ts.map +1 -0
- package/dist/types/src/base/ui/button.d.ts +91 -0
- package/dist/types/src/base/ui/button.d.ts.map +1 -0
- package/dist/types/src/base/ui/cell_renderer.d.ts +92 -0
- package/dist/types/src/base/ui/cell_renderer.d.ts.map +1 -0
- package/dist/types/src/base/ui/choice_token.d.ts +69 -0
- package/dist/types/src/base/ui/choice_token.d.ts.map +1 -0
- package/dist/types/src/base/ui/collaborator_token.d.ts +65 -0
- package/dist/types/src/base/ui/collaborator_token.d.ts.map +1 -0
- package/dist/types/src/base/ui/color_palette.d.ts +108 -0
- package/dist/types/src/base/ui/color_palette.d.ts.map +1 -0
- package/dist/types/src/base/ui/color_palette_synced.d.ts +44 -0
- package/dist/types/src/base/ui/color_palette_synced.d.ts.map +1 -0
- package/dist/types/src/base/ui/confirmation_dialog.d.ts +83 -0
- package/dist/types/src/base/ui/confirmation_dialog.d.ts.map +1 -0
- package/dist/types/src/base/ui/control_sizes.d.ts +17 -0
- package/dist/types/src/base/ui/control_sizes.d.ts.map +1 -0
- package/dist/types/src/base/ui/css_helpers.d.ts +6 -0
- package/dist/types/src/base/ui/css_helpers.d.ts.map +1 -0
- package/dist/types/src/base/ui/dialog.d.ts +80 -0
- package/dist/types/src/base/ui/dialog.d.ts.map +1 -0
- package/dist/types/src/base/ui/dialog_close_button.d.ts +62 -0
- package/dist/types/src/base/ui/dialog_close_button.d.ts.map +1 -0
- package/dist/types/src/base/ui/expand_record.d.ts +27 -0
- package/dist/types/src/base/ui/expand_record.d.ts.map +1 -0
- package/dist/types/src/base/ui/expand_record_list.d.ts +29 -0
- package/dist/types/src/base/ui/expand_record_list.d.ts.map +1 -0
- package/dist/types/src/base/ui/expand_record_picker_async.d.ts +45 -0
- package/dist/types/src/base/ui/expand_record_picker_async.d.ts.map +1 -0
- package/dist/types/src/base/ui/field_icon.d.ts +41 -0
- package/dist/types/src/base/ui/field_icon.d.ts.map +1 -0
- package/dist/types/src/base/ui/field_picker.d.ts +57 -0
- package/dist/types/src/base/ui/field_picker.d.ts.map +1 -0
- package/dist/types/src/base/ui/field_picker_synced.d.ts +18 -0
- package/dist/types/src/base/ui/field_picker_synced.d.ts.map +1 -0
- package/dist/types/src/base/ui/form_field.d.ts +46 -0
- package/dist/types/src/base/ui/form_field.d.ts.map +1 -0
- package/dist/types/src/base/ui/geometry/geometry.d.ts +3 -0
- package/dist/types/src/base/ui/geometry/geometry.d.ts.map +1 -0
- package/dist/types/src/base/ui/geometry/point.d.ts +2 -0
- package/dist/types/src/base/ui/geometry/point.d.ts.map +1 -0
- package/dist/types/src/base/ui/geometry/rect.d.ts +2 -0
- package/dist/types/src/base/ui/geometry/rect.d.ts.map +1 -0
- package/dist/types/src/base/ui/geometry/size.d.ts +2 -0
- package/dist/types/src/base/ui/geometry/size.d.ts.map +1 -0
- package/dist/types/src/base/ui/global_alert.d.ts +23 -0
- package/dist/types/src/base/ui/global_alert.d.ts.map +1 -0
- package/dist/types/src/base/ui/heading.d.ts +64 -0
- package/dist/types/src/base/ui/heading.d.ts.map +1 -0
- package/dist/types/src/base/ui/icon.d.ts +61 -0
- package/dist/types/src/base/ui/icon.d.ts.map +1 -0
- package/dist/types/src/base/ui/icon_config.d.ts +425 -0
- package/dist/types/src/base/ui/icon_config.d.ts.map +1 -0
- package/dist/types/src/base/ui/initialize_block.d.ts +44 -0
- package/dist/types/src/base/ui/initialize_block.d.ts.map +1 -0
- package/dist/types/src/base/ui/input.d.ts +154 -0
- package/dist/types/src/base/ui/input.d.ts.map +1 -0
- package/dist/types/src/base/ui/input_synced.d.ts +18 -0
- package/dist/types/src/base/ui/input_synced.d.ts.map +1 -0
- package/dist/types/src/base/ui/key_codes.d.ts +2 -0
- package/dist/types/src/base/ui/key_codes.d.ts.map +1 -0
- package/dist/types/src/base/ui/label.d.ts +35 -0
- package/dist/types/src/base/ui/label.d.ts.map +1 -0
- package/dist/types/src/base/ui/link.d.ts +88 -0
- package/dist/types/src/base/ui/link.d.ts.map +1 -0
- package/dist/types/src/base/ui/loader.d.ts +55 -0
- package/dist/types/src/base/ui/loader.d.ts.map +1 -0
- package/dist/types/src/base/ui/modal.d.ts +67 -0
- package/dist/types/src/base/ui/modal.d.ts.map +1 -0
- package/dist/types/src/base/ui/model_picker_select.d.ts +19 -0
- package/dist/types/src/base/ui/model_picker_select.d.ts.map +1 -0
- package/dist/types/src/base/ui/popover.d.ts +122 -0
- package/dist/types/src/base/ui/popover.d.ts.map +1 -0
- package/dist/types/src/base/ui/progress_bar.d.ts +83 -0
- package/dist/types/src/base/ui/progress_bar.d.ts.map +1 -0
- package/dist/types/src/base/ui/record_card.d.ts +102 -0
- package/dist/types/src/base/ui/record_card.d.ts.map +1 -0
- package/dist/types/src/base/ui/record_card_list.d.ts +105 -0
- package/dist/types/src/base/ui/record_card_list.d.ts.map +1 -0
- package/dist/types/src/base/ui/select.d.ts +126 -0
- package/dist/types/src/base/ui/select.d.ts.map +1 -0
- package/dist/types/src/base/ui/select_and_select_buttons_helpers.d.ts +27 -0
- package/dist/types/src/base/ui/select_and_select_buttons_helpers.d.ts.map +1 -0
- package/dist/types/src/base/ui/select_buttons.d.ts +78 -0
- package/dist/types/src/base/ui/select_buttons.d.ts.map +1 -0
- package/dist/types/src/base/ui/select_buttons_synced.d.ts +18 -0
- package/dist/types/src/base/ui/select_buttons_synced.d.ts.map +1 -0
- package/dist/types/src/base/ui/select_synced.d.ts +18 -0
- package/dist/types/src/base/ui/select_synced.d.ts.map +1 -0
- package/dist/types/src/base/ui/switch.d.ts +104 -0
- package/dist/types/src/base/ui/switch.d.ts.map +1 -0
- package/dist/types/src/base/ui/switch_synced.d.ts +18 -0
- package/dist/types/src/base/ui/switch_synced.d.ts.map +1 -0
- package/dist/types/src/base/ui/synced.d.ts +29 -0
- package/dist/types/src/base/ui/synced.d.ts.map +1 -0
- package/dist/types/src/base/ui/system/all_styles_set.d.ts +88 -0
- package/dist/types/src/base/ui/system/all_styles_set.d.ts.map +1 -0
- package/dist/types/src/base/ui/system/appearance/appearance_set.d.ts +15 -0
- package/dist/types/src/base/ui/system/appearance/appearance_set.d.ts.map +1 -0
- package/dist/types/src/base/ui/system/appearance/background_color.d.ts +13 -0
- package/dist/types/src/base/ui/system/appearance/background_color.d.ts.map +1 -0
- package/dist/types/src/base/ui/system/appearance/border.d.ts +31 -0
- package/dist/types/src/base/ui/system/appearance/border.d.ts.map +1 -0
- package/dist/types/src/base/ui/system/appearance/border_radius.d.ts +13 -0
- package/dist/types/src/base/ui/system/appearance/border_radius.d.ts.map +1 -0
- package/dist/types/src/base/ui/system/appearance/box_shadow.d.ts +13 -0
- package/dist/types/src/base/ui/system/appearance/box_shadow.d.ts.map +1 -0
- package/dist/types/src/base/ui/system/appearance/opacity.d.ts +13 -0
- package/dist/types/src/base/ui/system/appearance/opacity.d.ts.map +1 -0
- package/dist/types/src/base/ui/system/dimensions/dimensions_set.d.ts +16 -0
- package/dist/types/src/base/ui/system/dimensions/dimensions_set.d.ts.map +1 -0
- package/dist/types/src/base/ui/system/dimensions/height.d.ts +13 -0
- package/dist/types/src/base/ui/system/dimensions/height.d.ts.map +1 -0
- package/dist/types/src/base/ui/system/dimensions/max_height.d.ts +13 -0
- package/dist/types/src/base/ui/system/dimensions/max_height.d.ts.map +1 -0
- package/dist/types/src/base/ui/system/dimensions/max_width.d.ts +13 -0
- package/dist/types/src/base/ui/system/dimensions/max_width.d.ts.map +1 -0
- package/dist/types/src/base/ui/system/dimensions/min_height.d.ts +13 -0
- package/dist/types/src/base/ui/system/dimensions/min_height.d.ts.map +1 -0
- package/dist/types/src/base/ui/system/dimensions/min_width.d.ts +13 -0
- package/dist/types/src/base/ui/system/dimensions/min_width.d.ts.map +1 -0
- package/dist/types/src/base/ui/system/dimensions/width.d.ts +13 -0
- package/dist/types/src/base/ui/system/dimensions/width.d.ts.map +1 -0
- package/dist/types/src/base/ui/system/display.d.ts +14 -0
- package/dist/types/src/base/ui/system/display.d.ts.map +1 -0
- package/dist/types/src/base/ui/system/flex_container/align_content.d.ts +13 -0
- package/dist/types/src/base/ui/system/flex_container/align_content.d.ts.map +1 -0
- package/dist/types/src/base/ui/system/flex_container/align_items.d.ts +13 -0
- package/dist/types/src/base/ui/system/flex_container/align_items.d.ts.map +1 -0
- package/dist/types/src/base/ui/system/flex_container/flex_container_set.d.ts +16 -0
- package/dist/types/src/base/ui/system/flex_container/flex_container_set.d.ts.map +1 -0
- package/dist/types/src/base/ui/system/flex_container/flex_direction.d.ts +13 -0
- package/dist/types/src/base/ui/system/flex_container/flex_direction.d.ts.map +1 -0
- package/dist/types/src/base/ui/system/flex_container/flex_wrap.d.ts +13 -0
- package/dist/types/src/base/ui/system/flex_container/flex_wrap.d.ts.map +1 -0
- package/dist/types/src/base/ui/system/flex_container/justify_content.d.ts +13 -0
- package/dist/types/src/base/ui/system/flex_container/justify_content.d.ts.map +1 -0
- package/dist/types/src/base/ui/system/flex_container/justify_items.d.ts +13 -0
- package/dist/types/src/base/ui/system/flex_container/justify_items.d.ts.map +1 -0
- package/dist/types/src/base/ui/system/flex_item/align_self.d.ts +13 -0
- package/dist/types/src/base/ui/system/flex_item/align_self.d.ts.map +1 -0
- package/dist/types/src/base/ui/system/flex_item/flex.d.ts +13 -0
- package/dist/types/src/base/ui/system/flex_item/flex.d.ts.map +1 -0
- package/dist/types/src/base/ui/system/flex_item/flex_basis.d.ts +13 -0
- package/dist/types/src/base/ui/system/flex_item/flex_basis.d.ts.map +1 -0
- package/dist/types/src/base/ui/system/flex_item/flex_grow.d.ts +13 -0
- package/dist/types/src/base/ui/system/flex_item/flex_grow.d.ts.map +1 -0
- package/dist/types/src/base/ui/system/flex_item/flex_item_set.d.ts +17 -0
- package/dist/types/src/base/ui/system/flex_item/flex_item_set.d.ts.map +1 -0
- package/dist/types/src/base/ui/system/flex_item/flex_shrink.d.ts +13 -0
- package/dist/types/src/base/ui/system/flex_item/flex_shrink.d.ts.map +1 -0
- package/dist/types/src/base/ui/system/flex_item/justify_self.d.ts +13 -0
- package/dist/types/src/base/ui/system/flex_item/justify_self.d.ts.map +1 -0
- package/dist/types/src/base/ui/system/flex_item/order.d.ts +13 -0
- package/dist/types/src/base/ui/system/flex_item/order.d.ts.map +1 -0
- package/dist/types/src/base/ui/system/index.d.ts +54 -0
- package/dist/types/src/base/ui/system/index.d.ts.map +1 -0
- package/dist/types/src/base/ui/system/overflow.d.ts +18 -0
- package/dist/types/src/base/ui/system/overflow.d.ts.map +1 -0
- package/dist/types/src/base/ui/system/position/bottom.d.ts +13 -0
- package/dist/types/src/base/ui/system/position/bottom.d.ts.map +1 -0
- package/dist/types/src/base/ui/system/position/left.d.ts +13 -0
- package/dist/types/src/base/ui/system/position/left.d.ts.map +1 -0
- package/dist/types/src/base/ui/system/position/position.d.ts +13 -0
- package/dist/types/src/base/ui/system/position/position.d.ts.map +1 -0
- package/dist/types/src/base/ui/system/position/position_set.d.ts +16 -0
- package/dist/types/src/base/ui/system/position/position_set.d.ts.map +1 -0
- package/dist/types/src/base/ui/system/position/right.d.ts +13 -0
- package/dist/types/src/base/ui/system/position/right.d.ts.map +1 -0
- package/dist/types/src/base/ui/system/position/top.d.ts +13 -0
- package/dist/types/src/base/ui/system/position/top.d.ts.map +1 -0
- package/dist/types/src/base/ui/system/position/z_index.d.ts +13 -0
- package/dist/types/src/base/ui/system/position/z_index.d.ts.map +1 -0
- package/dist/types/src/base/ui/system/spacing/margin.d.ts +25 -0
- package/dist/types/src/base/ui/system/spacing/margin.d.ts.map +1 -0
- package/dist/types/src/base/ui/system/spacing/padding.d.ts +25 -0
- package/dist/types/src/base/ui/system/spacing/padding.d.ts.map +1 -0
- package/dist/types/src/base/ui/system/spacing/spacing_set.d.ts +12 -0
- package/dist/types/src/base/ui/system/spacing/spacing_set.d.ts.map +1 -0
- package/dist/types/src/base/ui/system/typography/font_family.d.ts +13 -0
- package/dist/types/src/base/ui/system/typography/font_family.d.ts.map +1 -0
- package/dist/types/src/base/ui/system/typography/font_size.d.ts +13 -0
- package/dist/types/src/base/ui/system/typography/font_size.d.ts.map +1 -0
- package/dist/types/src/base/ui/system/typography/font_style.d.ts +13 -0
- package/dist/types/src/base/ui/system/typography/font_style.d.ts.map +1 -0
- package/dist/types/src/base/ui/system/typography/font_weight.d.ts +13 -0
- package/dist/types/src/base/ui/system/typography/font_weight.d.ts.map +1 -0
- package/dist/types/src/base/ui/system/typography/letter_spacing.d.ts +13 -0
- package/dist/types/src/base/ui/system/typography/letter_spacing.d.ts.map +1 -0
- package/dist/types/src/base/ui/system/typography/line_height.d.ts +13 -0
- package/dist/types/src/base/ui/system/typography/line_height.d.ts.map +1 -0
- package/dist/types/src/base/ui/system/typography/text_align.d.ts +13 -0
- package/dist/types/src/base/ui/system/typography/text_align.d.ts.map +1 -0
- package/dist/types/src/base/ui/system/typography/text_color.d.ts +17 -0
- package/dist/types/src/base/ui/system/typography/text_color.d.ts.map +1 -0
- package/dist/types/src/base/ui/system/typography/text_decoration.d.ts +15 -0
- package/dist/types/src/base/ui/system/typography/text_decoration.d.ts.map +1 -0
- package/dist/types/src/base/ui/system/typography/text_transform.d.ts +13 -0
- package/dist/types/src/base/ui/system/typography/text_transform.d.ts.map +1 -0
- package/dist/types/src/base/ui/system/typography/typography_set.d.ts +20 -0
- package/dist/types/src/base/ui/system/typography/typography_set.d.ts.map +1 -0
- package/dist/types/src/base/ui/system/utils/create_responsive_prop_type.d.ts +2 -0
- package/dist/types/src/base/ui/system/utils/create_responsive_prop_type.d.ts.map +1 -0
- package/dist/types/src/base/ui/system/utils/create_style_prop_types.d.ts +4 -0
- package/dist/types/src/base/ui/system/utils/create_style_prop_types.d.ts.map +1 -0
- package/dist/types/src/base/ui/system/utils/csstype.d.ts +3977 -0
- package/dist/types/src/base/ui/system/utils/csstype.d.ts.map +1 -0
- package/dist/types/src/base/ui/system/utils/ensure_numbers_are_within_scale.d.ts +2 -0
- package/dist/types/src/base/ui/system/utils/ensure_numbers_are_within_scale.d.ts.map +1 -0
- package/dist/types/src/base/ui/system/utils/enum_prop_type_utils.d.ts +21 -0
- package/dist/types/src/base/ui/system/utils/enum_prop_type_utils.d.ts.map +1 -0
- package/dist/types/src/base/ui/system/utils/get_style_props_for_responsive_prop.d.ts +2 -0
- package/dist/types/src/base/ui/system/utils/get_style_props_for_responsive_prop.d.ts.map +1 -0
- package/dist/types/src/base/ui/system/utils/types.d.ts +31 -0
- package/dist/types/src/base/ui/system/utils/types.d.ts.map +1 -0
- package/dist/types/src/base/ui/table_picker.d.ts +49 -0
- package/dist/types/src/base/ui/table_picker.d.ts.map +1 -0
- package/dist/types/src/base/ui/table_picker_synced.d.ts +18 -0
- package/dist/types/src/base/ui/table_picker_synced.d.ts.map +1 -0
- package/dist/types/src/base/ui/text.d.ts +69 -0
- package/dist/types/src/base/ui/text.d.ts.map +1 -0
- package/dist/types/src/base/ui/text_button.d.ts +87 -0
- package/dist/types/src/base/ui/text_button.d.ts.map +1 -0
- package/dist/types/src/base/ui/theme/default_theme/button_variants.d.ts +8 -0
- package/dist/types/src/base/ui/theme/default_theme/button_variants.d.ts.map +1 -0
- package/dist/types/src/base/ui/theme/default_theme/control_sizes.d.ts +107 -0
- package/dist/types/src/base/ui/theme/default_theme/control_sizes.d.ts.map +1 -0
- package/dist/types/src/base/ui/theme/default_theme/heading_styles.d.ts +11 -0
- package/dist/types/src/base/ui/theme/default_theme/heading_styles.d.ts.map +1 -0
- package/dist/types/src/base/ui/theme/default_theme/index.d.ts +342 -0
- package/dist/types/src/base/ui/theme/default_theme/index.d.ts.map +1 -0
- package/dist/types/src/base/ui/theme/default_theme/input_variants.d.ts +5 -0
- package/dist/types/src/base/ui/theme/default_theme/input_variants.d.ts.map +1 -0
- package/dist/types/src/base/ui/theme/default_theme/link_variants.d.ts +7 -0
- package/dist/types/src/base/ui/theme/default_theme/link_variants.d.ts.map +1 -0
- package/dist/types/src/base/ui/theme/default_theme/select_buttons_variants.d.ts +8 -0
- package/dist/types/src/base/ui/theme/default_theme/select_buttons_variants.d.ts.map +1 -0
- package/dist/types/src/base/ui/theme/default_theme/select_variants.d.ts +5 -0
- package/dist/types/src/base/ui/theme/default_theme/select_variants.d.ts.map +1 -0
- package/dist/types/src/base/ui/theme/default_theme/switch_variants.d.ts +16 -0
- package/dist/types/src/base/ui/theme/default_theme/switch_variants.d.ts.map +1 -0
- package/dist/types/src/base/ui/theme/default_theme/text_button_variants.d.ts +7 -0
- package/dist/types/src/base/ui/theme/default_theme/text_button_variants.d.ts.map +1 -0
- package/dist/types/src/base/ui/theme/default_theme/text_styles.d.ts +76 -0
- package/dist/types/src/base/ui/theme/default_theme/text_styles.d.ts.map +1 -0
- package/dist/types/src/base/ui/theme/default_theme/tokens.d.ts +111 -0
- package/dist/types/src/base/ui/theme/default_theme/tokens.d.ts.map +1 -0
- package/dist/types/src/base/ui/theme/theme_context.d.ts +342 -0
- package/dist/types/src/base/ui/theme/theme_context.d.ts.map +1 -0
- package/dist/types/src/base/ui/theme/use_theme.d.ts +342 -0
- package/dist/types/src/base/ui/theme/use_theme.d.ts.map +1 -0
- package/dist/types/src/base/ui/tooltip.d.ts +80 -0
- package/dist/types/src/base/ui/tooltip.d.ts.map +1 -0
- package/dist/types/src/base/ui/types/aria_props.d.ts +22 -0
- package/dist/types/src/base/ui/types/aria_props.d.ts.map +1 -0
- package/dist/types/src/base/ui/types/data_attributes_prop.d.ts +14 -0
- package/dist/types/src/base/ui/types/data_attributes_prop.d.ts.map +1 -0
- package/dist/types/src/base/ui/types/tooltip_anchor_props.d.ts +19 -0
- package/dist/types/src/base/ui/types/tooltip_anchor_props.d.ts.map +1 -0
- package/dist/types/src/base/ui/ui.d.ts +46 -0
- package/dist/types/src/base/ui/ui.d.ts.map +1 -0
- package/dist/types/src/base/ui/unstable_standalone_ui.d.ts +24 -0
- package/dist/types/src/base/ui/unstable_standalone_ui.d.ts.map +1 -0
- package/dist/types/src/base/ui/use_base.d.ts +33 -0
- package/dist/types/src/base/ui/use_base.d.ts.map +1 -0
- package/dist/types/src/base/ui/use_cursor.d.ts +33 -0
- package/dist/types/src/base/ui/use_cursor.d.ts.map +1 -0
- package/dist/types/src/base/ui/use_form_field.d.ts +2 -0
- package/dist/types/src/base/ui/use_form_field.d.ts.map +1 -0
- package/dist/types/src/base/ui/use_record_action_data.d.ts +54 -0
- package/dist/types/src/base/ui/use_record_action_data.d.ts.map +1 -0
- package/dist/types/src/base/ui/use_records.d.ts +37 -0
- package/dist/types/src/base/ui/use_records.d.ts.map +1 -0
- package/dist/types/src/base/ui/use_session.d.ts +31 -0
- package/dist/types/src/base/ui/use_session.d.ts.map +1 -0
- package/dist/types/src/base/ui/use_settings_button.d.ts +30 -0
- package/dist/types/src/base/ui/use_settings_button.d.ts.map +1 -0
- package/dist/types/src/base/ui/use_styled_system.d.ts +2 -0
- package/dist/types/src/base/ui/use_styled_system.d.ts.map +1 -0
- package/dist/types/src/base/ui/use_text_color_for_background_color.d.ts +2 -0
- package/dist/types/src/base/ui/use_text_color_for_background_color.d.ts.map +1 -0
- package/dist/types/src/base/ui/use_view_metadata.d.ts +11 -0
- package/dist/types/src/base/ui/use_view_metadata.d.ts.map +1 -0
- package/dist/types/src/base/ui/use_viewport.d.ts +35 -0
- package/dist/types/src/base/ui/use_viewport.d.ts.map +1 -0
- package/dist/types/src/base/ui/view_picker.d.ts +57 -0
- package/dist/types/src/base/ui/view_picker.d.ts.map +1 -0
- package/dist/types/src/base/ui/view_picker_synced.d.ts +18 -0
- package/dist/types/src/base/ui/view_picker_synced.d.ts.map +1 -0
- package/dist/types/src/base/ui/viewport_constraint.d.ts +70 -0
- package/dist/types/src/base/ui/viewport_constraint.d.ts.map +1 -0
- package/dist/types/src/base/ui/with_styled_system.d.ts +2 -0
- package/dist/types/src/base/ui/with_styled_system.d.ts.map +1 -0
- package/dist/types/src/base/undo_redo.d.ts +18 -0
- package/dist/types/src/base/undo_redo.d.ts.map +1 -0
- package/dist/types/src/base/unstable_testing_utils.d.ts +15 -0
- package/dist/types/src/base/unstable_testing_utils.d.ts.map +1 -0
- package/dist/types/src/base/viewport.d.ts +136 -0
- package/dist/types/src/base/viewport.d.ts.map +1 -0
- package/dist/types/src/injected/airtable_interface.d.ts +4 -0
- package/dist/types/src/injected/airtable_interface.d.ts.map +1 -0
- package/dist/types/src/interface/index.d.ts +7 -0
- package/dist/types/src/interface/index.d.ts.map +1 -0
- package/dist/types/src/interface/models/base.d.ts +13 -0
- package/dist/types/src/interface/models/base.d.ts.map +1 -0
- package/dist/types/src/interface/models/field.d.ts +21 -0
- package/dist/types/src/interface/models/field.d.ts.map +1 -0
- package/dist/types/src/interface/models/mutations.d.ts +6 -0
- package/dist/types/src/interface/models/mutations.d.ts.map +1 -0
- package/dist/types/src/interface/models/record.d.ts +24 -0
- package/dist/types/src/interface/models/record.d.ts.map +1 -0
- package/dist/types/src/interface/models/record_store.d.ts +2 -0
- package/dist/types/src/interface/models/record_store.d.ts.map +1 -0
- package/dist/types/src/interface/models/session.d.ts +24 -0
- package/dist/types/src/interface/models/session.d.ts.map +1 -0
- package/dist/types/src/interface/models/table.d.ts +22 -0
- package/dist/types/src/interface/models/table.d.ts.map +1 -0
- package/dist/types/src/interface/sdk.d.ts +10 -0
- package/dist/types/src/interface/sdk.d.ts.map +1 -0
- package/dist/types/src/interface/types/airtable_interface.d.ts +66 -0
- package/dist/types/src/interface/types/airtable_interface.d.ts.map +1 -0
- package/dist/types/src/interface/types/base.d.ts +6 -0
- package/dist/types/src/interface/types/base.d.ts.map +1 -0
- package/dist/types/src/interface/types/mutations.d.ts +13 -0
- package/dist/types/src/interface/types/mutations.d.ts.map +1 -0
- package/dist/types/src/interface/types/record.d.ts +5 -0
- package/dist/types/src/interface/types/record.d.ts.map +1 -0
- package/dist/types/src/interface/types/table.d.ts +10 -0
- package/dist/types/src/interface/types/table.d.ts.map +1 -0
- package/dist/types/src/interface/ui/block_wrapper.d.ts +13 -0
- package/dist/types/src/interface/ui/block_wrapper.d.ts.map +1 -0
- package/dist/types/src/interface/ui/expand_record.d.ts +16 -0
- package/dist/types/src/interface/ui/expand_record.d.ts.map +1 -0
- package/dist/types/src/interface/ui/initialize_block.d.ts +4 -0
- package/dist/types/src/interface/ui/initialize_block.d.ts.map +1 -0
- package/dist/types/src/interface/ui/ui.d.ts +16 -0
- package/dist/types/src/interface/ui/ui.d.ts.map +1 -0
- package/dist/types/src/interface/ui/use_base.d.ts +33 -0
- package/dist/types/src/interface/ui/use_base.d.ts.map +1 -0
- package/dist/types/src/interface/ui/use_custom_properties.d.ts +45 -0
- package/dist/types/src/interface/ui/use_custom_properties.d.ts.map +1 -0
- package/dist/types/src/interface/ui/use_records.d.ts +40 -0
- package/dist/types/src/interface/ui/use_records.d.ts.map +1 -0
- package/dist/types/src/interface/ui/use_run_info.d.ts +30 -0
- package/dist/types/src/interface/ui/use_run_info.d.ts.map +1 -0
- package/dist/types/src/interface/ui/use_session.d.ts +30 -0
- package/dist/types/src/interface/ui/use_session.d.ts.map +1 -0
- package/dist/types/src/sdk_mode.d.ts +65 -0
- package/dist/types/src/sdk_mode.d.ts.map +1 -0
- package/dist/types/src/shared/color_utils.d.ts +72 -0
- package/dist/types/src/shared/color_utils.d.ts.map +1 -0
- package/dist/types/src/shared/colors.d.ts +180 -0
- package/dist/types/src/shared/colors.d.ts.map +1 -0
- package/dist/types/src/shared/error_utils.d.ts +19 -0
- package/dist/types/src/shared/error_utils.d.ts.map +1 -0
- package/dist/types/src/shared/event_tracker.d.ts +17 -0
- package/dist/types/src/shared/event_tracker.d.ts.map +1 -0
- package/dist/types/src/shared/global_config.d.ts +235 -0
- package/dist/types/src/shared/global_config.d.ts.map +1 -0
- package/dist/types/src/shared/models/abstract_model.d.ts +29 -0
- package/dist/types/src/shared/models/abstract_model.d.ts.map +1 -0
- package/dist/types/src/shared/models/base_core.d.ts +168 -0
- package/dist/types/src/shared/models/base_core.d.ts.map +1 -0
- package/dist/types/src/shared/models/field_core.d.ts +133 -0
- package/dist/types/src/shared/models/field_core.d.ts.map +1 -0
- package/dist/types/src/shared/models/mutations_core.d.ts +17 -0
- package/dist/types/src/shared/models/mutations_core.d.ts.map +1 -0
- package/dist/types/src/shared/models/record_core.d.ts +60 -0
- package/dist/types/src/shared/models/record_core.d.ts.map +1 -0
- package/dist/types/src/shared/models/record_store_core.d.ts +7 -0
- package/dist/types/src/shared/models/record_store_core.d.ts.map +1 -0
- package/dist/types/src/shared/models/session_core.d.ts +50 -0
- package/dist/types/src/shared/models/session_core.d.ts.map +1 -0
- package/dist/types/src/shared/models/table_core.d.ts +143 -0
- package/dist/types/src/shared/models/table_core.d.ts.map +1 -0
- package/dist/types/src/shared/private_utils.d.ts +168 -0
- package/dist/types/src/shared/private_utils.d.ts.map +1 -0
- package/dist/types/src/shared/sdk_core.d.ts +69 -0
- package/dist/types/src/shared/sdk_core.d.ts.map +1 -0
- package/dist/types/src/shared/types/airtable_interface_core.d.ts +91 -0
- package/dist/types/src/shared/types/airtable_interface_core.d.ts.map +1 -0
- package/dist/types/src/shared/types/attachment.d.ts +27 -0
- package/dist/types/src/shared/types/attachment.d.ts.map +1 -0
- package/dist/types/src/shared/types/base_core.d.ts +35 -0
- package/dist/types/src/shared/types/base_core.d.ts.map +1 -0
- package/dist/types/src/shared/types/collaborator.d.ts +17 -0
- package/dist/types/src/shared/types/collaborator.d.ts.map +1 -0
- package/dist/types/src/shared/types/field.d.ts +1470 -0
- package/dist/types/src/shared/types/field.d.ts.map +1 -0
- package/dist/types/src/shared/types/global_config.d.ts +44 -0
- package/dist/types/src/shared/types/global_config.d.ts.map +1 -0
- package/dist/types/src/shared/types/hyper_ids.d.ts +19 -0
- package/dist/types/src/shared/types/hyper_ids.d.ts.map +1 -0
- package/dist/types/src/shared/types/mutation_constants.d.ts +5 -0
- package/dist/types/src/shared/types/mutation_constants.d.ts.map +1 -0
- package/dist/types/src/shared/types/mutations_core.d.ts +49 -0
- package/dist/types/src/shared/types/mutations_core.d.ts.map +1 -0
- package/dist/types/src/shared/types/permission_levels.d.ts +13 -0
- package/dist/types/src/shared/types/permission_levels.d.ts.map +1 -0
- package/dist/types/src/shared/types/record.d.ts +12 -0
- package/dist/types/src/shared/types/record.d.ts.map +1 -0
- package/dist/types/src/shared/types/stat.d.ts +10 -0
- package/dist/types/src/shared/types/stat.d.ts.map +1 -0
- package/dist/types/src/shared/types/table_core.d.ts +28 -0
- package/dist/types/src/shared/types/table_core.d.ts.map +1 -0
- package/dist/types/src/shared/ui/global_config_synced_component_helpers.d.ts +9 -0
- package/dist/types/src/shared/ui/global_config_synced_component_helpers.d.ts.map +1 -0
- package/dist/types/src/shared/ui/loader.d.ts +2 -0
- package/dist/types/src/shared/ui/loader.d.ts.map +1 -0
- package/dist/types/src/shared/ui/remote_utils.d.ts +41 -0
- package/dist/types/src/shared/ui/remote_utils.d.ts.map +1 -0
- package/dist/types/src/shared/ui/sdk_context.d.ts +5 -0
- package/dist/types/src/shared/ui/sdk_context.d.ts.map +1 -0
- package/dist/types/src/shared/ui/use_array_identity.d.ts +2 -0
- package/dist/types/src/shared/ui/use_array_identity.d.ts.map +1 -0
- package/dist/types/src/shared/ui/use_base.d.ts +7 -0
- package/dist/types/src/shared/ui/use_base.d.ts.map +1 -0
- package/dist/types/src/shared/ui/use_global_config.d.ts +32 -0
- package/dist/types/src/shared/ui/use_global_config.d.ts.map +1 -0
- package/dist/types/src/shared/ui/use_loadable.d.ts +101 -0
- package/dist/types/src/shared/ui/use_loadable.d.ts.map +1 -0
- package/dist/types/src/shared/ui/use_session.d.ts +2 -0
- package/dist/types/src/shared/ui/use_session.d.ts.map +1 -0
- package/dist/types/src/shared/ui/use_synced.d.ts +28 -0
- package/dist/types/src/shared/ui/use_synced.d.ts.map +1 -0
- package/dist/types/src/shared/ui/use_watchable.d.ts +61 -0
- package/dist/types/src/shared/ui/use_watchable.d.ts.map +1 -0
- package/dist/types/src/shared/ui/with_hooks.d.ts +97 -0
- package/dist/types/src/shared/ui/with_hooks.d.ts.map +1 -0
- package/dist/types/src/shared/unstable_private_utils.d.ts +5 -0
- package/dist/types/src/shared/unstable_private_utils.d.ts.map +1 -0
- package/dist/types/src/shared/warning.d.ts +6 -0
- package/dist/types/src/shared/warning.d.ts.map +1 -0
- package/dist/types/src/shared/watchable.d.ts +38 -0
- package/dist/types/src/shared/watchable.d.ts.map +1 -0
- package/dist/types/src/stats/block_stats.d.ts +33 -0
- package/dist/types/src/stats/block_stats.d.ts.map +1 -0
- package/dist/types/src/testing/abstract_mock_airtable_interface.d.ts +87 -0
- package/dist/types/src/testing/abstract_mock_airtable_interface.d.ts.map +1 -0
- package/dist/types/stories/all_controls.stories.d.ts +10 -0
- package/dist/types/stories/all_controls.stories.d.ts.map +1 -0
- package/dist/types/stories/box/appearance.stories.d.ts +21 -0
- package/dist/types/stories/box/appearance.stories.d.ts.map +1 -0
- package/dist/types/stories/box/box.stories.d.ts +45 -0
- package/dist/types/stories/box/box.stories.d.ts.map +1 -0
- package/dist/types/stories/box/dimensions.stories.d.ts +24 -0
- package/dist/types/stories/box/dimensions.stories.d.ts.map +1 -0
- package/dist/types/stories/box/flex_container.stories.d.ts +24 -0
- package/dist/types/stories/box/flex_container.stories.d.ts.map +1 -0
- package/dist/types/stories/box/flex_item.stories.d.ts +25 -0
- package/dist/types/stories/box/flex_item.stories.d.ts.map +1 -0
- package/dist/types/stories/box/position.stories.d.ts +25 -0
- package/dist/types/stories/box/position.stories.d.ts.map +1 -0
- package/dist/types/stories/box/spacing.stories.d.ts +39 -0
- package/dist/types/stories/box/spacing.stories.d.ts.map +1 -0
- package/dist/types/stories/box/typography.stories.d.ts +33 -0
- package/dist/types/stories/box/typography.stories.d.ts.map +1 -0
- package/dist/types/stories/button.stories.d.ts +48 -0
- package/dist/types/stories/button.stories.d.ts.map +1 -0
- package/dist/types/stories/cell_renderer.stories.d.ts +11 -0
- package/dist/types/stories/cell_renderer.stories.d.ts.map +1 -0
- package/dist/types/stories/choice_token.stories.d.ts +24 -0
- package/dist/types/stories/choice_token.stories.d.ts.map +1 -0
- package/dist/types/stories/collaborator_token.stories.d.ts +29 -0
- package/dist/types/stories/collaborator_token.stories.d.ts.map +1 -0
- package/dist/types/stories/color_palette.stories.d.ts +12 -0
- package/dist/types/stories/color_palette.stories.d.ts.map +1 -0
- package/dist/types/stories/confirmation_dialog.stories.d.ts +10 -0
- package/dist/types/stories/confirmation_dialog.stories.d.ts.map +1 -0
- package/dist/types/stories/dialog.stories.d.ts +10 -0
- package/dist/types/stories/dialog.stories.d.ts.map +1 -0
- package/dist/types/stories/field_icon.stories.d.ts +10 -0
- package/dist/types/stories/field_icon.stories.d.ts.map +1 -0
- package/dist/types/stories/field_picker.stories.d.ts +12 -0
- package/dist/types/stories/field_picker.stories.d.ts.map +1 -0
- package/dist/types/stories/form_field.stories.d.ts +33 -0
- package/dist/types/stories/form_field.stories.d.ts.map +1 -0
- package/dist/types/stories/heading.size.stories.d.ts +19 -0
- package/dist/types/stories/heading.size.stories.d.ts.map +1 -0
- package/dist/types/stories/heading.stories.d.ts +33 -0
- package/dist/types/stories/heading.stories.d.ts.map +1 -0
- package/dist/types/stories/helpers/attachments.d.ts +4 -0
- package/dist/types/stories/helpers/attachments.d.ts.map +1 -0
- package/dist/types/stories/helpers/categorize_style_props.d.ts +14 -0
- package/dist/types/stories/helpers/categorize_style_props.d.ts.map +1 -0
- package/dist/types/stories/helpers/choice_options.d.ts +7 -0
- package/dist/types/stories/helpers/choice_options.d.ts.map +1 -0
- package/dist/types/stories/helpers/code_block.d.ts +5 -0
- package/dist/types/stories/helpers/code_block.d.ts.map +1 -0
- package/dist/types/stories/helpers/code_utils.d.ts +32 -0
- package/dist/types/stories/helpers/code_utils.d.ts.map +1 -0
- package/dist/types/stories/helpers/collaborator_options.d.ts +7 -0
- package/dist/types/stories/helpers/collaborator_options.d.ts.map +1 -0
- package/dist/types/stories/helpers/example.d.ts +39 -0
- package/dist/types/stories/helpers/example.d.ts.map +1 -0
- package/dist/types/stories/helpers/example_code_panel.d.ts +10 -0
- package/dist/types/stories/helpers/example_code_panel.d.ts.map +1 -0
- package/dist/types/stories/helpers/fake_cell_renderer.d.ts +7 -0
- package/dist/types/stories/helpers/fake_cell_renderer.d.ts.map +1 -0
- package/dist/types/stories/helpers/fake_foreign_record.d.ts +5 -0
- package/dist/types/stories/helpers/fake_foreign_record.d.ts.map +1 -0
- package/dist/types/stories/helpers/fake_record_card.d.ts +13 -0
- package/dist/types/stories/helpers/fake_record_card.d.ts.map +1 -0
- package/dist/types/stories/helpers/field_type.d.ts +6 -0
- package/dist/types/stories/helpers/field_type.d.ts.map +1 -0
- package/dist/types/stories/helpers/raf_throttle.d.ts +5 -0
- package/dist/types/stories/helpers/raf_throttle.d.ts.map +1 -0
- package/dist/types/stories/helpers/style_prop_list.d.ts +9 -0
- package/dist/types/stories/helpers/style_prop_list.d.ts.map +1 -0
- package/dist/types/stories/helpers/sync_source_options.d.ts +7 -0
- package/dist/types/stories/helpers/sync_source_options.d.ts.map +1 -0
- package/dist/types/stories/helpers/use_resizable_panel.d.ts +27 -0
- package/dist/types/stories/helpers/use_resizable_panel.d.ts.map +1 -0
- package/dist/types/stories/icon.stories.d.ts +18 -0
- package/dist/types/stories/icon.stories.d.ts.map +1 -0
- package/dist/types/stories/icon_example.d.ts +3 -0
- package/dist/types/stories/icon_example.d.ts.map +1 -0
- package/dist/types/stories/input.stories.d.ts +27 -0
- package/dist/types/stories/input.stories.d.ts.map +1 -0
- package/dist/types/stories/label.stories.d.ts +36 -0
- package/dist/types/stories/label.stories.d.ts.map +1 -0
- package/dist/types/stories/link.stories.d.ts +45 -0
- package/dist/types/stories/link.stories.d.ts.map +1 -0
- package/dist/types/stories/loader.stories.d.ts +21 -0
- package/dist/types/stories/loader.stories.d.ts.map +1 -0
- package/dist/types/stories/progress_bar.stories.d.ts +27 -0
- package/dist/types/stories/progress_bar.stories.d.ts.map +1 -0
- package/dist/types/stories/record_card.stories.d.ts +9 -0
- package/dist/types/stories/record_card.stories.d.ts.map +1 -0
- package/dist/types/stories/record_card_list.stories.d.ts +9 -0
- package/dist/types/stories/record_card_list.stories.d.ts.map +1 -0
- package/dist/types/stories/select.stories.d.ts +30 -0
- package/dist/types/stories/select.stories.d.ts.map +1 -0
- package/dist/types/stories/select_buttons.stories.d.ts +30 -0
- package/dist/types/stories/select_buttons.stories.d.ts.map +1 -0
- package/dist/types/stories/switch.stories.d.ts +48 -0
- package/dist/types/stories/switch.stories.d.ts.map +1 -0
- package/dist/types/stories/table_picker.stories.d.ts +12 -0
- package/dist/types/stories/table_picker.stories.d.ts.map +1 -0
- package/dist/types/stories/text.size.stories.d.ts +16 -0
- package/dist/types/stories/text.size.stories.d.ts.map +1 -0
- package/dist/types/stories/text.stories.d.ts +36 -0
- package/dist/types/stories/text.stories.d.ts.map +1 -0
- package/dist/types/stories/text_button.stories.d.ts +45 -0
- package/dist/types/stories/text_button.stories.d.ts.map +1 -0
- package/dist/types/stories/tooltip.stories.d.ts +10 -0
- package/dist/types/stories/tooltip.stories.d.ts.map +1 -0
- package/dist/types/stories/view_picker.stories.d.ts +12 -0
- package/dist/types/stories/view_picker.stories.d.ts.map +1 -0
- package/dist/types/test/airtable_interface_mocks/fixture_data.d.ts +122 -0
- package/dist/types/test/airtable_interface_mocks/fixture_data.d.ts.map +1 -0
- package/dist/types/test/airtable_interface_mocks/linked_records.d.ts +4 -0
- package/dist/types/test/airtable_interface_mocks/linked_records.d.ts.map +1 -0
- package/dist/types/test/airtable_interface_mocks/mock_airtable_interface.d.ts +60 -0
- package/dist/types/test/airtable_interface_mocks/mock_airtable_interface.d.ts.map +1 -0
- package/dist/types/test/airtable_interface_mocks/project_tracker.d.ts +4 -0
- package/dist/types/test/airtable_interface_mocks/project_tracker.d.ts.map +1 -0
- package/dist/types/test/error_utils.test.d.ts +2 -0
- package/dist/types/test/error_utils.test.d.ts.map +1 -0
- package/dist/types/test/get_style_props_for_responsive_prop.test.d.ts +2 -0
- package/dist/types/test/get_style_props_for_responsive_prop.test.d.ts.map +1 -0
- package/dist/types/test/index.test.d.ts +2 -0
- package/dist/types/test/index.test.d.ts.map +1 -0
- package/dist/types/test/models/base.test.d.ts +2 -0
- package/dist/types/test/models/base.test.d.ts.map +1 -0
- package/dist/types/test/models/cursor.test.d.ts +2 -0
- package/dist/types/test/models/cursor.test.d.ts.map +1 -0
- package/dist/types/test/models/field.test.d.ts +2 -0
- package/dist/types/test/models/field.test.d.ts.map +1 -0
- package/dist/types/test/models/linked_records_query_result.test.d.ts +2 -0
- package/dist/types/test/models/linked_records_query_result.test.d.ts.map +1 -0
- package/dist/types/test/models/mutations.test.d.ts +2 -0
- package/dist/types/test/models/mutations.test.d.ts.map +1 -0
- package/dist/types/test/models/object_pool.test.d.ts +2 -0
- package/dist/types/test/models/object_pool.test.d.ts.map +1 -0
- package/dist/types/test/models/record.test.d.ts +2 -0
- package/dist/types/test/models/record.test.d.ts.map +1 -0
- package/dist/types/test/models/session.test.d.ts +2 -0
- package/dist/types/test/models/session.test.d.ts.map +1 -0
- package/dist/types/test/models/table.test.d.ts +2 -0
- package/dist/types/test/models/table.test.d.ts.map +1 -0
- package/dist/types/test/models/table_mutations.test.d.ts +2 -0
- package/dist/types/test/models/table_mutations.test.d.ts.map +1 -0
- package/dist/types/test/models/table_or_view_query_result.test.d.ts +2 -0
- package/dist/types/test/models/table_or_view_query_result.test.d.ts.map +1 -0
- package/dist/types/test/models/view.test.d.ts +2 -0
- package/dist/types/test/models/view.test.d.ts.map +1 -0
- package/dist/types/test/models/view_metadata_query_result.test.d.ts +2 -0
- package/dist/types/test/models/view_metadata_query_result.test.d.ts.map +1 -0
- package/dist/types/test/private_utils.test.d.ts +2 -0
- package/dist/types/test/private_utils.test.d.ts.map +1 -0
- package/dist/types/test/sdk.test.d.ts +2 -0
- package/dist/types/test/sdk.test.d.ts.map +1 -0
- package/dist/types/test/setup_enzyme.d.ts +2 -0
- package/dist/types/test/setup_enzyme.d.ts.map +1 -0
- package/dist/types/test/test_helpers.d.ts +11 -0
- package/dist/types/test/test_helpers.d.ts.map +1 -0
- package/dist/types/test/ui/base_provider.test.d.ts +2 -0
- package/dist/types/test/ui/base_provider.test.d.ts.map +1 -0
- package/dist/types/test/ui/block_wrapper.test.d.ts +2 -0
- package/dist/types/test/ui/block_wrapper.test.d.ts.map +1 -0
- package/dist/types/test/ui/box.test.d.ts +2 -0
- package/dist/types/test/ui/box.test.d.ts.map +1 -0
- package/dist/types/test/ui/button.test.d.ts +2 -0
- package/dist/types/test/ui/button.test.d.ts.map +1 -0
- package/dist/types/test/ui/cell_renderer.test.d.ts +2 -0
- package/dist/types/test/ui/cell_renderer.test.d.ts.map +1 -0
- package/dist/types/test/ui/choice_token.test.d.ts +2 -0
- package/dist/types/test/ui/choice_token.test.d.ts.map +1 -0
- package/dist/types/test/ui/collaborator_token.test.d.ts +2 -0
- package/dist/types/test/ui/collaborator_token.test.d.ts.map +1 -0
- package/dist/types/test/ui/color_palette.test.d.ts +2 -0
- package/dist/types/test/ui/color_palette.test.d.ts.map +1 -0
- package/dist/types/test/ui/color_palette_synced.test.d.ts +2 -0
- package/dist/types/test/ui/color_palette_synced.test.d.ts.map +1 -0
- package/dist/types/test/ui/confirmation_dialog.test.d.ts +2 -0
- package/dist/types/test/ui/confirmation_dialog.test.d.ts.map +1 -0
- package/dist/types/test/ui/dialog.test.d.ts +2 -0
- package/dist/types/test/ui/dialog.test.d.ts.map +1 -0
- package/dist/types/test/ui/expand_record.test.d.ts +2 -0
- package/dist/types/test/ui/expand_record.test.d.ts.map +1 -0
- package/dist/types/test/ui/expand_record_list.test.d.ts +2 -0
- package/dist/types/test/ui/expand_record_list.test.d.ts.map +1 -0
- package/dist/types/test/ui/expand_record_picker_async.test.d.ts +2 -0
- package/dist/types/test/ui/expand_record_picker_async.test.d.ts.map +1 -0
- package/dist/types/test/ui/field_icon.test.d.ts +2 -0
- package/dist/types/test/ui/field_icon.test.d.ts.map +1 -0
- package/dist/types/test/ui/field_picker.test.d.ts +2 -0
- package/dist/types/test/ui/field_picker.test.d.ts.map +1 -0
- package/dist/types/test/ui/field_picker_synced.test.d.ts +2 -0
- package/dist/types/test/ui/field_picker_synced.test.d.ts.map +1 -0
- package/dist/types/test/ui/form_field.test.d.ts +2 -0
- package/dist/types/test/ui/form_field.test.d.ts.map +1 -0
- package/dist/types/test/ui/global_alert.test.d.ts +2 -0
- package/dist/types/test/ui/global_alert.test.d.ts.map +1 -0
- package/dist/types/test/ui/heading.test.d.ts +2 -0
- package/dist/types/test/ui/heading.test.d.ts.map +1 -0
- package/dist/types/test/ui/icon.test.d.ts +2 -0
- package/dist/types/test/ui/icon.test.d.ts.map +1 -0
- package/dist/types/test/ui/initialize_block.test.d.ts +2 -0
- package/dist/types/test/ui/initialize_block.test.d.ts.map +1 -0
- package/dist/types/test/ui/input.test.d.ts +2 -0
- package/dist/types/test/ui/input.test.d.ts.map +1 -0
- package/dist/types/test/ui/input_synced.test.d.ts +2 -0
- package/dist/types/test/ui/input_synced.test.d.ts.map +1 -0
- package/dist/types/test/ui/label.test.d.ts +2 -0
- package/dist/types/test/ui/label.test.d.ts.map +1 -0
- package/dist/types/test/ui/link.test.d.ts +2 -0
- package/dist/types/test/ui/link.test.d.ts.map +1 -0
- package/dist/types/test/ui/loader.test.d.ts +2 -0
- package/dist/types/test/ui/loader.test.d.ts.map +1 -0
- package/dist/types/test/ui/modal.test.d.ts +2 -0
- package/dist/types/test/ui/modal.test.d.ts.map +1 -0
- package/dist/types/test/ui/popover.test.d.ts +2 -0
- package/dist/types/test/ui/popover.test.d.ts.map +1 -0
- package/dist/types/test/ui/progress_bar.test.d.ts +2 -0
- package/dist/types/test/ui/progress_bar.test.d.ts.map +1 -0
- package/dist/types/test/ui/record_card.test.d.ts +2 -0
- package/dist/types/test/ui/record_card.test.d.ts.map +1 -0
- package/dist/types/test/ui/record_card_list.test.d.ts +2 -0
- package/dist/types/test/ui/record_card_list.test.d.ts.map +1 -0
- package/dist/types/test/ui/remote_utils.test.d.ts +2 -0
- package/dist/types/test/ui/remote_utils.test.d.ts.map +1 -0
- package/dist/types/test/ui/select.test.d.ts +2 -0
- package/dist/types/test/ui/select.test.d.ts.map +1 -0
- package/dist/types/test/ui/select_buttons.test.d.ts +2 -0
- package/dist/types/test/ui/select_buttons.test.d.ts.map +1 -0
- package/dist/types/test/ui/select_buttons_synced.test.d.ts +2 -0
- package/dist/types/test/ui/select_buttons_synced.test.d.ts.map +1 -0
- package/dist/types/test/ui/select_synced.test.d.ts +2 -0
- package/dist/types/test/ui/select_synced.test.d.ts.map +1 -0
- package/dist/types/test/ui/switch.test.d.ts +2 -0
- package/dist/types/test/ui/switch.test.d.ts.map +1 -0
- package/dist/types/test/ui/switch_synced.test.d.ts +2 -0
- package/dist/types/test/ui/switch_synced.test.d.ts.map +1 -0
- package/dist/types/test/ui/synced.test.d.ts +2 -0
- package/dist/types/test/ui/synced.test.d.ts.map +1 -0
- package/dist/types/test/ui/table_picker.test.d.ts +2 -0
- package/dist/types/test/ui/table_picker.test.d.ts.map +1 -0
- package/dist/types/test/ui/table_picker_synced.test.d.ts +2 -0
- package/dist/types/test/ui/table_picker_synced.test.d.ts.map +1 -0
- package/dist/types/test/ui/text.test.d.ts +2 -0
- package/dist/types/test/ui/text.test.d.ts.map +1 -0
- package/dist/types/test/ui/text_button.test.d.ts +2 -0
- package/dist/types/test/ui/text_button.test.d.ts.map +1 -0
- package/dist/types/test/ui/tooltip.test.d.ts +2 -0
- package/dist/types/test/ui/tooltip.test.d.ts.map +1 -0
- package/dist/types/test/ui/ui.test.d.ts +2 -0
- package/dist/types/test/ui/ui.test.d.ts.map +1 -0
- package/dist/types/test/ui/unstable_standalone_ui.test.d.ts +1 -0
- package/dist/types/test/ui/unstable_standalone_ui.test.d.ts.map +1 -0
- package/dist/types/test/ui/use_array_identity.test.d.ts +2 -0
- package/dist/types/test/ui/use_array_identity.test.d.ts.map +1 -0
- package/dist/types/test/ui/use_loadable.test.d.ts +2 -0
- package/dist/types/test/ui/use_loadable.test.d.ts.map +1 -0
- package/dist/types/test/ui/use_record_action_data.test.d.ts +2 -0
- package/dist/types/test/ui/use_record_action_data.test.d.ts.map +1 -0
- package/dist/types/test/ui/use_records.test.d.ts +2 -0
- package/dist/types/test/ui/use_records.test.d.ts.map +1 -0
- package/dist/types/test/ui/use_view_metadata.test.d.ts +2 -0
- package/dist/types/test/ui/use_view_metadata.test.d.ts.map +1 -0
- package/dist/types/test/ui/use_watchable.test.d.ts +2 -0
- package/dist/types/test/ui/use_watchable.test.d.ts.map +1 -0
- package/dist/types/test/ui/view_picker.test.d.ts +2 -0
- package/dist/types/test/ui/view_picker.test.d.ts.map +1 -0
- package/dist/types/test/ui/view_picker_synced.test.d.ts +2 -0
- package/dist/types/test/ui/view_picker_synced.test.d.ts.map +1 -0
- package/dist/types/test/ui/viewport_constraint.test.d.ts +2 -0
- package/dist/types/test/ui/viewport_constraint.test.d.ts.map +1 -0
- package/dist/types/test/unstable_private_utils.test.d.ts +1 -0
- package/dist/types/test/unstable_private_utils.test.d.ts.map +1 -0
- package/index.d.ts +14 -0
- package/models.d.ts +1 -0
- package/models.js +1 -0
- package/package.json +190 -0
- package/types/globals.d.ts +6 -0
- package/types/styled-system__core.d.ts +41 -0
- package/types/use-subscription.d.ts +6 -0
- package/types.d.ts +18 -0
- package/types.js +1 -0
- package/ui.d.ts +1 -0
- package/ui.js +1 -0
- package/unstable_private_utils.d.ts +1 -0
- package/unstable_private_utils.js +1 -0
- package/unstable_standalone_ui.d.ts +1 -0
- package/unstable_standalone_ui.js +1 -0
- package/unstable_testing_utils.d.ts +1 -0
- package/unstable_testing_utils.js +1 -0
|
@@ -0,0 +1,1737 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
require("core-js/modules/es.symbol.js");
|
|
4
|
+
require("core-js/modules/es.symbol.description.js");
|
|
5
|
+
require("core-js/modules/es.array.filter.js");
|
|
6
|
+
require("core-js/modules/es.array.from.js");
|
|
7
|
+
require("core-js/modules/es.array.iterator.js");
|
|
8
|
+
require("core-js/modules/es.array.slice.js");
|
|
9
|
+
require("core-js/modules/es.object.get-own-property-descriptors.js");
|
|
10
|
+
require("core-js/modules/es.regexp.exec.js");
|
|
11
|
+
require("core-js/modules/es.regexp.to-string.js");
|
|
12
|
+
require("core-js/modules/web.dom-collections.iterator.js");
|
|
13
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
14
|
+
Object.defineProperty(exports, "__esModule", {
|
|
15
|
+
value: true
|
|
16
|
+
});
|
|
17
|
+
exports.default = exports.WatchableTableKeys = void 0;
|
|
18
|
+
require("core-js/modules/es.array.find.js");
|
|
19
|
+
require("core-js/modules/es.array.includes.js");
|
|
20
|
+
require("core-js/modules/es.array.map.js");
|
|
21
|
+
require("core-js/modules/es.object.to-string.js");
|
|
22
|
+
require("core-js/modules/es.string.includes.js");
|
|
23
|
+
require("core-js/modules/web.dom-collections.for-each.js");
|
|
24
|
+
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
25
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
26
|
+
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
27
|
+
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
28
|
+
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
29
|
+
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
30
|
+
var _get2 = _interopRequireDefault(require("@babel/runtime/helpers/get"));
|
|
31
|
+
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
32
|
+
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
33
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
34
|
+
var _table_core = require("../../shared/models/table_core");
|
|
35
|
+
var _error_utils = require("../../shared/error_utils");
|
|
36
|
+
var _private_utils = require("../../shared/private_utils");
|
|
37
|
+
var _mutations = require("../types/mutations");
|
|
38
|
+
var _record_query_result = _interopRequireDefault(require("./record_query_result"));
|
|
39
|
+
var _field = _interopRequireDefault(require("./field"));
|
|
40
|
+
var _table_or_view_query_result = _interopRequireDefault(require("./table_or_view_query_result"));
|
|
41
|
+
var _view = _interopRequireDefault(require("./view"));
|
|
42
|
+
var _object_pool = _interopRequireDefault(require("./object_pool"));
|
|
43
|
+
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; } } }; }
|
|
44
|
+
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; } }
|
|
45
|
+
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; }
|
|
46
|
+
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)); }
|
|
47
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
48
|
+
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; }
|
|
49
|
+
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; } /** @module @airtable/blocks/models: Table */ /** */
|
|
50
|
+
// This doesn't follow our enum naming conventions because we want the keys
|
|
51
|
+
// to mirror the method/getter names on the model class.
|
|
52
|
+
var WatchableTableKeys = exports.WatchableTableKeys = Object.freeze(_objectSpread(_objectSpread({}, _table_core.WatchableTableKeysCore), {}, {
|
|
53
|
+
views: 'views'
|
|
54
|
+
}));
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* A key in {@link Table} that can be watched.
|
|
58
|
+
* - `name`
|
|
59
|
+
* - `description`
|
|
60
|
+
* - `fields`
|
|
61
|
+
* - `views`
|
|
62
|
+
*/
|
|
63
|
+
/**
|
|
64
|
+
* Model class representing a table. Every {@link Base} has one or more tables.
|
|
65
|
+
*
|
|
66
|
+
* @docsPath models/Table
|
|
67
|
+
*/
|
|
68
|
+
var Table = /*#__PURE__*/function (_TableCore) {
|
|
69
|
+
/** @internal */
|
|
70
|
+
function Table(parentBase, recordStore, tableId, sdk) {
|
|
71
|
+
var _this;
|
|
72
|
+
(0, _classCallCheck2.default)(this, Table);
|
|
73
|
+
_this = _callSuper(this, Table, [parentBase, recordStore, tableId, sdk]);
|
|
74
|
+
/** @internal */
|
|
75
|
+
(0, _defineProperty2.default)(_this, "_viewModelsById", void 0);
|
|
76
|
+
/** @internal */
|
|
77
|
+
(0, _defineProperty2.default)(_this, "__tableOrViewQueryResultPool", void 0);
|
|
78
|
+
_this._viewModelsById = {}; // View instances are lazily created by getViewById.
|
|
79
|
+
_this.__tableOrViewQueryResultPool = new _object_pool.default(_table_or_view_query_result.default);
|
|
80
|
+
return _this;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/** @internal */
|
|
84
|
+
(0, _inherits2.default)(Table, _TableCore);
|
|
85
|
+
return (0, _createClass2.default)(Table, [{
|
|
86
|
+
key: "_constructField",
|
|
87
|
+
value: function _constructField(fieldId) {
|
|
88
|
+
return new _field.default(this.parentBase.__sdk, this, fieldId);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* The URL for the table. You can visit this URL in the browser to be taken to the table in the Airtable UI.
|
|
93
|
+
*
|
|
94
|
+
* @example
|
|
95
|
+
* ```js
|
|
96
|
+
* console.log(myTable.url);
|
|
97
|
+
* // => 'https://airtable.com/appxxxxxxxxxxxxxx/tblxxxxxxxxxxxxxx'
|
|
98
|
+
* ```
|
|
99
|
+
*/
|
|
100
|
+
}, {
|
|
101
|
+
key: "url",
|
|
102
|
+
get: function get() {
|
|
103
|
+
return this._sdk.__airtableInterface.urlConstructor.getTableUrl(this.id);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
// Experimental, do not document yet. Allows fetching default cell values for
|
|
107
|
+
// a table or view. Before documenting, we should explore making this synchronous.
|
|
108
|
+
/**
|
|
109
|
+
* @internal
|
|
110
|
+
*/
|
|
111
|
+
// istanbul ignore next
|
|
112
|
+
}, {
|
|
113
|
+
key: "getDefaultCellValuesByFieldIdAsync",
|
|
114
|
+
value: function () {
|
|
115
|
+
var _getDefaultCellValuesByFieldIdAsync = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(opts) {
|
|
116
|
+
var viewId, cellValuesByFieldId;
|
|
117
|
+
return _regenerator.default.wrap(function _callee$(_context) {
|
|
118
|
+
while (1) switch (_context.prev = _context.next) {
|
|
119
|
+
case 0:
|
|
120
|
+
viewId = opts && opts.view ? opts.view.id : null;
|
|
121
|
+
_context.next = 3;
|
|
122
|
+
return this._sdk.__airtableInterface.fetchDefaultCellValuesByFieldIdAsync(this._id, viewId);
|
|
123
|
+
case 3:
|
|
124
|
+
cellValuesByFieldId = _context.sent;
|
|
125
|
+
return _context.abrupt("return", cellValuesByFieldId);
|
|
126
|
+
case 5:
|
|
127
|
+
case "end":
|
|
128
|
+
return _context.stop();
|
|
129
|
+
}
|
|
130
|
+
}, _callee, this);
|
|
131
|
+
}));
|
|
132
|
+
function getDefaultCellValuesByFieldIdAsync(_x) {
|
|
133
|
+
return _getDefaultCellValuesByFieldIdAsync.apply(this, arguments);
|
|
134
|
+
}
|
|
135
|
+
return getDefaultCellValuesByFieldIdAsync;
|
|
136
|
+
}()
|
|
137
|
+
/**
|
|
138
|
+
* The views in this table. Can be watched to know when views are created,
|
|
139
|
+
* deleted, or reordered.
|
|
140
|
+
*
|
|
141
|
+
* @example
|
|
142
|
+
* ```js
|
|
143
|
+
* console.log(`This table has ${myTable.views.length} views`);
|
|
144
|
+
* ```
|
|
145
|
+
*/
|
|
146
|
+
}, {
|
|
147
|
+
key: "views",
|
|
148
|
+
get: function get() {
|
|
149
|
+
// TODO(kasra): cache and freeze this so it isn't O(n)
|
|
150
|
+
var views = [];
|
|
151
|
+
this._data.viewOrder.forEach(viewId => {
|
|
152
|
+
var view = this.getViewById(viewId);
|
|
153
|
+
views.push(view);
|
|
154
|
+
});
|
|
155
|
+
return views;
|
|
156
|
+
}
|
|
157
|
+
/**
|
|
158
|
+
* Gets the view matching the given ID, or `null` if that view does not exist in this table.
|
|
159
|
+
*
|
|
160
|
+
* @param viewId The ID of the view.
|
|
161
|
+
* @example
|
|
162
|
+
* ```js
|
|
163
|
+
* const viewId = 'viwxxxxxxxxxxxxxx';
|
|
164
|
+
* const view = myTable.getViewByIdIfExists(viewId);
|
|
165
|
+
* if (view !== null) {
|
|
166
|
+
* console.log(view.name);
|
|
167
|
+
* } else {
|
|
168
|
+
* console.log('No view exists with that ID');
|
|
169
|
+
* }
|
|
170
|
+
* ```
|
|
171
|
+
*/
|
|
172
|
+
}, {
|
|
173
|
+
key: "getViewByIdIfExists",
|
|
174
|
+
value: function getViewByIdIfExists(viewId) {
|
|
175
|
+
if (!this._data.viewsById[viewId]) {
|
|
176
|
+
return null;
|
|
177
|
+
} else {
|
|
178
|
+
if (!this._viewModelsById[viewId]) {
|
|
179
|
+
this._viewModelsById[viewId] = new _view.default(this._sdk, this, this._recordStore.getViewDataStore(viewId), viewId);
|
|
180
|
+
}
|
|
181
|
+
return this._viewModelsById[viewId];
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
/**
|
|
185
|
+
* Gets the view matching the given ID. Throws if that view does not exist in this table. Use
|
|
186
|
+
* {@link getViewByIdIfExists} instead if you are unsure whether a view exists with the given
|
|
187
|
+
* ID.
|
|
188
|
+
*
|
|
189
|
+
* @param viewId The ID of the view.
|
|
190
|
+
* @example
|
|
191
|
+
* ```js
|
|
192
|
+
* const viewId = 'viwxxxxxxxxxxxxxx';
|
|
193
|
+
* const view = myTable.getViewById(viewId);
|
|
194
|
+
* console.log(view.name);
|
|
195
|
+
* // => 'Grid view'
|
|
196
|
+
* ```
|
|
197
|
+
*/
|
|
198
|
+
}, {
|
|
199
|
+
key: "getViewById",
|
|
200
|
+
value: function getViewById(viewId) {
|
|
201
|
+
var view = this.getViewByIdIfExists(viewId);
|
|
202
|
+
if (!view) {
|
|
203
|
+
throw (0, _error_utils.spawnError)("No view with ID %s in table '%s'", viewId, this.name);
|
|
204
|
+
}
|
|
205
|
+
return view;
|
|
206
|
+
}
|
|
207
|
+
/**
|
|
208
|
+
* Gets the view matching the given name, or `null` if no view exists with that name in this
|
|
209
|
+
* table.
|
|
210
|
+
*
|
|
211
|
+
* @param viewName The name of the view you're looking for.
|
|
212
|
+
* @example
|
|
213
|
+
* ```js
|
|
214
|
+
* const view = myTable.getViewByNameIfExists('Name');
|
|
215
|
+
* if (view !== null) {
|
|
216
|
+
* console.log(view.id);
|
|
217
|
+
* } else {
|
|
218
|
+
* console.log('No view exists with that name');
|
|
219
|
+
* }
|
|
220
|
+
* ```
|
|
221
|
+
*/
|
|
222
|
+
}, {
|
|
223
|
+
key: "getViewByNameIfExists",
|
|
224
|
+
value: function getViewByNameIfExists(viewName) {
|
|
225
|
+
var _iterator = _createForOfIteratorHelper((0, _private_utils.entries)(this._data.viewsById)),
|
|
226
|
+
_step;
|
|
227
|
+
try {
|
|
228
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
229
|
+
var _step$value = (0, _slicedToArray2.default)(_step.value, 2),
|
|
230
|
+
viewId = _step$value[0],
|
|
231
|
+
viewData = _step$value[1];
|
|
232
|
+
if (viewData.name === viewName) {
|
|
233
|
+
return this.getViewByIdIfExists(viewId);
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
} catch (err) {
|
|
237
|
+
_iterator.e(err);
|
|
238
|
+
} finally {
|
|
239
|
+
_iterator.f();
|
|
240
|
+
}
|
|
241
|
+
return null;
|
|
242
|
+
}
|
|
243
|
+
/**
|
|
244
|
+
* Gets the view matching the given name. Throws if no view exists with that name in this table.
|
|
245
|
+
* Use {@link getViewByNameIfExists} instead if you are unsure whether a view exists with the
|
|
246
|
+
* given name.
|
|
247
|
+
*
|
|
248
|
+
* @param viewName The name of the view you're looking for.
|
|
249
|
+
* @example
|
|
250
|
+
* ```js
|
|
251
|
+
* const view = myTable.getViewByName('Name');
|
|
252
|
+
* console.log(view.id);
|
|
253
|
+
* // => 'viwxxxxxxxxxxxxxx'
|
|
254
|
+
* ```
|
|
255
|
+
*/
|
|
256
|
+
}, {
|
|
257
|
+
key: "getViewByName",
|
|
258
|
+
value: function getViewByName(viewName) {
|
|
259
|
+
var view = this.getViewByNameIfExists(viewName);
|
|
260
|
+
if (!view) {
|
|
261
|
+
throw (0, _error_utils.spawnError)("No view named '%s' in table '%s'", viewName, this.name);
|
|
262
|
+
}
|
|
263
|
+
return view;
|
|
264
|
+
}
|
|
265
|
+
/**
|
|
266
|
+
* The view matching the given ID or name. Returns `null` if no matching view exists within
|
|
267
|
+
* this table.
|
|
268
|
+
*
|
|
269
|
+
* This method is convenient when building an extension for a specific base, but for more generic
|
|
270
|
+
* extensions the best practice is to use the {@link getViewByIdIfExists} or
|
|
271
|
+
* {@link getViewByNameIfExists} methods instead.
|
|
272
|
+
*
|
|
273
|
+
* @param viewIdOrName The ID or name of the view you're looking for.
|
|
274
|
+
*/
|
|
275
|
+
}, {
|
|
276
|
+
key: "getViewIfExists",
|
|
277
|
+
value: function getViewIfExists(viewIdOrName) {
|
|
278
|
+
var _this$getViewByIdIfEx;
|
|
279
|
+
return (_this$getViewByIdIfEx = this.getViewByIdIfExists(viewIdOrName)) !== null && _this$getViewByIdIfEx !== void 0 ? _this$getViewByIdIfEx : this.getViewByNameIfExists(viewIdOrName);
|
|
280
|
+
}
|
|
281
|
+
/**
|
|
282
|
+
* The view matching the given ID or name. Throws if no matching view exists within this table.
|
|
283
|
+
* Use {@link getViewIfExists} instead if you are unsure whether a view exists with the given
|
|
284
|
+
* name/ID.
|
|
285
|
+
*
|
|
286
|
+
* This method is convenient when building an extension for a specific base, but for more generic
|
|
287
|
+
* extensions the best practice is to use the {@link getViewById} or {@link getViewByName} methods
|
|
288
|
+
* instead.
|
|
289
|
+
*
|
|
290
|
+
* @param viewIdOrName The ID or name of the view you're looking for.
|
|
291
|
+
*/
|
|
292
|
+
}, {
|
|
293
|
+
key: "getView",
|
|
294
|
+
value: function getView(viewIdOrName) {
|
|
295
|
+
var view = this.getViewIfExists(viewIdOrName);
|
|
296
|
+
if (!view) {
|
|
297
|
+
throw (0, _error_utils.spawnError)("No view with ID or name '%s' in table '%s'", viewIdOrName, this.name);
|
|
298
|
+
}
|
|
299
|
+
return view;
|
|
300
|
+
}
|
|
301
|
+
/**
|
|
302
|
+
* Select records from the table. Returns a {@link RecordQueryResult}.
|
|
303
|
+
*
|
|
304
|
+
* Consider using {@link useRecords} or {@link useRecordIds} instead, unless you need the
|
|
305
|
+
* features of a QueryResult (e.g. `queryResult.getRecordById`). Record hooks handle
|
|
306
|
+
* loading/unloading and updating your UI automatically, but manually `select`ing records is
|
|
307
|
+
* useful for one-off data processing.
|
|
308
|
+
*
|
|
309
|
+
* @param opts Options for the query, such as sorts and fields.
|
|
310
|
+
* @example
|
|
311
|
+
* ```js
|
|
312
|
+
* import {useBase, useRecords} from '@airtable/blocks/ui';
|
|
313
|
+
* import React from 'react';
|
|
314
|
+
*
|
|
315
|
+
* function TodoList() {
|
|
316
|
+
* const base = useBase();
|
|
317
|
+
* const table = base.getTableByName('Tasks');
|
|
318
|
+
*
|
|
319
|
+
* const queryResult = table.selectRecords();
|
|
320
|
+
* const records = useRecords(queryResult);
|
|
321
|
+
*
|
|
322
|
+
* return (
|
|
323
|
+
* <ul>
|
|
324
|
+
* {records.map(record => (
|
|
325
|
+
* <li key={record.id}>
|
|
326
|
+
* {record.name || 'Unnamed record'}
|
|
327
|
+
* </li>
|
|
328
|
+
* ))}
|
|
329
|
+
* </ul>
|
|
330
|
+
* );
|
|
331
|
+
* }
|
|
332
|
+
* ```
|
|
333
|
+
*/
|
|
334
|
+
}, {
|
|
335
|
+
key: "selectRecords",
|
|
336
|
+
value: function selectRecords(opts) {
|
|
337
|
+
var normalizedOpts = _record_query_result.default._normalizeOpts(this, this._recordStore, opts || {});
|
|
338
|
+
return this.__tableOrViewQueryResultPool.getObjectForReuse(this._sdk, this, normalizedOpts);
|
|
339
|
+
}
|
|
340
|
+
/**
|
|
341
|
+
* Select and load records from the table. Returns a {@link RecordQueryResult} promise where
|
|
342
|
+
* record data has been loaded.
|
|
343
|
+
*
|
|
344
|
+
* Consider using {@link useRecords} or {@link useRecordIds} instead, unless you need the
|
|
345
|
+
* features of a QueryResult (e.g. `queryResult.getRecordById`). Record hooks handle
|
|
346
|
+
* loading/unloading and updating your UI automatically, but manually `select`ing records is
|
|
347
|
+
* useful for one-off data processing.
|
|
348
|
+
*
|
|
349
|
+
* Once you've finished with your query, remember to call `queryResult.unloadData()`.
|
|
350
|
+
*
|
|
351
|
+
* @param opts Options for the query, such as sorts and fields.
|
|
352
|
+
* @example
|
|
353
|
+
* ```js
|
|
354
|
+
* async function logRecordCountAsync(table) {
|
|
355
|
+
* const query = await table.selectRecordsAsync();
|
|
356
|
+
* console.log(query.recordIds.length);
|
|
357
|
+
* query.unloadData();
|
|
358
|
+
* }
|
|
359
|
+
* ```
|
|
360
|
+
*/
|
|
361
|
+
}, {
|
|
362
|
+
key: "selectRecordsAsync",
|
|
363
|
+
value: (function () {
|
|
364
|
+
var _selectRecordsAsync = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(opts) {
|
|
365
|
+
var queryResult;
|
|
366
|
+
return _regenerator.default.wrap(function _callee2$(_context2) {
|
|
367
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
368
|
+
case 0:
|
|
369
|
+
queryResult = this.selectRecords(opts);
|
|
370
|
+
_context2.next = 3;
|
|
371
|
+
return queryResult.loadDataAsync();
|
|
372
|
+
case 3:
|
|
373
|
+
return _context2.abrupt("return", queryResult);
|
|
374
|
+
case 4:
|
|
375
|
+
case "end":
|
|
376
|
+
return _context2.stop();
|
|
377
|
+
}
|
|
378
|
+
}, _callee2, this);
|
|
379
|
+
}));
|
|
380
|
+
function selectRecordsAsync(_x2) {
|
|
381
|
+
return _selectRecordsAsync.apply(this, arguments);
|
|
382
|
+
}
|
|
383
|
+
return selectRecordsAsync;
|
|
384
|
+
}()
|
|
385
|
+
/**
|
|
386
|
+
* Returns the first view in the table where the type is one of `allowedViewTypes`, or `null` if
|
|
387
|
+
* no such view exists in the table.
|
|
388
|
+
*
|
|
389
|
+
* @param allowedViewTypes An array of view types or a single view type to match against.
|
|
390
|
+
* @param preferredViewOrViewId If a view or view ID is supplied and that view exists & has the
|
|
391
|
+
* correct type, that view will be returned before checking the other views in the table.
|
|
392
|
+
* @example
|
|
393
|
+
* ```js
|
|
394
|
+
* import {ViewType} from '@airtable/blocks/models';
|
|
395
|
+
* const firstCalendarView = myTable.getFirstViewOfType(ViewType.CALENDAR);
|
|
396
|
+
* if (firstCalendarView !== null) {
|
|
397
|
+
* console.log(firstCalendarView.name);
|
|
398
|
+
* } else {
|
|
399
|
+
* console.log('No calendar views exist in the table');
|
|
400
|
+
* }
|
|
401
|
+
* ```
|
|
402
|
+
*/
|
|
403
|
+
)
|
|
404
|
+
}, {
|
|
405
|
+
key: "getFirstViewOfType",
|
|
406
|
+
value: function getFirstViewOfType(allowedViewTypes, preferredViewOrViewId) {
|
|
407
|
+
var _this$views$find;
|
|
408
|
+
if (!Array.isArray(allowedViewTypes)) {
|
|
409
|
+
allowedViewTypes = (0, _private_utils.cast)([allowedViewTypes]);
|
|
410
|
+
}
|
|
411
|
+
if (preferredViewOrViewId) {
|
|
412
|
+
var preferredView = this.getViewByIdIfExists(typeof preferredViewOrViewId === 'string' ? preferredViewOrViewId : preferredViewOrViewId.id);
|
|
413
|
+
if (preferredView && allowedViewTypes.includes(preferredView.type)) {
|
|
414
|
+
return preferredView;
|
|
415
|
+
}
|
|
416
|
+
}
|
|
417
|
+
return (_this$views$find = this.views.find(view => {
|
|
418
|
+
return allowedViewTypes.includes(view.type);
|
|
419
|
+
})) !== null && _this$views$find !== void 0 ? _this$views$find : null;
|
|
420
|
+
}
|
|
421
|
+
/**
|
|
422
|
+
* @internal
|
|
423
|
+
*/
|
|
424
|
+
}, {
|
|
425
|
+
key: "__getViewMatching",
|
|
426
|
+
value: function __getViewMatching(viewOrViewIdOrViewName) {
|
|
427
|
+
var view;
|
|
428
|
+
if (viewOrViewIdOrViewName instanceof _view.default) {
|
|
429
|
+
if (viewOrViewIdOrViewName.parentTable.id !== this.id) {
|
|
430
|
+
throw (0, _error_utils.spawnError)("View '%s' is from a different table than table '%s'", viewOrViewIdOrViewName.name, this.name);
|
|
431
|
+
}
|
|
432
|
+
view = viewOrViewIdOrViewName;
|
|
433
|
+
} else {
|
|
434
|
+
view = this.getViewByIdIfExists(viewOrViewIdOrViewName) || this.getViewByNameIfExists(viewOrViewIdOrViewName);
|
|
435
|
+
if (view === null) {
|
|
436
|
+
throw (0, _error_utils.spawnError)("View '%s' does not exist in table '%s'", viewOrViewIdOrViewName, this.name);
|
|
437
|
+
}
|
|
438
|
+
}
|
|
439
|
+
if (view.isDeleted) {
|
|
440
|
+
throw (0, _error_utils.spawnError)("View '%s' was deleted from table '%s'", view.name, this.name);
|
|
441
|
+
}
|
|
442
|
+
return view;
|
|
443
|
+
}
|
|
444
|
+
|
|
445
|
+
/**
|
|
446
|
+
* Checks whether the current user has permission to create a field in this table.
|
|
447
|
+
*
|
|
448
|
+
* Accepts partial input, in the same format as {@link createFieldAsync}.
|
|
449
|
+
*
|
|
450
|
+
* Returns `{hasPermission: true}` if the current user can update the specified record,
|
|
451
|
+
* `{hasPermission: false, reasonDisplayString: string}` otherwise. `reasonDisplayString` may be
|
|
452
|
+
* used to display an error message to the user.
|
|
453
|
+
*
|
|
454
|
+
* @param name name for the field. must be case-insensitive unique for the table
|
|
455
|
+
* @param type type for the field
|
|
456
|
+
* @param options options for the field. omit for fields without writable options
|
|
457
|
+
* @param description description for the field. omit to leave blank
|
|
458
|
+
*
|
|
459
|
+
* @example
|
|
460
|
+
* ```js
|
|
461
|
+
* const createFieldCheckResult = table.checkPermissionsForCreateField();
|
|
462
|
+
*
|
|
463
|
+
* if (!createFieldCheckResult.hasPermission) {
|
|
464
|
+
* alert(createFieldCheckResult.reasonDisplayString);
|
|
465
|
+
* }
|
|
466
|
+
* ```
|
|
467
|
+
*/
|
|
468
|
+
}, {
|
|
469
|
+
key: "checkPermissionsForCreateField",
|
|
470
|
+
value: function checkPermissionsForCreateField(name, type, options, description) {
|
|
471
|
+
return this._sdk.__mutations.checkPermissionsForMutation({
|
|
472
|
+
type: _mutations.MutationTypes.CREATE_SINGLE_FIELD,
|
|
473
|
+
tableId: this.id,
|
|
474
|
+
id: undefined,
|
|
475
|
+
// Generated in createFieldAsync.
|
|
476
|
+
name,
|
|
477
|
+
config: type ? _objectSpread({
|
|
478
|
+
type: type
|
|
479
|
+
}, options ? {
|
|
480
|
+
options
|
|
481
|
+
} : null) : undefined,
|
|
482
|
+
description
|
|
483
|
+
});
|
|
484
|
+
}
|
|
485
|
+
|
|
486
|
+
/**
|
|
487
|
+
* An alias for `checkPermissionsForCreateField(name, type, options, description).hasPermission`.
|
|
488
|
+
*
|
|
489
|
+
* Checks whether the current user has permission to create a field in this table.
|
|
490
|
+
*
|
|
491
|
+
* Accepts partial input, in the same format as {@link createFieldAsync}.
|
|
492
|
+
*
|
|
493
|
+
* @param name name for the field. must be case-insensitive unique for the table
|
|
494
|
+
* @param type type for the field
|
|
495
|
+
* @param options options for the field. omit for fields without writable options
|
|
496
|
+
* @param description description for the field. omit to leave blank
|
|
497
|
+
*
|
|
498
|
+
* @example
|
|
499
|
+
* ```js
|
|
500
|
+
* const canCreateField = table.hasPermissionToCreateField();
|
|
501
|
+
*
|
|
502
|
+
* if (!canCreateField) {
|
|
503
|
+
* alert('not allowed!');
|
|
504
|
+
* }
|
|
505
|
+
* ```
|
|
506
|
+
*/
|
|
507
|
+
}, {
|
|
508
|
+
key: "hasPermissionToCreateField",
|
|
509
|
+
value: function hasPermissionToCreateField(name, type, options, description) {
|
|
510
|
+
return this.checkPermissionsForCreateField(name, type, options, description).hasPermission;
|
|
511
|
+
}
|
|
512
|
+
|
|
513
|
+
/**
|
|
514
|
+
* Creates a new field.
|
|
515
|
+
*
|
|
516
|
+
* Similar to creating a field from the Airtable UI, the new field will not be visible
|
|
517
|
+
* in views that have other hidden fields and views that are publicly shared.
|
|
518
|
+
*
|
|
519
|
+
* Throws an error if the user does not have permission to create a field, if invalid
|
|
520
|
+
* name, type or options are provided, or if creating fields of this type is not supported.
|
|
521
|
+
*
|
|
522
|
+
* Refer to {@link FieldType} for supported field types, the write format for options, and
|
|
523
|
+
* other specifics for certain field types.
|
|
524
|
+
*
|
|
525
|
+
* This action is asynchronous. Unlike new records, new fields are **not** created
|
|
526
|
+
* optimistically locally. You must `await` the returned promise before using the new
|
|
527
|
+
* field in your extension.
|
|
528
|
+
*
|
|
529
|
+
* @param name name for the field. must be case-insensitive unique
|
|
530
|
+
* @param type type for the field
|
|
531
|
+
* @param options options for the field. omit for fields without writable options
|
|
532
|
+
* @param description description for the field. is optional and will be `''` if not specified
|
|
533
|
+
* or if specified as `null`.
|
|
534
|
+
*
|
|
535
|
+
* @example
|
|
536
|
+
* ```js
|
|
537
|
+
* async function createNewSingleLineTextField(table, name) {
|
|
538
|
+
* if (table.hasPermissionToCreateField(name, FieldType.SINGLE_LINE_TEXT)) {
|
|
539
|
+
* await table.createFieldAsync(name, FieldType.SINGLE_LINE_TEXT);
|
|
540
|
+
* }
|
|
541
|
+
* }
|
|
542
|
+
*
|
|
543
|
+
* async function createNewCheckboxField(table, name) {
|
|
544
|
+
* const options = {
|
|
545
|
+
* icon: 'check',
|
|
546
|
+
* color: 'greenBright',
|
|
547
|
+
* };
|
|
548
|
+
* if (table.hasPermissionToCreateField(name, FieldType.CHECKBOX, options)) {
|
|
549
|
+
* await table.createFieldAsync(name, FieldType.CHECKBOX, options);
|
|
550
|
+
* }
|
|
551
|
+
* }
|
|
552
|
+
*
|
|
553
|
+
* async function createNewDateField(table, name) {
|
|
554
|
+
* const options = {
|
|
555
|
+
* dateFormat: {
|
|
556
|
+
* name: 'iso',
|
|
557
|
+
* },
|
|
558
|
+
* };
|
|
559
|
+
* if (table.hasPermissionToCreateField(name, FieldType.DATE, options)) {
|
|
560
|
+
* await table.createFieldAsync(name, FieldType.DATE, options);
|
|
561
|
+
* }
|
|
562
|
+
* }
|
|
563
|
+
* ```
|
|
564
|
+
*/
|
|
565
|
+
}, {
|
|
566
|
+
key: "createFieldAsync",
|
|
567
|
+
value: (function () {
|
|
568
|
+
var _createFieldAsync = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3(name, type, options, description) {
|
|
569
|
+
var fieldId;
|
|
570
|
+
return _regenerator.default.wrap(function _callee3$(_context3) {
|
|
571
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
572
|
+
case 0:
|
|
573
|
+
fieldId = this._sdk.__airtableInterface.idGenerator.generateFieldId();
|
|
574
|
+
_context3.next = 3;
|
|
575
|
+
return this._sdk.__mutations.applyMutationAsync({
|
|
576
|
+
type: _mutations.MutationTypes.CREATE_SINGLE_FIELD,
|
|
577
|
+
tableId: this.id,
|
|
578
|
+
id: fieldId,
|
|
579
|
+
name,
|
|
580
|
+
config: _objectSpread({
|
|
581
|
+
type: type
|
|
582
|
+
}, options ? {
|
|
583
|
+
options
|
|
584
|
+
} : null),
|
|
585
|
+
// Coerce undefined to null so that only old SDKs pass "undefined" for description
|
|
586
|
+
// '' is permitted, as we already set empty descriptions to '' when editing descriptions
|
|
587
|
+
// from the UI
|
|
588
|
+
description: description !== null && description !== void 0 ? description : null
|
|
589
|
+
});
|
|
590
|
+
case 3:
|
|
591
|
+
return _context3.abrupt("return", this.getFieldById(fieldId));
|
|
592
|
+
case 4:
|
|
593
|
+
case "end":
|
|
594
|
+
return _context3.stop();
|
|
595
|
+
}
|
|
596
|
+
}, _callee3, this);
|
|
597
|
+
}));
|
|
598
|
+
function createFieldAsync(_x3, _x4, _x5, _x6) {
|
|
599
|
+
return _createFieldAsync.apply(this, arguments);
|
|
600
|
+
}
|
|
601
|
+
return createFieldAsync;
|
|
602
|
+
}()
|
|
603
|
+
/**
|
|
604
|
+
* Updates cell values for a record.
|
|
605
|
+
*
|
|
606
|
+
* Throws an error if the user does not have permission to update the given cell values in
|
|
607
|
+
* the record, or if invalid input is provided (eg. invalid cell values).
|
|
608
|
+
*
|
|
609
|
+
* Refer to {@link FieldType} for cell value write formats.
|
|
610
|
+
*
|
|
611
|
+
* This action is asynchronous: `await` the returned promise if you wish to wait for the updated
|
|
612
|
+
* cell values to be persisted to Airtable servers.
|
|
613
|
+
* Updates are applied optimistically locally, so your changes will be reflected in your extension
|
|
614
|
+
* before the promise resolves.
|
|
615
|
+
*
|
|
616
|
+
* @param recordOrRecordId the record to update
|
|
617
|
+
* @param fields cell values to update in that record, specified as object mapping `FieldId` or field name to value for that field.
|
|
618
|
+
* @example
|
|
619
|
+
* ```js
|
|
620
|
+
* function updateRecord(record, recordFields) {
|
|
621
|
+
* if (table.hasPermissionToUpdateRecord(record, recordFields)) {
|
|
622
|
+
* table.updateRecordAsync(record, recordFields);
|
|
623
|
+
* }
|
|
624
|
+
* // The updated values will now show in your extension (eg in
|
|
625
|
+
* // `table.selectRecords()` result) but are still being saved to Airtable
|
|
626
|
+
* // servers (e.g. other users may not be able to see them yet).
|
|
627
|
+
* }
|
|
628
|
+
*
|
|
629
|
+
* async function updateRecordAsync(record, recordFields) {
|
|
630
|
+
* if (table.hasPermissionToUpdateRecord(record, recordFields)) {
|
|
631
|
+
* await table.updateRecordAsync(record, recordFields);
|
|
632
|
+
* }
|
|
633
|
+
* // New record has been saved to Airtable servers.
|
|
634
|
+
* alert(`record with ID ${record.id} has been updated`);
|
|
635
|
+
* }
|
|
636
|
+
*
|
|
637
|
+
* // Fields can be specified by name or ID
|
|
638
|
+
* updateRecord(record1, {
|
|
639
|
+
* 'Post Title': 'How to make: orange-mango pound cake',
|
|
640
|
+
* 'Publication Date': '2020-01-01',
|
|
641
|
+
* });
|
|
642
|
+
* updateRecord(record2, {
|
|
643
|
+
* [postTitleField.id]: 'Cake decorating tips & tricks',
|
|
644
|
+
* [publicationDateField.id]: '2020-02-02',
|
|
645
|
+
* });
|
|
646
|
+
*
|
|
647
|
+
* // Cell values should generally have format matching the output of
|
|
648
|
+
* // record.getCellValue() for the field being updated
|
|
649
|
+
* updateRecord(record1, {
|
|
650
|
+
* 'Category (single select)': {name: 'Recipe'},
|
|
651
|
+
* 'Tags (multiple select)': [{name: 'Desserts'}, {id: 'someChoiceId'}],
|
|
652
|
+
* 'Images (attachment)': [{url: 'http://mywebsite.com/cake.png'}],
|
|
653
|
+
* 'Related posts (linked records)': [{id: 'someRecordId'}],
|
|
654
|
+
* });
|
|
655
|
+
* ```
|
|
656
|
+
*/
|
|
657
|
+
)
|
|
658
|
+
}, {
|
|
659
|
+
key: "updateRecordAsync",
|
|
660
|
+
value: (function () {
|
|
661
|
+
var _updateRecordAsync = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee4(recordOrRecordId, fields) {
|
|
662
|
+
var recordId;
|
|
663
|
+
return _regenerator.default.wrap(function _callee4$(_context4) {
|
|
664
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
665
|
+
case 0:
|
|
666
|
+
recordId = typeof recordOrRecordId === 'string' ? recordOrRecordId : recordOrRecordId.id;
|
|
667
|
+
_context4.next = 3;
|
|
668
|
+
return this.updateRecordsAsync([{
|
|
669
|
+
id: recordId,
|
|
670
|
+
fields
|
|
671
|
+
}]);
|
|
672
|
+
case 3:
|
|
673
|
+
case "end":
|
|
674
|
+
return _context4.stop();
|
|
675
|
+
}
|
|
676
|
+
}, _callee4, this);
|
|
677
|
+
}));
|
|
678
|
+
function updateRecordAsync(_x7, _x8) {
|
|
679
|
+
return _updateRecordAsync.apply(this, arguments);
|
|
680
|
+
}
|
|
681
|
+
return updateRecordAsync;
|
|
682
|
+
}()
|
|
683
|
+
/**
|
|
684
|
+
* Checks whether the current user has permission to perform the given record update.
|
|
685
|
+
*
|
|
686
|
+
* Accepts partial input, in the same format as {@link updateRecordAsync}.
|
|
687
|
+
* The more information provided, the more accurate the permissions check will be.
|
|
688
|
+
*
|
|
689
|
+
* Returns `{hasPermission: true}` if the current user can update the specified record,
|
|
690
|
+
* `{hasPermission: false, reasonDisplayString: string}` otherwise. `reasonDisplayString` may be
|
|
691
|
+
* used to display an error message to the user.
|
|
692
|
+
*
|
|
693
|
+
* @param recordOrRecordId the record to update
|
|
694
|
+
* @param fields cell values to update in that record, specified as object mapping `FieldId` or field name to value for that field.
|
|
695
|
+
* @example
|
|
696
|
+
* ```js
|
|
697
|
+
* // Check if user can update specific fields for a specific record.
|
|
698
|
+
* const updateRecordCheckResult =
|
|
699
|
+
* table.checkPermissionsForUpdateRecord(record, {
|
|
700
|
+
* 'Post Title': 'How to make: orange-mango pound cake',
|
|
701
|
+
* 'Publication Date': '2020-01-01',
|
|
702
|
+
* });
|
|
703
|
+
* if (!updateRecordCheckResult.hasPermission) {
|
|
704
|
+
* alert(updateRecordCheckResult.reasonDisplayString);
|
|
705
|
+
* }
|
|
706
|
+
*
|
|
707
|
+
* // Like updateRecordAsync, you can use either field names or field IDs.
|
|
708
|
+
* const updateRecordCheckResultWithFieldIds =
|
|
709
|
+
* table.checkPermissionsForUpdateRecord(record, {
|
|
710
|
+
* [postTitleField.id]: 'Cake decorating tips & tricks',
|
|
711
|
+
* [publicationDateField.id]: '2020-02-02',
|
|
712
|
+
* });
|
|
713
|
+
*
|
|
714
|
+
* // Check if user could update a given record, when you don't know the
|
|
715
|
+
* // specific fields that will be updated yet (e.g. to check whether you should
|
|
716
|
+
* // allow a user to select a certain record to update).
|
|
717
|
+
* const updateUnknownFieldsCheckResult =
|
|
718
|
+
* table.checkPermissionsForUpdateRecord(record);
|
|
719
|
+
*
|
|
720
|
+
* // Check if user could update specific fields, when you don't know the
|
|
721
|
+
* // specific record that will be updated yet. (for example, if the field is
|
|
722
|
+
* // selected by the user and you want to check if your extension can write to it).
|
|
723
|
+
* const updateUnknownRecordCheckResult =
|
|
724
|
+
* table.checkPermissionsForUpdateRecord(undefined, {
|
|
725
|
+
* 'My field name': 'updated value',
|
|
726
|
+
* // You can use undefined if you know you're going to update a field,
|
|
727
|
+
* // but don't know the new cell value yet.
|
|
728
|
+
* 'Another field name': undefined,
|
|
729
|
+
* });
|
|
730
|
+
*
|
|
731
|
+
* // Check if user could perform updates within the table, without knowing the
|
|
732
|
+
* // specific record or fields that will be updated yet (e.g., to render your
|
|
733
|
+
* // extension in "read only" mode).
|
|
734
|
+
* const updateUnknownRecordAndFieldsCheckResult =
|
|
735
|
+
* table.checkPermissionsForUpdateRecord();
|
|
736
|
+
* ```
|
|
737
|
+
*/
|
|
738
|
+
)
|
|
739
|
+
}, {
|
|
740
|
+
key: "checkPermissionsForUpdateRecord",
|
|
741
|
+
value: function checkPermissionsForUpdateRecord(recordOrRecordId, fields) {
|
|
742
|
+
var recordId = typeof recordOrRecordId === 'object' && recordOrRecordId !== null ? recordOrRecordId.id : recordOrRecordId;
|
|
743
|
+
return this.checkPermissionsForUpdateRecords([{
|
|
744
|
+
id: recordId,
|
|
745
|
+
fields
|
|
746
|
+
}]);
|
|
747
|
+
}
|
|
748
|
+
/**
|
|
749
|
+
* An alias for `checkPermissionsForUpdateRecord(recordOrRecordId, fields).hasPermission`.
|
|
750
|
+
*
|
|
751
|
+
* Checks whether the current user has permission to perform the given record update.
|
|
752
|
+
*
|
|
753
|
+
* Accepts partial input, in the same format as {@link updateRecordAsync}.
|
|
754
|
+
* The more information provided, the more accurate the permissions check will be.
|
|
755
|
+
*
|
|
756
|
+
* @param recordOrRecordId the record to update
|
|
757
|
+
* @param fields cell values to update in that record, specified as object mapping `FieldId` or field name to value for that field.
|
|
758
|
+
* @example
|
|
759
|
+
* ```js
|
|
760
|
+
* // Check if user can update specific fields for a specific record.
|
|
761
|
+
* const canUpdateRecord = table.hasPermissionToUpdateRecord(record, {
|
|
762
|
+
* 'Post Title': 'How to make: orange-mango pound cake',
|
|
763
|
+
* 'Publication Date': '2020-01-01',
|
|
764
|
+
* });
|
|
765
|
+
* if (!canUpdateRecord) {
|
|
766
|
+
* alert('not allowed!');
|
|
767
|
+
* }
|
|
768
|
+
*
|
|
769
|
+
* // Like updateRecordAsync, you can use either field names or field IDs.
|
|
770
|
+
* const canUpdateRecordWithFieldIds =
|
|
771
|
+
* table.hasPermissionToUpdateRecord(record, {
|
|
772
|
+
* [postTitleField.id]: 'Cake decorating tips & tricks',
|
|
773
|
+
* [publicationDateField.id]: '2020-02-02',
|
|
774
|
+
* });
|
|
775
|
+
*
|
|
776
|
+
* // Check if user could update a given record, when you don't know the
|
|
777
|
+
* // specific fields that will be updated yet (e.g. to check whether you should
|
|
778
|
+
* // allow a user to select a certain record to update).
|
|
779
|
+
* const canUpdateUnknownFields = table.hasPermissionToUpdateRecord(record);
|
|
780
|
+
*
|
|
781
|
+
* // Check if user could update specific fields, when you don't know the
|
|
782
|
+
* // specific record that will be updated yet (e.g. if the field is selected
|
|
783
|
+
* // by the user and you want to check if your extension can write to it).
|
|
784
|
+
* const canUpdateUnknownRecord =
|
|
785
|
+
* table.hasPermissionToUpdateRecord(undefined, {
|
|
786
|
+
* 'My field name': 'updated value',
|
|
787
|
+
* // You can use undefined if you know you're going to update a field,
|
|
788
|
+
* // but don't know the new cell value yet.
|
|
789
|
+
* 'Another field name': undefined,
|
|
790
|
+
* });
|
|
791
|
+
*
|
|
792
|
+
* // Check if user could perform updates within the table, without knowing the
|
|
793
|
+
* // specific record or fields that will be updated yet. (for example, to
|
|
794
|
+
* // render your extension in "read only" mode)
|
|
795
|
+
* const canUpdateUnknownRecordAndFields = table.hasPermissionToUpdateRecord();
|
|
796
|
+
* ```
|
|
797
|
+
*/
|
|
798
|
+
}, {
|
|
799
|
+
key: "hasPermissionToUpdateRecord",
|
|
800
|
+
value: function hasPermissionToUpdateRecord(recordOrRecordId, fields) {
|
|
801
|
+
return this.checkPermissionsForUpdateRecord(recordOrRecordId, fields).hasPermission;
|
|
802
|
+
}
|
|
803
|
+
/**
|
|
804
|
+
* Updates cell values for records.
|
|
805
|
+
*
|
|
806
|
+
* Throws an error if the user does not have permission to update the given cell values in
|
|
807
|
+
* the records, or if invalid input is provided (eg. invalid cell values).
|
|
808
|
+
*
|
|
809
|
+
* Refer to {@link FieldType} for cell value write formats.
|
|
810
|
+
*
|
|
811
|
+
* You may only update up to 50 records in one call to `updateRecordsAsync`.
|
|
812
|
+
* See [Write back to Airtable](/guides/write-back-to-airtable) for more information
|
|
813
|
+
* about write limits.
|
|
814
|
+
*
|
|
815
|
+
* This action is asynchronous: `await` the returned promise if you wish to wait for the
|
|
816
|
+
* updates to be persisted to Airtable servers.
|
|
817
|
+
* Updates are applied optimistically locally, so your changes will be reflected in your extension
|
|
818
|
+
* before the promise resolves.
|
|
819
|
+
*
|
|
820
|
+
* @param records Array of objects containing recordId and fields/cellValues to update for that record (specified as an object mapping `FieldId` or field name to cell value)
|
|
821
|
+
* @example
|
|
822
|
+
* ```js
|
|
823
|
+
* const recordsToUpdate = [
|
|
824
|
+
* // Fields can be specified by name or ID
|
|
825
|
+
* {
|
|
826
|
+
* id: record1.id,
|
|
827
|
+
* fields: {
|
|
828
|
+
* 'Post Title': 'How to make: orange-mango pound cake',
|
|
829
|
+
* 'Publication Date': '2020-01-01',
|
|
830
|
+
* },
|
|
831
|
+
* },
|
|
832
|
+
* {
|
|
833
|
+
* id: record2.id,
|
|
834
|
+
* fields: {
|
|
835
|
+
* // Sets the cell values to be empty.
|
|
836
|
+
* 'Post Title': '',
|
|
837
|
+
* 'Publication Date': '',
|
|
838
|
+
* },
|
|
839
|
+
* },
|
|
840
|
+
* {
|
|
841
|
+
* id: record3.id,
|
|
842
|
+
* fields: {
|
|
843
|
+
* [postTitleField.id]: 'Cake decorating tips & tricks',
|
|
844
|
+
* [publicationDateField.id]: '2020-02-02',
|
|
845
|
+
* },
|
|
846
|
+
* },
|
|
847
|
+
* // Cell values should generally have format matching the output of
|
|
848
|
+
* // record.getCellValue() for the field being updated
|
|
849
|
+
* {
|
|
850
|
+
* id: record4.id,
|
|
851
|
+
* fields: {
|
|
852
|
+
* 'Category (single select)': {name: 'Recipe'},
|
|
853
|
+
* 'Tags (multiple select)': [{name: 'Desserts'}, {id: 'choiceId'}],
|
|
854
|
+
* 'Images (attachment)': [{url: 'http://mywebsite.com/cake.png'}],
|
|
855
|
+
* 'Related posts (linked records)': [{id: 'someRecordId'}],
|
|
856
|
+
* },
|
|
857
|
+
* },
|
|
858
|
+
* ];
|
|
859
|
+
*
|
|
860
|
+
* function updateRecords() {
|
|
861
|
+
* if (table.hasPermissionToUpdateRecords(recordsToUpdate)) {
|
|
862
|
+
* table.updateRecordsAsync(recordsToUpdate);
|
|
863
|
+
* }
|
|
864
|
+
* // The records are now updated within your extension (eg will be reflected in
|
|
865
|
+
* // `table.selectRecords()`) but are still being saved to Airtable servers
|
|
866
|
+
* // (e.g. they may not be updated for other users yet).
|
|
867
|
+
* }
|
|
868
|
+
*
|
|
869
|
+
* async function updateRecordsAsync() {
|
|
870
|
+
* if (table.hasPermissionToUpdateRecords(recordsToUpdate)) {
|
|
871
|
+
* await table.updateRecordsAsync(recordsToUpdate);
|
|
872
|
+
* }
|
|
873
|
+
* // Record updates have been saved to Airtable servers.
|
|
874
|
+
* alert('records have been updated');
|
|
875
|
+
* }
|
|
876
|
+
* ```
|
|
877
|
+
*/
|
|
878
|
+
}, {
|
|
879
|
+
key: "updateRecordsAsync",
|
|
880
|
+
value: (function () {
|
|
881
|
+
var _updateRecordsAsync = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee5(records) {
|
|
882
|
+
var recordsWithCellValuesByFieldId;
|
|
883
|
+
return _regenerator.default.wrap(function _callee5$(_context5) {
|
|
884
|
+
while (1) switch (_context5.prev = _context5.next) {
|
|
885
|
+
case 0:
|
|
886
|
+
recordsWithCellValuesByFieldId = records.map(record => ({
|
|
887
|
+
id: record.id,
|
|
888
|
+
cellValuesByFieldId: this._cellValuesByFieldIdOrNameToCellValuesByFieldId(record.fields)
|
|
889
|
+
}));
|
|
890
|
+
_context5.next = 3;
|
|
891
|
+
return this._sdk.__mutations.applyMutationAsync({
|
|
892
|
+
type: _mutations.MutationTypes.SET_MULTIPLE_RECORDS_CELL_VALUES,
|
|
893
|
+
tableId: this.id,
|
|
894
|
+
records: recordsWithCellValuesByFieldId,
|
|
895
|
+
opts: {
|
|
896
|
+
parseDateCellValueInColumnTimeZone: true
|
|
897
|
+
}
|
|
898
|
+
});
|
|
899
|
+
case 3:
|
|
900
|
+
case "end":
|
|
901
|
+
return _context5.stop();
|
|
902
|
+
}
|
|
903
|
+
}, _callee5, this);
|
|
904
|
+
}));
|
|
905
|
+
function updateRecordsAsync(_x9) {
|
|
906
|
+
return _updateRecordsAsync.apply(this, arguments);
|
|
907
|
+
}
|
|
908
|
+
return updateRecordsAsync;
|
|
909
|
+
}()
|
|
910
|
+
/**
|
|
911
|
+
* Checks whether the current user has permission to perform the given record updates.
|
|
912
|
+
*
|
|
913
|
+
* Accepts partial input, in the same format as {@link updateRecordsAsync}.
|
|
914
|
+
* The more information provided, the more accurate the permissions check will be.
|
|
915
|
+
*
|
|
916
|
+
* Returns `{hasPermission: true}` if the current user can update the specified records,
|
|
917
|
+
* `{hasPermission: false, reasonDisplayString: string}` otherwise. `reasonDisplayString` may be
|
|
918
|
+
* used to display an error message to the user.
|
|
919
|
+
*
|
|
920
|
+
* @param records Array of objects containing recordId and fields/cellValues to update for that record (specified as an object mapping `FieldId` or field name to cell value)
|
|
921
|
+
* @example
|
|
922
|
+
* ```js
|
|
923
|
+
* const recordsToUpdate = [
|
|
924
|
+
* {
|
|
925
|
+
* // Validating a complete record update
|
|
926
|
+
* id: record1.id,
|
|
927
|
+
* fields: {
|
|
928
|
+
* 'Post Title': 'How to make: orange-mango pound cake',
|
|
929
|
+
* 'Publication Date': '2020-01-01',
|
|
930
|
+
* },
|
|
931
|
+
* },
|
|
932
|
+
* {
|
|
933
|
+
* // Like updateRecordsAsync, fields can be specified by name or ID
|
|
934
|
+
* id: record2.id,
|
|
935
|
+
* fields: {
|
|
936
|
+
* [postTitleField.id]: 'Cake decorating tips & tricks',
|
|
937
|
+
* [publicationDateField.id]: '2020-02-02',
|
|
938
|
+
* },
|
|
939
|
+
* },
|
|
940
|
+
* {
|
|
941
|
+
* // Validating an update to a specific record, not knowing what
|
|
942
|
+
* // fields will be updated
|
|
943
|
+
* id: record3.id,
|
|
944
|
+
* },
|
|
945
|
+
* {
|
|
946
|
+
* // Validating an update to specific cell values, not knowing what
|
|
947
|
+
* // record will be updated
|
|
948
|
+
* fields: {
|
|
949
|
+
* 'My field name': 'updated value for unknown record',
|
|
950
|
+
* // You can use undefined if you know you're going to update a
|
|
951
|
+
* // field, but don't know the new cell value yet.
|
|
952
|
+
* 'Another field name': undefined,
|
|
953
|
+
* },
|
|
954
|
+
* },
|
|
955
|
+
* ];
|
|
956
|
+
*
|
|
957
|
+
* const updateRecordsCheckResult =
|
|
958
|
+
* table.checkPermissionsForUpdateRecords(recordsToUpdate);
|
|
959
|
+
* if (!updateRecordsCheckResult.hasPermission) {
|
|
960
|
+
* alert(updateRecordsCheckResult.reasonDisplayString);
|
|
961
|
+
* }
|
|
962
|
+
*
|
|
963
|
+
* // Check if user could potentially update records.
|
|
964
|
+
* // Equivalent to table.checkPermissionsForUpdateRecord()
|
|
965
|
+
* const updateUnknownRecordAndFieldsCheckResult =
|
|
966
|
+
* table.checkPermissionsForUpdateRecords();
|
|
967
|
+
* ```
|
|
968
|
+
*/
|
|
969
|
+
)
|
|
970
|
+
}, {
|
|
971
|
+
key: "checkPermissionsForUpdateRecords",
|
|
972
|
+
value: function checkPermissionsForUpdateRecords(records) {
|
|
973
|
+
return this._sdk.__mutations.checkPermissionsForMutation({
|
|
974
|
+
type: _mutations.MutationTypes.SET_MULTIPLE_RECORDS_CELL_VALUES,
|
|
975
|
+
tableId: this.id,
|
|
976
|
+
records: records ? records.map(record => ({
|
|
977
|
+
id: record.id || undefined,
|
|
978
|
+
cellValuesByFieldId: record.fields ? this._cellValuesByFieldIdOrNameToCellValuesByFieldId(record.fields) : undefined
|
|
979
|
+
})) : undefined
|
|
980
|
+
});
|
|
981
|
+
}
|
|
982
|
+
/**
|
|
983
|
+
* An alias for `checkPermissionsForUpdateRecords(records).hasPermission`.
|
|
984
|
+
*
|
|
985
|
+
* Checks whether the current user has permission to perform the given record updates.
|
|
986
|
+
*
|
|
987
|
+
* Accepts partial input, in the same format as {@link updateRecordsAsync}.
|
|
988
|
+
* The more information provided, the more accurate the permissions check will be.
|
|
989
|
+
*
|
|
990
|
+
* @param records Array of objects containing recordId and fields/cellValues to update for that record (specified as an object mapping `FieldId` or field name to cell value)
|
|
991
|
+
* @example
|
|
992
|
+
* ```js
|
|
993
|
+
* const recordsToUpdate = [
|
|
994
|
+
* {
|
|
995
|
+
* // Validating a complete record update
|
|
996
|
+
* id: record1.id,
|
|
997
|
+
* fields: {
|
|
998
|
+
* 'Post Title': 'How to make: orange-mango pound cake',
|
|
999
|
+
* 'Publication Date': '2020-01-01',
|
|
1000
|
+
* },
|
|
1001
|
+
* },
|
|
1002
|
+
* {
|
|
1003
|
+
* // Like updateRecordsAsync, fields can be specified by name or ID
|
|
1004
|
+
* id: record2.id,
|
|
1005
|
+
* fields: {
|
|
1006
|
+
* [postTitleField.id]: 'Cake decorating tips & tricks',
|
|
1007
|
+
* [publicationDateField.id]: '2020-02-02',
|
|
1008
|
+
* },
|
|
1009
|
+
* },
|
|
1010
|
+
* {
|
|
1011
|
+
* // Validating an update to a specific record, not knowing what
|
|
1012
|
+
* // fields will be updated
|
|
1013
|
+
* id: record3.id,
|
|
1014
|
+
* },
|
|
1015
|
+
* {
|
|
1016
|
+
* // Validating an update to specific cell values, not knowing what
|
|
1017
|
+
* // record will be updated
|
|
1018
|
+
* fields: {
|
|
1019
|
+
* 'My field name': 'updated value for unknown record',
|
|
1020
|
+
* // You can use undefined if you know you're going to update a
|
|
1021
|
+
* // field, but don't know the new cell value yet.
|
|
1022
|
+
* 'Another field name': undefined,
|
|
1023
|
+
* },
|
|
1024
|
+
* },
|
|
1025
|
+
* ];
|
|
1026
|
+
*
|
|
1027
|
+
* const canUpdateRecords = table.hasPermissionToUpdateRecords(recordsToUpdate);
|
|
1028
|
+
* if (!canUpdateRecords) {
|
|
1029
|
+
* alert('not allowed');
|
|
1030
|
+
* }
|
|
1031
|
+
*
|
|
1032
|
+
* // Check if user could potentially update records.
|
|
1033
|
+
* // Equivalent to table.hasPermissionToUpdateRecord()
|
|
1034
|
+
* const canUpdateUnknownRecordsAndFields =
|
|
1035
|
+
* table.hasPermissionToUpdateRecords();
|
|
1036
|
+
* ```
|
|
1037
|
+
*/
|
|
1038
|
+
}, {
|
|
1039
|
+
key: "hasPermissionToUpdateRecords",
|
|
1040
|
+
value: function hasPermissionToUpdateRecords(records) {
|
|
1041
|
+
return this.checkPermissionsForUpdateRecords(records).hasPermission;
|
|
1042
|
+
}
|
|
1043
|
+
/**
|
|
1044
|
+
* Delete the given record.
|
|
1045
|
+
*
|
|
1046
|
+
* Throws an error if the user does not have permission to delete the given record.
|
|
1047
|
+
*
|
|
1048
|
+
* This action is asynchronous: `await` the returned promise if you wish to wait for the
|
|
1049
|
+
* delete to be persisted to Airtable servers.
|
|
1050
|
+
* Updates are applied optimistically locally, so your changes will be reflected in your extension
|
|
1051
|
+
* before the promise resolves.
|
|
1052
|
+
*
|
|
1053
|
+
* @param recordOrRecordId the record to be deleted
|
|
1054
|
+
* @example
|
|
1055
|
+
* ```js
|
|
1056
|
+
* function deleteRecord(record) {
|
|
1057
|
+
* if (table.hasPermissionToDeleteRecord(record)) {
|
|
1058
|
+
* table.deleteRecordAsync(record);
|
|
1059
|
+
* }
|
|
1060
|
+
* // The record is now deleted within your extension (eg will not be returned
|
|
1061
|
+
* // in `table.selectRecords`) but it is still being saved to Airtable
|
|
1062
|
+
* // servers (e.g. it may not look deleted to other users yet).
|
|
1063
|
+
* }
|
|
1064
|
+
*
|
|
1065
|
+
* async function deleteRecordAsync(record) {
|
|
1066
|
+
* if (table.hasPermissionToDeleteRecord(record)) {
|
|
1067
|
+
* await table.deleteRecordAsync(record);
|
|
1068
|
+
* }
|
|
1069
|
+
* // Record deletion has been saved to Airtable servers.
|
|
1070
|
+
* alert('record has been deleted');
|
|
1071
|
+
* }
|
|
1072
|
+
* ```
|
|
1073
|
+
*/
|
|
1074
|
+
}, {
|
|
1075
|
+
key: "deleteRecordAsync",
|
|
1076
|
+
value: (function () {
|
|
1077
|
+
var _deleteRecordAsync = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee6(recordOrRecordId) {
|
|
1078
|
+
return _regenerator.default.wrap(function _callee6$(_context6) {
|
|
1079
|
+
while (1) switch (_context6.prev = _context6.next) {
|
|
1080
|
+
case 0:
|
|
1081
|
+
_context6.next = 2;
|
|
1082
|
+
return this.deleteRecordsAsync([recordOrRecordId]);
|
|
1083
|
+
case 2:
|
|
1084
|
+
case "end":
|
|
1085
|
+
return _context6.stop();
|
|
1086
|
+
}
|
|
1087
|
+
}, _callee6, this);
|
|
1088
|
+
}));
|
|
1089
|
+
function deleteRecordAsync(_x10) {
|
|
1090
|
+
return _deleteRecordAsync.apply(this, arguments);
|
|
1091
|
+
}
|
|
1092
|
+
return deleteRecordAsync;
|
|
1093
|
+
}()
|
|
1094
|
+
/**
|
|
1095
|
+
* Checks whether the current user has permission to delete the specified record.
|
|
1096
|
+
*
|
|
1097
|
+
* Accepts optional input, in the same format as {@link deleteRecordAsync}.
|
|
1098
|
+
* The more information provided, the more accurate the permissions check will be.
|
|
1099
|
+
*
|
|
1100
|
+
* Returns `{hasPermission: true}` if the current user can delete the specified record,
|
|
1101
|
+
* `{hasPermission: false, reasonDisplayString: string}` otherwise. `reasonDisplayString` may be
|
|
1102
|
+
* used to display an error message to the user.
|
|
1103
|
+
*
|
|
1104
|
+
* @param recordOrRecordId the record to be deleted
|
|
1105
|
+
* @example
|
|
1106
|
+
* ```js
|
|
1107
|
+
* // Check if user can delete a specific record
|
|
1108
|
+
* const deleteRecordCheckResult =
|
|
1109
|
+
* table.checkPermissionsForDeleteRecord(record);
|
|
1110
|
+
* if (!deleteRecordCheckResult.hasPermission) {
|
|
1111
|
+
* alert(deleteRecordCheckResult.reasonDisplayString);
|
|
1112
|
+
* }
|
|
1113
|
+
*
|
|
1114
|
+
* // Check if user could potentially delete a record.
|
|
1115
|
+
* // Use when you don't know the specific record you want to delete yet (for
|
|
1116
|
+
* // example, to show/hide UI controls that let you select a record to delete).
|
|
1117
|
+
* const deleteUnknownRecordCheckResult =
|
|
1118
|
+
* table.checkPermissionsForDeleteRecord();
|
|
1119
|
+
* ```
|
|
1120
|
+
*/
|
|
1121
|
+
)
|
|
1122
|
+
}, {
|
|
1123
|
+
key: "checkPermissionsForDeleteRecord",
|
|
1124
|
+
value: function checkPermissionsForDeleteRecord(recordOrRecordId) {
|
|
1125
|
+
return this.checkPermissionsForDeleteRecords(recordOrRecordId ? [recordOrRecordId] : undefined);
|
|
1126
|
+
}
|
|
1127
|
+
/**
|
|
1128
|
+
* An alias for `checkPermissionsForDeleteRecord(recordOrRecordId).hasPermission`.
|
|
1129
|
+
*
|
|
1130
|
+
* Checks whether the current user has permission to delete the specified record.
|
|
1131
|
+
*
|
|
1132
|
+
* Accepts optional input, in the same format as {@link deleteRecordAsync}.
|
|
1133
|
+
* The more information provided, the more accurate the permissions check will be.
|
|
1134
|
+
*
|
|
1135
|
+
* @param recordOrRecordId the record to be deleted
|
|
1136
|
+
* @example
|
|
1137
|
+
* ```js
|
|
1138
|
+
* // Check if user can delete a specific record
|
|
1139
|
+
* const canDeleteRecord = table.hasPermissionToDeleteRecord(record);
|
|
1140
|
+
* if (!canDeleteRecord) {
|
|
1141
|
+
* alert('not allowed');
|
|
1142
|
+
* }
|
|
1143
|
+
*
|
|
1144
|
+
* // Check if user could potentially delete a record.
|
|
1145
|
+
* // Use when you don't know the specific record you want to delete yet (for
|
|
1146
|
+
* // example, to show/hide UI controls that let you select a record to delete).
|
|
1147
|
+
* const canDeleteUnknownRecord = table.hasPermissionToDeleteRecord();
|
|
1148
|
+
* ```
|
|
1149
|
+
*/
|
|
1150
|
+
}, {
|
|
1151
|
+
key: "hasPermissionToDeleteRecord",
|
|
1152
|
+
value: function hasPermissionToDeleteRecord(recordOrRecordId) {
|
|
1153
|
+
return this.checkPermissionsForDeleteRecord(recordOrRecordId).hasPermission;
|
|
1154
|
+
}
|
|
1155
|
+
/**
|
|
1156
|
+
* Delete the given records.
|
|
1157
|
+
*
|
|
1158
|
+
* Throws an error if the user does not have permission to delete the given records.
|
|
1159
|
+
*
|
|
1160
|
+
* You may only delete up to 50 records in one call to `deleteRecordsAsync`.
|
|
1161
|
+
* See [Write back to Airtable](/guides/write-back-to-airtable#size-limits-rate-limits) for
|
|
1162
|
+
* more information about write limits.
|
|
1163
|
+
*
|
|
1164
|
+
* This action is asynchronous: `await` the returned promise if you wish to wait for the
|
|
1165
|
+
* delete to be persisted to Airtable servers.
|
|
1166
|
+
* Updates are applied optimistically locally, so your changes will be reflected in your extension
|
|
1167
|
+
* before the promise resolves.
|
|
1168
|
+
*
|
|
1169
|
+
* @param recordsOrRecordIds Array of Records and RecordIds
|
|
1170
|
+
* @example
|
|
1171
|
+
* ```js
|
|
1172
|
+
*
|
|
1173
|
+
* function deleteRecords(records) {
|
|
1174
|
+
* if (table.hasPermissionToDeleteRecords(records)) {
|
|
1175
|
+
* table.deleteRecordsAsync(records);
|
|
1176
|
+
* }
|
|
1177
|
+
* // The records are now deleted within your extension (eg will not be
|
|
1178
|
+
* // returned in `table.selectRecords()`) but are still being saved to
|
|
1179
|
+
* // Airtable servers (e.g. they may not look deleted to other users yet).
|
|
1180
|
+
* }
|
|
1181
|
+
*
|
|
1182
|
+
* async function deleteRecordsAsync(records) {
|
|
1183
|
+
* if (table.hasPermissionToDeleteRecords(records)) {
|
|
1184
|
+
* await table.deleteRecordsAsync(records);
|
|
1185
|
+
* }
|
|
1186
|
+
* // Record deletions have been saved to Airtable servers.
|
|
1187
|
+
* alert('records have been deleted');
|
|
1188
|
+
* }
|
|
1189
|
+
* ```
|
|
1190
|
+
*/
|
|
1191
|
+
}, {
|
|
1192
|
+
key: "deleteRecordsAsync",
|
|
1193
|
+
value: (function () {
|
|
1194
|
+
var _deleteRecordsAsync = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee7(recordsOrRecordIds) {
|
|
1195
|
+
var recordIds;
|
|
1196
|
+
return _regenerator.default.wrap(function _callee7$(_context7) {
|
|
1197
|
+
while (1) switch (_context7.prev = _context7.next) {
|
|
1198
|
+
case 0:
|
|
1199
|
+
recordIds = recordsOrRecordIds.map(recordOrRecordId => typeof recordOrRecordId === 'string' ? recordOrRecordId : recordOrRecordId.id);
|
|
1200
|
+
_context7.next = 3;
|
|
1201
|
+
return this._sdk.__mutations.applyMutationAsync({
|
|
1202
|
+
type: _mutations.MutationTypes.DELETE_MULTIPLE_RECORDS,
|
|
1203
|
+
tableId: this.id,
|
|
1204
|
+
recordIds
|
|
1205
|
+
});
|
|
1206
|
+
case 3:
|
|
1207
|
+
case "end":
|
|
1208
|
+
return _context7.stop();
|
|
1209
|
+
}
|
|
1210
|
+
}, _callee7, this);
|
|
1211
|
+
}));
|
|
1212
|
+
function deleteRecordsAsync(_x11) {
|
|
1213
|
+
return _deleteRecordsAsync.apply(this, arguments);
|
|
1214
|
+
}
|
|
1215
|
+
return deleteRecordsAsync;
|
|
1216
|
+
}()
|
|
1217
|
+
/**
|
|
1218
|
+
* Checks whether the current user has permission to delete the specified records.
|
|
1219
|
+
*
|
|
1220
|
+
* Accepts optional input, in the same format as {@link deleteRecordsAsync}.
|
|
1221
|
+
* The more information provided, the more accurate the permissions check will be.
|
|
1222
|
+
*
|
|
1223
|
+
* Returns `{hasPermission: true}` if the current user can delete the specified records,
|
|
1224
|
+
* `{hasPermission: false, reasonDisplayString: string}` otherwise. `reasonDisplayString` may be
|
|
1225
|
+
* used to display an error message to the user.
|
|
1226
|
+
*
|
|
1227
|
+
* @param recordsOrRecordIds the records to be deleted
|
|
1228
|
+
* @example
|
|
1229
|
+
* ```js
|
|
1230
|
+
* // Check if user can delete specific records
|
|
1231
|
+
* const deleteRecordsCheckResult =
|
|
1232
|
+
* table.checkPermissionsForDeleteRecords([record1, record2]);
|
|
1233
|
+
* if (!deleteRecordsCheckResult.hasPermission) {
|
|
1234
|
+
* alert(deleteRecordsCheckResult.reasonDisplayString);
|
|
1235
|
+
* }
|
|
1236
|
+
*
|
|
1237
|
+
* // Check if user could potentially delete records.
|
|
1238
|
+
* // Use when you don't know the specific records you want to delete yet (for
|
|
1239
|
+
* // example, to show/hide UI controls that let you select records to delete).
|
|
1240
|
+
* // Equivalent to table.hasPermissionToDeleteRecord()
|
|
1241
|
+
* const deleteUnknownRecordsCheckResult =
|
|
1242
|
+
* table.checkPermissionsForDeleteRecords();
|
|
1243
|
+
* ```
|
|
1244
|
+
*/
|
|
1245
|
+
)
|
|
1246
|
+
}, {
|
|
1247
|
+
key: "checkPermissionsForDeleteRecords",
|
|
1248
|
+
value: function checkPermissionsForDeleteRecords(recordsOrRecordIds) {
|
|
1249
|
+
return this._sdk.__mutations.checkPermissionsForMutation({
|
|
1250
|
+
type: _mutations.MutationTypes.DELETE_MULTIPLE_RECORDS,
|
|
1251
|
+
tableId: this.id,
|
|
1252
|
+
recordIds: recordsOrRecordIds ? recordsOrRecordIds.map(recordOrRecordId => typeof recordOrRecordId === 'string' ? recordOrRecordId : recordOrRecordId.id) : undefined
|
|
1253
|
+
});
|
|
1254
|
+
}
|
|
1255
|
+
/**
|
|
1256
|
+
* An alias for `checkPermissionsForDeleteRecords(recordsOrRecordIds).hasPermission`.
|
|
1257
|
+
*
|
|
1258
|
+
* Checks whether the current user has permission to delete the specified records.
|
|
1259
|
+
*
|
|
1260
|
+
* Accepts optional input, in the same format as {@link deleteRecordsAsync}.
|
|
1261
|
+
* The more information provided, the more accurate the permissions check will be.
|
|
1262
|
+
*
|
|
1263
|
+
* @param recordsOrRecordIds the records to be deleted
|
|
1264
|
+
* @example
|
|
1265
|
+
* ```js
|
|
1266
|
+
* // Check if user can delete specific records
|
|
1267
|
+
* const canDeleteRecords =
|
|
1268
|
+
* table.hasPermissionToDeleteRecords([record1, record2]);
|
|
1269
|
+
* if (!canDeleteRecords) {
|
|
1270
|
+
* alert('not allowed!');
|
|
1271
|
+
* }
|
|
1272
|
+
*
|
|
1273
|
+
* // Check if user could potentially delete records.
|
|
1274
|
+
* // Use when you don't know the specific records you want to delete yet (for
|
|
1275
|
+
* // example, to show/hide UI controls that let you select records to delete).
|
|
1276
|
+
* // Equivalent to table.hasPermissionToDeleteRecord()
|
|
1277
|
+
* const canDeleteUnknownRecords = table.hasPermissionToDeleteRecords();
|
|
1278
|
+
* ```
|
|
1279
|
+
*/
|
|
1280
|
+
}, {
|
|
1281
|
+
key: "hasPermissionToDeleteRecords",
|
|
1282
|
+
value: function hasPermissionToDeleteRecords(recordsOrRecordIds) {
|
|
1283
|
+
return this.checkPermissionsForDeleteRecords(recordsOrRecordIds).hasPermission;
|
|
1284
|
+
}
|
|
1285
|
+
|
|
1286
|
+
/**
|
|
1287
|
+
* Creates a new record with the specified cell values.
|
|
1288
|
+
*
|
|
1289
|
+
* Throws an error if the user does not have permission to create the given records, or
|
|
1290
|
+
* if invalid input is provided (eg. invalid cell values).
|
|
1291
|
+
*
|
|
1292
|
+
* Refer to {@link FieldType} for cell value write formats.
|
|
1293
|
+
*
|
|
1294
|
+
* This action is asynchronous: `await` the returned promise if you wish to wait for the new
|
|
1295
|
+
* record to be persisted to Airtable servers.
|
|
1296
|
+
* Updates are applied optimistically locally, so your changes will be reflected in your extension
|
|
1297
|
+
* before the promise resolves.
|
|
1298
|
+
*
|
|
1299
|
+
* The returned promise will resolve to the RecordId of the new record once it is persisted.
|
|
1300
|
+
*
|
|
1301
|
+
* @param fields object mapping `FieldId` or field name to value for that field.
|
|
1302
|
+
* @example
|
|
1303
|
+
* ```js
|
|
1304
|
+
* function createNewRecord(recordFields) {
|
|
1305
|
+
* if (table.hasPermissionToCreateRecord(recordFields)) {
|
|
1306
|
+
* table.createRecordAsync(recordFields);
|
|
1307
|
+
* }
|
|
1308
|
+
* // You can now access the new record in your extension (eg
|
|
1309
|
+
* // `table.selectRecords()`) but it is still being saved to Airtable
|
|
1310
|
+
* // servers (e.g. other users may not be able to see it yet).
|
|
1311
|
+
* }
|
|
1312
|
+
*
|
|
1313
|
+
* async function createNewRecordAsync(recordFields) {
|
|
1314
|
+
* if (table.hasPermissionToCreateRecord(recordFields)) {
|
|
1315
|
+
* const newRecordId = await table.createRecordAsync(recordFields);
|
|
1316
|
+
* }
|
|
1317
|
+
* // New record has been saved to Airtable servers.
|
|
1318
|
+
* alert(`new record with ID ${newRecordId} has been created`);
|
|
1319
|
+
* }
|
|
1320
|
+
*
|
|
1321
|
+
* // Fields can be specified by name or ID
|
|
1322
|
+
* createNewRecord({
|
|
1323
|
+
* 'Project Name': 'Advertising campaign',
|
|
1324
|
+
* 'Budget': 100,
|
|
1325
|
+
* });
|
|
1326
|
+
* createNewRecord({
|
|
1327
|
+
* [projectNameField.id]: 'Cat video',
|
|
1328
|
+
* [budgetField.id]: 200,
|
|
1329
|
+
* });
|
|
1330
|
+
*
|
|
1331
|
+
* // Cell values should generally have format matching the output of
|
|
1332
|
+
* // record.getCellValue() for the field being updated
|
|
1333
|
+
* createNewRecord({
|
|
1334
|
+
* 'Project Name': 'Cat video 2'
|
|
1335
|
+
* 'Category (single select)': {name: 'Video'},
|
|
1336
|
+
* 'Tags (multiple select)': [{name: 'Cats'}, {id: 'someChoiceId'}],
|
|
1337
|
+
* 'Assets (attachment)': [{url: 'http://mywebsite.com/cats.mp4'}],
|
|
1338
|
+
* 'Related projects (linked records)': [{id: 'someRecordId'}],
|
|
1339
|
+
* });
|
|
1340
|
+
* ```
|
|
1341
|
+
*/
|
|
1342
|
+
}, {
|
|
1343
|
+
key: "createRecordAsync",
|
|
1344
|
+
value: (function () {
|
|
1345
|
+
var _createRecordAsync = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee8() {
|
|
1346
|
+
var fields,
|
|
1347
|
+
recordIds,
|
|
1348
|
+
_args8 = arguments;
|
|
1349
|
+
return _regenerator.default.wrap(function _callee8$(_context8) {
|
|
1350
|
+
while (1) switch (_context8.prev = _context8.next) {
|
|
1351
|
+
case 0:
|
|
1352
|
+
fields = _args8.length > 0 && _args8[0] !== undefined ? _args8[0] : {};
|
|
1353
|
+
_context8.next = 3;
|
|
1354
|
+
return this.createRecordsAsync([{
|
|
1355
|
+
fields
|
|
1356
|
+
}]);
|
|
1357
|
+
case 3:
|
|
1358
|
+
recordIds = _context8.sent;
|
|
1359
|
+
return _context8.abrupt("return", recordIds[0]);
|
|
1360
|
+
case 5:
|
|
1361
|
+
case "end":
|
|
1362
|
+
return _context8.stop();
|
|
1363
|
+
}
|
|
1364
|
+
}, _callee8, this);
|
|
1365
|
+
}));
|
|
1366
|
+
function createRecordAsync() {
|
|
1367
|
+
return _createRecordAsync.apply(this, arguments);
|
|
1368
|
+
}
|
|
1369
|
+
return createRecordAsync;
|
|
1370
|
+
}()
|
|
1371
|
+
/**
|
|
1372
|
+
* Checks whether the current user has permission to create the specified record.
|
|
1373
|
+
*
|
|
1374
|
+
* Accepts partial input, in the same format as {@link createRecordAsync}.
|
|
1375
|
+
* The more information provided, the more accurate the permissions check will be.
|
|
1376
|
+
*
|
|
1377
|
+
* Returns `{hasPermission: true}` if the current user can create the specified record,
|
|
1378
|
+
* `{hasPermission: false, reasonDisplayString: string}` otherwise. `reasonDisplayString` may be
|
|
1379
|
+
* used to display an error message to the user.
|
|
1380
|
+
*
|
|
1381
|
+
* @param fields object mapping `FieldId` or field name to value for that field.
|
|
1382
|
+
* @example
|
|
1383
|
+
* ```js
|
|
1384
|
+
* // Check if user can create a specific record, when you already know what
|
|
1385
|
+
* // fields/cell values will be set for the record.
|
|
1386
|
+
* const createRecordCheckResult = table.checkPermissionsForCreateRecord({
|
|
1387
|
+
* 'Project Name': 'Advertising campaign',
|
|
1388
|
+
* 'Budget': 100,
|
|
1389
|
+
* });
|
|
1390
|
+
* if (!createRecordCheckResult.hasPermission) {
|
|
1391
|
+
* alert(createRecordCheckResult.reasonDisplayString);
|
|
1392
|
+
* }
|
|
1393
|
+
*
|
|
1394
|
+
* // Like createRecordAsync, you can use either field names or field IDs.
|
|
1395
|
+
* const checkResultWithFieldIds = table.checkPermissionsForCreateRecord({
|
|
1396
|
+
* [projectNameField.id]: 'Cat video',
|
|
1397
|
+
* [budgetField.id]: 200,
|
|
1398
|
+
* });
|
|
1399
|
+
*
|
|
1400
|
+
* // Check if user could potentially create a record.
|
|
1401
|
+
* // Use when you don't know the specific fields/cell values yet (for example,
|
|
1402
|
+
* // to show or hide UI controls that let you start creating a record.)
|
|
1403
|
+
* const createUnknownRecordCheckResult =
|
|
1404
|
+
* table.checkPermissionsForCreateRecord();
|
|
1405
|
+
* ```
|
|
1406
|
+
*/
|
|
1407
|
+
)
|
|
1408
|
+
}, {
|
|
1409
|
+
key: "checkPermissionsForCreateRecord",
|
|
1410
|
+
value: function checkPermissionsForCreateRecord(fields) {
|
|
1411
|
+
return this.checkPermissionsForCreateRecords([{
|
|
1412
|
+
fields: fields || undefined
|
|
1413
|
+
}]);
|
|
1414
|
+
}
|
|
1415
|
+
/**
|
|
1416
|
+
* An alias for `checkPermissionsForCreateRecord(fields).hasPermission`.
|
|
1417
|
+
*
|
|
1418
|
+
* Checks whether the current user has permission to create the specified record.
|
|
1419
|
+
*
|
|
1420
|
+
* Accepts partial input, in the same format as {@link createRecordAsync}.
|
|
1421
|
+
* The more information provided, the more accurate the permissions check will be.
|
|
1422
|
+
*
|
|
1423
|
+
* @param fields object mapping `FieldId` or field name to value for that field.
|
|
1424
|
+
* @example
|
|
1425
|
+
* ```js
|
|
1426
|
+
* // Check if user can create a specific record, when you already know what
|
|
1427
|
+
* // fields/cell values will be set for the record.
|
|
1428
|
+
* const canCreateRecord = table.hasPermissionToCreateRecord({
|
|
1429
|
+
* 'Project Name': 'Advertising campaign',
|
|
1430
|
+
* 'Budget': 100,
|
|
1431
|
+
* });
|
|
1432
|
+
* if (!canCreateRecord) {
|
|
1433
|
+
* alert('not allowed!');
|
|
1434
|
+
* }
|
|
1435
|
+
*
|
|
1436
|
+
* // Like createRecordAsync, you can use either field names or field IDs.
|
|
1437
|
+
* const canCreateRecordWithFieldIds = table.hasPermissionToCreateRecord({
|
|
1438
|
+
* [projectNameField.id]: 'Cat video',
|
|
1439
|
+
* [budgetField.id]: 200,
|
|
1440
|
+
* });
|
|
1441
|
+
*
|
|
1442
|
+
* // Check if user could potentially create a record.
|
|
1443
|
+
* // Use when you don't know the specific fields/cell values yet (for example,
|
|
1444
|
+
* // to show or hide UI controls that let you start creating a record.)
|
|
1445
|
+
* const canCreateUnknownRecord = table.hasPermissionToCreateRecord();
|
|
1446
|
+
* ```
|
|
1447
|
+
*/
|
|
1448
|
+
}, {
|
|
1449
|
+
key: "hasPermissionToCreateRecord",
|
|
1450
|
+
value: function hasPermissionToCreateRecord(fields) {
|
|
1451
|
+
return this.checkPermissionsForCreateRecord(fields).hasPermission;
|
|
1452
|
+
}
|
|
1453
|
+
/**
|
|
1454
|
+
* Creates new records with the specified cell values.
|
|
1455
|
+
*
|
|
1456
|
+
* Throws an error if the user does not have permission to create the given records, or
|
|
1457
|
+
* if invalid input is provided (eg. invalid cell values).
|
|
1458
|
+
*
|
|
1459
|
+
* Refer to {@link FieldType} for cell value write formats.
|
|
1460
|
+
*
|
|
1461
|
+
* You may only create up to 50 records in one call to `createRecordsAsync`.
|
|
1462
|
+
* See [Write back to Airtable](/guides/write-back-to-airtable#size-limits-rate-limits) for
|
|
1463
|
+
* more information about write limits.
|
|
1464
|
+
*
|
|
1465
|
+
* This action is asynchronous: `await` the returned promise if you wish to wait for the new
|
|
1466
|
+
* record to be persisted to Airtable servers.
|
|
1467
|
+
* Updates are applied optimistically locally, so your changes will be reflected in your extension
|
|
1468
|
+
* before the promise resolves.
|
|
1469
|
+
*
|
|
1470
|
+
* The returned promise will resolve to an array of RecordIds of the new records once the new
|
|
1471
|
+
* records are persisted.
|
|
1472
|
+
*
|
|
1473
|
+
* @param records Array of objects with a `fields` key mapping `FieldId` or field name to value for that field.
|
|
1474
|
+
* @example
|
|
1475
|
+
* ```js
|
|
1476
|
+
* const recordDefs = [
|
|
1477
|
+
* // Fields can be specified by name or ID
|
|
1478
|
+
* {
|
|
1479
|
+
* fields: {
|
|
1480
|
+
* 'Project Name': 'Advertising campaign',
|
|
1481
|
+
* 'Budget': 100,
|
|
1482
|
+
* },
|
|
1483
|
+
* },
|
|
1484
|
+
* {
|
|
1485
|
+
* fields: {
|
|
1486
|
+
* [projectNameField.id]: 'Cat video',
|
|
1487
|
+
* [budgetField.id]: 200,
|
|
1488
|
+
* },
|
|
1489
|
+
* },
|
|
1490
|
+
* // Specifying no fields will create a new record with no cell values set
|
|
1491
|
+
* {
|
|
1492
|
+
* fields: {},
|
|
1493
|
+
* },
|
|
1494
|
+
* // Cell values should generally have format matching the output of
|
|
1495
|
+
* // record.getCellValue() for the field being updated
|
|
1496
|
+
* {
|
|
1497
|
+
* fields: {
|
|
1498
|
+
* 'Project Name': 'Cat video 2'
|
|
1499
|
+
* 'Category (single select)': {name: 'Video'},
|
|
1500
|
+
* 'Tags (multiple select)': [{name: 'Cats'}, {id: 'choiceId'}],
|
|
1501
|
+
* 'Assets (attachment)': [{url: 'http://mywebsite.com/cats.mp4'}],
|
|
1502
|
+
* 'Related projects (linked records)': [{id: 'someRecordId'}],
|
|
1503
|
+
* },
|
|
1504
|
+
* },
|
|
1505
|
+
* ];
|
|
1506
|
+
*
|
|
1507
|
+
* function createNewRecords() {
|
|
1508
|
+
* if (table.hasPermissionToCreateRecords(recordDefs)) {
|
|
1509
|
+
* table.createRecordsAsync(recordDefs);
|
|
1510
|
+
* }
|
|
1511
|
+
* // You can now access the new records in your extension (e.g.
|
|
1512
|
+
* // `table.selectRecords()`) but they are still being saved to Airtable
|
|
1513
|
+
* // servers (e.g. other users may not be able to see them yet.)
|
|
1514
|
+
* }
|
|
1515
|
+
*
|
|
1516
|
+
* async function createNewRecordsAsync() {
|
|
1517
|
+
* if (table.hasPermissionToCreateRecords(recordDefs)) {
|
|
1518
|
+
* const newRecordIds = await table.createRecordsAsync(recordDefs);
|
|
1519
|
+
* }
|
|
1520
|
+
* // New records have been saved to Airtable servers.
|
|
1521
|
+
* alert(`new records with IDs ${newRecordIds} have been created`);
|
|
1522
|
+
* }
|
|
1523
|
+
* ```
|
|
1524
|
+
*/
|
|
1525
|
+
}, {
|
|
1526
|
+
key: "createRecordsAsync",
|
|
1527
|
+
value: (function () {
|
|
1528
|
+
var _createRecordsAsync = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee9(records) {
|
|
1529
|
+
var recordsToCreate;
|
|
1530
|
+
return _regenerator.default.wrap(function _callee9$(_context9) {
|
|
1531
|
+
while (1) switch (_context9.prev = _context9.next) {
|
|
1532
|
+
case 0:
|
|
1533
|
+
recordsToCreate = records.map(recordDef => {
|
|
1534
|
+
var recordDefKeys = (0, _private_utils.keys)(recordDef);
|
|
1535
|
+
var fields;
|
|
1536
|
+
if (recordDefKeys.length === 1 && recordDefKeys[0] === 'fields') {
|
|
1537
|
+
fields = recordDef.fields;
|
|
1538
|
+
} else {
|
|
1539
|
+
throw (0, _error_utils.spawnError)('Invalid record format. Please define field mappings using a `fields` key for each record definition object');
|
|
1540
|
+
}
|
|
1541
|
+
return {
|
|
1542
|
+
id: this._sdk.__airtableInterface.idGenerator.generateRecordId(),
|
|
1543
|
+
cellValuesByFieldId: this._cellValuesByFieldIdOrNameToCellValuesByFieldId(fields)
|
|
1544
|
+
};
|
|
1545
|
+
});
|
|
1546
|
+
_context9.next = 3;
|
|
1547
|
+
return this._sdk.__mutations.applyMutationAsync({
|
|
1548
|
+
type: _mutations.MutationTypes.CREATE_MULTIPLE_RECORDS,
|
|
1549
|
+
tableId: this.id,
|
|
1550
|
+
records: recordsToCreate,
|
|
1551
|
+
opts: {
|
|
1552
|
+
parseDateCellValueInColumnTimeZone: true
|
|
1553
|
+
}
|
|
1554
|
+
});
|
|
1555
|
+
case 3:
|
|
1556
|
+
return _context9.abrupt("return", recordsToCreate.map(record => record.id));
|
|
1557
|
+
case 4:
|
|
1558
|
+
case "end":
|
|
1559
|
+
return _context9.stop();
|
|
1560
|
+
}
|
|
1561
|
+
}, _callee9, this);
|
|
1562
|
+
}));
|
|
1563
|
+
function createRecordsAsync(_x12) {
|
|
1564
|
+
return _createRecordsAsync.apply(this, arguments);
|
|
1565
|
+
}
|
|
1566
|
+
return createRecordsAsync;
|
|
1567
|
+
}()
|
|
1568
|
+
/**
|
|
1569
|
+
* Checks whether the current user has permission to create the specified records.
|
|
1570
|
+
*
|
|
1571
|
+
* Accepts partial input, in the same format as {@link createRecordsAsync}.
|
|
1572
|
+
* The more information provided, the more accurate the permissions check will be.
|
|
1573
|
+
*
|
|
1574
|
+
* Returns `{hasPermission: true}` if the current user can create the specified records,
|
|
1575
|
+
* `{hasPermission: false, reasonDisplayString: string}` otherwise. `reasonDisplayString` may be
|
|
1576
|
+
* used to display an error message to the user.
|
|
1577
|
+
*
|
|
1578
|
+
* @param records Array of objects mapping `FieldId` or field name to value for that field.
|
|
1579
|
+
* @example
|
|
1580
|
+
* ```js
|
|
1581
|
+
* // Check if user can create specific records, when you already know what
|
|
1582
|
+
* // fields/cell values will be set for the records.
|
|
1583
|
+
* const createRecordsCheckResult = table.checkPermissionsForCreateRecords([
|
|
1584
|
+
* // Like createRecordsAsync, fields can be specified by name or ID
|
|
1585
|
+
* {
|
|
1586
|
+
* fields: {
|
|
1587
|
+
* 'Project Name': 'Advertising campaign',
|
|
1588
|
+
* 'Budget': 100,
|
|
1589
|
+
* },
|
|
1590
|
+
* },
|
|
1591
|
+
* {
|
|
1592
|
+
* fields: {
|
|
1593
|
+
* [projectNameField.id]: 'Cat video',
|
|
1594
|
+
* [budgetField.id]: 200,
|
|
1595
|
+
* },
|
|
1596
|
+
* },
|
|
1597
|
+
* {},
|
|
1598
|
+
* ]);
|
|
1599
|
+
* if (!createRecordsCheckResult.hasPermission) {
|
|
1600
|
+
* alert(createRecordsCheckResult.reasonDisplayString);
|
|
1601
|
+
* }
|
|
1602
|
+
*
|
|
1603
|
+
* // Check if user could potentially create records.
|
|
1604
|
+
* // Use when you don't know the specific fields/cell values yet (for example,
|
|
1605
|
+
* // to show or hide UI controls that let you start creating records.)
|
|
1606
|
+
* // Equivalent to table.checkPermissionsForCreateRecord()
|
|
1607
|
+
* const createUnknownRecordCheckResult =
|
|
1608
|
+
* table.checkPermissionsForCreateRecords();
|
|
1609
|
+
* ```
|
|
1610
|
+
*/
|
|
1611
|
+
)
|
|
1612
|
+
}, {
|
|
1613
|
+
key: "checkPermissionsForCreateRecords",
|
|
1614
|
+
value: function checkPermissionsForCreateRecords(records) {
|
|
1615
|
+
return this._sdk.__mutations.checkPermissionsForMutation({
|
|
1616
|
+
type: _mutations.MutationTypes.CREATE_MULTIPLE_RECORDS,
|
|
1617
|
+
tableId: this.id,
|
|
1618
|
+
records: records ? records.map(record => ({
|
|
1619
|
+
id: undefined,
|
|
1620
|
+
cellValuesByFieldId: record.fields ? this._cellValuesByFieldIdOrNameToCellValuesByFieldId(record.fields) : undefined
|
|
1621
|
+
})) : undefined
|
|
1622
|
+
});
|
|
1623
|
+
}
|
|
1624
|
+
/**
|
|
1625
|
+
* An alias for `checkPermissionsForCreateRecords(records).hasPermission`.
|
|
1626
|
+
*
|
|
1627
|
+
* Checks whether the current user has permission to create the specified records.
|
|
1628
|
+
*
|
|
1629
|
+
* Accepts partial input, in the same format as {@link createRecordsAsync}.
|
|
1630
|
+
* The more information provided, the more accurate the permissions check will be.
|
|
1631
|
+
*
|
|
1632
|
+
* @param records Array of objects mapping `FieldId` or field name to value for that field.
|
|
1633
|
+
* @example
|
|
1634
|
+
* ```js
|
|
1635
|
+
* // Check if user can create specific records, when you already know what fields/cell values
|
|
1636
|
+
* // will be set for the records.
|
|
1637
|
+
* const canCreateRecords = table.hasPermissionToCreateRecords([
|
|
1638
|
+
* // Like createRecordsAsync, fields can be specified by name or ID
|
|
1639
|
+
* {
|
|
1640
|
+
* fields: {
|
|
1641
|
+
* 'Project Name': 'Advertising campaign',
|
|
1642
|
+
* 'Budget': 100,
|
|
1643
|
+
* }
|
|
1644
|
+
* },
|
|
1645
|
+
* {
|
|
1646
|
+
* fields: {
|
|
1647
|
+
* [projectNameField.id]: 'Cat video',
|
|
1648
|
+
* [budgetField.id]: 200,
|
|
1649
|
+
* }
|
|
1650
|
+
* },
|
|
1651
|
+
* {},
|
|
1652
|
+
* ]);
|
|
1653
|
+
* if (!canCreateRecords) {
|
|
1654
|
+
* alert('not allowed');
|
|
1655
|
+
* }
|
|
1656
|
+
*
|
|
1657
|
+
* // Check if user could potentially create records.
|
|
1658
|
+
* // Use when you don't know the specific fields/cell values yet (for example,
|
|
1659
|
+
* // to show or hide UI controls that let you start creating records).
|
|
1660
|
+
* // Equivalent to table.hasPermissionToCreateRecord()
|
|
1661
|
+
* const canCreateUnknownRecords = table.hasPermissionToCreateRecords();
|
|
1662
|
+
* ```
|
|
1663
|
+
*/
|
|
1664
|
+
}, {
|
|
1665
|
+
key: "hasPermissionToCreateRecords",
|
|
1666
|
+
value: function hasPermissionToCreateRecords(records) {
|
|
1667
|
+
return this.checkPermissionsForCreateRecords(records).hasPermission;
|
|
1668
|
+
}
|
|
1669
|
+
|
|
1670
|
+
/** @internal */
|
|
1671
|
+
}, {
|
|
1672
|
+
key: "__triggerOnChangeForDirtyPaths",
|
|
1673
|
+
value: function __triggerOnChangeForDirtyPaths(dirtyPaths) {
|
|
1674
|
+
var didTableSchemaChange = false;
|
|
1675
|
+
if ((0, _get2.default)((0, _getPrototypeOf2.default)(Table.prototype), "__triggerOnChangeForDirtyPaths", this).call(this, dirtyPaths)) {
|
|
1676
|
+
didTableSchemaChange = true;
|
|
1677
|
+
}
|
|
1678
|
+
if (dirtyPaths.viewOrder) {
|
|
1679
|
+
this._onChange(WatchableTableKeys.views);
|
|
1680
|
+
didTableSchemaChange = true;
|
|
1681
|
+
|
|
1682
|
+
// Clean up deleted views
|
|
1683
|
+
var _iterator2 = _createForOfIteratorHelper((0, _private_utils.entries)(this._viewModelsById)),
|
|
1684
|
+
_step2;
|
|
1685
|
+
try {
|
|
1686
|
+
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
1687
|
+
var _step2$value = (0, _slicedToArray2.default)(_step2.value, 2),
|
|
1688
|
+
viewId = _step2$value[0],
|
|
1689
|
+
viewModel = _step2$value[1];
|
|
1690
|
+
if (viewModel.isDeleted) {
|
|
1691
|
+
delete this._viewModelsById[viewId];
|
|
1692
|
+
}
|
|
1693
|
+
}
|
|
1694
|
+
} catch (err) {
|
|
1695
|
+
_iterator2.e(err);
|
|
1696
|
+
} finally {
|
|
1697
|
+
_iterator2.f();
|
|
1698
|
+
}
|
|
1699
|
+
}
|
|
1700
|
+
if (dirtyPaths.viewsById) {
|
|
1701
|
+
var _iterator3 = _createForOfIteratorHelper((0, _private_utils.entries)(dirtyPaths.viewsById)),
|
|
1702
|
+
_step3;
|
|
1703
|
+
try {
|
|
1704
|
+
for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
|
|
1705
|
+
var _step3$value = (0, _slicedToArray2.default)(_step3.value, 2),
|
|
1706
|
+
_viewId = _step3$value[0],
|
|
1707
|
+
dirtyViewPaths = _step3$value[1];
|
|
1708
|
+
// Directly access from _viewModelsById to avoid creating
|
|
1709
|
+
// a view model if it doesn't already exist. If it doesn't exist,
|
|
1710
|
+
// nothing can be subscribed to any events on it.
|
|
1711
|
+
var view = this._viewModelsById[_viewId];
|
|
1712
|
+
if (view) {
|
|
1713
|
+
var didViewSchemaChange = view.__triggerOnChangeForDirtyPaths(dirtyViewPaths);
|
|
1714
|
+
if (didViewSchemaChange) {
|
|
1715
|
+
didTableSchemaChange = true;
|
|
1716
|
+
}
|
|
1717
|
+
}
|
|
1718
|
+
}
|
|
1719
|
+
} catch (err) {
|
|
1720
|
+
_iterator3.e(err);
|
|
1721
|
+
} finally {
|
|
1722
|
+
_iterator3.f();
|
|
1723
|
+
}
|
|
1724
|
+
}
|
|
1725
|
+
return didTableSchemaChange;
|
|
1726
|
+
}
|
|
1727
|
+
}], [{
|
|
1728
|
+
key: "_isWatchableKey",
|
|
1729
|
+
value: /** @internal */
|
|
1730
|
+
function _isWatchableKey(key) {
|
|
1731
|
+
return (0, _private_utils.isEnumValue)(WatchableTableKeys, key);
|
|
1732
|
+
}
|
|
1733
|
+
}]);
|
|
1734
|
+
}(_table_core.TableCore);
|
|
1735
|
+
/** @internal */
|
|
1736
|
+
(0, _defineProperty2.default)(Table, "_className", 'Table');
|
|
1737
|
+
var _default = exports.default = Table;
|