@progress/kendo-dateinputs-common 0.1.0 → 0.2.0-dev.202301061341

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.
Files changed (55) hide show
  1. package/README.md +34 -3
  2. package/dist/cdn/js/kendo-dateinputs-common.js +1 -0
  3. package/dist/cdn/main.js +1 -1
  4. package/dist/es/common/constants.js +6 -0
  5. package/dist/es/common/dateobject.js +1159 -0
  6. package/dist/es/common/key.js +16 -0
  7. package/dist/es/common/keycode.js +16 -0
  8. package/dist/es/common/mask.js +8 -0
  9. package/dist/es/common/observable.js +32 -0
  10. package/dist/es/common/utils.js +128 -0
  11. package/dist/es/dateinput/dateinput.js +1011 -0
  12. package/dist/es/dateinput/interaction-mode.js +6 -0
  13. package/dist/es/dateinput/utils.js +93 -0
  14. package/dist/es/main.js +1 -1
  15. package/dist/es2015/common/constants.js +6 -0
  16. package/dist/es2015/common/dateobject.js +1137 -0
  17. package/dist/es2015/common/key.js +16 -0
  18. package/dist/es2015/common/keycode.js +16 -0
  19. package/dist/es2015/common/mask.js +6 -0
  20. package/dist/es2015/common/observable.js +29 -0
  21. package/dist/es2015/common/utils.js +117 -0
  22. package/dist/es2015/dateinput/dateinput.js +969 -0
  23. package/dist/es2015/dateinput/interaction-mode.js +6 -0
  24. package/dist/es2015/dateinput/utils.js +92 -0
  25. package/dist/es2015/main.js +1 -1
  26. package/dist/npm/common/constants.d.ts +6 -0
  27. package/dist/npm/common/constants.js +8 -0
  28. package/dist/npm/common/dateobject.d.ts +172 -0
  29. package/dist/npm/common/dateobject.js +1161 -0
  30. package/dist/npm/common/key.d.ts +16 -0
  31. package/dist/npm/common/key.js +18 -0
  32. package/dist/npm/common/keycode.d.ts +16 -0
  33. package/dist/npm/common/keycode.js +18 -0
  34. package/dist/npm/common/mask.d.ts +4 -0
  35. package/dist/npm/common/mask.js +10 -0
  36. package/dist/npm/common/observable.d.ts +9 -0
  37. package/dist/npm/common/observable.js +34 -0
  38. package/dist/npm/common/utils.d.ts +60 -0
  39. package/dist/npm/common/utils.js +130 -0
  40. package/dist/npm/dateinput/dateinput.d.ts +204 -0
  41. package/dist/npm/dateinput/dateinput.js +1013 -0
  42. package/dist/npm/dateinput/interaction-mode.d.ts +5 -0
  43. package/dist/npm/dateinput/interaction-mode.js +8 -0
  44. package/dist/npm/dateinput/utils.d.ts +27 -0
  45. package/dist/npm/dateinput/utils.js +95 -0
  46. package/dist/npm/main.d.ts +1 -1
  47. package/dist/npm/main.js +2 -2
  48. package/dist/systemjs/kendo-dateinputs-common.js +1 -0
  49. package/package.json +9 -7
  50. package/dist/cdn/js/kendo-typescript-package-base.js +0 -1
  51. package/dist/es/my-class.js +0 -15
  52. package/dist/es2015/my-class.js +0 -11
  53. package/dist/npm/my-class.d.ts +0 -9
  54. package/dist/npm/my-class.js +0 -17
  55. package/dist/systemjs/kendo-typescript-package-base.js +0 -1
