Update project structure

This commit is contained in:
gconsidine
2017-05-10 17:42:52 -04:00
parent 5553a6bcda
commit 725fd15519
82 changed files with 134 additions and 1078 deletions

View File

@@ -0,0 +1,7 @@
.at-ActionGroup {
margin-top: @at-space-6x;
button:last-child {
margin-left: @at-space-5x;
}
}

View File

@@ -0,0 +1,16 @@
function atActionGroup (pathService) {
return {
restrict: 'E',
transclude: true,
replace: true,
templateUrl: pathService.getPartialPath('components/action/action-group'),
scope: {
col: '@',
pos: '@'
}
};
}
atActionGroup.$inject = ['PathService'];
export default atActionGroup;

View File

@@ -0,0 +1,5 @@
<div class="col-xs-{{ col }} at-ActionGroup">
<div class="pull-{{ pos }}">
<ng-transclude></ng-transclude>
</div>
</div>

View File

@@ -0,0 +1,49 @@
let $state;
function applyCancelProperties (scope) {
scope.text = scope.config.text || 'CANCEL';
scope.fill = 'Hollow';
scope.color = 'white';
scope.disabled = false;
scope.action = () => $state.go('^');
}
function applySaveProperties (scope) {
scope.text = 'SAVE';
scope.fill = '';
scope.color = 'green';
scope.disabled = true;
}
function link (scope, el, attrs, form) {
form.use('action', scope, el);
switch(scope.config.type) {
case 'cancel':
applyCancelProperties(scope);
break;
case 'save':
applySaveProperties(scope);
break;
}
}
function atFormAction (_$state_, pathService) {
$state = _$state_;
return {
restrict: 'E',
transclude: true,
replace: true,
require: '^^at-form',
templateUrl: pathService.getPartialPath('components/action/action'),
link,
scope: {
config: '='
}
};
}
atFormAction.$inject = ['$state', 'PathService'];
export default atFormAction;

View File

@@ -0,0 +1,4 @@
<button class="btn at-Button{{ fill }}--{{ color }}" ng-disabled="disabled"
ng-class="{ 'at-Button--disabled': disabled }" ng-click="action()">
{{ text }}
</button>