Merge branch 'master' of ssh://git.verdnatura.es:/var/lib/git/salix

# Conflicts:
#	db.json
This commit is contained in:
nelo 2017-01-13 09:57:16 +01:00
commit 30e5bd9c0b
81 changed files with 1126 additions and 1126 deletions

View File

@ -1,4 +1,5 @@
<vn-vertical full-height class="bg-content"> <vn-vertical full-height class="bg-content">
<vn-main-menu></vn-main-menu> <vn-main-menu></vn-main-menu>
<vn-vertical ui-view scrollable class="main-view"></vn-vertical> <vn-topbar vn-empty></vn-topbar>
<vn-vertical vn-auto ui-view scrollable class="main-view"></vn-vertical>
</vn-vertical> </vn-vertical>

View File

@ -1,4 +1,5 @@
vn-app { vn-app {
display: block;
height: 100%; height: 100%;
} }

View File

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

View File

@ -1,18 +1,25 @@
import template from './searchbar.html';
import {module} from '../../module'; import {module} from '../../module';
require('./style.css'); require('./style.css');
export const NAME = 'vnSearchbar' export const NAME = 'vnSearchbar'
export const COMPONENT = { export const COMPONENT = {
template: template, template: require('./searchbar.html'),
transclude: true, bindings: {
controllerAs: 'searchbar', model: '<',
controller: function($element) { search: '&',
this.onClick = function(event) { advanced: '=',
var popover = $element.find('vn-popover'); popover: '@'
popover.controller('vnPopover').show($element); },
}; controller: controller
}
}; };
COMPONENT.controller.$inject = ['$element'];
module.component(NAME, COMPONENT); 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($element, child);
event.preventDefault();
};
}

View File

@ -1,2 +1,2 @@
<header class="mdl-layout__header mdl-layout__header--scroll bg-dark-bar"> <header class="bg-dark-bar" style="height: 4.2em;">
</header> </header>

View File

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

View File

@ -1,9 +1,7 @@
import {module} from './module'; import {module} from './module';
export const run = function($rootScope) { export const run = function($rootScope) {
$rootScope.$on('$viewContentLoaded',()=>{ $rootScope.$on('$viewContentLoaded', () => {})
componentHandler.upgradeAllRegistered();
})
} }
run.$inject = ['$rootScope']; run.$inject = ['$rootScope'];
module.run(run); module.run(run);

View File

@ -1,27 +1,27 @@
@import "colors"; @import "colors";
$bg-main: $color-green; $bg-main: $color-green;
$bg-minor: $color-orange; $bg-minor: $color-orange;
$bg-content: $color-light-grey; $bg-content: $color-light-grey;
$bg-panel: $color-white; $bg-panel: $color-white;
$bg-dark-bar: $color-dark; $bg-dark-bar: $color-dark;
$bg-dark-menu: $color-dark-grey; $bg-dark-menu: $color-dark-grey;
html [bg-main], .bg-main { html [bg-main], .bg-main {
background-color: $bg-main; background-color: $bg-main;
} }
html [bg-minor], .bg-minor { html [bg-minor], .bg-minor {
background-color: $bg-minor; background-color: $bg-minor;
} }
html [bg-content], .bg-content { html [bg-content], .bg-content {
background-color: $bg-content; background-color: $bg-content;
} }
html [bg-panel], .bg-panel { html [bg-panel], .bg-panel {
background-color: $bg-panel; background-color: $bg-panel;
} }
html [bg-dark-bar], .bg-dark-bar { html [bg-dark-bar], .bg-dark-bar {
background-color: $bg-dark-bar; background-color: $bg-dark-bar;
} }
html [bg-dark-menu], .bg-dark-menu { html [bg-dark-menu], .bg-dark-menu {
background-color: darken($bg-dark-menu, 35%); background-color: darken($bg-dark-menu, 35%);
} }

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1 +1 @@
// por definir // por definir

View File

@ -20,6 +20,7 @@ export function directive(resolve, normalizer) {
if (mdlField) if (mdlField)
mdlField.updateClasses_(); mdlField.updateClasses_();
}); });
componentHandler.upgradeElement(element[0].firstChild);
} }
}; };
} }

