This commit is contained in:
Vicente Falco 2017-01-13 14:44:47 +01:00
commit d4f37fa150
102 changed files with 1216 additions and 1149 deletions

View File

@ -5,3 +5,4 @@ export {NAME as LEFT_MENU, COMPONENT as LEFTMENU_COMPONENT} from './components/l
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';
export {NAME as CONFIRM, COMPONENT as CONFIRM_COMPONENT} from './components/confirm/confirm';

View File

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

View File

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

View File

@ -0,0 +1,11 @@
<dialog class="mdl-dialog">
<div class="mdl-dialog__content">
<p>
Allow this site to collect usage data to improve your experience?
</p>
</div>
<div class="mdl-dialog__actions mdl-dialog__actions--full-width">
<button type="button" class="mdl-button" ng-click="dialogController.accept()">Agree</button>
<button type="button" class="mdl-button close" ng-click="dialogController.cancel()">Disagree</button>
</div>
</dialog>

View File

@ -0,0 +1,18 @@
import template from './confirm.html';
import {module} from '../../module';
export const NAME = 'vnConfirm';
export const COMPONENT = {
template: template,
controllerAs: 'dialogController',
controller: function(){
this.accept = function(){
return true;
}
this.cancel = function(){
return false;
}
}
};
module.component(NAME, COMPONENT);

View File

@ -1,8 +1,12 @@
<form ng-submit="$ctrl.search()">
<vn-horizontal>
<vn-textfield vn-one label="Search" model="$ctrl.search"></vn-textfield>
<vn-icon icon="keyboard_arrow_down" ng-click="searchbar.onClick($event)" style="cursor: pointer;"></vn-icon>
<vn-icon-button icon="search"></vn-icon-button>
<vn-popover id="popover">
<vn-search-panel></vn-search-panel>
</vn-popover>
</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,18 +1,25 @@
import template from './searchbar.html';
import {module} from '../../module';
require('./style.css');
export const NAME = 'vnSearchbar'
export const COMPONENT = {
template: template,
transclude: true,
controllerAs: 'searchbar',
controller: function($element) {
this.onClick = function(event) {
var popover = $element.find('vn-popover');
popover.controller('vnPopover').show($element);
};
}
template: require('./searchbar.html'),
bindings: {
model: '<',
search: '&',
advanced: '=',
popover: '@'
},
controller: controller
};
COMPONENT.controller.$inject = ['$element'];
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>

View File

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

View File

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

View File

@ -25,9 +25,12 @@ html [bg-dark-bar], .bg-dark-bar {
html [bg-dark-menu], .bg-dark-menu {
background-color: darken($bg-dark-menu, 35%);
}
<<<<<<< HEAD
/* utilizado para mostrar el color default en el consignatario */
.bg-dark-item{
background-color: $bg-dark-bar;
color: $color-white;
}
=======
>>>>>>> 30e5bd9c0b8428cb5e77b03c22bbd81cf247f231

View File

@ -1,45 +1,45 @@
@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;
}
@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 +1,7 @@
$color-green: rgb(139,195,74);
$color-orange: rgb(255,171,64);
$color-white: white;
$color-dark: #3c393b;
$color-dark-grey: #424242;
$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,21 +1,21 @@
@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);
}
@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 +1,12 @@
@import "colors";
@import "font-family";
$font-color: $color-dark-grey;
body {
color: $font-color;
font-family: raleway-regular;
}
html [uppercase], .uppercase {
text-transform: uppercase;
@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 +1,110 @@
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;
}
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 +1,89 @@
$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;
}
$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,89 +1,89 @@
$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;
}
$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 +1,30 @@
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;
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 +1,2 @@
<!-- por definir -->
<!-- por definir -->

View File

@ -1,24 +1,24 @@
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);
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 +1,18 @@
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);
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 +1,3 @@
<button type = "*[typeName]*" class="*[className]*" *[enabled]* translate>
*[label]*
<button type = "*[typeName]*" class="*[className]*" *[enabled]* translate>
*[label]*
</button>

View File

