@angular/material-moment-adapter 7.0.3 → 7.2.0
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/bundles/material-moment-adapter.umd.js +9 -5
- package/bundles/material-moment-adapter.umd.js.map +1 -1
- package/bundles/material-moment-adapter.umd.min.js.map +1 -1
- package/esm2015/material-moment-adapter.js +9 -7
- package/esm2015/material-moment-adapter.js.map +1 -1
- package/esm5/material-moment-adapter.es5.js +11 -7
- package/esm5/material-moment-adapter.es5.js.map +1 -1
- package/package.json +5 -5
|
@@ -44,13 +44,14 @@ function __extends(d, b) {
|
|
|
44
44
|
|
|
45
45
|
/**
|
|
46
46
|
* @fileoverview added by tsickle
|
|
47
|
-
* @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
|
|
47
|
+
* @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
48
48
|
*/
|
|
49
49
|
/** @type {?} */
|
|
50
50
|
var moment = _rollupMoment__default__default || _rollupMoment__default;
|
|
51
|
-
/**
|
|
51
|
+
/**
|
|
52
52
|
* InjectionToken for moment date adapter to configure options.
|
|
53
|
-
|
|
53
|
+
* @type {?}
|
|
54
|
+
*/
|
|
54
55
|
var MAT_MOMENT_DATE_ADAPTER_OPTIONS = new core.InjectionToken('MAT_MOMENT_DATE_ADAPTER_OPTIONS', {
|
|
55
56
|
providedIn: 'root',
|
|
56
57
|
factory: MAT_MOMENT_DATE_ADAPTER_OPTIONS_FACTORY
|
|
@@ -425,13 +426,16 @@ var MomentDateAdapter = /** @class */ (function (_super) {
|
|
|
425
426
|
function () {
|
|
426
427
|
return moment.invalid();
|
|
427
428
|
};
|
|
429
|
+
/** Creates a Moment instance while respecting the current UTC settings. */
|
|
428
430
|
/**
|
|
429
431
|
* Creates a Moment instance while respecting the current UTC settings.
|
|
432
|
+
* @private
|
|
430
433
|
* @param {...?} args
|
|
431
434
|
* @return {?}
|
|
432
435
|
*/
|
|
433
436
|
MomentDateAdapter.prototype._createMoment = /**
|
|
434
437
|
* Creates a Moment instance while respecting the current UTC settings.
|
|
438
|
+
* @private
|
|
435
439
|
* @param {...?} args
|
|
436
440
|
* @return {?}
|
|
437
441
|
*/
|
|
@@ -455,7 +459,7 @@ var MomentDateAdapter = /** @class */ (function (_super) {
|
|
|
455
459
|
|
|
456
460
|
/**
|
|
457
461
|
* @fileoverview added by tsickle
|
|
458
|
-
* @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
|
|
462
|
+
* @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
459
463
|
*/
|
|
460
464
|
|
|
461
465
|
/** @type {?} */
|
|
@@ -473,7 +477,7 @@ var MAT_MOMENT_DATE_FORMATS = {
|
|
|
473
477
|
|
|
474
478
|
/**
|
|
475
479
|
* @fileoverview added by tsickle
|
|
476
|
-
* @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
|
|
480
|
+
* @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
477
481
|
*/
|
|
478
482
|
var MomentDateModule = /** @class */ (function () {
|
|
479
483
|
function MomentDateModule() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"material-moment-adapter.umd.js","sources":["../../src/material-moment-adapter/adapter/index.ts","../../src/material-moment-adapter/adapter/moment-date-formats.ts","../../src/material-moment-adapter/adapter/moment-date-adapter.ts","../../node_modules/tslib/tslib.es6.js"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {NgModule} from '@angular/core';\nimport {DateAdapter, MAT_DATE_FORMATS, MAT_DATE_LOCALE} from '@angular/material/core';\nimport {MAT_MOMENT_DATE_ADAPTER_OPTIONS, MomentDateAdapter} from './moment-date-adapter';\nimport {MAT_MOMENT_DATE_FORMATS} from './moment-date-formats';\n\nexport * from './moment-date-adapter';\nexport * from './moment-date-formats';\n\n@NgModule({\n providers: [\n {\n provide: DateAdapter,\n useClass: MomentDateAdapter,\n deps: [MAT_DATE_LOCALE, MAT_MOMENT_DATE_ADAPTER_OPTIONS]\n }\n ],\n})\nexport class MomentDateModule {}\n\n\n@NgModule({\n imports: [MomentDateModule],\n providers: [{provide: MAT_DATE_FORMATS, useValue: MAT_MOMENT_DATE_FORMATS}],\n})\nexport class MatMomentDateModule {}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {MatDateFormats} from '@angular/material/core';\n\n\nexport const MAT_MOMENT_DATE_FORMATS: MatDateFormats = {\n parse: {\n dateInput: 'l',\n },\n display: {\n dateInput: 'l',\n monthYearLabel: 'MMM YYYY',\n dateA11yLabel: 'LL',\n monthYearA11yLabel: 'MMMM YYYY',\n },\n};\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Inject, Injectable, Optional, InjectionToken} from '@angular/core';\nimport {DateAdapter, MAT_DATE_LOCALE} from '@angular/material/core';\n// Depending on whether rollup is used, moment needs to be imported differently.\n// Since Moment.js doesn't have a default export, we normally need to import using the `* as`\n// syntax. However, rollup creates a synthetic default module and we thus need to import it using\n// the `default as` syntax.\n// TODO(mmalerba): See if we can clean this up at some point.\nimport * as _moment from 'moment';\n// tslint:disable-next-line:no-duplicate-imports\nimport {default as _rollupMoment, Moment} from 'moment';\n\nconst moment = _rollupMoment || _moment;\n\n/** Configurable options for {@see MomentDateAdapter}. */\nexport interface MatMomentDateAdapterOptions {\n /**\n * Turns the use of utc dates on or off.\n * Changing this will change how Angular Material components like DatePicker output dates.\n * {@default false}\n */\n useUtc: boolean;\n}\n\n/** InjectionToken for moment date adapter to configure options. */\nexport const MAT_MOMENT_DATE_ADAPTER_OPTIONS = new InjectionToken<MatMomentDateAdapterOptions>(\n 'MAT_MOMENT_DATE_ADAPTER_OPTIONS', {\n providedIn: 'root',\n factory: MAT_MOMENT_DATE_ADAPTER_OPTIONS_FACTORY\n});\n\n\n/** @docs-private */\nexport function MAT_MOMENT_DATE_ADAPTER_OPTIONS_FACTORY(): MatMomentDateAdapterOptions {\n return {\n useUtc: false\n };\n}\n\n\n/** Creates an array and fills it with values. */\nfunction range<T>(length: number, valueFunction: (index: number) => T): T[] {\n const valuesArray = Array(length);\n for (let i = 0; i < length; i++) {\n valuesArray[i] = valueFunction(i);\n }\n return valuesArray;\n}\n\n\n/** Adapts Moment.js Dates for use with Angular Material. */\n@Injectable()\nexport class MomentDateAdapter extends DateAdapter<Moment> {\n // Note: all of the methods that accept a `Moment` input parameter immediately call `this.clone`\n // on it. This is to ensure that we're working with a `Moment` that has the correct locale setting\n // while avoiding mutating the original object passed to us. Just calling `.locale(...)` on the\n // input would mutate the object.\n\n private _localeData: {\n firstDayOfWeek: number,\n longMonths: string[],\n shortMonths: string[],\n dates: string[],\n longDaysOfWeek: string[],\n shortDaysOfWeek: string[],\n narrowDaysOfWeek: string[]\n };\n\n constructor(@Optional() @Inject(MAT_DATE_LOCALE) dateLocale: string,\n @Optional() @Inject(MAT_MOMENT_DATE_ADAPTER_OPTIONS)\n private options?: MatMomentDateAdapterOptions) {\n\n super();\n this.setLocale(dateLocale || moment.locale());\n }\n\n setLocale(locale: string) {\n super.setLocale(locale);\n\n let momentLocaleData = moment.localeData(locale);\n this._localeData = {\n firstDayOfWeek: momentLocaleData.firstDayOfWeek(),\n longMonths: momentLocaleData.months(),\n shortMonths: momentLocaleData.monthsShort(),\n dates: range(31, (i) => this.createDate(2017, 0, i + 1).format('D')),\n longDaysOfWeek: momentLocaleData.weekdays(),\n shortDaysOfWeek: momentLocaleData.weekdaysShort(),\n narrowDaysOfWeek: momentLocaleData.weekdaysMin(),\n };\n }\n\n getYear(date: Moment): number {\n return this.clone(date).year();\n }\n\n getMonth(date: Moment): number {\n return this.clone(date).month();\n }\n\n getDate(date: Moment): number {\n return this.clone(date).date();\n }\n\n getDayOfWeek(date: Moment): number {\n return this.clone(date).day();\n }\n\n getMonthNames(style: 'long' | 'short' | 'narrow'): string[] {\n // Moment.js doesn't support narrow month names, so we just use short if narrow is requested.\n return style == 'long' ? this._localeData.longMonths : this._localeData.shortMonths;\n }\n\n getDateNames(): string[] {\n return this._localeData.dates;\n }\n\n getDayOfWeekNames(style: 'long' | 'short' | 'narrow'): string[] {\n if (style == 'long') {\n return this._localeData.longDaysOfWeek;\n }\n if (style == 'short') {\n return this._localeData.shortDaysOfWeek;\n }\n return this._localeData.narrowDaysOfWeek;\n }\n\n getYearName(date: Moment): string {\n return this.clone(date).format('YYYY');\n }\n\n getFirstDayOfWeek(): number {\n return this._localeData.firstDayOfWeek;\n }\n\n getNumDaysInMonth(date: Moment): number {\n return this.clone(date).daysInMonth();\n }\n\n clone(date: Moment): Moment {\n return date.clone().locale(this.locale);\n }\n\n createDate(year: number, month: number, date: number): Moment {\n // Moment.js will create an invalid date if any of the components are out of bounds, but we\n // explicitly check each case so we can throw more descriptive errors.\n if (month < 0 || month > 11) {\n throw Error(`Invalid month index \"${month}\". Month index has to be between 0 and 11.`);\n }\n\n if (date < 1) {\n throw Error(`Invalid date \"${date}\". Date has to be greater than 0.`);\n }\n\n const result = this._createMoment({year, month, date}).locale(this.locale);\n\n // If the result isn't valid, the date must have been out of bounds for this month.\n if (!result.isValid()) {\n throw Error(`Invalid date \"${date}\" for month with index \"${month}\".`);\n }\n\n return result;\n }\n\n today(): Moment {\n return this._createMoment().locale(this.locale);\n }\n\n parse(value: any, parseFormat: string | string[]): Moment | null {\n if (value && typeof value == 'string') {\n return this._createMoment(value, parseFormat, this.locale);\n }\n return value ? this._createMoment(value).locale(this.locale) : null;\n }\n\n format(date: Moment, displayFormat: string): string {\n date = this.clone(date);\n if (!this.isValid(date)) {\n throw Error('MomentDateAdapter: Cannot format invalid date.');\n }\n return date.format(displayFormat);\n }\n\n addCalendarYears(date: Moment, years: number): Moment {\n return this.clone(date).add({years});\n }\n\n addCalendarMonths(date: Moment, months: number): Moment {\n return this.clone(date).add({months});\n }\n\n addCalendarDays(date: Moment, days: number): Moment {\n return this.clone(date).add({days});\n }\n\n toIso8601(date: Moment): string {\n return this.clone(date).format();\n }\n\n /**\n * Returns the given value if given a valid Moment or null. Deserializes valid ISO 8601 strings\n * (https://www.ietf.org/rfc/rfc3339.txt) and valid Date objects into valid Moments and empty\n * string into null. Returns an invalid date for all other values.\n */\n deserialize(value: any): Moment | null {\n let date;\n if (value instanceof Date) {\n date = this._createMoment(value);\n }\n if (typeof value === 'string') {\n if (!value) {\n return null;\n }\n date = this._createMoment(value, moment.ISO_8601).locale(this.locale);\n }\n if (date && this.isValid(date)) {\n return date;\n }\n return super.deserialize(value);\n }\n\n isDateInstance(obj: any): boolean {\n return moment.isMoment(obj);\n }\n\n isValid(date: Moment): boolean {\n return this.clone(date).isValid();\n }\n\n invalid(): Moment {\n return moment.invalid();\n }\n\n /** Creates a Moment instance while respecting the current UTC settings. */\n private _createMoment(...args: any[]): Moment {\n return (this.options && this.options.useUtc) ? moment.utc(...args) : moment(...args);\n }\n}\n","/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation. All rights reserved.\r\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use\r\nthis file except in compliance with the License. You may obtain a copy of the\r\nLicense at http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\r\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\r\nMERCHANTABLITY OR NON-INFRINGEMENT.\r\n\r\nSee the Apache Version 2.0 License for specific language governing permissions\r\nand limitations under the License.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0)\r\n t[p[i]] = s[p[i]];\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport function __exportStar(m, exports) {\r\n for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];\r\n}\r\n\r\nexport function __values(o) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator], i = 0;\r\n if (m) return m.call(o);\r\n return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];\r\n result.default = mod;\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n"],"names":["MAT_DATE_FORMATS","NgModule","MAT_DATE_LOCALE","DateAdapter","Optional","Inject","Injectable","tslib_1.__extends","InjectionToken","_rollupMoment","_moment"],"mappings":";;;;;;;;;;;;;;;AGAA;;;;;;;;;;;;;;;;AAgBA,IAAI,aAAa,GAAG,SAAS,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AA,EAAA,CAAwB,+BAA+B,EAAvD,EAAA,CAAA,EAAA;;IA5EA,OAAA,iBAAA,CAAA;CA2DA,CAAuCF,kBAAW,CAAlD,CAAA,CAAA;;;;;;;;ADhDA,AAAA,IAAa,uBAAuB,GAAmB;IACrD,KAAK,EAAE;QACL,SAAS,EAAE,GAAG;KACf;IACD,OAAO,EAAE;QACP,SAAS,EAAE,GAAG;QACd,cAAc,EAAE,UAAU;QAC1B,aAAa,EAAE,IAAI;QACnB,kBAAkB,EAAE,WAAW;KAChC;CACF,CAAD;;;;;;;;;;QDLA,EAAA,IAAA,EAACF,aAAQ,EAAT,IAAA,EAAA,CAAU;oBACR,SAAS,EAAE;wBACT;4BACE,OAAO,EAAEE,kBAAW;4BACpB,QAAQ,EAAE,iBAAiB;4BAC3B,IAAI,EAAE,CAACD,sBAAe,EAAE,+BAA+B,CAAC;yBACzD;qBACF;iBACF,EAAD,EAAA;;IAxBA,OAAA,gBAAA,CAAA;;AAyBA,IAKA,EAAA,GAAoD,uBAAuB,CAA3E;;;;;QAFA,EAAA,IAAA,EAACD,aAAQ,EAAT,IAAA,EAAA,CAAU;oBACR,OAAO,EAAE,CAAC,gBAAgB,CAAC;oBAC3B,SAAS,EAAE,CAAC,EAAC,OAAO,EAAED,uBAAgB,EAAE,QAAQ,EAAlD,EAA2E,EAAC,CAAC;iBAC5E,EAAD,EAAA;;IA/BA,OAAA,mBAAA,CAAA;;;;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"material-moment-adapter.umd.js","sources":["../../src/material-moment-adapter/adapter/index.ts","../../src/material-moment-adapter/adapter/moment-date-formats.ts","../../src/material-moment-adapter/adapter/moment-date-adapter.ts","../../node_modules/tslib/tslib.es6.js"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {NgModule} from '@angular/core';\nimport {DateAdapter, MAT_DATE_FORMATS, MAT_DATE_LOCALE} from '@angular/material/core';\nimport {MAT_MOMENT_DATE_ADAPTER_OPTIONS, MomentDateAdapter} from './moment-date-adapter';\nimport {MAT_MOMENT_DATE_FORMATS} from './moment-date-formats';\n\nexport * from './moment-date-adapter';\nexport * from './moment-date-formats';\n\n@NgModule({\n providers: [\n {\n provide: DateAdapter,\n useClass: MomentDateAdapter,\n deps: [MAT_DATE_LOCALE, MAT_MOMENT_DATE_ADAPTER_OPTIONS]\n }\n ],\n})\nexport class MomentDateModule {}\n\n\n@NgModule({\n imports: [MomentDateModule],\n providers: [{provide: MAT_DATE_FORMATS, useValue: MAT_MOMENT_DATE_FORMATS}],\n})\nexport class MatMomentDateModule {}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {MatDateFormats} from '@angular/material/core';\n\n\nexport const MAT_MOMENT_DATE_FORMATS: MatDateFormats = {\n parse: {\n dateInput: 'l',\n },\n display: {\n dateInput: 'l',\n monthYearLabel: 'MMM YYYY',\n dateA11yLabel: 'LL',\n monthYearA11yLabel: 'MMMM YYYY',\n },\n};\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Inject, Injectable, Optional, InjectionToken} from '@angular/core';\nimport {DateAdapter, MAT_DATE_LOCALE} from '@angular/material/core';\n// Depending on whether rollup is used, moment needs to be imported differently.\n// Since Moment.js doesn't have a default export, we normally need to import using the `* as`\n// syntax. However, rollup creates a synthetic default module and we thus need to import it using\n// the `default as` syntax.\n// TODO(mmalerba): See if we can clean this up at some point.\nimport * as _moment from 'moment';\n// tslint:disable-next-line:no-duplicate-imports\nimport {default as _rollupMoment, Moment} from 'moment';\n\nconst moment = _rollupMoment || _moment;\n\n/** Configurable options for {@see MomentDateAdapter}. */\nexport interface MatMomentDateAdapterOptions {\n /**\n * Turns the use of utc dates on or off.\n * Changing this will change how Angular Material components like DatePicker output dates.\n * {@default false}\n */\n useUtc: boolean;\n}\n\n/** InjectionToken for moment date adapter to configure options. */\nexport const MAT_MOMENT_DATE_ADAPTER_OPTIONS = new InjectionToken<MatMomentDateAdapterOptions>(\n 'MAT_MOMENT_DATE_ADAPTER_OPTIONS', {\n providedIn: 'root',\n factory: MAT_MOMENT_DATE_ADAPTER_OPTIONS_FACTORY\n});\n\n\n/** @docs-private */\nexport function MAT_MOMENT_DATE_ADAPTER_OPTIONS_FACTORY(): MatMomentDateAdapterOptions {\n return {\n useUtc: false\n };\n}\n\n\n/** Creates an array and fills it with values. */\nfunction range<T>(length: number, valueFunction: (index: number) => T): T[] {\n const valuesArray = Array(length);\n for (let i = 0; i < length; i++) {\n valuesArray[i] = valueFunction(i);\n }\n return valuesArray;\n}\n\n\n/** Adapts Moment.js Dates for use with Angular Material. */\n@Injectable()\nexport class MomentDateAdapter extends DateAdapter<Moment> {\n // Note: all of the methods that accept a `Moment` input parameter immediately call `this.clone`\n // on it. This is to ensure that we're working with a `Moment` that has the correct locale setting\n // while avoiding mutating the original object passed to us. Just calling `.locale(...)` on the\n // input would mutate the object.\n\n private _localeData: {\n firstDayOfWeek: number,\n longMonths: string[],\n shortMonths: string[],\n dates: string[],\n longDaysOfWeek: string[],\n shortDaysOfWeek: string[],\n narrowDaysOfWeek: string[]\n };\n\n constructor(@Optional() @Inject(MAT_DATE_LOCALE) dateLocale: string,\n @Optional() @Inject(MAT_MOMENT_DATE_ADAPTER_OPTIONS)\n private options?: MatMomentDateAdapterOptions) {\n\n super();\n this.setLocale(dateLocale || moment.locale());\n }\n\n setLocale(locale: string) {\n super.setLocale(locale);\n\n let momentLocaleData = moment.localeData(locale);\n this._localeData = {\n firstDayOfWeek: momentLocaleData.firstDayOfWeek(),\n longMonths: momentLocaleData.months(),\n shortMonths: momentLocaleData.monthsShort(),\n dates: range(31, (i) => this.createDate(2017, 0, i + 1).format('D')),\n longDaysOfWeek: momentLocaleData.weekdays(),\n shortDaysOfWeek: momentLocaleData.weekdaysShort(),\n narrowDaysOfWeek: momentLocaleData.weekdaysMin(),\n };\n }\n\n getYear(date: Moment): number {\n return this.clone(date).year();\n }\n\n getMonth(date: Moment): number {\n return this.clone(date).month();\n }\n\n getDate(date: Moment): number {\n return this.clone(date).date();\n }\n\n getDayOfWeek(date: Moment): number {\n return this.clone(date).day();\n }\n\n getMonthNames(style: 'long' | 'short' | 'narrow'): string[] {\n // Moment.js doesn't support narrow month names, so we just use short if narrow is requested.\n return style == 'long' ? this._localeData.longMonths : this._localeData.shortMonths;\n }\n\n getDateNames(): string[] {\n return this._localeData.dates;\n }\n\n getDayOfWeekNames(style: 'long' | 'short' | 'narrow'): string[] {\n if (style == 'long') {\n return this._localeData.longDaysOfWeek;\n }\n if (style == 'short') {\n return this._localeData.shortDaysOfWeek;\n }\n return this._localeData.narrowDaysOfWeek;\n }\n\n getYearName(date: Moment): string {\n return this.clone(date).format('YYYY');\n }\n\n getFirstDayOfWeek(): number {\n return this._localeData.firstDayOfWeek;\n }\n\n getNumDaysInMonth(date: Moment): number {\n return this.clone(date).daysInMonth();\n }\n\n clone(date: Moment): Moment {\n return date.clone().locale(this.locale);\n }\n\n createDate(year: number, month: number, date: number): Moment {\n // Moment.js will create an invalid date if any of the components are out of bounds, but we\n // explicitly check each case so we can throw more descriptive errors.\n if (month < 0 || month > 11) {\n throw Error(`Invalid month index \"${month}\". Month index has to be between 0 and 11.`);\n }\n\n if (date < 1) {\n throw Error(`Invalid date \"${date}\". Date has to be greater than 0.`);\n }\n\n const result = this._createMoment({year, month, date}).locale(this.locale);\n\n // If the result isn't valid, the date must have been out of bounds for this month.\n if (!result.isValid()) {\n throw Error(`Invalid date \"${date}\" for month with index \"${month}\".`);\n }\n\n return result;\n }\n\n today(): Moment {\n return this._createMoment().locale(this.locale);\n }\n\n parse(value: any, parseFormat: string | string[]): Moment | null {\n if (value && typeof value == 'string') {\n return this._createMoment(value, parseFormat, this.locale);\n }\n return value ? this._createMoment(value).locale(this.locale) : null;\n }\n\n format(date: Moment, displayFormat: string): string {\n date = this.clone(date);\n if (!this.isValid(date)) {\n throw Error('MomentDateAdapter: Cannot format invalid date.');\n }\n return date.format(displayFormat);\n }\n\n addCalendarYears(date: Moment, years: number): Moment {\n return this.clone(date).add({years});\n }\n\n addCalendarMonths(date: Moment, months: number): Moment {\n return this.clone(date).add({months});\n }\n\n addCalendarDays(date: Moment, days: number): Moment {\n return this.clone(date).add({days});\n }\n\n toIso8601(date: Moment): string {\n return this.clone(date).format();\n }\n\n /**\n * Returns the given value if given a valid Moment or null. Deserializes valid ISO 8601 strings\n * (https://www.ietf.org/rfc/rfc3339.txt) and valid Date objects into valid Moments and empty\n * string into null. Returns an invalid date for all other values.\n */\n deserialize(value: any): Moment | null {\n let date;\n if (value instanceof Date) {\n date = this._createMoment(value);\n }\n if (typeof value === 'string') {\n if (!value) {\n return null;\n }\n date = this._createMoment(value, moment.ISO_8601).locale(this.locale);\n }\n if (date && this.isValid(date)) {\n return date;\n }\n return super.deserialize(value);\n }\n\n isDateInstance(obj: any): boolean {\n return moment.isMoment(obj);\n }\n\n isValid(date: Moment): boolean {\n return this.clone(date).isValid();\n }\n\n invalid(): Moment {\n return moment.invalid();\n }\n\n /** Creates a Moment instance while respecting the current UTC settings. */\n private _createMoment(...args: any[]): Moment {\n return (this.options && this.options.useUtc) ? moment.utc(...args) : moment(...args);\n }\n}\n","/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation. All rights reserved.\r\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use\r\nthis file except in compliance with the License. You may obtain a copy of the\r\nLicense at http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\r\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\r\nMERCHANTABLITY OR NON-INFRINGEMENT.\r\n\r\nSee the Apache Version 2.0 License for specific language governing permissions\r\nand limitations under the License.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0)\r\n t[p[i]] = s[p[i]];\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport function __exportStar(m, exports) {\r\n for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];\r\n}\r\n\r\nexport function __values(o) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator], i = 0;\r\n if (m) return m.call(o);\r\n return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];\r\n result.default = mod;\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n"],"names":["MAT_DATE_FORMATS","NgModule","MAT_DATE_L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EAAD,EAAA;;IACkC,OAAlC,mBAAmC,CAAnC;CAAmC,EAAnC,CAAA;;;;;;;;;;;;;;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"material-moment-adapter.umd.min.js","sources":["../../node_modules/tslib/tslib.es6.js","../../src/material-moment-adapter/adapter/moment-date-adapter.ts","../../src/material-moment-adapter/adapter/moment-date-formats.ts","../../src/material-moment-adapter/adapter/index.ts"],"sourcesContent":["/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation. All rights reserved.\r\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use\r\nthis file except in compliance with the License. You may obtain a copy of the\r\nLicense at http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\r\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\r\nMERCHANTABLITY OR NON-INFRINGEMENT.\r\n\r\nSee the Apache Version 2.0 License for specific language governing permissions\r\nand limitations under the License.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0)\r\n t[p[i]] = s[p[i]];\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport function __exportStar(m, exports) {\r\n for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];\r\n}\r\n\r\nexport function __values(o) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator], i = 0;\r\n if (m) return m.call(o);\r\n return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];\r\n result.default = mod;\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Inject, Injectable, Optional, InjectionToken} from '@angular/core';\nimport {DateAdapter, MAT_DATE_LOCALE} from '@angular/material/core';\n// Depending on whether rollup is used, moment needs to be imported differently.\n// Since Moment.js doesn't have a default export, we normally need to import using the `* as`\n// syntax. However, rollup creates a synthetic default module and we thus need to import it using\n// the `default as` syntax.\n// TODO(mmalerba): See if we can clean this up at some point.\nimport * as _moment from 'moment';\n// tslint:disable-next-line:no-duplicate-imports\nimport {default as _rollupMoment, Moment} from 'moment';\n\nconst moment = _rollupMoment || _moment;\n\n/** Configurable options for {@see MomentDateAdapter}. */\nexport interface MatMomentDateAdapterOptions {\n /**\n * Turns the use of utc dates on or off.\n * Changing this will change how Angular Material components like DatePicker output dates.\n * {@default false}\n */\n useUtc: boolean;\n}\n\n/** InjectionToken for moment date adapter to configure options. */\nexport const MAT_MOMENT_DATE_ADAPTER_OPTIONS = new InjectionToken<MatMomentDateAdapterOptions>(\n 'MAT_MOMENT_DATE_ADAPTER_OPTIONS', {\n providedIn: 'root',\n factory: MAT_MOMENT_DATE_ADAPTER_OPTIONS_FACTORY\n});\n\n\n/** @docs-private */\nexport function MAT_MOMENT_DATE_ADAPTER_OPTIONS_FACTORY(): MatMomentDateAdapterOptions {\n return {\n useUtc: false\n };\n}\n\n\n/** Creates an array and fills it with values. */\nfunction range<T>(length: number, valueFunction: (index: number) => T): T[] {\n const valuesArray = Array(length);\n for (let i = 0; i < length; i++) {\n valuesArray[i] = valueFunction(i);\n }\n return valuesArray;\n}\n\n\n/** Adapts Moment.js Dates for use with Angular Material. */\n@Injectable()\nexport class MomentDateAdapter extends DateAdapter<Moment> {\n // Note: all of the methods that accept a `Moment` input parameter immediately call `this.clone`\n // on it. This is to ensure that we're working with a `Moment` that has the correct locale setting\n // while avoiding mutating the original object passed to us. Just calling `.locale(...)` on the\n // input would mutate the object.\n\n private _localeData: {\n firstDayOfWeek: number,\n longMonths: string[],\n shortMonths: string[],\n dates: string[],\n longDaysOfWeek: string[],\n shortDaysOfWeek: string[],\n narrowDaysOfWeek: string[]\n };\n\n constructor(@Optional() @Inject(MAT_DATE_LOCALE) dateLocale: string,\n @Optional() @Inject(MAT_MOMENT_DATE_ADAPTER_OPTIONS)\n private options?: MatMomentDateAdapterOptions) {\n\n super();\n this.setLocale(dateLocale || moment.locale());\n }\n\n setLocale(locale: string) {\n super.setLocale(locale);\n\n let momentLocaleData = moment.localeData(locale);\n this._localeData = {\n firstDayOfWeek: momentLocaleData.firstDayOfWeek(),\n longMonths: momentLocaleData.months(),\n shortMonths: momentLocaleData.monthsShort(),\n dates: range(31, (i) => this.createDate(2017, 0, i + 1).format('D')),\n longDaysOfWeek: momentLocaleData.weekdays(),\n shortDaysOfWeek: momentLocaleData.weekdaysShort(),\n narrowDaysOfWeek: momentLocaleData.weekdaysMin(),\n };\n }\n\n getYear(date: Moment): number {\n return this.clone(date).year();\n }\n\n getMonth(date: Moment): number {\n return this.clone(date).month();\n }\n\n getDate(date: Moment): number {\n return this.clone(date).date();\n }\n\n getDayOfWeek(date: Moment): number {\n return this.clone(date).day();\n }\n\n getMonthNames(style: 'long' | 'short' | 'narrow'): string[] {\n // Moment.js doesn't support narrow month names, so we just use short if narrow is requested.\n return style == 'long' ? this._localeData.longMonths : this._localeData.shortMonths;\n }\n\n getDateNames(): string[] {\n return this._localeData.dates;\n }\n\n getDayOfWeekNames(style: 'long' | 'short' | 'narrow'): string[] {\n if (style == 'long') {\n return this._localeData.longDaysOfWeek;\n }\n if (style == 'short') {\n return this._localeData.shortDaysOfWeek;\n }\n return this._localeData.narrowDaysOfWeek;\n }\n\n getYearName(date: Moment): string {\n return this.clone(date).format('YYYY');\n }\n\n getFirstDayOfWeek(): number {\n return this._localeData.firstDayOfWeek;\n }\n\n getNumDaysInMonth(date: Moment): number {\n return this.clone(date).daysInMonth();\n }\n\n clone(date: Moment): Moment {\n return date.clone().locale(this.locale);\n }\n\n createDate(year: number, month: number, date: number): Moment {\n // Moment.js will create an invalid date if any of the components are out of bounds, but we\n // explicitly check each case so we can throw more descriptive errors.\n if (month < 0 || month > 11) {\n throw Error(`Invalid month index \"${month}\". Month index has to be between 0 and 11.`);\n }\n\n if (date < 1) {\n throw Error(`Invalid date \"${date}\". Date has to be greater than 0.`);\n }\n\n const result = this._createMoment({year, month, date}).locale(this.locale);\n\n // If the result isn't valid, the date must have been out of bounds for this month.\n if (!result.isValid()) {\n throw Error(`Invalid date \"${date}\" for month with index \"${month}\".`);\n }\n\n return result;\n }\n\n today(): Moment {\n return this._createMoment().locale(this.locale);\n }\n\n parse(value: any, parseFormat: string | string[]): Moment | null {\n if (value && typeof value == 'string') {\n return this._createMoment(value, parseFormat, this.locale);\n }\n return value ? this._createMoment(value).locale(this.locale) : null;\n }\n\n format(date: Moment, displayFormat: string): string {\n date = this.clone(date);\n if (!this.isValid(date)) {\n throw Error('MomentDateAdapter: Cannot format invalid date.');\n }\n return date.format(displayFormat);\n }\n\n addCalendarYears(date: Moment, years: number): Moment {\n return this.clone(date).add({years});\n }\n\n addCalendarMonths(date: Moment, months: number): Moment {\n return this.clone(date).add({months});\n }\n\n addCalendarDays(date: Moment, days: number): Moment {\n return this.clone(date).add({days});\n }\n\n toIso8601(date: Moment): string {\n return this.clone(date).format();\n }\n\n /**\n * Returns the given value if given a valid Moment or null. Deserializes valid ISO 8601 strings\n * (https://www.ietf.org/rfc/rfc3339.txt) and valid Date objects into valid Moments and empty\n * string into null. Returns an invalid date for all other values.\n */\n deserialize(value: any): Moment | null {\n let date;\n if (value instanceof Date) {\n date = this._createMoment(value);\n }\n if (typeof value === 'string') {\n if (!value) {\n return null;\n }\n date = this._createMoment(value, moment.ISO_8601).locale(this.locale);\n }\n if (date && this.isValid(date)) {\n return date;\n }\n return super.deserialize(value);\n }\n\n isDateInstance(obj: any): boolean {\n return moment.isMoment(obj);\n }\n\n isValid(date: Moment): boolean {\n return this.clone(date).isValid();\n }\n\n invalid(): Moment {\n return moment.invalid();\n }\n\n /** Creates a Moment instance while respecting the current UTC settings. */\n private _createMoment(...args: any[]): Moment {\n return (this.options && this.options.useUtc) ? moment.utc(...args) : moment(...args);\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {MatDateFormats} from '@angular/material/core';\n\n\nexport const MAT_MOMENT_DATE_FORMATS: MatDateFormats = {\n parse: {\n dateInput: 'l',\n },\n display: {\n dateInput: 'l',\n monthYearLabel: 'MMM YYYY',\n dateA11yLabel: 'LL',\n monthYearA11yLabel: 'MMMM YYYY',\n },\n};\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {NgModule} from '@angular/core';\nimport {DateAdapter, MAT_DATE_FORMATS, MAT_DATE_LOCALE} from '@angular/material/core';\nimport {MAT_MOMENT_DATE_ADAPTER_OPTIONS, MomentDateAdapter} from './moment-date-adapter';\nimport {MAT_MOMENT_DATE_FORMATS} from './moment-date-formats';\n\nexport * from './moment-date-adapter';\nexport * from './moment-date-formats';\n\n@NgModule({\n providers: [\n {\n provide: DateAdapter,\n useClass: MomentDateAdapter,\n deps: [MAT_DATE_LOCALE, MAT_MOMENT_DATE_ADAPTER_OPTIONS]\n }\n ],\n})\nexport class MomentDateModule {}\n\n\n@NgModule({\n imports: [MomentDateModule],\n providers: [{provide: MAT_DATE_FORMATS, useValue: MAT_MOMENT_DATE_FORMATS}],\n})\nexport class MatMomentDateModule {}\n"],"names":["__extends","d","b","__","this","constructor","extendStatics","prototype","Object","create","MAT_MOMENT_DATE_ADAPTER_OPTIONS_FACTORY","useUtc","range","length","valueFunction","valuesArray","Array","i","setPrototypeOf","__proto__","p","hasOwnProperty","moment","_rollupMoment","_moment","MAT_MOMENT_DATE_ADAPTER_OPTIONS","InjectionToken","providedIn","factory","MomentDateAdapter","dateLocale","options","_this","_super","call","setLocale","locale","tslib_1.__extends","momentLocaleData","localeData","_localeData","firstDayOfWeek","longMonths","months","shortMonths","monthsShort","dates","createDate","format","longDaysOfWeek","weekdays","shortDaysOfWeek","weekdaysShort","narrowDaysOfWeek","weekdaysMin","getYear","date","clone","year","getMonth","month","getDate","getDayOfWeek","day","getMonthNames","style","getDateNames","getDayOfWeekNames","getYearName","getFirstDayOfWeek","getNumDaysInMonth","daysInMonth","Error","result","_createMoment","isValid","today","parse","value","parseFormat","displayFormat","addCalendarYears","years","add","addCalendarMonths","addCalendarDays","days","toIso8601","deserialize","Date","ISO_8601","isDateInstance","obj","isMoment","invalid","args","_i","arguments","utc","apply","type","Injectable","String","decorators","Optional","Inject","MAT_DATE_LOCALE","undefined","DateAdapter","MAT_MOMENT_DATE_FORMATS","dateInput","display","monthYearLabel","dateA11yLabel","monthYearA11yLabel","NgModule","providers","provide","useClass","deps","MomentDateModule","ɵ0","imports","MAT_DATE_FORMATS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uE,QAAQnB,GAChBA,EAEFvB,EAAX1B,UAAiBiF,YAAjBtD,KAAA9B,KAA6B0E,IAG3BjD,EAAFtB,UAAAoF,eAAE,SAAeC,GACb,MAAOtE,GAAOuE,SAASD,IAGzB/D,EAAFtB,UAAAoE,QAAE,SAAQnB,GACN,MAAOpD,MAAKqD,MAAMD,GAAMmB,WAG1B9C,EAAFtB,UAAAuF,QAAE,WACE,MAAOxE,GAAOwE,WAIRjE,EAAVtB,UAAAmE,yBAAA,IAAwB,GAAxBqB,MAAAC,EAAA,EAAwBA,EAAxBC,UAAApF,OAAwBmF,IAAAD,EAAxBC,GAAAC,UAAAD,EACI,OAAQ5F,MAAK2B,SAAW3B,KAAK2B,QAAQpB,OAAUW,EAAO4E,IAA1DC,MAAmD7E,EAAcyE,GAAQzE,EAAzE6E,UAAA,GAAmFJ,mBAvLnFK,KAACC,EAAAA,iDAiBDD,KAAAE,OAAAC,aAAAH,KAAeI,EAAAA,WAAfJ,KAA2BK,EAAAA,OAA3BV,MAAkCW,EAAAA,qBAClCN,SAAAO,GAAAJ,aAAAH,KAAKI,EAAAA,WAALJ,KAAiBK,EAAAA,OAAjBV,MAAwBtE,QA5ExBI,GA2DuC+E,EAAAA,aChD1BC,GACXhC,OACEiC,UAAW,KAEbC,SACED,UAAW,IACXE,eAAgB,WAChBC,cAAe,KACfC,mBAAoB,yCCnBxB,sBAgBAd,KAACe,EAAAA,SAADpB,OACEqB,YAEIC,QAAST,EAAAA,YACTU,SAAUzF,EACV0F,MAAOb,EAAAA,gBAAiBjF,SArB9B+F,KA8BAC,EAAoDZ,6BA9BpD,sBA4BAT,KAACe,EAAAA,SAADpB,OACE2B,SAAUF,GACVJ,YAAaC,QAASM,EAAAA,iBAAkBC,SAA1CH,QA9BAI"}
|
|
1
|
+
{"version":3,"file":"material-moment-adapter.umd.min.js","sources":["../../node_modules/tslib/tslib.es6.js","../../src/material-moment-adapter/adapter/moment-date-adapter.ts","../../src/material-moment-adapter/adapter/moment-date-formats.ts","../../src/material-moment-adapter/adapter/index.ts"],"sourcesContent":["/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation. All rights reserved.\r\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use\r\nthis file except in compliance with the License. You may obtain a copy of the\r\nLicense at http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\r\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\r\nMERCHANTABLITY OR NON-INFRINGEMENT.\r\n\r\nSee the Apache Version 2.0 License for specific language governing permissions\r\nand limitations under the License.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0)\r\n t[p[i]] = s[p[i]];\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport function __exportStar(m, exports) {\r\n for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];\r\n}\r\n\r\nexport function __values(o) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator], i = 0;\r\n if (m) return m.call(o);\r\n return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];\r\n result.default = mod;\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Inject, Injectable, Optional, InjectionToken} from '@angular/core';\nimport {DateAdapter, MAT_DATE_LOCALE} from '@angular/material/core';\n// Depending on whether rollup is used, moment needs to be imported differently.\n// Since Moment.js doesn't have a default export, we normally need to import using the `* as`\n// syntax. However, rollup creates a synthetic default module and we thus need to import it using\n// the `default as` syntax.\n// TODO(mmalerba): See if we can clean this up at some point.\nimport * as _moment from 'moment';\n// tslint:disable-next-line:no-duplicate-imports\nimport {default as _rollupMoment, Moment} from 'moment';\n\nconst moment = _rollupMoment || _moment;\n\n/** Configurable options for {@see MomentDateAdapter}. */\nexport interface MatMomentDateAdapterOptions {\n /**\n * Turns the use of utc dates on or off.\n * Changing this will change how Angular Material components like DatePicker output dates.\n * {@default false}\n */\n useUtc: boolean;\n}\n\n/** InjectionToken for moment date adapter to configure options. */\nexport const MAT_MOMENT_DATE_ADAPTER_OPTIONS = new InjectionToken<MatMomentDateAdapterOptions>(\n 'MAT_MOMENT_DATE_ADAPTER_OPTIONS', {\n providedIn: 'root',\n factory: MAT_MOMENT_DATE_ADAPTER_OPTIONS_FACTORY\n});\n\n\n/** @docs-private */\nexport function MAT_MOMENT_DATE_ADAPTER_OPTIONS_FACTORY(): MatMomentDateAdapterOptions {\n return {\n useUtc: false\n };\n}\n\n\n/** Creates an array and fills it with values. */\nfunction range<T>(length: number, valueFunction: (index: number) => T): T[] {\n const valuesArray = Array(length);\n for (let i = 0; i < length; i++) {\n valuesArray[i] = valueFunction(i);\n }\n return valuesArray;\n}\n\n\n/** Adapts Moment.js Dates for use with Angular Material. */\n@Injectable()\nexport class MomentDateAdapter extends DateAdapter<Moment> {\n // Note: all of the methods that accept a `Moment` input parameter immediately call `this.clone`\n // on it. This is to ensure that we're working with a `Moment` that has the correct locale setting\n // while avoiding mutating the original object passed to us. Just calling `.locale(...)` on the\n // input would mutate the object.\n\n private _localeData: {\n firstDayOfWeek: number,\n longMonths: string[],\n shortMonths: string[],\n dates: string[],\n longDaysOfWeek: string[],\n shortDaysOfWeek: string[],\n narrowDaysOfWeek: string[]\n };\n\n constructor(@Optional() @Inject(MAT_DATE_LOCALE) dateLocale: string,\n @Optional() @Inject(MAT_MOMENT_DATE_ADAPTER_OPTIONS)\n private options?: MatMomentDateAdapterOptions) {\n\n super();\n this.setLocale(dateLocale || moment.locale());\n }\n\n setLocale(locale: string) {\n super.setLocale(locale);\n\n let momentLocaleData = moment.localeData(locale);\n this._localeData = {\n firstDayOfWeek: momentLocaleData.firstDayOfWeek(),\n longMonths: momentLocaleData.months(),\n shortMonths: momentLocaleData.monthsShort(),\n dates: range(31, (i) => this.createDate(2017, 0, i + 1).format('D')),\n longDaysOfWeek: momentLocaleData.weekdays(),\n shortDaysOfWeek: momentLocaleData.weekdaysShort(),\n narrowDaysOfWeek: momentLocaleData.weekdaysMin(),\n };\n }\n\n getYear(date: Moment): number {\n return this.clone(date).year();\n }\n\n getMonth(date: Moment): number {\n return this.clone(date).month();\n }\n\n getDate(date: Moment): number {\n return this.clone(date).date();\n }\n\n getDayOfWeek(date: Moment): number {\n return this.clone(date).day();\n }\n\n getMonthNames(style: 'long' | 'short' | 'narrow'): string[] {\n // Moment.js doesn't support narrow month names, so we just use short if narrow is requested.\n return style == 'long' ? this._localeData.longMonths : this._localeData.shortMonths;\n }\n\n getDateNames(): string[] {\n return this._localeData.dates;\n }\n\n getDayOfWeekNames(style: 'long' | 'short' | 'narrow'): string[] {\n if (style == 'long') {\n return this._localeData.longDaysOfWeek;\n }\n if (style == 'short') {\n return this._localeData.shortDaysOfWeek;\n }\n return this._localeData.narrowDaysOfWeek;\n }\n\n getYearName(date: Moment): string {\n return this.clone(date).format('YYYY');\n }\n\n getFirstDayOfWeek(): number {\n return this._localeData.firstDayOfWeek;\n }\n\n getNumDaysInMonth(date: Moment): number {\n return this.clone(date).daysInMonth();\n }\n\n clone(date: Moment): Moment {\n return date.clone().locale(this.locale);\n }\n\n createDate(year: number, month: number, date: number): Moment {\n // Moment.js will create an invalid date if any of the components are out of bounds, but we\n // explicitly check each case so we can throw more descriptive errors.\n if (month < 0 || month > 11) {\n throw Error(`Invalid month index \"${month}\". Month index has to be between 0 and 11.`);\n }\n\n if (date < 1) {\n throw Error(`Invalid date \"${date}\". Date has to be greater than 0.`);\n }\n\n const result = this._createMoment({year, month, date}).locale(this.locale);\n\n // If the result isn't valid, the date must have been out of bounds for this month.\n if (!result.isValid()) {\n throw Error(`Invalid date \"${date}\" for month with index \"${month}\".`);\n }\n\n return result;\n }\n\n today(): Moment {\n return this._createMoment().locale(this.locale);\n }\n\n parse(value: any, parseFormat: string | string[]): Moment | null {\n if (value && typeof value == 'string') {\n return this._createMoment(value, parseFormat, this.locale);\n }\n return value ? this._createMoment(value).locale(this.locale) : null;\n }\n\n format(date: Moment, displayFormat: string): string {\n date = this.clone(date);\n if (!this.isValid(date)) {\n throw Error('MomentDateAdapter: Cannot format invalid date.');\n }\n return date.format(displayFormat);\n }\n\n addCalendarYears(date: Moment, years: number): Moment {\n return this.clone(date).add({years});\n }\n\n addCalendarMonths(date: Moment, months: number): Moment {\n return this.clone(date).add({months});\n }\n\n addCalendarDays(date: Moment, days: number): Moment {\n return this.clone(date).add({days});\n }\n\n toIso8601(date: Moment): string {\n return this.clone(date).format();\n }\n\n /**\n * Returns the given value if given a valid Moment or null. Deserializes valid ISO 8601 strings\n * (https://www.ietf.org/rfc/rfc3339.txt) and valid Date objects into valid Moments and empty\n * string into null. Returns an invalid date for all other values.\n */\n deserialize(value: any): Moment | null {\n let date;\n if (value instanceof Date) {\n date = this._createMoment(value);\n }\n if (typeof value === 'string') {\n if (!value) {\n return null;\n }\n date = this._createMoment(value, moment.ISO_8601).locale(this.locale);\n }\n if (date && this.isValid(date)) {\n return date;\n }\n return super.deserialize(value);\n }\n\n isDateInstance(obj: any): boolean {\n return moment.isMoment(obj);\n }\n\n isValid(date: Moment): boolean {\n return this.clone(date).isValid();\n }\n\n invalid(): Moment {\n return moment.invalid();\n }\n\n /** Creates a Moment instance while respecting the current UTC settings. */\n private _createMoment(...args: any[]): Moment {\n return (this.options && this.options.useUtc) ? moment.utc(...args) : moment(...args);\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {MatDateFormats} from '@angular/material/core';\n\n\nexport const MAT_MOMENT_DATE_FORMATS: MatDateFormats = {\n parse: {\n dateInput: 'l',\n },\n display: {\n dateInput: 'l',\n monthYearLabel: 'MMM YYYY',\n dateA11yLabel: 'LL',\n monthYearA11yLabel: 'MMMM YYYY',\n },\n};\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {NgModule} from '@angular/core';\nimport {DateAdapter, MAT_DATE_FORMATS, MAT_DATE_LOCALE} from '@angular/material/core';\nimport {MAT_MOMENT_DATE_ADAPTER_OPTIONS, MomentDateAdapter} from './moment-date-adapter';\nimport {MAT_MOMENT_DATE_FORMATS} from './moment-date-formats';\n\nexport * from './moment-date-adapter';\nexport * from './moment-date-formats';\n\n@NgModule({\n providers: [\n {\n provide: DateAdapter,\n useClass: MomentDateAdapter,\n deps: [MAT_DATE_LOCALE, MAT_MOMENT_DATE_ADAPTER_OPTIONS]\n }\n ],\n})\nexport class MomentDateModule {}\n\n\n@NgModule({\n imports: [MomentDateModule],\n providers: [{provide: MAT_DATE_FORMATS, useValue: MAT_MOMENT_DATE_FORMATS}],\n})\nexport class MatMomentDateModule {}\n"],"names":["__extends","d","b","__","this","constructor","extendStatics","prototype","Object","create","MAT_MOMENT_DATE_ADAPTER_OPTIONS_FACTORY","useUtc","range","length","valueFunction","valuesArray","Array","i","setPrototypeOf","__proto__","p","hasOwnProperty","moment","_rollupMoment","_moment","MAT_MOMENT_DATE_ADAPTER_OPTIONS","InjectionToken","providedIn","factory","MomentDateAdapter","_super","dateLocale","options","_this","call","setLocale","locale","tslib_1.__extends","momentLocaleData","localeData","_localeData","firstDayOfWeek","longMonths","months","shortMonths","monthsShort","dates","createDate","format","longDaysOfWeek","weekdays","shortDaysOfWeek","weekdaysShort","narrowDaysOfWeek","weekdaysMin","getYear","date","clone","year","getMonth","month","getDate","getDayOfWeek","day","getMonthNames","style","getDateNames","getDayOfWeekNames","getYearName","getFirstDayOfWeek","getNumDaysInMonth","daysInMonth","Error","result","_createMoment","isValid","today","parse","value","parseFormat","displayFormat","addCalendarYears","years","add","addCalendarMonths","addCalendarDays","days","toIso8601","deserialize","Date","ISO_8601","isDateInstance","obj","isMoment","invalid","args","_i","arguments","utc","apply","type","Injectable","String","decorators","Optional","Inject","MAT_DATE_LOCALE","undefined","DateAdapter","MAT_MOMENT_DATE_FORMATS","dateInput","display","monthYearLabel","dateA11yLabel","monthYearA11yLabel","MomentDateModule","NgModule","providers","provide","useClass","deps","ɵ0","MatMomentDateModule","imports","MAT_DATE_FORMATS","useValue"],"mappings":";;;;;;;6aAuBA,SAAgBA,GAAUC,EAAGC,GAEzB,QAASC,KAAOC,KAAKC,YAAcJ,EADnCK,EAAcL,EAAGC,GAEjBD,EAAEM,UAAkB,OAANL,EAAaM,OAAOC,OAAOP,IAAMC,EAAGI,UAAYL,EAAEK,UAAW,GAAIJ,ICcnF,QAAgBO,KACd,OACEC,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B9C,EAAFtB,UAAAuF,QAAE,WACE,MAAOxE,GAAOwE,WAIRjE,EAAVtB,UAAAmE,cAAE,WAAF,IAAwB,GAAxBqB,MAAAC,EAAA,EAAwBA,EAAxBC,UAAApF,OAAwBmF,IAAAD,EAAxBC,GAAAC,UAAAD,EACI,OAAQ5F,MAAK4B,SAAW5B,KAAK4B,QAAQrB,OAAUW,EAAO4E,IAA1DC,MAAmD7E,EAAcyE,GAAQzE,EAAzE6E,UAAA,GAAmFJ,mBAvLnFK,KAACC,EAAAA,iDAiBDD,KAAAE,OAAAC,aAAAH,KAAeI,EAAAA,WAAfJ,KAA2BK,EAAAA,OAA3BV,MAAkCW,EAAAA,qBAClCN,SAAAO,GAAAJ,aAAAH,KAAKI,EAAAA,WAALJ,KAAiBK,EAAAA,OAAjBV,MAAwBtE,QAuKxBI,GAxLuC+E,EAAAA,aChD1BC,GACXhC,OACEiC,UAAW,KAEbC,SACED,UAAW,IACXE,eAAgB,WAChBC,cAAe,KACfC,mBAAoB,cCHxBC,EAAA,WAAA,QAAAA,MAS+B,sBAT/Bf,KAACgB,EAAAA,SAADrB,OACEsB,YAEIC,QAASV,EAAAA,YACTW,SAAU1F,EACV2F,MAAOd,EAAAA,gBAAiBjF,SAI9B0F,KAKAM,EAAoDZ,EAFpDa,EAAA,WAAA,QAAAA,MAIkC,sBAJlCtB,KAACgB,EAAAA,SAADrB,OACE4B,SAAUR,GACVE,YAAaC,QAASM,EAAAA,iBAAkBC,SAA1CJ,QAEAC"}
|
|
@@ -12,13 +12,14 @@ import _rollupMoment__default, { } from 'moment';
|
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
14
|
* @fileoverview added by tsickle
|
|
15
|
-
* @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
|
|
15
|
+
* @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
16
16
|
*/
|
|
17
17
|
/** @type {?} */
|
|
18
18
|
const moment = _rollupMoment__default || _rollupMoment;
|
|
19
|
-
/**
|
|
19
|
+
/**
|
|
20
20
|
* InjectionToken for moment date adapter to configure options.
|
|
21
|
-
|
|
21
|
+
* @type {?}
|
|
22
|
+
*/
|
|
22
23
|
const MAT_MOMENT_DATE_ADAPTER_OPTIONS = new InjectionToken('MAT_MOMENT_DATE_ADAPTER_OPTIONS', {
|
|
23
24
|
providedIn: 'root',
|
|
24
25
|
factory: MAT_MOMENT_DATE_ADAPTER_OPTIONS_FACTORY
|
|
@@ -289,6 +290,7 @@ class MomentDateAdapter extends DateAdapter {
|
|
|
289
290
|
}
|
|
290
291
|
/**
|
|
291
292
|
* Creates a Moment instance while respecting the current UTC settings.
|
|
293
|
+
* @private
|
|
292
294
|
* @param {...?} args
|
|
293
295
|
* @return {?}
|
|
294
296
|
*/
|
|
@@ -307,7 +309,7 @@ MomentDateAdapter.ctorParameters = () => [
|
|
|
307
309
|
|
|
308
310
|
/**
|
|
309
311
|
* @fileoverview added by tsickle
|
|
310
|
-
* @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
|
|
312
|
+
* @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
311
313
|
*/
|
|
312
314
|
|
|
313
315
|
/** @type {?} */
|
|
@@ -325,7 +327,7 @@ const MAT_MOMENT_DATE_FORMATS = {
|
|
|
325
327
|
|
|
326
328
|
/**
|
|
327
329
|
* @fileoverview added by tsickle
|
|
328
|
-
* @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
|
|
330
|
+
* @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
329
331
|
*/
|
|
330
332
|
class MomentDateModule {
|
|
331
333
|
}
|
|
@@ -352,12 +354,12 @@ MatMomentDateModule.decorators = [
|
|
|
352
354
|
|
|
353
355
|
/**
|
|
354
356
|
* @fileoverview added by tsickle
|
|
355
|
-
* @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
|
|
357
|
+
* @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
356
358
|
*/
|
|
357
359
|
|
|
358
360
|
/**
|
|
359
361
|
* @fileoverview added by tsickle
|
|
360
|
-
* @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
|
|
362
|
+
* @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
361
363
|
*/
|
|
362
364
|
|
|
363
365
|
export { MomentDateModule, MatMomentDateModule, MAT_MOMENT_DATE_ADAPTER_OPTIONS_FACTORY, MAT_MOMENT_DATE_ADAPTER_OPTIONS, MomentDateAdapter, MAT_MOMENT_DATE_FORMATS };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"material-moment-adapter.js","sources":["../../src/material-moment-adapter/adapter/index.ts","../../src/material-moment-adapter/adapter/moment-date-formats.ts","../../src/material-moment-adapter/adapter/moment-date-adapter.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {NgModule} from '@angular/core';\nimport {DateAdapter, MAT_DATE_FORMATS, MAT_DATE_LOCALE} from '@angular/material/core';\nimport {MAT_MOMENT_DATE_ADAPTER_OPTIONS, MomentDateAdapter} from './moment-date-adapter';\nimport {MAT_MOMENT_DATE_FORMATS} from './moment-date-formats';\n\nexport * from './moment-date-adapter';\nexport * from './moment-date-formats';\n\n@NgModule({\n providers: [\n {\n provide: DateAdapter,\n useClass: MomentDateAdapter,\n deps: [MAT_DATE_LOCALE, MAT_MOMENT_DATE_ADAPTER_OPTIONS]\n }\n ],\n})\nexport class MomentDateModule {}\n\n\n@NgModule({\n imports: [MomentDateModule],\n providers: [{provide: MAT_DATE_FORMATS, useValue: MAT_MOMENT_DATE_FORMATS}],\n})\nexport class MatMomentDateModule {}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {MatDateFormats} from '@angular/material/core';\n\n\nexport const MAT_MOMENT_DATE_FORMATS: MatDateFormats = {\n parse: {\n dateInput: 'l',\n },\n display: {\n dateInput: 'l',\n monthYearLabel: 'MMM YYYY',\n dateA11yLabel: 'LL',\n monthYearA11yLabel: 'MMMM YYYY',\n },\n};\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Inject, Injectable, Optional, InjectionToken} from '@angular/core';\nimport {DateAdapter, MAT_DATE_LOCALE} from '@angular/material/core';\n// Depending on whether rollup is used, moment needs to be imported differently.\n// Since Moment.js doesn't have a default export, we normally need to import using the `* as`\n// syntax. However, rollup creates a synthetic default module and we thus need to import it using\n// the `default as` syntax.\n// TODO(mmalerba): See if we can clean this up at some point.\nimport * as _moment from 'moment';\n// tslint:disable-next-line:no-duplicate-imports\nimport {default as _rollupMoment, Moment} from 'moment';\n\nconst moment = _rollupMoment || _moment;\n\n/** Configurable options for {@see MomentDateAdapter}. */\nexport interface MatMomentDateAdapterOptions {\n /**\n * Turns the use of utc dates on or off.\n * Changing this will change how Angular Material components like DatePicker output dates.\n * {@default false}\n */\n useUtc: boolean;\n}\n\n/** InjectionToken for moment date adapter to configure options. */\nexport const MAT_MOMENT_DATE_ADAPTER_OPTIONS = new InjectionToken<MatMomentDateAdapterOptions>(\n 'MAT_MOMENT_DATE_ADAPTER_OPTIONS', {\n providedIn: 'root',\n factory: MAT_MOMENT_DATE_ADAPTER_OPTIONS_FACTORY\n});\n\n\n/** @docs-private */\nexport function MAT_MOMENT_DATE_ADAPTER_OPTIONS_FACTORY(): MatMomentDateAdapterOptions {\n return {\n useUtc: false\n };\n}\n\n\n/** Creates an array and fills it with values. */\nfunction range<T>(length: number, valueFunction: (index: number) => T): T[] {\n const valuesArray = Array(length);\n for (let i = 0; i < length; i++) {\n valuesArray[i] = valueFunction(i);\n }\n return valuesArray;\n}\n\n\n/** Adapts Moment.js Dates for use with Angular Material. */\n@Injectable()\nexport class MomentDateAdapter extends DateAdapter<Moment> {\n // Note: all of the methods that accept a `Moment` input parameter immediately call `this.clone`\n // on it. This is to ensure that we're working with a `Moment` that has the correct locale setting\n // while avoiding mutating the original object passed to us. Just calling `.locale(...)` on the\n // input would mutate the object.\n\n private _localeData: {\n firstDayOfWeek: number,\n longMonths: string[],\n shortMonths: string[],\n dates: string[],\n longDaysOfWeek: string[],\n shortDaysOfWeek: string[],\n narrowDaysOfWeek: string[]\n };\n\n constructor(@Optional() @Inject(MAT_DATE_LOCALE) dateLocale: string,\n @Optional() @Inject(MAT_MOMENT_DATE_ADAPTER_OPTIONS)\n private options?: MatMomentDateAdapterOptions) {\n\n super();\n this.setLocale(dateLocale || moment.locale());\n }\n\n setLocale(locale: string) {\n super.setLocale(locale);\n\n let momentLocaleData = moment.localeData(locale);\n this._localeData = {\n firstDayOfWeek: momentLocaleData.firstDayOfWeek(),\n longMonths: momentLocaleData.months(),\n shortMonths: momentLocaleData.monthsShort(),\n dates: range(31, (i) => this.createDate(2017, 0, i + 1).format('D')),\n longDaysOfWeek: momentLocaleData.weekdays(),\n shortDaysOfWeek: momentLocaleData.weekdaysShort(),\n narrowDaysOfWeek: momentLocaleData.weekdaysMin(),\n };\n }\n\n getYear(date: Moment): number {\n return this.clone(date).year();\n }\n\n getMonth(date: Moment): number {\n return this.clone(date).month();\n }\n\n getDate(date: Moment): number {\n return this.clone(date).date();\n }\n\n getDayOfWeek(date: Moment): number {\n return this.clone(date).day();\n }\n\n getMonthNames(style: 'long' | 'short' | 'narrow'): string[] {\n // Moment.js doesn't support narrow month names, so we just use short if narrow is requested.\n return style == 'long' ? this._localeData.longMonths : this._localeData.shortMonths;\n }\n\n getDateNames(): string[] {\n return this._localeData.dates;\n }\n\n getDayOfWeekNames(style: 'long' | 'short' | 'narrow'): string[] {\n if (style == 'long') {\n return this._localeData.longDaysOfWeek;\n }\n if (style == 'short') {\n return this._localeData.shortDaysOfWeek;\n }\n return this._localeData.narrowDaysOfWeek;\n }\n\n getYearName(date: Moment): string {\n return this.clone(date).format('YYYY');\n }\n\n getFirstDayOfWeek(): number {\n return this._localeData.firstDayOfWeek;\n }\n\n getNumDaysInMonth(date: Moment): number {\n return this.clone(date).daysInMonth();\n }\n\n clone(date: Moment): Moment {\n return date.clone().locale(this.locale);\n }\n\n createDate(year: number, month: number, date: number): Moment {\n // Moment.js will create an invalid date if any of the components are out of bounds, but we\n // explicitly check each case so we can throw more descriptive errors.\n if (month < 0 || month > 11) {\n throw Error(`Invalid month index \"${month}\". Month index has to be between 0 and 11.`);\n }\n\n if (date < 1) {\n throw Error(`Invalid date \"${date}\". Date has to be greater than 0.`);\n }\n\n const result = this._createMoment({year, month, date}).locale(this.locale);\n\n // If the result isn't valid, the date must have been out of bounds for this month.\n if (!result.isValid()) {\n throw Error(`Invalid date \"${date}\" for month with index \"${month}\".`);\n }\n\n return result;\n }\n\n today(): Moment {\n return this._createMoment().locale(this.locale);\n }\n\n parse(value: any, parseFormat: string | string[]): Moment | null {\n if (value && typeof value == 'string') {\n return this._createMoment(value, parseFormat, this.locale);\n }\n return value ? this._createMoment(value).locale(this.locale) : null;\n }\n\n format(date: Moment, displayFormat: string): string {\n date = this.clone(date);\n if (!this.isValid(date)) {\n throw Error('MomentDateAdapter: Cannot format invalid date.');\n }\n return date.format(displayFormat);\n }\n\n addCalendarYears(date: Moment, years: number): Moment {\n return this.clone(date).add({years});\n }\n\n addCalendarMonths(date: Moment, months: number): Moment {\n return this.clone(date).add({months});\n }\n\n addCalendarDays(date: Moment, days: number): Moment {\n return this.clone(date).add({days});\n }\n\n toIso8601(date: Moment): string {\n return this.clone(date).format();\n }\n\n /**\n * Returns the given value if given a valid Moment or null. Deserializes valid ISO 8601 strings\n * (https://www.ietf.org/rfc/rfc3339.txt) and valid Date objects into valid Moments and empty\n * string into null. Returns an invalid date for all other values.\n */\n deserialize(value: any): Moment | null {\n let date;\n if (value instanceof Date) {\n date = this._createMoment(value);\n }\n if (typeof value === 'string') {\n if (!value) {\n return null;\n }\n date = this._createMoment(value, moment.ISO_8601).locale(this.locale);\n }\n if (date && this.isValid(date)) {\n return date;\n }\n return super.deserialize(value);\n }\n\n isDateInstance(obj: any): boolean {\n return moment.isMoment(obj);\n }\n\n isValid(date: Moment): boolean {\n return this.clone(date).isValid();\n }\n\n invalid(): Moment {\n return moment.invalid();\n }\n\n /** Creates a Moment instance while respecting the current UTC settings. */\n private _createMoment(...args: any[]): Moment {\n return (this.options && this.options.useUtc) ? moment.utc(...args) : moment(...args);\n }\n}\n"],"names":["_rollupMoment","_moment"],"mappings":";;;;;;;;;;;;;;;;;AEmBA,MAAM,MAAM,GAAGA,sBAAa,IAAIC,aAAO,CAAC;;;;AAaxC,AAAA,MAAa,+BAA+B,GAAG,IAAI,cAAc,CAC/D,iCAAiC,EAAE;IACjC,UAAU,EAAE,MAAM;IAClB,OAAO,EAAE,uCAAuC;CACnD,CAAC,CAAC;;;;;AAIH,AAAA,SAAgB,uCAAuC,GAAvD;IACE,OAAO;QACL,MAAM,EAAE,KAAK;KACd,CAAC;CACH;;;;;;;;AAID,SAAS,KAAK,CAAI,MAAc,EAAE,aAAmC,EAArE;;IACE,MAAM,WAAW,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC;IAClC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,EAAE,CAAC,EAAE,EAAE;QAC/B,WAAW,CAAC,CAAC,CAAC,GAAG,aAAa,CAAC,CAAC,CAAC,CAAC;KACnC;IACD,OAAO,WAAW,CAAC;CACpB;;;;AAKD,AAAA,MAAa,iBAAkB,SAAQ,WAAmB,CAA1D;;;;;IAgBE,WAAF,CAAmD,UAAkB,EAEzD,OAAqC,EAFjD;QAII,KAAK,EAAE,CAAC;QAFA,IAAZ,CAAA,OAAmB,GAAP,OAAO,CAA8B;QAG7C,IAAI,CAAC,SAAS,CAAC,UAAU,IAA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,QAAQ,EAAlD,EAA2E,EAAC,CAAC;aAC5E,EAAD,EAAA;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"material-moment-adapter.js","sources":["../../src/material-moment-adapter/adapter/index.ts","../../src/material-moment-adapter/adapter/moment-date-formats.ts","../../src/material-moment-adapter/adapter/moment-date-adapter.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {NgModule} from '@angular/core';\nimport {DateAdapter, MAT_DATE_FORMATS, MAT_DATE_LOCALE} from '@angular/material/core';\nimport {MAT_MOMENT_DATE_ADAPTER_OPTIONS, MomentDateAdapter} from './moment-date-adapter';\nimport {MAT_MOMENT_DATE_FORMATS} from './moment-date-formats';\n\nexport * from './moment-date-adapter';\nexport * from './moment-date-formats';\n\n@NgModule({\n providers: [\n {\n provide: DateAdapter,\n useClass: MomentDateAdapter,\n deps: [MAT_DATE_LOCALE, MAT_MOMENT_DATE_ADAPTER_OPTIONS]\n }\n ],\n})\nexport class MomentDateModule {}\n\n\n@NgModule({\n imports: [MomentDateModule],\n providers: [{provide: MAT_DATE_FORMATS, useValue: MAT_MOMENT_DATE_FORMATS}],\n})\nexport class MatMomentDateModule {}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {MatDateFormats} from '@angular/material/core';\n\n\nexport const MAT_MOMENT_DATE_FORMATS: MatDateFormats = {\n parse: {\n dateInput: 'l',\n },\n display: {\n dateInput: 'l',\n monthYearLabel: 'MMM YYYY',\n dateA11yLabel: 'LL',\n monthYearA11yLabel: 'MMMM YYYY',\n },\n};\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Inject, Injectable, Optional, InjectionToken} from '@angular/core';\nimport {DateAdapter, MAT_DATE_LOCALE} from '@angular/material/core';\n// Depending on whether rollup is used, moment needs to be imported differently.\n// Since Moment.js doesn't have a default export, we normally need to import using the `* as`\n// syntax. However, rollup creates a synthetic default module and we thus need to import it using\n// the `default as` syntax.\n// TODO(mmalerba): See if we can clean this up at some point.\nimport * as _moment from 'moment';\n// tslint:disable-next-line:no-duplicate-imports\nimport {default as _rollupMoment, Moment} from 'moment';\n\nconst moment = _rollupMoment || _moment;\n\n/** Configurable options for {@see MomentDateAdapter}. */\nexport interface MatMomentDateAdapterOptions {\n /**\n * Turns the use of utc dates on or off.\n * Changing this will change how Angular Material components like DatePicker output dates.\n * {@default false}\n */\n useUtc: boolean;\n}\n\n/** InjectionToken for moment date adapter to configure options. */\nexport const MAT_MOMENT_DATE_ADAPTER_OPTIONS = new InjectionToken<MatMomentDateAdapterOptions>(\n 'MAT_MOMENT_DATE_ADAPTER_OPTIONS', {\n providedIn: 'root',\n factory: MAT_MOMENT_DATE_ADAPTER_OPTIONS_FACTORY\n});\n\n\n/** @docs-private */\nexport function MAT_MOMENT_DATE_ADAPTER_OPTIONS_FACTORY(): MatMomentDateAdapterOptions {\n return {\n useUtc: false\n };\n}\n\n\n/** Creates an array and fills it with values. */\nfunction range<T>(length: number, valueFunction: (index: number) => T): T[] {\n const valuesArray = Array(length);\n for (let i = 0; i < length; i++) {\n valuesArray[i] = valueFunction(i);\n }\n return valuesArray;\n}\n\n\n/** Adapts Moment.js Dates for use with Angular Material. */\n@Injectable()\nexport class MomentDateAdapter extends DateAdapter<Moment> {\n // Note: all of the methods that accept a `Moment` input parameter immediately call `this.clone`\n // on it. This is to ensure that we're working with a `Moment` that has the correct locale setting\n // while avoiding mutating the original object passed to us. Just calling `.locale(...)` on the\n // input would mutate the object.\n\n private _localeData: {\n firstDayOfWeek: number,\n longMonths: string[],\n shortMonths: string[],\n dates: string[],\n longDaysOfWeek: string[],\n shortDaysOfWeek: string[],\n narrowDaysOfWeek: string[]\n };\n\n constructor(@Optional() @Inject(MAT_DATE_LOCALE) dateLocale: string,\n @Optional() @Inject(MAT_MOMENT_DATE_ADAPTER_OPTIONS)\n private options?: MatMomentDateAdapterOptions) {\n\n super();\n this.setLocale(dateLocale || moment.locale());\n }\n\n setLocale(locale: string) {\n super.setLocale(locale);\n\n let momentLocaleData = moment.localeData(locale);\n this._localeData = {\n firstDayOfWeek: momentLocaleData.firstDayOfWeek(),\n longMonths: momentLocaleData.months(),\n shortMonths: momentLocaleData.monthsShort(),\n dates: range(31, (i) => this.createDate(2017, 0, i + 1).format('D')),\n longDaysOfWeek: momentLocaleData.weekdays(),\n shortDaysOfWeek: momentLocaleData.weekdaysShort(),\n narrowDaysOfWeek: momentLocaleData.weekdaysMin(),\n };\n }\n\n getYear(date: Moment): number {\n return this.clone(date).year();\n }\n\n getMonth(date: Moment): number {\n return this.clone(date).month();\n }\n\n getDate(date: Moment): number {\n return this.clone(date).date();\n }\n\n getDayOfWeek(date: Moment): number {\n return this.clone(date).day();\n }\n\n getMonthNames(style: 'long' | 'short' | 'narrow'): string[] {\n // Moment.js doesn't support narrow month names, so we just use short if narrow is requested.\n return style == 'long' ? this._localeData.longMonths : this._localeData.shortMonths;\n }\n\n getDateNames(): string[] {\n return this._localeData.dates;\n }\n\n getDayOfWeekNames(style: 'long' | 'short' | 'narrow'): string[] {\n if (style == 'long') {\n return this._localeData.longDaysOfWeek;\n }\n if (style == 'short') {\n return this._localeData.shortDaysOfWeek;\n }\n return this._localeData.narrowDaysOfWeek;\n }\n\n getYearName(date: Moment): string {\n return this.clone(date).format('YYYY');\n }\n\n getFirstDayOfWeek(): number {\n return this._localeData.firstDayOfWeek;\n }\n\n getNumDaysInMonth(date: Moment): number {\n return this.clone(date).daysInMonth();\n }\n\n clone(date: Moment): Moment {\n return date.clone().locale(this.locale);\n }\n\n createDate(year: number, month: number, date: number): Moment {\n // Moment.js will create an invalid date if any of the components are out of bounds, but we\n // explicitly check each case so we can throw more descriptive errors.\n if (month < 0 || month > 11) {\n throw Error(`Invalid month index \"${month}\". Month index has to be between 0 and 11.`);\n }\n\n if (date < 1) {\n throw Error(`Invalid date \"${date}\". Date has to be greater than 0.`);\n }\n\n const result = this._createMoment({year, month, date}).locale(this.locale);\n\n // If the result isn't valid, the date must have been out of bounds for this month.\n if (!result.isValid()) {\n throw Error(`Invalid date \"${date}\" for month with index \"${month}\".`);\n }\n\n return result;\n }\n\n today(): Moment {\n return this._createMoment().locale(this.locale);\n }\n\n parse(value: any, parseFormat: string | string[]): Moment | null {\n if (value && typeof value == 'string') {\n return this._createMoment(value, parseFormat, this.locale);\n }\n return value ? this._createMoment(value).locale(this.locale) : null;\n }\n\n format(date: Moment, displayFormat: string): string {\n date = this.clone(date);\n if (!this.isValid(date)) {\n throw Error('MomentDateAdapter: Cannot format invalid date.');\n }\n return date.format(displayFormat);\n }\n\n addCalendarYears(date: Moment, years: number): Moment {\n return this.clone(date).add({years});\n }\n\n addCalendarMonths(date: Moment, months: number): Moment {\n return this.clone(date).add({months});\n }\n\n addCalendarDays(date: Moment, days: number): Moment {\n return this.clone(date).add({days});\n }\n\n toIso8601(date: Moment): string {\n return this.clone(date).format();\n }\n\n /**\n * Returns the given value if given a valid Moment or null. Deserializes valid ISO 8601 strings\n * (https://www.ietf.org/rfc/rfc3339.txt) and valid Date objects into valid Moments and empty\n * string into null. Returns an invalid date for all other values.\n */\n deserialize(value: any): Moment | null {\n let date;\n if (value instanceof Date) {\n date = this._createMoment(value);\n }\n if (typeof value === 'string') {\n if (!value) {\n return null;\n }\n date = this._createMoment(value, moment.ISO_8601).locale(this.locale);\n }\n if (date && this.isValid(date)) {\n return date;\n }\n return super.deserialize(value);\n }\n\n isDateInstance(obj: any): boolean {\n return moment.isMoment(obj);\n }\n\n isValid(date: Moment): boolean {\n return this.clone(date).isValid();\n }\n\n invalid(): Moment {\n return moment.invalid();\n }\n\n /** Creates a Moment instance while respecting the current UTC settings. */\n private _createMoment(...args: any[]): Moment {\n return (this.options && this.options.use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jD,EAAA,CAAA,EAAA;IACA,EAAA,IAAA,EAAA,SAAA,EAAA,UAAA,EAAA,CAAA,EAAA,IAAA,EAAK,QAAQ,EAAb,EAAA,EAAA,IAAA,EAAiB,MAAM,EAAvB,IAAA,EAAA,CAAwB,+BAA+B,EAAvD,EAAA,CAAA,EAAA;;;;;;;;;ADjEA,AAAA,MAAa,uBAAuB,GAAmB;IACrD,KAAK,EAAE;QACL,SAAS,EAAE,GAAG;KACf;IACD,OAAO,EAAE;QACP,SAAS,EAAE,GAAG;QACd,cAAc,EAAE,UAAU;QAC1B,aAAa,EAAE,IAAI;QACnB,kBAAkB,EAAE,WAAW;KAChC;CACF;;;;;;ADID,MAAa,gBAAgB,CAA7B;;;IATA,EAAA,IAAA,EAAC,QAAQ,EAAT,IAAA,EAAA,CAAU;gBACR,SAAS,EAAE;oBACT;wBACE,OAAO,EAAE,WAAW;wBACpB,QAAQ,EAAE,iBAAiB;wBAC3B,IAAI,EAAE,CAAC,eAAe,EAAE,+BAA+B,CAAC;qBACzD;iBACF;aACF,EAAD,EAAA;;AAMA,MAAA,EAAA,GAAoD,uBAAuB,CAA3E;AAEA,AAAA,MAAa,mBAAmB,CAAhC;;;IAJA,EAAA,IAAA,EAAC,QAAQ,EAAT,IAAA,EAAA,CAAU;gBACR,OAAO,EAAE,CAAC,gBAAgB,CAAC;gBAC3B,SAAS,EAAE,CAAC,EAAC,OAAO,EAAE,gBAAgB,EAAE,QAAQ,EAAlD,EAA2E,EAAC,CAAC;aAC5E,EAAD,EAAA;;;;;;;;;;;;;;;"}
|
|
@@ -13,13 +13,14 @@ import _rollupMoment__default, { } from 'moment';
|
|
|
13
13
|
|
|
14
14
|
/**
|
|
15
15
|
* @fileoverview added by tsickle
|
|
16
|
-
* @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
|
|
16
|
+
* @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
17
17
|
*/
|
|
18
18
|
/** @type {?} */
|
|
19
19
|
var moment = _rollupMoment__default || _rollupMoment;
|
|
20
|
-
/**
|
|
20
|
+
/**
|
|
21
21
|
* InjectionToken for moment date adapter to configure options.
|
|
22
|
-
|
|
22
|
+
* @type {?}
|
|
23
|
+
*/
|
|
23
24
|
var MAT_MOMENT_DATE_ADAPTER_OPTIONS = new InjectionToken('MAT_MOMENT_DATE_ADAPTER_OPTIONS', {
|
|
24
25
|
providedIn: 'root',
|
|
25
26
|
factory: MAT_MOMENT_DATE_ADAPTER_OPTIONS_FACTORY
|
|
@@ -394,13 +395,16 @@ var MomentDateAdapter = /** @class */ (function (_super) {
|
|
|
394
395
|
function () {
|
|
395
396
|
return moment.invalid();
|
|
396
397
|
};
|
|
398
|
+
/** Creates a Moment instance while respecting the current UTC settings. */
|
|
397
399
|
/**
|
|
398
400
|
* Creates a Moment instance while respecting the current UTC settings.
|
|
401
|
+
* @private
|
|
399
402
|
* @param {...?} args
|
|
400
403
|
* @return {?}
|
|
401
404
|
*/
|
|
402
405
|
MomentDateAdapter.prototype._createMoment = /**
|
|
403
406
|
* Creates a Moment instance while respecting the current UTC settings.
|
|
407
|
+
* @private
|
|
404
408
|
* @param {...?} args
|
|
405
409
|
* @return {?}
|
|
406
410
|
*/
|
|
@@ -424,7 +428,7 @@ var MomentDateAdapter = /** @class */ (function (_super) {
|
|
|
424
428
|
|
|
425
429
|
/**
|
|
426
430
|
* @fileoverview added by tsickle
|
|
427
|
-
* @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
|
|
431
|
+
* @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
428
432
|
*/
|
|
429
433
|
|
|
430
434
|
/** @type {?} */
|
|
@@ -442,7 +446,7 @@ var MAT_MOMENT_DATE_FORMATS = {
|
|
|
442
446
|
|
|
443
447
|
/**
|
|
444
448
|
* @fileoverview added by tsickle
|
|
445
|
-
* @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
|
|
449
|
+
* @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
446
450
|
*/
|
|
447
451
|
var MomentDateModule = /** @class */ (function () {
|
|
448
452
|
function MomentDateModule() {
|
|
@@ -475,12 +479,12 @@ var MatMomentDateModule = /** @class */ (function () {
|
|
|
475
479
|
|
|
476
480
|
/**
|
|
477
481
|
* @fileoverview added by tsickle
|
|
478
|
-
* @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
|
|
482
|
+
* @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
479
483
|
*/
|
|
480
484
|
|
|
481
485
|
/**
|
|
482
486
|
* @fileoverview added by tsickle
|
|
483
|
-
* @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
|
|
487
|
+
* @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
484
488
|
*/
|
|
485
489
|
|
|
486
490
|
export { MomentDateModule, MatMomentDateModule, MAT_MOMENT_DATE_ADAPTER_OPTIONS_FACTORY, MAT_MOMENT_DATE_ADAPTER_OPTIONS, MomentDateAdapter, MAT_MOMENT_DATE_FORMATS };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"material-moment-adapter.es5.js","sources":["../../src/material-moment-adapter/adapter/index.ts","../../src/material-moment-adapter/adapter/moment-date-formats.ts","../../src/material-moment-adapter/adapter/moment-date-adapter.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {NgModule} from '@angular/core';\nimport {DateAdapter, MAT_DATE_FORMATS, MAT_DATE_LOCALE} from '@angular/material/core';\nimport {MAT_MOMENT_DATE_ADAPTER_OPTIONS, MomentDateAdapter} from './moment-date-adapter';\nimport {MAT_MOMENT_DATE_FORMATS} from './moment-date-formats';\n\nexport * from './moment-date-adapter';\nexport * from './moment-date-formats';\n\n@NgModule({\n providers: [\n {\n provide: DateAdapter,\n useClass: MomentDateAdapter,\n deps: [MAT_DATE_LOCALE, MAT_MOMENT_DATE_ADAPTER_OPTIONS]\n }\n ],\n})\nexport class MomentDateModule {}\n\n\n@NgModule({\n imports: [MomentDateModule],\n providers: [{provide: MAT_DATE_FORMATS, useValue: MAT_MOMENT_DATE_FORMATS}],\n})\nexport class MatMomentDateModule {}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {MatDateFormats} from '@angular/material/core';\n\n\nexport const MAT_MOMENT_DATE_FORMATS: MatDateFormats = {\n parse: {\n dateInput: 'l',\n },\n display: {\n dateInput: 'l',\n monthYearLabel: 'MMM YYYY',\n dateA11yLabel: 'LL',\n monthYearA11yLabel: 'MMMM YYYY',\n },\n};\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Inject, Injectable, Optional, InjectionToken} from '@angular/core';\nimport {DateAdapter, MAT_DATE_LOCALE} from '@angular/material/core';\n// Depending on whether rollup is used, moment needs to be imported differently.\n// Since Moment.js doesn't have a default export, we normally need to import using the `* as`\n// syntax. However, rollup creates a synthetic default module and we thus need to import it using\n// the `default as` syntax.\n// TODO(mmalerba): See if we can clean this up at some point.\nimport * as _moment from 'moment';\n// tslint:disable-next-line:no-duplicate-imports\nimport {default as _rollupMoment, Moment} from 'moment';\n\nconst moment = _rollupMoment || _moment;\n\n/** Configurable options for {@see MomentDateAdapter}. */\nexport interface MatMomentDateAdapterOptions {\n /**\n * Turns the use of utc dates on or off.\n * Changing this will change how Angular Material components like DatePicker output dates.\n * {@default false}\n */\n useUtc: boolean;\n}\n\n/** InjectionToken for moment date adapter to configure options. */\nexport const MAT_MOMENT_DATE_ADAPTER_OPTIONS = new InjectionToken<MatMomentDateAdapterOptions>(\n 'MAT_MOMENT_DATE_ADAPTER_OPTIONS', {\n providedIn: 'root',\n factory: MAT_MOMENT_DATE_ADAPTER_OPTIONS_FACTORY\n});\n\n\n/** @docs-private */\nexport function MAT_MOMENT_DATE_ADAPTER_OPTIONS_FACTORY(): MatMomentDateAdapterOptions {\n return {\n useUtc: false\n };\n}\n\n\n/** Creates an array and fills it with values. */\nfunction range<T>(length: number, valueFunction: (index: number) => T): T[] {\n const valuesArray = Array(length);\n for (let i = 0; i < length; i++) {\n valuesArray[i] = valueFunction(i);\n }\n return valuesArray;\n}\n\n\n/** Adapts Moment.js Dates for use with Angular Material. */\n@Injectable()\nexport class MomentDateAdapter extends DateAdapter<Moment> {\n // Note: all of the methods that accept a `Moment` input parameter immediately call `this.clone`\n // on it. This is to ensure that we're working with a `Moment` that has the correct locale setting\n // while avoiding mutating the original object passed to us. Just calling `.locale(...)` on the\n // input would mutate the object.\n\n private _localeData: {\n firstDayOfWeek: number,\n longMonths: string[],\n shortMonths: string[],\n dates: string[],\n longDaysOfWeek: string[],\n shortDaysOfWeek: string[],\n narrowDaysOfWeek: string[]\n };\n\n constructor(@Optional() @Inject(MAT_DATE_LOCALE) dateLocale: string,\n @Optional() @Inject(MAT_MOMENT_DATE_ADAPTER_OPTIONS)\n private options?: MatMomentDateAdapterOptions) {\n\n super();\n this.setLocale(dateLocale || moment.locale());\n }\n\n setLocale(locale: string) {\n super.setLocale(locale);\n\n let momentLocaleData = moment.localeData(locale);\n this._localeData = {\n firstDayOfWeek: momentLocaleData.firstDayOfWeek(),\n longMonths: momentLocaleData.months(),\n shortMonths: momentLocaleData.monthsShort(),\n dates: range(31, (i) => this.createDate(2017, 0, i + 1).format('D')),\n longDaysOfWeek: momentLocaleData.weekdays(),\n shortDaysOfWeek: momentLocaleData.weekdaysShort(),\n narrowDaysOfWeek: momentLocaleData.weekdaysMin(),\n };\n }\n\n getYear(date: Moment): number {\n return this.clone(date).year();\n }\n\n getMonth(date: Moment): number {\n return this.clone(date).month();\n }\n\n getDate(date: Moment): number {\n return this.clone(date).date();\n }\n\n getDayOfWeek(date: Moment): number {\n return this.clone(date).day();\n }\n\n getMonthNames(style: 'long' | 'short' | 'narrow'): string[] {\n // Moment.js doesn't support narrow month names, so we just use short if narrow is requested.\n return style == 'long' ? this._localeData.longMonths : this._localeData.shortMonths;\n }\n\n getDateNames(): string[] {\n return this._localeData.dates;\n }\n\n getDayOfWeekNames(style: 'long' | 'short' | 'narrow'): string[] {\n if (style == 'long') {\n return this._localeData.longDaysOfWeek;\n }\n if (style == 'short') {\n return this._localeData.shortDaysOfWeek;\n }\n return this._localeData.narrowDaysOfWeek;\n }\n\n getYearName(date: Moment): string {\n return this.clone(date).format('YYYY');\n }\n\n getFirstDayOfWeek(): number {\n return this._localeData.firstDayOfWeek;\n }\n\n getNumDaysInMonth(date: Moment): number {\n return this.clone(date).daysInMonth();\n }\n\n clone(date: Moment): Moment {\n return date.clone().locale(this.locale);\n }\n\n createDate(year: number, month: number, date: number): Moment {\n // Moment.js will create an invalid date if any of the components are out of bounds, but we\n // explicitly check each case so we can throw more descriptive errors.\n if (month < 0 || month > 11) {\n throw Error(`Invalid month index \"${month}\". Month index has to be between 0 and 11.`);\n }\n\n if (date < 1) {\n throw Error(`Invalid date \"${date}\". Date has to be greater than 0.`);\n }\n\n const result = this._createMoment({year, month, date}).locale(this.locale);\n\n // If the result isn't valid, the date must have been out of bounds for this month.\n if (!result.isValid()) {\n throw Error(`Invalid date \"${date}\" for month with index \"${month}\".`);\n }\n\n return result;\n }\n\n today(): Moment {\n return this._createMoment().locale(this.locale);\n }\n\n parse(value: any, parseFormat: string | string[]): Moment | null {\n if (value && typeof value == 'string') {\n return this._createMoment(value, parseFormat, this.locale);\n }\n return value ? this._createMoment(value).locale(this.locale) : null;\n }\n\n format(date: Moment, displayFormat: string): string {\n date = this.clone(date);\n if (!this.isValid(date)) {\n throw Error('MomentDateAdapter: Cannot format invalid date.');\n }\n return date.format(displayFormat);\n }\n\n addCalendarYears(date: Moment, years: number): Moment {\n return this.clone(date).add({years});\n }\n\n addCalendarMonths(date: Moment, months: number): Moment {\n return this.clone(date).add({months});\n }\n\n addCalendarDays(date: Moment, days: number): Moment {\n return this.clone(date).add({days});\n }\n\n toIso8601(date: Moment): string {\n return this.clone(date).format();\n }\n\n /**\n * Returns the given value if given a valid Moment or null. Deserializes valid ISO 8601 strings\n * (https://www.ietf.org/rfc/rfc3339.txt) and valid Date objects into valid Moments and empty\n * string into null. Returns an invalid date for all other values.\n */\n deserialize(value: any): Moment | null {\n let date;\n if (value instanceof Date) {\n date = this._createMoment(value);\n }\n if (typeof value === 'string') {\n if (!value) {\n return null;\n }\n date = this._createMoment(value, moment.ISO_8601).locale(this.locale);\n }\n if (date && this.isValid(date)) {\n return date;\n }\n return super.deserialize(value);\n }\n\n isDateInstance(obj: any): boolean {\n return moment.isMoment(obj);\n }\n\n isValid(date: Moment): boolean {\n return this.clone(date).isValid();\n }\n\n invalid(): Moment {\n return moment.invalid();\n }\n\n /** Creates a Moment instance while respecting the current UTC settings. */\n private _createMoment(...args: any[]): Moment {\n return (this.options && this.options.useUtc) ? moment.utc(...args) : moment(...args);\n }\n}\n"],"names":["tslib_1.__extends","_rollupMoment","_moment"],"mappings":";;;;;;;;;;;;;;;;;;AEmBA,IAAM,MAAM,GAAGC,sBAAa,IAAIC,aAAO,CAAC;;;;AAaxC,AAAA,IAAa,+BAA+B,GAAG,IAAI,cAAc,CAC/D,iCAAiC,EAAE;IACjC,UAAU,EAAE,MAAM;IAClB,OAAO,EAAE,uCAAuC;CACnD,CAAC,CAAC;;;;;AAIH,AAAA,SAAgB,uCAAuC,GAAvD;IACE,OAAO;QACL,MAAM,EAAE,KAAK;KACd,CAAC;CACH;;;;;;;;AAID,SAAS,KAAK,CAAI,MAAc,EAAE,aAAmC,EAArE;;IACE,IAAM,WAAW,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC;IAClC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,EAAE,CAAC,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AA,CAAA;CA2DA,CAAuC,WAAW,CAAlD,CAAA;;;;;;;;ADhDA,AAAA,IAAa,uBAAuB,GAAmB;IACrD,KAAK,EAAE;QACL,SAAS,EAAE,GAAG;KACf;IACD,OAAO,EAAE;QACP,SAAS,EAAE,GAAG;QACd,cAAc,EAAE,UAAU;QAC1B,aAAa,EAAE,IAAI;QACnB,kBAAkB,EAAE,WAAW;KAChC;CACF;;;;;;;;;;QDLD,EAAA,IAAA,EAAC,QAAQ,EAAT,IAAA,EAAA,CAAU;oBACR,SAAS,EAAE;wBACT;4BACE,OAAO,EAAE,WAAW;4BACpB,QAAQ,EAAE,iBAAiB;4BAC3B,IAAI,EAAE,CAAC,eAAe,EAAE,+BAA+B,CAAC;yBACzD;qBACF;iBACF,EAAD,EAAA;;IAxBA,OAAA,gBAAA,CAAA;;AAyBA,AAKA,IAAA,EAAA,GAAoD,uBAAuB,CAA3E;;;;;QAFA,EAAA,IAAA,EAAC,QAAQ,EAAT,IAAA,EAAA,CAAU;oBACR,OAAO,EAAE,CAAC,gBAAgB,CAAC;oBAC3B,SAAS,EAAE,CAAC,EAAC,OAAO,EAAE,gBAAgB,EAAE,QAAQ,EAAlD,EAA2E,EAAC,CAAC;iBAC5E,EAAD,EAAA;;IA/BA,OAAA,mBAAA,CAAA;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"material-moment-adapter.es5.js","sources":["../../src/material-moment-adapter/adapter/index.ts","../../src/material-moment-adapter/adapter/moment-date-formats.ts","../../src/material-moment-adapter/adapter/moment-date-adapter.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {NgModule} from '@angular/core';\nimport {DateAdapter, MAT_DATE_FORMATS, MAT_DATE_LOCALE} from '@angular/material/core';\nimport {MAT_MOMENT_DATE_ADAPTER_OPTIONS, MomentDateAdapter} from './moment-date-adapter';\nimport {MAT_MOMENT_DATE_FORMATS} from './moment-date-formats';\n\nexport * from './moment-date-adapter';\nexport * from './moment-date-formats';\n\n@NgModule({\n providers: [\n {\n provide: DateAdapter,\n useClass: MomentDateAdapter,\n deps: [MAT_DATE_LOCALE, MAT_MOMENT_DATE_ADAPTER_OPTIONS]\n }\n ],\n})\nexport class MomentDateModule {}\n\n\n@NgModule({\n imports: [MomentDateModule],\n providers: [{provide: MAT_DATE_FORMATS, useValue: MAT_MOMENT_DATE_FORMATS}],\n})\nexport class MatMomentDateModule {}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {MatDateFormats} from '@angular/material/core';\n\n\nexport const MAT_MOMENT_DATE_FORMATS: MatDateFormats = {\n parse: {\n dateInput: 'l',\n },\n display: {\n dateInput: 'l',\n monthYearLabel: 'MMM YYYY',\n dateA11yLabel: 'LL',\n monthYearA11yLabel: 'MMMM YYYY',\n },\n};\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Inject, Injectable, Optional, InjectionToken} from '@angular/core';\nimport {DateAdapter, MAT_DATE_LOCALE} from '@angular/material/core';\n// Depending on whether rollup is used, moment needs to be imported differently.\n// Since Moment.js doesn't have a default export, we normally need to import using the `* as`\n// syntax. However, rollup creates a synthetic default module and we thus need to import it using\n// the `default as` syntax.\n// TODO(mmalerba): See if we can clean this up at some point.\nimport * as _moment from 'moment';\n// tslint:disable-next-line:no-duplicate-imports\nimport {default as _rollupMoment, Moment} from 'moment';\n\nconst moment = _rollupMoment || _moment;\n\n/** Configurable options for {@see MomentDateAdapter}. */\nexport interface MatMomentDateAdapterOptions {\n /**\n * Turns the use of utc dates on or off.\n * Changing this will change how Angular Material components like DatePicker output dates.\n * {@default false}\n */\n useUtc: boolean;\n}\n\n/** InjectionToken for moment date adapter to configure options. */\nexport const MAT_MOMENT_DATE_ADAPTER_OPTIONS = new InjectionToken<MatMomentDateAdapterOptions>(\n 'MAT_MOMENT_DATE_ADAPTER_OPTIONS', {\n providedIn: 'root',\n factory: MAT_MOMENT_DATE_ADAPTER_OPTIONS_FACTORY\n});\n\n\n/** @docs-private */\nexport function MAT_MOMENT_DATE_ADAPTER_OPTIONS_FACTORY(): MatMomentDateAdapterOptions {\n return {\n useUtc: false\n };\n}\n\n\n/** Creates an array and fills it with values. */\nfunction range<T>(length: number, valueFunction: (index: number) => T): T[] {\n const valuesArray = Array(length);\n for (let i = 0; i < length; i++) {\n valuesArray[i] = valueFunction(i);\n }\n return valuesArray;\n}\n\n\n/** Adapts Moment.js Dates for use with Angular Material. */\n@Injectable()\nexport class MomentDateAdapter extends DateAdapter<Moment> {\n // Note: all of the methods that accept a `Moment` input parameter immediately call `this.clone`\n // on it. This is to ensure that we're working with a `Moment` that has the correct locale setting\n // while avoiding mutating the original object passed to us. Just calling `.locale(...)` on the\n // input would mutate the object.\n\n private _localeData: {\n firstDayOfWeek: number,\n longMonths: string[],\n shortMonths: string[],\n dates: string[],\n longDaysOfWeek: string[],\n shortDaysOfWeek: string[],\n narrowDaysOfWeek: string[]\n };\n\n constructor(@Optional() @Inject(MAT_DATE_LOCALE) dateLocale: string,\n @Optional() @Inject(MAT_MOMENT_DATE_ADAPTER_OPTIONS)\n private options?: MatMomentDateAdapterOptions) {\n\n super();\n this.setLocale(dateLocale || moment.locale());\n }\n\n setLocale(locale: string) {\n super.setLocale(locale);\n\n let momentLocaleData = moment.localeData(locale);\n this._localeData = {\n firstDayOfWeek: momentLocaleData.firstDayOfWeek(),\n longMonths: momentLocaleData.months(),\n shortMonths: momentLocaleData.monthsShort(),\n dates: range(31, (i) => this.createDate(2017, 0, i + 1).format('D')),\n longDaysOfWeek: momentLocaleData.weekdays(),\n shortDaysOfWeek: momentLocaleData.weekdaysShort(),\n narrowDaysOfWeek: momentLocaleData.weekdaysMin(),\n };\n }\n\n getYear(date: Moment): number {\n return this.clone(date).year();\n }\n\n getMonth(date: Moment): number {\n return this.clone(date).month();\n }\n\n getDate(date: Moment): number {\n return this.clone(date).date();\n }\n\n getDayOfWeek(date: Moment): number {\n return this.clone(date).day();\n }\n\n getMonthNames(style: 'long' | 'short' | 'narrow'): string[] {\n // Moment.js doesn't support narrow month names, so we just use short if narrow is requested.\n return style == 'long' ? this._localeData.longMonths : this._localeData.shortMonths;\n }\n\n getDateNames(): string[] {\n return this._localeData.dates;\n }\n\n getDayOfWeekNames(style: 'long' | 'short' | 'narrow'): string[] {\n if (style == 'long') {\n return this._localeData.longDaysOfWeek;\n }\n if (style == 'short') {\n return this._localeData.shortDaysOfWeek;\n }\n return this._localeData.narrowDaysOfWeek;\n }\n\n getYearName(date: Moment): string {\n return this.clone(date).format('YYYY');\n }\n\n getFirstDayOfWeek(): number {\n return this._localeData.firstDayOfWeek;\n }\n\n getNumDaysInMonth(date: Moment): number {\n return this.clone(date).daysInMonth();\n }\n\n clone(date: Moment): Moment {\n return date.clone().locale(this.locale);\n }\n\n createDate(year: number, month: number, date: number): Moment {\n // Moment.js will create an invalid date if any of the components are out of bounds, but we\n // explicitly check each case so we can throw more descriptive errors.\n if (month < 0 || month > 11) {\n throw Error(`Invalid month index \"${month}\". Month index has to be between 0 and 11.`);\n }\n\n if (date < 1) {\n throw Error(`Invalid date \"${date}\". Date has to be greater than 0.`);\n }\n\n const result = this._createMoment({year, month, date}).locale(this.locale);\n\n // If the result isn't valid, the date must have been out of bounds for this month.\n if (!result.isValid()) {\n throw Error(`Invalid date \"${date}\" for month with index \"${month}\".`);\n }\n\n return result;\n }\n\n today(): Moment {\n return this._createMoment().locale(this.locale);\n }\n\n parse(value: any, parseFormat: string | string[]): Moment | null {\n if (value && typeof value == 'string') {\n return this._createMoment(value, parseFormat, this.locale);\n }\n return value ? this._createMoment(value).locale(this.locale) : null;\n }\n\n format(date: Moment, displayFormat: string): string {\n date = this.clone(date);\n if (!this.isValid(date)) {\n throw Error('MomentDateAdapter: Cannot format invalid date.');\n }\n return date.format(displayFormat);\n }\n\n addCalendarYears(date: Moment, years: number): Moment {\n return this.clone(date).add({years});\n }\n\n addCalendarMonths(date: Moment, months: number): Moment {\n return this.clone(date).add({months});\n }\n\n addCalendarDays(date: Moment, days: number): Moment {\n return this.clone(date).add({days});\n }\n\n toIso8601(date: Moment): string {\n return this.clone(date).format();\n }\n\n /**\n * Returns the given value if given a valid Moment or null. Deserializes valid ISO 8601 strings\n * (https://www.ietf.org/rfc/rfc3339.txt) and valid Date objects into valid Moments and empty\n * string into null. Returns an invalid date for all other values.\n */\n deserialize(value: any): Moment | null {\n let date;\n if (value instanceof Date) {\n date = this._createMoment(value);\n }\n if (typeof value === 'string') {\n if (!value) {\n return null;\n }\n date = this._createMoment(value, moment.ISO_8601).locale(this.locale);\n }\n if (date && this.isValid(date)) {\n return date;\n }\n return super.deserialize(value);\n }\n\n isDateInstance(obj: any): boolean {\n return moment.isMoment(obj);\n }\n\n isValid(date: Moment): boolean {\n return this.clone(date).isValid();\n }\n\n invalid(): Moment {\n return moment.invalid();\n }\n\n /** Creates a Moment instance while respecting the current UTC settings. */\n private _createMoment(...args: any[]): Moment {\n return (this.options && this.options.useUtc) ? moment.utc(...args) : moment(...args);\n }\n}\n"],"names":["tslib_1.__extends","_rollupMoment","_moment"],"mappings":";;;;;;;;;;;;;;;;;;AEmBA,IAAM,MAAM,GAAGC,sBAAa,IAAIC,aAAO,CAAvC;;;;;AAaA,AAAA,IAAa,+BAA+B,GAAG,IAAI,cAAc,CAC/D,iCAAiC,EAAE;IACjC,UAAU,EAAE,MAAM;IAClB,OAAO,EAAE,uCAAuC;CACnD,CAAC,CAAF;;;;;AAIA,AAAA,SAAgB,uCAAuC,GAAvD;IACE,OAAO;QACL,MAAM,EAAE,KAAK;KACd,CAAC;CACH;;;;;;;;AAID,SAAS,KAAK,CAAI,MAAc,EAAE,aAAmC,EAArE;;IACA,IAAQ,WAAW,GAAG,KAAK,CAAC,MAAM,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name": "@angular/material-moment-adapter",
|
|
3
|
-
"version": "7.0
|
|
3
|
+
"version": "7.2.0",
|
|
4
4
|
"description": "Angular Material Moment Adapter",
|
|
5
5
|
"main": "./bundles/material-moment-adapter.umd.js",
|
|
6
6
|
"module": "./esm5/material-moment-adapter.es5.js",
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
},
|
|
17
17
|
"homepage": "https://github.com/angular/material2#readme",
|
|
18
18
|
"peerDependencies": {
|
|
19
|
-
"@angular/material": "7.0
|
|
19
|
+
"@angular/material": "7.2.0",
|
|
20
20
|
"@angular/core": ">=7.0.0",
|
|
21
21
|
"moment": "^2.18.1"
|
|
22
22
|
},
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"@angular/material-moment-adapter"
|
|
31
31
|
]
|
|
32
32
|
},
|
|
33
|
-
"releaseGitCommitSha": "
|
|
34
|
-
"releaseGitBranch": "
|
|
35
|
-
"releaseGitUser": "
|
|
33
|
+
"releaseGitCommitSha": "06085e05b0b7bee3ec9ee7737294602ec2a2d04d",
|
|
34
|
+
"releaseGitBranch": "master",
|
|
35
|
+
"releaseGitUser": "Vivian Hu <vivianhu@google.com>"
|
|
36
36
|
}
|