@airtable/blocks 0.0.0-experimental-f52bc4e5e-20250709 → 0.0.0-experimental-75d011284-20250904
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/base/assert_run_context.js +12 -0
- package/dist/cjs/base/index.js +30 -30
- package/dist/cjs/base/models/abstract_model_with_async_data.js +154 -237
- package/dist/cjs/base/models/base.js +188 -267
- package/dist/cjs/base/models/create_aggregators.js +29 -46
- package/dist/cjs/base/models/cursor.js +206 -294
- package/dist/cjs/base/models/field.js +307 -395
- package/dist/cjs/base/models/grouped_record_query_result.js +219 -338
- package/dist/cjs/base/models/linked_records_query_result.js +450 -625
- package/dist/cjs/base/models/models.js +19 -22
- package/dist/cjs/base/models/mutations.js +267 -293
- package/dist/cjs/base/models/object_pool.js +117 -156
- package/dist/cjs/base/models/record.js +191 -256
- package/dist/cjs/base/models/record_coloring.js +6 -6
- package/dist/cjs/base/models/record_query_result.js +351 -435
- package/dist/cjs/base/models/record_store.js +403 -753
- package/dist/cjs/base/models/session.js +125 -153
- package/dist/cjs/base/models/table.js +457 -605
- package/dist/cjs/base/models/table_or_view_query_result.js +656 -920
- package/dist/cjs/base/models/view.js +284 -389
- package/dist/cjs/base/models/view_data_store.js +218 -356
- package/dist/cjs/base/models/view_metadata_query_result.js +109 -157
- package/dist/cjs/base/perform_record_action.js +89 -131
- package/dist/cjs/base/sdk.js +129 -184
- package/dist/cjs/base/settings_button.js +54 -74
- package/dist/cjs/base/types/airtable_interface.js +1 -1
- package/dist/cjs/base/types/mutations.js +5 -11
- package/dist/cjs/base/types/undo_redo.js +1 -1
- package/dist/cjs/base/types/view.js +1 -1
- package/dist/cjs/base/ui/base_provider.js +6 -8
- package/dist/cjs/base/ui/baymax_utils.js +436 -108
- package/dist/cjs/base/ui/block_wrapper.js +81 -106
- package/dist/cjs/base/ui/box.js +34 -60
- package/dist/cjs/base/ui/button.js +44 -74
- package/dist/cjs/base/ui/cell_renderer.js +132 -189
- package/dist/cjs/base/ui/choice_token.js +25 -42
- package/dist/cjs/base/ui/collaborator_token.js +31 -53
- package/dist/cjs/base/ui/color_palette.js +130 -173
- package/dist/cjs/base/ui/color_palette_synced.js +41 -70
- package/dist/cjs/base/ui/confirmation_dialog.js +70 -120
- package/dist/cjs/base/ui/control_sizes.js +24 -22
- package/dist/cjs/base/ui/create_detect_element_resize.js +6 -10
- package/dist/cjs/base/ui/css_helpers.js +1 -1
- package/dist/cjs/base/ui/dialog.js +57 -98
- package/dist/cjs/base/ui/dialog_close_button.js +52 -98
- package/dist/cjs/base/ui/expand_record.js +1 -2
- package/dist/cjs/base/ui/expand_record_list.js +3 -4
- package/dist/cjs/base/ui/expand_record_picker_async.js +28 -57
- package/dist/cjs/base/ui/field_icon.js +15 -33
- package/dist/cjs/base/ui/field_picker.js +25 -70
- package/dist/cjs/base/ui/field_picker_synced.js +18 -40
- package/dist/cjs/base/ui/form_field.js +27 -55
- package/dist/cjs/base/ui/geometry/geometry.js +5 -5
- package/dist/cjs/base/ui/geometry/point.js +10 -12
- package/dist/cjs/base/ui/geometry/rect.js +36 -52
- package/dist/cjs/base/ui/geometry/size.js +10 -12
- package/dist/cjs/base/ui/global_alert.js +31 -52
- package/dist/cjs/base/ui/heading.js +45 -94
- package/dist/cjs/base/ui/icon.js +39 -59
- package/dist/cjs/base/ui/icon_config.js +6 -12
- package/dist/cjs/base/ui/initialize_block.js +16 -35
- package/dist/cjs/base/ui/input.js +62 -101
- package/dist/cjs/base/ui/input_synced.js +17 -40
- package/dist/cjs/base/ui/key_codes.js +2 -3
- package/dist/cjs/base/ui/label.js +30 -55
- package/dist/cjs/base/ui/link.js +54 -87
- package/dist/cjs/base/ui/loader.js +15 -36
- package/dist/cjs/base/ui/modal.js +88 -127
- package/dist/cjs/base/ui/model_picker_select.js +18 -44
- package/dist/cjs/base/ui/popover.js +236 -328
- package/dist/cjs/base/ui/progress_bar.js +34 -47
- package/dist/cjs/base/ui/record_card.js +389 -478
- package/dist/cjs/base/ui/record_card_list.js +150 -224
- package/dist/cjs/base/ui/select.js +60 -116
- package/dist/cjs/base/ui/select_and_select_buttons_helpers.js +15 -39
- package/dist/cjs/base/ui/select_buttons.js +50 -83
- package/dist/cjs/base/ui/select_buttons_synced.js +17 -39
- package/dist/cjs/base/ui/select_synced.js +17 -39
- package/dist/cjs/base/ui/switch.js +42 -71
- package/dist/cjs/base/ui/switch_synced.js +16 -38
- package/dist/cjs/base/ui/synced.js +27 -48
- package/dist/cjs/base/ui/system/all_styles_set.js +4 -12
- package/dist/cjs/base/ui/system/appearance/appearance_set.js +10 -13
- package/dist/cjs/base/ui/system/appearance/background_color.js +3 -6
- package/dist/cjs/base/ui/system/appearance/border.js +3 -6
- package/dist/cjs/base/ui/system/appearance/border_radius.js +3 -6
- package/dist/cjs/base/ui/system/appearance/box_shadow.js +3 -6
- package/dist/cjs/base/ui/system/appearance/opacity.js +3 -6
- package/dist/cjs/base/ui/system/dimensions/dimensions_set.js +11 -13
- package/dist/cjs/base/ui/system/dimensions/height.js +3 -6
- package/dist/cjs/base/ui/system/dimensions/max_height.js +3 -6
- package/dist/cjs/base/ui/system/dimensions/max_width.js +3 -6
- package/dist/cjs/base/ui/system/dimensions/min_height.js +3 -6
- package/dist/cjs/base/ui/system/dimensions/min_width.js +3 -6
- package/dist/cjs/base/ui/system/dimensions/width.js +3 -6
- package/dist/cjs/base/ui/system/display.js +3 -6
- package/dist/cjs/base/ui/system/flex_container/align_content.js +3 -6
- package/dist/cjs/base/ui/system/flex_container/align_items.js +3 -6
- package/dist/cjs/base/ui/system/flex_container/flex_container_set.js +11 -13
- package/dist/cjs/base/ui/system/flex_container/flex_direction.js +3 -6
- package/dist/cjs/base/ui/system/flex_container/flex_wrap.js +3 -6
- package/dist/cjs/base/ui/system/flex_container/justify_content.js +3 -6
- package/dist/cjs/base/ui/system/flex_container/justify_items.js +3 -6
- package/dist/cjs/base/ui/system/flex_item/align_self.js +3 -6
- package/dist/cjs/base/ui/system/flex_item/flex.js +3 -6
- package/dist/cjs/base/ui/system/flex_item/flex_basis.js +3 -6
- package/dist/cjs/base/ui/system/flex_item/flex_grow.js +3 -6
- package/dist/cjs/base/ui/system/flex_item/flex_item_set.js +12 -13
- package/dist/cjs/base/ui/system/flex_item/flex_shrink.js +3 -6
- package/dist/cjs/base/ui/system/flex_item/justify_self.js +3 -6
- package/dist/cjs/base/ui/system/flex_item/order.js +3 -6
- package/dist/cjs/base/ui/system/index.js +104 -416
- package/dist/cjs/base/ui/system/overflow.js +3 -6
- package/dist/cjs/base/ui/system/position/bottom.js +4 -6
- package/dist/cjs/base/ui/system/position/left.js +4 -6
- package/dist/cjs/base/ui/system/position/position.js +3 -6
- package/dist/cjs/base/ui/system/position/position_set.js +11 -13
- package/dist/cjs/base/ui/system/position/right.js +4 -6
- package/dist/cjs/base/ui/system/position/top.js +4 -6
- package/dist/cjs/base/ui/system/position/z_index.js +3 -6
- package/dist/cjs/base/ui/system/spacing/margin.js +4 -6
- package/dist/cjs/base/ui/system/spacing/padding.js +4 -6
- package/dist/cjs/base/ui/system/spacing/spacing_set.js +7 -13
- package/dist/cjs/base/ui/system/typography/font_family.js +3 -6
- package/dist/cjs/base/ui/system/typography/font_size.js +3 -6
- package/dist/cjs/base/ui/system/typography/font_style.js +3 -6
- package/dist/cjs/base/ui/system/typography/font_weight.js +3 -6
- package/dist/cjs/base/ui/system/typography/letter_spacing.js +3 -6
- package/dist/cjs/base/ui/system/typography/line_height.js +3 -6
- package/dist/cjs/base/ui/system/typography/text_align.js +3 -6
- package/dist/cjs/base/ui/system/typography/text_color.js +3 -6
- package/dist/cjs/base/ui/system/typography/text_decoration.js +3 -6
- package/dist/cjs/base/ui/system/typography/text_transform.js +3 -6
- package/dist/cjs/base/ui/system/typography/typography_set.js +15 -13
- package/dist/cjs/base/ui/system/utils/ensure_numbers_are_within_scale.js +3 -4
- package/dist/cjs/base/ui/system/utils/get_style_props_for_responsive_prop.js +47 -87
- package/dist/cjs/base/ui/table_picker.js +18 -42
- package/dist/cjs/base/ui/table_picker_synced.js +17 -39
- package/dist/cjs/base/ui/text.js +40 -73
- package/dist/cjs/base/ui/text_button.js +51 -83
- package/dist/cjs/base/ui/theme/default_theme/button_variants.js +3 -3
- package/dist/cjs/base/ui/theme/default_theme/control_sizes.js +51 -45
- package/dist/cjs/base/ui/theme/default_theme/heading_styles.js +1 -1
- package/dist/cjs/base/ui/theme/default_theme/index.js +9 -15
- package/dist/cjs/base/ui/theme/default_theme/input_variants.js +3 -3
- package/dist/cjs/base/ui/theme/default_theme/link_variants.js +3 -3
- package/dist/cjs/base/ui/theme/default_theme/select_buttons_variants.js +4 -4
- package/dist/cjs/base/ui/theme/default_theme/select_variants.js +8 -17
- package/dist/cjs/base/ui/theme/default_theme/switch_variants.js +23 -29
- package/dist/cjs/base/ui/theme/default_theme/text_button_variants.js +5 -5
- package/dist/cjs/base/ui/theme/default_theme/text_styles.js +1 -1
- package/dist/cjs/base/ui/theme/default_theme/tokens.js +14 -14
- package/dist/cjs/base/ui/theme/theme_context.js +2 -2
- package/dist/cjs/base/ui/theme/use_theme.js +2 -2
- package/dist/cjs/base/ui/tooltip.js +134 -174
- package/dist/cjs/base/ui/types/aria_props.js +1 -23
- package/dist/cjs/base/ui/types/data_attributes_prop.js +1 -18
- package/dist/cjs/base/ui/types/tooltip_anchor_props.js +1 -17
- package/dist/cjs/base/ui/ui.js +48 -49
- package/dist/cjs/base/ui/unstable_standalone_ui.js +27 -27
- package/dist/cjs/base/ui/use_base.js +1 -1
- package/dist/cjs/base/ui/use_cursor.js +5 -4
- package/dist/cjs/base/ui/use_form_field.js +1 -1
- package/dist/cjs/base/ui/use_loadable.js +25 -91
- package/dist/cjs/base/ui/use_record_action_data.js +4 -3
- package/dist/cjs/base/ui/use_records.js +9 -13
- package/dist/cjs/base/ui/use_session.js +1 -1
- package/dist/cjs/base/ui/use_settings_button.js +4 -3
- package/dist/cjs/base/ui/use_styled_system.js +7 -14
- package/dist/cjs/base/ui/use_text_color_for_background_color.js +4 -3
- package/dist/cjs/base/ui/use_view_metadata.js +4 -4
- package/dist/cjs/base/ui/use_viewport.js +2 -2
- package/dist/cjs/base/ui/view_picker.js +26 -70
- package/dist/cjs/base/ui/view_picker_synced.js +18 -40
- package/dist/cjs/base/ui/viewport_constraint.js +67 -114
- package/dist/cjs/base/ui/with_styled_system.js +25 -61
- package/dist/cjs/base/undo_redo.js +21 -32
- package/dist/cjs/base/unstable_testing_utils.js +27 -27
- package/dist/cjs/base/viewport.js +268 -312
- package/dist/cjs/injected/airtable_interface.js +4 -4
- package/dist/cjs/interface/assert_run_context.js +12 -0
- package/dist/cjs/interface/index.js +4 -18
- package/dist/cjs/interface/models/base.js +15 -34
- package/dist/cjs/interface/models/field.js +5 -19
- package/dist/cjs/interface/models/models.js +8 -7
- package/dist/cjs/interface/models/mutations.js +50 -66
- package/dist/cjs/interface/models/record.js +29 -49
- package/dist/cjs/interface/models/record_store.js +25 -57
- package/dist/cjs/interface/models/session.js +2 -16
- package/dist/cjs/interface/models/table.js +66 -95
- package/dist/cjs/interface/sdk.js +61 -87
- package/dist/cjs/interface/types/airtable_interface.js +2 -2
- package/dist/cjs/interface/types/mutations.js +3 -10
- package/dist/cjs/interface/ui/block_wrapper.js +56 -48
- package/dist/cjs/interface/ui/initialize_block.js +13 -28
- package/dist/cjs/interface/ui/ui.js +20 -19
- package/dist/cjs/interface/ui/use_base.js +1 -1
- package/dist/cjs/interface/ui/use_custom_properties.js +19 -35
- package/dist/cjs/interface/ui/use_records.js +6 -5
- package/dist/cjs/interface/ui/use_run_info.js +2 -2
- package/dist/cjs/interface/ui/use_session.js +1 -1
- package/dist/cjs/shared/color_utils.js +9 -16
- package/dist/cjs/shared/colors.js +2 -2
- package/dist/cjs/shared/error_utils.js +9 -11
- package/dist/cjs/shared/event_tracker.js +3 -3
- package/dist/cjs/shared/global_config.js +337 -449
- package/dist/cjs/shared/models/abstract_model.js +72 -97
- package/dist/cjs/shared/models/base_core.js +394 -514
- package/dist/cjs/shared/models/field_core.js +236 -279
- package/dist/cjs/shared/models/mutations_core.js +283 -379
- package/dist/cjs/shared/models/record_core.js +174 -231
- package/dist/cjs/shared/models/record_store_core.js +119 -172
- package/dist/cjs/shared/models/session_core.js +116 -170
- package/dist/cjs/shared/models/table_core.js +1258 -1501
- package/dist/cjs/shared/private_utils.js +54 -124
- package/dist/cjs/shared/sdk_core.js +68 -70
- package/dist/cjs/shared/types/field_core.js +1 -1
- package/dist/cjs/shared/types/mutation_constants.js +4 -4
- package/dist/cjs/shared/types/mutations_core.js +1 -1
- package/dist/cjs/shared/types/permission_levels.js +1 -1
- package/dist/cjs/shared/ui/global_config_synced_component_helpers.js +9 -9
- package/dist/cjs/shared/ui/loader.js +14 -35
- package/dist/cjs/shared/ui/remote_utils.js +5 -7
- package/dist/cjs/shared/ui/sdk_context.js +4 -8
- package/dist/cjs/shared/ui/use_array_identity.js +2 -2
- package/dist/cjs/shared/ui/use_base.js +6 -5
- package/dist/cjs/shared/ui/use_color_scheme.js +3 -8
- package/dist/cjs/shared/ui/use_global_config.js +5 -4
- package/dist/cjs/shared/ui/use_session.js +6 -5
- package/dist/cjs/shared/ui/use_synced.js +7 -5
- package/dist/cjs/shared/ui/use_watchable.js +13 -42
- package/dist/cjs/shared/ui/with_hooks.js +6 -13
- package/dist/cjs/shared/unstable_private_utils.js +4 -6
- package/dist/cjs/shared/warning.js +5 -5
- package/dist/cjs/shared/watchable.js +110 -176
- package/dist/cjs/stats/block_stats.js +62 -85
- package/dist/cjs/testing/base/abstract_mock_airtable_interface.js +208 -0
- package/dist/cjs/testing/interface/abstract_mock_airtable_interface.js +124 -0
- package/dist/types/src/base/assert_run_context.d.ts +2 -0
- package/dist/types/src/base/assert_run_context.d.ts.map +1 -0
- package/dist/types/src/base/index.d.ts +1 -0
- package/dist/types/src/base/index.d.ts.map +1 -1
- package/dist/types/src/base/models/models.d.ts +1 -0
- package/dist/types/src/base/models/models.d.ts.map +1 -1
- package/dist/types/src/base/models/mutations.d.ts.map +1 -1
- package/dist/types/src/base/sdk.d.ts.map +1 -1
- package/dist/types/src/base/ui/block_wrapper.d.ts +1 -1
- package/dist/types/src/base/ui/box.d.ts.map +1 -1
- package/dist/types/src/base/ui/button.d.ts +0 -5
- package/dist/types/src/base/ui/button.d.ts.map +1 -1
- package/dist/types/src/base/ui/cell_renderer.d.ts +1 -22
- package/dist/types/src/base/ui/cell_renderer.d.ts.map +1 -1
- package/dist/types/src/base/ui/choice_token.d.ts +1 -21
- package/dist/types/src/base/ui/choice_token.d.ts.map +1 -1
- package/dist/types/src/base/ui/collaborator_token.d.ts +0 -20
- package/dist/types/src/base/ui/collaborator_token.d.ts.map +1 -1
- package/dist/types/src/base/ui/color_palette.d.ts +1 -32
- package/dist/types/src/base/ui/color_palette.d.ts.map +1 -1
- package/dist/types/src/base/ui/color_palette_synced.d.ts +0 -14
- package/dist/types/src/base/ui/color_palette_synced.d.ts.map +1 -1
- package/dist/types/src/base/ui/confirmation_dialog.d.ts +0 -17
- package/dist/types/src/base/ui/confirmation_dialog.d.ts.map +1 -1
- package/dist/types/src/base/ui/control_sizes.d.ts +0 -1
- package/dist/types/src/base/ui/control_sizes.d.ts.map +1 -1
- package/dist/types/src/base/ui/dialog.d.ts +1 -23
- package/dist/types/src/base/ui/dialog.d.ts.map +1 -1
- package/dist/types/src/base/ui/dialog_close_button.d.ts +2 -24
- package/dist/types/src/base/ui/dialog_close_button.d.ts.map +1 -1
- package/dist/types/src/base/ui/field_icon.d.ts +1 -17
- package/dist/types/src/base/ui/field_icon.d.ts.map +1 -1
- package/dist/types/src/base/ui/field_picker.d.ts +0 -23
- package/dist/types/src/base/ui/field_picker.d.ts.map +1 -1
- package/dist/types/src/base/ui/field_picker_synced.d.ts.map +1 -1
- package/dist/types/src/base/ui/form_field.d.ts +0 -4
- package/dist/types/src/base/ui/form_field.d.ts.map +1 -1
- package/dist/types/src/base/ui/heading.d.ts +1 -1
- package/dist/types/src/base/ui/heading.d.ts.map +1 -1
- package/dist/types/src/base/ui/icon.d.ts +0 -16
- package/dist/types/src/base/ui/icon.d.ts.map +1 -1
- package/dist/types/src/base/ui/icon_config.d.ts +50 -51
- package/dist/types/src/base/ui/icon_config.d.ts.map +1 -1
- package/dist/types/src/base/ui/initialize_block.d.ts.map +1 -1
- package/dist/types/src/base/ui/input.d.ts +12 -46
- package/dist/types/src/base/ui/input.d.ts.map +1 -1
- package/dist/types/src/base/ui/input_synced.d.ts.map +1 -1
- package/dist/types/src/base/ui/label.d.ts.map +1 -1
- package/dist/types/src/base/ui/link.d.ts +1 -5
- package/dist/types/src/base/ui/link.d.ts.map +1 -1
- package/dist/types/src/base/ui/loader.d.ts +3 -20
- package/dist/types/src/base/ui/loader.d.ts.map +1 -1
- package/dist/types/src/base/ui/modal.d.ts +1 -14
- package/dist/types/src/base/ui/modal.d.ts.map +1 -1
- package/dist/types/src/base/ui/model_picker_select.d.ts.map +1 -1
- package/dist/types/src/base/ui/popover.d.ts +1 -17
- package/dist/types/src/base/ui/popover.d.ts.map +1 -1
- package/dist/types/src/base/ui/progress_bar.d.ts +1 -24
- package/dist/types/src/base/ui/progress_bar.d.ts.map +1 -1
- package/dist/types/src/base/ui/record_card.d.ts +1 -23
- package/dist/types/src/base/ui/record_card.d.ts.map +1 -1
- package/dist/types/src/base/ui/record_card_list.d.ts +1 -18
- package/dist/types/src/base/ui/record_card_list.d.ts.map +1 -1
- package/dist/types/src/base/ui/select.d.ts +0 -44
- package/dist/types/src/base/ui/select.d.ts.map +1 -1
- package/dist/types/src/base/ui/select_and_select_buttons_helpers.d.ts +0 -2
- package/dist/types/src/base/ui/select_and_select_buttons_helpers.d.ts.map +1 -1
- package/dist/types/src/base/ui/select_buttons.d.ts +0 -22
- package/dist/types/src/base/ui/select_buttons.d.ts.map +1 -1
- package/dist/types/src/base/ui/select_buttons_synced.d.ts.map +1 -1
- package/dist/types/src/base/ui/select_synced.d.ts.map +1 -1
- package/dist/types/src/base/ui/switch.d.ts +0 -22
- package/dist/types/src/base/ui/switch.d.ts.map +1 -1
- package/dist/types/src/base/ui/switch_synced.d.ts.map +1 -1
- package/dist/types/src/base/ui/synced.d.ts +2 -8
- package/dist/types/src/base/ui/synced.d.ts.map +1 -1
- package/dist/types/src/base/ui/system/all_styles_set.d.ts +0 -3
- package/dist/types/src/base/ui/system/all_styles_set.d.ts.map +1 -1
- package/dist/types/src/base/ui/system/appearance/appearance_set.d.ts +0 -1
- package/dist/types/src/base/ui/system/appearance/appearance_set.d.ts.map +1 -1
- package/dist/types/src/base/ui/system/appearance/background_color.d.ts +0 -1
- package/dist/types/src/base/ui/system/appearance/background_color.d.ts.map +1 -1
- package/dist/types/src/base/ui/system/appearance/border.d.ts +0 -1
- package/dist/types/src/base/ui/system/appearance/border.d.ts.map +1 -1
- package/dist/types/src/base/ui/system/appearance/border_radius.d.ts +0 -1
- package/dist/types/src/base/ui/system/appearance/border_radius.d.ts.map +1 -1
- package/dist/types/src/base/ui/system/appearance/box_shadow.d.ts +0 -1
- package/dist/types/src/base/ui/system/appearance/box_shadow.d.ts.map +1 -1
- package/dist/types/src/base/ui/system/appearance/opacity.d.ts +0 -1
- package/dist/types/src/base/ui/system/appearance/opacity.d.ts.map +1 -1
- package/dist/types/src/base/ui/system/dimensions/dimensions_set.d.ts +0 -1
- package/dist/types/src/base/ui/system/dimensions/dimensions_set.d.ts.map +1 -1
- package/dist/types/src/base/ui/system/dimensions/height.d.ts +0 -1
- package/dist/types/src/base/ui/system/dimensions/height.d.ts.map +1 -1
- package/dist/types/src/base/ui/system/dimensions/max_height.d.ts +0 -1
- package/dist/types/src/base/ui/system/dimensions/max_height.d.ts.map +1 -1
- package/dist/types/src/base/ui/system/dimensions/max_width.d.ts +0 -1
- package/dist/types/src/base/ui/system/dimensions/max_width.d.ts.map +1 -1
- package/dist/types/src/base/ui/system/dimensions/min_height.d.ts +0 -1
- package/dist/types/src/base/ui/system/dimensions/min_height.d.ts.map +1 -1
- package/dist/types/src/base/ui/system/dimensions/min_width.d.ts +0 -1
- package/dist/types/src/base/ui/system/dimensions/min_width.d.ts.map +1 -1
- package/dist/types/src/base/ui/system/dimensions/width.d.ts +0 -1
- package/dist/types/src/base/ui/system/dimensions/width.d.ts.map +1 -1
- package/dist/types/src/base/ui/system/display.d.ts +0 -1
- package/dist/types/src/base/ui/system/display.d.ts.map +1 -1
- package/dist/types/src/base/ui/system/flex_container/align_content.d.ts +0 -1
- package/dist/types/src/base/ui/system/flex_container/align_content.d.ts.map +1 -1
- package/dist/types/src/base/ui/system/flex_container/align_items.d.ts +0 -1
- package/dist/types/src/base/ui/system/flex_container/align_items.d.ts.map +1 -1
- package/dist/types/src/base/ui/system/flex_container/flex_container_set.d.ts +0 -1
- package/dist/types/src/base/ui/system/flex_container/flex_container_set.d.ts.map +1 -1
- package/dist/types/src/base/ui/system/flex_container/flex_direction.d.ts +0 -1
- package/dist/types/src/base/ui/system/flex_container/flex_direction.d.ts.map +1 -1
- package/dist/types/src/base/ui/system/flex_container/flex_wrap.d.ts +0 -1
- package/dist/types/src/base/ui/system/flex_container/flex_wrap.d.ts.map +1 -1
- package/dist/types/src/base/ui/system/flex_container/justify_content.d.ts +0 -1
- package/dist/types/src/base/ui/system/flex_container/justify_content.d.ts.map +1 -1
- package/dist/types/src/base/ui/system/flex_container/justify_items.d.ts +0 -1
- package/dist/types/src/base/ui/system/flex_container/justify_items.d.ts.map +1 -1
- package/dist/types/src/base/ui/system/flex_item/align_self.d.ts +0 -1
- package/dist/types/src/base/ui/system/flex_item/align_self.d.ts.map +1 -1
- package/dist/types/src/base/ui/system/flex_item/flex.d.ts +0 -1
- package/dist/types/src/base/ui/system/flex_item/flex.d.ts.map +1 -1
- package/dist/types/src/base/ui/system/flex_item/flex_basis.d.ts +0 -1
- package/dist/types/src/base/ui/system/flex_item/flex_basis.d.ts.map +1 -1
- package/dist/types/src/base/ui/system/flex_item/flex_grow.d.ts +0 -1
- package/dist/types/src/base/ui/system/flex_item/flex_grow.d.ts.map +1 -1
- package/dist/types/src/base/ui/system/flex_item/flex_item_set.d.ts +0 -1
- package/dist/types/src/base/ui/system/flex_item/flex_item_set.d.ts.map +1 -1
- package/dist/types/src/base/ui/system/flex_item/flex_shrink.d.ts +0 -1
- package/dist/types/src/base/ui/system/flex_item/flex_shrink.d.ts.map +1 -1
- package/dist/types/src/base/ui/system/flex_item/justify_self.d.ts +0 -1
- package/dist/types/src/base/ui/system/flex_item/justify_self.d.ts.map +1 -1
- package/dist/types/src/base/ui/system/flex_item/order.d.ts +0 -1
- package/dist/types/src/base/ui/system/flex_item/order.d.ts.map +1 -1
- package/dist/types/src/base/ui/system/index.d.ts +52 -52
- package/dist/types/src/base/ui/system/index.d.ts.map +1 -1
- package/dist/types/src/base/ui/system/overflow.d.ts +0 -1
- package/dist/types/src/base/ui/system/overflow.d.ts.map +1 -1
- package/dist/types/src/base/ui/system/position/bottom.d.ts +0 -1
- package/dist/types/src/base/ui/system/position/bottom.d.ts.map +1 -1
- package/dist/types/src/base/ui/system/position/left.d.ts +0 -1
- package/dist/types/src/base/ui/system/position/left.d.ts.map +1 -1
- package/dist/types/src/base/ui/system/position/position.d.ts +0 -1
- package/dist/types/src/base/ui/system/position/position.d.ts.map +1 -1
- package/dist/types/src/base/ui/system/position/position_set.d.ts +0 -1
- package/dist/types/src/base/ui/system/position/position_set.d.ts.map +1 -1
- package/dist/types/src/base/ui/system/position/right.d.ts +0 -1
- package/dist/types/src/base/ui/system/position/right.d.ts.map +1 -1
- package/dist/types/src/base/ui/system/position/top.d.ts +0 -1
- package/dist/types/src/base/ui/system/position/top.d.ts.map +1 -1
- package/dist/types/src/base/ui/system/position/z_index.d.ts +0 -1
- package/dist/types/src/base/ui/system/position/z_index.d.ts.map +1 -1
- package/dist/types/src/base/ui/system/spacing/margin.d.ts +0 -1
- package/dist/types/src/base/ui/system/spacing/margin.d.ts.map +1 -1
- package/dist/types/src/base/ui/system/spacing/padding.d.ts +0 -1
- package/dist/types/src/base/ui/system/spacing/padding.d.ts.map +1 -1
- package/dist/types/src/base/ui/system/spacing/spacing_set.d.ts +0 -1
- package/dist/types/src/base/ui/system/spacing/spacing_set.d.ts.map +1 -1
- package/dist/types/src/base/ui/system/typography/font_family.d.ts +0 -1
- package/dist/types/src/base/ui/system/typography/font_family.d.ts.map +1 -1
- package/dist/types/src/base/ui/system/typography/font_size.d.ts +0 -1
- package/dist/types/src/base/ui/system/typography/font_size.d.ts.map +1 -1
- package/dist/types/src/base/ui/system/typography/font_style.d.ts +0 -1
- package/dist/types/src/base/ui/system/typography/font_style.d.ts.map +1 -1
- package/dist/types/src/base/ui/system/typography/font_weight.d.ts +0 -1
- package/dist/types/src/base/ui/system/typography/font_weight.d.ts.map +1 -1
- package/dist/types/src/base/ui/system/typography/letter_spacing.d.ts +0 -1
- package/dist/types/src/base/ui/system/typography/letter_spacing.d.ts.map +1 -1
- package/dist/types/src/base/ui/system/typography/line_height.d.ts +0 -1
- package/dist/types/src/base/ui/system/typography/line_height.d.ts.map +1 -1
- package/dist/types/src/base/ui/system/typography/text_align.d.ts +0 -1
- package/dist/types/src/base/ui/system/typography/text_align.d.ts.map +1 -1
- package/dist/types/src/base/ui/system/typography/text_color.d.ts +0 -1
- package/dist/types/src/base/ui/system/typography/text_color.d.ts.map +1 -1
- package/dist/types/src/base/ui/system/typography/text_decoration.d.ts +0 -1
- package/dist/types/src/base/ui/system/typography/text_decoration.d.ts.map +1 -1
- package/dist/types/src/base/ui/system/typography/text_transform.d.ts +0 -1
- package/dist/types/src/base/ui/system/typography/text_transform.d.ts.map +1 -1
- package/dist/types/src/base/ui/system/typography/typography_set.d.ts +0 -1
- package/dist/types/src/base/ui/system/typography/typography_set.d.ts.map +1 -1
- package/dist/types/src/base/ui/table_picker.d.ts +0 -21
- package/dist/types/src/base/ui/table_picker.d.ts.map +1 -1
- package/dist/types/src/base/ui/table_picker_synced.d.ts.map +1 -1
- package/dist/types/src/base/ui/text.d.ts +0 -3
- package/dist/types/src/base/ui/text.d.ts.map +1 -1
- package/dist/types/src/base/ui/text_button.d.ts +1 -5
- package/dist/types/src/base/ui/text_button.d.ts.map +1 -1
- package/dist/types/src/base/ui/theme/default_theme/index.d.ts +1 -1
- package/dist/types/src/base/ui/theme/theme_context.d.ts +1 -1
- package/dist/types/src/base/ui/theme/use_theme.d.ts +1 -1
- package/dist/types/src/base/ui/tooltip.d.ts +0 -16
- package/dist/types/src/base/ui/tooltip.d.ts.map +1 -1
- package/dist/types/src/base/ui/types/aria_props.d.ts.map +1 -1
- package/dist/types/src/base/ui/types/data_attributes_prop.d.ts +0 -4
- package/dist/types/src/base/ui/types/data_attributes_prop.d.ts.map +1 -1
- package/dist/types/src/base/ui/types/tooltip_anchor_props.d.ts +0 -7
- package/dist/types/src/base/ui/types/tooltip_anchor_props.d.ts.map +1 -1
- package/dist/types/src/base/ui/ui.d.ts +1 -0
- package/dist/types/src/base/ui/ui.d.ts.map +1 -1
- package/dist/types/src/base/ui/view_picker.d.ts +0 -23
- package/dist/types/src/base/ui/view_picker.d.ts.map +1 -1
- package/dist/types/src/base/ui/view_picker_synced.d.ts.map +1 -1
- package/dist/types/src/base/ui/viewport_constraint.d.ts +1 -14
- package/dist/types/src/base/ui/viewport_constraint.d.ts.map +1 -1
- package/dist/types/src/base/unstable_testing_utils.d.ts +1 -1
- package/dist/types/src/base/unstable_testing_utils.d.ts.map +1 -1
- package/dist/types/src/interface/assert_run_context.d.ts +2 -0
- package/dist/types/src/interface/assert_run_context.d.ts.map +1 -0
- package/dist/types/src/interface/index.d.ts +1 -6
- package/dist/types/src/interface/index.d.ts.map +1 -1
- package/dist/types/src/interface/models/models.d.ts +1 -0
- package/dist/types/src/interface/models/models.d.ts.map +1 -1
- package/dist/types/src/interface/models/mutations.d.ts.map +1 -1
- package/dist/types/src/interface/ui/initialize_block.d.ts.map +1 -1
- package/dist/types/src/interface/ui/ui.d.ts +1 -0
- package/dist/types/src/interface/ui/ui.d.ts.map +1 -1
- package/dist/types/src/interface/ui/use_custom_properties.d.ts +1 -1
- package/dist/types/src/shared/models/mutations_core.d.ts.map +1 -1
- package/dist/types/src/shared/private_utils.d.ts +0 -9
- package/dist/types/src/shared/private_utils.d.ts.map +1 -1
- package/dist/types/src/shared/ui/global_config_synced_component_helpers.d.ts +0 -2
- package/dist/types/src/shared/ui/global_config_synced_component_helpers.d.ts.map +1 -1
- package/dist/types/src/shared/ui/loader.d.ts.map +1 -1
- package/dist/types/src/shared/ui/with_hooks.d.ts +2 -2
- package/dist/types/src/shared/ui/with_hooks.d.ts.map +1 -1
- package/dist/types/src/testing/{abstract_mock_airtable_interface.d.ts → base/abstract_mock_airtable_interface.d.ts} +13 -13
- package/dist/types/src/testing/base/abstract_mock_airtable_interface.d.ts.map +1 -0
- package/dist/types/src/testing/interface/abstract_mock_airtable_interface.d.ts +51 -0
- package/dist/types/src/testing/interface/abstract_mock_airtable_interface.d.ts.map +1 -0
- package/package.json +13 -13
- package/dist/cjs/base/ui/system/utils/create_responsive_prop_type.js +0 -19
- package/dist/cjs/base/ui/system/utils/create_style_prop_types.js +0 -24
- package/dist/cjs/base/ui/system/utils/enum_prop_type_utils.js +0 -35
- package/dist/cjs/testing/abstract_mock_airtable_interface.js +0 -277
- package/dist/types/src/base/ui/system/utils/create_responsive_prop_type.d.ts +0 -2
- package/dist/types/src/base/ui/system/utils/create_responsive_prop_type.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/utils/create_style_prop_types.d.ts +0 -4
- package/dist/types/src/base/ui/system/utils/create_style_prop_types.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/utils/enum_prop_type_utils.d.ts +0 -21
- package/dist/types/src/base/ui/system/utils/enum_prop_type_utils.d.ts.map +0 -1
- package/dist/types/src/testing/abstract_mock_airtable_interface.d.ts.map +0 -1
|
@@ -1,21 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
require("core-js/modules/es.symbol.js");
|
|
4
|
-
require("core-js/modules/es.array.iterator.js");
|
|
5
|
-
require("core-js/modules/es.object.get-own-property-descriptors.js");
|
|
6
|
-
require("core-js/modules/es.weak-map.js");
|
|
7
|
-
require("core-js/modules/web.dom-collections.for-each.js");
|
|
8
|
-
require("core-js/modules/web.dom-collections.iterator.js");
|
|
9
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
10
3
|
Object.defineProperty(exports, "__esModule", {
|
|
11
4
|
value: true
|
|
12
5
|
});
|
|
13
|
-
exports.
|
|
14
|
-
require("core-js/modules/es.array.filter.js");
|
|
15
|
-
require("core-js/modules/es.object.to-string.js");
|
|
16
|
-
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
17
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
18
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
6
|
+
exports.default = exports.ValidInputType = exports.SupportedInputType = void 0;
|
|
19
7
|
var _emotion = require("emotion");
|
|
20
8
|
var React = _interopRequireWildcard(require("react"));
|
|
21
9
|
var _core = require("@styled-system/core");
|
|
@@ -24,26 +12,25 @@ var _use_theme = _interopRequireDefault(require("./theme/use_theme"));
|
|
|
24
12
|
var _use_styled_system = _interopRequireDefault(require("./use_styled_system"));
|
|
25
13
|
var _use_form_field = _interopRequireDefault(require("./use_form_field"));
|
|
26
14
|
var _system = require("./system");
|
|
27
|
-
var _tooltip_anchor_props = require("./types/tooltip_anchor_props");
|
|
28
15
|
var _control_sizes = require("./control_sizes");
|
|
29
|
-
|
|
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); }
|
|
16
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
17
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
32
18
|
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
|
-
|
|
34
|
-
|
|
19
|
+
/** @module @airtable/blocks/ui: Input */ /** */
|
|
20
|
+
|
|
35
21
|
/** @internal */
|
|
36
22
|
|
|
37
|
-
|
|
23
|
+
const InputVariant = (0, _private_utils.createEnum)('default');
|
|
38
24
|
|
|
39
25
|
/** @internal */
|
|
40
26
|
function useInputVariant() {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
inputVariants
|
|
27
|
+
let variant = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : InputVariant.default;
|
|
28
|
+
const {
|
|
29
|
+
inputVariants
|
|
30
|
+
} = (0, _use_theme.default)();
|
|
44
31
|
return inputVariants[variant];
|
|
45
32
|
}
|
|
46
|
-
|
|
33
|
+
const ValidInputType = exports.ValidInputType = (0, _private_utils.createEnum)('date', 'datetime-local', 'email', 'month', 'number', 'password', 'search', 'tel', 'text', 'time', 'url', 'week');
|
|
47
34
|
/** */
|
|
48
35
|
|
|
49
36
|
/**
|
|
@@ -58,8 +45,7 @@ var ValidInputType = exports.ValidInputType = (0, _private_utils.createEnum)('da
|
|
|
58
45
|
* @noInheritDoc
|
|
59
46
|
*/
|
|
60
47
|
|
|
61
|
-
|
|
62
|
-
var inputStylePropTypes = exports.inputStylePropTypes = _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({}, _system.maxWidthPropTypes), _system.minWidthPropTypes), _system.widthPropTypes), _system.flexItemSetPropTypes), _system.positionSetPropTypes), _system.marginPropTypes);
|
|
48
|
+
const styleParser = (0, _core.compose)(_system.maxWidth, _system.minWidth, _system.width, _system.flexItemSet, _system.positionSet, _system.margin);
|
|
63
49
|
|
|
64
50
|
/**
|
|
65
51
|
* Props shared between the {@link Input} and {@link InputSynced} components.
|
|
@@ -67,38 +53,11 @@ var inputStylePropTypes = exports.inputStylePropTypes = _objectSpread(_objectSpr
|
|
|
67
53
|
* @noInheritDoc
|
|
68
54
|
*/
|
|
69
55
|
|
|
70
|
-
|
|
56
|
+
const SupportedInputType = exports.SupportedInputType = (0, _private_utils.createEnum)('date', 'datetime-local', 'email', 'month', 'number', 'password', 'search', 'tel', 'text', 'time', 'url', 'week');
|
|
71
57
|
/**
|
|
72
58
|
* Supported types for the {@link Input} component. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#%3Cinput%3E_types) for more information.
|
|
73
59
|
*/
|
|
74
60
|
|
|
75
|
-
// Shared with `Input` and `InputSynced`.
|
|
76
|
-
var sharedInputPropTypes = exports.sharedInputPropTypes = _objectSpread(_objectSpread({
|
|
77
|
-
size: _control_sizes.controlSizePropType,
|
|
78
|
-
type: (0, _enum_prop_type_utils.createPropTypeFromEnum)(SupportedInputType),
|
|
79
|
-
placeholder: _propTypes.default.string,
|
|
80
|
-
disabled: _propTypes.default.bool,
|
|
81
|
-
required: _propTypes.default.bool,
|
|
82
|
-
spellCheck: _propTypes.default.bool,
|
|
83
|
-
tabIndex: _propTypes.default.oneOfType([_propTypes.default.number]),
|
|
84
|
-
autoFocus: _propTypes.default.bool,
|
|
85
|
-
max: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]),
|
|
86
|
-
maxLength: _propTypes.default.number,
|
|
87
|
-
min: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]),
|
|
88
|
-
minLength: _propTypes.default.number,
|
|
89
|
-
step: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]),
|
|
90
|
-
pattern: _propTypes.default.string,
|
|
91
|
-
readOnly: _propTypes.default.bool,
|
|
92
|
-
autoComplete: _propTypes.default.string,
|
|
93
|
-
onChange: _propTypes.default.func,
|
|
94
|
-
onBlur: _propTypes.default.func,
|
|
95
|
-
onFocus: _propTypes.default.func,
|
|
96
|
-
style: _propTypes.default.object,
|
|
97
|
-
className: _propTypes.default.string,
|
|
98
|
-
'aria-labelledby': _propTypes.default.string,
|
|
99
|
-
'aria-describedby': _propTypes.default.string
|
|
100
|
-
}, inputStylePropTypes), _tooltip_anchor_props.tooltipAnchorPropTypes);
|
|
101
|
-
|
|
102
61
|
/**
|
|
103
62
|
* Props for the {@link Input} component. Also accepts:
|
|
104
63
|
* * {@link InputStyleProps}
|
|
@@ -114,50 +73,55 @@ var sharedInputPropTypes = exports.sharedInputPropTypes = _objectSpread(_objectS
|
|
|
114
73
|
* @docsPath UI/components/Input
|
|
115
74
|
* @component
|
|
116
75
|
*/
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
size =
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
76
|
+
const Input = (props, ref) => {
|
|
77
|
+
const {
|
|
78
|
+
size = _control_sizes.ControlSize.default,
|
|
79
|
+
type = SupportedInputType.text,
|
|
80
|
+
value,
|
|
81
|
+
placeholder,
|
|
82
|
+
onMouseEnter,
|
|
83
|
+
onMouseLeave,
|
|
84
|
+
onClick,
|
|
85
|
+
// This hasOnClick prop is set by the Tooltip wrapper. Destructure it here just to get it out of `props`.
|
|
86
|
+
// See 7a80fefd0a0bc871c31e0c063662c6100b0ca77d
|
|
87
|
+
// TODO(stephen): clean this up.
|
|
88
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
89
|
+
hasOnClick,
|
|
90
|
+
onChange,
|
|
91
|
+
onBlur,
|
|
92
|
+
onFocus,
|
|
93
|
+
style,
|
|
94
|
+
className,
|
|
95
|
+
disabled,
|
|
96
|
+
required,
|
|
97
|
+
spellCheck,
|
|
98
|
+
tabIndex,
|
|
99
|
+
id,
|
|
100
|
+
name,
|
|
101
|
+
autoFocus,
|
|
102
|
+
max,
|
|
103
|
+
maxLength,
|
|
104
|
+
min,
|
|
105
|
+
minLength,
|
|
106
|
+
step,
|
|
107
|
+
pattern,
|
|
108
|
+
readOnly,
|
|
109
|
+
autoComplete,
|
|
110
|
+
'aria-labelledby': ariaLabelledBy,
|
|
111
|
+
'aria-describedby': ariaDescribedByProp,
|
|
112
|
+
...styleProps
|
|
113
|
+
} = props;
|
|
114
|
+
const formFieldContextValue = (0, _use_form_field.default)();
|
|
115
|
+
const controlId = formFieldContextValue ? formFieldContextValue.controlId : undefined;
|
|
116
|
+
const descriptionId = formFieldContextValue ? formFieldContextValue.descriptionId : undefined;
|
|
117
|
+
const ariaDescribedBy = [ariaDescribedByProp, descriptionId].filter(Boolean).join(' ') || undefined;
|
|
155
118
|
// There is only a single default variant.
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
width: '100%'
|
|
160
|
-
|
|
119
|
+
const classNameForInputVariant = useInputVariant();
|
|
120
|
+
const classNameForInputSize = (0, _control_sizes.useInputSize)(size);
|
|
121
|
+
const classNameForStyleProps = (0, _use_styled_system.default)({
|
|
122
|
+
width: '100%',
|
|
123
|
+
...styleProps
|
|
124
|
+
}, styleParser);
|
|
161
125
|
return /*#__PURE__*/React.createElement("input", {
|
|
162
126
|
ref: ref,
|
|
163
127
|
value: value,
|
|
@@ -192,9 +156,6 @@ var Input = (props, ref) => {
|
|
|
192
156
|
"aria-describedby": ariaDescribedBy
|
|
193
157
|
});
|
|
194
158
|
};
|
|
195
|
-
|
|
196
|
-
ForwardedRefInput.propTypes = _objectSpread({
|
|
197
|
-
value: _propTypes.default.string.isRequired
|
|
198
|
-
}, sharedInputPropTypes);
|
|
159
|
+
const ForwardedRefInput = /*#__PURE__*/React.forwardRef(Input);
|
|
199
160
|
ForwardedRefInput.displayName = 'Input';
|
|
200
161
|
var _default = exports.default = ForwardedRefInput;
|
|
@@ -1,34 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
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");
|
|
11
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
12
3
|
Object.defineProperty(exports, "__esModule", {
|
|
13
4
|
value: true
|
|
14
5
|
});
|
|
15
6
|
exports.default = void 0;
|
|
16
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
17
|
-
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
18
|
-
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
19
|
-
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
20
7
|
var React = _interopRequireWildcard(require("react"));
|
|
21
8
|
var _error_utils = require("../../shared/error_utils");
|
|
22
9
|
var _use_synced = _interopRequireDefault(require("../../shared/ui/use_synced"));
|
|
23
|
-
var _global_config_synced_component_helpers = _interopRequireDefault(require("../../shared/ui/global_config_synced_component_helpers"));
|
|
24
10
|
var _input = _interopRequireWildcard(require("./input"));
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
/** */
|
|
28
|
-
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); }
|
|
11
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
12
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
29
13
|
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; }
|
|
30
|
-
function
|
|
31
|
-
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; }
|
|
14
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); } /** @module @airtable/blocks/ui: Input */ /** */
|
|
32
15
|
/**
|
|
33
16
|
* Props for the {@link InputSynced} component. Also accepts:
|
|
34
17
|
* * {@link InputStyleProps}
|
|
@@ -46,19 +29,16 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
46
29
|
* @groupPath UI/components/Input
|
|
47
30
|
* @component
|
|
48
31
|
*/
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
type =
|
|
53
|
-
disabled
|
|
54
|
-
|
|
55
|
-
restOfProps
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
setValue = _useSynced2[1],
|
|
60
|
-
canSetValue = _useSynced2[2];
|
|
61
|
-
var inputValue;
|
|
32
|
+
const InputSynced = (props, ref) => {
|
|
33
|
+
const {
|
|
34
|
+
globalConfigKey,
|
|
35
|
+
type = _input.SupportedInputType.text,
|
|
36
|
+
disabled,
|
|
37
|
+
onChange,
|
|
38
|
+
...restOfProps
|
|
39
|
+
} = props;
|
|
40
|
+
const [value, setValue, canSetValue] = (0, _use_synced.default)(globalConfigKey);
|
|
41
|
+
let inputValue;
|
|
62
42
|
if (value === null || value === undefined) {
|
|
63
43
|
// If an input gets null or undefined for value, React treats it as uncontrolled
|
|
64
44
|
// and will throw warnings when it becomes controlled.
|
|
@@ -68,22 +48,19 @@ var InputSynced = (props, ref) => {
|
|
|
68
48
|
} else {
|
|
69
49
|
throw (0, _error_utils.spawnError)('InputSynced only works with a global config value that is a string, null or undefined.');
|
|
70
50
|
}
|
|
71
|
-
return /*#__PURE__*/React.createElement(_input.default, (
|
|
51
|
+
return /*#__PURE__*/React.createElement(_input.default, _extends({}, restOfProps, {
|
|
72
52
|
ref: ref,
|
|
73
53
|
disabled: disabled || !canSetValue,
|
|
74
54
|
onChange: e => {
|
|
75
55
|
setValue(e.target.value);
|
|
76
|
-
if (
|
|
77
|
-
|
|
56
|
+
if (onChange) {
|
|
57
|
+
onChange(e);
|
|
78
58
|
}
|
|
79
59
|
},
|
|
80
60
|
value: inputValue,
|
|
81
61
|
type: type
|
|
82
62
|
}));
|
|
83
63
|
};
|
|
84
|
-
|
|
85
|
-
ForwardedRefInputSynced.propTypes = _objectSpread({
|
|
86
|
-
globalConfigKey: _global_config_synced_component_helpers.default.globalConfigKeyPropType
|
|
87
|
-
}, _input.sharedInputPropTypes);
|
|
64
|
+
const ForwardedRefInputSynced = /*#__PURE__*/React.forwardRef(InputSynced);
|
|
88
65
|
ForwardedRefInputSynced.displayName = 'InputSynced';
|
|
89
66
|
var _default = exports.default = ForwardedRefInputSynced;
|
|
@@ -5,11 +5,10 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.KeyCodes = void 0;
|
|
7
7
|
exports.isCommandModifierKeyEvent = isCommandModifierKeyEvent;
|
|
8
|
-
require("core-js/modules/es.array.index-of.js");
|
|
9
8
|
/**
|
|
10
9
|
* @internal
|
|
11
10
|
*/
|
|
12
|
-
|
|
11
|
+
const KeyCodes = exports.KeyCodes = Object.freeze({
|
|
13
12
|
BACKSPACE: 8,
|
|
14
13
|
TAB: 9,
|
|
15
14
|
ENTER: 13,
|
|
@@ -65,7 +64,7 @@ var KeyCodes = exports.KeyCodes = Object.freeze({
|
|
|
65
64
|
* OS-aware check for command/ctrl key.
|
|
66
65
|
*/
|
|
67
66
|
function isCommandModifierKeyEvent(e) {
|
|
68
|
-
|
|
67
|
+
const isMac = window.navigator.platform.toLowerCase().indexOf('mac') !== -1;
|
|
69
68
|
if (isMac) {
|
|
70
69
|
return e.metaKey;
|
|
71
70
|
} else {
|
|
@@ -1,36 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
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");
|
|
11
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
12
3
|
Object.defineProperty(exports, "__esModule", {
|
|
13
4
|
value: true
|
|
14
5
|
});
|
|
15
6
|
exports.default = void 0;
|
|
16
|
-
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
17
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
18
|
-
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
19
7
|
var React = _interopRequireWildcard(require("react"));
|
|
20
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
21
8
|
var _emotion = require("emotion");
|
|
22
9
|
var _use_styled_system = _interopRequireDefault(require("./use_styled_system"));
|
|
23
10
|
var _index = require("./system/index");
|
|
24
|
-
var _aria_props = require("./types/aria_props");
|
|
25
11
|
var _text = require("./text");
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
/** @module @airtable/blocks/ui: Label */
|
|
29
|
-
/** */
|
|
30
|
-
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
12
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
13
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
31
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; }
|
|
32
|
-
function
|
|
33
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
15
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); } /** @module @airtable/blocks/ui: Label */ /** */
|
|
34
16
|
/**
|
|
35
17
|
* Props for the {@link Label} component. Also accepts:
|
|
36
18
|
* * {@link AllStylesProps}
|
|
@@ -48,33 +30,35 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
48
30
|
* @docsPath UI/components/Label
|
|
49
31
|
* @component
|
|
50
32
|
*/
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
size =
|
|
54
|
-
htmlFor
|
|
55
|
-
id
|
|
56
|
-
children
|
|
57
|
-
className
|
|
58
|
-
style
|
|
59
|
-
dataAttributes
|
|
60
|
-
role
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
styleProps
|
|
70
|
-
|
|
71
|
-
|
|
33
|
+
const Label = (props, ref) => {
|
|
34
|
+
const {
|
|
35
|
+
size = _text.TextSize.default,
|
|
36
|
+
htmlFor,
|
|
37
|
+
id,
|
|
38
|
+
children,
|
|
39
|
+
className,
|
|
40
|
+
style,
|
|
41
|
+
dataAttributes,
|
|
42
|
+
role,
|
|
43
|
+
'aria-label': ariaLabel,
|
|
44
|
+
'aria-labelledby': ariaLabelledBy,
|
|
45
|
+
'aria-describedby': ariaDescribedBy,
|
|
46
|
+
'aria-controls': ariaControls,
|
|
47
|
+
'aria-expanded': ariaExpanded,
|
|
48
|
+
'aria-haspopup': ariaHasPopup,
|
|
49
|
+
'aria-hidden': ariaHidden,
|
|
50
|
+
'aria-live': ariaLive,
|
|
51
|
+
...styleProps
|
|
52
|
+
} = props;
|
|
53
|
+
const classNameForTextStyle = (0, _text.useTextStyle)(size);
|
|
54
|
+
const classNameForStyleProps = (0, _use_styled_system.default)({
|
|
72
55
|
display: 'inline-block',
|
|
73
56
|
textColor: 'light',
|
|
74
57
|
fontWeight: 'strong',
|
|
75
|
-
marginBottom: '6px'
|
|
76
|
-
|
|
77
|
-
|
|
58
|
+
marginBottom: '6px',
|
|
59
|
+
...styleProps
|
|
60
|
+
}, _index.allStylesParser);
|
|
61
|
+
return /*#__PURE__*/React.createElement("label", _extends({
|
|
78
62
|
ref: ref,
|
|
79
63
|
htmlFor: htmlFor,
|
|
80
64
|
id: id,
|
|
@@ -91,15 +75,6 @@ var Label = (props, ref) => {
|
|
|
91
75
|
"aria-live": ariaLive
|
|
92
76
|
}, dataAttributes), children);
|
|
93
77
|
};
|
|
94
|
-
|
|
95
|
-
ForwardedRefLabel.propTypes = _objectSpread(_objectSpread({
|
|
96
|
-
size: _text.textSizePropType,
|
|
97
|
-
htmlFor: _propTypes.default.string,
|
|
98
|
-
id: _propTypes.default.string,
|
|
99
|
-
dataAttributes: _data_attributes_prop.dataAttributesPropType,
|
|
100
|
-
children: _propTypes.default.node,
|
|
101
|
-
className: _propTypes.default.string,
|
|
102
|
-
style: _propTypes.default.object
|
|
103
|
-
}, _index.allStylesPropTypes), _aria_props.ariaPropTypes);
|
|
78
|
+
const ForwardedRefLabel = /*#__PURE__*/React.forwardRef(Label);
|
|
104
79
|
ForwardedRefLabel.displayName = 'Label';
|
|
105
80
|
var _default = exports.default = ForwardedRefLabel;
|