@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
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
(function (global, factory) {
|
|
2
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/common'), require('@angular/
|
|
3
|
-
typeof define === 'function' && define.amd ? define('@skyux/forms', ['exports', '@angular/common', '@angular/
|
|
4
|
-
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.skyux = global.skyux || {}, global.skyux.forms = {}), global.ng.common, global.ng.
|
|
5
|
-
})(this, (function (exports, i1,
|
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/common'), require('@angular/core'), require('@angular/forms'), require('@skyux/i18n'), require('@skyux/indicators'), require('rxjs'), require('@skyux/theme'), require('rxjs/operators'), require('@skyux/core')) :
|
|
3
|
+
typeof define === 'function' && define.amd ? define('@skyux/forms', ['exports', '@angular/common', '@angular/core', '@angular/forms', '@skyux/i18n', '@skyux/indicators', 'rxjs', '@skyux/theme', 'rxjs/operators', '@skyux/core'], factory) :
|
|
4
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.skyux = global.skyux || {}, global.skyux.forms = {}), global.ng.common, global.ng.core, global.ng.forms, global.i2, global.i2$1, global.rxjs, global.i1$1, global.rxjs.operators, global.i2$2));
|
|
5
|
+
})(this, (function (exports, i1, i0, i4, i2, i2$1, rxjs, i1$1, operators, i2$2) { 'use strict';
|
|
6
6
|
|
|
7
7
|
function _interopNamespace(e) {
|
|
8
8
|
if (e && e.__esModule) return e;
|
|
@@ -23,8 +23,8 @@
|
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
var i1__namespace = /*#__PURE__*/_interopNamespace(i1);
|
|
26
|
-
var i4__namespace = /*#__PURE__*/_interopNamespace(i4);
|
|
27
26
|
var i0__namespace = /*#__PURE__*/_interopNamespace(i0);
|
|
27
|
+
var i4__namespace = /*#__PURE__*/_interopNamespace(i4);
|
|
28
28
|
var i2__namespace = /*#__PURE__*/_interopNamespace(i2);
|
|
29
29
|
var i2__namespace$1 = /*#__PURE__*/_interopNamespace(i2$1);
|
|
30
30
|
var i1__namespace$1 = /*#__PURE__*/_interopNamespace(i1$1);
|
|
@@ -122,6 +122,48 @@
|
|
|
122
122
|
}]
|
|
123
123
|
}] });
|
|
124
124
|
|
|
125
|
+
var SkyCharacterCounterIndicatorComponent = /** @class */ (function () {
|
|
126
|
+
function SkyCharacterCounterIndicatorComponent(changeDetector) {
|
|
127
|
+
this.changeDetector = changeDetector;
|
|
128
|
+
this.currentCharacterCountLimit = 0;
|
|
129
|
+
this.currentCharacterCount = 0;
|
|
130
|
+
}
|
|
131
|
+
Object.defineProperty(SkyCharacterCounterIndicatorComponent.prototype, "characterCount", {
|
|
132
|
+
get: function () {
|
|
133
|
+
return this.currentCharacterCount;
|
|
134
|
+
},
|
|
135
|
+
set: function (count) {
|
|
136
|
+
this.currentCharacterCount = count;
|
|
137
|
+
this.changeDetector.markForCheck();
|
|
138
|
+
},
|
|
139
|
+
enumerable: false,
|
|
140
|
+
configurable: true
|
|
141
|
+
});
|
|
142
|
+
Object.defineProperty(SkyCharacterCounterIndicatorComponent.prototype, "characterCountLimit", {
|
|
143
|
+
get: function () {
|
|
144
|
+
return this.currentCharacterCountLimit;
|
|
145
|
+
},
|
|
146
|
+
set: function (limit) {
|
|
147
|
+
this.currentCharacterCountLimit = limit;
|
|
148
|
+
this.changeDetector.markForCheck();
|
|
149
|
+
},
|
|
150
|
+
enumerable: false,
|
|
151
|
+
configurable: true
|
|
152
|
+
});
|
|
153
|
+
return SkyCharacterCounterIndicatorComponent;
|
|
154
|
+
}());
|
|
155
|
+
SkyCharacterCounterIndicatorComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyCharacterCounterIndicatorComponent, deps: [{ token: i0__namespace.ChangeDetectorRef }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
156
|
+
SkyCharacterCounterIndicatorComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: SkyCharacterCounterIndicatorComponent, selector: "sky-character-counter-indicator", ngImport: i0__namespace, template: "<span\n class=\"sky-character-count-label sky-deemphasized\"\n [ngClass]=\"{ 'sky-error-label': characterCount > characterCountLimit }\"\n>\n {{ characterCount + '/' + characterCountLimit }}\n</span>\n<span aria-live=\"polite\" class=\"sky-screen-reader-only\">\n {{ characterCount }} {{ 'skyux_character_count_message' | skyLibResources }}\n {{ characterCountLimit }}.\n {{\n characterCount > characterCountLimit\n ? ('skyux_character_count_over_limit' | skyLibResources)\n : ''\n }}\n</span>\n", styles: [":host{flex-shrink:.0001}.sky-character-count-label.sky-error-label{margin:0}.sky-character-count-label.sky-error-label:before{font-style:normal}.sky-screen-reader-only{width:0;height:0;padding:0;opacity:0;position:absolute;margin:-1px;border:0;overflow:hidden;clip:rect(0,0,0,0);outline:none;white-space:nowrap}\n"], directives: [{ type: i1__namespace.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }], pipes: { "skyLibResources": i2__namespace.SkyLibResourcesPipe }, changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush });
|
|
157
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyCharacterCounterIndicatorComponent, decorators: [{
|
|
158
|
+
type: i0.Component,
|
|
159
|
+
args: [{
|
|
160
|
+
selector: 'sky-character-counter-indicator',
|
|
161
|
+
template: "<span\n class=\"sky-character-count-label sky-deemphasized\"\n [ngClass]=\"{ 'sky-error-label': characterCount > characterCountLimit }\"\n>\n {{ characterCount + '/' + characterCountLimit }}\n</span>\n<span aria-live=\"polite\" class=\"sky-screen-reader-only\">\n {{ characterCount }} {{ 'skyux_character_count_message' | skyLibResources }}\n {{ characterCountLimit }}.\n {{\n characterCount > characterCountLimit\n ? ('skyux_character_count_over_limit' | skyLibResources)\n : ''\n }}\n</span>\n",
|
|
162
|
+
styles: [":host{flex-shrink:.0001}.sky-character-count-label.sky-error-label{margin:0}.sky-character-count-label.sky-error-label:before{font-style:normal}.sky-screen-reader-only{width:0;height:0;padding:0;opacity:0;position:absolute;margin:-1px;border:0;overflow:hidden;clip:rect(0,0,0,0);outline:none;white-space:nowrap}\n"],
|
|
163
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush,
|
|
164
|
+
}]
|
|
165
|
+
}], ctorParameters: function () { return [{ type: i0__namespace.ChangeDetectorRef }]; } });
|
|
166
|
+
|
|
125
167
|
/**
|
|
126
168
|
* Creates an input field that validates the number of characters. Place this directive on
|
|
127
169
|
* an `input` or `textarea` element. If users enter more characters than allowed, then the
|
|
@@ -130,6 +172,7 @@
|
|
|
130
172
|
*/
|
|
131
173
|
var SkyCharacterCounterInputDirective = /** @class */ (function () {
|
|
132
174
|
function SkyCharacterCounterInputDirective() {
|
|
175
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
133
176
|
this._validatorChange = function () { };
|
|
134
177
|
}
|
|
135
178
|
Object.defineProperty(SkyCharacterCounterInputDirective.prototype, "skyCharacterCounterLimit", {
|
|
@@ -206,48 +249,6 @@
|
|
|
206
249
|
type: i0.Input
|
|
207
250
|
}] } });
|
|
208
251
|
|
|
209
|
-
var SkyCharacterCounterIndicatorComponent = /** @class */ (function () {
|
|
210
|
-
function SkyCharacterCounterIndicatorComponent(changeDetector) {
|
|
211
|
-
this.changeDetector = changeDetector;
|
|
212
|
-
this.currentCharacterCountLimit = 0;
|
|
213
|
-
this.currentCharacterCount = 0;
|
|
214
|
-
}
|
|
215
|
-
Object.defineProperty(SkyCharacterCounterIndicatorComponent.prototype, "characterCount", {
|
|
216
|
-
get: function () {
|
|
217
|
-
return this.currentCharacterCount;
|
|
218
|
-
},
|
|
219
|
-
set: function (count) {
|
|
220
|
-
this.currentCharacterCount = count;
|
|
221
|
-
this.changeDetector.markForCheck();
|
|
222
|
-
},
|
|
223
|
-
enumerable: false,
|
|
224
|
-
configurable: true
|
|
225
|
-
});
|
|
226
|
-
Object.defineProperty(SkyCharacterCounterIndicatorComponent.prototype, "characterCountLimit", {
|
|
227
|
-
get: function () {
|
|
228
|
-
return this.currentCharacterCountLimit;
|
|
229
|
-
},
|
|
230
|
-
set: function (limit) {
|
|
231
|
-
this.currentCharacterCountLimit = limit;
|
|
232
|
-
this.changeDetector.markForCheck();
|
|
233
|
-
},
|
|
234
|
-
enumerable: false,
|
|
235
|
-
configurable: true
|
|
236
|
-
});
|
|
237
|
-
return SkyCharacterCounterIndicatorComponent;
|
|
238
|
-
}());
|
|
239
|
-
SkyCharacterCounterIndicatorComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyCharacterCounterIndicatorComponent, deps: [{ token: i0__namespace.ChangeDetectorRef }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
240
|
-
SkyCharacterCounterIndicatorComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: SkyCharacterCounterIndicatorComponent, selector: "sky-character-counter-indicator", ngImport: i0__namespace, template: "<span\n class=\"sky-character-count-label sky-deemphasized\"\n [ngClass]=\"{ 'sky-error-label': characterCount > characterCountLimit }\"\n>\n {{ characterCount + '/' + characterCountLimit }}\n</span>\n<span aria-live=\"polite\" class=\"sky-screen-reader-only\">\n {{ characterCount }} {{ 'skyux_character_count_message' | skyLibResources }}\n {{ characterCountLimit }}.\n {{\n characterCount > characterCountLimit\n ? ('skyux_character_count_over_limit' | skyLibResources)\n : ''\n }}\n</span>\n", styles: [":host{flex-shrink:.0001}.sky-character-count-label.sky-error-label{margin:0}.sky-character-count-label.sky-error-label:before{font-style:normal}.sky-screen-reader-only{width:0;height:0;padding:0;opacity:0;position:absolute;margin:-1px;border:0;overflow:hidden;clip:rect(0,0,0,0);outline:none;white-space:nowrap}\n"], directives: [{ type: i1__namespace.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }], pipes: { "skyLibResources": i2__namespace.SkyLibResourcesPipe }, changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush });
|
|
241
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyCharacterCounterIndicatorComponent, decorators: [{
|
|
242
|
-
type: i0.Component,
|
|
243
|
-
args: [{
|
|
244
|
-
selector: 'sky-character-counter-indicator',
|
|
245
|
-
template: "<span\n class=\"sky-character-count-label sky-deemphasized\"\n [ngClass]=\"{ 'sky-error-label': characterCount > characterCountLimit }\"\n>\n {{ characterCount + '/' + characterCountLimit }}\n</span>\n<span aria-live=\"polite\" class=\"sky-screen-reader-only\">\n {{ characterCount }} {{ 'skyux_character_count_message' | skyLibResources }}\n {{ characterCountLimit }}.\n {{\n characterCount > characterCountLimit\n ? ('skyux_character_count_over_limit' | skyLibResources)\n : ''\n }}\n</span>\n",
|
|
246
|
-
styles: [":host{flex-shrink:.0001}.sky-character-count-label.sky-error-label{margin:0}.sky-character-count-label.sky-error-label:before{font-style:normal}.sky-screen-reader-only{width:0;height:0;padding:0;opacity:0;position:absolute;margin:-1px;border:0;overflow:hidden;clip:rect(0,0,0,0);outline:none;white-space:nowrap}\n"],
|
|
247
|
-
changeDetection: i0.ChangeDetectionStrategy.OnPush,
|
|
248
|
-
}]
|
|
249
|
-
}], ctorParameters: function () { return [{ type: i0__namespace.ChangeDetectorRef }]; } });
|
|
250
|
-
|
|
251
252
|
var SkyCharacterCounterModule = /** @class */ (function () {
|
|
252
253
|
function SkyCharacterCounterModule() {
|
|
253
254
|
}
|
|
@@ -298,297 +299,6 @@
|
|
|
298
299
|
return SkyCheckboxChange;
|
|
299
300
|
}());
|
|
300
301
|
|
|
301
|
-
// Need to add the following to classes which contain static methods.
|
|
302
|
-
// See: https://github.com/ng-packagr/ng-packagr/issues/641
|
|
303
|
-
// @dynamic
|
|
304
|
-
var SkyFormsUtility = /** @class */ (function () {
|
|
305
|
-
function SkyFormsUtility() {
|
|
306
|
-
}
|
|
307
|
-
/** Coerces a data-bound value (typically a string) to a boolean. */
|
|
308
|
-
SkyFormsUtility.coerceBooleanProperty = function (value) {
|
|
309
|
-
return value !== undefined && "" + value !== 'false';
|
|
310
|
-
};
|
|
311
|
-
/**
|
|
312
|
-
* Gets the required state of the checkbox.
|
|
313
|
-
* Currently, Angular doesn't offer a way to get this easily, so we have to create an empty
|
|
314
|
-
* control using the current validator to see if it throws a `required` validation error.
|
|
315
|
-
* https://github.com/angular/angular/issues/13461#issuecomment-340368046
|
|
316
|
-
*/
|
|
317
|
-
SkyFormsUtility.hasRequiredValidation = function (ngControl) {
|
|
318
|
-
var abstractControl = ngControl.control;
|
|
319
|
-
if (abstractControl && abstractControl.validator) {
|
|
320
|
-
var validator = abstractControl.validator({});
|
|
321
|
-
if (validator && validator.required) {
|
|
322
|
-
return true;
|
|
323
|
-
}
|
|
324
|
-
}
|
|
325
|
-
return false;
|
|
326
|
-
};
|
|
327
|
-
return SkyFormsUtility;
|
|
328
|
-
}());
|
|
329
|
-
|
|
330
|
-
/**
|
|
331
|
-
* Monotonically increasing integer used to auto-generate unique ids for checkbox components.
|
|
332
|
-
*/
|
|
333
|
-
var nextId = 0;
|
|
334
|
-
/**
|
|
335
|
-
* Replaces the HTML input element with `type="checkbox"`. When users select a checkbox, its value
|
|
336
|
-
* is driven through an `ngModel` attribute that you specify on the `sky-checkbox` element.
|
|
337
|
-
*/
|
|
338
|
-
var SkyCheckboxComponent = /** @class */ (function () {
|
|
339
|
-
function SkyCheckboxComponent(ngControl) {
|
|
340
|
-
this.ngControl = ngControl;
|
|
341
|
-
/**
|
|
342
|
-
* Specifies an ID for the checkbox.
|
|
343
|
-
* @default a unique, auto-incrementing integer. For example: `sky-checkbox-1`
|
|
344
|
-
*/
|
|
345
|
-
this.id = "sky-checkbox-" + ++nextId;
|
|
346
|
-
/**
|
|
347
|
-
* Specifies an index for the checkbox. If not defined, the index is set to the position of the
|
|
348
|
-
* checkbox on load.
|
|
349
|
-
*/
|
|
350
|
-
this.tabindex = 0;
|
|
351
|
-
/**
|
|
352
|
-
* Specifies a name for a group of checkboxes.
|
|
353
|
-
* @default a unique, auto-incrementing integer. For example: `sky-checkbox-1`
|
|
354
|
-
*/
|
|
355
|
-
this.name = "sky-checkbox-" + ++nextId;
|
|
356
|
-
/**
|
|
357
|
-
* Fires when the selected value changes.
|
|
358
|
-
*/
|
|
359
|
-
this.change = new i0.EventEmitter();
|
|
360
|
-
this.isFirstChange = true;
|
|
361
|
-
this._checked = false;
|
|
362
|
-
this._checkedChange = new rxjs.BehaviorSubject(this._checked);
|
|
363
|
-
this._disabled = false;
|
|
364
|
-
this._disabledChange = new rxjs.BehaviorSubject(this._disabled);
|
|
365
|
-
this._required = false;
|
|
366
|
-
/** Called when the checkbox is blurred. Needed to properly implement ControlValueAccessor. */
|
|
367
|
-
/*istanbul ignore next */
|
|
368
|
-
this.onTouched = function () { };
|
|
369
|
-
this._controlValueAccessorChangeFn = function (value) { };
|
|
370
|
-
if (this.ngControl) {
|
|
371
|
-
this.ngControl.valueAccessor = this;
|
|
372
|
-
}
|
|
373
|
-
}
|
|
374
|
-
Object.defineProperty(SkyCheckboxComponent.prototype, "disabled", {
|
|
375
|
-
/**
|
|
376
|
-
* Indicates whether the checkbox is disabled.
|
|
377
|
-
*/
|
|
378
|
-
get: function () {
|
|
379
|
-
return this._disabled;
|
|
380
|
-
},
|
|
381
|
-
/**
|
|
382
|
-
* Indicates whether to disable the checkbox.
|
|
383
|
-
* @default false
|
|
384
|
-
*/
|
|
385
|
-
set: function (value) {
|
|
386
|
-
var coercedValue = SkyFormsUtility.coerceBooleanProperty(value);
|
|
387
|
-
if (coercedValue !== this.disabled) {
|
|
388
|
-
this._disabled = coercedValue;
|
|
389
|
-
this._disabledChange.next(this._disabled);
|
|
390
|
-
}
|
|
391
|
-
},
|
|
392
|
-
enumerable: false,
|
|
393
|
-
configurable: true
|
|
394
|
-
});
|
|
395
|
-
Object.defineProperty(SkyCheckboxComponent.prototype, "checkboxType", {
|
|
396
|
-
get: function () {
|
|
397
|
-
return this._checkboxType || 'info';
|
|
398
|
-
},
|
|
399
|
-
/**
|
|
400
|
-
* Specifies a type to set the background color after users select a checkbox where the
|
|
401
|
-
* `icon` property displays an icon in place of the checkbox. The valid options correspond to
|
|
402
|
-
* [the label component's](https://developer.blackbaud.com/skyux/components/label)
|
|
403
|
-
* label types. `"info"` creates a blue background, `"success"` creates a green
|
|
404
|
-
* background, `"warning"` creates an orange background, and `"danger"` creates a red background.
|
|
405
|
-
* @default "info"
|
|
406
|
-
*/
|
|
407
|
-
set: function (value) {
|
|
408
|
-
if (value) {
|
|
409
|
-
this._checkboxType = value.toLowerCase();
|
|
410
|
-
}
|
|
411
|
-
},
|
|
412
|
-
enumerable: false,
|
|
413
|
-
configurable: true
|
|
414
|
-
});
|
|
415
|
-
Object.defineProperty(SkyCheckboxComponent.prototype, "inputId", {
|
|
416
|
-
get: function () {
|
|
417
|
-
return "input-" + this.id;
|
|
418
|
-
},
|
|
419
|
-
enumerable: false,
|
|
420
|
-
configurable: true
|
|
421
|
-
});
|
|
422
|
-
Object.defineProperty(SkyCheckboxComponent.prototype, "checked", {
|
|
423
|
-
/**
|
|
424
|
-
* Indicates whether the checkbox is selected.
|
|
425
|
-
*/
|
|
426
|
-
get: function () {
|
|
427
|
-
return this._checked;
|
|
428
|
-
},
|
|
429
|
-
/**
|
|
430
|
-
* Indicates whether the checkbox is selected.
|
|
431
|
-
* @default false
|
|
432
|
-
*/
|
|
433
|
-
set: function (checked) {
|
|
434
|
-
if (checked !== this.checked) {
|
|
435
|
-
this._checked = checked;
|
|
436
|
-
this._controlValueAccessorChangeFn(checked);
|
|
437
|
-
this._checkedChange.next(this._checked);
|
|
438
|
-
// Do not mark the field as "dirty"
|
|
439
|
-
// if the field has been initialized with a value.
|
|
440
|
-
if (this.isFirstChange && this.ngControl && this.ngControl.control) {
|
|
441
|
-
this.ngControl.control.markAsPristine();
|
|
442
|
-
this.isFirstChange = false;
|
|
443
|
-
}
|
|
444
|
-
}
|
|
445
|
-
},
|
|
446
|
-
enumerable: false,
|
|
447
|
-
configurable: true
|
|
448
|
-
});
|
|
449
|
-
Object.defineProperty(SkyCheckboxComponent.prototype, "required", {
|
|
450
|
-
get: function () {
|
|
451
|
-
return this._required;
|
|
452
|
-
},
|
|
453
|
-
/**
|
|
454
|
-
* Indicates whether the input is required for form validation.
|
|
455
|
-
* When you set this property to `true`, the component adds `aria-required` and `required`
|
|
456
|
-
* attributes to the input element so that forms display an invalid state until the input element
|
|
457
|
-
* is complete.
|
|
458
|
-
* @default false
|
|
459
|
-
*/
|
|
460
|
-
set: function (value) {
|
|
461
|
-
this._required = SkyFormsUtility.coerceBooleanProperty(value);
|
|
462
|
-
},
|
|
463
|
-
enumerable: false,
|
|
464
|
-
configurable: true
|
|
465
|
-
});
|
|
466
|
-
Object.defineProperty(SkyCheckboxComponent.prototype, "checkedChange", {
|
|
467
|
-
/**
|
|
468
|
-
* Fires when users select or deselect the checkbox.
|
|
469
|
-
*/
|
|
470
|
-
get: function () {
|
|
471
|
-
return this._checkedChange;
|
|
472
|
-
},
|
|
473
|
-
enumerable: false,
|
|
474
|
-
configurable: true
|
|
475
|
-
});
|
|
476
|
-
Object.defineProperty(SkyCheckboxComponent.prototype, "disabledChange", {
|
|
477
|
-
/**
|
|
478
|
-
* Fires when the selected value changes.
|
|
479
|
-
*/
|
|
480
|
-
get: function () {
|
|
481
|
-
return this._disabledChange;
|
|
482
|
-
},
|
|
483
|
-
enumerable: false,
|
|
484
|
-
configurable: true
|
|
485
|
-
});
|
|
486
|
-
SkyCheckboxComponent.prototype.ngOnInit = function () {
|
|
487
|
-
if (this.ngControl) {
|
|
488
|
-
// Backwards compatibility support for anyone still using Validators.Required.
|
|
489
|
-
this.required =
|
|
490
|
-
this.required || SkyFormsUtility.hasRequiredValidation(this.ngControl);
|
|
491
|
-
}
|
|
492
|
-
};
|
|
493
|
-
/**
|
|
494
|
-
* Implemented as part of ControlValueAccessor.
|
|
495
|
-
*/
|
|
496
|
-
SkyCheckboxComponent.prototype.writeValue = function (value) {
|
|
497
|
-
this.checked = !!value;
|
|
498
|
-
};
|
|
499
|
-
/**
|
|
500
|
-
* Implemented as part of ControlValueAccessor.
|
|
501
|
-
*/
|
|
502
|
-
SkyCheckboxComponent.prototype.registerOnChange = function (fn) {
|
|
503
|
-
this._controlValueAccessorChangeFn = fn;
|
|
504
|
-
};
|
|
505
|
-
/**
|
|
506
|
-
* Implemented as part of ControlValueAccessor.
|
|
507
|
-
*/
|
|
508
|
-
SkyCheckboxComponent.prototype.registerOnTouched = function (fn) {
|
|
509
|
-
this.onTouched = fn;
|
|
510
|
-
};
|
|
511
|
-
/**
|
|
512
|
-
* Implemented as part of ControlValueAccessor.
|
|
513
|
-
*/
|
|
514
|
-
SkyCheckboxComponent.prototype.setDisabledState = function (isDisabled) {
|
|
515
|
-
this.disabled = isDisabled;
|
|
516
|
-
};
|
|
517
|
-
/**
|
|
518
|
-
* Event handler for checkbox input element.
|
|
519
|
-
* Toggles checked state if element is not disabled.
|
|
520
|
-
*/
|
|
521
|
-
SkyCheckboxComponent.prototype.onInteractionEvent = function (event) {
|
|
522
|
-
// We always have to stop propagation on the change event.
|
|
523
|
-
// Otherwise the change event, from the input element, will bubble up and
|
|
524
|
-
// emit its event object to the `change` output.
|
|
525
|
-
event.stopPropagation();
|
|
526
|
-
if (!this.disabled) {
|
|
527
|
-
this._toggle();
|
|
528
|
-
this._emitChangeEvent();
|
|
529
|
-
}
|
|
530
|
-
};
|
|
531
|
-
SkyCheckboxComponent.prototype.onInputBlur = function () {
|
|
532
|
-
this.onTouched();
|
|
533
|
-
};
|
|
534
|
-
SkyCheckboxComponent.prototype._emitChangeEvent = function () {
|
|
535
|
-
var event = new SkyCheckboxChange();
|
|
536
|
-
event.source = this;
|
|
537
|
-
event.checked = this._checked;
|
|
538
|
-
this._controlValueAccessorChangeFn(this._checked);
|
|
539
|
-
this.change.emit(event);
|
|
540
|
-
};
|
|
541
|
-
/**
|
|
542
|
-
* Toggles the `checked` value between true and false
|
|
543
|
-
*/
|
|
544
|
-
SkyCheckboxComponent.prototype._toggle = function () {
|
|
545
|
-
this.checked = !this.checked;
|
|
546
|
-
};
|
|
547
|
-
return SkyCheckboxComponent;
|
|
548
|
-
}());
|
|
549
|
-
SkyCheckboxComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyCheckboxComponent, deps: [{ token: i4__namespace.NgControl, optional: true, self: true }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
550
|
-
SkyCheckboxComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: SkyCheckboxComponent, selector: "sky-checkbox", inputs: { label: "label", labelledBy: "labelledBy", id: "id", disabled: "disabled", tabindex: "tabindex", name: "name", icon: "icon", checkboxType: "checkboxType", checked: "checked", required: "required" }, outputs: { change: "change", checkedChange: "checkedChange", disabledChange: "disabledChange" }, ngImport: i0__namespace, template: "<label\n class=\"sky-checkbox-wrapper sky-switch\"\n [ngClass]=\"{\n 'sky-control-label-required': required,\n 'sky-switch-disabled': disabled\n }\"\n>\n <input\n class=\"sky-checkbox-input sky-switch-input\"\n type=\"checkbox\"\n [id]=\"inputId\"\n [checked]=\"checked\"\n [disabled]=\"disabled\"\n [name]=\"name\"\n [required]=\"required\"\n [tabIndex]=\"tabindex\"\n [attr.aria-label]=\"label\"\n [attr.aria-labelledby]=\"labelledBy\"\n [attr.aria-required]=\"required ? true : null\"\n (blur)=\"onInputBlur()\"\n (change)=\"onInteractionEvent($event)\"\n />\n <span\n class=\"sky-switch-control sky-rounded-corners\"\n [ngClass]=\"{\n 'sky-switch-control-icon': icon,\n 'sky-switch-control-info': checkboxType === 'info',\n 'sky-switch-control-success': checkboxType === 'success',\n 'sky-switch-control-warning': checkboxType === 'warning',\n 'sky-switch-control-danger': checkboxType === 'danger'\n }\"\n >\n <sky-icon\n *ngIf=\"icon || checked\"\n class=\"sky-checkbox-icon-default\"\n fixedWidth=\"true\"\n [icon]=\"icon || 'check'\"\n >\n </sky-icon>\n <div class=\"sky-checkbox-icon-modern\">\n <sky-icon\n *ngIf=\"icon; else checkedTemplate\"\n fixedWidth=\"true\"\n [icon]=\"icon\"\n >\n </sky-icon>\n <ng-template #checkedTemplate>\n <sky-icon\n *ngIf=\"checked\"\n class=\"sky-checkbox-icon-modern-checked\"\n fixedWidth=\"true\"\n icon=\"check\"\n iconType=\"skyux\"\n >\n </sky-icon>\n </ng-template>\n </div>\n </span>\n <ng-content select=\"sky-checkbox-label\"> </ng-content>\n</label>\n", styles: [".sky-checkbox-icon-modern{display:none}:host-context(.sky-theme-modern) .sky-checkbox-icon-default{display:none}:host-context(.sky-theme-modern) .sky-checkbox-icon-modern{display:inline}:host-context(.sky-theme-modern) .sky-checkbox-icon-modern-checked{color:#1870b8}:host-context(.sky-theme-modern) .sky-checkbox-input:disabled+.sky-switch-control .sky-checkbox-icon-modern-checked{color:#212327}:host-context(.sky-theme-modern) .sky-switch-control{border-radius:6px}.sky-theme-modern .sky-checkbox-icon-default{display:none}.sky-theme-modern .sky-checkbox-icon-modern{display:inline}.sky-theme-modern .sky-checkbox-icon-modern-checked{color:#1870b8}.sky-theme-modern .sky-checkbox-input:disabled+.sky-switch-control .sky-checkbox-icon-modern-checked{color:#212327}.sky-theme-modern .sky-switch-control{border-radius:6px}\n"], components: [{ type: i2__namespace$1.λ4, selector: "sky-icon", inputs: ["icon", "iconType", "size", "fixedWidth", "variant"] }], directives: [{ type: i1__namespace.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i1__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
|
|
551
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyCheckboxComponent, decorators: [{
|
|
552
|
-
type: i0.Component,
|
|
553
|
-
args: [{
|
|
554
|
-
selector: 'sky-checkbox',
|
|
555
|
-
template: "<label\n class=\"sky-checkbox-wrapper sky-switch\"\n [ngClass]=\"{\n 'sky-control-label-required': required,\n 'sky-switch-disabled': disabled\n }\"\n>\n <input\n class=\"sky-checkbox-input sky-switch-input\"\n type=\"checkbox\"\n [id]=\"inputId\"\n [checked]=\"checked\"\n [disabled]=\"disabled\"\n [name]=\"name\"\n [required]=\"required\"\n [tabIndex]=\"tabindex\"\n [attr.aria-label]=\"label\"\n [attr.aria-labelledby]=\"labelledBy\"\n [attr.aria-required]=\"required ? true : null\"\n (blur)=\"onInputBlur()\"\n (change)=\"onInteractionEvent($event)\"\n />\n <span\n class=\"sky-switch-control sky-rounded-corners\"\n [ngClass]=\"{\n 'sky-switch-control-icon': icon,\n 'sky-switch-control-info': checkboxType === 'info',\n 'sky-switch-control-success': checkboxType === 'success',\n 'sky-switch-control-warning': checkboxType === 'warning',\n 'sky-switch-control-danger': checkboxType === 'danger'\n }\"\n >\n <sky-icon\n *ngIf=\"icon || checked\"\n class=\"sky-checkbox-icon-default\"\n fixedWidth=\"true\"\n [icon]=\"icon || 'check'\"\n >\n </sky-icon>\n <div class=\"sky-checkbox-icon-modern\">\n <sky-icon\n *ngIf=\"icon; else checkedTemplate\"\n fixedWidth=\"true\"\n [icon]=\"icon\"\n >\n </sky-icon>\n <ng-template #checkedTemplate>\n <sky-icon\n *ngIf=\"checked\"\n class=\"sky-checkbox-icon-modern-checked\"\n fixedWidth=\"true\"\n icon=\"check\"\n iconType=\"skyux\"\n >\n </sky-icon>\n </ng-template>\n </div>\n </span>\n <ng-content select=\"sky-checkbox-label\"> </ng-content>\n</label>\n",
|
|
556
|
-
styles: [".sky-checkbox-icon-modern{display:none}:host-context(.sky-theme-modern) .sky-checkbox-icon-default{display:none}:host-context(.sky-theme-modern) .sky-checkbox-icon-modern{display:inline}:host-context(.sky-theme-modern) .sky-checkbox-icon-modern-checked{color:#1870b8}:host-context(.sky-theme-modern) .sky-checkbox-input:disabled+.sky-switch-control .sky-checkbox-icon-modern-checked{color:#212327}:host-context(.sky-theme-modern) .sky-switch-control{border-radius:6px}.sky-theme-modern .sky-checkbox-icon-default{display:none}.sky-theme-modern .sky-checkbox-icon-modern{display:inline}.sky-theme-modern .sky-checkbox-icon-modern-checked{color:#1870b8}.sky-theme-modern .sky-checkbox-input:disabled+.sky-switch-control .sky-checkbox-icon-modern-checked{color:#212327}.sky-theme-modern .sky-switch-control{border-radius:6px}\n"],
|
|
557
|
-
}]
|
|
558
|
-
}], ctorParameters: function () {
|
|
559
|
-
return [{ type: i4__namespace.NgControl, decorators: [{
|
|
560
|
-
type: i0.Self
|
|
561
|
-
}, {
|
|
562
|
-
type: i0.Optional
|
|
563
|
-
}] }];
|
|
564
|
-
}, propDecorators: { label: [{
|
|
565
|
-
type: i0.Input
|
|
566
|
-
}], labelledBy: [{
|
|
567
|
-
type: i0.Input
|
|
568
|
-
}], id: [{
|
|
569
|
-
type: i0.Input
|
|
570
|
-
}], disabled: [{
|
|
571
|
-
type: i0.Input
|
|
572
|
-
}], tabindex: [{
|
|
573
|
-
type: i0.Input
|
|
574
|
-
}], name: [{
|
|
575
|
-
type: i0.Input
|
|
576
|
-
}], change: [{
|
|
577
|
-
type: i0.Output
|
|
578
|
-
}], icon: [{
|
|
579
|
-
type: i0.Input
|
|
580
|
-
}], checkboxType: [{
|
|
581
|
-
type: i0.Input
|
|
582
|
-
}], checked: [{
|
|
583
|
-
type: i0.Input
|
|
584
|
-
}], required: [{
|
|
585
|
-
type: i0.Input
|
|
586
|
-
}], checkedChange: [{
|
|
587
|
-
type: i0.Output
|
|
588
|
-
}], disabledChange: [{
|
|
589
|
-
type: i0.Output
|
|
590
|
-
}] } });
|
|
591
|
-
|
|
592
302
|
/**
|
|
593
303
|
* Specifies a label for the checkbox.
|
|
594
304
|
*/
|
|
@@ -952,11 +662,303 @@
|
|
|
952
662
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyCheckboxRequiredValidatorDirective, decorators: [{
|
|
953
663
|
type: i0.Directive,
|
|
954
664
|
args: [{
|
|
955
|
-
// eslint-disable-next-line @angular-eslint/directive-selector
|
|
956
|
-
selector: "sky-checkbox[required][formControlName],\n sky-checkbox[required][formControl], sky-checkbox[required][ngModel]",
|
|
957
|
-
providers: [SKY_CHECKBOX_REQUIRED_VALIDATOR],
|
|
665
|
+
// eslint-disable-next-line @angular-eslint/directive-selector
|
|
666
|
+
selector: "sky-checkbox[required][formControlName],\n sky-checkbox[required][formControl], sky-checkbox[required][ngModel]",
|
|
667
|
+
providers: [SKY_CHECKBOX_REQUIRED_VALIDATOR],
|
|
668
|
+
}]
|
|
669
|
+
}] });
|
|
670
|
+
|
|
671
|
+
// Need to add the following to classes which contain static methods.
|
|
672
|
+
// See: https://github.com/ng-packagr/ng-packagr/issues/641
|
|
673
|
+
// @dynamic
|
|
674
|
+
var SkyFormsUtility = /** @class */ (function () {
|
|
675
|
+
function SkyFormsUtility() {
|
|
676
|
+
}
|
|
677
|
+
/** Coerces a data-bound value (typically a string) to a boolean. */
|
|
678
|
+
SkyFormsUtility.coerceBooleanProperty = function (value) {
|
|
679
|
+
return value !== undefined && "" + value !== 'false';
|
|
680
|
+
};
|
|
681
|
+
/**
|
|
682
|
+
* Gets the required state of the checkbox.
|
|
683
|
+
* Currently, Angular doesn't offer a way to get this easily, so we have to create an empty
|
|
684
|
+
* control using the current validator to see if it throws a `required` validation error.
|
|
685
|
+
* https://github.com/angular/angular/issues/13461#issuecomment-340368046
|
|
686
|
+
*/
|
|
687
|
+
SkyFormsUtility.hasRequiredValidation = function (ngControl) {
|
|
688
|
+
var abstractControl = ngControl.control;
|
|
689
|
+
if (abstractControl && abstractControl.validator) {
|
|
690
|
+
var validator = abstractControl.validator({});
|
|
691
|
+
if (validator && validator.required) {
|
|
692
|
+
return true;
|
|
693
|
+
}
|
|
694
|
+
}
|
|
695
|
+
return false;
|
|
696
|
+
};
|
|
697
|
+
return SkyFormsUtility;
|
|
698
|
+
}());
|
|
699
|
+
|
|
700
|
+
/**
|
|
701
|
+
* Monotonically increasing integer used to auto-generate unique ids for checkbox components.
|
|
702
|
+
*/
|
|
703
|
+
var nextId = 0;
|
|
704
|
+
/**
|
|
705
|
+
* Replaces the HTML input element with `type="checkbox"`. When users select a checkbox, its value
|
|
706
|
+
* is driven through an `ngModel` attribute that you specify on the `sky-checkbox` element.
|
|
707
|
+
*/
|
|
708
|
+
var SkyCheckboxComponent = /** @class */ (function () {
|
|
709
|
+
function SkyCheckboxComponent(ngControl) {
|
|
710
|
+
this.ngControl = ngControl;
|
|
711
|
+
/**
|
|
712
|
+
* Specifies an ID for the checkbox.
|
|
713
|
+
* @default a unique, auto-incrementing integer. For example: `sky-checkbox-1`
|
|
714
|
+
*/
|
|
715
|
+
this.id = "sky-checkbox-" + ++nextId;
|
|
716
|
+
/**
|
|
717
|
+
* Specifies an index for the checkbox. If not defined, the index is set to the position of the
|
|
718
|
+
* checkbox on load.
|
|
719
|
+
*/
|
|
720
|
+
this.tabindex = 0;
|
|
721
|
+
/**
|
|
722
|
+
* Specifies a name for a group of checkboxes.
|
|
723
|
+
* @default a unique, auto-incrementing integer. For example: `sky-checkbox-1`
|
|
724
|
+
*/
|
|
725
|
+
this.name = "sky-checkbox-" + ++nextId;
|
|
726
|
+
/**
|
|
727
|
+
* Fires when the selected value changes.
|
|
728
|
+
*/
|
|
729
|
+
this.change = new i0.EventEmitter();
|
|
730
|
+
this.isFirstChange = true;
|
|
731
|
+
this._checked = false;
|
|
732
|
+
this._checkedChange = new rxjs.BehaviorSubject(this._checked);
|
|
733
|
+
this._disabled = false;
|
|
734
|
+
this._disabledChange = new rxjs.BehaviorSubject(this._disabled);
|
|
735
|
+
this._required = false;
|
|
736
|
+
/** Called when the checkbox is blurred. Needed to properly implement ControlValueAccessor. */
|
|
737
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
738
|
+
this.onTouched = function () { };
|
|
739
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
740
|
+
this._controlValueAccessorChangeFn = function (value) { };
|
|
741
|
+
if (this.ngControl) {
|
|
742
|
+
this.ngControl.valueAccessor = this;
|
|
743
|
+
}
|
|
744
|
+
}
|
|
745
|
+
Object.defineProperty(SkyCheckboxComponent.prototype, "disabled", {
|
|
746
|
+
/**
|
|
747
|
+
* Indicates whether the checkbox is disabled.
|
|
748
|
+
*/
|
|
749
|
+
get: function () {
|
|
750
|
+
return this._disabled;
|
|
751
|
+
},
|
|
752
|
+
/**
|
|
753
|
+
* Indicates whether to disable the checkbox.
|
|
754
|
+
* @default false
|
|
755
|
+
*/
|
|
756
|
+
set: function (value) {
|
|
757
|
+
var coercedValue = SkyFormsUtility.coerceBooleanProperty(value);
|
|
758
|
+
if (coercedValue !== this.disabled) {
|
|
759
|
+
this._disabled = coercedValue;
|
|
760
|
+
this._disabledChange.next(this._disabled);
|
|
761
|
+
}
|
|
762
|
+
},
|
|
763
|
+
enumerable: false,
|
|
764
|
+
configurable: true
|
|
765
|
+
});
|
|
766
|
+
Object.defineProperty(SkyCheckboxComponent.prototype, "checkboxType", {
|
|
767
|
+
get: function () {
|
|
768
|
+
return this._checkboxType || 'info';
|
|
769
|
+
},
|
|
770
|
+
/**
|
|
771
|
+
* Specifies a type to set the background color after users select a checkbox where the
|
|
772
|
+
* `icon` property displays an icon in place of the checkbox. The valid options correspond to
|
|
773
|
+
* [the label component's](https://developer.blackbaud.com/skyux/components/label)
|
|
774
|
+
* label types. `"info"` creates a blue background, `"success"` creates a green
|
|
775
|
+
* background, `"warning"` creates an orange background, and `"danger"` creates a red background.
|
|
776
|
+
* @default "info"
|
|
777
|
+
*/
|
|
778
|
+
set: function (value) {
|
|
779
|
+
if (value) {
|
|
780
|
+
this._checkboxType = value.toLowerCase();
|
|
781
|
+
}
|
|
782
|
+
},
|
|
783
|
+
enumerable: false,
|
|
784
|
+
configurable: true
|
|
785
|
+
});
|
|
786
|
+
Object.defineProperty(SkyCheckboxComponent.prototype, "inputId", {
|
|
787
|
+
get: function () {
|
|
788
|
+
return "input-" + this.id;
|
|
789
|
+
},
|
|
790
|
+
enumerable: false,
|
|
791
|
+
configurable: true
|
|
792
|
+
});
|
|
793
|
+
Object.defineProperty(SkyCheckboxComponent.prototype, "checked", {
|
|
794
|
+
/**
|
|
795
|
+
* Indicates whether the checkbox is selected.
|
|
796
|
+
*/
|
|
797
|
+
get: function () {
|
|
798
|
+
return this._checked;
|
|
799
|
+
},
|
|
800
|
+
/**
|
|
801
|
+
* Indicates whether the checkbox is selected.
|
|
802
|
+
* @default false
|
|
803
|
+
*/
|
|
804
|
+
set: function (checked) {
|
|
805
|
+
if (checked !== this.checked) {
|
|
806
|
+
this._checked = checked;
|
|
807
|
+
this._controlValueAccessorChangeFn(checked);
|
|
808
|
+
this._checkedChange.next(this._checked);
|
|
809
|
+
// Do not mark the field as "dirty"
|
|
810
|
+
// if the field has been initialized with a value.
|
|
811
|
+
if (this.isFirstChange && this.ngControl && this.ngControl.control) {
|
|
812
|
+
this.ngControl.control.markAsPristine();
|
|
813
|
+
this.isFirstChange = false;
|
|
814
|
+
}
|
|
815
|
+
}
|
|
816
|
+
},
|
|
817
|
+
enumerable: false,
|
|
818
|
+
configurable: true
|
|
819
|
+
});
|
|
820
|
+
Object.defineProperty(SkyCheckboxComponent.prototype, "required", {
|
|
821
|
+
get: function () {
|
|
822
|
+
return this._required;
|
|
823
|
+
},
|
|
824
|
+
/**
|
|
825
|
+
* Indicates whether the input is required for form validation.
|
|
826
|
+
* When you set this property to `true`, the component adds `aria-required` and `required`
|
|
827
|
+
* attributes to the input element so that forms display an invalid state until the input element
|
|
828
|
+
* is complete.
|
|
829
|
+
* @default false
|
|
830
|
+
*/
|
|
831
|
+
set: function (value) {
|
|
832
|
+
this._required = SkyFormsUtility.coerceBooleanProperty(value);
|
|
833
|
+
},
|
|
834
|
+
enumerable: false,
|
|
835
|
+
configurable: true
|
|
836
|
+
});
|
|
837
|
+
Object.defineProperty(SkyCheckboxComponent.prototype, "checkedChange", {
|
|
838
|
+
/**
|
|
839
|
+
* Fires when users select or deselect the checkbox.
|
|
840
|
+
*/
|
|
841
|
+
get: function () {
|
|
842
|
+
return this._checkedChange;
|
|
843
|
+
},
|
|
844
|
+
enumerable: false,
|
|
845
|
+
configurable: true
|
|
846
|
+
});
|
|
847
|
+
Object.defineProperty(SkyCheckboxComponent.prototype, "disabledChange", {
|
|
848
|
+
/**
|
|
849
|
+
* Fires when the selected value changes.
|
|
850
|
+
*/
|
|
851
|
+
get: function () {
|
|
852
|
+
return this._disabledChange;
|
|
853
|
+
},
|
|
854
|
+
enumerable: false,
|
|
855
|
+
configurable: true
|
|
856
|
+
});
|
|
857
|
+
SkyCheckboxComponent.prototype.ngOnInit = function () {
|
|
858
|
+
if (this.ngControl) {
|
|
859
|
+
// Backwards compatibility support for anyone still using Validators.Required.
|
|
860
|
+
this.required =
|
|
861
|
+
this.required || SkyFormsUtility.hasRequiredValidation(this.ngControl);
|
|
862
|
+
}
|
|
863
|
+
};
|
|
864
|
+
/**
|
|
865
|
+
* Implemented as part of ControlValueAccessor.
|
|
866
|
+
*/
|
|
867
|
+
SkyCheckboxComponent.prototype.writeValue = function (value) {
|
|
868
|
+
this.checked = !!value;
|
|
869
|
+
};
|
|
870
|
+
/**
|
|
871
|
+
* Implemented as part of ControlValueAccessor.
|
|
872
|
+
*/
|
|
873
|
+
SkyCheckboxComponent.prototype.registerOnChange = function (fn) {
|
|
874
|
+
this._controlValueAccessorChangeFn = fn;
|
|
875
|
+
};
|
|
876
|
+
/**
|
|
877
|
+
* Implemented as part of ControlValueAccessor.
|
|
878
|
+
*/
|
|
879
|
+
SkyCheckboxComponent.prototype.registerOnTouched = function (fn) {
|
|
880
|
+
this.onTouched = fn;
|
|
881
|
+
};
|
|
882
|
+
/**
|
|
883
|
+
* Implemented as part of ControlValueAccessor.
|
|
884
|
+
*/
|
|
885
|
+
SkyCheckboxComponent.prototype.setDisabledState = function (isDisabled) {
|
|
886
|
+
this.disabled = isDisabled;
|
|
887
|
+
};
|
|
888
|
+
/**
|
|
889
|
+
* Event handler for checkbox input element.
|
|
890
|
+
* Toggles checked state if element is not disabled.
|
|
891
|
+
*/
|
|
892
|
+
SkyCheckboxComponent.prototype.onInteractionEvent = function (event) {
|
|
893
|
+
// We always have to stop propagation on the change event.
|
|
894
|
+
// Otherwise the change event, from the input element, will bubble up and
|
|
895
|
+
// emit its event object to the `change` output.
|
|
896
|
+
event.stopPropagation();
|
|
897
|
+
if (!this.disabled) {
|
|
898
|
+
this._toggle();
|
|
899
|
+
this._emitChangeEvent();
|
|
900
|
+
}
|
|
901
|
+
};
|
|
902
|
+
SkyCheckboxComponent.prototype.onInputBlur = function () {
|
|
903
|
+
this.onTouched();
|
|
904
|
+
};
|
|
905
|
+
SkyCheckboxComponent.prototype._emitChangeEvent = function () {
|
|
906
|
+
var event = new SkyCheckboxChange();
|
|
907
|
+
event.source = this;
|
|
908
|
+
event.checked = this._checked;
|
|
909
|
+
this._controlValueAccessorChangeFn(this._checked);
|
|
910
|
+
this.change.emit(event);
|
|
911
|
+
};
|
|
912
|
+
/**
|
|
913
|
+
* Toggles the `checked` value between true and false
|
|
914
|
+
*/
|
|
915
|
+
SkyCheckboxComponent.prototype._toggle = function () {
|
|
916
|
+
this.checked = !this.checked;
|
|
917
|
+
};
|
|
918
|
+
return SkyCheckboxComponent;
|
|
919
|
+
}());
|
|
920
|
+
SkyCheckboxComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyCheckboxComponent, deps: [{ token: i4__namespace.NgControl, optional: true, self: true }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
921
|
+
SkyCheckboxComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: SkyCheckboxComponent, selector: "sky-checkbox", inputs: { label: "label", labelledBy: "labelledBy", id: "id", disabled: "disabled", tabindex: "tabindex", name: "name", icon: "icon", checkboxType: "checkboxType", checked: "checked", required: "required" }, outputs: { change: "change", checkedChange: "checkedChange", disabledChange: "disabledChange" }, ngImport: i0__namespace, template: "<label\n class=\"sky-checkbox-wrapper sky-switch\"\n [ngClass]=\"{\n 'sky-control-label-required': required,\n 'sky-switch-disabled': disabled\n }\"\n>\n <input\n class=\"sky-checkbox-input sky-switch-input\"\n type=\"checkbox\"\n [id]=\"inputId\"\n [checked]=\"checked\"\n [disabled]=\"disabled\"\n [name]=\"name\"\n [required]=\"required\"\n [tabIndex]=\"tabindex\"\n [attr.aria-label]=\"label\"\n [attr.aria-labelledby]=\"labelledBy\"\n [attr.aria-required]=\"required ? true : null\"\n (blur)=\"onInputBlur()\"\n (change)=\"onInteractionEvent($event)\"\n />\n <span\n class=\"sky-switch-control sky-rounded-corners\"\n [ngClass]=\"{\n 'sky-switch-control-icon': icon,\n 'sky-switch-control-info': checkboxType === 'info',\n 'sky-switch-control-success': checkboxType === 'success',\n 'sky-switch-control-warning': checkboxType === 'warning',\n 'sky-switch-control-danger': checkboxType === 'danger'\n }\"\n >\n <sky-icon\n *ngIf=\"icon || checked\"\n class=\"sky-checkbox-icon-default\"\n fixedWidth=\"true\"\n [icon]=\"icon || 'check'\"\n >\n </sky-icon>\n <div class=\"sky-checkbox-icon-modern\">\n <sky-icon\n *ngIf=\"icon; else checkedTemplate\"\n fixedWidth=\"true\"\n [icon]=\"icon\"\n >\n </sky-icon>\n <ng-template #checkedTemplate>\n <sky-icon\n *ngIf=\"checked\"\n class=\"sky-checkbox-icon-modern-checked\"\n fixedWidth=\"true\"\n icon=\"check\"\n iconType=\"skyux\"\n >\n </sky-icon>\n </ng-template>\n </div>\n </span>\n <ng-content select=\"sky-checkbox-label\"> </ng-content>\n</label>\n", styles: [".sky-checkbox-icon-modern{display:none}:host-context(.sky-theme-modern) .sky-checkbox-icon-default{display:none}:host-context(.sky-theme-modern) .sky-checkbox-icon-modern{display:inline}:host-context(.sky-theme-modern) .sky-checkbox-icon-modern-checked{color:#1870b8}:host-context(.sky-theme-modern) .sky-checkbox-input:disabled+.sky-switch-control .sky-checkbox-icon-modern-checked{color:#212327}:host-context(.sky-theme-modern) .sky-switch-control{border-radius:6px}.sky-theme-modern .sky-checkbox-icon-default{display:none}.sky-theme-modern .sky-checkbox-icon-modern{display:inline}.sky-theme-modern .sky-checkbox-icon-modern-checked{color:#1870b8}.sky-theme-modern .sky-checkbox-input:disabled+.sky-switch-control .sky-checkbox-icon-modern-checked{color:#212327}.sky-theme-modern .sky-switch-control{border-radius:6px}\n"], components: [{ type: i2__namespace$1.λ4, selector: "sky-icon", inputs: ["icon", "iconType", "size", "fixedWidth", "variant"] }], directives: [{ type: i1__namespace.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i1__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
|
|
922
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyCheckboxComponent, decorators: [{
|
|
923
|
+
type: i0.Component,
|
|
924
|
+
args: [{
|
|
925
|
+
selector: 'sky-checkbox',
|
|
926
|
+
template: "<label\n class=\"sky-checkbox-wrapper sky-switch\"\n [ngClass]=\"{\n 'sky-control-label-required': required,\n 'sky-switch-disabled': disabled\n }\"\n>\n <input\n class=\"sky-checkbox-input sky-switch-input\"\n type=\"checkbox\"\n [id]=\"inputId\"\n [checked]=\"checked\"\n [disabled]=\"disabled\"\n [name]=\"name\"\n [required]=\"required\"\n [tabIndex]=\"tabindex\"\n [attr.aria-label]=\"label\"\n [attr.aria-labelledby]=\"labelledBy\"\n [attr.aria-required]=\"required ? true : null\"\n (blur)=\"onInputBlur()\"\n (change)=\"onInteractionEvent($event)\"\n />\n <span\n class=\"sky-switch-control sky-rounded-corners\"\n [ngClass]=\"{\n 'sky-switch-control-icon': icon,\n 'sky-switch-control-info': checkboxType === 'info',\n 'sky-switch-control-success': checkboxType === 'success',\n 'sky-switch-control-warning': checkboxType === 'warning',\n 'sky-switch-control-danger': checkboxType === 'danger'\n }\"\n >\n <sky-icon\n *ngIf=\"icon || checked\"\n class=\"sky-checkbox-icon-default\"\n fixedWidth=\"true\"\n [icon]=\"icon || 'check'\"\n >\n </sky-icon>\n <div class=\"sky-checkbox-icon-modern\">\n <sky-icon\n *ngIf=\"icon; else checkedTemplate\"\n fixedWidth=\"true\"\n [icon]=\"icon\"\n >\n </sky-icon>\n <ng-template #checkedTemplate>\n <sky-icon\n *ngIf=\"checked\"\n class=\"sky-checkbox-icon-modern-checked\"\n fixedWidth=\"true\"\n icon=\"check\"\n iconType=\"skyux\"\n >\n </sky-icon>\n </ng-template>\n </div>\n </span>\n <ng-content select=\"sky-checkbox-label\"> </ng-content>\n</label>\n",
|
|
927
|
+
styles: [".sky-checkbox-icon-modern{display:none}:host-context(.sky-theme-modern) .sky-checkbox-icon-default{display:none}:host-context(.sky-theme-modern) .sky-checkbox-icon-modern{display:inline}:host-context(.sky-theme-modern) .sky-checkbox-icon-modern-checked{color:#1870b8}:host-context(.sky-theme-modern) .sky-checkbox-input:disabled+.sky-switch-control .sky-checkbox-icon-modern-checked{color:#212327}:host-context(.sky-theme-modern) .sky-switch-control{border-radius:6px}.sky-theme-modern .sky-checkbox-icon-default{display:none}.sky-theme-modern .sky-checkbox-icon-modern{display:inline}.sky-theme-modern .sky-checkbox-icon-modern-checked{color:#1870b8}.sky-theme-modern .sky-checkbox-input:disabled+.sky-switch-control .sky-checkbox-icon-modern-checked{color:#212327}.sky-theme-modern .sky-switch-control{border-radius:6px}\n"],
|
|
958
928
|
}]
|
|
959
|
-
}]
|
|
929
|
+
}], ctorParameters: function () {
|
|
930
|
+
return [{ type: i4__namespace.NgControl, decorators: [{
|
|
931
|
+
type: i0.Self
|
|
932
|
+
}, {
|
|
933
|
+
type: i0.Optional
|
|
934
|
+
}] }];
|
|
935
|
+
}, propDecorators: { label: [{
|
|
936
|
+
type: i0.Input
|
|
937
|
+
}], labelledBy: [{
|
|
938
|
+
type: i0.Input
|
|
939
|
+
}], id: [{
|
|
940
|
+
type: i0.Input
|
|
941
|
+
}], disabled: [{
|
|
942
|
+
type: i0.Input
|
|
943
|
+
}], tabindex: [{
|
|
944
|
+
type: i0.Input
|
|
945
|
+
}], name: [{
|
|
946
|
+
type: i0.Input
|
|
947
|
+
}], change: [{
|
|
948
|
+
type: i0.Output
|
|
949
|
+
}], icon: [{
|
|
950
|
+
type: i0.Input
|
|
951
|
+
}], checkboxType: [{
|
|
952
|
+
type: i0.Input
|
|
953
|
+
}], checked: [{
|
|
954
|
+
type: i0.Input
|
|
955
|
+
}], required: [{
|
|
956
|
+
type: i0.Input
|
|
957
|
+
}], checkedChange: [{
|
|
958
|
+
type: i0.Output
|
|
959
|
+
}], disabledChange: [{
|
|
960
|
+
type: i0.Output
|
|
961
|
+
}] } });
|
|
960
962
|
|
|
961
963
|
var SkyCheckboxModule = /** @class */ (function () {
|
|
962
964
|
function SkyCheckboxModule() {
|
|
@@ -1036,7 +1038,7 @@
|
|
|
1036
1038
|
}
|
|
1037
1039
|
else if (validateFn) {
|
|
1038
1040
|
var errorParam = validateFn(fileItem);
|
|
1039
|
-
if (
|
|
1041
|
+
if (errorParam) {
|
|
1040
1042
|
fileItem.errorType = 'validate';
|
|
1041
1043
|
fileItem.errorParam = errorParam;
|
|
1042
1044
|
}
|
|
@@ -1119,8 +1121,8 @@
|
|
|
1119
1121
|
/* tslint:enable */
|
|
1120
1122
|
};
|
|
1121
1123
|
SkyFileItemService.prototype.isImage = function (fileItem) {
|
|
1122
|
-
var fileTypeUpper = this.getFileTypeUpper(fileItem)
|
|
1123
|
-
slashIndex = fileTypeUpper.indexOf('/');
|
|
1124
|
+
var fileTypeUpper = this.getFileTypeUpper(fileItem);
|
|
1125
|
+
var slashIndex = fileTypeUpper.indexOf('/');
|
|
1124
1126
|
if (slashIndex >= 0) {
|
|
1125
1127
|
switch (fileTypeUpper.substr(fileTypeUpper.indexOf('/') + 1)) {
|
|
1126
1128
|
case 'BMP':
|
|
@@ -1208,16 +1210,16 @@
|
|
|
1208
1210
|
/**
|
|
1209
1211
|
* Indicates whether the input is required for form validation.
|
|
1210
1212
|
* When you set this property to `true`, the component adds `aria-required` and `required`
|
|
1211
|
-
* attributes to the input element so that forms display an invalid state until the
|
|
1213
|
+
* attributes to the input element so that forms display an invalid state until the input element
|
|
1212
1214
|
* is complete.
|
|
1213
1215
|
*/
|
|
1214
1216
|
this.required = false;
|
|
1215
1217
|
this.fileAttachmentId = uniqueId$1++;
|
|
1216
1218
|
this.ngUnsubscribe = new rxjs.Subject();
|
|
1217
1219
|
this._disabled = false;
|
|
1218
|
-
|
|
1220
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
1219
1221
|
this._onChange = function (_) { };
|
|
1220
|
-
|
|
1222
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
1221
1223
|
this._onTouched = function () { };
|
|
1222
1224
|
this.labelElementId = "sky-file-attachment-label-" + this.fileAttachmentId;
|
|
1223
1225
|
this.fileDropDescriptionElementId = "sky-file-attachment-drop-description-" + this.fileAttachmentId;
|
|
@@ -1684,7 +1686,6 @@
|
|
|
1684
1686
|
var validFileArray = [];
|
|
1685
1687
|
var rejectedFileArray = [];
|
|
1686
1688
|
var totalFiles = files.length;
|
|
1687
|
-
var fileDrop = this;
|
|
1688
1689
|
// tslint:disable-next-line: max-line-length
|
|
1689
1690
|
var processedFiles = this.fileAttachmentService.checkFiles(files, this.minFileSize, this.maxFileSize, this.acceptedTypes, this.validateFn);
|
|
1690
1691
|
try {
|
|
@@ -1694,7 +1695,7 @@
|
|
|
1694
1695
|
this.filesRejected(file, validFileArray, rejectedFileArray, totalFiles);
|
|
1695
1696
|
}
|
|
1696
1697
|
else {
|
|
1697
|
-
this.loadFile(
|
|
1698
|
+
this.loadFile(this, file, validFileArray, rejectedFileArray, totalFiles);
|
|
1698
1699
|
}
|
|
1699
1700
|
}
|
|
1700
1701
|
}
|
|
@@ -1756,7 +1757,7 @@
|
|
|
1756
1757
|
this.resourcesService = resourcesService;
|
|
1757
1758
|
}
|
|
1758
1759
|
SkyFileSizePipe.prototype.transform = function (input) {
|
|
1759
|
-
var decimalPlaces = 0, dividend = 1,
|
|
1760
|
+
var decimalPlaces = 0, dividend = 1, template;
|
|
1760
1761
|
/* tslint:disable */
|
|
1761
1762
|
if (input === null || input === undefined) {
|
|
1762
1763
|
return '';
|
|
@@ -1782,10 +1783,9 @@
|
|
|
1782
1783
|
dividend = 1e9;
|
|
1783
1784
|
decimalPlaces = 1;
|
|
1784
1785
|
}
|
|
1785
|
-
roundedSize =
|
|
1786
|
-
Math.
|
|
1787
|
-
|
|
1788
|
-
formattedSize = this.decimalPipe.transform(roundedSize, '.0-3');
|
|
1786
|
+
var roundedSize = Math.floor(input / (dividend / Math.pow(10, decimalPlaces))) /
|
|
1787
|
+
Math.pow(10, decimalPlaces);
|
|
1788
|
+
var formattedSize = this.decimalPipe.transform(roundedSize, '.0-3');
|
|
1789
1789
|
return this.getString(template, formattedSize);
|
|
1790
1790
|
};
|
|
1791
1791
|
SkyFileSizePipe.prototype.getString = function (key) {
|
|
@@ -1843,7 +1843,9 @@
|
|
|
1843
1843
|
SkyFileItemComponent.prototype.ngDoCheck = function () {
|
|
1844
1844
|
var changes = this.differ.diff(this.fileItem);
|
|
1845
1845
|
if (changes) {
|
|
1846
|
-
var cls = void 0
|
|
1846
|
+
var cls = void 0;
|
|
1847
|
+
var extensionUpper = this.fileItemService.getFileExtensionUpper(this.fileItem);
|
|
1848
|
+
var fileTypeUpper = void 0;
|
|
1847
1849
|
switch (extensionUpper) {
|
|
1848
1850
|
case '.PDF':
|
|
1849
1851
|
cls = 'pdf';
|
|
@@ -2188,11 +2190,11 @@
|
|
|
2188
2190
|
this._checkedChange = new rxjs.BehaviorSubject(this._checked);
|
|
2189
2191
|
this._disabled = false;
|
|
2190
2192
|
this._disabledChange = new rxjs.BehaviorSubject(this._disabled);
|
|
2191
|
-
|
|
2193
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
2192
2194
|
this.removeUniqueSelectionListener = function () { };
|
|
2193
|
-
|
|
2195
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
2194
2196
|
this.onChangeCallback = function (value) { };
|
|
2195
|
-
|
|
2197
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
2196
2198
|
this.onTouchedCallback = function () { };
|
|
2197
2199
|
}
|
|
2198
2200
|
Object.defineProperty(SkyRadioComponent.prototype, "checked", {
|
|
@@ -2455,33 +2457,6 @@
|
|
|
2455
2457
|
type: i0.Output
|
|
2456
2458
|
}] } });
|
|
2457
2459
|
|
|
2458
|
-
/**
|
|
2459
|
-
* Specifies a label for the radio button.
|
|
2460
|
-
*/
|
|
2461
|
-
var SkyRadioLabelComponent = /** @class */ (function () {
|
|
2462
|
-
function SkyRadioLabelComponent() {
|
|
2463
|
-
}
|
|
2464
|
-
// When clicking on a checkbox label, Angular registers two click events.
|
|
2465
|
-
// This handler ignores all events except for those that deal
|
|
2466
|
-
// with the checkbox input explicitly.
|
|
2467
|
-
SkyRadioLabelComponent.prototype.onClick = function (event) {
|
|
2468
|
-
event.stopPropagation();
|
|
2469
|
-
};
|
|
2470
|
-
return SkyRadioLabelComponent;
|
|
2471
|
-
}());
|
|
2472
|
-
SkyRadioLabelComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyRadioLabelComponent, deps: [], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
2473
|
-
SkyRadioLabelComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: SkyRadioLabelComponent, selector: "sky-radio-label", host: { listeners: { "click": "onClick($event)" } }, ngImport: i0__namespace, template: "<span class=\"sky-switch-label\">\n <ng-content></ng-content>\n</span>\n" });
|
|
2474
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyRadioLabelComponent, decorators: [{
|
|
2475
|
-
type: i0.Component,
|
|
2476
|
-
args: [{
|
|
2477
|
-
selector: 'sky-radio-label',
|
|
2478
|
-
template: "<span class=\"sky-switch-label\">\n <ng-content></ng-content>\n</span>\n",
|
|
2479
|
-
}]
|
|
2480
|
-
}], propDecorators: { onClick: [{
|
|
2481
|
-
type: i0.HostListener,
|
|
2482
|
-
args: ['click', ['$event']]
|
|
2483
|
-
}] } });
|
|
2484
|
-
|
|
2485
2460
|
var nextUniqueId = 0;
|
|
2486
2461
|
/**
|
|
2487
2462
|
* Organizes radio buttons into a group. It is required for radio
|
|
@@ -2496,7 +2471,7 @@
|
|
|
2496
2471
|
/**
|
|
2497
2472
|
* Indicates whether the input is required for form validation.
|
|
2498
2473
|
* When you set this property to `true`, the component adds `aria-required` and `required`
|
|
2499
|
-
* attributes to the input element so that forms display an invalid state until the
|
|
2474
|
+
* attributes to the input element so that forms display an invalid state until the input element
|
|
2500
2475
|
* is complete.
|
|
2501
2476
|
* @default false
|
|
2502
2477
|
*/
|
|
@@ -2504,9 +2479,9 @@
|
|
|
2504
2479
|
this.ngUnsubscribe = new rxjs.Subject();
|
|
2505
2480
|
this._disabled = false;
|
|
2506
2481
|
this._name = "sky-radio-group-" + nextUniqueId++;
|
|
2507
|
-
|
|
2482
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
2508
2483
|
this.onChange = function () { };
|
|
2509
|
-
|
|
2484
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
2510
2485
|
this.onTouched = function () { };
|
|
2511
2486
|
if (this.ngControl) {
|
|
2512
2487
|
this.ngControl.valueAccessor = this;
|
|
@@ -2722,6 +2697,33 @@
|
|
|
2722
2697
|
args: [SkyRadioComponent, { descendants: true }]
|
|
2723
2698
|
}] } });
|
|
2724
2699
|
|
|
2700
|
+
/**
|
|
2701
|
+
* Specifies a label for the radio button.
|
|
2702
|
+
*/
|
|
2703
|
+
var SkyRadioLabelComponent = /** @class */ (function () {
|
|
2704
|
+
function SkyRadioLabelComponent() {
|
|
2705
|
+
}
|
|
2706
|
+
// When clicking on a checkbox label, Angular registers two click events.
|
|
2707
|
+
// This handler ignores all events except for those that deal
|
|
2708
|
+
// with the checkbox input explicitly.
|
|
2709
|
+
SkyRadioLabelComponent.prototype.onClick = function (event) {
|
|
2710
|
+
event.stopPropagation();
|
|
2711
|
+
};
|
|
2712
|
+
return SkyRadioLabelComponent;
|
|
2713
|
+
}());
|
|
2714
|
+
SkyRadioLabelComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyRadioLabelComponent, deps: [], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
2715
|
+
SkyRadioLabelComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: SkyRadioLabelComponent, selector: "sky-radio-label", host: { listeners: { "click": "onClick($event)" } }, ngImport: i0__namespace, template: "<span class=\"sky-switch-label\">\n <ng-content></ng-content>\n</span>\n" });
|
|
2716
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyRadioLabelComponent, decorators: [{
|
|
2717
|
+
type: i0.Component,
|
|
2718
|
+
args: [{
|
|
2719
|
+
selector: 'sky-radio-label',
|
|
2720
|
+
template: "<span class=\"sky-switch-label\">\n <ng-content></ng-content>\n</span>\n",
|
|
2721
|
+
}]
|
|
2722
|
+
}], propDecorators: { onClick: [{
|
|
2723
|
+
type: i0.HostListener,
|
|
2724
|
+
args: ['click', ['$event']]
|
|
2725
|
+
}] } });
|
|
2726
|
+
|
|
2725
2727
|
var SkyRadioModule = /** @class */ (function () {
|
|
2726
2728
|
function SkyRadioModule() {
|
|
2727
2729
|
}
|
|
@@ -2884,24 +2886,6 @@
|
|
|
2884
2886
|
}]
|
|
2885
2887
|
}] });
|
|
2886
2888
|
|
|
2887
|
-
/**
|
|
2888
|
-
* Specifies the header to display in a selection box.
|
|
2889
|
-
*/
|
|
2890
|
-
var SkySelectionBoxHeaderComponent = /** @class */ (function () {
|
|
2891
|
-
function SkySelectionBoxHeaderComponent() {
|
|
2892
|
-
}
|
|
2893
|
-
return SkySelectionBoxHeaderComponent;
|
|
2894
|
-
}());
|
|
2895
|
-
SkySelectionBoxHeaderComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkySelectionBoxHeaderComponent, deps: [], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
2896
|
-
SkySelectionBoxHeaderComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: SkySelectionBoxHeaderComponent, selector: "sky-selection-box-header", ngImport: i0__namespace, template: "<ng-content></ng-content>\n" });
|
|
2897
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkySelectionBoxHeaderComponent, decorators: [{
|
|
2898
|
-
type: i0.Component,
|
|
2899
|
-
args: [{
|
|
2900
|
-
selector: 'sky-selection-box-header',
|
|
2901
|
-
template: "<ng-content></ng-content>\n",
|
|
2902
|
-
}]
|
|
2903
|
-
}] });
|
|
2904
|
-
|
|
2905
2889
|
/**
|
|
2906
2890
|
* Creates a button to present users with a choice or question before proceeding with a one-time process.
|
|
2907
2891
|
*/
|
|
@@ -3144,6 +3128,24 @@
|
|
|
3144
3128
|
args: ['window:resize']
|
|
3145
3129
|
}] } });
|
|
3146
3130
|
|
|
3131
|
+
/**
|
|
3132
|
+
* Specifies the header to display in a selection box.
|
|
3133
|
+
*/
|
|
3134
|
+
var SkySelectionBoxHeaderComponent = /** @class */ (function () {
|
|
3135
|
+
function SkySelectionBoxHeaderComponent() {
|
|
3136
|
+
}
|
|
3137
|
+
return SkySelectionBoxHeaderComponent;
|
|
3138
|
+
}());
|
|
3139
|
+
SkySelectionBoxHeaderComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkySelectionBoxHeaderComponent, deps: [], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
3140
|
+
SkySelectionBoxHeaderComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: SkySelectionBoxHeaderComponent, selector: "sky-selection-box-header", ngImport: i0__namespace, template: "<ng-content></ng-content>\n" });
|
|
3141
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkySelectionBoxHeaderComponent, decorators: [{
|
|
3142
|
+
type: i0.Component,
|
|
3143
|
+
args: [{
|
|
3144
|
+
selector: 'sky-selection-box-header',
|
|
3145
|
+
template: "<ng-content></ng-content>\n",
|
|
3146
|
+
}]
|
|
3147
|
+
}] });
|
|
3148
|
+
|
|
3147
3149
|
var SkySelectionBoxModule = /** @class */ (function () {
|
|
3148
3150
|
function SkySelectionBoxModule() {
|
|
3149
3151
|
}
|
|
@@ -3231,8 +3233,9 @@
|
|
|
3231
3233
|
this.ngUnsubscribe = new rxjs.Subject();
|
|
3232
3234
|
this.toggleSwitchId = uniqueId++;
|
|
3233
3235
|
this._checked = false;
|
|
3234
|
-
|
|
3236
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
3235
3237
|
this.onTouched = function () { };
|
|
3238
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
3236
3239
|
this.onChange = function () { };
|
|
3237
3240
|
}
|
|
3238
3241
|
Object.defineProperty(SkyToggleSwitchComponent.prototype, "checked", {
|