@villedemontreal/angular-ui 3.1.1 → 3.2.0-pre.build.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -17,7 +17,7 @@ import { Subject, filter, take, defer, startWith, Subscription } from 'rxjs';
17
17
  import { _getFocusedElementPierceShadowDom } from '@angular/cdk/platform';
18
18
  import { trigger, state, style, transition, group, animate, query, animateChild } from '@angular/animations';
19
19
  import { ESCAPE, hasModifierKey } from '@angular/cdk/keycodes';
20
- import { ANIMATION_MODULE_TYPE, BrowserAnimationsModule, NoopAnimationsModule } from '@angular/platform-browser/animations';
20
+ import { ANIMATION_MODULE_TYPE } from '@angular/platform-browser/animations';
21
21
 
22
22
  function baoColorToHex(baoColor) {
23
23
  switch (baoColor) {
@@ -2223,7 +2223,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.1", ngImpor
2223
2223
  const SPAN = 'span';
2224
2224
  const SPAN_TEXT_PROPERTY$1 = 'textContent';
2225
2225
  const SCREEN_READER_CLASS_NAME$1 = 'sr-only';
2226
- const BAO_ICON = 'bao-icon';
2226
+ const BAO_ICON$1 = 'bao-icon';
2227
2227
  const HAS_ICON = 'has-icon';
2228
2228
  class BaoTagComponent {
2229
2229
  constructor(renderer, elementRef) {
@@ -2258,7 +2258,7 @@ class BaoTagComponent {
2258
2258
  }
2259
2259
  addIconClass() {
2260
2260
  const children = Array.from(this.nativeElement.children);
2261
- if (children.some(c => c.localName === BAO_ICON)) {
2261
+ if (children.some(c => c.localName === BAO_ICON$1)) {
2262
2262
  this.renderer.addClass(this.nativeElement, HAS_ICON);
2263
2263
  }
2264
2264
  }
@@ -3827,32 +3827,117 @@ const MODAL_DIRECTIVES = [BaoModalContainer, BaoModalClose];
3827
3827
  class BaoModalModule {
3828
3828
  }
3829
3829
  BaoModalModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.1", ngImport: i0, type: BaoModalModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
3830
- BaoModalModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.2.1", ngImport: i0, type: BaoModalModule, declarations: [BaoModalContainer, BaoModalClose], imports: [CommonModule,
3831
- OverlayModule,
3832
- PortalModule,
3833
- BrowserAnimationsModule,
3834
- NoopAnimationsModule], exports: [BaoModalContainer, BaoModalClose] });
3835
- BaoModalModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.2.1", ngImport: i0, type: BaoModalModule, providers: [BaoModal], imports: [CommonModule,
3836
- OverlayModule,
3837
- PortalModule,
3838
- BrowserAnimationsModule,
3839
- NoopAnimationsModule] });
3830
+ BaoModalModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.2.1", ngImport: i0, type: BaoModalModule, declarations: [BaoModalContainer, BaoModalClose], imports: [CommonModule, OverlayModule, PortalModule], exports: [BaoModalContainer, BaoModalClose] });
3831
+ BaoModalModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.2.1", ngImport: i0, type: BaoModalModule, providers: [BaoModal], imports: [CommonModule, OverlayModule, PortalModule] });
3840
3832
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.1", ngImport: i0, type: BaoModalModule, decorators: [{
3841
3833
  type: NgModule,
3842
3834
  args: [{
3843
- imports: [
3844
- CommonModule,
3845
- OverlayModule,
3846
- PortalModule,
3847
- BrowserAnimationsModule,
3848
- NoopAnimationsModule
3849
- ],
3835
+ imports: [CommonModule, OverlayModule, PortalModule],
3850
3836
  declarations: MODAL_DIRECTIVES,
3851
3837
  exports: MODAL_DIRECTIVES,
3852
3838
  providers: [BaoModal]
3853
3839
  }]
3854
3840
  }] });
3855
3841
 