View File

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

View File

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

View File

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

View File

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

View File

@ -46,11 +46,9 @@ 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 CARD_MDL, factory as cardMdl} from './card/card.mdl';
export {NAME as SWITCH, directive as SwitchDirective} from './switch/switch'; 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 SWITCH_MDL, factory as switchdMdl} from './switch/switch.mdl';
export {directive as Popover} from './popover/popover';
export {factory as PopoverMdl} from './popover/popover.mdl';
export {directive as Icon} from './icon/icon'; export {directive as Icon} from './icon/icon';
export {factory as IconMdl} from './icon/icon.mdl'; export {factory as IconMdl} from './icon/icon.mdl';
export {NAME as TITLE, COMPONENT as TITLE_COMPONENT} from './title/title'; export {directive as Popover} from './popover/popover';
export {NAME as SUBTITLE, COMPONENT as SUBTITLE_COMPONENT} from './subtitle/subtitle'; export {COMPONENT as Title} from './title/title';
export {COMPONENT as Subtitle} from './subtitle/subtitle';

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1 +1 @@
// por definir // por definir

View File

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

View File

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

View File

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

View File

@ -1,17 +1,17 @@
import {module} from '../module'; import {module} from '../module';
import template from './password.mdl.html'; import template from './password.mdl.html';
export const NAME = 'vnPasswordMdlFactory'; export const NAME = 'vnPasswordMdlFactory';
export function factory() { export function factory() {
return { return {
template: template, template: template,
default: { default: {
label: 'Password', label: 'Password',
enabled: 'enabled', enabled: 'enabled',
className: 'mdl-textfield__input' className: 'mdl-textfield__input'
} }
} }
} }
module.factory(NAME, factory); module.factory(NAME, factory);

View File

