Directorio @salix eliminado

This commit is contained in:
Juan Ferrer Toribio 2017-01-31 14:14:55 +01:00
parent abf6a6c142
commit bb4205ad12
219 changed files with 4 additions and 4812 deletions

View File

@ -1,3 +1,4 @@
node_modules
spliting.js
build
npm-debug.log

6
.vscode/launch.json vendored
View File

@ -1,7 +1,6 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "Iniciar",
"type": "node",
@ -44,10 +43,10 @@
"outFiles": []
},
{
"name": "Iniciar node-server",
"name": "Loopback",
"type": "node",
"request": "launch",
"program": "${workspaceRoot}\\@salix-services\\salix\\server\\server.js",
"program": "${workspaceRoot}/services/client/server/server.js",
"stopOnEntry": false,
"args": [],
"cwd": "${workspaceRoot}",
@ -83,6 +82,5 @@
"sourceMaps": false,
"outFiles": []
}
]
}

View File

@ -1 +0,0 @@
node_modules

View File

@ -1 +0,0 @@
export * from './src/app'

View File

@ -1,10 +0,0 @@
{
"name": "@salix/app",
"version": "0.0.0",
"description": "",
"main": "index.js",
"repository": {
"type": "git",
"url": "http://git.verdnatura.es:/salix"
}
}

View File

@ -1,20 +0,0 @@
import './module';
import './spliting';
import './configroutes';
import './config';
import './run';
import './components';
import './styles/title.css';
import './styles/layout.css';
import './styles/margin.scss';
import './styles/padding.scss';
import './styles/background.scss';
import './styles/border.scss';
import './styles/font-style.scss';
import './styles/misc.scss';
import './styles/display.css';
import {bootstrap} from './bootstrap';
bootstrap();

View File

@ -1,17 +0,0 @@
import {ng} from 'vendor';
import {NAME as SALIX} from './module';
export const bootstrap = () => {
const selector = 'selector'
let _script = document.currentScript || (() => {
let scripts = document.getElementsByTagName('script');
return scripts[scripts.length - 1];
})();
let _element = _script && document.querySelector(_script.getAttribute(selector));
if (!_element) {
throw new Error("element is not defined");
}
ng.bootstrap(_element, [SALIX]);
};

View File

@ -1,7 +0,0 @@
export {NAME as APP, COMPONENT as APP_COMPONENT} from './components/app/app';
export {NAME as VN_MAINMENU, COMPONENT as VN_MAINMENU_COMPONENT} from './components/main-menu/main-menu';
export {NAME as ACTIONS, COMPONENT as ACTIONS_COMPONENT} from './components/left-menu/actions';
export {NAME as LEFT_MENU, COMPONENT as LEFTMENU_COMPONENT} from './components/left-menu/left-menu';
export {NAME as MENU_ITEM, COMPONENT as MENU_ITEM_COMPONENT} from './components/left-menu/menu-item';
export {NAME as TOPBAR, COMPONENT as TOPBAR_COMPONENT} from './components/topbar/topbar';
export {NAME as SEARCHBAR, COMPONENT as SEARCHBAR_COMPONENT} from './components/searchbar/searchbar';

View File

@ -1,8 +0,0 @@
<vn-vertical full-height class="bg-content">
<vn-topbar vn-empty>
<vn-spinner enable="$root.loading"></vn-spinner>
<vn-snackbar></vn-snackbar>
<vn-main-menu></vn-main-menu>
</vn-topbar>
<vn-vertical vn-auto ui-view scrollable class="main-view"></vn-vertical>
</vn-vertical>

View File

@ -1,58 +0,0 @@
require('./style.css');
import {module} from '../../module';
export const NAME = 'vnApp';
export const COMPONENT = {
template: require('./app.html')
};
module.component(NAME, COMPONENT);
vnAppLogger.$inject = ['$document'];
function vnAppLogger($document) {
return {
showMessage: function (message) {
let snackbar = $document.find('vn-snackbar').controller('vnSnackbar');
snackbar.show({message: message});
},
showError: function(message) {
this.showMessage(`Error: ${message}`);
}
}
}
module.provider('vnAppLogger', function() {this.$get = vnAppLogger;});
vnAppInterceptor.$inject = ['$q', '$rootScope', 'vnAppLogger'];
function vnAppInterceptor($q, $rootScope, logger) {
$rootScope.loading = false;
return {
request: function(config) {
$rootScope.loading = true;
return config;
},
requestError: function(rejection) {
return $q.reject(rejection);
},
response: function(response) {
switch (response.config.method) {
case 'PUT':
case 'POST':
logger.showMessage('Data saved!');
}
$rootScope.loading = false;
return response;
},
responseError: function(rejection) {
$rootScope.loading = false;
let message = rejection.data.error.message;
logger.showError(message);
return $q.reject(rejection);
}
};
}
module.factory('vnAppInterceptor', vnAppInterceptor);
interceptorConfig.$inject = ['$httpProvider'];
function interceptorConfig($httpProvider) {
$httpProvider.interceptors.push('vnAppInterceptor');
}
module.config(interceptorConfig);

View File

@ -1,18 +0,0 @@
body {
height: 100%;
}
vn-app {
display: block;
height: 100%;
}
vn-app vn-spinner {
display: block;
padding: 1em;
}
.main-view > * {
height: 100%;
overflow: auto;
}

View File

@ -1,5 +0,0 @@
<vn-horizontal>
<ul style="list-style-type: none; margin: 0; padding: 0; width: 100%; color: #666;">
<vn-menu-item ng-repeat="item in action.items" item = "item"></vn-menu-item>
</ul>
</vn-horizontal>

View File

@ -1,12 +0,0 @@
import template from './actions.html';
import {module} from '../../module';
export const NAME = 'vnActions';
export const COMPONENT = {
template: template,
controllerAs: "action",
bindings: {
items: '<'
}
};
module.component(NAME, COMPONENT);

View File

@ -1,5 +0,0 @@
<vn-card >
<vn-vertical pad-medium-top pad-medium-bottom>
<vn-actions items = "menu.items"></vn-actions>
</vn-vertical>
</vn-card>

View File

@ -1,13 +0,0 @@
require('./style.css');
import template from './left-menu.html';
import {module} from '../../module';
export const NAME = "vnLeftMenu";
export const COMPONENT = {
template: template,
controllerAs: "menu",
bindings: {
items: '<'
}
};
module.component(NAME, COMPONENT);

View File

@ -1,7 +0,0 @@
<li>
<a ui-sref="{{menu.item.href}}" style="display: block; text-decoration: none; color: inherit; padding: .5em 2em;">
<i class="material-icons" style="float: right; margin-left: .4em;">keyboard_arrow_right</i>
<i class="material-icons" style="vertical-align: middle; margin-right: .4em;">{{menu.item.icon}}</i>
<span>{{menu.item.description}}</span>
</a>
</li>

View File

@ -1,12 +0,0 @@
import template from './menu-item.html';
import {module} from '../../module';
export const NAME = 'vnMenuItem';
export const COMPONENT = {
template: template,
controllerAs: "menu",
bindings: {
item: '<'
}
};
module.component(NAME, COMPONENT);

View File

@ -1,4 +0,0 @@
vn-menu-item a:hover {
color: white !important;
background-color: #424242;
}

View File

@ -1,15 +0,0 @@
<div style="position: fixed; top: 0; right: 0; padding: .8em 1.5em; z-index: 10;">
<vn-icon icon="apps" id="apps" translate-attr="{title: 'Applications'}"></vn-icon>
<vn-icon icon="notifications" translate-attr="{title: 'Notifications'}"></vn-icon>
<vn-icon icon="language" translate-attr="{title: 'Change language'}" ng-click="mainMenu.onChangeLanguage()"></vn-icon>
<vn-icon icon="exit_to_app" translate-attr="{title: 'Logout'}" ng-click="mainMenu.onLogoutClick()"></vn-icon>
<vn-icon icon="account_circle" translate-attr="{title: 'Profile'}" style="font-size: 35px;"></vn-icon>
<!--
<vn-popover pad-medium for="apps">
<a ui-sref="clients"><vn-icon icon=""></vn-icon></a>
</vn-popover>
-->
<ul class="mdl-menu mdl-js-menu mdl-menu--bottom-right user-menu" pad-medium for="apps">
<a ui-sref="clients"><vn-icon icon="person"></vn-icon></a>
</ul>
</div>

