@sumaris-net/ngx-components 1.14.1 → 1.15.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/sumaris-net.ngx-components.umd.js +362 -194
- package/bundles/sumaris-net.ngx-components.umd.js.map +1 -1
- package/bundles/sumaris-net.ngx-components.umd.min.js +2 -2
- package/bundles/sumaris-net.ngx-components.umd.min.js.map +1 -1
- package/doc/changelog.md +9 -0
- package/esm2015/src/app/shared/dates.js +23 -1
- package/esm2015/src/app/shared/material/datetime/material.date.js +124 -101
- package/esm2015/src/app/shared/material/datetime/material.datetime.js +58 -59
- package/esm2015/src/app/shared/material/datetime/testing/mat-date.test.js +102 -0
- package/esm2015/src/app/shared/material/material.testing.module.js +10 -1
- package/esm2015/src/app/shared/validator/validators.js +20 -9
- package/esm2015/sumaris-net.ngx-components.js +6 -5
- package/fesm2015/sumaris-net.ngx-components.js +342 -187
- package/fesm2015/sumaris-net.ngx-components.js.map +1 -1
- package/package.json +2 -1
- package/src/app/shared/dates.d.ts +8 -0
- package/src/app/shared/material/datetime/material.date.d.ts +19 -14
- package/src/app/shared/material/datetime/material.datetime.d.ts +5 -5
- package/src/app/shared/material/datetime/testing/mat-date.test.d.ts +28 -0
- package/src/app/shared/validator/validators.d.ts +3 -1
- package/src/assets/i18n/en-US.json +1 -0
- package/src/assets/i18n/en.json +1 -0
- package/src/assets/i18n/fr.json +1 -0
- package/sumaris-net.ngx-components.d.ts +5 -4
- package/sumaris-net.ngx-components.metadata.json +1 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
(function (global, factory) {
|
|
2
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/common'), require('@angular/cdk/table'), require('@angular/cdk/a11y'), require('@angular/cdk/overlay'), require('@angular/cdk/scrolling'), require('@angular/material/core'), require('@angular/material/table'), require('@angular/material/sort'), require('@angular/material/paginator'), require('@angular/material/form-field'), require('@angular/material/input'), require('@angular/material/checkbox'), require('@angular/material/expansion'), require('@angular/material/toolbar'), require('@angular/material/icon'), require('@angular/material/button'), require('@angular/material/menu'), require('@angular/material/select'), require('@angular/material/card'), require('@angular/material/tabs'), require('@angular/material/stepper'), require('@angular/material/list'), require('@angular/material/button-toggle'), require('@angular/material/progress-spinner'), require('@angular/material/progress-bar'), require('@angular/material/radio'), require('@angular/material/badge'), require('@angular/material/slide-toggle'), require('@angular/material/dialog'), require('@angular/material/autocomplete'), require('@angular/forms'), require('rxjs'), require('rxjs/operators'), require('@ngx-translate/core'), require('@ionic/angular'), require('moment'), require('@angular/material-moment-adapter'), require('@ionic-native/keyboard/ngx'), require('angular2-text-mask'), require('ngx-material-timepicker'), require('@angular/material/datepicker'), require('@angular/animations'), require('@angular/material/divider'), require('@angular/material/tooltip'), require('@angular/material/chips'), require('@angular/router'), require('@angular/platform-browser'), require('@angular/common/http'), require('ngx-color-picker'), require('@ionic-native/native-audio/ngx'), require('@ionic-native/vibration/ngx'), require('@ionic-native/audio-management/ngx'), require('@ionic-native/native-audio/ngx/index'), require('@ionic-native/vibration/ngx/index'), require('@ionic-native/audio-management/ngx/index'), require('uuid/v4'), require('@angular/cdk/drag-drop'), require('ngx-markdown'), require('tweetnacl'), require('@ionic/storage'), require('zone.js/dist/zone-error'), require('@ionic-native/splash-screen/ngx'), require('@ionic-native/network/ngx'), require('ionic-cache'), require('ionic-cache/dist/cache.service'), require('@ionic-native/network/ngx/index'), require('@ionic-native/splash-screen/ngx/index'), require('@ionic-native/status-bar/ngx'), require('@angular/cdk/platform'), require('@ionic-native/in-app-browser/ngx'), require('@apollo/client/core'), require('apollo-angular'), require('@apollo/client/link/ws'), require('@apollo/client/utilities'), require('@apollo/client/link/retry'), require('apollo-link-queue'), require('apollo-link-serialize'), require('apollo-link-logger'), require('apollo-angular/http'), require('apollo3-cache-persist'), require('@ionic-native/downloader/ngx'), require('@ionic-native/status-bar/ngx/index'), require('@ionic-native/keyboard/ngx/index'), require('@ionic-native/in-app-browser/ngx/index'), require('@ionic-native/downloader/ngx/index'), require('@angular/cdk/text-field'), require('@e-is/ngx-material-table'), require('@angular/cdk/collections'), require('ngx-jdenticon'), require('tweetnacl-util'), require('scrypt-async'), require('hammerjs')) :
|
|
3
|
-
typeof define === 'function' && define.amd ? define('@sumaris-net/ngx-components', ['exports', '@angular/core', '@angular/common', '@angular/cdk/table', '@angular/cdk/a11y', '@angular/cdk/overlay', '@angular/cdk/scrolling', '@angular/material/core', '@angular/material/table', '@angular/material/sort', '@angular/material/paginator', '@angular/material/form-field', '@angular/material/input', '@angular/material/checkbox', '@angular/material/expansion', '@angular/material/toolbar', '@angular/material/icon', '@angular/material/button', '@angular/material/menu', '@angular/material/select', '@angular/material/card', '@angular/material/tabs', '@angular/material/stepper', '@angular/material/list', '@angular/material/button-toggle', '@angular/material/progress-spinner', '@angular/material/progress-bar', '@angular/material/radio', '@angular/material/badge', '@angular/material/slide-toggle', '@angular/material/dialog', '@angular/material/autocomplete', '@angular/forms', 'rxjs', 'rxjs/operators', '@ngx-translate/core', '@ionic/angular', 'moment', '@angular/material-moment-adapter', '@ionic-native/keyboard/ngx', 'angular2-text-mask', 'ngx-material-timepicker', '@angular/material/datepicker', '@angular/animations', '@angular/material/divider', '@angular/material/tooltip', '@angular/material/chips', '@angular/router', '@angular/platform-browser', '@angular/common/http', 'ngx-color-picker', '@ionic-native/native-audio/ngx', '@ionic-native/vibration/ngx', '@ionic-native/audio-management/ngx', '@ionic-native/native-audio/ngx/index', '@ionic-native/vibration/ngx/index', '@ionic-native/audio-management/ngx/index', 'uuid/v4', '@angular/cdk/drag-drop', 'ngx-markdown', 'tweetnacl', '@ionic/storage', 'zone.js/dist/zone-error', '@ionic-native/splash-screen/ngx', '@ionic-native/network/ngx', 'ionic-cache', 'ionic-cache/dist/cache.service', '@ionic-native/network/ngx/index', '@ionic-native/splash-screen/ngx/index', '@ionic-native/status-bar/ngx', '@angular/cdk/platform', '@ionic-native/in-app-browser/ngx', '@apollo/client/core', 'apollo-angular', '@apollo/client/link/ws', '@apollo/client/utilities', '@apollo/client/link/retry', 'apollo-link-queue', 'apollo-link-serialize', 'apollo-link-logger', 'apollo-angular/http', 'apollo3-cache-persist', '@ionic-native/downloader/ngx', '@ionic-native/status-bar/ngx/index', '@ionic-native/keyboard/ngx/index', '@ionic-native/in-app-browser/ngx/index', '@ionic-native/downloader/ngx/index', '@angular/cdk/text-field', '@e-is/ngx-material-table', '@angular/cdk/collections', 'ngx-jdenticon', 'tweetnacl-util', 'scrypt-async', 'hammerjs'], factory) :
|
|
4
|
-
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global["sumaris-net"] = global["sumaris-net"] || {}, global["sumaris-net"]["ngx-components"] = {}), global.ng.core, global.ng.common, global.ng.cdk.table, global.ng.cdk.a11y, global.ng.cdk.overlay, global.ng.cdk.scrolling, global.ng.material.core, global.ng.material.table, global.ng.material.sort, global.ng.material.paginator, global.ng.material.formField, global.ng.material.input, global.ng.material.checkbox, global.ng.material.expansion, global.ng.material.toolbar, global.ng.material.icon, global.ng.material.button, global.ng.material.menu, global.ng.material.select, global.ng.material.card, global.ng.material.tabs, global.ng.material.stepper, global.ng.material.list, global.ng.material.buttonToggle, global.ng.material.progressSpinner, global.ng.material.progressBar, global.ng.material.radio, global.ng.material.badge, global.ng.material.slideToggle, global.ng.material.dialog, global.ng.material.autocomplete, global.ng.forms, global.rxjs, global.rxjs.operators, global["ngx-translate"].core, global.ionic.angular, global.moment, global.ng.materialMomentAdapter, global["ionic-native"].keyboard.ngx, global["angular2-text-mask"], global["ngx-material-timepicker"], global.ng.material.datepicker, global.ng.animations, global.ng.material.divider, global.ng.material.tooltip, global.ng.material.chips, global.ng.router, global.ng.platformBrowser, global.ng.common.http, global["ngx-color-picker"], global["ionic-native"]["native-audio"].ngx, global["ionic-native"].vibration.ngx, global["ionic-native"]["audio-management"].ngx, global["ionic-native"]["native-audio"].ngx.index, global["ionic-native"].vibration.ngx.index, global["ionic-native"]["audio-management"].ngx.index, global.uuid.v4, global.ng.cdk.dragDrop, global["ngx-markdown"], global.tweetnacl, global.ionic.storage, null, global["ionic-native"]["splash-screen"].ngx, global["ionic-native"].network.ngx, global["ionic-cache"], global["ionic-cache/dist/cache"].service, global["ionic-native"].network.ngx.index, global["ionic-native"]["splash-screen"].ngx.index, global["ionic-native"]["status-bar"].ngx, global.ng.cdk.platform, global["ionic-native"]["in-app-browser"].ngx, global.apollo.client.core, global["apollo-angular"], global.apollo.client.link.ws, global.apollo.client.utilities, global.apollo.client.link.retry, global["apollo-link-queue"], global["apollo-link-serialize"], global["apollo-link-logger"], global["apollo-angular"].http, global["apollo3-cache-persist"], global["ionic-native"].downloader.ngx, global["ionic-native"]["status-bar"].ngx.index, global["ionic-native"].keyboard.ngx.index, global["ionic-native"]["in-app-browser"].ngx.index, global["ionic-native"].downloader.ngx.index, global.ng.cdk.textField, global["e-is"]["ngx-material-table"], global.ng.cdk.collections, global["ngx-jdenticon"]));
|
|
5
|
-
})(this, (function (exports, i0, i1$4, table$1, a11y, overlay, scrolling, i1$3, table, sort$1, paginator, formField, input, checkbox, expansion, toolbar, icon, button, menu, select, card, tabs, stepper, list, buttonToggle, progressSpinner, progressBar, radio, badge, slideToggle, i2, autocomplete, i1, rxjs, operators, i1$2, i1$5, momentImported, i1$1, ngx, angular2TextMask, ngxMaterialTimepicker, datepicker, animations, divider, tooltip, chips, i3, i1$6, i2$1, ngxColorPicker, ngx$2, ngx$3, ngx$1, i2$2, i3$1, i4, uuidv4Imported, dragDrop, ngxMarkdown, tweetnacl, i3$2, zoneError, ngx$5, ngx$4, ionicCache, i6, i9, i10, ngx$7, i2$4, ngx$8, core, i2$3, ws, utilities, retry, QueueLink, SerializingLink, loggerLink, i3$3, apollo3CachePersist, ngx$6, i14, i15, i17, i18, textField, ngxMaterialTable, collections, ngxJdenticon) { 'use strict';
|
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/common'), require('@angular/cdk/table'), require('@angular/cdk/a11y'), require('@angular/cdk/overlay'), require('@angular/cdk/scrolling'), require('@angular/material/core'), require('@angular/material/table'), require('@angular/material/sort'), require('@angular/material/paginator'), require('@angular/material/form-field'), require('@angular/material/input'), require('@angular/material/checkbox'), require('@angular/material/expansion'), require('@angular/material/toolbar'), require('@angular/material/icon'), require('@angular/material/button'), require('@angular/material/menu'), require('@angular/material/select'), require('@angular/material/card'), require('@angular/material/tabs'), require('@angular/material/stepper'), require('@angular/material/list'), require('@angular/material/button-toggle'), require('@angular/material/progress-spinner'), require('@angular/material/progress-bar'), require('@angular/material/radio'), require('@angular/material/badge'), require('@angular/material/slide-toggle'), require('@angular/material/dialog'), require('@angular/material/autocomplete'), require('@angular/forms'), require('rxjs'), require('rxjs/operators'), require('@ngx-translate/core'), require('@ionic/angular'), require('moment'), require('@angular/material-moment-adapter'), require('moment-timezone'), require('@ionic-native/keyboard/ngx'), require('angular2-text-mask'), require('ngx-material-timepicker'), require('@angular/material/datepicker'), require('@angular/animations'), require('@angular/material/divider'), require('@angular/material/tooltip'), require('@angular/material/chips'), require('@angular/router'), require('@angular/platform-browser'), require('@angular/common/http'), require('ngx-color-picker'), require('@ionic-native/native-audio/ngx'), require('@ionic-native/vibration/ngx'), require('@ionic-native/audio-management/ngx'), require('@ionic-native/native-audio/ngx/index'), require('@ionic-native/vibration/ngx/index'), require('@ionic-native/audio-management/ngx/index'), require('uuid/v4'), require('@angular/cdk/drag-drop'), require('ngx-markdown'), require('tweetnacl'), require('@ionic/storage'), require('zone.js/dist/zone-error'), require('@ionic-native/splash-screen/ngx'), require('@ionic-native/network/ngx'), require('ionic-cache'), require('ionic-cache/dist/cache.service'), require('@ionic-native/network/ngx/index'), require('@ionic-native/splash-screen/ngx/index'), require('@ionic-native/status-bar/ngx'), require('@angular/cdk/platform'), require('@ionic-native/in-app-browser/ngx'), require('@apollo/client/core'), require('apollo-angular'), require('@apollo/client/link/ws'), require('@apollo/client/utilities'), require('@apollo/client/link/retry'), require('apollo-link-queue'), require('apollo-link-serialize'), require('apollo-link-logger'), require('apollo-angular/http'), require('apollo3-cache-persist'), require('@ionic-native/downloader/ngx'), require('@ionic-native/status-bar/ngx/index'), require('@ionic-native/keyboard/ngx/index'), require('@ionic-native/in-app-browser/ngx/index'), require('@ionic-native/downloader/ngx/index'), require('@angular/cdk/text-field'), require('@e-is/ngx-material-table'), require('@angular/cdk/collections'), require('ngx-jdenticon'), require('tweetnacl-util'), require('scrypt-async'), require('hammerjs')) :
|
|
3
|
+
typeof define === 'function' && define.amd ? define('@sumaris-net/ngx-components', ['exports', '@angular/core', '@angular/common', '@angular/cdk/table', '@angular/cdk/a11y', '@angular/cdk/overlay', '@angular/cdk/scrolling', '@angular/material/core', '@angular/material/table', '@angular/material/sort', '@angular/material/paginator', '@angular/material/form-field', '@angular/material/input', '@angular/material/checkbox', '@angular/material/expansion', '@angular/material/toolbar', '@angular/material/icon', '@angular/material/button', '@angular/material/menu', '@angular/material/select', '@angular/material/card', '@angular/material/tabs', '@angular/material/stepper', '@angular/material/list', '@angular/material/button-toggle', '@angular/material/progress-spinner', '@angular/material/progress-bar', '@angular/material/radio', '@angular/material/badge', '@angular/material/slide-toggle', '@angular/material/dialog', '@angular/material/autocomplete', '@angular/forms', 'rxjs', 'rxjs/operators', '@ngx-translate/core', '@ionic/angular', 'moment', '@angular/material-moment-adapter', 'moment-timezone', '@ionic-native/keyboard/ngx', 'angular2-text-mask', 'ngx-material-timepicker', '@angular/material/datepicker', '@angular/animations', '@angular/material/divider', '@angular/material/tooltip', '@angular/material/chips', '@angular/router', '@angular/platform-browser', '@angular/common/http', 'ngx-color-picker', '@ionic-native/native-audio/ngx', '@ionic-native/vibration/ngx', '@ionic-native/audio-management/ngx', '@ionic-native/native-audio/ngx/index', '@ionic-native/vibration/ngx/index', '@ionic-native/audio-management/ngx/index', 'uuid/v4', '@angular/cdk/drag-drop', 'ngx-markdown', 'tweetnacl', '@ionic/storage', 'zone.js/dist/zone-error', '@ionic-native/splash-screen/ngx', '@ionic-native/network/ngx', 'ionic-cache', 'ionic-cache/dist/cache.service', '@ionic-native/network/ngx/index', '@ionic-native/splash-screen/ngx/index', '@ionic-native/status-bar/ngx', '@angular/cdk/platform', '@ionic-native/in-app-browser/ngx', '@apollo/client/core', 'apollo-angular', '@apollo/client/link/ws', '@apollo/client/utilities', '@apollo/client/link/retry', 'apollo-link-queue', 'apollo-link-serialize', 'apollo-link-logger', 'apollo-angular/http', 'apollo3-cache-persist', '@ionic-native/downloader/ngx', '@ionic-native/status-bar/ngx/index', '@ionic-native/keyboard/ngx/index', '@ionic-native/in-app-browser/ngx/index', '@ionic-native/downloader/ngx/index', '@angular/cdk/text-field', '@e-is/ngx-material-table', '@angular/cdk/collections', 'ngx-jdenticon', 'tweetnacl-util', 'scrypt-async', 'hammerjs'], factory) :
|
|
4
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global["sumaris-net"] = global["sumaris-net"] || {}, global["sumaris-net"]["ngx-components"] = {}), global.ng.core, global.ng.common, global.ng.cdk.table, global.ng.cdk.a11y, global.ng.cdk.overlay, global.ng.cdk.scrolling, global.ng.material.core, global.ng.material.table, global.ng.material.sort, global.ng.material.paginator, global.ng.material.formField, global.ng.material.input, global.ng.material.checkbox, global.ng.material.expansion, global.ng.material.toolbar, global.ng.material.icon, global.ng.material.button, global.ng.material.menu, global.ng.material.select, global.ng.material.card, global.ng.material.tabs, global.ng.material.stepper, global.ng.material.list, global.ng.material.buttonToggle, global.ng.material.progressSpinner, global.ng.material.progressBar, global.ng.material.radio, global.ng.material.badge, global.ng.material.slideToggle, global.ng.material.dialog, global.ng.material.autocomplete, global.ng.forms, global.rxjs, global.rxjs.operators, global["ngx-translate"].core, global.ionic.angular, global.moment, global.ng.materialMomentAdapter, global.momentTZImported, global["ionic-native"].keyboard.ngx, global["angular2-text-mask"], global["ngx-material-timepicker"], global.ng.material.datepicker, global.ng.animations, global.ng.material.divider, global.ng.material.tooltip, global.ng.material.chips, global.ng.router, global.ng.platformBrowser, global.ng.common.http, global["ngx-color-picker"], global["ionic-native"]["native-audio"].ngx, global["ionic-native"].vibration.ngx, global["ionic-native"]["audio-management"].ngx, global["ionic-native"]["native-audio"].ngx.index, global["ionic-native"].vibration.ngx.index, global["ionic-native"]["audio-management"].ngx.index, global.uuid.v4, global.ng.cdk.dragDrop, global["ngx-markdown"], global.tweetnacl, global.ionic.storage, null, global["ionic-native"]["splash-screen"].ngx, global["ionic-native"].network.ngx, global["ionic-cache"], global["ionic-cache/dist/cache"].service, global["ionic-native"].network.ngx.index, global["ionic-native"]["splash-screen"].ngx.index, global["ionic-native"]["status-bar"].ngx, global.ng.cdk.platform, global["ionic-native"]["in-app-browser"].ngx, global.apollo.client.core, global["apollo-angular"], global.apollo.client.link.ws, global.apollo.client.utilities, global.apollo.client.link.retry, global["apollo-link-queue"], global["apollo-link-serialize"], global["apollo-link-logger"], global["apollo-angular"].http, global["apollo3-cache-persist"], global["ionic-native"].downloader.ngx, global["ionic-native"]["status-bar"].ngx.index, global["ionic-native"].keyboard.ngx.index, global["ionic-native"]["in-app-browser"].ngx.index, global["ionic-native"].downloader.ngx.index, global.ng.cdk.textField, global["e-is"]["ngx-material-table"], global.ng.cdk.collections, global["ngx-jdenticon"]));
|
|
5
|
+
})(this, (function (exports, i0, i1$4, table$1, a11y, overlay, scrolling, i1$3, table, sort$1, paginator, formField, input, checkbox, expansion, toolbar, icon, button, menu, select, card, tabs, stepper, list, buttonToggle, progressSpinner, progressBar, radio, badge, slideToggle, i2, autocomplete, i1, rxjs, operators, i1$2, i1$5, momentImported, i1$1, momentTZImported, ngx, angular2TextMask, ngxMaterialTimepicker, datepicker, animations, divider, tooltip, chips, i3, i1$6, i2$1, ngxColorPicker, ngx$2, ngx$3, ngx$1, i2$2, i3$1, i4, uuidv4Imported, dragDrop, ngxMarkdown, tweetnacl, i3$2, zoneError, ngx$5, ngx$4, ionicCache, i6, i9, i10, ngx$7, i2$4, ngx$8, core, i2$3, ws, utilities, retry, QueueLink, SerializingLink, loggerLink, i3$3, apollo3CachePersist, ngx$6, i14, i15, i17, i18, textField, ngxMaterialTable, collections, ngxJdenticon) { 'use strict';
|
|
6
6
|
|
|
7
7
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
8
8
|
|
|
@@ -33,6 +33,7 @@
|
|
|
33
33
|
var i1__namespace$4 = /*#__PURE__*/_interopNamespace(i1$5);
|
|
34
34
|
var momentImported__namespace = /*#__PURE__*/_interopNamespace(momentImported);
|
|
35
35
|
var i1__namespace = /*#__PURE__*/_interopNamespace(i1$1);
|
|
36
|
+
var momentTZImported__namespace = /*#__PURE__*/_interopNamespace(momentTZImported);
|
|
36
37
|
var i3__namespace$3 = /*#__PURE__*/_interopNamespace(i3);
|
|
37
38
|
var i1__namespace$5 = /*#__PURE__*/_interopNamespace(i1$6);
|
|
38
39
|
var i2__namespace$2 = /*#__PURE__*/_interopNamespace(i2$1);
|
|
@@ -2091,7 +2092,7 @@
|
|
|
2091
2092
|
{ type: i1$2.TranslateService }
|
|
2092
2093
|
]; };
|
|
2093
2094
|
|
|
2094
|
-
var moment$
|
|
2095
|
+
var moment$7 = momentImported__namespace;
|
|
2095
2096
|
var DateDiffDurationPipe = /** @class */ (function () {
|
|
2096
2097
|
function DateDiffDurationPipe(dateAdapter, translate) {
|
|
2097
2098
|
var _this = this;
|
|
@@ -2108,10 +2109,10 @@
|
|
|
2108
2109
|
return this.format(startDate, endDate);
|
|
2109
2110
|
};
|
|
2110
2111
|
DateDiffDurationPipe.prototype.format = function (startDate, endDate) {
|
|
2111
|
-
var duration = moment$
|
|
2112
|
+
var duration = moment$7.duration(endDate.diff(startDate));
|
|
2112
2113
|
if (duration.asMinutes() < 0)
|
|
2113
2114
|
return '';
|
|
2114
|
-
var timeDuration = moment$
|
|
2115
|
+
var timeDuration = moment$7(0)
|
|
2115
2116
|
.hour(duration.hours())
|
|
2116
2117
|
.minute(duration.minutes());
|
|
2117
2118
|
var days = Math.floor(duration.asDays());
|
|
@@ -2571,7 +2572,8 @@
|
|
|
2571
2572
|
{ type: i0.Pipe, args: [{ name: 'fileSize' },] }
|
|
2572
2573
|
];
|
|
2573
2574
|
|
|
2574
|
-
var moment$
|
|
2575
|
+
var moment$6 = momentImported__namespace;
|
|
2576
|
+
var tz = momentTZImported__namespace;
|
|
2575
2577
|
var DATE_UNIX_TIMESTAMP = 'X';
|
|
2576
2578
|
var DATE_UNIX_MS_TIMESTAMP = 'x';
|
|
2577
2579
|
var DateUtils = /** @class */ (function () {
|
|
@@ -2594,6 +2596,26 @@
|
|
|
2594
2596
|
var d2 = fromDateISOString(date2);
|
|
2595
2597
|
return (!d1 && !d2) || d1.isSame(d2, granularity);
|
|
2596
2598
|
};
|
|
2599
|
+
/**
|
|
2600
|
+
* Create a copy of a date, without time fields (always return a new Moment object, or undefined).
|
|
2601
|
+
* Same implementation as the Java class Dates.resetTime() (see any SUMARiS like Pod)
|
|
2602
|
+
* @param value
|
|
2603
|
+
* @param timezone a timezone (see https://momentjs.com/timezone/)
|
|
2604
|
+
* @param keepLocalTime if true, only the timezone (and offset) is updated, keeping the local time same. Consequently, it will now point to a different point in time if the offset has changed.
|
|
2605
|
+
*/
|
|
2606
|
+
DateUtils.resetTime = function (value, timezone, keepLocalTime) {
|
|
2607
|
+
if (!value)
|
|
2608
|
+
return undefined;
|
|
2609
|
+
var date = fromDateISOString(value);
|
|
2610
|
+
// No timezone
|
|
2611
|
+
if (!timezone) {
|
|
2612
|
+
return date.clone().startOf('day');
|
|
2613
|
+
}
|
|
2614
|
+
// Use timezone
|
|
2615
|
+
return date.clone() // clone the original date
|
|
2616
|
+
.tz(timezone, keepLocalTime)
|
|
2617
|
+
.startOf('day');
|
|
2618
|
+
};
|
|
2597
2619
|
return DateUtils;
|
|
2598
2620
|
}());
|
|
2599
2621
|
function toDateISOString(value) {
|
|
@@ -2614,32 +2636,32 @@
|
|
|
2614
2636
|
if (!value || momentImported.isMoment(value))
|
|
2615
2637
|
return value;
|
|
2616
2638
|
// Parse the input value, as a ISO date time
|
|
2617
|
-
var date = moment$
|
|
2639
|
+
var date = moment$6(value, DATE_ISO_PATTERN);
|
|
2618
2640
|
if (date.isValid())
|
|
2619
2641
|
return date;
|
|
2620
2642
|
// Not valid: trying to convert from unix timestamp
|
|
2621
2643
|
if (typeof value === 'string') {
|
|
2622
2644
|
console.warn('Wrong date format - Trying to convert from local time: ' + value);
|
|
2623
2645
|
if (value.length === 10) {
|
|
2624
|
-
return moment$
|
|
2646
|
+
return moment$6(value, DATE_UNIX_TIMESTAMP);
|
|
2625
2647
|
}
|
|
2626
2648
|
else if (value.length === 13) {
|
|
2627
|
-
return moment$
|
|
2649
|
+
return moment$6(value, DATE_UNIX_MS_TIMESTAMP);
|
|
2628
2650
|
}
|
|
2629
2651
|
}
|
|
2630
2652
|
console.warn('Unable to parse date: ' + value);
|
|
2631
2653
|
return undefined;
|
|
2632
2654
|
}
|
|
2633
2655
|
function fromUnixTimestamp(timeInSec) {
|
|
2634
|
-
return moment$
|
|
2656
|
+
return moment$6(timeInSec, DATE_UNIX_TIMESTAMP);
|
|
2635
2657
|
}
|
|
2636
2658
|
function fromUnixMsTimestamp(timeInMs) {
|
|
2637
|
-
return moment$
|
|
2659
|
+
return moment$6(timeInMs, DATE_UNIX_MS_TIMESTAMP);
|
|
2638
2660
|
}
|
|
2639
2661
|
function toDuration(value, unit) {
|
|
2640
2662
|
if (!value)
|
|
2641
2663
|
return undefined;
|
|
2642
|
-
var duration = moment$
|
|
2664
|
+
var duration = moment$6.duration(value, unit);
|
|
2643
2665
|
// fix 990+ ms
|
|
2644
2666
|
if (duration.milliseconds() >= 990) {
|
|
2645
2667
|
duration.add(1000 - duration.milliseconds(), 'ms');
|
|
@@ -3139,7 +3161,7 @@
|
|
|
3139
3161
|
ngInit: [{ type: i0.Output }]
|
|
3140
3162
|
};
|
|
3141
3163
|
|
|
3142
|
-
var moment$
|
|
3164
|
+
var moment$5 = momentImported__namespace;
|
|
3143
3165
|
// @dynamic
|
|
3144
3166
|
var SharedValidators = /** @class */ (function () {
|
|
3145
3167
|
function SharedValidators() {
|
|
@@ -3156,14 +3178,6 @@
|
|
|
3156
3178
|
this._REGEXP_CACHE.DOUBLE_BY_MAX_DECIMALS[maxDecimals] = new RegExp("^[-]?[0-9]+([.,][0-9]{1," + maxDecimals + "})?$");
|
|
3157
3179
|
return this._REGEXP_CACHE.DOUBLE_BY_MAX_DECIMALS[maxDecimals];
|
|
3158
3180
|
};
|
|
3159
|
-
SharedValidators.validDate = function (control) {
|
|
3160
|
-
var value = control.value;
|
|
3161
|
-
var date = !value || moment$4.isMoment(value) ? value : moment$4(control.value, DATE_ISO_PATTERN);
|
|
3162
|
-
if (date && (!date.isValid() || date.year() < 1970)) {
|
|
3163
|
-
return { validDate: true };
|
|
3164
|
-
}
|
|
3165
|
-
return null;
|
|
3166
|
-
};
|
|
3167
3181
|
SharedValidators.latitude = function (control) {
|
|
3168
3182
|
var value = control.value;
|
|
3169
3183
|
if (isNotNil(value) && (value < -90 || value > 90)) {
|
|
@@ -3228,6 +3242,14 @@
|
|
|
3228
3242
|
return null;
|
|
3229
3243
|
};
|
|
3230
3244
|
};
|
|
3245
|
+
SharedValidators.validDate = function (control) {
|
|
3246
|
+
var value = control.value;
|
|
3247
|
+
var date = !value || moment$5.isMoment(value) ? value : moment$5(control.value, DATE_ISO_PATTERN);
|
|
3248
|
+
if (date && (!date.isValid() || date.year() < 1970)) {
|
|
3249
|
+
return { validDate: true };
|
|
3250
|
+
}
|
|
3251
|
+
return null;
|
|
3252
|
+
};
|
|
3231
3253
|
SharedValidators.dateIsAfter = function (previousValue, errorParam, granularity) {
|
|
3232
3254
|
return function (control) {
|
|
3233
3255
|
var value = fromDateISOString(control.value);
|
|
@@ -3238,6 +3260,16 @@
|
|
|
3238
3260
|
return null;
|
|
3239
3261
|
};
|
|
3240
3262
|
};
|
|
3263
|
+
SharedValidators.dateIsBefore = function (maxValue, errorParam, granularity) {
|
|
3264
|
+
return function (control) {
|
|
3265
|
+
var value = fromDateISOString(control.value);
|
|
3266
|
+
if (isNotNil(value) && isNotNil(maxValue) && value.isSameOrAfter(maxValue, granularity)) {
|
|
3267
|
+
// Return the error
|
|
3268
|
+
return { dateIsBefore: { maxDate: errorParam } };
|
|
3269
|
+
}
|
|
3270
|
+
return null;
|
|
3271
|
+
};
|
|
3272
|
+
};
|
|
3241
3273
|
SharedValidators.dateRangeEnd = function (startDateFieldName, msg) {
|
|
3242
3274
|
var errorCode = msg ? 'msg' : 'dateRange';
|
|
3243
3275
|
var error = msg ? { msg: msg } : { dateRange: true };
|
|
@@ -3333,6 +3365,7 @@
|
|
|
3333
3365
|
pubkey: 'ERROR.FIELD_NOT_VALID_PUBKEY',
|
|
3334
3366
|
validDate: 'ERROR.FIELD_NOT_VALID_DATE',
|
|
3335
3367
|
dateIsAfter: 'ERROR.FIELD_NOT_VALID_DATE_AFTER',
|
|
3368
|
+
dateIsBefore: 'ERROR.FIELD_NOT_VALID_DATE_BEFORE',
|
|
3336
3369
|
dateRange: 'ERROR.FIELD_NOT_VALID_DATE_RANGE',
|
|
3337
3370
|
dateMinDuration: 'ERROR.FIELD_NOT_VALID_DATE_MIN_DURATION',
|
|
3338
3371
|
dateMaxDuration: 'ERROR.FIELD_NOT_VALID_DATE_MAX_DURATION',
|
|
@@ -5310,6 +5343,7 @@
|
|
|
5310
5343
|
var ɵ0$9 = noop$6;
|
|
5311
5344
|
var MatDate = /** @class */ (function () {
|
|
5312
5345
|
function MatDate(platform, dateAdapter, translate, formBuilder, cd, keyboard, formGroupDir) {
|
|
5346
|
+
this.platform = platform;
|
|
5313
5347
|
this.dateAdapter = dateAdapter;
|
|
5314
5348
|
this.translate = translate;
|
|
5315
5349
|
this.formBuilder = formBuilder;
|
|
@@ -5319,21 +5353,29 @@
|
|
|
5319
5353
|
this._onChangeCallback = noop$6;
|
|
5320
5354
|
this._onTouchedCallback = noop$6;
|
|
5321
5355
|
this._subscription = new rxjs.Subscription();
|
|
5322
|
-
this.
|
|
5323
|
-
this.
|
|
5356
|
+
this._writing = true;
|
|
5357
|
+
this._disabling = false;
|
|
5358
|
+
this._readonly = false;
|
|
5324
5359
|
this.dayMask = DAY_MASK$2;
|
|
5325
|
-
this.disabled = false;
|
|
5326
5360
|
this.floatLabel = 'auto';
|
|
5327
|
-
this.readonly = false;
|
|
5328
5361
|
this.compact = false;
|
|
5329
5362
|
this.placeholderChar = DEFAULT_PLACEHOLDER_CHAR;
|
|
5330
5363
|
this.autofocus = false;
|
|
5364
|
+
this.startDate = null;
|
|
5331
5365
|
this.clearable = false;
|
|
5332
|
-
// Workaround because ion-datetime has issue (do not returned a ISO date)
|
|
5333
|
-
this.mobile = platform.is('mobile');
|
|
5334
|
-
this.keyboardHideDelay = this.mobile && KEYBOARD_HIDE_DELAY_MS || 0;
|
|
5335
5366
|
this.locale = (translate.currentLang || translate.defaultLang).substr(0, 2);
|
|
5336
5367
|
}
|
|
5368
|
+
Object.defineProperty(MatDate.prototype, "readonly", {
|
|
5369
|
+
get: function () {
|
|
5370
|
+
return this._readonly;
|
|
5371
|
+
},
|
|
5372
|
+
set: function (value) {
|
|
5373
|
+
this._readonly = value;
|
|
5374
|
+
this.markForCheck();
|
|
5375
|
+
},
|
|
5376
|
+
enumerable: false,
|
|
5377
|
+
configurable: true
|
|
5378
|
+
});
|
|
5337
5379
|
Object.defineProperty(MatDate.prototype, "tabindex", {
|
|
5338
5380
|
get: function () {
|
|
5339
5381
|
return this._tabindex;
|
|
@@ -5350,71 +5392,69 @@
|
|
|
5350
5392
|
});
|
|
5351
5393
|
Object.defineProperty(MatDate.prototype, "value", {
|
|
5352
5394
|
get: function () {
|
|
5353
|
-
return
|
|
5395
|
+
return this.formControl.value;
|
|
5354
5396
|
},
|
|
5355
5397
|
enumerable: false,
|
|
5356
5398
|
configurable: true
|
|
5357
5399
|
});
|
|
5358
5400
|
MatDate.prototype.ngOnInit = function () {
|
|
5359
5401
|
var _this = this;
|
|
5402
|
+
this.mobile = isNil(this.mobile) ? this.platform.is('mobile') : this.mobile;
|
|
5403
|
+
this._keyboardHideDelay = this.mobile && KEYBOARD_HIDE_DELAY_MS || 0;
|
|
5360
5404
|
this.formControl = this.formControl || this.formControlName && this.formGroupDir && this.formGroupDir.form.get(this.formControlName);
|
|
5361
5405
|
if (!this.formControl)
|
|
5362
5406
|
throw new Error('Missing mandatory attribute \'formControl\' or \'formControlName\' in <mat-date-field>.');
|
|
5363
5407
|
this.required = toBoolean(this.required, this.formControl.validator === i1.Validators.required);
|
|
5364
|
-
//
|
|
5365
|
-
|
|
5366
|
-
|
|
5367
|
-
|
|
5368
|
-
|
|
5408
|
+
// Add 'validDate' validator (when existing validator are null or required, to be sure to keep it)
|
|
5409
|
+
if (!this.formControl.validator || this.formControl.validator === i1.Validators.required) {
|
|
5410
|
+
this.formControl.setValidators(this.required ? [i1.Validators.required, SharedValidators.validDate] : SharedValidators.validDate);
|
|
5411
|
+
}
|
|
5412
|
+
else {
|
|
5413
|
+
this.formControl.setValidators(this.required ? [this.formControl.validator, i1.Validators.required, SharedValidators.validDate] :
|
|
5414
|
+
[this.formControl.validator, SharedValidators.validDate]);
|
|
5415
|
+
}
|
|
5416
|
+
this.dayControl = this.formBuilder.control(null, function () { return _this.formControl.errors; });
|
|
5369
5417
|
// Get patterns to display date
|
|
5370
|
-
this.updatePattern(this.translate.instant('COMMON.DATE_PATTERN'));
|
|
5371
5418
|
this._subscription.add(this.translate.get('COMMON.DATE_PATTERN')
|
|
5372
5419
|
.subscribe(function (pattern) { return _this.updatePattern(pattern); }));
|
|
5373
5420
|
this._subscription.add(this.dayControl.valueChanges
|
|
5374
5421
|
.subscribe(function (value) { return _this.onFormChange(value); }));
|
|
5375
|
-
// Listen status changes outside the component
|
|
5422
|
+
// Listen status changes (when done outside the component - e.g. when setErrors() is calling on the formControl)
|
|
5376
5423
|
this._subscription.add(this.formControl.statusChanges
|
|
5377
|
-
.pipe(operators.filter(function () { return !_this.readonly && !_this.
|
|
5378
|
-
|
|
5379
|
-
|
|
5380
|
-
|
|
5381
|
-
}
|
|
5382
|
-
else if (status === 'VALID') {
|
|
5383
|
-
$error.next(null);
|
|
5384
|
-
}
|
|
5385
|
-
_this.dayControl.updateValueAndValidity({ onlySelf: true, emitEvent: false });
|
|
5424
|
+
.pipe(operators.filter(function (_) { return !_this.readonly && !_this._writing && !_this._disabling; }) // Skip
|
|
5425
|
+
)
|
|
5426
|
+
.subscribe(function () {
|
|
5427
|
+
_this.dayControl.updateValueAndValidity({ emitEvent: false });
|
|
5386
5428
|
_this.markForCheck();
|
|
5387
5429
|
}));
|
|
5388
5430
|
this.updateTabIndex();
|
|
5389
|
-
this.
|
|
5431
|
+
this._writing = false;
|
|
5390
5432
|
};
|
|
5391
5433
|
MatDate.prototype.ngOnDestroy = function () {
|
|
5392
5434
|
this._subscription.unsubscribe();
|
|
5393
5435
|
};
|
|
5394
|
-
MatDate.prototype.writeValue = function (
|
|
5395
|
-
if (this.
|
|
5396
|
-
return;
|
|
5397
|
-
|
|
5398
|
-
|
|
5399
|
-
|
|
5436
|
+
MatDate.prototype.writeValue = function (valueStr) {
|
|
5437
|
+
if (this._writing)
|
|
5438
|
+
return; // Skip
|
|
5439
|
+
this._writing = true;
|
|
5440
|
+
// DEBUG
|
|
5441
|
+
// console.debug("[mat-date] writeValue() with:", valueStr);
|
|
5442
|
+
var value = fromDateISOString(valueStr);
|
|
5443
|
+
if (!value || !value.isValid()) {
|
|
5400
5444
|
this.dayControl.patchValue(null, { emitEvent: false });
|
|
5401
|
-
this._value = undefined;
|
|
5402
5445
|
if (this.formControl.value) {
|
|
5403
5446
|
this.formControl.patchValue(null, { emitEvent: false });
|
|
5404
5447
|
this._onChangeCallback(null);
|
|
5405
5448
|
}
|
|
5406
|
-
this.writing = false;
|
|
5407
|
-
this.markForCheck();
|
|
5408
|
-
return;
|
|
5409
5449
|
}
|
|
5410
|
-
|
|
5411
|
-
|
|
5412
|
-
|
|
5450
|
+
else {
|
|
5451
|
+
// Format day
|
|
5452
|
+
var day = value.clone().startOf('day');
|
|
5453
|
+
var dayStr = this.dateAdapter.format(day, this.dayPattern);
|
|
5454
|
+
// Update control
|
|
5455
|
+
this.dayControl.patchValue(dayStr, { emitEvent: false });
|
|
5413
5456
|
}
|
|
5414
|
-
this.
|
|
5415
|
-
// Set form value
|
|
5416
|
-
this.dayControl.patchValue(this.dateAdapter.format(this._value.clone().startOf('day'), this.dayPattern), { emitEvent: false });
|
|
5417
|
-
this.writing = false;
|
|
5457
|
+
this._writing = false;
|
|
5418
5458
|
this.markForCheck();
|
|
5419
5459
|
};
|
|
5420
5460
|
MatDate.prototype.registerOnChange = function (fn) {
|
|
@@ -5424,37 +5464,36 @@
|
|
|
5424
5464
|
this._onTouchedCallback = fn;
|
|
5425
5465
|
};
|
|
5426
5466
|
MatDate.prototype.setDisabledState = function (isDisabled) {
|
|
5427
|
-
if (this.
|
|
5467
|
+
if (this._disabling)
|
|
5428
5468
|
return;
|
|
5429
|
-
this.
|
|
5430
|
-
this.disabled = isDisabled;
|
|
5469
|
+
this._disabling = true;
|
|
5431
5470
|
if (isDisabled) {
|
|
5432
|
-
this.dayControl.disable({
|
|
5471
|
+
this.dayControl.disable({ emitEvent: false });
|
|
5433
5472
|
}
|
|
5434
5473
|
else {
|
|
5435
|
-
this.dayControl.enable({
|
|
5474
|
+
this.dayControl.enable({ emitEvent: false });
|
|
5436
5475
|
}
|
|
5437
|
-
this.
|
|
5476
|
+
this._disabling = false;
|
|
5438
5477
|
this.markForCheck();
|
|
5439
5478
|
};
|
|
5440
5479
|
MatDate.prototype.onDatePickerChange = function (event) {
|
|
5441
|
-
|
|
5442
|
-
|
|
5443
|
-
|
|
5444
|
-
|
|
5445
|
-
|
|
5446
|
-
var
|
|
5447
|
-
|
|
5448
|
-
|
|
5449
|
-
|
|
5450
|
-
|
|
5451
|
-
this.dayControl.
|
|
5452
|
-
|
|
5453
|
-
|
|
5454
|
-
|
|
5455
|
-
|
|
5456
|
-
|
|
5457
|
-
|
|
5480
|
+
// Make sure event is valid
|
|
5481
|
+
if (!event || (event.value !== null && !momentImported.isMoment(event.value))) {
|
|
5482
|
+
console.warn('Invalid MatDatepicker event. Skipping', event);
|
|
5483
|
+
return; // Skip
|
|
5484
|
+
}
|
|
5485
|
+
var date = event.value && event.value
|
|
5486
|
+
.locale(this.locale) // set as time as locale time
|
|
5487
|
+
.minute(0).seconds(0).millisecond(0) // Reset hour
|
|
5488
|
+
.utc(true);
|
|
5489
|
+
var dateStr = date && this.dateAdapter.format(date, this.dayPattern) || null;
|
|
5490
|
+
if (this.dayControl.value !== dateStr) {
|
|
5491
|
+
// DEBUG
|
|
5492
|
+
console.debug("[mat-date] onDatePickerChange() new value:", dateStr);
|
|
5493
|
+
this.dayControl.setValue(dateStr, {
|
|
5494
|
+
emitEvent: true // Will call onFormChange
|
|
5495
|
+
});
|
|
5496
|
+
}
|
|
5458
5497
|
};
|
|
5459
5498
|
MatDate.prototype.openDatePickerIfMobile = function (event, datePicker) {
|
|
5460
5499
|
return __awaiter(this, void 0, void 0, function () {
|
|
@@ -5505,6 +5544,13 @@
|
|
|
5505
5544
|
}
|
|
5506
5545
|
});
|
|
5507
5546
|
};
|
|
5547
|
+
MatDate.prototype.clear = function () {
|
|
5548
|
+
this.dayControl.patchValue(null, { emitEvent: false });
|
|
5549
|
+
this.formControl.setValue(null, { emitEvent: false });
|
|
5550
|
+
this._onChangeCallback(null);
|
|
5551
|
+
this.markAsTouched();
|
|
5552
|
+
this.markAsDirty();
|
|
5553
|
+
};
|
|
5508
5554
|
/* -- private method -- */
|
|
5509
5555
|
MatDate.prototype.updatePattern = function (pattern) {
|
|
5510
5556
|
pattern = pattern !== 'COMMON.DATE_PATTERN' ? pattern : 'L';
|
|
@@ -5514,36 +5560,29 @@
|
|
|
5514
5560
|
this.markForCheck();
|
|
5515
5561
|
}
|
|
5516
5562
|
};
|
|
5517
|
-
MatDate.prototype.onFormChange = function (dayValue) {
|
|
5518
|
-
if (this.writing)
|
|
5519
|
-
return; // Skip if call by self
|
|
5520
|
-
this.writing = true;
|
|
5521
|
-
// Make to remove placeholder chars
|
|
5522
|
-
while (dayValue && dayValue.indexOf(this.placeholderChar) !== -1) {
|
|
5523
|
-
dayValue = dayValue.replace(this.placeholderChar, '');
|
|
5524
|
-
}
|
|
5525
|
-
var date;
|
|
5526
|
-
// Parse day string
|
|
5527
|
-
date = dayValue && this.dateAdapter.parse(dayValue, this.dayPattern) || null;
|
|
5528
|
-
// Reset time
|
|
5529
|
-
date = date && date.utc(true).hour(0).minute(0).seconds(0).millisecond(0);
|
|
5530
|
-
// update date picker
|
|
5531
|
-
this._value = date && this.dateAdapter.parse(date.clone(), DATE_ISO_PATTERN);
|
|
5532
|
-
// Get the model value
|
|
5533
|
-
var dateStr = date && date.isValid() && this.dateAdapter.format(date, DATE_ISO_PATTERN).replace('+00:00', 'Z') || date;
|
|
5534
|
-
//console.debug("[mat-date-time] Setting date: ", dateStr);
|
|
5535
|
-
this.formControl.patchValue(dateStr, { emitEvent: false });
|
|
5536
|
-
//this.formControl.updateValueAndValidity();
|
|
5537
|
-
this.writing = false;
|
|
5538
|
-
this.markForCheck();
|
|
5539
|
-
this._onChangeCallback(dateStr);
|
|
5540
|
-
};
|
|
5541
5563
|
MatDate.prototype.checkIfTouched = function () {
|
|
5542
5564
|
if (this.dayControl.touched) {
|
|
5543
|
-
this.markForCheck();
|
|
5544
5565
|
this._onTouchedCallback();
|
|
5566
|
+
this.markForCheck();
|
|
5545
5567
|
}
|
|
5546
5568
|
};
|
|
5569
|
+
MatDate.prototype.onFormChange = function (dayStr) {
|
|
5570
|
+
if (this._writing)
|
|
5571
|
+
return; // Skip if call by self
|
|
5572
|
+
this._writing = true;
|
|
5573
|
+
// Make to remove placeholder chars
|
|
5574
|
+
while (dayStr && dayStr.indexOf(this.placeholderChar) !== -1) {
|
|
5575
|
+
dayStr = dayStr.replace(this.placeholderChar, '');
|
|
5576
|
+
}
|
|
5577
|
+
// Parse day
|
|
5578
|
+
var date = dayStr && this.dateAdapter.parse(dayStr, this.dayPattern) || null;
|
|
5579
|
+
// Reset time
|
|
5580
|
+
date = date && date.minute(0).seconds(0).millisecond(0)
|
|
5581
|
+
.utc(); // Convert local date into utc (avoid TZ offset to be in the final string)
|
|
5582
|
+
// Set model value
|
|
5583
|
+
this.emitChange(date);
|
|
5584
|
+
this._writing = false;
|
|
5585
|
+
};
|
|
5547
5586
|
MatDate.prototype.waitKeyboardHide = function (waitKeyboardDelay) {
|
|
5548
5587
|
return __awaiter(this, void 0, void 0, function () {
|
|
5549
5588
|
return __generator(this, function (_a) {
|
|
@@ -5558,8 +5597,8 @@
|
|
|
5558
5597
|
case 1:
|
|
5559
5598
|
// Wait hide occur
|
|
5560
5599
|
_a.sent();
|
|
5561
|
-
if (!(this.
|
|
5562
|
-
return [4 /*yield*/, sleep(this.
|
|
5600
|
+
if (!(this._keyboardHideDelay > 0 && waitKeyboardDelay)) return [3 /*break*/, 3];
|
|
5601
|
+
return [4 /*yield*/, sleep(this._keyboardHideDelay)];
|
|
5563
5602
|
case 2:
|
|
5564
5603
|
_a.sent();
|
|
5565
5604
|
_a.label = 3;
|
|
@@ -5568,6 +5607,18 @@
|
|
|
5568
5607
|
});
|
|
5569
5608
|
});
|
|
5570
5609
|
};
|
|
5610
|
+
MatDate.prototype.emitChange = function (value) {
|
|
5611
|
+
// Get the model value
|
|
5612
|
+
var dateStr = toDateISOString(value) || null;
|
|
5613
|
+
if (this.formControl.value !== dateStr) {
|
|
5614
|
+
// DEBUG
|
|
5615
|
+
//console.debug('[matèdate-time] Emit new value: ' + dateStr);
|
|
5616
|
+
// Changes comes from inside function: use the callback
|
|
5617
|
+
this._onChangeCallback(dateStr);
|
|
5618
|
+
// Check if need to update controls
|
|
5619
|
+
this.checkIfTouched();
|
|
5620
|
+
}
|
|
5621
|
+
};
|
|
5571
5622
|
MatDate.prototype.updateTabIndex = function () {
|
|
5572
5623
|
var _this = this;
|
|
5573
5624
|
if (isNil(this._tabindex) || this._tabindex === -1)
|
|
@@ -5580,6 +5631,14 @@
|
|
|
5580
5631
|
_this.markForCheck();
|
|
5581
5632
|
});
|
|
5582
5633
|
};
|
|
5634
|
+
MatDate.prototype.markAsTouched = function (opts) {
|
|
5635
|
+
this.dayControl.markAsTouched(opts);
|
|
5636
|
+
this._onTouchedCallback();
|
|
5637
|
+
this.markForCheck();
|
|
5638
|
+
};
|
|
5639
|
+
MatDate.prototype.markAsDirty = function (opts) {
|
|
5640
|
+
this.formControl.markAsDirty(opts);
|
|
5641
|
+
};
|
|
5583
5642
|
MatDate.prototype.markForCheck = function () {
|
|
5584
5643
|
this.cd.markForCheck();
|
|
5585
5644
|
};
|
|
@@ -5588,7 +5647,7 @@
|
|
|
5588
5647
|
MatDate.decorators = [
|
|
5589
5648
|
{ type: i0.Component, args: [{
|
|
5590
5649
|
selector: 'mat-date-field',
|
|
5591
|
-
template: "<!-- readonly -->\n<mat-form-field *ngIf=\"readonly else writable\">\n <input matInput hidden type=\"text\"
|
|
5650
|
+
template: "<!-- readonly -->\n<mat-form-field *ngIf=\"readonly; else writable\"\n [floatLabel]=\"floatLabel\"\n class=\"mat-form-field-disabled\">\n\n <div matPrefix>\n <ng-container *ngTemplateOutlet=\"matPrefixTemplate\"></ng-container>\n </div>\n\n <input matInput hidden type=\"text\"\n readonly\n [placeholder]=\"placeholder\"\n [formControl]=\"formControl\">\n <ion-text>{{formControl.value|dateFormat: {pattern: displayPattern} }}</ion-text>\n</mat-form-field>\n\n<!-- writable -->\n<ng-template #writable>\n <mat-form-field [floatLabel]=\"floatLabel\">\n\n <mat-label>{{placeholder}}</mat-label>\n\n <div matPrefix>\n <ng-container *ngTemplateOutlet=\"matPrefixTemplate\"></ng-container>\n </div>\n\n <input matInput #matInput autocomplete=\"off\" type=\"text\"\n *ngIf=\"!mobile\"\n [formControl]=\"dayControl\"\n [textMask]=\"{mask: dayMask, keepCharPositions: true, placeholderChar: placeholderChar}\"\n [placeholder]=\"'COMMON.DATE_PLACEHOLDER'|translate\"\n (blur)=\"checkIfTouched()\"\n (keyup.arrowdown)=\"openDatePicker($event, datePicker)\"\n (keyup.escape)=\"preventEvent($event)\"\n [required]=\"required\"\n [tabindex]=\"tabindex\"\n [appAutofocus]=\"autofocus\">\n <input matInput #matInput autocomplete=\"off\" type=\"text\"\n *ngIf=\"mobile\"\n [formControl]=\"dayControl\"\n (click)=\"openDatePickerIfMobile($event, datePicker)\"\n [required]=\"required\"\n [tabindex]=\"tabindex\"\n readonly>\n\n <!-- Hide the final input -->\n <input matInput type=\"text\" [formControl]=\"formControl\"\n hidden\n [matDatepicker]=\"datePicker\"\n (dateChange)=\"onDatePickerChange($event)\">\n\n <button type=\"button\" mat-icon-button tabindex=\"-1\" matSuffix\n (click)=\"openDatePicker($event, datePicker)\"\n [disabled]=\"formControl.disabled\">\n <div *ngIf=\"mobile; then iconDate; else iconDesktop\"></div>\n </button>\n <button matSuffix mat-icon-button tabindex=\"-1\"\n type=\"button\"\n *ngIf=\"clearable\"\n (click)=\"clear()\"\n [hidden]=\"formControl.disabled || !formControl.value\">\n <mat-icon>close</mat-icon>\n </button>\n\n <!-- errors -->\n <mat-error *ngIf=\"formControl.touched && formControl.errors|mapKeys|arrayFirst; let errorKey\">\n <ng-container [ngSwitch]=\"errorKey\">\n <span *ngSwitchCase=\"'required'\" translate>ERROR.FIELD_REQUIRED</span>\n <span *ngSwitchCase=\"'validDate'\" translate>ERROR.FIELD_NOT_VALID_DATE_TIME</span>\n <span *ngSwitchCase=\"'dateIsAfter'\">{{'ERROR.FIELD_NOT_VALID_DATE_AFTER' | translate: formControl.errors.dateIsAfter }}</span>\n <span *ngSwitchCase=\"'dateIsBefore'\">{{'ERROR.FIELD_NOT_VALID_DATE_BEFORE' | translate: formControl.errors.dateIsBefore }}</span>\n <span *ngSwitchCase=\"'dateRange'\" translate>ERROR.FIELD_NOT_VALID_DATE_RANGE</span>\n <span *ngSwitchCase=\"'dateMaxDuration'\" translate>ERROR.FIELD_NOT_VALID_DATE_MAX_DURATION</span>\n <span *ngSwitchCase=\"'dateMinDuration'\" translate>ERROR.FIELD_NOT_VALID_DATE_MIN_DURATION</span>\n <span *ngSwitchCase=\"'msg'\">{{(formControl.errors.msg?.key || formControl.errors.msg) | translate: formControl.errors.msg?.params}}</span>\n </ng-container>\n </mat-error>\n <ng-content select=\"mat-error\"></ng-content>\n\n <!-- mat hint -->\n <div class=\"mat-form-field-hint-wrapper\" [class.cdk-visually-hidden]=\"formControl.invalid\">\n <div class=\"mat-form-field-hint-spacer\"></div>\n <ng-content select=\"mat-hint\"></ng-content>\n </div>\n </mat-form-field>\n\n <mat-datepicker #datePicker\n [touchUi]=\"mobile\"\n [disabled]=\"formControl.disabled\"\n [startAt]=\"startDate\"></mat-datepicker>\n\n\n\n</ng-template>\n\n<ng-template #iconDesktop>\n <mat-icon>keyboard_arrow_down</mat-icon>\n</ng-template>\n\n<ng-template #iconDate>\n <mat-icon>date_range</mat-icon>\n</ng-template>\n\n<ng-template #matPrefixTemplate>\n <ng-content select=\"[matPrefix]\"></ng-content>\n</ng-template>\n",
|
|
5592
5651
|
providers: [
|
|
5593
5652
|
DEFAULT_VALUE_ACCESSOR$5,
|
|
5594
5653
|
],
|
|
@@ -5606,19 +5665,19 @@
|
|
|
5606
5665
|
{ type: i1.FormGroupDirective, decorators: [{ type: i0.Optional }] }
|
|
5607
5666
|
]; };
|
|
5608
5667
|
MatDate.propDecorators = {
|
|
5609
|
-
disabled: [{ type: i0.Input }],
|
|
5610
5668
|
formControl: [{ type: i0.Input }],
|
|
5611
5669
|
formControlName: [{ type: i0.Input }],
|
|
5612
5670
|
placeholder: [{ type: i0.Input }],
|
|
5613
5671
|
floatLabel: [{ type: i0.Input }],
|
|
5614
|
-
readonly: [{ type: i0.Input }],
|
|
5615
5672
|
required: [{ type: i0.Input }],
|
|
5673
|
+
mobile: [{ type: i0.Input }],
|
|
5616
5674
|
compact: [{ type: i0.Input }],
|
|
5617
5675
|
placeholderChar: [{ type: i0.Input }],
|
|
5618
5676
|
autofocus: [{ type: i0.Input }],
|
|
5619
|
-
tabindex: [{ type: i0.Input }],
|
|
5620
5677
|
startDate: [{ type: i0.Input }],
|
|
5621
5678
|
clearable: [{ type: i0.Input }],
|
|
5679
|
+
readonly: [{ type: i0.Input }],
|
|
5680
|
+
tabindex: [{ type: i0.Input }],
|
|
5622
5681
|
datePicker: [{ type: i0.ViewChild, args: ['datePicker',] }],
|
|
5623
5682
|
matInputs: [{ type: i0.ViewChildren, args: ['matInput',] }]
|
|
5624
5683
|
};
|
|
@@ -5631,8 +5690,7 @@
|
|
|
5631
5690
|
var DAY_MASK$1 = [/\d/, /\d/, '/', /\d/, /\d/, '/', /\d/, /\d/, /\d/, /\d/];
|
|
5632
5691
|
var HOUR_REGEXP = /^[012][0-9][:][012345][0-9]$/;
|
|
5633
5692
|
var HOUR_MASK$1 = [/[012]/, /\d/, ':', /[012345]/, /\d/];
|
|
5634
|
-
var noop$5 = function () {
|
|
5635
|
-
};
|
|
5693
|
+
var noop$5 = function () { };
|
|
5636
5694
|
var ɵ0$8 = noop$5;
|
|
5637
5695
|
var MatDateTime = /** @class */ (function () {
|
|
5638
5696
|
function MatDateTime(platform, dateAdapter, translate, formBuilder, cd, keyboard, formGroupDir) {
|
|
@@ -5646,8 +5704,8 @@
|
|
|
5646
5704
|
this._onChangeCallback = noop$5;
|
|
5647
5705
|
this._onTouchedCallback = noop$5;
|
|
5648
5706
|
this._subscription = new rxjs.Subscription();
|
|
5649
|
-
this.
|
|
5650
|
-
this.
|
|
5707
|
+
this._writing = true;
|
|
5708
|
+
this._disabling = false;
|
|
5651
5709
|
this._readonly = false;
|
|
5652
5710
|
this.dayMask = DAY_MASK$1;
|
|
5653
5711
|
this.hourMask = HOUR_MASK$1;
|
|
@@ -5694,7 +5752,7 @@
|
|
|
5694
5752
|
MatDateTime.prototype.ngOnInit = function () {
|
|
5695
5753
|
var _this = this;
|
|
5696
5754
|
this.mobile = isNil(this.mobile) ? this.platform.is('mobile') : this.mobile;
|
|
5697
|
-
this.
|
|
5755
|
+
this._keyboardHideDelay = this.mobile && KEYBOARD_HIDE_DELAY_MS || 0;
|
|
5698
5756
|
this.formControl = this.formControl || this.formControlName && this.formGroupDir && this.formGroupDir.form.get(this.formControlName);
|
|
5699
5757
|
if (!this.formControl)
|
|
5700
5758
|
throw new Error('Missing mandatory attribute \'formControl\' or \'formControlName\' in <mat-date-time-field>.');
|
|
@@ -5721,19 +5779,19 @@
|
|
|
5721
5779
|
.subscribe(function (event) { return _this.onFormChange(event); }));
|
|
5722
5780
|
// Listen status changes (when done outside the component - e.g. when setErrors() is calling on the formControl)
|
|
5723
5781
|
this._subscription.add(this.formControl.statusChanges
|
|
5724
|
-
.pipe(operators.filter(function (_) { return !_this.readonly && !_this.
|
|
5782
|
+
.pipe(operators.filter(function (_) { return !_this.readonly && !_this._writing && !_this._disabling; }) // Skip
|
|
5725
5783
|
)
|
|
5726
5784
|
.subscribe(function () { return _this.markForCheck(); }));
|
|
5727
5785
|
this.updateTabIndex();
|
|
5728
|
-
this.
|
|
5786
|
+
this._writing = false;
|
|
5729
5787
|
};
|
|
5730
5788
|
MatDateTime.prototype.ngOnDestroy = function () {
|
|
5731
5789
|
this._subscription.unsubscribe();
|
|
5732
5790
|
};
|
|
5733
5791
|
MatDateTime.prototype.writeValue = function (valueStr) {
|
|
5734
|
-
if (this.
|
|
5792
|
+
if (this._writing)
|
|
5735
5793
|
return; // Skip
|
|
5736
|
-
this.
|
|
5794
|
+
this._writing = true;
|
|
5737
5795
|
// DEBUG
|
|
5738
5796
|
// console.debug("[mat-date-time] writeValue() with:", valueStr);
|
|
5739
5797
|
var value = fromDateISOString(valueStr);
|
|
@@ -5742,10 +5800,10 @@
|
|
|
5742
5800
|
this.timeFormControl.patchValue(null, { emitEvent: false });
|
|
5743
5801
|
}
|
|
5744
5802
|
else {
|
|
5745
|
-
//
|
|
5803
|
+
// Format day
|
|
5746
5804
|
var day = value.clone().startOf('day');
|
|
5747
5805
|
var dayStr = this.dateAdapter.format(day, this.dayPattern);
|
|
5748
|
-
//
|
|
5806
|
+
// Format time
|
|
5749
5807
|
// - Format hh
|
|
5750
5808
|
var hour = value.hour();
|
|
5751
5809
|
hour = hour < 10 ? ('0' + hour) : hour;
|
|
@@ -5757,46 +5815,9 @@
|
|
|
5757
5815
|
this.dateFormControl.patchValue(dayStr, { emitEvent: false });
|
|
5758
5816
|
this.timeFormControl.patchValue(timeStr, { emitEvent: false });
|
|
5759
5817
|
}
|
|
5760
|
-
this.
|
|
5818
|
+
this._writing = false;
|
|
5761
5819
|
this.markForCheck();
|
|
5762
5820
|
};
|
|
5763
|
-
MatDateTime.prototype.onFormChange = function (event) {
|
|
5764
|
-
if (this.writing)
|
|
5765
|
-
return; // Skip if call by self
|
|
5766
|
-
this.writing = true;
|
|
5767
|
-
var dayStr = this.dateFormControl.value;
|
|
5768
|
-
var time = this.timeFormControl.value;
|
|
5769
|
-
// DEBUG
|
|
5770
|
-
//console.debug(`[mat-date-time] onFormChange() from event: ${event} - controls values: `, [dayStr, time]);
|
|
5771
|
-
var incompleteValue = isNilOrBlank(time) !== isNilOrBlank(dayStr);
|
|
5772
|
-
if (incompleteValue || this.dateFormControl.invalid || this.timeFormControl.invalid) {
|
|
5773
|
-
this.formControl.markAsPending({ onlySelf: true });
|
|
5774
|
-
this.formControl.setErrors(Object.assign(Object.assign(Object.assign({ validDate: incompleteValue }, this.formControl.errors), this.dateFormControl.errors), this.timeFormControl.errors));
|
|
5775
|
-
this.formControl.markAsDirty();
|
|
5776
|
-
// Reset the value
|
|
5777
|
-
//this.emitChange(null);
|
|
5778
|
-
this.writing = false;
|
|
5779
|
-
return;
|
|
5780
|
-
}
|
|
5781
|
-
// Make to remove placeholder chars
|
|
5782
|
-
while (dayStr && dayStr.indexOf(this.placeholderChar) !== -1) {
|
|
5783
|
-
dayStr = dayStr.replace(this.placeholderChar, '');
|
|
5784
|
-
}
|
|
5785
|
-
// Parse day
|
|
5786
|
-
var day = dayStr && this.dateAdapter.parse(dayStr, this.dayPattern) || null;
|
|
5787
|
-
// Parse time
|
|
5788
|
-
var hourParts = (time || '').split(':');
|
|
5789
|
-
var hour = parseInt(hourParts[0] || 0);
|
|
5790
|
-
var minutes = parseInt(hourParts[1] || 0);
|
|
5791
|
-
var dateTime = day && day
|
|
5792
|
-
.locale(this.locale) // set as time as locale time
|
|
5793
|
-
.hour(hour).minute(minutes) // Set local hour
|
|
5794
|
-
.seconds(0).millisecond(0) // Reset seconds/millisecond
|
|
5795
|
-
.utc(); // Convert to UTC (avoid TZ offset in final string)
|
|
5796
|
-
// Set model value
|
|
5797
|
-
this.emitChange(dateTime);
|
|
5798
|
-
this.writing = false;
|
|
5799
|
-
};
|
|
5800
5821
|
MatDateTime.prototype.registerOnChange = function (fn) {
|
|
5801
5822
|
this._onChangeCallback = fn;
|
|
5802
5823
|
};
|
|
@@ -5804,9 +5825,9 @@
|
|
|
5804
5825
|
this._onTouchedCallback = fn;
|
|
5805
5826
|
};
|
|
5806
5827
|
MatDateTime.prototype.setDisabledState = function (isDisabled) {
|
|
5807
|
-
if (this.
|
|
5828
|
+
if (this._disabling)
|
|
5808
5829
|
return; // Skip
|
|
5809
|
-
this.
|
|
5830
|
+
this._disabling = true;
|
|
5810
5831
|
if (isDisabled) {
|
|
5811
5832
|
this.dateFormControl.disable({ emitEvent: false });
|
|
5812
5833
|
this.timeFormControl.disable({ emitEvent: false });
|
|
@@ -5815,7 +5836,7 @@
|
|
|
5815
5836
|
this.dateFormControl.enable({ emitEvent: false });
|
|
5816
5837
|
this.timeFormControl.enable({ emitEvent: false });
|
|
5817
5838
|
}
|
|
5818
|
-
this.
|
|
5839
|
+
this._disabling = false;
|
|
5819
5840
|
this.markForCheck();
|
|
5820
5841
|
};
|
|
5821
5842
|
MatDateTime.prototype.onDatePickerChange = function (event) {
|
|
@@ -5940,6 +5961,43 @@
|
|
|
5940
5961
|
this.markForCheck();
|
|
5941
5962
|
}
|
|
5942
5963
|
};
|
|
5964
|
+
MatDateTime.prototype.onFormChange = function (event) {
|
|
5965
|
+
if (this._writing)
|
|
5966
|
+
return; // Skip if call by self
|
|
5967
|
+
this._writing = true;
|
|
5968
|
+
var dayStr = this.dateFormControl.value;
|
|
5969
|
+
var time = this.timeFormControl.value;
|
|
5970
|
+
// DEBUG
|
|
5971
|
+
//console.debug(`[mat-date-time] onFormChange() from event: ${event} - controls values: `, [dayStr, time]);
|
|
5972
|
+
var incompleteValue = isNilOrBlank(time) !== isNilOrBlank(dayStr);
|
|
5973
|
+
if (incompleteValue || this.dateFormControl.invalid || this.timeFormControl.invalid) {
|
|
5974
|
+
this.formControl.markAsPending({ onlySelf: true });
|
|
5975
|
+
this.formControl.setErrors(Object.assign(Object.assign(Object.assign({ validDate: incompleteValue }, this.formControl.errors), this.dateFormControl.errors), this.timeFormControl.errors));
|
|
5976
|
+
this.formControl.markAsDirty();
|
|
5977
|
+
// Reset the value
|
|
5978
|
+
//this.emitChange(null);
|
|
5979
|
+
this._writing = false;
|
|
5980
|
+
return;
|
|
5981
|
+
}
|
|
5982
|
+
// Make to remove placeholder chars
|
|
5983
|
+
while (dayStr && dayStr.indexOf(this.placeholderChar) !== -1) {
|
|
5984
|
+
dayStr = dayStr.replace(this.placeholderChar, '');
|
|
5985
|
+
}
|
|
5986
|
+
// Parse day
|
|
5987
|
+
var day = dayStr && this.dateAdapter.parse(dayStr, this.dayPattern) || null;
|
|
5988
|
+
// Parse time
|
|
5989
|
+
var hourParts = (time || '').split(':');
|
|
5990
|
+
var hour = parseInt(hourParts[0] || 0);
|
|
5991
|
+
var minutes = parseInt(hourParts[1] || 0);
|
|
5992
|
+
var dateTime = day && day
|
|
5993
|
+
.locale(this.locale) // set as time as locale time
|
|
5994
|
+
.hour(hour).minute(minutes) // Set local hour
|
|
5995
|
+
.seconds(0).millisecond(0) // Reset seconds/millisecond
|
|
5996
|
+
.utc(); // Convert to UTC (avoid TZ offset in final string)
|
|
5997
|
+
// Set model value
|
|
5998
|
+
this.emitChange(dateTime);
|
|
5999
|
+
this._writing = false;
|
|
6000
|
+
};
|
|
5943
6001
|
MatDateTime.prototype.waitKeyboardHide = function (waitKeyboardDelay) {
|
|
5944
6002
|
return __awaiter(this, void 0, void 0, function () {
|
|
5945
6003
|
return __generator(this, function (_a) {
|
|
@@ -5954,8 +6012,8 @@
|
|
|
5954
6012
|
case 1:
|
|
5955
6013
|
// Wait hide occur
|
|
5956
6014
|
_a.sent();
|
|
5957
|
-
if (!(this.
|
|
5958
|
-
return [4 /*yield*/, sleep(this.
|
|
6015
|
+
if (!(this._keyboardHideDelay > 0 && waitKeyboardDelay)) return [3 /*break*/, 3];
|
|
6016
|
+
return [4 /*yield*/, sleep(this._keyboardHideDelay)];
|
|
5959
6017
|
case 2:
|
|
5960
6018
|
_a.sent();
|
|
5961
6019
|
_a.label = 3;
|
|
@@ -5988,9 +6046,9 @@
|
|
|
5988
6046
|
_this.markForCheck();
|
|
5989
6047
|
});
|
|
5990
6048
|
};
|
|
5991
|
-
MatDateTime.prototype.markAsTouched = function () {
|
|
5992
|
-
this.dateFormControl.markAsTouched();
|
|
5993
|
-
this.timeFormControl.markAsTouched();
|
|
6049
|
+
MatDateTime.prototype.markAsTouched = function (opts) {
|
|
6050
|
+
this.dateFormControl.markAsTouched(opts);
|
|
6051
|
+
this.timeFormControl.markAsTouched(opts);
|
|
5994
6052
|
this._onTouchedCallback();
|
|
5995
6053
|
this.markForCheck();
|
|
5996
6054
|
};
|
|
@@ -6005,7 +6063,7 @@
|
|
|
6005
6063
|
MatDateTime.decorators = [
|
|
6006
6064
|
{ type: i0.Component, args: [{
|
|
6007
6065
|
selector: 'mat-date-time-field',
|
|
6008
|
-
template: "<!-- readonly -->\n<mat-form-field *ngIf=\"readonly; else writable\"\n [floatLabel]=\"floatLabel\"\n class=\"mat-form-field-disabled\">\n\n <div matPrefix>\n <ng-container *ngTemplateOutlet=\"matPrefixTemplate\"></ng-container>\n </div>\n\n <input matInput hidden type=\"text\"\n readonly\n [placeholder]=\"placeholder\"\n [formControl]=\"formControl\">\n <ion-text>{{formControl.value|dateFormat: {pattern: displayPattern} }}</ion-text>\n</mat-form-field>\n\n<!-- writable + time -->\n<ng-template #writable >\n <ion-grid class=\"ion-no-padding\">\n <ion-row class=\"ion-no-padding no-wrap\" nowrap>\n\n <!-- day -->\n <ion-col class=\"day ion-no-padding\">\n <mat-form-field [floatLabel]=\"floatLabel\"\n [class.mat-form-field-invalid]=\"formControl.touched && formControl.invalid\">\n\n <mat-label>{{placeholder}}</mat-label>\n\n <div matPrefix>\n <ng-container *ngTemplateOutlet=\"matPrefixTemplate\"></ng-container>\n </div>\n\n <input matInput #matInput autocomplete=\"off\" type=\"text\"\n *ngIf=\"!mobile\"\n [formControl]=\"dateFormControl\"\n [textMask]=\"{mask: dayMask, keepCharPositions: true, placeholderChar: placeholderChar}\"\n [placeholder]=\"'COMMON.DATE_PLACEHOLDER'|translate\"\n (blur)=\"checkIfTouched()\"\n (keyup.arrowdown)=\"openDatePicker($event, datePicker)\"\n (keyup.escape)=\"preventEvent($event)\"\n [required]=\"required\"\n [tabindex]=\"tabindex\"\n [appAutofocus]=\"autofocus\">\n <input matInput #matInput autocomplete=\"off\" type=\"text\"\n *ngIf=\"mobile\"\n [formControl]=\"dateFormControl\"\n (click)=\"openDatePickerIfMobile($event, datePicker)\"\n [required]=\"required\"\n [tabindex]=\"tabindex\"\n readonly>\n <input matInput type=\"text\" [formControl]=\"formControl\"\n hidden\n [matDatepicker]=\"datePicker\"\n (dateChange)=\"onDatePickerChange($event)\">\n\n <button type=\"button\" mat-icon-button tabindex=\"-1\" matSuffix
|
|
6066
|
+
template: "<!-- readonly -->\n<mat-form-field *ngIf=\"readonly; else writable\"\n [floatLabel]=\"floatLabel\"\n class=\"mat-form-field-disabled\">\n\n <div matPrefix>\n <ng-container *ngTemplateOutlet=\"matPrefixTemplate\"></ng-container>\n </div>\n\n <input matInput hidden type=\"text\"\n readonly\n [placeholder]=\"placeholder\"\n [formControl]=\"formControl\">\n <ion-text>{{formControl.value|dateFormat: {pattern: displayPattern} }}</ion-text>\n</mat-form-field>\n\n<!-- writable + time -->\n<ng-template #writable >\n <ion-grid class=\"ion-no-padding\">\n <ion-row class=\"ion-no-padding no-wrap\" nowrap>\n\n <!-- day -->\n <ion-col class=\"day ion-no-padding\">\n <mat-form-field [floatLabel]=\"floatLabel\"\n [class.mat-form-field-invalid]=\"formControl.touched && formControl.invalid\">\n\n <mat-label>{{placeholder}}</mat-label>\n\n <div matPrefix>\n <ng-container *ngTemplateOutlet=\"matPrefixTemplate\"></ng-container>\n </div>\n\n <input matInput #matInput autocomplete=\"off\" type=\"text\"\n *ngIf=\"!mobile\"\n [formControl]=\"dateFormControl\"\n [textMask]=\"{mask: dayMask, keepCharPositions: true, placeholderChar: placeholderChar}\"\n [placeholder]=\"'COMMON.DATE_PLACEHOLDER'|translate\"\n (blur)=\"checkIfTouched()\"\n (keyup.arrowdown)=\"openDatePicker($event, datePicker)\"\n (keyup.escape)=\"preventEvent($event)\"\n [required]=\"required\"\n [tabindex]=\"tabindex\"\n [appAutofocus]=\"autofocus\">\n <input matInput #matInput autocomplete=\"off\" type=\"text\"\n *ngIf=\"mobile\"\n [formControl]=\"dateFormControl\"\n (click)=\"openDatePickerIfMobile($event, datePicker)\"\n [required]=\"required\"\n [tabindex]=\"tabindex\"\n readonly>\n\n <!-- Hide the final input -->\n <input matInput type=\"text\" [formControl]=\"formControl\"\n hidden\n [matDatepicker]=\"datePicker\"\n (dateChange)=\"onDatePickerChange($event)\">\n\n <button type=\"button\" mat-icon-button tabindex=\"-1\" matSuffix\n (click)=\"openDatePicker($event, datePicker)\"\n [disabled]=\"formControl.disabled\">\n <div *ngIf=\"mobile; then iconDate; else iconDesktop\"></div>\n </button>\n <button matSuffix mat-icon-button tabindex=\"-1\"\n type=\"button\"\n *ngIf=\"clearable\"\n (click)=\"clear()\"\n [hidden]=\"formControl.disabled || !formControl.value\">\n <mat-icon>close</mat-icon>\n </button>\n </mat-form-field>\n <mat-datepicker #datePicker\n [touchUi]=\"mobile\"\n [disabled]=\"formControl.disabled\"\n [startAt]=\"startDate\"></mat-datepicker>\n <div class=\"mat-form-field-subscript mat-form-field-subscript-wrapper\" >\n <!-- errors -->\n <ng-container [ngSwitch]=\"formControl.touched && formControl.errors|mapKeys|arrayFirst\">\n <mat-error *ngSwitchCase=\"'required'\" translate>ERROR.FIELD_REQUIRED</mat-error>\n <mat-error *ngSwitchCase=\"'validDate'\" translate>ERROR.FIELD_NOT_VALID_DATE_TIME</mat-error>\n <mat-error *ngSwitchCase=\"'dateIsAfter'\">{{'ERROR.FIELD_NOT_VALID_DATE_AFTER' | translate: formControl.errors.dateIsAfter }}</mat-error>\n <mat-error *ngSwitchCase=\"'dateIsBefore'\">{{'ERROR.FIELD_NOT_VALID_DATE_BEFORE' | translate: formControl.errors.dateIsBefore }}</mat-error>\n <mat-error *ngSwitchCase=\"'dateRange'\" translate>ERROR.FIELD_NOT_VALID_DATE_RANGE</mat-error>\n <mat-error *ngSwitchCase=\"'dateMaxDuration'\" translate>ERROR.FIELD_NOT_VALID_DATE_MAX_DURATION</mat-error>\n <mat-error *ngSwitchCase=\"'dateMinDuration'\" translate>ERROR.FIELD_NOT_VALID_DATE_MIN_DURATION</mat-error>\n <mat-error *ngSwitchCase=\"'msg'\">{{(formControl.errors.msg?.key || formControl.errors.msg) | translate: formControl.errors.msg?.params}}</mat-error>\n </ng-container>\n <ng-content select=\"mat-error\"></ng-content>\n\n <!-- mat hint -->\n <div class=\"mat-form-field-hint-wrapper\" [class.cdk-visually-hidden]=\"formControl.invalid\">\n <div class=\"mat-form-field-hint-spacer\"></div>\n <ng-content select=\"mat-hint\"></ng-content>\n </div>\n </div>\n\n </ion-col>\n\n <!-- hour -->\n <ion-col class=\"hour ion-no-padding\">\n <mat-form-field [floatLabel]=\"floatLabel\"\n [class.mat-form-field-invalid]=\"formControl.touched && (timeFormControl.invalid || formControl.invalid)\">\n <mat-label *ngIf=\"placeholder && floatLabel != 'never'\" translate>COMMON.TIME</mat-label>\n <input matInput #matInput type=\"text\"\n *ngIf=\"!mobile\"\n [formControl]=\"timeFormControl\"\n autocomplete=\"off\"\n min=\"0\" max=\"23\"\n [textMask]=\"{mask: hourMask, keepCharPositions: true, placeholderChar: placeholderChar, guide: true}\"\n [placeholder]=\"'COMMON.TIME_PLACEHOLDER'|translate\"\n [required]=\"required\"\n (keyup.arrowdown)=\"openTimePicker($event)\"\n (keyup.escape)=\"preventEvent($event)\"\n (blur)=\"checkIfTouched()\"\n [tabindex]=\"tabindex !== undefined ? tabindex+1 : undefined\">\n\n <input matInput #matInput type=\"text\"\n *ngIf=\"mobile\"\n [formControl]=\"timeFormControl\"\n (click)=\"openTimePickerIfMobile($event)\"\n readonly>\n\n <input matInput type=\"text\"\n [formControl]=\"timeFormControl\"\n hidden\n [ngxTimepicker]=\"timePicker\"\n [format]=\"24\">\n\n <button matSuffix type=\"button\" mat-icon-button\n tabindex=\"-1\"\n *ngIf=\"!compact && !mobile\"\n [disabled]=\"formControl.disabled\"\n (click)=\"openTimePicker($event)\" >\n <mat-icon>keyboard_arrow_down</mat-icon>\n </button>\n <button matSuffix type=\"button\" mat-icon-button\n tabindex=\"-1\"\n *ngIf=\"!compact && mobile\"\n [disabled]=\"formControl.disabled\"\n (click)=\"openTimePickerIfMobile($event)\">\n <mat-icon>access_time</mat-icon>\n </button>\n\n <ngx-material-timepicker #timePicker [@.disabled]=\"true\"\n (timeSet)=\"onTimePickerChange($event)\"\n [ESC]=\"!mobile\"\n [defaultTime]=\"'00:00'\"\n [cancelBtnTmpl]=\"timePickerCancelButton\"\n [confirmBtnTmpl]=\"timePickerOkButton\"\n [preventOverlayClick]=\"mobile\"\n [enableKeyboardInput]=\"false\"\n [disableAnimation]=\"true\">\n <!-- cancel button -->\n <ng-template #timePickerCancelButton>\n <ion-button fill=\"clear\" color=\"dark\">\n <ion-label translate>COMMON.BTN_CANCEL</ion-label>\n </ion-button>\n </ng-template>\n\n <!-- confirm button -->\n <ng-template #timePickerOkButton>\n <ion-button fill=\"solid\" color=\"tertiary\">\n <ion-label translate>COMMON.BTN_VALIDATE</ion-label>\n </ion-button>\n </ng-template>\n\n </ngx-material-timepicker>\n </mat-form-field>\n </ion-col>\n </ion-row>\n </ion-grid>\n\n\n</ng-template>\n\n<ng-template #iconDesktop>\n <mat-icon>keyboard_arrow_down</mat-icon>\n</ng-template>\n\n<ng-template #iconDate>\n <mat-icon>date_range</mat-icon>\n</ng-template>\n\n<ng-template #matPrefixTemplate>\n <ng-content select=\"[matPrefix]\"></ng-content>\n</ng-template>\n",
|
|
6009
6067
|
providers: [
|
|
6010
6068
|
DEFAULT_VALUE_ACCESSOR$4,
|
|
6011
6069
|
],
|
|
@@ -11508,7 +11566,7 @@
|
|
|
11508
11566
|
onRefresh: [{ type: i0.Input }]
|
|
11509
11567
|
};
|
|
11510
11568
|
|
|
11511
|
-
var moment$
|
|
11569
|
+
var moment$4 = momentImported__namespace;
|
|
11512
11570
|
var SETTINGS_STORAGE_KEY = 'settings';
|
|
11513
11571
|
var SETTINGS_TRANSIENT_PROPERTIES = ['mobile', 'touchUi' /*deprecated*/];
|
|
11514
11572
|
// fixme: this constant points to static environment
|
|
@@ -11810,11 +11868,11 @@
|
|
|
11810
11868
|
if (!feature) {
|
|
11811
11869
|
feature = {
|
|
11812
11870
|
name: featureName.toLowerCase(),
|
|
11813
|
-
lastSyncDate: moment$
|
|
11871
|
+
lastSyncDate: moment$4().toISOString()
|
|
11814
11872
|
};
|
|
11815
11873
|
}
|
|
11816
11874
|
else {
|
|
11817
|
-
feature.lastSyncDate = moment$
|
|
11875
|
+
feature.lastSyncDate = moment$4().toISOString();
|
|
11818
11876
|
}
|
|
11819
11877
|
this.saveOfflineFeature(feature);
|
|
11820
11878
|
};
|
|
@@ -12008,7 +12066,7 @@
|
|
|
12008
12066
|
if (!page || !page.title || !page.path)
|
|
12009
12067
|
throw Error('Missing required argument \'page\', \'page.path\' or \'page.title\'');
|
|
12010
12068
|
// Set time
|
|
12011
|
-
page.time = page.time || moment$
|
|
12069
|
+
page.time = page.time || moment$4();
|
|
12012
12070
|
// Clean the title (remove <small> tags)
|
|
12013
12071
|
if (!opts || opts.removeTitleSmallTag !== false) {
|
|
12014
12072
|
var tagIndex = page.title.indexOf('</small>');
|
|
@@ -17652,7 +17710,7 @@
|
|
|
17652
17710
|
]; };
|
|
17653
17711
|
var templateObject_1$3, templateObject_2$3, templateObject_3$2, templateObject_4$2, templateObject_5$1;
|
|
17654
17712
|
|
|
17655
|
-
var moment$
|
|
17713
|
+
var moment$3 = momentImported__namespace;
|
|
17656
17714
|
var PlatformService = /** @class */ (function (_super) {
|
|
17657
17715
|
__extends(PlatformService, _super);
|
|
17658
17716
|
function PlatformService(platform, cdkPlatform, toastController, translate, dateAdapter, entitiesStorage, settings, networkService, accountService, configService, cache, storage, audioProvider, environment, statusBar, keyboard, splashScreen, browser, downloader) {
|
|
@@ -17912,16 +17970,16 @@
|
|
|
17912
17970
|
}
|
|
17913
17971
|
// config moment lib
|
|
17914
17972
|
try {
|
|
17915
|
-
moment$
|
|
17973
|
+
moment$3.locale(event.lang);
|
|
17916
17974
|
console.debug('[platform] Use locale {' + event.lang + '}');
|
|
17917
17975
|
}
|
|
17918
17976
|
// If error, fallback to en
|
|
17919
17977
|
catch (err) {
|
|
17920
|
-
moment$
|
|
17978
|
+
moment$3.locale('en');
|
|
17921
17979
|
console.warn('[platform] Unknown local for moment lib. Using default [en]');
|
|
17922
17980
|
}
|
|
17923
17981
|
// Config date adapter
|
|
17924
|
-
_this.dateAdapter.setLocale(moment$
|
|
17982
|
+
_this.dateAdapter.setLocale(moment$3.locale());
|
|
17925
17983
|
}
|
|
17926
17984
|
});
|
|
17927
17985
|
this.settings.onChange.subscribe(function (data) {
|
|
@@ -29862,13 +29920,13 @@
|
|
|
29862
29920
|
{ type: i1.FormBuilder }
|
|
29863
29921
|
]; };
|
|
29864
29922
|
|
|
29865
|
-
var moment$
|
|
29923
|
+
var moment$2 = momentImported__namespace;
|
|
29866
29924
|
var SwipeTestPage = /** @class */ (function () {
|
|
29867
29925
|
function SwipeTestPage(formBuilder, dateFormatPipe) {
|
|
29868
29926
|
this.formBuilder = formBuilder;
|
|
29869
29927
|
this.dateFormatPipe = dateFormatPipe;
|
|
29870
29928
|
this.$dates = new rxjs.BehaviorSubject(undefined);
|
|
29871
|
-
this._today = moment$
|
|
29929
|
+
this._today = moment$2().startOf('day');
|
|
29872
29930
|
this.form = formBuilder.group({
|
|
29873
29931
|
empty: [null, i1.Validators.required],
|
|
29874
29932
|
date: [null, i1.Validators.compose([i1.Validators.required, SharedValidators.validDate])],
|
|
@@ -29882,7 +29940,7 @@
|
|
|
29882
29940
|
var _this = this;
|
|
29883
29941
|
var dates = [];
|
|
29884
29942
|
for (var d = 0; d < 7; d++) {
|
|
29885
|
-
dates[d] = moment$
|
|
29943
|
+
dates[d] = moment$2(this._today).add(d - 3, 'day');
|
|
29886
29944
|
}
|
|
29887
29945
|
this.$dates.next(dates);
|
|
29888
29946
|
this.loadData();
|
|
@@ -29929,7 +29987,7 @@
|
|
|
29929
29987
|
{ type: DateFormatPipe }
|
|
29930
29988
|
]; };
|
|
29931
29989
|
|
|
29932
|
-
var moment = momentImported__namespace;
|
|
29990
|
+
var moment$1 = momentImported__namespace;
|
|
29933
29991
|
var DateTimeTestPage = /** @class */ (function () {
|
|
29934
29992
|
function DateTimeTestPage(platform, formBuilder, cd) {
|
|
29935
29993
|
this.platform = platform;
|
|
@@ -29965,7 +30023,7 @@
|
|
|
29965
30023
|
var now, data;
|
|
29966
30024
|
var _this = this;
|
|
29967
30025
|
return __generator(this, function (_a) {
|
|
29968
|
-
now = moment();
|
|
30026
|
+
now = moment$1();
|
|
29969
30027
|
data = {
|
|
29970
30028
|
empty: toDateISOString(now.clone().add(2, 'hours')),
|
|
29971
30029
|
enable: toDateISOString(now),
|
|
@@ -30241,9 +30299,111 @@
|
|
|
30241
30299
|
{ type: i1.FormBuilder }
|
|
30242
30300
|
]; };
|
|
30243
30301
|
|
|
30302
|
+
var moment = momentImported__namespace;
|
|
30303
|
+
var DateTestPage = /** @class */ (function () {
|
|
30304
|
+
function DateTestPage(platform, formBuilder, cd) {
|
|
30305
|
+
this.platform = platform;
|
|
30306
|
+
this.formBuilder = formBuilder;
|
|
30307
|
+
this.cd = cd;
|
|
30308
|
+
this.showLogPanel = true;
|
|
30309
|
+
this.logContent = '';
|
|
30310
|
+
this.memoryHide = false;
|
|
30311
|
+
this.memoryMobile = true;
|
|
30312
|
+
this.stringify = JSON.stringify;
|
|
30313
|
+
this.form = formBuilder.group({
|
|
30314
|
+
empty: [null, i1.Validators.required],
|
|
30315
|
+
enable: [null, i1.Validators.required],
|
|
30316
|
+
disable: [null, i1.Validators.required],
|
|
30317
|
+
readonly: [null]
|
|
30318
|
+
}, {
|
|
30319
|
+
validators: SharedFormGroupValidators.dateRange('empty', 'enable')
|
|
30320
|
+
});
|
|
30321
|
+
var disableControl = this.form.get('disable');
|
|
30322
|
+
disableControl.disable();
|
|
30323
|
+
// Copy the 'enable' value, into the disable control
|
|
30324
|
+
this.form.get('enable').valueChanges.subscribe(function (value) { return disableControl.setValue(value); });
|
|
30325
|
+
var mobile = platform.is('mobile');
|
|
30326
|
+
this.showLogPanel = this.showLogPanel || mobile;
|
|
30327
|
+
}
|
|
30328
|
+
DateTestPage.prototype.ngOnInit = function () {
|
|
30329
|
+
var _this = this;
|
|
30330
|
+
setTimeout(function () { return _this.loadData(); }, 250);
|
|
30331
|
+
};
|
|
30332
|
+
// Load the form with data
|
|
30333
|
+
DateTestPage.prototype.loadData = function () {
|
|
30334
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
30335
|
+
var now, data;
|
|
30336
|
+
var _this = this;
|
|
30337
|
+
return __generator(this, function (_a) {
|
|
30338
|
+
now = moment();
|
|
30339
|
+
data = {
|
|
30340
|
+
empty: toDateISOString(now.clone().add(2, 'hours')),
|
|
30341
|
+
enable: toDateISOString(now),
|
|
30342
|
+
disable: now,
|
|
30343
|
+
readonly: now
|
|
30344
|
+
};
|
|
30345
|
+
this.form.setValue(data);
|
|
30346
|
+
this.log('[test-page] Data loaded: ' + JSON.stringify(data));
|
|
30347
|
+
this.form.get('empty').valueChanges
|
|
30348
|
+
.pipe(operators.debounceTime(300))
|
|
30349
|
+
.subscribe(function (value) { return _this.log('[test-page] Value n°1: ' + JSON.stringify(value)); });
|
|
30350
|
+
this.form.get('enable').valueChanges
|
|
30351
|
+
.pipe(operators.debounceTime(300))
|
|
30352
|
+
.subscribe(function (value) { return _this.log('[test-page] Value n°2: ' + JSON.stringify(value)); });
|
|
30353
|
+
return [2 /*return*/];
|
|
30354
|
+
});
|
|
30355
|
+
});
|
|
30356
|
+
};
|
|
30357
|
+
DateTestPage.prototype.doSubmit = function (event) {
|
|
30358
|
+
this.form.markAllAsTouched();
|
|
30359
|
+
this.log('[test-page] Form content: ' + JSON.stringify(this.form.value));
|
|
30360
|
+
this.log('[test-page] Form status: ' + this.form.status);
|
|
30361
|
+
if (this.form.invalid) {
|
|
30362
|
+
this.log('[test-page] Form errors: ' + JSON.stringify(this.form.errors));
|
|
30363
|
+
// DEBUG
|
|
30364
|
+
AppFormUtils.logFormErrors(this.form);
|
|
30365
|
+
}
|
|
30366
|
+
};
|
|
30367
|
+
DateTestPage.prototype.log = function (message) {
|
|
30368
|
+
console.debug(message);
|
|
30369
|
+
if (this.showLogPanel) {
|
|
30370
|
+
this.logContent += message + '<br/>';
|
|
30371
|
+
this.cd.markForCheck();
|
|
30372
|
+
}
|
|
30373
|
+
};
|
|
30374
|
+
DateTestPage.prototype.clearLogPanel = function () {
|
|
30375
|
+
this.logContent = '';
|
|
30376
|
+
this.cd.markForCheck();
|
|
30377
|
+
};
|
|
30378
|
+
DateTestPage.prototype.startMemoryTimer = function () {
|
|
30379
|
+
var _this = this;
|
|
30380
|
+
this.memoryTimer = setInterval(function () {
|
|
30381
|
+
_this.memoryHide = !_this.memoryHide;
|
|
30382
|
+
}, 50);
|
|
30383
|
+
};
|
|
30384
|
+
DateTestPage.prototype.stopMemoryTimer = function () {
|
|
30385
|
+
clearInterval(this.memoryTimer);
|
|
30386
|
+
this.memoryTimer = null;
|
|
30387
|
+
this.memoryHide = false;
|
|
30388
|
+
};
|
|
30389
|
+
return DateTestPage;
|
|
30390
|
+
}());
|
|
30391
|
+
DateTestPage.decorators = [
|
|
30392
|
+
{ type: i0.Component, args: [{
|
|
30393
|
+
selector: 'app-data-test',
|
|
30394
|
+
template: "<ion-header>\n <ion-toolbar color=\"primary\">\n\n <ion-buttons slot=\"start\">\n <ion-back-button></ion-back-button>\n </ion-buttons>\n\n <ion-title>Date/Time field test page</ion-title>\n </ion-toolbar>\n</ion-header>\n\n<ion-content class=\"ion-padding\">\n\n <form class=\"form-container\" [formGroup]=\"form\" (ngSubmit)=\"doSubmit($event)\">\n\n <ion-grid>\n\n <!-- debugging memory leak -->\n <ion-row><ion-col><ion-text><h4>Debug memory leak</h4></ion-text></ion-col></ion-row>\n <ion-row>\n <ion-col size=\"2\">\n <ion-button *ngIf=\"!memoryTimer\" (click)=\"startMemoryTimer()\">Start timer</ion-button>\n <ion-button *ngIf=\"memoryTimer\" (click)=\"stopMemoryTimer()\">Stop timer</ion-button>\n </ion-col>\n <ion-col size=\"2\">\n <mat-form-field floatLabel=\"never\">\n <input matInput type=\"text\" hidden>\n <mat-checkbox (change)=\"memoryMobile=$event.checked\" [value]=\"memoryMobile\">\n Mobile ?\n </mat-checkbox>\n </mat-form-field>\n </ion-col>\n <ion-col>\n <mat-date-field formControlName=\"empty\"\n *ngIf=\"!memoryHide\"\n placeholder=\"Date/Time\"\n [required]=\"true\"\n [mobile]=\"memoryMobile\"\n [clearable]=\"true\">\n <ion-icon matPrefix name=\"calendar-outline\"></ion-icon>\n </mat-date-field>\n </ion-col>\n </ion-row>\n\n <!-- Mobile mode -->\n <ion-row><ion-col><ion-text><h4>Mobile mode</h4></ion-text></ion-col></ion-row>\n <ion-row>\n <ion-col>\n\n <!-- Empty value -->\n <ion-card>\n <ion-card-header>\n <ion-card-title>\n <ion-label color=\"primary\">\n Empty value\n </ion-label>\n </ion-card-title>\n <ion-card-subtitle>\n <ion-text color=\"medium\">\n <small><pre>{{stringify(form.controls.empty.value)}}</pre></small>\n </ion-text>\n </ion-card-subtitle>\n </ion-card-header>\n <ion-card-content>\n <mat-date-field formControlName=\"empty\"\n placeholder=\"Date/Time\"\n [required]=\"true\"\n [mobile]=\"true\"\n [clearable]=\"true\">\n <ion-icon matPrefix name=\"calendar-outline\"></ion-icon>\n </mat-date-field>\n </ion-card-content>\n </ion-card>\n </ion-col>\n\n <!-- Enable -->\n <ion-col>\n <ion-card>\n <ion-card-header>\n <ion-card-title>\n <ion-label color=\"primary\">\n With value\n </ion-label>\n </ion-card-title>\n <ion-card-subtitle>\n <ion-text color=\"medium\">\n <small><pre>{{stringify(form.controls.enable.value)}}</pre></small>\n </ion-text>\n </ion-card-subtitle>\n </ion-card-header>\n <ion-card-content>\n <mat-date-field formControlName=\"enable\"\n placeholder=\"Date/Time\"\n [required]=\"true\"\n [mobile]=\"true\"\n [clearable]=\"true\">\n <ion-icon matPrefix name=\"calendar-outline\"></ion-icon>\n </mat-date-field>\n </ion-card-content>\n </ion-card>\n </ion-col>\n\n <!-- Disable -->\n <ion-col>\n <ion-card>\n <ion-card-header>\n <ion-card-title>\n <ion-label color=\"primary\">\n Disable\n </ion-label>\n </ion-card-title>\n <ion-card-subtitle>\n <ion-text color=\"medium\">\n <small><pre>{{stringify(form.controls.disable.value)}}</pre></small>\n </ion-text>\n </ion-card-subtitle>\n </ion-card-header>\n <ion-card-content>\n <mat-date-field formControlName=\"disable\"\n placeholder=\"Date/Time\"\n [required]=\"true\"\n [mobile]=\"true\">\n <ion-icon matPrefix name=\"calendar-outline\"></ion-icon>\n </mat-date-field>\n\n </ion-card-content>\n </ion-card>\n </ion-col>\n </ion-row>\n <!-- debug console -->\n <ion-row>\n <!-- buttons -->\n <ion-col size=\"2\">\n <!-- submit form -->\n <ion-button (click)=\"doSubmit($event)\"\n fill=\"outline\">\n <ion-icon name=\"checkmark\" slot=\"icon-only\"></ion-icon>\n </ion-button>\n\n <!-- clear log -->\n <ion-button (click)=\"clearLogPanel()\"\n fill=\"outline\">\n <ion-icon name=\"trash\" slot=\"icon-only\"></ion-icon>\n </ion-button>\n </ion-col>\n <ion-col size=\"10\" *ngIf=\"showLogPanel\">\n <ion-text color=\"primary\">Log:<br/></ion-text>\n <div class=\"ion-padding-start\">\n <ion-text color=\"medium\">\n <small [innerHTML]=\"logContent\"></small>\n </ion-text>\n </div>\n </ion-col>\n </ion-row>\n\n <!-- Desktop mode -->\n <ion-row><ion-col><ion-text><h4>Desktop mode</h4></ion-text></ion-col></ion-row>\n <ion-row>\n <ion-col>\n\n <!-- Empty value -->\n <ion-card>\n <ion-card-header>\n <ion-card-title>\n <ion-label color=\"primary\">\n Empty value\n </ion-label>\n </ion-card-title>\n <ion-card-subtitle>\n <ion-text color=\"medium\">\n <small><pre>{{stringify(form.controls.empty.value)}}</pre></small>\n </ion-text>\n </ion-card-subtitle>\n </ion-card-header>\n <ion-card-content>\n <mat-date-field formControlName=\"empty\"\n placeholder=\"Date/Time\"\n [required]=\"true\"\n [mobile]=\"false\"\n [clearable]=\"true\">\n <ion-icon matPrefix name=\"calendar-outline\"></ion-icon>\n </mat-date-field>\n </ion-card-content>\n </ion-card>\n </ion-col>\n\n <!-- Enable -->\n <ion-col>\n <ion-card>\n <ion-card-header>\n <ion-card-title>\n <ion-label color=\"primary\">\n With value\n </ion-label>\n </ion-card-title>\n <ion-card-subtitle>\n <ion-text color=\"medium\">\n <small><pre>{{stringify(form.controls.enable.value)}}</pre></small>\n </ion-text>\n </ion-card-subtitle>\n </ion-card-header>\n <ion-card-content>\n <mat-date-field formControlName=\"enable\"\n placeholder=\"Date/Time\"\n [required]=\"true\"\n [mobile]=\"false\"\n [clearable]=\"true\">\n <ion-icon matPrefix name=\"calendar-outline\"></ion-icon>\n </mat-date-field>\n </ion-card-content>\n </ion-card>\n </ion-col>\n\n <!-- Disable -->\n <ion-col>\n <ion-card>\n <ion-card-header>\n <ion-card-title>\n <ion-label color=\"primary\">\n Disable\n </ion-label>\n </ion-card-title>\n <ion-card-subtitle>\n <ion-text color=\"medium\">\n <small><pre>{{stringify(form.controls.disable.value)}}</pre></small>\n </ion-text>\n </ion-card-subtitle>\n </ion-card-header>\n <ion-card-content>\n <mat-date-field formControlName=\"disable\"\n placeholder=\"Date/Time\"\n [required]=\"true\"\n [mobile]=\"false\">\n <ion-icon matPrefix name=\"calendar-outline\"></ion-icon>\n </mat-date-field>\n\n </ion-card-content>\n </ion-card>\n </ion-col>\n\n <!-- Readonly -->\n <ion-col>\n <ion-card>\n <ion-card-header>\n <ion-card-title>\n <ion-label color=\"primary\">\n Readonly toggle\n </ion-label>\n </ion-card-title>\n <ion-card-subtitle>\n <ion-text color=\"medium\">\n <small><pre>{{stringify(form.controls.readonly.value)}}</pre></small>\n </ion-text>\n </ion-card-subtitle>\n </ion-card-header>\n <ion-card-content>\n <mat-checkbox (change)=\"readonlyField.readonly=$event.checked\" [checked]=\"readonlyField.readonly\">\n </mat-checkbox>\n\n <mat-date-field #readonlyField formControlName=\"readonly\"\n placeholder=\"Date/Time\"\n [readonly]=\"true\"\n [mobile]=\"false\"\n [clearable]=\"true\">\n <ion-icon matPrefix name=\"calendar-outline\"></ion-icon>\n </mat-date-field>\n </ion-card-content>\n </ion-card>\n </ion-col>\n </ion-row>\n </ion-grid>\n </form>\n\n</ion-content>\n"
|
|
30395
|
+
},] }
|
|
30396
|
+
];
|
|
30397
|
+
DateTestPage.ctorParameters = function () { return [
|
|
30398
|
+
{ type: i1$5.Platform },
|
|
30399
|
+
{ type: i1.FormBuilder },
|
|
30400
|
+
{ type: i0.ChangeDetectorRef }
|
|
30401
|
+
]; };
|
|
30402
|
+
|
|
30244
30403
|
var SHARED_MATERIAL_TESTING_PAGES = [
|
|
30245
30404
|
{ label: 'Shared Material components', divider: true },
|
|
30246
30405
|
{ label: 'Date/Time field', page: '/testing/shared/datetime' },
|
|
30406
|
+
{ label: 'Date field', page: '/testing/shared/date' },
|
|
30247
30407
|
{ label: 'Autocomplete field', page: '/testing/shared/autocomplete' },
|
|
30248
30408
|
{ label: 'Lat/Long field', page: '/testing/shared/latlong' },
|
|
30249
30409
|
{ label: 'Numeric pad component', page: '/testing/shared/numpad' },
|
|
@@ -30268,6 +30428,11 @@
|
|
|
30268
30428
|
pathMatch: 'full',
|
|
30269
30429
|
component: DateTimeTestPage
|
|
30270
30430
|
},
|
|
30431
|
+
{
|
|
30432
|
+
path: 'date',
|
|
30433
|
+
pathMatch: 'full',
|
|
30434
|
+
component: DateTestPage
|
|
30435
|
+
},
|
|
30271
30436
|
{
|
|
30272
30437
|
path: 'latlong',
|
|
30273
30438
|
pathMatch: 'full',
|
|
@@ -30311,6 +30476,7 @@
|
|
|
30311
30476
|
],
|
|
30312
30477
|
declarations: [
|
|
30313
30478
|
DateTimeTestPage,
|
|
30479
|
+
DateTestPage,
|
|
30314
30480
|
AutocompleteTestPage,
|
|
30315
30481
|
LatLongTestPage,
|
|
30316
30482
|
NumpadTestPage,
|
|
@@ -30322,6 +30488,7 @@
|
|
|
30322
30488
|
SharedMaterialModule,
|
|
30323
30489
|
i3.RouterModule,
|
|
30324
30490
|
DateTimeTestPage,
|
|
30491
|
+
DateTestPage,
|
|
30325
30492
|
AutocompleteTestPage,
|
|
30326
30493
|
LatLongTestPage,
|
|
30327
30494
|
NumpadTestPage,
|
|
@@ -31398,10 +31565,11 @@
|
|
|
31398
31565
|
exports["ɵg"] = UserSettingsValidatorService;
|
|
31399
31566
|
exports["ɵh"] = LocalSettingsValidatorService;
|
|
31400
31567
|
exports["ɵi"] = AppIconComponent;
|
|
31401
|
-
exports["ɵj"] =
|
|
31402
|
-
exports["ɵk"] =
|
|
31403
|
-
exports["ɵl"] =
|
|
31404
|
-
exports["ɵm"] =
|
|
31568
|
+
exports["ɵj"] = DateTestPage;
|
|
31569
|
+
exports["ɵk"] = NumpadTestPage;
|
|
31570
|
+
exports["ɵl"] = MatBadgeIconTestPage;
|
|
31571
|
+
exports["ɵm"] = ToastTestingModule;
|
|
31572
|
+
exports["ɵn"] = ToastTestingPage;
|
|
31405
31573
|
|
|
31406
31574
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
31407
31575
|
|