@agorapulse/ui-components 22.9.2 → 22.9.4-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.4-beta.1.tgz +0 -0
- package/fesm2022/agorapulse-ui-components-confirm-modal.mjs +19 -21
- package/fesm2022/agorapulse-ui-components-confirm-modal.mjs.map +1 -1
- package/fesm2022/agorapulse-ui-components-directives.mjs +3 -17
- package/fesm2022/agorapulse-ui-components-directives.mjs.map +1 -1
- package/fesm2022/agorapulse-ui-components-filter-dropdown.mjs +1 -1
- package/fesm2022/agorapulse-ui-components-filter-dropdown.mjs.map +1 -1
- package/fesm2022/agorapulse-ui-components-i18n.mjs +8 -0
- package/fesm2022/agorapulse-ui-components-i18n.mjs.map +1 -1
- package/fesm2022/agorapulse-ui-components-snackbars-thread.mjs +100 -93
- package/fesm2022/agorapulse-ui-components-snackbars-thread.mjs.map +1 -1
- package/fesm2022/agorapulse-ui-components-testing.mjs +75 -0
- package/fesm2022/agorapulse-ui-components-testing.mjs.map +1 -0
- package/fesm2022/agorapulse-ui-components-toggle.mjs +15 -19
- package/fesm2022/agorapulse-ui-components-toggle.mjs.map +1 -1
- package/fesm2022/agorapulse-ui-components.mjs +1 -1
- package/fesm2022/agorapulse-ui-components.mjs.map +1 -1
- package/package.json +5 -1
- package/types/agorapulse-ui-components-confirm-modal.d.ts +16 -11
- package/types/agorapulse-ui-components-directives.d.ts +1 -7
- package/types/agorapulse-ui-components-i18n.d.ts +8 -0
- package/types/agorapulse-ui-components-snackbars-thread.d.ts +71 -23
- package/types/agorapulse-ui-components-testing.d.ts +51 -0
- package/types/agorapulse-ui-components-toggle.d.ts +4 -5
- package/types/agorapulse-ui-components.d.ts +1 -1
- package/agorapulse-ui-components-22.9.2.tgz +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agorapulse-ui-components-testing.mjs","sources":["../../../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';\nimport { externalSnackbarTypeAllowed, SnackbarsThreadBase, SnackbarsThreadService } from '@agorapulse/ui-components/snackbars-thread';\nimport { Injectable, Provider } from '@angular/core';\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\n/** One snackbar the code under test showed. */\nexport interface ShownSnackbar {\n type: externalSnackbarTypeAllowed;\n message: ShownText;\n action?: ShownText;\n navigateInternalUrl?: string;\n callback?: () => void;\n}\n\nconst TYPE_OF_INDEX: Record<SnackbarsThreadBase['snackbarType'], externalSnackbarTypeAllowed> = {\n 0: 'info',\n 1: 'success',\n 2: 'warning',\n 3: 'error',\n};\n\nfunction 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\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, timeout?: number): string {\n this.pendingType = type;\n return super.show(message, type, timeout);\n }\n\n override addWithId(elem: SnackbarsThreadBase, id: string, _timeout?: number): 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.callback === undefined ? {} : { callback: elem.callback }),\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":";;;;AAgBA,MAAM,aAAa,GAA6E;AAC5F,IAAA,CAAC,EAAE,MAAM;AACT,IAAA,CAAC,EAAE,SAAS;AACZ,IAAA,CAAC,EAAE,SAAS;AACZ,IAAA,CAAC,EAAE,OAAO;CACb;AAED,SAAS,SAAS,CAAC,OAA2B,EAAA;AAC1C,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;AAEA;;;;;;;;;AASG;AAEG,MAAO,0BAA2B,SAAQ,sBAAsB,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AA;;2FAA1B,0BAA0B,EAAA,UAAA,EAAA,CAAA;kBADtC;;AA+BD;;;;;AAKG;SACa,oBAAoB,GAAA;AAChC,IAAA,OAAO,CAAC,0BAA0B,EAAE,EAAE,OAAO,EAAE,sBAAsB,EAAE,WAAW,EAAE,0BAA0B,EAAE,CAAC;AACrH;;AClFA;;AAEG;;;;"}
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { ConfirmModalComponent } from '@agorapulse/ui-components/confirm-modal';
|
|
2
2
|
import { SymbolRegistry, apCheck, apClose, SymbolComponent } from '@agorapulse/ui-symbol';
|
|
3
3
|
import * as i0 from '@angular/core';
|
|
4
|
-
import { forwardRef, inject, ChangeDetectorRef, EventEmitter, booleanAttribute, Output, Input, ViewChild, ViewEncapsulation, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
4
|
+
import { forwardRef, inject, ChangeDetectorRef, input, EventEmitter, booleanAttribute, Output, Input, ViewChild, ViewEncapsulation, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
5
5
|
import { NG_VALUE_ACCESSOR, NG_VALIDATORS } from '@angular/forms';
|
|
6
6
|
import { MatDialog } from '@angular/material/dialog';
|
|
7
7
|
import { first } from 'rxjs/operators';
|
|
8
8
|
|
|
9
|
+
const CONFIRM_TITLE_KEY = 'ui-components.toggle.confirm-title';
|
|
10
|
+
const CONFIRM_MESSAGE_KEY = 'ui-components.toggle.confirm-message';
|
|
9
11
|
const AP_CHECKBOX_CONTROL_VALUE_ACCESSOR = {
|
|
10
12
|
provide: NG_VALUE_ACCESSOR,
|
|
11
13
|
useExisting: forwardRef(() => ToggleComponent),
|
|
@@ -25,10 +27,9 @@ class ToggleComponent {
|
|
|
25
27
|
checked = false;
|
|
26
28
|
required = false;
|
|
27
29
|
confirm = false;
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
confirmTitle = 'Are you sure?';
|
|
30
|
+
/** Texts of the confirmation shown when `confirm` is set; the title and message default to the DS texts, the buttons to the confirm modal's. */
|
|
31
|
+
i18n = input({}, /* @ts-ignore */
|
|
32
|
+
...(ngDevMode ? [{ debugName: "i18n" }] : /* istanbul ignore next */ []));
|
|
32
33
|
set name(name) {
|
|
33
34
|
if (!name.endsWith('Checkbox')) {
|
|
34
35
|
this._name = name + 'Checkbox';
|
|
@@ -68,13 +69,16 @@ class ToggleComponent {
|
|
|
68
69
|
this.changeValue();
|
|
69
70
|
}
|
|
70
71
|
else {
|
|
72
|
+
const i18n = this.i18n();
|
|
71
73
|
const toggleConfirmModal = {
|
|
72
|
-
contentText: this.confirmMessage,
|
|
73
|
-
headerTitle: this.confirmTitle,
|
|
74
|
-
footerCancelButtonLabel: this.confirmCancel,
|
|
75
|
-
footerConfirmButtonLabel: this.confirmOk,
|
|
76
74
|
footerConfirmButtonId: 'confirm',
|
|
77
75
|
footerCancelButtonId: 'cancel',
|
|
76
|
+
i18n: {
|
|
77
|
+
title: i18n.confirmTitle ?? CONFIRM_TITLE_KEY,
|
|
78
|
+
message: i18n.confirmMessage ?? CONFIRM_MESSAGE_KEY,
|
|
79
|
+
confirm: i18n.confirm,
|
|
80
|
+
cancel: i18n.cancel,
|
|
81
|
+
},
|
|
78
82
|
};
|
|
79
83
|
const modalConfig = {
|
|
80
84
|
matDialogConfig: {
|
|
@@ -139,7 +143,7 @@ class ToggleComponent {
|
|
|
139
143
|
}
|
|
140
144
|
}
|
|
141
145
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: ToggleComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
142
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "
|
|
146
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.0.5", type: ToggleComponent, isStandalone: true, selector: "ap-toggle", inputs: { ariaLabel: { classPropertyName: "ariaLabel", publicName: "aria-label", isSignal: false, isRequired: false, transformFunction: null }, ariaLabelledby: { classPropertyName: "ariaLabelledby", publicName: "aria-labelledby", isSignal: false, isRequired: false, transformFunction: null }, ariaDescribedby: { classPropertyName: "ariaDescribedby", publicName: "aria-describedby", isSignal: false, isRequired: false, transformFunction: null }, labelPosition: { classPropertyName: "labelPosition", publicName: "labelPosition", isSignal: false, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: false, isRequired: false, transformFunction: booleanAttribute }, checked: { classPropertyName: "checked", publicName: "checked", isSignal: false, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: false, isRequired: false, transformFunction: booleanAttribute }, confirm: { classPropertyName: "confirm", publicName: "confirm", isSignal: false, isRequired: false, transformFunction: null }, i18n: { classPropertyName: "i18n", publicName: "i18n", isSignal: true, isRequired: false, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: false, isRequired: true, transformFunction: null } }, outputs: { change: "change" }, providers: [
|
|
143
147
|
AP_CHECKBOX_CONTROL_VALUE_ACCESSOR,
|
|
144
148
|
{
|
|
145
149
|
provide: NG_VALIDATORS,
|
|
@@ -191,15 +195,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
|
|
|
191
195
|
}]
|
|
192
196
|
}], confirm: [{
|
|
193
197
|
type: Input
|
|
194
|
-
}],
|
|
195
|
-
type: Input
|
|
196
|
-
}], confirmOk: [{
|
|
197
|
-
type: Input
|
|
198
|
-
}], confirmCancel: [{
|
|
199
|
-
type: Input
|
|
200
|
-
}], confirmTitle: [{
|
|
201
|
-
type: Input
|
|
202
|
-
}], name: [{
|
|
198
|
+
}], i18n: [{ type: i0.Input, args: [{ isSignal: true, alias: "i18n", required: false }] }], name: [{
|
|
203
199
|
type: Input,
|
|
204
200
|
args: [{
|
|
205
201
|
required: true,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agorapulse-ui-components-toggle.mjs","sources":["../../../libs/ui-components/toggle/src/toggle.component.ts","../../../libs/ui-components/toggle/src/toggle.component.html","../../../libs/ui-components/toggle/src/agorapulse-ui-components-toggle.ts"],"sourcesContent":["import { ConfirmModalComponent } from '@agorapulse/ui-components/confirm-modal';\nimport { apCheck, apClose, SymbolComponent, SymbolRegistry } from '@agorapulse/ui-symbol';\nimport {\n AfterContentInit,\n booleanAttribute,\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n ElementRef,\n EventEmitter,\n forwardRef,\n inject,\n Input,\n OnChanges,\n OnInit,\n Output,\n ViewChild,\n ViewEncapsulation,\n} from '@angular/core';\nimport { ControlValueAccessor, FormControl, NG_VALIDATORS, NG_VALUE_ACCESSOR } from '@angular/forms';\nimport { MatDialog } from '@angular/material/dialog';\nimport { first } from 'rxjs/operators';\n\nexport const AP_CHECKBOX_CONTROL_VALUE_ACCESSOR = {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => ToggleComponent),\n multi: true,\n};\n\n@Component({\n changeDetection: ChangeDetectionStrategy.OnPush,\n selector: 'ap-toggle',\n styleUrls: ['./toggle.component.scss'],\n imports: [SymbolComponent],\n providers: [\n AP_CHECKBOX_CONTROL_VALUE_ACCESSOR,\n {\n provide: NG_VALIDATORS,\n useExisting: ToggleComponent,\n multi: true,\n },\n MatDialog,\n ],\n templateUrl: './toggle.component.html',\n encapsulation: ViewEncapsulation.None,\n})\nexport class ToggleComponent implements ControlValueAccessor, AfterContentInit, OnChanges, OnInit {\n private readonly symbolRegistry = inject(SymbolRegistry);\n private readonly dialog = inject(MatDialog);\n private readonly cdr = inject(ChangeDetectorRef);\n\n @ViewChild('input') inputElement!: ElementRef<HTMLInputElement>;\n @ViewChild('label') labelElement!: ElementRef<HTMLInputElement>;\n @Input('aria-label') ariaLabel: string = '';\n @Input('aria-labelledby') ariaLabelledby: string | null = null;\n @Input('aria-describedby') ariaDescribedby: string | null = null;\n @Input() labelPosition: 'left' | 'right' = 'right';\n @Input({\n transform: booleanAttribute,\n })\n disabled = false;\n @Input() checked = false;\n @Input({\n transform: booleanAttribute,\n })\n required = false;\n @Input() confirm = false;\n @Input() confirmMessage = 'If you toggle this, it will affect other things. Are you sure';\n @Input() confirmOk = 'Confirm';\n @Input() confirmCancel = 'Cancel';\n @Input() confirmTitle = 'Are you sure?';\n @Input({\n required: true,\n })\n set name(name: string) {\n if (!name.endsWith('Checkbox')) {\n this._name = name + 'Checkbox';\n } else {\n this._name = name;\n }\n }\n get name(): string {\n return this._name;\n }\n // eslint-disable-next-line\n @Output() readonly change: EventEmitter<boolean> = new EventEmitter<boolean>();\n\n hasLabel: boolean = false;\n private _name = '';\n private _controlValueAccessorChangeFn!: (value: boolean) => void;\n onTouched!: () => void;\n\n ngOnChanges(): void {\n if (this.labelElement) {\n this.hasLabel = !!this.labelElement.nativeElement.textContent?.trim();\n }\n }\n\n ngOnInit() {\n this.symbolRegistry.registerSymbols([apCheck, apClose]);\n }\n\n ngAfterContentInit(): void {\n if (this.labelElement) {\n this.hasLabel = !!this.labelElement.nativeElement.textContent?.trim();\n }\n }\n\n onValueChange() {\n if (!this.disabled) {\n if (!this.confirm) {\n if (this.onTouched) {\n this.onTouched();\n }\n this.changeValue();\n } else {\n const toggleConfirmModal = {\n contentText: this.confirmMessage,\n headerTitle: this.confirmTitle,\n footerCancelButtonLabel: this.confirmCancel,\n footerConfirmButtonLabel: this.confirmOk,\n footerConfirmButtonId: 'confirm',\n footerCancelButtonId: 'cancel',\n };\n const modalConfig = {\n matDialogConfig: {\n panelClass: 'design-system',\n width: '550px',\n },\n };\n\n const dialogRef = ConfirmModalComponent.open(this.dialog, toggleConfirmModal, modalConfig);\n dialogRef\n .afterClosed()\n .pipe(first())\n .subscribe(result => {\n if (result) {\n if (this.onTouched) {\n this.onTouched();\n }\n this.changeValue();\n }\n });\n }\n }\n }\n\n changeValue(): void {\n this.checked = !this.checked;\n this.focus();\n this.change.emit(this.checked);\n if (this._controlValueAccessorChangeFn) {\n this._controlValueAccessorChangeFn(this.checked);\n }\n\n // Assigning the value again here is redundant, but we have to do it in case it was\n // changed inside the `change` listener which will cause the input to be out of sync.\n if (this.inputElement) {\n this.inputElement.nativeElement.checked = this.checked;\n }\n this.cdr.markForCheck();\n }\n\n focus() {\n this.inputElement.nativeElement.focus();\n }\n\n writeValue(value: boolean): void {\n this.checked = value;\n this.cdr.markForCheck();\n }\n registerOnChange(fn: (value: boolean) => void): void {\n this._controlValueAccessorChangeFn = fn;\n }\n registerOnTouched(fn: () => void): void {\n this.onTouched = fn;\n }\n setDisabledState(isDisabled: boolean): void {\n this.disabled = isDisabled;\n }\n\n validate({ value }: FormControl) {\n return (\n this.required &&\n !value && {\n invalid: true,\n }\n );\n }\n\n _preventBubblingFromLabel(event: MouseEvent) {\n if (!!event.target && this.labelElement.nativeElement.contains(event.target as HTMLElement)) {\n event.stopPropagation();\n }\n }\n}\n","<div\n class=\"toggle\"\n (click)=\"_preventBubblingFromLabel($event)\">\n <input\n #input\n class=\"hidden\"\n type=\"checkbox\"\n role=\"switch\"\n [id]=\"name\"\n [name]=\"name\"\n [checked]=\"checked\"\n [required]=\"required\"\n [disabled]=\"disabled\"\n [attr.data-test]=\"name\"\n [attr.aria-labelledby]=\"ariaLabelledby\"\n [attr.aria-describedby]=\"ariaDescribedby\"\n [attr.aria-checked]=\"checked\"\n [class.checked]=\"checked\"\n (click)=\"onValueChange()\"\n (change)=\"$event.stopPropagation()\" />\n <div\n class=\"switch-container\"\n [class.label-left]=\"labelPosition === 'left'\">\n <div\n class=\"switch\"\n [class.checked]=\"checked\"\n [class.disabled]=\"disabled\"\n (click)=\"onValueChange()\">\n <div class=\"knob\">\n <ap-symbol\n [class.checked]=\"checked\"\n [symbolId]=\"checked ? 'check' : 'close'\" />\n </div>\n </div>\n <label\n #label\n [class.disabled]=\"disabled\"\n [for]=\"name\">\n <ng-content />\n </label>\n </div>\n</div>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;;;AAuBO,MAAM,kCAAkC,GAAG;AAC9C,IAAA,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AA;;sBAEA;;sBACA;;sBACA;;sBACA;;sBACA;;sBACA,KAAK;AAAC,gBAAA,IAAA,EAAA,CAAA;AACH,wBAAA,QAAQ,EAAE,IAAI;AACjB,qBAAA;;sBAYA;;;AErFL;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"agorapulse-ui-components-toggle.mjs","sources":["../../../libs/ui-components/toggle/src/toggle.component.ts","../../../libs/ui-components/toggle/src/toggle.component.html","../../../libs/ui-components/toggle/src/agorapulse-ui-components-toggle.ts"],"sourcesContent":["import { ConfirmModalComponent } from '@agorapulse/ui-components/confirm-modal';\nimport { DefaultTextKey, I18nOf } from '@agorapulse/ui-components/i18n';\nimport { apCheck, apClose, SymbolComponent, SymbolRegistry } from '@agorapulse/ui-symbol';\nimport {\n AfterContentInit,\n booleanAttribute,\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n ElementRef,\n EventEmitter,\n forwardRef,\n inject,\n input,\n Input,\n OnChanges,\n OnInit,\n Output,\n ViewChild,\n ViewEncapsulation,\n} from '@angular/core';\nimport { ControlValueAccessor, FormControl, NG_VALIDATORS, NG_VALUE_ACCESSOR } from '@angular/forms';\nimport { MatDialog } from '@angular/material/dialog';\nimport { first } from 'rxjs/operators';\n\nconst CONFIRM_TITLE_KEY: DefaultTextKey = 'ui-components.toggle.confirm-title';\nconst CONFIRM_MESSAGE_KEY: DefaultTextKey = 'ui-components.toggle.confirm-message';\n\nexport const AP_CHECKBOX_CONTROL_VALUE_ACCESSOR = {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => ToggleComponent),\n multi: true,\n};\n\n@Component({\n changeDetection: ChangeDetectionStrategy.OnPush,\n selector: 'ap-toggle',\n styleUrls: ['./toggle.component.scss'],\n imports: [SymbolComponent],\n providers: [\n AP_CHECKBOX_CONTROL_VALUE_ACCESSOR,\n {\n provide: NG_VALIDATORS,\n useExisting: ToggleComponent,\n multi: true,\n },\n MatDialog,\n ],\n templateUrl: './toggle.component.html',\n encapsulation: ViewEncapsulation.None,\n})\nexport class ToggleComponent implements ControlValueAccessor, AfterContentInit, OnChanges, OnInit {\n private readonly symbolRegistry = inject(SymbolRegistry);\n private readonly dialog = inject(MatDialog);\n private readonly cdr = inject(ChangeDetectorRef);\n\n @ViewChild('input') inputElement!: ElementRef<HTMLInputElement>;\n @ViewChild('label') labelElement!: ElementRef<HTMLInputElement>;\n @Input('aria-label') ariaLabel: string = '';\n @Input('aria-labelledby') ariaLabelledby: string | null = null;\n @Input('aria-describedby') ariaDescribedby: string | null = null;\n @Input() labelPosition: 'left' | 'right' = 'right';\n @Input({\n transform: booleanAttribute,\n })\n disabled = false;\n @Input() checked = false;\n @Input({\n transform: booleanAttribute,\n })\n required = false;\n @Input() confirm = false;\n\n /** Texts of the confirmation shown when `confirm` is set; the title and message default to the DS texts, the buttons to the confirm modal's. */\n readonly i18n = input<I18nOf<never, 'confirmTitle' | 'confirmMessage' | 'confirm' | 'cancel'>>({});\n\n @Input({\n required: true,\n })\n set name(name: string) {\n if (!name.endsWith('Checkbox')) {\n this._name = name + 'Checkbox';\n } else {\n this._name = name;\n }\n }\n get name(): string {\n return this._name;\n }\n // eslint-disable-next-line\n @Output() readonly change: EventEmitter<boolean> = new EventEmitter<boolean>();\n\n hasLabel: boolean = false;\n private _name = '';\n private _controlValueAccessorChangeFn!: (value: boolean) => void;\n onTouched!: () => void;\n\n ngOnChanges(): void {\n if (this.labelElement) {\n this.hasLabel = !!this.labelElement.nativeElement.textContent?.trim();\n }\n }\n\n ngOnInit() {\n this.symbolRegistry.registerSymbols([apCheck, apClose]);\n }\n\n ngAfterContentInit(): void {\n if (this.labelElement) {\n this.hasLabel = !!this.labelElement.nativeElement.textContent?.trim();\n }\n }\n\n onValueChange() {\n if (!this.disabled) {\n if (!this.confirm) {\n if (this.onTouched) {\n this.onTouched();\n }\n this.changeValue();\n } else {\n const i18n = this.i18n();\n const toggleConfirmModal = {\n footerConfirmButtonId: 'confirm',\n footerCancelButtonId: 'cancel',\n i18n: {\n title: i18n.confirmTitle ?? CONFIRM_TITLE_KEY,\n message: i18n.confirmMessage ?? CONFIRM_MESSAGE_KEY,\n confirm: i18n.confirm,\n cancel: i18n.cancel,\n },\n };\n const modalConfig = {\n matDialogConfig: {\n panelClass: 'design-system',\n width: '550px',\n },\n };\n\n const dialogRef = ConfirmModalComponent.open(this.dialog, toggleConfirmModal, modalConfig);\n dialogRef\n .afterClosed()\n .pipe(first())\n .subscribe(result => {\n if (result) {\n if (this.onTouched) {\n this.onTouched();\n }\n this.changeValue();\n }\n });\n }\n }\n }\n\n changeValue(): void {\n this.checked = !this.checked;\n this.focus();\n this.change.emit(this.checked);\n if (this._controlValueAccessorChangeFn) {\n this._controlValueAccessorChangeFn(this.checked);\n }\n\n // Assigning the value again here is redundant, but we have to do it in case it was\n // changed inside the `change` listener which will cause the input to be out of sync.\n if (this.inputElement) {\n this.inputElement.nativeElement.checked = this.checked;\n }\n this.cdr.markForCheck();\n }\n\n focus() {\n this.inputElement.nativeElement.focus();\n }\n\n writeValue(value: boolean): void {\n this.checked = value;\n this.cdr.markForCheck();\n }\n registerOnChange(fn: (value: boolean) => void): void {\n this._controlValueAccessorChangeFn = fn;\n }\n registerOnTouched(fn: () => void): void {\n this.onTouched = fn;\n }\n setDisabledState(isDisabled: boolean): void {\n this.disabled = isDisabled;\n }\n\n validate({ value }: FormControl) {\n return (\n this.required &&\n !value && {\n invalid: true,\n }\n );\n }\n\n _preventBubblingFromLabel(event: MouseEvent) {\n if (!!event.target && this.labelElement.nativeElement.contains(event.target as HTMLElement)) {\n event.stopPropagation();\n }\n }\n}\n","<div\n class=\"toggle\"\n (click)=\"_preventBubblingFromLabel($event)\">\n <input\n #input\n class=\"hidden\"\n type=\"checkbox\"\n role=\"switch\"\n [id]=\"name\"\n [name]=\"name\"\n [checked]=\"checked\"\n [required]=\"required\"\n [disabled]=\"disabled\"\n [attr.data-test]=\"name\"\n [attr.aria-labelledby]=\"ariaLabelledby\"\n [attr.aria-describedby]=\"ariaDescribedby\"\n [attr.aria-checked]=\"checked\"\n [class.checked]=\"checked\"\n (click)=\"onValueChange()\"\n (change)=\"$event.stopPropagation()\" />\n <div\n class=\"switch-container\"\n [class.label-left]=\"labelPosition === 'left'\">\n <div\n class=\"switch\"\n [class.checked]=\"checked\"\n [class.disabled]=\"disabled\"\n (click)=\"onValueChange()\">\n <div class=\"knob\">\n <ap-symbol\n [class.checked]=\"checked\"\n [symbolId]=\"checked ? 'check' : 'close'\" />\n </div>\n </div>\n <label\n #label\n [class.disabled]=\"disabled\"\n [for]=\"name\">\n <ng-content />\n </label>\n </div>\n</div>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;;;AAyBA,MAAM,iBAAiB,GAAmB,oCAAoC;AAC9E,MAAM,mBAAmB,GAAmB,sCAAsC;AAE3E,MAAM,kCAAkC,GAAG;AAC9C,IAAA,OAAO,EAAE,iBAAiB;AAC1B,IAAA,WAAW,EAAE,UAAU,CAAC,MAAM,eAAe,CAAC;AAC9C,IAAA,KAAK,EAAE,IAAI;;MAoBF,eAAe,CAAA;AACP,IAAA,cAAc,GAAG,MAAM,CAAC,cAAc,CAAC;AACvC,IAAA,MAAM,GAAG,MAAM,CAAC,SAAS,CAAC;AAC1B,IAAA,GAAG,GAAG,MAAM,CAAC,iBAAiB,CAAC;AAE5B,IAAA,YAAY;AACZ,IAAA,YAAY;IACX,SAAS,GAAW,EAAE;IACjB,cAAc,GAAkB,IAAI;IACnC,eAAe,GAAkB,IAAI;IACvD,aAAa,GAAqB,OAAO;IAIlD,QAAQ,GAAG,KAAK;IACP,OAAO,GAAG,KAAK;IAIxB,QAAQ,GAAG,KAAK;IACP,OAAO,GAAG,KAAK;;IAGf,IAAI,GAAG,KAAK,CAA0E,EAAE;6EAAC;IAElG,IAGI,IAAI,CAAC,IAAY,EAAA;QACjB,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,EAAE;AAC5B,YAAA,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AC,IAAI,EAAA,QAAA,EAAA,mxCAAA,EAAA,MAAA,EAAA,CAAA,q2GAAA,CAAA,EAAA;;sBAOpC,SAAS;uBAAC,OAAO;;sBACjB,SAAS;uBAAC,OAAO;;sBACjB,KAAK;uBAAC,YAAY;;sBAClB,KAAK;uBAAC,iBAAiB;;sBACvB,KAAK;uBAAC,kBAAkB;;sBACxB;;sBACA,KAAK;AAAC,gBAAA,IAAA,EAAA,CAAA;AACH,wBAAA,SAAS,EAAE,gBAAgB;AAC9B,qBAAA;;sBAEA;;sBACA,KAAK;AAAC,gBAAA,IAAA,EAAA,CAAA;AACH,wBAAA,SAAS,EAAE,gBAAgB;AAC9B,qBAAA;;sBAEA;;sBAKA,KAAK;AAAC,gBAAA,IAAA,EAAA,CAAA;AACH,wBAAA,QAAQ,EAAE,IAAI;AACjB,qBAAA;;sBAYA;;;AE1FL;;AAEG;;;;"}
|
|
@@ -35,7 +35,7 @@ export { PasswordInputComponent } from '@agorapulse/ui-components/password-input
|
|
|
35
35
|
import { SlideToggleComponent } from '@agorapulse/ui-components/slide-toggle';
|
|
36
36
|
export { SlideToggleComponent } from '@agorapulse/ui-components/slide-toggle';
|
|
37
37
|
import { SnackbarsThreadComponent } from '@agorapulse/ui-components/snackbars-thread';
|
|
38
|
-
export {
|
|
38
|
+
export { SnackbarTypeValues, SnackbarsThreadComponent, SnackbarsThreadService } from '@agorapulse/ui-components/snackbars-thread';
|
|
39
39
|
import { StepperComponent } from '@agorapulse/ui-components/stepper';
|
|
40
40
|
export { StepperComponent } from '@agorapulse/ui-components/stepper';
|
|
41
41
|
import { TooltipDirective } from '@agorapulse/ui-components/tooltip';
|
|
@@ -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 {\n CodeStatus,\n SnackbarTypeValues,\n SnackbarsThreadBase,\n externalSnackbarTypeAllowed,\n generateCodeStatus,\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":";;;;;;;;;;;;;;;;;;;;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AAuB;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;;;;"}
|
|
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;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,e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;wBAChB,qBAAqB;wBACrB,uBAAuB;wBACvB,sBAAsB;wBACtB,kCAAkC;wBAClC,cAAc;wBACd,sBAAsB;wBACtB,cAAc;wBACd,qBAAqB;wBACrB,kBAAkB;wBAClB,wBAAwB;wBACxB,oBAAoB;wBACpB,wBAAwB;;wBAExB,qBAAqB;wBACrB,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.4-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"
|
|
@@ -1,30 +1,35 @@
|
|
|
1
|
+
import * as _agorapulse_ui_components_i18n from '@agorapulse/ui-components/i18n';
|
|
2
|
+
import { I18nOf } from '@agorapulse/ui-components/i18n';
|
|
3
|
+
import * as _angular_core from '@angular/core';
|
|
1
4
|
import { ModalConfig } from '@agorapulse/ui-components/modal';
|
|
2
5
|
import { MatDialogRef, MatDialog } from '@angular/material/dialog';
|
|
3
|
-
import * as i0 from '@angular/core';
|
|
4
6
|
|
|
5
7
|
interface ConfirmModalTexts {
|
|
6
8
|
footerConfirmButtonId: string | 'confirm';
|
|
7
|
-
footerConfirmButtonLabel: string;
|
|
8
|
-
contentText: string;
|
|
9
9
|
footerCancelButtonId: string | 'cancel';
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
/** `title` and `message` are required; `confirm` defaults to “OK”, `cancel` to “Cancel”. Rendered as text. */
|
|
11
|
+
i18n: I18nOf<'title' | 'message', 'confirm' | 'cancel'>;
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
declare class ConfirmModalComponent {
|
|
15
15
|
dialogRef: MatDialogRef<ConfirmModalComponent, boolean>;
|
|
16
|
-
contentText: string;
|
|
17
16
|
footerCancelButtonId: string;
|
|
18
|
-
footerCancelButtonLabel: string;
|
|
19
17
|
footerConfirmButtonId: string;
|
|
20
|
-
|
|
21
|
-
|
|
18
|
+
/** Texts of the modal, rendered as text; see {@link ConfirmModalTexts} for the required roles and defaults. */
|
|
19
|
+
readonly i18n: _angular_core.InputSignal<_agorapulse_ui_components_i18n.I18nOf<"title" | "message", "cancel" | "confirm">>;
|
|
20
|
+
private readonly resolveTexts;
|
|
21
|
+
protected readonly texts: _angular_core.Signal<{
|
|
22
|
+
readonly title: string | undefined;
|
|
23
|
+
readonly message: string | undefined;
|
|
24
|
+
readonly confirm: string;
|
|
25
|
+
readonly cancel: string;
|
|
26
|
+
}>;
|
|
22
27
|
constructor(dialogRef: MatDialogRef<ConfirmModalComponent, boolean>);
|
|
23
28
|
onCancel(): void;
|
|
24
29
|
onConfirm(): void;
|
|
25
30
|
static open(dialog: MatDialog, confirmModalTexts: ConfirmModalTexts, modalConfig?: ModalConfig | null): MatDialogRef<ConfirmModalComponent, boolean>;
|
|
26
|
-
static ɵfac:
|
|
27
|
-
static ɵcmp:
|
|
31
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<ConfirmModalComponent, never>;
|
|
32
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<ConfirmModalComponent, "ap-confirm-modal", never, { "footerCancelButtonId": { "alias": "footerCancelButtonId"; "required": false; }; "footerConfirmButtonId": { "alias": "footerConfirmButtonId"; "required": false; }; "i18n": { "alias": "i18n"; "required": true; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
28
33
|
}
|
|
29
34
|
|
|
30
35
|
export { ConfirmModalComponent };
|
|
@@ -72,20 +72,14 @@ declare class CheckboxDirective implements OnInit, OnDestroy {
|
|
|
72
72
|
* ```
|
|
73
73
|
*/
|
|
74
74
|
declare class ClickDirective {
|
|
75
|
-
/**
|
|
76
|
-
* Turns the host back into a plain element: no role, no tab stop, no activation at all.
|
|
77
|
-
* A host disabled while it holds focus keeps `tabindex="-1"` until focus leaves it, so the
|
|
78
|
-
* browser does not drop focus to `<body>` (a disclosure that disables itself once open).
|
|
79
|
-
*/
|
|
75
|
+
/** Turns the host back into a plain element: no role, no tab stop, no activation at all. */
|
|
80
76
|
apClickDisabled: i0.InputSignalWithTransform<boolean, unknown>;
|
|
81
77
|
/** ARIA role applied while the host is interactive. */
|
|
82
78
|
apClickRole: i0.InputSignal<string>;
|
|
83
79
|
apClick: i0.OutputEmitterRef<MouseEvent | KeyboardEvent>;
|
|
84
80
|
private host;
|
|
85
|
-
protected readonly focused: i0.WritableSignal<boolean>;
|
|
86
81
|
constructor();
|
|
87
82
|
protected isInteractive(): boolean;
|
|
88
|
-
protected tabIndex(): 0 | -1 | null;
|
|
89
83
|
/** The two checks are independent, so an anchor without `href` still gets its contenteditable read. */
|
|
90
84
|
private isNativelyActivated;
|
|
91
85
|
/**
|
|
@@ -3,6 +3,8 @@ import { InjectionToken, PipeTransform, Signal, Provider } from '@angular/core';
|
|
|
3
3
|
|
|
4
4
|
declare const DEFAULT_TEXTS: Readonly<{
|
|
5
5
|
readonly 'ui-components.action-dropdown.aria-label': "Action dropdown";
|
|
6
|
+
readonly 'ui-components.confirm-modal.confirm': "OK";
|
|
7
|
+
readonly 'ui-components.confirm-modal.cancel': "Cancel";
|
|
6
8
|
readonly 'ui-components.filters.trigger': "Filters";
|
|
7
9
|
readonly 'ui-components.filters.aria-label': "Filters";
|
|
8
10
|
readonly 'ui-components.filters.apply': "Apply filters";
|
|
@@ -23,7 +25,13 @@ declare const DEFAULT_TEXTS: Readonly<{
|
|
|
23
25
|
readonly 'ui-components.selection.options-section': "Options";
|
|
24
26
|
readonly 'ui-components.selection.select-all': "Select all";
|
|
25
27
|
readonly 'ui-components.selection.select-all-count': "({{selected}} of {{total}})";
|
|
28
|
+
readonly 'ui-components.snackbar.info': "Info";
|
|
29
|
+
readonly 'ui-components.snackbar.success': "Success";
|
|
30
|
+
readonly 'ui-components.snackbar.warning': "Warning";
|
|
31
|
+
readonly 'ui-components.snackbar.error': "Error";
|
|
26
32
|
readonly 'ui-components.split-button.toggle': "Toggle";
|
|
33
|
+
readonly 'ui-components.toggle.confirm-title': "Are you sure?";
|
|
34
|
+
readonly 'ui-components.toggle.confirm-message': "If you toggle this, it will affect other things. Are you sure?";
|
|
27
35
|
}>;
|
|
28
36
|
/**
|
|
29
37
|
* A key of the DS default texts, the only keys a component may fall back to.
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { I18nOf, TranslationRequest } from '@agorapulse/ui-components/i18n';
|
|
1
3
|
import { SymbolRegistry } from '@agorapulse/ui-symbol';
|
|
2
|
-
import { Router } from '@angular/router';
|
|
3
|
-
import { SafeHtml, DomSanitizer } from '@angular/platform-browser';
|
|
4
4
|
import { BehaviorSubject } from 'rxjs';
|
|
5
|
-
import * as i0 from '@angular/core';
|
|
6
5
|
|
|
7
6
|
/**
|
|
8
7
|
* Info - 0
|
|
@@ -22,29 +21,31 @@ declare enum SnackbarTypeValues {
|
|
|
22
21
|
WARNING = "warning",
|
|
23
22
|
ERROR = "error"
|
|
24
23
|
}
|
|
24
|
+
/**
|
|
25
|
+
* A snackbar to show.
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* const snackbar: SnackbarsThreadBase = { i18n: { message: 'post.saved', action: 'common.undo' }, snackbarType: 1, callback: undo };
|
|
29
|
+
*/
|
|
25
30
|
interface SnackbarsThreadBase {
|
|
26
|
-
|
|
27
|
-
|
|
31
|
+
/** `message` is rendered as sanitized HTML, whatever its form; `action` is the text of the link, rendered as text. */
|
|
32
|
+
i18n: I18nOf<'message', 'action'>;
|
|
33
|
+
/** 0 info, 1 success, 2 warning, 3 error. */
|
|
28
34
|
snackbarType: internalSnackbarTypeAllowed;
|
|
29
|
-
|
|
35
|
+
/** URL the action navigates to. */
|
|
36
|
+
navigateInternalUrl?: string;
|
|
37
|
+
/** Opens `navigateInternalUrl` in a new tab instead of navigating. */
|
|
30
38
|
openUrlInNewTab?: boolean;
|
|
39
|
+
/** Called by the action instead of navigating; the snackbar is removed first. */
|
|
31
40
|
callback?: () => void;
|
|
32
41
|
}
|
|
33
42
|
interface SnackbarsThreadComplete extends SnackbarsThreadBase {
|
|
34
43
|
id: string;
|
|
35
44
|
}
|
|
36
|
-
declare abstract class CodeStatus {
|
|
37
|
-
snackbarText: string;
|
|
38
|
-
snackbarType: internalSnackbarTypeAllowed;
|
|
39
|
-
protected constructor(snackbarText: string, snackbarType: internalSnackbarTypeAllowed);
|
|
40
|
-
}
|
|
41
|
-
declare function generateCodeStatus(text: string, type: externalSnackbarTypeAllowed): CodeStatus;
|
|
42
45
|
|
|
43
46
|
declare class SnackbarsThreadService {
|
|
44
|
-
private domSanitizer;
|
|
45
47
|
private _list;
|
|
46
48
|
snackbarList: BehaviorSubject<SnackbarsThreadComplete[]>;
|
|
47
|
-
constructor(domSanitizer: DomSanitizer);
|
|
48
49
|
private _emit;
|
|
49
50
|
add(elem: SnackbarsThreadBase, timeout?: number): void;
|
|
50
51
|
addWithId(elem: SnackbarsThreadBase, id: string, timeout?: number): void;
|
|
@@ -52,31 +53,78 @@ declare class SnackbarsThreadService {
|
|
|
52
53
|
* Adds the snackbar and return its ID so it can be closed further
|
|
53
54
|
*/
|
|
54
55
|
addSnackbar(elem: SnackbarsThreadBase, timeout?: number): string;
|
|
56
|
+
/**
|
|
57
|
+
* Shows a success snackbar for `timeout` ms (0 keeps it) and returns its id; `message` is rendered as sanitized HTML.
|
|
58
|
+
*
|
|
59
|
+
* @example
|
|
60
|
+
* snackbars.success('post.saved');
|
|
61
|
+
*/
|
|
62
|
+
success(message: TranslationRequest, timeout?: number): string;
|
|
63
|
+
/**
|
|
64
|
+
* Shows an error snackbar; same contract as {@link success}.
|
|
65
|
+
*
|
|
66
|
+
* @example
|
|
67
|
+
* snackbars.error({ key: 'post.failed', params: { count: 2 } });
|
|
68
|
+
*/
|
|
69
|
+
error(message: TranslationRequest, timeout?: number): string;
|
|
70
|
+
/**
|
|
71
|
+
* Shows an info snackbar, styled as a success; same contract as {@link success}.
|
|
72
|
+
*
|
|
73
|
+
* @example
|
|
74
|
+
* snackbars.info('post.scheduled');
|
|
75
|
+
*/
|
|
76
|
+
info(message: TranslationRequest, timeout?: number): string;
|
|
77
|
+
/**
|
|
78
|
+
* 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.
|
|
80
|
+
*
|
|
81
|
+
* @example
|
|
82
|
+
* snackbars.show('post.saved', status.type);
|
|
83
|
+
*/
|
|
84
|
+
show(message: TranslationRequest, type: externalSnackbarTypeAllowed, timeout?: number): string;
|
|
55
85
|
remove(id: string | undefined): void;
|
|
56
86
|
private generateId;
|
|
57
87
|
static ɵfac: i0.ɵɵFactoryDeclaration<SnackbarsThreadService, never>;
|
|
58
88
|
static ɵprov: i0.ɵɵInjectableDeclaration<SnackbarsThreadService>;
|
|
59
89
|
}
|
|
60
90
|
|
|
91
|
+
/**
|
|
92
|
+
* Shows the snackbars added through {@link SnackbarsThreadService}; their texts are resolved while shown, so they follow language changes.
|
|
93
|
+
*/
|
|
61
94
|
declare class SnackbarsThreadComponent {
|
|
62
|
-
snackbarsThreadService: SnackbarsThreadService;
|
|
63
|
-
symbolRegistry: SymbolRegistry;
|
|
64
|
-
private readonly router;
|
|
65
95
|
SnackbarTypesMap: {
|
|
66
|
-
0:
|
|
67
|
-
1:
|
|
68
|
-
2:
|
|
69
|
-
3:
|
|
96
|
+
readonly 0: "info";
|
|
97
|
+
readonly 1: "success";
|
|
98
|
+
readonly 2: "warning";
|
|
99
|
+
readonly 3: "error";
|
|
70
100
|
};
|
|
71
101
|
SnackbarIconsMap: {
|
|
72
102
|
[k: number]: string;
|
|
73
103
|
};
|
|
74
|
-
|
|
104
|
+
readonly snackbarsThreadService: SnackbarsThreadService;
|
|
105
|
+
readonly symbolRegistry: SymbolRegistry;
|
|
106
|
+
private readonly router;
|
|
107
|
+
private readonly resolveTexts;
|
|
108
|
+
private readonly snackbars;
|
|
109
|
+
protected readonly rows: i0.Signal<{
|
|
110
|
+
snackbar: SnackbarsThreadComplete;
|
|
111
|
+
texts: {
|
|
112
|
+
readonly message: string | undefined;
|
|
113
|
+
readonly action: string | undefined;
|
|
114
|
+
};
|
|
115
|
+
}[]>;
|
|
116
|
+
protected readonly iconLabels: i0.Signal<{
|
|
117
|
+
readonly info: string;
|
|
118
|
+
readonly success: string;
|
|
119
|
+
readonly warning: string;
|
|
120
|
+
readonly error: string;
|
|
121
|
+
}>;
|
|
122
|
+
constructor();
|
|
75
123
|
remove(id: string): void;
|
|
76
124
|
onActionClick(snackbar: SnackbarsThreadBase, id: string): void;
|
|
77
125
|
static ɵfac: i0.ɵɵFactoryDeclaration<SnackbarsThreadComponent, never>;
|
|
78
126
|
static ɵcmp: i0.ɵɵComponentDeclaration<SnackbarsThreadComponent, "ap-snackbars-thread", never, {}, {}, never, never, true, never>;
|
|
79
127
|
}
|
|
80
128
|
|
|
81
|
-
export {
|
|
129
|
+
export { SnackbarTypeValues, SnackbarsThreadComponent, SnackbarsThreadService };
|
|
82
130
|
export type { SnackbarsThreadBase, externalSnackbarTypeAllowed };
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { TranslationRequest } from '@agorapulse/ui-components/i18n';
|
|
2
|
+
import { SnackbarsThreadService, externalSnackbarTypeAllowed, SnackbarsThreadBase } from '@agorapulse/ui-components/snackbars-thread';
|
|
3
|
+
import * as i0 from '@angular/core';
|
|
4
|
+
import { Provider } from '@angular/core';
|
|
5
|
+
|
|
6
|
+
/** A text as a spec compares it: a key with its optional params, or raw text. A bare key string becomes `{ key }`. */
|
|
7
|
+
type ShownText = {
|
|
8
|
+
key: string;
|
|
9
|
+
params?: Record<string, unknown>;
|
|
10
|
+
} | {
|
|
11
|
+
raw: string;
|
|
12
|
+
};
|
|
13
|
+
/** One snackbar the code under test showed. */
|
|
14
|
+
interface ShownSnackbar {
|
|
15
|
+
type: externalSnackbarTypeAllowed;
|
|
16
|
+
message: ShownText;
|
|
17
|
+
action?: ShownText;
|
|
18
|
+
navigateInternalUrl?: string;
|
|
19
|
+
callback?: () => void;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* A {@link SnackbarsThreadService} for specs: it records every snackbar in {@link shown}, with its tone and its texts,
|
|
23
|
+
* and never starts a timer. It needs no test runner, so it works under Jest and Vitest alike.
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* TestBed.configureTestingModule({ providers: [provideFakeSnackbars()] });
|
|
27
|
+
* const snackbars = TestBed.inject(FakeSnackbarsThreadService);
|
|
28
|
+
* // ...act...
|
|
29
|
+
* expect(snackbars.shown).toEqual([{ type: 'error', message: { key: 'post.failed' } }]);
|
|
30
|
+
*/
|
|
31
|
+
declare class FakeSnackbarsThreadService extends SnackbarsThreadService {
|
|
32
|
+
/** Every snackbar shown, oldest first; removing one does not drop it from here. */
|
|
33
|
+
readonly shown: ShownSnackbar[];
|
|
34
|
+
private pendingType;
|
|
35
|
+
show(message: TranslationRequest, type: externalSnackbarTypeAllowed, timeout?: number): string;
|
|
36
|
+
addWithId(elem: SnackbarsThreadBase, id: string, _timeout?: number): void;
|
|
37
|
+
/** Forgets every snackbar shown so far, e.g. the ones a spec's setup raised. */
|
|
38
|
+
clear(): void;
|
|
39
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<FakeSnackbarsThreadService, never>;
|
|
40
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<FakeSnackbarsThreadService>;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Provides {@link FakeSnackbarsThreadService} in place of {@link SnackbarsThreadService}; inject the fake to read what was shown.
|
|
44
|
+
*
|
|
45
|
+
* @example
|
|
46
|
+
* providers: [provideFakeSnackbars()]
|
|
47
|
+
*/
|
|
48
|
+
declare function provideFakeSnackbars(): Provider[];
|
|
49
|
+
|
|
50
|
+
export { FakeSnackbarsThreadService, provideFakeSnackbars };
|
|
51
|
+
export type { ShownSnackbar, ShownText };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as _angular_core from '@angular/core';
|
|
2
2
|
import { AfterContentInit, OnChanges, OnInit, ElementRef, EventEmitter } from '@angular/core';
|
|
3
|
+
import { I18nOf } from '@agorapulse/ui-components/i18n';
|
|
3
4
|
import { ControlValueAccessor, FormControl } from '@angular/forms';
|
|
4
5
|
|
|
5
6
|
declare const AP_CHECKBOX_CONTROL_VALUE_ACCESSOR: {
|
|
@@ -21,10 +22,8 @@ declare class ToggleComponent implements ControlValueAccessor, AfterContentInit,
|
|
|
21
22
|
checked: boolean;
|
|
22
23
|
required: boolean;
|
|
23
24
|
confirm: boolean;
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
confirmCancel: string;
|
|
27
|
-
confirmTitle: string;
|
|
25
|
+
/** Texts of the confirmation shown when `confirm` is set; the title and message default to the DS texts, the buttons to the confirm modal's. */
|
|
26
|
+
readonly i18n: _angular_core.InputSignal<I18nOf<never, "cancel" | "confirm" | "confirmTitle" | "confirmMessage">>;
|
|
28
27
|
set name(name: string);
|
|
29
28
|
get name(): string;
|
|
30
29
|
readonly change: EventEmitter<boolean>;
|
|
@@ -47,7 +46,7 @@ declare class ToggleComponent implements ControlValueAccessor, AfterContentInit,
|
|
|
47
46
|
};
|
|
48
47
|
_preventBubblingFromLabel(event: MouseEvent): void;
|
|
49
48
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<ToggleComponent, never>;
|
|
50
|
-
static ɵcmp: _angular_core.ɵɵComponentDeclaration<ToggleComponent, "ap-toggle", never, { "ariaLabel": { "alias": "aria-label"; "required": false; }; "ariaLabelledby": { "alias": "aria-labelledby"; "required": false; }; "ariaDescribedby": { "alias": "aria-describedby"; "required": false; }; "labelPosition": { "alias": "labelPosition"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "checked": { "alias": "checked"; "required": false; }; "required": { "alias": "required"; "required": false; }; "confirm": { "alias": "confirm"; "required": false; }; "
|
|
49
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<ToggleComponent, "ap-toggle", never, { "ariaLabel": { "alias": "aria-label"; "required": false; }; "ariaLabelledby": { "alias": "aria-labelledby"; "required": false; }; "ariaDescribedby": { "alias": "aria-describedby"; "required": false; }; "labelPosition": { "alias": "labelPosition"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "checked": { "alias": "checked"; "required": false; }; "required": { "alias": "required"; "required": false; }; "confirm": { "alias": "confirm"; "required": false; }; "i18n": { "alias": "i18n"; "required": false; "isSignal": true; }; "name": { "alias": "name"; "required": true; }; }, { "change": "change"; }, never, ["*"], true, never>;
|
|
51
50
|
static ngAcceptInputType_disabled: unknown;
|
|
52
51
|
static ngAcceptInputType_required: unknown;
|
|
53
52
|
}
|
|
@@ -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 {
|
|
39
|
+
export { 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
|