@taiga-ui/core 3.72.0 → 3.73.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/abstract/accessors.d.ts +3 -0
- package/abstract/index.d.ts +1 -0
- package/abstract/position-accessor.d.ts +1 -1
- package/abstract/rect-accessor.d.ts +2 -1
- package/bundles/taiga-ui-core-abstract.umd.js +16 -9
- package/bundles/taiga-ui-core-abstract.umd.js.map +1 -1
- package/bundles/taiga-ui-core-components-expand.umd.js +4 -2
- package/bundles/taiga-ui-core-components-expand.umd.js.map +1 -1
- package/bundles/taiga-ui-core-components-hosted-dropdown.umd.js +1 -1
- package/bundles/taiga-ui-core-components-hosted-dropdown.umd.js.map +1 -1
- package/bundles/taiga-ui-core-components-primitive-textfield.umd.js +2 -1
- package/bundles/taiga-ui-core-components-primitive-textfield.umd.js.map +1 -1
- package/bundles/taiga-ui-core-components-root.umd.js +1 -1
- package/bundles/taiga-ui-core-components-tooltip.umd.js +1 -1
- package/bundles/taiga-ui-core-components-tooltip.umd.js.map +1 -1
- package/bundles/taiga-ui-core-directives-dropdown.umd.js +100 -101
- package/bundles/taiga-ui-core-directives-dropdown.umd.js.map +1 -1
- package/bundles/taiga-ui-core-directives-hint.umd.js +150 -151
- package/bundles/taiga-ui-core-directives-hint.umd.js.map +1 -1
- package/components/expand/expand.component.d.ts +1 -1
- package/components/primitive-textfield/textfield/textfield.component.d.ts +1 -1
- package/constants/cache-basting-payload.d.ts +1 -1
- package/directives/dropdown/dropdown-position.directive.d.ts +1 -1
- package/directives/dropdown/dropdown-selection.directive.d.ts +15 -15
- package/directives/hint/hint-position.directive.d.ts +1 -1
- package/esm2015/abstract/accessors.js +6 -0
- package/esm2015/abstract/index.js +2 -1
- package/esm2015/abstract/position-accessor.js +9 -5
- package/esm2015/abstract/rect-accessor.js +6 -8
- package/esm2015/components/expand/expand.component.js +5 -3
- package/esm2015/components/hosted-dropdown/hosted-dropdown.component.js +1 -1
- package/esm2015/components/primitive-textfield/textfield/textfield.component.js +3 -2
- package/esm2015/components/root/root.component.js +1 -1
- package/esm2015/components/tooltip/tooltip.component.js +1 -1
- package/esm2015/directives/dropdown/dropdown-position.directive.js +4 -5
- package/esm2015/directives/dropdown/dropdown-selection.directive.js +8 -8
- package/esm2015/directives/dropdown/dropdown.component.js +4 -3
- package/esm2015/directives/hint/hint-position.directive.js +4 -5
- package/esm2015/directives/hint/hint.component.js +4 -3
- package/fesm2015/taiga-ui-core-abstract.js +17 -11
- package/fesm2015/taiga-ui-core-abstract.js.map +1 -1
- package/fesm2015/taiga-ui-core-components-expand.js +4 -2
- package/fesm2015/taiga-ui-core-components-expand.js.map +1 -1
- package/fesm2015/taiga-ui-core-components-hosted-dropdown.js +1 -1
- package/fesm2015/taiga-ui-core-components-hosted-dropdown.js.map +1 -1
- package/fesm2015/taiga-ui-core-components-primitive-textfield.js +2 -1
- package/fesm2015/taiga-ui-core-components-primitive-textfield.js.map +1 -1
- package/fesm2015/taiga-ui-core-components-root.js +1 -1
- package/fesm2015/taiga-ui-core-components-tooltip.js +1 -1
- package/fesm2015/taiga-ui-core-components-tooltip.js.map +1 -1
- package/fesm2015/taiga-ui-core-directives-dropdown.js +93 -94
- package/fesm2015/taiga-ui-core-directives-dropdown.js.map +1 -1
- package/fesm2015/taiga-ui-core-directives-hint.js +103 -104
- package/fesm2015/taiga-ui-core-directives-hint.js.map +1 -1
- package/package.json +4 -4
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
(function (global, factory) {
|
|
2
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@taiga-ui/cdk'), require('@taiga-ui/core/abstract'), require('@taiga-ui/core/animations'), require('@taiga-ui/core/directives/mode'), require('@taiga-ui/core/services'), require('@taiga-ui/core/tokens'), require('@taiga-ui/core/utils'), require('@tinkoff/ng-polymorpheus'), require('rxjs/operators'), require('rxjs'), require('@
|
|
3
|
-
typeof define === 'function' && define.amd ? define('@taiga-ui/core/directives/hint', ['exports', '@angular/core', '@taiga-ui/cdk', '@taiga-ui/core/abstract', '@taiga-ui/core/animations', '@taiga-ui/core/directives/mode', '@taiga-ui/core/services', '@taiga-ui/core/tokens', '@taiga-ui/core/utils', '@tinkoff/ng-polymorpheus', 'rxjs/operators', 'rxjs', '@
|
|
4
|
-
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global["taiga-ui"] = global["taiga-ui"] || {}, global["taiga-ui"].core = global["taiga-ui"].core || {}, global["taiga-ui"].core.directives = global["taiga-ui"].core.directives || {}, global["taiga-ui"].core.directives.hint = {}), global.ng.core, global.i3, global["taiga-ui"].core.abstract, global["taiga-ui"].core.animations, global["taiga-ui"].core.directives.mode, global["taiga-ui"].core.services, global["taiga-ui"].core.tokens, global["taiga-ui"].core.utils, global.i1, global.rxjs.operators, global.rxjs, global
|
|
5
|
-
})(this, (function (exports, i0, i3,
|
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@taiga-ui/cdk'), require('@taiga-ui/core/abstract'), require('@taiga-ui/core/animations'), require('@taiga-ui/core/directives/mode'), require('@taiga-ui/core/services'), require('@taiga-ui/core/tokens'), require('@taiga-ui/core/utils'), require('@tinkoff/ng-polymorpheus'), require('rxjs/operators'), require('rxjs'), require('@taiga-ui/core/constants'), require('@angular/common')) :
|
|
3
|
+
typeof define === 'function' && define.amd ? define('@taiga-ui/core/directives/hint', ['exports', '@angular/core', '@taiga-ui/cdk', '@taiga-ui/core/abstract', '@taiga-ui/core/animations', '@taiga-ui/core/directives/mode', '@taiga-ui/core/services', '@taiga-ui/core/tokens', '@taiga-ui/core/utils', '@tinkoff/ng-polymorpheus', 'rxjs/operators', 'rxjs', '@taiga-ui/core/constants', '@angular/common'], factory) :
|
|
4
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global["taiga-ui"] = global["taiga-ui"] || {}, global["taiga-ui"].core = global["taiga-ui"].core || {}, global["taiga-ui"].core.directives = global["taiga-ui"].core.directives || {}, global["taiga-ui"].core.directives.hint = {}), global.ng.core, global.i3, global["taiga-ui"].core.abstract, global["taiga-ui"].core.animations, global["taiga-ui"].core.directives.mode, global["taiga-ui"].core.services, global["taiga-ui"].core.tokens, global["taiga-ui"].core.utils, global.i1, global.rxjs.operators, global.rxjs, global["taiga-ui"].core.constants, global.ng.common));
|
|
5
|
+
})(this, (function (exports, i0, i3, i1$1, animations, i5, i2, tokens, utils, i1, operators, i2$1, constants, common) { 'use strict';
|
|
6
6
|
|
|
7
7
|
function _interopNamespace(e) {
|
|
8
8
|
if (e && e.__esModule) return e;
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
|
|
25
25
|
var i0__namespace = /*#__PURE__*/_interopNamespace(i0);
|
|
26
26
|
var i3__namespace = /*#__PURE__*/_interopNamespace(i3);
|
|
27
|
-
var
|
|
27
|
+
var i1__namespace$1 = /*#__PURE__*/_interopNamespace(i1$1);
|
|
28
28
|
var i5__namespace = /*#__PURE__*/_interopNamespace(i5);
|
|
29
29
|
var i2__namespace = /*#__PURE__*/_interopNamespace(i2);
|
|
30
30
|
var i1__namespace = /*#__PURE__*/_interopNamespace(i1);
|
|
@@ -470,8 +470,8 @@
|
|
|
470
470
|
}());
|
|
471
471
|
TuiHintDirective.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: TuiHintDirective, deps: [{ token: i0.ElementRef }, { token: i1.PolymorpheusComponent }, { token: i2.TuiHintService }, { token: TUI_HINT_OPTIONS }, { token: i3.TuiActiveZoneDirective, optional: true }], target: i0__namespace.ɵɵFactoryTarget.Directive });
|
|
472
472
|
TuiHintDirective.ɵdir = i0__namespace.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.17", type: TuiHintDirective, selector: "[tuiHint]:not(ng-container):not(ng-template)", inputs: { content: ["tuiHint", "content"], context: ["tuiHintContext", "context"], tuiHintAppearance: "tuiHintAppearance" }, providers: [
|
|
473
|
-
|
|
474
|
-
|
|
473
|
+
i1$1.tuiAsRectAccessor(TuiHintDirective),
|
|
474
|
+
i1$1.tuiAsVehicle(TuiHintDirective),
|
|
475
475
|
{
|
|
476
476
|
provide: i1.PolymorpheusComponent,
|
|
477
477
|
deps: [TUI_HINT_COMPONENT, i0.INJECTOR],
|
|
@@ -483,8 +483,8 @@
|
|
|
483
483
|
args: [{
|
|
484
484
|
selector: '[tuiHint]:not(ng-container):not(ng-template)',
|
|
485
485
|
providers: [
|
|
486
|
-
|
|
487
|
-
|
|
486
|
+
i1$1.tuiAsRectAccessor(TuiHintDirective),
|
|
487
|
+
i1$1.tuiAsVehicle(TuiHintDirective),
|
|
488
488
|
{
|
|
489
489
|
provide: i1.PolymorpheusComponent,
|
|
490
490
|
deps: [TUI_HINT_COMPONENT, i0.INJECTOR],
|
|
@@ -546,14 +546,14 @@
|
|
|
546
546
|
this.toggle$.next(visible);
|
|
547
547
|
};
|
|
548
548
|
return TuiHintHoverDirective;
|
|
549
|
-
}(
|
|
549
|
+
}(i1$1.TuiDriver));
|
|
550
550
|
TuiHintHoverDirective.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: TuiHintHoverDirective, deps: [{ token: i3.TuiHoveredService }, { token: TUI_HINT_OPTIONS }, { token: i0.ElementRef }], target: i0__namespace.ɵɵFactoryTarget.Directive });
|
|
551
|
-
TuiHintHoverDirective.ɵdir = i0__namespace.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.17", type: TuiHintHoverDirective, selector: "[tuiHint]:not(ng-container):not(ng-template)", inputs: { showDelay: ["tuiHintShowDelay", "showDelay"], hideDelay: ["tuiHintHideDelay", "hideDelay"] }, providers: [
|
|
551
|
+
TuiHintHoverDirective.ɵdir = i0__namespace.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.17", type: TuiHintHoverDirective, selector: "[tuiHint]:not(ng-container):not(ng-template)", inputs: { showDelay: ["tuiHintShowDelay", "showDelay"], hideDelay: ["tuiHintHideDelay", "hideDelay"] }, providers: [i1$1.tuiAsDriver(TuiHintHoverDirective), i3.TuiHoveredService], exportAs: ["tuiHintHover"], usesInheritance: true, ngImport: i0__namespace });
|
|
552
552
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: TuiHintHoverDirective, decorators: [{
|
|
553
553
|
type: i0.Directive,
|
|
554
554
|
args: [{
|
|
555
555
|
selector: '[tuiHint]:not(ng-container):not(ng-template)',
|
|
556
|
-
providers: [
|
|
556
|
+
providers: [i1$1.tuiAsDriver(TuiHintHoverDirective), i3.TuiHoveredService],
|
|
557
557
|
exportAs: 'tuiHintHover',
|
|
558
558
|
}]
|
|
559
559
|
}], ctorParameters: function () {
|
|
@@ -593,16 +593,16 @@
|
|
|
593
593
|
}(TuiHintHoverDirective));
|
|
594
594
|
TuiHintPointerDirective.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: TuiHintPointerDirective, deps: null, target: i0__namespace.ɵɵFactoryTarget.Directive });
|
|
595
595
|
TuiHintPointerDirective.ɵdir = i0__namespace.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.17", type: TuiHintPointerDirective, selector: "[tuiHint][tuiHintPointer]", host: { listeners: { "mousemove.silent": "onMove($event)" } }, providers: [
|
|
596
|
-
|
|
597
|
-
|
|
596
|
+
i1$1.tuiAsRectAccessor(TuiHintPointerDirective),
|
|
597
|
+
i1$1.tuiAsDriver(TuiHintPointerDirective),
|
|
598
598
|
], usesInheritance: true, ngImport: i0__namespace });
|
|
599
599
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: TuiHintPointerDirective, decorators: [{
|
|
600
600
|
type: i0.Directive,
|
|
601
601
|
args: [{
|
|
602
602
|
selector: '[tuiHint][tuiHintPointer]',
|
|
603
603
|
providers: [
|
|
604
|
-
|
|
605
|
-
|
|
604
|
+
i1$1.tuiAsRectAccessor(TuiHintPointerDirective),
|
|
605
|
+
i1$1.tuiAsDriver(TuiHintPointerDirective),
|
|
606
606
|
],
|
|
607
607
|
}]
|
|
608
608
|
}], propDecorators: { onMove: [{
|
|
@@ -610,6 +610,119 @@
|
|
|
610
610
|
args: ['mousemove.silent', ['$event']]
|
|
611
611
|
}] } });
|
|
612
612
|
|
|
613
|
+
var OFFSET = 8;
|
|
614
|
+
var ARROW_OFFSET = 22;
|
|
615
|
+
var TOP = 0;
|
|
616
|
+
var LEFT = 1;
|
|
617
|
+
var TuiHintPositionDirective = /** @class */ (function (_super) {
|
|
618
|
+
__extends(TuiHintPositionDirective, _super);
|
|
619
|
+
function TuiHintPositionDirective(options, viewport, directive, accessors) {
|
|
620
|
+
var _this = _super.call(this) || this;
|
|
621
|
+
_this.options = options;
|
|
622
|
+
_this.viewport = viewport;
|
|
623
|
+
_this.directive = directive;
|
|
624
|
+
_this.accessors = accessors;
|
|
625
|
+
_this.points = constants.TUI_HINT_DIRECTIONS.reduce(function (acc, direction) {
|
|
626
|
+
var _c;
|
|
627
|
+
return (Object.assign(Object.assign({}, acc), (_c = {}, _c[direction] = [0, 0], _c)));
|
|
628
|
+
}, {});
|
|
629
|
+
_this.direction = _this.options.direction;
|
|
630
|
+
_this.type = 'hint';
|
|
631
|
+
return _this;
|
|
632
|
+
}
|
|
633
|
+
TuiHintPositionDirective.prototype.getPosition = function (_c) {
|
|
634
|
+
var _this = this;
|
|
635
|
+
var width = _c.width, height = _c.height;
|
|
636
|
+
var _a, _b;
|
|
637
|
+
var hostRect = (_b = (_a = this.accessor) === null || _a === void 0 ? void 0 : _a.getClientRect()) !== null && _b !== void 0 ? _b : i3.EMPTY_CLIENT_RECT;
|
|
638
|
+
var leftCenter = hostRect.left + hostRect.width / 2;
|
|
639
|
+
var topCenter = hostRect.top + hostRect.height / 2;
|
|
640
|
+
this.points['top-left'][TOP] = hostRect.top - height - OFFSET;
|
|
641
|
+
this.points['top-left'][LEFT] = leftCenter - width + ARROW_OFFSET;
|
|
642
|
+
this.points.top[TOP] = this.points['top-left'][TOP];
|
|
643
|
+
this.points.top[LEFT] = leftCenter - width / 2;
|
|
644
|
+
this.points['top-right'][TOP] = this.points['top-left'][TOP];
|
|
645
|
+
this.points['top-right'][LEFT] = leftCenter - ARROW_OFFSET;
|
|
646
|
+
this.points['bottom-left'][TOP] = hostRect.bottom + OFFSET;
|
|
647
|
+
this.points['bottom-left'][LEFT] = this.points['top-left'][LEFT];
|
|
648
|
+
this.points.bottom[TOP] = this.points['bottom-left'][TOP];
|
|
649
|
+
this.points.bottom[LEFT] = this.points.top[LEFT];
|
|
650
|
+
this.points['bottom-right'][TOP] = this.points['bottom-left'][TOP];
|
|
651
|
+
this.points['bottom-right'][LEFT] = this.points['top-right'][LEFT];
|
|
652
|
+
this.points['left-top'][TOP] = topCenter - height + ARROW_OFFSET;
|
|
653
|
+
this.points['left-top'][LEFT] = hostRect.left - width - OFFSET;
|
|
654
|
+
this.points.left[TOP] = topCenter - height / 2;
|
|
655
|
+
this.points.left[LEFT] = this.points['left-top'][LEFT];
|
|
656
|
+
this.points['left-bottom'][TOP] = topCenter - ARROW_OFFSET;
|
|
657
|
+
this.points['left-bottom'][LEFT] = this.points['left-top'][LEFT];
|
|
658
|
+
this.points['right-top'][TOP] = this.points['left-top'][TOP];
|
|
659
|
+
this.points['right-top'][LEFT] = hostRect.right + OFFSET;
|
|
660
|
+
this.points.right[TOP] = this.points.left[TOP];
|
|
661
|
+
this.points.right[LEFT] = this.points['right-top'][LEFT];
|
|
662
|
+
this.points['right-bottom'][TOP] = this.points['left-bottom'][TOP];
|
|
663
|
+
this.points['right-bottom'][LEFT] = this.points['right-top'][LEFT];
|
|
664
|
+
if (this.checkPosition(this.points[this.direction], width, height)) {
|
|
665
|
+
return this.points[this.direction];
|
|
666
|
+
}
|
|
667
|
+
var direction = constants.TUI_HINT_DIRECTIONS.find(function (direction) { return _this.checkPosition(_this.points[direction], width, height); });
|
|
668
|
+
return this.points[direction || this.fallback];
|
|
669
|
+
};
|
|
670
|
+
Object.defineProperty(TuiHintPositionDirective.prototype, "accessor", {
|
|
671
|
+
get: function () {
|
|
672
|
+
return i1$1.tuiFallbackRectAccessor('hint')(this.accessors, this.directive);
|
|
673
|
+
},
|
|
674
|
+
enumerable: false,
|
|
675
|
+
configurable: true
|
|
676
|
+
});
|
|
677
|
+
Object.defineProperty(TuiHintPositionDirective.prototype, "fallback", {
|
|
678
|
+
get: function () {
|
|
679
|
+
return this.points.top[TOP] >
|
|
680
|
+
this.viewport.getClientRect().bottom - this.points.bottom[TOP]
|
|
681
|
+
? 'top'
|
|
682
|
+
: 'bottom';
|
|
683
|
+
},
|
|
684
|
+
enumerable: false,
|
|
685
|
+
configurable: true
|
|
686
|
+
});
|
|
687
|
+
TuiHintPositionDirective.prototype.checkPosition = function (_c, width, height) {
|
|
688
|
+
var _d = __read(_c, 2), top = _d[0], left = _d[1];
|
|
689
|
+
var viewport = this.viewport.getClientRect();
|
|
690
|
+
return (top > OFFSET &&
|
|
691
|
+
left > OFFSET &&
|
|
692
|
+
top + height < viewport.bottom - OFFSET &&
|
|
693
|
+
left + width < viewport.right - OFFSET);
|
|
694
|
+
};
|
|
695
|
+
return TuiHintPositionDirective;
|
|
696
|
+
}(i1$1.TuiPositionAccessor));
|
|
697
|
+
TuiHintPositionDirective.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: TuiHintPositionDirective, deps: [{ token: TUI_HINT_OPTIONS }, { token: tokens.TUI_VIEWPORT }, { token: TuiHintDirective }, { token: i1$1.TuiRectAccessor }], target: i0__namespace.ɵɵFactoryTarget.Directive });
|
|
698
|
+
TuiHintPositionDirective.ɵdir = i0__namespace.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.17", type: TuiHintPositionDirective, selector: "[tuiHint]:not(ng-container):not(ng-template)", inputs: { direction: ["tuiHintDirection", "direction"] }, usesInheritance: true, ngImport: i0__namespace });
|
|
699
|
+
__decorate([
|
|
700
|
+
i3.tuiPure
|
|
701
|
+
], TuiHintPositionDirective.prototype, "accessor", null);
|
|
702
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: TuiHintPositionDirective, decorators: [{
|
|
703
|
+
type: i0.Directive,
|
|
704
|
+
args: [{
|
|
705
|
+
selector: '[tuiHint]:not(ng-container):not(ng-template)',
|
|
706
|
+
}]
|
|
707
|
+
}], ctorParameters: function () {
|
|
708
|
+
return [{ type: undefined, decorators: [{
|
|
709
|
+
type: i0.Inject,
|
|
710
|
+
args: [TUI_HINT_OPTIONS]
|
|
711
|
+
}] }, { type: i1__namespace$1.TuiRectAccessor, decorators: [{
|
|
712
|
+
type: i0.Inject,
|
|
713
|
+
args: [tokens.TUI_VIEWPORT]
|
|
714
|
+
}] }, { type: i1__namespace$1.TuiRectAccessor, decorators: [{
|
|
715
|
+
type: i0.Inject,
|
|
716
|
+
args: [TuiHintDirective]
|
|
717
|
+
}] }, { type: undefined, decorators: [{
|
|
718
|
+
type: i0.Inject,
|
|
719
|
+
args: [i1$1.TuiRectAccessor]
|
|
720
|
+
}] }];
|
|
721
|
+
}, propDecorators: { direction: [{
|
|
722
|
+
type: i0.Input,
|
|
723
|
+
args: ['tuiHintDirection']
|
|
724
|
+
}], accessor: [] } });
|
|
725
|
+
|
|
613
726
|
var GAP = 4;
|
|
614
727
|
var TuiHintComponent = /** @class */ (function () {
|
|
615
728
|
function TuiHintComponent(hovered$, position$, destroy$, animation, pointer, accessor, el, polymorpheus, hover, mode, visualViewportService, viewport) {
|
|
@@ -674,13 +787,13 @@
|
|
|
674
787
|
};
|
|
675
788
|
return TuiHintComponent;
|
|
676
789
|
}());
|
|
677
|
-
TuiHintComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: TuiHintComponent, deps: [{ token: i3.TuiHoveredService }, { token: i2.TuiPositionService }, { token: i3.TuiDestroyService, self: true }, { token: tokens.TUI_ANIMATION_OPTIONS }, { token: TuiHintPointerDirective, optional: true }, { token:
|
|
790
|
+
TuiHintComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: TuiHintComponent, deps: [{ token: i3.TuiHoveredService }, { token: i2.TuiPositionService }, { token: i3.TuiDestroyService, self: true }, { token: tokens.TUI_ANIMATION_OPTIONS }, { token: TuiHintPointerDirective, optional: true }, { token: i1$1.TuiRectAccessor }, { token: i0.ElementRef }, { token: i1.POLYMORPHEUS_CONTEXT }, { token: TuiHintHoverDirective }, { token: i5.TuiModeDirective, optional: true }, { token: i2.TuiVisualViewportService }, { token: tokens.TUI_VIEWPORT }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
678
791
|
TuiHintComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: TuiHintComponent, selector: "tui-hint", host: { listeners: { "document:click": "onClick($event.target)" }, properties: { "@tuiFadeIn": "animation", "class._untouchable": "pointer", "attr.data-appearance": "this.appearance" } }, providers: [
|
|
679
792
|
i3.TuiDestroyService,
|
|
680
793
|
i2.TuiPositionService,
|
|
681
794
|
i3.TuiHoveredService,
|
|
682
|
-
|
|
683
|
-
|
|
795
|
+
i1$1.tuiPositionAccessorFor('hint', TuiHintPositionDirective),
|
|
796
|
+
i1$1.tuiRectAccessorFor('hint', TuiHintDirective),
|
|
684
797
|
], ngImport: i0__namespace, template: "\n <ng-content></ng-content>\n <span\n *polymorpheusOutlet=\"content as text; context: context\"\n [innerHTML]=\"text\"\n ></span>\n ", isInline: true, styles: [":host{position:absolute;max-width:18rem;min-height:var(--tui-height-m);padding:.75rem 1rem;background:var(--tui-primary);border-radius:var(--tui-radius-l);color:var(--tui-primary-text);box-sizing:border-box;font:var(--tui-font-text-s);white-space:pre-line;word-wrap:break-word}:host:before{content:\"\";position:absolute;top:var(--top);left:var(--left);width:.5rem;height:.5rem;border-radius:.125rem;box-sizing:border-box;background:inherit;transform:translate(-50%,-50%) rotate(45deg)}:host[data-appearance=error]{background:var(--tui-error-fill)}:host[data-appearance=onDark]{background:var(--tui-elevation-02);color:var(--tui-text-01);filter:drop-shadow(0 0 .125rem rgba(0,0,0,.16)) drop-shadow(0 1.5rem 1rem rgba(0,0,0,.03)) drop-shadow(0 .75rem .75rem rgba(0,0,0,.04)) drop-shadow(0 .25rem .375rem rgba(0,0,0,.05))}:host:not([style*=\"top\"]){visibility:hidden}:host._untouchable{pointer-events:none}\n"], directives: [{ type: i1__namespace.PolymorpheusOutletDirective, selector: "[polymorpheusOutlet]", inputs: ["polymorpheusOutlet", "polymorpheusOutletContext"] }], animations: [animations.tuiFadeIn], changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush });
|
|
685
798
|
__decorate([
|
|
686
799
|
i3.tuiPure
|
|
@@ -696,8 +809,8 @@
|
|
|
696
809
|
i3.TuiDestroyService,
|
|
697
810
|
i2.TuiPositionService,
|
|
698
811
|
i3.TuiHoveredService,
|
|
699
|
-
|
|
700
|
-
|
|
812
|
+
i1$1.tuiPositionAccessorFor('hint', TuiHintPositionDirective),
|
|
813
|
+
i1$1.tuiRectAccessorFor('hint', TuiHintDirective),
|
|
701
814
|
],
|
|
702
815
|
animations: [animations.tuiFadeIn],
|
|
703
816
|
host: {
|
|
@@ -725,9 +838,9 @@
|
|
|
725
838
|
}, {
|
|
726
839
|
type: i0.Inject,
|
|
727
840
|
args: [TuiHintPointerDirective]
|
|
728
|
-
}] }, { type:
|
|
841
|
+
}] }, { type: i1__namespace$1.TuiRectAccessor, decorators: [{
|
|
729
842
|
type: i0.Inject,
|
|
730
|
-
args: [
|
|
843
|
+
args: [i1$1.TuiRectAccessor]
|
|
731
844
|
}] }, { type: i0__namespace.ElementRef, decorators: [{
|
|
732
845
|
type: i0.Inject,
|
|
733
846
|
args: [i0.ElementRef]
|
|
@@ -745,7 +858,7 @@
|
|
|
745
858
|
}] }, { type: i2__namespace.TuiVisualViewportService, decorators: [{
|
|
746
859
|
type: i0.Inject,
|
|
747
860
|
args: [i2.TuiVisualViewportService]
|
|
748
|
-
}] }, { type:
|
|
861
|
+
}] }, { type: i1__namespace$1.TuiRectAccessor, decorators: [{
|
|
749
862
|
type: i0.Inject,
|
|
750
863
|
args: [tokens.TUI_VIEWPORT]
|
|
751
864
|
}] }];
|
|
@@ -792,9 +905,9 @@
|
|
|
792
905
|
configurable: true
|
|
793
906
|
});
|
|
794
907
|
return TuiHintDescribeDirective;
|
|
795
|
-
}(
|
|
908
|
+
}(i1$1.TuiDriver));
|
|
796
909
|
TuiHintDescribeDirective.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: TuiHintDescribeDirective, deps: [{ token: i0.NgZone }, { token: common.DOCUMENT }, { token: i0.ElementRef }], target: i0__namespace.ɵɵFactoryTarget.Directive });
|
|
797
|
-
TuiHintDescribeDirective.ɵdir = i0__namespace.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.17", type: TuiHintDescribeDirective, selector: "[tuiHintDescribe]", inputs: { tuiHintDescribe: "tuiHintDescribe" }, providers: [
|
|
910
|
+
TuiHintDescribeDirective.ɵdir = i0__namespace.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.17", type: TuiHintDescribeDirective, selector: "[tuiHintDescribe]", inputs: { tuiHintDescribe: "tuiHintDescribe" }, providers: [i1$1.tuiAsDriver(TuiHintDescribeDirective)], usesInheritance: true, usesOnChanges: true, ngImport: i0__namespace });
|
|
798
911
|
__decorate([
|
|
799
912
|
i3.tuiPure
|
|
800
913
|
], TuiHintDescribeDirective.prototype, "element", null);
|
|
@@ -802,7 +915,7 @@
|
|
|
802
915
|
type: i0.Directive,
|
|
803
916
|
args: [{
|
|
804
917
|
selector: '[tuiHintDescribe]',
|
|
805
|
-
providers: [
|
|
918
|
+
providers: [i1$1.tuiAsDriver(TuiHintDescribeDirective)],
|
|
806
919
|
}]
|
|
807
920
|
}], ctorParameters: function () {
|
|
808
921
|
return [{ type: i0__namespace.NgZone, decorators: [{
|
|
@@ -828,8 +941,8 @@
|
|
|
828
941
|
return _this;
|
|
829
942
|
}
|
|
830
943
|
return TuiHintDriverDirective;
|
|
831
|
-
}(
|
|
832
|
-
TuiHintDriverDirective.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: TuiHintDriverDirective, deps: [{ token: i3.TuiDestroyService, self: true }, { token:
|
|
944
|
+
}(i1$1.AbstractTuiDriverDirective));
|
|
945
|
+
TuiHintDriverDirective.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: TuiHintDriverDirective, deps: [{ token: i3.TuiDestroyService, self: true }, { token: i1$1.TuiDriver }, { token: i1$1.TuiVehicle }], target: i0__namespace.ɵɵFactoryTarget.Directive });
|
|
833
946
|
TuiHintDriverDirective.ɵdir = i0__namespace.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.17", type: TuiHintDriverDirective, selector: "[tuiHint]:not(ng-container):not(ng-template)", providers: [i3.TuiDestroyService], usesInheritance: true, ngImport: i0__namespace });
|
|
834
947
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: TuiHintDriverDirective, decorators: [{
|
|
835
948
|
type: i0.Directive,
|
|
@@ -845,10 +958,10 @@
|
|
|
845
958
|
args: [i3.TuiDestroyService]
|
|
846
959
|
}] }, { type: undefined, decorators: [{
|
|
847
960
|
type: i0.Inject,
|
|
848
|
-
args: [
|
|
961
|
+
args: [i1$1.TuiDriver]
|
|
849
962
|
}] }, { type: undefined, decorators: [{
|
|
850
963
|
type: i0.Inject,
|
|
851
|
-
args: [
|
|
964
|
+
args: [i1$1.TuiVehicle]
|
|
852
965
|
}] }];
|
|
853
966
|
} });
|
|
854
967
|
|
|
@@ -864,14 +977,14 @@
|
|
|
864
977
|
return ((_a = this.tuiHintHost) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect()) || i3.EMPTY_CLIENT_RECT;
|
|
865
978
|
};
|
|
866
979
|
return TuiHintHostDirective;
|
|
867
|
-
}(
|
|
980
|
+
}(i1$1.TuiRectAccessor));
|
|
868
981
|
TuiHintHostDirective.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: TuiHintHostDirective, deps: null, target: i0__namespace.ɵɵFactoryTarget.Directive });
|
|
869
|
-
TuiHintHostDirective.ɵdir = i0__namespace.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.17", type: TuiHintHostDirective, selector: "[tuiHint][tuiHintHost]", inputs: { tuiHintHost: "tuiHintHost" }, providers: [
|
|
982
|
+
TuiHintHostDirective.ɵdir = i0__namespace.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.17", type: TuiHintHostDirective, selector: "[tuiHint][tuiHintHost]", inputs: { tuiHintHost: "tuiHintHost" }, providers: [i1$1.tuiAsRectAccessor(TuiHintHostDirective)], usesInheritance: true, ngImport: i0__namespace });
|
|
870
983
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: TuiHintHostDirective, decorators: [{
|
|
871
984
|
type: i0.Directive,
|
|
872
985
|
args: [{
|
|
873
986
|
selector: '[tuiHint][tuiHintHost]',
|
|
874
|
-
providers: [
|
|
987
|
+
providers: [i1$1.tuiAsRectAccessor(TuiHintHostDirective)],
|
|
875
988
|
}]
|
|
876
989
|
}], propDecorators: { tuiHintHost: [{
|
|
877
990
|
type: i0.Input
|
|
@@ -891,14 +1004,14 @@
|
|
|
891
1004
|
this.stream$.next(this.tuiHintManual);
|
|
892
1005
|
};
|
|
893
1006
|
return TuiHintManualDirective;
|
|
894
|
-
}(
|
|
1007
|
+
}(i1$1.TuiDriver));
|
|
895
1008
|
TuiHintManualDirective.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: TuiHintManualDirective, deps: [{ token: TuiHintHoverDirective }], target: i0__namespace.ɵɵFactoryTarget.Directive });
|
|
896
|
-
TuiHintManualDirective.ɵdir = i0__namespace.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.17", type: TuiHintManualDirective, selector: "[tuiHint][tuiHintManual]", inputs: { tuiHintManual: "tuiHintManual" }, providers: [
|
|
1009
|
+
TuiHintManualDirective.ɵdir = i0__namespace.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.17", type: TuiHintManualDirective, selector: "[tuiHint][tuiHintManual]", inputs: { tuiHintManual: "tuiHintManual" }, providers: [i1$1.tuiAsDriver(TuiHintManualDirective)], usesInheritance: true, usesOnChanges: true, ngImport: i0__namespace });
|
|
897
1010
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: TuiHintManualDirective, decorators: [{
|
|
898
1011
|
type: i0.Directive,
|
|
899
1012
|
args: [{
|
|
900
1013
|
selector: '[tuiHint][tuiHintManual]',
|
|
901
|
-
providers: [
|
|
1014
|
+
providers: [i1$1.tuiAsDriver(TuiHintManualDirective)],
|
|
902
1015
|
}]
|
|
903
1016
|
}], ctorParameters: function () {
|
|
904
1017
|
return [{ type: TuiHintHoverDirective, decorators: [{
|
|
@@ -909,120 +1022,6 @@
|
|
|
909
1022
|
type: i0.Input
|
|
910
1023
|
}] } });
|
|
911
1024
|
|
|
912
|
-
var OFFSET = 8;
|
|
913
|
-
var ARROW_OFFSET = 22;
|
|
914
|
-
var TOP = 0;
|
|
915
|
-
var LEFT = 1;
|
|
916
|
-
var TuiHintPositionDirective = /** @class */ (function (_super) {
|
|
917
|
-
__extends(TuiHintPositionDirective, _super);
|
|
918
|
-
function TuiHintPositionDirective(options, viewport, directive, accessors) {
|
|
919
|
-
var _this = _super.call(this) || this;
|
|
920
|
-
_this.options = options;
|
|
921
|
-
_this.viewport = viewport;
|
|
922
|
-
_this.directive = directive;
|
|
923
|
-
_this.accessors = accessors;
|
|
924
|
-
_this.points = constants.TUI_HINT_DIRECTIONS.reduce(function (acc, direction) {
|
|
925
|
-
var _c;
|
|
926
|
-
return (Object.assign(Object.assign({}, acc), (_c = {}, _c[direction] = [0, 0], _c)));
|
|
927
|
-
}, {});
|
|
928
|
-
_this.direction = _this.options.direction;
|
|
929
|
-
_this.type = 'hint';
|
|
930
|
-
return _this;
|
|
931
|
-
}
|
|
932
|
-
TuiHintPositionDirective.prototype.getPosition = function (_c) {
|
|
933
|
-
var _this = this;
|
|
934
|
-
var width = _c.width, height = _c.height;
|
|
935
|
-
var _a, _b;
|
|
936
|
-
var hostRect = (_b = (_a = this.accessor) === null || _a === void 0 ? void 0 : _a.getClientRect()) !== null && _b !== void 0 ? _b : i3.EMPTY_CLIENT_RECT;
|
|
937
|
-
var leftCenter = hostRect.left + hostRect.width / 2;
|
|
938
|
-
var topCenter = hostRect.top + hostRect.height / 2;
|
|
939
|
-
this.points['top-left'][TOP] = hostRect.top - height - OFFSET;
|
|
940
|
-
this.points['top-left'][LEFT] = leftCenter - width + ARROW_OFFSET;
|
|
941
|
-
this.points.top[TOP] = this.points['top-left'][TOP];
|
|
942
|
-
this.points.top[LEFT] = leftCenter - width / 2;
|
|
943
|
-
this.points['top-right'][TOP] = this.points['top-left'][TOP];
|
|
944
|
-
this.points['top-right'][LEFT] = leftCenter - ARROW_OFFSET;
|
|
945
|
-
this.points['bottom-left'][TOP] = hostRect.bottom + OFFSET;
|
|
946
|
-
this.points['bottom-left'][LEFT] = this.points['top-left'][LEFT];
|
|
947
|
-
this.points.bottom[TOP] = this.points['bottom-left'][TOP];
|
|
948
|
-
this.points.bottom[LEFT] = this.points.top[LEFT];
|
|
949
|
-
this.points['bottom-right'][TOP] = this.points['bottom-left'][TOP];
|
|
950
|
-
this.points['bottom-right'][LEFT] = this.points['top-right'][LEFT];
|
|
951
|
-
this.points['left-top'][TOP] = topCenter - height + ARROW_OFFSET;
|
|
952
|
-
this.points['left-top'][LEFT] = hostRect.left - width - OFFSET;
|
|
953
|
-
this.points.left[TOP] = topCenter - height / 2;
|
|
954
|
-
this.points.left[LEFT] = this.points['left-top'][LEFT];
|
|
955
|
-
this.points['left-bottom'][TOP] = topCenter - ARROW_OFFSET;
|
|
956
|
-
this.points['left-bottom'][LEFT] = this.points['left-top'][LEFT];
|
|
957
|
-
this.points['right-top'][TOP] = this.points['left-top'][TOP];
|
|
958
|
-
this.points['right-top'][LEFT] = hostRect.right + OFFSET;
|
|
959
|
-
this.points.right[TOP] = this.points.left[TOP];
|
|
960
|
-
this.points.right[LEFT] = this.points['right-top'][LEFT];
|
|
961
|
-
this.points['right-bottom'][TOP] = this.points['left-bottom'][TOP];
|
|
962
|
-
this.points['right-bottom'][LEFT] = this.points['right-top'][LEFT];
|
|
963
|
-
if (this.checkPosition(this.points[this.direction], width, height)) {
|
|
964
|
-
return this.points[this.direction];
|
|
965
|
-
}
|
|
966
|
-
var direction = constants.TUI_HINT_DIRECTIONS.find(function (direction) { return _this.checkPosition(_this.points[direction], width, height); });
|
|
967
|
-
return this.points[direction || this.fallback];
|
|
968
|
-
};
|
|
969
|
-
Object.defineProperty(TuiHintPositionDirective.prototype, "accessor", {
|
|
970
|
-
get: function () {
|
|
971
|
-
return i3$1.tuiFallbackRectAccessor('hint')(this.accessors, this.directive);
|
|
972
|
-
},
|
|
973
|
-
enumerable: false,
|
|
974
|
-
configurable: true
|
|
975
|
-
});
|
|
976
|
-
Object.defineProperty(TuiHintPositionDirective.prototype, "fallback", {
|
|
977
|
-
get: function () {
|
|
978
|
-
return this.points.top[TOP] >
|
|
979
|
-
this.viewport.getClientRect().bottom - this.points.bottom[TOP]
|
|
980
|
-
? 'top'
|
|
981
|
-
: 'bottom';
|
|
982
|
-
},
|
|
983
|
-
enumerable: false,
|
|
984
|
-
configurable: true
|
|
985
|
-
});
|
|
986
|
-
TuiHintPositionDirective.prototype.checkPosition = function (_c, width, height) {
|
|
987
|
-
var _d = __read(_c, 2), top = _d[0], left = _d[1];
|
|
988
|
-
var viewport = this.viewport.getClientRect();
|
|
989
|
-
return (top > OFFSET &&
|
|
990
|
-
left > OFFSET &&
|
|
991
|
-
top + height < viewport.bottom - OFFSET &&
|
|
992
|
-
left + width < viewport.right - OFFSET);
|
|
993
|
-
};
|
|
994
|
-
return TuiHintPositionDirective;
|
|
995
|
-
}(i3$1.TuiPositionAccessor));
|
|
996
|
-
TuiHintPositionDirective.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: TuiHintPositionDirective, deps: [{ token: TUI_HINT_OPTIONS }, { token: tokens.TUI_VIEWPORT }, { token: TuiHintDirective }, { token: i3$1.TuiRectAccessor }], target: i0__namespace.ɵɵFactoryTarget.Directive });
|
|
997
|
-
TuiHintPositionDirective.ɵdir = i0__namespace.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.17", type: TuiHintPositionDirective, selector: "[tuiHint]:not([tuiHintCustomPosition]):not(ng-container):not(ng-template)", inputs: { direction: ["tuiHintDirection", "direction"] }, providers: [i3$1.tuiAsPositionAccessor(TuiHintPositionDirective)], usesInheritance: true, ngImport: i0__namespace });
|
|
998
|
-
__decorate([
|
|
999
|
-
i3.tuiPure
|
|
1000
|
-
], TuiHintPositionDirective.prototype, "accessor", null);
|
|
1001
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: TuiHintPositionDirective, decorators: [{
|
|
1002
|
-
type: i0.Directive,
|
|
1003
|
-
args: [{
|
|
1004
|
-
selector: '[tuiHint]:not([tuiHintCustomPosition]):not(ng-container):not(ng-template)',
|
|
1005
|
-
providers: [i3$1.tuiAsPositionAccessor(TuiHintPositionDirective)],
|
|
1006
|
-
}]
|
|
1007
|
-
}], ctorParameters: function () {
|
|
1008
|
-
return [{ type: undefined, decorators: [{
|
|
1009
|
-
type: i0.Inject,
|
|
1010
|
-
args: [TUI_HINT_OPTIONS]
|
|
1011
|
-
}] }, { type: i3__namespace$1.TuiRectAccessor, decorators: [{
|
|
1012
|
-
type: i0.Inject,
|
|
1013
|
-
args: [tokens.TUI_VIEWPORT]
|
|
1014
|
-
}] }, { type: i3__namespace$1.TuiRectAccessor, decorators: [{
|
|
1015
|
-
type: i0.Inject,
|
|
1016
|
-
args: [TuiHintDirective]
|
|
1017
|
-
}] }, { type: undefined, decorators: [{
|
|
1018
|
-
type: i0.Inject,
|
|
1019
|
-
args: [i3$1.TuiRectAccessor]
|
|
1020
|
-
}] }];
|
|
1021
|
-
}, propDecorators: { direction: [{
|
|
1022
|
-
type: i0.Input,
|
|
1023
|
-
args: ['tuiHintDirection']
|
|
1024
|
-
}], accessor: [] } });
|
|
1025
|
-
|
|
1026
1025
|
var TuiHintUnstyledComponent = /** @class */ (function () {
|
|
1027
1026
|
function TuiHintUnstyledComponent(context) {
|
|
1028
1027
|
this.context = context;
|