@ -2,87 +2,91 @@ import {module} from '../module';
import * as resolveFactory from '../resolveDefaultComponents'; import * as resolveFactory from '../resolveDefaultComponents';
require('./style.css'); require('./style.css');
const _NAME = 'popover';
export const NAME = 'vnPopover'; export const NAME = 'vnPopover';
export function directive(resolver) { directive.$inject = ['$compile', '$document', 'vnPopover'];
export function directive($compile, $document, popover) {
return { return {
restrict: 'E', restrict: 'A',
transclude: true, link: function($scope, $element, $attrs, $ctrl) {
controllerAs: 'popover', $element.on('click', function(event) {
template: function(_, attrs) { var child = $document[0].createElement($attrs.vnPopover);
return resolver.getTemplate(_NAME, attrs); $compile(child)($scope);
}, popover.show($element, child);
/* link: function(scope, element, attrs, ctrl) { event.preventDefault();
var nativeElement = element[0];
nativeElement.addEventListener('click', function(ev) {
ev.preventDefault();
ctrl.show();
}); });
},
*/ controller: function($element) {
var self = this;
var doc = angular.element(document);
function docMouseDownHandler(event) {
if (event != self.lastEvent)
self.hide();
}
this.onMouseDown = function(event) {
this.lastEvent = event;
};
this.hide = function ()
{
$element[0].style.display = 'none';
doc.off('mousedown', docMouseDownHandler);
}
this.show = function(parent) {
var node = $element[0];
var style = node.style;
var spacing = 0;
var margin = 20;
var dblMargin = margin * 2;
var width = node.offsetWidth;
var height = node.offsetHeight;
var innerWidth = window.innerWidth;
var innerHeight = window.innerHeight;
if(width + dblMargin > innerWidth) {
width = innerWidth - dblMargin;
style.width = width +'px';
}
if(height + dblMargin > innerHeight) {
height = innerHeight - dblMargin;
style.height = height +'px';
}
if(parent) {
var parentNode = parent[0];
var rect = parentNode.getBoundingClientRect();
var left = rect.left;
var top = rect.top + spacing + parentNode.offsetHeight;
if(left + width > innerWidth)
left -= (left + width) - innerWidth + margin;
if(top + height > innerHeight)
top -= height + parentNode.offsetHeight + spacing * 2;
if(left < 0)
left = margin;
if(top < 0)
top = margin;
style.top = (top) +'px';
style.left = (left) +'px';
}
style.display = 'block';
doc.on('mousedown', docMouseDownHandler);
};
} }
} }
} }
directive.$inject = [resolveFactory.NAME];
module.directive(NAME, directive); module.directive(NAME, directive);
$get.$inject = ['$document'];
function $get($document) {
var lastEvent;
var popover;
var self = {
onDocMouseDown: function(event) {
if (event != lastEvent)
self.hide();
},
onPopoverMouseDown: function(event) {
lastEvent = event;
},
hide: function() {
$document.off('mousedown', this.onDocMouseDown);
$document[0].body.removeChild (popover);
popover = null;
},
show: function(parent, child) {
popover = $document[0].createElement('div');
popover.className = 'vn-popover';
popover.addEventListener('mousedown', this.onPopoverMouseDown);
popover.appendChild (child);
var style = popover.style;
var spacing = 0;
var margin = 20;
var dblMargin = margin * 2;
var width = popover.offsetWidth;
var height = popover.offsetHeight;
var innerWidth = window.innerWidth;
var innerHeight = window.innerHeight;
if(width + dblMargin > innerWidth) {
width = innerWidth - dblMargin;
style.width = width +'px';
}
if(height + dblMargin > innerHeight) {
height = innerHeight - dblMargin;
style.height = height +'px';
}
if(parent) {
var parentNode = parent[0];
var rect = parentNode.getBoundingClientRect();
var left = rect.left;
var top = rect.top + spacing + parentNode.offsetHeight;
if(left + width > innerWidth)
left -= (left + width) - innerWidth + margin;
if(top + height > innerHeight)
top -= height + parentNode.offsetHeight + spacing * 2;
if(left < 0)
left = margin;
if(top < 0)
top = margin;
style.top = (top) +'px';
style.left = (left) +'px';
}
$document[0].body.appendChild (popover);
$document.on('mousedown', this.onDocMouseDown);
}
};
return self;
}
module.provider('vnPopover', function() {this.$get = $get;});

View File

@ -1,5 +0,0 @@
<div
ng-mousedown="popover.onMouseDown($event)"
ng-transclude
*[foo]*>
</div>

View File

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

View File

@ -1,5 +1,4 @@
vn-popover { .vn-popover {
display: none;
position: fixed; position: fixed;
box-shadow: 0 0 .4em rgba(1,1,1,.4); box-shadow: 0 0 .4em rgba(1,1,1,.4);
background-color: white; background-color: white;

View File

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

View File

@ -1 +1 @@
// por definir // por definir

View File

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

View File

@ -1,2 +1,2 @@
<input type="radio" class="*[className]*" name="*[name]*" ng-model="*[model]*.*[name]*" *[enabled]*> <input type="radio" class="*[className]*" name="*[name]*" ng-model="*[model]*.*[name]*" *[enabled]*>
<span class="mdl-radio__label" translate>*[text]*</span> <span class="mdl-radio__label" translate>*[text]*</span>

View File

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

View File

@ -7,7 +7,7 @@ export const NAME = util.getName(_NAME);
directive.$inject = [resolveFactory.NAME]; directive.$inject = [resolveFactory.NAME];
export function directive(resolve) { export function directive(resolve) {
return{ return {
restrict: 'E', restrict: 'E',
template: function(_, attrs) { template: function(_, attrs) {
return resolve.getTemplate(_NAME, attrs); return resolve.getTemplate(_NAME, attrs);

View File

@ -1,4 +1,4 @@
<div class="*[className]*"> <div class="mdl-js-snackbar mdl-snackbar *[className]*">
<div class="mdl-snackbar__text"></div> <div class="mdl-snackbar__text"></div>
<button class="mdl-snackbar__action" type="button"></button> <button class="mdl-snackbar__action" type="button"></button>
</div> </div>

View File

@ -7,8 +7,7 @@ export function factory() {
return { return {
template: template, template: template,
default: { default: {
message: 'Default message', message: 'Default message'
className: 'mdl-js-snackbar mdl-snackbar'
} }
} }
} }

View File

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

View File

@ -1,15 +1,15 @@
import {module} from '../module'; import {module} from '../module';
import template from './spinner.mdl.html'; import template from './spinner.mdl.html';
export const NAME = 'vnSpinnerMdlFactory'; export const NAME = 'vnSpinnerMdlFactory';
export function factory() { export function factory() {
return { return {
template: template, template: template,
default: { default: {
className: 'mdl-spinner mdl-spinner--single-color mdl-js-spinner' className: 'mdl-spinner mdl-spinner--single-color mdl-js-spinner'
} }
} }
} }
module.factory(NAME, factory); module.factory(NAME, factory);

View File

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

View File

@ -1,17 +1,17 @@
import {module} from '../module'; import {module} from '../module';
import template from './submit.mdl.html'; import template from './submit.mdl.html';
export const NAME = 'vnSubmitMdlFactory'; export const NAME = 'vnSubmitMdlFactory';
export function factory() { export function factory() {
return { return {
template: template, template: template,
default: { default: {
label: 'Submit', label: 'Submit',
className: 'mdl-button mdl-js-button mdl-button--raised', className: 'mdl-button mdl-js-button mdl-button--raised',
enabled: 'true' enabled: 'true'
} }
} }
} }
module.factory(NAME, factory); module.factory(NAME, factory);

View File

@ -1,2 +0,0 @@
<h5 style="margin-top: 0;" class="border-dashed-top pad-medium-v" level="*[level]*" ng-transclude>
</h5>

View File

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

View File

@ -0,0 +1,2 @@
<h5 style="margin-top: 0;" class="margin-medium-bottom" ng-transclude>
</h5>

View File

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

View File

@ -1,4 +1,4 @@
<label class="mdl-switch mdl-js-switch mdl-js-ripple-effect"> <label class="mdl-switch mdl-js-switch mdl-js-ripple-effect">
<input type="checkbox" class="*[className]*" ng-model="*[model]*"> <input type="checkbox" class="*[className]*" ng-model="*[model]*">
<span class="mdl-switch__label">*[label]*</span> <span class="mdl-switch__label">*[label]*</span>
</label> </label>

View File

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

View File

@ -1 +1 @@
// por definir // por definir

View File

@ -20,6 +20,7 @@ export function directive(resolve, normalizer) {
if (mdlField) if (mdlField)
mdlField.updateClasses_(); mdlField.updateClasses_();
}); });
componentHandler.upgradeElement(element[0].firstChild);
} }
}; };
} }