@ -1,21 +1,21 @@
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',
enabled: 'true',
typeName: 'button'
}
}
}
_module.factory(NAME, factory);
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',
enabled: 'true',
typeName: 'button'
}
}
}
_module.factory(NAME, factory);

View File

@ -1,21 +1,21 @@
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 {
require: 'E',
transclude: true,
template: function(_, attr) {
return resolve.getTemplate(_NAME, attr);
}
};
}
_module.directive(NAME, directive);
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 {
require: 'E',
transclude: true,
template: function(_, attr) {
return resolve.getTemplate(_NAME, attr);
}
};
}
_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)
mdlField.updateClasses_();
});
componentHandler.upgradeElement(element[0].firstChild);
}
};
}

View File

@ -1,4 +1,4 @@
<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>
<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,27 +1,28 @@
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_();
});
}
};
}
_module.directive(NAME, directive);
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,14 +1,14 @@
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);
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,10 +1,10 @@
// 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 = [];
// 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 = [];

5
@salix/core/src/copy.js Normal file
View File

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

View File

@ -7,6 +7,8 @@ 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 FOCUS, directive as Focus} from './focus';
export {NAME as RULE, directive as Rule} from './rule';
@ -44,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 SWITCH, directive as SwitchDirective} from './switch/switch';
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 {factory as IconMdl} from './icon/icon.mdl';
export {NAME as TITLE, COMPONENT as TITLE_COMPONENT} from './title/title';
export {NAME as SUBTITLE, COMPONENT as SUBTITLE_COMPONENT} from './subtitle/subtitle';
export {directive as Popover} from './popover/popover';
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 * 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_();
});
}
};
}
_module.directive(NAME, directive);
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,14 +1,14 @@
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);
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

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

View File

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

View File

@ -1,15 +1,15 @@
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);
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,18 +1,18 @@
import {module} from '../module';
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);
import {module} from '../module';
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 +1 @@
<i class="material-icons">*[icon]*</i>
<i class="material-icons">*[icon]*</i>

View File

@ -1,12 +1,12 @@
import {module} from '../module';
import template from './icon.mdl.html';
export const NAME = 'vnIconMdlFactory';
export function factory() {
return {
template: template,
default: {}
}
}
module.factory(NAME, factory);
import {module} from '../module';
import template from './icon.mdl.html';
export const NAME = 'vnIconMdlFactory';
export function factory() {
return {
template: template,
default: {}
}
}
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 * as resolveFactory from '../resolveDefaultComponents';
import * as util from '../util';
const _NAME = 'label';
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);
import {module as _module} from '../module';
import * as resolveFactory from '../resolveDefaultComponents';
import * as util from '../util';
const _NAME = 'label';
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,20 +1,20 @@
import {module as _module} from '../module';
import * as util from '../util';
import * as constant from '../constants';
import template from './label.mdl.html';
const _NAME = 'label';
const DEFAULT_TEXT = 'label';
export const NAME = util.getFactoryName(_NAME + constant.MATERIAL_DESIGN_FRAMEWORK);
export function factory() {
return {
template: template,
default: {
text: DEFAULT_TEXT
}
}
}
_module.factory(NAME, factory);
import {module as _module} from '../module';
import * as util from '../util';
import * as constant from '../constants';
import template from './label.mdl.html';
const _NAME = 'label';
const DEFAULT_TEXT = 'label';
export const NAME = util.getFactoryName(_NAME + constant.MATERIAL_DESIGN_FRAMEWORK);
export function factory() {
return {
template: template,
default: {
text: DEFAULT_TEXT
}
}
}
_module.factory(NAME, factory);

View File

@ -1,26 +1,27 @@
import {module as _module} from '../module';
import * as resolveFactory from '../resolveDefaultComponents';
import * as normalizerFactory from '../inputAttrsNormalizer';
import * as util from '../util';
const _NAME = 'password';
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_();
});
}
}
}
_module.directive(NAME,directive);
import {module as _module} from '../module';
import * as resolveFactory from '../resolveDefaultComponents';
import * as normalizerFactory from '../inputAttrsNormalizer';
import * as util from '../util';
const _NAME = 'password';
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,17 +1,17 @@
import {module} from '../module';
import template from './password.mdl.html';
export const NAME = 'vnPasswordMdlFactory';
export function factory() {
return {
template: template,
default: {
label: 'Password',
enabled: 'enabled',
className: 'mdl-textfield__input'
}
}
}
module.factory(NAME, factory);
import {module} from '../module';
import template from './password.mdl.html';
export const NAME = 'vnPasswordMdlFactory';
export function factory() {
return {
template: template,
default: {
label: 'Password',
enabled: 'enabled',
className: 'mdl-textfield__input'
}
}
}
module.factory(NAME, factory);

