@vendure/admin-ui 2.1.4 → 2.2.0-next.0
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.
- package/catalog/components/product-list/product-list.component.d.ts +1 -1
- package/catalog/components/product-variant-list/product-variant-list.component.d.ts +1 -1
- package/core/common/utilities/custom-field-default-value.d.ts +1 -1
- package/core/common/version.d.ts +1 -1
- package/core/components/app-shell/app-shell.component.d.ts +1 -0
- package/core/components/ui-language-switcher-dialog/ui-language-switcher-dialog.component.d.ts +9 -3
- package/core/core.module.d.ts +1 -1
- package/core/providers/i18n/i18n.service.d.ts +6 -0
- package/core/shared/components/order-state-label/order-state-label.component.d.ts +1 -1
- package/core/shared/dynamic-form-inputs/default-form-inputs.d.ts +1 -1
- package/esm2022/core/common/utilities/configurable-operation-utils.mjs +1 -1
- package/esm2022/core/common/version.mjs +2 -2
- package/esm2022/core/components/app-shell/app-shell.component.mjs +15 -10
- package/esm2022/core/components/ui-language-switcher-dialog/ui-language-switcher-dialog.component.mjs +42 -273
- package/esm2022/core/core.module.mjs +13 -5
- package/esm2022/core/providers/i18n/i18n.service.mjs +11 -1
- package/esm2022/core/providers/localization/localization.service.mjs +4 -4
- package/esm2022/core/shared/components/asset-preview/asset-preview.component.mjs +3 -3
- package/esm2022/core/shared/components/configurable-input/configurable-input.component.mjs +1 -1
- package/esm2022/core/shared/components/datetime-picker/datetime-picker.service.mjs +1 -1
- package/esm2022/marketing/components/promotion-detail/promotion-detail.component.mjs +8 -8
- package/esm2022/react/react-hooks/use-query.mjs +61 -1
- package/esm2022/settings/components/payment-method-detail/payment-method-detail.component.mjs +8 -8
- package/fesm2022/vendure-admin-ui-core.mjs +66 -276
- package/fesm2022/vendure-admin-ui-core.mjs.map +1 -1
- package/fesm2022/vendure-admin-ui-marketing.mjs +7 -7
- package/fesm2022/vendure-admin-ui-marketing.mjs.map +1 -1
- package/fesm2022/vendure-admin-ui-react.mjs +61 -1
- package/fesm2022/vendure-admin-ui-react.mjs.map +1 -1
- package/fesm2022/vendure-admin-ui-settings.mjs +7 -7
- package/fesm2022/vendure-admin-ui-settings.mjs.map +1 -1
- package/package.json +14 -14
- package/react/react-hooks/use-query.d.ts +59 -0
- package/settings/components/stock-location-list/stock-location-list.component.d.ts +1 -1
- package/static/i18n-messages/fa.json +1 -1
- package/static/vendure-ui-config.json +260 -5
|
@@ -6,7 +6,7 @@ import { concatMap, bufferCount, map, filter, distinctUntilChanged, skip, takeUn
|
|
|
6
6
|
import * as i1 from 'apollo-angular';
|
|
7
7
|
import { gql, ApolloModule, APOLLO_OPTIONS } from 'apollo-angular';
|
|
8
8
|
import { pick } from '@vendure/common/lib/pick';
|
|
9
|
-
import { from, Subject, merge, lastValueFrom, BehaviorSubject, interval, combineLatest, isObservable, switchMap as switchMap$1, of, map as map$1, Observable, timer, EMPTY, concat, forkJoin, fromEvent } from 'rxjs';
|
|
9
|
+
import { from, Subject, merge, lastValueFrom, BehaviorSubject, interval, combineLatest, isObservable, switchMap as switchMap$1, of, map as map$1, take as take$1, takeUntil as takeUntil$1, finalize as finalize$1, Observable, timer, EMPTY, concat, forkJoin, fromEvent } from 'rxjs';
|
|
10
10
|
import { simpleDeepClone } from '@vendure/common/lib/simple-deep-clone';
|
|
11
11
|
import { NetworkStatus, ApolloLink, InMemoryCache } from '@apollo/client/core';
|
|
12
12
|
import { notNullOrUndefined, getGraphQlInputName, assertNever } from '@vendure/common/lib/shared-utils';
|
|
@@ -6820,9 +6820,13 @@ class I18nService {
|
|
|
6820
6820
|
get availableLanguages() {
|
|
6821
6821
|
return [...this._availableLanguages];
|
|
6822
6822
|
}
|
|
6823
|
+
get availableLocales() {
|
|
6824
|
+
return [...this._availableLocales];
|
|
6825
|
+
}
|
|
6823
6826
|
constructor(ngxTranslate, document) {
|
|
6824
6827
|
this.ngxTranslate = ngxTranslate;
|
|
6825
6828
|
this.document = document;
|
|
6829
|
+
this._availableLocales = [];
|
|
6826
6830
|
this._availableLanguages = [];
|
|
6827
6831
|
}
|
|
6828
6832
|
/**
|
|
@@ -6846,6 +6850,12 @@ class I18nService {
|
|
|
6846
6850
|
setAvailableLanguages(languages) {
|
|
6847
6851
|
this._availableLanguages = languages;
|
|
6848
6852
|
}
|
|
6853
|
+
/**
|
|
6854
|
+
* Set the available UI locales
|
|
6855
|
+
*/
|
|
6856
|
+
setAvailableLocales(locales) {
|
|
6857
|
+
this._availableLocales = locales;
|
|
6858
|
+
}
|
|
6849
6859
|
/**
|
|
6850
6860
|
* Translate the given key.
|
|
6851
6861
|
*/
|
|
@@ -6887,9 +6897,9 @@ class LocalizationService {
|
|
|
6887
6897
|
constructor(i18nService, dataService) {
|
|
6888
6898
|
this.i18nService = i18nService;
|
|
6889
6899
|
this.dataService = dataService;
|
|
6890
|
-
this.uiLanguageAndLocale$ = this.dataService.client
|
|
6891
|
-
|
|
6892
|
-
|
|
6900
|
+
this.uiLanguageAndLocale$ = this.dataService.client?.uiState()?.stream$?.pipe(map$1(({ uiState }) => {
|
|
6901
|
+
return [uiState.language, uiState.locale ?? undefined];
|
|
6902
|
+
}));
|
|
6893
6903
|
this.direction$ = this.uiLanguageAndLocale$?.pipe(map$1(([languageCode]) => {
|
|
6894
6904
|
return this.i18nService.isRTL(languageCode) ? 'rtl' : 'ltr';
|
|
6895
6905
|
}));
|
|
@@ -7147,7 +7157,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.2", ngImpor
|
|
|
7147
7157
|
}], ctorParameters: function () { return [{ type: AlertsService }]; } });
|
|
7148
7158
|
|
|
7149
7159
|
// Auto-generated by the set-version.js script.
|
|
7150
|
-
const ADMIN_UI_VERSION = '2.
|
|
7160
|
+
const ADMIN_UI_VERSION = '2.2.0-next.0';
|
|
7151
7161
|
|
|
7152
7162
|
/* eslint-disable @angular-eslint/directive-selector */
|
|
7153
7163
|
class FormFieldControlDirective {
|
|
@@ -7754,267 +7764,34 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.2", ngImpor
|
|
|
7754
7764
|
}] }]; } });
|
|
7755
7765
|
|
|
7756
7766
|
class UiLanguageSwitcherDialogComponent {
|
|
7757
|
-
constructor() {
|
|
7767
|
+
constructor(dataService, changeDetector) {
|
|
7768
|
+
this.dataService = dataService;
|
|
7769
|
+
this.changeDetector = changeDetector;
|
|
7770
|
+
this.isLoading = true;
|
|
7771
|
+
this.destroy$ = new Subject();
|
|
7758
7772
|
this.availableLanguages = [];
|
|
7759
|
-
this.availableLocales = [
|
|
7760
|
-
'AF',
|
|
7761
|
-
'AL',
|
|
7762
|
-
'DZ',
|
|
7763
|
-
'AS',
|
|
7764
|
-
'AD',
|
|
7765
|
-
'AO',
|
|
7766
|
-
'AI',
|
|
7767
|
-
'AQ',
|
|
7768
|
-
'AG',
|
|
7769
|
-
'AR',
|
|
7770
|
-
'AM',
|
|
7771
|
-
'AW',
|
|
7772
|
-
'AU',
|
|
7773
|
-
'AT',
|
|
7774
|
-
'AZ',
|
|
7775
|
-
'BS',
|
|
7776
|
-
'BH',
|
|
7777
|
-
'BD',
|
|
7778
|
-
'BB',
|
|
7779
|
-
'BY',
|
|
7780
|
-
'BE',
|
|
7781
|
-
'BZ',
|
|
7782
|
-
'BJ',
|
|
7783
|
-
'BM',
|
|
7784
|
-
'BT',
|
|
7785
|
-
'BO',
|
|
7786
|
-
'BQ',
|
|
7787
|
-
'BA',
|
|
7788
|
-
'BW',
|
|
7789
|
-
'BV',
|
|
7790
|
-
'BR',
|
|
7791
|
-
'IO',
|
|
7792
|
-
'BN',
|
|
7793
|
-
'BG',
|
|
7794
|
-
'BF',
|
|
7795
|
-
'BI',
|
|
7796
|
-
'CV',
|
|
7797
|
-
'KH',
|
|
7798
|
-
'CM',
|
|
7799
|
-
'CA',
|
|
7800
|
-
'KY',
|
|
7801
|
-
'CF',
|
|
7802
|
-
'TD',
|
|
7803
|
-
'CL',
|
|
7804
|
-
'CN',
|
|
7805
|
-
'CX',
|
|
7806
|
-
'CC',
|
|
7807
|
-
'CO',
|
|
7808
|
-
'KM',
|
|
7809
|
-
'CD',
|
|
7810
|
-
'CG',
|
|
7811
|
-
'CK',
|
|
7812
|
-
'CR',
|
|
7813
|
-
'HR',
|
|
7814
|
-
'CU',
|
|
7815
|
-
'CW',
|
|
7816
|
-
'CY',
|
|
7817
|
-
'CZ',
|
|
7818
|
-
'CI',
|
|
7819
|
-
'DK',
|
|
7820
|
-
'DJ',
|
|
7821
|
-
'DM',
|
|
7822
|
-
'DO',
|
|
7823
|
-
'EC',
|
|
7824
|
-
'EG',
|
|
7825
|
-
'SV',
|
|
7826
|
-
'GQ',
|
|
7827
|
-
'ER',
|
|
7828
|
-
'EE',
|
|
7829
|
-
'SZ',
|
|
7830
|
-
'ET',
|
|
7831
|
-
'FK',
|
|
7832
|
-
'FO',
|
|
7833
|
-
'FJ',
|
|
7834
|
-
'FI',
|
|
7835
|
-
'FR',
|
|
7836
|
-
'GF',
|
|
7837
|
-
'PF',
|
|
7838
|
-
'TF',
|
|
7839
|
-
'GA',
|
|
7840
|
-
'GM',
|
|
7841
|
-
'GE',
|
|
7842
|
-
'DE',
|
|
7843
|
-
'GH',
|
|
7844
|
-
'GI',
|
|
7845
|
-
'GR',
|
|
7846
|
-
'GL',
|
|
7847
|
-
'GD',
|
|
7848
|
-
'GP',
|
|
7849
|
-
'GU',
|
|
7850
|
-
'GT',
|
|
7851
|
-
'GG',
|
|
7852
|
-
'GN',
|
|
7853
|
-
'GW',
|
|
7854
|
-
'GY',
|
|
7855
|
-
'HT',
|
|
7856
|
-
'HM',
|
|
7857
|
-
'VA',
|
|
7858
|
-
'HN',
|
|
7859
|
-
'HK',
|
|
7860
|
-
'HU',
|
|
7861
|
-
'IS',
|
|
7862
|
-
'IN',
|
|
7863
|
-
'ID',
|
|
7864
|
-
'IR',
|
|
7865
|
-
'IQ',
|
|
7866
|
-
'IE',
|
|
7867
|
-
'IM',
|
|
7868
|
-
'IL',
|
|
7869
|
-
'IT',
|
|
7870
|
-
'JM',
|
|
7871
|
-
'JP',
|
|
7872
|
-
'JE',
|
|
7873
|
-
'JO',
|
|
7874
|
-
'KZ',
|
|
7875
|
-
'KE',
|
|
7876
|
-
'KI',
|
|
7877
|
-
'KP',
|
|
7878
|
-
'KR',
|
|
7879
|
-
'KW',
|
|
7880
|
-
'KG',
|
|
7881
|
-
'LA',
|
|
7882
|
-
'LV',
|
|
7883
|
-
'LB',
|
|
7884
|
-
'LS',
|
|
7885
|
-
'LR',
|
|
7886
|
-
'LY',
|
|
7887
|
-
'LI',
|
|
7888
|
-
'LT',
|
|
7889
|
-
'LU',
|
|
7890
|
-
'MO',
|
|
7891
|
-
'MG',
|
|
7892
|
-
'MW',
|
|
7893
|
-
'MY',
|
|
7894
|
-
'MV',
|
|
7895
|
-
'ML',
|
|
7896
|
-
'MT',
|
|
7897
|
-
'MH',
|
|
7898
|
-
'MQ',
|
|
7899
|
-
'MR',
|
|
7900
|
-
'MU',
|
|
7901
|
-
'YT',
|
|
7902
|
-
'MX',
|
|
7903
|
-
'FM',
|
|
7904
|
-
'MD',
|
|
7905
|
-
'MC',
|
|
7906
|
-
'MN',
|
|
7907
|
-
'ME',
|
|
7908
|
-
'MS',
|
|
7909
|
-
'MA',
|
|
7910
|
-
'MZ',
|
|
7911
|
-
'MM',
|
|
7912
|
-
'NA',
|
|
7913
|
-
'NR',
|
|
7914
|
-
'NP',
|
|
7915
|
-
'NL',
|
|
7916
|
-
'NC',
|
|
7917
|
-
'NZ',
|
|
7918
|
-
'NI',
|
|
7919
|
-
'NE',
|
|
7920
|
-
'NG',
|
|
7921
|
-
'NU',
|
|
7922
|
-
'NF',
|
|
7923
|
-
'MK',
|
|
7924
|
-
'MP',
|
|
7925
|
-
'NO',
|
|
7926
|
-
'OM',
|
|
7927
|
-
'PK',
|
|
7928
|
-
'PW',
|
|
7929
|
-
'PS',
|
|
7930
|
-
'PA',
|
|
7931
|
-
'PG',
|
|
7932
|
-
'PY',
|
|
7933
|
-
'PE',
|
|
7934
|
-
'PH',
|
|
7935
|
-
'PN',
|
|
7936
|
-
'PL',
|
|
7937
|
-
'PT',
|
|
7938
|
-
'PR',
|
|
7939
|
-
'QA',
|
|
7940
|
-
'RO',
|
|
7941
|
-
'RU',
|
|
7942
|
-
'RW',
|
|
7943
|
-
'RE',
|
|
7944
|
-
'BL',
|
|
7945
|
-
'SH',
|
|
7946
|
-
'KN',
|
|
7947
|
-
'LC',
|
|
7948
|
-
'MF',
|
|
7949
|
-
'PM',
|
|
7950
|
-
'VC',
|
|
7951
|
-
'WS',
|
|
7952
|
-
'SM',
|
|
7953
|
-
'ST',
|
|
7954
|
-
'SA',
|
|
7955
|
-
'SN',
|
|
7956
|
-
'RS',
|
|
7957
|
-
'SC',
|
|
7958
|
-
'SL',
|
|
7959
|
-
'SG',
|
|
7960
|
-
'SX',
|
|
7961
|
-
'SK',
|
|
7962
|
-
'SI',
|
|
7963
|
-
'SB',
|
|
7964
|
-
'SO',
|
|
7965
|
-
'ZA',
|
|
7966
|
-
'GS',
|
|
7967
|
-
'SS',
|
|
7968
|
-
'ES',
|
|
7969
|
-
'LK',
|
|
7970
|
-
'SD',
|
|
7971
|
-
'SR',
|
|
7972
|
-
'SJ',
|
|
7973
|
-
'SE',
|
|
7974
|
-
'CH',
|
|
7975
|
-
'SY',
|
|
7976
|
-
'TW',
|
|
7977
|
-
'TJ',
|
|
7978
|
-
'TZ',
|
|
7979
|
-
'TH',
|
|
7980
|
-
'TL',
|
|
7981
|
-
'TG',
|
|
7982
|
-
'TK',
|
|
7983
|
-
'TO',
|
|
7984
|
-
'TT',
|
|
7985
|
-
'TN',
|
|
7986
|
-
'TR',
|
|
7987
|
-
'TM',
|
|
7988
|
-
'TC',
|
|
7989
|
-
'TV',
|
|
7990
|
-
'UG',
|
|
7991
|
-
'UA',
|
|
7992
|
-
'AE',
|
|
7993
|
-
'GB',
|
|
7994
|
-
'UM',
|
|
7995
|
-
'US',
|
|
7996
|
-
'UY',
|
|
7997
|
-
'UZ',
|
|
7998
|
-
'VU',
|
|
7999
|
-
'VE',
|
|
8000
|
-
'VN',
|
|
8001
|
-
'VG',
|
|
8002
|
-
'VI',
|
|
8003
|
-
'WF',
|
|
8004
|
-
'EH',
|
|
8005
|
-
'YE',
|
|
8006
|
-
'ZM',
|
|
8007
|
-
'ZW',
|
|
8008
|
-
'AX',
|
|
8009
|
-
];
|
|
7773
|
+
this.availableLocales = [];
|
|
8010
7774
|
this.availableCurrencyCodes = Object.values(CurrencyCode);
|
|
8011
|
-
this.selectedCurrencyCode = 'USD';
|
|
8012
7775
|
this.now = new Date().toISOString();
|
|
8013
7776
|
const browserLanguage = navigator.language.split('-');
|
|
8014
7777
|
this.browserDefaultLocale = browserLanguage.length === 1 ? undefined : browserLanguage[1];
|
|
8015
7778
|
}
|
|
8016
7779
|
ngOnInit() {
|
|
8017
7780
|
this.updatePreviewLocale();
|
|
7781
|
+
this.dataService.settings
|
|
7782
|
+
.getActiveChannel()
|
|
7783
|
+
.mapStream(data => data.activeChannel.defaultCurrencyCode)
|
|
7784
|
+
.pipe(take$1(1), takeUntil$1(this.destroy$), finalize$1(() => {
|
|
7785
|
+
this.isLoading = false;
|
|
7786
|
+
this.changeDetector.markForCheck();
|
|
7787
|
+
}))
|
|
7788
|
+
.subscribe(x => {
|
|
7789
|
+
this.selectedCurrencyCode = x;
|
|
7790
|
+
});
|
|
7791
|
+
}
|
|
7792
|
+
ngOnDestroy() {
|
|
7793
|
+
this.destroy$.next();
|
|
7794
|
+
this.destroy$.complete();
|
|
8018
7795
|
}
|
|
8019
7796
|
updatePreviewLocale() {
|
|
8020
7797
|
if (!this.currentLocale || this.currentLocale.length === 0 || this.currentLocale.length === 2) {
|
|
@@ -8033,13 +7810,13 @@ class UiLanguageSwitcherDialogComponent {
|
|
|
8033
7810
|
}
|
|
8034
7811
|
return [languageCode, region.toUpperCase()].join('-');
|
|
8035
7812
|
}
|
|
8036
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.2", ngImport: i0, type: UiLanguageSwitcherDialogComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
8037
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.2", type: UiLanguageSwitcherDialogComponent, selector: "vdr-ui-language-switcher", ngImport: i0, template: "<ng-template vdrDialogTitle>{{ 'common.select-display-language' | translate }}</ng-template>\r\n<div class=\"clr-row\">\r\n
|
|
7813
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.2", ngImport: i0, type: UiLanguageSwitcherDialogComponent, deps: [{ token: DataService }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
7814
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.2", type: UiLanguageSwitcherDialogComponent, selector: "vdr-ui-language-switcher", ngImport: i0, template: "<ng-template vdrDialogTitle>{{ 'common.select-display-language' | translate }}</ng-template>\r\n\r\n<ng-container *ngIf=\"isLoading\">\r\n <div class=\"progress loop\"></div>\r\n</ng-container>\r\n\r\n<ng-container *ngIf=\"!isLoading\">\r\n <div class=\"clr-row\">\r\n <div class=\"flex pl-2 mb-2\">\r\n <vdr-form-field [label]=\"'common.language' | translate\" class=\"mr-2\">\r\n <select name=\"options\" [(ngModel)]=\"currentLanguage\" (ngModelChange)=\"updatePreviewLocale()\">\r\n <option *ngFor=\"let code of availableLanguages | sort\" [value]=\"code\">\r\n {{ code | uppercase }} ({{ code | localeLanguageName }})\r\n </option>\r\n </select>\r\n </vdr-form-field>\r\n <vdr-form-field [label]=\"'common.locale' | translate\">\r\n <ng-select appendTo=\"body\" [items]=\"availableLocales\" [(ngModel)]=\"currentLocale\"\r\n (ngModelChange)=\"updatePreviewLocale()\" [placeholder]=\"'common.browser-default' | translate\">\r\n <ng-template ng-label-tmp let-item=\"item\" let-clear=\"clear\">\r\n {{ item }} ({{ item | localeRegionName }})\r\n </ng-template>\r\n <ng-template ng-option-tmp let-item=\"item\">\r\n {{ item }} ({{ item | localeRegionName }})\r\n </ng-template>\r\n </ng-select>\r\n </vdr-form-field>\r\n </div>\r\n </div>\r\n <div class=\"card\">\r\n <div class=\"card-header\">\r\n <span class=\"pr-1\">{{ 'common.sample-formatting' | translate }}:</span><strong>{{ previewLocale |\r\n localeLanguageName : previewLocale }}</strong>\r\n </div>\r\n <div class=\"card-block\">\r\n <div class=\"clr-row\">\r\n <div class=\"clr-col-sm-4\">\r\n <vdr-labeled-data [label]=\"'common.medium-date' | translate\">\r\n {{ now | localeDate : 'medium' : previewLocale }}\r\n </vdr-labeled-data>\r\n <vdr-labeled-data [label]=\"'common.short-date' | translate\">\r\n {{ now | localeDate : 'short' : previewLocale }}\r\n </vdr-labeled-data>\r\n </div>\r\n <div class=\"clr-col-sm-4\">\r\n <select name=\"currency\" class=\"currency\" [(ngModel)]=\"selectedCurrencyCode\">\r\n <option *ngFor=\"let code of availableCurrencyCodes | sort\" [value]=\"code\">\r\n {{ code | uppercase }} ({{ code | localeCurrencyName : 'full' : previewLocale }})\r\n </option>\r\n </select>\r\n </div>\r\n <div class=\"clr-col-sm-4\">\r\n <vdr-labeled-data [label]=\"'common.price' | translate\">\r\n {{ 12345 | localeCurrency : selectedCurrencyCode : previewLocale }}\r\n </vdr-labeled-data>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n</ng-container>\r\n\r\n<ng-template vdrDialogButtons>\r\n <button type=\"button\" class=\"btn\" (click)=\"cancel()\">{{ 'common.cancel' | translate }}</button>\r\n <button type=\"submit\" (click)=\"setLanguage()\" class=\"btn btn-primary\">\r\n {{ 'common.set-language' | translate }}\r\n </button>\r\n</ng-template>", styles: ["select.currency{max-width:200px}input.locale{text-transform:uppercase}\n"], dependencies: [{ kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$4.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i1$4.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i1$4.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { kind: "directive", type: i1$4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$4.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i3$1.NgSelectComponent, selector: "ng-select", inputs: ["bindLabel", "bindValue", "markFirst", "placeholder", "notFoundText", "typeToSearchText", "addTagText", "loadingText", "clearAllText", "appearance", "dropdownPosition", "appendTo", "loading", "closeOnSelect", "hideSelected", "selectOnTab", "openOnEnter", "maxSelectedItems", "groupBy", "groupValue", "bufferAmount", "virtualScroll", "selectableGroup", "selectableGroupAsModel", "searchFn", "trackByFn", "clearOnBackspace", "labelForId", "inputAttrs", "tabIndex", "readonly", "searchWhileComposing", "minTermLength", "editableSearchTerm", "keyDownFn", "typeahead", "multiple", "addTag", "searchable", "clearable", "isOpen", "items", "compareWith", "clearSearchOnAdd", "deselectOnClick"], outputs: ["blur", "focus", "change", "open", "close", "search", "clear", "add", "remove", "scroll", "scrollToEnd"] }, { kind: "directive", type: i3$1.NgOptionTemplateDirective, selector: "[ng-option-tmp]" }, { kind: "directive", type: i3$1.NgLabelTemplateDirective, selector: "[ng-label-tmp]" }, { kind: "component", type: FormFieldComponent, selector: "vdr-form-field", inputs: ["label", "for", "tooltip", "errors", "readOnlyToggle"] }, { kind: "directive", type: FormFieldControlDirective, selector: "input, textarea, select" }, { kind: "directive", type: DialogButtonsDirective, selector: "[vdrDialogButtons]" }, { kind: "directive", type: DialogTitleDirective, selector: "[vdrDialogTitle]" }, { kind: "component", type: LabeledDataComponent, selector: "vdr-labeled-data", inputs: ["label"] }, { kind: "pipe", type: i2.UpperCasePipe, name: "uppercase" }, { kind: "pipe", type: i3.TranslatePipe, name: "translate" }, { kind: "pipe", type: LocaleCurrencyNamePipe, name: "localeCurrencyName" }, { kind: "pipe", type: SortPipe, name: "sort" }, { kind: "pipe", type: LocaleDatePipe, name: "localeDate" }, { kind: "pipe", type: LocaleCurrencyPipe, name: "localeCurrency" }, { kind: "pipe", type: LocaleLanguageNamePipe, name: "localeLanguageName" }, { kind: "pipe", type: LocaleRegionNamePipe, name: "localeRegionName" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
8038
7815
|
}
|
|
8039
7816
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.2", ngImport: i0, type: UiLanguageSwitcherDialogComponent, decorators: [{
|
|
8040
7817
|
type: Component,
|
|
8041
|
-
args: [{ selector: 'vdr-ui-language-switcher', changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-template vdrDialogTitle>{{ 'common.select-display-language' | translate }}</ng-template>\r\n<div class=\"clr-row\">\r\n
|
|
8042
|
-
}], ctorParameters: function () { return []; } });
|
|
7818
|
+
args: [{ selector: 'vdr-ui-language-switcher', changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-template vdrDialogTitle>{{ 'common.select-display-language' | translate }}</ng-template>\r\n\r\n<ng-container *ngIf=\"isLoading\">\r\n <div class=\"progress loop\"></div>\r\n</ng-container>\r\n\r\n<ng-container *ngIf=\"!isLoading\">\r\n <div class=\"clr-row\">\r\n <div class=\"flex pl-2 mb-2\">\r\n <vdr-form-field [label]=\"'common.language' | translate\" class=\"mr-2\">\r\n <select name=\"options\" [(ngModel)]=\"currentLanguage\" (ngModelChange)=\"updatePreviewLocale()\">\r\n <option *ngFor=\"let code of availableLanguages | sort\" [value]=\"code\">\r\n {{ code | uppercase }} ({{ code | localeLanguageName }})\r\n </option>\r\n </select>\r\n </vdr-form-field>\r\n <vdr-form-field [label]=\"'common.locale' | translate\">\r\n <ng-select appendTo=\"body\" [items]=\"availableLocales\" [(ngModel)]=\"currentLocale\"\r\n (ngModelChange)=\"updatePreviewLocale()\" [placeholder]=\"'common.browser-default' | translate\">\r\n <ng-template ng-label-tmp let-item=\"item\" let-clear=\"clear\">\r\n {{ item }} ({{ item | localeRegionName }})\r\n </ng-template>\r\n <ng-template ng-option-tmp let-item=\"item\">\r\n {{ item }} ({{ item | localeRegionName }})\r\n </ng-template>\r\n </ng-select>\r\n </vdr-form-field>\r\n </div>\r\n </div>\r\n <div class=\"card\">\r\n <div class=\"card-header\">\r\n <span class=\"pr-1\">{{ 'common.sample-formatting' | translate }}:</span><strong>{{ previewLocale |\r\n localeLanguageName : previewLocale }}</strong>\r\n </div>\r\n <div class=\"card-block\">\r\n <div class=\"clr-row\">\r\n <div class=\"clr-col-sm-4\">\r\n <vdr-labeled-data [label]=\"'common.medium-date' | translate\">\r\n {{ now | localeDate : 'medium' : previewLocale }}\r\n </vdr-labeled-data>\r\n <vdr-labeled-data [label]=\"'common.short-date' | translate\">\r\n {{ now | localeDate : 'short' : previewLocale }}\r\n </vdr-labeled-data>\r\n </div>\r\n <div class=\"clr-col-sm-4\">\r\n <select name=\"currency\" class=\"currency\" [(ngModel)]=\"selectedCurrencyCode\">\r\n <option *ngFor=\"let code of availableCurrencyCodes | sort\" [value]=\"code\">\r\n {{ code | uppercase }} ({{ code | localeCurrencyName : 'full' : previewLocale }})\r\n </option>\r\n </select>\r\n </div>\r\n <div class=\"clr-col-sm-4\">\r\n <vdr-labeled-data [label]=\"'common.price' | translate\">\r\n {{ 12345 | localeCurrency : selectedCurrencyCode : previewLocale }}\r\n </vdr-labeled-data>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n</ng-container>\r\n\r\n<ng-template vdrDialogButtons>\r\n <button type=\"button\" class=\"btn\" (click)=\"cancel()\">{{ 'common.cancel' | translate }}</button>\r\n <button type=\"submit\" (click)=\"setLanguage()\" class=\"btn btn-primary\">\r\n {{ 'common.set-language' | translate }}\r\n </button>\r\n</ng-template>", styles: ["select.currency{max-width:200px}input.locale{text-transform:uppercase}\n"] }]
|
|
7819
|
+
}], ctorParameters: function () { return [{ type: DataService }, { type: i0.ChangeDetectorRef }]; } });
|
|
8043
7820
|
|
|
8044
7821
|
/**
|
|
8045
7822
|
* This service handles logic relating to authentication of the current user.
|
|
@@ -9449,6 +9226,7 @@ class AppShellComponent {
|
|
|
9449
9226
|
this.localizationService = localizationService;
|
|
9450
9227
|
this.version = ADMIN_UI_VERSION;
|
|
9451
9228
|
this.availableLanguages = [];
|
|
9229
|
+
this.availableLocales = [];
|
|
9452
9230
|
this.hideVendureBranding = getAppConfig().hideVendureBranding;
|
|
9453
9231
|
this.devMode = isDevMode();
|
|
9454
9232
|
}
|
|
@@ -9459,6 +9237,7 @@ class AppShellComponent {
|
|
|
9459
9237
|
.userStatus()
|
|
9460
9238
|
.single$.pipe(map(data => data.userStatus.username));
|
|
9461
9239
|
this.availableLanguages = this.i18nService.availableLanguages;
|
|
9240
|
+
this.availableLocales = this.i18nService.availableLocales;
|
|
9462
9241
|
this.pageTitle$ = this.breadcrumbService.breadcrumbs$.pipe(map(breadcrumbs => breadcrumbs[breadcrumbs.length - 1].label));
|
|
9463
9242
|
this.mainNavExpanded$ = this.dataService.client
|
|
9464
9243
|
.uiState()
|
|
@@ -9466,15 +9245,18 @@ class AppShellComponent {
|
|
|
9466
9245
|
}
|
|
9467
9246
|
selectUiLanguage() {
|
|
9468
9247
|
this.uiLanguageAndLocale$
|
|
9469
|
-
.pipe(take(1), switchMap(([currentLanguage, currentLocale]) =>
|
|
9470
|
-
|
|
9471
|
-
|
|
9472
|
-
|
|
9473
|
-
|
|
9474
|
-
|
|
9475
|
-
|
|
9476
|
-
|
|
9477
|
-
|
|
9248
|
+
.pipe(take(1), switchMap(([currentLanguage, currentLocale]) => {
|
|
9249
|
+
return this.modalService.fromComponent(UiLanguageSwitcherDialogComponent, {
|
|
9250
|
+
closable: true,
|
|
9251
|
+
size: 'lg',
|
|
9252
|
+
locals: {
|
|
9253
|
+
availableLocales: this.availableLocales,
|
|
9254
|
+
availableLanguages: this.availableLanguages,
|
|
9255
|
+
currentLanguage: currentLanguage,
|
|
9256
|
+
currentLocale: currentLocale,
|
|
9257
|
+
},
|
|
9258
|
+
});
|
|
9259
|
+
}), switchMap(result => result ? this.dataService.client.setUiLanguage(result[0], result[1]) : EMPTY))
|
|
9478
9260
|
.subscribe(result => {
|
|
9479
9261
|
if (result.setUiLanguage) {
|
|
9480
9262
|
this.i18nService.setLanguage(result.setUiLanguage);
|
|
@@ -14128,11 +13910,11 @@ class AssetPreviewComponent {
|
|
|
14128
13910
|
this.disablePreviousButton = this.assets?.[this.previewAssetIndex - 1]?.id ? false : true;
|
|
14129
13911
|
}
|
|
14130
13912
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.2", ngImport: i0, type: AssetPreviewComponent, deps: [{ token: i1$4.FormBuilder }, { token: DataService }, { token: NotificationService }, { token: i0.ChangeDetectorRef }, { token: ModalService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
14131
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.2", type: AssetPreviewComponent, selector: "vdr-asset-preview", inputs: { asset: "asset", assets: "assets", editable: "editable", customFields: "customFields", customFieldsForm: "customFieldsForm" }, outputs: { assetChange: "assetChange", editClick: "editClick" }, viewQueries: [{ propertyName: "imageElementRef", first: true, predicate: ["imageElement"], descendants: true, static: true }, { propertyName: "previewDivRef", first: true, predicate: ["previewDiv"], descendants: true, static: true }], ngImport: i0, template: "<vdr-page-detail-layout>\r\n <vdr-page-detail-sidebar>\r\n <vdr-card>\r\n <div *ngIf=\"!editable\" class=\"mb-2\">\r\n <a\r\n class=\"button-ghost\"\r\n [routerLink]=\"['/catalog', 'assets', asset.id]\"\r\n (click)=\"editClick.emit()\"\r\n >\r\n <clr-icon shape=\"edit\"></clr-icon>\r\n {{ 'common.edit' | translate }}\r\n <clr-icon shape=\"arrow right\"></clr-icon>\r\n </a>\r\n </div>\r\n <vdr-form-field *ngIf=\"editable\" [label]=\"'common.name' | translate\" class=\"mb-2\">\r\n <input\r\n type=\"text\"\r\n [formControl]=\"form.get('name')\"\r\n [readonly]=\"!(['UpdateCatalog', 'UpdateAsset'] | hasPermission) || settingFocalPoint\"\r\n />\r\n </vdr-form-field>\r\n <vdr-labeled-data [label]=\"'common.name' | translate\" *ngIf=\"!editable\">\r\n <span class=\"elide\">\r\n {{ asset.name }}\r\n </span>\r\n </vdr-labeled-data>\r\n <vdr-labeled-data [label]=\"'asset.source-file' | translate\">\r\n <a [href]=\"asset.source\" [title]=\"asset.source\" target=\"_blank\" class=\"elide source-link\">{{\r\n getSourceFileName()\r\n }}</a>\r\n </vdr-labeled-data>\r\n\r\n <vdr-labeled-data [label]=\"'asset.original-asset-size' | translate\">\r\n {{ asset.fileSize | filesize }}\r\n </vdr-labeled-data>\r\n\r\n <vdr-labeled-data [label]=\"'asset.dimensions' | translate\">\r\n {{ asset.width }} x {{ asset.height }}\r\n </vdr-labeled-data>\r\n\r\n <vdr-labeled-data [label]=\"'asset.focal-point' | translate\">\r\n <span *ngIf=\"fpx\"\r\n ><clr-icon shape=\"crosshairs\"></clr-icon> x: {{ fpx | number : '1.2-2' }}, y:\r\n {{ fpy | number : '1.2-2' }}</span\r\n >\r\n <span *ngIf=\"!fpx\">{{ 'common.not-set' | translate }}</span>\r\n <div class=\"flex mt-1\">\r\n <button\r\n class=\"button-small mr-1\"\r\n [disabled]=\"settingFocalPoint\"\r\n (click)=\"setFocalPointStart()\"\r\n >\r\n <ng-container *ngIf=\"!fpx\">{{ 'asset.set-focal-point' | translate }}</ng-container>\r\n <ng-container *ngIf=\"fpx\">{{ 'asset.update-focal-point' | translate }}</ng-container>\r\n </button>\r\n <button\r\n class=\"button-small\"\r\n [disabled]=\"settingFocalPoint\"\r\n *ngIf=\"!!fpx\"\r\n (click)=\"removeFocalPoint()\"\r\n >\r\n {{ 'asset.unset-focal-point' | translate }}\r\n </button>\r\n </div>\r\n </vdr-labeled-data>\r\n <vdr-labeled-data [label]=\"'common.tags' | translate\">\r\n <ng-container *ngIf=\"editable\">\r\n <vdr-tag-selector [formControl]=\"form.get('tags')\"></vdr-tag-selector>\r\n <button class=\"button-small mt-1\" (click)=\"manageTags()\">\r\n <clr-icon shape=\"tags\"></clr-icon>\r\n {{ 'common.manage-tags' | translate }}\r\n </button>\r\n </ng-container>\r\n <div *ngIf=\"!editable\">\r\n <vdr-chip *ngFor=\"let tag of asset.tags\" [colorFrom]=\"tag.value\">\r\n <clr-icon shape=\"tag\" class=\"mr2\"></clr-icon>\r\n {{ tag.value }}</vdr-chip\r\n >\r\n </div>\r\n </vdr-labeled-data>\r\n </vdr-card>\r\n <vdr-card *ngIf=\"customFields.length\" [title]=\"'common.custom-fields' | translate\">\r\n <vdr-tabbed-custom-fields\r\n entityName=\"Asset\"\r\n [compact]=\"true\"\r\n [customFields]=\"customFields\"\r\n [customFieldsFormGroup]=\"customFieldsForm\"\r\n [readonly]=\"!(['UpdateCatalog', 'UpdateAsset'] | hasPermission)\"\r\n ></vdr-tabbed-custom-fields>\r\n </vdr-card>\r\n <vdr-card [title]=\"'asset.preview' | translate\">\r\n <vdr-form-field>\r\n <select name=\"options\" [(ngModel)]=\"size\" [disabled]=\"settingFocalPoint\">\r\n <option value=\"tiny\">tiny</option>\r\n <option value=\"thumb\">thumb</option>\r\n <option value=\"small\">small</option>\r\n <option value=\"medium\">medium</option>\r\n <option value=\"large\">large</option>\r\n <option value=\"\">full size</option>\r\n </select>\r\n </vdr-form-field>\r\n <div class=\"asset-detail\">{{ width }} x {{ height }}</div>\r\n <vdr-asset-preview-links [asset]=\"asset\"></vdr-asset-preview-links>\r\n </vdr-card>\r\n <vdr-card>\r\n <vdr-page-entity-info *ngIf=\"asset as entity\" [entity]=\"entity\"></vdr-page-entity-info>\r\n </vdr-card>\r\n </vdr-page-detail-sidebar>\r\n <div class=\"carousel-container\">\r\n <button *ngIf=\"showSlideButtons\" (click)=\"previousImage()\" [class.disabled]=\"disablePreviousButton\"><clr-icon shape=\"caret left\" class=\"color-weight-800\"></clr-icon\r\n ></button>\r\n <div class=\"preview-image\" #previewDiv [class.centered]=\"centered\">\r\n <div class=\"image-wrapper\">\r\n <vdr-focal-point-control\r\n [width]=\"width\"\r\n [height]=\"height\"\r\n [fpx]=\"fpx\"\r\n [fpy]=\"fpy\"\r\n [editable]=\"settingFocalPoint\"\r\n (focalPointChange)=\"onFocalPointChange($event)\"\r\n >\r\n <img\r\n class=\"asset-image\"\r\n [src]=\"asset | assetPreview : size\"\r\n [ngClass]=\"size\"\r\n #imageElement\r\n (load)=\"onImageLoad()\"\r\n />\r\n </vdr-focal-point-control>\r\n <div class=\"focal-point-info\" *ngIf=\"settingFocalPoint\">\r\n <button class=\"icon-button\" (click)=\"setFocalPointCancel()\">\r\n <clr-icon shape=\"times\"></clr-icon>\r\n </button>\r\n <button\r\n class=\"btn btn-primary btn-sm\"\r\n (click)=\"setFocalPointEnd()\"\r\n [disabled]=\"!lastFocalPoint\"\r\n >\r\n <clr-icon shape=\"crosshairs\"></clr-icon>\r\n {{ 'asset.set-focal-point' | translate }}\r\n </button>\r\n </div>\r\n </div>\r\n </div>\r\n <button *ngIf=\"showSlideButtons\" (click)=\"nextImage()\" [class.disabled]=\"disableNextButton\"><clr-icon shape=\"caret right\" class=\"color-weight-800\"></clr-icon\r\n ></button>\r\n </div>\r\n</vdr-page-detail-layout>\r\n", styles: [":host{height:100%}.preview-image{width:100%;max-width:750px;height:100%;min-height:60vh;overflow:auto;text-align:center;box-shadow:inset 0 0 5px #0000001a;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAIAAACQkWg2AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAACuoAAArqAVDM774AAAAZdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuMTZEaa/1AAAAK0lEQVQ4T2P4jwP8xgFGNSADqDwGIF0DlMYAUH0YYFQDMoDKYwASNfz/DwB/JvcficphowAAAABJRU5ErkJggg==);margin-top:var(--space-unit);flex:1}.preview-image.centered{display:flex;align-items:center;justify-content:center}.preview-image vdr-focal-point-control{position:relative;box-shadow:0 0 10px -3px #00000026}.preview-image .image-wrapper{position:relative}.preview-image .asset-image{width:100%}.preview-image .asset-image.tiny{max-width:50px;max-height:50px}.preview-image .asset-image.thumb{max-width:150px;max-height:150px}.preview-image .asset-image.small{max-width:300px;max-height:300px}.preview-image .asset-image.medium{max-width:500px;max-height:500px}.preview-image .asset-image.large{max-width:800px;max-height:800px}.preview-image .focal-point-info{position:absolute;display:flex;right:0}.controls{display:flex;flex-direction:column;margin-inline-start:12px;min-width:15vw;max-width:25vw;transition:opacity .3s}.controls.fade{opacity:.5}.controls .name-input{margin-bottom:24px}.controls ::ng-deep .clr-control-container{width:100%}.controls ::ng-deep .clr-control-container .clr-input{width:100%}.controls .elide{overflow:hidden;white-space:nowrap;text-overflow:ellipsis;display:block}.controls .source-link{direction:rtl}.controls .preview-select{display:flex;align-items:center}.controls .preview-select clr-select-container{margin-inline-end:12px}.carousel-container{display:flex;flex-direction:row;justify-content:space-between;align-items:center}.carousel-container button{cursor:pointer;width:30px;height:30px;border:none;border-radius:50%;text-align:center;background-color:var(--color-grey-300)}.carousel-container button:hover{background-color:var(--color-grey-400)}.carousel-container .disabled{pointer-events:none;opacity:.4}\n"], dependencies: [{ kind: "directive", type: i1$3.ClrIconCustomTag, selector: "clr-icon" }, { kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$4.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i1$4.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i1$4.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$4.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { kind: "directive", type: i1$4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$4.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i1$4.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$1.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "component", type: ChipComponent, selector: "vdr-chip", inputs: ["icon", "invert", "colorFrom", "colorType"], outputs: ["iconClick"] }, { kind: "component", type: FormFieldComponent, selector: "vdr-form-field", inputs: ["label", "for", "tooltip", "errors", "readOnlyToggle"] }, { kind: "directive", type: FormFieldControlDirective, selector: "input, textarea, select" }, { kind: "component", type: LabeledDataComponent, selector: "vdr-labeled-data", inputs: ["label"] }, { kind: "component", type: FocalPointControlComponent, selector: "vdr-focal-point-control", inputs: ["visible", "editable", "width", "height", "fpx", "fpy"], outputs: ["focalPointChange"] }, { kind: "component", type: TagSelectorComponent, selector: "vdr-tag-selector", inputs: ["placeholder"] }, { kind: "component", type: TabbedCustomFieldsComponent, selector: "vdr-tabbed-custom-fields", inputs: ["entityName", "customFields", "customFieldsFormGroup", "readonly", "compact", "showLabel"] }, { kind: "component", type: AssetPreviewLinksComponent, selector: "vdr-asset-preview-links", inputs: ["asset"] }, { kind: "component", type: PageEntityInfoComponent, selector: "vdr-page-entity-info", inputs: ["entity"] }, { kind: "component", type: PageDetailLayoutComponent, selector: "vdr-page-detail-layout" }, { kind: "component", type: PageDetailSidebarComponent, selector: "vdr-page-detail-sidebar" }, { kind: "component", type: CardComponent, selector: "vdr-card", inputs: ["title", "paddingX"] }, { kind: "pipe", type: i2.DecimalPipe, name: "number" }, { kind: "pipe", type: i3.TranslatePipe, name: "translate" }, { kind: "pipe", type: FileSizePipe, name: "filesize" }, { kind: "pipe", type: HasPermissionPipe, name: "hasPermission" }, { kind: "pipe", type: AssetPreviewPipe, name: "assetPreview" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
13913
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.2", type: AssetPreviewComponent, selector: "vdr-asset-preview", inputs: { asset: "asset", assets: "assets", editable: "editable", customFields: "customFields", customFieldsForm: "customFieldsForm" }, outputs: { assetChange: "assetChange", editClick: "editClick" }, viewQueries: [{ propertyName: "imageElementRef", first: true, predicate: ["imageElement"], descendants: true, static: true }, { propertyName: "previewDivRef", first: true, predicate: ["previewDiv"], descendants: true, static: true }], ngImport: i0, template: "<vdr-page-detail-layout>\r\n <vdr-page-detail-sidebar>\r\n <vdr-card>\r\n <div *ngIf=\"!editable\" class=\"mb-2\">\r\n <a\r\n class=\"button-ghost\"\r\n [routerLink]=\"['/catalog', 'assets', asset.id]\"\r\n (click)=\"editClick.emit()\"\r\n >\r\n <clr-icon shape=\"edit\"></clr-icon>\r\n {{ 'common.edit' | translate }}\r\n <clr-icon shape=\"arrow right\"></clr-icon>\r\n </a>\r\n </div>\r\n <vdr-form-field *ngIf=\"editable\" [label]=\"'common.name' | translate\" class=\"mb-2\">\r\n <input\r\n type=\"text\"\r\n [formControl]=\"form.get('name')\"\r\n [readonly]=\"!(['UpdateCatalog', 'UpdateAsset'] | hasPermission) || settingFocalPoint\"\r\n />\r\n </vdr-form-field>\r\n <vdr-labeled-data [label]=\"'common.name' | translate\" *ngIf=\"!editable\">\r\n <span class=\"elide\">\r\n {{ asset.name }}\r\n </span>\r\n </vdr-labeled-data>\r\n <vdr-labeled-data [label]=\"'asset.source-file' | translate\">\r\n <a [href]=\"asset.source\" [title]=\"asset.source\" target=\"_blank\" class=\"elide source-link\">{{\r\n getSourceFileName()\r\n }}</a>\r\n </vdr-labeled-data>\r\n\r\n <vdr-labeled-data [label]=\"'asset.original-asset-size' | translate\">\r\n {{ asset.fileSize | filesize }}\r\n </vdr-labeled-data>\r\n\r\n <vdr-labeled-data [label]=\"'asset.dimensions' | translate\">\r\n {{ asset.width }} x {{ asset.height }}\r\n </vdr-labeled-data>\r\n\r\n <vdr-labeled-data [label]=\"'asset.focal-point' | translate\">\r\n <span *ngIf=\"fpx\"\r\n ><clr-icon shape=\"crosshairs\"></clr-icon> x: {{ fpx | number : '1.2-2' }}, y:\r\n {{ fpy | number : '1.2-2' }}</span\r\n >\r\n <span *ngIf=\"!fpx\">{{ 'common.not-set' | translate }}</span>\r\n <div class=\"flex mt-1\">\r\n <button\r\n class=\"button-small mr-1\"\r\n [disabled]=\"settingFocalPoint\"\r\n (click)=\"setFocalPointStart()\"\r\n >\r\n <ng-container *ngIf=\"!fpx\">{{ 'asset.set-focal-point' | translate }}</ng-container>\r\n <ng-container *ngIf=\"fpx\">{{ 'asset.update-focal-point' | translate }}</ng-container>\r\n </button>\r\n <button\r\n class=\"button-small\"\r\n [disabled]=\"settingFocalPoint\"\r\n *ngIf=\"!!fpx\"\r\n (click)=\"removeFocalPoint()\"\r\n >\r\n {{ 'asset.unset-focal-point' | translate }}\r\n </button>\r\n </div>\r\n </vdr-labeled-data>\r\n <vdr-labeled-data [label]=\"'common.tags' | translate\">\r\n <ng-container *ngIf=\"editable\">\r\n <vdr-tag-selector [formControl]=\"form.get('tags')\"></vdr-tag-selector>\r\n <button class=\"button-small mt-1\" (click)=\"manageTags()\">\r\n <clr-icon shape=\"tags\"></clr-icon>\r\n {{ 'common.manage-tags' | translate }}\r\n </button>\r\n </ng-container>\r\n <div *ngIf=\"!editable\">\r\n <vdr-chip *ngFor=\"let tag of asset.tags\" [colorFrom]=\"tag.value\">\r\n <clr-icon shape=\"tag\" class=\"mr2\"></clr-icon>\r\n {{ tag.value }}</vdr-chip\r\n >\r\n </div>\r\n </vdr-labeled-data>\r\n </vdr-card>\r\n <vdr-card *ngIf=\"customFields.length\" [title]=\"'common.custom-fields' | translate\">\r\n <vdr-tabbed-custom-fields\r\n entityName=\"Asset\"\r\n [compact]=\"true\"\r\n [customFields]=\"customFields\"\r\n [customFieldsFormGroup]=\"customFieldsForm\"\r\n [readonly]=\"!(['UpdateCatalog', 'UpdateAsset'] | hasPermission)\"\r\n ></vdr-tabbed-custom-fields>\r\n </vdr-card>\r\n <vdr-card [title]=\"'asset.preview' | translate\">\r\n <vdr-form-field>\r\n <select name=\"options\" [(ngModel)]=\"size\" [disabled]=\"settingFocalPoint\">\r\n <option value=\"tiny\">tiny</option>\r\n <option value=\"thumb\">thumb</option>\r\n <option value=\"small\">small</option>\r\n <option value=\"medium\">medium</option>\r\n <option value=\"large\">large</option>\r\n <option value=\"\">full size</option>\r\n </select>\r\n </vdr-form-field>\r\n <div class=\"asset-detail\">{{ width }} x {{ height }}</div>\r\n <vdr-asset-preview-links [asset]=\"asset\"></vdr-asset-preview-links>\r\n </vdr-card>\r\n <vdr-card>\r\n <vdr-page-entity-info *ngIf=\"asset as entity\" [entity]=\"entity\"></vdr-page-entity-info>\r\n </vdr-card>\r\n </vdr-page-detail-sidebar>\r\n <div class=\"carousel-container\">\r\n <button *ngIf=\"showSlideButtons\" (click)=\"previousImage()\" class=\"carousel-button\" [class.disabled]=\"disablePreviousButton\">\r\n <clr-icon shape=\"caret left\" class=\"color-weight-800\"></clr-icon>\r\n </button>\r\n <div class=\"preview-image\" #previewDiv [class.centered]=\"centered\">\r\n <div class=\"image-wrapper\">\r\n <vdr-focal-point-control\r\n [width]=\"width\"\r\n [height]=\"height\"\r\n [fpx]=\"fpx\"\r\n [fpy]=\"fpy\"\r\n [editable]=\"settingFocalPoint\"\r\n (focalPointChange)=\"onFocalPointChange($event)\"\r\n >\r\n <img\r\n class=\"asset-image\"\r\n [src]=\"asset | assetPreview : size\"\r\n [ngClass]=\"size\"\r\n #imageElement\r\n (load)=\"onImageLoad()\"\r\n />\r\n </vdr-focal-point-control>\r\n <div class=\"focal-point-info\" *ngIf=\"settingFocalPoint\">\r\n <button class=\"icon-button\" (click)=\"setFocalPointCancel()\">\r\n <clr-icon shape=\"times\"></clr-icon>\r\n </button>\r\n <button\r\n class=\"btn btn-primary btn-sm\"\r\n (click)=\"setFocalPointEnd()\"\r\n [disabled]=\"!lastFocalPoint\"\r\n >\r\n <clr-icon shape=\"crosshairs\"></clr-icon>\r\n {{ 'asset.set-focal-point' | translate }}\r\n </button>\r\n </div>\r\n </div>\r\n </div>\r\n <button *ngIf=\"showSlideButtons\" (click)=\"nextImage()\" class=\"carousel-button\" [class.disabled]=\"disableNextButton\">\r\n <clr-icon shape=\"caret right\" class=\"color-weight-800\"></clr-icon>\r\n </button>\r\n </div>\r\n</vdr-page-detail-layout>\r\n", styles: [":host{height:100%}.preview-image{width:100%;max-width:750px;height:100%;min-height:60vh;overflow:auto;text-align:center;box-shadow:inset 0 0 5px #0000001a;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAIAAACQkWg2AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAACuoAAArqAVDM774AAAAZdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuMTZEaa/1AAAAK0lEQVQ4T2P4jwP8xgFGNSADqDwGIF0DlMYAUH0YYFQDMoDKYwASNfz/DwB/JvcficphowAAAABJRU5ErkJggg==);margin-top:var(--space-unit);flex:1}.preview-image.centered{display:flex;align-items:center;justify-content:center}.preview-image vdr-focal-point-control{position:relative;box-shadow:0 0 10px -3px #00000026}.preview-image .image-wrapper{position:relative}.preview-image .asset-image{width:100%}.preview-image .asset-image.tiny{max-width:50px;max-height:50px}.preview-image .asset-image.thumb{max-width:150px;max-height:150px}.preview-image .asset-image.small{max-width:300px;max-height:300px}.preview-image .asset-image.medium{max-width:500px;max-height:500px}.preview-image .asset-image.large{max-width:800px;max-height:800px}.preview-image .focal-point-info{position:absolute;display:flex;right:0}.controls{display:flex;flex-direction:column;margin-inline-start:12px;min-width:15vw;max-width:25vw;transition:opacity .3s}.controls.fade{opacity:.5}.controls .name-input{margin-bottom:24px}.controls ::ng-deep .clr-control-container{width:100%}.controls ::ng-deep .clr-control-container .clr-input{width:100%}.controls .elide{overflow:hidden;white-space:nowrap;text-overflow:ellipsis;display:block}.controls .source-link{direction:rtl}.controls .preview-select{display:flex;align-items:center}.controls .preview-select clr-select-container{margin-inline-end:12px}.carousel-container{display:flex;flex-direction:row;justify-content:space-between;align-items:center}.carousel-container button.carousel-button{cursor:pointer;width:30px;height:30px;border:none;border-radius:50%;text-align:center;background-color:var(--color-grey-300)}.carousel-container button.carousel-button:hover{background-color:var(--color-grey-400)}.carousel-container .disabled{pointer-events:none;opacity:.4}\n"], dependencies: [{ kind: "directive", type: i1$3.ClrIconCustomTag, selector: "clr-icon" }, { kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$4.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i1$4.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i1$4.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$4.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { kind: "directive", type: i1$4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$4.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i1$4.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$1.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "component", type: ChipComponent, selector: "vdr-chip", inputs: ["icon", "invert", "colorFrom", "colorType"], outputs: ["iconClick"] }, { kind: "component", type: FormFieldComponent, selector: "vdr-form-field", inputs: ["label", "for", "tooltip", "errors", "readOnlyToggle"] }, { kind: "directive", type: FormFieldControlDirective, selector: "input, textarea, select" }, { kind: "component", type: LabeledDataComponent, selector: "vdr-labeled-data", inputs: ["label"] }, { kind: "component", type: FocalPointControlComponent, selector: "vdr-focal-point-control", inputs: ["visible", "editable", "width", "height", "fpx", "fpy"], outputs: ["focalPointChange"] }, { kind: "component", type: TagSelectorComponent, selector: "vdr-tag-selector", inputs: ["placeholder"] }, { kind: "component", type: TabbedCustomFieldsComponent, selector: "vdr-tabbed-custom-fields", inputs: ["entityName", "customFields", "customFieldsFormGroup", "readonly", "compact", "showLabel"] }, { kind: "component", type: AssetPreviewLinksComponent, selector: "vdr-asset-preview-links", inputs: ["asset"] }, { kind: "component", type: PageEntityInfoComponent, selector: "vdr-page-entity-info", inputs: ["entity"] }, { kind: "component", type: PageDetailLayoutComponent, selector: "vdr-page-detail-layout" }, { kind: "component", type: PageDetailSidebarComponent, selector: "vdr-page-detail-sidebar" }, { kind: "component", type: CardComponent, selector: "vdr-card", inputs: ["title", "paddingX"] }, { kind: "pipe", type: i2.DecimalPipe, name: "number" }, { kind: "pipe", type: i3.TranslatePipe, name: "translate" }, { kind: "pipe", type: FileSizePipe, name: "filesize" }, { kind: "pipe", type: HasPermissionPipe, name: "hasPermission" }, { kind: "pipe", type: AssetPreviewPipe, name: "assetPreview" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
14132
13914
|
}
|
|
14133
13915
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.2", ngImport: i0, type: AssetPreviewComponent, decorators: [{
|
|
14134
13916
|
type: Component,
|
|
14135
|
-
args: [{ selector: 'vdr-asset-preview', changeDetection: ChangeDetectionStrategy.OnPush, template: "<vdr-page-detail-layout>\r\n <vdr-page-detail-sidebar>\r\n <vdr-card>\r\n <div *ngIf=\"!editable\" class=\"mb-2\">\r\n <a\r\n class=\"button-ghost\"\r\n [routerLink]=\"['/catalog', 'assets', asset.id]\"\r\n (click)=\"editClick.emit()\"\r\n >\r\n <clr-icon shape=\"edit\"></clr-icon>\r\n {{ 'common.edit' | translate }}\r\n <clr-icon shape=\"arrow right\"></clr-icon>\r\n </a>\r\n </div>\r\n <vdr-form-field *ngIf=\"editable\" [label]=\"'common.name' | translate\" class=\"mb-2\">\r\n <input\r\n type=\"text\"\r\n [formControl]=\"form.get('name')\"\r\n [readonly]=\"!(['UpdateCatalog', 'UpdateAsset'] | hasPermission) || settingFocalPoint\"\r\n />\r\n </vdr-form-field>\r\n <vdr-labeled-data [label]=\"'common.name' | translate\" *ngIf=\"!editable\">\r\n <span class=\"elide\">\r\n {{ asset.name }}\r\n </span>\r\n </vdr-labeled-data>\r\n <vdr-labeled-data [label]=\"'asset.source-file' | translate\">\r\n <a [href]=\"asset.source\" [title]=\"asset.source\" target=\"_blank\" class=\"elide source-link\">{{\r\n getSourceFileName()\r\n }}</a>\r\n </vdr-labeled-data>\r\n\r\n <vdr-labeled-data [label]=\"'asset.original-asset-size' | translate\">\r\n {{ asset.fileSize | filesize }}\r\n </vdr-labeled-data>\r\n\r\n <vdr-labeled-data [label]=\"'asset.dimensions' | translate\">\r\n {{ asset.width }} x {{ asset.height }}\r\n </vdr-labeled-data>\r\n\r\n <vdr-labeled-data [label]=\"'asset.focal-point' | translate\">\r\n <span *ngIf=\"fpx\"\r\n ><clr-icon shape=\"crosshairs\"></clr-icon> x: {{ fpx | number : '1.2-2' }}, y:\r\n {{ fpy | number : '1.2-2' }}</span\r\n >\r\n <span *ngIf=\"!fpx\">{{ 'common.not-set' | translate }}</span>\r\n <div class=\"flex mt-1\">\r\n <button\r\n class=\"button-small mr-1\"\r\n [disabled]=\"settingFocalPoint\"\r\n (click)=\"setFocalPointStart()\"\r\n >\r\n <ng-container *ngIf=\"!fpx\">{{ 'asset.set-focal-point' | translate }}</ng-container>\r\n <ng-container *ngIf=\"fpx\">{{ 'asset.update-focal-point' | translate }}</ng-container>\r\n </button>\r\n <button\r\n class=\"button-small\"\r\n [disabled]=\"settingFocalPoint\"\r\n *ngIf=\"!!fpx\"\r\n (click)=\"removeFocalPoint()\"\r\n >\r\n {{ 'asset.unset-focal-point' | translate }}\r\n </button>\r\n </div>\r\n </vdr-labeled-data>\r\n <vdr-labeled-data [label]=\"'common.tags' | translate\">\r\n <ng-container *ngIf=\"editable\">\r\n <vdr-tag-selector [formControl]=\"form.get('tags')\"></vdr-tag-selector>\r\n <button class=\"button-small mt-1\" (click)=\"manageTags()\">\r\n <clr-icon shape=\"tags\"></clr-icon>\r\n {{ 'common.manage-tags' | translate }}\r\n </button>\r\n </ng-container>\r\n <div *ngIf=\"!editable\">\r\n <vdr-chip *ngFor=\"let tag of asset.tags\" [colorFrom]=\"tag.value\">\r\n <clr-icon shape=\"tag\" class=\"mr2\"></clr-icon>\r\n {{ tag.value }}</vdr-chip\r\n >\r\n </div>\r\n </vdr-labeled-data>\r\n </vdr-card>\r\n <vdr-card *ngIf=\"customFields.length\" [title]=\"'common.custom-fields' | translate\">\r\n <vdr-tabbed-custom-fields\r\n entityName=\"Asset\"\r\n [compact]=\"true\"\r\n [customFields]=\"customFields\"\r\n [customFieldsFormGroup]=\"customFieldsForm\"\r\n [readonly]=\"!(['UpdateCatalog', 'UpdateAsset'] | hasPermission)\"\r\n ></vdr-tabbed-custom-fields>\r\n </vdr-card>\r\n <vdr-card [title]=\"'asset.preview' | translate\">\r\n <vdr-form-field>\r\n <select name=\"options\" [(ngModel)]=\"size\" [disabled]=\"settingFocalPoint\">\r\n <option value=\"tiny\">tiny</option>\r\n <option value=\"thumb\">thumb</option>\r\n <option value=\"small\">small</option>\r\n <option value=\"medium\">medium</option>\r\n <option value=\"large\">large</option>\r\n <option value=\"\">full size</option>\r\n </select>\r\n </vdr-form-field>\r\n <div class=\"asset-detail\">{{ width }} x {{ height }}</div>\r\n <vdr-asset-preview-links [asset]=\"asset\"></vdr-asset-preview-links>\r\n </vdr-card>\r\n <vdr-card>\r\n <vdr-page-entity-info *ngIf=\"asset as entity\" [entity]=\"entity\"></vdr-page-entity-info>\r\n </vdr-card>\r\n </vdr-page-detail-sidebar>\r\n <div class=\"carousel-container\">\r\n
|
|
13917
|
+
args: [{ selector: 'vdr-asset-preview', changeDetection: ChangeDetectionStrategy.OnPush, template: "<vdr-page-detail-layout>\r\n <vdr-page-detail-sidebar>\r\n <vdr-card>\r\n <div *ngIf=\"!editable\" class=\"mb-2\">\r\n <a\r\n class=\"button-ghost\"\r\n [routerLink]=\"['/catalog', 'assets', asset.id]\"\r\n (click)=\"editClick.emit()\"\r\n >\r\n <clr-icon shape=\"edit\"></clr-icon>\r\n {{ 'common.edit' | translate }}\r\n <clr-icon shape=\"arrow right\"></clr-icon>\r\n </a>\r\n </div>\r\n <vdr-form-field *ngIf=\"editable\" [label]=\"'common.name' | translate\" class=\"mb-2\">\r\n <input\r\n type=\"text\"\r\n [formControl]=\"form.get('name')\"\r\n [readonly]=\"!(['UpdateCatalog', 'UpdateAsset'] | hasPermission) || settingFocalPoint\"\r\n />\r\n </vdr-form-field>\r\n <vdr-labeled-data [label]=\"'common.name' | translate\" *ngIf=\"!editable\">\r\n <span class=\"elide\">\r\n {{ asset.name }}\r\n </span>\r\n </vdr-labeled-data>\r\n <vdr-labeled-data [label]=\"'asset.source-file' | translate\">\r\n <a [href]=\"asset.source\" [title]=\"asset.source\" target=\"_blank\" class=\"elide source-link\">{{\r\n getSourceFileName()\r\n }}</a>\r\n </vdr-labeled-data>\r\n\r\n <vdr-labeled-data [label]=\"'asset.original-asset-size' | translate\">\r\n {{ asset.fileSize | filesize }}\r\n </vdr-labeled-data>\r\n\r\n <vdr-labeled-data [label]=\"'asset.dimensions' | translate\">\r\n {{ asset.width }} x {{ asset.height }}\r\n </vdr-labeled-data>\r\n\r\n <vdr-labeled-data [label]=\"'asset.focal-point' | translate\">\r\n <span *ngIf=\"fpx\"\r\n ><clr-icon shape=\"crosshairs\"></clr-icon> x: {{ fpx | number : '1.2-2' }}, y:\r\n {{ fpy | number : '1.2-2' }}</span\r\n >\r\n <span *ngIf=\"!fpx\">{{ 'common.not-set' | translate }}</span>\r\n <div class=\"flex mt-1\">\r\n <button\r\n class=\"button-small mr-1\"\r\n [disabled]=\"settingFocalPoint\"\r\n (click)=\"setFocalPointStart()\"\r\n >\r\n <ng-container *ngIf=\"!fpx\">{{ 'asset.set-focal-point' | translate }}</ng-container>\r\n <ng-container *ngIf=\"fpx\">{{ 'asset.update-focal-point' | translate }}</ng-container>\r\n </button>\r\n <button\r\n class=\"button-small\"\r\n [disabled]=\"settingFocalPoint\"\r\n *ngIf=\"!!fpx\"\r\n (click)=\"removeFocalPoint()\"\r\n >\r\n {{ 'asset.unset-focal-point' | translate }}\r\n </button>\r\n </div>\r\n </vdr-labeled-data>\r\n <vdr-labeled-data [label]=\"'common.tags' | translate\">\r\n <ng-container *ngIf=\"editable\">\r\n <vdr-tag-selector [formControl]=\"form.get('tags')\"></vdr-tag-selector>\r\n <button class=\"button-small mt-1\" (click)=\"manageTags()\">\r\n <clr-icon shape=\"tags\"></clr-icon>\r\n {{ 'common.manage-tags' | translate }}\r\n </button>\r\n </ng-container>\r\n <div *ngIf=\"!editable\">\r\n <vdr-chip *ngFor=\"let tag of asset.tags\" [colorFrom]=\"tag.value\">\r\n <clr-icon shape=\"tag\" class=\"mr2\"></clr-icon>\r\n {{ tag.value }}</vdr-chip\r\n >\r\n </div>\r\n </vdr-labeled-data>\r\n </vdr-card>\r\n <vdr-card *ngIf=\"customFields.length\" [title]=\"'common.custom-fields' | translate\">\r\n <vdr-tabbed-custom-fields\r\n entityName=\"Asset\"\r\n [compact]=\"true\"\r\n [customFields]=\"customFields\"\r\n [customFieldsFormGroup]=\"customFieldsForm\"\r\n [readonly]=\"!(['UpdateCatalog', 'UpdateAsset'] | hasPermission)\"\r\n ></vdr-tabbed-custom-fields>\r\n </vdr-card>\r\n <vdr-card [title]=\"'asset.preview' | translate\">\r\n <vdr-form-field>\r\n <select name=\"options\" [(ngModel)]=\"size\" [disabled]=\"settingFocalPoint\">\r\n <option value=\"tiny\">tiny</option>\r\n <option value=\"thumb\">thumb</option>\r\n <option value=\"small\">small</option>\r\n <option value=\"medium\">medium</option>\r\n <option value=\"large\">large</option>\r\n <option value=\"\">full size</option>\r\n </select>\r\n </vdr-form-field>\r\n <div class=\"asset-detail\">{{ width }} x {{ height }}</div>\r\n <vdr-asset-preview-links [asset]=\"asset\"></vdr-asset-preview-links>\r\n </vdr-card>\r\n <vdr-card>\r\n <vdr-page-entity-info *ngIf=\"asset as entity\" [entity]=\"entity\"></vdr-page-entity-info>\r\n </vdr-card>\r\n </vdr-page-detail-sidebar>\r\n <div class=\"carousel-container\">\r\n <button *ngIf=\"showSlideButtons\" (click)=\"previousImage()\" class=\"carousel-button\" [class.disabled]=\"disablePreviousButton\">\r\n <clr-icon shape=\"caret left\" class=\"color-weight-800\"></clr-icon>\r\n </button>\r\n <div class=\"preview-image\" #previewDiv [class.centered]=\"centered\">\r\n <div class=\"image-wrapper\">\r\n <vdr-focal-point-control\r\n [width]=\"width\"\r\n [height]=\"height\"\r\n [fpx]=\"fpx\"\r\n [fpy]=\"fpy\"\r\n [editable]=\"settingFocalPoint\"\r\n (focalPointChange)=\"onFocalPointChange($event)\"\r\n >\r\n <img\r\n class=\"asset-image\"\r\n [src]=\"asset | assetPreview : size\"\r\n [ngClass]=\"size\"\r\n #imageElement\r\n (load)=\"onImageLoad()\"\r\n />\r\n </vdr-focal-point-control>\r\n <div class=\"focal-point-info\" *ngIf=\"settingFocalPoint\">\r\n <button class=\"icon-button\" (click)=\"setFocalPointCancel()\">\r\n <clr-icon shape=\"times\"></clr-icon>\r\n </button>\r\n <button\r\n class=\"btn btn-primary btn-sm\"\r\n (click)=\"setFocalPointEnd()\"\r\n [disabled]=\"!lastFocalPoint\"\r\n >\r\n <clr-icon shape=\"crosshairs\"></clr-icon>\r\n {{ 'asset.set-focal-point' | translate }}\r\n </button>\r\n </div>\r\n </div>\r\n </div>\r\n <button *ngIf=\"showSlideButtons\" (click)=\"nextImage()\" class=\"carousel-button\" [class.disabled]=\"disableNextButton\">\r\n <clr-icon shape=\"caret right\" class=\"color-weight-800\"></clr-icon>\r\n </button>\r\n </div>\r\n</vdr-page-detail-layout>\r\n", styles: [":host{height:100%}.preview-image{width:100%;max-width:750px;height:100%;min-height:60vh;overflow:auto;text-align:center;box-shadow:inset 0 0 5px #0000001a;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAIAAACQkWg2AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAACuoAAArqAVDM774AAAAZdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuMTZEaa/1AAAAK0lEQVQ4T2P4jwP8xgFGNSADqDwGIF0DlMYAUH0YYFQDMoDKYwASNfz/DwB/JvcficphowAAAABJRU5ErkJggg==);margin-top:var(--space-unit);flex:1}.preview-image.centered{display:flex;align-items:center;justify-content:center}.preview-image vdr-focal-point-control{position:relative;box-shadow:0 0 10px -3px #00000026}.preview-image .image-wrapper{position:relative}.preview-image .asset-image{width:100%}.preview-image .asset-image.tiny{max-width:50px;max-height:50px}.preview-image .asset-image.thumb{max-width:150px;max-height:150px}.preview-image .asset-image.small{max-width:300px;max-height:300px}.preview-image .asset-image.medium{max-width:500px;max-height:500px}.preview-image .asset-image.large{max-width:800px;max-height:800px}.preview-image .focal-point-info{position:absolute;display:flex;right:0}.controls{display:flex;flex-direction:column;margin-inline-start:12px;min-width:15vw;max-width:25vw;transition:opacity .3s}.controls.fade{opacity:.5}.controls .name-input{margin-bottom:24px}.controls ::ng-deep .clr-control-container{width:100%}.controls ::ng-deep .clr-control-container .clr-input{width:100%}.controls .elide{overflow:hidden;white-space:nowrap;text-overflow:ellipsis;display:block}.controls .source-link{direction:rtl}.controls .preview-select{display:flex;align-items:center}.controls .preview-select clr-select-container{margin-inline-end:12px}.carousel-container{display:flex;flex-direction:row;justify-content:space-between;align-items:center}.carousel-container button.carousel-button{cursor:pointer;width:30px;height:30px;border:none;border-radius:50%;text-align:center;background-color:var(--color-grey-300)}.carousel-container button.carousel-button:hover{background-color:var(--color-grey-400)}.carousel-container .disabled{pointer-events:none;opacity:.4}\n"] }]
|
|
14136
13918
|
}], ctorParameters: function () { return [{ type: i1$4.FormBuilder }, { type: DataService }, { type: NotificationService }, { type: i0.ChangeDetectorRef }, { type: ModalService }]; }, propDecorators: { asset: [{
|
|
14137
13919
|
type: Input
|
|
14138
13920
|
}], assets: [{
|
|
@@ -20028,24 +19810,32 @@ class CoreModule {
|
|
|
20028
19810
|
this.alertsService = alertsService;
|
|
20029
19811
|
this.dataService = dataService;
|
|
20030
19812
|
this.notificationService = notificationService;
|
|
20031
|
-
this.
|
|
19813
|
+
this.initUiLanguagesAndLocales();
|
|
20032
19814
|
this.initUiTitle();
|
|
20033
19815
|
this.initAlerts();
|
|
20034
19816
|
}
|
|
20035
|
-
|
|
19817
|
+
initUiLanguagesAndLocales() {
|
|
20036
19818
|
const defaultLanguage = getDefaultUiLanguage();
|
|
19819
|
+
const defaultLocale = getDefaultUiLocale();
|
|
20037
19820
|
const lastLanguage = this.localStorageService.get('uiLanguageCode');
|
|
20038
19821
|
const availableLanguages = getAppConfig().availableLanguages;
|
|
20039
|
-
|
|
19822
|
+
const availableLocales = getAppConfig().availableLocales;
|
|
19823
|
+
if (!!defaultLanguage && !availableLanguages.includes(defaultLanguage)) {
|
|
20040
19824
|
throw new Error(`The defaultLanguage "${defaultLanguage}" must be one of the availableLanguages [${availableLanguages
|
|
20041
19825
|
.map(l => `"${l}"`)
|
|
20042
19826
|
.join(', ')}]`);
|
|
20043
19827
|
}
|
|
19828
|
+
if (!!defaultLocale && !availableLocales.includes(defaultLocale)) {
|
|
19829
|
+
throw new Error(`The defaultLocale "${defaultLocale}" must be one of the availableLocales [${availableLocales
|
|
19830
|
+
.map(l => `"${l}"`)
|
|
19831
|
+
.join(', ')}]`);
|
|
19832
|
+
}
|
|
20044
19833
|
const uiLanguage = lastLanguage && availableLanguages.includes(lastLanguage) ? lastLanguage : defaultLanguage;
|
|
20045
19834
|
this.localStorageService.set('uiLanguageCode', uiLanguage);
|
|
20046
19835
|
this.i18nService.setLanguage(uiLanguage);
|
|
20047
19836
|
this.i18nService.setDefaultLanguage(defaultLanguage);
|
|
20048
19837
|
this.i18nService.setAvailableLanguages(availableLanguages || [defaultLanguage]);
|
|
19838
|
+
this.i18nService.setAvailableLocales(availableLocales || [defaultLocale]);
|
|
20049
19839
|
}
|
|
20050
19840
|
initUiTitle() {
|
|
20051
19841
|
const title = getAppConfig().brand || 'Vendure';
|