@airtable/blocks 0.0.0-experimental-f52bc4e5e-20250709 → 0.0.0-experimental-75d011284-20250904
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/base/assert_run_context.js +12 -0
- package/dist/cjs/base/index.js +30 -30
- package/dist/cjs/base/models/abstract_model_with_async_data.js +154 -237
- package/dist/cjs/base/models/base.js +188 -267
- package/dist/cjs/base/models/create_aggregators.js +29 -46
- package/dist/cjs/base/models/cursor.js +206 -294
- package/dist/cjs/base/models/field.js +307 -395
- package/dist/cjs/base/models/grouped_record_query_result.js +219 -338
- package/dist/cjs/base/models/linked_records_query_result.js +450 -625
- package/dist/cjs/base/models/models.js +19 -22
- package/dist/cjs/base/models/mutations.js +267 -293
- package/dist/cjs/base/models/object_pool.js +117 -156
- package/dist/cjs/base/models/record.js +191 -256
- package/dist/cjs/base/models/record_coloring.js +6 -6
- package/dist/cjs/base/models/record_query_result.js +351 -435
- package/dist/cjs/base/models/record_store.js +403 -753
- package/dist/cjs/base/models/session.js +125 -153
- package/dist/cjs/base/models/table.js +457 -605
- package/dist/cjs/base/models/table_or_view_query_result.js +656 -920
- package/dist/cjs/base/models/view.js +284 -389
- package/dist/cjs/base/models/view_data_store.js +218 -356
- package/dist/cjs/base/models/view_metadata_query_result.js +109 -157
- package/dist/cjs/base/perform_record_action.js +89 -131
- package/dist/cjs/base/sdk.js +129 -184
- package/dist/cjs/base/settings_button.js +54 -74
- package/dist/cjs/base/types/airtable_interface.js +1 -1
- package/dist/cjs/base/types/mutations.js +5 -11
- package/dist/cjs/base/types/undo_redo.js +1 -1
- package/dist/cjs/base/types/view.js +1 -1
- package/dist/cjs/base/ui/base_provider.js +6 -8
- package/dist/cjs/base/ui/baymax_utils.js +436 -108
- package/dist/cjs/base/ui/block_wrapper.js +81 -106
- package/dist/cjs/base/ui/box.js +34 -60
- package/dist/cjs/base/ui/button.js +44 -74
- package/dist/cjs/base/ui/cell_renderer.js +132 -189
- package/dist/cjs/base/ui/choice_token.js +25 -42
- package/dist/cjs/base/ui/collaborator_token.js +31 -53
- package/dist/cjs/base/ui/color_palette.js +130 -173
- package/dist/cjs/base/ui/color_palette_synced.js +41 -70
- package/dist/cjs/base/ui/confirmation_dialog.js +70 -120
- package/dist/cjs/base/ui/control_sizes.js +24 -22
- package/dist/cjs/base/ui/create_detect_element_resize.js +6 -10
- package/dist/cjs/base/ui/css_helpers.js +1 -1
- package/dist/cjs/base/ui/dialog.js +57 -98
- package/dist/cjs/base/ui/dialog_close_button.js +52 -98
- package/dist/cjs/base/ui/expand_record.js +1 -2
- package/dist/cjs/base/ui/expand_record_list.js +3 -4
- package/dist/cjs/base/ui/expand_record_picker_async.js +28 -57
- package/dist/cjs/base/ui/field_icon.js +15 -33
- package/dist/cjs/base/ui/field_picker.js +25 -70
- package/dist/cjs/base/ui/field_picker_synced.js +18 -40
- package/dist/cjs/base/ui/form_field.js +27 -55
- package/dist/cjs/base/ui/geometry/geometry.js +5 -5
- package/dist/cjs/base/ui/geometry/point.js +10 -12
- package/dist/cjs/base/ui/geometry/rect.js +36 -52
- package/dist/cjs/base/ui/geometry/size.js +10 -12
- package/dist/cjs/base/ui/global_alert.js +31 -52
- package/dist/cjs/base/ui/heading.js +45 -94
- package/dist/cjs/base/ui/icon.js +39 -59
- package/dist/cjs/base/ui/icon_config.js +6 -12
- package/dist/cjs/base/ui/initialize_block.js +16 -35
- package/dist/cjs/base/ui/input.js +62 -101
- package/dist/cjs/base/ui/input_synced.js +17 -40
- package/dist/cjs/base/ui/key_codes.js +2 -3
- package/dist/cjs/base/ui/label.js +30 -55
- package/dist/cjs/base/ui/link.js +54 -87
- package/dist/cjs/base/ui/loader.js +15 -36
- package/dist/cjs/base/ui/modal.js +88 -127
- package/dist/cjs/base/ui/model_picker_select.js +18 -44
- package/dist/cjs/base/ui/popover.js +236 -328
- package/dist/cjs/base/ui/progress_bar.js +34 -47
- package/dist/cjs/base/ui/record_card.js +389 -478
- package/dist/cjs/base/ui/record_card_list.js +150 -224
- package/dist/cjs/base/ui/select.js +60 -116
- package/dist/cjs/base/ui/select_and_select_buttons_helpers.js +15 -39
- package/dist/cjs/base/ui/select_buttons.js +50 -83
- package/dist/cjs/base/ui/select_buttons_synced.js +17 -39
- package/dist/cjs/base/ui/select_synced.js +17 -39
- package/dist/cjs/base/ui/switch.js +42 -71
- package/dist/cjs/base/ui/switch_synced.js +16 -38
- package/dist/cjs/base/ui/synced.js +27 -48
- package/dist/cjs/base/ui/system/all_styles_set.js +4 -12
- package/dist/cjs/base/ui/system/appearance/appearance_set.js +10 -13
- package/dist/cjs/base/ui/system/appearance/background_color.js +3 -6
- package/dist/cjs/base/ui/system/appearance/border.js +3 -6
- package/dist/cjs/base/ui/system/appearance/border_radius.js +3 -6
- package/dist/cjs/base/ui/system/appearance/box_shadow.js +3 -6
- package/dist/cjs/base/ui/system/appearance/opacity.js +3 -6
- package/dist/cjs/base/ui/system/dimensions/dimensions_set.js +11 -13
- package/dist/cjs/base/ui/system/dimensions/height.js +3 -6
- package/dist/cjs/base/ui/system/dimensions/max_height.js +3 -6
- package/dist/cjs/base/ui/system/dimensions/max_width.js +3 -6
- package/dist/cjs/base/ui/system/dimensions/min_height.js +3 -6
- package/dist/cjs/base/ui/system/dimensions/min_width.js +3 -6
- package/dist/cjs/base/ui/system/dimensions/width.js +3 -6
- package/dist/cjs/base/ui/system/display.js +3 -6
- package/dist/cjs/base/ui/system/flex_container/align_content.js +3 -6
- package/dist/cjs/base/ui/system/flex_container/align_items.js +3 -6
- package/dist/cjs/base/ui/system/flex_container/flex_container_set.js +11 -13
- package/dist/cjs/base/ui/system/flex_container/flex_direction.js +3 -6
- package/dist/cjs/base/ui/system/flex_container/flex_wrap.js +3 -6
- package/dist/cjs/base/ui/system/flex_container/justify_content.js +3 -6
- package/dist/cjs/base/ui/system/flex_container/justify_items.js +3 -6
- package/dist/cjs/base/ui/system/flex_item/align_self.js +3 -6
- package/dist/cjs/base/ui/system/flex_item/flex.js +3 -6
- package/dist/cjs/base/ui/system/flex_item/flex_basis.js +3 -6
- package/dist/cjs/base/ui/system/flex_item/flex_grow.js +3 -6
- package/dist/cjs/base/ui/system/flex_item/flex_item_set.js +12 -13
- package/dist/cjs/base/ui/system/flex_item/flex_shrink.js +3 -6
- package/dist/cjs/base/ui/system/flex_item/justify_self.js +3 -6
- package/dist/cjs/base/ui/system/flex_item/order.js +3 -6
- package/dist/cjs/base/ui/system/index.js +104 -416
- package/dist/cjs/base/ui/system/overflow.js +3 -6
- package/dist/cjs/base/ui/system/position/bottom.js +4 -6
- package/dist/cjs/base/ui/system/position/left.js +4 -6
- package/dist/cjs/base/ui/system/position/position.js +3 -6
- package/dist/cjs/base/ui/system/position/position_set.js +11 -13
- package/dist/cjs/base/ui/system/position/right.js +4 -6
- package/dist/cjs/base/ui/system/position/top.js +4 -6
- package/dist/cjs/base/ui/system/position/z_index.js +3 -6
- package/dist/cjs/base/ui/system/spacing/margin.js +4 -6
- package/dist/cjs/base/ui/system/spacing/padding.js +4 -6
- package/dist/cjs/base/ui/system/spacing/spacing_set.js +7 -13
- package/dist/cjs/base/ui/system/typography/font_family.js +3 -6
- package/dist/cjs/base/ui/system/typography/font_size.js +3 -6
- package/dist/cjs/base/ui/system/typography/font_style.js +3 -6
- package/dist/cjs/base/ui/system/typography/font_weight.js +3 -6
- package/dist/cjs/base/ui/system/typography/letter_spacing.js +3 -6
- package/dist/cjs/base/ui/system/typography/line_height.js +3 -6
- package/dist/cjs/base/ui/system/typography/text_align.js +3 -6
- package/dist/cjs/base/ui/system/typography/text_color.js +3 -6
- package/dist/cjs/base/ui/system/typography/text_decoration.js +3 -6
- package/dist/cjs/base/ui/system/typography/text_transform.js +3 -6
- package/dist/cjs/base/ui/system/typography/typography_set.js +15 -13
- package/dist/cjs/base/ui/system/utils/ensure_numbers_are_within_scale.js +3 -4
- package/dist/cjs/base/ui/system/utils/get_style_props_for_responsive_prop.js +47 -87
- package/dist/cjs/base/ui/table_picker.js +18 -42
- package/dist/cjs/base/ui/table_picker_synced.js +17 -39
- package/dist/cjs/base/ui/text.js +40 -73
- package/dist/cjs/base/ui/text_button.js +51 -83
- package/dist/cjs/base/ui/theme/default_theme/button_variants.js +3 -3
- package/dist/cjs/base/ui/theme/default_theme/control_sizes.js +51 -45
- package/dist/cjs/base/ui/theme/default_theme/heading_styles.js +1 -1
- package/dist/cjs/base/ui/theme/default_theme/index.js +9 -15
- package/dist/cjs/base/ui/theme/default_theme/input_variants.js +3 -3
- package/dist/cjs/base/ui/theme/default_theme/link_variants.js +3 -3
- package/dist/cjs/base/ui/theme/default_theme/select_buttons_variants.js +4 -4
- package/dist/cjs/base/ui/theme/default_theme/select_variants.js +8 -17
- package/dist/cjs/base/ui/theme/default_theme/switch_variants.js +23 -29
- package/dist/cjs/base/ui/theme/default_theme/text_button_variants.js +5 -5
- package/dist/cjs/base/ui/theme/default_theme/text_styles.js +1 -1
- package/dist/cjs/base/ui/theme/default_theme/tokens.js +14 -14
- package/dist/cjs/base/ui/theme/theme_context.js +2 -2
- package/dist/cjs/base/ui/theme/use_theme.js +2 -2
- package/dist/cjs/base/ui/tooltip.js +134 -174
- package/dist/cjs/base/ui/types/aria_props.js +1 -23
- package/dist/cjs/base/ui/types/data_attributes_prop.js +1 -18
- package/dist/cjs/base/ui/types/tooltip_anchor_props.js +1 -17
- package/dist/cjs/base/ui/ui.js +48 -49
- package/dist/cjs/base/ui/unstable_standalone_ui.js +27 -27
- package/dist/cjs/base/ui/use_base.js +1 -1
- package/dist/cjs/base/ui/use_cursor.js +5 -4
- package/dist/cjs/base/ui/use_form_field.js +1 -1
- package/dist/cjs/base/ui/use_loadable.js +25 -91
- package/dist/cjs/base/ui/use_record_action_data.js +4 -3
- package/dist/cjs/base/ui/use_records.js +9 -13
- package/dist/cjs/base/ui/use_session.js +1 -1
- package/dist/cjs/base/ui/use_settings_button.js +4 -3
- package/dist/cjs/base/ui/use_styled_system.js +7 -14
- package/dist/cjs/base/ui/use_text_color_for_background_color.js +4 -3
- package/dist/cjs/base/ui/use_view_metadata.js +4 -4
- package/dist/cjs/base/ui/use_viewport.js +2 -2
- package/dist/cjs/base/ui/view_picker.js +26 -70
- package/dist/cjs/base/ui/view_picker_synced.js +18 -40
- package/dist/cjs/base/ui/viewport_constraint.js +67 -114
- package/dist/cjs/base/ui/with_styled_system.js +25 -61
- package/dist/cjs/base/undo_redo.js +21 -32
- package/dist/cjs/base/unstable_testing_utils.js +27 -27
- package/dist/cjs/base/viewport.js +268 -312
- package/dist/cjs/injected/airtable_interface.js +4 -4
- package/dist/cjs/interface/assert_run_context.js +12 -0
- package/dist/cjs/interface/index.js +4 -18
- package/dist/cjs/interface/models/base.js +15 -34
- package/dist/cjs/interface/models/field.js +5 -19
- package/dist/cjs/interface/models/models.js +8 -7
- package/dist/cjs/interface/models/mutations.js +50 -66
- package/dist/cjs/interface/models/record.js +29 -49
- package/dist/cjs/interface/models/record_store.js +25 -57
- package/dist/cjs/interface/models/session.js +2 -16
- package/dist/cjs/interface/models/table.js +66 -95
- package/dist/cjs/interface/sdk.js +61 -87
- package/dist/cjs/interface/types/airtable_interface.js +2 -2
- package/dist/cjs/interface/types/mutations.js +3 -10
- package/dist/cjs/interface/ui/block_wrapper.js +56 -48
- package/dist/cjs/interface/ui/initialize_block.js +13 -28
- package/dist/cjs/interface/ui/ui.js +20 -19
- package/dist/cjs/interface/ui/use_base.js +1 -1
- package/dist/cjs/interface/ui/use_custom_properties.js +19 -35
- package/dist/cjs/interface/ui/use_records.js +6 -5
- package/dist/cjs/interface/ui/use_run_info.js +2 -2
- package/dist/cjs/interface/ui/use_session.js +1 -1
- package/dist/cjs/shared/color_utils.js +9 -16
- package/dist/cjs/shared/colors.js +2 -2
- package/dist/cjs/shared/error_utils.js +9 -11
- package/dist/cjs/shared/event_tracker.js +3 -3
- package/dist/cjs/shared/global_config.js +337 -449
- package/dist/cjs/shared/models/abstract_model.js +72 -97
- package/dist/cjs/shared/models/base_core.js +394 -514
- package/dist/cjs/shared/models/field_core.js +236 -279
- package/dist/cjs/shared/models/mutations_core.js +283 -379
- package/dist/cjs/shared/models/record_core.js +174 -231
- package/dist/cjs/shared/models/record_store_core.js +119 -172
- package/dist/cjs/shared/models/session_core.js +116 -170
- package/dist/cjs/shared/models/table_core.js +1258 -1501
- package/dist/cjs/shared/private_utils.js +54 -124
- package/dist/cjs/shared/sdk_core.js +68 -70
- package/dist/cjs/shared/types/field_core.js +1 -1
- package/dist/cjs/shared/types/mutation_constants.js +4 -4
- package/dist/cjs/shared/types/mutations_core.js +1 -1
- package/dist/cjs/shared/types/permission_levels.js +1 -1
- package/dist/cjs/shared/ui/global_config_synced_component_helpers.js +9 -9
- package/dist/cjs/shared/ui/loader.js +14 -35
- package/dist/cjs/shared/ui/remote_utils.js +5 -7
- package/dist/cjs/shared/ui/sdk_context.js +4 -8
- package/dist/cjs/shared/ui/use_array_identity.js +2 -2
- package/dist/cjs/shared/ui/use_base.js +6 -5
- package/dist/cjs/shared/ui/use_color_scheme.js +3 -8
- package/dist/cjs/shared/ui/use_global_config.js +5 -4
- package/dist/cjs/shared/ui/use_session.js +6 -5
- package/dist/cjs/shared/ui/use_synced.js +7 -5
- package/dist/cjs/shared/ui/use_watchable.js +13 -42
- package/dist/cjs/shared/ui/with_hooks.js +6 -13
- package/dist/cjs/shared/unstable_private_utils.js +4 -6
- package/dist/cjs/shared/warning.js +5 -5
- package/dist/cjs/shared/watchable.js +110 -176
- package/dist/cjs/stats/block_stats.js +62 -85
- package/dist/cjs/testing/base/abstract_mock_airtable_interface.js +208 -0
- package/dist/cjs/testing/interface/abstract_mock_airtable_interface.js +124 -0
- package/dist/types/src/base/assert_run_context.d.ts +2 -0
- package/dist/types/src/base/assert_run_context.d.ts.map +1 -0
- package/dist/types/src/base/index.d.ts +1 -0
- package/dist/types/src/base/index.d.ts.map +1 -1
- package/dist/types/src/base/models/models.d.ts +1 -0
- package/dist/types/src/base/models/models.d.ts.map +1 -1
- package/dist/types/src/base/models/mutations.d.ts.map +1 -1
- package/dist/types/src/base/sdk.d.ts.map +1 -1
- package/dist/types/src/base/ui/block_wrapper.d.ts +1 -1
- package/dist/types/src/base/ui/box.d.ts.map +1 -1
- package/dist/types/src/base/ui/button.d.ts +0 -5
- package/dist/types/src/base/ui/button.d.ts.map +1 -1
- package/dist/types/src/base/ui/cell_renderer.d.ts +1 -22
- package/dist/types/src/base/ui/cell_renderer.d.ts.map +1 -1
- package/dist/types/src/base/ui/choice_token.d.ts +1 -21
- package/dist/types/src/base/ui/choice_token.d.ts.map +1 -1
- package/dist/types/src/base/ui/collaborator_token.d.ts +0 -20
- package/dist/types/src/base/ui/collaborator_token.d.ts.map +1 -1
- package/dist/types/src/base/ui/color_palette.d.ts +1 -32
- package/dist/types/src/base/ui/color_palette.d.ts.map +1 -1
- package/dist/types/src/base/ui/color_palette_synced.d.ts +0 -14
- package/dist/types/src/base/ui/color_palette_synced.d.ts.map +1 -1
- package/dist/types/src/base/ui/confirmation_dialog.d.ts +0 -17
- package/dist/types/src/base/ui/confirmation_dialog.d.ts.map +1 -1
- package/dist/types/src/base/ui/control_sizes.d.ts +0 -1
- package/dist/types/src/base/ui/control_sizes.d.ts.map +1 -1
- package/dist/types/src/base/ui/dialog.d.ts +1 -23
- package/dist/types/src/base/ui/dialog.d.ts.map +1 -1
- package/dist/types/src/base/ui/dialog_close_button.d.ts +2 -24
- package/dist/types/src/base/ui/dialog_close_button.d.ts.map +1 -1
- package/dist/types/src/base/ui/field_icon.d.ts +1 -17
- package/dist/types/src/base/ui/field_icon.d.ts.map +1 -1
- package/dist/types/src/base/ui/field_picker.d.ts +0 -23
- package/dist/types/src/base/ui/field_picker.d.ts.map +1 -1
- package/dist/types/src/base/ui/field_picker_synced.d.ts.map +1 -1
- package/dist/types/src/base/ui/form_field.d.ts +0 -4
- package/dist/types/src/base/ui/form_field.d.ts.map +1 -1
- package/dist/types/src/base/ui/heading.d.ts +1 -1
- package/dist/types/src/base/ui/heading.d.ts.map +1 -1
- package/dist/types/src/base/ui/icon.d.ts +0 -16
- package/dist/types/src/base/ui/icon.d.ts.map +1 -1
- package/dist/types/src/base/ui/icon_config.d.ts +50 -51
- package/dist/types/src/base/ui/icon_config.d.ts.map +1 -1
- package/dist/types/src/base/ui/initialize_block.d.ts.map +1 -1
- package/dist/types/src/base/ui/input.d.ts +12 -46
- package/dist/types/src/base/ui/input.d.ts.map +1 -1
- package/dist/types/src/base/ui/input_synced.d.ts.map +1 -1
- package/dist/types/src/base/ui/label.d.ts.map +1 -1
- package/dist/types/src/base/ui/link.d.ts +1 -5
- package/dist/types/src/base/ui/link.d.ts.map +1 -1
- package/dist/types/src/base/ui/loader.d.ts +3 -20
- package/dist/types/src/base/ui/loader.d.ts.map +1 -1
- package/dist/types/src/base/ui/modal.d.ts +1 -14
- package/dist/types/src/base/ui/modal.d.ts.map +1 -1
- package/dist/types/src/base/ui/model_picker_select.d.ts.map +1 -1
- package/dist/types/src/base/ui/popover.d.ts +1 -17
- package/dist/types/src/base/ui/popover.d.ts.map +1 -1
- package/dist/types/src/base/ui/progress_bar.d.ts +1 -24
- package/dist/types/src/base/ui/progress_bar.d.ts.map +1 -1
- package/dist/types/src/base/ui/record_card.d.ts +1 -23
- package/dist/types/src/base/ui/record_card.d.ts.map +1 -1
- package/dist/types/src/base/ui/record_card_list.d.ts +1 -18
- package/dist/types/src/base/ui/record_card_list.d.ts.map +1 -1
- package/dist/types/src/base/ui/select.d.ts +0 -44
- package/dist/types/src/base/ui/select.d.ts.map +1 -1
- package/dist/types/src/base/ui/select_and_select_buttons_helpers.d.ts +0 -2
- package/dist/types/src/base/ui/select_and_select_buttons_helpers.d.ts.map +1 -1
- package/dist/types/src/base/ui/select_buttons.d.ts +0 -22
- package/dist/types/src/base/ui/select_buttons.d.ts.map +1 -1
- package/dist/types/src/base/ui/select_buttons_synced.d.ts.map +1 -1
- package/dist/types/src/base/ui/select_synced.d.ts.map +1 -1
- package/dist/types/src/base/ui/switch.d.ts +0 -22
- package/dist/types/src/base/ui/switch.d.ts.map +1 -1
- package/dist/types/src/base/ui/switch_synced.d.ts.map +1 -1
- package/dist/types/src/base/ui/synced.d.ts +2 -8
- package/dist/types/src/base/ui/synced.d.ts.map +1 -1
- package/dist/types/src/base/ui/system/all_styles_set.d.ts +0 -3
- package/dist/types/src/base/ui/system/all_styles_set.d.ts.map +1 -1
- package/dist/types/src/base/ui/system/appearance/appearance_set.d.ts +0 -1
- package/dist/types/src/base/ui/system/appearance/appearance_set.d.ts.map +1 -1
- package/dist/types/src/base/ui/system/appearance/background_color.d.ts +0 -1
- package/dist/types/src/base/ui/system/appearance/background_color.d.ts.map +1 -1
- package/dist/types/src/base/ui/system/appearance/border.d.ts +0 -1
- package/dist/types/src/base/ui/system/appearance/border.d.ts.map +1 -1
- package/dist/types/src/base/ui/system/appearance/border_radius.d.ts +0 -1
- package/dist/types/src/base/ui/system/appearance/border_radius.d.ts.map +1 -1
- package/dist/types/src/base/ui/system/appearance/box_shadow.d.ts +0 -1
- package/dist/types/src/base/ui/system/appearance/box_shadow.d.ts.map +1 -1
- package/dist/types/src/base/ui/system/appearance/opacity.d.ts +0 -1
- package/dist/types/src/base/ui/system/appearance/opacity.d.ts.map +1 -1
- package/dist/types/src/base/ui/system/dimensions/dimensions_set.d.ts +0 -1
- package/dist/types/src/base/ui/system/dimensions/dimensions_set.d.ts.map +1 -1
- package/dist/types/src/base/ui/system/dimensions/height.d.ts +0 -1
- package/dist/types/src/base/ui/system/dimensions/height.d.ts.map +1 -1
- package/dist/types/src/base/ui/system/dimensions/max_height.d.ts +0 -1
- package/dist/types/src/base/ui/system/dimensions/max_height.d.ts.map +1 -1
- package/dist/types/src/base/ui/system/dimensions/max_width.d.ts +0 -1
- package/dist/types/src/base/ui/system/dimensions/max_width.d.ts.map +1 -1
- package/dist/types/src/base/ui/system/dimensions/min_height.d.ts +0 -1
- package/dist/types/src/base/ui/system/dimensions/min_height.d.ts.map +1 -1
- package/dist/types/src/base/ui/system/dimensions/min_width.d.ts +0 -1
- package/dist/types/src/base/ui/system/dimensions/min_width.d.ts.map +1 -1
- package/dist/types/src/base/ui/system/dimensions/width.d.ts +0 -1
- package/dist/types/src/base/ui/system/dimensions/width.d.ts.map +1 -1
- package/dist/types/src/base/ui/system/display.d.ts +0 -1
- package/dist/types/src/base/ui/system/display.d.ts.map +1 -1
- package/dist/types/src/base/ui/system/flex_container/align_content.d.ts +0 -1
- package/dist/types/src/base/ui/system/flex_container/align_content.d.ts.map +1 -1
- package/dist/types/src/base/ui/system/flex_container/align_items.d.ts +0 -1
- package/dist/types/src/base/ui/system/flex_container/align_items.d.ts.map +1 -1
- package/dist/types/src/base/ui/system/flex_container/flex_container_set.d.ts +0 -1
- package/dist/types/src/base/ui/system/flex_container/flex_container_set.d.ts.map +1 -1
- package/dist/types/src/base/ui/system/flex_container/flex_direction.d.ts +0 -1
- package/dist/types/src/base/ui/system/flex_container/flex_direction.d.ts.map +1 -1
- package/dist/types/src/base/ui/system/flex_container/flex_wrap.d.ts +0 -1
- package/dist/types/src/base/ui/system/flex_container/flex_wrap.d.ts.map +1 -1
- package/dist/types/src/base/ui/system/flex_container/justify_content.d.ts +0 -1
- package/dist/types/src/base/ui/system/flex_container/justify_content.d.ts.map +1 -1
- package/dist/types/src/base/ui/system/flex_container/justify_items.d.ts +0 -1
- package/dist/types/src/base/ui/system/flex_container/justify_items.d.ts.map +1 -1
- package/dist/types/src/base/ui/system/flex_item/align_self.d.ts +0 -1
- package/dist/types/src/base/ui/system/flex_item/align_self.d.ts.map +1 -1
- package/dist/types/src/base/ui/system/flex_item/flex.d.ts +0 -1
- package/dist/types/src/base/ui/system/flex_item/flex.d.ts.map +1 -1
- package/dist/types/src/base/ui/system/flex_item/flex_basis.d.ts +0 -1
- package/dist/types/src/base/ui/system/flex_item/flex_basis.d.ts.map +1 -1
- package/dist/types/src/base/ui/system/flex_item/flex_grow.d.ts +0 -1
- package/dist/types/src/base/ui/system/flex_item/flex_grow.d.ts.map +1 -1
- package/dist/types/src/base/ui/system/flex_item/flex_item_set.d.ts +0 -1
- package/dist/types/src/base/ui/system/flex_item/flex_item_set.d.ts.map +1 -1
- package/dist/types/src/base/ui/system/flex_item/flex_shrink.d.ts +0 -1
- package/dist/types/src/base/ui/system/flex_item/flex_shrink.d.ts.map +1 -1
- package/dist/types/src/base/ui/system/flex_item/justify_self.d.ts +0 -1
- package/dist/types/src/base/ui/system/flex_item/justify_self.d.ts.map +1 -1
- package/dist/types/src/base/ui/system/flex_item/order.d.ts +0 -1
- package/dist/types/src/base/ui/system/flex_item/order.d.ts.map +1 -1
- package/dist/types/src/base/ui/system/index.d.ts +52 -52
- package/dist/types/src/base/ui/system/index.d.ts.map +1 -1
- package/dist/types/src/base/ui/system/overflow.d.ts +0 -1
- package/dist/types/src/base/ui/system/overflow.d.ts.map +1 -1
- package/dist/types/src/base/ui/system/position/bottom.d.ts +0 -1
- package/dist/types/src/base/ui/system/position/bottom.d.ts.map +1 -1
- package/dist/types/src/base/ui/system/position/left.d.ts +0 -1
- package/dist/types/src/base/ui/system/position/left.d.ts.map +1 -1
- package/dist/types/src/base/ui/system/position/position.d.ts +0 -1
- package/dist/types/src/base/ui/system/position/position.d.ts.map +1 -1
- package/dist/types/src/base/ui/system/position/position_set.d.ts +0 -1
- package/dist/types/src/base/ui/system/position/position_set.d.ts.map +1 -1
- package/dist/types/src/base/ui/system/position/right.d.ts +0 -1
- package/dist/types/src/base/ui/system/position/right.d.ts.map +1 -1
- package/dist/types/src/base/ui/system/position/top.d.ts +0 -1
- package/dist/types/src/base/ui/system/position/top.d.ts.map +1 -1
- package/dist/types/src/base/ui/system/position/z_index.d.ts +0 -1
- package/dist/types/src/base/ui/system/position/z_index.d.ts.map +1 -1
- package/dist/types/src/base/ui/system/spacing/margin.d.ts +0 -1
- package/dist/types/src/base/ui/system/spacing/margin.d.ts.map +1 -1
- package/dist/types/src/base/ui/system/spacing/padding.d.ts +0 -1
- package/dist/types/src/base/ui/system/spacing/padding.d.ts.map +1 -1
- package/dist/types/src/base/ui/system/spacing/spacing_set.d.ts +0 -1
- package/dist/types/src/base/ui/system/spacing/spacing_set.d.ts.map +1 -1
- package/dist/types/src/base/ui/system/typography/font_family.d.ts +0 -1
- package/dist/types/src/base/ui/system/typography/font_family.d.ts.map +1 -1
- package/dist/types/src/base/ui/system/typography/font_size.d.ts +0 -1
- package/dist/types/src/base/ui/system/typography/font_size.d.ts.map +1 -1
- package/dist/types/src/base/ui/system/typography/font_style.d.ts +0 -1
- package/dist/types/src/base/ui/system/typography/font_style.d.ts.map +1 -1
- package/dist/types/src/base/ui/system/typography/font_weight.d.ts +0 -1
- package/dist/types/src/base/ui/system/typography/font_weight.d.ts.map +1 -1
- package/dist/types/src/base/ui/system/typography/letter_spacing.d.ts +0 -1
- package/dist/types/src/base/ui/system/typography/letter_spacing.d.ts.map +1 -1
- package/dist/types/src/base/ui/system/typography/line_height.d.ts +0 -1
- package/dist/types/src/base/ui/system/typography/line_height.d.ts.map +1 -1
- package/dist/types/src/base/ui/system/typography/text_align.d.ts +0 -1
- package/dist/types/src/base/ui/system/typography/text_align.d.ts.map +1 -1
- package/dist/types/src/base/ui/system/typography/text_color.d.ts +0 -1
- package/dist/types/src/base/ui/system/typography/text_color.d.ts.map +1 -1
- package/dist/types/src/base/ui/system/typography/text_decoration.d.ts +0 -1
- package/dist/types/src/base/ui/system/typography/text_decoration.d.ts.map +1 -1
- package/dist/types/src/base/ui/system/typography/text_transform.d.ts +0 -1
- package/dist/types/src/base/ui/system/typography/text_transform.d.ts.map +1 -1
- package/dist/types/src/base/ui/system/typography/typography_set.d.ts +0 -1
- package/dist/types/src/base/ui/system/typography/typography_set.d.ts.map +1 -1
- package/dist/types/src/base/ui/table_picker.d.ts +0 -21
- package/dist/types/src/base/ui/table_picker.d.ts.map +1 -1
- package/dist/types/src/base/ui/table_picker_synced.d.ts.map +1 -1
- package/dist/types/src/base/ui/text.d.ts +0 -3
- package/dist/types/src/base/ui/text.d.ts.map +1 -1
- package/dist/types/src/base/ui/text_button.d.ts +1 -5
- package/dist/types/src/base/ui/text_button.d.ts.map +1 -1
- package/dist/types/src/base/ui/theme/default_theme/index.d.ts +1 -1
- package/dist/types/src/base/ui/theme/theme_context.d.ts +1 -1
- package/dist/types/src/base/ui/theme/use_theme.d.ts +1 -1
- package/dist/types/src/base/ui/tooltip.d.ts +0 -16
- package/dist/types/src/base/ui/tooltip.d.ts.map +1 -1
- package/dist/types/src/base/ui/types/aria_props.d.ts.map +1 -1
- package/dist/types/src/base/ui/types/data_attributes_prop.d.ts +0 -4
- package/dist/types/src/base/ui/types/data_attributes_prop.d.ts.map +1 -1
- package/dist/types/src/base/ui/types/tooltip_anchor_props.d.ts +0 -7
- package/dist/types/src/base/ui/types/tooltip_anchor_props.d.ts.map +1 -1
- package/dist/types/src/base/ui/ui.d.ts +1 -0
- package/dist/types/src/base/ui/ui.d.ts.map +1 -1
- package/dist/types/src/base/ui/view_picker.d.ts +0 -23
- package/dist/types/src/base/ui/view_picker.d.ts.map +1 -1
- package/dist/types/src/base/ui/view_picker_synced.d.ts.map +1 -1
- package/dist/types/src/base/ui/viewport_constraint.d.ts +1 -14
- package/dist/types/src/base/ui/viewport_constraint.d.ts.map +1 -1
- package/dist/types/src/base/unstable_testing_utils.d.ts +1 -1
- package/dist/types/src/base/unstable_testing_utils.d.ts.map +1 -1
- package/dist/types/src/interface/assert_run_context.d.ts +2 -0
- package/dist/types/src/interface/assert_run_context.d.ts.map +1 -0
- package/dist/types/src/interface/index.d.ts +1 -6
- package/dist/types/src/interface/index.d.ts.map +1 -1
- package/dist/types/src/interface/models/models.d.ts +1 -0
- package/dist/types/src/interface/models/models.d.ts.map +1 -1
- package/dist/types/src/interface/models/mutations.d.ts.map +1 -1
- package/dist/types/src/interface/ui/initialize_block.d.ts.map +1 -1
- package/dist/types/src/interface/ui/ui.d.ts +1 -0
- package/dist/types/src/interface/ui/ui.d.ts.map +1 -1
- package/dist/types/src/interface/ui/use_custom_properties.d.ts +1 -1
- package/dist/types/src/shared/models/mutations_core.d.ts.map +1 -1
- package/dist/types/src/shared/private_utils.d.ts +0 -9
- package/dist/types/src/shared/private_utils.d.ts.map +1 -1
- package/dist/types/src/shared/ui/global_config_synced_component_helpers.d.ts +0 -2
- package/dist/types/src/shared/ui/global_config_synced_component_helpers.d.ts.map +1 -1
- package/dist/types/src/shared/ui/loader.d.ts.map +1 -1
- package/dist/types/src/shared/ui/with_hooks.d.ts +2 -2
- package/dist/types/src/shared/ui/with_hooks.d.ts.map +1 -1
- package/dist/types/src/testing/{abstract_mock_airtable_interface.d.ts → base/abstract_mock_airtable_interface.d.ts} +13 -13
- package/dist/types/src/testing/base/abstract_mock_airtable_interface.d.ts.map +1 -0
- package/dist/types/src/testing/interface/abstract_mock_airtable_interface.d.ts +51 -0
- package/dist/types/src/testing/interface/abstract_mock_airtable_interface.d.ts.map +1 -0
- package/package.json +13 -13
- package/dist/cjs/base/ui/system/utils/create_responsive_prop_type.js +0 -19
- package/dist/cjs/base/ui/system/utils/create_style_prop_types.js +0 -24
- package/dist/cjs/base/ui/system/utils/enum_prop_type_utils.js +0 -35
- package/dist/cjs/testing/abstract_mock_airtable_interface.js +0 -277
- package/dist/types/src/base/ui/system/utils/create_responsive_prop_type.d.ts +0 -2
- package/dist/types/src/base/ui/system/utils/create_responsive_prop_type.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/utils/create_style_prop_types.d.ts +0 -4
- package/dist/types/src/base/ui/system/utils/create_style_prop_types.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/utils/enum_prop_type_utils.d.ts +0 -21
- package/dist/types/src/base/ui/system/utils/enum_prop_type_utils.d.ts.map +0 -1
- package/dist/types/src/testing/abstract_mock_airtable_interface.d.ts.map +0 -1
|
@@ -1,28 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
|
5
4
|
value: true
|
|
6
5
|
});
|
|
7
6
|
exports.default = void 0;
|
|
8
|
-
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
9
|
-
require("core-js/modules/es.array.filter.js");
|
|
10
|
-
require("core-js/modules/es.array.iterator.js");
|
|
11
|
-
require("core-js/modules/es.object.to-string.js");
|
|
12
|
-
require("core-js/modules/es.set.js");
|
|
13
|
-
require("core-js/modules/web.dom-collections.iterator.js");
|
|
14
|
-
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
15
|
-
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
16
|
-
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
17
|
-
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
18
|
-
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
19
|
-
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
20
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
21
7
|
var _field_core = require("../../shared/models/field_core");
|
|
22
8
|
var _mutations = require("../types/mutations");
|
|
23
9
|
var _private_utils = require("../../shared/private_utils");
|
|
24
|
-
|
|
25
|
-
|
|
10
|
+
/** @module @airtable/blocks/models: Field */ /** */
|
|
11
|
+
|
|
26
12
|
/**
|
|
27
13
|
* Model class representing a field in a table.
|
|
28
14
|
*
|
|
@@ -36,392 +22,318 @@ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.
|
|
|
36
22
|
* ```
|
|
37
23
|
* @docsPath models/Field
|
|
38
24
|
*/
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
25
|
+
class Field extends _field_core.FieldCore {
|
|
26
|
+
/** @internal */
|
|
27
|
+
static _className = 'Field';
|
|
28
|
+
|
|
29
|
+
// The following method is untested because its implementation resists
|
|
30
|
+
// testing and because it is expected to be redesigned.
|
|
31
|
+
// istanbul ignore next
|
|
32
|
+
/**
|
|
33
|
+
* A list of available aggregators given this field's configuration.
|
|
34
|
+
*
|
|
35
|
+
* @example
|
|
36
|
+
* ```js
|
|
37
|
+
* const fieldAggregators = myField.availableAggregators;
|
|
38
|
+
* ```
|
|
39
|
+
*/
|
|
40
|
+
get availableAggregators() {
|
|
41
|
+
const airtableInterface = this._sdk.__airtableInterface;
|
|
42
|
+
const availableAggregatorKeysSet = new Set(airtableInterface.aggregators.getAvailableAggregatorKeysForField(this._data));
|
|
43
|
+
const {
|
|
44
|
+
aggregators
|
|
45
|
+
} = require('./models');
|
|
46
|
+
return (0, _private_utils.values)(aggregators).filter(aggregator => {
|
|
47
|
+
return availableAggregatorKeysSet.has(aggregator.key);
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
// The following method is untested because its implementation resists
|
|
51
|
+
// testing and because it is expected to be redesigned.
|
|
52
|
+
// istanbul ignore next
|
|
53
|
+
/**
|
|
54
|
+
* Checks if the given aggregator is available for this field.
|
|
55
|
+
*
|
|
56
|
+
* @param aggregator The aggregator object or aggregator key.
|
|
57
|
+
* @example
|
|
58
|
+
* ```js
|
|
59
|
+
* import {aggregators} from '@airtable/blocks/base/models';
|
|
60
|
+
* const aggregator = aggregators.totalAttachmentSize;
|
|
61
|
+
*
|
|
62
|
+
* // Using an aggregator object
|
|
63
|
+
* console.log(myAttachmentField.isAggregatorAvailable(aggregator));
|
|
64
|
+
* // => true
|
|
65
|
+
*
|
|
66
|
+
* // Using an aggregator key
|
|
67
|
+
* console.log(myTextField.isAggregatorAvailable('totalAttachmentSize'));
|
|
68
|
+
* // => false
|
|
69
|
+
* ```
|
|
70
|
+
*/
|
|
71
|
+
isAggregatorAvailable(aggregator) {
|
|
72
|
+
const aggregatorKey = typeof aggregator === 'string' ? aggregator : aggregator.key;
|
|
73
|
+
const airtableInterface = this._sdk.__airtableInterface;
|
|
74
|
+
const availableAggregatorKeys = airtableInterface.aggregators.getAvailableAggregatorKeysForField(this._data);
|
|
75
|
+
return availableAggregatorKeys.some(key => key === aggregatorKey);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* Checks whether the current user has permission to perform the given name update.
|
|
80
|
+
*
|
|
81
|
+
* Accepts partial input, in the same format as {@link updateNameAsync}.
|
|
82
|
+
*
|
|
83
|
+
* Returns `{hasPermission: true}` if the current user can update the specified field,
|
|
84
|
+
* `{hasPermission: false, reasonDisplayString: string}` otherwise. `reasonDisplayString` may be
|
|
85
|
+
* used to display an error message to the user.
|
|
86
|
+
*
|
|
87
|
+
* @param name new name for the field
|
|
88
|
+
*
|
|
89
|
+
* @example
|
|
90
|
+
* ```js
|
|
91
|
+
* const updateFieldCheckResult = field.checkPermissionsForUpdateName();
|
|
92
|
+
*
|
|
93
|
+
* if (!updateFieldCheckResult.hasPermission) {
|
|
94
|
+
* alert(updateFieldCheckResult.reasonDisplayString);
|
|
95
|
+
* }
|
|
96
|
+
* ```
|
|
97
|
+
*/
|
|
98
|
+
checkPermissionsForUpdateName(name) {
|
|
99
|
+
return this._sdk.__mutations.checkPermissionsForMutation({
|
|
100
|
+
type: _mutations.MutationTypes.UPDATE_SINGLE_FIELD_NAME,
|
|
101
|
+
tableId: this.parentTable.id,
|
|
102
|
+
id: this.id,
|
|
103
|
+
name
|
|
104
|
+
});
|
|
43
105
|
}
|
|
44
|
-
(0, _inherits2.default)(Field, _FieldCore);
|
|
45
|
-
return (0, _createClass2.default)(Field, [{
|
|
46
|
-
key: "availableAggregators",
|
|
47
|
-
get:
|
|
48
|
-
// The following method is untested because its implementation resists
|
|
49
|
-
// testing and because it is expected to be redesigned.
|
|
50
|
-
// istanbul ignore next
|
|
51
|
-
/**
|
|
52
|
-
* A list of available aggregators given this field's configuration.
|
|
53
|
-
*
|
|
54
|
-
* @example
|
|
55
|
-
* ```js
|
|
56
|
-
* const fieldAggregators = myField.availableAggregators;
|
|
57
|
-
* ```
|
|
58
|
-
*/
|
|
59
|
-
function get() {
|
|
60
|
-
var airtableInterface = this._sdk.__airtableInterface;
|
|
61
|
-
var availableAggregatorKeysSet = new Set(airtableInterface.aggregators.getAvailableAggregatorKeysForField(this._data));
|
|
62
|
-
var _require = require('./models'),
|
|
63
|
-
aggregators = _require.aggregators;
|
|
64
|
-
return (0, _private_utils.values)(aggregators).filter(aggregator => {
|
|
65
|
-
return availableAggregatorKeysSet.has(aggregator.key);
|
|
66
|
-
});
|
|
67
|
-
}
|
|
68
|
-
// The following method is untested because its implementation resists
|
|
69
|
-
// testing and because it is expected to be redesigned.
|
|
70
|
-
// istanbul ignore next
|
|
71
|
-
/**
|
|
72
|
-
* Checks if the given aggregator is available for this field.
|
|
73
|
-
*
|
|
74
|
-
* @param aggregator The aggregator object or aggregator key.
|
|
75
|
-
* @example
|
|
76
|
-
* ```js
|
|
77
|
-
* import {aggregators} from '@airtable/blocks/base/models';
|
|
78
|
-
* const aggregator = aggregators.totalAttachmentSize;
|
|
79
|
-
*
|
|
80
|
-
* // Using an aggregator object
|
|
81
|
-
* console.log(myAttachmentField.isAggregatorAvailable(aggregator));
|
|
82
|
-
* // => true
|
|
83
|
-
*
|
|
84
|
-
* // Using an aggregator key
|
|
85
|
-
* console.log(myTextField.isAggregatorAvailable('totalAttachmentSize'));
|
|
86
|
-
* // => false
|
|
87
|
-
* ```
|
|
88
|
-
*/
|
|
89
|
-
}, {
|
|
90
|
-
key: "isAggregatorAvailable",
|
|
91
|
-
value: function isAggregatorAvailable(aggregator) {
|
|
92
|
-
var aggregatorKey = typeof aggregator === 'string' ? aggregator : aggregator.key;
|
|
93
|
-
var airtableInterface = this._sdk.__airtableInterface;
|
|
94
|
-
var availableAggregatorKeys = airtableInterface.aggregators.getAvailableAggregatorKeysForField(this._data);
|
|
95
|
-
return availableAggregatorKeys.some(key => key === aggregatorKey);
|
|
96
|
-
}
|
|
97
106
|
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
}
|
|
119
|
-
key: "checkPermissionsForUpdateName",
|
|
120
|
-
value: function checkPermissionsForUpdateName(name) {
|
|
121
|
-
return this._sdk.__mutations.checkPermissionsForMutation({
|
|
122
|
-
type: _mutations.MutationTypes.UPDATE_SINGLE_FIELD_NAME,
|
|
123
|
-
tableId: this.parentTable.id,
|
|
124
|
-
id: this.id,
|
|
125
|
-
name
|
|
126
|
-
});
|
|
127
|
-
}
|
|
107
|
+
/**
|
|
108
|
+
* An alias for `checkPermissionsForUpdateName(options).hasPermission`.
|
|
109
|
+
*
|
|
110
|
+
* Checks whether the current user has permission to perform the name update.
|
|
111
|
+
*
|
|
112
|
+
* Accepts partial input, in the same format as {@link updateNameAsync}.
|
|
113
|
+
*
|
|
114
|
+
* @param name new name for the field
|
|
115
|
+
*
|
|
116
|
+
* @example
|
|
117
|
+
* ```js
|
|
118
|
+
* const canUpdateField = field.hasPermissionToUpdateName();
|
|
119
|
+
*
|
|
120
|
+
* if (!canUpdateField) {
|
|
121
|
+
* alert('not allowed!');
|
|
122
|
+
* }
|
|
123
|
+
* ```
|
|
124
|
+
*/
|
|
125
|
+
hasPermissionToUpdateName(name) {
|
|
126
|
+
return this.checkPermissionsForUpdateName(name).hasPermission;
|
|
127
|
+
}
|
|
128
128
|
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
129
|
+
/**
|
|
130
|
+
* Updates the name for this field.
|
|
131
|
+
*
|
|
132
|
+
* Throws an error if the user does not have permission to update the field, or if an invalid
|
|
133
|
+
* name is provided.
|
|
134
|
+
*
|
|
135
|
+
* This action is asynchronous. Unlike updates to cell values, updates to field name are
|
|
136
|
+
* **not** applied optimistically locally. You must `await` the returned promise before
|
|
137
|
+
* relying on the change in your extension.
|
|
138
|
+
*
|
|
139
|
+
* @param name new name for the field
|
|
140
|
+
*
|
|
141
|
+
* @example
|
|
142
|
+
* ```js
|
|
143
|
+
* await myTextField.updateNameAsync('My New Name');
|
|
144
|
+
* ```
|
|
145
|
+
*/
|
|
146
|
+
async updateNameAsync(name) {
|
|
147
|
+
await this._sdk.__mutations.applyMutationAsync({
|
|
148
|
+
type: _mutations.MutationTypes.UPDATE_SINGLE_FIELD_NAME,
|
|
149
|
+
tableId: this.parentTable.id,
|
|
150
|
+
id: this.id,
|
|
151
|
+
name
|
|
152
|
+
});
|
|
153
|
+
}
|
|
152
154
|
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
*
|
|
204
|
-
* @param description new description for the field
|
|
205
|
-
*
|
|
206
|
-
* @example
|
|
207
|
-
* ```js
|
|
208
|
-
* const updateFieldCheckResult = field.checkPermissionsForUpdateDescription();
|
|
209
|
-
*
|
|
210
|
-
* if (!updateFieldCheckResult.hasPermission) {
|
|
211
|
-
* alert(updateFieldCheckResult.reasonDisplayString);
|
|
212
|
-
* }
|
|
213
|
-
* ```
|
|
214
|
-
*/
|
|
215
|
-
)
|
|
216
|
-
}, {
|
|
217
|
-
key: "checkPermissionsForUpdateDescription",
|
|
218
|
-
value: function checkPermissionsForUpdateDescription(description) {
|
|
219
|
-
return this._sdk.__mutations.checkPermissionsForMutation({
|
|
220
|
-
type: _mutations.MutationTypes.UPDATE_SINGLE_FIELD_DESCRIPTION,
|
|
221
|
-
tableId: this.parentTable.id,
|
|
222
|
-
id: this.id,
|
|
223
|
-
description
|
|
224
|
-
});
|
|
225
|
-
}
|
|
155
|
+
/**
|
|
156
|
+
* Checks whether the current user has permission to perform the given description update.
|
|
157
|
+
*
|
|
158
|
+
* Accepts partial input, in the same format as {@link updateDescriptionAsync}.
|
|
159
|
+
*
|
|
160
|
+
* Returns `{hasPermission: true}` if the current user can update the specified field,
|
|
161
|
+
* `{hasPermission: false, reasonDisplayString: string}` otherwise. `reasonDisplayString` may be
|
|
162
|
+
* used to display an error message to the user.
|
|
163
|
+
*
|
|
164
|
+
* @param description new description for the field
|
|
165
|
+
*
|
|
166
|
+
* @example
|
|
167
|
+
* ```js
|
|
168
|
+
* const updateFieldCheckResult = field.checkPermissionsForUpdateDescription();
|
|
169
|
+
*
|
|
170
|
+
* if (!updateFieldCheckResult.hasPermission) {
|
|
171
|
+
* alert(updateFieldCheckResult.reasonDisplayString);
|
|
172
|
+
* }
|
|
173
|
+
* ```
|
|
174
|
+
*/
|
|
175
|
+
checkPermissionsForUpdateDescription(description) {
|
|
176
|
+
return this._sdk.__mutations.checkPermissionsForMutation({
|
|
177
|
+
type: _mutations.MutationTypes.UPDATE_SINGLE_FIELD_DESCRIPTION,
|
|
178
|
+
tableId: this.parentTable.id,
|
|
179
|
+
id: this.id,
|
|
180
|
+
description
|
|
181
|
+
});
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
/**
|
|
185
|
+
* An alias for `checkPermissionsForUpdateDescription(options).hasPermission`.
|
|
186
|
+
*
|
|
187
|
+
* Checks whether the current user has permission to perform the description update.
|
|
188
|
+
*
|
|
189
|
+
* Accepts partial input, in the same format as {@link updateDescriptionAsync}.
|
|
190
|
+
*
|
|
191
|
+
* @param description new description for the field
|
|
192
|
+
*
|
|
193
|
+
* @example
|
|
194
|
+
* ```js
|
|
195
|
+
* const canUpdateField = field.hasPermissionToUpdateDescription();
|
|
196
|
+
*
|
|
197
|
+
* if (!canUpdateField) {
|
|
198
|
+
* alert('not allowed!');
|
|
199
|
+
* }
|
|
200
|
+
* ```
|
|
201
|
+
*/
|
|
202
|
+
hasPermissionToUpdateDescription(description) {
|
|
203
|
+
return this.checkPermissionsForUpdateDescription(description).hasPermission;
|
|
204
|
+
}
|
|
226
205
|
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
206
|
+
/**
|
|
207
|
+
* Updates the description for this field.
|
|
208
|
+
*
|
|
209
|
+
* To remove an existing description, pass `''` as the new description.
|
|
210
|
+
* `null` is also accepted and will be coerced to `''` for consistency with field creation.
|
|
211
|
+
*
|
|
212
|
+
* Throws an error if the user does not have permission to update the field, or if an invalid
|
|
213
|
+
* description is provided.
|
|
214
|
+
*
|
|
215
|
+
* This action is asynchronous. Unlike updates to cell values, updates to field descriptions are
|
|
216
|
+
* **not** applied optimistically locally. You must `await` the returned promise before
|
|
217
|
+
* relying on the change in your extension.
|
|
218
|
+
*
|
|
219
|
+
* @param description new description for the field
|
|
220
|
+
*
|
|
221
|
+
* @example
|
|
222
|
+
* ```js
|
|
223
|
+
* await myTextField.updateDescriptionAsync('This is a text field');
|
|
224
|
+
* ```
|
|
225
|
+
*/
|
|
226
|
+
async updateDescriptionAsync(description) {
|
|
227
|
+
await this._sdk.__mutations.applyMutationAsync({
|
|
228
|
+
type: _mutations.MutationTypes.UPDATE_SINGLE_FIELD_DESCRIPTION,
|
|
229
|
+
tableId: this.parentTable.id,
|
|
230
|
+
id: this.id,
|
|
231
|
+
description
|
|
232
|
+
});
|
|
233
|
+
}
|
|
250
234
|
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
return this._sdk.__mutations.applyMutationAsync({
|
|
280
|
-
type: _mutations.MutationTypes.UPDATE_SINGLE_FIELD_DESCRIPTION,
|
|
281
|
-
tableId: this.parentTable.id,
|
|
282
|
-
id: this.id,
|
|
283
|
-
description
|
|
284
|
-
});
|
|
285
|
-
case 2:
|
|
286
|
-
case "end":
|
|
287
|
-
return _context2.stop();
|
|
288
|
-
}
|
|
289
|
-
}, _callee2, this);
|
|
290
|
-
}));
|
|
291
|
-
function updateDescriptionAsync(_x2) {
|
|
292
|
-
return _updateDescriptionAsync.apply(this, arguments);
|
|
235
|
+
/**
|
|
236
|
+
* Checks whether the current user has permission to perform the given options update.
|
|
237
|
+
*
|
|
238
|
+
* Accepts partial input, in the same format as {@link updateOptionsAsync}.
|
|
239
|
+
*
|
|
240
|
+
* Returns `{hasPermission: true}` if the current user can update the specified field,
|
|
241
|
+
* `{hasPermission: false, reasonDisplayString: string}` otherwise. `reasonDisplayString` may be
|
|
242
|
+
* used to display an error message to the user.
|
|
243
|
+
*
|
|
244
|
+
* @param options new options for the field
|
|
245
|
+
*
|
|
246
|
+
* @example
|
|
247
|
+
* ```js
|
|
248
|
+
* const updateFieldCheckResult = field.checkPermissionsForUpdateOptions();
|
|
249
|
+
*
|
|
250
|
+
* if (!updateFieldCheckResult.hasPermission) {
|
|
251
|
+
* alert(updateFieldCheckResult.reasonDisplayString);
|
|
252
|
+
* }
|
|
253
|
+
* ```
|
|
254
|
+
*/
|
|
255
|
+
checkPermissionsForUpdateOptions(options) {
|
|
256
|
+
return this._sdk.__mutations.checkPermissionsForMutation({
|
|
257
|
+
type: _mutations.MutationTypes.UPDATE_SINGLE_FIELD_CONFIG,
|
|
258
|
+
tableId: this.parentTable.id,
|
|
259
|
+
id: this.id,
|
|
260
|
+
config: {
|
|
261
|
+
type: this.type,
|
|
262
|
+
options: options
|
|
293
263
|
}
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
/**
|
|
297
|
-
* Checks whether the current user has permission to perform the given options update.
|
|
298
|
-
*
|
|
299
|
-
* Accepts partial input, in the same format as {@link updateOptionsAsync}.
|
|
300
|
-
*
|
|
301
|
-
* Returns `{hasPermission: true}` if the current user can update the specified field,
|
|
302
|
-
* `{hasPermission: false, reasonDisplayString: string}` otherwise. `reasonDisplayString` may be
|
|
303
|
-
* used to display an error message to the user.
|
|
304
|
-
*
|
|
305
|
-
* @param options new options for the field
|
|
306
|
-
*
|
|
307
|
-
* @example
|
|
308
|
-
* ```js
|
|
309
|
-
* const updateFieldCheckResult = field.checkPermissionsForUpdateOptions();
|
|
310
|
-
*
|
|
311
|
-
* if (!updateFieldCheckResult.hasPermission) {
|
|
312
|
-
* alert(updateFieldCheckResult.reasonDisplayString);
|
|
313
|
-
* }
|
|
314
|
-
* ```
|
|
315
|
-
*/
|
|
316
|
-
)
|
|
317
|
-
}, {
|
|
318
|
-
key: "checkPermissionsForUpdateOptions",
|
|
319
|
-
value: function checkPermissionsForUpdateOptions(options) {
|
|
320
|
-
return this._sdk.__mutations.checkPermissionsForMutation({
|
|
321
|
-
type: _mutations.MutationTypes.UPDATE_SINGLE_FIELD_CONFIG,
|
|
322
|
-
tableId: this.parentTable.id,
|
|
323
|
-
id: this.id,
|
|
324
|
-
config: {
|
|
325
|
-
type: this.type,
|
|
326
|
-
options: options
|
|
327
|
-
}
|
|
328
|
-
});
|
|
329
|
-
}
|
|
264
|
+
});
|
|
265
|
+
}
|
|
330
266
|
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
return this.checkPermissionsForUpdateOptions(options).hasPermission;
|
|
353
|
-
}
|
|
267
|
+
/**
|
|
268
|
+
* An alias for `checkPermissionsForUpdateOptions(options).hasPermission`.
|
|
269
|
+
*
|
|
270
|
+
* Checks whether the current user has permission to perform the options update.
|
|
271
|
+
*
|
|
272
|
+
* Accepts partial input, in the same format as {@link updateOptionsAsync}.
|
|
273
|
+
*
|
|
274
|
+
* @param options new options for the field
|
|
275
|
+
*
|
|
276
|
+
* @example
|
|
277
|
+
* ```js
|
|
278
|
+
* const canUpdateField = field.hasPermissionToUpdateOptions();
|
|
279
|
+
*
|
|
280
|
+
* if (!canUpdateField) {
|
|
281
|
+
* alert('not allowed!');
|
|
282
|
+
* }
|
|
283
|
+
* ```
|
|
284
|
+
*/
|
|
285
|
+
hasPermissionToUpdateOptions(options) {
|
|
286
|
+
return this.checkPermissionsForUpdateOptions(options).hasPermission;
|
|
287
|
+
}
|
|
354
288
|
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
id: this.id,
|
|
406
|
-
config: {
|
|
407
|
-
type: this.type,
|
|
408
|
-
options: options
|
|
409
|
-
},
|
|
410
|
-
opts
|
|
411
|
-
});
|
|
412
|
-
case 3:
|
|
413
|
-
case "end":
|
|
414
|
-
return _context3.stop();
|
|
415
|
-
}
|
|
416
|
-
}, _callee3, this);
|
|
417
|
-
}));
|
|
418
|
-
function updateOptionsAsync(_x3) {
|
|
419
|
-
return _updateOptionsAsync.apply(this, arguments);
|
|
420
|
-
}
|
|
421
|
-
return updateOptionsAsync;
|
|
422
|
-
}())
|
|
423
|
-
}]);
|
|
424
|
-
}(_field_core.FieldCore);
|
|
425
|
-
/** @internal */
|
|
426
|
-
(0, _defineProperty2.default)(Field, "_className", 'Field');
|
|
289
|
+
/**
|
|
290
|
+
* Updates the options for this field.
|
|
291
|
+
*
|
|
292
|
+
* Throws an error if the user does not have permission to update the field, if invalid
|
|
293
|
+
* options are provided, if this field has no writable options, or if updates to this field
|
|
294
|
+
* type is not supported.
|
|
295
|
+
*
|
|
296
|
+
* Refer to {@link FieldType} for supported field types, the write format for options, and
|
|
297
|
+
* other specifics for certain field types.
|
|
298
|
+
*
|
|
299
|
+
* This action is asynchronous. Unlike updates to cell values, updates to field options are
|
|
300
|
+
* **not** applied optimistically locally. You must `await` the returned promise before
|
|
301
|
+
* relying on the change in your extension.
|
|
302
|
+
*
|
|
303
|
+
* Optionally, you can pass an `opts` object as the second argument. See {@link UpdateFieldOptionsOpts}
|
|
304
|
+
* for available options.
|
|
305
|
+
*
|
|
306
|
+
* @param options new options for the field
|
|
307
|
+
* @param opts optional options to affect the behavior of the update
|
|
308
|
+
*
|
|
309
|
+
* @example
|
|
310
|
+
* ```js
|
|
311
|
+
* async function addChoiceToSelectField(selectField, nameForNewOption) {
|
|
312
|
+
* const updatedOptions = {
|
|
313
|
+
* choices: [
|
|
314
|
+
* ...selectField.options.choices,
|
|
315
|
+
* {name: nameForNewOption},
|
|
316
|
+
* ]
|
|
317
|
+
* };
|
|
318
|
+
*
|
|
319
|
+
* if (selectField.hasPermissionToUpdateOptions(updatedOptions)) {
|
|
320
|
+
* await selectField.updateOptionsAsync(updatedOptions);
|
|
321
|
+
* }
|
|
322
|
+
* }
|
|
323
|
+
* ```
|
|
324
|
+
*/
|
|
325
|
+
async updateOptionsAsync(options) {
|
|
326
|
+
let opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
327
|
+
await this._sdk.__mutations.applyMutationAsync({
|
|
328
|
+
type: _mutations.MutationTypes.UPDATE_SINGLE_FIELD_CONFIG,
|
|
329
|
+
tableId: this.parentTable.id,
|
|
330
|
+
id: this.id,
|
|
331
|
+
config: {
|
|
332
|
+
type: this.type,
|
|
333
|
+
options: options
|
|
334
|
+
},
|
|
335
|
+
opts
|
|
336
|
+
});
|
|
337
|
+
}
|
|
338
|
+
}
|
|
427
339
|
var _default = exports.default = Field;
|