angular-lte
Version:
An Angular 1.x implementation of the AdminLTE admin template
443 lines (343 loc) • 13.3 kB
JavaScript
/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId])
/******/ return installedModules[moduleId].exports;
/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules[moduleId] = {
/******/ exports: {},
/******/ id: moduleId,
/******/ loaded: false
/******/ };
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/ // Flag the module as loaded
/******/ module.loaded = true;
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = modules;
/******/ // expose the module cache
/******/ __webpack_require__.c = installedModules;
/******/ // __webpack_public_path__
/******/ __webpack_require__.p = "";
/******/ // Load entry module and return exports
/******/ return __webpack_require__(0);
/******/ })
/************************************************************************/
/******/ ([
/* 0 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
__webpack_require__(1);
__webpack_require__(3);
__webpack_require__(6);
__webpack_require__(16);
module.exports = angular.module('angular-lte', ['angular-lte.app', 'angular-lte.sidebar', 'angular-lte.uiElements', 'angular-lte.widgets']);
/***/ },
/* 1 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
module.exports = angular.module('angular-lte.app', []).directive('lteApp', __webpack_require__(2));
/***/ },
/* 2 */
/***/ function(module, exports) {
'use strict';
module.exports = function (AngularLTESidebar) {
return {
restrict: 'A',
scope: {
lteApp: '='
},
link: function link(scope, element, attr) {
if (angular.isObject(scope.lteApp)) {
AngularLTESidebar.init(scope.lteApp);
};
function swapClasses(element, prefix, oldClass, newClass) {
element.removeClass(prefix + oldClass);
element.addClass(prefix + newClass);
}
scope.$watch(function () {
return AngularLTESidebar.getConfig();
}, function (newConfig, oldConfig) {
swapClasses(element, 'sidebar-', oldConfig.sidebar, newConfig.sidebar);
swapClasses(element, 'skin-', oldConfig.skin, newConfig.skin);
if (newConfig.collapse) {
element.addClass('sidebar-collapse');
} else {
element.removeClass('sidebar-collapse');
}
}, true);
}
};
};
/***/ },
/* 3 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
module.exports = angular.module('angular-lte.sidebar', []).component('lteSidebar', __webpack_require__(4)).service('AngularLTESidebar', __webpack_require__(5));
/***/ },
/* 4 */
/***/ function(module, exports) {
"use strict";
module.exports = {
template: "\n <aside class=\"main-siderbar\">\n <section class=\"sidebar\" style=\"height: auto;\">\n \n </section>\n </aside>\n "
};
/***/ },
/* 5 */
/***/ function(module, exports) {
'use strict';
module.exports = function () {
var _this = this;
this.config = {
collapse: false,
skin: 'blue'
};
this.collapseSidebar = function () {
_this.config.collapse = !_this.config.collapse;
};
this.getConfig = function () {
return _this.config;
};
this.setSkin = function (skin) {
_this.config.skin = skin;
};
this.init = function (options) {
angular.extend(this.config, options);
};
};
/***/ },
/* 6 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
__webpack_require__(7);
__webpack_require__(12);
__webpack_require__(14);
module.exports = angular.module('angular-lte.widgets', ['angular-lte.widgets.box', 'angular-lte.widgets.smallBox', 'angular-lte.widgets.infoBox']);
/***/ },
/* 7 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
module.exports = angular.module('angular-lte.widgets.box', []).component('lteBox', __webpack_require__(8)).component('lteBoxHeader', __webpack_require__(9)).component('lteBoxToolBadge', __webpack_require__(10)).component('lteBoxToolButton', __webpack_require__(11));
/***/ },
/* 8 */
/***/ function(module, exports) {
"use strict";
module.exports = {
template: "\n <div class=\"box\" \n ng-class=\"[{'box-solid': $ctrl.solid, 'collapsed-box': $ctrl.collapsed}, $ctrl.boxStyle]\"\n ng-hide=\"$ctrl.closed\">\n <div ng-transclude></div>\n <div ng-if=\"$ctrl.asyncPending\" class=\"overlay\">\n <i class=\"fa fa-refresh fa-spin\"></i>\n </div>\n </div>\n ",
transclude: true,
bindings: {
boxStyle: "@",
async: "<",
solid: "@",
collapsed: "<",
closed: "<"
},
controller: function controller() {
var _this = this;
this.$onInit = function () {
if (typeof _this.async !== 'undefined') {
_this.asyncPending = true;
_this.async.then(function () {
_this.asyncPending = false;
});
}
};
}
};
/***/ },
/* 9 */
/***/ function(module, exports) {
"use strict";
module.exports = {
template: "\n <div class=\"box-header\"\n ng-class=\"{'with-border': $ctrl.border}\">\n <h3 class=\"box-title\">{{$ctrl.title}}</h3>\n <div class=\"box-tools pull-right\" ng-transclude></div>\n </header>\n ",
require: {
boxCtrl: '^lteBox'
},
transclude: true,
bindings: {
border: "@",
title: "@"
},
controller: function controller() {}
};
/***/ },
/* 10 */
/***/ function(module, exports) {
'use strict';
module.exports = {
template: '\n <span class="badge" ng-class="$ctrl.bg">{{$ctrl.label}}</span>\n ',
require: {
boxCtrl: '^lteBox'
},
bindings: {
bg: '@',
label: '@'
}
};
/***/ },
/* 11 */
/***/ function(module, exports) {
"use strict";
module.exports = {
template: "\n <button type=\"button\" class=\"btn btn-box-tool\" ng-click=\"$ctrl.onClick()\">\n <i class=\"fa\" ng-class=\"$ctrl.icon\"></i>\n </button>\n ",
require: {
boxCtrl: "^lteBox"
},
bindings: {
icon: "=",
onClick: "&"
}
};
/***/ },
/* 12 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
module.exports = angular.module('angular-lte.widgets.smallBox', []).component('lteSmallBox', __webpack_require__(13));
/***/ },
/* 13 */
/***/ function(module, exports) {
"use strict";
module.exports = {
template: "\n <div class=\"small-box\" ng-class=\"$ctrl.bg\">\n <div class=\"inner\" ng-transclude></div>\n <div class=\"icon\" ng-if=\"$ctrl.icon\">\n <i class=\"fa\" ng-class=\"$ctrl.icon\"></i>\n </div>\n <a href=\"#\" class=\"small-box-footer\" ng-click=\"$ctrl.onFooterClick()\">\n {{$ctrl.footerLabel}}\n <i class=\"fa fa-arrow-circle-right\"></i>\n </a>\n </div>\n ",
transclude: true,
bindings: {
bg: "@",
icon: "@",
footerLabel: "@",
onFooterClick: "&"
},
controller: function controller() {}
};
/***/ },
/* 14 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
module.exports = angular.module('angular-lte.widgets.infoBox', []).component('lteInfoBox', __webpack_require__(15));
/***/ },
/* 15 */
/***/ function(module, exports) {
"use strict";
module.exports = {
//@TODO hide icon if there is no icon
template: "\n <div class=\"info-box\" ng-class=\"$ctrl.bg\">\n <span class=\"info-box-icon\" ng-class=\"$ctrl.iconBg\">\n <i class=\"fa\" ng-class=\"$ctrl.icon\"></i>\n </span>\n <div class=\"info-box-content\">\n <span class=\"info-box-text\">{{$ctrl.title}}</span>\n <span class=\"info-box-number\">{{$ctrl.number}}</span>\n <div ng-transclude></div>\n </div>\n </div>\n ",
transclude: true,
bindings: {
icon: "@",
bg: "@",
iconBg: "@",
title: "@",
number: "@"
}
};
/***/ },
/* 16 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
__webpack_require__(17);
__webpack_require__(19);
module.exports = angular.module('angular-lte.uiElements', ['angular-lte.uiElements.progress', 'angular-lte.uiElements.tabs']);
/***/ },
/* 17 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
module.exports = angular.module('angular-lte.uiElements.progress', []).component('lteProgress', __webpack_require__(18));
/***/ },
/* 18 */
/***/ function(module, exports) {
"use strict";
module.exports = {
//@TODO Embedding expressions in class attribute is bad practice
template: "\n <div class=\"progress progress-bar-{{$ctrl.size}}\"\n ng-class=\"{vertical: $ctrl.vertical, active: $ctrl.active}\">\n <div class=\"progress-bar progress-bar-{{$ctrl.color}}\"\n ng-class=\"{'progress-bar-striped': $ctrl.striped}\"\n ng-style=\"{width: $ctrl.progress}\"> \n </div> \n </div>\n <span class=\"progress-description\" ng-transclude></span>\n ",
transclude: true,
bindings: {
striped: "@",
color: '@',
progress: "<",
size: "@",
vertical: "@",
active: "<",
onComplete: "&",
onStart: "&"
},
controller: function controller() {}
};
/***/ },
/* 19 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
module.exports = angular.module('angular-lte.uiElements.tabs', []).component('lteTabs', __webpack_require__(20)).component('lteTab', __webpack_require__(21));
/***/ },
/* 20 */
/***/ function(module, exports) {
"use strict";
module.exports = {
template: "\n <div class=\"nav-tabs-custom\">\n <ul class=\"nav nav-tabs\" ng-class=\"$ctrl.orientation\">\n <li ng-repeat=\"tab in $ctrl.tabs\" ng-class=\"{active: tab.active}\" ng-class=\"tab.type\">\n <a href=\"#tab_{{index}}\" ng-click=\"$ctrl.select(tab)\">{{tab.label}}</a>\n </li>\n <li class=\"header\" ng-class=\"$ctrl.headerOrientation\">\n <i class=\"fa fa-th\"></i>\n {{$ctrl.header}}\n </li>\n </ul>\n <div class=\"tab-content\" ng-transclude></div>\n </div>\n ",
transclude: true,
bindings: {
header: "@",
headerOrientation: "@",
icon: "@",
orientation: "@"
},
controller: function controller() {
var _this = this;
this.tabs = [];
this.$postLink = function () {
var active_found = false;
// Ensure that only one tab is active when initializing
// If more than one is active, unactive all the others
angular.forEach(_this.tabs, function (tab) {
if (active_found) {
tab.active = false;
} else if (tab.active) {
active_found = true;
}
});
};
this.select = function (tab) {
angular.forEach(_this.tabs, function (tab) {
tab.active = false;
});
tab.active = true;
};
this.addTab = function (tab) {
_this.tabs.push(tab);
};
}
};
/***/ },
/* 21 */
/***/ function(module, exports) {
"use strict";
module.exports = {
template: "\n <div class=\"tab-content\">\n <div class=\"tab-pane\" ng-class=\"{active: $ctrl.config.active}\" ng-transclude></div>\n </div>\n ",
require: {
tabsCtrl: '^lteTabs'
},
transclude: true,
bindings: {
active: "@",
label: "@",
onEnter: "&",
onLeave: "&"
},
controller: function controller($scope) {
var _this = this;
this.config = {};
this.$onInit = function () {
_this.config = {
type: 'tab',
label: _this.label,
active: _this.active
};
_this.tabsCtrl.addTab(_this.config);
};
}
};
/***/ }
/******/ ]);