@ifsworld/granite-components 3.4.0 → 3.5.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/bundles/ifsworld-granite-components.umd.js +102 -0
- package/bundles/ifsworld-granite-components.umd.js.map +1 -1
- package/bundles/ifsworld-granite-components.umd.min.js +3 -3
- package/bundles/ifsworld-granite-components.umd.min.js.map +1 -1
- package/esm2015/index.js +2 -0
- package/esm2015/index.js.map +1 -1
- package/esm2015/index.metadata.json +1 -1
- package/esm2015/lib/checkbox/checkbox.component.js +89 -0
- package/esm2015/lib/checkbox/checkbox.component.js.map +1 -0
- package/esm2015/lib/checkbox/checkbox.component.metadata.json +1 -0
- package/esm2015/lib/checkbox/checkbox.module.js +11 -0
- package/esm2015/lib/checkbox/checkbox.module.js.map +1 -0
- package/esm2015/lib/checkbox/checkbox.module.metadata.json +1 -0
- package/fesm2015/ifsworld-granite-components.js +96 -1
- package/fesm2015/ifsworld-granite-components.js.map +1 -1
- package/ifsworld-granite-components.metadata.json +1 -1
- package/index.d.ts +2 -0
- package/lib/checkbox/checkbox.component.d.ts +26 -0
- package/lib/checkbox/checkbox.module.d.ts +2 -0
- package/package.json +1 -1
package/esm2015/index.js
CHANGED
|
@@ -25,6 +25,8 @@ export * from './lib/toggle-switch/toggle-switch.module';
|
|
|
25
25
|
export * from './lib/toggle-switch/toggle-switch.component';
|
|
26
26
|
export * from './lib/radio-button/radio-button.module';
|
|
27
27
|
export * from './lib/radio-button/radio-button.component';
|
|
28
|
+
export * from './lib/checkbox/checkbox.module';
|
|
29
|
+
export * from './lib/checkbox/checkbox.component';
|
|
28
30
|
export * from './lib/button/button.module';
|
|
29
31
|
export * from './lib/button/button.component';
|
|
30
32
|
export * from './lib/table/table.module';
|
package/esm2015/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../libs/granite-components/src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,cAAc,wCAAwC,CAAC;AACvD,cAAc,2CAA2C,CAAC;AAC1D,cAAc,gDAAgD,CAAC;AAE/D,cAAc,wBAAwB,CAAC;AACvC,cAAc,2BAA2B,CAAC;AAE1C,cAAc,0BAA0B,CAAC;AACzC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,mCAAmC,CAAC;AAElD,cAAc,wBAAwB,CAAC;AACvC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,oCAAoC,CAAC;AACnD,cAAc,kCAAkC,CAAC;AACjD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,uCAAuC,CAAC;AACtD,cAAc,iCAAiC,CAAC;AAChD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,uCAAuC,CAAC;AACtD,cAAc,uCAAuC,CAAC;AAEtD,cAAc,wBAAwB,CAAC;AACvC,cAAc,2BAA2B,CAAC;AAE1C,cAAc,0CAA0C,CAAC;AACzD,cAAc,6CAA6C,CAAC;AAE5D,cAAc,wCAAwC,CAAC;AACvD,cAAc,2CAA2C,CAAC;AAE1D,cAAc,4BAA4B,CAAC;AAC3C,cAAc,+BAA+B,CAAC;AAE9C,cAAc,0BAA0B,CAAC;AACzC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,2CAA2C,CAAC;AAE1D,cAAc,sCAAsC,CAAC;AACrD,cAAc,yCAAyC,CAAC;AAExD,YAAY;AACZ,cAAc,+BAA+B,CAAC;AAC9C,cAAc,wBAAwB,CAAC;AACvC,cAAc,kDAAkD,CAAC;AACjE,cAAc,oDAAoD,CAAC;AACnE,cAAc,iDAAiD,CAAC;AAChE,cAAc,mDAAmD,CAAC;AAClE,cAAc,sCAAsC,CAAC","sourcesContent":["/*\n * Public API Surface of ui\n */\n\nexport * from './lib/arrange-grid/arrange-grid.module';\nexport * from './lib/arrange-grid/arrange-grid.component';\nexport * from './lib/arrange-grid/arrange-grid-item.component';\n\nexport * from './lib/grid/grid.module';\nexport * from './lib/grid/grid.component';\n\nexport * from './lib/badge/badge.module';\nexport * from './lib/badge/badge.component';\nexport * from './lib/badge/testing/badge.harness';\n\nexport * from './lib/menu/menu.module';\nexport * from './lib/menu/menu.component';\nexport * from './lib/menu/menu-desktop-animations';\nexport * from './lib/menu/menu-touch-animations';\nexport * from './lib/menu/menu-item.component';\nexport * from './lib/menu/menu-trigger-for.directive';\nexport * from './lib/menu/testing/menu.harness';\nexport * from './lib/menu/divider.directive';\nexport * from './lib/menu/menu-touch-close.component';\nexport * from './lib/menu/menu-touch-title.component';\n\nexport * from './lib/icon/icon.module';\nexport * from './lib/icon/icon.component';\n\nexport * from './lib/toggle-switch/toggle-switch.module';\nexport * from './lib/toggle-switch/toggle-switch.component';\n\nexport * from './lib/radio-button/radio-button.module';\nexport * from './lib/radio-button/radio-button.component';\n\nexport * from './lib/button/button.module';\nexport * from './lib/button/button.component';\n\nexport * from './lib/table/table.module';\nexport * from './lib/table/table.component';\nexport * from './lib/table/column/table-column.directive';\n\nexport * from './lib/input-field/input-field.module';\nexport * from './lib/input-field/input-field.component';\n\n// Temporary\nexport * from './lib/core/client-environment';\nexport * from './lib/core/core.module';\nexport * from './lib/core/devices/client-output-touch.directive';\nexport * from './lib/core/devices/client-output-desktop.directive';\nexport * from './lib/core/devices/client-input-touch.directive';\nexport * from './lib/core/devices/client-input-desktop.directive';\nexport * from './lib/core/common-behaviors/disabled';\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../libs/granite-components/src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,cAAc,wCAAwC,CAAC;AACvD,cAAc,2CAA2C,CAAC;AAC1D,cAAc,gDAAgD,CAAC;AAE/D,cAAc,wBAAwB,CAAC;AACvC,cAAc,2BAA2B,CAAC;AAE1C,cAAc,0BAA0B,CAAC;AACzC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,mCAAmC,CAAC;AAElD,cAAc,wBAAwB,CAAC;AACvC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,oCAAoC,CAAC;AACnD,cAAc,kCAAkC,CAAC;AACjD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,uCAAuC,CAAC;AACtD,cAAc,iCAAiC,CAAC;AAChD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,uCAAuC,CAAC;AACtD,cAAc,uCAAuC,CAAC;AAEtD,cAAc,wBAAwB,CAAC;AACvC,cAAc,2BAA2B,CAAC;AAE1C,cAAc,0CAA0C,CAAC;AACzD,cAAc,6CAA6C,CAAC;AAE5D,cAAc,wCAAwC,CAAC;AACvD,cAAc,2CAA2C,CAAC;AAE1D,cAAc,gCAAgC,CAAC;AAC/C,cAAc,mCAAmC,CAAC;AAElD,cAAc,4BAA4B,CAAC;AAC3C,cAAc,+BAA+B,CAAC;AAE9C,cAAc,0BAA0B,CAAC;AACzC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,2CAA2C,CAAC;AAE1D,cAAc,sCAAsC,CAAC;AACrD,cAAc,yCAAyC,CAAC;AAExD,YAAY;AACZ,cAAc,+BAA+B,CAAC;AAC9C,cAAc,wBAAwB,CAAC;AACvC,cAAc,kDAAkD,CAAC;AACjE,cAAc,oDAAoD,CAAC;AACnE,cAAc,iDAAiD,CAAC;AAChE,cAAc,mDAAmD,CAAC;AAClE,cAAc,sCAAsC,CAAC","sourcesContent":["/*\n * Public API Surface of ui\n */\n\nexport * from './lib/arrange-grid/arrange-grid.module';\nexport * from './lib/arrange-grid/arrange-grid.component';\nexport * from './lib/arrange-grid/arrange-grid-item.component';\n\nexport * from './lib/grid/grid.module';\nexport * from './lib/grid/grid.component';\n\nexport * from './lib/badge/badge.module';\nexport * from './lib/badge/badge.component';\nexport * from './lib/badge/testing/badge.harness';\n\nexport * from './lib/menu/menu.module';\nexport * from './lib/menu/menu.component';\nexport * from './lib/menu/menu-desktop-animations';\nexport * from './lib/menu/menu-touch-animations';\nexport * from './lib/menu/menu-item.component';\nexport * from './lib/menu/menu-trigger-for.directive';\nexport * from './lib/menu/testing/menu.harness';\nexport * from './lib/menu/divider.directive';\nexport * from './lib/menu/menu-touch-close.component';\nexport * from './lib/menu/menu-touch-title.component';\n\nexport * from './lib/icon/icon.module';\nexport * from './lib/icon/icon.component';\n\nexport * from './lib/toggle-switch/toggle-switch.module';\nexport * from './lib/toggle-switch/toggle-switch.component';\n\nexport * from './lib/radio-button/radio-button.module';\nexport * from './lib/radio-button/radio-button.component';\n\nexport * from './lib/checkbox/checkbox.module';\nexport * from './lib/checkbox/checkbox.component';\n\nexport * from './lib/button/button.module';\nexport * from './lib/button/button.component';\n\nexport * from './lib/table/table.module';\nexport * from './lib/table/table.component';\nexport * from './lib/table/column/table-column.directive';\n\nexport * from './lib/input-field/input-field.module';\nexport * from './lib/input-field/input-field.component';\n\n// Temporary\nexport * from './lib/core/client-environment';\nexport * from './lib/core/core.module';\nexport * from './lib/core/devices/client-output-touch.directive';\nexport * from './lib/core/devices/client-output-desktop.directive';\nexport * from './lib/core/devices/client-input-touch.directive';\nexport * from './lib/core/devices/client-input-desktop.directive';\nexport * from './lib/core/common-behaviors/disabled';\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
[{"__symbolic":"module","version":4,"metadata":{},"exports":[{"from":"./lib/arrange-grid/arrange-grid.module"},{"from":"./lib/arrange-grid/arrange-grid.component"},{"from":"./lib/arrange-grid/arrange-grid-item.component"},{"from":"./lib/grid/grid.module"},{"from":"./lib/grid/grid.component"},{"from":"./lib/badge/badge.module"},{"from":"./lib/badge/badge.component"},{"from":"./lib/badge/testing/badge.harness"},{"from":"./lib/menu/menu.module"},{"from":"./lib/menu/menu.component"},{"from":"./lib/menu/menu-desktop-animations"},{"from":"./lib/menu/menu-touch-animations"},{"from":"./lib/menu/menu-item.component"},{"from":"./lib/menu/menu-trigger-for.directive"},{"from":"./lib/menu/testing/menu.harness"},{"from":"./lib/menu/divider.directive"},{"from":"./lib/menu/menu-touch-close.component"},{"from":"./lib/menu/menu-touch-title.component"},{"from":"./lib/icon/icon.module"},{"from":"./lib/icon/icon.component"},{"from":"./lib/toggle-switch/toggle-switch.module"},{"from":"./lib/toggle-switch/toggle-switch.component"},{"from":"./lib/radio-button/radio-button.module"},{"from":"./lib/radio-button/radio-button.component"},{"from":"./lib/button/button.module"},{"from":"./lib/button/button.component"},{"from":"./lib/table/table.module"},{"from":"./lib/table/table.component"},{"from":"./lib/table/column/table-column.directive"},{"from":"./lib/input-field/input-field.module"},{"from":"./lib/input-field/input-field.component"},{"from":"./lib/core/client-environment"},{"from":"./lib/core/core.module"},{"from":"./lib/core/devices/client-output-touch.directive"},{"from":"./lib/core/devices/client-output-desktop.directive"},{"from":"./lib/core/devices/client-input-touch.directive"},{"from":"./lib/core/devices/client-input-desktop.directive"},{"from":"./lib/core/common-behaviors/disabled"}]}]
|
|
1
|
+
[{"__symbolic":"module","version":4,"metadata":{},"exports":[{"from":"./lib/arrange-grid/arrange-grid.module"},{"from":"./lib/arrange-grid/arrange-grid.component"},{"from":"./lib/arrange-grid/arrange-grid-item.component"},{"from":"./lib/grid/grid.module"},{"from":"./lib/grid/grid.component"},{"from":"./lib/badge/badge.module"},{"from":"./lib/badge/badge.component"},{"from":"./lib/badge/testing/badge.harness"},{"from":"./lib/menu/menu.module"},{"from":"./lib/menu/menu.component"},{"from":"./lib/menu/menu-desktop-animations"},{"from":"./lib/menu/menu-touch-animations"},{"from":"./lib/menu/menu-item.component"},{"from":"./lib/menu/menu-trigger-for.directive"},{"from":"./lib/menu/testing/menu.harness"},{"from":"./lib/menu/divider.directive"},{"from":"./lib/menu/menu-touch-close.component"},{"from":"./lib/menu/menu-touch-title.component"},{"from":"./lib/icon/icon.module"},{"from":"./lib/icon/icon.component"},{"from":"./lib/toggle-switch/toggle-switch.module"},{"from":"./lib/toggle-switch/toggle-switch.component"},{"from":"./lib/radio-button/radio-button.module"},{"from":"./lib/radio-button/radio-button.component"},{"from":"./lib/checkbox/checkbox.module"},{"from":"./lib/checkbox/checkbox.component"},{"from":"./lib/button/button.module"},{"from":"./lib/button/button.component"},{"from":"./lib/table/table.module"},{"from":"./lib/table/table.component"},{"from":"./lib/table/column/table-column.directive"},{"from":"./lib/input-field/input-field.module"},{"from":"./lib/input-field/input-field.component"},{"from":"./lib/core/client-environment"},{"from":"./lib/core/core.module"},{"from":"./lib/core/devices/client-output-touch.directive"},{"from":"./lib/core/devices/client-output-desktop.directive"},{"from":"./lib/core/devices/client-input-touch.directive"},{"from":"./lib/core/devices/client-input-desktop.directive"},{"from":"./lib/core/common-behaviors/disabled"}]}]
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { FocusMonitor } from '@angular/cdk/a11y';
|
|
2
|
+
import { coerceBooleanProperty } from '@angular/cdk/coercion';
|
|
3
|
+
import { ChangeDetectionStrategy, Component, Input, Output, EventEmitter, ElementRef, ViewChild, } from '@angular/core';
|
|
4
|
+
export class GraniteCheckboxComponent {
|
|
5
|
+
constructor(_focusMonitor) {
|
|
6
|
+
this._focusMonitor = _focusMonitor;
|
|
7
|
+
this.id = null;
|
|
8
|
+
this.checked = false;
|
|
9
|
+
this.disabled = false;
|
|
10
|
+
this.readonly = false;
|
|
11
|
+
this.labelPosition = 'after';
|
|
12
|
+
this.ariaLabel = null;
|
|
13
|
+
this.ariaLabelledby = null;
|
|
14
|
+
this.valueChange = new EventEmitter();
|
|
15
|
+
this.checkboxChange = new EventEmitter();
|
|
16
|
+
this.checkboxBlur = new EventEmitter();
|
|
17
|
+
this._positionBefore = false;
|
|
18
|
+
this._checkboxDisabled = false;
|
|
19
|
+
}
|
|
20
|
+
ngOnChanges(changes) {
|
|
21
|
+
if (changes.checked) {
|
|
22
|
+
this.checked = coerceBooleanProperty(changes.checked.currentValue);
|
|
23
|
+
}
|
|
24
|
+
if (changes.disabled) {
|
|
25
|
+
this.disabled = coerceBooleanProperty(changes.disabled.currentValue);
|
|
26
|
+
}
|
|
27
|
+
if (changes.readonly) {
|
|
28
|
+
this.readonly = coerceBooleanProperty(changes.readonly.currentValue);
|
|
29
|
+
}
|
|
30
|
+
if (changes.labelPosition != null) {
|
|
31
|
+
this._positionBefore =
|
|
32
|
+
changes.labelPosition.currentValue != null &&
|
|
33
|
+
changes.labelPosition.currentValue === 'before';
|
|
34
|
+
}
|
|
35
|
+
if ((changes.disabled || changes.readonly) &&
|
|
36
|
+
(this.disabled || this.readonly)) {
|
|
37
|
+
this._checkboxDisabled = true;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
focus(origin = 'program', options) {
|
|
41
|
+
this._focusMonitor.focusVia(this._getInputElement(), origin, options);
|
|
42
|
+
}
|
|
43
|
+
_onBlur() {
|
|
44
|
+
this.checkboxBlur.emit();
|
|
45
|
+
}
|
|
46
|
+
_checkboxChange() {
|
|
47
|
+
this.checked = this._getInputElement().checked;
|
|
48
|
+
this.valueChange.emit(this.checked);
|
|
49
|
+
}
|
|
50
|
+
_checkboxClick() {
|
|
51
|
+
this.checkboxChange.emit();
|
|
52
|
+
}
|
|
53
|
+
_getInputElement() {
|
|
54
|
+
return this._inputElement.nativeElement;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
GraniteCheckboxComponent.decorators = [
|
|
58
|
+
{ type: Component, args: [{
|
|
59
|
+
selector: 'granite-checkbox',
|
|
60
|
+
exportAs: 'graniteCheckbox',
|
|
61
|
+
host: {
|
|
62
|
+
class: 'granite-checkbox',
|
|
63
|
+
'[class.granite-checkbox-checked]': 'checked',
|
|
64
|
+
'[class.granite-checkbox-disabled]': 'disabled',
|
|
65
|
+
'[class.granite-checkbox-readonly]': 'readonly',
|
|
66
|
+
'[class.granite-checkbox-label-before]': '_positionBefore',
|
|
67
|
+
},
|
|
68
|
+
template: "<label [attr.for]=\"id\" class=\"granite-checkbox-label\">\n <div class=\"granite-checkbox-box\">\n <input\n #input\n [id]=\"id\"\n class=\"granite-checkbox-input cdk-visually-hidden\"\n role=\"checkbox\"\n type=\"checkbox\"\n [attr.aria-checked]=\"checked.toString()\"\n [attr.aria-label]=\"ariaLabel\"\n [attr.aria-labelledby]=\"ariaLabelledby\"\n [checked]=\"checked\"\n [disabled]=\"_checkboxDisabled\"\n [readonly]=\"readonly\"\n (click)=\"_checkboxClick()\"\n (change)=\"_checkboxChange()\"\n (blur)=\"_onBlur()\"\n />\n <div class=\"granite-checkbox-check\"></div>\n </div>\n <span class=\"granite-checkbox-text\"><ng-content></ng-content></span>\n</label>\n",
|
|
69
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
70
|
+
styles: [".cdk-visually-hidden{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;white-space:nowrap;outline:0;-webkit-appearance:none;-moz-appearance:none}:host{box-sizing:border-box}:host *,:host :after,:host :before{box-sizing:inherit;cursor:pointer}:host(.granite-checkbox){color:var(--granite-color-text)}:host(.granite-checkbox):not(.granite-checkbox-checked):not(.granite-checkbox-readonly):not(.granite-checkbox-disabled) .granite-checkbox-label:hover .granite-checkbox-box{border-color:var(--granite-color-background-active)}:host(.granite-checkbox-checked):not(.granite-checkbox-readonly):not(.granite-checkbox-disabled) .granite-checkbox-label:hover .granite-checkbox-box{background-color:var(--granite-color-background-active-hover);border-color:var(--granite-color-background-active-hover)}:host(.granite-checkbox-checked) .granite-checkbox-box{border-color:var(--granite-color-background-active);background-color:var(--granite-color-background-active)}:host(.granite-checkbox-checked) .granite-checkbox-box:focus-within{border-color:var(--granite-color-focus)}:host(.granite-checkbox-checked) .granite-checkbox-check{display:flex}:host(.granite-checkbox-checked):not(.granite-checkbox-readonly):not(.granite-checkbox-disabled) .granite-checkbox-box{-webkit-animation:fadeInAnimation .2s;animation:fadeInAnimation .2s;-webkit-animation-iteration-count:1;animation-iteration-count:1}:host(:not(.granite-checkbox-checked)) .granite-checkbox-box{-webkit-animation:fadeOutAnimation .2s;animation:fadeOutAnimation .2s;-webkit-animation-iteration-count:1;animation-iteration-count:1}:host(.granite-checkbox-readonly.granite-checkbox-checked) .granite-checkbox-box{background-color:var(--granite-color-text);border-color:var(--granite-color-text)}:host(.granite-checkbox-readonly.granite-checkbox-checked) .granite-checkbox-box .granite-checkbox-check{border-color:var(--granite-color-background)}:host(.granite-checkbox-disabled) .granite-checkbox-box{opacity:.3;background-color:var(--granite-color-border-soft)}:host(.granite-checkbox-disabled) .granite-checkbox-label{opacity:.6}:host(.granite-checkbox-disabled) *,:host(.granite-checkbox-readonly) *{cursor:default}:host(.granite-checkbox-label-before) .granite-checkbox-label{flex-direction:row-reverse}:host(.granite-checkbox-label-before) .granite-checkbox-text{-webkit-padding-start:0;padding-inline-start:0;-webkit-padding-end:var(--granite-spacing-s);padding-inline-end:var(--granite-spacing-s)}.granite-checkbox-label{display:flex;align-items:center;width:-webkit-max-content;width:-moz-max-content;width:max-content}.granite-checkbox-box{width:var(--granite-spacing-m);height:var(--granite-spacing-m);border:solid var(--granite-color-background-inactive);border-width:calc(var(--granite-spacing-xs) / 4);border-radius:var(--granite-spacing-xs);display:flex;justify-content:center;position:relative}.granite-checkbox-box:focus-within{border:calc(var(--granite-spacing-xs) / 4) solid var(--granite-color-focus)}.granite-checkbox-check{position:relative;display:none;width:calc(var(--granite-spacing-s) + (var(--granite-spacing-xs) / 4));height:calc(var(--granite-spacing-xs) + (var(--granite-spacing-xs) / 4));background-color:transparent;border:solid var(--granite-color-text-static-light);transform:rotate(-45deg);margin-top:var(--granite-spacing-xs);border-left-width:calc(var(--granite-spacing-xs) / 2);border-bottom-width:calc(var(--granite-spacing-xs) / 2);border-right-width:0;border-top-width:0}.granite-checkbox-text{-webkit-padding-start:var(--granite-spacing-s);padding-inline-start:var(--granite-spacing-s)}.granite-checkbox-text:empty{display:none}@-webkit-keyframes fadeInAnimation{0%{opacity:0}to{opacity:1}}@keyframes fadeInAnimation{0%{opacity:0}to{opacity:1}}@-webkit-keyframes fadeOutAnimation{0%{opacity:1}to{opacity:0}}@keyframes fadeOutAnimation{0%{opacity:1}to{opacity:0}}"]
|
|
71
|
+
},] }
|
|
72
|
+
];
|
|
73
|
+
GraniteCheckboxComponent.ctorParameters = () => [
|
|
74
|
+
{ type: FocusMonitor }
|
|
75
|
+
];
|
|
76
|
+
GraniteCheckboxComponent.propDecorators = {
|
|
77
|
+
id: [{ type: Input }],
|
|
78
|
+
checked: [{ type: Input }],
|
|
79
|
+
disabled: [{ type: Input }],
|
|
80
|
+
readonly: [{ type: Input }],
|
|
81
|
+
labelPosition: [{ type: Input }],
|
|
82
|
+
ariaLabel: [{ type: Input, args: ['aria-label',] }],
|
|
83
|
+
ariaLabelledby: [{ type: Input, args: ['aria-labelledby',] }],
|
|
84
|
+
valueChange: [{ type: Output }],
|
|
85
|
+
checkboxChange: [{ type: Output }],
|
|
86
|
+
checkboxBlur: [{ type: Output }],
|
|
87
|
+
_inputElement: [{ type: ViewChild, args: ['input',] }]
|
|
88
|
+
};
|
|
89
|
+
//# sourceMappingURL=checkbox.component.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"checkbox.component.js","sourceRoot":"","sources":["../../../../../../libs/granite-components/src/lib/checkbox/checkbox.component.ts"],"names":[],"mappings":"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","sourcesContent":["import { FocusMonitor, FocusOrigin } from '@angular/cdk/a11y';\nimport { coerceBooleanProperty } from '@angular/cdk/coercion';\nimport {\n ChangeDetectionStrategy,\n Component,\n Input,\n Output,\n OnChanges,\n SimpleChanges,\n EventEmitter,\n ElementRef,\n ViewChild,\n} from '@angular/core';\nimport { Position } from '../core/types';\n\n@Component({\n selector: 'granite-checkbox',\n exportAs: 'graniteCheckbox',\n host: {\n class: 'granite-checkbox',\n '[class.granite-checkbox-checked]': 'checked',\n '[class.granite-checkbox-disabled]': 'disabled',\n '[class.granite-checkbox-readonly]': 'readonly',\n '[class.granite-checkbox-label-before]': '_positionBefore',\n },\n templateUrl: './checkbox.component.html',\n styleUrls: ['./checkbox.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class GraniteCheckboxComponent implements OnChanges {\n @Input()\n id: string | null = null;\n\n @Input()\n checked: boolean = false;\n\n @Input()\n disabled: boolean = false;\n\n @Input()\n readonly: boolean = false;\n\n @Input()\n labelPosition: Position = 'after';\n\n @Input('aria-label')\n ariaLabel: string | null = null;\n\n @Input('aria-labelledby')\n ariaLabelledby: string | null = null;\n\n @Output()\n readonly valueChange: EventEmitter<boolean> = new EventEmitter<boolean>();\n\n @Output()\n readonly checkboxChange: EventEmitter<void> = new EventEmitter<void>();\n\n @Output()\n readonly checkboxBlur: EventEmitter<void> = new EventEmitter<void>();\n\n @ViewChild('input')\n private _inputElement: ElementRef<HTMLInputElement>;\n\n _positionBefore: boolean = false;\n _checkboxDisabled: boolean = false;\n\n constructor(private _focusMonitor: FocusMonitor) {}\n\n ngOnChanges(changes: SimpleChanges): void {\n if (changes.checked) {\n this.checked = coerceBooleanProperty(changes.checked.currentValue);\n }\n\n if (changes.disabled) {\n this.disabled = coerceBooleanProperty(changes.disabled.currentValue);\n }\n\n if (changes.readonly) {\n this.readonly = coerceBooleanProperty(changes.readonly.currentValue);\n }\n\n if (changes.labelPosition != null) {\n this._positionBefore =\n changes.labelPosition.currentValue != null &&\n changes.labelPosition.currentValue === 'before';\n }\n\n if (\n (changes.disabled || changes.readonly) &&\n (this.disabled || this.readonly)\n ) {\n this._checkboxDisabled = true;\n }\n }\n\n focus(origin: FocusOrigin = 'program', options?: FocusOptions): void {\n this._focusMonitor.focusVia(this._getInputElement(), origin, options);\n }\n\n _onBlur(): void {\n this.checkboxBlur.emit();\n }\n\n _checkboxChange(): void {\n this.checked = this._getInputElement().checked;\n this.valueChange.emit(this.checked);\n }\n\n _checkboxClick(): void {\n this.checkboxChange.emit();\n }\n\n private _getInputElement(): HTMLInputElement {\n return this._inputElement.nativeElement;\n }\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
[{"__symbolic":"module","version":4,"metadata":{"GraniteCheckboxComponent":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":15,"character":1},"arguments":[{"selector":"granite-checkbox","exportAs":"graniteCheckbox","host":{"class":"granite-checkbox","[class.granite-checkbox-checked]":"checked","[class.granite-checkbox-disabled]":"disabled","[class.granite-checkbox-readonly]":"readonly","[class.granite-checkbox-label-before]":"_positionBefore","$quoted$":["[class.granite-checkbox-checked]","[class.granite-checkbox-disabled]","[class.granite-checkbox-readonly]","[class.granite-checkbox-label-before]"]},"changeDetection":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@angular/core","name":"ChangeDetectionStrategy","line":27,"character":19},"member":"OnPush"},"template":"<label [attr.for]=\"id\" class=\"granite-checkbox-label\">\n <div class=\"granite-checkbox-box\">\n <input\n #input\n [id]=\"id\"\n class=\"granite-checkbox-input cdk-visually-hidden\"\n role=\"checkbox\"\n type=\"checkbox\"\n [attr.aria-checked]=\"checked.toString()\"\n [attr.aria-label]=\"ariaLabel\"\n [attr.aria-labelledby]=\"ariaLabelledby\"\n [checked]=\"checked\"\n [disabled]=\"_checkboxDisabled\"\n [readonly]=\"readonly\"\n (click)=\"_checkboxClick()\"\n (change)=\"_checkboxChange()\"\n (blur)=\"_onBlur()\"\n />\n <div class=\"granite-checkbox-check\"></div>\n </div>\n <span class=\"granite-checkbox-text\"><ng-content></ng-content></span>\n</label>\n","styles":[".cdk-visually-hidden{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;white-space:nowrap;outline:0;-webkit-appearance:none;-moz-appearance:none}:host{box-sizing:border-box}:host *,:host :after,:host :before{box-sizing:inherit;cursor:pointer}:host(.granite-checkbox){color:var(--granite-color-text)}:host(.granite-checkbox):not(.granite-checkbox-checked):not(.granite-checkbox-readonly):not(.granite-checkbox-disabled) .granite-checkbox-label:hover .granite-checkbox-box{border-color:var(--granite-color-background-active)}:host(.granite-checkbox-checked):not(.granite-checkbox-readonly):not(.granite-checkbox-disabled) .granite-checkbox-label:hover .granite-checkbox-box{background-color:var(--granite-color-background-active-hover);border-color:var(--granite-color-background-active-hover)}:host(.granite-checkbox-checked) .granite-checkbox-box{border-color:var(--granite-color-background-active);background-color:var(--granite-color-background-active)}:host(.granite-checkbox-checked) .granite-checkbox-box:focus-within{border-color:var(--granite-color-focus)}:host(.granite-checkbox-checked) .granite-checkbox-check{display:flex}:host(.granite-checkbox-checked):not(.granite-checkbox-readonly):not(.granite-checkbox-disabled) .granite-checkbox-box{-webkit-animation:fadeInAnimation .2s;animation:fadeInAnimation .2s;-webkit-animation-iteration-count:1;animation-iteration-count:1}:host(:not(.granite-checkbox-checked)) .granite-checkbox-box{-webkit-animation:fadeOutAnimation .2s;animation:fadeOutAnimation .2s;-webkit-animation-iteration-count:1;animation-iteration-count:1}:host(.granite-checkbox-readonly.granite-checkbox-checked) .granite-checkbox-box{background-color:var(--granite-color-text);border-color:var(--granite-color-text)}:host(.granite-checkbox-readonly.granite-checkbox-checked) .granite-checkbox-box .granite-checkbox-check{border-color:var(--granite-color-background)}:host(.granite-checkbox-disabled) .granite-checkbox-box{opacity:.3;background-color:var(--granite-color-border-soft)}:host(.granite-checkbox-disabled) .granite-checkbox-label{opacity:.6}:host(.granite-checkbox-disabled) *,:host(.granite-checkbox-readonly) *{cursor:default}:host(.granite-checkbox-label-before) .granite-checkbox-label{flex-direction:row-reverse}:host(.granite-checkbox-label-before) .granite-checkbox-text{-webkit-padding-start:0;padding-inline-start:0;-webkit-padding-end:var(--granite-spacing-s);padding-inline-end:var(--granite-spacing-s)}.granite-checkbox-label{display:flex;align-items:center;width:-webkit-max-content;width:-moz-max-content;width:max-content}.granite-checkbox-box{width:var(--granite-spacing-m);height:var(--granite-spacing-m);border:solid var(--granite-color-background-inactive);border-width:calc(var(--granite-spacing-xs) / 4);border-radius:var(--granite-spacing-xs);display:flex;justify-content:center;position:relative}.granite-checkbox-box:focus-within{border:calc(var(--granite-spacing-xs) / 4) solid var(--granite-color-focus)}.granite-checkbox-check{position:relative;display:none;width:calc(var(--granite-spacing-s) + (var(--granite-spacing-xs) / 4));height:calc(var(--granite-spacing-xs) + (var(--granite-spacing-xs) / 4));background-color:transparent;border:solid var(--granite-color-text-static-light);transform:rotate(-45deg);margin-top:var(--granite-spacing-xs);border-left-width:calc(var(--granite-spacing-xs) / 2);border-bottom-width:calc(var(--granite-spacing-xs) / 2);border-right-width:0;border-top-width:0}.granite-checkbox-text{-webkit-padding-start:var(--granite-spacing-s);padding-inline-start:var(--granite-spacing-s)}.granite-checkbox-text:empty{display:none}@-webkit-keyframes fadeInAnimation{0%{opacity:0}to{opacity:1}}@keyframes fadeInAnimation{0%{opacity:0}to{opacity:1}}@-webkit-keyframes fadeOutAnimation{0%{opacity:1}to{opacity:0}}@keyframes fadeOutAnimation{0%{opacity:1}to{opacity:0}}"]}]}],"members":{"id":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":30,"character":3}}]}],"checked":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":33,"character":3}}]}],"disabled":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":36,"character":3}}]}],"readonly":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":39,"character":3}}]}],"labelPosition":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":42,"character":3}}]}],"ariaLabel":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":45,"character":3},"arguments":["aria-label"]}]}],"ariaLabelledby":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":48,"character":3},"arguments":["aria-labelledby"]}]}],"valueChange":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":51,"character":3}}]}],"checkboxChange":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":54,"character":3}}]}],"checkboxBlur":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":57,"character":3}}]}],"_inputElement":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"ViewChild","line":60,"character":3},"arguments":["input"]}]}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/cdk/a11y","name":"FocusMonitor","line":66,"character":37}]}],"ngOnChanges":[{"__symbolic":"method"}],"focus":[{"__symbolic":"method"}],"_onBlur":[{"__symbolic":"method"}],"_checkboxChange":[{"__symbolic":"method"}],"_checkboxClick":[{"__symbolic":"method"}],"_getInputElement":[{"__symbolic":"method"}]}}}}]
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { NgModule } from '@angular/core';
|
|
2
|
+
import { GraniteCheckboxComponent } from './checkbox.component';
|
|
3
|
+
export class GraniteCheckboxModule {
|
|
4
|
+
}
|
|
5
|
+
GraniteCheckboxModule.decorators = [
|
|
6
|
+
{ type: NgModule, args: [{
|
|
7
|
+
declarations: [GraniteCheckboxComponent],
|
|
8
|
+
exports: [GraniteCheckboxComponent],
|
|
9
|
+
},] }
|
|
10
|
+
];
|
|
11
|
+
//# sourceMappingURL=checkbox.module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"checkbox.module.js","sourceRoot":"","sources":["../../../../../../libs/granite-components/src/lib/checkbox/checkbox.module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;AAMhE,MAAM,OAAO,qBAAqB;;;YAJjC,QAAQ,SAAC;gBACR,YAAY,EAAE,CAAC,wBAAwB,CAAC;gBACxC,OAAO,EAAE,CAAC,wBAAwB,CAAC;aACpC","sourcesContent":["import { NgModule } from '@angular/core';\nimport { GraniteCheckboxComponent } from './checkbox.component';\n\n@NgModule({\n declarations: [GraniteCheckboxComponent],\n exports: [GraniteCheckboxComponent],\n})\nexport class GraniteCheckboxModule {}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
[{"__symbolic":"module","version":4,"metadata":{"GraniteCheckboxModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule","line":3,"character":1},"arguments":[{"declarations":[{"__symbolic":"reference","module":"./checkbox.component","name":"GraniteCheckboxComponent","line":4,"character":17}],"exports":[{"__symbolic":"reference","module":"./checkbox.component","name":"GraniteCheckboxComponent","line":5,"character":12}]}]}]}}}]
|
|
@@ -2274,6 +2274,101 @@ GraniteRadioButtonModule.decorators = [
|
|
|
2274
2274
|
},] }
|
|
2275
2275
|
];
|
|
2276
2276
|
|
|
2277
|
+
class GraniteCheckboxComponent {
|
|
2278
|
+
constructor(_focusMonitor) {
|
|
2279
|
+
this._focusMonitor = _focusMonitor;
|
|
2280
|
+
this.id = null;
|
|
2281
|
+
this.checked = false;
|
|
2282
|
+
this.disabled = false;
|
|
2283
|
+
this.readonly = false;
|
|
2284
|
+
this.labelPosition = 'after';
|
|
2285
|
+
this.ariaLabel = null;
|
|
2286
|
+
this.ariaLabelledby = null;
|
|
2287
|
+
this.valueChange = new EventEmitter();
|
|
2288
|
+
this.checkboxChange = new EventEmitter();
|
|
2289
|
+
this.checkboxBlur = new EventEmitter();
|
|
2290
|
+
this._positionBefore = false;
|
|
2291
|
+
this._checkboxDisabled = false;
|
|
2292
|
+
}
|
|
2293
|
+
ngOnChanges(changes) {
|
|
2294
|
+
if (changes.checked) {
|
|
2295
|
+
this.checked = coerceBooleanProperty(changes.checked.currentValue);
|
|
2296
|
+
}
|
|
2297
|
+
if (changes.disabled) {
|
|
2298
|
+
this.disabled = coerceBooleanProperty(changes.disabled.currentValue);
|
|
2299
|
+
}
|
|
2300
|
+
if (changes.readonly) {
|
|
2301
|
+
this.readonly = coerceBooleanProperty(changes.readonly.currentValue);
|
|
2302
|
+
}
|
|
2303
|
+
if (changes.labelPosition != null) {
|
|
2304
|
+
this._positionBefore =
|
|
2305
|
+
changes.labelPosition.currentValue != null &&
|
|
2306
|
+
changes.labelPosition.currentValue === 'before';
|
|
2307
|
+
}
|
|
2308
|
+
if ((changes.disabled || changes.readonly) &&
|
|
2309
|
+
(this.disabled || this.readonly)) {
|
|
2310
|
+
this._checkboxDisabled = true;
|
|
2311
|
+
}
|
|
2312
|
+
}
|
|
2313
|
+
focus(origin = 'program', options) {
|
|
2314
|
+
this._focusMonitor.focusVia(this._getInputElement(), origin, options);
|
|
2315
|
+
}
|
|
2316
|
+
_onBlur() {
|
|
2317
|
+
this.checkboxBlur.emit();
|
|
2318
|
+
}
|
|
2319
|
+
_checkboxChange() {
|
|
2320
|
+
this.checked = this._getInputElement().checked;
|
|
2321
|
+
this.valueChange.emit(this.checked);
|
|
2322
|
+
}
|
|
2323
|
+
_checkboxClick() {
|
|
2324
|
+
this.checkboxChange.emit();
|
|
2325
|
+
}
|
|
2326
|
+
_getInputElement() {
|
|
2327
|
+
return this._inputElement.nativeElement;
|
|
2328
|
+
}
|
|
2329
|
+
}
|
|
2330
|
+
GraniteCheckboxComponent.decorators = [
|
|
2331
|
+
{ type: Component, args: [{
|
|
2332
|
+
selector: 'granite-checkbox',
|
|
2333
|
+
exportAs: 'graniteCheckbox',
|
|
2334
|
+
host: {
|
|
2335
|
+
class: 'granite-checkbox',
|
|
2336
|
+
'[class.granite-checkbox-checked]': 'checked',
|
|
2337
|
+
'[class.granite-checkbox-disabled]': 'disabled',
|
|
2338
|
+
'[class.granite-checkbox-readonly]': 'readonly',
|
|
2339
|
+
'[class.granite-checkbox-label-before]': '_positionBefore',
|
|
2340
|
+
},
|
|
2341
|
+
template: "<label [attr.for]=\"id\" class=\"granite-checkbox-label\">\n <div class=\"granite-checkbox-box\">\n <input\n #input\n [id]=\"id\"\n class=\"granite-checkbox-input cdk-visually-hidden\"\n role=\"checkbox\"\n type=\"checkbox\"\n [attr.aria-checked]=\"checked.toString()\"\n [attr.aria-label]=\"ariaLabel\"\n [attr.aria-labelledby]=\"ariaLabelledby\"\n [checked]=\"checked\"\n [disabled]=\"_checkboxDisabled\"\n [readonly]=\"readonly\"\n (click)=\"_checkboxClick()\"\n (change)=\"_checkboxChange()\"\n (blur)=\"_onBlur()\"\n />\n <div class=\"granite-checkbox-check\"></div>\n </div>\n <span class=\"granite-checkbox-text\"><ng-content></ng-content></span>\n</label>\n",
|
|
2342
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
2343
|
+
styles: [".cdk-visually-hidden{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;white-space:nowrap;outline:0;-webkit-appearance:none;-moz-appearance:none}:host{box-sizing:border-box}:host *,:host :after,:host :before{box-sizing:inherit;cursor:pointer}:host(.granite-checkbox){color:var(--granite-color-text)}:host(.granite-checkbox):not(.granite-checkbox-checked):not(.granite-checkbox-readonly):not(.granite-checkbox-disabled) .granite-checkbox-label:hover .granite-checkbox-box{border-color:var(--granite-color-background-active)}:host(.granite-checkbox-checked):not(.granite-checkbox-readonly):not(.granite-checkbox-disabled) .granite-checkbox-label:hover .granite-checkbox-box{background-color:var(--granite-color-background-active-hover);border-color:var(--granite-color-background-active-hover)}:host(.granite-checkbox-checked) .granite-checkbox-box{border-color:var(--granite-color-background-active);background-color:var(--granite-color-background-active)}:host(.granite-checkbox-checked) .granite-checkbox-box:focus-within{border-color:var(--granite-color-focus)}:host(.granite-checkbox-checked) .granite-checkbox-check{display:flex}:host(.granite-checkbox-checked):not(.granite-checkbox-readonly):not(.granite-checkbox-disabled) .granite-checkbox-box{-webkit-animation:fadeInAnimation .2s;animation:fadeInAnimation .2s;-webkit-animation-iteration-count:1;animation-iteration-count:1}:host(:not(.granite-checkbox-checked)) .granite-checkbox-box{-webkit-animation:fadeOutAnimation .2s;animation:fadeOutAnimation .2s;-webkit-animation-iteration-count:1;animation-iteration-count:1}:host(.granite-checkbox-readonly.granite-checkbox-checked) .granite-checkbox-box{background-color:var(--granite-color-text);border-color:var(--granite-color-text)}:host(.granite-checkbox-readonly.granite-checkbox-checked) .granite-checkbox-box .granite-checkbox-check{border-color:var(--granite-color-background)}:host(.granite-checkbox-disabled) .granite-checkbox-box{opacity:.3;background-color:var(--granite-color-border-soft)}:host(.granite-checkbox-disabled) .granite-checkbox-label{opacity:.6}:host(.granite-checkbox-disabled) *,:host(.granite-checkbox-readonly) *{cursor:default}:host(.granite-checkbox-label-before) .granite-checkbox-label{flex-direction:row-reverse}:host(.granite-checkbox-label-before) .granite-checkbox-text{-webkit-padding-start:0;padding-inline-start:0;-webkit-padding-end:var(--granite-spacing-s);padding-inline-end:var(--granite-spacing-s)}.granite-checkbox-label{display:flex;align-items:center;width:-webkit-max-content;width:-moz-max-content;width:max-content}.granite-checkbox-box{width:var(--granite-spacing-m);height:var(--granite-spacing-m);border:solid var(--granite-color-background-inactive);border-width:calc(var(--granite-spacing-xs) / 4);border-radius:var(--granite-spacing-xs);display:flex;justify-content:center;position:relative}.granite-checkbox-box:focus-within{border:calc(var(--granite-spacing-xs) / 4) solid var(--granite-color-focus)}.granite-checkbox-check{position:relative;display:none;width:calc(var(--granite-spacing-s) + (var(--granite-spacing-xs) / 4));height:calc(var(--granite-spacing-xs) + (var(--granite-spacing-xs) / 4));background-color:transparent;border:solid var(--granite-color-text-static-light);transform:rotate(-45deg);margin-top:var(--granite-spacing-xs);border-left-width:calc(var(--granite-spacing-xs) / 2);border-bottom-width:calc(var(--granite-spacing-xs) / 2);border-right-width:0;border-top-width:0}.granite-checkbox-text{-webkit-padding-start:var(--granite-spacing-s);padding-inline-start:var(--granite-spacing-s)}.granite-checkbox-text:empty{display:none}@-webkit-keyframes fadeInAnimation{0%{opacity:0}to{opacity:1}}@keyframes fadeInAnimation{0%{opacity:0}to{opacity:1}}@-webkit-keyframes fadeOutAnimation{0%{opacity:1}to{opacity:0}}@keyframes fadeOutAnimation{0%{opacity:1}to{opacity:0}}"]
|
|
2344
|
+
},] }
|
|
2345
|
+
];
|
|
2346
|
+
GraniteCheckboxComponent.ctorParameters = () => [
|
|
2347
|
+
{ type: FocusMonitor }
|
|
2348
|
+
];
|
|
2349
|
+
GraniteCheckboxComponent.propDecorators = {
|
|
2350
|
+
id: [{ type: Input }],
|
|
2351
|
+
checked: [{ type: Input }],
|
|
2352
|
+
disabled: [{ type: Input }],
|
|
2353
|
+
readonly: [{ type: Input }],
|
|
2354
|
+
labelPosition: [{ type: Input }],
|
|
2355
|
+
ariaLabel: [{ type: Input, args: ['aria-label',] }],
|
|
2356
|
+
ariaLabelledby: [{ type: Input, args: ['aria-labelledby',] }],
|
|
2357
|
+
valueChange: [{ type: Output }],
|
|
2358
|
+
checkboxChange: [{ type: Output }],
|
|
2359
|
+
checkboxBlur: [{ type: Output }],
|
|
2360
|
+
_inputElement: [{ type: ViewChild, args: ['input',] }]
|
|
2361
|
+
};
|
|
2362
|
+
|
|
2363
|
+
class GraniteCheckboxModule {
|
|
2364
|
+
}
|
|
2365
|
+
GraniteCheckboxModule.decorators = [
|
|
2366
|
+
{ type: NgModule, args: [{
|
|
2367
|
+
declarations: [GraniteCheckboxComponent],
|
|
2368
|
+
exports: [GraniteCheckboxComponent],
|
|
2369
|
+
},] }
|
|
2370
|
+
];
|
|
2371
|
+
|
|
2277
2372
|
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
|
|
2278
2373
|
const disabledMixin = (Base = class {
|
|
2279
2374
|
}) => {
|
|
@@ -2775,5 +2870,5 @@ GraniteCoreModule.decorators = [
|
|
|
2775
2870
|
* Generated bundle index. Do not edit.
|
|
2776
2871
|
*/
|
|
2777
2872
|
|
|
2778
|
-
export { ClientInputDesktopDirective, ClientInputTouchDirective, ClientOutputDesktopDirective, ClientOutputTouchDirective, GRANITE_CLIENT_INPUT, GRANITE_CLIENT_OUTPUT, GraniteAnchorComponent, GraniteArrangeGridComponent, GraniteArrangeGridItemComponent, GraniteArrangeGridModule, GraniteArrangeGridOrientation, GraniteBadgeComponent, GraniteBadgeHarness, GraniteBadgeModule, GraniteButtonComponent, GraniteButtonModule, GraniteCoreModule, GraniteDividerDirective, GraniteGridComponent, GraniteGridItemComponent, GraniteGridModule, GraniteIconComponent, GraniteIconModule, GraniteInputFieldComponent, GraniteInputFieldModule, GraniteMenuComponent, GraniteMenuHarness, GraniteMenuItemComponent, GraniteMenuItemHarness, GraniteMenuModule, GraniteMenuTouchCloseComponent, GraniteMenuTouchTitleItemComponent, GraniteMenuTriggerForDirective, GraniteRadioButtonComponent, GraniteRadioButtonModule, GraniteTableColumnDirective, GraniteTableComponent, GraniteTableModule, GraniteToggleSwitchComponent, GraniteToggleSwitchModule, _MenuBaseComponent, deviceDesktop, deviceTouch, disabledMixin, graniteMenuDesktopAnimations, graniteMenuTouchAnimations, ɵ0$1 as ɵ0, GRANITE_MENU_PANEL as ɵa, getEaseOutSteep as ɵc, getEaseLinear as ɵd, GraniteTableDataCellComponent as ɵe, GraniteCell as ɵf, GraniteTableHeaderCellComponent as ɵg, PurePipesModule as ɵh, GraniteTitlePipe as ɵi };
|
|
2873
|
+
export { ClientInputDesktopDirective, ClientInputTouchDirective, ClientOutputDesktopDirective, ClientOutputTouchDirective, GRANITE_CLIENT_INPUT, GRANITE_CLIENT_OUTPUT, GraniteAnchorComponent, GraniteArrangeGridComponent, GraniteArrangeGridItemComponent, GraniteArrangeGridModule, GraniteArrangeGridOrientation, GraniteBadgeComponent, GraniteBadgeHarness, GraniteBadgeModule, GraniteButtonComponent, GraniteButtonModule, GraniteCheckboxComponent, GraniteCheckboxModule, GraniteCoreModule, GraniteDividerDirective, GraniteGridComponent, GraniteGridItemComponent, GraniteGridModule, GraniteIconComponent, GraniteIconModule, GraniteInputFieldComponent, GraniteInputFieldModule, GraniteMenuComponent, GraniteMenuHarness, GraniteMenuItemComponent, GraniteMenuItemHarness, GraniteMenuModule, GraniteMenuTouchCloseComponent, GraniteMenuTouchTitleItemComponent, GraniteMenuTriggerForDirective, GraniteRadioButtonComponent, GraniteRadioButtonModule, GraniteTableColumnDirective, GraniteTableComponent, GraniteTableModule, GraniteToggleSwitchComponent, GraniteToggleSwitchModule, _MenuBaseComponent, deviceDesktop, deviceTouch, disabledMixin, graniteMenuDesktopAnimations, graniteMenuTouchAnimations, ɵ0$1 as ɵ0, GRANITE_MENU_PANEL as ɵa, getEaseOutSteep as ɵc, getEaseLinear as ɵd, GraniteTableDataCellComponent as ɵe, GraniteCell as ɵf, GraniteTableHeaderCellComponent as ɵg, PurePipesModule as ɵh, GraniteTitlePipe as ɵi };
|
|
2779
2874
|
//# sourceMappingURL=ifsworld-granite-components.js.map
|