@airtable/blocks 1.18.1 → 1.19.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +15 -1
- package/dist/cjs/color_utils.js +21 -23
- package/dist/cjs/colors.js +4 -60
- package/dist/cjs/error_utils.js +15 -25
- package/dist/cjs/event_tracker.js +5 -11
- package/dist/cjs/global_config.js +107 -188
- package/dist/cjs/index.js +16 -40
- package/dist/cjs/injected/airtable_interface.js +1 -6
- package/dist/cjs/models/abstract_model.js +50 -81
- package/dist/cjs/models/abstract_model_with_async_data.js +102 -177
- package/dist/cjs/models/base.js +211 -374
- package/dist/cjs/models/create_aggregators.js +53 -47
- package/dist/cjs/models/cursor.js +125 -201
- package/dist/cjs/models/field.js +256 -303
- package/dist/cjs/models/grouped_record_query_result.js +210 -286
- package/dist/cjs/models/linked_records_query_result.js +276 -454
- package/dist/cjs/models/models.js +36 -50
- package/dist/cjs/models/mutation_constants.js +5 -9
- package/dist/cjs/models/mutations.js +125 -338
- package/dist/cjs/models/object_pool.js +37 -94
- package/dist/cjs/models/record.js +132 -226
- package/dist/cjs/models/record_coloring.js +14 -19
- package/dist/cjs/models/record_query_result.js +323 -282
- package/dist/cjs/models/record_store.js +355 -688
- package/dist/cjs/models/session.js +99 -158
- package/dist/cjs/models/table.js +361 -549
- package/dist/cjs/models/table_or_view_query_result.js +410 -765
- package/dist/cjs/models/view.js +161 -204
- package/dist/cjs/models/view_data_store.js +177 -282
- package/dist/cjs/models/view_metadata_query_result.js +96 -127
- package/dist/cjs/perform_record_action.js +69 -103
- package/dist/cjs/private_utils.js +133 -223
- package/dist/cjs/sdk.js +97 -142
- package/dist/cjs/settings_button.js +30 -57
- package/dist/cjs/stats/block_stats.js +3 -15
- package/dist/cjs/testing/abstract_mock_airtable_interface.js +53 -97
- package/dist/cjs/types/airtable_interface.js +36 -8
- package/dist/cjs/types/field.js +66 -12
- package/dist/cjs/types/mutations.js +99 -6
- package/dist/cjs/types/permission_levels.js +2 -4
- package/dist/cjs/types/undo_redo.js +2 -3
- package/dist/cjs/types/view.js +16 -11
- package/dist/cjs/ui/base_provider.js +14 -9
- package/dist/cjs/ui/baymax_utils.js +107 -1102
- package/dist/cjs/ui/block_wrapper.js +30 -68
- package/dist/cjs/ui/box.js +52 -56
- package/dist/cjs/ui/button.js +60 -77
- package/dist/cjs/ui/cell_renderer.js +78 -139
- package/dist/cjs/ui/choice_token.js +45 -47
- package/dist/cjs/ui/collaborator_token.js +33 -54
- package/dist/cjs/ui/color_palette.js +58 -106
- package/dist/cjs/ui/color_palette_synced.js +41 -52
- package/dist/cjs/ui/confirmation_dialog.js +53 -69
- package/dist/cjs/ui/control_sizes.js +21 -46
- package/dist/cjs/ui/create_detect_element_resize.js +16 -50
- package/dist/cjs/ui/css_helpers.js +3 -10
- package/dist/cjs/ui/dialog.js +44 -71
- package/dist/cjs/ui/dialog_close_button.js +52 -72
- package/dist/cjs/ui/expand_record.js +4 -11
- package/dist/cjs/ui/expand_record_list.js +6 -11
- package/dist/cjs/ui/expand_record_picker_async.js +18 -35
- package/dist/cjs/ui/field_icon.js +25 -28
- package/dist/cjs/ui/field_picker.js +47 -81
- package/dist/cjs/ui/field_picker_synced.js +33 -44
- package/dist/cjs/ui/form_field.js +45 -64
- package/dist/cjs/ui/geometry/geometry.js +6 -10
- package/dist/cjs/ui/geometry/point.js +5 -13
- package/dist/cjs/ui/geometry/rect.js +7 -29
- package/dist/cjs/ui/geometry/size.js +5 -13
- package/dist/cjs/ui/global_alert.js +35 -61
- package/dist/cjs/ui/global_config_synced_component_helpers.js +4 -13
- package/dist/cjs/ui/heading.js +63 -92
- package/dist/cjs/ui/icon.js +44 -66
- package/dist/cjs/ui/icon_config.js +13 -24
- package/dist/cjs/ui/initialize_block.js +23 -36
- package/dist/cjs/ui/input.js +74 -87
- package/dist/cjs/ui/input_synced.js +34 -43
- package/dist/cjs/ui/key_codes.js +4 -9
- package/dist/cjs/ui/label.js +45 -50
- package/dist/cjs/ui/link.js +74 -89
- package/dist/cjs/ui/loader.js +26 -42
- package/dist/cjs/ui/modal.js +63 -89
- package/dist/cjs/ui/model_picker_select.js +29 -47
- package/dist/cjs/ui/popover.js +98 -180
- package/dist/cjs/ui/progress_bar.js +45 -51
- package/dist/cjs/ui/record_card.js +143 -278
- package/dist/cjs/ui/record_card_list.js +117 -165
- package/dist/cjs/ui/remote_utils.js +5 -13
- package/dist/cjs/ui/sdk_context.js +7 -9
- package/dist/cjs/ui/select.js +84 -118
- package/dist/cjs/ui/select_and_select_buttons_helpers.js +29 -45
- package/dist/cjs/ui/select_buttons.js +54 -90
- package/dist/cjs/ui/select_buttons_synced.js +32 -41
- package/dist/cjs/ui/select_synced.js +32 -42
- package/dist/cjs/ui/switch.js +66 -84
- package/dist/cjs/ui/switch_synced.js +32 -38
- package/dist/cjs/ui/synced.js +16 -43
- package/dist/cjs/ui/system/all_styles_set.js +89 -22
- package/dist/cjs/ui/system/appearance/appearance_set.js +15 -26
- package/dist/cjs/ui/system/appearance/background_color.js +6 -12
- package/dist/cjs/ui/system/appearance/border.js +6 -12
- package/dist/cjs/ui/system/appearance/border_radius.js +6 -12
- package/dist/cjs/ui/system/appearance/box_shadow.js +6 -12
- package/dist/cjs/ui/system/appearance/opacity.js +5 -11
- package/dist/cjs/ui/system/dimensions/dimensions_set.js +15 -27
- package/dist/cjs/ui/system/dimensions/height.js +5 -11
- package/dist/cjs/ui/system/dimensions/max_height.js +5 -11
- package/dist/cjs/ui/system/dimensions/max_width.js +5 -11
- package/dist/cjs/ui/system/dimensions/min_height.js +5 -11
- package/dist/cjs/ui/system/dimensions/min_width.js +5 -11
- package/dist/cjs/ui/system/dimensions/width.js +5 -11
- package/dist/cjs/ui/system/display.js +8 -9
- package/dist/cjs/ui/system/flex_container/align_content.js +6 -12
- package/dist/cjs/ui/system/flex_container/align_items.js +6 -12
- package/dist/cjs/ui/system/flex_container/flex_container_set.js +15 -27
- package/dist/cjs/ui/system/flex_container/flex_direction.js +5 -11
- package/dist/cjs/ui/system/flex_container/flex_wrap.js +5 -11
- package/dist/cjs/ui/system/flex_container/justify_content.js +5 -11
- package/dist/cjs/ui/system/flex_container/justify_items.js +5 -11
- package/dist/cjs/ui/system/flex_item/align_self.js +6 -12
- package/dist/cjs/ui/system/flex_item/flex.js +5 -11
- package/dist/cjs/ui/system/flex_item/flex_basis.js +5 -11
- package/dist/cjs/ui/system/flex_item/flex_grow.js +5 -11
- package/dist/cjs/ui/system/flex_item/flex_item_set.js +15 -28
- package/dist/cjs/ui/system/flex_item/flex_shrink.js +5 -11
- package/dist/cjs/ui/system/flex_item/justify_self.js +5 -11
- package/dist/cjs/ui/system/flex_item/order.js +5 -11
- package/dist/cjs/ui/system/index.js +310 -362
- package/dist/cjs/ui/system/overflow.js +8 -9
- package/dist/cjs/ui/system/position/bottom.js +6 -13
- package/dist/cjs/ui/system/position/left.js +5 -12
- package/dist/cjs/ui/system/position/position.js +5 -11
- package/dist/cjs/ui/system/position/position_set.js +15 -27
- package/dist/cjs/ui/system/position/right.js +5 -12
- package/dist/cjs/ui/system/position/top.js +5 -12
- package/dist/cjs/ui/system/position/z_index.js +5 -11
- package/dist/cjs/ui/system/spacing/margin.js +5 -12
- package/dist/cjs/ui/system/spacing/padding.js +5 -12
- package/dist/cjs/ui/system/spacing/spacing_set.js +15 -23
- package/dist/cjs/ui/system/typography/font_family.js +5 -11
- package/dist/cjs/ui/system/typography/font_size.js +5 -11
- package/dist/cjs/ui/system/typography/font_style.js +5 -11
- package/dist/cjs/ui/system/typography/font_weight.js +5 -11
- package/dist/cjs/ui/system/typography/letter_spacing.js +5 -11
- package/dist/cjs/ui/system/typography/line_height.js +5 -11
- package/dist/cjs/ui/system/typography/text_align.js +5 -11
- package/dist/cjs/ui/system/typography/text_color.js +5 -11
- package/dist/cjs/ui/system/typography/text_decoration.js +5 -11
- package/dist/cjs/ui/system/typography/text_transform.js +5 -11
- package/dist/cjs/ui/system/typography/typography_set.js +15 -31
- package/dist/cjs/ui/system/utils/create_responsive_prop_type.js +2 -4
- package/dist/cjs/ui/system/utils/create_style_prop_types.js +5 -13
- package/dist/cjs/ui/system/utils/ensure_numbers_are_within_scale.js +4 -14
- package/dist/cjs/ui/system/utils/get_style_props_for_responsive_prop.js +30 -70
- package/dist/cjs/ui/table_picker.js +26 -43
- package/dist/cjs/ui/table_picker_synced.js +33 -42
- package/dist/cjs/ui/text.js +59 -71
- package/dist/cjs/ui/text_button.js +80 -97
- package/dist/cjs/ui/theme/default_theme/button_variants.js +1 -5
- package/dist/cjs/ui/theme/default_theme/control_sizes.js +29 -42
- package/dist/cjs/ui/theme/default_theme/heading_styles.js +4 -5
- package/dist/cjs/ui/theme/default_theme/index.js +15 -32
- package/dist/cjs/ui/theme/default_theme/input_variants.js +1 -5
- package/dist/cjs/ui/theme/default_theme/link_variants.js +1 -5
- package/dist/cjs/ui/theme/default_theme/select_buttons_variants.js +1 -5
- package/dist/cjs/ui/theme/default_theme/select_variants.js +10 -21
- package/dist/cjs/ui/theme/default_theme/switch_variants.js +8 -20
- package/dist/cjs/ui/theme/default_theme/text_button_variants.js +1 -5
- package/dist/cjs/ui/theme/default_theme/text_styles.js +1 -2
- package/dist/cjs/ui/theme/default_theme/tokens.js +33 -35
- package/dist/cjs/ui/theme/theme_context.js +3 -6
- package/dist/cjs/ui/theme/use_theme.js +1 -7
- package/dist/cjs/ui/tooltip.js +38 -79
- package/dist/cjs/ui/types/aria_props.js +3 -7
- package/dist/cjs/ui/types/data_attributes_prop.js +8 -6
- package/dist/cjs/ui/types/tooltip_anchor_props.js +4 -5
- package/dist/cjs/ui/ui.js +97 -130
- package/dist/cjs/ui/unstable_standalone_ui.js +18 -42
- package/dist/cjs/ui/use_array_identity.js +0 -4
- package/dist/cjs/ui/use_base.js +4 -13
- package/dist/cjs/ui/use_color_scheme.js +60 -0
- package/dist/cjs/ui/use_cursor.js +3 -12
- package/dist/cjs/ui/use_form_field.js +4 -6
- package/dist/cjs/ui/use_global_config.js +3 -10
- package/dist/cjs/ui/use_loadable.js +59 -132
- package/dist/cjs/ui/use_record_action_data.js +6 -12
- package/dist/cjs/ui/use_records.js +27 -28
- package/dist/cjs/ui/use_session.js +6 -15
- package/dist/cjs/ui/use_settings_button.js +4 -11
- package/dist/cjs/ui/use_styled_system.js +12 -21
- package/dist/cjs/ui/use_synced.js +0 -7
- package/dist/cjs/ui/use_text_color_for_background_color.js +1 -5
- package/dist/cjs/ui/use_view_metadata.js +5 -8
- package/dist/cjs/ui/use_viewport.js +1 -7
- package/dist/cjs/ui/use_watchable.js +36 -74
- package/dist/cjs/ui/view_picker.js +44 -78
- package/dist/cjs/ui/view_picker_synced.js +33 -44
- package/dist/cjs/ui/viewport_constraint.js +37 -64
- package/dist/cjs/ui/with_hooks.js +17 -22
- package/dist/cjs/ui/with_styled_system.js +33 -60
- package/dist/cjs/undo_redo.js +12 -32
- package/dist/cjs/unstable_private_utils.js +6 -8
- package/dist/cjs/unstable_testing_utils.js +44 -57
- package/dist/cjs/viewport.js +127 -189
- package/dist/cjs/warning.js +5 -6
- package/dist/cjs/watchable.js +66 -148
- package/dist/types/src/colors.d.ts +1 -1
- package/dist/types/src/colors.d.ts.map +1 -1
- package/dist/types/src/global_config.d.ts +1 -1
- package/dist/types/src/global_config.d.ts.map +1 -1
- package/dist/types/src/models/base.d.ts +1 -1
- package/dist/types/src/models/base.d.ts.map +1 -1
- package/dist/types/src/models/cursor.d.ts +1 -1
- package/dist/types/src/models/cursor.d.ts.map +1 -1
- package/dist/types/src/models/field.d.ts +1 -1
- package/dist/types/src/models/field.d.ts.map +1 -1
- package/dist/types/src/models/linked_records_query_result.d.ts.map +1 -1
- package/dist/types/src/models/models.d.ts.map +1 -1
- package/dist/types/src/models/record.d.ts +1 -1
- package/dist/types/src/models/record.d.ts.map +1 -1
- package/dist/types/src/models/record_coloring.d.ts +2 -2
- package/dist/types/src/models/record_coloring.d.ts.map +1 -1
- package/dist/types/src/models/record_query_result.d.ts +3 -3
- package/dist/types/src/models/record_query_result.d.ts.map +1 -1
- package/dist/types/src/models/session.d.ts +1 -1
- package/dist/types/src/models/session.d.ts.map +1 -1
- package/dist/types/src/models/table.d.ts +1 -1
- package/dist/types/src/models/table.d.ts.map +1 -1
- package/dist/types/src/models/view.d.ts +1 -1
- package/dist/types/src/models/view.d.ts.map +1 -1
- package/dist/types/src/models/view_metadata_query_result.d.ts +2 -2
- package/dist/types/src/models/view_metadata_query_result.d.ts.map +1 -1
- package/dist/types/src/perform_record_action.d.ts +1 -1
- package/dist/types/src/perform_record_action.d.ts.map +1 -1
- package/dist/types/src/private_utils.d.ts +8 -8
- package/dist/types/src/private_utils.d.ts.map +1 -1
- package/dist/types/src/sdk.d.ts +1 -1
- package/dist/types/src/sdk.d.ts.map +1 -1
- package/dist/types/src/settings_button.d.ts +1 -1
- package/dist/types/src/settings_button.d.ts.map +1 -1
- package/dist/types/src/types/aggregators.d.ts +1 -1
- package/dist/types/src/types/aggregators.d.ts.map +1 -1
- package/dist/types/src/types/airtable_interface.d.ts +6 -6
- package/dist/types/src/types/airtable_interface.d.ts.map +1 -1
- package/dist/types/src/types/attachment.d.ts +1 -1
- package/dist/types/src/types/attachment.d.ts.map +1 -1
- package/dist/types/src/types/base.d.ts +1 -1
- package/dist/types/src/types/base.d.ts.map +1 -1
- package/dist/types/src/types/block.d.ts +1 -1
- package/dist/types/src/types/block.d.ts.map +1 -1
- package/dist/types/src/types/collaborator.d.ts +1 -1
- package/dist/types/src/types/collaborator.d.ts.map +1 -1
- package/dist/types/src/types/field.d.ts +5 -5
- package/dist/types/src/types/field.d.ts.map +1 -1
- package/dist/types/src/types/global_config.d.ts +6 -6
- package/dist/types/src/types/global_config.d.ts.map +1 -1
- package/dist/types/src/types/mutations.d.ts +4 -4
- package/dist/types/src/types/mutations.d.ts.map +1 -1
- package/dist/types/src/types/permission_levels.d.ts +1 -1
- package/dist/types/src/types/permission_levels.d.ts.map +1 -1
- package/dist/types/src/types/record.d.ts +2 -2
- package/dist/types/src/types/record.d.ts.map +1 -1
- package/dist/types/src/types/record_action_data.d.ts +1 -1
- package/dist/types/src/types/record_action_data.d.ts.map +1 -1
- package/dist/types/src/types/table.d.ts +3 -3
- package/dist/types/src/types/table.d.ts.map +1 -1
- package/dist/types/src/types/undo_redo.d.ts +1 -1
- package/dist/types/src/types/undo_redo.d.ts.map +1 -1
- package/dist/types/src/types/view.d.ts +4 -4
- package/dist/types/src/types/view.d.ts.map +1 -1
- package/dist/types/src/ui/base_provider.d.ts +1 -1
- package/dist/types/src/ui/base_provider.d.ts.map +1 -1
- package/dist/types/src/ui/block_wrapper.d.ts +2 -2
- package/dist/types/src/ui/button.d.ts +2 -2
- package/dist/types/src/ui/button.d.ts.map +1 -1
- package/dist/types/src/ui/cell_renderer.d.ts +2 -2
- package/dist/types/src/ui/choice_token.d.ts +4 -4
- package/dist/types/src/ui/choice_token.d.ts.map +1 -1
- package/dist/types/src/ui/collaborator_token.d.ts +6 -6
- package/dist/types/src/ui/collaborator_token.d.ts.map +1 -1
- package/dist/types/src/ui/color_palette.d.ts +3 -3
- package/dist/types/src/ui/color_palette.d.ts.map +1 -1
- package/dist/types/src/ui/color_palette_synced.d.ts +2 -2
- package/dist/types/src/ui/confirmation_dialog.d.ts +1 -1
- package/dist/types/src/ui/control_sizes.d.ts +2 -2
- package/dist/types/src/ui/control_sizes.d.ts.map +1 -1
- package/dist/types/src/ui/dialog.d.ts +2 -2
- package/dist/types/src/ui/dialog.d.ts.map +1 -1
- package/dist/types/src/ui/dialog_close_button.d.ts +1 -1
- package/dist/types/src/ui/field_icon.d.ts +3 -3
- package/dist/types/src/ui/field_icon.d.ts.map +1 -1
- package/dist/types/src/ui/field_picker.d.ts +2 -2
- package/dist/types/src/ui/field_picker.d.ts.map +1 -1
- package/dist/types/src/ui/form_field.d.ts +1 -1
- package/dist/types/src/ui/form_field.d.ts.map +1 -1
- package/dist/types/src/ui/global_alert.d.ts +1 -1
- package/dist/types/src/ui/global_alert.d.ts.map +1 -1
- package/dist/types/src/ui/global_config_synced_component_helpers.d.ts +1 -1
- package/dist/types/src/ui/global_config_synced_component_helpers.d.ts.map +1 -1
- package/dist/types/src/ui/heading.d.ts +4 -4
- package/dist/types/src/ui/heading.d.ts.map +1 -1
- package/dist/types/src/ui/icon.d.ts +2 -2
- package/dist/types/src/ui/icon.d.ts.map +1 -1
- package/dist/types/src/ui/icon_config.d.ts +39 -39
- package/dist/types/src/ui/icon_config.d.ts.map +1 -1
- package/dist/types/src/ui/initialize_block.d.ts +3 -3
- package/dist/types/src/ui/initialize_block.d.ts.map +1 -1
- package/dist/types/src/ui/input.d.ts +16 -16
- package/dist/types/src/ui/input.d.ts.map +1 -1
- package/dist/types/src/ui/label.d.ts +1 -1
- package/dist/types/src/ui/label.d.ts.map +1 -1
- package/dist/types/src/ui/link.d.ts +2 -2
- package/dist/types/src/ui/link.d.ts.map +1 -1
- package/dist/types/src/ui/loader.d.ts +2 -2
- package/dist/types/src/ui/loader.d.ts.map +1 -1
- package/dist/types/src/ui/model_picker_select.d.ts +1 -1
- package/dist/types/src/ui/model_picker_select.d.ts.map +1 -1
- package/dist/types/src/ui/popover.d.ts +5 -5
- package/dist/types/src/ui/popover.d.ts.map +1 -1
- package/dist/types/src/ui/progress_bar.d.ts +2 -2
- package/dist/types/src/ui/progress_bar.d.ts.map +1 -1
- package/dist/types/src/ui/record_card.d.ts +3 -3
- package/dist/types/src/ui/record_card.d.ts.map +1 -1
- package/dist/types/src/ui/record_card_list.d.ts +3 -3
- package/dist/types/src/ui/record_card_list.d.ts.map +1 -1
- package/dist/types/src/ui/select.d.ts +4 -4
- package/dist/types/src/ui/select_and_select_buttons_helpers.d.ts +4 -4
- package/dist/types/src/ui/select_and_select_buttons_helpers.d.ts.map +1 -1
- package/dist/types/src/ui/select_buttons.d.ts +5 -5
- package/dist/types/src/ui/select_buttons.d.ts.map +1 -1
- package/dist/types/src/ui/switch.d.ts +2 -2
- package/dist/types/src/ui/switch.d.ts.map +1 -1
- package/dist/types/src/ui/synced.d.ts +3 -3
- package/dist/types/src/ui/system/all_styles_set.d.ts +0 -1
- package/dist/types/src/ui/system/all_styles_set.d.ts.map +1 -1
- package/dist/types/src/ui/system/appearance/appearance_set.d.ts +0 -1
- package/dist/types/src/ui/system/appearance/appearance_set.d.ts.map +1 -1
- package/dist/types/src/ui/system/appearance/background_color.d.ts +0 -1
- package/dist/types/src/ui/system/appearance/background_color.d.ts.map +1 -1
- package/dist/types/src/ui/system/appearance/border.d.ts +0 -1
- package/dist/types/src/ui/system/appearance/border.d.ts.map +1 -1
- package/dist/types/src/ui/system/appearance/border_radius.d.ts +0 -1
- package/dist/types/src/ui/system/appearance/border_radius.d.ts.map +1 -1
- package/dist/types/src/ui/system/appearance/box_shadow.d.ts +0 -1
- package/dist/types/src/ui/system/appearance/box_shadow.d.ts.map +1 -1
- package/dist/types/src/ui/system/appearance/opacity.d.ts +0 -1
- package/dist/types/src/ui/system/appearance/opacity.d.ts.map +1 -1
- package/dist/types/src/ui/system/dimensions/dimensions_set.d.ts +0 -1
- package/dist/types/src/ui/system/dimensions/dimensions_set.d.ts.map +1 -1
- package/dist/types/src/ui/system/dimensions/height.d.ts +0 -1
- package/dist/types/src/ui/system/dimensions/height.d.ts.map +1 -1
- package/dist/types/src/ui/system/dimensions/max_height.d.ts +0 -1
- package/dist/types/src/ui/system/dimensions/max_height.d.ts.map +1 -1
- package/dist/types/src/ui/system/dimensions/max_width.d.ts +0 -1
- package/dist/types/src/ui/system/dimensions/max_width.d.ts.map +1 -1
- package/dist/types/src/ui/system/dimensions/min_height.d.ts +0 -1
- package/dist/types/src/ui/system/dimensions/min_height.d.ts.map +1 -1
- package/dist/types/src/ui/system/dimensions/min_width.d.ts +0 -1
- package/dist/types/src/ui/system/dimensions/min_width.d.ts.map +1 -1
- package/dist/types/src/ui/system/dimensions/width.d.ts +0 -1
- package/dist/types/src/ui/system/dimensions/width.d.ts.map +1 -1
- package/dist/types/src/ui/system/display.d.ts +0 -1
- package/dist/types/src/ui/system/display.d.ts.map +1 -1
- package/dist/types/src/ui/system/flex_container/align_content.d.ts +0 -1
- package/dist/types/src/ui/system/flex_container/align_content.d.ts.map +1 -1
- package/dist/types/src/ui/system/flex_container/align_items.d.ts +0 -1
- package/dist/types/src/ui/system/flex_container/align_items.d.ts.map +1 -1
- package/dist/types/src/ui/system/flex_container/flex_container_set.d.ts +0 -1
- package/dist/types/src/ui/system/flex_container/flex_container_set.d.ts.map +1 -1
- package/dist/types/src/ui/system/flex_container/flex_direction.d.ts +0 -1
- package/dist/types/src/ui/system/flex_container/flex_direction.d.ts.map +1 -1
- package/dist/types/src/ui/system/flex_container/flex_wrap.d.ts +0 -1
- package/dist/types/src/ui/system/flex_container/flex_wrap.d.ts.map +1 -1
- package/dist/types/src/ui/system/flex_container/justify_content.d.ts +0 -1
- package/dist/types/src/ui/system/flex_container/justify_content.d.ts.map +1 -1
- package/dist/types/src/ui/system/flex_container/justify_items.d.ts +0 -1
- package/dist/types/src/ui/system/flex_container/justify_items.d.ts.map +1 -1
- package/dist/types/src/ui/system/flex_item/align_self.d.ts +0 -1
- package/dist/types/src/ui/system/flex_item/align_self.d.ts.map +1 -1
- package/dist/types/src/ui/system/flex_item/flex.d.ts +0 -1
- package/dist/types/src/ui/system/flex_item/flex.d.ts.map +1 -1
- package/dist/types/src/ui/system/flex_item/flex_basis.d.ts +0 -1
- package/dist/types/src/ui/system/flex_item/flex_basis.d.ts.map +1 -1
- package/dist/types/src/ui/system/flex_item/flex_grow.d.ts +0 -1
- package/dist/types/src/ui/system/flex_item/flex_grow.d.ts.map +1 -1
- package/dist/types/src/ui/system/flex_item/flex_item_set.d.ts +0 -1
- package/dist/types/src/ui/system/flex_item/flex_item_set.d.ts.map +1 -1
- package/dist/types/src/ui/system/flex_item/flex_shrink.d.ts +0 -1
- package/dist/types/src/ui/system/flex_item/flex_shrink.d.ts.map +1 -1
- package/dist/types/src/ui/system/flex_item/justify_self.d.ts +0 -1
- package/dist/types/src/ui/system/flex_item/justify_self.d.ts.map +1 -1
- package/dist/types/src/ui/system/flex_item/order.d.ts +0 -1
- package/dist/types/src/ui/system/flex_item/order.d.ts.map +1 -1
- package/dist/types/src/ui/system/overflow.d.ts +0 -1
- package/dist/types/src/ui/system/overflow.d.ts.map +1 -1
- package/dist/types/src/ui/system/position/bottom.d.ts +0 -1
- package/dist/types/src/ui/system/position/bottom.d.ts.map +1 -1
- package/dist/types/src/ui/system/position/left.d.ts +0 -1
- package/dist/types/src/ui/system/position/left.d.ts.map +1 -1
- package/dist/types/src/ui/system/position/position.d.ts +0 -1
- package/dist/types/src/ui/system/position/position.d.ts.map +1 -1
- package/dist/types/src/ui/system/position/position_set.d.ts +0 -1
- package/dist/types/src/ui/system/position/position_set.d.ts.map +1 -1
- package/dist/types/src/ui/system/position/right.d.ts +0 -1
- package/dist/types/src/ui/system/position/right.d.ts.map +1 -1
- package/dist/types/src/ui/system/position/top.d.ts +0 -1
- package/dist/types/src/ui/system/position/top.d.ts.map +1 -1
- package/dist/types/src/ui/system/position/z_index.d.ts +0 -1
- package/dist/types/src/ui/system/position/z_index.d.ts.map +1 -1
- package/dist/types/src/ui/system/spacing/margin.d.ts +0 -1
- package/dist/types/src/ui/system/spacing/margin.d.ts.map +1 -1
- package/dist/types/src/ui/system/spacing/padding.d.ts +0 -1
- package/dist/types/src/ui/system/spacing/padding.d.ts.map +1 -1
- package/dist/types/src/ui/system/spacing/spacing_set.d.ts +0 -1
- package/dist/types/src/ui/system/spacing/spacing_set.d.ts.map +1 -1
- package/dist/types/src/ui/system/typography/font_family.d.ts +0 -1
- package/dist/types/src/ui/system/typography/font_family.d.ts.map +1 -1
- package/dist/types/src/ui/system/typography/font_size.d.ts +0 -1
- package/dist/types/src/ui/system/typography/font_size.d.ts.map +1 -1
- package/dist/types/src/ui/system/typography/font_style.d.ts +0 -1
- package/dist/types/src/ui/system/typography/font_style.d.ts.map +1 -1
- package/dist/types/src/ui/system/typography/font_weight.d.ts +0 -1
- package/dist/types/src/ui/system/typography/font_weight.d.ts.map +1 -1
- package/dist/types/src/ui/system/typography/letter_spacing.d.ts +0 -1
- package/dist/types/src/ui/system/typography/letter_spacing.d.ts.map +1 -1
- package/dist/types/src/ui/system/typography/line_height.d.ts +0 -1
- package/dist/types/src/ui/system/typography/line_height.d.ts.map +1 -1
- package/dist/types/src/ui/system/typography/text_align.d.ts +0 -1
- package/dist/types/src/ui/system/typography/text_align.d.ts.map +1 -1
- package/dist/types/src/ui/system/typography/text_color.d.ts +0 -1
- package/dist/types/src/ui/system/typography/text_color.d.ts.map +1 -1
- package/dist/types/src/ui/system/typography/text_decoration.d.ts +0 -1
- package/dist/types/src/ui/system/typography/text_decoration.d.ts.map +1 -1
- package/dist/types/src/ui/system/typography/text_transform.d.ts +0 -1
- package/dist/types/src/ui/system/typography/text_transform.d.ts.map +1 -1
- package/dist/types/src/ui/system/typography/typography_set.d.ts +0 -1
- package/dist/types/src/ui/system/typography/typography_set.d.ts.map +1 -1
- package/dist/types/src/ui/system/utils/create_style_prop_types.d.ts +1 -1
- package/dist/types/src/ui/system/utils/create_style_prop_types.d.ts.map +1 -1
- package/dist/types/src/ui/system/utils/csstype.d.ts +578 -578
- package/dist/types/src/ui/system/utils/csstype.d.ts.map +1 -1
- package/dist/types/src/ui/system/utils/types.d.ts +4 -4
- package/dist/types/src/ui/system/utils/types.d.ts.map +1 -1
- package/dist/types/src/ui/table_picker.d.ts +1 -1
- package/dist/types/src/ui/table_picker.d.ts.map +1 -1
- package/dist/types/src/ui/text.d.ts +4 -4
- package/dist/types/src/ui/text.d.ts.map +1 -1
- package/dist/types/src/ui/text_button.d.ts +2 -2
- package/dist/types/src/ui/text_button.d.ts.map +1 -1
- package/dist/types/src/ui/theme/default_theme/heading_styles.d.ts +2 -2
- package/dist/types/src/ui/theme/default_theme/heading_styles.d.ts.map +1 -1
- package/dist/types/src/ui/theme/default_theme/index.d.ts +1 -1
- package/dist/types/src/ui/theme/theme_context.d.ts +1 -3
- package/dist/types/src/ui/theme/theme_context.d.ts.map +1 -1
- package/dist/types/src/ui/theme/use_theme.d.ts +1 -1
- package/dist/types/src/ui/tooltip.d.ts +3 -3
- package/dist/types/src/ui/types/data_attributes_prop.d.ts.map +1 -1
- package/dist/types/src/ui/types/tooltip_anchor_props.d.ts +0 -1
- package/dist/types/src/ui/types/tooltip_anchor_props.d.ts.map +1 -1
- package/dist/types/src/ui/ui.d.ts +1 -0
- package/dist/types/src/ui/ui.d.ts.map +1 -1
- package/dist/types/src/ui/use_base.d.ts.map +1 -1
- package/dist/types/src/ui/use_color_scheme.d.ts +28 -0
- package/dist/types/src/ui/use_color_scheme.d.ts.map +1 -0
- package/dist/types/src/ui/use_cursor.d.ts.map +1 -1
- package/dist/types/src/ui/use_form_field.d.ts +0 -2
- package/dist/types/src/ui/use_form_field.d.ts.map +1 -1
- package/dist/types/src/ui/use_records.d.ts +2 -2
- package/dist/types/src/ui/use_records.d.ts.map +1 -1
- package/dist/types/src/ui/use_session.d.ts.map +1 -1
- package/dist/types/src/ui/view_picker.d.ts +3 -3
- package/dist/types/src/ui/view_picker.d.ts.map +1 -1
- package/dist/types/src/ui/viewport_constraint.d.ts +3 -3
- package/dist/types/src/ui/viewport_constraint.d.ts.map +1 -1
- package/dist/types/src/viewport.d.ts +2 -2
- package/dist/types/src/viewport.d.ts.map +1 -1
- package/dist/types/src/warning.d.ts +1 -1
- package/dist/types/src/warning.d.ts.map +1 -1
- package/package.json +40 -34
- package/dist/types/stories/all_controls.stories.d.ts +0 -2
- package/dist/types/stories/all_controls.stories.d.ts.map +0 -1
- package/dist/types/stories/box.appearance.stories.d.ts +0 -2
- package/dist/types/stories/box.appearance.stories.d.ts.map +0 -1
- package/dist/types/stories/box.dimensions.stories.d.ts +0 -2
- package/dist/types/stories/box.dimensions.stories.d.ts.map +0 -1
- package/dist/types/stories/box.flex_container.stories.d.ts +0 -2
- package/dist/types/stories/box.flex_container.stories.d.ts.map +0 -1
- package/dist/types/stories/box.flex_item.stories.d.ts +0 -2
- package/dist/types/stories/box.flex_item.stories.d.ts.map +0 -1
- package/dist/types/stories/box.position.stories.d.ts +0 -2
- package/dist/types/stories/box.position.stories.d.ts.map +0 -1
- package/dist/types/stories/box.spacing.stories.d.ts +0 -2
- package/dist/types/stories/box.spacing.stories.d.ts.map +0 -1
- package/dist/types/stories/box.stories.d.ts +0 -2
- package/dist/types/stories/box.stories.d.ts.map +0 -1
- package/dist/types/stories/box.typography.stories.d.ts +0 -2
- package/dist/types/stories/box.typography.stories.d.ts.map +0 -1
- package/dist/types/stories/button.stories.d.ts +0 -2
- package/dist/types/stories/button.stories.d.ts.map +0 -1
- package/dist/types/stories/cell_renderer.stories.d.ts +0 -2
- package/dist/types/stories/cell_renderer.stories.d.ts.map +0 -1
- package/dist/types/stories/choice_token.stories.d.ts +0 -2
- package/dist/types/stories/choice_token.stories.d.ts.map +0 -1
- package/dist/types/stories/collaborator_token.stories.d.ts +0 -2
- package/dist/types/stories/collaborator_token.stories.d.ts.map +0 -1
- package/dist/types/stories/color_palette.stories.d.ts +0 -2
- package/dist/types/stories/color_palette.stories.d.ts.map +0 -1
- package/dist/types/stories/confirmation_dialog.stories.d.ts +0 -2
- package/dist/types/stories/confirmation_dialog.stories.d.ts.map +0 -1
- package/dist/types/stories/dialog.stories.d.ts +0 -2
- package/dist/types/stories/dialog.stories.d.ts.map +0 -1
- package/dist/types/stories/field_icon.stories.d.ts +0 -2
- package/dist/types/stories/field_icon.stories.d.ts.map +0 -1
- package/dist/types/stories/form_field.stories.d.ts +0 -2
- package/dist/types/stories/form_field.stories.d.ts.map +0 -1
- package/dist/types/stories/heading.size.stories.d.ts +0 -2
- package/dist/types/stories/heading.size.stories.d.ts.map +0 -1
- package/dist/types/stories/heading.stories.d.ts +0 -2
- package/dist/types/stories/heading.stories.d.ts.map +0 -1
- package/dist/types/stories/helpers/attachments.d.ts +0 -4
- package/dist/types/stories/helpers/attachments.d.ts.map +0 -1
- package/dist/types/stories/helpers/categorize_style_props.d.ts +0 -14
- package/dist/types/stories/helpers/categorize_style_props.d.ts.map +0 -1
- package/dist/types/stories/helpers/choice_options.d.ts +0 -7
- package/dist/types/stories/helpers/choice_options.d.ts.map +0 -1
- package/dist/types/stories/helpers/code_block.d.ts +0 -5
- package/dist/types/stories/helpers/code_block.d.ts.map +0 -1
- package/dist/types/stories/helpers/code_utils.d.ts +0 -32
- package/dist/types/stories/helpers/code_utils.d.ts.map +0 -1
- package/dist/types/stories/helpers/collaborator_options.d.ts +0 -7
- package/dist/types/stories/helpers/collaborator_options.d.ts.map +0 -1
- package/dist/types/stories/helpers/example.d.ts +0 -39
- package/dist/types/stories/helpers/example.d.ts.map +0 -1
- package/dist/types/stories/helpers/example_code_panel.d.ts +0 -10
- package/dist/types/stories/helpers/example_code_panel.d.ts.map +0 -1
- package/dist/types/stories/helpers/fake_cell_renderer.d.ts +0 -7
- package/dist/types/stories/helpers/fake_cell_renderer.d.ts.map +0 -1
- package/dist/types/stories/helpers/fake_foreign_record.d.ts +0 -5
- package/dist/types/stories/helpers/fake_foreign_record.d.ts.map +0 -1
- package/dist/types/stories/helpers/fake_record_card.d.ts +0 -13
- package/dist/types/stories/helpers/fake_record_card.d.ts.map +0 -1
- package/dist/types/stories/helpers/field_type.d.ts +0 -6
- package/dist/types/stories/helpers/field_type.d.ts.map +0 -1
- package/dist/types/stories/helpers/raf_throttle.d.ts +0 -5
- package/dist/types/stories/helpers/raf_throttle.d.ts.map +0 -1
- package/dist/types/stories/helpers/style_prop_list.d.ts +0 -9
- package/dist/types/stories/helpers/style_prop_list.d.ts.map +0 -1
- package/dist/types/stories/helpers/sync_source_options.d.ts +0 -7
- package/dist/types/stories/helpers/sync_source_options.d.ts.map +0 -1
- package/dist/types/stories/helpers/use_resizable_panel.d.ts +0 -27
- package/dist/types/stories/helpers/use_resizable_panel.d.ts.map +0 -1
- package/dist/types/stories/icon.stories.d.ts +0 -2
- package/dist/types/stories/icon.stories.d.ts.map +0 -1
- package/dist/types/stories/icon_example.d.ts +0 -3
- package/dist/types/stories/icon_example.d.ts.map +0 -1
- package/dist/types/stories/input.stories.d.ts +0 -2
- package/dist/types/stories/input.stories.d.ts.map +0 -1
- package/dist/types/stories/label.stories.d.ts +0 -2
- package/dist/types/stories/label.stories.d.ts.map +0 -1
- package/dist/types/stories/link.stories.d.ts +0 -2
- package/dist/types/stories/link.stories.d.ts.map +0 -1
- package/dist/types/stories/loader.stories.d.ts +0 -2
- package/dist/types/stories/loader.stories.d.ts.map +0 -1
- package/dist/types/stories/model_pickers.stories.d.ts +0 -2
- package/dist/types/stories/model_pickers.stories.d.ts.map +0 -1
- package/dist/types/stories/progress_bar.stories.d.ts +0 -2
- package/dist/types/stories/progress_bar.stories.d.ts.map +0 -1
- package/dist/types/stories/record_card.stories.d.ts +0 -2
- package/dist/types/stories/record_card.stories.d.ts.map +0 -1
- package/dist/types/stories/record_card_list.stories.d.ts +0 -2
- package/dist/types/stories/record_card_list.stories.d.ts.map +0 -1
- package/dist/types/stories/select.stories.d.ts +0 -2
- package/dist/types/stories/select.stories.d.ts.map +0 -1
- package/dist/types/stories/select_buttons.stories.d.ts +0 -2
- package/dist/types/stories/select_buttons.stories.d.ts.map +0 -1
- package/dist/types/stories/switch.stories.d.ts +0 -2
- package/dist/types/stories/switch.stories.d.ts.map +0 -1
- package/dist/types/stories/text.size.stories.d.ts +0 -2
- package/dist/types/stories/text.size.stories.d.ts.map +0 -1
- package/dist/types/stories/text.stories.d.ts +0 -2
- package/dist/types/stories/text.stories.d.ts.map +0 -1
- package/dist/types/stories/text_button.stories.d.ts +0 -2
- package/dist/types/stories/text_button.stories.d.ts.map +0 -1
- package/dist/types/stories/tooltip.stories.d.ts +0 -2
- package/dist/types/stories/tooltip.stories.d.ts.map +0 -1
- package/dist/types/test/airtable_interface_mocks/fixture_data.d.ts +0 -124
- package/dist/types/test/airtable_interface_mocks/fixture_data.d.ts.map +0 -1
- package/dist/types/test/airtable_interface_mocks/linked_records.d.ts +0 -4
- package/dist/types/test/airtable_interface_mocks/linked_records.d.ts.map +0 -1
- package/dist/types/test/airtable_interface_mocks/mock_airtable_interface.d.ts +0 -61
- package/dist/types/test/airtable_interface_mocks/mock_airtable_interface.d.ts.map +0 -1
- package/dist/types/test/airtable_interface_mocks/project_tracker.d.ts +0 -4
- package/dist/types/test/airtable_interface_mocks/project_tracker.d.ts.map +0 -1
- package/dist/types/test/error_utils.test.d.ts +0 -2
- package/dist/types/test/error_utils.test.d.ts.map +0 -1
- package/dist/types/test/get_style_props_for_responsive_prop.test.d.ts +0 -2
- package/dist/types/test/get_style_props_for_responsive_prop.test.d.ts.map +0 -1
- package/dist/types/test/index.test.d.ts +0 -2
- package/dist/types/test/index.test.d.ts.map +0 -1
- package/dist/types/test/models/base.test.d.ts +0 -2
- package/dist/types/test/models/base.test.d.ts.map +0 -1
- package/dist/types/test/models/cursor.test.d.ts +0 -2
- package/dist/types/test/models/cursor.test.d.ts.map +0 -1
- package/dist/types/test/models/field.test.d.ts +0 -2
- package/dist/types/test/models/field.test.d.ts.map +0 -1
- package/dist/types/test/models/linked_records_query_result.test.d.ts +0 -2
- package/dist/types/test/models/linked_records_query_result.test.d.ts.map +0 -1
- package/dist/types/test/models/mutations.test.d.ts +0 -2
- package/dist/types/test/models/mutations.test.d.ts.map +0 -1
- package/dist/types/test/models/object_pool.test.d.ts +0 -2
- package/dist/types/test/models/object_pool.test.d.ts.map +0 -1
- package/dist/types/test/models/record.test.d.ts +0 -2
- package/dist/types/test/models/record.test.d.ts.map +0 -1
- package/dist/types/test/models/session.test.d.ts +0 -2
- package/dist/types/test/models/session.test.d.ts.map +0 -1
- package/dist/types/test/models/table.test.d.ts +0 -2
- package/dist/types/test/models/table.test.d.ts.map +0 -1
- package/dist/types/test/models/table_mutations.test.d.ts +0 -2
- package/dist/types/test/models/table_mutations.test.d.ts.map +0 -1
- package/dist/types/test/models/table_or_view_query_result.test.d.ts +0 -2
- package/dist/types/test/models/table_or_view_query_result.test.d.ts.map +0 -1
- package/dist/types/test/models/view.test.d.ts +0 -2
- package/dist/types/test/models/view.test.d.ts.map +0 -1
- package/dist/types/test/models/view_metadata_query_result.test.d.ts +0 -2
- package/dist/types/test/models/view_metadata_query_result.test.d.ts.map +0 -1
- package/dist/types/test/private_utils.test.d.ts +0 -2
- package/dist/types/test/private_utils.test.d.ts.map +0 -1
- package/dist/types/test/sdk.test.d.ts +0 -2
- package/dist/types/test/sdk.test.d.ts.map +0 -1
- package/dist/types/test/setup_enzyme.d.ts +0 -2
- package/dist/types/test/setup_enzyme.d.ts.map +0 -1
- package/dist/types/test/test_helpers.d.ts +0 -11
- package/dist/types/test/test_helpers.d.ts.map +0 -1
- package/dist/types/test/ui/base_provider.test.d.ts +0 -2
- package/dist/types/test/ui/base_provider.test.d.ts.map +0 -1
- package/dist/types/test/ui/block_wrapper.test.d.ts +0 -2
- package/dist/types/test/ui/block_wrapper.test.d.ts.map +0 -1
- package/dist/types/test/ui/box.test.d.ts +0 -2
- package/dist/types/test/ui/box.test.d.ts.map +0 -1
- package/dist/types/test/ui/button.test.d.ts +0 -2
- package/dist/types/test/ui/button.test.d.ts.map +0 -1
- package/dist/types/test/ui/cell_renderer.test.d.ts +0 -2
- package/dist/types/test/ui/cell_renderer.test.d.ts.map +0 -1
- package/dist/types/test/ui/choice_token.test.d.ts +0 -2
- package/dist/types/test/ui/choice_token.test.d.ts.map +0 -1
- package/dist/types/test/ui/collaborator_token.test.d.ts +0 -2
- package/dist/types/test/ui/collaborator_token.test.d.ts.map +0 -1
- package/dist/types/test/ui/color_palette.test.d.ts +0 -2
- package/dist/types/test/ui/color_palette.test.d.ts.map +0 -1
- package/dist/types/test/ui/color_palette_synced.test.d.ts +0 -2
- package/dist/types/test/ui/color_palette_synced.test.d.ts.map +0 -1
- package/dist/types/test/ui/confirmation_dialog.test.d.ts +0 -2
- package/dist/types/test/ui/confirmation_dialog.test.d.ts.map +0 -1
- package/dist/types/test/ui/dialog.test.d.ts +0 -2
- package/dist/types/test/ui/dialog.test.d.ts.map +0 -1
- package/dist/types/test/ui/expand_record.test.d.ts +0 -2
- package/dist/types/test/ui/expand_record.test.d.ts.map +0 -1
- package/dist/types/test/ui/expand_record_list.test.d.ts +0 -2
- package/dist/types/test/ui/expand_record_list.test.d.ts.map +0 -1
- package/dist/types/test/ui/expand_record_picker_async.test.d.ts +0 -2
- package/dist/types/test/ui/expand_record_picker_async.test.d.ts.map +0 -1
- package/dist/types/test/ui/field_icon.test.d.ts +0 -2
- package/dist/types/test/ui/field_icon.test.d.ts.map +0 -1
- package/dist/types/test/ui/field_picker.test.d.ts +0 -2
- package/dist/types/test/ui/field_picker.test.d.ts.map +0 -1
- package/dist/types/test/ui/field_picker_synced.test.d.ts +0 -2
- package/dist/types/test/ui/field_picker_synced.test.d.ts.map +0 -1
- package/dist/types/test/ui/form_field.test.d.ts +0 -2
- package/dist/types/test/ui/form_field.test.d.ts.map +0 -1
- package/dist/types/test/ui/global_alert.test.d.ts +0 -2
- package/dist/types/test/ui/global_alert.test.d.ts.map +0 -1
- package/dist/types/test/ui/heading.test.d.ts +0 -2
- package/dist/types/test/ui/heading.test.d.ts.map +0 -1
- package/dist/types/test/ui/icon.test.d.ts +0 -2
- package/dist/types/test/ui/icon.test.d.ts.map +0 -1
- package/dist/types/test/ui/initialize_block.test.d.ts +0 -2
- package/dist/types/test/ui/initialize_block.test.d.ts.map +0 -1
- package/dist/types/test/ui/input.test.d.ts +0 -2
- package/dist/types/test/ui/input.test.d.ts.map +0 -1
- package/dist/types/test/ui/input_synced.test.d.ts +0 -2
- package/dist/types/test/ui/input_synced.test.d.ts.map +0 -1
- package/dist/types/test/ui/label.test.d.ts +0 -2
- package/dist/types/test/ui/label.test.d.ts.map +0 -1
- package/dist/types/test/ui/link.test.d.ts +0 -2
- package/dist/types/test/ui/link.test.d.ts.map +0 -1
- package/dist/types/test/ui/loader.test.d.ts +0 -2
- package/dist/types/test/ui/loader.test.d.ts.map +0 -1
- package/dist/types/test/ui/modal.test.d.ts +0 -2
- package/dist/types/test/ui/modal.test.d.ts.map +0 -1
- package/dist/types/test/ui/popover.test.d.ts +0 -2
- package/dist/types/test/ui/popover.test.d.ts.map +0 -1
- package/dist/types/test/ui/progress_bar.test.d.ts +0 -2
- package/dist/types/test/ui/progress_bar.test.d.ts.map +0 -1
- package/dist/types/test/ui/record_card.test.d.ts +0 -2
- package/dist/types/test/ui/record_card.test.d.ts.map +0 -1
- package/dist/types/test/ui/record_card_list.test.d.ts +0 -2
- package/dist/types/test/ui/record_card_list.test.d.ts.map +0 -1
- package/dist/types/test/ui/remote_utils.test.d.ts +0 -2
- package/dist/types/test/ui/remote_utils.test.d.ts.map +0 -1
- package/dist/types/test/ui/select.test.d.ts +0 -2
- package/dist/types/test/ui/select.test.d.ts.map +0 -1
- package/dist/types/test/ui/select_buttons.test.d.ts +0 -2
- package/dist/types/test/ui/select_buttons.test.d.ts.map +0 -1
- package/dist/types/test/ui/select_buttons_synced.test.d.ts +0 -2
- package/dist/types/test/ui/select_buttons_synced.test.d.ts.map +0 -1
- package/dist/types/test/ui/select_synced.test.d.ts +0 -2
- package/dist/types/test/ui/select_synced.test.d.ts.map +0 -1
- package/dist/types/test/ui/switch.test.d.ts +0 -2
- package/dist/types/test/ui/switch.test.d.ts.map +0 -1
- package/dist/types/test/ui/switch_synced.test.d.ts +0 -2
- package/dist/types/test/ui/switch_synced.test.d.ts.map +0 -1
- package/dist/types/test/ui/synced.test.d.ts +0 -2
- package/dist/types/test/ui/synced.test.d.ts.map +0 -1
- package/dist/types/test/ui/table_picker.test.d.ts +0 -2
- package/dist/types/test/ui/table_picker.test.d.ts.map +0 -1
- package/dist/types/test/ui/table_picker_synced.test.d.ts +0 -2
- package/dist/types/test/ui/table_picker_synced.test.d.ts.map +0 -1
- package/dist/types/test/ui/text.test.d.ts +0 -2
- package/dist/types/test/ui/text.test.d.ts.map +0 -1
- package/dist/types/test/ui/text_button.test.d.ts +0 -2
- package/dist/types/test/ui/text_button.test.d.ts.map +0 -1
- package/dist/types/test/ui/tooltip.test.d.ts +0 -2
- package/dist/types/test/ui/tooltip.test.d.ts.map +0 -1
- package/dist/types/test/ui/ui.test.d.ts +0 -2
- package/dist/types/test/ui/ui.test.d.ts.map +0 -1
- package/dist/types/test/ui/unstable_standalone_ui.test.d.ts +0 -1
- package/dist/types/test/ui/unstable_standalone_ui.test.d.ts.map +0 -1
- package/dist/types/test/ui/use_array_identity.test.d.ts +0 -2
- package/dist/types/test/ui/use_array_identity.test.d.ts.map +0 -1
- package/dist/types/test/ui/use_loadable.test.d.ts +0 -2
- package/dist/types/test/ui/use_loadable.test.d.ts.map +0 -1
- package/dist/types/test/ui/use_record_action_data.test.d.ts +0 -2
- package/dist/types/test/ui/use_record_action_data.test.d.ts.map +0 -1
- package/dist/types/test/ui/use_records.test.d.ts +0 -2
- package/dist/types/test/ui/use_records.test.d.ts.map +0 -1
- package/dist/types/test/ui/use_view_metadata.test.d.ts +0 -2
- package/dist/types/test/ui/use_view_metadata.test.d.ts.map +0 -1
- package/dist/types/test/ui/use_watchable.test.d.ts +0 -2
- package/dist/types/test/ui/use_watchable.test.d.ts.map +0 -1
- package/dist/types/test/ui/view_picker.test.d.ts +0 -2
- package/dist/types/test/ui/view_picker.test.d.ts.map +0 -1
- package/dist/types/test/ui/view_picker_synced.test.d.ts +0 -2
- package/dist/types/test/ui/view_picker_synced.test.d.ts.map +0 -1
- package/dist/types/test/ui/viewport_constraint.test.d.ts +0 -2
- package/dist/types/test/ui/viewport_constraint.test.d.ts.map +0 -1
- package/dist/types/test/unstable_private_utils.test.d.ts +0 -1
- package/dist/types/test/unstable_private_utils.test.d.ts.map +0 -1
|
@@ -1,104 +1,68 @@
|
|
|
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.from.js");
|
|
6
|
+
require("core-js/modules/es.array.iterator.js");
|
|
7
|
+
require("core-js/modules/es.array.slice.js");
|
|
8
|
+
require("core-js/modules/es.object.get-own-property-descriptors.js");
|
|
9
|
+
require("core-js/modules/es.regexp.exec.js");
|
|
10
|
+
require("core-js/modules/es.regexp.to-string.js");
|
|
11
|
+
require("core-js/modules/es.weak-map.js");
|
|
12
|
+
require("core-js/modules/web.dom-collections.for-each.js");
|
|
13
|
+
require("core-js/modules/web.dom-collections.iterator.js");
|
|
5
14
|
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.find");
|
|
14
|
-
|
|
15
|
-
require("core-js/modules/es.array.iterator");
|
|
16
|
-
|
|
17
|
-
require("core-js/modules/es.array.map");
|
|
18
|
-
|
|
19
|
-
require("core-js/modules/es.object.get-own-property-descriptors");
|
|
20
|
-
|
|
21
|
-
require("core-js/modules/es.object.to-string");
|
|
22
|
-
|
|
23
|
-
require("core-js/modules/web.dom-collections.for-each");
|
|
24
|
-
|
|
25
|
-
require("core-js/modules/web.dom-collections.iterator");
|
|
26
|
-
|
|
27
15
|
Object.defineProperty(exports, "__esModule", {
|
|
28
16
|
value: true
|
|
29
17
|
});
|
|
30
|
-
exports.
|
|
31
|
-
|
|
18
|
+
exports.recordCardStylePropTypes = exports.default = exports.RecordCard = void 0;
|
|
19
|
+
require("core-js/modules/es.array.filter.js");
|
|
20
|
+
require("core-js/modules/es.array.find.js");
|
|
21
|
+
require("core-js/modules/es.array.map.js");
|
|
22
|
+
require("core-js/modules/es.object.to-string.js");
|
|
32
23
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
33
|
-
|
|
34
24
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
35
|
-
|
|
36
25
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
37
|
-
|
|
38
26
|
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
39
|
-
|
|
40
27
|
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
41
|
-
|
|
42
|
-
var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
|
|
43
|
-
|
|
44
28
|
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
45
|
-
|
|
46
29
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
47
|
-
|
|
48
30
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
49
|
-
|
|
50
31
|
var _emotion = require("emotion");
|
|
51
|
-
|
|
52
32
|
var React = _interopRequireWildcard(require("react"));
|
|
53
|
-
|
|
54
33
|
var _core = require("@styled-system/core");
|
|
55
|
-
|
|
56
34
|
var _private_utils = require("../private_utils");
|
|
57
|
-
|
|
58
35
|
var _error_utils = require("../error_utils");
|
|
59
|
-
|
|
60
|
-
var
|
|
61
|
-
|
|
62
|
-
var _field4 = _interopRequireDefault(require("../models/field"));
|
|
63
|
-
|
|
36
|
+
var _field = require("../types/field");
|
|
37
|
+
var _field2 = _interopRequireDefault(require("../models/field"));
|
|
64
38
|
var _record = _interopRequireDefault(require("../models/record"));
|
|
65
|
-
|
|
66
39
|
var _view = _interopRequireDefault(require("../models/view"));
|
|
67
|
-
|
|
68
40
|
var _color_utils = _interopRequireDefault(require("../color_utils"));
|
|
69
|
-
|
|
70
41
|
var _baymax_utils = require("./baymax_utils");
|
|
71
|
-
|
|
72
42
|
var _expand_record = _interopRequireDefault(require("./expand_record"));
|
|
73
|
-
|
|
74
43
|
var _box = _interopRequireDefault(require("./box"));
|
|
75
|
-
|
|
76
44
|
var _cell_renderer = _interopRequireDefault(require("./cell_renderer"));
|
|
77
|
-
|
|
78
45
|
var _use_watchable = _interopRequireDefault(require("./use_watchable"));
|
|
79
|
-
|
|
80
46
|
var _with_hooks = _interopRequireDefault(require("./with_hooks"));
|
|
81
|
-
|
|
82
47
|
var _use_view_metadata = _interopRequireDefault(require("./use_view_metadata"));
|
|
83
|
-
|
|
84
48
|
var _key_codes = require("./key_codes");
|
|
85
|
-
|
|
86
49
|
var _use_styled_system = _interopRequireDefault(require("./use_styled_system"));
|
|
87
|
-
|
|
88
50
|
var _system = require("./system");
|
|
89
|
-
|
|
90
51
|
var _with_styled_system = require("./with_styled_system");
|
|
91
|
-
|
|
92
52
|
var _tooltip_anchor_props = require("./types/tooltip_anchor_props");
|
|
93
|
-
|
|
94
53
|
var _sdk_context = require("./sdk_context");
|
|
95
|
-
|
|
96
|
-
function
|
|
97
|
-
|
|
98
|
-
function
|
|
99
|
-
|
|
54
|
+
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); }
|
|
55
|
+
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; }
|
|
56
|
+
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; } } }; }
|
|
57
|
+
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; } }
|
|
58
|
+
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; }
|
|
59
|
+
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)); }
|
|
60
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
61
|
+
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; }
|
|
62
|
+
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: RecordCard */ /** */
|
|
100
63
|
// Mirrored from client_server_shared_config_settings
|
|
101
64
|
var FALLBACK_RECORD_NAME_FOR_DISPLAY = 'Unnamed record';
|
|
65
|
+
|
|
102
66
|
/**
|
|
103
67
|
* Style props for the {@link RecordCard} component. Accepts:
|
|
104
68
|
* * {@link FlexItemSetProps}
|
|
@@ -109,21 +73,19 @@ var FALLBACK_RECORD_NAME_FOR_DISPLAY = 'Unnamed record';
|
|
|
109
73
|
*/
|
|
110
74
|
|
|
111
75
|
var styleParser = (0, _core.compose)(_system.flexItemSet, _system.positionSet, _system.margin);
|
|
112
|
-
|
|
113
|
-
var recordCardStylePropTypes = _objectSpread({}, _system.flexItemSetPropTypes, {}, _system.positionSetPropTypes, {}, _system.marginPropTypes);
|
|
114
|
-
|
|
115
|
-
exports.recordCardStylePropTypes = recordCardStylePropTypes;
|
|
76
|
+
var recordCardStylePropTypes = exports.recordCardStylePropTypes = _objectSpread(_objectSpread(_objectSpread({}, _system.flexItemSetPropTypes), _system.positionSetPropTypes), _system.marginPropTypes);
|
|
116
77
|
var CARD_PADDING = 12;
|
|
78
|
+
|
|
117
79
|
/** @hidden */
|
|
118
80
|
|
|
119
|
-
var CellValueAndFieldLabel =
|
|
81
|
+
var CellValueAndFieldLabel = _ref => {
|
|
120
82
|
var record = _ref.record,
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
83
|
+
cellValue = _ref.cellValue,
|
|
84
|
+
field = _ref.field,
|
|
85
|
+
width = _ref.width,
|
|
86
|
+
renderInvalidCellValue = _ref.renderInvalidCellValue;
|
|
125
87
|
(0, _use_watchable.default)(field, ['name', 'type', 'options']);
|
|
126
|
-
return React.createElement(_box.default, {
|
|
88
|
+
return /*#__PURE__*/React.createElement(_box.default, {
|
|
127
89
|
style: {
|
|
128
90
|
verticalAlign: 'top'
|
|
129
91
|
},
|
|
@@ -132,12 +94,12 @@ var CellValueAndFieldLabel = (_ref) => {
|
|
|
132
94
|
margin: 0,
|
|
133
95
|
paddingRight: 2,
|
|
134
96
|
width: width
|
|
135
|
-
}, React.createElement(_box.default, {
|
|
97
|
+
}, /*#__PURE__*/React.createElement(_box.default, {
|
|
136
98
|
className: (0, _baymax_utils.baymax)('caps truncate'),
|
|
137
99
|
fontSize: "11px",
|
|
138
100
|
lineHeight: "13px",
|
|
139
101
|
textColor: "#898989"
|
|
140
|
-
}, field.name), React.createElement(_cell_renderer.default, {
|
|
102
|
+
}, field.name), /*#__PURE__*/React.createElement(_cell_renderer.default, {
|
|
141
103
|
record: record,
|
|
142
104
|
cellValue: cellValue,
|
|
143
105
|
field: field,
|
|
@@ -150,7 +112,6 @@ var CellValueAndFieldLabel = (_ref) => {
|
|
|
150
112
|
renderInvalidCellValue: renderInvalidCellValue
|
|
151
113
|
}));
|
|
152
114
|
};
|
|
153
|
-
|
|
154
115
|
CellValueAndFieldLabel.propTypes = {
|
|
155
116
|
record: _propTypes.default.instanceOf(_record.default),
|
|
156
117
|
// NOTE: this currently will not work for linked record fields, since CellRenderer
|
|
@@ -158,10 +119,11 @@ CellValueAndFieldLabel.propTypes = {
|
|
|
158
119
|
// TODO(jb): make the constraints for rendering cell values less strict than the
|
|
159
120
|
// constraints we put on updating cell values.
|
|
160
121
|
cellValue: _propTypes.default.any,
|
|
161
|
-
field: _propTypes.default.instanceOf(
|
|
122
|
+
field: _propTypes.default.instanceOf(_field2.default).isRequired,
|
|
162
123
|
width: _propTypes.default.number.isRequired,
|
|
163
124
|
renderInvalidCellValue: _propTypes.default.func
|
|
164
125
|
};
|
|
126
|
+
|
|
165
127
|
/**
|
|
166
128
|
* Props for the {@link RecordCard} component. Also accepts:
|
|
167
129
|
* * {@link RecordCardStyleProps}
|
|
@@ -172,52 +134,46 @@ CellValueAndFieldLabel.propTypes = {
|
|
|
172
134
|
|
|
173
135
|
// TODO(jb): move this stuff into the field model when we decide on an api for it.
|
|
174
136
|
var FormulaicFieldTypes = {
|
|
175
|
-
[
|
|
176
|
-
[
|
|
177
|
-
[
|
|
137
|
+
[_field.FieldType.FORMULA]: true,
|
|
138
|
+
[_field.FieldType.ROLLUP]: true,
|
|
139
|
+
[_field.FieldType.MULTIPLE_LOOKUP_VALUES]: true
|
|
178
140
|
};
|
|
179
|
-
|
|
180
141
|
var isFieldFormulaic = field => {
|
|
181
142
|
return (0, _private_utils.has)(FormulaicFieldTypes, field.type);
|
|
182
143
|
};
|
|
183
|
-
|
|
184
144
|
var getFieldResultType = field => {
|
|
185
|
-
if (field.type ===
|
|
186
|
-
return
|
|
145
|
+
if (field.type === _field.FieldType.COUNT) {
|
|
146
|
+
return _field.FieldType.NUMBER;
|
|
187
147
|
}
|
|
188
|
-
|
|
189
148
|
if (isFieldFormulaic(field)) {
|
|
190
149
|
(0, _error_utils.invariant)(field.options, 'options');
|
|
191
150
|
var result = field.options.result;
|
|
192
|
-
|
|
193
151
|
if (typeof result === 'object' && result) {
|
|
194
152
|
var resultType = result.type;
|
|
195
153
|
(0, _error_utils.invariant)(typeof resultType === 'string', 'resultType must be string');
|
|
196
154
|
return resultType;
|
|
197
155
|
} else {
|
|
198
156
|
// Formula is misconfigured.
|
|
199
|
-
return
|
|
157
|
+
return _field.FieldType.SINGLE_LINE_TEXT;
|
|
200
158
|
}
|
|
201
159
|
} else {
|
|
202
160
|
return field.type;
|
|
203
161
|
}
|
|
204
162
|
};
|
|
163
|
+
|
|
205
164
|
/**
|
|
206
165
|
* @internal
|
|
207
166
|
* Given a container size (ie, height of the record card), calculate the height and width of an
|
|
208
167
|
* attachment thumbnail image to fit inside the square attachment preview. Left and top margin
|
|
209
168
|
* are used to center non-square images.
|
|
210
169
|
*/
|
|
211
|
-
|
|
212
|
-
|
|
213
170
|
var calculateAttachmentDimensionsAndMargin = (attachment, containerSize) => {
|
|
214
171
|
if (!attachment || !attachment.thumbnails || !attachment.thumbnails.large) {
|
|
215
172
|
return {};
|
|
216
173
|
}
|
|
217
|
-
|
|
218
174
|
var _attachment$thumbnail = attachment.thumbnails.large,
|
|
219
|
-
|
|
220
|
-
|
|
175
|
+
thumbWidth = _attachment$thumbnail.width,
|
|
176
|
+
thumbHeight = _attachment$thumbnail.height;
|
|
221
177
|
var height = Math.min(containerSize, thumbHeight);
|
|
222
178
|
var width = Math.round(thumbWidth * height / thumbHeight);
|
|
223
179
|
var marginTop = Math.round((containerSize - height) / 2);
|
|
@@ -229,6 +185,7 @@ var calculateAttachmentDimensionsAndMargin = (attachment, containerSize) => {
|
|
|
229
185
|
marginLeft
|
|
230
186
|
};
|
|
231
187
|
};
|
|
188
|
+
|
|
232
189
|
/**
|
|
233
190
|
* A card component that displays an Airtable record.
|
|
234
191
|
*
|
|
@@ -237,90 +194,58 @@ var calculateAttachmentDimensionsAndMargin = (attachment, containerSize) => {
|
|
|
237
194
|
* @docsPath UI/components/RecordCard
|
|
238
195
|
* @component
|
|
239
196
|
*/
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
var RecordCard =
|
|
243
|
-
/*#__PURE__*/
|
|
244
|
-
function (_React$Component) {
|
|
245
|
-
(0, _inherits2.default)(RecordCard, _React$Component);
|
|
246
|
-
|
|
247
|
-
/** @hidden */
|
|
248
|
-
|
|
249
|
-
/** @hidden */
|
|
250
|
-
|
|
197
|
+
var RecordCard = exports.RecordCard = /*#__PURE__*/function (_React$Component) {
|
|
251
198
|
/** @hidden */
|
|
252
199
|
function RecordCard(props) {
|
|
253
200
|
var _this;
|
|
254
|
-
|
|
255
201
|
(0, _classCallCheck2.default)(this, RecordCard);
|
|
256
|
-
_this = (
|
|
257
|
-
_this._onClick = _this._onClick.bind(
|
|
258
|
-
|
|
202
|
+
_this = _callSuper(this, RecordCard, [props]);
|
|
203
|
+
_this._onClick = _this._onClick.bind(_this);
|
|
259
204
|
_this._validateProps(props);
|
|
260
|
-
|
|
261
205
|
return _this;
|
|
262
206
|
}
|
|
263
207
|
/** @hidden */
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
(0, _createClass2.default)(RecordCard, [{
|
|
208
|
+
(0, _inherits2.default)(RecordCard, _React$Component);
|
|
209
|
+
return (0, _createClass2.default)(RecordCard, [{
|
|
267
210
|
key: "UNSAFE_componentWillReceiveProps",
|
|
268
211
|
value: function UNSAFE_componentWillReceiveProps(nextProps) {
|
|
269
212
|
this._validateProps(nextProps);
|
|
270
213
|
}
|
|
271
214
|
/** @internal */
|
|
272
|
-
|
|
273
215
|
}, {
|
|
274
216
|
key: "_validateProps",
|
|
275
217
|
value: function _validateProps(props) {
|
|
276
218
|
var record = props.record,
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
219
|
+
view = props.view,
|
|
220
|
+
fields = props.fields,
|
|
221
|
+
attachmentCoverField = props.attachmentCoverField;
|
|
281
222
|
if (record && record instanceof _record.default && record.isDeleted) {
|
|
282
223
|
throw (0, _error_utils.spawnError)('Record %s is deleted', record.id);
|
|
283
224
|
}
|
|
284
|
-
|
|
285
225
|
if (!record) {
|
|
286
226
|
throw (0, _error_utils.spawnError)('Must provide record');
|
|
287
227
|
}
|
|
288
|
-
|
|
289
228
|
if (record && record instanceof _record.default && attachmentCoverField) {
|
|
290
229
|
if (attachmentCoverField.parentTable.id !== record.parentTable.id) {
|
|
291
230
|
throw (0, _error_utils.spawnError)('Attachment cover field %s must have the same parent table as record (record ID %s, table ID %s)', attachmentCoverField.id, record.id, record.parentTable.id);
|
|
292
231
|
}
|
|
293
232
|
}
|
|
294
|
-
|
|
295
233
|
if (record && record instanceof _record.default && fields) {
|
|
296
|
-
var
|
|
297
|
-
|
|
298
|
-
var _iteratorError = undefined;
|
|
299
|
-
|
|
234
|
+
var _iterator = _createForOfIteratorHelper(fields),
|
|
235
|
+
_step;
|
|
300
236
|
try {
|
|
301
|
-
for (
|
|
302
|
-
var
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
throw (0, _error_utils.spawnError)('Field %s must have the same parent table as record (record ID %s, table ID %s)', _field.id, record.id, record.parentTable.id);
|
|
237
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
238
|
+
var field = _step.value;
|
|
239
|
+
if (!field.isDeleted && field.parentTable.id !== record.parentTable.id) {
|
|
240
|
+
throw (0, _error_utils.spawnError)('Field %s must have the same parent table as record (record ID %s, table ID %s)', field.id, record.id, record.parentTable.id);
|
|
306
241
|
}
|
|
307
242
|
}
|
|
308
243
|
} catch (err) {
|
|
309
|
-
|
|
310
|
-
_iteratorError = err;
|
|
244
|
+
_iterator.e(err);
|
|
311
245
|
} finally {
|
|
312
|
-
|
|
313
|
-
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
314
|
-
_iterator.return();
|
|
315
|
-
}
|
|
316
|
-
} finally {
|
|
317
|
-
if (_didIteratorError) {
|
|
318
|
-
throw _iteratorError;
|
|
319
|
-
}
|
|
320
|
-
}
|
|
246
|
+
_iterator.f();
|
|
321
247
|
}
|
|
322
248
|
}
|
|
323
|
-
|
|
324
249
|
if (record && record instanceof _record.default && view && !view.isDeleted) {
|
|
325
250
|
if (view.parentTable.id !== record.parentTable.id) {
|
|
326
251
|
throw (0, _error_utils.spawnError)('View %s must have the same parent table as record (record ID %s, table ID %s)', view.id, record.id, record.parentTable.id);
|
|
@@ -328,50 +253,45 @@ function (_React$Component) {
|
|
|
328
253
|
}
|
|
329
254
|
}
|
|
330
255
|
/** @internal */
|
|
331
|
-
|
|
332
256
|
}, {
|
|
333
257
|
key: "_onClick",
|
|
334
258
|
value: function _onClick(e) {
|
|
335
259
|
if (this.props.onClick) {
|
|
336
260
|
this.props.onClick(e);
|
|
337
|
-
}
|
|
261
|
+
}
|
|
262
|
+
// Explicitly check if `hasOnClick` is false, which is only set by the Tooltip wrapper.
|
|
338
263
|
// When wrapped in Tooltip, `onClick` will always exist because Tooltip supplies it. We use
|
|
339
264
|
// `hasOnClick`, to account for whether the user defined their own `onClick`. We only want
|
|
340
265
|
// to run this default expandRecord behavior if the user did not supply their own `onClick`.
|
|
341
|
-
|
|
342
|
-
|
|
343
266
|
if (this.props.onClick === undefined || this.props.hasOnClick === false // TODO (stephen): remove tooltip anchor props
|
|
344
267
|
) {
|
|
345
|
-
|
|
346
|
-
var record = this.props.record;
|
|
347
|
-
var recordModel = record && record instanceof _record.default ? record : null;
|
|
268
|
+
// NOTE: `null` disables the default click behavior.
|
|
348
269
|
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
270
|
+
var record = this.props.record;
|
|
271
|
+
var recordModel = record && record instanceof _record.default ? record : null;
|
|
272
|
+
if (recordModel) {
|
|
273
|
+
if ((0, _key_codes.isCommandModifierKeyEvent)(e) || e.shiftKey) {
|
|
274
|
+
// No-op, let the <a> tag handle opening in new tab or window.
|
|
275
|
+
} else {
|
|
276
|
+
e.preventDefault();
|
|
277
|
+
var opts = this.props.expandRecordOptions || {};
|
|
278
|
+
(0, _expand_record.default)(recordModel, opts);
|
|
356
279
|
}
|
|
357
280
|
}
|
|
281
|
+
}
|
|
358
282
|
}
|
|
359
283
|
/** @internal */
|
|
360
|
-
|
|
361
284
|
}, {
|
|
362
285
|
key: "_getAttachmentCover",
|
|
363
286
|
value: function _getAttachmentCover(fieldsToUse) {
|
|
364
287
|
var attachmentField = this._getAttachmentField(fieldsToUse);
|
|
365
|
-
|
|
366
288
|
return attachmentField ? this._getFirstAttachmentInField(attachmentField) : null;
|
|
367
289
|
}
|
|
368
290
|
/** @internal */
|
|
369
|
-
|
|
370
291
|
}, {
|
|
371
292
|
key: "_getAttachmentField",
|
|
372
293
|
value: function _getAttachmentField(fieldsToUse) {
|
|
373
294
|
var attachmentCoverField = this.props.attachmentCoverField;
|
|
374
|
-
|
|
375
295
|
if (attachmentCoverField && !attachmentCoverField.isDeleted && this._isAttachment(attachmentCoverField)) {
|
|
376
296
|
return attachmentCoverField;
|
|
377
297
|
} else if (attachmentCoverField === undefined) {
|
|
@@ -383,79 +303,67 @@ function (_React$Component) {
|
|
|
383
303
|
var firstAttachmentFieldInView = fieldsToUse.find(field => {
|
|
384
304
|
return this._isAttachment(field);
|
|
385
305
|
});
|
|
386
|
-
|
|
387
306
|
if (firstAttachmentFieldInView === undefined) {
|
|
388
307
|
return null;
|
|
389
308
|
}
|
|
390
|
-
|
|
391
309
|
return firstAttachmentFieldInView;
|
|
392
310
|
} else {
|
|
393
311
|
return null;
|
|
394
312
|
}
|
|
395
313
|
}
|
|
396
314
|
/** @internal */
|
|
397
|
-
|
|
398
315
|
}, {
|
|
399
316
|
key: "_isAttachment",
|
|
400
317
|
value: function _isAttachment(field) {
|
|
401
|
-
return getFieldResultType(field) ===
|
|
318
|
+
return getFieldResultType(field) === _field.FieldType.MULTIPLE_ATTACHMENTS;
|
|
402
319
|
}
|
|
403
320
|
/** @internal */
|
|
404
|
-
|
|
405
321
|
}, {
|
|
406
322
|
key: "_getCellValue",
|
|
407
323
|
value: function _getCellValue(field) {
|
|
408
324
|
var record = this.props.record;
|
|
409
|
-
|
|
410
325
|
if (record && record instanceof _record.default) {
|
|
411
326
|
return record.getCellValue(field.id);
|
|
412
327
|
} else {
|
|
413
|
-
var
|
|
328
|
+
var cellValue = record[field.id];
|
|
329
|
+
|
|
330
|
+
// To validate public cell values, we only have validateCellValueForUpdate
|
|
414
331
|
// However, this is not implemented for computed fields (since you can't update them)
|
|
415
332
|
// so we just skip the check.
|
|
416
333
|
// TODO(emma): actually check this somehow.
|
|
417
|
-
|
|
418
334
|
if (!field.isComputed) {
|
|
419
335
|
var airtableInterface = this.props.sdk.__airtableInterface;
|
|
420
336
|
var appInterface = this.props.sdk.__appInterface;
|
|
421
|
-
var validationResult = airtableInterface.fieldTypeProvider.validateCellValueForUpdate(appInterface,
|
|
422
|
-
|
|
337
|
+
var validationResult = airtableInterface.fieldTypeProvider.validateCellValueForUpdate(appInterface, cellValue, null, field._data);
|
|
423
338
|
if (!validationResult.isValid) {
|
|
424
339
|
throw (0, _error_utils.spawnError)(validationResult.reason);
|
|
425
340
|
}
|
|
426
341
|
}
|
|
427
|
-
|
|
428
|
-
return _cellValue;
|
|
342
|
+
return cellValue;
|
|
429
343
|
}
|
|
430
344
|
}
|
|
431
345
|
/** @internal */
|
|
432
|
-
|
|
433
346
|
}, {
|
|
434
347
|
key: "_getFirstAttachmentInField",
|
|
435
348
|
value: function _getFirstAttachmentInField(attachmentField) {
|
|
436
349
|
var attachmentsInField;
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
attachmentsInField = _cellValue2 ? _cellValue2.map(cv => cv.value) : [];
|
|
350
|
+
if (attachmentField.type === _field.FieldType.MULTIPLE_LOOKUP_VALUES) {
|
|
351
|
+
var cellValue = this._getCellValue(attachmentField);
|
|
352
|
+
attachmentsInField = cellValue ? cellValue.map(cv => cv.value) : [];
|
|
442
353
|
} else {
|
|
443
354
|
attachmentsInField = this._getCellValue(attachmentField);
|
|
444
355
|
}
|
|
445
|
-
|
|
446
356
|
return attachmentsInField && attachmentsInField.length > 0 ? attachmentsInField[0] : null;
|
|
447
357
|
}
|
|
448
358
|
/** @internal */
|
|
449
|
-
|
|
450
359
|
}, {
|
|
451
360
|
key: "_getFields",
|
|
452
361
|
value: function _getFields() {
|
|
453
362
|
var _this$props = this.props,
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
363
|
+
viewMetadata = _this$props.viewMetadata,
|
|
364
|
+
fields = _this$props.fields,
|
|
365
|
+
record = _this$props.record;
|
|
457
366
|
var fieldsToUse;
|
|
458
|
-
|
|
459
367
|
if (fields) {
|
|
460
368
|
fieldsToUse = fields.filter(field => !field.isDeleted);
|
|
461
369
|
} else if (viewMetadata && !viewMetadata.isDeleted) {
|
|
@@ -465,26 +373,22 @@ function (_React$Component) {
|
|
|
465
373
|
fieldsToUse = parentTable.fields;
|
|
466
374
|
} else {
|
|
467
375
|
console.warn('RecordCard: no fields, view, or record, so rendering an empty card'); // eslint-disable-line no-console
|
|
468
|
-
|
|
469
376
|
fieldsToUse = [];
|
|
470
377
|
}
|
|
471
|
-
|
|
472
378
|
return (0, _private_utils.uniqBy)(fieldsToUse, field => field.id);
|
|
473
379
|
}
|
|
474
380
|
/** @internal */
|
|
475
|
-
|
|
476
381
|
}, {
|
|
477
382
|
key: "_getPossibleFieldsForCard",
|
|
478
383
|
value: function _getPossibleFieldsForCard() {
|
|
479
|
-
var fields = this._getFields();
|
|
480
|
-
|
|
384
|
+
var fields = this._getFields();
|
|
481
385
|
|
|
386
|
+
// remove primary field if it exists
|
|
482
387
|
return fields.filter(field => {
|
|
483
388
|
return !field.isPrimaryField;
|
|
484
389
|
});
|
|
485
390
|
}
|
|
486
391
|
/** @internal */
|
|
487
|
-
|
|
488
392
|
}, {
|
|
489
393
|
key: "_getWidthAndFieldIdArray",
|
|
490
394
|
value: function _getWidthAndFieldIdArray(cellContainerWidth, fieldsToUse) {
|
|
@@ -492,29 +396,25 @@ function (_React$Component) {
|
|
|
492
396
|
var runningWidth = 0;
|
|
493
397
|
var airtableInterface = this.props.sdk.__airtableInterface;
|
|
494
398
|
var appInterface = this.props.sdk.__appInterface;
|
|
495
|
-
var
|
|
496
|
-
|
|
497
|
-
var _iteratorError2 = undefined;
|
|
498
|
-
|
|
399
|
+
var _iterator2 = _createForOfIteratorHelper(fieldsToUse),
|
|
400
|
+
_step2;
|
|
499
401
|
try {
|
|
500
|
-
for (
|
|
501
|
-
var
|
|
502
|
-
var uiConfig = airtableInterface.fieldTypeProvider.getUiConfig(appInterface,
|
|
402
|
+
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
403
|
+
var field = _step2.value;
|
|
404
|
+
var uiConfig = airtableInterface.fieldTypeProvider.getUiConfig(appInterface, field._data);
|
|
503
405
|
var desiredWidth = uiConfig.desiredCellWidthForRecordCard;
|
|
504
|
-
|
|
505
406
|
if (runningWidth + desiredWidth < cellContainerWidth) {
|
|
506
407
|
widthAndFieldIdArray.push({
|
|
507
408
|
width: desiredWidth,
|
|
508
|
-
fieldId:
|
|
409
|
+
fieldId: field.id
|
|
509
410
|
});
|
|
510
411
|
runningWidth += desiredWidth;
|
|
511
412
|
} else {
|
|
512
413
|
var minCellWidth = uiConfig.minimumCellWidthForRecordCard;
|
|
513
|
-
|
|
514
414
|
if (runningWidth + minCellWidth < cellContainerWidth) {
|
|
515
415
|
widthAndFieldIdArray.push({
|
|
516
416
|
width: minCellWidth,
|
|
517
|
-
fieldId:
|
|
417
|
+
fieldId: field.id
|
|
518
418
|
});
|
|
519
419
|
runningWidth += minCellWidth;
|
|
520
420
|
} else {
|
|
@@ -523,34 +423,21 @@ function (_React$Component) {
|
|
|
523
423
|
}
|
|
524
424
|
}
|
|
525
425
|
} catch (err) {
|
|
526
|
-
|
|
527
|
-
_iteratorError2 = err;
|
|
426
|
+
_iterator2.e(err);
|
|
528
427
|
} finally {
|
|
529
|
-
|
|
530
|
-
if (!_iteratorNormalCompletion2 && _iterator2.return != null) {
|
|
531
|
-
_iterator2.return();
|
|
532
|
-
}
|
|
533
|
-
} finally {
|
|
534
|
-
if (_didIteratorError2) {
|
|
535
|
-
throw _iteratorError2;
|
|
536
|
-
}
|
|
537
|
-
}
|
|
428
|
+
_iterator2.f();
|
|
538
429
|
}
|
|
539
|
-
|
|
540
430
|
if (runningWidth < cellContainerWidth && widthAndFieldIdArray.length > 0) {
|
|
541
431
|
var lastWidthAndFieldId = widthAndFieldIdArray[widthAndFieldIdArray.length - 1];
|
|
542
432
|
lastWidthAndFieldId.width += cellContainerWidth - runningWidth;
|
|
543
433
|
}
|
|
544
|
-
|
|
545
434
|
return widthAndFieldIdArray;
|
|
546
435
|
}
|
|
547
436
|
/** @internal */
|
|
548
|
-
|
|
549
437
|
}, {
|
|
550
438
|
key: "_getRecord",
|
|
551
439
|
value: function _getRecord() {
|
|
552
440
|
var record = this.props.record;
|
|
553
|
-
|
|
554
441
|
if (record && record instanceof _record.default) {
|
|
555
442
|
return record;
|
|
556
443
|
} else {
|
|
@@ -558,23 +445,20 @@ function (_React$Component) {
|
|
|
558
445
|
}
|
|
559
446
|
}
|
|
560
447
|
/** @internal */
|
|
561
|
-
|
|
562
448
|
}, {
|
|
563
449
|
key: "_renderCellsAndFieldLabels",
|
|
564
450
|
value: function _renderCellsAndFieldLabels(attachmentSize, fieldsToUse) {
|
|
565
451
|
var _this$props2 = this.props,
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
452
|
+
record = _this$props2.record,
|
|
453
|
+
width = _this$props2.width,
|
|
454
|
+
renderInvalidCellValue = _this$props2.renderInvalidCellValue;
|
|
569
455
|
(0, _error_utils.invariant)(typeof width === 'number', 'width in defaultProps');
|
|
570
456
|
var cellContainerWidth = width - CARD_PADDING - attachmentSize;
|
|
571
|
-
|
|
572
457
|
var widthAndFieldIdArray = this._getWidthAndFieldIdArray(cellContainerWidth, fieldsToUse);
|
|
573
|
-
|
|
574
458
|
var fieldsById = (0, _private_utils.keyBy)(fieldsToUse, o => o.id);
|
|
575
459
|
return widthAndFieldIdArray.map(widthAndFieldId => {
|
|
576
460
|
var field = fieldsById[widthAndFieldId.fieldId];
|
|
577
|
-
return React.createElement(CellValueAndFieldLabel, (0, _extends2.default)({
|
|
461
|
+
return /*#__PURE__*/React.createElement(CellValueAndFieldLabel, (0, _extends2.default)({
|
|
578
462
|
key: field.id,
|
|
579
463
|
field: field,
|
|
580
464
|
width: widthAndFieldId.width,
|
|
@@ -587,38 +471,33 @@ function (_React$Component) {
|
|
|
587
471
|
});
|
|
588
472
|
}
|
|
589
473
|
/** @hidden */
|
|
590
|
-
|
|
591
474
|
}, {
|
|
592
475
|
key: "render",
|
|
593
476
|
value: function render() {
|
|
594
477
|
var _this$props3 = this.props,
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
478
|
+
record = _this$props3.record,
|
|
479
|
+
view = _this$props3.view,
|
|
480
|
+
width = _this$props3.width,
|
|
481
|
+
height = _this$props3.height,
|
|
482
|
+
onClick = _this$props3.onClick,
|
|
483
|
+
onMouseEnter = _this$props3.onMouseEnter,
|
|
484
|
+
onMouseLeave = _this$props3.onMouseLeave,
|
|
485
|
+
className = _this$props3.className,
|
|
486
|
+
style = _this$props3.style;
|
|
605
487
|
if (record && record instanceof _record.default && record.isDeleted) {
|
|
606
488
|
return null;
|
|
607
489
|
}
|
|
608
|
-
|
|
609
490
|
var allFields = this._getFields();
|
|
610
|
-
|
|
611
491
|
var fieldsToUse = this._getPossibleFieldsForCard();
|
|
612
|
-
|
|
613
492
|
var attachmentObjIfAvailable = this._getAttachmentCover(fieldsToUse);
|
|
614
|
-
|
|
615
493
|
var hasAttachment = !!attachmentObjIfAvailable;
|
|
616
494
|
var hasOnClick = !!onClick || !!this._getRecord();
|
|
617
495
|
var containerClasses = (0, _emotion.cx)((0, _baymax_utils.baymax)('white rounded relative block overflow-hidden'), {
|
|
618
496
|
[(0, _baymax_utils.baymax)('pointer cardBoxShadow')]: hasOnClick,
|
|
619
497
|
[(0, _baymax_utils.baymax)('stroked1')]: !hasOnClick
|
|
620
|
-
}, className);
|
|
498
|
+
}, className);
|
|
621
499
|
|
|
500
|
+
// use height as size in order to get square attachment
|
|
622
501
|
(0, _error_utils.invariant)(typeof height === 'number', 'height in defaultProps');
|
|
623
502
|
var attachmentSize = hasAttachment ? height : 0;
|
|
624
503
|
var primaryValue;
|
|
@@ -626,11 +505,9 @@ function (_React$Component) {
|
|
|
626
505
|
var recordName;
|
|
627
506
|
var recordUrl;
|
|
628
507
|
var recordColor;
|
|
629
|
-
|
|
630
508
|
if (record instanceof _record.default) {
|
|
631
509
|
recordUrl = record.url;
|
|
632
510
|
recordName = record.name;
|
|
633
|
-
|
|
634
511
|
if (view) {
|
|
635
512
|
recordColor = record.getColorInView(view);
|
|
636
513
|
}
|
|
@@ -639,7 +516,6 @@ function (_React$Component) {
|
|
|
639
516
|
var primaryCellValue = primaryField ? record[primaryField.id] : null;
|
|
640
517
|
recordName = primaryCellValue === null || primaryCellValue === undefined ? null : String(primaryCellValue);
|
|
641
518
|
}
|
|
642
|
-
|
|
643
519
|
if ((0, _private_utils.isNullOrUndefinedOrEmpty)(recordName)) {
|
|
644
520
|
primaryValue = FALLBACK_RECORD_NAME_FOR_DISPLAY;
|
|
645
521
|
isUnnamed = true;
|
|
@@ -647,19 +523,18 @@ function (_React$Component) {
|
|
|
647
523
|
primaryValue = recordName;
|
|
648
524
|
isUnnamed = false;
|
|
649
525
|
}
|
|
650
|
-
|
|
651
526
|
var attachmentDimensionsAndPosition = calculateAttachmentDimensionsAndMargin(attachmentObjIfAvailable, attachmentSize);
|
|
652
|
-
return React.createElement("a", {
|
|
527
|
+
return /*#__PURE__*/React.createElement("a", {
|
|
653
528
|
href: onClick === undefined && recordUrl ? recordUrl : undefined,
|
|
654
529
|
className: containerClasses,
|
|
655
|
-
style: _objectSpread({}, style, {
|
|
530
|
+
style: _objectSpread(_objectSpread({}, style), {}, {
|
|
656
531
|
width,
|
|
657
532
|
height
|
|
658
533
|
}),
|
|
659
534
|
onClick: this._onClick,
|
|
660
535
|
onMouseEnter: onMouseEnter || undefined,
|
|
661
536
|
onMouseLeave: onMouseLeave || undefined
|
|
662
|
-
}, React.createElement(_box.default, {
|
|
537
|
+
}, /*#__PURE__*/React.createElement(_box.default, {
|
|
663
538
|
right: "".concat(attachmentSize, "px"),
|
|
664
539
|
backgroundColor: "transparent",
|
|
665
540
|
padding: "".concat(CARD_PADDING, "px"),
|
|
@@ -668,7 +543,7 @@ function (_React$Component) {
|
|
|
668
543
|
bottom: 0,
|
|
669
544
|
left: 0,
|
|
670
545
|
textColor: "dark"
|
|
671
|
-
}, React.createElement(_box.default, {
|
|
546
|
+
}, /*#__PURE__*/React.createElement(_box.default, {
|
|
672
547
|
className: (0, _emotion.cx)({
|
|
673
548
|
unnamed: isUnnamed
|
|
674
549
|
}),
|
|
@@ -680,21 +555,21 @@ function (_React$Component) {
|
|
|
680
555
|
lineHeight: 1.5,
|
|
681
556
|
height: "18px",
|
|
682
557
|
fontSize: "14px"
|
|
683
|
-
}, recordColor && React.createElement(_box.default, {
|
|
558
|
+
}, recordColor && /*#__PURE__*/React.createElement(_box.default, {
|
|
684
559
|
width: "6px",
|
|
685
560
|
height: "20px",
|
|
686
561
|
flex: "none",
|
|
687
562
|
marginRight: 1,
|
|
688
563
|
borderRadius: "circle",
|
|
689
564
|
backgroundColor: _color_utils.default.getHexForColor(recordColor)
|
|
690
|
-
}), React.createElement(_box.default, {
|
|
565
|
+
}), /*#__PURE__*/React.createElement(_box.default, {
|
|
691
566
|
className: (0, _baymax_utils.baymax)('truncate'),
|
|
692
567
|
flex: "auto"
|
|
693
|
-
}, primaryValue)), React.createElement(_box.default, {
|
|
568
|
+
}, primaryValue)), /*#__PURE__*/React.createElement(_box.default, {
|
|
694
569
|
textColor: "#555555",
|
|
695
570
|
position: "absolute",
|
|
696
571
|
marginTop: "3px"
|
|
697
|
-
}, this._renderCellsAndFieldLabels(attachmentSize, fieldsToUse))), attachmentObjIfAvailable && attachmentObjIfAvailable.thumbnails && attachmentObjIfAvailable.thumbnails.large && React.createElement(_box.default, {
|
|
572
|
+
}, this._renderCellsAndFieldLabels(attachmentSize, fieldsToUse))), attachmentObjIfAvailable && attachmentObjIfAvailable.thumbnails && attachmentObjIfAvailable.thumbnails.large && /*#__PURE__*/React.createElement(_box.default, {
|
|
698
573
|
className: (0, _baymax_utils.baymax)('noevents'),
|
|
699
574
|
style: {
|
|
700
575
|
borderTopRightRadius: 2,
|
|
@@ -705,7 +580,7 @@ function (_React$Component) {
|
|
|
705
580
|
position: "absolute",
|
|
706
581
|
right: "0",
|
|
707
582
|
overflow: "hidden"
|
|
708
|
-
}, React.createElement("img", {
|
|
583
|
+
}, /*#__PURE__*/React.createElement("img", {
|
|
709
584
|
draggable: false,
|
|
710
585
|
height: attachmentDimensionsAndPosition.height,
|
|
711
586
|
width: attachmentDimensionsAndPosition.width,
|
|
@@ -717,53 +592,45 @@ function (_React$Component) {
|
|
|
717
592
|
})));
|
|
718
593
|
}
|
|
719
594
|
}]);
|
|
720
|
-
return RecordCard;
|
|
721
595
|
}(React.Component);
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
(0, _defineProperty2.default)(RecordCard, "propTypes", _objectSpread({
|
|
596
|
+
/** @hidden */
|
|
597
|
+
(0, _defineProperty2.default)(RecordCard, "propTypes", _objectSpread(_objectSpread({
|
|
725
598
|
// Record can either be a record model or a record def (cellValuesByFieldId)
|
|
726
599
|
record: _propTypes.default.oneOfType([_propTypes.default.instanceOf(_record.default), _propTypes.default.object]),
|
|
727
600
|
// Should provide one of fields and view
|
|
728
|
-
fields: _propTypes.default.arrayOf(_propTypes.default.instanceOf(
|
|
601
|
+
fields: _propTypes.default.arrayOf(_propTypes.default.instanceOf(_field2.default).isRequired),
|
|
729
602
|
view: _propTypes.default.instanceOf(_view.default),
|
|
730
603
|
// This component will always respect attachmentCoverField if one is passed in.
|
|
731
604
|
// Pass a null value to explicitly indicate that an attachment should not be
|
|
732
605
|
// shown. If attachmentCoverField is undefined, it will fall back to using the
|
|
733
606
|
// first attachment in the view provided (if a view is provided).
|
|
734
|
-
attachmentCoverField: _propTypes.default.instanceOf(
|
|
607
|
+
attachmentCoverField: _propTypes.default.instanceOf(_field2.default),
|
|
735
608
|
width: _propTypes.default.number,
|
|
736
609
|
height: _propTypes.default.number,
|
|
737
|
-
onClick: _propTypes.default.func,
|
|
738
|
-
hasOnClick: _propTypes.default.bool,
|
|
739
|
-
onMouseEnter: _propTypes.default.func,
|
|
740
|
-
onMouseLeave: _propTypes.default.func,
|
|
741
610
|
// TODO: add all other mouse events: https://facebook.github.io/react/docs/events.html#mouse-events
|
|
742
611
|
className: _propTypes.default.string,
|
|
743
612
|
style: _propTypes.default.object,
|
|
744
613
|
expandRecordOptions: _propTypes.default.object,
|
|
745
614
|
renderInvalidCellValue: _propTypes.default.func
|
|
746
|
-
}, _tooltip_anchor_props.tooltipAnchorPropTypes,
|
|
615
|
+
}, _tooltip_anchor_props.tooltipAnchorPropTypes), recordCardStylePropTypes));
|
|
616
|
+
/** @hidden */
|
|
747
617
|
(0, _defineProperty2.default)(RecordCard, "defaultProps", {
|
|
748
618
|
width: 568,
|
|
749
619
|
height: 80,
|
|
750
620
|
className: '',
|
|
751
621
|
style: {}
|
|
752
622
|
});
|
|
753
|
-
|
|
754
|
-
var _default = (0, _with_hooks.default)(RecordCard, props => {
|
|
623
|
+
var _default = exports.default = (0, _with_hooks.default)(RecordCard, props => {
|
|
755
624
|
var _splitStyleProps = (0, _with_styled_system.splitStyleProps)(props, styleParser.propNames),
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
625
|
+
styleProps = _splitStyleProps.styleProps,
|
|
626
|
+
nonStyleProps = _splitStyleProps.nonStyleProps;
|
|
759
627
|
var record = nonStyleProps.record,
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
628
|
+
fields = nonStyleProps.fields,
|
|
629
|
+
view = nonStyleProps.view,
|
|
630
|
+
className = nonStyleProps.className;
|
|
763
631
|
var classNameForStyledProps = (0, _use_styled_system.default)(styleProps, styleParser);
|
|
764
632
|
var recordModel = record && record instanceof _record.default ? record : null;
|
|
765
633
|
var parentTable = null;
|
|
766
|
-
|
|
767
634
|
if (recordModel) {
|
|
768
635
|
parentTable = recordModel.parentTable;
|
|
769
636
|
} else if (fields && fields.length > 0) {
|
|
@@ -771,11 +638,11 @@ var _default = (0, _with_hooks.default)(RecordCard, props => {
|
|
|
771
638
|
} else if (view) {
|
|
772
639
|
parentTable = view.parentTable;
|
|
773
640
|
}
|
|
641
|
+
(0, _use_watchable.default)(recordModel, ['name', view ? "colorInView:".concat(view.id) : null]);
|
|
642
|
+
// It's safe to watch the record's parentTable since a record's parent table never changes.
|
|
643
|
+
(0, _use_watchable.default)(parentTable, ['fields']);
|
|
774
644
|
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
(0, _use_watchable.default)(parentTable, ['fields']); // if a view is supplied, we need to load the field order to use it for rendering the card
|
|
778
|
-
|
|
645
|
+
// if a view is supplied, we need to load the field order to use it for rendering the card
|
|
779
646
|
var viewMetadata = (0, _use_view_metadata.default)(view);
|
|
780
647
|
var sdk = (0, _sdk_context.useSdk)();
|
|
781
648
|
return {
|
|
@@ -783,6 +650,4 @@ var _default = (0, _with_hooks.default)(RecordCard, props => {
|
|
|
783
650
|
className: (0, _emotion.cx)(classNameForStyledProps, className),
|
|
784
651
|
sdk
|
|
785
652
|
};
|
|
786
|
-
});
|
|
787
|
-
|
|
788
|
-
exports.default = _default;
|
|
653
|
+
});
|