View File

@ -1,25 +0,0 @@
require('./style.css');
import template from './main-menu.html';
import {module} from '../../module';
export const NAME = 'vnMainMenu';
export const COMPONENT = {
template: template,
controllerAs: "mainMenu",
controller: controller
};
module.component(NAME, COMPONENT);
controller.$inject = ['$translate'];
function controller($translate, $translatePartialLoader) {
this.onLogoutClick = function() {
let appName = 'salix';
document.cookie = `${appName}-session=; expires=Thu, 01 Jan 1970 00:00:01 GMT;`;
window.location = `/account?api_key=${appName}`;
};
this.onChangeLanguage = function() {
let lang = $translate.use() == 'en' ? 'es' : 'en';
$translate.use(lang);
console.log (`Locale changed: ${lang}`);
};
}

View File

@ -1,10 +0,0 @@
vn-main-menu vn-icon {
padding: .1em;
border-radius: .1em;
vertical-align: middle;
font-size: 24px;
}
vn-main-menu vn-icon:hover {
cursor: pointer;
opacity: .85;
}

View File

@ -1,12 +0,0 @@
<form ng-submit="$ctrl.search()">
<vn-horizontal>
<vn-textfield vn-one label="Search" model="$ctrl.model.search"></vn-textfield>
<vn-icon
ng-if="$ctrl.advanced"
ng-click="$ctrl.onClick($event)"
icon="keyboard_arrow_down"
style="cursor: pointer;">
</vn-icon>
<vn-icon-button icon="search"></vn-icon-button>
</vn-horizontal>
</form>

View File

@ -1,34 +0,0 @@
import {module} from '../../module';
require('./style.css');
export const NAME = 'vnSearchbar'
export const COMPONENT = {
template: require('./searchbar.html'),
bindings: {
model: '<',
search: '&',
advanced: '=',
popover: '@'
},
controller: controller
};
module.component(NAME, COMPONENT);
controller.$inject = ['$element', '$scope', '$document', '$compile', 'vnPopover'];
function controller($element, $scope, $document, $compile, popover) {
this.onClick = function(event) {
var child = $document[0].createElement(this.popover);
$compile(child)($scope);
popover.show(child, $element[0]);
// XXX: ¿Existe una forma más adecuada de acceder al controlador de un componente?
var childCtrl = angular.element(child).isolateScope().$ctrl;
childCtrl.onSubmit = () => {
popover.hide();
this.model.params = childCtrl.filter;
this.search();
};
event.preventDefault();
};
}

View File

@ -1,2 +0,0 @@
<header class="bg-dark-bar" style="height: 4.2em; color: white;" ng-transclude>
</header>

View File

@ -1,8 +0,0 @@
import {module} from '../../module';
export const NAME = 'vnTopbar';
export const COMPONENT = {
template: require('./topbar.html'),
transclude: true
};
module.component(NAME, COMPONENT);

View File

@ -1,8 +0,0 @@
import {module} from './module';
config.$inject = ['$translatePartialLoaderProvider'];
export function config($translatePartialLoaderProvider) {
$translatePartialLoaderProvider.addPart('app');
$translatePartialLoaderProvider.addPart('crud');
}
module.config(config);

View File

@ -1,52 +0,0 @@
import * as core from 'core';
import './spliting';
import * as deps from './spliting/deps.json';
function loader(module) {
load.$inject = ['$ocLazyLoad', '$q'];
function load($ocLazyLoad, $q) {
return $q((resolve) => {
core.splitingRegister.execute(module).then(function (dependencies) {
var array = dependencies.map((item) => { return { name: item } });
resolve($ocLazyLoad.load(array));
});
});
}
return load;
}
config.$inject = ['$stateProvider', '$urlRouterProvider'];
function config($stateProvider, $urlRouterProvider) {
core.splitingRegister.registerGraph(deps);
$urlRouterProvider.otherwise('/clients');
function getParams(route) {
let params = "",
temporalParams = [];
if (!route.params) {
return params;
}
Object.keys(route.params).forEach(key => {
temporalParams.push(key + `= "${route.params[key]}"`);
});
return temporalParams.join(" ");
}
for (let file in routes) {
let fileRoutes = routes[file].routes;
let module = routes[file].module;
fileRoutes.forEach(function(route) {
$stateProvider.state(route.state, {
url: route.url,
template: `<${route.component} ${getParams(route)}></${route.component}>`,
resolve: {
loader: loader(module)
}
});
});
}
}
core.module.config(config);

View File

@ -1,7 +0,0 @@
{
"Applications": "Applications",
"Notifications":"Notifications",
"Logout": "Logout",
"Change language": "Change language",
"Profile": "Profile"
}

View File

@ -1,7 +0,0 @@
{
"Applications": "Aplicaciones",
"Notifications":"Notificaciones",
"Logout": "Cerrar sesión",
"Change language": "Cambiar idioma",
"Profile": "Perfil"
}

View File

@ -1,6 +0,0 @@
import * as vendors from 'vendor';
import * as core from 'core';
import {NAME as CORE} from 'core';
export const NAME = 'salix';
export const module = vendors.ng.module(NAME, [CORE]);

View File

@ -1,10 +0,0 @@
{
"name": "@salix/core",
"version": "0.0.0",
"description": "",
"main": "index.js",
"repository": {
"type": "git",
"url": "http://git.verdnatura.es:/salix"
}
}

View File

@ -1,14 +0,0 @@
import {module} from './module';
const HOOK_ABORTED_TRANSITION = 3;
run.$inject = ['$rootScope', '$state'];
export function run ($rootScope, $state) {
$rootScope.$on('$viewContentLoaded', () => {});
window.myAppErrorLog = [];
$state.defaultErrorHandler(function(error) {
if (error.type === HOOK_ABORTED_TRANSITION)
window.myAppErrorLog.push(error);
});
}
module.run(run);

View File

@ -1,4 +0,0 @@
{
"app": ["crud"],
"crud": []
}

View File

@ -1 +0,0 @@
import * as core from 'core';

View File

@ -1,11 +0,0 @@
export const $module = () => {
return new Promise(resolve => {
require.ensure([], () => {
require('$module');
resolve('$module');
}, '$module');
});
};
core.splitingRegister.register('$module', $module);

View File

@ -1,36 +0,0 @@
@import "colors";
$bg-main: $color-green;
$bg-minor: $color-orange;
$bg-content: $color-light-grey;
$bg-panel: $color-white;
$bg-dark-bar: $color-dark;
$bg-dark-menu: $color-dark-grey;
html [bg-main], .bg-main {
background-color: $bg-main;
}
html [bg-minor], .bg-minor {
background-color: $bg-minor;
}
html [bg-content], .bg-content {
background-color: $bg-content;
}
html [bg-panel], .bg-panel {
background-color: $bg-panel;
}
html [bg-dark-bar], .bg-dark-bar {
background-color: $bg-dark-bar;
}
html [bg-dark-menu], .bg-dark-menu {
background-color: darken($bg-dark-menu, 35%);
}
/* Color para items seleccionados */
.bg-dark-item{
background-color: $bg-dark-bar;
color: $color-white;
}
/* Color para items inactivos */
.bg-opacity-item{
opacity: 0.6;
}

View File

