@progress/kendo-dateinputs-common 0.4.2-dev.202501141100 → 0.4.2-develop.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Key = void 0;
3
4
  exports.Key = {
4
5
  DELETE: "Delete",
5
6
  BACKSPACE: "Backspace",
@@ -1,5 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.KeyCode = void 0;
3
4
  exports.KeyCode = {
4
5
  BACKSPACE: 8,
5
6
  DELETE: 46,
@@ -1,5 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Mask = void 0;
3
4
  var Mask = /** @class */ (function () {
4
5
  function Mask() {
5
6
  this.symbols = '';
@@ -1,14 +1,16 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Observable = void 0;
3
4
  var utils_1 = require("./utils");
4
5
  var defaultOptions = {
5
6
  events: {}
6
7
  };
7
8
  var Observable = /** @class */ (function () {
8
9
  function Observable(options) {
9
- this.options = utils_1.extend({}, defaultOptions, options);
10
+ this.options = (0, utils_1.extend)({}, defaultOptions, options);
10
11
  }
11
12
  Observable.prototype.destroy = function () {
13
+ this.options = {};
12
14
  };
13
15
  /**
14
16
  * @hidden
@@ -21,8 +23,8 @@ var Observable = /** @class */ (function () {
21
23
  eventData.defaultPrevented = true;
22
24
  }
23
25
  };
24
- if (utils_1.isFunction(this.options.events[eventName])) {
25
- this.options.events[eventName](utils_1.extend(eventData, args, {
26
+ if ((0, utils_1.isFunction)(this.options.events[eventName])) {
27
+ this.options.events[eventName]((0, utils_1.extend)(eventData, args, {
26
28
  sender: this
27
29
  }));
28
30
  return eventData.defaultPrevented;
@@ -33,7 +33,7 @@ export declare const deepExtend: (target: any, ...sources: any[]) => any;
33
33
  /**
34
34
  * @hidden
35
35
  */
36
- export declare const noop: () => any;
36
+ export declare const noop: () => void;
37
37
  /**
38
38
  * @hidden
39
39
  */
@@ -1,53 +1,62 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isIOS = exports.isValidDate = exports.areDatePartsEqualTo = exports.millisecondStepFor = exports.millisecondDigitsInFormat = exports.setYears = exports.cropTwoDigitYear = exports.isFunction = exports.noop = exports.deepExtend = exports.extend = exports.clamp = exports.isParseableToInt = exports.parseToInt = exports.isNumber = exports.isDocumentAvailable = exports.isPresent = void 0;
4
+ var tslib_1 = require("tslib");
3
5
  var kendo_date_math_1 = require("@progress/kendo-date-math");
4
6
  var isObject = function (value) { return value && typeof (value) === "object" && !Array.isArray(value); };
5
7
  var isHtmlElement = function (element) { return element instanceof HTMLElement; };
6
8
  var dateSetter = function (method) { return function (date, value) {
7
- var clone = kendo_date_math_1.cloneDate(date);
9
+ var clone = (0, kendo_date_math_1.cloneDate)(date);
8
10
  clone[method](value);
9
11
  return clone;
10
12
  }; };
11
13
  /**
12
14
  * @hidden
13
15
  */
14
- exports.isPresent = function (value) { return value !== undefined && value !== null; };
16
+ var isPresent = function (value) { return value !== undefined && value !== null; };
17
+ exports.isPresent = isPresent;
15
18
  /**
16
19
  * @hidden
17
20
  */
18
- exports.isDocumentAvailable = function () { return !!document; };
21
+ var isDocumentAvailable = function () { return !!document; };
22
+ exports.isDocumentAvailable = isDocumentAvailable;
19
23
  /**
20
24
  * @hidden
21
25
  */
22
- exports.isNumber = function (value) { return exports.isPresent(value) && typeof (value) === "number" && !Number.isNaN(value); };
26
+ var isNumber = function (value) { return (0, exports.isPresent)(value) && typeof (value) === "number" && !Number.isNaN(value); };
27
+ exports.isNumber = isNumber;
23
28
  /**
24
29
  * @hidden
25
30
  */
26
- exports.parseToInt = function (value) { return parseInt(value, 10); };
31
+ var parseToInt = function (value) { return parseInt(value, 10); };
32
+ exports.parseToInt = parseToInt;
27
33
  /**
28
34
  * @hidden
29
35
  */
30
- exports.isParseableToInt = function (value) { return exports.isNumber(exports.parseToInt(value)) && /^[0-9]+$/.test(value); };
36
+ var isParseableToInt = function (value) { return (0, exports.isNumber)((0, exports.parseToInt)(value)) && /^[0-9]+$/.test(value); };
37
+ exports.isParseableToInt = isParseableToInt;
31
38
  /**
32
39
  * @hidden
33
40
  */
34
- exports.clamp = function (value, min, max) { return Math.min(max, Math.max(min, value)); };
41
+ var clamp = function (value, min, max) { return Math.min(max, Math.max(min, value)); };
42
+ exports.clamp = clamp;
35
43
  /**
36
44
  * @hidden
37
45
  */
38
46
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
39
47
  // @ts-ignore
40
- exports.extend = function () {
48
+ var extend = function () {
41
49
  var args = [];
42
50
  for (var _i = 0; _i < arguments.length; _i++) {
43
51
  args[_i] = arguments[_i];
44
52
  }
45
53
  return Object.assign.apply(Object, args);
46
54
  };
55
+ exports.extend = extend;
47
56
  /**
48
57
  * @hidden
49
58
  */
50
- exports.deepExtend = function (target) {
59
+ var deepExtend = function (target) {
51
60
  var _a, _b;
52
61
  var sources = [];
53
62
  for (var _i = 1; _i < arguments.length; _i++) {
@@ -59,7 +68,7 @@ exports.deepExtend = function (target) {
59
68
  var source = sources.shift();
60
69
  if (isObject(target) && isObject(source)) {
61
70
  for (var key in source) {
62
- if (!source.hasOwnProperty(key) ||
71
+ if (!Object.prototype.hasOwnProperty.call(source, key) ||
63
72
  key === "__proto__" ||
64
73
  key === "constructor" ||
65
74
  key === "prototype") {
@@ -70,30 +79,34 @@ exports.deepExtend = function (target) {
70
79
  }
71
80
  else if (isObject(source[key]) && !(source[key] instanceof Date)) {
72
81
  if (!target[key] || !isObject(target[key])) {
73
- exports.extend(target, (_a = {}, _a[key] = {}, _a));
82
+ (0, exports.extend)(target, (_a = {}, _a[key] = {}, _a));
74
83
  }
75
- exports.deepExtend(target[key], source[key]);
84
+ (0, exports.deepExtend)(target[key], source[key]);
76
85
  }
77
86
  else {
78
- exports.extend(target, (_b = {}, _b[key] = source[key], _b));
87
+ (0, exports.extend)(target, (_b = {}, _b[key] = source[key], _b));
79
88
  }
80
89
  }
81
90
  }
82
- return exports.deepExtend.apply(void 0, [target].concat(sources));
91
+ return exports.deepExtend.apply(void 0, tslib_1.__spreadArray([target], sources, false));
83
92
  };
93
+ exports.deepExtend = deepExtend;
84
94
  /**
85
95
  * @hidden
86
96
  */
87
- exports.noop = function () { };
97
+ // eslint-disable-next-line
98
+ var noop = function () { };
99
+ exports.noop = noop;
88
100
  /**
89
101
  * @hidden
90
102
  */
91
- exports.isFunction = function (fn) { return typeof (fn) === "function"; };
103
+ var isFunction = function (fn) { return typeof (fn) === "function"; };
104
+ exports.isFunction = isFunction;
92
105
  /**
93
106
  * @hidden
94
107
  */
95
- exports.cropTwoDigitYear = function (date) {
96
- if (!exports.isPresent(date) || isNaN(date.getTime())) {
108
+ var cropTwoDigitYear = function (date) {
109
+ if (!(0, exports.isPresent)(date) || isNaN(date.getTime())) {
97
110
  return 0;
98
111
  }
99
112
  return Number(date
@@ -101,6 +114,7 @@ exports.cropTwoDigitYear = function (date) {
101
114
  .toString()
102
115
  .slice(-2));
103
116
  };
117
+ exports.cropTwoDigitYear = cropTwoDigitYear;
104
118
  /**
105
119
  * @hidden
106
120
  */
@@ -108,20 +122,22 @@ exports.setYears = dateSetter('setFullYear');
108
122
  /**
109
123
  * @hidden
110
124
  */
111
- exports.millisecondDigitsInFormat = function (format) {
125
+ var millisecondDigitsInFormat = function (format) {
112
126
  var result = format && format.match(/S+(\1)/);
113
127
  return result ? result[0].length : 0;
114
128
  };
129
+ exports.millisecondDigitsInFormat = millisecondDigitsInFormat;
115
130
  /**
116
131
  * @hidden
117
132
  */
118
- exports.millisecondStepFor = function (digits) {
133
+ var millisecondStepFor = function (digits) {
119
134
  return Math.pow(10, 3 - digits);
120
135
  };
136
+ exports.millisecondStepFor = millisecondStepFor;
121
137
  /**
122
138
  * @hidden
123
139
  */
124
- exports.areDatePartsEqualTo = function (date, year, month, day, hour, minutes, seconds, milliseconds) {
140
+ var areDatePartsEqualTo = function (date, year, month, day, hour, minutes, seconds, milliseconds) {
125
141
  if (date &&
126
142
  date.getFullYear() === year &&
127
143
  date.getMonth() === month &&
@@ -134,13 +150,16 @@ exports.areDatePartsEqualTo = function (date, year, month, day, hour, minutes, s
134
150
  }
135
151
  return false;
136
152
  };
153
+ exports.areDatePartsEqualTo = areDatePartsEqualTo;
137
154
  /**
138
155
  * @hidden
139
156
  */
140
- exports.isValidDate = function (value) { return exports.isPresent(value) && value.getTime && exports.isNumber(value.getTime()); };
157
+ var isValidDate = function (value) { return (0, exports.isPresent)(value) && value.getTime && (0, exports.isNumber)(value.getTime()); };
158
+ exports.isValidDate = isValidDate;
141
159
  /**
142
160
  * @hidden
143
161
  */
144
- exports.isIOS = function () { return /iPad|iPhone|iPod/.test(navigator.userAgent) || (navigator.maxTouchPoints &&
162
+ var isIOS = function () { return /iPad|iPhone|iPod/.test(navigator.userAgent) || (navigator.maxTouchPoints &&
145
163
  navigator.maxTouchPoints > 2 &&
146
164
  /Macintosh/i.test(navigator.userAgent)); };
165
+ exports.isIOS = isIOS;
@@ -2,10 +2,10 @@ import { DateObject } from '../common/dateobject';
2
2
  import { Observable } from '../common/observable';
3
3
  export declare class DateInput extends Observable {
4
4
  dateObject: DateObject | null;
5
- readonly value: Date | null;
5
+ get value(): Date | null;
6
6
  private currentText;
7
7
  private currentFormat;
8
- private element;
8
+ element: HTMLInputElement;
9
9
  private resetSegmentValue;
10
10
  private isActive;
11
11
  private interactionMode;
@@ -85,10 +85,10 @@ export declare class DateInput extends Observable {
85
85
  */
86
86
  onElementMouseWheel(e: any): void;
87
87
  updateOnPaste(e: any): void;
88
- readonly elementValue: string;
89
- readonly inputFormat: string;
90
- private readonly displayFormat;
91
- readonly selection: {
88
+ get elementValue(): string;
89
+ get inputFormat(): string;
90
+ private get displayFormat();
91
+ get selection(): {
92
92
  start: number;
93
93
  end: number;
94
94
  };
@@ -226,7 +226,7 @@ export declare class DateInput extends Observable {
226
226
  /**
227
227
  * @hidden
228
228
  */
229
- getDateObjectOptions(): object;
229
+ getDateObjectOptions(): Record<string, unknown>;
230
230
  /**
231
231
  * @hidden
232
232
  */
@@ -1,7 +1,8 @@
1
1
  "use strict";
2
+ var _a;
2
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.DateInput = void 0;
3
5
  var tslib_1 = require("tslib");
4
- var _a;
5
6
  var dateobject_1 = require("../common/dateobject");
6
7
  var utils_1 = require("./utils");
7
8
  var keycode_1 = require("../common/keycode");
@@ -87,17 +88,17 @@ var DateInput = /** @class */ (function (_super) {
87
88
  get: function () {
88
89
  return this.dateObject && this.dateObject.getValue();
89
90
  },
90
- enumerable: true,
91
+ enumerable: false,
91
92
  configurable: true
92
93
  });
93
94
  DateInput.prototype.init = function (element, options) {
94
- var dateValue = utils_2.isValidDate(this.options.value) ? kendo_date_math_1.cloneDate(this.options.value) : new Date(options.formattedValue);
95
- if (!utils_2.isValidDate(dateValue)) {
95
+ var dateValue = (0, utils_2.isValidDate)(this.options.value) ? (0, kendo_date_math_1.cloneDate)(this.options.value) : new Date(options.formattedValue);
96
+ if (!(0, utils_2.isValidDate)(dateValue)) {
96
97
  dateValue = null;
97
98
  }
98
99
  this.element = element;
99
100
  // this.element._kendoWidget = this;
100
- this.options = utils_2.extend({}, defaultDateInputOptions, options, { steps: tslib_1.__assign({}, defaultDateInputOptions.steps, options.steps) });
101
+ this.options = (0, utils_2.extend)({}, defaultDateInputOptions, options, { steps: tslib_1.__assign(tslib_1.__assign({}, defaultDateInputOptions.steps), options.steps) });
101
102
  this.intl = this.options.intlService;
102
103
  this.dateObject = this.createDateObject();
103
104
  this.dateObject.setValue(dateValue);
@@ -158,7 +159,7 @@ var DateInput = /** @class */ (function (_super) {
158
159
  };
159
160
  DateInput.prototype.setOptions = function (options, refresh) {
160
161
  if (refresh === void 0) { refresh = false; }
161
- this.options = utils_2.extend({}, this.options, options, { steps: tslib_1.__assign({}, defaultDateInputOptions.steps, options.steps) });
162
+ this.options = (0, utils_2.extend)({}, this.options, options, { steps: tslib_1.__assign(tslib_1.__assign({}, defaultDateInputOptions.steps), options.steps) });
162
163
  this.setDateObjectOptions();
163
164
  if (refresh) {
164
165
  this.unbindEvents();
@@ -239,7 +240,7 @@ var DateInput = /** @class */ (function (_super) {
239
240
  else {
240
241
  if (this.isActive && this.options.selectNearestSegmentOnFocus) {
241
242
  var selectionPresent = this.element.selectionStart !== this.element.selectionEnd;
242
- var placeholderToggled = utils_2.isPresent(this.options.placeholder) &&
243
+ var placeholderToggled = (0, utils_2.isPresent)(this.options.placeholder) &&
243
244
  !this.dateObject.hasValue() &&
244
245
  !this.focusedPriorToMouseDown;
245
246
  // focus first segment if the user hasn't selected something during mousedown and if the placeholder was just toggled
@@ -313,7 +314,7 @@ var DateInput = /** @class */ (function (_super) {
313
314
  oldText = currentText;
314
315
  }
315
316
  var newText = this.elementValue;
316
- var diff = utils_1.approximateStringMatching({
317
+ var diff = (0, utils_1.approximateStringMatching)({
317
318
  oldText: oldText,
318
319
  newText: newText,
319
320
  formatPattern: this.currentFormat,
@@ -367,13 +368,13 @@ var DateInput = /** @class */ (function (_super) {
367
368
  this.resetSegmentValue = false;
368
369
  var hasFixedFormat = this.options.format === this.currentFormat ||
369
370
  // all not fixed formats are 1 symbol, e.g. "d"
370
- (utils_2.isPresent(this.options.format) && this.options.format.length > 1);
371
+ ((0, utils_2.isPresent)(this.options.format) && this.options.format.length > 1);
371
372
  var lastParseResult = parsePartsResults[parsePartsResults.length - 1];
372
- var lastParseResultHasNoValue = lastParseResult && !utils_2.isPresent(lastParseResult.value);
373
+ var lastParseResultHasNoValue = lastParseResult && !(0, utils_2.isPresent)(lastParseResult.value);
373
374
  var parsingFailedOnDelete = (hasCaret && (isBackspaceKey || isDeleteKey) && lastParseResultHasNoValue);
374
375
  var resetPart = lastParseResult ? lastParseResult.resetPart : false;
375
376
  var newExistingDateValue = this.dateObject.getValue();
376
- var hasExistingDateValueChanged = !kendo_date_math_1.isEqual(oldExistingDateValue, newExistingDateValue);
377
+ var hasExistingDateValueChanged = !(0, kendo_date_math_1.isEqual)(oldExistingDateValue, newExistingDateValue);
377
378
  var newDateValue = this.dateObject.value;
378
379
  var symbolForSelection;
379
380
  var currentSelection = this.selection;
@@ -406,13 +407,13 @@ var DateInput = /** @class */ (function (_super) {
406
407
  // do not reset element value on a leading zero
407
408
  // wait for consecutive input to determine the value
408
409
  }
409
- else if (utils_2.isPresent(oldExistingDateValue) && !utils_2.isPresent(newExistingDateValue)) {
410
+ else if ((0, utils_2.isPresent)(oldExistingDateValue) && !(0, utils_2.isPresent)(newExistingDateValue)) {
410
411
  this.restorePreviousInputEventState();
411
412
  }
412
- else if (!utils_2.isPresent(oldExistingDateValue) && utils_2.isPresent(newExistingDateValue)) {
413
+ else if (!(0, utils_2.isPresent)(oldExistingDateValue) && (0, utils_2.isPresent)(newExistingDateValue)) {
413
414
  this.forceUpdateWithSelection();
414
415
  }
415
- else if (utils_2.isPresent(oldExistingDateValue) && utils_2.isPresent(newExistingDateValue)) {
416
+ else if ((0, utils_2.isPresent)(oldExistingDateValue) && (0, utils_2.isPresent)(newExistingDateValue)) {
416
417
  if (hasExistingDateValueChanged) {
417
418
  this.forceUpdateWithSelection();
418
419
  }
@@ -420,7 +421,7 @@ var DateInput = /** @class */ (function (_super) {
420
421
  this.restorePreviousInputEventState();
421
422
  }
422
423
  }
423
- else if (!utils_2.isPresent(oldExistingDateValue) && !utils_2.isPresent(newExistingDateValue)) {
424
+ else if (!(0, utils_2.isPresent)(oldExistingDateValue) && !(0, utils_2.isPresent)(newExistingDateValue)) {
424
425
  this.forceUpdateWithSelection();
425
426
  }
426
427
  else if (oldDateValue !== newDateValue) {
@@ -663,7 +664,7 @@ var DateInput = /** @class */ (function (_super) {
663
664
  };
664
665
  DateInput.prototype.updateOnPaste = function (e) {
665
666
  var value = this.intl.parseDate(this.elementValue, this.inputFormat) || this.value;
666
- if (utils_2.isPresent(value) && this.dateObject.shouldNormalizeCentury()) {
667
+ if ((0, utils_2.isPresent)(value) && this.dateObject.shouldNormalizeCentury()) {
667
668
  value = this.dateObject.normalizeCentury(value);
668
669
  }
669
670
  var oldDateObjectValue = this.dateObject && this.dateObject.getValue();
@@ -677,7 +678,7 @@ var DateInput = /** @class */ (function (_super) {
677
678
  get: function () {
678
679
  return (this.element || {}).value || '';
679
680
  },
680
- enumerable: true,
681
+ enumerable: false,
681
682
  configurable: true
682
683
  });
683
684
  Object.defineProperty(DateInput.prototype, "inputFormat", {
@@ -692,7 +693,7 @@ var DateInput = /** @class */ (function (_super) {
692
693
  return this.options.format.inputFormat;
693
694
  }
694
695
  },
695
- enumerable: true,
696
+ enumerable: false,
696
697
  configurable: true
697
698
  });
698
699
  Object.defineProperty(DateInput.prototype, "displayFormat", {
@@ -707,7 +708,7 @@ var DateInput = /** @class */ (function (_super) {
707
708
  return this.options.format.displayFormat;
708
709
  }
709
710
  },
710
- enumerable: true,
711
+ enumerable: false,
711
712
  configurable: true
712
713
  });
713
714
  Object.defineProperty(DateInput.prototype, "selection", {
@@ -721,13 +722,13 @@ var DateInput = /** @class */ (function (_super) {
721
722
  }
722
723
  return returnValue;
723
724
  },
724
- enumerable: true,
725
+ enumerable: false,
725
726
  configurable: true
726
727
  });
727
728
  DateInput.prototype.setSelection = function (selection) {
728
729
  if (this.element && document.activeElement === this.element) {
729
730
  this.element.setSelectionRange(selection.start, selection.end);
730
- if (utils_2.isDocumentAvailable() && utils_2.isIOS()) {
731
+ if ((0, utils_2.isDocumentAvailable)() && (0, utils_2.isIOS)()) {
731
732
  this.element.scrollIntoView({ block: 'nearest', inline: 'nearest' });
732
733
  }
733
734
  if (selection.start !== selection.end) {
@@ -865,8 +866,8 @@ var DateInput = /** @class */ (function (_super) {
865
866
  var caret = this.caret();
866
867
  symbol = symbol || this.currentFormat[caret[0]];
867
868
  if (symbol === "S" && (!this.options.steps.millisecond || this.options.steps.millisecond === DEFAULT_SEGMENT_STEP)) {
868
- var msDigits = utils_2.millisecondDigitsInFormat(this.inputFormat);
869
- step = utils_2.millisecondStepFor(msDigits);
869
+ var msDigits = (0, utils_2.millisecondDigitsInFormat)(this.inputFormat);
870
+ step = (0, utils_2.millisecondStepFor)(msDigits);
870
871
  }
871
872
  this.dateObject.modifyPart(symbol, step * offset);
872
873
  this.tryTriggerValueChange({
@@ -881,7 +882,7 @@ var DateInput = /** @class */ (function (_super) {
881
882
  */
882
883
  DateInput.prototype.tryTriggerValueChange = function (args) {
883
884
  if (args === void 0) { args = { oldValue: null, event: {} }; }
884
- if (!kendo_date_math_1.isEqual(this.value, args.oldValue)) {
885
+ if (!(0, kendo_date_math_1.isEqual)(this.value, args.oldValue)) {
885
886
  return this.triggerValueChange(args);
886
887
  }
887
888
  };
@@ -890,7 +891,7 @@ var DateInput = /** @class */ (function (_super) {
890
891
  */
891
892
  DateInput.prototype.triggerValueChange = function (args) {
892
893
  if (args === void 0) { args = { oldValue: null, event: {} }; }
893
- return this.trigger(VALUE_CHANGE, utils_2.extend(args, {
894
+ return this.trigger(VALUE_CHANGE, (0, utils_2.extend)(args, {
894
895
  value: this.value
895
896
  }));
896
897
  };
@@ -899,7 +900,7 @@ var DateInput = /** @class */ (function (_super) {
899
900
  */
900
901
  DateInput.prototype.triggerInput = function (args) {
901
902
  if (args === void 0) { args = { event: {} }; }
902
- return this.trigger(INPUT, utils_2.extend(args, {
903
+ return this.trigger(INPUT, (0, utils_2.extend)(args, {
903
904
  value: this.value
904
905
  }));
905
906
  };
@@ -908,7 +909,7 @@ var DateInput = /** @class */ (function (_super) {
908
909
  */
909
910
  DateInput.prototype.triggerInputEnd = function (args) {
910
911
  if (args === void 0) { args = { event: {}, error: null, oldElementValue: '', newElementValue: '' }; }
911
- return this.trigger(INPUT_END, utils_2.extend(args, {
912
+ return this.trigger(INPUT_END, (0, utils_2.extend)(args, {
912
913
  value: this.value
913
914
  }));
914
915
  };
@@ -917,35 +918,35 @@ var DateInput = /** @class */ (function (_super) {
917
918
  */
918
919
  DateInput.prototype.triggerFocus = function (args) {
919
920
  if (args === void 0) { args = { event: {} }; }
920
- return this.trigger(FOCUS, utils_2.extend({}, args));
921
+ return this.trigger(FOCUS, (0, utils_2.extend)({}, args));
921
922
  };
922
923
  /**
923
924
  * @hidden
924
925
  */
925
926
  DateInput.prototype.triggerFocusEnd = function (args) {
926
927
  if (args === void 0) { args = { event: {} }; }
927
- return this.trigger(FOCUS_END, utils_2.extend({}, args));
928
+ return this.trigger(FOCUS_END, (0, utils_2.extend)({}, args));
928
929
  };
929
930
  /**
930
931
  * @hidden
931
932
  */
932
933
  DateInput.prototype.triggerBlur = function (args) {
933
934
  if (args === void 0) { args = { event: {} }; }
934
- return this.trigger(BLUR, utils_2.extend({}, args));
935
+ return this.trigger(BLUR, (0, utils_2.extend)({}, args));
935
936
  };
936
937
  /**
937
938
  * @hidden
938
939
  */
939
940
  DateInput.prototype.triggerBlurEnd = function (args) {
940
941
  if (args === void 0) { args = { event: {} }; }
941
- return this.trigger(BLUR_END, utils_2.extend({}, args));
942
+ return this.trigger(BLUR_END, (0, utils_2.extend)({}, args));
942
943
  };
943
944
  /**
944
945
  * @hidden
945
946
  */
946
947
  DateInput.prototype.triggerChange = function (args) {
947
948
  if (args === void 0) { args = { event: {} }; }
948
- return this.trigger(CHANGE, utils_2.extend(args, {
949
+ return this.trigger(CHANGE, (0, utils_2.extend)(args, {
949
950
  value: this.value
950
951
  }));
951
952
  };
@@ -954,14 +955,14 @@ var DateInput = /** @class */ (function (_super) {
954
955
  */
955
956
  DateInput.prototype.triggerKeyDown = function (args) {
956
957
  if (args === void 0) { args = { event: {} }; }
957
- return this.trigger(KEY_DOWN, utils_2.extend({}, args));
958
+ return this.trigger(KEY_DOWN, (0, utils_2.extend)({}, args));
958
959
  };
959
960
  /**
960
961
  * @hidden
961
962
  */
962
963
  DateInput.prototype.triggerMouseWheel = function (args) {
963
964
  if (args === void 0) { args = { event: {} }; }
964
- return this.trigger(MOUSE_WHEEL, utils_2.extend({}, args));
965
+ return this.trigger(MOUSE_WHEEL, (0, utils_2.extend)({}, args));
965
966
  };
966
967
  /**
967
968
  * @hidden
@@ -1056,7 +1057,7 @@ var DateInput = /** @class */ (function (_super) {
1056
1057
  this.refreshElementValue();
1057
1058
  };
1058
1059
  DateInput.prototype.verifyValue = function (value) {
1059
- if (value && !utils_2.isValidDate(value)) {
1060
+ if (value && !(0, utils_2.isValidDate)(value)) {
1060
1061
  throw new Error("The 'value' should be a valid JavaScript Date instance.");
1061
1062
  }
1062
1063
  };
@@ -1066,11 +1067,11 @@ var DateInput = /** @class */ (function (_super) {
1066
1067
  var _a = this.dateObject.getTextAndFormat(format), currentText = _a.text, currentFormat = _a.format;
1067
1068
  this.currentFormat = currentFormat;
1068
1069
  this.currentText = currentText;
1069
- var hasPlaceholder = this.options.hasPlaceholder || utils_2.isPresent(this.options.placeholder);
1070
+ var hasPlaceholder = this.options.hasPlaceholder || (0, utils_2.isPresent)(this.options.placeholder);
1070
1071
  var showPlaceholder = !this.isActive &&
1071
1072
  hasPlaceholder &&
1072
1073
  !this.dateObject.hasValue();
1073
- if (hasPlaceholder && utils_2.isPresent(this.options.placeholder)) {
1074
+ if (hasPlaceholder && (0, utils_2.isPresent)(this.options.placeholder)) {
1074
1075
  element.placeholder = this.options.placeholder;
1075
1076
  }
1076
1077
  var newElementValue = showPlaceholder ? "" : currentText;
@@ -1091,7 +1092,7 @@ var DateInput = /** @class */ (function (_super) {
1091
1092
  try {
1092
1093
  if (element.selectionStart !== undefined) {
1093
1094
  if (isPosition) {
1094
- if (utils_2.isDocumentAvailable() && document.activeElement !== element) {
1095
+ if ((0, utils_2.isDocumentAvailable)() && document.activeElement !== element) {
1095
1096
  element.focus();
1096
1097
  }
1097
1098
  element.setSelectionRange(start, end);
@@ -1150,7 +1151,7 @@ var DateInput = /** @class */ (function (_super) {
1150
1151
  */
1151
1152
  DateInput.prototype.createDateObject = function () {
1152
1153
  var defaultOptions = this.getDateObjectOptions();
1153
- var dateObject = new dateobject_1.DateObject(utils_2.extend({}, defaultOptions));
1154
+ var dateObject = new dateobject_1.DateObject((0, utils_2.extend)({}, defaultOptions));
1154
1155
  return dateObject;
1155
1156
  };
1156
1157
  /**
@@ -1187,7 +1188,9 @@ var DateInput = /** @class */ (function (_super) {
1187
1188
  * @hidden
1188
1189
  */
1189
1190
  DateInput.prototype.autoFill = function () {
1190
- var dateObject = this.dateObject, currentDate = new Date(), day, month, year, hours, minutes, seconds;
1191
+ var dateObject = this.dateObject;
1192
+ var currentDate = new Date();
1193
+ var day, month, year, hours, minutes, seconds;
1191
1194
  if (dateObject.date || dateObject.month || dateObject.year || dateObject.hours || dateObject.minutes || dateObject.seconds) {
1192
1195
  year = dateObject.year ? dateObject.value.getFullYear() : currentDate.getFullYear(),
1193
1196
  month = dateObject.month ? dateObject.value.getMonth() : currentDate.getMonth(),
@@ -1,8 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DateInputInteractionMode = void 0;
3
4
  var DateInputInteractionMode;
4
5
  (function (DateInputInteractionMode) {
5
6
  DateInputInteractionMode["None"] = "none";
6
7
  DateInputInteractionMode["Caret"] = "caret";
7
8
  DateInputInteractionMode["Selection"] = "selection";
8
- })(DateInputInteractionMode = exports.DateInputInteractionMode || (exports.DateInputInteractionMode = {}));
9
+ })(DateInputInteractionMode || (exports.DateInputInteractionMode = DateInputInteractionMode = {}));
@@ -1,19 +1,22 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isInRange = exports.dateSymbolMap = exports.approximateStringMatching = exports.unpadZero = exports.padZero = void 0;
3
4
  var constants_1 = require("../common/constants");
4
5
  var key_1 = require("../common/key");
5
6
  /**
6
7
  * @hidden
7
8
  */
8
- exports.padZero = function (length) { return new Array(Math.max(length, 0)).fill('0').join(''); };
9
+ var padZero = function (length) { return new Array(Math.max(length, 0)).fill('0').join(''); };
10
+ exports.padZero = padZero;
9
11
  /**
10
12
  * @hidden
11
13
  */
12
- exports.unpadZero = function (value) { return value.replace(/^0*/, ''); };
14
+ var unpadZero = function (value) { return value.replace(/^0*/, ''); };
15
+ exports.unpadZero = unpadZero;
13
16
  /**
14
17
  * @hidden
15
18
  */
16
- exports.approximateStringMatching = function (_a) {
19
+ var approximateStringMatching = function (_a) {
17
20
  var oldText = _a.oldText, newText = _a.newText, formatPattern = _a.formatPattern, selectionStart = _a.selectionStart, isInCaretMode = _a.isInCaretMode, keyEvent = _a.keyEvent;
18
21
  /*
19
22
  Remove the right part of the cursor.
@@ -79,14 +82,17 @@ exports.approximateStringMatching = function (_a) {
79
82
  var result = [[formatPattern[selectionStart - 1], newSegmentText[selectionStart - 1]]];
80
83
  return result;
81
84
  };
85
+ exports.approximateStringMatching = approximateStringMatching;
82
86
  /**
83
87
  * @hidden
84
88
  */
85
- exports.dateSymbolMap = function (map, part) {
89
+ var dateSymbolMap = function (map, part) {
86
90
  map[part.pattern[0]] = part.type;
87
91
  return map;
88
92
  };
93
+ exports.dateSymbolMap = dateSymbolMap;
89
94
  /**
90
95
  * @hidden
91
96
  */
92
- exports.isInRange = function (candidate, min, max) { return (candidate === null || !((min && min > candidate) || (max && max < candidate))); };
97
+ var isInRange = function (candidate, min, max) { return (candidate === null || !((min && min > candidate) || (max && max < candidate))); };
98
+ exports.isInRange = isInRange;
package/dist/npm/main.js CHANGED
@@ -1,4 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DateInput = void 0;
3
4
  var dateinput_1 = require("./dateinput/dateinput");
4
- exports.DateInput = dateinput_1.DateInput;
5
+ Object.defineProperty(exports, "DateInput", { enumerable: true, get: function () { return dateinput_1.DateInput; } });