@angular/elements 18.2.0 → 19.0.0-next.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm2022/src/version.mjs +1 -1
- package/fesm2022/elements.mjs +2 -2
- package/fesm2022/elements.mjs.map +1 -1
- package/index.d.ts +1 -1
- package/package.json +2 -2
package/esm2022/src/version.mjs
CHANGED
|
@@ -9,5 +9,5 @@ import { Version } from '@angular/core';
|
|
|
9
9
|
/**
|
|
10
10
|
* @publicApi
|
|
11
11
|
*/
|
|
12
|
-
export const VERSION = new Version('
|
|
12
|
+
export const VERSION = new Version('19.0.0-next.0');
|
|
13
13
|
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidmVyc2lvbi5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uL3BhY2thZ2VzL2VsZW1lbnRzL3NyYy92ZXJzaW9uLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOzs7Ozs7R0FNRztBQUVILE9BQU8sRUFBQyxPQUFPLEVBQUMsTUFBTSxlQUFlLENBQUM7QUFFdEM7O0dBRUc7QUFDSCxNQUFNLENBQUMsTUFBTSxPQUFPLEdBQUcsSUFBSSxPQUFPLENBQUMsbUJBQW1CLENBQUMsQ0FBQyIsInNvdXJjZXNDb250ZW50IjpbIi8qKlxuICogQGxpY2Vuc2VcbiAqIENvcHlyaWdodCBHb29nbGUgTExDIEFsbCBSaWdodHMgUmVzZXJ2ZWQuXG4gKlxuICogVXNlIG9mIHRoaXMgc291cmNlIGNvZGUgaXMgZ292ZXJuZWQgYnkgYW4gTUlULXN0eWxlIGxpY2Vuc2UgdGhhdCBjYW4gYmVcbiAqIGZvdW5kIGluIHRoZSBMSUNFTlNFIGZpbGUgYXQgaHR0cHM6Ly9hbmd1bGFyLmlvL2xpY2Vuc2VcbiAqL1xuXG5pbXBvcnQge1ZlcnNpb259IGZyb20gJ0Bhbmd1bGFyL2NvcmUnO1xuXG4vKipcbiAqIEBwdWJsaWNBcGlcbiAqL1xuZXhwb3J0IGNvbnN0IFZFUlNJT04gPSBuZXcgVmVyc2lvbignMC4wLjAtUExBQ0VIT0xERVInKTtcbiJdfQ==
|
package/fesm2022/elements.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Angular
|
|
2
|
+
* @license Angular v19.0.0-next.0
|
|
3
3
|
* (c) 2010-2024 Google LLC. https://angular.io/
|
|
4
4
|
* License: MIT
|
|
5
5
|
*/
|
|
@@ -513,7 +513,7 @@ function createCustomElement(component, config) {
|
|
|
513
513
|
/**
|
|
514
514
|
* @publicApi
|
|
515
515
|
*/
|
|
516
|
-
const VERSION = new Version('
|
|
516
|
+
const VERSION = new Version('19.0.0-next.0');
|
|
517
517
|
|
|
518
518
|
/**
|
|
519
519
|
* @module
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"elements.mjs","sources":["../../../../../../packages/elements/src/utils.ts","../../../../../../packages/elements/src/extract-projectable-nodes.ts","../../../../../../packages/elements/src/component-factory-strategy.ts","../../../../../../packages/elements/src/create-custom-element.ts","../../../../../../packages/elements/src/version.ts","../../../../../../packages/elements/public_api.ts","../../../../../../packages/elements/index.ts","../../../../../../packages/elements/elements.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nimport {ComponentFactoryResolver, Injector, Type} from '@angular/core';\n\n/**\n * Provide methods for scheduling the execution of a callback.\n */\nexport const scheduler = {\n /**\n * Schedule a callback to be called after some delay.\n *\n * Returns a function that when executed will cancel the scheduled function.\n */\n schedule(taskFn: () => void, delay: number): () => void {\n const id = setTimeout(taskFn, delay);\n return () => clearTimeout(id);\n },\n\n /**\n * Schedule a callback to be called before the next render.\n * (If `window.requestAnimationFrame()` is not available, use `scheduler.schedule()` instead.)\n *\n * Returns a function that when executed will cancel the scheduled function.\n */\n scheduleBeforeRender(taskFn: () => void): () => void {\n // TODO(gkalpak): Implement a better way of accessing `requestAnimationFrame()`\n // (e.g. accounting for vendor prefix, SSR-compatibility, etc).\n if (typeof window === 'undefined') {\n // For SSR just schedule immediately.\n return scheduler.schedule(taskFn, 0);\n }\n\n if (typeof window.requestAnimationFrame === 'undefined') {\n const frameMs = 16;\n return scheduler.schedule(taskFn, frameMs);\n }\n\n const id = window.requestAnimationFrame(taskFn);\n return () => window.cancelAnimationFrame(id);\n },\n};\n\n/**\n * Convert a camelCased string to kebab-cased.\n */\nexport function camelToDashCase(input: string): string {\n return input.replace(/[A-Z]/g, (char) => `-${char.toLowerCase()}`);\n}\n\n/**\n * Check whether the input is an `Element`.\n */\nexport function isElement(node: Node | null): node is Element {\n return !!node && node.nodeType === Node.ELEMENT_NODE;\n}\n\n/**\n * Check whether the input is a function.\n */\nexport function isFunction(value: any): value is Function {\n return typeof value === 'function';\n}\n\n/**\n * Convert a kebab-cased string to camelCased.\n */\nexport function kebabToCamelCase(input: string): string {\n return input.replace(/-([a-z\\d])/g, (_, char) => char.toUpperCase());\n}\n\nlet _matches: (this: any, selector: string) => boolean;\n\n/**\n * Check whether an `Element` matches a CSS selector.\n * NOTE: this is duplicated from @angular/upgrade, and can\n * be consolidated in the future\n */\nexport function matchesSelector(el: any, selector: string): boolean {\n if (!_matches) {\n const elProto = <any>Element.prototype;\n _matches =\n elProto.matches ||\n elProto.matchesSelector ||\n elProto.mozMatchesSelector ||\n elProto.msMatchesSelector ||\n elProto.oMatchesSelector ||\n elProto.webkitMatchesSelector;\n }\n return el.nodeType === Node.ELEMENT_NODE ? _matches.call(el, selector) : false;\n}\n\n/**\n * Test two values for strict equality, accounting for the fact that `NaN !== NaN`.\n */\nexport function strictEquals(value1: any, value2: any): boolean {\n return value1 === value2 || (value1 !== value1 && value2 !== value2);\n}\n\n/** Gets a map of default set of attributes to observe and the properties they affect. */\nexport function getDefaultAttributeToPropertyInputs(\n inputs: {propName: string; templateName: string; transform?: (value: any) => any}[],\n) {\n const attributeToPropertyInputs: {\n [key: string]: [propName: string, transform: ((value: any) => any) | undefined];\n } = {};\n inputs.forEach(({propName, templateName, transform}) => {\n attributeToPropertyInputs[camelToDashCase(templateName)] = [propName, transform];\n });\n\n return attributeToPropertyInputs;\n}\n\n/**\n * Gets a component's set of inputs. Uses the injector to get the component factory where the inputs\n * are defined.\n */\nexport function getComponentInputs(\n component: Type<any>,\n injector: Injector,\n): {\n propName: string;\n templateName: string;\n transform?: (value: any) => any;\n}[] {\n const componentFactoryResolver = injector.get(ComponentFactoryResolver);\n const componentFactory = componentFactoryResolver.resolveComponentFactory(component);\n return componentFactory.inputs;\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n// NOTE: This is a (slightly improved) version of what is used in ngUpgrade's\n// `DowngradeComponentAdapter`.\n// TODO(gkalpak): Investigate if it makes sense to share the code.\n\nimport {isElement, matchesSelector} from './utils';\n\nexport function extractProjectableNodes(host: HTMLElement, ngContentSelectors: string[]): Node[][] {\n const nodes = host.childNodes;\n const projectableNodes: Node[][] = ngContentSelectors.map(() => []);\n let wildcardIndex = -1;\n\n ngContentSelectors.some((selector, i) => {\n if (selector === '*') {\n wildcardIndex = i;\n return true;\n }\n return false;\n });\n\n for (let i = 0, ii = nodes.length; i < ii; ++i) {\n const node = nodes[i];\n const ngContentIndex = findMatchingIndex(node, ngContentSelectors, wildcardIndex);\n\n if (ngContentIndex !== -1) {\n projectableNodes[ngContentIndex].push(node);\n }\n }\n\n return projectableNodes;\n}\n\nfunction findMatchingIndex(node: Node, selectors: string[], defaultIndex: number): number {\n let matchingIndex = defaultIndex;\n\n if (isElement(node)) {\n selectors.some((selector, i) => {\n if (selector !== '*' && matchesSelector(node, selector)) {\n matchingIndex = i;\n return true;\n }\n return false;\n });\n }\n\n return matchingIndex;\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {\n ApplicationRef,\n ChangeDetectorRef,\n ComponentFactory,\n ComponentFactoryResolver,\n ComponentRef,\n EventEmitter,\n Injector,\n NgZone,\n OnChanges,\n SimpleChange,\n SimpleChanges,\n Type,\n} from '@angular/core';\nimport {merge, Observable, ReplaySubject} from 'rxjs';\nimport {map, switchMap} from 'rxjs/operators';\n\nimport {\n NgElementStrategy,\n NgElementStrategyEvent,\n NgElementStrategyFactory,\n} from './element-strategy';\nimport {extractProjectableNodes} from './extract-projectable-nodes';\nimport {isFunction, scheduler, strictEquals} from './utils';\n\n/** Time in milliseconds to wait before destroying the component ref when disconnected. */\nconst DESTROY_DELAY = 10;\n\n/**\n * Factory that creates new ComponentNgElementStrategy instance. Gets the component factory with the\n * constructor's injector's factory resolver and passes that factory to each strategy.\n */\nexport class ComponentNgElementStrategyFactory implements NgElementStrategyFactory {\n componentFactory: ComponentFactory<any>;\n\n constructor(component: Type<any>, injector: Injector) {\n this.componentFactory = injector\n .get(ComponentFactoryResolver)\n .resolveComponentFactory(component);\n }\n\n create(injector: Injector) {\n return new ComponentNgElementStrategy(this.componentFactory, injector);\n }\n}\n\n/**\n * Creates and destroys a component ref using a component factory and handles change detection\n * in response to input changes.\n */\nexport class ComponentNgElementStrategy implements NgElementStrategy {\n // Subject of `NgElementStrategyEvent` observables corresponding to the component's outputs.\n private eventEmitters = new ReplaySubject<Observable<NgElementStrategyEvent>[]>(1);\n\n /** Merged stream of the component's output events. */\n readonly events = this.eventEmitters.pipe(switchMap((emitters) => merge(...emitters)));\n\n /** Reference to the component that was created on connect. */\n private componentRef: ComponentRef<any> | null = null;\n\n /** Reference to the component view's `ChangeDetectorRef`. */\n private viewChangeDetectorRef: ChangeDetectorRef | null = null;\n\n /**\n * Changes that have been made to component inputs since the last change detection run.\n * (NOTE: These are only recorded if the component implements the `OnChanges` interface.)\n */\n private inputChanges: SimpleChanges | null = null;\n\n /** Whether changes have been made to component inputs since the last change detection run. */\n private hasInputChanges = false;\n\n /** Whether the created component implements the `OnChanges` interface. */\n private implementsOnChanges = false;\n\n /** Whether a change detection has been scheduled to run on the component. */\n private scheduledChangeDetectionFn: (() => void) | null = null;\n\n /** Callback function that when called will cancel a scheduled destruction on the component. */\n private scheduledDestroyFn: (() => void) | null = null;\n\n /** Initial input values that were set before the component was created. */\n private readonly initialInputValues = new Map<string, any>();\n\n /**\n * Set of component inputs that have not yet changed, i.e. for which `recordInputChange()` has not\n * fired.\n * (This helps detect the first change of an input, even if it is explicitly set to `undefined`.)\n */\n private readonly unchangedInputs: Set<string>;\n\n /** Service for setting zone context. */\n private readonly ngZone: NgZone;\n\n /** The zone the element was created in or `null` if Zone.js is not loaded. */\n private readonly elementZone: Zone | null;\n\n constructor(\n private componentFactory: ComponentFactory<any>,\n private injector: Injector,\n ) {\n this.unchangedInputs = new Set<string>(\n this.componentFactory.inputs.map(({propName}) => propName),\n );\n this.ngZone = this.injector.get<NgZone>(NgZone);\n this.elementZone = typeof Zone === 'undefined' ? null : this.ngZone.run(() => Zone.current);\n }\n\n /**\n * Initializes a new component if one has not yet been created and cancels any scheduled\n * destruction.\n */\n connect(element: HTMLElement) {\n this.runInZone(() => {\n // If the element is marked to be destroyed, cancel the task since the component was\n // reconnected\n if (this.scheduledDestroyFn !== null) {\n this.scheduledDestroyFn();\n this.scheduledDestroyFn = null;\n return;\n }\n\n if (this.componentRef === null) {\n this.initializeComponent(element);\n }\n });\n }\n\n /**\n * Schedules the component to be destroyed after some small delay in case the element is just\n * being moved across the DOM.\n */\n disconnect() {\n this.runInZone(() => {\n // Return if there is no componentRef or the component is already scheduled for destruction\n if (this.componentRef === null || this.scheduledDestroyFn !== null) {\n return;\n }\n\n // Schedule the component to be destroyed after a small timeout in case it is being\n // moved elsewhere in the DOM\n this.scheduledDestroyFn = scheduler.schedule(() => {\n if (this.componentRef !== null) {\n this.componentRef.destroy();\n this.componentRef = null;\n this.viewChangeDetectorRef = null;\n }\n }, DESTROY_DELAY);\n });\n }\n\n /**\n * Returns the component property value. If the component has not yet been created, the value is\n * retrieved from the cached initialization values.\n */\n getInputValue(property: string): any {\n return this.runInZone(() => {\n if (this.componentRef === null) {\n return this.initialInputValues.get(property);\n }\n\n return this.componentRef.instance[property];\n });\n }\n\n /**\n * Sets the input value for the property. If the component has not yet been created, the value is\n * cached and set when the component is created.\n */\n setInputValue(property: string, value: any, transform?: (value: any) => any): void {\n this.runInZone(() => {\n if (transform) {\n value = transform.call(this.componentRef?.instance, value);\n }\n\n if (this.componentRef === null) {\n this.initialInputValues.set(property, value);\n return;\n }\n\n // Ignore the value if it is strictly equal to the current value, except if it is `undefined`\n // and this is the first change to the value (because an explicit `undefined` _is_ strictly\n // equal to not having a value set at all, but we still need to record this as a change).\n if (\n strictEquals(value, this.getInputValue(property)) &&\n !(value === undefined && this.unchangedInputs.has(property))\n ) {\n return;\n }\n\n // Record the changed value and update internal state to reflect the fact that this input has\n // changed.\n this.recordInputChange(property, value);\n this.unchangedInputs.delete(property);\n this.hasInputChanges = true;\n\n // Update the component instance and schedule change detection.\n this.componentRef.instance[property] = value;\n this.scheduleDetectChanges();\n });\n }\n\n /**\n * Creates a new component through the component factory with the provided element host and\n * sets up its initial inputs, listens for outputs changes, and runs an initial change detection.\n */\n protected initializeComponent(element: HTMLElement) {\n const childInjector = Injector.create({providers: [], parent: this.injector});\n const projectableNodes = extractProjectableNodes(\n element,\n this.componentFactory.ngContentSelectors,\n );\n this.componentRef = this.componentFactory.create(childInjector, projectableNodes, element);\n this.viewChangeDetectorRef = this.componentRef.injector.get(ChangeDetectorRef);\n\n this.implementsOnChanges = isFunction((this.componentRef.instance as OnChanges).ngOnChanges);\n\n this.initializeInputs();\n this.initializeOutputs(this.componentRef);\n\n this.detectChanges();\n\n const applicationRef = this.injector.get<ApplicationRef>(ApplicationRef);\n applicationRef.attachView(this.componentRef.hostView);\n }\n\n /** Set any stored initial inputs on the component's properties. */\n protected initializeInputs(): void {\n this.componentFactory.inputs.forEach(({propName, transform}) => {\n if (this.initialInputValues.has(propName)) {\n // Call `setInputValue()` now that the component has been instantiated to update its\n // properties and fire `ngOnChanges()`.\n this.setInputValue(propName, this.initialInputValues.get(propName), transform);\n }\n });\n\n this.initialInputValues.clear();\n }\n\n /** Sets up listeners for the component's outputs so that the events stream emits the events. */\n protected initializeOutputs(componentRef: ComponentRef<any>): void {\n const eventEmitters: Observable<NgElementStrategyEvent>[] = this.componentFactory.outputs.map(\n ({propName, templateName}) => {\n const emitter: EventEmitter<any> = componentRef.instance[propName];\n return emitter.pipe(map((value) => ({name: templateName, value})));\n },\n );\n\n this.eventEmitters.next(eventEmitters);\n }\n\n /** Calls ngOnChanges with all the inputs that have changed since the last call. */\n protected callNgOnChanges(componentRef: ComponentRef<any>): void {\n if (!this.implementsOnChanges || this.inputChanges === null) {\n return;\n }\n\n // Cache the changes and set inputChanges to null to capture any changes that might occur\n // during ngOnChanges.\n const inputChanges = this.inputChanges;\n this.inputChanges = null;\n (componentRef.instance as OnChanges).ngOnChanges(inputChanges);\n }\n\n /**\n * Marks the component view for check, if necessary.\n * (NOTE: This is required when the `ChangeDetectionStrategy` is set to `OnPush`.)\n */\n protected markViewForCheck(viewChangeDetectorRef: ChangeDetectorRef): void {\n if (this.hasInputChanges) {\n this.hasInputChanges = false;\n viewChangeDetectorRef.markForCheck();\n }\n }\n\n /**\n * Schedules change detection to run on the component.\n * Ignores subsequent calls if already scheduled.\n */\n protected scheduleDetectChanges(): void {\n if (this.scheduledChangeDetectionFn) {\n return;\n }\n\n this.scheduledChangeDetectionFn = scheduler.scheduleBeforeRender(() => {\n this.scheduledChangeDetectionFn = null;\n this.detectChanges();\n });\n }\n\n /**\n * Records input changes so that the component receives SimpleChanges in its onChanges function.\n */\n protected recordInputChange(property: string, currentValue: any): void {\n // Do not record the change if the component does not implement `OnChanges`.\n if (!this.implementsOnChanges) {\n return;\n }\n\n if (this.inputChanges === null) {\n this.inputChanges = {};\n }\n\n // If there already is a change, modify the current value to match but leave the values for\n // `previousValue` and `isFirstChange`.\n const pendingChange = this.inputChanges[property];\n if (pendingChange) {\n pendingChange.currentValue = currentValue;\n return;\n }\n\n const isFirstChange = this.unchangedInputs.has(property);\n const previousValue = isFirstChange ? undefined : this.getInputValue(property);\n this.inputChanges[property] = new SimpleChange(previousValue, currentValue, isFirstChange);\n }\n\n /** Runs change detection on the component. */\n protected detectChanges(): void {\n if (this.componentRef === null) {\n return;\n }\n\n this.callNgOnChanges(this.componentRef);\n this.markViewForCheck(this.viewChangeDetectorRef!);\n this.componentRef.changeDetectorRef.detectChanges();\n }\n\n /** Runs in the angular zone, if present. */\n private runInZone(fn: () => unknown) {\n return this.elementZone && Zone.current !== this.elementZone ? this.ngZone.run(fn) : fn();\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Injector, Type} from '@angular/core';\nimport {Subscription} from 'rxjs';\n\nimport {ComponentNgElementStrategyFactory} from './component-factory-strategy';\nimport {NgElementStrategy, NgElementStrategyFactory} from './element-strategy';\nimport {getComponentInputs, getDefaultAttributeToPropertyInputs} from './utils';\n\n/**\n * Prototype for a class constructor based on an Angular component\n * that can be used for custom element registration. Implemented and returned\n * by the {@link createCustomElement createCustomElement() function}.\n *\n * @see [Angular Elements Overview](guide/elements \"Turning Angular components into custom elements\")\n *\n * @publicApi\n */\nexport interface NgElementConstructor<P> {\n /**\n * An array of observed attribute names for the custom element,\n * derived by transforming input property names from the source component.\n */\n readonly observedAttributes: string[];\n\n /**\n * Initializes a constructor instance.\n * @param injector If provided, overrides the configured injector.\n */\n new (injector?: Injector): NgElement & WithProperties<P>;\n}\n\n/**\n * Implements the functionality needed for a custom element.\n *\n * @publicApi\n */\nexport abstract class NgElement extends HTMLElement {\n /**\n * The strategy that controls how a component is transformed in a custom element.\n */\n protected abstract ngElementStrategy: NgElementStrategy;\n /**\n * A subscription to change, connect, and disconnect events in the custom element.\n */\n protected ngElementEventsSubscription: Subscription | null = null;\n\n /**\n * Prototype for a handler that responds to a change in an observed attribute.\n * @param attrName The name of the attribute that has changed.\n * @param oldValue The previous value of the attribute.\n * @param newValue The new value of the attribute.\n * @param namespace The namespace in which the attribute is defined.\n * @returns Nothing.\n */\n abstract attributeChangedCallback(\n attrName: string,\n oldValue: string | null,\n newValue: string,\n namespace?: string,\n ): void;\n /**\n * Prototype for a handler that responds to the insertion of the custom element in the DOM.\n * @returns Nothing.\n */\n abstract connectedCallback(): void;\n /**\n * Prototype for a handler that responds to the deletion of the custom element from the DOM.\n * @returns Nothing.\n */\n abstract disconnectedCallback(): void;\n}\n\n/**\n * Additional type information that can be added to the NgElement class,\n * for properties that are added based\n * on the inputs and methods of the underlying component.\n *\n * @publicApi\n */\nexport type WithProperties<P> = {\n [property in keyof P]: P[property];\n};\n\n/**\n * A configuration that initializes an NgElementConstructor with the\n * dependencies and strategy it needs to transform a component into\n * a custom element class.\n *\n * @publicApi\n */\nexport interface NgElementConfig {\n /**\n * The injector to use for retrieving the component's factory.\n */\n injector: Injector;\n /**\n * An optional custom strategy factory to use instead of the default.\n * The strategy controls how the transformation is performed.\n */\n strategyFactory?: NgElementStrategyFactory;\n}\n\n/**\n * @description Creates a custom element class based on an Angular component.\n *\n * Builds a class that encapsulates the functionality of the provided component and\n * uses the configuration information to provide more context to the class.\n * Takes the component factory's inputs and outputs to convert them to the proper\n * custom element API and add hooks to input changes.\n *\n * The configuration's injector is the initial injector set on the class,\n * and used by default for each created instance.This behavior can be overridden with the\n * static property to affect all newly created instances, or as a constructor argument for\n * one-off creations.\n *\n * @see [Angular Elements Overview](guide/elements \"Turning Angular components into custom elements\")\n *\n * @param component The component to transform.\n * @param config A configuration that provides initialization information to the created class.\n * @returns The custom-element construction class, which can be registered with\n * a browser's `CustomElementRegistry`.\n *\n * @publicApi\n */\nexport function createCustomElement<P>(\n component: Type<any>,\n config: NgElementConfig,\n): NgElementConstructor<P> {\n const inputs = getComponentInputs(component, config.injector);\n\n const strategyFactory =\n config.strategyFactory || new ComponentNgElementStrategyFactory(component, config.injector);\n\n const attributeToPropertyInputs = getDefaultAttributeToPropertyInputs(inputs);\n\n class NgElementImpl extends NgElement {\n // Work around a bug in closure typed optimizations(b/79557487) where it is not honoring static\n // field externs. So using quoted access to explicitly prevent renaming.\n static readonly ['observedAttributes'] = Object.keys(attributeToPropertyInputs);\n\n protected override get ngElementStrategy(): NgElementStrategy {\n // TODO(andrewseguin): Add e2e tests that cover cases where the constructor isn't called. For\n // now this is tested using a Google internal test suite.\n if (!this._ngElementStrategy) {\n const strategy = (this._ngElementStrategy = strategyFactory.create(\n this.injector || config.injector,\n ));\n\n // Re-apply pre-existing input values (set as properties on the element) through the\n // strategy.\n inputs.forEach(({propName, transform}) => {\n if (!this.hasOwnProperty(propName)) {\n // No pre-existing value for `propName`.\n return;\n }\n\n // Delete the property from the instance and re-apply it through the strategy.\n const value = (this as any)[propName];\n delete (this as any)[propName];\n strategy.setInputValue(propName, value, transform);\n });\n }\n\n return this._ngElementStrategy!;\n }\n\n private _ngElementStrategy?: NgElementStrategy;\n\n constructor(private readonly injector?: Injector) {\n super();\n }\n\n override attributeChangedCallback(\n attrName: string,\n oldValue: string | null,\n newValue: string,\n namespace?: string,\n ): void {\n const [propName, transform] = attributeToPropertyInputs[attrName]!;\n this.ngElementStrategy.setInputValue(propName, newValue, transform);\n }\n\n override connectedCallback(): void {\n // For historical reasons, some strategies may not have initialized the `events` property\n // until after `connect()` is run. Subscribe to `events` if it is available before running\n // `connect()` (in order to capture events emitted during initialization), otherwise subscribe\n // afterwards.\n //\n // TODO: Consider deprecating/removing the post-connect subscription in a future major version\n // (e.g. v11).\n\n let subscribedToEvents = false;\n\n if (this.ngElementStrategy.events) {\n // `events` are already available: Subscribe to it asap.\n this.subscribeToEvents();\n subscribedToEvents = true;\n }\n\n this.ngElementStrategy.connect(this);\n\n if (!subscribedToEvents) {\n // `events` were not initialized before running `connect()`: Subscribe to them now.\n // The events emitted during the component initialization have been missed, but at least\n // future events will be captured.\n this.subscribeToEvents();\n }\n }\n\n override disconnectedCallback(): void {\n // Not using `this.ngElementStrategy` to avoid unnecessarily creating the `NgElementStrategy`.\n if (this._ngElementStrategy) {\n this._ngElementStrategy.disconnect();\n }\n\n if (this.ngElementEventsSubscription) {\n this.ngElementEventsSubscription.unsubscribe();\n this.ngElementEventsSubscription = null;\n }\n }\n\n private subscribeToEvents(): void {\n // Listen for events from the strategy and dispatch them as custom events.\n this.ngElementEventsSubscription = this.ngElementStrategy.events.subscribe((e) => {\n const customEvent = new CustomEvent(e.name, {detail: e.value});\n this.dispatchEvent(customEvent);\n });\n }\n }\n\n // Add getters and setters to the prototype for each property input.\n inputs.forEach(({propName, transform}) => {\n Object.defineProperty(NgElementImpl.prototype, propName, {\n get(): any {\n return this.ngElementStrategy.getInputValue(propName);\n },\n set(newValue: any): void {\n this.ngElementStrategy.setInputValue(propName, newValue, transform);\n },\n configurable: true,\n enumerable: true,\n });\n });\n\n return NgElementImpl as any as NgElementConstructor<P>;\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Version} from '@angular/core';\n\n/**\n * @publicApi\n */\nexport const VERSION = new Version('18.2.0');\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n/**\n * @module\n * @description\n * Entry point for all public APIs of the `elements` package.\n */\nexport {\n createCustomElement,\n NgElement,\n NgElementConfig,\n NgElementConstructor,\n WithProperties,\n} from './src/create-custom-element';\nexport {\n NgElementStrategy,\n NgElementStrategyEvent,\n NgElementStrategyFactory,\n} from './src/element-strategy';\nexport {VERSION} from './src/version';\n\n// This file only reexports content of the `src` folder. Keep it that way.\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n// This file is not used to build this module. It is only used during editing\n// by the TypeScript language service and during build for verification. `ngc`\n// replaces this file with production index.ts when it rewrites private symbol\n// names.\n\nexport * from './public_api';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;AASA;;AAEG;AACI,MAAM,SAAS,GAAG;AACvB;;;;AAIG;IACH,QAAQ,CAAC,MAAkB,EAAE,KAAa,EAAA;QACxC,MAAM,EAAE,GAAG,UAAU,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;AACrC,QAAA,OAAO,MAAM,YAAY,CAAC,EAAE,CAAC,CAAC;KAC/B;AAED;;;;;AAKG;AACH,IAAA,oBAAoB,CAAC,MAAkB,EAAA;;;AAGrC,QAAA,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE;;YAEjC,OAAO,SAAS,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;SACtC;AAED,QAAA,IAAI,OAAO,MAAM,CAAC,qBAAqB,KAAK,WAAW,EAAE;YACvD,MAAM,OAAO,GAAG,EAAE,CAAC;YACnB,OAAO,SAAS,CAAC,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;SAC5C;QAED,MAAM,EAAE,GAAG,MAAM,CAAC,qBAAqB,CAAC,MAAM,CAAC,CAAC;QAChD,OAAO,MAAM,MAAM,CAAC,oBAAoB,CAAC,EAAE,CAAC,CAAC;KAC9C;CACF,CAAC;AAEF;;AAEG;AACG,SAAU,eAAe,CAAC,KAAa,EAAA;AAC3C,IAAA,OAAO,KAAK,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC,IAAI,KAAK,IAAI,IAAI,CAAC,WAAW,EAAE,CAAA,CAAE,CAAC,CAAC;AACrE,CAAC;AAED;;AAEG;AACG,SAAU,S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AiB,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC;aACvD;AACD,YAAA,GAAG,CAAC,QAAa,EAAA;gBACf,IAAI,CAAC,iBAAiB,CAAC,aAAa,CAAC,QAAQ,EAAE,QAAQ,EAAE,SAAS,CAAC,CAAC;aACrE;AACD,YAAA,YAAY,EAAE,IAAI;AAClB,YAAA,UAAU,EAAE,IAAI;AACjB,SAAA,CAAC,CAAC;AACL,KAAC,CAAC,CAAC;AAEH,IAAA,OAAO,aAA+C,CAAC;AACzD;;AClPA;;AAEG;MACU,OAAO,GAAG,IAAI,OAAO,CAAC,mBAAmB;;ACLtD;;;;AAIG;AAeH;;ACnBA;;ACRA;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"elements.mjs","sources":["../../../../../../packages/elements/src/utils.ts","../../../../../../packages/elements/src/extract-projectable-nodes.ts","../../../../../../packages/elements/src/component-factory-strategy.ts","../../../../../../packages/elements/src/create-custom-element.ts","../../../../../../packages/elements/src/version.ts","../../../../../../packages/elements/public_api.ts","../../../../../../packages/elements/index.ts","../../../../../../packages/elements/elements.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nimport {ComponentFactoryResolver, Injector, Type} from '@angular/core';\n\n/**\n * Provide methods for scheduling the execution of a callback.\n */\nexport const scheduler = {\n /**\n * Schedule a callback to be called after some delay.\n *\n * Returns a function that when executed will cancel the scheduled function.\n */\n schedule(taskFn: () => void, delay: number): () => void {\n const id = setTimeout(taskFn, delay);\n return () => clearTimeout(id);\n },\n\n /**\n * Schedule a callback to be called before the next render.\n * (If `window.requestAnimationFrame()` is not available, use `scheduler.schedule()` instead.)\n *\n * Returns a function that when executed will cancel the scheduled function.\n */\n scheduleBeforeRender(taskFn: () => void): () => void {\n // TODO(gkalpak): Implement a better way of accessing `requestAnimationFrame()`\n // (e.g. accounting for vendor prefix, SSR-compatibility, etc).\n if (typeof window === 'undefined') {\n // For SSR just schedule immediately.\n return scheduler.schedule(taskFn, 0);\n }\n\n if (typeof window.requestAnimationFrame === 'undefined') {\n const frameMs = 16;\n return scheduler.schedule(taskFn, frameMs);\n }\n\n const id = window.requestAnimationFrame(taskFn);\n return () => window.cancelAnimationFrame(id);\n },\n};\n\n/**\n * Convert a camelCased string to kebab-cased.\n */\nexport function camelToDashCase(input: string): string {\n return input.replace(/[A-Z]/g, (char) => `-${char.toLowerCase()}`);\n}\n\n/**\n * Check whether the input is an `Element`.\n */\nexport function isElement(node: Node | null): node is Element {\n return !!node && node.nodeType === Node.ELEMENT_NODE;\n}\n\n/**\n * Check whether the input is a function.\n */\nexport function isFunction(value: any): value is Function {\n return typeof value === 'function';\n}\n\n/**\n * Convert a kebab-cased string to camelCased.\n */\nexport function kebabToCamelCase(input: string): string {\n return input.replace(/-([a-z\\d])/g, (_, char) => char.toUpperCase());\n}\n\nlet _matches: (this: any, selector: string) => boolean;\n\n/**\n * Check whether an `Element` matches a CSS selector.\n * NOTE: this is duplicated from @angular/upgrade, and can\n * be consolidated in the future\n */\nexport function matchesSelector(el: any, selector: string): boolean {\n if (!_matches) {\n const elProto = <any>Element.prototype;\n _matches =\n elProto.matches ||\n elProto.matchesSelector ||\n elProto.mozMatchesSelector ||\n elProto.msMatchesSelector ||\n elProto.oMatchesSelector ||\n elProto.webkitMatchesSelector;\n }\n return el.nodeType === Node.ELEMENT_NODE ? _matches.call(el, selector) : false;\n}\n\n/**\n * Test two values for strict equality, accounting for the fact that `NaN !== NaN`.\n */\nexport function strictEquals(value1: any, value2: any): boolean {\n return value1 === value2 || (value1 !== value1 && value2 !== value2);\n}\n\n/** Gets a map of default set of attributes to observe and the properties they affect. */\nexport function getDefaultAttributeToPropertyInputs(\n inputs: {propName: string; templateName: string; transform?: (value: any) => any}[],\n) {\n const attributeToPropertyInputs: {\n [key: string]: [propName: string, transform: ((value: any) => any) | undefined];\n } = {};\n inputs.forEach(({propName, templateName, transform}) => {\n attributeToPropertyInputs[camelToDashCase(templateName)] = [propName, transform];\n });\n\n return attributeToPropertyInputs;\n}\n\n/**\n * Gets a component's set of inputs. Uses the injector to get the component factory where the inputs\n * are defined.\n */\nexport function getComponentInputs(\n component: Type<any>,\n injector: Injector,\n): {\n propName: string;\n templateName: string;\n transform?: (value: any) => any;\n}[] {\n const componentFactoryResolver = injector.get(ComponentFactoryResolver);\n const componentFactory = componentFactoryResolver.resolveComponentFactory(component);\n return componentFactory.inputs;\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n// NOTE: This is a (slightly improved) version of what is used in ngUpgrade's\n// `DowngradeComponentAdapter`.\n// TODO(gkalpak): Investigate if it makes sense to share the code.\n\nimport {isElement, matchesSelector} from './utils';\n\nexport function extractProjectableNodes(host: HTMLElement, ngContentSelectors: string[]): Node[][] {\n const nodes = host.childNodes;\n const projectableNodes: Node[][] = ngContentSelectors.map(() => []);\n let wildcardIndex = -1;\n\n ngContentSelectors.some((selector, i) => {\n if (selector === '*') {\n wildcardIndex = i;\n return true;\n }\n return false;\n });\n\n for (let i = 0, ii = nodes.length; i < ii; ++i) {\n const node = nodes[i];\n const ngContentIndex = findMatchingIndex(node, ngContentSelectors, wildcardIndex);\n\n if (ngContentIndex !== -1) {\n projectableNodes[ngContentIndex].push(node);\n }\n }\n\n return projectableNodes;\n}\n\nfunction findMatchingIndex(node: Node, selectors: string[], defaultIndex: number): number {\n let matchingIndex = defaultIndex;\n\n if (isElement(node)) {\n selectors.some((selector, i) => {\n if (selector !== '*' && matchesSelector(node, selector)) {\n matchingIndex = i;\n return true;\n }\n return false;\n });\n }\n\n return matchingIndex;\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {\n ApplicationRef,\n ChangeDetectorRef,\n ComponentFactory,\n ComponentFactoryResolver,\n ComponentRef,\n EventEmitter,\n Injector,\n NgZone,\n OnChanges,\n SimpleChange,\n SimpleChanges,\n Type,\n} from '@angular/core';\nimport {merge, Observable, ReplaySubject} from 'rxjs';\nimport {map, switchMap} from 'rxjs/operators';\n\nimport {\n NgElementStrategy,\n NgElementStrategyEvent,\n NgElementStrategyFactory,\n} from './element-strategy';\nimport {extractProjectableNodes} from './extract-projectable-nodes';\nimport {isFunction, scheduler, strictEquals} from './utils';\n\n/** Time in milliseconds to wait before destroying the component ref when disconnected. */\nconst DESTROY_DELAY = 10;\n\n/**\n * Factory that creates new ComponentNgElementStrategy instance. Gets the component factory with the\n * constructor's injector's factory resolver and passes that factory to each strategy.\n */\nexport class ComponentNgElementStrategyFactory implements NgElementStrategyFactory {\n componentFactory: ComponentFactory<any>;\n\n constructor(component: Type<any>, injector: Injector) {\n this.componentFactory = injector\n .get(ComponentFactoryResolver)\n .resolveComponentFactory(component);\n }\n\n create(injector: Injector) {\n return new ComponentNgElementStrategy(this.componentFactory, injector);\n }\n}\n\n/**\n * Creates and destroys a component ref using a component factory and handles change detection\n * in response to input changes.\n */\nexport class ComponentNgElementStrategy implements NgElementStrategy {\n // Subject of `NgElementStrategyEvent` observables corresponding to the component's outputs.\n private eventEmitters = new ReplaySubject<Observable<NgElementStrategyEvent>[]>(1);\n\n /** Merged stream of the component's output events. */\n readonly events = this.eventEmitters.pipe(switchMap((emitters) => merge(...emitters)));\n\n /** Reference to the component that was created on connect. */\n private componentRef: ComponentRef<any> | null = null;\n\n /** Reference to the component view's `ChangeDetectorRef`. */\n private viewChangeDetectorRef: ChangeDetectorRef | null = null;\n\n /**\n * Changes that have been made to component inputs since the last change detection run.\n * (NOTE: These are only recorded if the component implements the `OnChanges` interface.)\n */\n private inputChanges: SimpleChanges | null = null;\n\n /** Whether changes have been made to component inputs since the last change detection run. */\n private hasInputChanges = false;\n\n /** Whether the created component implements the `OnChanges` interface. */\n private implementsOnChanges = false;\n\n /** Whether a change detection has been scheduled to run on the component. */\n private scheduledChangeDetectionFn: (() => void) | null = null;\n\n /** Callback function that when called will cancel a scheduled destruction on the component. */\n private scheduledDestroyFn: (() => void) | null = null;\n\n /** Initial input values that were set before the component was created. */\n private readonly initialInputValues = new Map<string, any>();\n\n /**\n * Set of component inputs that have not yet changed, i.e. for which `recordInputChange()` has not\n * fired.\n * (This helps detect the first change of an input, even if it is explicitly set to `undefined`.)\n */\n private readonly unchangedInputs: Set<string>;\n\n /** Service for setting zone context. */\n private readonly ngZone: NgZone;\n\n /** The zone the element was created in or `null` if Zone.js is not loaded. */\n private readonly elementZone: Zone | null;\n\n constructor(\n private componentFactory: ComponentFactory<any>,\n private injector: Injector,\n ) {\n this.unchangedInputs = new Set<string>(\n this.componentFactory.inputs.map(({propName}) => propName),\n );\n this.ngZone = this.injector.get<NgZone>(NgZone);\n this.elementZone = typeof Zone === 'undefined' ? null : this.ngZone.run(() => Zone.current);\n }\n\n /**\n * Initializes a new component if one has not yet been created and cancels any scheduled\n * destruction.\n */\n connect(element: HTMLElement) {\n this.runInZone(() => {\n // If the element is marked to be destroyed, cancel the task since the component was\n // reconnected\n if (this.scheduledDestroyFn !== null) {\n this.scheduledDestroyFn();\n this.scheduledDestroyFn = null;\n return;\n }\n\n if (this.componentRef === null) {\n this.initializeComponent(element);\n }\n });\n }\n\n /**\n * Schedules the component to be destroyed after some small delay in case the element is just\n * being moved across the DOM.\n */\n disconnect() {\n this.runInZone(() => {\n // Return if there is no componentRef or the component is already scheduled for destruction\n if (this.componentRef === null || this.scheduledDestroyFn !== null) {\n return;\n }\n\n // Schedule the component to be destroyed after a small timeout in case it is being\n // moved elsewhere in the DOM\n this.scheduledDestroyFn = scheduler.schedule(() => {\n if (this.componentRef !== null) {\n this.componentRef.destroy();\n this.componentRef = null;\n this.viewChangeDetectorRef = null;\n }\n }, DESTROY_DELAY);\n });\n }\n\n /**\n * Returns the component property value. If the component has not yet been created, the value is\n * retrieved from the cached initialization values.\n */\n getInputValue(property: string): any {\n return this.runInZone(() => {\n if (this.componentRef === null) {\n return this.initialInputValues.get(property);\n }\n\n return this.componentRef.instance[property];\n });\n }\n\n /**\n * Sets the input value for the property. If the component has not yet been created, the value is\n * cached and set when the component is created.\n */\n setInputValue(property: string, value: any, transform?: (value: any) => any): void {\n this.runInZone(() => {\n if (transform) {\n value = transform.call(this.componentRef?.instance, value);\n }\n\n if (this.componentRef === null) {\n this.initialInputValues.set(property, value);\n return;\n }\n\n // Ignore the value if it is strictly equal to the current value, except if it is `undefined`\n // and this is the first change to the value (because an explicit `undefined` _is_ strictly\n // equal to not having a value set at all, but we still need to record this as a change).\n if (\n strictEquals(value, this.getInputValue(property)) &&\n !(value === undefined && this.unchangedInputs.has(property))\n ) {\n return;\n }\n\n // Record the changed value and update internal state to reflect the fact that this input has\n // changed.\n this.recordInputChange(property, value);\n this.unchangedInputs.delete(property);\n this.hasInputChanges = true;\n\n // Update the component instance and schedule change detection.\n this.componentRef.instance[property] = value;\n this.scheduleDetectChanges();\n });\n }\n\n /**\n * Creates a new component through the component factory with the provided element host and\n * sets up its initial inputs, listens for outputs changes, and runs an initial change detection.\n */\n protected initializeComponent(element: HTMLElement) {\n const childInjector = Injector.create({providers: [], parent: this.injector});\n const projectableNodes = extractProjectableNodes(\n element,\n this.componentFactory.ngContentSelectors,\n );\n this.componentRef = this.componentFactory.create(childInjector, projectableNodes, element);\n this.viewChangeDetectorRef = this.componentRef.injector.get(ChangeDetectorRef);\n\n this.implementsOnChanges = isFunction((this.componentRef.instance as OnChanges).ngOnChanges);\n\n this.initializeInputs();\n this.initializeOutputs(this.componentRef);\n\n this.detectChanges();\n\n const applicationRef = this.injector.get<ApplicationRef>(ApplicationRef);\n applicationRef.attachView(this.componentRef.hostView);\n }\n\n /** Set any stored initial inputs on the component's properties. */\n protected initializeInputs(): void {\n this.componentFactory.inputs.forEach(({propName, transform}) => {\n if (this.initialInputValues.has(propName)) {\n // Call `setInputValue()` now that the component has been instantiated to update its\n // properties and fire `ngOnChanges()`.\n this.setInputValue(propName, this.initialInputValues.get(propName), transform);\n }\n });\n\n this.initialInputValues.clear();\n }\n\n /** Sets up listeners for the component's outputs so that the events stream emits the events. */\n protected initializeOutputs(componentRef: ComponentRef<any>): void {\n const eventEmitters: Observable<NgElementStrategyEvent>[] = this.componentFactory.outputs.map(\n ({propName, templateName}) => {\n const emitter: EventEmitter<any> = componentRef.instance[propName];\n return emitter.pipe(map((value) => ({name: templateName, value})));\n },\n );\n\n this.eventEmitters.next(eventEmitters);\n }\n\n /** Calls ngOnChanges with all the inputs that have changed since the last call. */\n protected callNgOnChanges(componentRef: ComponentRef<any>): void {\n if (!this.implementsOnChanges || this.inputChanges === null) {\n return;\n }\n\n // Cache the changes and set inputChanges to null to capture any changes that might occur\n // during ngOnChanges.\n const inputChanges = this.inputChanges;\n this.inputChanges = null;\n (componentRef.instance as OnChanges).ngOnChanges(inputChanges);\n }\n\n /**\n * Marks the component view for check, if necessary.\n * (NOTE: This is required when the `ChangeDetectionStrategy` is set to `OnPush`.)\n */\n protected markViewForCheck(viewChangeDetectorRef: ChangeDetectorRef): void {\n if (this.hasInputChanges) {\n this.hasInputChanges = false;\n viewChangeDetectorRef.markForCheck();\n }\n }\n\n /**\n * Schedules change detection to run on the component.\n * Ignores subsequent calls if already scheduled.\n */\n protected scheduleDetectChanges(): void {\n if (this.scheduledChangeDetectionFn) {\n return;\n }\n\n this.scheduledChangeDetectionFn = scheduler.scheduleBeforeRender(() => {\n this.scheduledChangeDetectionFn = null;\n this.detectChanges();\n });\n }\n\n /**\n * Records input changes so that the component receives SimpleChanges in its onChanges function.\n */\n protected recordInputChange(property: string, currentValue: any): void {\n // Do not record the change if the component does not implement `OnChanges`.\n if (!this.implementsOnChanges) {\n return;\n }\n\n if (this.inputChanges === null) {\n this.inputChanges = {};\n }\n\n // If there already is a change, modify the current value to match but leave the values for\n // `previousValue` and `isFirstChange`.\n const pendingChange = this.inputChanges[property];\n if (pendingChange) {\n pendingChange.currentValue = currentValue;\n return;\n }\n\n const isFirstChange = this.unchangedInputs.has(property);\n const previousValue = isFirstChange ? undefined : this.getInputValue(property);\n this.inputChanges[property] = new SimpleChange(previousValue, currentValue, isFirstChange);\n }\n\n /** Runs change detection on the component. */\n protected detectChanges(): void {\n if (this.componentRef === null) {\n return;\n }\n\n this.callNgOnChanges(this.componentRef);\n this.markViewForCheck(this.viewChangeDetectorRef!);\n this.componentRef.changeDetectorRef.detectChanges();\n }\n\n /** Runs in the angular zone, if present. */\n private runInZone(fn: () => unknown) {\n return this.elementZone && Zone.current !== this.elementZone ? this.ngZone.run(fn) : fn();\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Injector, Type} from '@angular/core';\nimport {Subscription} from 'rxjs';\n\nimport {ComponentNgElementStrategyFactory} from './component-factory-strategy';\nimport {NgElementStrategy, NgElementStrategyFactory} from './element-strategy';\nimport {getComponentInputs, getDefaultAttributeToPropertyInputs} from './utils';\n\n/**\n * Prototype for a class constructor based on an Angular component\n * that can be used for custom element registration. Implemented and returned\n * by the {@link createCustomElement createCustomElement() function}.\n *\n * @see [Angular Elements Overview](guide/elements \"Turning Angular components into custom elements\")\n *\n * @publicApi\n */\nexport interface NgElementConstructor<P> {\n /**\n * An array of observed attribute names for the custom element,\n * derived by transforming input property names from the source component.\n */\n readonly observedAttributes: string[];\n\n /**\n * Initializes a constructor instance.\n * @param injector If provided, overrides the configured injector.\n */\n new (injector?: Injector): NgElement & WithProperties<P>;\n}\n\n/**\n * Implements the functionality needed for a custom element.\n *\n * @publicApi\n */\nexport abstract class NgElement extends HTMLElement {\n /**\n * The strategy that controls how a component is transformed in a custom element.\n */\n protected abstract ngElementStrategy: NgElementStrategy;\n /**\n * A subscription to change, connect, and disconnect events in the custom element.\n */\n protected ngElementEventsSubscription: Subscription | null = null;\n\n /**\n * Prototype for a handler that responds to a change in an observed attribute.\n * @param attrName The name of the attribute that has changed.\n * @param oldValue The previous value of the attribute.\n * @param newValue The new value of the attribute.\n * @param namespace The namespace in which the attribute is defined.\n * @returns Nothing.\n */\n abstract attributeChangedCallback(\n attrName: string,\n oldValue: string | null,\n newValue: string,\n namespace?: string,\n ): void;\n /**\n * Prototype for a handler that responds to the insertion of the custom element in the DOM.\n * @returns Nothing.\n */\n abstract connectedCallback(): void;\n /**\n * Prototype for a handler that responds to the deletion of the custom element from the DOM.\n * @returns Nothing.\n */\n abstract disconnectedCallback(): void;\n}\n\n/**\n * Additional type information that can be added to the NgElement class,\n * for properties that are added based\n * on the inputs and methods of the underlying component.\n *\n * @publicApi\n */\nexport type WithProperties<P> = {\n [property in keyof P]: P[property];\n};\n\n/**\n * A configuration that initializes an NgElementConstructor with the\n * dependencies and strategy it needs to transform a component into\n * a custom element class.\n *\n * @publicApi\n */\nexport interface NgElementConfig {\n /**\n * The injector to use for retrieving the component's factory.\n */\n injector: Injector;\n /**\n * An optional custom strategy factory to use instead of the default.\n * The strategy controls how the transformation is performed.\n */\n strategyFactory?: NgElementStrategyFactory;\n}\n\n/**\n * @description Creates a custom element class based on an Angular component.\n *\n * Builds a class that encapsulates the functionality of the provided component and\n * uses the configuration information to provide more context to the class.\n * Takes the component factory's inputs and outputs to convert them to the proper\n * custom element API and add hooks to input changes.\n *\n * The configuration's injector is the initial injector set on the class,\n * and used by default for each created instance.This behavior can be overridden with the\n * static property to affect all newly created instances, or as a constructor argument for\n * one-off creations.\n *\n * @see [Angular Elements Overview](guide/elements \"Turning Angular components into custom elements\")\n *\n * @param component The component to transform.\n * @param config A configuration that provides initialization information to the created class.\n * @returns The custom-element construction class, which can be registered with\n * a browser's `CustomElementRegistry`.\n *\n * @publicApi\n */\nexport function createCustomElement<P>(\n component: Type<any>,\n config: NgElementConfig,\n): NgElementConstructor<P> {\n const inputs = getComponentInputs(component, config.injector);\n\n const strategyFactory =\n config.strategyFactory || new ComponentNgElementStrategyFactory(component, config.injector);\n\n const attributeToPropertyInputs = getDefaultAttributeToPropertyInputs(inputs);\n\n class NgElementImpl extends NgElement {\n // Work around a bug in closure typed optimizations(b/79557487) where it is not honoring static\n // field externs. So using quoted access to explicitly prevent renaming.\n static readonly ['observedAttributes'] = Object.keys(attributeToPropertyInputs);\n\n protected override get ngElementStrategy(): NgElementStrategy {\n // TODO(andrewseguin): Add e2e tests that cover cases where the constructor isn't called. For\n // now this is tested using a Google internal test suite.\n if (!this._ngElementStrategy) {\n const strategy = (this._ngElementStrategy = strategyFactory.create(\n this.injector || config.injector,\n ));\n\n // Re-apply pre-existing input values (set as properties on the element) through the\n // strategy.\n inputs.forEach(({propName, transform}) => {\n if (!this.hasOwnProperty(propName)) {\n // No pre-existing value for `propName`.\n return;\n }\n\n // Delete the property from the instance and re-apply it through the strategy.\n const value = (this as any)[propName];\n delete (this as any)[propName];\n strategy.setInputValue(propName, value, transform);\n });\n }\n\n return this._ngElementStrategy!;\n }\n\n private _ngElementStrategy?: NgElementStrategy;\n\n constructor(private readonly injector?: Injector) {\n super();\n }\n\n override attributeChangedCallback(\n attrName: string,\n oldValue: string | null,\n newValue: string,\n namespace?: string,\n ): void {\n const [propName, transform] = attributeToPropertyInputs[attrName]!;\n this.ngElementStrategy.setInputValue(propName, newValue, transform);\n }\n\n override connectedCallback(): void {\n // For historical reasons, some strategies may not have initialized the `events` property\n // until after `connect()` is run. Subscribe to `events` if it is available before running\n // `connect()` (in order to capture events emitted during initialization), otherwise subscribe\n // afterwards.\n //\n // TODO: Consider deprecating/removing the post-connect subscription in a future major version\n // (e.g. v11).\n\n let subscribedToEvents = false;\n\n if (this.ngElementStrategy.events) {\n // `events` are already available: Subscribe to it asap.\n this.subscribeToEvents();\n subscribedToEvents = true;\n }\n\n this.ngElementStrategy.connect(this);\n\n if (!subscribedToEvents) {\n // `events` were not initialized before running `connect()`: Subscribe to them now.\n // The events emitted during the component initialization have been missed, but at least\n // future events will be captured.\n this.subscribeToEvents();\n }\n }\n\n override disconnectedCallback(): void {\n // Not using `this.ngElementStrategy` to avoid unnecessarily creating the `NgElementStrategy`.\n if (this._ngElementStrategy) {\n this._ngElementStrategy.disconnect();\n }\n\n if (this.ngElementEventsSubscription) {\n this.ngElementEventsSubscription.unsubscribe();\n this.ngElementEventsSubscription = null;\n }\n }\n\n private subscribeToEvents(): void {\n // Listen for events from the strategy and dispatch them as custom events.\n this.ngElementEventsSubscription = this.ngElementStrategy.events.subscribe((e) => {\n const customEvent = new CustomEvent(e.name, {detail: e.value});\n this.dispatchEvent(customEvent);\n });\n }\n }\n\n // Add getters and setters to the prototype for each property input.\n inputs.forEach(({propName, transform}) => {\n Object.defineProperty(NgElementImpl.prototype, propName, {\n get(): any {\n return this.ngElementStrategy.getInputValue(propName);\n },\n set(newValue: any): void {\n this.ngElementStrategy.setInputValue(propName, newValue, transform);\n },\n configurable: true,\n enumerable: true,\n });\n });\n\n return NgElementImpl as any as NgElementConstructor<P>;\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Version} from '@angular/core';\n\n/**\n * @publicApi\n */\nexport const VERSION = new Version('19.0.0-next.0');\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n/**\n * @module\n * @description\n * Entry point for all public APIs of the `elements` package.\n */\nexport {\n createCustomElement,\n NgElement,\n NgElementConfig,\n NgElementConstructor,\n WithProperties,\n} from './src/create-custom-element';\nexport {\n NgElementStrategy,\n NgElementStrategyEvent,\n NgElementStrategyFactory,\n} from './src/element-strategy';\nexport {VERSION} from './src/version';\n\n// This file only reexports content of the `src` folder. Keep it that way.\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n// This file is not used to build this module. It is only used during editing\n// by the TypeScript language service and during build for verification. `ngc`\n// replaces this file with production index.ts when it rewrites private symbol\n// names.\n\nexport * from './public_api';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;AASA;;AAEG;AACI,MAAM,SAAS,GAAG;AACvB;;;;AAIG;IACH,QAAQ,CAAC,MAAkB,EAAE,KAAa,EAAA;QACxC,MAAM,EAAE,GAAG,UAAU,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;AACrC,QAAA,OAAO,MAAM,YAAY,CAAC,EAAE,CAAC,CAAC;KAC/B;AAED;;;;;AAKG;AACH,IAAA,oBAAoB,CAAC,MAAkB,EAAA;;;AAGrC,QAAA,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE;;YAEjC,OAAO,SAAS,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;SACtC;AAED,QAAA,IAAI,OAAO,MAAM,CAAC,qBAAqB,KAAK,WAAW,EAAE;YACvD,MAAM,OAAO,GAAG,EAAE,CAAC;YACnB,OAAO,SAAS,CAAC,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;SAC5C;QAED,MAAM,EAAE,GAAG,MAAM,CAAC,qBAAqB,CAAC,MAAM,CAAC,CAAC;QAChD,OAAO,MAAM,MAAM,CAAC,oBAAoB,CAAC,EAAE,CAAC,CAAC;KAC9C;CACF,CAAC;AAEF;;AAEG;AACG,SAAU,eAAe,CAAC,KAAa,EAAA;AAC3C,IAAA,OAAO,KAAK,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC,IAAI,KAAK,IAAI,IAAI,CAAC,WAAW,EAAE,CAAA,CAAE,CAAC,CAAC;AACrE,CAAC;AAED;;AAEG;AACG,SAAU,SAAS,CAAC,IAAiB,EAAA;IACzC,OAAO,CAAC,CAAC,IAAI,IAAI,IAAI,CAAC,QAAQ,KAAK,IAAI,CAAC,YAAY,CAAC;AACvD,CAAC;AAED;;AAEG;AACG,SAAU,UAAU,CAAC,KAAU,EAAA;AACnC,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rE;AACD,YAAA,YAAY,EAAE,IAAI;AAClB,YAAA,UAAU,EAAE,IAAI;AACjB,SAAA,CAAC,CAAC;AACL,KAAC,CAAC,CAAC;AAEH,IAAA,OAAO,aAA+C,CAAC;AACzD;;AClPA;;AAEG;MACU,OAAO,GAAG,IAAI,OAAO,CAAC,mBAAmB;;ACLtD;;;;AAIG;AAeH;;ACnBA;;ACRA;;AAEG;;;;"}
|
package/index.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@angular/elements",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "19.0.0-next.0",
|
|
4
4
|
"description": "Angular - library for using Angular Components as Custom Elements",
|
|
5
5
|
"author": "angular",
|
|
6
6
|
"license": "MIT",
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"tslib": "^2.3.0"
|
|
12
12
|
},
|
|
13
13
|
"peerDependencies": {
|
|
14
|
-
"@angular/core": "
|
|
14
|
+
"@angular/core": "19.0.0-next.0",
|
|
15
15
|
"rxjs": "^6.5.3 || ^7.4.0"
|
|
16
16
|
},
|
|
17
17
|
"repository": {
|