@airtable/blocks 1.18.1 → 1.19.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +15 -1
- package/dist/cjs/color_utils.js +21 -23
- package/dist/cjs/colors.js +4 -60
- package/dist/cjs/error_utils.js +15 -25
- package/dist/cjs/event_tracker.js +5 -11
- package/dist/cjs/global_config.js +107 -188
- package/dist/cjs/index.js +16 -40
- package/dist/cjs/injected/airtable_interface.js +1 -6
- package/dist/cjs/models/abstract_model.js +50 -81
- package/dist/cjs/models/abstract_model_with_async_data.js +102 -177
- package/dist/cjs/models/base.js +211 -374
- package/dist/cjs/models/create_aggregators.js +53 -47
- package/dist/cjs/models/cursor.js +125 -201
- package/dist/cjs/models/field.js +256 -303
- package/dist/cjs/models/grouped_record_query_result.js +210 -286
- package/dist/cjs/models/linked_records_query_result.js +276 -454
- package/dist/cjs/models/models.js +36 -50
- package/dist/cjs/models/mutation_constants.js +5 -9
- package/dist/cjs/models/mutations.js +125 -338
- package/dist/cjs/models/object_pool.js +37 -94
- package/dist/cjs/models/record.js +132 -226
- package/dist/cjs/models/record_coloring.js +14 -19
- package/dist/cjs/models/record_query_result.js +323 -282
- package/dist/cjs/models/record_store.js +355 -688
- package/dist/cjs/models/session.js +99 -158
- package/dist/cjs/models/table.js +361 -549
- package/dist/cjs/models/table_or_view_query_result.js +410 -765
- package/dist/cjs/models/view.js +161 -204
- package/dist/cjs/models/view_data_store.js +177 -282
- package/dist/cjs/models/view_metadata_query_result.js +96 -127
- package/dist/cjs/perform_record_action.js +69 -103
- package/dist/cjs/private_utils.js +133 -223
- package/dist/cjs/sdk.js +97 -142
- package/dist/cjs/settings_button.js +30 -57
- package/dist/cjs/stats/block_stats.js +3 -15
- package/dist/cjs/testing/abstract_mock_airtable_interface.js +53 -97
- package/dist/cjs/types/airtable_interface.js +36 -8
- package/dist/cjs/types/field.js +66 -12
- package/dist/cjs/types/mutations.js +99 -6
- package/dist/cjs/types/permission_levels.js +2 -4
- package/dist/cjs/types/undo_redo.js +2 -3
- package/dist/cjs/types/view.js +16 -11
- package/dist/cjs/ui/base_provider.js +14 -9
- package/dist/cjs/ui/baymax_utils.js +107 -1102
- package/dist/cjs/ui/block_wrapper.js +30 -68
- package/dist/cjs/ui/box.js +52 -56
- package/dist/cjs/ui/button.js +60 -77
- package/dist/cjs/ui/cell_renderer.js +78 -139
- package/dist/cjs/ui/choice_token.js +45 -47
- package/dist/cjs/ui/collaborator_token.js +33 -54
- package/dist/cjs/ui/color_palette.js +58 -106
- package/dist/cjs/ui/color_palette_synced.js +41 -52
- package/dist/cjs/ui/confirmation_dialog.js +53 -69
- package/dist/cjs/ui/control_sizes.js +21 -46
- package/dist/cjs/ui/create_detect_element_resize.js +16 -50
- package/dist/cjs/ui/css_helpers.js +3 -10
- package/dist/cjs/ui/dialog.js +44 -71
- package/dist/cjs/ui/dialog_close_button.js +52 -72
- package/dist/cjs/ui/expand_record.js +4 -11
- package/dist/cjs/ui/expand_record_list.js +6 -11
- package/dist/cjs/ui/expand_record_picker_async.js +18 -35
- package/dist/cjs/ui/field_icon.js +25 -28
- package/dist/cjs/ui/field_picker.js +47 -81
- package/dist/cjs/ui/field_picker_synced.js +33 -44
- package/dist/cjs/ui/form_field.js +45 -64
- package/dist/cjs/ui/geometry/geometry.js +6 -10
- package/dist/cjs/ui/geometry/point.js +5 -13
- package/dist/cjs/ui/geometry/rect.js +7 -29
- package/dist/cjs/ui/geometry/size.js +5 -13
- package/dist/cjs/ui/global_alert.js +35 -61
- package/dist/cjs/ui/global_config_synced_component_helpers.js +4 -13
- package/dist/cjs/ui/heading.js +63 -92
- package/dist/cjs/ui/icon.js +44 -66
- package/dist/cjs/ui/icon_config.js +13 -24
- package/dist/cjs/ui/initialize_block.js +23 -36
- package/dist/cjs/ui/input.js +74 -87
- package/dist/cjs/ui/input_synced.js +34 -43
- package/dist/cjs/ui/key_codes.js +4 -9
- package/dist/cjs/ui/label.js +45 -50
- package/dist/cjs/ui/link.js +74 -89
- package/dist/cjs/ui/loader.js +26 -42
- package/dist/cjs/ui/modal.js +63 -89
- package/dist/cjs/ui/model_picker_select.js +29 -47
- package/dist/cjs/ui/popover.js +98 -180
- package/dist/cjs/ui/progress_bar.js +45 -51
- package/dist/cjs/ui/record_card.js +143 -278
- package/dist/cjs/ui/record_card_list.js +117 -165
- package/dist/cjs/ui/remote_utils.js +5 -13
- package/dist/cjs/ui/sdk_context.js +7 -9
- package/dist/cjs/ui/select.js +84 -118
- package/dist/cjs/ui/select_and_select_buttons_helpers.js +29 -45
- package/dist/cjs/ui/select_buttons.js +54 -90
- package/dist/cjs/ui/select_buttons_synced.js +32 -41
- package/dist/cjs/ui/select_synced.js +32 -42
- package/dist/cjs/ui/switch.js +66 -84
- package/dist/cjs/ui/switch_synced.js +32 -38
- package/dist/cjs/ui/synced.js +16 -43
- package/dist/cjs/ui/system/all_styles_set.js +89 -22
- package/dist/cjs/ui/system/appearance/appearance_set.js +15 -26
- package/dist/cjs/ui/system/appearance/background_color.js +6 -12
- package/dist/cjs/ui/system/appearance/border.js +6 -12
- package/dist/cjs/ui/system/appearance/border_radius.js +6 -12
- package/dist/cjs/ui/system/appearance/box_shadow.js +6 -12
- package/dist/cjs/ui/system/appearance/opacity.js +5 -11
- package/dist/cjs/ui/system/dimensions/dimensions_set.js +15 -27
- package/dist/cjs/ui/system/dimensions/height.js +5 -11
- package/dist/cjs/ui/system/dimensions/max_height.js +5 -11
- package/dist/cjs/ui/system/dimensions/max_width.js +5 -11
- package/dist/cjs/ui/system/dimensions/min_height.js +5 -11
- package/dist/cjs/ui/system/dimensions/min_width.js +5 -11
- package/dist/cjs/ui/system/dimensions/width.js +5 -11
- package/dist/cjs/ui/system/display.js +8 -9
- package/dist/cjs/ui/system/flex_container/align_content.js +6 -12
- package/dist/cjs/ui/system/flex_container/align_items.js +6 -12
- package/dist/cjs/ui/system/flex_container/flex_container_set.js +15 -27
- package/dist/cjs/ui/system/flex_container/flex_direction.js +5 -11
- package/dist/cjs/ui/system/flex_container/flex_wrap.js +5 -11
- package/dist/cjs/ui/system/flex_container/justify_content.js +5 -11
- package/dist/cjs/ui/system/flex_container/justify_items.js +5 -11
- package/dist/cjs/ui/system/flex_item/align_self.js +6 -12
- package/dist/cjs/ui/system/flex_item/flex.js +5 -11
- package/dist/cjs/ui/system/flex_item/flex_basis.js +5 -11
- package/dist/cjs/ui/system/flex_item/flex_grow.js +5 -11
- package/dist/cjs/ui/system/flex_item/flex_item_set.js +15 -28
- package/dist/cjs/ui/system/flex_item/flex_shrink.js +5 -11
- package/dist/cjs/ui/system/flex_item/justify_self.js +5 -11
- package/dist/cjs/ui/system/flex_item/order.js +5 -11
- package/dist/cjs/ui/system/index.js +310 -362
- package/dist/cjs/ui/system/overflow.js +8 -9
- package/dist/cjs/ui/system/position/bottom.js +6 -13
- package/dist/cjs/ui/system/position/left.js +5 -12
- package/dist/cjs/ui/system/position/position.js +5 -11
- package/dist/cjs/ui/system/position/position_set.js +15 -27
- package/dist/cjs/ui/system/position/right.js +5 -12
- package/dist/cjs/ui/system/position/top.js +5 -12
- package/dist/cjs/ui/system/position/z_index.js +5 -11
- package/dist/cjs/ui/system/spacing/margin.js +5 -12
- package/dist/cjs/ui/system/spacing/padding.js +5 -12
- package/dist/cjs/ui/system/spacing/spacing_set.js +15 -23
- package/dist/cjs/ui/system/typography/font_family.js +5 -11
- package/dist/cjs/ui/system/typography/font_size.js +5 -11
- package/dist/cjs/ui/system/typography/font_style.js +5 -11
- package/dist/cjs/ui/system/typography/font_weight.js +5 -11
- package/dist/cjs/ui/system/typography/letter_spacing.js +5 -11
- package/dist/cjs/ui/system/typography/line_height.js +5 -11
- package/dist/cjs/ui/system/typography/text_align.js +5 -11
- package/dist/cjs/ui/system/typography/text_color.js +5 -11
- package/dist/cjs/ui/system/typography/text_decoration.js +5 -11
- package/dist/cjs/ui/system/typography/text_transform.js +5 -11
- package/dist/cjs/ui/system/typography/typography_set.js +15 -31
- package/dist/cjs/ui/system/utils/create_responsive_prop_type.js +2 -4
- package/dist/cjs/ui/system/utils/create_style_prop_types.js +5 -13
- package/dist/cjs/ui/system/utils/ensure_numbers_are_within_scale.js +4 -14
- package/dist/cjs/ui/system/utils/get_style_props_for_responsive_prop.js +30 -70
- package/dist/cjs/ui/table_picker.js +26 -43
- package/dist/cjs/ui/table_picker_synced.js +33 -42
- package/dist/cjs/ui/text.js +59 -71
- package/dist/cjs/ui/text_button.js +80 -97
- package/dist/cjs/ui/theme/default_theme/button_variants.js +1 -5
- package/dist/cjs/ui/theme/default_theme/control_sizes.js +29 -42
- package/dist/cjs/ui/theme/default_theme/heading_styles.js +4 -5
- package/dist/cjs/ui/theme/default_theme/index.js +15 -32
- package/dist/cjs/ui/theme/default_theme/input_variants.js +1 -5
- package/dist/cjs/ui/theme/default_theme/link_variants.js +1 -5
- package/dist/cjs/ui/theme/default_theme/select_buttons_variants.js +1 -5
- package/dist/cjs/ui/theme/default_theme/select_variants.js +10 -21
- package/dist/cjs/ui/theme/default_theme/switch_variants.js +8 -20
- package/dist/cjs/ui/theme/default_theme/text_button_variants.js +1 -5
- package/dist/cjs/ui/theme/default_theme/text_styles.js +1 -2
- package/dist/cjs/ui/theme/default_theme/tokens.js +33 -35
- package/dist/cjs/ui/theme/theme_context.js +3 -6
- package/dist/cjs/ui/theme/use_theme.js +1 -7
- package/dist/cjs/ui/tooltip.js +38 -79
- package/dist/cjs/ui/types/aria_props.js +3 -7
- package/dist/cjs/ui/types/data_attributes_prop.js +8 -6
- package/dist/cjs/ui/types/tooltip_anchor_props.js +4 -5
- package/dist/cjs/ui/ui.js +97 -130
- package/dist/cjs/ui/unstable_standalone_ui.js +18 -42
- package/dist/cjs/ui/use_array_identity.js +0 -4
- package/dist/cjs/ui/use_base.js +4 -13
- package/dist/cjs/ui/use_color_scheme.js +60 -0
- package/dist/cjs/ui/use_cursor.js +3 -12
- package/dist/cjs/ui/use_form_field.js +4 -6
- package/dist/cjs/ui/use_global_config.js +3 -10
- package/dist/cjs/ui/use_loadable.js +59 -132
- package/dist/cjs/ui/use_record_action_data.js +6 -12
- package/dist/cjs/ui/use_records.js +27 -28
- package/dist/cjs/ui/use_session.js +6 -15
- package/dist/cjs/ui/use_settings_button.js +4 -11
- package/dist/cjs/ui/use_styled_system.js +12 -21
- package/dist/cjs/ui/use_synced.js +0 -7
- package/dist/cjs/ui/use_text_color_for_background_color.js +1 -5
- package/dist/cjs/ui/use_view_metadata.js +5 -8
- package/dist/cjs/ui/use_viewport.js +1 -7
- package/dist/cjs/ui/use_watchable.js +36 -74
- package/dist/cjs/ui/view_picker.js +44 -78
- package/dist/cjs/ui/view_picker_synced.js +33 -44
- package/dist/cjs/ui/viewport_constraint.js +37 -64
- package/dist/cjs/ui/with_hooks.js +17 -22
- package/dist/cjs/ui/with_styled_system.js +33 -60
- package/dist/cjs/undo_redo.js +12 -32
- package/dist/cjs/unstable_private_utils.js +6 -8
- package/dist/cjs/unstable_testing_utils.js +44 -57
- package/dist/cjs/viewport.js +127 -189
- package/dist/cjs/warning.js +5 -6
- package/dist/cjs/watchable.js +66 -148
- package/dist/types/src/colors.d.ts +1 -1
- package/dist/types/src/colors.d.ts.map +1 -1
- package/dist/types/src/global_config.d.ts +1 -1
- package/dist/types/src/global_config.d.ts.map +1 -1
- package/dist/types/src/models/base.d.ts +1 -1
- package/dist/types/src/models/base.d.ts.map +1 -1
- package/dist/types/src/models/cursor.d.ts +1 -1
- package/dist/types/src/models/cursor.d.ts.map +1 -1
- package/dist/types/src/models/field.d.ts +1 -1
- package/dist/types/src/models/field.d.ts.map +1 -1
- package/dist/types/src/models/linked_records_query_result.d.ts.map +1 -1
- package/dist/types/src/models/models.d.ts.map +1 -1
- package/dist/types/src/models/record.d.ts +1 -1
- package/dist/types/src/models/record.d.ts.map +1 -1
- package/dist/types/src/models/record_coloring.d.ts +2 -2
- package/dist/types/src/models/record_coloring.d.ts.map +1 -1
- package/dist/types/src/models/record_query_result.d.ts +3 -3
- package/dist/types/src/models/record_query_result.d.ts.map +1 -1
- package/dist/types/src/models/session.d.ts +1 -1
- package/dist/types/src/models/session.d.ts.map +1 -1
- package/dist/types/src/models/table.d.ts +1 -1
- package/dist/types/src/models/table.d.ts.map +1 -1
- package/dist/types/src/models/view.d.ts +1 -1
- package/dist/types/src/models/view.d.ts.map +1 -1
- package/dist/types/src/models/view_metadata_query_result.d.ts +2 -2
- package/dist/types/src/models/view_metadata_query_result.d.ts.map +1 -1
- package/dist/types/src/perform_record_action.d.ts +1 -1
- package/dist/types/src/perform_record_action.d.ts.map +1 -1
- package/dist/types/src/private_utils.d.ts +8 -8
- package/dist/types/src/private_utils.d.ts.map +1 -1
- package/dist/types/src/sdk.d.ts +1 -1
- package/dist/types/src/sdk.d.ts.map +1 -1
- package/dist/types/src/settings_button.d.ts +1 -1
- package/dist/types/src/settings_button.d.ts.map +1 -1
- package/dist/types/src/types/aggregators.d.ts +1 -1
- package/dist/types/src/types/aggregators.d.ts.map +1 -1
- package/dist/types/src/types/airtable_interface.d.ts +6 -6
- package/dist/types/src/types/airtable_interface.d.ts.map +1 -1
- package/dist/types/src/types/attachment.d.ts +1 -1
- package/dist/types/src/types/attachment.d.ts.map +1 -1
- package/dist/types/src/types/base.d.ts +1 -1
- package/dist/types/src/types/base.d.ts.map +1 -1
- package/dist/types/src/types/block.d.ts +1 -1
- package/dist/types/src/types/block.d.ts.map +1 -1
- package/dist/types/src/types/collaborator.d.ts +1 -1
- package/dist/types/src/types/collaborator.d.ts.map +1 -1
- package/dist/types/src/types/field.d.ts +5 -5
- package/dist/types/src/types/field.d.ts.map +1 -1
- package/dist/types/src/types/global_config.d.ts +6 -6
- package/dist/types/src/types/global_config.d.ts.map +1 -1
- package/dist/types/src/types/mutations.d.ts +4 -4
- package/dist/types/src/types/mutations.d.ts.map +1 -1
- package/dist/types/src/types/permission_levels.d.ts +1 -1
- package/dist/types/src/types/permission_levels.d.ts.map +1 -1
- package/dist/types/src/types/record.d.ts +2 -2
- package/dist/types/src/types/record.d.ts.map +1 -1
- package/dist/types/src/types/record_action_data.d.ts +1 -1
- package/dist/types/src/types/record_action_data.d.ts.map +1 -1
- package/dist/types/src/types/table.d.ts +3 -3
- package/dist/types/src/types/table.d.ts.map +1 -1
- package/dist/types/src/types/undo_redo.d.ts +1 -1
- package/dist/types/src/types/undo_redo.d.ts.map +1 -1
- package/dist/types/src/types/view.d.ts +4 -4
- package/dist/types/src/types/view.d.ts.map +1 -1
- package/dist/types/src/ui/base_provider.d.ts +1 -1
- package/dist/types/src/ui/base_provider.d.ts.map +1 -1
- package/dist/types/src/ui/block_wrapper.d.ts +2 -2
- package/dist/types/src/ui/button.d.ts +2 -2
- package/dist/types/src/ui/button.d.ts.map +1 -1
- package/dist/types/src/ui/cell_renderer.d.ts +2 -2
- package/dist/types/src/ui/choice_token.d.ts +4 -4
- package/dist/types/src/ui/choice_token.d.ts.map +1 -1
- package/dist/types/src/ui/collaborator_token.d.ts +6 -6
- package/dist/types/src/ui/collaborator_token.d.ts.map +1 -1
- package/dist/types/src/ui/color_palette.d.ts +3 -3
- package/dist/types/src/ui/color_palette.d.ts.map +1 -1
- package/dist/types/src/ui/color_palette_synced.d.ts +2 -2
- package/dist/types/src/ui/confirmation_dialog.d.ts +1 -1
- package/dist/types/src/ui/control_sizes.d.ts +2 -2
- package/dist/types/src/ui/control_sizes.d.ts.map +1 -1
- package/dist/types/src/ui/dialog.d.ts +2 -2
- package/dist/types/src/ui/dialog.d.ts.map +1 -1
- package/dist/types/src/ui/dialog_close_button.d.ts +1 -1
- package/dist/types/src/ui/field_icon.d.ts +3 -3
- package/dist/types/src/ui/field_icon.d.ts.map +1 -1
- package/dist/types/src/ui/field_picker.d.ts +2 -2
- package/dist/types/src/ui/field_picker.d.ts.map +1 -1
- package/dist/types/src/ui/form_field.d.ts +1 -1
- package/dist/types/src/ui/form_field.d.ts.map +1 -1
- package/dist/types/src/ui/global_alert.d.ts +1 -1
- package/dist/types/src/ui/global_alert.d.ts.map +1 -1
- package/dist/types/src/ui/global_config_synced_component_helpers.d.ts +1 -1
- package/dist/types/src/ui/global_config_synced_component_helpers.d.ts.map +1 -1
- package/dist/types/src/ui/heading.d.ts +4 -4
- package/dist/types/src/ui/heading.d.ts.map +1 -1
- package/dist/types/src/ui/icon.d.ts +2 -2
- package/dist/types/src/ui/icon.d.ts.map +1 -1
- package/dist/types/src/ui/icon_config.d.ts +39 -39
- package/dist/types/src/ui/icon_config.d.ts.map +1 -1
- package/dist/types/src/ui/initialize_block.d.ts +3 -3
- package/dist/types/src/ui/initialize_block.d.ts.map +1 -1
- package/dist/types/src/ui/input.d.ts +16 -16
- package/dist/types/src/ui/input.d.ts.map +1 -1
- package/dist/types/src/ui/label.d.ts +1 -1
- package/dist/types/src/ui/label.d.ts.map +1 -1
- package/dist/types/src/ui/link.d.ts +2 -2
- package/dist/types/src/ui/link.d.ts.map +1 -1
- package/dist/types/src/ui/loader.d.ts +2 -2
- package/dist/types/src/ui/loader.d.ts.map +1 -1
- package/dist/types/src/ui/model_picker_select.d.ts +1 -1
- package/dist/types/src/ui/model_picker_select.d.ts.map +1 -1
- package/dist/types/src/ui/popover.d.ts +5 -5
- package/dist/types/src/ui/popover.d.ts.map +1 -1
- package/dist/types/src/ui/progress_bar.d.ts +2 -2
- package/dist/types/src/ui/progress_bar.d.ts.map +1 -1
- package/dist/types/src/ui/record_card.d.ts +3 -3
- package/dist/types/src/ui/record_card.d.ts.map +1 -1
- package/dist/types/src/ui/record_card_list.d.ts +3 -3
- package/dist/types/src/ui/record_card_list.d.ts.map +1 -1
- package/dist/types/src/ui/select.d.ts +4 -4
- package/dist/types/src/ui/select_and_select_buttons_helpers.d.ts +4 -4
- package/dist/types/src/ui/select_and_select_buttons_helpers.d.ts.map +1 -1
- package/dist/types/src/ui/select_buttons.d.ts +5 -5
- package/dist/types/src/ui/select_buttons.d.ts.map +1 -1
- package/dist/types/src/ui/switch.d.ts +2 -2
- package/dist/types/src/ui/switch.d.ts.map +1 -1
- package/dist/types/src/ui/synced.d.ts +3 -3
- package/dist/types/src/ui/system/all_styles_set.d.ts +0 -1
- package/dist/types/src/ui/system/all_styles_set.d.ts.map +1 -1
- package/dist/types/src/ui/system/appearance/appearance_set.d.ts +0 -1
- package/dist/types/src/ui/system/appearance/appearance_set.d.ts.map +1 -1
- package/dist/types/src/ui/system/appearance/background_color.d.ts +0 -1
- package/dist/types/src/ui/system/appearance/background_color.d.ts.map +1 -1
- package/dist/types/src/ui/system/appearance/border.d.ts +0 -1
- package/dist/types/src/ui/system/appearance/border.d.ts.map +1 -1
- package/dist/types/src/ui/system/appearance/border_radius.d.ts +0 -1
- package/dist/types/src/ui/system/appearance/border_radius.d.ts.map +1 -1
- package/dist/types/src/ui/system/appearance/box_shadow.d.ts +0 -1
- package/dist/types/src/ui/system/appearance/box_shadow.d.ts.map +1 -1
- package/dist/types/src/ui/system/appearance/opacity.d.ts +0 -1
- package/dist/types/src/ui/system/appearance/opacity.d.ts.map +1 -1
- package/dist/types/src/ui/system/dimensions/dimensions_set.d.ts +0 -1
- package/dist/types/src/ui/system/dimensions/dimensions_set.d.ts.map +1 -1
- package/dist/types/src/ui/system/dimensions/height.d.ts +0 -1
- package/dist/types/src/ui/system/dimensions/height.d.ts.map +1 -1
- package/dist/types/src/ui/system/dimensions/max_height.d.ts +0 -1
- package/dist/types/src/ui/system/dimensions/max_height.d.ts.map +1 -1
- package/dist/types/src/ui/system/dimensions/max_width.d.ts +0 -1
- package/dist/types/src/ui/system/dimensions/max_width.d.ts.map +1 -1
- package/dist/types/src/ui/system/dimensions/min_height.d.ts +0 -1
- package/dist/types/src/ui/system/dimensions/min_height.d.ts.map +1 -1
- package/dist/types/src/ui/system/dimensions/min_width.d.ts +0 -1
- package/dist/types/src/ui/system/dimensions/min_width.d.ts.map +1 -1
- package/dist/types/src/ui/system/dimensions/width.d.ts +0 -1
- package/dist/types/src/ui/system/dimensions/width.d.ts.map +1 -1
- package/dist/types/src/ui/system/display.d.ts +0 -1
- package/dist/types/src/ui/system/display.d.ts.map +1 -1
- package/dist/types/src/ui/system/flex_container/align_content.d.ts +0 -1
- package/dist/types/src/ui/system/flex_container/align_content.d.ts.map +1 -1
- package/dist/types/src/ui/system/flex_container/align_items.d.ts +0 -1
- package/dist/types/src/ui/system/flex_container/align_items.d.ts.map +1 -1
- package/dist/types/src/ui/system/flex_container/flex_container_set.d.ts +0 -1
- package/dist/types/src/ui/system/flex_container/flex_container_set.d.ts.map +1 -1
- package/dist/types/src/ui/system/flex_container/flex_direction.d.ts +0 -1
- package/dist/types/src/ui/system/flex_container/flex_direction.d.ts.map +1 -1
- package/dist/types/src/ui/system/flex_container/flex_wrap.d.ts +0 -1
- package/dist/types/src/ui/system/flex_container/flex_wrap.d.ts.map +1 -1
- package/dist/types/src/ui/system/flex_container/justify_content.d.ts +0 -1
- package/dist/types/src/ui/system/flex_container/justify_content.d.ts.map +1 -1
- package/dist/types/src/ui/system/flex_container/justify_items.d.ts +0 -1
- package/dist/types/src/ui/system/flex_container/justify_items.d.ts.map +1 -1
- package/dist/types/src/ui/system/flex_item/align_self.d.ts +0 -1
- package/dist/types/src/ui/system/flex_item/align_self.d.ts.map +1 -1
- package/dist/types/src/ui/system/flex_item/flex.d.ts +0 -1
- package/dist/types/src/ui/system/flex_item/flex.d.ts.map +1 -1
- package/dist/types/src/ui/system/flex_item/flex_basis.d.ts +0 -1
- package/dist/types/src/ui/system/flex_item/flex_basis.d.ts.map +1 -1
- package/dist/types/src/ui/system/flex_item/flex_grow.d.ts +0 -1
- package/dist/types/src/ui/system/flex_item/flex_grow.d.ts.map +1 -1
- package/dist/types/src/ui/system/flex_item/flex_item_set.d.ts +0 -1
- package/dist/types/src/ui/system/flex_item/flex_item_set.d.ts.map +1 -1
- package/dist/types/src/ui/system/flex_item/flex_shrink.d.ts +0 -1
- package/dist/types/src/ui/system/flex_item/flex_shrink.d.ts.map +1 -1
- package/dist/types/src/ui/system/flex_item/justify_self.d.ts +0 -1
- package/dist/types/src/ui/system/flex_item/justify_self.d.ts.map +1 -1
- package/dist/types/src/ui/system/flex_item/order.d.ts +0 -1
- package/dist/types/src/ui/system/flex_item/order.d.ts.map +1 -1
- package/dist/types/src/ui/system/overflow.d.ts +0 -1
- package/dist/types/src/ui/system/overflow.d.ts.map +1 -1
- package/dist/types/src/ui/system/position/bottom.d.ts +0 -1
- package/dist/types/src/ui/system/position/bottom.d.ts.map +1 -1
- package/dist/types/src/ui/system/position/left.d.ts +0 -1
- package/dist/types/src/ui/system/position/left.d.ts.map +1 -1
- package/dist/types/src/ui/system/position/position.d.ts +0 -1
- package/dist/types/src/ui/system/position/position.d.ts.map +1 -1
- package/dist/types/src/ui/system/position/position_set.d.ts +0 -1
- package/dist/types/src/ui/system/position/position_set.d.ts.map +1 -1
- package/dist/types/src/ui/system/position/right.d.ts +0 -1
- package/dist/types/src/ui/system/position/right.d.ts.map +1 -1
- package/dist/types/src/ui/system/position/top.d.ts +0 -1
- package/dist/types/src/ui/system/position/top.d.ts.map +1 -1
- package/dist/types/src/ui/system/position/z_index.d.ts +0 -1
- package/dist/types/src/ui/system/position/z_index.d.ts.map +1 -1
- package/dist/types/src/ui/system/spacing/margin.d.ts +0 -1
- package/dist/types/src/ui/system/spacing/margin.d.ts.map +1 -1
- package/dist/types/src/ui/system/spacing/padding.d.ts +0 -1
- package/dist/types/src/ui/system/spacing/padding.d.ts.map +1 -1
- package/dist/types/src/ui/system/spacing/spacing_set.d.ts +0 -1
- package/dist/types/src/ui/system/spacing/spacing_set.d.ts.map +1 -1
- package/dist/types/src/ui/system/typography/font_family.d.ts +0 -1
- package/dist/types/src/ui/system/typography/font_family.d.ts.map +1 -1
- package/dist/types/src/ui/system/typography/font_size.d.ts +0 -1
- package/dist/types/src/ui/system/typography/font_size.d.ts.map +1 -1
- package/dist/types/src/ui/system/typography/font_style.d.ts +0 -1
- package/dist/types/src/ui/system/typography/font_style.d.ts.map +1 -1
- package/dist/types/src/ui/system/typography/font_weight.d.ts +0 -1
- package/dist/types/src/ui/system/typography/font_weight.d.ts.map +1 -1
- package/dist/types/src/ui/system/typography/letter_spacing.d.ts +0 -1
- package/dist/types/src/ui/system/typography/letter_spacing.d.ts.map +1 -1
- package/dist/types/src/ui/system/typography/line_height.d.ts +0 -1
- package/dist/types/src/ui/system/typography/line_height.d.ts.map +1 -1
- package/dist/types/src/ui/system/typography/text_align.d.ts +0 -1
- package/dist/types/src/ui/system/typography/text_align.d.ts.map +1 -1
- package/dist/types/src/ui/system/typography/text_color.d.ts +0 -1
- package/dist/types/src/ui/system/typography/text_color.d.ts.map +1 -1
- package/dist/types/src/ui/system/typography/text_decoration.d.ts +0 -1
- package/dist/types/src/ui/system/typography/text_decoration.d.ts.map +1 -1
- package/dist/types/src/ui/system/typography/text_transform.d.ts +0 -1
- package/dist/types/src/ui/system/typography/text_transform.d.ts.map +1 -1
- package/dist/types/src/ui/system/typography/typography_set.d.ts +0 -1
- package/dist/types/src/ui/system/typography/typography_set.d.ts.map +1 -1
- package/dist/types/src/ui/system/utils/create_style_prop_types.d.ts +1 -1
- package/dist/types/src/ui/system/utils/create_style_prop_types.d.ts.map +1 -1
- package/dist/types/src/ui/system/utils/csstype.d.ts +578 -578
- package/dist/types/src/ui/system/utils/csstype.d.ts.map +1 -1
- package/dist/types/src/ui/system/utils/types.d.ts +4 -4
- package/dist/types/src/ui/system/utils/types.d.ts.map +1 -1
- package/dist/types/src/ui/table_picker.d.ts +1 -1
- package/dist/types/src/ui/table_picker.d.ts.map +1 -1
- package/dist/types/src/ui/text.d.ts +4 -4
- package/dist/types/src/ui/text.d.ts.map +1 -1
- package/dist/types/src/ui/text_button.d.ts +2 -2
- package/dist/types/src/ui/text_button.d.ts.map +1 -1
- package/dist/types/src/ui/theme/default_theme/heading_styles.d.ts +2 -2
- package/dist/types/src/ui/theme/default_theme/heading_styles.d.ts.map +1 -1
- package/dist/types/src/ui/theme/default_theme/index.d.ts +1 -1
- package/dist/types/src/ui/theme/theme_context.d.ts +1 -3
- package/dist/types/src/ui/theme/theme_context.d.ts.map +1 -1
- package/dist/types/src/ui/theme/use_theme.d.ts +1 -1
- package/dist/types/src/ui/tooltip.d.ts +3 -3
- package/dist/types/src/ui/types/data_attributes_prop.d.ts.map +1 -1
- package/dist/types/src/ui/types/tooltip_anchor_props.d.ts +0 -1
- package/dist/types/src/ui/types/tooltip_anchor_props.d.ts.map +1 -1
- package/dist/types/src/ui/ui.d.ts +1 -0
- package/dist/types/src/ui/ui.d.ts.map +1 -1
- package/dist/types/src/ui/use_base.d.ts.map +1 -1
- package/dist/types/src/ui/use_color_scheme.d.ts +28 -0
- package/dist/types/src/ui/use_color_scheme.d.ts.map +1 -0
- package/dist/types/src/ui/use_cursor.d.ts.map +1 -1
- package/dist/types/src/ui/use_form_field.d.ts +0 -2
- package/dist/types/src/ui/use_form_field.d.ts.map +1 -1
- package/dist/types/src/ui/use_records.d.ts +2 -2
- package/dist/types/src/ui/use_records.d.ts.map +1 -1
- package/dist/types/src/ui/use_session.d.ts.map +1 -1
- package/dist/types/src/ui/view_picker.d.ts +3 -3
- package/dist/types/src/ui/view_picker.d.ts.map +1 -1
- package/dist/types/src/ui/viewport_constraint.d.ts +3 -3
- package/dist/types/src/ui/viewport_constraint.d.ts.map +1 -1
- package/dist/types/src/viewport.d.ts +2 -2
- package/dist/types/src/viewport.d.ts.map +1 -1
- package/dist/types/src/warning.d.ts +1 -1
- package/dist/types/src/warning.d.ts.map +1 -1
- package/package.json +40 -34
- package/dist/types/stories/all_controls.stories.d.ts +0 -2
- package/dist/types/stories/all_controls.stories.d.ts.map +0 -1
- package/dist/types/stories/box.appearance.stories.d.ts +0 -2
- package/dist/types/stories/box.appearance.stories.d.ts.map +0 -1
- package/dist/types/stories/box.dimensions.stories.d.ts +0 -2
- package/dist/types/stories/box.dimensions.stories.d.ts.map +0 -1
- package/dist/types/stories/box.flex_container.stories.d.ts +0 -2
- package/dist/types/stories/box.flex_container.stories.d.ts.map +0 -1
- package/dist/types/stories/box.flex_item.stories.d.ts +0 -2
- package/dist/types/stories/box.flex_item.stories.d.ts.map +0 -1
- package/dist/types/stories/box.position.stories.d.ts +0 -2
- package/dist/types/stories/box.position.stories.d.ts.map +0 -1
- package/dist/types/stories/box.spacing.stories.d.ts +0 -2
- package/dist/types/stories/box.spacing.stories.d.ts.map +0 -1
- package/dist/types/stories/box.stories.d.ts +0 -2
- package/dist/types/stories/box.stories.d.ts.map +0 -1
- package/dist/types/stories/box.typography.stories.d.ts +0 -2
- package/dist/types/stories/box.typography.stories.d.ts.map +0 -1
- package/dist/types/stories/button.stories.d.ts +0 -2
- package/dist/types/stories/button.stories.d.ts.map +0 -1
- package/dist/types/stories/cell_renderer.stories.d.ts +0 -2
- package/dist/types/stories/cell_renderer.stories.d.ts.map +0 -1
- package/dist/types/stories/choice_token.stories.d.ts +0 -2
- package/dist/types/stories/choice_token.stories.d.ts.map +0 -1
- package/dist/types/stories/collaborator_token.stories.d.ts +0 -2
- package/dist/types/stories/collaborator_token.stories.d.ts.map +0 -1
- package/dist/types/stories/color_palette.stories.d.ts +0 -2
- package/dist/types/stories/color_palette.stories.d.ts.map +0 -1
- package/dist/types/stories/confirmation_dialog.stories.d.ts +0 -2
- package/dist/types/stories/confirmation_dialog.stories.d.ts.map +0 -1
- package/dist/types/stories/dialog.stories.d.ts +0 -2
- package/dist/types/stories/dialog.stories.d.ts.map +0 -1
- package/dist/types/stories/field_icon.stories.d.ts +0 -2
- package/dist/types/stories/field_icon.stories.d.ts.map +0 -1
- package/dist/types/stories/form_field.stories.d.ts +0 -2
- package/dist/types/stories/form_field.stories.d.ts.map +0 -1
- package/dist/types/stories/heading.size.stories.d.ts +0 -2
- package/dist/types/stories/heading.size.stories.d.ts.map +0 -1
- package/dist/types/stories/heading.stories.d.ts +0 -2
- package/dist/types/stories/heading.stories.d.ts.map +0 -1
- package/dist/types/stories/helpers/attachments.d.ts +0 -4
- package/dist/types/stories/helpers/attachments.d.ts.map +0 -1
- package/dist/types/stories/helpers/categorize_style_props.d.ts +0 -14
- package/dist/types/stories/helpers/categorize_style_props.d.ts.map +0 -1
- package/dist/types/stories/helpers/choice_options.d.ts +0 -7
- package/dist/types/stories/helpers/choice_options.d.ts.map +0 -1
- package/dist/types/stories/helpers/code_block.d.ts +0 -5
- package/dist/types/stories/helpers/code_block.d.ts.map +0 -1
- package/dist/types/stories/helpers/code_utils.d.ts +0 -32
- package/dist/types/stories/helpers/code_utils.d.ts.map +0 -1
- package/dist/types/stories/helpers/collaborator_options.d.ts +0 -7
- package/dist/types/stories/helpers/collaborator_options.d.ts.map +0 -1
- package/dist/types/stories/helpers/example.d.ts +0 -39
- package/dist/types/stories/helpers/example.d.ts.map +0 -1
- package/dist/types/stories/helpers/example_code_panel.d.ts +0 -10
- package/dist/types/stories/helpers/example_code_panel.d.ts.map +0 -1
- package/dist/types/stories/helpers/fake_cell_renderer.d.ts +0 -7
- package/dist/types/stories/helpers/fake_cell_renderer.d.ts.map +0 -1
- package/dist/types/stories/helpers/fake_foreign_record.d.ts +0 -5
- package/dist/types/stories/helpers/fake_foreign_record.d.ts.map +0 -1
- package/dist/types/stories/helpers/fake_record_card.d.ts +0 -13
- package/dist/types/stories/helpers/fake_record_card.d.ts.map +0 -1
- package/dist/types/stories/helpers/field_type.d.ts +0 -6
- package/dist/types/stories/helpers/field_type.d.ts.map +0 -1
- package/dist/types/stories/helpers/raf_throttle.d.ts +0 -5
- package/dist/types/stories/helpers/raf_throttle.d.ts.map +0 -1
- package/dist/types/stories/helpers/style_prop_list.d.ts +0 -9
- package/dist/types/stories/helpers/style_prop_list.d.ts.map +0 -1
- package/dist/types/stories/helpers/sync_source_options.d.ts +0 -7
- package/dist/types/stories/helpers/sync_source_options.d.ts.map +0 -1
- package/dist/types/stories/helpers/use_resizable_panel.d.ts +0 -27
- package/dist/types/stories/helpers/use_resizable_panel.d.ts.map +0 -1
- package/dist/types/stories/icon.stories.d.ts +0 -2
- package/dist/types/stories/icon.stories.d.ts.map +0 -1
- package/dist/types/stories/icon_example.d.ts +0 -3
- package/dist/types/stories/icon_example.d.ts.map +0 -1
- package/dist/types/stories/input.stories.d.ts +0 -2
- package/dist/types/stories/input.stories.d.ts.map +0 -1
- package/dist/types/stories/label.stories.d.ts +0 -2
- package/dist/types/stories/label.stories.d.ts.map +0 -1
- package/dist/types/stories/link.stories.d.ts +0 -2
- package/dist/types/stories/link.stories.d.ts.map +0 -1
- package/dist/types/stories/loader.stories.d.ts +0 -2
- package/dist/types/stories/loader.stories.d.ts.map +0 -1
- package/dist/types/stories/model_pickers.stories.d.ts +0 -2
- package/dist/types/stories/model_pickers.stories.d.ts.map +0 -1
- package/dist/types/stories/progress_bar.stories.d.ts +0 -2
- package/dist/types/stories/progress_bar.stories.d.ts.map +0 -1
- package/dist/types/stories/record_card.stories.d.ts +0 -2
- package/dist/types/stories/record_card.stories.d.ts.map +0 -1
- package/dist/types/stories/record_card_list.stories.d.ts +0 -2
- package/dist/types/stories/record_card_list.stories.d.ts.map +0 -1
- package/dist/types/stories/select.stories.d.ts +0 -2
- package/dist/types/stories/select.stories.d.ts.map +0 -1
- package/dist/types/stories/select_buttons.stories.d.ts +0 -2
- package/dist/types/stories/select_buttons.stories.d.ts.map +0 -1
- package/dist/types/stories/switch.stories.d.ts +0 -2
- package/dist/types/stories/switch.stories.d.ts.map +0 -1
- package/dist/types/stories/text.size.stories.d.ts +0 -2
- package/dist/types/stories/text.size.stories.d.ts.map +0 -1
- package/dist/types/stories/text.stories.d.ts +0 -2
- package/dist/types/stories/text.stories.d.ts.map +0 -1
- package/dist/types/stories/text_button.stories.d.ts +0 -2
- package/dist/types/stories/text_button.stories.d.ts.map +0 -1
- package/dist/types/stories/tooltip.stories.d.ts +0 -2
- package/dist/types/stories/tooltip.stories.d.ts.map +0 -1
- package/dist/types/test/airtable_interface_mocks/fixture_data.d.ts +0 -124
- package/dist/types/test/airtable_interface_mocks/fixture_data.d.ts.map +0 -1
- package/dist/types/test/airtable_interface_mocks/linked_records.d.ts +0 -4
- package/dist/types/test/airtable_interface_mocks/linked_records.d.ts.map +0 -1
- package/dist/types/test/airtable_interface_mocks/mock_airtable_interface.d.ts +0 -61
- package/dist/types/test/airtable_interface_mocks/mock_airtable_interface.d.ts.map +0 -1
- package/dist/types/test/airtable_interface_mocks/project_tracker.d.ts +0 -4
- package/dist/types/test/airtable_interface_mocks/project_tracker.d.ts.map +0 -1
- package/dist/types/test/error_utils.test.d.ts +0 -2
- package/dist/types/test/error_utils.test.d.ts.map +0 -1
- package/dist/types/test/get_style_props_for_responsive_prop.test.d.ts +0 -2
- package/dist/types/test/get_style_props_for_responsive_prop.test.d.ts.map +0 -1
- package/dist/types/test/index.test.d.ts +0 -2
- package/dist/types/test/index.test.d.ts.map +0 -1
- package/dist/types/test/models/base.test.d.ts +0 -2
- package/dist/types/test/models/base.test.d.ts.map +0 -1
- package/dist/types/test/models/cursor.test.d.ts +0 -2
- package/dist/types/test/models/cursor.test.d.ts.map +0 -1
- package/dist/types/test/models/field.test.d.ts +0 -2
- package/dist/types/test/models/field.test.d.ts.map +0 -1
- package/dist/types/test/models/linked_records_query_result.test.d.ts +0 -2
- package/dist/types/test/models/linked_records_query_result.test.d.ts.map +0 -1
- package/dist/types/test/models/mutations.test.d.ts +0 -2
- package/dist/types/test/models/mutations.test.d.ts.map +0 -1
- package/dist/types/test/models/object_pool.test.d.ts +0 -2
- package/dist/types/test/models/object_pool.test.d.ts.map +0 -1
- package/dist/types/test/models/record.test.d.ts +0 -2
- package/dist/types/test/models/record.test.d.ts.map +0 -1
- package/dist/types/test/models/session.test.d.ts +0 -2
- package/dist/types/test/models/session.test.d.ts.map +0 -1
- package/dist/types/test/models/table.test.d.ts +0 -2
- package/dist/types/test/models/table.test.d.ts.map +0 -1
- package/dist/types/test/models/table_mutations.test.d.ts +0 -2
- package/dist/types/test/models/table_mutations.test.d.ts.map +0 -1
- package/dist/types/test/models/table_or_view_query_result.test.d.ts +0 -2
- package/dist/types/test/models/table_or_view_query_result.test.d.ts.map +0 -1
- package/dist/types/test/models/view.test.d.ts +0 -2
- package/dist/types/test/models/view.test.d.ts.map +0 -1
- package/dist/types/test/models/view_metadata_query_result.test.d.ts +0 -2
- package/dist/types/test/models/view_metadata_query_result.test.d.ts.map +0 -1
- package/dist/types/test/private_utils.test.d.ts +0 -2
- package/dist/types/test/private_utils.test.d.ts.map +0 -1
- package/dist/types/test/sdk.test.d.ts +0 -2
- package/dist/types/test/sdk.test.d.ts.map +0 -1
- package/dist/types/test/setup_enzyme.d.ts +0 -2
- package/dist/types/test/setup_enzyme.d.ts.map +0 -1
- package/dist/types/test/test_helpers.d.ts +0 -11
- package/dist/types/test/test_helpers.d.ts.map +0 -1
- package/dist/types/test/ui/base_provider.test.d.ts +0 -2
- package/dist/types/test/ui/base_provider.test.d.ts.map +0 -1
- package/dist/types/test/ui/block_wrapper.test.d.ts +0 -2
- package/dist/types/test/ui/block_wrapper.test.d.ts.map +0 -1
- package/dist/types/test/ui/box.test.d.ts +0 -2
- package/dist/types/test/ui/box.test.d.ts.map +0 -1
- package/dist/types/test/ui/button.test.d.ts +0 -2
- package/dist/types/test/ui/button.test.d.ts.map +0 -1
- package/dist/types/test/ui/cell_renderer.test.d.ts +0 -2
- package/dist/types/test/ui/cell_renderer.test.d.ts.map +0 -1
- package/dist/types/test/ui/choice_token.test.d.ts +0 -2
- package/dist/types/test/ui/choice_token.test.d.ts.map +0 -1
- package/dist/types/test/ui/collaborator_token.test.d.ts +0 -2
- package/dist/types/test/ui/collaborator_token.test.d.ts.map +0 -1
- package/dist/types/test/ui/color_palette.test.d.ts +0 -2
- package/dist/types/test/ui/color_palette.test.d.ts.map +0 -1
- package/dist/types/test/ui/color_palette_synced.test.d.ts +0 -2
- package/dist/types/test/ui/color_palette_synced.test.d.ts.map +0 -1
- package/dist/types/test/ui/confirmation_dialog.test.d.ts +0 -2
- package/dist/types/test/ui/confirmation_dialog.test.d.ts.map +0 -1
- package/dist/types/test/ui/dialog.test.d.ts +0 -2
- package/dist/types/test/ui/dialog.test.d.ts.map +0 -1
- package/dist/types/test/ui/expand_record.test.d.ts +0 -2
- package/dist/types/test/ui/expand_record.test.d.ts.map +0 -1
- package/dist/types/test/ui/expand_record_list.test.d.ts +0 -2
- package/dist/types/test/ui/expand_record_list.test.d.ts.map +0 -1
- package/dist/types/test/ui/expand_record_picker_async.test.d.ts +0 -2
- package/dist/types/test/ui/expand_record_picker_async.test.d.ts.map +0 -1
- package/dist/types/test/ui/field_icon.test.d.ts +0 -2
- package/dist/types/test/ui/field_icon.test.d.ts.map +0 -1
- package/dist/types/test/ui/field_picker.test.d.ts +0 -2
- package/dist/types/test/ui/field_picker.test.d.ts.map +0 -1
- package/dist/types/test/ui/field_picker_synced.test.d.ts +0 -2
- package/dist/types/test/ui/field_picker_synced.test.d.ts.map +0 -1
- package/dist/types/test/ui/form_field.test.d.ts +0 -2
- package/dist/types/test/ui/form_field.test.d.ts.map +0 -1
- package/dist/types/test/ui/global_alert.test.d.ts +0 -2
- package/dist/types/test/ui/global_alert.test.d.ts.map +0 -1
- package/dist/types/test/ui/heading.test.d.ts +0 -2
- package/dist/types/test/ui/heading.test.d.ts.map +0 -1
- package/dist/types/test/ui/icon.test.d.ts +0 -2
- package/dist/types/test/ui/icon.test.d.ts.map +0 -1
- package/dist/types/test/ui/initialize_block.test.d.ts +0 -2
- package/dist/types/test/ui/initialize_block.test.d.ts.map +0 -1
- package/dist/types/test/ui/input.test.d.ts +0 -2
- package/dist/types/test/ui/input.test.d.ts.map +0 -1
- package/dist/types/test/ui/input_synced.test.d.ts +0 -2
- package/dist/types/test/ui/input_synced.test.d.ts.map +0 -1
- package/dist/types/test/ui/label.test.d.ts +0 -2
- package/dist/types/test/ui/label.test.d.ts.map +0 -1
- package/dist/types/test/ui/link.test.d.ts +0 -2
- package/dist/types/test/ui/link.test.d.ts.map +0 -1
- package/dist/types/test/ui/loader.test.d.ts +0 -2
- package/dist/types/test/ui/loader.test.d.ts.map +0 -1
- package/dist/types/test/ui/modal.test.d.ts +0 -2
- package/dist/types/test/ui/modal.test.d.ts.map +0 -1
- package/dist/types/test/ui/popover.test.d.ts +0 -2
- package/dist/types/test/ui/popover.test.d.ts.map +0 -1
- package/dist/types/test/ui/progress_bar.test.d.ts +0 -2
- package/dist/types/test/ui/progress_bar.test.d.ts.map +0 -1
- package/dist/types/test/ui/record_card.test.d.ts +0 -2
- package/dist/types/test/ui/record_card.test.d.ts.map +0 -1
- package/dist/types/test/ui/record_card_list.test.d.ts +0 -2
- package/dist/types/test/ui/record_card_list.test.d.ts.map +0 -1
- package/dist/types/test/ui/remote_utils.test.d.ts +0 -2
- package/dist/types/test/ui/remote_utils.test.d.ts.map +0 -1
- package/dist/types/test/ui/select.test.d.ts +0 -2
- package/dist/types/test/ui/select.test.d.ts.map +0 -1
- package/dist/types/test/ui/select_buttons.test.d.ts +0 -2
- package/dist/types/test/ui/select_buttons.test.d.ts.map +0 -1
- package/dist/types/test/ui/select_buttons_synced.test.d.ts +0 -2
- package/dist/types/test/ui/select_buttons_synced.test.d.ts.map +0 -1
- package/dist/types/test/ui/select_synced.test.d.ts +0 -2
- package/dist/types/test/ui/select_synced.test.d.ts.map +0 -1
- package/dist/types/test/ui/switch.test.d.ts +0 -2
- package/dist/types/test/ui/switch.test.d.ts.map +0 -1
- package/dist/types/test/ui/switch_synced.test.d.ts +0 -2
- package/dist/types/test/ui/switch_synced.test.d.ts.map +0 -1
- package/dist/types/test/ui/synced.test.d.ts +0 -2
- package/dist/types/test/ui/synced.test.d.ts.map +0 -1
- package/dist/types/test/ui/table_picker.test.d.ts +0 -2
- package/dist/types/test/ui/table_picker.test.d.ts.map +0 -1
- package/dist/types/test/ui/table_picker_synced.test.d.ts +0 -2
- package/dist/types/test/ui/table_picker_synced.test.d.ts.map +0 -1
- package/dist/types/test/ui/text.test.d.ts +0 -2
- package/dist/types/test/ui/text.test.d.ts.map +0 -1
- package/dist/types/test/ui/text_button.test.d.ts +0 -2
- package/dist/types/test/ui/text_button.test.d.ts.map +0 -1
- package/dist/types/test/ui/tooltip.test.d.ts +0 -2
- package/dist/types/test/ui/tooltip.test.d.ts.map +0 -1
- package/dist/types/test/ui/ui.test.d.ts +0 -2
- package/dist/types/test/ui/ui.test.d.ts.map +0 -1
- package/dist/types/test/ui/unstable_standalone_ui.test.d.ts +0 -1
- package/dist/types/test/ui/unstable_standalone_ui.test.d.ts.map +0 -1
- package/dist/types/test/ui/use_array_identity.test.d.ts +0 -2
- package/dist/types/test/ui/use_array_identity.test.d.ts.map +0 -1
- package/dist/types/test/ui/use_loadable.test.d.ts +0 -2
- package/dist/types/test/ui/use_loadable.test.d.ts.map +0 -1
- package/dist/types/test/ui/use_record_action_data.test.d.ts +0 -2
- package/dist/types/test/ui/use_record_action_data.test.d.ts.map +0 -1
- package/dist/types/test/ui/use_records.test.d.ts +0 -2
- package/dist/types/test/ui/use_records.test.d.ts.map +0 -1
- package/dist/types/test/ui/use_view_metadata.test.d.ts +0 -2
- package/dist/types/test/ui/use_view_metadata.test.d.ts.map +0 -1
- package/dist/types/test/ui/use_watchable.test.d.ts +0 -2
- package/dist/types/test/ui/use_watchable.test.d.ts.map +0 -1
- package/dist/types/test/ui/view_picker.test.d.ts +0 -2
- package/dist/types/test/ui/view_picker.test.d.ts.map +0 -1
- package/dist/types/test/ui/view_picker_synced.test.d.ts +0 -2
- package/dist/types/test/ui/view_picker_synced.test.d.ts.map +0 -1
- package/dist/types/test/ui/viewport_constraint.test.d.ts +0 -2
- package/dist/types/test/ui/viewport_constraint.test.d.ts.map +0 -1
- package/dist/types/test/unstable_private_utils.test.d.ts +0 -1
- package/dist/types/test/unstable_private_utils.test.d.ts.map +0 -1
|
@@ -1,66 +1,44 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
require("core-js/modules/es.symbol.js");
|
|
4
|
+
require("core-js/modules/es.symbol.description.js");
|
|
5
|
+
require("core-js/modules/es.array.from.js");
|
|
6
|
+
require("core-js/modules/es.array.iterator.js");
|
|
7
|
+
require("core-js/modules/es.array.slice.js");
|
|
8
|
+
require("core-js/modules/es.object.to-string.js");
|
|
9
|
+
require("core-js/modules/es.regexp.exec.js");
|
|
10
|
+
require("core-js/modules/es.regexp.to-string.js");
|
|
11
|
+
require("core-js/modules/web.dom-collections.iterator.js");
|
|
3
12
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
|
-
require("core-js/modules/es.symbol");
|
|
6
|
-
|
|
7
|
-
require("core-js/modules/es.symbol.description");
|
|
8
|
-
|
|
9
|
-
require("core-js/modules/es.array.iterator");
|
|
10
|
-
|
|
11
|
-
require("core-js/modules/es.array.map");
|
|
12
|
-
|
|
13
|
-
require("core-js/modules/es.object.to-string");
|
|
14
|
-
|
|
15
|
-
require("core-js/modules/es.promise");
|
|
16
|
-
|
|
17
|
-
require("core-js/modules/es.string.starts-with");
|
|
18
|
-
|
|
19
|
-
require("core-js/modules/web.dom-collections.iterator");
|
|
20
|
-
|
|
21
13
|
Object.defineProperty(exports, "__esModule", {
|
|
22
14
|
value: true
|
|
23
15
|
});
|
|
24
|
-
exports.normalizeSortsOrGroups = normalizeSortsOrGroups;
|
|
25
16
|
exports.default = void 0;
|
|
26
|
-
|
|
17
|
+
exports.normalizeSortsOrGroups = normalizeSortsOrGroups;
|
|
27
18
|
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
28
|
-
|
|
29
|
-
require("regenerator-runtime/runtime");
|
|
30
|
-
|
|
19
|
+
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
31
20
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
32
|
-
|
|
21
|
+
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
33
22
|
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
34
|
-
|
|
35
|
-
var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
|
|
36
|
-
|
|
37
|
-
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
38
|
-
|
|
39
23
|
var _get2 = _interopRequireDefault(require("@babel/runtime/helpers/get"));
|
|
40
|
-
|
|
41
|
-
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
42
|
-
|
|
24
|
+
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
43
25
|
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
44
|
-
|
|
45
26
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
46
|
-
|
|
27
|
+
require("core-js/modules/es.array.concat.js");
|
|
28
|
+
require("core-js/modules/es.array.map.js");
|
|
29
|
+
require("core-js/modules/es.string.starts-with.js");
|
|
47
30
|
var _colors = _interopRequireDefault(require("../colors"));
|
|
48
|
-
|
|
49
31
|
var _field = require("../types/field");
|
|
50
|
-
|
|
51
32
|
var _private_utils = require("../private_utils");
|
|
52
|
-
|
|
53
33
|
var _error_utils = require("../error_utils");
|
|
54
|
-
|
|
55
34
|
var _abstract_model_with_async_data = _interopRequireDefault(require("./abstract_model_with_async_data"));
|
|
56
|
-
|
|
57
35
|
var _field2 = _interopRequireDefault(require("./field"));
|
|
58
|
-
|
|
59
36
|
var _record_coloring = require("./record_coloring");
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
37
|
+
function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t.return || t.return(); } finally { if (u) throw o; } } }; }
|
|
38
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
39
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
40
|
+
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)); }
|
|
41
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } /** @module @airtable/blocks/models: RecordQueryResult */ /** */
|
|
64
42
|
var WatchableRecordQueryResultKeys = Object.freeze({
|
|
65
43
|
records: 'records',
|
|
66
44
|
recordIds: 'recordIds',
|
|
@@ -70,8 +48,9 @@ var WatchableRecordQueryResultKeys = Object.freeze({
|
|
|
70
48
|
groupLevels: 'groupLevels',
|
|
71
49
|
isDataLoaded: 'isDataLoaded'
|
|
72
50
|
});
|
|
73
|
-
var WatchableCellValuesInFieldKeyPrefix = 'cellValuesInField:';
|
|
51
|
+
var WatchableCellValuesInFieldKeyPrefix = 'cellValuesInField:';
|
|
74
52
|
|
|
53
|
+
// The string case is to accommodate cellValuesInField:$FieldId.
|
|
75
54
|
/**
|
|
76
55
|
* A key in {@link RecordQueryResult} that can be watched
|
|
77
56
|
* - `records`
|
|
@@ -82,35 +61,188 @@ var WatchableCellValuesInFieldKeyPrefix = 'cellValuesInField:'; // The string ca
|
|
|
82
61
|
* - `cellValuesInField:{FIELD_ID}`
|
|
83
62
|
*/
|
|
84
63
|
|
|
64
|
+
/** */
|
|
65
|
+
|
|
66
|
+
/** @hidden */
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* NormalizedGroupLevel is in airtable_interface
|
|
70
|
+
*
|
|
71
|
+
* @hidden
|
|
72
|
+
*/
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* View Config that can be set by developer
|
|
76
|
+
*
|
|
77
|
+
* @hidden
|
|
78
|
+
*/
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* Used to control what data is loaded in a {@link RecordQueryResult}. Used when creating a
|
|
82
|
+
* query result using `table/view.selectRecords()` and in convenience hooks {@link useRecords}.
|
|
83
|
+
*
|
|
84
|
+
* ## sorts
|
|
85
|
+
* Pass an array of sorts to control the order of records. The first sort in the array has the
|
|
86
|
+
* highest priority. If you don't specify sorts, the result will use the inherent order of the
|
|
87
|
+
* source model: the same order you'd see in the main UI for views and linked record fields, and
|
|
88
|
+
* an arbitrary (but stable) order for tables.
|
|
89
|
+
*
|
|
90
|
+
* Record creation time is used as a tiebreaker: pass an empty array to sort by creation time.
|
|
91
|
+
*
|
|
92
|
+
* ```js
|
|
93
|
+
* const opts = {
|
|
94
|
+
* sorts: [
|
|
95
|
+
* // sort by someField in ascending order...
|
|
96
|
+
* {field: someField},
|
|
97
|
+
* // then by someOtherField in descending order
|
|
98
|
+
* {field: someOtherField, direction: 'desc'},
|
|
99
|
+
* ]
|
|
100
|
+
* };
|
|
101
|
+
* const records = useRecords(table, opts);
|
|
102
|
+
* const queryResult = table.selectRecords(opts);
|
|
103
|
+
* ```
|
|
104
|
+
*
|
|
105
|
+
* ## fields
|
|
106
|
+
* Generally, it's a good idea to load as little data into your extension as possible - Airtable bases
|
|
107
|
+
* can get pretty big, and we have to keep all that information in memory and up to date if you ask
|
|
108
|
+
* for it. The fields option lets you make sure that only data relevant to you is loaded.
|
|
109
|
+
*
|
|
110
|
+
* You can specify fields with a {@link Field}, by ID, or by name:
|
|
111
|
+
* ```js
|
|
112
|
+
* const opts = {
|
|
113
|
+
* fields: [
|
|
114
|
+
* // we want to only load fieldA:
|
|
115
|
+
* fieldA,
|
|
116
|
+
* // the field with this id:
|
|
117
|
+
* 'fldXXXXXXXXXXXXXX',
|
|
118
|
+
* // and the field named 'Rating':
|
|
119
|
+
* 'Rating',
|
|
120
|
+
* ],
|
|
121
|
+
* };
|
|
122
|
+
* const records = useRecords(table, opts);
|
|
123
|
+
* const queryResult = table.selectRecords(opts);
|
|
124
|
+
* ```
|
|
125
|
+
*
|
|
126
|
+
* ## recordColorMode
|
|
127
|
+
* Just like a view in Airtable, you can control the colors of records in a field. There are three
|
|
128
|
+
* supported record color modes: none, by a view, and by a select field.
|
|
129
|
+
*
|
|
130
|
+
* ```js
|
|
131
|
+
* import {recordColoring} from '@airtable/blocks/models';
|
|
132
|
+
* // No record coloring:
|
|
133
|
+
* const opts = {
|
|
134
|
+
* recordColorMode: recordColoring.modes.none(),
|
|
135
|
+
* };
|
|
136
|
+
*
|
|
137
|
+
* // Color according to the rules of a view:
|
|
138
|
+
* const opts = {
|
|
139
|
+
* recordColorMode: recordColoring.modes.byView(someView),
|
|
140
|
+
* };
|
|
141
|
+
*
|
|
142
|
+
* // Color by a single select field:
|
|
143
|
+
* const opts = {
|
|
144
|
+
* recordColorMode: recordColoring.modes.bySelectField(someSelectField),
|
|
145
|
+
* });
|
|
146
|
+
* ```
|
|
147
|
+
*
|
|
148
|
+
* You can access view coloring information directly from a {@link RecordQueryResult} or a
|
|
149
|
+
* {@link Record}, but you can only directly access single select coloring from a RecordQueryResult:
|
|
150
|
+
*
|
|
151
|
+
* ```
|
|
152
|
+
* const queryResult = table.selectRecords(opts);
|
|
153
|
+
* const records = useRecords(table, opts);
|
|
154
|
+
*
|
|
155
|
+
* // Returns based on opts coloring mode
|
|
156
|
+
* queryResult.getRecordColor(recordId);
|
|
157
|
+
*
|
|
158
|
+
* // Returns based on view
|
|
159
|
+
* // Will throw if you did not pass recordColoring.modes.byView(view) in opts
|
|
160
|
+
* records[0].getColorInView(view);
|
|
161
|
+
* ```
|
|
162
|
+
*
|
|
163
|
+
* Use `record.getCellValue(singleSelectField).color` to access the color of a single select field
|
|
164
|
+
* for a record.
|
|
165
|
+
*
|
|
166
|
+
* By default, views will have whichever coloring is set up in Airtable and tables won't have any
|
|
167
|
+
* record coloring:
|
|
168
|
+
*
|
|
169
|
+
* ```js
|
|
170
|
+
* // these two are the same:
|
|
171
|
+
* someView.selectRecords();
|
|
172
|
+
* someView.selectRecords({
|
|
173
|
+
* recordColorMode: recordColoring.modes.byView(someView),
|
|
174
|
+
* });
|
|
175
|
+
*
|
|
176
|
+
* // as are these two:
|
|
177
|
+
* someTable.selectRecords();
|
|
178
|
+
* someTable.selectRecords({
|
|
179
|
+
* recordColorMode: recordColoring.modes.none(),
|
|
180
|
+
* });
|
|
181
|
+
* ```
|
|
182
|
+
*
|
|
183
|
+
* */
|
|
184
|
+
|
|
185
|
+
/**
|
|
186
|
+
* A subset of {@link RecordQueryResultOpts} used in {@link useRecordById} that omits sorts, as
|
|
187
|
+
* there is only a single record.
|
|
188
|
+
*
|
|
189
|
+
* See RecordQueryResultOpts for full details and examples.
|
|
190
|
+
*
|
|
191
|
+
* ```js
|
|
192
|
+
* const opts = {
|
|
193
|
+
* fields: ['My field'],
|
|
194
|
+
* recordColorMode: recordColoring.modes.byView(view),
|
|
195
|
+
* };
|
|
196
|
+
* const record = useRecordById(table, recordId, opts);
|
|
197
|
+
* */
|
|
198
|
+
|
|
199
|
+
/**
|
|
200
|
+
* A subset of {@link RecordQueryResultOpts} used in {@link useRecordIds} that omits fields and
|
|
201
|
+
* recordColorMode, as record cell values and color are not accessible via this hook.
|
|
202
|
+
*
|
|
203
|
+
* See RecordQueryResultOpts for full details and examples.
|
|
204
|
+
*
|
|
205
|
+
* ```js
|
|
206
|
+
* const opts = {
|
|
207
|
+
* sorts: [
|
|
208
|
+
* // sort by someField in ascending order...
|
|
209
|
+
* {field: someField},
|
|
210
|
+
* // then by someOtherField in descending order
|
|
211
|
+
* {field: someOtherField, direction: 'desc'},
|
|
212
|
+
* ]
|
|
213
|
+
* };
|
|
214
|
+
* const recordIds = useRecordIds(table, opts);
|
|
215
|
+
* */
|
|
216
|
+
|
|
217
|
+
/** @internal */
|
|
218
|
+
|
|
219
|
+
/** @internal */
|
|
220
|
+
|
|
85
221
|
/**
|
|
86
222
|
* @internal
|
|
87
223
|
*/
|
|
88
224
|
function _normalizeSortOrGroup(table, sortOrGroup) {
|
|
89
225
|
var _sortOrGroup$directio;
|
|
90
|
-
|
|
91
226
|
var field = table.__getFieldMatching(sortOrGroup.field);
|
|
92
|
-
|
|
93
227
|
if (sortOrGroup.direction !== undefined && sortOrGroup.direction !== 'asc' && sortOrGroup.direction !== 'desc') {
|
|
94
228
|
throw (0, _error_utils.spawnError)('Invalid sort direction: %s', sortOrGroup.direction);
|
|
95
229
|
}
|
|
96
|
-
|
|
97
230
|
return {
|
|
98
231
|
fieldId: field.id,
|
|
99
232
|
direction: (_sortOrGroup$directio = sortOrGroup.direction) !== null && _sortOrGroup$directio !== void 0 ? _sortOrGroup$directio : 'asc'
|
|
100
233
|
};
|
|
101
234
|
}
|
|
235
|
+
|
|
102
236
|
/**
|
|
103
237
|
* @internal
|
|
104
238
|
*/
|
|
105
|
-
|
|
106
|
-
|
|
107
239
|
function normalizeSortsOrGroups(table, sortsOrGroups) {
|
|
108
240
|
if (sortsOrGroups === undefined || sortsOrGroups === null) {
|
|
109
241
|
return sortsOrGroups;
|
|
110
242
|
}
|
|
111
|
-
|
|
112
243
|
return sortsOrGroups.map(sortOrGroup => _normalizeSortOrGroup(table, sortOrGroup));
|
|
113
244
|
}
|
|
245
|
+
|
|
114
246
|
/**
|
|
115
247
|
* A RecordQueryResult represents a set of records. It's a little bit like a one-off View in Airtable: it
|
|
116
248
|
* contains a bunch of records, filtered to a useful subset of the records in the table. Those
|
|
@@ -159,136 +291,49 @@ function normalizeSortsOrGroups(table, sortsOrGroups) {
|
|
|
159
291
|
*
|
|
160
292
|
* @docsPath models/query results/RecordQueryResult
|
|
161
293
|
*/
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
var RecordQueryResult =
|
|
165
|
-
/*#__PURE__*/
|
|
166
|
-
function (_AbstractModelWithAsy) {
|
|
167
|
-
(0, _inherits2.default)(RecordQueryResult, _AbstractModelWithAsy);
|
|
168
|
-
(0, _createClass2.default)(RecordQueryResult, null, [{
|
|
169
|
-
key: "_isWatchableKey",
|
|
170
|
-
|
|
171
|
-
/** @internal */
|
|
172
|
-
value: function _isWatchableKey(key) {
|
|
173
|
-
return (0, _private_utils.isEnumValue)(WatchableRecordQueryResultKeys, key) || key.startsWith(WatchableCellValuesInFieldKeyPrefix);
|
|
174
|
-
}
|
|
175
|
-
/** @internal */
|
|
176
|
-
|
|
177
|
-
}, {
|
|
178
|
-
key: "_shouldLoadDataForKey",
|
|
179
|
-
value: function _shouldLoadDataForKey(key) {
|
|
180
|
-
return key === RecordQueryResult.WatchableKeys.records || key === RecordQueryResult.WatchableKeys.recordIds || key === RecordQueryResult.WatchableKeys.cellValues || key === RecordQueryResult.WatchableKeys.recordColors || key === RecordQueryResult.WatchableKeys.groups || key === RecordQueryResult.WatchableKeys.groupLevels || key.startsWith(RecordQueryResult.WatchableCellValuesInFieldKeyPrefix);
|
|
181
|
-
}
|
|
182
|
-
/** @internal */
|
|
183
|
-
|
|
184
|
-
}, {
|
|
185
|
-
key: "_normalizeOpts",
|
|
186
|
-
value: function _normalizeOpts(table, recordStore, opts) {
|
|
187
|
-
var _normalizeSortsOrGrou;
|
|
188
|
-
|
|
189
|
-
var sorts = (_normalizeSortsOrGrou = normalizeSortsOrGroups(table, opts.sorts)) !== null && _normalizeSortsOrGrou !== void 0 ? _normalizeSortsOrGrou : null;
|
|
190
|
-
var fieldIdsOrNullIfAllFields = null;
|
|
191
|
-
|
|
192
|
-
if (opts.fields) {
|
|
193
|
-
(0, _error_utils.invariant)(Array.isArray(opts.fields), 'Must specify an array of fields');
|
|
194
|
-
fieldIdsOrNullIfAllFields = [];
|
|
195
|
-
var _iteratorNormalCompletion = true;
|
|
196
|
-
var _didIteratorError = false;
|
|
197
|
-
var _iteratorError = undefined;
|
|
198
|
-
|
|
199
|
-
try {
|
|
200
|
-
for (var _iterator = opts.fields[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
|
|
201
|
-
var fieldOrFieldIdOrFieldName = _step.value;
|
|
202
|
-
|
|
203
|
-
if (!fieldOrFieldIdOrFieldName) {
|
|
204
|
-
// Filter out false-y values so users of this API
|
|
205
|
-
// can conveniently list conditional fields, e.g. [field1, isFoo && field2]
|
|
206
|
-
continue;
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
if (typeof fieldOrFieldIdOrFieldName !== 'string' && !(fieldOrFieldIdOrFieldName instanceof _field2.default)) {
|
|
210
|
-
throw (0, _error_utils.spawnError)('Invalid value for field, expected a field, id, or name but got: %s', fieldOrFieldIdOrFieldName);
|
|
211
|
-
}
|
|
212
|
-
|
|
213
|
-
var field = table.__getFieldMatching(fieldOrFieldIdOrFieldName);
|
|
214
|
-
|
|
215
|
-
fieldIdsOrNullIfAllFields.push(field.id);
|
|
216
|
-
}
|
|
217
|
-
} catch (err) {
|
|
218
|
-
_didIteratorError = true;
|
|
219
|
-
_iteratorError = err;
|
|
220
|
-
} finally {
|
|
221
|
-
try {
|
|
222
|
-
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
223
|
-
_iterator.return();
|
|
224
|
-
}
|
|
225
|
-
} finally {
|
|
226
|
-
if (_didIteratorError) {
|
|
227
|
-
throw _iteratorError;
|
|
228
|
-
}
|
|
229
|
-
}
|
|
230
|
-
}
|
|
231
|
-
}
|
|
232
|
-
|
|
233
|
-
var recordColorMode = opts.recordColorMode || _record_coloring.modes.none();
|
|
234
|
-
|
|
235
|
-
switch (recordColorMode.type) {
|
|
236
|
-
case _record_coloring.ModeTypes.NONE:
|
|
237
|
-
break;
|
|
238
|
-
|
|
239
|
-
case _record_coloring.ModeTypes.BY_SELECT_FIELD:
|
|
240
|
-
(0, _error_utils.invariant)(recordColorMode.selectField.type === _field.FieldType.SINGLE_SELECT, 'Invalid field for coloring records by select field: expected a %s, but got a %s', _field.FieldType.SINGLE_SELECT, recordColorMode.selectField.type);
|
|
241
|
-
(0, _error_utils.invariant)(recordColorMode.selectField.parentTable === table, 'Invalid field for coloring records by select field: the single select field is not in the same table as the records');
|
|
242
|
-
|
|
243
|
-
if (fieldIdsOrNullIfAllFields) {
|
|
244
|
-
fieldIdsOrNullIfAllFields.push(recordColorMode.selectField.id);
|
|
245
|
-
}
|
|
246
|
-
|
|
247
|
-
break;
|
|
248
|
-
|
|
249
|
-
case _record_coloring.ModeTypes.BY_VIEW:
|
|
250
|
-
(0, _error_utils.invariant)(recordColorMode.view.parentTable === table, 'Invalid view for coloring records from view: the view is not in the same table as the records');
|
|
251
|
-
break;
|
|
252
|
-
|
|
253
|
-
default:
|
|
254
|
-
throw (0, _error_utils.spawnError)('Unknown record coloring mode type: %s', (0, _private_utils.cast)(recordColorMode).type);
|
|
255
|
-
}
|
|
256
|
-
|
|
257
|
-
(0, _error_utils.invariant)(table.id === recordStore.tableId, 'record store and table must match');
|
|
258
|
-
return {
|
|
259
|
-
sorts,
|
|
260
|
-
fieldIdsOrNullIfAllFields,
|
|
261
|
-
recordColorMode,
|
|
262
|
-
table,
|
|
263
|
-
recordStore
|
|
264
|
-
};
|
|
265
|
-
}
|
|
266
|
-
/** @internal */
|
|
267
|
-
|
|
268
|
-
}]);
|
|
269
|
-
|
|
294
|
+
var RecordQueryResult = /*#__PURE__*/function (_AbstractModelWithAsy) {
|
|
270
295
|
/**
|
|
271
296
|
* @internal
|
|
272
297
|
*/
|
|
273
298
|
function RecordQueryResult(sdk, normalizedOpts) {
|
|
274
299
|
var _this;
|
|
275
|
-
|
|
276
300
|
(0, _classCallCheck2.default)(this, RecordQueryResult);
|
|
277
|
-
_this = (
|
|
278
|
-
|
|
279
|
-
(0, _defineProperty2.default)(
|
|
280
|
-
|
|
301
|
+
_this = _callSuper(this, RecordQueryResult, [sdk, (0, _private_utils.getLocallyUniqueId)('RecordQueryResult')]);
|
|
302
|
+
/** @internal */
|
|
303
|
+
(0, _defineProperty2.default)(_this, "_normalizedOpts", void 0);
|
|
304
|
+
/** @internal */
|
|
305
|
+
(0, _defineProperty2.default)(_this, "_recordStore", void 0);
|
|
306
|
+
/** @internal */
|
|
307
|
+
(0, _defineProperty2.default)(_this, "_recordColorChangeHandler", null);
|
|
281
308
|
_this._normalizedOpts = normalizedOpts;
|
|
282
309
|
_this._recordStore = normalizedOpts.recordStore;
|
|
283
310
|
return _this;
|
|
284
311
|
}
|
|
312
|
+
|
|
285
313
|
/**
|
|
286
314
|
* @internal
|
|
287
315
|
*/
|
|
316
|
+
(0, _inherits2.default)(RecordQueryResult, _AbstractModelWithAsy);
|
|
317
|
+
return (0, _createClass2.default)(RecordQueryResult, [{
|
|
318
|
+
key: "_serializedOpts",
|
|
319
|
+
get: function get() {
|
|
320
|
+
return JSON.stringify([this._normalizedOpts.sorts, this._normalizedOpts.fieldIdsOrNullIfAllFields, this._normalizedOpts.table.id, (0, _record_coloring.serialize)(this._normalizedOpts.recordColorMode)]);
|
|
321
|
+
}
|
|
288
322
|
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
323
|
+
/**
|
|
324
|
+
* The records in this RecordQueryResult.
|
|
325
|
+
* Throws if data is not loaded yet.
|
|
326
|
+
* Can be watched.
|
|
327
|
+
*/
|
|
328
|
+
}, {
|
|
329
|
+
key: "records",
|
|
330
|
+
get: function get() {
|
|
331
|
+
return this.recordIds.map(recordId => {
|
|
332
|
+
var record = this._recordStore.getRecordByIdIfExists(recordId);
|
|
333
|
+
(0, _error_utils.invariant)(record, 'Record missing in table');
|
|
334
|
+
return record;
|
|
335
|
+
});
|
|
336
|
+
}
|
|
292
337
|
|
|
293
338
|
/**
|
|
294
339
|
* Get a specific record in the query result, or null if that record doesn't exist or is
|
|
@@ -296,55 +341,54 @@ function (_AbstractModelWithAsy) {
|
|
|
296
341
|
*
|
|
297
342
|
* @param recordId the ID of the {@link Record} you want
|
|
298
343
|
*/
|
|
344
|
+
}, {
|
|
345
|
+
key: "getRecordByIdIfExists",
|
|
299
346
|
value: function getRecordByIdIfExists(recordId) {
|
|
300
347
|
var record = this._recordStore.getRecordByIdIfExists(recordId);
|
|
301
|
-
|
|
302
348
|
if (!record || !this.hasRecord(record)) {
|
|
303
349
|
return null;
|
|
304
350
|
}
|
|
305
|
-
|
|
306
351
|
return record;
|
|
307
352
|
}
|
|
353
|
+
|
|
308
354
|
/**
|
|
309
355
|
* Get a specific record in the query result, or throws if that record doesn't exist or is
|
|
310
356
|
* filtered out. Throws if data is not loaded yet. Watch using `'recordIds'`.
|
|
311
357
|
*
|
|
312
358
|
* @param recordId the ID of the {@link Record} you want
|
|
313
359
|
*/
|
|
314
|
-
|
|
315
360
|
}, {
|
|
316
361
|
key: "getRecordById",
|
|
317
362
|
value: function getRecordById(recordId) {
|
|
318
363
|
var record = this.getRecordByIdIfExists(recordId);
|
|
319
|
-
|
|
320
364
|
if (!record) {
|
|
321
365
|
throw (0, _error_utils.spawnError)('No record with ID %s in this query result', recordId);
|
|
322
366
|
}
|
|
323
|
-
|
|
324
367
|
return record;
|
|
325
368
|
}
|
|
369
|
+
|
|
326
370
|
/**
|
|
327
371
|
* @internal
|
|
328
372
|
*/
|
|
329
|
-
|
|
330
373
|
}, {
|
|
331
374
|
key: "_getRecord",
|
|
332
375
|
value: function _getRecord(recordOrRecordId) {
|
|
333
376
|
return this.getRecordById(typeof recordOrRecordId === 'string' ? recordOrRecordId : recordOrRecordId.id);
|
|
334
377
|
}
|
|
378
|
+
|
|
335
379
|
/**
|
|
336
380
|
* Check to see if a particular record or record id is present in this query result. Returns
|
|
337
381
|
* false if the record has been deleted or is filtered out.
|
|
338
382
|
*
|
|
339
383
|
* @param recordOrRecordId the record or record id to check the presence of
|
|
340
384
|
*/
|
|
341
|
-
|
|
342
385
|
}, {
|
|
343
386
|
key: "hasRecord",
|
|
344
387
|
value: function hasRecord(recordOrRecordId) {
|
|
345
388
|
var recordId = typeof recordOrRecordId === 'string' ? recordOrRecordId : recordOrRecordId.id;
|
|
346
389
|
return this._getOrGenerateRecordIdsSet()[recordId] === true;
|
|
347
390
|
}
|
|
391
|
+
|
|
348
392
|
/**
|
|
349
393
|
* Get the {@link Color} of a specific record in the query result. Returns null if the record
|
|
350
394
|
* has no color in this query result. Throws if the record isn't in the RecordQueryResult. Watch
|
|
@@ -352,45 +396,39 @@ function (_AbstractModelWithAsy) {
|
|
|
352
396
|
*
|
|
353
397
|
* @param recordOrRecordId the record or record ID you want the color of.
|
|
354
398
|
*/
|
|
355
|
-
|
|
356
399
|
}, {
|
|
357
400
|
key: "getRecordColor",
|
|
358
401
|
value: function getRecordColor(recordOrRecordId) {
|
|
359
402
|
var record = this._getRecord(recordOrRecordId);
|
|
360
|
-
|
|
361
403
|
var recordColorMode = this._normalizedOpts.recordColorMode;
|
|
362
|
-
|
|
363
404
|
switch (recordColorMode.type) {
|
|
364
405
|
case _record_coloring.ModeTypes.NONE:
|
|
365
406
|
return null;
|
|
366
|
-
|
|
367
407
|
case _record_coloring.ModeTypes.BY_SELECT_FIELD:
|
|
368
408
|
{
|
|
369
409
|
if (recordColorMode.selectField.type !== _field.FieldType.SINGLE_SELECT) {
|
|
370
410
|
return null;
|
|
371
411
|
}
|
|
372
|
-
|
|
373
412
|
var value = record.getCellValue(recordColorMode.selectField);
|
|
374
413
|
return value && typeof value === 'object' && typeof value.color === 'string' ? (0, _private_utils.assertEnumValue)(_colors.default, value.color) : null;
|
|
375
414
|
}
|
|
376
|
-
|
|
377
415
|
case _record_coloring.ModeTypes.BY_VIEW:
|
|
378
416
|
return this._recordStore.getViewDataStore(recordColorMode.view.id).getRecordColor(record);
|
|
379
417
|
// istanbul ignore next
|
|
380
|
-
|
|
381
418
|
default:
|
|
382
419
|
throw (0, _error_utils.spawnError)('Unknown record coloring mode type: %s', (0, _private_utils.cast)(recordColorMode).type);
|
|
383
420
|
}
|
|
384
421
|
}
|
|
422
|
+
|
|
385
423
|
/**
|
|
386
424
|
* @internal
|
|
387
425
|
*/
|
|
388
|
-
|
|
389
426
|
}, {
|
|
390
427
|
key: "_onChangeIsDataLoaded",
|
|
391
428
|
value: function _onChangeIsDataLoaded() {
|
|
392
429
|
this._onChange(WatchableRecordQueryResultKeys.isDataLoaded);
|
|
393
430
|
}
|
|
431
|
+
|
|
394
432
|
/**
|
|
395
433
|
* Get notified of changes to the query result.
|
|
396
434
|
*
|
|
@@ -414,40 +452,27 @@ function (_AbstractModelWithAsy) {
|
|
|
414
452
|
* @param callback a function to call when those keys change
|
|
415
453
|
* @param context an optional context for `this` in `callback`.
|
|
416
454
|
*/
|
|
417
|
-
|
|
418
455
|
}, {
|
|
419
456
|
key: "watch",
|
|
420
457
|
value: function watch(keys, callback, context) {
|
|
421
458
|
var validKeys = (0, _get2.default)((0, _getPrototypeOf2.default)(RecordQueryResult.prototype), "watch", this).call(this, keys, callback, context);
|
|
422
|
-
var
|
|
423
|
-
|
|
424
|
-
var _iteratorError2 = undefined;
|
|
425
|
-
|
|
459
|
+
var _iterator = _createForOfIteratorHelper(validKeys),
|
|
460
|
+
_step;
|
|
426
461
|
try {
|
|
427
|
-
for (
|
|
428
|
-
var key =
|
|
429
|
-
|
|
462
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
463
|
+
var key = _step.value;
|
|
430
464
|
if (key === WatchableRecordQueryResultKeys.recordColors) {
|
|
431
465
|
this._watchRecordColorsIfNeeded();
|
|
432
466
|
}
|
|
433
467
|
}
|
|
434
468
|
} catch (err) {
|
|
435
|
-
|
|
436
|
-
_iteratorError2 = err;
|
|
469
|
+
_iterator.e(err);
|
|
437
470
|
} finally {
|
|
438
|
-
|
|
439
|
-
if (!_iteratorNormalCompletion2 && _iterator2.return != null) {
|
|
440
|
-
_iterator2.return();
|
|
441
|
-
}
|
|
442
|
-
} finally {
|
|
443
|
-
if (_didIteratorError2) {
|
|
444
|
-
throw _iteratorError2;
|
|
445
|
-
}
|
|
446
|
-
}
|
|
471
|
+
_iterator.f();
|
|
447
472
|
}
|
|
448
|
-
|
|
449
473
|
return validKeys;
|
|
450
474
|
}
|
|
475
|
+
|
|
451
476
|
/**
|
|
452
477
|
* Unwatch keys watched with `.watch`.
|
|
453
478
|
*
|
|
@@ -462,63 +487,47 @@ function (_AbstractModelWithAsy) {
|
|
|
462
487
|
* @param callback the function passed to `.watch` for these keys
|
|
463
488
|
* @param context the context that was passed to `.watch` for this `callback`
|
|
464
489
|
*/
|
|
465
|
-
|
|
466
490
|
}, {
|
|
467
491
|
key: "unwatch",
|
|
468
492
|
value: function unwatch(keys, callback, context) {
|
|
469
493
|
var validKeys = (0, _get2.default)((0, _getPrototypeOf2.default)(RecordQueryResult.prototype), "unwatch", this).call(this, keys, callback, context);
|
|
470
|
-
var
|
|
471
|
-
|
|
472
|
-
var _iteratorError3 = undefined;
|
|
473
|
-
|
|
494
|
+
var _iterator2 = _createForOfIteratorHelper(validKeys),
|
|
495
|
+
_step2;
|
|
474
496
|
try {
|
|
475
|
-
for (
|
|
476
|
-
var key =
|
|
477
|
-
|
|
497
|
+
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
498
|
+
var key = _step2.value;
|
|
478
499
|
if (key === WatchableRecordQueryResultKeys.recordColors) {
|
|
479
500
|
this._unwatchRecordColorsIfPossible();
|
|
480
501
|
}
|
|
481
502
|
}
|
|
482
503
|
} catch (err) {
|
|
483
|
-
|
|
484
|
-
_iteratorError3 = err;
|
|
504
|
+
_iterator2.e(err);
|
|
485
505
|
} finally {
|
|
486
|
-
|
|
487
|
-
if (!_iteratorNormalCompletion3 && _iterator3.return != null) {
|
|
488
|
-
_iterator3.return();
|
|
489
|
-
}
|
|
490
|
-
} finally {
|
|
491
|
-
if (_didIteratorError3) {
|
|
492
|
-
throw _iteratorError3;
|
|
493
|
-
}
|
|
494
|
-
}
|
|
506
|
+
_iterator2.f();
|
|
495
507
|
}
|
|
496
|
-
|
|
497
508
|
return validKeys;
|
|
498
509
|
}
|
|
510
|
+
|
|
499
511
|
/**
|
|
500
512
|
* @internal
|
|
501
513
|
*/
|
|
502
|
-
|
|
503
514
|
}, {
|
|
504
515
|
key: "_watchRecordColorsIfNeeded",
|
|
505
516
|
value: function _watchRecordColorsIfNeeded() {
|
|
506
517
|
(0, _error_utils.invariant)(this._changeWatchersByKey[WatchableRecordQueryResultKeys.recordColors], 'method may only be called when `recordColors` key has been watched');
|
|
507
518
|
var watchCount = this._changeWatchersByKey[WatchableRecordQueryResultKeys.recordColors].length;
|
|
508
|
-
|
|
509
519
|
if (!this._recordColorChangeHandler && watchCount >= 1) {
|
|
510
520
|
this._watchRecordColors();
|
|
511
521
|
}
|
|
512
522
|
}
|
|
523
|
+
|
|
513
524
|
/**
|
|
514
525
|
* @internal
|
|
515
526
|
*/
|
|
516
|
-
|
|
517
527
|
}, {
|
|
518
528
|
key: "_watchRecordColors",
|
|
519
529
|
value: function _watchRecordColors() {
|
|
520
530
|
var recordColorMode = this._normalizedOpts.recordColorMode;
|
|
521
|
-
|
|
522
531
|
var handler = (model, key, recordIds) => {
|
|
523
532
|
if (model === this) {
|
|
524
533
|
this._onChange(WatchableRecordQueryResultKeys.recordColors, recordIds);
|
|
@@ -526,175 +535,207 @@ function (_AbstractModelWithAsy) {
|
|
|
526
535
|
this._onChange(WatchableRecordQueryResultKeys.recordColors);
|
|
527
536
|
}
|
|
528
537
|
};
|
|
529
|
-
|
|
530
538
|
switch (recordColorMode.type) {
|
|
531
539
|
case _record_coloring.ModeTypes.NONE:
|
|
532
540
|
break;
|
|
533
|
-
|
|
534
541
|
case _record_coloring.ModeTypes.BY_SELECT_FIELD:
|
|
535
542
|
this.watch("".concat(WatchableCellValuesInFieldKeyPrefix).concat(recordColorMode.selectField.id), handler);
|
|
536
543
|
recordColorMode.selectField.watch('options', handler);
|
|
537
544
|
break;
|
|
538
|
-
|
|
539
545
|
case _record_coloring.ModeTypes.BY_VIEW:
|
|
540
546
|
{
|
|
541
547
|
this._recordStore.getViewDataStore(recordColorMode.view.id).watch('recordColors', handler);
|
|
542
|
-
|
|
543
548
|
break;
|
|
544
549
|
}
|
|
545
550
|
// istanbul ignore next
|
|
546
|
-
|
|
547
551
|
default:
|
|
548
552
|
throw (0, _error_utils.spawnError)('Unknown record coloring mode type: %s', (0, _private_utils.cast)(recordColorMode).type);
|
|
549
553
|
}
|
|
550
|
-
|
|
551
554
|
this._recordColorChangeHandler = handler;
|
|
552
555
|
}
|
|
556
|
+
|
|
553
557
|
/**
|
|
554
558
|
* @internal
|
|
555
559
|
*/
|
|
556
|
-
|
|
557
560
|
}, {
|
|
558
561
|
key: "_unwatchRecordColorsIfPossible",
|
|
559
562
|
value: function _unwatchRecordColorsIfPossible() {
|
|
560
563
|
var watchCount = (this._changeWatchersByKey[WatchableRecordQueryResultKeys.recordColors] || []).length;
|
|
561
|
-
|
|
562
564
|
if (this._recordColorChangeHandler && watchCount === 0) {
|
|
563
565
|
this._unwatchRecordColors();
|
|
564
566
|
}
|
|
565
567
|
}
|
|
568
|
+
|
|
566
569
|
/**
|
|
567
570
|
* @internal
|
|
568
571
|
*/
|
|
569
|
-
|
|
570
572
|
}, {
|
|
571
573
|
key: "_unwatchRecordColors",
|
|
572
574
|
value: function _unwatchRecordColors() {
|
|
573
575
|
var recordColorMode = this._normalizedOpts.recordColorMode;
|
|
574
576
|
var handler = this._recordColorChangeHandler;
|
|
575
577
|
(0, _error_utils.invariant)(handler, 'record color change handler must exist');
|
|
576
|
-
|
|
577
578
|
switch (recordColorMode.type) {
|
|
578
579
|
case _record_coloring.ModeTypes.NONE:
|
|
579
580
|
break;
|
|
580
|
-
|
|
581
581
|
case _record_coloring.ModeTypes.BY_SELECT_FIELD:
|
|
582
582
|
this.unwatch("".concat(WatchableCellValuesInFieldKeyPrefix).concat(recordColorMode.selectField.id), handler);
|
|
583
583
|
recordColorMode.selectField.unwatch('options', handler);
|
|
584
584
|
break;
|
|
585
|
-
|
|
586
585
|
case _record_coloring.ModeTypes.BY_VIEW:
|
|
587
586
|
{
|
|
588
587
|
if (!recordColorMode.view.isDeleted) {
|
|
589
588
|
this._recordStore.getViewDataStore(recordColorMode.view.id).unwatch('recordColors', handler);
|
|
590
589
|
}
|
|
591
|
-
|
|
592
590
|
break;
|
|
593
591
|
}
|
|
594
592
|
// istanbul ignore next
|
|
595
|
-
|
|
596
593
|
default:
|
|
597
594
|
throw (0, _error_utils.spawnError)('Unknown record coloring mode type: %s', (0, _private_utils.cast)(recordColorMode).type);
|
|
598
595
|
}
|
|
599
|
-
|
|
600
596
|
this._recordColorChangeHandler = null;
|
|
601
597
|
}
|
|
598
|
+
|
|
602
599
|
/**
|
|
603
600
|
* @internal
|
|
604
601
|
*/
|
|
605
|
-
|
|
606
602
|
}, {
|
|
607
603
|
key: "_loadRecordColorsAsync",
|
|
608
|
-
value: function
|
|
609
|
-
var
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
switch (_context.prev = _context.next) {
|
|
604
|
+
value: (function () {
|
|
605
|
+
var _loadRecordColorsAsync2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
|
|
606
|
+
var recordColorMode;
|
|
607
|
+
return _regenerator.default.wrap(function _callee$(_context) {
|
|
608
|
+
while (1) switch (_context.prev = _context.next) {
|
|
613
609
|
case 0:
|
|
614
610
|
recordColorMode = this._normalizedOpts.recordColorMode;
|
|
615
611
|
_context.t0 = recordColorMode.type;
|
|
616
612
|
_context.next = _context.t0 === _record_coloring.ModeTypes.NONE ? 4 : _context.t0 === _record_coloring.ModeTypes.BY_SELECT_FIELD ? 5 : _context.t0 === _record_coloring.ModeTypes.BY_VIEW ? 6 : 9;
|
|
617
613
|
break;
|
|
618
|
-
|
|
619
614
|
case 4:
|
|
620
615
|
return _context.abrupt("return");
|
|
621
|
-
|
|
622
616
|
case 5:
|
|
623
617
|
return _context.abrupt("return");
|
|
624
|
-
|
|
625
618
|
case 6:
|
|
626
619
|
_context.next = 8;
|
|
627
|
-
return
|
|
628
|
-
|
|
620
|
+
return this._recordStore.getViewDataStore(recordColorMode.view.id).loadDataAsync();
|
|
629
621
|
case 8:
|
|
630
622
|
return _context.abrupt("return");
|
|
631
|
-
|
|
632
623
|
case 9:
|
|
633
624
|
throw (0, _error_utils.spawnUnknownSwitchCaseError)('record color mode type', recordColorMode, 'type');
|
|
634
|
-
|
|
635
625
|
case 10:
|
|
636
626
|
case "end":
|
|
637
627
|
return _context.stop();
|
|
638
628
|
}
|
|
639
|
-
}
|
|
640
|
-
}
|
|
641
|
-
|
|
629
|
+
}, _callee, this);
|
|
630
|
+
}));
|
|
631
|
+
function _loadRecordColorsAsync() {
|
|
632
|
+
return _loadRecordColorsAsync2.apply(this, arguments);
|
|
633
|
+
}
|
|
634
|
+
return _loadRecordColorsAsync;
|
|
635
|
+
}()
|
|
642
636
|
/**
|
|
643
637
|
* @internal
|
|
644
638
|
*/
|
|
645
|
-
|
|
639
|
+
)
|
|
646
640
|
}, {
|
|
647
641
|
key: "_unloadRecordColors",
|
|
648
642
|
value: function _unloadRecordColors() {
|
|
649
643
|
var recordColorMode = this._normalizedOpts.recordColorMode;
|
|
650
|
-
|
|
651
644
|
switch (recordColorMode.type) {
|
|
652
645
|
case _record_coloring.ModeTypes.NONE:
|
|
653
646
|
return;
|
|
654
|
-
|
|
655
647
|
case _record_coloring.ModeTypes.BY_SELECT_FIELD:
|
|
656
648
|
// handled as part of fieldIdsOrNullIfAllFields
|
|
657
649
|
return;
|
|
658
|
-
|
|
659
650
|
case _record_coloring.ModeTypes.BY_VIEW:
|
|
660
651
|
if (!recordColorMode.view.isDeleted) {
|
|
661
652
|
this._recordStore.getViewDataStore(recordColorMode.view.id).unloadData();
|
|
662
653
|
}
|
|
663
|
-
|
|
664
654
|
break;
|
|
665
655
|
// istanbul ignore next
|
|
666
|
-
|
|
667
656
|
default:
|
|
668
657
|
throw (0, _error_utils.spawnUnknownSwitchCaseError)('record color mode type', recordColorMode, 'type');
|
|
669
658
|
}
|
|
670
659
|
}
|
|
660
|
+
}], [{
|
|
661
|
+
key: "_isWatchableKey",
|
|
662
|
+
value: /** @internal */
|
|
663
|
+
function _isWatchableKey(key) {
|
|
664
|
+
return (0, _private_utils.isEnumValue)(WatchableRecordQueryResultKeys, key) || key.startsWith(WatchableCellValuesInFieldKeyPrefix);
|
|
665
|
+
}
|
|
666
|
+
/** @internal */
|
|
671
667
|
}, {
|
|
672
|
-
key: "
|
|
673
|
-
|
|
674
|
-
return
|
|
668
|
+
key: "_shouldLoadDataForKey",
|
|
669
|
+
value: function _shouldLoadDataForKey(key) {
|
|
670
|
+
return key === RecordQueryResult.WatchableKeys.records || key === RecordQueryResult.WatchableKeys.recordIds || key === RecordQueryResult.WatchableKeys.cellValues || key === RecordQueryResult.WatchableKeys.recordColors || key === RecordQueryResult.WatchableKeys.groups || key === RecordQueryResult.WatchableKeys.groupLevels || key.startsWith(RecordQueryResult.WatchableCellValuesInFieldKeyPrefix);
|
|
675
671
|
}
|
|
676
|
-
/**
|
|
677
|
-
* The records in this RecordQueryResult.
|
|
678
|
-
* Throws if data is not loaded yet.
|
|
679
|
-
* Can be watched.
|
|
680
|
-
*/
|
|
681
672
|
|
|
673
|
+
/** @internal */
|
|
682
674
|
}, {
|
|
683
|
-
key: "
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
675
|
+
key: "_normalizeOpts",
|
|
676
|
+
value: function _normalizeOpts(table, recordStore, opts) {
|
|
677
|
+
var _normalizeSortsOrGrou;
|
|
678
|
+
var sorts = (_normalizeSortsOrGrou = normalizeSortsOrGroups(table, opts.sorts)) !== null && _normalizeSortsOrGrou !== void 0 ? _normalizeSortsOrGrou : null;
|
|
679
|
+
var fieldIdsOrNullIfAllFields = null;
|
|
680
|
+
if (opts.fields) {
|
|
681
|
+
(0, _error_utils.invariant)(Array.isArray(opts.fields), 'Must specify an array of fields');
|
|
682
|
+
fieldIdsOrNullIfAllFields = [];
|
|
683
|
+
var _iterator3 = _createForOfIteratorHelper(opts.fields),
|
|
684
|
+
_step3;
|
|
685
|
+
try {
|
|
686
|
+
for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
|
|
687
|
+
var fieldOrFieldIdOrFieldName = _step3.value;
|
|
688
|
+
if (!fieldOrFieldIdOrFieldName) {
|
|
689
|
+
// Filter out false-y values so users of this API
|
|
690
|
+
// can conveniently list conditional fields, e.g. [field1, isFoo && field2]
|
|
691
|
+
continue;
|
|
692
|
+
}
|
|
693
|
+
if (typeof fieldOrFieldIdOrFieldName !== 'string' && !(fieldOrFieldIdOrFieldName instanceof _field2.default)) {
|
|
694
|
+
throw (0, _error_utils.spawnError)('Invalid value for field, expected a field, id, or name but got: %s', fieldOrFieldIdOrFieldName);
|
|
695
|
+
}
|
|
696
|
+
var field = table.__getFieldMatching(fieldOrFieldIdOrFieldName);
|
|
697
|
+
fieldIdsOrNullIfAllFields.push(field.id);
|
|
698
|
+
}
|
|
699
|
+
} catch (err) {
|
|
700
|
+
_iterator3.e(err);
|
|
701
|
+
} finally {
|
|
702
|
+
_iterator3.f();
|
|
703
|
+
}
|
|
704
|
+
}
|
|
705
|
+
var recordColorMode = opts.recordColorMode || _record_coloring.modes.none();
|
|
706
|
+
switch (recordColorMode.type) {
|
|
707
|
+
case _record_coloring.ModeTypes.NONE:
|
|
708
|
+
break;
|
|
709
|
+
case _record_coloring.ModeTypes.BY_SELECT_FIELD:
|
|
710
|
+
(0, _error_utils.invariant)(recordColorMode.selectField.type === _field.FieldType.SINGLE_SELECT, 'Invalid field for coloring records by select field: expected a %s, but got a %s', _field.FieldType.SINGLE_SELECT, recordColorMode.selectField.type);
|
|
711
|
+
(0, _error_utils.invariant)(recordColorMode.selectField.parentTable === table, 'Invalid field for coloring records by select field: the single select field is not in the same table as the records');
|
|
712
|
+
if (fieldIdsOrNullIfAllFields) {
|
|
713
|
+
fieldIdsOrNullIfAllFields.push(recordColorMode.selectField.id);
|
|
714
|
+
}
|
|
715
|
+
break;
|
|
716
|
+
case _record_coloring.ModeTypes.BY_VIEW:
|
|
717
|
+
(0, _error_utils.invariant)(recordColorMode.view.parentTable === table, 'Invalid view for coloring records from view: the view is not in the same table as the records');
|
|
718
|
+
break;
|
|
719
|
+
default:
|
|
720
|
+
throw (0, _error_utils.spawnError)('Unknown record coloring mode type: %s', (0, _private_utils.cast)(recordColorMode).type);
|
|
721
|
+
}
|
|
722
|
+
(0, _error_utils.invariant)(table.id === recordStore.tableId, 'record store and table must match');
|
|
723
|
+
return {
|
|
724
|
+
sorts,
|
|
725
|
+
fieldIdsOrNullIfAllFields,
|
|
726
|
+
recordColorMode,
|
|
727
|
+
table,
|
|
728
|
+
recordStore
|
|
729
|
+
};
|
|
691
730
|
}
|
|
692
731
|
}]);
|
|
693
|
-
return RecordQueryResult;
|
|
694
732
|
}(_abstract_model_with_async_data.default);
|
|
695
|
-
|
|
733
|
+
// Abstract properties - classes extending QueryResult must override these:
|
|
734
|
+
/** @internal */
|
|
696
735
|
(0, _defineProperty2.default)(RecordQueryResult, "_className", 'RecordQueryResult');
|
|
736
|
+
// provided properties + methods:
|
|
737
|
+
/** @internal */
|
|
697
738
|
(0, _defineProperty2.default)(RecordQueryResult, "WatchableKeys", WatchableRecordQueryResultKeys);
|
|
739
|
+
/** @internal */
|
|
698
740
|
(0, _defineProperty2.default)(RecordQueryResult, "WatchableCellValuesInFieldKeyPrefix", WatchableCellValuesInFieldKeyPrefix);
|
|
699
|
-
var _default = RecordQueryResult;
|
|
700
|
-
exports.default = _default;
|
|
741
|
+
var _default = exports.default = RecordQueryResult;
|