ngx-tethys 19.0.13 → 19.1.0-next.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/CHANGELOG.md +29 -2
- package/action/action.component.d.ts +12 -20
- package/action/actions.component.d.ts +5 -7
- package/affix/affix.component.d.ts +7 -10
- package/alert/alert.component.d.ts +1 -1
- package/anchor/anchor-link.component.d.ts +8 -8
- package/anchor/anchor.component.d.ts +15 -21
- package/arrow-switcher/arrow-switcher.component.d.ts +15 -22
- package/autocomplete/autocomplete.component.d.ts +10 -17
- package/autocomplete/autocomplete.trigger.directive.d.ts +10 -18
- package/avatar/avatar-list/avatar-list.component.d.ts +8 -14
- package/avatar/avatar.component.d.ts +25 -39
- package/back-top/back-top.component.d.ts +9 -12
- package/badge/badge.component.d.ts +19 -59
- package/breadcrumb/breadcrumb.component.d.ts +15 -20
- package/button/button-icon.component.d.ts +3 -2
- package/button/button.component.d.ts +3 -2
- package/calendar/calendar-header.component.d.ts +9 -8
- package/calendar/calendar.component.d.ts +16 -16
- package/card/card.component.d.ts +5 -11
- package/card/content.component.d.ts +3 -8
- package/card/header.component.d.ts +7 -8
- package/carousel/carousel.component.d.ts +22 -27
- package/cascader/cascader-li.component.d.ts +13 -21
- package/cascader/cascader-search-option.component.d.ts +8 -16
- package/cascader/cascader.component.d.ts +58 -80
- package/checkbox/checkbox.component.d.ts +2 -5
- package/collapse/collapse-item.component.d.ts +12 -19
- package/collapse/collapse.component.d.ts +6 -12
- package/collapse/collapse.token.d.ts +3 -3
- package/color-picker/color-picker-custom-panel.component.d.ts +5 -5
- package/color-picker/color-picker-panel.component.d.ts +7 -11
- package/color-picker/color-picker.component.d.ts +19 -35
- package/color-picker/parts/alpha/alpha.component.d.ts +8 -8
- package/color-picker/parts/hue/hue.component.d.ts +6 -6
- package/color-picker/parts/indicator/indicator.component.d.ts +4 -3
- package/color-picker/parts/inputs/inputs.component.d.ts +9 -9
- package/color-picker/parts/saturation/saturation.component.d.ts +9 -9
- package/comment/comment.component.d.ts +4 -5
- package/copy/copy.directive.d.ts +8 -9
- package/date-picker/abstract-picker.component.d.ts +8 -7
- package/date-picker/lib/calendar/calendar-footer.component.d.ts +2 -1
- package/date-picker/lib/popups/inner-popup.component.d.ts +2 -1
- package/date-picker/picker.component.d.ts +2 -1
- package/date-range/date-range.component.d.ts +2 -2
- package/dialog/body/dialog-body.component.d.ts +2 -6
- package/dialog/confirm/confirm.component.d.ts +2 -2
- package/dialog/footer/dialog-footer.component.d.ts +6 -9
- package/dialog/header/dialog-header.component.d.ts +9 -11
- package/divider/divider.component.d.ts +12 -16
- package/dot/dot.component.d.ts +5 -13
- package/drag-drop/drag-handle.directive.d.ts +2 -1
- package/drag-drop/drag.directive.d.ts +2 -1
- package/drag-drop/drop-container.directive.d.ts +2 -1
- package/dropdown/dropdown-menu-item.directive.d.ts +3 -2
- package/dropdown/dropdown-menu.component.d.ts +2 -1
- package/dropdown/dropdown.directive.d.ts +2 -1
- package/empty/empty.component.d.ts +21 -27
- package/fesm2022/ngx-tethys-action.mjs +54 -91
- package/fesm2022/ngx-tethys-action.mjs.map +1 -1
- package/fesm2022/ngx-tethys-affix.mjs +29 -26
- package/fesm2022/ngx-tethys-affix.mjs.map +1 -1
- package/fesm2022/ngx-tethys-anchor.mjs +91 -118
- package/fesm2022/ngx-tethys-anchor.mjs.map +1 -1
- package/fesm2022/ngx-tethys-arrow-switcher.mjs +51 -77
- package/fesm2022/ngx-tethys-arrow-switcher.mjs.map +1 -1
- package/fesm2022/ngx-tethys-autocomplete.mjs +69 -103
- package/fesm2022/ngx-tethys-autocomplete.mjs.map +1 -1
- package/fesm2022/ngx-tethys-avatar.mjs +117 -162
- package/fesm2022/ngx-tethys-avatar.mjs.map +1 -1
- package/fesm2022/ngx-tethys-back-top.mjs +33 -46
- package/fesm2022/ngx-tethys-back-top.mjs.map +1 -1
- package/fesm2022/ngx-tethys-badge.mjs +104 -208
- package/fesm2022/ngx-tethys-badge.mjs.map +1 -1
- package/fesm2022/ngx-tethys-breadcrumb.mjs +66 -70
- package/fesm2022/ngx-tethys-breadcrumb.mjs.map +1 -1
- package/fesm2022/ngx-tethys-calendar.mjs +85 -87
- package/fesm2022/ngx-tethys-calendar.mjs.map +1 -1
- package/fesm2022/ngx-tethys-card.mjs +72 -77
- package/fesm2022/ngx-tethys-card.mjs.map +1 -1
- package/fesm2022/ngx-tethys-carousel.mjs +82 -99
- package/fesm2022/ngx-tethys-carousel.mjs.map +1 -1
- package/fesm2022/ngx-tethys-cascader.mjs +313 -468
- package/fesm2022/ngx-tethys-cascader.mjs.map +1 -1
- package/fesm2022/ngx-tethys-checkbox.mjs +10 -17
- package/fesm2022/ngx-tethys-checkbox.mjs.map +1 -1
- package/fesm2022/ngx-tethys-collapse.mjs +66 -71
- package/fesm2022/ngx-tethys-collapse.mjs.map +1 -1
- package/fesm2022/ngx-tethys-color-picker.mjs +187 -246
- package/fesm2022/ngx-tethys-color-picker.mjs.map +1 -1
- package/fesm2022/ngx-tethys-comment.mjs +16 -10
- package/fesm2022/ngx-tethys-comment.mjs.map +1 -1
- package/fesm2022/ngx-tethys-copy.mjs +25 -28
- package/fesm2022/ngx-tethys-copy.mjs.map +1 -1
- package/fesm2022/ngx-tethys-dialog.mjs +81 -82
- package/fesm2022/ngx-tethys-dialog.mjs.map +1 -1
- package/fesm2022/ngx-tethys-divider.mjs +49 -58
- package/fesm2022/ngx-tethys-divider.mjs.map +1 -1
- package/fesm2022/ngx-tethys-dot.mjs +45 -68
- package/fesm2022/ngx-tethys-dot.mjs.map +1 -1
- package/fesm2022/ngx-tethys-empty.mjs +107 -95
- package/fesm2022/ngx-tethys-empty.mjs.map +1 -1
- package/fesm2022/ngx-tethys-form.mjs +161 -200
- package/fesm2022/ngx-tethys-form.mjs.map +1 -1
- package/fesm2022/ngx-tethys-fullscreen.mjs +21 -23
- package/fesm2022/ngx-tethys-fullscreen.mjs.map +1 -1
- package/fesm2022/ngx-tethys-grid.mjs +160 -152
- package/fesm2022/ngx-tethys-grid.mjs.map +1 -1
- package/fesm2022/ngx-tethys-i18n.mjs +25 -25
- package/fesm2022/ngx-tethys-i18n.mjs.map +1 -1
- package/fesm2022/ngx-tethys-input-number.mjs +101 -114
- package/fesm2022/ngx-tethys-input-number.mjs.map +1 -1
- package/fesm2022/ngx-tethys-input.mjs +268 -271
- package/fesm2022/ngx-tethys-input.mjs.map +1 -1
- package/fesm2022/ngx-tethys-list.mjs +1 -1
- package/fesm2022/ngx-tethys-list.mjs.map +1 -1
- package/fesm2022/ngx-tethys-loading.mjs +17 -35
- package/fesm2022/ngx-tethys-loading.mjs.map +1 -1
- package/fesm2022/ngx-tethys-mention.mjs +52 -74
- package/fesm2022/ngx-tethys-mention.mjs.map +1 -1
- package/fesm2022/ngx-tethys-menu.mjs +106 -179
- package/fesm2022/ngx-tethys-menu.mjs.map +1 -1
- package/fesm2022/ngx-tethys-nav.mjs +169 -201
- package/fesm2022/ngx-tethys-nav.mjs.map +1 -1
- package/fesm2022/ngx-tethys-pagination.mjs +230 -294
- package/fesm2022/ngx-tethys-pagination.mjs.map +1 -1
- package/fesm2022/ngx-tethys-popover.mjs +67 -70
- package/fesm2022/ngx-tethys-popover.mjs.map +1 -1
- package/fesm2022/ngx-tethys-progress.mjs +196 -244
- package/fesm2022/ngx-tethys-progress.mjs.map +1 -1
- package/fesm2022/ngx-tethys-property.mjs +102 -105
- package/fesm2022/ngx-tethys-property.mjs.map +1 -1
- package/fesm2022/ngx-tethys-radio.mjs +34 -38
- package/fesm2022/ngx-tethys-radio.mjs.map +1 -1
- package/fesm2022/ngx-tethys-result.mjs +46 -28
- package/fesm2022/ngx-tethys-result.mjs.map +1 -1
- package/fesm2022/ngx-tethys-skeleton.mjs +339 -342
- package/fesm2022/ngx-tethys-skeleton.mjs.map +1 -1
- package/fesm2022/ngx-tethys-slider.mjs +75 -108
- package/fesm2022/ngx-tethys-slider.mjs.map +1 -1
- package/fesm2022/ngx-tethys-space.mjs +26 -46
- package/fesm2022/ngx-tethys-space.mjs.map +1 -1
- package/fesm2022/ngx-tethys-statistic.mjs +114 -151
- package/fesm2022/ngx-tethys-statistic.mjs.map +1 -1
- package/fesm2022/ngx-tethys-stepper.mjs +74 -107
- package/fesm2022/ngx-tethys-stepper.mjs.map +1 -1
- package/fesm2022/ngx-tethys-switch.mjs +80 -140
- package/fesm2022/ngx-tethys-switch.mjs.map +1 -1
- package/fesm2022/ngx-tethys-table.mjs +1 -1
- package/fesm2022/ngx-tethys-table.mjs.map +1 -1
- package/fesm2022/ngx-tethys-tabs.mjs +69 -87
- package/fesm2022/ngx-tethys-tabs.mjs.map +1 -1
- package/fesm2022/ngx-tethys-tag.mjs +42 -64
- package/fesm2022/ngx-tethys-tag.mjs.map +1 -1
- package/fesm2022/ngx-tethys-timeline.mjs +104 -129
- package/fesm2022/ngx-tethys-timeline.mjs.map +1 -1
- package/fesm2022/ngx-tethys-typography.mjs +36 -33
- package/fesm2022/ngx-tethys-typography.mjs.map +1 -1
- package/fesm2022/ngx-tethys-upload.mjs +91 -130
- package/fesm2022/ngx-tethys-upload.mjs.map +1 -1
- package/fesm2022/ngx-tethys-util.mjs.map +1 -1
- package/fesm2022/ngx-tethys-watermark.mjs +36 -40
- package/fesm2022/ngx-tethys-watermark.mjs.map +1 -1
- package/fesm2022/ngx-tethys.mjs +1 -1
- package/fesm2022/ngx-tethys.mjs.map +1 -1
- package/form/form-group-error/form-group-error.component.d.ts +2 -3
- package/form/form-group-label.directive.d.ts +2 -1
- package/form/form-group.component.d.ts +17 -24
- package/form/form-submit.directive.d.ts +2 -2
- package/form/form.directive.d.ts +6 -8
- package/form/from-group-footer/form-group-footer.component.d.ts +2 -2
- package/form/validator/confirm-validator.directive.d.ts +2 -2
- package/form/validator/unique-validator.directive.d.ts +2 -2
- package/fullscreen/fullscreen.component.d.ts +7 -7
- package/grid/flex.d.ts +14 -19
- package/grid/thy-col.directive.d.ts +6 -9
- package/grid/thy-grid-item.component.d.ts +3 -4
- package/grid/thy-grid.component.d.ts +11 -12
- package/grid/thy-row.directive.d.ts +12 -12
- package/icon/icon.component.d.ts +3 -2
- package/image/image.directive.d.ts +3 -2
- package/input/input-count.component.d.ts +4 -5
- package/input/input-group.component.d.ts +20 -20
- package/input/input-search.component.d.ts +15 -20
- package/input/input.component.d.ts +20 -21
- package/input/input.directive.d.ts +4 -6
- package/input-number/input-number.component.d.ts +21 -29
- package/layout/header.component.d.ts +4 -9
- package/layout/sidebar-header.component.d.ts +2 -1
- package/layout/sidebar.component.d.ts +8 -7
- package/list/list.component.d.ts +2 -1
- package/list/selection/selection-list.d.ts +4 -3
- package/loading/loading.component.d.ts +4 -10
- package/mention/mention.directive.d.ts +6 -7
- package/mention/suggestions/suggestions.component.d.ts +8 -9
- package/menu/group/menu-group.component.d.ts +16 -33
- package/menu/item/action/menu-item-action.component.d.ts +7 -8
- package/menu/item/icon/menu-item-icon.component.d.ts +2 -2
- package/menu/item/menu-item.component.d.ts +4 -4
- package/menu/item/name/menu-item-name.component.d.ts +2 -3
- package/menu/menu.component.d.ts +3 -7
- package/nav/icon-nav/icon-nav-link.directive.d.ts +3 -7
- package/nav/icon-nav/icon-nav.component.d.ts +3 -8
- package/nav/nav-ink-bar.directive.d.ts +4 -6
- package/nav/nav-item.directive.d.ts +7 -10
- package/nav/nav.component.d.ts +20 -48
- package/package.json +1 -1
- package/pagination/pagination.component.d.ts +48 -109
- package/popover/header/popover-header.component.d.ts +7 -6
- package/popover/popover.directive.d.ts +11 -18
- package/progress/progress-circle.component.d.ts +32 -21
- package/progress/progress-strip.component.d.ts +10 -14
- package/progress/progress.component.d.ts +15 -23
- package/property/examples/single/single.component.scss +6 -0
- package/property/properties.component.d.ts +6 -13
- package/property/property-item.component.d.ts +21 -26
- package/property/styles/properties.scss +124 -52
- package/property-operation/property-operation.component.d.ts +6 -5
- package/radio/button/radio-button.component.d.ts +2 -2
- package/radio/group/radio-group.component.d.ts +8 -7
- package/radio/radio.component.d.ts +2 -2
- package/radio/radio.token.d.ts +2 -2
- package/rate/rate-item.component.d.ts +2 -1
- package/rate/rate.component.d.ts +4 -3
- package/resizable/resizable.directive.d.ts +4 -9
- package/resizable/resize-handle.component.d.ts +2 -1
- package/resizable/resize-handles.component.d.ts +2 -1
- package/result/result.component.d.ts +9 -10
- package/schematics/version.d.ts +1 -1
- package/schematics/version.js +1 -1
- package/segment/segment-item.component.d.ts +2 -1
- package/segment/segment.component.d.ts +2 -1
- package/select/custom-select/custom-select.component.d.ts +11 -10
- package/select/native-select/native-select.component.d.ts +2 -1
- package/shared/base-form-check.component.d.ts +3 -2
- package/shared/directives/thy-autofocus.directive.d.ts +3 -2
- package/shared/directives/thy-scroll.directive.d.ts +2 -1
- package/shared/directives/thy-show.d.ts +2 -1
- package/shared/option/group/option-group.component.d.ts +2 -1
- package/shared/option/list-option/list-option.component.d.ts +2 -7
- package/shared/option/option.component.d.ts +2 -1
- package/shared/select/select-control/select-control.component.d.ts +7 -6
- package/skeleton/skeleton-circle.component.d.ts +16 -19
- package/skeleton/skeleton-rectangle.component.d.ts +20 -23
- package/skeleton/skeleton.component.d.ts +5 -6
- package/skeleton/stylized/bullet-list.component.d.ts +11 -13
- package/skeleton/stylized/list.component.d.ts +10 -12
- package/skeleton/stylized/paragraph.component.d.ts +12 -14
- package/slide/slide-body/slide-body-section.component.d.ts +2 -1
- package/slider/slider.component.d.ts +17 -24
- package/space/space.component.d.ts +8 -8
- package/statistic/statistic.component.d.ts +35 -40
- package/stepper/step-header.component.d.ts +6 -10
- package/stepper/step.component.d.ts +6 -6
- package/stepper/stepper.component.d.ts +15 -20
- package/switch/switch.component.d.ts +24 -35
- package/table/table-column.component.d.ts +6 -5
- package/table/table-skeleton.component.d.ts +3 -10
- package/table/table.component.d.ts +11 -10
- package/tabs/tab-content.component.d.ts +4 -4
- package/tabs/tab.component.d.ts +4 -5
- package/tabs/tabs.component.d.ts +13 -15
- package/tag/tag.component.d.ts +10 -16
- package/time-picker/time-picker-panel.component.d.ts +3 -2
- package/time-picker/time-picker.component.d.ts +6 -5
- package/timeline/timeline-item.component.d.ts +9 -13
- package/timeline/timeline.component.d.ts +13 -17
- package/tooltip/tooltip.directive.d.ts +3 -2
- package/tree/tree-node.component.d.ts +6 -15
- package/tree/tree.component.d.ts +8 -7
- package/tree-select/tree-select.component.d.ts +8 -7
- package/typography/bg-color.directive.d.ts +3 -3
- package/typography/text/text.component.d.ts +2 -2
- package/typography/text-color.directive.d.ts +3 -3
- package/upload/file-drop.directive.d.ts +9 -11
- package/upload/file-select-base.d.ts +6 -10
- package/upload/file-select.component.d.ts +10 -20
- package/util/helpers/helpers.d.ts +2 -1
- package/vote/vote.component.d.ts +4 -3
- package/watermark/watermark.directive.d.ts +7 -9
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import {
|
|
2
|
+
import { input, Component, effect, HostBinding, ChangeDetectionStrategy, inject, ElementRef, NgZone, contentChildren, forwardRef, DestroyRef, Directive, ANIMATION_MODULE_TYPE, computed, Pipe, ChangeDetectorRef, signal, contentChild, viewChild, ContentChildren, NgModule } from '@angular/core';
|
|
3
3
|
import { ThyIcon, ThyIconModule } from 'ngx-tethys/icon';
|
|
4
4
|
import { coerceBooleanProperty, warnDeprecation } from 'ngx-tethys/util';
|
|
5
5
|
import { useHostRenderer } from '@tethys/cdk/dom';
|
|
@@ -8,79 +8,56 @@ import { RouterLinkActive, RouterModule } from '@angular/router';
|
|
|
8
8
|
import { ThyPopover, ThyPopoverModule } from 'ngx-tethys/popover';
|
|
9
9
|
import { merge, of, Observable } from 'rxjs';
|
|
10
10
|
import { take, startWith, tap } from 'rxjs/operators';
|
|
11
|
-
import { DomSanitizer } from '@angular/platform-browser';
|
|
12
|
-
import { ThyDropdownMenuComponent, ThyDropdownMenuItemDirective, ThyDropdownMenuItemActiveDirective, ThyDropdownModule } from 'ngx-tethys/dropdown';
|
|
13
11
|
import { NgClass, NgTemplateOutlet, CommonModule } from '@angular/common';
|
|
12
|
+
import { ThyDropdownMenuComponent, ThyDropdownMenuItemDirective, ThyDropdownMenuItemActiveDirective, ThyDropdownModule } from 'ngx-tethys/dropdown';
|
|
14
13
|
import { injectLocale } from 'ngx-tethys/i18n';
|
|
14
|
+
import { DomSanitizer } from '@angular/platform-browser';
|
|
15
15
|
|
|
16
16
|
/**
|
|
17
17
|
* @private
|
|
18
18
|
*/
|
|
19
19
|
class ThyIconNavLink {
|
|
20
20
|
constructor() {
|
|
21
|
-
this.
|
|
22
|
-
this.
|
|
23
|
-
}
|
|
24
|
-
set thyIconNavLinkIcon(icon) {
|
|
25
|
-
this.icon = icon;
|
|
26
|
-
}
|
|
27
|
-
set thyIconNavLinkActive(active) {
|
|
28
|
-
this.navLinkActive = active;
|
|
21
|
+
this.thyIconNavLinkIcon = input('');
|
|
22
|
+
this.thyIconNavLinkActive = input(false, { transform: coerceBooleanProperty });
|
|
29
23
|
}
|
|
30
24
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: ThyIconNavLink, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
31
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.8", type: ThyIconNavLink, isStandalone: true, selector: "[thyIconNavLink]", inputs: { thyIconNavLinkIcon: "thyIconNavLinkIcon", thyIconNavLinkActive:
|
|
25
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.8", type: ThyIconNavLink, isStandalone: true, selector: "[thyIconNavLink]", inputs: { thyIconNavLinkIcon: { classPropertyName: "thyIconNavLinkIcon", publicName: "thyIconNavLinkIcon", isSignal: true, isRequired: false, transformFunction: null }, thyIconNavLinkActive: { classPropertyName: "thyIconNavLinkActive", publicName: "thyIconNavLinkActive", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class.active": "thyIconNavLinkActive()", "class.thy-icon-nav-link": "true" } }, ngImport: i0, template: '<ng-content></ng-content>@if (thyIconNavLinkIcon()) {<thy-icon [thyIconName]="thyIconNavLinkIcon()"></thy-icon>}', isInline: true, dependencies: [{ kind: "component", type: ThyIcon, selector: "thy-icon, [thy-icon]", inputs: ["thyIconType", "thyTwotoneColor", "thyIconName", "thyIconRotate", "thyIconSet", "thyIconLegging", "thyIconLinearGradient"] }] }); }
|
|
32
26
|
}
|
|
33
27
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: ThyIconNavLink, decorators: [{
|
|
34
28
|
type: Component,
|
|
35
29
|
args: [{
|
|
36
30
|
// eslint-disable-next-line @angular-eslint/component-selector
|
|
37
31
|
selector: '[thyIconNavLink]',
|
|
38
|
-
template: '<ng-content></ng-content>@if (
|
|
32
|
+
template: '<ng-content></ng-content>@if (thyIconNavLinkIcon()) {<thy-icon [thyIconName]="thyIconNavLinkIcon()"></thy-icon>}',
|
|
33
|
+
host: {
|
|
34
|
+
'[class.active]': 'thyIconNavLinkActive()',
|
|
35
|
+
'[class.thy-icon-nav-link]': 'true'
|
|
36
|
+
},
|
|
39
37
|
imports: [ThyIcon]
|
|
40
38
|
}]
|
|
41
|
-
}]
|
|
42
|
-
type: HostBinding,
|
|
43
|
-
args: ['class.active']
|
|
44
|
-
}], navLinkClass: [{
|
|
45
|
-
type: HostBinding,
|
|
46
|
-
args: ['class.thy-icon-nav-link']
|
|
47
|
-
}], thyIconNavLinkIcon: [{
|
|
48
|
-
type: Input
|
|
49
|
-
}], thyIconNavLinkActive: [{
|
|
50
|
-
type: Input,
|
|
51
|
-
args: [{ transform: coerceBooleanProperty }]
|
|
52
|
-
}] } });
|
|
39
|
+
}] });
|
|
53
40
|
|
|
54
41
|
/**
|
|
55
42
|
* @private
|
|
56
43
|
*/
|
|
57
44
|
class ThyIconNav {
|
|
58
|
-
|
|
59
|
-
this.
|
|
60
|
-
this.updateClasses();
|
|
61
|
-
this.changeDetectorRef.markForCheck();
|
|
62
|
-
}
|
|
63
|
-
updateClasses(bypassInitialized) {
|
|
64
|
-
if (!bypassInitialized && !this.initialized) {
|
|
65
|
-
return;
|
|
66
|
-
}
|
|
67
|
-
this.hostRenderer.updateClass(this.type ? [`thy-icon-nav-${this.type}`] : []);
|
|
45
|
+
updateClasses() {
|
|
46
|
+
this.hostRenderer.updateClass(this.thyType() ? [`thy-icon-nav-${this.thyType()}`] : []);
|
|
68
47
|
}
|
|
69
48
|
constructor() {
|
|
70
|
-
this.changeDetectorRef = inject(ChangeDetectorRef);
|
|
71
|
-
this.initialized = false;
|
|
72
49
|
this.hostRenderer = useHostRenderer();
|
|
73
50
|
this.isIconNav = true;
|
|
51
|
+
this.thyType = input('');
|
|
74
52
|
if (typeof ngDevMode === 'undefined' || ngDevMode) {
|
|
75
53
|
warnDeprecation('thy-icon-nav has been deprecated, please use thyAction and thy-space components instead of it');
|
|
76
54
|
}
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
this.updateClasses(true);
|
|
55
|
+
effect(() => {
|
|
56
|
+
this.updateClasses();
|
|
57
|
+
});
|
|
81
58
|
}
|
|
82
59
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: ThyIconNav, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
83
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "
|
|
60
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.2.8", type: ThyIconNav, isStandalone: true, selector: "thy-icon-nav", inputs: { thyType: { classPropertyName: "thyType", publicName: "thyType", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class.thy-icon-nav": "this.isIconNav" } }, ngImport: i0, template: "<ng-content></ng-content>\n", changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
84
61
|
}
|
|
85
62
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: ThyIconNav, decorators: [{
|
|
86
63
|
type: Component,
|
|
@@ -88,8 +65,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImpor
|
|
|
88
65
|
}], ctorParameters: () => [], propDecorators: { isIconNav: [{
|
|
89
66
|
type: HostBinding,
|
|
90
67
|
args: [`class.thy-icon-nav`]
|
|
91
|
-
}], thyType: [{
|
|
92
|
-
type: Input
|
|
93
68
|
}] } });
|
|
94
69
|
|
|
95
70
|
/**
|
|
@@ -106,6 +81,30 @@ class ThyNavItemDirective {
|
|
|
106
81
|
* 唯一标识
|
|
107
82
|
*/
|
|
108
83
|
this.id = input();
|
|
84
|
+
/**
|
|
85
|
+
* 是否激活状态
|
|
86
|
+
* @default false
|
|
87
|
+
*/
|
|
88
|
+
this.thyNavItemActive = input(false, { transform: coerceBooleanProperty });
|
|
89
|
+
/**
|
|
90
|
+
* 已经废弃,请使用 thyNavItemActive
|
|
91
|
+
* @deprecated please use thyNavItemActive
|
|
92
|
+
* @default false
|
|
93
|
+
*/
|
|
94
|
+
this.thyNavLinkActive = input(false, { transform: coerceBooleanProperty });
|
|
95
|
+
/**
|
|
96
|
+
* 是否禁用
|
|
97
|
+
* @default false
|
|
98
|
+
*/
|
|
99
|
+
this.thyNavItemDisabled = input(false, { transform: coerceBooleanProperty });
|
|
100
|
+
/**
|
|
101
|
+
* @private
|
|
102
|
+
*/
|
|
103
|
+
this.links = contentChildren(forwardRef(() => ThyNavItemDirective), { descendants: true });
|
|
104
|
+
/**
|
|
105
|
+
* @private
|
|
106
|
+
*/
|
|
107
|
+
this.routers = contentChildren(RouterLinkActive, { descendants: true });
|
|
109
108
|
// @HostBinding('attr.href') navLinkHref = 'javascript:;';
|
|
110
109
|
this.offset = {
|
|
111
110
|
width: 0,
|
|
@@ -132,12 +131,13 @@ class ThyNavItemDirective {
|
|
|
132
131
|
};
|
|
133
132
|
}
|
|
134
133
|
linkIsActive() {
|
|
135
|
-
|
|
136
|
-
|
|
134
|
+
const links = this.links();
|
|
135
|
+
return (this.thyNavItemActive() ||
|
|
136
|
+
this.thyNavLinkActive() ||
|
|
137
137
|
(this.routerLinkActive && this.routerLinkActive.isActive) ||
|
|
138
|
-
this.routers.some(router => router.isActive) ||
|
|
139
|
-
|
|
140
|
-
|
|
138
|
+
this.routers().some(router => router.isActive) ||
|
|
139
|
+
links.some(item => item.thyNavItemActive()) ||
|
|
140
|
+
links.some(item => item.thyNavLinkActive()));
|
|
141
141
|
}
|
|
142
142
|
setNavLinkHidden(value) {
|
|
143
143
|
if (value) {
|
|
@@ -154,7 +154,7 @@ class ThyNavItemDirective {
|
|
|
154
154
|
this.hostRenderer.removeClass(className);
|
|
155
155
|
}
|
|
156
156
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: ThyNavItemDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
157
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.
|
|
157
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.2.0", version: "19.2.8", type: ThyNavItemDirective, isStandalone: true, selector: "[thyNavLink],[thyNavItem]", inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, thyNavItemActive: { classPropertyName: "thyNavItemActive", publicName: "thyNavItemActive", isSignal: true, isRequired: false, transformFunction: null }, thyNavLinkActive: { classPropertyName: "thyNavLinkActive", publicName: "thyNavLinkActive", isSignal: true, isRequired: false, transformFunction: null }, thyNavItemDisabled: { classPropertyName: "thyNavItemDisabled", publicName: "thyNavItemDisabled", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class.active": "thyNavItemActive() || thyNavLinkActive()", "class.disabled": "thyNavItemDisabled()" }, classAttribute: "thy-nav-item" }, queries: [{ propertyName: "links", predicate: i0.forwardRef(() => ThyNavItemDirective), descendants: true, isSignal: true }, { propertyName: "routers", predicate: RouterLinkActive, descendants: true, isSignal: true }], ngImport: i0 }); }
|
|
158
158
|
}
|
|
159
159
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: ThyNavItemDirective, decorators: [{
|
|
160
160
|
type: Directive,
|
|
@@ -162,26 +162,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImpor
|
|
|
162
162
|
selector: '[thyNavLink],[thyNavItem]',
|
|
163
163
|
host: {
|
|
164
164
|
class: 'thy-nav-item',
|
|
165
|
-
'[class.active]': 'thyNavItemActive || thyNavLinkActive',
|
|
166
|
-
'[class.disabled]': 'thyNavItemDisabled'
|
|
165
|
+
'[class.active]': 'thyNavItemActive() || thyNavLinkActive()',
|
|
166
|
+
'[class.disabled]': 'thyNavItemDisabled()'
|
|
167
167
|
}
|
|
168
168
|
}]
|
|
169
|
-
}]
|
|
170
|
-
type: Input,
|
|
171
|
-
args: [{ transform: coerceBooleanProperty }]
|
|
172
|
-
}], thyNavLinkActive: [{
|
|
173
|
-
type: Input,
|
|
174
|
-
args: [{ transform: coerceBooleanProperty }]
|
|
175
|
-
}], thyNavItemDisabled: [{
|
|
176
|
-
type: Input,
|
|
177
|
-
args: [{ transform: coerceBooleanProperty }]
|
|
178
|
-
}], links: [{
|
|
179
|
-
type: ContentChildren,
|
|
180
|
-
args: [forwardRef(() => ThyNavItemDirective), { descendants: true }]
|
|
181
|
-
}], routers: [{
|
|
182
|
-
type: ContentChildren,
|
|
183
|
-
args: [RouterLinkActive, { descendants: true }]
|
|
184
|
-
}] } });
|
|
169
|
+
}] });
|
|
185
170
|
|
|
186
171
|
/**
|
|
187
172
|
* @internal
|
|
@@ -191,9 +176,9 @@ class ThyNavInkBarDirective {
|
|
|
191
176
|
this.elementRef = inject(ElementRef);
|
|
192
177
|
this.ngZone = inject(NgZone);
|
|
193
178
|
this.animationMode = inject(ANIMATION_MODULE_TYPE, { optional: true });
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
179
|
+
this.isVertical = input(false, { transform: coerceBooleanProperty });
|
|
180
|
+
this.showInkBar = input(false, { transform: coerceBooleanProperty });
|
|
181
|
+
this.animated = computed(() => this.animationMode !== 'NoopAnimations' && this.showInkBar());
|
|
197
182
|
}
|
|
198
183
|
alignToElement(element) {
|
|
199
184
|
this.show();
|
|
@@ -205,7 +190,7 @@ class ThyNavInkBarDirective {
|
|
|
205
190
|
}
|
|
206
191
|
setStyles(element) {
|
|
207
192
|
const inkBar = this.elementRef.nativeElement;
|
|
208
|
-
if (!this.isVertical) {
|
|
193
|
+
if (!this.isVertical()) {
|
|
209
194
|
inkBar.style.top = '';
|
|
210
195
|
inkBar.style.bottom = '0px';
|
|
211
196
|
inkBar.style.height = '2px';
|
|
@@ -238,7 +223,7 @@ class ThyNavInkBarDirective {
|
|
|
238
223
|
this.elementRef.nativeElement.style.visibility = 'hidden';
|
|
239
224
|
}
|
|
240
225
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: ThyNavInkBarDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
241
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "
|
|
226
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.8", type: ThyNavInkBarDirective, isStandalone: true, selector: "thy-nav-ink-bar, [thyNavInkBar]", inputs: { isVertical: { classPropertyName: "isVertical", publicName: "isVertical", isSignal: true, isRequired: false, transformFunction: null }, showInkBar: { classPropertyName: "showInkBar", publicName: "showInkBar", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class.thy-nav-ink-bar-animated": "animated()" }, classAttribute: "thy-nav-ink-bar" }, ngImport: i0 }); }
|
|
242
227
|
}
|
|
243
228
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: ThyNavInkBarDirective, decorators: [{
|
|
244
229
|
type: Directive,
|
|
@@ -246,16 +231,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImpor
|
|
|
246
231
|
selector: 'thy-nav-ink-bar, [thyNavInkBar]',
|
|
247
232
|
host: {
|
|
248
233
|
class: 'thy-nav-ink-bar',
|
|
249
|
-
'[class.thy-nav-ink-bar-animated]': 'animated'
|
|
234
|
+
'[class.thy-nav-ink-bar-animated]': 'animated()'
|
|
250
235
|
}
|
|
251
236
|
}]
|
|
252
|
-
}]
|
|
253
|
-
type: Input,
|
|
254
|
-
args: [{ transform: coerceBooleanProperty }]
|
|
255
|
-
}], showInkBar: [{
|
|
256
|
-
type: Input,
|
|
257
|
-
args: [{ transform: coerceBooleanProperty }]
|
|
258
|
-
}] } });
|
|
237
|
+
}] });
|
|
259
238
|
|
|
260
239
|
/**
|
|
261
240
|
* @private
|
|
@@ -301,14 +280,36 @@ const tabItemRight = 20;
|
|
|
301
280
|
* @order 10
|
|
302
281
|
*/
|
|
303
282
|
class ThyNav {
|
|
283
|
+
/**
|
|
284
|
+
* @private
|
|
285
|
+
*/
|
|
286
|
+
set links(value) {
|
|
287
|
+
this.innerLinks = value;
|
|
288
|
+
this.prevActiveIndex = NaN;
|
|
289
|
+
}
|
|
290
|
+
get links() {
|
|
291
|
+
return this.innerLinks;
|
|
292
|
+
}
|
|
293
|
+
get showInkBar() {
|
|
294
|
+
const showTypes = ['pulled', 'tabs'];
|
|
295
|
+
return showTypes.includes(this.type());
|
|
296
|
+
}
|
|
297
|
+
updateClasses() {
|
|
298
|
+
let classNames = [];
|
|
299
|
+
if (navTypeClassesMap[this.type()]) {
|
|
300
|
+
classNames = [...navTypeClassesMap[this.type()]];
|
|
301
|
+
}
|
|
302
|
+
if (navSizeClassesMap[this.thySize()]) {
|
|
303
|
+
classNames.push(navSizeClassesMap[this.thySize()]);
|
|
304
|
+
}
|
|
305
|
+
this.hostRenderer.updateClass(classNames);
|
|
306
|
+
}
|
|
304
307
|
constructor() {
|
|
305
308
|
this.elementRef = inject(ElementRef);
|
|
306
309
|
this.ngZone = inject(NgZone);
|
|
307
310
|
this.changeDetectorRef = inject(ChangeDetectorRef);
|
|
308
311
|
this.popover = inject(ThyPopover);
|
|
309
312
|
this.destroyRef = inject(DestroyRef);
|
|
310
|
-
this.type = 'pulled';
|
|
311
|
-
this.size = 'md';
|
|
312
313
|
this.initialized = false;
|
|
313
314
|
this.wrapperOffset = {
|
|
314
315
|
height: 0,
|
|
@@ -321,10 +322,38 @@ class ThyNav {
|
|
|
321
322
|
this.moreBtnOffset = { height: 0, width: 0 };
|
|
322
323
|
this.hostRenderer = useHostRenderer();
|
|
323
324
|
this.locale = injectLocale('nav');
|
|
325
|
+
/**
|
|
326
|
+
* 导航类型
|
|
327
|
+
* @type pulled | tabs | pills | lite | primary | secondary | thirdly | secondary-divider
|
|
328
|
+
* @default pulled
|
|
329
|
+
*/
|
|
330
|
+
this.thyType = input();
|
|
331
|
+
/**
|
|
332
|
+
* 导航大小
|
|
333
|
+
* @type lg | md | sm
|
|
334
|
+
* @default md
|
|
335
|
+
*/
|
|
336
|
+
this.thySize = input('md');
|
|
337
|
+
/**
|
|
338
|
+
* 水平排列
|
|
339
|
+
* @type '' | 'start' | 'center' | 'end'
|
|
340
|
+
* @default false
|
|
341
|
+
*/
|
|
342
|
+
this.thyHorizontal = input('');
|
|
343
|
+
/**
|
|
344
|
+
* 是否垂直排列
|
|
345
|
+
* @default false
|
|
346
|
+
*/
|
|
347
|
+
this.thyVertical = input(false, { transform: coerceBooleanProperty });
|
|
324
348
|
/**
|
|
325
349
|
* 是否是填充模式
|
|
326
350
|
*/
|
|
327
|
-
this.thyFill = false;
|
|
351
|
+
this.thyFill = input(false, { transform: coerceBooleanProperty });
|
|
352
|
+
/**
|
|
353
|
+
* 是否响应式,自动计算宽度存放 thyNavItem,并添加更多弹框
|
|
354
|
+
* @default false
|
|
355
|
+
*/
|
|
356
|
+
this.thyResponsive = input(undefined, { transform: coerceBooleanProperty });
|
|
328
357
|
/**
|
|
329
358
|
* 支持暂停自适应计算
|
|
330
359
|
*/
|
|
@@ -333,77 +362,57 @@ class ThyNav {
|
|
|
333
362
|
* 更多操作的菜单点击内部是否可关闭
|
|
334
363
|
* @deprecated please use thyPopoverOptions
|
|
335
364
|
*/
|
|
336
|
-
this.thyInsideClosable = true;
|
|
365
|
+
this.thyInsideClosable = input(true, { transform: coerceBooleanProperty });
|
|
337
366
|
/**
|
|
338
367
|
* 更多菜单弹出框的参数,底层使用 Popover 组件
|
|
339
368
|
* @type ThyPopoverConfig
|
|
340
369
|
*/
|
|
341
370
|
this.thyPopoverOptions = input(null);
|
|
371
|
+
/**
|
|
372
|
+
* 右侧额外区域模板
|
|
373
|
+
* @type TemplateRef
|
|
374
|
+
*/
|
|
375
|
+
this.thyExtra = input();
|
|
376
|
+
/**
|
|
377
|
+
* @private
|
|
378
|
+
*/
|
|
379
|
+
this.routers = contentChildren(RouterLinkActive, { descendants: true });
|
|
380
|
+
/**
|
|
381
|
+
* 响应式模式下更多操作模板
|
|
382
|
+
* @type TemplateRef
|
|
383
|
+
*/
|
|
384
|
+
this.moreOperation = contentChild('more');
|
|
385
|
+
/**
|
|
386
|
+
* 响应式模式下更多弹框模板
|
|
387
|
+
* @type TemplateRef
|
|
388
|
+
*/
|
|
389
|
+
this.morePopover = contentChild('morePopover');
|
|
390
|
+
/**
|
|
391
|
+
* 右侧额外区域模板,支持 thyExtra 传参和 <ng-template #extra></ng-template> 模板
|
|
392
|
+
* @name extra
|
|
393
|
+
* @type TemplateRef
|
|
394
|
+
*/
|
|
395
|
+
this.extra = contentChild('extra');
|
|
396
|
+
this.defaultMoreOperation = viewChild('moreOperationContainer');
|
|
397
|
+
this.inkBar = viewChild.required(ThyNavInkBarDirective);
|
|
398
|
+
this.horizontal = computed(() => {
|
|
399
|
+
const horizontalValue = this.thyHorizontal();
|
|
400
|
+
return horizontalValue === 'right' ? 'end' : horizontalValue;
|
|
401
|
+
});
|
|
342
402
|
this.prevActiveIndex = NaN;
|
|
343
403
|
this.navSubscription = null;
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
* 导航类型
|
|
347
|
-
* @type pulled | tabs | pills | lite | primary | secondary | thirdly | secondary-divider
|
|
348
|
-
* @default pulled
|
|
349
|
-
*/
|
|
350
|
-
set thyType(type) {
|
|
351
|
-
this.type = type || 'pulled';
|
|
352
|
-
if (this.initialized) {
|
|
404
|
+
this.type = computed(() => this.thyType() || 'pulled');
|
|
405
|
+
effect(() => {
|
|
353
406
|
this.updateClasses();
|
|
354
|
-
}
|
|
355
|
-
}
|
|
356
|
-
/**
|
|
357
|
-
* 导航大小
|
|
358
|
-
* @type lg | md | sm
|
|
359
|
-
* @default md
|
|
360
|
-
*/
|
|
361
|
-
set thySize(size) {
|
|
362
|
-
this.size = size;
|
|
363
|
-
if (this.initialized) {
|
|
364
|
-
this.updateClasses();
|
|
365
|
-
}
|
|
366
|
-
}
|
|
367
|
-
/**
|
|
368
|
-
* 水平排列
|
|
369
|
-
* @type '' | 'start' | 'center' | 'end'
|
|
370
|
-
* @default false
|
|
371
|
-
*/
|
|
372
|
-
set thyHorizontal(horizontal) {
|
|
373
|
-
this.horizontal = horizontal === 'right' ? 'end' : horizontal;
|
|
374
|
-
}
|
|
375
|
-
/**
|
|
376
|
-
* @private
|
|
377
|
-
*/
|
|
378
|
-
set links(value) {
|
|
379
|
-
this.innerLinks = value;
|
|
380
|
-
this.prevActiveIndex = NaN;
|
|
381
|
-
}
|
|
382
|
-
get links() {
|
|
383
|
-
return this.innerLinks;
|
|
384
|
-
}
|
|
385
|
-
get showInkBar() {
|
|
386
|
-
const showTypes = ['pulled', 'tabs'];
|
|
387
|
-
return showTypes.includes(this.type);
|
|
388
|
-
}
|
|
389
|
-
updateClasses() {
|
|
390
|
-
let classNames = [];
|
|
391
|
-
if (navTypeClassesMap[this.type]) {
|
|
392
|
-
classNames = [...navTypeClassesMap[this.type]];
|
|
393
|
-
}
|
|
394
|
-
if (navSizeClassesMap[this.size]) {
|
|
395
|
-
classNames.push(navSizeClassesMap[this.size]);
|
|
396
|
-
}
|
|
397
|
-
this.hostRenderer.updateClass(classNames);
|
|
407
|
+
});
|
|
398
408
|
}
|
|
399
409
|
ngOnInit() {
|
|
400
|
-
if (!this.thyResponsive) {
|
|
410
|
+
if (!this.thyResponsive()) {
|
|
401
411
|
this.initialized = true;
|
|
402
412
|
}
|
|
403
|
-
this.updateClasses();
|
|
404
413
|
}
|
|
405
414
|
ngAfterViewInit() {
|
|
406
|
-
if (this.thyResponsive) {
|
|
415
|
+
if (this.thyResponsive()) {
|
|
407
416
|
this.setMoreBtnOffset();
|
|
408
417
|
this.ngZone.onStable.pipe(take(1)).subscribe(() => {
|
|
409
418
|
this.setMoreBtnOffset();
|
|
@@ -416,18 +425,18 @@ class ThyNav {
|
|
|
416
425
|
if (this.navSubscription) {
|
|
417
426
|
this.navSubscription.unsubscribe();
|
|
418
427
|
}
|
|
419
|
-
this.navSubscription = merge(this.createResizeObserver(this.elementRef.nativeElement), ...this.links.map(item => this.createResizeObserver(item.elementRef.nativeElement).pipe(tap(() => item.setOffset()))), ...(this.routers || []).map(router => router?.isActiveChange))
|
|
428
|
+
this.navSubscription = merge(this.createResizeObserver(this.elementRef.nativeElement), ...this.links.map(item => this.createResizeObserver(item.elementRef.nativeElement).pipe(tap(() => item.setOffset()))), ...(this.routers() || []).map(router => router?.isActiveChange))
|
|
420
429
|
.pipe(takeUntilDestroyed(this.destroyRef), tap(() => {
|
|
421
430
|
if (this.thyPauseReCalculate()) {
|
|
422
431
|
return;
|
|
423
432
|
}
|
|
424
|
-
if (this.thyResponsive) {
|
|
433
|
+
if (this.thyResponsive()) {
|
|
425
434
|
this.setMoreBtnOffset();
|
|
426
435
|
this.resetSizes();
|
|
427
436
|
this.setHiddenItems();
|
|
428
437
|
this.calculateMoreIsActive();
|
|
429
438
|
}
|
|
430
|
-
if (this.type === 'card') {
|
|
439
|
+
if (this.type() === 'card') {
|
|
431
440
|
this.setNavItemDivider();
|
|
432
441
|
}
|
|
433
442
|
}))
|
|
@@ -438,7 +447,7 @@ class ThyNav {
|
|
|
438
447
|
});
|
|
439
448
|
}
|
|
440
449
|
ngAfterContentInit() {
|
|
441
|
-
if (this.thyResponsive) {
|
|
450
|
+
if (this.thyResponsive()) {
|
|
442
451
|
this.ngZone.onStable.pipe(take(1)).subscribe(() => {
|
|
443
452
|
this.resetSizes();
|
|
444
453
|
});
|
|
@@ -448,17 +457,18 @@ class ThyNav {
|
|
|
448
457
|
this.calculateMoreIsActive();
|
|
449
458
|
this.curActiveIndex = this.links && this.links.length ? this.links.toArray().findIndex(item => item.linkIsActive()) : -1;
|
|
450
459
|
if (this.curActiveIndex < 0) {
|
|
451
|
-
this.inkBar.hide();
|
|
460
|
+
this.inkBar().hide();
|
|
452
461
|
}
|
|
453
462
|
else if (this.curActiveIndex !== this.prevActiveIndex) {
|
|
454
463
|
this.alignInkBarToSelectedTab();
|
|
455
464
|
}
|
|
456
465
|
}
|
|
457
466
|
setMoreBtnOffset() {
|
|
458
|
-
const
|
|
467
|
+
const defaultMoreOperation = this.defaultMoreOperation();
|
|
468
|
+
const computedStyle = window.getComputedStyle(defaultMoreOperation?.nativeElement);
|
|
459
469
|
this.moreBtnOffset = {
|
|
460
|
-
height:
|
|
461
|
-
width:
|
|
470
|
+
height: defaultMoreOperation?.nativeElement?.offsetHeight + parseFloat(computedStyle?.marginBottom) || 0,
|
|
471
|
+
width: defaultMoreOperation?.nativeElement?.offsetWidth + parseFloat(computedStyle?.marginRight) || 0
|
|
462
472
|
};
|
|
463
473
|
}
|
|
464
474
|
setNavItemDivider() {
|
|
@@ -500,7 +510,7 @@ class ThyNav {
|
|
|
500
510
|
this.showMore.set(false);
|
|
501
511
|
return;
|
|
502
512
|
}
|
|
503
|
-
const endIndex = this.thyVertical ? this.getShowItemsEndIndexWhenVertical(tabs) : this.getShowItemsEndIndexWhenHorizontal(tabs);
|
|
513
|
+
const endIndex = this.thyVertical() ? this.getShowItemsEndIndexWhenVertical(tabs) : this.getShowItemsEndIndexWhenHorizontal(tabs);
|
|
504
514
|
const showItems = tabs.slice(0, endIndex + 1);
|
|
505
515
|
(showItems || []).forEach(item => {
|
|
506
516
|
item.setNavLinkHidden(false);
|
|
@@ -582,18 +592,18 @@ class ThyNav {
|
|
|
582
592
|
}
|
|
583
593
|
alignInkBarToSelectedTab() {
|
|
584
594
|
if (!this.showInkBar) {
|
|
585
|
-
this.inkBar.hide();
|
|
595
|
+
this.inkBar().hide();
|
|
586
596
|
return;
|
|
587
597
|
}
|
|
588
598
|
const tabs = this.links?.toArray() ?? [];
|
|
589
599
|
const selectedItem = tabs.find(item => item.linkIsActive());
|
|
590
600
|
let selectedItemElement = selectedItem && selectedItem.elementRef.nativeElement;
|
|
591
601
|
if (selectedItem && this.moreActive) {
|
|
592
|
-
selectedItemElement = this.defaultMoreOperation.nativeElement;
|
|
602
|
+
selectedItemElement = this.defaultMoreOperation().nativeElement;
|
|
593
603
|
}
|
|
594
604
|
if (selectedItemElement) {
|
|
595
605
|
this.prevActiveIndex = this.curActiveIndex;
|
|
596
|
-
this.inkBar.alignToElement(selectedItemElement);
|
|
606
|
+
this.inkBar().alignToElement(selectedItemElement);
|
|
597
607
|
}
|
|
598
608
|
}
|
|
599
609
|
ngOnChanges(changes) {
|
|
@@ -608,12 +618,14 @@ class ThyNav {
|
|
|
608
618
|
}
|
|
609
619
|
}
|
|
610
620
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: ThyNav, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
611
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.8", type: ThyNav, isStandalone: true, selector: "thy-nav", inputs: { thyType: { classPropertyName: "thyType", publicName: "thyType", isSignal:
|
|
621
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.8", type: ThyNav, isStandalone: true, selector: "thy-nav", inputs: { thyType: { classPropertyName: "thyType", publicName: "thyType", isSignal: true, isRequired: false, transformFunction: null }, thySize: { classPropertyName: "thySize", publicName: "thySize", isSignal: true, isRequired: false, transformFunction: null }, thyHorizontal: { classPropertyName: "thyHorizontal", publicName: "thyHorizontal", isSignal: true, isRequired: false, transformFunction: null }, thyVertical: { classPropertyName: "thyVertical", publicName: "thyVertical", isSignal: true, isRequired: false, transformFunction: null }, thyFill: { classPropertyName: "thyFill", publicName: "thyFill", isSignal: true, isRequired: false, transformFunction: null }, thyResponsive: { classPropertyName: "thyResponsive", publicName: "thyResponsive", isSignal: true, isRequired: false, transformFunction: null }, thyPauseReCalculate: { classPropertyName: "thyPauseReCalculate", publicName: "thyPauseReCalculate", isSignal: true, isRequired: false, transformFunction: null }, thyInsideClosable: { classPropertyName: "thyInsideClosable", publicName: "thyInsideClosable", isSignal: true, isRequired: false, transformFunction: null }, thyPopoverOptions: { classPropertyName: "thyPopoverOptions", publicName: "thyPopoverOptions", isSignal: true, isRequired: false, transformFunction: null }, thyExtra: { classPropertyName: "thyExtra", publicName: "thyExtra", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class.thy-nav": "true", "class.thy-nav--vertical": "thyVertical()", "class.thy-nav--fill": "thyFill()" } }, queries: [{ propertyName: "routers", predicate: RouterLinkActive, descendants: true, isSignal: true }, { propertyName: "moreOperation", first: true, predicate: ["more"], descendants: true, isSignal: true }, { propertyName: "morePopover", first: true, predicate: ["morePopover"], descendants: true, isSignal: true }, { propertyName: "extra", first: true, predicate: ["extra"], descendants: true, isSignal: true }, { propertyName: "links", predicate: ThyNavItemDirective, descendants: true }], viewQueries: [{ propertyName: "defaultMoreOperation", first: true, predicate: ["moreOperationContainer"], descendants: true, isSignal: true }, { propertyName: "inkBar", first: true, predicate: ThyNavInkBarDirective, descendants: true, isSignal: true }], usesOnChanges: true, ngImport: i0, template: "<div class=\"thy-nav-list\" [ngClass]=\"horizontal() ? 'justify-content-' + horizontal() : ''\" #navList>\n <ng-container [ngTemplateOutlet]=\"content\"></ng-container>\n @if (thyResponsive()) {\n <a\n href=\"javascript:;\"\n class=\"thy-nav-more-container\"\n [class.d-none]=\"!showMore()\"\n [class.invisible]=\"!initialized\"\n #moreOperationContainer\n thyNavLink\n [thyNavItemActive]=\"moreActive\"\n (click)=\"openMoreMenu($event, navListPopover)\">\n @if (moreOperation()) {\n <ng-container [ngTemplateOutlet]=\"moreOperation()\"></ng-container>\n } @else {\n {{ locale().more }}\n <thy-icon thyIconName=\"angle-down\" class=\"thy-nav-more-icon\"></thy-icon>\n }\n </a>\n }\n @if (thyExtra() || extra()) {\n <div class=\"thy-nav-extra\">\n <ng-container [ngTemplateOutlet]=\"thyExtra() || extra()\"></ng-container>\n </div>\n }\n <thy-nav-ink-bar [showInkBar]=\"showInkBar\" [isVertical]=\"thyVertical()\"></thy-nav-ink-bar>\n</div>\n\n<ng-template #navListPopover>\n @if (morePopover()) {\n <ng-container [ngTemplateOutlet]=\"morePopover()\" [ngTemplateOutletContext]=\"{ $implicit: hiddenItems }\"></ng-container>\n } @else {\n <thy-dropdown-menu thyImmediateRender>\n @for (item of hiddenItems; track $index) {\n <span\n class=\"thy-nav-item-more\"\n thyDropdownMenuItem\n [thyDropdownMenuItemActive]=\"item.isActive\"\n (click)=\"navItemClick(item)\"\n [innerHTML]=\"item.elementRef.nativeElement.innerHTML | bypassSecurityTrustHtml\"></span>\n }\n </thy-dropdown-menu>\n }\n</ng-template>\n\n<ng-template #content>\n <ng-content></ng-content>\n</ng-template>\n", dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: ThyNavItemDirective, selector: "[thyNavLink],[thyNavItem]", inputs: ["id", "thyNavItemActive", "thyNavLinkActive", "thyNavItemDisabled"] }, { kind: "component", type: ThyIcon, selector: "thy-icon, [thy-icon]", inputs: ["thyIconType", "thyTwotoneColor", "thyIconName", "thyIconRotate", "thyIconSet", "thyIconLegging", "thyIconLinearGradient"] }, { kind: "directive", type: ThyNavInkBarDirective, selector: "thy-nav-ink-bar, [thyNavInkBar]", inputs: ["isVertical", "showInkBar"] }, { kind: "component", type: ThyDropdownMenuComponent, selector: "thy-dropdown-menu", inputs: ["thyWidth", "thyImmediateRender"] }, { kind: "directive", type: ThyDropdownMenuItemDirective, selector: "[thyDropdownMenuItem]", inputs: ["thyType", "thyDisabled"] }, { kind: "directive", type: ThyDropdownMenuItemActiveDirective, selector: "[thyDropdownMenuItemActive]", inputs: ["thyDropdownMenuItemActive"] }, { kind: "pipe", type: BypassSecurityTrustHtmlPipe, name: "bypassSecurityTrustHtml" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
612
622
|
}
|
|
613
623
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: ThyNav, decorators: [{
|
|
614
624
|
type: Component,
|
|
615
625
|
args: [{ selector: 'thy-nav', host: {
|
|
616
|
-
class
|
|
626
|
+
'[class.thy-nav]': 'true',
|
|
627
|
+
'[class.thy-nav--vertical]': 'thyVertical()',
|
|
628
|
+
'[class.thy-nav--fill]': 'thyFill()'
|
|
617
629
|
}, changeDetection: ChangeDetectionStrategy.OnPush, imports: [
|
|
618
630
|
NgClass,
|
|
619
631
|
NgTemplateOutlet,
|
|
@@ -624,54 +636,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImpor
|
|
|
624
636
|
ThyDropdownMenuItemDirective,
|
|
625
637
|
ThyDropdownMenuItemActiveDirective,
|
|
626
638
|
BypassSecurityTrustHtmlPipe
|
|
627
|
-
], template: "<div class=\"thy-nav-list\" [ngClass]=\"horizontal ? 'justify-content-' + horizontal : ''\" #navList>\n <ng-container [ngTemplateOutlet]=\"content\"></ng-container>\n @if (thyResponsive) {\n <a\n href=\"javascript:;\"\n class=\"thy-nav-more-container\"\n [class.d-none]=\"!showMore()\"\n [class.invisible]=\"!initialized\"\n #moreOperationContainer\n thyNavLink\n [thyNavItemActive]=\"moreActive\"\n (click)=\"openMoreMenu($event, navListPopover)\">\n @if (moreOperation) {\n <ng-container [ngTemplateOutlet]=\"moreOperation\"></ng-container>\n } @else {\n {{ locale().more }}\n <thy-icon thyIconName=\"angle-down\" class=\"thy-nav-more-icon\"></thy-icon>\n }\n </a>\n }\n @if (thyExtra || extra) {\n <div class=\"thy-nav-extra\">\n <ng-container [ngTemplateOutlet]=\"thyExtra || extra\"></ng-container>\n </div>\n }\n <thy-nav-ink-bar [showInkBar]=\"showInkBar\" [isVertical]=\"thyVertical\"></thy-nav-ink-bar>\n</div>\n\n<ng-template #navListPopover>\n @if (morePopover) {\n <ng-container [ngTemplateOutlet]=\"morePopover\" [ngTemplateOutletContext]=\"{ $implicit: hiddenItems }\"></ng-container>\n } @else {\n <thy-dropdown-menu thyImmediateRender>\n @for (item of hiddenItems; track $index) {\n <span\n class=\"thy-nav-item-more\"\n thyDropdownMenuItem\n [thyDropdownMenuItemActive]=\"item.isActive\"\n (click)=\"navItemClick(item)\"\n [innerHTML]=\"item.elementRef.nativeElement.innerHTML | bypassSecurityTrustHtml\"></span>\n }\n </thy-dropdown-menu>\n }\n</ng-template>\n\n<ng-template #content>\n <ng-content></ng-content>\n</ng-template>\n" }]
|
|
628
|
-
}], propDecorators: {
|
|
629
|
-
type: Input
|
|
630
|
-
}], thySize: [{
|
|
631
|
-
type: Input
|
|
632
|
-
}], thyHorizontal: [{
|
|
633
|
-
type: Input
|
|
634
|
-
}], thyVertical: [{
|
|
635
|
-
type: HostBinding,
|
|
636
|
-
args: ['class.thy-nav--vertical']
|
|
637
|
-
}, {
|
|
638
|
-
type: Input,
|
|
639
|
-
args: [{ transform: coerceBooleanProperty }]
|
|
640
|
-
}], thyFill: [{
|
|
641
|
-
type: HostBinding,
|
|
642
|
-
args: ['class.thy-nav--fill']
|
|
643
|
-
}, {
|
|
644
|
-
type: Input,
|
|
645
|
-
args: [{ transform: coerceBooleanProperty }]
|
|
646
|
-
}], thyResponsive: [{
|
|
647
|
-
type: Input,
|
|
648
|
-
args: [{ transform: coerceBooleanProperty }]
|
|
649
|
-
}], thyInsideClosable: [{
|
|
650
|
-
type: Input,
|
|
651
|
-
args: [{ transform: coerceBooleanProperty }]
|
|
652
|
-
}], thyExtra: [{
|
|
653
|
-
type: Input
|
|
654
|
-
}], links: [{
|
|
639
|
+
], template: "<div class=\"thy-nav-list\" [ngClass]=\"horizontal() ? 'justify-content-' + horizontal() : ''\" #navList>\n <ng-container [ngTemplateOutlet]=\"content\"></ng-container>\n @if (thyResponsive()) {\n <a\n href=\"javascript:;\"\n class=\"thy-nav-more-container\"\n [class.d-none]=\"!showMore()\"\n [class.invisible]=\"!initialized\"\n #moreOperationContainer\n thyNavLink\n [thyNavItemActive]=\"moreActive\"\n (click)=\"openMoreMenu($event, navListPopover)\">\n @if (moreOperation()) {\n <ng-container [ngTemplateOutlet]=\"moreOperation()\"></ng-container>\n } @else {\n {{ locale().more }}\n <thy-icon thyIconName=\"angle-down\" class=\"thy-nav-more-icon\"></thy-icon>\n }\n </a>\n }\n @if (thyExtra() || extra()) {\n <div class=\"thy-nav-extra\">\n <ng-container [ngTemplateOutlet]=\"thyExtra() || extra()\"></ng-container>\n </div>\n }\n <thy-nav-ink-bar [showInkBar]=\"showInkBar\" [isVertical]=\"thyVertical()\"></thy-nav-ink-bar>\n</div>\n\n<ng-template #navListPopover>\n @if (morePopover()) {\n <ng-container [ngTemplateOutlet]=\"morePopover()\" [ngTemplateOutletContext]=\"{ $implicit: hiddenItems }\"></ng-container>\n } @else {\n <thy-dropdown-menu thyImmediateRender>\n @for (item of hiddenItems; track $index) {\n <span\n class=\"thy-nav-item-more\"\n thyDropdownMenuItem\n [thyDropdownMenuItemActive]=\"item.isActive\"\n (click)=\"navItemClick(item)\"\n [innerHTML]=\"item.elementRef.nativeElement.innerHTML | bypassSecurityTrustHtml\"></span>\n }\n </thy-dropdown-menu>\n }\n</ng-template>\n\n<ng-template #content>\n <ng-content></ng-content>\n</ng-template>\n" }]
|
|
640
|
+
}], ctorParameters: () => [], propDecorators: { links: [{
|
|
655
641
|
type: ContentChildren,
|
|
656
642
|
args: [ThyNavItemDirective, { descendants: true }]
|
|
657
|
-
}], routers: [{
|
|
658
|
-
type: ContentChildren,
|
|
659
|
-
args: [RouterLinkActive, { descendants: true }]
|
|
660
|
-
}], moreOperation: [{
|
|
661
|
-
type: ContentChild,
|
|
662
|
-
args: ['more']
|
|
663
|
-
}], morePopover: [{
|
|
664
|
-
type: ContentChild,
|
|
665
|
-
args: ['morePopover']
|
|
666
|
-
}], extra: [{
|
|
667
|
-
type: ContentChild,
|
|
668
|
-
args: ['extra']
|
|
669
|
-
}], defaultMoreOperation: [{
|
|
670
|
-
type: ViewChild,
|
|
671
|
-
args: ['moreOperationContainer']
|
|
672
|
-
}], inkBar: [{
|
|
673
|
-
type: ViewChild,
|
|
674
|
-
args: [ThyNavInkBarDirective, { static: true }]
|
|
675
643
|
}] } });
|
|
676
644
|
|
|
677
645
|
class ThyNavModule {
|