diff --git a/src/app/compiler/angular-dependencies.ts b/src/app/compiler/angular-dependencies.ts index 737e9c8c3..5002bfd18 100644 --- a/src/app/compiler/angular-dependencies.ts +++ b/src/app/compiler/angular-dependencies.ts @@ -248,8 +248,12 @@ export class AngularDependencies extends FrameworkDependencies { if (IO.constructor && !Configuration.mainData.disableConstructors) { deps.constructorObj = IO.constructor; } + if (IO.inputs) { + deps.inputsClass = IO.inputs; + } if (IO.properties) { deps.properties = IO.properties; + deps.inputsClass = deps.inputsClass ? deps.inputsClass.concat(this.componentHelper.getInputSignals(IO.properties)) : this.componentHelper.getInputSignals(IO.properties); } if (IO.description) { deps.description = IO.description; @@ -272,9 +276,6 @@ export class AngularDependencies extends FrameworkDependencies { if (IO.accessors) { deps.accessors = IO.accessors; } - if (IO.inputs) { - deps.inputsClass = IO.inputs; - } if (IO.outputs) { deps.outputsClass = IO.outputs; } diff --git a/src/app/compiler/angular/deps/component-dep.factory.ts b/src/app/compiler/angular/deps/component-dep.factory.ts index 2d6b59df1..6c4cc213e 100644 --- a/src/app/compiler/angular/deps/component-dep.factory.ts +++ b/src/app/compiler/angular/deps/component-dep.factory.ts @@ -88,6 +88,9 @@ export class ComponentDepFactory { if (IO.accessors) { componentDep.accessors = IO.accessors; } + if (IO.properties) { + componentDep.inputsClass = componentDep.inputsClass.concat(this.helper.getInputSignals(IO.properties)); + } return componentDep; } diff --git a/src/app/compiler/angular/deps/directive-dep.factory.ts b/src/app/compiler/angular/deps/directive-dep.factory.ts index 5846599bb..e0ccfb189 100644 --- a/src/app/compiler/angular/deps/directive-dep.factory.ts +++ b/src/app/compiler/angular/deps/directive-dep.factory.ts @@ -26,7 +26,7 @@ export class DirectiveDepFactory { standalone: this.helper.getComponentStandalone(props, srcFile) ? true : false, - inputsClass: IO.inputs, + inputsClass: this.helper.getInputSignals(IO.properties).concat(IO.inputs), outputsClass: IO.outputs, deprecated: IO.deprecated, diff --git a/src/app/compiler/angular/deps/helpers/component-helper.ts b/src/app/compiler/angular/deps/helpers/component-helper.ts index 7dc259c6d..46e804046 100644 --- a/src/app/compiler/angular/deps/helpers/component-helper.ts +++ b/src/app/compiler/angular/deps/helpers/component-helper.ts @@ -135,6 +135,21 @@ export class ComponentHelper { return this.symbolHelper.getSymbolDeps(props, 'inputs', srcFile); } + public getInputSignals(props) { + let inputSignals = []; + props?.forEach((prop, i) => { + const regexp = /input(?:\.(required))?(?:<([\w-]+)>)?\(([\w-]+)?\)/; + const res = regexp.exec(prop.defaultValue); + if (res) { + const newInput = prop; + newInput.defaultValue = res[res.length - 1]; + newInput.required = res[0]?.includes('.required') ?? false; + inputSignals.push(newInput); + } + }); + return inputSignals; + } + public getComponentStandalone( props: ReadonlyArray, srcFile: ts.SourceFile pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy