@ifsworld/granite-components 3.2.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 +267 -6
- 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 +4 -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/esm2015/lib/input-field/input-field.component.js +144 -0
- package/esm2015/lib/input-field/input-field.component.js.map +1 -0
- package/esm2015/lib/input-field/input-field.component.metadata.json +1 -0
- package/esm2015/lib/input-field/input-field.module.js +15 -0
- package/esm2015/lib/input-field/input-field.module.js.map +1 -0
- package/esm2015/lib/input-field/input-field.module.metadata.json +1 -0
- package/esm2015/lib/table/cell/table-data-cell.component.js +4 -3
- package/esm2015/lib/table/cell/table-data-cell.component.js.map +1 -1
- package/esm2015/lib/table/cell/table-data-cell.component.metadata.json +1 -1
- package/esm2015/lib/table/cell/table-header-cell.component.js +1 -1
- package/esm2015/lib/table/cell/table-header-cell.component.metadata.json +1 -1
- package/esm2015/lib/table/table.component.js +2 -2
- package/esm2015/lib/table/table.component.js.map +1 -1
- package/esm2015/lib/table/table.component.metadata.json +1 -1
- package/fesm2015/ifsworld-granite-components.js +254 -7
- package/fesm2015/ifsworld-granite-components.js.map +1 -1
- package/ifsworld-granite-components.metadata.json +1 -1
- package/index.d.ts +4 -0
- package/lib/checkbox/checkbox.component.d.ts +26 -0
- package/lib/checkbox/checkbox.module.d.ts +2 -0
- package/lib/input-field/input-field.component.d.ts +39 -0
- package/lib/input-field/input-field.module.d.ts +2 -0
- package/lib/table/cell/table-data-cell.component.d.ts +1 -0
- package/package.json +1 -1
- package/src/lib/core/style/_mixins.scss +10 -0
|
@@ -2779,6 +2779,106 @@
|
|
|
2779
2779
|
},] }
|
|
2780
2780
|
];
|
|
2781
2781
|
|
|
2782
|
+
var GraniteCheckboxComponent = /** @class */ (function () {
|
|
2783
|
+
function GraniteCheckboxComponent(_focusMonitor) {
|
|
2784
|
+
this._focusMonitor = _focusMonitor;
|
|
2785
|
+
this.id = null;
|
|
2786
|
+
this.checked = false;
|
|
2787
|
+
this.disabled = false;
|
|
2788
|
+
this.readonly = false;
|
|
2789
|
+
this.labelPosition = 'after';
|
|
2790
|
+
this.ariaLabel = null;
|
|
2791
|
+
this.ariaLabelledby = null;
|
|
2792
|
+
this.valueChange = new core.EventEmitter();
|
|
2793
|
+
this.checkboxChange = new core.EventEmitter();
|
|
2794
|
+
this.checkboxBlur = new core.EventEmitter();
|
|
2795
|
+
this._positionBefore = false;
|
|
2796
|
+
this._checkboxDisabled = false;
|
|
2797
|
+
}
|
|
2798
|
+
GraniteCheckboxComponent.prototype.ngOnChanges = function (changes) {
|
|
2799
|
+
if (changes.checked) {
|
|
2800
|
+
this.checked = coercion.coerceBooleanProperty(changes.checked.currentValue);
|
|
2801
|
+
}
|
|
2802
|
+
if (changes.disabled) {
|
|
2803
|
+
this.disabled = coercion.coerceBooleanProperty(changes.disabled.currentValue);
|
|
2804
|
+
}
|
|
2805
|
+
if (changes.readonly) {
|
|
2806
|
+
this.readonly = coercion.coerceBooleanProperty(changes.readonly.currentValue);
|
|
2807
|
+
}
|
|
2808
|
+
if (changes.labelPosition != null) {
|
|
2809
|
+
this._positionBefore =
|
|
2810
|
+
changes.labelPosition.currentValue != null &&
|
|
2811
|
+
changes.labelPosition.currentValue === 'before';
|
|
2812
|
+
}
|
|
2813
|
+
if ((changes.disabled || changes.readonly) &&
|
|
2814
|
+
(this.disabled || this.readonly)) {
|
|
2815
|
+
this._checkboxDisabled = true;
|
|
2816
|
+
}
|
|
2817
|
+
};
|
|
2818
|
+
GraniteCheckboxComponent.prototype.focus = function (origin, options) {
|
|
2819
|
+
if (origin === void 0) { origin = 'program'; }
|
|
2820
|
+
this._focusMonitor.focusVia(this._getInputElement(), origin, options);
|
|
2821
|
+
};
|
|
2822
|
+
GraniteCheckboxComponent.prototype._onBlur = function () {
|
|
2823
|
+
this.checkboxBlur.emit();
|
|
2824
|
+
};
|
|
2825
|
+
GraniteCheckboxComponent.prototype._checkboxChange = function () {
|
|
2826
|
+
this.checked = this._getInputElement().checked;
|
|
2827
|
+
this.valueChange.emit(this.checked);
|
|
2828
|
+
};
|
|
2829
|
+
GraniteCheckboxComponent.prototype._checkboxClick = function () {
|
|
2830
|
+
this.checkboxChange.emit();
|
|
2831
|
+
};
|
|
2832
|
+
GraniteCheckboxComponent.prototype._getInputElement = function () {
|
|
2833
|
+
return this._inputElement.nativeElement;
|
|
2834
|
+
};
|
|
2835
|
+
return GraniteCheckboxComponent;
|
|
2836
|
+
}());
|
|
2837
|
+
GraniteCheckboxComponent.decorators = [
|
|
2838
|
+
{ type: core.Component, args: [{
|
|
2839
|
+
selector: 'granite-checkbox',
|
|
2840
|
+
exportAs: 'graniteCheckbox',
|
|
2841
|
+
host: {
|
|
2842
|
+
class: 'granite-checkbox',
|
|
2843
|
+
'[class.granite-checkbox-checked]': 'checked',
|
|
2844
|
+
'[class.granite-checkbox-disabled]': 'disabled',
|
|
2845
|
+
'[class.granite-checkbox-readonly]': 'readonly',
|
|
2846
|
+
'[class.granite-checkbox-label-before]': '_positionBefore',
|
|
2847
|
+
},
|
|
2848
|
+
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",
|
|
2849
|
+
changeDetection: core.ChangeDetectionStrategy.OnPush,
|
|
2850
|
+
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}}"]
|
|
2851
|
+
},] }
|
|
2852
|
+
];
|
|
2853
|
+
GraniteCheckboxComponent.ctorParameters = function () { return [
|
|
2854
|
+
{ type: a11y.FocusMonitor }
|
|
2855
|
+
]; };
|
|
2856
|
+
GraniteCheckboxComponent.propDecorators = {
|
|
2857
|
+
id: [{ type: core.Input }],
|
|
2858
|
+
checked: [{ type: core.Input }],
|
|
2859
|
+
disabled: [{ type: core.Input }],
|
|
2860
|
+
readonly: [{ type: core.Input }],
|
|
2861
|
+
labelPosition: [{ type: core.Input }],
|
|
2862
|
+
ariaLabel: [{ type: core.Input, args: ['aria-label',] }],
|
|
2863
|
+
ariaLabelledby: [{ type: core.Input, args: ['aria-labelledby',] }],
|
|
2864
|
+
valueChange: [{ type: core.Output }],
|
|
2865
|
+
checkboxChange: [{ type: core.Output }],
|
|
2866
|
+
checkboxBlur: [{ type: core.Output }],
|
|
2867
|
+
_inputElement: [{ type: core.ViewChild, args: ['input',] }]
|
|
2868
|
+
};
|
|
2869
|
+
|
|
2870
|
+
var GraniteCheckboxModule = /** @class */ (function () {
|
|
2871
|
+
function GraniteCheckboxModule() {
|
|
2872
|
+
}
|
|
2873
|
+
return GraniteCheckboxModule;
|
|
2874
|
+
}());
|
|
2875
|
+
GraniteCheckboxModule.decorators = [
|
|
2876
|
+
{ type: core.NgModule, args: [{
|
|
2877
|
+
declarations: [GraniteCheckboxComponent],
|
|
2878
|
+
exports: [GraniteCheckboxComponent],
|
|
2879
|
+
},] }
|
|
2880
|
+
];
|
|
2881
|
+
|
|
2782
2882
|
var disabledMixin = function (Base) {
|
|
2783
2883
|
if (Base === void 0) { Base = /** @class */ (function () {
|
|
2784
2884
|
function class_1() {
|
|
@@ -2964,9 +3064,9 @@
|
|
|
2964
3064
|
GraniteTableComponent.decorators = [
|
|
2965
3065
|
{ type: core.Component, args: [{
|
|
2966
3066
|
selector: 'granite-table',
|
|
2967
|
-
template: "<cdk-table\n [dataSource]=\"dataSource\"\n multiTemplateDataRows\n [trackBy]=\"trackBy\"\n [attr.aria-label]=\"ariaLabel\"\n>\n <ng-container\n *ngFor=\"let column of columns; index as columnI\"\n [cdkColumnDef]=\"column.name\"\n >\n <!-- Cell Header -->\n <cdk-header-cell *cdkHeaderCellDef graniteTableHeaderCell>\n {{ (column.title ? column.title : column.name) | graniteTitle }}\n </cdk-header-cell>\n\n <!-- Cell Data -->\n <cdk-cell\n graniteTableDataCell\n *cdkCellDef=\"let
|
|
3067
|
+
template: "<cdk-table\n [dataSource]=\"dataSource\"\n multiTemplateDataRows\n [trackBy]=\"trackBy\"\n [attr.aria-label]=\"ariaLabel\"\n>\n <ng-container\n *ngFor=\"let column of columns; index as columnI\"\n [cdkColumnDef]=\"column.name\"\n >\n <!-- Cell Header -->\n <cdk-header-cell *cdkHeaderCellDef graniteTableHeaderCell>\n {{ (column.title ? column.title : column.name) | graniteTitle }}\n </cdk-header-cell>\n\n <!-- Cell Data -->\n <cdk-cell\n graniteTableDataCell\n *cdkCellDef=\"let row; let rowI = dataIndex\"\n [id]=\"cellIdPrefix + '-' + rowI + '-' + columnI\"\n [value]=\"row[column.name]\"\n [rowIndex]=\"rowI\"\n [columnIndex]=\"columnI\"\n [staticType]=\"column.staticType\"\n [column]=\"column\"\n [tableCellTemplateRef]=\"column.tableCellTemplateRef\"\n [row]=\"row\"\n ></cdk-cell>\n </ng-container>\n\n <cdk-header-row *cdkHeaderRowDef=\"renderedColumns\"></cdk-header-row>\n <cdk-row\n *cdkRowDef=\"let row; let rowI = dataIndex; columns: renderedColumns\"\n [attr.aria-rowindex]=\"rowI + 1\"\n ></cdk-row>\n</cdk-table>\n",
|
|
2968
3068
|
changeDetection: core.ChangeDetectionStrategy.OnPush,
|
|
2969
|
-
styles: [":host{box-sizing:border-box}:host *,:host :after,:host :before{box-sizing:inherit}cdk-table{flex-direction:column;background-color:var(--granite-color-background-variant)}cdk-header-row,cdk-row,cdk-table{display:flex}cdk-cell,cdk-header-cell{flex:1
|
|
3069
|
+
styles: [":host{box-sizing:border-box}:host *,:host :after,:host :before{box-sizing:inherit}cdk-table{flex-direction:column;background-color:var(--granite-color-background-variant)}cdk-header-row,cdk-row,cdk-table{display:flex}cdk-cell,cdk-header-cell{flex:1;height:calc(var(--granite-spacing-m) * 2.5)}cdk-cell{border-top:1px solid var(--granite-color-border-soft)}"]
|
|
2970
3070
|
},] }
|
|
2971
3071
|
];
|
|
2972
3072
|
GraniteTableComponent.propDecorators = {
|
|
@@ -3000,8 +3100,8 @@
|
|
|
3000
3100
|
{ type: core.Component, args: [{
|
|
3001
3101
|
// eslint-disable-next-line @angular-eslint/component-selector
|
|
3002
3102
|
selector: 'cdk-cell[graniteTableDataCell]',
|
|
3003
|
-
template: "<span class=\"granite-table-data-cell-static-container\">\n <ng-template\n [ngTemplateOutlet]=\"tableCellTemplateRef || defaultTableCellTemplate\"\n [ngTemplateOutletContext]=\"{\n data: value,\n rowIndex: rowIndex,\n columnIndex: columnIndex,\n column: column\n }\"\n ></ng-template>\n</span>\n\n<ng-template #defaultTableCellTemplate>\n <ng-container [ngSwitch]=\"staticType\">\n <ng-container *ngSwitchCase=\"'badge'\">\n <granite-badge>{{ value }}</granite-badge>\n </ng-container>\n <ng-container *ngSwitchDefault>{{ value }}</ng-container>\n </ng-container>\n</ng-template>\n",
|
|
3004
|
-
styles: [".granite-table-data-cell-static-container{padding:var(--granite-spacing-s);height:
|
|
3103
|
+
template: "<span class=\"granite-table-data-cell-static-container\">\n <ng-template\n [ngTemplateOutlet]=\"tableCellTemplateRef || defaultTableCellTemplate\"\n [ngTemplateOutletContext]=\"{\n data: value,\n rowIndex: rowIndex,\n columnIndex: columnIndex,\n column: column,\n row: row\n }\"\n ></ng-template>\n</span>\n\n<ng-template #defaultTableCellTemplate>\n <ng-container [ngSwitch]=\"staticType\">\n <ng-container *ngSwitchCase=\"'badge'\">\n <granite-badge>{{ value }}</granite-badge>\n </ng-container>\n <ng-container *ngSwitchDefault>{{ value }}</ng-container>\n </ng-container>\n</ng-template>\n",
|
|
3104
|
+
styles: [":host{box-sizing:border-box}:host *,:host :after,:host :before{box-sizing:inherit}.granite-table-data-cell-static-container{padding:var(--granite-spacing-s);height:inherit;font-size:var(--granite-font-size-body-small);line-height:var(--granite-line-height-regular);display:flex;justify-content:center;align-items:center;color:var(--granite-color-text)}"]
|
|
3005
3105
|
},] }
|
|
3006
3106
|
];
|
|
3007
3107
|
GraniteTableDataCellComponent.propDecorators = {
|
|
@@ -3009,7 +3109,8 @@
|
|
|
3009
3109
|
staticType: [{ type: core.Input }],
|
|
3010
3110
|
rowIndex: [{ type: core.Input }],
|
|
3011
3111
|
columnIndex: [{ type: core.Input }],
|
|
3012
|
-
tableCellTemplateRef: [{ type: core.Input }]
|
|
3112
|
+
tableCellTemplateRef: [{ type: core.Input }],
|
|
3113
|
+
row: [{ type: core.Input }]
|
|
3013
3114
|
};
|
|
3014
3115
|
|
|
3015
3116
|
var GraniteTableHeaderCellComponent = /** @class */ (function (_super) {
|
|
@@ -3024,7 +3125,7 @@
|
|
|
3024
3125
|
// eslint-disable-next-line @angular-eslint/component-selector
|
|
3025
3126
|
selector: 'cdk-header-cell[graniteTableHeaderCell]',
|
|
3026
3127
|
template: "<span class=\"granite-table-header-cell-title\">\n <ng-content></ng-content>\n</span>\n",
|
|
3027
|
-
styles: [".granite-table-header-cell-title{padding:var(--granite-spacing-s);height:
|
|
3128
|
+
styles: [":host{box-sizing:border-box}:host *,:host :after,:host :before{box-sizing:inherit}.granite-table-header-cell-title{padding:var(--granite-spacing-s);height:inherit;font-size:var(--granite-font-size-micro);line-height:var(--granite-line-height-flowing);letter-spacing:.015em;font-weight:400;display:flex;justify-content:center;align-items:center;color:var(--granite-color-text-weak)}"]
|
|
3028
3129
|
},] }
|
|
3029
3130
|
];
|
|
3030
3131
|
|
|
@@ -3077,6 +3178,162 @@
|
|
|
3077
3178
|
},] }
|
|
3078
3179
|
];
|
|
3079
3180
|
|
|
3181
|
+
var GRANITE_INPUT_INCLUDES = ['text', 'number', 'password', 'textarea'];
|
|
3182
|
+
var GraniteInputFieldComponent = /** @class */ (function () {
|
|
3183
|
+
function GraniteInputFieldComponent(_focusMonitor) {
|
|
3184
|
+
this._focusMonitor = _focusMonitor;
|
|
3185
|
+
this.id = null;
|
|
3186
|
+
this.name = null;
|
|
3187
|
+
this.type = 'text';
|
|
3188
|
+
this.value = '';
|
|
3189
|
+
this.required = false;
|
|
3190
|
+
this.readonly = false;
|
|
3191
|
+
this.invalid = false;
|
|
3192
|
+
this.disabled = false;
|
|
3193
|
+
this.placeholder = '';
|
|
3194
|
+
this.maxlength = 255;
|
|
3195
|
+
this.countcharacters = false;
|
|
3196
|
+
this.ariaLabel = null;
|
|
3197
|
+
this.ariaLabelledby = null;
|
|
3198
|
+
this.valueChange = new core.EventEmitter();
|
|
3199
|
+
this._supported = true;
|
|
3200
|
+
this._empty = false;
|
|
3201
|
+
this._passwordFieldIcon = 'view';
|
|
3202
|
+
this._passwordField = false;
|
|
3203
|
+
this._passwordToggled = false;
|
|
3204
|
+
this._currentCharCount = 0;
|
|
3205
|
+
}
|
|
3206
|
+
GraniteInputFieldComponent.prototype.ngOnInit = function () {
|
|
3207
|
+
this._validateType();
|
|
3208
|
+
this._passwordField = this.type == 'password';
|
|
3209
|
+
this._empty = this.value == null || this.value === '';
|
|
3210
|
+
};
|
|
3211
|
+
GraniteInputFieldComponent.prototype.ngOnChanges = function (changes) {
|
|
3212
|
+
if (changes.required) {
|
|
3213
|
+
this.required = coercion.coerceBooleanProperty(changes.required.currentValue);
|
|
3214
|
+
}
|
|
3215
|
+
if (changes.readonly) {
|
|
3216
|
+
this.readonly = coercion.coerceBooleanProperty(changes.readonly.currentValue);
|
|
3217
|
+
}
|
|
3218
|
+
if (changes.invalid) {
|
|
3219
|
+
this.invalid = coercion.coerceBooleanProperty(changes.invalid.currentValue);
|
|
3220
|
+
}
|
|
3221
|
+
if (changes.disabled) {
|
|
3222
|
+
this.disabled = coercion.coerceBooleanProperty(changes.disabled.currentValue);
|
|
3223
|
+
}
|
|
3224
|
+
if (changes.countcharacters) {
|
|
3225
|
+
this.countcharacters = coercion.coerceBooleanProperty(changes.countcharacters.currentValue);
|
|
3226
|
+
}
|
|
3227
|
+
if (changes.value) {
|
|
3228
|
+
this._empty = this.value == null || this.value === '';
|
|
3229
|
+
}
|
|
3230
|
+
if (changes.type) {
|
|
3231
|
+
this._validateType();
|
|
3232
|
+
}
|
|
3233
|
+
};
|
|
3234
|
+
GraniteInputFieldComponent.prototype.focus = function (origin, options) {
|
|
3235
|
+
if (origin === void 0) { origin = 'program'; }
|
|
3236
|
+
if (this.type === 'text') {
|
|
3237
|
+
this._focusMonitor.focusVia(this._getInputElement(), origin, options);
|
|
3238
|
+
}
|
|
3239
|
+
else if (this.type === 'textarea') {
|
|
3240
|
+
this._focusMonitor.focusVia(this._getTextareaElement(), origin, options);
|
|
3241
|
+
}
|
|
3242
|
+
};
|
|
3243
|
+
GraniteInputFieldComponent.prototype._togglePassword = function () {
|
|
3244
|
+
if (this._passwordToggled) {
|
|
3245
|
+
this._passwordToggled = false;
|
|
3246
|
+
this.type = 'password';
|
|
3247
|
+
this._passwordFieldIcon = 'view';
|
|
3248
|
+
}
|
|
3249
|
+
else {
|
|
3250
|
+
this._passwordToggled = true;
|
|
3251
|
+
this.type = 'text';
|
|
3252
|
+
this._passwordFieldIcon = 'view-disabled';
|
|
3253
|
+
}
|
|
3254
|
+
};
|
|
3255
|
+
GraniteInputFieldComponent.prototype._onKeyUp = function (event) {
|
|
3256
|
+
var inputEvent = event.target;
|
|
3257
|
+
this._applyCharacterCount(inputEvent.value);
|
|
3258
|
+
this._empty = inputEvent.value == null || inputEvent.value === '';
|
|
3259
|
+
this.valueChange.emit(inputEvent.value);
|
|
3260
|
+
};
|
|
3261
|
+
GraniteInputFieldComponent.prototype._onInput = function (event) {
|
|
3262
|
+
var inputEvent = event.target;
|
|
3263
|
+
this._empty = inputEvent.value == null || inputEvent.value === '';
|
|
3264
|
+
this.valueChange.emit(inputEvent.value);
|
|
3265
|
+
};
|
|
3266
|
+
GraniteInputFieldComponent.prototype._validateType = function () {
|
|
3267
|
+
if (GRANITE_INPUT_INCLUDES.indexOf(this.type) < 0) {
|
|
3268
|
+
this._supported = false;
|
|
3269
|
+
throw Error("Input type \"" + this.type + "\" isn't supported by graniteInputField.");
|
|
3270
|
+
}
|
|
3271
|
+
};
|
|
3272
|
+
GraniteInputFieldComponent.prototype._applyCharacterCount = function (inputString) {
|
|
3273
|
+
if (this.countcharacters) {
|
|
3274
|
+
this._currentCharCount = inputString.length;
|
|
3275
|
+
if (this._currentCharCount > this.maxlength) {
|
|
3276
|
+
inputString = inputString.slice(0, this.maxlength);
|
|
3277
|
+
this._currentCharCount = this.maxlength;
|
|
3278
|
+
}
|
|
3279
|
+
}
|
|
3280
|
+
};
|
|
3281
|
+
GraniteInputFieldComponent.prototype._getInputElement = function () {
|
|
3282
|
+
return this._inputElement.nativeElement;
|
|
3283
|
+
};
|
|
3284
|
+
GraniteInputFieldComponent.prototype._getTextareaElement = function () {
|
|
3285
|
+
return this._textareaElement.nativeElement;
|
|
3286
|
+
};
|
|
3287
|
+
return GraniteInputFieldComponent;
|
|
3288
|
+
}());
|
|
3289
|
+
GraniteInputFieldComponent.decorators = [
|
|
3290
|
+
{ type: core.Component, args: [{
|
|
3291
|
+
selector: 'granite-input-field',
|
|
3292
|
+
exportAs: 'graniteInputField',
|
|
3293
|
+
template: "<div\n *ngIf=\"_supported\"\n class=\"granite-input-container\"\n [class.granite-input-disabled]=\"disabled\"\n [class.granite-input-readonly]=\"readonly\"\n [class.granite-input-disabled]=\"disabled\"\n [class.granite-input-readonly]=\"readonly\"\n>\n <div\n class=\"granite-input-top-row\"\n [class.granite-input-required]=\"required\"\n [class.granite-input-empty]=\"_empty\"\n [class.granite-input-disabled]=\"disabled\"\n [class.granite-input-readonly]=\"readonly\"\n >\n <div\n *ngIf=\"prefixicon\"\n class=\"granite-input-prepend\"\n [class.granite-input-required]=\"required\"\n [class.granite-input-empty]=\"_empty\"\n >\n <granite-icon class=\"granite-input-prepend-icon\">\n {{ prefixicon }}\n </granite-icon>\n </div>\n\n <ng-container\n *ngIf=\"type != 'textarea'; then inputElement; else textareaElement\"\n ></ng-container>\n\n <ng-template #inputElement>\n <input\n #input\n [id]=\"id\"\n class=\"granite-input-base\"\n [class.granite-input-invalid]=\"invalid\"\n [class.granite-input-empty]=\"_empty\"\n [name]=\"name\"\n [attr.type]=\"type\"\n [required]=\"required\"\n [readonly]=\"readonly\"\n [disabled]=\"disabled\"\n [placeholder]=\"placeholder\"\n [attr.maxlength]=\"maxlength\"\n [value]=\"value\"\n [attr.aria-label]=\"ariaLabel\"\n [attr.aria-labelledby]=\"ariaLabelledby\"\n [attr.aria-invalid]=\"invalid\"\n (keyup)=\"_onKeyUp($event)\"\n (input)=\"_onInput($event)\"\n />\n </ng-template>\n\n <button\n *ngIf=\"_passwordField\"\n class=\"granite-input-append\"\n [class.granite-input-required]=\"required\"\n [class.granite-input-empty]=\"_empty\"\n (click)=\"_togglePassword()\"\n >\n <granite-icon class=\"granite-input-password-toggle-icon\">\n {{ _passwordFieldIcon }}\n </granite-icon>\n </button>\n\n <ng-template #textareaElement>\n <textarea\n #textarea\n [id]=\"id\"\n class=\"granite-input-base granite-text-area\"\n [class.granite-input-invalid]=\"invalid\"\n [class.granite-input-empty]=\"_empty\"\n rows=\"1\"\n [name]=\"name\"\n [attr.type]=\"type\"\n [required]=\"required\"\n [readonly]=\"readonly\"\n [disabled]=\"disabled\"\n [placeholder]=\"placeholder\"\n [value]=\"value\"\n [attr.maxlength]=\"maxlength\"\n [attr.aria-label]=\"ariaLabel\"\n [attr.aria-labelledby]=\"ariaLabelledby\"\n [attr.aria-required]=\"required\"\n [attr.aria-invalid]=\"invalid\"\n (keyup)=\"_onKeyUp($event)\"\n (input)=\"_onInput($event)\"\n ></textarea>\n </ng-template>\n\n <div\n class=\"granite-input-hover-bar\"\n [class.granite-input-invalid]=\"invalid\"\n [class.granite-input-empty]=\"_empty\"\n ></div>\n </div>\n\n <div *ngIf=\"countcharacters\" class=\"granite-input-bottom-row\">\n <div class=\"granite-input-char-count\">\n {{ _currentCharCount }}/{{ maxlength }}\n </div>\n </div>\n</div>\n",
|
|
3294
|
+
host: {
|
|
3295
|
+
class: 'granite-input-field',
|
|
3296
|
+
},
|
|
3297
|
+
changeDetection: core.ChangeDetectionStrategy.OnPush,
|
|
3298
|
+
styles: [":host{transition:all .2s ease-out;width:calc(var(--granite-spacing-3-xl) * 3.625);height:var(--granite-spacing-xl);box-sizing:border-box}:host *,:host :after,:host :before{box-sizing:inherit}.granite-input-container{height:inherit;width:inherit;font-size:var(--granite-font-size-body-small)}.granite-input-container .granite-input-top-row{display:inline-flex;width:inherit;height:inherit;position:relative;background:var(--granite-color-background)}.granite-input-container .granite-input-top-row:hover .granite-input-hover-bar{height:calc(var(--granite-spacing-xs)/2)}.granite-input-container .granite-input-top-row:hover .granite-input-hover-bar.granite-input-invalid.granite-input-empty{background-color:var(--granite-color-focus)}.granite-input-container .granite-input-top-row .granite-text-area{min-width:calc(var(--granite-spacing-3-xl) * 3.625);min-height:var(--granite-spacing-xl)}.granite-input-container .granite-input-top-row.granite-input-disabled,.granite-input-container .granite-input-top-row.granite-input-readonly{background-color:transparent;box-shadow:none}.granite-input-container .granite-input-top-row.granite-input-disabled .granite-input-hover-bar,.granite-input-container .granite-input-top-row.granite-input-readonly .granite-input-hover-bar{background-color:transparent}.granite-input-container .granite-input-top-row .granite-input-base{-webkit-appearance:none;-moz-appearance:none;appearance:none;outline:none;border:none;background-color:var(--granite-color-background-input);padding:var(--granite-spacing-s);width:inherit;height:inherit;color:var(--granite-color-text);font:inherit;font-weight:var(--granite-font-weight-regular);line-height:100%}.granite-input-container .granite-input-top-row .granite-input-base:required.granite-input-empty{background-color:var(--granite-color-background-failure)}.granite-input-container .granite-input-top-row .granite-input-base:required::-moz-placeholder{color:var(--granite-color-text-weak)}.granite-input-container .granite-input-top-row .granite-input-base:required:-ms-input-placeholder{color:var(--granite-color-text-weak)}.granite-input-container .granite-input-top-row .granite-input-base:required::placeholder{color:var(--granite-color-text-weak)}.granite-input-container .granite-input-top-row .granite-input-base:-moz-read-only{background-color:transparent}.granite-input-container .granite-input-top-row .granite-input-base:read-only{background-color:transparent}.granite-input-container .granite-input-top-row .granite-input-base:disabled{opacity:.3}.granite-input-container .granite-input-top-row .granite-input-base::-moz-placeholder{color:var(--granite-color-text-hint)}.granite-input-container .granite-input-top-row .granite-input-base:-ms-input-placeholder{color:var(--granite-color-text-hint)}.granite-input-container .granite-input-top-row .granite-input-base::placeholder{color:var(--granite-color-text-hint)}.granite-input-container .granite-input-top-row .granite-input-base:hover::-moz-placeholder{color:var(--granite-color-text)}.granite-input-container .granite-input-top-row .granite-input-base:hover:-ms-input-placeholder{color:var(--granite-color-text)}.granite-input-container .granite-input-top-row .granite-input-base:hover::placeholder{color:var(--granite-color-text)}.granite-input-container .granite-input-top-row .granite-input-base:focus{box-shadow:inset 0 calc(var(--granite-spacing-xs)/2) var(--granite-color-focus),inset calc(var(--granite-spacing-xs)/2) 0 var(--granite-color-focus),inset calc(var(--granite-spacing-xs)/2 * -1) 0 var(--granite-color-focus),inset 0 calc(var(--granite-spacing-xs)/2 * -1) var(--granite-color-focus)}.granite-input-container .granite-input-top-row .granite-input-base:focus.granite-input-invalid{box-shadow:inset 0 calc(var(--granite-spacing-xs)/2 * -1) var(--granite-color-signal-failure),inset 0 calc(var(--granite-spacing-xs)/2) var(--granite-color-focus),inset calc(var(--granite-spacing-xs)/2) 0 var(--granite-color-focus),inset calc(var(--granite-spacing-xs)/2 * -1) 0 var(--granite-color-focus)}.granite-input-container .granite-input-top-row .granite-input-base:focus::-moz-placeholder{color:transparent}.granite-input-container .granite-input-top-row .granite-input-base:focus:-ms-input-placeholder{color:transparent}.granite-input-container .granite-input-top-row .granite-input-base:focus::placeholder{color:transparent}.granite-input-container .granite-input-top-row .granite-input-hover-bar{height:calc(var(--granite-spacing-xs)/4);background-color:var(--granite-color-border-hard);position:absolute;width:inherit;bottom:0}.granite-input-container .granite-input-top-row .granite-input-hover-bar.granite-input-invalid{background-color:var(--granite-color-signal-failure)}.granite-input-container .granite-input-top-row:focus-within .granite-input-hover-bar{background-color:transparent}.granite-input-container .granite-input-prepend{display:flex;align-items:center;padding:0 var(--granite-spacing-s);background:var(--granite-color-background-input)}.granite-input-container .granite-input-prepend .granite-input-prepend-icon{width:var(--granite-spacing-m);height:var(--granite-spacing-m);color:var(--granite-color-text);box-shadow:none}.granite-input-container .granite-input-prepend.granite-input-required.granite-input-empty{background-color:var(--granite-color-background-failure)}.granite-input-container .granite-input-append{-webkit-appearance:none;-moz-appearance:none;appearance:none;outline:none;border:none;background-color:var(--granite-color-background-input);position:relative}.granite-input-container .granite-input-append:focus{box-shadow:inset 0 calc(var(--granite-spacing-xs)/2) var(--granite-color-focus),inset calc(var(--granite-spacing-xs)/2) 0 var(--granite-color-focus),inset calc(var(--granite-spacing-xs)/2 * -1) 0 var(--granite-color-focus),inset 0 calc(var(--granite-spacing-xs)/2 * -1) var(--granite-color-focus)}.granite-input-container .granite-input-append .granite-input-password-toggle-icon{width:-webkit-max-content;width:-moz-max-content;width:max-content;height:-webkit-max-content;height:-moz-max-content;height:max-content;color:var(--granite-color-text);box-shadow:none}.granite-input-container .granite-input-append.granite-input-required.granite-input-empty{background-color:var(--granite-color-background-failure)}.granite-input-container .granite-input-bottom-row{box-shadow:none}.granite-input-container .granite-input-char-count{background:var(--granite-color-background-warning);border-radius:0 0 var(--granite-spacing-xs) var(--granite-spacing-xs);padding:var(--granite-spacing-s);background-size:contain;width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;box-shadow:none}.granite-input-container.granite-input-disabled,.granite-input-container.granite-input-readonly{background-color:transparent}"]
|
|
3299
|
+
},] }
|
|
3300
|
+
];
|
|
3301
|
+
GraniteInputFieldComponent.ctorParameters = function () { return [
|
|
3302
|
+
{ type: a11y.FocusMonitor }
|
|
3303
|
+
]; };
|
|
3304
|
+
GraniteInputFieldComponent.propDecorators = {
|
|
3305
|
+
id: [{ type: core.Input }],
|
|
3306
|
+
name: [{ type: core.Input }],
|
|
3307
|
+
type: [{ type: core.Input }],
|
|
3308
|
+
value: [{ type: core.Input }],
|
|
3309
|
+
required: [{ type: core.Input }],
|
|
3310
|
+
readonly: [{ type: core.Input }],
|
|
3311
|
+
invalid: [{ type: core.Input }],
|
|
3312
|
+
disabled: [{ type: core.Input }],
|
|
3313
|
+
placeholder: [{ type: core.Input }],
|
|
3314
|
+
prefixicon: [{ type: core.Input }],
|
|
3315
|
+
maxlength: [{ type: core.Input }],
|
|
3316
|
+
countcharacters: [{ type: core.Input }],
|
|
3317
|
+
ariaLabel: [{ type: core.Input, args: ['aria-label',] }],
|
|
3318
|
+
ariaLabelledby: [{ type: core.Input, args: ['aria-labelledby',] }],
|
|
3319
|
+
valueChange: [{ type: core.Output }],
|
|
3320
|
+
_inputElement: [{ type: core.ViewChild, args: ['input',] }],
|
|
3321
|
+
_textareaElement: [{ type: core.ViewChild, args: ['textarea',] }]
|
|
3322
|
+
};
|
|
3323
|
+
|
|
3324
|
+
var GraniteInputFieldModule = /** @class */ (function () {
|
|
3325
|
+
function GraniteInputFieldModule() {
|
|
3326
|
+
}
|
|
3327
|
+
return GraniteInputFieldModule;
|
|
3328
|
+
}());
|
|
3329
|
+
GraniteInputFieldModule.decorators = [
|
|
3330
|
+
{ type: core.NgModule, args: [{
|
|
3331
|
+
imports: [common.CommonModule, GraniteIconModule, GraniteButtonModule],
|
|
3332
|
+
declarations: [GraniteInputFieldComponent],
|
|
3333
|
+
exports: [GraniteInputFieldComponent],
|
|
3334
|
+
},] }
|
|
3335
|
+
];
|
|
3336
|
+
|
|
3080
3337
|
var ɵ0 = deviceDesktop.output;
|
|
3081
3338
|
/**
|
|
3082
3339
|
* Directive used to tell components and their sub components that client output
|
|
@@ -3211,6 +3468,8 @@
|
|
|
3211
3468
|
exports.GraniteBadgeModule = GraniteBadgeModule;
|
|
3212
3469
|
exports.GraniteButtonComponent = GraniteButtonComponent;
|
|
3213
3470
|
exports.GraniteButtonModule = GraniteButtonModule;
|
|
3471
|
+
exports.GraniteCheckboxComponent = GraniteCheckboxComponent;
|
|
3472
|
+
exports.GraniteCheckboxModule = GraniteCheckboxModule;
|
|
3214
3473
|
exports.GraniteCoreModule = GraniteCoreModule;
|
|
3215
3474
|
exports.GraniteDividerDirective = GraniteDividerDirective;
|
|
3216
3475
|
exports.GraniteGridComponent = GraniteGridComponent;
|
|
@@ -3218,6 +3477,8 @@
|
|
|
3218
3477
|
exports.GraniteGridModule = GraniteGridModule;
|
|
3219
3478
|
exports.GraniteIconComponent = GraniteIconComponent;
|
|
3220
3479
|
exports.GraniteIconModule = GraniteIconModule;
|
|
3480
|
+
exports.GraniteInputFieldComponent = GraniteInputFieldComponent;
|
|
3481
|
+
exports.GraniteInputFieldModule = GraniteInputFieldModule;
|
|
3221
3482
|
exports.GraniteMenuComponent = GraniteMenuComponent;
|
|
3222
3483
|
exports.GraniteMenuHarness = GraniteMenuHarness;
|
|
3223
3484
|
exports.GraniteMenuItemComponent = GraniteMenuItemComponent;
|