@vendure/admin-ui 1.4.5 → 1.4.6

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.
@@ -3506,9 +3506,11 @@
3506
3506
  { type: ServerConfigService }
3507
3507
  ]; };
3508
3508
 
3509
+ /** @dynamic */
3509
3510
  var I18nService = /** @class */ (function () {
3510
- function I18nService(ngxTranslate) {
3511
+ function I18nService(ngxTranslate, document) {
3511
3512
  this.ngxTranslate = ngxTranslate;
3513
+ this.document = document;
3512
3514
  this._availableLanguages = [];
3513
3515
  }
3514
3516
  Object.defineProperty(I18nService.prototype, "availableLanguages", {
@@ -3528,7 +3530,11 @@
3528
3530
  * Set the UI language
3529
3531
  */
3530
3532
  I18nService.prototype.setLanguage = function (language) {
3533
+ var _a;
3531
3534
  this.ngxTranslate.use(language);
3535
+ if ((_a = this.document) === null || _a === void 0 ? void 0 : _a.documentElement) {
3536
+ this.document.documentElement.lang = language;
3537
+ }
3532
3538
  };
3533
3539
  /**
3534
3540
  * Set the available UI languages
@@ -3544,14 +3550,15 @@
3544
3550
  };
3545
3551
  return I18nService;
3546
3552
  }());
3547
- I18nService.ɵprov = i0__namespace.ɵɵdefineInjectable({ factory: function I18nService_Factory() { return new I18nService(i0__namespace.ɵɵinject(i1__namespace$1.TranslateService)); }, token: I18nService, providedIn: "root" });
3553
+ I18nService.ɵprov = i0__namespace.ɵɵdefineInjectable({ factory: function I18nService_Factory() { return new I18nService(i0__namespace.ɵɵinject(i1__namespace$1.TranslateService), i0__namespace.ɵɵinject(i1__namespace.DOCUMENT)); }, token: I18nService, providedIn: "root" });
3548
3554
  I18nService.decorators = [
3549
3555
  { type: i0.Injectable, args: [{
3550
3556
  providedIn: 'root',
3551
3557
  },] }
3552
3558
  ];
3553
3559
  I18nService.ctorParameters = function () { return [
3554
- { type: i1$2.TranslateService }
3560
+ { type: i1$2.TranslateService },
3561
+ { type: Document, decorators: [{ type: i0.Inject, args: [i1.DOCUMENT,] }] }
3555
3562
  ]; };
3556
3563
 
3557
3564
  /**
@@ -5025,8 +5032,8 @@
5025
5032
  MainNavComponent.decorators = [
5026
5033
  { type: i0.Component, args: [{
5027
5034
  selector: 'vdr-main-nav',
5028
- template: "<nav class=\"sidenav\" [clr-nav-level]=\"2\">\r\n <section class=\"sidenav-content\">\r\n <ng-container *ngFor=\"let section of navBuilderService.navMenuConfig$ | async\">\r\n <section\r\n class=\"nav-group\"\r\n [attr.data-section-id]=\"section.id\"\r\n [class.collapsible]=\"section.collapsible\"\r\n *ngIf=\"shouldDisplayLink(section)\"\r\n >\r\n <vdr-ui-extension-point [locationId]=\"section.id\" api=\"navMenu\" [topPx]=\"-6\" [leftPx]=\"8\">\r\n <ng-container *ngIf=\"navBuilderService.sectionBadges[section.id] | async as sectionBadge\">\r\n <vdr-status-badge\r\n *ngIf=\"sectionBadge !== 'none'\"\r\n [type]=\"sectionBadge\"\r\n ></vdr-status-badge>\r\n </ng-container>\r\n <input [id]=\"section.id\" type=\"checkbox\" [checked]=\"section.collapsedByDefault\" />\r\n <label [for]=\"section.id\">{{ section.label | translate }}</label>\r\n <ul class=\"nav-list\">\r\n <ng-container *ngFor=\"let item of section.items\">\r\n <li *ngIf=\"shouldDisplayLink(item)\">\r\n <a\r\n class=\"nav-link\"\r\n [attr.data-item-id]=\"section.id\"\r\n [routerLink]=\"getRouterLink(item)\"\r\n routerLinkActive=\"active\"\r\n >\r\n <ng-container *ngIf=\"item.statusBadge | async as itemBadge\">\r\n <vdr-status-badge\r\n *ngIf=\"itemBadge.type !== 'none'\"\r\n [type]=\"itemBadge.type\"\r\n ></vdr-status-badge>\r\n </ng-container>\r\n <clr-icon [attr.shape]=\"item.icon || 'block'\" size=\"20\"></clr-icon>\r\n {{ item.label | translate }}\r\n </a>\r\n </li>\r\n </ng-container>\r\n </ul>\r\n </vdr-ui-extension-point>\r\n </section>\r\n </ng-container>\r\n </section>\r\n</nav>\r\n",
5029
- styles: [":host{order:-1;background-color:var(--clr-nav-background-color)}nav.sidenav{height:100%;width:10.8rem;border-right-color:var(--clr-sidenav-border-color)}.nav-list clr-icon{margin-right:12px}.nav-group,.nav-link{position:relative}.nav-group vdr-status-badge{left:10px;top:6px}.nav-link vdr-status-badge{left:25px;top:3px}\n"]
5035
+ template: "<nav class=\"sidenav\" [clr-nav-level]=\"2\">\r\n <section class=\"sidenav-content\">\r\n <ng-container *ngFor=\"let section of navBuilderService.navMenuConfig$ | async\">\r\n <section\r\n class=\"nav-group\"\r\n [attr.data-section-id]=\"section.id\"\r\n [class.collapsible]=\"section.collapsible\"\r\n *ngIf=\"shouldDisplayLink(section)\"\r\n >\r\n <vdr-ui-extension-point [locationId]=\"section.id\" api=\"navMenu\" [topPx]=\"-6\" [leftPx]=\"8\">\r\n <ng-container *ngIf=\"navBuilderService.sectionBadges[section.id] | async as sectionBadge\">\r\n <vdr-status-badge\r\n *ngIf=\"sectionBadge !== 'none'\"\r\n [type]=\"sectionBadge\"\r\n ></vdr-status-badge>\r\n </ng-container>\r\n <input [id]=\"section.id\" type=\"checkbox\" [checked]=\"section.collapsedByDefault\" />\r\n <label class=\"nav-group-header\" [for]=\"section.id\">{{ section.label | translate }}</label>\r\n <ul class=\"nav-list\">\r\n <ng-container *ngFor=\"let item of section.items\">\r\n <li *ngIf=\"shouldDisplayLink(item)\">\r\n <a\r\n class=\"nav-link\"\r\n [attr.data-item-id]=\"section.id\"\r\n [routerLink]=\"getRouterLink(item)\"\r\n routerLinkActive=\"active\"\r\n >\r\n <ng-container *ngIf=\"item.statusBadge | async as itemBadge\">\r\n <vdr-status-badge\r\n *ngIf=\"itemBadge.type !== 'none'\"\r\n [type]=\"itemBadge.type\"\r\n ></vdr-status-badge>\r\n </ng-container>\r\n <clr-icon [attr.shape]=\"item.icon || 'block'\" size=\"20\"></clr-icon>\r\n {{ item.label | translate }}\r\n </a>\r\n </li>\r\n </ng-container>\r\n </ul>\r\n </vdr-ui-extension-point>\r\n </section>\r\n </ng-container>\r\n </section>\r\n</nav>\r\n",
5036
+ styles: [":host{order:-1;background-color:var(--clr-nav-background-color)}nav.sidenav{height:100%;width:10.8rem;border-right-color:var(--clr-sidenav-border-color)}.sidenav .nav-group .nav-list{margin:0}.sidenav .nav-group .nav-group-header{margin:0;line-height:1.2}.sidenav .nav-group .nav-link{display:inline-flex;line-height:1rem;padding-right:.6rem}.nav-list clr-icon{flex-shrink:0;margin-right:12px}.nav-group{-webkit-hyphens:auto;hyphens:auto}.nav-group,.nav-link{position:relative}.nav-group vdr-status-badge{left:10px;top:6px}.nav-link vdr-status-badge{left:25px;top:3px}\n"]
5030
5037
  },] }
5031
5038
  ];
5032
5039
  MainNavComponent.ctorParameters = function () { return [
@@ -11106,7 +11113,7 @@
11106
11113
  };
11107
11114
  ProsemirrorService.prototype.getStateFromText = function (text) {
11108
11115
  var div = document.createElement('div');
11109
- div.innerHTML = text;
11116
+ div.innerHTML = text !== null && text !== void 0 ? text : '';
11110
11117
  return prosemirrorState.EditorState.create({
11111
11118
  doc: prosemirrorModel.DOMParser.fromSchema(this.mySchema).parse(div),
11112
11119
  plugins: this.configurePlugins({ schema: this.mySchema, floatingMenu: false }),
@@ -12468,7 +12475,7 @@
12468
12475
  if (!asset) {
12469
12476
  return '';
12470
12477
  }
12471
- if (!asset.preview || typeof asset.preview !== 'string') {
12478
+ if (asset.preview == null || typeof asset.preview !== 'string') {
12472
12479
  throw new Error("Expected an Asset, got " + JSON.stringify(asset));
12473
12480
  }
12474
12481
  var fp = asset.focalPoint ? "&fpx=" + asset.focalPoint.x + "&fpy=" + asset.focalPoint.y : '';
@@ -13619,8 +13626,8 @@
13619
13626
  this.availableLanguages$ = this.serverConfigService.getAvailableLanguages();
13620
13627
  rxjs.combineLatest(this.entity$, this.languageCode$)
13621
13628
  .pipe(operators.takeUntil(this.destroy$))
13622
- .subscribe(function (_c) {
13623
- var _d = __read(_c, 2), entity = _d[0], languageCode = _d[1];
13629
+ .subscribe(function (_d) {
13630
+ var _e = __read(_d, 2), entity = _e[0], languageCode = _e[1];
13624
13631
  _this.setFormValues(entity, languageCode);
13625
13632
  _this.detailForm.markAsPristine();
13626
13633
  });
@@ -13637,15 +13644,15 @@
13637
13644
  return this.detailForm && this.detailForm.pristine;
13638
13645
  };
13639
13646
  BaseDetailComponent.prototype.setCustomFieldFormValues = function (customFields, formGroup, entity, currentTranslation) {
13640
- var e_1, _c;
13641
- var _a, _b;
13647
+ var e_1, _d;
13648
+ var _a, _b, _c;
13642
13649
  try {
13643
13650
  for (var customFields_1 = __values(customFields), customFields_1_1 = customFields_1.next(); !customFields_1_1.done; customFields_1_1 = customFields_1.next()) {
13644
13651
  var fieldDef = customFields_1_1.value;
13645
13652
  var key = fieldDef.name;
13646
13653
  var value = fieldDef.type === 'localeString'
13647
- ? (_a = currentTranslation.customFields) === null || _a === void 0 ? void 0 : _a[key]
13648
- : (_b = entity.customFields) === null || _b === void 0 ? void 0 : _b[key];
13654
+ ? (_b = (_a = currentTranslation) === null || _a === void 0 ? void 0 : _a.customFields) === null || _b === void 0 ? void 0 : _b[key]
13655
+ : (_c = entity.customFields) === null || _c === void 0 ? void 0 : _c[key];
13649
13656
  var control = formGroup === null || formGroup === void 0 ? void 0 : formGroup.get(key);
13650
13657
  if (control) {
13651
13658
  control.patchValue(value);
@@ -13655,7 +13662,7 @@
13655
13662
  catch (e_1_1) { e_1 = { error: e_1_1 }; }
13656
13663
  finally {
13657
13664
  try {
13658
- if (customFields_1_1 && !customFields_1_1.done && (_c = customFields_1.return)) _c.call(customFields_1);
13665
+ if (customFields_1_1 && !customFields_1_1.done && (_d = customFields_1.return)) _d.call(customFields_1);
13659
13666
  }
13660
13667
  finally { if (e_1) throw e_1.error; }
13661
13668
  }
@@ -13664,10 +13671,10 @@
13664
13671
  return this.serverConfigService.getCustomFieldsFor(key);
13665
13672
  };
13666
13673
  BaseDetailComponent.prototype.setQueryParam = function (key, value) {
13667
- var _c;
13674
+ var _d;
13668
13675
  this.router.navigate([
13669
13676
  './',
13670
- Object.assign(Object.assign({}, this.route.snapshot.params), (_c = {}, _c[key] = value, _c)),
13677
+ Object.assign(Object.assign({}, this.route.snapshot.params), (_d = {}, _d[key] = value, _d)),
13671
13678
  ], {
13672
13679
  relativeTo: this.route,
13673
13680
  queryParamsHandling: 'merge',
@@ -14005,7 +14012,7 @@
14005
14012
  }
14006
14013
 
14007
14014
  // Auto-generated by the set-version.js script.
14008
- var ADMIN_UI_VERSION = '1.4.5';
14015
+ var ADMIN_UI_VERSION = '1.4.6';
14009
14016
 
14010
14017
  /**
14011
14018
  * Responsible for registering dashboard widget components and querying for layouts.