@angular/core 7.2.0-rc.0 → 7.2.3
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/bundles/core-testing.umd.js +193 -131
- package/bundles/core-testing.umd.js.map +1 -1
- package/bundles/core-testing.umd.min.js +11 -11
- package/bundles/core-testing.umd.min.js.map +1 -1
- package/bundles/core.umd.js +1777 -1329
- package/bundles/core.umd.js.map +1 -1
- package/bundles/core.umd.min.js +111 -125
- package/bundles/core.umd.min.js.map +1 -1
- package/core.metadata.json +1 -1
- package/esm2015/core.js +1 -1
- package/esm2015/index.js +2 -2
- package/esm2015/public_api.js +2 -2
- package/esm2015/src/application_init.js +1 -1
- package/esm2015/src/application_module.js +1 -1
- package/esm2015/src/application_ref.js +1 -1
- package/esm2015/src/application_tokens.js +1 -1
- package/esm2015/src/change_detection/change_detection.js +1 -1
- package/esm2015/src/change_detection/change_detection_util.js +1 -1
- package/esm2015/src/change_detection/change_detector_ref.js +1 -1
- package/esm2015/src/change_detection/constants.js +3 -3
- package/esm2015/src/change_detection/differs/default_iterable_differ.js +1 -1
- package/esm2015/src/change_detection/differs/default_keyvalue_differ.js +1 -1
- package/esm2015/src/change_detection/differs/iterable_differs.js +1 -1
- package/esm2015/src/change_detection/differs/keyvalue_differs.js +1 -1
- package/esm2015/src/change_detection/pipe_transform.js +1 -1
- package/esm2015/src/change_detection.js +1 -1
- package/esm2015/src/codegen_private_exports.js +1 -1
- package/esm2015/src/console.js +1 -1
- package/esm2015/src/core.js +2 -2
- package/esm2015/src/core_private_export.js +1 -1
- package/esm2015/src/core_render3_private_export.js +2 -2
- package/esm2015/src/debug/debug_node.js +6 -6
- package/esm2015/src/di/defs.js +1 -1
- package/esm2015/src/di/forward_ref.js +1 -1
- package/esm2015/src/di/injectable.js +1 -1
- package/esm2015/src/di/injection_token.js +2 -2
- package/esm2015/src/di/injector.js +1 -1
- package/esm2015/src/di/injector_compatibility.js +1 -1
- package/esm2015/src/di/metadata.js +1 -1
- package/esm2015/src/di/provider.js +1 -1
- package/esm2015/src/di/r3_injector.js +1 -1
- package/esm2015/src/di/reflective_errors.js +1 -1
- package/esm2015/src/di/reflective_injector.js +1 -1
- package/esm2015/src/di/reflective_key.js +1 -1
- package/esm2015/src/di/reflective_provider.js +1 -1
- package/esm2015/src/di/scope.js +1 -1
- package/esm2015/src/di/util.js +1 -1
- package/esm2015/src/di.js +1 -1
- package/esm2015/src/error_handler.js +1 -1
- package/esm2015/src/errors.js +1 -1
- package/esm2015/src/event_emitter.js +1 -1
- package/esm2015/src/i18n/tokens.js +1 -1
- package/esm2015/src/is_dev_mode.js +1 -1
- package/esm2015/src/ivy_switch.js +1 -1
- package/esm2015/src/linker/compiler.js +1 -1
- package/esm2015/src/linker/component_factory.js +1 -1
- package/esm2015/src/linker/component_factory_resolver.js +1 -1
- package/esm2015/src/linker/element_ref.js +1 -1
- package/esm2015/src/linker/ng_module_factory.js +1 -1
- package/esm2015/src/linker/ng_module_factory_loader.js +1 -1
- package/esm2015/src/linker/query_list.js +1 -1
- package/esm2015/src/linker/system_js_ng_module_factory_loader.js +1 -1
- package/esm2015/src/linker/template_ref.js +6 -4
- package/esm2015/src/linker/view_container_ref.js +1 -1
- package/esm2015/src/linker/view_ref.js +1 -1
- package/esm2015/src/linker.js +1 -1
- package/esm2015/src/metadata/di.js +1 -1
- package/esm2015/src/metadata/directives.js +1 -1
- package/esm2015/src/metadata/lifecycle_hooks.js +1 -1
- package/esm2015/src/metadata/ng_module.js +1 -1
- package/esm2015/src/metadata/resource_loading.js +1 -1
- package/esm2015/src/metadata/view.js +1 -1
- package/esm2015/src/metadata.js +1 -1
- package/esm2015/src/platform_core_providers.js +1 -1
- package/esm2015/src/profile/profile.js +1 -1
- package/esm2015/src/profile/wtf_impl.js +1 -1
- package/esm2015/src/r3_symbols.js +1 -1
- package/esm2015/src/reflection/platform_reflection_capabilities.js +1 -1
- package/esm2015/src/reflection/reflection.js +1 -1
- package/esm2015/src/reflection/reflection_capabilities.js +1 -1
- package/esm2015/src/reflection/reflector.js +1 -1
- package/esm2015/src/reflection/types.js +1 -1
- package/esm2015/src/render/api.js +1 -1
- package/esm2015/src/render.js +1 -1
- package/esm2015/src/render3/assert.js +1 -1
- package/esm2015/src/render3/bindings.js +3 -3
- package/esm2015/src/render3/component.js +8 -6
- package/esm2015/src/render3/component_ref.js +5 -5
- package/esm2015/src/render3/context_discovery.js +2 -2
- package/esm2015/src/render3/definition.js +3 -10
- package/esm2015/src/render3/di.js +107 -93
- package/esm2015/src/render3/di_setup.js +1 -1
- package/esm2015/src/render3/discovery_utils.js +5 -5
- package/esm2015/src/render3/empty.js +28 -0
- package/esm2015/src/render3/errors.js +1 -1
- package/esm2015/src/render3/features/inherit_definition_feature.js +3 -3
- package/esm2015/src/render3/features/ng_onchanges_feature.js +1 -1
- package/esm2015/src/render3/features/providers_feature.js +1 -1
- package/esm2015/src/render3/fields.js +1 -1
- package/esm2015/src/render3/global_utils.js +1 -1
- package/esm2015/src/render3/global_utils_api.js +1 -1
- package/esm2015/src/render3/hooks.js +14 -12
- package/esm2015/src/render3/i18n.js +3 -3
- package/esm2015/src/render3/index.js +2 -2
- package/esm2015/src/render3/instructions.js +319 -370
- package/esm2015/src/render3/interfaces/container.js +10 -1
- package/esm2015/src/render3/interfaces/context.js +1 -1
- package/esm2015/src/render3/interfaces/definition.js +1 -6
- package/esm2015/src/render3/interfaces/i18n.js +1 -1
- package/esm2015/src/render3/interfaces/injector.js +1 -2
- package/esm2015/src/render3/interfaces/node.js +37 -2
- package/esm2015/src/render3/interfaces/player.js +1 -1
- package/esm2015/src/render3/interfaces/projection.js +1 -1
- package/esm2015/src/render3/interfaces/query.js +1 -1
- package/esm2015/src/render3/interfaces/renderer.js +1 -1
- package/esm2015/src/render3/interfaces/sanitization.js +1 -1
- package/esm2015/src/render3/interfaces/styling.js +304 -113
- package/esm2015/src/render3/interfaces/view.js +15 -7
- package/esm2015/src/render3/jit/compiler_facade.js +1 -1
- package/esm2015/src/render3/jit/compiler_facade_interface.js +3 -1
- package/esm2015/src/render3/jit/directive.js +6 -7
- package/esm2015/src/render3/jit/environment.js +3 -1
- package/esm2015/src/render3/jit/injectable.js +1 -1
- package/esm2015/src/render3/jit/module.js +11 -9
- package/esm2015/src/render3/jit/pipe.js +1 -1
- package/esm2015/src/render3/jit/util.js +1 -1
- package/esm2015/src/render3/metadata.js +1 -1
- package/esm2015/src/render3/ng_dev_mode.js +1 -1
- package/esm2015/src/render3/ng_module_ref.js +1 -1
- package/esm2015/src/render3/node_assert.js +1 -1
- package/esm2015/src/render3/node_manipulation.js +5 -22
- package/esm2015/src/render3/node_selector_matcher.js +3 -3
- package/esm2015/src/render3/pipe.js +2 -2
- package/esm2015/src/render3/players.js +1 -1
- package/esm2015/src/render3/pure_function.js +3 -3
- package/esm2015/src/render3/query.js +3 -3
- package/esm2015/src/render3/state.js +14 -20
- package/esm2015/src/render3/styling/class_and_style_bindings.js +893 -213
- package/esm2015/src/render3/styling/core_player_handler.js +1 -1
- package/esm2015/src/render3/styling/player_factory.js +1 -1
- package/esm2015/src/render3/styling/util.js +37 -14
- package/esm2015/src/render3/tokens.js +1 -1
- package/esm2015/src/render3/util.js +21 -5
- package/esm2015/src/render3/view_engine_compatibility.js +5 -6
- package/esm2015/src/render3/view_engine_compatibility_prebound.js +1 -1
- package/esm2015/src/render3/view_ref.js +6 -16
- package/esm2015/src/sanitization/bypass.js +1 -1
- package/esm2015/src/sanitization/html_sanitizer.js +2 -2
- package/esm2015/src/sanitization/inert_body.js +4 -4
- package/esm2015/src/sanitization/sanitization.js +1 -1
- package/esm2015/src/sanitization/security.js +1 -1
- package/esm2015/src/sanitization/style_sanitizer.js +1 -1
- package/esm2015/src/sanitization/url_sanitizer.js +1 -1
- package/esm2015/src/testability/testability.js +1 -1
- package/esm2015/src/type.js +1 -1
- package/esm2015/src/util/decorators.js +1 -1
- package/esm2015/src/util/lang.js +1 -1
- package/esm2015/src/util/ng_reflect.js +1 -1
- package/esm2015/src/util/noop.js +1 -1
- package/esm2015/src/util/property.js +1 -1
- package/esm2015/src/util.js +1 -1
- package/esm2015/src/version.js +2 -2
- package/esm2015/src/view/element.js +1 -1
- package/esm2015/src/view/entrypoint.js +1 -1
- package/esm2015/src/view/errors.js +1 -1
- package/esm2015/src/view/index.js +1 -1
- package/esm2015/src/view/ng_content.js +1 -1
- package/esm2015/src/view/ng_module.js +1 -1
- package/esm2015/src/view/provider.js +1 -1
- package/esm2015/src/view/pure_expression.js +1 -1
- package/esm2015/src/view/query.js +1 -1
- package/esm2015/src/view/refs.js +1 -1
- package/esm2015/src/view/services.js +1 -1
- package/esm2015/src/view/text.js +1 -1
- package/esm2015/src/view/types.js +1 -1
- package/esm2015/src/view/util.js +1 -1
- package/esm2015/src/view/view.js +1 -1
- package/esm2015/src/view/view_attach.js +1 -1
- package/esm2015/src/zone/ng_zone.js +1 -1
- package/esm2015/src/zone.js +1 -1
- package/esm2015/testing/index.js +1 -1
- package/esm2015/testing/public_api.js +1 -1
- package/esm2015/testing/src/async.js +1 -1
- package/esm2015/testing/src/async_fallback.js +1 -1
- package/esm2015/testing/src/async_test_completer.js +1 -1
- package/esm2015/testing/src/before_each.js +1 -1
- package/esm2015/testing/src/component_fixture.js +1 -1
- package/esm2015/testing/src/fake_async.js +1 -1
- package/esm2015/testing/src/fake_async_fallback.js +1 -1
- package/esm2015/testing/src/lang_utils.js +1 -1
- package/esm2015/testing/src/logger.js +1 -1
- package/esm2015/testing/src/metadata_override.js +1 -1
- package/esm2015/testing/src/metadata_overrider.js +1 -1
- package/esm2015/testing/src/ng_zone_mock.js +1 -1
- package/esm2015/testing/src/private_export_testing.js +1 -1
- package/esm2015/testing/src/r3_test_bed.js +234 -152
- package/esm2015/testing/src/resolvers.js +12 -5
- package/esm2015/testing/src/test_bed.js +1 -1
- package/esm2015/testing/src/test_bed_common.js +1 -1
- package/esm2015/testing/src/test_compiler.js +1 -1
- package/esm2015/testing/src/testing.js +1 -1
- package/esm2015/testing/src/testing_internal.js +2 -2
- package/esm2015/testing/testing.js +1 -1
- package/esm5/core.js +1 -1
- package/esm5/index.js +1 -1
- package/esm5/public_api.js +1 -1
- package/esm5/src/application_init.js +1 -1
- package/esm5/src/application_module.js +1 -1
- package/esm5/src/application_ref.js +1 -1
- package/esm5/src/application_tokens.js +1 -1
- package/esm5/src/change_detection/change_detection.js +1 -1
- package/esm5/src/change_detection/change_detection_util.js +1 -1
- package/esm5/src/change_detection/change_detector_ref.js +1 -1
- package/esm5/src/change_detection/constants.js +3 -3
- package/esm5/src/change_detection/differs/default_iterable_differ.js +1 -1
- package/esm5/src/change_detection/differs/default_keyvalue_differ.js +1 -1
- package/esm5/src/change_detection/differs/iterable_differs.js +1 -1
- package/esm5/src/change_detection/differs/keyvalue_differs.js +1 -1
- package/esm5/src/change_detection/pipe_transform.js +1 -1
- package/esm5/src/change_detection.js +1 -1
- package/esm5/src/codegen_private_exports.js +1 -1
- package/esm5/src/console.js +1 -1
- package/esm5/src/core.js +1 -1
- package/esm5/src/core_private_export.js +1 -1
- package/esm5/src/core_render3_private_export.js +2 -2
- package/esm5/src/debug/debug_node.js +6 -6
- package/esm5/src/di/defs.js +1 -1
- package/esm5/src/di/forward_ref.js +1 -1
- package/esm5/src/di/injectable.js +1 -1
- package/esm5/src/di/injection_token.js +2 -2
- package/esm5/src/di/injector.js +1 -1
- package/esm5/src/di/injector_compatibility.js +1 -1
- package/esm5/src/di/metadata.js +1 -1
- package/esm5/src/di/provider.js +1 -1
- package/esm5/src/di/r3_injector.js +1 -1
- package/esm5/src/di/reflective_errors.js +1 -1
- package/esm5/src/di/reflective_injector.js +1 -1
- package/esm5/src/di/reflective_key.js +1 -1
- package/esm5/src/di/reflective_provider.js +1 -1
- package/esm5/src/di/scope.js +1 -1
- package/esm5/src/di/util.js +1 -1
- package/esm5/src/di.js +1 -1
- package/esm5/src/error_handler.js +1 -1
- package/esm5/src/errors.js +1 -1
- package/esm5/src/event_emitter.js +1 -1
- package/esm5/src/i18n/tokens.js +1 -1
- package/esm5/src/is_dev_mode.js +1 -1
- package/esm5/src/ivy_switch.js +1 -1
- package/esm5/src/linker/compiler.js +1 -1
- package/esm5/src/linker/component_factory.js +1 -1
- package/esm5/src/linker/component_factory_resolver.js +1 -1
- package/esm5/src/linker/element_ref.js +1 -1
- package/esm5/src/linker/ng_module_factory.js +1 -1
- package/esm5/src/linker/ng_module_factory_loader.js +1 -1
- package/esm5/src/linker/query_list.js +1 -1
- package/esm5/src/linker/system_js_ng_module_factory_loader.js +1 -1
- package/esm5/src/linker/template_ref.js +1 -1
- package/esm5/src/linker/view_container_ref.js +1 -1
- package/esm5/src/linker/view_ref.js +1 -1
- package/esm5/src/linker.js +1 -1
- package/esm5/src/metadata/di.js +1 -1
- package/esm5/src/metadata/directives.js +1 -1
- package/esm5/src/metadata/lifecycle_hooks.js +1 -1
- package/esm5/src/metadata/ng_module.js +1 -1
- package/esm5/src/metadata/resource_loading.js +1 -1
- package/esm5/src/metadata/view.js +1 -1
- package/esm5/src/metadata.js +1 -1
- package/esm5/src/platform_core_providers.js +1 -1
- package/esm5/src/profile/profile.js +1 -1
- package/esm5/src/profile/wtf_impl.js +1 -1
- package/esm5/src/r3_symbols.js +1 -1
- package/esm5/src/reflection/platform_reflection_capabilities.js +1 -1
- package/esm5/src/reflection/reflection.js +1 -1
- package/esm5/src/reflection/reflection_capabilities.js +1 -1
- package/esm5/src/reflection/reflector.js +1 -1
- package/esm5/src/reflection/types.js +1 -1
- package/esm5/src/render/api.js +1 -1
- package/esm5/src/render.js +1 -1
- package/esm5/src/render3/assert.js +1 -1
- package/esm5/src/render3/bindings.js +3 -3
- package/esm5/src/render3/component.js +8 -6
- package/esm5/src/render3/component_ref.js +5 -5
- package/esm5/src/render3/context_discovery.js +2 -2
- package/esm5/src/render3/definition.js +3 -8
- package/esm5/src/render3/di.js +94 -84
- package/esm5/src/render3/di_setup.js +1 -1
- package/esm5/src/render3/discovery_utils.js +5 -5
- package/esm5/src/render3/empty.js +22 -0
- package/esm5/src/render3/errors.js +1 -1
- package/esm5/src/render3/features/inherit_definition_feature.js +3 -3
- package/esm5/src/render3/features/ng_onchanges_feature.js +1 -1
- package/esm5/src/render3/features/providers_feature.js +1 -1
- package/esm5/src/render3/fields.js +1 -1
- package/esm5/src/render3/global_utils.js +1 -1
- package/esm5/src/render3/global_utils_api.js +1 -1
- package/esm5/src/render3/hooks.js +11 -9
- package/esm5/src/render3/i18n.js +3 -3
- package/esm5/src/render3/index.js +2 -2
- package/esm5/src/render3/instructions.js +282 -282
- package/esm5/src/render3/interfaces/container.js +9 -1
- package/esm5/src/render3/interfaces/context.js +1 -1
- package/esm5/src/render3/interfaces/definition.js +1 -1
- package/esm5/src/render3/interfaces/i18n.js +1 -1
- package/esm5/src/render3/interfaces/injector.js +1 -1
- package/esm5/src/render3/interfaces/node.js +1 -1
- package/esm5/src/render3/interfaces/player.js +1 -1
- package/esm5/src/render3/interfaces/projection.js +1 -1
- package/esm5/src/render3/interfaces/query.js +1 -1
- package/esm5/src/render3/interfaces/renderer.js +1 -1
- package/esm5/src/render3/interfaces/sanitization.js +1 -1
- package/esm5/src/render3/interfaces/styling.js +1 -1
- package/esm5/src/render3/interfaces/view.js +1 -1
- package/esm5/src/render3/jit/compiler_facade.js +1 -1
- package/esm5/src/render3/jit/compiler_facade_interface.js +1 -1
- package/esm5/src/render3/jit/directive.js +6 -6
- package/esm5/src/render3/jit/environment.js +3 -1
- package/esm5/src/render3/jit/injectable.js +1 -1
- package/esm5/src/render3/jit/module.js +10 -8
- package/esm5/src/render3/jit/pipe.js +1 -1
- package/esm5/src/render3/jit/util.js +1 -1
- package/esm5/src/render3/metadata.js +1 -1
- package/esm5/src/render3/ng_dev_mode.js +1 -1
- package/esm5/src/render3/ng_module_ref.js +1 -1
- package/esm5/src/render3/node_assert.js +1 -1
- package/esm5/src/render3/node_manipulation.js +5 -21
- package/esm5/src/render3/node_selector_matcher.js +3 -3
- package/esm5/src/render3/pipe.js +2 -2
- package/esm5/src/render3/players.js +1 -1
- package/esm5/src/render3/pure_function.js +3 -3
- package/esm5/src/render3/query.js +3 -3
- package/esm5/src/render3/state.js +14 -19
- package/esm5/src/render3/styling/class_and_style_bindings.js +681 -210
- package/esm5/src/render3/styling/core_player_handler.js +1 -1
- package/esm5/src/render3/styling/player_factory.js +1 -1
- package/esm5/src/render3/styling/util.js +26 -13
- package/esm5/src/render3/tokens.js +1 -1
- package/esm5/src/render3/util.js +20 -5
- package/esm5/src/render3/view_engine_compatibility.js +5 -6
- package/esm5/src/render3/view_engine_compatibility_prebound.js +1 -1
- package/esm5/src/render3/view_ref.js +6 -15
- package/esm5/src/sanitization/bypass.js +1 -1
- package/esm5/src/sanitization/html_sanitizer.js +2 -2
- package/esm5/src/sanitization/inert_body.js +4 -4
- package/esm5/src/sanitization/sanitization.js +1 -1
- package/esm5/src/sanitization/security.js +1 -1
- package/esm5/src/sanitization/style_sanitizer.js +1 -1
- package/esm5/src/sanitization/url_sanitizer.js +1 -1
- package/esm5/src/testability/testability.js +1 -1
- package/esm5/src/type.js +1 -1
- package/esm5/src/util/decorators.js +1 -1
- package/esm5/src/util/lang.js +1 -1
- package/esm5/src/util/ng_reflect.js +1 -1
- package/esm5/src/util/noop.js +1 -1
- package/esm5/src/util/property.js +1 -1
- package/esm5/src/util.js +1 -1
- package/esm5/src/version.js +2 -2
- package/esm5/src/view/element.js +1 -1
- package/esm5/src/view/entrypoint.js +1 -1
- package/esm5/src/view/errors.js +1 -1
- package/esm5/src/view/index.js +1 -1
- package/esm5/src/view/ng_content.js +1 -1
- package/esm5/src/view/ng_module.js +1 -1
- package/esm5/src/view/provider.js +1 -1
- package/esm5/src/view/pure_expression.js +1 -1
- package/esm5/src/view/query.js +1 -1
- package/esm5/src/view/refs.js +1 -1
- package/esm5/src/view/services.js +1 -1
- package/esm5/src/view/text.js +1 -1
- package/esm5/src/view/types.js +1 -1
- package/esm5/src/view/util.js +1 -1
- package/esm5/src/view/view.js +1 -1
- package/esm5/src/view/view_attach.js +1 -1
- package/esm5/src/zone/ng_zone.js +1 -1
- package/esm5/src/zone.js +1 -1
- package/esm5/testing/index.js +1 -1
- package/esm5/testing/public_api.js +1 -1
- package/esm5/testing/src/async.js +1 -1
- package/esm5/testing/src/async_fallback.js +1 -1
- package/esm5/testing/src/async_test_completer.js +1 -1
- package/esm5/testing/src/before_each.js +1 -1
- package/esm5/testing/src/component_fixture.js +1 -1
- package/esm5/testing/src/fake_async.js +1 -1
- package/esm5/testing/src/fake_async_fallback.js +1 -1
- package/esm5/testing/src/lang_utils.js +1 -1
- package/esm5/testing/src/logger.js +1 -1
- package/esm5/testing/src/metadata_override.js +1 -1
- package/esm5/testing/src/metadata_overrider.js +1 -1
- package/esm5/testing/src/ng_zone_mock.js +1 -1
- package/esm5/testing/src/private_export_testing.js +1 -1
- package/esm5/testing/src/r3_test_bed.js +174 -127
- package/esm5/testing/src/resolvers.js +11 -6
- package/esm5/testing/src/test_bed.js +1 -1
- package/esm5/testing/src/test_bed_common.js +1 -1
- package/esm5/testing/src/test_compiler.js +1 -1
- package/esm5/testing/src/testing.js +1 -1
- package/esm5/testing/src/testing_internal.js +2 -2
- package/esm5/testing/testing.js +1 -1
- package/fesm2015/core.js +2306 -1733
- package/fesm2015/core.js.map +1 -1
- package/fesm2015/testing.js +223 -150
- package/fesm2015/testing.js.map +1 -1
- package/fesm5/core.js +1781 -1335
- package/fesm5/core.js.map +1 -1
- package/fesm5/testing.js +181 -130
- package/fesm5/testing.js.map +1 -1
- package/package.json +1 -1
- package/src/change_detection/constants.d.ts +2 -2
- package/src/core_render3_private_export.d.ts +1 -1
- package/src/di/injection_token.d.ts +1 -1
- package/src/event_emitter.d.ts +2 -2
- package/src/linker/template_ref.d.ts +5 -3
- package/src/metadata/di.d.ts +1 -3
- package/src/metadata/directives.d.ts +3 -3
- package/src/render3/definition.d.ts +2 -4
- package/src/render3/di.d.ts +4 -3
- package/src/render3/empty.d.ts +16 -0
- package/src/render3/hooks.d.ts +3 -3
- package/src/render3/index.d.ts +1 -1
- package/src/render3/instructions.d.ts +117 -72
- package/src/render3/interfaces/container.d.ts +1 -0
- package/src/render3/interfaces/definition.d.ts +0 -3
- package/src/render3/interfaces/injector.d.ts +0 -1
- package/src/render3/interfaces/node.d.ts +37 -2
- package/src/render3/interfaces/styling.d.ts +392 -117
- package/src/render3/interfaces/view.d.ts +14 -6
- package/src/render3/jit/compiler_facade_interface.d.ts +2 -0
- package/src/render3/node_manipulation.d.ts +0 -7
- package/src/render3/state.d.ts +3 -4
- package/src/render3/styling/class_and_style_bindings.d.ts +114 -43
- package/src/render3/styling/util.d.ts +5 -2
- package/src/render3/util.d.ts +7 -0
- package/testing/src/r3_test_bed.d.ts +15 -0
- package/testing/testing.metadata.json +1 -1
- package/testing.d.ts +2 -3
|
@@ -11,136 +11,221 @@ import { PlayerContext } from './player';
|
|
|
11
11
|
/**
|
|
12
12
|
* The styling context acts as a styling manifest (shaped as an array) for determining which
|
|
13
13
|
* styling properties have been assigned via the provided `updateStylingMap`, `updateStyleProp`
|
|
14
|
-
* and `updateClassProp` functions.
|
|
15
|
-
*
|
|
16
|
-
* and/or clone the context.
|
|
14
|
+
* and `updateClassProp` functions. It also stores the static style/class values that were
|
|
15
|
+
* extracted from the template by the compiler.
|
|
17
16
|
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
* (
|
|
17
|
+
* A context is created by Angular when:
|
|
18
|
+
* 1. An element contains static styling values (like style="..." or class="...")
|
|
19
|
+
* 2. An element contains single property binding values (like [style.prop]="x" or
|
|
20
|
+
* [class.prop]="y")
|
|
21
|
+
* 3. An element contains multi property binding values (like [style]="x" or [class]="y")
|
|
22
|
+
* 4. A directive contains host bindings for static, single or multi styling properties/bindings.
|
|
23
|
+
* 5. An animation player is added to an element via `addPlayer`
|
|
21
24
|
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
25
|
+
* Note that even if an element contains static styling then this context will be created and
|
|
26
|
+
* attached to it. The reason why this happens (instead of treating styles/classes as regular
|
|
27
|
+
* HTML attributes) is because the style/class bindings must be able to default themselves back
|
|
28
|
+
* to their respective static values when they are set to null.
|
|
26
29
|
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
*
|
|
30
|
+
* Say for example we have this:
|
|
31
|
+
* ```
|
|
32
|
+
* <!-- when myWidthExp=null then a width of "100px"
|
|
33
|
+
* will be used a default value for width -->
|
|
34
|
+
* <div style="width:100px" [style.width]="myWidthExp"></div>
|
|
35
|
+
* ```
|
|
36
|
+
*
|
|
37
|
+
* Even in the situation where there are no bindings, the static styling is still placed into the
|
|
38
|
+
* context because there may be another directive on the same element that has styling.
|
|
39
|
+
*
|
|
40
|
+
* When Angular initializes styling data for an element then it will first register the static
|
|
41
|
+
* styling values on the element using one of these two instructions:
|
|
33
42
|
*
|
|
34
|
-
*
|
|
43
|
+
* 1. elementStart or element (within the template function of a component)
|
|
44
|
+
* 2. elementHostAttrs (for directive host bindings)
|
|
35
45
|
*
|
|
36
|
-
*
|
|
46
|
+
* In either case, a styling context will be created and stored within an element's LViewData. Once
|
|
47
|
+
* the styling context is created then single and multi properties can stored within it. For this to
|
|
48
|
+
* happen, the following function needs to be called:
|
|
37
49
|
*
|
|
38
|
-
*
|
|
39
|
-
*
|
|
50
|
+
* `elementStyling` (called with style properties, class properties and a sanitizer + a directive
|
|
51
|
+
* instance).
|
|
40
52
|
*
|
|
41
|
-
* When
|
|
42
|
-
*
|
|
43
|
-
* for example we have a series of initial styles that look like so:
|
|
53
|
+
* When this instruction is called it will populate the styling context with the provided style
|
|
54
|
+
* and class names into the context.
|
|
44
55
|
*
|
|
45
|
-
*
|
|
46
|
-
*
|
|
56
|
+
* The context itself looks like this:
|
|
57
|
+
*
|
|
58
|
+
* context = [
|
|
59
|
+
* // 0-8: header values (about 8 entries of configuration data)
|
|
60
|
+
* // 9+: this is where each entry is stored:
|
|
61
|
+
* ]
|
|
47
62
|
*
|
|
48
|
-
*
|
|
63
|
+
* Let's say we have the following template code:
|
|
49
64
|
*
|
|
50
65
|
* ```
|
|
66
|
+
* <div class="foo bar"
|
|
67
|
+
* style="width:200px; color:red"
|
|
68
|
+
* [style.width]="myWidthExp"
|
|
69
|
+
* [style.height]="myHeightExp"
|
|
70
|
+
* [class.baz]="myBazExp">
|
|
71
|
+
* ```
|
|
72
|
+
*
|
|
73
|
+
* The context generated from these values will look like this (note that
|
|
74
|
+
* for each binding name (the class and style bindings) the values will
|
|
75
|
+
* be inserted twice into the array (once for single property entries) and
|
|
76
|
+
* another for multi property entries).
|
|
77
|
+
*
|
|
78
|
+
* context = [
|
|
79
|
+
* // 0-8: header values (about 8 entries of configuration data)
|
|
80
|
+
* // 9+: this is where each entry is stored:
|
|
81
|
+
*
|
|
82
|
+
* // SINGLE PROPERTIES
|
|
83
|
+
* configForWidth,
|
|
84
|
+
* 'width'
|
|
85
|
+
* myWidthExp, // the binding value not the binding itself
|
|
86
|
+
* 0, // the directive owner
|
|
87
|
+
*
|
|
88
|
+
* configForHeight,
|
|
89
|
+
* 'height'
|
|
90
|
+
* myHeightExp, // the binding value not the binding itself
|
|
91
|
+
* 0, // the directive owner
|
|
92
|
+
*
|
|
93
|
+
* configForBazClass,
|
|
94
|
+
* 'baz
|
|
95
|
+
* myBazClassExp, // the binding value not the binding itself
|
|
96
|
+
* 0, // the directive owner
|
|
97
|
+
*
|
|
98
|
+
* // MULTI PROPERTIES
|
|
99
|
+
* configForWidth,
|
|
100
|
+
* 'width'
|
|
101
|
+
* myWidthExp, // the binding value not the binding itself
|
|
102
|
+
* 0, // the directive owner
|
|
103
|
+
*
|
|
104
|
+
* configForHeight,
|
|
105
|
+
* 'height'
|
|
106
|
+
* myHeightExp, // the binding value not the binding itself
|
|
107
|
+
* 0, // the directive owner
|
|
108
|
+
*
|
|
109
|
+
* configForBazClass,
|
|
110
|
+
* 'baz
|
|
111
|
+
* myBazClassExp, // the binding value not the binding itself
|
|
112
|
+
* 0, // the directive owner
|
|
113
|
+
* ]
|
|
114
|
+
*
|
|
115
|
+
* The configuration values are left out of the example above because
|
|
116
|
+
* the ordering of them could change between code patches. Please read the
|
|
117
|
+
* documentation below to get a better understand of what the configuration
|
|
118
|
+
* values are and how they work.
|
|
119
|
+
*
|
|
120
|
+
* Each time a binding property is updated (whether it be through a single
|
|
121
|
+
* property instruction like `elementStyleProp`, `elementClassProp` or
|
|
122
|
+
* `elementStylingMap`) then the values in the context will be updated as
|
|
123
|
+
* well.
|
|
124
|
+
*
|
|
125
|
+
* If for example `[style.width]` updates to `555px` then its value will be reflected
|
|
126
|
+
* in the context as so:
|
|
127
|
+
*
|
|
51
128
|
* context = [
|
|
52
|
-
*
|
|
53
|
-
*
|
|
54
|
-
*
|
|
55
|
-
*
|
|
56
|
-
*
|
|
57
|
-
*
|
|
58
|
-
* configMasterVal,
|
|
59
|
-
* 1, // this instructs how many `style` values there are so that class index values can be
|
|
60
|
-
* offsetted
|
|
61
|
-
* { classOne: true, classTwo: false } | 'classOne classTwo' | null // last class value provided
|
|
62
|
-
* into updateStylingMap
|
|
63
|
-
* { styleOne: '100px', styleTwo: 0 } | null // last style value provided into updateStylingMap
|
|
64
|
-
*
|
|
65
|
-
* // 8
|
|
66
|
-
* 'width',
|
|
67
|
-
* pointers(1, 15); // Point to static `width`: `100px` and multi `width`.
|
|
68
|
-
* null,
|
|
69
|
-
*
|
|
70
|
-
* // 11
|
|
71
|
-
* 'height',
|
|
72
|
-
* pointers(2, 18); // Point to static `height`: `200px` and multi `height`.
|
|
73
|
-
* null,
|
|
74
|
-
*
|
|
75
|
-
* // 14
|
|
76
|
-
* 'foo',
|
|
77
|
-
* pointers(1, 21); // Point to static `foo`: `true` and multi `foo`.
|
|
78
|
-
* null,
|
|
79
|
-
*
|
|
80
|
-
* // 17
|
|
81
|
-
* 'width',
|
|
82
|
-
* pointers(1, 6); // Point to static `width`: `100px` and single `width`.
|
|
83
|
-
* null,
|
|
84
|
-
*
|
|
85
|
-
* // 21
|
|
86
|
-
* 'height',
|
|
87
|
-
* pointers(2, 9); // Point to static `height`: `200px` and single `height`.
|
|
88
|
-
* null,
|
|
89
|
-
*
|
|
90
|
-
* // 24
|
|
91
|
-
* 'foo',
|
|
92
|
-
* pointers(3, 12); // Point to static `foo`: `true` and single `foo`.
|
|
93
|
-
* null,
|
|
129
|
+
* // ...
|
|
130
|
+
* configForWidth, // this will be marked DIRTY
|
|
131
|
+
* 'width'
|
|
132
|
+
* '555px',
|
|
133
|
+
* 0,
|
|
134
|
+
* //..
|
|
94
135
|
* ]
|
|
95
136
|
*
|
|
96
|
-
*
|
|
97
|
-
*
|
|
98
|
-
*
|
|
99
|
-
*
|
|
137
|
+
* The context and directive data will also be marked dirty.
|
|
138
|
+
*
|
|
139
|
+
* Despite the context being updated, nothing has been rendered on screen (not styles or
|
|
140
|
+
* classes have been set on the element). To kick off rendering for an element the following
|
|
141
|
+
* function needs to be run `elementStylingApply`.
|
|
142
|
+
*
|
|
143
|
+
* `elementStylingApply` will run through the context and find each dirty value and render them onto
|
|
144
|
+
* the element. Once complete, all styles/classes will be set to clean. Because of this, the render
|
|
145
|
+
* function will now know not to rerun itself again if called again unless new style/class values
|
|
146
|
+
* have changed.
|
|
147
|
+
*
|
|
148
|
+
* ## Directives
|
|
149
|
+
* Directives style values (which are provided through host bindings) are also supported and
|
|
150
|
+
* housed within the same styling context as are template-level style/class properties/bindings.
|
|
151
|
+
* Both directive-level and template-level styling bindings share the same context.
|
|
152
|
+
*
|
|
153
|
+
* Each of the following instructions supports accepting a directive instance as an input parameter:
|
|
154
|
+
*
|
|
155
|
+
* - `elementHostAttrs`
|
|
156
|
+
* - `elementStyling`
|
|
157
|
+
* - `elementStyleProp`
|
|
158
|
+
* - `elementClassProp`
|
|
159
|
+
* - `elementStylingMap`
|
|
160
|
+
* - `elementStylingApply`
|
|
161
|
+
*
|
|
162
|
+
* Each time a directiveRef is passed in, it will be converted into an index by examining the
|
|
163
|
+
* directive registry (which lives in the context configuration area). The index is then used
|
|
164
|
+
* to help single style properties figure out where a value is located in the context.
|
|
165
|
+
*
|
|
166
|
+
* If two directives or a directive + a template binding both write to the same style/class
|
|
167
|
+
* binding then the styling context code will decide which one wins based on the following
|
|
168
|
+
* rule:
|
|
169
|
+
*
|
|
170
|
+
* 1. If the template binding has a value then it always wins
|
|
171
|
+
* 2. If not then whichever first-registered directive that has that value first will win
|
|
172
|
+
*
|
|
173
|
+
* The code example helps make this clear:
|
|
174
|
+
*
|
|
175
|
+
* ```
|
|
176
|
+
* <div [style.width]="myWidth" [my-width-directive]="'600px">
|
|
177
|
+
* @Directive({ selector: '[my-width-directive' ]})
|
|
178
|
+
* class MyWidthDirective {
|
|
179
|
+
* @Input('my-width-directive')
|
|
180
|
+
* @HostBinding('style.width')
|
|
181
|
+
* public width = null;
|
|
100
182
|
* }
|
|
101
183
|
* ```
|
|
102
184
|
*
|
|
103
|
-
*
|
|
104
|
-
*
|
|
105
|
-
*
|
|
106
|
-
*
|
|
107
|
-
*
|
|
108
|
-
*
|
|
109
|
-
*
|
|
110
|
-
*
|
|
111
|
-
*
|
|
112
|
-
*
|
|
113
|
-
*
|
|
114
|
-
*
|
|
185
|
+
* Since there is a style binding for width present on the element (`[style.width]`) then
|
|
186
|
+
* it will always win over the width binding that is present as a host binding within
|
|
187
|
+
* the `MyWidthDirective`. However, if `[style.width]` renders as `null` (so `myWidth=null`)
|
|
188
|
+
* then the `MyWidthDirective` will be able to write to the `width` style within the context.
|
|
189
|
+
* Simply put, whichever directive writes to a value ends up having ownership of it.
|
|
190
|
+
*
|
|
191
|
+
* The way in which the ownership is facilitated is through index value. The earliest directives
|
|
192
|
+
* get the smallest index values (with 0 being reserved for the template element bindings). Each
|
|
193
|
+
* time a value is written from a directive or the template bindings, the value itself gets
|
|
194
|
+
* assigned the directive index value in its data. If another directive writes a value again then
|
|
195
|
+
* its directive index gets compared against the directive index that exists on the element. Only
|
|
196
|
+
* when the new value's directive index is less than the existing directive index then the new
|
|
197
|
+
* value will be written to the context.
|
|
198
|
+
*
|
|
199
|
+
* Each directive also has its own sanitizer and dirty flags. These values are consumed within the
|
|
200
|
+
* rendering function.
|
|
115
201
|
*/
|
|
116
|
-
export interface StylingContext extends Array<
|
|
202
|
+
export interface StylingContext extends Array<{
|
|
117
203
|
[key: string]: any;
|
|
118
204
|
} | number | string | boolean | RElement | StyleSanitizeFn | PlayerContext | null> {
|
|
119
205
|
/**
|
|
120
|
-
*
|
|
121
|
-
*
|
|
206
|
+
* A numeric value representing the configuration status (whether the context is dirty or not)
|
|
207
|
+
* mixed together (using bit shifting) with a index value which tells the starting index value
|
|
208
|
+
* of where the multi style entries begin.
|
|
122
209
|
*/
|
|
123
|
-
[StylingIndex.
|
|
210
|
+
[StylingIndex.MasterFlagPosition]: number;
|
|
124
211
|
/**
|
|
125
|
-
*
|
|
212
|
+
* Location of the collection of directives for this context
|
|
126
213
|
*/
|
|
127
|
-
[StylingIndex.
|
|
214
|
+
[StylingIndex.DirectiveRegistryPosition]: DirectiveRegistryValues;
|
|
128
215
|
/**
|
|
129
|
-
* Location of
|
|
216
|
+
* Location of all static styles values
|
|
130
217
|
*/
|
|
131
|
-
[StylingIndex.
|
|
218
|
+
[StylingIndex.InitialStyleValuesPosition]: InitialStylingValues;
|
|
132
219
|
/**
|
|
133
|
-
*
|
|
134
|
-
* mixed together (using bit shifting) with a index value which tells the starting index value
|
|
135
|
-
* of where the multi style entries begin.
|
|
220
|
+
* Location of all static class values
|
|
136
221
|
*/
|
|
137
|
-
[StylingIndex.
|
|
222
|
+
[StylingIndex.InitialClassValuesPosition]: InitialStylingValues;
|
|
138
223
|
/**
|
|
139
224
|
* A numeric value representing the class index offset value. Whenever a single class is
|
|
140
225
|
* applied (using `elementClassProp`) it should have an styling index value that doesn't
|
|
141
226
|
* need to take into account any style values that exist in the context.
|
|
142
227
|
*/
|
|
143
|
-
[StylingIndex.
|
|
228
|
+
[StylingIndex.SinglePropOffsetPositions]: SinglePropOffsetValues;
|
|
144
229
|
/**
|
|
145
230
|
* Location of element that is used as a target for this context.
|
|
146
231
|
*/
|
|
@@ -149,28 +234,204 @@ export interface StylingContext extends Array<InitialStyles | {
|
|
|
149
234
|
* The last class value that was interpreted by elementStylingMap. This is cached
|
|
150
235
|
* So that the algorithm can exit early incase the value has not changed.
|
|
151
236
|
*/
|
|
152
|
-
[StylingIndex.
|
|
237
|
+
[StylingIndex.CachedClassValueOrInitialClassString]: {
|
|
153
238
|
[key: string]: any;
|
|
154
|
-
} | string | null;
|
|
239
|
+
} | string | (string)[] | null;
|
|
155
240
|
/**
|
|
156
241
|
* The last style value that was interpreted by elementStylingMap. This is cached
|
|
157
242
|
* So that the algorithm can exit early incase the value has not changed.
|
|
158
243
|
*/
|
|
159
|
-
[StylingIndex.
|
|
244
|
+
[StylingIndex.CachedStyleValue]: {
|
|
160
245
|
[key: string]: any;
|
|
161
|
-
} | null;
|
|
246
|
+
} | (string)[] | null;
|
|
247
|
+
/**
|
|
248
|
+
* Location of animation context (which contains the active players) for this element styling
|
|
249
|
+
* context.
|
|
250
|
+
*/
|
|
251
|
+
[StylingIndex.PlayerContext]: PlayerContext | null;
|
|
162
252
|
}
|
|
163
253
|
/**
|
|
164
|
-
*
|
|
165
|
-
* the
|
|
166
|
-
*
|
|
254
|
+
* Used as a styling array to house static class and style values that were extracted
|
|
255
|
+
* by the compiler and placed in the animation context via `elementStart` and
|
|
256
|
+
* `elementHostAttrs`.
|
|
167
257
|
*
|
|
168
|
-
*
|
|
169
|
-
* were extracted from the `style=""` attribute in the HTML code for the provided template.
|
|
258
|
+
* See [InitialStylingValuesIndex] for a breakdown of how all this works.
|
|
170
259
|
*/
|
|
171
|
-
export interface
|
|
260
|
+
export interface InitialStylingValues extends Array<string | boolean | null> {
|
|
172
261
|
[0]: null;
|
|
173
262
|
}
|
|
263
|
+
/**
|
|
264
|
+
* Used as an offset/position index to figure out where initial styling
|
|
265
|
+
* values are located.
|
|
266
|
+
*
|
|
267
|
+
* Used as a reference point to provide markers to all static styling
|
|
268
|
+
* values (the initial style and class values on an element) within an
|
|
269
|
+
* array within the StylingContext. This array contains key/value pairs
|
|
270
|
+
* where the key is the style property name or className and the value is
|
|
271
|
+
* the style value or whether or not a class is present on the elment.
|
|
272
|
+
*
|
|
273
|
+
* The first value is also always null so that a initial index value of
|
|
274
|
+
* `0` will always point to a null value.
|
|
275
|
+
*
|
|
276
|
+
* If a <div> elements contains a list of static styling values like so:
|
|
277
|
+
*
|
|
278
|
+
* <div class="foo bar baz" style="width:100px; height:200px;">
|
|
279
|
+
*
|
|
280
|
+
* Then the initial styles for that will look like so:
|
|
281
|
+
*
|
|
282
|
+
* Styles:
|
|
283
|
+
* StylingContext[InitialStylesIndex] = [
|
|
284
|
+
* null, 'width', '100px', height, '200px'
|
|
285
|
+
* ]
|
|
286
|
+
*
|
|
287
|
+
* Classes:
|
|
288
|
+
* StylingContext[InitialStylesIndex] = [
|
|
289
|
+
* null, 'foo', true, 'bar', true, 'baz', true
|
|
290
|
+
* ]
|
|
291
|
+
*
|
|
292
|
+
* Initial style and class entries have their own arrays. This is because
|
|
293
|
+
* it's easier to add to the end of one array and not then have to update
|
|
294
|
+
* every context entries' pointer index to the newly offseted values.
|
|
295
|
+
*
|
|
296
|
+
* When property bindinds are added to a context then initial style/class
|
|
297
|
+
* values will also be inserted into the array. This is to create a space
|
|
298
|
+
* in the situation when a follow-up directive inserts static styling into
|
|
299
|
+
* the array. By default style values are `null` and class values are
|
|
300
|
+
* `false` when inserted by property bindings.
|
|
301
|
+
*
|
|
302
|
+
* For example:
|
|
303
|
+
* <div class="foo bar baz"
|
|
304
|
+
* [class.car]="myCarExp"
|
|
305
|
+
* style="width:100px; height:200px;"
|
|
306
|
+
* [style.opacity]="myOpacityExp">
|
|
307
|
+
*
|
|
308
|
+
* Will construct initial styling values that look like:
|
|
309
|
+
*
|
|
310
|
+
* Styles:
|
|
311
|
+
* StylingContext[InitialStylesIndex] = [
|
|
312
|
+
* null, 'width', '100px', height, '200px', 'opacity', null
|
|
313
|
+
* ]
|
|
314
|
+
*
|
|
315
|
+
* Classes:
|
|
316
|
+
* StylingContext[InitialStylesIndex] = [
|
|
317
|
+
* null, 'foo', true, 'bar', true, 'baz', true, 'car', false
|
|
318
|
+
* ]
|
|
319
|
+
*
|
|
320
|
+
* Now if a directive comes along and introduces `car` as a static
|
|
321
|
+
* class value or `opacity` then those values will be filled into
|
|
322
|
+
* the initial styles array.
|
|
323
|
+
*
|
|
324
|
+
* For example:
|
|
325
|
+
*
|
|
326
|
+
* @Directive({
|
|
327
|
+
* selector: 'opacity-car-directive',
|
|
328
|
+
* host: {
|
|
329
|
+
* 'style': 'opacity:0.5',
|
|
330
|
+
* 'class': 'car'
|
|
331
|
+
* }
|
|
332
|
+
* })
|
|
333
|
+
* class OpacityCarDirective {}
|
|
334
|
+
*
|
|
335
|
+
* This will render itself as:
|
|
336
|
+
*
|
|
337
|
+
* Styles:
|
|
338
|
+
* StylingContext[InitialStylesIndex] = [
|
|
339
|
+
* null, 'width', '100px', height, '200px', 'opacity', null
|
|
340
|
+
* ]
|
|
341
|
+
*
|
|
342
|
+
* Classes:
|
|
343
|
+
* StylingContext[InitialStylesIndex] = [
|
|
344
|
+
* null, 'foo', true, 'bar', true, 'baz', true, 'car', false
|
|
345
|
+
* ]
|
|
346
|
+
*/
|
|
347
|
+
export declare const enum InitialStylingValuesIndex {
|
|
348
|
+
KeyValueStartPosition = 1,
|
|
349
|
+
PropOffset = 0,
|
|
350
|
+
ValueOffset = 1,
|
|
351
|
+
Size = 2
|
|
352
|
+
}
|
|
353
|
+
/**
|
|
354
|
+
* An array located in the StylingContext that houses all directive instances and additional
|
|
355
|
+
* data about them.
|
|
356
|
+
*
|
|
357
|
+
* Each entry in this array represents a source of where style/class binding values could
|
|
358
|
+
* come from. By default, there is always at least one directive here with a null value and
|
|
359
|
+
* that represents bindings that live directly on an element (not host bindings).
|
|
360
|
+
*
|
|
361
|
+
* Each successive entry in the array is an actual instance of an array as well as some
|
|
362
|
+
* additional info.
|
|
363
|
+
*
|
|
364
|
+
* An entry within this array has the following values:
|
|
365
|
+
* [0] = The instance of the directive (or null when it is not a directive, but a template binding
|
|
366
|
+
* source)
|
|
367
|
+
* [1] = The pointer that tells where the single styling (stuff like [class.foo] and [style.prop])
|
|
368
|
+
* offset values are located. This value will allow for a binding instruction to find exactly
|
|
369
|
+
* where a style is located.
|
|
370
|
+
* [2] = Whether or not the directive has any styling values that are dirty. This is used as
|
|
371
|
+
* reference within the renderClassAndStyleBindings function to decide whether to skip
|
|
372
|
+
* iterating through the context when rendering is executed.
|
|
373
|
+
* [3] = The styleSanitizer instance that is assigned to the directive. Although it's unlikely,
|
|
374
|
+
* a directive could introduce its own special style sanitizer and for this reach each
|
|
375
|
+
* directive will get its own space for it (if null then the very first sanitizer is used).
|
|
376
|
+
*
|
|
377
|
+
* Each time a new directive is added it will insert these four values at the end of the array.
|
|
378
|
+
* When this array is examined (using indexOf) then the resulting directiveIndex will be resolved
|
|
379
|
+
* by dividing the index value by the size of the array entries (so if DirA is at spot 8 then its
|
|
380
|
+
* index will be 2).
|
|
381
|
+
*/
|
|
382
|
+
export interface DirectiveRegistryValues extends Array<null | {} | boolean | number | StyleSanitizeFn> {
|
|
383
|
+
[DirectiveRegistryValuesIndex.DirectiveValueOffset]: null;
|
|
384
|
+
[DirectiveRegistryValuesIndex.SinglePropValuesIndexOffset]: number;
|
|
385
|
+
[DirectiveRegistryValuesIndex.DirtyFlagOffset]: boolean;
|
|
386
|
+
[DirectiveRegistryValuesIndex.StyleSanitizerOffset]: StyleSanitizeFn | null;
|
|
387
|
+
}
|
|
388
|
+
/**
|
|
389
|
+
* An enum that outlines the offset/position values for each directive entry and its data
|
|
390
|
+
* that are housed inside of [DirectiveRegistryValues].
|
|
391
|
+
*/
|
|
392
|
+
export declare const enum DirectiveRegistryValuesIndex {
|
|
393
|
+
DirectiveValueOffset = 0,
|
|
394
|
+
SinglePropValuesIndexOffset = 1,
|
|
395
|
+
DirtyFlagOffset = 2,
|
|
396
|
+
StyleSanitizerOffset = 3,
|
|
397
|
+
Size = 4
|
|
398
|
+
}
|
|
399
|
+
/**
|
|
400
|
+
* An array that contains the index pointer values for every single styling property
|
|
401
|
+
* that exists in the context and for every directive. It also contains the total
|
|
402
|
+
* single styles and single classes that exists in the context as the first two values.
|
|
403
|
+
*
|
|
404
|
+
* Let's say we have the following template code:
|
|
405
|
+
*
|
|
406
|
+
* <div [style.width]="myWidth"
|
|
407
|
+
* [style.height]="myHeight"
|
|
408
|
+
* [class.flipped]="flipClass"
|
|
409
|
+
* directive-with-opacity>
|
|
410
|
+
* directive-with-foo-bar-classes>
|
|
411
|
+
*
|
|
412
|
+
* We have two directive and template-binding sources,
|
|
413
|
+
* 2 + 1 styles and 1 + 1 classes. When the bindings are
|
|
414
|
+
* registered the SinglePropOffsets array will look like so:
|
|
415
|
+
*
|
|
416
|
+
* s_0/c_0 = template directive value
|
|
417
|
+
* s_1/c_1 = directive one (directive-with-opacity)
|
|
418
|
+
* s_2/c_2 = directive two (directive-with-foo-bar-classes)
|
|
419
|
+
*
|
|
420
|
+
* [3, 2, 2, 1, s_00, s01, c_01, 1, 0, s_10, 0, 1, c_20
|
|
421
|
+
*/
|
|
422
|
+
export interface SinglePropOffsetValues extends Array<number> {
|
|
423
|
+
[SinglePropOffsetValuesIndex.StylesCountPosition]: number;
|
|
424
|
+
[SinglePropOffsetValuesIndex.ClassesCountPosition]: number;
|
|
425
|
+
}
|
|
426
|
+
/**
|
|
427
|
+
* An enum that outlines the offset/position values for each single prop/class entry
|
|
428
|
+
* that are housed inside of [SinglePropOffsetValues].
|
|
429
|
+
*/
|
|
430
|
+
export declare const enum SinglePropOffsetValuesIndex {
|
|
431
|
+
StylesCountPosition = 0,
|
|
432
|
+
ClassesCountPosition = 1,
|
|
433
|
+
ValueStartPosition = 2
|
|
434
|
+
}
|
|
174
435
|
/**
|
|
175
436
|
* Used to set the context to be dirty or not both on the master flag (position 1)
|
|
176
437
|
* or for each single/multi property that exists in the context.
|
|
@@ -182,20 +443,22 @@ export declare const enum StylingFlags {
|
|
|
182
443
|
Sanitize = 4,
|
|
183
444
|
PlayerBuildersDirty = 8,
|
|
184
445
|
OnlyProcessSingleClasses = 16,
|
|
185
|
-
|
|
186
|
-
|
|
446
|
+
BindingAllocationLocked = 32,
|
|
447
|
+
BitCountSize = 6,
|
|
448
|
+
BitMask = 63
|
|
187
449
|
}
|
|
188
450
|
/** Used as numeric pointer values to determine what cells to update in the `StylingContext` */
|
|
189
451
|
export declare const enum StylingIndex {
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
452
|
+
MasterFlagPosition = 0,
|
|
453
|
+
DirectiveRegistryPosition = 1,
|
|
454
|
+
InitialStyleValuesPosition = 2,
|
|
455
|
+
InitialClassValuesPosition = 3,
|
|
456
|
+
SinglePropOffsetPositions = 4,
|
|
195
457
|
ElementPosition = 5,
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
458
|
+
CachedClassValueOrInitialClassString = 6,
|
|
459
|
+
CachedStyleValue = 7,
|
|
460
|
+
PlayerContext = 8,
|
|
461
|
+
SingleStylesStartPosition = 9,
|
|
199
462
|
FlagsOffset = 0,
|
|
200
463
|
PropertyOffset = 1,
|
|
201
464
|
ValueOffset = 2,
|
|
@@ -204,3 +467,15 @@ export declare const enum StylingIndex {
|
|
|
204
467
|
BitCountSize = 14,
|
|
205
468
|
BitMask = 16383
|
|
206
469
|
}
|
|
470
|
+
/**
|
|
471
|
+
* An enum that outlines the bit flag data for directive owner and player index
|
|
472
|
+
* values that exist within en entry that lives in the StylingContext.
|
|
473
|
+
*
|
|
474
|
+
* The values here split a number value into two sets of bits:
|
|
475
|
+
* - The first 16 bits are used to store the directiveIndex that owns this style value
|
|
476
|
+
* - The other 16 bits are used to store the playerBuilderIndex that is attached to this style
|
|
477
|
+
*/
|
|
478
|
+
export declare const enum DirectiveOwnerAndPlayerBuilderIndex {
|
|
479
|
+
BitCountSize = 16,
|
|
480
|
+
BitMask = 65535
|
|
481
|
+
}
|
|
@@ -190,12 +190,20 @@ export declare const enum LViewFlags {
|
|
|
190
190
|
* improperly reported as false.
|
|
191
191
|
*/
|
|
192
192
|
CreationMode = 1,
|
|
193
|
+
/**
|
|
194
|
+
* Whether or not this LView instance is on its first processing pass.
|
|
195
|
+
*
|
|
196
|
+
* An LView instance is considered to be on its "first pass" until it
|
|
197
|
+
* has completed one creation mode run and one update mode run. At this
|
|
198
|
+
* time, the flag is turned off.
|
|
199
|
+
*/
|
|
200
|
+
FirstLViewPass = 2,
|
|
193
201
|
/** Whether this view has default change detection strategy (checks always) or onPush */
|
|
194
|
-
CheckAlways =
|
|
202
|
+
CheckAlways = 4,
|
|
195
203
|
/** Whether or not this view is currently dirty (needing check) */
|
|
196
|
-
Dirty =
|
|
204
|
+
Dirty = 8,
|
|
197
205
|
/** Whether or not this view is currently attached to change detection tree. */
|
|
198
|
-
Attached =
|
|
206
|
+
Attached = 16,
|
|
199
207
|
/**
|
|
200
208
|
* Whether or not the init hooks have run.
|
|
201
209
|
*
|
|
@@ -203,11 +211,11 @@ export declare const enum LViewFlags {
|
|
|
203
211
|
* runs OR the first cR() instruction that runs (so inits are run for the top level view before
|
|
204
212
|
* any embedded views).
|
|
205
213
|
*/
|
|
206
|
-
RunInit =
|
|
214
|
+
RunInit = 32,
|
|
207
215
|
/** Whether or not this view is destroyed. */
|
|
208
|
-
Destroyed =
|
|
216
|
+
Destroyed = 64,
|
|
209
217
|
/** Whether or not this view is the root view */
|
|
210
|
-
IsRoot =
|
|
218
|
+
IsRoot = 128
|
|
211
219
|
}
|
|
212
220
|
/**
|
|
213
221
|
* The static data for an LView (shared between all templates of a
|
|
@@ -124,8 +124,10 @@ export interface R3ComponentMetadataFacade extends R3DirectiveMetadataFacade {
|
|
|
124
124
|
encapsulation: ViewEncapsulation;
|
|
125
125
|
viewProviders: Provider[] | null;
|
|
126
126
|
interpolation?: [string, string];
|
|
127
|
+
changeDetection?: ChangeDetectionStrategy;
|
|
127
128
|
}
|
|
128
129
|
export declare type ViewEncapsulation = number;
|
|
130
|
+
export declare type ChangeDetectionStrategy = number;
|
|
129
131
|
export interface R3QueryMetadataFacade {
|
|
130
132
|
propertyName: string;
|
|
131
133
|
first: boolean;
|
|
@@ -22,13 +22,6 @@ export declare function getLContainer(tNode: TViewNode, embeddedView: LView): LC
|
|
|
22
22
|
* Might be null if a view is not yet attached to any container.
|
|
23
23
|
*/
|
|
24
24
|
export declare function getContainerRenderParent(tViewNode: TViewNode, view: LView): RElement | null;
|
|
25
|
-
/**
|
|
26
|
-
* Given a current view, finds the nearest component's host (LElement).
|
|
27
|
-
*
|
|
28
|
-
* @param lView LView for which we want a host element node
|
|
29
|
-
* @returns The host node
|
|
30
|
-
*/
|
|
31
|
-
export declare function findComponentView(lView: LView): LView;
|
|
32
25
|
export declare function createTextNode(value: any, renderer: Renderer3): RText;
|
|
33
26
|
/**
|
|
34
27
|
* Adds or removes all DOM elements associated with a view.
|