3842
+ /*
3843
+ * Copyright (c) 2022 Ville de Montreal. All rights reserved.
3844
+ * Licensed under the MIT license.
3845
+ * See LICENSE file in the project root for full license information.
3846
+ */
3847
+ const BAO_ICON = 'bao-icon';
3848
+ const LINK_ELEMENT = 'a';
3849
+ const HAS_LEFT_ICON = 'has-left-icon';
3850
+ const HAS_RIGHT_ICON = 'has-right-icon';
3851
+ const LIST_PARENT = 'bao-hyperlink-list-parent';
3852
+ class BaoHyperlinkComponent {
3853
+ constructor(renderer, elementRef) {
3854
+ this.renderer = renderer;
3855
+ this.elementRef = elementRef;
3856
+ /**
3857
+ * Size of the link when it's in a list.
3858
+ */
3859
+ this.size = 'medium';
3860
+ }
3861
+ get nativeElement() {
3862
+ return this.elementRef.nativeElement;
3863
+ }
3864
+ ngAfterViewInit() {
3865
+ this.setIcon();
3866
+ this.addIconClass();
3867
+ }
3868
+ setIcon() {
3869
+ const parentName = this.nativeElement.parentElement.localName;
3870
+ if (parentName === 'ul') {
3871
+ this.renderer.addClass(this.nativeElement.parentElement, LIST_PARENT);
3872
+ }
3873
+ else {
3874
+ // Icon in inline hyperlink must always be positioned after label.
3875
+ const children = Array.from(this.nativeElement.children);
3876
+ const iconIndex = children.findIndex(c => c.localName === BAO_ICON);
3877
+ if (iconIndex > -1) {
3878
+ const labelIndex = children.findIndex(c => c.localName === LINK_ELEMENT);
3879
+ // Set icon's size to match text's lineHeight.
3880
+ const lineHeight = getComputedStyle(children[labelIndex])['lineHeight'];
3881
+ this.renderer.setStyle(children[iconIndex], 'height', lineHeight);
3882
+ this.renderer.setStyle(children[iconIndex], 'width', lineHeight);
3883
+ if (iconIndex < labelIndex) {
3884
+ const iconElement = children[iconIndex];
3885
+ this.renderer.removeChild(this.nativeElement, children[iconIndex]);
3886
+ this.renderer.appendChild(this.nativeElement, iconElement);
3887
+ }
3888
+ }
3889
+ }
3890
+ }
3891
+ addIconClass() {
3892
+ const children = Array.from(this.nativeElement.children);
3893
+ const iconIndex = children.findIndex(c => c.localName === BAO_ICON);
3894
+ if (iconIndex > -1) {
3895
+ const labelIndex = children.findIndex(c => c.localName === LINK_ELEMENT);
3896
+ const iconClass = iconIndex < labelIndex ? HAS_LEFT_ICON : HAS_RIGHT_ICON;
3897
+ this.renderer.addClass(this.nativeElement, iconClass);
3898
+ }
3899
+ }
3900
+ }
3901
+ BaoHyperlinkComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.1", ngImport: i0, type: BaoHyperlinkComponent, deps: [{ token: i0.Renderer2 }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
3902
+ BaoHyperlinkComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.1", type: BaoHyperlinkComponent, selector: "bao-hyperlink, [bao-hyperlink]", inputs: { size: "size" }, host: { properties: { "class.bao-hyperlink-medium": "size === \"medium\"", "class.bao-hyperlink-small": "size === \"small\"", "class.bao-hyperlink-extra-small": "size === \"extra-small\"" }, classAttribute: "bao-hyperlink" }, ngImport: i0, template: "<ng-content></ng-content>\n", styles: [".bao-hyperlink:not(li){display:inline-flex;font-size:inherit;line-height:inherit}.bao-hyperlink:not(li)>a{box-shadow:inset 0 -1px #097d6c;text-decoration:none;border-bottom:none;font-size:inherit}li.bao-hyperlink{display:flex}li.bao-hyperlink>a{text-decoration:none;border-bottom:none}li.bao-hyperlink>a:hover{box-shadow:inset 0 -1px #097d6c}li.bao-hyperlink.bao-hyperlink-extra-small a{font-weight:700;font-size:.75rem;line-height:1rem}li.bao-hyperlink.bao-hyperlink-extra-small .bao-icon{height:1rem;width:1rem}li.bao-hyperlink.bao-hyperlink-small a{font-weight:700;font-size:.875rem;line-height:1.25rem}li.bao-hyperlink.bao-hyperlink-small .bao-icon{height:1.25rem;width:1.25rem}li.bao-hyperlink.bao-hyperlink-medium a{font-weight:700;font-size:1rem;line-height:1.5rem}li.bao-hyperlink.bao-hyperlink-medium .bao-icon{height:1.5rem;width:1.5rem}.bao-hyperlink{align-items:center}.bao-hyperlink>.bao-icon{color:#097d6c;flex-shrink:0}.bao-hyperlink.has-right-icon>.bao-icon{margin-left:.25rem}.bao-hyperlink.has-left-icon>.bao-icon{margin-right:.5rem}ul.bao-hyperlink-list-parent{list-style-type:none}\n"], encapsulation: i0.ViewEncapsulation.None });
3903
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.1", ngImport: i0, type: BaoHyperlinkComponent, decorators: [{
3904
+ type: Component,
3905
+ args: [{ selector: 'bao-hyperlink, [bao-hyperlink]', encapsulation: ViewEncapsulation.None, host: {
3906
+ class: 'bao-hyperlink',
3907
+ '[class.bao-hyperlink-medium]': 'size === "medium"',
3908
+ '[class.bao-hyperlink-small]': 'size === "small"',
3909
+ '[class.bao-hyperlink-extra-small]': 'size === "extra-small"'
3910
+ }, template: "<ng-content></ng-content>\n", styles: [".bao-hyperlink:not(li){display:inline-flex;font-size:inherit;line-height:inherit}.bao-hyperlink:not(li)>a{box-shadow:inset 0 -1px #097d6c;text-decoration:none;border-bottom:none;font-size:inherit}li.bao-hyperlink{display:flex}li.bao-hyperlink>a{text-decoration:none;border-bottom:none}li.bao-hyperlink>a:hover{box-shadow:inset 0 -1px #097d6c}li.bao-hyperlink.bao-hyperlink-extra-small a{font-weight:700;font-size:.75rem;line-height:1rem}li.bao-hyperlink.bao-hyperlink-extra-small .bao-icon{height:1rem;width:1rem}li.bao-hyperlink.bao-hyperlink-small a{font-weight:700;font-size:.875rem;line-height:1.25rem}li.bao-hyperlink.bao-hyperlink-small .bao-icon{height:1.25rem;width:1.25rem}li.bao-hyperlink.bao-hyperlink-medium a{font-weight:700;font-size:1rem;line-height:1.5rem}li.bao-hyperlink.bao-hyperlink-medium .bao-icon{height:1.5rem;width:1.5rem}.bao-hyperlink{align-items:center}.bao-hyperlink>.bao-icon{color:#097d6c;flex-shrink:0}.bao-hyperlink.has-right-icon>.bao-icon{margin-left:.25rem}.bao-hyperlink.has-left-icon>.bao-icon{margin-right:.5rem}ul.bao-hyperlink-list-parent{list-style-type:none}\n"] }]
3911
+ }], ctorParameters: function () { return [{ type: i0.Renderer2 }, { type: i0.ElementRef }]; }, propDecorators: { size: [{
3912
+ type: Input
3913
+ }] } });
3914
+
3915
+ /*
3916
+ * Copyright (c) 2022 Ville de Montreal. All rights reserved.
3917
+ * Licensed under the MIT license.
3918
+ * See LICENSE file in the project root for full license information.
3919
+ */
3920
+ const HYPERLINK_DIRECTIVES = [BaoHyperlinkComponent];
3921
+ class BaoHyperlinkModule {
3922
+ }
3923
+ BaoHyperlinkModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.1", ngImport: i0, type: BaoHyperlinkModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
3924
+ BaoHyperlinkModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.2.1", ngImport: i0, type: BaoHyperlinkModule, declarations: [BaoHyperlinkComponent], imports: [CommonModule], exports: [BaoHyperlinkComponent] });
3925
+ BaoHyperlinkModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.2.1", ngImport: i0, type: BaoHyperlinkModule, imports: [CommonModule] });
3926
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.1", ngImport: i0, type: BaoHyperlinkModule, decorators: [{
3927
+ type: NgModule,
3928
+ args: [{
3929
+ imports: [CommonModule],
3930
+ declarations: [HYPERLINK_DIRECTIVES],
3931
+ exports: [HYPERLINK_DIRECTIVES]
3932
+ }]
3933
+ }] });
3934
+
3935
+ /*
3936
+ * Copyright (c) 2022 Ville de Montreal. All rights reserved.
3937
+ * Licensed under the MIT license.
3938
+ * See LICENSE file in the project root for full license information.
3939
+ */
3940
+
3856
3941
  /*
3857
3942
  * Copyright (c) 2022 Ville de Montreal. All rights reserved.
3858
3943
  * Licensed under the MIT license.
@@ -3865,7 +3950,8 @@ BaoModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.
3865
3950
  BaoButtonModule,
3866
3951
  BaoAlertModule,
3867
3952
  BaoCardModule,
3868
- BaoBreadcrumbModule], exports: [BaoIconModule,
3953
+ BaoBreadcrumbModule,
3954
+ BaoModalModule], exports: [BaoIconModule,
3869
3955
  BaoButtonModule,
3870
3956
  BaoAlertModule,
3871
3957
  BaoBreadcrumbModule,
@@ -3879,7 +3965,8 @@ BaoModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.
3879
3965
  BaoSummaryModule,
3880
3966
  BaoAvatarModule,
3881
3967
  BaoTabsModule,
3882
- BaoModalModule
3968
+ BaoModalModule,
3969
+ BaoHyperlinkModule
3883
3970
  // TODO: reactivate once component does not depend on global css BaoBadgeModule,
3884
3971
  // TODO: reactivate once component does not depend on global css BaoSnackBarModule,
3885
3972
  ] });
@@ -3887,7 +3974,8 @@ BaoModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.
3887
3974
  BaoButtonModule,
3888
3975
  BaoAlertModule,
3889
3976
  BaoCardModule,
3890
- BaoBreadcrumbModule, BaoIconModule,
3977
+ BaoBreadcrumbModule,
3978
+ BaoModalModule, BaoIconModule,
3891
3979
  BaoButtonModule,
3892
3980
  BaoAlertModule,
3893
3981
  BaoBreadcrumbModule,
@@ -3901,7 +3989,8 @@ BaoModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.
3901
3989
  BaoSummaryModule,
3902
3990
  BaoAvatarModule,
3903
3991
  BaoTabsModule,
3904
- BaoModalModule
3992
+ BaoModalModule,
3993
+ BaoHyperlinkModule
3905
3994
  // TODO: reactivate once component does not depend on global css BaoBadgeModule,
3906
3995
  // TODO: reactivate once component does not depend on global css BaoSnackBarModule,
3907
3996
  ] });
@@ -3913,7 +4002,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.1", ngImpor
3913
4002
  BaoButtonModule,
3914
4003
  BaoAlertModule,
3915
4004
  BaoCardModule,
3916
- BaoBreadcrumbModule
4005
+ BaoBreadcrumbModule,
4006
+ BaoModalModule
3917
4007
  ],
3918
4008
  exports: [
3919
4009
  BaoIconModule,
@@ -3930,7 +4020,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.1", ngImpor
3930
4020
  BaoSummaryModule,
3931
4021
  BaoAvatarModule,
3932
4022
  BaoTabsModule,
3933
- BaoModalModule
4023
+ BaoModalModule,
4024
+ BaoHyperlinkModule
3934
4025
  // TODO: reactivate once component does not depend on global css BaoBadgeModule,
3935
4026
  // TODO: reactivate once component does not depend on global css BaoSnackBarModule,
3936
4027
  ]
@@ -4010,5 +4101,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.1", ngImpor
4010
4101
  * Generated bundle index. Do not edit.
4011
4102
  */
