Skip to content

Commit 0737453

Browse files
author
gianluca.cagnin
committed
ng-enter e aggiornamenti
1 parent c031446 commit 0737453

19 files changed

+458
-247
lines changed

AngularUtils.csproj

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -74,18 +74,28 @@
7474
<Content Include="bower_components\bootstrap\dist\fonts\glyphicons-halflings-regular.ttf" />
7575
<Content Include="bower_components\bootstrap\dist\fonts\glyphicons-halflings-regular.woff" />
7676
<Content Include="bower_components\bootstrap\dist\fonts\glyphicons-halflings-regular.woff2" />
77-
<Content Include="packages.config" />
7877
<Content Include="bower.json" />
79-
<Content Include="dist\AngularUtils.js.map" />
80-
<Content Include="dist\demo.js.map" />
78+
<Content Include="dist\AngularUtils.js.map">
79+
<DependentUpon>AngularUtils.js</DependentUpon>
80+
</Content>
81+
<Content Include="dist\demo.js.map">
82+
<DependentUpon>demo.js</DependentUpon>
83+
</Content>
8184
<Content Include="bower_components\components-font-awesome\fonts\fontawesome-webfont.eot" />
8285
<Content Include="bower_components\components-font-awesome\fonts\fontawesome-webfont.ttf" />
8386
<Content Include="bower_components\components-font-awesome\fonts\fontawesome-webfont.woff" />
8487
<Content Include="bower_components\components-font-awesome\fonts\fontawesome-webfont.woff2" />
8588
<Content Include="bower_components\components-font-awesome\fonts\FontAwesome.otf" />
86-
<Content Include="dist\auDatepicker.js.map" />
87-
<Content Include="dist\AuHttpDateFix.js.map" />
88-
<Content Include="dist\auHelper.js.map" />
89+
<Content Include="dist\auDatepicker.js.map">
90+
<DependentUpon>auDatepicker.js</DependentUpon>
91+
</Content>
92+
<Content Include="dist\AuHttpDateFix.js.map">
93+
<DependentUpon>AuHttpDateFix.js</DependentUpon>
94+
</Content>
95+
<Content Include="dist\auHelper.js.map">
96+
<DependentUpon>auHelper.js</DependentUpon>
97+
</Content>
98+
<Content Include="packages.config" />
8999
<None Include="web.Debug.config">
90100
<DependentUpon>web.config</DependentUpon>
91101
</None>

Scripts/typings/angularjs/angular-animate.d.ts

Lines changed: 63 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
// Type definitions for Angular JS 1.3 (ngAnimate module)
1+
// Type definitions for Angular JS 1.5 (ngAnimate module)
22
// Project: http://angularjs.org
33
// Definitions by: Michel Salib <https://github.com/michelsalib>, Adi Dahiya <https://github.com/adidahiya>, Raphael Schweizer <https://github.com/rasch>, Cody Schaaf <https://github.com/codyschaaf>
4-
// Definitions: https://github.com/borisyankov/DefinitelyTyped
4+
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
55

66
/// <reference path="angular.d.ts" />
77