View File

@ -2,87 +2,91 @@ import {module} from '../module';
import * as resolveFactory from '../resolveDefaultComponents';
require('./style.css');
const _NAME = 'popover';
export const NAME = 'vnPopover';
export function directive(resolver) {
directive.$inject = ['$compile', '$document', 'vnPopover'];
export function directive($compile, $document, popover) {
return {
restrict: 'E',
transclude: true,
controllerAs: 'popover',
template: function(_, attrs) {
return resolver.getTemplate(_NAME, attrs);
},
/* link: function(scope, element, attrs, ctrl) {
var nativeElement = element[0];
nativeElement.addEventListener('click', function(ev) {
ev.preventDefault();
ctrl.show();
restrict: 'A',
link: function($scope, $element, $attrs, $ctrl) {
$element.on('click', function(event) {
var child = $document[0].createElement($attrs.vnPopover);
$compile(child)($scope);
popover.show($element, child);
event.preventDefault();
});
},
*/ 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);
$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 {
display: none;
.vn-popover {
position: fixed;
box-shadow: 0 0 .4em rgba(1,1,1,.4);
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 * as resolveFactory from '../resolveDefaultComponents';
import * as util from '../util';
const _NAME = 'radio';
export const NAME = util.getName(_NAME);
directive.$inject = [resolveFactory.NAME];
export function directive(resolve) {
return{
restrict: 'E',
template: function(_, attrs) {
return resolve.getTemplate(_NAME, attrs);
}
}
}
_module.directive(NAME, directive);
import {module as _module} from '../module';
import * as resolveFactory from '../resolveDefaultComponents';
import * as util from '../util';
const _NAME = 'radio';
export const NAME = util.getName(_NAME);
directive.$inject = [resolveFactory.NAME];
export function directive(resolve) {
return{
restrict: 'E',
template: function(_, attrs) {
return resolve.getTemplate(_NAME, attrs);
}
}
}
_module.directive(NAME, directive);

View File

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

View File

@ -1,21 +1,21 @@
import {module as _module} from '../module';
import * as util from '../util';
import * as constant from '../constants';
import template from './radio.mdl.html';
const _NAME = 'radio';
const DEFAULT_CLASS = 'mdl-radio mdl-js-radio mdl-js-ripple-effect';
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);
import {module as _module} from '../module';
import * as util from '../util';
import * as constant from '../constants';
import template from './radio.mdl.html';
const _NAME = 'radio';
const DEFAULT_CLASS = 'mdl-radio mdl-js-radio mdl-js-ripple-effect';
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

@ -7,7 +7,7 @@ export const NAME = util.getName(_NAME);
directive.$inject = [resolveFactory.NAME];
export function directive(resolve) {
return{
return {
restrict: 'E',
template: function(_, 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>
<button class="mdl-snackbar__action" type="button"></button>
</div>

View File

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

View File

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

View File

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

View File

@ -1,18 +1,18 @@
import {module as _module} from '../module';
import * as resolveFactory from '../resolveDefaultComponents';
import * as util from '../util';
const _NAME = 'submit';
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);
import {module as _module} from '../module';
import * as resolveFactory from '../resolveDefaultComponents';
import * as util from '../util';
const _NAME = 'submit';
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,17 +1,17 @@
import {module} from '../module';
import template from './submit.mdl.html';
export const NAME = 'vnSubmitMdlFactory';
export function factory() {
return {
template: template,
default: {
label: 'Submit',
className: 'mdl-button mdl-js-button mdl-button--raised',
enabled: 'true'
}
}
}
module.factory(NAME, factory);
import {module} from '../module';
import template from './submit.mdl.html';
export const NAME = 'vnSubmitMdlFactory';
export function factory() {
return {
template: template,
default: {
label: 'Submit',
className: 'mdl-button mdl-js-button mdl-button--raised',
enabled: 'true'
}
}
}
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';
export const NAME = "vnSubtitle";
export const COMPONENT = {
template: template,
transclude: true
};
module.component(NAME, COMPONENT);
import {module} from '../module';
export const NAME = 'vnSubtitle';
export const COMPONENT = {
template: require('./template.html'),
transclude: true
};
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 * as resolveFactory from '../resolveDefaultComponents';
import * as normalizerFactory from '../inputAttrsNormalizer';
import * as util from '../util';
const _NAME = 'switch';
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.MaterialSwitch;
if (mdlField)
mdlField.updateClasses_();
});
}
};
}
_module.directive(NAME, directive);
import {module as _module} from '../module';
import * as resolveFactory from '../resolveDefaultComponents';
import * as normalizerFactory from '../inputAttrsNormalizer';
import * as util from '../util';
const _NAME = 'switch';
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.MaterialSwitch;
if (mdlField)
mdlField.updateClasses_();
});
componentHandler.upgradeElement(element[0].firstChild);
}
};
}
_module.directive(NAME, directive);