@@ -0,0 +1,5 @@
1
+ export declare enum DateInputInteractionMode {
2
+ None = "none",
3
+ Caret = "caret",
4
+ Selection = "selection"
5
+ }
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ var DateInputInteractionMode;
4
+ (function (DateInputInteractionMode) {
5
+ DateInputInteractionMode["None"] = "none";
6
+ DateInputInteractionMode["Caret"] = "caret";
7
+ DateInputInteractionMode["Selection"] = "selection";
8
+ })(DateInputInteractionMode = exports.DateInputInteractionMode || (exports.DateInputInteractionMode = {}));
@@ -0,0 +1,27 @@
1
+ /**
2
+ * @hidden
3
+ */
4
+ export declare const padZero: (length: any) => string;
5
+ /**
6
+ * @hidden
7
+ */
8
+ export declare const unpadZero: (value: string) => string;
9
+ /**
10
+ * @hidden
11
+ */
12
+ export declare const approximateStringMatching: ({ oldText, newText, formatPattern, selectionStart, isInCaretMode, keyEvent }: {
13
+ oldText: any;
14
+ newText: any;
15
+ formatPattern: any;
16
+ selectionStart: any;
17
+ isInCaretMode: any;
18
+ keyEvent: any;
19
+ }) => any;
20
+ /**
21
+ * @hidden
22
+ */
23
+ export declare const dateSymbolMap: (map: any, part: any) => any;
24
+ /**
25
+ * @hidden
26
+ */
27
+ export declare const isInRange: (candidate: any, min: any, max: any) => boolean;
@@ -0,0 +1,95 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ var constants_1 = require("../common/constants");
4
+ var key_1 = require("../common/key");
5
+ /**
6
+ * @hidden
7
+ */
8
+ exports.padZero = function (length) { return new Array(Math.max(length, 0)).fill('0').join(''); };
9
+ /**
10
+ * @hidden
11
+ */
12
+ exports.unpadZero = function (value) { return value.replace(/^0*/, ''); };
13
+ /**
14
+ * @hidden
15
+ */
16
+ exports.approximateStringMatching = function (_a) {
17
+ /*
18
+ Remove the right part of the cursor.
19
+ oldFormat = oldFormat.substring(0, caret + oldText.length - newText.length);
20
+ */
21
+ var oldText = _a.oldText, newText = _a.newText, formatPattern = _a.formatPattern, selectionStart = _a.selectionStart, isInCaretMode = _a.isInCaretMode, keyEvent = _a.keyEvent;
22
+ var oldTextSeparator = oldText[selectionStart + oldText.length - newText.length];
23
+ var oldSegmentText = oldText.substring(0, selectionStart + oldText.length - newText.length);
24
+ var newSegmentText = newText.substring(0, selectionStart);
25
+ var diff = [];
26
+ /* Handle the typing of a single character over the same selection. */
27
+ if (oldSegmentText === newSegmentText && selectionStart > 0) {
28
+ diff.push([formatPattern[selectionStart - 1], newSegmentText[selectionStart - 1]]);
29
+ return diff;
30
+ }
31
+ if (oldSegmentText.indexOf(newSegmentText) === 0 && (isInCaretMode &&
32
+ (keyEvent.key === key_1.Key.DELETE || keyEvent.key === key_1.Key.BACKSPACE)) ||
33
+ (oldSegmentText.indexOf(newSegmentText) === 0 && !isInCaretMode &&
34
+ (newSegmentText.length === 0 ||
35
+ formatPattern[newSegmentText.length - 1] !== formatPattern[newSegmentText.length]))) {
36
+ /* Handle Delete/Backspace. */
37
+ var deletedSymbol = '';
38
+ /*
39
+ The whole text is replaced by the same character.
40
+ A nasty patch is required to keep the selection in the first segment.
41
+ */
42
+ if (!isInCaretMode && newSegmentText.length === 1) {
43
+ diff.push([formatPattern[0], newSegmentText[0]]);
44
+ }
45
+ for (var i = newSegmentText.length; i < oldSegmentText.length; i++) {
46
+ if (formatPattern[i] !== deletedSymbol && formatPattern[i] !== constants_1.Constants.formatSeparator) {
47
+ deletedSymbol = formatPattern[i];
48
+ diff.push([deletedSymbol, '']);
49
+ }
50
+ }
51
+ return diff;
52
+ }
53
+ /*
54
+ Handle the insertion of the text (the new text is longer than the previous one).
55
+ Handle the typing over a literal as well.
56
+ */
57
+ if ((isInCaretMode &&
58
+ newSegmentText.indexOf(oldSegmentText) === 0 && formatPattern[selectionStart - 1]) ||
59
+ (!isInCaretMode &&
60
+ (newSegmentText.indexOf(oldSegmentText) === 0 ||
61
+ formatPattern[selectionStart - 1] === constants_1.Constants.formatSeparator))) {
62
+ if (isInCaretMode) {
63
+ var symbol = formatPattern[selectionStart - 1];
64
+ return [[symbol, newSegmentText[selectionStart - 1]]];
65
+ }
66
+ else {
67
+ var symbol = formatPattern[0];
68
+ for (var i = Math.max(0, oldSegmentText.length - 1); i < formatPattern.length; i++) {
69
+ if (formatPattern[i] !== constants_1.Constants.formatSeparator) {
70
+ symbol = formatPattern[i];
71
+ break;
72
+ }
73
+ }
74
+ return [[symbol, newSegmentText[selectionStart - 1]]];
75
+ }
76
+ }
77
+ /* Handle the entering of a space or a separator for navigating to the next item. */
78
+ if (newSegmentText[newSegmentText.length - 1] === ' ' || newSegmentText[newSegmentText.length - 1] === oldTextSeparator) {
79
+ return [[formatPattern[selectionStart - 1], constants_1.Constants.formatSeparator]];
80
+ }
81
+ /* Handle typing over a correctly selected part. */
82
+ var result = [[formatPattern[selectionStart - 1], newSegmentText[selectionStart - 1]]];
83
+ return result;
84
+ };
85
+ /**
86
+ * @hidden
87
+ */
88
+ exports.dateSymbolMap = function (map, part) {
89
+ map[part.pattern[0]] = part.type;
90
+ return map;
91
+ };
92
+ /**
93
+ * @hidden
94
+ */
95
+ exports.isInRange = function (candidate, min, max) { return (candidate === null || !((min && min > candidate) || (max && max < candidate))); };
@@ -1 +1 @@
1
- export { MyClass } from './my-class';
1
+ export { DateInput } from './dateinput/dateinput';
package/dist/npm/main.js CHANGED
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- var my_class_1 = require("./my-class");
4
- exports.MyClass = my_class_1.MyClass;
3
+ var dateinput_1 = require("./dateinput/dateinput");
4
+ exports.DateInput = dateinput_1.DateInput;
@@ -0,0 +1 @@
1
+ System.register("@progress/kendo-dateinputs-common",["tslib","@progress/kendo-date-math"],function(a){var r,o;function e(t){return t.__useDefault?t.default:t}return{setters:[function(t){r=e(t)},function(t){o=e(t)}],execute:function(){function i(t){var e;return(s[t]||(e=s[t]={i:t,l:!1,exports:{}},n[t].call(e.exports,e,e.exports,i),e.l=!0,e)).exports}var n,s;n=[function(t,r,e){"use strict";Object.defineProperty(r,"__esModule",{value:!0});function o(t){return t&&"object"==typeof t&&!Array.isArray(t)}var n=e(2);r.isPresent=function(t){return null!=t},r.isDocumentAvailable=function(){return!!document},r.isNumber=function(t){return r.isPresent(t)&&"number"==typeof t&&!Number.isNaN(t)},r.parseToInt=function(t){return parseInt(t,10)},r.clamp=function(t,e,n){return Math.min(n,Math.max(e,t))},r.extend=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return Object.assign.apply(Object,t)},r.deepExtend=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];if(!e.length)return t;var i,s=e.shift();if(o(t)&&o(s))for(var a in s)i=s[a],i instanceof HTMLElement?t[a]=s[a]:o(s[a])?(t[a]||r.extend(t,((i={})[a]={},i)),r.deepExtend(t[a],s[a])):r.extend(t,((i={})[a]=s[a],i));return r.deepExtend.apply(void 0,[t].concat(e))},r.noop=function(){},r.isFunction=function(t){return"function"==typeof t},r.cropTwoDigitYear=function(t){return!r.isPresent(t)||isNaN(t.getTime())?0:Number(t.getFullYear().toString().slice(-2))},r.setYears=function(t,e){t=n.cloneDate(t);return t.setFullYear(e),t},r.millisecondDigitsInFormat=function(t){t=t&&t.match(/S+(\1)/);return t?t[0].length:0},r.millisecondStepFor=function(t){return Math.pow(10,3-t)},r.areDatePartsEqualTo=function(t,e,n,i,s,a,r,o){return!(!t||t.getFullYear()!==e||t.getMonth()!==n||t.getDate()!==i||t.getHours()!==s||t.getMinutes()!==a||t.getSeconds()!==r||t.getMilliseconds()!==o)},r.isDate=function(t){return r.isPresent(t)&&t.getTime&&r.isNumber(t.getTime())}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Constants={formatSeparator:"_",twoDigitYearMax:68,defaultDateFormat:"d",defaultLocaleId:"en"}},function(t,e){t.exports=o},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Key={DELETE:"Delete",BACKSPACE:"Backspace",TAB:"Tab",ENTER:"Enter",ESCAPE:"Escape",ARROW_LEFT:"ArrowLeft",ARROW_UP:"ArrowUp",ARROW_RIGHT:"ArrowRight",ARROW_DOWN:"ArrowDown",SPACE:" ",END:"End",HOME:"Home",PAGE_UP:"PageUp",PAGE_DOWN:"PageDown"}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var d=n(1),p=n(3);e.padZero=function(t){return new Array(Math.max(t,0)).fill("0").join("")},e.unpadZero=function(t){return t.replace(/^0*/,"")},e.approximateStringMatching=function(t){var e=t.oldText,n=t.newText,i=t.formatPattern,s=t.selectionStart,a=t.isInCaretMode,t=t.keyEvent,r=e[s+e.length-n.length],o=e.substring(0,s+e.length-n.length),e=n.substring(0,s),l=[];if(o===e&&0<s)return l.push([i[s-1],e[s-1]]),l;if(0===o.indexOf(e)&&a&&(t.key===p.Key.DELETE||t.key===p.Key.BACKSPACE)||0===o.indexOf(e)&&!a&&(0===e.length||i[e.length-1]!==i[e.length])){var h="";a||1!==e.length||l.push([i[0],e[0]]);for(var u=e.length;u<o.length;u++)i[u]!==h&&i[u]!==d.Constants.formatSeparator&&(h=i[u],l.push([h,""]));return l}if(a&&0===e.indexOf(o)&&i[s-1]||!a&&(0===e.indexOf(o)||i[s-1]===d.Constants.formatSeparator)){if(a)return[[c=i[s-1],e[s-1]]];for(var c=i[0],u=Math.max(0,o.length-1);u<i.length;u++)if(i[u]!==d.Constants.formatSeparator){c=i[u];break}return[[c,e[s-1]]]}return" "===e[e.length-1]||e[e.length-1]===r?[[i[s-1],d.Constants.formatSeparator]]:[[i[s-1],e[s-1]]]},e.dateSymbolMap=function(t,e){return t[e.pattern[0]]=e.type,t},e.isInRange=function(t,e,n){return null===t||!(e&&t<e||n&&n<t)}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),(e=e.DateInputInteractionMode||(e.DateInputInteractionMode={})).None="none",e.Caret="caret",e.Selection="selection"},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(0),s={events:{}};function a(t){this.options=i.extend({},s,t)}a.prototype.destroy=function(){},a.prototype.trigger=function(t,e){void 0===e&&(e={});var n={defaultPrevented:!1,preventDefault:function(){n.defaultPrevented=!0}};return!!i.isFunction(this.options.events[t])&&(this.options.events[t](i.extend(n,e,{sender:this})),n.defaultPrevented)},e.Observable=a},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.KeyCode={BACKSPACE:8,DELETE:46,TAB:9,ENTER:13,ESCAPE:27,ARROW_LEFT:37,ARROW_UP:38,ARROW_RIGHT:39,ARROW_DOWN:40,SPACE:32,END:35,HOME:36,PAGE_UP:33,PAGE_DOWN:34}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Mask=function(){this.symbols="",this.partMap=[]}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var A=n(2),o=n(8),T=n(4),N=n(0),h=n(1),i=/d|M|H|h|m|s/;function s(t){var e=t.intlService,n=t.formatPlaceholder,i=t.format,s=t.cycleTime,s=void 0!==s&&s,a=t.twoDigitYearMax,a=void 0===a?h.Constants.twoDigitYearMax:a,r=t.value,r=void 0===r?null:r,t=t.autoCorrectParts,t=void 0===t||t;if(this.year=!0,this.month=!0,this.date=!0,this.hours=!0,this.minutes=!0,this.seconds=!0,this.milliseconds=!0,this.leadingZero=null,this.typedMonthPart="",this.knownParts="adHhmMsEyS",this.symbols={E:"E",H:"H",M:"M",a:"a",d:"d",h:"h",m:"m",s:"s",y:"y",S:"S"},this._value=A.getDate(new Date),this.cycleTime=!1,this._partiallyInvalidDate={startDate:null,invalidDateParts:{E:{value:null,date:null,startDateOffset:0},H:{value:null,date:null,startDateOffset:0},M:{value:null,date:null,startDateOffset:0},a:{value:null,date:null,startDateOffset:0},d:{value:null,date:null,startDateOffset:0},h:{value:null,date:null,startDateOffset:0},m:{value:null,date:null,startDateOffset:0},s:{value:null,date:null,startDateOffset:0},y:{value:null,date:null,startDateOffset:0},S:{value:null,date:null,startDateOffset:0}}},this.intl=e,this.formatPlaceholder=n||"wide",this.format=i,this.cycleTime=s,this.monthNames=this.allFormattedMonths(this.localeId),this.dayPeriods=this.allDayPeriods(this.localeId),this.twoDigitYearMax=a,this.autoCorrectParts=t,r)this._value=A.cloneDate(r);else{this._value=A.getDate(new Date);for(var o=this.dateFormatString(this.value,this.format).symbols,l=0;l<o.length;l++)this.setExisting(o[l],!1)}}Object.defineProperty(s.prototype,"value",{get:function(){return this._value},set:function(t){(!t||t instanceof Date)&&(this._value=t,this.resetInvalidDate())},enumerable:!0,configurable:!0}),Object.defineProperty(s.prototype,"localeId",{get:function(){for(var t=h.Constants.defaultLocaleId,e=Object.keys(this.intl.cldr),n=0;n<e.length;n++){var i=e[n],i=this.intl.cldr[i];if(i.name&&i.calendar&&i.numbers&&i.name!==h.Constants.defaultLocaleId){t=i.name;break}}return t},enumerable:!0,configurable:!0}),s.prototype.setValue=function(t){t?A.isEqual(t,this._value)||(this._value=A.cloneDate(t),this.modifyExisting(!0)):(this._value=A.getDate(new Date),this.modifyExisting(!1)),this.resetInvalidDate()},s.prototype.hasValue=function(){var n=this;return this.intl.splitDateFormat(this.format,this.localeId).reduce(function(t,e){return t||"literal"!==e.type&&"dayperiod"!==e.type&&n.getExisting(e.pattern[0])},!1)},s.prototype.getValue=function(){for(var t=0;t<this.knownParts.length;t++)if(!this.getExisting(this.knownParts[t]))return null;return A.cloneDate(this.value)},s.prototype.getFormattedDate=function(t){return this.intl.formatDate(this.getValue(),t,this.localeId)},s.prototype.getTextAndFormat=function(t){var t=(t=void 0===t?"":t)||this.format,e=this.intl.formatDate(this.value,t,this.localeId),n=this.dateFormatString(this.value,t);if(!this.autoCorrectParts&&this._partiallyInvalidDate.startDate){for(var i="",s=this.intl.formatDate(this.value,t,this.localeId),a=this.getFormattedInvalidDates(t),r=0;r<s.length;r++){var o,l=n.symbols[r];"literal"!==n.partMap[r].type&&this.getInvalidDatePartValue(l)?"M"===l?!(2<n.partMap[r].pattern.length)&&this.getInvalidDatePartValue(l)?(o=N.parseToInt(this.getInvalidDatePartValue(l)+1).toString(),i+=o=T.padZero(Math.abs(n.partMap[r].pattern.length-o.length))+o,r+=Math.max(0,o.length-1)):i+=a[l][r]:this.getInvalidDatePartValue(l)?(i+=this.getInvalidDatePartValue(l),r+=Math.max(0,this.getInvalidDatePartValue(l).toString().length-1)):i+=a[l][r]:i+=e[r]}e=i}return this.merge(e,n)},s.prototype.getFormattedInvalidDates=function(t){var n=this,i=(t=void 0===t?"":t)||this.format,s={E:"",H:"",M:"",a:"",d:"",h:"",m:"",s:"",y:"",S:""};return Object.keys(this._partiallyInvalidDate.invalidDateParts).forEach(function(t){var e=n.getInvalidDatePart(t).date;e&&(e=n.intl.formatDate(e,i,n.localeId),s[t]=e)}),s},s.prototype.modifyExisting=function(t){for(var e=this.dateFormatString(this.value,this.format).symbols,n=0;n<e.length;n++)this.setExisting(e[n],t)},s.prototype.getExisting=function(t){switch(t){case"y":return this.year;case"M":case"L":return this.month;case"d":return this.date;case"E":return this.date&&this.month&&this.year;case"h":case"H":return this.hours;case"m":return this.minutes;case"s":return this.seconds;case"S":return this.milliseconds;default:return!0}},s.prototype.setExisting=function(t,e){switch(t){case"y":!1===(this.year=e)&&this._value.setFullYear(2e3);break;case"M":!1===(this.month=e)&&this.autoCorrectParts&&this._value.setMonth(0);break;case"d":this.date=e;break;case"h":case"H":this.hours=e;break;case"m":this.minutes=e;break;case"s":this.seconds=e;break;case"S":this.milliseconds=e}this.getValue()&&this.resetInvalidDate()},s.prototype.modifyPart=function(t,e){var n,i=A.cloneDate(this.value),s=A.cloneDate(this.value),a=!1,r=0;if(this.autoCorrectParts)switch(t){case"y":i.setFullYear(i.getFullYear()+e);break;case"M":i=A.addMonths(this.value,e);break;case"d":case"E":i.setDate(i.getDate()+e);break;case"h":case"H":i.setHours(i.getHours()+e),a=!0;break;case"m":i.setMinutes(i.getMinutes()+e),a=!0;break;case"s":i.setSeconds(i.getSeconds()+e),a=!0;break;case"S":i.setMilliseconds(i.getMilliseconds()+e);break;case"a":i.setHours(i.getHours()+12*e),a=!0}else{var o="M"===t,l="d"===t||"E"===t,h=this._partiallyInvalidDate.invalidDateParts||{},u=h[t],c=h.y.value||i.getFullYear(),d=h.M.value||i.getMonth(),p=h.d.value||h.E.value||i.getDate(),m=h.h.value||h.H.value||i.getHours(),f=h.m.value||i.getMinutes(),v=h.s.value||i.getSeconds(),g=h.S.value||i.getMilliseconds();switch(t){case"y":c+=e;break;case"M":d+=e;break;case"d":case"E":p+=e;break;case"h":case"H":m+=e;break;case"m":f+=e;break;case"s":v+=e;break;case"S":g+=e}if("M"===t){if((d<0||11<d)&&this.getExisting(t))return void this.setExisting(t,!1);d=(12+d)%12}var h=A.createDate(c,d,p,m,f,v,g),y=o||l?this.modifyDateSymbolWithValue(i,t,o?d:p):null,D=N.areDatePartsEqualTo(h,c,d,p,m,f,v,g);if(this.getValue()&&N.areDatePartsEqualTo(h,c,d,p,m,f,v,g))i=A.cloneDate(h),this.markDatePartsAsExisting();else if(o&&y)y.getMonth()===d?this.getExisting("d")?D?(i=A.cloneDate(h),this.resetInvalidDateSymbol(t)):(n=!0,this.setInvalidDatePart(t,{value:d,date:A.cloneDate(y),startDateOffset:e,startDate:A.cloneDate(this.value)}),this.setExisting(t,!1)):D?(this.resetInvalidDateSymbol(t),i=A.cloneDate(h),this.getExisting("M")&&this.getExisting("y")&&(this.setExisting("d",!0),this.resetInvalidDateSymbol("d"))):(this.resetInvalidDateSymbol(t),i=A.cloneDate(y)):(n=!0,this.setInvalidDatePart(t,{value:d,date:A.cloneDate(y),startDateOffset:e,startDate:A.cloneDate(this.value)}),this.setExisting(t,!1));else if(l&&y)y.getDate()===p?this.getExisting("M")?D?(i=A.cloneDate(h),this.resetInvalidDateSymbol(t)):(n=!0,this.setInvalidDatePart(t,{value:p,date:A.cloneDate(y),startDateOffset:e,startDate:A.cloneDate(this.value)}),this.setExisting(t,!1)):D?(i=A.cloneDate(h),this.resetInvalidDateSymbol(t),this.getExisting("d")&&this.getExisting("y")&&(this.setExisting("M",!0),this.resetInvalidDateSymbol("M"))):(this.resetInvalidDateSymbol(t),i=A.cloneDate(y)):(n=!0,this.setInvalidDatePart(t,{value:p,date:A.cloneDate(this.value),startDateOffset:e,startDate:A.cloneDate(this.value)}),this.setExisting(t,!1));else{switch(t){case"y":i.setFullYear(i.getFullYear()+e);break;case"M":i=A.addMonths(this.value,e);break;case"d":case"E":i.setDate(i.getDate()+e);break;case"h":case"H":i.setHours(i.getHours()+e),a=!0;break;case"m":i.setMinutes(i.getMinutes()+e),a=!0;break;case"s":i.setSeconds(i.getSeconds()+e),a=!0;break;case"S":i.setMilliseconds(i.getMilliseconds()+e);break;case"a":i.setHours(i.getHours()+12*e),a=!0}if(n=!0,u&&u.value)r=N.parseToInt(u.value);else if(!N.isPresent(u.value))switch(i=A.cloneDate(s),t){case"y":r=s.getFullYear();break;case"M":r=s.getMonth();break;case"d":case"E":r=s.getDate();break;case"h":case"H":r=s.getHours();break;case"m":r=s.getMinutes();break;case"s":r=s.getSeconds();break;case"S":r=s.getMilliseconds()}o=Math.max(0,r+e);"y"!==t&&(o=N.clamp(r+e,0,99)),this.setInvalidDatePart(t,{value:o,date:A.cloneDate(i),startDateOffset:(this.getInvalidDatePart(t).startDateOffset||0)+e,startDate:A.cloneDate(this.value)}),this.setExisting(t,!1)}}this.shouldNormalizeCentury()&&(i=this.normalizeCentury(i)),a&&!this.cycleTime&&(i.getDate(),this._value.getDate()),n||(this.setExisting(t,!0),this._value=i,this.getValue()&&this.resetInvalidDate())},s.prototype.parsePart=function(t){var e=t.symbol,n=t.currentChar,i=t.resetSegmentValue,s=t.cycleSegmentValue,a=t.rawTextValue,r=t.isDeleting,o=!s,t=this.dateFormatString(this.value,this.format),l=t.partMap.filter(function(t){return"literal"===t.type}).map(function(t,e){return{datePartIndex:e,literal:t.pattern}}),h={value:null,switchPart:!1,resetPart:o&&"M"===e&&t.partMap.filter(function(t){return"month"===t.type}).some(function(t){return 2<t.pattern.length})};if(!n){if(!o)return this.resetLeadingZero(),this.setExisting(e,!1),this.resetInvalidDateSymbol(e),{value:null,switchToNext:!1};for(var u=0;u<l.length;u++){var c=l[u].literal,d=a.startsWith(c),p=a.endsWith(c),c=0<=a.indexOf(c+c);if(d||p||c)return this.resetLeadingZero(),this.setExisting(e,!1),this.resetInvalidDateSymbol(e),N.extend(h,{value:null,switchToNext:!1})}}var m=this.intl.formatDate(this.value,this.format,this.localeId),f=t.symbols,v=!1,g="",y="",D="",E="";if(o)for(var b=0,S=!1,u=0;u<m.length;u++){var M=l[b];M&&M===m[u]&&b++,f[u]===e?(y+=this.getExisting(e)?m[u]:"0",(M=a[u])!==m[u]&&M===l[b].literal?S=!0:S||(D+=void 0===M?a[u-Math.abs(this.format.length-f.length)]||"":M||""),v=!0):v?E+=m[u]:g+=m[u]}else for(u=0;u<m.length;u++)f[u]===e?(y+=this.getExisting(e)?m[u]:"0",v=!0):v?E+=m[u]:g+=m[u];var P=null,I=this.matchMonth(n),s=this.matchDayPeriod(n,e),C="0"===n,x=this.leadingZero||{},w=(C&&!o?0!==parseInt(i?n:y+n,10)||this.isAbbrMonth(t.partMap,e)||this.incrementLeadingZero(e):this.resetLeadingZero(),this.partPattern(t.partMap,e)),O=w?w.pattern:null;if(o&&r&&(y=T.padZero(Math.abs(y.length-D.length))+D),o&&r&&!D)this.setExisting(e,!1);else{var w=y.length-3,F=!0;for(u=Math.max(0,w);u<=y.length&&F;u++){this.autoCorrectParts||(F=!1);var k=i?n:y.substring(u)+n,_=(!F&&o&&(k=T.unpadZero(k)),parseInt(k,10)),P=this.intl.parseDate(g+k+E,this.format,this.localeId),V=!isNaN(parseInt(n,10))||o&&r&&""===n;if(P||isNaN(_)||!V||("M"!==e||I||-1<(V=_-1)&&V<12&&((P=A.cloneDate(this.value)).setMonth(V),P.getMonth()!==V)&&(P=A.lastDayOfMonth(A.addMonths(P,-1))),"y"===e&&(P=A.createDate(parseInt(k,10),this.month?this.value.getMonth():0,this.date?this.value.getDate():1,this.hours?this.value.getHours():0,this.minutes?this.value.getMinutes():0,this.seconds?this.value.getSeconds():0,this.milliseconds?this.value.getMilliseconds():0),this.date)&&P.getDate()!==this.value.getDate()&&(P=A.lastDayOfMonth(A.addMonths(P,-1)))),P)return _=this.intl.parseDate(""+g+this.peek(k,O)+E,this.format,this.localeId),V=this.patternLength(O)||O.length,k=x+(T.unpadZero(k)||n).length>=V,V=null===_||k,this.shouldNormalizeCentury()&&(P=this.normalizeCentury(P)),this._value=P,this.setExisting(e,!0),N.extend(h,{value:this.value,switchToNext:V})}if(I&&(P=this.intl.parseDate(g+I+E,this.format,this.localeId)))return this._value=P,this.setExisting(e,!0),N.extend(h,{value:this.value,switchToNext:!1});if(s&&(P=this.intl.parseDate(g+s+E,this.format)))return this._value=P,N.extend(h,{value:this.value,switchToNext:!0});C&&(this.leadingZero=this.isAbbrMonth(t.partMap,e)?null:((w={})[e]=!0,w),this.setExisting(e,!1)),this.autoCorrectParts||(this.setExisting(e,!1),s=void 0,C=N.parseToInt(o?D:y),N.isNumber(C)&&(s="M"===e?N.clamp(C-1,0,11):C),N.isNumber(s)&&(t=this.modifyDateSymbolWithValue(this.value,e,s),this.setInvalidDatePart(e,{value:s,date:A.cloneDate(t),startDate:this._partiallyInvalidDate.startDate||A.cloneDate(this.value)})))}return N.extend(h,{value:null,switchToNext:!1})},s.prototype.symbolMap=function(t){return this.intl.splitDateFormat(this.format,this.localeId).reduce(T.dateSymbolMap,{})[t]},s.prototype.resetLeadingZero=function(){var t=null!==this.leadingZero;return this.setLeadingZero(null),t},s.prototype.setLeadingZero=function(t){this.leadingZero=t},s.prototype.normalizeCentury=function(t){var e,n;return N.isPresent(t)?(e=N.cropTwoDigitYear(t),n=this.getNormalizedCenturyBase(e),N.setYears(t,n+e)):t},s.prototype.incrementLeadingZero=function(t){var e=this.leadingZero||{};e[t]=(e[t]||0)+1,this.leadingZero=e},s.prototype.isAbbrMonth=function(t,e){t=this.partPattern(t,e);return"month"===t.type&&t.names},s.prototype.partPattern=function(t,e){return t.filter(function(t){return-1!==t.pattern.indexOf(e)})[0]},s.prototype.peek=function(t,e){t=t.replace(/^0*/,"")+"0";return T.padZero(e.length-t.length)+t},s.prototype.matchMonth=function(t){if(this.typedMonthPart+=t.toLowerCase(),0!==this.monthNames.length)for(;0<this.typedMonthPart.length;){for(var e=0;e<this.monthNames.length;e++)if(0===this.monthNames[e].toLowerCase().indexOf(this.typedMonthPart))return this.monthNames[e];var n=parseInt(this.typedMonthPart,10);if(1<=n&&n<=12&&n.toString()===this.typedMonthPart)return this.monthNames[n-1];this.typedMonthPart=this.typedMonthPart.substring(1,this.typedMonthPart.length)}return""},s.prototype.matchDayPeriod=function(t,e){t=t.toLowerCase();if("a"===e&&this.dayPeriods){if(this.dayPeriods.am.toLowerCase().startsWith(t))return this.dayPeriods.am;if(this.dayPeriods.pm.toLowerCase().startsWith(t))return this.dayPeriods.pm}return""},s.prototype.allFormattedMonths=function(t){void 0===t&&(t="en");for(var e=this.intl.splitDateFormat(this.format,this.localeId),n=0;n<e.length;n++)if("month"===e[n].type&&e[n].names)return this.intl.dateFormatNames(t,e[n].names);return[]},s.prototype.allDayPeriods=function(t){void 0===t&&(t="en");for(var e=this.intl.splitDateFormat(this.format),n=0;n<e.length;n++)if("dayperiod"===e[n].type&&e[n].names)return this.intl.dateFormatNames(t,e[n].names);return null},s.prototype.patternLength=function(t){return"y"===t[0]?4:i.test(t)?2:0},s.prototype.dateFormatString=function(t,e){for(var n=this.intl.splitDateFormat(e,this.localeId),i=[],s=[],a=0;a<n.length;a++)for(var r=this.intl.formatDate(t,{pattern:n[a].pattern},this.localeId).length;0<r;)i.push(this.symbols[n[a].pattern[0]]||h.Constants.formatSeparator),s.push(n[a]),r--;e=new o.Mask;return e.symbols=i.join(""),e.partMap=s,e},s.prototype.merge=function(t,e){for(var n="",i="",s=e.symbols,a=s.length-1;0<=a;a--)if(-1===this.knownParts.indexOf(s[a])||this.getExisting(s[a]))n=t[a]+n,i=s[a]+i;else{for(var r=s[a];0<=a&&r===s[a];)a--;for(a++,n=this.leadingZero&&this.leadingZero[r]?"0"+n:!this.autoCorrectParts&&this.getInvalidDatePartValue(r)?t.substr(a,e.partMap[a].pattern.length)+n:this.dateFieldName(e.partMap[a])+n;i.length<n.length;)i=s[a]+i}return{text:n,format:i}},s.prototype.dateFieldName=function(t){var e=this.formatPlaceholder||"wide";return e[t.type]||("formatPattern"===e?t.pattern:this.intl.dateFieldName(Object.assign(t,{nameType:e})))},s.prototype.getNormalizedCenturyBase=function(t){return t>this.twoDigitYearMax?1900:2e3},s.prototype.shouldNormalizeCentury=function(){return this.intl.splitDateFormat(this.format).some(function(t){return"yy"===t.pattern})},s.prototype.resetInvalidDate=function(){var e=this;this._partiallyInvalidDate.startDate=null,Object.keys(this._partiallyInvalidDate.invalidDateParts).forEach(function(t){e.resetInvalidDatePart(t)})},s.prototype.resetInvalidDateSymbol=function(t){var e=this,n=(this.resetInvalidDatePart(t),!0);Object.keys(this._partiallyInvalidDate.invalidDateParts).forEach(function(t){e._partiallyInvalidDate.invalidDateParts[t]&&N.isPresent(e._partiallyInvalidDate.invalidDateParts[t].value)&&(n=!1)}),n&&this.resetInvalidDate()},s.prototype.resetInvalidDatePart=function(t){this._partiallyInvalidDate.invalidDateParts[t]&&(this._partiallyInvalidDate.invalidDateParts[t]={value:null,date:null,startDateOffset:0})},s.prototype.getInvalidDatePart=function(t){return this._partiallyInvalidDate.invalidDateParts[t]||{}},s.prototype.getInvalidDatePartValue=function(t){return(this._partiallyInvalidDate.invalidDateParts[t]||{}).value},s.prototype.setInvalidDatePart=function(t,e){var n=e.value,i=e.date,i=void 0===i?null:i,s=e.startDateOffset,s=void 0===s?0:s,e=e.startDate,e=void 0===e?null:e;this._partiallyInvalidDate.invalidDateParts[t]&&(this._partiallyInvalidDate.invalidDateParts[t].value=void 0===n?null:n,this._partiallyInvalidDate.invalidDateParts[t].date=i,this._partiallyInvalidDate.invalidDateParts[t].startDateOffset=s,this._partiallyInvalidDate.startDate=e)},s.prototype.modifyDateSymbolWithOffset=function(t,e,n){var i=A.cloneDate(t),s=!1;switch(e){case"y":i.setFullYear(i.getFullYear()+n);break;case"M":i=A.addMonths(this.value,n);break;case"d":case"E":i.setDate(i.getDate()+n);break;case"h":case"H":i.setHours(i.getHours()+n),s=!0;break;case"m":i.setMinutes(i.getMinutes()+n),s=!0;break;case"s":i.setSeconds(i.getSeconds()+n),s=!0;break;case"S":i.setMilliseconds(i.getMilliseconds()+n);break;case"a":i.setHours(i.getHours()+12*n),s=!0}return{date:i,timeModified:s}},s.prototype.modifyDateSymbolWithValue=function(t,e,n){var i=A.cloneDate(t);switch(e){case"y":i.setFullYear(n);break;case"M":i=A.addMonths(t,n-t.getMonth());break;case"d":case"E":i.setDate(n);break;case"h":case"H":i.setHours(n);break;case"m":i.setMinutes(n);break;case"s":i.setSeconds(n);break;case"S":i.setMilliseconds(n);break;case"a":i.setHours(n)}return i},s.prototype.markDatePartsAsExisting=function(){this.modifyExisting(!0)},e.DateObject=s},function(t,e){t.exports=r},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i,s=n(10),a=n(9),y=n(4),D=n(7),E=n(3),r=n(0),o=n(6),b=n(5),S=n(2),M=n(1),l={format:"d",allowNulls:!1,placeholder:null,cycleTime:!0,locale:null,steps:{millisecond:1,second:1,minute:1,hour:1,day:1,month:1,year:1},formatPlaceholder:null,events:((n={}).valueChange=null,n.input=null,n.inputEnd=null,n.focus=null,n.focusEnd=null,n.blur=null,n.blurEnd=null,n.keydown=null,n.mousewheel=null,n.change=null,n),selectNearestSegmentOnFocus:!1,enableMouseWheel:!1,allowCaretMode:!1,autoSwitchParts:!0,autoSwitchKeys:[],twoDigitYearMax:M.Constants.twoDigitYearMax,autoCorrectParts:!0},n=(i=o.Observable,s.__extends(h,i),Object.defineProperty(h.prototype,"value",{get:function(){return this.dateObject&&this.dateObject.getValue()},enumerable:!0,configurable:!0}),h.prototype.init=function(t,e){var n=r.isDate(this.options.value)?S.cloneDate(this.options.value):new Date(e.formattedValue);r.isDate(n)||(n=null),this.element=t,this.options=r.extend({},l,e),this.intl=this.options.intlService,this.formatPlaceholder=this.options.formatPlaceholder||"formatPattern",this.dateObject=this.createDateObject(),this.dateObject.setValue(n),this.setTextAndFormat(),this.bindEvents(),this.resetSegmentValue=!0,this.forceUpdate()},h.prototype.destroy=function(){this.unbindEvents(),this.dateObject=null,i.prototype.destroy.call(this)},h.prototype.bindEvents=function(){this.onElementDragStart=this.onElementDragStart.bind(this),this.element.addEventListener("dragStart",this.onElementDragStart),this.onElementDrop=this.onElementDrop.bind(this),this.element.addEventListener("drop",this.onElementDrop),this.onElementClick=this.onElementClick.bind(this),this.element.addEventListener("click",this.onElementClick),this.onElementMouseDown=this.onElementMouseDown.bind(this),this.element.addEventListener("mousedown",this.onElementMouseDown),this.element.addEventListener("touchstart",this.onElementMouseDown),this.onElementMouseUp=this.onElementMouseUp.bind(this),this.element.addEventListener("mouseup",this.onElementMouseUp),this.onElementInput=this.onElementInput.bind(this),this.element.addEventListener("input",this.onElementInput),this.onElementKeyDown=this.onElementKeyDown.bind(this),this.element.addEventListener("keydown",this.onElementKeyDown),this.onElementFocus=this.onElementFocus.bind(this),this.element.addEventListener("focus",this.onElementFocus),this.onElementBlur=this.onElementBlur.bind(this),this.element.addEventListener("blur",this.onElementBlur),this.onElementChange=this.onElementChange.bind(this),this.element.addEventListener("change",this.onElementChange),this.onElementPaste=this.onElementPaste.bind(this),this.element.addEventListener("paste",this.onElementPaste),this.onElementMouseWheel=this.onElementMouseWheel.bind(this),this.element.addEventListener("DOMMouseScroll",this.onElementMouseWheel),this.element.addEventListener("mousewheel",this.onElementMouseWheel)},h.prototype.unbindEvents=function(){this.element.removeEventListener("dragStart",this.onElementDragStart),this.element.removeEventListener("drop",this.onElementDrop),this.element.removeEventListener("touchstart",this.onElementMouseDown),this.element.removeEventListener("mousedown",this.onElementMouseDown),this.element.removeEventListener("mouseup",this.onElementMouseUp),this.element.removeEventListener("click",this.onElementClick),this.element.removeEventListener("input",this.onElementInput),this.element.removeEventListener("keydown",this.onElementKeyDown),this.element.removeEventListener("focus",this.onElementFocus),this.element.removeEventListener("blur",this.onElementBlur),this.element.removeEventListener("change",this.onElementChange),this.element.removeEventListener("paste",this.onElementPaste),this.element.removeEventListener("DOMMouseScroll",this.onElementMouseWheel),this.element.removeEventListener("mousewheel",this.onElementMouseWheel)},h.prototype.setOptions=function(t,e){void 0===e&&(e=!1),this.options=r.extend(this.options,t),e&&(this.destroy(),this.init(this.element,t))},h.prototype.resetLocale=function(){this.unbindEvents(),this.init(this.element,this.options)},h.prototype.isInCaretMode=function(){return this.interactionMode===b.DateInputInteractionMode.Caret},h.prototype.focus=function(){this.element.focus(),this.options.selectNearestSegmentOnFocus&&this.selectNearestSegment(0)},h.prototype.onElementDragStart=function(t){t.preventDefault()},h.prototype.onElementDrop=function(t){t.preventDefault()},h.prototype.onElementMouseDown=function(){this.mouseDownStarted=!0,this.focusedPriorToMouseDown=this.isActive},h.prototype.onElementMouseUp=function(t){this.mouseDownStarted=!1,t.preventDefault()},h.prototype.onElementClick=function(t){this.mouseDownStarted=!1;var e,n=this.selection;this.isInCaretMode()&&this.forceUpdate(),3!==t.detail&&(this.isActive&&this.options.selectNearestSegmentOnFocus?(t=this.element.selectionStart!==this.element.selectionEnd,e=r.isPresent(this.options.placeholder)&&!this.dateObject.hasValue()&&!this.focusedPriorToMouseDown,t=!t&&e?0:this.caret()[0],this.selectNearestSegment(t)):this.setSelection(this.selectionByIndex(n.start)))},h.prototype.onElementInput=function(t){this.triggerInput({event:t});var e=this.keyDownEvent||{},n=e.keyCode===D.KeyCode.BACKSPACE||e.key===E.Key.BACKSPACE,i=e.keyCode===D.KeyCode.DELETE||e.key===E.Key.DELETE;if(this.element&&this.dateObject)if(this.isPasteInProgress)this.options.allowCaretMode&&(this.resetSegmentValue=!1),this.updateOnPaste(t),this.isPasteInProgress=!1;else{var e=this.interactionMode,s=(!this.options.allowCaretMode||e===b.DateInputInteractionMode.Caret||i||n||(this.resetSegmentValue=!0),this.options.allowCaretMode?this.interactionMode=b.DateInputInteractionMode.Caret:this.interactionMode=b.DateInputInteractionMode.Selection,this.isInCaretMode());if(s&&this.keyDownEvent.key===E.Key.SPACE)this.setPreviousInputEventState(this.keyDownEvent);else{var a=this.dateObject&&this.dateObject.getValue(),r=this.dateObject.getTextAndFormat(),o=r.text,r=r.format,r=(this.currentFormat=r,s&&(n||i)?this.previousElementValue:o),l=y.approximateStringMatching({oldText:r,newText:this.element.value,formatPattern:this.currentFormat,selectionStart:this.selection.start,isInCaretMode:s,keyEvent:this.keyDownEvent});if(!s||l&&0!==l.length){if(s&&1===l.length){if(!l[0]||!l[0][0])return void this.setPreviousInputEventState(this.keyDownEvent);if(s&&l[0]&&(l[0][0]===M.Constants.formatSeparator||l[0][1]===M.Constants.formatSeparator))return void this.setPreviousInputEventState(this.keyDownEvent)}var o=1===l.length&&l[0][1]===M.Constants.formatSeparator,h=[],u=!1;if(!o)for(var c=0;c<l.length;c++){var d=this.dateObject.parsePart({symbol:l[c][0],currentChar:l[c][1],resetSegmentValue:this.resetSegmentValue,cycleSegmentValue:!this.isInCaretMode(),rawTextValue:this.element.value,isDeleting:n||i});h.push(d),u=d.switchToNext}this.options.autoSwitchParts||(u=!1),this.resetSegmentValue=!1;var p,r=h[h.length-1],m=r&&!r.value,f=s&&(n||i)&&m,r=!!r&&r.resetPart,v=!S.isEqual(a,this.dateObject.value),g=this.selection;s&&!f&&!r||(r&&(p=this.currentFormat[g.start]),this.forceUpdate()),l.length&&l[0][0]!==M.Constants.formatSeparator&&(!s||f||r)&&(p?this.setSelection(this.selectionBySymbol(p)):!this.options.autoSwitchParts&&l[0][1]===M.Constants.formatSeparator||this.setSelection(this.selectionBySymbol(l[0][0]))),u||!s||n||i||r||!m?this.options.autoSwitchParts&&(u||o)&&!s&&this.switchDateSegment(1):!v||this.currentFormat.length===this.elementValue.length||s&&e!==b.DateInputInteractionMode.Caret&&v||(s&&e!==b.DateInputInteractionMode.Caret?(p=this.currentFormat[g.start],this.forceUpdate(),this.setSelection(this.selectionBySymbol(p))):this.setPreviousInputEventState(this.keyDownEvent)),this.tryTriggerValueChange({oldValue:a,event:t}),this.triggerInputEnd({event:t})}else this.setPreviousInputEventState(this.keyDownEvent)}}},h.prototype.onElementFocus=function(t){this.triggerFocus({event:t})||(this.isActive=!0,this.interactionMode=b.DateInputInteractionMode.None,this.refreshElementValue(),this.mouseDownStarted||this.caret(0,this.elementValue.length),this.mouseDownStarted=!1,this.triggerFocusEnd({event:t}))},h.prototype.onElementBlur=function(t){this.resetSegmentValue=!0,this.isActive=!1,this.triggerBlur({event:t})||(this.interactionMode=b.DateInputInteractionMode.None,this.refreshElementValue(),this.triggerBlurEnd({event:t}))},h.prototype.onElementChange=function(t){this.triggerChange({event:t})},h.prototype.onElementKeyDown=function(t){if(!this.triggerKeyDown({event:t})){this.keyDownEvent=t,this.previousElementValue=this.element.value;var e=(this.options.autoSwitchKeys||[]).map(function(t){return t.toString().toLowerCase().trim()});if(0<=e.indexOf(t.keyCode.toString())||0<=e.indexOf(t.keyCode)||0<=e.indexOf(t.key.toLowerCase().trim())){e=0<=e.indexOf(E.Key.TAB.toLowerCase().trim())||0<=e.indexOf(D.KeyCode.TAB)||0<=e.indexOf(D.KeyCode.TAB.toString());if(!e)return t.preventDefault(),void this.switchDateSegment(1);var n=this.selection,i=n.start,n=n.end;if(t.shiftKey&&e?this.switchDateSegment(-1):this.switchDateSegment(1),i!==this.selection.start||n!==this.selection.end)return void t.preventDefault()}var s,a=this.currentFormat[this.selection.start],r=this.getStepFromSymbol(a),o=!1;if(!(t.altKey||t.ctrlKey||t.metaKey||t.keyCode===D.KeyCode.TAB)){switch(t.keyCode){case D.KeyCode.ARROW_LEFT:this.switchDateSegment(-1),o=!0;break;case D.KeyCode.ARROW_UP:this.modifyDateSegmentValue(r,a,event),o=!0;break;case D.KeyCode.ARROW_RIGHT:this.switchDateSegment(1),o=!0;break;case D.KeyCode.ARROW_DOWN:this.modifyDateSegmentValue(-r,a,event),o=!0;break;case D.KeyCode.ENTER:break;case D.KeyCode.DELETE:case D.KeyCode.BACKSPACE:return this.options.allowNulls&&(s=this.dateObject.value,this.dateObject.setValue(null),this.forceUpdate(),this.tryTriggerValueChange({oldValue:s,event:t})),o=!0,void(t.keyCode===D.KeyCode.BACKSPACE&&(0<=(this.options.autoSwitchKeys||[]).indexOf(D.KeyCode.BACKSPACE)||0<=(this.options.autoSwitchKeys||[]).indexOf(E.Key.BACKSPACE))&&this.switchDateSegment(-1));case E.Key.HOME:this.selectNearestSegment(0);break;case E.Key.END:this.selectNearestSegment(this.elementValue.length);break;default:return}o&&t.preventDefault()}}},h.prototype.onElementPaste=function(){this.isPasteInProgress=!0},h.prototype.onElementMouseWheel=function(t){this.options.enableMouseWheel&&!this.triggerMouseWheel({event:t})&&this.isActive&&((t=t).shiftKey?this.switchDateSegment(0<(t.wheelDelta||-t.detail)?-1:1):this.modifyDateSegmentValue(0<(t.wheelDelta||-t.detail)?1:-1),t.returnValue=!1,t.preventDefault&&t.preventDefault(),t.stopPropagation)&&t.stopPropagation()},h.prototype.updateOnPaste=function(t){var e=this.intl.parseDate(this.elementValue,this.inputFormat)||this.value,n=(r.isPresent(e)&&this.dateObject.shouldNormalizeCentury()&&(e=this.dateObject.normalizeCentury(e)),this.dateObject&&this.dateObject.getValue());this.writeValue(e),this.tryTriggerValueChange({oldValue:n,event:t})},Object.defineProperty(h.prototype,"elementValue",{get:function(){return(this.element||{}).value||""},enumerable:!0,configurable:!0}),Object.defineProperty(h.prototype,"inputFormat",{get:function(){return this.options.format?"string"==typeof this.options.format?this.options.format:this.options.format.inputFormat:M.Constants.defaultDateFormat},enumerable:!0,configurable:!0}),Object.defineProperty(h.prototype,"displayFormat",{get:function(){return this.options.format?"string"==typeof this.options.format?this.options.format:this.options.format.displayFormat:M.Constants.defaultDateFormat},enumerable:!0,configurable:!0}),Object.defineProperty(h.prototype,"selection",{get:function(){var t={start:0,end:0};return t=null!==this.element&&void 0!==this.element.selectionStart?{start:this.element.selectionStart,end:this.element.selectionEnd}:t},enumerable:!0,configurable:!0}),h.prototype.setSelection=function(t){this.element&&document.activeElement===this.element&&this.element.setSelectionRange(t.start,t.end)},h.prototype.selectionBySymbol=function(t){for(var e=-1,n=0,i=0;i<this.currentFormat.length;i++)this.currentFormat[i]===t&&(n=i+1,-1===e)&&(e=i);return{start:e=e<0?0:e,end:n}},h.prototype.selectionByIndex=function(t){for(var e={start:t,end:t},n=t,i=t-1;n<this.currentFormat.length||0<=i;n++,i--){if(n<this.currentFormat.length&&this.currentFormat[n]!==M.Constants.formatSeparator){e=this.selectionBySymbol(this.currentFormat[n]);break}if(0<=i&&this.currentFormat[i]!==M.Constants.formatSeparator){e=this.selectionBySymbol(this.currentFormat[i]);break}}return e},h.prototype.switchDateSegment=function(t){var e=this.selection;if(this.isInCaretMode()){for(var n=e.start,i=(this.currentFormat[n],n);0<=i;i--)if(this.currentFormat[i]!==M.Constants.formatSeparator){n=i;break}for(var s=void 0,i=n;i<this.currentFormat.length&&(s=this.currentFormat[i])===M.Constants.formatSeparator;i++);s&&(this.forceUpdate(),this.setSelection(this.selectionBySymbol(s)))}var e=this.selection,a=e.start,e=e.end;if(a<e&&this.currentFormat[a]!==this.currentFormat[e-1])this.setSelection(this.selectionByIndex(0<t?a:e-1)),this.resetSegmentValue=!0;else{for(var r=this.currentFormat[a],o=a+t;0<o&&o<this.currentFormat.length&&(this.currentFormat[o]===r||this.currentFormat[o]===M.Constants.formatSeparator);)o+=t;if(this.currentFormat[o]!==M.Constants.formatSeparator){for(var l=o;0<=l&&l<this.currentFormat.length&&this.currentFormat[l]===this.currentFormat[o];)l+=t;l<o&&(l+1!==a||o+1!==e)?(this.setSelection({start:l+1,end:o+1}),this.resetSegmentValue=!0):o<l&&(o!==a||l!==e)&&(this.setSelection({start:o,end:l}),this.resetSegmentValue=!0)}}},h.prototype.modifyDateSegmentValue=function(t,e,n){var i,s;void 0===e&&(e=""),void 0===n&&(n={}),this.dateObject&&(i=this.value,t=+t,s=this.caret(),"S"!==(e=e||this.currentFormat[s[0]])||this.options.steps.millisecond||(s=r.millisecondDigitsInFormat(this.inputFormat),t=r.millisecondStepFor(s)),this.dateObject.modifyPart(e,t),this.tryTriggerValueChange({oldValue:i,event:n}),this.forceUpdate(),this.setSelection(this.selectionBySymbol(e)))},h.prototype.tryTriggerValueChange=function(t){if(!S.isEqual(this.value,(t=void 0===t?{oldValue:null,event:{}}:t).oldValue))return this.triggerValueChange(t)},h.prototype.triggerValueChange=function(t){return this.trigger("valueChange",r.extend(t=void 0===t?{oldValue:null,event:{}}:t,{value:this.value}))},h.prototype.triggerInput=function(t){return this.trigger("input",r.extend(t=void 0===t?{event:{}}:t,{value:this.value}))},h.prototype.triggerInputEnd=function(t){return this.trigger("inputEnd",r.extend(t=void 0===t?{event:{}}:t,{value:this.value}))},h.prototype.triggerFocus=function(t){return this.trigger("focus",r.extend({},t=void 0===t?{event:{}}:t))},h.prototype.triggerFocusEnd=function(t){return this.trigger("focusEnd",r.extend({},t=void 0===t?{event:{}}:t))},h.prototype.triggerBlur=function(t){return this.trigger("blur",r.extend({},t=void 0===t?{event:{}}:t))},h.prototype.triggerBlurEnd=function(t){return this.trigger("blurEnd",r.extend({},t=void 0===t?{event:{}}:t))},h.prototype.triggerChange=function(t){return this.trigger("change",r.extend(t=void 0===t?{event:{}}:t,{value:this.value}))},h.prototype.triggerKeyDown=function(t){return this.trigger("keydown",r.extend({},t=void 0===t?{event:{}}:t))},h.prototype.triggerMouseWheel=function(t){return this.trigger("mousewheel",r.extend({},t=void 0===t?{event:{}}:t))},h.prototype.forceUpdate=function(){this.setTextAndFormat(),this.refreshElementValue()},h.prototype.setTextAndFormat=function(){var t=this.dateObject.getTextAndFormat(),e=t.text,t=t.format;this.currentFormat=t,this.currentText=e},h.prototype.setElementValue=function(t){this.previousElementValue=this.element.value,this.element.value=t},h.prototype.getStepFromSymbol=function(t){switch(t){case"S":return Number(this.options.steps.millisecond);case"s":return Number(this.options.steps.second);case"m":return Number(this.options.steps.minute);case"h":case"H":return Number(this.options.steps.hour);case"M":return Number(this.options.steps.month);case"d":case"E":return Number(this.options.steps.day);case"y":return Number(this.options.steps.year);default:return 1}},h.prototype.setPreviousInputEventState=function(t){var e=this.selection,n=e.start,e=e.end,t=t.keyCode===D.KeyCode.BACKSPACE?1:t.keyCode===D.KeyCode.DELETE?0:(t.keyCode,D.KeyCode.SPACE,-1);this.setElementValue(this.previousElementValue||""),this.setSelection({start:n+t,end:e+t})},h.prototype.writeValue=function(t){this.verifyValue(t),this.dateObject=this.getDateObject(t),this.refreshElementValue()},h.prototype.verifyValue=function(t){if(t&&!r.isDate(t))throw new Error("The 'value' should be a valid JavaScript Date instance.")},h.prototype.refreshElementValue=function(){var t=this.caret()[0],e=this.element,n=this.isActive?this.inputFormat:this.displayFormat,n=this.dateObject.getTextAndFormat(n),i=n.text,n=n.format,n=(this.currentFormat=n,this.currentText=i,!this.isActive&&r.isPresent(this.options.placeholder)&&!this.dateObject.hasValue());r.isPresent(this.options.placeholder)&&(e.placeholder=this.options.placeholder),this.setElementValue(n?"":i),this.isActive&&!this.options.allowCaretMode&&this.options.selectNearestSegmentOnFocus&&this.selectNearestSegment(t)},h.prototype.caret=function(t,e){void 0===e&&(e=t);var n=void 0!==t,i=[t,t],s=this.element;if(!n||!this.options.disabled&&!this.options.readonly){try{void 0!==s.selectionStart&&(n&&(r.isDocumentAvailable()&&document.activeElement!==s&&s.focus(),s.setSelectionRange(t,e)),i=[s.selectionStart,s.selectionEnd])}catch(t){i=[]}return i}},h.prototype.selectNearestSegment=function(t){for(var e=t,n=t-1;e<this.currentFormat.length||0<=n;e++,n--){if(e<this.currentFormat.length&&"_"!==this.currentFormat[e])return void this.selectDateSegment(this.currentFormat[e]);if(0<=n&&"_"!==this.currentFormat[n])return void this.selectDateSegment(this.currentFormat[n])}},h.prototype.selectDateSegment=function(t){for(var e=-1,n=0,i=0;i<this.currentFormat.length;i++)this.currentFormat[i]===t&&(n=i+1,-1===e)&&(e=i);e<0&&(e=0),this.caret(0,0),this.caret(e,n)},h.prototype.getDateObject=function(t){var e=(this.dateObject||{}).leadingZero,t=this.createDateObject({value:t});return t.setLeadingZero(this.isActive?e:null),t},h.prototype.createDateObject=function(t){return new a.DateObject(r.extend({intlService:this.intl,formatPlaceholder:this.formatPlaceholder,format:this.inputFormat,localeId:this.localeId,cycleTime:this.options.cycleTime,twoDigitYearMax:this.options.twoDigitYearMax,autoCorrectParts:this.options.autoCorrectParts},t=void 0===t?{}:t))},h);function h(t,e){var n=i.call(this,e)||this;return n.dateObject=null,n.currentText="",n.currentFormat="",n.interactionMode=b.DateInputInteractionMode.None,n.localeId=M.Constants.defaultLocaleId,n.init(t,e),n}e.DateInput=n},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i,n=n(11),s=(e.DateInput=n.DateInput,e);for(i in s)a(i,s[i])}],s={},i.m=n,i.c=s,i.d=function(t,e,n){i.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:n})},i.r=function(t){Object.defineProperty(t,"__esModule",{value:!0})},i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="",i(i.s=12)}}});
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@progress/kendo-dateinputs-common",
3
3
  "description": "Kendo UI common date input utilities",
