@angular-wave/angular.ts 0.0.66 → 0.0.67

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.
Files changed (64) hide show
  1. package/dist/angular-ts.esm.js +2 -2
  2. package/dist/angular-ts.umd.js +2 -2
  3. package/package.json +1 -1
  4. package/src/animations/animate-js.js +4 -4
  5. package/src/animations/animate-swap.js +3 -0
  6. package/src/core/compile/compile.js +3 -3
  7. package/src/core/controller/controller.js +0 -5
  8. package/src/core/di/injector.js +9 -12
  9. package/src/core/di/internal-injector.js +113 -60
  10. package/src/core/parser/parse.js +1 -12
  11. package/src/core/parser/parse.spec.js +96 -110
  12. package/src/core/timeout/timeout.js +110 -111
  13. package/src/directive/input/input.js +32 -726
  14. package/src/directive/input/input.md +706 -0
  15. package/src/directive/select/select.js +48 -122
  16. package/src/directive/select/select.md +74 -0
  17. package/src/directive/show-hide/show-hide.js +13 -224
  18. package/src/directive/show-hide/show-hide.md +257 -0
  19. package/src/filters/limit-to.spec.js +1 -1
  20. package/src/filters/order-by.spec.js +1 -1
  21. package/src/index.js +6 -2
  22. package/src/loader.js +7 -3
  23. package/src/public.js +1 -7
  24. package/src/router/state/state-builder.js +2 -4
  25. package/src/router/state/state-service.js +1 -1
  26. package/src/router/state-provider.js +1 -1
  27. package/src/router/template-factory.js +10 -10
  28. package/src/router/url/url-service.js +4 -4
  29. package/src/services/anchor-scroll.js +2 -2
  30. package/src/services/browser.js +2 -9
  31. package/src/services/cache-factory.js +0 -67
  32. package/src/services/cache-factory.md +75 -0
  33. package/src/services/cookie-reader.js +36 -55
  34. package/src/services/http/http.js +62 -587
  35. package/src/services/http/http.md +413 -0
  36. package/src/services/http-backend/http-backend.js +19 -44
  37. package/src/services/template-request.js +1 -9
  38. package/src/shared/jqlite/jqlite.js +4 -69
  39. package/src/types.js +2 -4
  40. package/types/animations/animate-swap.d.ts +4 -7
  41. package/types/core/compile/compile.d.ts +6 -6
  42. package/types/core/controller/controller.d.ts +0 -5
  43. package/types/core/di/internal-injector.d.ts +73 -18
  44. package/types/core/exception-handler.d.ts +1 -1
  45. package/types/core/parser/parse.d.ts +1 -1
  46. package/types/core/timeout/timeout.d.ts +16 -26
  47. package/types/directive/input/input.d.ts +19 -124
  48. package/types/directive/select/select.d.ts +7 -74
  49. package/types/directive/show-hide/show-hide.d.ts +11 -224
  50. package/types/loader.d.ts +4 -4
  51. package/types/router/state/state-builder.d.ts +1 -2
  52. package/types/router/state/state-service.d.ts +2 -2
  53. package/types/router/state-provider.d.ts +2 -2
  54. package/types/router/template-factory.d.ts +15 -15
  55. package/types/router/url/url-service.d.ts +4 -4
  56. package/types/services/anchor-scroll.d.ts +1 -1
  57. package/types/services/browser.d.ts +0 -10
  58. package/types/services/cache-factory.d.ts +0 -67
  59. package/types/services/cookie-reader.d.ts +2 -10
  60. package/types/services/http/http.d.ts +53 -61
  61. package/types/services/http-backend/http-backend.d.ts +8 -31
  62. package/types/services/template-request.d.ts +1 -9
  63. package/types/shared/jqlite/jqlite.d.ts +9 -9
  64. package/types/types.d.ts +1 -9
@@ -58,132 +58,12 @@ const PARTIAL_VALIDATION_TYPES = new Map();
58
58
  });
59
59
 
