@mediafly/js-ui 51.3.3-2 → 51.4.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/CHANGELOG.md +5 -0
- package/lib/constants/constants.js +1 -2
- package/lib/constants/constants.js.map +1 -1
- package/lib/date-input/date-input.js +12 -33
- package/lib/date-input/date-input.js.map +1 -1
- package/lib/date-input/validate-date.js +8 -12
- package/lib/date-input/validate-date.js.map +1 -1
- package/lib/date-time-zone-picker/date-time-zone-factory.js +49 -62
- package/lib/date-time-zone-picker/date-time-zone-factory.js.map +1 -1
- package/lib/date-time-zone-picker/date-time-zone-picker.html +6 -6
- package/lib/date-time-zone-picker/date-time-zone-picker.js +59 -119
- package/lib/date-time-zone-picker/date-time-zone-picker.js.map +1 -1
- package/lib/date-time-zone-picker/datepicker.html +3 -2
- package/lib/date-time-zone-picker/datepicker.js +26 -79
- package/lib/date-time-zone-picker/datepicker.js.map +1 -1
- package/lib/date-time-zone-picker/time-format-filter.js +8 -8
- package/lib/date-time-zone-picker/time-format-filter.js.map +1 -1
- package/lib/date-time-zone-picker/time-zone-picker.js +1 -1
- package/lib/date-time-zone-picker/timepicker.html +2 -1
- package/lib/date-time-zone-picker/timepicker.js +40 -35
- package/lib/date-time-zone-picker/timepicker.js.map +1 -1
- package/lib/feedback/feedback.component.html +17 -7
- package/lib/styles.css +10 -22
- package/lib/time-input/time-input.js +23 -27
- package/lib/time-input/time-input.js.map +1 -1
- package/lib/time-input/validate-time.js +3 -6
- package/lib/time-input/validate-time.js.map +1 -1
- package/lib/tsconfig.deploy.tsbuildinfo +25 -163
- package/package.json +4 -4
- package/src/components/constants/constants.js +1 -2
- package/src/components/date-input/date-input.js +12 -31
- package/src/components/date-input/validate-date.js +10 -14
- package/src/components/date-time-zone-picker/date-time-zone-factory.ts +49 -62
- package/src/components/date-time-zone-picker/date-time-zone-picker.html +6 -6
- package/src/components/date-time-zone-picker/date-time-zone-picker.ts +70 -131
- package/src/components/date-time-zone-picker/datepicker.html +3 -2
- package/src/components/date-time-zone-picker/datepicker.ts +26 -83
- package/src/components/date-time-zone-picker/time-format-filter.ts +8 -8
- package/src/components/date-time-zone-picker/time-zone-picker.js +1 -1
- package/src/components/date-time-zone-picker/timepicker.html +2 -1
- package/src/components/date-time-zone-picker/timepicker.js +47 -46
- package/src/components/feedback/feedback.component.html +17 -7
- package/src/components/feedback/feedback.less +24 -13
- package/src/components/less/objects/containers.less +15 -17
- package/src/components/less/variables/colors.less +8 -0
- package/src/components/time-input/time-input.js +24 -27
- package/src/components/time-input/validate-time.js +3 -6
- package/src/index.spec.js +1 -1
- package/tsconfig.tsbuildinfo +7221 -0
- package/webpack.config.js +0 -6
|
@@ -5,7 +5,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const angular_1 = __importDefault(require("angular"));
|
|
7
7
|
const time_input_html_1 = __importDefault(require("./time-input.html"));
|
|
8
|
-
const
|
|
8
|
+
const moment_1 = __importDefault(require("moment"));
|
|
9
9
|
angular_1.default.module('app').directive('mflyTimeInput', [
|
|
10
10
|
'$timeout',
|
|
11
11
|
'translateFactory',
|
|
@@ -25,13 +25,19 @@ angular_1.default.module('app').directive('mflyTimeInput', [
|
|
|
25
25
|
// Ng-model functionality
|
|
26
26
|
// ----------------------------------------
|
|
27
27
|
$scope.vm = {};
|
|
28
|
+
// See: https://momentjs.com/docs/#/parsing/string-format/
|
|
29
|
+
var validTimeFormats = [
|
|
30
|
+
'H:mm',
|
|
31
|
+
'h:mm A',
|
|
32
|
+
'h:mmA'
|
|
33
|
+
];
|
|
28
34
|
// Format the ng-model value as a time string.
|
|
29
35
|
// The result of this function is assigned to `ngModelCtrl.$viewValue`.
|
|
30
36
|
ngModelCtrl.$formatters.push(function (nativeDate) {
|
|
31
37
|
if (!nativeDate) {
|
|
32
38
|
return '';
|
|
33
39
|
}
|
|
34
|
-
return
|
|
40
|
+
return moment_1.default(nativeDate).format('h:mm A');
|
|
35
41
|
});
|
|
36
42
|
// Display the time string in the UI.
|
|
37
43
|
ngModelCtrl.$render = function () {
|
|
@@ -51,23 +57,13 @@ angular_1.default.module('app').directive('mflyTimeInput', [
|
|
|
51
57
|
// component of "today". If a model value exists, we need to set the
|
|
52
58
|
// outgoing date object's date part back to the original model value
|
|
53
59
|
// since the user did not intend to change that part.
|
|
54
|
-
|
|
55
|
-
const luxonFormats = ['H:mm', 'h:mm a', 'h:mma'];
|
|
56
|
-
// Try each format until one works
|
|
57
|
-
for (const format of luxonFormats) {
|
|
58
|
-
targetDateTime = DateTime.fromFormat(viewValue, format);
|
|
59
|
-
if (targetDateTime.isValid)
|
|
60
|
-
break;
|
|
61
|
-
}
|
|
60
|
+
var targetMoment = moment_1.default(viewValue, validTimeFormats, true);
|
|
62
61
|
if (ngModelCtrl.$modelValue) {
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
month: modelDateTime.month,
|
|
67
|
-
day: modelDateTime.day
|
|
68
|
-
});
|
|
62
|
+
var modelMoment = moment_1.default(ngModelCtrl.$modelValue);
|
|
63
|
+
targetMoment.year(modelMoment.year());
|
|
64
|
+
targetMoment.dayOfYear(modelMoment.dayOfYear());
|
|
69
65
|
}
|
|
70
|
-
return
|
|
66
|
+
return targetMoment.toDate();
|
|
71
67
|
});
|
|
72
68
|
// When the user input changes the scope model, push it through the
|
|
73
69
|
// parsing pipeline by calling `setViewValue`.
|
|
@@ -79,14 +75,14 @@ angular_1.default.module('app').directive('mflyTimeInput', [
|
|
|
79
75
|
$scope.invalidTimeText = translateFactory.instant('JSUI.INVALID_TIME');
|
|
80
76
|
// Time dropdown
|
|
81
77
|
// ----------------------------------------
|
|
82
|
-
|
|
83
|
-
|
|
78
|
+
var beginningOfToday = moment_1.default().hour(0).minute(0).second(0);
|
|
79
|
+
var timeCursor = moment_1.default(beginningOfToday);
|
|
84
80
|
$scope.dropdownEntries = [];
|
|
85
81
|
// Populate time entries for all 30-min intervals on today's date
|
|
86
82
|
do {
|
|
87
|
-
$scope.dropdownEntries.push(timeCursor.
|
|
88
|
-
timeCursor
|
|
89
|
-
} while (timeCursor.
|
|
83
|
+
$scope.dropdownEntries.push(timeCursor.format('h:mm A'));
|
|
84
|
+
timeCursor.add(30, 'minutes');
|
|
85
|
+
} while (timeCursor.date() === beginningOfToday.date());
|
|
90
86
|
// When a time is clicked, update the view model
|
|
91
87
|
$scope.setTime = function (timeString) {
|
|
92
88
|
$scope.vm.time = timeString;
|
|
@@ -104,13 +100,13 @@ angular_1.default.module('app').directive('mflyTimeInput', [
|
|
|
104
100
|
// Otherwise, we need to do some calculations.
|
|
105
101
|
function entriesForTime(time) {
|
|
106
102
|
// Find the number of minutes until our target time.
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
103
|
+
var target = moment_1.default(time);
|
|
104
|
+
var midnight = moment_1.default(target).hour(0).minute(0).second(0);
|
|
105
|
+
var minutesFromMidnight = target.diff(midnight, 'minutes');
|
|
110
106
|
// Round up to the next 30 minute interval.
|
|
111
|
-
|
|
107
|
+
minutesFromMidnight = Math.ceil((minutesFromMidnight + 1) / 30) * 30;
|
|
112
108
|
// Divide by 30 to get number of places we should scroll down.
|
|
113
|
-
return
|
|
109
|
+
return minutesFromMidnight / 30;
|
|
114
110
|
}
|
|
115
111
|
// If `dropdownDefault` is specified by the consumer, we should
|
|
116
112
|
// default to that time instead.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"time-input.js","sourceRoot":"","sources":["../../src/components/time-input/time-input.js"],"names":[],"mappings":";;;;;AAAA,sDAA6B;AAC7B,wEAAwC;AACxC,
|
|
1
|
+
{"version":3,"file":"time-input.js","sourceRoot":"","sources":["../../src/components/time-input/time-input.js"],"names":[],"mappings":";;;;;AAAA,sDAA6B;AAC7B,wEAAwC;AACxC,oDAA2B;AAG3B,iBAAO,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,SAAS,CAAC,eAA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AAC,WAAW,EAAE;wBAC5B,OAAO,GAAG,cAAc,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC;qBAClD;oBAED,oEAAoE;oBACpE,IAAI,OAAO,GAAG,CAAC,WAAW,GAAG,OAAO,CAAC,GAAG,UAAU,CAAC;oBAEnD,+DAA+D;oBAC/D,6CAA6C;oBAC7C,QAAQ,CAAC;wBACR,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;oBACzB,CAAC,EAAE,CAAC,CAAC,CAAC;gBACP,CAAC,CAAC;YACH,CAAC;SACD,CAAC;IACH,CAAC;CAAC,CAAC,CAAC"}
|
|
@@ -4,10 +4,11 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const angular_1 = __importDefault(require("angular"));
|
|
7
|
-
const
|
|
7
|
+
const moment_1 = __importDefault(require("moment"));
|
|
8
8
|
angular_1.default.module('app').directive('mflyValidateTime', function mflyValidateTime() {
|
|
9
9
|
function link($scope, $element, $attrs, $ctrl) {
|
|
10
10
|
$ctrl.$validators.timeFormat = function (modelValue, viewValue) {
|
|
11
|
+
// https://momentjs.com/docs/#/parsing/string-format/
|
|
11
12
|
var validTimeFormats = [
|
|
12
13
|
'H:mm',
|
|
13
14
|
'h:mm A',
|
|
@@ -17,11 +18,7 @@ angular_1.default.module('app').directive('mflyValidateTime', function mflyValid
|
|
|
17
18
|
if (viewValue === '') {
|
|
18
19
|
return true;
|
|
19
20
|
}
|
|
20
|
-
|
|
21
|
-
return validTimeFormats.some(format => {
|
|
22
|
-
const parsed = DateTime.fromFormat(viewValue, format === 'H:mm' ? 'H:mm' : 'h:mm a');
|
|
23
|
-
return parsed.isValid;
|
|
24
|
-
});
|
|
21
|
+
return moment_1.default(viewValue, validTimeFormats, true).isValid();
|
|
25
22
|
};
|
|
26
23
|
}
|
|
27
24
|
return {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validate-time.js","sourceRoot":"","sources":["../../src/components/time-input/validate-time.js"],"names":[],"mappings":";;;;;AAAA,sDAA6B;AAC7B,
|
|
1
|
+
{"version":3,"file":"validate-time.js","sourceRoot":"","sources":["../../src/components/time-input/validate-time.js"],"names":[],"mappings":";;;;;AAAA,sDAA6B;AAC7B,oDAA2B;AAE3B,iBAAO,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,SAAS,CAAC,kBAAkB,EAAE,SAAS,gBAAgB;IAE5E,SAAS,IAAI,CAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK;QAE7C,KAAK,CAAC,WAAW,CAAC,UAAU,GAAG,UAAU,UAAU,EAAE,SAAS;YAE7D,qDAAqD;YACrD,IAAI,gBAAgB,GAAG;gBACtB,MAAM;gBACN,QAAQ;gBACR,OAAO;aACP,CAAC;YAEF,sEAAsE;YACtE,IAAI,SAAS,KAAK,EAAE,EAAE;gBACrB,OAAO,IAAI,CAAC;aACZ;YAED,OAAO,gBAAM,CAAC,SAAS,EAAE,gBAAgB,EAAE,IAAI,CAAC,CAAC,OAAO,EAAE,CAAC;QAC5D,CAAC,CAAC;IACH,CAAC;IAED,OAAO;QACN,OAAO,EAAE,SAAS;QAClB,IAAI,EAAE,IAAI;KACV,CAAC;AACH,CAAC,CAAC,CAAC"}
|
|
@@ -386,58 +386,13 @@
|
|
|
386
386
|
"signature": "b896a663ff08ce92a167b7bc598edf6f4a1c13ef5b797ca2e3ffc9b0e779e48e",
|
|
387
387
|
"affectsGlobalScope": false
|
|
388
388
|
},
|
|
389
|
-
"../node_modules
|
|
390
|
-
"version": "
|
|
391
|
-
"signature": "
|
|
392
|
-
"affectsGlobalScope": false
|
|
393
|
-
},
|
|
394
|
-
"../node_modules/@types/luxon/src/_util.d.ts": {
|
|
395
|
-
"version": "f21f46e0fd48bb5051ddc15ea4532fb6fa64bfb822a54fcd9d9d2fd8a366f91c",
|
|
396
|
-
"signature": "f21f46e0fd48bb5051ddc15ea4532fb6fa64bfb822a54fcd9d9d2fd8a366f91c",
|
|
397
|
-
"affectsGlobalScope": false
|
|
398
|
-
},
|
|
399
|
-
"../node_modules/@types/luxon/src/zone.d.ts": {
|
|
400
|
-
"version": "2cb090ebddbcb24d70f7feefd4e3bb9910c61ed0de51a6c6599bfab9405348b8",
|
|
401
|
-
"signature": "2cb090ebddbcb24d70f7feefd4e3bb9910c61ed0de51a6c6599bfab9405348b8",
|
|
402
|
-
"affectsGlobalScope": false
|
|
403
|
-
},
|
|
404
|
-
"../node_modules/@types/luxon/src/misc.d.ts": {
|
|
405
|
-
"version": "52ed17fe2c0a4bb27a4f13e99234b3d1f364dc27f9bd7964946d5ec62792a0cc",
|
|
406
|
-
"signature": "52ed17fe2c0a4bb27a4f13e99234b3d1f364dc27f9bd7964946d5ec62792a0cc",
|
|
407
|
-
"affectsGlobalScope": false
|
|
408
|
-
},
|
|
409
|
-
"../node_modules/@types/luxon/src/duration.d.ts": {
|
|
410
|
-
"version": "1eef59c38f38c64fcb60dcab950d8164a54e346eab8123a33141287765ce1a4e",
|
|
411
|
-
"signature": "1eef59c38f38c64fcb60dcab950d8164a54e346eab8123a33141287765ce1a4e",
|
|
412
|
-
"affectsGlobalScope": false
|
|
413
|
-
},
|
|
414
|
-
"../node_modules/@types/luxon/src/interval.d.ts": {
|
|
415
|
-
"version": "b7648e912cb0958ae992e1b04e5bc78e79f11c7e27abd2b4c095f136a6bb2306",
|
|
416
|
-
"signature": "b7648e912cb0958ae992e1b04e5bc78e79f11c7e27abd2b4c095f136a6bb2306",
|
|
417
|
-
"affectsGlobalScope": false
|
|
418
|
-
},
|
|
419
|
-
"../node_modules/@types/luxon/src/datetime.d.ts": {
|
|
420
|
-
"version": "c68a4e9814ce3b5fffab0c0aac18172573b73e3853c5d5c509b809403fd434db",
|
|
421
|
-
"signature": "c68a4e9814ce3b5fffab0c0aac18172573b73e3853c5d5c509b809403fd434db",
|
|
422
|
-
"affectsGlobalScope": false
|
|
423
|
-
},
|
|
424
|
-
"../node_modules/@types/luxon/src/info.d.ts": {
|
|
425
|
-
"version": "ce7dc6a3cbc2310198386d55981572f53742d67a615721f101554da7801a992b",
|
|
426
|
-
"signature": "ce7dc6a3cbc2310198386d55981572f53742d67a615721f101554da7801a992b",
|
|
427
|
-
"affectsGlobalScope": false
|
|
428
|
-
},
|
|
429
|
-
"../node_modules/@types/luxon/src/luxon.d.ts": {
|
|
430
|
-
"version": "c5641bb951da5d5252e7d8a806ec3c84f42555b5bd6a0879dbf1c7df1b8bd850",
|
|
431
|
-
"signature": "c5641bb951da5d5252e7d8a806ec3c84f42555b5bd6a0879dbf1c7df1b8bd850",
|
|
432
|
-
"affectsGlobalScope": false
|
|
433
|
-
},
|
|
434
|
-
"../node_modules/@types/luxon/index.d.ts": {
|
|
435
|
-
"version": "137394641f2db26158061d0638106d87919713c4dd17d17b0cdca1972ea0f8c8",
|
|
436
|
-
"signature": "137394641f2db26158061d0638106d87919713c4dd17d17b0cdca1972ea0f8c8",
|
|
389
|
+
"../node_modules/moment/ts3.1-typings/moment.d.ts": {
|
|
390
|
+
"version": "f97edc4d3b4dd0b32766e9633086497565c37657fb591cc84a35864db4bc2fc5",
|
|
391
|
+
"signature": "f97edc4d3b4dd0b32766e9633086497565c37657fb591cc84a35864db4bc2fc5",
|
|
437
392
|
"affectsGlobalScope": false
|
|
438
393
|
},
|
|
439
394
|
"../src/components/constants/constants.js": {
|
|
440
|
-
"version": "
|
|
395
|
+
"version": "57ab21b936320cb6bcb023ab75f500d39a0686725a43f12cc6a10d98739e93dd",
|
|
441
396
|
"signature": "f761c91419d0a89422a0004ef1a92929dd4d2d5e5c16758654d8b0467d1998c6",
|
|
442
397
|
"affectsGlobalScope": false
|
|
443
398
|
},
|
|
@@ -447,12 +402,12 @@
|
|
|
447
402
|
"affectsGlobalScope": false
|
|
448
403
|
},
|
|
449
404
|
"../src/components/date-input/validate-date.js": {
|
|
450
|
-
"version": "
|
|
405
|
+
"version": "d81c0449f51910b79a55fed18c3e0766d21b32b6834d6f695e573da4d299fc8c",
|
|
451
406
|
"signature": "f761c91419d0a89422a0004ef1a92929dd4d2d5e5c16758654d8b0467d1998c6",
|
|
452
407
|
"affectsGlobalScope": false
|
|
453
408
|
},
|
|
454
409
|
"../src/components/date-input/date-input.js": {
|
|
455
|
-
"version": "
|
|
410
|
+
"version": "cf110397d2bcf6739ae3d9b45bf381853e43c35fc571c40f6354596bcdc2a638",
|
|
456
411
|
"signature": "f761c91419d0a89422a0004ef1a92929dd4d2d5e5c16758654d8b0467d1998c6",
|
|
457
412
|
"affectsGlobalScope": false
|
|
458
413
|
},
|
|
@@ -462,7 +417,7 @@
|
|
|
462
417
|
"affectsGlobalScope": false
|
|
463
418
|
},
|
|
464
419
|
"../src/components/date-time-zone-picker/date-time-zone-factory.ts": {
|
|
465
|
-
"version": "
|
|
420
|
+
"version": "88c3e3ebcdb80c6bebbe7ed55f24d622436c5fb16aa8d2532a269e26ead50a70",
|
|
466
421
|
"signature": "f761c91419d0a89422a0004ef1a92929dd4d2d5e5c16758654d8b0467d1998c6",
|
|
467
422
|
"affectsGlobalScope": false
|
|
468
423
|
},
|
|
@@ -482,27 +437,27 @@
|
|
|
482
437
|
"affectsGlobalScope": false
|
|
483
438
|
},
|
|
484
439
|
"../src/components/date-time-zone-picker/datepicker.ts": {
|
|
485
|
-
"version": "
|
|
440
|
+
"version": "e1c9d3712e4db5364405743090fc2b0e4bbf290f25b72455eb6598a0530810c6",
|
|
486
441
|
"signature": "f761c91419d0a89422a0004ef1a92929dd4d2d5e5c16758654d8b0467d1998c6",
|
|
487
442
|
"affectsGlobalScope": false
|
|
488
443
|
},
|
|
489
444
|
"../src/components/date-time-zone-picker/time-format-filter.ts": {
|
|
490
|
-
"version": "
|
|
445
|
+
"version": "0e8aef3c3fe0dd137b51a34202e7282a5c24a3a8224a2988c1dfee62e09a69db",
|
|
491
446
|
"signature": "f761c91419d0a89422a0004ef1a92929dd4d2d5e5c16758654d8b0467d1998c6",
|
|
492
447
|
"affectsGlobalScope": false
|
|
493
448
|
},
|
|
494
449
|
"../src/components/date-time-zone-picker/time-zone-picker.js": {
|
|
495
|
-
"version": "
|
|
450
|
+
"version": "3348d9ead1669c2ffa72a54bb687211874d2167a9e46535f58af1be101dfef56",
|
|
496
451
|
"signature": "f761c91419d0a89422a0004ef1a92929dd4d2d5e5c16758654d8b0467d1998c6",
|
|
497
452
|
"affectsGlobalScope": false
|
|
498
453
|
},
|
|
499
454
|
"../src/components/date-time-zone-picker/timepicker.js": {
|
|
500
|
-
"version": "
|
|
455
|
+
"version": "0a21468fae6cdd8289491eebf062872cad2f6294c9fbd4c6c678055d1e8a8869",
|
|
501
456
|
"signature": "f761c91419d0a89422a0004ef1a92929dd4d2d5e5c16758654d8b0467d1998c6",
|
|
502
457
|
"affectsGlobalScope": false
|
|
503
458
|
},
|
|
504
459
|
"../src/components/date-time-zone-picker/date-time-zone-picker.ts": {
|
|
505
|
-
"version": "
|
|
460
|
+
"version": "3e098b6a95dabfbcb4c494e64c263af04b4ac20f217469f27ac8170e7dd7623c",
|
|
506
461
|
"signature": "f761c91419d0a89422a0004ef1a92929dd4d2d5e5c16758654d8b0467d1998c6",
|
|
507
462
|
"affectsGlobalScope": false
|
|
508
463
|
},
|
|
@@ -1497,12 +1452,12 @@
|
|
|
1497
1452
|
"affectsGlobalScope": false
|
|
1498
1453
|
},
|
|
1499
1454
|
"../src/components/time-input/validate-time.js": {
|
|
1500
|
-
"version": "
|
|
1455
|
+
"version": "5ef0b1140a2cbffe7b8758a41f68bfb05a0674a01d48c0f0359f2dbdce39f3dc",
|
|
1501
1456
|
"signature": "f761c91419d0a89422a0004ef1a92929dd4d2d5e5c16758654d8b0467d1998c6",
|
|
1502
1457
|
"affectsGlobalScope": false
|
|
1503
1458
|
},
|
|
1504
1459
|
"../src/components/time-input/time-input.js": {
|
|
1505
|
-
"version": "
|
|
1460
|
+
"version": "2c3612dd8db98661ce806ff179b82b218465988a5d530709b2062e9d1fa64771",
|
|
1506
1461
|
"signature": "f761c91419d0a89422a0004ef1a92929dd4d2d5e5c16758654d8b0467d1998c6",
|
|
1507
1462
|
"affectsGlobalScope": false
|
|
1508
1463
|
},
|
|
@@ -2555,48 +2510,6 @@
|
|
|
2555
2510
|
"../node_modules/@types/lodash/common/string.d.ts",
|
|
2556
2511
|
"../node_modules/@types/lodash/common/util.d.ts"
|
|
2557
2512
|
],
|
|
2558
|
-
"../node_modules/@types/luxon/index.d.ts": [
|
|
2559
|
-
"../node_modules/@types/luxon/src/luxon.d.ts"
|
|
2560
|
-
],
|
|
2561
|
-
"../node_modules/@types/luxon/src/_util.d.ts": [
|
|
2562
|
-
"../node_modules/@types/luxon/src/settings.d.ts"
|
|
2563
|
-
],
|
|
2564
|
-
"../node_modules/@types/luxon/src/datetime.d.ts": [
|
|
2565
|
-
"../node_modules/@types/luxon/index.d.ts",
|
|
2566
|
-
"../node_modules/@types/luxon/src/_util.d.ts",
|
|
2567
|
-
"../node_modules/@types/luxon/src/duration.d.ts",
|
|
2568
|
-
"../node_modules/@types/luxon/src/interval.d.ts",
|
|
2569
|
-
"../node_modules/@types/luxon/src/zone.d.ts"
|
|
2570
|
-
],
|
|
2571
|
-
"../node_modules/@types/luxon/src/duration.d.ts": [
|
|
2572
|
-
"../node_modules/@types/luxon/src/_util.d.ts",
|
|
2573
|
-
"../node_modules/@types/luxon/src/datetime.d.ts",
|
|
2574
|
-
"../node_modules/@types/luxon/src/misc.d.ts"
|
|
2575
|
-
],
|
|
2576
|
-
"../node_modules/@types/luxon/src/info.d.ts": [
|
|
2577
|
-
"../node_modules/@types/luxon/src/misc.d.ts",
|
|
2578
|
-
"../node_modules/@types/luxon/src/zone.d.ts"
|
|
2579
|
-
],
|
|
2580
|
-
"../node_modules/@types/luxon/src/interval.d.ts": [
|
|
2581
|
-
"../node_modules/@types/luxon/src/_util.d.ts",
|
|
2582
|
-
"../node_modules/@types/luxon/src/datetime.d.ts",
|
|
2583
|
-
"../node_modules/@types/luxon/src/duration.d.ts"
|
|
2584
|
-
],
|
|
2585
|
-
"../node_modules/@types/luxon/src/luxon.d.ts": [
|
|
2586
|
-
"../node_modules/@types/luxon/src/datetime.d.ts",
|
|
2587
|
-
"../node_modules/@types/luxon/src/duration.d.ts",
|
|
2588
|
-
"../node_modules/@types/luxon/src/info.d.ts",
|
|
2589
|
-
"../node_modules/@types/luxon/src/interval.d.ts",
|
|
2590
|
-
"../node_modules/@types/luxon/src/misc.d.ts",
|
|
2591
|
-
"../node_modules/@types/luxon/src/settings.d.ts",
|
|
2592
|
-
"../node_modules/@types/luxon/src/zone.d.ts"
|
|
2593
|
-
],
|
|
2594
|
-
"../node_modules/@types/luxon/src/settings.d.ts": [
|
|
2595
|
-
"../node_modules/@types/luxon/src/zone.d.ts"
|
|
2596
|
-
],
|
|
2597
|
-
"../node_modules/@types/luxon/src/zone.d.ts": [
|
|
2598
|
-
"../node_modules/@types/luxon/src/_util.d.ts"
|
|
2599
|
-
],
|
|
2600
2513
|
"../node_modules/@types/mdast/index.d.ts": [
|
|
2601
2514
|
"../node_modules/@types/unist/index.d.ts"
|
|
2602
2515
|
],
|
|
@@ -3573,14 +3486,14 @@
|
|
|
3573
3486
|
"../src/components/constants/constants.js": [
|
|
3574
3487
|
"../node_modules/@types/angular/index.d.ts",
|
|
3575
3488
|
"../node_modules/@types/lodash/index.d.ts",
|
|
3576
|
-
"../node_modules
|
|
3489
|
+
"../node_modules/moment/ts3.1-typings/moment.d.ts"
|
|
3577
3490
|
],
|
|
3578
3491
|
"../src/components/constants/index.ts": [
|
|
3579
3492
|
"../src/components/constants/constants.js"
|
|
3580
3493
|
],
|
|
3581
3494
|
"../src/components/date-input/date-input.js": [
|
|
3582
3495
|
"../node_modules/@types/angular/index.d.ts",
|
|
3583
|
-
"../node_modules
|
|
3496
|
+
"../node_modules/moment/ts3.1-typings/moment.d.ts",
|
|
3584
3497
|
"../typings/index.d.ts"
|
|
3585
3498
|
],
|
|
3586
3499
|
"../src/components/date-input/index.ts": [
|
|
@@ -3589,20 +3502,20 @@
|
|
|
3589
3502
|
],
|
|
3590
3503
|
"../src/components/date-input/validate-date.js": [
|
|
3591
3504
|
"../node_modules/@types/angular/index.d.ts",
|
|
3592
|
-
"../node_modules
|
|
3505
|
+
"../node_modules/moment/ts3.1-typings/moment.d.ts"
|
|
3593
3506
|
],
|
|
3594
3507
|
"../src/components/date-time-zone-picker/date-time-zone-factory.ts": [
|
|
3595
3508
|
"../node_modules/@types/angular/index.d.ts",
|
|
3596
3509
|
"../node_modules/@types/lodash/index.d.ts",
|
|
3597
|
-
"../node_modules
|
|
3510
|
+
"../node_modules/moment/ts3.1-typings/moment.d.ts"
|
|
3598
3511
|
],
|
|
3599
3512
|
"../src/components/date-time-zone-picker/date-time-zone-picker.ts": [
|
|
3600
3513
|
"../node_modules/@types/angular/index.d.ts",
|
|
3601
|
-
"../node_modules
|
|
3514
|
+
"../node_modules/moment/ts3.1-typings/moment.d.ts"
|
|
3602
3515
|
],
|
|
3603
3516
|
"../src/components/date-time-zone-picker/datepicker.ts": [
|
|
3604
3517
|
"../node_modules/@types/angular/index.d.ts",
|
|
3605
|
-
"../node_modules
|
|
3518
|
+
"../node_modules/moment/ts3.1-typings/moment.d.ts",
|
|
3606
3519
|
"../src/components/form-validation-utils/form-validation-utils.ts",
|
|
3607
3520
|
"../src/components/translate/translate-factory.ts"
|
|
3608
3521
|
],
|
|
@@ -3617,7 +3530,7 @@
|
|
|
3617
3530
|
"../src/components/date-time-zone-picker/time-format-filter.ts": [
|
|
3618
3531
|
"../node_modules/@types/angular/index.d.ts",
|
|
3619
3532
|
"../node_modules/@types/lodash/index.d.ts",
|
|
3620
|
-
"../node_modules
|
|
3533
|
+
"../node_modules/moment/ts3.1-typings/moment.d.ts"
|
|
3621
3534
|
],
|
|
3622
3535
|
"../src/components/date-time-zone-picker/time-zone-picker.js": [
|
|
3623
3536
|
"../node_modules/@types/angular/index.d.ts",
|
|
@@ -3625,7 +3538,7 @@
|
|
|
3625
3538
|
],
|
|
3626
3539
|
"../src/components/date-time-zone-picker/timepicker.js": [
|
|
3627
3540
|
"../node_modules/@types/angular/index.d.ts",
|
|
3628
|
-
"../node_modules
|
|
3541
|
+
"../node_modules/moment/ts3.1-typings/moment.d.ts",
|
|
3629
3542
|
"../typings/index.d.ts"
|
|
3630
3543
|
],
|
|
3631
3544
|
"../src/components/decorators/index.ts": [
|
|
@@ -4055,12 +3968,12 @@
|
|
|
4055
3968
|
],
|
|
4056
3969
|
"../src/components/time-input/time-input.js": [
|
|
4057
3970
|
"../node_modules/@types/angular/index.d.ts",
|
|
4058
|
-
"../node_modules
|
|
3971
|
+
"../node_modules/moment/ts3.1-typings/moment.d.ts",
|
|
4059
3972
|
"../typings/index.d.ts"
|
|
4060
3973
|
],
|
|
4061
3974
|
"../src/components/time-input/validate-time.js": [
|
|
4062
3975
|
"../node_modules/@types/angular/index.d.ts",
|
|
4063
|
-
"../node_modules
|
|
3976
|
+
"../node_modules/moment/ts3.1-typings/moment.d.ts"
|
|
4064
3977
|
],
|
|
4065
3978
|
"../src/components/translate/index.ts": [
|
|
4066
3979
|
"../src/components/translate/translate-factory.ts"
|
|
@@ -4463,48 +4376,6 @@
|
|
|
4463
4376
|
"../node_modules/@types/lodash/common/string.d.ts",
|
|
4464
4377
|
"../node_modules/@types/lodash/common/util.d.ts"
|
|
4465
4378
|
],
|
|
4466
|
-
"../node_modules/@types/luxon/index.d.ts": [
|
|
4467
|
-
"../node_modules/@types/luxon/src/luxon.d.ts"
|
|
4468
|
-
],
|
|
4469
|
-
"../node_modules/@types/luxon/src/_util.d.ts": [
|
|
4470
|
-
"../node_modules/@types/luxon/src/settings.d.ts"
|
|
4471
|
-
],
|
|
4472
|
-
"../node_modules/@types/luxon/src/datetime.d.ts": [
|
|
4473
|
-
"../node_modules/@types/luxon/index.d.ts",
|
|
4474
|
-
"../node_modules/@types/luxon/src/_util.d.ts",
|
|
4475
|
-
"../node_modules/@types/luxon/src/duration.d.ts",
|
|
4476
|
-
"../node_modules/@types/luxon/src/interval.d.ts",
|
|
4477
|
-
"../node_modules/@types/luxon/src/zone.d.ts"
|
|
4478
|
-
],
|
|
4479
|
-
"../node_modules/@types/luxon/src/duration.d.ts": [
|
|
4480
|
-
"../node_modules/@types/luxon/src/_util.d.ts",
|
|
4481
|
-
"../node_modules/@types/luxon/src/datetime.d.ts",
|
|
4482
|
-
"../node_modules/@types/luxon/src/misc.d.ts"
|
|
4483
|
-
],
|
|
4484
|
-
"../node_modules/@types/luxon/src/info.d.ts": [
|
|
4485
|
-
"../node_modules/@types/luxon/src/misc.d.ts",
|
|
4486
|
-
"../node_modules/@types/luxon/src/zone.d.ts"
|
|
4487
|
-
],
|
|
4488
|
-
"../node_modules/@types/luxon/src/interval.d.ts": [
|
|
4489
|
-
"../node_modules/@types/luxon/src/_util.d.ts",
|
|
4490
|
-
"../node_modules/@types/luxon/src/datetime.d.ts",
|
|
4491
|
-
"../node_modules/@types/luxon/src/duration.d.ts"
|
|
4492
|
-
],
|
|
4493
|
-
"../node_modules/@types/luxon/src/luxon.d.ts": [
|
|
4494
|
-
"../node_modules/@types/luxon/src/datetime.d.ts",
|
|
4495
|
-
"../node_modules/@types/luxon/src/duration.d.ts",
|
|
4496
|
-
"../node_modules/@types/luxon/src/info.d.ts",
|
|
4497
|
-
"../node_modules/@types/luxon/src/interval.d.ts",
|
|
4498
|
-
"../node_modules/@types/luxon/src/misc.d.ts",
|
|
4499
|
-
"../node_modules/@types/luxon/src/settings.d.ts",
|
|
4500
|
-
"../node_modules/@types/luxon/src/zone.d.ts"
|
|
4501
|
-
],
|
|
4502
|
-
"../node_modules/@types/luxon/src/settings.d.ts": [
|
|
4503
|
-
"../node_modules/@types/luxon/src/zone.d.ts"
|
|
4504
|
-
],
|
|
4505
|
-
"../node_modules/@types/luxon/src/zone.d.ts": [
|
|
4506
|
-
"../node_modules/@types/luxon/src/_util.d.ts"
|
|
4507
|
-
],
|
|
4508
4379
|
"../node_modules/@types/mdast/index.d.ts": [
|
|
4509
4380
|
"../node_modules/@types/unist/index.d.ts"
|
|
4510
4381
|
],
|
|
@@ -5810,16 +5681,6 @@
|
|
|
5810
5681
|
"../node_modules/@types/lodash/common/string.d.ts",
|
|
5811
5682
|
"../node_modules/@types/lodash/common/util.d.ts",
|
|
5812
5683
|
"../node_modules/@types/lodash/index.d.ts",
|
|
5813
|
-
"../node_modules/@types/luxon/index.d.ts",
|
|
5814
|
-
"../node_modules/@types/luxon/src/_util.d.ts",
|
|
5815
|
-
"../node_modules/@types/luxon/src/datetime.d.ts",
|
|
5816
|
-
"../node_modules/@types/luxon/src/duration.d.ts",
|
|
5817
|
-
"../node_modules/@types/luxon/src/info.d.ts",
|
|
5818
|
-
"../node_modules/@types/luxon/src/interval.d.ts",
|
|
5819
|
-
"../node_modules/@types/luxon/src/luxon.d.ts",
|
|
5820
|
-
"../node_modules/@types/luxon/src/misc.d.ts",
|
|
5821
|
-
"../node_modules/@types/luxon/src/settings.d.ts",
|
|
5822
|
-
"../node_modules/@types/luxon/src/zone.d.ts",
|
|
5823
5684
|
"../node_modules/@types/mdast/index.d.ts",
|
|
5824
5685
|
"../node_modules/@types/mime/index.d.ts",
|
|
5825
5686
|
"../node_modules/@types/minimatch/index.d.ts",
|
|
@@ -5975,6 +5836,7 @@
|
|
|
5975
5836
|
"../node_modules/fast-glob/out/managers/tasks.d.ts",
|
|
5976
5837
|
"../node_modules/fast-glob/out/settings.d.ts",
|
|
5977
5838
|
"../node_modules/fast-glob/out/types/index.d.ts",
|
|
5839
|
+
"../node_modules/moment/ts3.1-typings/moment.d.ts",
|
|
5978
5840
|
"../node_modules/parchment/dist/parchment.d.ts",
|
|
5979
5841
|
"../node_modules/quill-delta/dist/attributemap.d.ts",
|
|
5980
5842
|
"../node_modules/quill-delta/dist/delta.d.ts",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mediafly/js-ui",
|
|
3
|
-
"version": "51.
|
|
3
|
+
"version": "51.4.0",
|
|
4
4
|
"license": "UNLICENSED",
|
|
5
5
|
"description": "UI components for Mediafly Angular applications",
|
|
6
6
|
"repository": {
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"hammerjs": "2.0.8",
|
|
25
25
|
"jquery": "3.6.0",
|
|
26
26
|
"lodash": "4.17.21",
|
|
27
|
-
"
|
|
27
|
+
"moment": "2.29.1",
|
|
28
28
|
"pikaday": "1.8.2",
|
|
29
29
|
"quill": "2.0.2",
|
|
30
30
|
"reflect-metadata": "0.1.13",
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"@types/jasmine": "2.8.6",
|
|
48
48
|
"@types/jquery": "3.5.8",
|
|
49
49
|
"@types/lodash": "4.14.176",
|
|
50
|
-
"@types/
|
|
50
|
+
"@types/moment": "2.13.0",
|
|
51
51
|
"@types/screenfull": "4.1.0",
|
|
52
52
|
"autoprefixer": "9.8.5",
|
|
53
53
|
"babel-core": "6.26.3",
|
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
"jasmine-core": "3.6.0",
|
|
68
68
|
"karma": "6.3.4",
|
|
69
69
|
"karma-chrome-launcher": "2.2.0",
|
|
70
|
-
"karma-jasmine": "
|
|
70
|
+
"karma-jasmine": "1.1.0",
|
|
71
71
|
"karma-junit-reporter": "2.0.1",
|
|
72
72
|
"karma-mocha-reporter": "2.2.3",
|
|
73
73
|
"karma-webpack": "5.0.0",
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import angular from 'angular'
|
|
2
|
-
const { DateTime } = require('luxon')
|
|
3
2
|
|
|
4
3
|
angular.module('app')
|
|
5
4
|
.constant('_', require('lodash'))
|
|
6
|
-
.constant('$
|
|
5
|
+
.constant('$moment', require('moment'))
|
|
7
6
|
.constant('Pikaday', require('pikaday'))
|
|
8
7
|
.constant('PREFIX', '/components/');
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import angular from 'angular'
|
|
2
2
|
import template from './date-input.html'
|
|
3
|
-
|
|
3
|
+
import moment from 'moment'
|
|
4
4
|
import Pikaday from 'pikaday'
|
|
5
5
|
|
|
6
6
|
angular.module('app').directive('mflyDateInput', ['translateFactory', function mflyDateInput (translateFactory) {
|
|
@@ -21,12 +21,12 @@ angular.module('app').directive('mflyDateInput', ['translateFactory', function m
|
|
|
21
21
|
// Ng-model functionality
|
|
22
22
|
// ----------------------------------------
|
|
23
23
|
var validDateFormats = [
|
|
24
|
-
'
|
|
25
|
-
'
|
|
26
|
-
'MM-
|
|
27
|
-
'M-
|
|
28
|
-
'MM-
|
|
29
|
-
'M-
|
|
24
|
+
'D-MMM-YYYY', 'D/MMM/YYYY',
|
|
25
|
+
'DD-MMM-YYYY', 'DD/MMM/YYYY',
|
|
26
|
+
'MM-DD-YYYY', 'MM/DD/YYYY',
|
|
27
|
+
'M-D-YYYY', 'M/D/YYYY',
|
|
28
|
+
'MM-DD-YY', 'MM/DD/YY',
|
|
29
|
+
'M-D-YY', 'M/D/YY'
|
|
30
30
|
]
|
|
31
31
|
|
|
32
32
|
// Format the ng-model value as a date string.
|
|
@@ -36,7 +36,7 @@ angular.module('app').directive('mflyDateInput', ['translateFactory', function m
|
|
|
36
36
|
if (!nativeDate) {
|
|
37
37
|
return ''
|
|
38
38
|
}
|
|
39
|
-
return
|
|
39
|
+
return moment(nativeDate).format('DD-MMM-YYYY')
|
|
40
40
|
})
|
|
41
41
|
|
|
42
42
|
// Display the date string in the UI.
|
|
@@ -56,14 +56,7 @@ angular.module('app').directive('mflyDateInput', ['translateFactory', function m
|
|
|
56
56
|
return null
|
|
57
57
|
}
|
|
58
58
|
|
|
59
|
-
|
|
60
|
-
let parsedDate;
|
|
61
|
-
for (const format of validDateFormats) {
|
|
62
|
-
parsedDate = DateTime.fromFormat(viewValue, format);
|
|
63
|
-
if (parsedDate.isValid) break;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
const jsDate = parsedDate.toJSDate();
|
|
59
|
+
const jsDate = moment(viewValue, validDateFormats, true).toDate()
|
|
67
60
|
$scope.onChange({ value: jsDate })
|
|
68
61
|
return jsDate
|
|
69
62
|
})
|
|
@@ -74,12 +67,7 @@ angular.module('app').directive('mflyDateInput', ['translateFactory', function m
|
|
|
74
67
|
|
|
75
68
|
if (pikaday) {
|
|
76
69
|
// We can't rely on native Date() parsing here (JSUI-185).
|
|
77
|
-
|
|
78
|
-
for (const format of validDateFormats) {
|
|
79
|
-
parsedDate = DateTime.fromFormat(newValue, format);
|
|
80
|
-
if (parsedDate.isValid) break;
|
|
81
|
-
}
|
|
82
|
-
pikaday.setDate(parsedDate.toJSDate(), true) // true = do not trigger onSelect
|
|
70
|
+
pikaday.setDate(moment(newValue, validDateFormats).toDate(), true) // true = do not trigger onSelect
|
|
83
71
|
}
|
|
84
72
|
|
|
85
73
|
ngModelCtrl.$setViewValue(newValue)
|
|
@@ -98,7 +86,7 @@ angular.module('app').directive('mflyDateInput', ['translateFactory', function m
|
|
|
98
86
|
// the scope property with a valid-formatted date string.
|
|
99
87
|
onSelect: function (newDate) {
|
|
100
88
|
$scope.$apply(function () {
|
|
101
|
-
$scope.date =
|
|
89
|
+
$scope.date = moment(newDate).format('DD-MMM-YYYY')
|
|
102
90
|
})
|
|
103
91
|
},
|
|
104
92
|
// We can make the input field disabled, but we need further measures
|
|
@@ -116,14 +104,7 @@ angular.module('app').directive('mflyDateInput', ['translateFactory', function m
|
|
|
116
104
|
// object which we initialize from the scope's model date, but ngModel
|
|
117
105
|
// doesn't fill that value in until the digest cycle has stabilized.
|
|
118
106
|
setTimeout(function () {
|
|
119
|
-
|
|
120
|
-
let parsedDate;
|
|
121
|
-
for (const format of validDateFormats) {
|
|
122
|
-
parsedDate = DateTime.fromFormat($scope.date, format);
|
|
123
|
-
if (parsedDate.isValid) break;
|
|
124
|
-
}
|
|
125
|
-
pikadayOptions.defaultDate = parsedDate.toJSDate();
|
|
126
|
-
}
|
|
107
|
+
pikadayOptions.defaultDate = moment($scope.date, validDateFormats).toDate() // new Date($scope.date)
|
|
127
108
|
pikaday = new Pikaday(pikadayOptions)
|
|
128
109
|
}, 0)
|
|
129
110
|
|