@skyux/forms 5.5.0 → 5.6.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundles/skyux-forms.umd.js +411 -408
- package/documentation.json +489 -831
- package/esm2015/lib/modules/character-counter/character-counter-indicator.component.js.map +1 -1
- package/esm2015/lib/modules/character-counter/character-counter.directive.js +1 -0
- package/esm2015/lib/modules/character-counter/character-counter.directive.js.map +1 -1
- package/esm2015/lib/modules/character-counter/character-counter.module.js +2 -2
- package/esm2015/lib/modules/character-counter/character-counter.module.js.map +1 -1
- package/esm2015/lib/modules/checkbox/checkbox-required-validator.directive.js.map +1 -1
- package/esm2015/lib/modules/checkbox/checkbox.component.js +4 -3
- package/esm2015/lib/modules/checkbox/checkbox.component.js.map +1 -1
- package/esm2015/lib/modules/checkbox/checkbox.module.js +1 -1
- package/esm2015/lib/modules/checkbox/checkbox.module.js.map +1 -1
- package/esm2015/lib/modules/file-attachment/file-attachment-label.component.js +1 -1
- package/esm2015/lib/modules/file-attachment/file-attachment-label.component.js.map +1 -1
- package/esm2015/lib/modules/file-attachment/file-attachment.component.js +6 -6
- package/esm2015/lib/modules/file-attachment/file-attachment.component.js.map +1 -1
- package/esm2015/lib/modules/file-attachment/file-attachment.service.js +6 -6
- package/esm2015/lib/modules/file-attachment/file-attachment.service.js.map +1 -1
- package/esm2015/lib/modules/file-attachment/file-attachments.module.js +3 -3
- package/esm2015/lib/modules/file-attachment/file-attachments.module.js.map +1 -1
- package/esm2015/lib/modules/file-attachment/file-drop.component.js +7 -8
- package/esm2015/lib/modules/file-attachment/file-drop.component.js.map +1 -1
- package/esm2015/lib/modules/file-attachment/file-item.component.js +5 -3
- package/esm2015/lib/modules/file-attachment/file-item.component.js.map +1 -1
- package/esm2015/lib/modules/file-attachment/file-item.service.js +5 -5
- package/esm2015/lib/modules/file-attachment/file-item.service.js.map +1 -1
- package/esm2015/lib/modules/file-attachment/file-size.pipe.js +5 -6
- package/esm2015/lib/modules/file-attachment/file-size.pipe.js.map +1 -1
- package/esm2015/lib/modules/input-box/input-box-host.service.js.map +1 -1
- package/esm2015/lib/modules/input-box/input-box.component.js.map +1 -1
- package/esm2015/lib/modules/input-box/input-box.module.js +1 -1
- package/esm2015/lib/modules/input-box/input-box.module.js.map +1 -1
- package/esm2015/lib/modules/radio/radio-group.component.js +3 -3
- package/esm2015/lib/modules/radio/radio-group.component.js.map +1 -1
- package/esm2015/lib/modules/radio/radio.component.js +4 -4
- package/esm2015/lib/modules/radio/radio.component.js.map +1 -1
- package/esm2015/lib/modules/radio/radio.module.js +2 -2
- package/esm2015/lib/modules/radio/radio.module.js.map +1 -1
- package/esm2015/lib/modules/selection-box/selection-box-adapter.service.js.map +1 -1
- package/esm2015/lib/modules/selection-box/selection-box-grid.component.js +2 -2
- package/esm2015/lib/modules/selection-box/selection-box-grid.component.js.map +1 -1
- package/esm2015/lib/modules/selection-box/selection-box.component.js.map +1 -1
- package/esm2015/lib/modules/selection-box/selection-box.module.js +1 -1
- package/esm2015/lib/modules/selection-box/selection-box.module.js.map +1 -1
- package/esm2015/lib/modules/shared/sky-forms-resources.module.js +1 -1
- package/esm2015/lib/modules/shared/sky-forms-resources.module.js.map +1 -1
- package/esm2015/lib/modules/toggle-switch/toggle-switch.component.js +3 -2
- package/esm2015/lib/modules/toggle-switch/toggle-switch.component.js.map +1 -1
- package/esm2015/lib/modules/toggle-switch/toggle-switch.module.js +2 -2
- package/esm2015/lib/modules/toggle-switch/toggle-switch.module.js.map +1 -1
- package/esm2015/testing/checkbox-fixture.js.map +1 -1
- package/fesm2015/skyux-forms-testing.js.map +1 -1
- package/fesm2015/skyux-forms.js +129 -126
- package/fesm2015/skyux-forms.js.map +1 -1
- package/lib/modules/checkbox/checkbox.component.d.ts +2 -2
- package/lib/modules/file-attachment/file-attachment.component.d.ts +3 -3
- package/lib/modules/file-attachment/file-drop.component.d.ts +2 -2
- package/lib/modules/file-attachment/file-item.component.d.ts +2 -2
- package/lib/modules/file-attachment/file-size.pipe.d.ts +1 -1
- package/lib/modules/input-box/input-box-host.service.d.ts +1 -1
- package/lib/modules/radio/radio-group.component.d.ts +1 -1
- package/lib/modules/selection-box/selection-box-grid.component.d.ts +1 -1
- package/package.json +15 -12
package/fesm2015/skyux-forms.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as i1 from '@angular/common';
|
|
2
2
|
import { CommonModule, DecimalPipe } from '@angular/common';
|
|
3
|
+
import * as i0 from '@angular/core';
|
|
4
|
+
import { NgModule, Component, ChangeDetectionStrategy, Directive, Input, forwardRef, EventEmitter, Self, Optional, Output, Injectable, ViewChild, ContentChildren, Pipe, ViewEncapsulation, ContentChild, HostListener, ElementRef } from '@angular/core';
|
|
3
5
|
import * as i4 from '@angular/forms';
|
|
4
6
|
import { NG_VALIDATORS, FormsModule, ReactiveFormsModule, CheckboxRequiredValidator, FormControlDirective, FormControlName, NgModel, NG_VALUE_ACCESSOR } from '@angular/forms';
|
|
5
|
-
import * as i0 from '@angular/core';
|
|
6
|
-
import { NgModule, Component, ChangeDetectionStrategy, Directive, Input, EventEmitter, Self, Optional, Output, forwardRef, Injectable, ViewChild, ContentChildren, Pipe, ViewEncapsulation, ContentChild, HostListener, ElementRef } from '@angular/core';
|
|
7
7
|
import * as i2 from '@skyux/i18n';
|
|
8
8
|
import { getLibStringForLocale, SkyI18nModule, SKY_LIB_RESOURCES_PROVIDERS } from '@skyux/i18n';
|
|
9
9
|
import * as i2$1 from '@skyux/indicators';
|
|
@@ -142,6 +142,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
|
|
|
142
142
|
*/
|
|
143
143
|
class SkyCharacterCounterInputDirective {
|
|
144
144
|
constructor() {
|
|
145
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
145
146
|
this._validatorChange = () => { };
|
|
146
147
|
}
|
|
147
148
|
/**
|
|
@@ -257,6 +258,50 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
|
|
|
257
258
|
class SkyCheckboxChange {
|
|
258
259
|
}
|
|
259
260
|
|
|
261
|
+
/**
|
|
262
|
+
* Specifies a label for the checkbox.
|
|
263
|
+
*/
|
|
264
|
+
class SkyCheckboxLabelComponent {
|
|
265
|
+
}
|
|
266
|
+
SkyCheckboxLabelComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyCheckboxLabelComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
267
|
+
SkyCheckboxLabelComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: SkyCheckboxLabelComponent, selector: "sky-checkbox-label", ngImport: i0, template: "<span class=\"sky-switch-label\">\n <ng-content></ng-content>\n</span>\n" });
|
|
268
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyCheckboxLabelComponent, decorators: [{
|
|
269
|
+
type: Component,
|
|
270
|
+
args: [{
|
|
271
|
+
selector: 'sky-checkbox-label',
|
|
272
|
+
templateUrl: './checkbox-label.component.html',
|
|
273
|
+
}]
|
|
274
|
+
}] });
|
|
275
|
+
|
|
276
|
+
// tslint:disable:no-forward-ref
|
|
277
|
+
const SKY_CHECKBOX_REQUIRED_VALIDATOR = {
|
|
278
|
+
provide: NG_VALIDATORS,
|
|
279
|
+
useExisting: forwardRef(() => SkyCheckboxRequiredValidatorDirective),
|
|
280
|
+
multi: true,
|
|
281
|
+
};
|
|
282
|
+
// tslint:enable
|
|
283
|
+
/**
|
|
284
|
+
* Validator support for the `required` input on `sky-checkbox`.
|
|
285
|
+
* Angular's `CheckboxRequiredValidator` only works with `input type=checkbox`. This directive
|
|
286
|
+
* extends the angular validator to work with `sky-checkbox` tags.
|
|
287
|
+
* This is based on Angular Material's similar implementation:
|
|
288
|
+
* https://github.com/angular/components/blob/a415b52ead2ec202ba37edb7d7866b29dd790394/src/material/checkbox/checkbox-required-validator.ts
|
|
289
|
+
* @internal
|
|
290
|
+
*/
|
|
291
|
+
class SkyCheckboxRequiredValidatorDirective extends CheckboxRequiredValidator {
|
|
292
|
+
}
|
|
293
|
+
SkyCheckboxRequiredValidatorDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyCheckboxRequiredValidatorDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive });
|
|
294
|
+
SkyCheckboxRequiredValidatorDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.16", type: SkyCheckboxRequiredValidatorDirective, selector: "sky-checkbox[required][formControlName],\n sky-checkbox[required][formControl], sky-checkbox[required][ngModel]", providers: [SKY_CHECKBOX_REQUIRED_VALIDATOR], usesInheritance: true, ngImport: i0 });
|
|
295
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyCheckboxRequiredValidatorDirective, decorators: [{
|
|
296
|
+
type: Directive,
|
|
297
|
+
args: [{
|
|
298
|
+
// eslint-disable-next-line @angular-eslint/directive-selector
|
|
299
|
+
selector: `sky-checkbox[required][formControlName],
|
|
300
|
+
sky-checkbox[required][formControl], sky-checkbox[required][ngModel]`,
|
|
301
|
+
providers: [SKY_CHECKBOX_REQUIRED_VALIDATOR],
|
|
302
|
+
}]
|
|
303
|
+
}] });
|
|
304
|
+
|
|
260
305
|
// Need to add the following to classes which contain static methods.
|
|
261
306
|
// See: https://github.com/ng-packagr/ng-packagr/issues/641
|
|
262
307
|
// @dynamic
|
|
@@ -320,8 +365,9 @@ class SkyCheckboxComponent {
|
|
|
320
365
|
this._disabledChange = new BehaviorSubject(this._disabled);
|
|
321
366
|
this._required = false;
|
|
322
367
|
/** Called when the checkbox is blurred. Needed to properly implement ControlValueAccessor. */
|
|
323
|
-
|
|
368
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
324
369
|
this.onTouched = () => { };
|
|
370
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
325
371
|
this._controlValueAccessorChangeFn = (value) => { };
|
|
326
372
|
if (this.ngControl) {
|
|
327
373
|
this.ngControl.valueAccessor = this;
|
|
@@ -389,7 +435,7 @@ class SkyCheckboxComponent {
|
|
|
389
435
|
/**
|
|
390
436
|
* Indicates whether the input is required for form validation.
|
|
391
437
|
* When you set this property to `true`, the component adds `aria-required` and `required`
|
|
392
|
-
* attributes to the input element so that forms display an invalid state until the
|
|
438
|
+
* attributes to the input element so that forms display an invalid state until the input element
|
|
393
439
|
* is complete.
|
|
394
440
|
* @default false
|
|
395
441
|
*/
|
|
@@ -460,7 +506,7 @@ class SkyCheckboxComponent {
|
|
|
460
506
|
this.onTouched();
|
|
461
507
|
}
|
|
462
508
|
_emitChangeEvent() {
|
|
463
|
-
|
|
509
|
+
const event = new SkyCheckboxChange();
|
|
464
510
|
event.source = this;
|
|
465
511
|
event.checked = this._checked;
|
|
466
512
|
this._controlValueAccessorChangeFn(this._checked);
|
|
@@ -514,50 +560,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
|
|
|
514
560
|
type: Output
|
|
515
561
|
}] } });
|
|
516
562
|
|
|
517
|
-
/**
|
|
518
|
-
* Specifies a label for the checkbox.
|
|
519
|
-
*/
|
|
520
|
-
class SkyCheckboxLabelComponent {
|
|
521
|
-
}
|
|
522
|
-
SkyCheckboxLabelComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyCheckboxLabelComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
523
|
-
SkyCheckboxLabelComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: SkyCheckboxLabelComponent, selector: "sky-checkbox-label", ngImport: i0, template: "<span class=\"sky-switch-label\">\n <ng-content></ng-content>\n</span>\n" });
|
|
524
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyCheckboxLabelComponent, decorators: [{
|
|
525
|
-
type: Component,
|
|
526
|
-
args: [{
|
|
527
|
-
selector: 'sky-checkbox-label',
|
|
528
|
-
templateUrl: './checkbox-label.component.html',
|
|
529
|
-
}]
|
|
530
|
-
}] });
|
|
531
|
-
|
|
532
|
-
// tslint:disable:no-forward-ref
|
|
533
|
-
const SKY_CHECKBOX_REQUIRED_VALIDATOR = {
|
|
534
|
-
provide: NG_VALIDATORS,
|
|
535
|
-
useExisting: forwardRef(() => SkyCheckboxRequiredValidatorDirective),
|
|
536
|
-
multi: true,
|
|
537
|
-
};
|
|
538
|
-
// tslint:enable
|
|
539
|
-
/**
|
|
540
|
-
* Validator support for the `required` input on `sky-checkbox`.
|
|
541
|
-
* Angular's `CheckboxRequiredValidator` only works with `input type=checkbox`. This directive
|
|
542
|
-
* extends the angular validator to work with `sky-checkbox` tags.
|
|
543
|
-
* This is based on Angular Material's similar implementation:
|
|
544
|
-
* https://github.com/angular/components/blob/a415b52ead2ec202ba37edb7d7866b29dd790394/src/material/checkbox/checkbox-required-validator.ts
|
|
545
|
-
* @internal
|
|
546
|
-
*/
|
|
547
|
-
class SkyCheckboxRequiredValidatorDirective extends CheckboxRequiredValidator {
|
|
548
|
-
}
|
|
549
|
-
SkyCheckboxRequiredValidatorDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyCheckboxRequiredValidatorDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive });
|
|
550
|
-
SkyCheckboxRequiredValidatorDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.16", type: SkyCheckboxRequiredValidatorDirective, selector: "sky-checkbox[required][formControlName],\n sky-checkbox[required][formControl], sky-checkbox[required][ngModel]", providers: [SKY_CHECKBOX_REQUIRED_VALIDATOR], usesInheritance: true, ngImport: i0 });
|
|
551
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyCheckboxRequiredValidatorDirective, decorators: [{
|
|
552
|
-
type: Directive,
|
|
553
|
-
args: [{
|
|
554
|
-
// eslint-disable-next-line @angular-eslint/directive-selector
|
|
555
|
-
selector: `sky-checkbox[required][formControlName],
|
|
556
|
-
sky-checkbox[required][formControl], sky-checkbox[required][ngModel]`,
|
|
557
|
-
providers: [SKY_CHECKBOX_REQUIRED_VALIDATOR],
|
|
558
|
-
}]
|
|
559
|
-
}] });
|
|
560
|
-
|
|
561
563
|
class SkyCheckboxModule {
|
|
562
564
|
}
|
|
563
565
|
SkyCheckboxModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyCheckboxModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
@@ -606,9 +608,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
|
|
|
606
608
|
*/
|
|
607
609
|
class SkyFileAttachmentService {
|
|
608
610
|
checkFiles(files, minFileSize, maxFileSize, acceptedTypes, validateFn) {
|
|
609
|
-
|
|
611
|
+
const fileResults = [];
|
|
610
612
|
for (let index = 0; index < files.length; index++) {
|
|
611
|
-
|
|
613
|
+
const fileItem = {
|
|
612
614
|
file: files.item(index),
|
|
613
615
|
};
|
|
614
616
|
if (fileItem.file.size < minFileSize) {
|
|
@@ -627,8 +629,8 @@ class SkyFileAttachmentService {
|
|
|
627
629
|
fileResults.push(fileItem);
|
|
628
630
|
}
|
|
629
631
|
else if (validateFn) {
|
|
630
|
-
|
|
631
|
-
if (
|
|
632
|
+
const errorParam = validateFn(fileItem);
|
|
633
|
+
if (errorParam) {
|
|
632
634
|
fileItem.errorType = 'validate';
|
|
633
635
|
fileItem.errorParam = errorParam;
|
|
634
636
|
}
|
|
@@ -661,8 +663,8 @@ class SkyFileAttachmentService {
|
|
|
661
663
|
if (!fileType) {
|
|
662
664
|
return true;
|
|
663
665
|
}
|
|
664
|
-
|
|
665
|
-
|
|
666
|
+
const acceptedTypesUpper = acceptedTypes.toUpperCase();
|
|
667
|
+
const typeArray = acceptedTypesUpper.split(',');
|
|
666
668
|
return !this.fileTypeInArray(typeArray, fileType.toUpperCase());
|
|
667
669
|
}
|
|
668
670
|
fileTypeInArray(typeArray, fileType) {
|
|
@@ -698,7 +700,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
|
|
|
698
700
|
*/
|
|
699
701
|
class SkyFileItemService {
|
|
700
702
|
isFile(fileItem) {
|
|
701
|
-
|
|
703
|
+
const file = fileItem.file;
|
|
702
704
|
/* tslint:disable */
|
|
703
705
|
return (file &&
|
|
704
706
|
file !== undefined &&
|
|
@@ -708,8 +710,8 @@ class SkyFileItemService {
|
|
|
708
710
|
/* tslint:enable */
|
|
709
711
|
}
|
|
710
712
|
isImage(fileItem) {
|
|
711
|
-
|
|
712
|
-
slashIndex = fileTypeUpper.indexOf('/');
|
|
713
|
+
const fileTypeUpper = this.getFileTypeUpper(fileItem);
|
|
714
|
+
const slashIndex = fileTypeUpper.indexOf('/');
|
|
713
715
|
if (slashIndex >= 0) {
|
|
714
716
|
switch (fileTypeUpper.substr(fileTypeUpper.indexOf('/') + 1)) {
|
|
715
717
|
case 'BMP':
|
|
@@ -728,7 +730,7 @@ class SkyFileItemService {
|
|
|
728
730
|
/* istanbul ignore else */
|
|
729
731
|
/* sanity check */
|
|
730
732
|
if (fileItem) {
|
|
731
|
-
|
|
733
|
+
const file = fileItem.file;
|
|
732
734
|
if (file) {
|
|
733
735
|
/* istanbul ignore next */
|
|
734
736
|
name = file.name || '';
|
|
@@ -746,7 +748,7 @@ class SkyFileItemService {
|
|
|
746
748
|
/* istanbul ignore else */
|
|
747
749
|
/* sanity check */
|
|
748
750
|
if (fileItem) {
|
|
749
|
-
|
|
751
|
+
const file = fileItem.file;
|
|
750
752
|
if (file) {
|
|
751
753
|
fileType = file.type || '';
|
|
752
754
|
}
|
|
@@ -796,16 +798,16 @@ class SkyFileAttachmentComponent {
|
|
|
796
798
|
/**
|
|
797
799
|
* Indicates whether the input is required for form validation.
|
|
798
800
|
* When you set this property to `true`, the component adds `aria-required` and `required`
|
|
799
|
-
* attributes to the input element so that forms display an invalid state until the
|
|
801
|
+
* attributes to the input element so that forms display an invalid state until the input element
|
|
800
802
|
* is complete.
|
|
801
803
|
*/
|
|
802
804
|
this.required = false;
|
|
803
805
|
this.fileAttachmentId = uniqueId$1++;
|
|
804
806
|
this.ngUnsubscribe = new Subject();
|
|
805
807
|
this._disabled = false;
|
|
806
|
-
|
|
808
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
807
809
|
this._onChange = (_) => { };
|
|
808
|
-
|
|
810
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
809
811
|
this._onTouched = () => { };
|
|
810
812
|
this.labelElementId = `sky-file-attachment-label-${this.fileAttachmentId}`;
|
|
811
813
|
this.fileDropDescriptionElementId = `sky-file-attachment-drop-description-${this.fileAttachmentId}`;
|
|
@@ -955,7 +957,7 @@ class SkyFileAttachmentComponent {
|
|
|
955
957
|
getFileName(truncate = true) {
|
|
956
958
|
if (this.value) {
|
|
957
959
|
// tslint:disable-next-line: max-line-length
|
|
958
|
-
|
|
960
|
+
const dropName = this.fileItemService.isFile(this.value) && this.value.file.name
|
|
959
961
|
? this.value.file.name
|
|
960
962
|
: this.value.url;
|
|
961
963
|
if (truncate && dropName.length > 26) {
|
|
@@ -1023,8 +1025,8 @@ class SkyFileAttachmentComponent {
|
|
|
1023
1025
|
}
|
|
1024
1026
|
handleFiles(files) {
|
|
1025
1027
|
// tslint:disable-next-line: max-line-length
|
|
1026
|
-
|
|
1027
|
-
for (
|
|
1028
|
+
const processedFiles = this.fileAttachmentService.checkFiles(files, this.minFileSize, this.maxFileSize, this.acceptedTypes, this.validateFn);
|
|
1029
|
+
for (const file of processedFiles) {
|
|
1028
1030
|
if (file.errorType) {
|
|
1029
1031
|
this.emitFileChangeEvent(file);
|
|
1030
1032
|
}
|
|
@@ -1237,18 +1239,17 @@ class SkyFileDropComponent {
|
|
|
1237
1239
|
reader.readAsDataURL(file.file);
|
|
1238
1240
|
}
|
|
1239
1241
|
handleFiles(files) {
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
let fileDrop = this;
|
|
1242
|
+
const validFileArray = [];
|
|
1243
|
+
const rejectedFileArray = [];
|
|
1244
|
+
const totalFiles = files.length;
|
|
1244
1245
|
// tslint:disable-next-line: max-line-length
|
|
1245
|
-
|
|
1246
|
-
for (
|
|
1246
|
+
const processedFiles = this.fileAttachmentService.checkFiles(files, this.minFileSize, this.maxFileSize, this.acceptedTypes, this.validateFn);
|
|
1247
|
+
for (const file of processedFiles) {
|
|
1247
1248
|
if (file.errorType) {
|
|
1248
1249
|
this.filesRejected(file, validFileArray, rejectedFileArray, totalFiles);
|
|
1249
1250
|
}
|
|
1250
1251
|
else {
|
|
1251
|
-
this.loadFile(
|
|
1252
|
+
this.loadFile(this, file, validFileArray, rejectedFileArray, totalFiles);
|
|
1252
1253
|
}
|
|
1253
1254
|
}
|
|
1254
1255
|
}
|
|
@@ -1301,7 +1302,7 @@ class SkyFileSizePipe {
|
|
|
1301
1302
|
this.resourcesService = resourcesService;
|
|
1302
1303
|
}
|
|
1303
1304
|
transform(input) {
|
|
1304
|
-
let decimalPlaces = 0, dividend = 1,
|
|
1305
|
+
let decimalPlaces = 0, dividend = 1, template;
|
|
1305
1306
|
/* tslint:disable */
|
|
1306
1307
|
if (input === null || input === undefined) {
|
|
1307
1308
|
return '';
|
|
@@ -1327,10 +1328,9 @@ class SkyFileSizePipe {
|
|
|
1327
1328
|
dividend = 1e9;
|
|
1328
1329
|
decimalPlaces = 1;
|
|
1329
1330
|
}
|
|
1330
|
-
roundedSize =
|
|
1331
|
-
Math.
|
|
1332
|
-
|
|
1333
|
-
formattedSize = this.decimalPipe.transform(roundedSize, '.0-3');
|
|
1331
|
+
const roundedSize = Math.floor(input / (dividend / Math.pow(10, decimalPlaces))) /
|
|
1332
|
+
Math.pow(10, decimalPlaces);
|
|
1333
|
+
const formattedSize = this.decimalPipe.transform(roundedSize, '.0-3');
|
|
1334
1334
|
return this.getString(template, formattedSize);
|
|
1335
1335
|
}
|
|
1336
1336
|
getString(key, ...args) {
|
|
@@ -1368,9 +1368,11 @@ class SkyFileItemComponent {
|
|
|
1368
1368
|
return this.fileItem.url;
|
|
1369
1369
|
}
|
|
1370
1370
|
ngDoCheck() {
|
|
1371
|
-
|
|
1371
|
+
const changes = this.differ.diff(this.fileItem);
|
|
1372
1372
|
if (changes) {
|
|
1373
|
-
let cls
|
|
1373
|
+
let cls;
|
|
1374
|
+
const extensionUpper = this.fileItemService.getFileExtensionUpper(this.fileItem);
|
|
1375
|
+
let fileTypeUpper;
|
|
1374
1376
|
switch (extensionUpper) {
|
|
1375
1377
|
case '.PDF':
|
|
1376
1378
|
cls = 'pdf';
|
|
@@ -1696,11 +1698,11 @@ class SkyRadioComponent {
|
|
|
1696
1698
|
this._checkedChange = new BehaviorSubject(this._checked);
|
|
1697
1699
|
this._disabled = false;
|
|
1698
1700
|
this._disabledChange = new BehaviorSubject(this._disabled);
|
|
1699
|
-
|
|
1701
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
1700
1702
|
this.removeUniqueSelectionListener = () => { };
|
|
1701
|
-
|
|
1703
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
1702
1704
|
this.onChangeCallback = (value) => { };
|
|
1703
|
-
|
|
1705
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
1704
1706
|
this.onTouchedCallback = () => { };
|
|
1705
1707
|
}
|
|
1706
1708
|
/**
|
|
@@ -1914,30 +1916,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
|
|
|
1914
1916
|
type: Output
|
|
1915
1917
|
}] } });
|
|
1916
1918
|
|
|
1917
|
-
/**
|
|
1918
|
-
* Specifies a label for the radio button.
|
|
1919
|
-
*/
|
|
1920
|
-
class SkyRadioLabelComponent {
|
|
1921
|
-
// When clicking on a checkbox label, Angular registers two click events.
|
|
1922
|
-
// This handler ignores all events except for those that deal
|
|
1923
|
-
// with the checkbox input explicitly.
|
|
1924
|
-
onClick(event) {
|
|
1925
|
-
event.stopPropagation();
|
|
1926
|
-
}
|
|
1927
|
-
}
|
|
1928
|
-
SkyRadioLabelComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyRadioLabelComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1929
|
-
SkyRadioLabelComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: SkyRadioLabelComponent, selector: "sky-radio-label", host: { listeners: { "click": "onClick($event)" } }, ngImport: i0, template: "<span class=\"sky-switch-label\">\n <ng-content></ng-content>\n</span>\n" });
|
|
1930
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyRadioLabelComponent, decorators: [{
|
|
1931
|
-
type: Component,
|
|
1932
|
-
args: [{
|
|
1933
|
-
selector: 'sky-radio-label',
|
|
1934
|
-
templateUrl: './radio-label.component.html',
|
|
1935
|
-
}]
|
|
1936
|
-
}], propDecorators: { onClick: [{
|
|
1937
|
-
type: HostListener,
|
|
1938
|
-
args: ['click', ['$event']]
|
|
1939
|
-
}] } });
|
|
1940
|
-
|
|
1941
1919
|
let nextUniqueId = 0;
|
|
1942
1920
|
/**
|
|
1943
1921
|
* Organizes radio buttons into a group. It is required for radio
|
|
@@ -1952,7 +1930,7 @@ class SkyRadioGroupComponent {
|
|
|
1952
1930
|
/**
|
|
1953
1931
|
* Indicates whether the input is required for form validation.
|
|
1954
1932
|
* When you set this property to `true`, the component adds `aria-required` and `required`
|
|
1955
|
-
* attributes to the input element so that forms display an invalid state until the
|
|
1933
|
+
* attributes to the input element so that forms display an invalid state until the input element
|
|
1956
1934
|
* is complete.
|
|
1957
1935
|
* @default false
|
|
1958
1936
|
*/
|
|
@@ -1960,9 +1938,9 @@ class SkyRadioGroupComponent {
|
|
|
1960
1938
|
this.ngUnsubscribe = new Subject();
|
|
1961
1939
|
this._disabled = false;
|
|
1962
1940
|
this._name = `sky-radio-group-${nextUniqueId++}`;
|
|
1963
|
-
|
|
1941
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
1964
1942
|
this.onChange = () => { };
|
|
1965
|
-
|
|
1943
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
1966
1944
|
this.onTouched = () => { };
|
|
1967
1945
|
if (this.ngControl) {
|
|
1968
1946
|
this.ngControl.valueAccessor = this;
|
|
@@ -2153,6 +2131,30 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
|
|
|
2153
2131
|
args: [SkyRadioComponent, { descendants: true }]
|
|
2154
2132
|
}] } });
|
|
2155
2133
|
|
|
2134
|
+
/**
|
|
2135
|
+
* Specifies a label for the radio button.
|
|
2136
|
+
*/
|
|
2137
|
+
class SkyRadioLabelComponent {
|
|
2138
|
+
// When clicking on a checkbox label, Angular registers two click events.
|
|
2139
|
+
// This handler ignores all events except for those that deal
|
|
2140
|
+
// with the checkbox input explicitly.
|
|
2141
|
+
onClick(event) {
|
|
2142
|
+
event.stopPropagation();
|
|
2143
|
+
}
|
|
2144
|
+
}
|
|
2145
|
+
SkyRadioLabelComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyRadioLabelComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2146
|
+
SkyRadioLabelComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: SkyRadioLabelComponent, selector: "sky-radio-label", host: { listeners: { "click": "onClick($event)" } }, ngImport: i0, template: "<span class=\"sky-switch-label\">\n <ng-content></ng-content>\n</span>\n" });
|
|
2147
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyRadioLabelComponent, decorators: [{
|
|
2148
|
+
type: Component,
|
|
2149
|
+
args: [{
|
|
2150
|
+
selector: 'sky-radio-label',
|
|
2151
|
+
templateUrl: './radio-label.component.html',
|
|
2152
|
+
}]
|
|
2153
|
+
}], propDecorators: { onClick: [{
|
|
2154
|
+
type: HostListener,
|
|
2155
|
+
args: ['click', ['$event']]
|
|
2156
|
+
}] } });
|
|
2157
|
+
|
|
2156
2158
|
class SkyRadioModule {
|
|
2157
2159
|
}
|
|
2158
2160
|
SkyRadioModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyRadioModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
@@ -2308,21 +2310,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
|
|
|
2308
2310
|
}]
|
|
2309
2311
|
}] });
|
|
2310
2312
|
|
|
2311
|
-
/**
|
|
2312
|
-
* Specifies the header to display in a selection box.
|
|
2313
|
-
*/
|
|
2314
|
-
class SkySelectionBoxHeaderComponent {
|
|
2315
|
-
}
|
|
2316
|
-
SkySelectionBoxHeaderComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkySelectionBoxHeaderComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2317
|
-
SkySelectionBoxHeaderComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: SkySelectionBoxHeaderComponent, selector: "sky-selection-box-header", ngImport: i0, template: "<ng-content></ng-content>\n" });
|
|
2318
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkySelectionBoxHeaderComponent, decorators: [{
|
|
2319
|
-
type: Component,
|
|
2320
|
-
args: [{
|
|
2321
|
-
selector: 'sky-selection-box-header',
|
|
2322
|
-
templateUrl: './selection-box-header.component.html',
|
|
2323
|
-
}]
|
|
2324
|
-
}] });
|
|
2325
|
-
|
|
2326
2313
|
/**
|
|
2327
2314
|
* Creates a button to present users with a choice or question before proceeding with a one-time process.
|
|
2328
2315
|
*/
|
|
@@ -2542,6 +2529,21 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
|
|
|
2542
2529
|
args: ['window:resize']
|
|
2543
2530
|
}] } });
|
|
2544
2531
|
|
|
2532
|
+
/**
|
|
2533
|
+
* Specifies the header to display in a selection box.
|
|
2534
|
+
*/
|
|
2535
|
+
class SkySelectionBoxHeaderComponent {
|
|
2536
|
+
}
|
|
2537
|
+
SkySelectionBoxHeaderComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkySelectionBoxHeaderComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2538
|
+
SkySelectionBoxHeaderComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: SkySelectionBoxHeaderComponent, selector: "sky-selection-box-header", ngImport: i0, template: "<ng-content></ng-content>\n" });
|
|
2539
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkySelectionBoxHeaderComponent, decorators: [{
|
|
2540
|
+
type: Component,
|
|
2541
|
+
args: [{
|
|
2542
|
+
selector: 'sky-selection-box-header',
|
|
2543
|
+
templateUrl: './selection-box-header.component.html',
|
|
2544
|
+
}]
|
|
2545
|
+
}] });
|
|
2546
|
+
|
|
2545
2547
|
class SkySelectionBoxModule {
|
|
2546
2548
|
}
|
|
2547
2549
|
SkySelectionBoxModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkySelectionBoxModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
@@ -2623,8 +2625,9 @@ class SkyToggleSwitchComponent {
|
|
|
2623
2625
|
this.ngUnsubscribe = new Subject();
|
|
2624
2626
|
this.toggleSwitchId = uniqueId++;
|
|
2625
2627
|
this._checked = false;
|
|
2626
|
-
|
|
2628
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
2627
2629
|
this.onTouched = () => { };
|
|
2630
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
2628
2631
|
this.onChange = () => { };
|
|
2629
2632
|
}
|
|
2630
2633
|
/**
|