@taiga-ui/kit 3.25.0-dev.main-e209b11 → 3.25.0-dev.main-7547cea

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 (22) hide show
  1. package/bundles/taiga-ui-kit-components-input-date-time.umd.js +140 -51
  2. package/bundles/taiga-ui-kit-components-input-date-time.umd.js.map +1 -1
  3. package/bundles/taiga-ui-kit-components-input-date.umd.js +62 -65
  4. package/bundles/taiga-ui-kit-components-input-date.umd.js.map +1 -1
  5. package/components/input-date/input-date.module.d.ts +1 -1
  6. package/components/input-date/native-date/native-date.component.d.ts +3 -3
  7. package/components/input-date-time/input-date-time.component.d.ts +6 -2
  8. package/components/input-date-time/input-date-time.directive.d.ts +3 -0
  9. package/components/input-date-time/input-date-time.module.d.ts +7 -6
  10. package/components/input-date-time/native-date-time/native-date-time.directive.d.ts +10 -0
  11. package/esm2015/components/input-date/input-date.component.js +8 -8
  12. package/esm2015/components/input-date/input-date.module.js +4 -4
  13. package/esm2015/components/input-date/native-date/native-date.component.js +7 -10
  14. package/esm2015/components/input-date-time/input-date-time.component.js +30 -14
  15. package/esm2015/components/input-date-time/input-date-time.directive.js +7 -1
  16. package/esm2015/components/input-date-time/input-date-time.module.js +10 -3
  17. package/esm2015/components/input-date-time/native-date-time/native-date-time.directive.js +47 -0
  18. package/fesm2015/taiga-ui-kit-components-input-date-time.js +87 -17
  19. package/fesm2015/taiga-ui-kit-components-input-date-time.js.map +1 -1
  20. package/fesm2015/taiga-ui-kit-components-input-date.js +14 -17
  21. package/fesm2015/taiga-ui-kit-components-input-date.js.map +1 -1
  22. package/package.json +1 -1
@@ -1,8 +1,8 @@
1
1
  (function (global, factory) {
2
2
  typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/forms'), require('@taiga-ui/cdk'), require('@taiga-ui/core'), require('@taiga-ui/kit/constants'), require('@taiga-ui/kit/tokens'), require('@taiga-ui/kit/utils/mask'), require('rxjs'), require('rxjs/operators'), require('@taiga-ui/kit/directives'), require('@tinkoff/ng-polymorpheus'), require('@angular/common')) :
3
3
  typeof define === 'function' && define.amd ? define('@taiga-ui/kit/components/input-date-time', ['exports', '@angular/core', '@angular/forms', '@taiga-ui/cdk', '@taiga-ui/core', '@taiga-ui/kit/constants', '@taiga-ui/kit/tokens', '@taiga-ui/kit/utils/mask', 'rxjs', 'rxjs/operators', '@taiga-ui/kit/directives', '@tinkoff/ng-polymorpheus', '@angular/common'], factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global["taiga-ui"] = global["taiga-ui"] || {}, global["taiga-ui"].kit = global["taiga-ui"].kit || {}, global["taiga-ui"].kit.components = global["taiga-ui"].kit.components || {}, global["taiga-ui"].kit.components["input-date-time"] = {}), global.ng.core, global.ng.forms, global.i4, global.i1, global["taiga-ui"].kit.constants, global["taiga-ui"].kit.tokens, global["taiga-ui"].kit.utils.mask, global.rxjs, global.rxjs.operators, global["taiga-ui"].kit.directives, global.i3, global.ng.common));
