@bravura/ui 1.23.2 → 1.24.1
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/CHANGELOG.md +33 -0
- package/behavior/await.directive.d.ts +5 -1
- package/behavior/behavior.module.d.ts +6 -4
- package/behavior/observe-content-class.directive.d.ts +29 -0
- package/behavior/public-api.d.ts +1 -0
- package/behavior/sizing.directive.d.ts +2 -0
- package/bundles/bravura-ui-alert.umd.js +1 -1
- package/bundles/bravura-ui-behavior.umd.js +117 -17
- package/bundles/bravura-ui-behavior.umd.js.map +1 -1
- package/bundles/bravura-ui-currency-input.umd.js +0 -3
- package/bundles/bravura-ui-currency-input.umd.js.map +1 -1
- package/bundles/bravura-ui-decimal-input.umd.js +1 -5
- package/bundles/bravura-ui-decimal-input.umd.js.map +1 -1
- package/bundles/bravura-ui-file-upload.umd.js +47 -3
- package/bundles/bravura-ui-file-upload.umd.js.map +1 -1
- package/bundles/bravura-ui-panel.umd.js +266 -0
- package/bundles/bravura-ui-panel.umd.js.map +1 -0
- package/bundles/bravura-ui-radio-panel.umd.js +2 -2
- package/bundles/bravura-ui-radio-panel.umd.js.map +1 -1
- package/bundles/bravura-ui-stepper.umd.js +6 -2
- package/bundles/bravura-ui-stepper.umd.js.map +1 -1
- package/bundles/bravura-ui-tooltip.umd.js +34 -6
- package/bundles/bravura-ui-tooltip.umd.js.map +1 -1
- package/decimal-input/decimal-input.directive.d.ts +0 -1
- package/esm2015/alert/alert-message.component.js +1 -1
- package/esm2015/behavior/await.directive.js +15 -6
- package/esm2015/behavior/behavior.module.js +18 -6
- package/esm2015/behavior/observe-content-class.directive.js +63 -0
- package/esm2015/behavior/public-api.js +2 -1
- package/esm2015/behavior/sizing.directive.js +13 -4
- package/esm2015/currency-input/currency-input.directive.js +1 -4
- package/esm2015/decimal-input/decimal-input.directive.js +2 -6
- package/esm2015/file-upload/file-upload.component.js +48 -4
- package/esm2015/panel/bravura-ui-panel.js +5 -0
- package/esm2015/panel/panel-section.component.js +47 -0
- package/esm2015/panel/panel.component.js +93 -0
- package/esm2015/panel/panel.module.js +23 -0
- package/esm2015/panel/public-api.js +2 -0
- package/esm2015/panel/tinted.directive.js +60 -0
- package/esm2015/radio-panel/radio-panel-item.component.js +2 -2
- package/esm2015/radio-panel/radio-panel.component.js +1 -1
- package/esm2015/stepper/stepper.component.js +7 -3
- package/esm2015/tooltip/public-api.js +2 -1
- package/esm2015/tooltip/tooltip.directive.js +30 -4
- package/fesm2015/bravura-ui-alert.js +1 -1
- package/fesm2015/bravura-ui-behavior.js +104 -14
- package/fesm2015/bravura-ui-behavior.js.map +1 -1
- package/fesm2015/bravura-ui-currency-input.js +0 -3
- package/fesm2015/bravura-ui-currency-input.js.map +1 -1
- package/fesm2015/bravura-ui-decimal-input.js +1 -5
- package/fesm2015/bravura-ui-decimal-input.js.map +1 -1
- package/fesm2015/bravura-ui-file-upload.js +47 -3
- package/fesm2015/bravura-ui-file-upload.js.map +1 -1
- package/fesm2015/bravura-ui-panel.js +218 -0
- package/fesm2015/bravura-ui-panel.js.map +1 -0
- package/fesm2015/bravura-ui-radio-panel.js +2 -2
- package/fesm2015/bravura-ui-radio-panel.js.map +1 -1
- package/fesm2015/bravura-ui-stepper.js +6 -2
- package/fesm2015/bravura-ui-stepper.js.map +1 -1
- package/fesm2015/bravura-ui-tooltip.js +30 -4
- package/fesm2015/bravura-ui-tooltip.js.map +1 -1
- package/file-upload/file-upload.component.d.ts +11 -1
- package/package.json +1 -1
- package/panel/bravura-ui-panel.d.ts +5 -0
- package/panel/package.json +10 -0
- package/panel/panel-section.component.d.ts +15 -0
- package/panel/panel.component.d.ts +60 -0
- package/panel/panel.module.d.ts +16 -0
- package/panel/public-api.d.ts +1 -0
- package/panel/tinted.directive.d.ts +26 -0
- package/stepper/stepper.component.d.ts +1 -0
- package/tooltip/public-api.d.ts +1 -0
- package/tooltip/tooltip.directive.d.ts +8 -2
|
@@ -127,6 +127,13 @@ class FileUploadComponent {
|
|
|
127
127
|
this.dropHint = 'Please release the mouse button to start uploading.';
|
|
128
128
|
/** Specifies the total number of files accepted. A falsy value removes the limit.*/
|
|
129
129
|
this.limit = 0;
|
|
130
|
+
/**
|
|
131
|
+
* specify the number of maximum bytes that can be uploaded.
|
|
132
|
+
* if number is specified, bytes are assumed, otherwise enter a string for specific size type.
|
|
133
|
+
*/
|
|
134
|
+
this.fileSize = '10MB';
|
|
135
|
+
/** @ignore */
|
|
136
|
+
this._fileSizeExceedMsg = '';
|
|
130
137
|
/** @ignore */
|
|
131
138
|
this._uploadingItems = [];
|
|
132
139
|
/** @ignore */
|
|
@@ -234,7 +241,7 @@ class FileUploadComponent {
|
|
|
234
241
|
event.stopPropagation();
|
|
235
242
|
this._onDndStopFrame();
|
|
236
243
|
const files = (_a = event.dataTransfer) === null || _a === void 0 ? void 0 : _a.files;
|
|
237
|
-
if (files === null || files === void 0 ? void 0 : files.length) {
|
|
244
|
+
if ((files === null || files === void 0 ? void 0 : files.length) && this._validateFileSize(files)) {
|
|
238
245
|
this._uploadFiles(Array.from(files));
|
|
239
246
|
}
|
|
240
247
|
}
|
|
@@ -268,7 +275,7 @@ class FileUploadComponent {
|
|
|
268
275
|
/** @ignore */
|
|
269
276
|
_handleFileSelection() {
|
|
270
277
|
const fileList = this._fileInput.nativeElement.files;
|
|
271
|
-
if (fileList === null || fileList === void 0 ? void 0 : fileList.length) {
|
|
278
|
+
if ((fileList === null || fileList === void 0 ? void 0 : fileList.length) && this._validateFileSize(fileList)) {
|
|
272
279
|
this._uploadFiles(Array.from(fileList));
|
|
273
280
|
this._fileInput.nativeElement.value = '';
|
|
274
281
|
}
|
|
@@ -281,6 +288,41 @@ class FileUploadComponent {
|
|
|
281
288
|
get _initialising() {
|
|
282
289
|
return !!this._initSubs && !this._initSubs.closed;
|
|
283
290
|
}
|
|
291
|
+
returnFileSize(size) {
|
|
292
|
+
if (size < 1024) {
|
|
293
|
+
return `${size} bytes`;
|
|
294
|
+
}
|
|
295
|
+
else if (size >= 1024 && size < 1048576) {
|
|
296
|
+
return `${(size / 1024).toFixed(1)} KB`;
|
|
297
|
+
}
|
|
298
|
+
else {
|
|
299
|
+
return `${(size / 1048576).toFixed(1)} MB`;
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
_validateFileSize(files) {
|
|
303
|
+
this._fileSizeExceedMsg = '';
|
|
304
|
+
const maxSize = this.returnFileSize(this._getMaxBytes());
|
|
305
|
+
for (let i = 0; i < files.length; i++) {
|
|
306
|
+
if (files[i].size > this._getMaxBytes()) {
|
|
307
|
+
this._fileSizeExceedMsg = `Selected file/s has exceeded the allowable size of ${maxSize} per file`;
|
|
308
|
+
return false;
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
return true;
|
|
312
|
+
}
|
|
313
|
+
_getMaxBytes() {
|
|
314
|
+
if (typeof this.fileSize === 'string') {
|
|
315
|
+
if (this.fileSize.toUpperCase().endsWith('KB')) {
|
|
316
|
+
const kiloBytes = this.fileSize.substring(0, this.fileSize.indexOf('KB'));
|
|
317
|
+
return Number(kiloBytes) * 1024;
|
|
318
|
+
}
|
|
319
|
+
else if (this.fileSize.toUpperCase().endsWith('MB')) {
|
|
320
|
+
const megaBytes = this.fileSize.substring(0, this.fileSize.indexOf('MB'));
|
|
321
|
+
return Number(megaBytes) * 1048576;
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
return this.fileSize;
|
|
325
|
+
}
|
|
284
326
|
_uploadFiles(files) {
|
|
285
327
|
if (this._initialising || files.length > this.remaining) {
|
|
286
328
|
return;
|
|
@@ -342,7 +384,7 @@ class FileUploadComponent {
|
|
|
342
384
|
}
|
|
343
385
|
}
|
|
344
386
|
FileUploadComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FileUploadComponent, deps: [{ token: FileUploadService }], target: i0.ɵɵFactoryTarget.Component });
|
|
345
|
-
FileUploadComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: FileUploadComponent, selector: "bui-file-upload", inputs: { uploadActionText: "uploadActionText", fileUploadedLabel: "fileUploadedLabel", dragHint: "dragHint", dropHint: "dropHint", limit: "limit", types: "types" }, host: { listeners: { "dragenter": "onDragEnter($event)", "dragover": "onDragOver($event)", "dragleave": "onDragLeave($event)", "drop": "onDndDrop($event)" }, properties: { "class.bui-dnd-active": "_overFrame && remaining >= _numberOfFilesDragged", "class.bui-dnd-over": "_overDropZone && remaining >= _numberOfFilesDragged", "class.bui-dnd-invalid": "_invalidFilesDragged" }, classAttribute: "bui-host bui-file-upload" }, providers: [{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => FileUploadComponent), multi: true }], viewQueries: [{ propertyName: "_fileInput", first: true, predicate: ["fileInput"], descendants: true, read: ElementRef, static: true }], ngImport: i0, template: "<div class=\"bui-file-upload-container\">\n\t<div\n\t\tclass=\"bui-file-upload-hint\"\n\t\t*ngIf=\"!_initialising && remaining > 0 && (!_itemAnimationInProgress || remaining > 1)\"\n\t>\n\t\t<ng-template [ngIf]=\"_invalidFilesDragged\" [ngIfElse]=\"validDnd\">\n\t\t\t<mat-icon [buiIcon]=\"'block'\" [size]=\"32\" color=\"warn\" variant=\"outlined\" style=\"opacity: 0.6\"></mat-icon>\n\t\t</ng-template>\n\t\t<ng-template #validDnd>\n\t\t\t<div *ngIf=\"!_overFrame && !_overDropZone\" class=\"bui-color-muted bui-upload-icon-link\" (click)=\"selectFiles()\">\n\t\t\t\t<mat-icon [buiIcon]=\"'fas fa-cloud-upload-alt'\" [size]=\"32\"></mat-icon>\n\t\t\t\t<a role=\"button\">{{ uploadActionText }}</a>\n\t\t\t</div>\n\t\t\t<div *ngIf=\"_overFrame && !_overDropZone\" class=\"bui-color-light\">{{ dragHint }}</div>\n\t\t\t<div *ngIf=\"_overDropZone\" class=\"bui-color-light\">{{ dropHint }}</div>\n\t\t</ng-template>\n\t</div>\n\t<div\n\t\tclass=\"bui-file-upload-list\"\n\t\t[@slideOut]=\"_uploadingItems.length\"\n\t\t(@slideOut.start)=\"_itemAnimationStart.next()\"\n\t\t(@slideOut.done)=\"_itemAnimationDone.next()\"\n\t\t*ngIf=\"_uploadingItems.length\"\n\t>\n\t\t<span class=\"bui-file-uploaded-label\">{{ fileUploadedLabel }}</span>\n\n\t\t<ng-container *ngFor=\"let item of _uploadingItems; let idx = index\">\n\t\t\t<div class=\"bui-file-upload-item\" [class.in-progress]=\"!item.done\" #itemDiv>\n\t\t\t\t<div class=\"bui-file-upload-item-name\">\n\t\t\t\t\t<span>\n\t\t\t\t\t\t<mat-icon class=\"bui-color-muted\">description</mat-icon>\n\t\t\t\t\t\t<a\n\t\t\t\t\t\t\tclass=\"text\"\n\t\t\t\t\t\t\t*ngIf=\"item.done && !item.downloading; else staticName\"\n\t\t\t\t\t\t\thref=\"#{{ item.uploadedItem?.id }}\"\n\t\t\t\t\t\t\t(click)=\"$event.preventDefault(); _openItem(item)\"\n\t\t\t\t\t\t\tcontextmenu=\"false\"\n\t\t\t\t\t\t\tmatTooltip=\"Download\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{{ item.name }}\n\t\t\t\t\t\t</a>\n\t\t\t\t\t\t<ng-template #staticName>\n\t\t\t\t\t\t\t<span class=\"text\">{{ item.name }}</span>\n\t\t\t\t\t\t</ng-template>\n\t\t\t\t\t</span>\n\t\t\t\t\t<div class=\"bui-file-upload-item-progress\">\n\t\t\t\t\t\t<mat-progress-bar\n\t\t\t\t\t\t\tmode=\"determinate\"\n\t\t\t\t\t\t\t[class.upload-completed]=\"item.done\"\n\t\t\t\t\t\t\t*ngIf=\"!item.downloading\"\n\t\t\t\t\t\t\t[value]=\"item.done ? 100 : item.progress * 100\"\n\t\t\t\t\t\t></mat-progress-bar>\n\t\t\t\t\t\t<mat-progress-bar mode=\"buffer\" *ngIf=\"item.downloading\"></mat-progress-bar>\n\t\t\t\t\t\t<span>\n\t\t\t\t\t\t\t<ng-template [ngIf]=\"item.done\" [ngIfElse]=\"inprogress\"> 100% </ng-template>\n\t\t\t\t\t\t\t<ng-template #inprogress>\n\t\t\t\t\t\t\t\t{{ item.progress | percent }}\n\t\t\t\t\t\t\t</ng-template>\n\t\t\t\t\t\t</span>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t<div class=\"bui-file-upload-item-action\">\n\t\t\t\t\t<button\n\t\t\t\t\t\tmat-icon-button\n\t\t\t\t\t\tcolor=\"primary\"\n\t\t\t\t\t\t(click)=\"item.cancel()\"\n\t\t\t\t\t\t(mouseenter)=\"itemDiv.classList.add('bui-file-upload-item-deleting')\"\n\t\t\t\t\t\t(mouseleave)=\"itemDiv.classList.remove('bui-file-upload-item-deleting')\"\n\t\t\t\t\t\tmatTooltip=\"Delete\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<mat-icon [buiIcon]=\"'cancel'\" style=\"line-height: 0.9\"></mat-icon>\n\t\t\t\t\t</button>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<mat-divider *ngIf=\"idx < _uploadingItems.length - 1\"></mat-divider>\n\t\t</ng-container>\n\t</div>\n\t<input\n\t\ttype=\"file\"\n\t\t#fileInput\n\t\tstyle=\"display: none\"\n\t\taccept=\"{{ _accept }}\"\n\t\t(change)=\"_handleFileSelection()\"\n\t\t[multiple]=\"remaining > 1\"\n\t/>\n</div>\n", styles: [":host:not([hidden]){display:block;border-style:dashed;border-width:1px;border-color:var(--bui-color-muted);transition:all .12s;padding:3px}:host:not([hidden]).bui-dnd-active,:host:not([hidden]).bui-dnd-over{padding:0;border-width:4px}:host:not([hidden]).bui-dnd-invalid{cursor:no-drop}:host:not([hidden]) .bui-file-upload-hint{margin:.5rem;height:40px;justify-content:center;display:flex;align-items:center}:host:not([hidden]) .bui-file-upload-container{min-height:4rem;display:flex;align-items:center;flex-direction:column;justify-content:center;transition:initial}:host:not([hidden]) .bui-file-upload-container .bui-upload-icon-link{cursor:pointer;transition:color .1s cubic-bezier(.55,0,.55,.2);display:flex;align-items:center}:host:not([hidden]) .bui-file-upload-container .bui-upload-icon-link:hover{color:var(--bui-color-light)!important}:host:not([hidden]) .bui-file-upload-container .bui-upload-icon-link>*{margin:4px}:host:not([hidden]) .bui-file-upload-list{align-self:stretch;margin-top:calc(1rem - 4px)}:host:not([hidden]) .bui-file-upload-list .bui-file-uploaded-label{display:block;font-size:smaller;margin:0 calc(1rem - 4px) .5rem calc(1rem - 4px)}:host:not([hidden]) .bui-file-upload-list .bui-file-upload-item{display:flex;align-items:center;margin:0 calc(1rem - 4px);padding:.25rem 0;justify-content:space-between}:host:not([hidden]) .bui-file-upload-list .bui-file-upload-item:last-child{margin-bottom:calc(.5rem - 4px)}:host:not([hidden]) .bui-file-upload-list .bui-file-upload-item.in-progress .bui-file-upload-item-name{font-style:italic}:host:not([hidden]) .bui-file-upload-list .bui-file-upload-item.bui-file-upload-item-deleting{background-color:#8080801a;transition:background-color .1s cubic-bezier(.55,0,.55,.2)}:host:not([hidden]) .bui-file-upload-list .bui-file-upload-item-name{flex-grow:1;font-size:80%;display:flex;align-items:center;flex-wrap:wrap}:host:not([hidden]) .bui-file-upload-list .bui-file-upload-item-name>span{word-break:break-all;display:flex;align-items:center}:host:not([hidden]) .bui-file-upload-list .bui-file-upload-item-name>span>mat-icon{width:20px;height:20px;font-size:20px}:host:not([hidden]) .bui-file-upload-list .bui-file-upload-item-name a{color:var(--bui-color-primary)}:host:not([hidden]) .bui-file-upload-list .bui-file-upload-item-name .text{margin-left:.5rem;margin-right:.5rem}:host:not([hidden]) .bui-file-upload-list .bui-file-upload-item-progress{flex-grow:1;min-width:50%;display:flex;justify-content:flex-start;align-items:center;margin:.5rem 0}:host:not([hidden]) .bui-file-upload-list .bui-file-upload-item-progress .mat-progress-bar{max-width:100%;height:.4rem;border-radius:1rem}:host:not([hidden]) .bui-file-upload-list .bui-file-upload-item-progress>span{margin-inline-start:.5rem}:host:not([hidden]) .bui-file-upload-list .bui-file-upload-item-action{display:flex;align-items:center;height:1em;width:1.75em}:host:not([hidden]) .bui-file-upload-list .mat-divider{margin:0 calc(1rem - 4px) 0 calc(1rem - 4px)}:host:not([hidden]) .upload-completed{animation:pulse 1s ease-in-out}@keyframes pulse{0%{transform:scaleY(1)}50%{transform:scaleY(1.5)}to{transform:scaleY(1)}}\n"], components: [{ type: i2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { type: i3.MatProgressBar, selector: "mat-progress-bar", inputs: ["color", "mode", "value", "bufferValue"], outputs: ["animationEnd"], exportAs: ["matProgressBar"] }, { type: i4.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { type: i5.MatDivider, selector: "mat-divider", inputs: ["vertical", "inset"] }], directives: [{ type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i7.IconDirective, selector: "[buiIcon]", inputs: ["buiIcon", "size", "variant"] }, { type: i6.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i8.MatTooltip, selector: "[matTooltip]", exportAs: ["matTooltip"] }], pipes: { "percent": i6.PercentPipe }, animations: [
|
|
387
|
+
FileUploadComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: FileUploadComponent, selector: "bui-file-upload", inputs: { uploadActionText: "uploadActionText", fileUploadedLabel: "fileUploadedLabel", dragHint: "dragHint", dropHint: "dropHint", limit: "limit", fileSize: "fileSize", types: "types" }, host: { listeners: { "dragenter": "onDragEnter($event)", "dragover": "onDragOver($event)", "dragleave": "onDragLeave($event)", "drop": "onDndDrop($event)" }, properties: { "class.bui-dnd-active": "_overFrame && remaining >= _numberOfFilesDragged", "class.bui-dnd-over": "_overDropZone && remaining >= _numberOfFilesDragged", "class.bui-dnd-invalid": "_invalidFilesDragged" }, classAttribute: "bui-host bui-file-upload" }, providers: [{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => FileUploadComponent), multi: true }], viewQueries: [{ propertyName: "_fileInput", first: true, predicate: ["fileInput"], descendants: true, read: ElementRef, static: true }], ngImport: i0, template: "<div class=\"bui-file-upload-container\">\n\t<div\n\t\tclass=\"bui-file-upload-hint\"\n\t\t*ngIf=\"!_initialising && remaining > 0 && (!_itemAnimationInProgress || remaining > 1)\"\n\t>\n\t\t<ng-template [ngIf]=\"_invalidFilesDragged\" [ngIfElse]=\"validDnd\">\n\t\t\t<mat-icon [buiIcon]=\"'block'\" [size]=\"32\" color=\"warn\" variant=\"outlined\" style=\"opacity: 0.6\"></mat-icon>\n\t\t</ng-template>\n\t\t<ng-template #validDnd>\n\t\t\t<div *ngIf=\"!_overFrame && !_overDropZone\" class=\"bui-color-muted bui-upload-icon-link\" (click)=\"selectFiles()\">\n\t\t\t\t<mat-icon [buiIcon]=\"'fas fa-cloud-upload-alt'\" [size]=\"32\"></mat-icon>\n\t\t\t\t<a role=\"button\">{{ uploadActionText }}</a>\n\t\t\t</div>\n\t\t\t<div *ngIf=\"_overFrame && !_overDropZone\" class=\"bui-color-light\">{{ dragHint }}</div>\n\t\t\t<div *ngIf=\"_overDropZone\" class=\"bui-color-light\">{{ dropHint }}</div>\n\t\t</ng-template>\n\t</div>\n\t<div\n\t\tclass=\"bui-file-upload-list\"\n\t\t[@slideOut]=\"_uploadingItems.length\"\n\t\t(@slideOut.start)=\"_itemAnimationStart.next()\"\n\t\t(@slideOut.done)=\"_itemAnimationDone.next()\"\n\t\t*ngIf=\"_uploadingItems.length\"\n\t>\n\t\t<span class=\"bui-file-uploaded-label\">{{ fileUploadedLabel }}</span>\n\n\t\t<ng-container *ngFor=\"let item of _uploadingItems; let idx = index\">\n\t\t\t<div class=\"bui-file-upload-item\" [class.in-progress]=\"!item.done\" #itemDiv>\n\t\t\t\t<div class=\"bui-file-upload-item-name\">\n\t\t\t\t\t<span>\n\t\t\t\t\t\t<mat-icon class=\"bui-color-muted\">description</mat-icon>\n\t\t\t\t\t\t<a\n\t\t\t\t\t\t\tclass=\"text\"\n\t\t\t\t\t\t\t*ngIf=\"item.done && !item.downloading; else staticName\"\n\t\t\t\t\t\t\thref=\"#{{ item.uploadedItem?.id }}\"\n\t\t\t\t\t\t\t(click)=\"$event.preventDefault(); _openItem(item)\"\n\t\t\t\t\t\t\tcontextmenu=\"false\"\n\t\t\t\t\t\t\tmatTooltip=\"Download\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{{ item.name }}\n\t\t\t\t\t\t</a>\n\t\t\t\t\t\t<ng-template #staticName>\n\t\t\t\t\t\t\t<span class=\"text\">{{ item.name }}</span>\n\t\t\t\t\t\t</ng-template>\n\t\t\t\t\t</span>\n\t\t\t\t\t<div class=\"bui-file-upload-item-progress\">\n\t\t\t\t\t\t<mat-progress-bar\n\t\t\t\t\t\t\tmode=\"determinate\"\n\t\t\t\t\t\t\t[class.upload-completed]=\"item.done\"\n\t\t\t\t\t\t\t*ngIf=\"!item.downloading\"\n\t\t\t\t\t\t\t[value]=\"item.done ? 100 : item.progress * 100\"\n\t\t\t\t\t\t></mat-progress-bar>\n\t\t\t\t\t\t<mat-progress-bar mode=\"buffer\" *ngIf=\"item.downloading\"></mat-progress-bar>\n\t\t\t\t\t\t<span>\n\t\t\t\t\t\t\t<ng-template [ngIf]=\"item.done\" [ngIfElse]=\"inprogress\"> 100% </ng-template>\n\t\t\t\t\t\t\t<ng-template #inprogress>\n\t\t\t\t\t\t\t\t{{ item.progress | percent }}\n\t\t\t\t\t\t\t</ng-template>\n\t\t\t\t\t\t</span>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t<div class=\"bui-file-upload-item-action\">\n\t\t\t\t\t<button\n\t\t\t\t\t\tmat-icon-button\n\t\t\t\t\t\tcolor=\"primary\"\n\t\t\t\t\t\t(click)=\"item.cancel()\"\n\t\t\t\t\t\t(mouseenter)=\"itemDiv.classList.add('bui-file-upload-item-deleting')\"\n\t\t\t\t\t\t(mouseleave)=\"itemDiv.classList.remove('bui-file-upload-item-deleting')\"\n\t\t\t\t\t\tmatTooltip=\"Delete\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<mat-icon [buiIcon]=\"'cancel'\" style=\"line-height: 0.9\"></mat-icon>\n\t\t\t\t\t</button>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<mat-divider *ngIf=\"idx < _uploadingItems.length - 1\"></mat-divider>\n\t\t</ng-container>\n\t</div>\n\t<input\n\t\ttype=\"file\"\n\t\t#fileInput\n\t\tstyle=\"display: none\"\n\t\taccept=\"{{ _accept }}\"\n\t\t(change)=\"_handleFileSelection()\"\n\t\t[multiple]=\"remaining > 1\"\n\t/>\n\n\t<div *ngIf=\"_fileSizeExceedMsg\" class=\"bui-color-warn bui-file-size-exceed\">\n\t\t<span> {{ _fileSizeExceedMsg }}</span> <mat-icon role=\"button\" (click)=\"_fileSizeExceedMsg = ''\">cancel</mat-icon>\n\t</div>\n</div>\n", styles: [":host:not([hidden]){display:block;border-style:dashed;border-width:1px;border-color:var(--bui-color-muted);transition:all .12s;padding:3px}:host:not([hidden]).bui-dnd-active,:host:not([hidden]).bui-dnd-over{padding:0;border-width:4px}:host:not([hidden]) .bui-file-size-exceed{display:flex;align-items:center;margin-bottom:1rem}:host:not([hidden]) .bui-file-size-exceed mat-icon{margin-left:.2rem}:host:not([hidden]).bui-dnd-invalid{cursor:no-drop}:host:not([hidden]) .bui-file-upload-hint{margin:.5rem;height:40px;justify-content:center;display:flex;align-items:center}:host:not([hidden]) .bui-file-upload-container{min-height:4rem;display:flex;align-items:center;flex-direction:column;justify-content:center;transition:initial}:host:not([hidden]) .bui-file-upload-container .bui-upload-icon-link{cursor:pointer;transition:color .1s cubic-bezier(.55,0,.55,.2);display:flex;align-items:center}:host:not([hidden]) .bui-file-upload-container .bui-upload-icon-link:hover{color:var(--bui-color-light)!important}:host:not([hidden]) .bui-file-upload-container .bui-upload-icon-link>*{margin:4px}:host:not([hidden]) .bui-file-upload-list{align-self:stretch;margin-top:calc(1rem - 4px)}:host:not([hidden]) .bui-file-upload-list .bui-file-uploaded-label{display:block;font-size:smaller;margin:0 calc(1rem - 4px) .5rem calc(1rem - 4px)}:host:not([hidden]) .bui-file-upload-list .bui-file-upload-item{display:flex;align-items:center;margin:0 calc(1rem - 4px);padding:.25rem 0;justify-content:space-between}:host:not([hidden]) .bui-file-upload-list .bui-file-upload-item:last-child{margin-bottom:calc(.5rem - 4px)}:host:not([hidden]) .bui-file-upload-list .bui-file-upload-item.in-progress .bui-file-upload-item-name{font-style:italic}:host:not([hidden]) .bui-file-upload-list .bui-file-upload-item.bui-file-upload-item-deleting{background-color:#8080801a;transition:background-color .1s cubic-bezier(.55,0,.55,.2)}:host:not([hidden]) .bui-file-upload-list .bui-file-upload-item-name{flex-grow:1;font-size:80%;display:flex;align-items:center;flex-wrap:wrap}:host:not([hidden]) .bui-file-upload-list .bui-file-upload-item-name>span{word-break:break-all;display:flex;align-items:center}:host:not([hidden]) .bui-file-upload-list .bui-file-upload-item-name>span>mat-icon{width:20px;height:20px;font-size:20px}:host:not([hidden]) .bui-file-upload-list .bui-file-upload-item-name a{color:var(--bui-color-primary)}:host:not([hidden]) .bui-file-upload-list .bui-file-upload-item-name .text{margin-left:.5rem;margin-right:.5rem}:host:not([hidden]) .bui-file-upload-list .bui-file-upload-item-progress{flex-grow:1;min-width:50%;display:flex;justify-content:flex-start;align-items:center;margin:.5rem 0}:host:not([hidden]) .bui-file-upload-list .bui-file-upload-item-progress .mat-progress-bar{max-width:100%;height:.4rem;border-radius:1rem}:host:not([hidden]) .bui-file-upload-list .bui-file-upload-item-progress>span{margin-inline-start:.5rem}:host:not([hidden]) .bui-file-upload-list .bui-file-upload-item-action{display:flex;align-items:center;height:1em;width:1.75em}:host:not([hidden]) .bui-file-upload-list .mat-divider{margin:0 calc(1rem - 4px) 0 calc(1rem - 4px)}:host:not([hidden]) .upload-completed{animation:pulse 1s ease-in-out}@keyframes pulse{0%{transform:scaleY(1)}50%{transform:scaleY(1.5)}to{transform:scaleY(1)}}\n"], components: [{ type: i2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { type: i3.MatProgressBar, selector: "mat-progress-bar", inputs: ["color", "mode", "value", "bufferValue"], outputs: ["animationEnd"], exportAs: ["matProgressBar"] }, { type: i4.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { type: i5.MatDivider, selector: "mat-divider", inputs: ["vertical", "inset"] }], directives: [{ type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i7.IconDirective, selector: "[buiIcon]", inputs: ["buiIcon", "size", "variant"] }, { type: i6.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i8.MatTooltip, selector: "[matTooltip]", exportAs: ["matTooltip"] }], pipes: { "percent": i6.PercentPipe }, animations: [
|
|
346
388
|
trigger('slideOut', [
|
|
347
389
|
transition('* => *', [
|
|
348
390
|
query(':leave', stagger(100, animate('0.25s', style({ height: 0, overflow: 'hidden' }))), { optional: true })
|
|
@@ -380,6 +422,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
|
|
|
380
422
|
type: Input
|
|
381
423
|
}], limit: [{
|
|
382
424
|
type: Input
|
|
425
|
+
}], fileSize: [{
|
|
426
|
+
type: Input
|
|
383
427
|
}], types: [{
|
|
384
428
|
type: Input
|
|
385
429
|
}], _fileInput: [{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bravura-ui-file-upload.js","sources":["../../../projects/ui/file-upload/file-upload.service.ts","../../../projects/ui/file-upload/file-upload.component.ts","../../../projects/ui/file-upload/file-upload.component.html","../../../projects/ui/file-upload/file-upload.module.ts","../../../projects/ui/file-upload/bravura-ui-file-upload.ts"],"sourcesContent":["import { HttpEvent } from '@angular/common/http';\nimport { Injectable } from '@angular/core';\nimport { Observable } from 'rxjs';\n\n/**\n * This type represents a file or form item that has been sent as part of a multipart/form-data POST request.\n */\nexport class FileUploadItem {\n\t/** The original filename in the client's filesystem, as provided by the browser. */\n\tname: string;\n\n\t/** The size of the file item. */\n\tsize: number;\n\n\t/** An alpha-numeric string that uniquely identifies the file item. */\n\tid: string;\n\n\t/** The content type (MIME type) of the file. */\n\ttype: string;\n\n\t/** @internal */\n\tconstructor(_id: string, _name: string, _size: number, _type: string) {\n\t\tthis.id = _id;\n\t\tthis.name = _name;\n\t\tthis.size = _size;\n\t\tthis.type = _type;\n\t}\n}\n\n/**\n * This is an API for processing file upload requests.\n *\n * A sub class of this type handles multiple file requests, sent using multipart/form-data encoding type, as specified by RFC 1867.\n *\n * Please extend this type and provide it in an injector at the same level, or ancestral to that, of the `FileUploadComponent`.\n */\n@Injectable()\nexport abstract class FileUploadService {\n\t/**\n\t * Upload a list of selected files from the browser. The returned `Observable` array provides the update of the uploading progress\n\t * through HTTP events.\n\t */\n\tabstract upload(files: File[]): Array<Observable<HttpEvent<FileUploadItem>>>;\n\n\t/** List all the uploaded file items in the current HTTP session. This list excludes the files still in the process of being uploaded*/\n\tabstract list(): Observable<FileUploadItem[]>;\n\n\t/** Get the content of an uploaded file item as a `Blob`. */\n\tabstract get(id: string): Observable<Blob>;\n\n\t/** Delete an uploaded file item from the server. */\n\tabstract delete(id: string): Observable<void>;\n\n\t/** Delete all uploaded file items in the current HTTP session. */\n\tabstract clear?(): Observable<void>;\n}\n","import { animate, query, stagger, style, transition, trigger } from '@angular/animations';\nimport { HttpEvent, HttpEventType } from '@angular/common/http';\nimport { Component, ElementRef, forwardRef, HostListener, Input, OnDestroy, OnInit, ViewChild } from '@angular/core';\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';\nimport { Observable, of, Subject, Subscription } from 'rxjs';\nimport { FileUploadItem, FileUploadService } from './file-upload.service';\n\n/** @ignore */\nclass UploadingItem {\n\tprogress = 0;\n\tuploadedItem: FileUploadItem | null | undefined;\n\tdownloadingSubs?: Subscription;\n\tprivate subscription: Subscription;\n\tprivate file?: File;\n\n\tconstructor(item: FileUploadItem, oncancel: (item: UploadingItem) => void);\n\tconstructor(\n\t\tevent$: Observable<HttpEvent<FileUploadItem>> | FileUploadItem,\n\t\tfile: File,\n\t\toncomplete: () => void,\n\t\toncancel: (item: UploadingItem) => void\n\t);\n\tconstructor(\n\t\tevent$: Observable<HttpEvent<FileUploadItem>> | FileUploadItem,\n\t\tfileOrOncancel?: File | ((item: UploadingItem) => void),\n\t\toncomplete?: () => void,\n\t\tprivate oncancel?: (item: UploadingItem) => void\n\t) {\n\t\tif (event$ instanceof Observable) {\n\t\t\tthis.file = fileOrOncancel as File;\n\t\t\tthis.subscription = event$.subscribe({\n\t\t\t\tnext: evt => {\n\t\t\t\t\tif (evt.type === HttpEventType.UploadProgress) {\n\t\t\t\t\t\tthis.progress = evt.loaded / (this.file as File).size;\n\t\t\t\t\t} else if (evt.type === HttpEventType.Response) {\n\t\t\t\t\t\tthis.uploadedItem = evt.body;\n\t\t\t\t\t\tthis.progress = 1;\n\t\t\t\t\t\toncomplete!();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t} else {\n\t\t\tthis.subscription = of(event$).subscribe();\n\t\t\tthis.uploadedItem = event$;\n\t\t\tthis.oncancel = fileOrOncancel as (item: UploadingItem) => void;\n\t\t}\n\t}\n\n\tcancel() {\n\t\tthis.subscription.unsubscribe();\n\t\tthis.oncancel!(this);\n\t}\n\n\tget done() {\n\t\treturn !!this.uploadedItem;\n\t}\n\n\tget name() {\n\t\treturn this.uploadedItem?.name || this.file?.name;\n\t}\n\n\tget downloading() {\n\t\treturn this.downloadingSubs && !this.downloadingSubs.closed;\n\t}\n}\n/**\n * A control value accessor component to provide the user interface for uploading files.\n *\n * The application that integrates this UI must provide an implementation of `FileUploadService`.\n *\n * The control's value is a list of alpha-numerical strings, which are the identifiers to the uploaded files.\n *\n * Example:\n *\n * ```html\n * <form>\n * <bui-file-upload [(ngModel)]=\"uploadedFileIds\" name=\"myFiles\"></bui-file-upload>\n * </form>\n * ```\n *\n * @see FileUploadService\n */\n@Component({\n\thost: {\n\t\tclass: 'bui-host bui-file-upload',\n\t\t'[class.bui-dnd-active]': '_overFrame && remaining >= _numberOfFilesDragged',\n\t\t'[class.bui-dnd-over]': '_overDropZone && remaining >= _numberOfFilesDragged',\n\t\t'[class.bui-dnd-invalid]': '_invalidFilesDragged'\n\t},\n\tselector: 'bui-file-upload',\n\ttemplateUrl: './file-upload.component.html',\n\tstyleUrls: ['./file-upload.component.scss'],\n\tproviders: [{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => FileUploadComponent), multi: true }],\n\tanimations: [\n\t\ttrigger('slideOut', [\n\t\t\ttransition('* => *', [\n\t\t\t\tquery(':leave', stagger(100, animate('0.25s', style({ height: 0, overflow: 'hidden' }))), { optional: true })\n\t\t\t])\n\t\t])\n\t]\n})\nexport class FileUploadComponent implements OnInit, OnDestroy, ControlValueAccessor {\n\t/** @ignore */\n\t_value: string[] | null = null;\n\n\t/**\n\t * The caption of the button for opening file selection dialog.\n\t */\n\t@Input()\n\tuploadActionText = 'Drag files here to attach or browse';\n\n\t/**\n\t * The label for listing successful uploaded files.\n\t */\n\t@Input()\n\tfileUploadedLabel = 'List of files uploaded successfully';\n\n\t/**\n\t * The text to be displayed when the user starts to drag file items over the browser window.\n\t */\n\t@Input()\n\tdragHint = 'Please drag the files here.';\n\n\t/**\n\t * The text to be displayed when the user is dragging the file items over the drop zone.\n\t */\n\t@Input()\n\tdropHint = 'Please release the mouse button to start uploading.';\n\n\t/** Specifies the total number of files accepted. A falsy value removes the limit.*/\n\t@Input()\n\tlimit = 0;\n\n\t/**\n\t * Accepted MIME types\n\t *\n\t * @example ['text/*', 'image/png']\n\t */\n\t@Input()\n\tget types(): string[] {\n\t\treturn this._types;\n\t}\n\tset types(types: string[]) {\n\t\tif (Array.isArray(types) && types?.length) {\n\t\t\tthis._typeRegExps = [];\n\t\t\tthis._types = Array.from(types);\n\t\t\tthis._accept = this._types.join(',');\n\t\t\ttypes.forEach(t => this._typeRegExps.push(new RegExp(t.replace(/\\*/g, '.*'))));\n\t\t}\n\t}\n\n\t/** @ignore */\n\t_uploadingItems: UploadingItem[] = [];\n\n\t/** @ignore */\n\t_accept = '*/*';\n\n\t/** @ignore */\n\t_itemAnimationStart = new Subject<void>();\n\t/** @ignore */\n\t_itemAnimationDone = new Subject<void>();\n\t/** @ignore */\n\t_itemAnimationInProgress = false;\n\n\tprivate _onChange = (_: string[]) => {};\n\tprivate _onTouch = () => {};\n\tprivate _frameDndEnter: (event: DragEvent) => void;\n\tprivate _frameDndLeave: () => void;\n\tprivate _frameDndOver: (event: DragEvent) => void;\n\tprivate _frameDndStop: () => void;\n\tprivate _overFrameCounter = 0;\n\tprivate _overCounter = 0;\n\tprivate _typeRegExps: RegExp[] = [/.*\\/.*/];\n\tprivate _types: string[] = ['*/*'];\n\tprivate _initSubs?: Subscription;\n\tprivate _numberOfFilesDragged = 0;\n\n\t@ViewChild('fileInput', { read: ElementRef, static: true })\n\tprivate _fileInput!: ElementRef<HTMLInputElement>;\n\n\tconstructor(private _service: FileUploadService) {\n\t\tthis._onChange([]);\n\t\tthis._onTouch();\n\t\tthis._frameDndEnter = this._onDndEnterFrame.bind(this);\n\t\tthis._frameDndLeave = this._onDndLeaveFrame.bind(this);\n\t\tthis._frameDndStop = this._onDndStopFrame.bind(this);\n\t\tthis._frameDndOver = event => event.preventDefault();\n\t}\n\n\t/** @internal */\n\tngOnInit(): void {\n\t\tdocument.addEventListener('dragenter', this._frameDndEnter);\n\t\tdocument.addEventListener('dragleave', this._frameDndLeave);\n\t\tdocument.addEventListener('dragend', this._frameDndStop);\n\t\tdocument.addEventListener('drop', this._frameDndStop);\n\t\tdocument.addEventListener('dragover', this._frameDndOver);\n\t\tthis._itemAnimationStart.subscribe(() => (this._itemAnimationInProgress = true));\n\t\tthis._itemAnimationDone.subscribe(() => (this._itemAnimationInProgress = false));\n\t}\n\n\tngOnDestroy(): void {\n\t\tdocument.removeEventListener('dragenter', this._frameDndEnter);\n\t\tdocument.removeEventListener('dragleave', this._frameDndLeave);\n\t\tdocument.removeEventListener('dragend', this._frameDndStop);\n\t\tdocument.removeEventListener('drop', this._frameDndStop);\n\t\tdocument.removeEventListener('dragover', this._frameDndOver);\n\t\tthis._itemAnimationStart.complete();\n\t\tthis._itemAnimationDone.complete();\n\t}\n\n\t/** @internal */\n\twriteValue(obj: any): void {\n\t\tif (Array.isArray(obj)) {\n\t\t\tif (!this._value) {\n\t\t\t\tthis._acceptChange(obj);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst common = obj.filter(v => this._value!.includes(v));\n\t\t\tif (common.length === obj.length && common.length === this._value.length) {\n\t\t\t\treturn; // no change\n\t\t\t}\n\t\t\tthis._acceptChange(obj);\n\t\t} else {\n\t\t\tthis._value = null;\n\t\t}\n\t}\n\n\t/** @internal */\n\tregisterOnChange(fn: any): void {\n\t\tthis._onChange = fn;\n\t}\n\n\t/** @internal */\n\tregisterOnTouched(fn: any): void {\n\t\tthis._onTouch = fn;\n\t}\n\n\t/** @internal */\n\t@HostListener('dragenter', ['$event'])\n\tonDragEnter(event: DragEvent) {\n\t\tevent.preventDefault();\n\t\tevent.stopPropagation();\n\t\tthis._overCounter++;\n\t}\n\n\t/** @internal */\n\t@HostListener('dragover', ['$event'])\n\tonDragOver(event: Event) {\n\t\tevent.preventDefault();\n\t}\n\n\t/** @internal */\n\t@HostListener('dragleave', ['$event'])\n\tonDragLeave(event: Event) {\n\t\tevent.preventDefault();\n\t\tevent.stopPropagation();\n\t\tthis._overCounter--;\n\t}\n\n\t/** @internal */\n\t@HostListener('drop', ['$event'])\n\tonDndDrop(event: DragEvent) {\n\t\tevent.preventDefault();\n\t\tevent.stopPropagation();\n\t\tthis._onDndStopFrame();\n\t\tconst files = event.dataTransfer?.files;\n\t\tif (files?.length) {\n\t\t\tthis._uploadFiles(Array.from(files));\n\t\t}\n\t}\n\n\t/** Open the file selection dialog */\n\tselectFiles() {\n\t\tthis._fileInput.nativeElement.click();\n\t}\n\n\t/** @ignore */\n\t_openItem(item: UploadingItem) {\n\t\titem.downloadingSubs = this._service.get(item.uploadedItem!.id).subscribe(blob => {\n\t\t\tconst url = URL.createObjectURL(blob);\n\t\t\twindow.open(url, '_blank');\n\t\t});\n\t}\n\n\t/** @ignore */\n\tget _overFrame(): boolean {\n\t\treturn this._overFrameCounter > 0;\n\t}\n\n\t/** @ignore */\n\tget _overDropZone(): boolean {\n\t\treturn this._overCounter > 0;\n\t}\n\n\t/** Whether file uploading is in progress */\n\tget uploading(): boolean {\n\t\treturn this._uploadingItems.some(i => !i.done);\n\t}\n\n\t/** The remaining number of files allowed.*/\n\tget remaining(): number {\n\t\treturn this.limit ? this.limit - this._uploadingItems.length : Infinity;\n\t}\n\n\t/** @ignore */\n\t_handleFileSelection() {\n\t\tconst fileList = this._fileInput.nativeElement.files;\n\t\tif (fileList?.length) {\n\t\t\tthis._uploadFiles(Array.from(fileList));\n\t\t\tthis._fileInput.nativeElement.value = '';\n\t\t}\n\t}\n\n\t/** @ignore */\n\tget _invalidFilesDragged(): boolean {\n\t\treturn this._numberOfFilesDragged > this.remaining && (this._overFrame || this._overDropZone);\n\t}\n\n\t/** @ignore */\n\tget _initialising(): boolean {\n\t\treturn !!this._initSubs && !this._initSubs.closed;\n\t}\n\n\tprivate _uploadFiles(files: File[]) {\n\t\tif (this._initialising || files.length > this.remaining) {\n\t\t\treturn;\n\t\t}\n\t\tconst filtered = files.filter(\n\t\t\tf =>\n\t\t\t\t(!f.type || this._typeRegExps.some(regexp => f.type.match(regexp))) &&\n\t\t\t\t!this._uploadingItems.some(i => i.name === f.name)\n\t\t);\n\t\tconst observables = this._service.upload(filtered);\n\t\tconst items = filtered.map(\n\t\t\t(f, i) => new UploadingItem(observables[i], f, this._updateItems.bind(this), this._deleteItem.bind(this))\n\t\t);\n\t\tthis._uploadingItems = [...this._uploadingItems, ...items];\n\t}\n\n\tprivate _onDndEnterFrame(event: DragEvent) {\n\t\tevent.preventDefault();\n\t\tthis._numberOfFilesDragged = event.dataTransfer?.items?.length || 0;\n\t\tthis._overFrameCounter++;\n\t}\n\n\tprivate _onDndLeaveFrame() {\n\t\tthis._overFrameCounter--;\n\t}\n\n\tprivate _onDndStopFrame() {\n\t\tthis._overFrameCounter = 0;\n\t\tthis._overCounter = 0;\n\t}\n\n\tprivate _acceptChange(v: string[]) {\n\t\tthis._initSubs = this._service.list().subscribe(list => {\n\t\t\tthis._uploadingItems = list\n\t\t\t\t.filter(i => v.includes(i.id))\n\t\t\t\t.map(f => new UploadingItem(f, this._deleteItem.bind(this)));\n\t\t});\n\t}\n\n\tprivate _updateItems() {\n\t\tconst completed = this._uploadingItems.filter(i => !!i.uploadedItem);\n\t\tthis._uploadingItems = [...completed, ...this._uploadingItems.filter(i => !i.uploadedItem)];\n\t\tthis._updateValue(completed);\n\t}\n\n\tprivate _deleteItem(item: UploadingItem) {\n\t\tconst key = item.uploadedItem?.id;\n\t\tif (key) {\n\t\t\tthis._service.delete(key).subscribe(() => {\n\t\t\t\tthis._uploadingItems = this._uploadingItems.filter(i => i !== item);\n\t\t\t\tconst completed = this._uploadingItems.filter(i => !!i.uploadedItem);\n\t\t\t\tthis._updateValue(completed);\n\t\t\t});\n\t\t} else {\n\t\t\tthis._uploadingItems = this._uploadingItems.filter(i => i !== item);\n\t\t\tconst completed = this._uploadingItems.filter(i => !!i.uploadedItem);\n\t\t\tthis._updateValue(completed);\n\t\t}\n\t}\n\n\tprivate _updateValue(completed: UploadingItem[]) {\n\t\tconst completedIds = completed.map(c => c.uploadedItem!.id);\n\t\tthis._value = completedIds;\n\t\tif (!this._value.length) {\n\t\t\tthis._value = null;\n\t\t}\n\t\tthis._onChange(completedIds);\n\t}\n}\n","<div class=\"bui-file-upload-container\">\n\t<div\n\t\tclass=\"bui-file-upload-hint\"\n\t\t*ngIf=\"!_initialising && remaining > 0 && (!_itemAnimationInProgress || remaining > 1)\"\n\t>\n\t\t<ng-template [ngIf]=\"_invalidFilesDragged\" [ngIfElse]=\"validDnd\">\n\t\t\t<mat-icon [buiIcon]=\"'block'\" [size]=\"32\" color=\"warn\" variant=\"outlined\" style=\"opacity: 0.6\"></mat-icon>\n\t\t</ng-template>\n\t\t<ng-template #validDnd>\n\t\t\t<div *ngIf=\"!_overFrame && !_overDropZone\" class=\"bui-color-muted bui-upload-icon-link\" (click)=\"selectFiles()\">\n\t\t\t\t<mat-icon [buiIcon]=\"'fas fa-cloud-upload-alt'\" [size]=\"32\"></mat-icon>\n\t\t\t\t<a role=\"button\">{{ uploadActionText }}</a>\n\t\t\t</div>\n\t\t\t<div *ngIf=\"_overFrame && !_overDropZone\" class=\"bui-color-light\">{{ dragHint }}</div>\n\t\t\t<div *ngIf=\"_overDropZone\" class=\"bui-color-light\">{{ dropHint }}</div>\n\t\t</ng-template>\n\t</div>\n\t<div\n\t\tclass=\"bui-file-upload-list\"\n\t\t[@slideOut]=\"_uploadingItems.length\"\n\t\t(@slideOut.start)=\"_itemAnimationStart.next()\"\n\t\t(@slideOut.done)=\"_itemAnimationDone.next()\"\n\t\t*ngIf=\"_uploadingItems.length\"\n\t>\n\t\t<span class=\"bui-file-uploaded-label\">{{ fileUploadedLabel }}</span>\n\n\t\t<ng-container *ngFor=\"let item of _uploadingItems; let idx = index\">\n\t\t\t<div class=\"bui-file-upload-item\" [class.in-progress]=\"!item.done\" #itemDiv>\n\t\t\t\t<div class=\"bui-file-upload-item-name\">\n\t\t\t\t\t<span>\n\t\t\t\t\t\t<mat-icon class=\"bui-color-muted\">description</mat-icon>\n\t\t\t\t\t\t<a\n\t\t\t\t\t\t\tclass=\"text\"\n\t\t\t\t\t\t\t*ngIf=\"item.done && !item.downloading; else staticName\"\n\t\t\t\t\t\t\thref=\"#{{ item.uploadedItem?.id }}\"\n\t\t\t\t\t\t\t(click)=\"$event.preventDefault(); _openItem(item)\"\n\t\t\t\t\t\t\tcontextmenu=\"false\"\n\t\t\t\t\t\t\tmatTooltip=\"Download\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{{ item.name }}\n\t\t\t\t\t\t</a>\n\t\t\t\t\t\t<ng-template #staticName>\n\t\t\t\t\t\t\t<span class=\"text\">{{ item.name }}</span>\n\t\t\t\t\t\t</ng-template>\n\t\t\t\t\t</span>\n\t\t\t\t\t<div class=\"bui-file-upload-item-progress\">\n\t\t\t\t\t\t<mat-progress-bar\n\t\t\t\t\t\t\tmode=\"determinate\"\n\t\t\t\t\t\t\t[class.upload-completed]=\"item.done\"\n\t\t\t\t\t\t\t*ngIf=\"!item.downloading\"\n\t\t\t\t\t\t\t[value]=\"item.done ? 100 : item.progress * 100\"\n\t\t\t\t\t\t></mat-progress-bar>\n\t\t\t\t\t\t<mat-progress-bar mode=\"buffer\" *ngIf=\"item.downloading\"></mat-progress-bar>\n\t\t\t\t\t\t<span>\n\t\t\t\t\t\t\t<ng-template [ngIf]=\"item.done\" [ngIfElse]=\"inprogress\"> 100% </ng-template>\n\t\t\t\t\t\t\t<ng-template #inprogress>\n\t\t\t\t\t\t\t\t{{ item.progress | percent }}\n\t\t\t\t\t\t\t</ng-template>\n\t\t\t\t\t\t</span>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t<div class=\"bui-file-upload-item-action\">\n\t\t\t\t\t<button\n\t\t\t\t\t\tmat-icon-button\n\t\t\t\t\t\tcolor=\"primary\"\n\t\t\t\t\t\t(click)=\"item.cancel()\"\n\t\t\t\t\t\t(mouseenter)=\"itemDiv.classList.add('bui-file-upload-item-deleting')\"\n\t\t\t\t\t\t(mouseleave)=\"itemDiv.classList.remove('bui-file-upload-item-deleting')\"\n\t\t\t\t\t\tmatTooltip=\"Delete\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<mat-icon [buiIcon]=\"'cancel'\" style=\"line-height: 0.9\"></mat-icon>\n\t\t\t\t\t</button>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<mat-divider *ngIf=\"idx < _uploadingItems.length - 1\"></mat-divider>\n\t\t</ng-container>\n\t</div>\n\t<input\n\t\ttype=\"file\"\n\t\t#fileInput\n\t\tstyle=\"display: none\"\n\t\taccept=\"{{ _accept }}\"\n\t\t(change)=\"_handleFileSelection()\"\n\t\t[multiple]=\"remaining > 1\"\n\t/>\n</div>\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { FileUploadComponent } from './file-upload.component';\nimport { MatIconModule } from '@angular/material/icon';\nimport { IconFontModule } from '@bravura/ui/icon-font';\nimport { MatProgressBarModule } from '@angular/material/progress-bar';\nimport { MatButtonModule } from '@angular/material/button';\nimport { MatDividerModule } from '@angular/material/divider';\nimport { MatTooltipModule } from '@angular/material/tooltip';\n\n@NgModule({\n\tdeclarations: [FileUploadComponent],\n\timports: [\n\t\tCommonModule,\n\t\tMatIconModule,\n\t\tIconFontModule,\n\t\tMatProgressBarModule,\n\t\tMatButtonModule,\n\t\tMatDividerModule,\n\t\tMatTooltipModule\n\t],\n\texports: [FileUploadComponent]\n})\nexport class FileUploadModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAIA;;;MAGa,cAAc;;IAc1B,YAAY,GAAW,EAAE,KAAa,EAAE,KAAa,EAAE,KAAa;QACnE,IAAI,CAAC,EAAE,GAAG,GAAG,CAAC;QACd,IAAI,CAAC,IAAI,GAAG,KAAK,CAAC;QAClB,IAAI,CAAC,IAAI,GAAG,KAAK,CAAC;QAClB,IAAI,CAAC,IAAI,GAAG,KAAK,CAAC;KAClB;CACD;AAED;;;;;;;M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AAa;wBACb,cAAc;wBACd,oBAAoB;wBACpB,eAAe;wBACf,gBAAgB;wBAChB,gBAAgB;qBAChB;oBACD,OAAO,EAAE,CAAC,mBAAmB,CAAC;iBAC9B;;;ACtBD;;;;;;"}
|
|
1
|
+
{"version":3,"file":"bravura-ui-file-upload.js","sources":["../../../projects/ui/file-upload/file-upload.service.ts","../../../projects/ui/file-upload/file-upload.component.ts","../../../projects/ui/file-upload/file-upload.component.html","../../../projects/ui/file-upload/file-upload.module.ts","../../../projects/ui/file-upload/bravura-ui-file-upload.ts"],"sourcesContent":["import { HttpEvent } from '@angular/common/http';\nimport { Injectable } from '@angular/core';\nimport { Observable } from 'rxjs';\n\n/**\n * This type represents a file or form item that has been sent as part of a multipart/form-data POST request.\n */\nexport class FileUploadItem {\n\t/** The original filename in the client's filesystem, as provided by the browser. */\n\tname: string;\n\n\t/** The size of the file item. */\n\tsize: number;\n\n\t/** An alpha-numeric string that uniquely identifies the file item. */\n\tid: string;\n\n\t/** The content type (MIME type) of the file. */\n\ttype: string;\n\n\t/** @internal */\n\tconstructor(_id: string, _name: string, _size: number, _type: string) {\n\t\tthis.id = _id;\n\t\tthis.name = _name;\n\t\tthis.size = _size;\n\t\tthis.type = _type;\n\t}\n}\n\n/**\n * This is an API for processing file upload requests.\n *\n * A sub class of this type handles multiple file requests, sent using multipart/form-data encoding type, as specified by RFC 1867.\n *\n * Please extend this type and provide it in an injector at the same level, or ancestral to that, of the `FileUploadComponent`.\n */\n@Injectable()\nexport abstract class FileUploadService {\n\t/**\n\t * Upload a list of selected files from the browser. The returned `Observable` array provides the update of the uploading progress\n\t * through HTTP events.\n\t */\n\tabstract upload(files: File[]): Array<Observable<HttpEvent<FileUploadItem>>>;\n\n\t/** List all the uploaded file items in the current HTTP session. This list excludes the files still in the process of being uploaded*/\n\tabstract list(): Observable<FileUploadItem[]>;\n\n\t/** Get the content of an uploaded file item as a `Blob`. */\n\tabstract get(id: string): Observable<Blob>;\n\n\t/** Delete an uploaded file item from the server. */\n\tabstract delete(id: string): Observable<void>;\n\n\t/** Delete all uploaded file items in the current HTTP session. */\n\tabstract clear?(): Observable<void>;\n}\n","import { animate, query, stagger, style, transition, trigger } from '@angular/animations';\nimport { HttpEvent, HttpEventType } from '@angular/common/http';\nimport { Component, ElementRef, forwardRef, HostListener, Input, OnDestroy, OnInit, ViewChild } from '@angular/core';\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';\nimport { Observable, of, Subject, Subscription } from 'rxjs';\nimport { FileUploadItem, FileUploadService } from './file-upload.service';\n\n/** @ignore */\nclass UploadingItem {\n\tprogress = 0;\n\tuploadedItem: FileUploadItem | null | undefined;\n\tdownloadingSubs?: Subscription;\n\tprivate subscription: Subscription;\n\tprivate file?: File;\n\n\tconstructor(item: FileUploadItem, oncancel: (item: UploadingItem) => void);\n\tconstructor(\n\t\tevent$: Observable<HttpEvent<FileUploadItem>> | FileUploadItem,\n\t\tfile: File,\n\t\toncomplete: () => void,\n\t\toncancel: (item: UploadingItem) => void\n\t);\n\tconstructor(\n\t\tevent$: Observable<HttpEvent<FileUploadItem>> | FileUploadItem,\n\t\tfileOrOncancel?: File | ((item: UploadingItem) => void),\n\t\toncomplete?: () => void,\n\t\tprivate oncancel?: (item: UploadingItem) => void\n\t) {\n\t\tif (event$ instanceof Observable) {\n\t\t\tthis.file = fileOrOncancel as File;\n\t\t\tthis.subscription = event$.subscribe({\n\t\t\t\tnext: evt => {\n\t\t\t\t\tif (evt.type === HttpEventType.UploadProgress) {\n\t\t\t\t\t\tthis.progress = evt.loaded / (this.file as File).size;\n\t\t\t\t\t} else if (evt.type === HttpEventType.Response) {\n\t\t\t\t\t\tthis.uploadedItem = evt.body;\n\t\t\t\t\t\tthis.progress = 1;\n\t\t\t\t\t\toncomplete!();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t} else {\n\t\t\tthis.subscription = of(event$).subscribe();\n\t\t\tthis.uploadedItem = event$;\n\t\t\tthis.oncancel = fileOrOncancel as (item: UploadingItem) => void;\n\t\t}\n\t}\n\n\tcancel() {\n\t\tthis.subscription.unsubscribe();\n\t\tthis.oncancel!(this);\n\t}\n\n\tget done() {\n\t\treturn !!this.uploadedItem;\n\t}\n\n\tget name() {\n\t\treturn this.uploadedItem?.name || this.file?.name;\n\t}\n\n\tget downloading() {\n\t\treturn this.downloadingSubs && !this.downloadingSubs.closed;\n\t}\n}\n/**\n * A control value accessor component to provide the user interface for uploading files.\n *\n * The application that integrates this UI must provide an implementation of `FileUploadService`.\n *\n * The control's value is a list of alpha-numerical strings, which are the identifiers to the uploaded files.\n *\n * Example:\n *\n * ```html\n * <form>\n * <bui-file-upload [(ngModel)]=\"uploadedFileIds\" name=\"myFiles\"></bui-file-upload>\n * </form>\n * ```\n *\n * @see FileUploadService\n */\n@Component({\n\thost: {\n\t\tclass: 'bui-host bui-file-upload',\n\t\t'[class.bui-dnd-active]': '_overFrame && remaining >= _numberOfFilesDragged',\n\t\t'[class.bui-dnd-over]': '_overDropZone && remaining >= _numberOfFilesDragged',\n\t\t'[class.bui-dnd-invalid]': '_invalidFilesDragged'\n\t},\n\tselector: 'bui-file-upload',\n\ttemplateUrl: './file-upload.component.html',\n\tstyleUrls: ['./file-upload.component.scss'],\n\tproviders: [{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => FileUploadComponent), multi: true }],\n\tanimations: [\n\t\ttrigger('slideOut', [\n\t\t\ttransition('* => *', [\n\t\t\t\tquery(':leave', stagger(100, animate('0.25s', style({ height: 0, overflow: 'hidden' }))), { optional: true })\n\t\t\t])\n\t\t])\n\t]\n})\nexport class FileUploadComponent implements OnInit, OnDestroy, ControlValueAccessor {\n\t/** @ignore */\n\t_value: string[] | null = null;\n\n\t/**\n\t * The caption of the button for opening file selection dialog.\n\t */\n\t@Input()\n\tuploadActionText = 'Drag files here to attach or browse';\n\n\t/**\n\t * The label for listing successful uploaded files.\n\t */\n\t@Input()\n\tfileUploadedLabel = 'List of files uploaded successfully';\n\n\t/**\n\t * The text to be displayed when the user starts to drag file items over the browser window.\n\t */\n\t@Input()\n\tdragHint = 'Please drag the files here.';\n\n\t/**\n\t * The text to be displayed when the user is dragging the file items over the drop zone.\n\t */\n\t@Input()\n\tdropHint = 'Please release the mouse button to start uploading.';\n\n\t/** Specifies the total number of files accepted. A falsy value removes the limit.*/\n\t@Input()\n\tlimit = 0;\n\n\t/**\n\t * specify the number of maximum bytes that can be uploaded.\n\t * if number is specified, bytes are assumed, otherwise enter a string for specific size type.\n\t */\n\t@Input()\n\tfileSize: number | string = '10MB';\n\n\t/**\n\t * Accepted MIME types\n\t *\n\t * @example ['text/*', 'image/png']\n\t */\n\t@Input()\n\tget types(): string[] {\n\t\treturn this._types;\n\t}\n\tset types(types: string[]) {\n\t\tif (Array.isArray(types) && types?.length) {\n\t\t\tthis._typeRegExps = [];\n\t\t\tthis._types = Array.from(types);\n\t\t\tthis._accept = this._types.join(',');\n\t\t\ttypes.forEach(t => this._typeRegExps.push(new RegExp(t.replace(/\\*/g, '.*'))));\n\t\t}\n\t}\n\n\t/** @ignore */\n\t_fileSizeExceedMsg: string = '';\n\n\t/** @ignore */\n\t_uploadingItems: UploadingItem[] = [];\n\n\t/** @ignore */\n\t_accept = '*/*';\n\n\t/** @ignore */\n\t_itemAnimationStart = new Subject<void>();\n\t/** @ignore */\n\t_itemAnimationDone = new Subject<void>();\n\t/** @ignore */\n\t_itemAnimationInProgress = false;\n\n\tprivate _onChange = (_: string[]) => {};\n\tprivate _onTouch = () => {};\n\tprivate _frameDndEnter: (event: DragEvent) => void;\n\tprivate _frameDndLeave: () => void;\n\tprivate _frameDndOver: (event: DragEvent) => void;\n\tprivate _frameDndStop: () => void;\n\tprivate _overFrameCounter = 0;\n\tprivate _overCounter = 0;\n\tprivate _typeRegExps: RegExp[] = [/.*\\/.*/];\n\tprivate _types: string[] = ['*/*'];\n\tprivate _initSubs?: Subscription;\n\tprivate _numberOfFilesDragged = 0;\n\n\t@ViewChild('fileInput', { read: ElementRef, static: true })\n\tprivate _fileInput!: ElementRef<HTMLInputElement>;\n\n\tconstructor(private _service: FileUploadService) {\n\t\tthis._onChange([]);\n\t\tthis._onTouch();\n\t\tthis._frameDndEnter = this._onDndEnterFrame.bind(this);\n\t\tthis._frameDndLeave = this._onDndLeaveFrame.bind(this);\n\t\tthis._frameDndStop = this._onDndStopFrame.bind(this);\n\t\tthis._frameDndOver = event => event.preventDefault();\n\t}\n\n\t/** @internal */\n\tngOnInit(): void {\n\t\tdocument.addEventListener('dragenter', this._frameDndEnter);\n\t\tdocument.addEventListener('dragleave', this._frameDndLeave);\n\t\tdocument.addEventListener('dragend', this._frameDndStop);\n\t\tdocument.addEventListener('drop', this._frameDndStop);\n\t\tdocument.addEventListener('dragover', this._frameDndOver);\n\t\tthis._itemAnimationStart.subscribe(() => (this._itemAnimationInProgress = true));\n\t\tthis._itemAnimationDone.subscribe(() => (this._itemAnimationInProgress = false));\n\t}\n\n\tngOnDestroy(): void {\n\t\tdocument.removeEventListener('dragenter', this._frameDndEnter);\n\t\tdocument.removeEventListener('dragleave', this._frameDndLeave);\n\t\tdocument.removeEventListener('dragend', this._frameDndStop);\n\t\tdocument.removeEventListener('drop', this._frameDndStop);\n\t\tdocument.removeEventListener('dragover', this._frameDndOver);\n\t\tthis._itemAnimationStart.complete();\n\t\tthis._itemAnimationDone.complete();\n\t}\n\n\t/** @internal */\n\twriteValue(obj: any): void {\n\t\tif (Array.isArray(obj)) {\n\t\t\tif (!this._value) {\n\t\t\t\tthis._acceptChange(obj);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst common = obj.filter(v => this._value!.includes(v));\n\t\t\tif (common.length === obj.length && common.length === this._value.length) {\n\t\t\t\treturn; // no change\n\t\t\t}\n\t\t\tthis._acceptChange(obj);\n\t\t} else {\n\t\t\tthis._value = null;\n\t\t}\n\t}\n\n\t/** @internal */\n\tregisterOnChange(fn: any): void {\n\t\tthis._onChange = fn;\n\t}\n\n\t/** @internal */\n\tregisterOnTouched(fn: any): void {\n\t\tthis._onTouch = fn;\n\t}\n\n\t/** @internal */\n\t@HostListener('dragenter', ['$event'])\n\tonDragEnter(event: DragEvent) {\n\t\tevent.preventDefault();\n\t\tevent.stopPropagation();\n\t\tthis._overCounter++;\n\t}\n\n\t/** @internal */\n\t@HostListener('dragover', ['$event'])\n\tonDragOver(event: Event) {\n\t\tevent.preventDefault();\n\t}\n\n\t/** @internal */\n\t@HostListener('dragleave', ['$event'])\n\tonDragLeave(event: Event) {\n\t\tevent.preventDefault();\n\t\tevent.stopPropagation();\n\t\tthis._overCounter--;\n\t}\n\n\t/** @internal */\n\t@HostListener('drop', ['$event'])\n\tonDndDrop(event: DragEvent) {\n\t\tevent.preventDefault();\n\t\tevent.stopPropagation();\n\t\tthis._onDndStopFrame();\n\t\tconst files = event.dataTransfer?.files;\n\t\tif (files?.length && this._validateFileSize(files)) {\n\t\t\tthis._uploadFiles(Array.from(files));\n\t\t}\n\t}\n\n\t/** Open the file selection dialog */\n\tselectFiles() {\n\t\tthis._fileInput.nativeElement.click();\n\t}\n\n\t/** @ignore */\n\t_openItem(item: UploadingItem) {\n\t\titem.downloadingSubs = this._service.get(item.uploadedItem!.id).subscribe(blob => {\n\t\t\tconst url = URL.createObjectURL(blob);\n\t\t\twindow.open(url, '_blank');\n\t\t});\n\t}\n\n\t/** @ignore */\n\tget _overFrame(): boolean {\n\t\treturn this._overFrameCounter > 0;\n\t}\n\n\t/** @ignore */\n\tget _overDropZone(): boolean {\n\t\treturn this._overCounter > 0;\n\t}\n\n\t/** Whether file uploading is in progress */\n\tget uploading(): boolean {\n\t\treturn this._uploadingItems.some(i => !i.done);\n\t}\n\n\t/** The remaining number of files allowed.*/\n\tget remaining(): number {\n\t\treturn this.limit ? this.limit - this._uploadingItems.length : Infinity;\n\t}\n\n\t/** @ignore */\n\t_handleFileSelection() {\n\t\tconst fileList = this._fileInput.nativeElement.files;\n\t\tif (fileList?.length && this._validateFileSize(fileList)) {\n\t\t\tthis._uploadFiles(Array.from(fileList));\n\t\t\tthis._fileInput.nativeElement.value = '';\n\t\t}\n\t}\n\n\t/** @ignore */\n\tget _invalidFilesDragged(): boolean {\n\t\treturn this._numberOfFilesDragged > this.remaining && (this._overFrame || this._overDropZone);\n\t}\n\n\t/** @ignore */\n\tget _initialising(): boolean {\n\t\treturn !!this._initSubs && !this._initSubs.closed;\n\t}\n\n\tprivate returnFileSize(size: number) {\n\t\tif (size < 1024) {\n\t\t\treturn `${size} bytes`;\n\t\t} else if (size >= 1024 && size < 1048576) {\n\t\t\treturn `${(size / 1024).toFixed(1)} KB`;\n\t\t} else {\n\t\t\treturn `${(size / 1048576).toFixed(1)} MB`;\n\t\t}\n\t}\n\n\tprivate _validateFileSize(files: FileList) {\n\t\tthis._fileSizeExceedMsg = '';\n\t\tconst maxSize = this.returnFileSize(this._getMaxBytes());\n\t\tfor (let i = 0; i < files.length; i++) {\n\t\t\tif (files[i]!.size > this._getMaxBytes()) {\n\t\t\t\tthis._fileSizeExceedMsg = `Selected file/s has exceeded the allowable size of ${maxSize} per file`;\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}\n\n\tprivate _getMaxBytes(): number {\n\t\tif (typeof this.fileSize === 'string') {\n\t\t\tif (this.fileSize.toUpperCase().endsWith('KB')) {\n\t\t\t\tconst kiloBytes = this.fileSize.substring(0, this.fileSize.indexOf('KB'));\n\t\t\t\treturn Number(kiloBytes) * 1024;\n\t\t\t} else if (this.fileSize.toUpperCase().endsWith('MB')) {\n\t\t\t\tconst megaBytes = this.fileSize.substring(0, this.fileSize.indexOf('MB'));\n\t\t\t\treturn Number(megaBytes) * 1048576;\n\t\t\t}\n\t\t}\n\t\treturn this.fileSize as number;\n\t}\n\n\tprivate _uploadFiles(files: File[]) {\n\t\tif (this._initialising || files.length > this.remaining) {\n\t\t\treturn;\n\t\t}\n\t\tconst filtered = files.filter(\n\t\t\tf =>\n\t\t\t\t(!f.type || this._typeRegExps.some(regexp => f.type.match(regexp))) &&\n\t\t\t\t!this._uploadingItems.some(i => i.name === f.name)\n\t\t);\n\t\tconst observables = this._service.upload(filtered);\n\t\tconst items = filtered.map(\n\t\t\t(f, i) => new UploadingItem(observables[i], f, this._updateItems.bind(this), this._deleteItem.bind(this))\n\t\t);\n\t\tthis._uploadingItems = [...this._uploadingItems, ...items];\n\t}\n\n\tprivate _onDndEnterFrame(event: DragEvent) {\n\t\tevent.preventDefault();\n\t\tthis._numberOfFilesDragged = event.dataTransfer?.items?.length || 0;\n\t\tthis._overFrameCounter++;\n\t}\n\n\tprivate _onDndLeaveFrame() {\n\t\tthis._overFrameCounter--;\n\t}\n\n\tprivate _onDndStopFrame() {\n\t\tthis._overFrameCounter = 0;\n\t\tthis._overCounter = 0;\n\t}\n\n\tprivate _acceptChange(v: string[]) {\n\t\tthis._initSubs = this._service.list().subscribe(list => {\n\t\t\tthis._uploadingItems = list\n\t\t\t\t.filter(i => v.includes(i.id))\n\t\t\t\t.map(f => new UploadingItem(f, this._deleteItem.bind(this)));\n\t\t});\n\t}\n\n\tprivate _updateItems() {\n\t\tconst completed = this._uploadingItems.filter(i => !!i.uploadedItem);\n\t\tthis._uploadingItems = [...completed, ...this._uploadingItems.filter(i => !i.uploadedItem)];\n\t\tthis._updateValue(completed);\n\t}\n\n\tprivate _deleteItem(item: UploadingItem) {\n\t\tconst key = item.uploadedItem?.id;\n\t\tif (key) {\n\t\t\tthis._service.delete(key).subscribe(() => {\n\t\t\t\tthis._uploadingItems = this._uploadingItems.filter(i => i !== item);\n\t\t\t\tconst completed = this._uploadingItems.filter(i => !!i.uploadedItem);\n\t\t\t\tthis._updateValue(completed);\n\t\t\t});\n\t\t} else {\n\t\t\tthis._uploadingItems = this._uploadingItems.filter(i => i !== item);\n\t\t\tconst completed = this._uploadingItems.filter(i => !!i.uploadedItem);\n\t\t\tthis._updateValue(completed);\n\t\t}\n\t}\n\n\tprivate _updateValue(completed: UploadingItem[]) {\n\t\tconst completedIds = completed.map(c => c.uploadedItem!.id);\n\t\tthis._value = completedIds;\n\t\tif (!this._value.length) {\n\t\t\tthis._value = null;\n\t\t}\n\t\tthis._onChange(completedIds);\n\t}\n}\n","<div class=\"bui-file-upload-container\">\n\t<div\n\t\tclass=\"bui-file-upload-hint\"\n\t\t*ngIf=\"!_initialising && remaining > 0 && (!_itemAnimationInProgress || remaining > 1)\"\n\t>\n\t\t<ng-template [ngIf]=\"_invalidFilesDragged\" [ngIfElse]=\"validDnd\">\n\t\t\t<mat-icon [buiIcon]=\"'block'\" [size]=\"32\" color=\"warn\" variant=\"outlined\" style=\"opacity: 0.6\"></mat-icon>\n\t\t</ng-template>\n\t\t<ng-template #validDnd>\n\t\t\t<div *ngIf=\"!_overFrame && !_overDropZone\" class=\"bui-color-muted bui-upload-icon-link\" (click)=\"selectFiles()\">\n\t\t\t\t<mat-icon [buiIcon]=\"'fas fa-cloud-upload-alt'\" [size]=\"32\"></mat-icon>\n\t\t\t\t<a role=\"button\">{{ uploadActionText }}</a>\n\t\t\t</div>\n\t\t\t<div *ngIf=\"_overFrame && !_overDropZone\" class=\"bui-color-light\">{{ dragHint }}</div>\n\t\t\t<div *ngIf=\"_overDropZone\" class=\"bui-color-light\">{{ dropHint }}</div>\n\t\t</ng-template>\n\t</div>\n\t<div\n\t\tclass=\"bui-file-upload-list\"\n\t\t[@slideOut]=\"_uploadingItems.length\"\n\t\t(@slideOut.start)=\"_itemAnimationStart.next()\"\n\t\t(@slideOut.done)=\"_itemAnimationDone.next()\"\n\t\t*ngIf=\"_uploadingItems.length\"\n\t>\n\t\t<span class=\"bui-file-uploaded-label\">{{ fileUploadedLabel }}</span>\n\n\t\t<ng-container *ngFor=\"let item of _uploadingItems; let idx = index\">\n\t\t\t<div class=\"bui-file-upload-item\" [class.in-progress]=\"!item.done\" #itemDiv>\n\t\t\t\t<div class=\"bui-file-upload-item-name\">\n\t\t\t\t\t<span>\n\t\t\t\t\t\t<mat-icon class=\"bui-color-muted\">description</mat-icon>\n\t\t\t\t\t\t<a\n\t\t\t\t\t\t\tclass=\"text\"\n\t\t\t\t\t\t\t*ngIf=\"item.done && !item.downloading; else staticName\"\n\t\t\t\t\t\t\thref=\"#{{ item.uploadedItem?.id }}\"\n\t\t\t\t\t\t\t(click)=\"$event.preventDefault(); _openItem(item)\"\n\t\t\t\t\t\t\tcontextmenu=\"false\"\n\t\t\t\t\t\t\tmatTooltip=\"Download\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{{ item.name }}\n\t\t\t\t\t\t</a>\n\t\t\t\t\t\t<ng-template #staticName>\n\t\t\t\t\t\t\t<span class=\"text\">{{ item.name }}</span>\n\t\t\t\t\t\t</ng-template>\n\t\t\t\t\t</span>\n\t\t\t\t\t<div class=\"bui-file-upload-item-progress\">\n\t\t\t\t\t\t<mat-progress-bar\n\t\t\t\t\t\t\tmode=\"determinate\"\n\t\t\t\t\t\t\t[class.upload-completed]=\"item.done\"\n\t\t\t\t\t\t\t*ngIf=\"!item.downloading\"\n\t\t\t\t\t\t\t[value]=\"item.done ? 100 : item.progress * 100\"\n\t\t\t\t\t\t></mat-progress-bar>\n\t\t\t\t\t\t<mat-progress-bar mode=\"buffer\" *ngIf=\"item.downloading\"></mat-progress-bar>\n\t\t\t\t\t\t<span>\n\t\t\t\t\t\t\t<ng-template [ngIf]=\"item.done\" [ngIfElse]=\"inprogress\"> 100% </ng-template>\n\t\t\t\t\t\t\t<ng-template #inprogress>\n\t\t\t\t\t\t\t\t{{ item.progress | percent }}\n\t\t\t\t\t\t\t</ng-template>\n\t\t\t\t\t\t</span>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t<div class=\"bui-file-upload-item-action\">\n\t\t\t\t\t<button\n\t\t\t\t\t\tmat-icon-button\n\t\t\t\t\t\tcolor=\"primary\"\n\t\t\t\t\t\t(click)=\"item.cancel()\"\n\t\t\t\t\t\t(mouseenter)=\"itemDiv.classList.add('bui-file-upload-item-deleting')\"\n\t\t\t\t\t\t(mouseleave)=\"itemDiv.classList.remove('bui-file-upload-item-deleting')\"\n\t\t\t\t\t\tmatTooltip=\"Delete\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<mat-icon [buiIcon]=\"'cancel'\" style=\"line-height: 0.9\"></mat-icon>\n\t\t\t\t\t</button>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<mat-divider *ngIf=\"idx < _uploadingItems.length - 1\"></mat-divider>\n\t\t</ng-container>\n\t</div>\n\t<input\n\t\ttype=\"file\"\n\t\t#fileInput\n\t\tstyle=\"display: none\"\n\t\taccept=\"{{ _accept }}\"\n\t\t(change)=\"_handleFileSelection()\"\n\t\t[multiple]=\"remaining > 1\"\n\t/>\n\n\t<div *ngIf=\"_fileSizeExceedMsg\" class=\"bui-color-warn bui-file-size-exceed\">\n\t\t<span> {{ _fileSizeExceedMsg }}</span> <mat-icon role=\"button\" (click)=\"_fileSizeExceedMsg = ''\">cancel</mat-icon>\n\t</div>\n</div>\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { FileUploadComponent } from './file-upload.component';\nimport { MatIconModule } from '@angular/material/icon';\nimport { IconFontModule } from '@bravura/ui/icon-font';\nimport { MatProgressBarModule } from '@angular/material/progress-bar';\nimport { MatButtonModule } from '@angular/material/button';\nimport { MatDividerModule } from '@angular/material/divider';\nimport { MatTooltipModule } from '@angular/material/tooltip';\n\n@NgModule({\n\tdeclarations: [FileUploadComponent],\n\timports: [\n\t\tCommonModule,\n\t\tMatIconModule,\n\t\tIconFontModule,\n\t\tMatProgressBarModule,\n\t\tMatButtonModule,\n\t\tMatDividerModule,\n\t\tMatTooltipModule\n\t],\n\texports: [FileUploadComponent]\n})\nexport class FileUploadModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAIA;;;MAGa,cAAc;;IAc1B,YAAY,GAAW,EAAE,KAAa,EAAE,KAAa,EAAE,KAAa;QACnE,IAAI,CAAC,EAAE,GA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AAY;uBAAC,WAAW,EAAE,CAAC,QAAQ,CAAC;gBASrC,UAAU;sBADT,YAAY;uBAAC,UAAU,EAAE,CAAC,QAAQ,CAAC;gBAOpC,WAAW;sBADV,YAAY;uBAAC,WAAW,EAAE,CAAC,QAAQ,CAAC;gBASrC,SAAS;sBADR,YAAY;uBAAC,MAAM,EAAE,CAAC,QAAQ,CAAC;;;MEvPpB,gBAAgB;;8GAAhB,gBAAgB;+GAAhB,gBAAgB,iBAZb,mBAAmB,aAEjC,YAAY;QACZ,aAAa;QACb,cAAc;QACd,oBAAoB;QACpB,eAAe;QACf,gBAAgB;QAChB,gBAAgB,aAEP,mBAAmB;+GAEjB,gBAAgB,YAXnB;YACR,YAAY;YACZ,aAAa;YACb,cAAc;YACd,oBAAoB;YACpB,eAAe;YACf,gBAAgB;YAChB,gBAAgB;SAChB;4FAGW,gBAAgB;kBAb5B,QAAQ;mBAAC;oBACT,YAAY,EAAE,CAAC,mBAAmB,CAAC;oBACnC,OAAO,EAAE;wBACR,YAAY;wBACZ,aAAa;wBACb,cAAc;wBACd,oBAAoB;wBACpB,eAAe;wBACf,gBAAgB;wBAChB,gBAAgB;qBAChB;oBACD,OAAO,EAAE,CAAC,mBAAmB,CAAC;iBAC9B;;;ACtBD;;;;;;"}
|
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { Directive, Inject, Input, Component, ChangeDetectionStrategy, Host, NgModule } from '@angular/core';
|
|
3
|
+
import { DOCUMENT, CommonModule } from '@angular/common';
|
|
4
|
+
import { generateID } from '@bravura/ui/common';
|
|
5
|
+
import * as i2 from '@angular/material/card';
|
|
6
|
+
import { MatCardModule } from '@angular/material/card';
|
|
7
|
+
import * as i3 from '@bravura/ui/behavior';
|
|
8
|
+
import { BehaviorModule } from '@bravura/ui/behavior';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* A "tinted" element has a shaded background specified by the `ThemePalette`, which
|
|
12
|
+
* is compatible with both light and dark themes.
|
|
13
|
+
*/
|
|
14
|
+
class TintedDirective {
|
|
15
|
+
constructor(_doc, elemRef) {
|
|
16
|
+
this._doc = _doc;
|
|
17
|
+
this._color = 'default';
|
|
18
|
+
this._addedStyle = this._doc.createElement('style');
|
|
19
|
+
this._attr = 'bui-tinted-' + generateID();
|
|
20
|
+
this._element = elemRef.nativeElement;
|
|
21
|
+
elemRef.nativeElement.setAttribute(this._attr, '');
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* The base color of the shaded background
|
|
25
|
+
* @default 'primary'
|
|
26
|
+
*/
|
|
27
|
+
get color() {
|
|
28
|
+
return this._color;
|
|
29
|
+
}
|
|
30
|
+
set color(c) {
|
|
31
|
+
this._color = c;
|
|
32
|
+
this.generateStyle();
|
|
33
|
+
}
|
|
34
|
+
ngOnInit() {
|
|
35
|
+
this._element.style.position = 'relative';
|
|
36
|
+
this.generateStyle();
|
|
37
|
+
this._element.appendChild(this._addedStyle);
|
|
38
|
+
}
|
|
39
|
+
ngOnDestroy() {
|
|
40
|
+
this._element.removeChild(this._addedStyle);
|
|
41
|
+
}
|
|
42
|
+
generateStyle() {
|
|
43
|
+
this._addedStyle.innerText =
|
|
44
|
+
`[${this._attr}]::after { position: absolute; opacity: 0.1; border-radius: inherit; display: block; content: ''; ` +
|
|
45
|
+
` background-color: var(--bui-color-${this.color}); top: 0; left: 0; ` +
|
|
46
|
+
` bottom: 0; right: 0; pointer-events: none; }`;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
TintedDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: TintedDirective, deps: [{ token: DOCUMENT }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
50
|
+
TintedDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.16", type: TintedDirective, selector: "[buiTinted], bui-panel", inputs: { color: ["buiTinted", "color"] }, host: { classAttribute: "bui-host" }, exportAs: ["buiTinted"], ngImport: i0 });
|
|
51
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: TintedDirective, decorators: [{
|
|
52
|
+
type: Directive,
|
|
53
|
+
args: [{
|
|
54
|
+
selector: '[buiTinted], bui-panel',
|
|
55
|
+
host: { class: 'bui-host' },
|
|
56
|
+
exportAs: 'buiTinted'
|
|
57
|
+
}]
|
|
58
|
+
}], ctorParameters: function () { return [{ type: Document, decorators: [{
|
|
59
|
+
type: Inject,
|
|
60
|
+
args: [DOCUMENT]
|
|
61
|
+
}] }, { type: i0.ElementRef }]; }, propDecorators: { color: [{
|
|
62
|
+
type: Input,
|
|
63
|
+
args: ['buiTinted']
|
|
64
|
+
}] } });
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* A `bui-panel` consists of a `mat-card` and a tinted backdrop.
|
|
68
|
+
*
|
|
69
|
+
* Unlike `mat-card`, `bui-panel` has a flat appearance by default and a transparent background.
|
|
70
|
+
* The backdrop is nearly transparent, blending the theme palette `color`
|
|
71
|
+
* and the effective background color of the DOM ancestors.
|
|
72
|
+
*
|
|
73
|
+
* `bui-panel` supports all the content child directives of `mat-card` as well as `bui-panel-section`.
|
|
74
|
+
*
|
|
75
|
+
* `bui-panel-section`s are subdivisions of `bui-panel` that rearrange their orientation based on the width of the container element.
|
|
76
|
+
*
|
|
77
|
+
*/
|
|
78
|
+
class PanelComponent {
|
|
79
|
+
constructor(_cd, _tinted) {
|
|
80
|
+
this._cd = _cd;
|
|
81
|
+
this._tinted = _tinted;
|
|
82
|
+
/**
|
|
83
|
+
* The width of the host element, at which the panel section container will change its orientation.
|
|
84
|
+
*/
|
|
85
|
+
this.breakpoint = 600;
|
|
86
|
+
/** @ignore */
|
|
87
|
+
this._width = 600;
|
|
88
|
+
this._color = 'primary';
|
|
89
|
+
this._appearance = 'flat';
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* This property defines the background (shaded) and border colors of the panel
|
|
93
|
+
*/
|
|
94
|
+
get color() {
|
|
95
|
+
return this._color;
|
|
96
|
+
}
|
|
97
|
+
set color(value) {
|
|
98
|
+
this._color = value;
|
|
99
|
+
this._tinted.color = value;
|
|
100
|
+
this._cd.markForCheck();
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* In contrast to using a `mat-card` alone, a `bui-panel` does not have a elevated appearance by default.
|
|
104
|
+
*
|
|
105
|
+
* This property can change the default appearance to
|
|
106
|
+
*
|
|
107
|
+
* * `raised` - the original `mat-card` default
|
|
108
|
+
* * `outline` - a `mat-card` with borders
|
|
109
|
+
* * `flat` - no border or elevation
|
|
110
|
+
*/
|
|
111
|
+
get appearance() {
|
|
112
|
+
return this._appearance;
|
|
113
|
+
}
|
|
114
|
+
set appearance(value) {
|
|
115
|
+
this._appearance = value;
|
|
116
|
+
this._cd.markForCheck();
|
|
117
|
+
}
|
|
118
|
+
ngOnInit() { }
|
|
119
|
+
/** @ignore */
|
|
120
|
+
_resized(width) {
|
|
121
|
+
this._width = width;
|
|
122
|
+
this._cd.markForCheck();
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
PanelComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: PanelComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: TintedDirective, host: true }], target: i0.ɵɵFactoryTarget.Component });
|
|
126
|
+
PanelComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: PanelComponent, selector: "bui-panel", inputs: { backdropClass: "backdropClass", cardClass: "cardClass", color: "color", appearance: "appearance", breakpoint: "breakpoint" }, host: { properties: { "class.bui-panel-vertical": "_width < breakpoint", "class.bui-panel-horizontal": "_width >= breakpoint" }, classAttribute: "bui-panel bui-host" }, ngImport: i0, template: "<mat-card\n\t[buiSizingBy]=\"'parent'\"\n\t(buiResized)=\"_resized($event.width)\"\n\tclass=\"bui-border-{{ color || 'none' }} {{ cardClass }} {{\n\t\tappearance === 'flat' ? 'mat-elevation-z' : appearance === 'outlined' ? 'mat-elevation-z bui-panel-border' : ''\n\t}}\"\n>\n\t<ng-content></ng-content>\n</mat-card>\n", styles: [":host{position:relative}:host .bui-panel-border{border-width:1px;border-style:solid}:host ::ng-deep .bui-panel-section-container{display:flex;box-sizing:border-box!important}:host(:not([hidden])){display:block}:host(:not([hidden])) .mat-card{background-color:transparent}:host(.bui-panel-horizontal) ::ng-deep .bui-panel-section-container{flex-direction:row}:host(.bui-panel-vertical) ::ng-deep .bui-panel-section-container{flex-direction:column}\n"], components: [{ type: i2.MatCard, selector: "mat-card", exportAs: ["matCard"] }], directives: [{ type: i3.SizingDirective, selector: "[buiSizing],[buiResized],[buiSizingBy],[buiFixedHeight]", inputs: ["buiSizing", "sizingBy", "buiSizingBy", "buiFixedHeight"], outputs: ["buiResized"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
127
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: PanelComponent, decorators: [{
|
|
128
|
+
type: Component,
|
|
129
|
+
args: [{
|
|
130
|
+
selector: 'bui-panel',
|
|
131
|
+
templateUrl: './panel.component.html',
|
|
132
|
+
styleUrls: ['./panel.component.scss'],
|
|
133
|
+
host: {
|
|
134
|
+
class: 'bui-panel bui-host',
|
|
135
|
+
'[class.bui-panel-vertical]': `_width < breakpoint`,
|
|
136
|
+
'[class.bui-panel-horizontal]': `_width >= breakpoint`
|
|
137
|
+
},
|
|
138
|
+
changeDetection: ChangeDetectionStrategy.OnPush
|
|
139
|
+
}]
|
|
140
|
+
}], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }, { type: TintedDirective, decorators: [{
|
|
141
|
+
type: Host
|
|
142
|
+
}] }]; }, propDecorators: { backdropClass: [{
|
|
143
|
+
type: Input
|
|
144
|
+
}], cardClass: [{
|
|
145
|
+
type: Input
|
|
146
|
+
}], color: [{
|
|
147
|
+
type: Input
|
|
148
|
+
}], appearance: [{
|
|
149
|
+
type: Input
|
|
150
|
+
}], breakpoint: [{
|
|
151
|
+
type: Input
|
|
152
|
+
}] } });
|
|
153
|
+
|
|
154
|
+
const CONTAINER_PREFIX = 'bui-panel-section-container';
|
|
155
|
+
const COUNT_ATTR = 'bui-section-count';
|
|
156
|
+
/**
|
|
157
|
+
* `bui-panel-section`s are subdivisions of `bui-panel` that rearrange their orientation based on the width of the container element.
|
|
158
|
+
*/
|
|
159
|
+
class PanelSectionComponent {
|
|
160
|
+
constructor(_elementRef) {
|
|
161
|
+
this._elementRef = _elementRef;
|
|
162
|
+
}
|
|
163
|
+
ngOnInit() {
|
|
164
|
+
this._parentElement = this._elementRef.nativeElement.parentElement;
|
|
165
|
+
this._parentElement.classList.add(CONTAINER_PREFIX);
|
|
166
|
+
this._calcCount(1);
|
|
167
|
+
}
|
|
168
|
+
ngOnDestroy() {
|
|
169
|
+
this._calcCount(-1);
|
|
170
|
+
}
|
|
171
|
+
_calcCount(delta) {
|
|
172
|
+
let count = this._parentElement.getAttribute(COUNT_ATTR);
|
|
173
|
+
if (count) {
|
|
174
|
+
this._parentElement.classList.remove(`${CONTAINER_PREFIX}-${count}`);
|
|
175
|
+
}
|
|
176
|
+
else {
|
|
177
|
+
count = '0';
|
|
178
|
+
}
|
|
179
|
+
count = `${Math.max(Number(count) + delta, 0)}`;
|
|
180
|
+
this._parentElement.setAttribute(COUNT_ATTR, count);
|
|
181
|
+
this._parentElement.classList.add(`${CONTAINER_PREFIX}-${count}`);
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
PanelSectionComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: PanelSectionComponent, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
185
|
+
PanelSectionComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: PanelSectionComponent, selector: "bui-panel-section", host: { classAttribute: "bui-panel-section" }, ngImport: i0, template: "<ng-content></ng-content>\n", styles: [":host{flex-grow:1}:host-context(.bui-panel-horizontal) :host:not(:first-child){border-inline-start:1px solid rgba(128,128,128,.2);padding-inline-start:16px}:host-context(.bui-panel-horizontal) :host:not(:last-child){padding-inline-end:16px}:host-context(.bui-panel-vertical) :host:not(:first-child){border-top:1px solid rgba(128,128,128,.2);padding-top:16px}:host-context(.bui-panel-vertical) :host:not(:last-child){padding-bottom:16px}:host-context(.bui-panel-horizontal .bui-panel-section-container-2){flex-basis:50%}:host-context(.bui-panel-horizontal .bui-panel-section-container-3){flex-basis:33.3333333333%}:host-context(.bui-panel-horizontal .bui-panel-section-container-4){flex-basis:25%}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
186
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: PanelSectionComponent, decorators: [{
|
|
187
|
+
type: Component,
|
|
188
|
+
args: [{
|
|
189
|
+
selector: 'bui-panel-section',
|
|
190
|
+
templateUrl: './panel-section.component.html',
|
|
191
|
+
styleUrls: ['./panel-section.component.scss'],
|
|
192
|
+
host: {
|
|
193
|
+
class: 'bui-panel-section'
|
|
194
|
+
},
|
|
195
|
+
changeDetection: ChangeDetectionStrategy.OnPush
|
|
196
|
+
}]
|
|
197
|
+
}], ctorParameters: function () { return [{ type: i0.ElementRef }]; } });
|
|
198
|
+
|
|
199
|
+
class PanelModule {
|
|
200
|
+
}
|
|
201
|
+
PanelModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: PanelModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
202
|
+
PanelModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: PanelModule, declarations: [PanelComponent, PanelSectionComponent, TintedDirective], imports: [CommonModule, MatCardModule, BehaviorModule], exports: [MatCardModule, PanelComponent, PanelSectionComponent, TintedDirective] });
|
|
203
|
+
PanelModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: PanelModule, imports: [[CommonModule, MatCardModule, BehaviorModule], MatCardModule] });
|
|
204
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: PanelModule, decorators: [{
|
|
205
|
+
type: NgModule,
|
|
206
|
+
args: [{
|
|
207
|
+
declarations: [PanelComponent, PanelSectionComponent, TintedDirective],
|
|
208
|
+
imports: [CommonModule, MatCardModule, BehaviorModule],
|
|
209
|
+
exports: [MatCardModule, PanelComponent, PanelSectionComponent, TintedDirective]
|
|
210
|
+
}]
|
|
211
|
+
}] });
|
|
212
|
+
|
|
213
|
+
/**
|
|
214
|
+
* Generated bundle index. Do not edit.
|
|
215
|
+
*/
|
|
216
|
+
|
|
217
|
+
export { PanelComponent, PanelModule, PanelSectionComponent, TintedDirective };
|
|
218
|
+
//# sourceMappingURL=bravura-ui-panel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bravura-ui-panel.js","sources":["../../../projects/ui/panel/tinted.directive.ts","../../../projects/ui/panel/panel.component.ts","../../../projects/ui/panel/panel.component.html","../../../projects/ui/panel/panel-section.component.ts","../../../projects/ui/panel/panel-section.component.html","../../../projects/ui/panel/panel.module.ts","../../../projects/ui/panel/bravura-ui-panel.ts"],"sourcesContent":["import { DOCUMENT } from '@angular/common';\nimport { Directive, ElementRef, Inject, Input, OnDestroy, OnInit } from '@angular/core';\nimport { ThemePalette } from '@angular/material/core';\nimport { generateID } from '@bravura/ui/common';\n\n/**\n * A \"tinted\" element has a shaded background specified by the `ThemePalette`, which\n * is compatible with both light and dark themes.\n */\n@Directive({\n\tselector: '[buiTinted], bui-panel',\n\thost: { class: 'bui-host' },\n\texportAs: 'buiTinted'\n})\nexport class TintedDirective implements OnInit, OnDestroy {\n\t/**\n\t * The base color of the shaded background\n\t * @default 'primary'\n\t */\n\t@Input('buiTinted')\n\tget color(): ThemePalette {\n\t\treturn this._color;\n\t}\n\tset color(c: ThemePalette) {\n\t\tthis._color = c;\n\t\tthis.generateStyle();\n\t}\n\n\tprivate _color: any = 'default';\n\n\tprivate readonly _addedStyle: HTMLStyleElement;\n\tprivate readonly _attr: string;\n\tprivate _element: HTMLElement;\n\n\tconstructor(@Inject(DOCUMENT) private _doc: Document, elemRef: ElementRef<HTMLElement>) {\n\t\tthis._addedStyle = this._doc.createElement('style');\n\t\tthis._attr = 'bui-tinted-' + generateID();\n\t\tthis._element = elemRef.nativeElement;\n\t\telemRef.nativeElement.setAttribute(this._attr, '');\n\t}\n\n\tngOnInit(): void {\n\t\tthis._element.style.position = 'relative';\n\t\tthis.generateStyle();\n\t\tthis._element.appendChild(this._addedStyle);\n\t}\n\n\tngOnDestroy(): void {\n\t\tthis._element.removeChild(this._addedStyle);\n\t}\n\n\tprivate generateStyle(): void {\n\t\tthis._addedStyle.innerText =\n\t\t\t`[${this._attr}]::after { position: absolute; opacity: 0.1; border-radius: inherit; display: block; content: ''; ` +\n\t\t\t` background-color: var(--bui-color-${this.color}); top: 0; left: 0; ` +\n\t\t\t` bottom: 0; right: 0; pointer-events: none; }`;\n\t}\n}\n","import { ChangeDetectionStrategy, ChangeDetectorRef, Component, Host, Input, OnInit } from '@angular/core';\nimport { ThemePalette } from '@angular/material/core';\nimport { TintedDirective } from './tinted.directive';\n\n/**\n * A `bui-panel` consists of a `mat-card` and a tinted backdrop.\n *\n * Unlike `mat-card`, `bui-panel` has a flat appearance by default and a transparent background.\n * The backdrop is nearly transparent, blending the theme palette `color`\n * and the effective background color of the DOM ancestors.\n *\n * `bui-panel` supports all the content child directives of `mat-card` as well as `bui-panel-section`.\n *\n * `bui-panel-section`s are subdivisions of `bui-panel` that rearrange their orientation based on the width of the container element.\n *\n */\n@Component({\n\tselector: 'bui-panel',\n\ttemplateUrl: './panel.component.html',\n\tstyleUrls: ['./panel.component.scss'],\n\thost: {\n\t\tclass: 'bui-panel bui-host',\n\t\t'[class.bui-panel-vertical]': `_width < breakpoint`,\n\t\t'[class.bui-panel-horizontal]': `_width >= breakpoint`\n\t},\n\tchangeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class PanelComponent implements OnInit {\n\t/**\n\t * Additional style classes on the tinted backdrop element.\n\t * @deprecated\n\t * @ignore\n\t */\n\t@Input()\n\tbackdropClass?: string;\n\n\t/**\n\t * Additional style classes on the `<mat-card>` element.\n\t */\n\t@Input()\n\tcardClass?: string;\n\n\t/**\n\t * This property defines the background (shaded) and border colors of the panel\n\t */\n\t@Input()\n\tget color(): ThemePalette {\n\t\treturn this._color;\n\t}\n\tset color(value: ThemePalette) {\n\t\tthis._color = value;\n\t\tthis._tinted.color = value;\n\t\tthis._cd.markForCheck();\n\t}\n\n\t/**\n\t * In contrast to using a `mat-card` alone, a `bui-panel` does not have a elevated appearance by default.\n\t *\n\t * This property can change the default appearance to\n\t *\n\t * * `raised` - the original `mat-card` default\n\t * * `outline` - a `mat-card` with borders\n\t * * `flat` - no border or elevation\n\t */\n\t@Input()\n\tget appearance(): 'outlined' | 'raised' | 'flat' {\n\t\treturn this._appearance;\n\t}\n\tset appearance(value: 'outlined' | 'raised' | 'flat') {\n\t\tthis._appearance = value;\n\t\tthis._cd.markForCheck();\n\t}\n\n\t/**\n\t * The width of the host element, at which the panel section container will change its orientation.\n\t */\n\t@Input()\n\tbreakpoint = 600;\n\n\t/** @ignore */\n\t_width = 600;\n\n\tprivate _color: ThemePalette = 'primary';\n\n\tprivate _appearance: 'outlined' | 'raised' | 'flat' = 'flat';\n\n\tconstructor(private _cd: ChangeDetectorRef, @Host() private _tinted: TintedDirective) {}\n\n\tngOnInit(): void {}\n\n\t/** @ignore */\n\t_resized(width: number): void {\n\t\tthis._width = width;\n\t\tthis._cd.markForCheck();\n\t}\n}\n","<mat-card\n\t[buiSizingBy]=\"'parent'\"\n\t(buiResized)=\"_resized($event.width)\"\n\tclass=\"bui-border-{{ color || 'none' }} {{ cardClass }} {{\n\t\tappearance === 'flat' ? 'mat-elevation-z' : appearance === 'outlined' ? 'mat-elevation-z bui-panel-border' : ''\n\t}}\"\n>\n\t<ng-content></ng-content>\n</mat-card>\n","import { ChangeDetectionStrategy, Component, ElementRef, OnDestroy, OnInit } from '@angular/core';\n\nconst CONTAINER_PREFIX = 'bui-panel-section-container';\n\nconst COUNT_ATTR = 'bui-section-count';\n/**\n * `bui-panel-section`s are subdivisions of `bui-panel` that rearrange their orientation based on the width of the container element.\n */\n@Component({\n\tselector: 'bui-panel-section',\n\ttemplateUrl: './panel-section.component.html',\n\tstyleUrls: ['./panel-section.component.scss'],\n\thost: {\n\t\tclass: 'bui-panel-section'\n\t},\n\tchangeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class PanelSectionComponent implements OnInit, OnDestroy {\n\tprivate _parentElement!: HTMLElement;\n\n\tconstructor(private _elementRef: ElementRef<HTMLElement>) {}\n\n\tngOnInit(): void {\n\t\tthis._parentElement = this._elementRef.nativeElement.parentElement!;\n\t\tthis._parentElement.classList.add(CONTAINER_PREFIX);\n\t\tthis._calcCount(1);\n\t}\n\n\tngOnDestroy(): void {\n\t\tthis._calcCount(-1);\n\t}\n\n\tprivate _calcCount(delta: number) {\n\t\tlet count = this._parentElement.getAttribute(COUNT_ATTR);\n\t\tif (count) {\n\t\t\tthis._parentElement.classList.remove(`${CONTAINER_PREFIX}-${count}`);\n\t\t} else {\n\t\t\tcount = '0';\n\t\t}\n\t\tcount = `${Math.max(Number(count) + delta, 0)}`;\n\t\tthis._parentElement.setAttribute(COUNT_ATTR, count);\n\t\tthis._parentElement.classList.add(`${CONTAINER_PREFIX}-${count}`);\n\t}\n}\n","<ng-content></ng-content>\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { PanelComponent } from './panel.component';\nimport { MatCardModule } from '@angular/material/card';\nimport { BehaviorModule } from '@bravura/ui/behavior';\nimport { PanelSectionComponent } from './panel-section.component';\nimport { TintedDirective } from './tinted.directive';\n\n@NgModule({\n\tdeclarations: [PanelComponent, PanelSectionComponent, TintedDirective],\n\timports: [CommonModule, MatCardModule, BehaviorModule],\n\texports: [MatCardModule, PanelComponent, PanelSectionComponent, TintedDirective]\n})\nexport class PanelModule {}\n\nexport { PanelComponent, PanelSectionComponent, TintedDirective };\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;AAKA;;;;MASa,eAAe;IAoB3B,YAAsC,IAAc,EAAE,OAAgC;QAAhD,SAAI,GAAJ,IAAI,CAAU;QAN5C,WAAM,GAAQ,SAAS,CAAC;QAO/B,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;QACpD,IAAI,CAAC,KAAK,GAAG,aAAa,GAAG,UAAU,EAAE,CAAC;QAC1C,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC,aAAa,CAAC;QACtC,OAAO,CAAC,aAAa,CAAC,YAAY,CAAC,IAAI,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;KACnD;;;;;IApBD,IACI,KAAK;QACR,OAAO,IAAI,CAAC,MAAM,CAAC;KACnB;IACD,IAAI,KAAK,CAAC,CAAe;QACxB,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC;QAChB,IAAI,CAAC,aAAa,EAAE,CAAC;KACrB;IAeD,QAAQ;QACP,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,QAAQ,GAAG,UAAU,CAAC;QAC1C,IAAI,CAAC,aAAa,EAAE,CAAC;QACrB,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;KAC5C;IAED,WAAW;QACV,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;KAC5C;IAEO,aAAa;QACpB,IAAI,CAAC,WAAW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ion: "12.0.0", version: "12.2.16", ngImport: i0, type: RadioPanelItemComponent, deps: [{ token: MAT_RADIO_GROUP, optional: true }, { token: i0.ElementRef }, { token: i0.ChangeDetectorRef }, { token: i1.FocusMonitor }, { token: i2.UniqueSelectionDispatcher }, { token: ANIMATION_MODULE_TYPE, optional: true }, { token: MAT_RADIO_DEFAULT_OPTIONS, optional: true }, { token: 'tabindex', attribute: true }], target: i0.ɵɵFactoryTarget.Component });
|
|
38
|
-
RadioPanelItemComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: RadioPanelItemComponent, selector: "bui-radio-panel-item", inputs: { disableRipple: "disableRipple", tabIndex: "tabIndex", title: "title", _tickPosition: "_tickPosition", tickPosition: "tickPosition" }, host: { listeners: { "focus": "_inputElement.nativeElement.focus()" }, properties: { "class.bui-radio-checked": "checked", "class.bui-disabled": "disabled", "class._mat-animation-noopable": "_noopAnimations", "class.mat-primary": "color === \"primary\"", "class.mat-accent": "color === \"accent\"", "class.mat-warn": "color === \"warn\"", "attr.tabindex": "null", "attr.id": "id", "attr.aria-label": "null", "attr.aria-labelledby": "null", "attr.aria-describedby": "null", "style.--panel-width": "this.panelWidth" }, classAttribute: "bui-radio-panel-item" }, queries: [{ propertyName: "contentOnSelect", first: true, predicate: ["contentOnSelect"], descendants: true }], exportAs: ["matRadioButton"], usesInheritance: true, ngImport: i0, template: "<label\n\tmatRipple\n\tmatRippleColor=\"rgba(128,128,128,.1)\"\n\t[matRippleDisabled]=\"disabled || checked\"\n\t[attr.for]=\"inputId\"\n\t#label\n\tclass=\"bui-radio-panel-item-label bui-border-{{ checked ? color : 'default' }}\"\n>\n\t<div class=\"bui-radio-panel-item-wrapper\" [class.bui-radio-tick-at-end]=\"tickPosition === 'end'\">\n\t\t<div class=\"bui-label-header\">\n\t\t\t<span class=\"bui-label-title\" [innerHTML]=\"title\"></span>\n\t\t\t<ng-content select=\"[buiRadioItemHeadingEnd]\"></ng-content>\n\t\t\t<span class=\"bui-radio-panel-item-circle\">\n\t\t\t\t<span\n\t\t\t\t\tclass=\"bui-persistent-ripple\"\n\t\t\t\t\tmatRipple\n\t\t\t\t\tmatRippleColor=\"rgba(128,128,128,.1)\"\n\t\t\t\t\t[matRippleCentered]=\"true\"\n\t\t\t\t\t[matRippleUnbounded]=\"true\"\n\t\t\t\t\t[matRippleTrigger]=\"label\"\n\t\t\t\t\t[matRippleRadius]=\"20\"\n\t\t\t\t\t*ngIf=\"!disabled\"\n\t\t\t\t></span>\n\t\t\t\t<mat-icon [color]=\"color\" *ngIf=\"checked\">check_circle</mat-icon>\n\t\t\t\t<mat-icon *ngIf=\"!checked\" class=\"bui-radio-panel-item-circle-unchecked\">radio_button_unchecked</mat-icon>\n\t\t\t</span>\n\t\t</div>\n\t\t<!-- The actual 'radio' part of the control. -->\n\t\t<span class=\"radio-container\">\n\t\t\t<input\n\t\t\t\t#input\n\t\t\t\tclass=\"mat-radio-input cdk-visually-hidden\"\n\t\t\t\ttype=\"radio\"\n\t\t\t\t[id]=\"inputId\"\n\t\t\t\t[checked]=\"checked\"\n\t\t\t\t[disabled]=\"disabled\"\n\t\t\t\t[tabIndex]=\"tabIndex\"\n\t\t\t\t[attr.name]=\"name\"\n\t\t\t\t[attr.value]=\"value\"\n\t\t\t\t[required]=\"required\"\n\t\t\t\t[attr.aria-label]=\"ariaLabel\"\n\t\t\t\t[attr.aria-labelledby]=\"ariaLabelledby\"\n\t\t\t\t[attr.aria-describedby]=\"ariaDescribedby\"\n\t\t\t\t(change)=\"_onInputInteraction($event)\"\n\t\t\t\t(click)=\"_onInputClick($event)\"\n\t\t\t/>\n\t\t</span>\n\n\t\t<div class=\"bui-label-content-gap\"></div>\n\t\t<!-- The label content for radio control. -->\n\t\t<div class=\"bui-label-content\">\n\t\t\t<ng-content></ng-content>\n\t\t</div>\n\t\t<div class=\"bui-label-content\" *ngIf=\"contentOnSelect && checked\" @slideInOut>\n\t\t\t<ng-container *ngTemplateOutlet=\"contentOnSelect\"></ng-container>\n\t\t</div>\n\t</div>\n</label>\n", styles: [":host .bui-ripple,:host .bui-persistent-ripple{position:absolute;top:0;right:0;bottom:0;left:0}:host .bui-radio-panel-item-overlay{background-color:#fff;opacity:0}:host .bui-radio-panel-item-circle{width:40px;height:40px}:host .bui-radio-panel-item-label{display:block;border-radius:5px;border:1px solid rgba(128,128,128,.2);padding:1px;position:relative;height:100%}:host .bui-radio-panel-item-label .bui-radio-panel-item-circle-unchecked{color:#80808066}:host .bui-radio-panel-item-wrapper.bui-radio-tick-at-end .bui-label-header{padding:calc(1rem - 10px) calc(1rem - 10px) 0 1rem;justify-content:space-between}:host .bui-radio-panel-item-wrapper:not(.bui-radio-tick-at-end) .bui-label-header{padding:calc(1rem - 10px) calc(1rem - 10px) 0 calc(1rem - 10px)}:host .bui-radio-panel-item-wrapper:not(.bui-radio-tick-at-end) .bui-radio-panel-item-circle{order:-1}:host .bui-label-header,:host .bui-radio-panel-item-circle{display:flex;align-items:center}:host .bui-label-header{margin-bottom:calc(1rem - 10px)}:host .bui-label-title{font-size:larger;font-weight:bold}:host .bui-radio-panel-item-circle{justify-content:center;position:relative}:host .bui-label-content:not(:empty){margin:0 1rem 1rem}:host .bui-label-content-gap{margin-top:calc(1rem - 10px)}@polyfill-unscoped-rule{content: \".bui-radio-panel-item-wrapper .bui-label-header [buiRadioItemHeadingEnd]\"; margin-left: auto;}:host(:not([hidden])){display:block}:host(:not(.bui-disabled)):not(.bui-radio-checked) .bui-radio-panel-item-label{cursor:pointer}:host(:not(.bui-disabled)) .bui-radio-panel-item-label:hover{border-width:2px;padding:0;border-color:#8080804d}:host(:not(.bui-disabled)).cdk-keyboard-focused .bui-persistent-ripple,:host(:not(.bui-disabled)).cdk-program-focused .bui-persistent-ripple{background-color:#80808033;border-radius:50%}:host-context(.radio-dir-row){--panel-width: 300px;margin-right:1rem;max-width:var(--panel-width);min-width:250px;margin-bottom:1rem}:host(.bui-disabled) .bui-radio-panel-item-wrapper>.bui-label-header,:host(.bui-disabled) .bui-radio-panel-item-wrapper>.bui-label-content{opacity:.5}:host-context(.radio-dir-row):not(:last-child){margin-right:1rem;margin-bottom:1rem}:host-context(.radio-dir-column):not(:last-child){margin-bottom:1rem}\n"], components: [{ type: i3.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }], directives: [{ type: i4.MatRipple, selector: "[mat-ripple], [matRipple]", inputs: ["matRippleRadius", "matRippleDisabled", "matRippleTrigger", "matRippleColor", "matRippleUnbounded", "matRippleCentered", "matRippleAnimation"], exportAs: ["matRipple"] }, { type: i5.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i5.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }], animations: [
|
|
38
|
+
RadioPanelItemComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: RadioPanelItemComponent, selector: "bui-radio-panel-item", inputs: { disableRipple: "disableRipple", tabIndex: "tabIndex", title: "title", _tickPosition: "_tickPosition", tickPosition: "tickPosition" }, host: { listeners: { "focus": "_inputElement.nativeElement.focus()" }, properties: { "class.bui-radio-checked": "checked", "class.bui-disabled": "disabled", "class._mat-animation-noopable": "_noopAnimations", "class.mat-primary": "color === \"primary\"", "class.mat-accent": "color === \"accent\"", "class.mat-warn": "color === \"warn\"", "attr.tabindex": "null", "attr.id": "id", "attr.aria-label": "null", "attr.aria-labelledby": "null", "attr.aria-describedby": "null", "style.--panel-width": "this.panelWidth" }, classAttribute: "bui-radio-panel-item" }, queries: [{ propertyName: "contentOnSelect", first: true, predicate: ["contentOnSelect"], descendants: true }], exportAs: ["matRadioButton"], usesInheritance: true, ngImport: i0, template: "<label\n\tmatRipple\n\tmatRippleColor=\"rgba(128,128,128,.1)\"\n\t[matRippleDisabled]=\"disabled || checked\"\n\t[attr.for]=\"inputId\"\n\t#label\n\tclass=\"bui-radio-panel-item-label bui-border-{{ checked ? color : 'default' }}\"\n>\n\t<div class=\"bui-radio-panel-item-wrapper\" [class.bui-radio-tick-at-end]=\"tickPosition === 'end'\">\n\t\t<div class=\"bui-label-header\">\n\t\t\t<span class=\"bui-label-title\" [innerHTML]=\"title\"></span>\n\t\t\t<ng-content select=\"[buiRadioItemHeadingEnd]\"></ng-content>\n\t\t\t<span class=\"bui-radio-panel-item-circle\">\n\t\t\t\t<span\n\t\t\t\t\tclass=\"bui-persistent-ripple\"\n\t\t\t\t\tmatRipple\n\t\t\t\t\tmatRippleColor=\"rgba(128,128,128,.1)\"\n\t\t\t\t\t[matRippleCentered]=\"true\"\n\t\t\t\t\t[matRippleUnbounded]=\"true\"\n\t\t\t\t\t[matRippleTrigger]=\"label\"\n\t\t\t\t\t[matRippleRadius]=\"20\"\n\t\t\t\t\t*ngIf=\"!disabled\"\n\t\t\t\t></span>\n\t\t\t\t<mat-icon [color]=\"color\" *ngIf=\"checked\">check_circle</mat-icon>\n\t\t\t\t<mat-icon *ngIf=\"!checked\" class=\"bui-radio-panel-item-circle-unchecked\">radio_button_unchecked</mat-icon>\n\t\t\t</span>\n\t\t</div>\n\t\t<!-- The actual 'radio' part of the control. -->\n\t\t<span class=\"radio-container\">\n\t\t\t<input\n\t\t\t\t#input\n\t\t\t\tclass=\"mat-radio-input cdk-visually-hidden\"\n\t\t\t\ttype=\"radio\"\n\t\t\t\t[id]=\"inputId\"\n\t\t\t\t[checked]=\"checked\"\n\t\t\t\t[disabled]=\"disabled\"\n\t\t\t\t[tabIndex]=\"tabIndex\"\n\t\t\t\t[attr.name]=\"name\"\n\t\t\t\t[attr.value]=\"value\"\n\t\t\t\t[required]=\"required\"\n\t\t\t\t[attr.aria-label]=\"ariaLabel\"\n\t\t\t\t[attr.aria-labelledby]=\"ariaLabelledby\"\n\t\t\t\t[attr.aria-describedby]=\"ariaDescribedby\"\n\t\t\t\t(change)=\"_onInputInteraction($event)\"\n\t\t\t\t(click)=\"_onInputClick($event)\"\n\t\t\t/>\n\t\t</span>\n\n\t\t<div class=\"bui-label-content-gap\"></div>\n\t\t<!-- The label content for radio control. -->\n\t\t<div class=\"bui-label-content\">\n\t\t\t<ng-content></ng-content>\n\t\t</div>\n\t\t<div class=\"bui-label-content\" *ngIf=\"contentOnSelect && checked\" @slideInOut>\n\t\t\t<ng-container *ngTemplateOutlet=\"contentOnSelect\"></ng-container>\n\t\t</div>\n\t</div>\n</label>\n", styles: [":host .bui-ripple,:host .bui-persistent-ripple{position:absolute;top:0;right:0;bottom:0;left:0}:host .bui-radio-panel-item-overlay{background-color:#fff;opacity:0}:host .bui-radio-panel-item-circle{width:40px;height:40px;flex-shrink:0}:host .bui-radio-panel-item-label{display:block;border-radius:5px;border:1px solid rgba(128,128,128,.2);padding:1px;position:relative;height:100%}:host .bui-radio-panel-item-label .bui-radio-panel-item-circle-unchecked{color:#80808066}:host .bui-radio-panel-item-wrapper.bui-radio-tick-at-end .bui-label-header{padding:calc(1rem - 10px) calc(1rem - 10px) 0 1rem;justify-content:space-between}:host .bui-radio-panel-item-wrapper:not(.bui-radio-tick-at-end) .bui-label-header{padding:calc(1rem - 10px) calc(1rem - 10px) 0 calc(1rem - 10px)}:host .bui-radio-panel-item-wrapper:not(.bui-radio-tick-at-end) .bui-radio-panel-item-circle{order:-1}:host .bui-label-header,:host .bui-radio-panel-item-circle{display:flex;align-items:center}:host .bui-label-header{margin-bottom:calc(1rem - 10px)}:host .bui-label-title{font-size:larger;font-weight:bold}:host .bui-radio-panel-item-circle{justify-content:center;position:relative}:host .bui-label-content:not(:empty){margin:0 1rem 1rem}:host .bui-label-content-gap{margin-top:calc(1rem - 10px)}@polyfill-unscoped-rule{content: \".bui-radio-panel-item-wrapper .bui-label-header [buiRadioItemHeadingEnd]\"; margin-left: auto;}:host(:not([hidden])){display:block}:host(:not(.bui-disabled)):not(.bui-radio-checked) .bui-radio-panel-item-label{cursor:pointer}:host(:not(.bui-disabled)) .bui-radio-panel-item-label:hover{border-width:2px;padding:0;border-color:#8080804d}:host(:not(.bui-disabled)).cdk-keyboard-focused .bui-persistent-ripple,:host(:not(.bui-disabled)).cdk-program-focused .bui-persistent-ripple{background-color:#80808033;border-radius:50%}:host-context(.radio-dir-row){--panel-width: 300px;margin-right:1rem;max-width:var(--panel-width);min-width:250px;margin-bottom:1rem}:host(.bui-disabled) .bui-radio-panel-item-wrapper>.bui-label-header,:host(.bui-disabled) .bui-radio-panel-item-wrapper>.bui-label-content{opacity:.5}:host-context(.radio-dir-row):not(:last-child){margin-right:1rem;margin-bottom:1rem}:host-context(.radio-dir-column):not(:last-child){margin-bottom:1rem}\n"], components: [{ type: i3.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }], directives: [{ type: i4.MatRipple, selector: "[mat-ripple], [matRipple]", inputs: ["matRippleRadius", "matRippleDisabled", "matRippleTrigger", "matRippleColor", "matRippleUnbounded", "matRippleCentered", "matRippleAnimation"], exportAs: ["matRipple"] }, { type: i5.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i5.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }], animations: [
|
|
39
39
|
trigger('slideInOut', [
|
|
40
40
|
state('void', style({ height: '0px', overflow: 'hidden' })),
|
|
41
41
|
transition(':enter, :leave', animate('.25s'))
|
|
@@ -166,7 +166,7 @@ RadioPanelComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", ve
|
|
|
166
166
|
multi: true
|
|
167
167
|
},
|
|
168
168
|
{ provide: MAT_RADIO_GROUP, useExisting: forwardRef(() => RadioPanelComponent) }
|
|
169
|
-
], queries: [{ propertyName: "_radios", predicate: RadioPanelItemComponent, descendants: true }], exportAs: ["buiRadioPanel"], usesInheritance: true, usesOnChanges: true, ngImport: i0, template: ` <ng-content></ng-content> `, isInline: true, styles: [":host{display:flex}:host.radio-dir-row{flex-direction:row;flex-wrap:wrap}:host.radio-dir-column{flex-direction:column}\n"] });
|
|
169
|
+
], queries: [{ propertyName: "_radios", predicate: RadioPanelItemComponent, descendants: true }], exportAs: ["buiRadioPanel"], usesInheritance: true, usesOnChanges: true, ngImport: i0, template: ` <ng-content></ng-content> `, isInline: true, styles: [":host:not([hidden]){display:flex}:host.radio-dir-row{flex-direction:row;flex-wrap:wrap}:host.radio-dir-column{flex-direction:column}\n"] });
|
|
170
170
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: RadioPanelComponent, decorators: [{
|
|
171
171
|
type: Component,
|
|
172
172
|
args: [{
|