4
- "version": "0.1.0",
4
+ "version": "0.2.0-dev.202301061341",
5
5
  "keywords": [
6
6
  "Kendo UI"
7
7
  ],
@@ -15,8 +15,11 @@
15
15
  "jsdelivr": "dist/cdn/main.js",
16
16
  "unpkg": "dist/cdn/main.js",
17
17
  "scripts": {
18
- "test": "jest",
19
- "test:ci": "jest",
18
+ "test": "jest --config jest.config.json",
19
+ "test:ci": "jest --config jest.config.json",
20
+ "watch-test": "jest --watch --config jest.config.json",
21
+ "e2e": "gulp e2e",
22
+ "e2e:ci": "CHROME_BIN=`which chromium-browser` NO_SANDBOX=true ENV_BROWSER=Chrome_headless npm run e2e",
20
23
  "start": "gulp start",
21
24
  "lint": "gulp lint",
22
25
  "api-check": "gulp api-check",
@@ -24,9 +27,11 @@
24
27
  "semantic-release": "semantic-release pre && semantic-prerelease publish --public && semantic-release post"
25
28
  },
26
29
  "dependencies": {
27
- "tslib": "^1.7.0"
30
+ "@progress/kendo-date-math": "^1.5.9",
31
+ "tslib": "^2.4.1"
28
32
  },