60
60
  const inputType = {
61
- /**
62
- * @ngdoc input
63
- * @name input[text]
64
- *
65
- * @description
66
- * Standard HTML text input with AngularJS data binding, inherited by most of the `input` elements.
67
- *
68
- *
69
- * @param {string} ngModel Assignable AngularJS expression to data-bind to.
70
- * @param {string=} name Property name of the form under which the control is published.
71
- * @param {string=} required Adds `required` validation error key if the value is not entered.
72
- * @param {string=} ngRequired Adds `required` attribute and `required` validation constraint to
73
- * the element when the ngRequired expression evaluates to true. Use `ngRequired` instead of
74
- * `required` when you want to data-bind to the `required` attribute.
75
- * @param {number=} ngMinlength Sets `minlength` validation error key if the value is shorter than
76
- * minlength.
77
- * @param {number=} ngMaxlength Sets `maxlength` validation error key if the value is longer than
78
- * maxlength. Setting the attribute to a negative or non-numeric value, allows view values of
79
- * any length.
80
- * @param {string=} pattern Similar to `ngPattern` except that the attribute value is the actual string
81
- * that contains the regular expression body that will be converted to a regular expression
82
- * as in the ngPattern directive.
83
- * @param {string=} ngPattern Sets `pattern` validation error key if the ngModel {@link ngModel.NgModelController#$viewValue $viewValue}
84
- * does not match a RegExp found by evaluating the AngularJS expression given in the attribute value.
85
- * If the expression evaluates to a RegExp object, then this is used directly.
86
- * If the expression evaluates to a string, then it will be converted to a RegExp
87
- * after wrapping it in `^` and `$` characters. For instance, `"abc"` will be converted to
88
- * `new RegExp('^abc$')`.<br />
89
- * **Note:** Avoid using the `g` flag on the RegExp, as it will cause each successive search to
90
- * start at the index of the last search's match, thus not taking the whole input value into
91
- * account.
92
- * @param {string=} ngChange AngularJS expression to be executed when input changes due to user
93
- * interaction with the input element.
94
- * @param {boolean=} [ngTrim=true] If set to false AngularJS will not automatically trim the input.
95
- * This parameter is ignored for input[type=password] controls, which will never trim the
96
- * input.
97
- */
98
61
  text: textInputType,
99
-
100
- /**
101
- * @ngdoc input
102
- * @name input[date]
103
- *
104
- * @description
105
- * Input with date validation and transformation. In browsers that do not yet support
106
- * the HTML5 date input, a text element will be used. In that case, text must be entered in a valid ISO-8601
107
- * date format (yyyy-MM-dd), for example: `2009-01-06`. Since many
108
- * modern browsers do not yet support this input type, it is important to provide cues to users on the
109
- * expected input format via a placeholder or label.
110
- *
111
- * The model must always be a Date object, otherwise AngularJS will throw an error.
112
- * Invalid `Date` objects (dates whose `getTime()` is `NaN`) will be rendered as an empty string.
113
- *
114
- * The timezone to be used to read/write the `Date` instance in the model can be defined using
115
- * {@link ng.directive:ngModelOptions ngModelOptions}. By default, this is the timezone of the browser.
116
- *
117
- * @param {string} ngModel Assignable AngularJS expression to data-bind to.
118
- * @param {string=} name Property name of the form under which the control is published.
119
- * @param {string=} min Sets the `min` validation error key if the value entered is less than `min`. This must be a
120
- * valid ISO date string (yyyy-MM-dd). You can also use interpolation inside this attribute
121
- * (e.g. `min="{{minDate | date:'yyyy-MM-dd'}}"`). Note that `min` will also add native HTML5
122
- * constraint validation.
123
- * @param {string=} max Sets the `max` validation error key if the value entered is greater than `max`. This must be
124
- * a valid ISO date string (yyyy-MM-dd). You can also use interpolation inside this attribute
125
- * (e.g. `max="{{maxDate | date:'yyyy-MM-dd'}}"`). Note that `max` will also add native HTML5
126
- * constraint validation.
127
- * @param {(date|string)=} ngMin Sets the `min` validation constraint to the Date / ISO date string
128
- * the `ngMin` expression evaluates to. Note that it does not set the `min` attribute.
129
- * @param {(date|string)=} ngMax Sets the `max` validation constraint to the Date / ISO date string
130
- * the `ngMax` expression evaluates to. Note that it does not set the `max` attribute.
131
- * @param {string=} required Sets `required` validation error key if the value is not entered.
132
- * @param {string=} ngRequired Adds `required` attribute and `required` validation constraint to
133
- * the element when the ngRequired expression evaluates to true. Use `ngRequired` instead of
134
- * `required` when you want to data-bind to the `required` attribute.
135
- * @param {string=} ngChange AngularJS expression to be executed when input changes due to user
136
- * interaction with the input element.
137
- *
138
- */
139
62
  date: createDateInputType(
140
63
  "date",
141
64
  DATE_REGEXP,
142
65
  createDateParser(DATE_REGEXP, ["yyyy", "MM", "dd"]),
143
- "yyyy-MM-dd",
144
66
  ),
145
-
146
- /**
147
- * @ngdoc input
148
- * @name input[datetime-local]
149
- *
150
- * @description
151
- * Input with datetime validation and transformation. In browsers that do not yet support
152
- * the HTML5 date input, a text element will be used. In that case, the text must be entered in a valid ISO-8601
153
- * local datetime format (yyyy-MM-ddTHH:mm:ss), for example: `2010-12-28T14:57:00`.
154
- *
155
- * The model must always be a Date object, otherwise AngularJS will throw an error.
156
- * Invalid `Date` objects (dates whose `getTime()` is `NaN`) will be rendered as an empty string.
157
- *
158
- * The timezone to be used to read/write the `Date` instance in the model can be defined using
159
- * {@link ng.directive:ngModelOptions ngModelOptions}. By default, this is the timezone of the browser.
160
- *
161
- * The format of the displayed time can be adjusted with the
162
- * {@link ng.directive:ngModelOptions#ngModelOptions-arguments ngModelOptions} `timeSecondsFormat`
163
- * and `timeStripZeroSeconds`.
164
- *
165
- * @param {string} ngModel Assignable AngularJS expression to data-bind to.
166
- * @param {string=} name Property name of the form under which the control is published.
167
- * @param {string=} min Sets the `min` validation error key if the value entered is less than `min`.
168
- * This must be a valid ISO datetime format (yyyy-MM-ddTHH:mm:ss). You can also use interpolation
169
- * inside this attribute (e.g. `min="{{minDatetimeLocal | date:'yyyy-MM-ddTHH:mm:ss'}}"`).
170
- * Note that `min` will also add native HTML5 constraint validation.
171
- * @param {string=} max Sets the `max` validation error key if the value entered is greater than `max`.
172
- * This must be a valid ISO datetime format (yyyy-MM-ddTHH:mm:ss). You can also use interpolation
173
- * inside this attribute (e.g. `max="{{maxDatetimeLocal | date:'yyyy-MM-ddTHH:mm:ss'}}"`).
174
- * Note that `max` will also add native HTML5 constraint validation.
175
- * @param {(date|string)=} ngMin Sets the `min` validation error key to the Date / ISO datetime string
176
- * the `ngMin` expression evaluates to. Note that it does not set the `min` attribute.
177
- * @param {(date|string)=} ngMax Sets the `max` validation error key to the Date / ISO datetime string
178
- * the `ngMax` expression evaluates to. Note that it does not set the `max` attribute.
179
- * @param {string=} required Sets `required` validation error key if the value is not entered.
180
- * @param {string=} ngRequired Adds `required` attribute and `required` validation constraint to
181
- * the element when the ngRequired expression evaluates to true. Use `ngRequired` instead of
182
- * `required` when you want to data-bind to the `required` attribute.
183
- * @param {string=} ngChange AngularJS expression to be executed when input changes due to user
184
- * interaction with the input element.
185
- *
186
- */
187
67
  "datetime-local": createDateInputType(
188
68
  "datetimelocal",
189
69
  DATETIMELOCAL_REGEXP,
@@ -196,500 +76,24 @@ const inputType = {
196
76
  "ss",
197
77
  "sss",
198
78
  ]),
199
- "yyyy-MM-ddTHH:mm:ss.sss",
200
79
  ),
