fix(ivy): ensure @animation host bindings/listeners work properly (#27896)
PR Close #27896
This commit is contained in:

committed by
Kara Erickson

parent
0bd9deb9f5
commit
5d3dcfc6ad
@ -52,3 +52,31 @@ export interface R3Reference {
|
||||
value: o.Expression;
|
||||
type: o.Expression;
|
||||
}
|
||||
|
||||
const ANIMATE_SYMBOL_PREFIX = '@';
|
||||
export function prepareSyntheticPropertyName(name: string) {
|
||||
return `${ANIMATE_SYMBOL_PREFIX}${name}`;
|
||||
}
|
||||
|
||||
export function prepareSyntheticListenerName(name: string, phase: string) {
|
||||
return `${ANIMATE_SYMBOL_PREFIX}${name}.${phase}`;
|
||||
}
|
||||
|
||||
export function isSyntheticPropertyOrListener(name: string) {
|
||||
return name.charAt(0) == ANIMATE_SYMBOL_PREFIX;
|
||||
}
|
||||
|
||||
export function getSyntheticPropertyName(name: string) {
|
||||
// this will strip out listener phase values...
|
||||
// @foo.start => @foo
|
||||
const i = name.indexOf('.');
|
||||
name = i > 0 ? name.substring(0, i) : name;
|
||||
if (name.charAt(0) !== ANIMATE_SYMBOL_PREFIX) {
|
||||
name = ANIMATE_SYMBOL_PREFIX + name;
|
||||
}
|
||||
return name;
|
||||
}
|
||||
|
||||
export function prepareSyntheticListenerFunctionName(name: string, phase: string) {
|
||||
return `animation_${name}_${phase}`;
|
||||
}
|
Reference in New Issue
Block a user