@angular/material-moment-adapter 13.0.0-next.7 → 13.0.0-rc.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/adapter/index.d.ts +7 -7
- package/adapter/moment-date-adapter.d.ts +3 -0
- package/esm2020/adapter/index.mjs +50 -0
- package/esm2020/adapter/moment-date-adapter.mjs +200 -0
- package/{esm2015/adapter/moment-date-formats.js → esm2020/adapter/moment-date-formats.mjs} +1 -1
- package/esm2020/index.mjs +9 -0
- package/esm2020/material-moment-adapter_public_index.mjs +5 -0
- package/{esm2015/public-api.js → esm2020/public-api.mjs} +0 -0
- package/fesm2015/material-moment-adapter.mjs +281 -0
- package/fesm2015/material-moment-adapter.mjs.map +1 -0
- package/{fesm2015/material-moment-adapter.js → fesm2020/material-moment-adapter.mjs} +61 -33
- package/fesm2020/material-moment-adapter.mjs.map +1 -0
- package/index.d.ts +5 -1
- package/material-moment-adapter_public_index.d.ts +4 -0
- package/package.json +23 -9
- package/bundles/material-moment-adapter.umd.js +0 -608
- package/bundles/material-moment-adapter.umd.js.map +0 -1
- package/esm2015/adapter/index.js +0 -37
- package/esm2015/adapter/moment-date-adapter.js +0 -193
- package/esm2015/index.js +0 -5
- package/esm2015/material-moment-adapter.externs.js +0 -6
- package/fesm2015/material-moment-adapter.js.map +0 -1
- package/index.metadata.json +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"material-moment-adapter.mjs","sources":["../../../../../../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","../../../../../../src/material-moment-adapter/public-api.ts","../../../../../../src/material-moment-adapter/index.ts","../../../../../../src/material-moment-adapter/material-moment-adapter_public_index.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 {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, MomentFormatSpecification, MomentInput} from 'moment';\n\nconst moment = _rollupMoment || _moment;\n\n/** Configurable options for {@see MomentDateAdapter}. */\nexport interface MatMomentDateAdapterOptions {\n /**\n * When enabled, the dates have to match the format exactly.\n * See https://momentjs.com/guides/#/parsing/strict-mode/.\n */\n strict?: boolean;\n\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 {\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/** 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/** 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(\n @Optional() @Inject(MAT_DATE_LOCALE) dateLocale: string,\n @Optional()\n @Inject(MAT_MOMENT_DATE_ADAPTER_OPTIONS)\n private _options?: MatMomentDateAdapterOptions,\n ) {\n super();\n this.setLocale(dateLocale || moment.locale());\n }\n\n override 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 (typeof ngDevMode === 'undefined' || ngDevMode) {\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\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() && (typeof ngDevMode === 'undefined' || ngDevMode)) {\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) && (typeof ngDevMode === 'undefined' || ngDevMode)) {\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 override deserialize(value: any): Moment | null {\n let date;\n if (value instanceof Date) {\n date = this._createMoment(value).locale(this.locale);\n } else if (this.isDateInstance(value)) {\n // Note: assumes that cloning also sets the correct locale.\n return this.clone(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 this._createMoment(date).locale(this.locale);\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(\n date?: MomentInput,\n format?: MomentFormatSpecification,\n locale?: string,\n ): Moment {\n const {strict, useUtc}: MatMomentDateAdapterOptions = this._options || {};\n\n return useUtc ? moment.utc(date, format, locale, strict) : moment(date, format, locale, strict);\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\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@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\nexport * from './adapter/index';\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\nexport * from './public-api';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["_rollupMoment","_moment"],"mappings":";;;;;;AAAA;;;;;;;AAmBA,MAAM,MAAM,GAAGA,sBAAa,IAAIC,aAAO,CAAC;AAkBxC;MACa,+BAA+B,GAAG,IAAI,cAAc,CAC/D,iCAAiC,EACjC;IACE,UAAU,EAAE,MAAM;IAClB,OAAO,EAAE,uCAAuC;CACjD,EACD;AAEF;SACgB,uCAAuC;IACrD,OAAO;QACL,MAAM,EAAE,KAAK;KACd,CAAC;AACJ,CAAC;AAED;AACA,SAAS,KAAK,CAAI,MAAc,EAAE,aAAmC;IACnE,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;AACrB,CAAC;AAED;MAEa,0BAA0B,WAAmB;IAgBxD,YACuC,UAAkB,EAG/C,QAAsC;QAE9C,KAAK,EAAE,CAAC;QAFA,aAAQ,GAAR,QAAQ,CAA8B;QAG9C,IAAI,CAAC,SAAS,CAAC,UAAU,IAAI,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC;KAC/C;IAEQ,SAAS,CAAC,MAAc;QAC/B,KAAK,CAAC,SAAS,CAA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gBAAgB,CAAC;oBAC3B,SAAS,EAAE,CAAC,EAAC,OAAO,EAAE,gBAAgB,EAAE,QAAQ,EAAE,uBAAuB,EAAC,CAAC;iBAC5E;;;AC9BD;;;;;;;;ACAA;;;;;;;;ACAA;;;;;;"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
1
2
|
import { InjectionToken, Injectable, Optional, Inject, NgModule } from '@angular/core';
|
|
2
3
|
import { DateAdapter, MAT_DATE_LOCALE, MAT_DATE_FORMATS } from '@angular/material/core';
|
|
3
4
|
import * as _rollupMoment from 'moment';
|
|
@@ -14,12 +15,12 @@ const moment = _rollupMoment__default || _rollupMoment;
|
|
|
14
15
|
/** InjectionToken for moment date adapter to configure options. */
|
|
15
16
|
const MAT_MOMENT_DATE_ADAPTER_OPTIONS = new InjectionToken('MAT_MOMENT_DATE_ADAPTER_OPTIONS', {
|
|
16
17
|
providedIn: 'root',
|
|
17
|
-
factory: MAT_MOMENT_DATE_ADAPTER_OPTIONS_FACTORY
|
|
18
|
+
factory: MAT_MOMENT_DATE_ADAPTER_OPTIONS_FACTORY,
|
|
18
19
|
});
|
|
19
20
|
/** @docs-private */
|
|
20
21
|
function MAT_MOMENT_DATE_ADAPTER_OPTIONS_FACTORY() {
|
|
21
22
|
return {
|
|
22
|
-
useUtc: false
|
|
23
|
+
useUtc: false,
|
|
23
24
|
};
|
|
24
25
|
}
|
|
25
26
|
/** Creates an array and fills it with values. */
|
|
@@ -44,7 +45,7 @@ class MomentDateAdapter extends DateAdapter {
|
|
|
44
45
|
firstDayOfWeek: momentLocaleData.firstDayOfWeek(),
|
|
45
46
|
longMonths: momentLocaleData.months(),
|
|
46
47
|
shortMonths: momentLocaleData.monthsShort(),
|
|
47
|
-
dates: range(31,
|
|
48
|
+
dates: range(31, i => this.createDate(2017, 0, i + 1).format('D')),
|
|
48
49
|
longDaysOfWeek: momentLocaleData.weekdays(),
|
|
49
50
|
shortDaysOfWeek: momentLocaleData.weekdaysShort(),
|
|
50
51
|
narrowDaysOfWeek: momentLocaleData.weekdaysMin(),
|
|
@@ -173,18 +174,24 @@ class MomentDateAdapter extends DateAdapter {
|
|
|
173
174
|
/** Creates a Moment instance while respecting the current UTC settings. */
|
|
174
175
|
_createMoment(date, format, locale) {
|
|
175
176
|
const { strict, useUtc } = this._options || {};
|
|
176
|
-
return useUtc
|
|
177
|
-
? moment.utc(date, format, locale, strict)
|
|
178
|
-
: moment(date, format, locale, strict);
|
|
177
|
+
return useUtc ? moment.utc(date, format, locale, strict) : moment(date, format, locale, strict);
|
|
179
178
|
}
|
|
180
179
|
}
|
|
181
|
-
MomentDateAdapter
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
180
|
+
MomentDateAdapter.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.0-next.15", ngImport: i0, type: MomentDateAdapter, deps: [{ token: MAT_DATE_LOCALE, optional: true }, { token: MAT_MOMENT_DATE_ADAPTER_OPTIONS, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
181
|
+
MomentDateAdapter.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.0.0-next.15", ngImport: i0, type: MomentDateAdapter });
|
|
182
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.0-next.15", ngImport: i0, type: MomentDateAdapter, decorators: [{
|
|
183
|
+
type: Injectable
|
|
184
|
+
}], ctorParameters: function () { return [{ type: undefined, decorators: [{
|
|
185
|
+
type: Optional
|
|
186
|
+
}, {
|
|
187
|
+
type: Inject,
|
|
188
|
+
args: [MAT_DATE_LOCALE]
|
|
189
|
+
}] }, { type: undefined, decorators: [{
|
|
190
|
+
type: Optional
|
|
191
|
+
}, {
|
|
192
|
+
type: Inject,
|
|
193
|
+
args: [MAT_MOMENT_DATE_ADAPTER_OPTIONS]
|
|
194
|
+
}] }]; } });
|
|
188
195
|
|
|
189
196
|
/**
|
|
190
197
|
* @license
|
|
@@ -214,26 +221,47 @@ const MAT_MOMENT_DATE_FORMATS = {
|
|
|
214
221
|
*/
|
|
215
222
|
class MomentDateModule {
|
|
216
223
|
}
|
|
217
|
-
MomentDateModule
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
224
|
+
MomentDateModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.0-next.15", ngImport: i0, type: MomentDateModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
225
|
+
MomentDateModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.0.0-next.15", ngImport: i0, type: MomentDateModule });
|
|
226
|
+
MomentDateModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.0.0-next.15", ngImport: i0, type: MomentDateModule, providers: [
|
|
227
|
+
{
|
|
228
|
+
provide: DateAdapter,
|
|
229
|
+
useClass: MomentDateAdapter,
|
|
230
|
+
deps: [MAT_DATE_LOCALE, MAT_MOMENT_DATE_ADAPTER_OPTIONS],
|
|
231
|
+
},
|
|
232
|
+
] });
|
|
233
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.0-next.15", ngImport: i0, type: MomentDateModule, decorators: [{
|
|
234
|
+
type: NgModule,
|
|
235
|
+
args: [{
|
|
236
|
+
providers: [
|
|
237
|
+
{
|
|
238
|
+
provide: DateAdapter,
|
|
239
|
+
useClass: MomentDateAdapter,
|
|
240
|
+
deps: [MAT_DATE_LOCALE, MAT_MOMENT_DATE_ADAPTER_OPTIONS],
|
|
241
|
+
},
|
|
242
|
+
],
|
|
243
|
+
}]
|
|
244
|
+
}] });
|
|
229
245
|
class MatMomentDateModule {
|
|
230
246
|
}
|
|
231
|
-
MatMomentDateModule
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
247
|
+
MatMomentDateModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.0-next.15", ngImport: i0, type: MatMomentDateModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
248
|
+
MatMomentDateModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.0.0-next.15", ngImport: i0, type: MatMomentDateModule, imports: [MomentDateModule] });
|
|
249
|
+
MatMomentDateModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.0.0-next.15", ngImport: i0, type: MatMomentDateModule, providers: [{ provide: MAT_DATE_FORMATS, useValue: MAT_MOMENT_DATE_FORMATS }], imports: [[MomentDateModule]] });
|
|
250
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.0-next.15", ngImport: i0, type: MatMomentDateModule, decorators: [{
|
|
251
|
+
type: NgModule,
|
|
252
|
+
args: [{
|
|
253
|
+
imports: [MomentDateModule],
|
|
254
|
+
providers: [{ provide: MAT_DATE_FORMATS, useValue: MAT_MOMENT_DATE_FORMATS }],
|
|
255
|
+
}]
|
|
256
|
+
}] });
|
|
257
|
+
|
|
258
|
+
/**
|
|
259
|
+
* @license
|
|
260
|
+
* Copyright Google LLC All Rights Reserved.
|
|
261
|
+
*
|
|
262
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
263
|
+
* found in the LICENSE file at https://angular.io/license
|
|
264
|
+
*/
|
|
237
265
|
|
|
238
266
|
/**
|
|
239
267
|
* @license
|
|
@@ -247,5 +275,5 @@ MatMomentDateModule.decorators = [
|
|
|
247
275
|
* Generated bundle index. Do not edit.
|
|
248
276
|
*/
|
|
249
277
|
|
|
250
|
-
export { MAT_MOMENT_DATE_ADAPTER_OPTIONS, MAT_MOMENT_DATE_ADAPTER_OPTIONS_FACTORY, MAT_MOMENT_DATE_FORMATS, MatMomentDateModule, MomentDateAdapter, MomentDateModule
|
|
251
|
-
//# sourceMappingURL=material-moment-adapter.
|
|
278
|
+
export { MAT_MOMENT_DATE_ADAPTER_OPTIONS, MAT_MOMENT_DATE_ADAPTER_OPTIONS_FACTORY, MAT_MOMENT_DATE_FORMATS, MatMomentDateModule, MomentDateAdapter, MomentDateModule };
|
|
279
|
+
//# sourceMappingURL=material-moment-adapter.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"material-moment-adapter.mjs","sources":["../../../../../../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","../../../../../../src/material-moment-adapter/public-api.ts","../../../../../../src/material-moment-adapter/index.ts","../../../../../../src/material-moment-adapter/material-moment-adapter_public_index.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 {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, MomentFormatSpecification, MomentInput} from 'moment';\n\nconst moment = _rollupMoment || _moment;\n\n/** Configurable options for {@see MomentDateAdapter}. */\nexport interface MatMomentDateAdapterOptions {\n /**\n * When enabled, the dates have to match the format exactly.\n * See https://momentjs.com/guides/#/parsing/strict-mode/.\n */\n strict?: boolean;\n\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 {\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/** 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/** 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(\n @Optional() @Inject(MAT_DATE_LOCALE) dateLocale: string,\n @Optional()\n @Inject(MAT_MOMENT_DATE_ADAPTER_OPTIONS)\n private _options?: MatMomentDateAdapterOptions,\n ) {\n super();\n this.setLocale(dateLocale || moment.locale());\n }\n\n override 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 (typeof ngDevMode === 'undefined' || ngDevMode) {\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\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() && (typeof ngDevMode === 'undefined' || ngDevMode)) {\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) && (typeof ngDevMode === 'undefined' || ngDevMode)) {\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 override deserialize(value: any): Moment | null {\n let date;\n if (value instanceof Date) {\n date = this._createMoment(value).locale(this.locale);\n } else if (this.isDateInstance(value)) {\n // Note: assumes that cloning also sets the correct locale.\n return this.clone(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 this._createMoment(date).locale(this.locale);\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(\n date?: MomentInput,\n format?: MomentFormatSpecification,\n locale?: string,\n ): Moment {\n const {strict, useUtc}: MatMomentDateAdapterOptions = this._options || {};\n\n return useUtc ? moment.utc(date, format, locale, strict) : moment(date, format, locale, strict);\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\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@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\nexport * from './adapter/index';\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\nexport * from './public-api';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["_rollupMoment","_moment"],"mappings":";;;;;;AAAA;;;;;;;AAmBA,MAAM,MAAM,GAAGA,sBAAa,IAAIC,aAAO,CAAC;AAkBxC;MACa,+BAA+B,GAAG,IAAI,cAAc,CAC/D,iCAAiC,EACjC;IACE,UAAU,EAAE,MAAM;IAClB,OAAO,EAAE,uCAAu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ChC;;;ACnBH;;;;;;;MAyBa,gBAAgB;;qHAAhB,gBAAgB;sHAAhB,gBAAgB;sHAAhB,gBAAgB,aARhB;QACT;YACE,OAAO,EAAE,WAAW;YACpB,QAAQ,EAAE,iBAAiB;YAC3B,IAAI,EAAE,CAAC,eAAe,EAAE,+BAA+B,CAAC;SACzD;KACF;mGAEU,gBAAgB;kBAT5B,QAAQ;mBAAC;oBACR,SAAS,EAAE;wBACT;4BACE,OAAO,EAAE,WAAW;4BACpB,QAAQ,EAAE,iBAAiB;4BAC3B,IAAI,EAAE,CAAC,eAAe,EAAE,+BAA+B,CAAC;yBACzD;qBACF;iBACF;;MAOY,mBAAmB;;wHAAnB,mBAAmB;yHAAnB,mBAAmB,YANnB,gBAAgB;yHAMhB,mBAAmB,aAFnB,CAAC,EAAC,OAAO,EAAE,gBAAgB,EAAE,QAAQ,EAAE,uBAAuB,EAAC,CAAC,YADlE,CAAC,gBAAgB,CAAC;mGAGhB,mBAAmB;kBAJ/B,QAAQ;mBAAC;oBACR,OAAO,EAAE,CAAC,gBAAgB,CAAC;oBAC3B,SAAS,EAAE,CAAC,EAAC,OAAO,EAAE,gBAAgB,EAAE,QAAQ,EAAE,uBAAuB,EAAC,CAAC;iBAC5E;;;AC9BD;;;;;;;;ACAA;;;;;;;;ACAA;;;;;;"}
|
package/index.d.ts
CHANGED
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright Google LLC All Rights Reserved.
|
|
4
|
+
*
|
|
5
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
6
|
+
* found in the LICENSE file at https://angular.io/license
|
|
3
7
|
*/
|
|
4
8
|
export * from './public-api';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@angular/material-moment-adapter",
|
|
3
|
-
"version": "13.0.0-
|
|
3
|
+
"version": "13.0.0-rc.2",
|
|
4
4
|
"description": "Angular Material Moment Adapter",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -12,12 +12,12 @@
|
|
|
12
12
|
},
|
|
13
13
|
"homepage": "https://github.com/angular/components#readme",
|
|
14
14
|
"peerDependencies": {
|
|
15
|
-
"@angular/material": "13.0.0-
|
|
15
|
+
"@angular/material": "13.0.0-rc.2",
|
|
16
16
|
"@angular/core": "^13.0.0-0 || ^14.0.0-0",
|
|
17
17
|
"moment": "^2.18.1"
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"tslib": "^2.
|
|
20
|
+
"tslib": "^2.3.0"
|
|
21
21
|
},
|
|
22
22
|
"ng-update": {
|
|
23
23
|
"packageGroup": [
|
|
@@ -27,10 +27,24 @@
|
|
|
27
27
|
]
|
|
28
28
|
},
|
|
29
29
|
"sideEffects": false,
|
|
30
|
-
"
|
|
31
|
-
"fesm2015": "./fesm2015/material-moment-adapter.
|
|
32
|
-
"
|
|
33
|
-
"typings": "./
|
|
34
|
-
"module": "./fesm2015/material-moment-adapter.
|
|
35
|
-
"
|
|
30
|
+
"fesm2020": "./fesm2020/material-moment-adapter.mjs",
|
|
31
|
+
"fesm2015": "./fesm2015/material-moment-adapter.mjs",
|
|
32
|
+
"esm2020": "./esm2020/material-moment-adapter_public_index.mjs",
|
|
33
|
+
"typings": "./material-moment-adapter_public_index.d.ts",
|
|
34
|
+
"module": "./fesm2015/material-moment-adapter.mjs",
|
|
35
|
+
"es2020": "./fesm2020/material-moment-adapter.mjs",
|
|
36
|
+
"type": "module",
|
|
37
|
+
"exports": {
|
|
38
|
+
"./package.json": {
|
|
39
|
+
"default": "./package.json"
|
|
40
|
+
},
|
|
41
|
+
".": {
|
|
42
|
+
"types": "./material-moment-adapter_public_index.d.ts",
|
|
43
|
+
"esm2020": "./esm2020/material-moment-adapter_public_index.mjs",
|
|
44
|
+
"es2020": "./fesm2020/material-moment-adapter.mjs",
|
|
45
|
+
"es2015": "./fesm2015/material-moment-adapter.mjs",
|
|
46
|
+
"node": "./fesm2015/material-moment-adapter.mjs",
|
|
47
|
+
"default": "./fesm2020/material-moment-adapter.mjs"
|
|
48
|
+
}
|
|
49
|
+
}
|
|
36
50
|
}
|