@delon/abc 20.1.1 → 21.0.0-next.1
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/fesm2022/auto-focus.mjs +10 -10
- package/fesm2022/auto-focus.mjs.map +1 -1
- package/fesm2022/cell.mjs +23 -25
- package/fesm2022/cell.mjs.map +1 -1
- package/fesm2022/chart-observer-size.mjs +21 -34
- package/fesm2022/chart-observer-size.mjs.map +1 -1
- package/fesm2022/count-down.mjs +24 -31
- package/fesm2022/count-down.mjs.map +1 -1
- package/fesm2022/date-picker.mjs +89 -85
- package/fesm2022/date-picker.mjs.map +1 -1
- package/fesm2022/down-file.mjs +23 -43
- package/fesm2022/down-file.mjs.map +1 -1
- package/fesm2022/ellipsis.mjs +163 -104
- package/fesm2022/ellipsis.mjs.map +1 -1
- package/fesm2022/error-collect.mjs +11 -13
- package/fesm2022/error-collect.mjs.map +1 -1
- package/fesm2022/exception.mjs +9 -9
- package/fesm2022/exception.mjs.map +1 -1
- package/fesm2022/footer-toolbar.mjs +9 -9
- package/fesm2022/footer-toolbar.mjs.map +1 -1
- package/fesm2022/full-content.mjs +50 -58
- package/fesm2022/full-content.mjs.map +1 -1
- package/fesm2022/global-footer.mjs +14 -15
- package/fesm2022/global-footer.mjs.map +1 -1
- package/fesm2022/hotkey.mjs +7 -7
- package/fesm2022/hotkey.mjs.map +1 -1
- package/fesm2022/loading.mjs +61 -14
- package/fesm2022/loading.mjs.map +1 -1
- package/fesm2022/lodop.mjs +7 -7
- package/fesm2022/media.mjs +37 -61
- package/fesm2022/media.mjs.map +1 -1
- package/fesm2022/notice-icon.mjs +220 -25
- package/fesm2022/notice-icon.mjs.map +1 -1
- package/fesm2022/onboarding.mjs +160 -62
- package/fesm2022/onboarding.mjs.map +1 -1
- package/fesm2022/page-header.mjs +252 -155
- package/fesm2022/page-header.mjs.map +1 -1
- package/fesm2022/pdf.mjs +7 -7
- package/fesm2022/pdf.mjs.map +1 -1
- package/fesm2022/quick-menu.mjs +79 -71
- package/fesm2022/quick-menu.mjs.map +1 -1
- package/fesm2022/reuse-tab.mjs +257 -160
- package/fesm2022/reuse-tab.mjs.map +1 -1
- package/fesm2022/se.mjs +289 -309
- package/fesm2022/se.mjs.map +1 -1
- package/fesm2022/sg.mjs +32 -69
- package/fesm2022/sg.mjs.map +1 -1
- package/fesm2022/st.mjs +93 -84
- package/fesm2022/st.mjs.map +1 -1
- package/fesm2022/sv.mjs +185 -174
- package/fesm2022/sv.mjs.map +1 -1
- package/fesm2022/tag-select.mjs +44 -25
- package/fesm2022/tag-select.mjs.map +1 -1
- package/fesm2022/xlsx.mjs +14 -17
- package/fesm2022/xlsx.mjs.map +1 -1
- package/fesm2022/zip.mjs +4 -4
- package/fesm2022/zip.mjs.map +1 -1
- package/package.json +37 -37
- package/{auto-focus/index.d.ts → types/auto-focus.d.ts} +2 -2
- package/{cell/index.d.ts → types/cell.d.ts} +12 -13
- package/{observers/index.d.ts → types/chart-observer-size.d.ts} +5 -9
- package/{count-down/index.d.ts → types/count-down.d.ts} +6 -10
- package/{date-picker/index.d.ts → types/date-picker.d.ts} +6 -10
- package/types/down-file.d.ts +32 -0
- package/types/ellipsis.d.ts +46 -0
- package/types/error-collect.d.ts +34 -0
- package/{exception/index.d.ts → types/exception.d.ts} +13 -13
- package/{footer-toolbar/index.d.ts → types/footer-toolbar.d.ts} +2 -2
- package/{full-content/index.d.ts → types/full-content.d.ts} +8 -13
- package/{global-footer/index.d.ts → types/global-footer.d.ts} +7 -7
- package/{loading/index.d.ts → types/loading.d.ts} +1 -0
- package/{media/index.d.ts → types/media.d.ts} +10 -16
- package/{notice-icon/index.d.ts → types/notice-icon.d.ts} +15 -15
- package/{onboarding/index.d.ts → types/onboarding.d.ts} +12 -14
- package/types/page-header.d.ts +67 -0
- package/types/quick-menu.d.ts +31 -0
- package/{reuse-tab/index.d.ts → types/reuse-tab.d.ts} +46 -55
- package/types/se.d.ts +101 -0
- package/types/sg.d.ts +31 -0
- package/{st/index.d.ts → types/st.d.ts} +10 -2
- package/types/sv.d.ts +81 -0
- package/types/tag-select.d.ts +25 -0
- package/{xlsx/index.d.ts → types/xlsx.d.ts} +3 -3
- package/down-file/index.d.ts +0 -34
- package/ellipsis/index.d.ts +0 -55
- package/error-collect/index.d.ts +0 -35
- package/page-header/index.d.ts +0 -83
- package/quick-menu/index.d.ts +0 -38
- package/se/index.d.ts +0 -129
- package/sg/index.d.ts +0 -44
- package/sv/index.d.ts +0 -96
- package/tag-select/index.d.ts +0 -27
- /package/{index.d.ts → types/abc.d.ts} +0 -0
- /package/{hotkey/index.d.ts → types/hotkey.d.ts} +0 -0
- /package/{lodop/index.d.ts → types/lodop.d.ts} +0 -0
- /package/{pdf/index.d.ts → types/pdf.d.ts} +0 -0
- /package/{zip/index.d.ts → types/zip.d.ts} +0 -0
package/fesm2022/sv.mjs
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { inject,
|
|
3
|
-
import { AlainConfigService } from '@delon/util/config';
|
|
2
|
+
import { inject, computed, ViewEncapsulation, ChangeDetectionStrategy, Component, input, numberAttribute, booleanAttribute, Input, viewChild, afterNextRender, NgModule } from '@angular/core';
|
|
4
3
|
import { NzStringTemplateOutletDirective, NzOutletModule } from 'ng-zorro-antd/core/outlet';
|
|
5
4
|
import { NzTooltipDirective, NzTooltipModule } from 'ng-zorro-antd/tooltip';
|
|
6
5
|
import { CdkObserveContent, ObserversModule } from '@angular/cdk/observers';
|
|
@@ -10,141 +9,101 @@ import { NzIconDirective, NzIconModule } from 'ng-zorro-antd/icon';
|
|
|
10
9
|
import { CommonModule } from '@angular/common';
|
|
11
10
|
|
|
12
11
|
class SVTitleComponent {
|
|
13
|
-
el = inject(ElementRef).nativeElement;
|
|
14
12
|
parentComp = inject(SVContainerComponent, { host: true, optional: true });
|
|
15
|
-
|
|
13
|
+
paddingValue = computed(() => this.parentComp.gutter() / 2, ...(ngDevMode ? [{ debugName: "paddingValue" }] : []));
|
|
16
14
|
constructor() {
|
|
17
15
|
if (this.parentComp == null) {
|
|
18
16
|
throw new Error(`[sv-title] must include 'sv-container' component`);
|
|
19
17
|
}
|
|
20
18
|
}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
const el = this.el;
|
|
24
|
-
this.ren.setStyle(el, 'padding-left', `${gutter / 2}px`);
|
|
25
|
-
this.ren.setStyle(el, 'padding-right', `${gutter / 2}px`);
|
|
26
|
-
}
|
|
27
|
-
ngOnInit() {
|
|
28
|
-
this.setClass();
|
|
29
|
-
}
|
|
30
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.0", ngImport: i0, type: SVTitleComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
31
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.0", type: SVTitleComponent, isStandalone: true, selector: "sv-title, [sv-title]", host: { properties: { "class.sv__title": "true" } }, exportAs: ["svTitle"], ngImport: i0, template: '<ng-content />', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
19
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: SVTitleComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
20
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.0.6", type: SVTitleComponent, isStandalone: true, selector: "sv-title, [sv-title]", host: { properties: { "style.padding-left.px": "paddingValue()", "style.padding-right.px": "paddingValue()" }, classAttribute: "sv__title" }, exportAs: ["svTitle"], ngImport: i0, template: '<ng-content />', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
32
21
|
}
|
|
33
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
22
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: SVTitleComponent, decorators: [{
|
|
34
23
|
type: Component,
|
|
35
24
|
args: [{
|
|
36
25
|
selector: 'sv-title, [sv-title]',
|
|
37
26
|
exportAs: 'svTitle',
|
|
38
27
|
template: '<ng-content />',
|
|
39
28
|
host: {
|
|
40
|
-
|
|
29
|
+
class: 'sv__title',
|
|
30
|
+
'[style.padding-left.px]': 'paddingValue()',
|
|
31
|
+
'[style.padding-right.px]': 'paddingValue()'
|
|
41
32
|
},
|
|
42
33
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
43
34
|
encapsulation: ViewEncapsulation.None
|
|
44
35
|
}]
|
|
45
36
|
}], ctorParameters: () => [] });
|
|
46
37
|
class SVContainerComponent {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
title;
|
|
50
|
-
size;
|
|
38
|
+
colInCon = input(null, { ...(ngDevMode ? { debugName: "colInCon" } : {}), transform: (v) => (v == null ? null : numberAttribute(v)),
|
|
39
|
+
alias: 'sv-container' });
|
|
40
|
+
title = input(...(ngDevMode ? [undefined, { debugName: "title" }] : []));
|
|
41
|
+
size = input('large', ...(ngDevMode ? [{ debugName: "size" }] : []));
|
|
51
42
|
/** 列表项间距,单位为 `px` */
|
|
52
|
-
gutter;
|
|
53
|
-
layout;
|
|
54
|
-
labelWidth;
|
|
43
|
+
gutter = input(32, { ...(ngDevMode ? { debugName: "gutter" } : {}), transform: numberAttribute });
|
|
44
|
+
layout = input('horizontal', ...(ngDevMode ? [{ debugName: "layout" }] : []));
|
|
45
|
+
labelWidth = input(undefined, { ...(ngDevMode ? { debugName: "labelWidth" } : {}), transform: numberAttribute });
|
|
55
46
|
/** 指定信息最多分几列展示,最终一行几列由 col 配置结合响应式规则决定 */
|
|
56
|
-
col;
|
|
57
|
-
default;
|
|
58
|
-
noColon = false;
|
|
59
|
-
bordered = false;
|
|
60
|
-
|
|
61
|
-
return this.bordered
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
});
|
|
71
|
-
}
|
|
72
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.0", ngImport: i0, type: SVContainerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
73
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.0", type: SVContainerComponent, isStandalone: true, selector: "sv-container, [sv-container]", inputs: { colInCon: ["sv-container", "colInCon", (v) => (v == null ? null : numberAttribute(v))], title: "title", size: "size", gutter: ["gutter", "gutter", numberAttribute], layout: "layout", labelWidth: ["labelWidth", "labelWidth", numberAttribute], col: ["col", "col", numberAttribute], default: ["default", "default", booleanAttribute], noColon: ["noColon", "noColon", booleanAttribute], bordered: ["bordered", "bordered", booleanAttribute] }, host: { properties: { "class.sv__container": "true", "class.sv__horizontal": "layout === 'horizontal'", "class.sv__vertical": "layout === 'vertical'", "class.sv__small": "size === 'small'", "class.sv__large": "size === 'large'", "class.sv__bordered": "bordered", "class.clearfix": "true" } }, exportAs: ["svContainer"], ngImport: i0, template: `
|
|
74
|
-
<div class="ant-row" [style]="margin">
|
|
75
|
-
@if (title) {
|
|
47
|
+
col = input(3, { ...(ngDevMode ? { debugName: "col" } : {}), transform: numberAttribute });
|
|
48
|
+
default = input(true, { ...(ngDevMode ? { debugName: "default" } : {}), transform: booleanAttribute });
|
|
49
|
+
noColon = input(false, { ...(ngDevMode ? { debugName: "noColon" } : {}), transform: booleanAttribute });
|
|
50
|
+
bordered = input(false, { ...(ngDevMode ? { debugName: "bordered" } : {}), transform: booleanAttribute });
|
|
51
|
+
margin = computed(() => {
|
|
52
|
+
return this.bordered()
|
|
53
|
+
? {}
|
|
54
|
+
: { 'margin-left': `${-(this.gutter() / 2)}px`, 'margin-right': `${-(this.gutter() / 2)}px` };
|
|
55
|
+
}, ...(ngDevMode ? [{ debugName: "margin" }] : []));
|
|
56
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: SVContainerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
57
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.6", type: SVContainerComponent, isStandalone: true, selector: "sv-container, [sv-container]", inputs: { colInCon: { classPropertyName: "colInCon", publicName: "sv-container", isSignal: true, isRequired: false, transformFunction: null }, title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, gutter: { classPropertyName: "gutter", publicName: "gutter", isSignal: true, isRequired: false, transformFunction: null }, layout: { classPropertyName: "layout", publicName: "layout", isSignal: true, isRequired: false, transformFunction: null }, labelWidth: { classPropertyName: "labelWidth", publicName: "labelWidth", isSignal: true, isRequired: false, transformFunction: null }, col: { classPropertyName: "col", publicName: "col", isSignal: true, isRequired: false, transformFunction: null }, default: { classPropertyName: "default", publicName: "default", isSignal: true, isRequired: false, transformFunction: null }, noColon: { classPropertyName: "noColon", publicName: "noColon", isSignal: true, isRequired: false, transformFunction: null }, bordered: { classPropertyName: "bordered", publicName: "bordered", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class.sv__horizontal": "layout() === 'horizontal'", "class.sv__vertical": "layout() === 'vertical'", "class.sv__small": "size() === 'small'", "class.sv__large": "size() === 'large'", "class.sv__bordered": "bordered()", "class.clearfix": "true" }, classAttribute: "sv__container" }, exportAs: ["svContainer"], ngImport: i0, template: `
|
|
58
|
+
<div class="ant-row" [style]="margin()">
|
|
59
|
+
@let tit = title();
|
|
60
|
+
@if (tit) {
|
|
76
61
|
<sv-title>
|
|
77
|
-
<ng-container *nzStringTemplateOutlet="
|
|
62
|
+
<ng-container *nzStringTemplateOutlet="tit">{{ tit }}</ng-container>
|
|
78
63
|
</sv-title>
|
|
79
64
|
}
|
|
80
65
|
<ng-content />
|
|
81
66
|
</div>
|
|
82
67
|
`, isInline: true, dependencies: [{ kind: "component", type: SVTitleComponent, selector: "sv-title, [sv-title]", exportAs: ["svTitle"] }, { kind: "directive", type: NzStringTemplateOutletDirective, selector: "[nzStringTemplateOutlet]", inputs: ["nzStringTemplateOutletContext", "nzStringTemplateOutlet"], exportAs: ["nzStringTemplateOutlet"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
83
68
|
}
|
|
84
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
69
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: SVContainerComponent, decorators: [{
|
|
85
70
|
type: Component,
|
|
86
71
|
args: [{
|
|
87
72
|
selector: 'sv-container, [sv-container]',
|
|
88
73
|
exportAs: 'svContainer',
|
|
89
74
|
template: `
|
|
90
|
-
<div class="ant-row" [style]="margin">
|
|
91
|
-
@
|
|
75
|
+
<div class="ant-row" [style]="margin()">
|
|
76
|
+
@let tit = title();
|
|
77
|
+
@if (tit) {
|
|
92
78
|
<sv-title>
|
|
93
|
-
<ng-container *nzStringTemplateOutlet="
|
|
79
|
+
<ng-container *nzStringTemplateOutlet="tit">{{ tit }}</ng-container>
|
|
94
80
|
</sv-title>
|
|
95
81
|
}
|
|
96
82
|
<ng-content />
|
|
97
83
|
</div>
|
|
98
84
|
`,
|
|
99
85
|
host: {
|
|
100
|
-
|
|
101
|
-
'[class.sv__horizontal]': `layout === 'horizontal'`,
|
|
102
|
-
'[class.sv__vertical]': `layout === 'vertical'`,
|
|
103
|
-
'[class.sv__small]': `size === 'small'`,
|
|
104
|
-
'[class.sv__large]': `size === 'large'`,
|
|
105
|
-
'[class.sv__bordered]': `bordered`,
|
|
86
|
+
class: 'sv__container',
|
|
87
|
+
'[class.sv__horizontal]': `layout() === 'horizontal'`,
|
|
88
|
+
'[class.sv__vertical]': `layout() === 'vertical'`,
|
|
89
|
+
'[class.sv__small]': `size() === 'small'`,
|
|
90
|
+
'[class.sv__large]': `size() === 'large'`,
|
|
91
|
+
'[class.sv__bordered]': `bordered()`,
|
|
106
92
|
'[class.clearfix]': `true`
|
|
107
93
|
},
|
|
108
94
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
109
95
|
encapsulation: ViewEncapsulation.None,
|
|
110
96
|
imports: [SVTitleComponent, NzStringTemplateOutletDirective]
|
|
111
97
|
}]
|
|
112
|
-
}],
|
|
113
|
-
type: Input,
|
|
114
|
-
args: [{ alias: 'sv-container', transform: (v) => (v == null ? null : numberAttribute(v)) }]
|
|
115
|
-
}], title: [{
|
|
116
|
-
type: Input
|
|
117
|
-
}], size: [{
|
|
118
|
-
type: Input
|
|
119
|
-
}], gutter: [{
|
|
120
|
-
type: Input,
|
|
121
|
-
args: [{ transform: numberAttribute }]
|
|
122
|
-
}], layout: [{
|
|
123
|
-
type: Input
|
|
124
|
-
}], labelWidth: [{
|
|
125
|
-
type: Input,
|
|
126
|
-
args: [{ transform: numberAttribute }]
|
|
127
|
-
}], col: [{
|
|
128
|
-
type: Input,
|
|
129
|
-
args: [{ transform: numberAttribute }]
|
|
130
|
-
}], default: [{
|
|
131
|
-
type: Input,
|
|
132
|
-
args: [{ transform: booleanAttribute }]
|
|
133
|
-
}], noColon: [{
|
|
134
|
-
type: Input,
|
|
135
|
-
args: [{ transform: booleanAttribute }]
|
|
136
|
-
}], bordered: [{
|
|
137
|
-
type: Input,
|
|
138
|
-
args: [{ transform: booleanAttribute }]
|
|
139
|
-
}] } });
|
|
98
|
+
}], propDecorators: { colInCon: [{ type: i0.Input, args: [{ isSignal: true, alias: "sv-container", required: false }] }], title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], gutter: [{ type: i0.Input, args: [{ isSignal: true, alias: "gutter", required: false }] }], layout: [{ type: i0.Input, args: [{ isSignal: true, alias: "layout", required: false }] }], labelWidth: [{ type: i0.Input, args: [{ isSignal: true, alias: "labelWidth", required: false }] }], col: [{ type: i0.Input, args: [{ isSignal: true, alias: "col", required: false }] }], default: [{ type: i0.Input, args: [{ isSignal: true, alias: "default", required: false }] }], noColon: [{ type: i0.Input, args: [{ isSignal: true, alias: "noColon", required: false }] }], bordered: [{ type: i0.Input, args: [{ isSignal: true, alias: "bordered", required: false }] }] } });
|
|
140
99
|
|
|
141
100
|
class SVValueComponent {
|
|
142
101
|
prefix;
|
|
143
102
|
unit;
|
|
144
103
|
tooltip;
|
|
145
104
|
size = 'default';
|
|
146
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
147
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "
|
|
105
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: SVValueComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
106
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.6", type: SVValueComponent, isStandalone: true, selector: "sv-value, [sv-value]", inputs: { prefix: "prefix", unit: "unit", tooltip: "tooltip", size: "size" }, host: { properties: { "class.sv__value": "true", "class.sv__value-small": "size === 'small'", "class.sv__value-large": "size === 'large'" } }, exportAs: ["svValue"], ngImport: i0, template: `
|
|
148
107
|
@if (prefix) {
|
|
149
108
|
<em class="sv__value-prefix" [innerHTML]="prefix"></em>
|
|
150
109
|
}
|
|
@@ -154,7 +113,7 @@ class SVValueComponent {
|
|
|
154
113
|
}
|
|
155
114
|
`, isInline: true, dependencies: [{ kind: "directive", type: NzTooltipDirective, selector: "[nz-tooltip]", inputs: ["nzTooltipTitle", "nzTooltipTitleContext", "nz-tooltip", "nzTooltipTrigger", "nzTooltipPlacement", "nzTooltipOrigin", "nzTooltipVisible", "nzTooltipMouseEnterDelay", "nzTooltipMouseLeaveDelay", "nzTooltipOverlayClassName", "nzTooltipOverlayStyle", "nzTooltipArrowPointAtCenter", "cdkConnectedOverlayPush", "nzTooltipColor"], outputs: ["nzTooltipVisibleChange"], exportAs: ["nzTooltip"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
156
115
|
}
|
|
157
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
116
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: SVValueComponent, decorators: [{
|
|
158
117
|
type: Component,
|
|
159
118
|
args: [{
|
|
160
119
|
selector: 'sv-value, [sv-value]',
|
|
@@ -189,69 +148,63 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.0", ngImpor
|
|
|
189
148
|
|
|
190
149
|
const prefixCls = `sv`;
|
|
191
150
|
class SVComponent {
|
|
192
|
-
el = inject(ElementRef).nativeElement;
|
|
193
151
|
parentComp = inject(SVContainerComponent, { host: true, optional: true });
|
|
194
152
|
rep = inject(ResponsiveService);
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
153
|
+
conEl = viewChild.required('conEl');
|
|
154
|
+
_noColon = computed(() => {
|
|
155
|
+
const noColon = this.noColon();
|
|
156
|
+
const parent = this.parentComp;
|
|
157
|
+
return parent.bordered() ? true : noColon != null ? noColon : parent.noColon();
|
|
158
|
+
}, ...(ngDevMode ? [{ debugName: "_noColon" }] : []));
|
|
199
159
|
// #region fields
|
|
200
|
-
optional;
|
|
201
|
-
optionalHelp;
|
|
202
|
-
optionalHelpColor;
|
|
203
|
-
label;
|
|
204
|
-
unit;
|
|
205
|
-
col;
|
|
206
|
-
default;
|
|
207
|
-
type;
|
|
208
|
-
noColon;
|
|
209
|
-
hideLabel = false;
|
|
160
|
+
optional = input(...(ngDevMode ? [undefined, { debugName: "optional" }] : []));
|
|
161
|
+
optionalHelp = input(...(ngDevMode ? [undefined, { debugName: "optionalHelp" }] : []));
|
|
162
|
+
optionalHelpColor = input(...(ngDevMode ? [undefined, { debugName: "optionalHelpColor" }] : []));
|
|
163
|
+
label = input(...(ngDevMode ? [undefined, { debugName: "label" }] : []));
|
|
164
|
+
unit = input(...(ngDevMode ? [undefined, { debugName: "unit" }] : []));
|
|
165
|
+
col = input(null, { ...(ngDevMode ? { debugName: "col" } : {}), transform: (v) => (v == null ? null : numberAttribute(v)) });
|
|
166
|
+
default = input(null, { ...(ngDevMode ? { debugName: "default" } : {}), transform: (v) => (v == null ? null : booleanAttribute(v)) });
|
|
167
|
+
type = input(...(ngDevMode ? [undefined, { debugName: "type" }] : []));
|
|
168
|
+
noColon = input(null, { ...(ngDevMode ? { debugName: "noColon" } : {}), transform: (v) => (v == null ? null : booleanAttribute(v)) });
|
|
169
|
+
hideLabel = input(false, { ...(ngDevMode ? { debugName: "hideLabel" } : {}), transform: booleanAttribute });
|
|
210
170
|
// #endregion
|
|
211
|
-
|
|
212
|
-
|
|
171
|
+
paddingValue = computed(() => {
|
|
172
|
+
const parent = this.parentComp;
|
|
173
|
+
if (parent.bordered())
|
|
213
174
|
return null;
|
|
214
|
-
return
|
|
215
|
-
}
|
|
216
|
-
|
|
175
|
+
return parent.gutter() / 2;
|
|
176
|
+
}, ...(ngDevMode ? [{ debugName: "paddingValue" }] : []));
|
|
177
|
+
labelWidth = computed(() => {
|
|
217
178
|
const { labelWidth, layout } = this.parentComp;
|
|
218
|
-
return layout === 'horizontal' ? labelWidth : null;
|
|
219
|
-
}
|
|
179
|
+
return layout() === 'horizontal' ? labelWidth() : null;
|
|
180
|
+
}, ...(ngDevMode ? [{ debugName: "labelWidth" }] : []));
|
|
181
|
+
cls = computed(() => {
|
|
182
|
+
const parent = this.parentComp;
|
|
183
|
+
const parentCol = parent.colInCon() ?? parent.col();
|
|
184
|
+
const col = this.col();
|
|
185
|
+
const ret = [...this.rep.genCls(col != null ? col : parentCol, parentCol)];
|
|
186
|
+
ret.push(`${prefixCls}__item`);
|
|
187
|
+
if (parent.labelWidth())
|
|
188
|
+
ret.push(`${prefixCls}__item-fixed`);
|
|
189
|
+
const type = this.type();
|
|
190
|
+
if (type)
|
|
191
|
+
ret.push(`${prefixCls}__type-${type}`);
|
|
192
|
+
return ret;
|
|
193
|
+
}, ...(ngDevMode ? [{ debugName: "cls" }] : []));
|
|
220
194
|
constructor() {
|
|
221
195
|
if (this.parentComp == null) {
|
|
222
196
|
throw new Error(`[sv] must include 'sv-container' component`);
|
|
223
197
|
}
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
const parent = this.parentComp;
|
|
228
|
-
const el = this.el;
|
|
229
|
-
this._noColon = parent.bordered ? true : noColon != null ? noColon : parent.noColon;
|
|
230
|
-
clsMap.forEach(cls => ren.removeClass(el, cls));
|
|
231
|
-
clsMap.length = 0;
|
|
232
|
-
const parentCol = parent.colInCon ?? parent.col;
|
|
233
|
-
clsMap.push(...rep.genCls(col != null ? col : parentCol, parentCol));
|
|
234
|
-
clsMap.push(`${prefixCls}__item`);
|
|
235
|
-
if (parent.labelWidth)
|
|
236
|
-
clsMap.push(`${prefixCls}__item-fixed`);
|
|
237
|
-
if (type)
|
|
238
|
-
clsMap.push(`${prefixCls}__type-${type}`);
|
|
239
|
-
clsMap.forEach(cls => ren.addClass(el, cls));
|
|
240
|
-
}
|
|
241
|
-
ngAfterViewInit() {
|
|
242
|
-
this.setClass();
|
|
243
|
-
this.checkContent();
|
|
244
|
-
}
|
|
245
|
-
ngOnChanges() {
|
|
246
|
-
this.setClass();
|
|
198
|
+
afterNextRender(() => {
|
|
199
|
+
this.checkContent();
|
|
200
|
+
});
|
|
247
201
|
}
|
|
248
202
|
checkContent() {
|
|
249
|
-
const
|
|
250
|
-
|
|
251
|
-
if (!(def != null ? def : this.parentComp?.default)) {
|
|
203
|
+
const def = this.default();
|
|
204
|
+
if (!(def != null ? def : this.parentComp?.default())) {
|
|
252
205
|
return;
|
|
253
206
|
}
|
|
254
|
-
const el = conEl.nativeElement;
|
|
207
|
+
const el = this.conEl().nativeElement;
|
|
255
208
|
const cls = `sv__default`;
|
|
256
209
|
if (el.classList.contains(cls)) {
|
|
257
210
|
el.classList.remove(cls);
|
|
@@ -260,51 +213,109 @@ class SVComponent {
|
|
|
260
213
|
el.classList.add(cls);
|
|
261
214
|
}
|
|
262
215
|
}
|
|
263
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
264
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "
|
|
216
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: SVComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
217
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.6", type: SVComponent, isStandalone: true, selector: "sv, [sv]", inputs: { optional: { classPropertyName: "optional", publicName: "optional", isSignal: true, isRequired: false, transformFunction: null }, optionalHelp: { classPropertyName: "optionalHelp", publicName: "optionalHelp", isSignal: true, isRequired: false, transformFunction: null }, optionalHelpColor: { classPropertyName: "optionalHelpColor", publicName: "optionalHelpColor", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, unit: { classPropertyName: "unit", publicName: "unit", isSignal: true, isRequired: false, transformFunction: null }, col: { classPropertyName: "col", publicName: "col", isSignal: true, isRequired: false, transformFunction: null }, default: { classPropertyName: "default", publicName: "default", isSignal: true, isRequired: false, transformFunction: null }, type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null }, noColon: { classPropertyName: "noColon", publicName: "noColon", isSignal: true, isRequired: false, transformFunction: null }, hideLabel: { classPropertyName: "hideLabel", publicName: "hideLabel", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "style.padding-left.px": "paddingValue()", "style.padding-right.px": "paddingValue()", "class": "cls()" } }, viewQueries: [{ propertyName: "conEl", first: true, predicate: ["conEl"], descendants: true, isSignal: true }], exportAs: ["sv"], ngImport: i0, template: `
|
|
218
|
+
@if (!hideLabel()) {
|
|
219
|
+
@let _label = label();
|
|
220
|
+
<div
|
|
221
|
+
class="sv__label"
|
|
222
|
+
[class.sv__label-empty]="!_label"
|
|
223
|
+
[class.sv__label-width]="labelWidth() != null"
|
|
224
|
+
[class.sv__no-colon]="_noColon()"
|
|
225
|
+
[style.width.px]="labelWidth()"
|
|
226
|
+
>
|
|
227
|
+
<span class="sv__label-text">
|
|
228
|
+
<ng-container *nzStringTemplateOutlet="_label">{{ _label }}</ng-container>
|
|
229
|
+
</span>
|
|
230
|
+
@let _optional = optional();
|
|
231
|
+
@if (_optional || optionalHelp()) {
|
|
232
|
+
<span class="sv__label-optional" [class.sv__label-optional-no-text]="!_optional">
|
|
233
|
+
<ng-container *nzStringTemplateOutlet="_optional">{{ _optional }}</ng-container>
|
|
234
|
+
@if (optionalHelp()) {
|
|
235
|
+
<nz-icon
|
|
236
|
+
nz-tooltip
|
|
237
|
+
[nzTooltipTitle]="optionalHelp()"
|
|
238
|
+
[nzTooltipColor]="optionalHelpColor()"
|
|
239
|
+
nzType="question-circle"
|
|
240
|
+
/>
|
|
241
|
+
}
|
|
242
|
+
</span>
|
|
243
|
+
}
|
|
244
|
+
</div>
|
|
245
|
+
}
|
|
246
|
+
<div class="sv__detail">
|
|
247
|
+
<span (cdkObserveContent)="checkContent()" #conEl>
|
|
248
|
+
<ng-content />
|
|
249
|
+
</span>
|
|
250
|
+
@let _unit = unit();
|
|
251
|
+
@if (_unit) {
|
|
252
|
+
<span class="sv__unit" *nzStringTemplateOutlet="_unit">{{ _unit }}</span>
|
|
253
|
+
}
|
|
254
|
+
</div>
|
|
255
|
+
`, isInline: true, dependencies: [{ kind: "directive", type: NzStringTemplateOutletDirective, selector: "[nzStringTemplateOutlet]", inputs: ["nzStringTemplateOutletContext", "nzStringTemplateOutlet"], exportAs: ["nzStringTemplateOutlet"] }, { kind: "directive", type: NzTooltipDirective, selector: "[nz-tooltip]", inputs: ["nzTooltipTitle", "nzTooltipTitleContext", "nz-tooltip", "nzTooltipTrigger", "nzTooltipPlacement", "nzTooltipOrigin", "nzTooltipVisible", "nzTooltipMouseEnterDelay", "nzTooltipMouseLeaveDelay", "nzTooltipOverlayClassName", "nzTooltipOverlayStyle", "nzTooltipArrowPointAtCenter", "cdkConnectedOverlayPush", "nzTooltipColor"], outputs: ["nzTooltipVisibleChange"], exportAs: ["nzTooltip"] }, { kind: "directive", type: NzIconDirective, selector: "nz-icon,[nz-icon]", inputs: ["nzSpin", "nzRotate", "nzType", "nzTheme", "nzTwotoneColor", "nzIconfont"], exportAs: ["nzIcon"] }, { kind: "directive", type: CdkObserveContent, selector: "[cdkObserveContent]", inputs: ["cdkObserveContentDisabled", "debounce"], outputs: ["cdkObserveContent"], exportAs: ["cdkObserveContent"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
265
256
|
}
|
|
266
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
257
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: SVComponent, decorators: [{
|
|
267
258
|
type: Component,
|
|
268
|
-
args: [{
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
259
|
+
args: [{
|
|
260
|
+
selector: 'sv, [sv]',
|
|
261
|
+
exportAs: 'sv',
|
|
262
|
+
template: `
|
|
263
|
+
@if (!hideLabel()) {
|
|
264
|
+
@let _label = label();
|
|
265
|
+
<div
|
|
266
|
+
class="sv__label"
|
|
267
|
+
[class.sv__label-empty]="!_label"
|
|
268
|
+
[class.sv__label-width]="labelWidth() != null"
|
|
269
|
+
[class.sv__no-colon]="_noColon()"
|
|
270
|
+
[style.width.px]="labelWidth()"
|
|
271
|
+
>
|
|
272
|
+
<span class="sv__label-text">
|
|
273
|
+
<ng-container *nzStringTemplateOutlet="_label">{{ _label }}</ng-container>
|
|
274
|
+
</span>
|
|
275
|
+
@let _optional = optional();
|
|
276
|
+
@if (_optional || optionalHelp()) {
|
|
277
|
+
<span class="sv__label-optional" [class.sv__label-optional-no-text]="!_optional">
|
|
278
|
+
<ng-container *nzStringTemplateOutlet="_optional">{{ _optional }}</ng-container>
|
|
279
|
+
@if (optionalHelp()) {
|
|
280
|
+
<nz-icon
|
|
281
|
+
nz-tooltip
|
|
282
|
+
[nzTooltipTitle]="optionalHelp()"
|
|
283
|
+
[nzTooltipColor]="optionalHelpColor()"
|
|
284
|
+
nzType="question-circle"
|
|
285
|
+
/>
|
|
286
|
+
}
|
|
287
|
+
</span>
|
|
288
|
+
}
|
|
289
|
+
</div>
|
|
290
|
+
}
|
|
291
|
+
<div class="sv__detail">
|
|
292
|
+
<span (cdkObserveContent)="checkContent()" #conEl>
|
|
293
|
+
<ng-content />
|
|
294
|
+
</span>
|
|
295
|
+
@let _unit = unit();
|
|
296
|
+
@if (_unit) {
|
|
297
|
+
<span class="sv__unit" *nzStringTemplateOutlet="_unit">{{ _unit }}</span>
|
|
298
|
+
}
|
|
299
|
+
</div>
|
|
300
|
+
`,
|
|
301
|
+
host: {
|
|
302
|
+
'[style.padding-left.px]': 'paddingValue()',
|
|
303
|
+
'[style.padding-right.px]': 'paddingValue()',
|
|
304
|
+
'[class]': 'cls()'
|
|
305
|
+
},
|
|
306
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
307
|
+
encapsulation: ViewEncapsulation.None,
|
|
308
|
+
imports: [NzStringTemplateOutletDirective, NzTooltipDirective, NzIconDirective, CdkObserveContent]
|
|
309
|
+
}]
|
|
310
|
+
}], ctorParameters: () => [], propDecorators: { conEl: [{ type: i0.ViewChild, args: ['conEl', { isSignal: true }] }], optional: [{ type: i0.Input, args: [{ isSignal: true, alias: "optional", required: false }] }], optionalHelp: [{ type: i0.Input, args: [{ isSignal: true, alias: "optionalHelp", required: false }] }], optionalHelpColor: [{ type: i0.Input, args: [{ isSignal: true, alias: "optionalHelpColor", required: false }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], unit: [{ type: i0.Input, args: [{ isSignal: true, alias: "unit", required: false }] }], col: [{ type: i0.Input, args: [{ isSignal: true, alias: "col", required: false }] }], default: [{ type: i0.Input, args: [{ isSignal: true, alias: "default", required: false }] }], type: [{ type: i0.Input, args: [{ isSignal: true, alias: "type", required: false }] }], noColon: [{ type: i0.Input, args: [{ isSignal: true, alias: "noColon", required: false }] }], hideLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "hideLabel", required: false }] }] } });
|
|
300
311
|
|
|
301
312
|
const COMPONENTS = [SVContainerComponent, SVComponent, SVTitleComponent, SVValueComponent];
|
|
302
313
|
class SVModule {
|
|
303
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
304
|
-
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "
|
|
305
|
-
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "
|
|
314
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: SVModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
315
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.0.6", ngImport: i0, type: SVModule, imports: [CommonModule, ObserversModule, NzTooltipModule, NzIconModule, NzOutletModule, SVContainerComponent, SVComponent, SVTitleComponent, SVValueComponent], exports: [SVContainerComponent, SVComponent, SVTitleComponent, SVValueComponent] });
|
|
316
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: SVModule, imports: [CommonModule, ObserversModule, NzTooltipModule, NzIconModule, NzOutletModule] });
|
|
306
317
|
}
|
|
307
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
318
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: SVModule, decorators: [{
|
|
308
319
|
type: NgModule,
|
|
309
320
|
args: [{
|
|
310
321
|
imports: [CommonModule, ObserversModule, NzTooltipModule, NzIconModule, NzOutletModule, ...COMPONENTS],
|