5
- })(this, (function (exports, i0, i6, i4, i1, constants, tokens, mask, i7, operators, i2, i3, i5) { 'use strict';
4
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global["taiga-ui"] = global["taiga-ui"] || {}, global["taiga-ui"].kit = global["taiga-ui"].kit || {}, global["taiga-ui"].kit.components = global["taiga-ui"].kit.components || {}, global["taiga-ui"].kit.components["input-date-time"] = {}), global.ng.core, global.ng.forms, global.i6, global.i1, global["taiga-ui"].kit.constants, global["taiga-ui"].kit.tokens, global["taiga-ui"].kit.utils.mask, global.rxjs, global.rxjs.operators, global["taiga-ui"].kit.directives, global.i3, global.ng.common));
5
+ })(this, (function (exports, i0, i7, i6, i1, constants, tokens, mask, i8, operators, i2, i3, i4) { 'use strict';
6
6
 
7
7
  function _interopNamespace(e) {
8
8
  if (e && e.__esModule) return e;
@@ -23,13 +23,13 @@
23
23
  }
24
24
 
25
25
  var i0__namespace = /*#__PURE__*/_interopNamespace(i0);
26
+ var i7__namespace = /*#__PURE__*/_interopNamespace(i7);
26
27
  var i6__namespace = /*#__PURE__*/_interopNamespace(i6);
27
- var i4__namespace = /*#__PURE__*/_interopNamespace(i4);
28
28
  var i1__namespace = /*#__PURE__*/_interopNamespace(i1);
29
- var i7__namespace = /*#__PURE__*/_interopNamespace(i7);
29
+ var i8__namespace = /*#__PURE__*/_interopNamespace(i8);
30
30
  var i2__namespace = /*#__PURE__*/_interopNamespace(i2);
31
31
  var i3__namespace = /*#__PURE__*/_interopNamespace(i3);
32
- var i5__namespace = /*#__PURE__*/_interopNamespace(i5);
32
+ var i4__namespace = /*#__PURE__*/_interopNamespace(i4);
33
33
 
34
34
  /*! *****************************************************************************
35
35
  Copyright (c) Microsoft Corporation.
@@ -349,9 +349,59 @@
349
349
  return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
350
350
  }
351
351
 
352
+ var TuiNativeDateTimeDirective = /** @class */ (function () {
353
+ function TuiNativeDateTimeDirective(host) {
354
+ this.host = host;
355
+ }
356
+ Object.defineProperty(TuiNativeDateTimeDirective.prototype, "value", {
357
+ get: function () {
358
+ var _a, _b;
359
+ if (!this.host.rawValue[0] || !this.host.rawValue[1]) {
360
+ return '';
361
+ }
362
+ return ((_a = this.host.rawValue[0]) === null || _a === void 0 ? void 0 : _a.toString('YMD', '-')) + "T" + ((_b = this.host.rawValue[1]) === null || _b === void 0 ? void 0 : _b.toString('HH:MM'));
363
+ },
364
+ enumerable: false,
365
+ configurable: true
366
+ });
367
+ TuiNativeDateTimeDirective.prototype.onChange = function (value) {
368
+ if (!value) {
369
+ this.host.writeValue([null, null]);
370
+ return;
371
+ }
372
+ var date = new Date(value);
373
+ var day = i6.TuiDay.fromLocalNativeDate(date);
374
+ var time = i6.TuiTime.fromLocalNativeDate(date);
375
+ this.host.writeValue([day, time]);
376
+ };
377
+ return TuiNativeDateTimeDirective;
378
+ }());
379
+ TuiNativeDateTimeDirective.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: TuiNativeDateTimeDirective, deps: [{ token: i1.TUI_TEXTFIELD_HOST }], target: i0__namespace.ɵɵFactoryTarget.Directive });
380
+ TuiNativeDateTimeDirective.ɵdir = i0__namespace.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.17", type: TuiNativeDateTimeDirective, selector: "input[tuiDateTime]", host: { attributes: { "type": "datetime-local" }, listeners: { "change.stop": "onChange($event.target.value)", "input.stop": "onChange($event.target.value)", "click.stop.silent": "0", "mousedown.stop.silent": "0" }, properties: { "tabIndex": "-1", "value": "value" } }, ngImport: i0__namespace });
381
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: TuiNativeDateTimeDirective, decorators: [{
382
+ type: i0.Directive,
383
+ args: [{
384
+ selector: 'input[tuiDateTime]',
385
+ host: {
386
+ type: 'datetime-local',
387
+ '[tabIndex]': '-1',
388
+ '[value]': 'value',
389
+ '(change.stop)': 'onChange($event.target.value)',
390
+ '(input.stop)': 'onChange($event.target.value)',
391
+ '(click.stop.silent)': '0',
392
+ '(mousedown.stop.silent)': '0',
393
+ },
394
+ }]
395
+ }], ctorParameters: function () {
396
+ return [{ type: undefined, decorators: [{
397
+ type: i0.Inject,
398
+ args: [i1.TUI_TEXTFIELD_HOST]
399
+ }] }];
400
+ } });
401
+
352
402
  var TuiInputDateTimeComponent = /** @class */ (function (_super) {
353
403
  __extends(TuiInputDateTimeComponent, _super);
354
- function TuiInputDateTimeComponent(control, cdr, textfieldSize, dateFormat, dateSeparator, timeTexts$, dateTexts$, valueTransformer, options) {
404
+ function TuiInputDateTimeComponent(control, cdr, textfieldSize, dateFormat, dateSeparator, timeTexts$, dateTexts$, valueTransformer, options, isMobile, isIos) {
355
405
  var _this = _super.call(this, control, cdr, valueTransformer) || this;
356
406
  _this.textfieldSize = textfieldSize;
357
407
  _this.dateFormat = dateFormat;
@@ -360,22 +410,24 @@
360
410
  _this.dateTexts$ = dateTexts$;
361
411
  _this.valueTransformer = valueTransformer;
362
412
  _this.options = options;
413
+ _this.isMobile = isMobile;
414
+ _this.isIos = isIos;
363
415
  _this.month = null;
364
416
  _this.min = _this.options.min;
365
417
  _this.max = _this.options.max;
366
- _this.disabledItemHandler = i4.ALWAYS_FALSE_HANDLER;
367
- _this.defaultActiveYearMonth = i4.TuiMonth.currentLocal();
418
+ _this.disabledItemHandler = i6.ALWAYS_FALSE_HANDLER;
419
+ _this.defaultActiveYearMonth = i6.TuiMonth.currentLocal();
368
420
  _this.timeMode = 'HH:MM';
369
421
  _this.open = false;
370
- _this.filler$ = i7.combineLatest([
371
- _this.dateTexts$.pipe(operators.map(function (dateTexts) { return i4.changeDateSeparator(dateTexts[_this.dateFormat], _this.dateSeparator); })),
422
+ _this.filler$ = i8.combineLatest([
423
+ _this.dateTexts$.pipe(operators.map(function (dateTexts) { return i6.changeDateSeparator(dateTexts[_this.dateFormat], _this.dateSeparator); })),
372
424
  _this.timeTexts$.pipe(operators.map(function (texts) { return texts[_this.timeMode]; })),
373
425
  ]).pipe(operators.map(function (fillers) { return _this.getDateTimeString.apply(_this, __spreadArray([], __read(fillers))); }));
374
426
  return _this;
375
427
  }
376
428
  Object.defineProperty(TuiInputDateTimeComponent.prototype, "fillerLength", {
377
429
  get: function () {
378
- return i4.DATE_FILLER_LENGTH + constants.DATE_TIME_SEPARATOR.length + this.timeMode.length;
430
+ return i6.DATE_FILLER_LENGTH + constants.DATE_TIME_SEPARATOR.length + this.timeMode.length;
379
431
  },
380
432
  enumerable: false,
381
433
  configurable: true
@@ -408,11 +460,25 @@
408
460
  enumerable: false,
409
461
  configurable: true
410
462
  });
463
+ Object.defineProperty(TuiInputDateTimeComponent.prototype, "nativePicker", {
464
+ get: function () {
465
+ return !!this.options.nativePicker && this.isMobile;
466
+ },
467
+ enumerable: false,
468
+ configurable: true
469
+ });
470
+ Object.defineProperty(TuiInputDateTimeComponent.prototype, "showNativePicker", {
471
+ get: function () {
472
+ return this.nativePicker && this.timeMode === 'HH:MM';
473
+ },
474
+ enumerable: false,
475
+ configurable: true
476
+ });
411
477
  Object.defineProperty(TuiInputDateTimeComponent.prototype, "computedValue", {
412
478
  get: function () {
413
479
  var _a = this, value = _a.value, nativeValue = _a.nativeValue, timeMode = _a.timeMode;
414
480
  var _b = __read(value, 2), date = _b[0], time = _b[1];
415
- var hasTimeInputChars = nativeValue.length > i4.DATE_FILLER_LENGTH;
481
+ var hasTimeInputChars = nativeValue.length > i6.DATE_FILLER_LENGTH;
416
482
  if (!date || (!time && hasTimeInputChars)) {
417
483
  return nativeValue;
418
484
  }
@@ -446,7 +512,7 @@
446
512
  get: function () {
447
513
  return (this.month ||
448
514
  this.value[0] ||
449
- i4.tuiDateClamp(this.defaultActiveYearMonth, Array.isArray(this.min) ? this.min[0] : this.min, Array.isArray(this.max) ? this.max[0] : this.max));
515
+ i6.tuiDateClamp(this.defaultActiveYearMonth, Array.isArray(this.min) ? this.min[0] : this.min, Array.isArray(this.max) ? this.max[0] : this.max));
450
516
  },
451
517
  enumerable: false,
452
518
  configurable: true
@@ -478,14 +544,14 @@
478
544
  if (!value) {
479
545
  this.onOpenChange(true);
480
546
  }
481
- if (value.length < i4.DATE_FILLER_LENGTH) {
547
+ if (value.length < i6.DATE_FILLER_LENGTH) {
482
548
  this.value = [null, null];
483
549
  return;
484
550
  }
485
551
  var _a = __read(value.split(constants.DATE_TIME_SEPARATOR), 2), date = _a[0], time = _a[1];
486
- var parsedDate = i4.TuiDay.normalizeParse(date, this.dateFormat);
552
+ var parsedDate = i6.TuiDay.normalizeParse(date, this.dateFormat);
487
553
  var parsedTime = time && time.length === this.timeMode.length
488
- ? this.clampTime(i4.TuiTime.fromString(time), parsedDate)
554
+ ? this.clampTime(i6.TuiTime.fromString(time), parsedDate)
489
555
  : null;
490
556
  this.open = false;
491
557
  this.value = [parsedDate, parsedTime];
@@ -516,7 +582,7 @@
516
582
  if (!time) {
517
583
  return;
518
584
  }
519
- var parsedTime = i4.TuiTime.fromString(time);
585
+ var parsedTime = i6.TuiTime.fromString(time);
520
586
  this.value = [this.value[0], parsedTime];
521
587
  setTimeout(function () {
522
588
  if (_this.nativeValue.endsWith('.') || _this.nativeValue.endsWith(':')) {
@@ -530,14 +596,15 @@
530
596
  };
531
597
  TuiInputDateTimeComponent.prototype.writeValue = function (value) {
532
598
  _super.prototype.writeValue.call(this, value);
533
- this.nativeValue = value && (value[0] || value[1]) ? this.computedValue : '';
599
+ this.nativeValue =
600
+ this.value && (this.value[0] || this.value[1]) ? this.computedValue : '';
534
601
  };
535
602
  TuiInputDateTimeComponent.prototype.getFallbackValue = function () {
536
603
  return [null, null];
537
604
  };
538
605
  TuiInputDateTimeComponent.prototype.valueIdenticalComparator = function (oldValue, newValue) {
539
- return (i4.tuiNullableSame(oldValue[0], newValue[0], function (a, b) { return a.daySame(b); }) &&
540
- i4.tuiNullableSame(oldValue[1], newValue[1], function (a, b) { return String(a) === String(b); }));
606
+ return (i6.tuiNullableSame(oldValue[0], newValue[0], function (a, b) { return a.daySame(b); }) &&
607
+ i6.tuiNullableSame(oldValue[1], newValue[1], function (a, b) { return String(a) === String(b); }));
541
608
  };
542
609
  TuiInputDateTimeComponent.prototype.calculateMask = function (day, min, max, timeMode, dateFormat, dateSeparator) {
543
610
  return {
@@ -558,10 +625,10 @@
558
625
  };
559
626
  TuiInputDateTimeComponent.prototype.getDateTimeString = function (date, time, timeMode) {
560
627
  if (timeMode === void 0) { timeMode = 'HH:MM'; }
561
- var dateString = date instanceof i4.TuiDay
628
+ var dateString = date instanceof i6.TuiDay
562
629
  ? date.toString(this.dateFormat, this.dateSeparator)
563
630
  : date;
564
- var timeString = time instanceof i4.TuiTime ? time.toString(timeMode) : time || '';
631
+ var timeString = time instanceof i6.TuiTime ? time.toString(timeMode) : time || '';
565
632
  return "" + dateString + constants.DATE_TIME_SEPARATOR + timeString;
566
633
  };
567
634
  TuiInputDateTimeComponent.prototype.updateNativeValue = function (day) {
@@ -576,36 +643,36 @@
576
643
  var max = Array.isArray(this.max) && day.daySame(this.calendarMaxDay)
577
644
  ? this.max[1].toAbsoluteMilliseconds()
578
645
  : Infinity;
579
- return i4.TuiTime.fromAbsoluteMilliseconds(i4.tuiClamp(ms, min, max));
646
+ return i6.TuiTime.fromAbsoluteMilliseconds(i6.tuiClamp(ms, min, max));
580
647
  };
581
648
  return TuiInputDateTimeComponent;
582
- }(i4.AbstractTuiControl));
583
- TuiInputDateTimeComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: TuiInputDateTimeComponent, deps: [{ token: i6.NgControl, optional: true, self: true }, { token: i0.ChangeDetectorRef }, { token: i1.TUI_TEXTFIELD_SIZE }, { token: i4.TUI_DATE_FORMAT }, { token: i4.TUI_DATE_SEPARATOR }, { token: tokens.TUI_TIME_TEXTS }, { token: tokens.TUI_DATE_TEXTS }, { token: tokens.TUI_DATE_TIME_VALUE_TRANSFORMER, optional: true }, { token: tokens.TUI_INPUT_DATE_OPTIONS }], target: i0__namespace.ɵɵFactoryTarget.Component });
649
+ }(i6.AbstractTuiControl));
650
+ TuiInputDateTimeComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: TuiInputDateTimeComponent, deps: [{ token: i7.NgControl, optional: true, self: true }, { token: i0.ChangeDetectorRef }, { token: i1.TUI_TEXTFIELD_SIZE }, { token: i6.TUI_DATE_FORMAT }, { token: i6.TUI_DATE_SEPARATOR }, { token: tokens.TUI_TIME_TEXTS }, { token: tokens.TUI_DATE_TEXTS }, { token: tokens.TUI_DATE_TIME_VALUE_TRANSFORMER, optional: true }, { token: tokens.TUI_INPUT_DATE_OPTIONS }, { token: i6.TUI_IS_MOBILE }, { token: i6.TUI_IS_IOS }], target: i0__namespace.ɵɵFactoryTarget.Component });
584
651
  TuiInputDateTimeComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: TuiInputDateTimeComponent, selector: "tui-input-date-time", inputs: { min: "min", max: "max", disabledItemHandler: "disabledItemHandler", defaultActiveYearMonth: "defaultActiveYearMonth", timeMode: "timeMode" }, host: { listeners: { "click": "onClick()" } }, providers: [
585
- i4.tuiAsFocusableItemAccessor(TuiInputDateTimeComponent),
586
- i4.tuiAsControl(TuiInputDateTimeComponent),
652
+ i6.tuiAsFocusableItemAccessor(TuiInputDateTimeComponent),
653
+ i6.tuiAsControl(TuiInputDateTimeComponent),
587
654
  tokens.tuiDateStreamWithTransformer(tokens.TUI_DATE_TIME_VALUE_TRANSFORMER),
588
- ], viewQueries: [{ propertyName: "textfield", first: true, predicate: i1.TuiPrimitiveTextfieldComponent, descendants: true }], usesInheritance: true, ngImport: i0__namespace, template: "<tui-hosted-dropdown\n class=\"t-hosted\"\n [canOpen]=\"interactive\"\n [content]=\"dropdown\"\n [open]=\"open && interactive\"\n (openChange)=\"onOpenChange($event)\"\n>\n <tui-primitive-textfield\n automation-id=\"tui-input-date-time__textfield\"\n tuiValueAccessor\n class=\"t-textfield\"\n [tuiTextfieldIcon]=\"calendarIcon && iconContent\"\n [tuiTextfieldFiller]=\"(filler$ | async) || ''\"\n [pseudoFocus]=\"pseudoFocus\"\n [pseudoHover]=\"pseudoHover\"\n [invalid]=\"computedInvalid\"\n [nativeId]=\"nativeId\"\n [readOnly]=\"readOnly\"\n [disabled]=\"computedDisabled\"\n [textMask]=\"textMaskOptions\"\n [value]=\"computedValue\"\n (valueChange)=\"onValueChange($event)\"\n (focusedChange)=\"onFocused($event)\"\n >\n <ng-content></ng-content>\n <ng-content\n select=\"input\"\n ngProjectAs=\"input\"\n ></ng-content>\n </tui-primitive-textfield>\n\n <ng-template #iconContent>\n <tui-svg\n *polymorpheusOutlet=\"calendarIcon as src; context: {$implicit: size}\"\n tuiWrapper\n appearance=\"icon\"\n [class.t-icon]=\"!computedDisabled\"\n [src]=\"src\"\n ></tui-svg>\n </ng-template>\n\n <ng-template\n #dropdown=\"polymorpheus\"\n [polymorpheus]=\"type\"\n >\n <tui-calendar\n tuiPreventDefault=\"mousedown\"\n automation-id=\"tui-input-date-time__calendar\"\n [min]=\"calendarMinDay\"\n [max]=\"calendarMaxDay\"\n [disabledItemHandler]=\"disabledItemHandler\"\n [month]=\"computedActiveYearMonth\"\n [value]=\"calendarValue\"\n (dayClick)=\"onDayClick($event)\"\n (monthChange)=\"onMonthChange($event)\"\n ></tui-calendar>\n </ng-template>\n</tui-hosted-dropdown>\n", styles: [":host{display:block;border-radius:var(--tui-radius-m);text-align:left}.t-hosted{display:block;border-radius:inherit}.t-textfield{border-radius:inherit;text-align:inherit}.t-icon{pointer-events:auto}.t-button{display:flex;height:2.75rem;justify-content:center;box-shadow:inset 0 1px var(--tui-base-03)}\n"], components: [{ type: i1__namespace.TuiHostedDropdownComponent, selector: "tui-hosted-dropdown", inputs: ["content", "sided", "canOpen", "open"], outputs: ["openChange", "focusedChange"] }, { type: i1__namespace.TuiPrimitiveTextfieldComponent, selector: "tui-primitive-textfield", inputs: ["editable", "filler", "iconCleaner", "readOnly", "invalid", "disabled", "prefix", "postfix", "value"], outputs: ["valueChange"] }, { type: i1__namespace.TuiSvgComponent, selector: "tui-svg", inputs: ["src"] }, { type: i1__namespace.TuiCalendarComponent, selector: "tui-calendar", inputs: ["month", "disabledItemHandler", "min", "max", "minViewedMonth", "maxViewedMonth", "hoveredItem", "showAdjacent", "markerHandler", "value"], outputs: ["dayClick", "monthChange", "hoveredItemChange"] }], directives: [{ type: i1__namespace.TuiPrimitiveTextfieldDirective, selector: "tui-primitive-textfield" }, { type: i2__namespace.TuiValueAccessorDirective, selector: "[tuiValueAccessor]" }, { type: i1__namespace.TuiTextfieldIconDirective, selector: "[tuiTextfieldIcon]", inputs: ["tuiTextfieldIcon"] }, { type: i1__namespace.TuiTextfieldFillerDirective, selector: "[tuiTextfieldFiller]", inputs: ["tuiTextfieldFiller"] }, { type: i2__namespace.MaskedInputDirective, selector: "[textMask]", inputs: ["textMask"], exportAs: ["textMask"] }, { type: i3__namespace.PolymorpheusOutletDirective, selector: "[polymorpheusOutlet]", inputs: ["polymorpheusOutlet", "polymorpheusOutletContext"] }, { type: i1__namespace.TuiWrapperDirective, selector: "[tuiWrapper]", inputs: ["disabled", "readOnly", "hover", "active", "focus", "invalid", "appearance"] }, { type: i3__namespace.PolymorpheusTemplate, selector: "ng-template[polymorpheus]", inputs: ["polymorpheus"], exportAs: ["polymorpheus"] }, { type: i4__namespace.TuiPreventDefaultDirective, selector: "[tuiPreventDefault]", inputs: ["tuiPreventDefault"] }], pipes: { "async": i5__namespace.AsyncPipe }, changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush });
655
+ ], viewQueries: [{ propertyName: "textfield", first: true, predicate: i1.TuiPrimitiveTextfieldComponent, descendants: true }], usesInheritance: true, ngImport: i0__namespace, template: "<tui-hosted-dropdown\n class=\"t-hosted\"\n [canOpen]=\"interactive && !showNativePicker\"\n [content]=\"dropdown\"\n [open]=\"open && interactive\"\n (openChange)=\"onOpenChange($event)\"\n>\n <tui-primitive-textfield\n automation-id=\"tui-input-date-time__textfield\"\n tuiValueAccessor\n class=\"t-textfield\"\n [tuiTextfieldIcon]=\"calendarIcon && iconContent\"\n [tuiTextfieldFiller]=\"(filler$ | async) || ''\"\n [pseudoFocus]=\"pseudoFocus\"\n [pseudoHover]=\"pseudoHover\"\n [invalid]=\"computedInvalid\"\n [nativeId]=\"nativeId\"\n [readOnly]=\"readOnly\"\n [disabled]=\"computedDisabled\"\n [textMask]=\"textMaskOptions\"\n [value]=\"computedValue\"\n (valueChange)=\"onValueChange($event)\"\n (focusedChange)=\"onFocused($event)\"\n >\n <ng-content></ng-content>\n <ng-content\n select=\"input\"\n ngProjectAs=\"input\"\n ></ng-content>\n </tui-primitive-textfield>\n\n <ng-template #iconContent>\n <tui-svg\n *polymorpheusOutlet=\"calendarIcon as src; context: {$implicit: size}\"\n tuiWrapper\n appearance=\"icon\"\n [class.t-icon]=\"!computedDisabled\"\n [src]=\"src\"\n ></tui-svg>\n <input\n *ngIf=\"showNativePicker\"\n tuiDateTime\n class=\"t-native-input\"\n />\n </ng-template>\n\n <ng-template\n #dropdown=\"polymorpheus\"\n [polymorpheus]=\"type\"\n >\n <tui-calendar\n tuiPreventDefault=\"mousedown\"\n automation-id=\"tui-input-date-time__calendar\"\n [min]=\"calendarMinDay\"\n [max]=\"calendarMaxDay\"\n [disabledItemHandler]=\"disabledItemHandler\"\n [month]=\"computedActiveYearMonth\"\n [value]=\"calendarValue\"\n (dayClick)=\"onDayClick($event)\"\n (monthChange)=\"onMonthChange($event)\"\n ></tui-calendar>\n </ng-template>\n</tui-hosted-dropdown>\n", styles: [":host{display:block;border-radius:var(--tui-radius-m);text-align:left}.t-hosted{display:block;border-radius:inherit}.t-textfield{border-radius:inherit;text-align:inherit}.t-icon{pointer-events:auto}.t-button{display:flex;height:2.75rem;justify-content:center;box-shadow:inset 0 1px var(--tui-base-03)}.t-native-input{position:absolute;top:0;left:0;width:100%;height:100%;opacity:0;pointer-events:auto;font-size:2rem}\n"], components: [{ type: i1__namespace.TuiHostedDropdownComponent, selector: "tui-hosted-dropdown", inputs: ["content", "sided", "canOpen", "open"], outputs: ["openChange", "focusedChange"] }, { type: i1__namespace.TuiPrimitiveTextfieldComponent, selector: "tui-primitive-textfield", inputs: ["editable", "filler", "iconCleaner", "readOnly", "invalid", "disabled", "prefix", "postfix", "value"], outputs: ["valueChange"] }, { type: i1__namespace.TuiSvgComponent, selector: "tui-svg", inputs: ["src"] }, { type: i1__namespace.TuiCalendarComponent, selector: "tui-calendar", inputs: ["month", "disabledItemHandler", "min", "max", "minViewedMonth", "maxViewedMonth", "hoveredItem", "showAdjacent", "markerHandler", "value"], outputs: ["dayClick", "monthChange", "hoveredItemChange"] }], directives: [{ type: i1__namespace.TuiPrimitiveTextfieldDirective, selector: "tui-primitive-textfield" }, { type: i2__namespace.TuiValueAccessorDirective, selector: "[tuiValueAccessor]" }, { type: i1__namespace.TuiTextfieldIconDirective, selector: "[tuiTextfieldIcon]", inputs: ["tuiTextfieldIcon"] }, { type: i1__namespace.TuiTextfieldFillerDirective, selector: "[tuiTextfieldFiller]", inputs: ["tuiTextfieldFiller"] }, { type: i2__namespace.MaskedInputDirective, selector: "[textMask]", inputs: ["textMask"], exportAs: ["textMask"] }, { type: i3__namespace.PolymorpheusOutletDirective, selector: "[polymorpheusOutlet]", inputs: ["polymorpheusOutlet", "polymorpheusOutletContext"] }, { type: i1__namespace.TuiWrapperDirective, selector: "[tuiWrapper]", inputs: ["disabled", "readOnly", "hover", "active", "focus", "invalid", "appearance"] }, { type: i4__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: TuiNativeDateTimeDirective, selector: "input[tuiDateTime]" }, { type: i3__namespace.PolymorpheusTemplate, selector: "ng-template[polymorpheus]", inputs: ["polymorpheus"], exportAs: ["polymorpheus"] }, { type: i6__namespace.TuiPreventDefaultDirective, selector: "[tuiPreventDefault]", inputs: ["tuiPreventDefault"] }], pipes: { "async": i4__namespace.AsyncPipe }, changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush });
589
656
  __decorate([
590
- i4.tuiDefaultProp()
657
+ i6.tuiDefaultProp()
591
658
  ], TuiInputDateTimeComponent.prototype, "min", void 0);
