@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.
@@ -5769,9 +5769,11 @@ AuthService.ctorParameters = () => [
5769
5769
  { type: ServerConfigService }
5770
5770
  ];
5771
5771
 
5772
+ /** @dynamic */
5772
5773
  class I18nService {
5773
- constructor(ngxTranslate) {
5774
+ constructor(ngxTranslate, document) {
5774
5775
  this.ngxTranslate = ngxTranslate;
5776
+ this.document = document;
5775
5777
  this._availableLanguages = [];
5776
5778
  }
5777
5779
  get availableLanguages() {
@@ -5787,7 +5789,11 @@ class I18nService {
5787
5789
  * Set the UI language
5788
5790
  */
5789
5791
  setLanguage(language) {
5792
+ var _a;
5790
5793
  this.ngxTranslate.use(language);
5794
+ if ((_a = this.document) === null || _a === void 0 ? void 0 : _a.documentElement) {
5795
+ this.document.documentElement.lang = language;
5796
+ }
5791
5797
  }
5792
5798
  /**
5793
5799
  * Set the available UI languages
@@ -5802,14 +5808,15 @@ class I18nService {
5802
5808
  return this.ngxTranslate.instant(key, params);
5803
5809
  }
5804
5810
  }
5805
- I18nService.ɵprov = i0.ɵɵdefineInjectable({ factory: function I18nService_Factory() { return new I18nService(i0.ɵɵinject(i1$1.TranslateService)); }, token: I18nService, providedIn: "root" });
5811
+ I18nService.ɵprov = i0.ɵɵdefineInjectable({ factory: function I18nService_Factory() { return new I18nService(i0.ɵɵinject(i1$1.TranslateService), i0.ɵɵinject(i1.DOCUMENT)); }, token: I18nService, providedIn: "root" });
5806
5812
  I18nService.decorators = [
5807
5813
  { type: Injectable, args: [{
5808
5814
  providedIn: 'root',
5809
5815
  },] }
5810
5816
  ];
5811
5817
  I18nService.ctorParameters = () => [
5812
- { type: TranslateService }
5818
+ { type: TranslateService },
5819
+ { type: Document, decorators: [{ type: Inject, args: [DOCUMENT,] }] }
5813
5820
  ];
5814
5821
 
5815
5822
  /**
@@ -7188,8 +7195,8 @@ class MainNavComponent {
7188
7195
  MainNavComponent.decorators = [
7189
7196
  { type: Component, args: [{
7190
7197
  selector: 'vdr-main-nav',
7191
- 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",
7192
- 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"]
7198
+ 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",
7199
+ 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"]
7193
7200
  },] }
7194
7201
  ];
7195
7202
  MainNavComponent.ctorParameters = () => [
@@ -12856,7 +12863,7 @@ class ProsemirrorService {
12856
12863
  }
12857
12864
  getStateFromText(text) {
12858
12865
  const div = document.createElement('div');
12859
- div.innerHTML = text;
12866
+ div.innerHTML = text !== null && text !== void 0 ? text : '';
12860
12867
  return EditorState.create({
12861
12868
  doc: DOMParser.fromSchema(this.mySchema).parse(div),
12862
12869
  plugins: this.configurePlugins({ schema: this.mySchema, floatingMenu: false }),
@@ -14088,7 +14095,7 @@ class AssetPreviewPipe {
14088
14095
  if (!asset) {
14089
14096
  return '';
14090
14097
  }
14091
- if (!asset.preview || typeof asset.preview !== 'string') {
14098
+ if (asset.preview == null || typeof asset.preview !== 'string') {
14092
14099
  throw new Error(`Expected an Asset, got ${JSON.stringify(asset)}`);
14093
14100
  }
14094
14101
  const fp = asset.focalPoint ? `&fpx=${asset.focalPoint.x}&fpy=${asset.focalPoint.y}` : '';
@@ -15174,12 +15181,12 @@ class BaseDetailComponent {
15174
15181
  return this.detailForm && this.detailForm.pristine;
15175
15182
  }
15176
15183
  setCustomFieldFormValues(customFields, formGroup, entity, currentTranslation) {
15177
- var _a, _b;
15184
+ var _a, _b, _c;
15178
15185
  for (const fieldDef of customFields) {
15179
15186
  const key = fieldDef.name;
15180
15187
  const value = fieldDef.type === 'localeString'
15181
- ? (_a = currentTranslation.customFields) === null || _a === void 0 ? void 0 : _a[key]
15182
- : (_b = entity.customFields) === null || _b === void 0 ? void 0 : _b[key];
15188
+ ? (_b = (_a = currentTranslation) === null || _a === void 0 ? void 0 : _a.customFields) === null || _b === void 0 ? void 0 : _b[key]
15189
+ : (_c = entity.customFields) === null || _c === void 0 ? void 0 : _c[key];
15183
15190
  const control = formGroup === null || formGroup === void 0 ? void 0 : formGroup.get(key);
15184
15191
  if (control) {
15185
15192
  control.patchValue(value);
@@ -15513,7 +15520,7 @@ function patchObject(obj, patch) {
15513
15520
  }
15514
15521
 
15515
15522
  // Auto-generated by the set-version.js script.
15516
- const ADMIN_UI_VERSION = '1.4.5';
15523
+ const ADMIN_UI_VERSION = '1.4.6';
15517
15524
 
15518
15525
  /**
15519
15526
  * Responsible for registering dashboard widget components and querying for layouts.