201
-
202
- /**
203
- * @ngdoc input
204
- * @name input[time]
205
- *
206
- * @description
207
- * Input with time validation and transformation. In browsers that do not yet support
208
- * the HTML5 time input, a text element will be used. In that case, the text must be entered in a valid ISO-8601
209
- * local time format (HH:mm:ss), for example: `14:57:00`. Model must be a Date object. This binding will always output a
210
- * Date object to the model of January 1, 1970, or local date `new Date(1970, 0, 1, HH, mm, ss)`.
211
- *
212
- * The model must always be a Date object, otherwise AngularJS will throw an error.
213
- * Invalid `Date` objects (dates whose `getTime()` is `NaN`) will be rendered as an empty string.
214
- *
215
- * The timezone to be used to read/write the `Date` instance in the model can be defined using
216
- * {@link ng.directive:ngModelOptions#ngModelOptions-arguments ngModelOptions}. By default,
217
- * this is the timezone of the browser.
218
- *
219
- * The format of the displayed time can be adjusted with the
220
- * {@link ng.directive:ngModelOptions#ngModelOptions-arguments ngModelOptions} `timeSecondsFormat`
221
- * and `timeStripZeroSeconds`.
222
- *
223
- * @param {string} ngModel Assignable AngularJS expression to data-bind to.
224
- * @param {string=} name Property name of the form under which the control is published.
225
- * @param {string=} min Sets the `min` validation error key if the value entered is less than `min`.
226
- * This must be a valid ISO time format (HH:mm:ss). You can also use interpolation inside this
227
- * attribute (e.g. `min="{{minTime | date:'HH:mm:ss'}}"`). Note that `min` will also add
228
- * native HTML5 constraint validation.
229
- * @param {string=} max Sets the `max` validation error key if the value entered is greater than `max`.
230
- * This must be a valid ISO time format (HH:mm:ss). You can also use interpolation inside this
231
- * attribute (e.g. `max="{{maxTime | date:'HH:mm:ss'}}"`). Note that `max` will also add
232
- * native HTML5 constraint validation.
233
- * @param {(date|string)=} ngMin Sets the `min` validation constraint to the Date / ISO time string the
234
- * `ngMin` expression evaluates to. Note that it does not set the `min` attribute.
235
- * @param {(date|string)=} ngMax Sets the `max` validation constraint to the Date / ISO time string the
236
- * `ngMax` expression evaluates to. Note that it does not set the `max` attribute.
237
- * @param {string=} required Sets `required` validation error key if the value is not entered.
238
- * @param {string=} ngRequired Adds `required` attribute and `required` validation constraint to
239
- * the element when the ngRequired expression evaluates to true. Use `ngRequired` instead of
240
- * `required` when you want to data-bind to the `required` attribute.
241
- * @param {string=} ngChange AngularJS expression to be executed when input changes due to user
242
- * interaction with the input element.
243
- *
244
- */
245
80
  time: createDateInputType(
246
81
  "time",
247
82
  TIME_REGEXP,
248
83
  createDateParser(TIME_REGEXP, ["HH", "mm", "ss", "sss"]),
249
- "HH:mm:ss.sss",
250
84
  ),
