@dereekb/dbx-web 9.20.0 → 9.20.2

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.
Files changed (30) hide show
  1. package/calendar/package.json +2 -2
  2. package/esm2020/lib/extension/model/model.tracker.mjs +1 -1
  3. package/esm2020/lib/extension/model/model.tracker.service.mjs +6 -3
  4. package/esm2020/lib/extension/model/model.tracker.view.storage.mjs +10 -2
  5. package/esm2020/lib/extension/model/model.types.mjs +1 -1
  6. package/esm2020/lib/extension/model/model.types.service.mjs +9 -9
  7. package/esm2020/lib/extension/model/state/actions/model.actions.mjs +1 -1
  8. package/esm2020/lib/extension/model/state/effects/tracker.effects.mjs +3 -3
  9. package/esm2020/lib/layout/list/list.view.value.component.mjs +3 -3
  10. package/esm2020/lib/layout/list/list.view.value.selection.component.mjs +3 -3
  11. package/esm2020/lib/layout/section/section.component.mjs +1 -1
  12. package/esm2020/lib/layout/section/section.header.component.mjs +7 -4
  13. package/esm2020/lib/layout/section/section.page.component.mjs +1 -1
  14. package/esm2020/lib/layout/section/subsection.component.mjs +1 -1
  15. package/fesm2015/dereekb-dbx-web.mjs +36 -21
  16. package/fesm2015/dereekb-dbx-web.mjs.map +1 -1
  17. package/fesm2020/dereekb-dbx-web.mjs +35 -20
  18. package/fesm2020/dereekb-dbx-web.mjs.map +1 -1
  19. package/lib/extension/model/model.tracker.d.ts +16 -2
  20. package/lib/extension/model/model.tracker.service.d.ts +1 -1
  21. package/lib/extension/model/model.tracker.view.storage.d.ts +5 -1
  22. package/lib/extension/model/model.types.d.ts +16 -2
  23. package/lib/extension/model/model.types.service.d.ts +4 -5
  24. package/lib/extension/model/state/actions/model.actions.d.ts +1 -0
  25. package/lib/layout/list/_list.scss +6 -0
  26. package/lib/layout/section/_section.scss +4 -0
  27. package/lib/layout/section/section.header.component.d.ts +2 -1
  28. package/lib/layout/text/_text.scss +14 -1
  29. package/mapbox/package.json +3 -3
  30. package/package.json +3 -3
@@ -5906,7 +5906,7 @@ DbxValueListItemViewComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "1
5906
5906
  <dbx-anchor *ngFor="let item of items; trackBy: trackByFunction" [anchor]="item.anchor" [disabled]="item.disabled">
5907
5907
  <a mat-list-item class="dbx-list-view-item" [disabled]="item.disabled" [disableRipple]="rippleDisabledOnItem(item)" (click)="onClickItem(item)">
5908
5908
  <mat-icon matListIcon *ngIf="item.icon">{{ item.icon }}</mat-icon>
5909
- <div dbx-injection [config]="item.config"></div>
5909
+ <dbx-injection [config]="item.config"></dbx-injection>
5910
5910
  </a>
5911
5911
  </dbx-anchor>
5912
5912
  </mat-nav-list>
@@ -5920,7 +5920,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImpo
5920
5920
  <dbx-anchor *ngFor="let item of items; trackBy: trackByFunction" [anchor]="item.anchor" [disabled]="item.disabled">
5921
5921
  <a mat-list-item class="dbx-list-view-item" [disabled]="item.disabled" [disableRipple]="rippleDisabledOnItem(item)" (click)="onClickItem(item)">
5922
5922
  <mat-icon matListIcon *ngIf="item.icon">{{ item.icon }}</mat-icon>
5923
- <div dbx-injection [config]="item.config"></div>
5923
+ <dbx-injection [config]="item.config"></dbx-injection>
5924
5924
  </a>
5925
5925
  </dbx-anchor>
5926
5926
  </mat-nav-list>
@@ -5991,7 +5991,7 @@ DbxSelectionValueListItemViewComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVe
5991
5991
  <mat-selection-list [disabled]="disabled$ | async" [multiple]="multiple" (selectionChange)="matSelectionChanged($event)">
5992
5992
  <mat-list-option class="dbx-list-view-item" *ngFor="let item of items; trackBy: trackByFunction" [selected]="item.selected" [disabled]="item.disabled" [value]="item.itemValue" (click)="onClickValue(item.itemValue)">