View File

@ -0,0 +1,2 @@
<h3 style="margin-top: 0;" class="margin-medium-bottom" ng-transclude>
</h3>

View File

@ -1,2 +0,0 @@
<h3 style="margin-top: 0;" class="margin-medium-bottom" level="*[level]*" ng-transclude>
</h3>

View File

@ -1,9 +1,8 @@
import template from './title.html'; import {module} from '../module';
import {module as _module} from '../module';
export const NAME = 'vnTitle';
export const NAME = "vnTitle"; export const COMPONENT = {
export const COMPONENT = { template: require('./template.html'),
template: template, transclude: true
transclude: true };
}; module.component(NAME, COMPONENT);
_module.component(NAME, COMPONENT);

View File

@ -4,29 +4,29 @@
<vn-vertical pad-large> <vn-vertical pad-large>
<vn-title vn-one>Consignatario</vn-title> <vn-title vn-one>Consignatario</vn-title>
<vn-horizontal> <vn-horizontal>
<vn-check vn-one label="Activo" field="addressData.address.enabled"></vn-check> <vn-check vn-one label="Activo" field="addressData.address.enabled" focus></vn-check>
<vn-check vn-one label="Predeterminado" field="addressData.address.default"></vn-check> <vn-check vn-one label="Predeterminado" field="addressData.address.default"></vn-check>
</vn-horizontal> </vn-horizontal>
<vn-horizontal> <vn-horizontal>
<vn-textfield vn-one label="Consignatario" field="addressData.address.consignee"></vn-textfield> <vn-textfield vn-one label="Consignatario" field="addressData.address.consignee"></vn-textfield>
<vn-textfield vn-one label="Domicilio" field="addressData.address.street"></vn-textfield> <vn-textfield vn-one label="Domicilio" field="addressData.address.street"></vn-textfield>
</vn-horizontal> </vn-horizontal>
<vn-horizontal> <vn-horizontal>
<vn-textfield vn-one label="Código Postal" field="addressData.address.postcode"></vn-textfield> <vn-textfield vn-one label="Código Postal" field="addressData.address.postcode"></vn-textfield>
<vn-textfield vn-one label="Municipio" field="addressData.address.city"></vn-textfield> <vn-textfield vn-one label="Municipio" field="addressData.address.city"></vn-textfield>
<vn-combo vn-one label="Provincia" field="addressData.address.province"> <vn-combo vn-one label="Provincia" field="addressData.address.province">
<option ng-repeat="p in addressData.provinces | orderBy:'name'" value="{{p.id}}">{{p.name}}</ng-repeat> <option ng-repeat="p in addressData.provinces | orderBy:'name'" value="{{p.id}}">{{p.name}}</ng-repeat>
</vn-combo> </vn-combo>
<vn-textfield vn-one label="Teléfono" field="addressData.address.phone"></vn-textfield> <vn-textfield vn-one label="Teléfono" field="addressData.address.phone"></vn-textfield>
<vn-textfield vn-one label="Móvil" field="addressData.address.mobile"></vn-textfield> <vn-textfield vn-one label="Móvil" field="addressData.address.mobile"></vn-textfield>
</vn-horizontal> </vn-horizontal>
<vn-horizontal> <vn-horizontal>
<vn-combo vn-one label="Agencia" field="addressData.address.agency"> <vn-combo vn-one label="Agencia" field="addressData.address.agency">
<option ng-repeat="a in addressData.agencies | orderBy:'name'" value="{{a.id}}">{{a.name}}</ng-repeat> <option ng-repeat="a in addressData.agencies | orderBy:'name'" value="{{a.id}}">{{a.name}}</ng-repeat>
</vn-combo> </vn-combo>
</vn-horizontal> </vn-horizontal>
<vn-empty margin-large-top> <vn-empty margin-large-top>
<vn-submit label="Guardar" id="save"></vn-submit> <vn-submit label="Guardar" id="save"></vn-submit>
</vn-empty> </vn-empty>
</vn-vertical> </vn-vertical>
</vn-card> </vn-card>

