@sixbell-telco/sdk 2.1.0 → 3.1.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 +82 -1
- package/README.md +323 -84
- package/_index.css +17 -3
- package/components/card/card-actions/card-actions.component.d.ts +4 -4
- package/components/card/card-body/card-body.component.d.ts +5 -0
- package/components/card/card-context.d.ts +8 -0
- package/components/card/card-footer/card-footer.component.d.ts +7 -0
- package/components/card/card-header/card-header.component.d.ts +5 -0
- package/components/card/card-header-aside/card-header-aside.component.d.ts +5 -0
- package/components/card/card-section/card-section.component.d.ts +5 -0
- package/components/card/card-section-body/card-section-body.component.d.ts +13 -0
- package/components/card/card-section-footer/card-section-footer.component.d.ts +5 -0
- package/components/card/card-section-group/card-section-group.component.d.ts +16 -0
- package/components/card/card-section-header/card-section-header.component.d.ts +5 -0
- package/components/card/card-section-header-aside/card-section-header-aside.component.d.ts +5 -0
- package/components/card/card-subtitle/card-subtitle.component.d.ts +34 -0
- package/components/card/card-title/card-title.component.d.ts +23 -14
- package/components/card/public-api.d.ts +12 -1
- package/components/card/src/card.component.d.ts +5 -1
- package/components/data-table/actions/actions.component.d.ts +67 -0
- package/components/data-table/actions/actions.types.d.ts +38 -0
- package/components/data-table/public-api.d.ts +2 -0
- package/components/data-table/sortable-header/sortable-header.component.d.ts +2 -0
- package/components/data-table/src/data-table.component.d.ts +14 -5
- package/{directives/typography → components/divider}/index.d.ts +1 -1
- package/components/divider/public-api.d.ts +1 -0
- package/components/divider/src/divider.component.d.ts +13 -0
- package/components/forms/date-picker/src/date-picker.component.d.ts +3 -0
- package/components/forms/form-error/src/form-error.component.d.ts +8 -1
- package/components/forms/input/src/input.component.d.ts +1 -12
- package/components/forms/textarea/src/textarea.component.d.ts +1 -6
- package/components/paginator/components/pagination-item/pagination-item.component.d.ts +10 -1
- package/components/paginator/src/paginator.component.d.ts +7 -1
- package/components/table/public-api.d.ts +1 -0
- package/components/table/src/table.component.d.ts +37 -4
- package/components/table/table-action/table-action.component.d.ts +2 -6
- package/components/table/table-actions/table-actions.component.d.ts +52 -6
- package/components/table/table-actions/table-actions.types.d.ts +28 -0
- package/components/{toast → text}/index.d.ts +1 -1
- package/components/text/public-api.d.ts +2 -0
- package/components/text/src/text.component.d.ts +38 -0
- package/directives/only-numbers/public-api.d.ts +0 -5
- package/directives/only-numbers/src/only-numbers.directive.d.ts +1 -13
- package/directives/text/index.d.ts +5 -0
- package/directives/text/public-api.d.ts +1 -0
- package/directives/text/src/text.directive.d.ts +87 -0
- package/fesm2022/sixbell-telco-sdk-components-accordion.mjs +3 -3
- package/fesm2022/sixbell-telco-sdk-components-accordion.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-audio-player.mjs +9 -9
- package/fesm2022/sixbell-telco-sdk-components-audio-player.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-avatar.mjs +10 -11
- package/fesm2022/sixbell-telco-sdk-components-avatar.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-badge.mjs +3 -3
- package/fesm2022/sixbell-telco-sdk-components-badge.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-button.mjs +2 -2
- package/fesm2022/sixbell-telco-sdk-components-button.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-card.mjs +428 -47
- package/fesm2022/sixbell-telco-sdk-components-card.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-data-table.mjs +202 -51
- package/fesm2022/sixbell-telco-sdk-components-data-table.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-dialog.mjs +5 -5
- package/fesm2022/sixbell-telco-sdk-components-dialog.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-divider.mjs +44 -0
- package/fesm2022/sixbell-telco-sdk-components-divider.mjs.map +1 -0
- package/fesm2022/sixbell-telco-sdk-components-dual-list.mjs +4 -4
- package/fesm2022/sixbell-telco-sdk-components-dual-list.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-file-upload.mjs +6 -6
- package/fesm2022/sixbell-telco-sdk-components-file-upload.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-forms-checkbox.mjs +2 -2
- package/fesm2022/sixbell-telco-sdk-components-forms-checkbox.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-forms-combobox.mjs +2 -2
- package/fesm2022/sixbell-telco-sdk-components-forms-combobox.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-forms-date-picker.mjs +21 -5
- package/fesm2022/sixbell-telco-sdk-components-forms-date-picker.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-forms-form-error.mjs +12 -5
- package/fesm2022/sixbell-telco-sdk-components-forms-form-error.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-forms-input.mjs +3 -15
- package/fesm2022/sixbell-telco-sdk-components-forms-input.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-forms-radio.mjs +2 -2
- package/fesm2022/sixbell-telco-sdk-components-forms-radio.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-forms-range.mjs +2 -2
- package/fesm2022/sixbell-telco-sdk-components-forms-range.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-forms-select.mjs +2 -2
- package/fesm2022/sixbell-telco-sdk-components-forms-select.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-forms-switch.mjs +2 -2
- package/fesm2022/sixbell-telco-sdk-components-forms-switch.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-forms-textarea.mjs +5 -11
- package/fesm2022/sixbell-telco-sdk-components-forms-textarea.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-forms-toggle.mjs +4 -4
- package/fesm2022/sixbell-telco-sdk-components-forms-toggle.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-icon.mjs +2 -2
- package/fesm2022/sixbell-telco-sdk-components-icon.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-link.mjs +3 -3
- package/fesm2022/sixbell-telco-sdk-components-link.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-paginator.mjs +46 -18
- package/fesm2022/sixbell-telco-sdk-components-paginator.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-progress.mjs +3 -3
- package/fesm2022/sixbell-telco-sdk-components-progress.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-table.mjs +439 -47
- package/fesm2022/sixbell-telco-sdk-components-table.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-text.mjs +308 -0
- package/fesm2022/sixbell-telco-sdk-components-text.mjs.map +1 -0
- package/fesm2022/sixbell-telco-sdk-components-wizard.mjs +12 -12
- package/fesm2022/sixbell-telco-sdk-components-wizard.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-directives-only-numbers.mjs +5 -22
- package/fesm2022/sixbell-telco-sdk-directives-only-numbers.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-directives-text.mjs +160 -0
- package/fesm2022/sixbell-telco-sdk-directives-text.mjs.map +1 -0
- package/fesm2022/sixbell-telco-sdk-utils-formatting.mjs +490 -0
- package/fesm2022/sixbell-telco-sdk-utils-formatting.mjs.map +1 -0
- package/fesm2022/sixbell-telco-sdk-utils-translation.mjs +49 -1
- package/fesm2022/sixbell-telco-sdk-utils-translation.mjs.map +1 -1
- package/package.json +100 -92
- package/utils/formatting/README.md +100 -0
- package/utils/formatting/index.d.ts +5 -0
- package/utils/formatting/public-api.d.ts +9 -0
- package/utils/formatting/src/constants/constants.d.ts +18 -0
- package/utils/formatting/src/models/formatting.d.ts +33 -0
- package/utils/formatting/src/pipes/currency/st-currency.pipe.d.ts +9 -0
- package/utils/formatting/src/pipes/date/st-date.pipe.d.ts +9 -0
- package/utils/formatting/src/pipes/decimal/st-decimal.pipe.d.ts +9 -0
- package/utils/formatting/src/pipes/percent/st-percent.pipe.d.ts +9 -0
- package/utils/formatting/src/service/formatting.service.d.ts +13 -0
- package/utils/formatting/src/utils/date-format/date-format.d.ts +9 -0
- package/utils/formatting/src/utils/number-format/number-format.d.ts +12 -0
- package/utils/logger/README.md +8 -19
- package/utils/runtime-config/README.md +1 -1
- package/utils/theme/README.md +21 -2
- package/utils/translation/README.md +40 -10
- package/utils/translation/public-api.d.ts +1 -1
- package/utils/translation/src/constants.d.ts +9 -2
- package/utils/translation/src/models/translation.d.ts +11 -0
- package/utils/translation/src/providers/translation.provider.d.ts +1 -1
- package/utils/translation/src/translation.service.d.ts +6 -1
- package/assets/styles/toast.css +0 -63
- package/components/card/card-content/card-content.component.d.ts +0 -30
- package/components/toast/public-api.d.ts +0 -12
- package/components/toast/services/toast.service.d.ts +0 -35
- package/components/toast/toast-message/toast-message.component.d.ts +0 -70
- package/components/toast/toasts-container/toasts-container.component.d.ts +0 -21
- package/directives/typography/public-api.d.ts +0 -1
- package/directives/typography/src/typography.directive.d.ts +0 -68
- package/fesm2022/sixbell-telco-sdk-components-toast.mjs +0 -250
- package/fesm2022/sixbell-telco-sdk-components-toast.mjs.map +0 -1
- package/fesm2022/sixbell-telco-sdk-directives-typography.mjs +0 -126
- package/fesm2022/sixbell-telco-sdk-directives-typography.mjs.map +0 -1
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
import { CommonModule } from '@angular/common';
|
|
1
|
+
import { CommonModule, NgTemplateOutlet } from '@angular/common';
|
|
2
2
|
import * as i0 from '@angular/core';
|
|
3
|
-
import { input, computed, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
|
+
import { input, computed, ChangeDetectionStrategy, Component, InjectionToken, signal, inject, ElementRef, DestroyRef, EnvironmentInjector, contentChildren, afterRenderEffect, createComponent } from '@angular/core';
|
|
4
4
|
import { cn } from '@sixbell-telco/sdk/utils/cn';
|
|
5
|
+
import { DividerComponent } from '@sixbell-telco/sdk/components/divider';
|
|
5
6
|
import { cva } from 'class-variance-authority';
|
|
7
|
+
import { TextDirective } from '@sixbell-telco/sdk/directives/text';
|
|
6
8
|
|
|
7
9
|
/**
|
|
8
10
|
* A container component for card action buttons/controls
|
|
@@ -15,11 +17,11 @@ import { cva } from 'class-variance-authority';
|
|
|
15
17
|
* @example
|
|
16
18
|
* ```html
|
|
17
19
|
* <st-card>
|
|
18
|
-
* <st-card-
|
|
19
|
-
*
|
|
20
|
-
* <st-card-actions alignment="right">
|
|
20
|
+
* <st-card-footer>
|
|
21
|
+
* <st-card-actions alignment="right">
|
|
21
22
|
* <button class="btn">Action</button>
|
|
22
|
-
*
|
|
23
|
+
* </st-card-actions>
|
|
24
|
+
* </st-card-footer>
|
|
23
25
|
* </st-card>
|
|
24
26
|
* ```
|
|
25
27
|
*/
|
|
@@ -34,7 +36,7 @@ class CardActionsComponent {
|
|
|
34
36
|
* Computed class string for the actions container
|
|
35
37
|
*/
|
|
36
38
|
componentClass = computed(() => {
|
|
37
|
-
return cn('card-actions text-pretty
|
|
39
|
+
return cn('card-actions font-body text-pretty', {
|
|
38
40
|
'justify-start': this.alignment() === 'left',
|
|
39
41
|
'justify-end': this.alignment() === 'right',
|
|
40
42
|
'justify-center': this.alignment() === 'center',
|
|
@@ -48,69 +50,444 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.0", ngImpor
|
|
|
48
50
|
args: [{ selector: 'st-card-actions', imports: [CommonModule], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div [class]=\"componentClass()\">\n\t<ng-content></ng-content>\n</div>\n" }]
|
|
49
51
|
}] });
|
|
50
52
|
|
|
53
|
+
class CardBodyComponent {
|
|
54
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.0", ngImport: i0, type: CardBodyComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
55
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.0", type: CardBodyComponent, isStandalone: true, selector: "st-card-body", host: { classAttribute: "flex flex-col" }, ngImport: i0, template: '<ng-content></ng-content>', isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
56
|
+
}
|
|
57
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.0", ngImport: i0, type: CardBodyComponent, decorators: [{
|
|
58
|
+
type: Component,
|
|
59
|
+
args: [{
|
|
60
|
+
selector: 'st-card-body',
|
|
61
|
+
imports: [CommonModule],
|
|
62
|
+
host: {
|
|
63
|
+
class: 'flex flex-col',
|
|
64
|
+
},
|
|
65
|
+
template: '<ng-content></ng-content>',
|
|
66
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
67
|
+
}]
|
|
68
|
+
}] });
|
|
69
|
+
|
|
70
|
+
const CARD_HAS_SECTIONS = new InjectionToken('CARD_HAS_SECTIONS');
|
|
71
|
+
const CARD_TYPOGRAPHY_CONTEXT = new InjectionToken('CARD_TYPOGRAPHY_CONTEXT');
|
|
72
|
+
|
|
73
|
+
class CardFooterComponent {
|
|
74
|
+
divided = input(false);
|
|
75
|
+
contentClass = computed(() => (this.divided() ? 'mt-6' : ''));
|
|
76
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.0", ngImport: i0, type: CardFooterComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
77
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.0", type: CardFooterComponent, isStandalone: true, selector: "st-card-footer", inputs: { divided: { classPropertyName: "divided", publicName: "divided", isSignal: true, isRequired: false, transformFunction: null } }, host: { classAttribute: "flex flex-col" }, ngImport: i0, template: `
|
|
78
|
+
@if (divided()) {
|
|
79
|
+
<st-divider variant="neutral" [withMargin]="false"></st-divider>
|
|
80
|
+
}
|
|
81
|
+
<div [class]="contentClass()">
|
|
82
|
+
<ng-content></ng-content>
|
|
83
|
+
</div>
|
|
84
|
+
`, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "component", type: DividerComponent, selector: "st-divider", inputs: ["orientation", "placement", "variant", "withMargin"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
85
|
+
}
|
|
86
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.0", ngImport: i0, type: CardFooterComponent, decorators: [{
|
|
87
|
+
type: Component,
|
|
88
|
+
args: [{
|
|
89
|
+
selector: 'st-card-footer',
|
|
90
|
+
imports: [CommonModule, DividerComponent],
|
|
91
|
+
host: {
|
|
92
|
+
class: 'flex flex-col',
|
|
93
|
+
},
|
|
94
|
+
template: `
|
|
95
|
+
@if (divided()) {
|
|
96
|
+
<st-divider variant="neutral" [withMargin]="false"></st-divider>
|
|
97
|
+
}
|
|
98
|
+
<div [class]="contentClass()">
|
|
99
|
+
<ng-content></ng-content>
|
|
100
|
+
</div>
|
|
101
|
+
`,
|
|
102
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
103
|
+
}]
|
|
104
|
+
}] });
|
|
105
|
+
|
|
106
|
+
class CardHeaderAsideComponent {
|
|
107
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.0", ngImport: i0, type: CardHeaderAsideComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
108
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.0", type: CardHeaderAsideComponent, isStandalone: true, selector: "st-card-header-aside", host: { classAttribute: "shrink-0" }, ngImport: i0, template: '<ng-content></ng-content>', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
109
|
+
}
|
|
110
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.0", ngImport: i0, type: CardHeaderAsideComponent, decorators: [{
|
|
111
|
+
type: Component,
|
|
112
|
+
args: [{
|
|
113
|
+
selector: 'st-card-header-aside',
|
|
114
|
+
host: {
|
|
115
|
+
class: 'shrink-0',
|
|
116
|
+
},
|
|
117
|
+
template: '<ng-content></ng-content>',
|
|
118
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
119
|
+
}]
|
|
120
|
+
}] });
|
|
121
|
+
|
|
122
|
+
const NON_PROMINENT_CARD_HEADER = signal(false).asReadonly();
|
|
123
|
+
class CardHeaderComponent {
|
|
124
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.0", ngImport: i0, type: CardHeaderComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
125
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.0", type: CardHeaderComponent, isStandalone: true, selector: "st-card-header", host: { classAttribute: "block" }, providers: [
|
|
126
|
+
{
|
|
127
|
+
provide: CARD_TYPOGRAPHY_CONTEXT,
|
|
128
|
+
useFactory: () => {
|
|
129
|
+
const prominent = inject(CARD_HAS_SECTIONS, { optional: true });
|
|
130
|
+
return {
|
|
131
|
+
area: 'card-header',
|
|
132
|
+
prominent: prominent ?? NON_PROMINENT_CARD_HEADER,
|
|
133
|
+
};
|
|
134
|
+
},
|
|
135
|
+
},
|
|
136
|
+
], ngImport: i0, template: `
|
|
137
|
+
<div class="flex flex-col gap-4 sm:flex-row sm:items-start">
|
|
138
|
+
<div class="flex min-w-0 flex-1 flex-col gap-1">
|
|
139
|
+
<ng-content></ng-content>
|
|
140
|
+
</div>
|
|
141
|
+
<ng-content select="st-card-header-aside"></ng-content>
|
|
142
|
+
</div>
|
|
143
|
+
`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
144
|
+
}
|
|
145
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.0", ngImport: i0, type: CardHeaderComponent, decorators: [{
|
|
146
|
+
type: Component,
|
|
147
|
+
args: [{
|
|
148
|
+
selector: 'st-card-header',
|
|
149
|
+
host: {
|
|
150
|
+
class: 'block',
|
|
151
|
+
},
|
|
152
|
+
template: `
|
|
153
|
+
<div class="flex flex-col gap-4 sm:flex-row sm:items-start">
|
|
154
|
+
<div class="flex min-w-0 flex-1 flex-col gap-1">
|
|
155
|
+
<ng-content></ng-content>
|
|
156
|
+
</div>
|
|
157
|
+
<ng-content select="st-card-header-aside"></ng-content>
|
|
158
|
+
</div>
|
|
159
|
+
`,
|
|
160
|
+
providers: [
|
|
161
|
+
{
|
|
162
|
+
provide: CARD_TYPOGRAPHY_CONTEXT,
|
|
163
|
+
useFactory: () => {
|
|
164
|
+
const prominent = inject(CARD_HAS_SECTIONS, { optional: true });
|
|
165
|
+
return {
|
|
166
|
+
area: 'card-header',
|
|
167
|
+
prominent: prominent ?? NON_PROMINENT_CARD_HEADER,
|
|
168
|
+
};
|
|
169
|
+
},
|
|
170
|
+
},
|
|
171
|
+
],
|
|
172
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
173
|
+
}]
|
|
174
|
+
}] });
|
|
175
|
+
|
|
176
|
+
const cardSectionBodyComponent = cva(['text-base-content', 'font-body', 'flex', 'flex-col', 'text-pretty'], {
|
|
177
|
+
variants: {
|
|
178
|
+
gap: {
|
|
179
|
+
tight: ['gap-1.5'],
|
|
180
|
+
normal: ['gap-3'],
|
|
181
|
+
relaxed: ['gap-4'],
|
|
182
|
+
},
|
|
183
|
+
},
|
|
184
|
+
defaultVariants: {
|
|
185
|
+
gap: 'relaxed',
|
|
186
|
+
},
|
|
187
|
+
});
|
|
188
|
+
class CardSectionBodyComponent {
|
|
189
|
+
gap = input('relaxed');
|
|
190
|
+
class = input('');
|
|
191
|
+
containerClass = computed(() => cn(cardSectionBodyComponent({ gap: this.gap() ?? 'relaxed' }), this.class()));
|
|
192
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.0", ngImport: i0, type: CardSectionBodyComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
193
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.2.0", type: CardSectionBodyComponent, isStandalone: true, selector: "st-card-section-body", inputs: { gap: { classPropertyName: "gap", publicName: "gap", isSignal: true, isRequired: false, transformFunction: null }, class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "containerClass()" } }, ngImport: i0, template: '<ng-content></ng-content>', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
194
|
+
}
|
|
195
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.0", ngImport: i0, type: CardSectionBodyComponent, decorators: [{
|
|
196
|
+
type: Component,
|
|
197
|
+
args: [{
|
|
198
|
+
selector: 'st-card-section-body',
|
|
199
|
+
host: {
|
|
200
|
+
'[class]': 'containerClass()',
|
|
201
|
+
},
|
|
202
|
+
template: '<ng-content></ng-content>',
|
|
203
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
204
|
+
}]
|
|
205
|
+
}] });
|
|
206
|
+
|
|
207
|
+
class CardSectionFooterComponent {
|
|
208
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.0", ngImport: i0, type: CardSectionFooterComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
209
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.0", type: CardSectionFooterComponent, isStandalone: true, selector: "st-card-section-footer", host: { classAttribute: "flex flex-col" }, ngImport: i0, template: '<ng-content></ng-content>', isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
210
|
+
}
|
|
211
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.0", ngImport: i0, type: CardSectionFooterComponent, decorators: [{
|
|
212
|
+
type: Component,
|
|
213
|
+
args: [{
|
|
214
|
+
selector: 'st-card-section-footer',
|
|
215
|
+
imports: [CommonModule],
|
|
216
|
+
host: {
|
|
217
|
+
class: 'flex flex-col',
|
|
218
|
+
},
|
|
219
|
+
template: '<ng-content></ng-content>',
|
|
220
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
221
|
+
}]
|
|
222
|
+
}] });
|
|
223
|
+
|
|
224
|
+
class CardSectionComponent {
|
|
225
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.0", ngImport: i0, type: CardSectionComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
226
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.0", type: CardSectionComponent, isStandalone: true, selector: "st-card-section", host: { classAttribute: "flex flex-col gap-5" }, ngImport: i0, template: '<ng-content></ng-content>', isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
227
|
+
}
|
|
228
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.0", ngImport: i0, type: CardSectionComponent, decorators: [{
|
|
229
|
+
type: Component,
|
|
230
|
+
args: [{
|
|
231
|
+
selector: 'st-card-section',
|
|
232
|
+
imports: [CommonModule],
|
|
233
|
+
host: {
|
|
234
|
+
class: 'flex flex-col gap-5',
|
|
235
|
+
},
|
|
236
|
+
template: '<ng-content></ng-content>',
|
|
237
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
238
|
+
}]
|
|
239
|
+
}] });
|
|
240
|
+
|
|
241
|
+
class CardSectionGroupComponent {
|
|
242
|
+
host = inject(ElementRef);
|
|
243
|
+
destroyRef = inject(DestroyRef);
|
|
244
|
+
envInjector = inject(EnvironmentInjector);
|
|
245
|
+
dividerClass = 'st-card-section-group-divider';
|
|
246
|
+
dividerRefs = [];
|
|
247
|
+
divided = input(false);
|
|
248
|
+
sections = contentChildren(CardSectionComponent);
|
|
249
|
+
constructor() {
|
|
250
|
+
afterRenderEffect(() => {
|
|
251
|
+
this.syncDividers();
|
|
252
|
+
});
|
|
253
|
+
this.destroyRef.onDestroy(() => {
|
|
254
|
+
this.removeDividers();
|
|
255
|
+
});
|
|
256
|
+
}
|
|
257
|
+
syncDividers() {
|
|
258
|
+
this.removeDividers();
|
|
259
|
+
if (!this.divided())
|
|
260
|
+
return;
|
|
261
|
+
const host = this.host.nativeElement;
|
|
262
|
+
const sections = Array.from(host.children).filter((element) => element instanceof HTMLElement && element.tagName === 'ST-CARD-SECTION');
|
|
263
|
+
if (sections.length < 2)
|
|
264
|
+
return;
|
|
265
|
+
for (let index = 0; index < sections.length - 1; index += 1) {
|
|
266
|
+
const dividerRef = createComponent(DividerComponent, {
|
|
267
|
+
environmentInjector: this.envInjector,
|
|
268
|
+
elementInjector: undefined,
|
|
269
|
+
});
|
|
270
|
+
dividerRef.setInput('variant', 'neutral');
|
|
271
|
+
dividerRef.changeDetectorRef.detectChanges();
|
|
272
|
+
const dividerHost = dividerRef.location.nativeElement;
|
|
273
|
+
dividerHost.classList.add(this.dividerClass);
|
|
274
|
+
sections[index].insertAdjacentElement('afterend', dividerHost);
|
|
275
|
+
this.dividerRefs.push(dividerRef);
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
removeDividers() {
|
|
279
|
+
for (const dividerRef of this.dividerRefs) {
|
|
280
|
+
dividerRef.location.nativeElement.remove();
|
|
281
|
+
dividerRef.destroy();
|
|
282
|
+
}
|
|
283
|
+
this.dividerRefs = [];
|
|
284
|
+
}
|
|
285
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.0", ngImport: i0, type: CardSectionGroupComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
286
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "19.2.0", type: CardSectionGroupComponent, isStandalone: true, selector: "st-card-section-group", inputs: { divided: { classPropertyName: "divided", publicName: "divided", isSignal: true, isRequired: false, transformFunction: null } }, host: { classAttribute: "flex flex-col gap-6" }, queries: [{ propertyName: "sections", predicate: CardSectionComponent, isSignal: true }], ngImport: i0, template: '<ng-content></ng-content>', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
287
|
+
}
|
|
288
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.0", ngImport: i0, type: CardSectionGroupComponent, decorators: [{
|
|
289
|
+
type: Component,
|
|
290
|
+
args: [{
|
|
291
|
+
selector: 'st-card-section-group',
|
|
292
|
+
host: {
|
|
293
|
+
class: 'flex flex-col gap-6',
|
|
294
|
+
},
|
|
295
|
+
template: '<ng-content></ng-content>',
|
|
296
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
297
|
+
}]
|
|
298
|
+
}], ctorParameters: () => [] });
|
|
299
|
+
|
|
300
|
+
class CardSectionHeaderAsideComponent {
|
|
301
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.0", ngImport: i0, type: CardSectionHeaderAsideComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
302
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.0", type: CardSectionHeaderAsideComponent, isStandalone: true, selector: "st-card-section-header-aside", host: { classAttribute: "shrink-0" }, ngImport: i0, template: '<ng-content></ng-content>', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
303
|
+
}
|
|
304
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.0", ngImport: i0, type: CardSectionHeaderAsideComponent, decorators: [{
|
|
305
|
+
type: Component,
|
|
306
|
+
args: [{
|
|
307
|
+
selector: 'st-card-section-header-aside',
|
|
308
|
+
host: {
|
|
309
|
+
class: 'shrink-0',
|
|
310
|
+
},
|
|
311
|
+
template: '<ng-content></ng-content>',
|
|
312
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
313
|
+
}]
|
|
314
|
+
}] });
|
|
315
|
+
|
|
316
|
+
const SECTION_HEADER_PROMINENCE = signal(false).asReadonly();
|
|
317
|
+
class CardSectionHeaderComponent {
|
|
318
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.0", ngImport: i0, type: CardSectionHeaderComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
319
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.0", type: CardSectionHeaderComponent, isStandalone: true, selector: "st-card-section-header", host: { classAttribute: "block" }, providers: [{ provide: CARD_TYPOGRAPHY_CONTEXT, useValue: { area: 'section-header', prominent: SECTION_HEADER_PROMINENCE } }], ngImport: i0, template: `
|
|
320
|
+
<div class="flex flex-col gap-4 sm:flex-row sm:items-start">
|
|
321
|
+
<div class="flex min-w-0 flex-1 flex-col gap-1">
|
|
322
|
+
<ng-content></ng-content>
|
|
323
|
+
</div>
|
|
324
|
+
<ng-content select="st-card-section-header-aside"></ng-content>
|
|
325
|
+
</div>
|
|
326
|
+
`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
327
|
+
}
|
|
328
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.0", ngImport: i0, type: CardSectionHeaderComponent, decorators: [{
|
|
329
|
+
type: Component,
|
|
330
|
+
args: [{
|
|
331
|
+
selector: 'st-card-section-header',
|
|
332
|
+
host: {
|
|
333
|
+
class: 'block',
|
|
334
|
+
},
|
|
335
|
+
template: `
|
|
336
|
+
<div class="flex flex-col gap-4 sm:flex-row sm:items-start">
|
|
337
|
+
<div class="flex min-w-0 flex-1 flex-col gap-1">
|
|
338
|
+
<ng-content></ng-content>
|
|
339
|
+
</div>
|
|
340
|
+
<ng-content select="st-card-section-header-aside"></ng-content>
|
|
341
|
+
</div>
|
|
342
|
+
`,
|
|
343
|
+
providers: [{ provide: CARD_TYPOGRAPHY_CONTEXT, useValue: { area: 'section-header', prominent: SECTION_HEADER_PROMINENCE } }],
|
|
344
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
345
|
+
}]
|
|
346
|
+
}] });
|
|
347
|
+
|
|
51
348
|
/**
|
|
52
|
-
* A
|
|
349
|
+
* A context-aware subtitle primitive for cards.
|
|
53
350
|
*
|
|
54
351
|
* @remarks
|
|
55
|
-
*
|
|
56
|
-
*
|
|
57
|
-
*
|
|
352
|
+
* Renders as a `<p>` element with the prominent card-header preset inside `<st-card-header>` when the card contains sections.
|
|
353
|
+
* If the card has no sections, the subtitle downgrades to the same preset used by section subtitles.
|
|
354
|
+
* Preset and classes are overridable per instance.
|
|
355
|
+
* Supports arbitrary inner HTML/components.
|
|
58
356
|
*
|
|
59
|
-
*
|
|
60
|
-
*
|
|
61
|
-
* <st-card>
|
|
62
|
-
* <st-card-title>Card Header</st-card-title>
|
|
63
|
-
* <st-card-content>
|
|
64
|
-
* <p>Main card content here</p>
|
|
65
|
-
* </st-card-content>
|
|
66
|
-
* </st-card>
|
|
67
|
-
* ```
|
|
357
|
+
* Uses `display: contents` so the rendered paragraph element participates
|
|
358
|
+
* directly in the parent flex layout.
|
|
68
359
|
*
|
|
69
360
|
* @example
|
|
70
361
|
* ```html
|
|
71
|
-
* <st-card-
|
|
72
|
-
*
|
|
73
|
-
* </st-card-
|
|
362
|
+
* <st-card-header>
|
|
363
|
+
* <st-card-title>Title</st-card-title>
|
|
364
|
+
* <st-card-subtitle>Last updated today</st-card-subtitle>
|
|
365
|
+
* </st-card-header>
|
|
74
366
|
* ```
|
|
75
367
|
*/
|
|
76
|
-
class
|
|
77
|
-
|
|
78
|
-
|
|
368
|
+
class CardSubtitleComponent {
|
|
369
|
+
typographyContext = inject(CARD_TYPOGRAPHY_CONTEXT, { optional: true });
|
|
370
|
+
hostStaticClasses = inject(ElementRef).nativeElement.getAttribute('class') ?? '';
|
|
371
|
+
preset = input(undefined);
|
|
372
|
+
class = input('');
|
|
373
|
+
isCardHeader = computed(() => this.typographyContext?.area === 'card-header');
|
|
374
|
+
prominent = computed(() => this.typographyContext?.prominent() ?? false);
|
|
375
|
+
resolvedPreset = computed(() => {
|
|
376
|
+
const override = this.preset();
|
|
377
|
+
if (override)
|
|
378
|
+
return override;
|
|
379
|
+
if (!this.isCardHeader())
|
|
380
|
+
return '8';
|
|
381
|
+
return this.prominent() ? '7' : '8';
|
|
382
|
+
});
|
|
383
|
+
resolvedClass = computed(() => {
|
|
384
|
+
const toneClass = this.isCardHeader() && this.prominent() ? 'block text-base-content/70' : 'block text-base-content/60';
|
|
385
|
+
return [toneClass, this.class(), this.hostStaticClasses].filter(Boolean).join(' ');
|
|
386
|
+
});
|
|
387
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.0", ngImport: i0, type: CardSubtitleComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
388
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.2.0", type: CardSubtitleComponent, isStandalone: true, selector: "st-card-subtitle", inputs: { preset: { classPropertyName: "preset", publicName: "preset", isSignal: true, isRequired: false, transformFunction: null }, class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { styleAttribute: "display: contents" }, ngImport: i0, template: `
|
|
389
|
+
<p [stText]="resolvedPreset()" [stTextClass]="resolvedClass()" stTextColor="base">
|
|
390
|
+
<ng-content></ng-content>
|
|
391
|
+
</p>
|
|
392
|
+
`, isInline: true, dependencies: [{ kind: "directive", type: TextDirective, selector: "[stText]", inputs: ["stText", "stTextWeight", "stTextColor", "stTextOverflow", "stTextLineClamp", "stTextClass"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
79
393
|
}
|
|
80
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.0", ngImport: i0, type:
|
|
394
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.0", ngImport: i0, type: CardSubtitleComponent, decorators: [{
|
|
81
395
|
type: Component,
|
|
82
|
-
args: [{
|
|
396
|
+
args: [{
|
|
397
|
+
selector: 'st-card-subtitle',
|
|
398
|
+
imports: [TextDirective],
|
|
399
|
+
template: `
|
|
400
|
+
<p [stText]="resolvedPreset()" [stTextClass]="resolvedClass()" stTextColor="base">
|
|
401
|
+
<ng-content></ng-content>
|
|
402
|
+
</p>
|
|
403
|
+
`,
|
|
404
|
+
host: { style: 'display: contents' },
|
|
405
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
406
|
+
}]
|
|
83
407
|
}] });
|
|
84
408
|
|
|
85
409
|
/**
|
|
86
|
-
* A title
|
|
410
|
+
* A context-aware title primitive for cards.
|
|
87
411
|
*
|
|
88
412
|
* @remarks
|
|
89
|
-
*
|
|
90
|
-
*
|
|
413
|
+
* Renders as `<h2>` with prominent preset 2 inside `<st-card-header>` when the card contains sections.
|
|
414
|
+
* If the card has no sections, the header title downgrades to preset 4 so the header does not overstate hierarchy.
|
|
415
|
+
* Inside `<st-card-section-header>` (or standalone), it renders as `<h3>` with preset 4.
|
|
416
|
+
* Semantic tag (`as`), preset, and classes are overridable per instance.
|
|
417
|
+
* Supports arbitrary inner HTML/components (badges, links, icons).
|
|
91
418
|
*
|
|
92
|
-
*
|
|
93
|
-
*
|
|
94
|
-
* <st-card>
|
|
95
|
-
* <st-card-title>Card Header</st-card-title>
|
|
96
|
-
* <p>Card content</p>
|
|
97
|
-
* </st-card>
|
|
98
|
-
* ```
|
|
419
|
+
* Uses `display: contents` so the rendered heading element participates
|
|
420
|
+
* directly in the parent flex layout.
|
|
99
421
|
*
|
|
100
422
|
* @example
|
|
101
423
|
* ```html
|
|
102
|
-
* <st-card-
|
|
103
|
-
*
|
|
104
|
-
* </st-card-
|
|
424
|
+
* <st-card-header>
|
|
425
|
+
* <st-card-title>Customer overview</st-card-title>
|
|
426
|
+
* </st-card-header>
|
|
105
427
|
* ```
|
|
106
428
|
*/
|
|
107
429
|
class CardTitleComponent {
|
|
430
|
+
typographyContext = inject(CARD_TYPOGRAPHY_CONTEXT, { optional: true });
|
|
431
|
+
hostStaticClasses = inject(ElementRef).nativeElement.getAttribute('class') ?? '';
|
|
432
|
+
// eslint-disable-next-line @angular-eslint/no-input-rename
|
|
433
|
+
tagOverride = input(undefined, { alias: 'as' });
|
|
434
|
+
preset = input(undefined);
|
|
435
|
+
class = input('');
|
|
436
|
+
isCardHeader = computed(() => this.typographyContext?.area === 'card-header');
|
|
437
|
+
prominent = computed(() => this.typographyContext?.prominent() ?? false);
|
|
438
|
+
tag = computed(() => this.tagOverride() ?? (this.isCardHeader() ? 'h2' : 'h3'));
|
|
439
|
+
resolvedPreset = computed(() => {
|
|
440
|
+
const override = this.preset();
|
|
441
|
+
if (override)
|
|
442
|
+
return override;
|
|
443
|
+
if (!this.isCardHeader())
|
|
444
|
+
return '4';
|
|
445
|
+
return this.prominent() ? '2' : '4';
|
|
446
|
+
});
|
|
447
|
+
resolvedClass = computed(() => {
|
|
448
|
+
const classes = [this.hostStaticClasses, this.class(), 'block'].filter(Boolean).join(' ');
|
|
449
|
+
return classes;
|
|
450
|
+
});
|
|
108
451
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.0", ngImport: i0, type: CardTitleComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
109
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "
|
|
452
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.0", type: CardTitleComponent, isStandalone: true, selector: "st-card-title", inputs: { tagOverride: { classPropertyName: "tagOverride", publicName: "as", isSignal: true, isRequired: false, transformFunction: null }, preset: { classPropertyName: "preset", publicName: "preset", isSignal: true, isRequired: false, transformFunction: null }, class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { styleAttribute: "display: contents" }, ngImport: i0, template: `
|
|
453
|
+
<ng-template #contentTpl><ng-content /></ng-template>
|
|
454
|
+
@switch (tag()) {
|
|
455
|
+
@case ('h2') {
|
|
456
|
+
<h2 [stText]="resolvedPreset()" [stTextClass]="resolvedClass()" stTextColor="base">
|
|
457
|
+
<ng-container [ngTemplateOutlet]="contentTpl" />
|
|
458
|
+
</h2>
|
|
459
|
+
}
|
|
460
|
+
@default {
|
|
461
|
+
<h3 [stText]="resolvedPreset()" [stTextClass]="resolvedClass()" stTextColor="base">
|
|
462
|
+
<ng-container [ngTemplateOutlet]="contentTpl" />
|
|
463
|
+
</h3>
|
|
464
|
+
}
|
|
465
|
+
}
|
|
466
|
+
`, isInline: true, dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: TextDirective, selector: "[stText]", inputs: ["stText", "stTextWeight", "stTextColor", "stTextOverflow", "stTextLineClamp", "stTextClass"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
110
467
|
}
|
|
111
468
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.0", ngImport: i0, type: CardTitleComponent, decorators: [{
|
|
112
469
|
type: Component,
|
|
113
|
-
args: [{
|
|
470
|
+
args: [{
|
|
471
|
+
selector: 'st-card-title',
|
|
472
|
+
imports: [NgTemplateOutlet, TextDirective],
|
|
473
|
+
template: `
|
|
474
|
+
<ng-template #contentTpl><ng-content /></ng-template>
|
|
475
|
+
@switch (tag()) {
|
|
476
|
+
@case ('h2') {
|
|
477
|
+
<h2 [stText]="resolvedPreset()" [stTextClass]="resolvedClass()" stTextColor="base">
|
|
478
|
+
<ng-container [ngTemplateOutlet]="contentTpl" />
|
|
479
|
+
</h2>
|
|
480
|
+
}
|
|
481
|
+
@default {
|
|
482
|
+
<h3 [stText]="resolvedPreset()" [stTextClass]="resolvedClass()" stTextColor="base">
|
|
483
|
+
<ng-container [ngTemplateOutlet]="contentTpl" />
|
|
484
|
+
</h3>
|
|
485
|
+
}
|
|
486
|
+
}
|
|
487
|
+
`,
|
|
488
|
+
host: { style: 'display: contents' },
|
|
489
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
490
|
+
}]
|
|
114
491
|
}] });
|
|
115
492
|
|
|
116
493
|
/**
|
|
@@ -152,6 +529,9 @@ const cardComponent = cva(['card'], {
|
|
|
152
529
|
* ```
|
|
153
530
|
*/
|
|
154
531
|
class CardComponent {
|
|
532
|
+
sections = contentChildren(CardSectionComponent, { descendants: true });
|
|
533
|
+
hasSections = computed(() => this.sections().length > 0);
|
|
534
|
+
bodyClass = computed(() => (this.hasSections() ? 'card-body gap-6' : 'card-body gap-5'));
|
|
155
535
|
/**
|
|
156
536
|
* Card container size variant
|
|
157
537
|
* @defaultValue 'md'
|
|
@@ -213,25 +593,26 @@ class CardComponent {
|
|
|
213
593
|
componentClass = computed(() => cn(cardComponent({
|
|
214
594
|
size: this.size(),
|
|
215
595
|
}), {
|
|
596
|
+
'w-full': this.block(),
|
|
216
597
|
'card-side': this.imageOrientation() === 'horizontal' && this.image(),
|
|
217
598
|
'image-full': this.imageAsBackground(),
|
|
218
599
|
'shadow-main': this.shadow(),
|
|
219
|
-
'
|
|
600
|
+
'border-neutral border': this.border(),
|
|
220
601
|
'card-dash': this.dash(),
|
|
221
602
|
'bg-base-200': !this.glass(),
|
|
222
603
|
glass: this.glass(),
|
|
223
604
|
}));
|
|
224
605
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.0", ngImport: i0, type: CardComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
225
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.0", type: CardComponent, isStandalone: true, selector: "st-card", inputs: { size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, border: { classPropertyName: "border", publicName: "border", isSignal: true, isRequired: false, transformFunction: null }, image: { classPropertyName: "image", publicName: "image", isSignal: true, isRequired: false, transformFunction: null }, imageAlt: { classPropertyName: "imageAlt", publicName: "imageAlt", isSignal: true, isRequired: false, transformFunction: null }, imageOrientation: { classPropertyName: "imageOrientation", publicName: "imageOrientation", isSignal: true, isRequired: false, transformFunction: null }, imageAlignment: { classPropertyName: "imageAlignment", publicName: "imageAlignment", isSignal: true, isRequired: false, transformFunction: null }, imageAsBackground: { classPropertyName: "imageAsBackground", publicName: "imageAsBackground", isSignal: true, isRequired: false, transformFunction: null }, shadow: { classPropertyName: "shadow", publicName: "shadow", isSignal: true, isRequired: false, transformFunction: null }, glass: { classPropertyName: "glass", publicName: "glass", isSignal: true, isRequired: false, transformFunction: null }, dash: { classPropertyName: "dash", publicName: "dash", isSignal: true, isRequired: false, transformFunction: null }, block: { classPropertyName: "block", publicName: "block", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "@let componentClassVar = this.componentClass();\n@let imageVar = this.image();\n@let imageAltVar = this.imageAlt();\n@let imageAlignmentVar = this.imageAlignment();\n<section [class]=\"componentClassVar\">\n\t@if (imageVar && imageAlignmentVar === 'start') {\n\t\t<figure>\n\t\t\t<img [src]=\"imageVar\" [alt]=\"imageAltVar\" />\n\t\t</figure>\n\t}\n\t<div class
|
|
606
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.0", type: CardComponent, isStandalone: true, selector: "st-card", inputs: { size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, border: { classPropertyName: "border", publicName: "border", isSignal: true, isRequired: false, transformFunction: null }, image: { classPropertyName: "image", publicName: "image", isSignal: true, isRequired: false, transformFunction: null }, imageAlt: { classPropertyName: "imageAlt", publicName: "imageAlt", isSignal: true, isRequired: false, transformFunction: null }, imageOrientation: { classPropertyName: "imageOrientation", publicName: "imageOrientation", isSignal: true, isRequired: false, transformFunction: null }, imageAlignment: { classPropertyName: "imageAlignment", publicName: "imageAlignment", isSignal: true, isRequired: false, transformFunction: null }, imageAsBackground: { classPropertyName: "imageAsBackground", publicName: "imageAsBackground", isSignal: true, isRequired: false, transformFunction: null }, shadow: { classPropertyName: "shadow", publicName: "shadow", isSignal: true, isRequired: false, transformFunction: null }, glass: { classPropertyName: "glass", publicName: "glass", isSignal: true, isRequired: false, transformFunction: null }, dash: { classPropertyName: "dash", publicName: "dash", isSignal: true, isRequired: false, transformFunction: null }, block: { classPropertyName: "block", publicName: "block", isSignal: true, isRequired: false, transformFunction: null } }, providers: [{ provide: CARD_HAS_SECTIONS, useFactory: (card) => card.hasSections, deps: [CardComponent] }], queries: [{ propertyName: "sections", predicate: CardSectionComponent, descendants: true, isSignal: true }], ngImport: i0, template: "@let componentClassVar = this.componentClass();\n@let imageVar = this.image();\n@let imageAltVar = this.imageAlt();\n@let imageAlignmentVar = this.imageAlignment();\n<section [class]=\"componentClassVar\">\n\t@if (imageVar && imageAlignmentVar === 'start') {\n\t\t<figure>\n\t\t\t<img [src]=\"imageVar\" [alt]=\"imageAltVar\" />\n\t\t</figure>\n\t}\n\t<div [class]=\"bodyClass()\">\n\t\t<ng-content></ng-content>\n\t</div>\n\t@if (imageVar && imageAlignmentVar === 'end') {\n\t\t<figure>\n\t\t\t<img [src]=\"imageVar\" [alt]=\"imageAltVar\" />\n\t\t</figure>\n\t}\n</section>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
226
607
|
}
|
|
227
608
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.0", ngImport: i0, type: CardComponent, decorators: [{
|
|
228
609
|
type: Component,
|
|
229
|
-
args: [{ selector: 'st-card', imports: [CommonModule], template: "@let componentClassVar = this.componentClass();\n@let imageVar = this.image();\n@let imageAltVar = this.imageAlt();\n@let imageAlignmentVar = this.imageAlignment();\n<section [class]=\"componentClassVar\">\n\t@if (imageVar && imageAlignmentVar === 'start') {\n\t\t<figure>\n\t\t\t<img [src]=\"imageVar\" [alt]=\"imageAltVar\" />\n\t\t</figure>\n\t}\n\t<div class
|
|
610
|
+
args: [{ selector: 'st-card', imports: [CommonModule], providers: [{ provide: CARD_HAS_SECTIONS, useFactory: (card) => card.hasSections, deps: [CardComponent] }], changeDetection: ChangeDetectionStrategy.OnPush, template: "@let componentClassVar = this.componentClass();\n@let imageVar = this.image();\n@let imageAltVar = this.imageAlt();\n@let imageAlignmentVar = this.imageAlignment();\n<section [class]=\"componentClassVar\">\n\t@if (imageVar && imageAlignmentVar === 'start') {\n\t\t<figure>\n\t\t\t<img [src]=\"imageVar\" [alt]=\"imageAltVar\" />\n\t\t</figure>\n\t}\n\t<div [class]=\"bodyClass()\">\n\t\t<ng-content></ng-content>\n\t</div>\n\t@if (imageVar && imageAlignmentVar === 'end') {\n\t\t<figure>\n\t\t\t<img [src]=\"imageVar\" [alt]=\"imageAltVar\" />\n\t\t</figure>\n\t}\n</section>\n" }]
|
|
230
611
|
}] });
|
|
231
612
|
|
|
232
613
|
/**
|
|
233
614
|
* Generated bundle index. Do not edit.
|
|
234
615
|
*/
|
|
235
616
|
|
|
236
|
-
export { CardActionsComponent, CardComponent,
|
|
617
|
+
export { CARD_HAS_SECTIONS, CARD_TYPOGRAPHY_CONTEXT, CardActionsComponent, CardBodyComponent, CardComponent, CardFooterComponent, CardHeaderAsideComponent, CardHeaderComponent, CardSectionBodyComponent, CardSectionComponent, CardSectionFooterComponent, CardSectionGroupComponent, CardSectionHeaderAsideComponent, CardSectionHeaderComponent, CardSubtitleComponent, CardTitleComponent, cardComponent };
|
|
237
618
|
//# sourceMappingURL=sixbell-telco-sdk-components-card.mjs.map
|