592
659
  __decorate([
593
- i4.tuiDefaultProp()
660
+ i6.tuiDefaultProp()
594
661
  ], TuiInputDateTimeComponent.prototype, "max", void 0);
595
662
  __decorate([
596
- i4.tuiDefaultProp()
663
+ i6.tuiDefaultProp()
597
664
  ], TuiInputDateTimeComponent.prototype, "disabledItemHandler", void 0);
598
665
  __decorate([
599
- i4.tuiDefaultProp()
666
+ i6.tuiDefaultProp()
600
667
  ], TuiInputDateTimeComponent.prototype, "defaultActiveYearMonth", void 0);
601
668
  __decorate([
602
- i4.tuiDefaultProp()
669
+ i6.tuiDefaultProp()
603
670
  ], TuiInputDateTimeComponent.prototype, "timeMode", void 0);
604
671
  __decorate([
605
- i4.tuiPure
672
+ i6.tuiPure
606
673
  ], TuiInputDateTimeComponent.prototype, "calculateMask", null);
607
674
  __decorate([
608
- i4.tuiPure
675
+ i6.tuiPure
609
676
  ], TuiInputDateTimeComponent.prototype, "getDateTimeString", null);
610
677
  i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: TuiInputDateTimeComponent, decorators: [{
611
678
  type: i0.Component,
@@ -615,19 +682,19 @@
615
682
  styleUrls: ['./input-date-time.style.less'],
616
683
  changeDetection: i0.ChangeDetectionStrategy.OnPush,
617
684
  providers: [
618
- i4.tuiAsFocusableItemAccessor(TuiInputDateTimeComponent),
619
- i4.tuiAsControl(TuiInputDateTimeComponent),
685
+ i6.tuiAsFocusableItemAccessor(TuiInputDateTimeComponent),
686
+ i6.tuiAsControl(TuiInputDateTimeComponent),
620
687
  tokens.tuiDateStreamWithTransformer(tokens.TUI_DATE_TIME_VALUE_TRANSFORMER),
621
688
  ],
622
689
  }]