5993
5993
  <mat-icon matListIcon *ngIf="item.icon">{{ item.icon }}</mat-icon>
5994
- <div dbx-injection [config]="item.config"></div>
5994
+ <dbx-injection [config]="item.config"></dbx-injection>
5995
5995
  </mat-list-option>
5996
5996
  </mat-selection-list>
5997
5997
  </ng-container>
@@ -6010,7 +6010,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImpo
6010
6010
  <mat-selection-list [disabled]="disabled$ | async" [multiple]="multiple" (selectionChange)="matSelectionChanged($event)">
6011
6011
  <mat-list-option class="dbx-list-view-item" *ngFor="let item of items; trackBy: trackByFunction" [selected]="item.selected" [disabled]="item.disabled" [value]="item.itemValue" (click)="onClickValue(item.itemValue)">
6012
6012
  <mat-icon matListIcon *ngIf="item.icon">{{ item.icon }}</mat-icon>
6013
- <div dbx-injection [config]="item.config"></div>
6013
+ <dbx-injection [config]="item.config"></dbx-injection>
6014
6014
  </mat-list-option>
6015
6015
  </mat-selection-list>
6016
6016
  </ng-container>
@@ -6459,7 +6459,7 @@ class DbxSectionHeaderComponent {
6459
6459
  }
6460
6460
  }
6461
6461
  DbxSectionHeaderComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DbxSectionHeaderComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
6462
- DbxSectionHeaderComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.12", type: DbxSectionHeaderComponent, selector: "dbx-section-header,.dbx-section-header", inputs: { h: "h", header: "header", onlyHeader: "onlyHeader", icon: "icon", hint: "hint", hintInline: "hintInline", headerConfig: "headerConfig" }, host: { properties: { "class.dbx-section-header-full-title": "onlyHeader" } }, ngImport: i0, template: `
6462
+ DbxSectionHeaderComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.12", type: DbxSectionHeaderComponent, selector: "dbx-section-header,.dbx-section-header", inputs: { paddedHeader: "paddedHeader", h: "h", header: "header", onlyHeader: "onlyHeader", icon: "icon", hint: "hint", hintInline: "hintInline", headerConfig: "headerConfig" }, host: { properties: { "class.dbx-section-header-full-title": "onlyHeader", "class.dbx-section-header-padded": "paddedHeader" } }, ngImport: i0, template: `
6463
6463
  <div class="dbx-section-header-content">
6464
6464
  <ng-container *ngIf="showTitle">
6465
6465
  <ng-container [ngSwitch]="h ?? 1">
@@ -6530,10 +6530,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImpo
6530
6530
  </ng-template>
