@bravura/ui 1.17.2 → 1.18.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 CHANGED
@@ -1,5 +1,11 @@
1
1
  # Change history
2
2
 
3
+ ## 1.18.0 (2022-04-05)
4
+
5
+ * fix(file-upload): fix fileupload build error ([56d61fa](https://scm.bravurasolutions.net/projects/DIGI/repos/ui-components/commits/56d61fa))
6
+ * fix(file-upload): fix janky animiation when upload link reveals ([9e5908f](https://scm.bravurasolutions.net/projects/DIGI/repos/ui-components/commits/9e5908f))
7
+ * feat(currency-input): add currency input directive ([7b40640](https://scm.bravurasolutions.net/projects/DIGI/repos/ui-components/commits/7b40640))
8
+
3
9
  ## <small>1.17.2 (2022-04-04)</small>
4
10
 
5
11
  * fix(file-upload): fix inconsistent margins ([5ba3890](https://scm.bravurasolutions.net/projects/DIGI/repos/ui-components/commits/5ba3890))
@@ -0,0 +1,317 @@
1
+ (function (global, factory) {
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/common'), require('@angular/core'), require('@angular/forms'), require('bignumber.js'), require('rxjs')) :
3
+ typeof define === 'function' && define.amd ? define('@bravura/ui/currency-input', ['exports', '@angular/common', '@angular/core', '@angular/forms', 'bignumber.js', 'rxjs'], factory) :
4
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.bravura = global.bravura || {}, global.bravura.ui = global.bravura.ui || {}, global.bravura.ui["currency-input"] = {}), global.ng.common, global.ng.core, global.ng.forms, global.BigNumber, global.rxjs));
5
+ })(this, (function (exports, common, i0, forms, BigNumber, rxjs) { 'use strict';
6
+
7
+ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
8
+
9
+ function _interopNamespace(e) {
10
+ if (e && e.__esModule) return e;
11
+ var n = Object.create(null);
12
+ if (e) {
13
+ Object.keys(e).forEach(function (k) {
14
+ if (k !== 'default') {
15
+ var d = Object.getOwnPropertyDescriptor(e, k);
16
+ Object.defineProperty(n, k, d.get ? d : {
17
+ enumerable: true,
18
+ get: function () { return e[k]; }
19
+ });
20
+ }
21
+ });
22
+ }
23
+ n["default"] = e;
24
+ return Object.freeze(n);
25
+ }
26
+
27
+ var i0__namespace = /*#__PURE__*/_interopNamespace(i0);
28
+ var BigNumber__default = /*#__PURE__*/_interopDefaultLegacy(BigNumber);
29
+
30
+ /* tslint:disable:no-empty */
31
+ var noop_consumer = function (_) { };
32
+ /**
33
+ * This directive will enhance an input element to format the numbers entered to a currency amount.
34
+ */
35
+ var CurrencyInputDirective = /** @class */ (function () {
36
+ function CurrencyInputDirective(_el, _renderer, _locale, _defaultCurrencyCode) {
37
+ this._el = _el;
38
+ this._renderer = _renderer;
39
+ this._locale = _locale;
40
+ this._defaultCurrencyCode = _defaultCurrencyCode;
41
+ /**
42
+ * true to allow negative input, otherwise false
43
+ * Default to false.
44
+ */
45
+ this.allowNegative = false;
46
+ /**
47
+ * Provide the currency code to format the entered amount.
48
+ * Uses angular token DEFAULT_CURRENCY_CODE by default.
49
+ */
50
+ this.currencyCode = '';
51
+ /**
52
+ * true if no decimal places allowed, otherwise false.
53
+ * Default to false.
54
+ */
55
+ this.wholeDollarOnly = false;
56
+ /**
57
+ * The format the of the amount either in wide or narrow.
58
+ */
59
+ this.format = 'narrow';
60
+ this.textCenter = 'right';
61
+ this.placeholder = '';
62
+ this.autocomplete = 'off';
63
+ this.type = 'text';
64
+ this.inputMode = 'decimal';
65
+ this.change = noop_consumer;
66
+ this.onTouch = rxjs.noop;
67
+ this._placeholderText = '0.00';
68
+ this._currencySymbol = '$';
69
+ this.wholeDollarOnly = false;
70
+ var userAgent = navigator.userAgent;
71
+ this._safari = !userAgent.match(/Firefox/i) && !userAgent.match(/Chrome/i) && !!userAgent.match(/safari/i);
72
+ this._currencyUpdated();
73
+ }
74
+ CurrencyInputDirective.prototype.ngOnInit = function () {
75
+ if (this.wholeDollarOnly) {
76
+ this._placeholderText = '0';
77
+ }
78
+ };
79
+ CurrencyInputDirective.prototype.ngOnChanges = function () {
80
+ this._currencyUpdated();
81
+ this.onInput();
82
+ };
83
+ CurrencyInputDirective.prototype.ngAfterViewInit = function () {
84
+ var _this = this;
85
+ setTimeout(function () {
86
+ _this.placeholder = "" + _this._currencySymbol + _this._placeholderText;
87
+ });
88
+ };
89
+ CurrencyInputDirective.prototype.onInput = function () {
90
+ if (this._safari) {
91
+ if (!isNaN(parseFloat(this._el.nativeElement.value))) {
92
+ this.change(Number(this._el.nativeElement.value));
93
+ }
94
+ else {
95
+ this.change(null);
96
+ }
97
+ }
98
+ else {
99
+ this._formatCurrency(this._el);
100
+ }
101
+ };
102
+ CurrencyInputDirective.prototype.onFocus = function () {
103
+ if (this._safari) {
104
+ // remove comma and currency symbol
105
+ var reg = new RegExp("[," + this._currencySymbol + "]", 'g');
106
+ var number = this._el.nativeElement.value.replace(reg, '');
107
+ this._renderer.setProperty(this._el.nativeElement, 'value', number);
108
+ }
109
+ };
110
+ CurrencyInputDirective.prototype.onblur = function () {
111
+ this.onTouch();
112
+ this._formatCurrency(this._el, true);
113
+ };
114
+ CurrencyInputDirective.prototype.writeValue = function (value) {
115
+ this._renderer.setProperty(this._el.nativeElement, 'value', value);
116
+ this._formatCurrency(this._el, true);
117
+ };
118
+ CurrencyInputDirective.prototype.registerOnChange = function (fn) {
119
+ this.change = fn;
120
+ };
121
+ CurrencyInputDirective.prototype.registerOnTouched = function (fn) {
122
+ this.onTouch = fn;
123
+ };
124
+ CurrencyInputDirective.prototype._currencyUpdated = function () {
125
+ this.currencyCode = this.currencyCode || this._defaultCurrencyCode;
126
+ this._currencySymbol = common.getCurrencySymbol(this.currencyCode, this.format, this._locale) || '$';
127
+ };
128
+ CurrencyInputDirective.prototype._formatCurrency = function (input, blur) {
129
+ if (blur === void 0) { blur = false; }
130
+ // appends $ to value, validates decimal side
131
+ // and puts cursor back in right position.
132
+ // get input value
133
+ var input_val = input.nativeElement.value;
134
+ // don't validate empty input
135
+ if (input_val === '') {
136
+ this.change(null);
137
+ return;
138
+ }
139
+ var minus = this.allowNegative ? '-' : '';
140
+ // remove non digit values except currency symbol, period and hypen
141
+ var reg = new RegExp("[^0-9" + minus + this._currencySymbol + ".]", 'g');
142
+ var sanitiseValue = input_val.replace(reg, '');
143
+ if (sanitiseValue === '' || sanitiseValue === this._currencySymbol) {
144
+ this.change(null);
145
+ this._renderer.setProperty(input.nativeElement, 'value', '');
146
+ return;
147
+ }
148
+ else if ((this.allowNegative && sanitiseValue === "-" + this._currencySymbol) ||
149
+ sanitiseValue === '-' ||
150
+ sanitiseValue === '--') {
151
+ this.change(null);
152
+ this._renderer.setProperty(input.nativeElement, 'value', '-');
153
+ return;
154
+ }
155
+ var negative = this.allowNegative && input_val.indexOf('-') >= 0;
156
+ // original length
157
+ var original_len = input_val.length;
158
+ // initial caret position
159
+ var caret_pos = input.nativeElement.selectionStart;
160
+ // check for decimal
161
+ if (input_val.indexOf('.') >= 0) {
162
+ // get position of first decimal
163
+ // this prevents multiple decimals from
164
+ // being entered
165
+ var decimal_pos = input_val.indexOf('.');
166
+ // split number by decimal point
167
+ var left_side = input_val.substring(0, decimal_pos);
168
+ var right_side = input_val.substring(decimal_pos);
169
+ // add commas to left side of number
170
+ left_side = this._formatNumber(left_side, blur);
171
+ // no value append a zero for decimal values
172
+ if (!left_side.length) {
173
+ left_side = '0';
174
+ }
175
+ if (!this.wholeDollarOnly) {
176
+ // validate right side
177
+ right_side = right_side.replace(/\D/g, '');
178
+ // Limit decimal to only 2 digits
179
+ var v = new BigNumber__default["default"]("0." + right_side).dp(2).toNumber();
180
+ if (v) {
181
+ var length = right_side.length > 1 ? 2 : 1;
182
+ right_side = v.toFixed(length).substring(2, 4);
183
+ }
184
+ // On blur make sure 2 numbers after decimal
185
+ if (blur) {
186
+ right_side += '00';
187
+ }
188
+ right_side = right_side.substring(0, 2);
189
+ // join number by .
190
+ input_val = left_side + '.' + right_side;
191
+ }
192
+ else {
193
+ input_val = left_side;
194
+ }
195
+ }
196
+ else {
197
+ input_val = this._formatNumber(input_val, blur);
198
+ // final formatting
199
+ if (blur && !this.wholeDollarOnly) {
200
+ input_val += '.00';
201
+ }
202
+ }
203
+ // append the currency symbol
204
+ input_val = this._currencySymbol + input_val;
205
+ if (negative) {
206
+ // append the hypen back to the value if a negative value was entered
207
+ input_val = "-" + input_val;
208
+ }
209
+ var num = Number(input_val.replace(/[^0-9.-]/g, ''));
210
+ // update control value first with the number
211
+ this.change(Number(num));
212
+ if (blur && num === 0) {
213
+ input_val = "" + this._currencySymbol + this._placeholderText;
214
+ }
215
+ // update dom with the formatted value
216
+ this._renderer.setProperty(input.nativeElement, 'value', input_val);
217
+ // put caret back in the right position
218
+ var updated_len = input_val.length;
219
+ if (caret_pos) {
220
+ caret_pos = updated_len - original_len + caret_pos;
221
+ }
222
+ if (!this._safari) {
223
+ input.nativeElement.setSelectionRange(caret_pos, caret_pos);
224
+ }
225
+ };
226
+ // format the number into currency format
227
+ CurrencyInputDirective.prototype._formatNumber = function (n, blur) {
228
+ if (blur === void 0) { blur = false; }
229
+ // format number 1000000 to 1,234,567
230
+ n = n.replace(/\D/g, '');
231
+ if (blur) {
232
+ n = n.replace(/^0+/, '');
233
+ }
234
+ return n.replace(/\B(?=(\d{3})+(?!\d))/g, ',');
235
+ };
236
+ return CurrencyInputDirective;
237
+ }());
238
+ CurrencyInputDirective.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0__namespace, type: CurrencyInputDirective, deps: [{ token: i0__namespace.ElementRef, self: true }, { token: i0__namespace.Renderer2 }, { token: i0.LOCALE_ID }, { token: i0.DEFAULT_CURRENCY_CODE }], target: i0__namespace.ɵɵFactoryTarget.Directive });
239
+ CurrencyInputDirective.ɵdir = i0__namespace.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.7", type: CurrencyInputDirective, selector: "[buiCurrencyInput]", inputs: { allowNegative: "allowNegative", currencyCode: "currencyCode", wholeDollarOnly: "wholeDollarOnly", format: "format" }, host: { listeners: { "input": "onInput()", "focus": "onFocus()", "blur": "onblur()" }, properties: { "style.text-align": "this.textCenter", "placeholder": "this.placeholder", "autocomplete": "this.autocomplete", "type": "this.type", "attr.inputmode": "this.inputMode" } }, providers: [{ provide: forms.NG_VALUE_ACCESSOR, useExisting: i0.forwardRef(function () { return CurrencyInputDirective; }), multi: true }], usesOnChanges: true, ngImport: i0__namespace });
240
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0__namespace, type: CurrencyInputDirective, decorators: [{
241
+ type: i0.Directive,
242
+ args: [{
243
+ selector: '[buiCurrencyInput]',
244
+ providers: [{ provide: forms.NG_VALUE_ACCESSOR, useExisting: i0.forwardRef(function () { return CurrencyInputDirective; }), multi: true }]
245
+ }]
246
+ }], ctorParameters: function () {
247
+ return [{ type: i0__namespace.ElementRef, decorators: [{
248
+ type: i0.Self
249
+ }] }, { type: i0__namespace.Renderer2 }, { type: undefined, decorators: [{
250
+ type: i0.Inject,
251
+ args: [i0.LOCALE_ID]
252
+ }] }, { type: undefined, decorators: [{
253
+ type: i0.Inject,
254
+ args: [i0.DEFAULT_CURRENCY_CODE]
255
+ }] }];
256
+ }, propDecorators: { allowNegative: [{
257
+ type: i0.Input
258
+ }], currencyCode: [{
259
+ type: i0.Input
260
+ }], wholeDollarOnly: [{
261
+ type: i0.Input
262
+ }], format: [{
263
+ type: i0.Input
264
+ }], textCenter: [{
265
+ type: i0.HostBinding,
266
+ args: ['style.text-align']
267
+ }], placeholder: [{
268
+ type: i0.HostBinding,
269
+ args: ['placeholder']
270
+ }], autocomplete: [{
271
+ type: i0.HostBinding,
272
+ args: ['autocomplete']
273
+ }], type: [{
274
+ type: i0.HostBinding,
275
+ args: ['type']
276
+ }], inputMode: [{
277
+ type: i0.HostBinding,
278
+ args: ['attr.inputmode']
279
+ }], onInput: [{
280
+ type: i0.HostListener,
281
+ args: ['input']
282
+ }], onFocus: [{
283
+ type: i0.HostListener,
284
+ args: ['focus']
285
+ }], onblur: [{
286
+ type: i0.HostListener,
287
+ args: ['blur']
288
+ }] } });
289
+
290
+ var CurrencyInputModule = /** @class */ (function () {
291
+ function CurrencyInputModule() {
292
+ }
293
+ return CurrencyInputModule;
294
+ }());
295
+ CurrencyInputModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0__namespace, type: CurrencyInputModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
296
+ CurrencyInputModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0__namespace, type: CurrencyInputModule, declarations: [CurrencyInputDirective], imports: [common.CommonModule], exports: [CurrencyInputDirective] });
297
+ CurrencyInputModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0__namespace, type: CurrencyInputModule, imports: [[common.CommonModule]] });
298
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0__namespace, type: CurrencyInputModule, decorators: [{
299
+ type: i0.NgModule,
300
+ args: [{
301
+ declarations: [CurrencyInputDirective],
302
+ imports: [common.CommonModule],
303
+ exports: [CurrencyInputDirective]
304
+ }]
305
+ }] });
306
+
307
+ /**
308
+ * Generated bundle index. Do not edit.
309
+ */
310
+
311
+ exports.CurrencyInputDirective = CurrencyInputDirective;
312
+ exports.CurrencyInputModule = CurrencyInputModule;
313
+
314
+ Object.defineProperty(exports, '__esModule', { value: true });
315
+
316
+ }));
317
+ //# sourceMappingURL=bravura-ui-currency-input.umd.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bravura-ui-currency-input.umd.js","sources":["../../../projects/ui/currency-input/currency-input.directive.ts","../../../projects/ui/currency-input/currency-input.module.ts","../../../projects/ui/currency-input/bravura-ui-currency-input.ts"],"sourcesContent":["import { getCurrencySymbol } from '@angular/common';\nimport {\n\tAfterViewInit,\n\tDEFAULT_CURRENCY_CODE,\n\tDirective,\n\tElementRef,\n\tforwardRef,\n\tHostBinding,\n\tHostListener,\n\tInject,\n\tInput,\n\tLOCALE_ID,\n\tOnChanges,\n\tOnInit,\n\tRenderer2,\n\tSelf\n} from '@angular/core';\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';\nimport BigNumber from 'bignumber.js';\nimport { noop } from 'rxjs';\n\n/* tslint:disable:no-empty */\nexport const noop_consumer = (_: any) => {};\n\n/**\n * This directive will enhance an input element to format the numbers entered to a currency amount.\n */\n@Directive({\n\tselector: '[buiCurrencyInput]',\n\tproviders: [{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => CurrencyInputDirective), multi: true }]\n})\nexport class CurrencyInputDirective implements OnInit, OnChanges, AfterViewInit, ControlValueAccessor {\n\t/**\n\t * true to allow negative input, otherwise false\n\t * Default to false.\n\t */\n\t@Input()\n\tallowNegative: boolean = false;\n\n\t/**\n\t * Provide the currency code to format the entered amount.\n\t * Uses angular token DEFAULT_CURRENCY_CODE by default.\n\t */\n\t@Input()\n\tcurrencyCode: string = '';\n\n\t/**\n\t * true if no decimal places allowed, otherwise false.\n\t * Default to false.\n\t */\n\t@Input()\n\twholeDollarOnly = false;\n\n\t/**\n\t * The format the of the amount either in wide or narrow.\n\t */\n\t@Input()\n\tformat: 'narrow' | 'wide' = 'narrow';\n\n\t@HostBinding('style.text-align')\n\tprivate textCenter = 'right';\n\n\t@HostBinding('placeholder')\n\tprivate placeholder: string = '';\n\n\t@HostBinding('autocomplete')\n\tprivate autocomplete = 'off';\n\n\t@HostBinding('type')\n\tprivate type = 'text';\n\n\t@HostBinding('attr.inputmode')\n\tprivate inputMode = 'decimal';\n\n\tprivate change = noop_consumer;\n\tprivate onTouch = noop;\n\tprivate _safari: boolean;\n\tprivate _placeholderText: string = '0.00';\n\tprivate _currencySymbol: string = '$';\n\n\tconstructor(\n\t\t@Self() private _el: ElementRef<HTMLInputElement>,\n\t\tprivate _renderer: Renderer2,\n\t\t@Inject(LOCALE_ID) private _locale: string,\n\t\t@Inject(DEFAULT_CURRENCY_CODE) private _defaultCurrencyCode: string\n\t) {\n\t\tthis.wholeDollarOnly = false;\n\t\tconst userAgent = navigator.userAgent;\n\t\tthis._safari = !userAgent.match(/Firefox/i) && !userAgent.match(/Chrome/i) && !!userAgent.match(/safari/i);\n\t\tthis._currencyUpdated();\n\t}\n\n\tngOnInit() {\n\t\tif (this.wholeDollarOnly) {\n\t\t\tthis._placeholderText = '0';\n\t\t}\n\t}\n\n\tngOnChanges(): void {\n\t\tthis._currencyUpdated();\n\t\tthis.onInput();\n\t}\n\n\tngAfterViewInit() {\n\t\tsetTimeout(() => {\n\t\t\tthis.placeholder = `${this._currencySymbol}${this._placeholderText}`;\n\t\t});\n\t}\n\n\t@HostListener('input')\n\tonInput() {\n\t\tif (this._safari) {\n\t\t\tif (!isNaN(parseFloat(this._el.nativeElement.value))) {\n\t\t\t\tthis.change(Number(this._el.nativeElement.value));\n\t\t\t} else {\n\t\t\t\tthis.change(null);\n\t\t\t}\n\t\t} else {\n\t\t\tthis._formatCurrency(this._el);\n\t\t}\n\t}\n\n\t@HostListener('focus')\n\tonFocus() {\n\t\tif (this._safari) {\n\t\t\t// remove comma and currency symbol\n\t\t\tconst reg = new RegExp(`[,${this._currencySymbol}]`, 'g');\n\t\t\tlet number = this._el.nativeElement.value.replace(reg, '');\n\t\t\tthis._renderer.setProperty(this._el.nativeElement, 'value', number);\n\t\t}\n\t}\n\n\t@HostListener('blur')\n\tonblur() {\n\t\tthis.onTouch();\n\t\tthis._formatCurrency(this._el, true);\n\t}\n\n\twriteValue(value: any) {\n\t\tthis._renderer.setProperty(this._el.nativeElement, 'value', value);\n\t\tthis._formatCurrency(this._el, true);\n\t}\n\n\tregisterOnChange(fn: any) {\n\t\tthis.change = fn;\n\t}\n\n\tregisterOnTouched(fn: any) {\n\t\tthis.onTouch = fn;\n\t}\n\n\tprivate _currencyUpdated() {\n\t\tthis.currencyCode = this.currencyCode || this._defaultCurrencyCode;\n\t\tthis._currencySymbol = getCurrencySymbol(this.currencyCode, this.format, this._locale) || '$';\n\t}\n\n\tprivate _formatCurrency(input: ElementRef<HTMLInputElement>, blur: boolean = false) {\n\t\t// appends $ to value, validates decimal side\n\t\t// and puts cursor back in right position.\n\t\t// get input value\n\t\tlet input_val = input.nativeElement.value;\n\n\t\t// don't validate empty input\n\t\tif (input_val === '') {\n\t\t\tthis.change(null);\n\t\t\treturn;\n\t\t}\n\n\t\tconst minus = this.allowNegative ? '-' : '';\n\n\t\t// remove non digit values except currency symbol, period and hypen\n\t\tconst reg = new RegExp(`[^0-9${minus}${this._currencySymbol}.]`, 'g');\n\n\t\tlet sanitiseValue = input_val.replace(reg, '');\n\n\t\tif (sanitiseValue === '' || sanitiseValue === this._currencySymbol) {\n\t\t\tthis.change(null);\n\t\t\tthis._renderer.setProperty(input.nativeElement, 'value', '');\n\t\t\treturn;\n\t\t} else if (\n\t\t\t(this.allowNegative && sanitiseValue === `-${this._currencySymbol}`) ||\n\t\t\tsanitiseValue === '-' ||\n\t\t\tsanitiseValue === '--'\n\t\t) {\n\t\t\tthis.change(null);\n\t\t\tthis._renderer.setProperty(input.nativeElement, 'value', '-');\n\t\t\treturn;\n\t\t}\n\n\t\tconst negative = this.allowNegative && input_val.indexOf('-') >= 0;\n\n\t\t// original length\n\t\tconst original_len = input_val.length;\n\n\t\t// initial caret position\n\t\tlet caret_pos = input.nativeElement.selectionStart;\n\n\t\t// check for decimal\n\t\tif (input_val.indexOf('.') >= 0) {\n\t\t\t// get position of first decimal\n\t\t\t// this prevents multiple decimals from\n\t\t\t// being entered\n\t\t\tlet decimal_pos = input_val.indexOf('.');\n\n\t\t\t// split number by decimal point\n\t\t\tlet left_side = input_val.substring(0, decimal_pos);\n\t\t\tlet right_side = input_val.substring(decimal_pos);\n\n\t\t\t// add commas to left side of number\n\t\t\tleft_side = this._formatNumber(left_side, blur);\n\n\t\t\t// no value append a zero for decimal values\n\t\t\tif (!left_side.length) {\n\t\t\t\tleft_side = '0';\n\t\t\t}\n\n\t\t\tif (!this.wholeDollarOnly) {\n\t\t\t\t// validate right side\n\t\t\t\tright_side = right_side.replace(/\\D/g, '');\n\n\t\t\t\t// Limit decimal to only 2 digits\n\t\t\t\tlet v = new BigNumber(`0.${right_side}`).dp(2).toNumber();\n\t\t\t\tif (v) {\n\t\t\t\t\tconst length = right_side.length > 1 ? 2 : 1;\n\t\t\t\t\tright_side = v.toFixed(length).substring(2, 4);\n\t\t\t\t}\n\n\t\t\t\t// On blur make sure 2 numbers after decimal\n\t\t\t\tif (blur) {\n\t\t\t\t\tright_side += '00';\n\t\t\t\t}\n\n\t\t\t\tright_side = right_side.substring(0, 2);\n\n\t\t\t\t// join number by .\n\t\t\t\tinput_val = left_side + '.' + right_side;\n\t\t\t} else {\n\t\t\t\tinput_val = left_side;\n\t\t\t}\n\t\t} else {\n\t\t\tinput_val = this._formatNumber(input_val, blur);\n\n\t\t\t// final formatting\n\t\t\tif (blur && !this.wholeDollarOnly) {\n\t\t\t\tinput_val += '.00';\n\t\t\t}\n\t\t}\n\n\t\t// append the currency symbol\n\t\tinput_val = this._currencySymbol + input_val;\n\n\t\tif (negative) {\n\t\t\t// append the hypen back to the value if a negative value was entered\n\t\t\tinput_val = `-${input_val}`;\n\t\t}\n\n\t\tconst num = Number(input_val.replace(/[^0-9.-]/g, ''));\n\n\t\t// update control value first with the number\n\t\tthis.change(Number(num));\n\n\t\tif (blur && num === 0) {\n\t\t\tinput_val = `${this._currencySymbol}${this._placeholderText}`;\n\t\t}\n\n\t\t// update dom with the formatted value\n\t\tthis._renderer.setProperty(input.nativeElement, 'value', input_val);\n\t\t// put caret back in the right position\n\t\tlet updated_len = input_val.length;\n\t\tif (caret_pos) {\n\t\t\tcaret_pos = updated_len - original_len + caret_pos;\n\t\t}\n\t\tif (!this._safari) {\n\t\t\tinput.nativeElement.setSelectionRange(caret_pos, caret_pos);\n\t\t}\n\t}\n\n\t// format the number into currency format\n\tprivate _formatNumber(n: string, blur: boolean = false) {\n\t\t// format number 1000000 to 1,234,567\n\t\tn = n.replace(/\\D/g, '');\n\t\tif (blur) {\n\t\t\tn = n.replace(/^0+/, '');\n\t\t}\n\t\treturn n.replace(/\\B(?=(\\d{3})+(?!\\d))/g, ',');\n\t}\n}\n","import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { CurrencyInputDirective } from './currency-input.directive';\n\n@NgModule({\n\tdeclarations: [CurrencyInputDirective],\n\timports: [CommonModule],\n\texports: [CurrencyInputDirective]\n})\nexport class CurrencyInputModule {}\n\nexport { CurrencyInputDirective };\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["noop","getCurrencySymbol","BigNumber","LOCALE_ID","DEFAULT_CURRENCY_CODE","NG_VALUE_ACCESSOR","forwardRef","Directive","Self","Inject","Input","HostBinding","HostListener","CommonModule","NgModule"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAqBA;IACO,IAAM,aAAa,GAAG,UAAC,CAAM,KAAO,CAAC;IAE5C;;;;QAwDC,gCACiB,GAAiC,EACzC,SAAoB,EACD,OAAe,EACH,oBAA4B;YAHnD,QAAG,GAAH,GAAG,CAA8B;YACzC,cAAS,GAAT,SAAS,CAAW;YACD,YAAO,GAAP,OAAO,CAAQ;YACH,yBAAoB,GAApB,oBAAoB,CAAQ;;;;;YA/CpE,kBAAa,GAAY,KAAK,CAAC;;;;;YAO/B,iBAAY,GAAW,EAAE,CAAC;;;;;YAO1B,oBAAe,GAAG,KAAK,CAAC;;;;YAMxB,WAAM,GAAsB,QAAQ,CAAC;YAG7B,eAAU,GAAG,OAAO,CAAC;YAGrB,gBAAW,GAAW,EAAE,CAAC;YAGzB,iBAAY,GAAG,KAAK,CAAC;YAGrB,SAAI,GAAG,MAAM,CAAC;YAGd,cAAS,GAAG,SAAS,CAAC;YAEtB,WAAM,GAAG,a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@ignore */
481
481
  this._accept = '*/*';
