ngx-tethys 19.1.0-next.4 → 19.1.0-next.6
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 +24 -0
- package/date-picker/abstract-picker.component.d.ts +50 -52
- package/date-picker/abstract-picker.directive.d.ts +15 -40
- package/date-picker/base-picker.component.d.ts +11 -40
- package/date-picker/date-picker.config.d.ts +1 -0
- package/date-picker/lib/calendar/calendar-footer.component.d.ts +24 -19
- package/date-picker/lib/calendar/calendar-header.component.d.ts +15 -15
- package/date-picker/lib/calendar/calendar-table.component.d.ts +15 -16
- package/date-picker/lib/date/date-table-cell.component.d.ts +2 -3
- package/date-picker/lib/date/date-table.component.d.ts +2 -3
- package/date-picker/lib/date-carousel/date-carousel.component.d.ts +2 -3
- package/date-picker/lib/decade/decade-header.component.d.ts +2 -5
- package/date-picker/lib/decade/decade-table.component.d.ts +3 -5
- package/date-picker/lib/month/month-table.component.d.ts +1 -2
- package/date-picker/lib/popups/date-popup.component.d.ts +33 -34
- package/date-picker/lib/popups/inner-popup.component.d.ts +22 -29
- package/date-picker/lib/quarter/quarter-table.component.d.ts +1 -4
- package/date-picker/lib/year/year-header.component.d.ts +2 -4
- package/date-picker/lib/year/year-table.component.d.ts +2 -4
- package/date-picker/month-picker.component.d.ts +2 -2
- package/date-picker/picker.component.d.ts +30 -34
- package/date-picker/picker.pipes.d.ts +4 -5
- package/date-picker/picker.util.d.ts +5 -5
- package/date-picker/picker.validators.d.ts +4 -8
- package/date-picker/quarter-picker.component.d.ts +2 -3
- package/date-picker/week-picker.component.d.ts +0 -1
- package/date-picker/year-picker.component.d.ts +2 -3
- package/dropdown/dropdown.directive.d.ts +2 -1
- package/fesm2022/ngx-tethys-autocomplete.mjs +4 -4
- package/fesm2022/ngx-tethys-autocomplete.mjs.map +1 -1
- package/fesm2022/ngx-tethys-checkbox.mjs +2 -2
- package/fesm2022/ngx-tethys-checkbox.mjs.map +1 -1
- package/fesm2022/ngx-tethys-date-picker.mjs +833 -1060
- package/fesm2022/ngx-tethys-date-picker.mjs.map +1 -1
- package/fesm2022/ngx-tethys-divider.mjs +5 -5
- package/fesm2022/ngx-tethys-divider.mjs.map +1 -1
- package/fesm2022/ngx-tethys-dropdown.mjs +2 -1
- package/fesm2022/ngx-tethys-dropdown.mjs.map +1 -1
- package/fesm2022/ngx-tethys-i18n.mjs +11 -6
- package/fesm2022/ngx-tethys-i18n.mjs.map +1 -1
- package/fesm2022/ngx-tethys-layout.mjs +291 -334
- package/fesm2022/ngx-tethys-layout.mjs.map +1 -1
- package/fesm2022/ngx-tethys-list.mjs +11 -10
- package/fesm2022/ngx-tethys-list.mjs.map +1 -1
- package/fesm2022/ngx-tethys-radio.mjs +4 -4
- package/fesm2022/ngx-tethys-radio.mjs.map +1 -1
- package/fesm2022/ngx-tethys-select.mjs +164 -228
- package/fesm2022/ngx-tethys-select.mjs.map +1 -1
- package/fesm2022/ngx-tethys-shared.mjs +371 -523
- package/fesm2022/ngx-tethys-shared.mjs.map +1 -1
- package/fesm2022/ngx-tethys-tree-select.mjs +215 -281
- package/fesm2022/ngx-tethys-tree-select.mjs.map +1 -1
- package/fesm2022/ngx-tethys.mjs +1 -1
- package/fesm2022/ngx-tethys.mjs.map +1 -1
- package/i18n/i18n.d.ts +2 -1
- package/i18n/locales/de-de.d.ts +2 -1
- package/i18n/locales/en-us.d.ts +2 -1
- package/i18n/locales/ja-jp.d.ts +2 -1
- package/i18n/locales/zh-hans.d.ts +2 -1
- package/i18n/locales/zh-hant.d.ts +2 -1
- package/layout/header.component.d.ts +15 -19
- package/layout/layout.component.d.ts +3 -2
- package/layout/sidebar-header.component.d.ts +7 -8
- package/layout/sidebar.component.d.ts +32 -62
- package/package.json +54 -54
- package/schematics/version.d.ts +1 -1
- package/schematics/version.js +1 -1
- package/select/custom-select/custom-select.component.d.ts +33 -56
- package/select/native-select/native-select.component.d.ts +7 -13
- package/shared/base-form-check.component.d.ts +6 -8
- package/shared/directives/string-or-template-outlet.directive.d.ts +5 -6
- package/shared/directives/thy-autofocus.directive.d.ts +4 -6
- package/shared/directives/thy-scroll.directive.d.ts +5 -8
- package/shared/directives/thy-show.d.ts +3 -4
- package/shared/directives/thy-stop-propagation.directive.d.ts +4 -4
- package/shared/directives/view-outlet.directive.d.ts +6 -7
- package/shared/ng-transclude.directive.d.ts +2 -3
- package/shared/option/group/option-group.component.d.ts +5 -9
- package/shared/option/list-option/list-option.component.d.ts +4 -8
- package/shared/option/option.component.d.ts +10 -17
- package/shared/option/options-container.component.d.ts +1 -1
- package/shared/select/select-control/select-control.component.d.ts +27 -47
- package/tree-select/tree-select.component.d.ts +53 -70
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { Directive, ChangeDetectionStrategy, Component,
|
|
2
|
+
import { signal, computed, Directive, ChangeDetectionStrategy, Component, input, contentChild, inject, linkedSignal, ElementRef, numberAttribute, output, effect, HostListener, NgModule } from '@angular/core';
|
|
3
3
|
import { NgTemplateOutlet, NgClass, CommonModule } from '@angular/common';
|
|
4
4
|
import { ThyIcon, ThyIconModule } from 'ngx-tethys/icon';
|
|
5
5
|
import { coerceBooleanProperty } from 'ngx-tethys/util';
|
|
@@ -17,11 +17,13 @@ import { DragDropModule } from '@angular/cdk/drag-drop';
|
|
|
17
17
|
*/
|
|
18
18
|
class ThyLayoutDirective {
|
|
19
19
|
constructor() {
|
|
20
|
-
this.
|
|
21
|
-
this.isSidebarRight =
|
|
20
|
+
this.sidebarDirection = signal(null);
|
|
21
|
+
this.isSidebarRight = computed(() => {
|
|
22
|
+
return this.sidebarDirection() === 'right';
|
|
23
|
+
});
|
|
22
24
|
}
|
|
23
25
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: ThyLayoutDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
24
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.8", type: ThyLayoutDirective, isStandalone: true, selector: "[thyLayout]:not([thyForm]):not(thy-form):not(thy-radio-group):not(thy-properties):not(thy-selection-list):not(thy-vote):not([thyVote])", host: { properties: { "class.thy-layout--has-sidebar": "
|
|
26
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.8", type: ThyLayoutDirective, isStandalone: true, selector: "[thyLayout]:not([thyForm]):not(thy-form):not(thy-radio-group):not(thy-properties):not(thy-selection-list):not(thy-vote):not([thyVote])", host: { properties: { "class.thy-layout--has-sidebar": "sidebarDirection()", "class.thy-layout--is-sidebar-right": "isSidebarRight()" }, classAttribute: "thy-layout" }, ngImport: i0 }); }
|
|
25
27
|
}
|
|
26
28
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: ThyLayoutDirective, decorators: [{
|
|
27
29
|
type: Directive,
|
|
@@ -29,8 +31,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImpor
|
|
|
29
31
|
selector: '[thyLayout]:not([thyForm]):not(thy-form):not(thy-radio-group):not(thy-properties):not(thy-selection-list):not(thy-vote):not([thyVote])',
|
|
30
32
|
host: {
|
|
31
33
|
class: 'thy-layout',
|
|
32
|
-
'[class.thy-layout--has-sidebar]': '
|
|
33
|
-
'[class.thy-layout--is-sidebar-right]': 'isSidebarRight'
|
|
34
|
+
'[class.thy-layout--has-sidebar]': 'sidebarDirection()',
|
|
35
|
+
'[class.thy-layout--is-sidebar-right]': 'isSidebarRight()'
|
|
34
36
|
}
|
|
35
37
|
}]
|
|
36
38
|
}] });
|
|
@@ -64,29 +66,31 @@ class ThyHeaderDirective {
|
|
|
64
66
|
* 头部大小
|
|
65
67
|
* @type sm | md | lg | xlg
|
|
66
68
|
*/
|
|
67
|
-
this.thySize = 'md';
|
|
69
|
+
this.thySize = input('md');
|
|
68
70
|
/**
|
|
69
71
|
* 底部是否有阴影
|
|
70
72
|
* @default false
|
|
71
73
|
*/
|
|
72
|
-
this.thyShadow = false;
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
74
|
+
this.thyShadow = input(false, { transform: coerceBooleanProperty });
|
|
75
|
+
/**
|
|
76
|
+
* 底部是否有分割线
|
|
77
|
+
*/
|
|
78
|
+
this.thyDivided = input(false, { transform: coerceBooleanProperty });
|
|
79
|
+
/**
|
|
80
|
+
* 底部是否有分割线,已废弃,请使用 thyDivided
|
|
81
|
+
* @deprecated please use thyDivided
|
|
82
|
+
*/
|
|
83
|
+
this.thyHasBorder = input(false, { transform: coerceBooleanProperty });
|
|
84
|
+
this.divided = computed(() => {
|
|
85
|
+
const value = this.thyDivided();
|
|
86
|
+
if (value !== undefined) {
|
|
87
|
+
return value;
|
|
88
|
+
}
|
|
89
|
+
return this.thyHasBorder();
|
|
90
|
+
});
|
|
87
91
|
}
|
|
88
92
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: ThyHeaderDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
89
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "
|
|
93
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.8", type: ThyHeaderDirective, isStandalone: true, selector: "[thyHeader]", inputs: { thySize: { classPropertyName: "thySize", publicName: "thySize", isSignal: true, isRequired: false, transformFunction: null }, thyShadow: { classPropertyName: "thyShadow", publicName: "thyShadow", isSignal: true, isRequired: false, transformFunction: null }, thyDivided: { classPropertyName: "thyDivided", publicName: "thyDivided", isSignal: true, isRequired: false, transformFunction: null }, thyHasBorder: { classPropertyName: "thyHasBorder", publicName: "thyHasBorder", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class.thy-layout-header-sm": "thySize() === 'sm'", "class.thy-layout-header-lg": "thySize() === 'lg'", "class.thy-layout-header-xlg": "thySize() === 'xlg'", "class.thy-layout-header-shadow": "thyShadow()", "class.thy-layout-header-divided": "divided()" }, classAttribute: "thy-layout-header" }, ngImport: i0 }); }
|
|
90
94
|
}
|
|
91
95
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: ThyHeaderDirective, decorators: [{
|
|
92
96
|
type: Directive,
|
|
@@ -94,26 +98,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImpor
|
|
|
94
98
|
selector: '[thyHeader]',
|
|
95
99
|
host: {
|
|
96
100
|
class: `thy-layout-header`,
|
|
97
|
-
'[class.thy-layout-header-sm]': `thySize === 'sm'`,
|
|
98
|
-
'[class.thy-layout-header-lg]': `thySize === 'lg'`,
|
|
99
|
-
'[class.thy-layout-header-xlg]': `thySize === 'xlg'`,
|
|
100
|
-
'[class.thy-layout-header-shadow]': `thyShadow`,
|
|
101
|
-
'[class.thy-layout-header-divided]': `divided`
|
|
101
|
+
'[class.thy-layout-header-sm]': `thySize() === 'sm'`,
|
|
102
|
+
'[class.thy-layout-header-lg]': `thySize() === 'lg'`,
|
|
103
|
+
'[class.thy-layout-header-xlg]': `thySize() === 'xlg'`,
|
|
104
|
+
'[class.thy-layout-header-shadow]': `thyShadow()`,
|
|
105
|
+
'[class.thy-layout-header-divided]': `divided()`
|
|
102
106
|
}
|
|
103
107
|
}]
|
|
104
|
-
}]
|
|
105
|
-
type: Input,
|
|
106
|
-
args: ['thySize']
|
|
107
|
-
}], thyShadow: [{
|
|
108
|
-
type: Input,
|
|
109
|
-
args: [{ transform: coerceBooleanProperty }]
|
|
110
|
-
}], thyDivided: [{
|
|
111
|
-
type: Input,
|
|
112
|
-
args: [{ transform: coerceBooleanProperty }]
|
|
113
|
-
}], thyHasBorder: [{
|
|
114
|
-
type: Input,
|
|
115
|
-
args: [{ transform: coerceBooleanProperty }]
|
|
116
|
-
}] } });
|
|
108
|
+
}] });
|
|
117
109
|
/**
|
|
118
110
|
* 头部布局组件
|
|
119
111
|
* @name thy-header
|
|
@@ -121,30 +113,56 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImpor
|
|
|
121
113
|
*/
|
|
122
114
|
class ThyHeader {
|
|
123
115
|
constructor() {
|
|
116
|
+
/**
|
|
117
|
+
* 头部标题
|
|
118
|
+
*/
|
|
119
|
+
this.thyTitle = input(undefined);
|
|
124
120
|
/**
|
|
125
121
|
* 图标前缀,被弃用,图标使用 SVG 图标
|
|
126
122
|
*/
|
|
127
|
-
this.thyIconPrefix = 'wtf';
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
if (
|
|
135
|
-
|
|
123
|
+
this.thyIconPrefix = input('wtf');
|
|
124
|
+
/**
|
|
125
|
+
* 图标,SVG 图标名称
|
|
126
|
+
*/
|
|
127
|
+
this.thyIcon = input(undefined);
|
|
128
|
+
this.svgIconName = computed(() => {
|
|
129
|
+
const icon = this.thyIcon();
|
|
130
|
+
if (icon && !icon.includes('wtf')) {
|
|
131
|
+
return icon;
|
|
132
|
+
}
|
|
133
|
+
return null;
|
|
134
|
+
});
|
|
135
|
+
this.iconClass = computed(() => {
|
|
136
|
+
const icon = this.svgIconName();
|
|
137
|
+
if (icon) {
|
|
138
|
+
return null;
|
|
136
139
|
}
|
|
137
140
|
else {
|
|
138
|
-
|
|
141
|
+
const icon = this.thyIcon();
|
|
142
|
+
if (icon && icon.includes('wtf')) {
|
|
143
|
+
return `${this.thyIconPrefix()} ${icon}`;
|
|
144
|
+
}
|
|
139
145
|
}
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
146
|
+
return null;
|
|
147
|
+
});
|
|
148
|
+
/**
|
|
149
|
+
* 头部自定义标题模板,`<ng-template #headerTitle></ng-template>`
|
|
150
|
+
* @type TemplateRef
|
|
151
|
+
*/
|
|
152
|
+
this.titleTemplateRef = contentChild('headerTitle');
|
|
153
|
+
/**
|
|
154
|
+
* 头部自定义内容模板,`<ng-template #headerContent></ng-template>`
|
|
155
|
+
* @type TemplateRef
|
|
156
|
+
*/
|
|
157
|
+
this.contentTemplateRef = contentChild('headerContent');
|
|
158
|
+
/**
|
|
159
|
+
* 头部自定义操作模板,`<ng-template #headerOperation></ng-template>`
|
|
160
|
+
* @type TemplateRef
|
|
161
|
+
*/
|
|
162
|
+
this.operationTemplateRef = contentChild('headerOperation');
|
|
145
163
|
}
|
|
146
164
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: ThyHeader, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
147
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.8", type: ThyHeader, isStandalone: true, selector: "thy-header", inputs: { thyTitle: "thyTitle", thyIconPrefix: "thyIconPrefix", thyIcon: "thyIcon" }, queries: [{ propertyName: "titleTemplateRef", first: true, predicate: ["headerTitle"], descendants: true }, { propertyName: "contentTemplateRef", first: true, predicate: ["headerContent"], descendants: true }, { propertyName: "operationTemplateRef", first: true, predicate: ["headerOperation"], descendants: true }], hostDirectives: [{ directive: ThyHeaderDirective, inputs: ["thySize", "thySize", "thyShadow", "thyShadow", "thyHasBorder", "thyHasBorder", "thyDivided", "thyDivided"] }], ngImport: i0, template: "<div class=\"layout-header-title\">\n <ng-template [ngTemplateOutlet]=\"titleTemplateRef\"></ng-template>\n @
|
|
165
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.8", type: ThyHeader, isStandalone: true, selector: "thy-header", inputs: { thyTitle: { classPropertyName: "thyTitle", publicName: "thyTitle", isSignal: true, isRequired: false, transformFunction: null }, thyIconPrefix: { classPropertyName: "thyIconPrefix", publicName: "thyIconPrefix", isSignal: true, isRequired: false, transformFunction: null }, thyIcon: { classPropertyName: "thyIcon", publicName: "thyIcon", isSignal: true, isRequired: false, transformFunction: null } }, queries: [{ propertyName: "titleTemplateRef", first: true, predicate: ["headerTitle"], descendants: true, isSignal: true }, { propertyName: "contentTemplateRef", first: true, predicate: ["headerContent"], descendants: true, isSignal: true }, { propertyName: "operationTemplateRef", first: true, predicate: ["headerOperation"], descendants: true, isSignal: true }], hostDirectives: [{ directive: ThyHeaderDirective, inputs: ["thySize", "thySize", "thyShadow", "thyShadow", "thyHasBorder", "thyHasBorder", "thyDivided", "thyDivided"] }], ngImport: i0, template: "<div class=\"layout-header-title\">\n @if (titleTemplateRef()) {\n <ng-template [ngTemplateOutlet]=\"titleTemplateRef()\"></ng-template>\n } @else {\n @if (svgIconName()) {\n <thy-icon class=\"prefix-icon\" [thyIconName]=\"svgIconName()\"></thy-icon>\n } @else {\n @if (iconClass()) {\n <i class=\"prefix-icon\" [ngClass]=\"iconClass()\"></i>\n }\n }\n <span class=\"title-name\">{{ thyTitle() }}</span>\n }\n</div>\n<div class=\"layout-header-content\">\n <ng-template [ngTemplateOutlet]=\"contentTemplateRef()\"></ng-template>\n</div>\n<div class=\"layout-header-operation\">\n <ng-template [ngTemplateOutlet]=\"operationTemplateRef()\"></ng-template>\n</div>\n", dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: ThyIcon, selector: "thy-icon, [thy-icon]", inputs: ["thyIconType", "thyTwotoneColor", "thyIconName", "thyIconRotate", "thyIconSet", "thyIconLegging", "thyIconLinearGradient"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
148
166
|
}
|
|
149
167
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: ThyHeader, decorators: [{
|
|
150
168
|
type: Component,
|
|
@@ -153,24 +171,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImpor
|
|
|
153
171
|
directive: ThyHeaderDirective,
|
|
154
172
|
inputs: ['thySize', 'thyShadow', 'thyHasBorder', 'thyDivided']
|
|
155
173
|
}
|
|
156
|
-
], imports: [NgTemplateOutlet, ThyIcon, NgClass], template: "<div class=\"layout-header-title\">\n <ng-template [ngTemplateOutlet]=\"titleTemplateRef\"></ng-template>\n @
|
|
157
|
-
}]
|
|
158
|
-
type: Input
|
|
159
|
-
}], thyIconPrefix: [{
|
|
160
|
-
type: Input
|
|
161
|
-
}], thyIcon: [{
|
|
162
|
-
type: Input,
|
|
163
|
-
args: ['thyIcon']
|
|
164
|
-
}], titleTemplateRef: [{
|
|
165
|
-
type: ContentChild,
|
|
166
|
-
args: ['headerTitle']
|
|
167
|
-
}], contentTemplateRef: [{
|
|
168
|
-
type: ContentChild,
|
|
169
|
-
args: ['headerContent']
|
|
170
|
-
}], operationTemplateRef: [{
|
|
171
|
-
type: ContentChild,
|
|
172
|
-
args: ['headerOperation']
|
|
173
|
-
}] } });
|
|
174
|
+
], imports: [NgTemplateOutlet, ThyIcon, NgClass], template: "<div class=\"layout-header-title\">\n @if (titleTemplateRef()) {\n <ng-template [ngTemplateOutlet]=\"titleTemplateRef()\"></ng-template>\n } @else {\n @if (svgIconName()) {\n <thy-icon class=\"prefix-icon\" [thyIconName]=\"svgIconName()\"></thy-icon>\n } @else {\n @if (iconClass()) {\n <i class=\"prefix-icon\" [ngClass]=\"iconClass()\"></i>\n }\n }\n <span class=\"title-name\">{{ thyTitle() }}</span>\n }\n</div>\n<div class=\"layout-header-content\">\n <ng-template [ngTemplateOutlet]=\"contentTemplateRef()\"></ng-template>\n</div>\n<div class=\"layout-header-operation\">\n <ng-template [ngTemplateOutlet]=\"operationTemplateRef()\"></ng-template>\n</div>\n" }]
|
|
175
|
+
}] });
|
|
174
176
|
|
|
175
177
|
/**
|
|
176
178
|
* 内容布局指令
|
|
@@ -221,63 +223,49 @@ const SIDEBAR_COLLAPSED_WIDTH = 20;
|
|
|
221
223
|
class ThySidebarDirective {
|
|
222
224
|
constructor() {
|
|
223
225
|
this.thyLayoutDirective = inject(ThyLayoutDirective, { optional: true, host: true });
|
|
224
|
-
this.sidebarIsolated = false;
|
|
225
|
-
this.isDivided = true;
|
|
226
226
|
/**
|
|
227
227
|
* sidebar 位置,默认在左侧
|
|
228
228
|
*/
|
|
229
|
-
this.thyDirection = 'left';
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
this.thyDivided = value;
|
|
262
|
-
}
|
|
263
|
-
/**
|
|
264
|
-
* 左侧是否有边框,已废弃,请使用 thyDivided
|
|
265
|
-
* @deprecated please use thyDivided
|
|
266
|
-
* @default true
|
|
267
|
-
*/
|
|
268
|
-
set thyHasBorderLeft(value) {
|
|
269
|
-
this.thyDivided = value;
|
|
229
|
+
this.thyDirection = input('left');
|
|
230
|
+
/**
|
|
231
|
+
* 主题
|
|
232
|
+
* @type white | light | dark
|
|
233
|
+
* @default white
|
|
234
|
+
*/
|
|
235
|
+
this.thyTheme = input(undefined);
|
|
236
|
+
/**
|
|
237
|
+
* 宽度,默认是 240px,传入 `lg` 大小时宽度是300px
|
|
238
|
+
* @default 240px
|
|
239
|
+
*/
|
|
240
|
+
this.thyWidth = input(SIDEBAR_DEFAULT_WIDTH, {
|
|
241
|
+
transform: (value) => {
|
|
242
|
+
if (value === 'lg') {
|
|
243
|
+
return LG_WIDTH;
|
|
244
|
+
}
|
|
245
|
+
return value || SIDEBAR_DEFAULT_WIDTH;
|
|
246
|
+
}
|
|
247
|
+
});
|
|
248
|
+
this.sidebarWidth = linkedSignal(() => {
|
|
249
|
+
return this.thyWidth();
|
|
250
|
+
});
|
|
251
|
+
/**
|
|
252
|
+
* 是否和右侧 /左侧隔离,当为 true 时距右侧 /左侧会有 margin,同时边框会去掉
|
|
253
|
+
* @default false
|
|
254
|
+
*/
|
|
255
|
+
this.thyIsolated = input(false, { transform: coerceBooleanProperty });
|
|
256
|
+
/**
|
|
257
|
+
* sidebar 是否有分割线。当`thyDirection`值为`left`时,控制右侧是否有分割线;当`thyDirection`值为`right`时,控制左侧是否有分割线。
|
|
258
|
+
* @default true
|
|
259
|
+
*/
|
|
260
|
+
this.thyDivided = input(true, { transform: coerceBooleanProperty });
|
|
270
261
|
}
|
|
271
262
|
ngOnInit() {
|
|
272
263
|
if (this.thyLayoutDirective) {
|
|
273
|
-
this.thyLayoutDirective.
|
|
274
|
-
}
|
|
275
|
-
if (this.thyDirection === 'right') {
|
|
276
|
-
this.thyLayoutDirective.isSidebarRight = true;
|
|
264
|
+
this.thyLayoutDirective.sidebarDirection.set(this.thyDirection());
|
|
277
265
|
}
|
|
278
266
|
}
|
|
279
267
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: ThySidebarDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
280
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "
|
|
268
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.8", type: ThySidebarDirective, isStandalone: true, selector: "[thySidebar]", inputs: { thyDirection: { classPropertyName: "thyDirection", publicName: "thyDirection", isSignal: true, isRequired: false, transformFunction: null }, thyTheme: { classPropertyName: "thyTheme", publicName: "thyTheme", isSignal: true, isRequired: false, transformFunction: null }, thyWidth: { classPropertyName: "thyWidth", publicName: "thyWidth", isSignal: true, isRequired: false, transformFunction: null }, thyIsolated: { classPropertyName: "thyIsolated", publicName: "thyIsolated", isSignal: true, isRequired: false, transformFunction: null }, thyDivided: { classPropertyName: "thyDivided", publicName: "thyDivided", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class.thy-layout-sidebar-right": "thyDirection() === \"right\"", "class.thy-layout-sidebar--clear-border-right": "thyDirection() === \"left\" && !thyDivided()", "class.thy-layout-sidebar--clear-border-left": "thyDirection() === \"right\" && !thyDivided()", "class.sidebar-theme-light": "thyTheme() === \"light\"", "class.sidebar-theme-dark": "thyTheme() === \"dark\"", "class.thy-layout-sidebar-isolated": "thyIsolated()", "style.width.px": "sidebarWidth()" }, classAttribute: "thy-layout-sidebar" }, ngImport: i0 }); }
|
|
281
269
|
}
|
|
282
270
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: ThySidebarDirective, decorators: [{
|
|
283
271
|
type: Directive,
|
|
@@ -285,200 +273,185 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImpor
|
|
|
285
273
|
selector: '[thySidebar]',
|
|
286
274
|
host: {
|
|
287
275
|
class: 'thy-layout-sidebar',
|
|
288
|
-
'[class.thy-layout-sidebar-right]': 'thyDirection === "right"',
|
|
289
|
-
'[class.thy-layout-sidebar--clear-border-right]': 'thyDirection === "left" && !
|
|
290
|
-
'[class.thy-layout-sidebar--clear-border-left]': 'thyDirection === "right" && !
|
|
291
|
-
'[class.sidebar-theme-light]': 'thyTheme === "light"',
|
|
292
|
-
'[class.sidebar-theme-dark]': 'thyTheme === "dark"',
|
|
293
|
-
'[class.thy-layout-sidebar-isolated]': '
|
|
276
|
+
'[class.thy-layout-sidebar-right]': 'thyDirection() === "right"',
|
|
277
|
+
'[class.thy-layout-sidebar--clear-border-right]': 'thyDirection() === "left" && !thyDivided()',
|
|
278
|
+
'[class.thy-layout-sidebar--clear-border-left]': 'thyDirection() === "right" && !thyDivided()',
|
|
279
|
+
'[class.sidebar-theme-light]': 'thyTheme() === "light"',
|
|
280
|
+
'[class.sidebar-theme-dark]': 'thyTheme() === "dark"',
|
|
281
|
+
'[class.thy-layout-sidebar-isolated]': 'thyIsolated()',
|
|
282
|
+
'[style.width.px]': 'sidebarWidth()'
|
|
294
283
|
}
|
|
295
284
|
}]
|
|
296
|
-
}]
|
|
297
|
-
type: HostBinding,
|
|
298
|
-
args: ['style.width.px']
|
|
299
|
-
}], thyDirection: [{
|
|
300
|
-
type: Input
|
|
301
|
-
}], thyTheme: [{
|
|
302
|
-
type: Input
|
|
303
|
-
}], thyWidth: [{
|
|
304
|
-
type: Input,
|
|
305
|
-
args: ['thyWidth']
|
|
306
|
-
}], thyIsolated: [{
|
|
307
|
-
type: Input,
|
|
308
|
-
args: [{ transform: coerceBooleanProperty }]
|
|
309
|
-
}], thyDivided: [{
|
|
310
|
-
type: Input,
|
|
311
|
-
args: [{ transform: coerceBooleanProperty }]
|
|
312
|
-
}], thyHasBorderRight: [{
|
|
313
|
-
type: Input,
|
|
314
|
-
args: [{ transform: coerceBooleanProperty }]
|
|
315
|
-
}], thyHasBorderLeft: [{
|
|
316
|
-
type: Input,
|
|
317
|
-
args: [{ transform: coerceBooleanProperty }]
|
|
318
|
-
}] } });
|
|
285
|
+
}] });
|
|
319
286
|
/**
|
|
320
287
|
* 侧边栏布局组件
|
|
321
288
|
* @name thy-sidebar
|
|
322
289
|
* @order 21
|
|
323
290
|
*/
|
|
324
291
|
class ThySidebar {
|
|
292
|
+
mouseenter($event) {
|
|
293
|
+
this.isMouseEnter.set(true);
|
|
294
|
+
}
|
|
295
|
+
mouseleave($event) {
|
|
296
|
+
this.isMouseEnter.set(false);
|
|
297
|
+
}
|
|
325
298
|
constructor() {
|
|
326
299
|
this.locale = injectLocale('layout');
|
|
327
300
|
this.elementRef = inject(ElementRef);
|
|
328
301
|
this.hotkeyDispatcher = inject(ThyHotkeyDispatcher);
|
|
329
302
|
this.sidebarDirective = inject(ThySidebarDirective);
|
|
303
|
+
this.isMouseEnter = signal(false);
|
|
304
|
+
this.sidebarWidth = computed(() => {
|
|
305
|
+
if (this.thyCollapsible() && this.collapsed()) {
|
|
306
|
+
return this.thyCollapsedWidth();
|
|
307
|
+
}
|
|
308
|
+
else {
|
|
309
|
+
return this.sidebarDirective.sidebarWidth();
|
|
310
|
+
}
|
|
311
|
+
});
|
|
330
312
|
/**
|
|
331
313
|
* 宽度是否可以拖拽
|
|
332
314
|
* @default false
|
|
333
315
|
*/
|
|
334
|
-
this.thyDraggable = false;
|
|
316
|
+
this.thyDraggable = input(false, { transform: coerceBooleanProperty });
|
|
317
|
+
/**
|
|
318
|
+
* 拖拽的最大宽度
|
|
319
|
+
*/
|
|
320
|
+
this.thyDragMaxWidth = input(undefined, { transform: numberAttribute });
|
|
321
|
+
/**
|
|
322
|
+
* 拖拽的最小宽度
|
|
323
|
+
*/
|
|
324
|
+
this.thyDragMinWidth = input(undefined, { transform: numberAttribute });
|
|
335
325
|
/**
|
|
336
326
|
* 展示收起的触发器自定义模板,默认显示展开收起的圆形图标,设置为 null 表示不展示触发元素,手动控制展开收起状态
|
|
337
327
|
* @type null | undefined | TemplateRef<any>
|
|
338
328
|
* @default undefined
|
|
339
329
|
*/
|
|
340
|
-
this.thyTrigger = undefined;
|
|
330
|
+
this.thyTrigger = input(undefined);
|
|
341
331
|
/**
|
|
342
332
|
* 收起状态改变后的事件
|
|
343
333
|
*/
|
|
344
|
-
this.thyCollapsedChange =
|
|
334
|
+
this.thyCollapsedChange = output();
|
|
345
335
|
/**
|
|
346
336
|
* 拖拽宽度的修改事件
|
|
347
337
|
*/
|
|
348
|
-
this.thyDragWidthChange =
|
|
338
|
+
this.thyDragWidthChange = output();
|
|
339
|
+
/**
|
|
340
|
+
* 开启收起/展开功能
|
|
341
|
+
* @default false
|
|
342
|
+
*/
|
|
343
|
+
this.thyCollapsible = input(false, { transform: coerceBooleanProperty });
|
|
344
|
+
/**
|
|
345
|
+
* 是否是收起
|
|
346
|
+
* @default false
|
|
347
|
+
*/
|
|
348
|
+
this.thyCollapsed = input(false, { transform: coerceBooleanProperty });
|
|
349
|
+
this.collapsed = linkedSignal(() => this.thyCollapsed());
|
|
350
|
+
this.collapseVisible = computed(() => {
|
|
351
|
+
return this.isMouseEnter() && !this.collapsed() ? true : false;
|
|
352
|
+
});
|
|
349
353
|
/**
|
|
350
354
|
* 收起后的宽度
|
|
351
355
|
*/
|
|
352
|
-
this.thyCollapsedWidth = SIDEBAR_COLLAPSED_WIDTH;
|
|
353
|
-
|
|
356
|
+
this.thyCollapsedWidth = input(SIDEBAR_COLLAPSED_WIDTH, { transform: numberAttribute });
|
|
357
|
+
/**
|
|
358
|
+
* 默认宽度,双击后可恢复到此宽度,默认是 240px,传入 lg 大小时宽度是300px
|
|
359
|
+
*/
|
|
360
|
+
this.thyDefaultWidth = input(undefined, {
|
|
361
|
+
transform: (value) => {
|
|
362
|
+
if (value === 'lg') {
|
|
363
|
+
return LG_WIDTH;
|
|
364
|
+
}
|
|
365
|
+
return value;
|
|
366
|
+
}
|
|
367
|
+
});
|
|
368
|
+
this.collapseTip = computed(() => {
|
|
369
|
+
const collapseTip = this.collapsed() ? this.locale().expand : this.locale().collapse;
|
|
370
|
+
return collapseTip + (isMacPlatform() ? `(⌘ + /)` : `(Ctrl + /)`);
|
|
371
|
+
});
|
|
354
372
|
this.originWidth = SIDEBAR_DEFAULT_WIDTH;
|
|
373
|
+
this.collapseHidden = signal(false);
|
|
374
|
+
this.isRemoveTransition = signal(false);
|
|
375
|
+
this.isResizable = signal(false);
|
|
376
|
+
this.dragMinWidth = computed(() => {
|
|
377
|
+
return this.thyDragMinWidth() || this.thyCollapsedWidth();
|
|
378
|
+
});
|
|
379
|
+
effect(() => {
|
|
380
|
+
const collapsible = this.thyCollapsible();
|
|
381
|
+
if (collapsible) {
|
|
382
|
+
this.subscribeHotkeyEvent();
|
|
383
|
+
}
|
|
384
|
+
else {
|
|
385
|
+
this.hotkeySubscription?.unsubscribe();
|
|
386
|
+
}
|
|
387
|
+
});
|
|
355
388
|
}
|
|
356
|
-
|
|
357
|
-
if (this.thyCollapsible && this.thyCollapsed) {
|
|
358
|
-
return this.thyCollapsedWidth;
|
|
359
|
-
}
|
|
360
|
-
else {
|
|
361
|
-
return this.sidebarDirective.thyLayoutSidebarWidth;
|
|
362
|
-
}
|
|
363
|
-
}
|
|
364
|
-
mouseenter($event) {
|
|
365
|
-
this.resizeHandleHover($event, 'enter');
|
|
366
|
-
}
|
|
367
|
-
mouseleave($event) {
|
|
368
|
-
this.resizeHandleHover($event, 'leave');
|
|
369
|
-
}
|
|
370
|
-
/**
|
|
371
|
-
* 开启收起/展开功能
|
|
372
|
-
* @default false
|
|
373
|
-
*/
|
|
374
|
-
set thyCollapsible(collapsible) {
|
|
375
|
-
this.collapsible = collapsible;
|
|
376
|
-
if (this.collapsible) {
|
|
377
|
-
this.subscribeHotkeyEvent();
|
|
378
|
-
}
|
|
379
|
-
else {
|
|
380
|
-
this.hotkeySubscription?.unsubscribe();
|
|
381
|
-
}
|
|
382
|
-
}
|
|
383
|
-
get thyCollapsible() {
|
|
384
|
-
return this.collapsible;
|
|
385
|
-
}
|
|
386
|
-
/**
|
|
387
|
-
* 是否是收起
|
|
388
|
-
* @default false
|
|
389
|
-
*/
|
|
390
|
-
set thyCollapsed(value) {
|
|
391
|
-
this.isCollapsed = value;
|
|
392
|
-
}
|
|
393
|
-
get thyCollapsed() {
|
|
394
|
-
return this.isCollapsed;
|
|
395
|
-
}
|
|
396
|
-
get collapseVisibility() {
|
|
397
|
-
return this.thyCollapsed;
|
|
398
|
-
}
|
|
399
|
-
get removeTransition() {
|
|
400
|
-
return this.isRemoveTransition;
|
|
401
|
-
}
|
|
402
|
-
get dragMinWidth() {
|
|
403
|
-
return this.thyDragMinWidth || this.thyCollapsedWidth;
|
|
404
|
-
}
|
|
405
|
-
ngOnInit() {
|
|
406
|
-
this.updateCollapseTip();
|
|
407
|
-
}
|
|
389
|
+
ngOnInit() { }
|
|
408
390
|
subscribeHotkeyEvent() {
|
|
409
391
|
this.hotkeySubscription = this.hotkeyDispatcher.keydown(['Control+/', 'Meta+/']).subscribe(() => {
|
|
410
392
|
this.toggleCollapse();
|
|
411
393
|
});
|
|
412
394
|
}
|
|
413
|
-
updateCollapseTip() {
|
|
414
|
-
this.collapseTip = this.thyCollapsed ? this.locale().expand : this.locale().collapse;
|
|
415
|
-
this.collapseTip = this.collapseTip + (isMacPlatform() ? `(⌘ + /)` : `(Ctrl + /)`);
|
|
416
|
-
}
|
|
417
395
|
resizeHandler({ width }) {
|
|
418
|
-
if (width === this.sidebarDirective.
|
|
396
|
+
if (width === this.sidebarDirective.sidebarWidth()) {
|
|
419
397
|
return;
|
|
420
398
|
}
|
|
421
|
-
if (this.thyCollapsible && width < this.thyCollapsedWidth) {
|
|
399
|
+
if (this.thyCollapsible() && width < this.thyCollapsedWidth()) {
|
|
422
400
|
return;
|
|
423
401
|
}
|
|
424
|
-
if (this.thyCollapsible && width === this.thyCollapsedWidth) {
|
|
425
|
-
this.
|
|
426
|
-
|
|
427
|
-
this.
|
|
428
|
-
this.
|
|
429
|
-
this.collapseVisible = false;
|
|
402
|
+
if (this.thyCollapsible() && width === this.thyCollapsedWidth()) {
|
|
403
|
+
this.collapsed.set(true);
|
|
404
|
+
this.thyCollapsedChange.emit(this.collapsed());
|
|
405
|
+
this.sidebarDirective.sidebarWidth.set(this.originWidth);
|
|
406
|
+
this.isMouseEnter.set(false);
|
|
430
407
|
return;
|
|
431
408
|
}
|
|
432
|
-
this.sidebarDirective.
|
|
409
|
+
this.sidebarDirective.sidebarWidth.set(width);
|
|
433
410
|
this.thyDragWidthChange.emit(width);
|
|
434
411
|
}
|
|
435
412
|
resizeStart() {
|
|
436
|
-
this.originWidth = this.sidebarDirective.
|
|
437
|
-
this.collapseHidden
|
|
438
|
-
this.isRemoveTransition
|
|
413
|
+
this.originWidth = this.sidebarDirective.sidebarWidth();
|
|
414
|
+
this.collapseHidden.set(true);
|
|
415
|
+
this.isRemoveTransition.set(true);
|
|
439
416
|
}
|
|
440
417
|
resizeEnd() {
|
|
441
|
-
this.collapseHidden
|
|
442
|
-
this.isRemoveTransition
|
|
443
|
-
}
|
|
444
|
-
resizeHandleHover(event, type) {
|
|
445
|
-
this.collapseVisible = type === 'enter' && !this.thyCollapsed ? true : false;
|
|
418
|
+
this.collapseHidden.set(false);
|
|
419
|
+
this.isRemoveTransition.set(false);
|
|
446
420
|
}
|
|
447
421
|
toggleCollapse(event) {
|
|
448
|
-
this.
|
|
449
|
-
|
|
450
|
-
|
|
422
|
+
this.collapsed.update((value) => {
|
|
423
|
+
return !value;
|
|
424
|
+
});
|
|
425
|
+
this.thyCollapsedChange.emit(this.collapsed());
|
|
451
426
|
}
|
|
452
427
|
toggleResizable(event, type) {
|
|
453
|
-
this.isResizable
|
|
428
|
+
this.isResizable.set(type === 'enter' ? true : false);
|
|
454
429
|
}
|
|
455
430
|
restoreToDefaultWidth() {
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
this.sidebarDirective.thyLayoutSidebarWidth = this.thyDefaultWidth || SIDEBAR_DEFAULT_WIDTH;
|
|
460
|
-
this.thyDragWidthChange.emit(this.sidebarDirective.thyLayoutSidebarWidth);
|
|
431
|
+
const thyDefaultWidth = this.thyDefaultWidth();
|
|
432
|
+
this.sidebarDirective.sidebarWidth.set(thyDefaultWidth || SIDEBAR_DEFAULT_WIDTH);
|
|
433
|
+
this.thyDragWidthChange.emit(this.sidebarDirective.sidebarWidth());
|
|
461
434
|
}
|
|
462
435
|
ngOnDestroy() {
|
|
463
436
|
this.hotkeySubscription?.unsubscribe();
|
|
464
437
|
}
|
|
465
438
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: ThySidebar, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
466
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.8", type: ThySidebar, isStandalone: true, selector: "thy-sidebar", inputs: { thyDraggable:
|
|
439
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.8", type: ThySidebar, isStandalone: true, selector: "thy-sidebar", inputs: { thyDraggable: { classPropertyName: "thyDraggable", publicName: "thyDraggable", isSignal: true, isRequired: false, transformFunction: null }, thyDragMaxWidth: { classPropertyName: "thyDragMaxWidth", publicName: "thyDragMaxWidth", isSignal: true, isRequired: false, transformFunction: null }, thyDragMinWidth: { classPropertyName: "thyDragMinWidth", publicName: "thyDragMinWidth", isSignal: true, isRequired: false, transformFunction: null }, thyTrigger: { classPropertyName: "thyTrigger", publicName: "thyTrigger", isSignal: true, isRequired: false, transformFunction: null }, thyCollapsible: { classPropertyName: "thyCollapsible", publicName: "thyCollapsible", isSignal: true, isRequired: false, transformFunction: null }, thyCollapsed: { classPropertyName: "thyCollapsed", publicName: "thyCollapsed", isSignal: true, isRequired: false, transformFunction: null }, thyCollapsedWidth: { classPropertyName: "thyCollapsedWidth", publicName: "thyCollapsedWidth", isSignal: true, isRequired: false, transformFunction: null }, thyDefaultWidth: { classPropertyName: "thyDefaultWidth", publicName: "thyDefaultWidth", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { thyCollapsedChange: "thyCollapsedChange", thyDragWidthChange: "thyDragWidthChange" }, host: { listeners: { "mouseenter": "mouseenter($event)", "mouseleave": "mouseleave($event)" }, properties: { "class.sidebar-collapse-show": "collapsed()", "class.remove-transition": "isRemoveTransition()", "style.width.px": "sidebarWidth()" } }, hostDirectives: [{ directive: ThySidebarDirective, inputs: ["thyTheme", "thyTheme", "thyDirection", "thyDirection", "thyWidth", "thyWidth", "thyIsolated", "thyIsolated", "thyDivided", "thyDivided"] }], ngImport: i0, template: `
|
|
467
440
|
<ng-content></ng-content>
|
|
468
|
-
@if (thyDraggable) {
|
|
441
|
+
@if (thyDraggable()) {
|
|
469
442
|
<div
|
|
470
443
|
thyResizable
|
|
471
444
|
class="sidebar-drag"
|
|
472
445
|
thyBounds="window"
|
|
473
|
-
[thyMaxWidth]="thyDragMaxWidth"
|
|
474
|
-
[thyMinWidth]="dragMinWidth"
|
|
446
|
+
[thyMaxWidth]="thyDragMaxWidth()"
|
|
447
|
+
[thyMinWidth]="dragMinWidth()"
|
|
475
448
|
(thyResize)="resizeHandler($event)"
|
|
476
449
|
(thyResizeStart)="resizeStart()"
|
|
477
450
|
(thyResizeEnd)="resizeEnd()"
|
|
478
|
-
[style.display]="!isResizable ? 'contents' : null">
|
|
479
|
-
@if (!
|
|
451
|
+
[style.display]="!isResizable() ? 'contents' : null">
|
|
452
|
+
@if (!collapsed()) {
|
|
480
453
|
<thy-resize-handle
|
|
481
|
-
[thyDirection]="sidebarDirective.thyDirection === 'right' ? 'left' : 'right'"
|
|
454
|
+
[thyDirection]="sidebarDirective.thyDirection() === 'right' ? 'left' : 'right'"
|
|
482
455
|
class="sidebar-resize-handle"
|
|
483
456
|
thyLine="true"
|
|
484
457
|
(mouseenter)="toggleResizable($event, 'enter')"
|
|
@@ -488,20 +461,21 @@ class ThySidebar {
|
|
|
488
461
|
}
|
|
489
462
|
</div>
|
|
490
463
|
}
|
|
491
|
-
@if (thyCollapsible) {
|
|
464
|
+
@if (thyCollapsible()) {
|
|
492
465
|
<div class="sidebar-collapse-line"></div>
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
466
|
+
|
|
467
|
+
@if (thyTrigger() !== null) {
|
|
468
|
+
<div
|
|
469
|
+
class="sidebar-collapse"
|
|
470
|
+
[ngClass]="{ 'collapse-visible': collapseVisible(), 'collapse-hidden': collapseHidden() }"
|
|
471
|
+
(click)="toggleCollapse($event)"
|
|
472
|
+
[thyTooltip]="!thyTrigger() && collapseTip()">
|
|
473
|
+
<ng-template [ngTemplateOutlet]="thyTrigger() || defaultTrigger"></ng-template>
|
|
474
|
+
<ng-template #defaultTrigger>
|
|
475
|
+
<thy-icon class="sidebar-collapse-icon" [thyIconName]="this.collapsed ? 'indent' : 'outdent'"></thy-icon>
|
|
476
|
+
</ng-template>
|
|
477
|
+
</div>
|
|
478
|
+
}
|
|
505
479
|
}
|
|
506
480
|
`, isInline: true, dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: ThyResizeHandle, selector: "thy-resize-handle, [thy-resize-handle]", inputs: ["thyDirection", "thyLine"], outputs: ["thyMouseDown"], exportAs: ["thyResizeHandle"] }, { kind: "directive", type: ThyResizableDirective, selector: "[thyResizable]", inputs: ["thyBounds", "thyMaxHeight", "thyMaxWidth", "thyMinHeight", "thyMinWidth", "thyGridColumnCount", "thyMaxColumn", "thyMinColumn", "thyLockAspectRatio", "thyPreview", "thyDisabled"], outputs: ["thyResize", "thyResizeStart", "thyResizeEnd"] }, { kind: "component", type: ThyIcon, selector: "thy-icon, [thy-icon]", inputs: ["thyIconType", "thyTwotoneColor", "thyIconName", "thyIconRotate", "thyIconSet", "thyIconLegging", "thyIconLinearGradient"] }, { kind: "directive", type: ThyTooltipDirective, selector: "[thyTooltip],[thy-tooltip]", inputs: ["thyTooltip", "thyTooltipPlacement", "thyTooltipClass", "thyTooltipShowDelay", "thyTooltipHideDelay", "thyTooltipTrigger", "thyTooltipDisabled", "thyTooltipTemplateContext", "thyTooltipOffset", "thyTooltipPin"], exportAs: ["thyTooltip"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }] }); }
|
|
507
481
|
}
|
|
@@ -512,20 +486,20 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImpor
|
|
|
512
486
|
preserveWhitespaces: false,
|
|
513
487
|
template: `
|
|
514
488
|
<ng-content></ng-content>
|
|
515
|
-
@if (thyDraggable) {
|
|
489
|
+
@if (thyDraggable()) {
|
|
516
490
|
<div
|
|
517
491
|
thyResizable
|
|
518
492
|
class="sidebar-drag"
|
|
519
493
|
thyBounds="window"
|
|
520
|
-
[thyMaxWidth]="thyDragMaxWidth"
|
|
521
|
-
[thyMinWidth]="dragMinWidth"
|
|
494
|
+
[thyMaxWidth]="thyDragMaxWidth()"
|
|
495
|
+
[thyMinWidth]="dragMinWidth()"
|
|
522
496
|
(thyResize)="resizeHandler($event)"
|
|
523
497
|
(thyResizeStart)="resizeStart()"
|
|
524
498
|
(thyResizeEnd)="resizeEnd()"
|
|
525
|
-
[style.display]="!isResizable ? 'contents' : null">
|
|
526
|
-
@if (!
|
|
499
|
+
[style.display]="!isResizable() ? 'contents' : null">
|
|
500
|
+
@if (!collapsed()) {
|
|
527
501
|
<thy-resize-handle
|
|
528
|
-
[thyDirection]="sidebarDirective.thyDirection === 'right' ? 'left' : 'right'"
|
|
502
|
+
[thyDirection]="sidebarDirective.thyDirection() === 'right' ? 'left' : 'right'"
|
|
529
503
|
class="sidebar-resize-handle"
|
|
530
504
|
thyLine="true"
|
|
531
505
|
(mouseenter)="toggleResizable($event, 'enter')"
|
|
@@ -535,71 +509,42 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImpor
|
|
|
535
509
|
}
|
|
536
510
|
</div>
|
|
537
511
|
}
|
|
538
|
-
@if (thyCollapsible) {
|
|
512
|
+
@if (thyCollapsible()) {
|
|
539
513
|
<div class="sidebar-collapse-line"></div>
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
514
|
+
|
|
515
|
+
@if (thyTrigger() !== null) {
|
|
516
|
+
<div
|
|
517
|
+
class="sidebar-collapse"
|
|
518
|
+
[ngClass]="{ 'collapse-visible': collapseVisible(), 'collapse-hidden': collapseHidden() }"
|
|
519
|
+
(click)="toggleCollapse($event)"
|
|
520
|
+
[thyTooltip]="!thyTrigger() && collapseTip()">
|
|
521
|
+
<ng-template [ngTemplateOutlet]="thyTrigger() || defaultTrigger"></ng-template>
|
|
522
|
+
<ng-template #defaultTrigger>
|
|
523
|
+
<thy-icon class="sidebar-collapse-icon" [thyIconName]="this.collapsed ? 'indent' : 'outdent'"></thy-icon>
|
|
524
|
+
</ng-template>
|
|
525
|
+
</div>
|
|
526
|
+
}
|
|
552
527
|
}
|
|
553
528
|
`,
|
|
554
529
|
hostDirectives: [
|
|
555
530
|
{
|
|
556
531
|
directive: ThySidebarDirective,
|
|
557
|
-
inputs: ['thyTheme', 'thyDirection', 'thyWidth', 'thyIsolated', 'thyDivided'
|
|
532
|
+
inputs: ['thyTheme', 'thyDirection', 'thyWidth', 'thyIsolated', 'thyDivided']
|
|
558
533
|
}
|
|
559
534
|
],
|
|
560
|
-
imports: [NgTemplateOutlet, ThyResizeHandle, ThyResizableDirective, ThyIcon, ThyTooltipDirective, NgClass]
|
|
535
|
+
imports: [NgTemplateOutlet, ThyResizeHandle, ThyResizableDirective, ThyIcon, ThyTooltipDirective, NgClass],
|
|
536
|
+
host: {
|
|
537
|
+
'[class.sidebar-collapse-show]': 'collapsed()',
|
|
538
|
+
'[class.remove-transition]': 'isRemoveTransition()',
|
|
539
|
+
'[style.width.px]': 'sidebarWidth()'
|
|
540
|
+
}
|
|
561
541
|
}]
|
|
562
|
-
}], propDecorators: {
|
|
563
|
-
type: HostBinding,
|
|
564
|
-
args: ['style.width.px']
|
|
565
|
-
}], mouseenter: [{
|
|
542
|
+
}], ctorParameters: () => [], propDecorators: { mouseenter: [{
|
|
566
543
|
type: HostListener,
|
|
567
544
|
args: ['mouseenter', ['$event']]
|
|
568
545
|
}], mouseleave: [{
|
|
569
546
|
type: HostListener,
|
|
570
547
|
args: ['mouseleave', ['$event']]
|
|
571
|
-
}], thyDraggable: [{
|
|
572
|
-
type: Input,
|
|
573
|
-
args: [{ transform: coerceBooleanProperty }]
|
|
574
|
-
}], thyDragMaxWidth: [{
|
|
575
|
-
type: Input,
|
|
576
|
-
args: [{ transform: numberAttribute }]
|
|
577
|
-
}], thyDragMinWidth: [{
|
|
578
|
-
type: Input,
|
|
579
|
-
args: [{ transform: numberAttribute }]
|
|
580
|
-
}], thyTrigger: [{
|
|
581
|
-
type: Input
|
|
582
|
-
}], thyCollapsedChange: [{
|
|
583
|
-
type: Output
|
|
584
|
-
}], thyDragWidthChange: [{
|
|
585
|
-
type: Output
|
|
586
|
-
}], thyCollapsible: [{
|
|
587
|
-
type: Input,
|
|
588
|
-
args: [{ transform: coerceBooleanProperty }]
|
|
589
|
-
}], thyCollapsed: [{
|
|
590
|
-
type: Input,
|
|
591
|
-
args: [{ transform: coerceBooleanProperty }]
|
|
592
|
-
}], thyCollapsedWidth: [{
|
|
593
|
-
type: Input,
|
|
594
|
-
args: [{ transform: numberAttribute }]
|
|
595
|
-
}], thyDefaultWidth: [{
|
|
596
|
-
type: Input
|
|
597
|
-
}], collapseVisibility: [{
|
|
598
|
-
type: HostBinding,
|
|
599
|
-
args: ['class.sidebar-collapse-show']
|
|
600
|
-
}], removeTransition: [{
|
|
601
|
-
type: HostBinding,
|
|
602
|
-
args: ['class.remove-transition']
|
|
603
548
|
}] } });
|
|
604
549
|
|
|
605
550
|
/**
|
|
@@ -684,8 +629,15 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImpor
|
|
|
684
629
|
* @order 25
|
|
685
630
|
*/
|
|
686
631
|
class ThySidebarHeaderDirective {
|
|
632
|
+
constructor() {
|
|
633
|
+
/**
|
|
634
|
+
* 是否有分割线
|
|
635
|
+
* @default false
|
|
636
|
+
*/
|
|
637
|
+
this.thyDivided = input(false, { transform: coerceBooleanProperty });
|
|
638
|
+
}
|
|
687
639
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: ThySidebarHeaderDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
688
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "
|
|
640
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.8", type: ThySidebarHeaderDirective, isStandalone: true, selector: "[thySidebarHeader]", inputs: { thyDivided: { classPropertyName: "thyDivided", publicName: "thyDivided", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class.sidebar-header-divided": "thyDivided()" }, classAttribute: "sidebar-header" }, ngImport: i0 }); }
|
|
689
641
|
}
|
|
690
642
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: ThySidebarHeaderDirective, decorators: [{
|
|
691
643
|
type: Directive,
|
|
@@ -693,21 +645,34 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImpor
|
|
|
693
645
|
selector: '[thySidebarHeader]',
|
|
694
646
|
host: {
|
|
695
647
|
class: 'sidebar-header',
|
|
696
|
-
'[class.sidebar-header-divided]': 'thyDivided'
|
|
648
|
+
'[class.sidebar-header-divided]': 'thyDivided()'
|
|
697
649
|
}
|
|
698
650
|
}]
|
|
699
|
-
}],
|
|
700
|
-
type: Input,
|
|
701
|
-
args: [{ transform: coerceBooleanProperty }]
|
|
702
|
-
}] } });
|
|
651
|
+
}], ctorParameters: () => [] });
|
|
703
652
|
/**
|
|
704
653
|
* 侧边栏头部布局组件
|
|
705
654
|
* @name thy-sidebar-header
|
|
706
655
|
* @order 26
|
|
707
656
|
*/
|
|
708
657
|
class ThySidebarHeader {
|
|
658
|
+
constructor() {
|
|
659
|
+
/**
|
|
660
|
+
* 头部标题
|
|
661
|
+
*/
|
|
662
|
+
this.thyTitle = input(undefined);
|
|
663
|
+
/**
|
|
664
|
+
* 头部自定义操作模板,`<ng-template #headerOperation></ng-template>`
|
|
665
|
+
* @type TemplateRef
|
|
666
|
+
*/
|
|
667
|
+
this.operationTemplateRef = contentChild('headerOperation');
|
|
668
|
+
/**
|
|
669
|
+
* 头部自定义标题模板,`<ng-template #headerTitle></ng-template>`
|
|
670
|
+
* @type TemplateRef
|
|
671
|
+
*/
|
|
672
|
+
this.titleTemplateRef = contentChild('headerTitle');
|
|
673
|
+
}
|
|
709
674
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: ThySidebarHeader, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
710
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.8", type: ThySidebarHeader, isStandalone: true, selector: "thy-sidebar-header", inputs: { thyTitle: "thyTitle" }, queries: [{ propertyName: "operationTemplateRef", first: true, predicate: ["headerOperation"], descendants: true }, { propertyName: "titleTemplateRef", first: true, predicate: ["headerTitle"], descendants: true }], hostDirectives: [{ directive: ThySidebarHeaderDirective, inputs: ["thyDivided", "thyDivided"] }], ngImport: i0, template: "@if (thyTitle || titleTemplateRef) {\n <span class=\"title\">\n @if (titleTemplateRef) {\n <ng-template [ngTemplateOutlet]=\"titleTemplateRef\"></ng-template>\n } @else {\n {{ thyTitle }}\n }\n </span>\n}\n<ng-content></ng-content>\n<div class=\"operation\">\n <ng-template [ngTemplateOutlet]=\"operationTemplateRef\"></ng-template>\n</div>\n", dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
675
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.8", type: ThySidebarHeader, isStandalone: true, selector: "thy-sidebar-header", inputs: { thyTitle: { classPropertyName: "thyTitle", publicName: "thyTitle", isSignal: true, isRequired: false, transformFunction: null } }, queries: [{ propertyName: "operationTemplateRef", first: true, predicate: ["headerOperation"], descendants: true, isSignal: true }, { propertyName: "titleTemplateRef", first: true, predicate: ["headerTitle"], descendants: true, isSignal: true }], hostDirectives: [{ directive: ThySidebarHeaderDirective, inputs: ["thyDivided", "thyDivided"] }], ngImport: i0, template: "@if (thyTitle() || titleTemplateRef()) {\n <span class=\"title\">\n @if (titleTemplateRef()) {\n <ng-template [ngTemplateOutlet]=\"titleTemplateRef()\"></ng-template>\n } @else {\n {{ thyTitle() }}\n }\n </span>\n}\n<ng-content></ng-content>\n<div class=\"operation\">\n <ng-template [ngTemplateOutlet]=\"operationTemplateRef()\"></ng-template>\n</div>\n", dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
711
676
|
}
|
|
712
677
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: ThySidebarHeader, decorators: [{
|
|
713
678
|
type: Component,
|
|
@@ -716,16 +681,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImpor
|
|
|
716
681
|
directive: ThySidebarHeaderDirective,
|
|
717
682
|
inputs: ['thyDivided']
|
|
718
683
|
}
|
|
719
|
-
], imports: [NgTemplateOutlet], template: "@if (thyTitle || titleTemplateRef) {\n <span class=\"title\">\n @if (titleTemplateRef) {\n <ng-template [ngTemplateOutlet]=\"titleTemplateRef\"></ng-template>\n } @else {\n {{ thyTitle }}\n }\n </span>\n}\n<ng-content></ng-content>\n<div class=\"operation\">\n <ng-template [ngTemplateOutlet]=\"operationTemplateRef\"></ng-template>\n</div>\n" }]
|
|
720
|
-
}]
|
|
721
|
-
type: Input
|
|
722
|
-
}], operationTemplateRef: [{
|
|
723
|
-
type: ContentChild,
|
|
724
|
-
args: ['headerOperation']
|
|
725
|
-
}], titleTemplateRef: [{
|
|
726
|
-
type: ContentChild,
|
|
727
|
-
args: ['headerTitle']
|
|
728
|
-
}] } });
|
|
684
|
+
], imports: [NgTemplateOutlet], template: "@if (thyTitle() || titleTemplateRef()) {\n <span class=\"title\">\n @if (titleTemplateRef()) {\n <ng-template [ngTemplateOutlet]=\"titleTemplateRef()\"></ng-template>\n } @else {\n {{ thyTitle() }}\n }\n </span>\n}\n<ng-content></ng-content>\n<div class=\"operation\">\n <ng-template [ngTemplateOutlet]=\"operationTemplateRef()\"></ng-template>\n</div>\n" }]
|
|
685
|
+
}] });
|
|
729
686
|
|
|
730
687
|
/**
|
|
731
688
|
* 侧边栏底部布局指令
|