251
-
252
- /**
253
- * @ngdoc input
254
- * @name input[week]
255
- *
256
- * @description
257
- * Input with week-of-the-year validation and transformation to Date. In browsers that do not yet support
258
- * the HTML5 week input, a text element will be used. In that case, the text must be entered in a valid ISO-8601
259
- * week format (yyyy-W##), for example: `2013-W02`.
260
- *
261
- * The model must always be a Date object, otherwise AngularJS will throw an error.
262
- * Invalid `Date` objects (dates whose `getTime()` is `NaN`) will be rendered as an empty string.
263
- *
264
- * The value of the resulting Date object will be set to Thursday at 00:00:00 of the requested week,
265
- * due to ISO-8601 week numbering standards. Information on ISO's system for numbering the weeks of the
266
- * year can be found at: https://en.wikipedia.org/wiki/ISO_8601#Week_dates
267
- *
268
- * The timezone to be used to read/write the `Date` instance in the model can be defined using
269
- * {@link ng.directive:ngModelOptions ngModelOptions}. By default, this is the timezone of the browser.
270
- *
271
- * @param {string} ngModel Assignable AngularJS expression to data-bind to.
272
- * @param {string=} name Property name of the form under which the control is published.
273
- * @param {string=} min Sets the `min` validation error key if the value entered is less than `min`.
274
- * This must be a valid ISO week format (yyyy-W##). You can also use interpolation inside this
275
- * attribute (e.g. `min="{{minWeek | date:'yyyy-Www'}}"`). Note that `min` will also add
276
- * native HTML5 constraint validation.
277
- * @param {string=} max Sets the `max` validation error key if the value entered is greater than `max`.
278
- * This must be a valid ISO week format (yyyy-W##). You can also use interpolation inside this
279
- * attribute (e.g. `max="{{maxWeek | date:'yyyy-Www'}}"`). Note that `max` will also add
280
- * native HTML5 constraint validation.
281
- * @param {(date|string)=} ngMin Sets the `min` validation constraint to the Date / ISO week string
282
- * the `ngMin` expression evaluates to. Note that it does not set the `min` attribute.
283
- * @param {(date|string)=} ngMax Sets the `max` validation constraint to the Date / ISO week string
284
- * the `ngMax` expression evaluates to. Note that it does not set the `max` attribute.
285
- * @param {string=} required Sets `required` validation error key if the value is not entered.
286
- * @param {string=} ngRequired Adds `required` attribute and `required` validation constraint to
287
- * the element when the ngRequired expression evaluates to true. Use `ngRequired` instead of
288
- * `required` when you want to data-bind to the `required` attribute.
289
- * @param {string=} ngChange AngularJS expression to be executed when input changes due to user
290
- * interaction with the input element.
291
- */
292
- week: createDateInputType("week", WEEK_REGEXP, weekParser, "yyyy-Www"),
293
-
294
- /**
295
- * @ngdoc input
296
- * @name input[month]
297
- *
298
- * @description
299
- * Input with month validation and transformation. In browsers that do not yet support
300
- * the HTML5 month input, a text element will be used. In that case, the text must be entered in a valid ISO-8601
301
- * month format (yyyy-MM), for example: `2009-01`.
302
- *
303
- * The model must always be a Date object, otherwise AngularJS will throw an error.
304
- * Invalid `Date` objects (dates whose `getTime()` is `NaN`) will be rendered as an empty string.
305
- * If the model is not set to the first of the month, the next view to model update will set it
306
- * to the first of the month.
307
- *
308
- * The timezone to be used to read/write the `Date` instance in the model can be defined using
309
- * {@link ng.directive:ngModelOptions ngModelOptions}. By default, this is the timezone of the browser.
310
- *
311
- * @param {string} ngModel Assignable AngularJS expression to data-bind to.
312
- * @param {string=} name Property name of the form under which the control is published.
313
- * @param {string=} min Sets the `min` validation error key if the value entered is less than `min`.
314
- * This must be a valid ISO month format (yyyy-MM). You can also use interpolation inside this
315
- * attribute (e.g. `min="{{minMonth | date:'yyyy-MM'}}"`). Note that `min` will also add
316
- * native HTML5 constraint validation.
317
- * @param {string=} max Sets the `max` validation error key if the value entered is greater than `max`.
318
- * This must be a valid ISO month format (yyyy-MM). You can also use interpolation inside this
319
- * attribute (e.g. `max="{{maxMonth | date:'yyyy-MM'}}"`). Note that `max` will also add
320
- * native HTML5 constraint validation.
321
- * @param {(date|string)=} ngMin Sets the `min` validation constraint to the Date / ISO week string
322
- * the `ngMin` expression evaluates to. Note that it does not set the `min` attribute.
323
- * @param {(date|string)=} ngMax Sets the `max` validation constraint to the Date / ISO week string
324
- * the `ngMax` expression evaluates to. Note that it does not set the `max` attribute.
325
-
326
- * @param {string=} required Sets `required` validation error key if the value is not entered.
327
- * @param {string=} ngRequired Adds `required` attribute and `required` validation constraint to
328
- * the element when the ngRequired expression evaluates to true. Use `ngRequired` instead of
329
- * `required` when you want to data-bind to the `required` attribute.
330
- * @param {string=} ngChange AngularJS expression to be executed when input changes due to user
331
- * interaction with the input element.
332
- *
333
- */
85
+ week: createDateInputType("week", WEEK_REGEXP, weekParser),
334
86
  month: createDateInputType(
335
87
  "month",
336
88
  MONTH_REGEXP,
337
89
  createDateParser(MONTH_REGEXP, ["yyyy", "MM"]),
338
- "yyyy-MM",
339
90
  ),
340
-
341
- /**
342
- * @ngdoc input
343
- * @name input[number]
344
- *
345
- * @description
346
- * Text input with number validation and transformation. Sets the `number` validation
347
- * error if not a valid number.
348
- *
349
- * <div class="alert alert-warning">
350
- * The model must always be of type `number` otherwise AngularJS will throw an error.
351
- * Be aware that a string containing a number is not enough. See the {@link ngModel:numfmt}
352
- * error docs for more information and an example of how to convert your model if necessary.
353
- * </div>
354
- *
355
- *
356
- *
357
- * @knownIssue
358
- *
359
- * ### HTML5 constraint validation and `allowInvalid`
360
- *
361
- * In browsers that follow the
362
- * [HTML5 specification](https://html.spec.whatwg.org/multipage/forms.html#number-state-%28type=number%29),
363
- * `input[number]` does not work as expected with {@link ngModelOptions `ngModelOptions.allowInvalid`}.
364
- * If a non-number is entered in the input, the browser will report the value as an empty string,
365
- * which means the view / model values in `ngModel` and subsequently the scope value
366
- * will also be an empty string.
367
- *
368
- * @knownIssue
369
- *
370
- * ### Large numbers and `step` validation
371
- *
372
- * The `step` validation will not work correctly for very large numbers (e.g. 9999999999) due to
373
- * Javascript's arithmetic limitations. If you need to handle large numbers, purpose-built
374
- * libraries (e.g. https://github.com/MikeMcl/big.js/), can be included into AngularJS by
375
- * {@link guide/forms#modifying-built-in-validators overwriting the validators}
376
- * for `number` and / or `step`, or by {@link guide/forms#custom-validation applying custom validators}
377
- * to an `input[text]` element. The source for `input[number]` type can be used as a starting
378
- * point for both implementations.
379
- *
380
- * @param {string} ngModel Assignable AngularJS expression to data-bind to.
381
- * @param {string=} name Property name of the form under which the control is published.
382
- * @param {string=} min Sets the `min` validation error key if the value entered is less than `min`.
383
- * Can be interpolated.
384
- * @param {string=} max Sets the `max` validation error key if the value entered is greater than `max`.
385
- * Can be interpolated.
386
- * @param {string=} ngMin Like `min`, sets the `min` validation error key if the value entered is less than `ngMin`,
387
- * but does not trigger HTML5 native validation. Takes an expression.
388
- * @param {string=} ngMax Like `max`, sets the `max` validation error key if the value entered is greater than `ngMax`,
389
- * but does not trigger HTML5 native validation. Takes an expression.
390
- * @param {string=} step Sets the `step` validation error key if the value entered does not fit the `step` constraint.
391
- * Can be interpolated.
392
- * @param {string=} ngStep Like `step`, sets the `step` validation error key if the value entered does not fit the `ngStep` constraint,
393
- * but does not trigger HTML5 native validation. Takes an expression.
394
- * @param {string=} required Sets `required` validation error key if the value is not entered.
395
- * @param {string=} ngRequired Adds `required` attribute and `required` validation constraint to
396
- * the element when the ngRequired expression evaluates to true. Use `ngRequired` instead of
397
- * `required` when you want to data-bind to the `required` attribute.
398
- * @param {number=} ngMinlength Sets `minlength` validation error key if the value is shorter than
399
- * minlength.
400
- * @param {number=} ngMaxlength Sets `maxlength` validation error key if the value is longer than
401
- * maxlength. Setting the attribute to a negative or non-numeric value, allows view values of
402
- * any length.
403
- * @param {string=} pattern Similar to `ngPattern` except that the attribute value is the actual string
404
- * that contains the regular expression body that will be converted to a regular expression
405
- * as in the ngPattern directive.
406
- * @param {string=} ngPattern Sets `pattern` validation error key if the ngModel {@link ngModel.NgModelController#$viewValue $viewValue}
407
- * does not match a RegExp found by evaluating the AngularJS expression given in the attribute value.
408
- * If the expression evaluates to a RegExp object, then this is used directly.
409
- * If the expression evaluates to a string, then it will be converted to a RegExp
410
- * after wrapping it in `^` and `$` characters. For instance, `"abc"` will be converted to
411
- * `new RegExp('^abc$')`.<br />
412
- * **Note:** Avoid using the `g` flag on the RegExp, as it will cause each successive search to
413
- * start at the index of the last search's match, thus not taking the whole input value into
414
- * account.
415
- * @param {string=} ngChange AngularJS expression to be executed when input changes due to user
416
- * interaction with the input element.
417
- *
418
- */
419
91
  number: numberInputType,