6531
6531
  `,
6532
6532
  host: {
6533
- '[class.dbx-section-header-full-title]': 'onlyHeader'
6533
+ '[class.dbx-section-header-full-title]': 'onlyHeader',
6534
+ '[class.dbx-section-header-padded]': 'paddedHeader'
6534
6535
  }
6535
6536
  }]
6536
- }], ctorParameters: function () { return []; }, propDecorators: { h: [{
6537
+ }], ctorParameters: function () { return []; }, propDecorators: { paddedHeader: [{
6538
+ type: Input
6539
+ }], h: [{
6537
6540
  type: Input
6538
6541
  }], header: [{
6539
6542
  type: Input
@@ -6566,7 +6569,7 @@ DbxSectionComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", ve
6566
6569
  <div class="dbx-section-content">
6567
6570
  <ng-content></ng-content>
6568
6571
  </div>
6569
- `, isInline: true, dependencies: [{ kind: "component", type: DbxSectionHeaderComponent, selector: "dbx-section-header,.dbx-section-header", inputs: ["h", "header", "onlyHeader", "icon", "hint", "hintInline", "headerConfig"] }] });
6572
+ `, isInline: true, dependencies: [{ kind: "component", type: DbxSectionHeaderComponent, selector: "dbx-section-header,.dbx-section-header", inputs: ["paddedHeader", "h", "header", "onlyHeader", "icon", "hint", "hintInline", "headerConfig"] }] });
6570
6573
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DbxSectionComponent, decorators: [{
6571
6574
  type: Component,
6572
6575
  args: [{
@@ -6664,7 +6667,7 @@ DbxSubSectionComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0",
6664
6667
  <ng-content></ng-content>
6665
6668
  </div>
6666
6669
  </div>
6667
- `, isInline: true, dependencies: [{ kind: "component", type: DbxSectionHeaderComponent, selector: "dbx-section-header,.dbx-section-header", inputs: ["h", "header", "onlyHeader", "icon", "hint", "hintInline", "headerConfig"] }] });
6670
+ `, isInline: true, dependencies: [{ kind: "component", type: DbxSectionHeaderComponent, selector: "dbx-section-header,.dbx-section-header", inputs: ["paddedHeader", "h", "header", "onlyHeader", "icon", "hint", "hintInline", "headerConfig"] }] });
6668
6671
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DbxSubSectionComponent, decorators: [{
6669
6672
  type: Component,
6670
6673
  args: [{
@@ -6704,7 +6707,7 @@ DbxSectionPageComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0"
6704
6707
  <div class="dbx-section-page-content">
6705
6708
  <ng-content></ng-content>
6706
6709
  </div>
6707
- `, isInline: true, dependencies: [{ kind: "component", type: DbxSectionHeaderComponent, selector: "dbx-section-header,.dbx-section-header", inputs: ["h", "header", "onlyHeader", "icon", "hint", "hintInline", "headerConfig"] }] });
6710
+ `, isInline: true, dependencies: [{ kind: "component", type: DbxSectionHeaderComponent, selector: "dbx-section-header,.dbx-section-header", inputs: ["paddedHeader", "h", "header", "onlyHeader", "icon", "hint", "hintInline", "headerConfig"] }] });
6708
6711
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DbxSectionPageComponent, decorators: [{
6709
6712
  type: Component,
6710
6713
  args: [{
@@ -7891,12 +7894,13 @@ class DbxModelViewTrackerStorage {
7891
7894
  get maxEventsToKeep() {
7892
7895
  return DbxModelViewTrackerStorage.MAX_EVENTS;
7893
7896
  }
7894
- addEvent(event) {
7897
+ addTrackerEvent(event) {
7895
7898
  const storageKey = this.getStorageKeyForFolder(event.folder);
7896
7899
  return this._getEventSetForStorageKey(storageKey).pipe(mergeMap$1((set) => {
7897
7900
  var _a, _b;
7898
7901
  const nextEvent = {
7899
7902
  d: (_a = event.d) !== null && _a !== void 0 ? _a : unixTimeNumberForNow(),
7903
+ c: event.c,
7900
7904
  m: event.m
7901
7905
  };
7902
7906
  const e = ModelRelationUtility.removeDuplicates(set.e, (x) => encodeModelKeyTypePair(x.m), [encodeModelKeyTypePair(nextEvent.m)]);
@@ -7924,6 +7928,13 @@ class DbxModelViewTrackerStorage {
7924
7928
  const storageKey = `${this.storageKey}_${folder !== null && folder !== void 0 ? folder : 'default'}`;
7925
7929
  return storageKey;
7926
7930
  }
7931
+ // MARK: Compat
7932
+ /**
7933
+ * @deprecated use addTrackerEvent() instead.
7934
+ */
7935
+ addEvent(event) {
7936
+ return this.addTrackerEvent(event);
7937
+ }
7927
7938
  }
7928
7939
  DbxModelViewTrackerStorage.OBJECT_VIEW_TRACKER_STORAGE_LIST_KEY = 'dbxModelViewTrackerEvents';
7929
7940
  DbxModelViewTrackerStorage.MAX_EVENTS = 60;
@@ -7950,12 +7961,14 @@ class DbxModelTrackerService {
7950
7961
  this._defaultFolder = folder !== null && folder !== void 0 ? folder : undefined;
7951
7962
  }
7952
7963
  // MARK: View
7953
- trackViewedObject(modelKeyTypeNamePair, folder = this._defaultFolder) {
7964
+ trackViewedObject(modelKeyTypeNamePair, context, folder = this._defaultFolder) {
7954
7965
  this.viewTrackerStorage
7955
- .addEvent({
7966
+ .addTrackerEvent({
7956
7967
  m: modelKeyTypeNamePair,
7968
+ c: context,
7957
7969
  folder
7958
7970
  })
7971
+ .pipe(first())
7959
7972
  .subscribe();
7960
7973
  }
7961
7974
  getAllViewEvents(folder = this._defaultFolder) {
@@ -7981,8 +7994,8 @@ class DbxModelTrackerEffects {
7981
7994
  constructor(actions$, dbxModelTrackerService) {
7982
7995
  this.actions$ = actions$;
7983
7996
  this.dbxModelTrackerService = dbxModelTrackerService;
7984
- this.trackModelViewed$ = createEffect(() => this.actions$.pipe(ofType(emitObjectViewEvent), distinctUntilChanged$1((a, b) => (a === null || a === void 0 ? void 0 : a.modelKeyTypeNamePair.key) === (b === null || b === void 0 ? void 0 : b.modelKeyTypeNamePair.key) && (a === null || a === void 0 ? void 0 : a.type) === (b === null || b === void 0 ? void 0 : b.type)), tap$1((x) => {
7985
- this.dbxModelTrackerService.trackViewedObject(x.modelKeyTypeNamePair);
7997
+ this.trackModelViewed$ = createEffect(() => this.actions$.pipe(ofType(emitObjectViewEvent), distinctUntilChanged$1((a, b) => (a === null || a === void 0 ? void 0 : a.modelKeyTypeNamePair.key) === (b === null || b === void 0 ? void 0 : b.modelKeyTypeNamePair.key) && (a === null || a === void 0 ? void 0 : a.type) === (b === null || b === void 0 ? void 0 : b.type) && (a === null || a === void 0 ? void 0 : a.context) === (b === null || b === void 0 ? void 0 : b.context)), tap$1((x) => {
7998
+ this.dbxModelTrackerService.trackViewedObject(x.modelKeyTypeNamePair, x.context);
7986
7999
  })), { dispatch: false });
7987
8000
  this.changeTrackerFolderToMatchAuth$ = createEffect(() => this.actions$.pipe(ofType(onDbxAppAuth.DbxAppAuthUserActions.setUserIdentifier), map$1((x) => x.id), filter$1((x) => Boolean(x)), distinctUntilChanged$1(), tap$1((accountId) => {
7988
8001
  this.dbxModelTrackerService.defaultFolder = accountId;
@@ -8078,8 +8091,8 @@ function allDbxModelViewTrackerEventModelKeys(events) {
8078
8091
  }
8079
8092
 
8080
8093
  class DbxModelTypesService {
8081
- constructor(store) {
8082
- this.store = store;
8094
+ constructor(injector) {
8095
+ this.injector = injector;
8083
8096
  this._configs = new BehaviorSubject({});
8084
8097
  // MARK: Accessors
8085
8098
  this.typesMap$ = this._configs.pipe(map$1((types) => {
@@ -8089,8 +8102,10 @@ class DbxModelTypesService {
8089
8102
  const config = types[type];
8090
8103
  const label = config.label || capitalCase(type);
8091
8104
  const analyticsName = config.analyticsName || label;
8092
- typesMap[type] = Object.assign(Object.assign({}, config), { label,
8093
- analyticsName, icon: (_a = config.icon) !== null && _a !== void 0 ? _a : DbxModelTypesService.DEFAULT_ICON, canSegueToView: Boolean(config.sref) });
8105
+ const sref = config.srefBuilder ? config.srefBuilder(this.injector) : config.sref;
8106
+ typesMap[type] = Object.assign(Object.assign({}, config), { sref,
8107
+ label,
8108
+ analyticsName, icon: (_a = config.icon) !== null && _a !== void 0 ? _a : DbxModelTypesService.DEFAULT_ICON, canSegueToView: Boolean(sref) });
8094
8109
  });
8095
8110
  return typesMap;
8096
8111
  }), shareReplay$1(1));
@@ -8119,14 +8134,14 @@ class DbxModelTypesService {
8119
8134
  }
8120
8135
  }
8121
8136
  DbxModelTypesService.DEFAULT_ICON = 'help_outline';
8122
- DbxModelTypesService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DbxModelTypesService, deps: [{ token: i1$b.Store }], target: i0.ɵɵFactoryTarget.Injectable });
8137
+ DbxModelTypesService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DbxModelTypesService, deps: [{ token: i0.Injector }], target: i0.ɵɵFactoryTarget.Injectable });
8123
8138
  DbxModelTypesService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DbxModelTypesService, providedIn: 'root' });
8124
8139
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DbxModelTypesService, decorators: [{
8125
8140
  type: Injectable,
8126
8141
  args: [{
8127
8142
  providedIn: 'root'
8128
8143
  }]
8129
- }], ctorParameters: function () { return [{ type: i1$b.Store }]; } });
8144
+ }], ctorParameters: function () { return [{ type: i0.Injector }]; } });
8130
8145
 
8131
8146
  /**
8132
8147
  * Service used to register widgets.