623
690
  }], ctorParameters: function () {
624
- return [{ type: i6__namespace.NgControl, decorators: [{
691
+ return [{ type: i7__namespace.NgControl, decorators: [{
625
692
  type: i0.Optional
626
693
  }, {
627
694
  type: i0.Self
628
695
  }, {
629
696
  type: i0.Inject,
630
- args: [i6.NgControl]
697
+ args: [i7.NgControl]
631
698
  }] }, { type: i0__namespace.ChangeDetectorRef, decorators: [{
632
699
  type: i0.Inject,
633
700
  args: [i0.ChangeDetectorRef]
@@ -636,17 +703,17 @@
636
703
  args: [i1.TUI_TEXTFIELD_SIZE]
637
704
  }] }, { type: undefined, decorators: [{
638
705
  type: i0.Inject,
639
- args: [i4.TUI_DATE_FORMAT]
706
+ args: [i6.TUI_DATE_FORMAT]
640
707
  }] }, { type: undefined, decorators: [{
641
708
  type: i0.Inject,
642
- args: [i4.TUI_DATE_SEPARATOR]
643
- }] }, { type: i7__namespace.Observable, decorators: [{
709
+ args: [i6.TUI_DATE_SEPARATOR]
710
+ }] }, { type: i8__namespace.Observable, decorators: [{
644
711
  type: i0.Inject,
645
712
  args: [tokens.TUI_TIME_TEXTS]
646
- }] }, { type: i7__namespace.Observable, decorators: [{
713
+ }] }, { type: i8__namespace.Observable, decorators: [{
647
714
  type: i0.Inject,
648
715
  args: [tokens.TUI_DATE_TEXTS]
649
- }] }, { type: i4__namespace.AbstractTuiValueTransformer, decorators: [{
716
+ }] }, { type: i6__namespace.AbstractTuiValueTransformer, decorators: [{
650
717
  type: i0.Optional
651
718
  }, {
652
719
  type: i0.Inject,
@@ -654,6 +721,12 @@
654
721
  }] }, { type: undefined, decorators: [{
655
722
  type: i0.Inject,
656
723
  args: [tokens.TUI_INPUT_DATE_OPTIONS]
724
+ }] }, { type: undefined, decorators: [{
725
+ type: i0.Inject,
726
+ args: [i6.TUI_IS_MOBILE]
727
+ }] }, { type: undefined, decorators: [{
728
+ type: i0.Inject,
729
+ args: [i6.TUI_IS_IOS]
657
730
  }] }];
658
731
  }, propDecorators: { textfield: [{
659
732
  type: i0.ViewChild,
@@ -685,9 +758,19 @@
685
758
  enumerable: false,
686
759
  configurable: true
687
760
  });
761
+ Object.defineProperty(TuiInputDateTimeDirective.prototype, "rawValue", {
762
+ get: function () {
763
+ return this.host.value;
764
+ },
765
+ enumerable: false,
766
+ configurable: true
767
+ });
688
768
  TuiInputDateTimeDirective.prototype.onValueChange = function (value) {
689
769
  this.host.onValueChange(value);
690
770
  };
771
+ TuiInputDateTimeDirective.prototype.writeValue = function (value) {
772
+ this.host.writeValue(value);
773
+ };
691
774
  TuiInputDateTimeDirective.prototype.process = function (input) {
692
775
  input.inputMode = 'numeric';
693
776
  };
@@ -709,11 +792,13 @@
709
792
  return TuiInputDateTimeModule;
710
793
  }());
711
794
  TuiInputDateTimeModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: TuiInputDateTimeModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
712
- TuiInputDateTimeModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: TuiInputDateTimeModule, declarations: [TuiInputDateTimeComponent, TuiInputDateTimeDirective], imports: [i5.CommonModule,
795
+ TuiInputDateTimeModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: TuiInputDateTimeModule, declarations: [TuiInputDateTimeComponent,
796
+ TuiInputDateTimeDirective,
797
+ TuiNativeDateTimeDirective], imports: [i4.CommonModule,
713
798
  i2.TextMaskModule,
714
799
  i3.PolymorpheusModule,
715
800
  i1.TuiWrapperModule,
716
- i4.TuiPreventDefaultModule,
801
+ i6.TuiPreventDefaultModule,
717
802
  i1.TuiCalendarModule,
718
803
  i1.TuiSvgModule,
719
804
  i1.TuiLinkModule,
@@ -724,11 +809,11 @@
724
809
  TuiInputDateTimeDirective,
725
810
  i1.TuiTextfieldComponent] });
726
811
  TuiInputDateTimeModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: TuiInputDateTimeModule, imports: [[
727
- i5.CommonModule,
812
+ i4.CommonModule,
728
813
  i2.TextMaskModule,
729
814
  i3.PolymorpheusModule,
730
815
  i1.TuiWrapperModule,
731
- i4.TuiPreventDefaultModule,
816
+ i6.TuiPreventDefaultModule,
732
817
  i1.TuiCalendarModule,
733
818
  i1.TuiSvgModule,
734
819
  i1.TuiLinkModule,
@@ -741,11 +826,11 @@
741
826
  type: i0.NgModule,
742
827
  args: [{
743
828
  imports: [
744
- i5.CommonModule,
829
+ i4.CommonModule,
745
830
  i2.TextMaskModule,
746
831
  i3.PolymorpheusModule,
747
832
  i1.TuiWrapperModule,
748
- i4.TuiPreventDefaultModule,
833
+ i6.TuiPreventDefaultModule,
749
834
  i1.TuiCalendarModule,
750
835
  i1.TuiSvgModule,
751
836
  i1.TuiLinkModule,
@@ -754,7 +839,11 @@
754
839
  i2.TuiValueAccessorModule,
755
840
  i1.TuiTextfieldControllerModule,
756
841
  ],
757
- declarations: [TuiInputDateTimeComponent, TuiInputDateTimeDirective],
842
+ declarations: [
843
+ TuiInputDateTimeComponent,
844
+ TuiInputDateTimeDirective,
845
+ TuiNativeDateTimeDirective,
846
+ ],
758
847
  exports: [
759
848
  TuiInputDateTimeComponent,
760
849
  TuiInputDateTimeDirective,