@skyux/forms 5.6.2 → 6.0.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/documentation.json +630 -630
- 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 +32 -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 +325 -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 +217 -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 +72 -0
- package/esm2020/lib/modules/file-attachment/file-link.mjs +2 -0
- package/esm2020/lib/modules/file-attachment/file-size.pipe.mjs +60 -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 +256 -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 +124 -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 +126 -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 +153 -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 +2691 -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 +2685 -0
- package/fesm2020/skyux-forms.mjs.map +1 -0
- package/lib/modules/shared/sky-forms-resources.module.d.ts +1 -1
- package/package.json +36 -15
- package/testing/package.json +5 -5
- package/bundles/skyux-forms-testing.umd.js +0 -123
- package/bundles/skyux-forms.umd.js +0 -3422
- 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 -331
- 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 -132
- 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 -2765
- package/fesm2015/skyux-forms.js.map +0 -1
|
@@ -1,3422 +0,0 @@
|
|
|
1
|
-
(function (global, factory) {
|
|
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
|
-
|
|
7
|
-
function _interopNamespace(e) {
|
|
8
|
-
if (e && e.__esModule) return e;
|
|
9
|
-
var n = Object.create(null);
|
|
10
|
-
if (e) {
|
|
11
|
-
Object.keys(e).forEach(function (k) {
|
|
12
|
-
if (k !== 'default') {
|
|
13
|
-
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
14
|
-
Object.defineProperty(n, k, d.get ? d : {
|
|
15
|
-
enumerable: true,
|
|
16
|
-
get: function () { return e[k]; }
|
|
17
|
-
});
|
|
18
|
-
}
|
|
19
|
-
});
|
|
20
|
-
}
|
|
21
|
-
n["default"] = e;
|
|
22
|
-
return Object.freeze(n);
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
var i1__namespace = /*#__PURE__*/_interopNamespace(i1);
|
|
26
|
-
var i0__namespace = /*#__PURE__*/_interopNamespace(i0);
|
|
27
|
-
var i4__namespace = /*#__PURE__*/_interopNamespace(i4);
|
|
28
|
-
var i2__namespace = /*#__PURE__*/_interopNamespace(i2);
|
|
29
|
-
var i2__namespace$1 = /*#__PURE__*/_interopNamespace(i2$1);
|
|
30
|
-
var i1__namespace$1 = /*#__PURE__*/_interopNamespace(i1$1);
|
|
31
|
-
var i2__namespace$2 = /*#__PURE__*/_interopNamespace(i2$2);
|
|
32
|
-
|
|
33
|
-
/**
|
|
34
|
-
* NOTICE: DO NOT MODIFY THIS FILE!
|
|
35
|
-
* The contents of this file were automatically generated by
|
|
36
|
-
* the 'ng generate @skyux/i18n:lib-resources-module modules/shared/sky-forms' schematic.
|
|
37
|
-
* To update this file, simply rerun the command.
|
|
38
|
-
*/
|
|
39
|
-
var RESOURCES = {
|
|
40
|
-
'EN-US': {
|
|
41
|
-
skyux_character_count_message: { message: 'characters out of' },
|
|
42
|
-
skyux_character_count_over_limit: {
|
|
43
|
-
message: 'You are over the character limit.',
|
|
44
|
-
},
|
|
45
|
-
skyux_file_attachment_button_label_choose_file: { message: 'Choose file' },
|
|
46
|
-
skyux_file_attachment_button_label_replace_file: {
|
|
47
|
-
message: 'Replace file',
|
|
48
|
-
},
|
|
49
|
-
skyux_file_attachment_file_item_delete: { message: 'Delete file' },
|
|
50
|
-
skyux_file_attachment_file_size_b_plural: { message: '{0} bytes' },
|
|
51
|
-
skyux_file_attachment_file_size_b_singular: { message: '{0} byte' },
|
|
52
|
-
skyux_file_attachment_file_size_gb: { message: '{0} GB' },
|
|
53
|
-
skyux_file_attachment_file_size_kb: { message: '{0} KB' },
|
|
54
|
-
skyux_file_attachment_file_size_mb: { message: '{0} MB' },
|
|
55
|
-
skyux_file_attachment_file_upload_drag_file_here: {
|
|
56
|
-
message: 'Drag a file here',
|
|
57
|
-
},
|
|
58
|
-
skyux_file_attachment_file_upload_drag_or_click: {
|
|
59
|
-
message: 'Drag a file here or click to browse',
|
|
60
|
-
},
|
|
61
|
-
skyux_file_attachment_file_upload_drop_files_here: {
|
|
62
|
-
message: 'Drop files here',
|
|
63
|
-
},
|
|
64
|
-
skyux_file_attachment_file_upload_image_preview_alt_text: {
|
|
65
|
-
message: 'Image preview',
|
|
66
|
-
},
|
|
67
|
-
skyux_file_attachment_file_upload_invalid_file: {
|
|
68
|
-
message: 'This file type is invalid',
|
|
69
|
-
},
|
|
70
|
-
skyux_file_attachment_file_upload_link_input: {
|
|
71
|
-
message: 'Add a link to a file',
|
|
72
|
-
},
|
|
73
|
-
skyux_file_attachment_file_upload_link_placeholder: {
|
|
74
|
-
message: 'http://www.something.com/file',
|
|
75
|
-
},
|
|
76
|
-
skyux_file_attachment_file_upload_or_click_to_browse: {
|
|
77
|
-
message: 'or click to browse',
|
|
78
|
-
},
|
|
79
|
-
skyux_file_attachment_file_upload_paste_link: {
|
|
80
|
-
message: 'Paste a link to a file',
|
|
81
|
-
},
|
|
82
|
-
skyux_file_attachment_file_upload_paste_link_done: { message: 'Done' },
|
|
83
|
-
skyux_file_attachment_label_no_file_chosen: { message: 'No file chosen' },
|
|
84
|
-
},
|
|
85
|
-
};
|
|
86
|
-
var SkyFormsResourcesProvider = /** @class */ (function () {
|
|
87
|
-
function SkyFormsResourcesProvider() {
|
|
88
|
-
}
|
|
89
|
-
SkyFormsResourcesProvider.prototype.getString = function (localeInfo, name) {
|
|
90
|
-
return i2.getLibStringForLocale(RESOURCES, localeInfo.locale, name);
|
|
91
|
-
};
|
|
92
|
-
return SkyFormsResourcesProvider;
|
|
93
|
-
}());
|
|
94
|
-
/**
|
|
95
|
-
* Import into any component library module that needs to use resource strings.
|
|
96
|
-
*/
|
|
97
|
-
var SkyFormsResourcesModule = /** @class */ (function () {
|
|
98
|
-
function SkyFormsResourcesModule() {
|
|
99
|
-
}
|
|
100
|
-
return SkyFormsResourcesModule;
|
|
101
|
-
}());
|
|
102
|
-
SkyFormsResourcesModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyFormsResourcesModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
|
|
103
|
-
SkyFormsResourcesModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyFormsResourcesModule, exports: [i2.SkyI18nModule] });
|
|
104
|
-
SkyFormsResourcesModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyFormsResourcesModule, providers: [
|
|
105
|
-
{
|
|
106
|
-
provide: i2.SKY_LIB_RESOURCES_PROVIDERS,
|
|
107
|
-
useClass: SkyFormsResourcesProvider,
|
|
108
|
-
multi: true,
|
|
109
|
-
},
|
|
110
|
-
], imports: [i2.SkyI18nModule] });
|
|
111
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyFormsResourcesModule, decorators: [{
|
|
112
|
-
type: i0.NgModule,
|
|
113
|
-
args: [{
|
|
114
|
-
exports: [i2.SkyI18nModule],
|
|
115
|
-
providers: [
|
|
116
|
-
{
|
|
117
|
-
provide: i2.SKY_LIB_RESOURCES_PROVIDERS,
|
|
118
|
-
useClass: SkyFormsResourcesProvider,
|
|
119
|
-
multi: true,
|
|
120
|
-
},
|
|
121
|
-
],
|
|
122
|
-
}]
|
|
123
|
-
}] });
|
|
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
|
-
|
|
167
|
-
/**
|
|
168
|
-
* Creates an input field that validates the number of characters. Place this directive on
|
|
169
|
-
* an `input` or `textarea` element. If users enter more characters than allowed, then the
|
|
170
|
-
* input field is invalid and the component displays an error indicator.
|
|
171
|
-
* @required
|
|
172
|
-
*/
|
|
173
|
-
var SkyCharacterCounterInputDirective = /** @class */ (function () {
|
|
174
|
-
function SkyCharacterCounterInputDirective() {
|
|
175
|
-
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
176
|
-
this._validatorChange = function () { };
|
|
177
|
-
}
|
|
178
|
-
Object.defineProperty(SkyCharacterCounterInputDirective.prototype, "skyCharacterCounterLimit", {
|
|
179
|
-
get: function () {
|
|
180
|
-
return this._skyCharacterCounterLimit || 0;
|
|
181
|
-
},
|
|
182
|
-
/**
|
|
183
|
-
* Specifies the maximum number of characters allowed in the input field. Place this directive
|
|
184
|
-
* on an `input` or `textarea` element. This property accepts `number` values.
|
|
185
|
-
* @required
|
|
186
|
-
*/
|
|
187
|
-
set: function (value) {
|
|
188
|
-
this._skyCharacterCounterLimit = value;
|
|
189
|
-
this.updateIndicatorLimit(this.skyCharacterCounterLimit);
|
|
190
|
-
this._validatorChange();
|
|
191
|
-
},
|
|
192
|
-
enumerable: false,
|
|
193
|
-
configurable: true
|
|
194
|
-
});
|
|
195
|
-
SkyCharacterCounterInputDirective.prototype.validate = function (control) {
|
|
196
|
-
var value = control.value;
|
|
197
|
-
this.updateIndicatorCount((value && value.length) || 0);
|
|
198
|
-
if (!value) {
|
|
199
|
-
return;
|
|
200
|
-
}
|
|
201
|
-
if (value.length > this.skyCharacterCounterLimit) {
|
|
202
|
-
// This is needed to apply the appropriate error styles to the input.
|
|
203
|
-
control.markAsTouched();
|
|
204
|
-
return {
|
|
205
|
-
skyCharacterCounter: {
|
|
206
|
-
invalid: value,
|
|
207
|
-
},
|
|
208
|
-
};
|
|
209
|
-
}
|
|
210
|
-
};
|
|
211
|
-
SkyCharacterCounterInputDirective.prototype.registerOnValidatorChange = function (fn) {
|
|
212
|
-
this._validatorChange = fn;
|
|
213
|
-
};
|
|
214
|
-
SkyCharacterCounterInputDirective.prototype.updateIndicatorCount = function (count) {
|
|
215
|
-
if (this.skyCharacterCounterIndicator) {
|
|
216
|
-
this.skyCharacterCounterIndicator.characterCount = count;
|
|
217
|
-
}
|
|
218
|
-
};
|
|
219
|
-
SkyCharacterCounterInputDirective.prototype.updateIndicatorLimit = function (limit) {
|
|
220
|
-
if (this.skyCharacterCounterIndicator) {
|
|
221
|
-
this.skyCharacterCounterIndicator.characterCountLimit = limit;
|
|
222
|
-
}
|
|
223
|
-
};
|
|
224
|
-
return SkyCharacterCounterInputDirective;
|
|
225
|
-
}());
|
|
226
|
-
SkyCharacterCounterInputDirective.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyCharacterCounterInputDirective, deps: [], target: i0__namespace.ɵɵFactoryTarget.Directive });
|
|
227
|
-
SkyCharacterCounterInputDirective.ɵdir = i0__namespace.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.16", type: SkyCharacterCounterInputDirective, selector: "[skyCharacterCounter]", inputs: { skyCharacterCounterIndicator: "skyCharacterCounterIndicator", skyCharacterCounterLimit: "skyCharacterCounterLimit" }, providers: [
|
|
228
|
-
{
|
|
229
|
-
provide: i4.NG_VALIDATORS,
|
|
230
|
-
useExisting: SkyCharacterCounterInputDirective,
|
|
231
|
-
multi: true,
|
|
232
|
-
},
|
|
233
|
-
], ngImport: i0__namespace });
|
|
234
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyCharacterCounterInputDirective, decorators: [{
|
|
235
|
-
type: i0.Directive,
|
|
236
|
-
args: [{
|
|
237
|
-
selector: '[skyCharacterCounter]',
|
|
238
|
-
providers: [
|
|
239
|
-
{
|
|
240
|
-
provide: i4.NG_VALIDATORS,
|
|
241
|
-
useExisting: SkyCharacterCounterInputDirective,
|
|
242
|
-
multi: true,
|
|
243
|
-
},
|
|
244
|
-
],
|
|
245
|
-
}]
|
|
246
|
-
}], propDecorators: { skyCharacterCounterIndicator: [{
|
|
247
|
-
type: i0.Input
|
|
248
|
-
}], skyCharacterCounterLimit: [{
|
|
249
|
-
type: i0.Input
|
|
250
|
-
}] } });
|
|
251
|
-
|
|
252
|
-
var SkyCharacterCounterModule = /** @class */ (function () {
|
|
253
|
-
function SkyCharacterCounterModule() {
|
|
254
|
-
}
|
|
255
|
-
return SkyCharacterCounterModule;
|
|
256
|
-
}());
|
|
257
|
-
SkyCharacterCounterModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyCharacterCounterModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
|
|
258
|
-
SkyCharacterCounterModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyCharacterCounterModule, declarations: [SkyCharacterCounterInputDirective,
|
|
259
|
-
SkyCharacterCounterIndicatorComponent], imports: [i1.CommonModule,
|
|
260
|
-
i4.FormsModule,
|
|
261
|
-
i4.ReactiveFormsModule,
|
|
262
|
-
SkyFormsResourcesModule,
|
|
263
|
-
i2.SkyI18nModule], exports: [SkyCharacterCounterInputDirective,
|
|
264
|
-
SkyCharacterCounterIndicatorComponent] });
|
|
265
|
-
SkyCharacterCounterModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyCharacterCounterModule, imports: [[
|
|
266
|
-
i1.CommonModule,
|
|
267
|
-
i4.FormsModule,
|
|
268
|
-
i4.ReactiveFormsModule,
|
|
269
|
-
SkyFormsResourcesModule,
|
|
270
|
-
i2.SkyI18nModule,
|
|
271
|
-
]] });
|
|
272
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyCharacterCounterModule, decorators: [{
|
|
273
|
-
type: i0.NgModule,
|
|
274
|
-
args: [{
|
|
275
|
-
declarations: [
|
|
276
|
-
SkyCharacterCounterInputDirective,
|
|
277
|
-
SkyCharacterCounterIndicatorComponent,
|
|
278
|
-
],
|
|
279
|
-
imports: [
|
|
280
|
-
i1.CommonModule,
|
|
281
|
-
i4.FormsModule,
|
|
282
|
-
i4.ReactiveFormsModule,
|
|
283
|
-
SkyFormsResourcesModule,
|
|
284
|
-
i2.SkyI18nModule,
|
|
285
|
-
],
|
|
286
|
-
exports: [
|
|
287
|
-
SkyCharacterCounterInputDirective,
|
|
288
|
-
SkyCharacterCounterIndicatorComponent,
|
|
289
|
-
],
|
|
290
|
-
}]
|
|
291
|
-
}] });
|
|
292
|
-
|
|
293
|
-
/**
|
|
294
|
-
* Fires when users select or deselect the checkbox.
|
|
295
|
-
*/
|
|
296
|
-
var SkyCheckboxChange = /** @class */ (function () {
|
|
297
|
-
function SkyCheckboxChange() {
|
|
298
|
-
}
|
|
299
|
-
return SkyCheckboxChange;
|
|
300
|
-
}());
|
|
301
|
-
|
|
302
|
-
/**
|
|
303
|
-
* Specifies a label for the checkbox.
|
|
304
|
-
*/
|
|
305
|
-
var SkyCheckboxLabelComponent = /** @class */ (function () {
|
|
306
|
-
function SkyCheckboxLabelComponent() {
|
|
307
|
-
}
|
|
308
|
-
return SkyCheckboxLabelComponent;
|
|
309
|
-
}());
|
|
310
|
-
SkyCheckboxLabelComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyCheckboxLabelComponent, deps: [], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
311
|
-
SkyCheckboxLabelComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: SkyCheckboxLabelComponent, selector: "sky-checkbox-label", ngImport: i0__namespace, template: "<span class=\"sky-switch-label\">\n <ng-content></ng-content>\n</span>\n" });
|
|
312
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyCheckboxLabelComponent, decorators: [{
|
|
313
|
-
type: i0.Component,
|
|
314
|
-
args: [{
|
|
315
|
-
selector: 'sky-checkbox-label',
|
|
316
|
-
template: "<span class=\"sky-switch-label\">\n <ng-content></ng-content>\n</span>\n",
|
|
317
|
-
}]
|
|
318
|
-
}] });
|
|
319
|
-
|
|
320
|
-
/*! *****************************************************************************
|
|
321
|
-
Copyright (c) Microsoft Corporation.
|
|
322
|
-
|
|
323
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
|
324
|
-
purpose with or without fee is hereby granted.
|
|
325
|
-
|
|
326
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
327
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
328
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
329
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
330
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
331
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
332
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
333
|
-
***************************************************************************** */
|
|
334
|
-
/* global Reflect, Promise */
|
|
335
|
-
var extendStatics = function (d, b) {
|
|
336
|
-
extendStatics = Object.setPrototypeOf ||
|
|
337
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
338
|
-
function (d, b) { for (var p in b)
|
|
339
|
-
if (Object.prototype.hasOwnProperty.call(b, p))
|
|
340
|
-
d[p] = b[p]; };
|
|
341
|
-
return extendStatics(d, b);
|
|
342
|
-
};
|
|
343
|
-
function __extends(d, b) {
|
|
344
|
-
if (typeof b !== "function" && b !== null)
|
|
345
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
346
|
-
extendStatics(d, b);
|
|
347
|
-
function __() { this.constructor = d; }
|
|
348
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
349
|
-
}
|
|
350
|
-
var __assign = function () {
|
|
351
|
-
__assign = Object.assign || function __assign(t) {
|
|
352
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
353
|
-
s = arguments[i];
|
|
354
|
-
for (var p in s)
|
|
355
|
-
if (Object.prototype.hasOwnProperty.call(s, p))
|
|
356
|
-
t[p] = s[p];
|
|
357
|
-
}
|
|
358
|
-
return t;
|
|
359
|
-
};
|
|
360
|
-
return __assign.apply(this, arguments);
|
|
361
|
-
};
|
|
362
|
-
function __rest(s, e) {
|
|
363
|
-
var t = {};
|
|
364
|
-
for (var p in s)
|
|
365
|
-
if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
366
|
-
t[p] = s[p];
|
|
367
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
368
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
369
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
370
|
-
t[p[i]] = s[p[i]];
|
|
371
|
-
}
|
|
372
|
-
return t;
|
|
373
|
-
}
|
|
374
|
-
function __decorate(decorators, target, key, desc) {
|
|
375
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
376
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
377
|
-
r = Reflect.decorate(decorators, target, key, desc);
|
|
378
|
-
else
|
|
379
|
-
for (var i = decorators.length - 1; i >= 0; i--)
|
|
380
|
-
if (d = decorators[i])
|
|
381
|
-
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
382
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
383
|
-
}
|
|
384
|
-
function __param(paramIndex, decorator) {
|
|
385
|
-
return function (target, key) { decorator(target, key, paramIndex); };
|
|
386
|
-
}
|
|
387
|
-
function __metadata(metadataKey, metadataValue) {
|
|
388
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
|
|
389
|
-
return Reflect.metadata(metadataKey, metadataValue);
|
|
390
|
-
}
|
|
391
|
-
function __awaiter(thisArg, _arguments, P, generator) {
|
|
392
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
393
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
394
|
-
function fulfilled(value) { try {
|
|
395
|
-
step(generator.next(value));
|
|
396
|
-
}
|
|
397
|
-
catch (e) {
|
|
398
|
-
reject(e);
|
|
399
|
-
} }
|
|
400
|
-
function rejected(value) { try {
|
|
401
|
-
step(generator["throw"](value));
|
|
402
|
-
}
|
|
403
|
-
catch (e) {
|
|
404
|
-
reject(e);
|
|
405
|
-
} }
|
|
406
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
407
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
408
|
-
});
|
|
409
|
-
}
|
|
410
|
-
function __generator(thisArg, body) {
|
|
411
|
-
var _ = { label: 0, sent: function () { if (t[0] & 1)
|
|
412
|
-
throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
413
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function () { return this; }), g;
|
|
414
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
415
|
-
function step(op) {
|
|
416
|
-
if (f)
|
|
417
|
-
throw new TypeError("Generator is already executing.");
|
|
418
|
-
while (_)
|
|
419
|
-
try {
|
|
420
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done)
|
|
421
|
-
return t;
|
|
422
|
-
if (y = 0, t)
|
|
423
|
-
op = [op[0] & 2, t.value];
|
|
424
|
-
switch (op[0]) {
|
|
425
|
-
case 0:
|
|
426
|
-
case 1:
|
|
427
|
-
t = op;
|
|
428
|
-
break;
|
|
429
|
-
case 4:
|
|
430
|
-
_.label++;
|
|
431
|
-
return { value: op[1], done: false };
|
|
432
|
-
case 5:
|
|
433
|
-
_.label++;
|
|
434
|
-
y = op[1];
|
|
435
|
-
op = [0];
|
|
436
|
-
continue;
|
|
437
|
-
case 7:
|
|
438
|
-
op = _.ops.pop();
|
|
439
|
-
_.trys.pop();
|
|
440
|
-
continue;
|
|
441
|
-
default:
|
|
442
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
443
|
-
_ = 0;
|
|
444
|
-
continue;
|
|
445
|
-
}
|
|
446
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) {
|
|
447
|
-
_.label = op[1];
|
|
448
|
-
break;
|
|
449
|
-
}
|
|
450
|
-
if (op[0] === 6 && _.label < t[1]) {
|
|
451
|
-
_.label = t[1];
|
|
452
|
-
t = op;
|
|
453
|
-
break;
|
|
454
|
-
}
|
|
455
|
-
if (t && _.label < t[2]) {
|
|
456
|
-
_.label = t[2];
|
|
457
|
-
_.ops.push(op);
|
|
458
|
-
break;
|
|
459
|
-
}
|
|
460
|
-
if (t[2])
|
|
461
|
-
_.ops.pop();
|
|
462
|
-
_.trys.pop();
|
|
463
|
-
continue;
|
|
464
|
-
}
|
|
465
|
-
op = body.call(thisArg, _);
|
|
466
|
-
}
|
|
467
|
-
catch (e) {
|
|
468
|
-
op = [6, e];
|
|
469
|
-
y = 0;
|
|
470
|
-
}
|
|
471
|
-
finally {
|
|
472
|
-
f = t = 0;
|
|
473
|
-
}
|
|
474
|
-
if (op[0] & 5)
|
|
475
|
-
throw op[1];
|
|
476
|
-
return { value: op[0] ? op[1] : void 0, done: true };
|
|
477
|
-
}
|
|
478
|
-
}
|
|
479
|
-
var __createBinding = Object.create ? (function (o, m, k, k2) {
|
|
480
|
-
if (k2 === undefined)
|
|
481
|
-
k2 = k;
|
|
482
|
-
Object.defineProperty(o, k2, { enumerable: true, get: function () { return m[k]; } });
|
|
483
|
-
}) : (function (o, m, k, k2) {
|
|
484
|
-
if (k2 === undefined)
|
|
485
|
-
k2 = k;
|
|
486
|
-
o[k2] = m[k];
|
|
487
|
-
});
|
|
488
|
-
function __exportStar(m, o) {
|
|
489
|
-
for (var p in m)
|
|
490
|
-
if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p))
|
|
491
|
-
__createBinding(o, m, p);
|
|
492
|
-
}
|
|
493
|
-
function __values(o) {
|
|
494
|
-
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
495
|
-
if (m)
|
|
496
|
-
return m.call(o);
|
|
497
|
-
if (o && typeof o.length === "number")
|
|
498
|
-
return {
|
|
499
|
-
next: function () {
|
|
500
|
-
if (o && i >= o.length)
|
|
501
|
-
o = void 0;
|
|
502
|
-
return { value: o && o[i++], done: !o };
|
|
503
|
-
}
|
|
504
|
-
};
|
|
505
|
-
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
506
|
-
}
|
|
507
|
-
function __read(o, n) {
|
|
508
|
-
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
509
|
-
if (!m)
|
|
510
|
-
return o;
|
|
511
|
-
var i = m.call(o), r, ar = [], e;
|
|
512
|
-
try {
|
|
513
|
-
while ((n === void 0 || n-- > 0) && !(r = i.next()).done)
|
|
514
|
-
ar.push(r.value);
|
|
515
|
-
}
|
|
516
|
-
catch (error) {
|
|
517
|
-
e = { error: error };
|
|
518
|
-
}
|
|
519
|
-
finally {
|
|
520
|
-
try {
|
|
521
|
-
if (r && !r.done && (m = i["return"]))
|
|
522
|
-
m.call(i);
|
|
523
|
-
}
|
|
524
|
-
finally {
|
|
525
|
-
if (e)
|
|
526
|
-
throw e.error;
|
|
527
|
-
}
|
|
528
|
-
}
|
|
529
|
-
return ar;
|
|
530
|
-
}
|
|
531
|
-
/** @deprecated */
|
|
532
|
-
function __spread() {
|
|
533
|
-
for (var ar = [], i = 0; i < arguments.length; i++)
|
|
534
|
-
ar = ar.concat(__read(arguments[i]));
|
|
535
|
-
return ar;
|
|
536
|
-
}
|
|
537
|
-
/** @deprecated */
|
|
538
|
-
function __spreadArrays() {
|
|
539
|
-
for (var s = 0, i = 0, il = arguments.length; i < il; i++)
|
|
540
|
-
s += arguments[i].length;
|
|
541
|
-
for (var r = Array(s), k = 0, i = 0; i < il; i++)
|
|
542
|
-
for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
|
|
543
|
-
r[k] = a[j];
|
|
544
|
-
return r;
|
|
545
|
-
}
|
|
546
|
-
function __spreadArray(to, from, pack) {
|
|
547
|
-
if (pack || arguments.length === 2)
|
|
548
|
-
for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
549
|
-
if (ar || !(i in from)) {
|
|
550
|
-
if (!ar)
|
|
551
|
-
ar = Array.prototype.slice.call(from, 0, i);
|
|
552
|
-
ar[i] = from[i];
|
|
553
|
-
}
|
|
554
|
-
}
|
|
555
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
556
|
-
}
|
|
557
|
-
function __await(v) {
|
|
558
|
-
return this instanceof __await ? (this.v = v, this) : new __await(v);
|
|
559
|
-
}
|
|
560
|
-
function __asyncGenerator(thisArg, _arguments, generator) {
|
|
561
|
-
if (!Symbol.asyncIterator)
|
|
562
|
-
throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
563
|
-
var g = generator.apply(thisArg, _arguments || []), i, q = [];
|
|
564
|
-
return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
|
|
565
|
-
function verb(n) { if (g[n])
|
|
566
|
-
i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
|
|
567
|
-
function resume(n, v) { try {
|
|
568
|
-
step(g[n](v));
|
|
569
|
-
}
|
|
570
|
-
catch (e) {
|
|
571
|
-
settle(q[0][3], e);
|
|
572
|
-
} }
|
|
573
|
-
function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
|
|
574
|
-
function fulfill(value) { resume("next", value); }
|
|
575
|
-
function reject(value) { resume("throw", value); }
|
|
576
|
-
function settle(f, v) { if (f(v), q.shift(), q.length)
|
|
577
|
-
resume(q[0][0], q[0][1]); }
|
|
578
|
-
}
|
|
579
|
-
function __asyncDelegator(o) {
|
|
580
|
-
var i, p;
|
|
581
|
-
return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
|
|
582
|
-
function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; }
|
|
583
|
-
}
|
|
584
|
-
function __asyncValues(o) {
|
|
585
|
-
if (!Symbol.asyncIterator)
|
|
586
|
-
throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
587
|
-
var m = o[Symbol.asyncIterator], i;
|
|
588
|
-
return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
|
|
589
|
-
function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
|
|
590
|
-
function settle(resolve, reject, d, v) { Promise.resolve(v).then(function (v) { resolve({ value: v, done: d }); }, reject); }
|
|
591
|
-
}
|
|
592
|
-
function __makeTemplateObject(cooked, raw) {
|
|
593
|
-
if (Object.defineProperty) {
|
|
594
|
-
Object.defineProperty(cooked, "raw", { value: raw });
|
|
595
|
-
}
|
|
596
|
-
else {
|
|
597
|
-
cooked.raw = raw;
|
|
598
|
-
}
|
|
599
|
-
return cooked;
|
|
600
|
-
}
|
|
601
|
-
;
|
|
602
|
-
var __setModuleDefault = Object.create ? (function (o, v) {
|
|
603
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
604
|
-
}) : function (o, v) {
|
|
605
|
-
o["default"] = v;
|
|
606
|
-
};
|
|
607
|
-
function __importStar(mod) {
|
|
608
|
-
if (mod && mod.__esModule)
|
|
609
|
-
return mod;
|
|
610
|
-
var result = {};
|
|
611
|
-
if (mod != null)
|
|
612
|
-
for (var k in mod)
|
|
613
|
-
if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k))
|
|
614
|
-
__createBinding(result, mod, k);
|
|
615
|
-
__setModuleDefault(result, mod);
|
|
616
|
-
return result;
|
|
617
|
-
}
|
|
618
|
-
function __importDefault(mod) {
|
|
619
|
-
return (mod && mod.__esModule) ? mod : { default: mod };
|
|
620
|
-
}
|
|
621
|
-
function __classPrivateFieldGet(receiver, state, kind, f) {
|
|
622
|
-
if (kind === "a" && !f)
|
|
623
|
-
throw new TypeError("Private accessor was defined without a getter");
|
|
624
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
|
|
625
|
-
throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
626
|
-
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
627
|
-
}
|
|
628
|
-
function __classPrivateFieldSet(receiver, state, value, kind, f) {
|
|
629
|
-
if (kind === "m")
|
|
630
|
-
throw new TypeError("Private method is not writable");
|
|
631
|
-
if (kind === "a" && !f)
|
|
632
|
-
throw new TypeError("Private accessor was defined without a setter");
|
|
633
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
|
|
634
|
-
throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
635
|
-
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
636
|
-
}
|
|
637
|
-
|
|
638
|
-
// tslint:disable:no-forward-ref
|
|
639
|
-
var SKY_CHECKBOX_REQUIRED_VALIDATOR = {
|
|
640
|
-
provide: i4.NG_VALIDATORS,
|
|
641
|
-
useExisting: i0.forwardRef(function () { return SkyCheckboxRequiredValidatorDirective; }),
|
|
642
|
-
multi: true,
|
|
643
|
-
};
|
|
644
|
-
// tslint:enable
|
|
645
|
-
/**
|
|
646
|
-
* Validator support for the `required` input on `sky-checkbox`.
|
|
647
|
-
* Angular's `CheckboxRequiredValidator` only works with `input type=checkbox`. This directive
|
|
648
|
-
* extends the angular validator to work with `sky-checkbox` tags.
|
|
649
|
-
* This is based on Angular Material's similar implementation:
|
|
650
|
-
* https://github.com/angular/components/blob/a415b52ead2ec202ba37edb7d7866b29dd790394/src/material/checkbox/checkbox-required-validator.ts
|
|
651
|
-
* @internal
|
|
652
|
-
*/
|
|
653
|
-
var SkyCheckboxRequiredValidatorDirective = /** @class */ (function (_super) {
|
|
654
|
-
__extends(SkyCheckboxRequiredValidatorDirective, _super);
|
|
655
|
-
function SkyCheckboxRequiredValidatorDirective() {
|
|
656
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
657
|
-
}
|
|
658
|
-
return SkyCheckboxRequiredValidatorDirective;
|
|
659
|
-
}(i4.CheckboxRequiredValidator));
|
|
660
|
-
SkyCheckboxRequiredValidatorDirective.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyCheckboxRequiredValidatorDirective, deps: null, target: i0__namespace.ɵɵFactoryTarget.Directive });
|
|
661
|
-
SkyCheckboxRequiredValidatorDirective.ɵdir = i0__namespace.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.16", type: SkyCheckboxRequiredValidatorDirective, selector: "sky-checkbox[required][formControlName],\n sky-checkbox[required][formControl], sky-checkbox[required][ngModel]", providers: [SKY_CHECKBOX_REQUIRED_VALIDATOR], usesInheritance: true, ngImport: i0__namespace });
|
|
662
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyCheckboxRequiredValidatorDirective, decorators: [{
|
|
663
|
-
type: i0.Directive,
|
|
664
|
-
args: [{
|
|
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"],
|
|
928
|
-
}]
|
|
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
|
-
}] } });
|
|
962
|
-
|
|
963
|
-
var SkyCheckboxModule = /** @class */ (function () {
|
|
964
|
-
function SkyCheckboxModule() {
|
|
965
|
-
}
|
|
966
|
-
return SkyCheckboxModule;
|
|
967
|
-
}());
|
|
968
|
-
SkyCheckboxModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyCheckboxModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
|
|
969
|
-
SkyCheckboxModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyCheckboxModule, declarations: [SkyCheckboxComponent,
|
|
970
|
-
SkyCheckboxLabelComponent,
|
|
971
|
-
SkyCheckboxRequiredValidatorDirective], imports: [i1.CommonModule, i4.FormsModule, i2$1.SkyIconModule], exports: [SkyCheckboxComponent,
|
|
972
|
-
SkyCheckboxLabelComponent,
|
|
973
|
-
SkyCheckboxRequiredValidatorDirective] });
|
|
974
|
-
SkyCheckboxModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyCheckboxModule, imports: [[i1.CommonModule, i4.FormsModule, i2$1.SkyIconModule]] });
|
|
975
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyCheckboxModule, decorators: [{
|
|
976
|
-
type: i0.NgModule,
|
|
977
|
-
args: [{
|
|
978
|
-
declarations: [
|
|
979
|
-
SkyCheckboxComponent,
|
|
980
|
-
SkyCheckboxLabelComponent,
|
|
981
|
-
SkyCheckboxRequiredValidatorDirective,
|
|
982
|
-
],
|
|
983
|
-
imports: [i1.CommonModule, i4.FormsModule, i2$1.SkyIconModule],
|
|
984
|
-
exports: [
|
|
985
|
-
SkyCheckboxComponent,
|
|
986
|
-
SkyCheckboxLabelComponent,
|
|
987
|
-
SkyCheckboxRequiredValidatorDirective,
|
|
988
|
-
],
|
|
989
|
-
}]
|
|
990
|
-
}] });
|
|
991
|
-
|
|
992
|
-
/**
|
|
993
|
-
* Displays a label above the file attachment element.
|
|
994
|
-
*/
|
|
995
|
-
var SkyFileAttachmentLabelComponent = /** @class */ (function () {
|
|
996
|
-
function SkyFileAttachmentLabelComponent() {
|
|
997
|
-
}
|
|
998
|
-
return SkyFileAttachmentLabelComponent;
|
|
999
|
-
}());
|
|
1000
|
-
SkyFileAttachmentLabelComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyFileAttachmentLabelComponent, deps: [], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
1001
|
-
SkyFileAttachmentLabelComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: SkyFileAttachmentLabelComponent, selector: "sky-file-attachment-label", ngImport: i0__namespace, template: "<span class=\"sky-control-label\">\n <ng-content></ng-content>\n</span>\n", styles: [":host-context(.sky-theme-modern) .sky-control-label{color:#686c73;font-size:13px}.sky-theme-modern .sky-control-label{color:#686c73;font-size:13px}\n"], changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush });
|
|
1002
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyFileAttachmentLabelComponent, decorators: [{
|
|
1003
|
-
type: i0.Component,
|
|
1004
|
-
args: [{
|
|
1005
|
-
selector: 'sky-file-attachment-label',
|
|
1006
|
-
template: "<span class=\"sky-control-label\">\n <ng-content></ng-content>\n</span>\n",
|
|
1007
|
-
styles: [":host-context(.sky-theme-modern) .sky-control-label{color:#686c73;font-size:13px}.sky-theme-modern .sky-control-label{color:#686c73;font-size:13px}\n"],
|
|
1008
|
-
changeDetection: i0.ChangeDetectionStrategy.OnPush,
|
|
1009
|
-
}]
|
|
1010
|
-
}] });
|
|
1011
|
-
|
|
1012
|
-
/**
|
|
1013
|
-
* @internal
|
|
1014
|
-
*/
|
|
1015
|
-
var SkyFileAttachmentService = /** @class */ (function () {
|
|
1016
|
-
function SkyFileAttachmentService() {
|
|
1017
|
-
}
|
|
1018
|
-
SkyFileAttachmentService.prototype.checkFiles = function (files, minFileSize, maxFileSize, acceptedTypes, validateFn) {
|
|
1019
|
-
var fileResults = [];
|
|
1020
|
-
for (var index = 0; index < files.length; index++) {
|
|
1021
|
-
var fileItem = {
|
|
1022
|
-
file: files.item(index),
|
|
1023
|
-
};
|
|
1024
|
-
if (fileItem.file.size < minFileSize) {
|
|
1025
|
-
fileItem.errorType = 'minFileSize';
|
|
1026
|
-
fileItem.errorParam = minFileSize.toString();
|
|
1027
|
-
fileResults.push(fileItem);
|
|
1028
|
-
}
|
|
1029
|
-
else if (fileItem.file.size > maxFileSize) {
|
|
1030
|
-
fileItem.errorType = 'maxFileSize';
|
|
1031
|
-
fileItem.errorParam = maxFileSize.toString();
|
|
1032
|
-
fileResults.push(fileItem);
|
|
1033
|
-
}
|
|
1034
|
-
else if (this.fileTypeRejected(fileItem.file.type, acceptedTypes)) {
|
|
1035
|
-
fileItem.errorType = 'fileType';
|
|
1036
|
-
fileItem.errorParam = acceptedTypes;
|
|
1037
|
-
fileResults.push(fileItem);
|
|
1038
|
-
}
|
|
1039
|
-
else if (validateFn) {
|
|
1040
|
-
var errorParam = validateFn(fileItem);
|
|
1041
|
-
if (errorParam) {
|
|
1042
|
-
fileItem.errorType = 'validate';
|
|
1043
|
-
fileItem.errorParam = errorParam;
|
|
1044
|
-
}
|
|
1045
|
-
fileResults.push(fileItem);
|
|
1046
|
-
}
|
|
1047
|
-
else {
|
|
1048
|
-
fileResults.push(fileItem);
|
|
1049
|
-
}
|
|
1050
|
-
}
|
|
1051
|
-
return fileResults;
|
|
1052
|
-
};
|
|
1053
|
-
/**
|
|
1054
|
-
* Returns `true` if a directory is found in the provided `files` parameter.
|
|
1055
|
-
*/
|
|
1056
|
-
SkyFileAttachmentService.prototype.hasDirectory = function (files) {
|
|
1057
|
-
for (var index = 0; index < files.length; index++) {
|
|
1058
|
-
var file = files.item(index);
|
|
1059
|
-
if (file.webkitGetAsEntry &&
|
|
1060
|
-
file.webkitGetAsEntry() &&
|
|
1061
|
-
file.webkitGetAsEntry().isDirectory) {
|
|
1062
|
-
return true;
|
|
1063
|
-
}
|
|
1064
|
-
}
|
|
1065
|
-
return false;
|
|
1066
|
-
};
|
|
1067
|
-
SkyFileAttachmentService.prototype.fileTypeRejected = function (fileType, acceptedTypes) {
|
|
1068
|
-
if (!acceptedTypes) {
|
|
1069
|
-
return false;
|
|
1070
|
-
}
|
|
1071
|
-
if (!fileType) {
|
|
1072
|
-
return true;
|
|
1073
|
-
}
|
|
1074
|
-
var acceptedTypesUpper = acceptedTypes.toUpperCase();
|
|
1075
|
-
var typeArray = acceptedTypesUpper.split(',');
|
|
1076
|
-
return !this.fileTypeInArray(typeArray, fileType.toUpperCase());
|
|
1077
|
-
};
|
|
1078
|
-
SkyFileAttachmentService.prototype.fileTypeInArray = function (typeArray, fileType) {
|
|
1079
|
-
if (typeArray.indexOf(fileType) !== -1) {
|
|
1080
|
-
return true;
|
|
1081
|
-
}
|
|
1082
|
-
for (var index = 0; index < typeArray.length; index++) {
|
|
1083
|
-
var type = typeArray[index];
|
|
1084
|
-
var validSubtype = this.getMimeSubtype(type);
|
|
1085
|
-
if (validSubtype === '*') {
|
|
1086
|
-
if (this.getMimeMainType(type) === this.getMimeMainType(fileType)) {
|
|
1087
|
-
return true;
|
|
1088
|
-
}
|
|
1089
|
-
}
|
|
1090
|
-
}
|
|
1091
|
-
return false;
|
|
1092
|
-
};
|
|
1093
|
-
SkyFileAttachmentService.prototype.getMimeSubtype = function (type) {
|
|
1094
|
-
return type.substr(type.indexOf('/') + 1, type.length);
|
|
1095
|
-
};
|
|
1096
|
-
SkyFileAttachmentService.prototype.getMimeMainType = function (type) {
|
|
1097
|
-
return type.substr(0, type.indexOf('/'));
|
|
1098
|
-
};
|
|
1099
|
-
return SkyFileAttachmentService;
|
|
1100
|
-
}());
|
|
1101
|
-
SkyFileAttachmentService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyFileAttachmentService, deps: [], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
1102
|
-
SkyFileAttachmentService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyFileAttachmentService });
|
|
1103
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyFileAttachmentService, decorators: [{
|
|
1104
|
-
type: i0.Injectable
|
|
1105
|
-
}] });
|
|
1106
|
-
|
|
1107
|
-
/**
|
|
1108
|
-
* @internal
|
|
1109
|
-
*/
|
|
1110
|
-
var SkyFileItemService = /** @class */ (function () {
|
|
1111
|
-
function SkyFileItemService() {
|
|
1112
|
-
}
|
|
1113
|
-
SkyFileItemService.prototype.isFile = function (fileItem) {
|
|
1114
|
-
var file = fileItem.file;
|
|
1115
|
-
/* tslint:disable */
|
|
1116
|
-
return (file &&
|
|
1117
|
-
file !== undefined &&
|
|
1118
|
-
file !== null &&
|
|
1119
|
-
file.size !== undefined &&
|
|
1120
|
-
file.size !== null);
|
|
1121
|
-
/* tslint:enable */
|
|
1122
|
-
};
|
|
1123
|
-
SkyFileItemService.prototype.isImage = function (fileItem) {
|
|
1124
|
-
var fileTypeUpper = this.getFileTypeUpper(fileItem);
|
|
1125
|
-
var slashIndex = fileTypeUpper.indexOf('/');
|
|
1126
|
-
if (slashIndex >= 0) {
|
|
1127
|
-
switch (fileTypeUpper.substr(fileTypeUpper.indexOf('/') + 1)) {
|
|
1128
|
-
case 'BMP':
|
|
1129
|
-
case 'GIF':
|
|
1130
|
-
case 'JPEG':
|
|
1131
|
-
case 'PNG':
|
|
1132
|
-
return true;
|
|
1133
|
-
default:
|
|
1134
|
-
break;
|
|
1135
|
-
}
|
|
1136
|
-
}
|
|
1137
|
-
return false;
|
|
1138
|
-
};
|
|
1139
|
-
SkyFileItemService.prototype.getFileExtensionUpper = function (fileItem) {
|
|
1140
|
-
var extension = '', name;
|
|
1141
|
-
/* istanbul ignore else */
|
|
1142
|
-
/* sanity check */
|
|
1143
|
-
if (fileItem) {
|
|
1144
|
-
var file = fileItem.file;
|
|
1145
|
-
if (file) {
|
|
1146
|
-
/* istanbul ignore next */
|
|
1147
|
-
name = file.name || '';
|
|
1148
|
-
/* istanbul ignore next */
|
|
1149
|
-
extension = name.substr(name.lastIndexOf('.')) || '';
|
|
1150
|
-
}
|
|
1151
|
-
else {
|
|
1152
|
-
extension = '';
|
|
1153
|
-
}
|
|
1154
|
-
}
|
|
1155
|
-
return extension.toUpperCase();
|
|
1156
|
-
};
|
|
1157
|
-
SkyFileItemService.prototype.getFileTypeUpper = function (fileItem) {
|
|
1158
|
-
var fileType = '';
|
|
1159
|
-
/* istanbul ignore else */
|
|
1160
|
-
/* sanity check */
|
|
1161
|
-
if (fileItem) {
|
|
1162
|
-
var file = fileItem.file;
|
|
1163
|
-
if (file) {
|
|
1164
|
-
fileType = file.type || '';
|
|
1165
|
-
}
|
|
1166
|
-
else {
|
|
1167
|
-
fileType = '';
|
|
1168
|
-
}
|
|
1169
|
-
}
|
|
1170
|
-
return fileType.toUpperCase();
|
|
1171
|
-
};
|
|
1172
|
-
return SkyFileItemService;
|
|
1173
|
-
}());
|
|
1174
|
-
SkyFileItemService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyFileItemService, deps: [], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
1175
|
-
SkyFileItemService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyFileItemService });
|
|
1176
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyFileItemService, decorators: [{
|
|
1177
|
-
type: i0.Injectable
|
|
1178
|
-
}] });
|
|
1179
|
-
|
|
1180
|
-
var uniqueId$1 = 0;
|
|
1181
|
-
/**
|
|
1182
|
-
* Provides an element to attach a single local file.
|
|
1183
|
-
*/
|
|
1184
|
-
var SkyFileAttachmentComponent = /** @class */ (function () {
|
|
1185
|
-
function SkyFileAttachmentComponent(themeSvc, changeDetector, fileAttachmentService, fileItemService, ngControl) {
|
|
1186
|
-
this.themeSvc = themeSvc;
|
|
1187
|
-
this.changeDetector = changeDetector;
|
|
1188
|
-
this.fileAttachmentService = fileAttachmentService;
|
|
1189
|
-
this.fileItemService = fileItemService;
|
|
1190
|
-
this.ngControl = ngControl;
|
|
1191
|
-
/**
|
|
1192
|
-
* Specifies the maximum size in bytes for valid files.
|
|
1193
|
-
*/
|
|
1194
|
-
this.maxFileSize = 500000;
|
|
1195
|
-
/**
|
|
1196
|
-
* Specifies the minimum size in bytes for valid files.
|
|
1197
|
-
*/
|
|
1198
|
-
this.minFileSize = 0;
|
|
1199
|
-
/**
|
|
1200
|
-
* Fires when users add or remove files.
|
|
1201
|
-
*/
|
|
1202
|
-
this.fileChange = new i0.EventEmitter();
|
|
1203
|
-
/**
|
|
1204
|
-
* Fires when users select the file name link. Make sure to bind the event.
|
|
1205
|
-
* If you do not, the file name link will be a dead link.
|
|
1206
|
-
*/
|
|
1207
|
-
this.fileClick = new i0.EventEmitter();
|
|
1208
|
-
this.acceptedOver = false;
|
|
1209
|
-
this.rejectedOver = false;
|
|
1210
|
-
/**
|
|
1211
|
-
* Indicates whether the input is required for form validation.
|
|
1212
|
-
* When you set this property to `true`, the component adds `aria-required` and `required`
|
|
1213
|
-
* attributes to the input element so that forms display an invalid state until the input element
|
|
1214
|
-
* is complete.
|
|
1215
|
-
*/
|
|
1216
|
-
this.required = false;
|
|
1217
|
-
this.fileAttachmentId = uniqueId$1++;
|
|
1218
|
-
this.ngUnsubscribe = new rxjs.Subject();
|
|
1219
|
-
this._disabled = false;
|
|
1220
|
-
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
1221
|
-
this._onChange = function (_) { };
|
|
1222
|
-
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
1223
|
-
this._onTouched = function () { };
|
|
1224
|
-
this.labelElementId = "sky-file-attachment-label-" + this.fileAttachmentId;
|
|
1225
|
-
this.fileDropDescriptionElementId = "sky-file-attachment-drop-description-" + this.fileAttachmentId;
|
|
1226
|
-
if (this.ngControl) {
|
|
1227
|
-
this.ngControl.valueAccessor = this;
|
|
1228
|
-
}
|
|
1229
|
-
}
|
|
1230
|
-
Object.defineProperty(SkyFileAttachmentComponent.prototype, "disabled", {
|
|
1231
|
-
get: function () {
|
|
1232
|
-
return this._disabled;
|
|
1233
|
-
},
|
|
1234
|
-
/**
|
|
1235
|
-
* Indicates whether to disable the input.
|
|
1236
|
-
* @default false
|
|
1237
|
-
*/
|
|
1238
|
-
set: function (value) {
|
|
1239
|
-
var newDisabledState = SkyFormsUtility.coerceBooleanProperty(value);
|
|
1240
|
-
if (this._disabled !== newDisabledState) {
|
|
1241
|
-
this._disabled = newDisabledState;
|
|
1242
|
-
}
|
|
1243
|
-
},
|
|
1244
|
-
enumerable: false,
|
|
1245
|
-
configurable: true
|
|
1246
|
-
});
|
|
1247
|
-
Object.defineProperty(SkyFileAttachmentComponent.prototype, "hasLabelComponent", {
|
|
1248
|
-
get: function () {
|
|
1249
|
-
return this.labelComponents.length > 0;
|
|
1250
|
-
},
|
|
1251
|
-
enumerable: false,
|
|
1252
|
-
configurable: true
|
|
1253
|
-
});
|
|
1254
|
-
Object.defineProperty(SkyFileAttachmentComponent.prototype, "value", {
|
|
1255
|
-
get: function () {
|
|
1256
|
-
return this._value;
|
|
1257
|
-
},
|
|
1258
|
-
set: function (value) {
|
|
1259
|
-
// The null check is needed to address a bug in Angular 4.
|
|
1260
|
-
// writeValue is being called twice, first time with a phantom null value
|
|
1261
|
-
// See: https://github.com/angular/angular/issues/14988
|
|
1262
|
-
// tslint:disable-next-line:no-null-keyword
|
|
1263
|
-
var isNewValue = value !== this.value && value !== null;
|
|
1264
|
-
if (isNewValue) {
|
|
1265
|
-
this._value = value;
|
|
1266
|
-
this._onChange(value);
|
|
1267
|
-
this.updateFileAttachmentButton();
|
|
1268
|
-
}
|
|
1269
|
-
},
|
|
1270
|
-
enumerable: false,
|
|
1271
|
-
configurable: true
|
|
1272
|
-
});
|
|
1273
|
-
SkyFileAttachmentComponent.prototype.ngOnInit = function () {
|
|
1274
|
-
var _this = this;
|
|
1275
|
-
this.themeSvc.settingsChange
|
|
1276
|
-
.pipe(operators.takeUntil(this.ngUnsubscribe))
|
|
1277
|
-
.subscribe(function (themeSettings) {
|
|
1278
|
-
_this.currentThemeName = themeSettings.currentSettings.theme.name;
|
|
1279
|
-
_this.updateFileAttachmentButton();
|
|
1280
|
-
});
|
|
1281
|
-
};
|
|
1282
|
-
SkyFileAttachmentComponent.prototype.ngAfterViewInit = function () {
|
|
1283
|
-
var _this = this;
|
|
1284
|
-
// This is needed to address a bug in Angular 7.
|
|
1285
|
-
// When a control value is set intially, its value is not represented on the view.
|
|
1286
|
-
// See: https://github.com/angular/angular/issues/13792
|
|
1287
|
-
// Of note is the parent check which allows us to determine if the form is reactive.
|
|
1288
|
-
// Without this check there is a changed before checked error
|
|
1289
|
-
/* istanbul ignore else */
|
|
1290
|
-
if (this.ngControl) {
|
|
1291
|
-
setTimeout(function () {
|
|
1292
|
-
_this.ngControl.control.setValue(_this.value, {
|
|
1293
|
-
emitEvent: false,
|
|
1294
|
-
});
|
|
1295
|
-
_this.changeDetector.markForCheck();
|
|
1296
|
-
});
|
|
1297
|
-
// Backwards compatibility support for anyone still using Validators.Required.
|
|
1298
|
-
this.required =
|
|
1299
|
-
this.required || SkyFormsUtility.hasRequiredValidation(this.ngControl);
|
|
1300
|
-
}
|
|
1301
|
-
};
|
|
1302
|
-
SkyFileAttachmentComponent.prototype.ngAfterContentInit = function () {
|
|
1303
|
-
var _this = this;
|
|
1304
|
-
// Handles updating classes when label changes
|
|
1305
|
-
this.labelComponents.changes
|
|
1306
|
-
.pipe(operators.takeUntil(this.ngUnsubscribe))
|
|
1307
|
-
.subscribe(function () {
|
|
1308
|
-
_this.changeDetector.detectChanges();
|
|
1309
|
-
});
|
|
1310
|
-
};
|
|
1311
|
-
SkyFileAttachmentComponent.prototype.isImage = function () {
|
|
1312
|
-
return this.fileItemService.isImage(this.value);
|
|
1313
|
-
};
|
|
1314
|
-
SkyFileAttachmentComponent.prototype.onDropClicked = function () {
|
|
1315
|
-
this._onTouched();
|
|
1316
|
-
this.inputEl.nativeElement.click();
|
|
1317
|
-
};
|
|
1318
|
-
SkyFileAttachmentComponent.prototype.fileChangeEvent = function (fileChangeEvent) {
|
|
1319
|
-
this.handleFiles(fileChangeEvent.target.files);
|
|
1320
|
-
};
|
|
1321
|
-
SkyFileAttachmentComponent.prototype.fileDragEnter = function (dragEnterEvent) {
|
|
1322
|
-
// Save this target to know when the drag event leaves
|
|
1323
|
-
this.enterEventTarget = dragEnterEvent.target;
|
|
1324
|
-
dragEnterEvent.stopPropagation();
|
|
1325
|
-
dragEnterEvent.preventDefault();
|
|
1326
|
-
};
|
|
1327
|
-
SkyFileAttachmentComponent.prototype.fileDragOver = function (dragOverEvent) {
|
|
1328
|
-
var transfer = dragOverEvent.dataTransfer;
|
|
1329
|
-
dragOverEvent.stopPropagation();
|
|
1330
|
-
dragOverEvent.preventDefault();
|
|
1331
|
-
if (transfer) {
|
|
1332
|
-
if (transfer.items) {
|
|
1333
|
-
var files = transfer.items;
|
|
1334
|
-
for (var index = 0; index < files.length; index++) {
|
|
1335
|
-
var file = files[index];
|
|
1336
|
-
if (file.type &&
|
|
1337
|
-
this.fileAttachmentService.fileTypeRejected(file.type, this.acceptedTypes)) {
|
|
1338
|
-
this.rejectedOver = true;
|
|
1339
|
-
this.acceptedOver = false;
|
|
1340
|
-
return;
|
|
1341
|
-
}
|
|
1342
|
-
}
|
|
1343
|
-
if (files.length > 0 && !this.acceptedOver) {
|
|
1344
|
-
this.rejectedOver = false;
|
|
1345
|
-
this.acceptedOver = true;
|
|
1346
|
-
}
|
|
1347
|
-
}
|
|
1348
|
-
else if (transfer.files) {
|
|
1349
|
-
// If the browser does not support DataTransfer.items,
|
|
1350
|
-
// defer file-type checking to drop handler.
|
|
1351
|
-
// https://developer.mozilla.org/en-US/docs/Web/API/DataTransfer/items#Browser_compatibility
|
|
1352
|
-
this.rejectedOver = false;
|
|
1353
|
-
this.acceptedOver = true;
|
|
1354
|
-
}
|
|
1355
|
-
}
|
|
1356
|
-
};
|
|
1357
|
-
SkyFileAttachmentComponent.prototype.fileDrop = function (dropEvent) {
|
|
1358
|
-
dropEvent.stopPropagation();
|
|
1359
|
-
dropEvent.preventDefault();
|
|
1360
|
-
this.enterEventTarget = undefined;
|
|
1361
|
-
this.rejectedOver = false;
|
|
1362
|
-
this.acceptedOver = false;
|
|
1363
|
-
if (dropEvent.dataTransfer && dropEvent.dataTransfer.files) {
|
|
1364
|
-
if (dropEvent.dataTransfer.files.length > 1) {
|
|
1365
|
-
return;
|
|
1366
|
-
}
|
|
1367
|
-
if (this.fileAttachmentService.hasDirectory(dropEvent.dataTransfer.files)) {
|
|
1368
|
-
return;
|
|
1369
|
-
}
|
|
1370
|
-
this.handleFiles(dropEvent.dataTransfer.files);
|
|
1371
|
-
}
|
|
1372
|
-
};
|
|
1373
|
-
SkyFileAttachmentComponent.prototype.fileDragLeave = function (dragLeaveEvent) {
|
|
1374
|
-
if (this.enterEventTarget === dragLeaveEvent.target) {
|
|
1375
|
-
this.rejectedOver = false;
|
|
1376
|
-
this.acceptedOver = false;
|
|
1377
|
-
}
|
|
1378
|
-
};
|
|
1379
|
-
SkyFileAttachmentComponent.prototype.deleteFileAttachment = function () {
|
|
1380
|
-
this.value = undefined;
|
|
1381
|
-
this.changeDetector.markForCheck();
|
|
1382
|
-
this.emitFileChangeEvent(this.value);
|
|
1383
|
-
};
|
|
1384
|
-
SkyFileAttachmentComponent.prototype.getFileName = function (truncate) {
|
|
1385
|
-
if (truncate === void 0) { truncate = true; }
|
|
1386
|
-
if (this.value) {
|
|
1387
|
-
// tslint:disable-next-line: max-line-length
|
|
1388
|
-
var dropName = this.fileItemService.isFile(this.value) && this.value.file.name
|
|
1389
|
-
? this.value.file.name
|
|
1390
|
-
: this.value.url;
|
|
1391
|
-
if (truncate && dropName.length > 26) {
|
|
1392
|
-
return dropName.slice(0, 26) + '...';
|
|
1393
|
-
}
|
|
1394
|
-
else {
|
|
1395
|
-
return dropName;
|
|
1396
|
-
}
|
|
1397
|
-
}
|
|
1398
|
-
else {
|
|
1399
|
-
return undefined;
|
|
1400
|
-
}
|
|
1401
|
-
};
|
|
1402
|
-
SkyFileAttachmentComponent.prototype.ngOnDestroy = function () {
|
|
1403
|
-
this.fileChange.complete();
|
|
1404
|
-
this.ngUnsubscribe.next();
|
|
1405
|
-
this.ngUnsubscribe.complete();
|
|
1406
|
-
};
|
|
1407
|
-
SkyFileAttachmentComponent.prototype.registerOnChange = function (fn) {
|
|
1408
|
-
this._onChange = fn;
|
|
1409
|
-
};
|
|
1410
|
-
SkyFileAttachmentComponent.prototype.registerOnTouched = function (fn) {
|
|
1411
|
-
this._onTouched = fn;
|
|
1412
|
-
};
|
|
1413
|
-
SkyFileAttachmentComponent.prototype.writeValue = function (value) {
|
|
1414
|
-
this.value = value;
|
|
1415
|
-
this.changeDetector.markForCheck();
|
|
1416
|
-
};
|
|
1417
|
-
/**
|
|
1418
|
-
* @internal
|
|
1419
|
-
* Sets the disabled state of the control. Implemented as a part of ControlValueAccessor.
|
|
1420
|
-
* @param isDisabled Whether the control should be disabled.
|
|
1421
|
-
*/
|
|
1422
|
-
SkyFileAttachmentComponent.prototype.setDisabledState = function (isDisabled) {
|
|
1423
|
-
this.disabled = isDisabled;
|
|
1424
|
-
this.changeDetector.markForCheck();
|
|
1425
|
-
};
|
|
1426
|
-
SkyFileAttachmentComponent.prototype.emitClick = function () {
|
|
1427
|
-
this.fileClick.emit({
|
|
1428
|
-
file: this.value,
|
|
1429
|
-
});
|
|
1430
|
-
};
|
|
1431
|
-
SkyFileAttachmentComponent.prototype.emitFileChangeEvent = function (currentFile) {
|
|
1432
|
-
if (currentFile && !currentFile.errorType) {
|
|
1433
|
-
this.writeValue(currentFile);
|
|
1434
|
-
}
|
|
1435
|
-
this.fileChange.emit({
|
|
1436
|
-
file: currentFile,
|
|
1437
|
-
});
|
|
1438
|
-
this.inputEl.nativeElement.value = '';
|
|
1439
|
-
};
|
|
1440
|
-
SkyFileAttachmentComponent.prototype.loadFile = function (file) {
|
|
1441
|
-
var _this = this;
|
|
1442
|
-
var reader = new FileReader();
|
|
1443
|
-
reader.addEventListener('load', function (event) {
|
|
1444
|
-
file.url = event.target.result;
|
|
1445
|
-
_this.emitFileChangeEvent(file);
|
|
1446
|
-
});
|
|
1447
|
-
reader.addEventListener('error', function (event) {
|
|
1448
|
-
_this.emitFileChangeEvent(file);
|
|
1449
|
-
});
|
|
1450
|
-
reader.addEventListener('abort', function (event) {
|
|
1451
|
-
_this.emitFileChangeEvent(file);
|
|
1452
|
-
});
|
|
1453
|
-
reader.readAsDataURL(file.file);
|
|
1454
|
-
};
|
|
1455
|
-
SkyFileAttachmentComponent.prototype.handleFiles = function (files) {
|
|
1456
|
-
var e_1, _a;
|
|
1457
|
-
// tslint:disable-next-line: max-line-length
|
|
1458
|
-
var processedFiles = this.fileAttachmentService.checkFiles(files, this.minFileSize, this.maxFileSize, this.acceptedTypes, this.validateFn);
|
|
1459
|
-
try {
|
|
1460
|
-
for (var processedFiles_1 = __values(processedFiles), processedFiles_1_1 = processedFiles_1.next(); !processedFiles_1_1.done; processedFiles_1_1 = processedFiles_1.next()) {
|
|
1461
|
-
var file = processedFiles_1_1.value;
|
|
1462
|
-
if (file.errorType) {
|
|
1463
|
-
this.emitFileChangeEvent(file);
|
|
1464
|
-
}
|
|
1465
|
-
else {
|
|
1466
|
-
this.loadFile(file);
|
|
1467
|
-
}
|
|
1468
|
-
}
|
|
1469
|
-
}
|
|
1470
|
-
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
1471
|
-
finally {
|
|
1472
|
-
try {
|
|
1473
|
-
if (processedFiles_1_1 && !processedFiles_1_1.done && (_a = processedFiles_1.return)) _a.call(processedFiles_1);
|
|
1474
|
-
}
|
|
1475
|
-
finally { if (e_1) throw e_1.error; }
|
|
1476
|
-
}
|
|
1477
|
-
};
|
|
1478
|
-
SkyFileAttachmentComponent.prototype.updateFileAttachmentButton = function () {
|
|
1479
|
-
this.showFileAttachmentButton = !(this.value && this.currentThemeName === 'modern');
|
|
1480
|
-
this.changeDetector.markForCheck();
|
|
1481
|
-
};
|
|
1482
|
-
return SkyFileAttachmentComponent;
|
|
1483
|
-
}());
|
|
1484
|
-
SkyFileAttachmentComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyFileAttachmentComponent, deps: [{ token: i1__namespace$1.SkyThemeService }, { token: i0__namespace.ChangeDetectorRef }, { token: SkyFileAttachmentService }, { token: SkyFileItemService }, { token: i4__namespace.NgControl, optional: true, self: true }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
1485
|
-
SkyFileAttachmentComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: SkyFileAttachmentComponent, selector: "sky-file-attachment", inputs: { acceptedTypes: "acceptedTypes", disabled: "disabled", maxFileSize: "maxFileSize", minFileSize: "minFileSize", validateFn: "validateFn", required: "required" }, outputs: { fileChange: "fileChange", fileClick: "fileClick" }, providers: [SkyFileAttachmentService], queries: [{ propertyName: "labelComponents", predicate: SkyFileAttachmentLabelComponent }], viewQueries: [{ propertyName: "inputEl", first: true, predicate: ["fileInput"], descendants: true }], ngImport: i0__namespace, template: "<div class=\"sky-file-attachment-wrapper\">\n <div\n class=\"sky-file-attachment-label-wrapper\"\n [attr.aria-required]=\"required ? true : null\"\n [attr.id]=\"labelElementId\"\n [ngClass]=\"{ 'sky-control-label-required': required && hasLabelComponent }\"\n >\n <ng-container *ngTemplateOutlet=\"labelContent\"></ng-container>\n </div>\n <div\n class=\"\n sky-file-attachment-upload sky-file-attachment sky-file-attachment-target\n \"\n [ngClass]=\"{\n 'sky-file-attachment-accept': acceptedOver,\n 'sky-file-attachment-reject': rejectedOver\n }\"\n (dragenter)=\"fileDragEnter($event)\"\n (dragover)=\"fileDragOver($event)\"\n (dragleave)=\"fileDragLeave($event)\"\n (drop)=\"fileDrop($event)\"\n >\n <div\n aria-hidden=\"true\"\n class=\"sky-file-attachment-drop-description\"\n role=\"tooltip\"\n [attr.id]=\"fileDropDescriptionElementId\"\n >\n {{ 'skyux_file_attachment_file_upload_drag_or_click' | skyLibResources }}\n </div>\n <input\n hidden\n tabindex=\"-1\"\n type=\"file\"\n [attr.accept]=\"acceptedTypes || null\"\n [disabled]=\"disabled\"\n [required]=\"required\"\n (change)=\"fileChangeEvent($event)\"\n #fileInput\n />\n <button\n *ngIf=\"showFileAttachmentButton\"\n class=\"sky-file-attachment-btn sky-btn sky-btn-default\"\n type=\"button\"\n [attr.aria-describedby]=\"fileDropDescriptionElementId\"\n [disabled]=\"disabled\"\n (click)=\"onDropClicked()\"\n >\n <sky-icon icon=\"folder-open-o\"></sky-icon>\n {{\n value\n ? ('skyux_file_attachment_button_label_replace_file'\n | skyLibResources)\n : ('skyux_file_attachment_button_label_choose_file' | skyLibResources)\n }}\n </button>\n <sky-icon\n *ngIf=\"value && !isImage() && currentThemeName === 'modern'\"\n class=\"sky-file-attachment-icon sky-deemphasized\"\n icon=\"file-o\"\n size=\"2x\"\n >\n </sky-icon>\n <span\n *ngIf=\"value || currentThemeName === 'default'\"\n class=\"sky-file-attachment-name\"\n >\n <a\n *ngIf=\"value; else noFile\"\n [attr.title]=\"getFileName(false)\"\n (click)=\"emitClick()\"\n >\n {{ getFileName() }}\n </a>\n </span>\n <ng-template #noFile>\n <span class=\"sky-file-attachment-none sky-deemphasized\">\n {{ 'skyux_file_attachment_label_no_file_chosen' | skyLibResources }}\n </span>\n </ng-template>\n <button\n *ngIf=\"value\"\n class=\"sky-btn sky-btn-borderless sky-file-attachment-delete\"\n type=\"button\"\n [attr.aria-label]=\"\n 'skyux_file_attachment_file_item_delete' | skyLibResources\n \"\n [disabled]=\"disabled\"\n [skyThemeClass]=\"{\n 'sky-btn-icon-borderless': 'modern'\n }\"\n (click)=\"deleteFileAttachment()\"\n >\n <sky-icon icon=\"trash-o\" size=\"md\"> </sky-icon>\n </button>\n </div>\n\n <img\n *ngIf=\"value && isImage()\"\n class=\"sky-file-attachment-preview-img\"\n [alt]=\"\n 'skyux_file_attachment_file_upload_image_preview_alt_text'\n | skyLibResources\n \"\n [src]=\"value.url\"\n />\n</div>\n\n<ng-template #labelContent>\n <ng-content select=\"sky-file-attachment-label\"></ng-content>\n</ng-template>\n", styles: [".sky-file-attachment-wrapper{display:inline-block}.sky-file-attachment-upload{padding-right:8px;display:block;border:1px solid transparent}.sky-file-attachment-accept{border-color:#72bf44;border-style:dashed;border-width:1px;border-radius:5px;color:#212327}.sky-file-attachment-reject{border-color:#ef4044;border-style:dashed;border-width:1px;border-radius:5px;color:#212327}:host(.ng-invalid.ng-dirty) .sky-file-attachment-btn{box-shadow:0 0 8px #ef404499;border:1px solid #ef4044}.sky-file-attachment-name{padding:0 5px}.sky-file-attachment-name a{cursor:pointer}.sky-file-attachment-delete{border:none;color:#cdcfd2;cursor:pointer;padding:0}.sky-file-attachment-delete:hover{color:#979ba2;transition:color .15s}.sky-file-attachment-preview-img{max-width:25%;height:auto;box-shadow:0 0 5px #666;margin:10px}.sky-file-attachment-drop-description{position:absolute;left:-10000px;top:auto;width:1px;height:1px;overflow:hidden}:host-context(.sky-theme-modern) .sky-file-attachment-none{font-size:13px}:host-context(.sky-theme-modern) .sky-file-attachment-wrapper{display:flex;flex-wrap:wrap}:host-context(.sky-theme-modern) .sky-file-attachment-wrapper .sky-file-attachment-label-wrapper{width:100%}:host-context(.sky-theme-modern) .sky-file-attachment-wrapper .sky-file-attachment-preview-img{border-top:1px solid #cdcfd2;border-bottom:1px solid #cdcfd2;border-left:1px solid #cdcfd2;border-right:1px solid #cdcfd2;box-shadow:none;margin:0 10px 0 0;width:100px;flex:0;order:1}:host-context(.sky-theme-modern) .sky-file-attachment-wrapper .sky-file-attachment-btn{margin:0 10px 0 0}:host-context(.sky-theme-modern) .sky-file-attachment-wrapper .sky-file-attachment-icon{margin:5px 10px 5px 5px}:host-context(.sky-theme-modern) .sky-file-attachment-wrapper .sky-file-attachment-upload{flex:1;order:2;display:flex;align-items:flex-start}:host-context(.sky-theme-modern) .sky-file-attachment-wrapper .sky-file-attachment-upload .sky-file-attachment-name{margin:10px 10px 0 0;padding:0}:host-context(.sky-theme-modern) .sky-file-attachment-wrapper .sky-file-attachment-delete{width:40px;height:40px;color:#686c73!important}.sky-theme-modern .sky-file-attachment-none{font-size:13px}.sky-theme-modern .sky-file-attachment-wrapper{display:flex;flex-wrap:wrap}.sky-theme-modern .sky-file-attachment-wrapper .sky-file-attachment-label-wrapper{width:100%}.sky-theme-modern .sky-file-attachment-wrapper .sky-file-attachment-preview-img{border-top:1px solid #cdcfd2;border-bottom:1px solid #cdcfd2;border-left:1px solid #cdcfd2;border-right:1px solid #cdcfd2;box-shadow:none;margin:0 10px 0 0;width:100px;flex:0;order:1}.sky-theme-modern .sky-file-attachment-wrapper .sky-file-attachment-btn{margin:0 10px 0 0}.sky-theme-modern .sky-file-attachment-wrapper .sky-file-attachment-icon{margin:5px 10px 5px 5px}.sky-theme-modern .sky-file-attachment-wrapper .sky-file-attachment-upload{flex:1;order:2;display:flex;align-items:flex-start}.sky-theme-modern .sky-file-attachment-wrapper .sky-file-attachment-upload .sky-file-attachment-name{margin:10px 10px 0 0;padding:0}.sky-theme-modern .sky-file-attachment-wrapper .sky-file-attachment-delete{width:40px;height:40px;color:#686c73!important}\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.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }, { type: i1__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1__namespace$1.λ2, selector: "[skyThemeClass]", inputs: ["class", "skyThemeClass"] }], pipes: { "skyLibResources": i2__namespace.SkyLibResourcesPipe }, changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush });
|
|
1486
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyFileAttachmentComponent, decorators: [{
|
|
1487
|
-
type: i0.Component,
|
|
1488
|
-
args: [{
|
|
1489
|
-
selector: 'sky-file-attachment',
|
|
1490
|
-
template: "<div class=\"sky-file-attachment-wrapper\">\n <div\n class=\"sky-file-attachment-label-wrapper\"\n [attr.aria-required]=\"required ? true : null\"\n [attr.id]=\"labelElementId\"\n [ngClass]=\"{ 'sky-control-label-required': required && hasLabelComponent }\"\n >\n <ng-container *ngTemplateOutlet=\"labelContent\"></ng-container>\n </div>\n <div\n class=\"\n sky-file-attachment-upload sky-file-attachment sky-file-attachment-target\n \"\n [ngClass]=\"{\n 'sky-file-attachment-accept': acceptedOver,\n 'sky-file-attachment-reject': rejectedOver\n }\"\n (dragenter)=\"fileDragEnter($event)\"\n (dragover)=\"fileDragOver($event)\"\n (dragleave)=\"fileDragLeave($event)\"\n (drop)=\"fileDrop($event)\"\n >\n <div\n aria-hidden=\"true\"\n class=\"sky-file-attachment-drop-description\"\n role=\"tooltip\"\n [attr.id]=\"fileDropDescriptionElementId\"\n >\n {{ 'skyux_file_attachment_file_upload_drag_or_click' | skyLibResources }}\n </div>\n <input\n hidden\n tabindex=\"-1\"\n type=\"file\"\n [attr.accept]=\"acceptedTypes || null\"\n [disabled]=\"disabled\"\n [required]=\"required\"\n (change)=\"fileChangeEvent($event)\"\n #fileInput\n />\n <button\n *ngIf=\"showFileAttachmentButton\"\n class=\"sky-file-attachment-btn sky-btn sky-btn-default\"\n type=\"button\"\n [attr.aria-describedby]=\"fileDropDescriptionElementId\"\n [disabled]=\"disabled\"\n (click)=\"onDropClicked()\"\n >\n <sky-icon icon=\"folder-open-o\"></sky-icon>\n {{\n value\n ? ('skyux_file_attachment_button_label_replace_file'\n | skyLibResources)\n : ('skyux_file_attachment_button_label_choose_file' | skyLibResources)\n }}\n </button>\n <sky-icon\n *ngIf=\"value && !isImage() && currentThemeName === 'modern'\"\n class=\"sky-file-attachment-icon sky-deemphasized\"\n icon=\"file-o\"\n size=\"2x\"\n >\n </sky-icon>\n <span\n *ngIf=\"value || currentThemeName === 'default'\"\n class=\"sky-file-attachment-name\"\n >\n <a\n *ngIf=\"value; else noFile\"\n [attr.title]=\"getFileName(false)\"\n (click)=\"emitClick()\"\n >\n {{ getFileName() }}\n </a>\n </span>\n <ng-template #noFile>\n <span class=\"sky-file-attachment-none sky-deemphasized\">\n {{ 'skyux_file_attachment_label_no_file_chosen' | skyLibResources }}\n </span>\n </ng-template>\n <button\n *ngIf=\"value\"\n class=\"sky-btn sky-btn-borderless sky-file-attachment-delete\"\n type=\"button\"\n [attr.aria-label]=\"\n 'skyux_file_attachment_file_item_delete' | skyLibResources\n \"\n [disabled]=\"disabled\"\n [skyThemeClass]=\"{\n 'sky-btn-icon-borderless': 'modern'\n }\"\n (click)=\"deleteFileAttachment()\"\n >\n <sky-icon icon=\"trash-o\" size=\"md\"> </sky-icon>\n </button>\n </div>\n\n <img\n *ngIf=\"value && isImage()\"\n class=\"sky-file-attachment-preview-img\"\n [alt]=\"\n 'skyux_file_attachment_file_upload_image_preview_alt_text'\n | skyLibResources\n \"\n [src]=\"value.url\"\n />\n</div>\n\n<ng-template #labelContent>\n <ng-content select=\"sky-file-attachment-label\"></ng-content>\n</ng-template>\n",
|
|
1491
|
-
styles: [".sky-file-attachment-wrapper{display:inline-block}.sky-file-attachment-upload{padding-right:8px;display:block;border:1px solid transparent}.sky-file-attachment-accept{border-color:#72bf44;border-style:dashed;border-width:1px;border-radius:5px;color:#212327}.sky-file-attachment-reject{border-color:#ef4044;border-style:dashed;border-width:1px;border-radius:5px;color:#212327}:host(.ng-invalid.ng-dirty) .sky-file-attachment-btn{box-shadow:0 0 8px #ef404499;border:1px solid #ef4044}.sky-file-attachment-name{padding:0 5px}.sky-file-attachment-name a{cursor:pointer}.sky-file-attachment-delete{border:none;color:#cdcfd2;cursor:pointer;padding:0}.sky-file-attachment-delete:hover{color:#979ba2;transition:color .15s}.sky-file-attachment-preview-img{max-width:25%;height:auto;box-shadow:0 0 5px #666;margin:10px}.sky-file-attachment-drop-description{position:absolute;left:-10000px;top:auto;width:1px;height:1px;overflow:hidden}:host-context(.sky-theme-modern) .sky-file-attachment-none{font-size:13px}:host-context(.sky-theme-modern) .sky-file-attachment-wrapper{display:flex;flex-wrap:wrap}:host-context(.sky-theme-modern) .sky-file-attachment-wrapper .sky-file-attachment-label-wrapper{width:100%}:host-context(.sky-theme-modern) .sky-file-attachment-wrapper .sky-file-attachment-preview-img{border-top:1px solid #cdcfd2;border-bottom:1px solid #cdcfd2;border-left:1px solid #cdcfd2;border-right:1px solid #cdcfd2;box-shadow:none;margin:0 10px 0 0;width:100px;flex:0;order:1}:host-context(.sky-theme-modern) .sky-file-attachment-wrapper .sky-file-attachment-btn{margin:0 10px 0 0}:host-context(.sky-theme-modern) .sky-file-attachment-wrapper .sky-file-attachment-icon{margin:5px 10px 5px 5px}:host-context(.sky-theme-modern) .sky-file-attachment-wrapper .sky-file-attachment-upload{flex:1;order:2;display:flex;align-items:flex-start}:host-context(.sky-theme-modern) .sky-file-attachment-wrapper .sky-file-attachment-upload .sky-file-attachment-name{margin:10px 10px 0 0;padding:0}:host-context(.sky-theme-modern) .sky-file-attachment-wrapper .sky-file-attachment-delete{width:40px;height:40px;color:#686c73!important}.sky-theme-modern .sky-file-attachment-none{font-size:13px}.sky-theme-modern .sky-file-attachment-wrapper{display:flex;flex-wrap:wrap}.sky-theme-modern .sky-file-attachment-wrapper .sky-file-attachment-label-wrapper{width:100%}.sky-theme-modern .sky-file-attachment-wrapper .sky-file-attachment-preview-img{border-top:1px solid #cdcfd2;border-bottom:1px solid #cdcfd2;border-left:1px solid #cdcfd2;border-right:1px solid #cdcfd2;box-shadow:none;margin:0 10px 0 0;width:100px;flex:0;order:1}.sky-theme-modern .sky-file-attachment-wrapper .sky-file-attachment-btn{margin:0 10px 0 0}.sky-theme-modern .sky-file-attachment-wrapper .sky-file-attachment-icon{margin:5px 10px 5px 5px}.sky-theme-modern .sky-file-attachment-wrapper .sky-file-attachment-upload{flex:1;order:2;display:flex;align-items:flex-start}.sky-theme-modern .sky-file-attachment-wrapper .sky-file-attachment-upload .sky-file-attachment-name{margin:10px 10px 0 0;padding:0}.sky-theme-modern .sky-file-attachment-wrapper .sky-file-attachment-delete{width:40px;height:40px;color:#686c73!important}\n"],
|
|
1492
|
-
providers: [SkyFileAttachmentService],
|
|
1493
|
-
changeDetection: i0.ChangeDetectionStrategy.OnPush,
|
|
1494
|
-
}]
|
|
1495
|
-
}], ctorParameters: function () {
|
|
1496
|
-
return [{ type: i1__namespace$1.SkyThemeService }, { type: i0__namespace.ChangeDetectorRef }, { type: SkyFileAttachmentService }, { type: SkyFileItemService }, { type: i4__namespace.NgControl, decorators: [{
|
|
1497
|
-
type: i0.Self
|
|
1498
|
-
}, {
|
|
1499
|
-
type: i0.Optional
|
|
1500
|
-
}] }];
|
|
1501
|
-
}, propDecorators: { acceptedTypes: [{
|
|
1502
|
-
type: i0.Input
|
|
1503
|
-
}], disabled: [{
|
|
1504
|
-
type: i0.Input
|
|
1505
|
-
}], maxFileSize: [{
|
|
1506
|
-
type: i0.Input
|
|
1507
|
-
}], minFileSize: [{
|
|
1508
|
-
type: i0.Input
|
|
1509
|
-
}], validateFn: [{
|
|
1510
|
-
type: i0.Input
|
|
1511
|
-
}], fileChange: [{
|
|
1512
|
-
type: i0.Output
|
|
1513
|
-
}], fileClick: [{
|
|
1514
|
-
type: i0.Output
|
|
1515
|
-
}], required: [{
|
|
1516
|
-
type: i0.Input
|
|
1517
|
-
}], inputEl: [{
|
|
1518
|
-
type: i0.ViewChild,
|
|
1519
|
-
args: ['fileInput']
|
|
1520
|
-
}], labelComponents: [{
|
|
1521
|
-
type: i0.ContentChildren,
|
|
1522
|
-
args: [SkyFileAttachmentLabelComponent]
|
|
1523
|
-
}] } });
|
|
1524
|
-
|
|
1525
|
-
/**
|
|
1526
|
-
* Provides an element to attach multiple files where users can browse or drag and drop local files
|
|
1527
|
-
* or provide hyperlinks to external files. You can leave the contents of the component
|
|
1528
|
-
* blank to display the drop zone's default UI, or you can specify custom content to
|
|
1529
|
-
* display instead. When the module initializes, it disables the ability to drag and
|
|
1530
|
-
* drop files for the entire window to prevent the browser from opening files that are
|
|
1531
|
-
* accidentally dropped outside the target zone. If you implement your own file drop functionality
|
|
1532
|
-
* outside of the file drop component, you can place the `sky-file-drop-target` CSS class
|
|
1533
|
-
* on the element that receives drop events to exempt it from the drop exclusion rule.
|
|
1534
|
-
*/
|
|
1535
|
-
var SkyFileDropComponent = /** @class */ (function () {
|
|
1536
|
-
function SkyFileDropComponent(fileAttachmentService) {
|
|
1537
|
-
this.fileAttachmentService = fileAttachmentService;
|
|
1538
|
-
/**
|
|
1539
|
-
* Fires when users add or remove files.
|
|
1540
|
-
*/
|
|
1541
|
-
this.filesChanged = new i0.EventEmitter();
|
|
1542
|
-
/**
|
|
1543
|
-
* Fires when the link input box triggers a blur event.
|
|
1544
|
-
*/
|
|
1545
|
-
this.linkInputBlur = new i0.EventEmitter();
|
|
1546
|
-
/**
|
|
1547
|
-
* Fires when users add or remove links.
|
|
1548
|
-
*/
|
|
1549
|
-
this.linkChanged = new i0.EventEmitter();
|
|
1550
|
-
/**
|
|
1551
|
-
* Specifies the minimum size in bytes for valid files.
|
|
1552
|
-
*/
|
|
1553
|
-
this.minFileSize = 0;
|
|
1554
|
-
/**
|
|
1555
|
-
* Specifies the maximum size in bytes for valid files.
|
|
1556
|
-
*/
|
|
1557
|
-
this.maxFileSize = 500000;
|
|
1558
|
-
/**
|
|
1559
|
-
* Indicates whether users can drag and drop multiple files at the same time.
|
|
1560
|
-
*/
|
|
1561
|
-
this.multiple = true;
|
|
1562
|
-
/**
|
|
1563
|
-
* Indicates whether to disable the option to browse for files to attach.
|
|
1564
|
-
*/
|
|
1565
|
-
this.noClick = false;
|
|
1566
|
-
/**
|
|
1567
|
-
* Indicates whether to display the option to attach files from URLs rather than from local devices.
|
|
1568
|
-
*/
|
|
1569
|
-
this.allowLinks = false;
|
|
1570
|
-
this.rejectedOver = false;
|
|
1571
|
-
this.acceptedOver = false;
|
|
1572
|
-
}
|
|
1573
|
-
SkyFileDropComponent.prototype.ngOnDestroy = function () {
|
|
1574
|
-
this.filesChanged.complete();
|
|
1575
|
-
this.linkChanged.complete();
|
|
1576
|
-
this.linkInputBlur.complete();
|
|
1577
|
-
};
|
|
1578
|
-
SkyFileDropComponent.prototype.dropClicked = function () {
|
|
1579
|
-
if (!this.noClick) {
|
|
1580
|
-
this.inputEl.nativeElement.click();
|
|
1581
|
-
}
|
|
1582
|
-
};
|
|
1583
|
-
SkyFileDropComponent.prototype.fileChangeEvent = function (fileChangeEvent) {
|
|
1584
|
-
this.handleFiles(fileChangeEvent.target.files);
|
|
1585
|
-
};
|
|
1586
|
-
SkyFileDropComponent.prototype.fileDragEnter = function (dragEnterEvent) {
|
|
1587
|
-
// Save this target to know when the drag event leaves
|
|
1588
|
-
this.enterEventTarget = dragEnterEvent.target;
|
|
1589
|
-
dragEnterEvent.stopPropagation();
|
|
1590
|
-
dragEnterEvent.preventDefault();
|
|
1591
|
-
};
|
|
1592
|
-
SkyFileDropComponent.prototype.fileDragOver = function (dragOverEvent) {
|
|
1593
|
-
var transfer = dragOverEvent.dataTransfer;
|
|
1594
|
-
dragOverEvent.stopPropagation();
|
|
1595
|
-
dragOverEvent.preventDefault();
|
|
1596
|
-
if (transfer) {
|
|
1597
|
-
if (transfer.items) {
|
|
1598
|
-
var files = transfer.items;
|
|
1599
|
-
for (var index = 0; index < files.length; index++) {
|
|
1600
|
-
var file = files[index];
|
|
1601
|
-
if (file.type &&
|
|
1602
|
-
this.fileAttachmentService.fileTypeRejected(file.type, this.acceptedTypes)) {
|
|
1603
|
-
this.rejectedOver = true;
|
|
1604
|
-
this.acceptedOver = false;
|
|
1605
|
-
return;
|
|
1606
|
-
}
|
|
1607
|
-
}
|
|
1608
|
-
if (files.length > 0 && !this.acceptedOver) {
|
|
1609
|
-
this.rejectedOver = false;
|
|
1610
|
-
this.acceptedOver = true;
|
|
1611
|
-
}
|
|
1612
|
-
} /* istanbul ignore next: untestable */
|
|
1613
|
-
else if (transfer.files) {
|
|
1614
|
-
// If the browser does not support DataTransfer.items,
|
|
1615
|
-
// defer file-type checking to drop handler.
|
|
1616
|
-
// https://developer.mozilla.org/en-US/docs/Web/API/DataTransfer/items#Browser_compatibility
|
|
1617
|
-
this.rejectedOver = false;
|
|
1618
|
-
this.acceptedOver = true;
|
|
1619
|
-
}
|
|
1620
|
-
}
|
|
1621
|
-
};
|
|
1622
|
-
SkyFileDropComponent.prototype.fileDrop = function (dropEvent) {
|
|
1623
|
-
dropEvent.stopPropagation();
|
|
1624
|
-
dropEvent.preventDefault();
|
|
1625
|
-
this.enterEventTarget = undefined;
|
|
1626
|
-
this.rejectedOver = false;
|
|
1627
|
-
this.acceptedOver = false;
|
|
1628
|
-
if (dropEvent.dataTransfer && dropEvent.dataTransfer.files) {
|
|
1629
|
-
var hasDirectory = this.fileAttachmentService.hasDirectory(dropEvent.dataTransfer.files);
|
|
1630
|
-
var invalidNumberOfFiles = !this.multiple && dropEvent.dataTransfer.files.length > 1;
|
|
1631
|
-
if (hasDirectory || invalidNumberOfFiles) {
|
|
1632
|
-
return;
|
|
1633
|
-
}
|
|
1634
|
-
this.handleFiles(dropEvent.dataTransfer.files);
|
|
1635
|
-
}
|
|
1636
|
-
};
|
|
1637
|
-
SkyFileDropComponent.prototype.fileDragLeave = function (dragLeaveEvent) {
|
|
1638
|
-
if (this.enterEventTarget === dragLeaveEvent.target) {
|
|
1639
|
-
this.rejectedOver = false;
|
|
1640
|
-
this.acceptedOver = false;
|
|
1641
|
-
}
|
|
1642
|
-
};
|
|
1643
|
-
SkyFileDropComponent.prototype.addLinkEnter = function (event) {
|
|
1644
|
-
if (event.which === 13) {
|
|
1645
|
-
this.addLink(event);
|
|
1646
|
-
}
|
|
1647
|
-
};
|
|
1648
|
-
SkyFileDropComponent.prototype.addLink = function (event) {
|
|
1649
|
-
event.preventDefault();
|
|
1650
|
-
this.linkChanged.emit({ url: this.linkUrl });
|
|
1651
|
-
this.linkUrl = undefined;
|
|
1652
|
-
};
|
|
1653
|
-
SkyFileDropComponent.prototype.onLinkBlur = function () {
|
|
1654
|
-
this.linkInputBlur.emit();
|
|
1655
|
-
};
|
|
1656
|
-
SkyFileDropComponent.prototype.emitFileChangeEvent = function (totalFiles, rejectedFileArray, validFileArray) {
|
|
1657
|
-
if (totalFiles === rejectedFileArray.length + validFileArray.length) {
|
|
1658
|
-
this.filesChanged.emit({
|
|
1659
|
-
files: validFileArray,
|
|
1660
|
-
rejectedFiles: rejectedFileArray,
|
|
1661
|
-
});
|
|
1662
|
-
this.inputEl.nativeElement.value = '';
|
|
1663
|
-
}
|
|
1664
|
-
};
|
|
1665
|
-
SkyFileDropComponent.prototype.filesRejected = function (file, validFileArray, rejectedFileArray, totalFiles) {
|
|
1666
|
-
rejectedFileArray.push(file);
|
|
1667
|
-
this.emitFileChangeEvent(totalFiles, rejectedFileArray, validFileArray);
|
|
1668
|
-
};
|
|
1669
|
-
SkyFileDropComponent.prototype.loadFile = function (fileDrop, file, validFileArray, rejectedFileArray, totalFiles) {
|
|
1670
|
-
var reader = new FileReader();
|
|
1671
|
-
reader.addEventListener('load', function (event) {
|
|
1672
|
-
file.url = event.target.result;
|
|
1673
|
-
validFileArray.push(file);
|
|
1674
|
-
fileDrop.emitFileChangeEvent(totalFiles, rejectedFileArray, validFileArray);
|
|
1675
|
-
});
|
|
1676
|
-
reader.addEventListener('error', function (event) {
|
|
1677
|
-
fileDrop.filesRejected(file, validFileArray, rejectedFileArray, totalFiles);
|
|
1678
|
-
});
|
|
1679
|
-
reader.addEventListener('abort', function (event) {
|
|
1680
|
-
fileDrop.filesRejected(file, validFileArray, rejectedFileArray, totalFiles);
|
|
1681
|
-
});
|
|
1682
|
-
reader.readAsDataURL(file.file);
|
|
1683
|
-
};
|
|
1684
|
-
SkyFileDropComponent.prototype.handleFiles = function (files) {
|
|
1685
|
-
var e_1, _a;
|
|
1686
|
-
var validFileArray = [];
|
|
1687
|
-
var rejectedFileArray = [];
|
|
1688
|
-
var totalFiles = files.length;
|
|
1689
|
-
// tslint:disable-next-line: max-line-length
|
|
1690
|
-
var processedFiles = this.fileAttachmentService.checkFiles(files, this.minFileSize, this.maxFileSize, this.acceptedTypes, this.validateFn);
|
|
1691
|
-
try {
|
|
1692
|
-
for (var processedFiles_1 = __values(processedFiles), processedFiles_1_1 = processedFiles_1.next(); !processedFiles_1_1.done; processedFiles_1_1 = processedFiles_1.next()) {
|
|
1693
|
-
var file = processedFiles_1_1.value;
|
|
1694
|
-
if (file.errorType) {
|
|
1695
|
-
this.filesRejected(file, validFileArray, rejectedFileArray, totalFiles);
|
|
1696
|
-
}
|
|
1697
|
-
else {
|
|
1698
|
-
this.loadFile(this, file, validFileArray, rejectedFileArray, totalFiles);
|
|
1699
|
-
}
|
|
1700
|
-
}
|
|
1701
|
-
}
|
|
1702
|
-
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
1703
|
-
finally {
|
|
1704
|
-
try {
|
|
1705
|
-
if (processedFiles_1_1 && !processedFiles_1_1.done && (_a = processedFiles_1.return)) _a.call(processedFiles_1);
|
|
1706
|
-
}
|
|
1707
|
-
finally { if (e_1) throw e_1.error; }
|
|
1708
|
-
}
|
|
1709
|
-
};
|
|
1710
|
-
return SkyFileDropComponent;
|
|
1711
|
-
}());
|
|
1712
|
-
SkyFileDropComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyFileDropComponent, deps: [{ token: SkyFileAttachmentService }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
1713
|
-
SkyFileDropComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: SkyFileDropComponent, selector: "sky-file-drop", inputs: { fileUploadAriaLabel: "fileUploadAriaLabel", linkUploadAriaLabel: "linkUploadAriaLabel", minFileSize: "minFileSize", maxFileSize: "maxFileSize", multiple: "multiple", validateFn: "validateFn", acceptedTypes: "acceptedTypes", noClick: "noClick", allowLinks: "allowLinks" }, outputs: { filesChanged: "filesChanged", linkInputBlur: "linkInputBlur", linkChanged: "linkChanged" }, providers: [SkyFileAttachmentService], viewQueries: [{ propertyName: "inputEl", first: true, predicate: ["fileInput"], descendants: true }], ngImport: i0__namespace, template: "<div\n class=\"sky-file-drop-row\"\n [ngClass]=\"{ 'sky-file-drop-allow-links': allowLinks }\"\n>\n <div\n class=\"sky-file-drop-col\"\n [ngClass]=\"{\n 'sky-file-drop-accept': acceptedOver,\n 'sky-file-drop-reject': rejectedOver\n }\"\n >\n <button\n class=\"sky-file-drop sky-file-drop-target\"\n type=\"button\"\n (click)=\"dropClicked()\"\n (dragover)=\"fileDragOver($event)\"\n (dragenter)=\"fileDragEnter($event)\"\n (dragleave)=\"fileDragLeave($event)\"\n (drop)=\"fileDrop($event)\"\n [attr.aria-label]=\"\n fileUploadAriaLabel ||\n ('skyux_file_attachment_file_upload_drag_or_click' | skyLibResources)\n \"\n ></button>\n\n <input\n tabindex=\"-1\"\n aria-hidden=\"true\"\n type=\"file\"\n class=\"sky-file-input-hidden\"\n [attr.multiple]=\"multiple ? multiple : null\"\n [attr.accept]=\"acceptedTypes ? acceptedTypes : null\"\n (change)=\"fileChangeEvent($event)\"\n #fileInput\n />\n\n <div\n class=\"sky-file-drop-contents sky-padding-even-default\"\n *ngIf=\"customEl.children.length === 0\"\n >\n <div class=\"sky-file-drop-contents-not-over\">\n <div class=\"sky-file-drop-text-header sky-headline\">\n {{\n 'skyux_file_attachment_file_upload_drag_file_here' | skyLibResources\n }}\n </div>\n <div class=\"sky-file-drop-text\">\n {{\n 'skyux_file_attachment_file_upload_or_click_to_browse'\n | skyLibResources\n }}\n </div>\n <sky-icon icon=\"cloud-upload\" class=\"sky-file-upload-icon\"></sky-icon>\n </div>\n\n <!-- This will appear when file is dragged over and is valid -->\n <div class=\"sky-file-drop-contents-accept\">\n <div class=\"sky-file-drop-text-header sky-headline\">\n {{\n 'skyux_file_attachment_file_upload_drop_files_here'\n | skyLibResources\n }}\n </div>\n <sky-icon icon=\"bullseye\" class=\"sky-file-upload-icon\"></sky-icon>\n </div>\n\n <!-- This will appear when file is dragged over and is invalid -->\n <div class=\"sky-file-drop-contents-reject\">\n <div class=\"sky-file-drop-text-header sky-headline\">\n {{\n 'skyux_file_attachment_file_upload_invalid_file' | skyLibResources\n }}\n </div>\n <sky-icon icon=\"times-circle\" class=\"sky-file-upload-icon\"></sky-icon>\n </div>\n </div>\n\n <div class=\"sky-file-drop-contents-custom\" #customEl>\n <ng-content></ng-content>\n </div>\n </div>\n <div class=\"sky-file-drop-col\" *ngIf=\"allowLinks\">\n <div class=\"sky-file-drop-contents sky-padding-even-default\">\n <div class=\"sky-file-drop-link\">\n <div class=\"sky-file-drop-link-header\">\n <div class=\"sky-file-drop-text-header sky-headline\">\n {{\n 'skyux_file_attachment_file_upload_paste_link' | skyLibResources\n }}\n </div>\n </div>\n <div class=\"sky-form-group\">\n <input\n type=\"text\"\n class=\"sky-form-control\"\n [attr.aria-label]=\"\n linkUploadAriaLabel ||\n ('skyux_file_attachment_file_upload_link_input' | skyLibResources)\n \"\n [attr.placeholder]=\"\n 'skyux_file_attachment_file_upload_link_placeholder'\n | skyLibResources\n \"\n [(ngModel)]=\"linkUrl\"\n (blur)=\"onLinkBlur()\"\n (keyup)=\"addLinkEnter($event)\"\n />\n </div>\n <button\n type=\"button\"\n class=\"sky-btn sky-btn-primary\"\n [disabled]=\"!linkUrl\"\n (click)=\"addLink($event)\"\n >\n {{\n 'skyux_file_attachment_file_upload_paste_link_done'\n | skyLibResources\n }}\n </button>\n </div>\n </div>\n </div>\n</div>\n", styles: [".sky-file-drop-col{margin-bottom:10px;padding-left:5px;padding-right:5px;position:relative}:host .sky-file-drop-row{display:block}:host .sky-file-drop-col{flex-basis:auto}:host .sky-file-drop-allow-links .sky-file-drop-col{flex-basis:auto}:host-context(.sky-responsive-container-xs) .sky-file-drop-row,:host-context(.sky-responsive-container-sm) .sky-file-drop-row,:host-context(.sky-responsive-container-md) .sky-file-drop-row,:host-context(.sky-responsive-container-lg) .sky-file-drop-row{display:block}:host-context(.sky-responsive-container-xs) .sky-file-drop-col,:host-context(.sky-responsive-container-sm) .sky-file-drop-col,:host-context(.sky-responsive-container-md) .sky-file-drop-col,:host-context(.sky-responsive-container-lg) .sky-file-drop-col{flex-basis:auto}:host-context(.sky-responsive-container-xs) .sky-file-drop-allow-links .sky-file-drop-col,:host-context(.sky-responsive-container-sm) .sky-file-drop-allow-links .sky-file-drop-col,:host-context(.sky-responsive-container-md) .sky-file-drop-allow-links .sky-file-drop-col,:host-context(.sky-responsive-container-lg) .sky-file-drop-allow-links .sky-file-drop-col{flex-basis:auto}@media (min-width: 768px){:host .sky-file-drop-row{display:flex}:host .sky-file-drop-col{flex-basis:100%}:host .sky-file-drop-allow-links .sky-file-drop-col{flex-basis:50%}}:host-context(.sky-responsive-container-sm) .sky-file-drop-row,:host-context(.sky-responsive-container-md) .sky-file-drop-row,:host-context(.sky-responsive-container-lg) .sky-file-drop-row{display:flex}:host-context(.sky-responsive-container-sm) .sky-file-drop-col,:host-context(.sky-responsive-container-md) .sky-file-drop-col,:host-context(.sky-responsive-container-lg) .sky-file-drop-col{flex-basis:100%}:host-context(.sky-responsive-container-sm) .sky-file-drop-allow-links .sky-file-drop-col,:host-context(.sky-responsive-container-md) .sky-file-drop-allow-links .sky-file-drop-col,:host-context(.sky-responsive-container-lg) .sky-file-drop-allow-links .sky-file-drop-col{flex-basis:50%}button.sky-file-drop{height:100%;position:absolute;top:0;right:0;bottom:0;left:0;z-index:1}button.sky-file-drop:hover{cursor:pointer}.sky-file-drop-contents{border-top:1px solid #cdcfd2;border-bottom:1px solid #cdcfd2;border-left:1px solid #cdcfd2;border-right:1px solid #cdcfd2;background-color:#eeeeef;color:#212327;cursor:pointer;width:100%;text-align:center;height:100%}.sky-file-drop-contents .sky-file-drop-link-header{margin-bottom:5px}.sky-file-drop-noclick .sky-file-drop-contents{cursor:default}.sky-file-drop-accept .sky-file-drop-contents,.sky-file-drop-reject .sky-file-drop-contents{border-style:dashed;border-width:1px}.sky-file-drop-accept .sky-file-drop-contents-not-over,.sky-file-drop-reject .sky-file-drop-contents-not-over{display:none}.sky-file-drop-accept .sky-file-drop-contents{border-color:#72bf44;color:#212327}.sky-file-drop-accept .sky-file-drop-contents-accept{display:block}.sky-file-drop-reject .sky-file-drop-contents{border-color:#ef4044;color:#212327}.sky-file-drop-reject .sky-file-drop-contents-reject{display:block}.sky-file-drop-contents-accept,.sky-file-drop-contents-reject{display:none}.sky-file-upload-icon{display:block;font-size:40px;max-height:40px;margin-top:10px}.sky-file-drop-link{cursor:default}.sky-file-drop-text-header{margin:0}.sky-file-drop-text{font-size:15px;margin-top:5px;margin-bottom:20px}.sky-file-drop-text,.sky-file-drop-text-header{line-height:1.1;display:block}.sky-file-upload-icon{color:#686c73}.sky-file-drop{background-color:transparent;border:none;display:block;-webkit-appearance:none;width:100%;padding:0}.sky-file-input-hidden{display:none}\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"] }, { type: i4__namespace.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i4__namespace.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i4__namespace.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }], pipes: { "skyLibResources": i2__namespace.SkyLibResourcesPipe } });
|
|
1714
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyFileDropComponent, decorators: [{
|
|
1715
|
-
type: i0.Component,
|
|
1716
|
-
args: [{
|
|
1717
|
-
selector: 'sky-file-drop',
|
|
1718
|
-
template: "<div\n class=\"sky-file-drop-row\"\n [ngClass]=\"{ 'sky-file-drop-allow-links': allowLinks }\"\n>\n <div\n class=\"sky-file-drop-col\"\n [ngClass]=\"{\n 'sky-file-drop-accept': acceptedOver,\n 'sky-file-drop-reject': rejectedOver\n }\"\n >\n <button\n class=\"sky-file-drop sky-file-drop-target\"\n type=\"button\"\n (click)=\"dropClicked()\"\n (dragover)=\"fileDragOver($event)\"\n (dragenter)=\"fileDragEnter($event)\"\n (dragleave)=\"fileDragLeave($event)\"\n (drop)=\"fileDrop($event)\"\n [attr.aria-label]=\"\n fileUploadAriaLabel ||\n ('skyux_file_attachment_file_upload_drag_or_click' | skyLibResources)\n \"\n ></button>\n\n <input\n tabindex=\"-1\"\n aria-hidden=\"true\"\n type=\"file\"\n class=\"sky-file-input-hidden\"\n [attr.multiple]=\"multiple ? multiple : null\"\n [attr.accept]=\"acceptedTypes ? acceptedTypes : null\"\n (change)=\"fileChangeEvent($event)\"\n #fileInput\n />\n\n <div\n class=\"sky-file-drop-contents sky-padding-even-default\"\n *ngIf=\"customEl.children.length === 0\"\n >\n <div class=\"sky-file-drop-contents-not-over\">\n <div class=\"sky-file-drop-text-header sky-headline\">\n {{\n 'skyux_file_attachment_file_upload_drag_file_here' | skyLibResources\n }}\n </div>\n <div class=\"sky-file-drop-text\">\n {{\n 'skyux_file_attachment_file_upload_or_click_to_browse'\n | skyLibResources\n }}\n </div>\n <sky-icon icon=\"cloud-upload\" class=\"sky-file-upload-icon\"></sky-icon>\n </div>\n\n <!-- This will appear when file is dragged over and is valid -->\n <div class=\"sky-file-drop-contents-accept\">\n <div class=\"sky-file-drop-text-header sky-headline\">\n {{\n 'skyux_file_attachment_file_upload_drop_files_here'\n | skyLibResources\n }}\n </div>\n <sky-icon icon=\"bullseye\" class=\"sky-file-upload-icon\"></sky-icon>\n </div>\n\n <!-- This will appear when file is dragged over and is invalid -->\n <div class=\"sky-file-drop-contents-reject\">\n <div class=\"sky-file-drop-text-header sky-headline\">\n {{\n 'skyux_file_attachment_file_upload_invalid_file' | skyLibResources\n }}\n </div>\n <sky-icon icon=\"times-circle\" class=\"sky-file-upload-icon\"></sky-icon>\n </div>\n </div>\n\n <div class=\"sky-file-drop-contents-custom\" #customEl>\n <ng-content></ng-content>\n </div>\n </div>\n <div class=\"sky-file-drop-col\" *ngIf=\"allowLinks\">\n <div class=\"sky-file-drop-contents sky-padding-even-default\">\n <div class=\"sky-file-drop-link\">\n <div class=\"sky-file-drop-link-header\">\n <div class=\"sky-file-drop-text-header sky-headline\">\n {{\n 'skyux_file_attachment_file_upload_paste_link' | skyLibResources\n }}\n </div>\n </div>\n <div class=\"sky-form-group\">\n <input\n type=\"text\"\n class=\"sky-form-control\"\n [attr.aria-label]=\"\n linkUploadAriaLabel ||\n ('skyux_file_attachment_file_upload_link_input' | skyLibResources)\n \"\n [attr.placeholder]=\"\n 'skyux_file_attachment_file_upload_link_placeholder'\n | skyLibResources\n \"\n [(ngModel)]=\"linkUrl\"\n (blur)=\"onLinkBlur()\"\n (keyup)=\"addLinkEnter($event)\"\n />\n </div>\n <button\n type=\"button\"\n class=\"sky-btn sky-btn-primary\"\n [disabled]=\"!linkUrl\"\n (click)=\"addLink($event)\"\n >\n {{\n 'skyux_file_attachment_file_upload_paste_link_done'\n | skyLibResources\n }}\n </button>\n </div>\n </div>\n </div>\n</div>\n",
|
|
1719
|
-
styles: [".sky-file-drop-col{margin-bottom:10px;padding-left:5px;padding-right:5px;position:relative}:host .sky-file-drop-row{display:block}:host .sky-file-drop-col{flex-basis:auto}:host .sky-file-drop-allow-links .sky-file-drop-col{flex-basis:auto}:host-context(.sky-responsive-container-xs) .sky-file-drop-row,:host-context(.sky-responsive-container-sm) .sky-file-drop-row,:host-context(.sky-responsive-container-md) .sky-file-drop-row,:host-context(.sky-responsive-container-lg) .sky-file-drop-row{display:block}:host-context(.sky-responsive-container-xs) .sky-file-drop-col,:host-context(.sky-responsive-container-sm) .sky-file-drop-col,:host-context(.sky-responsive-container-md) .sky-file-drop-col,:host-context(.sky-responsive-container-lg) .sky-file-drop-col{flex-basis:auto}:host-context(.sky-responsive-container-xs) .sky-file-drop-allow-links .sky-file-drop-col,:host-context(.sky-responsive-container-sm) .sky-file-drop-allow-links .sky-file-drop-col,:host-context(.sky-responsive-container-md) .sky-file-drop-allow-links .sky-file-drop-col,:host-context(.sky-responsive-container-lg) .sky-file-drop-allow-links .sky-file-drop-col{flex-basis:auto}@media (min-width: 768px){:host .sky-file-drop-row{display:flex}:host .sky-file-drop-col{flex-basis:100%}:host .sky-file-drop-allow-links .sky-file-drop-col{flex-basis:50%}}:host-context(.sky-responsive-container-sm) .sky-file-drop-row,:host-context(.sky-responsive-container-md) .sky-file-drop-row,:host-context(.sky-responsive-container-lg) .sky-file-drop-row{display:flex}:host-context(.sky-responsive-container-sm) .sky-file-drop-col,:host-context(.sky-responsive-container-md) .sky-file-drop-col,:host-context(.sky-responsive-container-lg) .sky-file-drop-col{flex-basis:100%}:host-context(.sky-responsive-container-sm) .sky-file-drop-allow-links .sky-file-drop-col,:host-context(.sky-responsive-container-md) .sky-file-drop-allow-links .sky-file-drop-col,:host-context(.sky-responsive-container-lg) .sky-file-drop-allow-links .sky-file-drop-col{flex-basis:50%}button.sky-file-drop{height:100%;position:absolute;top:0;right:0;bottom:0;left:0;z-index:1}button.sky-file-drop:hover{cursor:pointer}.sky-file-drop-contents{border-top:1px solid #cdcfd2;border-bottom:1px solid #cdcfd2;border-left:1px solid #cdcfd2;border-right:1px solid #cdcfd2;background-color:#eeeeef;color:#212327;cursor:pointer;width:100%;text-align:center;height:100%}.sky-file-drop-contents .sky-file-drop-link-header{margin-bottom:5px}.sky-file-drop-noclick .sky-file-drop-contents{cursor:default}.sky-file-drop-accept .sky-file-drop-contents,.sky-file-drop-reject .sky-file-drop-contents{border-style:dashed;border-width:1px}.sky-file-drop-accept .sky-file-drop-contents-not-over,.sky-file-drop-reject .sky-file-drop-contents-not-over{display:none}.sky-file-drop-accept .sky-file-drop-contents{border-color:#72bf44;color:#212327}.sky-file-drop-accept .sky-file-drop-contents-accept{display:block}.sky-file-drop-reject .sky-file-drop-contents{border-color:#ef4044;color:#212327}.sky-file-drop-reject .sky-file-drop-contents-reject{display:block}.sky-file-drop-contents-accept,.sky-file-drop-contents-reject{display:none}.sky-file-upload-icon{display:block;font-size:40px;max-height:40px;margin-top:10px}.sky-file-drop-link{cursor:default}.sky-file-drop-text-header{margin:0}.sky-file-drop-text{font-size:15px;margin-top:5px;margin-bottom:20px}.sky-file-drop-text,.sky-file-drop-text-header{line-height:1.1;display:block}.sky-file-upload-icon{color:#686c73}.sky-file-drop{background-color:transparent;border:none;display:block;-webkit-appearance:none;width:100%;padding:0}.sky-file-input-hidden{display:none}\n"],
|
|
1720
|
-
providers: [SkyFileAttachmentService],
|
|
1721
|
-
}]
|
|
1722
|
-
}], ctorParameters: function () { return [{ type: SkyFileAttachmentService }]; }, propDecorators: { filesChanged: [{
|
|
1723
|
-
type: i0.Output
|
|
1724
|
-
}], linkInputBlur: [{
|
|
1725
|
-
type: i0.Output
|
|
1726
|
-
}], linkChanged: [{
|
|
1727
|
-
type: i0.Output
|
|
1728
|
-
}], fileUploadAriaLabel: [{
|
|
1729
|
-
type: i0.Input
|
|
1730
|
-
}], linkUploadAriaLabel: [{
|
|
1731
|
-
type: i0.Input
|
|
1732
|
-
}], minFileSize: [{
|
|
1733
|
-
type: i0.Input
|
|
1734
|
-
}], maxFileSize: [{
|
|
1735
|
-
type: i0.Input
|
|
1736
|
-
}], multiple: [{
|
|
1737
|
-
type: i0.Input
|
|
1738
|
-
}], validateFn: [{
|
|
1739
|
-
type: i0.Input
|
|
1740
|
-
}], acceptedTypes: [{
|
|
1741
|
-
type: i0.Input
|
|
1742
|
-
}], noClick: [{
|
|
1743
|
-
type: i0.Input
|
|
1744
|
-
}], allowLinks: [{
|
|
1745
|
-
type: i0.Input
|
|
1746
|
-
}], inputEl: [{
|
|
1747
|
-
type: i0.ViewChild,
|
|
1748
|
-
args: ['fileInput']
|
|
1749
|
-
}] } });
|
|
1750
|
-
|
|
1751
|
-
/**
|
|
1752
|
-
* @internal
|
|
1753
|
-
*/
|
|
1754
|
-
var SkyFileSizePipe = /** @class */ (function () {
|
|
1755
|
-
function SkyFileSizePipe(decimalPipe, resourcesService) {
|
|
1756
|
-
this.decimalPipe = decimalPipe;
|
|
1757
|
-
this.resourcesService = resourcesService;
|
|
1758
|
-
}
|
|
1759
|
-
SkyFileSizePipe.prototype.transform = function (input) {
|
|
1760
|
-
var decimalPlaces = 0, dividend = 1, template;
|
|
1761
|
-
/* tslint:disable */
|
|
1762
|
-
if (input === null || input === undefined) {
|
|
1763
|
-
return '';
|
|
1764
|
-
}
|
|
1765
|
-
/* tslint:enable */
|
|
1766
|
-
if (Math.abs(input) === 1) {
|
|
1767
|
-
template = 'skyux_file_attachment_file_size_b_singular';
|
|
1768
|
-
}
|
|
1769
|
-
else if (input < 1000) {
|
|
1770
|
-
template = 'skyux_file_attachment_file_size_b_plural';
|
|
1771
|
-
}
|
|
1772
|
-
else if (input < 1e6) {
|
|
1773
|
-
template = 'skyux_file_attachment_file_size_kb';
|
|
1774
|
-
dividend = 1000;
|
|
1775
|
-
}
|
|
1776
|
-
else if (input < 1e9) {
|
|
1777
|
-
template = 'skyux_file_attachment_file_size_mb';
|
|
1778
|
-
dividend = 1e6;
|
|
1779
|
-
decimalPlaces = 1;
|
|
1780
|
-
}
|
|
1781
|
-
else {
|
|
1782
|
-
template = 'skyux_file_attachment_file_size_gb';
|
|
1783
|
-
dividend = 1e9;
|
|
1784
|
-
decimalPlaces = 1;
|
|
1785
|
-
}
|
|
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
|
-
return this.getString(template, formattedSize);
|
|
1790
|
-
};
|
|
1791
|
-
SkyFileSizePipe.prototype.getString = function (key) {
|
|
1792
|
-
var _a;
|
|
1793
|
-
var args = [];
|
|
1794
|
-
for (var _i = 1; _i < arguments.length; _i++) {
|
|
1795
|
-
args[_i - 1] = arguments[_i];
|
|
1796
|
-
}
|
|
1797
|
-
// TODO: Need to implement the async `getString` method in a breaking change.
|
|
1798
|
-
return (_a = this.resourcesService).getStringForLocale.apply(_a, __spreadArray([{ locale: 'en-US' }, key], __read(args)));
|
|
1799
|
-
};
|
|
1800
|
-
return SkyFileSizePipe;
|
|
1801
|
-
}());
|
|
1802
|
-
SkyFileSizePipe.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyFileSizePipe, deps: [{ token: i1__namespace.DecimalPipe }, { token: i2__namespace.SkyLibResourcesService }], target: i0__namespace.ɵɵFactoryTarget.Pipe });
|
|
1803
|
-
SkyFileSizePipe.ɵpipe = i0__namespace.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyFileSizePipe, name: "skyFileSize" });
|
|
1804
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyFileSizePipe, decorators: [{
|
|
1805
|
-
type: i0.Pipe,
|
|
1806
|
-
args: [{
|
|
1807
|
-
name: 'skyFileSize',
|
|
1808
|
-
}]
|
|
1809
|
-
}], ctorParameters: function () { return [{ type: i1__namespace.DecimalPipe }, { type: i2__namespace.SkyLibResourcesService }]; } });
|
|
1810
|
-
|
|
1811
|
-
var SkyFileItemComponent = /** @class */ (function () {
|
|
1812
|
-
function SkyFileItemComponent(differs, fileItemService) {
|
|
1813
|
-
this.differs = differs;
|
|
1814
|
-
this.fileItemService = fileItemService;
|
|
1815
|
-
/**
|
|
1816
|
-
* Fires when users select the delete button for an item. The deleted item is passed to the
|
|
1817
|
-
* function.
|
|
1818
|
-
*/
|
|
1819
|
-
this.deleteFile = new i0.EventEmitter();
|
|
1820
|
-
this.differ = this.differs.find({}).create();
|
|
1821
|
-
}
|
|
1822
|
-
Object.defineProperty(SkyFileItemComponent.prototype, "fileName", {
|
|
1823
|
-
get: function () {
|
|
1824
|
-
return this.fileItem.file.name;
|
|
1825
|
-
},
|
|
1826
|
-
enumerable: false,
|
|
1827
|
-
configurable: true
|
|
1828
|
-
});
|
|
1829
|
-
Object.defineProperty(SkyFileItemComponent.prototype, "fileSize", {
|
|
1830
|
-
get: function () {
|
|
1831
|
-
return this.fileItem.file.size;
|
|
1832
|
-
},
|
|
1833
|
-
enumerable: false,
|
|
1834
|
-
configurable: true
|
|
1835
|
-
});
|
|
1836
|
-
Object.defineProperty(SkyFileItemComponent.prototype, "url", {
|
|
1837
|
-
get: function () {
|
|
1838
|
-
return this.fileItem.url;
|
|
1839
|
-
},
|
|
1840
|
-
enumerable: false,
|
|
1841
|
-
configurable: true
|
|
1842
|
-
});
|
|
1843
|
-
SkyFileItemComponent.prototype.ngDoCheck = function () {
|
|
1844
|
-
var changes = this.differ.diff(this.fileItem);
|
|
1845
|
-
if (changes) {
|
|
1846
|
-
var cls = void 0;
|
|
1847
|
-
var extensionUpper = this.fileItemService.getFileExtensionUpper(this.fileItem);
|
|
1848
|
-
var fileTypeUpper = void 0;
|
|
1849
|
-
switch (extensionUpper) {
|
|
1850
|
-
case '.PDF':
|
|
1851
|
-
cls = 'pdf';
|
|
1852
|
-
break;
|
|
1853
|
-
case '.GZ':
|
|
1854
|
-
case '.RAR':
|
|
1855
|
-
case '.TGZ':
|
|
1856
|
-
case '.ZIP':
|
|
1857
|
-
cls = 'archive';
|
|
1858
|
-
break;
|
|
1859
|
-
case '.PPT':
|
|
1860
|
-
case '.PPTX':
|
|
1861
|
-
cls = 'powerpoint';
|
|
1862
|
-
break;
|
|
1863
|
-
case '.DOC':
|
|
1864
|
-
case '.DOCX':
|
|
1865
|
-
cls = 'word';
|
|
1866
|
-
break;
|
|
1867
|
-
case '.XLS':
|
|
1868
|
-
case '.XLSX':
|
|
1869
|
-
cls = 'excel';
|
|
1870
|
-
break;
|
|
1871
|
-
case '.TXT':
|
|
1872
|
-
cls = 'text';
|
|
1873
|
-
break;
|
|
1874
|
-
case '.HTM':
|
|
1875
|
-
case '.HTML':
|
|
1876
|
-
cls = 'code';
|
|
1877
|
-
break;
|
|
1878
|
-
default:
|
|
1879
|
-
break;
|
|
1880
|
-
}
|
|
1881
|
-
if (!cls) {
|
|
1882
|
-
fileTypeUpper = this.fileItemService.getFileTypeUpper(this.fileItem);
|
|
1883
|
-
switch (fileTypeUpper.substr(0, fileTypeUpper.indexOf('/'))) {
|
|
1884
|
-
case 'AUDIO':
|
|
1885
|
-
cls = 'audio';
|
|
1886
|
-
break;
|
|
1887
|
-
case 'IMAGE':
|
|
1888
|
-
// Normally images are displayed as thumbnails, but if an image type is not recognized
|
|
1889
|
-
// as being widely supported by modern browsers (e.g. TIFF files) then an icon should
|
|
1890
|
-
// be displayed instead.
|
|
1891
|
-
cls = 'image';
|
|
1892
|
-
break;
|
|
1893
|
-
case 'TEXT':
|
|
1894
|
-
cls = 'text';
|
|
1895
|
-
break;
|
|
1896
|
-
case 'VIDEO':
|
|
1897
|
-
cls = 'video';
|
|
1898
|
-
break;
|
|
1899
|
-
default:
|
|
1900
|
-
break;
|
|
1901
|
-
}
|
|
1902
|
-
}
|
|
1903
|
-
this.icon = 'file-' + (cls ? cls + '-' : '') + 'o';
|
|
1904
|
-
}
|
|
1905
|
-
};
|
|
1906
|
-
SkyFileItemComponent.prototype.itemDelete = function () {
|
|
1907
|
-
this.deleteFile.emit(this.fileItem);
|
|
1908
|
-
};
|
|
1909
|
-
SkyFileItemComponent.prototype.isFile = function () {
|
|
1910
|
-
return this.fileItemService.isFile(this.fileItem);
|
|
1911
|
-
};
|
|
1912
|
-
SkyFileItemComponent.prototype.isImage = function () {
|
|
1913
|
-
return this.fileItemService.isImage(this.fileItem);
|
|
1914
|
-
};
|
|
1915
|
-
return SkyFileItemComponent;
|
|
1916
|
-
}());
|
|
1917
|
-
SkyFileItemComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyFileItemComponent, deps: [{ token: i0__namespace.KeyValueDiffers }, { token: SkyFileItemService }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
1918
|
-
SkyFileItemComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: SkyFileItemComponent, selector: "sky-file-item", inputs: { fileItem: "fileItem" }, outputs: { deleteFile: "deleteFile" }, ngImport: i0__namespace, template: "<div class=\"sky-file-item sky-padding-even-default\">\n <div class=\"sky-file-item-title\">\n <div class=\"sky-file-item-name-container\">\n <div class=\"sky-file-item-name\">\n <strong *ngIf=\"isFile()\">{{ fileName }}</strong>\n <strong *ngIf=\"!isFile()\">{{ url }}</strong>\n </div>\n <div class=\"sky-file-item-size\" *ngIf=\"isFile()\">\n ({{ fileSize | skyFileSize }})\n </div>\n </div>\n <div class=\"sky-file-item-controls\">\n <button\n type=\"button\"\n class=\"sky-btn sky-btn-default sky-file-item-btn-delete\"\n [attr.aria-label]=\"\n 'skyux_file_attachment_file_item_delete' | skyLibResources\n \"\n (click)=\"itemDelete()\"\n >\n <sky-icon icon=\"trash-o\" size=\"lg\"></sky-icon>\n </button>\n </div>\n </div>\n <div class=\"sky-file-item-content\">\n <div class=\"sky-file-item-preview\">\n <div *ngIf=\"isImage()\" class=\"sky-file-item-preview-img-container\">\n <img\n class=\"sky-file-item-preview-img\"\n [src]=\"url\"\n [alt]=\"\n 'skyux_file_attachment_file_upload_image_preview_alt_text'\n | skyLibResources\n \"\n />\n </div>\n <div *ngIf=\"!isImage()\" class=\"sky-file-item-preview-other\">\n <sky-icon [icon]=\"icon\"></sky-icon>\n </div>\n </div>\n <div class=\"sky-file-item-content-custom\">\n <ng-content></ng-content>\n </div>\n </div>\n</div>\n", styles: [".sky-file-item{border-top:1px solid #e2e3e4;border-bottom:1px solid #e2e3e4;border-left:1px solid #e2e3e4;border-right:1px solid #e2e3e4;background-color:#eeeeef;margin-bottom:10px}.sky-file-item-name-container{flex:1 1 auto;overflow:hidden}.sky-file-item-controls{flex:0 1 auto;padding-left:15px}.sky-file-item-name{white-space:nowrap;overflow:hidden;-ms-text-overflow:ellipsis;text-overflow:ellipsis}.sky-file-item-title{margin-bottom:10px;display:flex}.sky-file-item-content{display:flex}.sky-file-item-preview{flex-basis:25%}.sky-file-item-content-custom{flex-basis:75%}.sky-file-item-preview-img-container{text-align:center}.sky-file-item-preview-img{max-width:100%;height:auto;box-shadow:0 0 5px #666}.sky-file-item-preview-other{color:#686c73;font-size:100px;line-height:1;text-align:center;width:100%}\n"], components: [{ type: i2__namespace$1.λ4, selector: "sky-icon", inputs: ["icon", "iconType", "size", "fixedWidth", "variant"] }], directives: [{ type: i1__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], pipes: { "skyFileSize": SkyFileSizePipe, "skyLibResources": i2__namespace.SkyLibResourcesPipe } });
|
|
1919
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyFileItemComponent, decorators: [{
|
|
1920
|
-
type: i0.Component,
|
|
1921
|
-
args: [{
|
|
1922
|
-
selector: 'sky-file-item',
|
|
1923
|
-
template: "<div class=\"sky-file-item sky-padding-even-default\">\n <div class=\"sky-file-item-title\">\n <div class=\"sky-file-item-name-container\">\n <div class=\"sky-file-item-name\">\n <strong *ngIf=\"isFile()\">{{ fileName }}</strong>\n <strong *ngIf=\"!isFile()\">{{ url }}</strong>\n </div>\n <div class=\"sky-file-item-size\" *ngIf=\"isFile()\">\n ({{ fileSize | skyFileSize }})\n </div>\n </div>\n <div class=\"sky-file-item-controls\">\n <button\n type=\"button\"\n class=\"sky-btn sky-btn-default sky-file-item-btn-delete\"\n [attr.aria-label]=\"\n 'skyux_file_attachment_file_item_delete' | skyLibResources\n \"\n (click)=\"itemDelete()\"\n >\n <sky-icon icon=\"trash-o\" size=\"lg\"></sky-icon>\n </button>\n </div>\n </div>\n <div class=\"sky-file-item-content\">\n <div class=\"sky-file-item-preview\">\n <div *ngIf=\"isImage()\" class=\"sky-file-item-preview-img-container\">\n <img\n class=\"sky-file-item-preview-img\"\n [src]=\"url\"\n [alt]=\"\n 'skyux_file_attachment_file_upload_image_preview_alt_text'\n | skyLibResources\n \"\n />\n </div>\n <div *ngIf=\"!isImage()\" class=\"sky-file-item-preview-other\">\n <sky-icon [icon]=\"icon\"></sky-icon>\n </div>\n </div>\n <div class=\"sky-file-item-content-custom\">\n <ng-content></ng-content>\n </div>\n </div>\n</div>\n",
|
|
1924
|
-
styles: [".sky-file-item{border-top:1px solid #e2e3e4;border-bottom:1px solid #e2e3e4;border-left:1px solid #e2e3e4;border-right:1px solid #e2e3e4;background-color:#eeeeef;margin-bottom:10px}.sky-file-item-name-container{flex:1 1 auto;overflow:hidden}.sky-file-item-controls{flex:0 1 auto;padding-left:15px}.sky-file-item-name{white-space:nowrap;overflow:hidden;-ms-text-overflow:ellipsis;text-overflow:ellipsis}.sky-file-item-title{margin-bottom:10px;display:flex}.sky-file-item-content{display:flex}.sky-file-item-preview{flex-basis:25%}.sky-file-item-content-custom{flex-basis:75%}.sky-file-item-preview-img-container{text-align:center}.sky-file-item-preview-img{max-width:100%;height:auto;box-shadow:0 0 5px #666}.sky-file-item-preview-other{color:#686c73;font-size:100px;line-height:1;text-align:center;width:100%}\n"],
|
|
1925
|
-
}]
|
|
1926
|
-
}], ctorParameters: function () { return [{ type: i0__namespace.KeyValueDiffers }, { type: SkyFileItemService }]; }, propDecorators: { fileItem: [{
|
|
1927
|
-
type: i0.Input
|
|
1928
|
-
}], deleteFile: [{
|
|
1929
|
-
type: i0.Output
|
|
1930
|
-
}] } });
|
|
1931
|
-
|
|
1932
|
-
var SkyFileAttachmentsModule = /** @class */ (function () {
|
|
1933
|
-
function SkyFileAttachmentsModule() {
|
|
1934
|
-
}
|
|
1935
|
-
return SkyFileAttachmentsModule;
|
|
1936
|
-
}());
|
|
1937
|
-
SkyFileAttachmentsModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyFileAttachmentsModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
|
|
1938
|
-
SkyFileAttachmentsModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyFileAttachmentsModule, declarations: [SkyFileAttachmentComponent,
|
|
1939
|
-
SkyFileAttachmentLabelComponent,
|
|
1940
|
-
SkyFileDropComponent,
|
|
1941
|
-
SkyFileItemComponent,
|
|
1942
|
-
SkyFileSizePipe], imports: [i1.CommonModule,
|
|
1943
|
-
i4.FormsModule,
|
|
1944
|
-
SkyFormsResourcesModule,
|
|
1945
|
-
i2.SkyI18nModule,
|
|
1946
|
-
i2$1.SkyIconModule,
|
|
1947
|
-
i1$1.SkyThemeModule], exports: [SkyFileAttachmentComponent,
|
|
1948
|
-
SkyFileAttachmentLabelComponent,
|
|
1949
|
-
SkyFileDropComponent,
|
|
1950
|
-
SkyFileItemComponent,
|
|
1951
|
-
SkyFileSizePipe] });
|
|
1952
|
-
SkyFileAttachmentsModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyFileAttachmentsModule, providers: [i1.DecimalPipe, SkyFileItemService], imports: [[
|
|
1953
|
-
i1.CommonModule,
|
|
1954
|
-
i4.FormsModule,
|
|
1955
|
-
SkyFormsResourcesModule,
|
|
1956
|
-
i2.SkyI18nModule,
|
|
1957
|
-
i2$1.SkyIconModule,
|
|
1958
|
-
i1$1.SkyThemeModule,
|
|
1959
|
-
]] });
|
|
1960
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyFileAttachmentsModule, decorators: [{
|
|
1961
|
-
type: i0.NgModule,
|
|
1962
|
-
args: [{
|
|
1963
|
-
declarations: [
|
|
1964
|
-
SkyFileAttachmentComponent,
|
|
1965
|
-
SkyFileAttachmentLabelComponent,
|
|
1966
|
-
SkyFileDropComponent,
|
|
1967
|
-
SkyFileItemComponent,
|
|
1968
|
-
SkyFileSizePipe,
|
|
1969
|
-
],
|
|
1970
|
-
imports: [
|
|
1971
|
-
i1.CommonModule,
|
|
1972
|
-
i4.FormsModule,
|
|
1973
|
-
SkyFormsResourcesModule,
|
|
1974
|
-
i2.SkyI18nModule,
|
|
1975
|
-
i2$1.SkyIconModule,
|
|
1976
|
-
i1$1.SkyThemeModule,
|
|
1977
|
-
],
|
|
1978
|
-
exports: [
|
|
1979
|
-
SkyFileAttachmentComponent,
|
|
1980
|
-
SkyFileAttachmentLabelComponent,
|
|
1981
|
-
SkyFileDropComponent,
|
|
1982
|
-
SkyFileItemComponent,
|
|
1983
|
-
SkyFileSizePipe,
|
|
1984
|
-
],
|
|
1985
|
-
providers: [i1.DecimalPipe, SkyFileItemService],
|
|
1986
|
-
}]
|
|
1987
|
-
}] });
|
|
1988
|
-
|
|
1989
|
-
/**
|
|
1990
|
-
* @internal
|
|
1991
|
-
*/
|
|
1992
|
-
var SkyInputBoxAdapterService = /** @class */ (function () {
|
|
1993
|
-
function SkyInputBoxAdapterService() {
|
|
1994
|
-
}
|
|
1995
|
-
SkyInputBoxAdapterService.prototype.focusControl = function (elRef) {
|
|
1996
|
-
var control = elRef.nativeElement.querySelector('.sky-form-control');
|
|
1997
|
-
/* istanbul ignore else */
|
|
1998
|
-
if (control) {
|
|
1999
|
-
control.focus();
|
|
2000
|
-
}
|
|
2001
|
-
};
|
|
2002
|
-
/**
|
|
2003
|
-
* Returns the inline help element.
|
|
2004
|
-
*/
|
|
2005
|
-
SkyInputBoxAdapterService.prototype.getInlineHelpElement = function (elRef) {
|
|
2006
|
-
return elRef.nativeElement.querySelector('.sky-control-help');
|
|
2007
|
-
};
|
|
2008
|
-
/**
|
|
2009
|
-
* Returns true if the provided element contains the focused element.
|
|
2010
|
-
*/
|
|
2011
|
-
SkyInputBoxAdapterService.prototype.isFocusInElement = function (el) {
|
|
2012
|
-
if (el) {
|
|
2013
|
-
return (el === document.activeElement || el.contains(document.activeElement));
|
|
2014
|
-
}
|
|
2015
|
-
return false;
|
|
2016
|
-
};
|
|
2017
|
-
return SkyInputBoxAdapterService;
|
|
2018
|
-
}());
|
|
2019
|
-
SkyInputBoxAdapterService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyInputBoxAdapterService, deps: [], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
2020
|
-
SkyInputBoxAdapterService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyInputBoxAdapterService });
|
|
2021
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyInputBoxAdapterService, decorators: [{
|
|
2022
|
-
type: i0.Injectable
|
|
2023
|
-
}] });
|
|
2024
|
-
|
|
2025
|
-
/**
|
|
2026
|
-
* @internal
|
|
2027
|
-
*/
|
|
2028
|
-
var SkyInputBoxHostService = /** @class */ (function () {
|
|
2029
|
-
function SkyInputBoxHostService() {
|
|
2030
|
-
}
|
|
2031
|
-
SkyInputBoxHostService.prototype.init = function (host) {
|
|
2032
|
-
this.host = host;
|
|
2033
|
-
};
|
|
2034
|
-
SkyInputBoxHostService.prototype.populate = function (args) {
|
|
2035
|
-
this.host.populate(args);
|
|
2036
|
-
};
|
|
2037
|
-
return SkyInputBoxHostService;
|
|
2038
|
-
}());
|
|
2039
|
-
SkyInputBoxHostService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyInputBoxHostService, deps: [], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
2040
|
-
SkyInputBoxHostService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyInputBoxHostService });
|
|
2041
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyInputBoxHostService, decorators: [{
|
|
2042
|
-
type: i0.Injectable
|
|
2043
|
-
}] });
|
|
2044
|
-
|
|
2045
|
-
/**
|
|
2046
|
-
* Creates a wrapper to provide styling for `input` and `label` elements. To render the
|
|
2047
|
-
* component correctly, include the `sky-form-control` CSS class on the `input` element
|
|
2048
|
-
* and the `sky-control-label` CSS class on the `label` element. To display a help button
|
|
2049
|
-
* beside the label, include a help button element in the `sky-input-box` element and a
|
|
2050
|
-
* `sky-control-help` CSS class on that element.
|
|
2051
|
-
*/
|
|
2052
|
-
var SkyInputBoxComponent = /** @class */ (function () {
|
|
2053
|
-
function SkyInputBoxComponent(changeRef, inputBoxHostSvc, adapterService, elementRef) {
|
|
2054
|
-
this.changeRef = changeRef;
|
|
2055
|
-
this.inputBoxHostSvc = inputBoxHostSvc;
|
|
2056
|
-
this.adapterService = adapterService;
|
|
2057
|
-
this.elementRef = elementRef;
|
|
2058
|
-
}
|
|
2059
|
-
Object.defineProperty(SkyInputBoxComponent.prototype, "hasErrorsComputed", {
|
|
2060
|
-
get: function () {
|
|
2061
|
-
if (this.hasErrors === undefined) {
|
|
2062
|
-
return (this.controlHasErrors(this.formControl) ||
|
|
2063
|
-
this.controlHasErrors(this.formControlByName) ||
|
|
2064
|
-
this.controlHasErrors(this.ngModel));
|
|
2065
|
-
}
|
|
2066
|
-
return this.hasErrors;
|
|
2067
|
-
},
|
|
2068
|
-
enumerable: false,
|
|
2069
|
-
configurable: true
|
|
2070
|
-
});
|
|
2071
|
-
SkyInputBoxComponent.prototype.ngOnInit = function () {
|
|
2072
|
-
this.inputBoxHostSvc.init(this);
|
|
2073
|
-
};
|
|
2074
|
-
SkyInputBoxComponent.prototype.formControlFocusIn = function () {
|
|
2075
|
-
var inlineHelpEl = this.adapterService.getInlineHelpElement(this.elementRef);
|
|
2076
|
-
if (!this.adapterService.isFocusInElement(inlineHelpEl)) {
|
|
2077
|
-
this.updateHasFocus(true);
|
|
2078
|
-
}
|
|
2079
|
-
};
|
|
2080
|
-
SkyInputBoxComponent.prototype.formControlFocusOut = function () {
|
|
2081
|
-
this.updateHasFocus(false);
|
|
2082
|
-
};
|
|
2083
|
-
SkyInputBoxComponent.prototype.onInsetIconClick = function () {
|
|
2084
|
-
if (!this.disabled) {
|
|
2085
|
-
this.adapterService.focusControl(this.elementRef);
|
|
2086
|
-
}
|
|
2087
|
-
};
|
|
2088
|
-
SkyInputBoxComponent.prototype.populate = function (args) {
|
|
2089
|
-
this.hostInputTemplate = args.inputTemplate;
|
|
2090
|
-
this.hostButtonsTemplate = args.buttonsTemplate;
|
|
2091
|
-
this.hostButtonsLeftTemplate = args.buttonsLeftTemplate;
|
|
2092
|
-
this.hostButtonsInsetTemplate = args.buttonsInsetTemplate;
|
|
2093
|
-
this.hostIconsInsetTemplate = args.iconsInsetTemplate;
|
|
2094
|
-
this.hostIconsInsetLeftTemplate = args.iconsInsetLeftTemplate;
|
|
2095
|
-
};
|
|
2096
|
-
SkyInputBoxComponent.prototype.updateHasFocus = function (hasFocus) {
|
|
2097
|
-
var _this = this;
|
|
2098
|
-
// Some components manipulate the focus of elements inside an input box programmatically,
|
|
2099
|
-
// which can cause an `ExpressionChangedAfterItHasBeenCheckedError` if focus was set after
|
|
2100
|
-
// initial change detection. Using `setTimeout()` here fixes it.
|
|
2101
|
-
setTimeout(function () {
|
|
2102
|
-
_this.formControlHasFocus = hasFocus;
|
|
2103
|
-
_this.changeRef.markForCheck();
|
|
2104
|
-
});
|
|
2105
|
-
};
|
|
2106
|
-
SkyInputBoxComponent.prototype.controlHasErrors = function (control) {
|
|
2107
|
-
return control && control.invalid && (control.dirty || control.touched);
|
|
2108
|
-
};
|
|
2109
|
-
return SkyInputBoxComponent;
|
|
2110
|
-
}());
|
|
2111
|
-
SkyInputBoxComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyInputBoxComponent, deps: [{ token: i0__namespace.ChangeDetectorRef }, { token: SkyInputBoxHostService }, { token: SkyInputBoxAdapterService }, { token: i0__namespace.ElementRef }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
2112
|
-
SkyInputBoxComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: SkyInputBoxComponent, selector: "sky-input-box", inputs: { hasErrors: "hasErrors", disabled: "disabled" }, providers: [SkyInputBoxAdapterService, SkyInputBoxHostService], queries: [{ propertyName: "formControl", first: true, predicate: i4.FormControlDirective, descendants: true }, { propertyName: "formControlByName", first: true, predicate: i4.FormControlName, descendants: true }, { propertyName: "ngModel", first: true, predicate: i4.NgModel, descendants: true }], ngImport: i0__namespace, template: "<div\n *skyThemeIf=\"'default'\"\n class=\"sky-input-box\"\n [ngClass]=\"{\n 'sky-input-box-disabled': disabled\n }\"\n>\n <div class=\"sky-form-group\">\n <div class=\"sky-input-box-label-wrapper\">\n <ng-container *ngTemplateOutlet=\"labelTemplate\"></ng-container>\n <ng-container *ngTemplateOutlet=\"inlineHelpTemplate\"></ng-container>\n <ng-container *ngTemplateOutlet=\"characterCountTemplate\"></ng-container>\n </div>\n <div class=\"sky-input-group\">\n <ng-container *ngTemplateOutlet=\"buttonsLeftTemplate\"></ng-container>\n <div\n class=\"sky-input-box-input-group-inner\"\n [ngClass]=\"{\n 'sky-field-status-active': formControlHasFocus,\n 'sky-field-status-invalid': hasErrorsComputed\n }\"\n (focusin)=\"formControlFocusIn()\"\n (focusout)=\"formControlFocusOut()\"\n >\n <ng-container *ngTemplateOutlet=\"iconsInsetLeftTemplate\"></ng-container>\n <ng-container *ngTemplateOutlet=\"inputTemplate\"></ng-container>\n <ng-container *ngTemplateOutlet=\"buttonsInsetTemplate\"></ng-container>\n <ng-container *ngTemplateOutlet=\"iconsInsetTemplate\"></ng-container>\n </div>\n <ng-container *ngTemplateOutlet=\"buttonsTemplate\"></ng-container>\n </div>\n <ng-container *ngTemplateOutlet=\"errorLabelTemplate\"></ng-container>\n </div>\n</div>\n\n<div\n *skyThemeIf=\"'modern'\"\n class=\"sky-input-box\"\n [ngClass]=\"{\n 'sky-input-box-disabled': disabled\n }\"\n>\n <div class=\"sky-input-box-group\">\n <ng-container *ngTemplateOutlet=\"buttonsLeftTemplate\"></ng-container>\n <div\n class=\"sky-input-box-group-form-control\"\n [ngClass]=\"{\n 'sky-input-box-group-form-control-focus': formControlHasFocus,\n 'sky-input-box-group-form-control-invalid': hasErrorsComputed\n }\"\n (focusin)=\"formControlFocusIn()\"\n (focusout)=\"formControlFocusOut()\"\n >\n <div class=\"sky-form-group\">\n <ng-container *ngTemplateOutlet=\"iconsInsetLeftTemplate\"></ng-container>\n <div class=\"sky-input-box-form-group-inner\">\n <div class=\"sky-input-box-label-wrapper\">\n <ng-container *ngTemplateOutlet=\"labelTemplate\"></ng-container>\n <ng-container *ngTemplateOutlet=\"inlineHelpTemplate\"></ng-container>\n <ng-container\n *ngTemplateOutlet=\"characterCountTemplate\"\n ></ng-container>\n </div>\n <ng-container *ngTemplateOutlet=\"inputTemplate\"></ng-container>\n </div>\n <ng-container *ngTemplateOutlet=\"buttonsInsetTemplate\"></ng-container>\n <ng-container *ngTemplateOutlet=\"iconsInsetTemplate\"></ng-container>\n </div>\n </div>\n <ng-container *ngTemplateOutlet=\"buttonsTemplate\"></ng-container>\n </div>\n <ng-container *ngTemplateOutlet=\"errorLabelTemplate\"></ng-container>\n</div>\n\n<ng-template #labelTemplate>\n <ng-content select=\".sky-control-label\"></ng-content>\n</ng-template>\n\n<ng-template #inlineHelpTemplate>\n <ng-content select=\".sky-control-help\"></ng-content>\n</ng-template>\n\n<ng-template #characterCountTemplate>\n <ng-content select=\"sky-character-counter-indicator\"></ng-content>\n</ng-template>\n\n<ng-template #inputTemplate>\n <ng-content select=\".sky-form-control\"></ng-content>\n <ng-container *ngTemplateOutlet=\"hostInputTemplate\"></ng-container>\n</ng-template>\n\n<ng-template #buttonsLeftTemplate>\n <ng-content select=\".sky-input-group-btn.sky-input-box-btn-left\"></ng-content>\n <ng-container *ngTemplateOutlet=\"hostButtonsLeftTemplate\"></ng-container>\n</ng-template>\n\n<ng-template #buttonsTemplate>\n <ng-content\n select=\".sky-input-group-btn:not(.sky-input-box-btn-left):not(.sky-input-box-btn-inset)\"\n ></ng-content>\n <ng-container *ngTemplateOutlet=\"hostButtonsTemplate\"></ng-container>\n</ng-template>\n\n<ng-template #buttonsInsetTemplate>\n <ng-content\n select=\".sky-input-group-btn.sky-input-box-btn-inset\"\n ></ng-content>\n <ng-container *ngTemplateOutlet=\"hostButtonsInsetTemplate\"></ng-container>\n</ng-template>\n\n<ng-template #iconsInsetTemplate>\n <div class=\"sky-input-box-icon-inset-wrapper\" (click)=\"onInsetIconClick()\">\n <ng-content\n select=\".sky-input-group-icon.sky-input-box-icon-inset\"\n ></ng-content>\n <ng-container *ngTemplateOutlet=\"hostIconsInsetTemplate\"></ng-container>\n </div>\n</ng-template>\n\n<ng-template #iconsInsetLeftTemplate>\n <div\n class=\"sky-input-box-icon-inset-left-wrapper\"\n (click)=\"onInsetIconClick()\"\n >\n <ng-content\n select=\".sky-input-group-icon.sky-input-box-icon-inset-left\"\n ></ng-content>\n <ng-container *ngTemplateOutlet=\"hostIconsInsetLeftTemplate\"></ng-container>\n </div>\n</ng-template>\n\n<ng-template #errorLabelTemplate>\n <ng-content select=\".sky-error-label\"></ng-content>\n</ng-template>\n", styles: ["sky-input-box{display:block}sky-input-box .sky-input-box-input-container{width:100%}sky-input-box .sky-form-group{display:flex;flex-wrap:wrap}sky-input-box .sky-form-group .sky-control-help{margin:0 0 0 4px}sky-input-box .sky-form-group .sky-input-box-label-wrapper{display:flex;width:100%}sky-input-box .sky-input-box-input-group-inner{display:flex;background-color:#fff;width:100%;z-index:1}sky-input-box .sky-input-box-input-group-inner:not(.sky-field-status-active):not(.sky-field-status-invalid){border-top:1px solid #cdcfd2;border-bottom:1px solid #cdcfd2;border-left:1px solid #cdcfd2;border-right:1px solid #cdcfd2}sky-input-box .sky-input-box-btn-inset .sky-btn{background-color:transparent;border:none}sky-input-box .sky-input-box-icon-inset-wrapper,sky-input-box .sky-input-box-icon-inset-left-wrapper{display:flex}sky-input-box .sky-input-box-icon-inset-wrapper .sky-input-group-icon,sky-input-box .sky-input-box-icon-inset-left-wrapper .sky-input-group-icon{width:33px;display:flex;align-items:center;justify-content:center}sky-input-box .sky-input-box-disabled .sky-input-box-icon-inset-wrapper,sky-input-box .sky-input-box-disabled .sky-input-box-icon-inset-left-wrapper{background-color:#cdcfd2}sky-input-box .sky-input-box-disabled .sky-input-box-icon-inset-wrapper .sky-icon,sky-input-box .sky-input-box-disabled .sky-input-box-icon-inset-left-wrapper .sky-icon{color:#686c73}sky-input-box sky-character-counter-indicator{flex-grow:1;text-align:right;margin-bottom:5px;margin-left:auto}sky-input-box .sky-control-label+sky-character-counter-indicator{flex-grow:0;flex-shrink:.001}sky-input-box .sky-form-control,sky-input-box .sky-form-control:focus{border:none;flex-basis:100%}sky-input-box .sky-form-control:focus,sky-input-box .sky-form-control.ng-invalid.ng-touched,sky-input-box .sky-form-control:focus:focus,sky-input-box .sky-form-control:focus.ng-invalid.ng-touched{border:none;box-shadow:none}sky-input-box .sky-input-box-icon-inset-left-wrapper .sky-input-box-icon-inset-left{padding:0 0 0 10px;width:initial}.sky-theme-modern .sky-input-box .sky-input-box-group{display:flex}.sky-theme-modern .sky-input-box .sky-input-box-group-form-control{flex-grow:1;position:relative}.sky-theme-modern .sky-input-box .sky-input-box-group-form-control:first-child .sky-form-group{border-top-left-radius:6px;border-bottom-left-radius:6px}.sky-theme-modern .sky-input-box .sky-input-box-group-form-control:last-child .sky-form-group{border-top-right-radius:6px;border-bottom-right-radius:6px}.sky-theme-modern .sky-input-box .sky-input-box-form-group-inner{display:flex;flex-grow:1;flex-wrap:wrap}.sky-theme-modern .sky-input-box .sky-input-group-btn .sky-btn{border-radius:0;color:#686c73;margin:0;padding:0;position:relative;transition:border-color .15s,box-shadow .15s,color .15s;width:55px}.sky-theme-modern .sky-input-box .sky-input-group-btn .sky-btn .sky-icon{font-size:24px}.sky-theme-modern .sky-input-box .sky-input-group-btn:first-child .sky-btn{border-top-left-radius:6px;border-bottom-left-radius:6px;margin-right:-1px}.sky-theme-modern .sky-input-box .sky-input-group-btn:first-child .sky-btn:focus{z-index:1}.sky-theme-modern .sky-input-box .sky-input-group-btn:last-child .sky-btn{border-top-right-radius:6px;border-bottom-right-radius:6px}.sky-theme-modern .sky-input-box .sky-input-group-icon{width:55px}.sky-theme-modern .sky-input-box .sky-input-group-icon .sky-icon{color:#686c73;font-size:24px}.sky-theme-modern .sky-input-box .sky-input-box-group-form-control-focus:not(:last-child),.sky-theme-modern .sky-input-box .sky-input-box-group-form-control-invalid:not(:last-child),.sky-theme-modern .sky-input-box .sky-input-group-btn:focus-within:not(:last-child){z-index:1}.sky-theme-modern .sky-input-box .sky-input-box-group-form-control+.sky-input-group-btn .sky-btn{margin-left:-2px}.sky-theme-modern .sky-input-box .sky-input-group-btn+.sky-input-group-btn .sky-btn{margin-left:-1px}.sky-theme-modern .sky-input-box .sky-input-box-group-form-control-invalid .sky-form-group{border:none;box-shadow:inset 0 0 0 2px #ef4044;color:#d93a3d}.sky-theme-modern .sky-input-box .sky-input-box-group-form-control-focus:not(:active),.sky-theme-modern .sky-input-box .sky-input-box-group-form-control-focus:not(:active).sky-input-box-group-form-control-invalid{z-index:1}.sky-theme-modern .sky-input-box .sky-input-box-group-form-control-focus:not(:active) .sky-form-group,.sky-theme-modern .sky-input-box .sky-input-box-group-form-control-focus:not(:active).sky-input-box-group-form-control-invalid .sky-form-group{border:none;box-shadow:inset 0 0 0 2px #1870b8,0 1px 3px #0000004d;color:#1870b8}.sky-theme-modern .sky-input-box .sky-form-group{background-color:#fff;border:none;box-shadow:inset 0 0 0 1px #d2d2d2;color:#686c73;flex-wrap:nowrap;margin-bottom:0;padding:0}.sky-theme-modern .sky-input-box .sky-form-group .sky-input-box-label-wrapper{display:flex;padding:0 15px;width:100%}.sky-theme-modern .sky-input-box .sky-form-group .sky-input-box-label-wrapper .sky-control-label,.sky-theme-modern .sky-input-box .sky-form-group .sky-input-box-label-wrapper .sky-control-help,.sky-theme-modern .sky-input-box .sky-form-group .sky-input-box-label-wrapper sky-character-counter-indicator{margin-bottom:0;position:relative;z-index:2}.sky-theme-modern .sky-input-box .sky-form-group .sky-input-box-label-wrapper .sky-control-label{padding:6px 0 1px}.sky-theme-modern .sky-input-box .sky-form-group .sky-input-box-label-wrapper .sky-control-label,.sky-theme-modern .sky-input-box .sky-form-group .sky-input-box-label-wrapper .sky-character-count-label{font-size:13px}.sky-theme-modern .sky-input-box .sky-form-group .sky-input-box-label-wrapper .sky-control-help{margin:0}.sky-theme-modern .sky-input-box .sky-form-group .sky-input-box-label-wrapper .sky-control-help .sky-help-inline{font-size:16px;padding:3px 10px 0}.sky-theme-modern .sky-input-box .sky-form-group .sky-input-box-label-wrapper .sky-control-help:last-child .sky-help-inline{padding:3px 0 0 10px}.sky-theme-modern .sky-input-box .sky-form-group .sky-input-box-label-wrapper sky-character-counter-indicator{margin-left:auto;padding:3px 0 0}.sky-theme-modern .sky-input-box .sky-form-group .sky-form-control{background-color:transparent;border:none;border-radius:6px;font-size:16px;height:auto;line-height:18px;margin-top:-23px;padding:26px 15px 10px;position:relative}.sky-theme-modern .sky-input-box .sky-form-group .sky-form-control:first-line{line-height:19px}.sky-theme-modern .sky-input-box .sky-form-group .sky-form-control:focus,.sky-theme-modern .sky-input-box .sky-form-group .sky-form-control.ng-invalid{box-shadow:none;outline:none}.sky-theme-modern .sky-input-box .sky-form-group .sky-form-control::-webkit-input-placeholder{font-size:16px}.sky-theme-modern .sky-input-box .sky-form-group .sky-form-control::-moz-placeholder{font-size:16px}.sky-theme-modern .sky-input-box .sky-form-group .sky-form-controlinput:-moz-placeholder{font-size:16px}.sky-theme-modern .sky-input-box .sky-form-group .sky-form-control:-ms-input-placeholder{font-size:16px}.sky-theme-modern .sky-input-box .sky-form-group .sky-input-box-btn-inset .sky-btn{background-color:transparent;border-radius:6px;transition-property:none}.sky-theme-modern .sky-input-box .sky-form-group .sky-input-box-btn-inset .sky-btn:not(:active):not(:focus):not(:hover){box-shadow:none}.sky-theme-modern .sky-input-box .sky-form-group .sky-input-box-label-wrapper:empty+.sky-form-control,.sky-theme-modern .sky-input-box .sky-form-group .sky-input-box-label-wrapper:empty+* .sky-form-control{margin-top:0;padding-top:10px}.sky-theme-modern .sky-input-box .sky-form-group textarea.sky-form-control{margin-top:0;padding-top:5px}@-moz-document url-prefix(){.sky-theme-modern .sky-input-box .sky-form-group select.sky-form-control{padding-left:10px}}.sky-theme-modern .sky-input-box .sky-form-group select.sky-form-control{background-position-x:calc(100% - 10px);z-index:3}.sky-theme-modern .sky-input-box .sky-form-group textarea.sky-form-control{resize:vertical}.sky-theme-modern .sky-input-box .sky-input-box-icon-inset-left-wrapper .sky-input-box-icon-inset-left{padding:0 0 0 15px;width:initial}.sky-theme-modern .sky-input-box:not(.sky-input-box-disabled) .sky-input-box-group-form-control:hover{z-index:1}.sky-theme-modern .sky-input-box:not(.sky-input-box-disabled) .sky-input-box-group-form-control:hover .sky-form-group{border:none;box-shadow:inset 0 0 0 1px #1870b8}.sky-theme-modern .sky-input-box:not(.sky-input-box-disabled) .sky-input-group-btn .sky-btn{border:none;box-shadow:inset 0 0 0 1px #d2d2d2}.sky-theme-modern .sky-input-box:not(.sky-input-box-disabled) .sky-input-group-btn .sky-btn:hover{border:none;box-shadow:inset 0 0 0 1px #1870b8;z-index:1}.sky-theme-modern .sky-input-box:not(.sky-input-box-disabled) .sky-input-group-btn .sky-btn:active,.sky-theme-modern .sky-input-box:not(.sky-input-box-disabled) .sky-input-group-btn .sky-btn:focus{border:none;box-shadow:inset 0 0 0 2px #1870b8;color:#212327;z-index:2}.sky-theme-modern .sky-input-box:not(.sky-input-box-disabled) .sky-input-group-btn .sky-btn:focus:not(:active){outline:none;border:none;box-shadow:inset 0 0 0 2px #1870b8,0 1px 3px #0000004d}.sky-theme-modern .sky-input-box:not(.sky-input-box-disabled) .sky-input-box-group-form-control:active .sky-form-group,.sky-theme-modern .sky-input-box:not(.sky-input-box-disabled) .sky-input-box-group-form-control-focus .sky-form-group{border:none;box-shadow:inset 0 0 0 2px #1870b8}.sky-theme-modern .sky-input-box:not(.sky-input-box-disabled) .sky-input-box-group-form-control-invalid .sky-form-group{border:none;box-shadow:inset 0 0 0 2px #ef4044;color:#d93a3d}.sky-theme-modern .sky-input-box:not(.sky-input-box-disabled) .sky-input-box-group-form-control-invalid:active .sky-form-group{color:#1870b8}.sky-theme-modern .sky-input-box:not(.sky-input-box-disabled) .sky-input-box-group-form-control-focus:not(:active),.sky-theme-modern .sky-input-box:not(.sky-input-box-disabled) .sky-input-box-group-form-control-focus:not(:active).sky-input-box-group-form-control-invalid{z-index:1}.sky-theme-modern .sky-input-box:not(.sky-input-box-disabled) .sky-input-box-group-form-control-focus:not(:active) .sky-form-group,.sky-theme-modern .sky-input-box:not(.sky-input-box-disabled) .sky-input-box-group-form-control-focus:not(:active).sky-input-box-group-form-control-invalid .sky-form-group{border:none;box-shadow:inset 0 0 0 2px #1870b8,0 1px 3px #0000004d;color:#1870b8}.sky-theme-modern .sky-input-box:not(.sky-input-box-disabled) .sky-form-group{transition:border-color .15s,box-shadow .15s,color .15s}.sky-theme-modern .sky-input-box:not(.sky-input-box-disabled) .sky-form-group .sky-control-label{transition:border-color .15s,box-shadow .15s,color .15s}.sky-theme-modern .sky-input-box.sky-input-box-disabled .sky-form-control,.sky-theme-modern .sky-input-box.sky-input-box-disabled .sky-control-label,.sky-theme-modern .sky-input-box.sky-input-box-disabled .sky-input-group-btn{cursor:not-allowed}.sky-theme-modern .sky-input-box.sky-input-box-disabled .sky-input-box-icon-inset-wrapper,.sky-theme-modern .sky-input-box.sky-input-box-disabled .sky-input-box-icon-inset-left-wrapper{background-color:transparent}.sky-theme-modern .sky-input-box.sky-input-box-disabled .sky-form-group{background-color:#ededee}.sky-theme-modern .sky-input-box.sky-input-box-disabled .sky-input-group-btn .sky-btn{background-color:#ededee;border:none;box-shadow:inset 0 0 0 1px #d2d2d2;opacity:1}.sky-theme-modern.sky-theme-mode-dark .sky-input-box .sky-form-group{background-color:transparent;border:none;box-shadow:inset 0 0 0 1px #686c73;color:#c0c2c5}.sky-theme-modern.sky-theme-mode-dark .sky-input-box .sky-form-group .sky-form-control,.sky-theme-modern.sky-theme-mode-dark .sky-input-box .sky-form-group .sky-input-group-btn .sky-btn{background-color:transparent;color:#fbfcfe}.sky-theme-modern.sky-theme-mode-dark .sky-input-box .sky-input-box-group-form-control-focus .sky-form-group,.sky-theme-modern.sky-theme-mode-dark .sky-input-box .sky-input-box-group-form-control-focus.sky-input-box-group-form-control-invalid .sky-form-group{color:#1870b8}.sky-theme-modern.sky-theme-mode-dark .sky-input-box .sky-input-box-group-form-control-invalid .sky-form-group{border:none;box-shadow:inset 0 0 0 2px #ef4044;color:#d93a3d}.sky-theme-modern.sky-theme-mode-dark .sky-input-box .sky-input-group-btn .sky-btn{border:none;box-shadow:inset 0 0 0 1px #686c73;color:#c0c2c5}.sky-theme-modern.sky-theme-mode-dark .sky-input-box .sky-input-group-btn .sky-btn.sky-btn-default{background-color:transparent}.sky-theme-modern.sky-theme-mode-dark .sky-input-box .sky-input-group-btn .sky-btn:focus{border-color:#1870b8;color:#fbfcfe}\n"], directives: [{ type: i1__namespace$1.λ3, selector: "[skyThemeIf]", inputs: ["skyThemeIf"] }, { type: i1__namespace.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i1__namespace.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }], encapsulation: i0__namespace.ViewEncapsulation.None });
|
|
2113
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyInputBoxComponent, decorators: [{
|
|
2114
|
-
type: i0.Component,
|
|
2115
|
-
args: [{
|
|
2116
|
-
selector: 'sky-input-box',
|
|
2117
|
-
template: "<div\n *skyThemeIf=\"'default'\"\n class=\"sky-input-box\"\n [ngClass]=\"{\n 'sky-input-box-disabled': disabled\n }\"\n>\n <div class=\"sky-form-group\">\n <div class=\"sky-input-box-label-wrapper\">\n <ng-container *ngTemplateOutlet=\"labelTemplate\"></ng-container>\n <ng-container *ngTemplateOutlet=\"inlineHelpTemplate\"></ng-container>\n <ng-container *ngTemplateOutlet=\"characterCountTemplate\"></ng-container>\n </div>\n <div class=\"sky-input-group\">\n <ng-container *ngTemplateOutlet=\"buttonsLeftTemplate\"></ng-container>\n <div\n class=\"sky-input-box-input-group-inner\"\n [ngClass]=\"{\n 'sky-field-status-active': formControlHasFocus,\n 'sky-field-status-invalid': hasErrorsComputed\n }\"\n (focusin)=\"formControlFocusIn()\"\n (focusout)=\"formControlFocusOut()\"\n >\n <ng-container *ngTemplateOutlet=\"iconsInsetLeftTemplate\"></ng-container>\n <ng-container *ngTemplateOutlet=\"inputTemplate\"></ng-container>\n <ng-container *ngTemplateOutlet=\"buttonsInsetTemplate\"></ng-container>\n <ng-container *ngTemplateOutlet=\"iconsInsetTemplate\"></ng-container>\n </div>\n <ng-container *ngTemplateOutlet=\"buttonsTemplate\"></ng-container>\n </div>\n <ng-container *ngTemplateOutlet=\"errorLabelTemplate\"></ng-container>\n </div>\n</div>\n\n<div\n *skyThemeIf=\"'modern'\"\n class=\"sky-input-box\"\n [ngClass]=\"{\n 'sky-input-box-disabled': disabled\n }\"\n>\n <div class=\"sky-input-box-group\">\n <ng-container *ngTemplateOutlet=\"buttonsLeftTemplate\"></ng-container>\n <div\n class=\"sky-input-box-group-form-control\"\n [ngClass]=\"{\n 'sky-input-box-group-form-control-focus': formControlHasFocus,\n 'sky-input-box-group-form-control-invalid': hasErrorsComputed\n }\"\n (focusin)=\"formControlFocusIn()\"\n (focusout)=\"formControlFocusOut()\"\n >\n <div class=\"sky-form-group\">\n <ng-container *ngTemplateOutlet=\"iconsInsetLeftTemplate\"></ng-container>\n <div class=\"sky-input-box-form-group-inner\">\n <div class=\"sky-input-box-label-wrapper\">\n <ng-container *ngTemplateOutlet=\"labelTemplate\"></ng-container>\n <ng-container *ngTemplateOutlet=\"inlineHelpTemplate\"></ng-container>\n <ng-container\n *ngTemplateOutlet=\"characterCountTemplate\"\n ></ng-container>\n </div>\n <ng-container *ngTemplateOutlet=\"inputTemplate\"></ng-container>\n </div>\n <ng-container *ngTemplateOutlet=\"buttonsInsetTemplate\"></ng-container>\n <ng-container *ngTemplateOutlet=\"iconsInsetTemplate\"></ng-container>\n </div>\n </div>\n <ng-container *ngTemplateOutlet=\"buttonsTemplate\"></ng-container>\n </div>\n <ng-container *ngTemplateOutlet=\"errorLabelTemplate\"></ng-container>\n</div>\n\n<ng-template #labelTemplate>\n <ng-content select=\".sky-control-label\"></ng-content>\n</ng-template>\n\n<ng-template #inlineHelpTemplate>\n <ng-content select=\".sky-control-help\"></ng-content>\n</ng-template>\n\n<ng-template #characterCountTemplate>\n <ng-content select=\"sky-character-counter-indicator\"></ng-content>\n</ng-template>\n\n<ng-template #inputTemplate>\n <ng-content select=\".sky-form-control\"></ng-content>\n <ng-container *ngTemplateOutlet=\"hostInputTemplate\"></ng-container>\n</ng-template>\n\n<ng-template #buttonsLeftTemplate>\n <ng-content select=\".sky-input-group-btn.sky-input-box-btn-left\"></ng-content>\n <ng-container *ngTemplateOutlet=\"hostButtonsLeftTemplate\"></ng-container>\n</ng-template>\n\n<ng-template #buttonsTemplate>\n <ng-content\n select=\".sky-input-group-btn:not(.sky-input-box-btn-left):not(.sky-input-box-btn-inset)\"\n ></ng-content>\n <ng-container *ngTemplateOutlet=\"hostButtonsTemplate\"></ng-container>\n</ng-template>\n\n<ng-template #buttonsInsetTemplate>\n <ng-content\n select=\".sky-input-group-btn.sky-input-box-btn-inset\"\n ></ng-content>\n <ng-container *ngTemplateOutlet=\"hostButtonsInsetTemplate\"></ng-container>\n</ng-template>\n\n<ng-template #iconsInsetTemplate>\n <div class=\"sky-input-box-icon-inset-wrapper\" (click)=\"onInsetIconClick()\">\n <ng-content\n select=\".sky-input-group-icon.sky-input-box-icon-inset\"\n ></ng-content>\n <ng-container *ngTemplateOutlet=\"hostIconsInsetTemplate\"></ng-container>\n </div>\n</ng-template>\n\n<ng-template #iconsInsetLeftTemplate>\n <div\n class=\"sky-input-box-icon-inset-left-wrapper\"\n (click)=\"onInsetIconClick()\"\n >\n <ng-content\n select=\".sky-input-group-icon.sky-input-box-icon-inset-left\"\n ></ng-content>\n <ng-container *ngTemplateOutlet=\"hostIconsInsetLeftTemplate\"></ng-container>\n </div>\n</ng-template>\n\n<ng-template #errorLabelTemplate>\n <ng-content select=\".sky-error-label\"></ng-content>\n</ng-template>\n",
|
|
2118
|
-
styles: ["sky-input-box{display:block}sky-input-box .sky-input-box-input-container{width:100%}sky-input-box .sky-form-group{display:flex;flex-wrap:wrap}sky-input-box .sky-form-group .sky-control-help{margin:0 0 0 4px}sky-input-box .sky-form-group .sky-input-box-label-wrapper{display:flex;width:100%}sky-input-box .sky-input-box-input-group-inner{display:flex;background-color:#fff;width:100%;z-index:1}sky-input-box .sky-input-box-input-group-inner:not(.sky-field-status-active):not(.sky-field-status-invalid){border-top:1px solid #cdcfd2;border-bottom:1px solid #cdcfd2;border-left:1px solid #cdcfd2;border-right:1px solid #cdcfd2}sky-input-box .sky-input-box-btn-inset .sky-btn{background-color:transparent;border:none}sky-input-box .sky-input-box-icon-inset-wrapper,sky-input-box .sky-input-box-icon-inset-left-wrapper{display:flex}sky-input-box .sky-input-box-icon-inset-wrapper .sky-input-group-icon,sky-input-box .sky-input-box-icon-inset-left-wrapper .sky-input-group-icon{width:33px;display:flex;align-items:center;justify-content:center}sky-input-box .sky-input-box-disabled .sky-input-box-icon-inset-wrapper,sky-input-box .sky-input-box-disabled .sky-input-box-icon-inset-left-wrapper{background-color:#cdcfd2}sky-input-box .sky-input-box-disabled .sky-input-box-icon-inset-wrapper .sky-icon,sky-input-box .sky-input-box-disabled .sky-input-box-icon-inset-left-wrapper .sky-icon{color:#686c73}sky-input-box sky-character-counter-indicator{flex-grow:1;text-align:right;margin-bottom:5px;margin-left:auto}sky-input-box .sky-control-label+sky-character-counter-indicator{flex-grow:0;flex-shrink:.001}sky-input-box .sky-form-control,sky-input-box .sky-form-control:focus{border:none;flex-basis:100%}sky-input-box .sky-form-control:focus,sky-input-box .sky-form-control.ng-invalid.ng-touched,sky-input-box .sky-form-control:focus:focus,sky-input-box .sky-form-control:focus.ng-invalid.ng-touched{border:none;box-shadow:none}sky-input-box .sky-input-box-icon-inset-left-wrapper .sky-input-box-icon-inset-left{padding:0 0 0 10px;width:initial}.sky-theme-modern .sky-input-box .sky-input-box-group{display:flex}.sky-theme-modern .sky-input-box .sky-input-box-group-form-control{flex-grow:1;position:relative}.sky-theme-modern .sky-input-box .sky-input-box-group-form-control:first-child .sky-form-group{border-top-left-radius:6px;border-bottom-left-radius:6px}.sky-theme-modern .sky-input-box .sky-input-box-group-form-control:last-child .sky-form-group{border-top-right-radius:6px;border-bottom-right-radius:6px}.sky-theme-modern .sky-input-box .sky-input-box-form-group-inner{display:flex;flex-grow:1;flex-wrap:wrap}.sky-theme-modern .sky-input-box .sky-input-group-btn .sky-btn{border-radius:0;color:#686c73;margin:0;padding:0;position:relative;transition:border-color .15s,box-shadow .15s,color .15s;width:55px}.sky-theme-modern .sky-input-box .sky-input-group-btn .sky-btn .sky-icon{font-size:24px}.sky-theme-modern .sky-input-box .sky-input-group-btn:first-child .sky-btn{border-top-left-radius:6px;border-bottom-left-radius:6px;margin-right:-1px}.sky-theme-modern .sky-input-box .sky-input-group-btn:first-child .sky-btn:focus{z-index:1}.sky-theme-modern .sky-input-box .sky-input-group-btn:last-child .sky-btn{border-top-right-radius:6px;border-bottom-right-radius:6px}.sky-theme-modern .sky-input-box .sky-input-group-icon{width:55px}.sky-theme-modern .sky-input-box .sky-input-group-icon .sky-icon{color:#686c73;font-size:24px}.sky-theme-modern .sky-input-box .sky-input-box-group-form-control-focus:not(:last-child),.sky-theme-modern .sky-input-box .sky-input-box-group-form-control-invalid:not(:last-child),.sky-theme-modern .sky-input-box .sky-input-group-btn:focus-within:not(:last-child){z-index:1}.sky-theme-modern .sky-input-box .sky-input-box-group-form-control+.sky-input-group-btn .sky-btn{margin-left:-2px}.sky-theme-modern .sky-input-box .sky-input-group-btn+.sky-input-group-btn .sky-btn{margin-left:-1px}.sky-theme-modern .sky-input-box .sky-input-box-group-form-control-invalid .sky-form-group{border:none;box-shadow:inset 0 0 0 2px #ef4044;color:#d93a3d}.sky-theme-modern .sky-input-box .sky-input-box-group-form-control-focus:not(:active),.sky-theme-modern .sky-input-box .sky-input-box-group-form-control-focus:not(:active).sky-input-box-group-form-control-invalid{z-index:1}.sky-theme-modern .sky-input-box .sky-input-box-group-form-control-focus:not(:active) .sky-form-group,.sky-theme-modern .sky-input-box .sky-input-box-group-form-control-focus:not(:active).sky-input-box-group-form-control-invalid .sky-form-group{border:none;box-shadow:inset 0 0 0 2px #1870b8,0 1px 3px #0000004d;color:#1870b8}.sky-theme-modern .sky-input-box .sky-form-group{background-color:#fff;border:none;box-shadow:inset 0 0 0 1px #d2d2d2;color:#686c73;flex-wrap:nowrap;margin-bottom:0;padding:0}.sky-theme-modern .sky-input-box .sky-form-group .sky-input-box-label-wrapper{display:flex;padding:0 15px;width:100%}.sky-theme-modern .sky-input-box .sky-form-group .sky-input-box-label-wrapper .sky-control-label,.sky-theme-modern .sky-input-box .sky-form-group .sky-input-box-label-wrapper .sky-control-help,.sky-theme-modern .sky-input-box .sky-form-group .sky-input-box-label-wrapper sky-character-counter-indicator{margin-bottom:0;position:relative;z-index:2}.sky-theme-modern .sky-input-box .sky-form-group .sky-input-box-label-wrapper .sky-control-label{padding:6px 0 1px}.sky-theme-modern .sky-input-box .sky-form-group .sky-input-box-label-wrapper .sky-control-label,.sky-theme-modern .sky-input-box .sky-form-group .sky-input-box-label-wrapper .sky-character-count-label{font-size:13px}.sky-theme-modern .sky-input-box .sky-form-group .sky-input-box-label-wrapper .sky-control-help{margin:0}.sky-theme-modern .sky-input-box .sky-form-group .sky-input-box-label-wrapper .sky-control-help .sky-help-inline{font-size:16px;padding:3px 10px 0}.sky-theme-modern .sky-input-box .sky-form-group .sky-input-box-label-wrapper .sky-control-help:last-child .sky-help-inline{padding:3px 0 0 10px}.sky-theme-modern .sky-input-box .sky-form-group .sky-input-box-label-wrapper sky-character-counter-indicator{margin-left:auto;padding:3px 0 0}.sky-theme-modern .sky-input-box .sky-form-group .sky-form-control{background-color:transparent;border:none;border-radius:6px;font-size:16px;height:auto;line-height:18px;margin-top:-23px;padding:26px 15px 10px;position:relative}.sky-theme-modern .sky-input-box .sky-form-group .sky-form-control:first-line{line-height:19px}.sky-theme-modern .sky-input-box .sky-form-group .sky-form-control:focus,.sky-theme-modern .sky-input-box .sky-form-group .sky-form-control.ng-invalid{box-shadow:none;outline:none}.sky-theme-modern .sky-input-box .sky-form-group .sky-form-control::-webkit-input-placeholder{font-size:16px}.sky-theme-modern .sky-input-box .sky-form-group .sky-form-control::-moz-placeholder{font-size:16px}.sky-theme-modern .sky-input-box .sky-form-group .sky-form-controlinput:-moz-placeholder{font-size:16px}.sky-theme-modern .sky-input-box .sky-form-group .sky-form-control:-ms-input-placeholder{font-size:16px}.sky-theme-modern .sky-input-box .sky-form-group .sky-input-box-btn-inset .sky-btn{background-color:transparent;border-radius:6px;transition-property:none}.sky-theme-modern .sky-input-box .sky-form-group .sky-input-box-btn-inset .sky-btn:not(:active):not(:focus):not(:hover){box-shadow:none}.sky-theme-modern .sky-input-box .sky-form-group .sky-input-box-label-wrapper:empty+.sky-form-control,.sky-theme-modern .sky-input-box .sky-form-group .sky-input-box-label-wrapper:empty+* .sky-form-control{margin-top:0;padding-top:10px}.sky-theme-modern .sky-input-box .sky-form-group textarea.sky-form-control{margin-top:0;padding-top:5px}@-moz-document url-prefix(){.sky-theme-modern .sky-input-box .sky-form-group select.sky-form-control{padding-left:10px}}.sky-theme-modern .sky-input-box .sky-form-group select.sky-form-control{background-position-x:calc(100% - 10px);z-index:3}.sky-theme-modern .sky-input-box .sky-form-group textarea.sky-form-control{resize:vertical}.sky-theme-modern .sky-input-box .sky-input-box-icon-inset-left-wrapper .sky-input-box-icon-inset-left{padding:0 0 0 15px;width:initial}.sky-theme-modern .sky-input-box:not(.sky-input-box-disabled) .sky-input-box-group-form-control:hover{z-index:1}.sky-theme-modern .sky-input-box:not(.sky-input-box-disabled) .sky-input-box-group-form-control:hover .sky-form-group{border:none;box-shadow:inset 0 0 0 1px #1870b8}.sky-theme-modern .sky-input-box:not(.sky-input-box-disabled) .sky-input-group-btn .sky-btn{border:none;box-shadow:inset 0 0 0 1px #d2d2d2}.sky-theme-modern .sky-input-box:not(.sky-input-box-disabled) .sky-input-group-btn .sky-btn:hover{border:none;box-shadow:inset 0 0 0 1px #1870b8;z-index:1}.sky-theme-modern .sky-input-box:not(.sky-input-box-disabled) .sky-input-group-btn .sky-btn:active,.sky-theme-modern .sky-input-box:not(.sky-input-box-disabled) .sky-input-group-btn .sky-btn:focus{border:none;box-shadow:inset 0 0 0 2px #1870b8;color:#212327;z-index:2}.sky-theme-modern .sky-input-box:not(.sky-input-box-disabled) .sky-input-group-btn .sky-btn:focus:not(:active){outline:none;border:none;box-shadow:inset 0 0 0 2px #1870b8,0 1px 3px #0000004d}.sky-theme-modern .sky-input-box:not(.sky-input-box-disabled) .sky-input-box-group-form-control:active .sky-form-group,.sky-theme-modern .sky-input-box:not(.sky-input-box-disabled) .sky-input-box-group-form-control-focus .sky-form-group{border:none;box-shadow:inset 0 0 0 2px #1870b8}.sky-theme-modern .sky-input-box:not(.sky-input-box-disabled) .sky-input-box-group-form-control-invalid .sky-form-group{border:none;box-shadow:inset 0 0 0 2px #ef4044;color:#d93a3d}.sky-theme-modern .sky-input-box:not(.sky-input-box-disabled) .sky-input-box-group-form-control-invalid:active .sky-form-group{color:#1870b8}.sky-theme-modern .sky-input-box:not(.sky-input-box-disabled) .sky-input-box-group-form-control-focus:not(:active),.sky-theme-modern .sky-input-box:not(.sky-input-box-disabled) .sky-input-box-group-form-control-focus:not(:active).sky-input-box-group-form-control-invalid{z-index:1}.sky-theme-modern .sky-input-box:not(.sky-input-box-disabled) .sky-input-box-group-form-control-focus:not(:active) .sky-form-group,.sky-theme-modern .sky-input-box:not(.sky-input-box-disabled) .sky-input-box-group-form-control-focus:not(:active).sky-input-box-group-form-control-invalid .sky-form-group{border:none;box-shadow:inset 0 0 0 2px #1870b8,0 1px 3px #0000004d;color:#1870b8}.sky-theme-modern .sky-input-box:not(.sky-input-box-disabled) .sky-form-group{transition:border-color .15s,box-shadow .15s,color .15s}.sky-theme-modern .sky-input-box:not(.sky-input-box-disabled) .sky-form-group .sky-control-label{transition:border-color .15s,box-shadow .15s,color .15s}.sky-theme-modern .sky-input-box.sky-input-box-disabled .sky-form-control,.sky-theme-modern .sky-input-box.sky-input-box-disabled .sky-control-label,.sky-theme-modern .sky-input-box.sky-input-box-disabled .sky-input-group-btn{cursor:not-allowed}.sky-theme-modern .sky-input-box.sky-input-box-disabled .sky-input-box-icon-inset-wrapper,.sky-theme-modern .sky-input-box.sky-input-box-disabled .sky-input-box-icon-inset-left-wrapper{background-color:transparent}.sky-theme-modern .sky-input-box.sky-input-box-disabled .sky-form-group{background-color:#ededee}.sky-theme-modern .sky-input-box.sky-input-box-disabled .sky-input-group-btn .sky-btn{background-color:#ededee;border:none;box-shadow:inset 0 0 0 1px #d2d2d2;opacity:1}.sky-theme-modern.sky-theme-mode-dark .sky-input-box .sky-form-group{background-color:transparent;border:none;box-shadow:inset 0 0 0 1px #686c73;color:#c0c2c5}.sky-theme-modern.sky-theme-mode-dark .sky-input-box .sky-form-group .sky-form-control,.sky-theme-modern.sky-theme-mode-dark .sky-input-box .sky-form-group .sky-input-group-btn .sky-btn{background-color:transparent;color:#fbfcfe}.sky-theme-modern.sky-theme-mode-dark .sky-input-box .sky-input-box-group-form-control-focus .sky-form-group,.sky-theme-modern.sky-theme-mode-dark .sky-input-box .sky-input-box-group-form-control-focus.sky-input-box-group-form-control-invalid .sky-form-group{color:#1870b8}.sky-theme-modern.sky-theme-mode-dark .sky-input-box .sky-input-box-group-form-control-invalid .sky-form-group{border:none;box-shadow:inset 0 0 0 2px #ef4044;color:#d93a3d}.sky-theme-modern.sky-theme-mode-dark .sky-input-box .sky-input-group-btn .sky-btn{border:none;box-shadow:inset 0 0 0 1px #686c73;color:#c0c2c5}.sky-theme-modern.sky-theme-mode-dark .sky-input-box .sky-input-group-btn .sky-btn.sky-btn-default{background-color:transparent}.sky-theme-modern.sky-theme-mode-dark .sky-input-box .sky-input-group-btn .sky-btn:focus{border-color:#1870b8;color:#fbfcfe}\n"],
|
|
2119
|
-
providers: [SkyInputBoxAdapterService, SkyInputBoxHostService],
|
|
2120
|
-
// Note that change detection is not set to OnPush; default change detection allows the
|
|
2121
|
-
// invalid CSS class to be added when the content control's invalid/dirty state changes.
|
|
2122
|
-
encapsulation: i0.ViewEncapsulation.None,
|
|
2123
|
-
}]
|
|
2124
|
-
}], ctorParameters: function () { return [{ type: i0__namespace.ChangeDetectorRef }, { type: SkyInputBoxHostService }, { type: SkyInputBoxAdapterService }, { type: i0__namespace.ElementRef }]; }, propDecorators: { hasErrors: [{
|
|
2125
|
-
type: i0.Input
|
|
2126
|
-
}], disabled: [{
|
|
2127
|
-
type: i0.Input
|
|
2128
|
-
}], formControl: [{
|
|
2129
|
-
type: i0.ContentChild,
|
|
2130
|
-
args: [i4.FormControlDirective]
|
|
2131
|
-
}], formControlByName: [{
|
|
2132
|
-
type: i0.ContentChild,
|
|
2133
|
-
args: [i4.FormControlName]
|
|
2134
|
-
}], ngModel: [{
|
|
2135
|
-
type: i0.ContentChild,
|
|
2136
|
-
args: [i4.NgModel]
|
|
2137
|
-
}] } });
|
|
2138
|
-
|
|
2139
|
-
var SkyInputBoxModule = /** @class */ (function () {
|
|
2140
|
-
function SkyInputBoxModule() {
|
|
2141
|
-
}
|
|
2142
|
-
return SkyInputBoxModule;
|
|
2143
|
-
}());
|
|
2144
|
-
SkyInputBoxModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyInputBoxModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
|
|
2145
|
-
SkyInputBoxModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyInputBoxModule, declarations: [SkyInputBoxComponent], imports: [i1.CommonModule, i1$1.SkyThemeModule], exports: [SkyInputBoxComponent] });
|
|
2146
|
-
SkyInputBoxModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyInputBoxModule, imports: [[i1.CommonModule, i1$1.SkyThemeModule]] });
|
|
2147
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyInputBoxModule, decorators: [{
|
|
2148
|
-
type: i0.NgModule,
|
|
2149
|
-
args: [{
|
|
2150
|
-
declarations: [SkyInputBoxComponent],
|
|
2151
|
-
imports: [i1.CommonModule, i1$1.SkyThemeModule],
|
|
2152
|
-
exports: [SkyInputBoxComponent],
|
|
2153
|
-
}]
|
|
2154
|
-
}] });
|
|
2155
|
-
|
|
2156
|
-
/**
|
|
2157
|
-
* Auto-incrementing integer that generates unique IDs for radio components.
|
|
2158
|
-
*/
|
|
2159
|
-
var nextUniqueId$1 = 0;
|
|
2160
|
-
/**
|
|
2161
|
-
* Provider Expression that allows sky-radio to register as a ControlValueAccessor.
|
|
2162
|
-
* This allows it to support [(ngModel)].
|
|
2163
|
-
*/
|
|
2164
|
-
// tslint:disable:no-forward-ref no-use-before-declare
|
|
2165
|
-
var SKY_RADIO_CONTROL_VALUE_ACCESSOR = {
|
|
2166
|
-
provide: i4.NG_VALUE_ACCESSOR,
|
|
2167
|
-
useExisting: i0.forwardRef(function () { return SkyRadioComponent; }),
|
|
2168
|
-
multi: true,
|
|
2169
|
-
};
|
|
2170
|
-
// tslint:enable
|
|
2171
|
-
/**
|
|
2172
|
-
* Renders a SKY UX-themed replacement for an HTML `input` element
|
|
2173
|
-
* with `type="radio"`. When users select a radio button, its value is driven through an
|
|
2174
|
-
* `ngModel` attribute that you specify on the `sky-radio` element or the parent `sky-radio-group` element.
|
|
2175
|
-
*/
|
|
2176
|
-
var SkyRadioComponent = /** @class */ (function () {
|
|
2177
|
-
function SkyRadioComponent(changeDetector) {
|
|
2178
|
-
this.changeDetector = changeDetector;
|
|
2179
|
-
/**
|
|
2180
|
-
* Fires when users focus off a radio button.
|
|
2181
|
-
*/
|
|
2182
|
-
this.blur = new rxjs.Subject();
|
|
2183
|
-
/**
|
|
2184
|
-
* Specifies an ID for the radio button.
|
|
2185
|
-
* @default a unique, auto-incrementing integer. For example: `sky-radio-1`
|
|
2186
|
-
*/
|
|
2187
|
-
this.id = "sky-radio-" + ++nextUniqueId$1;
|
|
2188
|
-
this._change = new i0.EventEmitter();
|
|
2189
|
-
this._checked = false;
|
|
2190
|
-
this._checkedChange = new rxjs.BehaviorSubject(this._checked);
|
|
2191
|
-
this._disabled = false;
|
|
2192
|
-
this._disabledChange = new rxjs.BehaviorSubject(this._disabled);
|
|
2193
|
-
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
2194
|
-
this.removeUniqueSelectionListener = function () { };
|
|
2195
|
-
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
2196
|
-
this.onChangeCallback = function (value) { };
|
|
2197
|
-
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
2198
|
-
this.onTouchedCallback = function () { };
|
|
2199
|
-
}
|
|
2200
|
-
Object.defineProperty(SkyRadioComponent.prototype, "checked", {
|
|
2201
|
-
get: function () {
|
|
2202
|
-
return this._checked;
|
|
2203
|
-
},
|
|
2204
|
-
/**
|
|
2205
|
-
* Indicates whether the radio button is selected.
|
|
2206
|
-
* @default false
|
|
2207
|
-
*/
|
|
2208
|
-
set: function (value) {
|
|
2209
|
-
var newCheckedState = !!value;
|
|
2210
|
-
if (this._checked !== newCheckedState) {
|
|
2211
|
-
this._checked = newCheckedState;
|
|
2212
|
-
this._checkedChange.next(this._checked);
|
|
2213
|
-
if (newCheckedState) {
|
|
2214
|
-
this.selectedValue = this.value;
|
|
2215
|
-
}
|
|
2216
|
-
}
|
|
2217
|
-
this.changeDetector.markForCheck();
|
|
2218
|
-
},
|
|
2219
|
-
enumerable: false,
|
|
2220
|
-
configurable: true
|
|
2221
|
-
});
|
|
2222
|
-
Object.defineProperty(SkyRadioComponent.prototype, "disabled", {
|
|
2223
|
-
get: function () {
|
|
2224
|
-
return this._disabled;
|
|
2225
|
-
},
|
|
2226
|
-
/**
|
|
2227
|
-
* Indicates whether to disable the input.
|
|
2228
|
-
* @default false
|
|
2229
|
-
*/
|
|
2230
|
-
set: function (value) {
|
|
2231
|
-
var coercedValue = SkyFormsUtility.coerceBooleanProperty(value);
|
|
2232
|
-
if (coercedValue !== this.disabled) {
|
|
2233
|
-
this._disabled = coercedValue;
|
|
2234
|
-
this._disabledChange.next(this._disabled);
|
|
2235
|
-
this.changeDetector.markForCheck();
|
|
2236
|
-
}
|
|
2237
|
-
},
|
|
2238
|
-
enumerable: false,
|
|
2239
|
-
configurable: true
|
|
2240
|
-
});
|
|
2241
|
-
Object.defineProperty(SkyRadioComponent.prototype, "name", {
|
|
2242
|
-
get: function () {
|
|
2243
|
-
return this._name;
|
|
2244
|
-
},
|
|
2245
|
-
/**
|
|
2246
|
-
* This property is deprecated in favor of the `name` property on the `sky-radio-group element`.
|
|
2247
|
-
* We recommend using the `sky-radio-group` element with all radio buttons, but if you opt not to,
|
|
2248
|
-
* then this property specifies a name for a group of radio buttons.
|
|
2249
|
-
* @deprecated
|
|
2250
|
-
*/
|
|
2251
|
-
set: function (value) {
|
|
2252
|
-
this._name = value;
|
|
2253
|
-
this.changeDetector.markForCheck();
|
|
2254
|
-
},
|
|
2255
|
-
enumerable: false,
|
|
2256
|
-
configurable: true
|
|
2257
|
-
});
|
|
2258
|
-
Object.defineProperty(SkyRadioComponent.prototype, "tabindex", {
|
|
2259
|
-
get: function () {
|
|
2260
|
-
return this._tabindex || 0;
|
|
2261
|
-
},
|
|
2262
|
-
/**
|
|
2263
|
-
* This property is deprecated in favor of
|
|
2264
|
-
* the `tabIndex` property on the `sky-radio-group` element. It specifies an index for the radio
|
|
2265
|
-
* button. If the index is not defined, it is set to the position of the radio button on load.
|
|
2266
|
-
* @deprecated
|
|
2267
|
-
*/
|
|
2268
|
-
set: function (value) {
|
|
2269
|
-
console.warn('The sky-radio `tabindex` property is deprecated. Please use the `tabindex` property on the sky-radio-group component.');
|
|
2270
|
-
this._tabindex = value;
|
|
2271
|
-
this.changeDetector.markForCheck();
|
|
2272
|
-
},
|
|
2273
|
-
enumerable: false,
|
|
2274
|
-
configurable: true
|
|
2275
|
-
});
|
|
2276
|
-
Object.defineProperty(SkyRadioComponent.prototype, "groupTabIndex", {
|
|
2277
|
-
// For setting the tabindex from the radio group
|
|
2278
|
-
set: function (value) {
|
|
2279
|
-
this._tabindex = value;
|
|
2280
|
-
this.changeDetector.markForCheck();
|
|
2281
|
-
},
|
|
2282
|
-
enumerable: false,
|
|
2283
|
-
configurable: true
|
|
2284
|
-
});
|
|
2285
|
-
Object.defineProperty(SkyRadioComponent.prototype, "value", {
|
|
2286
|
-
get: function () {
|
|
2287
|
-
return this._value;
|
|
2288
|
-
},
|
|
2289
|
-
/**
|
|
2290
|
-
* Specifies and binds a value to the radio button's `value` property. The value usually
|
|
2291
|
-
* corresponds to the radio button's label, which you specify with the `sky-radio-label`
|
|
2292
|
-
* component.
|
|
2293
|
-
* @required
|
|
2294
|
-
*/
|
|
2295
|
-
set: function (value) {
|
|
2296
|
-
/* istanbul ignore else */
|
|
2297
|
-
if (this._value !== value) {
|
|
2298
|
-
if (this.selectedValue && this.selectedValue === this._value) {
|
|
2299
|
-
this.selectedValue = value;
|
|
2300
|
-
this.onChangeCallback(this.selectedValue);
|
|
2301
|
-
this.onTouchedCallback();
|
|
2302
|
-
}
|
|
2303
|
-
this._value = value;
|
|
2304
|
-
}
|
|
2305
|
-
this.changeDetector.markForCheck();
|
|
2306
|
-
},
|
|
2307
|
-
enumerable: false,
|
|
2308
|
-
configurable: true
|
|
2309
|
-
});
|
|
2310
|
-
Object.defineProperty(SkyRadioComponent.prototype, "radioType", {
|
|
2311
|
-
/**
|
|
2312
|
-
* Specifies a type to set the background color after users select an icon radio button.
|
|
2313
|
-
* The valid options correspond
|
|
2314
|
-
* [the label component's](https://developer.blackbaud.com/skyux/components/label)
|
|
2315
|
-
* label types. `danger` creates a red background, `info` creates a blue background,
|
|
2316
|
-
* `success` creates a green background, and `warning` creates an orange background.
|
|
2317
|
-
* @default "info"
|
|
2318
|
-
*/
|
|
2319
|
-
get: function () {
|
|
2320
|
-
return this._radioType || 'info';
|
|
2321
|
-
},
|
|
2322
|
-
set: function (value) {
|
|
2323
|
-
if (value) {
|
|
2324
|
-
this._radioType = value.toLowerCase();
|
|
2325
|
-
}
|
|
2326
|
-
},
|
|
2327
|
-
enumerable: false,
|
|
2328
|
-
configurable: true
|
|
2329
|
-
});
|
|
2330
|
-
Object.defineProperty(SkyRadioComponent.prototype, "change", {
|
|
2331
|
-
/**
|
|
2332
|
-
* Fires when users select a radio button.
|
|
2333
|
-
*/
|
|
2334
|
-
get: function () {
|
|
2335
|
-
return this._change;
|
|
2336
|
-
},
|
|
2337
|
-
enumerable: false,
|
|
2338
|
-
configurable: true
|
|
2339
|
-
});
|
|
2340
|
-
Object.defineProperty(SkyRadioComponent.prototype, "checkedChange", {
|
|
2341
|
-
/**
|
|
2342
|
-
* Fires when the selected value changes.
|
|
2343
|
-
*/
|
|
2344
|
-
get: function () {
|
|
2345
|
-
return this._checkedChange;
|
|
2346
|
-
},
|
|
2347
|
-
enumerable: false,
|
|
2348
|
-
configurable: true
|
|
2349
|
-
});
|
|
2350
|
-
Object.defineProperty(SkyRadioComponent.prototype, "disabledChange", {
|
|
2351
|
-
/**
|
|
2352
|
-
* Fires when the selected value changes.
|
|
2353
|
-
*/
|
|
2354
|
-
get: function () {
|
|
2355
|
-
return this._disabledChange;
|
|
2356
|
-
},
|
|
2357
|
-
enumerable: false,
|
|
2358
|
-
configurable: true
|
|
2359
|
-
});
|
|
2360
|
-
Object.defineProperty(SkyRadioComponent.prototype, "inputId", {
|
|
2361
|
-
get: function () {
|
|
2362
|
-
return "sky-radio-" + this.id + "-input";
|
|
2363
|
-
},
|
|
2364
|
-
enumerable: false,
|
|
2365
|
-
configurable: true
|
|
2366
|
-
});
|
|
2367
|
-
Object.defineProperty(SkyRadioComponent.prototype, "selectedValue", {
|
|
2368
|
-
get: function () {
|
|
2369
|
-
return this._selectedValue;
|
|
2370
|
-
},
|
|
2371
|
-
set: function (value) {
|
|
2372
|
-
if (value !== this._selectedValue) {
|
|
2373
|
-
this._selectedValue = value;
|
|
2374
|
-
}
|
|
2375
|
-
},
|
|
2376
|
-
enumerable: false,
|
|
2377
|
-
configurable: true
|
|
2378
|
-
});
|
|
2379
|
-
SkyRadioComponent.prototype.ngOnDestroy = function () {
|
|
2380
|
-
this.removeUniqueSelectionListener();
|
|
2381
|
-
};
|
|
2382
|
-
SkyRadioComponent.prototype.writeValue = function (value) {
|
|
2383
|
-
if (value === undefined) {
|
|
2384
|
-
return;
|
|
2385
|
-
}
|
|
2386
|
-
this.selectedValue = value;
|
|
2387
|
-
this.checked = this.value === this.selectedValue;
|
|
2388
|
-
this.changeDetector.markForCheck();
|
|
2389
|
-
};
|
|
2390
|
-
/**
|
|
2391
|
-
* @internal
|
|
2392
|
-
* Indicates whether to disable the control. Implemented as a part of ControlValueAccessor.
|
|
2393
|
-
*/
|
|
2394
|
-
SkyRadioComponent.prototype.setDisabledState = function (isDisabled) {
|
|
2395
|
-
this.disabled = isDisabled;
|
|
2396
|
-
};
|
|
2397
|
-
SkyRadioComponent.prototype.registerOnChange = function (fn) {
|
|
2398
|
-
this.onChangeCallback = fn;
|
|
2399
|
-
};
|
|
2400
|
-
SkyRadioComponent.prototype.registerOnTouched = function (fn) {
|
|
2401
|
-
this.onTouchedCallback = fn;
|
|
2402
|
-
};
|
|
2403
|
-
SkyRadioComponent.prototype.onInputChange = function (event) {
|
|
2404
|
-
event.stopPropagation();
|
|
2405
|
-
if (!this.disabled) {
|
|
2406
|
-
this.checked = true;
|
|
2407
|
-
this._change.emit({
|
|
2408
|
-
source: this,
|
|
2409
|
-
value: this._value,
|
|
2410
|
-
});
|
|
2411
|
-
this.onInputFocusChange(undefined);
|
|
2412
|
-
this.onChangeCallback(this.value);
|
|
2413
|
-
}
|
|
2414
|
-
};
|
|
2415
|
-
SkyRadioComponent.prototype.onInputFocusChange = function (event) {
|
|
2416
|
-
this.onTouchedCallback();
|
|
2417
|
-
this.blur.next();
|
|
2418
|
-
};
|
|
2419
|
-
return SkyRadioComponent;
|
|
2420
|
-
}());
|
|
2421
|
-
SkyRadioComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyRadioComponent, deps: [{ token: i0__namespace.ChangeDetectorRef }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
2422
|
-
SkyRadioComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: SkyRadioComponent, selector: "sky-radio", inputs: { checked: "checked", disabled: "disabled", id: "id", label: "label", labelledBy: "labelledBy", name: "name", tabindex: "tabindex", value: "value", icon: "icon", radioType: "radioType" }, outputs: { change: "change", checkedChange: "checkedChange", disabledChange: "disabledChange" }, providers: [SKY_RADIO_CONTROL_VALUE_ACCESSOR], ngImport: i0__namespace, template: "<label\n class=\"sky-radio-wrapper sky-switch\"\n [ngClass]=\"{ 'sky-switch-disabled': disabled }\"\n>\n <input\n class=\"sky-radio-input sky-switch-input\"\n type=\"radio\"\n [attr.aria-label]=\"label\"\n [attr.aria-labelledby]=\"labelledBy\"\n [checked]=\"checked\"\n [disabled]=\"disabled\"\n [id]=\"inputId\"\n [name]=\"name\"\n [tabIndex]=\"tabindex\"\n [value]=\"value\"\n (blur)=\"onInputFocusChange($event)\"\n (change)=\"onInputChange($event)\"\n />\n <span\n class=\"sky-switch-control\"\n [ngClass]=\"{\n 'sky-switch-control-icon': icon,\n 'sky-rounded-corners': icon,\n 'sky-rounded-circle': !icon,\n 'sky-switch-control-info': icon && radioType === 'info',\n 'sky-switch-control-success': icon && radioType === 'success',\n 'sky-switch-control-warning': icon && radioType === 'warning',\n 'sky-switch-control-danger': icon && radioType === 'danger'\n }\"\n >\n <sky-icon *ngIf=\"icon\" fixedWidth=\"true\" [icon]=\"icon\"> </sky-icon>\n </span>\n <ng-content select=\"sky-radio-label\"></ng-content>\n</label>\n", styles: [".sky-switch-control:not(.sky-switch-control-icon) sky-icon{font-size:70%}.sky-switch-input:checked+.sky-switch-control:not(.sky-switch-control-icon):after{content:\"\";display:inline-block;width:10px;height:10px;background:#000000;border-radius:50%}:host-context(.sky-theme-modern) .sky-switch-input:checked+.sky-switch-control:not(.sky-switch-control-icon):after{background:#1870B8}:host-context(.sky-theme-modern) .sky-radio-input:disabled+.sky-switch-control .sky-radio-icon-modern-checked{background-color:#212327}.sky-theme-modern .sky-switch-input:checked+.sky-switch-control:not(.sky-switch-control-icon):after{background:#1870B8}.sky-theme-modern .sky-radio-input:disabled+.sky-switch-control .sky-radio-icon-modern-checked{background-color:#212327}\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"] }], changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush });
|
|
2423
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyRadioComponent, decorators: [{
|
|
2424
|
-
type: i0.Component,
|
|
2425
|
-
args: [{
|
|
2426
|
-
selector: 'sky-radio',
|
|
2427
|
-
template: "<label\n class=\"sky-radio-wrapper sky-switch\"\n [ngClass]=\"{ 'sky-switch-disabled': disabled }\"\n>\n <input\n class=\"sky-radio-input sky-switch-input\"\n type=\"radio\"\n [attr.aria-label]=\"label\"\n [attr.aria-labelledby]=\"labelledBy\"\n [checked]=\"checked\"\n [disabled]=\"disabled\"\n [id]=\"inputId\"\n [name]=\"name\"\n [tabIndex]=\"tabindex\"\n [value]=\"value\"\n (blur)=\"onInputFocusChange($event)\"\n (change)=\"onInputChange($event)\"\n />\n <span\n class=\"sky-switch-control\"\n [ngClass]=\"{\n 'sky-switch-control-icon': icon,\n 'sky-rounded-corners': icon,\n 'sky-rounded-circle': !icon,\n 'sky-switch-control-info': icon && radioType === 'info',\n 'sky-switch-control-success': icon && radioType === 'success',\n 'sky-switch-control-warning': icon && radioType === 'warning',\n 'sky-switch-control-danger': icon && radioType === 'danger'\n }\"\n >\n <sky-icon *ngIf=\"icon\" fixedWidth=\"true\" [icon]=\"icon\"> </sky-icon>\n </span>\n <ng-content select=\"sky-radio-label\"></ng-content>\n</label>\n",
|
|
2428
|
-
styles: [".sky-switch-control:not(.sky-switch-control-icon) sky-icon{font-size:70%}.sky-switch-input:checked+.sky-switch-control:not(.sky-switch-control-icon):after{content:\"\";display:inline-block;width:10px;height:10px;background:#000000;border-radius:50%}:host-context(.sky-theme-modern) .sky-switch-input:checked+.sky-switch-control:not(.sky-switch-control-icon):after{background:#1870B8}:host-context(.sky-theme-modern) .sky-radio-input:disabled+.sky-switch-control .sky-radio-icon-modern-checked{background-color:#212327}.sky-theme-modern .sky-switch-input:checked+.sky-switch-control:not(.sky-switch-control-icon):after{background:#1870B8}.sky-theme-modern .sky-radio-input:disabled+.sky-switch-control .sky-radio-icon-modern-checked{background-color:#212327}\n"],
|
|
2429
|
-
providers: [SKY_RADIO_CONTROL_VALUE_ACCESSOR],
|
|
2430
|
-
changeDetection: i0.ChangeDetectionStrategy.OnPush,
|
|
2431
|
-
}]
|
|
2432
|
-
}], ctorParameters: function () { return [{ type: i0__namespace.ChangeDetectorRef }]; }, propDecorators: { checked: [{
|
|
2433
|
-
type: i0.Input
|
|
2434
|
-
}], disabled: [{
|
|
2435
|
-
type: i0.Input
|
|
2436
|
-
}], id: [{
|
|
2437
|
-
type: i0.Input
|
|
2438
|
-
}], label: [{
|
|
2439
|
-
type: i0.Input
|
|
2440
|
-
}], labelledBy: [{
|
|
2441
|
-
type: i0.Input
|
|
2442
|
-
}], name: [{
|
|
2443
|
-
type: i0.Input
|
|
2444
|
-
}], tabindex: [{
|
|
2445
|
-
type: i0.Input
|
|
2446
|
-
}], value: [{
|
|
2447
|
-
type: i0.Input
|
|
2448
|
-
}], icon: [{
|
|
2449
|
-
type: i0.Input
|
|
2450
|
-
}], radioType: [{
|
|
2451
|
-
type: i0.Input
|
|
2452
|
-
}], change: [{
|
|
2453
|
-
type: i0.Output
|
|
2454
|
-
}], checkedChange: [{
|
|
2455
|
-
type: i0.Output
|
|
2456
|
-
}], disabledChange: [{
|
|
2457
|
-
type: i0.Output
|
|
2458
|
-
}] } });
|
|
2459
|
-
|
|
2460
|
-
var nextUniqueId = 0;
|
|
2461
|
-
/**
|
|
2462
|
-
* Organizes radio buttons into a group. It is required for radio
|
|
2463
|
-
* buttons on Angular reactive forms, and we recommend using it with all radio buttons.
|
|
2464
|
-
* On Angular forms, the component manages the selected values and keeps the forms up-to-date.
|
|
2465
|
-
* When users select a radio button, its value is driven through an `ngModel` attribute that you specify on the `sky-radio-group` element.
|
|
2466
|
-
*/
|
|
2467
|
-
var SkyRadioGroupComponent = /** @class */ (function () {
|
|
2468
|
-
function SkyRadioGroupComponent(changeDetector, ngControl) {
|
|
2469
|
-
this.changeDetector = changeDetector;
|
|
2470
|
-
this.ngControl = ngControl;
|
|
2471
|
-
/**
|
|
2472
|
-
* Indicates whether the input is required for form validation.
|
|
2473
|
-
* When you set this property to `true`, the component adds `aria-required` and `required`
|
|
2474
|
-
* attributes to the input element so that forms display an invalid state until the input element
|
|
2475
|
-
* is complete.
|
|
2476
|
-
* @default false
|
|
2477
|
-
*/
|
|
2478
|
-
this.required = false;
|
|
2479
|
-
this.ngUnsubscribe = new rxjs.Subject();
|
|
2480
|
-
this._disabled = false;
|
|
2481
|
-
this._name = "sky-radio-group-" + nextUniqueId++;
|
|
2482
|
-
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
2483
|
-
this.onChange = function () { };
|
|
2484
|
-
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
2485
|
-
this.onTouched = function () { };
|
|
2486
|
-
if (this.ngControl) {
|
|
2487
|
-
this.ngControl.valueAccessor = this;
|
|
2488
|
-
}
|
|
2489
|
-
}
|
|
2490
|
-
Object.defineProperty(SkyRadioGroupComponent.prototype, "disabled", {
|
|
2491
|
-
get: function () {
|
|
2492
|
-
return this._disabled;
|
|
2493
|
-
},
|
|
2494
|
-
/**
|
|
2495
|
-
* Indicates whether to disable the input.
|
|
2496
|
-
* @default false
|
|
2497
|
-
*/
|
|
2498
|
-
set: function (value) {
|
|
2499
|
-
var newDisabledState = SkyFormsUtility.coerceBooleanProperty(value);
|
|
2500
|
-
if (this._disabled !== newDisabledState) {
|
|
2501
|
-
this._disabled = newDisabledState;
|
|
2502
|
-
this.updateRadioButtonDisabled();
|
|
2503
|
-
}
|
|
2504
|
-
},
|
|
2505
|
-
enumerable: false,
|
|
2506
|
-
configurable: true
|
|
2507
|
-
});
|
|
2508
|
-
Object.defineProperty(SkyRadioGroupComponent.prototype, "name", {
|
|
2509
|
-
get: function () {
|
|
2510
|
-
return this._name;
|
|
2511
|
-
},
|
|
2512
|
-
/**
|
|
2513
|
-
* Specifies a name for the collection of radio buttons that the component groups together.
|
|
2514
|
-
* This property overwrites the deprecated `name` property on individual `sky-radio` elements,
|
|
2515
|
-
* and it is required unless the `name` property is set on individual `sky-radio` elements.
|
|
2516
|
-
* @required
|
|
2517
|
-
*/
|
|
2518
|
-
set: function (value) {
|
|
2519
|
-
this._name = value;
|
|
2520
|
-
this.updateRadioButtonNames();
|
|
2521
|
-
},
|
|
2522
|
-
enumerable: false,
|
|
2523
|
-
configurable: true
|
|
2524
|
-
});
|
|
2525
|
-
Object.defineProperty(SkyRadioGroupComponent.prototype, "value", {
|
|
2526
|
-
get: function () {
|
|
2527
|
-
return this._value;
|
|
2528
|
-
},
|
|
2529
|
-
/**
|
|
2530
|
-
* Specifies the value of the radio button to select by default when the group loads.
|
|
2531
|
-
* The value corresponds to the `value` property of an individual `sky-radio` element within the
|
|
2532
|
-
* group.
|
|
2533
|
-
*/
|
|
2534
|
-
set: function (value) {
|
|
2535
|
-
var isNewValue = value !== this._value;
|
|
2536
|
-
/* istanbul ignore else */
|
|
2537
|
-
if (isNewValue) {
|
|
2538
|
-
this._value = value;
|
|
2539
|
-
this.onChange(this._value);
|
|
2540
|
-
this.updateCheckedRadioFromValue();
|
|
2541
|
-
}
|
|
2542
|
-
},
|
|
2543
|
-
enumerable: false,
|
|
2544
|
-
configurable: true
|
|
2545
|
-
});
|
|
2546
|
-
Object.defineProperty(SkyRadioGroupComponent.prototype, "tabIndex", {
|
|
2547
|
-
get: function () {
|
|
2548
|
-
return this._tabIndex;
|
|
2549
|
-
},
|
|
2550
|
-
/**
|
|
2551
|
-
* Specifies an index for all the radio buttons in the group. If the index is not defined,
|
|
2552
|
-
* the indices for individual radio buttons are set to their positions on load.
|
|
2553
|
-
* This property supports accessibility by placing focus on the currently selected radio
|
|
2554
|
-
* button. If no radio button is selected, it places focus on the first or last button
|
|
2555
|
-
* depending on how users navigate to the radio button group.
|
|
2556
|
-
*/
|
|
2557
|
-
set: function (value) {
|
|
2558
|
-
if (this._tabIndex !== value) {
|
|
2559
|
-
this._tabIndex = value;
|
|
2560
|
-
this.updateRadioButtonTabIndexes();
|
|
2561
|
-
}
|
|
2562
|
-
},
|
|
2563
|
-
enumerable: false,
|
|
2564
|
-
configurable: true
|
|
2565
|
-
});
|
|
2566
|
-
SkyRadioGroupComponent.prototype.ngAfterContentInit = function () {
|
|
2567
|
-
var _this = this;
|
|
2568
|
-
// Let child radio components render before updating.
|
|
2569
|
-
setTimeout(function () {
|
|
2570
|
-
_this.resetRadioButtons();
|
|
2571
|
-
});
|
|
2572
|
-
// Watch for radio selections.
|
|
2573
|
-
this.watchForSelections();
|
|
2574
|
-
this.radios.changes.pipe(operators.takeUntil(this.ngUnsubscribe)).subscribe(function () {
|
|
2575
|
-
// Wait for child radio components to finish any rendering updates.
|
|
2576
|
-
setTimeout(function () {
|
|
2577
|
-
_this.resetRadioButtons();
|
|
2578
|
-
});
|
|
2579
|
-
// Subscribe to the new radio buttons
|
|
2580
|
-
_this.watchForSelections();
|
|
2581
|
-
});
|
|
2582
|
-
};
|
|
2583
|
-
SkyRadioGroupComponent.prototype.ngAfterViewInit = function () {
|
|
2584
|
-
if (this.ngControl) {
|
|
2585
|
-
// Backwards compatibility support for anyone still using Validators.Required.
|
|
2586
|
-
this.required =
|
|
2587
|
-
this.required || SkyFormsUtility.hasRequiredValidation(this.ngControl);
|
|
2588
|
-
// Avoid an ExpressionChangedAfterItHasBeenCheckedError.
|
|
2589
|
-
this.changeDetector.detectChanges();
|
|
2590
|
-
}
|
|
2591
|
-
};
|
|
2592
|
-
SkyRadioGroupComponent.prototype.watchForSelections = function () {
|
|
2593
|
-
var _this = this;
|
|
2594
|
-
this.radios.forEach(function (radio) {
|
|
2595
|
-
radio.change
|
|
2596
|
-
.pipe(operators.takeUntil(_this.ngUnsubscribe))
|
|
2597
|
-
.subscribe(function (change) {
|
|
2598
|
-
_this.onTouched();
|
|
2599
|
-
_this.writeValue(change.value);
|
|
2600
|
-
});
|
|
2601
|
-
radio.blur.pipe(operators.takeUntil(_this.ngUnsubscribe)).subscribe(function () {
|
|
2602
|
-
_this.onTouched();
|
|
2603
|
-
_this.changeDetector.markForCheck();
|
|
2604
|
-
});
|
|
2605
|
-
});
|
|
2606
|
-
};
|
|
2607
|
-
SkyRadioGroupComponent.prototype.ngOnDestroy = function () {
|
|
2608
|
-
this.ngUnsubscribe.next();
|
|
2609
|
-
this.ngUnsubscribe.complete();
|
|
2610
|
-
};
|
|
2611
|
-
SkyRadioGroupComponent.prototype.writeValue = function (value) {
|
|
2612
|
-
this.value = value;
|
|
2613
|
-
};
|
|
2614
|
-
/**
|
|
2615
|
-
* @internal
|
|
2616
|
-
* Indicates whether to disable the control. Implemented as a part of ControlValueAccessor.
|
|
2617
|
-
*/
|
|
2618
|
-
SkyRadioGroupComponent.prototype.setDisabledState = function (isDisabled) {
|
|
2619
|
-
this.disabled = isDisabled;
|
|
2620
|
-
};
|
|
2621
|
-
SkyRadioGroupComponent.prototype.registerOnChange = function (fn) {
|
|
2622
|
-
this.onChange = fn;
|
|
2623
|
-
};
|
|
2624
|
-
SkyRadioGroupComponent.prototype.registerOnTouched = function (fn) {
|
|
2625
|
-
this.onTouched = fn;
|
|
2626
|
-
};
|
|
2627
|
-
SkyRadioGroupComponent.prototype.updateRadioButtonDisabled = function () {
|
|
2628
|
-
var _this = this;
|
|
2629
|
-
if (this.radios) {
|
|
2630
|
-
this.radios.forEach(function (radio) {
|
|
2631
|
-
radio.disabled = _this.disabled;
|
|
2632
|
-
});
|
|
2633
|
-
}
|
|
2634
|
-
};
|
|
2635
|
-
SkyRadioGroupComponent.prototype.updateRadioButtonNames = function () {
|
|
2636
|
-
var _this = this;
|
|
2637
|
-
if (this.radios) {
|
|
2638
|
-
this.radios.forEach(function (radio) {
|
|
2639
|
-
radio.name = _this.name;
|
|
2640
|
-
});
|
|
2641
|
-
}
|
|
2642
|
-
};
|
|
2643
|
-
SkyRadioGroupComponent.prototype.updateRadioButtonTabIndexes = function () {
|
|
2644
|
-
var _this = this;
|
|
2645
|
-
if (this.radios) {
|
|
2646
|
-
this.radios.forEach(function (radio) {
|
|
2647
|
-
radio.groupTabIndex = _this.tabIndex;
|
|
2648
|
-
});
|
|
2649
|
-
}
|
|
2650
|
-
};
|
|
2651
|
-
SkyRadioGroupComponent.prototype.updateCheckedRadioFromValue = function () {
|
|
2652
|
-
var _this = this;
|
|
2653
|
-
if (!this.radios) {
|
|
2654
|
-
return;
|
|
2655
|
-
}
|
|
2656
|
-
this.radios.forEach(function (radio) {
|
|
2657
|
-
radio.checked = _this._value === radio.value;
|
|
2658
|
-
});
|
|
2659
|
-
};
|
|
2660
|
-
SkyRadioGroupComponent.prototype.resetRadioButtons = function () {
|
|
2661
|
-
this.updateCheckedRadioFromValue();
|
|
2662
|
-
this.updateRadioButtonNames();
|
|
2663
|
-
this.updateRadioButtonTabIndexes();
|
|
2664
|
-
};
|
|
2665
|
-
return SkyRadioGroupComponent;
|
|
2666
|
-
}());
|
|
2667
|
-
SkyRadioGroupComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyRadioGroupComponent, deps: [{ token: i0__namespace.ChangeDetectorRef }, { token: i4__namespace.NgControl, optional: true, self: true }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
2668
|
-
SkyRadioGroupComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: SkyRadioGroupComponent, selector: "sky-radio-group", inputs: { ariaLabelledBy: "ariaLabelledBy", ariaLabel: "ariaLabel", disabled: "disabled", name: "name", required: "required", value: "value", tabIndex: "tabIndex" }, queries: [{ propertyName: "radios", predicate: SkyRadioComponent, descendants: true }], ngImport: i0__namespace, template: "<div\n class=\"sky-radio-group\"\n role=\"radiogroup\"\n [attr.aria-label]=\"ariaLabel\"\n [attr.aria-labelledby]=\"ariaLabelledBy\"\n [attr.aria-required]=\"required ? true : null\"\n [attr.required]=\"required ? '' : null\"\n>\n <ng-content></ng-content>\n</div>\n" });
|
|
2669
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyRadioGroupComponent, decorators: [{
|
|
2670
|
-
type: i0.Component,
|
|
2671
|
-
args: [{
|
|
2672
|
-
selector: 'sky-radio-group',
|
|
2673
|
-
template: "<div\n class=\"sky-radio-group\"\n role=\"radiogroup\"\n [attr.aria-label]=\"ariaLabel\"\n [attr.aria-labelledby]=\"ariaLabelledBy\"\n [attr.aria-required]=\"required ? true : null\"\n [attr.required]=\"required ? '' : null\"\n>\n <ng-content></ng-content>\n</div>\n",
|
|
2674
|
-
}]
|
|
2675
|
-
}], ctorParameters: function () {
|
|
2676
|
-
return [{ type: i0__namespace.ChangeDetectorRef }, { type: i4__namespace.NgControl, decorators: [{
|
|
2677
|
-
type: i0.Self
|
|
2678
|
-
}, {
|
|
2679
|
-
type: i0.Optional
|
|
2680
|
-
}] }];
|
|
2681
|
-
}, propDecorators: { ariaLabelledBy: [{
|
|
2682
|
-
type: i0.Input
|
|
2683
|
-
}], ariaLabel: [{
|
|
2684
|
-
type: i0.Input
|
|
2685
|
-
}], disabled: [{
|
|
2686
|
-
type: i0.Input
|
|
2687
|
-
}], name: [{
|
|
2688
|
-
type: i0.Input
|
|
2689
|
-
}], required: [{
|
|
2690
|
-
type: i0.Input
|
|
2691
|
-
}], value: [{
|
|
2692
|
-
type: i0.Input
|
|
2693
|
-
}], tabIndex: [{
|
|
2694
|
-
type: i0.Input
|
|
2695
|
-
}], radios: [{
|
|
2696
|
-
type: i0.ContentChildren,
|
|
2697
|
-
args: [SkyRadioComponent, { descendants: true }]
|
|
2698
|
-
}] } });
|
|
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
|
-
|
|
2727
|
-
var SkyRadioModule = /** @class */ (function () {
|
|
2728
|
-
function SkyRadioModule() {
|
|
2729
|
-
}
|
|
2730
|
-
return SkyRadioModule;
|
|
2731
|
-
}());
|
|
2732
|
-
SkyRadioModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyRadioModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
|
|
2733
|
-
SkyRadioModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyRadioModule, declarations: [SkyRadioComponent,
|
|
2734
|
-
SkyRadioGroupComponent,
|
|
2735
|
-
SkyRadioLabelComponent], imports: [i1.CommonModule, i4.FormsModule, i2$1.SkyIconModule], exports: [SkyRadioComponent, SkyRadioGroupComponent, SkyRadioLabelComponent] });
|
|
2736
|
-
SkyRadioModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyRadioModule, imports: [[i1.CommonModule, i4.FormsModule, i2$1.SkyIconModule]] });
|
|
2737
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyRadioModule, decorators: [{
|
|
2738
|
-
type: i0.NgModule,
|
|
2739
|
-
args: [{
|
|
2740
|
-
declarations: [
|
|
2741
|
-
SkyRadioComponent,
|
|
2742
|
-
SkyRadioGroupComponent,
|
|
2743
|
-
SkyRadioLabelComponent,
|
|
2744
|
-
],
|
|
2745
|
-
imports: [i1.CommonModule, i4.FormsModule, i2$1.SkyIconModule],
|
|
2746
|
-
exports: [SkyRadioComponent, SkyRadioGroupComponent, SkyRadioLabelComponent],
|
|
2747
|
-
}]
|
|
2748
|
-
}] });
|
|
2749
|
-
|
|
2750
|
-
var RESPONSIVE_CLASS_XS = 'sky-selection-box-container-xs';
|
|
2751
|
-
var RESPONSIVE_CLASS_SM = 'sky-selection-box-container-sm';
|
|
2752
|
-
var RESPONSIVE_CLASS_MD = 'sky-selection-box-container-md';
|
|
2753
|
-
var RESPONSIVE_CLASS_LG = 'sky-selection-box-container-lg';
|
|
2754
|
-
var BREAKPOINT_XS_MAX_PIXELS = 767;
|
|
2755
|
-
var BREAKPOINT_SM_MIN_PIXELS = 768;
|
|
2756
|
-
var BREAKPOINT_SM_MAX_PIXELS = 991;
|
|
2757
|
-
var BREAKPOINT_MD_MIN_PIXELS = 992;
|
|
2758
|
-
var BREAKPOINT_MD_MAX_PIXELS = 1439;
|
|
2759
|
-
/**
|
|
2760
|
-
* @internal
|
|
2761
|
-
*/
|
|
2762
|
-
var SkySelectionBoxAdapterService = /** @class */ (function () {
|
|
2763
|
-
function SkySelectionBoxAdapterService(coreAdapterService, rendererFactory) {
|
|
2764
|
-
this.coreAdapterService = coreAdapterService;
|
|
2765
|
-
this.renderer = rendererFactory.createRenderer(undefined, undefined);
|
|
2766
|
-
}
|
|
2767
|
-
/**
|
|
2768
|
-
* Sets focus on the specified element.
|
|
2769
|
-
*/
|
|
2770
|
-
SkySelectionBoxAdapterService.prototype.focus = function (el) {
|
|
2771
|
-
el.nativeElement.focus();
|
|
2772
|
-
};
|
|
2773
|
-
/**
|
|
2774
|
-
* Returns a child element with the `.sky-switch` class.
|
|
2775
|
-
* Useful for getting SKY UX-themed radio buttons or checkboxes.
|
|
2776
|
-
*/
|
|
2777
|
-
SkySelectionBoxAdapterService.prototype.getControl = function (el) {
|
|
2778
|
-
return el.nativeElement.querySelector('.sky-switch');
|
|
2779
|
-
};
|
|
2780
|
-
/**
|
|
2781
|
-
* Returns a breakpoint based on the width.
|
|
2782
|
-
* @param width Width of the element in pixels.
|
|
2783
|
-
*/
|
|
2784
|
-
SkySelectionBoxAdapterService.prototype.getBreakpointForWidth = function (width) {
|
|
2785
|
-
if (width <= BREAKPOINT_XS_MAX_PIXELS) {
|
|
2786
|
-
return i2$2.SkyMediaBreakpoints.xs;
|
|
2787
|
-
}
|
|
2788
|
-
else if (width >= BREAKPOINT_SM_MIN_PIXELS &&
|
|
2789
|
-
width <= BREAKPOINT_SM_MAX_PIXELS) {
|
|
2790
|
-
return i2$2.SkyMediaBreakpoints.sm;
|
|
2791
|
-
}
|
|
2792
|
-
else if (width >= BREAKPOINT_MD_MIN_PIXELS &&
|
|
2793
|
-
width <= BREAKPOINT_MD_MAX_PIXELS) {
|
|
2794
|
-
return i2$2.SkyMediaBreakpoints.md;
|
|
2795
|
-
}
|
|
2796
|
-
else {
|
|
2797
|
-
return i2$2.SkyMediaBreakpoints.lg;
|
|
2798
|
-
}
|
|
2799
|
-
};
|
|
2800
|
-
/**
|
|
2801
|
-
* Returns the width of the `parentNode` of the provided `element`.
|
|
2802
|
-
*/
|
|
2803
|
-
SkySelectionBoxAdapterService.prototype.getParentWidth = function (element) {
|
|
2804
|
-
return element.nativeElement.parentNode.getBoundingClientRect().width;
|
|
2805
|
-
};
|
|
2806
|
-
/**
|
|
2807
|
-
* Returns `true` if the `childEl` is a descendant of the `parentEl`.
|
|
2808
|
-
*/
|
|
2809
|
-
SkySelectionBoxAdapterService.prototype.isDescendant = function (parentEl, childEl) {
|
|
2810
|
-
return parentEl.nativeElement.contains(childEl);
|
|
2811
|
-
};
|
|
2812
|
-
/**
|
|
2813
|
-
* Sets the `tabIndex` of all focusable children of the `element` to the provided `tabIndex`.
|
|
2814
|
-
*/
|
|
2815
|
-
SkySelectionBoxAdapterService.prototype.setChildrenTabIndex = function (element, tabIndex) {
|
|
2816
|
-
var el = element.nativeElement;
|
|
2817
|
-
var focusableElems = this.coreAdapterService.getFocusableChildren(el, {
|
|
2818
|
-
ignoreVisibility: true,
|
|
2819
|
-
});
|
|
2820
|
-
var index = focusableElems.length;
|
|
2821
|
-
while (index--) {
|
|
2822
|
-
focusableElems[index].tabIndex = tabIndex;
|
|
2823
|
-
}
|
|
2824
|
-
};
|
|
2825
|
-
/**
|
|
2826
|
-
* Adds a responsive CSS class on the provided element based on its current width.
|
|
2827
|
-
*/
|
|
2828
|
-
SkySelectionBoxAdapterService.prototype.setResponsiveClass = function (element, breakpoint) {
|
|
2829
|
-
var nativeEl = element.nativeElement;
|
|
2830
|
-
this.renderer.removeClass(nativeEl, RESPONSIVE_CLASS_XS);
|
|
2831
|
-
this.renderer.removeClass(nativeEl, RESPONSIVE_CLASS_SM);
|
|
2832
|
-
this.renderer.removeClass(nativeEl, RESPONSIVE_CLASS_MD);
|
|
2833
|
-
this.renderer.removeClass(nativeEl, RESPONSIVE_CLASS_LG);
|
|
2834
|
-
var newClass;
|
|
2835
|
-
// tslint:disable-next-line: switch-default
|
|
2836
|
-
switch (breakpoint) {
|
|
2837
|
-
case i2$2.SkyMediaBreakpoints.xs: {
|
|
2838
|
-
newClass = RESPONSIVE_CLASS_XS;
|
|
2839
|
-
break;
|
|
2840
|
-
}
|
|
2841
|
-
case i2$2.SkyMediaBreakpoints.sm: {
|
|
2842
|
-
newClass = RESPONSIVE_CLASS_SM;
|
|
2843
|
-
break;
|
|
2844
|
-
}
|
|
2845
|
-
case i2$2.SkyMediaBreakpoints.md: {
|
|
2846
|
-
newClass = RESPONSIVE_CLASS_MD;
|
|
2847
|
-
break;
|
|
2848
|
-
}
|
|
2849
|
-
case i2$2.SkyMediaBreakpoints.lg: {
|
|
2850
|
-
newClass = RESPONSIVE_CLASS_LG;
|
|
2851
|
-
break;
|
|
2852
|
-
}
|
|
2853
|
-
}
|
|
2854
|
-
this.renderer.addClass(nativeEl, newClass);
|
|
2855
|
-
};
|
|
2856
|
-
/**
|
|
2857
|
-
* Sets the `tabIndex` of the `element` to the provided `tabIndex`.
|
|
2858
|
-
*/
|
|
2859
|
-
SkySelectionBoxAdapterService.prototype.setTabIndex = function (element, tabIndex) {
|
|
2860
|
-
var el = element.nativeElement;
|
|
2861
|
-
el.tabIndex = tabIndex;
|
|
2862
|
-
};
|
|
2863
|
-
return SkySelectionBoxAdapterService;
|
|
2864
|
-
}());
|
|
2865
|
-
SkySelectionBoxAdapterService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkySelectionBoxAdapterService, deps: [{ token: i2__namespace$2.SkyCoreAdapterService }, { token: i0__namespace.RendererFactory2 }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
2866
|
-
SkySelectionBoxAdapterService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkySelectionBoxAdapterService });
|
|
2867
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkySelectionBoxAdapterService, decorators: [{
|
|
2868
|
-
type: i0.Injectable
|
|
2869
|
-
}], ctorParameters: function () { return [{ type: i2__namespace$2.SkyCoreAdapterService }, { type: i0__namespace.RendererFactory2 }]; } });
|
|
2870
|
-
|
|
2871
|
-
/**
|
|
2872
|
-
* Specifies the description to display in a selection box.
|
|
2873
|
-
*/
|
|
2874
|
-
var SkySelectionBoxDescriptionComponent = /** @class */ (function () {
|
|
2875
|
-
function SkySelectionBoxDescriptionComponent() {
|
|
2876
|
-
}
|
|
2877
|
-
return SkySelectionBoxDescriptionComponent;
|
|
2878
|
-
}());
|
|
2879
|
-
SkySelectionBoxDescriptionComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkySelectionBoxDescriptionComponent, deps: [], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
2880
|
-
SkySelectionBoxDescriptionComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: SkySelectionBoxDescriptionComponent, selector: "sky-selection-box-description", ngImport: i0__namespace, template: "<ng-content></ng-content>\n" });
|
|
2881
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkySelectionBoxDescriptionComponent, decorators: [{
|
|
2882
|
-
type: i0.Component,
|
|
2883
|
-
args: [{
|
|
2884
|
-
selector: 'sky-selection-box-description',
|
|
2885
|
-
template: "<ng-content></ng-content>\n",
|
|
2886
|
-
}]
|
|
2887
|
-
}] });
|
|
2888
|
-
|
|
2889
|
-
/**
|
|
2890
|
-
* Creates a button to present users with a choice or question before proceeding with a one-time process.
|
|
2891
|
-
*/
|
|
2892
|
-
var SkySelectionBoxComponent = /** @class */ (function () {
|
|
2893
|
-
function SkySelectionBoxComponent(changeDetector, selectionBoxAdapterService) {
|
|
2894
|
-
this.changeDetector = changeDetector;
|
|
2895
|
-
this.selectionBoxAdapterService = selectionBoxAdapterService;
|
|
2896
|
-
this.ngUnsubscribe = new rxjs.Subject();
|
|
2897
|
-
}
|
|
2898
|
-
Object.defineProperty(SkySelectionBoxComponent.prototype, "checked", {
|
|
2899
|
-
get: function () {
|
|
2900
|
-
return this._checked;
|
|
2901
|
-
},
|
|
2902
|
-
set: function (value) {
|
|
2903
|
-
this._checked = value;
|
|
2904
|
-
this.changeDetector.markForCheck();
|
|
2905
|
-
},
|
|
2906
|
-
enumerable: false,
|
|
2907
|
-
configurable: true
|
|
2908
|
-
});
|
|
2909
|
-
Object.defineProperty(SkySelectionBoxComponent.prototype, "disabled", {
|
|
2910
|
-
get: function () {
|
|
2911
|
-
return this._disabled || false;
|
|
2912
|
-
},
|
|
2913
|
-
set: function (value) {
|
|
2914
|
-
this.selectionBoxAdapterService.setTabIndex(this.selectionBoxEl, value ? -1 : 0);
|
|
2915
|
-
this._disabled = value;
|
|
2916
|
-
this.changeDetector.markForCheck();
|
|
2917
|
-
},
|
|
2918
|
-
enumerable: false,
|
|
2919
|
-
configurable: true
|
|
2920
|
-
});
|
|
2921
|
-
SkySelectionBoxComponent.prototype.ngAfterViewInit = function () {
|
|
2922
|
-
var _this = this;
|
|
2923
|
-
// Wait for consumer form controls to initialize before setting selected/disabled states.
|
|
2924
|
-
setTimeout(function () {
|
|
2925
|
-
_this.selectionBoxAdapterService.setChildrenTabIndex(_this.selectionBoxEl, -1);
|
|
2926
|
-
_this.updateCheckedOnControlChange();
|
|
2927
|
-
_this.updateDisabledState();
|
|
2928
|
-
});
|
|
2929
|
-
};
|
|
2930
|
-
SkySelectionBoxComponent.prototype.ngOnDestroy = function () {
|
|
2931
|
-
this.ngUnsubscribe.next();
|
|
2932
|
-
this.ngUnsubscribe.complete();
|
|
2933
|
-
};
|
|
2934
|
-
/**
|
|
2935
|
-
* Since we are programatically firing a click on the control,
|
|
2936
|
-
* make sure user is not clicking on the control before firing click logic.
|
|
2937
|
-
*/
|
|
2938
|
-
SkySelectionBoxComponent.prototype.onClick = function (event) {
|
|
2939
|
-
var isControlClick = this.selectionBoxAdapterService.isDescendant(this.controlEl, event.target);
|
|
2940
|
-
if (!isControlClick) {
|
|
2941
|
-
this.selectControl();
|
|
2942
|
-
}
|
|
2943
|
-
};
|
|
2944
|
-
SkySelectionBoxComponent.prototype.onKeydown = function (event) {
|
|
2945
|
-
/* istanbul ignore else */
|
|
2946
|
-
if (event.key === ' ') {
|
|
2947
|
-
this.selectControl();
|
|
2948
|
-
event.preventDefault();
|
|
2949
|
-
}
|
|
2950
|
-
};
|
|
2951
|
-
SkySelectionBoxComponent.prototype.selectControl = function () {
|
|
2952
|
-
this.selectionBoxAdapterService.getControl(this.controlEl).click();
|
|
2953
|
-
this.selectionBoxAdapterService.focus(this.selectionBoxEl);
|
|
2954
|
-
};
|
|
2955
|
-
SkySelectionBoxComponent.prototype.updateCheckedOnControlChange = function () {
|
|
2956
|
-
var _this = this;
|
|
2957
|
-
this.control.checkedChange
|
|
2958
|
-
.pipe(operators.takeUntil(this.ngUnsubscribe))
|
|
2959
|
-
.subscribe(function (value) {
|
|
2960
|
-
_this.checked = value;
|
|
2961
|
-
});
|
|
2962
|
-
};
|
|
2963
|
-
SkySelectionBoxComponent.prototype.updateDisabledState = function () {
|
|
2964
|
-
var _this = this;
|
|
2965
|
-
this.control.disabledChange
|
|
2966
|
-
.pipe(operators.takeUntil(this.ngUnsubscribe))
|
|
2967
|
-
.subscribe(function (value) {
|
|
2968
|
-
_this.disabled = value;
|
|
2969
|
-
});
|
|
2970
|
-
};
|
|
2971
|
-
return SkySelectionBoxComponent;
|
|
2972
|
-
}());
|
|
2973
|
-
SkySelectionBoxComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkySelectionBoxComponent, deps: [{ token: i0__namespace.ChangeDetectorRef }, { token: SkySelectionBoxAdapterService }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
2974
|
-
SkySelectionBoxComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: SkySelectionBoxComponent, selector: "sky-selection-box", inputs: { control: "control" }, viewQueries: [{ propertyName: "controlEl", first: true, predicate: ["control"], descendants: true, read: i0.ElementRef }, { propertyName: "selectionBoxEl", first: true, predicate: ["selectionBox"], descendants: true, read: i0.ElementRef }], ngImport: i0__namespace, template: "<div\n class=\"sky-selection-box sky-rounded-corners sky-btn sky-btn-default\"\n role=\"button\"\n tabindex=\"0\"\n [attr.disabled]=\"disabled ? true : null\"\n [ngClass]=\"{\n 'sky-selection-box-selected': checked,\n 'sky-selection-box-disabled': disabled\n }\"\n [skyThemeClass]=\"{\n 'sky-shadow': 'default',\n 'sky-box sky-elevation-1': 'modern'\n }\"\n (click)=\"onClick($event)\"\n (keydown)=\"onKeydown($event)\"\n #selectionBox\n>\n <div\n class=\"sky-selection-box-icon\"\n [ngStyle]=\"{\n display: !icon.innerHTML.trim() ? 'none' : ''\n }\"\n #icon\n >\n <ng-content select=\"sky-icon\"> </ng-content>\n </div>\n\n <div class=\"sky-selection-box-content\">\n <div\n class=\"sky-selection-box-header\"\n [ngClass]=\"{\n 'sky-font-heading-2': icon.innerHTML.trim(),\n 'sky-font-heading-3': !icon.innerHTML.trim()\n }\"\n >\n <ng-content select=\"sky-selection-box-header\"></ng-content>\n </div>\n <div\n class=\"sky-selection-box-description\"\n [skyThemeClass]=\"{\n 'sky-font-deemphasized': 'modern',\n 'sky-deemphasized': 'default'\n }\"\n >\n <ng-content select=\"sky-selection-box-description\"> </ng-content>\n </div>\n </div>\n\n <div class=\"sky-selection-box-control\" #control>\n <ng-content select=\"sky-radio\"> </ng-content>\n <ng-content select=\"sky-checkbox\"> </ng-content>\n </div>\n</div>\n", styles: [".sky-selection-box{display:flex;flex-flow:row nowrap;padding:15px;text-align:left}.sky-selection-box:hover{background:#ffffff;box-shadow:0 0 5px #0000004d,inset 0 0 0 1px #00b4f1}.sky-selection-box:hover .sky-switch-control{border:solid 1px #00b4f1}.sky-selection-box:focus .sky-switch-control{outline:thin dotted;outline:-webkit-focus-ring-color auto 5px}.sky-selection-box.sky-selection-box-selected{background:#f1eef6}.sky-selection-box.sky-selection-box-disabled{background:#eeeeef}.sky-selection-box.sky-selection-box-disabled .sky-selection-box-icon{color:#686c73}.sky-selection-box .sky-selection-box-icon{color:#0974a1;margin:0 10px 0 0;width:42px;height:42px;display:flex;align-items:center;justify-content:center;flex:0 0 auto}.sky-selection-box .sky-selection-box-icon .sky-icon{font-size:24px!important}.sky-selection-box .sky-selection-box-content{flex:1 1 auto;margin:0 10px 0 0;white-space:initial}.sky-selection-box .sky-selection-box-header{padding-top:3px}.sky-selection-box .sky-selection-box-control{flex:0 0 auto;padding-top:5px}:host-context(.sky-theme-modern) .sky-selection-box{padding:30px}:host-context(.sky-theme-modern) .sky-selection-box:hover{box-shadow:0 1px 3px #0000004d,inset 0 0 0 1px #1870b8}:host-context(.sky-theme-modern) .sky-selection-box:hover .sky-switch-control{border:solid 1px #1870B8}:host-context(.sky-theme-modern) .sky-selection-box:focus .sky-switch-input:not(:disabled):checked+.sky-switch-control{border:none}:host-context(.sky-theme-modern) .sky-selection-box:focus .sky-switch-control{outline:none;border:none;box-shadow:inset 0 0 0 2px #1870b8}:host-context(.sky-theme-modern) .sky-selection-box.sky-selection-box-selected,:host-context(.sky-theme-modern) .sky-selection-box:focus.sky-selection-box-selected{background:#e8f8ff;box-shadow:inset 0 0 0 2px #1870b8,0 1px 8px #0000004d,inset 6px 0 #0974a1}:host-context(.sky-theme-modern) .sky-selection-box.sky-selection-box-disabled .sky-selection-box-icon{background:#d2d2d2;color:#686c73}:host-context(.sky-theme-modern) .sky-selection-box .sky-selection-box-icon{color:#0974a1;background:#e8f8ff;margin:0 15px 0 0;border-radius:50%;width:42px;height:42px;display:flex;align-items:center;justify-content:center;flex:0 0 auto}:host-context(.sky-theme-modern) .sky-selection-box .sky-selection-box-content{margin:0 30px 0 0}:host-context(.sky-theme-modern) .sky-selection-box .sky-selection-box-description{margin:3px 0 0}.sky-theme-modern .sky-selection-box{padding:30px}.sky-theme-modern .sky-selection-box:hover{box-shadow:0 1px 3px #0000004d,inset 0 0 0 1px #1870b8}.sky-theme-modern .sky-selection-box:hover .sky-switch-control{border:solid 1px #1870B8}.sky-theme-modern .sky-selection-box:focus .sky-switch-input:not(:disabled):checked+.sky-switch-control{border:none}.sky-theme-modern .sky-selection-box:focus .sky-switch-control{outline:none;border:none;box-shadow:inset 0 0 0 2px #1870b8}.sky-theme-modern .sky-selection-box.sky-selection-box-selected,.sky-theme-modern .sky-selection-box:focus.sky-selection-box-selected{background:#e8f8ff;box-shadow:inset 0 0 0 2px #1870b8,0 1px 8px #0000004d,inset 6px 0 #0974a1}.sky-theme-modern .sky-selection-box.sky-selection-box-disabled .sky-selection-box-icon{background:#d2d2d2;color:#686c73}.sky-theme-modern .sky-selection-box .sky-selection-box-icon{color:#0974a1;background:#e8f8ff;margin:0 15px 0 0;border-radius:50%;width:42px;height:42px;display:flex;align-items:center;justify-content:center;flex:0 0 auto}.sky-theme-modern .sky-selection-box .sky-selection-box-content{margin:0 30px 0 0}.sky-theme-modern .sky-selection-box .sky-selection-box-description{margin:3px 0 0}\n"], directives: [{ type: i1__namespace.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i1__namespace$1.λ2, selector: "[skyThemeClass]", inputs: ["class", "skyThemeClass"] }, { type: i1__namespace.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }], changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush, encapsulation: i0__namespace.ViewEncapsulation.None });
|
|
2975
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkySelectionBoxComponent, decorators: [{
|
|
2976
|
-
type: i0.Component,
|
|
2977
|
-
args: [{
|
|
2978
|
-
selector: 'sky-selection-box',
|
|
2979
|
-
styles: [".sky-selection-box{display:flex;flex-flow:row nowrap;padding:15px;text-align:left}.sky-selection-box:hover{background:#ffffff;box-shadow:0 0 5px #0000004d,inset 0 0 0 1px #00b4f1}.sky-selection-box:hover .sky-switch-control{border:solid 1px #00b4f1}.sky-selection-box:focus .sky-switch-control{outline:thin dotted;outline:-webkit-focus-ring-color auto 5px}.sky-selection-box.sky-selection-box-selected{background:#f1eef6}.sky-selection-box.sky-selection-box-disabled{background:#eeeeef}.sky-selection-box.sky-selection-box-disabled .sky-selection-box-icon{color:#686c73}.sky-selection-box .sky-selection-box-icon{color:#0974a1;margin:0 10px 0 0;width:42px;height:42px;display:flex;align-items:center;justify-content:center;flex:0 0 auto}.sky-selection-box .sky-selection-box-icon .sky-icon{font-size:24px!important}.sky-selection-box .sky-selection-box-content{flex:1 1 auto;margin:0 10px 0 0;white-space:initial}.sky-selection-box .sky-selection-box-header{padding-top:3px}.sky-selection-box .sky-selection-box-control{flex:0 0 auto;padding-top:5px}:host-context(.sky-theme-modern) .sky-selection-box{padding:30px}:host-context(.sky-theme-modern) .sky-selection-box:hover{box-shadow:0 1px 3px #0000004d,inset 0 0 0 1px #1870b8}:host-context(.sky-theme-modern) .sky-selection-box:hover .sky-switch-control{border:solid 1px #1870B8}:host-context(.sky-theme-modern) .sky-selection-box:focus .sky-switch-input:not(:disabled):checked+.sky-switch-control{border:none}:host-context(.sky-theme-modern) .sky-selection-box:focus .sky-switch-control{outline:none;border:none;box-shadow:inset 0 0 0 2px #1870b8}:host-context(.sky-theme-modern) .sky-selection-box.sky-selection-box-selected,:host-context(.sky-theme-modern) .sky-selection-box:focus.sky-selection-box-selected{background:#e8f8ff;box-shadow:inset 0 0 0 2px #1870b8,0 1px 8px #0000004d,inset 6px 0 #0974a1}:host-context(.sky-theme-modern) .sky-selection-box.sky-selection-box-disabled .sky-selection-box-icon{background:#d2d2d2;color:#686c73}:host-context(.sky-theme-modern) .sky-selection-box .sky-selection-box-icon{color:#0974a1;background:#e8f8ff;margin:0 15px 0 0;border-radius:50%;width:42px;height:42px;display:flex;align-items:center;justify-content:center;flex:0 0 auto}:host-context(.sky-theme-modern) .sky-selection-box .sky-selection-box-content{margin:0 30px 0 0}:host-context(.sky-theme-modern) .sky-selection-box .sky-selection-box-description{margin:3px 0 0}.sky-theme-modern .sky-selection-box{padding:30px}.sky-theme-modern .sky-selection-box:hover{box-shadow:0 1px 3px #0000004d,inset 0 0 0 1px #1870b8}.sky-theme-modern .sky-selection-box:hover .sky-switch-control{border:solid 1px #1870B8}.sky-theme-modern .sky-selection-box:focus .sky-switch-input:not(:disabled):checked+.sky-switch-control{border:none}.sky-theme-modern .sky-selection-box:focus .sky-switch-control{outline:none;border:none;box-shadow:inset 0 0 0 2px #1870b8}.sky-theme-modern .sky-selection-box.sky-selection-box-selected,.sky-theme-modern .sky-selection-box:focus.sky-selection-box-selected{background:#e8f8ff;box-shadow:inset 0 0 0 2px #1870b8,0 1px 8px #0000004d,inset 6px 0 #0974a1}.sky-theme-modern .sky-selection-box.sky-selection-box-disabled .sky-selection-box-icon{background:#d2d2d2;color:#686c73}.sky-theme-modern .sky-selection-box .sky-selection-box-icon{color:#0974a1;background:#e8f8ff;margin:0 15px 0 0;border-radius:50%;width:42px;height:42px;display:flex;align-items:center;justify-content:center;flex:0 0 auto}.sky-theme-modern .sky-selection-box .sky-selection-box-content{margin:0 30px 0 0}.sky-theme-modern .sky-selection-box .sky-selection-box-description{margin:3px 0 0}\n"],
|
|
2980
|
-
template: "<div\n class=\"sky-selection-box sky-rounded-corners sky-btn sky-btn-default\"\n role=\"button\"\n tabindex=\"0\"\n [attr.disabled]=\"disabled ? true : null\"\n [ngClass]=\"{\n 'sky-selection-box-selected': checked,\n 'sky-selection-box-disabled': disabled\n }\"\n [skyThemeClass]=\"{\n 'sky-shadow': 'default',\n 'sky-box sky-elevation-1': 'modern'\n }\"\n (click)=\"onClick($event)\"\n (keydown)=\"onKeydown($event)\"\n #selectionBox\n>\n <div\n class=\"sky-selection-box-icon\"\n [ngStyle]=\"{\n display: !icon.innerHTML.trim() ? 'none' : ''\n }\"\n #icon\n >\n <ng-content select=\"sky-icon\"> </ng-content>\n </div>\n\n <div class=\"sky-selection-box-content\">\n <div\n class=\"sky-selection-box-header\"\n [ngClass]=\"{\n 'sky-font-heading-2': icon.innerHTML.trim(),\n 'sky-font-heading-3': !icon.innerHTML.trim()\n }\"\n >\n <ng-content select=\"sky-selection-box-header\"></ng-content>\n </div>\n <div\n class=\"sky-selection-box-description\"\n [skyThemeClass]=\"{\n 'sky-font-deemphasized': 'modern',\n 'sky-deemphasized': 'default'\n }\"\n >\n <ng-content select=\"sky-selection-box-description\"> </ng-content>\n </div>\n </div>\n\n <div class=\"sky-selection-box-control\" #control>\n <ng-content select=\"sky-radio\"> </ng-content>\n <ng-content select=\"sky-checkbox\"> </ng-content>\n </div>\n</div>\n",
|
|
2981
|
-
changeDetection: i0.ChangeDetectionStrategy.OnPush,
|
|
2982
|
-
encapsulation: i0.ViewEncapsulation.None,
|
|
2983
|
-
}]
|
|
2984
|
-
}], ctorParameters: function () { return [{ type: i0__namespace.ChangeDetectorRef }, { type: SkySelectionBoxAdapterService }]; }, propDecorators: { control: [{
|
|
2985
|
-
type: i0.Input
|
|
2986
|
-
}], controlEl: [{
|
|
2987
|
-
type: i0.ViewChild,
|
|
2988
|
-
args: ['control', {
|
|
2989
|
-
read: i0.ElementRef,
|
|
2990
|
-
static: false,
|
|
2991
|
-
}]
|
|
2992
|
-
}], selectionBoxEl: [{
|
|
2993
|
-
type: i0.ViewChild,
|
|
2994
|
-
args: ['selectionBox', {
|
|
2995
|
-
read: i0.ElementRef,
|
|
2996
|
-
static: false,
|
|
2997
|
-
}]
|
|
2998
|
-
}] } });
|
|
2999
|
-
|
|
3000
|
-
var SKY_SELECTION_BOX_CLASS_NAME = '.sky-selection-box';
|
|
3001
|
-
/**
|
|
3002
|
-
* Creates a grid layout for an array of selection boxes.
|
|
3003
|
-
*/
|
|
3004
|
-
var SkySelectionBoxGridComponent = /** @class */ (function () {
|
|
3005
|
-
function SkySelectionBoxGridComponent(themeSvc, coreAdapterService, selectionBoxAdapter, hostElRef, mutationObserverSvc, ngZone) {
|
|
3006
|
-
this.themeSvc = themeSvc;
|
|
3007
|
-
this.coreAdapterService = coreAdapterService;
|
|
3008
|
-
this.selectionBoxAdapter = selectionBoxAdapter;
|
|
3009
|
-
this.hostElRef = hostElRef;
|
|
3010
|
-
this.mutationObserverSvc = mutationObserverSvc;
|
|
3011
|
-
this.ngZone = ngZone;
|
|
3012
|
-
this.ngUnsubscribe = new rxjs.Subject();
|
|
3013
|
-
}
|
|
3014
|
-
Object.defineProperty(SkySelectionBoxGridComponent.prototype, "alignItems", {
|
|
3015
|
-
get: function () {
|
|
3016
|
-
return this._alignItems || 'center';
|
|
3017
|
-
},
|
|
3018
|
-
/**
|
|
3019
|
-
* @internal
|
|
3020
|
-
* Specifies how to display the selection boxes in the grid.
|
|
3021
|
-
* @default 'center'
|
|
3022
|
-
*/
|
|
3023
|
-
set: function (value) {
|
|
3024
|
-
this._alignItems = value;
|
|
3025
|
-
},
|
|
3026
|
-
enumerable: false,
|
|
3027
|
-
configurable: true
|
|
3028
|
-
});
|
|
3029
|
-
Object.defineProperty(SkySelectionBoxGridComponent.prototype, "currentBreakpoint", {
|
|
3030
|
-
set: function (value) {
|
|
3031
|
-
if (value !== this._currentBreakpoint) {
|
|
3032
|
-
this._currentBreakpoint = value;
|
|
3033
|
-
this.selectionBoxAdapter.setResponsiveClass(this.elementRef, value);
|
|
3034
|
-
this.updateChildrenHeights();
|
|
3035
|
-
}
|
|
3036
|
-
},
|
|
3037
|
-
enumerable: false,
|
|
3038
|
-
configurable: true
|
|
3039
|
-
});
|
|
3040
|
-
SkySelectionBoxGridComponent.prototype.ngOnInit = function () {
|
|
3041
|
-
var _this = this;
|
|
3042
|
-
/* istanbul ignore else */
|
|
3043
|
-
if (this.themeSvc) {
|
|
3044
|
-
this.themeSvc.settingsChange
|
|
3045
|
-
.pipe(operators.takeUntil(this.ngUnsubscribe))
|
|
3046
|
-
.subscribe(function () {
|
|
3047
|
-
_this.updateBreakpointClass();
|
|
3048
|
-
_this.updateChildrenHeights();
|
|
3049
|
-
});
|
|
3050
|
-
}
|
|
3051
|
-
};
|
|
3052
|
-
SkySelectionBoxGridComponent.prototype.ngAfterViewInit = function () {
|
|
3053
|
-
this.updateBreakpointClass();
|
|
3054
|
-
this.updateChildrenHeights();
|
|
3055
|
-
this.initMutationObserver();
|
|
3056
|
-
};
|
|
3057
|
-
SkySelectionBoxGridComponent.prototype.ngOnDestroy = function () {
|
|
3058
|
-
this.ngUnsubscribe.next();
|
|
3059
|
-
this.ngUnsubscribe.complete();
|
|
3060
|
-
this.destroyMutationObserver();
|
|
3061
|
-
};
|
|
3062
|
-
SkySelectionBoxGridComponent.prototype.onWindowResize = function () {
|
|
3063
|
-
this.updateBreakpointClass();
|
|
3064
|
-
};
|
|
3065
|
-
SkySelectionBoxGridComponent.prototype.initMutationObserver = function () {
|
|
3066
|
-
var _this = this;
|
|
3067
|
-
/* istanbul ignore else */
|
|
3068
|
-
if (!this.mutationObserver) {
|
|
3069
|
-
var el_1 = this.elementRef.nativeElement;
|
|
3070
|
-
// MutationObserver is patched by Zone.js and therefore becomes part of the
|
|
3071
|
-
// Angular change detection cycle, but this can lead to infinite loops in some
|
|
3072
|
-
// scenarios. This will keep MutationObserver from triggering change detection.
|
|
3073
|
-
this.ngZone.runOutsideAngular(function () {
|
|
3074
|
-
_this.mutationObserver = _this.mutationObserverSvc.create(function () {
|
|
3075
|
-
_this.updateChildrenHeights();
|
|
3076
|
-
});
|
|
3077
|
-
_this.mutationObserver.observe(el_1, {
|
|
3078
|
-
characterData: true,
|
|
3079
|
-
subtree: true,
|
|
3080
|
-
});
|
|
3081
|
-
});
|
|
3082
|
-
}
|
|
3083
|
-
};
|
|
3084
|
-
SkySelectionBoxGridComponent.prototype.destroyMutationObserver = function () {
|
|
3085
|
-
/* istanbul ignore else */
|
|
3086
|
-
if (this.mutationObserver) {
|
|
3087
|
-
this.mutationObserver.disconnect();
|
|
3088
|
-
this.mutationObserver = undefined;
|
|
3089
|
-
}
|
|
3090
|
-
};
|
|
3091
|
-
SkySelectionBoxGridComponent.prototype.updateBreakpointClass = function () {
|
|
3092
|
-
var parentWidth = this.selectionBoxAdapter.getParentWidth(this.hostElRef);
|
|
3093
|
-
this.currentBreakpoint =
|
|
3094
|
-
this.selectionBoxAdapter.getBreakpointForWidth(parentWidth);
|
|
3095
|
-
};
|
|
3096
|
-
SkySelectionBoxGridComponent.prototype.updateChildrenHeights = function () {
|
|
3097
|
-
this.coreAdapterService.resetHeight(this.elementRef, SKY_SELECTION_BOX_CLASS_NAME);
|
|
3098
|
-
this.coreAdapterService.syncMaxHeight(this.elementRef, SKY_SELECTION_BOX_CLASS_NAME);
|
|
3099
|
-
};
|
|
3100
|
-
return SkySelectionBoxGridComponent;
|
|
3101
|
-
}());
|
|
3102
|
-
SkySelectionBoxGridComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkySelectionBoxGridComponent, deps: [{ token: i1__namespace$1.SkyThemeService }, { token: i2__namespace$2.SkyCoreAdapterService }, { token: SkySelectionBoxAdapterService }, { token: i0__namespace.ElementRef }, { token: i2__namespace$2.MutationObserverService }, { token: i0__namespace.NgZone }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
3103
|
-
SkySelectionBoxGridComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: SkySelectionBoxGridComponent, selector: "sky-selection-box-grid", inputs: { alignItems: "alignItems" }, host: { listeners: { "window:resize": "onWindowResize()" } }, queries: [{ propertyName: "selectionBoxes", predicate: SkySelectionBoxComponent, read: SkySelectionBoxComponent }], viewQueries: [{ propertyName: "elementRef", first: true, predicate: ["container"], descendants: true, read: i0.ElementRef, static: true }], ngImport: i0__namespace, template: "<div\n class=\"sky-selection-box-grid\"\n [ngClass]=\"'sky-selection-box-grid-align-' + alignItems\"\n #container\n>\n <ng-content select=\"sky-selection-box\"></ng-content>\n</div>\n", styles: [":host{display:block}.sky-selection-box-grid{display:flex;flex-flow:row wrap;padding:0 7.5px;margin:0 auto}.sky-selection-box-grid.sky-selection-box-grid-align-center{justify-content:center}.sky-selection-box-grid.sky-selection-box-grid-align-left{justify-content:flex-start}.sky-selection-box-grid>sky-selection-box{margin:0 7.5px 15px;height:100%}.sky-selection-box-grid.sky-selection-box-container-xs{max-width:374px}.sky-selection-box-grid.sky-selection-box-container-xs>sky-selection-box{flex:0 1 344px}.sky-selection-box-grid.sky-selection-box-container-xs .sky-selection-box{padding:15px}.sky-selection-box-grid.sky-selection-box-container-xs .sky-selection-box .sky-selection-box-icon{display:none}.sky-selection-box-grid.sky-selection-box-container-xs .sky-selection-box .sky-selection-box-header{font-size:20px;font-weight:400}.sky-selection-box-grid.sky-selection-box-container-sm{max-width:733px}.sky-selection-box-grid.sky-selection-box-container-sm>sky-selection-box{flex:0 1 344px}.sky-selection-box-grid.sky-selection-box-container-sm .sky-selection-box{padding:15px}.sky-selection-box-grid.sky-selection-box-container-sm .sky-selection-box .sky-selection-box-icon{display:none}.sky-selection-box-grid.sky-selection-box-container-sm .sky-selection-box .sky-selection-box-header{font-size:20px;font-weight:400}.sky-selection-box-grid.sky-selection-box-container-md{max-width:937px}.sky-selection-box-grid.sky-selection-box-container-md>sky-selection-box{flex:0 1 446px}.sky-selection-box-grid.sky-selection-box-container-lg{max-width:1398px}.sky-selection-box-grid.sky-selection-box-container-lg>sky-selection-box{flex:0 1 446px}\n"], directives: [{ type: i1__namespace.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }], changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush, encapsulation: i0__namespace.ViewEncapsulation.None });
|
|
3104
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkySelectionBoxGridComponent, decorators: [{
|
|
3105
|
-
type: i0.Component,
|
|
3106
|
-
args: [{
|
|
3107
|
-
selector: 'sky-selection-box-grid',
|
|
3108
|
-
template: "<div\n class=\"sky-selection-box-grid\"\n [ngClass]=\"'sky-selection-box-grid-align-' + alignItems\"\n #container\n>\n <ng-content select=\"sky-selection-box\"></ng-content>\n</div>\n",
|
|
3109
|
-
styles: [":host{display:block}.sky-selection-box-grid{display:flex;flex-flow:row wrap;padding:0 7.5px;margin:0 auto}.sky-selection-box-grid.sky-selection-box-grid-align-center{justify-content:center}.sky-selection-box-grid.sky-selection-box-grid-align-left{justify-content:flex-start}.sky-selection-box-grid>sky-selection-box{margin:0 7.5px 15px;height:100%}.sky-selection-box-grid.sky-selection-box-container-xs{max-width:374px}.sky-selection-box-grid.sky-selection-box-container-xs>sky-selection-box{flex:0 1 344px}.sky-selection-box-grid.sky-selection-box-container-xs .sky-selection-box{padding:15px}.sky-selection-box-grid.sky-selection-box-container-xs .sky-selection-box .sky-selection-box-icon{display:none}.sky-selection-box-grid.sky-selection-box-container-xs .sky-selection-box .sky-selection-box-header{font-size:20px;font-weight:400}.sky-selection-box-grid.sky-selection-box-container-sm{max-width:733px}.sky-selection-box-grid.sky-selection-box-container-sm>sky-selection-box{flex:0 1 344px}.sky-selection-box-grid.sky-selection-box-container-sm .sky-selection-box{padding:15px}.sky-selection-box-grid.sky-selection-box-container-sm .sky-selection-box .sky-selection-box-icon{display:none}.sky-selection-box-grid.sky-selection-box-container-sm .sky-selection-box .sky-selection-box-header{font-size:20px;font-weight:400}.sky-selection-box-grid.sky-selection-box-container-md{max-width:937px}.sky-selection-box-grid.sky-selection-box-container-md>sky-selection-box{flex:0 1 446px}.sky-selection-box-grid.sky-selection-box-container-lg{max-width:1398px}.sky-selection-box-grid.sky-selection-box-container-lg>sky-selection-box{flex:0 1 446px}\n"],
|
|
3110
|
-
changeDetection: i0.ChangeDetectionStrategy.OnPush,
|
|
3111
|
-
encapsulation: i0.ViewEncapsulation.None,
|
|
3112
|
-
}]
|
|
3113
|
-
}], ctorParameters: function () { return [{ type: i1__namespace$1.SkyThemeService }, { type: i2__namespace$2.SkyCoreAdapterService }, { type: SkySelectionBoxAdapterService }, { type: i0__namespace.ElementRef }, { type: i2__namespace$2.MutationObserverService }, { type: i0__namespace.NgZone }]; }, propDecorators: { alignItems: [{
|
|
3114
|
-
type: i0.Input
|
|
3115
|
-
}], selectionBoxes: [{
|
|
3116
|
-
type: i0.ContentChildren,
|
|
3117
|
-
args: [SkySelectionBoxComponent, {
|
|
3118
|
-
read: SkySelectionBoxComponent,
|
|
3119
|
-
}]
|
|
3120
|
-
}], elementRef: [{
|
|
3121
|
-
type: i0.ViewChild,
|
|
3122
|
-
args: ['container', {
|
|
3123
|
-
read: i0.ElementRef,
|
|
3124
|
-
static: true,
|
|
3125
|
-
}]
|
|
3126
|
-
}], onWindowResize: [{
|
|
3127
|
-
type: i0.HostListener,
|
|
3128
|
-
args: ['window:resize']
|
|
3129
|
-
}] } });
|
|
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
|
-
|
|
3149
|
-
var SkySelectionBoxModule = /** @class */ (function () {
|
|
3150
|
-
function SkySelectionBoxModule() {
|
|
3151
|
-
}
|
|
3152
|
-
return SkySelectionBoxModule;
|
|
3153
|
-
}());
|
|
3154
|
-
SkySelectionBoxModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkySelectionBoxModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
|
|
3155
|
-
SkySelectionBoxModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkySelectionBoxModule, declarations: [SkySelectionBoxGridComponent,
|
|
3156
|
-
SkySelectionBoxComponent,
|
|
3157
|
-
SkySelectionBoxDescriptionComponent,
|
|
3158
|
-
SkySelectionBoxHeaderComponent], imports: [i1.CommonModule, i1$1.SkyThemeModule], exports: [SkySelectionBoxGridComponent,
|
|
3159
|
-
SkySelectionBoxComponent,
|
|
3160
|
-
SkySelectionBoxDescriptionComponent,
|
|
3161
|
-
SkySelectionBoxHeaderComponent] });
|
|
3162
|
-
SkySelectionBoxModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkySelectionBoxModule, providers: [SkySelectionBoxAdapterService], imports: [[i1.CommonModule, i1$1.SkyThemeModule]] });
|
|
3163
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkySelectionBoxModule, decorators: [{
|
|
3164
|
-
type: i0.NgModule,
|
|
3165
|
-
args: [{
|
|
3166
|
-
declarations: [
|
|
3167
|
-
SkySelectionBoxGridComponent,
|
|
3168
|
-
SkySelectionBoxComponent,
|
|
3169
|
-
SkySelectionBoxDescriptionComponent,
|
|
3170
|
-
SkySelectionBoxHeaderComponent,
|
|
3171
|
-
],
|
|
3172
|
-
imports: [i1.CommonModule, i1$1.SkyThemeModule],
|
|
3173
|
-
exports: [
|
|
3174
|
-
SkySelectionBoxGridComponent,
|
|
3175
|
-
SkySelectionBoxComponent,
|
|
3176
|
-
SkySelectionBoxDescriptionComponent,
|
|
3177
|
-
SkySelectionBoxHeaderComponent,
|
|
3178
|
-
],
|
|
3179
|
-
providers: [SkySelectionBoxAdapterService],
|
|
3180
|
-
}]
|
|
3181
|
-
}] });
|
|
3182
|
-
|
|
3183
|
-
/**
|
|
3184
|
-
* Specifies the label to display beside the toggle switch.
|
|
3185
|
-
*/
|
|
3186
|
-
var SkyToggleSwitchLabelComponent = /** @class */ (function () {
|
|
3187
|
-
function SkyToggleSwitchLabelComponent() {
|
|
3188
|
-
}
|
|
3189
|
-
return SkyToggleSwitchLabelComponent;
|
|
3190
|
-
}());
|
|
3191
|
-
SkyToggleSwitchLabelComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyToggleSwitchLabelComponent, deps: [], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
3192
|
-
SkyToggleSwitchLabelComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: SkyToggleSwitchLabelComponent, selector: "sky-toggle-switch-label", ngImport: i0__namespace, template: "<ng-content></ng-content>\n", changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush });
|
|
3193
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyToggleSwitchLabelComponent, decorators: [{
|
|
3194
|
-
type: i0.Component,
|
|
3195
|
-
args: [{
|
|
3196
|
-
selector: 'sky-toggle-switch-label',
|
|
3197
|
-
template: "<ng-content></ng-content>\n",
|
|
3198
|
-
changeDetection: i0.ChangeDetectionStrategy.OnPush,
|
|
3199
|
-
}]
|
|
3200
|
-
}] });
|
|
3201
|
-
|
|
3202
|
-
// tslint:disable:no-forward-ref no-use-before-declare
|
|
3203
|
-
var SKY_TOGGLE_SWITCH_CONTROL_VALUE_ACCESSOR = {
|
|
3204
|
-
provide: i4.NG_VALUE_ACCESSOR,
|
|
3205
|
-
useExisting: i0.forwardRef(function () { return SkyToggleSwitchComponent; }),
|
|
3206
|
-
multi: true,
|
|
3207
|
-
};
|
|
3208
|
-
var SKY_TOGGLE_SWITCH_VALIDATOR = {
|
|
3209
|
-
provide: i4.NG_VALIDATORS,
|
|
3210
|
-
useExisting: i0.forwardRef(function () { return SkyToggleSwitchComponent; }),
|
|
3211
|
-
multi: true,
|
|
3212
|
-
};
|
|
3213
|
-
// tslint:enable
|
|
3214
|
-
var uniqueId = 0;
|
|
3215
|
-
var SkyToggleSwitchComponent = /** @class */ (function () {
|
|
3216
|
-
function SkyToggleSwitchComponent(changeDetector) {
|
|
3217
|
-
this.changeDetector = changeDetector;
|
|
3218
|
-
/**
|
|
3219
|
-
* Indicates whether to disable the toggle switch.
|
|
3220
|
-
*/
|
|
3221
|
-
this.disabled = false;
|
|
3222
|
-
/**
|
|
3223
|
-
* Specifies a tab index for the toggle switch. If not defined, the index is set to the position
|
|
3224
|
-
* of the toggle switch on load.
|
|
3225
|
-
*/
|
|
3226
|
-
this.tabIndex = 0;
|
|
3227
|
-
/**
|
|
3228
|
-
* Fires when the checked state of a toggle switch changes.
|
|
3229
|
-
*/
|
|
3230
|
-
this.toggleChange = new i0.EventEmitter();
|
|
3231
|
-
this.enableIndicatorAnimation = false;
|
|
3232
|
-
this.isFirstChange = true;
|
|
3233
|
-
this.ngUnsubscribe = new rxjs.Subject();
|
|
3234
|
-
this.toggleSwitchId = uniqueId++;
|
|
3235
|
-
this._checked = false;
|
|
3236
|
-
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
3237
|
-
this.onTouched = function () { };
|
|
3238
|
-
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
3239
|
-
this.onChange = function () { };
|
|
3240
|
-
}
|
|
3241
|
-
Object.defineProperty(SkyToggleSwitchComponent.prototype, "checked", {
|
|
3242
|
-
get: function () {
|
|
3243
|
-
return this._checked || false;
|
|
3244
|
-
},
|
|
3245
|
-
/**
|
|
3246
|
-
* Indicates whether the toggle switch is selected.
|
|
3247
|
-
* @default false
|
|
3248
|
-
*/
|
|
3249
|
-
set: function (checked) {
|
|
3250
|
-
if (checked !== this.checked) {
|
|
3251
|
-
this._checked = checked;
|
|
3252
|
-
this.onChange(checked);
|
|
3253
|
-
// Do not mark the field as "dirty"
|
|
3254
|
-
// if the field has been initialized with a value.
|
|
3255
|
-
if (this.isFirstChange && this.control) {
|
|
3256
|
-
this.control.markAsPristine();
|
|
3257
|
-
this.isFirstChange = false;
|
|
3258
|
-
}
|
|
3259
|
-
}
|
|
3260
|
-
},
|
|
3261
|
-
enumerable: false,
|
|
3262
|
-
configurable: true
|
|
3263
|
-
});
|
|
3264
|
-
Object.defineProperty(SkyToggleSwitchComponent.prototype, "hasLabelComponent", {
|
|
3265
|
-
get: function () {
|
|
3266
|
-
return this.labelComponents.length > 0;
|
|
3267
|
-
},
|
|
3268
|
-
enumerable: false,
|
|
3269
|
-
configurable: true
|
|
3270
|
-
});
|
|
3271
|
-
Object.defineProperty(SkyToggleSwitchComponent.prototype, "labelElementId", {
|
|
3272
|
-
get: function () {
|
|
3273
|
-
return "sky-toggle-switch-label-" + this.toggleSwitchId;
|
|
3274
|
-
},
|
|
3275
|
-
enumerable: false,
|
|
3276
|
-
configurable: true
|
|
3277
|
-
});
|
|
3278
|
-
SkyToggleSwitchComponent.prototype.ngAfterContentInit = function () {
|
|
3279
|
-
var _this = this;
|
|
3280
|
-
this.labelComponents.changes
|
|
3281
|
-
.pipe(operators.takeUntil(this.ngUnsubscribe))
|
|
3282
|
-
.subscribe(function () {
|
|
3283
|
-
// Allow the template to reload any ARIA attributes that are relying on the
|
|
3284
|
-
// label component existing in the DOM.
|
|
3285
|
-
_this.changeDetector.markForCheck();
|
|
3286
|
-
});
|
|
3287
|
-
// Wait for the view to render before applying animation effects.
|
|
3288
|
-
// (Some browsers, such as Firefox, apply the animation too early.)
|
|
3289
|
-
setTimeout(function () {
|
|
3290
|
-
_this.enableIndicatorAnimation = true;
|
|
3291
|
-
});
|
|
3292
|
-
};
|
|
3293
|
-
SkyToggleSwitchComponent.prototype.ngOnDestroy = function () {
|
|
3294
|
-
this.ngUnsubscribe.next();
|
|
3295
|
-
this.ngUnsubscribe.complete();
|
|
3296
|
-
};
|
|
3297
|
-
SkyToggleSwitchComponent.prototype.writeValue = function (value) {
|
|
3298
|
-
this.checked = !!value;
|
|
3299
|
-
this.changeDetector.markForCheck();
|
|
3300
|
-
};
|
|
3301
|
-
SkyToggleSwitchComponent.prototype.validate = function (control) {
|
|
3302
|
-
if (!this.control) {
|
|
3303
|
-
this.control = control;
|
|
3304
|
-
}
|
|
3305
|
-
return;
|
|
3306
|
-
};
|
|
3307
|
-
SkyToggleSwitchComponent.prototype.registerOnChange = function (fn) {
|
|
3308
|
-
this.onChange = fn;
|
|
3309
|
-
};
|
|
3310
|
-
SkyToggleSwitchComponent.prototype.registerOnTouched = function (fn) {
|
|
3311
|
-
this.onTouched = fn;
|
|
3312
|
-
};
|
|
3313
|
-
SkyToggleSwitchComponent.prototype.setDisabledState = function (disabled) {
|
|
3314
|
-
this.disabled = disabled;
|
|
3315
|
-
this.changeDetector.markForCheck();
|
|
3316
|
-
};
|
|
3317
|
-
SkyToggleSwitchComponent.prototype.onButtonClick = function (event) {
|
|
3318
|
-
event.stopPropagation();
|
|
3319
|
-
this.toggleChecked();
|
|
3320
|
-
this.emitChangeEvent();
|
|
3321
|
-
};
|
|
3322
|
-
SkyToggleSwitchComponent.prototype.onButtonBlur = function () {
|
|
3323
|
-
this.onTouched();
|
|
3324
|
-
};
|
|
3325
|
-
SkyToggleSwitchComponent.prototype.emitChangeEvent = function () {
|
|
3326
|
-
this.onChange(this._checked);
|
|
3327
|
-
this.toggleChange.emit({
|
|
3328
|
-
checked: this._checked,
|
|
3329
|
-
});
|
|
3330
|
-
};
|
|
3331
|
-
SkyToggleSwitchComponent.prototype.toggleChecked = function () {
|
|
3332
|
-
this.checked = !this.checked;
|
|
3333
|
-
};
|
|
3334
|
-
return SkyToggleSwitchComponent;
|
|
3335
|
-
}());
|
|
3336
|
-
SkyToggleSwitchComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyToggleSwitchComponent, deps: [{ token: i0__namespace.ChangeDetectorRef }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
3337
|
-
SkyToggleSwitchComponent.ɵcmp = i0__namespace.ɵɵ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: [
|
|
3338
|
-
SKY_TOGGLE_SWITCH_CONTROL_VALUE_ACCESSOR,
|
|
3339
|
-
SKY_TOGGLE_SWITCH_VALIDATOR,
|
|
3340
|
-
], queries: [{ propertyName: "labelComponents", predicate: SkyToggleSwitchLabelComponent }], ngImport: i0__namespace, 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__namespace.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i1__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1__namespace.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }], changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush });
|
|
3341
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyToggleSwitchComponent, decorators: [{
|
|
3342
|
-
type: i0.Component,
|
|
3343
|
-
args: [{
|
|
3344
|
-
selector: 'sky-toggle-switch',
|
|
3345
|
-
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",
|
|
3346
|
-
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"],
|
|
3347
|
-
providers: [
|
|
3348
|
-
SKY_TOGGLE_SWITCH_CONTROL_VALUE_ACCESSOR,
|
|
3349
|
-
SKY_TOGGLE_SWITCH_VALIDATOR,
|
|
3350
|
-
],
|
|
3351
|
-
changeDetection: i0.ChangeDetectionStrategy.OnPush,
|
|
3352
|
-
}]
|
|
3353
|
-
}], ctorParameters: function () { return [{ type: i0__namespace.ChangeDetectorRef }]; }, propDecorators: { ariaLabel: [{
|
|
3354
|
-
type: i0.Input
|
|
3355
|
-
}], checked: [{
|
|
3356
|
-
type: i0.Input
|
|
3357
|
-
}], disabled: [{
|
|
3358
|
-
type: i0.Input
|
|
3359
|
-
}], tabIndex: [{
|
|
3360
|
-
type: i0.Input
|
|
3361
|
-
}], toggleChange: [{
|
|
3362
|
-
type: i0.Output
|
|
3363
|
-
}], labelComponents: [{
|
|
3364
|
-
type: i0.ContentChildren,
|
|
3365
|
-
args: [SkyToggleSwitchLabelComponent]
|
|
3366
|
-
}] } });
|
|
3367
|
-
|
|
3368
|
-
var SkyToggleSwitchModule = /** @class */ (function () {
|
|
3369
|
-
function SkyToggleSwitchModule() {
|
|
3370
|
-
}
|
|
3371
|
-
return SkyToggleSwitchModule;
|
|
3372
|
-
}());
|
|
3373
|
-
SkyToggleSwitchModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyToggleSwitchModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
|
|
3374
|
-
SkyToggleSwitchModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyToggleSwitchModule, declarations: [SkyToggleSwitchLabelComponent, SkyToggleSwitchComponent], imports: [i1.CommonModule, i4.FormsModule], exports: [SkyToggleSwitchLabelComponent, SkyToggleSwitchComponent] });
|
|
3375
|
-
SkyToggleSwitchModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyToggleSwitchModule, imports: [[i1.CommonModule, i4.FormsModule]] });
|
|
3376
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyToggleSwitchModule, decorators: [{
|
|
3377
|
-
type: i0.NgModule,
|
|
3378
|
-
args: [{
|
|
3379
|
-
declarations: [SkyToggleSwitchLabelComponent, SkyToggleSwitchComponent],
|
|
3380
|
-
imports: [i1.CommonModule, i4.FormsModule],
|
|
3381
|
-
exports: [SkyToggleSwitchLabelComponent, SkyToggleSwitchComponent],
|
|
3382
|
-
}]
|
|
3383
|
-
}] });
|
|
3384
|
-
|
|
3385
|
-
/**
|
|
3386
|
-
* Generated bundle index. Do not edit.
|
|
3387
|
-
*/
|
|
3388
|
-
|
|
3389
|
-
exports.SkyCharacterCounterModule = SkyCharacterCounterModule;
|
|
3390
|
-
exports.SkyCheckboxChange = SkyCheckboxChange;
|
|
3391
|
-
exports.SkyCheckboxModule = SkyCheckboxModule;
|
|
3392
|
-
exports.SkyFileAttachmentsModule = SkyFileAttachmentsModule;
|
|
3393
|
-
exports.SkyFileSizePipe = SkyFileSizePipe;
|
|
3394
|
-
exports.SkyInputBoxHostService = SkyInputBoxHostService;
|
|
3395
|
-
exports.SkyInputBoxModule = SkyInputBoxModule;
|
|
3396
|
-
exports.SkyRadioModule = SkyRadioModule;
|
|
3397
|
-
exports.SkySelectionBoxModule = SkySelectionBoxModule;
|
|
3398
|
-
exports.SkyToggleSwitchModule = SkyToggleSwitchModule;
|
|
3399
|
-
exports["λ1"] = SkyCharacterCounterIndicatorComponent;
|
|
3400
|
-
exports["λ10"] = SkyInputBoxComponent;
|
|
3401
|
-
exports["λ11"] = SkyRadioGroupComponent;
|
|
3402
|
-
exports["λ12"] = SkyRadioLabelComponent;
|
|
3403
|
-
exports["λ13"] = SkyRadioComponent;
|
|
3404
|
-
exports["λ14"] = SkySelectionBoxDescriptionComponent;
|
|
3405
|
-
exports["λ15"] = SkySelectionBoxGridComponent;
|
|
3406
|
-
exports["λ16"] = SkySelectionBoxHeaderComponent;
|
|
3407
|
-
exports["λ17"] = SkySelectionBoxComponent;
|
|
3408
|
-
exports["λ18"] = SkyToggleSwitchLabelComponent;
|
|
3409
|
-
exports["λ19"] = SkyToggleSwitchComponent;
|
|
3410
|
-
exports["λ2"] = SkyCharacterCounterInputDirective;
|
|
3411
|
-
exports["λ3"] = SkyCheckboxComponent;
|
|
3412
|
-
exports["λ4"] = SkyCheckboxLabelComponent;
|
|
3413
|
-
exports["λ5"] = SkyCheckboxRequiredValidatorDirective;
|
|
3414
|
-
exports["λ6"] = SkyFileAttachmentLabelComponent;
|
|
3415
|
-
exports["λ7"] = SkyFileAttachmentComponent;
|
|
3416
|
-
exports["λ8"] = SkyFileDropComponent;
|
|
3417
|
-
exports["λ9"] = SkyFileItemComponent;
|
|
3418
|
-
|
|
3419
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
3420
|
-
|
|
3421
|
-
}));
|
|
3422
|
-
//# sourceMappingURL=skyux-forms.umd.js.map
|