@rs-pk/asset-management 1.0.13 → 1.0.14
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/bundles/rs-pk-asset-management.umd.js +128 -159
- package/bundles/rs-pk-asset-management.umd.js.map +1 -1
- package/bundles/rs-pk-asset-management.umd.min.js +2 -2
- package/bundles/rs-pk-asset-management.umd.min.js.map +1 -1
- package/esm2015/lib/components/partial/add-folder-dialog/add-folder-dialog.component.js +6 -3
- package/esm2015/lib/components/partial/asset-dialog/asset-dialog.component.js +3 -2
- package/esm2015/lib/components/partial/asset-item/asset-item.component.js +3 -3
- package/esm2015/lib/components/partial/edit-folder-dialog/edit-folder-dialog.component.js +6 -3
- package/esm2015/lib/components/partial/file-item/file-item.component.js +57 -18
- package/esm2015/lib/components/partial/file-list/file-list.component.js +10 -9
- package/esm2015/lib/components/partial/upload-file/upload-file.component.js +1 -18
- package/esm2015/lib/services/upload-assets.service.js +30 -61
- package/esm5/lib/components/partial/add-folder-dialog/add-folder-dialog.component.js +6 -3
- package/esm5/lib/components/partial/asset-dialog/asset-dialog.component.js +3 -2
- package/esm5/lib/components/partial/asset-item/asset-item.component.js +3 -3
- package/esm5/lib/components/partial/edit-folder-dialog/edit-folder-dialog.component.js +6 -3
- package/esm5/lib/components/partial/file-item/file-item.component.js +71 -22
- package/esm5/lib/components/partial/file-list/file-list.component.js +13 -13
- package/esm5/lib/components/partial/upload-file/upload-file.component.js +1 -29
- package/esm5/lib/services/upload-assets.service.js +33 -92
- package/fesm2015/rs-pk-asset-management.js +108 -109
- package/fesm2015/rs-pk-asset-management.js.map +1 -1
- package/fesm5/rs-pk-asset-management.js +129 -160
- package/fesm5/rs-pk-asset-management.js.map +1 -1
- package/lib/components/partial/file-item/file-item.component.d.ts +7 -3
- package/lib/components/partial/file-list/file-list.component.d.ts +5 -2
- package/lib/components/partial/upload-file/upload-file.component.d.ts +0 -2
- package/lib/services/upload-assets.service.d.ts +5 -15
- package/package.json +1 -1
- package/rs-pk-asset-management.metadata.json +1 -1
|
@@ -1164,8 +1164,7 @@ class UploadAssetsService {
|
|
|
1164
1164
|
this.dialog = dialog;
|
|
1165
1165
|
this._api = _api;
|
|
1166
1166
|
this.files = [];
|
|
1167
|
-
this.
|
|
1168
|
-
this.errorsMap = {};
|
|
1167
|
+
this.fileNames = [];
|
|
1169
1168
|
this.supportedSize = 10 * 1024 * 1024; // 10MB
|
|
1170
1169
|
// 10MB
|
|
1171
1170
|
this.documentExtension = ['.pdf'];
|
|
@@ -1182,6 +1181,7 @@ class UploadAssetsService {
|
|
|
1182
1181
|
size: `File size should be upto`,
|
|
1183
1182
|
ext: `Only supported file extension:`,
|
|
1184
1183
|
replace: `The replacement file should be the same extension with old one:`,
|
|
1184
|
+
maxLength: `The character limit is 200 characters`,
|
|
1185
1185
|
};
|
|
1186
1186
|
this.errorObs$ = new BehaviorSubject(true);
|
|
1187
1187
|
this.baseUrl = this._env.asset2Url;
|
|
@@ -1212,81 +1212,58 @@ class UploadAssetsService {
|
|
|
1212
1212
|
set setFiles(files) {
|
|
1213
1213
|
this.files = files;
|
|
1214
1214
|
}
|
|
1215
|
-
/**
|
|
1216
|
-
* @return {?}
|
|
1217
|
-
*/
|
|
1218
|
-
get nameFiles() {
|
|
1219
|
-
return this.namesMap;
|
|
1220
|
-
}
|
|
1221
|
-
/**
|
|
1222
|
-
* @param {?} newName
|
|
1223
|
-
* @return {?}
|
|
1224
|
-
*/
|
|
1225
|
-
set newName(newName) {
|
|
1226
|
-
this.namesMap = Object.assign({}, this.namesMap, newName);
|
|
1227
|
-
}
|
|
1228
1215
|
/**
|
|
1229
1216
|
* @return {?}
|
|
1230
1217
|
*/
|
|
1231
1218
|
get errorFiles() {
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
this.errorsMap = Object.assign({}, this.errorsMap, newError);
|
|
1240
|
-
}
|
|
1241
|
-
/**
|
|
1242
|
-
* @return {?}
|
|
1243
|
-
*/
|
|
1244
|
-
get fileErrors() {
|
|
1245
|
-
return this.errorsMap;
|
|
1219
|
+
/** @type {?} */
|
|
1220
|
+
const invalidFiles = this.fileNames.filter((/**
|
|
1221
|
+
* @param {?} file
|
|
1222
|
+
* @return {?}
|
|
1223
|
+
*/
|
|
1224
|
+
file => !file.valid));
|
|
1225
|
+
return this.fileNames.length && invalidFiles.length > 0;
|
|
1246
1226
|
}
|
|
1247
1227
|
/**
|
|
1248
1228
|
* @return {?}
|
|
1249
1229
|
*/
|
|
1250
1230
|
get errorLength() {
|
|
1251
|
-
return
|
|
1231
|
+
return this.fileNames.filter((/**
|
|
1232
|
+
* @param {?} file
|
|
1233
|
+
* @return {?}
|
|
1234
|
+
*/
|
|
1235
|
+
file => !file.valid)).length;
|
|
1252
1236
|
}
|
|
1253
1237
|
/**
|
|
1254
|
-
* @param {?} fileName
|
|
1255
1238
|
* @param {?} index
|
|
1256
1239
|
* @return {?}
|
|
1257
1240
|
*/
|
|
1258
|
-
deleteFile(
|
|
1259
|
-
this.files
|
|
1260
|
-
|
|
1261
|
-
* @param {?} i
|
|
1262
|
-
* @return {?}
|
|
1263
|
-
*/
|
|
1264
|
-
(_file, i) => i !== index));
|
|
1265
|
-
delete this.namesMap[fileName];
|
|
1266
|
-
delete this.errorsMap[fileName];
|
|
1241
|
+
deleteFile(index) {
|
|
1242
|
+
this.files.splice(index, 1);
|
|
1243
|
+
this.fileNames.splice(index, 1);
|
|
1267
1244
|
}
|
|
1268
1245
|
/**
|
|
1269
1246
|
* @param {?} parentAssetId
|
|
1270
1247
|
* @return {?}
|
|
1271
1248
|
*/
|
|
1272
1249
|
uploadMultipleAssets(parentAssetId) {
|
|
1273
|
-
const { files
|
|
1250
|
+
const { files } = this;
|
|
1251
|
+
/** @type {?} */
|
|
1252
|
+
const fileNames = this.fileNames.map((/**
|
|
1253
|
+
* @param {?} file
|
|
1254
|
+
* @return {?}
|
|
1255
|
+
*/
|
|
1256
|
+
file => file.name));
|
|
1274
1257
|
/** @type {?} */
|
|
1275
1258
|
const formData = new FormData();
|
|
1276
1259
|
formData.append('parentAssetId', parentAssetId);
|
|
1277
1260
|
formData.append('companyId', '732DA8D2-04EC-4BE0-A168-63EE0DCF50D8');
|
|
1278
|
-
for (
|
|
1261
|
+
for (let i = 0; i < files.length; i++) {
|
|
1279
1262
|
/** @type {?} */
|
|
1280
|
-
const nameSplit =
|
|
1263
|
+
const nameSplit = files[i].name.split('.');
|
|
1281
1264
|
/** @type {?} */
|
|
1282
1265
|
const ext = `.${nameSplit.splice(nameSplit.length - 1, 1)[0]}`;
|
|
1283
|
-
|
|
1284
|
-
const originName = file.name;
|
|
1285
|
-
/** @type {?} */
|
|
1286
|
-
const fileName = namesMap[originName]
|
|
1287
|
-
? `${namesMap[originName]}${ext}`
|
|
1288
|
-
: originName;
|
|
1289
|
-
formData.append('files', file, fileName);
|
|
1266
|
+
formData.append('files', files[i], `${fileNames[i]}${ext}`);
|
|
1290
1267
|
}
|
|
1291
1268
|
return this._api.post(`${this.baseUrl}/File/Upload`, formData);
|
|
1292
1269
|
}
|
|
@@ -1306,16 +1283,8 @@ if (false) {
|
|
|
1306
1283
|
* @private
|
|
1307
1284
|
*/
|
|
1308
1285
|
UploadAssetsService.prototype.files;
|
|
1309
|
-
/**
|
|
1310
|
-
|
|
1311
|
-
* @private
|
|
1312
|
-
*/
|
|
1313
|
-
UploadAssetsService.prototype.namesMap;
|
|
1314
|
-
/**
|
|
1315
|
-
* @type {?}
|
|
1316
|
-
* @private
|
|
1317
|
-
*/
|
|
1318
|
-
UploadAssetsService.prototype.errorsMap;
|
|
1286
|
+
/** @type {?} */
|
|
1287
|
+
UploadAssetsService.prototype.fileNames;
|
|
1319
1288
|
/** @type {?} */
|
|
1320
1289
|
UploadAssetsService.prototype.supportedSize;
|
|
1321
1290
|
/** @type {?} */
|
|
@@ -1972,6 +1941,7 @@ class FileItemComponent {
|
|
|
1972
1941
|
ext: '',
|
|
1973
1942
|
data: null,
|
|
1974
1943
|
errors: {
|
|
1944
|
+
maxLength: false,
|
|
1975
1945
|
ext: false,
|
|
1976
1946
|
size: false,
|
|
1977
1947
|
},
|
|
@@ -1981,33 +1951,54 @@ class FileItemComponent {
|
|
|
1981
1951
|
* @return {?}
|
|
1982
1952
|
*/
|
|
1983
1953
|
ngOnInit() {
|
|
1984
|
-
this.
|
|
1954
|
+
this.initDataFile();
|
|
1985
1955
|
}
|
|
1986
1956
|
/**
|
|
1987
1957
|
* @private
|
|
1988
|
-
* @param {?} file
|
|
1989
1958
|
* @return {?}
|
|
1990
1959
|
*/
|
|
1991
|
-
|
|
1992
|
-
|
|
1960
|
+
initDataFile() {
|
|
1961
|
+
this.setDetailsFile();
|
|
1962
|
+
this.setErrorFile();
|
|
1963
|
+
}
|
|
1964
|
+
/**
|
|
1965
|
+
* @private
|
|
1966
|
+
* @return {?}
|
|
1967
|
+
*/
|
|
1968
|
+
setDetailsFile() {
|
|
1969
|
+
const { name, size } = this.file;
|
|
1970
|
+
const { getFiles: files } = this.uploadAssetService;
|
|
1971
|
+
/** @type {?} */
|
|
1972
|
+
const names = files.filter((/**
|
|
1973
|
+
* @param {?} file
|
|
1974
|
+
* @return {?}
|
|
1975
|
+
*/
|
|
1976
|
+
file => file.name === name));
|
|
1993
1977
|
/** @type {?} */
|
|
1994
|
-
const nameSplit =
|
|
1978
|
+
const nameSplit = name.split('.');
|
|
1979
|
+
if (names.length > 1) {
|
|
1980
|
+
nameSplit[0] = `${nameSplit[0]}(${names.length - 1})`;
|
|
1981
|
+
}
|
|
1995
1982
|
this.dataFile.ext = nameSplit.splice(nameSplit.length - 1, 1)[0];
|
|
1996
1983
|
this.dataFile.name = nameSplit.join('.');
|
|
1997
|
-
this.dataFile.size =
|
|
1984
|
+
this.dataFile.size = size;
|
|
1985
|
+
}
|
|
1986
|
+
/**
|
|
1987
|
+
* @private
|
|
1988
|
+
* @return {?}
|
|
1989
|
+
*/
|
|
1990
|
+
setErrorFile() {
|
|
1991
|
+
const { supportedTypes, supportedSize, fileNames } = this.uploadAssetService;
|
|
1992
|
+
const { name, ext: extFile, size: sizeFile } = this.dataFile;
|
|
1998
1993
|
this.dataFile.errors = {
|
|
1999
|
-
|
|
2000
|
-
|
|
1994
|
+
maxLength: name.length + extFile.length > 199,
|
|
1995
|
+
ext: supportedTypes.indexOf(`.${extFile}`) < 0,
|
|
1996
|
+
size: supportedSize < sizeFile,
|
|
2001
1997
|
};
|
|
2002
|
-
|
|
2003
|
-
if (ext || size) {
|
|
2004
|
-
this.uploadAssetService.errors = { [file.name]: true };
|
|
2005
|
-
this.checkError.emit();
|
|
2006
|
-
}
|
|
2007
|
-
if (file.type.indexOf('image') > -1) {
|
|
1998
|
+
if (this.file.type.indexOf('image') > -1) {
|
|
2008
1999
|
/** @type {?} */
|
|
2009
2000
|
const reader = new FileReader();
|
|
2010
|
-
reader.readAsDataURL(file);
|
|
2001
|
+
reader.readAsDataURL(this.file);
|
|
2011
2002
|
reader.onload = (/**
|
|
2012
2003
|
* @param {?} readerEvent
|
|
2013
2004
|
* @return {?}
|
|
@@ -2024,15 +2015,32 @@ class FileItemComponent {
|
|
|
2024
2015
|
});
|
|
2025
2016
|
});
|
|
2026
2017
|
}
|
|
2018
|
+
fileNames.push({
|
|
2019
|
+
name,
|
|
2020
|
+
valid: this.checkErrors()
|
|
2021
|
+
});
|
|
2027
2022
|
this.uploadAssetService.setErrorObs(this.uploadAssetService.errorFiles);
|
|
2028
2023
|
}
|
|
2024
|
+
/**
|
|
2025
|
+
* @private
|
|
2026
|
+
* @return {?}
|
|
2027
|
+
*/
|
|
2028
|
+
checkErrors() {
|
|
2029
|
+
const { ext, size, maxLength } = this.dataFile.errors;
|
|
2030
|
+
return (ext || size || maxLength) ? false : true;
|
|
2031
|
+
}
|
|
2029
2032
|
/**
|
|
2030
2033
|
* @param {?} event
|
|
2031
2034
|
* @return {?}
|
|
2032
2035
|
*/
|
|
2033
2036
|
onChange(event) {
|
|
2034
2037
|
this.dataFile.name = ((/** @type {?} */ (event.target))).value.trim();
|
|
2035
|
-
this.
|
|
2038
|
+
const { name, ext } = this.dataFile;
|
|
2039
|
+
this.dataFile.errors.maxLength = name.length + ext.length > 199;
|
|
2040
|
+
this.fileChange.emit({
|
|
2041
|
+
name: this.dataFile.name,
|
|
2042
|
+
valid: this.checkErrors()
|
|
2043
|
+
});
|
|
2036
2044
|
}
|
|
2037
2045
|
/**
|
|
2038
2046
|
* @return {?}
|
|
@@ -2044,7 +2052,7 @@ class FileItemComponent {
|
|
|
2044
2052
|
FileItemComponent.decorators = [
|
|
2045
2053
|
{ type: Component, args: [{
|
|
2046
2054
|
selector: 'lib-file-item',
|
|
2047
|
-
template: "<div class=\"file-item__img\">\n <ng-container\n *ngIf=\"\n file.type.indexOf('image') > -1 || dataFile.ext === 'pdf';\n else defaultFile\n \"\n >\n <img\n [class.image]=\"file.type.indexOf('image') > -1\"\n *ngIf=\"dataFile.ext === 'pdf' || dataFile.data\"\n [src]=\"dataFile.ext === 'pdf' ? base64Pdf : dataFile.data\"\n />\n </ng-container>\n <ng-template #defaultFile>\n <mat-icon>attach_file</mat-icon>\n </ng-template>\n</div>\n<div class=\"file-item__content\">\n <input\n class=\"file-item__content--name\"\n matInput\n placeholder=\"Enter file name\"\n [value]=\"dataFile.name\"\n required\n (input)=\"onChange($event)\"\n />\n <div class=\"file-item__content--info\">\n <div class=\"file-item__content--info__item\">\n Extension: <span>{{ dataFile.ext }}</span>\n </div>\n <div class=\"file-item__content--info__item\">\n Size: <span>{{ dataFile.size | fileSize }}</span>\n </div>\n </div>\n <div *ngIf=\"dataFile.errors.ext\" class=\"file-item__error\">\n {{ uploadAssetService.messageErrors['ext'] }}\n {{ uploadAssetService.supportedTypes.join(', ') }}\n </div>\n <div *ngIf=\"dataFile.errors.size\" class=\"file-item__error\">\n {{ uploadAssetService.messageErrors['size'] }}\n {{ uploadAssetService.supportedSize | fileSize: 0 }}\n </div>\n</div>\n<div class=\"file-item__action\">\n <mat-icon (click)=\"onRemove()\">delete_outline</mat-icon>\n</div>\n",
|
|
2055
|
+
template: "<div class=\"file-item__img\">\n <ng-container\n *ngIf=\"\n file.type.indexOf('image') > -1 || dataFile.ext === 'pdf';\n else defaultFile\n \"\n >\n <img\n [class.image]=\"file.type.indexOf('image') > -1\"\n *ngIf=\"dataFile.ext === 'pdf' || dataFile.data\"\n [src]=\"dataFile.ext === 'pdf' ? base64Pdf : dataFile.data\"\n />\n </ng-container>\n <ng-template #defaultFile>\n <mat-icon>attach_file</mat-icon>\n </ng-template>\n</div>\n<div class=\"file-item__content\">\n <input\n class=\"file-item__content--name\"\n matInput\n placeholder=\"Enter file name\"\n [value]=\"dataFile.name\"\n required\n (input)=\"onChange($event)\"\n />\n <div class=\"file-item__content--info\">\n <div class=\"file-item__content--info__item\">\n Extension: <span>{{ dataFile.ext }}</span>\n </div>\n <div class=\"file-item__content--info__item\">\n Size: <span>{{ dataFile.size | fileSize }}</span>\n </div>\n </div>\n <div *ngIf=\"dataFile.errors.ext\" class=\"file-item__error\">\n {{ uploadAssetService.messageErrors['ext'] }}\n {{ uploadAssetService.supportedTypes.join(', ') }}\n </div>\n <div *ngIf=\"dataFile.errors.size\" class=\"file-item__error\">\n {{ uploadAssetService.messageErrors['size'] }}\n {{ uploadAssetService.supportedSize | fileSize: 0 }}\n </div>\n <div *ngIf=\"dataFile.errors.maxLength\" class=\"file-item__error\">\n {{ uploadAssetService.messageErrors['maxLength'] }}\n </div>\n</div>\n<div class=\"file-item__action\">\n <mat-icon (click)=\"onRemove()\">delete_outline</mat-icon>\n</div>\n",
|
|
2048
2056
|
styles: [":host::ng-deep{padding:10px 5%;display:flex;justify-content:space-between;align-items:center;background-color:#f9f9f9;border-radius:10px}:host::ng-deep .file-item__img{display:flex;justify-content:center;align-items:center;width:250px;height:150px;border-radius:10px}:host::ng-deep .file-item__img img{max-width:100%;max-height:100%;-o-object-fit:contain;object-fit:contain}:host::ng-deep .file-item__img img.image{background-image:url(data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEBLAEsAAD/2wBDAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQH/2wBDAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQH/wAARCAAUABQDASIAAhEBAxEB/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx8vP09fb3+Pn6/8QAHwEAAwEBAQEBAQEBAQAAAAAAAAECAwQFBgcICQoL/8QAtREAAgECBAQDBAcFBAQAAQJ3AAECAxEEBSExBhJBUQdhcRMiMoEIFEKRobHBCSMzUvAVYnLRChYkNOEl8RcYGRomJygpKjU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6goOEhYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3uLm6wsPExcbHyMnK0tPU1dbX2Nna4uPk5ebn6Onq8vP09fb3+Pn6/9oADAMBAAIRAxEAPwD+/ivFPFOf+EjvxzjbBgdv+PeDp+OfxzSt4q18AkageASB9ntu3OM+Vn8c5rsdG0fT9d06DVdUgN1f3XmefP5ksO/ypXhj/dwvHGu2ONF+VF3bQSM0AeYUV7IPCWgjgWRA/wCvi4P85SaKAPGm5Vh7H+VeyeERjQLEDoPP/WeQ/wAzRRQB0tFFFAH/2Q==)}:host::ng-deep .file-item__img mat-icon{font-size:100px;width:auto;height:auto}:host::ng-deep .file-item__content{flex:1;padding-left:5%;padding-right:5%}:host::ng-deep .file-item__content--name{width:100%;padding:10px;border:1px solid #d8d8d8;border-radius:5px}:host::ng-deep .file-item__content--info{margin-top:10px;display:flex}:host::ng-deep .file-item__content--info__item:not(:last-child){margin-right:50px}:host::ng-deep .file-item__content--info__item span{color:#000;text-transform:uppercase}:host::ng-deep .file-item__error{margin-top:10px;color:#f44336}:host::ng-deep .file-item__action{color:#f44336;cursor:pointer}"]
|
|
2049
2057
|
}] }
|
|
2050
2058
|
];
|
|
@@ -2107,21 +2115,22 @@ class FileListComponent {
|
|
|
2107
2115
|
((/** @type {?} */ (document.getElementById('file-import')))).value = '';
|
|
2108
2116
|
}
|
|
2109
2117
|
/**
|
|
2110
|
-
* @param {?} fileName
|
|
2111
2118
|
* @param {?} index
|
|
2112
2119
|
* @return {?}
|
|
2113
2120
|
*/
|
|
2114
|
-
onDelFile(
|
|
2115
|
-
this.uploadAssetsService.deleteFile(
|
|
2121
|
+
onDelFile(index) {
|
|
2122
|
+
this.uploadAssetsService.deleteFile(index);
|
|
2116
2123
|
this.revalidate.emit(this.uploadAssetsService.errorFiles);
|
|
2117
2124
|
}
|
|
2118
2125
|
/**
|
|
2119
|
-
* @param {?}
|
|
2120
|
-
* @param {?}
|
|
2126
|
+
* @param {?} __0
|
|
2127
|
+
* @param {?} index
|
|
2121
2128
|
* @return {?}
|
|
2122
2129
|
*/
|
|
2123
|
-
onChangeName(
|
|
2124
|
-
|
|
2130
|
+
onChangeName({ name, valid }, index) {
|
|
2131
|
+
const { fileNames } = this.uploadAssetsService;
|
|
2132
|
+
fileNames[index] = { name, valid };
|
|
2133
|
+
this.uploadAssetsService.setErrorObs(this.uploadAssetsService.errorFiles);
|
|
2125
2134
|
}
|
|
2126
2135
|
/**
|
|
2127
2136
|
* @return {?}
|
|
@@ -2133,7 +2142,7 @@ class FileListComponent {
|
|
|
2133
2142
|
FileListComponent.decorators = [
|
|
2134
2143
|
{ type: Component, args: [{
|
|
2135
2144
|
selector: 'lib-file-list',
|
|
2136
|
-
template: "<div class=\"file-list__heading\">\n <div class=\"file-list__info\">\n <h4 class=\"file-list__info--title\">\n <span *ngIf=\"!uploadAssetsService.errorLength\">\n {{\n uploadAssetsService?.getFiles?.length -\n uploadAssetsService.errorLength\n }}\n {{ uploadAssetsService?.getFiles?.length > 1 ? 'assets' : 'asset' }}\n ready to upload\n </span>\n <span *ngIf=\"uploadAssetsService.errorLength\">\n {{ uploadAssetsService.errorLength }}\n {{ uploadAssetsService.errorLength > 1 ? 'assets' : 'asset' }}\n invalid, please remove it before upload</span\n >\n </h4>\n <div class=\"file-list__info--desc\">\n Manage the assets before adding them to the Media Library\n </div>\n </div>\n <lib-input-file\n [acceptTypes]=\"uploadAssetsService?.supportedTypes?.join(', ')\"\n (onFileChange)=\"onFileChange($event)\"\n color=\"primary\"\n >\n <span>Add new assets</span>\n </lib-input-file>\n</div>\n<div class=\"file-list\">\n <lib-file-item\n *ngFor=\"let file of uploadAssetsService?.getFiles; let i = index\"\n [file]=\"file\"\n (checkError)=\"onEmitError()\"\n (fileRemove)=\"onDelFile(
|
|
2145
|
+
template: "<div class=\"file-list__heading\">\n <div class=\"file-list__info\">\n <h4 class=\"file-list__info--title\">\n <span *ngIf=\"!uploadAssetsService.errorLength\">\n {{\n uploadAssetsService?.getFiles?.length -\n uploadAssetsService.errorLength\n }}\n {{ uploadAssetsService?.getFiles?.length > 1 ? 'assets' : 'asset' }}\n ready to upload\n </span>\n <span *ngIf=\"uploadAssetsService.errorLength\">\n {{ uploadAssetsService.errorLength }}\n {{ uploadAssetsService.errorLength > 1 ? 'assets' : 'asset' }}\n invalid, please remove it before upload</span\n >\n </h4>\n <div class=\"file-list__info--desc\">\n Manage the assets before adding them to the Media Library\n </div>\n </div>\n <lib-input-file\n [acceptTypes]=\"uploadAssetsService?.supportedTypes?.join(', ')\"\n (onFileChange)=\"onFileChange($event)\"\n color=\"primary\"\n >\n <span>Add new assets</span>\n </lib-input-file>\n</div>\n<div class=\"file-list\">\n <lib-file-item\n *ngFor=\"let file of uploadAssetsService?.getFiles; let i = index\"\n [file]=\"file\"\n (checkError)=\"onEmitError()\"\n (fileRemove)=\"onDelFile(i)\"\n (fileChange)=\"onChangeName($event, i)\"\n ></lib-file-item>\n</div>\n",
|
|
2137
2146
|
styles: [":host::ng-deep .file-list{padding-top:15px}:host::ng-deep .file-list__heading{display:flex;justify-content:space-between;align-items:center;padding-top:15px;padding-bottom:15px;position:-webkit-sticky;position:sticky;top:0;background-color:#fff}:host::ng-deep .file-list__info--title{font-size:16px;margin-bottom:5px;color:#000}:host::ng-deep lib-file-item{margin-bottom:20px}"]
|
|
2138
2147
|
}] }
|
|
2139
2148
|
];
|
|
@@ -2171,23 +2180,6 @@ class UploadFileComponent {
|
|
|
2171
2180
|
* @return {?}
|
|
2172
2181
|
*/
|
|
2173
2182
|
ngOnInit() { }
|
|
2174
|
-
/**
|
|
2175
|
-
* @param {?} fileName
|
|
2176
|
-
* @param {?} index
|
|
2177
|
-
* @return {?}
|
|
2178
|
-
*/
|
|
2179
|
-
onDelFile(fileName, index) {
|
|
2180
|
-
this.uploadAssetsService.deleteFile(fileName, index);
|
|
2181
|
-
this.revalidate.emit(this.uploadAssetsService.errorFiles);
|
|
2182
|
-
}
|
|
2183
|
-
/**
|
|
2184
|
-
* @param {?} newName
|
|
2185
|
-
* @param {?} originName
|
|
2186
|
-
* @return {?}
|
|
2187
|
-
*/
|
|
2188
|
-
onChangeName(newName, originName) {
|
|
2189
|
-
this.uploadAssetsService.newName = { [originName]: newName };
|
|
2190
|
-
}
|
|
2191
2183
|
/**
|
|
2192
2184
|
* @param {?} newFiles
|
|
2193
2185
|
* @return {?}
|
|
@@ -2279,7 +2271,10 @@ class AddFolderDialogComponent {
|
|
|
2279
2271
|
this.destroy$ = new Subject();
|
|
2280
2272
|
this.form = new FormControl();
|
|
2281
2273
|
this.formGroup = this.fb.group({
|
|
2282
|
-
name: ['',
|
|
2274
|
+
name: ['', [
|
|
2275
|
+
Validators.maxLength(200),
|
|
2276
|
+
Validators.required
|
|
2277
|
+
]],
|
|
2283
2278
|
});
|
|
2284
2279
|
}
|
|
2285
2280
|
/**
|
|
@@ -2343,7 +2338,7 @@ class AddFolderDialogComponent {
|
|
|
2343
2338
|
AddFolderDialogComponent.decorators = [
|
|
2344
2339
|
{ type: Component, args: [{
|
|
2345
2340
|
selector: 'lib-add-folder-dialog',
|
|
2346
|
-
template: "<lib-modal heading=\"Add a folder\">\n <ng-container content>\n <form (ngSubmit)=\"addFolder()\" [formGroup]=\"formGroup\" #form=\"ngForm\">\n <input\n (input)=\"onChange($event)\"\n matInput\n placeholder=\"Enter your folder name\"\n autocomplete=\"off\"\n required\n pattern=\".*\\S+.*\"\n formControlName=\"name\"\n />\n <mat-error *ngIf=\"formGroup?.controls?.name?.errors?.pattern\">\n This field does not allow only whitespace\n </mat-error>\n <mat-error *ngIf=\"errorMessage\">{{ errorMessage }}</mat-error>\n </form>\n </ng-container>\n <ng-container actions>\n <button mat-raised-button mat-dialog-close>Cancel</button>\n <button\n mat-raised-button\n color=\"primary\"\n (click)=\"addFolder()\"\n [class.loading]=\"isLoading\"\n [disabled]=\"disabled || formGroup?.
|
|
2341
|
+
template: "<lib-modal heading=\"Add a folder\">\n <ng-container content>\n <form (ngSubmit)=\"addFolder()\" [formGroup]=\"formGroup\" #form=\"ngForm\">\n <input\n (input)=\"onChange($event)\"\n matInput\n placeholder=\"Enter your folder name\"\n autocomplete=\"off\"\n required\n pattern=\".*\\S+.*\"\n formControlName=\"name\"\n />\n <mat-error *ngIf=\"formGroup?.controls?.name?.errors?.pattern\">\n This field does not allow only whitespace\n </mat-error>\n <mat-error *ngIf=\"formGroup?.controls?.name?.errors?.maxlength\">\n The character limit is 200 characters\n </mat-error>\n <mat-error *ngIf=\"errorMessage\">{{ errorMessage }}</mat-error>\n </form>\n </ng-container>\n <ng-container actions>\n <button mat-raised-button mat-dialog-close>Cancel</button>\n <button\n mat-raised-button\n color=\"primary\"\n (click)=\"addFolder()\"\n [class.loading]=\"isLoading\"\n [disabled]=\"disabled || !formGroup?.valid\"\n >\n <ng-container *ngIf=\"isLoading\">\n <mat-spinner [diameter]=\"20\"></mat-spinner>\n </ng-container>\n <span>Add</span>\n </button>\n </ng-container>\n</lib-modal>\n",
|
|
2347
2342
|
styles: [":host::ng-deep .mat-dialog-title{padding-bottom:0!important}:host::ng-deep form{position:relative}:host::ng-deep form .mat-error{margin-top:0;position:absolute;left:0;bottom:-20px;line-height:15px;font-size:13px}:host::ng-deep .mat-dialog-content{padding-top:24px;padding-bottom:24px}:host::ng-deep .mat-dialog-actions{padding-top:5px}"]
|
|
2348
2343
|
}] }
|
|
2349
2344
|
];
|
|
@@ -2418,7 +2413,10 @@ class EditFolderDialogComponent {
|
|
|
2418
2413
|
this.destroy$ = new Subject();
|
|
2419
2414
|
this.form = new FormControl();
|
|
2420
2415
|
this.formGroup = this.fb.group({
|
|
2421
|
-
name: [this.data.name,
|
|
2416
|
+
name: [this.data.name, [
|
|
2417
|
+
Validators.maxLength(200),
|
|
2418
|
+
Validators.required
|
|
2419
|
+
]],
|
|
2422
2420
|
});
|
|
2423
2421
|
}
|
|
2424
2422
|
/**
|
|
@@ -2485,7 +2483,7 @@ class EditFolderDialogComponent {
|
|
|
2485
2483
|
EditFolderDialogComponent.decorators = [
|
|
2486
2484
|
{ type: Component, args: [{
|
|
2487
2485
|
selector: 'lib-edit-folder-dialog',
|
|
2488
|
-
template: "<lib-modal heading=\"Rename folder\">\n <ng-container content>\n <form (ngSubmit)=\"editFolder()\" [formGroup]=\"formGroup\" #form=\"ngForm\">\n <input\n matInput\n required\n autocomplete=\"off\"\n formControlName=\"name\"\n (input)=\"onChange($event)\"\n placeholder=\"Enter your folder name\"\n pattern=\".*\\S+.*\"\n />\n <mat-error *ngIf=\"formGroup?.controls?.name?.errors?.pattern\">\n This field does not allow only whitespace\n </mat-error>\n <mat-error *ngIf=\"errorMessage\">{{ errorMessage }}</mat-error>\n </form>\n </ng-container>\n <ng-container actions>\n <button mat-raised-button mat-dialog-close>Cancel</button>\n <button\n mat-raised-button\n color=\"primary\"\n (click)=\"editFolder()\"\n [class.loading]=\"isLoading\"\n [disabled]=\"disabled || formGroup?.controls?.name?.errors?.pattern\"\n >\n <ng-container *ngIf=\"isLoading\">\n <mat-spinner [diameter]=\"20\"></mat-spinner>\n </ng-container>\n <span>Update</span>\n </button>\n </ng-container>\n</lib-modal>\n",
|
|
2486
|
+
template: "<lib-modal heading=\"Rename folder\">\n <ng-container content>\n <form (ngSubmit)=\"editFolder()\" [formGroup]=\"formGroup\" #form=\"ngForm\">\n <input\n matInput\n required\n autocomplete=\"off\"\n formControlName=\"name\"\n (input)=\"onChange($event)\"\n placeholder=\"Enter your folder name\"\n pattern=\".*\\S+.*\"\n />\n <mat-error *ngIf=\"formGroup?.controls?.name?.errors?.pattern\">\n This field does not allow only whitespace\n </mat-error>\n <mat-error *ngIf=\"formGroup?.controls?.name?.errors?.maxlength\">\n The character limit is 200 characters\n </mat-error>\n <mat-error *ngIf=\"errorMessage\">{{ errorMessage }}</mat-error>\n </form>\n </ng-container>\n <ng-container actions>\n <button mat-raised-button mat-dialog-close>Cancel</button>\n <button\n mat-raised-button\n color=\"primary\"\n (click)=\"editFolder()\"\n [class.loading]=\"isLoading\"\n [disabled]=\"disabled || formGroup?.controls?.name?.errors?.pattern\"\n >\n <ng-container *ngIf=\"isLoading\">\n <mat-spinner [diameter]=\"20\"></mat-spinner>\n </ng-container>\n <span>Update</span>\n </button>\n </ng-container>\n</lib-modal>\n",
|
|
2489
2487
|
styles: [":host::ng-deep .mat-dialog-title{padding-bottom:0!important}:host::ng-deep form{position:relative}:host::ng-deep form .mat-error{margin-top:0;position:absolute;left:0;bottom:-20px;line-height:15px;font-size:13px}:host::ng-deep .mat-dialog-content{padding-top:24px;padding-bottom:24px}:host::ng-deep .mat-dialog-actions{padding-top:5px}"]
|
|
2490
2488
|
}] }
|
|
2491
2489
|
];
|
|
@@ -3307,6 +3305,7 @@ class AssetDialogComponent {
|
|
|
3307
3305
|
*/
|
|
3308
3306
|
get disabled() {
|
|
3309
3307
|
return (!this.fileName.length ||
|
|
3308
|
+
this.fileName.length + this.assetDetails.Extension.length > 199 || // limit 200
|
|
3310
3309
|
!!this.errorMessage ||
|
|
3311
3310
|
this.patternError ||
|
|
3312
3311
|
this.isUpdating);
|
|
@@ -3522,7 +3521,7 @@ class AssetDialogComponent {
|
|
|
3522
3521
|
AssetDialogComponent.decorators = [
|
|
3523
3522
|
{ type: Component, args: [{
|
|
3524
3523
|
selector: 'lib-asset-dialog',
|
|
3525
|
-
template: "<lib-modal\n [heading]=\"assetDetails?.OriginalFileNameWithoutExtension || data?.name\"\n>\n <ng-container content>\n <div *ngIf=\"isLoading; else contentAsset\" class=\"file-details__loading\">\n <div>\n <mat-spinner></mat-spinner>\n </div>\n </div>\n </ng-container>\n <ng-container actions>\n <button mat-raised-button mat-dialog-close>Cancel</button>\n <button\n class=\"update__action\"\n [class.loading]=\"isUpdating\"\n mat-raised-button\n color=\"primary\"\n (click)=\"updateAsset()\"\n [disabled]=\"disabled\"\n >\n <ng-container *ngIf=\"isUpdating\">\n <mat-spinner [diameter]=\"20\"></mat-spinner>\n </ng-container>\n <span>Update</span>\n </button>\n </ng-container>\n</lib-modal>\n<ng-template #contentAsset>\n <div class=\"file-details__item\">\n <div class=\"file-details__image\">\n <div class=\"file-details__image--heading\">\n <mat-error\n *ngIf=\"replaceMessage\"\n [innerHTML]=\"replaceMessage\"\n ></mat-error>\n <div class=\"file-details__action\">\n <lib-input-file\n matTooltip=\"Replace\"\n [acceptTypes]=\"acceptTypes.join(', ')\"\n (onFileChange)=\"replaceAsset($event)\"\n [multiple]=\"false\"\n >\n <mat-icon class=\"icon-sync\">sync</mat-icon>\n </lib-input-file>\n <a [href]=\"linkDownload\" matTooltip=\"Download\" mat-raised-button>\n <mat-icon class=\"icon-download\">get_app</mat-icon>\n </a>\n <button matTooltip=\"Delete\" mat-raised-button (click)=\"deleteAsset()\">\n <mat-icon class=\"icon-delete\">delete_outline</mat-icon>\n </button>\n </div>\n </div>\n <div class=\"file-details__img\">\n <ng-container\n *ngIf=\"\n assetDetails?.FileType === fileType.DOCUMENT ||\n assetDetails?.FileType === fileType.IMAGE;\n else defaultFile\n \"\n >\n <img\n [class.image]=\"assetDetails?.FileType === fileType.IMAGE\"\n [src]=\"\n assetDetails?.FileType === fileType.IMAGE\n ? assetDetails?.UrlDetail\n : base64Pdf\n \"\n [alt]=\"assetDetails?.FilePath\"\n />\n </ng-container>\n <ng-template #defaultFile>\n <mat-icon>attach_file</mat-icon>\n </ng-template>\n </div>\n </div>\n </div>\n <div class=\"file-details__item\">\n <div class=\"file-details__info\">\n <div class=\"file-details__info--name\">\n <div class=\"file-details__label\">File name</div>\n <input\n class=\"file-details__input\"\n matInput\n placeholder=\"Enter your folder name\"\n [value]=\"fileName\"\n required\n (input)=\"onChangeName($event)\"\n />\n <mat-error *ngIf=\"errorMessage\">{{ errorMessage }}</mat-error>\n <mat-error *ngIf=\"patternError\">\n This field does not allow only whitespace\n </mat-error>\n </div>\n <div class=\"file-details__info--description\">\n <div class=\"file-details__label\">Description</div>\n <textarea\n class=\"file-details__textarea custom-scrollbar\"\n matInput\n placeholder=\"Enter description\"\n [value]=\"description\"\n (input)=\"onChangeDescription($event)\"\n maxlength=\"200\"\n rows=\"3\"\n >\n </textarea>\n </div>\n\n <div class=\"file-details__info--details\">\n <div class=\"file-details__info--size\">\n <div class=\"file-details__label\">Size</div>\n <div>{{ assetDetails?.Size }}</div>\n </div>\n <div class=\"file-details__info--ext\">\n <div class=\"file-details__label\">Extension</div>\n <div>{{ assetDetails?.Extension }}</div>\n </div>\n <div class=\"file-details__info--date\">\n <div class=\"file-details__label\">Created date</div>\n <div>{{ assetDetails?.CreatedDate | localDate }}</div>\n </div>\n <div class=\"file-details__info--date\">\n <div class=\"file-details__label\">Updated date</div>\n <div>\n {{ assetDetails?.ModifiedDate | localDate }}\n </div>\n </div>\n <div\n *ngIf=\"\n assetDetails?.FileType === fileType.IMAGE &&\n assetDetails?.Extension !== 'svg'\n \"\n class=\"file-details__info--dimension\"\n >\n <div class=\"file-details__label\">Dimensions</div>\n <div>{{ assetDetails?.Width }}x{{ assetDetails?.Height }}</div>\n </div>\n </div>\n <div class=\"file-details__link\">\n <div class=\"file-details__label\">Public Url</div>\n <div class=\"break-word\">\n <span>{{ assetDetails?.CloudUrl }} </span>\n <mat-icon matTooltip=\"Copy\" (click)=\"copyText(assetDetails?.CloudUrl)\"\n >content_copy</mat-icon\n >\n </div>\n </div>\n <span class=\"file-details__copy\" [class.visible]=\"isCopied\">Copied!</span>\n </div>\n </div>\n</ng-template>\n",
|
|
3524
|
+
template: "<lib-modal\n [heading]=\"assetDetails?.OriginalFileNameWithoutExtension || data?.name\"\n>\n <ng-container content>\n <div *ngIf=\"isLoading; else contentAsset\" class=\"file-details__loading\">\n <div>\n <mat-spinner></mat-spinner>\n </div>\n </div>\n </ng-container>\n <ng-container actions>\n <button mat-raised-button mat-dialog-close>Cancel</button>\n <button\n class=\"update__action\"\n [class.loading]=\"isUpdating\"\n mat-raised-button\n color=\"primary\"\n (click)=\"updateAsset()\"\n [disabled]=\"disabled\"\n >\n <ng-container *ngIf=\"isUpdating\">\n <mat-spinner [diameter]=\"20\"></mat-spinner>\n </ng-container>\n <span>Update</span>\n </button>\n </ng-container>\n</lib-modal>\n<ng-template #contentAsset>\n <div class=\"file-details__item\">\n <div class=\"file-details__image\">\n <div class=\"file-details__image--heading\">\n <mat-error\n *ngIf=\"replaceMessage\"\n [innerHTML]=\"replaceMessage\"\n ></mat-error>\n <div class=\"file-details__action\">\n <lib-input-file\n matTooltip=\"Replace\"\n [acceptTypes]=\"acceptTypes.join(', ')\"\n (onFileChange)=\"replaceAsset($event)\"\n [multiple]=\"false\"\n >\n <mat-icon class=\"icon-sync\">sync</mat-icon>\n </lib-input-file>\n <a [href]=\"linkDownload\" matTooltip=\"Download\" mat-raised-button>\n <mat-icon class=\"icon-download\">get_app</mat-icon>\n </a>\n <button matTooltip=\"Delete\" mat-raised-button (click)=\"deleteAsset()\">\n <mat-icon class=\"icon-delete\">delete_outline</mat-icon>\n </button>\n </div>\n </div>\n <div class=\"file-details__img\">\n <ng-container\n *ngIf=\"\n assetDetails?.FileType === fileType.DOCUMENT ||\n assetDetails?.FileType === fileType.IMAGE;\n else defaultFile\n \"\n >\n <img\n [class.image]=\"assetDetails?.FileType === fileType.IMAGE\"\n [src]=\"\n assetDetails?.FileType === fileType.IMAGE\n ? assetDetails?.UrlDetail\n : base64Pdf\n \"\n [alt]=\"assetDetails?.FilePath\"\n />\n </ng-container>\n <ng-template #defaultFile>\n <mat-icon>attach_file</mat-icon>\n </ng-template>\n </div>\n </div>\n </div>\n <div class=\"file-details__item\">\n <div class=\"file-details__info\">\n <div class=\"file-details__info--name\">\n <div class=\"file-details__label\">File name</div>\n <input\n class=\"file-details__input\"\n matInput\n placeholder=\"Enter your folder name\"\n [value]=\"fileName\"\n required\n (input)=\"onChangeName($event)\"\n />\n <mat-error *ngIf=\"errorMessage\">{{ errorMessage }}</mat-error>\n <mat-error *ngIf=\"patternError\">\n This field does not allow only whitespace\n </mat-error>\n <mat-error *ngIf=\"fileName?.length + assetDetails.Extension.length > 199\">\n The character limit is 200 characters\n </mat-error>\n </div>\n <div class=\"file-details__info--description\">\n <div class=\"file-details__label\">Description</div>\n <textarea\n class=\"file-details__textarea custom-scrollbar\"\n matInput\n placeholder=\"Enter description\"\n [value]=\"description\"\n (input)=\"onChangeDescription($event)\"\n maxlength=\"200\"\n rows=\"3\"\n >\n </textarea>\n </div>\n\n <div class=\"file-details__info--details\">\n <div class=\"file-details__info--size\">\n <div class=\"file-details__label\">Size</div>\n <div>{{ assetDetails?.Size }}</div>\n </div>\n <div class=\"file-details__info--ext\">\n <div class=\"file-details__label\">Extension</div>\n <div>{{ assetDetails?.Extension }}</div>\n </div>\n <div class=\"file-details__info--date\">\n <div class=\"file-details__label\">Created date</div>\n <div>{{ assetDetails?.CreatedDate | localDate }}</div>\n </div>\n <div class=\"file-details__info--date\">\n <div class=\"file-details__label\">Updated date</div>\n <div>\n {{ assetDetails?.ModifiedDate | localDate }}\n </div>\n </div>\n <div\n *ngIf=\"\n assetDetails?.FileType === fileType.IMAGE &&\n assetDetails?.Extension !== 'svg'\n \"\n class=\"file-details__info--dimension\"\n >\n <div class=\"file-details__label\">Dimensions</div>\n <div>{{ assetDetails?.Width }}x{{ assetDetails?.Height }}</div>\n </div>\n </div>\n <div class=\"file-details__link\">\n <div class=\"file-details__label\">Public Url</div>\n <div class=\"break-word\">\n <span>{{ assetDetails?.CloudUrl }} </span>\n <mat-icon matTooltip=\"Copy\" (click)=\"copyText(assetDetails?.CloudUrl)\"\n >content_copy</mat-icon\n >\n </div>\n </div>\n <span class=\"file-details__copy\" [class.visible]=\"isCopied\">Copied!</span>\n </div>\n </div>\n</ng-template>\n",
|
|
3526
3525
|
providers: [FileSizePipe],
|
|
3527
3526
|
styles: [":host::ng-deep .mat-dialog-content{position:relative;display:flex;flex:1;justify-content:space-between;align-items:flex-start;font-size:14px;line-height:24px;color:#000;min-height:400px}:host::ng-deep .file-details__loading{position:absolute;top:0;left:0;width:100%;height:100%;display:flex;justify-content:center;align-items:center;z-index:1}:host::ng-deep .file-details__item{width:50%;padding:20px 10px;position:relative}:host::ng-deep .file-details__image{padding:20px;background:#f9f9f9;border:1px solid #e0e0e0;border-radius:10px}:host::ng-deep .file-details__image--heading{display:flex;justify-content:flex-end}:host::ng-deep .file-details__image--heading .mat-error{flex:1;margin-top:0}:host::ng-deep .file-details__action{margin-bottom:20px}:host::ng-deep .file-details__action>*{margin-left:10px}:host::ng-deep .file-details__action .mat-button-base{padding:0;min-width:40px}:host::ng-deep .file-details__action .icon-download,:host::ng-deep .file-details__action .icon-sync{color:#979797}:host::ng-deep .file-details__action .icon-delete{color:#f44336}:host::ng-deep .file-details__img{position:relative;padding-bottom:66.66%;text-align:center}:host::ng-deep .file-details__img img{max-width:100%;max-height:100%;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}:host::ng-deep .file-details__img img.image{background-image:url(data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEBLAEsAAD/2wBDAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQH/2wBDAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQH/wAARCAAUABQDASIAAhEBAxEB/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx8vP09fb3+Pn6/8QAHwEAAwEBAQEBAQEBAQAAAAAAAAECAwQFBgcICQoL/8QAtREAAgECBAQDBAcFBAQAAQJ3AAECAxEEBSExBhJBUQdhcRMiMoEIFEKRobHBCSMzUvAVYnLRChYkNOEl8RcYGRomJygpKjU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6goOEhYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3uLm6wsPExcbHyMnK0tPU1dbX2Nna4uPk5ebn6Onq8vP09fb3+Pn6/9oADAMBAAIRAxEAPwD+/ivFPFOf+EjvxzjbBgdv+PeDp+OfxzSt4q18AkageASB9ntu3OM+Vn8c5rsdG0fT9d06DVdUgN1f3XmefP5ksO/ypXhj/dwvHGu2ONF+VF3bQSM0AeYUV7IPCWgjgWRA/wCvi4P85SaKAPGm5Vh7H+VeyeERjQLEDoPP/WeQ/wAzRRQB0tFFFAH/2Q==)}:host::ng-deep .file-details__img mat-icon{font-size:100px;width:auto;height:auto}:host::ng-deep .file-details__info{position:relative}:host::ng-deep .file-details__info--name{padding-bottom:20px;position:relative}:host::ng-deep .file-details__info--name .mat-error{margin-top:0;position:absolute;left:0;bottom:0;font-size:13px;line-height:20px}:host::ng-deep .file-details__info--description{padding-bottom:10px}:host::ng-deep .file-details__info--details{display:flex;flex-wrap:wrap;flex:1}:host::ng-deep .file-details__info--details>*{width:50%;margin-top:10px}:host::ng-deep .file-details__input,:host::ng-deep .file-details__textarea{margin-top:7px}:host::ng-deep .file-details__link{margin-top:15px}:host::ng-deep .file-details__link .mat-icon{font-size:16px;cursor:pointer}:host::ng-deep .file-details__label{color:#979797}:host::ng-deep .file-details__copy{opacity:0;position:absolute;top:50%;left:50%;background-color:rgba(0,0,0,.5);color:#fff;padding:15px;border-radius:5px;transform:translate(-50%,-50%)}:host::ng-deep .file-details__copy.visible{opacity:1}:host::ng-deep .update__action{min-width:100px}:host::ng-deep .update__action.loading{padding:0 5px}:host::ng-deep .update__action.loading .mat-button-wrapper{display:flex;width:100%;justify-content:center;align-items:center}:host::ng-deep .update__action.loading .mat-spinner{margin-right:10px}:host::ng-deep .break-word{word-break:break-word}"]
|
|
3528
3527
|
}] }
|
|
@@ -3715,8 +3714,8 @@ class AssetItemComponent {
|
|
|
3715
3714
|
AssetItemComponent.decorators = [
|
|
3716
3715
|
{ type: Component, args: [{
|
|
3717
3716
|
selector: 'lib-asset-item',
|
|
3718
|
-
template: "<div class=\"asset-wrapper\">\n <div class=\"asset-content\">\n <div class=\"asset-content__header\">\n <button class=\"asset-content__header--button\" mat-raised-button>\n <mat-checkbox\n class=\"checkbox\"\n [checked]=\"checkSelectedAsset\"\n
|
|
3719
|
-
styles: [":host::ng-deep .asset-wrapper{padding:5px}:host::ng-deep .asset-wrapper .asset-content{overflow:hidden;position:relative;border-radius:10px;border:1px solid #d8d8d8;font-size:14px;transition:.3s cubic-bezier(.25,.8,.25,1)}:host::ng-deep .asset-wrapper .asset-content:hover{box-shadow:0 14px 28px rgba(0,0,0,.25),0 10px 10px rgba(0,0,0,.22)}:host::ng-deep .asset-wrapper .asset-content__header{position:absolute;z-index:1;top:0;left:0;width:100%;display:flex;justify-content:space-between;padding:14px}:host::ng-deep .asset-wrapper .asset-content__header--button{width:30px;height:30px;min-width:30px;display:flex;align-items:center;justify-content:center;text-align:center;color:rgba(0,0,0,.65);background:rgba(255,255,255,.6)}:host::ng-deep .asset-wrapper .asset-content__header--button:hover{background:#fff}:host::ng-deep .asset-wrapper .asset-content__header--button.edit-button{transition:.3s cubic-bezier(.25,.8,.25,1);opacity:0}:host::ng-deep .asset-wrapper .asset-content__header--button .mat-icon{font-size:22px}:host::ng-deep .asset-wrapper .asset-content__header--button .mat-checkbox{display:flex;align-items:center}:host::ng-deep .asset-wrapper .asset-content__header--button .mat-checkbox .mat-checkbox-layout{margin:0}:host::ng-deep .asset-wrapper .asset-content__header--button .mat-checkbox .mat-checkbox-layout .mat-checkbox-frame{color:#767676}:host::ng-deep .asset-wrapper .asset-content__body{padding-bottom:66.66%;background:#f1f1f1;position:relative}:host::ng-deep .asset-wrapper .asset-content__body img{max-width:100%;max-height:100%;-o-object-fit:contain;object-fit:contain;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}:host::ng-deep .asset-wrapper .asset-content__body img.image{background-image:url(data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEBLAEsAAD/2wBDAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQH/2wBDAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQH/wAARCAAUABQDASIAAhEBAxEB/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx8vP09fb3+Pn6/8QAHwEAAwEBAQEBAQEBAQAAAAAAAAECAwQFBgcICQoL/8QAtREAAgECBAQDBAcFBAQAAQJ3AAECAxEEBSExBhJBUQdhcRMiMoEIFEKRobHBCSMzUvAVYnLRChYkNOEl8RcYGRomJygpKjU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6goOEhYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3uLm6wsPExcbHyMnK0tPU1dbX2Nna4uPk5ebn6Onq8vP09fb3+Pn6/9oADAMBAAIRAxEAPwD+/ivFPFOf+EjvxzjbBgdv+PeDp+OfxzSt4q18AkageASB9ntu3OM+Vn8c5rsdG0fT9d06DVdUgN1f3XmefP5ksO/ypXhj/dwvHGu2ONF+VF3bQSM0AeYUV7IPCWgjgWRA/wCvi4P85SaKAPGm5Vh7H+VeyeERjQLEDoPP/WeQ/wAzRRQB0tFFFAH/2Q==)}:host::ng-deep .asset-wrapper .asset-content__body img.pdf{width:75%;height:75%}:host::ng-deep .asset-wrapper .asset-content__footer{display:flex;align-items:center;justify-content:space-between;padding:5px 8px}:host::ng-deep .asset-wrapper .asset-content__footer--info{max-width:calc(100% - 50px)}:host::ng-deep .asset-wrapper .asset-content__footer--info p{margin:0;display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}:host::ng-deep .asset-wrapper .asset-content__footer--info .info{font-size:12px;color:#979797}:host::ng-deep .asset-wrapper .asset-content__footer--info .info .extension{text-transform:uppercase}:host::ng-deep .asset-wrapper .asset-content__footer--info.file-type__document{max-width:calc(100% - 70px)}:host::ng-deep .asset-wrapper .asset-content__footer--file-type{border-radius:5px;background-color:#d8d8d8;padding:2px 6px;font-size:12px}:host::ng-deep .asset-wrapper .asset-content:hover .edit-button{opacity:1!important}"]
|
|
3717
|
+
template: "<div class=\"asset-wrapper\">\n <div class=\"asset-content\">\n <div class=\"asset-content__header\">\n <button class=\"asset-content__header--button\" mat-raised-button (click)=\"onChange()\">\n <mat-checkbox\n class=\"checkbox\"\n [checked]=\"checkSelectedAsset\"\n ></mat-checkbox>\n </button>\n <button\n class=\"asset-content__header--button edit-button\"\n mat-raised-button\n (click)=\"editAsset()\"\n >\n <mat-icon>edit</mat-icon>\n </button>\n </div>\n <div class=\"asset-content__body\">\n <ng-container [ngSwitch]=\"asset.FileType\">\n <ng-container *ngSwitchCase=\"fileType.IMAGE\">\n <img\n class=\"image\"\n [src]=\"asset.UrlThumbnail\"\n [alt]=\"asset.OriginalFileName\"\n />\n </ng-container>\n <ng-container *ngSwitchCase=\"fileType.DOCUMENT\">\n <img [src]=\"base64Pdf\" [alt]=\"asset.OriginalFileName\" class=\"pdf\" />\n </ng-container>\n </ng-container>\n </div>\n <div class=\"asset-content__footer\">\n <div\n class=\"asset-content__footer--info\"\n [ngClass]=\"{\n 'file-type__document': asset.FileType === fileType.DOCUMENT\n }\"\n >\n <p\n class=\"name\"\n [matTooltip]=\"asset.OriginalFileNameWithoutExtension\"\n matTooltipClass=\"width-auto\"\n >\n {{ asset.OriginalFileNameWithoutExtension }}\n </p>\n <p class=\"info\">\n <span class=\"extension\">{{ asset.Extension }}</span>\n <span\n *ngIf=\"\n asset.FileType === fileType.IMAGE && asset?.Extension !== 'svg'\n \"\n >\n - {{ asset.Width }}x{{ asset.Height }}</span\n >\n <span *ngIf=\"asset.Size\"> - {{ asset.Size }}</span>\n </p>\n </div>\n <div class=\"asset-content__footer--file-type\">\n <span>{{ asset.FileType }}</span>\n </div>\n </div>\n </div>\n</div>\n",
|
|
3718
|
+
styles: [":host::ng-deep .asset-wrapper{padding:5px}:host::ng-deep .asset-wrapper .asset-content{overflow:hidden;position:relative;border-radius:10px;border:1px solid #d8d8d8;font-size:14px;transition:.3s cubic-bezier(.25,.8,.25,1)}:host::ng-deep .asset-wrapper .asset-content:hover{box-shadow:0 14px 28px rgba(0,0,0,.25),0 10px 10px rgba(0,0,0,.22)}:host::ng-deep .asset-wrapper .asset-content__header{position:absolute;z-index:1;top:0;left:0;width:100%;display:flex;justify-content:space-between;padding:14px}:host::ng-deep .asset-wrapper .asset-content__header--button{width:30px;height:30px;min-width:30px;display:flex;align-items:center;justify-content:center;text-align:center;color:rgba(0,0,0,.65);background:rgba(255,255,255,.6)}:host::ng-deep .asset-wrapper .asset-content__header--button:hover{background:#fff}:host::ng-deep .asset-wrapper .asset-content__header--button.edit-button{transition:.3s cubic-bezier(.25,.8,.25,1);opacity:0}:host::ng-deep .asset-wrapper .asset-content__header--button .mat-icon{font-size:22px}:host::ng-deep .asset-wrapper .asset-content__header--button .mat-checkbox{pointer-events:none;display:flex;align-items:center}:host::ng-deep .asset-wrapper .asset-content__header--button .mat-checkbox .mat-checkbox-layout{margin:0}:host::ng-deep .asset-wrapper .asset-content__header--button .mat-checkbox .mat-checkbox-layout .mat-checkbox-frame{color:#767676}:host::ng-deep .asset-wrapper .asset-content__body{padding-bottom:66.66%;background:#f1f1f1;position:relative}:host::ng-deep .asset-wrapper .asset-content__body img{max-width:100%;max-height:100%;-o-object-fit:contain;object-fit:contain;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}:host::ng-deep .asset-wrapper .asset-content__body img.image{background-image:url(data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEBLAEsAAD/2wBDAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQH/2wBDAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQH/wAARCAAUABQDASIAAhEBAxEB/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx8vP09fb3+Pn6/8QAHwEAAwEBAQEBAQEBAQAAAAAAAAECAwQFBgcICQoL/8QAtREAAgECBAQDBAcFBAQAAQJ3AAECAxEEBSExBhJBUQdhcRMiMoEIFEKRobHBCSMzUvAVYnLRChYkNOEl8RcYGRomJygpKjU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6goOEhYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3uLm6wsPExcbHyMnK0tPU1dbX2Nna4uPk5ebn6Onq8vP09fb3+Pn6/9oADAMBAAIRAxEAPwD+/ivFPFOf+EjvxzjbBgdv+PeDp+OfxzSt4q18AkageASB9ntu3OM+Vn8c5rsdG0fT9d06DVdUgN1f3XmefP5ksO/ypXhj/dwvHGu2ONF+VF3bQSM0AeYUV7IPCWgjgWRA/wCvi4P85SaKAPGm5Vh7H+VeyeERjQLEDoPP/WeQ/wAzRRQB0tFFFAH/2Q==)}:host::ng-deep .asset-wrapper .asset-content__body img.pdf{width:75%;height:75%}:host::ng-deep .asset-wrapper .asset-content__footer{display:flex;align-items:center;justify-content:space-between;padding:5px 8px}:host::ng-deep .asset-wrapper .asset-content__footer--info{max-width:calc(100% - 50px)}:host::ng-deep .asset-wrapper .asset-content__footer--info p{margin:0;display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}:host::ng-deep .asset-wrapper .asset-content__footer--info .info{font-size:12px;color:#979797}:host::ng-deep .asset-wrapper .asset-content__footer--info .info .extension{text-transform:uppercase}:host::ng-deep .asset-wrapper .asset-content__footer--info.file-type__document{max-width:calc(100% - 70px)}:host::ng-deep .asset-wrapper .asset-content__footer--file-type{border-radius:5px;background-color:#d8d8d8;padding:2px 6px;font-size:12px}:host::ng-deep .asset-wrapper .asset-content:hover .edit-button{opacity:1!important}"]
|
|
3720
3719
|
}] }
|
|
3721
3720
|
];
|
|
3722
3721
|
/** @nocollapse */
|