@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,78 +1,57 @@
|
|
|
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.from.js");
|
|
7
|
+
require("core-js/modules/es.array.iterator.js");
|
|
8
|
+
require("core-js/modules/es.array.slice.js");
|
|
9
|
+
require("core-js/modules/es.object.get-own-property-descriptors.js");
|
|
10
|
+
require("core-js/modules/es.object.to-string.js");
|
|
11
|
+
require("core-js/modules/es.regexp.exec.js");
|
|
12
|
+
require("core-js/modules/es.regexp.to-string.js");
|
|
13
|
+
require("core-js/modules/es.weak-map.js");
|
|
14
|
+
require("core-js/modules/web.dom-collections.for-each.js");
|
|
15
|
+
require("core-js/modules/web.dom-collections.iterator.js");
|
|
5
16
|
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.iterator");
|
|
14
|
-
|
|
15
|
-
require("core-js/modules/es.number.constructor");
|
|
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/web.dom-collections.for-each");
|
|
22
|
-
|
|
23
|
-
require("core-js/modules/web.dom-collections.iterator");
|
|
24
|
-
|
|
25
17
|
Object.defineProperty(exports, "__esModule", {
|
|
26
18
|
value: true
|
|
27
19
|
});
|
|
28
|
-
exports.
|
|
29
|
-
|
|
20
|
+
exports.recordCardListStylePropTypes = exports.default = exports.RecordCardList = void 0;
|
|
21
|
+
require("core-js/modules/es.number.constructor.js");
|
|
30
22
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
31
|
-
|
|
32
23
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
33
|
-
|
|
34
24
|
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
35
|
-
|
|
36
25
|
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
37
|
-
|
|
38
|
-
var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
|
|
39
|
-
|
|
40
26
|
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
41
|
-
|
|
42
27
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
43
|
-
|
|
44
28
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
45
|
-
|
|
46
29
|
var React = _interopRequireWildcard(require("react"));
|
|
47
|
-
|
|
48
30
|
var _reactWindow = require("react-window");
|
|
49
|
-
|
|
50
31
|
var _core = require("@styled-system/core");
|
|
51
|
-
|
|
52
32
|
var _error_utils = require("../error_utils");
|
|
53
|
-
|
|
54
33
|
var _record = _interopRequireDefault(require("../models/record"));
|
|
55
|
-
|
|
56
34
|
var _field = _interopRequireDefault(require("../models/field"));
|
|
57
|
-
|
|
58
35
|
var _view = _interopRequireDefault(require("../models/view"));
|
|
59
|
-
|
|
60
36
|
var _record_card = _interopRequireDefault(require("./record_card"));
|
|
61
|
-
|
|
62
37
|
var _box = _interopRequireDefault(require("./box"));
|
|
63
|
-
|
|
64
38
|
var _create_detect_element_resize = _interopRequireDefault(require("./create_detect_element_resize"));
|
|
65
|
-
|
|
66
39
|
var _with_styled_system = _interopRequireDefault(require("./with_styled_system"));
|
|
67
|
-
|
|
68
40
|
var _system = require("./system");
|
|
69
|
-
|
|
70
|
-
function
|
|
71
|
-
|
|
72
|
-
function
|
|
73
|
-
|
|
41
|
+
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); }
|
|
42
|
+
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; }
|
|
43
|
+
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)); }
|
|
44
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
45
|
+
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; }
|
|
46
|
+
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; }
|
|
47
|
+
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; } } }; }
|
|
48
|
+
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; } }
|
|
49
|
+
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; } /** @module @airtable/blocks/ui: RecordCardList */ /** */
|
|
74
50
|
var RECORD_CARD_ROW_HEIGHT = 80;
|
|
75
51
|
var RECORD_CARD_SPACING = 10;
|
|
52
|
+
|
|
53
|
+
/** @internal */
|
|
54
|
+
|
|
76
55
|
/** @internal */
|
|
77
56
|
|
|
78
57
|
/**
|
|
@@ -84,57 +63,43 @@ var RECORD_CARD_SPACING = 10;
|
|
|
84
63
|
*/
|
|
85
64
|
function RecordCardItemRenderer(props) {
|
|
86
65
|
var _props$data = props.data,
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
66
|
+
records = _props$data.records,
|
|
67
|
+
fields = _props$data.fields,
|
|
68
|
+
view = _props$data.view,
|
|
69
|
+
width = _props$data.width,
|
|
70
|
+
attachmentCoverField = _props$data.attachmentCoverField,
|
|
71
|
+
onClick = _props$data.onClick,
|
|
72
|
+
onMouseEnter = _props$data.onMouseEnter,
|
|
73
|
+
onMouseLeave = _props$data.onMouseLeave;
|
|
95
74
|
var itemIndex = props.index,
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
var record = records[itemIndex];
|
|
75
|
+
style = props.style,
|
|
76
|
+
className = props.className;
|
|
77
|
+
var record = records[itemIndex];
|
|
78
|
+
// Ensure that expandRecordOptions.records only contains Records, not RecordDefs. RecordCardList
|
|
99
79
|
// can be given either Records or RecordDefs, but the `opts` argument in `expandRecord` only
|
|
100
80
|
// accepts an array of Records.
|
|
101
|
-
|
|
102
81
|
var filteredRecords = [];
|
|
103
|
-
var
|
|
104
|
-
|
|
105
|
-
var _iteratorError = undefined;
|
|
106
|
-
|
|
82
|
+
var _iterator = _createForOfIteratorHelper(records),
|
|
83
|
+
_step;
|
|
107
84
|
try {
|
|
108
|
-
for (
|
|
85
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
109
86
|
var currentRecord = _step.value;
|
|
110
|
-
|
|
111
87
|
if (currentRecord instanceof _record.default) {
|
|
112
88
|
filteredRecords.push(currentRecord);
|
|
113
89
|
}
|
|
114
90
|
}
|
|
115
91
|
} catch (err) {
|
|
116
|
-
|
|
117
|
-
_iteratorError = err;
|
|
92
|
+
_iterator.e(err);
|
|
118
93
|
} finally {
|
|
119
|
-
|
|
120
|
-
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
121
|
-
_iterator.return();
|
|
122
|
-
}
|
|
123
|
-
} finally {
|
|
124
|
-
if (_didIteratorError) {
|
|
125
|
-
throw _iteratorError;
|
|
126
|
-
}
|
|
127
|
-
}
|
|
94
|
+
_iterator.f();
|
|
128
95
|
}
|
|
129
|
-
|
|
130
96
|
if (filteredRecords.length !== records.length && filteredRecords.length !== 0) {
|
|
131
97
|
throw (0, _error_utils.spawnError)("RecordCardList's props.records should not contain a mix of Record and RecordDef");
|
|
132
|
-
}
|
|
133
|
-
// falsey values (e.g. "", false) like null.
|
|
134
|
-
|
|
98
|
+
}
|
|
135
99
|
|
|
100
|
+
// RecordCard handles null and undefined differently for `onClick`. Treat other
|
|
101
|
+
// falsey values (e.g. "", false) like null.
|
|
136
102
|
var _onClick;
|
|
137
|
-
|
|
138
103
|
if (onClick) {
|
|
139
104
|
_onClick = () => onClick(record, itemIndex);
|
|
140
105
|
} else if (onClick === undefined) {
|
|
@@ -142,8 +107,7 @@ function RecordCardItemRenderer(props) {
|
|
|
142
107
|
} else {
|
|
143
108
|
_onClick = null;
|
|
144
109
|
}
|
|
145
|
-
|
|
146
|
-
return React.createElement(_record_card.default, {
|
|
110
|
+
return /*#__PURE__*/React.createElement(_record_card.default, {
|
|
147
111
|
record: record,
|
|
148
112
|
fields: fields,
|
|
149
113
|
view: view,
|
|
@@ -156,16 +120,16 @@ function RecordCardItemRenderer(props) {
|
|
|
156
120
|
onMouseLeave: onMouseLeave ? () => onMouseLeave(record, itemIndex) : undefined,
|
|
157
121
|
width: width,
|
|
158
122
|
height: RECORD_CARD_ROW_HEIGHT,
|
|
159
|
-
className: className
|
|
123
|
+
className: className
|
|
124
|
+
// Adjustments to top and left made to properly position the cards in the list. FixedSizeList doesn't
|
|
160
125
|
// differentiate between content & gutter for each "item" it renders. See https://github.com/bvaughn/react-window#can-i-add-gutter-or-padding-between-items
|
|
161
126
|
,
|
|
162
|
-
style: _objectSpread({}, style, {
|
|
127
|
+
style: _objectSpread(_objectSpread({}, style), {}, {
|
|
163
128
|
left: Number(style.left) + RECORD_CARD_SPACING,
|
|
164
129
|
top: Number(style.top) + RECORD_CARD_SPACING
|
|
165
130
|
})
|
|
166
131
|
});
|
|
167
132
|
}
|
|
168
|
-
|
|
169
133
|
RecordCardItemRenderer.propTypes = {
|
|
170
134
|
data: _propTypes.default.shape({
|
|
171
135
|
records: _propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.instanceOf(_record.default), _propTypes.default.object])).isRequired,
|
|
@@ -183,13 +147,13 @@ RecordCardItemRenderer.propTypes = {
|
|
|
183
147
|
style: _propTypes.default.object,
|
|
184
148
|
className: _propTypes.default.string
|
|
185
149
|
};
|
|
150
|
+
|
|
186
151
|
/**
|
|
187
152
|
* Utility function to measure scrollbar size.
|
|
188
153
|
* Used to correctly calculate the width for record cards in the container.
|
|
189
154
|
*
|
|
190
155
|
* @internal
|
|
191
156
|
*/
|
|
192
|
-
|
|
193
157
|
function getScrollbarWidth() {
|
|
194
158
|
var scrollDiv = document.createElement('div');
|
|
195
159
|
scrollDiv.style.position = 'absolute';
|
|
@@ -204,11 +168,11 @@ function getScrollbarWidth() {
|
|
|
204
168
|
body.removeChild(scrollDiv);
|
|
205
169
|
return scrollbarWidth;
|
|
206
170
|
}
|
|
171
|
+
|
|
207
172
|
/**
|
|
208
173
|
* @internal
|
|
209
174
|
*/
|
|
210
175
|
|
|
211
|
-
|
|
212
176
|
/**
|
|
213
177
|
* Wrapper component for RecordCardList's window (passed to FixedSizeList).
|
|
214
178
|
*
|
|
@@ -219,30 +183,47 @@ function getScrollbarWidth() {
|
|
|
219
183
|
*
|
|
220
184
|
* @internal
|
|
221
185
|
*/
|
|
222
|
-
var innerRecordCardListWindow = React.forwardRef((props, ref) => {
|
|
186
|
+
var innerRecordCardListWindow = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
223
187
|
var style = props.style,
|
|
224
|
-
|
|
225
|
-
return React.createElement("div", {
|
|
226
|
-
ref: ref
|
|
188
|
+
children = props.children;
|
|
189
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
190
|
+
ref: ref
|
|
191
|
+
// Height adjustment required to account for the spacing between the last item and the bottom of the list container.
|
|
227
192
|
// See https://github.com/bvaughn/react-window#can-i-add-padding-to-the-top-and-bottom-of-a-list
|
|
228
193
|
,
|
|
229
|
-
style: _objectSpread({}, style, {
|
|
194
|
+
style: _objectSpread(_objectSpread({}, style), {}, {
|
|
230
195
|
height: Number(style.height) + RECORD_CARD_SPACING
|
|
231
196
|
})
|
|
232
197
|
}, children);
|
|
233
198
|
});
|
|
199
|
+
|
|
234
200
|
/**
|
|
235
201
|
* Scroll event for {@link RecordCardList}.
|
|
236
202
|
*/
|
|
237
203
|
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
204
|
+
/**
|
|
205
|
+
* Props for the {@link RecordCardList} component. Also accepts:
|
|
206
|
+
* * {@link RecordCardListStyleProps}
|
|
207
|
+
*
|
|
208
|
+
* @docsPath UI/components/RecordCardList
|
|
209
|
+
*/
|
|
210
|
+
// This doesn't actually extend RecordCardListStyleProps since withStyledSystem
|
|
211
|
+
// expects non-style props and style props as separate generic type variables.
|
|
242
212
|
|
|
213
|
+
/**
|
|
214
|
+
* Style props for the {@link RecordCardList} component. Accepts:
|
|
215
|
+
* * {@link DimensionsSetProps}
|
|
216
|
+
* * {@link FlexItemSetProps}
|
|
217
|
+
* * {@link MarginProps}
|
|
218
|
+
* * {@link PositionSetProps}
|
|
219
|
+
*
|
|
220
|
+
* @noInheritDoc
|
|
221
|
+
*/
|
|
243
222
|
|
|
244
|
-
|
|
223
|
+
var styleParser = (0, _core.compose)(_system.dimensionsSet, _system.flexItemSet, _system.positionSet, _system.margin);
|
|
224
|
+
var recordCardListStylePropTypes = exports.recordCardListStylePropTypes = _objectSpread(_objectSpread(_objectSpread(_objectSpread({}, _system.dimensionsSetPropTypes), _system.flexItemSetPropTypes), _system.positionSetPropTypes), _system.marginPropTypes);
|
|
245
225
|
|
|
226
|
+
/** @hidden */
|
|
246
227
|
/**
|
|
247
228
|
* Scrollable list of record cards.
|
|
248
229
|
*
|
|
@@ -251,44 +232,30 @@ exports.recordCardListStylePropTypes = recordCardListStylePropTypes;
|
|
|
251
232
|
* @docsPath UI/components/RecordCardList
|
|
252
233
|
* @component
|
|
253
234
|
*/
|
|
254
|
-
var RecordCardList =
|
|
255
|
-
/*#__PURE__*/
|
|
256
|
-
function (_React$Component) {
|
|
257
|
-
(0, _inherits2.default)(RecordCardList, _React$Component);
|
|
258
|
-
|
|
259
|
-
/** @hidden */
|
|
260
|
-
|
|
261
|
-
/** @internal */
|
|
262
|
-
|
|
263
|
-
/** @internal */
|
|
264
|
-
|
|
265
|
-
/** @internal */
|
|
266
|
-
|
|
267
|
-
/** @internal */
|
|
268
|
-
|
|
269
|
-
/** @internal */
|
|
270
|
-
|
|
235
|
+
var RecordCardList = exports.RecordCardList = /*#__PURE__*/function (_React$Component) {
|
|
271
236
|
/** @hidden */
|
|
272
237
|
function RecordCardList(props) {
|
|
273
238
|
var _this;
|
|
274
|
-
|
|
275
239
|
(0, _classCallCheck2.default)(this, RecordCardList);
|
|
276
|
-
_this = (
|
|
277
|
-
|
|
278
|
-
(0, _defineProperty2.default)(
|
|
279
|
-
|
|
280
|
-
(0, _defineProperty2.default)(
|
|
281
|
-
|
|
282
|
-
(0, _defineProperty2.default)(
|
|
240
|
+
_this = _callSuper(this, RecordCardList, [props]);
|
|
241
|
+
/** @internal */
|
|
242
|
+
(0, _defineProperty2.default)(_this, "_container", void 0);
|
|
243
|
+
/** @internal */
|
|
244
|
+
(0, _defineProperty2.default)(_this, "_cardList", void 0);
|
|
245
|
+
/** @internal */
|
|
246
|
+
(0, _defineProperty2.default)(_this, "_cardListInnerWindow", void 0);
|
|
247
|
+
/** @internal */
|
|
248
|
+
(0, _defineProperty2.default)(_this, "_detectElementResize", void 0);
|
|
249
|
+
/** @internal */
|
|
250
|
+
(0, _defineProperty2.default)(_this, "_scrollbarWidth", void 0);
|
|
251
|
+
/** @internal */
|
|
252
|
+
(0, _defineProperty2.default)(_this, "_updateCardListSizeIfNeeded", () => {
|
|
283
253
|
(0, _error_utils.invariant)(_this._container.current, 'No container to update card list size');
|
|
284
|
-
|
|
285
254
|
var _this$_container$curr = _this._container.current.getBoundingClientRect(),
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
255
|
+
cardListWidth = _this$_container$curr.width,
|
|
256
|
+
cardListHeight = _this$_container$curr.height;
|
|
289
257
|
(0, _error_utils.invariant)(_this._cardListInnerWindow.current, 'No card list inner window to measure scroll height');
|
|
290
258
|
var isScrollbarVisible = _this._cardListInnerWindow.current.scrollHeight > cardListHeight;
|
|
291
|
-
|
|
292
259
|
if (_this.state.cardListWidth !== cardListWidth || _this.state.cardListHeight !== cardListHeight || _this.state.isScrollbarVisible !== isScrollbarVisible) {
|
|
293
260
|
_this.setState({
|
|
294
261
|
cardListWidth,
|
|
@@ -297,9 +264,9 @@ function (_React$Component) {
|
|
|
297
264
|
});
|
|
298
265
|
}
|
|
299
266
|
});
|
|
300
|
-
_this._container = React.createRef();
|
|
301
|
-
_this._cardList = React.createRef();
|
|
302
|
-
_this._cardListInnerWindow = React.createRef();
|
|
267
|
+
_this._container = /*#__PURE__*/React.createRef();
|
|
268
|
+
_this._cardList = /*#__PURE__*/React.createRef();
|
|
269
|
+
_this._cardListInnerWindow = /*#__PURE__*/React.createRef();
|
|
303
270
|
_this._detectElementResize = (0, _create_detect_element_resize.default)();
|
|
304
271
|
_this._scrollbarWidth = getScrollbarWidth();
|
|
305
272
|
_this.state = {
|
|
@@ -310,19 +277,15 @@ function (_React$Component) {
|
|
|
310
277
|
return _this;
|
|
311
278
|
}
|
|
312
279
|
/** @hidden */
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
(0, _createClass2.default)(RecordCardList, [{
|
|
280
|
+
(0, _inherits2.default)(RecordCardList, _React$Component);
|
|
281
|
+
return (0, _createClass2.default)(RecordCardList, [{
|
|
316
282
|
key: "componentDidMount",
|
|
317
283
|
value: function componentDidMount() {
|
|
318
284
|
(0, _error_utils.invariant)(this._container.current, 'No container to detect resize on');
|
|
319
|
-
|
|
320
285
|
this._detectElementResize.addResizeListener(this._container.current, this._updateCardListSizeIfNeeded);
|
|
321
|
-
|
|
322
286
|
this._updateCardListSizeIfNeeded();
|
|
323
287
|
}
|
|
324
288
|
/** @hidden */
|
|
325
|
-
|
|
326
289
|
}, {
|
|
327
290
|
key: "componentWillUnmount",
|
|
328
291
|
value: function componentWillUnmount() {
|
|
@@ -331,7 +294,6 @@ function (_React$Component) {
|
|
|
331
294
|
}
|
|
332
295
|
}
|
|
333
296
|
/** @hidden */
|
|
334
|
-
|
|
335
297
|
}, {
|
|
336
298
|
key: "componentDidUpdate",
|
|
337
299
|
value: function componentDidUpdate(prevProps) {
|
|
@@ -340,35 +302,29 @@ function (_React$Component) {
|
|
|
340
302
|
if (this.props.records.length !== prevProps.records.length) {
|
|
341
303
|
this._updateCardListSizeIfNeeded();
|
|
342
304
|
}
|
|
343
|
-
}
|
|
305
|
+
}
|
|
306
|
+
// Functionality for `getScrollTopForRecordAtIndex` and `scrollTop` getter/setter was
|
|
344
307
|
// removed when migrating from DynamicDraw => react-window, which were not being used
|
|
345
308
|
// by any consuming component at the time of migration.
|
|
346
|
-
|
|
347
309
|
/** @hidden */
|
|
348
|
-
|
|
349
310
|
}, {
|
|
350
311
|
key: "scrollToRecordAtIndex",
|
|
351
312
|
value: function scrollToRecordAtIndex(recordIndex) {
|
|
352
313
|
(0, _error_utils.invariant)(this._cardList.current, 'No card list to scroll');
|
|
353
|
-
|
|
354
314
|
this._cardList.current.scrollToItem(recordIndex);
|
|
355
315
|
}
|
|
356
|
-
/** @internal */
|
|
357
|
-
|
|
358
316
|
}, {
|
|
359
317
|
key: "render",
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
value: function render() {
|
|
318
|
+
value: /** @hidden */
|
|
319
|
+
function render() {
|
|
363
320
|
var _this$props$onRecordM, _this$props$onRecordM2;
|
|
364
|
-
|
|
365
321
|
var _this$props = this.props,
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
322
|
+
records = _this$props.records,
|
|
323
|
+
fields = _this$props.fields,
|
|
324
|
+
view = _this$props.view,
|
|
325
|
+
attachmentCoverField = _this$props.attachmentCoverField,
|
|
326
|
+
className = _this$props.className,
|
|
327
|
+
style = _this$props.style;
|
|
372
328
|
var itemData = {
|
|
373
329
|
records,
|
|
374
330
|
fields,
|
|
@@ -381,13 +337,13 @@ function (_React$Component) {
|
|
|
381
337
|
style: {},
|
|
382
338
|
className: ''
|
|
383
339
|
};
|
|
384
|
-
return React.createElement(_box.default, {
|
|
340
|
+
return /*#__PURE__*/React.createElement(_box.default, {
|
|
385
341
|
ref: this._container,
|
|
386
342
|
className: className,
|
|
387
343
|
overflow: "hidden",
|
|
388
344
|
height: "100%",
|
|
389
345
|
style: style
|
|
390
|
-
}, React.createElement(_reactWindow.FixedSizeList, {
|
|
346
|
+
}, /*#__PURE__*/React.createElement(_reactWindow.FixedSizeList, {
|
|
391
347
|
outerRef: this._cardList,
|
|
392
348
|
width: this.state.cardListWidth,
|
|
393
349
|
height: this.state.cardListHeight,
|
|
@@ -398,14 +354,13 @@ function (_React$Component) {
|
|
|
398
354
|
itemKey: (index, data) => data.records[index].id,
|
|
399
355
|
itemSize: RECORD_CARD_ROW_HEIGHT + RECORD_CARD_SPACING,
|
|
400
356
|
onScroll: this.props.onScroll
|
|
401
|
-
},
|
|
357
|
+
},
|
|
358
|
+
// TODO(alex): figure out why this needs a cast to any - something to do with prop-types?
|
|
402
359
|
RecordCardItemRenderer));
|
|
403
360
|
}
|
|
404
361
|
}]);
|
|
405
|
-
return RecordCardList;
|
|
406
362
|
}(React.Component);
|
|
407
|
-
|
|
408
|
-
exports.RecordCardList = RecordCardList;
|
|
363
|
+
/** @hidden */
|
|
409
364
|
(0, _defineProperty2.default)(RecordCardList, "propTypes", {
|
|
410
365
|
records: _propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.instanceOf(_record.default), _propTypes.default.object])).isRequired,
|
|
411
366
|
onScroll: _propTypes.default.func,
|
|
@@ -419,7 +374,4 @@ exports.RecordCardList = RecordCardList;
|
|
|
419
374
|
className: _propTypes.default.string,
|
|
420
375
|
style: _propTypes.default.object
|
|
421
376
|
});
|
|
422
|
-
|
|
423
|
-
var _default = (0, _with_styled_system.default)(RecordCardList, styleParser, recordCardListStylePropTypes);
|
|
424
|
-
|
|
425
|
-
exports.default = _default;
|
|
377
|
+
var _default = exports.default = (0, _with_styled_system.default)(RecordCardList, styleParser, recordCardListStylePropTypes);
|
|
@@ -1,21 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
require("core-js/modules/es.object.to-string");
|
|
4
|
-
|
|
5
|
-
require("core-js/modules/es.promise");
|
|
6
|
-
|
|
7
3
|
Object.defineProperty(exports, "__esModule", {
|
|
8
4
|
value: true
|
|
9
5
|
});
|
|
10
6
|
exports.loadCSSFromString = loadCSSFromString;
|
|
11
7
|
exports.loadCSSFromURLAsync = loadCSSFromURLAsync;
|
|
12
8
|
exports.loadScriptFromURLAsync = loadScriptFromURLAsync;
|
|
13
|
-
|
|
9
|
+
require("core-js/modules/es.object.to-string.js");
|
|
10
|
+
require("core-js/modules/es.promise.js");
|
|
14
11
|
var _error_utils = require("../error_utils");
|
|
15
|
-
|
|
16
|
-
/** @module @airtable/blocks/ui: Loading external resources */
|
|
17
|
-
|
|
18
|
-
/** */
|
|
12
|
+
/** @module @airtable/blocks/ui: Loading external resources */ /** */
|
|
19
13
|
|
|
20
14
|
/**
|
|
21
15
|
* Injects CSS from a string into the page. Returns the HTML style element inserted into the page.
|
|
@@ -35,6 +29,7 @@ function loadCSSFromString(css) {
|
|
|
35
29
|
document.head.appendChild(styleTag);
|
|
36
30
|
return styleTag;
|
|
37
31
|
}
|
|
32
|
+
|
|
38
33
|
/**
|
|
39
34
|
* Injects CSS from a remote URL.
|
|
40
35
|
*
|
|
@@ -48,8 +43,6 @@ function loadCSSFromString(css) {
|
|
|
48
43
|
* ```
|
|
49
44
|
* @docsPath UI/utils/loadCSSFromURLAsync
|
|
50
45
|
*/
|
|
51
|
-
|
|
52
|
-
|
|
53
46
|
function loadCSSFromURLAsync(url) {
|
|
54
47
|
// Pre-create the error for a nicer stack trace.
|
|
55
48
|
var loadError = new Error('Failed to load remote CSS: ' + url);
|
|
@@ -67,6 +60,7 @@ function loadCSSFromURLAsync(url) {
|
|
|
67
60
|
document.head.appendChild(linkTag);
|
|
68
61
|
});
|
|
69
62
|
}
|
|
63
|
+
|
|
70
64
|
/**
|
|
71
65
|
* Injects Javascript from a remote URL.
|
|
72
66
|
*
|
|
@@ -80,8 +74,6 @@ function loadCSSFromURLAsync(url) {
|
|
|
80
74
|
* ```
|
|
81
75
|
* @docsPath UI/utils/loadScriptFromURLAsync
|
|
82
76
|
*/
|
|
83
|
-
|
|
84
|
-
|
|
85
77
|
function loadScriptFromURLAsync(url) {
|
|
86
78
|
// Pre-create the error for a nicer stack trace.
|
|
87
79
|
var loadError = new Error('Failed to load remote script: ' + url);
|
|
@@ -1,23 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
require("core-js/modules/es.array.iterator.js");
|
|
4
|
+
require("core-js/modules/es.object.to-string.js");
|
|
5
|
+
require("core-js/modules/es.weak-map.js");
|
|
6
|
+
require("core-js/modules/web.dom-collections.iterator.js");
|
|
5
7
|
Object.defineProperty(exports, "__esModule", {
|
|
6
8
|
value: true
|
|
7
9
|
});
|
|
8
10
|
exports.useSdk = exports.SdkContext = void 0;
|
|
9
|
-
|
|
10
11
|
var React = _interopRequireWildcard(require("react"));
|
|
11
|
-
|
|
12
12
|
var _error_utils = require("../error_utils");
|
|
13
|
-
|
|
14
|
-
var
|
|
15
|
-
exports.SdkContext =
|
|
16
|
-
|
|
13
|
+
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); }
|
|
14
|
+
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; }
|
|
15
|
+
var SdkContext = exports.SdkContext = /*#__PURE__*/React.createContext(null);
|
|
17
16
|
var useSdk = () => {
|
|
18
17
|
var sdk = React.useContext(SdkContext);
|
|
19
18
|
(0, _error_utils.invariant)(sdk, 'This component can only be used in a block. Make sure to use `initializeBlock` at the root of this component tree.');
|
|
20
19
|
return sdk;
|
|
21
20
|
};
|
|
22
|
-
|
|
23
21
|
exports.useSdk = useSdk;
|