@agorapulse/ui-components 22.9.8-beta.1 → 22.9.10-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.
@@ -0,0 +1,182 @@
1
+ import { ConfirmModalComponent } from '@agorapulse/ui-components/confirm-modal';
2
+ import * as i0 from '@angular/core';
3
+ import { Injectable } from '@angular/core';
4
+ import { MatDialog } from '@angular/material/dialog';
5
+ import { Subject, of } from 'rxjs';
6
+ import { SnackbarsThreadService } from '@agorapulse/ui-components/snackbars-thread';
7
+
8
+ function shownText(request) {
9
+ if (typeof request === 'string') {
10
+ return { key: request };
11
+ }
12
+ if ('raw' in request) {
13
+ return { raw: request.raw };
14
+ }
15
+ return request.params === undefined ? { key: request.key } : { key: request.key, params: request.params };
16
+ }
17
+
18
+ function askedConfirmation(i18n, ids) {
19
+ return {
20
+ title: shownText(i18n.title),
21
+ message: shownText(i18n.message),
22
+ ...(i18n.confirm === undefined ? {} : { confirm: shownText(i18n.confirm) }),
23
+ ...(i18n.cancel === undefined ? {} : { cancel: shownText(i18n.cancel) }),
24
+ ...(ids.footerConfirmButtonId === undefined || ids.footerConfirmButtonId === 'confirm'
25
+ ? {}
26
+ : { footerConfirmButtonId: ids.footerConfirmButtonId }),
27
+ ...(ids.footerCancelButtonId === undefined || ids.footerCancelButtonId === 'cancel'
28
+ ? {}
29
+ : { footerCancelButtonId: ids.footerCancelButtonId }),
30
+ };
31
+ }
32
+ /**
33
+ * A {@link MatDialog} for specs that answers every `ConfirmModalComponent.open` with {@link answer} instead of rendering
34
+ * it, and records the texts of each modal in {@link asked}. Any other component goes to the real dialog. It needs no
35
+ * test runner, so it works under Jest and Vitest alike.
36
+ *
37
+ * @example
38
+ * TestBed.configureTestingModule({ providers: [provideFakeConfirmModal({ answer: false })] });
39
+ * const confirmModal = TestBed.inject(FakeConfirmModal);
40
+ * // ...act...
41
+ * expect(confirmModal.asked).toEqual([{ title: { key: 'post.delete.title' }, message: { key: 'post.delete.message' } }]);
42
+ */
43
+ class FakeConfirmModal extends MatDialog {
44
+ /** Every confirm modal opened, oldest first. */
45
+ asked = [];
46
+ /** What the next modals answer. */
47
+ answer = true;
48
+ pending = 0;
49
+ /** How many `'pending'` modals the code has not closed yet. */
50
+ get openModals() {
51
+ return this.pending;
52
+ }
53
+ open(target, config) {
54
+ if (target !== ConfirmModalComponent) {
55
+ return super.open(target, config);
56
+ }
57
+ const answer = this.answer;
58
+ const componentInstance = {};
59
+ const closed = new Subject();
60
+ let open = answer === 'pending';
61
+ if (open) {
62
+ this.pending++;
63
+ }
64
+ const ref = {
65
+ componentInstance,
66
+ componentRef: {
67
+ setInput: (name, value) => {
68
+ if (name === 'i18n') {
69
+ this.asked.push(askedConfirmation(value, componentInstance));
70
+ }
71
+ },
72
+ },
73
+ disableClose: true,
74
+ afterClosed: () => (answer === 'pending' ? closed.asObservable() : of(answer)),
75
+ close: (result) => {
76
+ if (!open) {
77
+ return;
78
+ }
79
+ open = false;
80
+ this.pending--;
81
+ closed.next(result);
82
+ closed.complete();
83
+ },
84
+ };
85
+ return ref;
86
+ }
87
+ /** Forgets every modal opened so far. */
88
+ clear() {
89
+ this.asked.length = 0;
90
+ }
91
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: FakeConfirmModal, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
92
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: FakeConfirmModal });
93
+ }
94
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: FakeConfirmModal, decorators: [{
95
+ type: Injectable
96
+ }] });
97
+ /**
98
+ * Provides {@link FakeConfirmModal} in place of {@link MatDialog}; inject the fake to set the answer and read what was asked.
99
+ *
100
+ * @example
101
+ * providers: [provideFakeConfirmModal({ answer: true })]
102
+ */
103
+ function provideFakeConfirmModal(options = {}) {
104
+ return [
105
+ {
106
+ provide: FakeConfirmModal,
107
+ useFactory: () => {
108
+ const fake = new FakeConfirmModal();
109
+ if ('answer' in options) {
110
+ fake.answer = options.answer;
111
+ }
112
+ return fake;
113
+ },
114
+ },
115
+ { provide: MatDialog, useExisting: FakeConfirmModal },
116
+ ];
117
+ }
118
+
119
+ const DEFAULT_TIMEOUT = 5000;
120
+ const TYPE_OF_INDEX = {
121
+ 0: 'info',
122
+ 1: 'success',
123
+ 3: 'error',
124
+ };
125
+ /**
126
+ * A {@link SnackbarsThreadService} for specs: it records every snackbar in {@link shown}, with its tone and its texts,
127
+ * and never starts a timer. It needs no test runner, so it works under Jest and Vitest alike.
128
+ *
129
+ * @example
130
+ * TestBed.configureTestingModule({ providers: [provideFakeSnackbars()] });
131
+ * const snackbars = TestBed.inject(FakeSnackbarsThreadService);
132
+ * // ...act...
133
+ * expect(snackbars.shown).toEqual([{ type: 'error', message: { key: 'post.failed' } }]);
134
+ */
135
+ class FakeSnackbarsThreadService extends SnackbarsThreadService {
136
+ /** Every snackbar shown, oldest first; removing one does not drop it from here. */
137
+ shown = [];
138
+ pendingType;
139
+ show(message, type, options) {
140
+ this.pendingType = type;
141
+ return super.show(message, type, options);
142
+ }
143
+ addWithId(elem, id, timeout = DEFAULT_TIMEOUT) {
144
+ const type = this.pendingType ?? TYPE_OF_INDEX[elem.snackbarType];
145
+ this.pendingType = undefined;
146
+ this.shown.push({
147
+ type,
148
+ message: shownText(elem.i18n.message),
149
+ ...(elem.i18n.action === undefined ? {} : { action: shownText(elem.i18n.action) }),
150
+ ...(elem.navigateInternalUrl === undefined ? {} : { navigateInternalUrl: elem.navigateInternalUrl }),
151
+ ...(elem.openUrlInNewTab === undefined ? {} : { openUrlInNewTab: elem.openUrlInNewTab }),
152
+ ...(elem.callback === undefined ? {} : { callback: elem.callback }),
153
+ ...(timeout === DEFAULT_TIMEOUT ? {} : { timeout }),
154
+ });
155
+ super.addWithId(elem, id, 0);
156
+ }
157
+ /** Forgets every snackbar shown so far, e.g. the ones a spec's setup raised. */
158
+ clear() {
159
+ this.shown.length = 0;
160
+ }
161
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: FakeSnackbarsThreadService, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
162
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: FakeSnackbarsThreadService });
163
+ }
164
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: FakeSnackbarsThreadService, decorators: [{
165
+ type: Injectable
166
+ }] });
167
+ /**
168
+ * Provides {@link FakeSnackbarsThreadService} in place of {@link SnackbarsThreadService}; inject the fake to read what was shown.
169
+ *
170
+ * @example
171
+ * providers: [provideFakeSnackbars()]
172
+ */
173
+ function provideFakeSnackbars() {
174
+ return [FakeSnackbarsThreadService, { provide: SnackbarsThreadService, useExisting: FakeSnackbarsThreadService }];
175
+ }
176
+
177
+ /**
178
+ * Generated bundle index. Do not edit.
179
+ */
180
+
181
+ export { FakeConfirmModal, FakeSnackbarsThreadService, provideFakeConfirmModal, provideFakeSnackbars };
182
+ //# sourceMappingURL=agorapulse-ui-components-testing.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agorapulse-ui-components-testing.mjs","sources":["../../../libs/ui-components/testing/src/shown-text.ts","../../../libs/ui-components/testing/src/fake-confirm-modal.ts","../../../libs/ui-components/testing/src/fake-snackbars-thread.service.ts","../../../libs/ui-components/testing/src/agorapulse-ui-components-testing.ts"],"sourcesContent":["import { TranslationRequest } from '@agorapulse/ui-components/i18n';\n\n/** A text as a spec compares it: a key with its optional params, or raw text. A bare key string becomes `{ key }`. */\nexport type ShownText = { key: string; params?: Record<string, unknown> } | { raw: string };\n\nexport function shownText(request: TranslationRequest): ShownText {\n if (typeof request === 'string') {\n return { key: request };\n }\n if ('raw' in request) {\n return { raw: request.raw };\n }\n return request.params === undefined ? { key: request.key } : { key: request.key, params: request.params };\n}\n","import { ConfirmModalComponent, ConfirmModalTexts } from '@agorapulse/ui-components/confirm-modal';\nimport { ComponentType } from '@angular/cdk/portal';\nimport { Injectable, Provider, TemplateRef } from '@angular/core';\nimport { MatDialog, MatDialogConfig, MatDialogRef } from '@angular/material/dialog';\nimport { of, Subject } from 'rxjs';\nimport { ShownText, shownText } from './shown-text';\n\n/** One confirm modal the code under test opened. */\nexport interface AskedConfirmation {\n title: ShownText;\n message: ShownText;\n confirm?: ShownText;\n cancel?: ShownText;\n /** Present only when it is not the default `'confirm'`. */\n footerConfirmButtonId?: string;\n /** Present only when it is not the default `'cancel'`. */\n footerCancelButtonId?: string;\n}\n\n/** What a modal answers: `true` confirms, `false` cancels, `undefined` closes without a choice, `'pending'` stays open until the code closes it. */\nexport type ConfirmModalAnswer = boolean | undefined | 'pending';\n\ninterface FooterIds {\n footerConfirmButtonId?: string;\n footerCancelButtonId?: string;\n}\n\nfunction askedConfirmation(i18n: ConfirmModalTexts['i18n'], ids: FooterIds): AskedConfirmation {\n return {\n title: shownText(i18n.title),\n message: shownText(i18n.message),\n ...(i18n.confirm === undefined ? {} : { confirm: shownText(i18n.confirm) }),\n ...(i18n.cancel === undefined ? {} : { cancel: shownText(i18n.cancel) }),\n ...(ids.footerConfirmButtonId === undefined || ids.footerConfirmButtonId === 'confirm'\n ? {}\n : { footerConfirmButtonId: ids.footerConfirmButtonId }),\n ...(ids.footerCancelButtonId === undefined || ids.footerCancelButtonId === 'cancel'\n ? {}\n : { footerCancelButtonId: ids.footerCancelButtonId }),\n };\n}\n\n/**\n * A {@link MatDialog} for specs that answers every `ConfirmModalComponent.open` with {@link answer} instead of rendering\n * it, and records the texts of each modal in {@link asked}. Any other component goes to the real dialog. It needs no\n * test runner, so it works under Jest and Vitest alike.\n *\n * @example\n * TestBed.configureTestingModule({ providers: [provideFakeConfirmModal({ answer: false })] });\n * const confirmModal = TestBed.inject(FakeConfirmModal);\n * // ...act...\n * expect(confirmModal.asked).toEqual([{ title: { key: 'post.delete.title' }, message: { key: 'post.delete.message' } }]);\n */\n@Injectable()\nexport class FakeConfirmModal extends MatDialog {\n /** Every confirm modal opened, oldest first. */\n readonly asked: AskedConfirmation[] = [];\n\n /** What the next modals answer. */\n answer: ConfirmModalAnswer = true;\n\n private pending = 0;\n\n /** How many `'pending'` modals the code has not closed yet. */\n get openModals(): number {\n return this.pending;\n }\n\n override open<T, D = unknown, R = unknown>(component: ComponentType<T>, config?: MatDialogConfig<D>): MatDialogRef<T, R>;\n override open<T, D = unknown, R = unknown>(template: TemplateRef<T>, config?: MatDialogConfig<D>): MatDialogRef<T, R>;\n override open<T, D = unknown, R = unknown>(target: ComponentType<T> | TemplateRef<T>, config?: MatDialogConfig<D>): MatDialogRef<T, R> {\n if (target !== (ConfirmModalComponent as ComponentType<unknown>)) {\n return super.open(target, config);\n }\n const answer = this.answer;\n const componentInstance: FooterIds = {};\n const closed = new Subject<unknown>();\n let open = answer === 'pending';\n if (open) {\n this.pending++;\n }\n const ref = {\n componentInstance,\n componentRef: {\n setInput: (name: string, value: unknown): void => {\n if (name === 'i18n') {\n this.asked.push(askedConfirmation(value as ConfirmModalTexts['i18n'], componentInstance));\n }\n },\n },\n disableClose: true,\n afterClosed: () => (answer === 'pending' ? closed.asObservable() : of(answer)),\n close: (result?: unknown): void => {\n if (!open) {\n return;\n }\n open = false;\n this.pending--;\n closed.next(result);\n closed.complete();\n },\n };\n return ref as unknown as MatDialogRef<T, R>;\n }\n\n /** Forgets every modal opened so far. */\n clear(): void {\n this.asked.length = 0;\n }\n}\n\n/**\n * Provides {@link FakeConfirmModal} in place of {@link MatDialog}; inject the fake to set the answer and read what was asked.\n *\n * @example\n * providers: [provideFakeConfirmModal({ answer: true })]\n */\nexport function provideFakeConfirmModal(options: { answer?: ConfirmModalAnswer } = {}): Provider[] {\n return [\n {\n provide: FakeConfirmModal,\n useFactory: () => {\n const fake = new FakeConfirmModal();\n if ('answer' in options) {\n fake.answer = options.answer;\n }\n return fake;\n },\n },\n { provide: MatDialog, useExisting: FakeConfirmModal },\n ];\n}\n","import { TranslationRequest } from '@agorapulse/ui-components/i18n';\nimport {\n externalSnackbarTypeAllowed,\n SnackbarOptions,\n SnackbarsThreadBase,\n SnackbarsThreadService,\n} from '@agorapulse/ui-components/snackbars-thread';\nimport { Injectable, Provider } from '@angular/core';\nimport { ShownText, shownText } from './shown-text';\n\n/** One snackbar the code under test showed. */\nexport interface ShownSnackbar {\n type: externalSnackbarTypeAllowed;\n message: ShownText;\n action?: ShownText;\n navigateInternalUrl?: string;\n openUrlInNewTab?: boolean;\n callback?: () => void;\n /** Present only when it differs from the service's default of 5000 ms; 0 keeps the snackbar open. */\n timeout?: number;\n}\n\nconst DEFAULT_TIMEOUT = 5000;\n\nconst TYPE_OF_INDEX: Record<SnackbarsThreadBase['snackbarType'], externalSnackbarTypeAllowed> = {\n 0: 'info',\n 1: 'success',\n 3: 'error',\n};\n\n/**\n * A {@link SnackbarsThreadService} for specs: it records every snackbar in {@link shown}, with its tone and its texts,\n * and never starts a timer. It needs no test runner, so it works under Jest and Vitest alike.\n *\n * @example\n * TestBed.configureTestingModule({ providers: [provideFakeSnackbars()] });\n * const snackbars = TestBed.inject(FakeSnackbarsThreadService);\n * // ...act...\n * expect(snackbars.shown).toEqual([{ type: 'error', message: { key: 'post.failed' } }]);\n */\n@Injectable()\nexport class FakeSnackbarsThreadService extends SnackbarsThreadService {\n /** Every snackbar shown, oldest first; removing one does not drop it from here. */\n readonly shown: ShownSnackbar[] = [];\n\n private pendingType: externalSnackbarTypeAllowed | undefined;\n\n override show(message: TranslationRequest, type: externalSnackbarTypeAllowed, options?: SnackbarOptions): string {\n this.pendingType = type;\n return super.show(message, type, options);\n }\n\n override addWithId(elem: SnackbarsThreadBase, id: string, timeout: number = DEFAULT_TIMEOUT): void {\n const type = this.pendingType ?? TYPE_OF_INDEX[elem.snackbarType];\n this.pendingType = undefined;\n this.shown.push({\n type,\n message: shownText(elem.i18n.message),\n ...(elem.i18n.action === undefined ? {} : { action: shownText(elem.i18n.action) }),\n ...(elem.navigateInternalUrl === undefined ? {} : { navigateInternalUrl: elem.navigateInternalUrl }),\n ...(elem.openUrlInNewTab === undefined ? {} : { openUrlInNewTab: elem.openUrlInNewTab }),\n ...(elem.callback === undefined ? {} : { callback: elem.callback }),\n ...(timeout === DEFAULT_TIMEOUT ? {} : { timeout }),\n });\n super.addWithId(elem, id, 0);\n }\n\n /** Forgets every snackbar shown so far, e.g. the ones a spec's setup raised. */\n clear(): void {\n this.shown.length = 0;\n }\n}\n\n/**\n * Provides {@link FakeSnackbarsThreadService} in place of {@link SnackbarsThreadService}; inject the fake to read what was shown.\n *\n * @example\n * providers: [provideFakeSnackbars()]\n */\nexport function provideFakeSnackbars(): Provider[] {\n return [FakeSnackbarsThreadService, { provide: SnackbarsThreadService, useExisting: FakeSnackbarsThreadService }];\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;;AAKM,SAAU,SAAS,CAAC,OAA2B,EAAA;AACjD,IAAA,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE;AAC7B,QAAA,OAAO,EAAE,GAAG,EAAE,OAAO,EAAE;IAC3B;AACA,IAAA,IAAI,KAAK,IAAI,OAAO,EAAE;AAClB,QAAA,OAAO,EAAE,GAAG,EAAE,OAAO,CAAC,GAAG,EAAE;IAC/B;AACA,IAAA,OAAO,OAAO,CAAC,MAAM,KAAK,SAAS,GAAG,EAAE,GAAG,EAAE,OAAO,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,OAAO,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,MAAM,EAAE;AAC7G;;ACcA,SAAS,iBAAiB,CAAC,IAA+B,EAAE,GAAc,EAAA;IACtE,OAAO;AACH,QAAA,KAAK,EAAE,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC;AAC5B,QAAA,OAAO,EAAE,SAAS,CAAC,IA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Ae,EAAE,IAAI,CAAC,eAAe,EAAE,CAAC;YACxF,IAAI,IAAI,CAAC,QAAQ,KAAK,SAAS,GAAG,EAAE,GAAG,EAAE,QAAQ,EAAE,IAAI,CAAC,QAAQ,EAAE,CAAC;AACnE,YAAA,IAAI,OAAO,KAAK,eAAe,GAAG,EAAE,GAAG,EAAE,OAAO,EAAE,CAAC;AACtD,SAAA,CAAC;QACF,KAAK,CAAC,SAAS,CAAC,IAAI,EAAE,EAAE,EAAE,CAAC,CAAC;IAChC;;IAGA,KAAK,GAAA;AACD,QAAA,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC;IACzB;uGA7BS,0BAA0B,EAAA,IAAA,EAAA,IAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA;2GAA1B,0BAA0B,EAAA,CAAA;;2FAA1B,0BAA0B,EAAA,UAAA,EAAA,CAAA;kBADtC;;AAiCD;;;;;AAKG;SACa,oBAAoB,GAAA;AAChC,IAAA,OAAO,CAAC,0BAA0B,EAAE,EAAE,OAAO,EAAE,sBAAsB,EAAE,WAAW,EAAE,0BAA0B,EAAE,CAAC;AACrH;;ACjFA;;AAEG;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"agorapulse-ui-components.mjs","sources":["../../../libs/ui-components/src/lib/agorapulse-ui-components.module.ts","../../../libs/ui-components/index.ts","../../../libs/ui-components/agorapulse-ui-components.ts"],"sourcesContent":["// Modules\nimport { AddCommentComponent } from '@agorapulse/ui-components/add-comment';\nimport { AvatarComponent } from '@agorapulse/ui-components/avatar';\nimport { ConfirmModalComponent } from '@agorapulse/ui-components/confirm-modal';\nimport { DatepickerComponent } from '@agorapulse/ui-components/datepicker';\nimport {\n AutosizeTextareaDirective,\n DefaultImageDirective,\n EllipsisDirective,\n EqualValidatorDirective,\n FrozenGifDirective,\n MultiStyleTextDirective,\n} from '@agorapulse/ui-components/directives';\nimport { DotStepperComponent } from '@agorapulse/ui-components/dot-stepper';\nimport { InfoboxComponent } from '@agorapulse/ui-components/infobox';\nimport { LabelComponent } from '@agorapulse/ui-components/labels';\nimport { LabelsSelectorComponent } from '@agorapulse/ui-components/labels-selector';\nimport { MediaDisplayOverlayDialogComponent } from '@agorapulse/ui-components/media-display-overlay';\nimport { ModalComponent } from '@agorapulse/ui-components/modal';\nimport { DayDisabledPipe, NeoDatepickerComponent } from '@agorapulse/ui-components/neo-datepicker';\nimport { NotificationComponent } from '@agorapulse/ui-components/notification';\nimport { OverflowListComponent } from '@agorapulse/ui-components/overflow-list';\nimport { PaginatorButtonComponent, PaginatorComponent } from '@agorapulse/ui-components/paginator';\nimport { PasswordInputComponent } from '@agorapulse/ui-components/password-input';\nimport { PopmenuModule } from '@agorapulse/ui-components/popmenu';\nimport { SlideToggleComponent } from '@agorapulse/ui-components/slide-toggle';\nimport { SnackbarsThreadComponent } from '@agorapulse/ui-components/snackbars-thread';\nimport { StepperComponent } from '@agorapulse/ui-components/stepper';\nimport { TooltipDirective } from '@agorapulse/ui-components/tooltip';\nimport { NgModule } from '@angular/core';\nimport { MAT_TABS_CONFIG } from '@angular/material/tabs';\n\n/**\n * @deprecated for better tree-shaking, use standalone component import instead\n */\n@NgModule({\n declarations: [],\n imports: [\n // Components\n AvatarComponent,\n StepperComponent,\n ConfirmModalComponent,\n DatepickerComponent,\n DotStepperComponent,\n EllipsisDirective,\n InfoboxComponent,\n OverflowListComponent,\n LabelsSelectorComponent,\n NeoDatepickerComponent,\n MediaDisplayOverlayDialogComponent,\n ModalComponent,\n PasswordInputComponent,\n LabelComponent,\n NotificationComponent,\n PaginatorComponent,\n PaginatorButtonComponent,\n SlideToggleComponent,\n SnackbarsThreadComponent,\n // Directives\n DefaultImageDirective,\n FrozenGifDirective,\n EqualValidatorDirective,\n MultiStyleTextDirective,\n TooltipDirective,\n AddCommentComponent,\n AutosizeTextareaDirective,\n // Pipes\n DayDisabledPipe,\n ],\n exports: [\n // Components\n AddCommentComponent,\n AvatarComponent,\n StepperComponent,\n ConfirmModalComponent,\n DatepickerComponent,\n NeoDatepickerComponent,\n DotStepperComponent,\n EllipsisDirective,\n InfoboxComponent,\n LabelComponent,\n OverflowListComponent,\n MediaDisplayOverlayDialogComponent,\n ModalComponent,\n PasswordInputComponent,\n LabelsSelectorComponent,\n NotificationComponent,\n PaginatorComponent,\n PaginatorButtonComponent,\n SlideToggleComponent,\n SnackbarsThreadComponent,\n // Pipes\n DayDisabledPipe,\n // Directives\n AutosizeTextareaDirective,\n DefaultImageDirective,\n FrozenGifDirective,\n EqualValidatorDirective,\n MultiStyleTextDirective,\n TooltipDirective,\n // Modules\n PopmenuModule,\n ],\n providers: [\n // Disable ripple effect\n // {provide: MAT_RIPPLE_GLOBAL_OPTIONS, useValue: {disabled: true}},\n // Disable tabs animation\n { provide: MAT_TABS_CONFIG, useValue: { animationDuration: '0ms' } },\n ],\n})\nexport class AgorapulseUiComponentsModule {}\n","/*\n * Public API Surface of ui\n */\n\n// Module\nexport { PopmenuModule } from '@agorapulse/ui-components/popmenu';\nexport { AgorapulseUiComponentsModule } from './src/lib/agorapulse-ui-components.module';\n\n// Directive\nexport {\n AutosizeTextareaDirective,\n CheckboxDirective,\n DefaultImageDirective,\n EllipsisDirective,\n EqualValidatorDirective,\n FrozenGifDirective,\n MultiStyleTextDirective,\n} from '@agorapulse/ui-components/directives';\nexport { PopmenuDirective } from '@agorapulse/ui-components/popmenu';\nexport { TooltipDirective, TooltipExternalTriggerDirective } from '@agorapulse/ui-components/tooltip';\n\n// Dropdown base\nexport { DropdownOptionDirective, DropdownOverlay, DropdownTriggerDirective, createDropdownOverlay } from '@agorapulse/ui-components/dropdown-base';\nexport { DropdownContentDirective, DropdownPanelComponent } from '@agorapulse/ui-components/dropdown-panel';\n\n// Component\nexport { ActionDropdownComponent, ActionDropdownItem, ActionDropdownTriggerDirective } from '@agorapulse/ui-components/action-dropdown';\nexport { AddCommentComponent } from '@agorapulse/ui-components/add-comment';\nexport { AutocompleteComponent } from '@agorapulse/ui-components/autocomplete';\nexport { AvatarComponent, AvatarItem } from '@agorapulse/ui-components/avatar';\nexport { BadgeComponent } from '@agorapulse/ui-components/badge';\nexport { ButtonComponent } from '@agorapulse/ui-components/button';\nexport { CheckboxComponent } from '@agorapulse/ui-components/checkbox';\nexport { ConfirmModalComponent } from '@agorapulse/ui-components/confirm-modal';\nexport { CounterComponent } from '@agorapulse/ui-components/counter';\nexport {\n DatepickerComponent,\n DatepickerMode,\n DatepickerPreset,\n DatepickerSelectComponent,\n DatepickerValue,\n defaultDatepickerPresets,\n isPeriod,\n Period,\n} from '@agorapulse/ui-components/datepicker';\nexport { DotStepperComponent } from '@agorapulse/ui-components/dot-stepper';\nexport { IconButtonComponent } from '@agorapulse/ui-components/icon-button';\nexport { InfoboxComponent } from '@agorapulse/ui-components/infobox';\nexport { LabelComponent } from '@agorapulse/ui-components/labels';\nexport { LabelsSelectorComponent } from '@agorapulse/ui-components/labels-selector';\nexport { InputComponent } from '@agorapulse/ui-components/legacy/input';\nexport { SelectComponent } from '@agorapulse/ui-components/legacy/select';\nexport { TextareaComponent } from '@agorapulse/ui-components/legacy/textarea';\nexport { MediaDisplayOverlayDialogComponent } from '@agorapulse/ui-components/media-display-overlay';\nexport { ModalComponent, ModalConfig } from '@agorapulse/ui-components/modal';\nexport { NavSelectorComponent } from '@agorapulse/ui-components/nav-selector';\nexport {\n DayDisabledPipe,\n NeoDatePickerLocale,\n NeoDatePickerMode,\n NeoDatePickerStartsOn,\n NeoDatepickerComponent,\n} from '@agorapulse/ui-components/neo-datepicker';\nexport { NotificationComponent } from '@agorapulse/ui-components/notification';\nexport { OverflowListComponent, OverflowListDisplayType, OverflowListMode } from '@agorapulse/ui-components/overflow-list';\nexport { PaginatorButtonComponent, PaginatorComponent } from '@agorapulse/ui-components/paginator';\nexport { PasswordInputComponent } from '@agorapulse/ui-components/password-input';\nexport { PopmenuComponent } from '@agorapulse/ui-components/popmenu';\nexport { RadioComponent } from '@agorapulse/ui-components/radio';\nexport { RadioButtonCardComponent } from '@agorapulse/ui-components/radio-button-card';\nexport { SegmentedControlComponent, SegmentedControlOption } from '@agorapulse/ui-components/segmented-control';\nexport {\n SelectionDropdownComponent,\n SelectionDropdownItem,\n SelectionDropdownTriggerDirective,\n} from '@agorapulse/ui-components/selection-dropdown';\nexport { SlideToggleComponent } from '@agorapulse/ui-components/slide-toggle';\nexport { SnackbarsThreadComponent } from '@agorapulse/ui-components/snackbars-thread';\nexport { SocialButtonComponent } from '@agorapulse/ui-components/social-button';\nexport { StatusComponent } from '@agorapulse/ui-components/status';\nexport { StatusCardActor, StatusCardComponent } from '@agorapulse/ui-components/status-card';\nexport { StepperComponent } from '@agorapulse/ui-components/stepper';\nexport { TagComponent } from '@agorapulse/ui-components/tag';\nexport { ToggleComponent } from '@agorapulse/ui-components/toggle';\n\n// Service\nexport { SnackbarsThreadService } from '@agorapulse/ui-components/snackbars-thread';\n\n// Model\nexport { ConfirmModalTexts } from '@agorapulse/ui-components/confirm-modal';\nexport * from '@agorapulse/ui-components/filter-dropdown';\nexport { SnackbarTypeValues, SnackbarsThreadBase, externalSnackbarTypeAllowed } from '@agorapulse/ui-components/snackbars-thread';\nexport { Step } from '@agorapulse/ui-components/stepper';\nexport { CustomTooltipAvatarItem, CustomTooltipPresentationItem, CustomTooltipType } from '@agorapulse/ui-components/tooltip';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAgCA;;AAEG;MA4EU,4BAA4B,CAAA;uGAA5B,4BAA4B,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA;wGAA5B,4BAA4B,EAAA,OAAA,EAAA;;YAvEjC,eAAe;YACf,gBAAgB;YAChB,qBAAqB;YACrB,mBAAmB;YACnB,mBAAmB;YACnB,iBAAiB;Y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K,EAAE,EAAE;AACvE,qBAAA;AACJ,iBAAA;;;AC7GD;;AAEG;AAEH;;ACJA;;AAEG;;;;"}
1
+ {"version":3,"file":"agorapulse-ui-components.mjs","sources":["../../../libs/ui-components/src/lib/agorapulse-ui-components.module.ts","../../../libs/ui-components/index.ts","../../../libs/ui-components/agorapulse-ui-components.ts"],"sourcesContent":["// Modules\nimport { AddCommentComponent } from '@agorapulse/ui-components/add-comment';\nimport { AvatarComponent } from '@agorapulse/ui-components/avatar';\nimport { ConfirmModalComponent } from '@agorapulse/ui-components/confirm-modal';\nimport { DatepickerComponent } from '@agorapulse/ui-components/datepicker';\nimport {\n AutosizeTextareaDirective,\n DefaultImageDirective,\n EllipsisDirective,\n EqualValidatorDirective,\n FrozenGifDirective,\n MultiStyleTextDirective,\n} from '@agorapulse/ui-components/directives';\nimport { DotStepperComponent } from '@agorapulse/ui-components/dot-stepper';\nimport { InfoboxComponent } from '@agorapulse/ui-components/infobox';\nimport { LabelComponent } from '@agorapulse/ui-components/labels';\nimport { LabelsSelectorComponent } from '@agorapulse/ui-components/labels-selector';\nimport { MediaDisplayOverlayDialogComponent } from '@agorapulse/ui-components/media-display-overlay';\nimport { ModalComponent } from '@agorapulse/ui-components/modal';\nimport { DayDisabledPipe, NeoDatepickerComponent } from '@agorapulse/ui-components/neo-datepicker';\nimport { NotificationComponent } from '@agorapulse/ui-components/notification';\nimport { OverflowListComponent } from '@agorapulse/ui-components/overflow-list';\nimport { PaginatorButtonComponent, PaginatorComponent } from '@agorapulse/ui-components/paginator';\nimport { PasswordInputComponent } from '@agorapulse/ui-components/password-input';\nimport { PopmenuModule } from '@agorapulse/ui-components/popmenu';\nimport { SlideToggleComponent } from '@agorapulse/ui-components/slide-toggle';\nimport { SnackbarsThreadComponent } from '@agorapulse/ui-components/snackbars-thread';\nimport { StepperComponent } from '@agorapulse/ui-components/stepper';\nimport { TooltipDirective } from '@agorapulse/ui-components/tooltip';\nimport { NgModule } from '@angular/core';\nimport { MAT_TABS_CONFIG } from '@angular/material/tabs';\n\n/**\n * @deprecated for better tree-shaking, use standalone component import instead\n */\n@NgModule({\n declarations: [],\n imports: [\n // Components\n AvatarComponent,\n StepperComponent,\n ConfirmModalComponent,\n DatepickerComponent,\n DotStepperComponent,\n EllipsisDirective,\n InfoboxComponent,\n OverflowListComponent,\n LabelsSelectorComponent,\n NeoDatepickerComponent,\n MediaDisplayOverlayDialogComponent,\n ModalComponent,\n PasswordInputComponent,\n LabelComponent,\n NotificationComponent,\n PaginatorComponent,\n PaginatorButtonComponent,\n SlideToggleComponent,\n SnackbarsThreadComponent,\n // Directives\n DefaultImageDirective,\n FrozenGifDirective,\n EqualValidatorDirective,\n MultiStyleTextDirective,\n TooltipDirective,\n AddCommentComponent,\n AutosizeTextareaDirective,\n // Pipes\n DayDisabledPipe,\n ],\n exports: [\n // Components\n AddCommentComponent,\n AvatarComponent,\n StepperComponent,\n ConfirmModalComponent,\n DatepickerComponent,\n NeoDatepickerComponent,\n DotStepperComponent,\n EllipsisDirective,\n InfoboxComponent,\n LabelComponent,\n OverflowListComponent,\n MediaDisplayOverlayDialogComponent,\n ModalComponent,\n PasswordInputComponent,\n LabelsSelectorComponent,\n NotificationComponent,\n PaginatorComponent,\n PaginatorButtonComponent,\n SlideToggleComponent,\n SnackbarsThreadComponent,\n // Pipes\n DayDisabledPipe,\n // Directives\n AutosizeTextareaDirective,\n DefaultImageDirective,\n FrozenGifDirective,\n EqualValidatorDirective,\n MultiStyleTextDirective,\n TooltipDirective,\n // Modules\n PopmenuModule,\n ],\n providers: [\n // Disable ripple effect\n // {provide: MAT_RIPPLE_GLOBAL_OPTIONS, useValue: {disabled: true}},\n // Disable tabs animation\n { provide: MAT_TABS_CONFIG, useValue: { animationDuration: '0ms' } },\n ],\n})\nexport class AgorapulseUiComponentsModule {}\n","/*\n * Public API Surface of ui\n */\n\n// Module\nexport { PopmenuModule } from '@agorapulse/ui-components/popmenu';\nexport { AgorapulseUiComponentsModule } from './src/lib/agorapulse-ui-components.module';\n\n// Directive\nexport {\n AutosizeTextareaDirective,\n CheckboxDirective,\n DefaultImageDirective,\n EllipsisDirective,\n EqualValidatorDirective,\n FrozenGifDirective,\n MultiStyleTextDirective,\n} from '@agorapulse/ui-components/directives';\nexport { PopmenuDirective } from '@agorapulse/ui-components/popmenu';\nexport { TooltipDirective, TooltipExternalTriggerDirective } from '@agorapulse/ui-components/tooltip';\n\n// Dropdown base\nexport {\n DropdownOptionDirective,\n DropdownOverlay,\n DropdownTriggerDirective,\n createDropdownOverlay,\n} from '@agorapulse/ui-components/dropdown-base';\nexport { DropdownContentDirective, DropdownPanelComponent } from '@agorapulse/ui-components/dropdown-panel';\n\n// Component\nexport { ActionDropdownComponent, ActionDropdownItem, ActionDropdownTriggerDirective } from '@agorapulse/ui-components/action-dropdown';\nexport { AddCommentComponent } from '@agorapulse/ui-components/add-comment';\nexport { AutocompleteComponent } from '@agorapulse/ui-components/autocomplete';\nexport { AvatarComponent, AvatarItem } from '@agorapulse/ui-components/avatar';\nexport { BadgeComponent } from '@agorapulse/ui-components/badge';\nexport { ButtonComponent } from '@agorapulse/ui-components/button';\nexport { CheckboxComponent } from '@agorapulse/ui-components/checkbox';\nexport { ConfirmModalComponent } from '@agorapulse/ui-components/confirm-modal';\nexport { CounterComponent } from '@agorapulse/ui-components/counter';\nexport {\n DatepickerComponent,\n DatepickerMode,\n DatepickerPreset,\n DatepickerSelectComponent,\n DatepickerValue,\n Period,\n defaultDatepickerPresets,\n isPeriod,\n} from '@agorapulse/ui-components/datepicker';\nexport { DotStepperComponent } from '@agorapulse/ui-components/dot-stepper';\nexport { IconButtonComponent } from '@agorapulse/ui-components/icon-button';\nexport { InfoboxComponent } from '@agorapulse/ui-components/infobox';\nexport { LabelComponent } from '@agorapulse/ui-components/labels';\nexport { LabelsSelectorComponent } from '@agorapulse/ui-components/labels-selector';\nexport { InputComponent } from '@agorapulse/ui-components/legacy/input';\nexport { SelectComponent } from '@agorapulse/ui-components/legacy/select';\nexport { TextareaComponent } from '@agorapulse/ui-components/legacy/textarea';\nexport { MediaDisplayOverlayDialogComponent } from '@agorapulse/ui-components/media-display-overlay';\nexport { ModalComponent, ModalConfig } from '@agorapulse/ui-components/modal';\nexport { NavSelectorComponent } from '@agorapulse/ui-components/nav-selector';\nexport {\n DayDisabledPipe,\n NeoDatePickerLocale,\n NeoDatePickerMode,\n NeoDatePickerStartsOn,\n NeoDatepickerComponent,\n} from '@agorapulse/ui-components/neo-datepicker';\nexport { NotificationComponent } from '@agorapulse/ui-components/notification';\nexport { OverflowListComponent, OverflowListDisplayType, OverflowListMode } from '@agorapulse/ui-components/overflow-list';\nexport { PaginatorButtonComponent, PaginatorComponent } from '@agorapulse/ui-components/paginator';\nexport { PasswordInputComponent } from '@agorapulse/ui-components/password-input';\nexport { PopmenuComponent } from '@agorapulse/ui-components/popmenu';\nexport { RadioComponent } from '@agorapulse/ui-components/radio';\nexport { RadioButtonCardComponent } from '@agorapulse/ui-components/radio-button-card';\nexport { SegmentedControlComponent, SegmentedControlOption } from '@agorapulse/ui-components/segmented-control';\nexport {\n SelectionDropdownComponent,\n SelectionDropdownItem,\n SelectionDropdownTriggerDirective,\n} from '@agorapulse/ui-components/selection-dropdown';\nexport { SlideToggleComponent } from '@agorapulse/ui-components/slide-toggle';\nexport { SnackbarsThreadComponent } from '@agorapulse/ui-components/snackbars-thread';\nexport { SocialButtonComponent } from '@agorapulse/ui-components/social-button';\nexport { StatusComponent } from '@agorapulse/ui-components/status';\nexport { StatusCardActor, StatusCardComponent } from '@agorapulse/ui-components/status-card';\nexport { StepperComponent } from '@agorapulse/ui-components/stepper';\nexport { TagComponent } from '@agorapulse/ui-components/tag';\nexport { ToggleComponent } from '@agorapulse/ui-components/toggle';\n\n// Service\nexport { SnackbarsThreadService } from '@agorapulse/ui-components/snackbars-thread';\n\n// Model\nexport { ConfirmModalTexts } from '@agorapulse/ui-components/confirm-modal';\nexport * from '@agorapulse/ui-components/filter-dropdown';\nexport {\n SnackbarOptions,\n SnackbarTypeValues,\n SnackbarsThreadBase,\n externalSnackbarTypeAllowed,\n} from '@agorapulse/ui-components/snackbars-thread';\nexport { Step } from '@agorapulse/ui-components/stepper';\nexport { CustomTooltipAvatarItem, CustomTooltipPresentationItem, CustomTooltipType } from '@agorapulse/ui-components/tooltip';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAgCA;;AAEG;MA4EU,4BAA4B,CAAA;uGAA5B,4BAA4B,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA;wGAA5B,4BAA4B,EAAA,OAAA,EAAA;;YAvEjC,eAAe;YACf,gBAAgB;YAChB,qBAAqB;YACrB,mBAAmB;YACnB,mBAAmB;YACnB,iBAAiB;YACjB,gBAAgB;YAChB,qBAAqB;YACrB,uBAAuB;YACvB,sBAAsB;YACtB,kCAAkC;YAClC,cAAc;YACd,sBAAsB;YACtB,cAAc;YACd,qBAAqB;YACrB,kBAAkB;YAClB,wBAAwB;YACxB,oBAAoB;YACpB,wBAAwB;;YAExB,qBAAqB;YACrB,kBAAkB;YAClB,uBAAuB;YACvB,uBAAuB;YACvB,gBAAgB;YAChB,mBAAmB;YACnB,yBAAyB;;YAEzB,eAAe,CAAA,EAAA,OAAA,EAAA;;YAIf,mBAAmB;YACnB,eAAe;YACf,gBAAgB;YAChB,qBAAqB;YACrB,mBAAmB;YACnB,sBAAsB;YACtB,mBAAmB;YACnB,iBAAiB;YACjB,gBAAgB;YAChB,cAAc;YACd,qBAAqB;YACrB,kCAAkC;YAClC,cAAc;YACd,sBAAsB;YACtB,uBAAuB;YACvB,qBAAqB;YACrB,kBAAkB;YAClB,wBAAwB;YACxB,oBAAoB;YACpB,wBAAwB;;YAExB,eAAe;;YAEf,yBAAyB;YACzB,qBA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BAEzB,eAAe;AAClB,qBAAA;AACD,oBAAA,OAAO,EAAE;;wBAEL,mBAAmB;wBACnB,eAAe;wBACf,gBAAgB;wBAChB,qBAAqB;wBACrB,mBAAmB;wBACnB,sBAAsB;wBACtB,mBAAmB;wBACnB,iBAAiB;wBACjB,gBAAgB;wBAChB,cAAc;wBACd,qBAAqB;wBACrB,kCAAkC;wBAClC,cAAc;wBACd,sBAAsB;wBACtB,uBAAuB;wBACvB,qBAAqB;wBACrB,kBAAkB;wBAClB,wBAAwB;wBACxB,oBAAoB;wBACpB,wBAAwB;;wBAExB,eAAe;;wBAEf,yBAAyB;wBACzB,qBAAqB;wBACrB,kBAAkB;wBAClB,uBAAuB;wBACvB,uBAAuB;wBACvB,gBAAgB;;wBAEhB,aAAa;AAChB,qBAAA;AACD,oBAAA,SAAS,EAAE;;;;wBAIP,EAAE,OAAO,EAAE,eAAe,EAAE,QAAQ,EAAE,EAAE,iBAAiB,EAAE,KAAK,EAAE,EAAE;AACvE,qBAAA;AACJ,iBAAA;;;AC7GD;;AAEG;AAEH;;ACJA;;AAEG;;;;"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@agorapulse/ui-components",
3
3
  "description": "Agorapulse UI Components Library",
4
- "version": "22.9.8-beta.1",
4
+ "version": "22.9.10-beta.1",
5
5
  "author": "Benoit Hediard",
6
6
  "repository": {
7
7
  "type": "git",
@@ -281,6 +281,10 @@
281
281
  "types": "./types/agorapulse-ui-components-tag.d.ts",
282
282
  "default": "./fesm2022/agorapulse-ui-components-tag.mjs"
283
283
  },
284
+ "./testing": {
285
+ "types": "./types/agorapulse-ui-components-testing.d.ts",
286
+ "default": "./fesm2022/agorapulse-ui-components-testing.mjs"
287
+ },
284
288
  "./text-measurement": {
285
289
  "types": "./types/agorapulse-ui-components-text-measurement.d.ts",
286
290
  "default": "./fesm2022/agorapulse-ui-components-text-measurement.mjs"
@@ -287,9 +287,9 @@ declare class FilterDropdownComponent implements DropdownOverlay {
287
287
  href: string | undefined;
288
288
  label: string | undefined;
289
289
  } | undefined;
290
+ title: string | undefined;
290
291
  message: string | undefined;
291
292
  type: _agorapulse_ui_components_infobox.InfoboxType;
292
- titleRequest: _agorapulse_ui_components_i18n.TranslationRequest | undefined;
293
293
  } | null>;
294
294
  /**
295
295
  * The filter groups to display: STRUCTURE only (keys, titles, options, locks, display type, and the
@@ -1,23 +1,17 @@
1
1
  import * as _angular_core from '@angular/core';
2
- import { I18nOf } from '@agorapulse/ui-components/i18n';
3
2
 
4
3
  type MessageType = 'error' | 'success';
5
4
  declare class FormMessageComponent {
6
5
  set messageType(messageType: MessageType);
7
- /** The `message` shown next to the status symbol, rendered as text. */
8
- readonly i18n: _angular_core.InputSignal<I18nOf<"message">>;
9
- protected readonly texts: _angular_core.Signal<{
10
- readonly message: string | undefined;
11
- }>;
6
+ message: string;
12
7
  messageTypeSignal: _angular_core.WritableSignal<MessageType>;
13
8
  symbolIdSignal: _angular_core.Signal<"error_fill" | "rounded-check_fill">;
14
9
  /** The id this message is referenced by. A bound `[id]` would land after construction and leave the reference dangling. */
15
10
  readonly messageId: string;
16
11
  private symbolRegistry;
17
- private readonly resolveTexts;
18
12
  constructor();
19
13
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<FormMessageComponent, never>;
20
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<FormMessageComponent, "ap-form-message", never, { "messageType": { "alias": "messageType"; "required": true; }; "i18n": { "alias": "i18n"; "required": true; "isSignal": true; }; }, {}, never, never, true, never>;
14
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<FormMessageComponent, "ap-form-message", never, { "messageType": { "alias": "messageType"; "required": true; }; "message": { "alias": "message"; "required": true; }; }, {}, never, never, true, never>;
21
15
  }
22
16
 
23
17
  export { FormMessageComponent };
@@ -27,7 +27,6 @@ declare const DEFAULT_TEXTS: Readonly<{
27
27
  readonly 'ui-components.selection.select-all-count': "({{selected}} of {{total}})";
28
28
  readonly 'ui-components.snackbar.info': "Info";
29
29
  readonly 'ui-components.snackbar.success': "Success";
30
- readonly 'ui-components.snackbar.warning': "Warning";
31
30
  readonly 'ui-components.snackbar.error': "Error";
32
31
  readonly 'ui-components.split-button.toggle': "Toggle";
33
32
  readonly 'ui-components.toggle.confirm-title': "Are you sure?";
@@ -1,25 +1,17 @@
1
- import * as _angular_core from '@angular/core';
1
+ import * as i0 from '@angular/core';
2
2
  import { EventEmitter } from '@angular/core';
3
- import { I18nOf } from '@agorapulse/ui-components/i18n';
4
3
  import { agorapulseSymbol } from '@agorapulse/ui-symbol';
5
4
 
6
5
  type InfoboxType = 'info' | 'warning' | 'error' | 'success' | 'feature-lock';
7
6
  declare class InfoboxComponent {
8
7
  private readonly symbolRegistry;
9
8
  private readonly elementRef;
10
- private readonly resolveTexts;
11
- /** `title` is shown above the projected text; `action` is the label of the button, which is shown only when set. Rendered as text. */
12
- readonly i18n: _angular_core.InputSignal<I18nOf<never, "title" | "action">>;
13
- /** 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. */
14
- readonly title: _angular_core.InputSignal<undefined>;
15
- protected readonly texts: _angular_core.Signal<{
16
- readonly title: string | undefined;
17
- readonly action: string | undefined;
18
- }>;
19
9
  buttonId: string | null;
10
+ buttonLabel: string | undefined;
20
11
  buttonDataTrack: string | null;
21
- buttonSymbolId: _angular_core.InputSignal<string | undefined>;
12
+ buttonSymbolId: i0.InputSignal<string | undefined>;
22
13
  closable: boolean;
14
+ title?: string;
23
15
  type: InfoboxType;
24
16
  buttonClicked: EventEmitter<void>;
25
17
  closed: EventEmitter<void>;
@@ -31,8 +23,8 @@ declare class InfoboxComponent {
31
23
  constructor();
32
24
  onClickButton(): void;
33
25
  onCloseInfobox(): void;
34
- static ɵfac: _angular_core.ɵɵFactoryDeclaration<InfoboxComponent, never>;
35
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<InfoboxComponent, "ap-infobox", never, { "i18n": { "alias": "i18n"; "required": false; "isSignal": true; }; "title": { "alias": "title"; "required": false; "isSignal": true; }; "buttonId": { "alias": "buttonId"; "required": false; }; "buttonDataTrack": { "alias": "buttonDataTrack"; "required": false; }; "buttonSymbolId": { "alias": "buttonSymbolId"; "required": false; "isSignal": true; }; "closable": { "alias": "closable"; "required": false; }; "type": { "alias": "type"; "required": false; }; }, { "buttonClicked": "buttonClicked"; "closed": "closed"; }, never, ["*"], true, never>;
26
+ static ɵfac: i0.ɵɵFactoryDeclaration<InfoboxComponent, never>;
27
+ static ɵcmp: i0.ɵɵComponentDeclaration<InfoboxComponent, "ap-infobox", never, { "buttonId": { "alias": "buttonId"; "required": false; }; "buttonLabel": { "alias": "buttonLabel"; "required": false; }; "buttonDataTrack": { "alias": "buttonDataTrack"; "required": false; }; "buttonSymbolId": { "alias": "buttonSymbolId"; "required": false; "isSignal": true; }; "closable": { "alias": "closable"; "required": false; }; "title": { "alias": "title"; "required": false; }; "type": { "alias": "type"; "required": false; }; }, { "buttonClicked": "buttonClicked"; "closed": "closed"; }, never, ["*"], true, never>;
36
28
  static ngAcceptInputType_closable: unknown;
37
29
  }
38
30
 
@@ -1,5 +1,5 @@
1
1
  import * as i0 from '@angular/core';
2
- import { I18nOf, TranslationRequest } from '@agorapulse/ui-components/i18n';
2
+ import { TranslationRequest, I18nOf } from '@agorapulse/ui-components/i18n';
3
3
  import { SymbolRegistry } from '@agorapulse/ui-symbol';
4
4
  import { BehaviorSubject } from 'rxjs';
5
5
 
@@ -9,8 +9,8 @@ import { BehaviorSubject } from 'rxjs';
9
9
  * Warning - 2
10
10
  * Error - 3
11
11
  */
12
- type externalSnackbarTypeAllowed = 'info' | 'success' | 'warning' | 'error';
13
- type internalSnackbarTypeAllowed = 0 | 1 | 2 | 3;
12
+ type externalSnackbarTypeAllowed = 'info' | 'success' | 'error';
13
+ type internalSnackbarTypeAllowed = 0 | 1 | 3;
14
14
  /**
15
15
  * We use enum to avoid problem with isolatedModules when export const enum
16
16
  * https://ncjamieson.com/dont-export-const-enums/
@@ -18,7 +18,6 @@ type internalSnackbarTypeAllowed = 0 | 1 | 2 | 3;
18
18
  declare enum SnackbarTypeValues {
19
19
  INFO = "info",
20
20
  SUCCESS = "success",
21
- WARNING = "warning",
22
21
  ERROR = "error"
23
22
  }
24
23
  /**
@@ -30,7 +29,7 @@ declare enum SnackbarTypeValues {
30
29
  interface SnackbarsThreadBase {
31
30
  /** `message` is rendered as sanitized HTML, whatever its form; `action` is the text of the link, rendered as text. */
32
31
  i18n: I18nOf<'message', 'action'>;
33
- /** 0 info, 1 success, 2 warning, 3 error. */
32
+ /** 0 info, 1 success, 3 error. */
34
33
  snackbarType: internalSnackbarTypeAllowed;
35
34
  /** URL the action navigates to. */
36
35
  navigateInternalUrl?: string;
@@ -39,6 +38,24 @@ interface SnackbarsThreadBase {
39
38
  /** Called by the action instead of navigating; the snackbar is removed first. */
40
39
  callback?: () => void;
41
40
  }
41
+ /**
42
+ * What a snackbar shown by tone can carry besides its message.
43
+ *
44
+ * @example
45
+ * snackbars.success('rule.created', { action: 'rule.open', navigateInternalUrl: `/rules/${id}` });
46
+ */
47
+ interface SnackbarOptions {
48
+ /** Text of the link; shown only with `callback` or `navigateInternalUrl`, rendered as text. */
49
+ action?: TranslationRequest;
50
+ /** Runs when the link is clicked. */
51
+ callback?: () => void;
52
+ /** App route the link opens. */
53
+ navigateInternalUrl?: string;
54
+ /** Opens `navigateInternalUrl` in a new tab. */
55
+ openUrlInNewTab?: boolean;
56
+ /** Milliseconds before the snackbar closes; 0 keeps it open. Defaults to 5000. */
57
+ timeout?: number;
58
+ }
42
59
  interface SnackbarsThreadComplete extends SnackbarsThreadBase {
43
60
  id: string;
44
61
  }
@@ -54,34 +71,36 @@ declare class SnackbarsThreadService {
54
71
  */
55
72
  addSnackbar(elem: SnackbarsThreadBase, timeout?: number): string;
56
73
  /**
57
- * Shows a success snackbar for `timeout` ms (0 keeps it) and returns its id; `message` is rendered as sanitized HTML.
74
+ * Shows a success snackbar and returns its id; `message` is rendered as sanitized HTML.
75
+ * `options` adds a link (`action` with `callback` or `navigateInternalUrl`) and sets the `timeout`.
58
76
  *
59
77
  * @example
60
78
  * snackbars.success('post.saved');
79
+ * snackbars.success('rule.created', { action: 'rule.open', navigateInternalUrl: `/rules/${id}` });
61
80
  */
62
- success(message: TranslationRequest, timeout?: number): string;
81
+ success(message: TranslationRequest, options?: SnackbarOptions): string;
63
82
  /**
64
83
  * Shows an error snackbar; same contract as {@link success}.
65
84
  *
66
85
  * @example
67
86
  * snackbars.error({ key: 'post.failed', params: { count: 2 } });
68
87
  */
69
- error(message: TranslationRequest, timeout?: number): string;
88
+ error(message: TranslationRequest, options?: SnackbarOptions): string;
70
89
  /**
71
90
  * Shows an info snackbar, styled as a success; same contract as {@link success}.
72
91
  *
73
92
  * @example
74
93
  * snackbars.info('post.scheduled');
75
94
  */
76
- info(message: TranslationRequest, timeout?: number): string;
95
+ info(message: TranslationRequest, options?: SnackbarOptions): string;
77
96
  /**
78
97
  * Shows a snackbar whose type is data rather than a literal; same contract as {@link success}.
79
- * `info` is styled as a success, `warning` as an error.
98
+ * `info` is styled as a success.
80
99
  *
81
100
  * @example
82
101
  * snackbars.show('post.saved', status.type);
83
102
  */
84
- show(message: TranslationRequest, type: externalSnackbarTypeAllowed, timeout?: number): string;
103
+ show(message: TranslationRequest, type: externalSnackbarTypeAllowed, options?: SnackbarOptions): string;
85
104
  remove(id: string | undefined): void;
86
105
  private generateId;
87
106
  static ɵfac: i0.ɵɵFactoryDeclaration<SnackbarsThreadService, never>;
@@ -95,7 +114,6 @@ declare class SnackbarsThreadComponent {
95
114
  SnackbarTypesMap: {
96
115
  readonly 0: "info";
97
116
  readonly 1: "success";
98
- readonly 2: "warning";
99
117
  readonly 3: "error";
100
118
  };
101
119
  SnackbarIconsMap: {
@@ -116,7 +134,6 @@ declare class SnackbarsThreadComponent {
116
134
  protected readonly iconLabels: i0.Signal<{
117
135
  readonly info: string;
118
136
  readonly success: string;
119
- readonly warning: string;
120
137
  readonly error: string;
121
138
  }>;
122
139
  constructor();
@@ -127,4 +144,4 @@ declare class SnackbarsThreadComponent {
127
144
  }
128
145
 
129
146
  export { SnackbarTypeValues, SnackbarsThreadComponent, SnackbarsThreadService };
130
- export type { SnackbarsThreadBase, externalSnackbarTypeAllowed };
147
+ export type { SnackbarOptions, SnackbarsThreadBase, externalSnackbarTypeAllowed };
@@ -0,0 +1,106 @@
1
+ import { ComponentType } from '@angular/cdk/portal';
2
+ import * as i0 from '@angular/core';
3
+ import { TemplateRef, Provider } from '@angular/core';
4
+ import { MatDialog, MatDialogConfig, MatDialogRef } from '@angular/material/dialog';
5
+ import { TranslationRequest } from '@agorapulse/ui-components/i18n';
6
+ import { SnackbarsThreadService, externalSnackbarTypeAllowed, SnackbarOptions, SnackbarsThreadBase } from '@agorapulse/ui-components/snackbars-thread';
7
+
8
+ /** A text as a spec compares it: a key with its optional params, or raw text. A bare key string becomes `{ key }`. */
9
+ type ShownText = {
10
+ key: string;
11
+ params?: Record<string, unknown>;
12
+ } | {
13
+ raw: string;
14
+ };
15
+
16
+ /** One confirm modal the code under test opened. */
17
+ interface AskedConfirmation {
18
+ title: ShownText;
19
+ message: ShownText;
20
+ confirm?: ShownText;
21
+ cancel?: ShownText;
22
+ /** Present only when it is not the default `'confirm'`. */
23
+ footerConfirmButtonId?: string;
24
+ /** Present only when it is not the default `'cancel'`. */
25
+ footerCancelButtonId?: string;
26
+ }
27
+ /** What a modal answers: `true` confirms, `false` cancels, `undefined` closes without a choice, `'pending'` stays open until the code closes it. */
28
+ type ConfirmModalAnswer = boolean | undefined | 'pending';
29
+ /**
30
+ * A {@link MatDialog} for specs that answers every `ConfirmModalComponent.open` with {@link answer} instead of rendering
31
+ * it, and records the texts of each modal in {@link asked}. Any other component goes to the real dialog. It needs no
32
+ * test runner, so it works under Jest and Vitest alike.
33
+ *
34
+ * @example
35
+ * TestBed.configureTestingModule({ providers: [provideFakeConfirmModal({ answer: false })] });
36
+ * const confirmModal = TestBed.inject(FakeConfirmModal);
37
+ * // ...act...
38
+ * expect(confirmModal.asked).toEqual([{ title: { key: 'post.delete.title' }, message: { key: 'post.delete.message' } }]);
39
+ */
40
+ declare class FakeConfirmModal extends MatDialog {
41
+ /** Every confirm modal opened, oldest first. */
42
+ readonly asked: AskedConfirmation[];
43
+ /** What the next modals answer. */
44
+ answer: ConfirmModalAnswer;
45
+ private pending;
46
+ /** How many `'pending'` modals the code has not closed yet. */
47
+ get openModals(): number;
48
+ open<T, D = unknown, R = unknown>(component: ComponentType<T>, config?: MatDialogConfig<D>): MatDialogRef<T, R>;
49
+ open<T, D = unknown, R = unknown>(template: TemplateRef<T>, config?: MatDialogConfig<D>): MatDialogRef<T, R>;
50
+ /** Forgets every modal opened so far. */
51
+ clear(): void;
52
+ static ɵfac: i0.ɵɵFactoryDeclaration<FakeConfirmModal, never>;
53
+ static ɵprov: i0.ɵɵInjectableDeclaration<FakeConfirmModal>;
54
+ }
55
+ /**
56
+ * Provides {@link FakeConfirmModal} in place of {@link MatDialog}; inject the fake to set the answer and read what was asked.
57
+ *
58
+ * @example
59
+ * providers: [provideFakeConfirmModal({ answer: true })]
60
+ */
61
+ declare function provideFakeConfirmModal(options?: {
62
+ answer?: ConfirmModalAnswer;
63
+ }): Provider[];
64
+
65
+ /** One snackbar the code under test showed. */
66
+ interface ShownSnackbar {
67
+ type: externalSnackbarTypeAllowed;
68
+ message: ShownText;
69
+ action?: ShownText;
70
+ navigateInternalUrl?: string;
71
+ openUrlInNewTab?: boolean;
72
+ callback?: () => void;
73
+ /** Present only when it differs from the service's default of 5000 ms; 0 keeps the snackbar open. */
74
+ timeout?: number;
75
+ }
76
+ /**
77
+ * A {@link SnackbarsThreadService} for specs: it records every snackbar in {@link shown}, with its tone and its texts,
78
+ * and never starts a timer. It needs no test runner, so it works under Jest and Vitest alike.
79
+ *
80
+ * @example
81
+ * TestBed.configureTestingModule({ providers: [provideFakeSnackbars()] });
82
+ * const snackbars = TestBed.inject(FakeSnackbarsThreadService);
83
+ * // ...act...
84
+ * expect(snackbars.shown).toEqual([{ type: 'error', message: { key: 'post.failed' } }]);
85
+ */
86
+ declare class FakeSnackbarsThreadService extends SnackbarsThreadService {
87
+ /** Every snackbar shown, oldest first; removing one does not drop it from here. */
88
+ readonly shown: ShownSnackbar[];
89
+ private pendingType;
90
+ show(message: TranslationRequest, type: externalSnackbarTypeAllowed, options?: SnackbarOptions): string;
91
+ addWithId(elem: SnackbarsThreadBase, id: string, timeout?: number): void;
92
+ /** Forgets every snackbar shown so far, e.g. the ones a spec's setup raised. */
93
+ clear(): void;
94
+ static ɵfac: i0.ɵɵFactoryDeclaration<FakeSnackbarsThreadService, never>;
95
+ static ɵprov: i0.ɵɵInjectableDeclaration<FakeSnackbarsThreadService>;
96
+ }
97
+ /**
98
+ * Provides {@link FakeSnackbarsThreadService} in place of {@link SnackbarsThreadService}; inject the fake to read what was shown.
99
+ *
100
+ * @example
101
+ * providers: [provideFakeSnackbars()]
102
+ */
103
+ declare function provideFakeSnackbars(): Provider[];
104
+
105
+ export { FakeConfirmModal, FakeSnackbarsThreadService, provideFakeConfirmModal, provideFakeSnackbars };
106
+ export type { AskedConfirmation, ConfirmModalAnswer, ShownSnackbar, ShownText };
@@ -36,7 +36,7 @@ export { PaginatorButtonComponent, PaginatorComponent } from '@agorapulse/ui-com
36
36
  import * as i17 from '@agorapulse/ui-components/slide-toggle';
37
37
  export { SlideToggleComponent } from '@agorapulse/ui-components/slide-toggle';
38
38
  import * as i18 from '@agorapulse/ui-components/snackbars-thread';
39
- export { SnackbarTypeValues, SnackbarsThreadBase, SnackbarsThreadComponent, SnackbarsThreadService, externalSnackbarTypeAllowed } from '@agorapulse/ui-components/snackbars-thread';
39
+ export { SnackbarOptions, SnackbarTypeValues, SnackbarsThreadBase, SnackbarsThreadComponent, SnackbarsThreadService, externalSnackbarTypeAllowed } from '@agorapulse/ui-components/snackbars-thread';
40
40
  import * as i19 from '@agorapulse/ui-components/tooltip';
41
41
  export { CustomTooltipAvatarItem, CustomTooltipPresentationItem, CustomTooltipType, TooltipDirective, TooltipExternalTriggerDirective } from '@agorapulse/ui-components/tooltip';
42
42
  import * as i20 from '@agorapulse/ui-components/add-comment';