4012
4103
 
4013
- export { BAO_MODAL_DATA, BAO_RADIO_GROUP, BaoAlertActions, BaoAlertComponent, BaoAlertContent, BaoAlertLink, BaoAlertModule, BaoAlertTitle, BaoAvatarComponent, BaoAvatarContent, BaoAvatarModule, BaoBadgeComponent, BaoBadgeModule, BaoBreadcrumbComponent, BaoBreadcrumbModule, BaoButtonComponent, BaoButtonModule, BaoCardComponent, BaoCardContent, BaoCardHeader, BaoCardModule, BaoCardTextInterface, BaoCardTitle, BaoCheckBoxDescription, BaoCheckboxComponent, BaoCheckboxGroupComponent, BaoCheckboxModule, BaoCommonComponentsModule, BaoErrorTextComponent, BaoGuidingTextComponent, BaoHeaderInfoComponent, BaoHeaderInfoContent, BaoHeaderInfoModule, BaoHeaderInfoSubtitle, BaoHeaderInfoSurtitle, BaoHeaderInfoTitle, BaoHeaderInfoTitleGroupComponent, BaoIconComponent, BaoIconModule, BaoLabelTextComponent, BaoList, BaoListItem, BaoListItemDescription, BaoListItemTitle, BaoListModule, BaoListSummary, BaoListSummaryItem, BaoModal, BaoModalBase, BaoModalClose, BaoModalContainer, BaoModalInitialConfig, BaoModalModule, BaoModalRef, BaoModule, BaoNavList, BaoRadioButtonComponent, BaoRadioButtonGroupComponent, BaoRadioDescription, BaoRadioModule, BaoSummaryComponent, BaoSummaryDescription, BaoSummaryModule, BaoTabHeader, BaoTabPanel, BaoTablistComponent, BaoTabsContainer, BaoTabsModule, BaoTagComponent, BaoTagModule, BaoTitleTextComponent, _BaoModalContainerBase, _closeModalVia, eModalDesktopWidthSize, eModalMobileWidthSize, throwBaoModalContentAlreadyAttachedError };
4104
+ export { BAO_MODAL_DATA, BAO_RADIO_GROUP, BaoAlertActions, BaoAlertComponent, BaoAlertContent, BaoAlertLink, BaoAlertModule, BaoAlertTitle, BaoAvatarComponent, BaoAvatarContent, BaoAvatarModule, BaoBadgeComponent, BaoBadgeModule, BaoBreadcrumbComponent, BaoBreadcrumbModule, BaoButtonComponent, BaoButtonModule, BaoCardComponent, BaoCardContent, BaoCardHeader, BaoCardModule, BaoCardTextInterface, BaoCardTitle, BaoCheckBoxDescription, BaoCheckboxComponent, BaoCheckboxGroupComponent, BaoCheckboxModule, BaoCommonComponentsModule, BaoErrorTextComponent, BaoGuidingTextComponent, BaoHeaderInfoComponent, BaoHeaderInfoContent, BaoHeaderInfoModule, BaoHeaderInfoSubtitle, BaoHeaderInfoSurtitle, BaoHeaderInfoTitle, BaoHeaderInfoTitleGroupComponent, BaoHyperlinkComponent, BaoHyperlinkModule, BaoIconComponent, BaoIconModule, BaoLabelTextComponent, BaoList, BaoListItem, BaoListItemDescription, BaoListItemTitle, BaoListModule, BaoListSummary, BaoListSummaryItem, BaoModal, BaoModalBase, BaoModalClose, BaoModalContainer, BaoModalInitialConfig, BaoModalModule, BaoModalRef, BaoModule, BaoNavList, BaoRadioButtonComponent, BaoRadioButtonGroupComponent, BaoRadioDescription, BaoRadioModule, BaoSummaryComponent, BaoSummaryDescription, BaoSummaryModule, BaoTabHeader, BaoTabPanel, BaoTablistComponent, BaoTabsContainer, BaoTabsModule, BaoTagComponent, BaoTagModule, BaoTitleTextComponent, _BaoModalContainerBase, _closeModalVia, eModalDesktopWidthSize, eModalMobileWidthSize, throwBaoModalContentAlreadyAttachedError };
4014
4105
  //# sourceMappingURL=villedemontreal-angular-ui.mjs.map