@luftborn/custom-elements 2.8.0 → 2.8.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/demo/index.js +466 -2853
- package/demo/index.min.js +465 -2852
- package/demo/index.min.js.map +1 -1
- package/dist/elements/CustomFormatDateFieldElement/CustomDatepicker/CustomDatepicker.d.ts +45 -0
- package/dist/elements/CustomFormatDateFieldElement/CustomDatepicker/CustomDatepicker.js +327 -0
- package/dist/elements/CustomFormatDateFieldElement/CustomDatepicker/CustomDatepicker.js.map +1 -0
- package/dist/elements/CustomFormatDateFieldElement/CustomDatepicker/CustomDatepickerStyles.d.ts +1 -0
- package/dist/elements/CustomFormatDateFieldElement/CustomDatepicker/CustomDatepickerStyles.js +5 -0
- package/dist/elements/CustomFormatDateFieldElement/CustomDatepicker/CustomDatepickerStyles.js.map +1 -0
- package/dist/elements/CustomFormatDateFieldElement/CustomDatepicker/CustomDatepickerUtils.d.ts +6 -0
- package/dist/elements/CustomFormatDateFieldElement/CustomDatepicker/CustomDatepickerUtils.js +45 -0
- package/dist/elements/CustomFormatDateFieldElement/CustomDatepicker/CustomDatepickerUtils.js.map +1 -0
- package/dist/elements/CustomFormatDateFieldElement/CustomFormatDateFieldElement.d.ts +2 -6
- package/dist/elements/CustomFormatDateFieldElement/CustomFormatDateFieldElement.js +14 -60
- package/dist/elements/CustomFormatDateFieldElement/CustomFormatDateFieldElement.js.map +1 -1
- package/package.json +1 -2
- package/src/elements/CustomFormatDateFieldElement/CustomDatepicker/CustomDatepicker.ts +355 -0
- package/src/elements/CustomFormatDateFieldElement/CustomDatepicker/CustomDatepickerStyles.ts +101 -0
- package/src/elements/CustomFormatDateFieldElement/CustomDatepicker/CustomDatepickerUtils.ts +44 -0
- package/src/elements/CustomFormatDateFieldElement/CustomFormatDateFieldElement.ts +18 -72
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":76}],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":8}],4:[function(require,module,exports){
|
|
407
407
|
/**
|
|
408
408
|
* @license
|
|
409
409
|
* Copyright (c) 2018 The Polymer Project Authors. All rights reserved.
|
|
@@ -612,2727 +612,6 @@ 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){
|
|
3336
615
|
/*
|
|
3337
616
|
* International Telephone Input v16.1.0
|
|
3338
617
|
* https://github.com/jackocnr/intl-tel-input.git
|
|
@@ -4664,13 +1943,13 @@ var hj=window.customElements,ij=!1,jj=null;hj.polyfillWrapFlushCallback&&hj.poly
|
|
|
4664
1943
|
};
|
|
4665
1944
|
}();
|
|
4666
1945
|
});
|
|
4667
|
-
},{}],
|
|
1946
|
+
},{}],6:[function(require,module,exports){
|
|
4668
1947
|
/**
|
|
4669
1948
|
* Exposing intl-tel-input as a component
|
|
4670
1949
|
*/
|
|
4671
1950
|
module.exports = require("./build/js/intlTelInput");
|
|
4672
1951
|
|
|
4673
|
-
},{"./build/js/intlTelInput":
|
|
1952
|
+
},{"./build/js/intlTelInput":5}],7:[function(require,module,exports){
|
|
4674
1953
|
// shim for using process in browser
|
|
4675
1954
|
var process = module.exports = {};
|
|
4676
1955
|
|
|
@@ -4856,7 +2135,7 @@ process.chdir = function (dir) {
|
|
|
4856
2135
|
};
|
|
4857
2136
|
process.umask = function() { return 0; };
|
|
4858
2137
|
|
|
4859
|
-
},{}],
|
|
2138
|
+
},{}],8:[function(require,module,exports){
|
|
4860
2139
|
(function (setImmediate,clearImmediate){(function (){
|
|
4861
2140
|
var nextTick = require('process/browser.js').nextTick;
|
|
4862
2141
|
var apply = Function.prototype.apply;
|
|
@@ -4936,7 +2215,7 @@ exports.clearImmediate = typeof clearImmediate === "function" ? clearImmediate :
|
|
|
4936
2215
|
};
|
|
4937
2216
|
}).call(this)}).call(this,require("timers").setImmediate,require("timers").clearImmediate)
|
|
4938
2217
|
|
|
4939
|
-
},{"process/browser.js":
|
|
2218
|
+
},{"process/browser.js":7,"timers":8}],9:[function(require,module,exports){
|
|
4940
2219
|
"use strict";
|
|
4941
2220
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4942
2221
|
exports.CustomForm = void 0;
|
|
@@ -5088,7 +2367,7 @@ var CustomForm = /** @class */ (function () {
|
|
|
5088
2367
|
}());
|
|
5089
2368
|
exports.CustomForm = CustomForm;
|
|
5090
2369
|
|
|
5091
|
-
},{"./elements/FileField/FileFieldElement":
|
|
2370
|
+
},{"./elements/FileField/FileFieldElement":24,"./framework/Utilities/ArrayUtil":60,"./framework/Utilities/MakeRequest":63}],10:[function(require,module,exports){
|
|
5092
2371
|
"use strict";
|
|
5093
2372
|
var __extends = (this && this.__extends) || (function () {
|
|
5094
2373
|
var extendStatics = function (d, b) {
|
|
@@ -5296,7 +2575,7 @@ var AddressElement = /** @class */ (function (_super) {
|
|
|
5296
2575
|
}(CustomInputElement_1.CustomInputElement));
|
|
5297
2576
|
exports.AddressElement = AddressElement;
|
|
5298
2577
|
|
|
5299
|
-
},{"../../framework/CustomEvents":
|
|
2578
|
+
},{"../../framework/CustomEvents":36,"../../framework/CustomInputElement":37,"../../framework/Language/Translator":58,"../../framework/Polyfills/getAttributeNamesPolyfill":59,"../../framework/Utilities/debouncer":66,"../../framework/custom-element.decorator":75}],11:[function(require,module,exports){
|
|
5300
2579
|
"use strict";
|
|
5301
2580
|
var __extends = (this && this.__extends) || (function () {
|
|
5302
2581
|
var extendStatics = function (d, b) {
|
|
@@ -5425,7 +2704,7 @@ var BankFieldElement = /** @class */ (function (_super) {
|
|
|
5425
2704
|
}(CustomInputElement_1.CustomInputElement));
|
|
5426
2705
|
exports.BankFieldElement = BankFieldElement;
|
|
5427
2706
|
|
|
5428
|
-
},{"../../framework/CustomEvents":
|
|
2707
|
+
},{"../../framework/CustomEvents":36,"../../framework/CustomInputElement":37,"../../framework/Language/Translator":58,"../../framework/Validation/Validators/BankAccount":67,"../../framework/Validation/Validators/BankAccountRegistrationNumber":68,"../../framework/custom-element.decorator":75}],12:[function(require,module,exports){
|
|
5429
2708
|
"use strict";
|
|
5430
2709
|
var __extends = (this && this.__extends) || (function () {
|
|
5431
2710
|
var extendStatics = function (d, b) {
|
|
@@ -5509,7 +2788,7 @@ var CPRElement = /** @class */ (function (_super) {
|
|
|
5509
2788
|
}(CustomInputElement_1.CustomInputElement));
|
|
5510
2789
|
exports.CPRElement = CPRElement;
|
|
5511
2790
|
|
|
5512
|
-
},{"../../framework/CustomEvents":
|
|
2791
|
+
},{"../../framework/CustomEvents":36,"../../framework/CustomInputElement":37,"../../framework/Validation/Validators/CPR":71,"../../framework/custom-element.decorator":75}],13:[function(require,module,exports){
|
|
5513
2792
|
"use strict";
|
|
5514
2793
|
var __extends = (this && this.__extends) || (function () {
|
|
5515
2794
|
var extendStatics = function (d, b) {
|
|
@@ -5593,7 +2872,7 @@ var CVRElement = /** @class */ (function (_super) {
|
|
|
5593
2872
|
}(CustomInputElement_1.CustomInputElement));
|
|
5594
2873
|
exports.CVRElement = CVRElement;
|
|
5595
2874
|
|
|
5596
|
-
},{"../../framework/CustomEvents":
|
|
2875
|
+
},{"../../framework/CustomEvents":36,"../../framework/CustomInputElement":37,"../../framework/Validation/Validators/CVR":72,"../../framework/custom-element.decorator":75}],14:[function(require,module,exports){
|
|
5597
2876
|
"use strict";
|
|
5598
2877
|
var __extends = (this && this.__extends) || (function () {
|
|
5599
2878
|
var extendStatics = function (d, b) {
|
|
@@ -5691,7 +2970,387 @@ var CheckBoxElement = /** @class */ (function (_super) {
|
|
|
5691
2970
|
}(CustomInputElement_1.CustomInputElement));
|
|
5692
2971
|
exports.CheckBoxElement = CheckBoxElement;
|
|
5693
2972
|
|
|
5694
|
-
},{"../../framework/CustomEvents":
|
|
2973
|
+
},{"../../framework/CustomEvents":36,"../../framework/CustomInputElement":37,"../../framework/Utilities/StringUtil":64,"../../framework/custom-element.decorator":75}],15:[function(require,module,exports){
|
|
2974
|
+
"use strict";
|
|
2975
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2976
|
+
var CustomDatepickerStyles_1 = require("./CustomDatepickerStyles");
|
|
2977
|
+
var CustomDatepickerUtils_1 = require("./CustomDatepickerUtils");
|
|
2978
|
+
var CustomDatepicker = /** @class */ (function () {
|
|
2979
|
+
function CustomDatepicker(options) {
|
|
2980
|
+
this.input = options.input;
|
|
2981
|
+
this.dateFormat = CustomDatepickerUtils_1.supportedDateFormats.includes(options.dateFormat) ? options.dateFormat : CustomDatepickerUtils_1.defaultDateFormat;
|
|
2982
|
+
this.otherTriggers = options.otherTriggers || [];
|
|
2983
|
+
this.parentElement = options.parentElement;
|
|
2984
|
+
this.currentDate = new Date();
|
|
2985
|
+
this.currentMonth = this.currentDate.getMonth();
|
|
2986
|
+
this.currentYear = this.currentDate.getFullYear();
|
|
2987
|
+
this.selectedDate = new Date();
|
|
2988
|
+
this.selectedMonth = this.selectedDate.getMonth();
|
|
2989
|
+
this.selectedYear = this.selectedDate.getFullYear();
|
|
2990
|
+
this.selectedDay = this.selectedDate.getDate();
|
|
2991
|
+
this.firstDayOfMonth = new Date(this.currentYear, this.currentMonth, 1);
|
|
2992
|
+
this.lastDayOfMonth = new Date(this.currentYear, this.currentMonth + 1, 0);
|
|
2993
|
+
this.firstDay = this.firstDayOfMonth.getDay();
|
|
2994
|
+
this.lastDay = this.lastDayOfMonth.getDate();
|
|
2995
|
+
this.createDatePickerElements();
|
|
2996
|
+
this.renderCalendar();
|
|
2997
|
+
this.initSelectMonthYear();
|
|
2998
|
+
this.addEventListeners();
|
|
2999
|
+
}
|
|
3000
|
+
CustomDatepicker.prototype.createDatePickerElements = function () {
|
|
3001
|
+
var _this = this;
|
|
3002
|
+
this.datepicker = document.createElement('div');
|
|
3003
|
+
this.datepicker.classList.add('datepicker');
|
|
3004
|
+
this.header = document.createElement('div');
|
|
3005
|
+
this.header.classList.add('header');
|
|
3006
|
+
this.monthYear = document.createElement('span');
|
|
3007
|
+
this.monthYear.classList.add('month-year');
|
|
3008
|
+
this.monthYear.onclick = function () { return _this.toggleSelectMonthYear(); };
|
|
3009
|
+
this.selectNextMonth = document.createElement('span');
|
|
3010
|
+
this.selectNextMonth.classList.add('next-month');
|
|
3011
|
+
this.selectNextMonth.innerHTML = '▶';
|
|
3012
|
+
this.selectNextMonth.onclick = function () { return _this.moveMonth(1); };
|
|
3013
|
+
this.selectPrevMonth = document.createElement('span');
|
|
3014
|
+
this.selectPrevMonth.classList.add('prev-month');
|
|
3015
|
+
this.selectPrevMonth.innerHTML = '◀';
|
|
3016
|
+
this.selectPrevMonth.onclick = function () { return _this.moveMonth(-1); };
|
|
3017
|
+
this.header.appendChild(this.selectPrevMonth);
|
|
3018
|
+
this.header.appendChild(this.monthYear);
|
|
3019
|
+
this.header.appendChild(this.selectNextMonth);
|
|
3020
|
+
this.weekdays = document.createElement('div');
|
|
3021
|
+
this.weekdays.classList.add('weekdays');
|
|
3022
|
+
this.days = document.createElement('div');
|
|
3023
|
+
this.days.classList.add('days');
|
|
3024
|
+
this.selectMonthYear = document.createElement('div');
|
|
3025
|
+
this.selectMonthYear.classList.add('select-month-year');
|
|
3026
|
+
this.selectDate = document.createElement('div');
|
|
3027
|
+
this.selectDate.classList.add('select-date');
|
|
3028
|
+
this.datepicker.appendChild(this.header);
|
|
3029
|
+
this.datepicker.appendChild(this.selectDate);
|
|
3030
|
+
this.selectDate.appendChild(this.weekdays);
|
|
3031
|
+
this.selectDate.appendChild(this.days);
|
|
3032
|
+
this.datepicker.appendChild(this.selectMonthYear);
|
|
3033
|
+
var actions = document.createElement('div');
|
|
3034
|
+
actions.classList.add('actions');
|
|
3035
|
+
this.selectDate.appendChild(actions);
|
|
3036
|
+
var cancel = document.createElement('input');
|
|
3037
|
+
cancel.type = 'reset';
|
|
3038
|
+
cancel.value = 'Cancel';
|
|
3039
|
+
cancel.onclick = function () { return _this.showPicker(false); };
|
|
3040
|
+
actions.appendChild(cancel);
|
|
3041
|
+
var today = document.createElement('input');
|
|
3042
|
+
today.type = 'reset';
|
|
3043
|
+
today.value = 'Today';
|
|
3044
|
+
today.onclick = function () { return _this.setDateForToday(); };
|
|
3045
|
+
actions.appendChild(today);
|
|
3046
|
+
if (this.input.parentElement) {
|
|
3047
|
+
this.input.parentElement.appendChild(this.datepicker);
|
|
3048
|
+
}
|
|
3049
|
+
else {
|
|
3050
|
+
document.body.appendChild(this.datepicker);
|
|
3051
|
+
}
|
|
3052
|
+
this.applyStyles();
|
|
3053
|
+
};
|
|
3054
|
+
CustomDatepicker.prototype.applyStyles = function () {
|
|
3055
|
+
var style = document.createElement('style');
|
|
3056
|
+
style.innerHTML = CustomDatepickerStyles_1.CustomDatepickerStyles;
|
|
3057
|
+
this.datepicker.appendChild(style);
|
|
3058
|
+
};
|
|
3059
|
+
CustomDatepicker.prototype.moveMonth = function (steps) {
|
|
3060
|
+
var newMonth = this.currentMonth + steps;
|
|
3061
|
+
var newYear = this.currentYear;
|
|
3062
|
+
if (newMonth < 0) {
|
|
3063
|
+
newYear = this.currentYear + Math.floor(newMonth / 12);
|
|
3064
|
+
newMonth = 12 + (newMonth % 12);
|
|
3065
|
+
}
|
|
3066
|
+
else if (newMonth > 11) {
|
|
3067
|
+
newYear = this.currentYear + Math.floor(newMonth / 12);
|
|
3068
|
+
newMonth = newMonth % 12;
|
|
3069
|
+
}
|
|
3070
|
+
this.currentMonth = newMonth;
|
|
3071
|
+
this.currentYear = newYear;
|
|
3072
|
+
this.firstDayOfMonth = new Date(this.currentYear, this.currentMonth, 1);
|
|
3073
|
+
this.lastDayOfMonth = new Date(this.currentYear, this.currentMonth + 1, 0);
|
|
3074
|
+
this.firstDay = this.firstDayOfMonth.getDay();
|
|
3075
|
+
this.lastDay = this.lastDayOfMonth.getDate();
|
|
3076
|
+
this.renderCalendar();
|
|
3077
|
+
};
|
|
3078
|
+
CustomDatepicker.prototype.renderCalendar = function () {
|
|
3079
|
+
var _this = this;
|
|
3080
|
+
this.monthYear.innerHTML = CustomDatepickerUtils_1.months[this.currentMonth] + ' ' + this.currentYear;
|
|
3081
|
+
this.weekdays.innerHTML = '';
|
|
3082
|
+
for (var i = 0; i < CustomDatepickerUtils_1.daysOfWeek.length; i++) {
|
|
3083
|
+
var span = document.createElement('span');
|
|
3084
|
+
span.innerHTML = CustomDatepickerUtils_1.daysOfWeek[i];
|
|
3085
|
+
this.weekdays.appendChild(span);
|
|
3086
|
+
}
|
|
3087
|
+
this.days.innerHTML = '';
|
|
3088
|
+
var _loop_1 = function (i) {
|
|
3089
|
+
var span = document.createElement('span');
|
|
3090
|
+
if (i < this_1.firstDay) {
|
|
3091
|
+
span.classList.add('day-of-previous-month');
|
|
3092
|
+
span.style.color = '#ccc';
|
|
3093
|
+
var currentDate = new Date(this_1.currentYear, this_1.currentMonth, 0);
|
|
3094
|
+
span.innerHTML = (currentDate.getDate() - this_1.firstDay + i + 1).toString();
|
|
3095
|
+
}
|
|
3096
|
+
else if (i < this_1.lastDay + this_1.firstDay) {
|
|
3097
|
+
span.classList.add('day-of-current-month');
|
|
3098
|
+
span.innerHTML = (i - this_1.firstDay + 1).toString();
|
|
3099
|
+
if (i - this_1.firstDay + 1 === this_1.selectedDay && this_1.currentMonth === this_1.selectedMonth && this_1.currentYear === this_1.selectedYear) {
|
|
3100
|
+
span.classList.add('selected-day');
|
|
3101
|
+
}
|
|
3102
|
+
}
|
|
3103
|
+
else {
|
|
3104
|
+
span.classList.add('day-of-next-month');
|
|
3105
|
+
span.style.color = '#ccc';
|
|
3106
|
+
span.innerHTML = (i - this_1.lastDay - this_1.firstDay + 1).toString();
|
|
3107
|
+
}
|
|
3108
|
+
span.onclick = function () {
|
|
3109
|
+
var moveMonthSteps = 0;
|
|
3110
|
+
_this.selectedDay = parseInt(span.innerHTML);
|
|
3111
|
+
if (span.classList.contains('day-of-previous-month')) {
|
|
3112
|
+
_this.selectedMonth = _this.currentMonth - 1;
|
|
3113
|
+
_this.selectedYear = _this.currentYear;
|
|
3114
|
+
moveMonthSteps = -1;
|
|
3115
|
+
}
|
|
3116
|
+
else if (span.classList.contains('day-of-current-month')) {
|
|
3117
|
+
_this.selectedMonth = _this.currentMonth;
|
|
3118
|
+
_this.selectedYear = _this.currentYear;
|
|
3119
|
+
}
|
|
3120
|
+
else {
|
|
3121
|
+
_this.selectedMonth = _this.currentMonth + 1;
|
|
3122
|
+
_this.selectedYear = _this.currentYear;
|
|
3123
|
+
moveMonthSteps = 1;
|
|
3124
|
+
}
|
|
3125
|
+
_this.selectedDate = new Date(_this.selectedYear, _this.selectedMonth, _this.selectedDay);
|
|
3126
|
+
var selectedDayElement = _this.days.querySelector('.selected-day');
|
|
3127
|
+
if (selectedDayElement) {
|
|
3128
|
+
selectedDayElement.classList.remove('selected-day');
|
|
3129
|
+
}
|
|
3130
|
+
span.classList.add('selected-day');
|
|
3131
|
+
var formattedDate = (0, CustomDatepickerUtils_1.formatDate)(_this.selectedDate, _this.dateFormat);
|
|
3132
|
+
_this.input.value = formattedDate;
|
|
3133
|
+
_this.showPicker(false);
|
|
3134
|
+
};
|
|
3135
|
+
this_1.days.appendChild(span);
|
|
3136
|
+
};
|
|
3137
|
+
var this_1 = this;
|
|
3138
|
+
for (var i = 0; i < 42; i++) {
|
|
3139
|
+
_loop_1(i);
|
|
3140
|
+
}
|
|
3141
|
+
this.positionPicker();
|
|
3142
|
+
};
|
|
3143
|
+
CustomDatepicker.prototype.initSelectMonthYear = function () {
|
|
3144
|
+
var _this = this;
|
|
3145
|
+
this.selectMonthYear.style.display = 'none';
|
|
3146
|
+
this.selectMonthYear.style.height = '200px';
|
|
3147
|
+
if ((0, CustomDatepickerUtils_1.isMobileDevice)()) {
|
|
3148
|
+
this.selectMonthYear.style.height = '300px';
|
|
3149
|
+
}
|
|
3150
|
+
this.selectMonthYear.innerHTML = '';
|
|
3151
|
+
var monthsContainer = document.createElement('div');
|
|
3152
|
+
monthsContainer.classList.add('months');
|
|
3153
|
+
var _loop_2 = function (i) {
|
|
3154
|
+
var span = document.createElement('span');
|
|
3155
|
+
span.innerHTML = CustomDatepickerUtils_1.months[i].substring(0, 3);
|
|
3156
|
+
span.classList.add('select-month');
|
|
3157
|
+
monthsContainer.appendChild(span);
|
|
3158
|
+
span.onclick = function () {
|
|
3159
|
+
_this.selectedMonth = CustomDatepickerUtils_1.months.findIndex(function (month) { return month.substring(0, 3) === span.innerHTML; });
|
|
3160
|
+
var moveMonthSteps = (_this.selectedYear - _this.currentYear) * 12 + _this.selectedMonth - _this.currentMonth;
|
|
3161
|
+
_this.moveMonth(moveMonthSteps);
|
|
3162
|
+
_this.hideSelectMonthYear();
|
|
3163
|
+
};
|
|
3164
|
+
};
|
|
3165
|
+
for (var i = 0; i < CustomDatepickerUtils_1.months.length; i++) {
|
|
3166
|
+
_loop_2(i);
|
|
3167
|
+
}
|
|
3168
|
+
for (var i = this.currentYear - 100; i < this.currentYear + 100; i++) {
|
|
3169
|
+
var year = document.createElement('div');
|
|
3170
|
+
year.classList.add('year');
|
|
3171
|
+
year.innerHTML = i.toString();
|
|
3172
|
+
this.selectMonthYear.appendChild(year);
|
|
3173
|
+
if (i === this.currentYear) {
|
|
3174
|
+
year.appendChild(monthsContainer);
|
|
3175
|
+
}
|
|
3176
|
+
}
|
|
3177
|
+
var years = this.selectMonthYear.querySelectorAll('.year');
|
|
3178
|
+
var tempSelectedYear = this.selectedYear;
|
|
3179
|
+
var _loop_3 = function (i) {
|
|
3180
|
+
years[i].addEventListener('click', function () {
|
|
3181
|
+
var year = parseInt(years[i].innerHTML);
|
|
3182
|
+
if (year === tempSelectedYear) {
|
|
3183
|
+
return;
|
|
3184
|
+
}
|
|
3185
|
+
else {
|
|
3186
|
+
tempSelectedYear = year;
|
|
3187
|
+
_this.selectedYear = year;
|
|
3188
|
+
var monthsContainers = _this.selectMonthYear.querySelectorAll('.months');
|
|
3189
|
+
for (var i_1 = 0; i_1 < monthsContainers.length; i_1++) {
|
|
3190
|
+
monthsContainers[i_1].remove();
|
|
3191
|
+
}
|
|
3192
|
+
years[i].appendChild(monthsContainer);
|
|
3193
|
+
}
|
|
3194
|
+
});
|
|
3195
|
+
};
|
|
3196
|
+
for (var i = 0; i < years.length; i++) {
|
|
3197
|
+
_loop_3(i);
|
|
3198
|
+
}
|
|
3199
|
+
};
|
|
3200
|
+
CustomDatepicker.prototype.toggleSelectMonthYear = function () {
|
|
3201
|
+
if (this.selectMonthYear.style.display === 'none') {
|
|
3202
|
+
this.selectDate.style.display = 'none';
|
|
3203
|
+
this.selectMonthYear.style.display = 'block';
|
|
3204
|
+
this.header.style.color = '#ccc';
|
|
3205
|
+
var years = this.selectMonthYear.querySelectorAll('.year');
|
|
3206
|
+
for (var i = 0; i < years.length; i++) {
|
|
3207
|
+
if (years[i].querySelector('.months')) {
|
|
3208
|
+
years[i].scrollIntoView();
|
|
3209
|
+
break;
|
|
3210
|
+
}
|
|
3211
|
+
}
|
|
3212
|
+
}
|
|
3213
|
+
else {
|
|
3214
|
+
this.hideSelectMonthYear();
|
|
3215
|
+
}
|
|
3216
|
+
};
|
|
3217
|
+
CustomDatepicker.prototype.hideSelectMonthYear = function () {
|
|
3218
|
+
this.selectDate.style.display = 'block';
|
|
3219
|
+
this.selectMonthYear.style.display = 'none';
|
|
3220
|
+
this.header.style.color = '#000';
|
|
3221
|
+
};
|
|
3222
|
+
CustomDatepicker.prototype.showPicker = function (showpicker) {
|
|
3223
|
+
if (showpicker === void 0) { showpicker = true; }
|
|
3224
|
+
if (showpicker) {
|
|
3225
|
+
this.positionPicker();
|
|
3226
|
+
this.datepicker.style.display = 'block';
|
|
3227
|
+
}
|
|
3228
|
+
else {
|
|
3229
|
+
this.datepicker.style.display = 'none';
|
|
3230
|
+
this.hideSelectMonthYear();
|
|
3231
|
+
return;
|
|
3232
|
+
}
|
|
3233
|
+
};
|
|
3234
|
+
CustomDatepicker.prototype.positionPicker = function () {
|
|
3235
|
+
this.datepicker.style.position = 'fixed';
|
|
3236
|
+
var datepickerHeight = 250;
|
|
3237
|
+
if ((0, CustomDatepickerUtils_1.isMobileDevice)()) {
|
|
3238
|
+
this.datepicker.style.height = '400px';
|
|
3239
|
+
this.datepicker.style.top = '50%';
|
|
3240
|
+
this.datepicker.style.left = '50%';
|
|
3241
|
+
this.datepicker.style.transform = 'translate(-50%, -50%)';
|
|
3242
|
+
this.datepicker.style.width = '90%';
|
|
3243
|
+
this.datepicker.style.maxWidth = '300px';
|
|
3244
|
+
this.datepicker.style.fontSize = '16px';
|
|
3245
|
+
this.datepicker.style.padding = '30px';
|
|
3246
|
+
this.header.style.marginBottom = '20px';
|
|
3247
|
+
var weekdaysSpans = this.weekdays.querySelectorAll('span');
|
|
3248
|
+
var daysSpans = this.days.querySelectorAll('span');
|
|
3249
|
+
weekdaysSpans.forEach(function (span) { return span.style.marginBottom = '10px'; });
|
|
3250
|
+
daysSpans.forEach(function (span) { return span.style.marginBottom = '10px'; });
|
|
3251
|
+
}
|
|
3252
|
+
else {
|
|
3253
|
+
this.datepicker.style.height = datepickerHeight + 'px';
|
|
3254
|
+
var dateInputRect = this.input.getBoundingClientRect();
|
|
3255
|
+
datepickerHeight += 20;
|
|
3256
|
+
if (window.innerHeight - dateInputRect.bottom < datepickerHeight) {
|
|
3257
|
+
this.datepicker.style.top = 'auto';
|
|
3258
|
+
this.datepicker.style.bottom = window.innerHeight - dateInputRect.top + 'px';
|
|
3259
|
+
}
|
|
3260
|
+
else {
|
|
3261
|
+
this.datepicker.style.bottom = 'auto';
|
|
3262
|
+
this.datepicker.style.top = dateInputRect.bottom + 'px';
|
|
3263
|
+
}
|
|
3264
|
+
this.datepicker.style.left = dateInputRect.left + 'px';
|
|
3265
|
+
}
|
|
3266
|
+
};
|
|
3267
|
+
CustomDatepicker.prototype.setDateForToday = function () {
|
|
3268
|
+
this.input.value = (0, CustomDatepickerUtils_1.formatDate)(this.selectedDate, this.dateFormat);
|
|
3269
|
+
this.showPicker(false);
|
|
3270
|
+
};
|
|
3271
|
+
CustomDatepicker.prototype.addEventListeners = function () {
|
|
3272
|
+
var _this = this;
|
|
3273
|
+
this.input.addEventListener('click', function () { return _this.showPicker(true); });
|
|
3274
|
+
this.input.addEventListener('focus', function () { return _this.showPicker(true); });
|
|
3275
|
+
this.input.addEventListener('change', function () {
|
|
3276
|
+
var date = new Date(_this.input.value);
|
|
3277
|
+
if (date.toString() !== 'Invalid Date') {
|
|
3278
|
+
_this.selectedDate = date;
|
|
3279
|
+
_this.selectedMonth = date.getMonth();
|
|
3280
|
+
_this.selectedYear = date.getFullYear();
|
|
3281
|
+
_this.selectedDay = date.getDate();
|
|
3282
|
+
_this.renderCalendar();
|
|
3283
|
+
}
|
|
3284
|
+
});
|
|
3285
|
+
this.otherTriggers.forEach(function (trigger) {
|
|
3286
|
+
trigger.addEventListener('click', function () { return _this.showPicker(true); });
|
|
3287
|
+
});
|
|
3288
|
+
document.onclick = function (event) {
|
|
3289
|
+
var elementsToNeglect = [_this.input, _this.datepicker, _this.monthYear, _this.weekdays, _this.days, _this.header, _this.selectMonthYear];
|
|
3290
|
+
var element = event.target;
|
|
3291
|
+
var isNeglected = elementsToNeglect.includes(element) || elementsToNeglect.includes(element.parentElement) || (element).classList.contains('select-month') || element === _this.parentElement;
|
|
3292
|
+
if (!isNeglected) {
|
|
3293
|
+
_this.showPicker(false);
|
|
3294
|
+
}
|
|
3295
|
+
};
|
|
3296
|
+
};
|
|
3297
|
+
return CustomDatepicker;
|
|
3298
|
+
}());
|
|
3299
|
+
exports.default = CustomDatepicker;
|
|
3300
|
+
|
|
3301
|
+
},{"./CustomDatepickerStyles":16,"./CustomDatepickerUtils":17}],16:[function(require,module,exports){
|
|
3302
|
+
"use strict";
|
|
3303
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3304
|
+
exports.CustomDatepickerStyles = void 0;
|
|
3305
|
+
exports.CustomDatepickerStyles = "\n .datepicker {\n position: fixed;\n background-color: #fff;\n display: none;\n width: 200px;\n border: 1px solid #ccc;\n border-radius: 5px;\n padding: 10px;\n margin: 0 auto;\n box-shadow: 0 0 10px 0 #ccc;\n font: 12px Arial, sans-serif;\n }\n\n .header {\n display: flex;\n justify-content: space-between;\n align-items: center;\n margin-bottom: 10px;\n }\n .weekdays {\n display: flex;\n justify-content: space-between;\n }\n .weekdays span {\n width: 14.28%;\n text-align: center;\n padding: 5px 0;\n }\n .days {\n display: flex;\n flex-wrap: wrap;\n }\n .days span {\n width: 14.28%;\n text-align: center;\n padding: 5px 0;\n }\n .days span:hover {\n background-color: #B2d5ff;\n cursor: pointer;\n }\n .days span.today {\n border: 1px solid #000;\n }\n .days span.selected-day {\n background-color: #0075ff;\n color: #fff;\n }\n .prev-month, .next-month {\n cursor: pointer;\n }\n .month-year {\n font-weight: bold;\n }\n .month-year:hover {\n cursor: pointer;\n }\n .select-month-year {\n display: none;\n width: 100%;\n overflow-y: auto;\n }\n .select-month-year .year {\n text-align: center;\n background-color: #f0f0f0;\n border-bottom: 1px solid #3f3d3d;\n padding: 5px 0;\n cursor: pointer;\n }\n .select-month-year .year .months {\n display: flex;\n flex-wrap: wrap;\n }\n .select-month-year .year .months span {\n width: 25%;\n text-align: center;\n padding: 10px 0;\n background-color: #fff;\n }\n .select-month-year .year .months span:hover {\n background-color: #B2d5ff;\n cursor: pointer;\n }\n .actions {\n display: flex;\n justify-content: space-between;\n margin-top: 10px;\n }\n .actions input {\n color: #0075ff;\n border: none;\n background-color: transparent;\n padding: 5px;\n border: 1px solid transparent;\n }\n .actions input:hover {\n background-color: #B2d5ff;\n border-color: #000;\n }\n";
|
|
3306
|
+
|
|
3307
|
+
},{}],17:[function(require,module,exports){
|
|
3308
|
+
"use strict";
|
|
3309
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3310
|
+
exports.isMobileDevice = exports.formatDate = exports.supportedDateFormats = exports.defaultDateFormat = exports.daysOfWeek = exports.months = void 0;
|
|
3311
|
+
exports.months = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'];
|
|
3312
|
+
exports.daysOfWeek = ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'];
|
|
3313
|
+
exports.defaultDateFormat = 'yyyy-mm-dd';
|
|
3314
|
+
exports.supportedDateFormats = [
|
|
3315
|
+
'ddmmyyyy',
|
|
3316
|
+
'mmddyyyy',
|
|
3317
|
+
'dd/mm/yyyy',
|
|
3318
|
+
'mm/dd/yyyy',
|
|
3319
|
+
'dd-mm-yyyy',
|
|
3320
|
+
'mm-dd-yyyy',
|
|
3321
|
+
'yyyy-mm-dd',
|
|
3322
|
+
'yyyy-dd-mm',
|
|
3323
|
+
'Month dd, yyyy',
|
|
3324
|
+
'mm/dd/yy',
|
|
3325
|
+
'dd/mm/yy',
|
|
3326
|
+
];
|
|
3327
|
+
function formatDate(date, dateFormat) {
|
|
3328
|
+
var year = date.getFullYear();
|
|
3329
|
+
var month = (date.getMonth() + 1).toString().padStart(2, '0');
|
|
3330
|
+
var day = date.getDate().toString().padStart(2, '0');
|
|
3331
|
+
var monthName = date.toLocaleString('default', { month: 'long' });
|
|
3332
|
+
var dateFormats = {
|
|
3333
|
+
'ddmmyyyy': "" + day + month + year,
|
|
3334
|
+
'mmddyyyy': "" + month + day + year,
|
|
3335
|
+
'dd/mm/yyyy': day + "/" + month + "/" + year,
|
|
3336
|
+
'mm/dd/yyyy': month + "/" + day + "/" + year,
|
|
3337
|
+
'dd-mm-yyyy': day + "-" + month + "-" + year,
|
|
3338
|
+
'mm-dd-yyyy': month + "-" + day + "-" + year,
|
|
3339
|
+
'yyyy-mm-dd': year + "-" + month + "-" + day,
|
|
3340
|
+
'yyyy-dd-mm': year + "-" + day + "-" + month,
|
|
3341
|
+
'Month dd, yyyy': monthName + " " + day + ", " + year,
|
|
3342
|
+
'mm/dd/yy': month + "/" + day + "/" + year.toString().slice(-2),
|
|
3343
|
+
'dd/mm/yy': day + "/" + month + "/" + year.toString().slice(-2),
|
|
3344
|
+
};
|
|
3345
|
+
return dateFormats[dateFormat];
|
|
3346
|
+
}
|
|
3347
|
+
exports.formatDate = formatDate;
|
|
3348
|
+
function isMobileDevice() {
|
|
3349
|
+
return /Android|webOS|iPhone|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) || window.innerWidth < 480;
|
|
3350
|
+
}
|
|
3351
|
+
exports.isMobileDevice = isMobileDevice;
|
|
3352
|
+
|
|
3353
|
+
},{}],18:[function(require,module,exports){
|
|
5695
3354
|
"use strict";
|
|
5696
3355
|
var __extends = (this && this.__extends) || (function () {
|
|
5697
3356
|
var extendStatics = function (d, b) {
|
|
@@ -5719,26 +3378,12 @@ exports.CustomFormatDateFieldElement = void 0;
|
|
|
5719
3378
|
var custom_element_decorator_1 = require("../../framework/custom-element.decorator");
|
|
5720
3379
|
var CustomInputElement_1 = require("../../framework/CustomInputElement");
|
|
5721
3380
|
var CustomEvents_1 = require("../../framework/CustomEvents");
|
|
5722
|
-
var
|
|
3381
|
+
var CustomDatepicker_1 = require("./CustomDatepicker/CustomDatepicker");
|
|
3382
|
+
var CustomDatepickerUtils_1 = require("./CustomDatepicker/CustomDatepickerUtils");
|
|
5723
3383
|
var CustomFormatDateFieldElement = /** @class */ (function (_super) {
|
|
5724
3384
|
__extends(CustomFormatDateFieldElement, _super);
|
|
5725
3385
|
function CustomFormatDateFieldElement() {
|
|
5726
|
-
|
|
5727
|
-
_this.defaultDateFormat = 'yyyy-mm-dd';
|
|
5728
|
-
_this.supportedDateFormats = [
|
|
5729
|
-
'ddmmyyyy',
|
|
5730
|
-
'mmddyyyy',
|
|
5731
|
-
'dd/mm/yyyy',
|
|
5732
|
-
'mm/dd/yyyy',
|
|
5733
|
-
'dd-mm-yyyy',
|
|
5734
|
-
'mm-dd-yyyy',
|
|
5735
|
-
'yyyy-mm-dd',
|
|
5736
|
-
'yyyy-dd-mm',
|
|
5737
|
-
'Month dd, yyyy',
|
|
5738
|
-
'mm/dd/yy',
|
|
5739
|
-
'dd/mm/yy',
|
|
5740
|
-
];
|
|
5741
|
-
return _this;
|
|
3386
|
+
return _super.call(this) || this;
|
|
5742
3387
|
}
|
|
5743
3388
|
Object.defineProperty(CustomFormatDateFieldElement.prototype, "value", {
|
|
5744
3389
|
get: function () {
|
|
@@ -5762,8 +3407,8 @@ var CustomFormatDateFieldElement = /** @class */ (function (_super) {
|
|
|
5762
3407
|
};
|
|
5763
3408
|
CustomFormatDateFieldElement.prototype.initChildInputs = function () {
|
|
5764
3409
|
this.date = _super.prototype.getChildInput.call(this, '#date-field');
|
|
5765
|
-
this.
|
|
5766
|
-
this.
|
|
3410
|
+
this.pickerTrigger = this.getChildElement('#picker-trigger');
|
|
3411
|
+
this.dateFormat = CustomDatepickerUtils_1.supportedDateFormats.includes(this.dateFormat) ? this.dateFormat : CustomDatepickerUtils_1.defaultDateFormat;
|
|
5767
3412
|
this.date.placeholder = this.dateFormat;
|
|
5768
3413
|
this.date.addEventListener('change', this.change.bind(this));
|
|
5769
3414
|
if (this.required) {
|
|
@@ -5775,7 +3420,7 @@ var CustomFormatDateFieldElement = /** @class */ (function (_super) {
|
|
|
5775
3420
|
if (this.min) {
|
|
5776
3421
|
this.date.setAttribute('min', this.min);
|
|
5777
3422
|
}
|
|
5778
|
-
this.
|
|
3423
|
+
this.initCustomPicker();
|
|
5779
3424
|
};
|
|
5780
3425
|
// events
|
|
5781
3426
|
CustomFormatDateFieldElement.prototype.change = function ($event) {
|
|
@@ -5786,51 +3431,19 @@ var CustomFormatDateFieldElement = /** @class */ (function (_super) {
|
|
|
5786
3431
|
this.valid;
|
|
5787
3432
|
this.onValidate.emit(new CustomEvents_1.CustomElementEventArgs(this.value, 'validate'));
|
|
5788
3433
|
};
|
|
5789
|
-
CustomFormatDateFieldElement.prototype.
|
|
5790
|
-
|
|
5791
|
-
|
|
5792
|
-
|
|
5793
|
-
|
|
5794
|
-
|
|
5795
|
-
disableMobile: true,
|
|
5796
|
-
parseDate: function (datestr) {
|
|
5797
|
-
return new Date(datestr);
|
|
5798
|
-
},
|
|
5799
|
-
formatDate: function (date, format) {
|
|
5800
|
-
return _this.formatDate(date);
|
|
5801
|
-
}
|
|
3434
|
+
CustomFormatDateFieldElement.prototype.initCustomPicker = function () {
|
|
3435
|
+
new CustomDatepicker_1.default({
|
|
3436
|
+
input: this.date,
|
|
3437
|
+
dateFormat: this.dateFormat,
|
|
3438
|
+
otherTriggers: [this.pickerTrigger],
|
|
3439
|
+
parentElement: this,
|
|
5802
3440
|
});
|
|
5803
3441
|
};
|
|
5804
|
-
CustomFormatDateFieldElement.prototype.formatDate = function (date) {
|
|
5805
|
-
var year = date.getFullYear();
|
|
5806
|
-
var month = (date.getMonth() + 1).toString().padStart(2, '0');
|
|
5807
|
-
var day = date.getDate().toString().padStart(2, '0');
|
|
5808
|
-
var monthName = date.toLocaleString('default', { month: 'long' });
|
|
5809
|
-
var dateFormats = {
|
|
5810
|
-
'ddmmyyyy': "" + day + month + year,
|
|
5811
|
-
'mmddyyyy': "" + month + day + year,
|
|
5812
|
-
'dd/mm/yyyy': day + "/" + month + "/" + year,
|
|
5813
|
-
'mm/dd/yyyy': month + "/" + day + "/" + year,
|
|
5814
|
-
'dd-mm-yyyy': day + "-" + month + "-" + year,
|
|
5815
|
-
'mm-dd-yyyy': month + "-" + day + "-" + year,
|
|
5816
|
-
'yyyy-mm-dd': year + "-" + month + "-" + day,
|
|
5817
|
-
'yyyy-dd-mm': year + "-" + day + "-" + month,
|
|
5818
|
-
'Month dd, yyyy': monthName + " " + day + ", " + year,
|
|
5819
|
-
'mm/dd/yy': month + "/" + day + "/" + year.toString().slice(-2),
|
|
5820
|
-
'dd/mm/yy': day + "/" + month + "/" + year.toString().slice(-2),
|
|
5821
|
-
};
|
|
5822
|
-
return dateFormats[this.dateFormat];
|
|
5823
|
-
};
|
|
5824
|
-
CustomFormatDateFieldElement.prototype.validateDateFormats = function () {
|
|
5825
|
-
if (!this.supportedDateFormats.includes(this.dateFormat)) {
|
|
5826
|
-
this.dateFormat = this.defaultDateFormat;
|
|
5827
|
-
}
|
|
5828
|
-
};
|
|
5829
3442
|
CustomFormatDateFieldElement = __decorate([
|
|
5830
3443
|
(0, custom_element_decorator_1.default)({
|
|
5831
3444
|
selector: 'custom-format-date-element',
|
|
5832
|
-
template: "\n\t\t<div class=\"wrapper
|
|
5833
|
-
style: "\n\t\t
|
|
3445
|
+
template: "\n\t\t<div class=\"wrapper\">\n\t\t\t<input type=\"text\" id=\"date-field\" readonly />\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>",
|
|
3446
|
+
style: "\n\t\t:host{\n\t\t\twidth:100%;\n\t\t}\n\t\t* {\n\t\t\tbox-sizing: border-box;\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",
|
|
5834
3447
|
useShadow: true,
|
|
5835
3448
|
})
|
|
5836
3449
|
], CustomFormatDateFieldElement);
|
|
@@ -5838,7 +3451,7 @@ var CustomFormatDateFieldElement = /** @class */ (function (_super) {
|
|
|
5838
3451
|
}(CustomInputElement_1.CustomInputElement));
|
|
5839
3452
|
exports.CustomFormatDateFieldElement = CustomFormatDateFieldElement;
|
|
5840
3453
|
|
|
5841
|
-
},{"../../framework/CustomEvents":
|
|
3454
|
+
},{"../../framework/CustomEvents":36,"../../framework/CustomInputElement":37,"../../framework/custom-element.decorator":75,"./CustomDatepicker/CustomDatepicker":15,"./CustomDatepicker/CustomDatepickerUtils":17}],19:[function(require,module,exports){
|
|
5842
3455
|
"use strict";
|
|
5843
3456
|
var __extends = (this && this.__extends) || (function () {
|
|
5844
3457
|
var extendStatics = function (d, b) {
|
|
@@ -5931,7 +3544,7 @@ var CustomRegularExpressionElement = /** @class */ (function (_super) {
|
|
|
5931
3544
|
}(CustomInputElement_1.CustomInputElement));
|
|
5932
3545
|
exports.CustomRegularExpressionElement = CustomRegularExpressionElement;
|
|
5933
3546
|
|
|
5934
|
-
},{"../../framework/CustomEvents":
|
|
3547
|
+
},{"../../framework/CustomEvents":36,"../../framework/CustomInputElement":37,"../../framework/custom-element.decorator":75}],20:[function(require,module,exports){
|
|
5935
3548
|
"use strict";
|
|
5936
3549
|
var __extends = (this && this.__extends) || (function () {
|
|
5937
3550
|
var extendStatics = function (d, b) {
|
|
@@ -6018,7 +3631,7 @@ var DateFieldElement = /** @class */ (function (_super) {
|
|
|
6018
3631
|
}(CustomInputElement_1.CustomInputElement));
|
|
6019
3632
|
exports.DateFieldElement = DateFieldElement;
|
|
6020
3633
|
|
|
6021
|
-
},{"../../framework/CustomEvents":
|
|
3634
|
+
},{"../../framework/CustomEvents":36,"../../framework/CustomInputElement":37,"../../framework/custom-element.decorator":75}],21:[function(require,module,exports){
|
|
6022
3635
|
"use strict";
|
|
6023
3636
|
var __extends = (this && this.__extends) || (function () {
|
|
6024
3637
|
var extendStatics = function (d, b) {
|
|
@@ -6119,7 +3732,7 @@ var DropDownListElement = /** @class */ (function (_super) {
|
|
|
6119
3732
|
}(CustomInputElement_1.CustomInputElement));
|
|
6120
3733
|
exports.DropDownListElement = DropDownListElement;
|
|
6121
3734
|
|
|
6122
|
-
},{"../../framework/CustomEvents":
|
|
3735
|
+
},{"../../framework/CustomEvents":36,"../../framework/CustomInputElement":37,"../../framework/Utilities/StringUtil":64,"../../framework/custom-element.decorator":75}],22:[function(require,module,exports){
|
|
6123
3736
|
"use strict";
|
|
6124
3737
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6125
3738
|
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;
|
|
@@ -6164,7 +3777,7 @@ Object.defineProperty(exports, "SECompanyRegistrationElement", { enumerable: tru
|
|
|
6164
3777
|
var CustomFormatDateFieldElement_1 = require("./CustomFormatDateFieldElement/CustomFormatDateFieldElement");
|
|
6165
3778
|
Object.defineProperty(exports, "CustomFormatDateFieldElement", { enumerable: true, get: function () { return CustomFormatDateFieldElement_1.CustomFormatDateFieldElement; } });
|
|
6166
3779
|
|
|
6167
|
-
},{"./Address/AddressElement":
|
|
3780
|
+
},{"./Address/AddressElement":10,"./BankField/BankFieldElement":11,"./CPRElement/CPRElement":12,"./CVRElement/CVRElement":13,"./CheckBoxElement/CheckBoxElement":14,"./CustomFormatDateFieldElement/CustomFormatDateFieldElement":18,"./CustomRegularExpression/CustomRegularExpressionElement":19,"./DateField/DateFieldElement":20,"./DropDownList/DropDownListElement":21,"./EmailField/EmailFieldElement":23,"./FileField/FileFieldElement":24,"./IdentificationElement/IdentificationElement":25,"./InternationaPhoneNumber/InternationaPhoneNumberElement":28,"./NumericField/NumericFieldElement":29,"./RadioButtonGroup/RadioButtonGroupElement":30,"./SECompanyRegistrationElement/SECompanyRegistrationElement":31,"./SEPersonalNumberElement/SEPersonalNumberElement":32,"./TextAreaElement/TextAreaElement":33,"./TextField/TextFieldElement":34,"./TypeAhead/TypeAheadElement":35}],23:[function(require,module,exports){
|
|
6168
3781
|
"use strict";
|
|
6169
3782
|
var __extends = (this && this.__extends) || (function () {
|
|
6170
3783
|
var extendStatics = function (d, b) {
|
|
@@ -6252,7 +3865,7 @@ var EmailFieldElement = /** @class */ (function (_super) {
|
|
|
6252
3865
|
}(CustomInputElement_1.CustomInputElement));
|
|
6253
3866
|
exports.EmailFieldElement = EmailFieldElement;
|
|
6254
3867
|
|
|
6255
|
-
},{"../../framework/CustomEvents":
|
|
3868
|
+
},{"../../framework/CustomEvents":36,"../../framework/CustomInputElement":37,"../../framework/custom-element.decorator":75}],24:[function(require,module,exports){
|
|
6256
3869
|
"use strict";
|
|
6257
3870
|
var __extends = (this && this.__extends) || (function () {
|
|
6258
3871
|
var extendStatics = function (d, b) {
|
|
@@ -6357,7 +3970,7 @@ var FileFieldElement = /** @class */ (function (_super) {
|
|
|
6357
3970
|
}(CustomInputElement_1.CustomInputElement));
|
|
6358
3971
|
exports.FileFieldElement = FileFieldElement;
|
|
6359
3972
|
|
|
6360
|
-
},{"../../framework/CustomEvents":
|
|
3973
|
+
},{"../../framework/CustomEvents":36,"../../framework/CustomInputElement":37,"../../framework/Polyfills/getAttributeNamesPolyfill":59,"../../framework/custom-element.decorator":75}],25:[function(require,module,exports){
|
|
6361
3974
|
"use strict";
|
|
6362
3975
|
var __extends = (this && this.__extends) || (function () {
|
|
6363
3976
|
var extendStatics = function (d, b) {
|
|
@@ -6453,7 +4066,7 @@ var IdentificationElement = /** @class */ (function (_super) {
|
|
|
6453
4066
|
}(CustomInputElement_1.CustomInputElement));
|
|
6454
4067
|
exports.IdentificationElement = IdentificationElement;
|
|
6455
4068
|
|
|
6456
|
-
},{"../../framework/CustomEvents":
|
|
4069
|
+
},{"../../framework/CustomEvents":36,"../../framework/CustomInputElement":37,"../../framework/Validation/Validators/BankIdNorway":69,"../../framework/Validation/Validators/BankIdSweden":70,"../../framework/Validation/Validators/CPR":71,"../../framework/Validation/Validators/CVR":72,"../../framework/custom-element.decorator":75}],26:[function(require,module,exports){
|
|
6457
4070
|
"use strict";
|
|
6458
4071
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6459
4072
|
function GetFlagsUrl() {
|
|
@@ -6461,7 +4074,7 @@ function GetFlagsUrl() {
|
|
|
6461
4074
|
}
|
|
6462
4075
|
exports.default = GetFlagsUrl;
|
|
6463
4076
|
|
|
6464
|
-
},{}],
|
|
4077
|
+
},{}],27:[function(require,module,exports){
|
|
6465
4078
|
"use strict";
|
|
6466
4079
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6467
4080
|
function GetFlags2XUrl() {
|
|
@@ -6469,7 +4082,7 @@ function GetFlags2XUrl() {
|
|
|
6469
4082
|
}
|
|
6470
4083
|
exports.default = GetFlags2XUrl;
|
|
6471
4084
|
|
|
6472
|
-
},{}],
|
|
4085
|
+
},{}],28:[function(require,module,exports){
|
|
6473
4086
|
"use strict";
|
|
6474
4087
|
var __extends = (this && this.__extends) || (function () {
|
|
6475
4088
|
var extendStatics = function (d, b) {
|
|
@@ -6601,7 +4214,7 @@ var IntPhoneFieldElement = /** @class */ (function (_super) {
|
|
|
6601
4214
|
}(CustomInputElement_1.CustomInputElement));
|
|
6602
4215
|
exports.IntPhoneFieldElement = IntPhoneFieldElement;
|
|
6603
4216
|
|
|
6604
|
-
},{"../../framework/CustomEvents":
|
|
4217
|
+
},{"../../framework/CustomEvents":36,"../../framework/CustomInputElement":37,"../../framework/Utilities/MakeRequest":63,"../../framework/custom-element.decorator":75,"./Flags":26,"./Flags2x":27,"intl-tel-input":6}],29:[function(require,module,exports){
|
|
6605
4218
|
"use strict";
|
|
6606
4219
|
var __extends = (this && this.__extends) || (function () {
|
|
6607
4220
|
var extendStatics = function (d, b) {
|
|
@@ -6697,7 +4310,7 @@ var NumericFieldElement = /** @class */ (function (_super) {
|
|
|
6697
4310
|
}(CustomInputElement_1.CustomInputElement));
|
|
6698
4311
|
exports.NumericFieldElement = NumericFieldElement;
|
|
6699
4312
|
|
|
6700
|
-
},{"../../framework/CustomEvents":
|
|
4313
|
+
},{"../../framework/CustomEvents":36,"../../framework/CustomInputElement":37,"../../framework/custom-element.decorator":75}],30:[function(require,module,exports){
|
|
6701
4314
|
"use strict";
|
|
6702
4315
|
var __extends = (this && this.__extends) || (function () {
|
|
6703
4316
|
var extendStatics = function (d, b) {
|
|
@@ -6798,7 +4411,7 @@ var RadioButtonGroupElement = /** @class */ (function (_super) {
|
|
|
6798
4411
|
}(CustomInputElement_1.CustomInputElement));
|
|
6799
4412
|
exports.RadioButtonGroupElement = RadioButtonGroupElement;
|
|
6800
4413
|
|
|
6801
|
-
},{"../../framework/CustomEvents":
|
|
4414
|
+
},{"../../framework/CustomEvents":36,"../../framework/CustomInputElement":37,"../../framework/Utilities/StringUtil":64,"../../framework/custom-element.decorator":75}],31:[function(require,module,exports){
|
|
6802
4415
|
"use strict";
|
|
6803
4416
|
var __extends = (this && this.__extends) || (function () {
|
|
6804
4417
|
var extendStatics = function (d, b) {
|
|
@@ -6882,7 +4495,7 @@ var SECompanyRegistrationElement = /** @class */ (function (_super) {
|
|
|
6882
4495
|
}(CustomInputElement_1.CustomInputElement));
|
|
6883
4496
|
exports.SECompanyRegistrationElement = SECompanyRegistrationElement;
|
|
6884
4497
|
|
|
6885
|
-
},{"../../framework/CustomEvents":
|
|
4498
|
+
},{"../../framework/CustomEvents":36,"../../framework/CustomInputElement":37,"../../framework/Validation/Validators/SECompanyRegistration":73,"../../framework/custom-element.decorator":75}],32:[function(require,module,exports){
|
|
6886
4499
|
"use strict";
|
|
6887
4500
|
var __extends = (this && this.__extends) || (function () {
|
|
6888
4501
|
var extendStatics = function (d, b) {
|
|
@@ -6966,7 +4579,7 @@ var SEPersonalNumberElement = /** @class */ (function (_super) {
|
|
|
6966
4579
|
}(CustomInputElement_1.CustomInputElement));
|
|
6967
4580
|
exports.SEPersonalNumberElement = SEPersonalNumberElement;
|
|
6968
4581
|
|
|
6969
|
-
},{"../../framework/CustomEvents":
|
|
4582
|
+
},{"../../framework/CustomEvents":36,"../../framework/CustomInputElement":37,"../../framework/Validation/Validators/SEPersonalNumber":74,"../../framework/custom-element.decorator":75}],33:[function(require,module,exports){
|
|
6970
4583
|
"use strict";
|
|
6971
4584
|
var __extends = (this && this.__extends) || (function () {
|
|
6972
4585
|
var extendStatics = function (d, b) {
|
|
@@ -7050,7 +4663,7 @@ var TextAreaElement = /** @class */ (function (_super) {
|
|
|
7050
4663
|
}(CustomInputElement_1.CustomInputElement));
|
|
7051
4664
|
exports.TextAreaElement = TextAreaElement;
|
|
7052
4665
|
|
|
7053
|
-
},{"../../framework/CustomEvents":
|
|
4666
|
+
},{"../../framework/CustomEvents":36,"../../framework/CustomInputElement":37,"../../framework/custom-element.decorator":75}],34:[function(require,module,exports){
|
|
7054
4667
|
"use strict";
|
|
7055
4668
|
var __extends = (this && this.__extends) || (function () {
|
|
7056
4669
|
var extendStatics = function (d, b) {
|
|
@@ -7134,7 +4747,7 @@ var TextFieldElement = /** @class */ (function (_super) {
|
|
|
7134
4747
|
}(CustomInputElement_1.CustomInputElement));
|
|
7135
4748
|
exports.TextFieldElement = TextFieldElement;
|
|
7136
4749
|
|
|
7137
|
-
},{"../../framework/CustomEvents":
|
|
4750
|
+
},{"../../framework/CustomEvents":36,"../../framework/CustomInputElement":37,"../../framework/custom-element.decorator":75}],35:[function(require,module,exports){
|
|
7138
4751
|
"use strict";
|
|
7139
4752
|
var __extends = (this && this.__extends) || (function () {
|
|
7140
4753
|
var extendStatics = function (d, b) {
|
|
@@ -7348,7 +4961,7 @@ var TypeAheadElement = /** @class */ (function (_super) {
|
|
|
7348
4961
|
}(CustomInputElement_1.CustomInputElement));
|
|
7349
4962
|
exports.TypeAheadElement = TypeAheadElement;
|
|
7350
4963
|
|
|
7351
|
-
},{"../../framework/CustomEvents":
|
|
4964
|
+
},{"../../framework/CustomEvents":36,"../../framework/CustomInputElement":37,"../../framework/Utilities/DomUtility":62,"../../framework/custom-element.decorator":75}],36:[function(require,module,exports){
|
|
7352
4965
|
"use strict";
|
|
7353
4966
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7354
4967
|
exports.CustomElementEvent = exports.CustomElementEventArgs = void 0;
|
|
@@ -7397,7 +5010,7 @@ var CustomElementEvent = /** @class */ (function () {
|
|
|
7397
5010
|
}());
|
|
7398
5011
|
exports.CustomElementEvent = CustomElementEvent;
|
|
7399
5012
|
|
|
7400
|
-
},{}],
|
|
5013
|
+
},{}],37:[function(require,module,exports){
|
|
7401
5014
|
"use strict";
|
|
7402
5015
|
var __extends = (this && this.__extends) || (function () {
|
|
7403
5016
|
var extendStatics = function (d, b) {
|
|
@@ -7659,7 +5272,7 @@ var CustomInputElement = /** @class */ (function (_super) {
|
|
|
7659
5272
|
}(HTMLElement));
|
|
7660
5273
|
exports.CustomInputElement = CustomInputElement;
|
|
7661
5274
|
|
|
7662
|
-
},{"./CustomEvents":
|
|
5275
|
+
},{"./CustomEvents":36,"./Utilities/ArrayUtil":60,"./Utilities/DomUtil":61}],38:[function(require,module,exports){
|
|
7663
5276
|
"use strict";
|
|
7664
5277
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7665
5278
|
var BaseDictionary = /** @class */ (function () {
|
|
@@ -7681,7 +5294,7 @@ var BaseDictionary = /** @class */ (function () {
|
|
|
7681
5294
|
}());
|
|
7682
5295
|
exports.default = BaseDictionary;
|
|
7683
5296
|
|
|
7684
|
-
},{}],
|
|
5297
|
+
},{}],39:[function(require,module,exports){
|
|
7685
5298
|
"use strict";
|
|
7686
5299
|
var __extends = (this && this.__extends) || (function () {
|
|
7687
5300
|
var extendStatics = function (d, b) {
|
|
@@ -7722,7 +5335,7 @@ var CzechDictionary = /** @class */ (function (_super) {
|
|
|
7722
5335
|
}(BaseDictionary_1.default));
|
|
7723
5336
|
exports.default = CzechDictionary;
|
|
7724
5337
|
|
|
7725
|
-
},{"./Base/BaseDictionary":
|
|
5338
|
+
},{"./Base/BaseDictionary":38}],40:[function(require,module,exports){
|
|
7726
5339
|
"use strict";
|
|
7727
5340
|
var __extends = (this && this.__extends) || (function () {
|
|
7728
5341
|
var extendStatics = function (d, b) {
|
|
@@ -7763,7 +5376,7 @@ var DanishDictionary = /** @class */ (function (_super) {
|
|
|
7763
5376
|
}(BaseDictionary_1.default));
|
|
7764
5377
|
exports.default = DanishDictionary;
|
|
7765
5378
|
|
|
7766
|
-
},{"./Base/BaseDictionary":
|
|
5379
|
+
},{"./Base/BaseDictionary":38}],41:[function(require,module,exports){
|
|
7767
5380
|
"use strict";
|
|
7768
5381
|
var __extends = (this && this.__extends) || (function () {
|
|
7769
5382
|
var extendStatics = function (d, b) {
|
|
@@ -7804,7 +5417,7 @@ var DutchDictionary = /** @class */ (function (_super) {
|
|
|
7804
5417
|
}(BaseDictionary_1.default));
|
|
7805
5418
|
exports.default = DutchDictionary;
|
|
7806
5419
|
|
|
7807
|
-
},{"./Base/BaseDictionary":
|
|
5420
|
+
},{"./Base/BaseDictionary":38}],42:[function(require,module,exports){
|
|
7808
5421
|
"use strict";
|
|
7809
5422
|
var __extends = (this && this.__extends) || (function () {
|
|
7810
5423
|
var extendStatics = function (d, b) {
|
|
@@ -7845,7 +5458,7 @@ var EnglishDictionary = /** @class */ (function (_super) {
|
|
|
7845
5458
|
}(BaseDictionary_1.default));
|
|
7846
5459
|
exports.default = EnglishDictionary;
|
|
7847
5460
|
|
|
7848
|
-
},{"./Base/BaseDictionary":
|
|
5461
|
+
},{"./Base/BaseDictionary":38}],43:[function(require,module,exports){
|
|
7849
5462
|
"use strict";
|
|
7850
5463
|
var __extends = (this && this.__extends) || (function () {
|
|
7851
5464
|
var extendStatics = function (d, b) {
|
|
@@ -7886,7 +5499,7 @@ var EstonianDictionary = /** @class */ (function (_super) {
|
|
|
7886
5499
|
}(BaseDictionary_1.default));
|
|
7887
5500
|
exports.default = EstonianDictionary;
|
|
7888
5501
|
|
|
7889
|
-
},{"./Base/BaseDictionary":
|
|
5502
|
+
},{"./Base/BaseDictionary":38}],44:[function(require,module,exports){
|
|
7890
5503
|
"use strict";
|
|
7891
5504
|
var __extends = (this && this.__extends) || (function () {
|
|
7892
5505
|
var extendStatics = function (d, b) {
|
|
@@ -7927,7 +5540,7 @@ var FinnishDictionary = /** @class */ (function (_super) {
|
|
|
7927
5540
|
}(BaseDictionary_1.default));
|
|
7928
5541
|
exports.default = FinnishDictionary;
|
|
7929
5542
|
|
|
7930
|
-
},{"./Base/BaseDictionary":
|
|
5543
|
+
},{"./Base/BaseDictionary":38}],45:[function(require,module,exports){
|
|
7931
5544
|
"use strict";
|
|
7932
5545
|
var __extends = (this && this.__extends) || (function () {
|
|
7933
5546
|
var extendStatics = function (d, b) {
|
|
@@ -7968,7 +5581,7 @@ var FrenchDictionary = /** @class */ (function (_super) {
|
|
|
7968
5581
|
}(BaseDictionary_1.default));
|
|
7969
5582
|
exports.default = FrenchDictionary;
|
|
7970
5583
|
|
|
7971
|
-
},{"./Base/BaseDictionary":
|
|
5584
|
+
},{"./Base/BaseDictionary":38}],46:[function(require,module,exports){
|
|
7972
5585
|
"use strict";
|
|
7973
5586
|
var __extends = (this && this.__extends) || (function () {
|
|
7974
5587
|
var extendStatics = function (d, b) {
|
|
@@ -8009,7 +5622,7 @@ var GermanDictionary = /** @class */ (function (_super) {
|
|
|
8009
5622
|
}(BaseDictionary_1.default));
|
|
8010
5623
|
exports.default = GermanDictionary;
|
|
8011
5624
|
|
|
8012
|
-
},{"./Base/BaseDictionary":
|
|
5625
|
+
},{"./Base/BaseDictionary":38}],47:[function(require,module,exports){
|
|
8013
5626
|
"use strict";
|
|
8014
5627
|
var __extends = (this && this.__extends) || (function () {
|
|
8015
5628
|
var extendStatics = function (d, b) {
|
|
@@ -8050,7 +5663,7 @@ var GreekDictionary = /** @class */ (function (_super) {
|
|
|
8050
5663
|
}(BaseDictionary_1.default));
|
|
8051
5664
|
exports.default = GreekDictionary;
|
|
8052
5665
|
|
|
8053
|
-
},{"./Base/BaseDictionary":
|
|
5666
|
+
},{"./Base/BaseDictionary":38}],48:[function(require,module,exports){
|
|
8054
5667
|
"use strict";
|
|
8055
5668
|
var __extends = (this && this.__extends) || (function () {
|
|
8056
5669
|
var extendStatics = function (d, b) {
|
|
@@ -8091,7 +5704,7 @@ var HungarianDictionary = /** @class */ (function (_super) {
|
|
|
8091
5704
|
}(BaseDictionary_1.default));
|
|
8092
5705
|
exports.default = HungarianDictionary;
|
|
8093
5706
|
|
|
8094
|
-
},{"./Base/BaseDictionary":
|
|
5707
|
+
},{"./Base/BaseDictionary":38}],49:[function(require,module,exports){
|
|
8095
5708
|
"use strict";
|
|
8096
5709
|
var __extends = (this && this.__extends) || (function () {
|
|
8097
5710
|
var extendStatics = function (d, b) {
|
|
@@ -8132,7 +5745,7 @@ var IcelandicDictionary = /** @class */ (function (_super) {
|
|
|
8132
5745
|
}(BaseDictionary_1.default));
|
|
8133
5746
|
exports.default = IcelandicDictionary;
|
|
8134
5747
|
|
|
8135
|
-
},{"./Base/BaseDictionary":
|
|
5748
|
+
},{"./Base/BaseDictionary":38}],50:[function(require,module,exports){
|
|
8136
5749
|
"use strict";
|
|
8137
5750
|
var __extends = (this && this.__extends) || (function () {
|
|
8138
5751
|
var extendStatics = function (d, b) {
|
|
@@ -8173,7 +5786,7 @@ var ItalianDictionary = /** @class */ (function (_super) {
|
|
|
8173
5786
|
}(BaseDictionary_1.default));
|
|
8174
5787
|
exports.default = ItalianDictionary;
|
|
8175
5788
|
|
|
8176
|
-
},{"./Base/BaseDictionary":
|
|
5789
|
+
},{"./Base/BaseDictionary":38}],51:[function(require,module,exports){
|
|
8177
5790
|
"use strict";
|
|
8178
5791
|
var __extends = (this && this.__extends) || (function () {
|
|
8179
5792
|
var extendStatics = function (d, b) {
|
|
@@ -8214,7 +5827,7 @@ var LatvianDictionary = /** @class */ (function (_super) {
|
|
|
8214
5827
|
}(BaseDictionary_1.default));
|
|
8215
5828
|
exports.default = LatvianDictionary;
|
|
8216
5829
|
|
|
8217
|
-
},{"./Base/BaseDictionary":
|
|
5830
|
+
},{"./Base/BaseDictionary":38}],52:[function(require,module,exports){
|
|
8218
5831
|
"use strict";
|
|
8219
5832
|
var __extends = (this && this.__extends) || (function () {
|
|
8220
5833
|
var extendStatics = function (d, b) {
|
|
@@ -8255,7 +5868,7 @@ var LituanianDictionary = /** @class */ (function (_super) {
|
|
|
8255
5868
|
}(BaseDictionary_1.default));
|
|
8256
5869
|
exports.default = LituanianDictionary;
|
|
8257
5870
|
|
|
8258
|
-
},{"./Base/BaseDictionary":
|
|
5871
|
+
},{"./Base/BaseDictionary":38}],53:[function(require,module,exports){
|
|
8259
5872
|
"use strict";
|
|
8260
5873
|
var __extends = (this && this.__extends) || (function () {
|
|
8261
5874
|
var extendStatics = function (d, b) {
|
|
@@ -8296,7 +5909,7 @@ var NorwegianDictionary = /** @class */ (function (_super) {
|
|
|
8296
5909
|
}(BaseDictionary_1.default));
|
|
8297
5910
|
exports.default = NorwegianDictionary;
|
|
8298
5911
|
|
|
8299
|
-
},{"./Base/BaseDictionary":
|
|
5912
|
+
},{"./Base/BaseDictionary":38}],54:[function(require,module,exports){
|
|
8300
5913
|
"use strict";
|
|
8301
5914
|
var __extends = (this && this.__extends) || (function () {
|
|
8302
5915
|
var extendStatics = function (d, b) {
|
|
@@ -8337,7 +5950,7 @@ var PolishDictionary = /** @class */ (function (_super) {
|
|
|
8337
5950
|
}(BaseDictionary_1.default));
|
|
8338
5951
|
exports.default = PolishDictionary;
|
|
8339
5952
|
|
|
8340
|
-
},{"./Base/BaseDictionary":
|
|
5953
|
+
},{"./Base/BaseDictionary":38}],55:[function(require,module,exports){
|
|
8341
5954
|
"use strict";
|
|
8342
5955
|
var __extends = (this && this.__extends) || (function () {
|
|
8343
5956
|
var extendStatics = function (d, b) {
|
|
@@ -8378,7 +5991,7 @@ var PortugueseDictionary = /** @class */ (function (_super) {
|
|
|
8378
5991
|
}(BaseDictionary_1.default));
|
|
8379
5992
|
exports.default = PortugueseDictionary;
|
|
8380
5993
|
|
|
8381
|
-
},{"./Base/BaseDictionary":
|
|
5994
|
+
},{"./Base/BaseDictionary":38}],56:[function(require,module,exports){
|
|
8382
5995
|
"use strict";
|
|
8383
5996
|
var __extends = (this && this.__extends) || (function () {
|
|
8384
5997
|
var extendStatics = function (d, b) {
|
|
@@ -8419,7 +6032,7 @@ var SpanishDictionary = /** @class */ (function (_super) {
|
|
|
8419
6032
|
}(BaseDictionary_1.default));
|
|
8420
6033
|
exports.default = SpanishDictionary;
|
|
8421
6034
|
|
|
8422
|
-
},{"./Base/BaseDictionary":
|
|
6035
|
+
},{"./Base/BaseDictionary":38}],57:[function(require,module,exports){
|
|
8423
6036
|
"use strict";
|
|
8424
6037
|
var __extends = (this && this.__extends) || (function () {
|
|
8425
6038
|
var extendStatics = function (d, b) {
|
|
@@ -8460,7 +6073,7 @@ var SwedishDictionary = /** @class */ (function (_super) {
|
|
|
8460
6073
|
}(BaseDictionary_1.default));
|
|
8461
6074
|
exports.default = SwedishDictionary;
|
|
8462
6075
|
|
|
8463
|
-
},{"./Base/BaseDictionary":
|
|
6076
|
+
},{"./Base/BaseDictionary":38}],58:[function(require,module,exports){
|
|
8464
6077
|
"use strict";
|
|
8465
6078
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8466
6079
|
var DanishDictionary_1 = require("./Languages/DanishDictionary");
|
|
@@ -8577,7 +6190,7 @@ var Translator = /** @class */ (function () {
|
|
|
8577
6190
|
}());
|
|
8578
6191
|
exports.default = Translator;
|
|
8579
6192
|
|
|
8580
|
-
},{"./Languages/CzechDictionary":
|
|
6193
|
+
},{"./Languages/CzechDictionary":39,"./Languages/DanishDictionary":40,"./Languages/DutchDictionary":41,"./Languages/EnglishDictionary":42,"./Languages/EstonianDictionary":43,"./Languages/FinnishDictionary":44,"./Languages/FrenchDictionary":45,"./Languages/GermanDictionary":46,"./Languages/GreekDictionary":47,"./Languages/HungarianDictionary":48,"./Languages/IcelandicDictionary":49,"./Languages/ItalianDictionary":50,"./Languages/LatvianDictionary":51,"./Languages/LituanianDictionary":52,"./Languages/NorwegianDictionary":53,"./Languages/PolishDictionary":54,"./Languages/PortugueseDictionary":55,"./Languages/SpanishDictionary":56,"./Languages/SwedishDictionary":57}],59:[function(require,module,exports){
|
|
8581
6194
|
"use strict";
|
|
8582
6195
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8583
6196
|
function getAttributeNamesPolyfill() {
|
|
@@ -8596,7 +6209,7 @@ function getAttributeNamesPolyfill() {
|
|
|
8596
6209
|
exports.default = getAttributeNamesPolyfill;
|
|
8597
6210
|
;
|
|
8598
6211
|
|
|
8599
|
-
},{}],
|
|
6212
|
+
},{}],60:[function(require,module,exports){
|
|
8600
6213
|
"use strict";
|
|
8601
6214
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8602
6215
|
var ArrayUtil = /** @class */ (function () {
|
|
@@ -8634,7 +6247,7 @@ var ArrayUtil = /** @class */ (function () {
|
|
|
8634
6247
|
}());
|
|
8635
6248
|
exports.default = ArrayUtil;
|
|
8636
6249
|
|
|
8637
|
-
},{}],
|
|
6250
|
+
},{}],61:[function(require,module,exports){
|
|
8638
6251
|
"use strict";
|
|
8639
6252
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8640
6253
|
var ViewportUtil_1 = require("./ViewportUtil");
|
|
@@ -8737,7 +6350,7 @@ var DomUtil = /** @class */ (function () {
|
|
|
8737
6350
|
}());
|
|
8738
6351
|
exports.default = DomUtil;
|
|
8739
6352
|
|
|
8740
|
-
},{"./ViewportUtil":
|
|
6353
|
+
},{"./ViewportUtil":65}],62:[function(require,module,exports){
|
|
8741
6354
|
"use strict";
|
|
8742
6355
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8743
6356
|
var DomUtility = /** @class */ (function () {
|
|
@@ -8751,7 +6364,7 @@ var DomUtility = /** @class */ (function () {
|
|
|
8751
6364
|
}());
|
|
8752
6365
|
exports.default = DomUtility;
|
|
8753
6366
|
|
|
8754
|
-
},{}],
|
|
6367
|
+
},{}],63:[function(require,module,exports){
|
|
8755
6368
|
"use strict";
|
|
8756
6369
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8757
6370
|
var MakeRequest = /** @class */ (function () {
|
|
@@ -8801,7 +6414,7 @@ var MakeRequest = /** @class */ (function () {
|
|
|
8801
6414
|
}());
|
|
8802
6415
|
exports.default = MakeRequest;
|
|
8803
6416
|
|
|
8804
|
-
},{}],
|
|
6417
|
+
},{}],64:[function(require,module,exports){
|
|
8805
6418
|
"use strict";
|
|
8806
6419
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8807
6420
|
exports.StringUtil = void 0;
|
|
@@ -8819,7 +6432,7 @@ var StringUtil = /** @class */ (function () {
|
|
|
8819
6432
|
}());
|
|
8820
6433
|
exports.StringUtil = StringUtil;
|
|
8821
6434
|
|
|
8822
|
-
},{}],
|
|
6435
|
+
},{}],65:[function(require,module,exports){
|
|
8823
6436
|
"use strict";
|
|
8824
6437
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8825
6438
|
exports.ViewportUtil = void 0;
|
|
@@ -8863,7 +6476,7 @@ var ViewportUtil = /** @class */ (function () {
|
|
|
8863
6476
|
}());
|
|
8864
6477
|
exports.ViewportUtil = ViewportUtil;
|
|
8865
6478
|
|
|
8866
|
-
},{}],
|
|
6479
|
+
},{}],66:[function(require,module,exports){
|
|
8867
6480
|
"use strict";
|
|
8868
6481
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8869
6482
|
var debouncer = function (func, wait, immediate) {
|
|
@@ -8916,7 +6529,7 @@ var debouncer = function (func, wait, immediate) {
|
|
|
8916
6529
|
};
|
|
8917
6530
|
exports.default = debouncer;
|
|
8918
6531
|
|
|
8919
|
-
},{}],
|
|
6532
|
+
},{}],67:[function(require,module,exports){
|
|
8920
6533
|
"use strict";
|
|
8921
6534
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8922
6535
|
var BankAccountValidator = /** @class */ (function () {
|
|
@@ -8930,7 +6543,7 @@ var BankAccountValidator = /** @class */ (function () {
|
|
|
8930
6543
|
}());
|
|
8931
6544
|
exports.default = BankAccountValidator;
|
|
8932
6545
|
|
|
8933
|
-
},{}],
|
|
6546
|
+
},{}],68:[function(require,module,exports){
|
|
8934
6547
|
"use strict";
|
|
8935
6548
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8936
6549
|
var BankAccountRegistrationNumberValidator = /** @class */ (function () {
|
|
@@ -8944,7 +6557,7 @@ var BankAccountRegistrationNumberValidator = /** @class */ (function () {
|
|
|
8944
6557
|
}());
|
|
8945
6558
|
exports.default = BankAccountRegistrationNumberValidator;
|
|
8946
6559
|
|
|
8947
|
-
},{}],
|
|
6560
|
+
},{}],69:[function(require,module,exports){
|
|
8948
6561
|
"use strict";
|
|
8949
6562
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8950
6563
|
var BankIdNorwayValidator = /** @class */ (function () {
|
|
@@ -8967,7 +6580,7 @@ var BankIdNorwayValidator = /** @class */ (function () {
|
|
|
8967
6580
|
}());
|
|
8968
6581
|
exports.default = BankIdNorwayValidator;
|
|
8969
6582
|
|
|
8970
|
-
},{}],
|
|
6583
|
+
},{}],70:[function(require,module,exports){
|
|
8971
6584
|
"use strict";
|
|
8972
6585
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8973
6586
|
var BankIdSwedenValidator = /** @class */ (function () {
|
|
@@ -8990,7 +6603,7 @@ var BankIdSwedenValidator = /** @class */ (function () {
|
|
|
8990
6603
|
}());
|
|
8991
6604
|
exports.default = BankIdSwedenValidator;
|
|
8992
6605
|
|
|
8993
|
-
},{}],
|
|
6606
|
+
},{}],71:[function(require,module,exports){
|
|
8994
6607
|
"use strict";
|
|
8995
6608
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8996
6609
|
var CprValidator = /** @class */ (function () {
|
|
@@ -9067,7 +6680,7 @@ var CprValidator = /** @class */ (function () {
|
|
|
9067
6680
|
}());
|
|
9068
6681
|
exports.default = CprValidator;
|
|
9069
6682
|
|
|
9070
|
-
},{}],
|
|
6683
|
+
},{}],72:[function(require,module,exports){
|
|
9071
6684
|
"use strict";
|
|
9072
6685
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9073
6686
|
var CvrValidator = /** @class */ (function () {
|
|
@@ -9099,7 +6712,7 @@ var CvrValidator = /** @class */ (function () {
|
|
|
9099
6712
|
}());
|
|
9100
6713
|
exports.default = CvrValidator;
|
|
9101
6714
|
|
|
9102
|
-
},{}],
|
|
6715
|
+
},{}],73:[function(require,module,exports){
|
|
9103
6716
|
"use strict";
|
|
9104
6717
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9105
6718
|
var SECompanyRegistrationValidator = /** @class */ (function () {
|
|
@@ -9138,7 +6751,7 @@ var SECompanyRegistrationValidator = /** @class */ (function () {
|
|
|
9138
6751
|
}());
|
|
9139
6752
|
exports.default = SECompanyRegistrationValidator;
|
|
9140
6753
|
|
|
9141
|
-
},{}],
|
|
6754
|
+
},{}],74:[function(require,module,exports){
|
|
9142
6755
|
"use strict";
|
|
9143
6756
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9144
6757
|
var SEPersonalNumberValidator = /** @class */ (function () {
|
|
@@ -9182,7 +6795,7 @@ var SEPersonalNumberValidator = /** @class */ (function () {
|
|
|
9182
6795
|
}());
|
|
9183
6796
|
exports.default = SEPersonalNumberValidator;
|
|
9184
6797
|
|
|
9185
|
-
},{}],
|
|
6798
|
+
},{}],75:[function(require,module,exports){
|
|
9186
6799
|
"use strict";
|
|
9187
6800
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9188
6801
|
var elementConfig = /** @class */ (function () {
|
|
@@ -9235,7 +6848,7 @@ var CustomElement = function (config) {
|
|
|
9235
6848
|
};
|
|
9236
6849
|
exports.default = CustomElement;
|
|
9237
6850
|
|
|
9238
|
-
},{}],
|
|
6851
|
+
},{}],76:[function(require,module,exports){
|
|
9239
6852
|
"use strict";
|
|
9240
6853
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9241
6854
|
exports.CustomInputElement = exports.elements = exports.CustomForm = void 0;
|
|
@@ -9251,6 +6864,6 @@ Object.defineProperty(exports, "CustomInputElement", { enumerable: true, get: fu
|
|
|
9251
6864
|
var elements = require("./elements/Elements");
|
|
9252
6865
|
exports.elements = elements;
|
|
9253
6866
|
|
|
9254
|
-
},{"./custom-form":
|
|
6867
|
+
},{"./custom-form":9,"./elements/Elements":22,"./framework/CustomInputElement":37,"@webcomponents/webcomponentsjs/custom-elements-es5-adapter.js":2,"@webcomponents/webcomponentsjs/webcomponents-bundle":3,"@webcomponents/webcomponentsjs/webcomponents-loader.js":4}]},{},[1])
|
|
9255
6868
|
|
|
9256
6869
|
//# sourceMappingURL=index.min.js.map
|