@@ -13,28 +13,69 @@ declare module "angular-animate" {
1313
/**
1414
* ngAnimate module (angular-animate.js)
1515
*/
16-
declare module angular.animate {
17-
interface IAnimateFactory extends Function {
18-
enter?: (element: ng.IAugmentedJQuery, doneFn: Function) => IAnimateCssRunner|void;
19-
leave?: (element: ng.IAugmentedJQuery, doneFn: Function) => IAnimateCssRunner|void;
20-
addClass?: (element: ng.IAugmentedJQuery, className: string, doneFn: Function) => IAnimateCssRunner|void;
21-
removeClass?: (element: ng.IAugmentedJQuery, className: string, doneFn: Function) => IAnimateCssRunner|void;
22-
setClass?: (element: ng.IAugmentedJQuery, className: string, doneFn: Function) => IAnimateCssRunner|void;
16+
declare namespace angular.animate {
17+
interface IAnimateFactory {
18+
(...args: any[]): IAnimateCallbackObject;
2319
}
2420

21+
interface IAnimateCallbackObject {
22+
eventFn?: (element: IAugmentedJQuery, doneFunction: Function, options: IAnimationOptions) => any;
23+
setClass?: (element: IAugmentedJQuery, addedClasses: string, removedClasses: string, doneFunction: Function, options: IAnimationOptions) => any;
24+
addClass?: (element: IAugmentedJQuery, addedClasses: string, doneFunction: Function, options: IAnimationOptions) => any;
25+
removeClass?: (element: IAugmentedJQuery, removedClasses: string, doneFunction: Function, options: IAnimationOptions) => any;
26+
enter?: (element: IAugmentedJQuery, doneFunction: Function, options: IAnimationOptions) => any;
27+
leave?: (element: IAugmentedJQuery, doneFunction: Function, options: IAnimationOptions) => any;
28+
move?: (element: IAugmentedJQuery, doneFunction: Function, options: IAnimationOptions) => any;
29+
animate?: (element: IAugmentedJQuery, fromStyles: string, toStyles: string, doneFunction: Function, options: IAnimationOptions) => any;
30+
}
31+
32+
interface IAnimationPromise extends IPromise<void> {}
33+
2534
/**
2635
* AnimateService
2736
* see http://docs.angularjs.org/api/ngAnimate/service/$animate
2837
*/
2938
interface IAnimateService {
39+
/**
40+
* Sets up an event listener to fire whenever the animation event has fired on the given element or among any of its children.
41+
*
42+
* @param event the animation event that will be captured (e.g. enter, leave, move, addClass, removeClass, etc...)
43+
* @param container the container element that will capture each of the animation events that are fired on itself as well as among its children
44+
* @param callback the callback function that will be fired when the listener is triggered
45+
*/
46+
on(event: string, container: JQuery, callback: Function): void;
47+
48+
/**
49+
* Deregisters an event listener based on the event which has been associated with the provided element.
50+
*
51+
* @param event the animation event (e.g. enter, leave, move, addClass, removeClass, etc...)
52+
* @param container the container element the event listener was placed on
53+
* @param callback the callback function that was registered as the listener
54+
*/
55+
off(event: string, container?: JQuery, callback?: Function): void;
56+
57+
/**
58+
* Associates the provided element with a host parent element to allow the element to be animated even if it exists outside of the DOM structure of the Angular application.
59+
*
60+
* @param element the external element that will be pinned
61+
* @param parentElement the host parent element that will be associated with the external element
62+
*/
63+
pin(element: JQuery, parentElement: JQuery): void;
64+
3065
/**
3166
* Globally enables / disables animations.
3267
*
3368
* @param element If provided then the element will be used to represent the enable/disable operation.
3469
* @param value If provided then set the animation on or off.
3570
* @returns current animation state
3671
*/
37-
enabled(element?: JQuery, value?: boolean): boolean;
72+
enabled(element: JQuery, value?: boolean): boolean;
73+
enabled(value: boolean): boolean;
74+
75+
/**
76+
* Cancels the provided animation.
77+
*/
78+
cancel(animationPromise: IAnimationPromise): void;
3879

3980
/**
4081
* Performs an inline animation on the element.
@@ -46,7 +87,7 @@ declare module angular.animate {
4687
* @param options an optional collection of styles that will be picked up by the CSS transition/animation
4788
* @returns the animation callback promise
4889
*/
49-
animate(element: JQuery, from: any, to: any, className?: string, options?: IAnimationOptions): IPromise<void>;
90+
animate(element: JQuery, from: any, to: any, className?: string, options?: IAnimationOptions): IAnimationPromise;
5091

5192
/**
5293
* Appends the element to the parentElement element that resides in the document and then runs the enter animation.
@@ -57,7 +98,7 @@ declare module angular.animate {
5798
* @param options an optional collection of styles that will be picked up by the CSS transition/animation
5899
* @returns the animation callback promise
59100
*/
60-
enter(element: JQuery, parentElement: JQuery, afterElement?: JQuery, options?: IAnimationOptions): IPromise<void>;
101+
enter(element: JQuery, parentElement: JQuery, afterElement?: JQuery, options?: IAnimationOptions): IAnimationPromise;
61102

62103
/**
63104
* Runs the leave animation operation and, upon completion, removes the element from the DOM.
@@ -66,7 +107,7 @@ declare module angular.animate {
66107
* @param options an optional collection of styles that will be picked up by the CSS transition/animation
67108
* @returns the animation callback promise
68109
*/
69-
leave(element: JQuery, options?: IAnimationOptions): IPromise<void>;
110+
leave(element: JQuery, options?: IAnimationOptions): IAnimationPromise;
70111

71112
/**
72113
* Fires the move DOM operation. Just before the animation starts, the animate service will either append
@@ -78,7 +119,7 @@ declare module angular.animate {
78119
* @param afterElement the sibling element (which is the previous element) of the element that will be the focus of the move animation
79120
* @returns the animation callback promise
80121
*/
81-
move(element: JQuery, parentElement: JQuery, afterElement?: JQuery): IPromise<void>;
122+
move(element: JQuery, parentElement: JQuery, afterElement?: JQuery): IAnimationPromise;
82123

83124
/**
84125
* Triggers a custom animation event based off the className variable and then attaches the className
@@ -89,7 +130,7 @@ declare module angular.animate {
89130
* @param options an optional collection of styles that will be picked up by the CSS transition/animation
90131
* @returns the animation callback promise
91132
*/
92-
addClass(element: JQuery, className: string, options?: IAnimationOptions): IPromise<void>;
133+
addClass(element: JQuery, className: string, options?: IAnimationOptions): IAnimationPromise;
93134

94135
/**
95136
* Triggers a custom animation event based off the className variable and then removes the CSS class
@@ -100,7 +141,7 @@ declare module angular.animate {
100141
* @param options an optional collection of styles that will be picked up by the CSS transition/animation
101142
* @returns the animation callback promise
102143
*/
103-
removeClass(element: JQuery, className: string, options?: IAnimationOptions): IPromise<void>;
144+
removeClass(element: JQuery, className: string, options?: IAnimationOptions): IAnimationPromise;
104145

105146
/**
106147
* Adds and/or removes the given CSS classes to and from the element. Once complete, the done() callback
@@ -112,12 +153,7 @@ declare module angular.animate {
112153
* @param options an optional collection of styles that will be picked up by the CSS transition/animation
113154
* @returns the animation callback promise
114155
*/
115-
setClass(element: JQuery, add: string, remove: string, options?: IAnimationOptions): IPromise<void>;
116-
117-
/**
118-
* Cancels the provided animation.
119-
*/
120-
cancel(animationPromise: IPromise<void>): void;
156+
setClass(element: JQuery, add: string, remove: string, options?: IAnimationOptions): IAnimationPromise;
121157
}
122158

123159
/**
@@ -131,7 +167,7 @@ declare module angular.animate {
131167
* @param name The name of the animation.
132168
* @param factory The factory function that will be executed to return the animation object.
133169
*/
134-
register(name: string, factory: () => IAnimateCallbackObject): void;
170+
register(name: string, factory: IAnimateFactory): void;
135171

136172
/**
137173
* Gets and/or sets the CSS class expression that is checked when performing an animation.
@@ -251,11 +287,13 @@ declare module angular.animate {
251287
interface IAnimateCssService {
252288
(element: JQuery, animateCssOptions: IAnimationOptions): IAnimateCssRunner;
253289
}
254-
255290
}
256291

257292
declare module angular {
258293
interface IModule {
259-
animate(cssSelector: string, animateFactory: angular.animate.IAnimateFactory): IModule;
294+
animation(name: string, animationFactory: angular.animate.IAnimateFactory): IModule;
295+
animation(name: string, inlineAnnotatedFunction: any[]): IModule;
296+
animation(object: Object): IModule;
260297
}
298+
261299
}

Scripts/typings/angularjs/angular-component-router.d.ts

Lines changed: 21 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
// Type definitions for Angular JS 1.5 component router
22
// Project: http://angularjs.org
33
// Definitions by: David Reher <http://github.com/davidreher>
4-
// Definitions: https://github.com/borisyankov/DefinitelyTyped
4+
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
55

66
/// <reference path="./angular.d.ts" />
7-
/// <reference path="../es6-promise/es6-promise.d.ts" />
87

9-
declare module angular {
8+
declare namespace angular {
109
/**
1110
* `Instruction` is a tree of {@link ComponentInstruction}s with all the information needed
1211
* to transition each component in the app to a given route, including all auxiliary routes.
@@ -46,7 +45,7 @@ declare module angular {
4645

4746
specificity(): number;
4847

49-
resolveComponent(): Promise<ComponentInstruction>;
48+
resolveComponent(): IPromise<ComponentInstruction>;
5049

5150
/**
5251
* converts the instruction into a URL string
@@ -88,20 +87,20 @@ declare module angular {
8887
* Called by the Router to instantiate a new component during the commit phase of a navigation.
8988
* This method in turn is responsible for calling the `routerOnActivate` hook of its child.
9089
*/
91-
activate(nextInstruction: ComponentInstruction): Promise<any>;
90+
activate(nextInstruction: ComponentInstruction): IPromise<any>;
9291

9392
/**
9493
* Called by the {@link Router} during the commit phase of a navigation when an outlet
9594
* reuses a component between different routes.
9695
* This method in turn is responsible for calling the `routerOnReuse` hook of its child.
9796
*/
98-
reuse(nextInstruction: ComponentInstruction): Promise<any>;
97+
reuse(nextInstruction: ComponentInstruction): IPromise<any>;
9998

10099
/**
101100
* Called by the {@link Router} when an outlet disposes of a component's contents.
102101
* This method in turn is responsible for calling the `routerOnDeactivate` hook of its child.
103102
*/
104-
deactivate(nextInstruction: ComponentInstruction): Promise<any>;
103+
deactivate(nextInstruction: ComponentInstruction): IPromise<any>;
105104

106105
/**
107106
* Called by the {@link Router} during recognition phase of a navigation.
@@ -111,7 +110,7 @@ declare module angular {
111110
* This method delegates to the child component's `routerCanDeactivate` hook if it exists,
112111
* and otherwise resolves to true.
113112
*/
114-
routerCanDeactivate(nextInstruction: ComponentInstruction): Promise<boolean>;
113+
routerCanDeactivate(nextInstruction: ComponentInstruction): IPromise<boolean>;
115114

116115
/**
117116
* Called by the {@link Router} during recognition phase of a navigation.
@@ -123,7 +122,7 @@ declare module angular {
123122
* Otherwise, this method delegates to the child component's `routerCanReuse` hook if it exists,
124123
* or resolves to true if the hook is not present.
125124
*/
126-
routerCanReuse(nextInstruction: ComponentInstruction): Promise<boolean>;
125+
routerCanReuse(nextInstruction: ComponentInstruction): IPromise<boolean>;
127126
}
128127

129128
interface RouteRegistry {
@@ -141,7 +140,7 @@ declare module angular {
141140
* Given a URL and a parent component, return the most specific instruction for navigating
142141
* the application into the state specified by the url
143142
*/
144-
recognize(url: string, ancestorInstructions: Instruction[]): Promise<Instruction>;
143+
recognize(url: string, ancestorInstructions: Instruction[]): IPromise<Instruction>;
145144

146145
/**
147146
* Given a normalized list with component names and params like: `['user', {id: 3 }]`
@@ -198,14 +197,14 @@ declare module angular {
198197
*
199198
* You probably don't need to use this unless you're writing a reusable component.
200199
*/
201-
registerPrimaryOutlet(outlet: RouterOutlet): Promise<boolean>;
200+
registerPrimaryOutlet(outlet: RouterOutlet): IPromise<boolean>;
202201

203202
/**
204203
* Register an outlet to notified of auxiliary route changes.
205204
*
206205
* You probably don't need to use this unless you're writing a reusable component.
207206
*/
208-
registerAuxOutlet(outlet: RouterOutlet): Promise<boolean>;
207+
registerAuxOutlet(outlet: RouterOutlet): IPromise<boolean>;
209208

210209
/**
211210
* Given an instruction, returns `true` if the instruction is currently active,
@@ -225,7 +224,7 @@ declare module angular {
225224
* ]);
226225
* ```
227226
*/
228-
config(definitions: RouteDefinition[]): Promise<any>;
227+
config(definitions: RouteDefinition[]): IPromise<any>;
229228

230229
/**
231230
* Navigate based on the provided Route Link DSL. It's preferred to navigate with this method
@@ -239,7 +238,7 @@ declare module angular {
239238
* ```
240239
* See the {@link RouterLink} directive for more.
241240
*/
242-
navigate(linkParams: any[]): Promise<any>;
241+
navigate(linkParams: any[]): IPromise<any>;
243242

244243
/**
245244
* Navigate to a URL. Returns a promise that resolves when navigation is complete.
@@ -248,19 +247,19 @@ declare module angular {
248247
* If the given URL begins with a `/`, router will navigate absolutely.
249248
* If the given URL does not begin with `/`, the router will navigate relative to this component.
250249
*/
251-
navigateByUrl(url: string, _skipLocationChange?: boolean): Promise<any>;
250+
navigateByUrl(url: string, _skipLocationChange?: boolean): IPromise<any>;
252251

253252
/**
254253
* Navigate via the provided instruction. Returns a promise that resolves when navigation is
255254
* complete.
256255
*/
257256
navigateByInstruction(instruction: Instruction,
258-
_skipLocationChange?: boolean): Promise<any>;
257+
_skipLocationChange?: boolean): IPromise<any>;
259258

260259
/**
261260
* Updates this router and all descendant routers according to the given instruction
262261
*/
263-
commit(instruction: Instruction, _skipLocationChange?: boolean): Promise<any>;
262+
commit(instruction: Instruction, _skipLocationChange?: boolean): IPromise<any>;
264263

265264
/**
266265
* Subscribe to URL updates from the router
@@ -270,18 +269,18 @@ declare module angular {
270269
/**
271270
* Removes the contents of this router's outlet and all descendant outlets
272271
*/
273-
deactivate(instruction: Instruction): Promise<any>;
272+
deactivate(instruction: Instruction): IPromise<any>;
274273

275274
/**
276275
* Given a URL, returns an instruction representing the component graph
277276
*/
278-
recognize(url: string): Promise<Instruction>;
277+
recognize(url: string): IPromise<Instruction>;
279278

280279
/**
281280
* Navigates to either the last URL successfully navigated to, or the last URL requested if the
282281
* router has yet to successfully navigate.
283282
*/
284-
renavigate(): Promise<any>;
283+
renavigate(): IPromise<any>;
285284

286285
/**
287286
* Generate an `Instruction` based on the provided Route Link DSL.
@@ -365,7 +364,7 @@ declare module angular {
365364
* {@example router/ts/can_deactivate/can_deactivate_example.ts region='routerCanDeactivate'}
366365
*/
367366
interface CanDeactivate {
368-
$routerCanDeactivate(next?: ComponentInstruction, prev?: ComponentInstruction): boolean | Promise<boolean>;
367+
$routerCanDeactivate(next?: ComponentInstruction, prev?: ComponentInstruction): boolean | IPromise<boolean>;
369368
}
370369

371370
/**
@@ -408,7 +407,7 @@ declare module angular {
408407
* {@example router/ts/reuse/reuse_example.ts region='reuseCmp'}
409408
*/
410409
interface CanReuse {
411-
$routerCanReuse(next?: angular.ComponentInstruction, prev?: angular.ComponentInstruction): boolean | Promise<boolean>;
410+
$routerCanReuse(next?: angular.ComponentInstruction, prev?: angular.ComponentInstruction): boolean | IPromise<boolean>;
412411
}
413412

414413
/**

0 commit comments

Comments
 (0)