View File

@ -1,4 +1,4 @@
<label class="mdl-switch mdl-js-switch mdl-js-ripple-effect">
<input type="checkbox" class="*[className]*" ng-model="*[model]*">
<span class="mdl-switch__label">*[label]*</span>
<label class="mdl-switch mdl-js-switch mdl-js-ripple-effect">
<input type="checkbox" class="*[className]*" ng-model="*[model]*">
<span class="mdl-switch__label">*[label]*</span>
</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)
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 as _module} from '../module';
export const NAME = "vnTitle";
export const COMPONENT = {
template: template,
transclude: true
};
_module.component(NAME, COMPONENT);
import {module} from '../module';
export const NAME = 'vnTitle';
export const COMPONENT = {
template: require('./template.html'),
transclude: true
};
module.component(NAME, COMPONENT);

View File

@ -4,29 +4,29 @@
<vn-vertical pad-large>
<vn-title vn-one>Consignatario</vn-title>
<vn-horizontal>
<vn-check vn-one label="Activo" field="addressData.address.enabled"></vn-check>
<vn-check vn-one label="Predeterminado" field="addressData.address.default"></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-horizontal>
<vn-horizontal>
<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="Consignatario" field="addressData.address.consignee"></vn-textfield>
<vn-textfield vn-one label="Domicilio" field="addressData.address.street"></vn-textfield>
</vn-horizontal>
<vn-horizontal>
<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-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>
</vn-combo>
<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="Código Postal" field="addressData.address.postcode"></vn-textfield>
<vn-textfield vn-one label="Municipio" field="addressData.address.city"></vn-textfield>
<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>
</vn-combo>
<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-horizontal>
<vn-horizontal>
<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>
</vn-combo>
<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>
</vn-combo>
</vn-horizontal>
<vn-empty>
<vn-submit label="Guardar" id="save"></vn-submit>
<vn-empty margin-large-top>
<vn-submit label="Guardar" id="save"></vn-submit>
</vn-empty>
</vn-vertical>
</vn-card>

View File

@ -19,10 +19,10 @@
<vn-two></vn-two>
</vn-horizontal>
<vn-horizontal>
<vn-one>
<vn-one margin-large-top>
<vn-submit label="Guardar" id="save"></vn-submit>
</vn-one>
</vn-horizontal>
</vn-vertical>
</vn-vertical>
</vn-card>
</form>
</form>

View File

