@evotor-dev/ui-kit 6.17.1 → 6.17.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundles/evotor-dev-ui-kit.umd.js +379 -0
- package/bundles/evotor-dev-ui-kit.umd.js.map +1 -1
- package/esm2015/lib/components/evo-navigation-tabs/evo-navigation-tab.directive.js +52 -0
- package/esm2015/lib/components/evo-navigation-tabs/evo-navigation-tabs.component.js +112 -0
- package/esm2015/lib/components/evo-navigation-tabs/evo-navigation-tabs.module.js +20 -0
- package/esm2015/lib/components/evo-navigation-tabs/index.js +2 -0
- package/esm2015/lib/components/evo-navigation-tabs/public-api.js +5 -0
- package/esm2015/lib/components/evo-navigation-tabs/types/evo-navigation-tabs-size.js +2 -0
- package/esm2015/lib/services/mutation-observer.service.js +59 -0
- package/esm2015/lib/services/router-link-active.service.js +41 -0
- package/esm2015/lib/utils/observables/zone-free.js +64 -0
- package/esm2015/lib/utils/tokens/animation-frame.js +27 -0
- package/esm2015/public_api.js +2 -1
- package/fesm2015/evotor-dev-ui-kit.js +341 -5
- package/fesm2015/evotor-dev-ui-kit.js.map +1 -1
- package/lib/components/evo-navigation-tabs/evo-navigation-tab.directive.d.ts +19 -0
- package/lib/components/evo-navigation-tabs/evo-navigation-tabs.component.d.ts +32 -0
- package/lib/components/evo-navigation-tabs/evo-navigation-tabs.module.d.ts +10 -0
- package/lib/components/evo-navigation-tabs/index.d.ts +1 -0
- package/lib/components/evo-navigation-tabs/public-api.d.ts +4 -0
- package/lib/components/evo-navigation-tabs/types/evo-navigation-tabs-size.d.ts +1 -0
- package/lib/services/mutation-observer.service.d.ts +34 -0
- package/lib/services/router-link-active.service.d.ts +16 -0
- package/lib/utils/observables/zone-free.d.ts +54 -0
- package/lib/utils/tokens/animation-frame.d.ts +10 -0
- package/package.json +1 -1
- package/public_api.d.ts +1 -0
|
@@ -9537,6 +9537,381 @@
|
|
|
9537
9537
|
}]
|
|
9538
9538
|
}] });
|
|
9539
9539
|
|
|
9540
|
+
/**
|
|
9541
|
+
* Токен `ANIMATION_FRAME` предоставляет поток значений времени из `requestAnimationFrame`,
|
|
9542
|
+
* испускаемый каждый кадр анимации.
|
|
9543
|
+
*
|
|
9544
|
+
* Может быть полезен для задач, которые требуют частого обновления, например, отслеживания
|
|
9545
|
+
* активности или плавной анимации в UI.
|
|
9546
|
+
*/
|
|
9547
|
+
var ANIMATION_FRAME = new i0.InjectionToken('[ANIMATION_FRAME]', {
|
|
9548
|
+
factory: function () {
|
|
9549
|
+
var animationFrame$ = new i3.Observable(function (subscriber) {
|
|
9550
|
+
var id = NaN;
|
|
9551
|
+
var callback = function (timestamp) {
|
|
9552
|
+
subscriber.next(timestamp);
|
|
9553
|
+
id = requestAnimationFrame(callback);
|
|
9554
|
+
};
|
|
9555
|
+
id = requestAnimationFrame(callback);
|
|
9556
|
+
return function () {
|
|
9557
|
+
cancelAnimationFrame(id);
|
|
9558
|
+
};
|
|
9559
|
+
});
|
|
9560
|
+
return animationFrame$.pipe(operators.share());
|
|
9561
|
+
},
|
|
9562
|
+
});
|
|
9563
|
+
|
|
9564
|
+
/**
|
|
9565
|
+
* Кратко:
|
|
9566
|
+
* 🔥 evoZonefull — тащит всё в Angular-зону.
|
|
9567
|
+
* 🧊 evoZonefree — игнорирует Angular-зону, экономит CD.
|
|
9568
|
+
* ⚖️ evoZoneOptimized — как утро с кофе: просыпаешься вовремя и не дергаешь лишний раз change detection.
|
|
9569
|
+
*/
|
|
9570
|
+
/**
|
|
9571
|
+
* Оператор `evoZonefull` обеспечивает полное выполнение потока внутри зоны Angular.
|
|
9572
|
+
*
|
|
9573
|
+
* Все `next`, `error` и `complete` вызовы оборачиваются в `NgZone.run`, чтобы гарантировать
|
|
9574
|
+
* корректный запуск change detection.
|
|
9575
|
+
*
|
|
9576
|
+
* Используй, если поток формируется вне зоны или ты не уверен, что Angular узнает об изменениях.
|
|
9577
|
+
*
|
|
9578
|
+
* @param zone Сервис `NgZone` из Angular DI.
|
|
9579
|
+
* @returns Оператор, оборачивающий поток в `NgZone.run()`.
|
|
9580
|
+
*
|
|
9581
|
+
* @example
|
|
9582
|
+
* source$.pipe(evoZonefull(this.ngZone)).subscribe(...);
|
|
9583
|
+
*/
|
|
9584
|
+
function evoZonefull(zone) {
|
|
9585
|
+
return function (source) { return new i3.Observable(function (subscriber) { return source.subscribe({
|
|
9586
|
+
next: function (value) { return zone.run(function () { return subscriber.next(value); }); },
|
|
9587
|
+
error: function (error) { return zone.run(function () { return subscriber.error(error); }); },
|
|
9588
|
+
complete: function () { return zone.run(function () { return subscriber.complete(); }); },
|
|
9589
|
+
}); }); };
|
|
9590
|
+
}
|
|
9591
|
+
/**
|
|
9592
|
+
* Оператор `evoZonefree` исполняет весь поток вне зоны Angular.
|
|
9593
|
+
*
|
|
9594
|
+
* Это помогает избежать лишних срабатываний change detection и повысить производительность,
|
|
9595
|
+
* особенно для часто испускаемых потоков (например, `scroll`, `animationFrame`, таймеры).
|
|
9596
|
+
*
|
|
9597
|
+
* Используй, если тебе не нужно обновлять Angular view внутри этого потока.
|
|
9598
|
+
*
|
|
9599
|
+
* @param zone Сервис `NgZone` из Angular DI.
|
|
9600
|
+
* @returns Оператор, исполняющий подписку вне Angular-зоны.
|
|
9601
|
+
*
|
|
9602
|
+
* @example
|
|
9603
|
+
* source$.pipe(evoZonefree(this.ngZone)).subscribe(...);
|
|
9604
|
+
*/
|
|
9605
|
+
function evoZonefree(zone) {
|
|
9606
|
+
return function (source) { return new i3.Observable(function (subscriber) { return zone.runOutsideAngular(function () { return source.subscribe(subscriber); }); }); };
|
|
9607
|
+
}
|
|
9608
|
+
/**
|
|
9609
|
+
* Оператор `evoZoneOptimized` — комбо из `evoZonefree` и `evoZonefull`.
|
|
9610
|
+
*
|
|
9611
|
+
* Сначала поток исполняется вне Angular-зоны (`runOutsideAngular`), чтобы избежать лишнего
|
|
9612
|
+
* change detection. Но события `next`, `error` и `complete` всё равно возвращаются в Angular-зону.
|
|
9613
|
+
*
|
|
9614
|
+
* Это идеальный баланс, если тебе нужен быстрый поток без лишнего CD, но ты всё равно хочешь,
|
|
9615
|
+
* чтобы Angular знал о результатах.
|
|
9616
|
+
*
|
|
9617
|
+
* @param zone Сервис `NgZone` из Angular DI.
|
|
9618
|
+
* @returns Оператор, оптимизированный по производительности.
|
|
9619
|
+
*
|
|
9620
|
+
* @example
|
|
9621
|
+
* source$.pipe(evoZoneOptimized(this.ngZone)).subscribe(...);
|
|
9622
|
+
*/
|
|
9623
|
+
function evoZoneOptimized(zone) {
|
|
9624
|
+
return i3.pipe(evoZonefree(zone), evoZonefull(zone));
|
|
9625
|
+
}
|
|
9626
|
+
|
|
9627
|
+
/**
|
|
9628
|
+
* Сервис создает поток, отслеживающий состояние активности
|
|
9629
|
+
* `RouterLinkActive` в реальном времени с использованием `requestAnimationFrame`.
|
|
9630
|
+
*
|
|
9631
|
+
* Наследуется от `Observable<boolean>` и эмитит `true` или `false`, когда состояние `isActive`
|
|
9632
|
+
* меняется. Если `RouterLinkActive` не передан — поток будет пустым (`EMPTY`).
|
|
9633
|
+
*/
|
|
9634
|
+
var RouterLinkActiveService = /** @class */ (function (_super) {
|
|
9635
|
+
__extends(RouterLinkActiveService, _super);
|
|
9636
|
+
function RouterLinkActiveService(routerLinkActive, ngZone, animationFrame$) {
|
|
9637
|
+
var _this = this;
|
|
9638
|
+
var stream$ = routerLinkActive
|
|
9639
|
+
? i3.merge(i3.timer(0), animationFrame$).pipe(operators.map(function () { return routerLinkActive.isActive; }), operators.distinctUntilChanged(), evoZoneOptimized(ngZone))
|
|
9640
|
+
: i3.EMPTY;
|
|
9641
|
+
_this = _super.call(this, function (subscriber) { return stream$.subscribe(subscriber); }) || this;
|
|
9642
|
+
return _this;
|
|
9643
|
+
}
|
|
9644
|
+
return RouterLinkActiveService;
|
|
9645
|
+
}(i3.Observable));
|
|
9646
|
+
RouterLinkActiveService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: RouterLinkActiveService, deps: [{ token: i3$2.RouterLinkActive, optional: true }, { token: i0.NgZone }, { token: ANIMATION_FRAME }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
9647
|
+
RouterLinkActiveService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: RouterLinkActiveService });
|
|
9648
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: RouterLinkActiveService, decorators: [{
|
|
9649
|
+
type: i0.Injectable
|
|
9650
|
+
}], ctorParameters: function () {
|
|
9651
|
+
return [{ type: i3__namespace$2.RouterLinkActive, decorators: [{
|
|
9652
|
+
type: i0.Optional
|
|
9653
|
+
}, {
|
|
9654
|
+
type: i0.Inject,
|
|
9655
|
+
args: [i3$2.RouterLinkActive]
|
|
9656
|
+
}] }, { type: i0__namespace.NgZone, decorators: [{
|
|
9657
|
+
type: i0.Inject,
|
|
9658
|
+
args: [i0.NgZone]
|
|
9659
|
+
}] }, { type: i3__namespace$3.Observable, decorators: [{
|
|
9660
|
+
type: i0.Inject,
|
|
9661
|
+
args: [ANIMATION_FRAME]
|
|
9662
|
+
}] }];
|
|
9663
|
+
} });
|
|
9664
|
+
|
|
9665
|
+
/**
|
|
9666
|
+
* Безопасная обёртка над `MutationObserver`, которая гарантирует,
|
|
9667
|
+
* что код не упадёт в средах, где `MutationObserver` недоступен
|
|
9668
|
+
* (например, серверный рендеринг или тесты без DOM).
|
|
9669
|
+
*
|
|
9670
|
+
* Если `MutationObserver` существует — используется он.
|
|
9671
|
+
* Если нет — используется заглушка с пустыми методами.
|
|
9672
|
+
*/
|
|
9673
|
+
var SafeObserver = typeof MutationObserver !== 'undefined'
|
|
9674
|
+
? MutationObserver
|
|
9675
|
+
: /** @class */ (function () {
|
|
9676
|
+
function class_1() {
|
|
9677
|
+
}
|
|
9678
|
+
class_1.prototype.observe = function () { };
|
|
9679
|
+
class_1.prototype.disconnect = function () { };
|
|
9680
|
+
class_1.prototype.takeRecords = function () {
|
|
9681
|
+
return [];
|
|
9682
|
+
};
|
|
9683
|
+
return class_1;
|
|
9684
|
+
}());
|
|
9685
|
+
/**
|
|
9686
|
+
* Сервис `MutationObserverService` предоставляет поток `Observable<MutationRecord[]>`,
|
|
9687
|
+
* который эмитит записи изменений DOM для текущего элемента (`ElementRef`).
|
|
9688
|
+
*
|
|
9689
|
+
* Наблюдает за изменениями потомков, текстового содержимого и вложенных структур (`subtree: true`).
|
|
9690
|
+
*
|
|
9691
|
+
* Используется `SafeObserver`, чтобы гарантировать совместимость с SSR и тестовой средой.
|
|
9692
|
+
*
|
|
9693
|
+
* ⚠️ Важно: требует, чтобы `ElementRef` был доступен через DI-контекст (т.е. работает в компонентах/директивах).
|
|
9694
|
+
*
|
|
9695
|
+
* @example
|
|
9696
|
+
* this.mutationObserverService.subscribe(records => {
|
|
9697
|
+
* console.log('Mutation detected!', records);
|
|
9698
|
+
* });
|
|
9699
|
+
*/
|
|
9700
|
+
var MutationObserverService = /** @class */ (function (_super) {
|
|
9701
|
+
__extends(MutationObserverService, _super);
|
|
9702
|
+
function MutationObserverService() {
|
|
9703
|
+
var _this = this;
|
|
9704
|
+
var nativeElement = i0.inject(i0.ElementRef).nativeElement;
|
|
9705
|
+
_this = _super.call(this, function (subscriber) {
|
|
9706
|
+
var observer = new SafeObserver(function (records) {
|
|
9707
|
+
subscriber.next(records);
|
|
9708
|
+
});
|
|
9709
|
+
observer.observe(nativeElement, {
|
|
9710
|
+
childList: true,
|
|
9711
|
+
characterData: true,
|
|
9712
|
+
subtree: true,
|
|
9713
|
+
});
|
|
9714
|
+
return function () {
|
|
9715
|
+
observer.disconnect();
|
|
9716
|
+
};
|
|
9717
|
+
}) || this;
|
|
9718
|
+
return _this;
|
|
9719
|
+
}
|
|
9720
|
+
return MutationObserverService;
|
|
9721
|
+
}(i3.Observable));
|
|
9722
|
+
MutationObserverService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: MutationObserverService, deps: [], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
9723
|
+
MutationObserverService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: MutationObserverService });
|
|
9724
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: MutationObserverService, decorators: [{
|
|
9725
|
+
type: i0.Injectable
|
|
9726
|
+
}], ctorParameters: function () { return []; } });
|
|
9727
|
+
|
|
9728
|
+
var EVO_TAB_ACTIVATE = 'evo-tab-activate';
|
|
9729
|
+
var EvoNavigationTabDirective = /** @class */ (function () {
|
|
9730
|
+
function EvoNavigationTabDirective(el, routerLinkActiveService, rla, mutation) {
|
|
9731
|
+
this.el = el;
|
|
9732
|
+
this.routerLinkActiveService = routerLinkActiveService;
|
|
9733
|
+
this.rla = rla;
|
|
9734
|
+
this.mutation = mutation;
|
|
9735
|
+
this.tabClass = true;
|
|
9736
|
+
this.destroy$ = new i3.Subject();
|
|
9737
|
+
this.initSubscriptions();
|
|
9738
|
+
}
|
|
9739
|
+
EvoNavigationTabDirective.prototype.ngOnDestroy = function () {
|
|
9740
|
+
this.destroy$.next();
|
|
9741
|
+
this.destroy$.complete();
|
|
9742
|
+
};
|
|
9743
|
+
EvoNavigationTabDirective.prototype.initSubscriptions = function () {
|
|
9744
|
+
var _this = this;
|
|
9745
|
+
var mutationObserver = this.rla && this.mutation ? this.mutation.pipe(operators.filter(function () { return _this.rla.isActive; })) : i3.EMPTY;
|
|
9746
|
+
i3.merge(mutationObserver, this.routerLinkActiveService.pipe(operators.filter(function (r) { return r; })), i3.fromEvent(this.el.nativeElement, 'click').pipe(
|
|
9747
|
+
// Delaying execution until after all other click callbacks
|
|
9748
|
+
operators.switchMap(function () { return i3.fromEvent(_this.el.nativeElement.parentElement, 'click').pipe(operators.take(1)); })))
|
|
9749
|
+
.pipe(operators.tap(function () {
|
|
9750
|
+
_this.el.nativeElement.dispatchEvent(new CustomEvent(EVO_TAB_ACTIVATE, { bubbles: true }));
|
|
9751
|
+
}), operators.takeUntil(this.destroy$))
|
|
9752
|
+
.subscribe();
|
|
9753
|
+
};
|
|
9754
|
+
return EvoNavigationTabDirective;
|
|
9755
|
+
}());
|
|
9756
|
+
EvoNavigationTabDirective.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: EvoNavigationTabDirective, deps: [{ token: i0__namespace.ElementRef }, { token: RouterLinkActiveService }, { token: i3__namespace$2.RouterLinkActive, optional: true }, { token: MutationObserverService, optional: true }], target: i0__namespace.ɵɵFactoryTarget.Directive });
|
|
9757
|
+
EvoNavigationTabDirective.ɵdir = i0__namespace.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.17", type: EvoNavigationTabDirective, selector: "button[evoNavigationTab]:not([routerLink]), button[evoNavigationTab][routerLink][routerLinkActive]", host: { properties: { "class.evo-navigation-tab": "this.tabClass" } }, providers: [MutationObserverService, RouterLinkActiveService], ngImport: i0__namespace });
|
|
9758
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: EvoNavigationTabDirective, decorators: [{
|
|
9759
|
+
type: i0.Directive,
|
|
9760
|
+
args: [{
|
|
9761
|
+
selector: 'button[evoNavigationTab]:not([routerLink]), button[evoNavigationTab][routerLink][routerLinkActive]',
|
|
9762
|
+
providers: [MutationObserverService, RouterLinkActiveService],
|
|
9763
|
+
}]
|
|
9764
|
+
}], ctorParameters: function () {
|
|
9765
|
+
return [{ type: i0__namespace.ElementRef }, { type: RouterLinkActiveService }, { type: i3__namespace$2.RouterLinkActive, decorators: [{
|
|
9766
|
+
type: i0.Optional
|
|
9767
|
+
}] }, { type: MutationObserverService, decorators: [{
|
|
9768
|
+
type: i0.Optional
|
|
9769
|
+
}] }];
|
|
9770
|
+
}, propDecorators: { tabClass: [{
|
|
9771
|
+
type: i0.HostBinding,
|
|
9772
|
+
args: ['class.evo-navigation-tab']
|
|
9773
|
+
}] } });
|
|
9774
|
+
|
|
9775
|
+
var EvoNavigationTabsComponent = /** @class */ (function () {
|
|
9776
|
+
function EvoNavigationTabsComponent(el) {
|
|
9777
|
+
this.el = el;
|
|
9778
|
+
this.tabs = [];
|
|
9779
|
+
this.size = 'normal';
|
|
9780
|
+
this.activeItemIndexChange = new i0.EventEmitter();
|
|
9781
|
+
this.disabled = false;
|
|
9782
|
+
this.activeIndex = 0;
|
|
9783
|
+
this.disabledSubject$ = new i3.Subject();
|
|
9784
|
+
this.nextRenderSubject$ = new i3.Subject();
|
|
9785
|
+
this.destroy$ = new i3.Subject();
|
|
9786
|
+
this.initSubscriptions();
|
|
9787
|
+
}
|
|
9788
|
+
Object.defineProperty(EvoNavigationTabsComponent.prototype, "setActiveIndex", {
|
|
9789
|
+
set: function (index) {
|
|
9790
|
+
this.activeIndex = index;
|
|
9791
|
+
this.markTabAsActive();
|
|
9792
|
+
},
|
|
9793
|
+
enumerable: false,
|
|
9794
|
+
configurable: true
|
|
9795
|
+
});
|
|
9796
|
+
Object.defineProperty(EvoNavigationTabsComponent.prototype, "setDisabled", {
|
|
9797
|
+
set: function (disabled) {
|
|
9798
|
+
this.disabled = disabled;
|
|
9799
|
+
this.disabledSubject$.next(disabled);
|
|
9800
|
+
},
|
|
9801
|
+
enumerable: false,
|
|
9802
|
+
configurable: true
|
|
9803
|
+
});
|
|
9804
|
+
EvoNavigationTabsComponent.prototype.ngAfterViewInit = function () {
|
|
9805
|
+
this.markTabAsActive();
|
|
9806
|
+
};
|
|
9807
|
+
EvoNavigationTabsComponent.prototype.ngAfterViewChecked = function () {
|
|
9808
|
+
this.nextRenderSubject$.next();
|
|
9809
|
+
};
|
|
9810
|
+
EvoNavigationTabsComponent.prototype.ngOnDestroy = function () {
|
|
9811
|
+
this.destroy$.next();
|
|
9812
|
+
this.destroy$.complete();
|
|
9813
|
+
};
|
|
9814
|
+
EvoNavigationTabsComponent.prototype.onActivate = function (event, element) {
|
|
9815
|
+
var index = this.tabsList.findIndex(function (tab) { return tab === element; });
|
|
9816
|
+
event.stopPropagation();
|
|
9817
|
+
if (index === this.activeIndex) {
|
|
9818
|
+
return;
|
|
9819
|
+
}
|
|
9820
|
+
this.activeItemIndexChange.emit(index);
|
|
9821
|
+
this.activeIndex = index;
|
|
9822
|
+
this.markTabAsActive();
|
|
9823
|
+
};
|
|
9824
|
+
Object.defineProperty(EvoNavigationTabsComponent.prototype, "tabsList", {
|
|
9825
|
+
get: function () {
|
|
9826
|
+
return Array.from(this.el.nativeElement.querySelectorAll('[evoNavigationTab]'));
|
|
9827
|
+
},
|
|
9828
|
+
enumerable: false,
|
|
9829
|
+
configurable: true
|
|
9830
|
+
});
|
|
9831
|
+
Object.defineProperty(EvoNavigationTabsComponent.prototype, "activeElement", {
|
|
9832
|
+
get: function () {
|
|
9833
|
+
return this.tabsList[this.activeIndex] || undefined;
|
|
9834
|
+
},
|
|
9835
|
+
enumerable: false,
|
|
9836
|
+
configurable: true
|
|
9837
|
+
});
|
|
9838
|
+
EvoNavigationTabsComponent.prototype.markTabAsActive = function () {
|
|
9839
|
+
var _a = this, tabsList = _a.tabsList, activeElement = _a.activeElement;
|
|
9840
|
+
tabsList.forEach(function (nativeElement) {
|
|
9841
|
+
var active = nativeElement === activeElement;
|
|
9842
|
+
nativeElement.classList.toggle('_active', active);
|
|
9843
|
+
nativeElement.setAttribute('tabIndex', active ? '0' : '-1');
|
|
9844
|
+
});
|
|
9845
|
+
};
|
|
9846
|
+
EvoNavigationTabsComponent.prototype.markTabAsDisabled = function () {
|
|
9847
|
+
var _this = this;
|
|
9848
|
+
this.tabsList.forEach(function (nativeElement) {
|
|
9849
|
+
var allDisabledClassName = '_all_disabled';
|
|
9850
|
+
if (_this.disabled && !nativeElement.disabled) {
|
|
9851
|
+
nativeElement.classList.add(allDisabledClassName);
|
|
9852
|
+
nativeElement.setAttribute('disabled', '');
|
|
9853
|
+
}
|
|
9854
|
+
if (!_this.disabled && nativeElement.classList.contains(allDisabledClassName)) {
|
|
9855
|
+
nativeElement.classList.remove(allDisabledClassName);
|
|
9856
|
+
nativeElement.removeAttribute('disabled');
|
|
9857
|
+
}
|
|
9858
|
+
});
|
|
9859
|
+
};
|
|
9860
|
+
EvoNavigationTabsComponent.prototype.initSubscriptions = function () {
|
|
9861
|
+
var _this = this;
|
|
9862
|
+
this.disabledSubject$
|
|
9863
|
+
.pipe(operators.switchMap(function () { return _this.nextRenderSubject$.pipe(operators.take(1)); }), operators.tap(function () {
|
|
9864
|
+
_this.markTabAsDisabled();
|
|
9865
|
+
}), operators.takeUntil(this.destroy$))
|
|
9866
|
+
.subscribe();
|
|
9867
|
+
};
|
|
9868
|
+
return EvoNavigationTabsComponent;
|
|
9869
|
+
}());
|
|
9870
|
+
EvoNavigationTabsComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: EvoNavigationTabsComponent, deps: [{ token: i0__namespace.ElementRef }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
9871
|
+
EvoNavigationTabsComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: EvoNavigationTabsComponent, selector: "evo-navigation-tabs", inputs: { tabs: "tabs", size: "size", setActiveIndex: ["activeIndex", "setActiveIndex"], setDisabled: ["disabled", "setDisabled"] }, outputs: { activeItemIndexChange: "activeItemIndexChange" }, host: { listeners: { "evo-tab-activate": "onActivate($event,$event.target)" } }, ngImport: i0__namespace, template: "<div class=\"evo-navigation-tabs\" [class]=\"{ 'evo-navigation-tabs_size_small': size === 'small' }\">\n <ng-content select=\"[position=start]\"></ng-content>\n\n <ng-container *ngFor=\"let tab of tabs; let i = index\">\n <button\n *ngIf=\"tab.link\"\n evoNavigationTab\n routerLinkActive=\"active\"\n queryParamsHandling=\"merge\"\n [routerLink]=\"tab.link\"\n [routerLinkActiveOptions]=\"{exact: true}\"\n [disabled]=\"tab.disabled || disabled\"\n >\n {{ tab.label }}\n </button>\n <button *ngIf=\"!tab.link\" evoNavigationTab [disabled]=\"tab.disabled || disabled\">{{ tab.label }}</button>\n </ng-container>\n\n <ng-content></ng-content>\n</div>\n", styles: ["@charset \"UTF-8\";:host{display:block}.evo-navigation-tabs{display:flex;box-shadow:inset 0 -1px #c6c6c6;overflow-x:auto;-webkit-overflow-scrolling:touch;scrollbar-width:none}.evo-navigation-tabs::-webkit-scrollbar{display:none}.evo-navigation-tab{display:flex;align-items:center;box-sizing:border-box;padding:12px 16px;border:none;background:none;color:#212121;white-space:nowrap;text-transform:uppercase;text-decoration:none;cursor:pointer;transition:box-shadow .3s,color .3s;font-family:var(--evo-font);font-style:normal;font-size:14px;line-height:24px;font-weight:600}.evo-navigation-tabs_size_small .evo-navigation-tab{padding:7px 8px;text-transform:none;font-family:var(--evo-font);font-style:normal;font-size:12px;line-height:18px;font-weight:400}.evo-navigation-tab:hover{color:#f05023}.evo-navigation-tab:focus-visible{outline:none}.evo-navigation-tab._active:not(:disabled){color:#f05023;box-shadow:inset 0 -2px #f05023;cursor:default}.evo-navigation-tabs_size_small .evo-navigation-tab._active:not(:disabled){box-shadow:inset 0 -1px #f05023}.evo-navigation-tab:disabled{color:#b0b0b0;pointer-events:none;cursor:default}\n"], directives: [{ type: i2__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i2__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: EvoNavigationTabDirective, selector: "button[evoNavigationTab]:not([routerLink]), button[evoNavigationTab][routerLink][routerLinkActive]" }, { type: i3__namespace$2.RouterLinkActive, selector: "[routerLinkActive]", inputs: ["routerLinkActiveOptions", "routerLinkActive"], exportAs: ["routerLinkActive"] }, { type: i3__namespace$2.RouterLink, selector: ":not(a):not(area)[routerLink]", inputs: ["routerLink", "queryParams", "fragment", "queryParamsHandling", "preserveFragment", "skipLocationChange", "replaceUrl", "state", "relativeTo"] }], changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush, encapsulation: i0__namespace.ViewEncapsulation.None });
|
|
9872
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: EvoNavigationTabsComponent, decorators: [{
|
|
9873
|
+
type: i0.Component,
|
|
9874
|
+
args: [{
|
|
9875
|
+
selector: 'evo-navigation-tabs',
|
|
9876
|
+
templateUrl: './evo-navigation-tabs.component.html',
|
|
9877
|
+
styleUrls: ['./evo-navigation-tabs.component.scss'],
|
|
9878
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush,
|
|
9879
|
+
encapsulation: i0.ViewEncapsulation.None,
|
|
9880
|
+
}]
|
|
9881
|
+
}], ctorParameters: function () { return [{ type: i0__namespace.ElementRef }]; }, propDecorators: { tabs: [{
|
|
9882
|
+
type: i0.Input
|
|
9883
|
+
}], size: [{
|
|
9884
|
+
type: i0.Input
|
|
9885
|
+
}], setActiveIndex: [{
|
|
9886
|
+
type: i0.Input,
|
|
9887
|
+
args: ['activeIndex']
|
|
9888
|
+
}], setDisabled: [{
|
|
9889
|
+
type: i0.Input,
|
|
9890
|
+
args: ['disabled']
|
|
9891
|
+
}], activeItemIndexChange: [{
|
|
9892
|
+
type: i0.Output
|
|
9893
|
+
}], onActivate: [{
|
|
9894
|
+
type: i0.HostListener,
|
|
9895
|
+
args: [EVO_TAB_ACTIVATE, ['$event', '$event.target']]
|
|
9896
|
+
}] } });
|
|
9897
|
+
|
|
9898
|
+
var EvoNavigationTabsModule = /** @class */ (function () {
|
|
9899
|
+
function EvoNavigationTabsModule() {
|
|
9900
|
+
}
|
|
9901
|
+
return EvoNavigationTabsModule;
|
|
9902
|
+
}());
|
|
9903
|
+
EvoNavigationTabsModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: EvoNavigationTabsModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
|
|
9904
|
+
EvoNavigationTabsModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: EvoNavigationTabsModule, declarations: [EvoNavigationTabsComponent, EvoNavigationTabDirective], imports: [i2.CommonModule, i3$2.RouterModule], exports: [EvoNavigationTabsComponent, EvoNavigationTabDirective] });
|
|
9905
|
+
EvoNavigationTabsModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: EvoNavigationTabsModule, imports: [[i2.CommonModule, i3$2.RouterModule]] });
|
|
9906
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: EvoNavigationTabsModule, decorators: [{
|
|
9907
|
+
type: i0.NgModule,
|
|
9908
|
+
args: [{
|
|
9909
|
+
declarations: [EvoNavigationTabsComponent, EvoNavigationTabDirective],
|
|
9910
|
+
imports: [i2.CommonModule, i3$2.RouterModule],
|
|
9911
|
+
exports: [EvoNavigationTabsComponent, EvoNavigationTabDirective],
|
|
9912
|
+
}]
|
|
9913
|
+
}] });
|
|
9914
|
+
|
|
9540
9915
|
/*
|
|
9541
9916
|
* Public API Surface of evo-ui-kit
|
|
9542
9917
|
*/
|
|
@@ -9556,6 +9931,7 @@
|
|
|
9556
9931
|
exports.EVO_SIDEBAR_CONFIG = EVO_SIDEBAR_CONFIG;
|
|
9557
9932
|
exports.EVO_SIDEBAR_DATA = EVO_SIDEBAR_DATA;
|
|
9558
9933
|
exports.EVO_SIDEBAR_ROOT_ID = EVO_SIDEBAR_ROOT_ID;
|
|
9934
|
+
exports.EVO_TAB_ACTIVATE = EVO_TAB_ACTIVATE;
|
|
9559
9935
|
exports.EvoAbstractPortal = EvoAbstractPortal;
|
|
9560
9936
|
exports.EvoAccordionComponent = EvoAccordionComponent;
|
|
9561
9937
|
exports.EvoAccordionContentComponent = EvoAccordionContentComponent;
|
|
@@ -9624,6 +10000,9 @@
|
|
|
9624
10000
|
exports.EvoNavbarModule = EvoNavbarModule;
|
|
9625
10001
|
exports.EvoNavigationButtonComponent = EvoNavigationButtonComponent;
|
|
9626
10002
|
exports.EvoNavigationButtonModule = EvoNavigationButtonModule;
|
|
10003
|
+
exports.EvoNavigationTabDirective = EvoNavigationTabDirective;
|
|
10004
|
+
exports.EvoNavigationTabsComponent = EvoNavigationTabsComponent;
|
|
10005
|
+
exports.EvoNavigationTabsModule = EvoNavigationTabsModule;
|
|
9627
10006
|
exports.EvoNoteComponent = EvoNoteComponent;
|
|
9628
10007
|
exports.EvoNoteModule = EvoNoteModule;
|
|
9629
10008
|
exports.EvoPaginatorComponent = EvoPaginatorComponent;
|