@angular-wave/angular.ts 0.15.1 → 0.15.2
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/@types/angular.d.ts +3 -0
- package/@types/core/scope/scope.d.ts +16 -24
- package/@types/directive/input/input.d.ts +8 -40
- package/@types/directive/show-hide/show-hide.d.ts +2 -1
- package/@types/namespace.d.ts +7 -1
- package/@types/services/http/interface.d.ts +0 -7
- package/@types/services/template-request/interface.d.ts +2 -9
- package/@types/services/template-request/template-request.d.ts +7 -40
- package/@types/shared/utils.d.ts +0 -10
- package/dist/angular-ts.esm.js +189 -635
- package/dist/angular-ts.umd.js +189 -635
- package/dist/angular-ts.umd.min.js +1 -1
- package/dist/angular-ts.umd.min.js.gz +0 -0
- package/dist/angular-ts.umd.min.js.map +1 -1
- package/package.json +1 -1
package/dist/angular-ts.esm.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* Version: 0.15.
|
|
1
|
+
/* Version: 0.15.2 - December 24, 2025 03:47:38 */
|
|
2
2
|
const VALID_CLASS = "ng-valid";
|
|
3
3
|
const INVALID_CLASS = "ng-invalid";
|
|
4
4
|
const PRISTINE_CLASS = "ng-pristine";
|
|
@@ -790,18 +790,6 @@ function fromJson(json) {
|
|
|
790
790
|
return isString(json) ? JSON.parse(json) : json;
|
|
791
791
|
}
|
|
792
792
|
|
|
793
|
-
/**
|
|
794
|
-
* @param {Date} date
|
|
795
|
-
* @param {number} minutes
|
|
796
|
-
*/
|
|
797
|
-
function addDateMinutes(date, minutes) {
|
|
798
|
-
const newDate = new Date(date.getTime());
|
|
799
|
-
|
|
800
|
-
newDate.setMinutes(newDate.getMinutes() + minutes);
|
|
801
|
-
|
|
802
|
-
return newDate;
|
|
803
|
-
}
|
|
804
|
-
|
|
805
793
|
/**
|
|
806
794
|
* Parses an escaped url query string into key-value pairs.
|
|
807
795
|
* @param {string} keyValue
|
|
@@ -9935,7 +9923,7 @@ class CompileProvider {
|
|
|
9935
9923
|
|
|
9936
9924
|
let linkNode = $compileNode._getAny();
|
|
9937
9925
|
|
|
9938
|
-
if (scope
|
|
9926
|
+
if (scope._destroyed) {
|
|
9939
9927
|
continue;
|
|
9940
9928
|
}
|
|
9941
9929
|
|
|
@@ -10002,7 +9990,7 @@ class CompileProvider {
|
|
|
10002
9990
|
) {
|
|
10003
9991
|
let childBoundTranscludeFn = boundTranscludeFn;
|
|
10004
9992
|
|
|
10005
|
-
if (scope
|
|
9993
|
+
if (scope._destroyed) {
|
|
10006
9994
|
return;
|
|
10007
9995
|
}
|
|
10008
9996
|
|
|
@@ -12924,9 +12912,6 @@ function ngModelDirective() {
|
|
|
12924
12912
|
};
|
|
12925
12913
|
}
|
|
12926
12914
|
|
|
12927
|
-
// Regex code was initially obtained from SO prior to modification: https://stackoverflow.com/questions/3143070/javascript-regex-iso-datetime#answer-3143231
|
|
12928
|
-
const ISO_DATE_REGEXP =
|
|
12929
|
-
/^\d{4,}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+(?:[+-][0-2]\d:[0-5]\d|Z)$/;
|
|
12930
12915
|
// See valid URLs in RFC3987 (http://tools.ietf.org/html/rfc3987)
|
|
12931
12916
|
// Note: We are being more lenient, because browsers are too.
|
|
12932
12917
|
// 1. Scheme
|
|
@@ -12974,35 +12959,14 @@ const PARTIAL_VALIDATION_TYPES = new Map();
|
|
|
12974
12959
|
|
|
12975
12960
|
const inputType = {
|
|
12976
12961
|
text: textInputType,
|
|
12977
|
-
date:
|
|
12978
|
-
|
|
12979
|
-
DATE_REGEXP,
|
|
12980
|
-
createDateParser(DATE_REGEXP, ["yyyy", "MM", "dd"]),
|
|
12981
|
-
),
|
|
12982
|
-
"datetime-local": createDateInputType(
|
|
12962
|
+
date: createStringDateInputType("date", DATE_REGEXP),
|
|
12963
|
+
"datetime-local": createStringDateInputType(
|
|
12983
12964
|
"datetimelocal",
|
|
12984
12965
|
DATETIMELOCAL_REGEXP,
|
|
12985
|
-
createDateParser(DATETIMELOCAL_REGEXP, [
|
|
12986
|
-
"yyyy",
|
|
12987
|
-
"MM",
|
|
12988
|
-
"dd",
|
|
12989
|
-
"HH",
|
|
12990
|
-
"mm",
|
|
12991
|
-
"ss",
|
|
12992
|
-
"sss",
|
|
12993
|
-
]),
|
|
12994
|
-
),
|
|
12995
|
-
time: createDateInputType(
|
|
12996
|
-
"time",
|
|
12997
|
-
TIME_REGEXP,
|
|
12998
|
-
createDateParser(TIME_REGEXP, ["HH", "mm", "ss", "sss"]),
|
|
12999
|
-
),
|
|
13000
|
-
week: createDateInputType("week", WEEK_REGEXP, weekParser),
|
|
13001
|
-
month: createDateInputType(
|
|
13002
|
-
"month",
|
|
13003
|
-
MONTH_REGEXP,
|
|
13004
|
-
createDateParser(MONTH_REGEXP, ["yyyy", "MM"]),
|
|
13005
12966
|
),
|
|
12967
|
+
time: createStringDateInputType("time", TIME_REGEXP),
|
|
12968
|
+
week: createStringDateInputType("week", WEEK_REGEXP),
|
|
12969
|
+
month: createStringDateInputType("month", MONTH_REGEXP),
|
|
13006
12970
|
number: numberInputType,
|
|
13007
12971
|
url: urlInputType,
|
|
13008
12972
|
email: emailInputType,
|
|
@@ -13131,318 +13095,56 @@ function baseInputType(_, element, attr, ctrl) {
|
|
|
13131
13095
|
};
|
|
13132
13096
|
}
|
|
13133
13097
|
|
|
13134
|
-
|
|
13135
|
-
|
|
13136
|
-
|
|
13137
|
-
|
|
13138
|
-
|
|
13139
|
-
|
|
13140
|
-
|
|
13141
|
-
const dayOfWeekOnFirst = new Date(year, 0, 1).getDay();
|
|
13142
|
-
|
|
13143
|
-
// 4 = index of Thursday (+1 to account for 1st = 5)
|
|
13144
|
-
// 11 = index of *next* Thursday (+1 account for 1st = 12)
|
|
13145
|
-
return new Date(
|
|
13146
|
-
year,
|
|
13147
|
-
0,
|
|
13148
|
-
// eslint-disable-next-line no-magic-numbers
|
|
13149
|
-
(dayOfWeekOnFirst <= 4 ? 5 : 12) - dayOfWeekOnFirst,
|
|
13150
|
-
);
|
|
13151
|
-
}
|
|
13152
|
-
|
|
13153
|
-
if (isString(isoWeek)) {
|
|
13154
|
-
WEEK_REGEXP.lastIndex = 0;
|
|
13155
|
-
const parts = WEEK_REGEXP.exec(isoWeek);
|
|
13156
|
-
|
|
13157
|
-
if (parts) {
|
|
13158
|
-
const year = +parts[1];
|
|
13159
|
-
|
|
13160
|
-
const week = +parts[2];
|
|
13161
|
-
|
|
13162
|
-
let hours = 0;
|
|
13163
|
-
|
|
13164
|
-
let minutes = 0;
|
|
13165
|
-
|
|
13166
|
-
let seconds = 0;
|
|
13167
|
-
|
|
13168
|
-
let milliseconds = 0;
|
|
13169
|
-
|
|
13170
|
-
const firstThurs = getFirstThursdayOfYear(year);
|
|
13171
|
-
|
|
13172
|
-
const DAYS = 7;
|
|
13173
|
-
|
|
13174
|
-
const addDays = (week - 1) * DAYS;
|
|
13175
|
-
|
|
13176
|
-
if (existingDate) {
|
|
13177
|
-
hours = existingDate.getHours();
|
|
13178
|
-
minutes = existingDate.getMinutes();
|
|
13179
|
-
seconds = existingDate.getSeconds();
|
|
13180
|
-
milliseconds = existingDate.getMilliseconds();
|
|
13181
|
-
}
|
|
13182
|
-
|
|
13183
|
-
return new Date(
|
|
13184
|
-
year,
|
|
13185
|
-
0,
|
|
13186
|
-
firstThurs.getDate() + addDays,
|
|
13187
|
-
hours,
|
|
13188
|
-
minutes,
|
|
13189
|
-
seconds,
|
|
13190
|
-
milliseconds,
|
|
13191
|
-
);
|
|
13192
|
-
}
|
|
13193
|
-
}
|
|
13194
|
-
|
|
13195
|
-
return NaN;
|
|
13196
|
-
}
|
|
13197
|
-
|
|
13198
|
-
function createDateParser(regexp, mapping) {
|
|
13199
|
-
return function (iso, previousDate) {
|
|
13200
|
-
let parts;
|
|
13201
|
-
|
|
13202
|
-
let map;
|
|
13203
|
-
|
|
13204
|
-
if (isDate(iso)) {
|
|
13205
|
-
return iso;
|
|
13206
|
-
}
|
|
13207
|
-
|
|
13208
|
-
if (isString(iso)) {
|
|
13209
|
-
// When a date is JSON'ified to wraps itself inside of an extra
|
|
13210
|
-
// set of double quotes. This makes the date parsing code unable
|
|
13211
|
-
// to match the date string and parse it as a date.
|
|
13212
|
-
if (iso.charAt(0) === '"' && iso.charAt(iso.length - 1) === '"') {
|
|
13213
|
-
iso = iso.substring(1, iso.length - 1);
|
|
13214
|
-
}
|
|
13215
|
-
|
|
13216
|
-
if (ISO_DATE_REGEXP.test(iso)) {
|
|
13217
|
-
return new Date(iso);
|
|
13218
|
-
}
|
|
13219
|
-
regexp.lastIndex = 0;
|
|
13220
|
-
parts = regexp.exec(iso);
|
|
13221
|
-
|
|
13222
|
-
if (parts) {
|
|
13223
|
-
parts.shift();
|
|
13224
|
-
|
|
13225
|
-
if (previousDate) {
|
|
13226
|
-
map = {
|
|
13227
|
-
yyyy: previousDate.getFullYear(),
|
|
13228
|
-
MM: previousDate.getMonth() + 1,
|
|
13229
|
-
dd: previousDate.getDate(),
|
|
13230
|
-
HH: previousDate.getHours(),
|
|
13231
|
-
mm: previousDate.getMinutes(),
|
|
13232
|
-
ss: previousDate.getSeconds(),
|
|
13233
|
-
sss: previousDate.getMilliseconds() / 1000,
|
|
13234
|
-
};
|
|
13235
|
-
} else {
|
|
13236
|
-
map = { yyyy: 1970, MM: 1, dd: 1, HH: 0, mm: 0, ss: 0, sss: 0 };
|
|
13237
|
-
}
|
|
13238
|
-
|
|
13239
|
-
Object.entries(parts).forEach(([index, part]) => {
|
|
13240
|
-
if (index < mapping.length) {
|
|
13241
|
-
map[mapping[index]] = +part;
|
|
13242
|
-
}
|
|
13243
|
-
});
|
|
13244
|
-
|
|
13245
|
-
const date = new Date(
|
|
13246
|
-
map.yyyy,
|
|
13247
|
-
map.MM - 1,
|
|
13248
|
-
map.dd,
|
|
13249
|
-
map.HH,
|
|
13250
|
-
map.mm,
|
|
13251
|
-
map.ss || 0,
|
|
13252
|
-
map.sss * 1000 || 0,
|
|
13253
|
-
);
|
|
13254
|
-
|
|
13255
|
-
if (map.yyyy < 100) {
|
|
13256
|
-
// In the constructor, 2-digit years map to 1900-1999.
|
|
13257
|
-
// Use `setFullYear()` to set the correct year.
|
|
13258
|
-
date.setFullYear(map.yyyy);
|
|
13259
|
-
}
|
|
13260
|
-
|
|
13261
|
-
return date;
|
|
13262
|
-
}
|
|
13263
|
-
}
|
|
13264
|
-
|
|
13265
|
-
return NaN;
|
|
13266
|
-
};
|
|
13267
|
-
}
|
|
13268
|
-
|
|
13269
|
-
const MONTH_INPUT_FORMAT = /\b\d{4}-(0[1-9]|1[0-2])\b/;
|
|
13270
|
-
|
|
13271
|
-
function createDateInputType(type, regexp, parseDate) {
|
|
13272
|
-
return function dynamicDateInputType(
|
|
13273
|
-
scope,
|
|
13274
|
-
element,
|
|
13275
|
-
attr,
|
|
13276
|
-
ctrl,
|
|
13277
|
-
$filter,
|
|
13278
|
-
$parse,
|
|
13279
|
-
) {
|
|
13280
|
-
badInputChecker(scope, element, attr, ctrl, type);
|
|
13098
|
+
/**
|
|
13099
|
+
* @param {string} type
|
|
13100
|
+
* @param {RegExp} regexp
|
|
13101
|
+
* @returns {*}
|
|
13102
|
+
*/
|
|
13103
|
+
function createStringDateInputType(type, regexp) {
|
|
13104
|
+
return function stringDateInputType(scope, element, attr, ctrl, $parse) {
|
|
13281
13105
|
baseInputType(scope, element, attr, ctrl);
|
|
13282
|
-
let previousDate;
|
|
13283
|
-
|
|
13284
13106
|
ctrl.$parsers.push((value) => {
|
|
13285
13107
|
if (ctrl.$isEmpty(value)) return null;
|
|
13286
13108
|
|
|
13287
|
-
if (regexp.test(value))
|
|
13288
|
-
// Do not convert for native HTML
|
|
13289
|
-
if (["month", "week", "datetimelocal", "time", "date"].includes(type)) {
|
|
13290
|
-
return value;
|
|
13291
|
-
}
|
|
13109
|
+
if (regexp.test(value)) return value;
|
|
13292
13110
|
|
|
13293
|
-
// Note: We cannot read ctrl.$modelValue, as there might be a different
|
|
13294
|
-
// parser/formatter in the processing chain so that the model
|
|
13295
|
-
// contains some different data format!
|
|
13296
|
-
return parseDateAndConvertTimeZoneToLocal(value, previousDate);
|
|
13297
|
-
}
|
|
13298
13111
|
ctrl.$$parserName = type;
|
|
13299
13112
|
|
|
13300
13113
|
return undefined;
|
|
13301
13114
|
});
|
|
13302
13115
|
|
|
13303
|
-
ctrl.$formatters.push(
|
|
13304
|
-
if (
|
|
13305
|
-
throw ngModelMinErr("datefmt", "Expected `{0}` to be a String", value);
|
|
13306
|
-
}
|
|
13307
|
-
|
|
13308
|
-
if (type === "month") {
|
|
13309
|
-
if (isNullOrUndefined(value)) {
|
|
13310
|
-
return "";
|
|
13311
|
-
}
|
|
13312
|
-
|
|
13313
|
-
if (!MONTH_INPUT_FORMAT.test(value)) {
|
|
13314
|
-
throw ngModelMinErr(
|
|
13315
|
-
"datefmt",
|
|
13316
|
-
"Expected month `{0}` to be a 'YYYY-DD'",
|
|
13317
|
-
value,
|
|
13318
|
-
);
|
|
13319
|
-
}
|
|
13320
|
-
}
|
|
13116
|
+
ctrl.$formatters.push((value) => {
|
|
13117
|
+
if (ctrl.$isEmpty(value)) return "";
|
|
13321
13118
|
|
|
13322
|
-
if (
|
|
13323
|
-
|
|
13324
|
-
return "";
|
|
13325
|
-
}
|
|
13326
|
-
|
|
13327
|
-
if (!WEEK_REGEXP.test(value)) {
|
|
13328
|
-
throw ngModelMinErr(
|
|
13329
|
-
"datefmt",
|
|
13330
|
-
"Expected week `{0}` to be a 'yyyy-Www'",
|
|
13331
|
-
value,
|
|
13332
|
-
);
|
|
13333
|
-
}
|
|
13334
|
-
}
|
|
13335
|
-
|
|
13336
|
-
if (type === "datetimelocal") {
|
|
13337
|
-
if (isNullOrUndefined(value)) {
|
|
13338
|
-
return "";
|
|
13339
|
-
}
|
|
13340
|
-
|
|
13341
|
-
if (!DATETIMELOCAL_REGEXP.test(value)) {
|
|
13342
|
-
throw ngModelMinErr(
|
|
13343
|
-
"datefmt",
|
|
13344
|
-
"Expected week `{0}` to be a in date time format. See: https://developer.mozilla.org/en-US/docs/Web/HTML/Date_and_time_formats#local_date_and_time_strings",
|
|
13345
|
-
value,
|
|
13346
|
-
);
|
|
13347
|
-
}
|
|
13119
|
+
if (!isString(value)) {
|
|
13120
|
+
throw ngModelMinErr("datefmt", "Expected `{0}` to be a string", value);
|
|
13348
13121
|
}
|
|
13349
13122
|
|
|
13350
13123
|
return value;
|
|
13351
|
-
|
|
13352
|
-
// if (isValidDate(value)) {
|
|
13353
|
-
// previousDate = value;
|
|
13354
|
-
// const timezone = ctrl.$options.getOption("timezone");
|
|
13355
|
-
|
|
13356
|
-
// if (timezone) {
|
|
13357
|
-
// previousTimezone = timezone;
|
|
13358
|
-
// previousDate = convertTimezoneToLocal(previousDate, timezone, true);
|
|
13359
|
-
// }
|
|
13360
|
-
|
|
13361
|
-
// return value;
|
|
13362
|
-
// }
|
|
13363
|
-
// previousDate = null;
|
|
13364
|
-
// previousTimezone = null;
|
|
13365
|
-
// return "";
|
|
13366
13124
|
});
|
|
13367
13125
|
|
|
13126
|
+
// Optional min/max
|
|
13368
13127
|
if (isDefined(attr.min) || attr.ngMin) {
|
|
13369
|
-
let minVal = attr.min || $parse(attr.ngMin)(scope);
|
|
13128
|
+
let minVal = attr.min || $parse?.(attr.ngMin)(scope);
|
|
13370
13129
|
|
|
13371
|
-
|
|
13372
|
-
|
|
13373
|
-
ctrl.$validators.min = function (value) {
|
|
13374
|
-
if (type === "month") {
|
|
13375
|
-
return (
|
|
13376
|
-
isUndefined(parsedMinVal) ||
|
|
13377
|
-
parseDate(value) >= parseDate(parsedMinVal)
|
|
13378
|
-
);
|
|
13379
|
-
}
|
|
13380
|
-
|
|
13381
|
-
return (
|
|
13382
|
-
!isValidDate(value) ||
|
|
13383
|
-
isUndefined(parsedMinVal) ||
|
|
13384
|
-
parseDate(value) >= parsedMinVal
|
|
13385
|
-
);
|
|
13386
|
-
};
|
|
13130
|
+
ctrl.$validators.min = (_modelValue, viewValue) =>
|
|
13131
|
+
ctrl.$isEmpty(viewValue) || viewValue >= minVal;
|
|
13387
13132
|
attr.$observe("min", (val) => {
|
|
13388
|
-
|
|
13389
|
-
|
|
13390
|
-
minVal = val;
|
|
13391
|
-
ctrl.$validate();
|
|
13392
|
-
}
|
|
13133
|
+
minVal = val;
|
|
13134
|
+
ctrl.$validate();
|
|
13393
13135
|
});
|
|
13394
13136
|
}
|
|
13395
13137
|
|
|
13396
13138
|
if (isDefined(attr.max) || attr.ngMax) {
|
|
13397
|
-
let maxVal = attr.max || $parse(attr.ngMax)(scope);
|
|
13398
|
-
|
|
13399
|
-
let parsedMaxVal = parseObservedDateValue(deProxy(maxVal));
|
|
13400
|
-
|
|
13401
|
-
ctrl.$validators.max = function (value) {
|
|
13402
|
-
if (type === "month") {
|
|
13403
|
-
return (
|
|
13404
|
-
isUndefined(parsedMaxVal) ||
|
|
13405
|
-
parseDate(value) <= parseDate(parsedMaxVal)
|
|
13406
|
-
);
|
|
13407
|
-
}
|
|
13139
|
+
let maxVal = attr.max || $parse?.(attr.ngMax)(scope);
|
|
13408
13140
|
|
|
13409
|
-
|
|
13410
|
-
|
|
13411
|
-
isUndefined(parsedMaxVal) ||
|
|
13412
|
-
parseDate(value) <= parsedMaxVal
|
|
13413
|
-
);
|
|
13414
|
-
};
|
|
13141
|
+
ctrl.$validators.max = (_modelValue, viewValue) =>
|
|
13142
|
+
ctrl.$isEmpty(viewValue) || viewValue <= maxVal;
|
|
13415
13143
|
attr.$observe("max", (val) => {
|
|
13416
|
-
|
|
13417
|
-
|
|
13418
|
-
maxVal = val;
|
|
13419
|
-
ctrl.$validate();
|
|
13420
|
-
}
|
|
13144
|
+
maxVal = val;
|
|
13145
|
+
ctrl.$validate();
|
|
13421
13146
|
});
|
|
13422
13147
|
}
|
|
13423
|
-
|
|
13424
|
-
function isValidDate(value) {
|
|
13425
|
-
// Invalid Date: getTime() returns NaN
|
|
13426
|
-
return value && !(value.getTime && Number.isNaN(value.getTime()));
|
|
13427
|
-
}
|
|
13428
|
-
|
|
13429
|
-
function parseObservedDateValue(val) {
|
|
13430
|
-
return isDefined(val) && !isDate(val)
|
|
13431
|
-
? parseDateAndConvertTimeZoneToLocal(val) || undefined
|
|
13432
|
-
: val;
|
|
13433
|
-
}
|
|
13434
|
-
|
|
13435
|
-
function parseDateAndConvertTimeZoneToLocal(value, previousDateParam) {
|
|
13436
|
-
const timezone = ctrl.$options.getOption("timezone");
|
|
13437
|
-
|
|
13438
|
-
let parsedDate = parseDate(value, previousDateParam);
|
|
13439
|
-
|
|
13440
|
-
if (!Number.isNaN(parsedDate) && timezone) {
|
|
13441
|
-
parsedDate = convertTimezoneToLocal(parsedDate, timezone);
|
|
13442
|
-
}
|
|
13443
|
-
|
|
13444
|
-
return parsedDate;
|
|
13445
|
-
}
|
|
13446
13148
|
};
|
|
13447
13149
|
}
|
|
13448
13150
|
|
|
@@ -13567,7 +13269,7 @@ function isValidForStep(viewValue, stepBase, step) {
|
|
|
13567
13269
|
return (value - stepBase) % step === 0;
|
|
13568
13270
|
}
|
|
13569
13271
|
|
|
13570
|
-
function numberInputType(scope, element, attr, ctrl, $
|
|
13272
|
+
function numberInputType(scope, element, attr, ctrl, $parse) {
|
|
13571
13273
|
badInputChecker(scope, element, attr, ctrl, "number");
|
|
13572
13274
|
numberFormatterParser(ctrl);
|
|
13573
13275
|
baseInputType(scope, element, attr, ctrl);
|
|
@@ -13906,7 +13608,7 @@ function parseConstantExpr($parse, context, name, expression, fallback) {
|
|
|
13906
13608
|
return fallback;
|
|
13907
13609
|
}
|
|
13908
13610
|
|
|
13909
|
-
function checkboxInputType(scope, element, attr, ctrl, $
|
|
13611
|
+
function checkboxInputType(scope, element, attr, ctrl, $parse) {
|
|
13910
13612
|
const trueValue = parseConstantExpr(
|
|
13911
13613
|
$parse,
|
|
13912
13614
|
scope,
|
|
@@ -13945,14 +13647,13 @@ function checkboxInputType(scope, element, attr, ctrl, $filter, $parse) {
|
|
|
13945
13647
|
ctrl.$parsers.push((value) => (value ? trueValue : falseValue));
|
|
13946
13648
|
}
|
|
13947
13649
|
|
|
13948
|
-
inputDirective.$inject = [$injectTokens.
|
|
13650
|
+
inputDirective.$inject = [$injectTokens._parse];
|
|
13949
13651
|
|
|
13950
13652
|
/**
|
|
13951
|
-
* @param {ng.FilterFactory} $filter
|
|
13952
13653
|
* @param {ng.ParseService} $parse
|
|
13953
13654
|
* @returns {ng.Directive}
|
|
13954
13655
|
*/
|
|
13955
|
-
function inputDirective($
|
|
13656
|
+
function inputDirective($parse) {
|
|
13956
13657
|
return {
|
|
13957
13658
|
restrict: "E",
|
|
13958
13659
|
require: ["?ngModel"],
|
|
@@ -13964,7 +13665,6 @@ function inputDirective($filter, $parse) {
|
|
|
13964
13665
|
element,
|
|
13965
13666
|
attr,
|
|
13966
13667
|
ctrls[0],
|
|
13967
|
-
$filter,
|
|
13968
13668
|
$parse,
|
|
13969
13669
|
);
|
|
13970
13670
|
}
|
|
@@ -13976,47 +13676,18 @@ function inputDirective($filter, $parse) {
|
|
|
13976
13676
|
/**
|
|
13977
13677
|
* @returns {ng.Directive}
|
|
13978
13678
|
*/
|
|
13979
|
-
function
|
|
13980
|
-
const valueProperty = {
|
|
13981
|
-
configurable: true,
|
|
13982
|
-
enumerable: false,
|
|
13983
|
-
get() {
|
|
13984
|
-
return this.getAttribute("value") || "";
|
|
13985
|
-
},
|
|
13986
|
-
set(val) {
|
|
13987
|
-
this.setAttribute("value", val);
|
|
13988
|
-
},
|
|
13989
|
-
};
|
|
13990
|
-
|
|
13679
|
+
function hiddenInputDirective() {
|
|
13991
13680
|
return {
|
|
13992
13681
|
restrict: "E",
|
|
13993
|
-
priority: 200,
|
|
13994
13682
|
compile(_, attr) {
|
|
13995
|
-
if (attr.type?.toLowerCase() !== "hidden")
|
|
13996
|
-
return undefined;
|
|
13997
|
-
}
|
|
13683
|
+
if (attr.type?.toLowerCase() !== "hidden") return undefined;
|
|
13998
13684
|
|
|
13999
|
-
|
|
13685
|
+
return {
|
|
14000
13686
|
pre(_scope, element) {
|
|
14001
|
-
|
|
14002
|
-
|
|
14003
|
-
// Support: Edge
|
|
14004
|
-
// Moving the DOM around prevents autofillling
|
|
14005
|
-
if (node.parentNode) {
|
|
14006
|
-
node.parentNode.insertBefore(node, node.nextSibling);
|
|
14007
|
-
}
|
|
14008
|
-
|
|
14009
|
-
// Support: FF, IE
|
|
14010
|
-
// Avoiding direct assignment to .value prevents autofillling
|
|
14011
|
-
if (Object.defineProperty) {
|
|
14012
|
-
Object.defineProperty(node, "value", valueProperty);
|
|
14013
|
-
}
|
|
14014
|
-
|
|
14015
|
-
return undefined;
|
|
13687
|
+
/** @type {HTMLInputElement} */ (element).value =
|
|
13688
|
+
element.getAttribute("value") ?? "";
|
|
14016
13689
|
},
|
|
14017
13690
|
};
|
|
14018
|
-
|
|
14019
|
-
return res;
|
|
14020
13691
|
},
|
|
14021
13692
|
};
|
|
14022
13693
|
}
|
|
@@ -14059,40 +13730,6 @@ function ngValueDirective() {
|
|
|
14059
13730
|
};
|
|
14060
13731
|
}
|
|
14061
13732
|
|
|
14062
|
-
/**
|
|
14063
|
-
* @param {Date} date
|
|
14064
|
-
* @param {any} timezone
|
|
14065
|
-
* @param {undefined} [reverse]
|
|
14066
|
-
*/
|
|
14067
|
-
function convertTimezoneToLocal(date, timezone, reverse) {
|
|
14068
|
-
const doReverse = 1;
|
|
14069
|
-
|
|
14070
|
-
const dateTimezoneOffset = date.getTimezoneOffset();
|
|
14071
|
-
|
|
14072
|
-
const timezoneOffset = timezoneToOffset(timezone, dateTimezoneOffset);
|
|
14073
|
-
|
|
14074
|
-
return addDateMinutes(
|
|
14075
|
-
date,
|
|
14076
|
-
doReverse * (timezoneOffset - dateTimezoneOffset),
|
|
14077
|
-
);
|
|
14078
|
-
}
|
|
14079
|
-
|
|
14080
|
-
const MS_PER_MINUTE = 60_000; // 60,000 ms in a minute
|
|
14081
|
-
|
|
14082
|
-
/**
|
|
14083
|
-
* @param {any} timezone
|
|
14084
|
-
* @param {number} [fallback]
|
|
14085
|
-
* @returns {number}
|
|
14086
|
-
*/
|
|
14087
|
-
function timezoneToOffset(timezone, fallback) {
|
|
14088
|
-
const requestedTimezoneOffset =
|
|
14089
|
-
Date.parse(`Jan 01, 1970 00:00:00 ${timezone}`) / MS_PER_MINUTE;
|
|
14090
|
-
|
|
14091
|
-
return isNumberNaN(requestedTimezoneOffset)
|
|
14092
|
-
? (fallback ?? 0)
|
|
14093
|
-
: requestedTimezoneOffset;
|
|
14094
|
-
}
|
|
14095
|
-
|
|
14096
13733
|
scriptDirective.$inject = [$injectTokens._templateCache];
|
|
14097
13734
|
|
|
14098
13735
|
/**
|
|
@@ -15067,6 +14704,7 @@ function ngShowDirective($animate) {
|
|
|
15067
14704
|
|
|
15068
14705
|
ngHideDirective.$inject = [$injectTokens._animate];
|
|
15069
14706
|
/**
|
|
14707
|
+
* @param {ng.AnimateService} $animate
|
|
15070
14708
|
* @returns {ng.Directive}
|
|
15071
14709
|
*/
|
|
15072
14710
|
function ngHideDirective($animate) {
|
|
@@ -15264,9 +14902,9 @@ function ngIncludeDirective(
|
|
|
15264
14902
|
if (src) {
|
|
15265
14903
|
// set the 2nd param to true to ignore the template request error so that the inner
|
|
15266
14904
|
// contents and scope can be cleaned up.
|
|
15267
|
-
await $templateRequest(src
|
|
14905
|
+
await $templateRequest(src).then(
|
|
15268
14906
|
(response) => {
|
|
15269
|
-
if (scope
|
|
14907
|
+
if (scope._destroyed) return;
|
|
15270
14908
|
|
|
15271
14909
|
if (thisChangeId !== changeCounter) return;
|
|
15272
14910
|
const newScope = scope.$new();
|
|
@@ -15298,7 +14936,7 @@ function ngIncludeDirective(
|
|
|
15298
14936
|
scope.$eval(onloadExp);
|
|
15299
14937
|
},
|
|
15300
14938
|
(err) => {
|
|
15301
|
-
if (scope
|
|
14939
|
+
if (scope._destroyed) return;
|
|
15302
14940
|
|
|
15303
14941
|
if (thisChangeId === changeCounter) {
|
|
15304
14942
|
cleanupLastIncludeContent();
|
|
@@ -22436,7 +22074,7 @@ class RootScopeProvider {
|
|
|
22436
22074
|
*
|
|
22437
22075
|
* @param {Object} target - The object to be wrapped in a proxy.
|
|
22438
22076
|
* @param {Scope} [context] - The context for the handler, used to track listeners.
|
|
22439
|
-
* @returns {Scope} - A proxy that intercepts operations on the target object,
|
|
22077
|
+
* @returns {Scope|Object} - A proxy that intercepts operations on the target object,
|
|
22440
22078
|
* or the original value if the target is not an object.
|
|
22441
22079
|
*/
|
|
22442
22080
|
function createScope(target = {}, context) {
|
|
@@ -22492,7 +22130,8 @@ function isNonScope(target) {
|
|
|
22492
22130
|
target instanceof Promise ||
|
|
22493
22131
|
target instanceof HTMLCollection ||
|
|
22494
22132
|
target instanceof NodeList ||
|
|
22495
|
-
target instanceof Event
|
|
22133
|
+
target instanceof Event ||
|
|
22134
|
+
target instanceof Date
|
|
22496
22135
|
) {
|
|
22497
22136
|
return true;
|
|
22498
22137
|
}
|
|
@@ -22527,20 +22166,17 @@ class Scope {
|
|
|
22527
22166
|
/** @type {Map<string, Array<import('./interface.ts').Listener>>} Watch listeners */
|
|
22528
22167
|
this.watchers = context ? context.watchers : new Map();
|
|
22529
22168
|
|
|
22530
|
-
/** @type {Map<String, Function[]>} Event listeners */
|
|
22531
|
-
this
|
|
22532
|
-
|
|
22533
|
-
/** @type {Map<string, Array<import('./interface.ts').Listener>>} Watch listeners from other proxies */
|
|
22534
|
-
this.foreignListeners = context ? context.foreignListeners : new Map();
|
|
22169
|
+
/** @private @type {Map<String, Function[]>} Event listeners */
|
|
22170
|
+
this._listeners = new Map();
|
|
22535
22171
|
|
|
22536
|
-
/** @type {
|
|
22537
|
-
this.
|
|
22172
|
+
/** @private @type {Map<string, Array<import('./interface.ts').Listener>>} Watch listeners from other proxies */
|
|
22173
|
+
this._foreignListeners = context ? context._foreignListeners : new Map();
|
|
22538
22174
|
|
|
22539
|
-
/** @type {
|
|
22540
|
-
this.
|
|
22175
|
+
/** @private @type {Set<Proxy<ng.Scope>>} */
|
|
22176
|
+
this._foreignProxies = context ? context._foreignProxies : new Set();
|
|
22541
22177
|
|
|
22542
|
-
/** @type {
|
|
22543
|
-
this.
|
|
22178
|
+
/** @private @type {WeakMap<Object, Array<string>>} */
|
|
22179
|
+
this._objectListeners = context ? context._objectListeners : new WeakMap();
|
|
22544
22180
|
|
|
22545
22181
|
/** @type {Proxy<Scope>} Current proxy being operated on */
|
|
22546
22182
|
this.$proxy = null;
|
|
@@ -22575,40 +22211,39 @@ class Scope {
|
|
|
22575
22211
|
? null
|
|
22576
22212
|
: context;
|
|
22577
22213
|
|
|
22578
|
-
|
|
22579
|
-
|
|
22580
|
-
/** @type {boolean} */
|
|
22581
|
-
this.$$destroyed = false;
|
|
22214
|
+
/** @ignore @type {boolean} */
|
|
22215
|
+
this._destroyed = false;
|
|
22582
22216
|
|
|
22583
|
-
|
|
22217
|
+
/** @private @type {import("./interface.ts").Listener[]} A list of scheduled Event listeners */
|
|
22218
|
+
this._scheduled = [];
|
|
22584
22219
|
|
|
22585
22220
|
this.$scopename = undefined;
|
|
22586
22221
|
|
|
22587
22222
|
/** @private */
|
|
22588
22223
|
this.propertyMap = {
|
|
22589
|
-
$watch: this.$watch.bind(this),
|
|
22590
|
-
$new: this.$new.bind(this),
|
|
22591
|
-
$newIsolate: this.$newIsolate.bind(this),
|
|
22592
|
-
$destroy: this.$destroy.bind(this),
|
|
22593
|
-
$flushQueue: this.$flushQueue.bind(this),
|
|
22594
|
-
$eval: this.$eval.bind(this),
|
|
22595
22224
|
$apply: this.$apply.bind(this),
|
|
22596
|
-
$postUpdate: this.$postUpdate.bind(this),
|
|
22597
|
-
$isRoot: this.#isRoot.bind(this),
|
|
22598
|
-
$on: this.$on.bind(this),
|
|
22599
|
-
$emit: this.$emit.bind(this),
|
|
22600
22225
|
$broadcast: this.$broadcast.bind(this),
|
|
22601
|
-
$
|
|
22226
|
+
$children: this.$children,
|
|
22227
|
+
$destroy: this.$destroy.bind(this),
|
|
22228
|
+
$emit: this.$emit.bind(this),
|
|
22229
|
+
$eval: this.$eval.bind(this),
|
|
22230
|
+
$flushQueue: this.$flushQueue.bind(this),
|
|
22231
|
+
$getById: this.$getById.bind(this),
|
|
22602
22232
|
$handler: /** @type {Scope} */ (this),
|
|
22233
|
+
$id: this.$id,
|
|
22234
|
+
$isRoot: this.#isRoot.bind(this),
|
|
22603
22235
|
$merge: this.$merge.bind(this),
|
|
22604
|
-
$
|
|
22605
|
-
$
|
|
22606
|
-
$
|
|
22236
|
+
$new: this.$new.bind(this),
|
|
22237
|
+
$newIsolate: this.$newIsolate.bind(this),
|
|
22238
|
+
$on: this.$on.bind(this),
|
|
22607
22239
|
$parent: this.$parent,
|
|
22240
|
+
$postUpdate: this.$postUpdate.bind(this),
|
|
22241
|
+
$proxy: this.$proxy,
|
|
22608
22242
|
$root: this.$root,
|
|
22609
|
-
$children: this.$children,
|
|
22610
|
-
$id: this.$id,
|
|
22611
22243
|
$scopename: this.$scopename,
|
|
22244
|
+
$searchByName: this.$searchByName.bind(this),
|
|
22245
|
+
$transcluded: this.$transcluded.bind(this),
|
|
22246
|
+
$watch: this.$watch.bind(this),
|
|
22612
22247
|
};
|
|
22613
22248
|
}
|
|
22614
22249
|
|
|
@@ -22668,18 +22303,18 @@ class Scope {
|
|
|
22668
22303
|
this.#scheduleListener(listeners);
|
|
22669
22304
|
}
|
|
22670
22305
|
|
|
22671
|
-
const
|
|
22306
|
+
const _foreignListeners = this._foreignListeners.get(property);
|
|
22672
22307
|
|
|
22673
|
-
if (
|
|
22674
|
-
this.#scheduleListener(
|
|
22308
|
+
if (_foreignListeners) {
|
|
22309
|
+
this.#scheduleListener(_foreignListeners);
|
|
22675
22310
|
}
|
|
22676
22311
|
}
|
|
22677
22312
|
|
|
22678
|
-
if (this.
|
|
22679
|
-
this.
|
|
22313
|
+
if (this._objectListeners.get(target[property])) {
|
|
22314
|
+
this._objectListeners.delete(target[property]);
|
|
22680
22315
|
}
|
|
22681
22316
|
target[property] = createScope(value, this);
|
|
22682
|
-
this.
|
|
22317
|
+
this._objectListeners.set(target[property], [property]);
|
|
22683
22318
|
|
|
22684
22319
|
return true;
|
|
22685
22320
|
}
|
|
@@ -22700,10 +22335,10 @@ class Scope {
|
|
|
22700
22335
|
this.#scheduleListener(listeners);
|
|
22701
22336
|
}
|
|
22702
22337
|
|
|
22703
|
-
const
|
|
22338
|
+
const _foreignListeners = this._foreignListeners.get(property);
|
|
22704
22339
|
|
|
22705
|
-
if (
|
|
22706
|
-
this.#scheduleListener(
|
|
22340
|
+
if (_foreignListeners) {
|
|
22341
|
+
this.#scheduleListener(_foreignListeners);
|
|
22707
22342
|
}
|
|
22708
22343
|
|
|
22709
22344
|
this.#checkeListenersForAllKeys(value);
|
|
@@ -22756,8 +22391,8 @@ class Scope {
|
|
|
22756
22391
|
}
|
|
22757
22392
|
|
|
22758
22393
|
if (isArray(target)) {
|
|
22759
|
-
if (this.
|
|
22760
|
-
const keyList = this.
|
|
22394
|
+
if (this._objectListeners.has(proxy) && property !== "length") {
|
|
22395
|
+
const keyList = this._objectListeners.get(proxy);
|
|
22761
22396
|
|
|
22762
22397
|
for (let i = 0, l = keyList.length; i < l; i++) {
|
|
22763
22398
|
const currentListeners = this.watchers.get(keyList[i]);
|
|
@@ -22773,7 +22408,7 @@ class Scope {
|
|
|
22773
22408
|
return true;
|
|
22774
22409
|
} else {
|
|
22775
22410
|
if (isUndefined(target[property]) && isProxy(value)) {
|
|
22776
|
-
this.
|
|
22411
|
+
this._foreignProxies.add(/** @type {Proxy<ng.Scope>} */ (value));
|
|
22777
22412
|
target[property] = value;
|
|
22778
22413
|
|
|
22779
22414
|
if (!this.watchers.has(property)) {
|
|
@@ -22794,8 +22429,8 @@ class Scope {
|
|
|
22794
22429
|
|
|
22795
22430
|
// Handle the case where we need to start observing object after a watcher has been set
|
|
22796
22431
|
if (isUndefined(oldValue) && isObject(target[property])) {
|
|
22797
|
-
if (!this.
|
|
22798
|
-
this.
|
|
22432
|
+
if (!this._objectListeners.has(target[property])) {
|
|
22433
|
+
this._objectListeners.set(target[property], [property]);
|
|
22799
22434
|
}
|
|
22800
22435
|
const keyList = keys(value);
|
|
22801
22436
|
|
|
@@ -22858,14 +22493,14 @@ class Scope {
|
|
|
22858
22493
|
});
|
|
22859
22494
|
}
|
|
22860
22495
|
|
|
22861
|
-
let
|
|
22496
|
+
let _foreignListeners = this._foreignListeners.get(property);
|
|
22862
22497
|
|
|
22863
|
-
if (!
|
|
22864
|
-
|
|
22498
|
+
if (!_foreignListeners && this.$parent?._foreignListeners) {
|
|
22499
|
+
_foreignListeners = this.$parent._foreignListeners.get(property);
|
|
22865
22500
|
}
|
|
22866
22501
|
|
|
22867
|
-
if (
|
|
22868
|
-
let scheduled =
|
|
22502
|
+
if (_foreignListeners) {
|
|
22503
|
+
let scheduled = _foreignListeners;
|
|
22869
22504
|
|
|
22870
22505
|
// filter for repeaters
|
|
22871
22506
|
const hashKey = this.$target._hashKey;
|
|
@@ -22873,8 +22508,8 @@ class Scope {
|
|
|
22873
22508
|
if (hashKey) {
|
|
22874
22509
|
scheduled = [];
|
|
22875
22510
|
|
|
22876
|
-
for (let i = 0, l =
|
|
22877
|
-
const listener =
|
|
22511
|
+
for (let i = 0, l = _foreignListeners.length; i < l; i++) {
|
|
22512
|
+
const listener = _foreignListeners[i];
|
|
22878
22513
|
|
|
22879
22514
|
if (listener.originalTarget._hashKey === hashKey) {
|
|
22880
22515
|
scheduled.push(listener);
|
|
@@ -22888,15 +22523,15 @@ class Scope {
|
|
|
22888
22523
|
}
|
|
22889
22524
|
}
|
|
22890
22525
|
|
|
22891
|
-
if (this.
|
|
22892
|
-
const keyList = this.
|
|
22526
|
+
if (this._objectListeners.has(proxy) && property !== "length") {
|
|
22527
|
+
const keyList = this._objectListeners.get(proxy);
|
|
22893
22528
|
|
|
22894
22529
|
for (let i = 0, l = keyList.length; i < l; i++) {
|
|
22895
22530
|
const key = keyList[i];
|
|
22896
22531
|
|
|
22897
22532
|
const listeners = this.watchers.get(key);
|
|
22898
22533
|
|
|
22899
|
-
if (listeners && this.
|
|
22534
|
+
if (listeners && this._scheduled !== listeners) {
|
|
22900
22535
|
this.#scheduleListener(listeners);
|
|
22901
22536
|
}
|
|
22902
22537
|
}
|
|
@@ -22936,8 +22571,8 @@ class Scope {
|
|
|
22936
22571
|
isArray(target) &&
|
|
22937
22572
|
["pop", "shift", "unshift"].includes(/** @type { string } */ (property))
|
|
22938
22573
|
) {
|
|
22939
|
-
if (this.
|
|
22940
|
-
const keyList = this.
|
|
22574
|
+
if (this._objectListeners.has(proxy)) {
|
|
22575
|
+
const keyList = this._objectListeners.get(proxy);
|
|
22941
22576
|
|
|
22942
22577
|
for (let i = 0, l = keyList.length; i < l; i++) {
|
|
22943
22578
|
const key = keyList[i];
|
|
@@ -22945,13 +22580,13 @@ class Scope {
|
|
|
22945
22580
|
const listeners = this.watchers.get(key);
|
|
22946
22581
|
|
|
22947
22582
|
if (listeners) {
|
|
22948
|
-
this.
|
|
22583
|
+
this._scheduled = listeners;
|
|
22949
22584
|
}
|
|
22950
22585
|
}
|
|
22951
22586
|
}
|
|
22952
22587
|
|
|
22953
22588
|
if (property === "unshift") {
|
|
22954
|
-
this.#scheduleListener(this.
|
|
22589
|
+
this.#scheduleListener(this._scheduled);
|
|
22955
22590
|
}
|
|
22956
22591
|
}
|
|
22957
22592
|
|
|
@@ -22976,8 +22611,8 @@ class Scope {
|
|
|
22976
22611
|
this.#scheduleListener(listeners);
|
|
22977
22612
|
}
|
|
22978
22613
|
|
|
22979
|
-
if (this.
|
|
22980
|
-
const keyList = this.
|
|
22614
|
+
if (this._objectListeners.has(this.$proxy)) {
|
|
22615
|
+
const keyList = this._objectListeners.get(this.$proxy);
|
|
22981
22616
|
|
|
22982
22617
|
for (let i = 0, l = keyList.length; i < l; i++) {
|
|
22983
22618
|
const key = keyList[i];
|
|
@@ -22988,9 +22623,9 @@ class Scope {
|
|
|
22988
22623
|
}
|
|
22989
22624
|
}
|
|
22990
22625
|
|
|
22991
|
-
if (this.
|
|
22992
|
-
this.#scheduleListener(this.
|
|
22993
|
-
this.
|
|
22626
|
+
if (this._scheduled) {
|
|
22627
|
+
this.#scheduleListener(this._scheduled);
|
|
22628
|
+
this._scheduled = [];
|
|
22994
22629
|
}
|
|
22995
22630
|
|
|
22996
22631
|
return true;
|
|
@@ -22998,8 +22633,8 @@ class Scope {
|
|
|
22998
22633
|
|
|
22999
22634
|
delete target[property];
|
|
23000
22635
|
|
|
23001
|
-
if (this.
|
|
23002
|
-
const keyList = this.
|
|
22636
|
+
if (this._objectListeners.has(this.$proxy)) {
|
|
22637
|
+
const keyList = this._objectListeners.get(this.$proxy);
|
|
23003
22638
|
|
|
23004
22639
|
for (let i = 0, l = keyList.length; i < l; i++) {
|
|
23005
22640
|
const key = keyList[i];
|
|
@@ -23241,7 +22876,7 @@ class Scope {
|
|
|
23241
22876
|
watchProp.split(".").slice(0, -1).join("."),
|
|
23242
22877
|
)(/** @type {Scope} */ (listener.originalTarget));
|
|
23243
22878
|
|
|
23244
|
-
if (potentialProxy && this.
|
|
22879
|
+
if (potentialProxy && this._foreignProxies.has(potentialProxy)) {
|
|
23245
22880
|
potentialProxy.$handler.#registerForeignKey(key, listener);
|
|
23246
22881
|
potentialProxy.$handler.#scheduleListener([listener]);
|
|
23247
22882
|
|
|
@@ -23324,7 +22959,7 @@ class Scope {
|
|
|
23324
22959
|
const listenerObject = listener.watchFn(this.$target);
|
|
23325
22960
|
|
|
23326
22961
|
if (isObject(listenerObject)) {
|
|
23327
|
-
this.
|
|
22962
|
+
this._objectListeners.set(listenerObject, [key]);
|
|
23328
22963
|
}
|
|
23329
22964
|
|
|
23330
22965
|
if (keySet.length > 0) {
|
|
@@ -23418,10 +23053,10 @@ class Scope {
|
|
|
23418
23053
|
|
|
23419
23054
|
/** @internal **/
|
|
23420
23055
|
#registerForeignKey(key, listener) {
|
|
23421
|
-
if (this.
|
|
23422
|
-
this.
|
|
23056
|
+
if (this._foreignListeners.has(key)) {
|
|
23057
|
+
this._foreignListeners.get(key).push(listener);
|
|
23423
23058
|
} else {
|
|
23424
|
-
this.
|
|
23059
|
+
this._foreignListeners.set(key, [listener]);
|
|
23425
23060
|
}
|
|
23426
23061
|
}
|
|
23427
23062
|
|
|
@@ -23446,7 +23081,7 @@ class Scope {
|
|
|
23446
23081
|
}
|
|
23447
23082
|
|
|
23448
23083
|
// #deregisterForeignKey(key, id) {
|
|
23449
|
-
// const listenerList = this.
|
|
23084
|
+
// const listenerList = this._foreignListeners.get(key);
|
|
23450
23085
|
// if (!listenerList) return false;
|
|
23451
23086
|
|
|
23452
23087
|
// const index = listenerList.findIndex((x) => x.id === id);
|
|
@@ -23454,9 +23089,9 @@ class Scope {
|
|
|
23454
23089
|
|
|
23455
23090
|
// listenerList.splice(index, 1);
|
|
23456
23091
|
// if (listenerList.length) {
|
|
23457
|
-
// this.
|
|
23092
|
+
// this._foreignListeners.set(key, listenerList);
|
|
23458
23093
|
// } else {
|
|
23459
|
-
// this.
|
|
23094
|
+
// this._foreignListeners.delete(key);
|
|
23460
23095
|
// }
|
|
23461
23096
|
// return true;
|
|
23462
23097
|
// }
|
|
@@ -23516,11 +23151,11 @@ class Scope {
|
|
|
23516
23151
|
* @returns {(function(): void)|*}
|
|
23517
23152
|
*/
|
|
23518
23153
|
$on(name, listener) {
|
|
23519
|
-
let namedListeners = this
|
|
23154
|
+
let namedListeners = this._listeners.get(name);
|
|
23520
23155
|
|
|
23521
23156
|
if (!namedListeners) {
|
|
23522
23157
|
namedListeners = [];
|
|
23523
|
-
this
|
|
23158
|
+
this._listeners.set(name, namedListeners);
|
|
23524
23159
|
}
|
|
23525
23160
|
namedListeners.push(listener);
|
|
23526
23161
|
|
|
@@ -23531,7 +23166,7 @@ class Scope {
|
|
|
23531
23166
|
namedListeners.splice(indexOfListener, 1);
|
|
23532
23167
|
|
|
23533
23168
|
if (namedListeners.length === 0) {
|
|
23534
|
-
this
|
|
23169
|
+
this._listeners.delete(name);
|
|
23535
23170
|
}
|
|
23536
23171
|
}
|
|
23537
23172
|
};
|
|
@@ -23567,7 +23202,7 @@ class Scope {
|
|
|
23567
23202
|
*/
|
|
23568
23203
|
#eventHelper({ name, event, broadcast }, ...args) {
|
|
23569
23204
|
if (!broadcast) {
|
|
23570
|
-
if (!this
|
|
23205
|
+
if (!this._listeners.has(name)) {
|
|
23571
23206
|
if (this.$parent) {
|
|
23572
23207
|
return this.$parent.$handler.#eventHelper(
|
|
23573
23208
|
{ name, event, broadcast },
|
|
@@ -23599,7 +23234,7 @@ class Scope {
|
|
|
23599
23234
|
|
|
23600
23235
|
const listenerArgs = concat([event], [event].concat(args), 1);
|
|
23601
23236
|
|
|
23602
|
-
const listeners = this
|
|
23237
|
+
const listeners = this._listeners.get(name);
|
|
23603
23238
|
|
|
23604
23239
|
if (listeners) {
|
|
23605
23240
|
let { length } = listeners;
|
|
@@ -23666,7 +23301,7 @@ class Scope {
|
|
|
23666
23301
|
}
|
|
23667
23302
|
|
|
23668
23303
|
$destroy() {
|
|
23669
|
-
if (this
|
|
23304
|
+
if (this._destroyed) return;
|
|
23670
23305
|
|
|
23671
23306
|
this.$broadcast("$destroy");
|
|
23672
23307
|
|
|
@@ -23697,8 +23332,8 @@ class Scope {
|
|
|
23697
23332
|
}
|
|
23698
23333
|
}
|
|
23699
23334
|
|
|
23700
|
-
this
|
|
23701
|
-
this
|
|
23335
|
+
this._listeners.clear();
|
|
23336
|
+
this._destroyed = true;
|
|
23702
23337
|
}
|
|
23703
23338
|
|
|
23704
23339
|
/**
|
|
@@ -23780,31 +23415,23 @@ class Scope {
|
|
|
23780
23415
|
* @returns {ng.Scope|undefined}
|
|
23781
23416
|
*/
|
|
23782
23417
|
$searchByName(name) {
|
|
23783
|
-
|
|
23784
|
-
* @param {ng.Scope} scope
|
|
23785
|
-
* @param {string} nameParam
|
|
23786
|
-
* @returns {ng.Scope|undefined}
|
|
23787
|
-
*/
|
|
23788
|
-
function getByName(scope, nameParam) {
|
|
23789
|
-
if (scope.$scopename === nameParam) {
|
|
23790
|
-
return scope;
|
|
23791
|
-
} else {
|
|
23792
|
-
let res = undefined;
|
|
23418
|
+
const stack = [this.$root];
|
|
23793
23419
|
|
|
23794
|
-
|
|
23795
|
-
|
|
23420
|
+
while (stack.length) {
|
|
23421
|
+
const scope = stack.pop();
|
|
23796
23422
|
|
|
23797
|
-
|
|
23798
|
-
|
|
23799
|
-
|
|
23800
|
-
}
|
|
23801
|
-
}
|
|
23423
|
+
if (scope.$scopename === name) {
|
|
23424
|
+
return scope;
|
|
23425
|
+
}
|
|
23802
23426
|
|
|
23803
|
-
|
|
23427
|
+
if (scope.$children?.length) {
|
|
23428
|
+
for (let i = scope.$children.length - 1; i >= 0; i--) {
|
|
23429
|
+
stack.push(scope.$children[i]);
|
|
23430
|
+
}
|
|
23804
23431
|
}
|
|
23805
23432
|
}
|
|
23806
23433
|
|
|
23807
|
-
return
|
|
23434
|
+
return undefined;
|
|
23808
23435
|
}
|
|
23809
23436
|
}
|
|
23810
23437
|
|
|
@@ -23856,146 +23483,65 @@ function collectChildIds(child) {
|
|
|
23856
23483
|
return ids;
|
|
23857
23484
|
}
|
|
23858
23485
|
|
|
23859
|
-
const $templateRequestMinErr = minErr("$templateRequest");
|
|
23860
|
-
|
|
23861
23486
|
/**
|
|
23862
|
-
*
|
|
23487
|
+
* Provider for the `$templateRequest` service.
|
|
23863
23488
|
*
|
|
23864
|
-
*
|
|
23865
|
-
*
|
|
23489
|
+
* Fetches templates via HTTP and caches them in `$templateCache`.
|
|
23490
|
+
* Templates are assumed trusted. This provider allows configuring
|
|
23491
|
+
* per-request `$http` options such as headers, timeout, or transform functions.
|
|
23866
23492
|
*/
|
|
23867
|
-
|
|
23868
|
-
|
|
23869
|
-
|
|
23870
|
-
/**
|
|
23871
|
-
* The options to be passed to the {@link $http} service when making the request.
|
|
23872
|
-
* You can use this to override options such as the "Accept" header for template requests.
|
|
23873
|
-
* The {@link $templateRequest} will set the `cache` and the `transformResponse` properties of the
|
|
23874
|
-
* options if not overridden here.
|
|
23875
|
-
*
|
|
23876
|
-
* @param {string=} val new value for the {@link $http} options.
|
|
23877
|
-
* @returns {string|TemplateRequestProvider} Returns the {@link $http} options when used as getter and self if used as setter.
|
|
23878
|
-
*/
|
|
23879
|
-
this.httpOptions = function (val) {
|
|
23880
|
-
if (val) {
|
|
23881
|
-
httpOptions = val;
|
|
23493
|
+
class TemplateRequestProvider {
|
|
23494
|
+
/** @type {ng.RequestShortcutConfig|undefined} */
|
|
23495
|
+
httpOptions;
|
|
23882
23496
|
|
|
23883
|
-
|
|
23884
|
-
|
|
23885
|
-
|
|
23886
|
-
return httpOptions;
|
|
23887
|
-
};
|
|
23888
|
-
|
|
23889
|
-
/**
|
|
23890
|
-
* The `$templateRequest` service runs security checks then downloads the provided template using
|
|
23891
|
-
* `$http` and, upon success, stores the contents inside of `$templateCache`. If the HTTP request
|
|
23892
|
-
* fails or the response data of the HTTP request is empty, a `$compile` error will be thrown (the
|
|
23893
|
-
* exception can be thwarted by setting the 2nd parameter of the function to true). Note that the
|
|
23894
|
-
* contents of `$templateCache` are trusted, so the call to `$sce.getTrustedUrl(tpl)` is omitted
|
|
23895
|
-
* when `tpl` is of type string and `$templateCache` has the matching entry.
|
|
23896
|
-
*
|
|
23897
|
-
* If you want to pass custom options to the `$http` service, such as setting the Accept header you
|
|
23898
|
-
* can configure this via {@link $templateRequestProvider#httpOptions}.
|
|
23899
|
-
*
|
|
23900
|
-
* `$templateRequest` is used internally by {@link $compile}, {@link ngRoute.$route}, and directives such
|
|
23901
|
-
* as {@link ngInclude} to download and cache templates.
|
|
23902
|
-
*
|
|
23903
|
-
* 3rd party modules should use `$templateRequest` if their services or directives are loading
|
|
23904
|
-
* templates.
|
|
23905
|
-
*
|
|
23906
|
-
* @param {string} tpl The HTTP request template URL
|
|
23907
|
-
* @param {boolean=} ignoreRequestError Whether or not to ignore the exception when the request fails or the template is empty
|
|
23908
|
-
*
|
|
23909
|
-
* @return {Promise} a promise for the HTTP response data of the given URL.
|
|
23910
|
-
*
|
|
23911
|
-
* @property {number} totalPendingRequests total amount of pending template requests being downloaded.
|
|
23912
|
-
*/
|
|
23913
|
-
this.$get = [
|
|
23914
|
-
$injectTokens._exceptionHandler,
|
|
23497
|
+
/** @returns {Array} DI tokens for Angular.ts injection */
|
|
23498
|
+
$get = [
|
|
23915
23499
|
$injectTokens._templateCache,
|
|
23916
23500
|
$injectTokens._http,
|
|
23917
|
-
$injectTokens._sce,
|
|
23918
23501
|
/**
|
|
23919
|
-
*
|
|
23920
|
-
* @param {ng.ExceptionHandlerService} $exceptionHandler
|
|
23921
23502
|
* @param {ng.TemplateCacheService} $templateCache
|
|
23922
23503
|
* @param {ng.HttpService} $http
|
|
23923
|
-
* @param {*} $sce
|
|
23924
23504
|
* @returns {ng.TemplateRequestService}
|
|
23925
23505
|
*/
|
|
23926
|
-
|
|
23927
|
-
|
|
23928
|
-
|
|
23929
|
-
|
|
23930
|
-
|
|
23931
|
-
|
|
23932
|
-
|
|
23933
|
-
|
|
23934
|
-
//
|
|
23935
|
-
|
|
23936
|
-
if (!isString(tpl) || !$templateCache.has(tpl)) {
|
|
23937
|
-
try {
|
|
23938
|
-
tpl = $sce.getTrustedResourceUrl(tpl);
|
|
23939
|
-
|
|
23940
|
-
if (!tpl) {
|
|
23941
|
-
return Promise.reject("Template not found");
|
|
23942
|
-
}
|
|
23943
|
-
} catch (err) {
|
|
23944
|
-
return Promise.reject(err.message);
|
|
23945
|
-
}
|
|
23946
|
-
}
|
|
23947
|
-
|
|
23948
|
-
let transformResponse =
|
|
23949
|
-
$http.defaults && $http.defaults.transformResponse;
|
|
23506
|
+
($templateCache, $http) => {
|
|
23507
|
+
/**
|
|
23508
|
+
* Fetch a template via HTTP and cache it.
|
|
23509
|
+
*
|
|
23510
|
+
* @param {string} templateUrl URL of the template
|
|
23511
|
+
* @returns {Promise<string>} Resolves with template content
|
|
23512
|
+
*/
|
|
23513
|
+
const fetchTemplate = (templateUrl) => {
|
|
23514
|
+
// Filter out default transformResponse for template requests
|
|
23515
|
+
let transformResponse = $http.defaults?.transformResponse ?? null;
|
|
23950
23516
|
|
|
23951
23517
|
if (isArray(transformResponse)) {
|
|
23952
|
-
transformResponse = transformResponse.filter(
|
|
23953
|
-
|
|
23954
|
-
|
|
23518
|
+
transformResponse = transformResponse.filter(
|
|
23519
|
+
(x) => x !== defaultHttpResponseTransform,
|
|
23520
|
+
);
|
|
23955
23521
|
} else if (transformResponse === defaultHttpResponseTransform) {
|
|
23956
23522
|
transformResponse = null;
|
|
23957
23523
|
}
|
|
23958
23524
|
|
|
23959
|
-
|
|
23960
|
-
|
|
23961
|
-
|
|
23962
|
-
|
|
23963
|
-
|
|
23964
|
-
|
|
23965
|
-
|
|
23966
|
-
|
|
23967
|
-
httpOptions,
|
|
23968
|
-
),
|
|
23969
|
-
)
|
|
23970
|
-
.finally(function () {
|
|
23971
|
-
handleRequestFn.totalPendingRequests--;
|
|
23972
|
-
})
|
|
23973
|
-
.then(function (response) {
|
|
23974
|
-
$templateCache.set(tpl, response.data);
|
|
23975
|
-
|
|
23976
|
-
return response.data;
|
|
23977
|
-
}, handleError);
|
|
23978
|
-
|
|
23979
|
-
function handleError(resp) {
|
|
23980
|
-
if (!ignoreRequestError) {
|
|
23981
|
-
resp = $templateRequestMinErr(
|
|
23982
|
-
"tpload",
|
|
23983
|
-
"Failed to load template: {0} (HTTP status: {1} {2})",
|
|
23984
|
-
tpl,
|
|
23985
|
-
resp.status,
|
|
23986
|
-
resp.statusText,
|
|
23987
|
-
);
|
|
23988
|
-
|
|
23989
|
-
$exceptionHandler(resp);
|
|
23990
|
-
}
|
|
23525
|
+
/** @type {ng.RequestShortcutConfig} */
|
|
23526
|
+
const config = extend(
|
|
23527
|
+
{
|
|
23528
|
+
cache: $templateCache,
|
|
23529
|
+
transformResponse,
|
|
23530
|
+
},
|
|
23531
|
+
this.httpOptions || {},
|
|
23532
|
+
);
|
|
23991
23533
|
|
|
23992
|
-
|
|
23993
|
-
|
|
23994
|
-
|
|
23534
|
+
return $http.get(templateUrl, config).then(
|
|
23535
|
+
(response) => {
|
|
23536
|
+
$templateCache.set(templateUrl, response.data);
|
|
23995
23537
|
|
|
23996
|
-
|
|
23538
|
+
return response.data;
|
|
23539
|
+
},
|
|
23540
|
+
(resp) => Promise.reject(resp),
|
|
23541
|
+
);
|
|
23542
|
+
};
|
|
23997
23543
|
|
|
23998
|
-
return
|
|
23544
|
+
return fetchTemplate;
|
|
23999
23545
|
},
|
|
24000
23546
|
];
|
|
24001
23547
|
}
|
|
@@ -24335,7 +23881,7 @@ function ngMessagesIncludeDirective($templateRequest, $compile) {
|
|
|
24335
23881
|
const src = attrs.ngMessagesInclude || attrs.src;
|
|
24336
23882
|
|
|
24337
23883
|
$templateRequest(src).then((html) => {
|
|
24338
|
-
if ($scope
|
|
23884
|
+
if ($scope._destroyed) return;
|
|
24339
23885
|
|
|
24340
23886
|
if (isString(html) && !html.trim()) ; else {
|
|
24341
23887
|
// Non-empty template - compile and link
|
|
@@ -38813,6 +38359,7 @@ ngChannelDirective.$inject = [$injectTokens._eventBus];
|
|
|
38813
38359
|
*/
|
|
38814
38360
|
function ngChannelDirective($eventBus) {
|
|
38815
38361
|
return {
|
|
38362
|
+
scope: false,
|
|
38816
38363
|
link: (scope, element, attrs) => {
|
|
38817
38364
|
const channel = attrs.ngChannel;
|
|
38818
38365
|
|
|
@@ -38827,6 +38374,8 @@ function ngChannelDirective($eventBus) {
|
|
|
38827
38374
|
}
|
|
38828
38375
|
} else if (isString(value)) {
|
|
38829
38376
|
element.innerHTML = value;
|
|
38377
|
+
} else {
|
|
38378
|
+
element.innerHTML = value.toString();
|
|
38830
38379
|
}
|
|
38831
38380
|
},
|
|
38832
38381
|
);
|
|
@@ -40361,7 +39910,7 @@ function registerNgModule(angular) {
|
|
|
40361
39910
|
ngScope: ngScopeDirective,
|
|
40362
39911
|
})
|
|
40363
39912
|
.directive({
|
|
40364
|
-
input:
|
|
39913
|
+
input: hiddenInputDirective,
|
|
40365
39914
|
ngAnimateSwap: ngAnimateSwapDirective,
|
|
40366
39915
|
ngAnimateChildren: $$AnimateChildrenDirective,
|
|
40367
39916
|
// aria directives
|
|
@@ -40454,9 +40003,12 @@ const STRICT_DI = "strict-di";
|
|
|
40454
40003
|
const moduleRegistry = {};
|
|
40455
40004
|
|
|
40456
40005
|
class Angular extends EventTarget {
|
|
40457
|
-
constructor() {
|
|
40006
|
+
constructor(submodule = false) {
|
|
40458
40007
|
super();
|
|
40459
40008
|
|
|
40009
|
+
/** @private @type {boolean} */
|
|
40010
|
+
this._submodule = submodule;
|
|
40011
|
+
|
|
40460
40012
|
/** @private @type {!Array<string|any>} */
|
|
40461
40013
|
this._bootsrappedModules = [];
|
|
40462
40014
|
|
|
@@ -40470,7 +40022,7 @@ class Angular extends EventTarget {
|
|
|
40470
40022
|
* @public
|
|
40471
40023
|
* @type {string} `version` from `package.json`
|
|
40472
40024
|
*/
|
|
40473
|
-
this.version = "0.15.
|
|
40025
|
+
this.version = "0.15.2"; //inserted via rollup plugin
|
|
40474
40026
|
|
|
40475
40027
|
/**
|
|
40476
40028
|
* Gets the controller instance for a given element, if exists. Defaults to "ngControllerController"
|
|
@@ -40500,7 +40052,9 @@ class Angular extends EventTarget {
|
|
|
40500
40052
|
/** @type {any} */ (this.$t)[i] = i;
|
|
40501
40053
|
});
|
|
40502
40054
|
|
|
40503
|
-
|
|
40055
|
+
if (!submodule) {
|
|
40056
|
+
window.angular = this;
|
|
40057
|
+
}
|
|
40504
40058
|
registerNgModule(this);
|
|
40505
40059
|
}
|
|
40506
40060
|
|