View File

@ -1,11 +1,10 @@
<vn-vertical class="full-height"> <vn-vertical full-height style="max-width: 85em; margin: 0 auto;">
<vn-topbar></vn-topbar> <vn-horizontal full-height>
<vn-horizontal class="full-height"> <vn-empty pad-medium-left style="min-width: 18em;">
<vn-empty pad-medium-left >
<vn-descriptor client="card.client" class="display-block" ></vn-descriptor> <vn-descriptor client="card.client" class="display-block" ></vn-descriptor>
<vn-left-menu items="card.items"></vn-left-menu> <vn-left-menu items="card.items"></vn-left-menu>
</vn-empty> </vn-empty>
<vn-auto > <vn-auto>
<vn-vertical ui-view></vn-vertical> <vn-vertical ui-view></vn-vertical>
</vn-auto> </vn-auto>
</vn-horizontal> </vn-horizontal>

View File

@ -1,21 +1,20 @@
<vn-topbar></vn-topbar> <form ng-submit="create.submit()" pad-large style="max-width: 67em; margin: 0 auto;">
<form ng-submit="create.submit()" pad-large> <vn-card>
<vn-card> <vn-vertical pad-large>
<vn-vertical pad-large> <vn-title>Crear Cliente</vn-title>
<vn-title>Crear Cliente</vn-title> <vn-horizontal>
<vn-horizontal> <vn-textfield vn-one label="Nombre" field="create.model.name" focus></vn-textfield>
<vn-textfield vn-one label="Nombre" field="create.model.name"></vn-textfield> <vn-textfield vn-one label="NIF/CIF" field="create.model.fi"></vn-textfield>
<vn-textfield vn-one label="NIF/CIF" field="create.model.fi"></vn-textfield> </vn-horizontal>
</vn-horizontal> <vn-horizontal>
<vn-horizontal> <vn-textfield vn-one label="Razón social" field="create.model.socialName"></vn-textfield>
<vn-textfield autofocus vn-one label="Razón social" field="create.model.socialName"></vn-textfield> <vn-one></vn-one>
<vn-one></vn-one> </vn-horizontal>
</vn-horizontal> <vn-horizontal>
<vn-horizontal> <vn-one margin-large-top>
<vn-one margin-large-top> <vn-submit label="Crear" id="create"></vn-submit>
<vn-submit label="Crear" id="create"></vn-submit> </vn-one>
</vn-one> </vn-horizontal>
</vn-horizontal> </vn-vertical>
</vn-vertical> </vn-card>
</vn-card>
</form> </form>

