@skyux/forms 5.9.4 → 6.0.0-beta.10
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/documentation.json +693 -693
- package/esm2020/index.mjs +43 -0
- package/esm2020/lib/modules/character-counter/character-counter-indicator.component.mjs +32 -0
- package/esm2020/lib/modules/character-counter/character-counter.directive.mjs +84 -0
- package/esm2020/lib/modules/character-counter/character-counter.module.mjs +46 -0
- package/esm2020/lib/modules/checkbox/checkbox-change.mjs +6 -0
- package/esm2020/lib/modules/checkbox/checkbox-label.component.mjs +14 -0
- package/esm2020/lib/modules/checkbox/checkbox-required-validator.directive.mjs +30 -0
- package/esm2020/lib/modules/checkbox/checkbox.component.mjs +237 -0
- package/esm2020/lib/modules/checkbox/checkbox.module.mjs +34 -0
- package/esm2020/lib/modules/file-attachment/file-attachment-label.component.mjs +14 -0
- package/esm2020/lib/modules/file-attachment/file-attachment.component.mjs +326 -0
- package/esm2020/lib/modules/file-attachment/file-attachment.service.mjs +94 -0
- package/esm2020/lib/modules/file-attachment/file-attachments.module.mjs +68 -0
- package/esm2020/lib/modules/file-attachment/file-drop.component.mjs +216 -0
- package/esm2020/lib/modules/file-attachment/file-item-error-type.mjs +2 -0
- package/esm2020/lib/modules/file-attachment/file-item.component.mjs +112 -0
- package/esm2020/lib/modules/file-attachment/file-item.mjs +2 -0
- package/esm2020/lib/modules/file-attachment/file-item.service.mjs +70 -0
- package/esm2020/lib/modules/file-attachment/file-link.mjs +2 -0
- package/esm2020/lib/modules/file-attachment/file-size.pipe.mjs +58 -0
- package/esm2020/lib/modules/file-attachment/types/file-attachment-change.mjs +2 -0
- package/esm2020/lib/modules/file-attachment/types/file-attachment-click.mjs +2 -0
- package/esm2020/lib/modules/file-attachment/types/file-drop-change.mjs +2 -0
- package/esm2020/lib/modules/input-box/input-box-adapter.service.mjs +35 -0
- package/esm2020/lib/modules/input-box/input-box-host.service.mjs +19 -0
- package/esm2020/lib/modules/input-box/input-box-populate-args.mjs +2 -0
- package/esm2020/lib/modules/input-box/input-box.component.mjs +89 -0
- package/esm2020/lib/modules/input-box/input-box.module.mjs +19 -0
- package/esm2020/lib/modules/radio/radio-group.component.mjs +220 -0
- package/esm2020/lib/modules/radio/radio-label.component.mjs +23 -0
- package/esm2020/lib/modules/radio/radio.component.mjs +254 -0
- package/esm2020/lib/modules/radio/radio.module.mjs +28 -0
- package/esm2020/lib/modules/radio/types/radio-change.mjs +2 -0
- package/esm2020/lib/modules/selection-box/selection-box-adapter.service.mjs +123 -0
- package/esm2020/lib/modules/selection-box/selection-box-description.component.mjs +14 -0
- package/esm2020/lib/modules/selection-box/selection-box-grid.component.mjs +128 -0
- package/esm2020/lib/modules/selection-box/selection-box-header.component.mjs +14 -0
- package/esm2020/lib/modules/selection-box/selection-box.component.mjs +101 -0
- package/esm2020/lib/modules/selection-box/selection-box.module.mjs +40 -0
- package/esm2020/lib/modules/selection-box/types/selection-box-grid-align-items-type.mjs +2 -0
- package/esm2020/lib/modules/selection-box/types/selection-box-grid-align-items.mjs +2 -0
- package/esm2020/lib/modules/shared/forms-utility.mjs +26 -0
- package/esm2020/lib/modules/shared/sky-forms-resources.module.mjs +89 -0
- package/esm2020/lib/modules/toggle-switch/toggle-switch-label.component.mjs +14 -0
- package/esm2020/lib/modules/toggle-switch/toggle-switch.component.mjs +151 -0
- package/esm2020/lib/modules/toggle-switch/toggle-switch.module.mjs +20 -0
- package/esm2020/lib/modules/toggle-switch/types/toggle-switch-change.mjs +2 -0
- package/esm2020/skyux-forms.mjs +5 -0
- package/esm2020/testing/checkbox-fixture.mjs +88 -0
- package/esm2020/testing/public-api.mjs +2 -0
- package/esm2020/testing/skyux-forms-testing.mjs +5 -0
- package/fesm2015/{skyux-forms-testing.js → skyux-forms-testing.mjs} +1 -1
- package/fesm2015/skyux-forms-testing.mjs.map +1 -0
- package/fesm2015/skyux-forms.mjs +2684 -0
- package/fesm2015/skyux-forms.mjs.map +1 -0
- package/{esm2015/testing/checkbox-fixture.js → fesm2020/skyux-forms-testing.mjs} +9 -2
- package/fesm2020/skyux-forms-testing.mjs.map +1 -0
- package/fesm2020/skyux-forms.mjs +2676 -0
- package/fesm2020/skyux-forms.mjs.map +1 -0
- package/package.json +39 -15
- package/testing/package.json +5 -5
- package/bundles/skyux-forms-testing.umd.js +0 -123
- package/bundles/skyux-forms.umd.js +0 -3430
- package/esm2015/index.js +0 -43
- package/esm2015/index.js.map +0 -1
- package/esm2015/lib/modules/character-counter/character-counter-indicator.component.js +0 -37
- package/esm2015/lib/modules/character-counter/character-counter-indicator.component.js.map +0 -1
- package/esm2015/lib/modules/character-counter/character-counter.directive.js +0 -84
- package/esm2015/lib/modules/character-counter/character-counter.directive.js.map +0 -1
- package/esm2015/lib/modules/character-counter/character-counter.module.js +0 -46
- package/esm2015/lib/modules/character-counter/character-counter.module.js.map +0 -1
- package/esm2015/lib/modules/checkbox/checkbox-change.js +0 -6
- package/esm2015/lib/modules/checkbox/checkbox-change.js.map +0 -1
- package/esm2015/lib/modules/checkbox/checkbox-label.component.js +0 -17
- package/esm2015/lib/modules/checkbox/checkbox-label.component.js.map +0 -1
- package/esm2015/lib/modules/checkbox/checkbox-required-validator.directive.js +0 -32
- package/esm2015/lib/modules/checkbox/checkbox-required-validator.directive.js.map +0 -1
- package/esm2015/lib/modules/checkbox/checkbox.component.js +0 -241
- package/esm2015/lib/modules/checkbox/checkbox.component.js.map +0 -1
- package/esm2015/lib/modules/checkbox/checkbox.module.js +0 -34
- package/esm2015/lib/modules/checkbox/checkbox.module.js.map +0 -1
- package/esm2015/lib/modules/file-attachment/file-attachment-label.component.js +0 -19
- package/esm2015/lib/modules/file-attachment/file-attachment-label.component.js.map +0 -1
- package/esm2015/lib/modules/file-attachment/file-attachment.component.js +0 -335
- package/esm2015/lib/modules/file-attachment/file-attachment.component.js.map +0 -1
- package/esm2015/lib/modules/file-attachment/file-attachment.service.js +0 -94
- package/esm2015/lib/modules/file-attachment/file-attachment.service.js.map +0 -1
- package/esm2015/lib/modules/file-attachment/file-attachments.module.js +0 -68
- package/esm2015/lib/modules/file-attachment/file-attachments.module.js.map +0 -1
- package/esm2015/lib/modules/file-attachment/file-drop.component.js +0 -222
- package/esm2015/lib/modules/file-attachment/file-drop.component.js.map +0 -1
- package/esm2015/lib/modules/file-attachment/file-item-error-type.js +0 -2
- package/esm2015/lib/modules/file-attachment/file-item-error-type.js.map +0 -1
- package/esm2015/lib/modules/file-attachment/file-item.component.js +0 -116
- package/esm2015/lib/modules/file-attachment/file-item.component.js.map +0 -1
- package/esm2015/lib/modules/file-attachment/file-item.js +0 -2
- package/esm2015/lib/modules/file-attachment/file-item.js.map +0 -1
- package/esm2015/lib/modules/file-attachment/file-item.service.js +0 -72
- package/esm2015/lib/modules/file-attachment/file-item.service.js.map +0 -1
- package/esm2015/lib/modules/file-attachment/file-link.js +0 -2
- package/esm2015/lib/modules/file-attachment/file-link.js.map +0 -1
- package/esm2015/lib/modules/file-attachment/file-size.pipe.js +0 -60
- package/esm2015/lib/modules/file-attachment/file-size.pipe.js.map +0 -1
- package/esm2015/lib/modules/file-attachment/types/file-attachment-change.js +0 -2
- package/esm2015/lib/modules/file-attachment/types/file-attachment-change.js.map +0 -1
- package/esm2015/lib/modules/file-attachment/types/file-attachment-click.js +0 -2
- package/esm2015/lib/modules/file-attachment/types/file-attachment-click.js.map +0 -1
- package/esm2015/lib/modules/file-attachment/types/file-drop-change.js +0 -2
- package/esm2015/lib/modules/file-attachment/types/file-drop-change.js.map +0 -1
- package/esm2015/lib/modules/input-box/input-box-adapter.service.js +0 -35
- package/esm2015/lib/modules/input-box/input-box-adapter.service.js.map +0 -1
- package/esm2015/lib/modules/input-box/input-box-host.service.js +0 -19
- package/esm2015/lib/modules/input-box/input-box-host.service.js.map +0 -1
- package/esm2015/lib/modules/input-box/input-box-populate-args.js +0 -2
- package/esm2015/lib/modules/input-box/input-box-populate-args.js.map +0 -1
- package/esm2015/lib/modules/input-box/input-box.component.js +0 -97
- package/esm2015/lib/modules/input-box/input-box.component.js.map +0 -1
- package/esm2015/lib/modules/input-box/input-box.module.js +0 -19
- package/esm2015/lib/modules/input-box/input-box.module.js.map +0 -1
- package/esm2015/lib/modules/radio/radio-group.component.js +0 -223
- package/esm2015/lib/modules/radio/radio-group.component.js.map +0 -1
- package/esm2015/lib/modules/radio/radio-label.component.js +0 -26
- package/esm2015/lib/modules/radio/radio-label.component.js.map +0 -1
- package/esm2015/lib/modules/radio/radio.component.js +0 -262
- package/esm2015/lib/modules/radio/radio.component.js.map +0 -1
- package/esm2015/lib/modules/radio/radio.module.js +0 -28
- package/esm2015/lib/modules/radio/radio.module.js.map +0 -1
- package/esm2015/lib/modules/radio/types/radio-change.js +0 -2
- package/esm2015/lib/modules/radio/types/radio-change.js.map +0 -1
- package/esm2015/lib/modules/selection-box/selection-box-adapter.service.js +0 -124
- package/esm2015/lib/modules/selection-box/selection-box-adapter.service.js.map +0 -1
- package/esm2015/lib/modules/selection-box/selection-box-description.component.js +0 -17
- package/esm2015/lib/modules/selection-box/selection-box-description.component.js.map +0 -1
- package/esm2015/lib/modules/selection-box/selection-box-grid.component.js +0 -134
- package/esm2015/lib/modules/selection-box/selection-box-grid.component.js.map +0 -1
- package/esm2015/lib/modules/selection-box/selection-box-header.component.js +0 -17
- package/esm2015/lib/modules/selection-box/selection-box-header.component.js.map +0 -1
- package/esm2015/lib/modules/selection-box/selection-box.component.js +0 -107
- package/esm2015/lib/modules/selection-box/selection-box.component.js.map +0 -1
- package/esm2015/lib/modules/selection-box/selection-box.module.js +0 -40
- package/esm2015/lib/modules/selection-box/selection-box.module.js.map +0 -1
- package/esm2015/lib/modules/selection-box/types/selection-box-grid-align-items-type.js +0 -2
- package/esm2015/lib/modules/selection-box/types/selection-box-grid-align-items-type.js.map +0 -1
- package/esm2015/lib/modules/selection-box/types/selection-box-grid-align-items.js +0 -2
- package/esm2015/lib/modules/selection-box/types/selection-box-grid-align-items.js.map +0 -1
- package/esm2015/lib/modules/shared/forms-utility.js +0 -26
- package/esm2015/lib/modules/shared/forms-utility.js.map +0 -1
- package/esm2015/lib/modules/shared/sky-forms-resources.module.js +0 -89
- package/esm2015/lib/modules/shared/sky-forms-resources.module.js.map +0 -1
- package/esm2015/lib/modules/toggle-switch/toggle-switch-label.component.js +0 -18
- package/esm2015/lib/modules/toggle-switch/toggle-switch-label.component.js.map +0 -1
- package/esm2015/lib/modules/toggle-switch/toggle-switch.component.js +0 -159
- package/esm2015/lib/modules/toggle-switch/toggle-switch.component.js.map +0 -1
- package/esm2015/lib/modules/toggle-switch/toggle-switch.module.js +0 -20
- package/esm2015/lib/modules/toggle-switch/toggle-switch.module.js.map +0 -1
- package/esm2015/lib/modules/toggle-switch/types/toggle-switch-change.js +0 -2
- package/esm2015/lib/modules/toggle-switch/types/toggle-switch-change.js.map +0 -1
- package/esm2015/skyux-forms.js +0 -5
- package/esm2015/skyux-forms.js.map +0 -1
- package/esm2015/testing/checkbox-fixture.js.map +0 -1
- package/esm2015/testing/public-api.js +0 -2
- package/esm2015/testing/public-api.js.map +0 -1
- package/esm2015/testing/skyux-forms-testing.js +0 -5
- package/esm2015/testing/skyux-forms-testing.js.map +0 -1
- package/fesm2015/skyux-forms-testing.js.map +0 -1
- package/fesm2015/skyux-forms.js +0 -2771
- package/fesm2015/skyux-forms.js.map +0 -1
|
@@ -1,159 +0,0 @@
|
|
|
1
|
-
import { ChangeDetectionStrategy, ChangeDetectorRef, Component, ContentChildren, EventEmitter, Input, Output, QueryList, forwardRef, } from '@angular/core';
|
|
2
|
-
import { NG_VALIDATORS, NG_VALUE_ACCESSOR, } from '@angular/forms';
|
|
3
|
-
import { Subject } from 'rxjs';
|
|
4
|
-
import { takeUntil } from 'rxjs/operators';
|
|
5
|
-
import { SkyToggleSwitchLabelComponent } from './toggle-switch-label.component';
|
|
6
|
-
import * as i0 from "@angular/core";
|
|
7
|
-
import * as i1 from "@angular/common";
|
|
8
|
-
// tslint:disable:no-forward-ref no-use-before-declare
|
|
9
|
-
const SKY_TOGGLE_SWITCH_CONTROL_VALUE_ACCESSOR = {
|
|
10
|
-
provide: NG_VALUE_ACCESSOR,
|
|
11
|
-
useExisting: forwardRef(() => SkyToggleSwitchComponent),
|
|
12
|
-
multi: true,
|
|
13
|
-
};
|
|
14
|
-
const SKY_TOGGLE_SWITCH_VALIDATOR = {
|
|
15
|
-
provide: NG_VALIDATORS,
|
|
16
|
-
useExisting: forwardRef(() => SkyToggleSwitchComponent),
|
|
17
|
-
multi: true,
|
|
18
|
-
};
|
|
19
|
-
// tslint:enable
|
|
20
|
-
let uniqueId = 0;
|
|
21
|
-
export class SkyToggleSwitchComponent {
|
|
22
|
-
constructor(changeDetector) {
|
|
23
|
-
this.changeDetector = changeDetector;
|
|
24
|
-
/**
|
|
25
|
-
* Indicates whether to disable the toggle switch.
|
|
26
|
-
*/
|
|
27
|
-
this.disabled = false;
|
|
28
|
-
/**
|
|
29
|
-
* Specifies a tab index for the toggle switch. If not defined, the index is set to the position
|
|
30
|
-
* of the toggle switch on load.
|
|
31
|
-
*/
|
|
32
|
-
this.tabIndex = 0;
|
|
33
|
-
/**
|
|
34
|
-
* Fires when the checked state of a toggle switch changes.
|
|
35
|
-
*/
|
|
36
|
-
this.toggleChange = new EventEmitter();
|
|
37
|
-
this.enableIndicatorAnimation = false;
|
|
38
|
-
this.isFirstChange = true;
|
|
39
|
-
this.ngUnsubscribe = new Subject();
|
|
40
|
-
this.toggleSwitchId = uniqueId++;
|
|
41
|
-
this._checked = false;
|
|
42
|
-
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
43
|
-
this.onTouched = () => { };
|
|
44
|
-
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
45
|
-
this.onChange = () => { };
|
|
46
|
-
}
|
|
47
|
-
/**
|
|
48
|
-
* Indicates whether the toggle switch is selected.
|
|
49
|
-
* @default false
|
|
50
|
-
*/
|
|
51
|
-
set checked(checked) {
|
|
52
|
-
if (checked !== this.checked) {
|
|
53
|
-
this._checked = checked;
|
|
54
|
-
this.onChange(checked);
|
|
55
|
-
// Do not mark the field as "dirty"
|
|
56
|
-
// if the field has been initialized with a value.
|
|
57
|
-
if (this.isFirstChange && this.control) {
|
|
58
|
-
this.control.markAsPristine();
|
|
59
|
-
this.isFirstChange = false;
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
get checked() {
|
|
64
|
-
return this._checked || false;
|
|
65
|
-
}
|
|
66
|
-
get hasLabelComponent() {
|
|
67
|
-
return this.labelComponents.length > 0;
|
|
68
|
-
}
|
|
69
|
-
get labelElementId() {
|
|
70
|
-
return `sky-toggle-switch-label-${this.toggleSwitchId}`;
|
|
71
|
-
}
|
|
72
|
-
ngAfterContentInit() {
|
|
73
|
-
this.labelComponents.changes
|
|
74
|
-
.pipe(takeUntil(this.ngUnsubscribe))
|
|
75
|
-
.subscribe(() => {
|
|
76
|
-
// Allow the template to reload any ARIA attributes that are relying on the
|
|
77
|
-
// label component existing in the DOM.
|
|
78
|
-
this.changeDetector.markForCheck();
|
|
79
|
-
});
|
|
80
|
-
// Wait for the view to render before applying animation effects.
|
|
81
|
-
// (Some browsers, such as Firefox, apply the animation too early.)
|
|
82
|
-
setTimeout(() => {
|
|
83
|
-
this.enableIndicatorAnimation = true;
|
|
84
|
-
});
|
|
85
|
-
}
|
|
86
|
-
ngOnDestroy() {
|
|
87
|
-
this.ngUnsubscribe.next();
|
|
88
|
-
this.ngUnsubscribe.complete();
|
|
89
|
-
}
|
|
90
|
-
writeValue(value) {
|
|
91
|
-
this.checked = !!value;
|
|
92
|
-
this.changeDetector.markForCheck();
|
|
93
|
-
}
|
|
94
|
-
validate(control) {
|
|
95
|
-
if (!this.control) {
|
|
96
|
-
this.control = control;
|
|
97
|
-
}
|
|
98
|
-
return;
|
|
99
|
-
}
|
|
100
|
-
registerOnChange(fn) {
|
|
101
|
-
this.onChange = fn;
|
|
102
|
-
}
|
|
103
|
-
registerOnTouched(fn) {
|
|
104
|
-
this.onTouched = fn;
|
|
105
|
-
}
|
|
106
|
-
setDisabledState(disabled) {
|
|
107
|
-
this.disabled = disabled;
|
|
108
|
-
this.changeDetector.markForCheck();
|
|
109
|
-
}
|
|
110
|
-
onButtonClick(event) {
|
|
111
|
-
event.stopPropagation();
|
|
112
|
-
this.toggleChecked();
|
|
113
|
-
this.emitChangeEvent();
|
|
114
|
-
}
|
|
115
|
-
onButtonBlur() {
|
|
116
|
-
this.onTouched();
|
|
117
|
-
}
|
|
118
|
-
emitChangeEvent() {
|
|
119
|
-
this.onChange(this._checked);
|
|
120
|
-
this.toggleChange.emit({
|
|
121
|
-
checked: this._checked,
|
|
122
|
-
});
|
|
123
|
-
}
|
|
124
|
-
toggleChecked() {
|
|
125
|
-
this.checked = !this.checked;
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
SkyToggleSwitchComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyToggleSwitchComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
129
|
-
SkyToggleSwitchComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: SkyToggleSwitchComponent, selector: "sky-toggle-switch", inputs: { ariaLabel: "ariaLabel", checked: "checked", disabled: "disabled", tabIndex: "tabIndex" }, outputs: { toggleChange: "toggleChange" }, providers: [
|
|
130
|
-
SKY_TOGGLE_SWITCH_CONTROL_VALUE_ACCESSOR,
|
|
131
|
-
SKY_TOGGLE_SWITCH_VALIDATOR,
|
|
132
|
-
], queries: [{ propertyName: "labelComponents", predicate: SkyToggleSwitchLabelComponent }], ngImport: i0, template: "<span class=\"sky-toggle-switch\">\n <button\n class=\"sky-toggle-switch-button\"\n role=\"switch\"\n type=\"button\"\n [attr.aria-checked]=\"checked\"\n [attr.aria-label]=\"ariaLabel\"\n [attr.aria-labelledby]=\"hasLabelComponent ? labelElementId : null\"\n [disabled]=\"disabled\"\n [ngClass]=\"{\n 'sky-toggle-switch-checked': checked,\n 'sky-toggle-switch-disabled': disabled\n }\"\n [tabIndex]=\"tabIndex\"\n (blur)=\"onButtonBlur()\"\n (click)=\"onButtonClick($event)\"\n >\n <i\n aria-hidden=\"true\"\n class=\"sky-toggle-switch-indicator\"\n [ngClass]=\"{\n 'sky-toggle-switch-transition': enableIndicatorAnimation\n }\"\n role=\"presentation\"\n > </i\n >\n <!-- Non-breaking space needed to align switch to baseline! -->\n </button>\n\n <label\n *ngIf=\"hasLabelComponent\"\n class=\"sky-toggle-switch-label\"\n [attr.id]=\"labelElementId\"\n >\n <ng-container *ngTemplateOutlet=\"labelContent\"> </ng-container>\n </label>\n</span>\n\n<ng-template #labelContent>\n <ng-content select=\"sky-toggle-switch-label\"></ng-content>\n</ng-template>\n", styles: [".sky-toggle-switch{display:inline-flex;align-items:baseline}.sky-toggle-switch-button{border:1px solid #cdcfd2;background-color:#eeeeef;padding:1px;border-radius:24px;flex:1 0 46px;line-height:1.428571429}.sky-toggle-switch-button:hover:not(.sky-toggle-switch-disabled){border-color:#00b4f1;border-width:2px;padding:0;cursor:pointer}.sky-toggle-switch-button.sky-toggle-switch-checked{background-color:#c1e8fb;border-color:#00b4f1;border-width:2px;padding:0}.sky-toggle-switch-button.sky-toggle-switch-checked .sky-toggle-switch-indicator{left:100%}.sky-toggle-switch-button.sky-toggle-switch-disabled{background-color:#cdcfd2;border-color:transparent}.sky-toggle-switch-button.sky-toggle-switch-disabled .sky-toggle-switch-indicator{background-color:#eeeeef}.sky-toggle-switch-button+.sky-toggle-switch-label{margin-left:10px;flex:1 0 auto}.sky-toggle-switch-indicator{height:22px;width:22px;display:block;position:relative;top:0;left:22px;margin-left:-22px;border-radius:100%;box-shadow:0 1px 2px #000000bf;background-color:#fff}.sky-toggle-switch-indicator.sky-toggle-switch-transition{transition:left .15s}:host-context(.sky-theme-modern) .sky-toggle-switch-button{background-color:#fff;border-width:1px;flex-basis:48px;transition:border-color .15s,box-shadow .15s}:host-context(.sky-theme-modern) .sky-toggle-switch-button.sky-toggle-switch-disabled{border-color:#d2d2d2;cursor:not-allowed}:host-context(.sky-theme-modern) .sky-toggle-switch-button.sky-toggle-switch-disabled,:host-context(.sky-theme-modern) .sky-toggle-switch-button.sky-toggle-switch-disabled .sky-toggle-switch-indicator{background-color:#ededee}:host-context(.sky-theme-modern) .sky-toggle-switch-button.sky-toggle-switch-checked{padding:1px}:host-context(.sky-theme-modern) .sky-toggle-switch-button:not(.sky-toggle-switch-disabled).sky-toggle-switch-checked{background-color:#c1e8fb;border-color:#1870b8}:host-context(.sky-theme-modern) .sky-toggle-switch-button:not(.sky-toggle-switch-disabled):active,:host-context(.sky-theme-modern) .sky-toggle-switch-button:not(.sky-toggle-switch-disabled):focus{outline:none;border:solid 2px #1870B8;padding:0}:host-context(.sky-theme-modern) .sky-toggle-switch-button:not(.sky-toggle-switch-disabled):not(:active):focus{box-shadow:0 1px 8px #0000004d}:host-context(.sky-theme-modern) .sky-toggle-switch-button:not(.sky-toggle-switch-disabled):not(:active):hover:not(:focus){padding:1px;border:solid 1px #1870B8}:host-context(.sky-theme-modern) .sky-toggle-switch-indicator{box-shadow:0 1px 2px #00000080}.sky-theme-modern .sky-toggle-switch-button{background-color:#fff;border-width:1px;flex-basis:48px;transition:border-color .15s,box-shadow .15s}.sky-theme-modern .sky-toggle-switch-button.sky-toggle-switch-disabled{border-color:#d2d2d2;cursor:not-allowed}.sky-theme-modern .sky-toggle-switch-button.sky-toggle-switch-disabled,.sky-theme-modern .sky-toggle-switch-button.sky-toggle-switch-disabled .sky-toggle-switch-indicator{background-color:#ededee}.sky-theme-modern .sky-toggle-switch-button.sky-toggle-switch-checked{padding:1px}.sky-theme-modern .sky-toggle-switch-button:not(.sky-toggle-switch-disabled).sky-toggle-switch-checked{background-color:#c1e8fb;border-color:#1870b8}.sky-theme-modern .sky-toggle-switch-button:not(.sky-toggle-switch-disabled):active,.sky-theme-modern .sky-toggle-switch-button:not(.sky-toggle-switch-disabled):focus{outline:none;border:solid 2px #1870B8;padding:0}.sky-theme-modern .sky-toggle-switch-button:not(.sky-toggle-switch-disabled):not(:active):focus{box-shadow:0 1px 8px #0000004d}.sky-theme-modern .sky-toggle-switch-button:not(.sky-toggle-switch-disabled):not(:active):hover:not(:focus){padding:1px;border:solid 1px #1870B8}.sky-theme-modern .sky-toggle-switch-indicator{box-shadow:0 1px 2px #00000080}:host-context(.sky-theme-modern.sky-theme-mode-dark) .sky-toggle-switch-button{background-color:#121212}.sky-theme-modern.sky-theme-mode-dark .sky-toggle-switch-button{background-color:#121212}\n"], directives: [{ type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
133
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyToggleSwitchComponent, decorators: [{
|
|
134
|
-
type: Component,
|
|
135
|
-
args: [{
|
|
136
|
-
selector: 'sky-toggle-switch',
|
|
137
|
-
templateUrl: './toggle-switch.component.html',
|
|
138
|
-
styleUrls: ['./toggle-switch.component.scss'],
|
|
139
|
-
providers: [
|
|
140
|
-
SKY_TOGGLE_SWITCH_CONTROL_VALUE_ACCESSOR,
|
|
141
|
-
SKY_TOGGLE_SWITCH_VALIDATOR,
|
|
142
|
-
],
|
|
143
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
144
|
-
}]
|
|
145
|
-
}], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }]; }, propDecorators: { ariaLabel: [{
|
|
146
|
-
type: Input
|
|
147
|
-
}], checked: [{
|
|
148
|
-
type: Input
|
|
149
|
-
}], disabled: [{
|
|
150
|
-
type: Input
|
|
151
|
-
}], tabIndex: [{
|
|
152
|
-
type: Input
|
|
153
|
-
}], toggleChange: [{
|
|
154
|
-
type: Output
|
|
155
|
-
}], labelComponents: [{
|
|
156
|
-
type: ContentChildren,
|
|
157
|
-
args: [SkyToggleSwitchLabelComponent]
|
|
158
|
-
}] } });
|
|
159
|
-
//# sourceMappingURL=toggle-switch.component.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"toggle-switch.component.js","sourceRoot":"","sources":["../../../../../../../../libs/components/forms/src/lib/modules/toggle-switch/toggle-switch.component.ts","../../../../../../../../libs/components/forms/src/lib/modules/toggle-switch/toggle-switch.component.html"],"names":[],"mappings":"AAAA,OAAO,EAEL,uBAAuB,EACvB,iBAAiB,EACjB,SAAS,EACT,eAAe,EACf,YAAY,EACZ,KAAK,EAEL,MAAM,EACN,SAAS,EACT,UAAU,GACX,MAAM,eAAe,CAAC;AACvB,OAAO,EAGL,aAAa,EACb,iBAAiB,GAGlB,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAC/B,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE3C,OAAO,EAAE,6BAA6B,EAAE,MAAM,iCAAiC,CAAC;;;AAGhF,sDAAsD;AACtD,MAAM,wCAAwC,GAAQ;IACpD,OAAO,EAAE,iBAAiB;IAC1B,WAAW,EAAE,UAAU,CAAC,GAAG,EAAE,CAAC,wBAAwB,CAAC;IACvD,KAAK,EAAE,IAAI;CACZ,CAAC;AACF,MAAM,2BAA2B,GAAG;IAClC,OAAO,EAAE,aAAa;IACtB,WAAW,EAAE,UAAU,CAAC,GAAG,EAAE,CAAC,wBAAwB,CAAC;IACvD,KAAK,EAAE,IAAI;CACZ,CAAC;AACF,gBAAgB;AAEhB,IAAI,QAAQ,GAAG,CAAC,CAAC;AAYjB,MAAM,OAAO,wBAAwB;IAyEnC,YAAoB,cAAiC;QAAjC,mBAAc,GAAd,cAAc,CAAmB;QAvCrD;;WAEG;Q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C;QAC7B,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC;YACrB,OAAO,EAAE,IAAI,CAAC,QAAQ;SACvB,CAAC,CAAC;IACL,CAAC;IAEO,aAAa;QACnB,IAAI,CAAC,OAAO,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC;IAC/B,CAAC;;sHAlJU,wBAAwB;0GAAxB,wBAAwB,2LANxB;QACT,wCAAwC;QACxC,2BAA2B;KAC5B,0DAkEgB,6BAA6B,6BCpHhD,opCAyCA;4FDYa,wBAAwB;kBAVpC,SAAS;mBAAC;oBACT,QAAQ,EAAE,mBAAmB;oBAC7B,WAAW,EAAE,gCAAgC;oBAC7C,SAAS,EAAE,CAAC,gCAAgC,CAAC;oBAC7C,SAAS,EAAE;wBACT,wCAAwC;wBACxC,2BAA2B;qBAC5B;oBACD,eAAe,EAAE,uBAAuB,CAAC,MAAM;iBAChD;wGAUQ,SAAS;sBADf,KAAK;gBAQK,OAAO;sBADjB,KAAK;gBAuBC,QAAQ;sBADd,KAAK;gBAQC,QAAQ;sBADd,KAAK;gBAOC,YAAY;sBADlB,MAAM;gBAcC,eAAe;sBADtB,eAAe;uBAAC,6BAA6B","sourcesContent":["import {\n AfterContentInit,\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n ContentChildren,\n EventEmitter,\n Input,\n OnDestroy,\n Output,\n QueryList,\n forwardRef,\n} from '@angular/core';\nimport {\n AbstractControl,\n ControlValueAccessor,\n NG_VALIDATORS,\n NG_VALUE_ACCESSOR,\n ValidationErrors,\n Validator,\n} from '@angular/forms';\n\nimport { Subject } from 'rxjs';\nimport { takeUntil } from 'rxjs/operators';\n\nimport { SkyToggleSwitchLabelComponent } from './toggle-switch-label.component';\nimport { SkyToggleSwitchChange } from './types/toggle-switch-change';\n\n// tslint:disable:no-forward-ref no-use-before-declare\nconst SKY_TOGGLE_SWITCH_CONTROL_VALUE_ACCESSOR: any = {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => SkyToggleSwitchComponent),\n multi: true,\n};\nconst SKY_TOGGLE_SWITCH_VALIDATOR = {\n provide: NG_VALIDATORS,\n useExisting: forwardRef(() => SkyToggleSwitchComponent),\n multi: true,\n};\n// tslint:enable\n\nlet uniqueId = 0;\n\n@Component({\n selector: 'sky-toggle-switch',\n templateUrl: './toggle-switch.component.html',\n styleUrls: ['./toggle-switch.component.scss'],\n providers: [\n SKY_TOGGLE_SWITCH_CONTROL_VALUE_ACCESSOR,\n SKY_TOGGLE_SWITCH_VALIDATOR,\n ],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class SkyToggleSwitchComponent\n implements AfterContentInit, OnDestroy, ControlValueAccessor, Validator\n{\n /**\n * Specifies an ARIA label for the toggle switch. This sets the toggle switch's `aria-label`\n * attribute [to support accessibility](https://developer.blackbaud.com/skyux/learn/accessibility).\n * If the `sky-toggle-switch-label` component displays a visible label, do not use this property.\n */\n @Input()\n public ariaLabel: string;\n\n /**\n * Indicates whether the toggle switch is selected.\n * @default false\n */\n @Input()\n public set checked(checked: boolean) {\n if (checked !== this.checked) {\n this._checked = checked;\n this.onChange(checked);\n\n // Do not mark the field as \"dirty\"\n // if the field has been initialized with a value.\n if (this.isFirstChange && this.control) {\n this.control.markAsPristine();\n this.isFirstChange = false;\n }\n }\n }\n\n public get checked(): boolean {\n return this._checked || false;\n }\n\n /**\n * Indicates whether to disable the toggle switch.\n */\n @Input()\n public disabled = false;\n\n /**\n * Specifies a tab index for the toggle switch. If not defined, the index is set to the position\n * of the toggle switch on load.\n */\n @Input()\n public tabIndex = 0;\n\n /**\n * Fires when the checked state of a toggle switch changes.\n */\n @Output()\n public toggleChange = new EventEmitter<SkyToggleSwitchChange>();\n\n public get hasLabelComponent(): boolean {\n return this.labelComponents.length > 0;\n }\n\n public enableIndicatorAnimation = false;\n\n public get labelElementId(): string {\n return `sky-toggle-switch-label-${this.toggleSwitchId}`;\n }\n\n @ContentChildren(SkyToggleSwitchLabelComponent)\n private labelComponents: QueryList<SkyToggleSwitchLabelComponent>;\n\n private control: AbstractControl;\n private isFirstChange = true;\n private ngUnsubscribe = new Subject<void>();\n private toggleSwitchId = uniqueId++;\n\n private _checked = false;\n\n constructor(private changeDetector: ChangeDetectorRef) {}\n\n public ngAfterContentInit(): void {\n this.labelComponents.changes\n .pipe(takeUntil(this.ngUnsubscribe))\n .subscribe(() => {\n // Allow the template to reload any ARIA attributes that are relying on the\n // label component existing in the DOM.\n this.changeDetector.markForCheck();\n });\n\n // Wait for the view to render before applying animation effects.\n // (Some browsers, such as Firefox, apply the animation too early.)\n setTimeout(() => {\n this.enableIndicatorAnimation = true;\n });\n }\n\n public ngOnDestroy(): void {\n this.ngUnsubscribe.next();\n this.ngUnsubscribe.complete();\n }\n\n public writeValue(value: boolean): void {\n this.checked = !!value;\n this.changeDetector.markForCheck();\n }\n\n public validate(control: AbstractControl): ValidationErrors {\n if (!this.control) {\n this.control = control;\n }\n\n return;\n }\n\n public registerOnChange(fn: (value: any) => void) {\n this.onChange = fn;\n }\n\n public registerOnTouched(fn: any): void {\n this.onTouched = fn;\n }\n\n public setDisabledState(disabled: boolean): void {\n this.disabled = disabled;\n this.changeDetector.markForCheck();\n }\n\n public onButtonClick(event: any): void {\n event.stopPropagation();\n this.toggleChecked();\n this.emitChangeEvent();\n }\n\n public onButtonBlur(): void {\n this.onTouched();\n }\n\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n private onTouched: () => any = () => {};\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n private onChange: (value: any) => void = () => {};\n\n private emitChangeEvent(): void {\n this.onChange(this._checked);\n this.toggleChange.emit({\n checked: this._checked,\n });\n }\n\n private toggleChecked(): void {\n this.checked = !this.checked;\n }\n}\n","<span class=\"sky-toggle-switch\">\n <button\n class=\"sky-toggle-switch-button\"\n role=\"switch\"\n type=\"button\"\n [attr.aria-checked]=\"checked\"\n [attr.aria-label]=\"ariaLabel\"\n [attr.aria-labelledby]=\"hasLabelComponent ? labelElementId : null\"\n [disabled]=\"disabled\"\n [ngClass]=\"{\n 'sky-toggle-switch-checked': checked,\n 'sky-toggle-switch-disabled': disabled\n }\"\n [tabIndex]=\"tabIndex\"\n (blur)=\"onButtonBlur()\"\n (click)=\"onButtonClick($event)\"\n >\n <i\n aria-hidden=\"true\"\n class=\"sky-toggle-switch-indicator\"\n [ngClass]=\"{\n 'sky-toggle-switch-transition': enableIndicatorAnimation\n }\"\n role=\"presentation\"\n > </i\n >\n <!-- Non-breaking space needed to align switch to baseline! -->\n </button>\n\n <label\n *ngIf=\"hasLabelComponent\"\n class=\"sky-toggle-switch-label\"\n [attr.id]=\"labelElementId\"\n >\n <ng-container *ngTemplateOutlet=\"labelContent\"> </ng-container>\n </label>\n</span>\n\n<ng-template #labelContent>\n <ng-content select=\"sky-toggle-switch-label\"></ng-content>\n</ng-template>\n"]}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { CommonModule } from '@angular/common';
|
|
2
|
-
import { NgModule } from '@angular/core';
|
|
3
|
-
import { FormsModule } from '@angular/forms';
|
|
4
|
-
import { SkyToggleSwitchLabelComponent } from './toggle-switch-label.component';
|
|
5
|
-
import { SkyToggleSwitchComponent } from './toggle-switch.component';
|
|
6
|
-
import * as i0 from "@angular/core";
|
|
7
|
-
export class SkyToggleSwitchModule {
|
|
8
|
-
}
|
|
9
|
-
SkyToggleSwitchModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyToggleSwitchModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
10
|
-
SkyToggleSwitchModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyToggleSwitchModule, declarations: [SkyToggleSwitchLabelComponent, SkyToggleSwitchComponent], imports: [CommonModule, FormsModule], exports: [SkyToggleSwitchLabelComponent, SkyToggleSwitchComponent] });
|
|
11
|
-
SkyToggleSwitchModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyToggleSwitchModule, imports: [[CommonModule, FormsModule]] });
|
|
12
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyToggleSwitchModule, decorators: [{
|
|
13
|
-
type: NgModule,
|
|
14
|
-
args: [{
|
|
15
|
-
declarations: [SkyToggleSwitchLabelComponent, SkyToggleSwitchComponent],
|
|
16
|
-
imports: [CommonModule, FormsModule],
|
|
17
|
-
exports: [SkyToggleSwitchLabelComponent, SkyToggleSwitchComponent],
|
|
18
|
-
}]
|
|
19
|
-
}] });
|
|
20
|
-
//# sourceMappingURL=toggle-switch.module.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"toggle-switch.module.js","sourceRoot":"","sources":["../../../../../../../../libs/components/forms/src/lib/modules/toggle-switch/toggle-switch.module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C,OAAO,EAAE,6BAA6B,EAAE,MAAM,iCAAiC,CAAC;AAChF,OAAO,EAAE,wBAAwB,EAAE,MAAM,2BAA2B,CAAC;;AAOrE,MAAM,OAAO,qBAAqB;;mHAArB,qBAAqB;oHAArB,qBAAqB,iBAJjB,6BAA6B,EAAE,wBAAwB,aAC5D,YAAY,EAAE,WAAW,aACzB,6BAA6B,EAAE,wBAAwB;oHAEtD,qBAAqB,YAHvB,CAAC,YAAY,EAAE,WAAW,CAAC;4FAGzB,qBAAqB;kBALjC,QAAQ;mBAAC;oBACR,YAAY,EAAE,CAAC,6BAA6B,EAAE,wBAAwB,CAAC;oBACvE,OAAO,EAAE,CAAC,YAAY,EAAE,WAAW,CAAC;oBACpC,OAAO,EAAE,CAAC,6BAA6B,EAAE,wBAAwB,CAAC;iBACnE","sourcesContent":["import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { FormsModule } from '@angular/forms';\n\nimport { SkyToggleSwitchLabelComponent } from './toggle-switch-label.component';\nimport { SkyToggleSwitchComponent } from './toggle-switch.component';\n\n@NgModule({\n declarations: [SkyToggleSwitchLabelComponent, SkyToggleSwitchComponent],\n imports: [CommonModule, FormsModule],\n exports: [SkyToggleSwitchLabelComponent, SkyToggleSwitchComponent],\n})\nexport class SkyToggleSwitchModule {}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"toggle-switch-change.js","sourceRoot":"","sources":["../../../../../../../../../libs/components/forms/src/lib/modules/toggle-switch/types/toggle-switch-change.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * Indicates whether the toggle switch is selected.\n */\nexport interface SkyToggleSwitchChange {\n checked: boolean;\n}\n"]}
|
package/esm2015/skyux-forms.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"skyux-forms.js","sourceRoot":"","sources":["../../../../../libs/components/forms/src/skyux-forms.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,cAAc,SAAS,CAAC","sourcesContent":["/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"checkbox-fixture.js","sourceRoot":"","sources":["../../../../../../libs/components/forms/testing/src/checkbox-fixture.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,EAAE,EAAE,MAAM,2BAA2B,CAAC;AAC/C,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAEvD;;GAEG;AACH,MAAM,OAAO,kBAAkB;IAG7B,YAAY,OAA8B,EAAE,SAAiB;QAC3D,IAAI,CAAC,OAAO,GAAG,iBAAiB,CAAC,uBAAuB,CACtD,OAAO,EACP,SAAS,EACT,cAAc,CACf,CAAC;IACJ,CAAC;IAED;;OAEG;IACH,IAAW,QAA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IACnB,CAAC;IAED;;OAEG;IACH,IAAW,QAAQ;QACjB,OAAO,IAAI,CAAC,kBAAkB,EAAE,CAAC,aAAa,CAAC,QAAQ,CAAC;IAC1D,CAAC;IAED;;OAEG;IACI,MAAM;QACX,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE;YAClB,IAAI,CAAC,oBAAoB,EAAE,CAAC;SAC7B;IACH,CAAC;IAED;;OAEG;IACI,QAAQ;QACb,IAAI,IAAI,CAAC,QAAQ,EAAE;YACjB,IAAI,CAAC,oBAAoB,EAAE,CAAC;SAC7B;IACH,CAAC;IAEO,oBAAoB;QAC1B,IAAI,CAAC,OAAO;aACT,KAAK,CAAC,EAAE,CAAC,GAAG,CAAC,4BAA4B,CAAC,CAAC;aAC3C,aAAa,CAAC,KAAK,EAAE,CAAC;IAC3B,CAAC;IAEO,kBAAkB;QACxB,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC,GAAG,CAAC,6BAA6B,CAAC,CAAC,CAAC;IACnE,CAAC;IAEO,gBAAgB;QACtB,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC,GAAG,CAAC,iCAAiC,CAAC,CAAC,CAAC;IACvE,CAAC;CACF","sourcesContent":["import { DebugElement } from '@angular/core';\nimport { ComponentFixture } from '@angular/core/testing';\nimport { By } from '@angular/platform-browser';\nimport { SkyAppTestUtility } from '@skyux-sdk/testing';\n\n/**\n * Allows interaction with a SKY UX checkbox component.\n */\nexport class SkyCheckboxFixture {\n private debugEl: DebugElement;\n\n constructor(fixture: ComponentFixture<any>, skyTestId: string) {\n this.debugEl = SkyAppTestUtility.getDebugElementByTestId(\n fixture,\n skyTestId,\n 'sky-checkbox'\n );\n }\n\n /**\n * A flag indicating whether the checkbox is currently selected.\n */\n public get selected(): boolean {\n return this.getCheckboxInputEl().nativeElement.checked;\n }\n\n /**\n * The checkbox's label\n */\n public get labelText(): string {\n return SkyAppTestUtility.getText(\n this.debugEl.query(By.css('label.sky-checkbox-wrapper'))\n );\n }\n\n /**\n * The checkbox's icon type\n */\n public get iconType(): string {\n const classList = this.debugEl.query(By.css('.fa.sky-icon')).nativeElement\n .classList;\n\n for (let i = 0, n = classList.length; i < n; i++) {\n const cls = classList.item(i);\n\n if (cls.indexOf('fa-') === 0) {\n return cls.substr(3);\n }\n }\n }\n\n /**\n * The checkbox's type.\n */\n public get checkboxType(): string {\n const classList = this.getCheckboxBoxEl().nativeElement.classList;\n\n if (classList.contains('sky-switch-control-danger')) {\n return 'danger';\n }\n\n if (classList.contains('sky-switch-control-info')) {\n return 'info';\n }\n\n if (classList.contains('sky-switch-control-success')) {\n return 'success';\n }\n\n if (classList.contains('sky-switch-control-warning')) {\n return 'warning';\n }\n\n return undefined;\n }\n\n /**\n * A flag indicating whether the checkbox is currently disabled.\n */\n public get disabled(): boolean {\n return this.getCheckboxInputEl().nativeElement.disabled;\n }\n\n /**\n * Selects the checkbox.\n */\n public select(): void {\n if (!this.selected) {\n this.clickCheckboxLabelEl();\n }\n }\n\n /**\n * Deselects the checkbox.\n */\n public deselect(): void {\n if (this.selected) {\n this.clickCheckboxLabelEl();\n }\n }\n\n private clickCheckboxLabelEl(): void {\n this.debugEl\n .query(By.css('label.sky-checkbox-wrapper'))\n .nativeElement.click();\n }\n\n private getCheckboxInputEl(): DebugElement {\n return this.debugEl.query(By.css('.sky-checkbox-wrapper input'));\n }\n\n private getCheckboxBoxEl(): DebugElement {\n return this.debugEl.query(By.css('label.sky-checkbox-wrapper span'));\n }\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"public-api.js","sourceRoot":"","sources":["../../../../../../libs/components/forms/testing/src/public-api.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC","sourcesContent":["export * from './checkbox-fixture';\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"skyux-forms-testing.js","sourceRoot":"","sources":["../../../../../../libs/components/forms/testing/src/skyux-forms-testing.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,cAAc,cAAc,CAAC","sourcesContent":["/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"skyux-forms-testing.js","sources":["../../../../../libs/components/forms/testing/src/checkbox-fixture.ts","../../../../../libs/components/forms/testing/src/skyux-forms-testing.ts"],"sourcesContent":["import { DebugElement } from '@angular/core';\nimport { ComponentFixture } from '@angular/core/testing';\nimport { By } from '@angular/platform-browser';\nimport { SkyAppTestUtility } from '@skyux-sdk/testing';\n\n/**\n * Allows interaction with a SKY UX checkbox component.\n */\nexport class SkyCheckboxFixture {\n private debugEl: DebugElement;\n\n constructor(fixture: ComponentFixture<any>, skyTestId: string) {\n this.debugEl = SkyAppTestUtility.getDebugElementByTestId(\n fixture,\n skyTestId,\n 'sky-checkbox'\n );\n }\n\n /**\n * A flag indicating whether the checkbox is currently selected.\n */\n public get selected(): boolean {\n return this.getCheckboxInputEl().nativeElement.checked;\n }\n\n /**\n * The checkbox's label\n */\n public get labelText(): string {\n return SkyAppTestUtility.getText(\n this.debugEl.query(By.css('label.sky-checkbox-wrapper'))\n );\n }\n\n /**\n * The checkbox's icon type\n */\n public get iconType(): string {\n const classList = this.debugEl.query(By.css('.fa.sky-icon')).nativeElement\n .classList;\n\n for (let i = 0, n = classList.length; i < n; i++) {\n const cls = classList.item(i);\n\n if (cls.indexOf('fa-') === 0) {\n return cls.substr(3);\n }\n }\n }\n\n /**\n * The checkbox's type.\n */\n public get checkboxType(): string {\n const classList = this.getCheckboxBoxEl().nativeElement.classList;\n\n if (classList.contains('sky-switch-control-danger')) {\n return 'danger';\n }\n\n if (classList.contains('sky-switch-control-info')) {\n return 'info';\n }\n\n if (classList.contains('sky-switch-control-success')) {\n return 'success';\n }\n\n if (classList.contains('sky-switch-control-warning')) {\n return 'warning';\n }\n\n return undefined;\n }\n\n /**\n * A flag indicating whether the checkbox is currently disabled.\n */\n public get disabled(): boolean {\n return this.getCheckboxInputEl().nativeElement.disabled;\n }\n\n /**\n * Selects the checkbox.\n */\n public select(): void {\n if (!this.selected) {\n this.clickCheckboxLabelEl();\n }\n }\n\n /**\n * Deselects the checkbox.\n */\n public deselect(): void {\n if (this.selected) {\n this.clickCheckboxLabelEl();\n }\n }\n\n private clickCheckboxLabelEl(): void {\n this.debugEl\n .query(By.css('label.sky-checkbox-wrapper'))\n .nativeElement.click();\n }\n\n private getCheckboxInputEl(): DebugElement {\n return this.debugEl.query(By.css('.sky-checkbox-wrapper input'));\n }\n\n private getCheckboxBoxEl(): DebugElement {\n return this.debugEl.query(By.css('label.sky-checkbox-wrapper span'));\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;AAKA;;;MAGa,kBAAkB;IAG7B,YAAY,OAA8B,EAAE,SAAiB;QAC3D,IAAI,CAAC,OAAO,GAAG,iBAAiB,CAAC,uBAAuB,CACtD,OAAO,EACP,SAAS,EACT,cAAc,CACf,CAAC;KACH;;;;IAKD,IAAW,QAAQ;QACjB,OAAO,IAAI,CAAC,kBAAkB,EAAE,CAAC,aAAa,CAAC,OAAO,CAAC;KACxD;;;;IAKD,IAAW,SAAS;QAClB,OAAO,iBAAiB,CAAC,OAAO,CAC9B,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC,GAAG,CAAC,4BAA4B,CAAC,CAAC,CACzD,CAAC;KACH;;;;IAKD,IAAW,QAAQ;QACjB,MAAM,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC,CAAC,aAAa;aACvE,SAAS,CAAC;QAEb,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,SAAS,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;YAChD,MAAM,GAAG,GAAG,SAAS,C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