29
33
  "devDependencies": {
34
+ "@progress/kendo-intl": "^3.1.1",
30
35
  "@progress/kendo-typescript-tasks": "^10.0.0",
31
36
  "@progress/semantic-prerelease": "^3.0.0",
32
37
  "@types/jasmine": "~2.2.0",
@@ -64,9 +69,6 @@
64
69
  "maxSubjectLength": 100
65
70
  }
66
71
  },
67
- "jest": {
68
- "preset": "jest-preset-typescript"
69
- },
70
72
  "repository": {
71
73
  "type": "git",
72
74
  "url": "https://github.com/telerik/kendo-angular-component-base.git"
@@ -1 +0,0 @@
1
- !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.KendoTypescriptPackageBase=t():e.KendoTypescriptPackageBase=t()}(window,(function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=0)}([function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(1);t.MyClass=r.MyClass},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(){}return e.prototype.add=function(e,t){return e+t},e}();t.MyClass=r}])}));
@@ -1,15 +0,0 @@
1
- /**
2
- * This is the actual sample class implementation
3
- */
4
- var MyClass = /** @class */ (function () {
5
- function MyClass() {
6
- }
7
- /**
8
- * @hidden
9
- */
10
- MyClass.prototype.add = function (a, b) {
11
- return a + b;
12
- };
13
- return MyClass;
14
- }());
15
- export { MyClass };
@@ -1,11 +0,0 @@
1
- /**
2
- * This is the actual sample class implementation
3
- */
4
- export class MyClass {
5
- /**
6
- * @hidden
7
- */
8
- add(a, b) {
9
- return a + b;
10
- }
11
- }
@@ -1,9 +0,0 @@
1
- /**
2
- * This is the actual sample class implementation
3
- */
4
- export declare class MyClass {
5
- /**
6
- * @hidden
7
- */
8
- add(a: number, b: number): number;
9
- }
@@ -1,17 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- /**
4
- * This is the actual sample class implementation
5
- */
6
- var MyClass = /** @class */ (function () {
7
- function MyClass() {
8
- }
9
- /**
10
- * @hidden
11
- */
12
- MyClass.prototype.add = function (a, b) {
13
- return a + b;
14
- };
15
- return MyClass;
16
- }());
17
- exports.MyClass = MyClass;
@@ -1 +0,0 @@
1
- System.register("@progress/kendo-dateinputs-common",[],function(u){return{setters:[],execute:function(){function r(e){var t;return(o[e]||(t=o[e]={i:e,l:!1,exports:{}},n[e].call(t.exports,t,t.exports,r),t.l=!0,t)).exports}var n,o;n=[function(e,t,n){"use strict";function r(){}Object.defineProperty(t,"__esModule",{value:!0}),r.prototype.add=function(e,t){return e+t},t.MyClass=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,n=n(0),o=(t.MyClass=n.MyClass,t);for(r in o)u(r,o[r])}],o={},r.m=n,r.c=o,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:n})},r.r=function(e){Object.defineProperty(e,"__esModule",{value:!0})},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=1)}}});