@agorapulse/ui-components 18.0.16 → 18.0.18
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-18.0.18.tgz +0 -0
- package/button/button.component.d.ts +2 -2
- package/esm2022/add-comment/add-comment.component.mjs +1 -1
- package/esm2022/avatar/avatar.component.mjs +2 -2
- package/esm2022/badge/badge.component.mjs +3 -3
- package/esm2022/button/button.component.mjs +7 -13
- package/esm2022/checkbox/checkbox.component.mjs +3 -3
- package/esm2022/confirm-modal/confirm-modal.component.mjs +2 -2
- package/esm2022/counter/counter.component.mjs +3 -3
- package/esm2022/icon-button/icon-button.component.mjs +5 -4
- package/esm2022/infobox/infobox.component.mjs +15 -22
- package/esm2022/labels/label.component.mjs +4 -5
- package/esm2022/modal/modal.component.mjs +1 -1
- package/esm2022/nav-selector/nav-selector-group/nav-selector-group.component.mjs +13 -3
- package/esm2022/nav-selector/nav-selector-leaf/nav-selector-leaf.component.mjs +9 -3
- package/esm2022/nav-selector/nav-selector-leaf-detail/nav-selector-leaf-detail.component.mjs +6 -4
- package/esm2022/nav-selector/nav-selector-popover/nav-selector-popover-item.component.mjs +9 -5
- package/esm2022/nav-selector/nav-selector-popover/nav-selector-popover.component.mjs +6 -4
- package/esm2022/nav-selector/nav-selector.component.mjs +2 -2
- package/esm2022/neo-datepicker/neo-datepicker.component.mjs +1 -1
- package/esm2022/paginator/paginator.component.mjs +2 -4
- package/esm2022/radio/radio.component.mjs +3 -4
- package/esm2022/social-button/social-button.component.mjs +3 -3
- package/esm2022/split-button/split-button.component.mjs +6 -5
- package/esm2022/status/status.component.mjs +3 -3
- package/esm2022/status-card/status-card.component.mjs +3 -4
- package/esm2022/tag/tag.component.mjs +4 -4
- package/esm2022/toggle/toggle.component.mjs +3 -3
- package/fesm2022/agorapulse-ui-components-add-comment.mjs +1 -1
- package/fesm2022/agorapulse-ui-components-add-comment.mjs.map +1 -1
- package/fesm2022/agorapulse-ui-components-avatar.mjs +1 -1
- package/fesm2022/agorapulse-ui-components-avatar.mjs.map +1 -1
- package/fesm2022/agorapulse-ui-components-badge.mjs +2 -2
- package/fesm2022/agorapulse-ui-components-badge.mjs.map +1 -1
- package/fesm2022/agorapulse-ui-components-button.mjs +6 -12
- package/fesm2022/agorapulse-ui-components-button.mjs.map +1 -1
- package/fesm2022/agorapulse-ui-components-checkbox.mjs +2 -2
- package/fesm2022/agorapulse-ui-components-checkbox.mjs.map +1 -1
- package/fesm2022/agorapulse-ui-components-confirm-modal.mjs +1 -1
- package/fesm2022/agorapulse-ui-components-confirm-modal.mjs.map +1 -1
- package/fesm2022/agorapulse-ui-components-counter.mjs +2 -2
- package/fesm2022/agorapulse-ui-components-counter.mjs.map +1 -1
- package/fesm2022/agorapulse-ui-components-icon-button.mjs +4 -3
- package/fesm2022/agorapulse-ui-components-icon-button.mjs.map +1 -1
- package/fesm2022/agorapulse-ui-components-infobox.mjs +14 -21
- package/fesm2022/agorapulse-ui-components-infobox.mjs.map +1 -1
- package/fesm2022/agorapulse-ui-components-labels.mjs +3 -4
- package/fesm2022/agorapulse-ui-components-labels.mjs.map +1 -1
- package/fesm2022/agorapulse-ui-components-modal.mjs +1 -1
- package/fesm2022/agorapulse-ui-components-modal.mjs.map +1 -1
- package/fesm2022/agorapulse-ui-components-nav-selector.mjs +38 -15
- package/fesm2022/agorapulse-ui-components-nav-selector.mjs.map +1 -1
- package/fesm2022/agorapulse-ui-components-neo-datepicker.mjs +1 -1
- package/fesm2022/agorapulse-ui-components-neo-datepicker.mjs.map +1 -1
- package/fesm2022/agorapulse-ui-components-paginator.mjs +1 -3
- package/fesm2022/agorapulse-ui-components-paginator.mjs.map +1 -1
- package/fesm2022/agorapulse-ui-components-radio.mjs +2 -3
- package/fesm2022/agorapulse-ui-components-radio.mjs.map +1 -1
- package/fesm2022/agorapulse-ui-components-social-button.mjs +2 -2
- package/fesm2022/agorapulse-ui-components-social-button.mjs.map +1 -1
- package/fesm2022/agorapulse-ui-components-split-button.mjs +5 -4
- package/fesm2022/agorapulse-ui-components-split-button.mjs.map +1 -1
- package/fesm2022/agorapulse-ui-components-status-card.mjs +2 -3
- package/fesm2022/agorapulse-ui-components-status-card.mjs.map +1 -1
- package/fesm2022/agorapulse-ui-components-status.mjs +2 -2
- package/fesm2022/agorapulse-ui-components-status.mjs.map +1 -1
- package/fesm2022/agorapulse-ui-components-tag.mjs +3 -3
- package/fesm2022/agorapulse-ui-components-tag.mjs.map +1 -1
- package/fesm2022/agorapulse-ui-components-toggle.mjs +2 -2
- package/fesm2022/agorapulse-ui-components-toggle.mjs.map +1 -1
- package/icon-button/icon-button.component.d.ts +2 -1
- package/infobox/infobox.component.d.ts +1 -7
- package/nav-selector/nav-selector-group/nav-selector-group.component.d.ts +5 -0
- package/nav-selector/nav-selector-leaf/nav-selector-leaf.component.d.ts +4 -0
- package/nav-selector/nav-selector-popover/nav-selector-popover-item.component.d.ts +1 -0
- package/package.json +1 -1
- package/split-button/split-button.component.d.ts +2 -1
- package/agorapulse-ui-components-18.0.16.tgz +0 -0
|
@@ -55,7 +55,7 @@ class AvatarComponent {
|
|
|
55
55
|
bigNetwork = input(false);
|
|
56
56
|
anonymous = input(false);
|
|
57
57
|
online = input(false);
|
|
58
|
-
hideBigNetwork = input(false, { alias: 'youtubeAvatarMode' });
|
|
58
|
+
hideBigNetwork = input(false, { alias: 'youtubeAvatarMode' }); // TODO: rename youtubeAvatarMode to hideBigNetwork in platform
|
|
59
59
|
rounded = input(true, { transform: booleanAttribute });
|
|
60
60
|
imageError = signal(false);
|
|
61
61
|
backgroundView = computed(() => this.buildBackgroundView());
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agorapulse-ui-components-avatar.mjs","sources":["../../../libs/ui-components/avatar/src/avatar.component.ts","../../../libs/ui-components/avatar/src/avatar.component.html","../../../libs/ui-components/avatar/src/agorapulse-ui-components-avatar.ts"],"sourcesContent":["import {\n agorapulseSymbol,\n apShowTheaterMaskHappy,\n apSingleNeutral,\n networkDescription,\n NetworkName,\n NetworkSymbolPipe,\n SymbolComponent,\n SymbolRegistry,\n toNetworkSymbol,\n} from '@agorapulse/ui-symbol';\nimport { NgClass, NgOptimizedImage, NgStyle } from '@angular/common';\nimport { booleanAttribute, ChangeDetectionStrategy, Component, computed, effect, input, signal, untracked } from '@angular/core';\n\nexport type AvatarNetwork = NetworkName;\nexport type AvatarSize = 56 | 48 | 40 | 36 | 32 | 24 | 16;\n\nconst onlineIconSizeByAvatarSize: Record<AvatarSize, number> = {\n 56: 16,\n 48: 12,\n 40: 12,\n 36: 8,\n 32: 8,\n 24: 6,\n 16: 6,\n};\n\nconst symbolSizeByAvatarSize: Record<AvatarSize, number> = {\n 56: 28,\n 48: 24,\n 40: 20,\n 36: 18,\n 32: 16,\n 24: 12,\n 16: 8,\n};\n\nconst networkSizeByAvatarSize: Record<AvatarSize, number> = {\n 56: 16,\n 48: 16,\n 40: 16,\n 36: 16,\n 32: 12,\n 24: 12,\n 16: 8,\n};\n\nconst initialSizeByAvatarSize: Record<AvatarSize, number> = {\n 56: 28,\n 48: 24,\n 40: 20,\n 36: 16,\n 32: 16,\n 24: 12,\n 16: 8,\n};\n\nconst automaticBigSymbolNetwork: AvatarNetwork[] = ['youtube'];\n\ntype BackgroundView =\n | { mode: 'image'; image: { src: string; size: number; alt?: string } }\n | { mode: 'initials'; text: string }\n | { mode: 'symbol'; symbolId: agorapulseSymbol; big?: boolean }\n | { mode?: never };\n\ntype OverlayView = { mode: 'online' } | { mode: 'network'; network: NetworkName; round: boolean } | { mode?: never };\n\n@Component({\n selector: 'ap-avatar',\n changeDetection: ChangeDetectionStrategy.OnPush,\n templateUrl: './avatar.component.html',\n styleUrls: ['./avatar.component.scss'],\n standalone: true,\n imports: [NgOptimizedImage, SymbolComponent, NgClass, NetworkSymbolPipe],\n hostDirectives: [NgStyle],\n host: {\n '[class.background-default]': '!showBigNetworkBackground()',\n role: 'presentation',\n },\n})\nexport class AvatarComponent {\n profilePicture = input<string>();\n alt = input('');\n network = input(undefined, {\n transform: (v?: AvatarNetwork | string) => (v !== undefined ? (v as AvatarNetwork) : v),\n });\n size = input<AvatarSize | `${AvatarSize}`>(40);\n username = input<string>();\n showInitials = input<boolean | string>();\n bigNetwork = input(false);\n anonymous = input(false);\n online = input(false);\n hideBigNetwork = input(false, { alias: 'youtubeAvatarMode' });\n rounded = input(true, { transform: booleanAttribute });\n\n private imageError = signal(false);\n\n backgroundView = computed<BackgroundView>(() => this.buildBackgroundView());\n overlayView = computed<OverlayView>(() => this.buildOverlayView());\n private useBigNetwork = computed(() => {\n return (this.automaticBigSymbolNetwork() || this.bigNetwork()) && this.network();\n });\n private automaticBigSymbolNetwork = computed(() => {\n return automaticBigSymbolNetwork.includes(this.network() as AvatarNetwork);\n });\n protected showBigNetworkBackground = computed(() => {\n return !this.anonymous() && this.useBigNetwork() && (!this.validProfilePicture() || !this.hideBigNetwork());\n });\n private validProfilePicture = computed(() => {\n return !this.imageError() ? this.profilePicture() : undefined;\n });\n\n constructor(\n symbolRegistry: SymbolRegistry,\n private ngStyle: NgStyle\n ) {\n const networkSymbols = Object.values(networkDescription) //\n .flatMap(({ symbol }) => (typeof symbol !== 'string' ? [symbol] : []));\n\n symbolRegistry.registerSymbols([...networkSymbols, apSingleNeutral, apShowTheaterMaskHappy]);\n\n effect(() => {\n this.ngStyle.ngStyle = this.buildHostStyle();\n this.ngStyle.ngDoCheck();\n });\n effect(() => {\n this.profilePicture(); // on change\n untracked(() => this.imageError.set(false));\n });\n }\n\n onImageError(): void {\n this.imageError.set(true);\n }\n\n private buildBackgroundView(): BackgroundView {\n let bgView: BackgroundView;\n\n if (this.showBigNetworkBackground()) {\n bgView = { mode: 'symbol', symbolId: toNetworkSymbol(this.network()!), big: true };\n } else if (this.anonymous()) {\n bgView = { mode: 'symbol', symbolId: apShowTheaterMaskHappy.name };\n } else {\n const profilePicture = this.validProfilePicture();\n\n if (profilePicture) {\n bgView = {\n mode: 'image',\n image: {\n src: profilePicture,\n size: +this.size(),\n alt: this.alt(),\n },\n };\n } else {\n const initials = this.showInitials();\n\n if (initials !== false && initials !== undefined) {\n const useDefault = initials === true || initials === '';\n const candidateName = (useDefault ? this.username()?.charAt(0) ?? '' : initials.slice(0, 2)).toUpperCase();\n bgView = { mode: 'initials', text: candidateName };\n } else {\n bgView = { mode: 'symbol', symbolId: apSingleNeutral.name };\n }\n }\n }\n\n return bgView;\n }\n\n private buildOverlayView(): OverlayView {\n let ovlView: OverlayView = {};\n const network = this.network();\n\n if (this.online()) {\n ovlView = { mode: 'online' };\n } else if (network && !this.showBigNetworkBackground() && !this.automaticBigSymbolNetwork()) {\n // unit tests in platform repo gives random network values which are unchecked by the compiler\n const { round } = networkDescription[network] ?? {};\n ovlView = { mode: 'network', network, round };\n }\n\n return ovlView;\n }\n\n private buildHostStyle() {\n const bgView = this.backgroundView();\n const ovlMode = this.overlayView().mode;\n const size = this.size();\n\n return {\n '--ap-avatar-size': `${size}px`,\n '--ap-avatar-border-radius': this.rounded() ? '100%' : 'var(--sys-border-radius-sm)',\n '--ap-avatar-initials-size': bgView.mode == 'initials' ? `${initialSizeByAvatarSize[size]}px` : '',\n '--ap-avatar-symbol-size': bgView.mode == 'symbol' ? `${bgView.big ? size : symbolSizeByAvatarSize[size]}px` : '',\n '--ap-avatar-network-size': ovlMode == 'network' ? `${networkSizeByAvatarSize[size]}px` : '',\n '--ap-avatar-online-icon-size': ovlMode == 'online' ? `${onlineIconSizeByAvatarSize[size]}px` : '',\n };\n }\n}\n","<!-- background -->\n@if (backgroundView(); as bgView) {\n @switch (bgView.mode) {\n @case ('image') {\n <img\n class=\"bg-image\"\n [ngSrc]=\"bgView.image.src\"\n [width]=\"bgView.image.size\"\n [height]=\"bgView.image.size\"\n [alt]=\"bgView.image.alt\"\n (error)=\"onImageError()\" />\n }\n @case ('initials') {\n <div class=\"bg-initials\">\n {{ bgView.text }}\n </div>\n }\n @case ('symbol') {\n <div\n class=\"bg-symbol\"\n [ngClass]=\"['sym-' + bgView.symbolId, bgView.big ? 'big' : '']\">\n <ap-symbol [symbolId]=\"bgView.symbolId\" />\n </div>\n }\n }\n}\n\n<!-- overlay -->\n@if (overlayView(); as ovlView) {\n @switch (ovlView.mode) {\n @case ('network') {\n <div\n class=\"ovl-network\"\n [class.round]=\"ovlView.round\"\n [ngClass]=\"ovlView.network\">\n <ap-symbol [symbolId]=\"ovlView.network | networkSymbol\" />\n </div>\n }\n @case ('online') {\n <div class=\"ovl-online\"></div>\n }\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;;AAiBA,MAAM,0BAA0B,GAA+B;AAC3D,IAAA,EAAE,EAAE,EAAE;AACN,IAAA,EAAE,EAAE,EAAE;AACN,IAAA,EAAE,EAAE,EAAE;AACN,IAAA,EAAE,EAAE,CAAC;AACL,IAAA,EAAE,EAAE,CAAC;AACL,IAAA,EAAE,EAAE,CAAC;AACL,IAAA,EAAE,EAAE,CAAC;CACR;AAED,MAAM,sBAAsB,GAA+B;AACvD,IAAA,EAAE,EAAE,EAAE;AACN,IAAA,EAAE,EAAE,EAAE;AACN,IAAA,EAAE,EAAE,EAAE;AACN,IAAA,EAAE,EAAE,EAAE;AACN,IAAA,EAAE,EAAE,EAAE;AACN,IAAA,EAAE,EAAE,EAAE;AACN,IAAA,EAAE,EAAE,CAAC;CACR;AAED,MAAM,uBAAuB,GAA+B;AACxD,IAAA,EAAE,EAAE,EAAE;AACN,IAAA,EAAE,EAAE,EAAE;AACN,IAAA,EAAE,EAAE,EAAE;AACN,IAAA,EAAE,EAAE,EAAE;AACN,IAAA,EAAE,EAAE,EAAE;AACN,IAAA,EAAE,EAAE,EAAE;AACN,IAAA,EAAE,EAAE,CAAC;CACR;AAED,MAAM,uBAAuB,GAA+B;AACxD,IAAA,EAAE,EAAE,EAAE;AACN,IAAA,EAAE,EAAE,EAAE;AACN,IAAA,EAAE,EAAE,EAAE;AACN,IAAA,EAAE,E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EAAA,gBAAgB,gPAAE,eAAe,EAAA,QAAA,EAAA,WAAA,EAAA,MAAA,EAAA,CAAA,UAAA,EAAA,OAAA,EAAA,MAAA,CAAA,EAAA,OAAA,EAAA,CAAA,YAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAE,OAAO,EAAA,QAAA,EAAA,WAAA,EAAA,MAAA,EAAA,CAAA,OAAA,EAAA,SAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,MAAA,EAAA,IAAA,EAAE,iBAAiB,EAAA,IAAA,EAAA,eAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA;;2FAO9D,eAAe,EAAA,UAAA,EAAA,CAAA;kBAb3B,SAAS;+BACI,WAAW,EAAA,eAAA,EACJ,uBAAuB,CAAC,MAAM,cAGnC,IAAI,EAAA,OAAA,EACP,CAAC,gBAAgB,EAAE,eAAe,EAAE,OAAO,EAAE,iBAAiB,CAAC,kBACxD,CAAC,OAAO,CAAC,EACnB,IAAA,EAAA;AACF,wBAAA,4BAA4B,EAAE,6BAA6B;AAC3D,wBAAA,IAAI,EAAE,cAAc;AACvB,qBAAA,EAAA,QAAA,EAAA,4wCAAA,EAAA,MAAA,EAAA,CAAA,+vEAAA,CAAA,EAAA;;;AE9EL;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"agorapulse-ui-components-avatar.mjs","sources":["../../../libs/ui-components/avatar/src/avatar.component.ts","../../../libs/ui-components/avatar/src/avatar.component.html","../../../libs/ui-components/avatar/src/agorapulse-ui-components-avatar.ts"],"sourcesContent":["import {\n agorapulseSymbol,\n apShowTheaterMaskHappy,\n apSingleNeutral,\n networkDescription,\n NetworkName,\n NetworkSymbolPipe,\n SymbolComponent,\n SymbolRegistry,\n toNetworkSymbol,\n} from '@agorapulse/ui-symbol';\nimport { NgClass, NgOptimizedImage, NgStyle } from '@angular/common';\nimport { booleanAttribute, ChangeDetectionStrategy, Component, computed, effect, input, signal, untracked } from '@angular/core';\n\nexport type AvatarNetwork = NetworkName;\nexport type AvatarSize = 56 | 48 | 40 | 36 | 32 | 24 | 16;\n\nconst onlineIconSizeByAvatarSize: Record<AvatarSize, number> = {\n 56: 16,\n 48: 12,\n 40: 12,\n 36: 8,\n 32: 8,\n 24: 6,\n 16: 6,\n};\n\nconst symbolSizeByAvatarSize: Record<AvatarSize, number> = {\n 56: 28,\n 48: 24,\n 40: 20,\n 36: 18,\n 32: 16,\n 24: 12,\n 16: 8,\n};\n\nconst networkSizeByAvatarSize: Record<AvatarSize, number> = {\n 56: 16,\n 48: 16,\n 40: 16,\n 36: 16,\n 32: 12,\n 24: 12,\n 16: 8,\n};\n\nconst initialSizeByAvatarSize: Record<AvatarSize, number> = {\n 56: 28,\n 48: 24,\n 40: 20,\n 36: 16,\n 32: 16,\n 24: 12,\n 16: 8,\n};\n\nconst automaticBigSymbolNetwork: AvatarNetwork[] = ['youtube'];\n\ntype BackgroundView =\n | { mode: 'image'; image: { src: string; size: number; alt?: string } }\n | { mode: 'initials'; text: string }\n | { mode: 'symbol'; symbolId: agorapulseSymbol; big?: boolean }\n | { mode?: never };\n\ntype OverlayView = { mode: 'online' } | { mode: 'network'; network: NetworkName; round: boolean } | { mode?: never };\n\n@Component({\n selector: 'ap-avatar',\n changeDetection: ChangeDetectionStrategy.OnPush,\n templateUrl: './avatar.component.html',\n styleUrls: ['./avatar.component.scss'],\n standalone: true,\n imports: [NgOptimizedImage, SymbolComponent, NgClass, NetworkSymbolPipe],\n hostDirectives: [NgStyle],\n host: {\n '[class.background-default]': '!showBigNetworkBackground()',\n role: 'presentation',\n },\n})\nexport class AvatarComponent {\n profilePicture = input<string>();\n alt = input('');\n network = input(undefined, {\n transform: (v?: AvatarNetwork | string) => (v !== undefined ? (v as AvatarNetwork) : v),\n });\n size = input<AvatarSize | `${AvatarSize}`>(40);\n username = input<string>();\n showInitials = input<boolean | string>();\n bigNetwork = input(false);\n anonymous = input(false);\n online = input(false);\n hideBigNetwork = input(false, { alias: 'youtubeAvatarMode' }); // TODO: rename youtubeAvatarMode to hideBigNetwork in platform\n rounded = input(true, { transform: booleanAttribute });\n\n private imageError = signal(false);\n\n backgroundView = computed<BackgroundView>(() => this.buildBackgroundView());\n overlayView = computed<OverlayView>(() => this.buildOverlayView());\n private useBigNetwork = computed(() => {\n return (this.automaticBigSymbolNetwork() || this.bigNetwork()) && this.network();\n });\n private automaticBigSymbolNetwork = computed(() => {\n return automaticBigSymbolNetwork.includes(this.network() as AvatarNetwork);\n });\n protected showBigNetworkBackground = computed(() => {\n return !this.anonymous() && this.useBigNetwork() && (!this.validProfilePicture() || !this.hideBigNetwork());\n });\n private validProfilePicture = computed(() => {\n return !this.imageError() ? this.profilePicture() : undefined;\n });\n\n constructor(\n symbolRegistry: SymbolRegistry,\n private ngStyle: NgStyle\n ) {\n const networkSymbols = Object.values(networkDescription) //\n .flatMap(({ symbol }) => (typeof symbol !== 'string' ? [symbol] : []));\n\n symbolRegistry.registerSymbols([...networkSymbols, apSingleNeutral, apShowTheaterMaskHappy]);\n\n effect(() => {\n this.ngStyle.ngStyle = this.buildHostStyle();\n this.ngStyle.ngDoCheck();\n });\n effect(() => {\n this.profilePicture(); // on change\n untracked(() => this.imageError.set(false));\n });\n }\n\n onImageError(): void {\n this.imageError.set(true);\n }\n\n private buildBackgroundView(): BackgroundView {\n let bgView: BackgroundView;\n\n if (this.showBigNetworkBackground()) {\n bgView = { mode: 'symbol', symbolId: toNetworkSymbol(this.network()!), big: true };\n } else if (this.anonymous()) {\n bgView = { mode: 'symbol', symbolId: apShowTheaterMaskHappy.name };\n } else {\n const profilePicture = this.validProfilePicture();\n\n if (profilePicture) {\n bgView = {\n mode: 'image',\n image: {\n src: profilePicture,\n size: +this.size(),\n alt: this.alt(),\n },\n };\n } else {\n const initials = this.showInitials();\n\n if (initials !== false && initials !== undefined) {\n const useDefault = initials === true || initials === '';\n const candidateName = (useDefault ? this.username()?.charAt(0) ?? '' : initials.slice(0, 2)).toUpperCase();\n bgView = { mode: 'initials', text: candidateName };\n } else {\n bgView = { mode: 'symbol', symbolId: apSingleNeutral.name };\n }\n }\n }\n\n return bgView;\n }\n\n private buildOverlayView(): OverlayView {\n let ovlView: OverlayView = {};\n const network = this.network();\n\n if (this.online()) {\n ovlView = { mode: 'online' };\n } else if (network && !this.showBigNetworkBackground() && !this.automaticBigSymbolNetwork()) {\n // unit tests in platform repo gives random network values which are unchecked by the compiler\n const { round } = networkDescription[network] ?? {};\n ovlView = { mode: 'network', network, round };\n }\n\n return ovlView;\n }\n\n private buildHostStyle() {\n const bgView = this.backgroundView();\n const ovlMode = this.overlayView().mode;\n const size = this.size();\n\n return {\n '--ap-avatar-size': `${size}px`,\n '--ap-avatar-border-radius': this.rounded() ? '100%' : 'var(--sys-border-radius-sm)',\n '--ap-avatar-initials-size': bgView.mode == 'initials' ? `${initialSizeByAvatarSize[size]}px` : '',\n '--ap-avatar-symbol-size': bgView.mode == 'symbol' ? `${bgView.big ? size : symbolSizeByAvatarSize[size]}px` : '',\n '--ap-avatar-network-size': ovlMode == 'network' ? `${networkSizeByAvatarSize[size]}px` : '',\n '--ap-avatar-online-icon-size': ovlMode == 'online' ? `${onlineIconSizeByAvatarSize[size]}px` : '',\n };\n }\n}\n","<!-- background -->\n@if (backgroundView(); as bgView) {\n @switch (bgView.mode) {\n @case ('image') {\n <img\n class=\"bg-image\"\n [ngSrc]=\"bgView.image.src\"\n [width]=\"bgView.image.size\"\n [height]=\"bgView.image.size\"\n [alt]=\"bgView.image.alt\"\n (error)=\"onImageError()\" />\n }\n @case ('initials') {\n <div class=\"bg-initials\">\n {{ bgView.text }}\n </div>\n }\n @case ('symbol') {\n <div\n class=\"bg-symbol\"\n [ngClass]=\"['sym-' + bgView.symbolId, bgView.big ? 'big' : '']\">\n <ap-symbol [symbolId]=\"bgView.symbolId\" />\n </div>\n }\n }\n}\n\n<!-- overlay -->\n@if (overlayView(); as ovlView) {\n @switch (ovlView.mode) {\n @case ('network') {\n <div\n class=\"ovl-network\"\n [class.round]=\"ovlView.round\"\n [ngClass]=\"ovlView.network\">\n <ap-symbol [symbolId]=\"ovlView.network | networkSymbol\" />\n </div>\n }\n @case ('online') {\n <div class=\"ovl-online\"></div>\n }\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;;AAiBA,MAAM,0BAA0B,GAA+B;AAC3D,IAAA,EAAE,EAAE,EAAE;AACN,IAAA,EAAE,EAAE,EAAE;AACN,IAAA,EAAE,EAAE,EAAE;AACN,IAAA,EAAE,EAAE,CAAC;AACL,IAAA,EAAE,EAAE,CAAC;AACL,IAAA,EAAE,EAAE,CAAC;AACL,IAAA,EAAE,EAAE,CAAC;CACR;AAED,MAAM,sBAAsB,GAA+B;AACvD,IAAA,EAAE,EAAE,EAAE;AACN,IAAA,EAAE,EAAE,EAAE;AACN,IAAA,EAAE,EAAE,EAAE;AACN,IAAA,EAAE,EAAE,EAAE;AACN,IAAA,EAAE,EAAE,EAAE;AACN,IAAA,EAAE,EAAE,EAAE;AACN,IAAA,EAAE,EAAE,CAAC;CACR;AAED,MAAM,uBAAuB,GAA+B;AACxD,IAAA,EAAE,EAAE,EAAE;AACN,IAAA,EAAE,EAAE,EAAE;AACN,IAAA,EAAE,EAAE,EAAE;AACN,IAAA,EAAE,EAAE,EAAE;AACN,IAAA,EAAE,EAAE,EAAE;AACN,IAAA,EAAE,EAAE,EAAE;AACN,IAAA,EAAE,EAAE,CAAC;CACR;AAED,MAAM,uBAAuB,GAA+B;AACxD,IAAA,EAAE,EAAE,EAAE;AACN,IAAA,EAAE,EAAE,EAAE;AACN,IAAA,EAAE,EAAE,EAAE;AACN,IAAA,EAAE,EAAE,EAAE;AACN,IAAA,EAAE,EAAE,EAAE;AACN,IAAA,EAAE,EAAE,EAAE;AACN,IAAA,EAAE,EAAE,CAAC;CACR;AAED,MAAM,yBAAyB,GAAoB,CAAC,SAAS,CA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AAA,YAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAE,OAAO,EAAA,QAAA,EAAA,WAAA,EAAA,MAAA,EAAA,CAAA,OAAA,EAAA,SAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,MAAA,EAAA,IAAA,EAAE,iBAAiB,EAAA,IAAA,EAAA,eAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA;;2FAO9D,eAAe,EAAA,UAAA,EAAA,CAAA;kBAb3B,SAAS;+BACI,WAAW,EAAA,eAAA,EACJ,uBAAuB,CAAC,MAAM,cAGnC,IAAI,EAAA,OAAA,EACP,CAAC,gBAAgB,EAAE,eAAe,EAAE,OAAO,EAAE,iBAAiB,CAAC,kBACxD,CAAC,OAAO,CAAC,EACnB,IAAA,EAAA;AACF,wBAAA,4BAA4B,EAAE,6BAA6B;AAC3D,wBAAA,IAAI,EAAE,cAAc;AACvB,qBAAA,EAAA,QAAA,EAAA,4wCAAA,EAAA,MAAA,EAAA,CAAA,+vEAAA,CAAA,EAAA;;;AE9EL;;AAEG;;;;"}
|
|
@@ -4,11 +4,11 @@ import { HostBinding, Input, ViewEncapsulation, ChangeDetectionStrategy, Compone
|
|
|
4
4
|
class BadgeComponent {
|
|
5
5
|
color = 'blue';
|
|
6
6
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.9", ngImport: i0, type: BadgeComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
7
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.9", type: BadgeComponent, isStandalone: true, selector: "ap-badge", inputs: { color: "color" }, host: { properties: { "class": "this.color" } }, ngImport: i0, template: "<ng-content
|
|
7
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.9", type: BadgeComponent, isStandalone: true, selector: "ap-badge", inputs: { color: "color" }, host: { properties: { "class": "this.color" } }, ngImport: i0, template: "<ng-content>Badge text</ng-content>\n", styles: ["ap-badge{display:flex;padding:0 var(--comp-badge-padding-right) 0 var(--comp-badge-padding-left);font-weight:var(--comp-badge-text-style-font-weight);font-family:var(--comp-badge-text-style-font-family);line-height:var(--comp-badge-text-style-line-height);font-size:var(--comp-badge-text-style-size);height:var(--comp-badge-height);max-height:var(--comp-badge-height);border-radius:2px}ap-badge.blue{background-color:var(--comp-badge-blue-background-color);color:var(--comp-badge-blue-color)}ap-badge.orange{text-transform:uppercase;background-color:var(--comp-badge-orange-background-color);color:var(--comp-badge-orange-color)}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
8
8
|
}
|
|
9
9
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.9", ngImport: i0, type: BadgeComponent, decorators: [{
|
|
10
10
|
type: Component,
|
|
11
|
-
args: [{ changeDetection: ChangeDetectionStrategy.OnPush, selector: 'ap-badge', standalone: true, imports: [], encapsulation: ViewEncapsulation.None, template: "<ng-content
|
|
11
|
+
args: [{ changeDetection: ChangeDetectionStrategy.OnPush, selector: 'ap-badge', standalone: true, imports: [], encapsulation: ViewEncapsulation.None, template: "<ng-content>Badge text</ng-content>\n", styles: ["ap-badge{display:flex;padding:0 var(--comp-badge-padding-right) 0 var(--comp-badge-padding-left);font-weight:var(--comp-badge-text-style-font-weight);font-family:var(--comp-badge-text-style-font-family);line-height:var(--comp-badge-text-style-line-height);font-size:var(--comp-badge-text-style-size);height:var(--comp-badge-height);max-height:var(--comp-badge-height);border-radius:2px}ap-badge.blue{background-color:var(--comp-badge-blue-background-color);color:var(--comp-badge-blue-color)}ap-badge.orange{text-transform:uppercase;background-color:var(--comp-badge-orange-background-color);color:var(--comp-badge-orange-color)}\n"] }]
|
|
12
12
|
}], propDecorators: { color: [{
|
|
13
13
|
type: HostBinding,
|
|
14
14
|
args: ['class']
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agorapulse-ui-components-badge.mjs","sources":["../../../libs/ui-components/badge/src/badge.component.ts","../../../libs/ui-components/badge/src/badge.component.html","../../../libs/ui-components/badge/src/agorapulse-ui-components-badge.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, HostBinding, Input, ViewEncapsulation } from '@angular/core';\n\nexport type BadgeColor = 'blue' | 'orange';\n\n@Component({\n changeDetection: ChangeDetectionStrategy.OnPush,\n selector: 'ap-badge',\n standalone: true,\n templateUrl: './badge.component.html',\n imports: [],\n styleUrls: ['./badge.component.scss'],\n encapsulation: ViewEncapsulation.None,\n})\nexport class BadgeComponent {\n @HostBinding('class')\n @Input()\n color: BadgeColor = 'blue';\n}\n","<ng-content
|
|
1
|
+
{"version":3,"file":"agorapulse-ui-components-badge.mjs","sources":["../../../libs/ui-components/badge/src/badge.component.ts","../../../libs/ui-components/badge/src/badge.component.html","../../../libs/ui-components/badge/src/agorapulse-ui-components-badge.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, HostBinding, Input, ViewEncapsulation } from '@angular/core';\n\nexport type BadgeColor = 'blue' | 'orange';\n\n@Component({\n changeDetection: ChangeDetectionStrategy.OnPush,\n selector: 'ap-badge',\n standalone: true,\n templateUrl: './badge.component.html',\n imports: [],\n styleUrls: ['./badge.component.scss'],\n encapsulation: ViewEncapsulation.None,\n})\nexport class BadgeComponent {\n @HostBinding('class')\n @Input()\n color: BadgeColor = 'blue';\n}\n","<ng-content>Badge text</ng-content>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;MAaa,cAAc,CAAA;IAGvB,KAAK,GAAe,MAAM;uGAHjB,cAAc,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;AAAd,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,cAAc,iJCb3B,uCACA,EAAA,MAAA,EAAA,CAAA,ynBAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,aAAA,EAAA,EAAA,CAAA,iBAAA,CAAA,IAAA,EAAA,CAAA;;2FDYa,cAAc,EAAA,UAAA,EAAA,CAAA;kBAT1B,SAAS;sCACW,uBAAuB,CAAC,MAAM,EAAA,QAAA,EACrC,UAAU,EAAA,UAAA,EACR,IAAI,EAAA,OAAA,EAEP,EAAE,EAAA,aAAA,EAEI,iBAAiB,CAAC,IAAI,EAAA,QAAA,EAAA,uCAAA,EAAA,MAAA,EAAA,CAAA,ynBAAA,CAAA,EAAA;8BAKrC,KAAK,EAAA,CAAA;sBAFJ,WAAW;uBAAC,OAAO;;sBACnB;;;AEfL;;AAEG;;;;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { inject, EventEmitter, booleanAttribute, HostListener,
|
|
2
|
+
import { inject, input, EventEmitter, booleanAttribute, HostListener, Output, Input, ViewChild, ViewEncapsulation, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
3
|
import * as i1 from '@agorapulse/ui-components/directives';
|
|
4
4
|
import { BaseButtonDirective } from '@agorapulse/ui-components/directives';
|
|
5
5
|
import { SymbolComponent } from '@agorapulse/ui-symbol';
|
|
@@ -21,6 +21,7 @@ class ButtonComponent {
|
|
|
21
21
|
locked = false;
|
|
22
22
|
menuTrigger = null;
|
|
23
23
|
symbolPosition = 'right';
|
|
24
|
+
symbolId = input();
|
|
24
25
|
menuOpened = new EventEmitter();
|
|
25
26
|
menuClosed = new EventEmitter();
|
|
26
27
|
// eslint-disable-next-line @angular-eslint/no-output-native
|
|
@@ -29,17 +30,12 @@ class ButtonComponent {
|
|
|
29
30
|
focus = new EventEmitter();
|
|
30
31
|
// eslint-disable-next-line @angular-eslint/no-output-native
|
|
31
32
|
blur = new EventEmitter();
|
|
32
|
-
// Specific ionic behaviour with modal trigger on html side. We cannot use stopImmediatePropagation otherwise the modal doesn't open.
|
|
33
|
-
// Maybe we can remove this hack once we rename click event by onClick
|
|
34
|
-
ionicModalEnabled = false;
|
|
35
33
|
focused = false;
|
|
36
34
|
onClickHandle($event) {
|
|
37
35
|
if (this.disabled || this.loading) {
|
|
38
36
|
return;
|
|
39
37
|
}
|
|
40
|
-
|
|
41
|
-
$event.stopImmediatePropagation();
|
|
42
|
-
}
|
|
38
|
+
$event.stopImmediatePropagation();
|
|
43
39
|
this.click.emit($event);
|
|
44
40
|
this.buttonElement.nativeElement.blur();
|
|
45
41
|
this.blur.emit($event);
|
|
@@ -59,13 +55,13 @@ class ButtonComponent {
|
|
|
59
55
|
}
|
|
60
56
|
}
|
|
61
57
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.9", ngImport: i0, type: ButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
62
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.9", type: ButtonComponent, isStandalone: true, selector: "ap-button", inputs: { ariaLabel: "ariaLabel", disabled: ["disabled", "disabled", booleanAttribute], name: "name", form: "form", config: "config", loading: "loading", locked: "locked", menuTrigger: "menuTrigger", symbolPosition: "symbolPosition", ionicModalEnabled: "ionicModalEnabled" }, outputs: { menuOpened: "menuOpened", menuClosed: "menuClosed", click: "click", focus: "focus", blur: "blur" }, host: { listeners: { "window:keyup.space": "onSpaceKeyUp($event)" }, properties: { "attr.disabled": "disabled || null" } }, providers: [], viewQueries: [{ propertyName: "buttonElement", first: true, predicate: ["button"], descendants: true }], hostDirectives: [{ directive: i1.BaseButtonDirective }], ngImport: i0, template: "<button\n #button\n #trigger=\"matMenuTrigger\"\n role=\"button\"\n [matMenuTriggerFor]=\"menuTrigger\"\n [class.primary]=\"config.style === 'primary' && !locked\"\n [class.secondary]=\"config.style === 'secondary' && !locked\"\n [class.ghost]=\"config.style === 'ghost' && !locked\"\n [class.stroked]=\"(config.style === 'stroked' || config.style === 'stroked-transparent') && !locked\"\n [class.transparent]=\"config.style === 'stroked-transparent' && !locked\"\n [class.orange]=\"config.color === 'orange' && !locked\"\n [class.blue]=\"config.color === 'blue' && !locked\"\n [class.red]=\"config.color === 'red' && !locked\"\n [class.grey]=\"config.color === 'grey' && !locked\"\n [class.loading]=\"loading && !locked\"\n [class.locked]=\"locked\"\n [class.inverse]=\"symbolPosition === 'left'\"\n [disabled]=\"disabled && !locked\"\n [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></ng-content>\n <ng-content select=\"ap-symbol\"></ng-content>\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=\"premium-star\"\n size=\"sm\" />\n </div>\n}\n", styles: ["ap-button{--loading-bar-width: 50px;display:inline-block;position:relative}ap-button[disabled]{pointer-events:none}ap-button button{border:none;border-radius:4px;padding:var(--comp-button-padding-horizontal) var(--comp-button-padding-vertical);position:relative;overflow:hidden;display:flex;justify-content:center;align-items:center;gap:var(--comp-split-button-spacing);flex-direction:row;font-size:var(--comp-button-text-size);font-family:var(--comp-button-text-font-family);line-height:var(--comp-button-text-line-height);font-weight:var(--comp-button-text-weight);max-height:var(--comp-button-height);min-height:var(--comp-button-height);white-space:nowrap;text-overflow:ellipsis;width:100%}ap-button button ap-symbol{width:16px;min-width:16px;max-width:16px;height:16px;min-height:16px;max-height:16px}ap-button button.inverse{flex-direction:row-reverse}ap-button button:hover:not(:disabled):not(.loading){cursor:pointer}ap-button button:disabled{pointer-events:none}@media (hover: hover){ap-button button:focus:not(:disabled):not(:active):not(.loading){outline:2px solid var(--ref-color-electric-blue-100);outline-offset:1px}}ap-button button.loading{pointer-events:none}ap-button button.primary{color:var(--ref-color-white)}ap-button button.primary ap-symbol{color:var(--ref-color-white)}ap-button button.primary.orange{background:var(--ref-color-orange-100)}ap-button button.primary.orange:hover{background-color:var(--ref-color-orange-80)}ap-button button.primary.orange:active:not(:disabled){background-color:var(--ref-color-orange-60)}ap-button button.primary.orange:disabled{background-color:var(--ref-color-orange-20)}ap-button button.primary.orange.loading{background-color:var(--ref-color-orange-60)}ap-button button.primary.orange .loading-bar{background-color:var(--ref-color-orange-100)}ap-button button.primary.blue{background:var(--ref-color-electric-blue-100)}ap-button button.primary.blue:hover{background-color:var(--ref-color-electric-blue-80)}ap-button button.primary.blue:active:not(:disabled){background-color:var(--ref-color-electric-blue-60)}ap-button button.primary.blue:disabled{background-color:var(--ref-color-electric-blue-20)}ap-button button.primary.blue.loading{background-color:var(--ref-color-electric-blue-60)}ap-button button.primary.blue .loading-bar{background-color:var(--ref-color-electric-blue-100)}ap-button button.secondary.orange{background:var(--ref-color-orange-10);color:var(--ref-color-orange-100)}ap-button button.secondary.orange ap-symbol{color:var(--ref-color-orange-100)}ap-button button.secondary.orange:hover{background-color:var(--ref-color-orange-20)}ap-button button.secondary.orange:active:not(:disabled){background-color:var(--ref-color-orange-40)}ap-button button.secondary.orange:focus:not(:disabled):not(:active){background-color:var(--ref-color-orange-10)}ap-button button.secondary.orange:disabled{background-color:var(--ref-color-orange-10);color:var(--ref-color-orange-20)}ap-button button.secondary.orange:disabled ap-symbol{color:var(--ref-color-orange-20)}ap-button button.secondary.orange.loading{background-color:var(--ref-color-orange-40)}ap-button button.secondary.orange .loading-bar{background-color:var(--ref-color-orange-100)}ap-button button.secondary.blue{background:var(--ref-color-electric-blue-10);color:var(--ref-color-electric-blue-100)}ap-button button.secondary.blue ap-symbol{color:var(--ref-color-electric-blue-100)}ap-button button.secondary.blue:hover{background-color:var(--ref-color-electric-blue-20)}ap-button button.secondary.blue:active:not(:disabled){background-color:var(--ref-color-electric-blue-40)}ap-button button.secondary.blue:focus:not(:disabled):not(:active){background-color:var(--ref-color-electric-blue-10)}ap-button button.secondary.blue:disabled{background-color:var(--ref-color-electric-blue-10);color:var(--ref-color-electric-blue-20)}ap-button button.secondary.blue:disabled ap-symbol{color:var(--ref-color-electric-blue-20)}ap-button button.secondary.blue.loading{background-color:var(--ref-color-electric-blue-40)}ap-button button.secondary.blue .loading-bar{background-color:var(--ref-color-electric-blue-100)}ap-button button.stroked{background:var(--ref-color-white);border-width:1px;border-style:solid;color:var(--ref-color-grey-80)}ap-button button.stroked.grey{border-color:var(--ref-color-grey-20)}ap-button button.stroked.grey ap-symbol{color:var(--ref-color-grey-80)}ap-button button.stroked.grey:hover{border-color:var(--ref-color-grey-40)}ap-button button.stroked.grey:active:not(:disabled){border-color:var(--ref-color-grey-60)}ap-button button.stroked.grey:focus:not(:disabled):not(:active){border-color:var(--ref-color-grey-20)}ap-button button.stroked.grey:disabled{border-color:var(--ref-color-grey-20);color:var(--ref-color-grey-20)}ap-button button.stroked.grey:disabled ap-symbol{color:var(--ref-color-grey-20)}ap-button button.stroked.grey.loading{border-color:var(--ref-color-grey-20);color:var(--ref-color-grey-40)}ap-button button.stroked.grey.loading ap-symbol{color:var(--ref-color-grey-40)}ap-button button.stroked.grey .loading-bar{background-color:var(--ref-color-grey-80)}ap-button button.stroked.blue{border-color:var(--ref-color-electric-blue-60);color:var(--ref-color-electric-blue-100)}ap-button button.stroked.blue ap-symbol{color:var(--ref-color-electric-blue-100)}ap-button button.stroked.blue:hover{border-color:var(--ref-color-electric-blue-80)}ap-button button.stroked.blue:active:not(:disabled){border-color:var(--ref-color-electric-blue-100)}ap-button button.stroked.blue:focus:not(:disabled):not(:active){border-color:var(--ref-color-electric-blue-60)}ap-button button.stroked.blue:disabled{border-color:var(--ref-color-electric-blue-20);color:var(--ref-color-electric-blue-20)}ap-button button.stroked.blue:disabled ap-symbol{color:var(--ref-color-electric-blue-20)}ap-button button.stroked.blue.loading{border-color:var(--ref-color-electric-blue-20);color:var(--ref-color-electric-blue-40)}ap-button button.stroked.blue.loading ap-symbol{color:var(--ref-color-electric-blue-40)}ap-button button.stroked.blue .loading-bar{background-color:var(--ref-color-electric-blue-100)}ap-button button.transparent{background:transparent}ap-button button.ghost{background:transparent}ap-button button.ghost.grey{color:var(--ref-color-grey-80)}ap-button button.ghost.grey ap-symbol{color:var(--ref-color-grey-80)}ap-button button.ghost.grey:hover{background-color:var(--ref-color-grey-05)}ap-button button.ghost.grey:active:not(:disabled){background-color:var(--ref-color-grey-10)}ap-button button.ghost.grey:focus:not(:disabled):not(:active){background-color:var(--ref-color-grey-10)}ap-button button.ghost.grey:disabled{color:var(--ref-color-grey-20)}ap-button button.ghost.grey:disabled ap-symbol{color:var(--ref-color-grey-20)}ap-button button.ghost.grey.loading:not(.locked){color:var(--ref-color-grey-40)}ap-button button.ghost.grey.loading:not(.locked) ap-symbol{color:var(--ref-color-grey-40)}ap-button button.ghost.grey .loading-bar{background-color:var(--ref-color-grey-80)}ap-button button.ghost.blue{color:var(--ref-color-electric-blue-100)}ap-button button.ghost.blue ap-symbol{color:var(--ref-color-electric-blue-100)}ap-button button.ghost.blue:hover{background-color:var(--ref-color-electric-blue-10)}ap-button button.ghost.blue:active:not(:disabled){background-color:var(--ref-color-electric-blue-20)}ap-button button.ghost.blue:focus:not(:disabled):not(:active){background-color:var(--ref-color-electric-blue-20)}ap-button button.ghost.blue:disabled{color:var(--ref-color-electric-blue-20)}ap-button button.ghost.blue:disabled ap-symbol{color:var(--ref-color-electric-blue-20)}ap-button button.ghost.blue.loading{color:var(--ref-color-electric-blue-40)}ap-button button.ghost.blue.loading ap-symbol{color:var(--ref-color-electric-blue-40)}ap-button button.ghost.blue .loading-bar{background-color:var(--ref-color-electric-blue-100)}ap-button button.ghost.red{color:var(--ref-color-red-100)}ap-button button.ghost.red ap-symbol{color:var(--ref-color-red-100)}ap-button button.ghost.red:hover{background-color:var(--ref-color-red-10)}ap-button button.ghost.red:active:not(:disabled){background-color:var(--ref-color-red-20)}ap-button button.ghost.red:focus:not(:disabled):not(:active){background-color:var(--ref-color-red-20)}ap-button button.ghost.red:disabled{color:var(--ref-color-red-20)}ap-button button.ghost.red:disabled ap-symbol{color:var(--ref-color-red-20)}ap-button button.ghost.red.loading{color:var(--ref-color-red-40)}ap-button button.ghost.red.loading ap-symbol{color:var(--ref-color-red-40)}ap-button button.ghost.red .loading-bar{background-color:var(--ref-color-red-100)}ap-button button.locked{background-color:var(--ref-color-purple-10);color:var(--ref-color-purple-80);border:1px solid var(--ref-color-purple-20)}ap-button button.locked:hover{border-color:var(--ref-color-purple-40);background-color:var(--ref-color-purple-20)}ap-button button.locked:focus:not(:disabled):not(:active){border-color:var(--ref-color-purple-20);background-color:var(--ref-color-purple-20)}ap-button button.locked:active{border-color:var(--ref-color-purple-60);background-color:var(--ref-color-purple-40)}ap-button .loading-bar{position:absolute;bottom:0;left:var(--comp-button-padding-vertical);width:var(--loading-bar-width);height:5px;border-radius:8px;animation:slide 1.5s ease-in-out infinite}@keyframes slide{0%{left:calc(var(--loading-bar-width) * -1)}to{left:100%}}ap-button .locked-symbol{position:absolute;top:-6px;right:-6px;border-radius:100%;background:var(--ref-color-white)}ap-button .locked-symbol ap-symbol{color:var(--ref-color-purple-100)}\n"], dependencies: [{ kind: "component", type: SymbolComponent, selector: "ap-symbol", inputs: ["symbolId", "color", "size"], outputs: ["sizeChange"] }, { kind: "ngmodule", type: MatMenuModule }, { kind: "directive", type: i2.MatMenuTrigger, selector: "[mat-menu-trigger-for], [matMenuTriggerFor]", inputs: ["mat-menu-trigger-for", "matMenuTriggerFor", "matMenuTriggerData", "matMenuTriggerRestoreFocus"], outputs: ["menuOpened", "onMenuOpen", "menuClosed", "onMenuClose"], exportAs: ["matMenuTrigger"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
58
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.9", type: ButtonComponent, isStandalone: true, selector: "ap-button", inputs: { ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: false, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: false, isRequired: false, transformFunction: booleanAttribute }, name: { classPropertyName: "name", publicName: "name", isSignal: false, isRequired: true, transformFunction: null }, form: { classPropertyName: "form", publicName: "form", isSignal: false, isRequired: false, transformFunction: null }, config: { classPropertyName: "config", publicName: "config", isSignal: false, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: false, isRequired: false, transformFunction: null }, locked: { classPropertyName: "locked", publicName: "locked", isSignal: false, isRequired: false, transformFunction: null }, menuTrigger: { classPropertyName: "menuTrigger", publicName: "menuTrigger", isSignal: false, isRequired: false, transformFunction: null }, symbolPosition: { classPropertyName: "symbolPosition", publicName: "symbolPosition", isSignal: false, isRequired: false, transformFunction: null }, symbolId: { classPropertyName: "symbolId", publicName: "symbolId", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { menuOpened: "menuOpened", menuClosed: "menuClosed", click: "click", focus: "focus", blur: "blur" }, host: { listeners: { "window:keyup.space": "onSpaceKeyUp($event)" }, properties: { "attr.disabled": "disabled || null" } }, viewQueries: [{ propertyName: "buttonElement", first: true, predicate: ["button"], descendants: true }], hostDirectives: [{ directive: i1.BaseButtonDirective }], ngImport: i0, template: "<button\n #button\n #trigger=\"matMenuTrigger\"\n role=\"button\"\n [matMenuTriggerFor]=\"menuTrigger\"\n [class.primary]=\"config.style === 'primary' && !locked\"\n [class.secondary]=\"config.style === 'secondary' && !locked\"\n [class.ghost]=\"config.style === 'ghost' && !locked\"\n [class.stroked]=\"(config.style === 'stroked' || config.style === 'stroked-transparent') && !locked\"\n [class.transparent]=\"config.style === 'stroked-transparent' && !locked\"\n [class.orange]=\"config.color === 'orange' && !locked\"\n [class.blue]=\"config.color === 'blue' && !locked\"\n [class.red]=\"config.color === 'red' && !locked\"\n [class.grey]=\"config.color === 'grey' && !locked\"\n [class.loading]=\"loading && !locked\"\n [class.locked]=\"locked\"\n [class.inverse]=\"symbolPosition === 'left'\"\n [disabled]=\"disabled && !locked\"\n [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>Button text</ng-content>\n @if (symbolId()) {\n <ap-symbol [symbolId]=\"symbolId()\" />\n } @else {\n <ng-content select=\"ap-symbol\"></ng-content>\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=\"premium-star\"\n size=\"sm\" />\n </div>\n}\n", styles: ["ap-button{--loading-bar-width: 50px;display:inline-block;position:relative}ap-button[disabled]{pointer-events:none}ap-button button{border:none;border-radius:4px;padding:var(--comp-button-padding-horizontal) var(--comp-button-padding-vertical);position:relative;overflow:hidden;display:flex;justify-content:center;align-items:center;gap:var(--comp-split-button-spacing);flex-direction:row;font-size:var(--comp-button-text-size);font-family:var(--comp-button-text-font-family);line-height:var(--comp-button-text-line-height);font-weight:var(--comp-button-text-weight);max-height:var(--comp-button-height);min-height:var(--comp-button-height);white-space:nowrap;text-overflow:ellipsis;width:100%}ap-button button ap-symbol{width:16px;min-width:16px;max-width:16px;height:16px;min-height:16px;max-height:16px}ap-button button.inverse{flex-direction:row-reverse}ap-button button:hover:not(:disabled):not(.loading){cursor:pointer}ap-button button:disabled{pointer-events:none}@media (hover: hover){ap-button button:focus:not(:disabled):not(:active):not(.loading){outline:2px solid var(--ref-color-electric-blue-100);outline-offset:1px}}ap-button button.loading{pointer-events:none}ap-button button.primary{color:var(--ref-color-white)}ap-button button.primary ap-symbol{color:var(--ref-color-white)}ap-button button.primary.orange{background:var(--ref-color-orange-100)}ap-button button.primary.orange:hover{background-color:var(--ref-color-orange-80)}ap-button button.primary.orange:active:not(:disabled){background-color:var(--ref-color-orange-60)}ap-button button.primary.orange:disabled{background-color:var(--ref-color-orange-20)}ap-button button.primary.orange.loading{background-color:var(--ref-color-orange-60)}ap-button button.primary.orange .loading-bar{background-color:var(--ref-color-orange-100)}ap-button button.primary.blue{background:var(--ref-color-electric-blue-100)}ap-button button.primary.blue:hover{background-color:var(--ref-color-electric-blue-80)}ap-button button.primary.blue:active:not(:disabled){background-color:var(--ref-color-electric-blue-60)}ap-button button.primary.blue:disabled{background-color:var(--ref-color-electric-blue-20)}ap-button button.primary.blue.loading{background-color:var(--ref-color-electric-blue-60)}ap-button button.primary.blue .loading-bar{background-color:var(--ref-color-electric-blue-100)}ap-button button.secondary.orange{background:var(--ref-color-orange-10);color:var(--ref-color-orange-100)}ap-button button.secondary.orange ap-symbol{color:var(--ref-color-orange-100)}ap-button button.secondary.orange:hover{background-color:var(--ref-color-orange-20)}ap-button button.secondary.orange:active:not(:disabled){background-color:var(--ref-color-orange-40)}ap-button button.secondary.orange:focus:not(:disabled):not(:active){background-color:var(--ref-color-orange-10)}ap-button button.secondary.orange:disabled{background-color:var(--ref-color-orange-10);color:var(--ref-color-orange-20)}ap-button button.secondary.orange:disabled ap-symbol{color:var(--ref-color-orange-20)}ap-button button.secondary.orange.loading{background-color:var(--ref-color-orange-40)}ap-button button.secondary.orange .loading-bar{background-color:var(--ref-color-orange-100)}ap-button button.secondary.blue{background:var(--ref-color-electric-blue-10);color:var(--ref-color-electric-blue-100)}ap-button button.secondary.blue ap-symbol{color:var(--ref-color-electric-blue-100)}ap-button button.secondary.blue:hover{background-color:var(--ref-color-electric-blue-20)}ap-button button.secondary.blue:active:not(:disabled){background-color:var(--ref-color-electric-blue-40)}ap-button button.secondary.blue:focus:not(:disabled):not(:active){background-color:var(--ref-color-electric-blue-10)}ap-button button.secondary.blue:disabled{background-color:var(--ref-color-electric-blue-10);color:var(--ref-color-electric-blue-20)}ap-button button.secondary.blue:disabled ap-symbol{color:var(--ref-color-electric-blue-20)}ap-button button.secondary.blue.loading{background-color:var(--ref-color-electric-blue-40)}ap-button button.secondary.blue .loading-bar{background-color:var(--ref-color-electric-blue-100)}ap-button button.stroked{background:var(--ref-color-white);border-width:1px;border-style:solid;color:var(--ref-color-grey-80)}ap-button button.stroked.grey{border-color:var(--ref-color-grey-20)}ap-button button.stroked.grey ap-symbol{color:var(--ref-color-grey-80)}ap-button button.stroked.grey:hover{border-color:var(--ref-color-grey-40)}ap-button button.stroked.grey:active:not(:disabled){border-color:var(--ref-color-grey-60)}ap-button button.stroked.grey:focus:not(:disabled):not(:active){border-color:var(--ref-color-grey-20)}ap-button button.stroked.grey:disabled{border-color:var(--ref-color-grey-20);color:var(--ref-color-grey-20)}ap-button button.stroked.grey:disabled ap-symbol{color:var(--ref-color-grey-20)}ap-button button.stroked.grey.loading{border-color:var(--ref-color-grey-20);color:var(--ref-color-grey-40)}ap-button button.stroked.grey.loading ap-symbol{color:var(--ref-color-grey-40)}ap-button button.stroked.grey .loading-bar{background-color:var(--ref-color-grey-80)}ap-button button.stroked.blue{border-color:var(--ref-color-electric-blue-60);color:var(--ref-color-electric-blue-100)}ap-button button.stroked.blue ap-symbol{color:var(--ref-color-electric-blue-100)}ap-button button.stroked.blue:hover{border-color:var(--ref-color-electric-blue-80)}ap-button button.stroked.blue:active:not(:disabled){border-color:var(--ref-color-electric-blue-100)}ap-button button.stroked.blue:focus:not(:disabled):not(:active){border-color:var(--ref-color-electric-blue-60)}ap-button button.stroked.blue:disabled{border-color:var(--ref-color-electric-blue-20);color:var(--ref-color-electric-blue-20)}ap-button button.stroked.blue:disabled ap-symbol{color:var(--ref-color-electric-blue-20)}ap-button button.stroked.blue.loading{border-color:var(--ref-color-electric-blue-20);color:var(--ref-color-electric-blue-40)}ap-button button.stroked.blue.loading ap-symbol{color:var(--ref-color-electric-blue-40)}ap-button button.stroked.blue .loading-bar{background-color:var(--ref-color-electric-blue-100)}ap-button button.transparent{background:transparent}ap-button button.ghost{background:transparent}ap-button button.ghost.grey{color:var(--ref-color-grey-80)}ap-button button.ghost.grey ap-symbol{color:var(--ref-color-grey-80)}ap-button button.ghost.grey:hover{background-color:var(--ref-color-grey-05)}ap-button button.ghost.grey:active:not(:disabled){background-color:var(--ref-color-grey-10)}ap-button button.ghost.grey:focus:not(:disabled):not(:active){background-color:var(--ref-color-grey-10)}ap-button button.ghost.grey:disabled{color:var(--ref-color-grey-20)}ap-button button.ghost.grey:disabled ap-symbol{color:var(--ref-color-grey-20)}ap-button button.ghost.grey.loading:not(.locked){color:var(--ref-color-grey-40)}ap-button button.ghost.grey.loading:not(.locked) ap-symbol{color:var(--ref-color-grey-40)}ap-button button.ghost.grey .loading-bar{background-color:var(--ref-color-grey-80)}ap-button button.ghost.blue{color:var(--ref-color-electric-blue-100)}ap-button button.ghost.blue ap-symbol{color:var(--ref-color-electric-blue-100)}ap-button button.ghost.blue:hover{background-color:var(--ref-color-electric-blue-10)}ap-button button.ghost.blue:active:not(:disabled){background-color:var(--ref-color-electric-blue-20)}ap-button button.ghost.blue:focus:not(:disabled):not(:active){background-color:var(--ref-color-electric-blue-20)}ap-button button.ghost.blue:disabled{color:var(--ref-color-electric-blue-20)}ap-button button.ghost.blue:disabled ap-symbol{color:var(--ref-color-electric-blue-20)}ap-button button.ghost.blue.loading{color:var(--ref-color-electric-blue-40)}ap-button button.ghost.blue.loading ap-symbol{color:var(--ref-color-electric-blue-40)}ap-button button.ghost.blue .loading-bar{background-color:var(--ref-color-electric-blue-100)}ap-button button.ghost.red{color:var(--ref-color-red-100)}ap-button button.ghost.red ap-symbol{color:var(--ref-color-red-100)}ap-button button.ghost.red:hover{background-color:var(--ref-color-red-10)}ap-button button.ghost.red:active:not(:disabled){background-color:var(--ref-color-red-20)}ap-button button.ghost.red:focus:not(:disabled):not(:active){background-color:var(--ref-color-red-20)}ap-button button.ghost.red:disabled{color:var(--ref-color-red-20)}ap-button button.ghost.red:disabled ap-symbol{color:var(--ref-color-red-20)}ap-button button.ghost.red.loading{color:var(--ref-color-red-40)}ap-button button.ghost.red.loading ap-symbol{color:var(--ref-color-red-40)}ap-button button.ghost.red .loading-bar{background-color:var(--ref-color-red-100)}ap-button button.locked{background-color:var(--ref-color-purple-10);color:var(--ref-color-purple-80);border:1px solid var(--ref-color-purple-20)}ap-button button.locked:hover{border-color:var(--ref-color-purple-40);background-color:var(--ref-color-purple-20)}ap-button button.locked:focus:not(:disabled):not(:active){border-color:var(--ref-color-purple-20);background-color:var(--ref-color-purple-20)}ap-button button.locked:active{border-color:var(--ref-color-purple-60);background-color:var(--ref-color-purple-40)}ap-button .loading-bar{position:absolute;bottom:0;left:var(--comp-button-padding-vertical);width:var(--loading-bar-width);height:5px;border-radius:8px;animation:slide 1.5s ease-in-out infinite}@keyframes slide{0%{left:calc(var(--loading-bar-width) * -1)}to{left:100%}}ap-button .locked-symbol{position:absolute;top:-6px;right:-6px;border-radius:100%;background:var(--ref-color-white)}ap-button .locked-symbol ap-symbol{color:var(--ref-color-purple-100)}\n"], dependencies: [{ kind: "component", type: SymbolComponent, selector: "ap-symbol", inputs: ["symbolId", "color", "size"], outputs: ["sizeChange"] }, { kind: "ngmodule", type: MatMenuModule }, { kind: "directive", type: i2.MatMenuTrigger, selector: "[mat-menu-trigger-for], [matMenuTriggerFor]", inputs: ["mat-menu-trigger-for", "matMenuTriggerFor", "matMenuTriggerData", "matMenuTriggerRestoreFocus"], outputs: ["menuOpened", "onMenuOpen", "menuClosed", "onMenuClose"], exportAs: ["matMenuTrigger"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
63
59
|
}
|
|
64
60
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.9", ngImport: i0, type: ButtonComponent, decorators: [{
|
|
65
61
|
type: Component,
|
|
66
|
-
args: [{ changeDetection: ChangeDetectionStrategy.OnPush, selector: 'ap-button', standalone: true, imports: [SymbolComponent, MatMenuModule],
|
|
62
|
+
args: [{ changeDetection: ChangeDetectionStrategy.OnPush, selector: 'ap-button', standalone: true, imports: [SymbolComponent, MatMenuModule], encapsulation: ViewEncapsulation.None, hostDirectives: [BaseButtonDirective], host: {
|
|
67
63
|
'[attr.disabled]': 'disabled || null',
|
|
68
|
-
}, template: "<button\n #button\n #trigger=\"matMenuTrigger\"\n role=\"button\"\n [matMenuTriggerFor]=\"menuTrigger\"\n [class.primary]=\"config.style === 'primary' && !locked\"\n [class.secondary]=\"config.style === 'secondary' && !locked\"\n [class.ghost]=\"config.style === 'ghost' && !locked\"\n [class.stroked]=\"(config.style === 'stroked' || config.style === 'stroked-transparent') && !locked\"\n [class.transparent]=\"config.style === 'stroked-transparent' && !locked\"\n [class.orange]=\"config.color === 'orange' && !locked\"\n [class.blue]=\"config.color === 'blue' && !locked\"\n [class.red]=\"config.color === 'red' && !locked\"\n [class.grey]=\"config.color === 'grey' && !locked\"\n [class.loading]=\"loading && !locked\"\n [class.locked]=\"locked\"\n [class.inverse]=\"symbolPosition === 'left'\"\n [disabled]=\"disabled && !locked\"\n [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></ng-content>\n <ng-content select=\"ap-symbol\"></ng-content>\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=\"premium-star\"\n size=\"sm\" />\n </div>\n}\n", styles: ["ap-button{--loading-bar-width: 50px;display:inline-block;position:relative}ap-button[disabled]{pointer-events:none}ap-button button{border:none;border-radius:4px;padding:var(--comp-button-padding-horizontal) var(--comp-button-padding-vertical);position:relative;overflow:hidden;display:flex;justify-content:center;align-items:center;gap:var(--comp-split-button-spacing);flex-direction:row;font-size:var(--comp-button-text-size);font-family:var(--comp-button-text-font-family);line-height:var(--comp-button-text-line-height);font-weight:var(--comp-button-text-weight);max-height:var(--comp-button-height);min-height:var(--comp-button-height);white-space:nowrap;text-overflow:ellipsis;width:100%}ap-button button ap-symbol{width:16px;min-width:16px;max-width:16px;height:16px;min-height:16px;max-height:16px}ap-button button.inverse{flex-direction:row-reverse}ap-button button:hover:not(:disabled):not(.loading){cursor:pointer}ap-button button:disabled{pointer-events:none}@media (hover: hover){ap-button button:focus:not(:disabled):not(:active):not(.loading){outline:2px solid var(--ref-color-electric-blue-100);outline-offset:1px}}ap-button button.loading{pointer-events:none}ap-button button.primary{color:var(--ref-color-white)}ap-button button.primary ap-symbol{color:var(--ref-color-white)}ap-button button.primary.orange{background:var(--ref-color-orange-100)}ap-button button.primary.orange:hover{background-color:var(--ref-color-orange-80)}ap-button button.primary.orange:active:not(:disabled){background-color:var(--ref-color-orange-60)}ap-button button.primary.orange:disabled{background-color:var(--ref-color-orange-20)}ap-button button.primary.orange.loading{background-color:var(--ref-color-orange-60)}ap-button button.primary.orange .loading-bar{background-color:var(--ref-color-orange-100)}ap-button button.primary.blue{background:var(--ref-color-electric-blue-100)}ap-button button.primary.blue:hover{background-color:var(--ref-color-electric-blue-80)}ap-button button.primary.blue:active:not(:disabled){background-color:var(--ref-color-electric-blue-60)}ap-button button.primary.blue:disabled{background-color:var(--ref-color-electric-blue-20)}ap-button button.primary.blue.loading{background-color:var(--ref-color-electric-blue-60)}ap-button button.primary.blue .loading-bar{background-color:var(--ref-color-electric-blue-100)}ap-button button.secondary.orange{background:var(--ref-color-orange-10);color:var(--ref-color-orange-100)}ap-button button.secondary.orange ap-symbol{color:var(--ref-color-orange-100)}ap-button button.secondary.orange:hover{background-color:var(--ref-color-orange-20)}ap-button button.secondary.orange:active:not(:disabled){background-color:var(--ref-color-orange-40)}ap-button button.secondary.orange:focus:not(:disabled):not(:active){background-color:var(--ref-color-orange-10)}ap-button button.secondary.orange:disabled{background-color:var(--ref-color-orange-10);color:var(--ref-color-orange-20)}ap-button button.secondary.orange:disabled ap-symbol{color:var(--ref-color-orange-20)}ap-button button.secondary.orange.loading{background-color:var(--ref-color-orange-40)}ap-button button.secondary.orange .loading-bar{background-color:var(--ref-color-orange-100)}ap-button button.secondary.blue{background:var(--ref-color-electric-blue-10);color:var(--ref-color-electric-blue-100)}ap-button button.secondary.blue ap-symbol{color:var(--ref-color-electric-blue-100)}ap-button button.secondary.blue:hover{background-color:var(--ref-color-electric-blue-20)}ap-button button.secondary.blue:active:not(:disabled){background-color:var(--ref-color-electric-blue-40)}ap-button button.secondary.blue:focus:not(:disabled):not(:active){background-color:var(--ref-color-electric-blue-10)}ap-button button.secondary.blue:disabled{background-color:var(--ref-color-electric-blue-10);color:var(--ref-color-electric-blue-20)}ap-button button.secondary.blue:disabled ap-symbol{color:var(--ref-color-electric-blue-20)}ap-button button.secondary.blue.loading{background-color:var(--ref-color-electric-blue-40)}ap-button button.secondary.blue .loading-bar{background-color:var(--ref-color-electric-blue-100)}ap-button button.stroked{background:var(--ref-color-white);border-width:1px;border-style:solid;color:var(--ref-color-grey-80)}ap-button button.stroked.grey{border-color:var(--ref-color-grey-20)}ap-button button.stroked.grey ap-symbol{color:var(--ref-color-grey-80)}ap-button button.stroked.grey:hover{border-color:var(--ref-color-grey-40)}ap-button button.stroked.grey:active:not(:disabled){border-color:var(--ref-color-grey-60)}ap-button button.stroked.grey:focus:not(:disabled):not(:active){border-color:var(--ref-color-grey-20)}ap-button button.stroked.grey:disabled{border-color:var(--ref-color-grey-20);color:var(--ref-color-grey-20)}ap-button button.stroked.grey:disabled ap-symbol{color:var(--ref-color-grey-20)}ap-button button.stroked.grey.loading{border-color:var(--ref-color-grey-20);color:var(--ref-color-grey-40)}ap-button button.stroked.grey.loading ap-symbol{color:var(--ref-color-grey-40)}ap-button button.stroked.grey .loading-bar{background-color:var(--ref-color-grey-80)}ap-button button.stroked.blue{border-color:var(--ref-color-electric-blue-60);color:var(--ref-color-electric-blue-100)}ap-button button.stroked.blue ap-symbol{color:var(--ref-color-electric-blue-100)}ap-button button.stroked.blue:hover{border-color:var(--ref-color-electric-blue-80)}ap-button button.stroked.blue:active:not(:disabled){border-color:var(--ref-color-electric-blue-100)}ap-button button.stroked.blue:focus:not(:disabled):not(:active){border-color:var(--ref-color-electric-blue-60)}ap-button button.stroked.blue:disabled{border-color:var(--ref-color-electric-blue-20);color:var(--ref-color-electric-blue-20)}ap-button button.stroked.blue:disabled ap-symbol{color:var(--ref-color-electric-blue-20)}ap-button button.stroked.blue.loading{border-color:var(--ref-color-electric-blue-20);color:var(--ref-color-electric-blue-40)}ap-button button.stroked.blue.loading ap-symbol{color:var(--ref-color-electric-blue-40)}ap-button button.stroked.blue .loading-bar{background-color:var(--ref-color-electric-blue-100)}ap-button button.transparent{background:transparent}ap-button button.ghost{background:transparent}ap-button button.ghost.grey{color:var(--ref-color-grey-80)}ap-button button.ghost.grey ap-symbol{color:var(--ref-color-grey-80)}ap-button button.ghost.grey:hover{background-color:var(--ref-color-grey-05)}ap-button button.ghost.grey:active:not(:disabled){background-color:var(--ref-color-grey-10)}ap-button button.ghost.grey:focus:not(:disabled):not(:active){background-color:var(--ref-color-grey-10)}ap-button button.ghost.grey:disabled{color:var(--ref-color-grey-20)}ap-button button.ghost.grey:disabled ap-symbol{color:var(--ref-color-grey-20)}ap-button button.ghost.grey.loading:not(.locked){color:var(--ref-color-grey-40)}ap-button button.ghost.grey.loading:not(.locked) ap-symbol{color:var(--ref-color-grey-40)}ap-button button.ghost.grey .loading-bar{background-color:var(--ref-color-grey-80)}ap-button button.ghost.blue{color:var(--ref-color-electric-blue-100)}ap-button button.ghost.blue ap-symbol{color:var(--ref-color-electric-blue-100)}ap-button button.ghost.blue:hover{background-color:var(--ref-color-electric-blue-10)}ap-button button.ghost.blue:active:not(:disabled){background-color:var(--ref-color-electric-blue-20)}ap-button button.ghost.blue:focus:not(:disabled):not(:active){background-color:var(--ref-color-electric-blue-20)}ap-button button.ghost.blue:disabled{color:var(--ref-color-electric-blue-20)}ap-button button.ghost.blue:disabled ap-symbol{color:var(--ref-color-electric-blue-20)}ap-button button.ghost.blue.loading{color:var(--ref-color-electric-blue-40)}ap-button button.ghost.blue.loading ap-symbol{color:var(--ref-color-electric-blue-40)}ap-button button.ghost.blue .loading-bar{background-color:var(--ref-color-electric-blue-100)}ap-button button.ghost.red{color:var(--ref-color-red-100)}ap-button button.ghost.red ap-symbol{color:var(--ref-color-red-100)}ap-button button.ghost.red:hover{background-color:var(--ref-color-red-10)}ap-button button.ghost.red:active:not(:disabled){background-color:var(--ref-color-red-20)}ap-button button.ghost.red:focus:not(:disabled):not(:active){background-color:var(--ref-color-red-20)}ap-button button.ghost.red:disabled{color:var(--ref-color-red-20)}ap-button button.ghost.red:disabled ap-symbol{color:var(--ref-color-red-20)}ap-button button.ghost.red.loading{color:var(--ref-color-red-40)}ap-button button.ghost.red.loading ap-symbol{color:var(--ref-color-red-40)}ap-button button.ghost.red .loading-bar{background-color:var(--ref-color-red-100)}ap-button button.locked{background-color:var(--ref-color-purple-10);color:var(--ref-color-purple-80);border:1px solid var(--ref-color-purple-20)}ap-button button.locked:hover{border-color:var(--ref-color-purple-40);background-color:var(--ref-color-purple-20)}ap-button button.locked:focus:not(:disabled):not(:active){border-color:var(--ref-color-purple-20);background-color:var(--ref-color-purple-20)}ap-button button.locked:active{border-color:var(--ref-color-purple-60);background-color:var(--ref-color-purple-40)}ap-button .loading-bar{position:absolute;bottom:0;left:var(--comp-button-padding-vertical);width:var(--loading-bar-width);height:5px;border-radius:8px;animation:slide 1.5s ease-in-out infinite}@keyframes slide{0%{left:calc(var(--loading-bar-width) * -1)}to{left:100%}}ap-button .locked-symbol{position:absolute;top:-6px;right:-6px;border-radius:100%;background:var(--ref-color-white)}ap-button .locked-symbol ap-symbol{color:var(--ref-color-purple-100)}\n"] }]
|
|
64
|
+
}, template: "<button\n #button\n #trigger=\"matMenuTrigger\"\n role=\"button\"\n [matMenuTriggerFor]=\"menuTrigger\"\n [class.primary]=\"config.style === 'primary' && !locked\"\n [class.secondary]=\"config.style === 'secondary' && !locked\"\n [class.ghost]=\"config.style === 'ghost' && !locked\"\n [class.stroked]=\"(config.style === 'stroked' || config.style === 'stroked-transparent') && !locked\"\n [class.transparent]=\"config.style === 'stroked-transparent' && !locked\"\n [class.orange]=\"config.color === 'orange' && !locked\"\n [class.blue]=\"config.color === 'blue' && !locked\"\n [class.red]=\"config.color === 'red' && !locked\"\n [class.grey]=\"config.color === 'grey' && !locked\"\n [class.loading]=\"loading && !locked\"\n [class.locked]=\"locked\"\n [class.inverse]=\"symbolPosition === 'left'\"\n [disabled]=\"disabled && !locked\"\n [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>Button text</ng-content>\n @if (symbolId()) {\n <ap-symbol [symbolId]=\"symbolId()\" />\n } @else {\n <ng-content select=\"ap-symbol\"></ng-content>\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=\"premium-star\"\n size=\"sm\" />\n </div>\n}\n", styles: ["ap-button{--loading-bar-width: 50px;display:inline-block;position:relative}ap-button[disabled]{pointer-events:none}ap-button button{border:none;border-radius:4px;padding:var(--comp-button-padding-horizontal) var(--comp-button-padding-vertical);position:relative;overflow:hidden;display:flex;justify-content:center;align-items:center;gap:var(--comp-split-button-spacing);flex-direction:row;font-size:var(--comp-button-text-size);font-family:var(--comp-button-text-font-family);line-height:var(--comp-button-text-line-height);font-weight:var(--comp-button-text-weight);max-height:var(--comp-button-height);min-height:var(--comp-button-height);white-space:nowrap;text-overflow:ellipsis;width:100%}ap-button button ap-symbol{width:16px;min-width:16px;max-width:16px;height:16px;min-height:16px;max-height:16px}ap-button button.inverse{flex-direction:row-reverse}ap-button button:hover:not(:disabled):not(.loading){cursor:pointer}ap-button button:disabled{pointer-events:none}@media (hover: hover){ap-button button:focus:not(:disabled):not(:active):not(.loading){outline:2px solid var(--ref-color-electric-blue-100);outline-offset:1px}}ap-button button.loading{pointer-events:none}ap-button button.primary{color:var(--ref-color-white)}ap-button button.primary ap-symbol{color:var(--ref-color-white)}ap-button button.primary.orange{background:var(--ref-color-orange-100)}ap-button button.primary.orange:hover{background-color:var(--ref-color-orange-80)}ap-button button.primary.orange:active:not(:disabled){background-color:var(--ref-color-orange-60)}ap-button button.primary.orange:disabled{background-color:var(--ref-color-orange-20)}ap-button button.primary.orange.loading{background-color:var(--ref-color-orange-60)}ap-button button.primary.orange .loading-bar{background-color:var(--ref-color-orange-100)}ap-button button.primary.blue{background:var(--ref-color-electric-blue-100)}ap-button button.primary.blue:hover{background-color:var(--ref-color-electric-blue-80)}ap-button button.primary.blue:active:not(:disabled){background-color:var(--ref-color-electric-blue-60)}ap-button button.primary.blue:disabled{background-color:var(--ref-color-electric-blue-20)}ap-button button.primary.blue.loading{background-color:var(--ref-color-electric-blue-60)}ap-button button.primary.blue .loading-bar{background-color:var(--ref-color-electric-blue-100)}ap-button button.secondary.orange{background:var(--ref-color-orange-10);color:var(--ref-color-orange-100)}ap-button button.secondary.orange ap-symbol{color:var(--ref-color-orange-100)}ap-button button.secondary.orange:hover{background-color:var(--ref-color-orange-20)}ap-button button.secondary.orange:active:not(:disabled){background-color:var(--ref-color-orange-40)}ap-button button.secondary.orange:focus:not(:disabled):not(:active){background-color:var(--ref-color-orange-10)}ap-button button.secondary.orange:disabled{background-color:var(--ref-color-orange-10);color:var(--ref-color-orange-20)}ap-button button.secondary.orange:disabled ap-symbol{color:var(--ref-color-orange-20)}ap-button button.secondary.orange.loading{background-color:var(--ref-color-orange-40)}ap-button button.secondary.orange .loading-bar{background-color:var(--ref-color-orange-100)}ap-button button.secondary.blue{background:var(--ref-color-electric-blue-10);color:var(--ref-color-electric-blue-100)}ap-button button.secondary.blue ap-symbol{color:var(--ref-color-electric-blue-100)}ap-button button.secondary.blue:hover{background-color:var(--ref-color-electric-blue-20)}ap-button button.secondary.blue:active:not(:disabled){background-color:var(--ref-color-electric-blue-40)}ap-button button.secondary.blue:focus:not(:disabled):not(:active){background-color:var(--ref-color-electric-blue-10)}ap-button button.secondary.blue:disabled{background-color:var(--ref-color-electric-blue-10);color:var(--ref-color-electric-blue-20)}ap-button button.secondary.blue:disabled ap-symbol{color:var(--ref-color-electric-blue-20)}ap-button button.secondary.blue.loading{background-color:var(--ref-color-electric-blue-40)}ap-button button.secondary.blue .loading-bar{background-color:var(--ref-color-electric-blue-100)}ap-button button.stroked{background:var(--ref-color-white);border-width:1px;border-style:solid;color:var(--ref-color-grey-80)}ap-button button.stroked.grey{border-color:var(--ref-color-grey-20)}ap-button button.stroked.grey ap-symbol{color:var(--ref-color-grey-80)}ap-button button.stroked.grey:hover{border-color:var(--ref-color-grey-40)}ap-button button.stroked.grey:active:not(:disabled){border-color:var(--ref-color-grey-60)}ap-button button.stroked.grey:focus:not(:disabled):not(:active){border-color:var(--ref-color-grey-20)}ap-button button.stroked.grey:disabled{border-color:var(--ref-color-grey-20);color:var(--ref-color-grey-20)}ap-button button.stroked.grey:disabled ap-symbol{color:var(--ref-color-grey-20)}ap-button button.stroked.grey.loading{border-color:var(--ref-color-grey-20);color:var(--ref-color-grey-40)}ap-button button.stroked.grey.loading ap-symbol{color:var(--ref-color-grey-40)}ap-button button.stroked.grey .loading-bar{background-color:var(--ref-color-grey-80)}ap-button button.stroked.blue{border-color:var(--ref-color-electric-blue-60);color:var(--ref-color-electric-blue-100)}ap-button button.stroked.blue ap-symbol{color:var(--ref-color-electric-blue-100)}ap-button button.stroked.blue:hover{border-color:var(--ref-color-electric-blue-80)}ap-button button.stroked.blue:active:not(:disabled){border-color:var(--ref-color-electric-blue-100)}ap-button button.stroked.blue:focus:not(:disabled):not(:active){border-color:var(--ref-color-electric-blue-60)}ap-button button.stroked.blue:disabled{border-color:var(--ref-color-electric-blue-20);color:var(--ref-color-electric-blue-20)}ap-button button.stroked.blue:disabled ap-symbol{color:var(--ref-color-electric-blue-20)}ap-button button.stroked.blue.loading{border-color:var(--ref-color-electric-blue-20);color:var(--ref-color-electric-blue-40)}ap-button button.stroked.blue.loading ap-symbol{color:var(--ref-color-electric-blue-40)}ap-button button.stroked.blue .loading-bar{background-color:var(--ref-color-electric-blue-100)}ap-button button.transparent{background:transparent}ap-button button.ghost{background:transparent}ap-button button.ghost.grey{color:var(--ref-color-grey-80)}ap-button button.ghost.grey ap-symbol{color:var(--ref-color-grey-80)}ap-button button.ghost.grey:hover{background-color:var(--ref-color-grey-05)}ap-button button.ghost.grey:active:not(:disabled){background-color:var(--ref-color-grey-10)}ap-button button.ghost.grey:focus:not(:disabled):not(:active){background-color:var(--ref-color-grey-10)}ap-button button.ghost.grey:disabled{color:var(--ref-color-grey-20)}ap-button button.ghost.grey:disabled ap-symbol{color:var(--ref-color-grey-20)}ap-button button.ghost.grey.loading:not(.locked){color:var(--ref-color-grey-40)}ap-button button.ghost.grey.loading:not(.locked) ap-symbol{color:var(--ref-color-grey-40)}ap-button button.ghost.grey .loading-bar{background-color:var(--ref-color-grey-80)}ap-button button.ghost.blue{color:var(--ref-color-electric-blue-100)}ap-button button.ghost.blue ap-symbol{color:var(--ref-color-electric-blue-100)}ap-button button.ghost.blue:hover{background-color:var(--ref-color-electric-blue-10)}ap-button button.ghost.blue:active:not(:disabled){background-color:var(--ref-color-electric-blue-20)}ap-button button.ghost.blue:focus:not(:disabled):not(:active){background-color:var(--ref-color-electric-blue-20)}ap-button button.ghost.blue:disabled{color:var(--ref-color-electric-blue-20)}ap-button button.ghost.blue:disabled ap-symbol{color:var(--ref-color-electric-blue-20)}ap-button button.ghost.blue.loading{color:var(--ref-color-electric-blue-40)}ap-button button.ghost.blue.loading ap-symbol{color:var(--ref-color-electric-blue-40)}ap-button button.ghost.blue .loading-bar{background-color:var(--ref-color-electric-blue-100)}ap-button button.ghost.red{color:var(--ref-color-red-100)}ap-button button.ghost.red ap-symbol{color:var(--ref-color-red-100)}ap-button button.ghost.red:hover{background-color:var(--ref-color-red-10)}ap-button button.ghost.red:active:not(:disabled){background-color:var(--ref-color-red-20)}ap-button button.ghost.red:focus:not(:disabled):not(:active){background-color:var(--ref-color-red-20)}ap-button button.ghost.red:disabled{color:var(--ref-color-red-20)}ap-button button.ghost.red:disabled ap-symbol{color:var(--ref-color-red-20)}ap-button button.ghost.red.loading{color:var(--ref-color-red-40)}ap-button button.ghost.red.loading ap-symbol{color:var(--ref-color-red-40)}ap-button button.ghost.red .loading-bar{background-color:var(--ref-color-red-100)}ap-button button.locked{background-color:var(--ref-color-purple-10);color:var(--ref-color-purple-80);border:1px solid var(--ref-color-purple-20)}ap-button button.locked:hover{border-color:var(--ref-color-purple-40);background-color:var(--ref-color-purple-20)}ap-button button.locked:focus:not(:disabled):not(:active){border-color:var(--ref-color-purple-20);background-color:var(--ref-color-purple-20)}ap-button button.locked:active{border-color:var(--ref-color-purple-60);background-color:var(--ref-color-purple-40)}ap-button .loading-bar{position:absolute;bottom:0;left:var(--comp-button-padding-vertical);width:var(--loading-bar-width);height:5px;border-radius:8px;animation:slide 1.5s ease-in-out infinite}@keyframes slide{0%{left:calc(var(--loading-bar-width) * -1)}to{left:100%}}ap-button .locked-symbol{position:absolute;top:-6px;right:-6px;border-radius:100%;background:var(--ref-color-white)}ap-button .locked-symbol ap-symbol{color:var(--ref-color-purple-100)}\n"] }]
|
|
69
65
|
}], propDecorators: { buttonElement: [{
|
|
70
66
|
type: ViewChild,
|
|
71
67
|
args: ['button']
|
|
@@ -103,8 +99,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.9", ngImpor
|
|
|
103
99
|
type: Output
|
|
104
100
|
}], blur: [{
|
|
105
101
|
type: Output
|
|
106
|
-
}], ionicModalEnabled: [{
|
|
107
|
-
type: Input
|
|
108
102
|
}], onSpaceKeyUp: [{
|
|
109
103
|
type: HostListener,
|
|
110
104
|
args: ['window:keyup.space', ['$event']]
|
|
@@ -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 {\n booleanAttribute,\n ChangeDetectionStrategy,\n Component,\n ElementRef,\n EventEmitter,\n HostListener,\n inject,\n Input,\n Output,\n ViewChild,\n ViewEncapsulation,\n} from '@angular/core';\n\nimport { BaseButtonDirective } from '@agorapulse/ui-components/directives';\nimport { SymbolComponent } from '@agorapulse/ui-symbol';\nimport { MatMenuModule, MatMenuPanel } from '@angular/material/menu';\n\ntype ButtonConfig =\n | { style: 'primary'; color: 'orange' | 'blue' }\n | { style: 'secondary'; color: 'orange' | 'blue' }\n | { style: 'stroked'; color: 'grey' | 'blue' }\n | { style: 'stroked-transparent'; color: 'grey' | 'blue' }\n | { style: 'ghost'; color: 'grey' | 'blue' | 'red' };\n\n@Component({\n changeDetection: ChangeDetectionStrategy.OnPush,\n selector: 'ap-button',\n styleUrls: ['./button.component.scss'],\n standalone: true,\n imports: [SymbolComponent, MatMenuModule],\n providers: [],\n templateUrl: './button.component.html',\n encapsulation: ViewEncapsulation.None,\n hostDirectives: [BaseButtonDirective],\n // eslint-disable-next-line @angular-eslint/no-host-metadata-property\n host: {\n '[attr.disabled]': 'disabled || null',\n },\n})\nexport class ButtonComponent {\n readonly baseButtonDirective: BaseButtonDirective = inject(BaseButtonDirective, { self: true });\n\n @ViewChild('button') buttonElement!: ElementRef<HTMLButtonElement>;\n\n @Input() ariaLabel: string = '';\n @Input({\n transform: booleanAttribute,\n })\n disabled: boolean | undefined = false;\n @Input({\n required: true,\n })\n name: string = '';\n @Input() form: string | undefined = undefined;\n @Input() config: ButtonConfig = {\n style: 'primary',\n color: 'orange',\n };\n @Input() loading: boolean | undefined = false;\n @Input() locked: boolean = false;\n @Input() menuTrigger: MatMenuPanel | null = null;\n @Input() symbolPosition: 'left' | 'right' = 'right';\n\n @Output() menuOpened: EventEmitter<void> = new EventEmitter();\n @Output() menuClosed: EventEmitter<void> = new EventEmitter();\n // eslint-disable-next-line @angular-eslint/no-output-native\n @Output() click: EventEmitter<MouseEvent> = new EventEmitter();\n // eslint-disable-next-line @angular-eslint/no-output-native\n @Output() focus: EventEmitter<FocusEvent> = new EventEmitter();\n // eslint-disable-next-line @angular-eslint/no-output-native\n @Output() blur: EventEmitter<FocusEvent> = new EventEmitter();\n\n // Specific ionic behaviour with modal trigger on html side. We cannot use stopImmediatePropagation otherwise the modal doesn't open.\n // Maybe we can remove this hack once we rename click event by onClick\n @Input() ionicModalEnabled: boolean = false;\n\n focused: boolean = false;\n\n onClickHandle($event: MouseEvent): void {\n if (this.disabled || this.loading) {\n return;\n }\n if (!this.ionicModalEnabled) {\n $event.stopImmediatePropagation();\n }\n this.click.emit($event);\n this.buttonElement.nativeElement.blur();\n this.blur.emit($event);\n }\n\n onBlurHandle($event: FocusEvent): void {\n this.focused = false;\n this.blur.emit($event);\n }\n\n onFocusHandle($event: FocusEvent): void {\n this.focused = true;\n this.focus.emit($event);\n }\n\n @HostListener('window:keyup.space', ['$event'])\n onSpaceKeyUp(event: KeyboardEvent) {\n if (this.focused && !this.disabled && !this.loading) {\n event.preventDefault();\n this.buttonElement.nativeElement.click();\n }\n }\n}\n","<button\n #button\n #trigger=\"matMenuTrigger\"\n role=\"button\"\n [matMenuTriggerFor]=\"menuTrigger\"\n [class.primary]=\"config.style === 'primary' && !locked\"\n [class.secondary]=\"config.style === 'secondary' && !locked\"\n [class.ghost]=\"config.style === 'ghost' && !locked\"\n [class.stroked]=\"(config.style === 'stroked' || config.style === 'stroked-transparent') && !locked\"\n [class.transparent]=\"config.style === 'stroked-transparent' && !locked\"\n [class.orange]=\"config.color === 'orange' && !locked\"\n [class.blue]=\"config.color === 'blue' && !locked\"\n [class.red]=\"config.color === 'red' && !locked\"\n [class.grey]=\"config.color === 'grey' && !locked\"\n [class.loading]=\"loading && !locked\"\n [class.locked]=\"locked\"\n [class.inverse]=\"symbolPosition === 'left'\"\n [disabled]=\"disabled && !locked\"\n [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></ng-content>\n <ng-content select=\"ap-symbol\"></ng-content>\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=\"premium-star\"\n size=\"sm\" />\n </div>\n}\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ACH,wBAAA,SAAS,EAAE,gBAAgB;AAC9B,qBAAA;gBAKD,IAAI,EAAA,CAAA;sBAHH,KAAK;AAAC,gBAAA,IAAA,EAAA,CAAA;AACH,wBAAA,QAAQ,EAAE,IAAI;AACjB,qBAAA;gBAEQ,IAAI,EAAA,CAAA;sBAAZ;gBACQ,MAAM,EAAA,CAAA;sBAAd;gBAIQ,OAAO,EAAA,CAAA;sBAAf;gBACQ,MAAM,EAAA,CAAA;sBAAd;gBACQ,WAAW,EAAA,CAAA;sBAAnB;gBACQ,cAAc,EAAA,CAAA;sBAAtB;gBAES,UAAU,EAAA,CAAA;sBAAnB;gBACS,UAAU,EAAA,CAAA;sBAAnB;gBAES,KAAK,EAAA,CAAA;sBAAd;gBAES,KAAK,EAAA,CAAA;sBAAd;gBAES,IAAI,EAAA,CAAA;sBAAb;gBAIQ,iBAAiB,EAAA,CAAA;sBAAzB;gBA2BD,YAAY,EAAA,CAAA;sBADX,YAAY;uBAAC,oBAAoB,EAAE,CAAC,QAAQ,CAAC;;;AErGlD;;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 {\n booleanAttribute,\n ChangeDetectionStrategy,\n Component,\n ElementRef,\n EventEmitter,\n HostListener,\n inject,\n input,\n Input,\n Output,\n ViewChild,\n ViewEncapsulation,\n} from '@angular/core';\n\nimport { BaseButtonDirective } from '@agorapulse/ui-components/directives';\nimport { agorapulseSymbol, SymbolComponent } from '@agorapulse/ui-symbol';\nimport { MatMenuModule, MatMenuPanel } from '@angular/material/menu';\n\ntype ButtonConfig =\n | { style: 'primary'; color: 'orange' | 'blue' }\n | { style: 'secondary'; color: 'orange' | 'blue' }\n | { style: 'stroked'; color: 'grey' | 'blue' }\n | { style: 'stroked-transparent'; color: 'grey' | 'blue' }\n | { style: 'ghost'; color: 'grey' | 'blue' | 'red' };\n\n@Component({\n changeDetection: ChangeDetectionStrategy.OnPush,\n selector: 'ap-button',\n styleUrls: ['./button.component.scss'],\n standalone: true,\n imports: [SymbolComponent, MatMenuModule],\n templateUrl: './button.component.html',\n encapsulation: ViewEncapsulation.None,\n hostDirectives: [BaseButtonDirective],\n // eslint-disable-next-line @angular-eslint/no-host-metadata-property\n host: {\n '[attr.disabled]': 'disabled || null',\n },\n})\nexport class ButtonComponent {\n readonly baseButtonDirective: BaseButtonDirective = inject(BaseButtonDirective, { self: true });\n\n @ViewChild('button') buttonElement!: ElementRef<HTMLButtonElement>;\n\n @Input() ariaLabel: string = '';\n @Input({\n transform: booleanAttribute,\n })\n disabled: boolean | undefined = false;\n @Input({\n required: true,\n })\n name: string = '';\n @Input() form: string | undefined = undefined;\n @Input() config: ButtonConfig = {\n style: 'primary',\n color: 'orange',\n };\n @Input() loading: boolean | undefined = false;\n @Input() locked: boolean = false;\n @Input() menuTrigger: MatMenuPanel | null = null;\n @Input() symbolPosition: 'left' | 'right' = 'right';\n\n symbolId = input<agorapulseSymbol>();\n\n @Output() menuOpened: EventEmitter<void> = new EventEmitter();\n @Output() menuClosed: EventEmitter<void> = new EventEmitter();\n // eslint-disable-next-line @angular-eslint/no-output-native\n @Output() click: EventEmitter<MouseEvent> = new EventEmitter();\n // eslint-disable-next-line @angular-eslint/no-output-native\n @Output() focus: EventEmitter<FocusEvent> = new EventEmitter();\n // eslint-disable-next-line @angular-eslint/no-output-native\n @Output() blur: EventEmitter<FocusEvent> = new EventEmitter();\n\n focused: boolean = false;\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.focused = false;\n this.blur.emit($event);\n }\n\n onFocusHandle($event: FocusEvent): void {\n this.focused = true;\n this.focus.emit($event);\n }\n\n @HostListener('window:keyup.space', ['$event'])\n onSpaceKeyUp(event: KeyboardEvent) {\n if (this.focused && !this.disabled && !this.loading) {\n event.preventDefault();\n this.buttonElement.nativeElement.click();\n }\n }\n}\n","<button\n #button\n #trigger=\"matMenuTrigger\"\n role=\"button\"\n [matMenuTriggerFor]=\"menuTrigger\"\n [class.primary]=\"config.style === 'primary' && !locked\"\n [class.secondary]=\"config.style === 'secondary' && !locked\"\n [class.ghost]=\"config.style === 'ghost' && !locked\"\n [class.stroked]=\"(config.style === 'stroked' || config.style === 'stroked-transparent') && !locked\"\n [class.transparent]=\"config.style === 'stroked-transparent' && !locked\"\n [class.orange]=\"config.color === 'orange' && !locked\"\n [class.blue]=\"config.color === 'blue' && !locked\"\n [class.red]=\"config.color === 'red' && !locked\"\n [class.grey]=\"config.color === 'grey' && !locked\"\n [class.loading]=\"loading && !locked\"\n [class.locked]=\"locked\"\n [class.inverse]=\"symbolPosition === 'left'\"\n [disabled]=\"disabled && !locked\"\n [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>Button text</ng-content>\n @if (symbolId()) {\n <ap-symbol [symbolId]=\"symbolId()\" />\n } @else {\n <ng-content select=\"ap-symbol\"></ng-content>\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=\"premium-star\"\n size=\"sm\" />\n </div>\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;;;MA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BAAtB;gBAIS,UAAU,EAAA,CAAA;sBAAnB;gBACS,UAAU,EAAA,CAAA;sBAAnB;gBAES,KAAK,EAAA,CAAA;sBAAd;gBAES,KAAK,EAAA,CAAA;sBAAd;gBAES,IAAI,EAAA,CAAA;sBAAb;gBAyBD,YAAY,EAAA,CAAA;sBADX,YAAY;uBAAC,oBAAoB,EAAE,CAAC,QAAQ,CAAC;;;AEjGlD;;AAEG;;;;"}
|
|
@@ -123,7 +123,7 @@ class CheckboxComponent {
|
|
|
123
123
|
useExisting: CheckboxComponent,
|
|
124
124
|
multi: true,
|
|
125
125
|
},
|
|
126
|
-
], viewQueries: [{ propertyName: "inputElement", first: true, predicate: ["input"], descendants: true, static: true }, { propertyName: "labelElement", first: true, predicate: ["label"], descendants: true, static: true }], usesOnChanges: true, ngImport: i0, template: "<div\n class=\"checkbox\"\n (click)=\"_preventBubblingFromLabel($event)\">\n <div\n class=\"checkbox-container\"\n [class.hover]=\"hovered\"\n [class.checked]=\"checked\"\n [class.indeterminate]=\"indeterminate && !checked\"\n [class.disabled]=\"disabled\"\n [class.has-label]=\"hasLabel\"\n [class.required]=\"required\">\n <input\n #input\n type=\"checkbox\"\n [id]=\"name\"\n [class.disabled]=\"disabled\"\n [disabled]=\"disabled\"\n [checked]=\"checked\"\n [required]=\"required\"\n [attr.aria-label]=\"ariaLabel\"\n [attr.aria-labelledby]=\"ariaLabelledby\"\n [attr.aria-describedby]=\"ariaDescribedby\"\n [attr.data-test]=\"name\"\n (click)=\"onValueChange()\" />\n <span\n class=\"checkbox\"\n (mouseenter)=\"onMouseEnter()\"\n (mouseleave)=\"onMouseLeave()\"\n (click)=\"onValueChange()\">\n @if (checked) {\n <span class=\"checkmark\">\n <ap-symbol\n symbolId=\"check\"\n color=\"white\"\n [size]=\"10\" />\n </span>\n }\n @if (indeterminate && !checked) {\n <span class=\"indeterminate\"></span>\n }\n </span>\n </div>\n <label\n #label\n [class.disabled]=\"disabled\"\n [for]=\"name\">\n <ng-content
|
|
126
|
+
], viewQueries: [{ propertyName: "inputElement", first: true, predicate: ["input"], descendants: true, static: true }, { propertyName: "labelElement", first: true, predicate: ["label"], descendants: true, static: true }], usesOnChanges: true, ngImport: i0, template: "<div\n class=\"checkbox\"\n (click)=\"_preventBubblingFromLabel($event)\">\n <div\n class=\"checkbox-container\"\n [class.hover]=\"hovered\"\n [class.checked]=\"checked\"\n [class.indeterminate]=\"indeterminate && !checked\"\n [class.disabled]=\"disabled\"\n [class.has-label]=\"hasLabel\"\n [class.required]=\"required\">\n <input\n #input\n type=\"checkbox\"\n [id]=\"name\"\n [class.disabled]=\"disabled\"\n [disabled]=\"disabled\"\n [checked]=\"checked\"\n [required]=\"required\"\n [attr.aria-label]=\"ariaLabel\"\n [attr.aria-labelledby]=\"ariaLabelledby\"\n [attr.aria-describedby]=\"ariaDescribedby\"\n [attr.data-test]=\"name\"\n (click)=\"onValueChange()\" />\n <span\n class=\"checkbox\"\n (mouseenter)=\"onMouseEnter()\"\n (mouseleave)=\"onMouseLeave()\"\n (click)=\"onValueChange()\">\n @if (checked) {\n <span class=\"checkmark\">\n <ap-symbol\n symbolId=\"check\"\n color=\"white\"\n [size]=\"10\" />\n </span>\n }\n @if (indeterminate && !checked) {\n <span class=\"indeterminate\"></span>\n }\n </span>\n </div>\n <label\n #label\n [class.disabled]=\"disabled\"\n [for]=\"name\">\n <ng-content>Checkbox label</ng-content>\n </label>\n</div>\n", styles: ["ap-checkbox{display:flex;align-items:center}ap-checkbox.ng-invalid.ng-touched .checkbox-container.required span.checkbox{border-color:var(--ref-color-red-100)!important}ap-checkbox.bold label{font-weight:var(--ref-font-weight-bold)}ap-checkbox.full-width .checkbox{justify-content:space-between;align-items:center;width:100%}ap-checkbox .checkbox{display:flex;align-items:center;gap:var(--ref-spacing-xxs)}ap-checkbox .checkbox .checkbox-container{display:flex;justify-content:center;align-items:center;max-width:36px;height:fit-content;box-sizing:border-box;position:relative}ap-checkbox .checkbox .checkbox-container:not(.has-label){padding:10px}ap-checkbox .checkbox .checkbox-container.hover:not(.disabled):not(.has-label){border-radius:var(--ref-border-radius-md);background:var(--ref-color-grey-05)}ap-checkbox .checkbox .checkbox-container.checked:not(.disabled).hover{background:var(--ref-color-electric-blue-10)}ap-checkbox .checkbox .checkbox-container.checked:not(.disabled):active:not(.has-label){background:var(--ref-color-electric-blue-20)}ap-checkbox .checkbox .checkbox-container.checked:not(.disabled):active:not(.has-label) span.checkbox{background:var(--ref-color-electric-blue-60)}ap-checkbox .checkbox .checkbox-container.checked:not(.disabled) span.checkbox{background:var(--ref-color-electric-blue-100);border-color:var(--ref-color-electric-blue-100)}ap-checkbox .checkbox .checkbox-container.checked:not(.disabled) span.checkbox:hover{border:1px solid var(--ref-color-electric-blue-100);background:var(--ref-color-electric-blue-80)}ap-checkbox .checkbox .checkbox-container.checked:not(.disabled) span.checkbox:active{border:1px solid var(--ref-color-electric-blue-100);background:var(--ref-color-electric-blue-60)}ap-checkbox .checkbox .checkbox-container.indeterminate:not(.disabled).hover{background:var(--ref-color-electric-blue-10)}ap-checkbox .checkbox .checkbox-container.indeterminate:not(.disabled) span.checkbox{background:var(--ref-color-electric-blue-100);border-color:var(--ref-color-electric-blue-100)}ap-checkbox .checkbox .checkbox-container.indeterminate:not(.disabled) span.checkbox:hover{border:1px solid var(--ref-color-electric-blue-100);background:var(--ref-color-electric-blue-80)}ap-checkbox .checkbox .checkbox-container.disabled span.checkbox{border:1px solid var(--ref-color-grey-20);background:var(--ref-color-grey-10)}ap-checkbox .checkbox .checkbox-container.disabled.checked span.checkbox{background:var(--ref-color-grey-20)}ap-checkbox .checkbox .checkbox-container.disabled.indeterminate span.checkbox{background:var(--ref-color-grey-20)}ap-checkbox .checkbox .checkbox-container.disabled span.checkbox{pointer-events:none}ap-checkbox .checkbox .checkbox-container input[type=checkbox]{position:absolute;clip:rect(0,0,0,0)}@media (hover: hover){ap-checkbox .checkbox .checkbox-container input[type=checkbox]:focus:not(.disabled)~.checkbox{outline:3px solid var(--ref-color-electric-blue-100);outline-offset:1px}}ap-checkbox .checkbox .checkbox-container span.checkbox{display:flex;justify-content:center;align-items:center;width:16px;height:16px;min-width:16px;min-height:16px;max-height:16px;max-width:16px;border-radius:var(--sys-border-radius-sm);border:1px solid var(--ref-color-grey-60);background:var(--ref-color-white);box-sizing:border-box}ap-checkbox .checkbox .checkbox-container span.checkbox:hover{cursor:pointer;border-color:var(--ref-color-grey-80)}ap-checkbox .checkbox .checkbox-container span.checkbox:active{border-color:var(--ref-color-grey-100)}ap-checkbox .checkbox .checkbox-container span.checkbox .checkmark{display:flex;justify-content:center;align-items:center}ap-checkbox .checkbox .checkbox-container span.checkbox .indeterminate{height:1.5px;background:var(--ref-color-white);width:8px}ap-checkbox .checkbox label{display:flex;align-items:center;font-family:var(--comp-forms-label-font-family);font-size:var(--comp-forms-label-size);font-weight:var(--comp-forms-label-font-weight);line-height:var(--comp-forms-label-line-height);color:var(--comp-forms-label-text-color)}ap-checkbox .checkbox label:empty{display:none}ap-checkbox .checkbox label.disabled{color:var(--ref-color-grey-60)}ap-checkbox .checkbox label:hover:not(.disabled){cursor:pointer}form.ng-submitted ap-checkbox.ng-invalid span.checkbox{border-color:var(--ref-color-red-100)!important}\n"], dependencies: [{ kind: "component", type: SymbolComponent, selector: "ap-symbol", inputs: ["symbolId", "color", "size"], outputs: ["sizeChange"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
127
127
|
}
|
|
128
128
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.9", ngImport: i0, type: CheckboxComponent, decorators: [{
|
|
129
129
|
type: Component,
|
|
@@ -134,7 +134,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.9", ngImpor
|
|
|
134
134
|
useExisting: CheckboxComponent,
|
|
135
135
|
multi: true,
|
|
136
136
|
},
|
|
137
|
-
], encapsulation: ViewEncapsulation.None, template: "<div\n class=\"checkbox\"\n (click)=\"_preventBubblingFromLabel($event)\">\n <div\n class=\"checkbox-container\"\n [class.hover]=\"hovered\"\n [class.checked]=\"checked\"\n [class.indeterminate]=\"indeterminate && !checked\"\n [class.disabled]=\"disabled\"\n [class.has-label]=\"hasLabel\"\n [class.required]=\"required\">\n <input\n #input\n type=\"checkbox\"\n [id]=\"name\"\n [class.disabled]=\"disabled\"\n [disabled]=\"disabled\"\n [checked]=\"checked\"\n [required]=\"required\"\n [attr.aria-label]=\"ariaLabel\"\n [attr.aria-labelledby]=\"ariaLabelledby\"\n [attr.aria-describedby]=\"ariaDescribedby\"\n [attr.data-test]=\"name\"\n (click)=\"onValueChange()\" />\n <span\n class=\"checkbox\"\n (mouseenter)=\"onMouseEnter()\"\n (mouseleave)=\"onMouseLeave()\"\n (click)=\"onValueChange()\">\n @if (checked) {\n <span class=\"checkmark\">\n <ap-symbol\n symbolId=\"check\"\n color=\"white\"\n [size]=\"10\" />\n </span>\n }\n @if (indeterminate && !checked) {\n <span class=\"indeterminate\"></span>\n }\n </span>\n </div>\n <label\n #label\n [class.disabled]=\"disabled\"\n [for]=\"name\">\n <ng-content
|
|
137
|
+
], encapsulation: ViewEncapsulation.None, template: "<div\n class=\"checkbox\"\n (click)=\"_preventBubblingFromLabel($event)\">\n <div\n class=\"checkbox-container\"\n [class.hover]=\"hovered\"\n [class.checked]=\"checked\"\n [class.indeterminate]=\"indeterminate && !checked\"\n [class.disabled]=\"disabled\"\n [class.has-label]=\"hasLabel\"\n [class.required]=\"required\">\n <input\n #input\n type=\"checkbox\"\n [id]=\"name\"\n [class.disabled]=\"disabled\"\n [disabled]=\"disabled\"\n [checked]=\"checked\"\n [required]=\"required\"\n [attr.aria-label]=\"ariaLabel\"\n [attr.aria-labelledby]=\"ariaLabelledby\"\n [attr.aria-describedby]=\"ariaDescribedby\"\n [attr.data-test]=\"name\"\n (click)=\"onValueChange()\" />\n <span\n class=\"checkbox\"\n (mouseenter)=\"onMouseEnter()\"\n (mouseleave)=\"onMouseLeave()\"\n (click)=\"onValueChange()\">\n @if (checked) {\n <span class=\"checkmark\">\n <ap-symbol\n symbolId=\"check\"\n color=\"white\"\n [size]=\"10\" />\n </span>\n }\n @if (indeterminate && !checked) {\n <span class=\"indeterminate\"></span>\n }\n </span>\n </div>\n <label\n #label\n [class.disabled]=\"disabled\"\n [for]=\"name\">\n <ng-content>Checkbox label</ng-content>\n </label>\n</div>\n", styles: ["ap-checkbox{display:flex;align-items:center}ap-checkbox.ng-invalid.ng-touched .checkbox-container.required span.checkbox{border-color:var(--ref-color-red-100)!important}ap-checkbox.bold label{font-weight:var(--ref-font-weight-bold)}ap-checkbox.full-width .checkbox{justify-content:space-between;align-items:center;width:100%}ap-checkbox .checkbox{display:flex;align-items:center;gap:var(--ref-spacing-xxs)}ap-checkbox .checkbox .checkbox-container{display:flex;justify-content:center;align-items:center;max-width:36px;height:fit-content;box-sizing:border-box;position:relative}ap-checkbox .checkbox .checkbox-container:not(.has-label){padding:10px}ap-checkbox .checkbox .checkbox-container.hover:not(.disabled):not(.has-label){border-radius:var(--ref-border-radius-md);background:var(--ref-color-grey-05)}ap-checkbox .checkbox .checkbox-container.checked:not(.disabled).hover{background:var(--ref-color-electric-blue-10)}ap-checkbox .checkbox .checkbox-container.checked:not(.disabled):active:not(.has-label){background:var(--ref-color-electric-blue-20)}ap-checkbox .checkbox .checkbox-container.checked:not(.disabled):active:not(.has-label) span.checkbox{background:var(--ref-color-electric-blue-60)}ap-checkbox .checkbox .checkbox-container.checked:not(.disabled) span.checkbox{background:var(--ref-color-electric-blue-100);border-color:var(--ref-color-electric-blue-100)}ap-checkbox .checkbox .checkbox-container.checked:not(.disabled) span.checkbox:hover{border:1px solid var(--ref-color-electric-blue-100);background:var(--ref-color-electric-blue-80)}ap-checkbox .checkbox .checkbox-container.checked:not(.disabled) span.checkbox:active{border:1px solid var(--ref-color-electric-blue-100);background:var(--ref-color-electric-blue-60)}ap-checkbox .checkbox .checkbox-container.indeterminate:not(.disabled).hover{background:var(--ref-color-electric-blue-10)}ap-checkbox .checkbox .checkbox-container.indeterminate:not(.disabled) span.checkbox{background:var(--ref-color-electric-blue-100);border-color:var(--ref-color-electric-blue-100)}ap-checkbox .checkbox .checkbox-container.indeterminate:not(.disabled) span.checkbox:hover{border:1px solid var(--ref-color-electric-blue-100);background:var(--ref-color-electric-blue-80)}ap-checkbox .checkbox .checkbox-container.disabled span.checkbox{border:1px solid var(--ref-color-grey-20);background:var(--ref-color-grey-10)}ap-checkbox .checkbox .checkbox-container.disabled.checked span.checkbox{background:var(--ref-color-grey-20)}ap-checkbox .checkbox .checkbox-container.disabled.indeterminate span.checkbox{background:var(--ref-color-grey-20)}ap-checkbox .checkbox .checkbox-container.disabled span.checkbox{pointer-events:none}ap-checkbox .checkbox .checkbox-container input[type=checkbox]{position:absolute;clip:rect(0,0,0,0)}@media (hover: hover){ap-checkbox .checkbox .checkbox-container input[type=checkbox]:focus:not(.disabled)~.checkbox{outline:3px solid var(--ref-color-electric-blue-100);outline-offset:1px}}ap-checkbox .checkbox .checkbox-container span.checkbox{display:flex;justify-content:center;align-items:center;width:16px;height:16px;min-width:16px;min-height:16px;max-height:16px;max-width:16px;border-radius:var(--sys-border-radius-sm);border:1px solid var(--ref-color-grey-60);background:var(--ref-color-white);box-sizing:border-box}ap-checkbox .checkbox .checkbox-container span.checkbox:hover{cursor:pointer;border-color:var(--ref-color-grey-80)}ap-checkbox .checkbox .checkbox-container span.checkbox:active{border-color:var(--ref-color-grey-100)}ap-checkbox .checkbox .checkbox-container span.checkbox .checkmark{display:flex;justify-content:center;align-items:center}ap-checkbox .checkbox .checkbox-container span.checkbox .indeterminate{height:1.5px;background:var(--ref-color-white);width:8px}ap-checkbox .checkbox label{display:flex;align-items:center;font-family:var(--comp-forms-label-font-family);font-size:var(--comp-forms-label-size);font-weight:var(--comp-forms-label-font-weight);line-height:var(--comp-forms-label-line-height);color:var(--comp-forms-label-text-color)}ap-checkbox .checkbox label:empty{display:none}ap-checkbox .checkbox label.disabled{color:var(--ref-color-grey-60)}ap-checkbox .checkbox label:hover:not(.disabled){cursor:pointer}form.ng-submitted ap-checkbox.ng-invalid span.checkbox{border-color:var(--ref-color-red-100)!important}\n"] }]
|
|
138
138
|
}], propDecorators: { inputElement: [{
|
|
139
139
|
type: ViewChild,
|
|
140
140
|
args: ['input', { static: true }]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agorapulse-ui-components-checkbox.mjs","sources":["../../../libs/ui-components/checkbox/src/checkbox.component.ts","../../../libs/ui-components/checkbox/src/checkbox.component.html","../../../libs/ui-components/checkbox/src/agorapulse-ui-components-checkbox.ts"],"sourcesContent":["import { apCheck, SymbolComponent, SymbolRegistry } from '@agorapulse/ui-symbol';\nimport {\n AfterContentInit,\n booleanAttribute,\n ChangeDetectionStrategy,\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, NG_VALIDATORS, NG_VALUE_ACCESSOR } from '@angular/forms';\n\nexport const AP_CHECKBOX_CONTROL_VALUE_ACCESSOR = {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => CheckboxComponent),\n multi: true,\n};\n\n@Component({\n changeDetection: ChangeDetectionStrategy.OnPush,\n selector: 'ap-checkbox',\n styleUrls: ['./checkbox.component.scss'],\n standalone: true,\n imports: [SymbolComponent],\n providers: [\n AP_CHECKBOX_CONTROL_VALUE_ACCESSOR,\n {\n provide: NG_VALIDATORS,\n useExisting: CheckboxComponent,\n multi: true,\n },\n ],\n templateUrl: './checkbox.component.html',\n encapsulation: ViewEncapsulation.None,\n})\nexport class CheckboxComponent implements ControlValueAccessor, AfterContentInit, OnChanges, OnInit {\n private readonly symbolRegistry = inject(SymbolRegistry);\n @ViewChild('input', { static: true }) inputElement!: ElementRef<HTMLInputElement>;\n @ViewChild('label', { static: true }) labelElement!: ElementRef<HTMLInputElement>;\n @Input('aria-label') ariaLabel?: string;\n @Input('aria-labelledby') ariaLabelledby?: string;\n @Input('aria-describedby') ariaDescribedby?: string;\n @Input({\n transform: booleanAttribute,\n })\n disabled = false;\n @Input({\n transform: booleanAttribute,\n })\n set indeterminate(indeterminate: boolean) {\n if (indeterminate) {\n this.checked = false;\n }\n this._indeterminate = indeterminate;\n }\n\n get indeterminate(): boolean {\n return this._indeterminate;\n }\n\n @Input() checked = false;\n\n @Input({\n transform: booleanAttribute,\n })\n required = false;\n\n @Input({\n required: true,\n })\n set name(name: string) {\n this._name = name;\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 ariaChecked: 'true' | 'false' | 'mixed' = 'false';\n hasLabel = false;\n hovered = false;\n\n private _indeterminate = 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]);\n }\n\n ngAfterContentInit(): void {\n if (this.labelElement) {\n this.hasLabel = !!this.labelElement.nativeElement.textContent?.trim();\n }\n }\n\n onMouseEnter(): void {\n if (!this.disabled) {\n this.hovered = true;\n }\n }\n\n onMouseLeave(): void {\n if (!this.disabled) {\n this.hovered = false;\n }\n }\n\n onValueChange() {\n if (this.onTouched) {\n this.onTouched();\n }\n if (!this.disabled) {\n if (this.indeterminate) {\n this.checked = false;\n this.indeterminate = false;\n } else {\n this.checked = !this.checked;\n this.focus();\n }\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 }\n }\n\n focus() {\n this.inputElement.nativeElement.focus();\n }\n\n writeValue(value: boolean): void {\n this.checked = value;\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() {\n const isNotValid = !this.checked && this.required;\n return (\n isNotValid && {\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=\"checkbox\"\n (click)=\"_preventBubblingFromLabel($event)\">\n <div\n class=\"checkbox-container\"\n [class.hover]=\"hovered\"\n [class.checked]=\"checked\"\n [class.indeterminate]=\"indeterminate && !checked\"\n [class.disabled]=\"disabled\"\n [class.has-label]=\"hasLabel\"\n [class.required]=\"required\">\n <input\n #input\n type=\"checkbox\"\n [id]=\"name\"\n [class.disabled]=\"disabled\"\n [disabled]=\"disabled\"\n [checked]=\"checked\"\n [required]=\"required\"\n [attr.aria-label]=\"ariaLabel\"\n [attr.aria-labelledby]=\"ariaLabelledby\"\n [attr.aria-describedby]=\"ariaDescribedby\"\n [attr.data-test]=\"name\"\n (click)=\"onValueChange()\" />\n <span\n class=\"checkbox\"\n (mouseenter)=\"onMouseEnter()\"\n (mouseleave)=\"onMouseLeave()\"\n (click)=\"onValueChange()\">\n @if (checked) {\n <span class=\"checkmark\">\n <ap-symbol\n symbolId=\"check\"\n color=\"white\"\n [size]=\"10\" />\n </span>\n }\n @if (indeterminate && !checked) {\n <span class=\"indeterminate\"></span>\n }\n </span>\n </div>\n <label\n #label\n [class.disabled]=\"disabled\"\n [for]=\"name\">\n <ng-content />\n </label>\n</div>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;AAmBa,MAAA,kCAAkC,GAAG;AAC9C,IAAA,OAAO,EAAE,iBAAiB;AAC1B,IAAA,WAA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gBACf,SAAS,EAAA,CAAA;sBAA7B,KAAK;uBAAC,YAAY;gBACO,cAAc,EAAA,CAAA;sBAAvC,KAAK;uBAAC,iBAAiB;gBACG,eAAe,EAAA,CAAA;sBAAzC,KAAK;uBAAC,kBAAkB;gBAIzB,QAAQ,EAAA,CAAA;sBAHP,KAAK;AAAC,gBAAA,IAAA,EAAA,CAAA;AACH,wBAAA,SAAS,EAAE,gBAAgB;AAC9B,qBAAA;gBAKG,aAAa,EAAA,CAAA;sBAHhB,KAAK;AAAC,gBAAA,IAAA,EAAA,CAAA;AACH,wBAAA,SAAS,EAAE,gBAAgB;AAC9B,qBAAA;gBAYQ,OAAO,EAAA,CAAA;sBAAf;gBAKD,QAAQ,EAAA,CAAA;sBAHP,KAAK;AAAC,gBAAA,IAAA,EAAA,CAAA;AACH,wBAAA,SAAS,EAAE,gBAAgB;AAC9B,qBAAA;gBAMG,IAAI,EAAA,CAAA;sBAHP,KAAK;AAAC,gBAAA,IAAA,EAAA,CAAA;AACH,wBAAA,QAAQ,EAAE,IAAI;AACjB,qBAAA;gBAQkB,MAAM,EAAA,CAAA;sBAAxB;;;AEpFL;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"agorapulse-ui-components-checkbox.mjs","sources":["../../../libs/ui-components/checkbox/src/checkbox.component.ts","../../../libs/ui-components/checkbox/src/checkbox.component.html","../../../libs/ui-components/checkbox/src/agorapulse-ui-components-checkbox.ts"],"sourcesContent":["import { apCheck, SymbolComponent, SymbolRegistry } from '@agorapulse/ui-symbol';\nimport {\n AfterContentInit,\n booleanAttribute,\n ChangeDetectionStrategy,\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, NG_VALIDATORS, NG_VALUE_ACCESSOR } from '@angular/forms';\n\nexport const AP_CHECKBOX_CONTROL_VALUE_ACCESSOR = {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => CheckboxComponent),\n multi: true,\n};\n\n@Component({\n changeDetection: ChangeDetectionStrategy.OnPush,\n selector: 'ap-checkbox',\n styleUrls: ['./checkbox.component.scss'],\n standalone: true,\n imports: [SymbolComponent],\n providers: [\n AP_CHECKBOX_CONTROL_VALUE_ACCESSOR,\n {\n provide: NG_VALIDATORS,\n useExisting: CheckboxComponent,\n multi: true,\n },\n ],\n templateUrl: './checkbox.component.html',\n encapsulation: ViewEncapsulation.None,\n})\nexport class CheckboxComponent implements ControlValueAccessor, AfterContentInit, OnChanges, OnInit {\n private readonly symbolRegistry = inject(SymbolRegistry);\n @ViewChild('input', { static: true }) inputElement!: ElementRef<HTMLInputElement>;\n @ViewChild('label', { static: true }) labelElement!: ElementRef<HTMLInputElement>;\n @Input('aria-label') ariaLabel?: string;\n @Input('aria-labelledby') ariaLabelledby?: string;\n @Input('aria-describedby') ariaDescribedby?: string;\n @Input({\n transform: booleanAttribute,\n })\n disabled = false;\n @Input({\n transform: booleanAttribute,\n })\n set indeterminate(indeterminate: boolean) {\n if (indeterminate) {\n this.checked = false;\n }\n this._indeterminate = indeterminate;\n }\n\n get indeterminate(): boolean {\n return this._indeterminate;\n }\n\n @Input() checked = false;\n\n @Input({\n transform: booleanAttribute,\n })\n required = false;\n\n @Input({\n required: true,\n })\n set name(name: string) {\n this._name = name;\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 ariaChecked: 'true' | 'false' | 'mixed' = 'false';\n hasLabel = false;\n hovered = false;\n\n private _indeterminate = 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]);\n }\n\n ngAfterContentInit(): void {\n if (this.labelElement) {\n this.hasLabel = !!this.labelElement.nativeElement.textContent?.trim();\n }\n }\n\n onMouseEnter(): void {\n if (!this.disabled) {\n this.hovered = true;\n }\n }\n\n onMouseLeave(): void {\n if (!this.disabled) {\n this.hovered = false;\n }\n }\n\n onValueChange() {\n if (this.onTouched) {\n this.onTouched();\n }\n if (!this.disabled) {\n if (this.indeterminate) {\n this.checked = false;\n this.indeterminate = false;\n } else {\n this.checked = !this.checked;\n this.focus();\n }\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 }\n }\n\n focus() {\n this.inputElement.nativeElement.focus();\n }\n\n writeValue(value: boolean): void {\n this.checked = value;\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() {\n const isNotValid = !this.checked && this.required;\n return (\n isNotValid && {\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=\"checkbox\"\n (click)=\"_preventBubblingFromLabel($event)\">\n <div\n class=\"checkbox-container\"\n [class.hover]=\"hovered\"\n [class.checked]=\"checked\"\n [class.indeterminate]=\"indeterminate && !checked\"\n [class.disabled]=\"disabled\"\n [class.has-label]=\"hasLabel\"\n [class.required]=\"required\">\n <input\n #input\n type=\"checkbox\"\n [id]=\"name\"\n [class.disabled]=\"disabled\"\n [disabled]=\"disabled\"\n [checked]=\"checked\"\n [required]=\"required\"\n [attr.aria-label]=\"ariaLabel\"\n [attr.aria-labelledby]=\"ariaLabelledby\"\n [attr.aria-describedby]=\"ariaDescribedby\"\n [attr.data-test]=\"name\"\n (click)=\"onValueChange()\" />\n <span\n class=\"checkbox\"\n (mouseenter)=\"onMouseEnter()\"\n (mouseleave)=\"onMouseLeave()\"\n (click)=\"onValueChange()\">\n @if (checked) {\n <span class=\"checkmark\">\n <ap-symbol\n symbolId=\"check\"\n color=\"white\"\n [size]=\"10\" />\n </span>\n }\n @if (indeterminate && !checked) {\n <span class=\"indeterminate\"></span>\n }\n </span>\n </div>\n <label\n #label\n [class.disabled]=\"disabled\"\n [for]=\"name\">\n <ng-content>Checkbox label</ng-content>\n </label>\n</div>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;AAmBa,MAAA,kCAAkC,GAAG;AAC9C,IAAA,OAAO,EAAE,iBAAiB;AAC1B,IAAA,WAAW,EAAE,UAAU,CAAC,MAAM,iBAAiB,CAAC;AAChD,IAAA,KAAK,EAAE,IAAI;;MAoBF,iBAAiB,CAAA;AACT,IAAA,cAAc,GAAG,MAAM,CAAC,cAAc,CAAC;AAClB,IAAA,YAAY;AACZ,IAAA,YAAY;AAC7B,IAAA,SAAS;AACJ,IAAA,cAAc;AACb,IAAA,eAAe;IAI1C,QAAQ,GAAG,KAAK;IAChB,IAGI,aAAa,CAAC,aAAsB,EAAA;QACpC,IAAI,aAAa,EAAE;AACf,YAAA,IAAI,CAAC,OAAO,GAAG,KAAK;;AAExB,QAAA,IAAI,CAAC,cAAc,GAAG,aAAa;;AAGvC,IAAA,IAAI,aAAa,GAAA;QACb,OAAO,IAAI,CAAC,cAAc;;IAGrB,OAAO,GAAG,KAAK;IAKxB,QAAQ,GAAG,KAAK;IAEhB,IAGI,IAAI,CAAC,IAAY,EAAA;AACjB,QAAA,IAAI,CAAC,KAAK,GAAG,IAAI;;AAErB,IAAA,IAAI,IAAI,GAAA;QACJ,OAAO,IAAI,CAAC,KAAK;;;AAGF,IAAA,MAAM,GAA0B,IAAI,YAAY,EAAW;IAE9E,WAAW,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;"}
|
|
@@ -41,7 +41,7 @@ class ConfirmModalComponent {
|
|
|
41
41
|
return confirmModal;
|
|
42
42
|
}
|
|
43
43
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.9", ngImport: i0, type: ConfirmModalComponent, deps: [{ token: i1.MatDialogRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
44
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.9", 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", "
|
|
44
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.9", 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 });
|
|
45
45
|
}
|
|
46
46
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.9", ngImport: i0, type: ConfirmModalComponent, decorators: [{
|
|
47
47
|
type: Component,
|
|
@@ -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 { ModalComponent, ModalConfig } from '@agorapulse/ui-components/modal';\nimport { ComponentType } from '@angular/cdk/portal';\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 standalone: true,\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<ComponentType<any>>) {\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.openWithComponent(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"],"names":[],"mappings":";;;;;;MAea,qBAAqB,CAAA;AAQX,IAAA,SAAA;IAPV,WAAW,GAAW,EAAE;IACxB,oBAAoB,GAAW,QAAQ;IACvC,uBAAuB,GAAW,EAAE;IACpC,qBAAqB,GAAW,SAAS;IACzC,wBAAwB,GAAW,EAAE;IACrC,WAAW,GAAW,EAAE;AAEjC,IAAA,WAAA,CAAmB,SAA2C,EAAA;QAA3C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EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,qBAAqB,ECflC,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,kBAAA,EAAA,MAAA,EAAA,EAAA,WAAA,EAAA,aAAA,EAAA,oBAAA,EAAA,sBAAA,EAAA,uBAAA,EAAA,yBAAA,EAAA,qBAAA,EAAA,uBAAA,EAAA,wBAAA,EAAA,0BAAA,EAAA,WAAA,EAAA,aAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,EAAA,2pCA2CA,ED/Bc,MAAA,EAAA,CAAA,oDAAA,CAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,eAAe
|
|
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 { ComponentType } from '@angular/cdk/portal';\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 standalone: true,\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<ComponentType<any>>) {\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.openWithComponent(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\nex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