420
-
421
- /**
422
- * @ngdoc input
423
- * @name input[url]
424
- *
425
- * @description
426
- * Text input with URL validation. Sets the `url` validation error key if the content is not a
427
- * valid URL.
428
- *
429
- * <div class="alert alert-warning">
430
- * **Note:** `input[url]` uses a regex to validate urls that is derived from the regex
431
- * used in Chromium. If you need stricter validation, you can use `ng-pattern` or modify
432
- * the built-in validators (see the {@link guide/forms Forms guide})
433
- * </div>
434
- *
435
- * @param {string} ngModel Assignable AngularJS expression to data-bind to.
436
- * @param {string=} name Property name of the form under which the control is published.
437
- * @param {string=} required Sets `required` validation error key if the value is not entered.
438
- * @param {string=} ngRequired Adds `required` attribute and `required` validation constraint to
439
- * the element when the ngRequired expression evaluates to true. Use `ngRequired` instead of
440
- * `required` when you want to data-bind to the `required` attribute.
441
- * @param {number=} ngMinlength Sets `minlength` validation error key if the value is shorter than
442
- * minlength.
443
- * @param {number=} ngMaxlength Sets `maxlength` validation error key if the value is longer than
444
- * maxlength. Setting the attribute to a negative or non-numeric value, allows view values of
445
- * any length.
446
- * @param {string=} pattern Similar to `ngPattern` except that the attribute value is the actual string
447
- * that contains the regular expression body that will be converted to a regular expression
448
- * as in the ngPattern directive.
449
- * @param {string=} ngPattern Sets `pattern` validation error key if the ngModel {@link ngModel.NgModelController#$viewValue $viewValue}
450
- * does not match a RegExp found by evaluating the AngularJS expression given in the attribute value.
451
- * If the expression evaluates to a RegExp object, then this is used directly.
452
- * If the expression evaluates to a string, then it will be converted to a RegExp
453
- * after wrapping it in `^` and `$` characters. For instance, `"abc"` will be converted to
454
- * `new RegExp('^abc$')`.<br />
455
- * **Note:** Avoid using the `g` flag on the RegExp, as it will cause each successive search to
456
- * start at the index of the last search's match, thus not taking the whole input value into
457
- * account.
458
- * @param {string=} ngChange AngularJS expression to be executed when input changes due to user
459
- * interaction with the input element.
460
- *
461
- */
462
92
  url: urlInputType,
463
-
464
- /**
465
- * @ngdoc input
466
- * @name input[email]
467
- *
468
- * @description
469
- * Text input with email validation. Sets the `email` validation error key if not a valid email
470
- * address.
471
- *
472
- * <div class="alert alert-warning">
473
- * **Note:** `input[email]` uses a regex to validate email addresses that is derived from the regex
474
- * used in Chromium, which may not fulfill your app's requirements.
475
- * If you need stricter (e.g. requiring a top-level domain), or more relaxed validation
476
- * (e.g. allowing IPv6 address literals) you can use `ng-pattern` or
477
- * modify the built-in validators (see the {@link guide/forms Forms guide}).
478
- * </div>
479
- *
480
- * @param {string} ngModel Assignable AngularJS expression to data-bind to.
481
- * @param {string=} name Property name of the form under which the control is published.
482
- * @param {string=} required Sets `required` validation error key if the value is not entered.
483
- * @param {string=} ngRequired Adds `required` attribute and `required` validation constraint to
484
- * the element when the ngRequired expression evaluates to true. Use `ngRequired` instead of
485
- * `required` when you want to data-bind to the `required` attribute.
486
- * @param {number=} ngMinlength Sets `minlength` validation error key if the value is shorter than
487
- * minlength.
488
- * @param {number=} ngMaxlength Sets `maxlength` validation error key if the value is longer than
489
- * maxlength. Setting the attribute to a negative or non-numeric value, allows view values of
490
- * any length.
491
- * @param {string=} pattern Similar to `ngPattern` except that the attribute value is the actual string
492
- * that contains the regular expression body that will be converted to a regular expression
493
- * as in the ngPattern directive.
494
- * @param {string=} ngPattern Sets `pattern` validation error key if the ngModel {@link ngModel.NgModelController#$viewValue $viewValue}
495
- * does not match a RegExp found by evaluating the AngularJS expression given in the attribute value.
496
- * If the expression evaluates to a RegExp object, then this is used directly.
497
- * If the expression evaluates to a string, then it will be converted to a RegExp
498
- * after wrapping it in `^` and `$` characters. For instance, `"abc"` will be converted to
499
- * `new RegExp('^abc$')`.<br />
500
- * **Note:** Avoid using the `g` flag on the RegExp, as it will cause each successive search to
501
- * start at the index of the last search's match, thus not taking the whole input value into
502
- * account.
503
- * @param {string=} ngChange AngularJS expression to be executed when input changes due to user
504
- * interaction with the input element.
505
- *
506
- */
507
93
  email: emailInputType,