@ -1,45 +0,0 @@
@import "colors";
$border-color: #AAA;
$border-thin: 1px;
$border-thick: 2px;
html [border-none], .border-none {
border: 0;
}
/* Solid border */
html [border-solid], .border-solid {
border: $border-thin solid $border-color;
}
html [border-solid-top], .border-solid-top {
border-top: $border-thin solid $border-color;
}
html [border-solid-left], .border-solid-left {
border-left: $border-thin solid $border-color;
}
html [border-solid-right], .border-solid-right {
border-right: $border-thin solid $border-color;
}
html [border-solid-bottom], .border-solid-bottom {
border-bottom: $border-thin solid $border-color;
}
/* Dashed border */
html [border-dashed], .border-dashed {
border: $border-thin dashed $border-color;
}
html [border-dashed-top], .border-dashed-top {
border-top: $border-thin dashed $border-color;
}
html [border-dashed-left], .border-dashed-left {
border-left: $border-thin dashed $border-color;
}
html [border-dashed-right], .border-dashed-right {
border-right: $border-thin dashed $border-color;
}
html [border-dashed-bottom], .border-dashed-bottom {
border-bottom: $border-thin dashed $border-color;
}

View File

@ -1,7 +0,0 @@
$color-green: rgb(139,195,74);
$color-orange: rgb(255,171,64);
$color-white: white;
$color-dark: #3c393b;
$color-dark-grey: #424242;
$color-light-grey: #e6e6e6;

View File

