@luftborn/custom-elements 2.7.0 → 2.8.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/demo/index.js +2822 -123
- package/demo/index.min.js +2821 -122
- package/demo/index.min.js.map +1 -1
- package/dist/elements/CustomFormatDateFieldElement/CustomFormatDateFieldElement.d.ts +4 -4
- package/dist/elements/CustomFormatDateFieldElement/CustomFormatDateFieldElement.js +29 -51
- package/dist/elements/CustomFormatDateFieldElement/CustomFormatDateFieldElement.js.map +1 -1
- package/package.json +6 -2
- package/src/elements/CustomFormatDateFieldElement/CustomFormatDateFieldElement.ts +43 -67
package/demo/index.min.js
CHANGED
|
@@ -11,7 +11,7 @@ document.onreadystatechange = function () {
|
|
|
11
11
|
}
|
|
12
12
|
};
|
|
13
13
|
|
|
14
|
-
},{"./../src/index":
|
|
14
|
+
},{"./../src/index":74}],2:[function(require,module,exports){
|
|
15
15
|
/**
|
|
16
16
|
@license @nocompile
|
|
17
17
|
Copyright (c) 2018 The Polymer Project Authors. All rights reserved.
|
|
@@ -403,7 +403,7 @@ var hj=window.customElements,ij=!1,jj=null;hj.polyfillWrapFlushCallback&&hj.poly
|
|
|
403
403
|
|
|
404
404
|
}).call(this)}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {},require("timers").setImmediate)
|
|
405
405
|
|
|
406
|
-
},{"timers":
|
|
406
|
+
},{"timers":9}],4:[function(require,module,exports){
|
|
407
407
|
/**
|
|
408
408
|
* @license
|
|
409
409
|
* Copyright (c) 2018 The Polymer Project Authors. All rights reserved.
|
|
@@ -612,6 +612,2727 @@ var hj=window.customElements,ij=!1,jj=null;hj.polyfillWrapFlushCallback&&hj.poly
|
|
|
612
612
|
})();
|
|
613
613
|
|
|
614
614
|
},{}],5:[function(require,module,exports){
|
|
615
|
+
/* flatpickr v4.6.13, @license MIT */
|
|
616
|
+
(function (global, factory) {
|
|
617
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
|
|
618
|
+
typeof define === 'function' && define.amd ? define(factory) :
|
|
619
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.flatpickr = factory());
|
|
620
|
+
}(this, (function () { 'use strict';
|
|
621
|
+
|
|
622
|
+
/*! *****************************************************************************
|
|
623
|
+
Copyright (c) Microsoft Corporation.
|
|
624
|
+
|
|
625
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
626
|
+
purpose with or without fee is hereby granted.
|
|
627
|
+
|
|
628
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
629
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
630
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
631
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
632
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
633
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
634
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
635
|
+
***************************************************************************** */
|
|
636
|
+
|
|
637
|
+
var __assign = function() {
|
|
638
|
+
__assign = Object.assign || function __assign(t) {
|
|
639
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
640
|
+
s = arguments[i];
|
|
641
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
642
|
+
}
|
|
643
|
+
return t;
|
|
644
|
+
};
|
|
645
|
+
return __assign.apply(this, arguments);
|
|
646
|
+
};
|
|
647
|
+
|
|
648
|
+
function __spreadArrays() {
|
|
649
|
+
for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
|
|
650
|
+
for (var r = Array(s), k = 0, i = 0; i < il; i++)
|
|
651
|
+
for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
|
|
652
|
+
r[k] = a[j];
|
|
653
|
+
return r;
|
|
654
|
+
}
|
|
655
|
+
|
|
656
|
+
var HOOKS = [
|
|
657
|
+
"onChange",
|
|
658
|
+
"onClose",
|
|
659
|
+
"onDayCreate",
|
|
660
|
+
"onDestroy",
|
|
661
|
+
"onKeyDown",
|
|
662
|
+
"onMonthChange",
|
|
663
|
+
"onOpen",
|
|
664
|
+
"onParseConfig",
|
|
665
|
+
"onReady",
|
|
666
|
+
"onValueUpdate",
|
|
667
|
+
"onYearChange",
|
|
668
|
+
"onPreCalendarPosition",
|
|
669
|
+
];
|
|
670
|
+
var defaults = {
|
|
671
|
+
_disable: [],
|
|
672
|
+
allowInput: false,
|
|
673
|
+
allowInvalidPreload: false,
|
|
674
|
+
altFormat: "F j, Y",
|
|
675
|
+
altInput: false,
|
|
676
|
+
altInputClass: "form-control input",
|
|
677
|
+
animate: typeof window === "object" &&
|
|
678
|
+
window.navigator.userAgent.indexOf("MSIE") === -1,
|
|
679
|
+
ariaDateFormat: "F j, Y",
|
|
680
|
+
autoFillDefaultTime: true,
|
|
681
|
+
clickOpens: true,
|
|
682
|
+
closeOnSelect: true,
|
|
683
|
+
conjunction: ", ",
|
|
684
|
+
dateFormat: "Y-m-d",
|
|
685
|
+
defaultHour: 12,
|
|
686
|
+
defaultMinute: 0,
|
|
687
|
+
defaultSeconds: 0,
|
|
688
|
+
disable: [],
|
|
689
|
+
disableMobile: false,
|
|
690
|
+
enableSeconds: false,
|
|
691
|
+
enableTime: false,
|
|
692
|
+
errorHandler: function (err) {
|
|
693
|
+
return typeof console !== "undefined" && console.warn(err);
|
|
694
|
+
},
|
|
695
|
+
getWeek: function (givenDate) {
|
|
696
|
+
var date = new Date(givenDate.getTime());
|
|
697
|
+
date.setHours(0, 0, 0, 0);
|
|
698
|
+
// Thursday in current week decides the year.
|
|
699
|
+
date.setDate(date.getDate() + 3 - ((date.getDay() + 6) % 7));
|
|
700
|
+
// January 4 is always in week 1.
|
|
701
|
+
var week1 = new Date(date.getFullYear(), 0, 4);
|
|
702
|
+
// Adjust to Thursday in week 1 and count number of weeks from date to week1.
|
|
703
|
+
return (1 +
|
|
704
|
+
Math.round(((date.getTime() - week1.getTime()) / 86400000 -
|
|
705
|
+
3 +
|
|
706
|
+
((week1.getDay() + 6) % 7)) /
|
|
707
|
+
7));
|
|
708
|
+
},
|
|
709
|
+
hourIncrement: 1,
|
|
710
|
+
ignoredFocusElements: [],
|
|
711
|
+
inline: false,
|
|
712
|
+
locale: "default",
|
|
713
|
+
minuteIncrement: 5,
|
|
714
|
+
mode: "single",
|
|
715
|
+
monthSelectorType: "dropdown",
|
|
716
|
+
nextArrow: "<svg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' viewBox='0 0 17 17'><g></g><path d='M13.207 8.472l-7.854 7.854-0.707-0.707 7.146-7.146-7.146-7.148 0.707-0.707 7.854 7.854z' /></svg>",
|
|
717
|
+
noCalendar: false,
|
|
718
|
+
now: new Date(),
|
|
719
|
+
onChange: [],
|
|
720
|
+
onClose: [],
|
|
721
|
+
onDayCreate: [],
|
|
722
|
+
onDestroy: [],
|
|
723
|
+
onKeyDown: [],
|
|
724
|
+
onMonthChange: [],
|
|
725
|
+
onOpen: [],
|
|
726
|
+
onParseConfig: [],
|
|
727
|
+
onReady: [],
|
|
728
|
+
onValueUpdate: [],
|
|
729
|
+
onYearChange: [],
|
|
730
|
+
onPreCalendarPosition: [],
|
|
731
|
+
plugins: [],
|
|
732
|
+
position: "auto",
|
|
733
|
+
positionElement: undefined,
|
|
734
|
+
prevArrow: "<svg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' viewBox='0 0 17 17'><g></g><path d='M5.207 8.471l7.146 7.147-0.707 0.707-7.853-7.854 7.854-7.853 0.707 0.707-7.147 7.146z' /></svg>",
|
|
735
|
+
shorthandCurrentMonth: false,
|
|
736
|
+
showMonths: 1,
|
|
737
|
+
static: false,
|
|
738
|
+
time_24hr: false,
|
|
739
|
+
weekNumbers: false,
|
|
740
|
+
wrap: false,
|
|
741
|
+
};
|
|
742
|
+
|
|
743
|
+
var english = {
|
|
744
|
+
weekdays: {
|
|
745
|
+
shorthand: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
|
|
746
|
+
longhand: [
|
|
747
|
+
"Sunday",
|
|
748
|
+
"Monday",
|
|
749
|
+
"Tuesday",
|
|
750
|
+
"Wednesday",
|
|
751
|
+
"Thursday",
|
|
752
|
+
"Friday",
|
|
753
|
+
"Saturday",
|
|
754
|
+
],
|
|
755
|
+
},
|
|
756
|
+
months: {
|
|
757
|
+
shorthand: [
|
|
758
|
+
"Jan",
|
|
759
|
+
"Feb",
|
|
760
|
+
"Mar",
|
|
761
|
+
"Apr",
|
|
762
|
+
"May",
|
|
763
|
+
"Jun",
|
|
764
|
+
"Jul",
|
|
765
|
+
"Aug",
|
|
766
|
+
"Sep",
|
|
767
|
+
"Oct",
|
|
768
|
+
"Nov",
|
|
769
|
+
"Dec",
|
|
770
|
+
],
|
|
771
|
+
longhand: [
|
|
772
|
+
"January",
|
|
773
|
+
"February",
|
|
774
|
+
"March",
|
|
775
|
+
"April",
|
|
776
|
+
"May",
|
|
777
|
+
"June",
|
|
778
|
+
"July",
|
|
779
|
+
"August",
|
|
780
|
+
"September",
|
|
781
|
+
"October",
|
|
782
|
+
"November",
|
|
783
|
+
"December",
|
|
784
|
+
],
|
|
785
|
+
},
|
|
786
|
+
daysInMonth: [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31],
|
|
787
|
+
firstDayOfWeek: 0,
|
|
788
|
+
ordinal: function (nth) {
|
|
789
|
+
var s = nth % 100;
|
|
790
|
+
if (s > 3 && s < 21)
|
|
791
|
+
return "th";
|
|
792
|
+
switch (s % 10) {
|
|
793
|
+
case 1:
|
|
794
|
+
return "st";
|
|
795
|
+
case 2:
|
|
796
|
+
return "nd";
|
|
797
|
+
case 3:
|
|
798
|
+
return "rd";
|
|
799
|
+
default:
|
|
800
|
+
return "th";
|
|
801
|
+
}
|
|
802
|
+
},
|
|
803
|
+
rangeSeparator: " to ",
|
|
804
|
+
weekAbbreviation: "Wk",
|
|
805
|
+
scrollTitle: "Scroll to increment",
|
|
806
|
+
toggleTitle: "Click to toggle",
|
|
807
|
+
amPM: ["AM", "PM"],
|
|
808
|
+
yearAriaLabel: "Year",
|
|
809
|
+
monthAriaLabel: "Month",
|
|
810
|
+
hourAriaLabel: "Hour",
|
|
811
|
+
minuteAriaLabel: "Minute",
|
|
812
|
+
time_24hr: false,
|
|
813
|
+
};
|
|
814
|
+
|
|
815
|
+
var pad = function (number, length) {
|
|
816
|
+
if (length === void 0) { length = 2; }
|
|
817
|
+
return ("000" + number).slice(length * -1);
|
|
818
|
+
};
|
|
819
|
+
var int = function (bool) { return (bool === true ? 1 : 0); };
|
|
820
|
+
/* istanbul ignore next */
|
|
821
|
+
function debounce(fn, wait) {
|
|
822
|
+
var t;
|
|
823
|
+
return function () {
|
|
824
|
+
var _this = this;
|
|
825
|
+
var args = arguments;
|
|
826
|
+
clearTimeout(t);
|
|
827
|
+
t = setTimeout(function () { return fn.apply(_this, args); }, wait);
|
|
828
|
+
};
|
|
829
|
+
}
|
|
830
|
+
var arrayify = function (obj) {
|
|
831
|
+
return obj instanceof Array ? obj : [obj];
|
|
832
|
+
};
|
|
833
|
+
|
|
834
|
+
function toggleClass(elem, className, bool) {
|
|
835
|
+
if (bool === true)
|
|
836
|
+
return elem.classList.add(className);
|
|
837
|
+
elem.classList.remove(className);
|
|
838
|
+
}
|
|
839
|
+
function createElement(tag, className, content) {
|
|
840
|
+
var e = window.document.createElement(tag);
|
|
841
|
+
className = className || "";
|
|
842
|
+
content = content || "";
|
|
843
|
+
e.className = className;
|
|
844
|
+
if (content !== undefined)
|
|
845
|
+
e.textContent = content;
|
|
846
|
+
return e;
|
|
847
|
+
}
|
|
848
|
+
function clearNode(node) {
|
|
849
|
+
while (node.firstChild)
|
|
850
|
+
node.removeChild(node.firstChild);
|
|
851
|
+
}
|
|
852
|
+
function findParent(node, condition) {
|
|
853
|
+
if (condition(node))
|
|
854
|
+
return node;
|
|
855
|
+
else if (node.parentNode)
|
|
856
|
+
return findParent(node.parentNode, condition);
|
|
857
|
+
return undefined; // nothing found
|
|
858
|
+
}
|
|
859
|
+
function createNumberInput(inputClassName, opts) {
|
|
860
|
+
var wrapper = createElement("div", "numInputWrapper"), numInput = createElement("input", "numInput " + inputClassName), arrowUp = createElement("span", "arrowUp"), arrowDown = createElement("span", "arrowDown");
|
|
861
|
+
if (navigator.userAgent.indexOf("MSIE 9.0") === -1) {
|
|
862
|
+
numInput.type = "number";
|
|
863
|
+
}
|
|
864
|
+
else {
|
|
865
|
+
numInput.type = "text";
|
|
866
|
+
numInput.pattern = "\\d*";
|
|
867
|
+
}
|
|
868
|
+
if (opts !== undefined)
|
|
869
|
+
for (var key in opts)
|
|
870
|
+
numInput.setAttribute(key, opts[key]);
|
|
871
|
+
wrapper.appendChild(numInput);
|
|
872
|
+
wrapper.appendChild(arrowUp);
|
|
873
|
+
wrapper.appendChild(arrowDown);
|
|
874
|
+
return wrapper;
|
|
875
|
+
}
|
|
876
|
+
function getEventTarget(event) {
|
|
877
|
+
try {
|
|
878
|
+
if (typeof event.composedPath === "function") {
|
|
879
|
+
var path = event.composedPath();
|
|
880
|
+
return path[0];
|
|
881
|
+
}
|
|
882
|
+
return event.target;
|
|
883
|
+
}
|
|
884
|
+
catch (error) {
|
|
885
|
+
return event.target;
|
|
886
|
+
}
|
|
887
|
+
}
|
|
888
|
+
|
|
889
|
+
var doNothing = function () { return undefined; };
|
|
890
|
+
var monthToStr = function (monthNumber, shorthand, locale) { return locale.months[shorthand ? "shorthand" : "longhand"][monthNumber]; };
|
|
891
|
+
var revFormat = {
|
|
892
|
+
D: doNothing,
|
|
893
|
+
F: function (dateObj, monthName, locale) {
|
|
894
|
+
dateObj.setMonth(locale.months.longhand.indexOf(monthName));
|
|
895
|
+
},
|
|
896
|
+
G: function (dateObj, hour) {
|
|
897
|
+
dateObj.setHours((dateObj.getHours() >= 12 ? 12 : 0) + parseFloat(hour));
|
|
898
|
+
},
|
|
899
|
+
H: function (dateObj, hour) {
|
|
900
|
+
dateObj.setHours(parseFloat(hour));
|
|
901
|
+
},
|
|
902
|
+
J: function (dateObj, day) {
|
|
903
|
+
dateObj.setDate(parseFloat(day));
|
|
904
|
+
},
|
|
905
|
+
K: function (dateObj, amPM, locale) {
|
|
906
|
+
dateObj.setHours((dateObj.getHours() % 12) +
|
|
907
|
+
12 * int(new RegExp(locale.amPM[1], "i").test(amPM)));
|
|
908
|
+
},
|
|
909
|
+
M: function (dateObj, shortMonth, locale) {
|
|
910
|
+
dateObj.setMonth(locale.months.shorthand.indexOf(shortMonth));
|
|
911
|
+
},
|
|
912
|
+
S: function (dateObj, seconds) {
|
|
913
|
+
dateObj.setSeconds(parseFloat(seconds));
|
|
914
|
+
},
|
|
915
|
+
U: function (_, unixSeconds) { return new Date(parseFloat(unixSeconds) * 1000); },
|
|
916
|
+
W: function (dateObj, weekNum, locale) {
|
|
917
|
+
var weekNumber = parseInt(weekNum);
|
|
918
|
+
var date = new Date(dateObj.getFullYear(), 0, 2 + (weekNumber - 1) * 7, 0, 0, 0, 0);
|
|
919
|
+
date.setDate(date.getDate() - date.getDay() + locale.firstDayOfWeek);
|
|
920
|
+
return date;
|
|
921
|
+
},
|
|
922
|
+
Y: function (dateObj, year) {
|
|
923
|
+
dateObj.setFullYear(parseFloat(year));
|
|
924
|
+
},
|
|
925
|
+
Z: function (_, ISODate) { return new Date(ISODate); },
|
|
926
|
+
d: function (dateObj, day) {
|
|
927
|
+
dateObj.setDate(parseFloat(day));
|
|
928
|
+
},
|
|
929
|
+
h: function (dateObj, hour) {
|
|
930
|
+
dateObj.setHours((dateObj.getHours() >= 12 ? 12 : 0) + parseFloat(hour));
|
|
931
|
+
},
|
|
932
|
+
i: function (dateObj, minutes) {
|
|
933
|
+
dateObj.setMinutes(parseFloat(minutes));
|
|
934
|
+
},
|
|
935
|
+
j: function (dateObj, day) {
|
|
936
|
+
dateObj.setDate(parseFloat(day));
|
|
937
|
+
},
|
|
938
|
+
l: doNothing,
|
|
939
|
+
m: function (dateObj, month) {
|
|
940
|
+
dateObj.setMonth(parseFloat(month) - 1);
|
|
941
|
+
},
|
|
942
|
+
n: function (dateObj, month) {
|
|
943
|
+
dateObj.setMonth(parseFloat(month) - 1);
|
|
944
|
+
},
|
|
945
|
+
s: function (dateObj, seconds) {
|
|
946
|
+
dateObj.setSeconds(parseFloat(seconds));
|
|
947
|
+
},
|
|
948
|
+
u: function (_, unixMillSeconds) {
|
|
949
|
+
return new Date(parseFloat(unixMillSeconds));
|
|
950
|
+
},
|
|
951
|
+
w: doNothing,
|
|
952
|
+
y: function (dateObj, year) {
|
|
953
|
+
dateObj.setFullYear(2000 + parseFloat(year));
|
|
954
|
+
},
|
|
955
|
+
};
|
|
956
|
+
var tokenRegex = {
|
|
957
|
+
D: "",
|
|
958
|
+
F: "",
|
|
959
|
+
G: "(\\d\\d|\\d)",
|
|
960
|
+
H: "(\\d\\d|\\d)",
|
|
961
|
+
J: "(\\d\\d|\\d)\\w+",
|
|
962
|
+
K: "",
|
|
963
|
+
M: "",
|
|
964
|
+
S: "(\\d\\d|\\d)",
|
|
965
|
+
U: "(.+)",
|
|
966
|
+
W: "(\\d\\d|\\d)",
|
|
967
|
+
Y: "(\\d{4})",
|
|
968
|
+
Z: "(.+)",
|
|
969
|
+
d: "(\\d\\d|\\d)",
|
|
970
|
+
h: "(\\d\\d|\\d)",
|
|
971
|
+
i: "(\\d\\d|\\d)",
|
|
972
|
+
j: "(\\d\\d|\\d)",
|
|
973
|
+
l: "",
|
|
974
|
+
m: "(\\d\\d|\\d)",
|
|
975
|
+
n: "(\\d\\d|\\d)",
|
|
976
|
+
s: "(\\d\\d|\\d)",
|
|
977
|
+
u: "(.+)",
|
|
978
|
+
w: "(\\d\\d|\\d)",
|
|
979
|
+
y: "(\\d{2})",
|
|
980
|
+
};
|
|
981
|
+
var formats = {
|
|
982
|
+
// get the date in UTC
|
|
983
|
+
Z: function (date) { return date.toISOString(); },
|
|
984
|
+
// weekday name, short, e.g. Thu
|
|
985
|
+
D: function (date, locale, options) {
|
|
986
|
+
return locale.weekdays.shorthand[formats.w(date, locale, options)];
|
|
987
|
+
},
|
|
988
|
+
// full month name e.g. January
|
|
989
|
+
F: function (date, locale, options) {
|
|
990
|
+
return monthToStr(formats.n(date, locale, options) - 1, false, locale);
|
|
991
|
+
},
|
|
992
|
+
// padded hour 1-12
|
|
993
|
+
G: function (date, locale, options) {
|
|
994
|
+
return pad(formats.h(date, locale, options));
|
|
995
|
+
},
|
|
996
|
+
// hours with leading zero e.g. 03
|
|
997
|
+
H: function (date) { return pad(date.getHours()); },
|
|
998
|
+
// day (1-30) with ordinal suffix e.g. 1st, 2nd
|
|
999
|
+
J: function (date, locale) {
|
|
1000
|
+
return locale.ordinal !== undefined
|
|
1001
|
+
? date.getDate() + locale.ordinal(date.getDate())
|
|
1002
|
+
: date.getDate();
|
|
1003
|
+
},
|
|
1004
|
+
// AM/PM
|
|
1005
|
+
K: function (date, locale) { return locale.amPM[int(date.getHours() > 11)]; },
|
|
1006
|
+
// shorthand month e.g. Jan, Sep, Oct, etc
|
|
1007
|
+
M: function (date, locale) {
|
|
1008
|
+
return monthToStr(date.getMonth(), true, locale);
|
|
1009
|
+
},
|
|
1010
|
+
// seconds 00-59
|
|
1011
|
+
S: function (date) { return pad(date.getSeconds()); },
|
|
1012
|
+
// unix timestamp
|
|
1013
|
+
U: function (date) { return date.getTime() / 1000; },
|
|
1014
|
+
W: function (date, _, options) {
|
|
1015
|
+
return options.getWeek(date);
|
|
1016
|
+
},
|
|
1017
|
+
// full year e.g. 2016, padded (0001-9999)
|
|
1018
|
+
Y: function (date) { return pad(date.getFullYear(), 4); },
|
|
1019
|
+
// day in month, padded (01-30)
|
|
1020
|
+
d: function (date) { return pad(date.getDate()); },
|
|
1021
|
+
// hour from 1-12 (am/pm)
|
|
1022
|
+
h: function (date) { return (date.getHours() % 12 ? date.getHours() % 12 : 12); },
|
|
1023
|
+
// minutes, padded with leading zero e.g. 09
|
|
1024
|
+
i: function (date) { return pad(date.getMinutes()); },
|
|
1025
|
+
// day in month (1-30)
|
|
1026
|
+
j: function (date) { return date.getDate(); },
|
|
1027
|
+
// weekday name, full, e.g. Thursday
|
|
1028
|
+
l: function (date, locale) {
|
|
1029
|
+
return locale.weekdays.longhand[date.getDay()];
|
|
1030
|
+
},
|
|
1031
|
+
// padded month number (01-12)
|
|
1032
|
+
m: function (date) { return pad(date.getMonth() + 1); },
|
|
1033
|
+
// the month number (1-12)
|
|
1034
|
+
n: function (date) { return date.getMonth() + 1; },
|
|
1035
|
+
// seconds 0-59
|
|
1036
|
+
s: function (date) { return date.getSeconds(); },
|
|
1037
|
+
// Unix Milliseconds
|
|
1038
|
+
u: function (date) { return date.getTime(); },
|
|
1039
|
+
// number of the day of the week
|
|
1040
|
+
w: function (date) { return date.getDay(); },
|
|
1041
|
+
// last two digits of year e.g. 16 for 2016
|
|
1042
|
+
y: function (date) { return String(date.getFullYear()).substring(2); },
|
|
1043
|
+
};
|
|
1044
|
+
|
|
1045
|
+
var createDateFormatter = function (_a) {
|
|
1046
|
+
var _b = _a.config, config = _b === void 0 ? defaults : _b, _c = _a.l10n, l10n = _c === void 0 ? english : _c, _d = _a.isMobile, isMobile = _d === void 0 ? false : _d;
|
|
1047
|
+
return function (dateObj, frmt, overrideLocale) {
|
|
1048
|
+
var locale = overrideLocale || l10n;
|
|
1049
|
+
if (config.formatDate !== undefined && !isMobile) {
|
|
1050
|
+
return config.formatDate(dateObj, frmt, locale);
|
|
1051
|
+
}
|
|
1052
|
+
return frmt
|
|
1053
|
+
.split("")
|
|
1054
|
+
.map(function (c, i, arr) {
|
|
1055
|
+
return formats[c] && arr[i - 1] !== "\\"
|
|
1056
|
+
? formats[c](dateObj, locale, config)
|
|
1057
|
+
: c !== "\\"
|
|
1058
|
+
? c
|
|
1059
|
+
: "";
|
|
1060
|
+
})
|
|
1061
|
+
.join("");
|
|
1062
|
+
};
|
|
1063
|
+
};
|
|
1064
|
+
var createDateParser = function (_a) {
|
|
1065
|
+
var _b = _a.config, config = _b === void 0 ? defaults : _b, _c = _a.l10n, l10n = _c === void 0 ? english : _c;
|
|
1066
|
+
return function (date, givenFormat, timeless, customLocale) {
|
|
1067
|
+
if (date !== 0 && !date)
|
|
1068
|
+
return undefined;
|
|
1069
|
+
var locale = customLocale || l10n;
|
|
1070
|
+
var parsedDate;
|
|
1071
|
+
var dateOrig = date;
|
|
1072
|
+
if (date instanceof Date)
|
|
1073
|
+
parsedDate = new Date(date.getTime());
|
|
1074
|
+
else if (typeof date !== "string" &&
|
|
1075
|
+
date.toFixed !== undefined // timestamp
|
|
1076
|
+
)
|
|
1077
|
+
// create a copy
|
|
1078
|
+
parsedDate = new Date(date);
|
|
1079
|
+
else if (typeof date === "string") {
|
|
1080
|
+
// date string
|
|
1081
|
+
var format = givenFormat || (config || defaults).dateFormat;
|
|
1082
|
+
var datestr = String(date).trim();
|
|
1083
|
+
if (datestr === "today") {
|
|
1084
|
+
parsedDate = new Date();
|
|
1085
|
+
timeless = true;
|
|
1086
|
+
}
|
|
1087
|
+
else if (config && config.parseDate) {
|
|
1088
|
+
parsedDate = config.parseDate(date, format);
|
|
1089
|
+
}
|
|
1090
|
+
else if (/Z$/.test(datestr) ||
|
|
1091
|
+
/GMT$/.test(datestr) // datestrings w/ timezone
|
|
1092
|
+
) {
|
|
1093
|
+
parsedDate = new Date(date);
|
|
1094
|
+
}
|
|
1095
|
+
else {
|
|
1096
|
+
var matched = void 0, ops = [];
|
|
1097
|
+
for (var i = 0, matchIndex = 0, regexStr = ""; i < format.length; i++) {
|
|
1098
|
+
var token_1 = format[i];
|
|
1099
|
+
var isBackSlash = token_1 === "\\";
|
|
1100
|
+
var escaped = format[i - 1] === "\\" || isBackSlash;
|
|
1101
|
+
if (tokenRegex[token_1] && !escaped) {
|
|
1102
|
+
regexStr += tokenRegex[token_1];
|
|
1103
|
+
var match = new RegExp(regexStr).exec(date);
|
|
1104
|
+
if (match && (matched = true)) {
|
|
1105
|
+
ops[token_1 !== "Y" ? "push" : "unshift"]({
|
|
1106
|
+
fn: revFormat[token_1],
|
|
1107
|
+
val: match[++matchIndex],
|
|
1108
|
+
});
|
|
1109
|
+
}
|
|
1110
|
+
}
|
|
1111
|
+
else if (!isBackSlash)
|
|
1112
|
+
regexStr += "."; // don't really care
|
|
1113
|
+
}
|
|
1114
|
+
parsedDate =
|
|
1115
|
+
!config || !config.noCalendar
|
|
1116
|
+
? new Date(new Date().getFullYear(), 0, 1, 0, 0, 0, 0)
|
|
1117
|
+
: new Date(new Date().setHours(0, 0, 0, 0));
|
|
1118
|
+
ops.forEach(function (_a) {
|
|
1119
|
+
var fn = _a.fn, val = _a.val;
|
|
1120
|
+
return (parsedDate = fn(parsedDate, val, locale) || parsedDate);
|
|
1121
|
+
});
|
|
1122
|
+
parsedDate = matched ? parsedDate : undefined;
|
|
1123
|
+
}
|
|
1124
|
+
}
|
|
1125
|
+
/* istanbul ignore next */
|
|
1126
|
+
if (!(parsedDate instanceof Date && !isNaN(parsedDate.getTime()))) {
|
|
1127
|
+
config.errorHandler(new Error("Invalid date provided: " + dateOrig));
|
|
1128
|
+
return undefined;
|
|
1129
|
+
}
|
|
1130
|
+
if (timeless === true)
|
|
1131
|
+
parsedDate.setHours(0, 0, 0, 0);
|
|
1132
|
+
return parsedDate;
|
|
1133
|
+
};
|
|
1134
|
+
};
|
|
1135
|
+
/**
|
|
1136
|
+
* Compute the difference in dates, measured in ms
|
|
1137
|
+
*/
|
|
1138
|
+
function compareDates(date1, date2, timeless) {
|
|
1139
|
+
if (timeless === void 0) { timeless = true; }
|
|
1140
|
+
if (timeless !== false) {
|
|
1141
|
+
return (new Date(date1.getTime()).setHours(0, 0, 0, 0) -
|
|
1142
|
+
new Date(date2.getTime()).setHours(0, 0, 0, 0));
|
|
1143
|
+
}
|
|
1144
|
+
return date1.getTime() - date2.getTime();
|
|
1145
|
+
}
|
|
1146
|
+
var isBetween = function (ts, ts1, ts2) {
|
|
1147
|
+
return ts > Math.min(ts1, ts2) && ts < Math.max(ts1, ts2);
|
|
1148
|
+
};
|
|
1149
|
+
var calculateSecondsSinceMidnight = function (hours, minutes, seconds) {
|
|
1150
|
+
return hours * 3600 + minutes * 60 + seconds;
|
|
1151
|
+
};
|
|
1152
|
+
var parseSeconds = function (secondsSinceMidnight) {
|
|
1153
|
+
var hours = Math.floor(secondsSinceMidnight / 3600), minutes = (secondsSinceMidnight - hours * 3600) / 60;
|
|
1154
|
+
return [hours, minutes, secondsSinceMidnight - hours * 3600 - minutes * 60];
|
|
1155
|
+
};
|
|
1156
|
+
var duration = {
|
|
1157
|
+
DAY: 86400000,
|
|
1158
|
+
};
|
|
1159
|
+
function getDefaultHours(config) {
|
|
1160
|
+
var hours = config.defaultHour;
|
|
1161
|
+
var minutes = config.defaultMinute;
|
|
1162
|
+
var seconds = config.defaultSeconds;
|
|
1163
|
+
if (config.minDate !== undefined) {
|
|
1164
|
+
var minHour = config.minDate.getHours();
|
|
1165
|
+
var minMinutes = config.minDate.getMinutes();
|
|
1166
|
+
var minSeconds = config.minDate.getSeconds();
|
|
1167
|
+
if (hours < minHour) {
|
|
1168
|
+
hours = minHour;
|
|
1169
|
+
}
|
|
1170
|
+
if (hours === minHour && minutes < minMinutes) {
|
|
1171
|
+
minutes = minMinutes;
|
|
1172
|
+
}
|
|
1173
|
+
if (hours === minHour && minutes === minMinutes && seconds < minSeconds)
|
|
1174
|
+
seconds = config.minDate.getSeconds();
|
|
1175
|
+
}
|
|
1176
|
+
if (config.maxDate !== undefined) {
|
|
1177
|
+
var maxHr = config.maxDate.getHours();
|
|
1178
|
+
var maxMinutes = config.maxDate.getMinutes();
|
|
1179
|
+
hours = Math.min(hours, maxHr);
|
|
1180
|
+
if (hours === maxHr)
|
|
1181
|
+
minutes = Math.min(maxMinutes, minutes);
|
|
1182
|
+
if (hours === maxHr && minutes === maxMinutes)
|
|
1183
|
+
seconds = config.maxDate.getSeconds();
|
|
1184
|
+
}
|
|
1185
|
+
return { hours: hours, minutes: minutes, seconds: seconds };
|
|
1186
|
+
}
|
|
1187
|
+
|
|
1188
|
+
if (typeof Object.assign !== "function") {
|
|
1189
|
+
Object.assign = function (target) {
|
|
1190
|
+
var args = [];
|
|
1191
|
+
for (var _i = 1; _i < arguments.length; _i++) {
|
|
1192
|
+
args[_i - 1] = arguments[_i];
|
|
1193
|
+
}
|
|
1194
|
+
if (!target) {
|
|
1195
|
+
throw TypeError("Cannot convert undefined or null to object");
|
|
1196
|
+
}
|
|
1197
|
+
var _loop_1 = function (source) {
|
|
1198
|
+
if (source) {
|
|
1199
|
+
Object.keys(source).forEach(function (key) { return (target[key] = source[key]); });
|
|
1200
|
+
}
|
|
1201
|
+
};
|
|
1202
|
+
for (var _a = 0, args_1 = args; _a < args_1.length; _a++) {
|
|
1203
|
+
var source = args_1[_a];
|
|
1204
|
+
_loop_1(source);
|
|
1205
|
+
}
|
|
1206
|
+
return target;
|
|
1207
|
+
};
|
|
1208
|
+
}
|
|
1209
|
+
|
|
1210
|
+
var DEBOUNCED_CHANGE_MS = 300;
|
|
1211
|
+
function FlatpickrInstance(element, instanceConfig) {
|
|
1212
|
+
var self = {
|
|
1213
|
+
config: __assign(__assign({}, defaults), flatpickr.defaultConfig),
|
|
1214
|
+
l10n: english,
|
|
1215
|
+
};
|
|
1216
|
+
self.parseDate = createDateParser({ config: self.config, l10n: self.l10n });
|
|
1217
|
+
self._handlers = [];
|
|
1218
|
+
self.pluginElements = [];
|
|
1219
|
+
self.loadedPlugins = [];
|
|
1220
|
+
self._bind = bind;
|
|
1221
|
+
self._setHoursFromDate = setHoursFromDate;
|
|
1222
|
+
self._positionCalendar = positionCalendar;
|
|
1223
|
+
self.changeMonth = changeMonth;
|
|
1224
|
+
self.changeYear = changeYear;
|
|
1225
|
+
self.clear = clear;
|
|
1226
|
+
self.close = close;
|
|
1227
|
+
self.onMouseOver = onMouseOver;
|
|
1228
|
+
self._createElement = createElement;
|
|
1229
|
+
self.createDay = createDay;
|
|
1230
|
+
self.destroy = destroy;
|
|
1231
|
+
self.isEnabled = isEnabled;
|
|
1232
|
+
self.jumpToDate = jumpToDate;
|
|
1233
|
+
self.updateValue = updateValue;
|
|
1234
|
+
self.open = open;
|
|
1235
|
+
self.redraw = redraw;
|
|
1236
|
+
self.set = set;
|
|
1237
|
+
self.setDate = setDate;
|
|
1238
|
+
self.toggle = toggle;
|
|
1239
|
+
function setupHelperFunctions() {
|
|
1240
|
+
self.utils = {
|
|
1241
|
+
getDaysInMonth: function (month, yr) {
|
|
1242
|
+
if (month === void 0) { month = self.currentMonth; }
|
|
1243
|
+
if (yr === void 0) { yr = self.currentYear; }
|
|
1244
|
+
if (month === 1 && ((yr % 4 === 0 && yr % 100 !== 0) || yr % 400 === 0))
|
|
1245
|
+
return 29;
|
|
1246
|
+
return self.l10n.daysInMonth[month];
|
|
1247
|
+
},
|
|
1248
|
+
};
|
|
1249
|
+
}
|
|
1250
|
+
function init() {
|
|
1251
|
+
self.element = self.input = element;
|
|
1252
|
+
self.isOpen = false;
|
|
1253
|
+
parseConfig();
|
|
1254
|
+
setupLocale();
|
|
1255
|
+
setupInputs();
|
|
1256
|
+
setupDates();
|
|
1257
|
+
setupHelperFunctions();
|
|
1258
|
+
if (!self.isMobile)
|
|
1259
|
+
build();
|
|
1260
|
+
bindEvents();
|
|
1261
|
+
if (self.selectedDates.length || self.config.noCalendar) {
|
|
1262
|
+
if (self.config.enableTime) {
|
|
1263
|
+
setHoursFromDate(self.config.noCalendar ? self.latestSelectedDateObj : undefined);
|
|
1264
|
+
}
|
|
1265
|
+
updateValue(false);
|
|
1266
|
+
}
|
|
1267
|
+
setCalendarWidth();
|
|
1268
|
+
var isSafari = /^((?!chrome|android).)*safari/i.test(navigator.userAgent);
|
|
1269
|
+
/* TODO: investigate this further
|
|
1270
|
+
|
|
1271
|
+
Currently, there is weird positioning behavior in safari causing pages
|
|
1272
|
+
to scroll up. https://github.com/chmln/flatpickr/issues/563
|
|
1273
|
+
|
|
1274
|
+
However, most browsers are not Safari and positioning is expensive when used
|
|
1275
|
+
in scale. https://github.com/chmln/flatpickr/issues/1096
|
|
1276
|
+
*/
|
|
1277
|
+
if (!self.isMobile && isSafari) {
|
|
1278
|
+
positionCalendar();
|
|
1279
|
+
}
|
|
1280
|
+
triggerEvent("onReady");
|
|
1281
|
+
}
|
|
1282
|
+
function getClosestActiveElement() {
|
|
1283
|
+
var _a;
|
|
1284
|
+
return (((_a = self.calendarContainer) === null || _a === void 0 ? void 0 : _a.getRootNode())
|
|
1285
|
+
.activeElement || document.activeElement);
|
|
1286
|
+
}
|
|
1287
|
+
function bindToInstance(fn) {
|
|
1288
|
+
return fn.bind(self);
|
|
1289
|
+
}
|
|
1290
|
+
function setCalendarWidth() {
|
|
1291
|
+
var config = self.config;
|
|
1292
|
+
if (config.weekNumbers === false && config.showMonths === 1) {
|
|
1293
|
+
return;
|
|
1294
|
+
}
|
|
1295
|
+
else if (config.noCalendar !== true) {
|
|
1296
|
+
window.requestAnimationFrame(function () {
|
|
1297
|
+
if (self.calendarContainer !== undefined) {
|
|
1298
|
+
self.calendarContainer.style.visibility = "hidden";
|
|
1299
|
+
self.calendarContainer.style.display = "block";
|
|
1300
|
+
}
|
|
1301
|
+
if (self.daysContainer !== undefined) {
|
|
1302
|
+
var daysWidth = (self.days.offsetWidth + 1) * config.showMonths;
|
|
1303
|
+
self.daysContainer.style.width = daysWidth + "px";
|
|
1304
|
+
self.calendarContainer.style.width =
|
|
1305
|
+
daysWidth +
|
|
1306
|
+
(self.weekWrapper !== undefined
|
|
1307
|
+
? self.weekWrapper.offsetWidth
|
|
1308
|
+
: 0) +
|
|
1309
|
+
"px";
|
|
1310
|
+
self.calendarContainer.style.removeProperty("visibility");
|
|
1311
|
+
self.calendarContainer.style.removeProperty("display");
|
|
1312
|
+
}
|
|
1313
|
+
});
|
|
1314
|
+
}
|
|
1315
|
+
}
|
|
1316
|
+
/**
|
|
1317
|
+
* The handler for all events targeting the time inputs
|
|
1318
|
+
*/
|
|
1319
|
+
function updateTime(e) {
|
|
1320
|
+
if (self.selectedDates.length === 0) {
|
|
1321
|
+
var defaultDate = self.config.minDate === undefined ||
|
|
1322
|
+
compareDates(new Date(), self.config.minDate) >= 0
|
|
1323
|
+
? new Date()
|
|
1324
|
+
: new Date(self.config.minDate.getTime());
|
|
1325
|
+
var defaults = getDefaultHours(self.config);
|
|
1326
|
+
defaultDate.setHours(defaults.hours, defaults.minutes, defaults.seconds, defaultDate.getMilliseconds());
|
|
1327
|
+
self.selectedDates = [defaultDate];
|
|
1328
|
+
self.latestSelectedDateObj = defaultDate;
|
|
1329
|
+
}
|
|
1330
|
+
if (e !== undefined && e.type !== "blur") {
|
|
1331
|
+
timeWrapper(e);
|
|
1332
|
+
}
|
|
1333
|
+
var prevValue = self._input.value;
|
|
1334
|
+
setHoursFromInputs();
|
|
1335
|
+
updateValue();
|
|
1336
|
+
if (self._input.value !== prevValue) {
|
|
1337
|
+
self._debouncedChange();
|
|
1338
|
+
}
|
|
1339
|
+
}
|
|
1340
|
+
function ampm2military(hour, amPM) {
|
|
1341
|
+
return (hour % 12) + 12 * int(amPM === self.l10n.amPM[1]);
|
|
1342
|
+
}
|
|
1343
|
+
function military2ampm(hour) {
|
|
1344
|
+
switch (hour % 24) {
|
|
1345
|
+
case 0:
|
|
1346
|
+
case 12:
|
|
1347
|
+
return 12;
|
|
1348
|
+
default:
|
|
1349
|
+
return hour % 12;
|
|
1350
|
+
}
|
|
1351
|
+
}
|
|
1352
|
+
/**
|
|
1353
|
+
* Syncs the selected date object time with user's time input
|
|
1354
|
+
*/
|
|
1355
|
+
function setHoursFromInputs() {
|
|
1356
|
+
if (self.hourElement === undefined || self.minuteElement === undefined)
|
|
1357
|
+
return;
|
|
1358
|
+
var hours = (parseInt(self.hourElement.value.slice(-2), 10) || 0) % 24, minutes = (parseInt(self.minuteElement.value, 10) || 0) % 60, seconds = self.secondElement !== undefined
|
|
1359
|
+
? (parseInt(self.secondElement.value, 10) || 0) % 60
|
|
1360
|
+
: 0;
|
|
1361
|
+
if (self.amPM !== undefined) {
|
|
1362
|
+
hours = ampm2military(hours, self.amPM.textContent);
|
|
1363
|
+
}
|
|
1364
|
+
var limitMinHours = self.config.minTime !== undefined ||
|
|
1365
|
+
(self.config.minDate &&
|
|
1366
|
+
self.minDateHasTime &&
|
|
1367
|
+
self.latestSelectedDateObj &&
|
|
1368
|
+
compareDates(self.latestSelectedDateObj, self.config.minDate, true) ===
|
|
1369
|
+
0);
|
|
1370
|
+
var limitMaxHours = self.config.maxTime !== undefined ||
|
|
1371
|
+
(self.config.maxDate &&
|
|
1372
|
+
self.maxDateHasTime &&
|
|
1373
|
+
self.latestSelectedDateObj &&
|
|
1374
|
+
compareDates(self.latestSelectedDateObj, self.config.maxDate, true) ===
|
|
1375
|
+
0);
|
|
1376
|
+
if (self.config.maxTime !== undefined &&
|
|
1377
|
+
self.config.minTime !== undefined &&
|
|
1378
|
+
self.config.minTime > self.config.maxTime) {
|
|
1379
|
+
var minBound = calculateSecondsSinceMidnight(self.config.minTime.getHours(), self.config.minTime.getMinutes(), self.config.minTime.getSeconds());
|
|
1380
|
+
var maxBound = calculateSecondsSinceMidnight(self.config.maxTime.getHours(), self.config.maxTime.getMinutes(), self.config.maxTime.getSeconds());
|
|
1381
|
+
var currentTime = calculateSecondsSinceMidnight(hours, minutes, seconds);
|
|
1382
|
+
if (currentTime > maxBound && currentTime < minBound) {
|
|
1383
|
+
var result = parseSeconds(minBound);
|
|
1384
|
+
hours = result[0];
|
|
1385
|
+
minutes = result[1];
|
|
1386
|
+
seconds = result[2];
|
|
1387
|
+
}
|
|
1388
|
+
}
|
|
1389
|
+
else {
|
|
1390
|
+
if (limitMaxHours) {
|
|
1391
|
+
var maxTime = self.config.maxTime !== undefined
|
|
1392
|
+
? self.config.maxTime
|
|
1393
|
+
: self.config.maxDate;
|
|
1394
|
+
hours = Math.min(hours, maxTime.getHours());
|
|
1395
|
+
if (hours === maxTime.getHours())
|
|
1396
|
+
minutes = Math.min(minutes, maxTime.getMinutes());
|
|
1397
|
+
if (minutes === maxTime.getMinutes())
|
|
1398
|
+
seconds = Math.min(seconds, maxTime.getSeconds());
|
|
1399
|
+
}
|
|
1400
|
+
if (limitMinHours) {
|
|
1401
|
+
var minTime = self.config.minTime !== undefined
|
|
1402
|
+
? self.config.minTime
|
|
1403
|
+
: self.config.minDate;
|
|
1404
|
+
hours = Math.max(hours, minTime.getHours());
|
|
1405
|
+
if (hours === minTime.getHours() && minutes < minTime.getMinutes())
|
|
1406
|
+
minutes = minTime.getMinutes();
|
|
1407
|
+
if (minutes === minTime.getMinutes())
|
|
1408
|
+
seconds = Math.max(seconds, minTime.getSeconds());
|
|
1409
|
+
}
|
|
1410
|
+
}
|
|
1411
|
+
setHours(hours, minutes, seconds);
|
|
1412
|
+
}
|
|
1413
|
+
/**
|
|
1414
|
+
* Syncs time input values with a date
|
|
1415
|
+
*/
|
|
1416
|
+
function setHoursFromDate(dateObj) {
|
|
1417
|
+
var date = dateObj || self.latestSelectedDateObj;
|
|
1418
|
+
if (date && date instanceof Date) {
|
|
1419
|
+
setHours(date.getHours(), date.getMinutes(), date.getSeconds());
|
|
1420
|
+
}
|
|
1421
|
+
}
|
|
1422
|
+
/**
|
|
1423
|
+
* Sets the hours, minutes, and optionally seconds
|
|
1424
|
+
* of the latest selected date object and the
|
|
1425
|
+
* corresponding time inputs
|
|
1426
|
+
* @param {Number} hours the hour. whether its military
|
|
1427
|
+
* or am-pm gets inferred from config
|
|
1428
|
+
* @param {Number} minutes the minutes
|
|
1429
|
+
* @param {Number} seconds the seconds (optional)
|
|
1430
|
+
*/
|
|
1431
|
+
function setHours(hours, minutes, seconds) {
|
|
1432
|
+
if (self.latestSelectedDateObj !== undefined) {
|
|
1433
|
+
self.latestSelectedDateObj.setHours(hours % 24, minutes, seconds || 0, 0);
|
|
1434
|
+
}
|
|
1435
|
+
if (!self.hourElement || !self.minuteElement || self.isMobile)
|
|
1436
|
+
return;
|
|
1437
|
+
self.hourElement.value = pad(!self.config.time_24hr
|
|
1438
|
+
? ((12 + hours) % 12) + 12 * int(hours % 12 === 0)
|
|
1439
|
+
: hours);
|
|
1440
|
+
self.minuteElement.value = pad(minutes);
|
|
1441
|
+
if (self.amPM !== undefined)
|
|
1442
|
+
self.amPM.textContent = self.l10n.amPM[int(hours >= 12)];
|
|
1443
|
+
if (self.secondElement !== undefined)
|
|
1444
|
+
self.secondElement.value = pad(seconds);
|
|
1445
|
+
}
|
|
1446
|
+
/**
|
|
1447
|
+
* Handles the year input and incrementing events
|
|
1448
|
+
* @param {Event} event the keyup or increment event
|
|
1449
|
+
*/
|
|
1450
|
+
function onYearInput(event) {
|
|
1451
|
+
var eventTarget = getEventTarget(event);
|
|
1452
|
+
var year = parseInt(eventTarget.value) + (event.delta || 0);
|
|
1453
|
+
if (year / 1000 > 1 ||
|
|
1454
|
+
(event.key === "Enter" && !/[^\d]/.test(year.toString()))) {
|
|
1455
|
+
changeYear(year);
|
|
1456
|
+
}
|
|
1457
|
+
}
|
|
1458
|
+
/**
|
|
1459
|
+
* Essentially addEventListener + tracking
|
|
1460
|
+
* @param {Element} element the element to addEventListener to
|
|
1461
|
+
* @param {String} event the event name
|
|
1462
|
+
* @param {Function} handler the event handler
|
|
1463
|
+
*/
|
|
1464
|
+
function bind(element, event, handler, options) {
|
|
1465
|
+
if (event instanceof Array)
|
|
1466
|
+
return event.forEach(function (ev) { return bind(element, ev, handler, options); });
|
|
1467
|
+
if (element instanceof Array)
|
|
1468
|
+
return element.forEach(function (el) { return bind(el, event, handler, options); });
|
|
1469
|
+
element.addEventListener(event, handler, options);
|
|
1470
|
+
self._handlers.push({
|
|
1471
|
+
remove: function () { return element.removeEventListener(event, handler, options); },
|
|
1472
|
+
});
|
|
1473
|
+
}
|
|
1474
|
+
function triggerChange() {
|
|
1475
|
+
triggerEvent("onChange");
|
|
1476
|
+
}
|
|
1477
|
+
/**
|
|
1478
|
+
* Adds all the necessary event listeners
|
|
1479
|
+
*/
|
|
1480
|
+
function bindEvents() {
|
|
1481
|
+
if (self.config.wrap) {
|
|
1482
|
+
["open", "close", "toggle", "clear"].forEach(function (evt) {
|
|
1483
|
+
Array.prototype.forEach.call(self.element.querySelectorAll("[data-" + evt + "]"), function (el) {
|
|
1484
|
+
return bind(el, "click", self[evt]);
|
|
1485
|
+
});
|
|
1486
|
+
});
|
|
1487
|
+
}
|
|
1488
|
+
if (self.isMobile) {
|
|
1489
|
+
setupMobile();
|
|
1490
|
+
return;
|
|
1491
|
+
}
|
|
1492
|
+
var debouncedResize = debounce(onResize, 50);
|
|
1493
|
+
self._debouncedChange = debounce(triggerChange, DEBOUNCED_CHANGE_MS);
|
|
1494
|
+
if (self.daysContainer && !/iPhone|iPad|iPod/i.test(navigator.userAgent))
|
|
1495
|
+
bind(self.daysContainer, "mouseover", function (e) {
|
|
1496
|
+
if (self.config.mode === "range")
|
|
1497
|
+
onMouseOver(getEventTarget(e));
|
|
1498
|
+
});
|
|
1499
|
+
bind(self._input, "keydown", onKeyDown);
|
|
1500
|
+
if (self.calendarContainer !== undefined) {
|
|
1501
|
+
bind(self.calendarContainer, "keydown", onKeyDown);
|
|
1502
|
+
}
|
|
1503
|
+
if (!self.config.inline && !self.config.static)
|
|
1504
|
+
bind(window, "resize", debouncedResize);
|
|
1505
|
+
if (window.ontouchstart !== undefined)
|
|
1506
|
+
bind(window.document, "touchstart", documentClick);
|
|
1507
|
+
else
|
|
1508
|
+
bind(window.document, "mousedown", documentClick);
|
|
1509
|
+
bind(window.document, "focus", documentClick, { capture: true });
|
|
1510
|
+
if (self.config.clickOpens === true) {
|
|
1511
|
+
bind(self._input, "focus", self.open);
|
|
1512
|
+
bind(self._input, "click", self.open);
|
|
1513
|
+
}
|
|
1514
|
+
if (self.daysContainer !== undefined) {
|
|
1515
|
+
bind(self.monthNav, "click", onMonthNavClick);
|
|
1516
|
+
bind(self.monthNav, ["keyup", "increment"], onYearInput);
|
|
1517
|
+
bind(self.daysContainer, "click", selectDate);
|
|
1518
|
+
}
|
|
1519
|
+
if (self.timeContainer !== undefined &&
|
|
1520
|
+
self.minuteElement !== undefined &&
|
|
1521
|
+
self.hourElement !== undefined) {
|
|
1522
|
+
var selText = function (e) {
|
|
1523
|
+
return getEventTarget(e).select();
|
|
1524
|
+
};
|
|
1525
|
+
bind(self.timeContainer, ["increment"], updateTime);
|
|
1526
|
+
bind(self.timeContainer, "blur", updateTime, { capture: true });
|
|
1527
|
+
bind(self.timeContainer, "click", timeIncrement);
|
|
1528
|
+
bind([self.hourElement, self.minuteElement], ["focus", "click"], selText);
|
|
1529
|
+
if (self.secondElement !== undefined)
|
|
1530
|
+
bind(self.secondElement, "focus", function () { return self.secondElement && self.secondElement.select(); });
|
|
1531
|
+
if (self.amPM !== undefined) {
|
|
1532
|
+
bind(self.amPM, "click", function (e) {
|
|
1533
|
+
updateTime(e);
|
|
1534
|
+
});
|
|
1535
|
+
}
|
|
1536
|
+
}
|
|
1537
|
+
if (self.config.allowInput) {
|
|
1538
|
+
bind(self._input, "blur", onBlur);
|
|
1539
|
+
}
|
|
1540
|
+
}
|
|
1541
|
+
/**
|
|
1542
|
+
* Set the calendar view to a particular date.
|
|
1543
|
+
* @param {Date} jumpDate the date to set the view to
|
|
1544
|
+
* @param {boolean} triggerChange if change events should be triggered
|
|
1545
|
+
*/
|
|
1546
|
+
function jumpToDate(jumpDate, triggerChange) {
|
|
1547
|
+
var jumpTo = jumpDate !== undefined
|
|
1548
|
+
? self.parseDate(jumpDate)
|
|
1549
|
+
: self.latestSelectedDateObj ||
|
|
1550
|
+
(self.config.minDate && self.config.minDate > self.now
|
|
1551
|
+
? self.config.minDate
|
|
1552
|
+
: self.config.maxDate && self.config.maxDate < self.now
|
|
1553
|
+
? self.config.maxDate
|
|
1554
|
+
: self.now);
|
|
1555
|
+
var oldYear = self.currentYear;
|
|
1556
|
+
var oldMonth = self.currentMonth;
|
|
1557
|
+
try {
|
|
1558
|
+
if (jumpTo !== undefined) {
|
|
1559
|
+
self.currentYear = jumpTo.getFullYear();
|
|
1560
|
+
self.currentMonth = jumpTo.getMonth();
|
|
1561
|
+
}
|
|
1562
|
+
}
|
|
1563
|
+
catch (e) {
|
|
1564
|
+
/* istanbul ignore next */
|
|
1565
|
+
e.message = "Invalid date supplied: " + jumpTo;
|
|
1566
|
+
self.config.errorHandler(e);
|
|
1567
|
+
}
|
|
1568
|
+
if (triggerChange && self.currentYear !== oldYear) {
|
|
1569
|
+
triggerEvent("onYearChange");
|
|
1570
|
+
buildMonthSwitch();
|
|
1571
|
+
}
|
|
1572
|
+
if (triggerChange &&
|
|
1573
|
+
(self.currentYear !== oldYear || self.currentMonth !== oldMonth)) {
|
|
1574
|
+
triggerEvent("onMonthChange");
|
|
1575
|
+
}
|
|
1576
|
+
self.redraw();
|
|
1577
|
+
}
|
|
1578
|
+
/**
|
|
1579
|
+
* The up/down arrow handler for time inputs
|
|
1580
|
+
* @param {Event} e the click event
|
|
1581
|
+
*/
|
|
1582
|
+
function timeIncrement(e) {
|
|
1583
|
+
var eventTarget = getEventTarget(e);
|
|
1584
|
+
if (~eventTarget.className.indexOf("arrow"))
|
|
1585
|
+
incrementNumInput(e, eventTarget.classList.contains("arrowUp") ? 1 : -1);
|
|
1586
|
+
}
|
|
1587
|
+
/**
|
|
1588
|
+
* Increments/decrements the value of input associ-
|
|
1589
|
+
* ated with the up/down arrow by dispatching an
|
|
1590
|
+
* "increment" event on the input.
|
|
1591
|
+
*
|
|
1592
|
+
* @param {Event} e the click event
|
|
1593
|
+
* @param {Number} delta the diff (usually 1 or -1)
|
|
1594
|
+
* @param {Element} inputElem the input element
|
|
1595
|
+
*/
|
|
1596
|
+
function incrementNumInput(e, delta, inputElem) {
|
|
1597
|
+
var target = e && getEventTarget(e);
|
|
1598
|
+
var input = inputElem ||
|
|
1599
|
+
(target && target.parentNode && target.parentNode.firstChild);
|
|
1600
|
+
var event = createEvent("increment");
|
|
1601
|
+
event.delta = delta;
|
|
1602
|
+
input && input.dispatchEvent(event);
|
|
1603
|
+
}
|
|
1604
|
+
function build() {
|
|
1605
|
+
var fragment = window.document.createDocumentFragment();
|
|
1606
|
+
self.calendarContainer = createElement("div", "flatpickr-calendar");
|
|
1607
|
+
self.calendarContainer.tabIndex = -1;
|
|
1608
|
+
if (!self.config.noCalendar) {
|
|
1609
|
+
fragment.appendChild(buildMonthNav());
|
|
1610
|
+
self.innerContainer = createElement("div", "flatpickr-innerContainer");
|
|
1611
|
+
if (self.config.weekNumbers) {
|
|
1612
|
+
var _a = buildWeeks(), weekWrapper = _a.weekWrapper, weekNumbers = _a.weekNumbers;
|
|
1613
|
+
self.innerContainer.appendChild(weekWrapper);
|
|
1614
|
+
self.weekNumbers = weekNumbers;
|
|
1615
|
+
self.weekWrapper = weekWrapper;
|
|
1616
|
+
}
|
|
1617
|
+
self.rContainer = createElement("div", "flatpickr-rContainer");
|
|
1618
|
+
self.rContainer.appendChild(buildWeekdays());
|
|
1619
|
+
if (!self.daysContainer) {
|
|
1620
|
+
self.daysContainer = createElement("div", "flatpickr-days");
|
|
1621
|
+
self.daysContainer.tabIndex = -1;
|
|
1622
|
+
}
|
|
1623
|
+
buildDays();
|
|
1624
|
+
self.rContainer.appendChild(self.daysContainer);
|
|
1625
|
+
self.innerContainer.appendChild(self.rContainer);
|
|
1626
|
+
fragment.appendChild(self.innerContainer);
|
|
1627
|
+
}
|
|
1628
|
+
if (self.config.enableTime) {
|
|
1629
|
+
fragment.appendChild(buildTime());
|
|
1630
|
+
}
|
|
1631
|
+
toggleClass(self.calendarContainer, "rangeMode", self.config.mode === "range");
|
|
1632
|
+
toggleClass(self.calendarContainer, "animate", self.config.animate === true);
|
|
1633
|
+
toggleClass(self.calendarContainer, "multiMonth", self.config.showMonths > 1);
|
|
1634
|
+
self.calendarContainer.appendChild(fragment);
|
|
1635
|
+
var customAppend = self.config.appendTo !== undefined &&
|
|
1636
|
+
self.config.appendTo.nodeType !== undefined;
|
|
1637
|
+
if (self.config.inline || self.config.static) {
|
|
1638
|
+
self.calendarContainer.classList.add(self.config.inline ? "inline" : "static");
|
|
1639
|
+
if (self.config.inline) {
|
|
1640
|
+
if (!customAppend && self.element.parentNode)
|
|
1641
|
+
self.element.parentNode.insertBefore(self.calendarContainer, self._input.nextSibling);
|
|
1642
|
+
else if (self.config.appendTo !== undefined)
|
|
1643
|
+
self.config.appendTo.appendChild(self.calendarContainer);
|
|
1644
|
+
}
|
|
1645
|
+
if (self.config.static) {
|
|
1646
|
+
var wrapper = createElement("div", "flatpickr-wrapper");
|
|
1647
|
+
if (self.element.parentNode)
|
|
1648
|
+
self.element.parentNode.insertBefore(wrapper, self.element);
|
|
1649
|
+
wrapper.appendChild(self.element);
|
|
1650
|
+
if (self.altInput)
|
|
1651
|
+
wrapper.appendChild(self.altInput);
|
|
1652
|
+
wrapper.appendChild(self.calendarContainer);
|
|
1653
|
+
}
|
|
1654
|
+
}
|
|
1655
|
+
if (!self.config.static && !self.config.inline)
|
|
1656
|
+
(self.config.appendTo !== undefined
|
|
1657
|
+
? self.config.appendTo
|
|
1658
|
+
: window.document.body).appendChild(self.calendarContainer);
|
|
1659
|
+
}
|
|
1660
|
+
function createDay(className, date, _dayNumber, i) {
|
|
1661
|
+
var dateIsEnabled = isEnabled(date, true), dayElement = createElement("span", className, date.getDate().toString());
|
|
1662
|
+
dayElement.dateObj = date;
|
|
1663
|
+
dayElement.$i = i;
|
|
1664
|
+
dayElement.setAttribute("aria-label", self.formatDate(date, self.config.ariaDateFormat));
|
|
1665
|
+
if (className.indexOf("hidden") === -1 &&
|
|
1666
|
+
compareDates(date, self.now) === 0) {
|
|
1667
|
+
self.todayDateElem = dayElement;
|
|
1668
|
+
dayElement.classList.add("today");
|
|
1669
|
+
dayElement.setAttribute("aria-current", "date");
|
|
1670
|
+
}
|
|
1671
|
+
if (dateIsEnabled) {
|
|
1672
|
+
dayElement.tabIndex = -1;
|
|
1673
|
+
if (isDateSelected(date)) {
|
|
1674
|
+
dayElement.classList.add("selected");
|
|
1675
|
+
self.selectedDateElem = dayElement;
|
|
1676
|
+
if (self.config.mode === "range") {
|
|
1677
|
+
toggleClass(dayElement, "startRange", self.selectedDates[0] &&
|
|
1678
|
+
compareDates(date, self.selectedDates[0], true) === 0);
|
|
1679
|
+
toggleClass(dayElement, "endRange", self.selectedDates[1] &&
|
|
1680
|
+
compareDates(date, self.selectedDates[1], true) === 0);
|
|
1681
|
+
if (className === "nextMonthDay")
|
|
1682
|
+
dayElement.classList.add("inRange");
|
|
1683
|
+
}
|
|
1684
|
+
}
|
|
1685
|
+
}
|
|
1686
|
+
else {
|
|
1687
|
+
dayElement.classList.add("flatpickr-disabled");
|
|
1688
|
+
}
|
|
1689
|
+
if (self.config.mode === "range") {
|
|
1690
|
+
if (isDateInRange(date) && !isDateSelected(date))
|
|
1691
|
+
dayElement.classList.add("inRange");
|
|
1692
|
+
}
|
|
1693
|
+
if (self.weekNumbers &&
|
|
1694
|
+
self.config.showMonths === 1 &&
|
|
1695
|
+
className !== "prevMonthDay" &&
|
|
1696
|
+
i % 7 === 6) {
|
|
1697
|
+
self.weekNumbers.insertAdjacentHTML("beforeend", "<span class='flatpickr-day'>" + self.config.getWeek(date) + "</span>");
|
|
1698
|
+
}
|
|
1699
|
+
triggerEvent("onDayCreate", dayElement);
|
|
1700
|
+
return dayElement;
|
|
1701
|
+
}
|
|
1702
|
+
function focusOnDayElem(targetNode) {
|
|
1703
|
+
targetNode.focus();
|
|
1704
|
+
if (self.config.mode === "range")
|
|
1705
|
+
onMouseOver(targetNode);
|
|
1706
|
+
}
|
|
1707
|
+
function getFirstAvailableDay(delta) {
|
|
1708
|
+
var startMonth = delta > 0 ? 0 : self.config.showMonths - 1;
|
|
1709
|
+
var endMonth = delta > 0 ? self.config.showMonths : -1;
|
|
1710
|
+
for (var m = startMonth; m != endMonth; m += delta) {
|
|
1711
|
+
var month = self.daysContainer.children[m];
|
|
1712
|
+
var startIndex = delta > 0 ? 0 : month.children.length - 1;
|
|
1713
|
+
var endIndex = delta > 0 ? month.children.length : -1;
|
|
1714
|
+
for (var i = startIndex; i != endIndex; i += delta) {
|
|
1715
|
+
var c = month.children[i];
|
|
1716
|
+
if (c.className.indexOf("hidden") === -1 && isEnabled(c.dateObj))
|
|
1717
|
+
return c;
|
|
1718
|
+
}
|
|
1719
|
+
}
|
|
1720
|
+
return undefined;
|
|
1721
|
+
}
|
|
1722
|
+
function getNextAvailableDay(current, delta) {
|
|
1723
|
+
var givenMonth = current.className.indexOf("Month") === -1
|
|
1724
|
+
? current.dateObj.getMonth()
|
|
1725
|
+
: self.currentMonth;
|
|
1726
|
+
var endMonth = delta > 0 ? self.config.showMonths : -1;
|
|
1727
|
+
var loopDelta = delta > 0 ? 1 : -1;
|
|
1728
|
+
for (var m = givenMonth - self.currentMonth; m != endMonth; m += loopDelta) {
|
|
1729
|
+
var month = self.daysContainer.children[m];
|
|
1730
|
+
var startIndex = givenMonth - self.currentMonth === m
|
|
1731
|
+
? current.$i + delta
|
|
1732
|
+
: delta < 0
|
|
1733
|
+
? month.children.length - 1
|
|
1734
|
+
: 0;
|
|
1735
|
+
var numMonthDays = month.children.length;
|
|
1736
|
+
for (var i = startIndex; i >= 0 && i < numMonthDays && i != (delta > 0 ? numMonthDays : -1); i += loopDelta) {
|
|
1737
|
+
var c = month.children[i];
|
|
1738
|
+
if (c.className.indexOf("hidden") === -1 &&
|
|
1739
|
+
isEnabled(c.dateObj) &&
|
|
1740
|
+
Math.abs(current.$i - i) >= Math.abs(delta))
|
|
1741
|
+
return focusOnDayElem(c);
|
|
1742
|
+
}
|
|
1743
|
+
}
|
|
1744
|
+
self.changeMonth(loopDelta);
|
|
1745
|
+
focusOnDay(getFirstAvailableDay(loopDelta), 0);
|
|
1746
|
+
return undefined;
|
|
1747
|
+
}
|
|
1748
|
+
function focusOnDay(current, offset) {
|
|
1749
|
+
var activeElement = getClosestActiveElement();
|
|
1750
|
+
var dayFocused = isInView(activeElement || document.body);
|
|
1751
|
+
var startElem = current !== undefined
|
|
1752
|
+
? current
|
|
1753
|
+
: dayFocused
|
|
1754
|
+
? activeElement
|
|
1755
|
+
: self.selectedDateElem !== undefined && isInView(self.selectedDateElem)
|
|
1756
|
+
? self.selectedDateElem
|
|
1757
|
+
: self.todayDateElem !== undefined && isInView(self.todayDateElem)
|
|
1758
|
+
? self.todayDateElem
|
|
1759
|
+
: getFirstAvailableDay(offset > 0 ? 1 : -1);
|
|
1760
|
+
if (startElem === undefined) {
|
|
1761
|
+
self._input.focus();
|
|
1762
|
+
}
|
|
1763
|
+
else if (!dayFocused) {
|
|
1764
|
+
focusOnDayElem(startElem);
|
|
1765
|
+
}
|
|
1766
|
+
else {
|
|
1767
|
+
getNextAvailableDay(startElem, offset);
|
|
1768
|
+
}
|
|
1769
|
+
}
|
|
1770
|
+
function buildMonthDays(year, month) {
|
|
1771
|
+
var firstOfMonth = (new Date(year, month, 1).getDay() - self.l10n.firstDayOfWeek + 7) % 7;
|
|
1772
|
+
var prevMonthDays = self.utils.getDaysInMonth((month - 1 + 12) % 12, year);
|
|
1773
|
+
var daysInMonth = self.utils.getDaysInMonth(month, year), days = window.document.createDocumentFragment(), isMultiMonth = self.config.showMonths > 1, prevMonthDayClass = isMultiMonth ? "prevMonthDay hidden" : "prevMonthDay", nextMonthDayClass = isMultiMonth ? "nextMonthDay hidden" : "nextMonthDay";
|
|
1774
|
+
var dayNumber = prevMonthDays + 1 - firstOfMonth, dayIndex = 0;
|
|
1775
|
+
// prepend days from the ending of previous month
|
|
1776
|
+
for (; dayNumber <= prevMonthDays; dayNumber++, dayIndex++) {
|
|
1777
|
+
days.appendChild(createDay("flatpickr-day " + prevMonthDayClass, new Date(year, month - 1, dayNumber), dayNumber, dayIndex));
|
|
1778
|
+
}
|
|
1779
|
+
// Start at 1 since there is no 0th day
|
|
1780
|
+
for (dayNumber = 1; dayNumber <= daysInMonth; dayNumber++, dayIndex++) {
|
|
1781
|
+
days.appendChild(createDay("flatpickr-day", new Date(year, month, dayNumber), dayNumber, dayIndex));
|
|
1782
|
+
}
|
|
1783
|
+
// append days from the next month
|
|
1784
|
+
for (var dayNum = daysInMonth + 1; dayNum <= 42 - firstOfMonth &&
|
|
1785
|
+
(self.config.showMonths === 1 || dayIndex % 7 !== 0); dayNum++, dayIndex++) {
|
|
1786
|
+
days.appendChild(createDay("flatpickr-day " + nextMonthDayClass, new Date(year, month + 1, dayNum % daysInMonth), dayNum, dayIndex));
|
|
1787
|
+
}
|
|
1788
|
+
//updateNavigationCurrentMonth();
|
|
1789
|
+
var dayContainer = createElement("div", "dayContainer");
|
|
1790
|
+
dayContainer.appendChild(days);
|
|
1791
|
+
return dayContainer;
|
|
1792
|
+
}
|
|
1793
|
+
function buildDays() {
|
|
1794
|
+
if (self.daysContainer === undefined) {
|
|
1795
|
+
return;
|
|
1796
|
+
}
|
|
1797
|
+
clearNode(self.daysContainer);
|
|
1798
|
+
// TODO: week numbers for each month
|
|
1799
|
+
if (self.weekNumbers)
|
|
1800
|
+
clearNode(self.weekNumbers);
|
|
1801
|
+
var frag = document.createDocumentFragment();
|
|
1802
|
+
for (var i = 0; i < self.config.showMonths; i++) {
|
|
1803
|
+
var d = new Date(self.currentYear, self.currentMonth, 1);
|
|
1804
|
+
d.setMonth(self.currentMonth + i);
|
|
1805
|
+
frag.appendChild(buildMonthDays(d.getFullYear(), d.getMonth()));
|
|
1806
|
+
}
|
|
1807
|
+
self.daysContainer.appendChild(frag);
|
|
1808
|
+
self.days = self.daysContainer.firstChild;
|
|
1809
|
+
if (self.config.mode === "range" && self.selectedDates.length === 1) {
|
|
1810
|
+
onMouseOver();
|
|
1811
|
+
}
|
|
1812
|
+
}
|
|
1813
|
+
function buildMonthSwitch() {
|
|
1814
|
+
if (self.config.showMonths > 1 ||
|
|
1815
|
+
self.config.monthSelectorType !== "dropdown")
|
|
1816
|
+
return;
|
|
1817
|
+
var shouldBuildMonth = function (month) {
|
|
1818
|
+
if (self.config.minDate !== undefined &&
|
|
1819
|
+
self.currentYear === self.config.minDate.getFullYear() &&
|
|
1820
|
+
month < self.config.minDate.getMonth()) {
|
|
1821
|
+
return false;
|
|
1822
|
+
}
|
|
1823
|
+
return !(self.config.maxDate !== undefined &&
|
|
1824
|
+
self.currentYear === self.config.maxDate.getFullYear() &&
|
|
1825
|
+
month > self.config.maxDate.getMonth());
|
|
1826
|
+
};
|
|
1827
|
+
self.monthsDropdownContainer.tabIndex = -1;
|
|
1828
|
+
self.monthsDropdownContainer.innerHTML = "";
|
|
1829
|
+
for (var i = 0; i < 12; i++) {
|
|
1830
|
+
if (!shouldBuildMonth(i))
|
|
1831
|
+
continue;
|
|
1832
|
+
var month = createElement("option", "flatpickr-monthDropdown-month");
|
|
1833
|
+
month.value = new Date(self.currentYear, i).getMonth().toString();
|
|
1834
|
+
month.textContent = monthToStr(i, self.config.shorthandCurrentMonth, self.l10n);
|
|
1835
|
+
month.tabIndex = -1;
|
|
1836
|
+
if (self.currentMonth === i) {
|
|
1837
|
+
month.selected = true;
|
|
1838
|
+
}
|
|
1839
|
+
self.monthsDropdownContainer.appendChild(month);
|
|
1840
|
+
}
|
|
1841
|
+
}
|
|
1842
|
+
function buildMonth() {
|
|
1843
|
+
var container = createElement("div", "flatpickr-month");
|
|
1844
|
+
var monthNavFragment = window.document.createDocumentFragment();
|
|
1845
|
+
var monthElement;
|
|
1846
|
+
if (self.config.showMonths > 1 ||
|
|
1847
|
+
self.config.monthSelectorType === "static") {
|
|
1848
|
+
monthElement = createElement("span", "cur-month");
|
|
1849
|
+
}
|
|
1850
|
+
else {
|
|
1851
|
+
self.monthsDropdownContainer = createElement("select", "flatpickr-monthDropdown-months");
|
|
1852
|
+
self.monthsDropdownContainer.setAttribute("aria-label", self.l10n.monthAriaLabel);
|
|
1853
|
+
bind(self.monthsDropdownContainer, "change", function (e) {
|
|
1854
|
+
var target = getEventTarget(e);
|
|
1855
|
+
var selectedMonth = parseInt(target.value, 10);
|
|
1856
|
+
self.changeMonth(selectedMonth - self.currentMonth);
|
|
1857
|
+
triggerEvent("onMonthChange");
|
|
1858
|
+
});
|
|
1859
|
+
buildMonthSwitch();
|
|
1860
|
+
monthElement = self.monthsDropdownContainer;
|
|
1861
|
+
}
|
|
1862
|
+
var yearInput = createNumberInput("cur-year", { tabindex: "-1" });
|
|
1863
|
+
var yearElement = yearInput.getElementsByTagName("input")[0];
|
|
1864
|
+
yearElement.setAttribute("aria-label", self.l10n.yearAriaLabel);
|
|
1865
|
+
if (self.config.minDate) {
|
|
1866
|
+
yearElement.setAttribute("min", self.config.minDate.getFullYear().toString());
|
|
1867
|
+
}
|
|
1868
|
+
if (self.config.maxDate) {
|
|
1869
|
+
yearElement.setAttribute("max", self.config.maxDate.getFullYear().toString());
|
|
1870
|
+
yearElement.disabled =
|
|
1871
|
+
!!self.config.minDate &&
|
|
1872
|
+
self.config.minDate.getFullYear() === self.config.maxDate.getFullYear();
|
|
1873
|
+
}
|
|
1874
|
+
var currentMonth = createElement("div", "flatpickr-current-month");
|
|
1875
|
+
currentMonth.appendChild(monthElement);
|
|
1876
|
+
currentMonth.appendChild(yearInput);
|
|
1877
|
+
monthNavFragment.appendChild(currentMonth);
|
|
1878
|
+
container.appendChild(monthNavFragment);
|
|
1879
|
+
return {
|
|
1880
|
+
container: container,
|
|
1881
|
+
yearElement: yearElement,
|
|
1882
|
+
monthElement: monthElement,
|
|
1883
|
+
};
|
|
1884
|
+
}
|
|
1885
|
+
function buildMonths() {
|
|
1886
|
+
clearNode(self.monthNav);
|
|
1887
|
+
self.monthNav.appendChild(self.prevMonthNav);
|
|
1888
|
+
if (self.config.showMonths) {
|
|
1889
|
+
self.yearElements = [];
|
|
1890
|
+
self.monthElements = [];
|
|
1891
|
+
}
|
|
1892
|
+
for (var m = self.config.showMonths; m--;) {
|
|
1893
|
+
var month = buildMonth();
|
|
1894
|
+
self.yearElements.push(month.yearElement);
|
|
1895
|
+
self.monthElements.push(month.monthElement);
|
|
1896
|
+
self.monthNav.appendChild(month.container);
|
|
1897
|
+
}
|
|
1898
|
+
self.monthNav.appendChild(self.nextMonthNav);
|
|
1899
|
+
}
|
|
1900
|
+
function buildMonthNav() {
|
|
1901
|
+
self.monthNav = createElement("div", "flatpickr-months");
|
|
1902
|
+
self.yearElements = [];
|
|
1903
|
+
self.monthElements = [];
|
|
1904
|
+
self.prevMonthNav = createElement("span", "flatpickr-prev-month");
|
|
1905
|
+
self.prevMonthNav.innerHTML = self.config.prevArrow;
|
|
1906
|
+
self.nextMonthNav = createElement("span", "flatpickr-next-month");
|
|
1907
|
+
self.nextMonthNav.innerHTML = self.config.nextArrow;
|
|
1908
|
+
buildMonths();
|
|
1909
|
+
Object.defineProperty(self, "_hidePrevMonthArrow", {
|
|
1910
|
+
get: function () { return self.__hidePrevMonthArrow; },
|
|
1911
|
+
set: function (bool) {
|
|
1912
|
+
if (self.__hidePrevMonthArrow !== bool) {
|
|
1913
|
+
toggleClass(self.prevMonthNav, "flatpickr-disabled", bool);
|
|
1914
|
+
self.__hidePrevMonthArrow = bool;
|
|
1915
|
+
}
|
|
1916
|
+
},
|
|
1917
|
+
});
|
|
1918
|
+
Object.defineProperty(self, "_hideNextMonthArrow", {
|
|
1919
|
+
get: function () { return self.__hideNextMonthArrow; },
|
|
1920
|
+
set: function (bool) {
|
|
1921
|
+
if (self.__hideNextMonthArrow !== bool) {
|
|
1922
|
+
toggleClass(self.nextMonthNav, "flatpickr-disabled", bool);
|
|
1923
|
+
self.__hideNextMonthArrow = bool;
|
|
1924
|
+
}
|
|
1925
|
+
},
|
|
1926
|
+
});
|
|
1927
|
+
self.currentYearElement = self.yearElements[0];
|
|
1928
|
+
updateNavigationCurrentMonth();
|
|
1929
|
+
return self.monthNav;
|
|
1930
|
+
}
|
|
1931
|
+
function buildTime() {
|
|
1932
|
+
self.calendarContainer.classList.add("hasTime");
|
|
1933
|
+
if (self.config.noCalendar)
|
|
1934
|
+
self.calendarContainer.classList.add("noCalendar");
|
|
1935
|
+
var defaults = getDefaultHours(self.config);
|
|
1936
|
+
self.timeContainer = createElement("div", "flatpickr-time");
|
|
1937
|
+
self.timeContainer.tabIndex = -1;
|
|
1938
|
+
var separator = createElement("span", "flatpickr-time-separator", ":");
|
|
1939
|
+
var hourInput = createNumberInput("flatpickr-hour", {
|
|
1940
|
+
"aria-label": self.l10n.hourAriaLabel,
|
|
1941
|
+
});
|
|
1942
|
+
self.hourElement = hourInput.getElementsByTagName("input")[0];
|
|
1943
|
+
var minuteInput = createNumberInput("flatpickr-minute", {
|
|
1944
|
+
"aria-label": self.l10n.minuteAriaLabel,
|
|
1945
|
+
});
|
|
1946
|
+
self.minuteElement = minuteInput.getElementsByTagName("input")[0];
|
|
1947
|
+
self.hourElement.tabIndex = self.minuteElement.tabIndex = -1;
|
|
1948
|
+
self.hourElement.value = pad(self.latestSelectedDateObj
|
|
1949
|
+
? self.latestSelectedDateObj.getHours()
|
|
1950
|
+
: self.config.time_24hr
|
|
1951
|
+
? defaults.hours
|
|
1952
|
+
: military2ampm(defaults.hours));
|
|
1953
|
+
self.minuteElement.value = pad(self.latestSelectedDateObj
|
|
1954
|
+
? self.latestSelectedDateObj.getMinutes()
|
|
1955
|
+
: defaults.minutes);
|
|
1956
|
+
self.hourElement.setAttribute("step", self.config.hourIncrement.toString());
|
|
1957
|
+
self.minuteElement.setAttribute("step", self.config.minuteIncrement.toString());
|
|
1958
|
+
self.hourElement.setAttribute("min", self.config.time_24hr ? "0" : "1");
|
|
1959
|
+
self.hourElement.setAttribute("max", self.config.time_24hr ? "23" : "12");
|
|
1960
|
+
self.hourElement.setAttribute("maxlength", "2");
|
|
1961
|
+
self.minuteElement.setAttribute("min", "0");
|
|
1962
|
+
self.minuteElement.setAttribute("max", "59");
|
|
1963
|
+
self.minuteElement.setAttribute("maxlength", "2");
|
|
1964
|
+
self.timeContainer.appendChild(hourInput);
|
|
1965
|
+
self.timeContainer.appendChild(separator);
|
|
1966
|
+
self.timeContainer.appendChild(minuteInput);
|
|
1967
|
+
if (self.config.time_24hr)
|
|
1968
|
+
self.timeContainer.classList.add("time24hr");
|
|
1969
|
+
if (self.config.enableSeconds) {
|
|
1970
|
+
self.timeContainer.classList.add("hasSeconds");
|
|
1971
|
+
var secondInput = createNumberInput("flatpickr-second");
|
|
1972
|
+
self.secondElement = secondInput.getElementsByTagName("input")[0];
|
|
1973
|
+
self.secondElement.value = pad(self.latestSelectedDateObj
|
|
1974
|
+
? self.latestSelectedDateObj.getSeconds()
|
|
1975
|
+
: defaults.seconds);
|
|
1976
|
+
self.secondElement.setAttribute("step", self.minuteElement.getAttribute("step"));
|
|
1977
|
+
self.secondElement.setAttribute("min", "0");
|
|
1978
|
+
self.secondElement.setAttribute("max", "59");
|
|
1979
|
+
self.secondElement.setAttribute("maxlength", "2");
|
|
1980
|
+
self.timeContainer.appendChild(createElement("span", "flatpickr-time-separator", ":"));
|
|
1981
|
+
self.timeContainer.appendChild(secondInput);
|
|
1982
|
+
}
|
|
1983
|
+
if (!self.config.time_24hr) {
|
|
1984
|
+
// add self.amPM if appropriate
|
|
1985
|
+
self.amPM = createElement("span", "flatpickr-am-pm", self.l10n.amPM[int((self.latestSelectedDateObj
|
|
1986
|
+
? self.hourElement.value
|
|
1987
|
+
: self.config.defaultHour) > 11)]);
|
|
1988
|
+
self.amPM.title = self.l10n.toggleTitle;
|
|
1989
|
+
self.amPM.tabIndex = -1;
|
|
1990
|
+
self.timeContainer.appendChild(self.amPM);
|
|
1991
|
+
}
|
|
1992
|
+
return self.timeContainer;
|
|
1993
|
+
}
|
|
1994
|
+
function buildWeekdays() {
|
|
1995
|
+
if (!self.weekdayContainer)
|
|
1996
|
+
self.weekdayContainer = createElement("div", "flatpickr-weekdays");
|
|
1997
|
+
else
|
|
1998
|
+
clearNode(self.weekdayContainer);
|
|
1999
|
+
for (var i = self.config.showMonths; i--;) {
|
|
2000
|
+
var container = createElement("div", "flatpickr-weekdaycontainer");
|
|
2001
|
+
self.weekdayContainer.appendChild(container);
|
|
2002
|
+
}
|
|
2003
|
+
updateWeekdays();
|
|
2004
|
+
return self.weekdayContainer;
|
|
2005
|
+
}
|
|
2006
|
+
function updateWeekdays() {
|
|
2007
|
+
if (!self.weekdayContainer) {
|
|
2008
|
+
return;
|
|
2009
|
+
}
|
|
2010
|
+
var firstDayOfWeek = self.l10n.firstDayOfWeek;
|
|
2011
|
+
var weekdays = __spreadArrays(self.l10n.weekdays.shorthand);
|
|
2012
|
+
if (firstDayOfWeek > 0 && firstDayOfWeek < weekdays.length) {
|
|
2013
|
+
weekdays = __spreadArrays(weekdays.splice(firstDayOfWeek, weekdays.length), weekdays.splice(0, firstDayOfWeek));
|
|
2014
|
+
}
|
|
2015
|
+
for (var i = self.config.showMonths; i--;) {
|
|
2016
|
+
self.weekdayContainer.children[i].innerHTML = "\n <span class='flatpickr-weekday'>\n " + weekdays.join("</span><span class='flatpickr-weekday'>") + "\n </span>\n ";
|
|
2017
|
+
}
|
|
2018
|
+
}
|
|
2019
|
+
/* istanbul ignore next */
|
|
2020
|
+
function buildWeeks() {
|
|
2021
|
+
self.calendarContainer.classList.add("hasWeeks");
|
|
2022
|
+
var weekWrapper = createElement("div", "flatpickr-weekwrapper");
|
|
2023
|
+
weekWrapper.appendChild(createElement("span", "flatpickr-weekday", self.l10n.weekAbbreviation));
|
|
2024
|
+
var weekNumbers = createElement("div", "flatpickr-weeks");
|
|
2025
|
+
weekWrapper.appendChild(weekNumbers);
|
|
2026
|
+
return {
|
|
2027
|
+
weekWrapper: weekWrapper,
|
|
2028
|
+
weekNumbers: weekNumbers,
|
|
2029
|
+
};
|
|
2030
|
+
}
|
|
2031
|
+
function changeMonth(value, isOffset) {
|
|
2032
|
+
if (isOffset === void 0) { isOffset = true; }
|
|
2033
|
+
var delta = isOffset ? value : value - self.currentMonth;
|
|
2034
|
+
if ((delta < 0 && self._hidePrevMonthArrow === true) ||
|
|
2035
|
+
(delta > 0 && self._hideNextMonthArrow === true))
|
|
2036
|
+
return;
|
|
2037
|
+
self.currentMonth += delta;
|
|
2038
|
+
if (self.currentMonth < 0 || self.currentMonth > 11) {
|
|
2039
|
+
self.currentYear += self.currentMonth > 11 ? 1 : -1;
|
|
2040
|
+
self.currentMonth = (self.currentMonth + 12) % 12;
|
|
2041
|
+
triggerEvent("onYearChange");
|
|
2042
|
+
buildMonthSwitch();
|
|
2043
|
+
}
|
|
2044
|
+
buildDays();
|
|
2045
|
+
triggerEvent("onMonthChange");
|
|
2046
|
+
updateNavigationCurrentMonth();
|
|
2047
|
+
}
|
|
2048
|
+
function clear(triggerChangeEvent, toInitial) {
|
|
2049
|
+
if (triggerChangeEvent === void 0) { triggerChangeEvent = true; }
|
|
2050
|
+
if (toInitial === void 0) { toInitial = true; }
|
|
2051
|
+
self.input.value = "";
|
|
2052
|
+
if (self.altInput !== undefined)
|
|
2053
|
+
self.altInput.value = "";
|
|
2054
|
+
if (self.mobileInput !== undefined)
|
|
2055
|
+
self.mobileInput.value = "";
|
|
2056
|
+
self.selectedDates = [];
|
|
2057
|
+
self.latestSelectedDateObj = undefined;
|
|
2058
|
+
if (toInitial === true) {
|
|
2059
|
+
self.currentYear = self._initialDate.getFullYear();
|
|
2060
|
+
self.currentMonth = self._initialDate.getMonth();
|
|
2061
|
+
}
|
|
2062
|
+
if (self.config.enableTime === true) {
|
|
2063
|
+
var _a = getDefaultHours(self.config), hours = _a.hours, minutes = _a.minutes, seconds = _a.seconds;
|
|
2064
|
+
setHours(hours, minutes, seconds);
|
|
2065
|
+
}
|
|
2066
|
+
self.redraw();
|
|
2067
|
+
if (triggerChangeEvent)
|
|
2068
|
+
// triggerChangeEvent is true (default) or an Event
|
|
2069
|
+
triggerEvent("onChange");
|
|
2070
|
+
}
|
|
2071
|
+
function close() {
|
|
2072
|
+
self.isOpen = false;
|
|
2073
|
+
if (!self.isMobile) {
|
|
2074
|
+
if (self.calendarContainer !== undefined) {
|
|
2075
|
+
self.calendarContainer.classList.remove("open");
|
|
2076
|
+
}
|
|
2077
|
+
if (self._input !== undefined) {
|
|
2078
|
+
self._input.classList.remove("active");
|
|
2079
|
+
}
|
|
2080
|
+
}
|
|
2081
|
+
triggerEvent("onClose");
|
|
2082
|
+
}
|
|
2083
|
+
function destroy() {
|
|
2084
|
+
if (self.config !== undefined)
|
|
2085
|
+
triggerEvent("onDestroy");
|
|
2086
|
+
for (var i = self._handlers.length; i--;) {
|
|
2087
|
+
self._handlers[i].remove();
|
|
2088
|
+
}
|
|
2089
|
+
self._handlers = [];
|
|
2090
|
+
if (self.mobileInput) {
|
|
2091
|
+
if (self.mobileInput.parentNode)
|
|
2092
|
+
self.mobileInput.parentNode.removeChild(self.mobileInput);
|
|
2093
|
+
self.mobileInput = undefined;
|
|
2094
|
+
}
|
|
2095
|
+
else if (self.calendarContainer && self.calendarContainer.parentNode) {
|
|
2096
|
+
if (self.config.static && self.calendarContainer.parentNode) {
|
|
2097
|
+
var wrapper = self.calendarContainer.parentNode;
|
|
2098
|
+
wrapper.lastChild && wrapper.removeChild(wrapper.lastChild);
|
|
2099
|
+
if (wrapper.parentNode) {
|
|
2100
|
+
while (wrapper.firstChild)
|
|
2101
|
+
wrapper.parentNode.insertBefore(wrapper.firstChild, wrapper);
|
|
2102
|
+
wrapper.parentNode.removeChild(wrapper);
|
|
2103
|
+
}
|
|
2104
|
+
}
|
|
2105
|
+
else
|
|
2106
|
+
self.calendarContainer.parentNode.removeChild(self.calendarContainer);
|
|
2107
|
+
}
|
|
2108
|
+
if (self.altInput) {
|
|
2109
|
+
self.input.type = "text";
|
|
2110
|
+
if (self.altInput.parentNode)
|
|
2111
|
+
self.altInput.parentNode.removeChild(self.altInput);
|
|
2112
|
+
delete self.altInput;
|
|
2113
|
+
}
|
|
2114
|
+
if (self.input) {
|
|
2115
|
+
self.input.type = self.input._type;
|
|
2116
|
+
self.input.classList.remove("flatpickr-input");
|
|
2117
|
+
self.input.removeAttribute("readonly");
|
|
2118
|
+
}
|
|
2119
|
+
[
|
|
2120
|
+
"_showTimeInput",
|
|
2121
|
+
"latestSelectedDateObj",
|
|
2122
|
+
"_hideNextMonthArrow",
|
|
2123
|
+
"_hidePrevMonthArrow",
|
|
2124
|
+
"__hideNextMonthArrow",
|
|
2125
|
+
"__hidePrevMonthArrow",
|
|
2126
|
+
"isMobile",
|
|
2127
|
+
"isOpen",
|
|
2128
|
+
"selectedDateElem",
|
|
2129
|
+
"minDateHasTime",
|
|
2130
|
+
"maxDateHasTime",
|
|
2131
|
+
"days",
|
|
2132
|
+
"daysContainer",
|
|
2133
|
+
"_input",
|
|
2134
|
+
"_positionElement",
|
|
2135
|
+
"innerContainer",
|
|
2136
|
+
"rContainer",
|
|
2137
|
+
"monthNav",
|
|
2138
|
+
"todayDateElem",
|
|
2139
|
+
"calendarContainer",
|
|
2140
|
+
"weekdayContainer",
|
|
2141
|
+
"prevMonthNav",
|
|
2142
|
+
"nextMonthNav",
|
|
2143
|
+
"monthsDropdownContainer",
|
|
2144
|
+
"currentMonthElement",
|
|
2145
|
+
"currentYearElement",
|
|
2146
|
+
"navigationCurrentMonth",
|
|
2147
|
+
"selectedDateElem",
|
|
2148
|
+
"config",
|
|
2149
|
+
].forEach(function (k) {
|
|
2150
|
+
try {
|
|
2151
|
+
delete self[k];
|
|
2152
|
+
}
|
|
2153
|
+
catch (_) { }
|
|
2154
|
+
});
|
|
2155
|
+
}
|
|
2156
|
+
function isCalendarElem(elem) {
|
|
2157
|
+
return self.calendarContainer.contains(elem);
|
|
2158
|
+
}
|
|
2159
|
+
function documentClick(e) {
|
|
2160
|
+
if (self.isOpen && !self.config.inline) {
|
|
2161
|
+
var eventTarget_1 = getEventTarget(e);
|
|
2162
|
+
var isCalendarElement = isCalendarElem(eventTarget_1);
|
|
2163
|
+
var isInput = eventTarget_1 === self.input ||
|
|
2164
|
+
eventTarget_1 === self.altInput ||
|
|
2165
|
+
self.element.contains(eventTarget_1) ||
|
|
2166
|
+
// web components
|
|
2167
|
+
// e.path is not present in all browsers. circumventing typechecks
|
|
2168
|
+
(e.path &&
|
|
2169
|
+
e.path.indexOf &&
|
|
2170
|
+
(~e.path.indexOf(self.input) ||
|
|
2171
|
+
~e.path.indexOf(self.altInput)));
|
|
2172
|
+
var lostFocus = !isInput &&
|
|
2173
|
+
!isCalendarElement &&
|
|
2174
|
+
!isCalendarElem(e.relatedTarget);
|
|
2175
|
+
var isIgnored = !self.config.ignoredFocusElements.some(function (elem) {
|
|
2176
|
+
return elem.contains(eventTarget_1);
|
|
2177
|
+
});
|
|
2178
|
+
if (lostFocus && isIgnored) {
|
|
2179
|
+
if (self.config.allowInput) {
|
|
2180
|
+
self.setDate(self._input.value, false, self.config.altInput
|
|
2181
|
+
? self.config.altFormat
|
|
2182
|
+
: self.config.dateFormat);
|
|
2183
|
+
}
|
|
2184
|
+
if (self.timeContainer !== undefined &&
|
|
2185
|
+
self.minuteElement !== undefined &&
|
|
2186
|
+
self.hourElement !== undefined &&
|
|
2187
|
+
self.input.value !== "" &&
|
|
2188
|
+
self.input.value !== undefined) {
|
|
2189
|
+
updateTime();
|
|
2190
|
+
}
|
|
2191
|
+
self.close();
|
|
2192
|
+
if (self.config &&
|
|
2193
|
+
self.config.mode === "range" &&
|
|
2194
|
+
self.selectedDates.length === 1)
|
|
2195
|
+
self.clear(false);
|
|
2196
|
+
}
|
|
2197
|
+
}
|
|
2198
|
+
}
|
|
2199
|
+
function changeYear(newYear) {
|
|
2200
|
+
if (!newYear ||
|
|
2201
|
+
(self.config.minDate && newYear < self.config.minDate.getFullYear()) ||
|
|
2202
|
+
(self.config.maxDate && newYear > self.config.maxDate.getFullYear()))
|
|
2203
|
+
return;
|
|
2204
|
+
var newYearNum = newYear, isNewYear = self.currentYear !== newYearNum;
|
|
2205
|
+
self.currentYear = newYearNum || self.currentYear;
|
|
2206
|
+
if (self.config.maxDate &&
|
|
2207
|
+
self.currentYear === self.config.maxDate.getFullYear()) {
|
|
2208
|
+
self.currentMonth = Math.min(self.config.maxDate.getMonth(), self.currentMonth);
|
|
2209
|
+
}
|
|
2210
|
+
else if (self.config.minDate &&
|
|
2211
|
+
self.currentYear === self.config.minDate.getFullYear()) {
|
|
2212
|
+
self.currentMonth = Math.max(self.config.minDate.getMonth(), self.currentMonth);
|
|
2213
|
+
}
|
|
2214
|
+
if (isNewYear) {
|
|
2215
|
+
self.redraw();
|
|
2216
|
+
triggerEvent("onYearChange");
|
|
2217
|
+
buildMonthSwitch();
|
|
2218
|
+
}
|
|
2219
|
+
}
|
|
2220
|
+
function isEnabled(date, timeless) {
|
|
2221
|
+
var _a;
|
|
2222
|
+
if (timeless === void 0) { timeless = true; }
|
|
2223
|
+
var dateToCheck = self.parseDate(date, undefined, timeless); // timeless
|
|
2224
|
+
if ((self.config.minDate &&
|
|
2225
|
+
dateToCheck &&
|
|
2226
|
+
compareDates(dateToCheck, self.config.minDate, timeless !== undefined ? timeless : !self.minDateHasTime) < 0) ||
|
|
2227
|
+
(self.config.maxDate &&
|
|
2228
|
+
dateToCheck &&
|
|
2229
|
+
compareDates(dateToCheck, self.config.maxDate, timeless !== undefined ? timeless : !self.maxDateHasTime) > 0))
|
|
2230
|
+
return false;
|
|
2231
|
+
if (!self.config.enable && self.config.disable.length === 0)
|
|
2232
|
+
return true;
|
|
2233
|
+
if (dateToCheck === undefined)
|
|
2234
|
+
return false;
|
|
2235
|
+
var bool = !!self.config.enable, array = (_a = self.config.enable) !== null && _a !== void 0 ? _a : self.config.disable;
|
|
2236
|
+
for (var i = 0, d = void 0; i < array.length; i++) {
|
|
2237
|
+
d = array[i];
|
|
2238
|
+
if (typeof d === "function" &&
|
|
2239
|
+
d(dateToCheck) // disabled by function
|
|
2240
|
+
)
|
|
2241
|
+
return bool;
|
|
2242
|
+
else if (d instanceof Date &&
|
|
2243
|
+
dateToCheck !== undefined &&
|
|
2244
|
+
d.getTime() === dateToCheck.getTime())
|
|
2245
|
+
// disabled by date
|
|
2246
|
+
return bool;
|
|
2247
|
+
else if (typeof d === "string") {
|
|
2248
|
+
// disabled by date string
|
|
2249
|
+
var parsed = self.parseDate(d, undefined, true);
|
|
2250
|
+
return parsed && parsed.getTime() === dateToCheck.getTime()
|
|
2251
|
+
? bool
|
|
2252
|
+
: !bool;
|
|
2253
|
+
}
|
|
2254
|
+
else if (
|
|
2255
|
+
// disabled by range
|
|
2256
|
+
typeof d === "object" &&
|
|
2257
|
+
dateToCheck !== undefined &&
|
|
2258
|
+
d.from &&
|
|
2259
|
+
d.to &&
|
|
2260
|
+
dateToCheck.getTime() >= d.from.getTime() &&
|
|
2261
|
+
dateToCheck.getTime() <= d.to.getTime())
|
|
2262
|
+
return bool;
|
|
2263
|
+
}
|
|
2264
|
+
return !bool;
|
|
2265
|
+
}
|
|
2266
|
+
function isInView(elem) {
|
|
2267
|
+
if (self.daysContainer !== undefined)
|
|
2268
|
+
return (elem.className.indexOf("hidden") === -1 &&
|
|
2269
|
+
elem.className.indexOf("flatpickr-disabled") === -1 &&
|
|
2270
|
+
self.daysContainer.contains(elem));
|
|
2271
|
+
return false;
|
|
2272
|
+
}
|
|
2273
|
+
function onBlur(e) {
|
|
2274
|
+
var isInput = e.target === self._input;
|
|
2275
|
+
var valueChanged = self._input.value.trimEnd() !== getDateStr();
|
|
2276
|
+
if (isInput &&
|
|
2277
|
+
valueChanged &&
|
|
2278
|
+
!(e.relatedTarget && isCalendarElem(e.relatedTarget))) {
|
|
2279
|
+
self.setDate(self._input.value, true, e.target === self.altInput
|
|
2280
|
+
? self.config.altFormat
|
|
2281
|
+
: self.config.dateFormat);
|
|
2282
|
+
}
|
|
2283
|
+
}
|
|
2284
|
+
function onKeyDown(e) {
|
|
2285
|
+
// e.key e.keyCode
|
|
2286
|
+
// "Backspace" 8
|
|
2287
|
+
// "Tab" 9
|
|
2288
|
+
// "Enter" 13
|
|
2289
|
+
// "Escape" (IE "Esc") 27
|
|
2290
|
+
// "ArrowLeft" (IE "Left") 37
|
|
2291
|
+
// "ArrowUp" (IE "Up") 38
|
|
2292
|
+
// "ArrowRight" (IE "Right") 39
|
|
2293
|
+
// "ArrowDown" (IE "Down") 40
|
|
2294
|
+
// "Delete" (IE "Del") 46
|
|
2295
|
+
var eventTarget = getEventTarget(e);
|
|
2296
|
+
var isInput = self.config.wrap
|
|
2297
|
+
? element.contains(eventTarget)
|
|
2298
|
+
: eventTarget === self._input;
|
|
2299
|
+
var allowInput = self.config.allowInput;
|
|
2300
|
+
var allowKeydown = self.isOpen && (!allowInput || !isInput);
|
|
2301
|
+
var allowInlineKeydown = self.config.inline && isInput && !allowInput;
|
|
2302
|
+
if (e.keyCode === 13 && isInput) {
|
|
2303
|
+
if (allowInput) {
|
|
2304
|
+
self.setDate(self._input.value, true, eventTarget === self.altInput
|
|
2305
|
+
? self.config.altFormat
|
|
2306
|
+
: self.config.dateFormat);
|
|
2307
|
+
self.close();
|
|
2308
|
+
return eventTarget.blur();
|
|
2309
|
+
}
|
|
2310
|
+
else {
|
|
2311
|
+
self.open();
|
|
2312
|
+
}
|
|
2313
|
+
}
|
|
2314
|
+
else if (isCalendarElem(eventTarget) ||
|
|
2315
|
+
allowKeydown ||
|
|
2316
|
+
allowInlineKeydown) {
|
|
2317
|
+
var isTimeObj = !!self.timeContainer &&
|
|
2318
|
+
self.timeContainer.contains(eventTarget);
|
|
2319
|
+
switch (e.keyCode) {
|
|
2320
|
+
case 13:
|
|
2321
|
+
if (isTimeObj) {
|
|
2322
|
+
e.preventDefault();
|
|
2323
|
+
updateTime();
|
|
2324
|
+
focusAndClose();
|
|
2325
|
+
}
|
|
2326
|
+
else
|
|
2327
|
+
selectDate(e);
|
|
2328
|
+
break;
|
|
2329
|
+
case 27: // escape
|
|
2330
|
+
e.preventDefault();
|
|
2331
|
+
focusAndClose();
|
|
2332
|
+
break;
|
|
2333
|
+
case 8:
|
|
2334
|
+
case 46:
|
|
2335
|
+
if (isInput && !self.config.allowInput) {
|
|
2336
|
+
e.preventDefault();
|
|
2337
|
+
self.clear();
|
|
2338
|
+
}
|
|
2339
|
+
break;
|
|
2340
|
+
case 37:
|
|
2341
|
+
case 39:
|
|
2342
|
+
if (!isTimeObj && !isInput) {
|
|
2343
|
+
e.preventDefault();
|
|
2344
|
+
var activeElement = getClosestActiveElement();
|
|
2345
|
+
if (self.daysContainer !== undefined &&
|
|
2346
|
+
(allowInput === false ||
|
|
2347
|
+
(activeElement && isInView(activeElement)))) {
|
|
2348
|
+
var delta_1 = e.keyCode === 39 ? 1 : -1;
|
|
2349
|
+
if (!e.ctrlKey)
|
|
2350
|
+
focusOnDay(undefined, delta_1);
|
|
2351
|
+
else {
|
|
2352
|
+
e.stopPropagation();
|
|
2353
|
+
changeMonth(delta_1);
|
|
2354
|
+
focusOnDay(getFirstAvailableDay(1), 0);
|
|
2355
|
+
}
|
|
2356
|
+
}
|
|
2357
|
+
}
|
|
2358
|
+
else if (self.hourElement)
|
|
2359
|
+
self.hourElement.focus();
|
|
2360
|
+
break;
|
|
2361
|
+
case 38:
|
|
2362
|
+
case 40:
|
|
2363
|
+
e.preventDefault();
|
|
2364
|
+
var delta = e.keyCode === 40 ? 1 : -1;
|
|
2365
|
+
if ((self.daysContainer &&
|
|
2366
|
+
eventTarget.$i !== undefined) ||
|
|
2367
|
+
eventTarget === self.input ||
|
|
2368
|
+
eventTarget === self.altInput) {
|
|
2369
|
+
if (e.ctrlKey) {
|
|
2370
|
+
e.stopPropagation();
|
|
2371
|
+
changeYear(self.currentYear - delta);
|
|
2372
|
+
focusOnDay(getFirstAvailableDay(1), 0);
|
|
2373
|
+
}
|
|
2374
|
+
else if (!isTimeObj)
|
|
2375
|
+
focusOnDay(undefined, delta * 7);
|
|
2376
|
+
}
|
|
2377
|
+
else if (eventTarget === self.currentYearElement) {
|
|
2378
|
+
changeYear(self.currentYear - delta);
|
|
2379
|
+
}
|
|
2380
|
+
else if (self.config.enableTime) {
|
|
2381
|
+
if (!isTimeObj && self.hourElement)
|
|
2382
|
+
self.hourElement.focus();
|
|
2383
|
+
updateTime(e);
|
|
2384
|
+
self._debouncedChange();
|
|
2385
|
+
}
|
|
2386
|
+
break;
|
|
2387
|
+
case 9:
|
|
2388
|
+
if (isTimeObj) {
|
|
2389
|
+
var elems = [
|
|
2390
|
+
self.hourElement,
|
|
2391
|
+
self.minuteElement,
|
|
2392
|
+
self.secondElement,
|
|
2393
|
+
self.amPM,
|
|
2394
|
+
]
|
|
2395
|
+
.concat(self.pluginElements)
|
|
2396
|
+
.filter(function (x) { return x; });
|
|
2397
|
+
var i = elems.indexOf(eventTarget);
|
|
2398
|
+
if (i !== -1) {
|
|
2399
|
+
var target = elems[i + (e.shiftKey ? -1 : 1)];
|
|
2400
|
+
e.preventDefault();
|
|
2401
|
+
(target || self._input).focus();
|
|
2402
|
+
}
|
|
2403
|
+
}
|
|
2404
|
+
else if (!self.config.noCalendar &&
|
|
2405
|
+
self.daysContainer &&
|
|
2406
|
+
self.daysContainer.contains(eventTarget) &&
|
|
2407
|
+
e.shiftKey) {
|
|
2408
|
+
e.preventDefault();
|
|
2409
|
+
self._input.focus();
|
|
2410
|
+
}
|
|
2411
|
+
break;
|
|
2412
|
+
}
|
|
2413
|
+
}
|
|
2414
|
+
if (self.amPM !== undefined && eventTarget === self.amPM) {
|
|
2415
|
+
switch (e.key) {
|
|
2416
|
+
case self.l10n.amPM[0].charAt(0):
|
|
2417
|
+
case self.l10n.amPM[0].charAt(0).toLowerCase():
|
|
2418
|
+
self.amPM.textContent = self.l10n.amPM[0];
|
|
2419
|
+
setHoursFromInputs();
|
|
2420
|
+
updateValue();
|
|
2421
|
+
break;
|
|
2422
|
+
case self.l10n.amPM[1].charAt(0):
|
|
2423
|
+
case self.l10n.amPM[1].charAt(0).toLowerCase():
|
|
2424
|
+
self.amPM.textContent = self.l10n.amPM[1];
|
|
2425
|
+
setHoursFromInputs();
|
|
2426
|
+
updateValue();
|
|
2427
|
+
break;
|
|
2428
|
+
}
|
|
2429
|
+
}
|
|
2430
|
+
if (isInput || isCalendarElem(eventTarget)) {
|
|
2431
|
+
triggerEvent("onKeyDown", e);
|
|
2432
|
+
}
|
|
2433
|
+
}
|
|
2434
|
+
function onMouseOver(elem, cellClass) {
|
|
2435
|
+
if (cellClass === void 0) { cellClass = "flatpickr-day"; }
|
|
2436
|
+
if (self.selectedDates.length !== 1 ||
|
|
2437
|
+
(elem &&
|
|
2438
|
+
(!elem.classList.contains(cellClass) ||
|
|
2439
|
+
elem.classList.contains("flatpickr-disabled"))))
|
|
2440
|
+
return;
|
|
2441
|
+
var hoverDate = elem
|
|
2442
|
+
? elem.dateObj.getTime()
|
|
2443
|
+
: self.days.firstElementChild.dateObj.getTime(), initialDate = self.parseDate(self.selectedDates[0], undefined, true).getTime(), rangeStartDate = Math.min(hoverDate, self.selectedDates[0].getTime()), rangeEndDate = Math.max(hoverDate, self.selectedDates[0].getTime());
|
|
2444
|
+
var containsDisabled = false;
|
|
2445
|
+
var minRange = 0, maxRange = 0;
|
|
2446
|
+
for (var t = rangeStartDate; t < rangeEndDate; t += duration.DAY) {
|
|
2447
|
+
if (!isEnabled(new Date(t), true)) {
|
|
2448
|
+
containsDisabled =
|
|
2449
|
+
containsDisabled || (t > rangeStartDate && t < rangeEndDate);
|
|
2450
|
+
if (t < initialDate && (!minRange || t > minRange))
|
|
2451
|
+
minRange = t;
|
|
2452
|
+
else if (t > initialDate && (!maxRange || t < maxRange))
|
|
2453
|
+
maxRange = t;
|
|
2454
|
+
}
|
|
2455
|
+
}
|
|
2456
|
+
var hoverableCells = Array.from(self.rContainer.querySelectorAll("*:nth-child(-n+" + self.config.showMonths + ") > ." + cellClass));
|
|
2457
|
+
hoverableCells.forEach(function (dayElem) {
|
|
2458
|
+
var date = dayElem.dateObj;
|
|
2459
|
+
var timestamp = date.getTime();
|
|
2460
|
+
var outOfRange = (minRange > 0 && timestamp < minRange) ||
|
|
2461
|
+
(maxRange > 0 && timestamp > maxRange);
|
|
2462
|
+
if (outOfRange) {
|
|
2463
|
+
dayElem.classList.add("notAllowed");
|
|
2464
|
+
["inRange", "startRange", "endRange"].forEach(function (c) {
|
|
2465
|
+
dayElem.classList.remove(c);
|
|
2466
|
+
});
|
|
2467
|
+
return;
|
|
2468
|
+
}
|
|
2469
|
+
else if (containsDisabled && !outOfRange)
|
|
2470
|
+
return;
|
|
2471
|
+
["startRange", "inRange", "endRange", "notAllowed"].forEach(function (c) {
|
|
2472
|
+
dayElem.classList.remove(c);
|
|
2473
|
+
});
|
|
2474
|
+
if (elem !== undefined) {
|
|
2475
|
+
elem.classList.add(hoverDate <= self.selectedDates[0].getTime()
|
|
2476
|
+
? "startRange"
|
|
2477
|
+
: "endRange");
|
|
2478
|
+
if (initialDate < hoverDate && timestamp === initialDate)
|
|
2479
|
+
dayElem.classList.add("startRange");
|
|
2480
|
+
else if (initialDate > hoverDate && timestamp === initialDate)
|
|
2481
|
+
dayElem.classList.add("endRange");
|
|
2482
|
+
if (timestamp >= minRange &&
|
|
2483
|
+
(maxRange === 0 || timestamp <= maxRange) &&
|
|
2484
|
+
isBetween(timestamp, initialDate, hoverDate))
|
|
2485
|
+
dayElem.classList.add("inRange");
|
|
2486
|
+
}
|
|
2487
|
+
});
|
|
2488
|
+
}
|
|
2489
|
+
function onResize() {
|
|
2490
|
+
if (self.isOpen && !self.config.static && !self.config.inline)
|
|
2491
|
+
positionCalendar();
|
|
2492
|
+
}
|
|
2493
|
+
function open(e, positionElement) {
|
|
2494
|
+
if (positionElement === void 0) { positionElement = self._positionElement; }
|
|
2495
|
+
if (self.isMobile === true) {
|
|
2496
|
+
if (e) {
|
|
2497
|
+
e.preventDefault();
|
|
2498
|
+
var eventTarget = getEventTarget(e);
|
|
2499
|
+
if (eventTarget) {
|
|
2500
|
+
eventTarget.blur();
|
|
2501
|
+
}
|
|
2502
|
+
}
|
|
2503
|
+
if (self.mobileInput !== undefined) {
|
|
2504
|
+
self.mobileInput.focus();
|
|
2505
|
+
self.mobileInput.click();
|
|
2506
|
+
}
|
|
2507
|
+
triggerEvent("onOpen");
|
|
2508
|
+
return;
|
|
2509
|
+
}
|
|
2510
|
+
else if (self._input.disabled || self.config.inline) {
|
|
2511
|
+
return;
|
|
2512
|
+
}
|
|
2513
|
+
var wasOpen = self.isOpen;
|
|
2514
|
+
self.isOpen = true;
|
|
2515
|
+
if (!wasOpen) {
|
|
2516
|
+
self.calendarContainer.classList.add("open");
|
|
2517
|
+
self._input.classList.add("active");
|
|
2518
|
+
triggerEvent("onOpen");
|
|
2519
|
+
positionCalendar(positionElement);
|
|
2520
|
+
}
|
|
2521
|
+
if (self.config.enableTime === true && self.config.noCalendar === true) {
|
|
2522
|
+
if (self.config.allowInput === false &&
|
|
2523
|
+
(e === undefined ||
|
|
2524
|
+
!self.timeContainer.contains(e.relatedTarget))) {
|
|
2525
|
+
setTimeout(function () { return self.hourElement.select(); }, 50);
|
|
2526
|
+
}
|
|
2527
|
+
}
|
|
2528
|
+
}
|
|
2529
|
+
function minMaxDateSetter(type) {
|
|
2530
|
+
return function (date) {
|
|
2531
|
+
var dateObj = (self.config["_" + type + "Date"] = self.parseDate(date, self.config.dateFormat));
|
|
2532
|
+
var inverseDateObj = self.config["_" + (type === "min" ? "max" : "min") + "Date"];
|
|
2533
|
+
if (dateObj !== undefined) {
|
|
2534
|
+
self[type === "min" ? "minDateHasTime" : "maxDateHasTime"] =
|
|
2535
|
+
dateObj.getHours() > 0 ||
|
|
2536
|
+
dateObj.getMinutes() > 0 ||
|
|
2537
|
+
dateObj.getSeconds() > 0;
|
|
2538
|
+
}
|
|
2539
|
+
if (self.selectedDates) {
|
|
2540
|
+
self.selectedDates = self.selectedDates.filter(function (d) { return isEnabled(d); });
|
|
2541
|
+
if (!self.selectedDates.length && type === "min")
|
|
2542
|
+
setHoursFromDate(dateObj);
|
|
2543
|
+
updateValue();
|
|
2544
|
+
}
|
|
2545
|
+
if (self.daysContainer) {
|
|
2546
|
+
redraw();
|
|
2547
|
+
if (dateObj !== undefined)
|
|
2548
|
+
self.currentYearElement[type] = dateObj.getFullYear().toString();
|
|
2549
|
+
else
|
|
2550
|
+
self.currentYearElement.removeAttribute(type);
|
|
2551
|
+
self.currentYearElement.disabled =
|
|
2552
|
+
!!inverseDateObj &&
|
|
2553
|
+
dateObj !== undefined &&
|
|
2554
|
+
inverseDateObj.getFullYear() === dateObj.getFullYear();
|
|
2555
|
+
}
|
|
2556
|
+
};
|
|
2557
|
+
}
|
|
2558
|
+
function parseConfig() {
|
|
2559
|
+
var boolOpts = [
|
|
2560
|
+
"wrap",
|
|
2561
|
+
"weekNumbers",
|
|
2562
|
+
"allowInput",
|
|
2563
|
+
"allowInvalidPreload",
|
|
2564
|
+
"clickOpens",
|
|
2565
|
+
"time_24hr",
|
|
2566
|
+
"enableTime",
|
|
2567
|
+
"noCalendar",
|
|
2568
|
+
"altInput",
|
|
2569
|
+
"shorthandCurrentMonth",
|
|
2570
|
+
"inline",
|
|
2571
|
+
"static",
|
|
2572
|
+
"enableSeconds",
|
|
2573
|
+
"disableMobile",
|
|
2574
|
+
];
|
|
2575
|
+
var userConfig = __assign(__assign({}, JSON.parse(JSON.stringify(element.dataset || {}))), instanceConfig);
|
|
2576
|
+
var formats = {};
|
|
2577
|
+
self.config.parseDate = userConfig.parseDate;
|
|
2578
|
+
self.config.formatDate = userConfig.formatDate;
|
|
2579
|
+
Object.defineProperty(self.config, "enable", {
|
|
2580
|
+
get: function () { return self.config._enable; },
|
|
2581
|
+
set: function (dates) {
|
|
2582
|
+
self.config._enable = parseDateRules(dates);
|
|
2583
|
+
},
|
|
2584
|
+
});
|
|
2585
|
+
Object.defineProperty(self.config, "disable", {
|
|
2586
|
+
get: function () { return self.config._disable; },
|
|
2587
|
+
set: function (dates) {
|
|
2588
|
+
self.config._disable = parseDateRules(dates);
|
|
2589
|
+
},
|
|
2590
|
+
});
|
|
2591
|
+
var timeMode = userConfig.mode === "time";
|
|
2592
|
+
if (!userConfig.dateFormat && (userConfig.enableTime || timeMode)) {
|
|
2593
|
+
var defaultDateFormat = flatpickr.defaultConfig.dateFormat || defaults.dateFormat;
|
|
2594
|
+
formats.dateFormat =
|
|
2595
|
+
userConfig.noCalendar || timeMode
|
|
2596
|
+
? "H:i" + (userConfig.enableSeconds ? ":S" : "")
|
|
2597
|
+
: defaultDateFormat + " H:i" + (userConfig.enableSeconds ? ":S" : "");
|
|
2598
|
+
}
|
|
2599
|
+
if (userConfig.altInput &&
|
|
2600
|
+
(userConfig.enableTime || timeMode) &&
|
|
2601
|
+
!userConfig.altFormat) {
|
|
2602
|
+
var defaultAltFormat = flatpickr.defaultConfig.altFormat || defaults.altFormat;
|
|
2603
|
+
formats.altFormat =
|
|
2604
|
+
userConfig.noCalendar || timeMode
|
|
2605
|
+
? "h:i" + (userConfig.enableSeconds ? ":S K" : " K")
|
|
2606
|
+
: defaultAltFormat + (" h:i" + (userConfig.enableSeconds ? ":S" : "") + " K");
|
|
2607
|
+
}
|
|
2608
|
+
Object.defineProperty(self.config, "minDate", {
|
|
2609
|
+
get: function () { return self.config._minDate; },
|
|
2610
|
+
set: minMaxDateSetter("min"),
|
|
2611
|
+
});
|
|
2612
|
+
Object.defineProperty(self.config, "maxDate", {
|
|
2613
|
+
get: function () { return self.config._maxDate; },
|
|
2614
|
+
set: minMaxDateSetter("max"),
|
|
2615
|
+
});
|
|
2616
|
+
var minMaxTimeSetter = function (type) { return function (val) {
|
|
2617
|
+
self.config[type === "min" ? "_minTime" : "_maxTime"] = self.parseDate(val, "H:i:S");
|
|
2618
|
+
}; };
|
|
2619
|
+
Object.defineProperty(self.config, "minTime", {
|
|
2620
|
+
get: function () { return self.config._minTime; },
|
|
2621
|
+
set: minMaxTimeSetter("min"),
|
|
2622
|
+
});
|
|
2623
|
+
Object.defineProperty(self.config, "maxTime", {
|
|
2624
|
+
get: function () { return self.config._maxTime; },
|
|
2625
|
+
set: minMaxTimeSetter("max"),
|
|
2626
|
+
});
|
|
2627
|
+
if (userConfig.mode === "time") {
|
|
2628
|
+
self.config.noCalendar = true;
|
|
2629
|
+
self.config.enableTime = true;
|
|
2630
|
+
}
|
|
2631
|
+
Object.assign(self.config, formats, userConfig);
|
|
2632
|
+
for (var i = 0; i < boolOpts.length; i++)
|
|
2633
|
+
// https://github.com/microsoft/TypeScript/issues/31663
|
|
2634
|
+
self.config[boolOpts[i]] =
|
|
2635
|
+
self.config[boolOpts[i]] === true ||
|
|
2636
|
+
self.config[boolOpts[i]] === "true";
|
|
2637
|
+
HOOKS.filter(function (hook) { return self.config[hook] !== undefined; }).forEach(function (hook) {
|
|
2638
|
+
self.config[hook] = arrayify(self.config[hook] || []).map(bindToInstance);
|
|
2639
|
+
});
|
|
2640
|
+
self.isMobile =
|
|
2641
|
+
!self.config.disableMobile &&
|
|
2642
|
+
!self.config.inline &&
|
|
2643
|
+
self.config.mode === "single" &&
|
|
2644
|
+
!self.config.disable.length &&
|
|
2645
|
+
!self.config.enable &&
|
|
2646
|
+
!self.config.weekNumbers &&
|
|
2647
|
+
/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);
|
|
2648
|
+
for (var i = 0; i < self.config.plugins.length; i++) {
|
|
2649
|
+
var pluginConf = self.config.plugins[i](self) || {};
|
|
2650
|
+
for (var key in pluginConf) {
|
|
2651
|
+
if (HOOKS.indexOf(key) > -1) {
|
|
2652
|
+
self.config[key] = arrayify(pluginConf[key])
|
|
2653
|
+
.map(bindToInstance)
|
|
2654
|
+
.concat(self.config[key]);
|
|
2655
|
+
}
|
|
2656
|
+
else if (typeof userConfig[key] === "undefined")
|
|
2657
|
+
self.config[key] = pluginConf[key];
|
|
2658
|
+
}
|
|
2659
|
+
}
|
|
2660
|
+
if (!userConfig.altInputClass) {
|
|
2661
|
+
self.config.altInputClass =
|
|
2662
|
+
getInputElem().className + " " + self.config.altInputClass;
|
|
2663
|
+
}
|
|
2664
|
+
triggerEvent("onParseConfig");
|
|
2665
|
+
}
|
|
2666
|
+
function getInputElem() {
|
|
2667
|
+
return self.config.wrap
|
|
2668
|
+
? element.querySelector("[data-input]")
|
|
2669
|
+
: element;
|
|
2670
|
+
}
|
|
2671
|
+
function setupLocale() {
|
|
2672
|
+
if (typeof self.config.locale !== "object" &&
|
|
2673
|
+
typeof flatpickr.l10ns[self.config.locale] === "undefined")
|
|
2674
|
+
self.config.errorHandler(new Error("flatpickr: invalid locale " + self.config.locale));
|
|
2675
|
+
self.l10n = __assign(__assign({}, flatpickr.l10ns.default), (typeof self.config.locale === "object"
|
|
2676
|
+
? self.config.locale
|
|
2677
|
+
: self.config.locale !== "default"
|
|
2678
|
+
? flatpickr.l10ns[self.config.locale]
|
|
2679
|
+
: undefined));
|
|
2680
|
+
tokenRegex.D = "(" + self.l10n.weekdays.shorthand.join("|") + ")";
|
|
2681
|
+
tokenRegex.l = "(" + self.l10n.weekdays.longhand.join("|") + ")";
|
|
2682
|
+
tokenRegex.M = "(" + self.l10n.months.shorthand.join("|") + ")";
|
|
2683
|
+
tokenRegex.F = "(" + self.l10n.months.longhand.join("|") + ")";
|
|
2684
|
+
tokenRegex.K = "(" + self.l10n.amPM[0] + "|" + self.l10n.amPM[1] + "|" + self.l10n.amPM[0].toLowerCase() + "|" + self.l10n.amPM[1].toLowerCase() + ")";
|
|
2685
|
+
var userConfig = __assign(__assign({}, instanceConfig), JSON.parse(JSON.stringify(element.dataset || {})));
|
|
2686
|
+
if (userConfig.time_24hr === undefined &&
|
|
2687
|
+
flatpickr.defaultConfig.time_24hr === undefined) {
|
|
2688
|
+
self.config.time_24hr = self.l10n.time_24hr;
|
|
2689
|
+
}
|
|
2690
|
+
self.formatDate = createDateFormatter(self);
|
|
2691
|
+
self.parseDate = createDateParser({ config: self.config, l10n: self.l10n });
|
|
2692
|
+
}
|
|
2693
|
+
function positionCalendar(customPositionElement) {
|
|
2694
|
+
if (typeof self.config.position === "function") {
|
|
2695
|
+
return void self.config.position(self, customPositionElement);
|
|
2696
|
+
}
|
|
2697
|
+
if (self.calendarContainer === undefined)
|
|
2698
|
+
return;
|
|
2699
|
+
triggerEvent("onPreCalendarPosition");
|
|
2700
|
+
var positionElement = customPositionElement || self._positionElement;
|
|
2701
|
+
var calendarHeight = Array.prototype.reduce.call(self.calendarContainer.children, (function (acc, child) { return acc + child.offsetHeight; }), 0), calendarWidth = self.calendarContainer.offsetWidth, configPos = self.config.position.split(" "), configPosVertical = configPos[0], configPosHorizontal = configPos.length > 1 ? configPos[1] : null, inputBounds = positionElement.getBoundingClientRect(), distanceFromBottom = window.innerHeight - inputBounds.bottom, showOnTop = configPosVertical === "above" ||
|
|
2702
|
+
(configPosVertical !== "below" &&
|
|
2703
|
+
distanceFromBottom < calendarHeight &&
|
|
2704
|
+
inputBounds.top > calendarHeight);
|
|
2705
|
+
var top = window.pageYOffset +
|
|
2706
|
+
inputBounds.top +
|
|
2707
|
+
(!showOnTop ? positionElement.offsetHeight + 2 : -calendarHeight - 2);
|
|
2708
|
+
toggleClass(self.calendarContainer, "arrowTop", !showOnTop);
|
|
2709
|
+
toggleClass(self.calendarContainer, "arrowBottom", showOnTop);
|
|
2710
|
+
if (self.config.inline)
|
|
2711
|
+
return;
|
|
2712
|
+
var left = window.pageXOffset + inputBounds.left;
|
|
2713
|
+
var isCenter = false;
|
|
2714
|
+
var isRight = false;
|
|
2715
|
+
if (configPosHorizontal === "center") {
|
|
2716
|
+
left -= (calendarWidth - inputBounds.width) / 2;
|
|
2717
|
+
isCenter = true;
|
|
2718
|
+
}
|
|
2719
|
+
else if (configPosHorizontal === "right") {
|
|
2720
|
+
left -= calendarWidth - inputBounds.width;
|
|
2721
|
+
isRight = true;
|
|
2722
|
+
}
|
|
2723
|
+
toggleClass(self.calendarContainer, "arrowLeft", !isCenter && !isRight);
|
|
2724
|
+
toggleClass(self.calendarContainer, "arrowCenter", isCenter);
|
|
2725
|
+
toggleClass(self.calendarContainer, "arrowRight", isRight);
|
|
2726
|
+
var right = window.document.body.offsetWidth -
|
|
2727
|
+
(window.pageXOffset + inputBounds.right);
|
|
2728
|
+
var rightMost = left + calendarWidth > window.document.body.offsetWidth;
|
|
2729
|
+
var centerMost = right + calendarWidth > window.document.body.offsetWidth;
|
|
2730
|
+
toggleClass(self.calendarContainer, "rightMost", rightMost);
|
|
2731
|
+
if (self.config.static)
|
|
2732
|
+
return;
|
|
2733
|
+
self.calendarContainer.style.top = top + "px";
|
|
2734
|
+
if (!rightMost) {
|
|
2735
|
+
self.calendarContainer.style.left = left + "px";
|
|
2736
|
+
self.calendarContainer.style.right = "auto";
|
|
2737
|
+
}
|
|
2738
|
+
else if (!centerMost) {
|
|
2739
|
+
self.calendarContainer.style.left = "auto";
|
|
2740
|
+
self.calendarContainer.style.right = right + "px";
|
|
2741
|
+
}
|
|
2742
|
+
else {
|
|
2743
|
+
var doc = getDocumentStyleSheet();
|
|
2744
|
+
// some testing environments don't have css support
|
|
2745
|
+
if (doc === undefined)
|
|
2746
|
+
return;
|
|
2747
|
+
var bodyWidth = window.document.body.offsetWidth;
|
|
2748
|
+
var centerLeft = Math.max(0, bodyWidth / 2 - calendarWidth / 2);
|
|
2749
|
+
var centerBefore = ".flatpickr-calendar.centerMost:before";
|
|
2750
|
+
var centerAfter = ".flatpickr-calendar.centerMost:after";
|
|
2751
|
+
var centerIndex = doc.cssRules.length;
|
|
2752
|
+
var centerStyle = "{left:" + inputBounds.left + "px;right:auto;}";
|
|
2753
|
+
toggleClass(self.calendarContainer, "rightMost", false);
|
|
2754
|
+
toggleClass(self.calendarContainer, "centerMost", true);
|
|
2755
|
+
doc.insertRule(centerBefore + "," + centerAfter + centerStyle, centerIndex);
|
|
2756
|
+
self.calendarContainer.style.left = centerLeft + "px";
|
|
2757
|
+
self.calendarContainer.style.right = "auto";
|
|
2758
|
+
}
|
|
2759
|
+
}
|
|
2760
|
+
function getDocumentStyleSheet() {
|
|
2761
|
+
var editableSheet = null;
|
|
2762
|
+
for (var i = 0; i < document.styleSheets.length; i++) {
|
|
2763
|
+
var sheet = document.styleSheets[i];
|
|
2764
|
+
if (!sheet.cssRules)
|
|
2765
|
+
continue;
|
|
2766
|
+
try {
|
|
2767
|
+
sheet.cssRules;
|
|
2768
|
+
}
|
|
2769
|
+
catch (err) {
|
|
2770
|
+
continue;
|
|
2771
|
+
}
|
|
2772
|
+
editableSheet = sheet;
|
|
2773
|
+
break;
|
|
2774
|
+
}
|
|
2775
|
+
return editableSheet != null ? editableSheet : createStyleSheet();
|
|
2776
|
+
}
|
|
2777
|
+
function createStyleSheet() {
|
|
2778
|
+
var style = document.createElement("style");
|
|
2779
|
+
document.head.appendChild(style);
|
|
2780
|
+
return style.sheet;
|
|
2781
|
+
}
|
|
2782
|
+
function redraw() {
|
|
2783
|
+
if (self.config.noCalendar || self.isMobile)
|
|
2784
|
+
return;
|
|
2785
|
+
buildMonthSwitch();
|
|
2786
|
+
updateNavigationCurrentMonth();
|
|
2787
|
+
buildDays();
|
|
2788
|
+
}
|
|
2789
|
+
function focusAndClose() {
|
|
2790
|
+
self._input.focus();
|
|
2791
|
+
if (window.navigator.userAgent.indexOf("MSIE") !== -1 ||
|
|
2792
|
+
navigator.msMaxTouchPoints !== undefined) {
|
|
2793
|
+
// hack - bugs in the way IE handles focus keeps the calendar open
|
|
2794
|
+
setTimeout(self.close, 0);
|
|
2795
|
+
}
|
|
2796
|
+
else {
|
|
2797
|
+
self.close();
|
|
2798
|
+
}
|
|
2799
|
+
}
|
|
2800
|
+
function selectDate(e) {
|
|
2801
|
+
e.preventDefault();
|
|
2802
|
+
e.stopPropagation();
|
|
2803
|
+
var isSelectable = function (day) {
|
|
2804
|
+
return day.classList &&
|
|
2805
|
+
day.classList.contains("flatpickr-day") &&
|
|
2806
|
+
!day.classList.contains("flatpickr-disabled") &&
|
|
2807
|
+
!day.classList.contains("notAllowed");
|
|
2808
|
+
};
|
|
2809
|
+
var t = findParent(getEventTarget(e), isSelectable);
|
|
2810
|
+
if (t === undefined)
|
|
2811
|
+
return;
|
|
2812
|
+
var target = t;
|
|
2813
|
+
var selectedDate = (self.latestSelectedDateObj = new Date(target.dateObj.getTime()));
|
|
2814
|
+
var shouldChangeMonth = (selectedDate.getMonth() < self.currentMonth ||
|
|
2815
|
+
selectedDate.getMonth() >
|
|
2816
|
+
self.currentMonth + self.config.showMonths - 1) &&
|
|
2817
|
+
self.config.mode !== "range";
|
|
2818
|
+
self.selectedDateElem = target;
|
|
2819
|
+
if (self.config.mode === "single")
|
|
2820
|
+
self.selectedDates = [selectedDate];
|
|
2821
|
+
else if (self.config.mode === "multiple") {
|
|
2822
|
+
var selectedIndex = isDateSelected(selectedDate);
|
|
2823
|
+
if (selectedIndex)
|
|
2824
|
+
self.selectedDates.splice(parseInt(selectedIndex), 1);
|
|
2825
|
+
else
|
|
2826
|
+
self.selectedDates.push(selectedDate);
|
|
2827
|
+
}
|
|
2828
|
+
else if (self.config.mode === "range") {
|
|
2829
|
+
if (self.selectedDates.length === 2) {
|
|
2830
|
+
self.clear(false, false);
|
|
2831
|
+
}
|
|
2832
|
+
self.latestSelectedDateObj = selectedDate;
|
|
2833
|
+
self.selectedDates.push(selectedDate);
|
|
2834
|
+
// unless selecting same date twice, sort ascendingly
|
|
2835
|
+
if (compareDates(selectedDate, self.selectedDates[0], true) !== 0)
|
|
2836
|
+
self.selectedDates.sort(function (a, b) { return a.getTime() - b.getTime(); });
|
|
2837
|
+
}
|
|
2838
|
+
setHoursFromInputs();
|
|
2839
|
+
if (shouldChangeMonth) {
|
|
2840
|
+
var isNewYear = self.currentYear !== selectedDate.getFullYear();
|
|
2841
|
+
self.currentYear = selectedDate.getFullYear();
|
|
2842
|
+
self.currentMonth = selectedDate.getMonth();
|
|
2843
|
+
if (isNewYear) {
|
|
2844
|
+
triggerEvent("onYearChange");
|
|
2845
|
+
buildMonthSwitch();
|
|
2846
|
+
}
|
|
2847
|
+
triggerEvent("onMonthChange");
|
|
2848
|
+
}
|
|
2849
|
+
updateNavigationCurrentMonth();
|
|
2850
|
+
buildDays();
|
|
2851
|
+
updateValue();
|
|
2852
|
+
// maintain focus
|
|
2853
|
+
if (!shouldChangeMonth &&
|
|
2854
|
+
self.config.mode !== "range" &&
|
|
2855
|
+
self.config.showMonths === 1)
|
|
2856
|
+
focusOnDayElem(target);
|
|
2857
|
+
else if (self.selectedDateElem !== undefined &&
|
|
2858
|
+
self.hourElement === undefined) {
|
|
2859
|
+
self.selectedDateElem && self.selectedDateElem.focus();
|
|
2860
|
+
}
|
|
2861
|
+
if (self.hourElement !== undefined)
|
|
2862
|
+
self.hourElement !== undefined && self.hourElement.focus();
|
|
2863
|
+
if (self.config.closeOnSelect) {
|
|
2864
|
+
var single = self.config.mode === "single" && !self.config.enableTime;
|
|
2865
|
+
var range = self.config.mode === "range" &&
|
|
2866
|
+
self.selectedDates.length === 2 &&
|
|
2867
|
+
!self.config.enableTime;
|
|
2868
|
+
if (single || range) {
|
|
2869
|
+
focusAndClose();
|
|
2870
|
+
}
|
|
2871
|
+
}
|
|
2872
|
+
triggerChange();
|
|
2873
|
+
}
|
|
2874
|
+
var CALLBACKS = {
|
|
2875
|
+
locale: [setupLocale, updateWeekdays],
|
|
2876
|
+
showMonths: [buildMonths, setCalendarWidth, buildWeekdays],
|
|
2877
|
+
minDate: [jumpToDate],
|
|
2878
|
+
maxDate: [jumpToDate],
|
|
2879
|
+
positionElement: [updatePositionElement],
|
|
2880
|
+
clickOpens: [
|
|
2881
|
+
function () {
|
|
2882
|
+
if (self.config.clickOpens === true) {
|
|
2883
|
+
bind(self._input, "focus", self.open);
|
|
2884
|
+
bind(self._input, "click", self.open);
|
|
2885
|
+
}
|
|
2886
|
+
else {
|
|
2887
|
+
self._input.removeEventListener("focus", self.open);
|
|
2888
|
+
self._input.removeEventListener("click", self.open);
|
|
2889
|
+
}
|
|
2890
|
+
},
|
|
2891
|
+
],
|
|
2892
|
+
};
|
|
2893
|
+
function set(option, value) {
|
|
2894
|
+
if (option !== null && typeof option === "object") {
|
|
2895
|
+
Object.assign(self.config, option);
|
|
2896
|
+
for (var key in option) {
|
|
2897
|
+
if (CALLBACKS[key] !== undefined)
|
|
2898
|
+
CALLBACKS[key].forEach(function (x) { return x(); });
|
|
2899
|
+
}
|
|
2900
|
+
}
|
|
2901
|
+
else {
|
|
2902
|
+
self.config[option] = value;
|
|
2903
|
+
if (CALLBACKS[option] !== undefined)
|
|
2904
|
+
CALLBACKS[option].forEach(function (x) { return x(); });
|
|
2905
|
+
else if (HOOKS.indexOf(option) > -1)
|
|
2906
|
+
self.config[option] = arrayify(value);
|
|
2907
|
+
}
|
|
2908
|
+
self.redraw();
|
|
2909
|
+
updateValue(true);
|
|
2910
|
+
}
|
|
2911
|
+
function setSelectedDate(inputDate, format) {
|
|
2912
|
+
var dates = [];
|
|
2913
|
+
if (inputDate instanceof Array)
|
|
2914
|
+
dates = inputDate.map(function (d) { return self.parseDate(d, format); });
|
|
2915
|
+
else if (inputDate instanceof Date || typeof inputDate === "number")
|
|
2916
|
+
dates = [self.parseDate(inputDate, format)];
|
|
2917
|
+
else if (typeof inputDate === "string") {
|
|
2918
|
+
switch (self.config.mode) {
|
|
2919
|
+
case "single":
|
|
2920
|
+
case "time":
|
|
2921
|
+
dates = [self.parseDate(inputDate, format)];
|
|
2922
|
+
break;
|
|
2923
|
+
case "multiple":
|
|
2924
|
+
dates = inputDate
|
|
2925
|
+
.split(self.config.conjunction)
|
|
2926
|
+
.map(function (date) { return self.parseDate(date, format); });
|
|
2927
|
+
break;
|
|
2928
|
+
case "range":
|
|
2929
|
+
dates = inputDate
|
|
2930
|
+
.split(self.l10n.rangeSeparator)
|
|
2931
|
+
.map(function (date) { return self.parseDate(date, format); });
|
|
2932
|
+
break;
|
|
2933
|
+
}
|
|
2934
|
+
}
|
|
2935
|
+
else
|
|
2936
|
+
self.config.errorHandler(new Error("Invalid date supplied: " + JSON.stringify(inputDate)));
|
|
2937
|
+
self.selectedDates = (self.config.allowInvalidPreload
|
|
2938
|
+
? dates
|
|
2939
|
+
: dates.filter(function (d) { return d instanceof Date && isEnabled(d, false); }));
|
|
2940
|
+
if (self.config.mode === "range")
|
|
2941
|
+
self.selectedDates.sort(function (a, b) { return a.getTime() - b.getTime(); });
|
|
2942
|
+
}
|
|
2943
|
+
function setDate(date, triggerChange, format) {
|
|
2944
|
+
if (triggerChange === void 0) { triggerChange = false; }
|
|
2945
|
+
if (format === void 0) { format = self.config.dateFormat; }
|
|
2946
|
+
if ((date !== 0 && !date) || (date instanceof Array && date.length === 0))
|
|
2947
|
+
return self.clear(triggerChange);
|
|
2948
|
+
setSelectedDate(date, format);
|
|
2949
|
+
self.latestSelectedDateObj =
|
|
2950
|
+
self.selectedDates[self.selectedDates.length - 1];
|
|
2951
|
+
self.redraw();
|
|
2952
|
+
jumpToDate(undefined, triggerChange);
|
|
2953
|
+
setHoursFromDate();
|
|
2954
|
+
if (self.selectedDates.length === 0) {
|
|
2955
|
+
self.clear(false);
|
|
2956
|
+
}
|
|
2957
|
+
updateValue(triggerChange);
|
|
2958
|
+
if (triggerChange)
|
|
2959
|
+
triggerEvent("onChange");
|
|
2960
|
+
}
|
|
2961
|
+
function parseDateRules(arr) {
|
|
2962
|
+
return arr
|
|
2963
|
+
.slice()
|
|
2964
|
+
.map(function (rule) {
|
|
2965
|
+
if (typeof rule === "string" ||
|
|
2966
|
+
typeof rule === "number" ||
|
|
2967
|
+
rule instanceof Date) {
|
|
2968
|
+
return self.parseDate(rule, undefined, true);
|
|
2969
|
+
}
|
|
2970
|
+
else if (rule &&
|
|
2971
|
+
typeof rule === "object" &&
|
|
2972
|
+
rule.from &&
|
|
2973
|
+
rule.to)
|
|
2974
|
+
return {
|
|
2975
|
+
from: self.parseDate(rule.from, undefined),
|
|
2976
|
+
to: self.parseDate(rule.to, undefined),
|
|
2977
|
+
};
|
|
2978
|
+
return rule;
|
|
2979
|
+
})
|
|
2980
|
+
.filter(function (x) { return x; }); // remove falsy values
|
|
2981
|
+
}
|
|
2982
|
+
function setupDates() {
|
|
2983
|
+
self.selectedDates = [];
|
|
2984
|
+
self.now = self.parseDate(self.config.now) || new Date();
|
|
2985
|
+
// Workaround IE11 setting placeholder as the input's value
|
|
2986
|
+
var preloadedDate = self.config.defaultDate ||
|
|
2987
|
+
((self.input.nodeName === "INPUT" ||
|
|
2988
|
+
self.input.nodeName === "TEXTAREA") &&
|
|
2989
|
+
self.input.placeholder &&
|
|
2990
|
+
self.input.value === self.input.placeholder
|
|
2991
|
+
? null
|
|
2992
|
+
: self.input.value);
|
|
2993
|
+
if (preloadedDate)
|
|
2994
|
+
setSelectedDate(preloadedDate, self.config.dateFormat);
|
|
2995
|
+
self._initialDate =
|
|
2996
|
+
self.selectedDates.length > 0
|
|
2997
|
+
? self.selectedDates[0]
|
|
2998
|
+
: self.config.minDate &&
|
|
2999
|
+
self.config.minDate.getTime() > self.now.getTime()
|
|
3000
|
+
? self.config.minDate
|
|
3001
|
+
: self.config.maxDate &&
|
|
3002
|
+
self.config.maxDate.getTime() < self.now.getTime()
|
|
3003
|
+
? self.config.maxDate
|
|
3004
|
+
: self.now;
|
|
3005
|
+
self.currentYear = self._initialDate.getFullYear();
|
|
3006
|
+
self.currentMonth = self._initialDate.getMonth();
|
|
3007
|
+
if (self.selectedDates.length > 0)
|
|
3008
|
+
self.latestSelectedDateObj = self.selectedDates[0];
|
|
3009
|
+
if (self.config.minTime !== undefined)
|
|
3010
|
+
self.config.minTime = self.parseDate(self.config.minTime, "H:i");
|
|
3011
|
+
if (self.config.maxTime !== undefined)
|
|
3012
|
+
self.config.maxTime = self.parseDate(self.config.maxTime, "H:i");
|
|
3013
|
+
self.minDateHasTime =
|
|
3014
|
+
!!self.config.minDate &&
|
|
3015
|
+
(self.config.minDate.getHours() > 0 ||
|
|
3016
|
+
self.config.minDate.getMinutes() > 0 ||
|
|
3017
|
+
self.config.minDate.getSeconds() > 0);
|
|
3018
|
+
self.maxDateHasTime =
|
|
3019
|
+
!!self.config.maxDate &&
|
|
3020
|
+
(self.config.maxDate.getHours() > 0 ||
|
|
3021
|
+
self.config.maxDate.getMinutes() > 0 ||
|
|
3022
|
+
self.config.maxDate.getSeconds() > 0);
|
|
3023
|
+
}
|
|
3024
|
+
function setupInputs() {
|
|
3025
|
+
self.input = getInputElem();
|
|
3026
|
+
/* istanbul ignore next */
|
|
3027
|
+
if (!self.input) {
|
|
3028
|
+
self.config.errorHandler(new Error("Invalid input element specified"));
|
|
3029
|
+
return;
|
|
3030
|
+
}
|
|
3031
|
+
// hack: store previous type to restore it after destroy()
|
|
3032
|
+
self.input._type = self.input.type;
|
|
3033
|
+
self.input.type = "text";
|
|
3034
|
+
self.input.classList.add("flatpickr-input");
|
|
3035
|
+
self._input = self.input;
|
|
3036
|
+
if (self.config.altInput) {
|
|
3037
|
+
// replicate self.element
|
|
3038
|
+
self.altInput = createElement(self.input.nodeName, self.config.altInputClass);
|
|
3039
|
+
self._input = self.altInput;
|
|
3040
|
+
self.altInput.placeholder = self.input.placeholder;
|
|
3041
|
+
self.altInput.disabled = self.input.disabled;
|
|
3042
|
+
self.altInput.required = self.input.required;
|
|
3043
|
+
self.altInput.tabIndex = self.input.tabIndex;
|
|
3044
|
+
self.altInput.type = "text";
|
|
3045
|
+
self.input.setAttribute("type", "hidden");
|
|
3046
|
+
if (!self.config.static && self.input.parentNode)
|
|
3047
|
+
self.input.parentNode.insertBefore(self.altInput, self.input.nextSibling);
|
|
3048
|
+
}
|
|
3049
|
+
if (!self.config.allowInput)
|
|
3050
|
+
self._input.setAttribute("readonly", "readonly");
|
|
3051
|
+
updatePositionElement();
|
|
3052
|
+
}
|
|
3053
|
+
function updatePositionElement() {
|
|
3054
|
+
self._positionElement = self.config.positionElement || self._input;
|
|
3055
|
+
}
|
|
3056
|
+
function setupMobile() {
|
|
3057
|
+
var inputType = self.config.enableTime
|
|
3058
|
+
? self.config.noCalendar
|
|
3059
|
+
? "time"
|
|
3060
|
+
: "datetime-local"
|
|
3061
|
+
: "date";
|
|
3062
|
+
self.mobileInput = createElement("input", self.input.className + " flatpickr-mobile");
|
|
3063
|
+
self.mobileInput.tabIndex = 1;
|
|
3064
|
+
self.mobileInput.type = inputType;
|
|
3065
|
+
self.mobileInput.disabled = self.input.disabled;
|
|
3066
|
+
self.mobileInput.required = self.input.required;
|
|
3067
|
+
self.mobileInput.placeholder = self.input.placeholder;
|
|
3068
|
+
self.mobileFormatStr =
|
|
3069
|
+
inputType === "datetime-local"
|
|
3070
|
+
? "Y-m-d\\TH:i:S"
|
|
3071
|
+
: inputType === "date"
|
|
3072
|
+
? "Y-m-d"
|
|
3073
|
+
: "H:i:S";
|
|
3074
|
+
if (self.selectedDates.length > 0) {
|
|
3075
|
+
self.mobileInput.defaultValue = self.mobileInput.value = self.formatDate(self.selectedDates[0], self.mobileFormatStr);
|
|
3076
|
+
}
|
|
3077
|
+
if (self.config.minDate)
|
|
3078
|
+
self.mobileInput.min = self.formatDate(self.config.minDate, "Y-m-d");
|
|
3079
|
+
if (self.config.maxDate)
|
|
3080
|
+
self.mobileInput.max = self.formatDate(self.config.maxDate, "Y-m-d");
|
|
3081
|
+
if (self.input.getAttribute("step"))
|
|
3082
|
+
self.mobileInput.step = String(self.input.getAttribute("step"));
|
|
3083
|
+
self.input.type = "hidden";
|
|
3084
|
+
if (self.altInput !== undefined)
|
|
3085
|
+
self.altInput.type = "hidden";
|
|
3086
|
+
try {
|
|
3087
|
+
if (self.input.parentNode)
|
|
3088
|
+
self.input.parentNode.insertBefore(self.mobileInput, self.input.nextSibling);
|
|
3089
|
+
}
|
|
3090
|
+
catch (_a) { }
|
|
3091
|
+
bind(self.mobileInput, "change", function (e) {
|
|
3092
|
+
self.setDate(getEventTarget(e).value, false, self.mobileFormatStr);
|
|
3093
|
+
triggerEvent("onChange");
|
|
3094
|
+
triggerEvent("onClose");
|
|
3095
|
+
});
|
|
3096
|
+
}
|
|
3097
|
+
function toggle(e) {
|
|
3098
|
+
if (self.isOpen === true)
|
|
3099
|
+
return self.close();
|
|
3100
|
+
self.open(e);
|
|
3101
|
+
}
|
|
3102
|
+
function triggerEvent(event, data) {
|
|
3103
|
+
// If the instance has been destroyed already, all hooks have been removed
|
|
3104
|
+
if (self.config === undefined)
|
|
3105
|
+
return;
|
|
3106
|
+
var hooks = self.config[event];
|
|
3107
|
+
if (hooks !== undefined && hooks.length > 0) {
|
|
3108
|
+
for (var i = 0; hooks[i] && i < hooks.length; i++)
|
|
3109
|
+
hooks[i](self.selectedDates, self.input.value, self, data);
|
|
3110
|
+
}
|
|
3111
|
+
if (event === "onChange") {
|
|
3112
|
+
self.input.dispatchEvent(createEvent("change"));
|
|
3113
|
+
// many front-end frameworks bind to the input event
|
|
3114
|
+
self.input.dispatchEvent(createEvent("input"));
|
|
3115
|
+
}
|
|
3116
|
+
}
|
|
3117
|
+
function createEvent(name) {
|
|
3118
|
+
var e = document.createEvent("Event");
|
|
3119
|
+
e.initEvent(name, true, true);
|
|
3120
|
+
return e;
|
|
3121
|
+
}
|
|
3122
|
+
function isDateSelected(date) {
|
|
3123
|
+
for (var i = 0; i < self.selectedDates.length; i++) {
|
|
3124
|
+
var selectedDate = self.selectedDates[i];
|
|
3125
|
+
if (selectedDate instanceof Date &&
|
|
3126
|
+
compareDates(selectedDate, date) === 0)
|
|
3127
|
+
return "" + i;
|
|
3128
|
+
}
|
|
3129
|
+
return false;
|
|
3130
|
+
}
|
|
3131
|
+
function isDateInRange(date) {
|
|
3132
|
+
if (self.config.mode !== "range" || self.selectedDates.length < 2)
|
|
3133
|
+
return false;
|
|
3134
|
+
return (compareDates(date, self.selectedDates[0]) >= 0 &&
|
|
3135
|
+
compareDates(date, self.selectedDates[1]) <= 0);
|
|
3136
|
+
}
|
|
3137
|
+
function updateNavigationCurrentMonth() {
|
|
3138
|
+
if (self.config.noCalendar || self.isMobile || !self.monthNav)
|
|
3139
|
+
return;
|
|
3140
|
+
self.yearElements.forEach(function (yearElement, i) {
|
|
3141
|
+
var d = new Date(self.currentYear, self.currentMonth, 1);
|
|
3142
|
+
d.setMonth(self.currentMonth + i);
|
|
3143
|
+
if (self.config.showMonths > 1 ||
|
|
3144
|
+
self.config.monthSelectorType === "static") {
|
|
3145
|
+
self.monthElements[i].textContent =
|
|
3146
|
+
monthToStr(d.getMonth(), self.config.shorthandCurrentMonth, self.l10n) + " ";
|
|
3147
|
+
}
|
|
3148
|
+
else {
|
|
3149
|
+
self.monthsDropdownContainer.value = d.getMonth().toString();
|
|
3150
|
+
}
|
|
3151
|
+
yearElement.value = d.getFullYear().toString();
|
|
3152
|
+
});
|
|
3153
|
+
self._hidePrevMonthArrow =
|
|
3154
|
+
self.config.minDate !== undefined &&
|
|
3155
|
+
(self.currentYear === self.config.minDate.getFullYear()
|
|
3156
|
+
? self.currentMonth <= self.config.minDate.getMonth()
|
|
3157
|
+
: self.currentYear < self.config.minDate.getFullYear());
|
|
3158
|
+
self._hideNextMonthArrow =
|
|
3159
|
+
self.config.maxDate !== undefined &&
|
|
3160
|
+
(self.currentYear === self.config.maxDate.getFullYear()
|
|
3161
|
+
? self.currentMonth + 1 > self.config.maxDate.getMonth()
|
|
3162
|
+
: self.currentYear > self.config.maxDate.getFullYear());
|
|
3163
|
+
}
|
|
3164
|
+
function getDateStr(specificFormat) {
|
|
3165
|
+
var format = specificFormat ||
|
|
3166
|
+
(self.config.altInput ? self.config.altFormat : self.config.dateFormat);
|
|
3167
|
+
return self.selectedDates
|
|
3168
|
+
.map(function (dObj) { return self.formatDate(dObj, format); })
|
|
3169
|
+
.filter(function (d, i, arr) {
|
|
3170
|
+
return self.config.mode !== "range" ||
|
|
3171
|
+
self.config.enableTime ||
|
|
3172
|
+
arr.indexOf(d) === i;
|
|
3173
|
+
})
|
|
3174
|
+
.join(self.config.mode !== "range"
|
|
3175
|
+
? self.config.conjunction
|
|
3176
|
+
: self.l10n.rangeSeparator);
|
|
3177
|
+
}
|
|
3178
|
+
/**
|
|
3179
|
+
* Updates the values of inputs associated with the calendar
|
|
3180
|
+
*/
|
|
3181
|
+
function updateValue(triggerChange) {
|
|
3182
|
+
if (triggerChange === void 0) { triggerChange = true; }
|
|
3183
|
+
if (self.mobileInput !== undefined && self.mobileFormatStr) {
|
|
3184
|
+
self.mobileInput.value =
|
|
3185
|
+
self.latestSelectedDateObj !== undefined
|
|
3186
|
+
? self.formatDate(self.latestSelectedDateObj, self.mobileFormatStr)
|
|
3187
|
+
: "";
|
|
3188
|
+
}
|
|
3189
|
+
self.input.value = getDateStr(self.config.dateFormat);
|
|
3190
|
+
if (self.altInput !== undefined) {
|
|
3191
|
+
self.altInput.value = getDateStr(self.config.altFormat);
|
|
3192
|
+
}
|
|
3193
|
+
if (triggerChange !== false)
|
|
3194
|
+
triggerEvent("onValueUpdate");
|
|
3195
|
+
}
|
|
3196
|
+
function onMonthNavClick(e) {
|
|
3197
|
+
var eventTarget = getEventTarget(e);
|
|
3198
|
+
var isPrevMonth = self.prevMonthNav.contains(eventTarget);
|
|
3199
|
+
var isNextMonth = self.nextMonthNav.contains(eventTarget);
|
|
3200
|
+
if (isPrevMonth || isNextMonth) {
|
|
3201
|
+
changeMonth(isPrevMonth ? -1 : 1);
|
|
3202
|
+
}
|
|
3203
|
+
else if (self.yearElements.indexOf(eventTarget) >= 0) {
|
|
3204
|
+
eventTarget.select();
|
|
3205
|
+
}
|
|
3206
|
+
else if (eventTarget.classList.contains("arrowUp")) {
|
|
3207
|
+
self.changeYear(self.currentYear + 1);
|
|
3208
|
+
}
|
|
3209
|
+
else if (eventTarget.classList.contains("arrowDown")) {
|
|
3210
|
+
self.changeYear(self.currentYear - 1);
|
|
3211
|
+
}
|
|
3212
|
+
}
|
|
3213
|
+
function timeWrapper(e) {
|
|
3214
|
+
e.preventDefault();
|
|
3215
|
+
var isKeyDown = e.type === "keydown", eventTarget = getEventTarget(e), input = eventTarget;
|
|
3216
|
+
if (self.amPM !== undefined && eventTarget === self.amPM) {
|
|
3217
|
+
self.amPM.textContent =
|
|
3218
|
+
self.l10n.amPM[int(self.amPM.textContent === self.l10n.amPM[0])];
|
|
3219
|
+
}
|
|
3220
|
+
var min = parseFloat(input.getAttribute("min")), max = parseFloat(input.getAttribute("max")), step = parseFloat(input.getAttribute("step")), curValue = parseInt(input.value, 10), delta = e.delta ||
|
|
3221
|
+
(isKeyDown ? (e.which === 38 ? 1 : -1) : 0);
|
|
3222
|
+
var newValue = curValue + step * delta;
|
|
3223
|
+
if (typeof input.value !== "undefined" && input.value.length === 2) {
|
|
3224
|
+
var isHourElem = input === self.hourElement, isMinuteElem = input === self.minuteElement;
|
|
3225
|
+
if (newValue < min) {
|
|
3226
|
+
newValue =
|
|
3227
|
+
max +
|
|
3228
|
+
newValue +
|
|
3229
|
+
int(!isHourElem) +
|
|
3230
|
+
(int(isHourElem) && int(!self.amPM));
|
|
3231
|
+
if (isMinuteElem)
|
|
3232
|
+
incrementNumInput(undefined, -1, self.hourElement);
|
|
3233
|
+
}
|
|
3234
|
+
else if (newValue > max) {
|
|
3235
|
+
newValue =
|
|
3236
|
+
input === self.hourElement ? newValue - max - int(!self.amPM) : min;
|
|
3237
|
+
if (isMinuteElem)
|
|
3238
|
+
incrementNumInput(undefined, 1, self.hourElement);
|
|
3239
|
+
}
|
|
3240
|
+
if (self.amPM &&
|
|
3241
|
+
isHourElem &&
|
|
3242
|
+
(step === 1
|
|
3243
|
+
? newValue + curValue === 23
|
|
3244
|
+
: Math.abs(newValue - curValue) > step)) {
|
|
3245
|
+
self.amPM.textContent =
|
|
3246
|
+
self.l10n.amPM[int(self.amPM.textContent === self.l10n.amPM[0])];
|
|
3247
|
+
}
|
|
3248
|
+
input.value = pad(newValue);
|
|
3249
|
+
}
|
|
3250
|
+
}
|
|
3251
|
+
init();
|
|
3252
|
+
return self;
|
|
3253
|
+
}
|
|
3254
|
+
/* istanbul ignore next */
|
|
3255
|
+
function _flatpickr(nodeList, config) {
|
|
3256
|
+
// static list
|
|
3257
|
+
var nodes = Array.prototype.slice
|
|
3258
|
+
.call(nodeList)
|
|
3259
|
+
.filter(function (x) { return x instanceof HTMLElement; });
|
|
3260
|
+
var instances = [];
|
|
3261
|
+
for (var i = 0; i < nodes.length; i++) {
|
|
3262
|
+
var node = nodes[i];
|
|
3263
|
+
try {
|
|
3264
|
+
if (node.getAttribute("data-fp-omit") !== null)
|
|
3265
|
+
continue;
|
|
3266
|
+
if (node._flatpickr !== undefined) {
|
|
3267
|
+
node._flatpickr.destroy();
|
|
3268
|
+
node._flatpickr = undefined;
|
|
3269
|
+
}
|
|
3270
|
+
node._flatpickr = FlatpickrInstance(node, config || {});
|
|
3271
|
+
instances.push(node._flatpickr);
|
|
3272
|
+
}
|
|
3273
|
+
catch (e) {
|
|
3274
|
+
console.error(e);
|
|
3275
|
+
}
|
|
3276
|
+
}
|
|
3277
|
+
return instances.length === 1 ? instances[0] : instances;
|
|
3278
|
+
}
|
|
3279
|
+
/* istanbul ignore next */
|
|
3280
|
+
if (typeof HTMLElement !== "undefined" &&
|
|
3281
|
+
typeof HTMLCollection !== "undefined" &&
|
|
3282
|
+
typeof NodeList !== "undefined") {
|
|
3283
|
+
// browser env
|
|
3284
|
+
HTMLCollection.prototype.flatpickr = NodeList.prototype.flatpickr = function (config) {
|
|
3285
|
+
return _flatpickr(this, config);
|
|
3286
|
+
};
|
|
3287
|
+
HTMLElement.prototype.flatpickr = function (config) {
|
|
3288
|
+
return _flatpickr([this], config);
|
|
3289
|
+
};
|
|
3290
|
+
}
|
|
3291
|
+
/* istanbul ignore next */
|
|
3292
|
+
var flatpickr = function (selector, config) {
|
|
3293
|
+
if (typeof selector === "string") {
|
|
3294
|
+
return _flatpickr(window.document.querySelectorAll(selector), config);
|
|
3295
|
+
}
|
|
3296
|
+
else if (selector instanceof Node) {
|
|
3297
|
+
return _flatpickr([selector], config);
|
|
3298
|
+
}
|
|
3299
|
+
else {
|
|
3300
|
+
return _flatpickr(selector, config);
|
|
3301
|
+
}
|
|
3302
|
+
};
|
|
3303
|
+
/* istanbul ignore next */
|
|
3304
|
+
flatpickr.defaultConfig = {};
|
|
3305
|
+
flatpickr.l10ns = {
|
|
3306
|
+
en: __assign({}, english),
|
|
3307
|
+
default: __assign({}, english),
|
|
3308
|
+
};
|
|
3309
|
+
flatpickr.localize = function (l10n) {
|
|
3310
|
+
flatpickr.l10ns.default = __assign(__assign({}, flatpickr.l10ns.default), l10n);
|
|
3311
|
+
};
|
|
3312
|
+
flatpickr.setDefaults = function (config) {
|
|
3313
|
+
flatpickr.defaultConfig = __assign(__assign({}, flatpickr.defaultConfig), config);
|
|
3314
|
+
};
|
|
3315
|
+
flatpickr.parseDate = createDateParser({});
|
|
3316
|
+
flatpickr.formatDate = createDateFormatter({});
|
|
3317
|
+
flatpickr.compareDates = compareDates;
|
|
3318
|
+
/* istanbul ignore next */
|
|
3319
|
+
if (typeof jQuery !== "undefined" && typeof jQuery.fn !== "undefined") {
|
|
3320
|
+
jQuery.fn.flatpickr = function (config) {
|
|
3321
|
+
return _flatpickr(this, config);
|
|
3322
|
+
};
|
|
3323
|
+
}
|
|
3324
|
+
Date.prototype.fp_incr = function (days) {
|
|
3325
|
+
return new Date(this.getFullYear(), this.getMonth(), this.getDate() + (typeof days === "string" ? parseInt(days, 10) : days));
|
|
3326
|
+
};
|
|
3327
|
+
if (typeof window !== "undefined") {
|
|
3328
|
+
window.flatpickr = flatpickr;
|
|
3329
|
+
}
|
|
3330
|
+
|
|
3331
|
+
return flatpickr;
|
|
3332
|
+
|
|
3333
|
+
})));
|
|
3334
|
+
|
|
3335
|
+
},{}],6:[function(require,module,exports){
|
|
615
3336
|
/*
|
|
616
3337
|
* International Telephone Input v16.1.0
|
|
617
3338
|
* https://github.com/jackocnr/intl-tel-input.git
|
|
@@ -1943,13 +4664,13 @@ var hj=window.customElements,ij=!1,jj=null;hj.polyfillWrapFlushCallback&&hj.poly
|
|
|
1943
4664
|
};
|
|
1944
4665
|
}();
|
|
1945
4666
|
});
|
|
1946
|
-
},{}],
|
|
4667
|
+
},{}],7:[function(require,module,exports){
|
|
1947
4668
|
/**
|
|
1948
4669
|
* Exposing intl-tel-input as a component
|
|
1949
4670
|
*/
|
|
1950
4671
|
module.exports = require("./build/js/intlTelInput");
|
|
1951
4672
|
|
|
1952
|
-
},{"./build/js/intlTelInput":
|
|
4673
|
+
},{"./build/js/intlTelInput":6}],8:[function(require,module,exports){
|
|
1953
4674
|
// shim for using process in browser
|
|
1954
4675
|
var process = module.exports = {};
|
|
1955
4676
|
|
|
@@ -2135,7 +4856,7 @@ process.chdir = function (dir) {
|
|
|
2135
4856
|
};
|
|
2136
4857
|
process.umask = function() { return 0; };
|
|
2137
4858
|
|
|
2138
|
-
},{}],
|
|
4859
|
+
},{}],9:[function(require,module,exports){
|
|
2139
4860
|
(function (setImmediate,clearImmediate){(function (){
|
|
2140
4861
|
var nextTick = require('process/browser.js').nextTick;
|
|
2141
4862
|
var apply = Function.prototype.apply;
|
|
@@ -2215,7 +4936,7 @@ exports.clearImmediate = typeof clearImmediate === "function" ? clearImmediate :
|
|
|
2215
4936
|
};
|
|
2216
4937
|
}).call(this)}).call(this,require("timers").setImmediate,require("timers").clearImmediate)
|
|
2217
4938
|
|
|
2218
|
-
},{"process/browser.js":
|
|
4939
|
+
},{"process/browser.js":8,"timers":9}],10:[function(require,module,exports){
|
|
2219
4940
|
"use strict";
|
|
2220
4941
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2221
4942
|
exports.CustomForm = void 0;
|
|
@@ -2367,7 +5088,7 @@ var CustomForm = /** @class */ (function () {
|
|
|
2367
5088
|
}());
|
|
2368
5089
|
exports.CustomForm = CustomForm;
|
|
2369
5090
|
|
|
2370
|
-
},{"./elements/FileField/FileFieldElement":
|
|
5091
|
+
},{"./elements/FileField/FileFieldElement":22,"./framework/Utilities/ArrayUtil":58,"./framework/Utilities/MakeRequest":61}],11:[function(require,module,exports){
|
|
2371
5092
|
"use strict";
|
|
2372
5093
|
var __extends = (this && this.__extends) || (function () {
|
|
2373
5094
|
var extendStatics = function (d, b) {
|
|
@@ -2575,7 +5296,7 @@ var AddressElement = /** @class */ (function (_super) {
|
|
|
2575
5296
|
}(CustomInputElement_1.CustomInputElement));
|
|
2576
5297
|
exports.AddressElement = AddressElement;
|
|
2577
5298
|
|
|
2578
|
-
},{"../../framework/CustomEvents":
|
|
5299
|
+
},{"../../framework/CustomEvents":34,"../../framework/CustomInputElement":35,"../../framework/Language/Translator":56,"../../framework/Polyfills/getAttributeNamesPolyfill":57,"../../framework/Utilities/debouncer":64,"../../framework/custom-element.decorator":73}],12:[function(require,module,exports){
|
|
2579
5300
|
"use strict";
|
|
2580
5301
|
var __extends = (this && this.__extends) || (function () {
|
|
2581
5302
|
var extendStatics = function (d, b) {
|
|
@@ -2704,7 +5425,7 @@ var BankFieldElement = /** @class */ (function (_super) {
|
|
|
2704
5425
|
}(CustomInputElement_1.CustomInputElement));
|
|
2705
5426
|
exports.BankFieldElement = BankFieldElement;
|
|
2706
5427
|
|
|
2707
|
-
},{"../../framework/CustomEvents":
|
|
5428
|
+
},{"../../framework/CustomEvents":34,"../../framework/CustomInputElement":35,"../../framework/Language/Translator":56,"../../framework/Validation/Validators/BankAccount":65,"../../framework/Validation/Validators/BankAccountRegistrationNumber":66,"../../framework/custom-element.decorator":73}],13:[function(require,module,exports){
|
|
2708
5429
|
"use strict";
|
|
2709
5430
|
var __extends = (this && this.__extends) || (function () {
|
|
2710
5431
|
var extendStatics = function (d, b) {
|
|
@@ -2788,7 +5509,7 @@ var CPRElement = /** @class */ (function (_super) {
|
|
|
2788
5509
|
}(CustomInputElement_1.CustomInputElement));
|
|
2789
5510
|
exports.CPRElement = CPRElement;
|
|
2790
5511
|
|
|
2791
|
-
},{"../../framework/CustomEvents":
|
|
5512
|
+
},{"../../framework/CustomEvents":34,"../../framework/CustomInputElement":35,"../../framework/Validation/Validators/CPR":69,"../../framework/custom-element.decorator":73}],14:[function(require,module,exports){
|
|
2792
5513
|
"use strict";
|
|
2793
5514
|
var __extends = (this && this.__extends) || (function () {
|
|
2794
5515
|
var extendStatics = function (d, b) {
|
|
@@ -2872,7 +5593,7 @@ var CVRElement = /** @class */ (function (_super) {
|
|
|
2872
5593
|
}(CustomInputElement_1.CustomInputElement));
|
|
2873
5594
|
exports.CVRElement = CVRElement;
|
|
2874
5595
|
|
|
2875
|
-
},{"../../framework/CustomEvents":
|
|
5596
|
+
},{"../../framework/CustomEvents":34,"../../framework/CustomInputElement":35,"../../framework/Validation/Validators/CVR":70,"../../framework/custom-element.decorator":73}],15:[function(require,module,exports){
|
|
2876
5597
|
"use strict";
|
|
2877
5598
|
var __extends = (this && this.__extends) || (function () {
|
|
2878
5599
|
var extendStatics = function (d, b) {
|
|
@@ -2970,7 +5691,7 @@ var CheckBoxElement = /** @class */ (function (_super) {
|
|
|
2970
5691
|
}(CustomInputElement_1.CustomInputElement));
|
|
2971
5692
|
exports.CheckBoxElement = CheckBoxElement;
|
|
2972
5693
|
|
|
2973
|
-
},{"../../framework/CustomEvents":
|
|
5694
|
+
},{"../../framework/CustomEvents":34,"../../framework/CustomInputElement":35,"../../framework/Utilities/StringUtil":62,"../../framework/custom-element.decorator":73}],16:[function(require,module,exports){
|
|
2974
5695
|
"use strict";
|
|
2975
5696
|
var __extends = (this && this.__extends) || (function () {
|
|
2976
5697
|
var extendStatics = function (d, b) {
|
|
@@ -2998,6 +5719,7 @@ exports.CustomFormatDateFieldElement = void 0;
|
|
|
2998
5719
|
var custom_element_decorator_1 = require("../../framework/custom-element.decorator");
|
|
2999
5720
|
var CustomInputElement_1 = require("../../framework/CustomInputElement");
|
|
3000
5721
|
var CustomEvents_1 = require("../../framework/CustomEvents");
|
|
5722
|
+
var flatpickr = require('flatpickr');
|
|
3001
5723
|
var CustomFormatDateFieldElement = /** @class */ (function (_super) {
|
|
3002
5724
|
__extends(CustomFormatDateFieldElement, _super);
|
|
3003
5725
|
function CustomFormatDateFieldElement() {
|
|
@@ -3020,11 +5742,10 @@ var CustomFormatDateFieldElement = /** @class */ (function (_super) {
|
|
|
3020
5742
|
}
|
|
3021
5743
|
Object.defineProperty(CustomFormatDateFieldElement.prototype, "value", {
|
|
3022
5744
|
get: function () {
|
|
3023
|
-
return this.
|
|
5745
|
+
return this.date.value;
|
|
3024
5746
|
},
|
|
3025
5747
|
set: function (value) {
|
|
3026
5748
|
this.date.value = value;
|
|
3027
|
-
this.display.value = value;
|
|
3028
5749
|
},
|
|
3029
5750
|
enumerable: false,
|
|
3030
5751
|
configurable: true
|
|
@@ -3040,26 +5761,11 @@ var CustomFormatDateFieldElement = /** @class */ (function (_super) {
|
|
|
3040
5761
|
_super.prototype.connectedCallback.call(this);
|
|
3041
5762
|
};
|
|
3042
5763
|
CustomFormatDateFieldElement.prototype.initChildInputs = function () {
|
|
3043
|
-
var _this = this;
|
|
3044
5764
|
this.date = _super.prototype.getChildInput.call(this, '#date-field');
|
|
3045
|
-
this.
|
|
3046
|
-
this.
|
|
3047
|
-
this.date.
|
|
3048
|
-
|
|
3049
|
-
_this.change(null);
|
|
3050
|
-
_this.closeDatePicker();
|
|
3051
|
-
});
|
|
3052
|
-
this.datepicker.addEventListener('click', function () {
|
|
3053
|
-
_this.showDatePicker();
|
|
3054
|
-
});
|
|
3055
|
-
this.display.addEventListener('click', function () {
|
|
3056
|
-
_this.showDatePicker();
|
|
3057
|
-
});
|
|
3058
|
-
document.addEventListener('click', function (event) {
|
|
3059
|
-
if (!_this.contains(event.target)) {
|
|
3060
|
-
_this.closeDatePicker();
|
|
3061
|
-
}
|
|
3062
|
-
});
|
|
5765
|
+
this.dateWrapper = _super.prototype.getChildInput.call(this, '.flatpickr');
|
|
5766
|
+
this.validateDateFormats();
|
|
5767
|
+
this.date.placeholder = this.dateFormat;
|
|
5768
|
+
this.date.addEventListener('change', this.change.bind(this));
|
|
3063
5769
|
if (this.required) {
|
|
3064
5770
|
this.date.setAttribute('required', '');
|
|
3065
5771
|
}
|
|
@@ -3069,28 +5775,33 @@ var CustomFormatDateFieldElement = /** @class */ (function (_super) {
|
|
|
3069
5775
|
if (this.min) {
|
|
3070
5776
|
this.date.setAttribute('min', this.min);
|
|
3071
5777
|
}
|
|
3072
|
-
|
|
3073
|
-
this.display.placeholder = this.dateFormat;
|
|
3074
|
-
}
|
|
3075
|
-
else {
|
|
3076
|
-
this.display.placeholder = this.defaultDateFormat;
|
|
3077
|
-
this.dateFormat = this.defaultDateFormat;
|
|
3078
|
-
}
|
|
5778
|
+
this.initFlatpickr();
|
|
3079
5779
|
};
|
|
5780
|
+
// events
|
|
3080
5781
|
CustomFormatDateFieldElement.prototype.change = function ($event) {
|
|
3081
|
-
var _a;
|
|
3082
5782
|
this.touched = true;
|
|
3083
|
-
var formattedDate = (_a = this.formatDate()) !== null && _a !== void 0 ? _a : this.date.valueAsDate.toLocaleDateString();
|
|
3084
|
-
this.display.value = formattedDate;
|
|
3085
|
-
this.date.setAttribute('value', formattedDate);
|
|
3086
5783
|
this.onChange.emit(new CustomEvents_1.CustomElementEventArgs(this.value, 'change'));
|
|
3087
5784
|
};
|
|
3088
5785
|
CustomFormatDateFieldElement.prototype.validate = function () {
|
|
3089
5786
|
this.valid;
|
|
3090
5787
|
this.onValidate.emit(new CustomEvents_1.CustomElementEventArgs(this.value, 'validate'));
|
|
3091
5788
|
};
|
|
3092
|
-
CustomFormatDateFieldElement.prototype.
|
|
3093
|
-
var
|
|
5789
|
+
CustomFormatDateFieldElement.prototype.initFlatpickr = function () {
|
|
5790
|
+
var _this = this;
|
|
5791
|
+
flatpickr(this.dateWrapper, {
|
|
5792
|
+
wrap: true,
|
|
5793
|
+
altInput: true,
|
|
5794
|
+
appendTo: this.shadowRoot.querySelector('.wrapper'),
|
|
5795
|
+
disableMobile: true,
|
|
5796
|
+
parseDate: function (datestr) {
|
|
5797
|
+
return new Date(datestr);
|
|
5798
|
+
},
|
|
5799
|
+
formatDate: function (date, format) {
|
|
5800
|
+
return _this.formatDate(date);
|
|
5801
|
+
}
|
|
5802
|
+
});
|
|
5803
|
+
};
|
|
5804
|
+
CustomFormatDateFieldElement.prototype.formatDate = function (date) {
|
|
3094
5805
|
var year = date.getFullYear();
|
|
3095
5806
|
var month = (date.getMonth() + 1).toString().padStart(2, '0');
|
|
3096
5807
|
var day = date.getDate().toString().padStart(2, '0');
|
|
@@ -3110,28 +5821,16 @@ var CustomFormatDateFieldElement = /** @class */ (function (_super) {
|
|
|
3110
5821
|
};
|
|
3111
5822
|
return dateFormats[this.dateFormat];
|
|
3112
5823
|
};
|
|
3113
|
-
CustomFormatDateFieldElement.prototype.
|
|
3114
|
-
if ((
|
|
3115
|
-
this.
|
|
3116
|
-
}
|
|
3117
|
-
else {
|
|
3118
|
-
if (this.date.showPicker) {
|
|
3119
|
-
this.date.showPicker();
|
|
3120
|
-
}
|
|
5824
|
+
CustomFormatDateFieldElement.prototype.validateDateFormats = function () {
|
|
5825
|
+
if (!this.supportedDateFormats.includes(this.dateFormat)) {
|
|
5826
|
+
this.dateFormat = this.defaultDateFormat;
|
|
3121
5827
|
}
|
|
3122
5828
|
};
|
|
3123
|
-
CustomFormatDateFieldElement.prototype.closeDatePicker = function () {
|
|
3124
|
-
var _this = this;
|
|
3125
|
-
this.date.hidden = true;
|
|
3126
|
-
setTimeout(function () {
|
|
3127
|
-
_this.date.hidden = false;
|
|
3128
|
-
}, 0);
|
|
3129
|
-
};
|
|
3130
5829
|
CustomFormatDateFieldElement = __decorate([
|
|
3131
5830
|
(0, custom_element_decorator_1.default)({
|
|
3132
5831
|
selector: 'custom-format-date-element',
|
|
3133
|
-
template: "\n\t\t<div class=\"wrapper\">\n\t\t\t<input type=\"text\" id=\"
|
|
3134
|
-
style: "\n\t\t:host{\n\t\t\twidth:100%;\n\t\t}\n\t\t.wrapper{\n\t\t\tdisplay:flex;\n\t\t\tposition: relative;\n\t\t}\n\t\tinput{\n\t\t\tbox-sizing: border-box;\n\t\t\twidth: 100% !important;\n\t\t\tborder: none;\n\t\t\tbackground-color: #f1f4ff;\n\t\t\tmargin: 2px;\n\t\t\tresize: none;\n\t\t}\n\t\t#date-field
|
|
5832
|
+
template: "\n\t\t<div class=\"wrapper flatpickr\">\n\t\t\t<input type=\"text\" id=\"date-field\" data-input />\n\t\t\t<svg id=\"picker-trigger\" data-toggle viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\"><rect x=\"2\" y=\"4\" width=\"20\" height=\"18\" rx=\"1\" fill=\"#000\"/><rect x=\"4\" y=\"8\" width=\"16\" height=\"12\" fill=\"white\"/><path d=\"M4 10H20\" stroke=\"#000\" stroke-width=\"1\"/><circle cx=\"16\" cy=\"14\" r=\"2\" fill=\"#F44336\"/><rect x=\"6\" y=\"2\" width=\"3\" height=\"4\" rx=\".5\" fill=\"#000\"/><rect x=\"15\" y=\"2\" width=\"3\" height=\"4\" rx=\".5\" fill=\"#000\"/></svg>\n\t\t</div>",
|
|
5833
|
+
style: "\n\t\t@import '../../../node_modules/flatpickr/dist/flatpickr.min.css';\n\t\t:host{\n\t\t\twidth:100%;\n\t\t}\n\t\t.wrapper{\n\t\t\tdisplay:flex;\n\t\t\tposition: relative;\n\t\t}\n\t\tinput{\n\t\t\tbox-sizing: border-box;\n\t\t\twidth: 100% !important;\n\t\t\tborder: none;\n\t\t\tbackground-color: #f1f4ff;\n\t\t\tmargin: 2px;\n\t\t\tresize: none;\n\t\t}\n\t\t#date-field::after {\n\t\t\tcontent: url('path/to/datepicker-icon.png'); /* Path to your datepicker icon */\n\t\t\tcursor: pointer;\n\t\t\tright: 10px;\n\t\t}\n\t\t#picker-trigger {\n\t\t\tcursor: pointer;\n\t\t\twidth: 15px;\n\t\t\theight: 15px;\n\t\t\tposition:absolute;\n\t\t\tright: 2px;\n\t\t\ttop: 15%;\n\t\t}\n\t\t.flatpickr-calendar {\n\t\t\tposition: fixed !important; /* Use fixed positioning */\n\t\t\ttop: 50% !important; /* Center vertically */\n\t\t\tleft: 50% !important; /* Center horizontally */\n\t\t\tz-index: 1000 !important; /* Ensure it's above other content */\n\t\t}\n\t",
|
|
3135
5834
|
useShadow: true,
|
|
3136
5835
|
})
|
|
3137
5836
|
], CustomFormatDateFieldElement);
|
|
@@ -3139,7 +5838,7 @@ var CustomFormatDateFieldElement = /** @class */ (function (_super) {
|
|
|
3139
5838
|
}(CustomInputElement_1.CustomInputElement));
|
|
3140
5839
|
exports.CustomFormatDateFieldElement = CustomFormatDateFieldElement;
|
|
3141
5840
|
|
|
3142
|
-
},{"../../framework/CustomEvents":
|
|
5841
|
+
},{"../../framework/CustomEvents":34,"../../framework/CustomInputElement":35,"../../framework/custom-element.decorator":73,"flatpickr":5}],17:[function(require,module,exports){
|
|
3143
5842
|
"use strict";
|
|
3144
5843
|
var __extends = (this && this.__extends) || (function () {
|
|
3145
5844
|
var extendStatics = function (d, b) {
|
|
@@ -3232,7 +5931,7 @@ var CustomRegularExpressionElement = /** @class */ (function (_super) {
|
|
|
3232
5931
|
}(CustomInputElement_1.CustomInputElement));
|
|
3233
5932
|
exports.CustomRegularExpressionElement = CustomRegularExpressionElement;
|
|
3234
5933
|
|
|
3235
|
-
},{"../../framework/CustomEvents":
|
|
5934
|
+
},{"../../framework/CustomEvents":34,"../../framework/CustomInputElement":35,"../../framework/custom-element.decorator":73}],18:[function(require,module,exports){
|
|
3236
5935
|
"use strict";
|
|
3237
5936
|
var __extends = (this && this.__extends) || (function () {
|
|
3238
5937
|
var extendStatics = function (d, b) {
|
|
@@ -3319,7 +6018,7 @@ var DateFieldElement = /** @class */ (function (_super) {
|
|
|
3319
6018
|
}(CustomInputElement_1.CustomInputElement));
|
|
3320
6019
|
exports.DateFieldElement = DateFieldElement;
|
|
3321
6020
|
|
|
3322
|
-
},{"../../framework/CustomEvents":
|
|
6021
|
+
},{"../../framework/CustomEvents":34,"../../framework/CustomInputElement":35,"../../framework/custom-element.decorator":73}],19:[function(require,module,exports){
|
|
3323
6022
|
"use strict";
|
|
3324
6023
|
var __extends = (this && this.__extends) || (function () {
|
|
3325
6024
|
var extendStatics = function (d, b) {
|
|
@@ -3420,7 +6119,7 @@ var DropDownListElement = /** @class */ (function (_super) {
|
|
|
3420
6119
|
}(CustomInputElement_1.CustomInputElement));
|
|
3421
6120
|
exports.DropDownListElement = DropDownListElement;
|
|
3422
6121
|
|
|
3423
|
-
},{"../../framework/CustomEvents":
|
|
6122
|
+
},{"../../framework/CustomEvents":34,"../../framework/CustomInputElement":35,"../../framework/Utilities/StringUtil":62,"../../framework/custom-element.decorator":73}],20:[function(require,module,exports){
|
|
3424
6123
|
"use strict";
|
|
3425
6124
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3426
6125
|
exports.SECompanyRegistrationElement = exports.SEPersonalNumberElement = exports.TypeAheadElement = exports.BankFieldElement = exports.IdentificationElement = exports.CVRElement = exports.CPRElement = exports.IntPhoneFieldElement = exports.CustomFormatDateFieldElement = exports.DateFieldElement = exports.CustomRegularExpressionElement = exports.NumericFieldElement = exports.FileFieldElement = exports.DropDownListElement = exports.TextAreaElement = exports.RadioButtonGroupElement = exports.CheckBoxElement = exports.EmailFieldElement = exports.TextFieldElement = exports.AddressElement = void 0;
|
|
@@ -3465,7 +6164,7 @@ Object.defineProperty(exports, "SECompanyRegistrationElement", { enumerable: tru
|
|
|
3465
6164
|
var CustomFormatDateFieldElement_1 = require("./CustomFormatDateFieldElement/CustomFormatDateFieldElement");
|
|
3466
6165
|
Object.defineProperty(exports, "CustomFormatDateFieldElement", { enumerable: true, get: function () { return CustomFormatDateFieldElement_1.CustomFormatDateFieldElement; } });
|
|
3467
6166
|
|
|
3468
|
-
},{"./Address/AddressElement":
|
|
6167
|
+
},{"./Address/AddressElement":11,"./BankField/BankFieldElement":12,"./CPRElement/CPRElement":13,"./CVRElement/CVRElement":14,"./CheckBoxElement/CheckBoxElement":15,"./CustomFormatDateFieldElement/CustomFormatDateFieldElement":16,"./CustomRegularExpression/CustomRegularExpressionElement":17,"./DateField/DateFieldElement":18,"./DropDownList/DropDownListElement":19,"./EmailField/EmailFieldElement":21,"./FileField/FileFieldElement":22,"./IdentificationElement/IdentificationElement":23,"./InternationaPhoneNumber/InternationaPhoneNumberElement":26,"./NumericField/NumericFieldElement":27,"./RadioButtonGroup/RadioButtonGroupElement":28,"./SECompanyRegistrationElement/SECompanyRegistrationElement":29,"./SEPersonalNumberElement/SEPersonalNumberElement":30,"./TextAreaElement/TextAreaElement":31,"./TextField/TextFieldElement":32,"./TypeAhead/TypeAheadElement":33}],21:[function(require,module,exports){
|
|
3469
6168
|
"use strict";
|
|
3470
6169
|
var __extends = (this && this.__extends) || (function () {
|
|
3471
6170
|
var extendStatics = function (d, b) {
|
|
@@ -3553,7 +6252,7 @@ var EmailFieldElement = /** @class */ (function (_super) {
|
|
|
3553
6252
|
}(CustomInputElement_1.CustomInputElement));
|
|
3554
6253
|
exports.EmailFieldElement = EmailFieldElement;
|
|
3555
6254
|
|
|
3556
|
-
},{"../../framework/CustomEvents":
|
|
6255
|
+
},{"../../framework/CustomEvents":34,"../../framework/CustomInputElement":35,"../../framework/custom-element.decorator":73}],22:[function(require,module,exports){
|
|
3557
6256
|
"use strict";
|
|
3558
6257
|
var __extends = (this && this.__extends) || (function () {
|
|
3559
6258
|
var extendStatics = function (d, b) {
|
|
@@ -3658,7 +6357,7 @@ var FileFieldElement = /** @class */ (function (_super) {
|
|
|
3658
6357
|
}(CustomInputElement_1.CustomInputElement));
|
|
3659
6358
|
exports.FileFieldElement = FileFieldElement;
|
|
3660
6359
|
|
|
3661
|
-
},{"../../framework/CustomEvents":
|
|
6360
|
+
},{"../../framework/CustomEvents":34,"../../framework/CustomInputElement":35,"../../framework/Polyfills/getAttributeNamesPolyfill":57,"../../framework/custom-element.decorator":73}],23:[function(require,module,exports){
|
|
3662
6361
|
"use strict";
|
|
3663
6362
|
var __extends = (this && this.__extends) || (function () {
|
|
3664
6363
|
var extendStatics = function (d, b) {
|
|
@@ -3754,7 +6453,7 @@ var IdentificationElement = /** @class */ (function (_super) {
|
|
|
3754
6453
|
}(CustomInputElement_1.CustomInputElement));
|
|
3755
6454
|
exports.IdentificationElement = IdentificationElement;
|
|
3756
6455
|
|
|
3757
|
-
},{"../../framework/CustomEvents":
|
|
6456
|
+
},{"../../framework/CustomEvents":34,"../../framework/CustomInputElement":35,"../../framework/Validation/Validators/BankIdNorway":67,"../../framework/Validation/Validators/BankIdSweden":68,"../../framework/Validation/Validators/CPR":69,"../../framework/Validation/Validators/CVR":70,"../../framework/custom-element.decorator":73}],24:[function(require,module,exports){
|
|
3758
6457
|
"use strict";
|
|
3759
6458
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3760
6459
|
function GetFlagsUrl() {
|
|
@@ -3762,7 +6461,7 @@ function GetFlagsUrl() {
|
|
|
3762
6461
|
}
|
|
3763
6462
|
exports.default = GetFlagsUrl;
|
|
3764
6463
|
|
|
3765
|
-
},{}],
|
|
6464
|
+
},{}],25:[function(require,module,exports){
|
|
3766
6465
|
"use strict";
|
|
3767
6466
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3768
6467
|
function GetFlags2XUrl() {
|
|
@@ -3770,7 +6469,7 @@ function GetFlags2XUrl() {
|
|
|
3770
6469
|
}
|
|
3771
6470
|
exports.default = GetFlags2XUrl;
|
|
3772
6471
|
|
|
3773
|
-
},{}],
|
|
6472
|
+
},{}],26:[function(require,module,exports){
|
|
3774
6473
|
"use strict";
|
|
3775
6474
|
var __extends = (this && this.__extends) || (function () {
|
|
3776
6475
|
var extendStatics = function (d, b) {
|
|
@@ -3902,7 +6601,7 @@ var IntPhoneFieldElement = /** @class */ (function (_super) {
|
|
|
3902
6601
|
}(CustomInputElement_1.CustomInputElement));
|
|
3903
6602
|
exports.IntPhoneFieldElement = IntPhoneFieldElement;
|
|
3904
6603
|
|
|
3905
|
-
},{"../../framework/CustomEvents":
|
|
6604
|
+
},{"../../framework/CustomEvents":34,"../../framework/CustomInputElement":35,"../../framework/Utilities/MakeRequest":61,"../../framework/custom-element.decorator":73,"./Flags":24,"./Flags2x":25,"intl-tel-input":7}],27:[function(require,module,exports){
|
|
3906
6605
|
"use strict";
|
|
3907
6606
|
var __extends = (this && this.__extends) || (function () {
|
|
3908
6607
|
var extendStatics = function (d, b) {
|
|
@@ -3998,7 +6697,7 @@ var NumericFieldElement = /** @class */ (function (_super) {
|
|
|
3998
6697
|
}(CustomInputElement_1.CustomInputElement));
|
|
3999
6698
|
exports.NumericFieldElement = NumericFieldElement;
|
|
4000
6699
|
|
|
4001
|
-
},{"../../framework/CustomEvents":
|
|
6700
|
+
},{"../../framework/CustomEvents":34,"../../framework/CustomInputElement":35,"../../framework/custom-element.decorator":73}],28:[function(require,module,exports){
|
|
4002
6701
|
"use strict";
|
|
4003
6702
|
var __extends = (this && this.__extends) || (function () {
|
|
4004
6703
|
var extendStatics = function (d, b) {
|
|
@@ -4099,7 +6798,7 @@ var RadioButtonGroupElement = /** @class */ (function (_super) {
|
|
|
4099
6798
|
}(CustomInputElement_1.CustomInputElement));
|
|
4100
6799
|
exports.RadioButtonGroupElement = RadioButtonGroupElement;
|
|
4101
6800
|
|
|
4102
|
-
},{"../../framework/CustomEvents":
|
|
6801
|
+
},{"../../framework/CustomEvents":34,"../../framework/CustomInputElement":35,"../../framework/Utilities/StringUtil":62,"../../framework/custom-element.decorator":73}],29:[function(require,module,exports){
|
|
4103
6802
|
"use strict";
|
|
4104
6803
|
var __extends = (this && this.__extends) || (function () {
|
|
4105
6804
|
var extendStatics = function (d, b) {
|
|
@@ -4183,7 +6882,7 @@ var SECompanyRegistrationElement = /** @class */ (function (_super) {
|
|
|
4183
6882
|
}(CustomInputElement_1.CustomInputElement));
|
|
4184
6883
|
exports.SECompanyRegistrationElement = SECompanyRegistrationElement;
|
|
4185
6884
|
|
|
4186
|
-
},{"../../framework/CustomEvents":
|
|
6885
|
+
},{"../../framework/CustomEvents":34,"../../framework/CustomInputElement":35,"../../framework/Validation/Validators/SECompanyRegistration":71,"../../framework/custom-element.decorator":73}],30:[function(require,module,exports){
|
|
4187
6886
|
"use strict";
|
|
4188
6887
|
var __extends = (this && this.__extends) || (function () {
|
|
4189
6888
|
var extendStatics = function (d, b) {
|
|
@@ -4267,7 +6966,7 @@ var SEPersonalNumberElement = /** @class */ (function (_super) {
|
|
|
4267
6966
|
}(CustomInputElement_1.CustomInputElement));
|
|
4268
6967
|
exports.SEPersonalNumberElement = SEPersonalNumberElement;
|
|
4269
6968
|
|
|
4270
|
-
},{"../../framework/CustomEvents":
|
|
6969
|
+
},{"../../framework/CustomEvents":34,"../../framework/CustomInputElement":35,"../../framework/Validation/Validators/SEPersonalNumber":72,"../../framework/custom-element.decorator":73}],31:[function(require,module,exports){
|
|
4271
6970
|
"use strict";
|
|
4272
6971
|
var __extends = (this && this.__extends) || (function () {
|
|
4273
6972
|
var extendStatics = function (d, b) {
|
|
@@ -4351,7 +7050,7 @@ var TextAreaElement = /** @class */ (function (_super) {
|
|
|
4351
7050
|
}(CustomInputElement_1.CustomInputElement));
|
|
4352
7051
|
exports.TextAreaElement = TextAreaElement;
|
|
4353
7052
|
|
|
4354
|
-
},{"../../framework/CustomEvents":
|
|
7053
|
+
},{"../../framework/CustomEvents":34,"../../framework/CustomInputElement":35,"../../framework/custom-element.decorator":73}],32:[function(require,module,exports){
|
|
4355
7054
|
"use strict";
|
|
4356
7055
|
var __extends = (this && this.__extends) || (function () {
|
|
4357
7056
|
var extendStatics = function (d, b) {
|
|
@@ -4435,7 +7134,7 @@ var TextFieldElement = /** @class */ (function (_super) {
|
|
|
4435
7134
|
}(CustomInputElement_1.CustomInputElement));
|
|
4436
7135
|
exports.TextFieldElement = TextFieldElement;
|
|
4437
7136
|
|
|
4438
|
-
},{"../../framework/CustomEvents":
|
|
7137
|
+
},{"../../framework/CustomEvents":34,"../../framework/CustomInputElement":35,"../../framework/custom-element.decorator":73}],33:[function(require,module,exports){
|
|
4439
7138
|
"use strict";
|
|
4440
7139
|
var __extends = (this && this.__extends) || (function () {
|
|
4441
7140
|
var extendStatics = function (d, b) {
|
|
@@ -4649,7 +7348,7 @@ var TypeAheadElement = /** @class */ (function (_super) {
|
|
|
4649
7348
|
}(CustomInputElement_1.CustomInputElement));
|
|
4650
7349
|
exports.TypeAheadElement = TypeAheadElement;
|
|
4651
7350
|
|
|
4652
|
-
},{"../../framework/CustomEvents":
|
|
7351
|
+
},{"../../framework/CustomEvents":34,"../../framework/CustomInputElement":35,"../../framework/Utilities/DomUtility":60,"../../framework/custom-element.decorator":73}],34:[function(require,module,exports){
|
|
4653
7352
|
"use strict";
|
|
4654
7353
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4655
7354
|
exports.CustomElementEvent = exports.CustomElementEventArgs = void 0;
|
|
@@ -4698,7 +7397,7 @@ var CustomElementEvent = /** @class */ (function () {
|
|
|
4698
7397
|
}());
|
|
4699
7398
|
exports.CustomElementEvent = CustomElementEvent;
|
|
4700
7399
|
|
|
4701
|
-
},{}],
|
|
7400
|
+
},{}],35:[function(require,module,exports){
|
|
4702
7401
|
"use strict";
|
|
4703
7402
|
var __extends = (this && this.__extends) || (function () {
|
|
4704
7403
|
var extendStatics = function (d, b) {
|
|
@@ -4960,7 +7659,7 @@ var CustomInputElement = /** @class */ (function (_super) {
|
|
|
4960
7659
|
}(HTMLElement));
|
|
4961
7660
|
exports.CustomInputElement = CustomInputElement;
|
|
4962
7661
|
|
|
4963
|
-
},{"./CustomEvents":
|
|
7662
|
+
},{"./CustomEvents":34,"./Utilities/ArrayUtil":58,"./Utilities/DomUtil":59}],36:[function(require,module,exports){
|
|
4964
7663
|
"use strict";
|
|
4965
7664
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4966
7665
|
var BaseDictionary = /** @class */ (function () {
|
|
@@ -4982,7 +7681,7 @@ var BaseDictionary = /** @class */ (function () {
|
|
|
4982
7681
|
}());
|
|
4983
7682
|
exports.default = BaseDictionary;
|
|
4984
7683
|
|
|
4985
|
-
},{}],
|
|
7684
|
+
},{}],37:[function(require,module,exports){
|
|
4986
7685
|
"use strict";
|
|
4987
7686
|
var __extends = (this && this.__extends) || (function () {
|
|
4988
7687
|
var extendStatics = function (d, b) {
|
|
@@ -5023,7 +7722,7 @@ var CzechDictionary = /** @class */ (function (_super) {
|
|
|
5023
7722
|
}(BaseDictionary_1.default));
|
|
5024
7723
|
exports.default = CzechDictionary;
|
|
5025
7724
|
|
|
5026
|
-
},{"./Base/BaseDictionary":
|
|
7725
|
+
},{"./Base/BaseDictionary":36}],38:[function(require,module,exports){
|
|
5027
7726
|
"use strict";
|
|
5028
7727
|
var __extends = (this && this.__extends) || (function () {
|
|
5029
7728
|
var extendStatics = function (d, b) {
|
|
@@ -5064,7 +7763,7 @@ var DanishDictionary = /** @class */ (function (_super) {
|
|
|
5064
7763
|
}(BaseDictionary_1.default));
|
|
5065
7764
|
exports.default = DanishDictionary;
|
|
5066
7765
|
|
|
5067
|
-
},{"./Base/BaseDictionary":
|
|
7766
|
+
},{"./Base/BaseDictionary":36}],39:[function(require,module,exports){
|
|
5068
7767
|
"use strict";
|
|
5069
7768
|
var __extends = (this && this.__extends) || (function () {
|
|
5070
7769
|
var extendStatics = function (d, b) {
|
|
@@ -5105,7 +7804,7 @@ var DutchDictionary = /** @class */ (function (_super) {
|
|
|
5105
7804
|
}(BaseDictionary_1.default));
|
|
5106
7805
|
exports.default = DutchDictionary;
|
|
5107
7806
|
|
|
5108
|
-
},{"./Base/BaseDictionary":
|
|
7807
|
+
},{"./Base/BaseDictionary":36}],40:[function(require,module,exports){
|
|
5109
7808
|
"use strict";
|
|
5110
7809
|
var __extends = (this && this.__extends) || (function () {
|
|
5111
7810
|
var extendStatics = function (d, b) {
|
|
@@ -5146,7 +7845,7 @@ var EnglishDictionary = /** @class */ (function (_super) {
|
|
|
5146
7845
|
}(BaseDictionary_1.default));
|
|
5147
7846
|
exports.default = EnglishDictionary;
|
|
5148
7847
|
|
|
5149
|
-
},{"./Base/BaseDictionary":
|
|
7848
|
+
},{"./Base/BaseDictionary":36}],41:[function(require,module,exports){
|
|
5150
7849
|
"use strict";
|
|
5151
7850
|
var __extends = (this && this.__extends) || (function () {
|
|
5152
7851
|
var extendStatics = function (d, b) {
|
|
@@ -5187,7 +7886,7 @@ var EstonianDictionary = /** @class */ (function (_super) {
|
|
|
5187
7886
|
}(BaseDictionary_1.default));
|
|
5188
7887
|
exports.default = EstonianDictionary;
|
|
5189
7888
|
|
|
5190
|
-
},{"./Base/BaseDictionary":
|
|
7889
|
+
},{"./Base/BaseDictionary":36}],42:[function(require,module,exports){
|
|
5191
7890
|
"use strict";
|
|
5192
7891
|
var __extends = (this && this.__extends) || (function () {
|
|
5193
7892
|
var extendStatics = function (d, b) {
|
|
@@ -5228,7 +7927,7 @@ var FinnishDictionary = /** @class */ (function (_super) {
|
|
|
5228
7927
|
}(BaseDictionary_1.default));
|
|
5229
7928
|
exports.default = FinnishDictionary;
|
|
5230
7929
|
|
|
5231
|
-
},{"./Base/BaseDictionary":
|
|
7930
|
+
},{"./Base/BaseDictionary":36}],43:[function(require,module,exports){
|
|
5232
7931
|
"use strict";
|
|
5233
7932
|
var __extends = (this && this.__extends) || (function () {
|
|
5234
7933
|
var extendStatics = function (d, b) {
|
|
@@ -5269,7 +7968,7 @@ var FrenchDictionary = /** @class */ (function (_super) {
|
|
|
5269
7968
|
}(BaseDictionary_1.default));
|
|
5270
7969
|
exports.default = FrenchDictionary;
|
|
5271
7970
|
|
|
5272
|
-
},{"./Base/BaseDictionary":
|
|
7971
|
+
},{"./Base/BaseDictionary":36}],44:[function(require,module,exports){
|
|
5273
7972
|
"use strict";
|
|
5274
7973
|
var __extends = (this && this.__extends) || (function () {
|
|
5275
7974
|
var extendStatics = function (d, b) {
|
|
@@ -5310,7 +8009,7 @@ var GermanDictionary = /** @class */ (function (_super) {
|
|
|
5310
8009
|
}(BaseDictionary_1.default));
|
|
5311
8010
|
exports.default = GermanDictionary;
|
|
5312
8011
|
|
|
5313
|
-
},{"./Base/BaseDictionary":
|
|
8012
|
+
},{"./Base/BaseDictionary":36}],45:[function(require,module,exports){
|
|
5314
8013
|
"use strict";
|
|
5315
8014
|
var __extends = (this && this.__extends) || (function () {
|
|
5316
8015
|
var extendStatics = function (d, b) {
|
|
@@ -5351,7 +8050,7 @@ var GreekDictionary = /** @class */ (function (_super) {
|
|
|
5351
8050
|
}(BaseDictionary_1.default));
|
|
5352
8051
|
exports.default = GreekDictionary;
|
|
5353
8052
|
|
|
5354
|
-
},{"./Base/BaseDictionary":
|
|
8053
|
+
},{"./Base/BaseDictionary":36}],46:[function(require,module,exports){
|
|
5355
8054
|
"use strict";
|
|
5356
8055
|
var __extends = (this && this.__extends) || (function () {
|
|
5357
8056
|
var extendStatics = function (d, b) {
|
|
@@ -5392,7 +8091,7 @@ var HungarianDictionary = /** @class */ (function (_super) {
|
|
|
5392
8091
|
}(BaseDictionary_1.default));
|
|
5393
8092
|
exports.default = HungarianDictionary;
|
|
5394
8093
|
|
|
5395
|
-
},{"./Base/BaseDictionary":
|
|
8094
|
+
},{"./Base/BaseDictionary":36}],47:[function(require,module,exports){
|
|
5396
8095
|
"use strict";
|
|
5397
8096
|
var __extends = (this && this.__extends) || (function () {
|
|
5398
8097
|
var extendStatics = function (d, b) {
|
|
@@ -5433,7 +8132,7 @@ var IcelandicDictionary = /** @class */ (function (_super) {
|
|
|
5433
8132
|
}(BaseDictionary_1.default));
|
|
5434
8133
|
exports.default = IcelandicDictionary;
|
|
5435
8134
|
|
|
5436
|
-
},{"./Base/BaseDictionary":
|
|
8135
|
+
},{"./Base/BaseDictionary":36}],48:[function(require,module,exports){
|
|
5437
8136
|
"use strict";
|
|
5438
8137
|
var __extends = (this && this.__extends) || (function () {
|
|
5439
8138
|
var extendStatics = function (d, b) {
|
|
@@ -5474,7 +8173,7 @@ var ItalianDictionary = /** @class */ (function (_super) {
|
|
|
5474
8173
|
}(BaseDictionary_1.default));
|
|
5475
8174
|
exports.default = ItalianDictionary;
|
|
5476
8175
|
|
|
5477
|
-
},{"./Base/BaseDictionary":
|
|
8176
|
+
},{"./Base/BaseDictionary":36}],49:[function(require,module,exports){
|
|
5478
8177
|
"use strict";
|
|
5479
8178
|
var __extends = (this && this.__extends) || (function () {
|
|
5480
8179
|
var extendStatics = function (d, b) {
|
|
@@ -5515,7 +8214,7 @@ var LatvianDictionary = /** @class */ (function (_super) {
|
|
|
5515
8214
|
}(BaseDictionary_1.default));
|
|
5516
8215
|
exports.default = LatvianDictionary;
|
|
5517
8216
|
|
|
5518
|
-
},{"./Base/BaseDictionary":
|
|
8217
|
+
},{"./Base/BaseDictionary":36}],50:[function(require,module,exports){
|
|
5519
8218
|
"use strict";
|
|
5520
8219
|
var __extends = (this && this.__extends) || (function () {
|
|
5521
8220
|
var extendStatics = function (d, b) {
|
|
@@ -5556,7 +8255,7 @@ var LituanianDictionary = /** @class */ (function (_super) {
|
|
|
5556
8255
|
}(BaseDictionary_1.default));
|
|
5557
8256
|
exports.default = LituanianDictionary;
|
|
5558
8257
|
|
|
5559
|
-
},{"./Base/BaseDictionary":
|
|
8258
|
+
},{"./Base/BaseDictionary":36}],51:[function(require,module,exports){
|
|
5560
8259
|
"use strict";
|
|
5561
8260
|
var __extends = (this && this.__extends) || (function () {
|
|
5562
8261
|
var extendStatics = function (d, b) {
|
|
@@ -5597,7 +8296,7 @@ var NorwegianDictionary = /** @class */ (function (_super) {
|
|
|
5597
8296
|
}(BaseDictionary_1.default));
|
|
5598
8297
|
exports.default = NorwegianDictionary;
|
|
5599
8298
|
|
|
5600
|
-
},{"./Base/BaseDictionary":
|
|
8299
|
+
},{"./Base/BaseDictionary":36}],52:[function(require,module,exports){
|
|
5601
8300
|
"use strict";
|
|
5602
8301
|
var __extends = (this && this.__extends) || (function () {
|
|
5603
8302
|
var extendStatics = function (d, b) {
|
|
@@ -5638,7 +8337,7 @@ var PolishDictionary = /** @class */ (function (_super) {
|
|
|
5638
8337
|
}(BaseDictionary_1.default));
|
|
5639
8338
|
exports.default = PolishDictionary;
|
|
5640
8339
|
|
|
5641
|
-
},{"./Base/BaseDictionary":
|
|
8340
|
+
},{"./Base/BaseDictionary":36}],53:[function(require,module,exports){
|
|
5642
8341
|
"use strict";
|
|
5643
8342
|
var __extends = (this && this.__extends) || (function () {
|
|
5644
8343
|
var extendStatics = function (d, b) {
|
|
@@ -5679,7 +8378,7 @@ var PortugueseDictionary = /** @class */ (function (_super) {
|
|
|
5679
8378
|
}(BaseDictionary_1.default));
|
|
5680
8379
|
exports.default = PortugueseDictionary;
|
|
5681
8380
|
|
|
5682
|
-
},{"./Base/BaseDictionary":
|
|
8381
|
+
},{"./Base/BaseDictionary":36}],54:[function(require,module,exports){
|
|
5683
8382
|
"use strict";
|
|
5684
8383
|
var __extends = (this && this.__extends) || (function () {
|
|
5685
8384
|
var extendStatics = function (d, b) {
|
|
@@ -5720,7 +8419,7 @@ var SpanishDictionary = /** @class */ (function (_super) {
|
|
|
5720
8419
|
}(BaseDictionary_1.default));
|
|
5721
8420
|
exports.default = SpanishDictionary;
|
|
5722
8421
|
|
|
5723
|
-
},{"./Base/BaseDictionary":
|
|
8422
|
+
},{"./Base/BaseDictionary":36}],55:[function(require,module,exports){
|
|
5724
8423
|
"use strict";
|
|
5725
8424
|
var __extends = (this && this.__extends) || (function () {
|
|
5726
8425
|
var extendStatics = function (d, b) {
|
|
@@ -5761,7 +8460,7 @@ var SwedishDictionary = /** @class */ (function (_super) {
|
|
|
5761
8460
|
}(BaseDictionary_1.default));
|
|
5762
8461
|
exports.default = SwedishDictionary;
|
|
5763
8462
|
|
|
5764
|
-
},{"./Base/BaseDictionary":
|
|
8463
|
+
},{"./Base/BaseDictionary":36}],56:[function(require,module,exports){
|
|
5765
8464
|
"use strict";
|
|
5766
8465
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5767
8466
|
var DanishDictionary_1 = require("./Languages/DanishDictionary");
|
|
@@ -5878,7 +8577,7 @@ var Translator = /** @class */ (function () {
|
|
|
5878
8577
|
}());
|
|
5879
8578
|
exports.default = Translator;
|
|
5880
8579
|
|
|
5881
|
-
},{"./Languages/CzechDictionary":
|
|
8580
|
+
},{"./Languages/CzechDictionary":37,"./Languages/DanishDictionary":38,"./Languages/DutchDictionary":39,"./Languages/EnglishDictionary":40,"./Languages/EstonianDictionary":41,"./Languages/FinnishDictionary":42,"./Languages/FrenchDictionary":43,"./Languages/GermanDictionary":44,"./Languages/GreekDictionary":45,"./Languages/HungarianDictionary":46,"./Languages/IcelandicDictionary":47,"./Languages/ItalianDictionary":48,"./Languages/LatvianDictionary":49,"./Languages/LituanianDictionary":50,"./Languages/NorwegianDictionary":51,"./Languages/PolishDictionary":52,"./Languages/PortugueseDictionary":53,"./Languages/SpanishDictionary":54,"./Languages/SwedishDictionary":55}],57:[function(require,module,exports){
|
|
5882
8581
|
"use strict";
|
|
5883
8582
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5884
8583
|
function getAttributeNamesPolyfill() {
|
|
@@ -5897,7 +8596,7 @@ function getAttributeNamesPolyfill() {
|
|
|
5897
8596
|
exports.default = getAttributeNamesPolyfill;
|
|
5898
8597
|
;
|
|
5899
8598
|
|
|
5900
|
-
},{}],
|
|
8599
|
+
},{}],58:[function(require,module,exports){
|
|
5901
8600
|
"use strict";
|
|
5902
8601
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5903
8602
|
var ArrayUtil = /** @class */ (function () {
|
|
@@ -5935,7 +8634,7 @@ var ArrayUtil = /** @class */ (function () {
|
|
|
5935
8634
|
}());
|
|
5936
8635
|
exports.default = ArrayUtil;
|
|
5937
8636
|
|
|
5938
|
-
},{}],
|
|
8637
|
+
},{}],59:[function(require,module,exports){
|
|
5939
8638
|
"use strict";
|
|
5940
8639
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5941
8640
|
var ViewportUtil_1 = require("./ViewportUtil");
|
|
@@ -6038,7 +8737,7 @@ var DomUtil = /** @class */ (function () {
|
|
|
6038
8737
|
}());
|
|
6039
8738
|
exports.default = DomUtil;
|
|
6040
8739
|
|
|
6041
|
-
},{"./ViewportUtil":
|
|
8740
|
+
},{"./ViewportUtil":63}],60:[function(require,module,exports){
|
|
6042
8741
|
"use strict";
|
|
6043
8742
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6044
8743
|
var DomUtility = /** @class */ (function () {
|
|
@@ -6052,7 +8751,7 @@ var DomUtility = /** @class */ (function () {
|
|
|
6052
8751
|
}());
|
|
6053
8752
|
exports.default = DomUtility;
|
|
6054
8753
|
|
|
6055
|
-
},{}],
|
|
8754
|
+
},{}],61:[function(require,module,exports){
|
|
6056
8755
|
"use strict";
|
|
6057
8756
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6058
8757
|
var MakeRequest = /** @class */ (function () {
|
|
@@ -6102,7 +8801,7 @@ var MakeRequest = /** @class */ (function () {
|
|
|
6102
8801
|
}());
|
|
6103
8802
|
exports.default = MakeRequest;
|
|
6104
8803
|
|
|
6105
|
-
},{}],
|
|
8804
|
+
},{}],62:[function(require,module,exports){
|
|
6106
8805
|
"use strict";
|
|
6107
8806
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6108
8807
|
exports.StringUtil = void 0;
|
|
@@ -6120,7 +8819,7 @@ var StringUtil = /** @class */ (function () {
|
|
|
6120
8819
|
}());
|
|
6121
8820
|
exports.StringUtil = StringUtil;
|
|
6122
8821
|
|
|
6123
|
-
},{}],
|
|
8822
|
+
},{}],63:[function(require,module,exports){
|
|
6124
8823
|
"use strict";
|
|
6125
8824
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6126
8825
|
exports.ViewportUtil = void 0;
|
|
@@ -6164,7 +8863,7 @@ var ViewportUtil = /** @class */ (function () {
|
|
|
6164
8863
|
}());
|
|
6165
8864
|
exports.ViewportUtil = ViewportUtil;
|
|
6166
8865
|
|
|
6167
|
-
},{}],
|
|
8866
|
+
},{}],64:[function(require,module,exports){
|
|
6168
8867
|
"use strict";
|
|
6169
8868
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6170
8869
|
var debouncer = function (func, wait, immediate) {
|
|
@@ -6217,7 +8916,7 @@ var debouncer = function (func, wait, immediate) {
|
|
|
6217
8916
|
};
|
|
6218
8917
|
exports.default = debouncer;
|
|
6219
8918
|
|
|
6220
|
-
},{}],
|
|
8919
|
+
},{}],65:[function(require,module,exports){
|
|
6221
8920
|
"use strict";
|
|
6222
8921
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6223
8922
|
var BankAccountValidator = /** @class */ (function () {
|
|
@@ -6231,7 +8930,7 @@ var BankAccountValidator = /** @class */ (function () {
|
|
|
6231
8930
|
}());
|
|
6232
8931
|
exports.default = BankAccountValidator;
|
|
6233
8932
|
|
|
6234
|
-
},{}],
|
|
8933
|
+
},{}],66:[function(require,module,exports){
|
|
6235
8934
|
"use strict";
|
|
6236
8935
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6237
8936
|
var BankAccountRegistrationNumberValidator = /** @class */ (function () {
|
|
@@ -6245,7 +8944,7 @@ var BankAccountRegistrationNumberValidator = /** @class */ (function () {
|
|
|
6245
8944
|
}());
|
|
6246
8945
|
exports.default = BankAccountRegistrationNumberValidator;
|
|
6247
8946
|
|
|
6248
|
-
},{}],
|
|
8947
|
+
},{}],67:[function(require,module,exports){
|
|
6249
8948
|
"use strict";
|
|
6250
8949
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6251
8950
|
var BankIdNorwayValidator = /** @class */ (function () {
|
|
@@ -6268,7 +8967,7 @@ var BankIdNorwayValidator = /** @class */ (function () {
|
|
|
6268
8967
|
}());
|
|
6269
8968
|
exports.default = BankIdNorwayValidator;
|
|
6270
8969
|
|
|
6271
|
-
},{}],
|
|
8970
|
+
},{}],68:[function(require,module,exports){
|
|
6272
8971
|
"use strict";
|
|
6273
8972
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6274
8973
|
var BankIdSwedenValidator = /** @class */ (function () {
|
|
@@ -6291,7 +8990,7 @@ var BankIdSwedenValidator = /** @class */ (function () {
|
|
|
6291
8990
|
}());
|
|
6292
8991
|
exports.default = BankIdSwedenValidator;
|
|
6293
8992
|
|
|
6294
|
-
},{}],
|
|
8993
|
+
},{}],69:[function(require,module,exports){
|
|
6295
8994
|
"use strict";
|
|
6296
8995
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6297
8996
|
var CprValidator = /** @class */ (function () {
|
|
@@ -6368,7 +9067,7 @@ var CprValidator = /** @class */ (function () {
|
|
|
6368
9067
|
}());
|
|
6369
9068
|
exports.default = CprValidator;
|
|
6370
9069
|
|
|
6371
|
-
},{}],
|
|
9070
|
+
},{}],70:[function(require,module,exports){
|
|
6372
9071
|
"use strict";
|
|
6373
9072
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6374
9073
|
var CvrValidator = /** @class */ (function () {
|
|
@@ -6400,7 +9099,7 @@ var CvrValidator = /** @class */ (function () {
|
|
|
6400
9099
|
}());
|
|
6401
9100
|
exports.default = CvrValidator;
|
|
6402
9101
|
|
|
6403
|
-
},{}],
|
|
9102
|
+
},{}],71:[function(require,module,exports){
|
|
6404
9103
|
"use strict";
|
|
6405
9104
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6406
9105
|
var SECompanyRegistrationValidator = /** @class */ (function () {
|
|
@@ -6439,7 +9138,7 @@ var SECompanyRegistrationValidator = /** @class */ (function () {
|
|
|
6439
9138
|
}());
|
|
6440
9139
|
exports.default = SECompanyRegistrationValidator;
|
|
6441
9140
|
|
|
6442
|
-
},{}],
|
|
9141
|
+
},{}],72:[function(require,module,exports){
|
|
6443
9142
|
"use strict";
|
|
6444
9143
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6445
9144
|
var SEPersonalNumberValidator = /** @class */ (function () {
|
|
@@ -6483,7 +9182,7 @@ var SEPersonalNumberValidator = /** @class */ (function () {
|
|
|
6483
9182
|
}());
|
|
6484
9183
|
exports.default = SEPersonalNumberValidator;
|
|
6485
9184
|
|
|
6486
|
-
},{}],
|
|
9185
|
+
},{}],73:[function(require,module,exports){
|
|
6487
9186
|
"use strict";
|
|
6488
9187
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6489
9188
|
var elementConfig = /** @class */ (function () {
|
|
@@ -6536,7 +9235,7 @@ var CustomElement = function (config) {
|
|
|
6536
9235
|
};
|
|
6537
9236
|
exports.default = CustomElement;
|
|
6538
9237
|
|
|
6539
|
-
},{}],
|
|
9238
|
+
},{}],74:[function(require,module,exports){
|
|
6540
9239
|
"use strict";
|
|
6541
9240
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6542
9241
|
exports.CustomInputElement = exports.elements = exports.CustomForm = void 0;
|
|
@@ -6552,6 +9251,6 @@ Object.defineProperty(exports, "CustomInputElement", { enumerable: true, get: fu
|
|
|
6552
9251
|
var elements = require("./elements/Elements");
|
|
6553
9252
|
exports.elements = elements;
|
|
6554
9253
|
|
|
6555
|
-
},{"./custom-form":
|
|
9254
|
+
},{"./custom-form":10,"./elements/Elements":20,"./framework/CustomInputElement":35,"@webcomponents/webcomponentsjs/custom-elements-es5-adapter.js":2,"@webcomponents/webcomponentsjs/webcomponents-bundle":3,"@webcomponents/webcomponentsjs/webcomponents-loader.js":4}]},{},[1])
|
|
6556
9255
|
|
|
6557
9256
|
//# sourceMappingURL=index.min.js.map
|