482
+ /** @ignore */
483
+ this._itemAnimationStart = new rxjs.Subject();
484
+ /** @ignore */
485
+ this._itemAnimationDone = new rxjs.Subject();
486
+ /** @ignore */
487
+ this._itemAnimationInProgress = false;
482
488
  this._onChange = function (_) { };
483
489
  this._onTouch = function () { };
484
490
  this._overFrameCounter = 0;
@@ -516,11 +522,14 @@
516
522
  });
517
523
  /** @internal */
518
524
  FileUploadComponent.prototype.ngOnInit = function () {
525
+ var _this = this;
519
526
  document.addEventListener('dragenter', this._frameDndEnter);
520
527
  document.addEventListener('dragleave', this._frameDndLeave);
521
528
  document.addEventListener('dragend', this._frameDndStop);
522
529
  document.addEventListener('drop', this._frameDndStop);
523
530
  document.addEventListener('dragover', this._frameDndOver);
531
+ this._itemAnimationStart.subscribe(function () { return (_this._itemAnimationInProgress = true); });
532
+ this._itemAnimationDone.subscribe(function () { return (_this._itemAnimationInProgress = false); });
524
533
  };
525
534
  FileUploadComponent.prototype.ngOnDestroy = function () {
526
535
  document.removeEventListener('dragenter', this._frameDndEnter);
@@ -528,6 +537,8 @@
528
537
  document.removeEventListener('dragend', this._frameDndStop);
529
538
  document.removeEventListener('drop', this._frameDndStop);
530
539
  document.removeEventListener('dragover', this._frameDndOver);
540
+ this._itemAnimationStart.complete();
541
+ this._itemAnimationDone.complete();
531
542
  };