View File

@ -1,13 +1,17 @@
<vn-vertical class="full-height"> <div>
<vn-topbar></vn-topbar> <div style="max-width: 39em; margin: 0 auto;">
<div style="max-width: 45em; margin: 0 auto;">
<vn-card margin-medium> <vn-card margin-medium>
<form pad-medium ng-submit="search.submit()"> <vn-horizontal pad-medium>
<vn-horizontal> <vn-searchbar
<vn-searchbar vn-auto></vn-searchbar> vn-auto
<a vn-empty ui-sref="create"><vn-button label="New client"></vn-button></a> model="search.filter"
search="search.find()"
advanced="true"
popover="vn-client-search-panel"
params="search.filter"
return="search.find()">
</vn-searchbar>
</vn-horizontal> </vn-horizontal>
</form>
</vn-card> </vn-card>
<vn-card margin-medium> <vn-card margin-medium>
<vn-item-client <vn-item-client
@ -17,4 +21,9 @@
</vn-item-client> </vn-item-client>
</vn-card> </vn-card>
</div> </div>
</vn-vertical> <a
ui-sref="create"
style="position: fixed; bottom: 2em; right: 2em;">
<vn-button label="New client"></vn-button>
</a>
</div>

View File

@ -8,25 +8,20 @@ export const COMPONENT = {
controllerAs: 'search', controllerAs: 'search',
controller: function($http) { controller: function($http) {
this.clients = []; this.clients = [];
$http.get('/client/api/Clients').then( this.find = function() {
json => { var queryStr = '/client/api/Clients';
this.clients = json.data; var search = this.filter.search;
}, if(search) {
json => console.error(json.data.error.message) let json = JSON.stringify({where: {name: {ilike: search}}});
); var queryStr = `${queryStr}?filter=${json}`;
this.submit = function() { }
var query = {where: model}; $http.get(queryStr).then(
var self = this; json => this.clients = json.data,
$http.get(`/client/api/Clients/findOne?filter=${JSON.stringify(query)}`).then( json => console.error(json.data.error.message)
function(response) {
self.clients = [];
self.clients.push(response.data);
},
function(response) {
console.log(response);
}
); );
}; };
this.filter = {};
this.find();
} }
}; };
COMPONENT.controller.$inject = ['$http']; COMPONENT.controller.$inject = ['$http'];

View File

@ -1,4 +1,4 @@
<a ui-sref="clientCard.basicData({ id: {{itemClient.client.id}} })" pad-medium border-solid-bottom> <a ui-sref="clientCard.basicData({ id: {{itemClient.client.id}} })" pad-medium border-solid-bottom>
<div class="vn-item-client-name">{{itemClient.client.name}}</div> <div class="vn-item-client-name">{{itemClient.client.name}}</div>
<div>{{itemClient.client.id}} </div> <div>{{itemClient.client.id}}</div>
</a> </a>

View File

@ -1,10 +1,9 @@
<form name="form" ng-submit="form.$valid && note.submit()" pad-medium> <form name="form" ng-submit="form.$valid && note.submit()" pad-medium>
<vn-card> <vn-card>
<vn-vertical pad-large> <vn-vertical pad-large>
<vn-title>Notas</vn-title> <vn-title>Notas</vn-title>
<vn-textfield label="Notas" class="padd-medium-top" field="note.model.notes"></vn-textfield> <vn-textfield label="Notas" field="note.model.notes" focus padd-medium-top></vn-textfield>
<vn-submit margin-large-top label="Guardar"></vn-submit> <vn-submit margin-large-top label="Guardar"></vn-submit>
</vn-vertical> </vn-vertical>
</vn-card> </vn-card>
</form> </form>