@ -6,20 +6,42 @@ export const COMPONENT = {
template: template,
controllerAs: 'basicData',
bindings: {
client: '='
client: '<'
},
controller: function($http) {
controller: function($http, copyObject, equalsObject, $transitions) {
var self = this;
var deregister = $transitions.onStart({ }, callback);
this.$onChanges = function (changes) {
if(this.client)
this.clientOld = copyObject(this.client);
}
this.$onDestroy = function(){
deregister();
}
$http.get('/client/api/SalesPeople').then(
json => this.sales = json.data,
json => console.error(json.data.error.message)
);
function callback(transition) {
if(!equalsObject(self.client, self.clientOld) && !confirm("¿Desea salir sin guardar los cambios?"))
return false;
}
this.submit = function() {
$http.put('/client/api/Clients', this.client).then(
json => console.log(json.statusText),
json => console.error(json.data.error.message)
);
if(!equalsObject(this.client, this.clientOld)){
this.client.modify = "BasicData";
$http.put('/client/api/Clients', this.client).then(
json => console.log(json.statusText),
json => console.error(json.data.error.message)
);
}
};
}
};
COMPONENT.controller.$inject = ['$http'];
COMPONENT.controller.$inject = ['$http', 'copyObject', 'equalsObject', '$transitions'];
module.component(NAME, COMPONENT);

View File

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

View File

@ -13,12 +13,6 @@ export const COMPONENT = {
$http.get(`/client/api/Clients/${$stateParams.id}`).then(
json => {
this.client = json.data;
this.descriptor = {
clientId: this.client.id,
name: this.client.name,
phone: this.client.phone,
active: this.client.active
};
},
json => console.error(json.data.error.message)
);

View File

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

View File

@ -5,11 +5,11 @@
<i class="material-icons descriptor-icon">person</i>
</vn-one>
<vn-vertical vn-two>
<div class="margin-none">{{descriptor.descriptor.clientId}}</div>
<div class="margin-none">{{descriptor.descriptor.name}}</div>
<div class="margin-none">{{descriptor.descriptor.phone}}</div>
<div class="margin-none">{{descriptor.client.clientId}}</div>
<div class="margin-none">{{descriptor.client.name}}</div>
<div class="margin-none">{{descriptor.client.phone}}</div>
</vn-vertical>
</vn-horizontal>
<vn-switch label="Activo" field="descriptor.descriptor.active"></vn-switch>
<vn-switch label="Activo" field="descriptor.client.active"></vn-switch>
</vn-vertical>
</vn-card>

View File

@ -7,7 +7,7 @@ export const COMPONENT = {
template: template,
controllerAs: 'descriptor',
bindings: {
descriptor: '<'
client: '<'
}
};
module.component(NAME, COMPONENT);

View File

@ -15,10 +15,10 @@
<vn-horizontal>
<vn-textfield vn-one label="Código postal" field="fiscal.client.postcode"></vn-textfield>
<vn-combo vn-one label="Provincia" field="fiscal.client.province">
<option ng-repeat="p in fiscal.provinces" value="{{p.id}}">{{p.name}}</option>
<option ng-repeat="p in fiscal.provinces | orderBy:'name'" value="{{p.id}}">{{p.name}}</option>
</vn-combo>
<vn-combo vn-one label="País" field="fiscal.client.country">
<option ng-repeat="c in fiscal.countries" value="{{c.id}}">{{c.name}}</option>
<option ng-repeat="c in fiscal.countries | orderBy:'name'" value="{{c.id}}">{{c.name}}</option>
</vn-combo>
</vn-horizontal>
<vn-horizontal>
@ -54,9 +54,9 @@
<vn-check vn-two label="Recibido core VNL" field="fiscal.client.coreVnl"></vn-check>
<vn-check vn-two label="Recibido B2B VNL" field="fiscal.client.sepaVnl"></vn-check>
</vn-horizontal>
<vn-empty class="margin-large-top">
<vn-submit label="Guardar"></vn-submit>
</vn-empty>
</vn-vertical>
</vn-card>
<vn-empty margin-large-top>
<vn-submit label="Guardar"></vn-submit>
</vn-empty>
</form>

View File

@ -1,13 +1,17 @@
<vn-vertical class="full-height">
<vn-topbar></vn-topbar>
<div style="max-width: 45em; margin: 0 auto;">
<div>
<div style="max-width: 39em; margin: 0 auto;">
<vn-card margin-medium>
<form pad-medium ng-submit="search.submit()">
<vn-horizontal>
<vn-searchbar vn-auto></vn-searchbar>
<a vn-empty ui-sref="create"><vn-button label="New client"></vn-button></a>
<vn-horizontal pad-medium>
<vn-searchbar
vn-auto
model="search.filter"
search="search.find()"
advanced="true"
popover="vn-client-search-panel"
params="search.filter"
return="search.find()">
</vn-searchbar>
</vn-horizontal>
</form>
</vn-card>
<vn-card margin-medium>
<vn-item-client
@ -17,4 +21,9 @@
</vn-item-client>
</vn-card>
</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',
controller: function($http) {
this.clients = [];
$http.get('/client/api/Clients').then(
json => {
this.clients = json.data;
},
json => console.error(json.data.error.message)
);
this.submit = function() {
var query = {where: model};
var self = this;
$http.get(`/client/api/Clients/findOne?filter=${JSON.stringify(query)}`).then(
function(response) {
self.clients = [];
self.clients.push(response.data);
},
function(response) {
console.log(response);
}
this.find = function() {
var queryStr = '/client/api/Clients';
var search = this.filter.search;
if(search) {
let json = JSON.stringify({where: {name: {ilike: search}}});
var queryStr = `${queryStr}?filter=${json}`;
}
$http.get(queryStr).then(
json => this.clients = json.data,
json => console.error(json.data.error.message)
);
};
this.filter = {};
this.find();
}
};
COMPONENT.controller.$inject = ['$http'];

View File

@ -1,4 +1,4 @@
<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>{{itemClient.client.id}} </div>
<div>{{itemClient.client.id}}</div>
</a>

View File

@ -1,10 +1,9 @@
<form name="form" ng-submit="form.$valid && note.submit()" pad-medium>
<vn-card>
<vn-vertical pad-large>
<vn-title>Notas</vn-title>
<vn-textfield label="Notas" class="padd-medium-top" field="note.model.notes"></vn-textfield>
<vn-submit label="Guardar"></vn-submit>
</vn-vertical>
</vn-card>
<vn-card>
<vn-vertical pad-large>
<vn-title>Notas</vn-title>
<vn-textfield label="Notas" field="note.model.notes" focus padd-medium-top></vn-textfield>
<vn-submit margin-large-top label="Guardar"></vn-submit>
</vn-vertical>
</vn-card>
</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()">
<vn-horizontal>
<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-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-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="Teléfono" field="search.model.phone"></vn-textfield>
</vn-horizontal>
<vn-button label="Search"></vn-button>
<vn-horizontal margin-large-top>
<vn-button label="Search"></vn-button>
</vn-horizontal>
</form>
</div>

View File

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

View File

@ -3,8 +3,8 @@
<vn-vertical pad-large>
<vn-title>Acceso Web</vn-title>
<vn-check label="Acceso web activo" field="web.client.active"></vn-check>
<vn-textfield label="Usuario" class="padd-medium-top margin-medium-top margin-medium-bottom" field="web.client.user" focus></vn-textfield>
<vn-submit label="Guardar"></vn-submit>
<vn-textfield label="Usuario" class="padd-medium-top margin-medium-top" field="web.client.user" focus></vn-textfield>
<vn-submit margin-large-top label="Guardar"></vn-submit>
</vn-vertical>
</vn-card>
</form>

View File

@ -18,7 +18,7 @@
"NUf7o684TmteojFX9KmPOpaDLthjP5Def4wuy83Yjv31i43HHiWgV3FyBp6pX8Ue": "{\"id\":\"NUf7o684TmteojFX9KmPOpaDLthjP5Def4wuy83Yjv31i43HHiWgV3FyBp6pX8Ue\",\"ttl\":1209600,\"created\":\"2016-11-21T11:06:11.113Z\",\"userId\":1}"
},
"Client": {
"12": "{\"name\":\"Verdnatura\",\"id\":12,\"fi\":\"B97367486\",\"salesPerson\":\"2\",\"telefono\":\"963242100\",\"socialName\":\"Verdnatura Levante SL\",\"active\":true,\"user\":\"verdnatura\",\"fax\":\"963242100\",\"phone\":\"963242100\",\"email\":\"informatica@verdnatura.es\",\"surcharge\":true,\"cyc\":2345,\"credit\":1000,\"iban\":\"2352345234523452345\",\"street\":\"Avenida Espioca, 100\",\"city\":\"Silla\",\"postcode\":\"46680\",\"mobile\":\"654654654\",\"dueDay\":4,\"gestdoc\":23452343}",
"12": "{\"name\":\"Verdnatura\",\"id\":12,\"fi\":\"B97367486\",\"salesPerson\":\"2\",\"telefono\":\"963242100\",\"socialName\":\"Verdnatura Levante SL\",\"active\":true,\"user\":\"verdnatura\",\"fax\":\"963242100\",\"phone\":\"963242100\",\"email\":\"informatica@verdnatura.es\",\"surcharge\":true,\"cyc\":2345,\"credit\":1000,\"iban\":\"2352345234523452345\",\"street\":\"Avenida Espioca, 100\",\"city\":\"Silla\",\"postcode\":\"46680\",\"mobile\":\"654654654\",\"dueDay\":4,\"gestdoc\":23452343,\"country\":\"2\",\"province\":\"2\",\"payMethod\":\"2\",\"modify\":\"BasicData\"}",
"14": "{\"name\":\"Cliente 1\",\"id\":14,\"street\":\"Aaaaaaaaaa\",\"fi\":\"1234567890A\",\"socialName\":\"Cliente 1\",\"fax\":\"963242100\",\"dischargeDate\":\"01/01/2017\",\"telefono\":\"963242100\",\"salesPerson\":\"2\",\"email\":\"informatica@verdnatura.es\",\"city\":\"asdf\",\"postcode\":\"asdf\",\"phone\":\"asdf\",\"mobile\":\"asdf\",\"credit\":2345,\"cyc\":123,\"iban\":\"asdf\",\"dueDay\":345,\"gestdoc\":2435,\"surcharge\":true}"
},
"PaymentMethod": {
@ -32,8 +32,8 @@
"3": "{\"name\":\"Carlos Zambrano\",\"id\":3}"
},
"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}",
"64": "{\"street\":\"Aaa\",\"consignee\":\"aaa\",\"city\":\"aaa\",\"postcode\":\"11111\",\"phone\":\"963242100\",\"mobile\":\"11231241423\",\"id\":64}"
"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,\"enabled\":true}"
},
"Country": {
"1": "{\"id\":1,\"name\":\"Spain\"}",

View File

@ -9,15 +9,15 @@
},
"street": {
"type": "string",
"required": "true"
"required": true
},
"consignee": {
"type": "string",
"required": "true"
"required": true
},
"city": {
"type": "string",
"required": "true"
"required": true
},
"postcode": {
"type": "string"

View File

@ -9,7 +9,7 @@
},
"name": {
"type": "string",
"required": "true"
"required": true
}
}
}

