@mediafly/js-ui 51.4.0 → 51.4.1
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 +4 -0
- package/lib/constants/constants.js +2 -1
- package/lib/constants/constants.js.map +1 -1
- package/lib/date-input/date-input.js +33 -12
- package/lib/date-input/date-input.js.map +1 -1
- package/lib/date-input/validate-date.js +12 -8
- package/lib/date-input/validate-date.js.map +1 -1
- package/lib/date-time-zone-picker/date-time-zone-factory.js +62 -49
- 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 +119 -59
- package/lib/date-time-zone-picker/date-time-zone-picker.js.map +1 -1
- package/lib/date-time-zone-picker/datepicker.html +2 -3
- package/lib/date-time-zone-picker/datepicker.js +79 -26
- 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 +1 -2
- package/lib/date-time-zone-picker/timepicker.js +35 -40
- package/lib/date-time-zone-picker/timepicker.js.map +1 -1
- package/lib/time-input/time-input.js +27 -23
- package/lib/time-input/time-input.js.map +1 -1
- package/lib/time-input/validate-time.js +6 -3
- package/lib/time-input/validate-time.js.map +1 -1
- package/lib/tsconfig.deploy.tsbuildinfo +163 -25
- package/package.json +4 -4
- package/src/components/constants/constants.js +2 -1
- package/src/components/date-input/date-input.js +31 -12
- package/src/components/date-input/validate-date.js +14 -10
- package/src/components/date-time-zone-picker/date-time-zone-factory.ts +62 -49
- 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 +131 -70
- package/src/components/date-time-zone-picker/datepicker.html +2 -3
- package/src/components/date-time-zone-picker/datepicker.ts +83 -26
- 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 +1 -2
- package/src/components/date-time-zone-picker/timepicker.js +46 -47
- package/src/components/time-input/time-input.js +27 -24
- package/src/components/time-input/validate-time.js +6 -3
- package/webpack.config.js +6 -0
- package/tsconfig.tsbuildinfo +0 -7221
|
@@ -4,11 +4,10 @@ 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 { DateTime } = require('luxon');
|
|
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/
|
|
12
11
|
var validTimeFormats = [
|
|
13
12
|
'H:mm',
|
|
14
13
|
'h:mm A',
|
|
@@ -18,7 +17,11 @@ angular_1.default.module('app').directive('mflyValidateTime', function mflyValid
|
|
|
18
17
|
if (viewValue === '') {
|
|
19
18
|
return true;
|
|
20
19
|
}
|
|
21
|
-
|
|
20
|
+
// Check if the time is valid according to the given formats
|
|
21
|
+
return validTimeFormats.some(format => {
|
|
22
|
+
const parsed = DateTime.fromFormat(viewValue, format === 'H:mm' ? 'H:mm' : 'h:mm a');
|
|
23
|
+
return parsed.isValid;
|
|
24
|
+
});
|
|
22
25
|
};
|
|
23
26
|
}
|
|
24
27
|
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,MAAM,EAAE,QAAQ,EAAE,GAAG,OAAO,CAAC,OAAO,CAAC,CAAA;AAErC,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,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,4DAA4D;YAC5D,OAAO,gBAAgB,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE;gBACrC,MAAM,MAAM,GAAG,QAAQ,CAAC,UAAU,CAAC,SAAS,EAAE,MAAM,KAAK,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAA;gBACpF,OAAO,MAAM,CAAC,OAAO,CAAA;YACtB,CAAC,CAAC,CAAA;QACH,CAAC,CAAC;IACH,CAAC;IAED,OAAO;QACN,OAAO,EAAE,SAAS;QAClB,IAAI,EAAE,IAAI;KACV,CAAC;AACH,CAAC,CAAC,CAAC"}
|
|
@@ -386,13 +386,58 @@
|
|
|
386
386
|
"signature": "b896a663ff08ce92a167b7bc598edf6f4a1c13ef5b797ca2e3ffc9b0e779e48e",
|
|
387
387
|
"affectsGlobalScope": false
|
|
388
388
|
},
|
|
389
|
-
"../node_modules/
|
|
390
|
-
"version": "
|
|
391
|
-
"signature": "
|
|
389
|
+
"../node_modules/@types/luxon/src/settings.d.ts": {
|
|
390
|
+
"version": "3c706bae5e03bfd2d4da4bb476191b425c6414b4e142cf6419d969df582c257e",
|
|
391
|
+
"signature": "3c706bae5e03bfd2d4da4bb476191b425c6414b4e142cf6419d969df582c257e",
|
|
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",
|
|
392
437
|
"affectsGlobalScope": false
|
|
393
438
|
},
|
|
394
439
|
"../src/components/constants/constants.js": {
|
|
395
|
-
"version": "
|
|
440
|
+
"version": "a25441ad1502777599c67b270c69df28966e2c936060d2c2c6672e08a8b93c98",
|
|
396
441
|
"signature": "f761c91419d0a89422a0004ef1a92929dd4d2d5e5c16758654d8b0467d1998c6",
|
|
397
442
|
"affectsGlobalScope": false
|
|
398
443
|
},
|
|
@@ -402,12 +447,12 @@
|
|
|
402
447
|
"affectsGlobalScope": false
|
|
403
448
|
},
|
|
404
449
|
"../src/components/date-input/validate-date.js": {
|
|
405
|
-
"version": "
|
|
450
|
+
"version": "ebe7da7090a6de60a0239cac46353c6078f4cf92d3413229bc40942d512db971",
|
|
406
451
|
"signature": "f761c91419d0a89422a0004ef1a92929dd4d2d5e5c16758654d8b0467d1998c6",
|
|
407
452
|
"affectsGlobalScope": false
|
|
408
453
|
},
|
|
409
454
|
"../src/components/date-input/date-input.js": {
|
|
410
|
-
"version": "
|
|
455
|
+
"version": "d04cdd8d8a5be2c5a5a10345ad3d4db9cf51756622075bceddbf279dd63742bf",
|
|
411
456
|
"signature": "f761c91419d0a89422a0004ef1a92929dd4d2d5e5c16758654d8b0467d1998c6",
|
|
412
457
|
"affectsGlobalScope": false
|
|
413
458
|
},
|
|
@@ -417,7 +462,7 @@
|
|
|
417
462
|
"affectsGlobalScope": false
|
|
418
463
|
},
|
|
419
464
|
"../src/components/date-time-zone-picker/date-time-zone-factory.ts": {
|
|
420
|
-
"version": "
|
|
465
|
+
"version": "deb87bff70e5651092c4d3cb03807127a64493a91853cd5b07368a9f6bfdac9b",
|
|
421
466
|
"signature": "f761c91419d0a89422a0004ef1a92929dd4d2d5e5c16758654d8b0467d1998c6",
|
|
422
467
|
"affectsGlobalScope": false
|
|
423
468
|
},
|
|
@@ -437,27 +482,27 @@
|
|
|
437
482
|
"affectsGlobalScope": false
|
|
438
483
|
},
|
|
439
484
|
"../src/components/date-time-zone-picker/datepicker.ts": {
|
|
440
|
-
"version": "
|
|
485
|
+
"version": "248189c74ccf05d22333c1d7e6a15dbd9d1e72aed2ada660c0dded9d8481302d",
|
|
441
486
|
"signature": "f761c91419d0a89422a0004ef1a92929dd4d2d5e5c16758654d8b0467d1998c6",
|
|
442
487
|
"affectsGlobalScope": false
|
|
443
488
|
},
|
|
444
489
|
"../src/components/date-time-zone-picker/time-format-filter.ts": {
|
|
445
|
-
"version": "
|
|
490
|
+
"version": "576b080bea72c11b702b9252e3148a7edfe6f6a1fab231a8816f98aafea5ab10",
|
|
446
491
|
"signature": "f761c91419d0a89422a0004ef1a92929dd4d2d5e5c16758654d8b0467d1998c6",
|
|
447
492
|
"affectsGlobalScope": false
|
|
448
493
|
},
|
|
449
494
|
"../src/components/date-time-zone-picker/time-zone-picker.js": {
|
|
450
|
-
"version": "
|
|
495
|
+
"version": "488076a733d7e36b8ae10e624098d82b25e3699a8ec34476fb8704735343c424",
|
|
451
496
|
"signature": "f761c91419d0a89422a0004ef1a92929dd4d2d5e5c16758654d8b0467d1998c6",
|
|
452
497
|
"affectsGlobalScope": false
|
|
453
498
|
},
|
|
454
499
|
"../src/components/date-time-zone-picker/timepicker.js": {
|
|
455
|
-
"version": "
|
|
500
|
+
"version": "cc6cfa0aa9252d08f1a501acc80aa58fd7fb06ca700cf48c4dd158fc4a69abf3",
|
|
456
501
|
"signature": "f761c91419d0a89422a0004ef1a92929dd4d2d5e5c16758654d8b0467d1998c6",
|
|
457
502
|
"affectsGlobalScope": false
|
|
458
503
|
},
|
|
459
504
|
"../src/components/date-time-zone-picker/date-time-zone-picker.ts": {
|
|
460
|
-
"version": "
|
|
505
|
+
"version": "6a093618454e92658f5ad3a5720d30d46598124da4498367fb50062695295e74",
|
|
461
506
|
"signature": "f761c91419d0a89422a0004ef1a92929dd4d2d5e5c16758654d8b0467d1998c6",
|
|
462
507
|
"affectsGlobalScope": false
|
|
463
508
|
},
|
|
@@ -1452,12 +1497,12 @@
|
|
|
1452
1497
|
"affectsGlobalScope": false
|
|
1453
1498
|
},
|
|
1454
1499
|
"../src/components/time-input/validate-time.js": {
|
|
1455
|
-
"version": "
|
|
1500
|
+
"version": "e7d91339457009a9f41c6606edfeacc608e05ab47d37cfd93878e865eccb138c",
|
|
1456
1501
|
"signature": "f761c91419d0a89422a0004ef1a92929dd4d2d5e5c16758654d8b0467d1998c6",
|
|
1457
1502
|
"affectsGlobalScope": false
|
|
1458
1503
|
},
|
|
1459
1504
|
"../src/components/time-input/time-input.js": {
|
|
1460
|
-
"version": "
|
|
1505
|
+
"version": "6597be84973f5c0256419a6da15681f707033623c0d37387aff480ef39cae4a5",
|
|
1461
1506
|
"signature": "f761c91419d0a89422a0004ef1a92929dd4d2d5e5c16758654d8b0467d1998c6",
|
|
1462
1507
|
"affectsGlobalScope": false
|
|
1463
1508
|
},
|
|
@@ -2510,6 +2555,48 @@
|
|
|
2510
2555
|
"../node_modules/@types/lodash/common/string.d.ts",
|
|
2511
2556
|
"../node_modules/@types/lodash/common/util.d.ts"
|
|
2512
2557
|
],
|
|
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
|
+
],
|
|
2513
2600
|
"../node_modules/@types/mdast/index.d.ts": [
|
|
2514
2601
|
"../node_modules/@types/unist/index.d.ts"
|
|
2515
2602
|
],
|
|
@@ -3486,14 +3573,14 @@
|
|
|
3486
3573
|
"../src/components/constants/constants.js": [
|
|
3487
3574
|
"../node_modules/@types/angular/index.d.ts",
|
|
3488
3575
|
"../node_modules/@types/lodash/index.d.ts",
|
|
3489
|
-
"../node_modules/
|
|
3576
|
+
"../node_modules/@types/luxon/index.d.ts"
|
|
3490
3577
|
],
|
|
3491
3578
|
"../src/components/constants/index.ts": [
|
|
3492
3579
|
"../src/components/constants/constants.js"
|
|
3493
3580
|
],
|
|
3494
3581
|
"../src/components/date-input/date-input.js": [
|
|
3495
3582
|
"../node_modules/@types/angular/index.d.ts",
|
|
3496
|
-
"../node_modules/
|
|
3583
|
+
"../node_modules/@types/luxon/index.d.ts",
|
|
3497
3584
|
"../typings/index.d.ts"
|
|
3498
3585
|
],
|
|
3499
3586
|
"../src/components/date-input/index.ts": [
|
|
@@ -3502,20 +3589,20 @@
|
|
|
3502
3589
|
],
|
|
3503
3590
|
"../src/components/date-input/validate-date.js": [
|
|
3504
3591
|
"../node_modules/@types/angular/index.d.ts",
|
|
3505
|
-
"../node_modules/
|
|
3592
|
+
"../node_modules/@types/luxon/index.d.ts"
|
|
3506
3593
|
],
|
|
3507
3594
|
"../src/components/date-time-zone-picker/date-time-zone-factory.ts": [
|
|
3508
3595
|
"../node_modules/@types/angular/index.d.ts",
|
|
3509
3596
|
"../node_modules/@types/lodash/index.d.ts",
|
|
3510
|
-
"../node_modules/
|
|
3597
|
+
"../node_modules/@types/luxon/index.d.ts"
|
|
3511
3598
|
],
|
|
3512
3599
|
"../src/components/date-time-zone-picker/date-time-zone-picker.ts": [
|
|
3513
3600
|
"../node_modules/@types/angular/index.d.ts",
|
|
3514
|
-
"../node_modules/
|
|
3601
|
+
"../node_modules/@types/luxon/index.d.ts"
|
|
3515
3602
|
],
|
|
3516
3603
|
"../src/components/date-time-zone-picker/datepicker.ts": [
|
|
3517
3604
|
"../node_modules/@types/angular/index.d.ts",
|
|
3518
|
-
"../node_modules/
|
|
3605
|
+
"../node_modules/@types/luxon/index.d.ts",
|
|
3519
3606
|
"../src/components/form-validation-utils/form-validation-utils.ts",
|
|
3520
3607
|
"../src/components/translate/translate-factory.ts"
|
|
3521
3608
|
],
|
|
@@ -3530,7 +3617,7 @@
|
|
|
3530
3617
|
"../src/components/date-time-zone-picker/time-format-filter.ts": [
|
|
3531
3618
|
"../node_modules/@types/angular/index.d.ts",
|
|
3532
3619
|
"../node_modules/@types/lodash/index.d.ts",
|
|
3533
|
-
"../node_modules/
|
|
3620
|
+
"../node_modules/@types/luxon/index.d.ts"
|
|
3534
3621
|
],
|
|
3535
3622
|
"../src/components/date-time-zone-picker/time-zone-picker.js": [
|
|
3536
3623
|
"../node_modules/@types/angular/index.d.ts",
|
|
@@ -3538,7 +3625,7 @@
|
|
|
3538
3625
|
],
|
|
3539
3626
|
"../src/components/date-time-zone-picker/timepicker.js": [
|
|
3540
3627
|
"../node_modules/@types/angular/index.d.ts",
|
|
3541
|
-
"../node_modules/
|
|
3628
|
+
"../node_modules/@types/luxon/index.d.ts",
|
|
3542
3629
|
"../typings/index.d.ts"
|
|
3543
3630
|
],
|
|
3544
3631
|
"../src/components/decorators/index.ts": [
|
|
@@ -3968,12 +4055,12 @@
|
|
|
3968
4055
|
],
|
|
3969
4056
|
"../src/components/time-input/time-input.js": [
|
|
3970
4057
|
"../node_modules/@types/angular/index.d.ts",
|
|
3971
|
-
"../node_modules/
|
|
4058
|
+
"../node_modules/@types/luxon/index.d.ts",
|
|
3972
4059
|
"../typings/index.d.ts"
|
|
3973
4060
|
],
|
|
3974
4061
|
"../src/components/time-input/validate-time.js": [
|
|
3975
4062
|
"../node_modules/@types/angular/index.d.ts",
|
|
3976
|
-
"../node_modules/
|
|
4063
|
+
"../node_modules/@types/luxon/index.d.ts"
|
|
3977
4064
|
],
|
|
3978
4065
|
"../src/components/translate/index.ts": [
|
|
3979
4066
|
"../src/components/translate/translate-factory.ts"
|
|
@@ -4376,6 +4463,48 @@
|
|
|
4376
4463
|
"../node_modules/@types/lodash/common/string.d.ts",
|
|
4377
4464
|
"../node_modules/@types/lodash/common/util.d.ts"
|
|
4378
4465
|
],
|
|
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
|
+
],
|
|
4379
4508
|
"../node_modules/@types/mdast/index.d.ts": [
|
|
4380
4509
|
"../node_modules/@types/unist/index.d.ts"
|
|
4381
4510
|
],
|
|
@@ -5681,6 +5810,16 @@
|
|
|
5681
5810
|
"../node_modules/@types/lodash/common/string.d.ts",
|
|
5682
5811
|
"../node_modules/@types/lodash/common/util.d.ts",
|
|
5683
5812
|
"../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",
|
|
5684
5823
|
"../node_modules/@types/mdast/index.d.ts",
|
|
5685
5824
|
"../node_modules/@types/mime/index.d.ts",
|
|
5686
5825
|
"../node_modules/@types/minimatch/index.d.ts",
|
|
@@ -5836,7 +5975,6 @@
|
|
|
5836
5975
|
"../node_modules/fast-glob/out/managers/tasks.d.ts",
|
|
5837
5976
|
"../node_modules/fast-glob/out/settings.d.ts",
|
|
5838
5977
|
"../node_modules/fast-glob/out/types/index.d.ts",
|
|
5839
|
-
"../node_modules/moment/ts3.1-typings/moment.d.ts",
|
|
5840
5978
|
"../node_modules/parchment/dist/parchment.d.ts",
|
|
5841
5979
|
"../node_modules/quill-delta/dist/attributemap.d.ts",
|
|
5842
5980
|
"../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.4.
|
|
3
|
+
"version": "51.4.1",
|
|
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
|
+
"luxon": "3.4.4",
|
|
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/luxon": "3.3.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": "4.0.2",
|
|
71
71
|
"karma-junit-reporter": "2.0.1",
|
|
72
72
|
"karma-mocha-reporter": "2.2.3",
|
|
73
73
|
"karma-webpack": "5.0.0",
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import angular from 'angular'
|
|
2
|
+
const { DateTime } = require('luxon')
|
|
2
3
|
|
|
3
4
|
angular.module('app')
|
|
4
5
|
.constant('_', require('lodash'))
|
|
5
|
-
.constant('$
|
|
6
|
+
.constant('$luxon', DateTime)
|
|
6
7
|
.constant('Pikaday', require('pikaday'))
|
|
7
8
|
.constant('PREFIX', '/components/');
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import angular from 'angular'
|
|
2
2
|
import template from './date-input.html'
|
|
3
|
-
|
|
3
|
+
const { DateTime } = require('luxon')
|
|
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 DateTime.fromJSDate(nativeDate).toFormat('dd-MMM-yyyy')
|
|
40
40
|
})
|
|
41
41
|
|
|
42
42
|
// Display the date string in the UI.
|
|
@@ -56,7 +56,14 @@ angular.module('app').directive('mflyDateInput', ['translateFactory', function m
|
|
|
56
56
|
return null
|
|
57
57
|
}
|
|
58
58
|
|
|
59
|
-
|
|
59
|
+
// Try parsing with each valid format
|
|
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();
|
|
60
67
|
$scope.onChange({ value: jsDate })
|
|
61
68
|
return jsDate
|
|
62
69
|
})
|
|
@@ -67,7 +74,12 @@ angular.module('app').directive('mflyDateInput', ['translateFactory', function m
|
|
|
67
74
|
|
|
68
75
|
if (pikaday) {
|
|
69
76
|
// We can't rely on native Date() parsing here (JSUI-185).
|
|
70
|
-
|
|
77
|
+
let parsedDate;
|
|
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
|
|
71
83
|
}
|
|
72
84
|
|
|
73
85
|
ngModelCtrl.$setViewValue(newValue)
|
|
@@ -86,7 +98,7 @@ angular.module('app').directive('mflyDateInput', ['translateFactory', function m
|
|
|
86
98
|
// the scope property with a valid-formatted date string.
|
|
87
99
|
onSelect: function (newDate) {
|
|
88
100
|
$scope.$apply(function () {
|
|
89
|
-
$scope.date =
|
|
101
|
+
$scope.date = DateTime.fromJSDate(newDate).toFormat('dd-MMM-yyyy')
|
|
90
102
|
})
|
|
91
103
|
},
|
|
92
104
|
// We can make the input field disabled, but we need further measures
|
|
@@ -104,7 +116,14 @@ angular.module('app').directive('mflyDateInput', ['translateFactory', function m
|
|
|
104
116
|
// object which we initialize from the scope's model date, but ngModel
|
|
105
117
|
// doesn't fill that value in until the digest cycle has stabilized.
|
|
106
118
|
setTimeout(function () {
|
|
107
|
-
|
|
119
|
+
if ($scope.date) {
|
|
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
|
+
}
|
|
108
127
|
pikaday = new Pikaday(pikadayOptions)
|
|
109
128
|
}, 0)
|
|
110
129
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import angular from 'angular'
|
|
2
|
-
|
|
2
|
+
const { DateTime } = require('luxon')
|
|
3
3
|
|
|
4
4
|
angular.module('app').directive('mflyValidateDate', function mflyValidateDate () {
|
|
5
5
|
|
|
@@ -7,21 +7,25 @@ angular.module('app').directive('mflyValidateDate', function mflyValidateDate ()
|
|
|
7
7
|
|
|
8
8
|
$ctrl.$validators.dateFormat = function (modelValue, viewValue) {
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
10
|
+
var validDateFormats = [
|
|
11
|
+
'd-MMM-yyyy', 'd/MMM/yyyy',
|
|
12
|
+
'dd-MMM-yyyy', 'dd/MMM/yyyy',
|
|
13
|
+
'MM-dd-yyyy', 'MM/dd/yyyy',
|
|
14
|
+
'M-d-yyyy', 'M/d/yyyy',
|
|
15
|
+
'MM-dd-yy', 'MM/dd/yy',
|
|
16
|
+
'M-d-yy', 'M/d/yy'
|
|
17
|
+
];
|
|
18
18
|
|
|
19
19
|
// Empty models shouldn't be "invalid" - that's covered by "required".
|
|
20
20
|
if (viewValue === '') {
|
|
21
21
|
return true;
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
-
|
|
24
|
+
// Check if the date is valid according to any of the given formats
|
|
25
|
+
return validDateFormats.some(format => {
|
|
26
|
+
const parsed = DateTime.fromFormat(viewValue, format)
|
|
27
|
+
return parsed.isValid
|
|
28
|
+
})
|
|
25
29
|
};
|
|
26
30
|
}
|
|
27
31
|
|