@ -1,52 +0,0 @@
.display-block{
display: block;
}
/*angular-paging*/
.well {
min-height: 20px;
padding: 19px;
margin-bottom: 20px;
background-color: #f5f5f5;
border: 1px solid #e3e3e3;
border-radius: 4px;
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .05);
box-shadow: inset 0 1px 1px rgba(0, 0, 0, .05);
}
.pagination {
display: inline-block;
padding-left: 0;
margin: 20px 0;
border-radius: 4px;
}
.pagination > li {
display: inline;
}
.pagination > li > a,
.pagination > li > span {
position: relative;
float: left;
padding: 6px 12px;
margin-left: -1px;
line-height: 1.42857143;
color: #337ab7;
text-decoration: none;
background-color: #fff;
border: 1px solid #ddd;
}
.pagination > li:first-child > a,
.pagination > li:first-child > span {
margin-left: 0;
border-top-left-radius: 4px;
border-bottom-left-radius: 4px;
}
.form-group {
margin-bottom: 15px;
}
.pagination>li.active>a {
background: #4f94ce;
color: #fff;
}
ul.pagination li a:hover:not(.active) {background-color: #ddd;}
/* fin angular-paging*/

View File

@ -1,21 +0,0 @@
@font-face {
font-family: raleway-italic;
src: url(./fonts/Raleway-Italic.ttf);
}
@font-face {
font-family: raleway-thin;
src: url(./fonts/Raleway-Thin.ttf);
}
@font-face {
font-family: raleway-regular;
src: url(./fonts/Raleway-Regular.ttf);
}
@font-face {
font-family: raleway-bold;
src: url(./fonts/Raleway-Bold.ttf);
}
@font-face {
font-family: raleway-semi-bold;
src: url(./fonts/Raleway-SemiBold.ttf);
}

View File

@ -1,12 +0,0 @@
@import "colors";
@import "font-family";
$font-color: $color-dark-grey;
body {
color: $font-color;
font-family: raleway-regular;
}
html [uppercase], .uppercase {
text-transform: uppercase;
}

View File

@ -1,110 +0,0 @@
html, body {
height: 100%;
margin: 0px;
padding: 0px;
}
html [full-height], .full-height {
height: 100%;
}
html [self-scroll], .self-scroll {
overflow: auto;
}
/* Horizontal & vertical */
html [vn-horizontal], vn-horizontal, .vn-horizontal,
html [vn-vertical], vn-vertical, .vn-vertical {
display: flex;
}
html [vn-horizontal], vn-horizontal, .vn-horizontal {
flex-direction: row;
}
vn-horizontal[reverse] {
flex-direction: row-reverse;
}
html [vn-vertical], vn-vertical, .vn-vertical {
flex-direction: column;
}
vn-vertical[reverse] {
flex-direction: column-reverse;
}
html [wrap] {
flex-wrap: wrap;
}
html [wrap-reverse] {
flex-wrap: wrap-reverse;
}
html [scrollable] {
min-height: 1px;
flex: 1;
flex-basis: 0.000000001px;
}
/* Horizontal & vertical childs */
html [vn-auto],
html [vn-none],
html [vn-one],
html [vn-two],
html [vn-three],
html [vn-four],
html [vn-five],
html [vn-six],
html [vn-seven],
html [vn-eight],
html [vn-nine],
html [vn-ten],
html [vn-eleven],
html [vn-twelve]{
flex-basis: 0.000000001px;
}
html [vn-auto], vn-auto, .vn-auto {
flex: 1;
flex-basis: auto;
}
html [vn-empty], vn-empty, .vn-empty {
display: block;
}
html [vn-none], vn-none, .vn-none {
flex: 1;
flex: none;
}
html [vn-one], vn-one, .vn-one {
flex: 1;
}
html [vn-two], vn-two, .vn-two {
flex: 2;
}
html [vn-three], vn-three, .vn-three {
flex: 3;
}
html [vn-four], vn-four, .vn-four {
flex: 4;
}
html [vn-five], vn-five, .vn-five {
flex: 5;
}
html [vn-six], vn-six, .vn-six {
flex: 6;
}
html [vn-seven], vn-seven, .vn-seven {
flex: 7;
}
html [vn-eight], vn-eight, .vn-eight {
flex: 8;
}
html [vn-nine], vn-nine, .vn-nine {
flex: 9;
}
html [vn-ten], vn-ten, .vn-ten {
flex: 10;
}
html [vn-eleven], vn-eleven, .vn-eleven {
flex: 11;
}
html [vn-twelve], vn-twelve, .vn-twelve {
flex: 12;
}

View File

@ -1,89 +0,0 @@
$margin-none: 0;
$margin-small: 8px;
$margin-medium: 16px;
$margin-large: 32px;
/* None */
html [margin-none], .margin-none {
margin: $margin-none;
}
/* Small */
html [margin-small], .margin-small {
margin: $margin-small;
}
html [margin-small-top], .margin-small-top {
margin-top: $margin-small;
}
html [margin-small-left], .margin-small-left {
margin-left: $margin-small;
}
html [margin-small-right], .margin-small-right {
margin-right: $margin-small;
}
html [margin-small-bottom], .margin-small-bottom {
margin-bottom: $margin-small;
}
html [margin-small-v], .margin-small-v {
margin-top: $margin-small;
margin-bottom: $margin-small;
}
html [margin-small-h], .margin-small-h {
margin-left: $margin-small;
margin-right: $margin-small;
}
/* Medium */
html [margin-medium], .margin-medium {
margin: $margin-medium;
}
html [margin-medium-top], .margin-medium-top {
margin-top: $margin-medium;
}
html [margin-medium-left], .margin-medium-left {
margin-left: $margin-medium;
}
html [margin-medium-right], .margin-medium-right {
margin-right: $margin-medium;
}
html [margin-medium-bottom], .margin-medium-bottom {
margin-bottom: $margin-medium;
}
html [margin-medium-v], .margin-medium-v {
margin-top: $margin-medium;
margin-bottom: $margin-medium;
}
html [margin-medium-h], .margin-medium-h {
margin-left: $margin-medium;
margin-right: $margin-medium;
}
/* Large */
html [margin-large], .margin-large {
margin: $margin-large;
}
html [margin-large-top], .margin-large-top {
margin-top: $margin-large;
}
html [margin-large-left], .margin-large-left {
margin-left: $margin-large;
}
html [margin-large-right], .margin-large-right {
margin-right: $margin-large;
}
html [margin-large-bottom], .margin-large-bottom {
margin-bottom: $margin-large;
}
html [margin-large-v], .margin-large-v {
margin-top: $margin-large;
margin-bottom: $margin-large;
}
html [margin-large-h], .margin-large-h {
margin-left: $margin-large;
margin-right: $margin-large;
}

View File

@ -1,29 +0,0 @@
@import "padding";
@import "margin";
.form {
height: 100%;
box-sizing: border-box;
padding: $pad-large;
max-width: 1000px;
}
form vn-horizontal > * {
padding: 0 .4em;
}
form vn-horizontal > *:first-child {
padding-left: 0;
}
form vn-horizontal > *:last-child {
padding-right: 0;
}
html [fixed-bottom-right] {
position: fixed;
bottom: 2em;
right: 2em;
}
vn-button-bar {
display: block;
margin-top: $margin-small;
}

View File

@ -1,89 +0,0 @@
$pad-none: 0;
$pad-small: 8px;
$pad-medium: 16px;
$pad-large: 32px;
/* None */
html [pad-none], .pad-none {
padding: $pad-none;
}
/* Small */
html [pad-small], .pad-small {
padding: $pad-small;
}
html [pad-small-left], .pad-small-left {
padding-left: $pad-small;
}
html [pad-small-right], .pad-small-right {
padding-right: $pad-small;
}
html [pad-small-top], .pad-small-top {
padding-top: $pad-small;
}
html [pad-small-bottom], .pad-small-bottom {
padding-bottom: $pad-small;
}
html [pad-small-v], .pad-small-v {
padding-top: $pad-small;
padding-bottom: $pad-small;
}
html [pad-small-h], .pad-small-h {
padding-left: $pad-small;
padding-right: $pad-small;
}
/* Medium */
html [pad-medium], .pad-medium {
padding: $pad-medium;
}
html [pad-medium-left], .pad-medium-left {
padding-left: $pad-medium;
}
html [pad-medium-right], .pad-medium-right {
padding-right: $pad-medium;
}
html [pad-medium-top], .pad-medium-top {
padding-top: $pad-medium;
}
html [pad-medium-bottom], .pad-medium-bottom {
padding-bottom: $pad-medium;
}
html [pad-medium-v], .pad-medium-v {
padding-top: $pad-medium;
padding-bottom: $pad-medium;
}
html [pad-medium-h], .pad-medium-h {
padding-left: $pad-medium;
padding-right: $pad-medium;
}
/* Large */
html [pad-large], .pad-large {
padding: $pad-large;
}
html [pad-large-left], .pad-large-left {
padding-left: $pad-large;
}
html [pad-large-right], .pad-large-right {
padding-right: $pad-large;
}
html [pad-large-top], .pad-large-top {
padding-top: $pad-large;
}
html [pad-large-bottom], .pad-large-bottom {
padding-bottom: $pad-large;
}
html [pad-large-v], .pad-large-v {
padding-top: $pad-large;
padding-bottom: $pad-large;
}
html [pad-large-h], .pad-large-h {
padding-left: $pad-large;
padding-right: $pad-large;
}

View File

@ -1,30 +0,0 @@
h1 {
font-size: 32pt;
font-family: raleway-semi-bold;
}
h2 {
font-size: 28pt;
font-family: raleway-semi-bold;
}
h3 {
font-size: 24pt;
font-family: raleway-semi-bold;
}
h4 {
font-size: 20pt;
font-family: raleway-semi-bold;
}
h5 {
font-size: 16pt;
font-family: raleway-semi-bold;
}
h6 {
font-size: 12pt;
font-family: raleway-semi-bold;
}
h1, h2, h3, h4, h5, h6 {
padding: 0;
margin: .4em 0;
}

View File

@ -1,2 +0,0 @@
export * from './src/core'

View File

@ -1,10 +0,0 @@
{
"name": "@salix/core",
"version": "0.0.0",
"description": "",
"main": "index.js",
"repository": {
"type": "git",
"url": "http://git.verdnatura.es:/salix"
}
}

View File

@ -1 +0,0 @@
node_modules

View File

@ -1,368 +0,0 @@
import {module} from '../module';
export {factory as mdlFactory} from './index.mdl';
require('./style.scss');
export const component = {
transclude: true,
bindings: {
url: '@',
showField: '@',
valueField: '@',
model: '='
},
template: template,
controller: controller
};
module.component('vnAutocomplete', component);
template.$inject = ['$element', '$attrs', 'vnInputAttrsNormalizer', 'vnResolveDefaultComponent'];
function template($element, $attrs, normalizer, resolve) {
normalizer.normalize($attrs);
return resolve.getTemplate('autocomplete', $attrs);
}
controller.$inject = ['$http', '$element', '$attrs', '$scope', '$parse', '$document', 'vnPopover'];
function controller($http, $element, $attrs, $scope, $parse, $document, popoverProvider) {
let locked = false;
$scope.$watch($attrs.model, (newValue) => {
if(!locked) {
locked = true;
this.setValue(newValue);
locked = false;
}
});
componentHandler.upgradeElement($element[0].firstChild);
function mdlUpdate() {
let mdlField = $element[0].firstChild.MaterialTextfield;
if (mdlField)
mdlField.updateClasses_();
}
Object.assign(this, {
init: function() {
this.input = $element[0].querySelector('input');
this.item = null;
this.data = null;
this.popover = null;
this.popoverData = null;
this.timeoutId = null;
this.lastSearch = null;
this.lastRequest = null;
this.currentRequest = null;
this.moreData = false;
this.activeOption = -1;
this.maxRows = 10;
this.requestDelay = 350;
this.requestItem();
},
loadData: function(textFilter) {
textFilter = textFilter ? textFilter : '';
if(this.lastSearch === textFilter) {
this.popoverDataReady();
return;
}
this.lastSearch = textFilter;
let lastRequest = this.lastRequest;
let requestWillSame = lastRequest !== null
&& !this.moreData
&& textFilter.substr(0, lastRequest.length) === lastRequest;
if(requestWillSame)
this.localFilter(textFilter);
else
this.requestData(textFilter, false);
},
getRequestFields: function() {
let fields = {};
fields[this.valueField] = true;
fields[this.showField] = true;
return fields;
},
requestData: function(textFilter, append) {
let where = {};
let skip = 0;
if(textFilter)
where[this.showField] = {ilike: textFilter};
if(append && this.data)
skip = this.data.length;
let filter = {
fields: this.getRequestFields(),
where: where,
order: `${this.showField} ASC`,
skip: skip,
limit: this.maxRows
};
this.lastRequest = textFilter ? textFilter : '';
let json = JSON.stringify(filter);
if(this.currentRequest)
this.currentRequest.resolve();
this.currentRequest = $http.get(`${this.url}?filter=${json}`);
this.currentRequest.then(
json => this.onRequest(json.data, append),
json => this.onRequest([])
);
},
onRequest: function(data, append) {
this.currentRequest = null;
this.moreData = data.length >= this.maxRows;
if(!append || !this.data)
this.data = data;
else
this.data = this.data.concat(data);
this.setPopoverData(this.data);
},
localFilter: function(textFilter) {
let regex = new RegExp(textFilter, 'i');
let data = this.data.filter((item) => {
return regex.test(item[this.showField]);
});
this.setPopoverData(data);
},
setPopoverData: function(data) {
this.popoverData = data;
this.popoverDataReady();
},
popoverDataReady: function() {
if(this.hasFocus)
this.showPopover();
},
showPopover: function() {
if(!this.data) return;
let fragment = $document[0].createDocumentFragment();
let data = this.popoverData;
for(let i = 0; i < data.length; i++) {
let li = $document[0].createElement('li');
li.appendChild($document[0].createTextNode(data[i][this.showField]));
fragment.appendChild(li);
}
if(this.moreData) {
let li = $document[0].createElement('li');
li.appendChild($document[0].createTextNode('Load more'));
li.className = 'load-more';
fragment.appendChild(li);
}
if (!this.popover) {
let popover = $document[0].createElement('ul');
popover.addEventListener('click',
(e) => this.onPopoverClick(e));
popover.addEventListener('mousedown',
(e) => this.onPopoverMousedown(e));
popover.className = 'vn-autocomplete';
popover.appendChild(fragment);
popoverProvider.show(popover, this.input);
this.popover = popover;
}
else {
this.popover.innerHTML = '';
this.popover.appendChild(fragment);
}
},
hidePopover: function() {
if(!this.popover) return;
this.activeOption = -1;
popoverProvider.hide();
this.popover = null;
},
selectPopoverOption: function(index) {
if(!this.popover || index == -1) return;
if(index < this.popoverData.length) {
this.selectOptionByDataIndex(this.popoverData, index);
this.hidePopover();
}
else
this.requestData(this.lastRequest, true);
},
onPopoverClick: function(event) {
let childs = this.popover.childNodes;
for(let i = 0; i < childs.length; i++)
if(childs[i] === event.target) {
this.selectPopoverOption(i);
break;
}
},
onPopoverMousedown: function(event) {
// Prevents input from loosing focus
event.preventDefault();
},
onClick: function(event) {
if(!this.popover)
this.showPopover();
},
onFocus: function() {
this.hasFocus = true;
this.input.select();
if(this.data)
this.showPopover();
else
this.loadData();
},
onBlur: function() {
this.hasFocus = false;
this.restoreShowValue();
this.hidePopover();
},
onKeydown: function(event) {
switch(event.keyCode) {
case 13: // Enter
this.selectPopoverOption(this.activeOption);
break;
case 27: // Escape
this.restoreShowValue();
this.input.select();
break;
case 38: // Arrow up
this.activateOption(this.activeOption-1);
break;
case 40: // Arrow down
this.activateOption(this.activeOption+1);
break;
default:
return;
}
event.preventDefault();
},
onKeyup: function(event) {
if(!this.isKeycodePrintable(event.keyCode)) return;
if(this.timeoutId) clearTimeout(this.timeoutId);
this.timeoutId = setTimeout(() => this.onTimeout(), this.requestDelay);
},
onTimeout: function() {
this.loadData(this.input.value);
this.timeoutId = null;
},
isKeycodePrintable: function(keyCode) {
return keyCode == 32 // Spacebar
|| keyCode == 8 // Backspace
|| (keyCode > 47 && keyCode < 58) // Numbers
|| (keyCode > 64 && keyCode < 91) // Letters
|| (keyCode > 95 && keyCode < 112) // Numpad
|| (keyCode > 185 && keyCode < 193) // ;=,-./`
|| (keyCode > 218 && keyCode < 223); // [\]'
},
restoreShowValue: function() {
this.putItem(this.item);
},
requestItem: function() {
if(!this.model) return;
let where = {};
where[this.valueField] = this.model;
let filter = {
fields: this.getRequestFields(),
where: where,
};
let json = JSON.stringify(filter);
$http.get(`${this.url}?filter=${json}`).then(
json => this.onItemRequest(json.data),
json => this.onItemRequest(null)
);
},
onItemRequest: function(data) {
if(data && data.length > 0)
this.showItem(data[0]);
else
this.showItem(null);
},
activateOption: function(index) {
if(!this.popover)
this.showPopover();
let popover = this.popover;
let childs = popover.childNodes;
let len = this.popoverData.length;
if(this.activeOption >= 0)
childs[this.activeOption].className = '';
if(index >= len)
index = 0;
else if(index < 0)
index = len - 1;
if (index >= 0) {
let opt = childs[index];
let top = popover.scrollTop;
let height = popover.clientHeight;
if(opt.offsetTop + opt.offsetHeight > top + height)
top = opt.offsetTop + opt.offsetHeight - height;
else if(opt.offsetTop < top)
top = opt.offsetTop;
opt.className = 'active';
popover.scrollTop = top;
}
this.activeOption = index;
},
setValue: function(value) {
if(value) {
let data = this.data;
if(data)
for(let i = 0; i < data.length; i++)
if(data[i][this.valueField] == value) {
this.putItem(data[i]);
return;
}
this.requestItem();
}
else
this.putItem(null);
},
selectOptionByIndex: function(index) {
this.selectOptionByDataIndex(this.data, index);
},
selectOptionByDataIndex: function(data, index) {
if(data && index >= 0 && index < data.length)
this.putItem(data[index]);
else
this.putItem(null);
},
putItem: function(item) {
this.showItem(item);
let value = item ? item[this.valueField] : undefined;
if(!locked) {
setTimeout (() => {
$scope.$apply(function () {
locked = true;
$parse($attrs.model).assign($scope, value);
locked = false;
});
});
}
},
showItem: function(item) {
this.input.value = item ? item[this.showField] : '';
this.item = item;
mdlUpdate();
}
});
this.init();
}

View File

@ -1,14 +0,0 @@
<div class="mdl-textfield mdl-js-textfield *[className]*">
<input
class="mdl-textfield__input"
type="text"
rule="*[rule]*"
*[enabled]*
*[focus]*
ng-keydown="$ctrl.onKeydown($event)"
ng-click="$ctrl.onClick($event)"
ng-keyup="$ctrl.onKeyup($event)"
ng-focus="$ctrl.onFocus($event)"
ng-blur="$ctrl.onBlur($event)"/>
<label class="mdl-textfield__label" translate>*[label]*</label>
</div>

View File

@ -1,11 +0,0 @@
import {module} from '../module';
export function factory() {
return {
template: require('./index.mdl.html'),
default: {
className: 'mdl-textfield--floating-label'
}
}
}
module.factory('vnAutocompleteMdlFactory', factory);

View File

@ -1,25 +0,0 @@
ul.vn-autocomplete {
list-style-type: none;
padding: 1em;
margin: 0;
padding: 0;
overflow: auto;
max-height: 300px;
li {
display: block;
padding: .8em;
margin: 0;
cursor: pointer;
&.active,
&:hover {
background-color: rgba(1,1,1,.1);
}
&.load-more {
color: #ffa410;
font-weight: bold;
padding: .4em .8em;
}
}
}

View File

@ -1,2 +0,0 @@
<!-- por definir -->

View File

@ -1,24 +0,0 @@
import {module as _module} from '../module';
import * as util from '../util';
import * as constant from '../constants';
import template from './button.bt.html';
const _NAME = 'button';
const DEFAULT_CLASS = '';
const DEFAULT_TEXT = 'Button';
export const NAME = util.getFactoryName(_NAME + constant.BOOTSTRAP_FRAMEWORK);
export function factory() {
return {
template: template,
default: {
text: DEFAULT_TEXT,
className: DEFAULT_CLASS,
enabled: 'true',
typeName: 'button'
}
}
}
_module.factory(NAME, factory);

View File

@ -1,18 +0,0 @@
import {module as _module} from '../module';
import * as resolveFactory from '../resolveDefaultComponents';
import * as util from '../util';
const _NAME = 'button';
export const NAME = util.getName(_NAME);
directive.$inject = [resolveFactory.NAME];
export function directive(resolve) {
return {
restrict: 'E',
template: function(_, attr) {
return resolve.getTemplate(_NAME, attr);
}
};
}
_module.directive(NAME, directive);

View File

@ -1,3 +0,0 @@
<button type = "*[typeName]*" class="*[className]*" *[enabled]* translate>
*[label]*
</button>

View File

@ -1,21 +0,0 @@
import {module as _module} from '../module';
import * as util from '../util';
import * as constant from '../constants';
import template from './button.mdl.html';
const _NAME = 'button';
export const NAME = util.getFactoryName(_NAME + constant.MATERIAL_DESIGN_FRAMEWORK);
export function factory() {
return {
template: template,
default: {
label: 'Submit',
className: 'mdl-button mdl-js-button mdl-button--raised mdl-button--colored',
enabled: 'true',
typeName: 'button'
}
}
}
_module.factory(NAME, factory);

View File

@ -1,21 +0,0 @@
import {module as _module} from '../module';
import * as resolveFactory from '../resolveDefaultComponents';
import * as util from '../util';
require ('./style.css');
const _NAME = 'card';
export const NAME = util.getName(_NAME);
directive.$inject = [resolveFactory.NAME];
export function directive(resolve) {
return {
restrict: 'E',
transclude: true,
template: function(_, attr) {
return resolve.getTemplate(_NAME, attr);
}
};
}
_module.directive(NAME, directive);

View File

@ -1 +0,0 @@
<div class="demo-card-wide mdl-shadow--2dp bg-panel" *[foo]* ng-transclude></div>

View File

@ -1,16 +0,0 @@
import {module as _module} from '../module';
import * as util from '../util';
import * as constant from '../constants';
import template from './card.mdl.html';
const _NAME = 'card';
export const NAME = util.getFactoryName(_NAME + constant.MATERIAL_DESIGN_FRAMEWORK);
export function factory() {
return {
template: template
}
}
_module.factory(NAME, factory);

View File

@ -1,3 +0,0 @@
vn-card {
display: block;
}

View File

@ -1,2 +0,0 @@
<!-- por definir -->

View File

@ -1 +0,0 @@
// por definir

View File

@ -1,28 +0,0 @@
import {module as _module} from '../module';
import * as resolveFactory from '../resolveDefaultComponents';
import * as normalizerFactory from '../inputAttrsNormalizer';
import * as util from '../util';
const _NAME = 'check';
export const NAME = util.getName(_NAME);
directive.$inject = [resolveFactory.NAME, normalizerFactory.NAME];
export function directive(resolve, normalizer) {
return {
restrict: 'E',
template: function(_, attrs) {
normalizer.normalize(attrs);
return resolve.getTemplate(_NAME, attrs);
},
link: function(scope, element, attrs) {
scope.$watch(attrs.model, () => {
let mdlField = element[0].firstChild.MaterialCheckbox;
if (mdlField)
mdlField.updateClasses_();
});
componentHandler.upgradeElement(element[0].firstChild);
}
};
}
_module.directive(NAME, directive);

View File

@ -1,4 +0,0 @@
<label class="mdl-checkbox mdl-js-checkbox mdl-js-ripple-effect">
<input type="checkbox" name="*[name]*" class="*[className]*" name="*[name]*" ng-model="*[model]*" rule="*[rule]*" *[enabled]* *[focus]*>
<span class="mdl-checkbox__label" translate>*[label]*</span>
</label>

View File

@ -1,21 +0,0 @@
import {module as _module} from '../module';
import * as util from '../util';
import * as constant from '../constants';
import template from './check.mdl.html';
const _NAME = 'check';
const DEFAULT_CLASS = 'mdl-checkbox__input';
export const NAME = util.getFactoryName(_NAME + constant.MATERIAL_DESIGN_FRAMEWORK);
export function factory() {
return {
template: template,
default: {
enabled: 'true',
className: DEFAULT_CLASS
}
};
}
_module.factory(NAME, factory);

View File

@ -1,28 +0,0 @@
import {module as _module} from '../module';
import * as resolveFactory from '../resolveDefaultComponents';
import * as normalizerFactory from '../inputAttrsNormalizer';
import * as util from '../util';
const _NAME = 'combo';
export const NAME = util.getName(_NAME);
directive.$inject = [resolveFactory.NAME, normalizerFactory.NAME];
export function directive(resolve, normalizer) {
return {
restrict: 'E',
transclude: true,
template: function(_, attrs) {
normalizer.normalize(attrs);
return resolve.getTemplate(_NAME, attrs);
},
link: function(scope, element, attrs) {
scope.$watch(attrs.model, () => {
let mdlField = element[0].firstChild.MaterialTextfield;
if (mdlField)
mdlField.updateClasses_();
});
componentHandler.upgradeElement(element[0].firstChild);
}
};
}
_module.directive(NAME, directive);

View File

@ -1,5 +0,0 @@
<div class="mdl-textfield mdl-js-textfield mdl-textfield--floating-label">
<select class="mdl-textfield__input" class="*[className]*" name="*[name]*" ng-model="*[model]*" rule="*[rule]*" *[enabled]* ng-transclude>
</select>
<label class="mdl-textfield__label" translate>*[label]*</label>
</div>

View File

@ -1,14 +0,0 @@
import {module} from '../module';
import template from './combo.mdl.html';
export const NAME = 'vnComboMdlFactory';
export function factory() {
return {
template: template,
default: {
label: 'Label',
enabled: 'enabled'
}
}
}
module.factory(NAME, factory);

View File

@ -1,21 +0,0 @@
import {module} from './module';
config.$inject = ['$translateProvider', '$translatePartialLoaderProvider'];
export function config($translateProvider, $translatePartialLoaderProvider) {
$translatePartialLoaderProvider.addPart('core');
let conf = {urlTemplate: '/static/locale/{part}/{lang}.json'};
let langs = ['en', 'es'];
let localLangs = {
'en_US': 'en',
'en_UK': 'en',
'es_ES': 'es',
'es_AR': 'es'
};
$translateProvider
.useSanitizeValueStrategy('escape')
.useLoader('$translatePartialLoader', conf)
.registerAvailableLanguageKeys(langs, localLangs)
.determinePreferredLanguage();
}
module.config(config);

View File

@ -1,10 +0,0 @@
// Proyect prefix name
export const PREFIX ='vn';
// CSS frameworks
export const MATERIAL_DESIGN_FRAMEWORK = 'Mdl';
export const BOOTSTRAP_FRAMEWORK = 'Bt';
// Module dependencies
export const EMPTY_DEPENDECIES = [];

View File

@ -1,5 +0,0 @@
import {module} from './module';
export const NAME = 'copyObject';
module.value(NAME, angular.copy);

View File

@ -1,62 +0,0 @@
import './mdl-override.css';
export * from './module';
export * from './util';
import './config';
export {SplitingRegister as splitingRegister} from './splitingregister';
export {NAME as RESOLVEDEFAULTCOMPONENT, ResolveDefaultComponent} from './resolveDefaultComponents';
export {NAME as INTERPOLATE, Interpolate} from './interpolate';
export {NAME as ROUTES_LOADER, RoutesLoader} from './routesLoader';
export {NAME as COPY_OBJECT} from './copy';
export {NAME as EQUALS_OBJECT} from './equals';
export {NAME as GET_DATA_MODIFIED, factory as Modified} from './modified';
export {NAME as FOCUS, directive as Focus} from './focus';
export {NAME as RULE, directive as Rule} from './rule';
export {NAME as BUTTON, directive as ButtonDirective} from './button/button';
export {NAME as BUTTON_MDL, factory as buttonMdl} from './button/button.mdl';
export {NAME as BUTTON_BT, factory as buttonBt} from './button/button.bt';
export {NAME as CHECK, directive as CheckDirective} from './check/check';
export {NAME as CHECK_MDL, factory as checknMdl} from './check/check.mdl';
export {NAME as CHECK_BT, factory as checkBt} from './check/check.bt';
export {NAME as RADIO, directive as RadioDirective} from './radio/radio';
export {NAME as RADIO_MDL, factory as radionMdl} from './radio/radio.mdl';
export {NAME as RADIO_BT, factory as radioBt} from './radio/radio.bt';
export {NAME as TEXTAREA, directive as TextareaDirective} from './textarea/textarea';
export {NAME as TEXTAREA_MDL, factory as textareaMdl} from './textarea/textarea.mdl';
export {NAME as TEXTFIELD, directive as TextfieldDirective} from './textfield/textfield';
export {NAME as TEXTFIELD_MDL, factory as textfieldMdl} from './textfield/textfield.mdl';
export {NAME as TEXTFIELD_BT, factory as textfieldBt} from './textfield/textfield.bt';
export {NAME as LABEL, directive as LabelDirective} from './label/label';
export {NAME as LABEL_MDL, factory as labelMdl} from './label/label.mdl';
export {NAME as LABEL_BT, factory as labelBt} from './label/label.bt';
export {NAME as ICON_BUTTON, directive as IconButtonDirective} from './icon-button/icon-button';
export {NAME as ICON_BUTTON_MDL, factory as iconButtonMdl} from './icon-button/icon-button.mdl';
export {NAME as PASSWORD, directive as PasswordDirective} from './password/password';
export {NAME as PASSWORD_MDL, factory as passwordMdl} from './password/password.mdl';
export {NAME as SUBMIT, directive as SubmitDirective} from './submit/submit';
export {NAME as SUBMIT_MDL, factory as submitMdl} from './submit/submit.mdl';
export {NAME as SNACKBAR, directive as SnackbarDirective} from './snackbar/snackbar';
export {NAME as SNACKBAR_MDL, factory as snackbarMdl} from './snackbar/snackbar.mdl';
export {NAME as SPINNER, directive as SpinnerDirective} from './spinner/spinner';
export {NAME as SPINNER_MDL, factory as spinnerMdl} from './spinner/spinner.mdl';
export {NAME as COMBO, directive as ComboDirective} from './combo/combo';
export {NAME as COMBO_MDL, factory as comboMdl} from './combo/combo.mdl';
export {NAME as DATE_PICKER, directive as DatePickerDirective} from './date-picker/date-picker';
export {NAME as DATE_PICKER_MDL, factory as datePickerMdl} from './date-picker/date-picker.mdl';
export {NAME as CARD, directive as CardDirective} from './card/card';
export {NAME as CARD_MDL, factory as cardMdl} from './card/card.mdl';
export {NAME as SWITCH, directive as SwitchDirective} from './switch/switch';
export {NAME as SWITCH_MDL, factory as switchdMdl} from './switch/switch.mdl';
export {NAME as FLOATBUTTON, directive as FloatButtonDirective} from './floatbutton/floatbutton';
export {NAME as FLOATBUTTON_MDL, factory as floatButtondMdl} from './floatbutton/floatbutton.mdl';
export {directive as Icon} from './icon/index';
export {directive as Autocomplete} from './autocomplete/index';
export {directive as Popover} from './popover/index';
export {directive as Dialog} from './dialog/index';
export {component as Title} from './title/index';
export {component as Subtitle} from './subtitle/index';

View File

@ -1,27 +0,0 @@
import {module as _module} from '../module';
import * as resolveFactory from '../resolveDefaultComponents';
import * as normalizerFactory from '../inputAttrsNormalizer';
import * as util from '../util';
const _NAME = 'datePicker';
export const NAME = util.getName(_NAME);
directive.$inject = [resolveFactory.NAME, normalizerFactory.NAME];
export function directive(resolve, normalizer) {
return {
restrict: 'E',
template: function(_, attrs) {
normalizer.normalize(attrs);
return resolve.getTemplate(_NAME, attrs);
},
link: function(scope, element, attrs) {
scope.$watch(attrs.model, () => {
let mdlField = element[0].firstChild.MaterialTextfield;
if (mdlField)
mdlField.updateClasses_();
});
componentHandler.upgradeElement(element[0].firstChild);
}
};
}
_module.directive(NAME, directive);

View File

@ -1,4 +0,0 @@
<div class="mdl-textfield mdl-js-textfield mdl-textfield--floating-label">
<input class="mdl-textfield__input *[className]*" type="text" name="*[name]*" ng-model="*[model]*" rule="*[rule]*" *[enabled]*/>
<label class="mdl-textfield__label" translate>*[label]*</label>
</div>

View File

@ -1,14 +0,0 @@
import {module} from '../module';
import template from './date-picker.mdl.html';
export const NAME = 'vnDatePickerMdlFactory';
export function factory() {
return {
template: template,
default: {
label: 'Label',
enabled: 'enabled'
}
}
}
module.factory(NAME, factory);

View File

@ -1,75 +0,0 @@
import {module} from '../module';
require('./style.css');
directive.$inject = ['vnDialog'];
export function directive(dialog) {
return {
restrict: 'A',
link: function($scope, $element, $attrs, $ctrl) {
$element.on('click', function(event) {
dialog.showComponent($attrs.vnDialog, $scope);
event.preventDefault();
});
}
}
}
module.directive('vnDialog', directive);
provider.$inject = ['$document', '$compile'];
export function provider($document, $compile) {
return {
show: function(childElement) {
let background = $document[0].createElement('div');
background.className = 'vn-background';
background.addEventListener('mousedown',
this.onBackgroundMouseDown.bind(this));
this.background = background;
let dialog = $document[0].createElement('div');
dialog.className = 'vn-dialog';
dialog.addEventListener('mousedown',
this.onDialogMouseDown.bind(this));
dialog.appendChild (childElement);
background.appendChild (dialog);
this.dialog = dialog;
let style = this.dialog.style;
let screenMargin = 20;
let width = dialog.offsetWidth;
let height = dialog.offsetHeight;
let innerWidth = window.innerWidth;
let innerHeight = window.innerHeight;
if(width + screenMargin > innerWidth) {
width = innerWidth - dblMargin;
style.width = width +'px';
}
if(height + screenMargin > innerHeight) {
height = innerHeight - dblMargin;
style.height = height +'px';
}
$document[0].body.appendChild (background);
},
showComponent: function(childComponent, $scope) {
let childElement = $document[0].createElement(childComponent);
$compile(childElement)($scope);
this.show(childElement);
},
hide: function() {
$document[0].body.removeChild (this.background);
this.background = null;
this.dialog = null;
this.lastEvent = null;
},
onDialogMouseDown: function(event) {
this.lastEvent = event;
},
onBackgroundMouseDown: function(event) {
if (event != this.lastEvent)
this.hide();
}
};
}
module.provider('vnDialog', function() {this.$get = provider;});

View File

@ -1,22 +0,0 @@
.vn-dialog {
position: relative;
box-shadow: 0 0 .4em rgba(1,1,1,.4);
background-color: white;
border-radius: .2em;
overflow: auto;
top: 50%;
left: 50%;
width: 400px;
margin-top: -150px;
margin-left: -200px;
}
.vn-background {
z-index: 100;
position: fixed;
left: 0;
top: 0;
height: 100%;
width: 100%;
background-color: rgba(1,1,1,.4);
}

View File

@ -1,5 +0,0 @@
import {module} from './module';
export const NAME = 'equalsObject';
module.value(NAME, angular.equals);

View File

@ -1,19 +0,0 @@
import {module as _module} from '../module';
import * as resolveFactory from '../resolveDefaultComponents';
import * as util from '../util';
const _NAME = 'floatButton';
export const NAME = util.getName(_NAME);
directive.$inject = [resolveFactory.NAME];
export function directive(resolve) {
return {
restrict: 'E',
template: function(_, attr) {
return resolve.getTemplate(_NAME, attr);
}
};
}
_module.directive(NAME, directive);

View File

@ -1,3 +0,0 @@
<button class="*[className]*">
<vn-icon icon="*[icon]*"></vn-icon>
</button>

View File

@ -1,20 +0,0 @@
import {module as _module} from '../module';
import * as util from '../util';
import * as constant from '../constants';
import template from './floatbutton.mdl.html';
const _NAME = 'floatButton';
const DEFAULT_CLASS = 'mdl-button mdl-js-button mdl-button--fab mdl-js-ripple-effect mdl-button--colored';
export const NAME = util.getFactoryName(_NAME + constant.MATERIAL_DESIGN_FRAMEWORK);
export function factory() {
return {
template: template,
default: {
className: DEFAULT_CLASS
}
};
}
_module.factory(NAME, factory);

View File

@ -1,14 +0,0 @@
import {module} from './module';
export const NAME = 'vnFocus';
export function directive() {
return {
restrict: 'A',
link: function($scope, $element, $attrs) {
var input = $element[0];
input.focus();
input.select();
}
};
}
module.directive(NAME, directive);

View File

@ -1,17 +0,0 @@
import {module as _module} from '../module';
import * as resolveFactory from '../resolveDefaultComponents';
import * as util from '../util';
const _NAME = 'iconButton';
export const NAME = util.getName(_NAME);
directive.$inject = [resolveFactory.NAME];
export function directive(resolve) {
return {
restrict: 'E',
template: function(_, attr) {
return resolve.getTemplate(_NAME, attr);
}
};
}
_module.directive(NAME, directive);

View File

@ -1,3 +0,0 @@
<button class="mdl-button mdl-js-button mdl-button--raised mdl-button--colored *[className]*" *[enabled]*>
<vn-icon icon="*[icon]*"></vn-icon>*[label]*
</button>

View File

@ -1,15 +0,0 @@
import {module} from '../module';
import template from './icon-button.mdl.html';
export const NAME = 'vnIconButtonMdlFactory';
export function factory() {
return {
template: template,
default: {
enabled: 'enabled',
icon: '',
label: ''
}
};
}
module.factory(NAME, factory);

View File

@ -1,19 +0,0 @@
import {module} from '../module';
export {factory as mdlFactory} from './index.mdl';
import * as resolveFactory from '../resolveDefaultComponents';
require('./style.css');
const _NAME = 'icon';
export const NAME = 'vnIcon';
export function directive(resolver) {
return {
restrict: 'E',
template: function(_, attrs) {
return resolver.getTemplate(_NAME, attrs);
}
}
}
directive.$inject = [resolveFactory.NAME];
module.directive(NAME, directive);

View File

@ -1 +0,0 @@
<i display-block class="material-icons">*[icon]*</i>

View File

@ -1,12 +0,0 @@
import {module} from '../module';
import template from './index.mdl.html';
export const NAME = 'vnIconMdlFactory';
export function factory() {
return {
template: template,
default: {}
}
}
module.factory(NAME, factory);

View File

@ -1,7 +0,0 @@
vn-icon {
display: inline;
font-size: 18pt;
}
vn-icon > i {
font-size: inherit !important;
}

View File

@ -1,39 +0,0 @@
import {module} from './module';
export const NAME = 'vnInputAttrsNormalizer';
export class InputAttrsNormalizer {
$get() {
return {
normalize: function(attrs) {
if(attrs.field) {
let split = attrs.field.split('.');
let len = split.length;
if(len == 0)
throw new Error (`Attribute 'field' can not be empty`);
if(len > 3)
throw new Error (`Attribute 'field' must have this syntax: [ctrl].[entity].[field]`);
let i = len - 1;
let field = split[i--];
let entity = i >= 0 ? split[i--] : 'model';
let ctrl = i >= 0 ? split[i--] : '$ctrl';
if (attrs.model === undefined)
attrs.model = `${ctrl}.${entity}.${field}`;
if (attrs.rule === undefined && len >= 2)
attrs.rule = `${entity}.${field}`;
if (attrs.label === undefined && len >= 2)
attrs.label = `${entity}.${field}`;
if (attrs.name === undefined)
attrs.name = field;
}
if (attrs.focus !== undefined)
attrs.focus = 'vn-focus';
}
};
}
}
module.provider(NAME, () => new InputAttrsNormalizer());

View File

@ -1,202 +0,0 @@
import {module} from './module';
import {ng} from 'vendor';
import * as util from './util';
export const NAME = util.getProviderName('interpolate');
function minErr() {}
function stringify(value) {
if (value === null) { // null || undefined
return '';
}
switch (typeof value) {
case 'string':
break;
case 'number':
value = String(value);
break;
default:
value = angular.toJson(value);
}
return value;
}
var $interpolateMinErr = ng.angular.$interpolateMinErr = ng.$$minErr('$interpolate');
$interpolateMinErr.throwNoconcat = function(text) {
throw $interpolateMinErr('noconcat',
'Error while interpolating: {0}\nStrict Contextual Escaping disallows ' +
'interpolations that concatenate multiple expressions when a trusted value is ' +
'required. See http://docs.angularjs.org/api/ng.$sce', text);
};
$interpolateMinErr.interr = function(text, err) {
return $interpolateMinErr('interr', 'Can\'t interpolate: {0}\n{1}', text, err.toString());
};
function $get($parse, $exceptionHandler, $sce) {
var startSymbolLength = this._startSymbol.length,
endSymbolLength = this._endSymbol.length,
escapedStartRegexp = new RegExp(this._startSymbol.replace(/./g, escape), 'g'),
escapedEndRegexp = new RegExp(this._endSymbol.replace(/./g, escape), 'g'),
self = this;
function escape(ch) {
return '\\\\\\' + ch;
}
function unescapeText(text) {
return text.replace(escapedStartRegexp, self._startSymbol)
.replace(escapedEndRegexp, self._endSymbol);
}
// TODO: this is the same as the constantWatchDelegate in parse.js
function constantWatchDelegate(scope, listener, objectEquality, constantInterp) {
var unwatch = scope.$watch(function constantInterpolateWatch(scope) {
unwatch();
return constantInterp(scope);
}, listener, objectEquality);
return unwatch;
}
function $interpolate(text, mustHaveExpression, trustedContext, allOrNothing) {
// Provide a quick exit and simplified result function for text with no interpolation
if (!text.length || text.indexOf(self._startSymbol) === -1) {
var constantInterp;
if (!mustHaveExpression) {
var unescapedText = unescapeText(text);
constantInterp = valueFn(unescapedText);
constantInterp.exp = text;
constantInterp.expressions = [];
constantInterp.$$watchDelegate = constantWatchDelegate;
}
return constantInterp;
}
allOrNothing = Boolean(allOrNothing);
var startIndex,
endIndex,
index = 0,
expressions = [],
parseFns = [],
textLength = text.length,
exp,
concat = [],
expressionPositions = [];
while (index < textLength) {
if (((startIndex = text.indexOf(self._startSymbol, index)) !== -1) &&
((endIndex = text.indexOf(self._endSymbol, startIndex + startSymbolLength)) !== -1)) {
if (index !== startIndex) {
concat.push(unescapeText(text.substring(index, startIndex)));
}
exp = text.substring(startIndex + startSymbolLength, endIndex);
expressions.push(exp);
parseFns.push($parse(exp, parseStringifyInterceptor));
index = endIndex + endSymbolLength;
expressionPositions.push(concat.length);
concat.push('');
} else {
// we did not find an interpolation, so we have to add the remainder to the separators array
if (index !== textLength) {
concat.push(unescapeText(text.substring(index)));
}
break;
}
}
if (trustedContext && concat.length > 1) {
$interpolateMinErr.throwNoconcat(text);
}
if (!mustHaveExpression || expressions.length) {
var compute = function(values) {
for (var i = 0, ii = expressions.length; i < ii; i++) {
if (allOrNothing && isUndefined(values[i])) return;
concat[expressionPositions[i]] = values[i];
}
return concat.join('');
};
var getValue = function(value) {
return trustedContext ?
$sce.getTrusted(trustedContext, value) :
$sce.valueOf(value);
};
return angular.extend(function interpolationFn(context) {
var i = 0;
var ii = expressions.length;
var values = new Array(ii);
try {
for (; i < ii; i++) {
values[i] = parseFns[i](context);
}
return compute(values);
} catch (err) {
$exceptionHandler($interpolateMinErr.interr(text, err));
}
}, {
// all of these properties are undocumented for now
exp: text, // just for compatibility with regular watchers created via $watch
expressions: expressions
});
}
function parseStringifyInterceptor(value) {
try {
value = getValue(value);
return allOrNothing && !isDefined(value) ? value : stringify(value);
} catch (err) {
$exceptionHandler($interpolateMinErr.interr(text, err));
}
}
}
$interpolate.startSymbol = function() {
return startSymbol;
};
$interpolate.endSymbol = function() {
return endSymbol;
};
return $interpolate;
}
$get.$inject = ['$parse', '$exceptionHandler', '$sce'];
export class Interpolate
{
constructor() {
this._startSymbol = '*[';
this._endSymbol = ']*';
}
set startSymbol(value) {
if (value) {
this._startSymbol = value;
return this;
} else {
return this._startSymbol;
}
}
set endSymbol(value) {
if (value) {
this._endSymbol = value;
return this;
} else {
return this._endSymbol;
}
}
}
Interpolate.prototype.$get = $get;
var interpolate = new Interpolate();
module.provider(NAME, () => interpolate);

View File

@ -1,2 +0,0 @@
<!-- por definir -->

Some files were not shown because too many files have changed in this diff Show More