508
-
509
- /**
510
- * @ngdoc input
511
- * @name input[radio]
512
- *
513
- * @description
514
- * HTML radio button.
515
- *
516
- * **Note:**<br>
517
- * All inputs controlled by {@link ngModel ngModel} (including those of type `radio`) will use the
518
- * value of their `name` attribute to determine the property under which their
519
- * {@link ngModel.NgModelController NgModelController} will be published on the parent
520
- * {@link form.FormController FormController}. Thus, if you use the same `name` for multiple
521
- * inputs of a form (e.g. a group of radio inputs), only _one_ `NgModelController` will be
522
- * published on the parent `FormController` under that name. The rest of the controllers will
523
- * continue to work as expected, but you won't be able to access them as properties on the parent
524
- * `FormController`.
525
- *
526
- * <div class="alert alert-info">
527
- * <p>
528
- * In plain HTML forms, the `name` attribute is used to identify groups of radio inputs, so
529
- * that the browser can manage their state (checked/unchecked) based on the state of other
530
- * inputs in the same group.
531
- * </p>
532
- * <p>
533
- * In AngularJS forms, this is not necessary. The input's state will be updated based on the
534
- * value of the underlying model data.
535
- * </p>
536
- * </div>
537
- *
538
- * <div class="alert alert-success">
539
- * If you omit the `name` attribute on a radio input, `ngModel` will automatically assign it a
540
- * unique name.
541
- * </div>
542
- *
543
- * @param {string} ngModel Assignable AngularJS expression to data-bind to.
544
- * @param {string} value The value to which the `ngModel` expression should be set when selected.
545
- * Note that `value` only supports `string` values, i.e. the scope model needs to be a string,
546
- * too. Use `ngValue` if you need complex models (`number`, `object`, ...).
547
- * @param {string=} name Property name of the form under which the control is published.
548
- * @param {string=} ngChange AngularJS expression to be executed when input changes due to user
549
- * interaction with the input element.
550
- * @param {string} ngValue AngularJS expression to which `ngModel` will be be set when the radio
551
- * is selected. Should be used instead of the `value` attribute if you need
552
- * a non-string `ngModel` (`boolean`, `array`, ...).
553
- *
554
- */
555
94
  radio: radioInputType,
556
-
557
- /**
558
- * @ngdoc input
559
- * @name input[range]
560
- *
561
- * @description
562
- * Native range input with validation and transformation.
563
- *
564
- * The model for the range input must always be a `Number`.
565
- *
566
- * IE9 and other browsers that do not support the `range` type fall back
567
- * to a text input without any default values for `min`, `max` and `step`. Model binding,
568
- * validation and number parsing are nevertheless supported.
569
- *
570
- * Browsers that support range (latest Chrome, Safari, Firefox, Edge) treat `input[range]`
571
- * in a way that never allows the input to hold an invalid value. That means:
572
- * - any non-numerical value is set to `(max + min) / 2`.
573
- * - any numerical value that is less than the current min val, or greater than the current max val
574
- * is set to the min / max val respectively.
575
- * - additionally, the current `step` is respected, so the nearest value that satisfies a step
576
- * is used.
577
- *
578
- * See the [HTML Spec on input[type=range]](https://www.w3.org/TR/html5/forms.html#range-state-(type=range))
579
- * for more info.
580
- *
581
- * This has the following consequences for AngularJS:
582
- *
583
- * Since the element value should always reflect the current model value, a range input
584
- * will set the bound ngModel expression to the value that the browser has set for the
585
- * input element. For example, in the following input `<input type="range" ng-model="model.value">`,
586
- * if the application sets `model.value = null`, the browser will set the input to `'50'`.
587
- * AngularJS will then set the model to `50`, to prevent input and model value being out of sync.
588
- *
589
- * That means the model for range will immediately be set to `50` after `ngModel` has been
590
- * initialized. It also means a range input can never have the required error.
591
- *
592
- * This does not only affect changes to the model value, but also to the values of the `min`,
593
- * `max`, and `step` attributes. When these change in a way that will cause the browser to modify
594
- * the input value, AngularJS will also update the model value.
595
- *
596
- * Automatic value adjustment also means that a range input element can never have the `required`,
597
- * `min`, or `max` errors.
598
- *
599
- * However, `step` is currently only fully implemented by Firefox. Other browsers have problems
600
- * when the step value changes dynamically - they do not adjust the element value correctly, but
601
- * instead may set the `stepMismatch` error. If that's the case, the AngularJS will set the `step`
602
- * error on the input, and set the model to `undefined`.
603
- *
604
- * Note that `input[range]` is not compatible with`ngMax`, `ngMin`, and `ngStep`, because they do
605
- * not set the `min` and `max` attributes, which means that the browser won't automatically adjust
606
- * the input value based on their values, and will always assume min = 0, max = 100, and step = 1.
607
- *
608
- * @param {string} ngModel Assignable AngularJS expression to data-bind to.
609
- * @param {string=} name Property name of the form under which the control is published.
610
- * @param {string=} min Sets the `min` validation to ensure that the value entered is greater
611
- * than `min`. Can be interpolated.
612
- * @param {string=} max Sets the `max` validation to ensure that the value entered is less than `max`.
613
- * Can be interpolated.
614
- * @param {string=} step Sets the `step` validation to ensure that the value entered matches the `step`
615
- * Can be interpolated.
616
- * @param {expression=} ngChange AngularJS expression to be executed when the ngModel value changes due
617
- * to user interaction with the input element.
618
- * @param {expression=} ngChecked If the expression is truthy, then the `checked` attribute will be set on the
619
- * element. **Note** : `ngChecked` should not be used alongside `ngModel`.
620
- * Checkout {@link ng.directive:ngChecked ngChecked} for usage.
621
- *
622
- * @example
623
- <example name="range-input-directive" module="rangeExample">
624
- <file name="index.html">
625
- <script>
626
- angular.module('rangeExample', [])
627
- .controller('ExampleController', ['$scope', function($scope) {
628
- $scope.value = 75;
629
- $scope.min = 10;
630
- $scope.max = 90;
631
- }]);
632
- </script>
633
- <form name="myForm" ng-controller="ExampleController">
634
-
635
- Model as range: <input type="range" name="range" ng-model="value" min="{{min}}" max="{{max}}">
636
- <hr>
637
- Model as number: <input type="number" ng-model="value"><br>
638
- Min: <input type="number" ng-model="min"><br>
639
- Max: <input type="number" ng-model="max"><br>
640
- value = <code>{{value}}</code><br/>
641
- myForm.range.$valid = <code>{{myForm.range.$valid}}</code><br/>
642
- myForm.range.$error = <code>{{myForm.range.$error}}</code>
643
- </form>
644
- </file>
645
- </example>
646
-
647
- * ## Range Input with ngMin & ngMax attributes
648
-
649
- * @example
650
- <example name="range-input-directive-ng" module="rangeExample">
651
- <file name="index.html">
652
- <script>
653
- angular.module('rangeExample', [])
654
- .controller('ExampleController', ['$scope', function($scope) {
655
- $scope.value = 75;
656
- $scope.min = 10;
657
- $scope.max = 90;
658
- }]);
659
- </script>
660
- <form name="myForm" ng-controller="ExampleController">
661
- Model as range: <input type="range" name="range" ng-model="value" ng-min="min" ng-max="max">
662
- <hr>
663
- Model as number: <input type="number" ng-model="value"><br>
664
- Min: <input type="number" ng-model="min"><br>
665
- Max: <input type="number" ng-model="max"><br>
666
- value = <code>{{value}}</code><br/>
667
- myForm.range.$valid = <code>{{myForm.range.$valid}}</code><br/>
668
- myForm.range.$error = <code>{{myForm.range.$error}}</code>
669
- </form>
670
- </file>
671
- </example>
672
-
673
- */
674
95
  range: rangeInputType,
