@dereekb/dbx-web 9.23.3 → 9.23.4

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.
@@ -931,25 +931,30 @@ class DbxMapboxMarkerComponent {
931
931
  let width = 0;
932
932
  let height = 0;
933
933
  const size = this._marker?.size || 'medium';
934
- if (typeof size === 'number') {
935
- width = size;
936
- }
937
- else {
938
- switch (size) {
939
- case 'small':
940
- width = 18;
941
- break;
942
- case 'medium':
943
- width = 24;
944
- break;
945
- case 'large':
946
- width = 32;
947
- break;
948
- case 'tall':
949
- width = 24;
950
- height = 32;
934
+ switch (this.presentation) {
935
+ case 'normal':
936
+ if (typeof size === 'number') {
937
+ width = size;
938
+ }
939
+ else {
940
+ switch (size) {
941
+ case 'small':
942
+ width = 18;
943
+ break;
944
+ case 'medium':
945
+ width = 24;
946
+ break;
947
+ case 'large':
948
+ width = 32;
949
+ break;
950
+ case 'tall':
951
+ width = 24;
952
+ height = 32;
953
+ break;
954
+ }
951
955
  break;
952
- }
956
+ }
957
+ break;
953
958
  }
954
959
  if (!height) {
955
960
  height = width;
@@ -958,13 +963,39 @@ class DbxMapboxMarkerComponent {
958
963
  const image = imageInput ? (typeof imageInput === 'string' ? imageInput : getValueFromGetter(imageInput, width)) : undefined;
959
964
  const style = {
960
965
  ...this._marker?.style,
961
- width: width + 'px',
962
- height: height + 'px',
963
- 'font-size': width + 'px',
964
966
  'background-image': image
965
967
  };
968
+ if (width && height) {
969
+ style.width = width + 'px';
970
+ style.height = height + 'px';
971
+ style['font-size'] = width + 'px';
972
+ }
966
973
  return style;
967
974
  }
975
+ get presentation() {
976
+ return this._marker.presentation ?? 'normal';
977
+ }
978
+ get presentationClasses() {
979
+ const presentation = this.presentation;
980
+ const markerClasses = this._marker.markerClasses;
981
+ let cssClasses = '';
982
+ switch (presentation) {
983
+ case 'chip':
984
+ case 'chip-small':
985
+ cssClasses = 'dbx-mapbox-marker-chip dbx-chip mat-standard-chip dbx-bg';
986
+ if (presentation === 'chip-small') {
987
+ cssClasses += ' dbx-chip-small';
988
+ }
989
+ break;
990
+ }
991
+ if (!this.icon) {
992
+ cssClasses += ' dbx-mapbox-marker-no-icon';
993
+ }
994
+ if (markerClasses) {
995
+ cssClasses += markerClasses;
996
+ }
997
+ return cssClasses;
998
+ }
968
999
  ngOnDestroy() {
969
1000
  this._dbxMapboxChangeService?.emitMarkerDestroyed();
970
1001
  }
@@ -974,29 +1005,29 @@ DbxMapboxMarkerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0",
974
1005
  DbxMapboxMarkerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.12", type: DbxMapboxMarkerComponent, selector: "dbx-mapbox-marker", inputs: { marker: "marker" }, ngImport: i0, template: `
975
1006
  <mgl-marker [lngLat]="latLng">
976
1007
  <dbx-anchor [anchor]="anchor">
977
- <div class="dbx-mapbox-marker">
978
- <div class="dbx-mapbox-marker-content" [ngStyle]="style">
1008
+ <div class="dbx-mapbox-marker" [ngClass]="presentationClasses">
1009
+ <div class="dbx-mapbox-marker-icon-content" [ngStyle]="style">
979
1010
  <mat-icon *ngIf="icon">{{ icon }}</mat-icon>
980
1011
  </div>
981
1012
  <div class="dbx-mapbox-marker-label dbx-outlined-text" *ngIf="label">{{ label }}</div>
982
1013
  </div>
983
1014
  </dbx-anchor>
984
1015
  </mgl-marker>
985
- `, isInline: true, styles: [".dbx-mapbox-marker{display:flex;align-items:center;flex-direction:column}.dbx-mapbox-marker .dbx-mapbox-marker-content{display:flex;align-items:center;justify-content:center}.dbx-mapbox-marker .dbx-mapbox-marker-content mat-icon{width:100%;height:100%;font-size:inherit}.dbx-mapbox-marker .dbx-mapbox-marker-label{font-size:.9em}\n"], dependencies: [{ kind: "directive", type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2$1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "component", type: i5.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i4$1.DbxAnchorComponent, selector: "dbx-anchor, [dbx-anchor]", inputs: ["block"] }, { kind: "component", type: i1.MarkerComponent, selector: "mgl-marker", inputs: ["offset", "anchor", "clickTolerance", "feature", "lngLat", "draggable", "popupShown", "className", "pitchAlignment", "rotationAlignment"], outputs: ["markerDragStart", "markerDragEnd", "markerDrag", "dragStart", "dragEnd", "drag"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1016
+ `, isInline: true, styles: [".dbx-mapbox-marker{display:flex;align-items:center;flex-direction:column}.dbx-mapbox-marker .dbx-mapbox-marker-icon-content{display:flex;align-items:center;justify-content:center}.dbx-mapbox-marker .dbx-mapbox-marker-icon-content mat-icon{width:100%;height:100%;font-size:inherit}.dbx-mapbox-marker .dbx-mapbox-marker-label{font-size:.9em}.dbx-mapbox-marker.dbx-mapbox-marker-chip.dbx-chip{flex-direction:row;font-size:1em}.dbx-mapbox-marker.dbx-mapbox-marker-chip.dbx-chip .dbx-mapbox-marker-icon-content{width:18px;height:18px;font-size:18px}.dbx-mapbox-marker.dbx-mapbox-marker-chip.dbx-chip.dbx-chip-small .dbx-mapbox-marker-label{padding-left:3px}.dbx-mapbox-marker.dbx-mapbox-marker-chip.dbx-chip.dbx-chip-small .dbx-mapbox-marker-icon-content{padding:0!important;width:16px;height:16px;font-size:16px}.dbx-mapbox-marker.dbx-mapbox-marker-chip.dbx-chip .dbx-mapbox-marker-label{padding-left:4px}.dbx-mapbox-marker-no-icon>.dbx-mapbox-marker-icon-content{display:none}.dbx-mapbox-marker-no-icon>.dbx-mapbox-marker-icon-content .dbx-mapbox-marker-label{padding-left:0}\n"], dependencies: [{ kind: "directive", type: i2$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2$1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "component", type: i5.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i4$1.DbxAnchorComponent, selector: "dbx-anchor, [dbx-anchor]", inputs: ["block"] }, { kind: "component", type: i1.MarkerComponent, selector: "mgl-marker", inputs: ["offset", "anchor", "clickTolerance", "feature", "lngLat", "draggable", "popupShown", "className", "pitchAlignment", "rotationAlignment"], outputs: ["markerDragStart", "markerDragEnd", "markerDrag", "dragStart", "dragEnd", "drag"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
986
1017
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DbxMapboxMarkerComponent, decorators: [{
987
1018
  type: Component,
988
1019
  args: [{ selector: 'dbx-mapbox-marker', template: `
989
1020
  <mgl-marker [lngLat]="latLng">
990
1021
  <dbx-anchor [anchor]="anchor">
991
- <div class="dbx-mapbox-marker">
992
- <div class="dbx-mapbox-marker-content" [ngStyle]="style">
1022
+ <div class="dbx-mapbox-marker" [ngClass]="presentationClasses">
1023
+ <div class="dbx-mapbox-marker-icon-content" [ngStyle]="style">
993
1024
  <mat-icon *ngIf="icon">{{ icon }}</mat-icon>
994
1025
  </div>
995
1026
  <div class="dbx-mapbox-marker-label dbx-outlined-text" *ngIf="label">{{ label }}</div>
996
1027
  </div>
997
1028
  </dbx-anchor>
998
1029
  </mgl-marker>
999
- `, changeDetection: ChangeDetectionStrategy.OnPush, styles: [".dbx-mapbox-marker{display:flex;align-items:center;flex-direction:column}.dbx-mapbox-marker .dbx-mapbox-marker-content{display:flex;align-items:center;justify-content:center}.dbx-mapbox-marker .dbx-mapbox-marker-content mat-icon{width:100%;height:100%;font-size:inherit}.dbx-mapbox-marker .dbx-mapbox-marker-label{font-size:.9em}\n"] }]
1030
+ `, changeDetection: ChangeDetectionStrategy.OnPush, styles: [".dbx-mapbox-marker{display:flex;align-items:center;flex-direction:column}.dbx-mapbox-marker .dbx-mapbox-marker-icon-content{display:flex;align-items:center;justify-content:center}.dbx-mapbox-marker .dbx-mapbox-marker-icon-content mat-icon{width:100%;height:100%;font-size:inherit}.dbx-mapbox-marker .dbx-mapbox-marker-label{font-size:.9em}.dbx-mapbox-marker.dbx-mapbox-marker-chip.dbx-chip{flex-direction:row;font-size:1em}.dbx-mapbox-marker.dbx-mapbox-marker-chip.dbx-chip .dbx-mapbox-marker-icon-content{width:18px;height:18px;font-size:18px}.dbx-mapbox-marker.dbx-mapbox-marker-chip.dbx-chip.dbx-chip-small .dbx-mapbox-marker-label{padding-left:3px}.dbx-mapbox-marker.dbx-mapbox-marker-chip.dbx-chip.dbx-chip-small .dbx-mapbox-marker-icon-content{padding:0!important;width:16px;height:16px;font-size:16px}.dbx-mapbox-marker.dbx-mapbox-marker-chip.dbx-chip .dbx-mapbox-marker-label{padding-left:4px}.dbx-mapbox-marker-no-icon>.dbx-mapbox-marker-icon-content{display:none}.dbx-mapbox-marker-no-icon>.dbx-mapbox-marker-icon-content .dbx-mapbox-marker-label{padding-left:0}\n"] }]
1000
1031
  }], ctorParameters: function () { return [{ type: DbxMapboxChangeService, decorators: [{
1001
1032
  type: Optional
1002
1033
  }] }]; }, propDecorators: { marker: [{
@@ -1148,7 +1179,7 @@ function dbxMapboxColoredDotStyle(background, color) {
1148
1179
  return {
1149
1180
  background,
1150
1181
  padding: '2px',
1151
- color: color || 'white',
1182
+ color: color ?? background ? 'white' : undefined,
1152
1183
  'border-radius': '50%'
1153
1184
  };
1154
1185
  }