@skyux/forms 5.6.0 → 5.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundles/skyux-forms.umd.js +13 -13
- package/documentation.json +4 -4
- package/esm2015/lib/modules/checkbox/checkbox.component.js +1 -1
- package/esm2015/lib/modules/checkbox/checkbox.component.js.map +1 -1
- package/esm2015/lib/modules/file-attachment/file-attachment.component.js +1 -1
- package/esm2015/lib/modules/file-attachment/file-attachment.component.js.map +1 -1
- package/esm2015/lib/modules/file-attachment/file-drop.component.js +1 -2
- package/esm2015/lib/modules/file-attachment/file-drop.component.js.map +1 -1
- package/esm2015/lib/modules/file-attachment/file-item.component.js +3 -1
- package/esm2015/lib/modules/file-attachment/file-item.component.js.map +1 -1
- package/esm2015/lib/modules/file-attachment/file-item.service.js +2 -2
- package/esm2015/lib/modules/file-attachment/file-item.service.js.map +1 -1
- package/esm2015/lib/modules/file-attachment/file-size.pipe.js +4 -5
- package/esm2015/lib/modules/file-attachment/file-size.pipe.js.map +1 -1
- package/esm2015/lib/modules/radio/radio-group.component.js +1 -1
- package/esm2015/lib/modules/radio/radio-group.component.js.map +1 -1
- package/fesm2015/skyux-forms.js +13 -13
- package/fesm2015/skyux-forms.js.map +1 -1
- package/lib/modules/checkbox/checkbox.component.d.ts +1 -1
- package/lib/modules/file-attachment/file-attachment.component.d.ts +1 -1
- package/lib/modules/radio/radio-group.component.d.ts +1 -1
- package/package.json +15 -12
|
@@ -20,7 +20,7 @@ export class SkyRadioGroupComponent {
|
|
|
20
20
|
/**
|
|
21
21
|
* Indicates whether the input is required for form validation.
|
|
22
22
|
* When you set this property to `true`, the component adds `aria-required` and `required`
|
|
23
|
-
* attributes to the input element so that forms display an invalid state until the
|
|
23
|
+
* attributes to the input element so that forms display an invalid state until the input element
|
|
24
24
|
* is complete.
|
|
25
25
|
* @default false
|
|
26
26
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"radio-group.component.js","sourceRoot":"","sources":["../../../../../../../../libs/components/forms/src/lib/modules/radio/radio-group.component.ts","../../../../../../../../libs/components/forms/src/lib/modules/radio/radio-group.component.html"],"names":[],"mappings":"AAAA,OAAO,EAGL,iBAAiB,EACjB,SAAS,EACT,eAAe,EACf,KAAK,EAEL,QAAQ,EACR,SAAS,EACT,IAAI,GACL,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE3C,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAC/B,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE3C,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAE1D,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;;;AAGtD,IAAI,YAAY,GAAG,CAAC,CAAC;AAErB;;;;;GAKG;AAKH,MAAM,OAAO,sBAAsB;IAkHjC,YACU,cAAiC,EACb,SAAoB;QADxC,mBAAc,GAAd,cAAc,CAAmB;QACb,cAAS,GAAT,SAAS,CAAW;QA/DlD;;;;;;WAMG;QAEI,aAAQ,GAAG,KAAK,CAAC;QA2ChB,kBAAa,GAAG,IAAI,OAAO,EAAE,CAAC;QAE9B,cAAS,GAAG,KAAK,CAAC;QAElB,UAAK,GAAG,mBAAmB,YAAY,EAAE,EAAE,CAAC;QAsFpD,0BAA0B;QAClB,aAAQ,GAAyB,GAAG,EAAE,GAAE,CAAC,CAAC;QAClD,0BAA0B;QAClB,cAAS,GAAc,GAAG,EAAE,GAAE,CAAC,CAAC;QA/EtC,IAAI,IAAI,CAAC,SAAS,EAAE;YAClB,IAAI,CAAC,SAAS,CAAC,aAAa,GAAG,IAAI,CAAC;SACrC;IACH,CAAC;IApGD;;;OAGG;IACH,IACW,QAAQ,CAAC,KAAc;QAChC,MAAM,gBAAgB,GAAG,eAAe,CAAC,qBAAqB,CAAC,KAAK,CAAC,CAAC;QACtE,IAAI,IAAI,CA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CAAC;QAC9C,CAAC,CAAC,CAAC;IACL,CAAC;IAEO,iBAAiB;QACvB,IAAI,CAAC,2BAA2B,EAAE,CAAC;QACnC,IAAI,CAAC,sBAAsB,EAAE,CAAC;QAC9B,IAAI,CAAC,2BAA2B,EAAE,CAAC;IACrC,CAAC;;oHA7OU,sBAAsB;wGAAtB,sBAAsB,oPAqGhB,iBAAiB,gDCvIpC,mRAUA;4FDwBa,sBAAsB;kBAJlC,SAAS;mBAAC;oBACT,QAAQ,EAAE,iBAAiB;oBAC3B,WAAW,EAAE,8BAA8B;iBAC5C;;0BAqHI,IAAI;;0BAAI,QAAQ;4CA1GZ,cAAc;sBADpB,KAAK;gBAUC,SAAS;sBADf,KAAK;gBAQK,QAAQ;sBADlB,KAAK;gBAoBK,IAAI;sBADd,KAAK;gBAiBC,QAAQ;sBADd,KAAK;gBASK,KAAK;sBADf,KAAK;gBAuBK,QAAQ;sBADlB,KAAK;gBAYE,MAAM;sBADb,eAAe;uBAAC,iBAAiB,EAAE,EAAE,WAAW,EAAE,IAAI,EAAE","sourcesContent":["import {\n AfterContentInit,\n AfterViewInit,\n ChangeDetectorRef,\n Component,\n ContentChildren,\n Input,\n OnDestroy,\n Optional,\n QueryList,\n Self,\n} from '@angular/core';\nimport { NgControl } from '@angular/forms';\n\nimport { Subject } from 'rxjs';\nimport { takeUntil } from 'rxjs/operators';\n\nimport { SkyFormsUtility } from '../shared/forms-utility';\n\nimport { SkyRadioComponent } from './radio.component';\nimport { SkyRadioChange } from './types/radio-change';\n\nlet nextUniqueId = 0;\n\n/**\n * Organizes radio buttons into a group. It is required for radio\n * buttons on Angular reactive forms, and we recommend using it with all radio buttons.\n * On Angular forms, the component manages the selected values and keeps the forms up-to-date.\n * When users select a radio button, its value is driven through an `ngModel` attribute that you specify on the `sky-radio-group` element.\n */\n@Component({\n selector: 'sky-radio-group',\n templateUrl: './radio-group.component.html',\n})\nexport class SkyRadioGroupComponent\n implements AfterContentInit, AfterViewInit, OnDestroy\n{\n /**\n * Specifies the HTML element ID (without the leading `#`) of the element that labels\n * the radio button group. This sets the radio button group's `aria-labelledby` attribute\n * [to support accessibility](https://developer.blackbaud.com/skyux/learn/accessibility).\n * If the radio button group does not include a visible label, use `ariaLabel` instead.\n */\n @Input()\n public ariaLabelledBy: string;\n\n /**\n * Specifies an ARIA label for the radio button group. This sets the\n * radio button group's `aria-label` attribute\n * [to support accessibility](https://developer.blackbaud.com/skyux/learn/accessibility).\n * If the radio button group includes a visible label, use `ariaLabelledBy` instead.\n */\n @Input()\n public ariaLabel: string;\n\n /**\n * Indicates whether to disable the input.\n * @default false\n */\n @Input()\n public set disabled(value: boolean) {\n const newDisabledState = SkyFormsUtility.coerceBooleanProperty(value);\n if (this._disabled !== newDisabledState) {\n this._disabled = newDisabledState;\n this.updateRadioButtonDisabled();\n }\n }\n\n public get disabled(): boolean {\n return this._disabled;\n }\n\n /**\n * Specifies a name for the collection of radio buttons that the component groups together.\n * This property overwrites the deprecated `name` property on individual `sky-radio` elements,\n * and it is required unless the `name` property is set on individual `sky-radio` elements.\n * @required\n */\n @Input()\n public set name(value: string) {\n this._name = value;\n this.updateRadioButtonNames();\n }\n public get name(): string {\n return this._name;\n }\n\n /**\n * Indicates whether the input is required for form validation.\n * When you set this property to `true`, the component adds `aria-required` and `required`\n * attributes to the input element so that forms display an invalid state until the input element\n * is complete.\n * @default false\n */\n @Input()\n public required = false;\n\n /**\n * Specifies the value of the radio button to select by default when the group loads.\n * The value corresponds to the `value` property of an individual `sky-radio` element within the\n * group.\n */\n @Input()\n public set value(value: any) {\n const isNewValue = value !== this._value;\n\n /* istanbul ignore else */\n if (isNewValue) {\n this._value = value;\n this.onChange(this._value);\n this.updateCheckedRadioFromValue();\n }\n }\n public get value(): any {\n return this._value;\n }\n\n /**\n * Specifies an index for all the radio buttons in the group. If the index is not defined,\n * the indices for individual radio buttons are set to their positions on load.\n * This property supports accessibility by placing focus on the currently selected radio\n * button. If no radio button is selected, it places focus on the first or last button\n * depending on how users navigate to the radio button group.\n */\n @Input()\n public set tabIndex(value: number) {\n if (this._tabIndex !== value) {\n this._tabIndex = value;\n this.updateRadioButtonTabIndexes();\n }\n }\n public get tabIndex(): number {\n return this._tabIndex;\n }\n\n @ContentChildren(SkyRadioComponent, { descendants: true })\n private radios: QueryList<SkyRadioComponent>;\n\n private ngUnsubscribe = new Subject();\n\n private _disabled = false;\n\n private _name = `sky-radio-group-${nextUniqueId++}`;\n\n private _tabIndex: number;\n\n private _value: any;\n\n constructor(\n private changeDetector: ChangeDetectorRef,\n @Self() @Optional() private ngControl: NgControl\n ) {\n if (this.ngControl) {\n this.ngControl.valueAccessor = this;\n }\n }\n\n public ngAfterContentInit(): void {\n // Let child radio components render before updating.\n setTimeout(() => {\n this.resetRadioButtons();\n });\n\n // Watch for radio selections.\n this.watchForSelections();\n\n this.radios.changes.pipe(takeUntil(this.ngUnsubscribe)).subscribe(() => {\n // Wait for child radio components to finish any rendering updates.\n setTimeout(() => {\n this.resetRadioButtons();\n });\n\n // Subscribe to the new radio buttons\n this.watchForSelections();\n });\n }\n\n public ngAfterViewInit(): void {\n if (this.ngControl) {\n // Backwards compatibility support for anyone still using Validators.Required.\n this.required =\n this.required || SkyFormsUtility.hasRequiredValidation(this.ngControl);\n\n // Avoid an ExpressionChangedAfterItHasBeenCheckedError.\n this.changeDetector.detectChanges();\n }\n }\n\n public watchForSelections() {\n this.radios.forEach((radio) => {\n radio.change\n .pipe(takeUntil(this.ngUnsubscribe))\n .subscribe((change: SkyRadioChange) => {\n this.onTouched();\n this.writeValue(change.value);\n });\n radio.blur.pipe(takeUntil(this.ngUnsubscribe)).subscribe(() => {\n this.onTouched();\n this.changeDetector.markForCheck();\n });\n });\n }\n\n public ngOnDestroy() {\n this.ngUnsubscribe.next();\n this.ngUnsubscribe.complete();\n }\n\n public writeValue(value: any): void {\n this.value = value;\n }\n\n /**\n * @internal\n * Indicates whether to disable the control. Implemented as a part of ControlValueAccessor.\n */\n public setDisabledState(isDisabled: boolean) {\n this.disabled = isDisabled;\n }\n\n public registerOnChange(fn: (value: any) => void): void {\n this.onChange = fn;\n }\n\n public registerOnTouched(fn: any): void {\n this.onTouched = fn;\n }\n\n /* istanbul ignore next */\n private onChange: (value: any) => void = () => {};\n /* istanbul ignore next */\n private onTouched: () => any = () => {};\n\n private updateRadioButtonDisabled(): void {\n if (this.radios) {\n this.radios.forEach((radio) => {\n radio.disabled = this.disabled;\n });\n }\n }\n\n private updateRadioButtonNames(): void {\n if (this.radios) {\n this.radios.forEach((radio) => {\n radio.name = this.name;\n });\n }\n }\n\n private updateRadioButtonTabIndexes(): void {\n if (this.radios) {\n this.radios.forEach((radio) => {\n radio.groupTabIndex = this.tabIndex;\n });\n }\n }\n\n private updateCheckedRadioFromValue(): void {\n if (!this.radios) {\n return;\n }\n\n this.radios.forEach((radio) => {\n radio.checked = this._value === radio.value;\n });\n }\n\n private resetRadioButtons(): void {\n this.updateCheckedRadioFromValue();\n this.updateRadioButtonNames();\n this.updateRadioButtonTabIndexes();\n }\n}\n","<div\n class=\"sky-radio-group\"\n role=\"radiogroup\"\n [attr.aria-label]=\"ariaLabel\"\n [attr.aria-labelledby]=\"ariaLabelledBy\"\n [attr.aria-required]=\"required ? true : null\"\n [attr.required]=\"required ? '' : null\"\n>\n <ng-content></ng-content>\n</div>\n"]}
|
|
1
|
+
{"version":3,"file":"radio-group.component.js","sourceRoot":"","sources":["../../../../../../../../libs/components/forms/src/lib/modules/radio/radio-group.component.ts","../../../../../../../../libs/components/forms/src/lib/modules/radio/radio-group.component.html"],"names":[],"mappings":"AAAA,OAAO,EAGL,iBAAiB,EACjB,SAAS,EACT,eAAe,EACf,KAAK,EAEL,QAAQ,EACR,SAAS,EACT,IAAI,GACL,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE3C,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAC/B,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,C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CA1GZ,cAAc;sBADpB,KAAK;gBAUC,SAAS;sBADf,KAAK;gBAQK,QAAQ;sBADlB,KAAK;gBAoBK,IAAI;sBADd,KAAK;gBAiBC,QAAQ;sBADd,KAAK;gBASK,KAAK;sBADf,KAAK;gBAuBK,QAAQ;sBADlB,KAAK;gBAYE,MAAM;sBADb,eAAe;uBAAC,iBAAiB,EAAE,EAAE,WAAW,EAAE,IAAI,EAAE","sourcesContent":["import {\n AfterContentInit,\n AfterViewInit,\n ChangeDetectorRef,\n Component,\n ContentChildren,\n Input,\n OnDestroy,\n Optional,\n QueryList,\n Self,\n} from '@angular/core';\nimport { NgControl } from '@angular/forms';\n\nimport { Subject } from 'rxjs';\nimport { takeUntil } from 'rxjs/operators';\n\nimport { SkyFormsUtility } from '../shared/forms-utility';\n\nimport { SkyRadioComponent } from './radio.component';\nimport { SkyRadioChange } from './types/radio-change';\n\nlet nextUniqueId = 0;\n\n/**\n * Organizes radio buttons into a group. It is required for radio\n * buttons on Angular reactive forms, and we recommend using it with all radio buttons.\n * On Angular forms, the component manages the selected values and keeps the forms up-to-date.\n * When users select a radio button, its value is driven through an `ngModel` attribute that you specify on the `sky-radio-group` element.\n */\n@Component({\n selector: 'sky-radio-group',\n templateUrl: './radio-group.component.html',\n})\nexport class SkyRadioGroupComponent\n implements AfterContentInit, AfterViewInit, OnDestroy\n{\n /**\n * Specifies the HTML element ID (without the leading `#`) of the element that labels\n * the radio button group. This sets the radio button group's `aria-labelledby` attribute\n * [to support accessibility](https://developer.blackbaud.com/skyux/learn/accessibility).\n * If the radio button group does not include a visible label, use `ariaLabel` instead.\n */\n @Input()\n public ariaLabelledBy: string;\n\n /**\n * Specifies an ARIA label for the radio button group. This sets the\n * radio button group's `aria-label` attribute\n * [to support accessibility](https://developer.blackbaud.com/skyux/learn/accessibility).\n * If the radio button group includes a visible label, use `ariaLabelledBy` instead.\n */\n @Input()\n public ariaLabel: string;\n\n /**\n * Indicates whether to disable the input.\n * @default false\n */\n @Input()\n public set disabled(value: boolean) {\n const newDisabledState = SkyFormsUtility.coerceBooleanProperty(value);\n if (this._disabled !== newDisabledState) {\n this._disabled = newDisabledState;\n this.updateRadioButtonDisabled();\n }\n }\n\n public get disabled(): boolean {\n return this._disabled;\n }\n\n /**\n * Specifies a name for the collection of radio buttons that the component groups together.\n * This property overwrites the deprecated `name` property on individual `sky-radio` elements,\n * and it is required unless the `name` property is set on individual `sky-radio` elements.\n * @required\n */\n @Input()\n public set name(value: string) {\n this._name = value;\n this.updateRadioButtonNames();\n }\n public get name(): string {\n return this._name;\n }\n\n /**\n * Indicates whether the input is required for form validation.\n * When you set this property to `true`, the component adds `aria-required` and `required`\n * attributes to the input element so that forms display an invalid state until the input element\n * is complete.\n * @default false\n */\n @Input()\n public required = false;\n\n /**\n * Specifies the value of the radio button to select by default when the group loads.\n * The value corresponds to the `value` property of an individual `sky-radio` element within the\n * group.\n */\n @Input()\n public set value(value: any) {\n const isNewValue = value !== this._value;\n\n /* istanbul ignore else */\n if (isNewValue) {\n this._value = value;\n this.onChange(this._value);\n this.updateCheckedRadioFromValue();\n }\n }\n public get value(): any {\n return this._value;\n }\n\n /**\n * Specifies an index for all the radio buttons in the group. If the index is not defined,\n * the indices for individual radio buttons are set to their positions on load.\n * This property supports accessibility by placing focus on the currently selected radio\n * button. If no radio button is selected, it places focus on the first or last button\n * depending on how users navigate to the radio button group.\n */\n @Input()\n public set tabIndex(value: number) {\n if (this._tabIndex !== value) {\n this._tabIndex = value;\n this.updateRadioButtonTabIndexes();\n }\n }\n public get tabIndex(): number {\n return this._tabIndex;\n }\n\n @ContentChildren(SkyRadioComponent, { descendants: true })\n private radios: QueryList<SkyRadioComponent>;\n\n private ngUnsubscribe = new Subject();\n\n private _disabled = false;\n\n private _name = `sky-radio-group-${nextUniqueId++}`;\n\n private _tabIndex: number;\n\n private _value: any;\n\n constructor(\n private changeDetector: ChangeDetectorRef,\n @Self() @Optional() private ngControl: NgControl\n ) {\n if (this.ngControl) {\n this.ngControl.valueAccessor = this;\n }\n }\n\n public ngAfterContentInit(): void {\n // Let child radio components render before updating.\n setTimeout(() => {\n this.resetRadioButtons();\n });\n\n // Watch for radio selections.\n this.watchForSelections();\n\n this.radios.changes.pipe(takeUntil(this.ngUnsubscribe)).subscribe(() => {\n // Wait for child radio components to finish any rendering updates.\n setTimeout(() => {\n this.resetRadioButtons();\n });\n\n // Subscribe to the new radio buttons\n this.watchForSelections();\n });\n }\n\n public ngAfterViewInit(): void {\n if (this.ngControl) {\n // Backwards compatibility support for anyone still using Validators.Required.\n this.required =\n this.required || SkyFormsUtility.hasRequiredValidation(this.ngControl);\n\n // Avoid an ExpressionChangedAfterItHasBeenCheckedError.\n this.changeDetector.detectChanges();\n }\n }\n\n public watchForSelections() {\n this.radios.forEach((radio) => {\n radio.change\n .pipe(takeUntil(this.ngUnsubscribe))\n .subscribe((change: SkyRadioChange) => {\n this.onTouched();\n this.writeValue(change.value);\n });\n radio.blur.pipe(takeUntil(this.ngUnsubscribe)).subscribe(() => {\n this.onTouched();\n this.changeDetector.markForCheck();\n });\n });\n }\n\n public ngOnDestroy() {\n this.ngUnsubscribe.next();\n this.ngUnsubscribe.complete();\n }\n\n public writeValue(value: any): void {\n this.value = value;\n }\n\n /**\n * @internal\n * Indicates whether to disable the control. Implemented as a part of ControlValueAccessor.\n */\n public setDisabledState(isDisabled: boolean) {\n this.disabled = isDisabled;\n }\n\n public registerOnChange(fn: (value: any) => void): void {\n this.onChange = fn;\n }\n\n public registerOnTouched(fn: any): void {\n this.onTouched = fn;\n }\n\n /* istanbul ignore next */\n private onChange: (value: any) => void = () => {};\n /* istanbul ignore next */\n private onTouched: () => any = () => {};\n\n private updateRadioButtonDisabled(): void {\n if (this.radios) {\n this.radios.forEach((radio) => {\n radio.disabled = this.disabled;\n });\n }\n }\n\n private updateRadioButtonNames(): void {\n if (this.radios) {\n this.radios.forEach((radio) => {\n radio.name = this.name;\n });\n }\n }\n\n private updateRadioButtonTabIndexes(): void {\n if (this.radios) {\n this.radios.forEach((radio) => {\n radio.groupTabIndex = this.tabIndex;\n });\n }\n }\n\n private updateCheckedRadioFromValue(): void {\n if (!this.radios) {\n return;\n }\n\n this.radios.forEach((radio) => {\n radio.checked = this._value === radio.value;\n });\n }\n\n private resetRadioButtons(): void {\n this.updateCheckedRadioFromValue();\n this.updateRadioButtonNames();\n this.updateRadioButtonTabIndexes();\n }\n}\n","<div\n class=\"sky-radio-group\"\n role=\"radiogroup\"\n [attr.aria-label]=\"ariaLabel\"\n [attr.aria-labelledby]=\"ariaLabelledBy\"\n [attr.aria-required]=\"required ? true : null\"\n [attr.required]=\"required ? '' : null\"\n>\n <ng-content></ng-content>\n</div>\n"]}
|
package/fesm2015/skyux-forms.js
CHANGED
|
@@ -433,7 +433,7 @@ class SkyCheckboxComponent {
|
|
|
433
433
|
/**
|
|
434
434
|
* Indicates whether the input is required for form validation.
|
|
435
435
|
* When you set this property to `true`, the component adds `aria-required` and `required`
|
|
436
|
-
* attributes to the input element so that forms display an invalid state until the
|
|
436
|
+
* attributes to the input element so that forms display an invalid state until the input element
|
|
437
437
|
* is complete.
|
|
438
438
|
* @default false
|
|
439
439
|
*/
|
|
@@ -708,8 +708,8 @@ class SkyFileItemService {
|
|
|
708
708
|
/* tslint:enable */
|
|
709
709
|
}
|
|
710
710
|
isImage(fileItem) {
|
|
711
|
-
|
|
712
|
-
slashIndex = fileTypeUpper.indexOf('/');
|
|
711
|
+
const fileTypeUpper = this.getFileTypeUpper(fileItem);
|
|
712
|
+
const slashIndex = fileTypeUpper.indexOf('/');
|
|
713
713
|
if (slashIndex >= 0) {
|
|
714
714
|
switch (fileTypeUpper.substr(fileTypeUpper.indexOf('/') + 1)) {
|
|
715
715
|
case 'BMP':
|
|
@@ -796,7 +796,7 @@ class SkyFileAttachmentComponent {
|
|
|
796
796
|
/**
|
|
797
797
|
* Indicates whether the input is required for form validation.
|
|
798
798
|
* 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
|
|
799
|
+
* attributes to the input element so that forms display an invalid state until the input element
|
|
800
800
|
* is complete.
|
|
801
801
|
*/
|
|
802
802
|
this.required = false;
|
|
@@ -1240,7 +1240,6 @@ class SkyFileDropComponent {
|
|
|
1240
1240
|
const validFileArray = [];
|
|
1241
1241
|
const rejectedFileArray = [];
|
|
1242
1242
|
const totalFiles = files.length;
|
|
1243
|
-
const fileDrop = this;
|
|
1244
1243
|
// tslint:disable-next-line: max-line-length
|
|
1245
1244
|
const processedFiles = this.fileAttachmentService.checkFiles(files, this.minFileSize, this.maxFileSize, this.acceptedTypes, this.validateFn);
|
|
1246
1245
|
for (const file of processedFiles) {
|
|
@@ -1248,7 +1247,7 @@ class SkyFileDropComponent {
|
|
|
1248
1247
|
this.filesRejected(file, validFileArray, rejectedFileArray, totalFiles);
|
|
1249
1248
|
}
|
|
1250
1249
|
else {
|
|
1251
|
-
this.loadFile(
|
|
1250
|
+
this.loadFile(this, file, validFileArray, rejectedFileArray, totalFiles);
|
|
1252
1251
|
}
|
|
1253
1252
|
}
|
|
1254
1253
|
}
|
|
@@ -1301,7 +1300,7 @@ class SkyFileSizePipe {
|
|
|
1301
1300
|
this.resourcesService = resourcesService;
|
|
1302
1301
|
}
|
|
1303
1302
|
transform(input) {
|
|
1304
|
-
let decimalPlaces = 0, dividend = 1,
|
|
1303
|
+
let decimalPlaces = 0, dividend = 1, template;
|
|
1305
1304
|
/* tslint:disable */
|
|
1306
1305
|
if (input === null || input === undefined) {
|
|
1307
1306
|
return '';
|
|
@@ -1327,10 +1326,9 @@ class SkyFileSizePipe {
|
|
|
1327
1326
|
dividend = 1e9;
|
|
1328
1327
|
decimalPlaces = 1;
|
|
1329
1328
|
}
|
|
1330
|
-
roundedSize =
|
|
1331
|
-
Math.
|
|
1332
|
-
|
|
1333
|
-
formattedSize = this.decimalPipe.transform(roundedSize, '.0-3');
|
|
1329
|
+
const roundedSize = Math.floor(input / (dividend / Math.pow(10, decimalPlaces))) /
|
|
1330
|
+
Math.pow(10, decimalPlaces);
|
|
1331
|
+
const formattedSize = this.decimalPipe.transform(roundedSize, '.0-3');
|
|
1334
1332
|
return this.getString(template, formattedSize);
|
|
1335
1333
|
}
|
|
1336
1334
|
getString(key, ...args) {
|
|
@@ -1370,7 +1368,9 @@ class SkyFileItemComponent {
|
|
|
1370
1368
|
ngDoCheck() {
|
|
1371
1369
|
const changes = this.differ.diff(this.fileItem);
|
|
1372
1370
|
if (changes) {
|
|
1373
|
-
let cls
|
|
1371
|
+
let cls;
|
|
1372
|
+
const extensionUpper = this.fileItemService.getFileExtensionUpper(this.fileItem);
|
|
1373
|
+
let fileTypeUpper;
|
|
1374
1374
|
switch (extensionUpper) {
|
|
1375
1375
|
case '.PDF':
|
|
1376
1376
|
cls = 'pdf';
|
|
@@ -1928,7 +1928,7 @@ class SkyRadioGroupComponent {
|
|
|
1928
1928
|
/**
|
|
1929
1929
|
* Indicates whether the input is required for form validation.
|
|
1930
1930
|
* When you set this property to `true`, the component adds `aria-required` and `required`
|
|
1931
|
-
* attributes to the input element so that forms display an invalid state until the
|
|
1931
|
+
* attributes to the input element so that forms display an invalid state until the input element
|
|
1932
1932
|
* is complete.
|
|
1933
1933
|
* @default false
|
|
1934
1934
|
*/
|