@airtable/blocks 1.18.1 → 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 +6 -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 +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
package/dist/cjs/ui/modal.js
CHANGED
|
@@ -1,142 +1,124 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
require("core-js/modules/es.symbol.js");
|
|
4
|
+
require("core-js/modules/es.array.filter.js");
|
|
5
|
+
require("core-js/modules/es.array.iterator.js");
|
|
6
|
+
require("core-js/modules/es.object.get-own-property-descriptors.js");
|
|
7
|
+
require("core-js/modules/es.object.to-string.js");
|
|
8
|
+
require("core-js/modules/es.weak-map.js");
|
|
9
|
+
require("core-js/modules/web.dom-collections.for-each.js");
|
|
10
|
+
require("core-js/modules/web.dom-collections.iterator.js");
|
|
5
11
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
6
|
-
|
|
7
|
-
require("core-js/modules/es.symbol");
|
|
8
|
-
|
|
9
|
-
require("core-js/modules/es.array.filter");
|
|
10
|
-
|
|
11
|
-
require("core-js/modules/es.object.get-own-property-descriptors");
|
|
12
|
-
|
|
13
|
-
require("core-js/modules/web.dom-collections.for-each");
|
|
14
|
-
|
|
15
12
|
Object.defineProperty(exports, "__esModule", {
|
|
16
13
|
value: true
|
|
17
14
|
});
|
|
18
|
-
exports.
|
|
19
|
-
|
|
15
|
+
exports.modalStylePropTypes = exports.default = exports.Modal = void 0;
|
|
20
16
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
21
|
-
|
|
22
17
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
23
|
-
|
|
24
18
|
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
25
|
-
|
|
26
19
|
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
27
|
-
|
|
28
|
-
var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
|
|
29
|
-
|
|
30
20
|
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
31
|
-
|
|
32
21
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
33
|
-
|
|
34
22
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
35
|
-
|
|
36
23
|
var _emotion = require("emotion");
|
|
37
|
-
|
|
38
24
|
var React = _interopRequireWildcard(require("react"));
|
|
39
|
-
|
|
40
25
|
var _reactDom = _interopRequireDefault(require("react-dom"));
|
|
41
|
-
|
|
42
26
|
var _core = require("@styled-system/core");
|
|
43
|
-
|
|
44
27
|
var _error_utils = require("../error_utils");
|
|
45
|
-
|
|
46
28
|
var _baymax_utils = require("./baymax_utils");
|
|
47
|
-
|
|
48
29
|
var _with_styled_system = _interopRequireDefault(require("./with_styled_system"));
|
|
49
|
-
|
|
50
30
|
var _system = require("./system");
|
|
31
|
+
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); }
|
|
32
|
+
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; }
|
|
33
|
+
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)); }
|
|
34
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
35
|
+
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; }
|
|
36
|
+
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; } /** @hidden */ /** */
|
|
37
|
+
/**
|
|
38
|
+
* Props for the {@link Modal} component. Also accepts:
|
|
39
|
+
* * {@link ModalStyleProps}
|
|
40
|
+
*
|
|
41
|
+
* @hidden
|
|
42
|
+
*/
|
|
43
|
+
// This doesn't actually extend ModalStyleProps since withStyledSystem
|
|
44
|
+
// expects non-style props and style props as separate generic type variables.
|
|
51
45
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
46
|
+
/**
|
|
47
|
+
* Style props shared between the {@link Modal}, {@link Dialog}, and {@link ConfirmationDialog} components. Also accepts:
|
|
48
|
+
* * {@link DimensionsSetProps}
|
|
49
|
+
* * {@link FlexContainerSetProps}
|
|
50
|
+
* * {@link SpacingSetProps}
|
|
51
|
+
*
|
|
52
|
+
* @hidden
|
|
53
|
+
* @noInheritDoc
|
|
54
|
+
*/
|
|
55
55
|
|
|
56
56
|
var styleParser = (0, _core.compose)(_system.dimensionsSet, _system.display, _system.flexContainerSet, _system.spacingSet);
|
|
57
|
+
var modalStylePropTypes = exports.modalStylePropTypes = _objectSpread(_objectSpread(_objectSpread(_objectSpread({}, _system.dimensionsSetPropTypes), _system.displayPropTypes), _system.flexContainerSetPropTypes), _system.spacingSetPropTypes);
|
|
57
58
|
|
|
58
|
-
var modalStylePropTypes = _objectSpread({}, _system.dimensionsSetPropTypes, {}, _system.displayPropTypes, {}, _system.flexContainerSetPropTypes, {}, _system.spacingSetPropTypes);
|
|
59
59
|
/**
|
|
60
60
|
* Generic modal component with minimal styling.
|
|
61
61
|
*
|
|
62
62
|
* @hidden
|
|
63
63
|
*/
|
|
64
64
|
// TODO (stephen): refactor so Modal only includes the background element and renders the dialog via children
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
exports.modalStylePropTypes = modalStylePropTypes;
|
|
68
|
-
|
|
69
|
-
var Modal =
|
|
70
|
-
/*#__PURE__*/
|
|
71
|
-
function (_React$Component) {
|
|
72
|
-
(0, _inherits2.default)(Modal, _React$Component);
|
|
73
|
-
|
|
74
|
-
/** @hidden */
|
|
75
|
-
|
|
76
|
-
/** @internal */
|
|
77
|
-
|
|
78
|
-
/** @internal */
|
|
79
|
-
|
|
80
|
-
/** @internal */
|
|
81
|
-
|
|
82
|
-
/** @internal */
|
|
83
|
-
|
|
65
|
+
var Modal = exports.Modal = /*#__PURE__*/function (_React$Component) {
|
|
84
66
|
/** @hidden */
|
|
85
67
|
function Modal(props) {
|
|
86
68
|
var _this;
|
|
87
|
-
|
|
88
69
|
(0, _classCallCheck2.default)(this, Modal);
|
|
89
|
-
_this = (
|
|
90
|
-
|
|
91
|
-
(0, _defineProperty2.default)(
|
|
92
|
-
|
|
93
|
-
(0, _defineProperty2.default)(
|
|
70
|
+
_this = _callSuper(this, Modal, [props]);
|
|
71
|
+
/** @internal */
|
|
72
|
+
(0, _defineProperty2.default)(_this, "_background", void 0);
|
|
73
|
+
/** @internal */
|
|
74
|
+
(0, _defineProperty2.default)(_this, "_container", void 0);
|
|
75
|
+
/** @internal */
|
|
76
|
+
(0, _defineProperty2.default)(_this, "_originalActiveElement", void 0);
|
|
77
|
+
/** @internal */
|
|
78
|
+
(0, _defineProperty2.default)(_this, "_mouseDownOutsideModal", void 0);
|
|
94
79
|
_this._background = null;
|
|
95
80
|
_this._container = document.createElement('div');
|
|
96
81
|
_this._originalActiveElement = null;
|
|
97
82
|
_this._mouseDownOutsideModal = false;
|
|
98
|
-
_this._onMouseDown = _this._onMouseDown.bind(
|
|
99
|
-
_this._onMouseUp = _this._onMouseUp.bind(
|
|
83
|
+
_this._onMouseDown = _this._onMouseDown.bind(_this);
|
|
84
|
+
_this._onMouseUp = _this._onMouseUp.bind(_this);
|
|
100
85
|
return _this;
|
|
101
86
|
}
|
|
102
87
|
/** @hidden */
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
(0, _createClass2.default)(Modal, [{
|
|
88
|
+
(0, _inherits2.default)(Modal, _React$Component);
|
|
89
|
+
return (0, _createClass2.default)(Modal, [{
|
|
106
90
|
key: "componentDidMount",
|
|
107
91
|
value: function componentDidMount() {
|
|
108
92
|
var container = this._container;
|
|
109
93
|
container.setAttribute('tabIndex', '0');
|
|
110
|
-
container.style.zIndex = '99999';
|
|
94
|
+
container.style.zIndex = '99999';
|
|
95
|
+
// If we don't set `position: fixed`, the outline and box-shadow
|
|
111
96
|
// of elements that are in theory underneath this element will cover
|
|
112
97
|
// up the modal.
|
|
113
|
-
|
|
114
98
|
container.style.position = 'fixed';
|
|
115
99
|
(0, _error_utils.invariant)(document.body, 'no document body');
|
|
116
|
-
document.body.appendChild(container);
|
|
100
|
+
document.body.appendChild(container);
|
|
101
|
+
|
|
102
|
+
// If the frame is focused, move focus to the modal's container.
|
|
117
103
|
// Next time the user presses tab, it will focus the first focusable element in the modal.
|
|
118
104
|
// We only do this if the document is focused to avoid the frame becoming
|
|
119
105
|
// programmatically focused if a modal is displayed without user interaction.
|
|
120
|
-
|
|
121
106
|
if (document.hasFocus()) {
|
|
122
107
|
this._originalActiveElement = document.activeElement;
|
|
123
108
|
container.focus();
|
|
124
109
|
}
|
|
125
110
|
}
|
|
126
111
|
/** @hidden */
|
|
127
|
-
|
|
128
112
|
}, {
|
|
129
113
|
key: "componentWillUnmount",
|
|
130
114
|
value: function componentWillUnmount() {
|
|
131
115
|
(0, _error_utils.invariant)(document.body, 'no document body');
|
|
132
116
|
document.body.removeChild(this._container);
|
|
133
|
-
|
|
134
117
|
if (this._originalActiveElement !== null) {
|
|
135
118
|
this._originalActiveElement.focus();
|
|
136
119
|
}
|
|
137
120
|
}
|
|
138
121
|
/** @internal */
|
|
139
|
-
|
|
140
122
|
}, {
|
|
141
123
|
key: "_onMouseDown",
|
|
142
124
|
value: function _onMouseDown(e) {
|
|
@@ -145,50 +127,44 @@ function (_React$Component) {
|
|
|
145
127
|
}
|
|
146
128
|
}
|
|
147
129
|
/** @internal */
|
|
148
|
-
|
|
149
130
|
}, {
|
|
150
131
|
key: "_onMouseUp",
|
|
151
132
|
value: function _onMouseUp(e) {
|
|
152
133
|
if (this._mouseDownOutsideModal && this.props.onClose && this._shouldClickingOnElementCloseModal(e.target)) {
|
|
153
134
|
this.props.onClose();
|
|
154
135
|
}
|
|
155
|
-
|
|
156
136
|
this._mouseDownOutsideModal = false;
|
|
157
137
|
}
|
|
158
138
|
/** @internal */
|
|
159
|
-
|
|
160
139
|
}, {
|
|
161
140
|
key: "_shouldClickingOnElementCloseModal",
|
|
162
141
|
value: function _shouldClickingOnElementCloseModal(el) {
|
|
163
142
|
return el === this._background;
|
|
164
143
|
}
|
|
165
144
|
/** @hidden */
|
|
166
|
-
|
|
167
145
|
}, {
|
|
168
146
|
key: "render",
|
|
169
147
|
value: function render() {
|
|
170
148
|
var _this$props = this.props,
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
return _reactDom.default.createPortal(React.createElement("div", {
|
|
149
|
+
className = _this$props.className,
|
|
150
|
+
style = _this$props.style,
|
|
151
|
+
backgroundClassName = _this$props.backgroundClassName,
|
|
152
|
+
backgroundStyle = _this$props.backgroundStyle,
|
|
153
|
+
children = _this$props.children;
|
|
154
|
+
return /*#__PURE__*/_reactDom.default.createPortal( /*#__PURE__*/React.createElement("div", {
|
|
177
155
|
ref: el => this._background = el,
|
|
178
156
|
className: (0, _emotion.cx)((0, _baymax_utils.baymax)('fixed all-0 darken3 flex items-center justify-center'), backgroundClassName),
|
|
179
157
|
style: backgroundStyle,
|
|
180
158
|
onMouseDown: this._onMouseDown,
|
|
181
159
|
onMouseUp: this._onMouseUp
|
|
182
|
-
}, React.createElement("div", {
|
|
160
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
183
161
|
className: (0, _emotion.cx)((0, _baymax_utils.baymax)('relative overflow-auto light-scrollbar white stroked1 rounded-big animate-bounce-in'), className),
|
|
184
162
|
style: style
|
|
185
163
|
}, children)), this._container);
|
|
186
164
|
}
|
|
187
165
|
}]);
|
|
188
|
-
return Modal;
|
|
189
166
|
}(React.Component);
|
|
190
|
-
|
|
191
|
-
exports.Modal = Modal;
|
|
167
|
+
/** @hidden */
|
|
192
168
|
(0, _defineProperty2.default)(Modal, "propTypes", {
|
|
193
169
|
onClose: _propTypes.default.func,
|
|
194
170
|
className: _propTypes.default.string,
|
|
@@ -196,8 +172,8 @@ exports.Modal = Modal;
|
|
|
196
172
|
backgroundClassName: _propTypes.default.string,
|
|
197
173
|
backgroundStyle: _propTypes.default.object
|
|
198
174
|
});
|
|
199
|
-
|
|
200
|
-
|
|
175
|
+
var _default = exports.default = (0, _with_styled_system.default)(Modal, styleParser, modalStylePropTypes,
|
|
176
|
+
// TODO (stephen): move these to Dialog
|
|
201
177
|
{
|
|
202
178
|
display: 'block',
|
|
203
179
|
width: '100%',
|
|
@@ -205,6 +181,4 @@ var _default = (0, _with_styled_system.default)(Modal, styleParser, modalStylePr
|
|
|
205
181
|
maxHeight: '100vh',
|
|
206
182
|
margin: 3,
|
|
207
183
|
padding: 3
|
|
208
|
-
});
|
|
209
|
-
|
|
210
|
-
exports.default = _default;
|
|
184
|
+
});
|
|
@@ -1,72 +1,56 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
require("core-js/modules/es.symbol.js");
|
|
4
|
+
require("core-js/modules/es.array.filter.js");
|
|
5
|
+
require("core-js/modules/es.object.get-own-property-descriptors.js");
|
|
6
|
+
require("core-js/modules/es.object.to-string.js");
|
|
7
|
+
require("core-js/modules/es.weak-map.js");
|
|
8
|
+
require("core-js/modules/web.dom-collections.for-each.js");
|
|
5
9
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
6
|
-
|
|
7
|
-
require("core-js/modules/es.symbol");
|
|
8
|
-
|
|
9
|
-
require("core-js/modules/es.array.filter");
|
|
10
|
-
|
|
11
|
-
require("core-js/modules/es.array.iterator");
|
|
12
|
-
|
|
13
|
-
require("core-js/modules/es.array.map");
|
|
14
|
-
|
|
15
|
-
require("core-js/modules/es.object.get-own-property-descriptors");
|
|
16
|
-
|
|
17
|
-
require("core-js/modules/web.dom-collections.for-each");
|
|
18
|
-
|
|
19
|
-
require("core-js/modules/web.dom-collections.iterator");
|
|
20
|
-
|
|
21
10
|
Object.defineProperty(exports, "__esModule", {
|
|
22
11
|
value: true
|
|
23
12
|
});
|
|
24
13
|
exports.default = void 0;
|
|
25
|
-
|
|
14
|
+
require("core-js/modules/es.array.iterator.js");
|
|
15
|
+
require("core-js/modules/es.array.map.js");
|
|
16
|
+
require("core-js/modules/web.dom-collections.iterator.js");
|
|
26
17
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
27
|
-
|
|
28
18
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
29
|
-
|
|
30
19
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
31
|
-
|
|
32
20
|
var React = _interopRequireWildcard(require("react"));
|
|
33
|
-
|
|
34
21
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
35
|
-
|
|
36
22
|
var _error_utils = require("../error_utils");
|
|
37
|
-
|
|
38
23
|
var _table = _interopRequireDefault(require("../models/table"));
|
|
39
|
-
|
|
40
24
|
var _view = _interopRequireDefault(require("../models/view"));
|
|
41
|
-
|
|
42
25
|
var _field = _interopRequireDefault(require("../models/field"));
|
|
43
|
-
|
|
44
26
|
var _select = _interopRequireWildcard(require("./select"));
|
|
45
|
-
|
|
46
27
|
var _use_watchable = _interopRequireDefault(require("./use_watchable"));
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
function
|
|
28
|
+
var _excluded = ["models", "modelKeysToWatch", "selectedModelId", "shouldAllowPickingNone", "shouldAllowPickingModelFn", "placeholder", "onChange"];
|
|
29
|
+
/** @hidden */
|
|
30
|
+
/** */
|
|
31
|
+
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); }
|
|
32
|
+
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; }
|
|
33
|
+
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; }
|
|
34
|
+
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; }
|
|
35
|
+
// Private component used by TablePicker, ViewPicker, FieldPicker.
|
|
51
36
|
|
|
52
37
|
function ModelPickerSelect(props, ref) {
|
|
53
38
|
var models = props.models,
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
39
|
+
modelKeysToWatch = props.modelKeysToWatch,
|
|
40
|
+
selectedModelId = props.selectedModelId,
|
|
41
|
+
shouldAllowPickingNone = props.shouldAllowPickingNone,
|
|
42
|
+
shouldAllowPickingModelFn = props.shouldAllowPickingModelFn,
|
|
43
|
+
placeholder = props.placeholder,
|
|
44
|
+
onChange = props.onChange,
|
|
45
|
+
restOfProps = (0, _objectWithoutProperties2.default)(props, _excluded);
|
|
46
|
+
|
|
47
|
+
// useWatchable has stricter typing than createDataContainer which it replaced, so we can't
|
|
61
48
|
// know that model and modelKeysToWatch are exactly compatible here:
|
|
62
|
-
|
|
63
49
|
(0, _use_watchable.default)(models, modelKeysToWatch);
|
|
64
|
-
|
|
65
50
|
function _onChange(value) {
|
|
66
51
|
(0, _error_utils.invariant)(value === null || typeof value === 'string', 'value must be null or model id');
|
|
67
52
|
onChange(value);
|
|
68
53
|
}
|
|
69
|
-
|
|
70
54
|
var options = [{
|
|
71
55
|
value: null,
|
|
72
56
|
label: placeholder,
|
|
@@ -78,15 +62,14 @@ function ModelPickerSelect(props, ref) {
|
|
|
78
62
|
disabled: shouldAllowPickingModelFn && !shouldAllowPickingModelFn(model)
|
|
79
63
|
};
|
|
80
64
|
})];
|
|
81
|
-
return React.createElement(_select.default, (0, _extends2.default)({}, restOfProps, {
|
|
65
|
+
return /*#__PURE__*/React.createElement(_select.default, (0, _extends2.default)({}, restOfProps, {
|
|
82
66
|
ref: ref,
|
|
83
67
|
value: selectedModelId,
|
|
84
68
|
onChange: _onChange,
|
|
85
69
|
options: options
|
|
86
70
|
}));
|
|
87
71
|
}
|
|
88
|
-
|
|
89
|
-
var ForwardedRefModelPickerSelect = React.forwardRef(ModelPickerSelect);
|
|
72
|
+
var ForwardedRefModelPickerSelect = /*#__PURE__*/React.forwardRef(ModelPickerSelect);
|
|
90
73
|
ForwardedRefModelPickerSelect.displayName = 'ModelPickerSelect';
|
|
91
74
|
ForwardedRefModelPickerSelect.propTypes = _objectSpread({
|
|
92
75
|
models: _propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.instanceOf(_table.default).isRequired, _propTypes.default.instanceOf(_view.default).isRequired, _propTypes.default.instanceOf(_field.default).isRequired]).isRequired).isRequired,
|
|
@@ -97,5 +80,4 @@ ForwardedRefModelPickerSelect.propTypes = _objectSpread({
|
|
|
97
80
|
onChange: _propTypes.default.func.isRequired,
|
|
98
81
|
placeholder: _propTypes.default.string.isRequired
|
|
99
82
|
}, _select.sharedSelectBasePropTypes);
|
|
100
|
-
var _default = ForwardedRefModelPickerSelect;
|
|
101
|
-
exports.default = _default;
|
|
83
|
+
var _default = exports.default = ForwardedRefModelPickerSelect;
|