675
-
676
- /**
677
- * @ngdoc input
678
- * @name input[checkbox]
679
- *
680
- * @description
681
- * HTML checkbox.
682
- *
683
- * @param {string} ngModel Assignable AngularJS expression to data-bind to.
684
- * @param {string=} name Property name of the form under which the control is published.
685
- * @param {expression=} ngTrueValue The value to which the expression should be set when selected.
686
- * @param {expression=} ngFalseValue The value to which the expression should be set when not selected.
687
- * @param {string=} ngChange AngularJS expression to be executed when input changes due to user
688
- * interaction with the input element.
689
- *
690
- */
691
96
  checkbox: checkboxInputType,
692
-
693
97
  hidden: () => {},
694
98
  button: () => {},
695
99
  submit: () => {},
@@ -1568,121 +972,41 @@ function checkboxInputType(
1568
972
  }
1569
973
 
1570
974
  /**
1571
- * @ngdoc directive
1572
- * @name textarea
1573
- * @restrict E
1574
- *
1575
- * @description
1576
- * HTML textarea element control with AngularJS data-binding. The data-binding and validation
1577
- * properties of this element are exactly the same as those of the
1578
- * {@link ng.directive:input input element}.
1579
- *
1580
- * @param {string} ngModel Assignable AngularJS expression to data-bind to.
1581
- * @param {string=} name Property name of the form under which the control is published.
1582
- * @param {string=} required Sets `required` validation error key if the value is not entered.
1583
- * @param {string=} ngRequired Adds `required` attribute and `required` validation constraint to
1584
- * the element when the ngRequired expression evaluates to true. Use `ngRequired` instead of
1585
- * `required` when you want to data-bind to the `required` attribute.
1586
- * @param {number=} ngMinlength Sets `minlength` validation error key if the value is shorter than
1587
- * minlength.
1588
- * @param {number=} ngMaxlength Sets `maxlength` validation error key if the value is longer than
1589
- * maxlength. Setting the attribute to a negative or non-numeric value, allows view values of any
1590
- * length.
1591
- * @param {string=} ngPattern Sets `pattern` validation error key if the ngModel {@link ngModel.NgModelController#$viewValue $viewValue}
1592
- * does not match a RegExp found by evaluating the AngularJS expression given in the attribute value.
1593
- * If the expression evaluates to a RegExp object, then this is used directly.
1594
- * If the expression evaluates to a string, then it will be converted to a RegExp
1595
- * after wrapping it in `^` and `$` characters. For instance, `"abc"` will be converted to
1596
- * `new RegExp('^abc$')`.<br />
1597
- * **Note:** Avoid using the `g` flag on the RegExp, as it will cause each successive search to
1598
- * start at the index of the last search's match, thus not taking the whole input value into
1599
- * account.
1600
- * @param {string=} ngChange AngularJS expression to be executed when input changes due to user
1601
- * interaction with the input element.
1602
- * @param {boolean=} [ngTrim=true] If set to false AngularJS will not automatically trim the input.
1603
- *
1604
- * @knownIssue
1605
- *
1606
- * When specifying the `placeholder` attribute of `<textarea>`, Internet Explorer will temporarily
1607
- * insert the placeholder value as the textarea's content. If the placeholder value contains
1608
- * interpolation (`{{ ... }}`), an error will be logged in the console when AngularJS tries to update
1609
- * the value of the by-then-removed text node. This doesn't affect the functionality of the
1610
- * textarea, but can be undesirable.
1611
- *
1612
- * You can work around this Internet Explorer issue by using `ng-attr-placeholder` instead of
1613
- * `placeholder` on textareas, whenever you need interpolation in the placeholder value. You can
1614
- * find more details on `ngAttr` in the
1615
- * [Interpolation](guide/interpolation#-ngattr-for-binding-to-arbitrary-attributes) section of the
1616
- * Developer Guide.
975
+ * @returns {import('../../types').Directive}
1617
976
  */