View File

@ -1,4 +1,4 @@
<div pad-large style="width: 600px;"> <div pad-large style="min-width: 30em;">
<form name="form" ng-submit="form.$valid && search.submit()"> <form name="form" ng-submit="form.$valid && search.submit()">
<vn-horizontal> <vn-horizontal>
<vn-textfield vn-one label="Id Cliente" field="search.model.id"></vn-textfield> <vn-textfield vn-one label="Id Cliente" field="search.model.id"></vn-textfield>
@ -8,7 +8,7 @@
<vn-textfield vn-one label="Alias" field="search.model.alias"></vn-textfield> <vn-textfield vn-one label="Alias" field="search.model.alias"></vn-textfield>
</vn-horizontal> </vn-horizontal>
<vn-horizontal> <vn-horizontal>
<vn-textfield vn-two label="Razon Social" field="search.model.name"></vn-textfield> <vn-textfield vn-one label="Razon Social" field="search.model.name"></vn-textfield>
</vn-horizontal> </vn-horizontal>
<vn-horizontal> <vn-horizontal>
<vn-textfield vn-one label="Población" field="search.model.city"></vn-textfield> <vn-textfield vn-one label="Población" field="search.model.city"></vn-textfield>
@ -18,7 +18,9 @@
<vn-textfield vn-one label="Email" field="search.model.email"></vn-textfield> <vn-textfield vn-one label="Email" field="search.model.email"></vn-textfield>
<vn-textfield vn-one label="Teléfono" field="search.model.phone"></vn-textfield> <vn-textfield vn-one label="Teléfono" field="search.model.phone"></vn-textfield>
</vn-horizontal> </vn-horizontal>
<vn-button label="Search"></vn-button> <vn-horizontal margin-large-top>
<vn-button label="Search"></vn-button>
</vn-horizontal>
</form> </form>
</div> </div>

View File

@ -1,7 +1,7 @@
import template from './search-panel.html'; import template from './search-panel.html';
import {module} from '../../module'; import {module} from '../../module';
export const NAME = "vnSearchPanel"; export const NAME = 'vnClientSearchPanel';
export const COMPONENT = { export const COMPONENT = {
controllerAs: 'search', controllerAs: 'search',
template: template template: template

View File

@ -32,8 +32,8 @@
"3": "{\"name\":\"Carlos Zambrano\",\"id\":3}" "3": "{\"name\":\"Carlos Zambrano\",\"id\":3}"
}, },
"Address": { "Address": {
"63": "{\"street\":\"Avd. Espioca nº 100\",\"consignee\":\"Verndatura Silla\",\"city\":\"Silla\",\"postcode\":\"46460\",\"phone\":\"66666666\",\"mobile\":\"989898888\",\"id\":63,\"province\":\"2\",\"agency\":\"3\",\"default\":true,\"enabled\":true}", "63": "{\"street\":\"Avd. Espioca nº 100\",\"consignee\":\"Verndatura Silla\",\"city\":\"Silla\",\"postcode\":\"46460\",\"phone\":\"66666666\",\"mobile\":\"989898888\",\"id\":63,\"province\":\"2\",\"agency\":\"2\",\"default\":true,\"enabled\":true}",
"64": "{\"street\":\"Aaa\",\"consignee\":\"aaa\",\"city\":\"aaa\",\"postcode\":\"11111\",\"phone\":\"963242100\",\"mobile\":\"11231241423\",\"id\":64}" "64": "{\"street\":\"Aaa\",\"consignee\":\"aaa\",\"city\":\"aaa\",\"postcode\":\"11111\",\"phone\":\"963242100\",\"mobile\":\"11231241423\",\"id\":64,\"enabled\":true}"
}, },
"Country": { "Country": {
"1": "{\"id\":1,\"name\":\"Spain\"}", "1": "{\"id\":1,\"name\":\"Spain\"}",