532
543
  /** @internal */
533
544
  FileUploadComponent.prototype.writeValue = function (obj) {
@@ -714,7 +725,7 @@
714
725
  return FileUploadComponent;
715
726
  }());
716
727
  FileUploadComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0__namespace, type: FileUploadComponent, deps: [{ token: FileUploadService }], target: i0__namespace.ɵɵFactoryTarget.Component });
717
- FileUploadComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.7", 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: forms.NG_VALUE_ACCESSOR, useExisting: i0.forwardRef(function () { return FileUploadComponent; }), multi: true }], viewQueries: [{ propertyName: "_fileInput", first: true, predicate: ["fileInput"], descendants: true, read: i0.ElementRef, static: true }], ngImport: i0__namespace, template: "<div class=\"bui-file-upload-container\">\n\t<div class=\"bui-file-upload-hint\" *ngIf=\"!_initialising && remaining > 0\">\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 class=\"bui-file-upload-list\" [@slideOut]=\"_uploadingItems.length\" *ngIf=\"_uploadingItems.length\">\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\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{{ item.name }}\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'\" [size]=\"18\" style=\"line-height: 1\"></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:4px}: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:none 0s ease 0s;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;text-align:left;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{margin-right:calc(1rem - 4px);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;margin-left:-.25rem;margin-right:.2rem}: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-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;margin-right:.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{-webkit-animation:pulse 1s ease-in-out;animation:pulse 1s ease-in-out}@-webkit-keyframes pulse{0%{transform:scaleY(1)}50%{transform:scaleY(1.5)}to{transform:scaleY(1)}}@keyframes pulse{0%{transform:scaleY(1)}50%{transform:scaleY(1.5)}to{transform:scaleY(1)}}\n"], components: [{ type: i2__namespace.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { type: i3__namespace.MatProgressBar, selector: "mat-progress-bar", inputs: ["color", "mode", "value", "bufferValue"], outputs: ["animationEnd"], exportAs: ["matProgressBar"] }, { type: i4__namespace.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__namespace.MatDivider, selector: "mat-divider", inputs: ["vertical", "inset"] }], directives: [{ type: i6__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i7__namespace.IconDirective, selector: "[buiIcon]", inputs: ["buiIcon", "size", "variant"] }, { type: i6__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i8__namespace.MatTooltip, selector: "[matTooltip]", exportAs: ["matTooltip"] }], pipes: { "percent": i6__namespace.PercentPipe }, animations: [
728
+ FileUploadComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.7", 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: forms.NG_VALUE_ACCESSOR, useExisting: i0.forwardRef(function () { return FileUploadComponent; }), multi: true }], viewQueries: [{ propertyName: "_fileInput", first: true, predicate: ["fileInput"], descendants: true, read: i0.ElementRef, static: true }], ngImport: i0__namespace, 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\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{{ item.name }}\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'\" [size]=\"18\" style=\"line-height: 1\"></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:4px}: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:none 0s ease 0s;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;text-align:left;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{margin-right:calc(1rem - 4px);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;margin-left:-.25rem;margin-right:.2rem}: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-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;margin-right:.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{-webkit-animation:pulse 1s ease-in-out;animation:pulse 1s ease-in-out}@-webkit-keyframes pulse{0%{transform:scaleY(1)}50%{transform:scaleY(1.5)}to{transform:scaleY(1)}}@keyframes pulse{0%{transform:scaleY(1)}50%{transform:scaleY(1.5)}to{transform:scaleY(1)}}\n"], components: [{ type: i2__namespace.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { type: i3__namespace.MatProgressBar, selector: "mat-progress-bar", inputs: ["color", "mode", "value", "bufferValue"], outputs: ["animationEnd"], exportAs: ["matProgressBar"] }, { type: i4__namespace.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__namespace.MatDivider, selector: "mat-divider", inputs: ["vertical", "inset"] }], directives: [{ type: i6__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i7__namespace.IconDirective, selector: "[buiIcon]", inputs: ["buiIcon", "size", "variant"] }, { type: i6__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i8__namespace.MatTooltip, selector: "[matTooltip]", exportAs: ["matTooltip"] }], pipes: { "percent": i6__namespace.PercentPipe }, animations: [
718
729
  animations.trigger('slideOut', [
719
730
  animations.transition('* => *', [
720
731
  animations.query(':leave', animations.stagger(100, animations.animate('0.25s', animations.style({ height: 0, overflow: 'hidden' }))), { optional: true })