@bravura/ui 3.8.1 → 4.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +579 -565
- package/LICENSE +6 -6
- package/README.md +56 -54
- package/alert/alert-container.component.d.ts +1 -1
- package/alert/alert-message.component.d.ts +1 -1
- package/behavior/await.directive.d.ts +1 -1
- package/behavior/observe-content-class.directive.d.ts +1 -1
- package/behavior/sizing.directive.d.ts +1 -1
- package/clip-note/clip-note.directive.d.ts +1 -1
- package/currency-input/currency-input.directive.d.ts +1 -1
- package/decimal-input/decimal-input.directive.d.ts +1 -1
- package/discrete-input/discrete-input.component.d.ts +1 -1
- package/esm2022/alert/alert-container.component.mjs +207 -0
- package/esm2022/alert/alert-message.component.mjs +101 -0
- package/esm2022/alert/alert.module.mjs +22 -0
- package/{esm2020 → esm2022}/alert/public-api.mjs +1 -1
- package/esm2022/alert/testing/test-api.mjs +44 -0
- package/{esm2020 → esm2022}/behavior/await.directive.mjs +6 -6
- package/esm2022/behavior/behavior.module.mjs +37 -0
- package/{esm2020 → esm2022}/behavior/observe-content-class.directive.mjs +5 -5
- package/{esm2020 → esm2022}/behavior/public-api.mjs +1 -1
- package/esm2022/behavior/sizing-monitor.directive.mjs +31 -0
- package/esm2022/behavior/sizing.directive.mjs +256 -0
- package/esm2022/clip-note/clip-note.component.mjs +216 -0
- package/esm2022/clip-note/clip-note.directive.mjs +141 -0
- package/esm2022/clip-note/clip-note.module.mjs +32 -0
- package/{esm2020 → esm2022}/clip-note/public-api.mjs +1 -1
- package/{esm2020 → esm2022}/common/common-utils.mjs +1 -1
- package/{esm2020 → esm2022}/common/common.module.mjs +7 -7
- package/{esm2020 → esm2022}/common/public-api.mjs +1 -1
- package/{esm2020 → esm2022}/currency-input/currency-input.directive.mjs +6 -6
- package/esm2022/currency-input/currency-input.module.mjs +19 -0
- package/{esm2020 → esm2022}/currency-input/public-api.mjs +1 -1
- package/{esm2020 → esm2022}/decimal-input/decimal-input.directive.mjs +9 -9
- package/{esm2020 → esm2022}/decimal-input/decimal-input.module.mjs +5 -5
- package/esm2022/discrete-input/discrete-input.component.mjs +337 -0
- package/esm2022/discrete-input/discrete-input.module.mjs +21 -0
- package/{esm2020 → esm2022}/discrete-input/public-api.mjs +1 -1
- package/esm2022/file-upload/file-upload.component.mjs +400 -0
- package/esm2022/file-upload/file-upload.module.mjs +44 -0
- package/esm2022/file-upload/file-upload.service.mjs +29 -0
- package/{esm2020 → esm2022}/file-upload/public-api.mjs +1 -1
- package/esm2022/form-field/form-field.component.mjs +82 -0
- package/esm2022/form-field/form-field.module.mjs +33 -0
- package/{esm2020 → esm2022}/form-field/public-api.mjs +1 -1
- package/esm2022/icon-font/icon-font.module.mjs +22 -0
- package/{esm2020 → esm2022}/icon-font/icon.directive.mjs +5 -5
- package/{esm2020 → esm2022}/icon-font/public-api.mjs +1 -1
- package/{esm2020 → esm2022}/icon-font/utilities.mjs +1 -1
- package/esm2022/panel/panel-section.component.mjs +41 -0
- package/esm2022/panel/panel.component.mjs +87 -0
- package/esm2022/panel/panel.module.mjs +23 -0
- package/{esm2020 → esm2022}/panel/public-api.mjs +1 -1
- package/esm2022/panel/tinted.directive.mjs +60 -0
- package/esm2022/phone-number/phone-number.directive.mjs +188 -0
- package/{esm2020 → esm2022}/phone-number/phone-number.module.mjs +5 -5
- package/{esm2020 → esm2022}/phone-number/phone-number.pipe.mjs +6 -6
- package/esm2022/phone-number/phone-number.validator.mjs +64 -0
- package/{esm2020 → esm2022}/phone-number/public-api.mjs +1 -1
- package/{esm2020 → esm2022}/public-api.mjs +1 -1
- package/esm2022/radio-panel/radio-panel-item.component.mjs +93 -0
- package/esm2022/radio-panel/radio-panel.component.mjs +81 -0
- package/{esm2020 → esm2022}/radio-panel/radio-panel.module.mjs +5 -5
- package/esm2022/radio-panel/testing/test-api.mjs +46 -0
- package/{esm2020 → esm2022}/selection-panel/public-api.mjs +1 -1
- package/esm2022/selection-panel/selection-panel-item.component.mjs +166 -0
- package/esm2022/selection-panel/selection-panel.directive.mjs +119 -0
- package/esm2022/selection-panel/selection-panel.module.mjs +23 -0
- package/{esm2020 → esm2022}/skeletons/public-api.mjs +1 -1
- package/esm2022/skeletons/skeleton-loader-presets.directive.mjs +83 -0
- package/{esm2020 → esm2022}/skeletons/skeleton-loader.component.mjs +5 -5
- package/esm2022/skeletons/skeletons.module.mjs +35 -0
- package/{esm2020 → esm2022}/stepper/public-api.mjs +1 -1
- package/{esm2020 → esm2022}/stepper/stepper-animation.mjs +1 -1
- package/esm2022/stepper/stepper.component.mjs +176 -0
- package/esm2022/stepper/stepper.module.mjs +52 -0
- package/{esm2020 → esm2022}/tooltip/public-api.mjs +1 -1
- package/esm2022/tooltip/tooltip.component.mjs +63 -0
- package/esm2022/tooltip/tooltip.directive.mjs +148 -0
- package/esm2022/tooltip/tooltip.module.mjs +25 -0
- package/{fesm2020 → fesm2022}/bravura-ui-alert-testing.mjs +2 -2
- package/fesm2022/bravura-ui-alert-testing.mjs.map +1 -0
- package/fesm2022/bravura-ui-alert.mjs +327 -0
- package/fesm2022/bravura-ui-alert.mjs.map +1 -0
- package/{fesm2020 → fesm2022}/bravura-ui-behavior.mjs +45 -45
- package/fesm2022/bravura-ui-behavior.mjs.map +1 -0
- package/{fesm2020 → fesm2022}/bravura-ui-clip-note.mjs +70 -70
- package/fesm2022/bravura-ui-clip-note.mjs.map +1 -0
- package/{fesm2020 → fesm2022}/bravura-ui-common.mjs +6 -6
- package/fesm2022/bravura-ui-common.mjs.map +1 -0
- package/{fesm2020 → fesm2022}/bravura-ui-currency-input.mjs +11 -11
- package/fesm2022/bravura-ui-currency-input.mjs.map +1 -0
- package/{fesm2020 → fesm2022}/bravura-ui-decimal-input.mjs +12 -12
- package/fesm2022/bravura-ui-decimal-input.mjs.map +1 -0
- package/{fesm2020 → fesm2022}/bravura-ui-discrete-input.mjs +48 -48
- package/fesm2022/bravura-ui-discrete-input.mjs.map +1 -0
- package/fesm2022/bravura-ui-file-upload.mjs +474 -0
- package/fesm2022/bravura-ui-file-upload.mjs.map +1 -0
- package/{fesm2020 → fesm2022}/bravura-ui-form-field.mjs +19 -19
- package/fesm2022/bravura-ui-form-field.mjs.map +1 -0
- package/{fesm2020 → fesm2022}/bravura-ui-icon-font.mjs +8 -8
- package/fesm2022/bravura-ui-icon-font.mjs.map +1 -0
- package/fesm2022/bravura-ui-panel.mjs +206 -0
- package/fesm2022/bravura-ui-panel.mjs.map +1 -0
- package/{fesm2020 → fesm2022}/bravura-ui-phone-number.mjs +30 -30
- package/fesm2022/bravura-ui-phone-number.mjs.map +1 -0
- package/{fesm2020 → fesm2022}/bravura-ui-radio-panel-testing.mjs +5 -6
- package/fesm2022/bravura-ui-radio-panel-testing.mjs.map +1 -0
- package/{fesm2020 → fesm2022}/bravura-ui-radio-panel.mjs +31 -31
- package/fesm2022/bravura-ui-radio-panel.mjs.map +1 -0
- package/fesm2022/bravura-ui-selection-panel.mjs +306 -0
- package/fesm2022/bravura-ui-selection-panel.mjs.map +1 -0
- package/{fesm2020 → fesm2022}/bravura-ui-skeletons.mjs +43 -43
- package/fesm2022/bravura-ui-skeletons.mjs.map +1 -0
- package/fesm2022/bravura-ui-stepper.mjs +251 -0
- package/fesm2022/bravura-ui-stepper.mjs.map +1 -0
- package/{fesm2020 → fesm2022}/bravura-ui-tooltip.mjs +32 -24
- package/fesm2022/bravura-ui-tooltip.mjs.map +1 -0
- package/fesm2022/bravura-ui.mjs.map +1 -0
- package/file-upload/file-upload.component.d.ts +1 -1
- package/form-field/form-field.component.d.ts +1 -1
- package/icon-font/icon.directive.d.ts +1 -1
- package/package.json +76 -120
- package/panel/panel.component.d.ts +1 -1
- package/panel/tinted.directive.d.ts +1 -1
- package/phone-number/phone-number.directive.d.ts +1 -1
- package/phone-number/phone-number.validator.d.ts +2 -2
- package/radio-panel/radio-panel-item.component.d.ts +1 -1
- package/radio-panel/radio-panel.component.d.ts +1 -1
- package/radio-panel/testing/test-api.d.ts +2 -3
- package/selection-panel/selection-panel-item.component.d.ts +1 -1
- package/selection-panel/selection-panel.directive.d.ts +1 -1
- package/skeletons/skeleton-loader-presets.directive.d.ts +3 -3
- package/stepper/stepper.component.d.ts +1 -1
- package/theme/_bui-card.scss +56 -56
- package/theme/_ui-theme.scss +112 -112
- package/theme/global-style-by-bootstrap.scss +3 -3
- package/theme/global-style-by-tailwind.scss +3 -3
- package/theme/scrollbar.scss +40 -40
- package/tooltip/tooltip.component.d.ts +2 -0
- package/tooltip/tooltip.directive.d.ts +3 -5
- package/esm2020/alert/alert-container.component.mjs +0 -207
- package/esm2020/alert/alert-message.component.mjs +0 -102
- package/esm2020/alert/alert.module.mjs +0 -22
- package/esm2020/alert/testing/test-api.mjs +0 -44
- package/esm2020/behavior/behavior.module.mjs +0 -37
- package/esm2020/behavior/sizing-monitor.directive.mjs +0 -31
- package/esm2020/behavior/sizing.directive.mjs +0 -256
- package/esm2020/clip-note/clip-note.component.mjs +0 -216
- package/esm2020/clip-note/clip-note.directive.mjs +0 -141
- package/esm2020/clip-note/clip-note.module.mjs +0 -32
- package/esm2020/currency-input/currency-input.module.mjs +0 -19
- package/esm2020/discrete-input/discrete-input.component.mjs +0 -337
- package/esm2020/discrete-input/discrete-input.module.mjs +0 -21
- package/esm2020/file-upload/file-upload.component.mjs +0 -400
- package/esm2020/file-upload/file-upload.module.mjs +0 -44
- package/esm2020/file-upload/file-upload.service.mjs +0 -29
- package/esm2020/form-field/form-field.component.mjs +0 -82
- package/esm2020/form-field/form-field.module.mjs +0 -33
- package/esm2020/icon-font/icon-font.module.mjs +0 -22
- package/esm2020/panel/panel-section.component.mjs +0 -41
- package/esm2020/panel/panel.component.mjs +0 -87
- package/esm2020/panel/panel.module.mjs +0 -23
- package/esm2020/panel/tinted.directive.mjs +0 -60
- package/esm2020/phone-number/phone-number.directive.mjs +0 -188
- package/esm2020/phone-number/phone-number.validator.mjs +0 -64
- package/esm2020/radio-panel/radio-panel-item.component.mjs +0 -93
- package/esm2020/radio-panel/radio-panel.component.mjs +0 -81
- package/esm2020/radio-panel/testing/test-api.mjs +0 -47
- package/esm2020/selection-panel/selection-panel-item.component.mjs +0 -166
- package/esm2020/selection-panel/selection-panel.directive.mjs +0 -119
- package/esm2020/selection-panel/selection-panel.module.mjs +0 -23
- package/esm2020/skeletons/skeleton-loader-presets.directive.mjs +0 -83
- package/esm2020/skeletons/skeletons.module.mjs +0 -35
- package/esm2020/stepper/stepper.component.mjs +0 -176
- package/esm2020/stepper/stepper.module.mjs +0 -52
- package/esm2020/tooltip/tooltip.component.mjs +0 -54
- package/esm2020/tooltip/tooltip.directive.mjs +0 -149
- package/esm2020/tooltip/tooltip.module.mjs +0 -25
- package/fesm2015/bravura-ui-alert-testing.mjs +0 -64
- package/fesm2015/bravura-ui-alert-testing.mjs.map +0 -1
- package/fesm2015/bravura-ui-alert.mjs +0 -340
- package/fesm2015/bravura-ui-alert.mjs.map +0 -1
- package/fesm2015/bravura-ui-behavior.mjs +0 -515
- package/fesm2015/bravura-ui-behavior.mjs.map +0 -1
- package/fesm2015/bravura-ui-clip-note.mjs +0 -393
- package/fesm2015/bravura-ui-clip-note.mjs.map +0 -1
- package/fesm2015/bravura-ui-common.mjs +0 -96
- package/fesm2015/bravura-ui-common.mjs.map +0 -1
- package/fesm2015/bravura-ui-currency-input.mjs +0 -300
- package/fesm2015/bravura-ui-currency-input.mjs.map +0 -1
- package/fesm2015/bravura-ui-decimal-input.mjs +0 -145
- package/fesm2015/bravura-ui-decimal-input.mjs.map +0 -1
- package/fesm2015/bravura-ui-discrete-input.mjs +0 -365
- package/fesm2015/bravura-ui-discrete-input.mjs.map +0 -1
- package/fesm2015/bravura-ui-file-upload.mjs +0 -478
- package/fesm2015/bravura-ui-file-upload.mjs.map +0 -1
- package/fesm2015/bravura-ui-form-field.mjs +0 -120
- package/fesm2015/bravura-ui-form-field.mjs.map +0 -1
- package/fesm2015/bravura-ui-icon-font.mjs +0 -178
- package/fesm2015/bravura-ui-icon-font.mjs.map +0 -1
- package/fesm2015/bravura-ui-panel.mjs +0 -210
- package/fesm2015/bravura-ui-panel.mjs.map +0 -1
- package/fesm2015/bravura-ui-phone-number.mjs +0 -327
- package/fesm2015/bravura-ui-phone-number.mjs.map +0 -1
- package/fesm2015/bravura-ui-radio-panel-testing.mjs +0 -63
- package/fesm2015/bravura-ui-radio-panel-testing.mjs.map +0 -1
- package/fesm2015/bravura-ui-radio-panel.mjs +0 -200
- package/fesm2015/bravura-ui-radio-panel.mjs.map +0 -1
- package/fesm2015/bravura-ui-selection-panel.mjs +0 -311
- package/fesm2015/bravura-ui-selection-panel.mjs.map +0 -1
- package/fesm2015/bravura-ui-skeletons.mjs +0 -195
- package/fesm2015/bravura-ui-skeletons.mjs.map +0 -1
- package/fesm2015/bravura-ui-stepper.mjs +0 -253
- package/fesm2015/bravura-ui-stepper.mjs.map +0 -1
- package/fesm2015/bravura-ui-tooltip.mjs +0 -229
- package/fesm2015/bravura-ui-tooltip.mjs.map +0 -1
- package/fesm2015/bravura-ui.mjs.map +0 -1
- package/fesm2020/bravura-ui-alert-testing.mjs.map +0 -1
- package/fesm2020/bravura-ui-alert.mjs +0 -328
- package/fesm2020/bravura-ui-alert.mjs.map +0 -1
- package/fesm2020/bravura-ui-behavior.mjs.map +0 -1
- package/fesm2020/bravura-ui-clip-note.mjs.map +0 -1
- package/fesm2020/bravura-ui-common.mjs.map +0 -1
- package/fesm2020/bravura-ui-currency-input.mjs.map +0 -1
- package/fesm2020/bravura-ui-decimal-input.mjs.map +0 -1
- package/fesm2020/bravura-ui-discrete-input.mjs.map +0 -1
- package/fesm2020/bravura-ui-file-upload.mjs +0 -474
- package/fesm2020/bravura-ui-file-upload.mjs.map +0 -1
- package/fesm2020/bravura-ui-form-field.mjs.map +0 -1
- package/fesm2020/bravura-ui-icon-font.mjs.map +0 -1
- package/fesm2020/bravura-ui-panel.mjs +0 -206
- package/fesm2020/bravura-ui-panel.mjs.map +0 -1
- package/fesm2020/bravura-ui-phone-number.mjs.map +0 -1
- package/fesm2020/bravura-ui-radio-panel-testing.mjs.map +0 -1
- package/fesm2020/bravura-ui-radio-panel.mjs.map +0 -1
- package/fesm2020/bravura-ui-selection-panel.mjs +0 -306
- package/fesm2020/bravura-ui-selection-panel.mjs.map +0 -1
- package/fesm2020/bravura-ui-skeletons.mjs.map +0 -1
- package/fesm2020/bravura-ui-stepper.mjs +0 -251
- package/fesm2020/bravura-ui-stepper.mjs.map +0 -1
- package/fesm2020/bravura-ui-tooltip.mjs.map +0 -1
- package/fesm2020/bravura-ui.mjs +0 -8
- package/fesm2020/bravura-ui.mjs.map +0 -1
- /package/{esm2020 → esm2022}/alert/bravura-ui-alert.mjs +0 -0
- /package/{esm2020 → esm2022}/alert/testing/bravura-ui-alert-testing.mjs +0 -0
- /package/{esm2020 → esm2022}/behavior/bravura-ui-behavior.mjs +0 -0
- /package/{esm2020 → esm2022}/bravura-ui.mjs +0 -0
- /package/{esm2020 → esm2022}/clip-note/bravura-ui-clip-note.mjs +0 -0
- /package/{esm2020 → esm2022}/common/bravura-ui-common.mjs +0 -0
- /package/{esm2020 → esm2022}/currency-input/bravura-ui-currency-input.mjs +0 -0
- /package/{esm2020 → esm2022}/decimal-input/bravura-ui-decimal-input.mjs +0 -0
- /package/{esm2020 → esm2022}/decimal-input/public-api.mjs +0 -0
- /package/{esm2020 → esm2022}/discrete-input/bravura-ui-discrete-input.mjs +0 -0
- /package/{esm2020 → esm2022}/file-upload/bravura-ui-file-upload.mjs +0 -0
- /package/{esm2020 → esm2022}/form-field/bravura-ui-form-field.mjs +0 -0
- /package/{esm2020 → esm2022}/icon-font/bravura-ui-icon-font.mjs +0 -0
- /package/{esm2020 → esm2022}/panel/bravura-ui-panel.mjs +0 -0
- /package/{esm2020 → esm2022}/phone-number/bravura-ui-phone-number.mjs +0 -0
- /package/{esm2020 → esm2022}/radio-panel/bravura-ui-radio-panel.mjs +0 -0
- /package/{esm2020 → esm2022}/radio-panel/public-api.mjs +0 -0
- /package/{esm2020 → esm2022}/radio-panel/testing/bravura-ui-radio-panel-testing.mjs +0 -0
- /package/{esm2020 → esm2022}/selection-panel/bravura-ui-selection-panel.mjs +0 -0
- /package/{esm2020 → esm2022}/skeletons/bravura-ui-skeletons.mjs +0 -0
- /package/{esm2020 → esm2022}/stepper/bravura-ui-stepper.mjs +0 -0
- /package/{esm2020 → esm2022}/tooltip/bravura-ui-tooltip.mjs +0 -0
- /package/{fesm2015 → fesm2022}/bravura-ui.mjs +0 -0
|
@@ -0,0 +1,474 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { Injectable, forwardRef, ElementRef, Component, Input, ViewChild, HostListener, NgModule } from '@angular/core';
|
|
3
|
+
import * as i2 from '@angular/common';
|
|
4
|
+
import { CommonModule } from '@angular/common';
|
|
5
|
+
import { trigger, transition, query, stagger, animate, style } from '@angular/animations';
|
|
6
|
+
import { HttpEventType } from '@angular/common/http';
|
|
7
|
+
import { NG_VALUE_ACCESSOR } from '@angular/forms';
|
|
8
|
+
import { Observable, of, Subject } from 'rxjs';
|
|
9
|
+
import * as i3 from '@angular/material/icon';
|
|
10
|
+
import { MatIconModule } from '@angular/material/icon';
|
|
11
|
+
import * as i4 from '@bravura/ui/icon-font';
|
|
12
|
+
import { IconFontModule } from '@bravura/ui/icon-font';
|
|
13
|
+
import * as i5 from '@angular/material/progress-bar';
|
|
14
|
+
import { MatProgressBarModule } from '@angular/material/progress-bar';
|
|
15
|
+
import * as i6 from '@angular/material/button';
|
|
16
|
+
import { MatButtonModule } from '@angular/material/button';
|
|
17
|
+
import * as i7 from '@angular/material/divider';
|
|
18
|
+
import { MatDividerModule } from '@angular/material/divider';
|
|
19
|
+
import * as i8 from '@angular/material/tooltip';
|
|
20
|
+
import { MatTooltipModule } from '@angular/material/tooltip';
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* This type represents a file or form item that has been sent as part of a multipart/form-data POST request.
|
|
24
|
+
*/
|
|
25
|
+
class FileUploadItem {
|
|
26
|
+
/** @internal */
|
|
27
|
+
constructor(_id, _name, _size, _type) {
|
|
28
|
+
this.id = _id;
|
|
29
|
+
this.name = _name;
|
|
30
|
+
this.size = _size;
|
|
31
|
+
this.type = _type;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* This is an API for processing file upload requests.
|
|
36
|
+
*
|
|
37
|
+
* A sub class of this type handles multiple file requests, sent using multipart/form-data encoding type, as specified by RFC 1867.
|
|
38
|
+
*
|
|
39
|
+
* Please extend this type and provide it in an injector at the same level, or ancestral to that, of the `FileUploadComponent`.
|
|
40
|
+
*/
|
|
41
|
+
class FileUploadService {
|
|
42
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: FileUploadService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
43
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: FileUploadService }); }
|
|
44
|
+
}
|
|
45
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: FileUploadService, decorators: [{
|
|
46
|
+
type: Injectable
|
|
47
|
+
}] });
|
|
48
|
+
|
|
49
|
+
/** @ignore */
|
|
50
|
+
class UploadingItem {
|
|
51
|
+
constructor(event$, fileOrOncancel, oncomplete, oncancel) {
|
|
52
|
+
this.oncancel = oncancel;
|
|
53
|
+
this.progress = 0;
|
|
54
|
+
if (event$ instanceof Observable) {
|
|
55
|
+
this.file = fileOrOncancel;
|
|
56
|
+
this.subscription = event$.subscribe({
|
|
57
|
+
next: evt => {
|
|
58
|
+
if (evt.type === HttpEventType.UploadProgress) {
|
|
59
|
+
this.progress = evt.loaded / this.file.size;
|
|
60
|
+
}
|
|
61
|
+
else if (evt.type === HttpEventType.Response) {
|
|
62
|
+
this.uploadedItem = evt.body;
|
|
63
|
+
this.progress = 1;
|
|
64
|
+
oncomplete();
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
else {
|
|
70
|
+
this.subscription = of(event$).subscribe();
|
|
71
|
+
this.uploadedItem = event$;
|
|
72
|
+
this.oncancel = fileOrOncancel;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
cancel() {
|
|
76
|
+
this.subscription.unsubscribe();
|
|
77
|
+
this.oncancel(this);
|
|
78
|
+
}
|
|
79
|
+
get done() {
|
|
80
|
+
return !!this.uploadedItem;
|
|
81
|
+
}
|
|
82
|
+
get name() {
|
|
83
|
+
return this.uploadedItem?.name || this.file?.name;
|
|
84
|
+
}
|
|
85
|
+
get downloading() {
|
|
86
|
+
return this.downloadingSubs && !this.downloadingSubs.closed;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* A control value accessor component to provide the user interface for uploading files.
|
|
91
|
+
*
|
|
92
|
+
* The application that integrates this UI must provide an implementation of `FileUploadService`.
|
|
93
|
+
*
|
|
94
|
+
* The control's value is a list of alpha-numerical strings, which are the identifiers to the uploaded files.
|
|
95
|
+
*
|
|
96
|
+
* Example:
|
|
97
|
+
*
|
|
98
|
+
* ```html
|
|
99
|
+
* <form>
|
|
100
|
+
* <bui-file-upload [(ngModel)]="uploadedFileIds" name="myFiles"></bui-file-upload>
|
|
101
|
+
* </form>
|
|
102
|
+
* ```
|
|
103
|
+
*
|
|
104
|
+
* @see FileUploadService
|
|
105
|
+
*/
|
|
106
|
+
class FileUploadComponent {
|
|
107
|
+
/**
|
|
108
|
+
* Accepted MIME types
|
|
109
|
+
*
|
|
110
|
+
* @example ['text/*', 'image/png']
|
|
111
|
+
*/
|
|
112
|
+
get types() {
|
|
113
|
+
return this._types;
|
|
114
|
+
}
|
|
115
|
+
set types(types) {
|
|
116
|
+
if (Array.isArray(types) && types?.length) {
|
|
117
|
+
this._typeRegExps = [];
|
|
118
|
+
this._types = Array.from(types);
|
|
119
|
+
this._accept = this._types.join(',');
|
|
120
|
+
types.forEach(t => this._typeRegExps.push(new RegExp(t.replace(/\*/g, '.*'))));
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
constructor(_service) {
|
|
124
|
+
this._service = _service;
|
|
125
|
+
/** @ignore */
|
|
126
|
+
this._value = null;
|
|
127
|
+
/**
|
|
128
|
+
* The caption of the button for opening file selection dialog.
|
|
129
|
+
*/
|
|
130
|
+
this.uploadActionText = 'Drag files here to attach or browse';
|
|
131
|
+
/**
|
|
132
|
+
* The label for listing successful uploaded files.
|
|
133
|
+
*/
|
|
134
|
+
this.fileUploadedLabel = 'List of files uploaded successfully';
|
|
135
|
+
/**
|
|
136
|
+
* The text to be displayed when the user starts to drag file items over the browser window.
|
|
137
|
+
*/
|
|
138
|
+
this.dragHint = 'Please drag the files here.';
|
|
139
|
+
/**
|
|
140
|
+
* The text to be displayed when the user is dragging the file items over the drop zone.
|
|
141
|
+
*/
|
|
142
|
+
this.dropHint = 'Please release the mouse button to start uploading.';
|
|
143
|
+
/** Specifies the total number of files accepted. A falsy value removes the limit.*/
|
|
144
|
+
this.limit = 0;
|
|
145
|
+
/**
|
|
146
|
+
* specify the number of maximum bytes that can be uploaded.
|
|
147
|
+
* if number is specified, bytes are assumed, otherwise enter a string for specific size type.
|
|
148
|
+
*/
|
|
149
|
+
this.fileSize = '10MB';
|
|
150
|
+
/** @ignore */
|
|
151
|
+
this._fileSizeExceedMsg = '';
|
|
152
|
+
/** @ignore */
|
|
153
|
+
this._uploadingItems = [];
|
|
154
|
+
/** @ignore */
|
|
155
|
+
this._accept = '*/*';
|
|
156
|
+
/** @ignore */
|
|
157
|
+
this._itemAnimationStart = new Subject();
|
|
158
|
+
/** @ignore */
|
|
159
|
+
this._itemAnimationDone = new Subject();
|
|
160
|
+
/** @ignore */
|
|
161
|
+
this._itemAnimationInProgress = false;
|
|
162
|
+
this._onChange = (_) => { };
|
|
163
|
+
this._onTouch = () => { };
|
|
164
|
+
this._overFrameCounter = 0;
|
|
165
|
+
this._overCounter = 0;
|
|
166
|
+
this._typeRegExps = [/.*\/.*/];
|
|
167
|
+
this._types = ['*/*'];
|
|
168
|
+
this._numberOfFilesDragged = 0;
|
|
169
|
+
this._onChange([]);
|
|
170
|
+
this._onTouch();
|
|
171
|
+
this._frameDndEnter = this._onDndEnterFrame.bind(this);
|
|
172
|
+
this._frameDndLeave = this._onDndLeaveFrame.bind(this);
|
|
173
|
+
this._frameDndStop = this._onDndStopFrame.bind(this);
|
|
174
|
+
this._frameDndOver = event => event.preventDefault();
|
|
175
|
+
}
|
|
176
|
+
/** @internal */
|
|
177
|
+
ngOnInit() {
|
|
178
|
+
document.addEventListener('dragenter', this._frameDndEnter);
|
|
179
|
+
document.addEventListener('dragleave', this._frameDndLeave);
|
|
180
|
+
document.addEventListener('dragend', this._frameDndStop);
|
|
181
|
+
document.addEventListener('drop', this._frameDndStop);
|
|
182
|
+
document.addEventListener('dragover', this._frameDndOver);
|
|
183
|
+
this._itemAnimationStart.subscribe(() => (this._itemAnimationInProgress = true));
|
|
184
|
+
this._itemAnimationDone.subscribe(() => (this._itemAnimationInProgress = false));
|
|
185
|
+
}
|
|
186
|
+
ngOnDestroy() {
|
|
187
|
+
document.removeEventListener('dragenter', this._frameDndEnter);
|
|
188
|
+
document.removeEventListener('dragleave', this._frameDndLeave);
|
|
189
|
+
document.removeEventListener('dragend', this._frameDndStop);
|
|
190
|
+
document.removeEventListener('drop', this._frameDndStop);
|
|
191
|
+
document.removeEventListener('dragover', this._frameDndOver);
|
|
192
|
+
this._itemAnimationStart.complete();
|
|
193
|
+
this._itemAnimationDone.complete();
|
|
194
|
+
}
|
|
195
|
+
/** @internal */
|
|
196
|
+
writeValue(obj) {
|
|
197
|
+
if (Array.isArray(obj)) {
|
|
198
|
+
if (!this._value) {
|
|
199
|
+
this._acceptChange(obj);
|
|
200
|
+
return;
|
|
201
|
+
}
|
|
202
|
+
const common = obj.filter(v => this._value.includes(v));
|
|
203
|
+
if (common.length === obj.length && common.length === this._value.length) {
|
|
204
|
+
return; // no change
|
|
205
|
+
}
|
|
206
|
+
this._acceptChange(obj);
|
|
207
|
+
}
|
|
208
|
+
else {
|
|
209
|
+
this._value = null;
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
/** @internal */
|
|
213
|
+
registerOnChange(fn) {
|
|
214
|
+
this._onChange = fn;
|
|
215
|
+
}
|
|
216
|
+
/** @internal */
|
|
217
|
+
registerOnTouched(fn) {
|
|
218
|
+
this._onTouch = fn;
|
|
219
|
+
}
|
|
220
|
+
/** @internal */
|
|
221
|
+
onDragEnter(event) {
|
|
222
|
+
event.preventDefault();
|
|
223
|
+
event.stopPropagation();
|
|
224
|
+
this._overCounter++;
|
|
225
|
+
}
|
|
226
|
+
/** @internal */
|
|
227
|
+
onDragOver(event) {
|
|
228
|
+
event.preventDefault();
|
|
229
|
+
}
|
|
230
|
+
/** @internal */
|
|
231
|
+
onDragLeave(event) {
|
|
232
|
+
event.preventDefault();
|
|
233
|
+
event.stopPropagation();
|
|
234
|
+
this._overCounter--;
|
|
235
|
+
}
|
|
236
|
+
/** @internal */
|
|
237
|
+
onDndDrop(event) {
|
|
238
|
+
event.preventDefault();
|
|
239
|
+
event.stopPropagation();
|
|
240
|
+
this._onDndStopFrame();
|
|
241
|
+
const files = event.dataTransfer?.files;
|
|
242
|
+
if (files?.length && this._validateFileSize(files)) {
|
|
243
|
+
this._uploadFiles(Array.from(files));
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
/** Open the file selection dialog */
|
|
247
|
+
selectFiles() {
|
|
248
|
+
this._fileInput.nativeElement.click();
|
|
249
|
+
}
|
|
250
|
+
/** @ignore */
|
|
251
|
+
_openItem(item) {
|
|
252
|
+
item.downloadingSubs = this._service.get(item.uploadedItem.id).subscribe(blob => {
|
|
253
|
+
const url = URL.createObjectURL(blob);
|
|
254
|
+
window.open(url, '_blank');
|
|
255
|
+
});
|
|
256
|
+
}
|
|
257
|
+
/** @ignore */
|
|
258
|
+
get _overFrame() {
|
|
259
|
+
return this._overFrameCounter > 0;
|
|
260
|
+
}
|
|
261
|
+
/** @ignore */
|
|
262
|
+
get _overDropZone() {
|
|
263
|
+
return this._overCounter > 0;
|
|
264
|
+
}
|
|
265
|
+
/** Whether file uploading is in progress */
|
|
266
|
+
get uploading() {
|
|
267
|
+
return this._uploadingItems.some(i => !i.done);
|
|
268
|
+
}
|
|
269
|
+
/** The remaining number of files allowed.*/
|
|
270
|
+
get remaining() {
|
|
271
|
+
return this.limit ? this.limit - this._uploadingItems.length : Infinity;
|
|
272
|
+
}
|
|
273
|
+
/** @ignore */
|
|
274
|
+
_handleFileSelection() {
|
|
275
|
+
const fileList = this._fileInput.nativeElement.files;
|
|
276
|
+
if (fileList?.length && this._validateFileSize(fileList)) {
|
|
277
|
+
this._uploadFiles(Array.from(fileList));
|
|
278
|
+
this._fileInput.nativeElement.value = '';
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
/** @ignore */
|
|
282
|
+
get _invalidFilesDragged() {
|
|
283
|
+
return this._numberOfFilesDragged > this.remaining && (this._overFrame || this._overDropZone);
|
|
284
|
+
}
|
|
285
|
+
/** @ignore */
|
|
286
|
+
get _initialising() {
|
|
287
|
+
return !!this._initSubs && !this._initSubs.closed;
|
|
288
|
+
}
|
|
289
|
+
returnFileSize(size) {
|
|
290
|
+
if (size < 1024) {
|
|
291
|
+
return `${size} bytes`;
|
|
292
|
+
}
|
|
293
|
+
else if (size >= 1024 && size < 1048576) {
|
|
294
|
+
return `${(size / 1024).toFixed(1)} KB`;
|
|
295
|
+
}
|
|
296
|
+
else {
|
|
297
|
+
return `${(size / 1048576).toFixed(1)} MB`;
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
_validateFileSize(files) {
|
|
301
|
+
this._fileSizeExceedMsg = '';
|
|
302
|
+
const maxSize = this.returnFileSize(this._getMaxBytes());
|
|
303
|
+
for (let i = 0; i < files.length; i++) {
|
|
304
|
+
if (files[i].size > this._getMaxBytes()) {
|
|
305
|
+
this._fileSizeExceedMsg = `Selected file/s has exceeded the allowable size of ${maxSize} per file`;
|
|
306
|
+
return false;
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
return true;
|
|
310
|
+
}
|
|
311
|
+
_getMaxBytes() {
|
|
312
|
+
if (typeof this.fileSize === 'string') {
|
|
313
|
+
if (this.fileSize.toUpperCase().endsWith('KB')) {
|
|
314
|
+
const kiloBytes = this.fileSize.substring(0, this.fileSize.indexOf('KB'));
|
|
315
|
+
return Number(kiloBytes) * 1024;
|
|
316
|
+
}
|
|
317
|
+
else if (this.fileSize.toUpperCase().endsWith('MB')) {
|
|
318
|
+
const megaBytes = this.fileSize.substring(0, this.fileSize.indexOf('MB'));
|
|
319
|
+
return Number(megaBytes) * 1048576;
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
return this.fileSize;
|
|
323
|
+
}
|
|
324
|
+
_uploadFiles(files) {
|
|
325
|
+
if (this._initialising || files.length > this.remaining) {
|
|
326
|
+
return;
|
|
327
|
+
}
|
|
328
|
+
const filtered = files.filter(f => (!f.type || this._typeRegExps.some(regexp => f.type.match(regexp))) &&
|
|
329
|
+
!this._uploadingItems.some(i => i.name === f.name));
|
|
330
|
+
const observables = this._service.upload(filtered);
|
|
331
|
+
const items = filtered.map((f, i) => new UploadingItem(observables[i], f, this._updateItems.bind(this), this._deleteItem.bind(this)));
|
|
332
|
+
this._uploadingItems = [...this._uploadingItems, ...items];
|
|
333
|
+
}
|
|
334
|
+
_onDndEnterFrame(event) {
|
|
335
|
+
event.preventDefault();
|
|
336
|
+
this._numberOfFilesDragged = event.dataTransfer?.items?.length || 0;
|
|
337
|
+
this._overFrameCounter++;
|
|
338
|
+
}
|
|
339
|
+
_onDndLeaveFrame() {
|
|
340
|
+
this._overFrameCounter--;
|
|
341
|
+
}
|
|
342
|
+
_onDndStopFrame() {
|
|
343
|
+
this._overFrameCounter = 0;
|
|
344
|
+
this._overCounter = 0;
|
|
345
|
+
}
|
|
346
|
+
_acceptChange(v) {
|
|
347
|
+
this._initSubs = this._service.list().subscribe(list => {
|
|
348
|
+
this._uploadingItems = list
|
|
349
|
+
.filter(i => v.includes(i.id))
|
|
350
|
+
.map(f => new UploadingItem(f, this._deleteItem.bind(this)));
|
|
351
|
+
});
|
|
352
|
+
}
|
|
353
|
+
_updateItems() {
|
|
354
|
+
const completed = this._uploadingItems.filter(i => !!i.uploadedItem);
|
|
355
|
+
this._uploadingItems = [...completed, ...this._uploadingItems.filter(i => !i.uploadedItem)];
|
|
356
|
+
this._updateValue(completed);
|
|
357
|
+
}
|
|
358
|
+
_deleteItem(item) {
|
|
359
|
+
const key = item.uploadedItem?.id;
|
|
360
|
+
if (key) {
|
|
361
|
+
this._service.delete(key).subscribe(() => {
|
|
362
|
+
this._uploadingItems = this._uploadingItems.filter(i => i !== item);
|
|
363
|
+
const completed = this._uploadingItems.filter(i => !!i.uploadedItem);
|
|
364
|
+
this._updateValue(completed);
|
|
365
|
+
});
|
|
366
|
+
}
|
|
367
|
+
else {
|
|
368
|
+
this._uploadingItems = this._uploadingItems.filter(i => i !== item);
|
|
369
|
+
const completed = this._uploadingItems.filter(i => !!i.uploadedItem);
|
|
370
|
+
this._updateValue(completed);
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
_updateValue(completed) {
|
|
374
|
+
const completedIds = completed.map(c => c.uploadedItem.id);
|
|
375
|
+
this._value = completedIds;
|
|
376
|
+
if (!this._value.length) {
|
|
377
|
+
this._value = null;
|
|
378
|
+
}
|
|
379
|
+
this._onChange(completedIds);
|
|
380
|
+
}
|
|
381
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: FileUploadComponent, deps: [{ token: FileUploadService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
382
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", 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\">\r\n\t<div\r\n\t\tclass=\"bui-file-upload-hint\"\r\n\t\t*ngIf=\"!_initialising && remaining > 0 && (!_itemAnimationInProgress || remaining > 1)\"\r\n\t>\r\n\t\t<ng-template [ngIf]=\"_invalidFilesDragged\" [ngIfElse]=\"validDnd\">\r\n\t\t\t<mat-icon [buiIcon]=\"'block'\" [size]=\"32\" color=\"warn\" variant=\"outlined\" style=\"opacity: 0.6\"></mat-icon>\r\n\t\t</ng-template>\r\n\t\t<ng-template #validDnd>\r\n\t\t\t<div *ngIf=\"!_overFrame && !_overDropZone\" class=\"bui-color-muted bui-upload-icon-link\" (click)=\"selectFiles()\">\r\n\t\t\t\t<mat-icon [buiIcon]=\"'fas fa-cloud-upload-alt'\" [size]=\"32\"></mat-icon>\r\n\t\t\t\t<a role=\"button\">{{ uploadActionText }}</a>\r\n\t\t\t</div>\r\n\t\t\t<div *ngIf=\"_overFrame && !_overDropZone\" class=\"bui-color-light\">{{ dragHint }}</div>\r\n\t\t\t<div *ngIf=\"_overDropZone\" class=\"bui-color-light\">{{ dropHint }}</div>\r\n\t\t</ng-template>\r\n\t</div>\r\n\t<div\r\n\t\tclass=\"bui-file-upload-list\"\r\n\t\t[@slideOut]=\"_uploadingItems.length\"\r\n\t\t(@slideOut.start)=\"_itemAnimationStart.next()\"\r\n\t\t(@slideOut.done)=\"_itemAnimationDone.next()\"\r\n\t\t*ngIf=\"_uploadingItems.length\"\r\n\t>\r\n\t\t<span class=\"bui-file-uploaded-label\">{{ fileUploadedLabel }}</span>\r\n\r\n\t\t<ng-container *ngFor=\"let item of _uploadingItems; let idx = index\">\r\n\t\t\t<div class=\"bui-file-upload-item\" [class.in-progress]=\"!item.done\" #itemDiv>\r\n\t\t\t\t<div class=\"bui-file-upload-item-name\">\r\n\t\t\t\t\t<span>\r\n\t\t\t\t\t\t<mat-icon class=\"bui-color-muted\">description</mat-icon>\r\n\t\t\t\t\t\t<a\r\n\t\t\t\t\t\t\tclass=\"text\"\r\n\t\t\t\t\t\t\t*ngIf=\"item.done && !item.downloading; else staticName\"\r\n\t\t\t\t\t\t\thref=\"#{{ item.uploadedItem?.id }}\"\r\n\t\t\t\t\t\t\t(click)=\"$event.preventDefault(); _openItem(item)\"\r\n\t\t\t\t\t\t\tcontextmenu=\"false\"\r\n\t\t\t\t\t\t\tmatTooltip=\"Download\"\r\n\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t{{ item.name }}\r\n\t\t\t\t\t\t</a>\r\n\t\t\t\t\t\t<ng-template #staticName>\r\n\t\t\t\t\t\t\t<span class=\"text\">{{ item.name }}</span>\r\n\t\t\t\t\t\t</ng-template>\r\n\t\t\t\t\t</span>\r\n\t\t\t\t\t<div class=\"bui-file-upload-item-progress\">\r\n\t\t\t\t\t\t<mat-progress-bar\r\n\t\t\t\t\t\t\tmode=\"determinate\"\r\n\t\t\t\t\t\t\t[class.upload-completed]=\"item.done\"\r\n\t\t\t\t\t\t\t*ngIf=\"!item.downloading\"\r\n\t\t\t\t\t\t\t[value]=\"item.done ? 100 : item.progress * 100\"\r\n\t\t\t\t\t\t></mat-progress-bar>\r\n\t\t\t\t\t\t<mat-progress-bar mode=\"buffer\" *ngIf=\"item.downloading\"></mat-progress-bar>\r\n\t\t\t\t\t\t<span>\r\n\t\t\t\t\t\t\t<ng-template [ngIf]=\"item.done\" [ngIfElse]=\"inprogress\"> 100% </ng-template>\r\n\t\t\t\t\t\t\t<ng-template #inprogress>\r\n\t\t\t\t\t\t\t\t{{ item.progress | percent }}\r\n\t\t\t\t\t\t\t</ng-template>\r\n\t\t\t\t\t\t</span>\r\n\t\t\t\t\t</div>\r\n\t\t\t\t</div>\r\n\t\t\t\t<div class=\"bui-file-upload-item-action\">\r\n\t\t\t\t\t<button\r\n\t\t\t\t\t\tmat-icon-button\r\n\t\t\t\t\t\tcolor=\"primary\"\r\n\t\t\t\t\t\t(click)=\"item.cancel()\"\r\n\t\t\t\t\t\t(mouseenter)=\"itemDiv.classList.add('bui-file-upload-item-deleting')\"\r\n\t\t\t\t\t\t(mouseleave)=\"itemDiv.classList.remove('bui-file-upload-item-deleting')\"\r\n\t\t\t\t\t\tmatTooltip=\"Delete\"\r\n\t\t\t\t\t>\r\n\t\t\t\t\t\t<mat-icon [buiIcon]=\"'cancel'\" style=\"line-height: 0.9\"></mat-icon>\r\n\t\t\t\t\t</button>\r\n\t\t\t\t</div>\r\n\t\t\t</div>\r\n\t\t\t<mat-divider *ngIf=\"idx < _uploadingItems.length - 1\"></mat-divider>\r\n\t\t</ng-container>\r\n\t</div>\r\n\t<input\r\n\t\ttype=\"file\"\r\n\t\t#fileInput\r\n\t\tstyle=\"display: none\"\r\n\t\taccept=\"{{ _accept }}\"\r\n\t\t(change)=\"_handleFileSelection()\"\r\n\t\t[multiple]=\"remaining > 1\"\r\n\t/>\r\n\r\n\t<div *ngIf=\"_fileSizeExceedMsg\" class=\"bui-color-warn bui-file-size-exceed\">\r\n\t\t<span> {{ _fileSizeExceedMsg }}</span> <mat-icon role=\"button\" (click)=\"_fileSizeExceedMsg = ''\">cancel</mat-icon>\r\n\t</div>\r\n</div>\r\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:12px 0;--mdc-linear-progress-track-height: 8px}:host:not([hidden]) .bui-file-upload-list .bui-file-upload-item-progress .mat-mdc-progress-bar{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"], dependencies: [{ kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i3.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: i4.IconDirective, selector: "[buiIcon]", inputs: ["buiIcon", "size", "variant"] }, { kind: "component", type: i5.MatProgressBar, selector: "mat-progress-bar", inputs: ["color", "value", "bufferValue", "mode"], outputs: ["animationEnd"], exportAs: ["matProgressBar"] }, { kind: "component", type: i6.MatIconButton, selector: "button[mat-icon-button]", exportAs: ["matButton"] }, { kind: "component", type: i7.MatDivider, selector: "mat-divider", inputs: ["vertical", "inset"] }, { kind: "directive", type: i8.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "pipe", type: i2.PercentPipe, name: "percent" }], animations: [
|
|
383
|
+
trigger('slideOut', [
|
|
384
|
+
transition('* => *', [
|
|
385
|
+
query(':leave', stagger(100, animate('0.25s', style({ height: 0, overflow: 'hidden' }))), { optional: true })
|
|
386
|
+
])
|
|
387
|
+
])
|
|
388
|
+
] }); }
|
|
389
|
+
}
|
|
390
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: FileUploadComponent, decorators: [{
|
|
391
|
+
type: Component,
|
|
392
|
+
args: [{ host: {
|
|
393
|
+
class: 'bui-host bui-file-upload',
|
|
394
|
+
'[class.bui-dnd-active]': '_overFrame && remaining >= _numberOfFilesDragged',
|
|
395
|
+
'[class.bui-dnd-over]': '_overDropZone && remaining >= _numberOfFilesDragged',
|
|
396
|
+
'[class.bui-dnd-invalid]': '_invalidFilesDragged'
|
|
397
|
+
}, selector: 'bui-file-upload', providers: [{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => FileUploadComponent), multi: true }], animations: [
|
|
398
|
+
trigger('slideOut', [
|
|
399
|
+
transition('* => *', [
|
|
400
|
+
query(':leave', stagger(100, animate('0.25s', style({ height: 0, overflow: 'hidden' }))), { optional: true })
|
|
401
|
+
])
|
|
402
|
+
])
|
|
403
|
+
], template: "<div class=\"bui-file-upload-container\">\r\n\t<div\r\n\t\tclass=\"bui-file-upload-hint\"\r\n\t\t*ngIf=\"!_initialising && remaining > 0 && (!_itemAnimationInProgress || remaining > 1)\"\r\n\t>\r\n\t\t<ng-template [ngIf]=\"_invalidFilesDragged\" [ngIfElse]=\"validDnd\">\r\n\t\t\t<mat-icon [buiIcon]=\"'block'\" [size]=\"32\" color=\"warn\" variant=\"outlined\" style=\"opacity: 0.6\"></mat-icon>\r\n\t\t</ng-template>\r\n\t\t<ng-template #validDnd>\r\n\t\t\t<div *ngIf=\"!_overFrame && !_overDropZone\" class=\"bui-color-muted bui-upload-icon-link\" (click)=\"selectFiles()\">\r\n\t\t\t\t<mat-icon [buiIcon]=\"'fas fa-cloud-upload-alt'\" [size]=\"32\"></mat-icon>\r\n\t\t\t\t<a role=\"button\">{{ uploadActionText }}</a>\r\n\t\t\t</div>\r\n\t\t\t<div *ngIf=\"_overFrame && !_overDropZone\" class=\"bui-color-light\">{{ dragHint }}</div>\r\n\t\t\t<div *ngIf=\"_overDropZone\" class=\"bui-color-light\">{{ dropHint }}</div>\r\n\t\t</ng-template>\r\n\t</div>\r\n\t<div\r\n\t\tclass=\"bui-file-upload-list\"\r\n\t\t[@slideOut]=\"_uploadingItems.length\"\r\n\t\t(@slideOut.start)=\"_itemAnimationStart.next()\"\r\n\t\t(@slideOut.done)=\"_itemAnimationDone.next()\"\r\n\t\t*ngIf=\"_uploadingItems.length\"\r\n\t>\r\n\t\t<span class=\"bui-file-uploaded-label\">{{ fileUploadedLabel }}</span>\r\n\r\n\t\t<ng-container *ngFor=\"let item of _uploadingItems; let idx = index\">\r\n\t\t\t<div class=\"bui-file-upload-item\" [class.in-progress]=\"!item.done\" #itemDiv>\r\n\t\t\t\t<div class=\"bui-file-upload-item-name\">\r\n\t\t\t\t\t<span>\r\n\t\t\t\t\t\t<mat-icon class=\"bui-color-muted\">description</mat-icon>\r\n\t\t\t\t\t\t<a\r\n\t\t\t\t\t\t\tclass=\"text\"\r\n\t\t\t\t\t\t\t*ngIf=\"item.done && !item.downloading; else staticName\"\r\n\t\t\t\t\t\t\thref=\"#{{ item.uploadedItem?.id }}\"\r\n\t\t\t\t\t\t\t(click)=\"$event.preventDefault(); _openItem(item)\"\r\n\t\t\t\t\t\t\tcontextmenu=\"false\"\r\n\t\t\t\t\t\t\tmatTooltip=\"Download\"\r\n\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t{{ item.name }}\r\n\t\t\t\t\t\t</a>\r\n\t\t\t\t\t\t<ng-template #staticName>\r\n\t\t\t\t\t\t\t<span class=\"text\">{{ item.name }}</span>\r\n\t\t\t\t\t\t</ng-template>\r\n\t\t\t\t\t</span>\r\n\t\t\t\t\t<div class=\"bui-file-upload-item-progress\">\r\n\t\t\t\t\t\t<mat-progress-bar\r\n\t\t\t\t\t\t\tmode=\"determinate\"\r\n\t\t\t\t\t\t\t[class.upload-completed]=\"item.done\"\r\n\t\t\t\t\t\t\t*ngIf=\"!item.downloading\"\r\n\t\t\t\t\t\t\t[value]=\"item.done ? 100 : item.progress * 100\"\r\n\t\t\t\t\t\t></mat-progress-bar>\r\n\t\t\t\t\t\t<mat-progress-bar mode=\"buffer\" *ngIf=\"item.downloading\"></mat-progress-bar>\r\n\t\t\t\t\t\t<span>\r\n\t\t\t\t\t\t\t<ng-template [ngIf]=\"item.done\" [ngIfElse]=\"inprogress\"> 100% </ng-template>\r\n\t\t\t\t\t\t\t<ng-template #inprogress>\r\n\t\t\t\t\t\t\t\t{{ item.progress | percent }}\r\n\t\t\t\t\t\t\t</ng-template>\r\n\t\t\t\t\t\t</span>\r\n\t\t\t\t\t</div>\r\n\t\t\t\t</div>\r\n\t\t\t\t<div class=\"bui-file-upload-item-action\">\r\n\t\t\t\t\t<button\r\n\t\t\t\t\t\tmat-icon-button\r\n\t\t\t\t\t\tcolor=\"primary\"\r\n\t\t\t\t\t\t(click)=\"item.cancel()\"\r\n\t\t\t\t\t\t(mouseenter)=\"itemDiv.classList.add('bui-file-upload-item-deleting')\"\r\n\t\t\t\t\t\t(mouseleave)=\"itemDiv.classList.remove('bui-file-upload-item-deleting')\"\r\n\t\t\t\t\t\tmatTooltip=\"Delete\"\r\n\t\t\t\t\t>\r\n\t\t\t\t\t\t<mat-icon [buiIcon]=\"'cancel'\" style=\"line-height: 0.9\"></mat-icon>\r\n\t\t\t\t\t</button>\r\n\t\t\t\t</div>\r\n\t\t\t</div>\r\n\t\t\t<mat-divider *ngIf=\"idx < _uploadingItems.length - 1\"></mat-divider>\r\n\t\t</ng-container>\r\n\t</div>\r\n\t<input\r\n\t\ttype=\"file\"\r\n\t\t#fileInput\r\n\t\tstyle=\"display: none\"\r\n\t\taccept=\"{{ _accept }}\"\r\n\t\t(change)=\"_handleFileSelection()\"\r\n\t\t[multiple]=\"remaining > 1\"\r\n\t/>\r\n\r\n\t<div *ngIf=\"_fileSizeExceedMsg\" class=\"bui-color-warn bui-file-size-exceed\">\r\n\t\t<span> {{ _fileSizeExceedMsg }}</span> <mat-icon role=\"button\" (click)=\"_fileSizeExceedMsg = ''\">cancel</mat-icon>\r\n\t</div>\r\n</div>\r\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:12px 0;--mdc-linear-progress-track-height: 8px}:host:not([hidden]) .bui-file-upload-list .bui-file-upload-item-progress .mat-mdc-progress-bar{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"] }]
|
|
404
|
+
}], ctorParameters: () => [{ type: FileUploadService }], propDecorators: { uploadActionText: [{
|
|
405
|
+
type: Input
|
|
406
|
+
}], fileUploadedLabel: [{
|
|
407
|
+
type: Input
|
|
408
|
+
}], dragHint: [{
|
|
409
|
+
type: Input
|
|
410
|
+
}], dropHint: [{
|
|
411
|
+
type: Input
|
|
412
|
+
}], limit: [{
|
|
413
|
+
type: Input
|
|
414
|
+
}], fileSize: [{
|
|
415
|
+
type: Input
|
|
416
|
+
}], types: [{
|
|
417
|
+
type: Input
|
|
418
|
+
}], _fileInput: [{
|
|
419
|
+
type: ViewChild,
|
|
420
|
+
args: ['fileInput', { read: ElementRef, static: true }]
|
|
421
|
+
}], onDragEnter: [{
|
|
422
|
+
type: HostListener,
|
|
423
|
+
args: ['dragenter', ['$event']]
|
|
424
|
+
}], onDragOver: [{
|
|
425
|
+
type: HostListener,
|
|
426
|
+
args: ['dragover', ['$event']]
|
|
427
|
+
}], onDragLeave: [{
|
|
428
|
+
type: HostListener,
|
|
429
|
+
args: ['dragleave', ['$event']]
|
|
430
|
+
}], onDndDrop: [{
|
|
431
|
+
type: HostListener,
|
|
432
|
+
args: ['drop', ['$event']]
|
|
433
|
+
}] } });
|
|
434
|
+
|
|
435
|
+
class FileUploadModule {
|
|
436
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: FileUploadModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
437
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.3.12", ngImport: i0, type: FileUploadModule, declarations: [FileUploadComponent], imports: [CommonModule,
|
|
438
|
+
MatIconModule,
|
|
439
|
+
IconFontModule,
|
|
440
|
+
MatProgressBarModule,
|
|
441
|
+
MatButtonModule,
|
|
442
|
+
MatDividerModule,
|
|
443
|
+
MatTooltipModule], exports: [FileUploadComponent] }); }
|
|
444
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: FileUploadModule, imports: [CommonModule,
|
|
445
|
+
MatIconModule,
|
|
446
|
+
IconFontModule,
|
|
447
|
+
MatProgressBarModule,
|
|
448
|
+
MatButtonModule,
|
|
449
|
+
MatDividerModule,
|
|
450
|
+
MatTooltipModule] }); }
|
|
451
|
+
}
|
|
452
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: FileUploadModule, decorators: [{
|
|
453
|
+
type: NgModule,
|
|
454
|
+
args: [{
|
|
455
|
+
declarations: [FileUploadComponent],
|
|
456
|
+
imports: [
|
|
457
|
+
CommonModule,
|
|
458
|
+
MatIconModule,
|
|
459
|
+
IconFontModule,
|
|
460
|
+
MatProgressBarModule,
|
|
461
|
+
MatButtonModule,
|
|
462
|
+
MatDividerModule,
|
|
463
|
+
MatTooltipModule
|
|
464
|
+
],
|
|
465
|
+
exports: [FileUploadComponent]
|
|
466
|
+
}]
|
|
467
|
+
}] });
|
|
468
|
+
|
|
469
|
+
/**
|
|
470
|
+
* Generated bundle index. Do not edit.
|
|
471
|
+
*/
|
|
472
|
+
|
|
473
|
+
export { FileUploadComponent, FileUploadItem, FileUploadModule, FileUploadService };
|
|
474
|
+
//# sourceMappingURL=bravura-ui-file-upload.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bravura-ui-file-upload.mjs","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';\r\nimport { Injectable } from '@angular/core';\r\nimport { Observable } from 'rxjs';\r\n\r\n/**\r\n * This type represents a file or form item that has been sent as part of a multipart/form-data POST request.\r\n */\r\nexport class FileUploadItem {\r\n\t/** The original filename in the client's filesystem, as provided by the browser. */\r\n\tname: string;\r\n\r\n\t/** The size of the file item. */\r\n\tsize: number;\r\n\r\n\t/** An alpha-numeric string that uniquely identifies the file item. */\r\n\tid: string;\r\n\r\n\t/** The content type (MIME type) of the file. */\r\n\ttype: string;\r\n\r\n\t/** @internal */\r\n\tconstructor(_id: string, _name: string, _size: number, _type: string) {\r\n\t\tthis.id = _id;\r\n\t\tthis.name = _name;\r\n\t\tthis.size = _size;\r\n\t\tthis.type = _type;\r\n\t}\r\n}\r\n\r\n/**\r\n * This is an API for processing file upload requests.\r\n *\r\n * A sub class of this type handles multiple file requests, sent using multipart/form-data encoding type, as specified by RFC 1867.\r\n *\r\n * Please extend this type and provide it in an injector at the same level, or ancestral to that, of the `FileUploadComponent`.\r\n */\r\n@Injectable()\r\nexport abstract class FileUploadService {\r\n\t/**\r\n\t * Upload a list of selected files from the browser. The returned `Observable` array provides the update of the uploading progress\r\n\t * through HTTP events.\r\n\t */\r\n\tabstract upload(files: File[]): Array<Observable<HttpEvent<FileUploadItem>>>;\r\n\r\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*/\r\n\tabstract list(): Observable<FileUploadItem[]>;\r\n\r\n\t/** Get the content of an uploaded file item as a `Blob`. */\r\n\tabstract get(id: string): Observable<Blob>;\r\n\r\n\t/** Delete an uploaded file item from the server. */\r\n\tabstract delete(id: string): Observable<void>;\r\n\r\n\t/** Delete all uploaded file items in the current HTTP session. */\r\n\tabstract clear?(): Observable<void>;\r\n}\r\n","import { animate, query, stagger, style, transition, trigger } from '@angular/animations';\r\nimport { HttpEvent, HttpEventType } from '@angular/common/http';\r\nimport { Component, ElementRef, forwardRef, HostListener, Input, OnDestroy, OnInit, ViewChild } from '@angular/core';\r\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';\r\nimport { Observable, of, Subject, Subscription } from 'rxjs';\r\nimport { FileUploadItem, FileUploadService } from './file-upload.service';\r\n\r\n/** @ignore */\r\nclass UploadingItem {\r\n\tprogress = 0;\r\n\tuploadedItem: FileUploadItem | null | undefined;\r\n\tdownloadingSubs?: Subscription;\r\n\tprivate subscription: Subscription;\r\n\tprivate file?: File;\r\n\r\n\tconstructor(item: FileUploadItem, oncancel: (item: UploadingItem) => void);\r\n\tconstructor(\r\n\t\tevent$: Observable<HttpEvent<FileUploadItem>> | FileUploadItem,\r\n\t\tfile: File,\r\n\t\toncomplete: () => void,\r\n\t\toncancel: (item: UploadingItem) => void\r\n\t);\r\n\tconstructor(\r\n\t\tevent$: Observable<HttpEvent<FileUploadItem>> | FileUploadItem,\r\n\t\tfileOrOncancel?: File | ((item: UploadingItem) => void),\r\n\t\toncomplete?: () => void,\r\n\t\tprivate oncancel?: (item: UploadingItem) => void\r\n\t) {\r\n\t\tif (event$ instanceof Observable) {\r\n\t\t\tthis.file = fileOrOncancel as File;\r\n\t\t\tthis.subscription = event$.subscribe({\r\n\t\t\t\tnext: evt => {\r\n\t\t\t\t\tif (evt.type === HttpEventType.UploadProgress) {\r\n\t\t\t\t\t\tthis.progress = evt.loaded / (this.file as File).size;\r\n\t\t\t\t\t} else if (evt.type === HttpEventType.Response) {\r\n\t\t\t\t\t\tthis.uploadedItem = evt.body;\r\n\t\t\t\t\t\tthis.progress = 1;\r\n\t\t\t\t\t\toncomplete!();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t} else {\r\n\t\t\tthis.subscription = of(event$).subscribe();\r\n\t\t\tthis.uploadedItem = event$;\r\n\t\t\tthis.oncancel = fileOrOncancel as (item: UploadingItem) => void;\r\n\t\t}\r\n\t}\r\n\r\n\tcancel() {\r\n\t\tthis.subscription.unsubscribe();\r\n\t\tthis.oncancel!(this);\r\n\t}\r\n\r\n\tget done() {\r\n\t\treturn !!this.uploadedItem;\r\n\t}\r\n\r\n\tget name() {\r\n\t\treturn this.uploadedItem?.name || this.file?.name;\r\n\t}\r\n\r\n\tget downloading() {\r\n\t\treturn this.downloadingSubs && !this.downloadingSubs.closed;\r\n\t}\r\n}\r\n/**\r\n * A control value accessor component to provide the user interface for uploading files.\r\n *\r\n * The application that integrates this UI must provide an implementation of `FileUploadService`.\r\n *\r\n * The control's value is a list of alpha-numerical strings, which are the identifiers to the uploaded files.\r\n *\r\n * Example:\r\n *\r\n * ```html\r\n * <form>\r\n * <bui-file-upload [(ngModel)]=\"uploadedFileIds\" name=\"myFiles\"></bui-file-upload>\r\n * </form>\r\n * ```\r\n *\r\n * @see FileUploadService\r\n */\r\n@Component({\r\n\thost: {\r\n\t\tclass: 'bui-host bui-file-upload',\r\n\t\t'[class.bui-dnd-active]': '_overFrame && remaining >= _numberOfFilesDragged',\r\n\t\t'[class.bui-dnd-over]': '_overDropZone && remaining >= _numberOfFilesDragged',\r\n\t\t'[class.bui-dnd-invalid]': '_invalidFilesDragged'\r\n\t},\r\n\tselector: 'bui-file-upload',\r\n\ttemplateUrl: './file-upload.component.html',\r\n\tstyleUrls: ['./file-upload.component.scss'],\r\n\tproviders: [{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => FileUploadComponent), multi: true }],\r\n\tanimations: [\r\n\t\ttrigger('slideOut', [\r\n\t\t\ttransition('* => *', [\r\n\t\t\t\tquery(':leave', stagger(100, animate('0.25s', style({ height: 0, overflow: 'hidden' }))), { optional: true })\r\n\t\t\t])\r\n\t\t])\r\n\t]\r\n})\r\nexport class FileUploadComponent implements OnInit, OnDestroy, ControlValueAccessor {\r\n\t/** @ignore */\r\n\t_value: string[] | null = null;\r\n\r\n\t/**\r\n\t * The caption of the button for opening file selection dialog.\r\n\t */\r\n\t@Input()\r\n\tuploadActionText = 'Drag files here to attach or browse';\r\n\r\n\t/**\r\n\t * The label for listing successful uploaded files.\r\n\t */\r\n\t@Input()\r\n\tfileUploadedLabel = 'List of files uploaded successfully';\r\n\r\n\t/**\r\n\t * The text to be displayed when the user starts to drag file items over the browser window.\r\n\t */\r\n\t@Input()\r\n\tdragHint = 'Please drag the files here.';\r\n\r\n\t/**\r\n\t * The text to be displayed when the user is dragging the file items over the drop zone.\r\n\t */\r\n\t@Input()\r\n\tdropHint = 'Please release the mouse button to start uploading.';\r\n\r\n\t/** Specifies the total number of files accepted. A falsy value removes the limit.*/\r\n\t@Input()\r\n\tlimit = 0;\r\n\r\n\t/**\r\n\t * specify the number of maximum bytes that can be uploaded.\r\n\t * if number is specified, bytes are assumed, otherwise enter a string for specific size type.\r\n\t */\r\n\t@Input()\r\n\tfileSize: number | string = '10MB';\r\n\r\n\t/**\r\n\t * Accepted MIME types\r\n\t *\r\n\t * @example ['text/*', 'image/png']\r\n\t */\r\n\t@Input()\r\n\tget types(): string[] {\r\n\t\treturn this._types;\r\n\t}\r\n\tset types(types: string[]) {\r\n\t\tif (Array.isArray(types) && types?.length) {\r\n\t\t\tthis._typeRegExps = [];\r\n\t\t\tthis._types = Array.from(types);\r\n\t\t\tthis._accept = this._types.join(',');\r\n\t\t\ttypes.forEach(t => this._typeRegExps.push(new RegExp(t.replace(/\\*/g, '.*'))));\r\n\t\t}\r\n\t}\r\n\r\n\t/** @ignore */\r\n\t_fileSizeExceedMsg: string = '';\r\n\r\n\t/** @ignore */\r\n\t_uploadingItems: UploadingItem[] = [];\r\n\r\n\t/** @ignore */\r\n\t_accept = '*/*';\r\n\r\n\t/** @ignore */\r\n\t_itemAnimationStart = new Subject<void>();\r\n\t/** @ignore */\r\n\t_itemAnimationDone = new Subject<void>();\r\n\t/** @ignore */\r\n\t_itemAnimationInProgress = false;\r\n\r\n\tprivate _onChange = (_: string[]) => {};\r\n\tprivate _onTouch = () => {};\r\n\tprivate _frameDndEnter: (event: DragEvent) => void;\r\n\tprivate _frameDndLeave: () => void;\r\n\tprivate _frameDndOver: (event: DragEvent) => void;\r\n\tprivate _frameDndStop: () => void;\r\n\tprivate _overFrameCounter = 0;\r\n\tprivate _overCounter = 0;\r\n\tprivate _typeRegExps: RegExp[] = [/.*\\/.*/];\r\n\tprivate _types: string[] = ['*/*'];\r\n\tprivate _initSubs?: Subscription;\r\n\tprivate _numberOfFilesDragged = 0;\r\n\r\n\t@ViewChild('fileInput', { read: ElementRef, static: true })\r\n\tprivate _fileInput!: ElementRef<HTMLInputElement>;\r\n\r\n\tconstructor(private _service: FileUploadService) {\r\n\t\tthis._onChange([]);\r\n\t\tthis._onTouch();\r\n\t\tthis._frameDndEnter = this._onDndEnterFrame.bind(this);\r\n\t\tthis._frameDndLeave = this._onDndLeaveFrame.bind(this);\r\n\t\tthis._frameDndStop = this._onDndStopFrame.bind(this);\r\n\t\tthis._frameDndOver = event => event.preventDefault();\r\n\t}\r\n\r\n\t/** @internal */\r\n\tngOnInit(): void {\r\n\t\tdocument.addEventListener('dragenter', this._frameDndEnter);\r\n\t\tdocument.addEventListener('dragleave', this._frameDndLeave);\r\n\t\tdocument.addEventListener('dragend', this._frameDndStop);\r\n\t\tdocument.addEventListener('drop', this._frameDndStop);\r\n\t\tdocument.addEventListener('dragover', this._frameDndOver);\r\n\t\tthis._itemAnimationStart.subscribe(() => (this._itemAnimationInProgress = true));\r\n\t\tthis._itemAnimationDone.subscribe(() => (this._itemAnimationInProgress = false));\r\n\t}\r\n\r\n\tngOnDestroy(): void {\r\n\t\tdocument.removeEventListener('dragenter', this._frameDndEnter);\r\n\t\tdocument.removeEventListener('dragleave', this._frameDndLeave);\r\n\t\tdocument.removeEventListener('dragend', this._frameDndStop);\r\n\t\tdocument.removeEventListener('drop', this._frameDndStop);\r\n\t\tdocument.removeEventListener('dragover', this._frameDndOver);\r\n\t\tthis._itemAnimationStart.complete();\r\n\t\tthis._itemAnimationDone.complete();\r\n\t}\r\n\r\n\t/** @internal */\r\n\twriteValue(obj: any): void {\r\n\t\tif (Array.isArray(obj)) {\r\n\t\t\tif (!this._value) {\r\n\t\t\t\tthis._acceptChange(obj);\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tconst common = obj.filter(v => this._value!.includes(v));\r\n\t\t\tif (common.length === obj.length && common.length === this._value.length) {\r\n\t\t\t\treturn; // no change\r\n\t\t\t}\r\n\t\t\tthis._acceptChange(obj);\r\n\t\t} else {\r\n\t\t\tthis._value = null;\r\n\t\t}\r\n\t}\r\n\r\n\t/** @internal */\r\n\tregisterOnChange(fn: any): void {\r\n\t\tthis._onChange = fn;\r\n\t}\r\n\r\n\t/** @internal */\r\n\tregisterOnTouched(fn: any): void {\r\n\t\tthis._onTouch = fn;\r\n\t}\r\n\r\n\t/** @internal */\r\n\t@HostListener('dragenter', ['$event'])\r\n\tonDragEnter(event: DragEvent) {\r\n\t\tevent.preventDefault();\r\n\t\tevent.stopPropagation();\r\n\t\tthis._overCounter++;\r\n\t}\r\n\r\n\t/** @internal */\r\n\t@HostListener('dragover', ['$event'])\r\n\tonDragOver(event: Event) {\r\n\t\tevent.preventDefault();\r\n\t}\r\n\r\n\t/** @internal */\r\n\t@HostListener('dragleave', ['$event'])\r\n\tonDragLeave(event: Event) {\r\n\t\tevent.preventDefault();\r\n\t\tevent.stopPropagation();\r\n\t\tthis._overCounter--;\r\n\t}\r\n\r\n\t/** @internal */\r\n\t@HostListener('drop', ['$event'])\r\n\tonDndDrop(event: DragEvent) {\r\n\t\tevent.preventDefault();\r\n\t\tevent.stopPropagation();\r\n\t\tthis._onDndStopFrame();\r\n\t\tconst files = event.dataTransfer?.files;\r\n\t\tif (files?.length && this._validateFileSize(files)) {\r\n\t\t\tthis._uploadFiles(Array.from(files));\r\n\t\t}\r\n\t}\r\n\r\n\t/** Open the file selection dialog */\r\n\tselectFiles() {\r\n\t\tthis._fileInput.nativeElement.click();\r\n\t}\r\n\r\n\t/** @ignore */\r\n\t_openItem(item: UploadingItem) {\r\n\t\titem.downloadingSubs = this._service.get(item.uploadedItem!.id).subscribe(blob => {\r\n\t\t\tconst url = URL.createObjectURL(blob);\r\n\t\t\twindow.open(url, '_blank');\r\n\t\t});\r\n\t}\r\n\r\n\t/** @ignore */\r\n\tget _overFrame(): boolean {\r\n\t\treturn this._overFrameCounter > 0;\r\n\t}\r\n\r\n\t/** @ignore */\r\n\tget _overDropZone(): boolean {\r\n\t\treturn this._overCounter > 0;\r\n\t}\r\n\r\n\t/** Whether file uploading is in progress */\r\n\tget uploading(): boolean {\r\n\t\treturn this._uploadingItems.some(i => !i.done);\r\n\t}\r\n\r\n\t/** The remaining number of files allowed.*/\r\n\tget remaining(): number {\r\n\t\treturn this.limit ? this.limit - this._uploadingItems.length : Infinity;\r\n\t}\r\n\r\n\t/** @ignore */\r\n\t_handleFileSelection() {\r\n\t\tconst fileList = this._fileInput.nativeElement.files;\r\n\t\tif (fileList?.length && this._validateFileSize(fileList)) {\r\n\t\t\tthis._uploadFiles(Array.from(fileList));\r\n\t\t\tthis._fileInput.nativeElement.value = '';\r\n\t\t}\r\n\t}\r\n\r\n\t/** @ignore */\r\n\tget _invalidFilesDragged(): boolean {\r\n\t\treturn this._numberOfFilesDragged > this.remaining && (this._overFrame || this._overDropZone);\r\n\t}\r\n\r\n\t/** @ignore */\r\n\tget _initialising(): boolean {\r\n\t\treturn !!this._initSubs && !this._initSubs.closed;\r\n\t}\r\n\r\n\tprivate returnFileSize(size: number) {\r\n\t\tif (size < 1024) {\r\n\t\t\treturn `${size} bytes`;\r\n\t\t} else if (size >= 1024 && size < 1048576) {\r\n\t\t\treturn `${(size / 1024).toFixed(1)} KB`;\r\n\t\t} else {\r\n\t\t\treturn `${(size / 1048576).toFixed(1)} MB`;\r\n\t\t}\r\n\t}\r\n\r\n\tprivate _validateFileSize(files: FileList) {\r\n\t\tthis._fileSizeExceedMsg = '';\r\n\t\tconst maxSize = this.returnFileSize(this._getMaxBytes());\r\n\t\tfor (let i = 0; i < files.length; i++) {\r\n\t\t\tif (files[i]!.size > this._getMaxBytes()) {\r\n\t\t\t\tthis._fileSizeExceedMsg = `Selected file/s has exceeded the allowable size of ${maxSize} per file`;\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn true;\r\n\t}\r\n\r\n\tprivate _getMaxBytes(): number {\r\n\t\tif (typeof this.fileSize === 'string') {\r\n\t\t\tif (this.fileSize.toUpperCase().endsWith('KB')) {\r\n\t\t\t\tconst kiloBytes = this.fileSize.substring(0, this.fileSize.indexOf('KB'));\r\n\t\t\t\treturn Number(kiloBytes) * 1024;\r\n\t\t\t} else if (this.fileSize.toUpperCase().endsWith('MB')) {\r\n\t\t\t\tconst megaBytes = this.fileSize.substring(0, this.fileSize.indexOf('MB'));\r\n\t\t\t\treturn Number(megaBytes) * 1048576;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn this.fileSize as number;\r\n\t}\r\n\r\n\tprivate _uploadFiles(files: File[]) {\r\n\t\tif (this._initialising || files.length > this.remaining) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tconst filtered = files.filter(\r\n\t\t\tf =>\r\n\t\t\t\t(!f.type || this._typeRegExps.some(regexp => f.type.match(regexp))) &&\r\n\t\t\t\t!this._uploadingItems.some(i => i.name === f.name)\r\n\t\t);\r\n\t\tconst observables = this._service.upload(filtered);\r\n\t\tconst items = filtered.map(\r\n\t\t\t(f, i) => new UploadingItem(observables[i], f, this._updateItems.bind(this), this._deleteItem.bind(this))\r\n\t\t);\r\n\t\tthis._uploadingItems = [...this._uploadingItems, ...items];\r\n\t}\r\n\r\n\tprivate _onDndEnterFrame(event: DragEvent) {\r\n\t\tevent.preventDefault();\r\n\t\tthis._numberOfFilesDragged = event.dataTransfer?.items?.length || 0;\r\n\t\tthis._overFrameCounter++;\r\n\t}\r\n\r\n\tprivate _onDndLeaveFrame() {\r\n\t\tthis._overFrameCounter--;\r\n\t}\r\n\r\n\tprivate _onDndStopFrame() {\r\n\t\tthis._overFrameCounter = 0;\r\n\t\tthis._overCounter = 0;\r\n\t}\r\n\r\n\tprivate _acceptChange(v: string[]) {\r\n\t\tthis._initSubs = this._service.list().subscribe(list => {\r\n\t\t\tthis._uploadingItems = list\r\n\t\t\t\t.filter(i => v.includes(i.id))\r\n\t\t\t\t.map(f => new UploadingItem(f, this._deleteItem.bind(this)));\r\n\t\t});\r\n\t}\r\n\r\n\tprivate _updateItems() {\r\n\t\tconst completed = this._uploadingItems.filter(i => !!i.uploadedItem);\r\n\t\tthis._uploadingItems = [...completed, ...this._uploadingItems.filter(i => !i.uploadedItem)];\r\n\t\tthis._updateValue(completed);\r\n\t}\r\n\r\n\tprivate _deleteItem(item: UploadingItem) {\r\n\t\tconst key = item.uploadedItem?.id;\r\n\t\tif (key) {\r\n\t\t\tthis._service.delete(key).subscribe(() => {\r\n\t\t\t\tthis._uploadingItems = this._uploadingItems.filter(i => i !== item);\r\n\t\t\t\tconst completed = this._uploadingItems.filter(i => !!i.uploadedItem);\r\n\t\t\t\tthis._updateValue(completed);\r\n\t\t\t});\r\n\t\t} else {\r\n\t\t\tthis._uploadingItems = this._uploadingItems.filter(i => i !== item);\r\n\t\t\tconst completed = this._uploadingItems.filter(i => !!i.uploadedItem);\r\n\t\t\tthis._updateValue(completed);\r\n\t\t}\r\n\t}\r\n\r\n\tprivate _updateValue(completed: UploadingItem[]) {\r\n\t\tconst completedIds = completed.map(c => c.uploadedItem!.id);\r\n\t\tthis._value = completedIds;\r\n\t\tif (!this._value.length) {\r\n\t\t\tthis._value = null;\r\n\t\t}\r\n\t\tthis._onChange(completedIds);\r\n\t}\r\n}\r\n","<div class=\"bui-file-upload-container\">\r\n\t<div\r\n\t\tclass=\"bui-file-upload-hint\"\r\n\t\t*ngIf=\"!_initialising && remaining > 0 && (!_itemAnimationInProgress || remaining > 1)\"\r\n\t>\r\n\t\t<ng-template [ngIf]=\"_invalidFilesDragged\" [ngIfElse]=\"validDnd\">\r\n\t\t\t<mat-icon [buiIcon]=\"'block'\" [size]=\"32\" color=\"warn\" variant=\"outlined\" style=\"opacity: 0.6\"></mat-icon>\r\n\t\t</ng-template>\r\n\t\t<ng-template #validDnd>\r\n\t\t\t<div *ngIf=\"!_overFrame && !_overDropZone\" class=\"bui-color-muted bui-upload-icon-link\" (click)=\"selectFiles()\">\r\n\t\t\t\t<mat-icon [buiIcon]=\"'fas fa-cloud-upload-alt'\" [size]=\"32\"></mat-icon>\r\n\t\t\t\t<a role=\"button\">{{ uploadActionText }}</a>\r\n\t\t\t</div>\r\n\t\t\t<div *ngIf=\"_overFrame && !_overDropZone\" class=\"bui-color-light\">{{ dragHint }}</div>\r\n\t\t\t<div *ngIf=\"_overDropZone\" class=\"bui-color-light\">{{ dropHint }}</div>\r\n\t\t</ng-template>\r\n\t</div>\r\n\t<div\r\n\t\tclass=\"bui-file-upload-list\"\r\n\t\t[@slideOut]=\"_uploadingItems.length\"\r\n\t\t(@slideOut.start)=\"_itemAnimationStart.next()\"\r\n\t\t(@slideOut.done)=\"_itemAnimationDone.next()\"\r\n\t\t*ngIf=\"_uploadingItems.length\"\r\n\t>\r\n\t\t<span class=\"bui-file-uploaded-label\">{{ fileUploadedLabel }}</span>\r\n\r\n\t\t<ng-container *ngFor=\"let item of _uploadingItems; let idx = index\">\r\n\t\t\t<div class=\"bui-file-upload-item\" [class.in-progress]=\"!item.done\" #itemDiv>\r\n\t\t\t\t<div class=\"bui-file-upload-item-name\">\r\n\t\t\t\t\t<span>\r\n\t\t\t\t\t\t<mat-icon class=\"bui-color-muted\">description</mat-icon>\r\n\t\t\t\t\t\t<a\r\n\t\t\t\t\t\t\tclass=\"text\"\r\n\t\t\t\t\t\t\t*ngIf=\"item.done && !item.downloading; else staticName\"\r\n\t\t\t\t\t\t\thref=\"#{{ item.uploadedItem?.id }}\"\r\n\t\t\t\t\t\t\t(click)=\"$event.preventDefault(); _openItem(item)\"\r\n\t\t\t\t\t\t\tcontextmenu=\"false\"\r\n\t\t\t\t\t\t\tmatTooltip=\"Download\"\r\n\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t{{ item.name }}\r\n\t\t\t\t\t\t</a>\r\n\t\t\t\t\t\t<ng-template #staticName>\r\n\t\t\t\t\t\t\t<span class=\"text\">{{ item.name }}</span>\r\n\t\t\t\t\t\t</ng-template>\r\n\t\t\t\t\t</span>\r\n\t\t\t\t\t<div class=\"bui-file-upload-item-progress\">\r\n\t\t\t\t\t\t<mat-progress-bar\r\n\t\t\t\t\t\t\tmode=\"determinate\"\r\n\t\t\t\t\t\t\t[class.upload-completed]=\"item.done\"\r\n\t\t\t\t\t\t\t*ngIf=\"!item.downloading\"\r\n\t\t\t\t\t\t\t[value]=\"item.done ? 100 : item.progress * 100\"\r\n\t\t\t\t\t\t></mat-progress-bar>\r\n\t\t\t\t\t\t<mat-progress-bar mode=\"buffer\" *ngIf=\"item.downloading\"></mat-progress-bar>\r\n\t\t\t\t\t\t<span>\r\n\t\t\t\t\t\t\t<ng-template [ngIf]=\"item.done\" [ngIfElse]=\"inprogress\"> 100% </ng-template>\r\n\t\t\t\t\t\t\t<ng-template #inprogress>\r\n\t\t\t\t\t\t\t\t{{ item.progress | percent }}\r\n\t\t\t\t\t\t\t</ng-template>\r\n\t\t\t\t\t\t</span>\r\n\t\t\t\t\t</div>\r\n\t\t\t\t</div>\r\n\t\t\t\t<div class=\"bui-file-upload-item-action\">\r\n\t\t\t\t\t<button\r\n\t\t\t\t\t\tmat-icon-button\r\n\t\t\t\t\t\tcolor=\"primary\"\r\n\t\t\t\t\t\t(click)=\"item.cancel()\"\r\n\t\t\t\t\t\t(mouseenter)=\"itemDiv.classList.add('bui-file-upload-item-deleting')\"\r\n\t\t\t\t\t\t(mouseleave)=\"itemDiv.classList.remove('bui-file-upload-item-deleting')\"\r\n\t\t\t\t\t\tmatTooltip=\"Delete\"\r\n\t\t\t\t\t>\r\n\t\t\t\t\t\t<mat-icon [buiIcon]=\"'cancel'\" style=\"line-height: 0.9\"></mat-icon>\r\n\t\t\t\t\t</button>\r\n\t\t\t\t</div>\r\n\t\t\t</div>\r\n\t\t\t<mat-divider *ngIf=\"idx < _uploadingItems.length - 1\"></mat-divider>\r\n\t\t</ng-container>\r\n\t</div>\r\n\t<input\r\n\t\ttype=\"file\"\r\n\t\t#fileInput\r\n\t\tstyle=\"display: none\"\r\n\t\taccept=\"{{ _accept }}\"\r\n\t\t(change)=\"_handleFileSelection()\"\r\n\t\t[multiple]=\"remaining > 1\"\r\n\t/>\r\n\r\n\t<div *ngIf=\"_fileSizeExceedMsg\" class=\"bui-color-warn bui-file-size-exceed\">\r\n\t\t<span> {{ _fileSizeExceedMsg }}</span> <mat-icon role=\"button\" (click)=\"_fileSizeExceedMsg = ''\">cancel</mat-icon>\r\n\t</div>\r\n</div>\r\n","import { NgModule } from '@angular/core';\r\nimport { CommonModule } from '@angular/common';\r\nimport { FileUploadComponent } from './file-upload.component';\r\nimport { MatIconModule } from '@angular/material/icon';\r\nimport { IconFontModule } from '@bravura/ui/icon-font';\r\nimport { MatProgressBarModule } from '@angular/material/progress-bar';\r\nimport { MatButtonModule } from '@angular/material/button';\r\nimport { MatDividerModule } from '@angular/material/divider';\r\nimport { MatTooltipModule } from '@angular/material/tooltip';\r\n\r\n@NgModule({\r\n\tdeclarations: [FileUploadComponent],\r\n\timports: [\r\n\t\tCommonModule,\r\n\t\tMatIconModule,\r\n\t\tIconFontModule,\r\n\t\tMatProgressBarModule,\r\n\t\tMatButtonModule,\r\n\t\tMatDividerModule,\r\n\t\tMatTooltipModule\r\n\t],\r\n\texports: [FileUploadComponent]\r\n})\r\nexport class FileUploadModule {}\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["i1.FileUploadService"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAIA;;AAEG;MACU,cAAc,CAAA;;AAc1B,IAAA,WAAA,CAAY,GAAW,EAAE,KAAa,EAAE,KAAa,EAAE,KAAa,EAAA;AACnE,QAAA,IAAI,CAAC,EAAE,GAAG,GAAG,CAAC;AACd,QAAA,IAAI,CAAC,IAAI,GAAG,KAAK,CAAC;AAClB,QAAA,IAAI,CAAC,IAAI,GAAG,KAAK,CAAC;AAClB,QAAA,IAAI,CAAC,IAAI,GAAG,KAAK,CAAC;KAClB;AACD,CAAA;AAED;;;;;;AAMG;MAEmB,iBAAiB,CAAA;+GAAjB,iBAAiB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA,EAAA;mHAAjB,iBAAiB,EAAA,CAAA,CAAA,EAAA;;4FAAjB,iBAAiB,EAAA,UAAA,EAAA,C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