View File

@ -0,0 +1,14 @@
module.exports = function(Client) {
// prueba uno
// Client.validatesUniquenessOf('name', {message: 'el nombre debe ser unico'});
// prueba dos
Client.validate('name',hasCC,{message: 'Introducir cuenta bancaria'});
function hasCC(err) {
if (this.payMethod == 2) err();
}
};

View File

@ -1,6 +1,7 @@
{
"name": "Client",
"base": "PersistedModel",
"validateUpsert": true,
"properties": {
"id": {
"type": "Number",
@ -9,7 +10,7 @@
},
"name": {
"type": "string",
"required": "true"
"required": true
},
"fi": {
"type": "string",
@ -36,12 +37,6 @@
"postcode": {
"type": "string"
},
"province": {
"type": "Number"
},
"country": {
"type": "string"
},
"email": {
"type": "string"
},
@ -63,9 +58,6 @@
"iban": {
"type": "string"
},
"payMethod": {
"type": "string"
},
"dueDay": {
"type": "Number"
},

View File

@ -9,7 +9,7 @@
},
"name": {
"type": "string",
"required": "true"
"required": true
}
}
}

View File

@ -9,7 +9,7 @@
},
"name": {
"type": "string",
"required": "true"
"required": true
}
}
}

View File

@ -9,7 +9,7 @@
},
"name": {
"type": "string",
"required": "true"
"required": true
}
}
}

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