977
+ inputDirective.$inject = ["$browser", "$filter", "$parse"];
1618
978
 
1619
979
  /**
1620
- * @ngdoc directive
1621
- * @name input
1622
- * @restrict E
1623
- *
1624
- * @description
1625
- * HTML input element control. When used together with {@link ngModel `ngModel`}, it provides data-binding,
1626
- * input state control, and validation.
1627
- * Input control follows HTML5 input types and polyfills the HTML5 validation behavior for older browsers.
1628
- *
1629
- * <div class="alert alert-warning">
1630
- * **Note:** Not every feature offered is available for all input types.
1631
- * Specifically, data binding and event handling via `ng-model` is unsupported for `input[file]`.
1632
- * </div>
1633
- *
1634
- * @param {string} ngModel Assignable AngularJS expression to data-bind to.
1635
- * @param {string=} name Property name of the form under which the control is published.
1636
- * @param {string=} required Sets `required` validation error key if the value is not entered.
1637
- * @param {boolean=} ngRequired Sets `required` attribute if set to true
1638
- * @param {number=} ngMinlength Sets `minlength` validation error key if the value is shorter than
1639
- * minlength.
1640
- * @param {number=} ngMaxlength Sets `maxlength` validation error key if the value is longer than
1641
- * maxlength. Setting the attribute to a negative or non-numeric value, allows view values of any
1642
- * length.
1643
- * @param {string=} ngPattern Sets `pattern` validation error key if the ngModel {@link ngModel.NgModelController#$viewValue $viewValue}
1644
- * value does not match a RegExp found by evaluating the AngularJS expression given in the attribute value.
1645
- * If the expression evaluates to a RegExp object, then this is used directly.
1646
- * If the expression evaluates to a string, then it will be converted to a RegExp
1647
- * after wrapping it in `^` and `$` characters. For instance, `"abc"` will be converted to
1648
- * `new RegExp('^abc$')`.<br />
1649
- * **Note:** Avoid using the `g` flag on the RegExp, as it will cause each successive search to
1650
- * start at the index of the last search's match, thus not taking the whole input value into
1651
- * account.
1652
- * @param {string=} ngChange AngularJS expression to be executed when input changes due to user
1653
- * interaction with the input element.
1654
- * @param {boolean=} [ngTrim=true] If set to false AngularJS will not automatically trim the input.
1655
- * This parameter is ignored for input[type=password] controls, which will never trim the
1656
- * input.
1657
- *
980
+ * @param {import('../../services/browser').Browser} $browser
981
+ * @param {*} $filter
982
+ * @param {*} $parse
983
+ * @returns
1658
984
  */
1659
- export const inputDirective = [
1660
- "$browser",
1661
- "$filter",
1662
- "$parse",
1663
- function ($browser, $filter, $parse) {
1664
- return {
1665
- restrict: "E",
1666
- require: ["?ngModel"],
1667
- link: {
1668
- pre(scope, element, attr, ctrls) {
1669
- if (ctrls[0]) {
1670
- (inputType[lowercase(attr.type)] || inputType.text)(
1671
- scope,
1672
- element,
1673
- attr,
1674
- ctrls[0],
1675
- $browser,
1676
- $filter,
1677
- $parse,
1678
- );
1679
- }
1680
- },
985
+ export function inputDirective($browser, $filter, $parse) {
986
+ return {
987
+ restrict: "E",
988
+ require: ["?ngModel"],
989
+ link: {
990
+ pre(scope, element, attr, ctrls) {
991
+ if (ctrls[0]) {
992
+ (inputType[lowercase(attr.type)] || inputType.text)(
993
+ scope,
994
+ element,
995
+ attr,
996
+ ctrls[0],
997
+ $browser,
998
+ $filter,
999
+ $parse,
1000
+ );
1001
+ }
1681
1002
  },
1682
- };
1683
- },
1684
- ];
1003
+ },
1004
+ };
1005
+ }
1685
1006
 
1007
+ /**
1008
+ * @returns {import('../../types').Directive}
1009
+ */
1686
1010
  export function hiddenInputBrowserCacheDirective() {
1687
1011
  const valueProperty = {
1688
1012
  configurable: true,
@@ -1725,27 +1049,9 @@ export function hiddenInputBrowserCacheDirective() {
1725
1049
  }
1726
1050
 
1727
1051
  const CONSTANT_VALUE_REGEXP = /^(true|false|\d+)$/;
1052
+
1728
1053
  /**
1729
- * @ngdoc directive
1730
- * @name ngValue
1731
- * @restrict A
1732
- * @priority 100
1733
- *
1734
- * @description
1735
- * Binds the given expression to the value of the element.
1736
- *
1737
- * It is mainly used on {@link input[radio] `input[radio]`} and option elements,
1738
- * so that when the element is selected, the {@link ngModel `ngModel`} of that element (or its
1739
- * {@link select `select`} parent element) is set to the bound value. It is especially useful
1740
- * for dynamically generated lists using {@link ngRepeat `ngRepeat`}, as shown below.
1741
- *
1742
- * It can also be used to achieve one-way binding of a given expression to an input element
1743
- * such as an `input[text]` or a `textarea`, when that element does not use ngModel.
1744
- *
1745
- * @element ANY
1746
- * @param {string=} ngValue AngularJS expression, whose value will be bound to the `value` attribute
1747
- * and `value` property of the element.
1748
- *
1054
+ * @returns {import('../../types').Directive}
1749
1055
  */
1750
1056
  export function ngValueDirective() {
1751
1057
  /**