@airtable/blocks 1.18.0 → 1.18.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +552 -0
- package/dist/cjs/color_utils.js +21 -23
- package/dist/cjs/colors.js +4 -60
- package/dist/cjs/error_utils.js +15 -25
- package/dist/cjs/event_tracker.js +5 -11
- package/dist/cjs/global_config.js +107 -188
- package/dist/cjs/index.js +16 -40
- package/dist/cjs/injected/airtable_interface.js +1 -6
- package/dist/cjs/models/abstract_model.js +50 -81
- package/dist/cjs/models/abstract_model_with_async_data.js +102 -177
- package/dist/cjs/models/base.js +211 -374
- package/dist/cjs/models/create_aggregators.js +53 -47
- package/dist/cjs/models/cursor.js +125 -201
- package/dist/cjs/models/field.js +256 -303
- package/dist/cjs/models/grouped_record_query_result.js +210 -286
- package/dist/cjs/models/linked_records_query_result.js +276 -454
- package/dist/cjs/models/models.js +36 -50
- package/dist/cjs/models/mutation_constants.js +5 -9
- package/dist/cjs/models/mutations.js +125 -338
- package/dist/cjs/models/object_pool.js +37 -94
- package/dist/cjs/models/record.js +132 -226
- package/dist/cjs/models/record_coloring.js +14 -19
- package/dist/cjs/models/record_query_result.js +323 -282
- package/dist/cjs/models/record_store.js +355 -688
- package/dist/cjs/models/session.js +99 -158
- package/dist/cjs/models/table.js +361 -549
- package/dist/cjs/models/table_or_view_query_result.js +410 -765
- package/dist/cjs/models/view.js +161 -204
- package/dist/cjs/models/view_data_store.js +177 -282
- package/dist/cjs/models/view_metadata_query_result.js +96 -127
- package/dist/cjs/perform_record_action.js +69 -103
- package/dist/cjs/private_utils.js +133 -223
- package/dist/cjs/sdk.js +97 -142
- package/dist/cjs/settings_button.js +30 -57
- package/dist/cjs/stats/block_stats.js +3 -15
- package/dist/cjs/testing/abstract_mock_airtable_interface.js +53 -97
- package/dist/cjs/types/airtable_interface.js +36 -8
- package/dist/cjs/types/field.js +66 -12
- package/dist/cjs/types/mutations.js +99 -6
- package/dist/cjs/types/permission_levels.js +2 -4
- package/dist/cjs/types/undo_redo.js +2 -3
- package/dist/cjs/types/view.js +16 -11
- package/dist/cjs/ui/base_provider.js +14 -9
- package/dist/cjs/ui/baymax_utils.js +107 -1102
- package/dist/cjs/ui/block_wrapper.js +30 -68
- package/dist/cjs/ui/box.js +52 -56
- package/dist/cjs/ui/button.js +60 -77
- package/dist/cjs/ui/cell_renderer.js +78 -139
- package/dist/cjs/ui/choice_token.js +45 -47
- package/dist/cjs/ui/collaborator_token.js +33 -54
- package/dist/cjs/ui/color_palette.js +58 -106
- package/dist/cjs/ui/color_palette_synced.js +41 -52
- package/dist/cjs/ui/confirmation_dialog.js +53 -69
- package/dist/cjs/ui/control_sizes.js +21 -46
- package/dist/cjs/ui/create_detect_element_resize.js +16 -50
- package/dist/cjs/ui/css_helpers.js +3 -10
- package/dist/cjs/ui/dialog.js +44 -71
- package/dist/cjs/ui/dialog_close_button.js +52 -72
- package/dist/cjs/ui/expand_record.js +4 -11
- package/dist/cjs/ui/expand_record_list.js +6 -11
- package/dist/cjs/ui/expand_record_picker_async.js +18 -35
- package/dist/cjs/ui/field_icon.js +25 -28
- package/dist/cjs/ui/field_picker.js +47 -81
- package/dist/cjs/ui/field_picker_synced.js +33 -44
- package/dist/cjs/ui/form_field.js +45 -64
- package/dist/cjs/ui/geometry/geometry.js +6 -10
- package/dist/cjs/ui/geometry/point.js +5 -13
- package/dist/cjs/ui/geometry/rect.js +7 -29
- package/dist/cjs/ui/geometry/size.js +5 -13
- package/dist/cjs/ui/global_alert.js +35 -61
- package/dist/cjs/ui/global_config_synced_component_helpers.js +4 -13
- package/dist/cjs/ui/heading.js +63 -92
- package/dist/cjs/ui/icon.js +44 -66
- package/dist/cjs/ui/icon_config.js +13 -24
- package/dist/cjs/ui/initialize_block.js +23 -36
- package/dist/cjs/ui/input.js +74 -87
- package/dist/cjs/ui/input_synced.js +34 -43
- package/dist/cjs/ui/key_codes.js +4 -9
- package/dist/cjs/ui/label.js +45 -50
- package/dist/cjs/ui/link.js +74 -89
- package/dist/cjs/ui/loader.js +26 -42
- package/dist/cjs/ui/modal.js +63 -89
- package/dist/cjs/ui/model_picker_select.js +29 -47
- package/dist/cjs/ui/popover.js +98 -180
- package/dist/cjs/ui/progress_bar.js +45 -51
- package/dist/cjs/ui/record_card.js +143 -278
- package/dist/cjs/ui/record_card_list.js +117 -165
- package/dist/cjs/ui/remote_utils.js +5 -13
- package/dist/cjs/ui/sdk_context.js +7 -9
- package/dist/cjs/ui/select.js +84 -118
- package/dist/cjs/ui/select_and_select_buttons_helpers.js +27 -45
- package/dist/cjs/ui/select_buttons.js +54 -90
- package/dist/cjs/ui/select_buttons_synced.js +32 -41
- package/dist/cjs/ui/select_synced.js +32 -42
- package/dist/cjs/ui/switch.js +66 -84
- package/dist/cjs/ui/switch_synced.js +32 -38
- package/dist/cjs/ui/synced.js +16 -43
- package/dist/cjs/ui/system/all_styles_set.js +89 -22
- package/dist/cjs/ui/system/appearance/appearance_set.js +15 -26
- package/dist/cjs/ui/system/appearance/background_color.js +6 -12
- package/dist/cjs/ui/system/appearance/border.js +6 -12
- package/dist/cjs/ui/system/appearance/border_radius.js +6 -12
- package/dist/cjs/ui/system/appearance/box_shadow.js +6 -12
- package/dist/cjs/ui/system/appearance/opacity.js +5 -11
- package/dist/cjs/ui/system/dimensions/dimensions_set.js +15 -27
- package/dist/cjs/ui/system/dimensions/height.js +5 -11
- package/dist/cjs/ui/system/dimensions/max_height.js +5 -11
- package/dist/cjs/ui/system/dimensions/max_width.js +5 -11
- package/dist/cjs/ui/system/dimensions/min_height.js +5 -11
- package/dist/cjs/ui/system/dimensions/min_width.js +5 -11
- package/dist/cjs/ui/system/dimensions/width.js +5 -11
- package/dist/cjs/ui/system/display.js +8 -9
- package/dist/cjs/ui/system/flex_container/align_content.js +6 -12
- package/dist/cjs/ui/system/flex_container/align_items.js +6 -12
- package/dist/cjs/ui/system/flex_container/flex_container_set.js +15 -27
- package/dist/cjs/ui/system/flex_container/flex_direction.js +5 -11
- package/dist/cjs/ui/system/flex_container/flex_wrap.js +5 -11
- package/dist/cjs/ui/system/flex_container/justify_content.js +5 -11
- package/dist/cjs/ui/system/flex_container/justify_items.js +5 -11
- package/dist/cjs/ui/system/flex_item/align_self.js +6 -12
- package/dist/cjs/ui/system/flex_item/flex.js +5 -11
- package/dist/cjs/ui/system/flex_item/flex_basis.js +5 -11
- package/dist/cjs/ui/system/flex_item/flex_grow.js +5 -11
- package/dist/cjs/ui/system/flex_item/flex_item_set.js +15 -28
- package/dist/cjs/ui/system/flex_item/flex_shrink.js +5 -11
- package/dist/cjs/ui/system/flex_item/justify_self.js +5 -11
- package/dist/cjs/ui/system/flex_item/order.js +5 -11
- package/dist/cjs/ui/system/index.js +310 -362
- package/dist/cjs/ui/system/overflow.js +8 -9
- package/dist/cjs/ui/system/position/bottom.js +6 -13
- package/dist/cjs/ui/system/position/left.js +5 -12
- package/dist/cjs/ui/system/position/position.js +5 -11
- package/dist/cjs/ui/system/position/position_set.js +15 -27
- package/dist/cjs/ui/system/position/right.js +5 -12
- package/dist/cjs/ui/system/position/top.js +5 -12
- package/dist/cjs/ui/system/position/z_index.js +5 -11
- package/dist/cjs/ui/system/spacing/margin.js +5 -12
- package/dist/cjs/ui/system/spacing/padding.js +5 -12
- package/dist/cjs/ui/system/spacing/spacing_set.js +15 -23
- package/dist/cjs/ui/system/typography/font_family.js +5 -11
- package/dist/cjs/ui/system/typography/font_size.js +5 -11
- package/dist/cjs/ui/system/typography/font_style.js +5 -11
- package/dist/cjs/ui/system/typography/font_weight.js +5 -11
- package/dist/cjs/ui/system/typography/letter_spacing.js +5 -11
- package/dist/cjs/ui/system/typography/line_height.js +5 -11
- package/dist/cjs/ui/system/typography/text_align.js +5 -11
- package/dist/cjs/ui/system/typography/text_color.js +5 -11
- package/dist/cjs/ui/system/typography/text_decoration.js +5 -11
- package/dist/cjs/ui/system/typography/text_transform.js +5 -11
- package/dist/cjs/ui/system/typography/typography_set.js +15 -31
- package/dist/cjs/ui/system/utils/create_responsive_prop_type.js +2 -4
- package/dist/cjs/ui/system/utils/create_style_prop_types.js +5 -13
- package/dist/cjs/ui/system/utils/ensure_numbers_are_within_scale.js +2 -14
- package/dist/cjs/ui/system/utils/get_style_props_for_responsive_prop.js +30 -70
- package/dist/cjs/ui/table_picker.js +26 -43
- package/dist/cjs/ui/table_picker_synced.js +33 -42
- package/dist/cjs/ui/text.js +59 -71
- package/dist/cjs/ui/text_button.js +80 -97
- package/dist/cjs/ui/theme/default_theme/button_variants.js +1 -5
- package/dist/cjs/ui/theme/default_theme/control_sizes.js +29 -42
- package/dist/cjs/ui/theme/default_theme/heading_styles.js +4 -5
- package/dist/cjs/ui/theme/default_theme/index.js +15 -32
- package/dist/cjs/ui/theme/default_theme/input_variants.js +1 -5
- package/dist/cjs/ui/theme/default_theme/link_variants.js +1 -5
- package/dist/cjs/ui/theme/default_theme/select_buttons_variants.js +1 -5
- package/dist/cjs/ui/theme/default_theme/select_variants.js +10 -21
- package/dist/cjs/ui/theme/default_theme/switch_variants.js +8 -20
- package/dist/cjs/ui/theme/default_theme/text_button_variants.js +1 -5
- package/dist/cjs/ui/theme/default_theme/text_styles.js +1 -2
- package/dist/cjs/ui/theme/default_theme/tokens.js +33 -35
- package/dist/cjs/ui/theme/theme_context.js +3 -6
- package/dist/cjs/ui/theme/use_theme.js +1 -7
- package/dist/cjs/ui/tooltip.js +38 -79
- package/dist/cjs/ui/types/aria_props.js +3 -7
- package/dist/cjs/ui/types/data_attributes_prop.js +8 -6
- package/dist/cjs/ui/types/tooltip_anchor_props.js +4 -5
- package/dist/cjs/ui/ui.js +89 -130
- package/dist/cjs/ui/unstable_standalone_ui.js +18 -42
- package/dist/cjs/ui/use_array_identity.js +0 -4
- package/dist/cjs/ui/use_base.js +4 -13
- package/dist/cjs/ui/use_cursor.js +3 -12
- package/dist/cjs/ui/use_form_field.js +4 -6
- package/dist/cjs/ui/use_global_config.js +3 -10
- package/dist/cjs/ui/use_loadable.js +59 -132
- package/dist/cjs/ui/use_record_action_data.js +6 -12
- package/dist/cjs/ui/use_records.js +23 -24
- package/dist/cjs/ui/use_session.js +6 -15
- package/dist/cjs/ui/use_settings_button.js +4 -11
- package/dist/cjs/ui/use_styled_system.js +12 -21
- package/dist/cjs/ui/use_synced.js +0 -7
- package/dist/cjs/ui/use_text_color_for_background_color.js +1 -5
- package/dist/cjs/ui/use_view_metadata.js +5 -8
- package/dist/cjs/ui/use_viewport.js +1 -7
- package/dist/cjs/ui/use_watchable.js +36 -74
- package/dist/cjs/ui/view_picker.js +44 -78
- package/dist/cjs/ui/view_picker_synced.js +33 -44
- package/dist/cjs/ui/viewport_constraint.js +37 -64
- package/dist/cjs/ui/with_hooks.js +17 -22
- package/dist/cjs/ui/with_styled_system.js +33 -60
- package/dist/cjs/undo_redo.js +12 -32
- package/dist/cjs/unstable_private_utils.js +6 -8
- package/dist/cjs/unstable_testing_utils.js +44 -57
- package/dist/cjs/viewport.js +127 -189
- package/dist/cjs/warning.js +5 -6
- package/dist/cjs/watchable.js +66 -148
- package/dist/types/src/colors.d.ts +1 -1
- package/dist/types/src/colors.d.ts.map +1 -1
- package/dist/types/src/global_config.d.ts +1 -1
- package/dist/types/src/global_config.d.ts.map +1 -1
- package/dist/types/src/models/base.d.ts +1 -1
- package/dist/types/src/models/base.d.ts.map +1 -1
- package/dist/types/src/models/cursor.d.ts +1 -1
- package/dist/types/src/models/cursor.d.ts.map +1 -1
- package/dist/types/src/models/field.d.ts +1 -1
- package/dist/types/src/models/field.d.ts.map +1 -1
- package/dist/types/src/models/linked_records_query_result.d.ts.map +1 -1
- package/dist/types/src/models/models.d.ts.map +1 -1
- package/dist/types/src/models/record.d.ts +1 -1
- package/dist/types/src/models/record.d.ts.map +1 -1
- package/dist/types/src/models/record_coloring.d.ts +2 -2
- package/dist/types/src/models/record_coloring.d.ts.map +1 -1
- package/dist/types/src/models/record_query_result.d.ts +3 -3
- package/dist/types/src/models/record_query_result.d.ts.map +1 -1
- package/dist/types/src/models/session.d.ts +1 -1
- package/dist/types/src/models/session.d.ts.map +1 -1
- package/dist/types/src/models/table.d.ts +1 -1
- package/dist/types/src/models/table.d.ts.map +1 -1
- package/dist/types/src/models/view.d.ts +1 -1
- package/dist/types/src/models/view.d.ts.map +1 -1
- package/dist/types/src/models/view_metadata_query_result.d.ts +2 -2
- package/dist/types/src/models/view_metadata_query_result.d.ts.map +1 -1
- package/dist/types/src/perform_record_action.d.ts +1 -1
- package/dist/types/src/perform_record_action.d.ts.map +1 -1
- package/dist/types/src/private_utils.d.ts +8 -8
- package/dist/types/src/private_utils.d.ts.map +1 -1
- package/dist/types/src/sdk.d.ts +1 -1
- package/dist/types/src/sdk.d.ts.map +1 -1
- package/dist/types/src/settings_button.d.ts +1 -1
- package/dist/types/src/settings_button.d.ts.map +1 -1
- package/dist/types/src/types/aggregators.d.ts +1 -1
- package/dist/types/src/types/aggregators.d.ts.map +1 -1
- package/dist/types/src/types/airtable_interface.d.ts +6 -6
- package/dist/types/src/types/airtable_interface.d.ts.map +1 -1
- package/dist/types/src/types/attachment.d.ts +1 -1
- package/dist/types/src/types/attachment.d.ts.map +1 -1
- package/dist/types/src/types/base.d.ts +1 -1
- package/dist/types/src/types/base.d.ts.map +1 -1
- package/dist/types/src/types/block.d.ts +1 -1
- package/dist/types/src/types/block.d.ts.map +1 -1
- package/dist/types/src/types/collaborator.d.ts +1 -1
- package/dist/types/src/types/collaborator.d.ts.map +1 -1
- package/dist/types/src/types/field.d.ts +5 -5
- package/dist/types/src/types/field.d.ts.map +1 -1
- package/dist/types/src/types/global_config.d.ts +6 -6
- package/dist/types/src/types/global_config.d.ts.map +1 -1
- package/dist/types/src/types/mutations.d.ts +4 -4
- package/dist/types/src/types/mutations.d.ts.map +1 -1
- package/dist/types/src/types/permission_levels.d.ts +1 -1
- package/dist/types/src/types/permission_levels.d.ts.map +1 -1
- package/dist/types/src/types/record.d.ts +2 -2
- package/dist/types/src/types/record.d.ts.map +1 -1
- package/dist/types/src/types/record_action_data.d.ts +1 -1
- package/dist/types/src/types/record_action_data.d.ts.map +1 -1
- package/dist/types/src/types/table.d.ts +3 -3
- package/dist/types/src/types/table.d.ts.map +1 -1
- package/dist/types/src/types/undo_redo.d.ts +1 -1
- package/dist/types/src/types/undo_redo.d.ts.map +1 -1
- package/dist/types/src/types/view.d.ts +4 -4
- package/dist/types/src/types/view.d.ts.map +1 -1
- package/dist/types/src/ui/base_provider.d.ts +1 -1
- package/dist/types/src/ui/base_provider.d.ts.map +1 -1
- package/dist/types/src/ui/block_wrapper.d.ts +2 -2
- package/dist/types/src/ui/button.d.ts +1 -1
- package/dist/types/src/ui/button.d.ts.map +1 -1
- package/dist/types/src/ui/cell_renderer.d.ts +2 -2
- package/dist/types/src/ui/choice_token.d.ts +3 -3
- package/dist/types/src/ui/choice_token.d.ts.map +1 -1
- package/dist/types/src/ui/collaborator_token.d.ts +5 -5
- package/dist/types/src/ui/collaborator_token.d.ts.map +1 -1
- package/dist/types/src/ui/color_palette.d.ts +2 -2
- package/dist/types/src/ui/color_palette_synced.d.ts +2 -2
- package/dist/types/src/ui/confirmation_dialog.d.ts +1 -1
- package/dist/types/src/ui/control_sizes.d.ts +2 -2
- package/dist/types/src/ui/control_sizes.d.ts.map +1 -1
- package/dist/types/src/ui/dialog.d.ts +2 -2
- package/dist/types/src/ui/dialog.d.ts.map +1 -1
- package/dist/types/src/ui/dialog_close_button.d.ts +1 -1
- package/dist/types/src/ui/field_icon.d.ts +3 -3
- package/dist/types/src/ui/field_icon.d.ts.map +1 -1
- package/dist/types/src/ui/field_picker.d.ts +1 -1
- package/dist/types/src/ui/global_alert.d.ts +1 -1
- package/dist/types/src/ui/global_alert.d.ts.map +1 -1
- package/dist/types/src/ui/global_config_synced_component_helpers.d.ts +1 -1
- package/dist/types/src/ui/global_config_synced_component_helpers.d.ts.map +1 -1
- package/dist/types/src/ui/heading.d.ts +3 -3
- package/dist/types/src/ui/heading.d.ts.map +1 -1
- package/dist/types/src/ui/icon.d.ts +1 -1
- package/dist/types/src/ui/icon_config.d.ts +39 -39
- package/dist/types/src/ui/icon_config.d.ts.map +1 -1
- package/dist/types/src/ui/initialize_block.d.ts +3 -3
- package/dist/types/src/ui/initialize_block.d.ts.map +1 -1
- package/dist/types/src/ui/input.d.ts +15 -15
- package/dist/types/src/ui/input.d.ts.map +1 -1
- package/dist/types/src/ui/link.d.ts +1 -1
- package/dist/types/src/ui/link.d.ts.map +1 -1
- package/dist/types/src/ui/loader.d.ts +1 -1
- package/dist/types/src/ui/loader.d.ts.map +1 -1
- package/dist/types/src/ui/model_picker_select.d.ts +1 -1
- package/dist/types/src/ui/model_picker_select.d.ts.map +1 -1
- package/dist/types/src/ui/popover.d.ts +5 -5
- package/dist/types/src/ui/popover.d.ts.map +1 -1
- package/dist/types/src/ui/progress_bar.d.ts +1 -1
- package/dist/types/src/ui/progress_bar.d.ts.map +1 -1
- package/dist/types/src/ui/record_card.d.ts +2 -2
- package/dist/types/src/ui/record_card.d.ts.map +1 -1
- package/dist/types/src/ui/record_card_list.d.ts +1 -1
- package/dist/types/src/ui/select.d.ts +4 -4
- package/dist/types/src/ui/select_and_select_buttons_helpers.d.ts +4 -4
- package/dist/types/src/ui/select_and_select_buttons_helpers.d.ts.map +1 -1
- package/dist/types/src/ui/select_buttons.d.ts +4 -4
- package/dist/types/src/ui/switch.d.ts +1 -1
- package/dist/types/src/ui/switch.d.ts.map +1 -1
- package/dist/types/src/ui/synced.d.ts +3 -3
- package/dist/types/src/ui/system/all_styles_set.d.ts +0 -1
- package/dist/types/src/ui/system/all_styles_set.d.ts.map +1 -1
- package/dist/types/src/ui/system/appearance/appearance_set.d.ts +0 -1
- package/dist/types/src/ui/system/appearance/appearance_set.d.ts.map +1 -1
- package/dist/types/src/ui/system/appearance/background_color.d.ts +0 -1
- package/dist/types/src/ui/system/appearance/background_color.d.ts.map +1 -1
- package/dist/types/src/ui/system/appearance/border.d.ts +0 -1
- package/dist/types/src/ui/system/appearance/border.d.ts.map +1 -1
- package/dist/types/src/ui/system/appearance/border_radius.d.ts +0 -1
- package/dist/types/src/ui/system/appearance/border_radius.d.ts.map +1 -1
- package/dist/types/src/ui/system/appearance/box_shadow.d.ts +0 -1
- package/dist/types/src/ui/system/appearance/box_shadow.d.ts.map +1 -1
- package/dist/types/src/ui/system/appearance/opacity.d.ts +0 -1
- package/dist/types/src/ui/system/appearance/opacity.d.ts.map +1 -1
- package/dist/types/src/ui/system/dimensions/dimensions_set.d.ts +0 -1
- package/dist/types/src/ui/system/dimensions/dimensions_set.d.ts.map +1 -1
- package/dist/types/src/ui/system/dimensions/height.d.ts +0 -1
- package/dist/types/src/ui/system/dimensions/height.d.ts.map +1 -1
- package/dist/types/src/ui/system/dimensions/max_height.d.ts +0 -1
- package/dist/types/src/ui/system/dimensions/max_height.d.ts.map +1 -1
- package/dist/types/src/ui/system/dimensions/max_width.d.ts +0 -1
- package/dist/types/src/ui/system/dimensions/max_width.d.ts.map +1 -1
- package/dist/types/src/ui/system/dimensions/min_height.d.ts +0 -1
- package/dist/types/src/ui/system/dimensions/min_height.d.ts.map +1 -1
- package/dist/types/src/ui/system/dimensions/min_width.d.ts +0 -1
- package/dist/types/src/ui/system/dimensions/min_width.d.ts.map +1 -1
- package/dist/types/src/ui/system/dimensions/width.d.ts +0 -1
- package/dist/types/src/ui/system/dimensions/width.d.ts.map +1 -1
- package/dist/types/src/ui/system/display.d.ts +0 -1
- package/dist/types/src/ui/system/display.d.ts.map +1 -1
- package/dist/types/src/ui/system/flex_container/align_content.d.ts +0 -1
- package/dist/types/src/ui/system/flex_container/align_content.d.ts.map +1 -1
- package/dist/types/src/ui/system/flex_container/align_items.d.ts +0 -1
- package/dist/types/src/ui/system/flex_container/align_items.d.ts.map +1 -1
- package/dist/types/src/ui/system/flex_container/flex_container_set.d.ts +0 -1
- package/dist/types/src/ui/system/flex_container/flex_container_set.d.ts.map +1 -1
- package/dist/types/src/ui/system/flex_container/flex_direction.d.ts +0 -1
- package/dist/types/src/ui/system/flex_container/flex_direction.d.ts.map +1 -1
- package/dist/types/src/ui/system/flex_container/flex_wrap.d.ts +0 -1
- package/dist/types/src/ui/system/flex_container/flex_wrap.d.ts.map +1 -1
- package/dist/types/src/ui/system/flex_container/justify_content.d.ts +0 -1
- package/dist/types/src/ui/system/flex_container/justify_content.d.ts.map +1 -1
- package/dist/types/src/ui/system/flex_container/justify_items.d.ts +0 -1
- package/dist/types/src/ui/system/flex_container/justify_items.d.ts.map +1 -1
- package/dist/types/src/ui/system/flex_item/align_self.d.ts +0 -1
- package/dist/types/src/ui/system/flex_item/align_self.d.ts.map +1 -1
- package/dist/types/src/ui/system/flex_item/flex.d.ts +0 -1
- package/dist/types/src/ui/system/flex_item/flex.d.ts.map +1 -1
- package/dist/types/src/ui/system/flex_item/flex_basis.d.ts +0 -1
- package/dist/types/src/ui/system/flex_item/flex_basis.d.ts.map +1 -1
- package/dist/types/src/ui/system/flex_item/flex_grow.d.ts +0 -1
- package/dist/types/src/ui/system/flex_item/flex_grow.d.ts.map +1 -1
- package/dist/types/src/ui/system/flex_item/flex_item_set.d.ts +0 -1
- package/dist/types/src/ui/system/flex_item/flex_item_set.d.ts.map +1 -1
- package/dist/types/src/ui/system/flex_item/flex_shrink.d.ts +0 -1
- package/dist/types/src/ui/system/flex_item/flex_shrink.d.ts.map +1 -1
- package/dist/types/src/ui/system/flex_item/justify_self.d.ts +0 -1
- package/dist/types/src/ui/system/flex_item/justify_self.d.ts.map +1 -1
- package/dist/types/src/ui/system/flex_item/order.d.ts +0 -1
- package/dist/types/src/ui/system/flex_item/order.d.ts.map +1 -1
- package/dist/types/src/ui/system/overflow.d.ts +0 -1
- package/dist/types/src/ui/system/overflow.d.ts.map +1 -1
- package/dist/types/src/ui/system/position/bottom.d.ts +0 -1
- package/dist/types/src/ui/system/position/bottom.d.ts.map +1 -1
- package/dist/types/src/ui/system/position/left.d.ts +0 -1
- package/dist/types/src/ui/system/position/left.d.ts.map +1 -1
- package/dist/types/src/ui/system/position/position.d.ts +0 -1
- package/dist/types/src/ui/system/position/position.d.ts.map +1 -1
- package/dist/types/src/ui/system/position/position_set.d.ts +0 -1
- package/dist/types/src/ui/system/position/position_set.d.ts.map +1 -1
- package/dist/types/src/ui/system/position/right.d.ts +0 -1
- package/dist/types/src/ui/system/position/right.d.ts.map +1 -1
- package/dist/types/src/ui/system/position/top.d.ts +0 -1
- package/dist/types/src/ui/system/position/top.d.ts.map +1 -1
- package/dist/types/src/ui/system/position/z_index.d.ts +0 -1
- package/dist/types/src/ui/system/position/z_index.d.ts.map +1 -1
- package/dist/types/src/ui/system/spacing/margin.d.ts +0 -1
- package/dist/types/src/ui/system/spacing/margin.d.ts.map +1 -1
- package/dist/types/src/ui/system/spacing/padding.d.ts +0 -1
- package/dist/types/src/ui/system/spacing/padding.d.ts.map +1 -1
- package/dist/types/src/ui/system/spacing/spacing_set.d.ts +0 -1
- package/dist/types/src/ui/system/spacing/spacing_set.d.ts.map +1 -1
- package/dist/types/src/ui/system/typography/font_family.d.ts +0 -1
- package/dist/types/src/ui/system/typography/font_family.d.ts.map +1 -1
- package/dist/types/src/ui/system/typography/font_size.d.ts +0 -1
- package/dist/types/src/ui/system/typography/font_size.d.ts.map +1 -1
- package/dist/types/src/ui/system/typography/font_style.d.ts +0 -1
- package/dist/types/src/ui/system/typography/font_style.d.ts.map +1 -1
- package/dist/types/src/ui/system/typography/font_weight.d.ts +0 -1
- package/dist/types/src/ui/system/typography/font_weight.d.ts.map +1 -1
- package/dist/types/src/ui/system/typography/letter_spacing.d.ts +0 -1
- package/dist/types/src/ui/system/typography/letter_spacing.d.ts.map +1 -1
- package/dist/types/src/ui/system/typography/line_height.d.ts +0 -1
- package/dist/types/src/ui/system/typography/line_height.d.ts.map +1 -1
- package/dist/types/src/ui/system/typography/text_align.d.ts +0 -1
- package/dist/types/src/ui/system/typography/text_align.d.ts.map +1 -1
- package/dist/types/src/ui/system/typography/text_color.d.ts +0 -1
- package/dist/types/src/ui/system/typography/text_color.d.ts.map +1 -1
- package/dist/types/src/ui/system/typography/text_decoration.d.ts +0 -1
- package/dist/types/src/ui/system/typography/text_decoration.d.ts.map +1 -1
- package/dist/types/src/ui/system/typography/text_transform.d.ts +0 -1
- package/dist/types/src/ui/system/typography/text_transform.d.ts.map +1 -1
- package/dist/types/src/ui/system/typography/typography_set.d.ts +0 -1
- package/dist/types/src/ui/system/typography/typography_set.d.ts.map +1 -1
- package/dist/types/src/ui/system/utils/create_style_prop_types.d.ts +1 -1
- package/dist/types/src/ui/system/utils/create_style_prop_types.d.ts.map +1 -1
- package/dist/types/src/ui/system/utils/csstype.d.ts +578 -578
- package/dist/types/src/ui/system/utils/csstype.d.ts.map +1 -1
- package/dist/types/src/ui/system/utils/types.d.ts +4 -4
- package/dist/types/src/ui/system/utils/types.d.ts.map +1 -1
- package/dist/types/src/ui/text.d.ts +3 -3
- package/dist/types/src/ui/text.d.ts.map +1 -1
- package/dist/types/src/ui/text_button.d.ts +1 -1
- package/dist/types/src/ui/text_button.d.ts.map +1 -1
- package/dist/types/src/ui/theme/default_theme/heading_styles.d.ts +2 -2
- package/dist/types/src/ui/theme/default_theme/heading_styles.d.ts.map +1 -1
- package/dist/types/src/ui/theme/default_theme/index.d.ts +1 -1
- package/dist/types/src/ui/theme/theme_context.d.ts +1 -3
- package/dist/types/src/ui/theme/theme_context.d.ts.map +1 -1
- package/dist/types/src/ui/theme/use_theme.d.ts +1 -1
- package/dist/types/src/ui/tooltip.d.ts +3 -3
- package/dist/types/src/ui/types/data_attributes_prop.d.ts.map +1 -1
- package/dist/types/src/ui/types/tooltip_anchor_props.d.ts +0 -1
- package/dist/types/src/ui/types/tooltip_anchor_props.d.ts.map +1 -1
- package/dist/types/src/ui/use_base.d.ts.map +1 -1
- package/dist/types/src/ui/use_cursor.d.ts.map +1 -1
- package/dist/types/src/ui/use_form_field.d.ts +0 -2
- package/dist/types/src/ui/use_form_field.d.ts.map +1 -1
- package/dist/types/src/ui/use_records.d.ts +2 -2
- package/dist/types/src/ui/use_records.d.ts.map +1 -1
- package/dist/types/src/ui/use_session.d.ts.map +1 -1
- package/dist/types/src/ui/view_picker.d.ts +2 -2
- package/dist/types/src/ui/view_picker.d.ts.map +1 -1
- package/dist/types/src/ui/viewport_constraint.d.ts +3 -3
- package/dist/types/src/ui/viewport_constraint.d.ts.map +1 -1
- package/dist/types/src/viewport.d.ts +2 -2
- package/dist/types/src/viewport.d.ts.map +1 -1
- package/dist/types/src/warning.d.ts +1 -1
- package/dist/types/src/warning.d.ts.map +1 -1
- package/dist/types/stories/helpers/code_block.d.ts +2 -2
- package/dist/types/stories/helpers/code_block.d.ts.map +1 -1
- package/dist/types/stories/helpers/example.d.ts +5 -5
- package/dist/types/stories/helpers/example.d.ts.map +1 -1
- package/dist/types/stories/helpers/example_code_panel.d.ts +2 -2
- package/dist/types/stories/helpers/example_code_panel.d.ts.map +1 -1
- package/dist/types/stories/helpers/fake_cell_renderer.d.ts +2 -2
- package/dist/types/stories/helpers/fake_cell_renderer.d.ts.map +1 -1
- package/dist/types/stories/helpers/fake_foreign_record.d.ts +1 -1
- package/dist/types/stories/helpers/fake_foreign_record.d.ts.map +1 -1
- package/dist/types/stories/helpers/fake_record_card.d.ts +2 -2
- package/dist/types/stories/helpers/fake_record_card.d.ts.map +1 -1
- package/dist/types/stories/helpers/style_prop_list.d.ts +2 -2
- package/dist/types/stories/helpers/style_prop_list.d.ts.map +1 -1
- package/dist/types/stories/icon_example.d.ts +2 -2
- package/dist/types/stories/icon_example.d.ts.map +1 -1
- package/dist/types/test/airtable_interface_mocks/mock_airtable_interface.d.ts +0 -1
- package/dist/types/test/airtable_interface_mocks/mock_airtable_interface.d.ts.map +1 -1
- package/package.json +26 -25
|
@@ -1,85 +1,70 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
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.slice.js");
|
|
7
|
+
require("core-js/modules/es.object.get-own-property-descriptors.js");
|
|
8
|
+
require("core-js/modules/es.regexp.exec.js");
|
|
9
|
+
require("core-js/modules/es.regexp.to-string.js");
|
|
10
|
+
require("core-js/modules/es.weak-map.js");
|
|
11
|
+
require("core-js/modules/web.dom-collections.for-each.js");
|
|
5
12
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
6
|
-
|
|
7
|
-
require("core-js/modules/es.symbol");
|
|
8
|
-
|
|
9
|
-
require("core-js/modules/es.symbol.description");
|
|
10
|
-
|
|
11
|
-
require("core-js/modules/es.array.filter");
|
|
12
|
-
|
|
13
|
-
require("core-js/modules/es.array.from");
|
|
14
|
-
|
|
15
|
-
require("core-js/modules/es.array.iterator");
|
|
16
|
-
|
|
17
|
-
require("core-js/modules/es.object.get-own-property-descriptors");
|
|
18
|
-
|
|
19
|
-
require("core-js/modules/es.object.to-string");
|
|
20
|
-
|
|
21
|
-
require("core-js/modules/es.set");
|
|
22
|
-
|
|
23
|
-
require("core-js/modules/web.dom-collections.for-each");
|
|
24
|
-
|
|
25
|
-
require("core-js/modules/web.dom-collections.iterator");
|
|
26
|
-
|
|
27
13
|
Object.defineProperty(exports, "__esModule", {
|
|
28
14
|
value: true
|
|
29
15
|
});
|
|
30
|
-
exports.default = exports.
|
|
31
|
-
|
|
16
|
+
exports.default = exports.cellRendererStylePropTypes = exports.CellRenderer = void 0;
|
|
17
|
+
require("core-js/modules/es.array.from.js");
|
|
18
|
+
require("core-js/modules/es.array.iterator.js");
|
|
19
|
+
require("core-js/modules/es.object.to-string.js");
|
|
20
|
+
require("core-js/modules/es.set.js");
|
|
21
|
+
require("core-js/modules/web.dom-collections.iterator.js");
|
|
32
22
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
33
|
-
|
|
34
23
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
35
|
-
|
|
36
24
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
37
|
-
|
|
38
25
|
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
39
|
-
|
|
40
26
|
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
41
|
-
|
|
42
27
|
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
43
|
-
|
|
44
28
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
45
|
-
|
|
46
29
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
47
|
-
|
|
48
30
|
var _emotion = require("emotion");
|
|
49
|
-
|
|
50
31
|
var React = _interopRequireWildcard(require("react"));
|
|
51
|
-
|
|
52
32
|
var _core = require("@styled-system/core");
|
|
53
|
-
|
|
54
33
|
var _error_utils = require("../error_utils");
|
|
55
|
-
|
|
56
34
|
var _record = _interopRequireDefault(require("../models/record"));
|
|
57
|
-
|
|
58
35
|
var _field = _interopRequireDefault(require("../models/field"));
|
|
59
|
-
|
|
60
36
|
var _field2 = require("../types/field");
|
|
61
|
-
|
|
62
37
|
var _with_hooks = _interopRequireDefault(require("./with_hooks"));
|
|
63
|
-
|
|
64
38
|
var _use_watchable = _interopRequireDefault(require("./use_watchable"));
|
|
65
|
-
|
|
66
39
|
var _system = require("./system");
|
|
67
|
-
|
|
68
40
|
var _use_styled_system = _interopRequireDefault(require("./use_styled_system"));
|
|
69
|
-
|
|
70
41
|
var _with_styled_system = require("./with_styled_system");
|
|
71
|
-
|
|
72
42
|
var _tooltip_anchor_props = require("./types/tooltip_anchor_props");
|
|
73
|
-
|
|
74
43
|
var _sdk_context = require("./sdk_context");
|
|
75
|
-
|
|
76
|
-
function
|
|
77
|
-
|
|
78
|
-
function
|
|
44
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
45
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
46
|
+
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; } } }; }
|
|
47
|
+
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; } }
|
|
48
|
+
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; }
|
|
49
|
+
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)); }
|
|
50
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
51
|
+
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; }
|
|
52
|
+
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/ui: CellRenderer */ /** */
|
|
53
|
+
/**
|
|
54
|
+
* Style props for the {@link CellRenderer} component. Also accepts:
|
|
55
|
+
* * {@link FlexItemSetProps}
|
|
56
|
+
* * {@link MarginProps}
|
|
57
|
+
* * {@link MaxWidthProps}
|
|
58
|
+
* * {@link MinWidthProps}
|
|
59
|
+
* * {@link PositionSetProps}
|
|
60
|
+
* * {@link WidthProps}
|
|
61
|
+
*
|
|
62
|
+
* @noInheritDoc
|
|
63
|
+
*/
|
|
79
64
|
|
|
80
65
|
var styleParser = (0, _core.compose)(_system.display, _system.flexItemSet, _system.margin, _system.maxWidth, _system.minWidth, _system.positionSet, _system.width);
|
|
66
|
+
var cellRendererStylePropTypes = exports.cellRendererStylePropTypes = _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({}, _system.displayPropTypes), _system.flexItemSetPropTypes), _system.marginPropTypes), _system.maxWidthPropTypes), _system.minWidthPropTypes), _system.positionSetPropTypes), _system.widthPropTypes);
|
|
81
67
|
|
|
82
|
-
var cellRendererStylePropTypes = _objectSpread({}, _system.displayPropTypes, {}, _system.flexItemSetPropTypes, {}, _system.marginPropTypes, {}, _system.maxWidthPropTypes, {}, _system.minWidthPropTypes, {}, _system.positionSetPropTypes, {}, _system.widthPropTypes);
|
|
83
68
|
/**
|
|
84
69
|
* Props for the {@link CellRenderer} component. Also accepts:
|
|
85
70
|
* * {@link CellRendererStyleProps}
|
|
@@ -87,10 +72,6 @@ var cellRendererStylePropTypes = _objectSpread({}, _system.displayPropTypes, {},
|
|
|
87
72
|
* @docsPath UI/components/CellRenderer
|
|
88
73
|
* @noInheritDoc
|
|
89
74
|
*/
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
exports.cellRendererStylePropTypes = cellRendererStylePropTypes;
|
|
93
|
-
|
|
94
75
|
/**
|
|
95
76
|
* Displays the contents of a cell given a field and record.
|
|
96
77
|
*
|
|
@@ -99,36 +80,23 @@ exports.cellRendererStylePropTypes = cellRendererStylePropTypes;
|
|
|
99
80
|
* @component
|
|
100
81
|
* @docsPath UI/components/CellRenderer
|
|
101
82
|
*/
|
|
102
|
-
var CellRenderer =
|
|
103
|
-
/*#__PURE__*/
|
|
104
|
-
function (_React$Component) {
|
|
105
|
-
(0, _inherits2.default)(CellRenderer, _React$Component);
|
|
106
|
-
|
|
107
|
-
/** @hidden */
|
|
108
|
-
|
|
109
|
-
/** @hidden */
|
|
110
|
-
|
|
83
|
+
var CellRenderer = exports.CellRenderer = /*#__PURE__*/function (_React$Component) {
|
|
111
84
|
/** @hidden */
|
|
112
85
|
function CellRenderer(props) {
|
|
113
86
|
var _this;
|
|
114
|
-
|
|
115
87
|
(0, _classCallCheck2.default)(this, CellRenderer);
|
|
116
|
-
_this = (
|
|
117
|
-
|
|
88
|
+
_this = _callSuper(this, CellRenderer, [props]);
|
|
118
89
|
_this._validateProps(props);
|
|
119
|
-
|
|
120
90
|
return _this;
|
|
121
91
|
}
|
|
122
92
|
/** @hidden */
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
(0, _createClass2.default)(CellRenderer, [{
|
|
93
|
+
(0, _inherits2.default)(CellRenderer, _React$Component);
|
|
94
|
+
return (0, _createClass2.default)(CellRenderer, [{
|
|
126
95
|
key: "UNSAFE_componentWillReceiveProps",
|
|
127
96
|
value: function UNSAFE_componentWillReceiveProps(nextProps) {
|
|
128
97
|
this._validateProps(nextProps);
|
|
129
98
|
}
|
|
130
99
|
/** @internal */
|
|
131
|
-
|
|
132
100
|
}, {
|
|
133
101
|
key: "_validateProps",
|
|
134
102
|
value: function _validateProps(props) {
|
|
@@ -137,43 +105,37 @@ function (_React$Component) {
|
|
|
137
105
|
}
|
|
138
106
|
}
|
|
139
107
|
/** @hidden */
|
|
140
|
-
|
|
141
108
|
}, {
|
|
142
109
|
key: "render",
|
|
143
110
|
value: function render() {
|
|
144
111
|
var _this$props = this.props,
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
112
|
+
record = _this$props.record,
|
|
113
|
+
cellValue = _this$props.cellValue,
|
|
114
|
+
field = _this$props.field,
|
|
115
|
+
shouldWrap = _this$props.shouldWrap,
|
|
116
|
+
onMouseEnter = _this$props.onMouseEnter,
|
|
117
|
+
onMouseLeave = _this$props.onMouseLeave,
|
|
118
|
+
onClick = _this$props.onClick,
|
|
119
|
+
className = _this$props.className,
|
|
120
|
+
style = _this$props.style,
|
|
121
|
+
cellClassName = _this$props.cellClassName,
|
|
122
|
+
cellStyle = _this$props.cellStyle,
|
|
123
|
+
renderInvalidCellValue = _this$props.renderInvalidCellValue,
|
|
124
|
+
sdk = _this$props.sdk;
|
|
159
125
|
if (field.isDeleted) {
|
|
160
126
|
return null;
|
|
161
127
|
}
|
|
162
|
-
|
|
163
128
|
var airtableInterface = sdk.__airtableInterface;
|
|
164
129
|
var appInterface = sdk.__appInterface;
|
|
165
130
|
var cellValueToRender;
|
|
166
|
-
|
|
167
131
|
if (record) {
|
|
168
132
|
if (cellValue !== undefined) {
|
|
169
133
|
// eslint-disable-next-line
|
|
170
134
|
console.warn('CellRenderer was given both record and cellValue, choosing to render record value');
|
|
171
135
|
}
|
|
172
|
-
|
|
173
136
|
if (record.isDeleted) {
|
|
174
137
|
return null;
|
|
175
138
|
}
|
|
176
|
-
|
|
177
139
|
cellValueToRender = record.getCellValue(field.id);
|
|
178
140
|
} else {
|
|
179
141
|
// NOTE: this will not work if you want to render a cell value for
|
|
@@ -189,10 +151,9 @@ function (_React$Component) {
|
|
|
189
151
|
// TODO(emma): actually check this somehow.
|
|
190
152
|
if (!field.isComputed) {
|
|
191
153
|
var validationResult = airtableInterface.fieldTypeProvider.validateCellValueForUpdate(appInterface, cellValue, null, field._data);
|
|
192
|
-
|
|
193
154
|
if (!validationResult.isValid) {
|
|
194
155
|
if (renderInvalidCellValue) {
|
|
195
|
-
return React.createElement("div", {
|
|
156
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
196
157
|
onMouseEnter: onMouseEnter,
|
|
197
158
|
onMouseLeave: onMouseLeave,
|
|
198
159
|
onClick: onClick,
|
|
@@ -204,68 +165,51 @@ function (_React$Component) {
|
|
|
204
165
|
}
|
|
205
166
|
}
|
|
206
167
|
}
|
|
207
|
-
|
|
208
168
|
cellValueToRender = cellValue;
|
|
209
|
-
}
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
// in record.getCellValue, we reformat the cell value to the new public format. in order to
|
|
210
172
|
// make it work with the cell renderer, we need to format it back the other way.
|
|
211
173
|
// Note: we can't use _getRawCellValue here since we also need to handle formatting
|
|
212
174
|
// these in the case where the user passed cellValue instead of a record.
|
|
213
|
-
|
|
214
|
-
|
|
215
175
|
if (cellValueToRender && field.type === _field2.FieldType.MULTIPLE_LOOKUP_VALUES && !airtableInterface.sdkInitData.isUsingNewLookupCellValueFormat) {
|
|
216
176
|
var originalCellValue = cellValueToRender;
|
|
217
177
|
var linkedRecordIdsSet = new Set();
|
|
218
178
|
var valuesByLinkedRecordId = {};
|
|
219
|
-
var
|
|
220
|
-
|
|
221
|
-
var _iteratorError = undefined;
|
|
222
|
-
|
|
179
|
+
var _iterator = _createForOfIteratorHelper(originalCellValue),
|
|
180
|
+
_step;
|
|
223
181
|
try {
|
|
224
|
-
for (
|
|
182
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
225
183
|
var _step$value = _step.value,
|
|
226
|
-
|
|
227
|
-
|
|
184
|
+
linkedRecordId = _step$value.linkedRecordId,
|
|
185
|
+
value = _step$value.value;
|
|
228
186
|
linkedRecordIdsSet.add(linkedRecordId);
|
|
229
|
-
|
|
230
187
|
if (!valuesByLinkedRecordId[linkedRecordId]) {
|
|
231
188
|
valuesByLinkedRecordId[linkedRecordId] = [];
|
|
232
189
|
}
|
|
233
|
-
|
|
234
190
|
valuesByLinkedRecordId[linkedRecordId].push(value);
|
|
235
191
|
}
|
|
236
192
|
} catch (err) {
|
|
237
|
-
|
|
238
|
-
_iteratorError = err;
|
|
193
|
+
_iterator.e(err);
|
|
239
194
|
} finally {
|
|
240
|
-
|
|
241
|
-
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
242
|
-
_iterator.return();
|
|
243
|
-
}
|
|
244
|
-
} finally {
|
|
245
|
-
if (_didIteratorError) {
|
|
246
|
-
throw _iteratorError;
|
|
247
|
-
}
|
|
248
|
-
}
|
|
195
|
+
_iterator.f();
|
|
249
196
|
}
|
|
250
|
-
|
|
251
197
|
cellValueToRender = {
|
|
252
198
|
linkedRecordIds: Array.from(linkedRecordIdsSet),
|
|
253
199
|
valuesByLinkedRecordId
|
|
254
200
|
};
|
|
255
201
|
}
|
|
256
|
-
|
|
257
202
|
var _airtableInterface$fi = airtableInterface.fieldTypeProvider.getCellRendererData(appInterface, cellValueToRender, field._data, !!shouldWrap),
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
return React.createElement("div", {
|
|
203
|
+
cellValueHtml = _airtableInterface$fi.cellValueHtml,
|
|
204
|
+
attributes = _airtableInterface$fi.attributes;
|
|
205
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
262
206
|
// TODO (stephen): remove tooltip anchor props
|
|
263
207
|
onMouseEnter: onMouseEnter,
|
|
264
208
|
onMouseLeave: onMouseLeave,
|
|
265
209
|
onClick: onClick,
|
|
266
210
|
className: (0, _emotion.cx)('baymax', className),
|
|
267
211
|
style: style
|
|
268
|
-
}, React.createElement("div", (0, _extends2.default)({}, attributes, {
|
|
212
|
+
}, /*#__PURE__*/React.createElement("div", (0, _extends2.default)({}, attributes, {
|
|
269
213
|
className: (0, _emotion.cx)('cell read', cellClassName),
|
|
270
214
|
style: cellStyle,
|
|
271
215
|
dangerouslySetInnerHTML: {
|
|
@@ -274,11 +218,9 @@ function (_React$Component) {
|
|
|
274
218
|
})));
|
|
275
219
|
}
|
|
276
220
|
}]);
|
|
277
|
-
return CellRenderer;
|
|
278
221
|
}(React.Component);
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
(0, _defineProperty2.default)(CellRenderer, "propTypes", _objectSpread({
|
|
222
|
+
/** @hidden */
|
|
223
|
+
(0, _defineProperty2.default)(CellRenderer, "propTypes", _objectSpread(_objectSpread({
|
|
282
224
|
// NOTE: must pass in one of record or cellValue. It will default to using
|
|
283
225
|
// the record if one is passed in, and cellValue otherwise.
|
|
284
226
|
record: _propTypes.default.instanceOf(_record.default),
|
|
@@ -290,18 +232,17 @@ exports.CellRenderer = CellRenderer;
|
|
|
290
232
|
cellClassName: _propTypes.default.string,
|
|
291
233
|
cellStyle: _propTypes.default.object,
|
|
292
234
|
renderInvalidCellValue: _propTypes.default.func
|
|
293
|
-
}, _tooltip_anchor_props.tooltipAnchorPropTypes,
|
|
235
|
+
}, _tooltip_anchor_props.tooltipAnchorPropTypes), cellRendererStylePropTypes));
|
|
236
|
+
/** @hidden */
|
|
294
237
|
(0, _defineProperty2.default)(CellRenderer, "defaultProps", {
|
|
295
238
|
shouldWrap: true
|
|
296
239
|
});
|
|
297
|
-
|
|
298
|
-
var _default = (0, _with_hooks.default)(CellRenderer, props => {
|
|
240
|
+
var _default = exports.default = (0, _with_hooks.default)(CellRenderer, props => {
|
|
299
241
|
var _splitStyleProps = (0, _with_styled_system.splitStyleProps)(props, styleParser.propNames, {
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
242
|
+
display: 'block'
|
|
243
|
+
}),
|
|
244
|
+
styleProps = _splitStyleProps.styleProps,
|
|
245
|
+
nonStyleProps = _splitStyleProps.nonStyleProps;
|
|
305
246
|
var className = nonStyleProps.className;
|
|
306
247
|
var classNameForStyleProps = (0, _use_styled_system.default)(styleProps, styleParser);
|
|
307
248
|
var sdk = (0, _sdk_context.useSdk)();
|
|
@@ -311,6 +252,4 @@ var _default = (0, _with_hooks.default)(CellRenderer, props => {
|
|
|
311
252
|
className: (0, _emotion.cx)(classNameForStyleProps, className),
|
|
312
253
|
sdk
|
|
313
254
|
};
|
|
314
|
-
});
|
|
315
|
-
|
|
316
|
-
exports.default = _default;
|
|
255
|
+
});
|
|
@@ -1,60 +1,59 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
require("core-js/modules/es.symbol.js");
|
|
4
|
+
require("core-js/modules/es.array.filter.js");
|
|
5
|
+
require("core-js/modules/es.array.iterator.js");
|
|
6
|
+
require("core-js/modules/es.object.get-own-property-descriptors.js");
|
|
7
|
+
require("core-js/modules/es.object.to-string.js");
|
|
8
|
+
require("core-js/modules/es.weak-map.js");
|
|
9
|
+
require("core-js/modules/web.dom-collections.for-each.js");
|
|
10
|
+
require("core-js/modules/web.dom-collections.iterator.js");
|
|
5
11
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
6
|
-
|
|
7
|
-
require("core-js/modules/es.symbol");
|
|
8
|
-
|
|
9
|
-
require("core-js/modules/es.array.filter");
|
|
10
|
-
|
|
11
|
-
require("core-js/modules/es.object.get-own-property-descriptors");
|
|
12
|
-
|
|
13
|
-
require("core-js/modules/web.dom-collections.for-each");
|
|
14
|
-
|
|
15
12
|
Object.defineProperty(exports, "__esModule", {
|
|
16
13
|
value: true
|
|
17
14
|
});
|
|
18
15
|
exports.default = exports.choiceTokenStylePropTypes = void 0;
|
|
19
|
-
|
|
20
16
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
21
|
-
|
|
22
17
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
23
|
-
|
|
24
18
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
25
|
-
|
|
26
19
|
var _emotion = require("emotion");
|
|
27
|
-
|
|
28
20
|
var React = _interopRequireWildcard(require("react"));
|
|
29
|
-
|
|
30
21
|
var _core = require("@styled-system/core");
|
|
31
|
-
|
|
32
22
|
var _baymax_utils = require("./baymax_utils");
|
|
33
|
-
|
|
34
23
|
var _box = _interopRequireDefault(require("./box"));
|
|
35
|
-
|
|
36
24
|
var _text = _interopRequireDefault(require("./text"));
|
|
37
|
-
|
|
38
25
|
var _use_styled_system = _interopRequireDefault(require("./use_styled_system"));
|
|
39
|
-
|
|
40
26
|
var _use_text_color_for_background_color = _interopRequireDefault(require("./use_text_color_for_background_color"));
|
|
41
|
-
|
|
42
27
|
var _system = require("./system");
|
|
43
|
-
|
|
44
28
|
var _tooltip_anchor_props = require("./types/tooltip_anchor_props");
|
|
45
|
-
|
|
46
|
-
function
|
|
47
|
-
|
|
48
|
-
function
|
|
29
|
+
var _excluded = ["choice", "onMouseEnter", "onMouseLeave", "onClick", "hasOnClick", "className", "style"];
|
|
30
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
31
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
32
|
+
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; }
|
|
33
|
+
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/ui: ChoiceToken */ /** */
|
|
34
|
+
/**
|
|
35
|
+
* Style props for the {@link ChoiceToken} component. Accepts:
|
|
36
|
+
* * {@link FlexItemSetProps}
|
|
37
|
+
* * {@link MarginProps}
|
|
38
|
+
* * {@link PositionSetProps}
|
|
39
|
+
*
|
|
40
|
+
* @noInheritDoc
|
|
41
|
+
*/
|
|
49
42
|
|
|
50
43
|
var styleParser = (0, _core.compose)(_system.flexItemSet, _system.positionSet, _system.margin);
|
|
51
|
-
|
|
52
|
-
var choiceTokenStylePropTypes = _objectSpread({}, _system.flexItemSetPropTypes, {}, _system.positionSetPropTypes, {}, _system.marginPropTypes);
|
|
53
|
-
|
|
54
|
-
exports.choiceTokenStylePropTypes = choiceTokenStylePropTypes;
|
|
44
|
+
var choiceTokenStylePropTypes = exports.choiceTokenStylePropTypes = _objectSpread(_objectSpread(_objectSpread({}, _system.flexItemSetPropTypes), _system.positionSetPropTypes), _system.marginPropTypes);
|
|
55
45
|
var DEFAULT_CHOICE_COLOR = 'gray';
|
|
46
|
+
|
|
56
47
|
/** An option from a select field. You should not create these objects from scratch, but should instead grab them from base data. */
|
|
57
48
|
|
|
49
|
+
/**
|
|
50
|
+
* Props for the {@link ChoiceToken} component. Also accepts:
|
|
51
|
+
* * {@link ChoiceTokenStyleProps}
|
|
52
|
+
*
|
|
53
|
+
* @docsPath UI/components/ChoiceToken
|
|
54
|
+
* @noInheritDoc
|
|
55
|
+
*/
|
|
56
|
+
|
|
58
57
|
/**
|
|
59
58
|
* A component that shows a single choice in a small token, to be displayed inline or in a list of choices.
|
|
60
59
|
*
|
|
@@ -65,21 +64,22 @@ var DEFAULT_CHOICE_COLOR = 'gray';
|
|
|
65
64
|
*/
|
|
66
65
|
var ChoiceToken = props => {
|
|
67
66
|
var choice = props.choice,
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
67
|
+
onMouseEnter = props.onMouseEnter,
|
|
68
|
+
onMouseLeave = props.onMouseLeave,
|
|
69
|
+
onClick = props.onClick,
|
|
70
|
+
hasOnClick = props.hasOnClick,
|
|
71
|
+
className = props.className,
|
|
72
|
+
style = props.style,
|
|
73
|
+
styleProps = (0, _objectWithoutProperties2.default)(props, _excluded);
|
|
75
74
|
var classNameForStyleProps = (0, _use_styled_system.default)(styleProps, styleParser);
|
|
76
75
|
var color = choice.color || DEFAULT_CHOICE_COLOR;
|
|
77
76
|
var textColor = (0, _use_text_color_for_background_color.default)(color);
|
|
78
|
-
return React.createElement(_box.default, {
|
|
77
|
+
return /*#__PURE__*/React.createElement(_box.default, {
|
|
79
78
|
className: (0, _emotion.cx)(className, classNameForStyleProps),
|
|
80
79
|
style: style,
|
|
81
80
|
display: "inline-block"
|
|
82
|
-
}, React.createElement(_box.default
|
|
81
|
+
}, /*#__PURE__*/React.createElement(_box.default
|
|
82
|
+
// TODO (stephen): remove tooltip anchor props
|
|
83
83
|
, {
|
|
84
84
|
onMouseEnter: onMouseEnter,
|
|
85
85
|
onMouseLeave: onMouseLeave,
|
|
@@ -90,7 +90,7 @@ var ChoiceToken = props => {
|
|
|
90
90
|
height: "18px",
|
|
91
91
|
borderRadius: "circle",
|
|
92
92
|
paddingX: 2
|
|
93
|
-
}, React.createElement(_text.default, {
|
|
93
|
+
}, /*#__PURE__*/React.createElement(_text.default, {
|
|
94
94
|
className: (0, _baymax_utils.baymax)('truncate'),
|
|
95
95
|
textColor: textColor,
|
|
96
96
|
fontSize: "13px",
|
|
@@ -98,8 +98,7 @@ var ChoiceToken = props => {
|
|
|
98
98
|
lineHeight: 1.5
|
|
99
99
|
}, choice.name)));
|
|
100
100
|
};
|
|
101
|
-
|
|
102
|
-
ChoiceToken.propTypes = _objectSpread({
|
|
101
|
+
ChoiceToken.propTypes = _objectSpread(_objectSpread({
|
|
103
102
|
choice: _propTypes.default.shape({
|
|
104
103
|
id: _propTypes.default.string,
|
|
105
104
|
name: _propTypes.default.string.isRequired,
|
|
@@ -107,6 +106,5 @@ ChoiceToken.propTypes = _objectSpread({
|
|
|
107
106
|
}).isRequired,
|
|
108
107
|
style: _propTypes.default.object,
|
|
109
108
|
className: _propTypes.default.string
|
|
110
|
-
}, _tooltip_anchor_props.tooltipAnchorPropTypes,
|
|
111
|
-
var _default = ChoiceToken;
|
|
112
|
-
exports.default = _default;
|
|
109
|
+
}, _tooltip_anchor_props.tooltipAnchorPropTypes), choiceTokenStylePropTypes);
|
|
110
|
+
var _default = exports.default = ChoiceToken;
|