@airtable/blocks 1.18.0 → 1.18.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +552 -0
- package/dist/cjs/color_utils.js +21 -23
- package/dist/cjs/colors.js +4 -60
- package/dist/cjs/error_utils.js +15 -25
- package/dist/cjs/event_tracker.js +5 -11
- package/dist/cjs/global_config.js +107 -188
- package/dist/cjs/index.js +16 -40
- package/dist/cjs/injected/airtable_interface.js +1 -6
- package/dist/cjs/models/abstract_model.js +50 -81
- package/dist/cjs/models/abstract_model_with_async_data.js +102 -177
- package/dist/cjs/models/base.js +211 -374
- package/dist/cjs/models/create_aggregators.js +53 -47
- package/dist/cjs/models/cursor.js +125 -201
- package/dist/cjs/models/field.js +256 -303
- package/dist/cjs/models/grouped_record_query_result.js +210 -286
- package/dist/cjs/models/linked_records_query_result.js +276 -454
- package/dist/cjs/models/models.js +36 -50
- package/dist/cjs/models/mutation_constants.js +5 -9
- package/dist/cjs/models/mutations.js +125 -338
- package/dist/cjs/models/object_pool.js +37 -94
- package/dist/cjs/models/record.js +132 -226
- package/dist/cjs/models/record_coloring.js +14 -19
- package/dist/cjs/models/record_query_result.js +323 -282
- package/dist/cjs/models/record_store.js +355 -688
- package/dist/cjs/models/session.js +99 -158
- package/dist/cjs/models/table.js +361 -549
- package/dist/cjs/models/table_or_view_query_result.js +410 -765
- package/dist/cjs/models/view.js +161 -204
- package/dist/cjs/models/view_data_store.js +177 -282
- package/dist/cjs/models/view_metadata_query_result.js +96 -127
- package/dist/cjs/perform_record_action.js +69 -103
- package/dist/cjs/private_utils.js +133 -223
- package/dist/cjs/sdk.js +97 -142
- package/dist/cjs/settings_button.js +30 -57
- package/dist/cjs/stats/block_stats.js +3 -15
- package/dist/cjs/testing/abstract_mock_airtable_interface.js +53 -97
- package/dist/cjs/types/airtable_interface.js +36 -8
- package/dist/cjs/types/field.js +66 -12
- package/dist/cjs/types/mutations.js +99 -6
- package/dist/cjs/types/permission_levels.js +2 -4
- package/dist/cjs/types/undo_redo.js +2 -3
- package/dist/cjs/types/view.js +16 -11
- package/dist/cjs/ui/base_provider.js +14 -9
- package/dist/cjs/ui/baymax_utils.js +107 -1102
- package/dist/cjs/ui/block_wrapper.js +30 -68
- package/dist/cjs/ui/box.js +52 -56
- package/dist/cjs/ui/button.js +60 -77
- package/dist/cjs/ui/cell_renderer.js +78 -139
- package/dist/cjs/ui/choice_token.js +45 -47
- package/dist/cjs/ui/collaborator_token.js +33 -54
- package/dist/cjs/ui/color_palette.js +58 -106
- package/dist/cjs/ui/color_palette_synced.js +41 -52
- package/dist/cjs/ui/confirmation_dialog.js +53 -69
- package/dist/cjs/ui/control_sizes.js +21 -46
- package/dist/cjs/ui/create_detect_element_resize.js +16 -50
- package/dist/cjs/ui/css_helpers.js +3 -10
- package/dist/cjs/ui/dialog.js +44 -71
- package/dist/cjs/ui/dialog_close_button.js +52 -72
- package/dist/cjs/ui/expand_record.js +4 -11
- package/dist/cjs/ui/expand_record_list.js +6 -11
- package/dist/cjs/ui/expand_record_picker_async.js +18 -35
- package/dist/cjs/ui/field_icon.js +25 -28
- package/dist/cjs/ui/field_picker.js +47 -81
- package/dist/cjs/ui/field_picker_synced.js +33 -44
- package/dist/cjs/ui/form_field.js +45 -64
- package/dist/cjs/ui/geometry/geometry.js +6 -10
- package/dist/cjs/ui/geometry/point.js +5 -13
- package/dist/cjs/ui/geometry/rect.js +7 -29
- package/dist/cjs/ui/geometry/size.js +5 -13
- package/dist/cjs/ui/global_alert.js +35 -61
- package/dist/cjs/ui/global_config_synced_component_helpers.js +4 -13
- package/dist/cjs/ui/heading.js +63 -92
- package/dist/cjs/ui/icon.js +44 -66
- package/dist/cjs/ui/icon_config.js +13 -24
- package/dist/cjs/ui/initialize_block.js +23 -36
- package/dist/cjs/ui/input.js +74 -87
- package/dist/cjs/ui/input_synced.js +34 -43
- package/dist/cjs/ui/key_codes.js +4 -9
- package/dist/cjs/ui/label.js +45 -50
- package/dist/cjs/ui/link.js +74 -89
- package/dist/cjs/ui/loader.js +26 -42
- package/dist/cjs/ui/modal.js +63 -89
- package/dist/cjs/ui/model_picker_select.js +29 -47
- package/dist/cjs/ui/popover.js +98 -180
- package/dist/cjs/ui/progress_bar.js +45 -51
- package/dist/cjs/ui/record_card.js +143 -278
- package/dist/cjs/ui/record_card_list.js +117 -165
- package/dist/cjs/ui/remote_utils.js +5 -13
- package/dist/cjs/ui/sdk_context.js +7 -9
- package/dist/cjs/ui/select.js +84 -118
- package/dist/cjs/ui/select_and_select_buttons_helpers.js +27 -45
- package/dist/cjs/ui/select_buttons.js +54 -90
- package/dist/cjs/ui/select_buttons_synced.js +32 -41
- package/dist/cjs/ui/select_synced.js +32 -42
- package/dist/cjs/ui/switch.js +66 -84
- package/dist/cjs/ui/switch_synced.js +32 -38
- package/dist/cjs/ui/synced.js +16 -43
- package/dist/cjs/ui/system/all_styles_set.js +89 -22
- package/dist/cjs/ui/system/appearance/appearance_set.js +15 -26
- package/dist/cjs/ui/system/appearance/background_color.js +6 -12
- package/dist/cjs/ui/system/appearance/border.js +6 -12
- package/dist/cjs/ui/system/appearance/border_radius.js +6 -12
- package/dist/cjs/ui/system/appearance/box_shadow.js +6 -12
- package/dist/cjs/ui/system/appearance/opacity.js +5 -11
- package/dist/cjs/ui/system/dimensions/dimensions_set.js +15 -27
- package/dist/cjs/ui/system/dimensions/height.js +5 -11
- package/dist/cjs/ui/system/dimensions/max_height.js +5 -11
- package/dist/cjs/ui/system/dimensions/max_width.js +5 -11
- package/dist/cjs/ui/system/dimensions/min_height.js +5 -11
- package/dist/cjs/ui/system/dimensions/min_width.js +5 -11
- package/dist/cjs/ui/system/dimensions/width.js +5 -11
- package/dist/cjs/ui/system/display.js +8 -9
- package/dist/cjs/ui/system/flex_container/align_content.js +6 -12
- package/dist/cjs/ui/system/flex_container/align_items.js +6 -12
- package/dist/cjs/ui/system/flex_container/flex_container_set.js +15 -27
- package/dist/cjs/ui/system/flex_container/flex_direction.js +5 -11
- package/dist/cjs/ui/system/flex_container/flex_wrap.js +5 -11
- package/dist/cjs/ui/system/flex_container/justify_content.js +5 -11
- package/dist/cjs/ui/system/flex_container/justify_items.js +5 -11
- package/dist/cjs/ui/system/flex_item/align_self.js +6 -12
- package/dist/cjs/ui/system/flex_item/flex.js +5 -11
- package/dist/cjs/ui/system/flex_item/flex_basis.js +5 -11
- package/dist/cjs/ui/system/flex_item/flex_grow.js +5 -11
- package/dist/cjs/ui/system/flex_item/flex_item_set.js +15 -28
- package/dist/cjs/ui/system/flex_item/flex_shrink.js +5 -11
- package/dist/cjs/ui/system/flex_item/justify_self.js +5 -11
- package/dist/cjs/ui/system/flex_item/order.js +5 -11
- package/dist/cjs/ui/system/index.js +310 -362
- package/dist/cjs/ui/system/overflow.js +8 -9
- package/dist/cjs/ui/system/position/bottom.js +6 -13
- package/dist/cjs/ui/system/position/left.js +5 -12
- package/dist/cjs/ui/system/position/position.js +5 -11
- package/dist/cjs/ui/system/position/position_set.js +15 -27
- package/dist/cjs/ui/system/position/right.js +5 -12
- package/dist/cjs/ui/system/position/top.js +5 -12
- package/dist/cjs/ui/system/position/z_index.js +5 -11
- package/dist/cjs/ui/system/spacing/margin.js +5 -12
- package/dist/cjs/ui/system/spacing/padding.js +5 -12
- package/dist/cjs/ui/system/spacing/spacing_set.js +15 -23
- package/dist/cjs/ui/system/typography/font_family.js +5 -11
- package/dist/cjs/ui/system/typography/font_size.js +5 -11
- package/dist/cjs/ui/system/typography/font_style.js +5 -11
- package/dist/cjs/ui/system/typography/font_weight.js +5 -11
- package/dist/cjs/ui/system/typography/letter_spacing.js +5 -11
- package/dist/cjs/ui/system/typography/line_height.js +5 -11
- package/dist/cjs/ui/system/typography/text_align.js +5 -11
- package/dist/cjs/ui/system/typography/text_color.js +5 -11
- package/dist/cjs/ui/system/typography/text_decoration.js +5 -11
- package/dist/cjs/ui/system/typography/text_transform.js +5 -11
- package/dist/cjs/ui/system/typography/typography_set.js +15 -31
- package/dist/cjs/ui/system/utils/create_responsive_prop_type.js +2 -4
- package/dist/cjs/ui/system/utils/create_style_prop_types.js +5 -13
- package/dist/cjs/ui/system/utils/ensure_numbers_are_within_scale.js +2 -14
- package/dist/cjs/ui/system/utils/get_style_props_for_responsive_prop.js +30 -70
- package/dist/cjs/ui/table_picker.js +26 -43
- package/dist/cjs/ui/table_picker_synced.js +33 -42
- package/dist/cjs/ui/text.js +59 -71
- package/dist/cjs/ui/text_button.js +80 -97
- package/dist/cjs/ui/theme/default_theme/button_variants.js +1 -5
- package/dist/cjs/ui/theme/default_theme/control_sizes.js +29 -42
- package/dist/cjs/ui/theme/default_theme/heading_styles.js +4 -5
- package/dist/cjs/ui/theme/default_theme/index.js +15 -32
- package/dist/cjs/ui/theme/default_theme/input_variants.js +1 -5
- package/dist/cjs/ui/theme/default_theme/link_variants.js +1 -5
- package/dist/cjs/ui/theme/default_theme/select_buttons_variants.js +1 -5
- package/dist/cjs/ui/theme/default_theme/select_variants.js +10 -21
- package/dist/cjs/ui/theme/default_theme/switch_variants.js +8 -20
- package/dist/cjs/ui/theme/default_theme/text_button_variants.js +1 -5
- package/dist/cjs/ui/theme/default_theme/text_styles.js +1 -2
- package/dist/cjs/ui/theme/default_theme/tokens.js +33 -35
- package/dist/cjs/ui/theme/theme_context.js +3 -6
- package/dist/cjs/ui/theme/use_theme.js +1 -7
- package/dist/cjs/ui/tooltip.js +38 -79
- package/dist/cjs/ui/types/aria_props.js +3 -7
- package/dist/cjs/ui/types/data_attributes_prop.js +8 -6
- package/dist/cjs/ui/types/tooltip_anchor_props.js +4 -5
- package/dist/cjs/ui/ui.js +89 -130
- package/dist/cjs/ui/unstable_standalone_ui.js +18 -42
- package/dist/cjs/ui/use_array_identity.js +0 -4
- package/dist/cjs/ui/use_base.js +4 -13
- package/dist/cjs/ui/use_cursor.js +3 -12
- package/dist/cjs/ui/use_form_field.js +4 -6
- package/dist/cjs/ui/use_global_config.js +3 -10
- package/dist/cjs/ui/use_loadable.js +59 -132
- package/dist/cjs/ui/use_record_action_data.js +6 -12
- package/dist/cjs/ui/use_records.js +23 -24
- package/dist/cjs/ui/use_session.js +6 -15
- package/dist/cjs/ui/use_settings_button.js +4 -11
- package/dist/cjs/ui/use_styled_system.js +12 -21
- package/dist/cjs/ui/use_synced.js +0 -7
- package/dist/cjs/ui/use_text_color_for_background_color.js +1 -5
- package/dist/cjs/ui/use_view_metadata.js +5 -8
- package/dist/cjs/ui/use_viewport.js +1 -7
- package/dist/cjs/ui/use_watchable.js +36 -74
- package/dist/cjs/ui/view_picker.js +44 -78
- package/dist/cjs/ui/view_picker_synced.js +33 -44
- package/dist/cjs/ui/viewport_constraint.js +37 -64
- package/dist/cjs/ui/with_hooks.js +17 -22
- package/dist/cjs/ui/with_styled_system.js +33 -60
- package/dist/cjs/undo_redo.js +12 -32
- package/dist/cjs/unstable_private_utils.js +6 -8
- package/dist/cjs/unstable_testing_utils.js +44 -57
- package/dist/cjs/viewport.js +127 -189
- package/dist/cjs/warning.js +5 -6
- package/dist/cjs/watchable.js +66 -148
- package/dist/types/src/colors.d.ts +1 -1
- package/dist/types/src/colors.d.ts.map +1 -1
- package/dist/types/src/global_config.d.ts +1 -1
- package/dist/types/src/global_config.d.ts.map +1 -1
- package/dist/types/src/models/base.d.ts +1 -1
- package/dist/types/src/models/base.d.ts.map +1 -1
- package/dist/types/src/models/cursor.d.ts +1 -1
- package/dist/types/src/models/cursor.d.ts.map +1 -1
- package/dist/types/src/models/field.d.ts +1 -1
- package/dist/types/src/models/field.d.ts.map +1 -1
- package/dist/types/src/models/linked_records_query_result.d.ts.map +1 -1
- package/dist/types/src/models/models.d.ts.map +1 -1
- package/dist/types/src/models/record.d.ts +1 -1
- package/dist/types/src/models/record.d.ts.map +1 -1
- package/dist/types/src/models/record_coloring.d.ts +2 -2
- package/dist/types/src/models/record_coloring.d.ts.map +1 -1
- package/dist/types/src/models/record_query_result.d.ts +3 -3
- package/dist/types/src/models/record_query_result.d.ts.map +1 -1
- package/dist/types/src/models/session.d.ts +1 -1
- package/dist/types/src/models/session.d.ts.map +1 -1
- package/dist/types/src/models/table.d.ts +1 -1
- package/dist/types/src/models/table.d.ts.map +1 -1
- package/dist/types/src/models/view.d.ts +1 -1
- package/dist/types/src/models/view.d.ts.map +1 -1
- package/dist/types/src/models/view_metadata_query_result.d.ts +2 -2
- package/dist/types/src/models/view_metadata_query_result.d.ts.map +1 -1
- package/dist/types/src/perform_record_action.d.ts +1 -1
- package/dist/types/src/perform_record_action.d.ts.map +1 -1
- package/dist/types/src/private_utils.d.ts +8 -8
- package/dist/types/src/private_utils.d.ts.map +1 -1
- package/dist/types/src/sdk.d.ts +1 -1
- package/dist/types/src/sdk.d.ts.map +1 -1
- package/dist/types/src/settings_button.d.ts +1 -1
- package/dist/types/src/settings_button.d.ts.map +1 -1
- package/dist/types/src/types/aggregators.d.ts +1 -1
- package/dist/types/src/types/aggregators.d.ts.map +1 -1
- package/dist/types/src/types/airtable_interface.d.ts +6 -6
- package/dist/types/src/types/airtable_interface.d.ts.map +1 -1
- package/dist/types/src/types/attachment.d.ts +1 -1
- package/dist/types/src/types/attachment.d.ts.map +1 -1
- package/dist/types/src/types/base.d.ts +1 -1
- package/dist/types/src/types/base.d.ts.map +1 -1
- package/dist/types/src/types/block.d.ts +1 -1
- package/dist/types/src/types/block.d.ts.map +1 -1
- package/dist/types/src/types/collaborator.d.ts +1 -1
- package/dist/types/src/types/collaborator.d.ts.map +1 -1
- package/dist/types/src/types/field.d.ts +5 -5
- package/dist/types/src/types/field.d.ts.map +1 -1
- package/dist/types/src/types/global_config.d.ts +6 -6
- package/dist/types/src/types/global_config.d.ts.map +1 -1
- package/dist/types/src/types/mutations.d.ts +4 -4
- package/dist/types/src/types/mutations.d.ts.map +1 -1
- package/dist/types/src/types/permission_levels.d.ts +1 -1
- package/dist/types/src/types/permission_levels.d.ts.map +1 -1
- package/dist/types/src/types/record.d.ts +2 -2
- package/dist/types/src/types/record.d.ts.map +1 -1
- package/dist/types/src/types/record_action_data.d.ts +1 -1
- package/dist/types/src/types/record_action_data.d.ts.map +1 -1
- package/dist/types/src/types/table.d.ts +3 -3
- package/dist/types/src/types/table.d.ts.map +1 -1
- package/dist/types/src/types/undo_redo.d.ts +1 -1
- package/dist/types/src/types/undo_redo.d.ts.map +1 -1
- package/dist/types/src/types/view.d.ts +4 -4
- package/dist/types/src/types/view.d.ts.map +1 -1
- package/dist/types/src/ui/base_provider.d.ts +1 -1
- package/dist/types/src/ui/base_provider.d.ts.map +1 -1
- package/dist/types/src/ui/block_wrapper.d.ts +2 -2
- package/dist/types/src/ui/button.d.ts +1 -1
- package/dist/types/src/ui/button.d.ts.map +1 -1
- package/dist/types/src/ui/cell_renderer.d.ts +2 -2
- package/dist/types/src/ui/choice_token.d.ts +3 -3
- package/dist/types/src/ui/choice_token.d.ts.map +1 -1
- package/dist/types/src/ui/collaborator_token.d.ts +5 -5
- package/dist/types/src/ui/collaborator_token.d.ts.map +1 -1
- package/dist/types/src/ui/color_palette.d.ts +2 -2
- package/dist/types/src/ui/color_palette_synced.d.ts +2 -2
- package/dist/types/src/ui/confirmation_dialog.d.ts +1 -1
- package/dist/types/src/ui/control_sizes.d.ts +2 -2
- package/dist/types/src/ui/control_sizes.d.ts.map +1 -1
- package/dist/types/src/ui/dialog.d.ts +2 -2
- package/dist/types/src/ui/dialog.d.ts.map +1 -1
- package/dist/types/src/ui/dialog_close_button.d.ts +1 -1
- package/dist/types/src/ui/field_icon.d.ts +3 -3
- package/dist/types/src/ui/field_icon.d.ts.map +1 -1
- package/dist/types/src/ui/field_picker.d.ts +1 -1
- package/dist/types/src/ui/global_alert.d.ts +1 -1
- package/dist/types/src/ui/global_alert.d.ts.map +1 -1
- package/dist/types/src/ui/global_config_synced_component_helpers.d.ts +1 -1
- package/dist/types/src/ui/global_config_synced_component_helpers.d.ts.map +1 -1
- package/dist/types/src/ui/heading.d.ts +3 -3
- package/dist/types/src/ui/heading.d.ts.map +1 -1
- package/dist/types/src/ui/icon.d.ts +1 -1
- package/dist/types/src/ui/icon_config.d.ts +39 -39
- package/dist/types/src/ui/icon_config.d.ts.map +1 -1
- package/dist/types/src/ui/initialize_block.d.ts +3 -3
- package/dist/types/src/ui/initialize_block.d.ts.map +1 -1
- package/dist/types/src/ui/input.d.ts +15 -15
- package/dist/types/src/ui/input.d.ts.map +1 -1
- package/dist/types/src/ui/link.d.ts +1 -1
- package/dist/types/src/ui/link.d.ts.map +1 -1
- package/dist/types/src/ui/loader.d.ts +1 -1
- package/dist/types/src/ui/loader.d.ts.map +1 -1
- package/dist/types/src/ui/model_picker_select.d.ts +1 -1
- package/dist/types/src/ui/model_picker_select.d.ts.map +1 -1
- package/dist/types/src/ui/popover.d.ts +5 -5
- package/dist/types/src/ui/popover.d.ts.map +1 -1
- package/dist/types/src/ui/progress_bar.d.ts +1 -1
- package/dist/types/src/ui/progress_bar.d.ts.map +1 -1
- package/dist/types/src/ui/record_card.d.ts +2 -2
- package/dist/types/src/ui/record_card.d.ts.map +1 -1
- package/dist/types/src/ui/record_card_list.d.ts +1 -1
- package/dist/types/src/ui/select.d.ts +4 -4
- package/dist/types/src/ui/select_and_select_buttons_helpers.d.ts +4 -4
- package/dist/types/src/ui/select_and_select_buttons_helpers.d.ts.map +1 -1
- package/dist/types/src/ui/select_buttons.d.ts +4 -4
- package/dist/types/src/ui/switch.d.ts +1 -1
- package/dist/types/src/ui/switch.d.ts.map +1 -1
- package/dist/types/src/ui/synced.d.ts +3 -3
- package/dist/types/src/ui/system/all_styles_set.d.ts +0 -1
- package/dist/types/src/ui/system/all_styles_set.d.ts.map +1 -1
- package/dist/types/src/ui/system/appearance/appearance_set.d.ts +0 -1
- package/dist/types/src/ui/system/appearance/appearance_set.d.ts.map +1 -1
- package/dist/types/src/ui/system/appearance/background_color.d.ts +0 -1
- package/dist/types/src/ui/system/appearance/background_color.d.ts.map +1 -1
- package/dist/types/src/ui/system/appearance/border.d.ts +0 -1
- package/dist/types/src/ui/system/appearance/border.d.ts.map +1 -1
- package/dist/types/src/ui/system/appearance/border_radius.d.ts +0 -1
- package/dist/types/src/ui/system/appearance/border_radius.d.ts.map +1 -1
- package/dist/types/src/ui/system/appearance/box_shadow.d.ts +0 -1
- package/dist/types/src/ui/system/appearance/box_shadow.d.ts.map +1 -1
- package/dist/types/src/ui/system/appearance/opacity.d.ts +0 -1
- package/dist/types/src/ui/system/appearance/opacity.d.ts.map +1 -1
- package/dist/types/src/ui/system/dimensions/dimensions_set.d.ts +0 -1
- package/dist/types/src/ui/system/dimensions/dimensions_set.d.ts.map +1 -1
- package/dist/types/src/ui/system/dimensions/height.d.ts +0 -1
- package/dist/types/src/ui/system/dimensions/height.d.ts.map +1 -1
- package/dist/types/src/ui/system/dimensions/max_height.d.ts +0 -1
- package/dist/types/src/ui/system/dimensions/max_height.d.ts.map +1 -1
- package/dist/types/src/ui/system/dimensions/max_width.d.ts +0 -1
- package/dist/types/src/ui/system/dimensions/max_width.d.ts.map +1 -1
- package/dist/types/src/ui/system/dimensions/min_height.d.ts +0 -1
- package/dist/types/src/ui/system/dimensions/min_height.d.ts.map +1 -1
- package/dist/types/src/ui/system/dimensions/min_width.d.ts +0 -1
- package/dist/types/src/ui/system/dimensions/min_width.d.ts.map +1 -1
- package/dist/types/src/ui/system/dimensions/width.d.ts +0 -1
- package/dist/types/src/ui/system/dimensions/width.d.ts.map +1 -1
- package/dist/types/src/ui/system/display.d.ts +0 -1
- package/dist/types/src/ui/system/display.d.ts.map +1 -1
- package/dist/types/src/ui/system/flex_container/align_content.d.ts +0 -1
- package/dist/types/src/ui/system/flex_container/align_content.d.ts.map +1 -1
- package/dist/types/src/ui/system/flex_container/align_items.d.ts +0 -1
- package/dist/types/src/ui/system/flex_container/align_items.d.ts.map +1 -1
- package/dist/types/src/ui/system/flex_container/flex_container_set.d.ts +0 -1
- package/dist/types/src/ui/system/flex_container/flex_container_set.d.ts.map +1 -1
- package/dist/types/src/ui/system/flex_container/flex_direction.d.ts +0 -1
- package/dist/types/src/ui/system/flex_container/flex_direction.d.ts.map +1 -1
- package/dist/types/src/ui/system/flex_container/flex_wrap.d.ts +0 -1
- package/dist/types/src/ui/system/flex_container/flex_wrap.d.ts.map +1 -1
- package/dist/types/src/ui/system/flex_container/justify_content.d.ts +0 -1
- package/dist/types/src/ui/system/flex_container/justify_content.d.ts.map +1 -1
- package/dist/types/src/ui/system/flex_container/justify_items.d.ts +0 -1
- package/dist/types/src/ui/system/flex_container/justify_items.d.ts.map +1 -1
- package/dist/types/src/ui/system/flex_item/align_self.d.ts +0 -1
- package/dist/types/src/ui/system/flex_item/align_self.d.ts.map +1 -1
- package/dist/types/src/ui/system/flex_item/flex.d.ts +0 -1
- package/dist/types/src/ui/system/flex_item/flex.d.ts.map +1 -1
- package/dist/types/src/ui/system/flex_item/flex_basis.d.ts +0 -1
- package/dist/types/src/ui/system/flex_item/flex_basis.d.ts.map +1 -1
- package/dist/types/src/ui/system/flex_item/flex_grow.d.ts +0 -1
- package/dist/types/src/ui/system/flex_item/flex_grow.d.ts.map +1 -1
- package/dist/types/src/ui/system/flex_item/flex_item_set.d.ts +0 -1
- package/dist/types/src/ui/system/flex_item/flex_item_set.d.ts.map +1 -1
- package/dist/types/src/ui/system/flex_item/flex_shrink.d.ts +0 -1
- package/dist/types/src/ui/system/flex_item/flex_shrink.d.ts.map +1 -1
- package/dist/types/src/ui/system/flex_item/justify_self.d.ts +0 -1
- package/dist/types/src/ui/system/flex_item/justify_self.d.ts.map +1 -1
- package/dist/types/src/ui/system/flex_item/order.d.ts +0 -1
- package/dist/types/src/ui/system/flex_item/order.d.ts.map +1 -1
- package/dist/types/src/ui/system/overflow.d.ts +0 -1
- package/dist/types/src/ui/system/overflow.d.ts.map +1 -1
- package/dist/types/src/ui/system/position/bottom.d.ts +0 -1
- package/dist/types/src/ui/system/position/bottom.d.ts.map +1 -1
- package/dist/types/src/ui/system/position/left.d.ts +0 -1
- package/dist/types/src/ui/system/position/left.d.ts.map +1 -1
- package/dist/types/src/ui/system/position/position.d.ts +0 -1
- package/dist/types/src/ui/system/position/position.d.ts.map +1 -1
- package/dist/types/src/ui/system/position/position_set.d.ts +0 -1
- package/dist/types/src/ui/system/position/position_set.d.ts.map +1 -1
- package/dist/types/src/ui/system/position/right.d.ts +0 -1
- package/dist/types/src/ui/system/position/right.d.ts.map +1 -1
- package/dist/types/src/ui/system/position/top.d.ts +0 -1
- package/dist/types/src/ui/system/position/top.d.ts.map +1 -1
- package/dist/types/src/ui/system/position/z_index.d.ts +0 -1
- package/dist/types/src/ui/system/position/z_index.d.ts.map +1 -1
- package/dist/types/src/ui/system/spacing/margin.d.ts +0 -1
- package/dist/types/src/ui/system/spacing/margin.d.ts.map +1 -1
- package/dist/types/src/ui/system/spacing/padding.d.ts +0 -1
- package/dist/types/src/ui/system/spacing/padding.d.ts.map +1 -1
- package/dist/types/src/ui/system/spacing/spacing_set.d.ts +0 -1
- package/dist/types/src/ui/system/spacing/spacing_set.d.ts.map +1 -1
- package/dist/types/src/ui/system/typography/font_family.d.ts +0 -1
- package/dist/types/src/ui/system/typography/font_family.d.ts.map +1 -1
- package/dist/types/src/ui/system/typography/font_size.d.ts +0 -1
- package/dist/types/src/ui/system/typography/font_size.d.ts.map +1 -1
- package/dist/types/src/ui/system/typography/font_style.d.ts +0 -1
- package/dist/types/src/ui/system/typography/font_style.d.ts.map +1 -1
- package/dist/types/src/ui/system/typography/font_weight.d.ts +0 -1
- package/dist/types/src/ui/system/typography/font_weight.d.ts.map +1 -1
- package/dist/types/src/ui/system/typography/letter_spacing.d.ts +0 -1
- package/dist/types/src/ui/system/typography/letter_spacing.d.ts.map +1 -1
- package/dist/types/src/ui/system/typography/line_height.d.ts +0 -1
- package/dist/types/src/ui/system/typography/line_height.d.ts.map +1 -1
- package/dist/types/src/ui/system/typography/text_align.d.ts +0 -1
- package/dist/types/src/ui/system/typography/text_align.d.ts.map +1 -1
- package/dist/types/src/ui/system/typography/text_color.d.ts +0 -1
- package/dist/types/src/ui/system/typography/text_color.d.ts.map +1 -1
- package/dist/types/src/ui/system/typography/text_decoration.d.ts +0 -1
- package/dist/types/src/ui/system/typography/text_decoration.d.ts.map +1 -1
- package/dist/types/src/ui/system/typography/text_transform.d.ts +0 -1
- package/dist/types/src/ui/system/typography/text_transform.d.ts.map +1 -1
- package/dist/types/src/ui/system/typography/typography_set.d.ts +0 -1
- package/dist/types/src/ui/system/typography/typography_set.d.ts.map +1 -1
- package/dist/types/src/ui/system/utils/create_style_prop_types.d.ts +1 -1
- package/dist/types/src/ui/system/utils/create_style_prop_types.d.ts.map +1 -1
- package/dist/types/src/ui/system/utils/csstype.d.ts +578 -578
- package/dist/types/src/ui/system/utils/csstype.d.ts.map +1 -1
- package/dist/types/src/ui/system/utils/types.d.ts +4 -4
- package/dist/types/src/ui/system/utils/types.d.ts.map +1 -1
- package/dist/types/src/ui/text.d.ts +3 -3
- package/dist/types/src/ui/text.d.ts.map +1 -1
- package/dist/types/src/ui/text_button.d.ts +1 -1
- package/dist/types/src/ui/text_button.d.ts.map +1 -1
- package/dist/types/src/ui/theme/default_theme/heading_styles.d.ts +2 -2
- package/dist/types/src/ui/theme/default_theme/heading_styles.d.ts.map +1 -1
- package/dist/types/src/ui/theme/default_theme/index.d.ts +1 -1
- package/dist/types/src/ui/theme/theme_context.d.ts +1 -3
- package/dist/types/src/ui/theme/theme_context.d.ts.map +1 -1
- package/dist/types/src/ui/theme/use_theme.d.ts +1 -1
- package/dist/types/src/ui/tooltip.d.ts +3 -3
- package/dist/types/src/ui/types/data_attributes_prop.d.ts.map +1 -1
- package/dist/types/src/ui/types/tooltip_anchor_props.d.ts +0 -1
- package/dist/types/src/ui/types/tooltip_anchor_props.d.ts.map +1 -1
- package/dist/types/src/ui/use_base.d.ts.map +1 -1
- package/dist/types/src/ui/use_cursor.d.ts.map +1 -1
- package/dist/types/src/ui/use_form_field.d.ts +0 -2
- package/dist/types/src/ui/use_form_field.d.ts.map +1 -1
- package/dist/types/src/ui/use_records.d.ts +2 -2
- package/dist/types/src/ui/use_records.d.ts.map +1 -1
- package/dist/types/src/ui/use_session.d.ts.map +1 -1
- package/dist/types/src/ui/view_picker.d.ts +2 -2
- package/dist/types/src/ui/view_picker.d.ts.map +1 -1
- package/dist/types/src/ui/viewport_constraint.d.ts +3 -3
- package/dist/types/src/ui/viewport_constraint.d.ts.map +1 -1
- package/dist/types/src/viewport.d.ts +2 -2
- package/dist/types/src/viewport.d.ts.map +1 -1
- package/dist/types/src/warning.d.ts +1 -1
- package/dist/types/src/warning.d.ts.map +1 -1
- package/dist/types/stories/helpers/code_block.d.ts +2 -2
- package/dist/types/stories/helpers/code_block.d.ts.map +1 -1
- package/dist/types/stories/helpers/example.d.ts +5 -5
- package/dist/types/stories/helpers/example.d.ts.map +1 -1
- package/dist/types/stories/helpers/example_code_panel.d.ts +2 -2
- package/dist/types/stories/helpers/example_code_panel.d.ts.map +1 -1
- package/dist/types/stories/helpers/fake_cell_renderer.d.ts +2 -2
- package/dist/types/stories/helpers/fake_cell_renderer.d.ts.map +1 -1
- package/dist/types/stories/helpers/fake_foreign_record.d.ts +1 -1
- package/dist/types/stories/helpers/fake_foreign_record.d.ts.map +1 -1
- package/dist/types/stories/helpers/fake_record_card.d.ts +2 -2
- package/dist/types/stories/helpers/fake_record_card.d.ts.map +1 -1
- package/dist/types/stories/helpers/style_prop_list.d.ts +2 -2
- package/dist/types/stories/helpers/style_prop_list.d.ts.map +1 -1
- package/dist/types/stories/icon_example.d.ts +2 -2
- package/dist/types/stories/icon_example.d.ts.map +1 -1
- package/dist/types/test/airtable_interface_mocks/mock_airtable_interface.d.ts +0 -1
- package/dist/types/test/airtable_interface_mocks/mock_airtable_interface.d.ts.map +1 -1
- package/package.json +26 -25
|
@@ -1,60 +1,41 @@
|
|
|
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.object.to-string.js");
|
|
7
|
+
require("core-js/modules/es.regexp.exec.js");
|
|
8
|
+
require("core-js/modules/es.regexp.to-string.js");
|
|
3
9
|
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.concat");
|
|
10
|
-
|
|
11
|
-
require("core-js/modules/es.array.iterator");
|
|
12
|
-
|
|
13
|
-
require("core-js/modules/es.array.map");
|
|
14
|
-
|
|
15
|
-
require("core-js/modules/es.array.slice");
|
|
16
|
-
|
|
17
|
-
require("core-js/modules/es.object.to-string");
|
|
18
|
-
|
|
19
|
-
require("core-js/modules/es.promise");
|
|
20
|
-
|
|
21
|
-
require("core-js/modules/web.dom-collections.iterator");
|
|
22
|
-
|
|
23
10
|
Object.defineProperty(exports, "__esModule", {
|
|
24
11
|
value: true
|
|
25
12
|
});
|
|
26
13
|
exports.default = void 0;
|
|
27
|
-
|
|
28
14
|
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
29
|
-
|
|
30
|
-
require("
|
|
31
|
-
|
|
15
|
+
require("core-js/modules/es.array.concat.js");
|
|
16
|
+
require("core-js/modules/es.array.iterator.js");
|
|
17
|
+
require("core-js/modules/es.array.map.js");
|
|
18
|
+
require("core-js/modules/es.array.slice.js");
|
|
19
|
+
require("core-js/modules/web.dom-collections.iterator.js");
|
|
20
|
+
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
32
21
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
33
|
-
|
|
34
22
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
35
|
-
|
|
36
23
|
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
37
|
-
|
|
38
|
-
var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
|
|
39
|
-
|
|
40
|
-
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
41
|
-
|
|
42
24
|
var _get2 = _interopRequireDefault(require("@babel/runtime/helpers/get"));
|
|
43
|
-
|
|
25
|
+
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
44
26
|
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
45
|
-
|
|
46
27
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
47
|
-
|
|
48
28
|
var _error_utils = require("../error_utils");
|
|
49
|
-
|
|
50
29
|
var _record_query_result = _interopRequireDefault(require("./record_query_result"));
|
|
51
|
-
|
|
52
30
|
var _object_pool = _interopRequireDefault(require("./object_pool"));
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
31
|
+
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; } } }; }
|
|
32
|
+
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; } }
|
|
33
|
+
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; }
|
|
34
|
+
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)); }
|
|
35
|
+
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 */ /** */
|
|
36
|
+
/** @hidden */
|
|
37
|
+
// Even though we don't load the data, we still access it through `._data` so that
|
|
38
|
+
// we can be ensured the model hasn't been deleted.
|
|
58
39
|
/**
|
|
59
40
|
* Represents a group of records returned from a group query. See {@link RecordQueryResult} for main
|
|
60
41
|
* documentation.
|
|
@@ -65,411 +46,354 @@ var _object_pool = _interopRequireDefault(require("./object_pool"));
|
|
|
65
46
|
* @docsPath models/query results/GroupedRecordQueryResult
|
|
66
47
|
* @hidden
|
|
67
48
|
*/
|
|
68
|
-
var GroupedRecordQueryResult =
|
|
69
|
-
/*#__PURE__*/
|
|
70
|
-
function (_RecordQueryResult) {
|
|
71
|
-
(0, _inherits2.default)(GroupedRecordQueryResult, _RecordQueryResult);
|
|
72
|
-
|
|
73
|
-
/** @internal */
|
|
74
|
-
|
|
75
|
-
/** @internal */
|
|
76
|
-
|
|
77
|
-
/** @internal */
|
|
78
|
-
|
|
79
|
-
/**
|
|
80
|
-
* This includes groupLevel for all children & parent grouped layers, the getter
|
|
81
|
-
* returns only the groupLevels for this layer.
|
|
82
|
-
*
|
|
83
|
-
* @internal
|
|
84
|
-
*/
|
|
85
|
-
// This is the ordered list of groups.
|
|
86
|
-
|
|
87
|
-
/** @internal */
|
|
88
|
-
// lazily generated set of record ids
|
|
89
|
-
|
|
90
|
-
/** @internal */
|
|
91
|
-
// lazily generated ordered array of recordIds
|
|
92
|
-
|
|
93
|
-
/** @internal */
|
|
94
|
-
|
|
49
|
+
var GroupedRecordQueryResult = /*#__PURE__*/function (_RecordQueryResult) {
|
|
95
50
|
/** @internal */
|
|
96
51
|
function GroupedRecordQueryResult(parentQueryResult, groupData, groupLevel, normalizedOpts, sdk) {
|
|
97
52
|
var _this;
|
|
98
|
-
|
|
99
53
|
(0, _classCallCheck2.default)(this, GroupedRecordQueryResult);
|
|
100
|
-
_this = (
|
|
101
|
-
|
|
102
|
-
(0, _defineProperty2.default)(
|
|
103
|
-
|
|
104
|
-
(0, _defineProperty2.default)(
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
54
|
+
_this = _callSuper(this, GroupedRecordQueryResult, [sdk, normalizedOpts]);
|
|
55
|
+
/** @internal */
|
|
56
|
+
(0, _defineProperty2.default)(_this, "_parentQueryResult", void 0);
|
|
57
|
+
/** @internal */
|
|
58
|
+
(0, _defineProperty2.default)(_this, "_groupData", void 0);
|
|
59
|
+
/**
|
|
60
|
+
* This includes groupLevel for all children & parent grouped layers, the getter
|
|
61
|
+
* returns only the groupLevels for this layer.
|
|
62
|
+
*
|
|
63
|
+
* @internal
|
|
64
|
+
*/
|
|
65
|
+
(0, _defineProperty2.default)(_this, "_groupLevels", void 0);
|
|
66
|
+
// This is the ordered list of groups.
|
|
67
|
+
/** @internal */
|
|
68
|
+
(0, _defineProperty2.default)(_this, "_orderedChildrenGroups", void 0);
|
|
69
|
+
// lazily generated set of record ids
|
|
70
|
+
/** @internal */
|
|
71
|
+
(0, _defineProperty2.default)(_this, "_recordIdsSet", null);
|
|
72
|
+
// lazily generated ordered array of recordIds
|
|
73
|
+
(0, _defineProperty2.default)(_this, "_orderedRecordIds", null);
|
|
74
|
+
/** @internal */
|
|
75
|
+
(0, _defineProperty2.default)(_this, "__groupedRecordQueryResultPool", void 0);
|
|
108
76
|
_this.__groupedRecordQueryResultPool = new _object_pool.default(GroupedRecordQueryResult);
|
|
109
77
|
_this._parentQueryResult = parentQueryResult;
|
|
110
78
|
_this._groupData = groupData;
|
|
111
79
|
_this._groupLevels = groupLevel;
|
|
112
|
-
|
|
113
80
|
var groupLevelDataSlicedForChildren = _this._groupLevels.slice(1);
|
|
114
|
-
|
|
115
81
|
_this._orderedChildrenGroups = groupData.groups ? groupData.groups.map(singleGroupData => {
|
|
116
|
-
var group = _this.__groupedRecordQueryResultPool.getObjectForReuse(
|
|
82
|
+
var group = _this.__groupedRecordQueryResultPool.getObjectForReuse(_this, singleGroupData, groupLevelDataSlicedForChildren, normalizedOpts, sdk);
|
|
83
|
+
// Don't await the loading, let others check isDataLoaded.
|
|
117
84
|
// (it doesn't take any time anyway). Loading also strong retains.
|
|
118
|
-
|
|
119
|
-
|
|
120
85
|
group.loadDataAsync();
|
|
121
86
|
return group;
|
|
122
87
|
}) : null;
|
|
123
88
|
return _this;
|
|
124
89
|
}
|
|
90
|
+
|
|
125
91
|
/**
|
|
126
92
|
* Gets children groups of this group (if any exist)
|
|
127
93
|
*/
|
|
94
|
+
(0, _inherits2.default)(GroupedRecordQueryResult, _RecordQueryResult);
|
|
95
|
+
return (0, _createClass2.default)(GroupedRecordQueryResult, [{
|
|
96
|
+
key: "groups",
|
|
97
|
+
get: function get() {
|
|
98
|
+
return this._orderedChildrenGroups;
|
|
99
|
+
}
|
|
128
100
|
|
|
101
|
+
/** @internal */
|
|
102
|
+
}, {
|
|
103
|
+
key: "groupLevel",
|
|
104
|
+
get: function get() {
|
|
105
|
+
return this._data.groupLevels[0];
|
|
106
|
+
}
|
|
129
107
|
|
|
130
|
-
|
|
131
|
-
|
|
108
|
+
/**
|
|
109
|
+
* Gets the fieldId that this group is grouped by
|
|
110
|
+
*/
|
|
111
|
+
}, {
|
|
112
|
+
key: "fieldId",
|
|
113
|
+
get: function get() {
|
|
114
|
+
return this.groupLevel.fieldId;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* Gets the field that this group is grouped by
|
|
119
|
+
*/
|
|
120
|
+
}, {
|
|
121
|
+
key: "field",
|
|
122
|
+
get: function get() {
|
|
123
|
+
return this.parentTable.getFieldById(this.fieldId);
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
// TODO (SeanKeenan) This is needed because we can't always iterate down and find
|
|
127
|
+
// a record, it's possible to have "empty groups".
|
|
128
|
+
// getValue() {
|
|
129
|
+
// }
|
|
130
|
+
|
|
131
|
+
// TODO (SeanKeenan)
|
|
132
|
+
// getValueAsString() {
|
|
133
|
+
// }
|
|
134
|
+
|
|
135
|
+
/**
|
|
136
|
+
* @internal (since we may not be able to return parent model instances in the immutable models world)
|
|
137
|
+
* The table that records in this RecordQueryResult are part of
|
|
138
|
+
*/
|
|
139
|
+
}, {
|
|
140
|
+
key: "parentTable",
|
|
141
|
+
get: function get() {
|
|
142
|
+
return this._parentQueryResult.parentTable;
|
|
143
|
+
}
|
|
132
144
|
|
|
133
145
|
/**
|
|
134
146
|
* Recursively gets all recordIds in the children groups, keeping recordIds in group order
|
|
135
147
|
*
|
|
136
148
|
* @internal
|
|
137
149
|
*/
|
|
150
|
+
}, {
|
|
151
|
+
key: "_computeRecordIds",
|
|
138
152
|
value: function _computeRecordIds() {
|
|
139
153
|
// If we are a leaf node, return the raw recordIds
|
|
140
154
|
if (!this.groups) {
|
|
141
155
|
var _this$_data$groupData;
|
|
142
|
-
|
|
143
156
|
// Typescript can't infer if groups is empty visibleRecordIds must be populated
|
|
144
157
|
// but the extra safety isn't bad. (istanbul also can't ignore just the ??)
|
|
145
158
|
// istanbul ignore next
|
|
146
159
|
return (_this$_data$groupData = this._data.groupData.visibleRecordIds) !== null && _this$_data$groupData !== void 0 ? _this$_data$groupData : [];
|
|
147
|
-
}
|
|
148
|
-
|
|
160
|
+
}
|
|
149
161
|
|
|
162
|
+
// Otherwise build the recordId's from children groups
|
|
150
163
|
var recordIds = [];
|
|
151
|
-
var
|
|
152
|
-
|
|
153
|
-
var _iteratorError = undefined;
|
|
154
|
-
|
|
164
|
+
var _iterator = _createForOfIteratorHelper(this.groups),
|
|
165
|
+
_step;
|
|
155
166
|
try {
|
|
156
|
-
for (
|
|
167
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
157
168
|
var group = _step.value;
|
|
158
169
|
recordIds.push(...group.recordIds);
|
|
159
170
|
}
|
|
160
171
|
} catch (err) {
|
|
161
|
-
|
|
162
|
-
_iteratorError = err;
|
|
172
|
+
_iterator.e(err);
|
|
163
173
|
} finally {
|
|
164
|
-
|
|
165
|
-
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
166
|
-
_iterator.return();
|
|
167
|
-
}
|
|
168
|
-
} finally {
|
|
169
|
-
if (_didIteratorError) {
|
|
170
|
-
throw _iteratorError;
|
|
171
|
-
}
|
|
172
|
-
}
|
|
174
|
+
_iterator.f();
|
|
173
175
|
}
|
|
174
|
-
|
|
175
176
|
return recordIds;
|
|
176
177
|
}
|
|
178
|
+
|
|
177
179
|
/**
|
|
178
180
|
* Anytime the recordIds to return could have changed, we clear this so that
|
|
179
181
|
* the next time the user requests recordIds it recomputes
|
|
180
182
|
*
|
|
181
183
|
* @internal
|
|
182
184
|
*/
|
|
183
|
-
|
|
184
185
|
}, {
|
|
185
186
|
key: "_invalidateComputedRecordIds",
|
|
186
187
|
value: function _invalidateComputedRecordIds() {
|
|
187
188
|
this._orderedRecordIds = null;
|
|
188
189
|
}
|
|
190
|
+
|
|
189
191
|
/**
|
|
190
192
|
* Ordered array of all the record ids inside this group, in group order.
|
|
191
193
|
* This returns all recordIds of all children groups (in grouped order).
|
|
192
194
|
* Watchable.
|
|
193
195
|
*/
|
|
196
|
+
}, {
|
|
197
|
+
key: "recordIds",
|
|
198
|
+
get: function get() {
|
|
199
|
+
(0, _error_utils.invariant)(this.isDataLoaded, 'GroupedRecordQueryResult data is not loaded');
|
|
200
|
+
if (this._orderedRecordIds === null) {
|
|
201
|
+
this._orderedRecordIds = this._computeRecordIds();
|
|
202
|
+
}
|
|
203
|
+
return this._orderedRecordIds;
|
|
204
|
+
}
|
|
194
205
|
|
|
206
|
+
/**
|
|
207
|
+
* The fields that were used to create the parent RecordQueryResult that created this GroupedRecordQueryResult.
|
|
208
|
+
* This is separate from the field/fieldId property - which is the field this grouping is based upon.
|
|
209
|
+
* Null if fields were not specified, which means the RecordQueryResult
|
|
210
|
+
* will load all fields in the table.
|
|
211
|
+
*/
|
|
195
212
|
}, {
|
|
196
|
-
key: "
|
|
213
|
+
key: "fields",
|
|
214
|
+
get: function get() {
|
|
215
|
+
(0, _error_utils.invariant)(this.isDataLoaded, 'GroupedRecordQueryResult data is not loaded');
|
|
216
|
+
return this._parentQueryResult.fields;
|
|
217
|
+
}
|
|
197
218
|
|
|
198
219
|
/** @inheritdoc */
|
|
220
|
+
}, {
|
|
221
|
+
key: "watch",
|
|
199
222
|
value: function watch(keys, callback, context) {
|
|
200
223
|
// TODO (SeanKeenan): This provides events even if they occur outside of this group
|
|
201
224
|
// This is an issue that needs to be fixed before this API is made public
|
|
202
225
|
var validKeys = this._parentQueryResult.watch(keys, callback, context);
|
|
203
|
-
|
|
204
226
|
return validKeys;
|
|
205
227
|
}
|
|
206
|
-
/** @inheritdoc */
|
|
207
228
|
|
|
229
|
+
/** @inheritdoc */
|
|
208
230
|
}, {
|
|
209
231
|
key: "unwatch",
|
|
210
232
|
value: function unwatch(keys, callback, context) {
|
|
211
233
|
return this._parentQueryResult.unwatch(keys, callback, context);
|
|
212
234
|
}
|
|
213
|
-
/** @inheritdoc */
|
|
214
235
|
|
|
236
|
+
/** @inheritdoc */
|
|
215
237
|
}, {
|
|
216
238
|
key: "loadDataAsync",
|
|
217
|
-
value: function
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
switch (_context.prev = _context.next) {
|
|
239
|
+
value: (function () {
|
|
240
|
+
var _loadDataAsync2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
|
|
241
|
+
return _regenerator.default.wrap(function _callee$(_context) {
|
|
242
|
+
while (1) switch (_context.prev = _context.next) {
|
|
221
243
|
case 0:
|
|
222
244
|
_context.next = 2;
|
|
223
|
-
return
|
|
224
|
-
|
|
245
|
+
return (0, _get2.default)((0, _getPrototypeOf2.default)(GroupedRecordQueryResult.prototype), "loadDataAsync", this).call(this);
|
|
225
246
|
case 2:
|
|
226
247
|
case "end":
|
|
227
248
|
return _context.stop();
|
|
228
249
|
}
|
|
229
|
-
}
|
|
230
|
-
}
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
250
|
+
}, _callee, this);
|
|
251
|
+
}));
|
|
252
|
+
function loadDataAsync() {
|
|
253
|
+
return _loadDataAsync2.apply(this, arguments);
|
|
254
|
+
}
|
|
255
|
+
return loadDataAsync;
|
|
256
|
+
}() /** @internal */)
|
|
234
257
|
}, {
|
|
235
258
|
key: "_getChangedKeysOnLoad",
|
|
236
259
|
value: function _getChangedKeysOnLoad() {
|
|
237
260
|
return this._parentQueryResult._getChangedKeysOnLoad();
|
|
238
261
|
}
|
|
239
|
-
/** @internal */
|
|
240
262
|
|
|
263
|
+
/** @internal */
|
|
241
264
|
}, {
|
|
242
265
|
key: "_loadDataAsync",
|
|
243
|
-
value: function
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
switch (_context2.prev = _context2.next) {
|
|
266
|
+
value: (function () {
|
|
267
|
+
var _loadDataAsync3 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2() {
|
|
268
|
+
return _regenerator.default.wrap(function _callee2$(_context2) {
|
|
269
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
247
270
|
case 0:
|
|
248
|
-
this._parentQueryResult.__groupedRecordQueryResultPool.registerObjectForReuseStrong(this);
|
|
271
|
+
this._parentQueryResult.__groupedRecordQueryResultPool.registerObjectForReuseStrong(this);
|
|
272
|
+
|
|
273
|
+
// Ensure we invalidate our memoized computed recordIds whenever a relevant hook changes
|
|
249
274
|
// TODO: (SeanKeenan) At the moment this should never be relevant, because groups are recreated
|
|
250
275
|
// anytime the groups change - but this is how it should work once groups persist AND
|
|
251
276
|
// watching recordIds only changes if records in this group change.
|
|
252
277
|
// In the meantime this does ensure that a deleted GroupedRecordQuery with stale recordIds
|
|
253
278
|
// doesn't return the cached array.
|
|
254
|
-
|
|
255
|
-
|
|
256
279
|
this.watch(['recordIds', 'groups', 'groupLevels'], this._invalidateComputedRecordIds, this);
|
|
257
280
|
this.watch(['recordIds'], this._invalidateRecordIdsSet, this);
|
|
258
281
|
return _context2.abrupt("return", this._getChangedKeysOnLoad());
|
|
259
|
-
|
|
260
282
|
case 4:
|
|
261
283
|
case "end":
|
|
262
284
|
return _context2.stop();
|
|
263
285
|
}
|
|
264
|
-
}
|
|
265
|
-
}
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
286
|
+
}, _callee2, this);
|
|
287
|
+
}));
|
|
288
|
+
function _loadDataAsync() {
|
|
289
|
+
return _loadDataAsync3.apply(this, arguments);
|
|
290
|
+
}
|
|
291
|
+
return _loadDataAsync;
|
|
292
|
+
}() /** @internal */)
|
|
269
293
|
}, {
|
|
270
294
|
key: "_unloadData",
|
|
271
295
|
value: function _unloadData() {
|
|
272
296
|
// Ensure we invalidate our memoized computed recordIds whenever a relevant hook changes
|
|
273
297
|
this.unwatch(['recordIds', 'groups', 'groupLevels'], this._invalidateComputedRecordIds, this);
|
|
274
|
-
this.unwatch(['recordIds'], this._invalidateRecordIdsSet, this);
|
|
298
|
+
this.unwatch(['recordIds'], this._invalidateRecordIdsSet, this);
|
|
275
299
|
|
|
300
|
+
// Invalidate both of the caches, as this object can no longer be accessed
|
|
276
301
|
this._invalidateComputedRecordIds();
|
|
277
|
-
|
|
278
302
|
this._invalidateRecordIdsSet();
|
|
279
|
-
|
|
280
303
|
this._unloadChildrenGroupsIfNeeded();
|
|
281
|
-
|
|
282
304
|
this._parentQueryResult.__groupedRecordQueryResultPool.unregisterObjectForReuseStrong(this);
|
|
283
305
|
}
|
|
306
|
+
|
|
284
307
|
/** @internal */
|
|
308
|
+
}, {
|
|
309
|
+
key: "__poolKey",
|
|
310
|
+
get: function get() {
|
|
311
|
+
// TODO (SeanKeenan) We don't have an actual groupId, but while id is unique; this should have id removed
|
|
312
|
+
return "".concat(this._serializedOpts, "::").concat(this.id);
|
|
313
|
+
}
|
|
285
314
|
|
|
315
|
+
/**
|
|
316
|
+
* This model doesn't actually load data, but it does use the `_data`
|
|
317
|
+
* property so that checks for model deletion behave appropriately.
|
|
318
|
+
*
|
|
319
|
+
* This is considered deleted if the parent query result has been deleted.
|
|
320
|
+
*
|
|
321
|
+
* We return groupData, instead of precomputing all children groups because
|
|
322
|
+
* we perform the computation+caching lazily on request
|
|
323
|
+
*
|
|
324
|
+
* @internal
|
|
325
|
+
*/
|
|
286
326
|
}, {
|
|
287
|
-
key: "
|
|
327
|
+
key: "_dataOrNullIfDeleted",
|
|
328
|
+
get: function get() {
|
|
329
|
+
if (this._parentQueryResult._dataOrNullIfDeleted === null) {
|
|
330
|
+
return null;
|
|
331
|
+
}
|
|
332
|
+
return {
|
|
333
|
+
groupData: this._groupData,
|
|
334
|
+
groupLevels: this._groupLevels
|
|
335
|
+
};
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
/** @inheritdoc */
|
|
339
|
+
}, {
|
|
340
|
+
key: "isDataLoaded",
|
|
341
|
+
get: function get() {
|
|
342
|
+
return this._parentQueryResult.isDataLoaded;
|
|
343
|
+
}
|
|
288
344
|
|
|
289
345
|
/** @internal */
|
|
346
|
+
}, {
|
|
347
|
+
key: "_unloadChildrenGroupsIfNeeded",
|
|
290
348
|
value: function _unloadChildrenGroupsIfNeeded() {
|
|
291
349
|
if (this._orderedChildrenGroups) {
|
|
292
|
-
var
|
|
293
|
-
|
|
294
|
-
var _iteratorError2 = undefined;
|
|
295
|
-
|
|
350
|
+
var _iterator2 = _createForOfIteratorHelper(this._orderedChildrenGroups),
|
|
351
|
+
_step2;
|
|
296
352
|
try {
|
|
297
|
-
for (
|
|
353
|
+
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
298
354
|
var group = _step2.value;
|
|
299
355
|
group.unloadData();
|
|
300
356
|
}
|
|
301
357
|
} catch (err) {
|
|
302
|
-
|
|
303
|
-
_iteratorError2 = err;
|
|
358
|
+
_iterator2.e(err);
|
|
304
359
|
} finally {
|
|
305
|
-
|
|
306
|
-
if (!_iteratorNormalCompletion2 && _iterator2.return != null) {
|
|
307
|
-
_iterator2.return();
|
|
308
|
-
}
|
|
309
|
-
} finally {
|
|
310
|
-
if (_didIteratorError2) {
|
|
311
|
-
throw _iteratorError2;
|
|
312
|
-
}
|
|
313
|
-
}
|
|
360
|
+
_iterator2.f();
|
|
314
361
|
}
|
|
315
362
|
}
|
|
316
363
|
}
|
|
317
|
-
/** @internal */
|
|
318
364
|
|
|
365
|
+
/** @internal */
|
|
319
366
|
}, {
|
|
320
367
|
key: "_invalidateRecordIdsSet",
|
|
321
368
|
value: function _invalidateRecordIdsSet() {
|
|
322
369
|
this._recordIdsSet = null;
|
|
323
370
|
}
|
|
324
|
-
/** @internal */
|
|
325
371
|
|
|
372
|
+
/** @internal */
|
|
326
373
|
}, {
|
|
327
374
|
key: "_getOrGenerateRecordIdsSet",
|
|
328
375
|
value: function _getOrGenerateRecordIdsSet() {
|
|
329
376
|
// TODO (SeanKeenan): this logic is duplicated in tableOrViewQueryResult
|
|
330
377
|
if (!this._recordIdsSet) {
|
|
331
378
|
var recordIdsSet = {};
|
|
332
|
-
var
|
|
333
|
-
|
|
334
|
-
var _iteratorError3 = undefined;
|
|
335
|
-
|
|
379
|
+
var _iterator3 = _createForOfIteratorHelper(this.recordIds),
|
|
380
|
+
_step3;
|
|
336
381
|
try {
|
|
337
|
-
for (
|
|
382
|
+
for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
|
|
338
383
|
var recordId = _step3.value;
|
|
339
384
|
recordIdsSet[recordId] = true;
|
|
340
385
|
}
|
|
341
386
|
} catch (err) {
|
|
342
|
-
|
|
343
|
-
_iteratorError3 = err;
|
|
387
|
+
_iterator3.e(err);
|
|
344
388
|
} finally {
|
|
345
|
-
|
|
346
|
-
if (!_iteratorNormalCompletion3 && _iterator3.return != null) {
|
|
347
|
-
_iterator3.return();
|
|
348
|
-
}
|
|
349
|
-
} finally {
|
|
350
|
-
if (_didIteratorError3) {
|
|
351
|
-
throw _iteratorError3;
|
|
352
|
-
}
|
|
353
|
-
}
|
|
389
|
+
_iterator3.f();
|
|
354
390
|
}
|
|
355
|
-
|
|
356
391
|
this._recordIdsSet = recordIdsSet;
|
|
357
392
|
}
|
|
358
|
-
|
|
359
393
|
return this._recordIdsSet;
|
|
360
394
|
}
|
|
361
|
-
}, {
|
|
362
|
-
key: "groups",
|
|
363
|
-
get: function get() {
|
|
364
|
-
return this._orderedChildrenGroups;
|
|
365
|
-
}
|
|
366
|
-
/** @internal */
|
|
367
|
-
|
|
368
|
-
}, {
|
|
369
|
-
key: "groupLevel",
|
|
370
|
-
get: function get() {
|
|
371
|
-
return this._data.groupLevels[0];
|
|
372
|
-
}
|
|
373
|
-
/**
|
|
374
|
-
* Gets the fieldId that this group is grouped by
|
|
375
|
-
*/
|
|
376
|
-
|
|
377
|
-
}, {
|
|
378
|
-
key: "fieldId",
|
|
379
|
-
get: function get() {
|
|
380
|
-
return this.groupLevel.fieldId;
|
|
381
|
-
}
|
|
382
|
-
/**
|
|
383
|
-
* Gets the field that this group is grouped by
|
|
384
|
-
*/
|
|
385
|
-
|
|
386
|
-
}, {
|
|
387
|
-
key: "field",
|
|
388
|
-
get: function get() {
|
|
389
|
-
return this.parentTable.getFieldById(this.fieldId);
|
|
390
|
-
} // TODO (SeanKeenan) This is needed because we can't always iterate down and find
|
|
391
|
-
// a record, it's possible to have "empty groups".
|
|
392
|
-
// getValue() {
|
|
393
|
-
// }
|
|
394
|
-
// TODO (SeanKeenan)
|
|
395
|
-
// getValueAsString() {
|
|
396
|
-
// }
|
|
397
|
-
|
|
398
|
-
/**
|
|
399
|
-
* @internal (since we may not be able to return parent model instances in the immutable models world)
|
|
400
|
-
* The table that records in this RecordQueryResult are part of
|
|
401
|
-
*/
|
|
402
|
-
|
|
403
|
-
}, {
|
|
404
|
-
key: "parentTable",
|
|
405
|
-
get: function get() {
|
|
406
|
-
return this._parentQueryResult.parentTable;
|
|
407
|
-
}
|
|
408
|
-
}, {
|
|
409
|
-
key: "recordIds",
|
|
410
|
-
get: function get() {
|
|
411
|
-
(0, _error_utils.invariant)(this.isDataLoaded, 'GroupedRecordQueryResult data is not loaded');
|
|
412
|
-
|
|
413
|
-
if (this._orderedRecordIds === null) {
|
|
414
|
-
this._orderedRecordIds = this._computeRecordIds();
|
|
415
|
-
}
|
|
416
|
-
|
|
417
|
-
return this._orderedRecordIds;
|
|
418
|
-
}
|
|
419
|
-
/**
|
|
420
|
-
* The fields that were used to create the parent RecordQueryResult that created this GroupedRecordQueryResult.
|
|
421
|
-
* This is separate from the field/fieldId property - which is the field this grouping is based upon.
|
|
422
|
-
* Null if fields were not specified, which means the RecordQueryResult
|
|
423
|
-
* will load all fields in the table.
|
|
424
|
-
*/
|
|
425
|
-
|
|
426
|
-
}, {
|
|
427
|
-
key: "fields",
|
|
428
|
-
get: function get() {
|
|
429
|
-
(0, _error_utils.invariant)(this.isDataLoaded, 'GroupedRecordQueryResult data is not loaded');
|
|
430
|
-
return this._parentQueryResult.fields;
|
|
431
|
-
}
|
|
432
|
-
}, {
|
|
433
|
-
key: "__poolKey",
|
|
434
|
-
get: function get() {
|
|
435
|
-
// TODO (SeanKeenan) We don't have an actual groupId, but while id is unique; this should have id removed
|
|
436
|
-
return "".concat(this._serializedOpts, "::").concat(this.id);
|
|
437
|
-
}
|
|
438
|
-
/**
|
|
439
|
-
* This model doesn't actually load data, but it does use the `_data`
|
|
440
|
-
* property so that checks for model deletion behave appropriately.
|
|
441
|
-
*
|
|
442
|
-
* This is considered deleted if the parent query result has been deleted.
|
|
443
|
-
*
|
|
444
|
-
* We return groupData, instead of precomputing all children groups because
|
|
445
|
-
* we perform the computation+caching lazily on request
|
|
446
|
-
*
|
|
447
|
-
* @internal
|
|
448
|
-
*/
|
|
449
|
-
|
|
450
|
-
}, {
|
|
451
|
-
key: "_dataOrNullIfDeleted",
|
|
452
|
-
get: function get() {
|
|
453
|
-
if (this._parentQueryResult._dataOrNullIfDeleted === null) {
|
|
454
|
-
return null;
|
|
455
|
-
}
|
|
456
|
-
|
|
457
|
-
return {
|
|
458
|
-
groupData: this._groupData,
|
|
459
|
-
groupLevels: this._groupLevels
|
|
460
|
-
};
|
|
461
|
-
}
|
|
462
|
-
/** @inheritdoc */
|
|
463
|
-
|
|
464
|
-
}, {
|
|
465
|
-
key: "isDataLoaded",
|
|
466
|
-
get: function get() {
|
|
467
|
-
return this._parentQueryResult.isDataLoaded;
|
|
468
|
-
}
|
|
469
395
|
}]);
|
|
470
|
-
return GroupedRecordQueryResult;
|
|
471
396
|
}(_record_query_result.default);
|
|
472
|
-
|
|
397
|
+
/** @internal */
|
|
473
398
|
(0, _defineProperty2.default)(GroupedRecordQueryResult, "_className", 'GroupedRecordQueryResult');
|
|
474
|
-
var _default = GroupedRecordQueryResult;
|
|
475
|
-
exports.default = _default;
|
|
399
|
+
var _default = exports.default = GroupedRecordQueryResult;
|