@agorapulse/ui-components 22.10.1-beta.1 → 22.10.3-beta.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/agorapulse-ui-components-22.10.3-beta.1.tgz +0 -0
- package/fesm2022/agorapulse-ui-components-infobox.mjs +16 -38
- package/fesm2022/agorapulse-ui-components-infobox.mjs.map +1 -1
- package/package.json +1 -1
- package/types/agorapulse-ui-components-infobox.d.ts +9 -12
- package/agorapulse-ui-components-22.10.1-beta.1.tgz +0 -0
|
Binary file
|
|
@@ -2,9 +2,9 @@ import { ButtonComponent } from '@agorapulse/ui-components/button';
|
|
|
2
2
|
import { CloseButtonComponent } from '@agorapulse/ui-components/close-button';
|
|
3
3
|
import { injectResolveTexts } from '@agorapulse/ui-components/i18n';
|
|
4
4
|
import { UI_COMPONENTS_SYMBOLS } from '@agorapulse/ui-components/providers';
|
|
5
|
-
import { SymbolRegistry, apInfoFill, apErrorFill, apWarningFill,
|
|
5
|
+
import { SymbolRegistry, apInfoFill, apErrorFill, apWarningFill, apRoundedCheckFill, apFeatureLock, SymbolComponent } from '@agorapulse/ui-symbol';
|
|
6
6
|
import * as i0 from '@angular/core';
|
|
7
|
-
import { inject, ElementRef, input, computed,
|
|
7
|
+
import { inject, ElementRef, input, computed, booleanAttribute, output, ViewEncapsulation, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
8
8
|
|
|
9
9
|
const ROLES = { title: null, action: null };
|
|
10
10
|
// Increasing integer for generating unique ids for infobox components.
|
|
@@ -22,19 +22,21 @@ class InfoboxComponent {
|
|
|
22
22
|
texts = computed(() => this.resolveTexts(this.i18n(), ROLES), /* @ts-ignore */
|
|
23
23
|
...(ngDevMode ? [{ debugName: "texts" }] : /* istanbul ignore next */ []));
|
|
24
24
|
/** Id of the action button; defaults to a generated `infobox-button-N`. */
|
|
25
|
-
actionId = null
|
|
25
|
+
actionId = input(null, /* @ts-ignore */
|
|
26
|
+
...(ngDevMode ? [{ debugName: "actionId" }] : /* istanbul ignore next */ []));
|
|
26
27
|
/** `data-track` attribute of the action button. */
|
|
27
|
-
actionDataTrack = null
|
|
28
|
+
actionDataTrack = input(null, /* @ts-ignore */
|
|
29
|
+
...(ngDevMode ? [{ debugName: "actionDataTrack" }] : /* istanbul ignore next */ []));
|
|
28
30
|
/** Symbol shown on the left of the action button. */
|
|
29
31
|
actionSymbolId = input(/* @ts-ignore */
|
|
30
32
|
...(ngDevMode ? [undefined, { debugName: "actionSymbolId" }] : /* istanbul ignore next */ []));
|
|
31
|
-
closable = false;
|
|
32
|
-
type = 'info'
|
|
33
|
+
closable = input(false, { ...(ngDevMode ? { debugName: "closable" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
34
|
+
type = input('info', /* @ts-ignore */
|
|
35
|
+
...(ngDevMode ? [{ debugName: "type" }] : /* istanbul ignore next */ []));
|
|
33
36
|
/** Emits when the action button, labelled by `i18n.action`, is clicked. */
|
|
34
|
-
actionClick =
|
|
35
|
-
closed =
|
|
36
|
-
|
|
37
|
-
defaultButtonId = '';
|
|
37
|
+
actionClick = output();
|
|
38
|
+
closed = output();
|
|
39
|
+
defaultButtonId = `infobox-button-${++nextUniqueId}`;
|
|
38
40
|
symbolIds = {
|
|
39
41
|
info: 'info_fill',
|
|
40
42
|
warning: 'warning_fill',
|
|
@@ -43,17 +45,8 @@ class InfoboxComponent {
|
|
|
43
45
|
'feature-lock': 'feature-lock',
|
|
44
46
|
};
|
|
45
47
|
constructor() {
|
|
46
|
-
this.symbolRegistry.registerSymbols([
|
|
47
|
-
apInfoFill,
|
|
48
|
-
apErrorFill,
|
|
49
|
-
apWarningFill,
|
|
50
|
-
apTrash,
|
|
51
|
-
apRoundedCheckFill,
|
|
52
|
-
apClose,
|
|
53
|
-
apFeatureLock,
|
|
54
|
-
]);
|
|
48
|
+
this.symbolRegistry.registerSymbols([apInfoFill, apErrorFill, apWarningFill, apRoundedCheckFill, apFeatureLock]);
|
|
55
49
|
this.symbolRegistry.withSymbols(...(inject(UI_COMPONENTS_SYMBOLS, { optional: true })?.flat() ?? []));
|
|
56
|
-
this.defaultButtonId = `infobox-button-${++nextUniqueId}`;
|
|
57
50
|
}
|
|
58
51
|
onActionClick() {
|
|
59
52
|
this.actionClick.emit();
|
|
@@ -63,27 +56,12 @@ class InfoboxComponent {
|
|
|
63
56
|
this.closed.emit();
|
|
64
57
|
}
|
|
65
58
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: InfoboxComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
66
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.5", type: InfoboxComponent, isStandalone: true, selector: "ap-infobox", inputs: { i18n: { classPropertyName: "i18n", publicName: "i18n", isSignal: true, isRequired: false, transformFunction: null }, title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, actionId: { classPropertyName: "actionId", publicName: "actionId", isSignal:
|
|
59
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.5", type: InfoboxComponent, isStandalone: true, selector: "ap-infobox", inputs: { i18n: { classPropertyName: "i18n", publicName: "i18n", isSignal: true, isRequired: false, transformFunction: null }, title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, actionId: { classPropertyName: "actionId", publicName: "actionId", isSignal: true, isRequired: false, transformFunction: null }, actionDataTrack: { classPropertyName: "actionDataTrack", publicName: "actionDataTrack", isSignal: true, isRequired: false, transformFunction: null }, actionSymbolId: { classPropertyName: "actionSymbolId", publicName: "actionSymbolId", isSignal: true, isRequired: false, transformFunction: null }, closable: { classPropertyName: "closable", publicName: "closable", isSignal: true, isRequired: false, transformFunction: null }, type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { actionClick: "actionClick", closed: "closed" }, ngImport: i0, template: "<div\n class=\"main\"\n [class.info]=\"type() === 'info'\"\n [class.warning]=\"type() === 'warning'\"\n [class.error]=\"type() === 'error'\"\n [class.success]=\"type() === 'success'\"\n [class.feature-lock]=\"type() === 'feature-lock'\"\n [class.has-title]=\"!!texts().title\">\n <div class=\"status-banner\"></div>\n <div class=\"wrapper\">\n <div class=\"symbol-content\">\n <div class=\"symbol-wrapper\">\n <ap-symbol\n class=\"status\"\n size=\"sm\"\n [symbolId]=\"symbolIds[type()]\" />\n </div>\n <div class=\"content\">\n <div class=\"texts\">\n @if (texts().title; as title) {\n <span class=\"title\">\n {{ title }}\n </span>\n }\n <span class=\"text\">\n <ng-content />\n </span>\n </div>\n @if (texts().action; as action) {\n <ap-button\n name=\"infobox-button\"\n symbolPosition=\"left\"\n [symbolId]=\"actionSymbolId()\"\n [id]=\"actionId() ?? defaultButtonId\"\n [attr.data-track]=\"actionDataTrack()\"\n [config]=\"{\n style: 'stroked',\n color: 'grey',\n }\"\n (click)=\"onActionClick()\">\n {{ action }}\n </ap-button>\n }\n </div>\n </div>\n @if (closable()) {\n <ap-close-button (closed)=\"onCloseInfobox()\" />\n }\n </div>\n</div>\n", styles: ["ap-infobox{--comp-icon-size: 20px;container:infobox/inline-size;display:block;width:100%;max-width:100%}ap-infobox .main{display:flex;font-size:var(--ref-font-size-sm);line-height:var(--ref-font-line-height-sm);align-items:center;color:var(--ref-color-grey-100);padding:var(--comp-infobox-padding-top) var(--comp-infobox-padding-right) var(--comp-infobox-padding-bottom) var(--comp-infobox-padding-left);border-radius:var(--comp-infobox-border-radius);overflow:hidden;font-family:var(--comp-infobox-text-title-font-family);box-sizing:border-box;position:relative;gap:var(--comp-infobox-button-margin-left)}ap-infobox .main .status-banner{position:absolute;left:0;top:0;width:4px;height:100%}ap-infobox .main ap-symbol{align-self:center}ap-infobox .main .symbol-wrapper{margin-top:1px}ap-infobox .main.has-title .symbol-wrapper{margin-top:var(--ref-spacing-xxxs)}ap-infobox .main .wrapper{display:flex;justify-content:space-between;width:100%;align-items:flex-start;gap:var(--ref-spacing-xxs)}ap-infobox .main .wrapper .symbol-content{display:flex;gap:var(--ref-spacing-xs);align-items:flex-start;flex:1}ap-infobox .main .wrapper .symbol-content .content{display:flex;flex-direction:column;align-items:flex-start;flex:1;justify-content:space-between;gap:var(--ref-spacing-xxs)}ap-infobox .main .wrapper .symbol-content .content ap-button button{width:unset}ap-infobox .main .wrapper .symbol-content .content .texts{display:flex;flex-direction:column;overflow-wrap:anywhere}ap-infobox .main .wrapper .symbol-content .content .texts .title{font-weight:var(--comp-infobox-text-title-weight);font-family:var(--comp-infobox-text-title-font-family);font-size:var(--comp-infobox-text-title-size);line-height:var(--comp-infobox-text-title-line-height)}ap-infobox .main.info{background-color:var(--comp-infobox-info-background-color)}ap-infobox .main.info ap-symbol.status{align-self:baseline;color:var(--comp-infobox-info-icon-color)}ap-infobox .main.info .status-banner{background-color:var(--comp-infobox-info-border-left-color)}ap-infobox .main.warning{background-color:var(--comp-infobox-warning-background-color)}ap-infobox .main.warning ap-symbol.status{color:var(--comp-infobox-warning-icon-color)}ap-infobox .main.warning .status-banner{background-color:var(--comp-infobox-warning-border-left-color)}ap-infobox .main.error{background-color:var(--comp-infobox-error-background-color)}ap-infobox .main.error ap-symbol.status{color:var(--comp-infobox-error-icon-color)}ap-infobox .main.error .status-banner{background-color:var(--comp-infobox-error-border-left-color)}ap-infobox .main.success{background-color:var(--comp-infobox-success-background-color)}ap-infobox .main.success ap-symbol.status{color:var(--comp-infobox-success-icon-color)}ap-infobox .main.success .status-banner{background-color:var(--comp-infobox-success-border-left-color)}ap-infobox .main.feature-lock{background-color:var(--comp-infobox-feature-lock-background-color)}ap-infobox .main.feature-lock ap-symbol.status{color:var(--comp-infobox-feature-lock-icon-color)}ap-infobox .main.feature-lock .status-banner{background-color:var(--comp-infobox-feature-lock-border-left-color)}@container infobox (min-width: 588px){.main .wrapper{align-items:center!important}.main .wrapper .symbol-wrapper{margin-top:0!important}.main .wrapper .symbol-content{align-items:center!important}.main .wrapper .symbol-content .content{flex-direction:row!important;align-items:center!important}}\n"], dependencies: [{ kind: "component", type: SymbolComponent, selector: "ap-symbol", inputs: ["symbolId", "color", "size"], outputs: ["sizeChange"] }, { kind: "component", type: ButtonComponent, selector: "ap-button", inputs: ["ariaLabel", "disabled", "name", "form", "config", "loading", "locked", "menuTrigger", "symbolPosition", "symbolId"], outputs: ["menuOpened", "menuClosed", "click", "focus", "blur"] }, { kind: "component", type: CloseButtonComponent, selector: "ap-close-button", inputs: ["disabled", "ariaLabel", "dataTest"], outputs: ["closed"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
67
60
|
}
|
|
68
61
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: InfoboxComponent, decorators: [{
|
|
69
62
|
type: Component,
|
|
70
|
-
args: [{ selector: 'ap-infobox', imports: [SymbolComponent, ButtonComponent, CloseButtonComponent], changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, template: "<div\n class=\"main\"\n [class.info]=\"type === 'info'\"\n [class.warning]=\"type === 'warning'\"\n [class.error]=\"type === 'error'\"\n [class.success]=\"type === 'success'\"\n [class.feature-lock]=\"type === 'feature-lock'\"\n [class.has-title]=\"!!texts().title\">\n <div class=\"status-banner\"></div>\n <div class=\"wrapper\">\n <div class=\"symbol-content\">\n <div class=\"symbol-wrapper\">\n <ap-symbol\n class=\"status\"\n size=\"sm\"\n [symbolId]=\"symbolIds[type]\" />\n </div>\n <div class=\"content\">\n <div class=\"texts\">\n @if (texts().title; as title) {\n <span class=\"title\">\n {{ title }}\n </span>\n }\n <span class=\"text\">\n <ng-content />\n </span>\n </div>\n @if (texts().action; as action) {\n <ap-button\n name=\"infobox-button\"\n symbolPosition=\"left\"\n [symbolId]=\"actionSymbolId()\"\n [id]=\"actionId ?? defaultButtonId\"\n [attr.data-track]=\"actionDataTrack\"\n [config]=\"{\n style: 'stroked',\n color: 'grey'
|
|
71
|
-
}], ctorParameters: () => [], propDecorators: { i18n: [{ type: i0.Input, args: [{ isSignal: true, alias: "i18n", required: false }] }], title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: false }] }], actionId: [{
|
|
72
|
-
type: Input
|
|
73
|
-
}], actionDataTrack: [{
|
|
74
|
-
type: Input
|
|
75
|
-
}], actionSymbolId: [{ type: i0.Input, args: [{ isSignal: true, alias: "actionSymbolId", required: false }] }], closable: [{
|
|
76
|
-
type: Input,
|
|
77
|
-
args: [{
|
|
78
|
-
transform: booleanAttribute,
|
|
79
|
-
}]
|
|
80
|
-
}], type: [{
|
|
81
|
-
type: Input
|
|
82
|
-
}], actionClick: [{
|
|
83
|
-
type: Output
|
|
84
|
-
}], closed: [{
|
|
85
|
-
type: Output
|
|
86
|
-
}] } });
|
|
63
|
+
args: [{ selector: 'ap-infobox', imports: [SymbolComponent, ButtonComponent, CloseButtonComponent], changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, template: "<div\n class=\"main\"\n [class.info]=\"type() === 'info'\"\n [class.warning]=\"type() === 'warning'\"\n [class.error]=\"type() === 'error'\"\n [class.success]=\"type() === 'success'\"\n [class.feature-lock]=\"type() === 'feature-lock'\"\n [class.has-title]=\"!!texts().title\">\n <div class=\"status-banner\"></div>\n <div class=\"wrapper\">\n <div class=\"symbol-content\">\n <div class=\"symbol-wrapper\">\n <ap-symbol\n class=\"status\"\n size=\"sm\"\n [symbolId]=\"symbolIds[type()]\" />\n </div>\n <div class=\"content\">\n <div class=\"texts\">\n @if (texts().title; as title) {\n <span class=\"title\">\n {{ title }}\n </span>\n }\n <span class=\"text\">\n <ng-content />\n </span>\n </div>\n @if (texts().action; as action) {\n <ap-button\n name=\"infobox-button\"\n symbolPosition=\"left\"\n [symbolId]=\"actionSymbolId()\"\n [id]=\"actionId() ?? defaultButtonId\"\n [attr.data-track]=\"actionDataTrack()\"\n [config]=\"{\n style: 'stroked',\n color: 'grey',\n }\"\n (click)=\"onActionClick()\">\n {{ action }}\n </ap-button>\n }\n </div>\n </div>\n @if (closable()) {\n <ap-close-button (closed)=\"onCloseInfobox()\" />\n }\n </div>\n</div>\n", styles: ["ap-infobox{--comp-icon-size: 20px;container:infobox/inline-size;display:block;width:100%;max-width:100%}ap-infobox .main{display:flex;font-size:var(--ref-font-size-sm);line-height:var(--ref-font-line-height-sm);align-items:center;color:var(--ref-color-grey-100);padding:var(--comp-infobox-padding-top) var(--comp-infobox-padding-right) var(--comp-infobox-padding-bottom) var(--comp-infobox-padding-left);border-radius:var(--comp-infobox-border-radius);overflow:hidden;font-family:var(--comp-infobox-text-title-font-family);box-sizing:border-box;position:relative;gap:var(--comp-infobox-button-margin-left)}ap-infobox .main .status-banner{position:absolute;left:0;top:0;width:4px;height:100%}ap-infobox .main ap-symbol{align-self:center}ap-infobox .main .symbol-wrapper{margin-top:1px}ap-infobox .main.has-title .symbol-wrapper{margin-top:var(--ref-spacing-xxxs)}ap-infobox .main .wrapper{display:flex;justify-content:space-between;width:100%;align-items:flex-start;gap:var(--ref-spacing-xxs)}ap-infobox .main .wrapper .symbol-content{display:flex;gap:var(--ref-spacing-xs);align-items:flex-start;flex:1}ap-infobox .main .wrapper .symbol-content .content{display:flex;flex-direction:column;align-items:flex-start;flex:1;justify-content:space-between;gap:var(--ref-spacing-xxs)}ap-infobox .main .wrapper .symbol-content .content ap-button button{width:unset}ap-infobox .main .wrapper .symbol-content .content .texts{display:flex;flex-direction:column;overflow-wrap:anywhere}ap-infobox .main .wrapper .symbol-content .content .texts .title{font-weight:var(--comp-infobox-text-title-weight);font-family:var(--comp-infobox-text-title-font-family);font-size:var(--comp-infobox-text-title-size);line-height:var(--comp-infobox-text-title-line-height)}ap-infobox .main.info{background-color:var(--comp-infobox-info-background-color)}ap-infobox .main.info ap-symbol.status{align-self:baseline;color:var(--comp-infobox-info-icon-color)}ap-infobox .main.info .status-banner{background-color:var(--comp-infobox-info-border-left-color)}ap-infobox .main.warning{background-color:var(--comp-infobox-warning-background-color)}ap-infobox .main.warning ap-symbol.status{color:var(--comp-infobox-warning-icon-color)}ap-infobox .main.warning .status-banner{background-color:var(--comp-infobox-warning-border-left-color)}ap-infobox .main.error{background-color:var(--comp-infobox-error-background-color)}ap-infobox .main.error ap-symbol.status{color:var(--comp-infobox-error-icon-color)}ap-infobox .main.error .status-banner{background-color:var(--comp-infobox-error-border-left-color)}ap-infobox .main.success{background-color:var(--comp-infobox-success-background-color)}ap-infobox .main.success ap-symbol.status{color:var(--comp-infobox-success-icon-color)}ap-infobox .main.success .status-banner{background-color:var(--comp-infobox-success-border-left-color)}ap-infobox .main.feature-lock{background-color:var(--comp-infobox-feature-lock-background-color)}ap-infobox .main.feature-lock ap-symbol.status{color:var(--comp-infobox-feature-lock-icon-color)}ap-infobox .main.feature-lock .status-banner{background-color:var(--comp-infobox-feature-lock-border-left-color)}@container infobox (min-width: 588px){.main .wrapper{align-items:center!important}.main .wrapper .symbol-wrapper{margin-top:0!important}.main .wrapper .symbol-content{align-items:center!important}.main .wrapper .symbol-content .content{flex-direction:row!important;align-items:center!important}}\n"] }]
|
|
64
|
+
}], ctorParameters: () => [], propDecorators: { i18n: [{ type: i0.Input, args: [{ isSignal: true, alias: "i18n", required: false }] }], title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: false }] }], actionId: [{ type: i0.Input, args: [{ isSignal: true, alias: "actionId", required: false }] }], actionDataTrack: [{ type: i0.Input, args: [{ isSignal: true, alias: "actionDataTrack", required: false }] }], actionSymbolId: [{ type: i0.Input, args: [{ isSignal: true, alias: "actionSymbolId", required: false }] }], closable: [{ type: i0.Input, args: [{ isSignal: true, alias: "closable", required: false }] }], type: [{ type: i0.Input, args: [{ isSignal: true, alias: "type", required: false }] }], actionClick: [{ type: i0.Output, args: ["actionClick"] }], closed: [{ type: i0.Output, args: ["closed"] }] } });
|
|
87
65
|
|
|
88
66
|
/**
|
|
89
67
|
* Generated bundle index. Do not edit.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agorapulse-ui-components-infobox.mjs","sources":["../../../libs/ui-components/infobox/src/infobox.component.ts","../../../libs/ui-components/infobox/src/infobox.component.html","../../../libs/ui-components/infobox/src/agorapulse-ui-components-infobox.ts"],"sourcesContent":["import { ButtonComponent } from '@agorapulse/ui-components/button';\nimport { CloseButtonComponent } from '@agorapulse/ui-components/close-button';\nimport { I18nOf, TextRolesOf, injectResolveTexts } from '@agorapulse/ui-components/i18n';\nimport { UI_COMPONENTS_SYMBOLS } from '@agorapulse/ui-components/providers';\nimport {\n SymbolComponent,\n SymbolRegistry,\n agorapulseSymbol,\n
|
|
1
|
+
{"version":3,"file":"agorapulse-ui-components-infobox.mjs","sources":["../../../libs/ui-components/infobox/src/infobox.component.ts","../../../libs/ui-components/infobox/src/infobox.component.html","../../../libs/ui-components/infobox/src/agorapulse-ui-components-infobox.ts"],"sourcesContent":["import { ButtonComponent } from '@agorapulse/ui-components/button';\nimport { CloseButtonComponent } from '@agorapulse/ui-components/close-button';\nimport { I18nOf, TextRolesOf, injectResolveTexts } from '@agorapulse/ui-components/i18n';\nimport { UI_COMPONENTS_SYMBOLS } from '@agorapulse/ui-components/providers';\nimport {\n SymbolComponent,\n SymbolRegistry,\n agorapulseSymbol,\n apErrorFill,\n apFeatureLock,\n apInfoFill,\n apRoundedCheckFill,\n apWarningFill,\n} from '@agorapulse/ui-symbol';\nimport {\n ChangeDetectionStrategy,\n Component,\n ElementRef,\n ViewEncapsulation,\n booleanAttribute,\n computed,\n inject,\n input,\n output,\n} from '@angular/core';\n\nexport type InfoboxType = 'info' | 'warning' | 'error' | 'success' | 'feature-lock';\n\nconst ROLES = { title: null, action: null } as const satisfies TextRolesOf<I18nOf<never, 'title' | 'action'>>;\n\n// Increasing integer for generating unique ids for infobox components.\nlet nextUniqueId = 0;\n\n@Component({\n selector: 'ap-infobox',\n templateUrl: './infobox.component.html',\n styleUrls: ['./infobox.component.scss'],\n imports: [SymbolComponent, ButtonComponent, CloseButtonComponent],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n})\nexport class InfoboxComponent {\n private readonly symbolRegistry = inject(SymbolRegistry);\n private readonly elementRef = inject(ElementRef);\n private readonly resolveTexts = injectResolveTexts();\n\n /** `title` is shown above the projected text; `action` is the label of the button, which is shown only when set. Rendered as text. */\n readonly i18n = input<I18nOf<never, 'title' | 'action'>>({});\n\n /** Not a way to pass the title: use `i18n.title`. Typed `never` so that a `title` left on `<ap-infobox>` fails to compile instead of becoming the native tooltip. */\n readonly title = input<never>();\n\n protected readonly texts = computed(() => this.resolveTexts(this.i18n(), ROLES));\n\n /** Id of the action button; defaults to a generated `infobox-button-N`. */\n readonly actionId = input<string | null>(null);\n /** `data-track` attribute of the action button. */\n readonly actionDataTrack = input<string | null>(null);\n /** Symbol shown on the left of the action button. */\n readonly actionSymbolId = input<agorapulseSymbol>();\n readonly closable = input(false, { transform: booleanAttribute });\n readonly type = input<InfoboxType>('info');\n\n /** Emits when the action button, labelled by `i18n.action`, is clicked. */\n readonly actionClick = output<void>();\n readonly closed = output<void>();\n\n protected readonly defaultButtonId = `infobox-button-${++nextUniqueId}`;\n\n readonly symbolIds: { [k: string]: agorapulseSymbol } = {\n info: 'info_fill',\n warning: 'warning_fill',\n error: 'error_fill',\n success: 'rounded-check_fill',\n 'feature-lock': 'feature-lock',\n };\n\n constructor() {\n this.symbolRegistry.registerSymbols([apInfoFill, apErrorFill, apWarningFill, apRoundedCheckFill, apFeatureLock]);\n this.symbolRegistry.withSymbols(...(inject(UI_COMPONENTS_SYMBOLS, { optional: true })?.flat() ?? []));\n }\n\n onActionClick(): void {\n this.actionClick.emit();\n }\n\n onCloseInfobox(): void {\n this.elementRef.nativeElement.remove();\n this.closed.emit();\n }\n}\n","<div\n class=\"main\"\n [class.info]=\"type() === 'info'\"\n [class.warning]=\"type() === 'warning'\"\n [class.error]=\"type() === 'error'\"\n [class.success]=\"type() === 'success'\"\n [class.feature-lock]=\"type() === 'feature-lock'\"\n [class.has-title]=\"!!texts().title\">\n <div class=\"status-banner\"></div>\n <div class=\"wrapper\">\n <div class=\"symbol-content\">\n <div class=\"symbol-wrapper\">\n <ap-symbol\n class=\"status\"\n size=\"sm\"\n [symbolId]=\"symbolIds[type()]\" />\n </div>\n <div class=\"content\">\n <div class=\"texts\">\n @if (texts().title; as title) {\n <span class=\"title\">\n {{ title }}\n </span>\n }\n <span class=\"text\">\n <ng-content />\n </span>\n </div>\n @if (texts().action; as action) {\n <ap-button\n name=\"infobox-button\"\n symbolPosition=\"left\"\n [symbolId]=\"actionSymbolId()\"\n [id]=\"actionId() ?? defaultButtonId\"\n [attr.data-track]=\"actionDataTrack()\"\n [config]=\"{\n style: 'stroked',\n color: 'grey',\n }\"\n (click)=\"onActionClick()\">\n {{ action }}\n </ap-button>\n }\n </div>\n </div>\n @if (closable()) {\n <ap-close-button (closed)=\"onCloseInfobox()\" />\n }\n </div>\n</div>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":"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"}
|
package/package.json
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import * as _angular_core from '@angular/core';
|
|
2
|
-
import { EventEmitter } from '@angular/core';
|
|
3
2
|
import { I18nOf } from '@agorapulse/ui-components/i18n';
|
|
4
3
|
import { agorapulseSymbol } from '@agorapulse/ui-symbol';
|
|
5
4
|
|
|
@@ -17,18 +16,17 @@ declare class InfoboxComponent {
|
|
|
17
16
|
readonly action: string | undefined;
|
|
18
17
|
}>;
|
|
19
18
|
/** Id of the action button; defaults to a generated `infobox-button-N`. */
|
|
20
|
-
actionId: string | null
|
|
19
|
+
readonly actionId: _angular_core.InputSignal<string | null>;
|
|
21
20
|
/** `data-track` attribute of the action button. */
|
|
22
|
-
actionDataTrack: string | null
|
|
21
|
+
readonly actionDataTrack: _angular_core.InputSignal<string | null>;
|
|
23
22
|
/** Symbol shown on the left of the action button. */
|
|
24
|
-
actionSymbolId: _angular_core.InputSignal<string | undefined>;
|
|
25
|
-
closable: boolean
|
|
26
|
-
type: InfoboxType
|
|
23
|
+
readonly actionSymbolId: _angular_core.InputSignal<string | undefined>;
|
|
24
|
+
readonly closable: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
25
|
+
readonly type: _angular_core.InputSignal<InfoboxType>;
|
|
27
26
|
/** Emits when the action button, labelled by `i18n.action`, is clicked. */
|
|
28
|
-
actionClick:
|
|
29
|
-
closed:
|
|
30
|
-
|
|
31
|
-
defaultButtonId: string;
|
|
27
|
+
readonly actionClick: _angular_core.OutputEmitterRef<void>;
|
|
28
|
+
readonly closed: _angular_core.OutputEmitterRef<void>;
|
|
29
|
+
protected readonly defaultButtonId: string;
|
|
32
30
|
readonly symbolIds: {
|
|
33
31
|
[k: string]: agorapulseSymbol;
|
|
34
32
|
};
|
|
@@ -36,8 +34,7 @@ declare class InfoboxComponent {
|
|
|
36
34
|
onActionClick(): void;
|
|
37
35
|
onCloseInfobox(): void;
|
|
38
36
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<InfoboxComponent, never>;
|
|
39
|
-
static ɵcmp: _angular_core.ɵɵComponentDeclaration<InfoboxComponent, "ap-infobox", never, { "i18n": { "alias": "i18n"; "required": false; "isSignal": true; }; "title": { "alias": "title"; "required": false; "isSignal": true; }; "actionId": { "alias": "actionId"; "required": false; }; "actionDataTrack": { "alias": "actionDataTrack"; "required": false; }; "actionSymbolId": { "alias": "actionSymbolId"; "required": false; "isSignal": true; }; "closable": { "alias": "closable"; "required": false; }; "type": { "alias": "type"; "required": false; }; }, { "actionClick": "actionClick"; "closed": "closed"; }, never, ["*"], true, never>;
|
|
40
|
-
static ngAcceptInputType_closable: unknown;
|
|
37
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<InfoboxComponent, "ap-infobox", never, { "i18n": { "alias": "i18n"; "required": false; "isSignal": true; }; "title": { "alias": "title"; "required": false; "isSignal": true; }; "actionId": { "alias": "actionId"; "required": false; "isSignal": true; }; "actionDataTrack": { "alias": "actionDataTrack"; "required": false; "isSignal": true; }; "actionSymbolId": { "alias": "actionSymbolId"; "required": false; "isSignal": true; }; "closable": { "alias": "closable"; "required": false; "isSignal": true; }; "type": { "alias": "type"; "required": false; "isSignal": true; }; }, { "actionClick": "actionClick"; "closed": "closed"; }, never, ["*"], true, never>;
|
|
41
38
|
}
|
|
42
39
|
|
|
43
40
|
export { InfoboxComponent };
|
|
Binary file
|