@agorapulse/ui-components 22.9.8-beta.1 → 22.9.9-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.9.9-beta.1.tgz +0 -0
- package/fesm2022/agorapulse-ui-components-filter-dropdown.mjs +3 -4
- package/fesm2022/agorapulse-ui-components-filter-dropdown.mjs.map +1 -1
- package/fesm2022/agorapulse-ui-components-form-message.mjs +8 -12
- package/fesm2022/agorapulse-ui-components-form-message.mjs.map +1 -1
- package/fesm2022/agorapulse-ui-components-i18n.mjs +0 -1
- package/fesm2022/agorapulse-ui-components-i18n.mjs.map +1 -1
- package/fesm2022/agorapulse-ui-components-infobox.mjs +10 -15
- package/fesm2022/agorapulse-ui-components-infobox.mjs.map +1 -1
- package/fesm2022/agorapulse-ui-components-snackbars-thread.mjs +14 -15
- package/fesm2022/agorapulse-ui-components-snackbars-thread.mjs.map +1 -1
- package/fesm2022/agorapulse-ui-components-testing.mjs +157 -0
- package/fesm2022/agorapulse-ui-components-testing.mjs.map +1 -0
- package/fesm2022/agorapulse-ui-components.mjs.map +1 -1
- package/package.json +5 -1
- package/types/agorapulse-ui-components-filter-dropdown.d.ts +1 -1
- package/types/agorapulse-ui-components-form-message.d.ts +2 -8
- package/types/agorapulse-ui-components-i18n.d.ts +0 -1
- package/types/agorapulse-ui-components-infobox.d.ts +6 -14
- package/types/agorapulse-ui-components-snackbars-thread.d.ts +31 -14
- package/types/agorapulse-ui-components-testing.d.ts +97 -0
- package/types/agorapulse-ui-components.d.ts +1 -1
- package/agorapulse-ui-components-22.9.8-beta.1.tgz +0 -0
|
@@ -0,0 +1,157 @@
|
|
|
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 { 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) {
|
|
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
|
+
};
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* A {@link MatDialog} for specs that answers every `ConfirmModalComponent.open` with {@link answer} instead of rendering
|
|
28
|
+
* it, and records the texts of each modal in {@link asked}. Any other component goes to the real dialog. It needs no
|
|
29
|
+
* test runner, so it works under Jest and Vitest alike.
|
|
30
|
+
*
|
|
31
|
+
* @example
|
|
32
|
+
* TestBed.configureTestingModule({ providers: [provideFakeConfirmModal({ answer: false })] });
|
|
33
|
+
* const confirmModal = TestBed.inject(FakeConfirmModal);
|
|
34
|
+
* // ...act...
|
|
35
|
+
* expect(confirmModal.asked).toEqual([{ title: { key: 'post.delete.title' }, message: { key: 'post.delete.message' } }]);
|
|
36
|
+
*/
|
|
37
|
+
class FakeConfirmModal extends MatDialog {
|
|
38
|
+
/** Every confirm modal opened, oldest first. */
|
|
39
|
+
asked = [];
|
|
40
|
+
/** What the next modals answer: `true` confirms, `false` cancels, `undefined` closes without a choice. */
|
|
41
|
+
answer = true;
|
|
42
|
+
open(target, config) {
|
|
43
|
+
if (target !== ConfirmModalComponent) {
|
|
44
|
+
return super.open(target, config);
|
|
45
|
+
}
|
|
46
|
+
const answer = this.answer;
|
|
47
|
+
const ref = {
|
|
48
|
+
componentInstance: {},
|
|
49
|
+
componentRef: {
|
|
50
|
+
setInput: (name, value) => {
|
|
51
|
+
if (name === 'i18n') {
|
|
52
|
+
this.asked.push(askedConfirmation(value));
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
},
|
|
56
|
+
disableClose: true,
|
|
57
|
+
afterClosed: () => of(answer),
|
|
58
|
+
close: () => undefined,
|
|
59
|
+
};
|
|
60
|
+
return ref;
|
|
61
|
+
}
|
|
62
|
+
/** Forgets every modal opened so far. */
|
|
63
|
+
clear() {
|
|
64
|
+
this.asked.length = 0;
|
|
65
|
+
}
|
|
66
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: FakeConfirmModal, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
|
|
67
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: FakeConfirmModal });
|
|
68
|
+
}
|
|
69
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: FakeConfirmModal, decorators: [{
|
|
70
|
+
type: Injectable
|
|
71
|
+
}] });
|
|
72
|
+
/**
|
|
73
|
+
* Provides {@link FakeConfirmModal} in place of {@link MatDialog}; inject the fake to set the answer and read what was asked.
|
|
74
|
+
*
|
|
75
|
+
* @example
|
|
76
|
+
* providers: [provideFakeConfirmModal({ answer: true })]
|
|
77
|
+
*/
|
|
78
|
+
function provideFakeConfirmModal(options = {}) {
|
|
79
|
+
return [
|
|
80
|
+
{
|
|
81
|
+
provide: FakeConfirmModal,
|
|
82
|
+
useFactory: () => {
|
|
83
|
+
const fake = new FakeConfirmModal();
|
|
84
|
+
if ('answer' in options) {
|
|
85
|
+
fake.answer = options.answer;
|
|
86
|
+
}
|
|
87
|
+
return fake;
|
|
88
|
+
},
|
|
89
|
+
},
|
|
90
|
+
{ provide: MatDialog, useExisting: FakeConfirmModal },
|
|
91
|
+
];
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
const DEFAULT_TIMEOUT = 5000;
|
|
95
|
+
const TYPE_OF_INDEX = {
|
|
96
|
+
0: 'info',
|
|
97
|
+
1: 'success',
|
|
98
|
+
3: 'error',
|
|
99
|
+
};
|
|
100
|
+
/**
|
|
101
|
+
* A {@link SnackbarsThreadService} for specs: it records every snackbar in {@link shown}, with its tone and its texts,
|
|
102
|
+
* and never starts a timer. It needs no test runner, so it works under Jest and Vitest alike.
|
|
103
|
+
*
|
|
104
|
+
* @example
|
|
105
|
+
* TestBed.configureTestingModule({ providers: [provideFakeSnackbars()] });
|
|
106
|
+
* const snackbars = TestBed.inject(FakeSnackbarsThreadService);
|
|
107
|
+
* // ...act...
|
|
108
|
+
* expect(snackbars.shown).toEqual([{ type: 'error', message: { key: 'post.failed' } }]);
|
|
109
|
+
*/
|
|
110
|
+
class FakeSnackbarsThreadService extends SnackbarsThreadService {
|
|
111
|
+
/** Every snackbar shown, oldest first; removing one does not drop it from here. */
|
|
112
|
+
shown = [];
|
|
113
|
+
pendingType;
|
|
114
|
+
show(message, type, options) {
|
|
115
|
+
this.pendingType = type;
|
|
116
|
+
return super.show(message, type, options);
|
|
117
|
+
}
|
|
118
|
+
addWithId(elem, id, timeout = DEFAULT_TIMEOUT) {
|
|
119
|
+
const type = this.pendingType ?? TYPE_OF_INDEX[elem.snackbarType];
|
|
120
|
+
this.pendingType = undefined;
|
|
121
|
+
this.shown.push({
|
|
122
|
+
type,
|
|
123
|
+
message: shownText(elem.i18n.message),
|
|
124
|
+
...(elem.i18n.action === undefined ? {} : { action: shownText(elem.i18n.action) }),
|
|
125
|
+
...(elem.navigateInternalUrl === undefined ? {} : { navigateInternalUrl: elem.navigateInternalUrl }),
|
|
126
|
+
...(elem.openUrlInNewTab === undefined ? {} : { openUrlInNewTab: elem.openUrlInNewTab }),
|
|
127
|
+
...(elem.callback === undefined ? {} : { callback: elem.callback }),
|
|
128
|
+
...(timeout === DEFAULT_TIMEOUT ? {} : { timeout }),
|
|
129
|
+
});
|
|
130
|
+
super.addWithId(elem, id, 0);
|
|
131
|
+
}
|
|
132
|
+
/** Forgets every snackbar shown so far, e.g. the ones a spec's setup raised. */
|
|
133
|
+
clear() {
|
|
134
|
+
this.shown.length = 0;
|
|
135
|
+
}
|
|
136
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: FakeSnackbarsThreadService, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
|
|
137
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: FakeSnackbarsThreadService });
|
|
138
|
+
}
|
|
139
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: FakeSnackbarsThreadService, decorators: [{
|
|
140
|
+
type: Injectable
|
|
141
|
+
}] });
|
|
142
|
+
/**
|
|
143
|
+
* Provides {@link FakeSnackbarsThreadService} in place of {@link SnackbarsThreadService}; inject the fake to read what was shown.
|
|
144
|
+
*
|
|
145
|
+
* @example
|
|
146
|
+
* providers: [provideFakeSnackbars()]
|
|
147
|
+
*/
|
|
148
|
+
function provideFakeSnackbars() {
|
|
149
|
+
return [FakeSnackbarsThreadService, { provide: SnackbarsThreadService, useExisting: FakeSnackbarsThreadService }];
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
/**
|
|
153
|
+
* Generated bundle index. Do not edit.
|
|
154
|
+
*/
|
|
155
|
+
|
|
156
|
+
export { FakeConfirmModal, FakeSnackbarsThreadService, provideFakeConfirmModal, provideFakeSnackbars };
|
|
157
|
+
//# 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 } 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}\n\nfunction askedConfirmation(i18n: ConfirmModalTexts['i18n']): 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 };\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: `true` confirms, `false` cancels, `undefined` closes without a choice. */\n answer: boolean | undefined = true;\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 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']));\n }\n },\n },\n disableClose: true,\n afterClosed: () => of(answer),\n close: (): void => undefined,\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?: boolean | undefined } = {}): 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;;ACEA,SAAS,iBAAiB,CAAC,IAA+B,EAAA;IACtD,OAAO;AACH,QAAA,KAAK,EAAE,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC;AAC5B,QAAA,OAAO,EAAE,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC;QAChC,IAAI,IAAI,CAAC,OAAO,KAAK,SAAS,GAAG,EAAE,GAAG,EAAE,OAAO,EAAE,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC;QAC3E,IAAI,IAAI,CAAC,MAAM,KAAK,SAAS,GAAG,EAAE,GAAG,EAAE,MAAM,EAAE,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC;KAC3E;AACL;AAEA;;;;;;;;;;AAUG;AAEG,MAAO,gBAAiB,SAA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ACpG,IAAI,IAAI,CAAC,eAAe,KAAK,SAAS,GAAG,EAAE,GAAG,EAAE,eAAe,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;;YAv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AAE;;;;wBAIP,EAAE,OAAO,EAAE,eAAe,EAAE,QAAQ,EAAE,EAAE,iBAAiB,EAAE,KAAK,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,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,kBAAkB;wBAClB,uBAAuB;wBACvB,uBAAuB;wBACvB,gBAAgB;wBAChB,mBAAmB;wBACnB,yBAAyB;;wBAEzB,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.
|
|
4
|
+
"version": "22.9.9-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
|
-
|
|
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; }; "
|
|
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
|
|
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:
|
|
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:
|
|
35
|
-
static ɵcmp:
|
|
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 {
|
|
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' | '
|
|
13
|
-
type internalSnackbarTypeAllowed = 0 | 1 |
|
|
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,
|
|
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
|
|
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,
|
|
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,
|
|
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,
|
|
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
|
|
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,
|
|
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,97 @@
|
|
|
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
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* A {@link MatDialog} for specs that answers every `ConfirmModalComponent.open` with {@link answer} instead of rendering
|
|
25
|
+
* it, and records the texts of each modal in {@link asked}. Any other component goes to the real dialog. It needs no
|
|
26
|
+
* test runner, so it works under Jest and Vitest alike.
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* TestBed.configureTestingModule({ providers: [provideFakeConfirmModal({ answer: false })] });
|
|
30
|
+
* const confirmModal = TestBed.inject(FakeConfirmModal);
|
|
31
|
+
* // ...act...
|
|
32
|
+
* expect(confirmModal.asked).toEqual([{ title: { key: 'post.delete.title' }, message: { key: 'post.delete.message' } }]);
|
|
33
|
+
*/
|
|
34
|
+
declare class FakeConfirmModal extends MatDialog {
|
|
35
|
+
/** Every confirm modal opened, oldest first. */
|
|
36
|
+
readonly asked: AskedConfirmation[];
|
|
37
|
+
/** What the next modals answer: `true` confirms, `false` cancels, `undefined` closes without a choice. */
|
|
38
|
+
answer: boolean | undefined;
|
|
39
|
+
open<T, D = unknown, R = unknown>(component: ComponentType<T>, config?: MatDialogConfig<D>): MatDialogRef<T, R>;
|
|
40
|
+
open<T, D = unknown, R = unknown>(template: TemplateRef<T>, config?: MatDialogConfig<D>): MatDialogRef<T, R>;
|
|
41
|
+
/** Forgets every modal opened so far. */
|
|
42
|
+
clear(): void;
|
|
43
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<FakeConfirmModal, never>;
|
|
44
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<FakeConfirmModal>;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Provides {@link FakeConfirmModal} in place of {@link MatDialog}; inject the fake to set the answer and read what was asked.
|
|
48
|
+
*
|
|
49
|
+
* @example
|
|
50
|
+
* providers: [provideFakeConfirmModal({ answer: true })]
|
|
51
|
+
*/
|
|
52
|
+
declare function provideFakeConfirmModal(options?: {
|
|
53
|
+
answer?: boolean | undefined;
|
|
54
|
+
}): Provider[];
|
|
55
|
+
|
|
56
|
+
/** One snackbar the code under test showed. */
|
|
57
|
+
interface ShownSnackbar {
|
|
58
|
+
type: externalSnackbarTypeAllowed;
|
|
59
|
+
message: ShownText;
|
|
60
|
+
action?: ShownText;
|
|
61
|
+
navigateInternalUrl?: string;
|
|
62
|
+
openUrlInNewTab?: boolean;
|
|
63
|
+
callback?: () => void;
|
|
64
|
+
/** Present only when it differs from the service's default of 5000 ms; 0 keeps the snackbar open. */
|
|
65
|
+
timeout?: number;
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* A {@link SnackbarsThreadService} for specs: it records every snackbar in {@link shown}, with its tone and its texts,
|
|
69
|
+
* and never starts a timer. It needs no test runner, so it works under Jest and Vitest alike.
|
|
70
|
+
*
|
|
71
|
+
* @example
|
|
72
|
+
* TestBed.configureTestingModule({ providers: [provideFakeSnackbars()] });
|
|
73
|
+
* const snackbars = TestBed.inject(FakeSnackbarsThreadService);
|
|
74
|
+
* // ...act...
|
|
75
|
+
* expect(snackbars.shown).toEqual([{ type: 'error', message: { key: 'post.failed' } }]);
|
|
76
|
+
*/
|
|
77
|
+
declare class FakeSnackbarsThreadService extends SnackbarsThreadService {
|
|
78
|
+
/** Every snackbar shown, oldest first; removing one does not drop it from here. */
|
|
79
|
+
readonly shown: ShownSnackbar[];
|
|
80
|
+
private pendingType;
|
|
81
|
+
show(message: TranslationRequest, type: externalSnackbarTypeAllowed, options?: SnackbarOptions): string;
|
|
82
|
+
addWithId(elem: SnackbarsThreadBase, id: string, timeout?: number): void;
|
|
83
|
+
/** Forgets every snackbar shown so far, e.g. the ones a spec's setup raised. */
|
|
84
|
+
clear(): void;
|
|
85
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<FakeSnackbarsThreadService, never>;
|
|
86
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<FakeSnackbarsThreadService>;
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Provides {@link FakeSnackbarsThreadService} in place of {@link SnackbarsThreadService}; inject the fake to read what was shown.
|
|
90
|
+
*
|
|
91
|
+
* @example
|
|
92
|
+
* providers: [provideFakeSnackbars()]
|
|
93
|
+
*/
|
|
94
|
+
declare function provideFakeSnackbars(): Provider[];
|
|
95
|
+
|
|
96
|
+
export { FakeConfirmModal, FakeSnackbarsThreadService, provideFakeConfirmModal, provideFakeSnackbars };
|
|
97
|
+
export type { AskedConfirmation, 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';
|
|
Binary file
|