diff options
author | talasila <talasila@research.att.com> | 2017-02-07 15:03:57 -0500 |
---|---|---|
committer | talasila <talasila@research.att.com> | 2017-02-07 15:05:15 -0500 |
commit | 4ad39a5c96dd99acf819ce189b13fec946d7506b (patch) | |
tree | a1449286441947cc3d07a45227fa0d6f978e1a7d /ecomp-portal-FE/client/bower_components/angular-material/modules/closure/checkbox | |
parent | 5500448cbd1f374d0ac743ee2fd636fe2d3c0027 (diff) |
Initial OpenECOMP Portal commit
Change-Id: I804b80e0830c092e307da1599bd9fbb5c3e2da77
Signed-off-by: talasila <talasila@research.att.com>
Diffstat (limited to 'ecomp-portal-FE/client/bower_components/angular-material/modules/closure/checkbox')
3 files changed, 338 insertions, 0 deletions
diff --git a/ecomp-portal-FE/client/bower_components/angular-material/modules/closure/checkbox/checkbox-default-theme.css b/ecomp-portal-FE/client/bower_components/angular-material/modules/closure/checkbox/checkbox-default-theme.css new file mode 100644 index 00000000..c23e596c --- /dev/null +++ b/ecomp-portal-FE/client/bower_components/angular-material/modules/closure/checkbox/checkbox-default-theme.css @@ -0,0 +1,47 @@ +/*! + * Angular Material Design + * https://github.com/angular/material + * @license MIT + * v0.9.8 + */ +/* mixin definition ; sets LTR and RTL within the same style call */ +md-checkbox.md-THEME_NAME-theme .md-ripple { + color: '{{accent-600}}'; } +md-checkbox.md-THEME_NAME-theme.md-checked .md-ripple { + color: '{{background-600}}'; } +md-checkbox.md-THEME_NAME-theme.md-checked.md-focused .md-container:before { + background-color: '{{accent-color-0.26}}'; } +md-checkbox.md-THEME_NAME-theme .md-icon { + border-color: '{{foreground-2}}'; } +md-checkbox.md-THEME_NAME-theme.md-checked .md-icon { + background-color: '{{accent-color-0.87}}'; } +md-checkbox.md-THEME_NAME-theme.md-checked .md-icon:after { + border-color: '{{background-200}}'; } +md-checkbox.md-THEME_NAME-theme:not([disabled]).md-primary .md-ripple { + color: '{{primary-600}}'; } +md-checkbox.md-THEME_NAME-theme:not([disabled]).md-primary.md-checked .md-ripple { + color: '{{background-600}}'; } +md-checkbox.md-THEME_NAME-theme:not([disabled]).md-primary .md-icon { + border-color: '{{foreground-2}}'; } +md-checkbox.md-THEME_NAME-theme:not([disabled]).md-primary.md-checked .md-icon { + background-color: '{{primary-color-0.87}}'; } +md-checkbox.md-THEME_NAME-theme:not([disabled]).md-primary.md-checked.md-focused .md-container:before { + background-color: '{{primary-color-0.26}}'; } +md-checkbox.md-THEME_NAME-theme:not([disabled]).md-primary.md-checked .md-icon:after { + border-color: '{{background-200}}'; } +md-checkbox.md-THEME_NAME-theme:not([disabled]).md-warn .md-ripple { + color: '{{warn-600}}'; } +md-checkbox.md-THEME_NAME-theme:not([disabled]).md-warn .md-icon { + border-color: '{{foreground-2}}'; } +md-checkbox.md-THEME_NAME-theme:not([disabled]).md-warn.md-checked .md-icon { + background-color: '{{warn-color-0.87}}'; } +md-checkbox.md-THEME_NAME-theme:not([disabled]).md-warn.md-checked.md-focused:not([disabled]) .md-container:before { + background-color: '{{warn-color-0.26}}'; } +md-checkbox.md-THEME_NAME-theme:not([disabled]).md-warn.md-checked .md-icon:after { + border-color: '{{background-200}}'; } +md-checkbox.md-THEME_NAME-theme[disabled] .md-icon { + border-color: '{{foreground-3}}'; } +md-checkbox.md-THEME_NAME-theme[disabled].md-checked .md-icon { + background-color: '{{foreground-3}}'; } +md-checkbox.md-THEME_NAME-theme[disabled] .md-label { + color: '{{foreground-3}}'; } diff --git a/ecomp-portal-FE/client/bower_components/angular-material/modules/closure/checkbox/checkbox.css b/ecomp-portal-FE/client/bower_components/angular-material/modules/closure/checkbox/checkbox.css new file mode 100644 index 00000000..652ba9f1 --- /dev/null +++ b/ecomp-portal-FE/client/bower_components/angular-material/modules/closure/checkbox/checkbox.css @@ -0,0 +1,125 @@ +/*! + * Angular Material Design + * https://github.com/angular/material + * @license MIT + * v0.9.8 + */ +/* mixin definition ; sets LTR and RTL within the same style call */ +md-checkbox { + box-sizing: border-box; + display: block; + margin: 8px; + white-space: nowrap; + cursor: pointer; + outline: none; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + padding-left: 18px; + padding-right: 0; + position: relative; + line-height: 26px; + min-width: 18px; + min-height: 18px; } + html[dir=rtl] md-checkbox { + padding-left: 0; } + html[dir=rtl] md-checkbox { + padding-right: 18px; } + md-checkbox *, md-checkbox *:before, md-checkbox *:after { + box-sizing: border-box; } + md-checkbox.md-focused:not([disabled]) .md-container:before { + left: -8px; + top: -8px; + right: -8px; + bottom: -8px; } + md-checkbox.md-focused:not([disabled]):not(.md-checked) .md-container:before { + background-color: rgba(0, 0, 0, 0.12); } + md-checkbox .md-container { + position: absolute; + top: 50%; + display: inline-block; + width: 18px; + height: 18px; + -webkit-transform: translateY(-50%); + transform: translateY(-50%); + left: 0; + right: auto; } + html[dir=rtl] md-checkbox .md-container { + left: auto; } + html[dir=rtl] md-checkbox .md-container { + right: 0; } + md-checkbox .md-container:before { + background-color: transparent; + border-radius: 50%; + content: ''; + position: absolute; + display: block; + height: auto; + left: 0; + top: 0; + right: 0; + bottom: 0; + transition: all 0.5s; + width: auto; } + md-checkbox .md-container:after { + content: ''; + position: absolute; + top: -10px; + right: -10px; + bottom: -10px; + left: -10px; } + md-checkbox .md-container .md-ripple-container { + position: absolute; + display: block; + width: auto; + height: auto; + left: -15px; + top: -15px; + right: -15px; + bottom: -15px; } + md-checkbox .md-icon { + transition: 240ms; + position: absolute; + top: 0; + left: 0; + width: 18px; + height: 18px; + border-width: 2px; + border-style: solid; + border-radius: 2px; } + md-checkbox.md-checked .md-icon { + border: none; } + md-checkbox[disabled] { + cursor: no-drop; } + md-checkbox.md-checked .md-icon:after { + -webkit-transform: rotate(45deg); + transform: rotate(45deg); + position: absolute; + left: 6px; + top: 2px; + display: table; + width: 6px; + height: 12px; + border-width: 2px; + border-style: solid; + border-top: 0; + border-left: 0; + content: ''; } + md-checkbox .md-label { + position: relative; + display: inline-block; + vertical-align: middle; + white-space: normal; + pointer-events: none; + -webkit-user-select: text; + -moz-user-select: text; + -ms-user-select: text; + user-select: text; } + md-checkbox .md-label span { + margin-left: 10px; + margin-right: 0; } + html[dir=rtl] md-checkbox .md-label span { + margin-left: 0; } + html[dir=rtl] md-checkbox .md-label span { + margin-right: 10px; } diff --git a/ecomp-portal-FE/client/bower_components/angular-material/modules/closure/checkbox/checkbox.js b/ecomp-portal-FE/client/bower_components/angular-material/modules/closure/checkbox/checkbox.js new file mode 100644 index 00000000..351b73ab --- /dev/null +++ b/ecomp-portal-FE/client/bower_components/angular-material/modules/closure/checkbox/checkbox.js @@ -0,0 +1,166 @@ +/*! + * Angular Material Design + * https://github.com/angular/material + * @license MIT + * v0.9.8 + */ +goog.provide('ng.material.components.checkbox'); +goog.require('ng.material.core'); +/** + * @ngdoc module + * @name material.components.checkbox + * @description Checkbox module! + */ +angular + .module('material.components.checkbox', ['material.core']) + .directive('mdCheckbox', MdCheckboxDirective); + +/** + * @ngdoc directive + * @name mdCheckbox + * @module material.components.checkbox + * @restrict E + * + * @description + * The checkbox directive is used like the normal [angular checkbox](https://docs.angularjs.org/api/ng/input/input%5Bcheckbox%5D). + * + * As per the [material design spec](http://www.google.com/design/spec/style/color.html#color-ui-color-application) + * the checkbox is in the accent color by default. The primary color palette may be used with + * the `md-primary` class. + * + * @param {string} ng-model Assignable angular expression to data-bind to. + * @param {string=} name Property name of the form under which the control is published. + * @param {expression=} ng-true-value The value to which the expression should be set when selected. + * @param {expression=} ng-false-value The value to which the expression should be set when not selected. + * @param {string=} ng-change Angular expression to be executed when input changes due to user interaction with the input element. + * @param {boolean=} md-no-ink Use of attribute indicates use of ripple ink effects + * @param {string=} aria-label Adds label to checkbox for accessibility. + * Defaults to checkbox's text. If no default text is found, a warning will be logged. + * + * @usage + * <hljs lang="html"> + * <md-checkbox ng-model="isChecked" aria-label="Finished?"> + * Finished ? + * </md-checkbox> + * + * <md-checkbox md-no-ink ng-model="hasInk" aria-label="No Ink Effects"> + * No Ink Effects + * </md-checkbox> + * + * <md-checkbox ng-disabled="true" ng-model="isDisabled" aria-label="Disabled"> + * Disabled + * </md-checkbox> + * + * </hljs> + * + */ +function MdCheckboxDirective(inputDirective, $mdInkRipple, $mdAria, $mdConstant, $mdTheming, $mdUtil, $timeout) { + inputDirective = inputDirective[0]; + var CHECKED_CSS = 'md-checked'; + + return { + restrict: 'E', + transclude: true, + require: '?ngModel', + priority:210, // Run before ngAria + template: + '<div class="md-container" md-ink-ripple md-ink-ripple-checkbox>' + + '<div class="md-icon"></div>' + + '</div>' + + '<div ng-transclude class="md-label"></div>', + compile: compile + }; + + // ********************************************************** + // Private Methods + // ********************************************************** + + function compile (tElement, tAttrs) { + + tAttrs.type = 'checkbox'; + tAttrs.tabindex = tAttrs.tabindex || '0'; + tElement.attr('role', tAttrs.type); + + return function postLink(scope, element, attr, ngModelCtrl) { + ngModelCtrl = ngModelCtrl || $mdUtil.fakeNgModel(); + $mdTheming(element); + + if (attr.ngChecked) { + scope.$watch( + scope.$eval.bind(scope, attr.ngChecked), + ngModelCtrl.$setViewValue.bind(ngModelCtrl) + ); + } + $$watchExpr('ngDisabled', 'tabindex', { + true: '-1', + false: attr.tabindex + }); + $mdAria.expectWithText(element, 'aria-label'); + + // Reuse the original input[type=checkbox] directive from Angular core. + // This is a bit hacky as we need our own event listener and own render + // function. + inputDirective.link.pre(scope, { + on: angular.noop, + 0: {} + }, attr, [ngModelCtrl]); + + scope.mouseActive = false; + element.on('click', listener) + .on('keypress', keypressHandler) + .on('mousedown', function() { + scope.mouseActive = true; + $timeout(function(){ + scope.mouseActive = false; + }, 100); + }) + .on('focus', function() { + if(scope.mouseActive === false) { element.addClass('md-focused'); } + }) + .on('blur', function() { element.removeClass('md-focused'); }); + + ngModelCtrl.$render = render; + + function $$watchExpr(expr, htmlAttr, valueOpts) { + if (attr[expr]) { + scope.$watch(attr[expr], function(val) { + if (valueOpts[val]) { + element.attr(htmlAttr, valueOpts[val]); + } + }); + } + } + + function keypressHandler(ev) { + var keyCode = ev.which || ev.keyCode; + if (keyCode === $mdConstant.KEY_CODE.SPACE || keyCode === $mdConstant.KEY_CODE.ENTER) { + ev.preventDefault(); + if (!element.hasClass('md-focused')) { element.addClass('md-focused'); } + listener(ev); + } + } + function listener(ev) { + if (element[0].hasAttribute('disabled')) return; + + scope.$apply(function() { + // Toggle the checkbox value... + var viewValue = attr.ngChecked ? attr.checked : !ngModelCtrl.$viewValue; + + ngModelCtrl.$setViewValue( viewValue, ev && ev.type); + ngModelCtrl.$render(); + }); + } + + function render() { + if(ngModelCtrl.$viewValue) { + element.addClass(CHECKED_CSS); + } else { + element.removeClass(CHECKED_CSS); + } + } + }; + } +} +MdCheckboxDirective.$inject = ["inputDirective", "$mdInkRipple", "$mdAria", "$mdConstant", "$mdTheming", "$mdUtil", "$timeout"]; + +ng.material.components.checkbox = angular.module("material.components.checkbox");
\ No newline at end of file |