@agorapulse/ui-components 22.9.6-beta.1 → 22.9.7
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.7.tgz +0 -0
- package/fesm2022/agorapulse-ui-components-button.mjs +0 -2
- package/fesm2022/agorapulse-ui-components-button.mjs.map +1 -1
- package/fesm2022/agorapulse-ui-components-confirm-modal.mjs +21 -19
- package/fesm2022/agorapulse-ui-components-confirm-modal.mjs.map +1 -1
- package/fesm2022/agorapulse-ui-components-datepicker.mjs +33 -14
- package/fesm2022/agorapulse-ui-components-datepicker.mjs.map +1 -1
- package/fesm2022/agorapulse-ui-components-directives.mjs +17 -3
- 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 +0 -7
- package/fesm2022/agorapulse-ui-components-i18n.mjs.map +1 -1
- package/fesm2022/agorapulse-ui-components-icon-button.mjs +2 -4
- package/fesm2022/agorapulse-ui-components-icon-button.mjs.map +1 -1
- package/fesm2022/agorapulse-ui-components-snackbars-thread.mjs +93 -99
- package/fesm2022/agorapulse-ui-components-snackbars-thread.mjs.map +1 -1
- package/fesm2022/agorapulse-ui-components-social-button.mjs +2 -4
- package/fesm2022/agorapulse-ui-components-social-button.mjs.map +1 -1
- package/fesm2022/agorapulse-ui-components-split-button.mjs +2 -8
- package/fesm2022/agorapulse-ui-components-split-button.mjs.map +1 -1
- package/fesm2022/agorapulse-ui-components-toggle.mjs +19 -15
- 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 +1 -5
- package/types/agorapulse-ui-components-confirm-modal.d.ts +11 -16
- package/types/agorapulse-ui-components-datepicker.d.ts +7 -2
- package/types/agorapulse-ui-components-directives.d.ts +7 -1
- package/types/agorapulse-ui-components-i18n.d.ts +0 -7
- package/types/agorapulse-ui-components-snackbars-thread.d.ts +27 -92
- package/types/agorapulse-ui-components-toggle.d.ts +5 -4
- package/types/agorapulse-ui-components.d.ts +1 -1
- package/agorapulse-ui-components-22.9.6-beta.1.tgz +0 -0
- package/fesm2022/agorapulse-ui-components-testing.mjs +0 -77
- package/fesm2022/agorapulse-ui-components-testing.mjs.map +0 -1
- package/types/agorapulse-ui-components-testing.d.ts +0 -54
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agorapulse-ui-components-button.mjs","sources":["../../../libs/ui-components/button/src/button.component.ts","../../../libs/ui-components/button/src/button.component.html","../../../libs/ui-components/button/src/agorapulse-ui-components-button.ts"],"sourcesContent":["import { AP_INTERACTIVE_ELEMENT, ApInteractiveElement, BaseButtonDirective } from '@agorapulse/ui-components/directives';\nimport { UI_COMPONENTS_SYMBOLS } from '@agorapulse/ui-components/providers';\nimport { agorapulseSymbol, SymbolComponent, SymbolRegistry } from '@agorapulse/ui-symbol';\nimport {\n booleanAttribute,\n ChangeDetectionStrategy,\n Component,\n computed,\n ElementRef,\n forwardRef,\n inject,\n input,\n output,\n viewChild,\n ViewEncapsulation,\n} from '@angular/core';\nimport { MatMenuModule, MatMenuPanel } from '@angular/material/menu';\n\nexport type ButtonConfig =\n | { style: 'primary'; color: 'orange' | 'blue' }\n | { style: 'secondary'; color: 'orange' | 'blue' }\n | { style: 'stroked'; color: 'grey' | 'blue' | 'red' }\n | { style: 'stroked-transparent'; color: 'grey' | 'blue' | 'red' }\n | { style: 'ghost'; color: 'grey' | 'blue' | 'red' | 'green' }\n | { style: 'mermaid'; color?: never };\n\nexport const defaultButtonConfig: ButtonConfig = {\n style: 'primary',\n color: 'orange',\n};\n\n@Component({\n changeDetection: ChangeDetectionStrategy.OnPush,\n selector: 'ap-button',\n styleUrls: ['./button.component.scss'],\n imports: [SymbolComponent, MatMenuModule],\n templateUrl: './button.component.html',\n encapsulation: ViewEncapsulation.None,\n hostDirectives: [BaseButtonDirective],\n providers: [{ provide: AP_INTERACTIVE_ELEMENT, useExisting: forwardRef(() => ButtonComponent) }],\n host: {\n '[attr.disabled]': 'loading() || disabled() || null',\n },\n})\nexport class ButtonComponent implements ApInteractiveElement {\n readonly baseButtonDirective: BaseButtonDirective = inject(BaseButtonDirective, { self: true });\n\n buttonElement = viewChild.required<ElementRef<HTMLButtonElement>>('button');\n\n /** The host is a wrapper: this is the element that takes focus and carries the ARIA state. */\n interactiveElement(): HTMLElement {\n return this.buttonElement().nativeElement;\n }\n\n ariaLabel = input<string>();\n disabled = input(false, { transform: booleanAttribute });\n name = input<string>();\n form = input<string>();\n config = input(defaultButtonConfig, { transform: (value?: ButtonConfig) => value ?? defaultButtonConfig });\n loading = input(false, { transform: booleanAttribute });\n locked = input(false, { transform: booleanAttribute });\n menuTrigger = input<MatMenuPanel | null>(null);\n symbolPosition = input<'left' | 'right'>('right');\n symbolId = input<agorapulseSymbol>();\n\n menuOpened = output<void>();\n menuClosed = output<void>();\n // eslint-disable-next-line @angular-eslint/no-output-native\n click = output<MouseEvent>();\n // eslint-disable-next-line @angular-eslint/no-output-native\n focus = output<FocusEvent>();\n // eslint-disable-next-line @angular-eslint/no-output-native\n blur = output<FocusEvent>();\n\n buttonClasses = computed(() => {\n const cfg = this.config();\n const isLocked = this.locked();\n\n return {\n inverse: this.symbolPosition() === 'left',\n ...(isLocked\n ? { locked: true }\n : {\n // Style\n [cfg.style]: true,\n transparent: cfg.style === 'stroked-transparent',\n stroked: cfg.style === 'stroked' || cfg.style === 'stroked-transparent',\n // Color\n ...(cfg.color ? { [cfg.color]: true } : {}),\n // Loading state\n loading: this.loading(),\n }),\n };\n });\n\n private readonly symbolRegistry = inject(SymbolRegistry);\n\n constructor() {\n this.symbolRegistry.withSymbols(...(inject(UI_COMPONENTS_SYMBOLS, { optional: true })?.flat() ?? []));\n }\n\n onClickHandle($event: MouseEvent): void {\n if (this.disabled() || this.loading()) {\n return;\n }\n $event.stopImmediatePropagation();\n this.click.emit($event);\n this.buttonElement().nativeElement.blur();\n this.blur.emit($event);\n }\n\n onBlurHandle($event: FocusEvent): void {\n this.blur.emit($event);\n }\n\n onFocusHandle($event: FocusEvent): void {\n this.focus.emit($event);\n }\n}\n","<button\n #button\n role=\"button\"\n [matMenuTriggerFor]=\"menuTrigger()\"\n [class]=\"buttonClasses()\"\n [disabled]=\"disabled() && !locked()\"\n [attr.name]=\"name()\"\n [attr.data-test]=\"baseButtonDirective.hostDataTest ?? name()\"\n [attr.id]=\"baseButtonDirective.hostId\"\n [attr.type]=\"baseButtonDirective.hostType\"\n [attr.form]=\"form()\"\n [attr.aria-label]=\"ariaLabel() || null\"\n [attr.aria-disabled]=\"disabled()?.toString()\"\n (click)=\"onClickHandle($event)\"\n (focus)=\"onFocusHandle($event)\"\n (blur)=\"onBlurHandle($event)\"\n (menuOpened)=\"menuOpened.emit()\"\n (menuClosed)=\"menuClosed.emit()\">\n <ng-content />\n @if (symbolId()) {\n <ap-symbol [symbolId]=\"symbolId()\" />\n } @else {\n <ng-content select=\"ap-symbol\" />\n }\n @if (loading() && !locked()) {\n <div class=\"loading-bar\"></div>\n }\n</button>\n@if (locked()) {\n <div class=\"locked-symbol\">\n <ap-symbol\n symbolId=\"feature-lock\"\n size=\"sm\" />\n </div>\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;;;;AA0BO,MAAM,mBAAmB,GAAiB;AAC7C,IAAA,KAAK,EAAE,SAAS;AAChB,IAAA,KAAK,EAAE,QAAQ;;MAgBN,eAAe,CAAA;IACf,mBAAmB,GAAwB,MAAM,CAAC,mBAAmB,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;AAE/F,IAAA,aAAa,GAAG,SAAS,CAAC,QAAQ,CAAgC,QAAQ,CAAC;;IAG3E,kBAAkB,GAAA;A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,KAAA,EAAA,CAAA,EAAA,CAAA,EAAA,UAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,MAAA,EAAA,IAAA,EAAA,CAAA,YAAA,CAAA,EAAA,CAAA,EAAA,UAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,MAAA,EAAA,IAAA,EAAA,CAAA,YAAA,CAAA,EAAA,CAAA,EAAA,KAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,MAAA,EAAA,IAAA,EAAA,CAAA,OAAA,CAAA,EAAA,CAAA,EAAA,KAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,MAAA,EAAA,IAAA,EAAA,CAAA,OAAA,CAAA,EAAA,CAAA,EAAA,IAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,MAAA,EAAA,IAAA,EAAA,CAAA,MAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;AE/C9E;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"agorapulse-ui-components-button.mjs","sources":["../../../libs/ui-components/button/src/button.component.ts","../../../libs/ui-components/button/src/button.component.html","../../../libs/ui-components/button/src/agorapulse-ui-components-button.ts"],"sourcesContent":["import { AP_INTERACTIVE_ELEMENT, ApInteractiveElement, BaseButtonDirective } from '@agorapulse/ui-components/directives';\nimport { UI_COMPONENTS_SYMBOLS } from '@agorapulse/ui-components/providers';\nimport { agorapulseSymbol, SymbolComponent, SymbolRegistry } from '@agorapulse/ui-symbol';\nimport {\n booleanAttribute,\n ChangeDetectionStrategy,\n Component,\n computed,\n ElementRef,\n forwardRef,\n inject,\n input,\n output,\n viewChild,\n ViewEncapsulation,\n} from '@angular/core';\nimport { MatMenuModule, MatMenuPanel } from '@angular/material/menu';\n\nexport type ButtonConfig =\n | { style: 'primary'; color: 'orange' | 'blue' }\n | { style: 'secondary'; color: 'orange' | 'blue' }\n | { style: 'stroked'; color: 'grey' | 'blue' | 'red' }\n | { style: 'stroked-transparent'; color: 'grey' | 'blue' | 'red' }\n | { style: 'ghost'; color: 'grey' | 'blue' | 'red' | 'green' }\n | { style: 'mermaid'; color?: never };\n\nexport const defaultButtonConfig: ButtonConfig = {\n style: 'primary',\n color: 'orange',\n};\n\n@Component({\n changeDetection: ChangeDetectionStrategy.OnPush,\n selector: 'ap-button',\n styleUrls: ['./button.component.scss'],\n imports: [SymbolComponent, MatMenuModule],\n templateUrl: './button.component.html',\n encapsulation: ViewEncapsulation.None,\n hostDirectives: [BaseButtonDirective],\n providers: [{ provide: AP_INTERACTIVE_ELEMENT, useExisting: forwardRef(() => ButtonComponent) }],\n host: {\n '[attr.disabled]': 'loading() || disabled() || null',\n },\n})\nexport class ButtonComponent implements ApInteractiveElement {\n readonly baseButtonDirective: BaseButtonDirective = inject(BaseButtonDirective, { self: true });\n\n buttonElement = viewChild.required<ElementRef<HTMLButtonElement>>('button');\n\n /** The host is a wrapper: this is the element that takes focus and carries the ARIA state. */\n interactiveElement(): HTMLElement {\n return this.buttonElement().nativeElement;\n }\n\n ariaLabel = input<string>();\n disabled = input(false, { transform: booleanAttribute });\n name = input<string>();\n form = input<string>();\n config = input(defaultButtonConfig, { transform: (value?: ButtonConfig) => value ?? defaultButtonConfig });\n loading = input(false, { transform: booleanAttribute });\n locked = input(false, { transform: booleanAttribute });\n menuTrigger = input<MatMenuPanel | null>(null);\n symbolPosition = input<'left' | 'right'>('right');\n symbolId = input<agorapulseSymbol>();\n\n menuOpened = output<void>();\n menuClosed = output<void>();\n // eslint-disable-next-line @angular-eslint/no-output-native\n click = output<MouseEvent>();\n // eslint-disable-next-line @angular-eslint/no-output-native\n focus = output<FocusEvent>();\n // eslint-disable-next-line @angular-eslint/no-output-native\n blur = output<FocusEvent>();\n\n buttonClasses = computed(() => {\n const cfg = this.config();\n const isLocked = this.locked();\n\n return {\n inverse: this.symbolPosition() === 'left',\n ...(isLocked\n ? { locked: true }\n : {\n // Style\n [cfg.style]: true,\n transparent: cfg.style === 'stroked-transparent',\n stroked: cfg.style === 'stroked' || cfg.style === 'stroked-transparent',\n // Color\n ...(cfg.color ? { [cfg.color]: true } : {}),\n // Loading state\n loading: this.loading(),\n }),\n };\n });\n\n private readonly symbolRegistry = inject(SymbolRegistry);\n\n constructor() {\n this.symbolRegistry.withSymbols(...(inject(UI_COMPONENTS_SYMBOLS, { optional: true })?.flat() ?? []));\n }\n\n onClickHandle($event: MouseEvent): void {\n if (this.disabled() || this.loading()) {\n return;\n }\n $event.stopImmediatePropagation();\n this.click.emit($event);\n }\n\n onBlurHandle($event: FocusEvent): void {\n this.blur.emit($event);\n }\n\n onFocusHandle($event: FocusEvent): void {\n this.focus.emit($event);\n }\n}\n","<button\n #button\n role=\"button\"\n [matMenuTriggerFor]=\"menuTrigger()\"\n [class]=\"buttonClasses()\"\n [disabled]=\"disabled() && !locked()\"\n [attr.name]=\"name()\"\n [attr.data-test]=\"baseButtonDirective.hostDataTest ?? name()\"\n [attr.id]=\"baseButtonDirective.hostId\"\n [attr.type]=\"baseButtonDirective.hostType\"\n [attr.form]=\"form()\"\n [attr.aria-label]=\"ariaLabel() || null\"\n [attr.aria-disabled]=\"disabled()?.toString()\"\n (click)=\"onClickHandle($event)\"\n (focus)=\"onFocusHandle($event)\"\n (blur)=\"onBlurHandle($event)\"\n (menuOpened)=\"menuOpened.emit()\"\n (menuClosed)=\"menuClosed.emit()\">\n <ng-content />\n @if (symbolId()) {\n <ap-symbol [symbolId]=\"symbolId()\" />\n } @else {\n <ng-content select=\"ap-symbol\" />\n }\n @if (loading() && !locked()) {\n <div class=\"loading-bar\"></div>\n }\n</button>\n@if (locked()) {\n <div class=\"locked-symbol\">\n <ap-symbol\n symbolId=\"feature-lock\"\n size=\"sm\" />\n </div>\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;;;;AA0BO,MAAM,mBAAmB,GAAiB;AAC7C,IAAA,KAAK,EAAE,SAAS;AAChB,IAAA,KAAK,EAA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AAA,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,KAAA,EAAA,UAAA,EAAA,QAAA,EAAA,KAAA,EAAA,CAAA,EAAA,CAAA,EAAA,UAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,MAAA,EAAA,IAAA,EAAA,CAAA,YAAA,CAAA,EAAA,CAAA,EAAA,UAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,MAAA,EAAA,IAAA,EAAA,CAAA,YAAA,CAAA,EAAA,CAAA,EAAA,KAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,MAAA,EAAA,IAAA,EAAA,CAAA,OAAA,CAAA,EAAA,CAAA,EAAA,KAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,MAAA,EAAA,IAAA,EAAA,CAAA,OAAA,CAAA,EAAA,CAAA,EAAA,IAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,MAAA,EAAA,IAAA,EAAA,CAAA,MAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;AE/C9E;;AAEG;;;;"}
|
|
@@ -1,26 +1,17 @@
|
|
|
1
1
|
import { ButtonComponent } from '@agorapulse/ui-components/button';
|
|
2
|
-
import { injectResolveTexts } from '@agorapulse/ui-components/i18n';
|
|
3
2
|
import { ModalComponent } from '@agorapulse/ui-components/modal';
|
|
4
3
|
import * as i0 from '@angular/core';
|
|
5
|
-
import {
|
|
4
|
+
import { Input, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
6
5
|
import * as i1 from '@angular/material/dialog';
|
|
7
6
|
|
|
8
|
-
const ROLES = {
|
|
9
|
-
title: null,
|
|
10
|
-
message: null,
|
|
11
|
-
confirm: 'ui-components.confirm-modal.confirm',
|
|
12
|
-
cancel: 'ui-components.confirm-modal.cancel',
|
|
13
|
-
};
|
|
14
7
|
class ConfirmModalComponent {
|
|
15
8
|
dialogRef;
|
|
9
|
+
contentText = '';
|
|
16
10
|
footerCancelButtonId = 'cancel';
|
|
11
|
+
footerCancelButtonLabel = '';
|
|
17
12
|
footerConfirmButtonId = 'confirm';
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
...(ngDevMode ? [{ debugName: "i18n" }] : /* istanbul ignore next */ []));
|
|
21
|
-
resolveTexts = injectResolveTexts();
|
|
22
|
-
texts = computed(() => this.resolveTexts(this.i18n(), ROLES), /* @ts-ignore */
|
|
23
|
-
...(ngDevMode ? [{ debugName: "texts" }] : /* istanbul ignore next */ []));
|
|
13
|
+
footerConfirmButtonLabel = '';
|
|
14
|
+
headerTitle = '';
|
|
24
15
|
constructor(dialogRef) {
|
|
25
16
|
this.dialogRef = dialogRef;
|
|
26
17
|
dialogRef.disableClose = true;
|
|
@@ -41,22 +32,33 @@ class ConfirmModalComponent {
|
|
|
41
32
|
};
|
|
42
33
|
}
|
|
43
34
|
const confirmModal = ModalComponent.openDialog(dialog, modalConfig, ConfirmModalComponent);
|
|
35
|
+
confirmModal.componentInstance.contentText = confirmModalTexts.contentText;
|
|
44
36
|
confirmModal.componentInstance.footerConfirmButtonId = confirmModalTexts.footerConfirmButtonId;
|
|
37
|
+
confirmModal.componentInstance.footerConfirmButtonLabel = confirmModalTexts.footerConfirmButtonLabel;
|
|
45
38
|
confirmModal.componentInstance.footerCancelButtonId = confirmModalTexts.footerCancelButtonId;
|
|
46
|
-
confirmModal.
|
|
39
|
+
confirmModal.componentInstance.footerCancelButtonLabel = confirmModalTexts.footerCancelButtonLabel;
|
|
40
|
+
confirmModal.componentInstance.headerTitle = confirmModalTexts.headerTitle;
|
|
47
41
|
return confirmModal;
|
|
48
42
|
}
|
|
49
43
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: ConfirmModalComponent, deps: [{ token: i1.MatDialogRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
50
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "
|
|
44
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.0.5", type: ConfirmModalComponent, isStandalone: true, selector: "ap-confirm-modal", inputs: { contentText: "contentText", footerCancelButtonId: "footerCancelButtonId", footerCancelButtonLabel: "footerCancelButtonLabel", footerConfirmButtonId: "footerConfirmButtonId", footerConfirmButtonLabel: "footerConfirmButtonLabel", headerTitle: "headerTitle" }, ngImport: i0, template: "<ng-template #headerTemplate>\n <h2>{{ headerTitle }}</h2>\n</ng-template>\n\n<ng-template #mainTemplate>\n <p>{{ contentText }}</p>\n</ng-template>\n\n<ng-template #footerTemplate>\n <div class=\"buttons\">\n <ap-button\n name=\"confirm-modal-cancel-button\"\n [config]=\"{\n style: 'ghost',\n color: 'grey'\n }\"\n [id]=\"footerCancelButtonId\"\n (click)=\"onCancel()\">\n <span>\n {{ footerCancelButtonLabel }}\n </span>\n </ap-button>\n <ap-button\n name=\"confirm-modal-confirm-button\"\n cdkFocusInitial\n [config]=\"{\n style: 'primary',\n color: 'orange'\n }\"\n [id]=\"footerConfirmButtonId\"\n (click)=\"onConfirm()\">\n <span>\n {{ footerConfirmButtonLabel }}\n </span>\n </ap-button>\n </div>\n</ng-template>\n\n<ap-modal\n [closable]=\"true\"\n [headerTemplate]=\"headerTemplate\"\n [mainTemplate]=\"mainTemplate\"\n [footerTemplate]=\"footerTemplate\" />\n", styles: [".buttons{display:flex;gap:var(--ref-spacing-sm)}\n"], dependencies: [{ kind: "component", type: ButtonComponent, selector: "ap-button", inputs: ["ariaLabel", "disabled", "name", "form", "config", "loading", "locked", "menuTrigger", "symbolPosition", "symbolId"], outputs: ["menuOpened", "menuClosed", "click", "focus", "blur"] }, { kind: "component", type: ModalComponent, selector: "ap-modal", inputs: ["closable", "headerBottomBorderEnabled", "footerTemplate", "footerVisible", "headerTemplate", "headerVisible", "mainTemplate", "sidePaneTemplate", "sidePaneStyle", "containerStyle", "headerStyle", "contentStyle", "footerStyle", "defaultLayout"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
51
45
|
}
|
|
52
46
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: ConfirmModalComponent, decorators: [{
|
|
53
47
|
type: Component,
|
|
54
|
-
args: [{ changeDetection: ChangeDetectionStrategy.OnPush, selector: 'ap-confirm-modal', imports: [ButtonComponent, ModalComponent], template: "<ng-template #headerTemplate>\n <h2>{{
|
|
55
|
-
}], ctorParameters: () => [{ type: i1.MatDialogRef }], propDecorators: {
|
|
48
|
+
args: [{ changeDetection: ChangeDetectionStrategy.OnPush, selector: 'ap-confirm-modal', imports: [ButtonComponent, ModalComponent], template: "<ng-template #headerTemplate>\n <h2>{{ headerTitle }}</h2>\n</ng-template>\n\n<ng-template #mainTemplate>\n <p>{{ contentText }}</p>\n</ng-template>\n\n<ng-template #footerTemplate>\n <div class=\"buttons\">\n <ap-button\n name=\"confirm-modal-cancel-button\"\n [config]=\"{\n style: 'ghost',\n color: 'grey'\n }\"\n [id]=\"footerCancelButtonId\"\n (click)=\"onCancel()\">\n <span>\n {{ footerCancelButtonLabel }}\n </span>\n </ap-button>\n <ap-button\n name=\"confirm-modal-confirm-button\"\n cdkFocusInitial\n [config]=\"{\n style: 'primary',\n color: 'orange'\n }\"\n [id]=\"footerConfirmButtonId\"\n (click)=\"onConfirm()\">\n <span>\n {{ footerConfirmButtonLabel }}\n </span>\n </ap-button>\n </div>\n</ng-template>\n\n<ap-modal\n [closable]=\"true\"\n [headerTemplate]=\"headerTemplate\"\n [mainTemplate]=\"mainTemplate\"\n [footerTemplate]=\"footerTemplate\" />\n", styles: [".buttons{display:flex;gap:var(--ref-spacing-sm)}\n"] }]
|
|
49
|
+
}], ctorParameters: () => [{ type: i1.MatDialogRef }], propDecorators: { contentText: [{
|
|
50
|
+
type: Input
|
|
51
|
+
}], footerCancelButtonId: [{
|
|
52
|
+
type: Input
|
|
53
|
+
}], footerCancelButtonLabel: [{
|
|
56
54
|
type: Input
|
|
57
55
|
}], footerConfirmButtonId: [{
|
|
58
56
|
type: Input
|
|
59
|
-
}],
|
|
57
|
+
}], footerConfirmButtonLabel: [{
|
|
58
|
+
type: Input
|
|
59
|
+
}], headerTitle: [{
|
|
60
|
+
type: Input
|
|
61
|
+
}] } });
|
|
60
62
|
|
|
61
63
|
/**
|
|
62
64
|
* Generated bundle index. Do not edit.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agorapulse-ui-components-confirm-modal.mjs","sources":["../../../libs/ui-components/confirm-modal/src/confirm-modal.component.ts","../../../libs/ui-components/confirm-modal/src/confirm-modal.component.html","../../../libs/ui-components/confirm-modal/src/agorapulse-ui-components-confirm-modal.ts"],"sourcesContent":["import { ButtonComponent } from '@agorapulse/ui-components/button';\nimport {
|
|
1
|
+
{"version":3,"file":"agorapulse-ui-components-confirm-modal.mjs","sources":["../../../libs/ui-components/confirm-modal/src/confirm-modal.component.ts","../../../libs/ui-components/confirm-modal/src/confirm-modal.component.html","../../../libs/ui-components/confirm-modal/src/agorapulse-ui-components-confirm-modal.ts"],"sourcesContent":["import { ButtonComponent } from '@agorapulse/ui-components/button';\nimport { ModalComponent, ModalConfig } from '@agorapulse/ui-components/modal';\nimport { ChangeDetectionStrategy, Component, Input } from '@angular/core';\nimport { MatDialog, MatDialogRef } from '@angular/material/dialog';\nimport { ConfirmModalTexts } from './confirm-modal-texts.model';\n\n@Component({\n changeDetection: ChangeDetectionStrategy.OnPush,\n selector: 'ap-confirm-modal',\n templateUrl: 'confirm-modal.component.html',\n styleUrls: ['./confirm-modal.component.scss'],\n imports: [ButtonComponent, ModalComponent],\n})\nexport class ConfirmModalComponent {\n @Input() contentText: string = '';\n @Input() footerCancelButtonId: string = 'cancel';\n @Input() footerCancelButtonLabel: string = '';\n @Input() footerConfirmButtonId: string = 'confirm';\n @Input() footerConfirmButtonLabel: string = '';\n @Input() headerTitle: string = '';\n\n constructor(public dialogRef: MatDialogRef<ConfirmModalComponent, boolean>) {\n dialogRef.disableClose = true;\n }\n\n onCancel() {\n this.dialogRef.close(false);\n }\n\n onConfirm() {\n this.dialogRef.close(true);\n }\n\n static open(dialog: MatDialog, confirmModalTexts: ConfirmModalTexts, modalConfig: ModalConfig | null = null) {\n if (!modalConfig) {\n modalConfig = {};\n }\n if (!modalConfig.matDialogConfig) {\n modalConfig.matDialogConfig = {\n width: '550px',\n };\n }\n const confirmModal = ModalComponent.openDialog(dialog, modalConfig, ConfirmModalComponent);\n confirmModal.componentInstance.contentText = confirmModalTexts.contentText;\n confirmModal.componentInstance.footerConfirmButtonId = confirmModalTexts.footerConfirmButtonId;\n confirmModal.componentInstance.footerConfirmButtonLabel = confirmModalTexts.footerConfirmButtonLabel;\n confirmModal.componentInstance.footerCancelButtonId = confirmModalTexts.footerCancelButtonId;\n confirmModal.componentInstance.footerCancelButtonLabel = confirmModalTexts.footerCancelButtonLabel;\n confirmModal.componentInstance.headerTitle = confirmModalTexts.headerTitle;\n return confirmModal;\n }\n}\n","<ng-template #headerTemplate>\n <h2>{{ headerTitle }}</h2>\n</ng-template>\n\n<ng-template #mainTemplate>\n <p>{{ contentText }}</p>\n</ng-template>\n\n<ng-template #footerTemplate>\n <div class=\"buttons\">\n <ap-button\n name=\"confirm-modal-cancel-button\"\n [config]=\"{\n style: 'ghost',\n color: 'grey'\n }\"\n [id]=\"footerCancelButtonId\"\n (click)=\"onCancel()\">\n <span>\n {{ footerCancelButtonLabel }}\n </span>\n </ap-button>\n <ap-button\n name=\"confirm-modal-confirm-button\"\n cdkFocusInitial\n [config]=\"{\n style: 'primary',\n color: 'orange'\n }\"\n [id]=\"footerConfirmButtonId\"\n (click)=\"onConfirm()\">\n <span>\n {{ footerConfirmButtonLabel }}\n </span>\n </ap-button>\n </div>\n</ng-template>\n\n<ap-modal\n [closable]=\"true\"\n [headerTemplate]=\"headerTemplate\"\n [mainTemplate]=\"mainTemplate\"\n [footerTemplate]=\"footerTemplate\" />\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"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CAAA,oDAAA,CAAA,EAAA;;sBAGzC;;sBACA;;sBACA;;sBACA;;sBACA;;sBACA;;;AEnBL;;AAEG;;;;"}
|
|
@@ -2,9 +2,9 @@ import { StopPropagationDirective, OverflowCountDirective, OverflowCounterDirect
|
|
|
2
2
|
import { DropdownPanelComponent, DropdownContentDirective } from '@agorapulse/ui-components/dropdown-panel';
|
|
3
3
|
import { NgTemplateOutlet } from '@angular/common';
|
|
4
4
|
import * as i0 from '@angular/core';
|
|
5
|
-
import { input, output, signal, viewChild,
|
|
5
|
+
import { input, output, signal, viewChild, computed, linkedSignal, ChangeDetectionStrategy, Component, EventEmitter, Output, Input, ViewChild, inject, APP_ID, model, effect, ViewEncapsulation } from '@angular/core';
|
|
6
6
|
import { ButtonComponent } from '@agorapulse/ui-components/button';
|
|
7
|
-
import {
|
|
7
|
+
import { interactiveTriggerElement, DropdownTriggerDirective } from '@agorapulse/ui-components/dropdown-base';
|
|
8
8
|
import { IconButtonComponent } from '@agorapulse/ui-components/icon-button';
|
|
9
9
|
import * as i1 from '@agorapulse/ui-symbol';
|
|
10
10
|
import { withSymbols, apArrowLeft, apArrowRight, SymbolComponent, apCalendar, apChevronDown, apChevronUp, apClock, apClose, apInfo } from '@agorapulse/ui-symbol';
|
|
@@ -63,10 +63,9 @@ class DatepickerMonthPickerComponent {
|
|
|
63
63
|
*/
|
|
64
64
|
showingYears = signal(false, /* @ts-ignore */
|
|
65
65
|
...(ngDevMode ? [{ debugName: "showingYears" }] : /* istanbul ignore next */ []));
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
isOpen = this.overlay.isOpen;
|
|
66
|
+
panel = viewChild.required(DropdownPanelComponent);
|
|
67
|
+
isOpen = computed(() => this.panel().isOpen(), /* @ts-ignore */
|
|
68
|
+
...(ngDevMode ? [{ debugName: "isOpen" }] : /* istanbul ignore next */ []));
|
|
70
69
|
/** Browsable on its own, and re-anchored on the calendar's year whenever that moves. */
|
|
71
70
|
displayedYear = linkedSignal(() => this.year(), /* @ts-ignore */
|
|
72
71
|
...(ngDevMode ? [{ debugName: "displayedYear" }] : /* istanbul ignore next */ []));
|
|
@@ -140,16 +139,21 @@ class DatepickerMonthPickerComponent {
|
|
|
140
139
|
}, /* @ts-ignore */
|
|
141
140
|
...(ngDevMode ? [{ debugName: "years" }] : /* istanbul ignore next */ []));
|
|
142
141
|
open(triggerElement) {
|
|
143
|
-
|
|
144
|
-
if (this.isOpen() || !panelTemplate) {
|
|
142
|
+
if (this.isOpen()) {
|
|
145
143
|
return;
|
|
146
144
|
}
|
|
147
|
-
|
|
145
|
+
// Back on the calendar year, so its month is in the grid to take focus.
|
|
146
|
+
this.displayedYear.set(this.year());
|
|
147
|
+
this.panel().open(triggerElement);
|
|
148
|
+
this.focusSelectedMonth();
|
|
148
149
|
}
|
|
150
|
+
/** The panel gives focus back to the trigger; a gesture (Escape, outside click) closes through it too. */
|
|
149
151
|
close() {
|
|
150
|
-
|
|
152
|
+
this.panel().close();
|
|
153
|
+
}
|
|
154
|
+
/** Back to months, so reopening never starts on the year grid the last visit happened to leave on. */
|
|
155
|
+
onPanelClosed() {
|
|
151
156
|
this.showingYears.set(false);
|
|
152
|
-
this.overlay.close();
|
|
153
157
|
}
|
|
154
158
|
toggle(triggerElement) {
|
|
155
159
|
if (this.isOpen()) {
|
|
@@ -172,22 +176,37 @@ class DatepickerMonthPickerComponent {
|
|
|
172
176
|
onSelectYear(year) {
|
|
173
177
|
this.displayedYear.set(year);
|
|
174
178
|
this.showingYears.set(false);
|
|
179
|
+
// The clicked year leaves the grid with it, which would drop focus on `body`.
|
|
180
|
+
this.focusInPanel('.ap-datepicker-month-picker__year');
|
|
175
181
|
}
|
|
176
182
|
onSelectMonth(month) {
|
|
177
183
|
this.monthSelected.emit({ month, year: this.displayedYear() });
|
|
178
184
|
this.close();
|
|
179
185
|
}
|
|
186
|
+
/** An out-of-bounds month is disabled, hence unfocusable: focus then stays on the panel. */
|
|
187
|
+
focusSelectedMonth() {
|
|
188
|
+
const index = this.months().findIndex(option => option.config === SELECTED_MONTH_CONFIG && !option.disabled);
|
|
189
|
+
if (index >= 0) {
|
|
190
|
+
this.focusInPanel(`.ap-datepicker-month-picker__grid > ap-button:nth-child(${index + 1})`);
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
focusInPanel(selector) {
|
|
194
|
+
const host = this.panel().overlayRef?.overlayElement.querySelector(selector);
|
|
195
|
+
if (host) {
|
|
196
|
+
interactiveTriggerElement(host).focus();
|
|
197
|
+
}
|
|
198
|
+
}
|
|
180
199
|
/** One year at a time through the months, a whole page at a time through the years. */
|
|
181
200
|
step() {
|
|
182
201
|
return this.showingYears() ? YEARS_PER_PAGE : 1;
|
|
183
202
|
}
|
|
184
203
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: DatepickerMonthPickerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
185
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.5", type: DatepickerMonthPickerComponent, isStandalone: true, selector: "ap-datepicker-month-picker", inputs: { month: { classPropertyName: "month", publicName: "month", isSignal: true, isRequired: true, transformFunction: null }, year: { classPropertyName: "year", publicName: "year", isSignal: true, isRequired: true, transformFunction: null }, locale: { classPropertyName: "locale", publicName: "locale", isSignal: true, isRequired: false, transformFunction: null }, minDate: { classPropertyName: "minDate", publicName: "minDate", isSignal: true, isRequired: false, transformFunction: null }, maxDate: { classPropertyName: "maxDate", publicName: "maxDate", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { monthSelected: "monthSelected" }, providers: [withSymbols(apArrowLeft, apArrowRight)], viewQueries: [{ propertyName: "
|
|
204
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.5", type: DatepickerMonthPickerComponent, isStandalone: true, selector: "ap-datepicker-month-picker", inputs: { month: { classPropertyName: "month", publicName: "month", isSignal: true, isRequired: true, transformFunction: null }, year: { classPropertyName: "year", publicName: "year", isSignal: true, isRequired: true, transformFunction: null }, locale: { classPropertyName: "locale", publicName: "locale", isSignal: true, isRequired: false, transformFunction: null }, minDate: { classPropertyName: "minDate", publicName: "minDate", isSignal: true, isRequired: false, transformFunction: null }, maxDate: { classPropertyName: "maxDate", publicName: "maxDate", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { monthSelected: "monthSelected" }, providers: [withSymbols(apArrowLeft, apArrowRight)], viewQueries: [{ propertyName: "panel", first: true, predicate: DropdownPanelComponent, descendants: true, isSignal: true }], ngImport: i0, template: "<ap-dropdown-panel (closed)=\"onPanelClosed()\">\n <div\n *apDropdownContent\n class=\"ap-datepicker-month-picker\"\n role=\"dialog\"\n aria-label=\"Choose a month\"\n tabindex=\"-1\">\n <div class=\"ap-datepicker-month-picker__header\">\n <ap-icon-button\n symbolId=\"arrow-left\"\n [ariaLabel]=\"showingYears() ? 'Previous years' : 'Previous year'\"\n [disabled]=\"!canGoPrevious()\"\n (onClick)=\"onPrevious()\" />\n <!--\n A button, not a label: it is what opens the year grid. Reaching a distant year through\n the arrows alone costs one click per year.\n -->\n <ap-button\n class=\"ap-datepicker-month-picker__year\"\n [ariaLabel]=\"showingYears() ? 'Back to the months' : 'Choose a year'\"\n [config]=\"{ style: 'ghost', color: 'grey' }\"\n (click)=\"onToggleYears()\">\n {{ showingYears() ? displayedYearRange() : displayedYear() }}\n </ap-button>\n <ap-icon-button\n symbolId=\"arrow-right\"\n [ariaLabel]=\"showingYears() ? 'Next years' : 'Next year'\"\n [disabled]=\"!canGoNext()\"\n (onClick)=\"onNext()\" />\n </div>\n\n <!-- One grid for both: a page of years fills it exactly, so switching never resizes the panel. -->\n <div class=\"ap-datepicker-month-picker__grid\">\n @if (showingYears()) {\n @for (option of years(); track option.year) {\n <ap-button\n [config]=\"option.config\"\n [disabled]=\"option.disabled\"\n (click)=\"onSelectYear(option.year)\">\n {{ option.year }}\n </ap-button>\n }\n } @else {\n @for (option of months(); track option.month) {\n <ap-button\n [ariaLabel]=\"option.ariaLabel\"\n [config]=\"option.config\"\n [disabled]=\"option.disabled\"\n (click)=\"onSelectMonth(option.month)\">\n {{ option.label }}\n </ap-button>\n }\n }\n </div>\n </div>\n</ap-dropdown-panel>\n", styles: [":host{display:none}.ap-datepicker-month-picker{padding:var(--ref-spacing-sm);outline:none}.ap-datepicker-month-picker__header{display:flex;align-items:center;justify-content:space-between;margin-bottom:var(--ref-spacing-xs);gap:var(--ref-spacing-xxs)}.ap-datepicker-month-picker__year{color:var(--ref-color-grey-100);font-size:var(--sys-text-style-body-bold-size);font-weight:var(--sys-text-style-body-bold-weight);line-height:var(--sys-text-style-body-bold-line-height)}.ap-datepicker-month-picker__grid{display:grid;gap:var(--ref-spacing-xxs);grid-template-columns:repeat(3,minmax(64px,1fr))}\n"], dependencies: [{ kind: "component", type: ButtonComponent, selector: "ap-button", inputs: ["ariaLabel", "disabled", "name", "form", "config", "loading", "locked", "menuTrigger", "symbolPosition", "symbolId"], outputs: ["menuOpened", "menuClosed", "click", "focus", "blur"] }, { kind: "directive", type: DropdownContentDirective, selector: "ng-template[apDropdownContent]" }, { kind: "component", type: DropdownPanelComponent, selector: "ap-dropdown-panel", inputs: ["placement", "showBackdrop", "panelClass", "canDismiss"], outputs: ["opened", "closed"] }, { kind: "component", type: IconButtonComponent, selector: "ap-icon-button", inputs: ["ariaLabel", "name", "color", "disabled", "menuTrigger", "symbolId", "locked", "loading", "type"], outputs: ["onClick", "onFocus", "onBlur", "menuOpened", "menuClosed"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
186
205
|
}
|
|
187
206
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: DatepickerMonthPickerComponent, decorators: [{
|
|
188
207
|
type: Component,
|
|
189
|
-
args: [{ changeDetection: ChangeDetectionStrategy.OnPush, selector: 'ap-datepicker-month-picker', imports: [ButtonComponent, IconButtonComponent], providers: [withSymbols(apArrowLeft, apArrowRight)], template: "<
|
|
190
|
-
}], propDecorators: { month: [{ type: i0.Input, args: [{ isSignal: true, alias: "month", required: true }] }], year: [{ type: i0.Input, args: [{ isSignal: true, alias: "year", required: true }] }], locale: [{ type: i0.Input, args: [{ isSignal: true, alias: "locale", required: false }] }], minDate: [{ type: i0.Input, args: [{ isSignal: true, alias: "minDate", required: false }] }], maxDate: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxDate", required: false }] }], monthSelected: [{ type: i0.Output, args: ["monthSelected"] }],
|
|
208
|
+
args: [{ changeDetection: ChangeDetectionStrategy.OnPush, selector: 'ap-datepicker-month-picker', imports: [ButtonComponent, DropdownContentDirective, DropdownPanelComponent, IconButtonComponent], providers: [withSymbols(apArrowLeft, apArrowRight)], template: "<ap-dropdown-panel (closed)=\"onPanelClosed()\">\n <div\n *apDropdownContent\n class=\"ap-datepicker-month-picker\"\n role=\"dialog\"\n aria-label=\"Choose a month\"\n tabindex=\"-1\">\n <div class=\"ap-datepicker-month-picker__header\">\n <ap-icon-button\n symbolId=\"arrow-left\"\n [ariaLabel]=\"showingYears() ? 'Previous years' : 'Previous year'\"\n [disabled]=\"!canGoPrevious()\"\n (onClick)=\"onPrevious()\" />\n <!--\n A button, not a label: it is what opens the year grid. Reaching a distant year through\n the arrows alone costs one click per year.\n -->\n <ap-button\n class=\"ap-datepicker-month-picker__year\"\n [ariaLabel]=\"showingYears() ? 'Back to the months' : 'Choose a year'\"\n [config]=\"{ style: 'ghost', color: 'grey' }\"\n (click)=\"onToggleYears()\">\n {{ showingYears() ? displayedYearRange() : displayedYear() }}\n </ap-button>\n <ap-icon-button\n symbolId=\"arrow-right\"\n [ariaLabel]=\"showingYears() ? 'Next years' : 'Next year'\"\n [disabled]=\"!canGoNext()\"\n (onClick)=\"onNext()\" />\n </div>\n\n <!-- One grid for both: a page of years fills it exactly, so switching never resizes the panel. -->\n <div class=\"ap-datepicker-month-picker__grid\">\n @if (showingYears()) {\n @for (option of years(); track option.year) {\n <ap-button\n [config]=\"option.config\"\n [disabled]=\"option.disabled\"\n (click)=\"onSelectYear(option.year)\">\n {{ option.year }}\n </ap-button>\n }\n } @else {\n @for (option of months(); track option.month) {\n <ap-button\n [ariaLabel]=\"option.ariaLabel\"\n [config]=\"option.config\"\n [disabled]=\"option.disabled\"\n (click)=\"onSelectMonth(option.month)\">\n {{ option.label }}\n </ap-button>\n }\n }\n </div>\n </div>\n</ap-dropdown-panel>\n", styles: [":host{display:none}.ap-datepicker-month-picker{padding:var(--ref-spacing-sm);outline:none}.ap-datepicker-month-picker__header{display:flex;align-items:center;justify-content:space-between;margin-bottom:var(--ref-spacing-xs);gap:var(--ref-spacing-xxs)}.ap-datepicker-month-picker__year{color:var(--ref-color-grey-100);font-size:var(--sys-text-style-body-bold-size);font-weight:var(--sys-text-style-body-bold-weight);line-height:var(--sys-text-style-body-bold-line-height)}.ap-datepicker-month-picker__grid{display:grid;gap:var(--ref-spacing-xxs);grid-template-columns:repeat(3,minmax(64px,1fr))}\n"] }]
|
|
209
|
+
}], propDecorators: { month: [{ type: i0.Input, args: [{ isSignal: true, alias: "month", required: true }] }], year: [{ type: i0.Input, args: [{ isSignal: true, alias: "year", required: true }] }], locale: [{ type: i0.Input, args: [{ isSignal: true, alias: "locale", required: false }] }], minDate: [{ type: i0.Input, args: [{ isSignal: true, alias: "minDate", required: false }] }], maxDate: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxDate", required: false }] }], monthSelected: [{ type: i0.Output, args: ["monthSelected"] }], panel: [{ type: i0.ViewChild, args: [i0.forwardRef(() => DropdownPanelComponent), { isSignal: true }] }] } });
|
|
191
210
|
|
|
192
211
|
var DatepickerMode;
|
|
193
212
|
(function (DatepickerMode) {
|