Merge
This commit is contained in:
commit
ef0bd78fe7
|
@ -1,6 +1,7 @@
|
|||
{
|
||||
"version": "0.2.0",
|
||||
"configurations": [
|
||||
|
||||
{
|
||||
"name": "Iniciar",
|
||||
"type": "node",
|
||||
|
@ -61,6 +62,27 @@
|
|||
"console": "internalConsole",
|
||||
"sourceMaps": false,
|
||||
"outFiles": []
|
||||
},
|
||||
{
|
||||
"name": "gulp debug",
|
||||
"type": "node",
|
||||
"request": "launch",
|
||||
"program": "${workspaceRoot}\\@salix\\node_modules\\gulp\\bin\\gulp.js",
|
||||
"stopOnEntry": false,
|
||||
"args": [],
|
||||
"cwd": "${workspaceRoot}\\@salix",
|
||||
"preLaunchTask": null,
|
||||
"runtimeExecutable": null,
|
||||
"runtimeArgs": [
|
||||
"--nolazy"
|
||||
],
|
||||
"env": {
|
||||
"NODE_ENV": "development"
|
||||
},
|
||||
"console": "internalConsole",
|
||||
"sourceMaps": false,
|
||||
"outFiles": []
|
||||
}
|
||||
|
||||
]
|
||||
}
|
|
@ -1,20 +1,20 @@
|
|||
import {module as _module} from '../module';
|
||||
import * as resolveFactory from '../resolveDefaultComponents';
|
||||
import * as normalizerFactory from '../inputAttrsNormalizer';
|
||||
import * as util from '../util';
|
||||
|
||||
const _NAME = 'check';
|
||||
export const NAME = util.getName(_NAME);
|
||||
|
||||
directive.$inject =[resolveFactory.NAME, normalizerFactory.NAME];
|
||||
export function directive (resolve, normalizer){
|
||||
return{
|
||||
require:'E',
|
||||
template: function(_,attrs){
|
||||
normalizer.normalize (attrs);
|
||||
return resolve.getTemplate(_NAME, attrs);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
_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 = 'check';
|
||||
export const NAME = util.getName(_NAME);
|
||||
|
||||
directive.$inject = [resolveFactory.NAME, normalizerFactory.NAME];
|
||||
export function directive(resolve, normalizer) {
|
||||
return {
|
||||
require: 'E',
|
||||
template: function(_, attrs) {
|
||||
normalizer.normalize(attrs);
|
||||
return resolve.getTemplate(_NAME, attrs);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
_module.directive(NAME, directive);
|
||||
|
|
|
@ -1,21 +1,21 @@
|
|||
import {module as _module} from '../module';
|
||||
import * as util from '../util';
|
||||
import * as constant from '../constants';
|
||||
import template from './check.mdl.html';
|
||||
|
||||
const _NAME = 'check';
|
||||
const DEFAULT_CLASS = 'mdl-checkbox__input';
|
||||
|
||||
export const NAME = util.getFactoryName(_NAME + constant.MATERIAL_DESIGN_FRAMEWORK);
|
||||
|
||||
export function factory() {
|
||||
return {
|
||||
template: template,
|
||||
default: {
|
||||
enabled: 'true',
|
||||
className: DEFAULT_CLASS
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
_module.factory(NAME, factory);
|
||||
import {module as _module} from '../module';
|
||||
import * as util from '../util';
|
||||
import * as constant from '../constants';
|
||||
import template from './check.mdl.html';
|
||||
|
||||
const _NAME = 'check';
|
||||
const DEFAULT_CLASS = 'mdl-checkbox__input';
|
||||
|
||||
export const NAME = util.getFactoryName(_NAME + constant.MATERIAL_DESIGN_FRAMEWORK);
|
||||
|
||||
export function factory() {
|
||||
return {
|
||||
template: template,
|
||||
default: {
|
||||
enabled: 'true',
|
||||
className: DEFAULT_CLASS
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
_module.factory(NAME, factory);
|
||||
|
|
|
@ -1,51 +1,50 @@
|
|||
import mtOverride from './mdl-override.css';
|
||||
require('./mdl-override.css');
|
||||
|
||||
export * from './module'
|
||||
export * from './util'
|
||||
export * from './module';
|
||||
export * from './util';
|
||||
|
||||
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 {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 FOCUS, directive as Focus} from './focus'
|
||||
export {NAME as RULE, directive as Rule} from './rule'
|
||||
export {NAME as FOCUS, directive as Focus} from './focus';
|
||||
export {NAME as RULE, directive as Rule} from './rule';
|
||||
|
||||
export {NAME as BUTTON, directive as ButtonDirective} from './button/button'
|
||||
export {NAME as BUTTON_MDL, factory as buttonMdl} from './button/button.mdl'
|
||||
export {NAME as BUTTON_BT, factory as buttonBt} from './button/button.bt'
|
||||
export {NAME as CHECK,directive as CheckDirective} from './check/check'
|
||||
export {NAME as CHECK_MDL, factory as checknMdl} from './check/check.mdl'
|
||||
export {NAME as CHECK_BT, factory as checkBt} from './check/check.bt'
|
||||
export {NAME as RADIO,directive as RadioDirective} from './radio/radio'
|
||||
export {NAME as RADIO_MDL, factory as radionMdl} from './radio/radio.mdl'
|
||||
export {NAME as RADIO_BT, factory as radioBt} from './radio/radio.bt'
|
||||
export {NAME as TEXTFIELD, directive as TextfieldDirective} from './textfield/textfield'
|
||||
export {NAME as TEXTFIELD_MDL, factory as textfieldMdl} from './textfield/textfield.mdl'
|
||||
export {NAME as TEXTFIELD_BT, factory as textfieldBt} from './textfield/textfield.bt'
|
||||
export {NAME as LABEL, directive as LabelDirective} from './label/label'
|
||||
export {NAME as LABEL_MDL, factory as labelMdl} from './label/label.mdl'
|
||||
export {NAME as LABEL_BT, factory as labelBt} from './label/label.bt'
|
||||
export {NAME as ICON_BUTTON, directive as IconButtonDirective} from './icon-button/icon-button'
|
||||
export {NAME as ICON_BUTTON_MDL, factory as iconButtonMdl} from './icon-button/icon-button.mdl'
|
||||
export {NAME as PASSWORD, directive as PasswordDirective} from './password/password'
|
||||
export {NAME as PASSWORD_MDL,factory as passwordMdl} from './password/password.mdl'
|
||||
export {NAME as SUBMIT, directive as SubmitDirective} from './submit/submit'
|
||||
export {NAME as SUBMIT_MDL, factory as submitMdl} from './submit/submit.mdl'
|
||||
export {NAME as SNACKBAR, directive as SnackbarDirective} from './snackbar/snackbar'
|
||||
export {NAME as SNACKBAR_MDL, factory as snackbarMdl} from './snackbar/snackbar.mdl'
|
||||
export {NAME as SPINNER, directive as SpinnerDirective} from './spinner/spinner'
|
||||
export {NAME as SPINNER_MDL, factory as spinnerMdl} from './spinner/spinner.mdl'
|
||||
export {NAME as COMBO, directive as ComboDirective} from './combo/combo'
|
||||
export {NAME as COMBO_MDL, factory as comboMdl} from './combo/combo.mdl'
|
||||
export {NAME as DATE_PICKER, directive as DatePickerDirective} from './date-picker/date-picker'
|
||||
export {NAME as DATE_PICKER_MDL, factory as datePickerMdl} from './date-picker/date-picker.mdl'
|
||||
|
||||
export {NAME as TITLE, COMPONENT as TITLE_COMPONENT} from './title/title'
|
||||
export {NAME as SUBTITLE, COMPONENT as SUBTITLE_COMPONENT} from './subtitle/subtitle'
|
||||
export {NAME as BUTTON, directive as ButtonDirective} from './button/button';
|
||||
export {NAME as BUTTON_MDL, factory as buttonMdl} from './button/button.mdl';
|
||||
export {NAME as BUTTON_BT, factory as buttonBt} from './button/button.bt';
|
||||
export {NAME as CHECK, directive as CheckDirective} from './check/check';
|
||||
export {NAME as CHECK_MDL, factory as checknMdl} from './check/check.mdl';
|
||||
export {NAME as CHECK_BT, factory as checkBt} from './check/check.bt';
|
||||
export {NAME as RADIO, directive as RadioDirective} from './radio/radio';
|
||||
export {NAME as RADIO_MDL, factory as radionMdl} from './radio/radio.mdl';
|
||||
export {NAME as RADIO_BT, factory as radioBt} from './radio/radio.bt';
|
||||
export {NAME as TEXTFIELD, directive as TextfieldDirective} from './textfield/textfield';
|
||||
export {NAME as TEXTFIELD_MDL, factory as textfieldMdl} from './textfield/textfield.mdl';
|
||||
export {NAME as TEXTFIELD_BT, factory as textfieldBt} from './textfield/textfield.bt';
|
||||
export {NAME as LABEL, directive as LabelDirective} from './label/label';
|
||||
export {NAME as LABEL_MDL, factory as labelMdl} from './label/label.mdl';
|
||||
export {NAME as LABEL_BT, factory as labelBt} from './label/label.bt';
|
||||
export {NAME as ICON_BUTTON, directive as IconButtonDirective} from './icon-button/icon-button';
|
||||
export {NAME as ICON_BUTTON_MDL, factory as iconButtonMdl} from './icon-button/icon-button.mdl';
|
||||
export {NAME as PASSWORD, directive as PasswordDirective} from './password/password';
|
||||
export {NAME as PASSWORD_MDL, factory as passwordMdl} from './password/password.mdl';
|
||||
export {NAME as SUBMIT, directive as SubmitDirective} from './submit/submit';
|
||||
export {NAME as SUBMIT_MDL, factory as submitMdl} from './submit/submit.mdl';
|
||||
export {NAME as SNACKBAR, directive as SnackbarDirective} from './snackbar/snackbar';
|
||||
export {NAME as SNACKBAR_MDL, factory as snackbarMdl} from './snackbar/snackbar.mdl';
|
||||
export {NAME as SPINNER, directive as SpinnerDirective} from './spinner/spinner';
|
||||
export {NAME as SPINNER_MDL, factory as spinnerMdl} from './spinner/spinner.mdl';
|
||||
export {NAME as COMBO, directive as ComboDirective} from './combo/combo';
|
||||
export {NAME as COMBO_MDL, factory as comboMdl} from './combo/combo.mdl';
|
||||
export {NAME as DATE_PICKER, directive as DatePickerDirective} from './date-picker/date-picker';
|
||||
export {NAME as DATE_PICKER_MDL, factory as datePickerMdl} from './date-picker/date-picker.mdl';
|
||||
|
||||
export {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';
|
||||
|
|
|
@ -4,10 +4,12 @@ export const NAME = 'vnFocus';
|
|||
export function directive() {
|
||||
return {
|
||||
restrict: 'A',
|
||||
link: function(scope, elements, attrs){
|
||||
link: function(scope, elements, attrs) {
|
||||
let element = elements[0];
|
||||
element.focus();
|
||||
element.select();
|
||||
let len = element.value ? element.value.length : 0;
|
||||
element.setSelectionRange(0, len);
|
||||
// element.select();
|
||||
}
|
||||
};
|
||||
}
|
||||
|
|
|
@ -2,8 +2,7 @@ import {module} from './module';
|
|||
|
||||
export const NAME = 'vnInputAttrsNormalizer';
|
||||
export class InputAttrsNormalizer {
|
||||
constructor () {}
|
||||
$get(){
|
||||
$get() {
|
||||
return {
|
||||
normalize: function(attrs) {
|
||||
// FIXME: No siempre se pasan estos atributos, ej: searchbar
|
||||
|
@ -25,7 +24,7 @@ export class InputAttrsNormalizer {
|
|||
attrs.focus = 'vn-focus';
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
module.provider (NAME, () => new InputAttrsNormalizer ())
|
||||
module.provider(NAME, () => new InputAttrsNormalizer());
|
||||
|
|
|
@ -1,206 +1,202 @@
|
|||
import {module} from './module';
|
||||
import {ng} from 'vendor';
|
||||
import * as util from './util';
|
||||
|
||||
export const NAME = util.getProviderName('interpolate');
|
||||
|
||||
function minErr() {}
|
||||
|
||||
function stringify(value) {
|
||||
if (value == null) { // null || undefined
|
||||
return '';
|
||||
}
|
||||
switch (typeof value) {
|
||||
case 'string':
|
||||
break;
|
||||
case 'number':
|
||||
value = '' + value;
|
||||
break;
|
||||
default:
|
||||
value = angular.toJson(value);
|
||||
}
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
var $interpolateMinErr = ng.angular.$interpolateMinErr = ng.$$minErr('$interpolate');
|
||||
|
||||
$interpolateMinErr.throwNoconcat = function (text) {
|
||||
throw $interpolateMinErr('noconcat',
|
||||
'Error while interpolating: {0}\nStrict Contextual Escaping disallows ' +
|
||||
'interpolations that concatenate multiple expressions when a trusted value is ' +
|
||||
'required. See http://docs.angularjs.org/api/ng.$sce', text);
|
||||
};
|
||||
|
||||
$interpolateMinErr.interr = function (text, err) {
|
||||
return $interpolateMinErr('interr', 'Can\'t interpolate: {0}\n{1}', text, err.toString());
|
||||
};
|
||||
|
||||
function $get($parse, $exceptionHandler, $sce) {
|
||||
var startSymbolLength = this._startSymbol.length,
|
||||
endSymbolLength = this._endSymbol.length,
|
||||
escapedStartRegexp = new RegExp(this._startSymbol.replace(/./g, escape), 'g'),
|
||||
escapedEndRegexp = new RegExp(this._endSymbol.replace(/./g, escape), 'g'),
|
||||
self = this;
|
||||
|
||||
function escape(ch) {
|
||||
return '\\\\\\' + ch;
|
||||
}
|
||||
|
||||
function unescapeText(text) {
|
||||
return text.replace(escapedStartRegexp, self._startSymbol).
|
||||
replace(escapedEndRegexp, self._endSymbol);
|
||||
}
|
||||
|
||||
// TODO: this is the same as the constantWatchDelegate in parse.js
|
||||
function constantWatchDelegate(scope, listener, objectEquality, constantInterp) {
|
||||
var unwatch = scope.$watch(function constantInterpolateWatch(scope) {
|
||||
unwatch();
|
||||
return constantInterp(scope);
|
||||
}, listener, objectEquality);
|
||||
return unwatch;
|
||||
}
|
||||
|
||||
function $interpolate(text, mustHaveExpression, trustedContext, allOrNothing)
|
||||
{
|
||||
// Provide a quick exit and simplified result function for text with no interpolation
|
||||
if (!text.length || text.indexOf(self._startSymbol) === -1)
|
||||
{
|
||||
var constantInterp;
|
||||
if (!mustHaveExpression) {
|
||||
var unescapedText = unescapeText(text);
|
||||
constantInterp = valueFn(unescapedText);
|
||||
constantInterp.exp = text;
|
||||
constantInterp.expressions = [];
|
||||
constantInterp.$$watchDelegate = constantWatchDelegate;
|
||||
}
|
||||
return constantInterp;
|
||||
}
|
||||
|
||||
allOrNothing = !!allOrNothing;
|
||||
var startIndex,
|
||||
endIndex,
|
||||
index = 0,
|
||||
expressions = [],
|
||||
parseFns = [],
|
||||
textLength = text.length,
|
||||
exp,
|
||||
concat = [],
|
||||
expressionPositions = [];
|
||||
|
||||
while (index < textLength) {
|
||||
if (((startIndex = text.indexOf(self._startSymbol, index)) !== -1) &&
|
||||
((endIndex = text.indexOf(self._endSymbol, startIndex + startSymbolLength)) !== -1)) {
|
||||
if (index !== startIndex) {
|
||||
concat.push(unescapeText(text.substring(index, startIndex)));
|
||||
}
|
||||
exp = text.substring(startIndex + startSymbolLength, endIndex);
|
||||
expressions.push(exp);
|
||||
parseFns.push($parse(exp, parseStringifyInterceptor));
|
||||
index = endIndex + endSymbolLength;
|
||||
expressionPositions.push(concat.length);
|
||||
concat.push('');
|
||||
} else {
|
||||
// we did not find an interpolation, so we have to add the remainder to the separators array
|
||||
if (index !== textLength) {
|
||||
concat.push(unescapeText(text.substring(index)));
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (trustedContext && concat.length > 1) {
|
||||
$interpolateMinErr.throwNoconcat(text);
|
||||
}
|
||||
|
||||
if (!mustHaveExpression || expressions.length) {
|
||||
var compute = function (values) {
|
||||
for (var i = 0, ii = expressions.length; i < ii; i++) {
|
||||
if (allOrNothing && isUndefined(values[i])) return;
|
||||
concat[expressionPositions[i]] = values[i];
|
||||
}
|
||||
return concat.join('');
|
||||
};
|
||||
|
||||
var getValue = function (value) {
|
||||
return trustedContext ?
|
||||
$sce.getTrusted(trustedContext, value) :
|
||||
$sce.valueOf(value);
|
||||
};
|
||||
|
||||
return angular.extend(function interpolationFn(context) {
|
||||
var i = 0;
|
||||
var ii = expressions.length;
|
||||
var values = new Array(ii);
|
||||
|
||||
try {
|
||||
for (; i < ii; i++) {
|
||||
values[i] = parseFns[i](context);
|
||||
}
|
||||
|
||||
return compute(values);
|
||||
} catch (err) {
|
||||
$exceptionHandler($interpolateMinErr.interr(text, err));
|
||||
}
|
||||
|
||||
}, {
|
||||
// all of these properties are undocumented for now
|
||||
exp: text, //just for compatibility with regular watchers created via $watch
|
||||
expressions: expressions,
|
||||
});
|
||||
}
|
||||
|
||||
function parseStringifyInterceptor(value) {
|
||||
try {
|
||||
value = getValue(value);
|
||||
return allOrNothing && !isDefined(value) ? value : stringify(value);
|
||||
} catch (err) {
|
||||
$exceptionHandler($interpolateMinErr.interr(text, err));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$interpolate.startSymbol = function () {
|
||||
return startSymbol;
|
||||
};
|
||||
|
||||
$interpolate.endSymbol = function () {
|
||||
return endSymbol;
|
||||
};
|
||||
|
||||
return $interpolate;
|
||||
}
|
||||
|
||||
$get.$inject = ['$parse', '$exceptionHandler', '$sce'];
|
||||
|
||||
export class Interpolate
|
||||
{
|
||||
constructor () {
|
||||
this._startSymbol='*[';
|
||||
this._endSymbol = ']*';
|
||||
}
|
||||
|
||||
set startSymbol (value) {
|
||||
if (value) {
|
||||
this._startSymbol = value;
|
||||
return this;
|
||||
} else {
|
||||
return this._startSymbol;
|
||||
}
|
||||
};
|
||||
|
||||
set endSymbol (value) {
|
||||
if (value) {
|
||||
this._endSymbol = value;
|
||||
return this;
|
||||
} else {
|
||||
return this._endSymbol;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
}
|
||||
|
||||
Interpolate.prototype.$get = $get;
|
||||
var interpolate = new Interpolate();
|
||||
module.provider(NAME, () => interpolate);
|
||||
import {module} from './module';
|
||||
import {ng} from 'vendor';
|
||||
import * as util from './util';
|
||||
|
||||
export const NAME = util.getProviderName('interpolate');
|
||||
|
||||
function minErr() {}
|
||||
|
||||
function stringify(value) {
|
||||
if (value === null) { // null || undefined
|
||||
return '';
|
||||
}
|
||||
switch (typeof value) {
|
||||
case 'string':
|
||||
break;
|
||||
case 'number':
|
||||
value = String(value);
|
||||
break;
|
||||
default:
|
||||
value = angular.toJson(value);
|
||||
}
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
var $interpolateMinErr = ng.angular.$interpolateMinErr = ng.$$minErr('$interpolate');
|
||||
|
||||
$interpolateMinErr.throwNoconcat = function(text) {
|
||||
throw $interpolateMinErr('noconcat',
|
||||
'Error while interpolating: {0}\nStrict Contextual Escaping disallows ' +
|
||||
'interpolations that concatenate multiple expressions when a trusted value is ' +
|
||||
'required. See http://docs.angularjs.org/api/ng.$sce', text);
|
||||
};
|
||||
|
||||
$interpolateMinErr.interr = function(text, err) {
|
||||
return $interpolateMinErr('interr', 'Can\'t interpolate: {0}\n{1}', text, err.toString());
|
||||
};
|
||||
|
||||
function $get($parse, $exceptionHandler, $sce) {
|
||||
var startSymbolLength = this._startSymbol.length,
|
||||
endSymbolLength = this._endSymbol.length,
|
||||
escapedStartRegexp = new RegExp(this._startSymbol.replace(/./g, escape), 'g'),
|
||||
escapedEndRegexp = new RegExp(this._endSymbol.replace(/./g, escape), 'g'),
|
||||
self = this;
|
||||
|
||||
function escape(ch) {
|
||||
return '\\\\\\' + ch;
|
||||
}
|
||||
|
||||
function unescapeText(text) {
|
||||
return text.replace(escapedStartRegexp, self._startSymbol)
|
||||
.replace(escapedEndRegexp, self._endSymbol);
|
||||
}
|
||||
|
||||
// TODO: this is the same as the constantWatchDelegate in parse.js
|
||||
function constantWatchDelegate(scope, listener, objectEquality, constantInterp) {
|
||||
var unwatch = scope.$watch(function constantInterpolateWatch(scope) {
|
||||
unwatch();
|
||||
return constantInterp(scope);
|
||||
}, listener, objectEquality);
|
||||
return unwatch;
|
||||
}
|
||||
|
||||
function $interpolate(text, mustHaveExpression, trustedContext, allOrNothing) {
|
||||
// Provide a quick exit and simplified result function for text with no interpolation
|
||||
if (!text.length || text.indexOf(self._startSymbol) === -1) {
|
||||
var constantInterp;
|
||||
if (!mustHaveExpression) {
|
||||
var unescapedText = unescapeText(text);
|
||||
constantInterp = valueFn(unescapedText);
|
||||
constantInterp.exp = text;
|
||||
constantInterp.expressions = [];
|
||||
constantInterp.$$watchDelegate = constantWatchDelegate;
|
||||
}
|
||||
return constantInterp;
|
||||
}
|
||||
|
||||
allOrNothing = Boolean(allOrNothing);
|
||||
var startIndex,
|
||||
endIndex,
|
||||
index = 0,
|
||||
expressions = [],
|
||||
parseFns = [],
|
||||
textLength = text.length,
|
||||
exp,
|
||||
concat = [],
|
||||
expressionPositions = [];
|
||||
|
||||
while (index < textLength) {
|
||||
if (((startIndex = text.indexOf(self._startSymbol, index)) !== -1) &&
|
||||
((endIndex = text.indexOf(self._endSymbol, startIndex + startSymbolLength)) !== -1)) {
|
||||
if (index !== startIndex) {
|
||||
concat.push(unescapeText(text.substring(index, startIndex)));
|
||||
}
|
||||
exp = text.substring(startIndex + startSymbolLength, endIndex);
|
||||
expressions.push(exp);
|
||||
parseFns.push($parse(exp, parseStringifyInterceptor));
|
||||
index = endIndex + endSymbolLength;
|
||||
expressionPositions.push(concat.length);
|
||||
concat.push('');
|
||||
} else {
|
||||
// we did not find an interpolation, so we have to add the remainder to the separators array
|
||||
if (index !== textLength) {
|
||||
concat.push(unescapeText(text.substring(index)));
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (trustedContext && concat.length > 1) {
|
||||
$interpolateMinErr.throwNoconcat(text);
|
||||
}
|
||||
|
||||
if (!mustHaveExpression || expressions.length) {
|
||||
var compute = function(values) {
|
||||
for (var i = 0, ii = expressions.length; i < ii; i++) {
|
||||
if (allOrNothing && isUndefined(values[i])) return;
|
||||
concat[expressionPositions[i]] = values[i];
|
||||
}
|
||||
return concat.join('');
|
||||
};
|
||||
|
||||
var getValue = function(value) {
|
||||
return trustedContext ?
|
||||
$sce.getTrusted(trustedContext, value) :
|
||||
$sce.valueOf(value);
|
||||
};
|
||||
|
||||
return angular.extend(function interpolationFn(context) {
|
||||
var i = 0;
|
||||
var ii = expressions.length;
|
||||
var values = new Array(ii);
|
||||
|
||||
try {
|
||||
for (; i < ii; i++) {
|
||||
values[i] = parseFns[i](context);
|
||||
}
|
||||
|
||||
return compute(values);
|
||||
} catch (err) {
|
||||
$exceptionHandler($interpolateMinErr.interr(text, err));
|
||||
}
|
||||
}, {
|
||||
// all of these properties are undocumented for now
|
||||
exp: text, // just for compatibility with regular watchers created via $watch
|
||||
expressions: expressions
|
||||
});
|
||||
}
|
||||
|
||||
function parseStringifyInterceptor(value) {
|
||||
try {
|
||||
value = getValue(value);
|
||||
return allOrNothing && !isDefined(value) ? value : stringify(value);
|
||||
} catch (err) {
|
||||
$exceptionHandler($interpolateMinErr.interr(text, err));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$interpolate.startSymbol = function() {
|
||||
return startSymbol;
|
||||
};
|
||||
|
||||
$interpolate.endSymbol = function() {
|
||||
return endSymbol;
|
||||
};
|
||||
|
||||
return $interpolate;
|
||||
}
|
||||
|
||||
$get.$inject = ['$parse', '$exceptionHandler', '$sce'];
|
||||
|
||||
export class Interpolate
|
||||
{
|
||||
constructor() {
|
||||
this._startSymbol = '*[';
|
||||
this._endSymbol = ']*';
|
||||
}
|
||||
|
||||
set startSymbol(value) {
|
||||
if (value) {
|
||||
this._startSymbol = value;
|
||||
return this;
|
||||
} else {
|
||||
return this._startSymbol;
|
||||
}
|
||||
}
|
||||
|
||||
set endSymbol(value) {
|
||||
if (value) {
|
||||
this._endSymbol = value;
|
||||
return this;
|
||||
} else {
|
||||
return this._endSymbol;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Interpolate.prototype.$get = $get;
|
||||
var interpolate = new Interpolate();
|
||||
module.provider(NAME, () => interpolate);
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
.mdl-textfield {
|
||||
width: 100%;
|
||||
}
|
||||
|
@ -19,4 +18,9 @@
|
|||
|
||||
.mdl-button--raised:hover {
|
||||
background-color: #ffa410;
|
||||
}
|
||||
|
||||
.mdl-textfield__label{
|
||||
top: 0px;
|
||||
font-size: 12px;
|
||||
}
|
|
@ -1,39 +1,39 @@
|
|||
import {module as _module} from './module';
|
||||
import * as util from './util';
|
||||
import constant from './constants';
|
||||
import Interpolate from './interpolate';
|
||||
|
||||
export const NAME = util.getProviderName('ResolveDefaultComponent');
|
||||
|
||||
function $get($injector, vnInterpolate){
|
||||
return {
|
||||
getTemplate:function(name, attrs) {
|
||||
this._frameworkName = 'Mdl';
|
||||
let _name = util.getFactoryName( name + this._frameworkName);
|
||||
let defaultfactory = $injector.has(_name) ? $injector.get(_name) : undefined;
|
||||
|
||||
if(!defaultfactory) {
|
||||
throw new Error("factory is not defined");
|
||||
}
|
||||
|
||||
let defaultValues = defaultfactory.default;
|
||||
let template = defaultfactory.template;
|
||||
let scope = Object.assign({}, defaultValues || {}, attrs || {});
|
||||
return template && vnInterpolate(template)(scope);
|
||||
}
|
||||
};
|
||||
}
|
||||
$get.$inject = ['$injector', 'vnInterpolate'];
|
||||
|
||||
export class ResolveDefaultComponent {
|
||||
constructor() {
|
||||
this._frameworkName='Mdl';
|
||||
}
|
||||
set frameworkName(value) {
|
||||
this._frameworkName = value;
|
||||
}
|
||||
}
|
||||
|
||||
ResolveDefaultComponent.prototype.$get = $get;
|
||||
var resolve = new ResolveDefaultComponent();
|
||||
_module.provider(NAME,() => resolve);
|
||||
import {module as _module} from './module';
|
||||
import * as util from './util';
|
||||
import constant from './constants';
|
||||
import Interpolate from './interpolate';
|
||||
|
||||
export const NAME = util.getProviderName('ResolveDefaultComponent');
|
||||
|
||||
function $get($injector, vnInterpolate) {
|
||||
return {
|
||||
getTemplate: function(name, attrs) {
|
||||
this._frameworkName = 'Mdl';
|
||||
let _name = util.getFactoryName(name + this._frameworkName);
|
||||
let defaultfactory = $injector.has(_name) ? $injector.get(_name) : undefined;
|
||||
|
||||
if (!defaultfactory) {
|
||||
throw new Error("factory is not defined");
|
||||
}
|
||||
|
||||
let defaultValues = defaultfactory.default;
|
||||
let template = defaultfactory.template;
|
||||
let scope = Object.assign({}, defaultValues || {}, attrs || {});
|
||||
return template && vnInterpolate(template)(scope);
|
||||
}
|
||||
};
|
||||
}
|
||||
$get.$inject = ['$injector', 'vnInterpolate'];
|
||||
|
||||
export class ResolveDefaultComponent {
|
||||
constructor() {
|
||||
this._frameworkName = 'Mdl';
|
||||
}
|
||||
set frameworkName(value) {
|
||||
this._frameworkName = value;
|
||||
}
|
||||
}
|
||||
|
||||
ResolveDefaultComponent.prototype.$get = $get;
|
||||
var resolve = new ResolveDefaultComponent();
|
||||
_module.provider(NAME, () => resolve);
|
||||
|
|
|
@ -1,27 +1,27 @@
|
|||
|
||||
import {module as _module} from './module'
|
||||
import * as util from './util'
|
||||
import {module as _module} from './module';
|
||||
import * as util from './util';
|
||||
|
||||
export const NAME = util.getProviderName ('RoutesLoader')
|
||||
export const NAME = util.getProviderName('RoutesLoader');
|
||||
|
||||
function $get($http){
|
||||
let script = document.currentScript || (() => {
|
||||
let scripts = document.getElementsByTagName ('script');
|
||||
return scripts[scripts.length - 1];
|
||||
}) ();
|
||||
|
||||
let routesCdn = script.getAttribute ('routes-cdn');
|
||||
|
||||
return $http({
|
||||
method: 'GET',
|
||||
url: routesCdn
|
||||
});
|
||||
function $get($http) {
|
||||
let script = document.currentScript || (() => {
|
||||
let scripts = document.getElementsByTagName('script');
|
||||
return scripts[scripts.length - 1];
|
||||
})();
|
||||
|
||||
let routesCdn = script.getAttribute('routes-cdn');
|
||||
|
||||
return $http({
|
||||
method: 'GET',
|
||||
url: routesCdn
|
||||
});
|
||||
}
|
||||
|
||||
$get.$inject = ["$http"];
|
||||
|
||||
export class RoutesLoader{ constructor () {} }
|
||||
export class RoutesLoader { constructor() {} }
|
||||
|
||||
RoutesLoader.prototype.$get = $get;
|
||||
var routes = new RoutesLoader ();
|
||||
_module.provider (NAME, () => routes)
|
||||
var routes = new RoutesLoader();
|
||||
_module.provider(NAME, () => routes);
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
const _SplitingRegister = () => {
|
||||
|
||||
var _graph;
|
||||
var dependencies = {};
|
||||
|
||||
|
@ -16,15 +15,14 @@ const _SplitingRegister = () => {
|
|||
}
|
||||
|
||||
return {
|
||||
registerGraph: function (graph) {
|
||||
registerGraph: function(graph) {
|
||||
_graph = graph;
|
||||
},
|
||||
register: function (dependency, loader) {
|
||||
register: function(dependency, loader) {
|
||||
dependencies[dependency] = loader;
|
||||
},
|
||||
execute: function (dependency) {
|
||||
execute: function(dependency) {
|
||||
return new Promise(resolve => {
|
||||
|
||||
var array = getDependencies(dependency);
|
||||
var arrayClone = array.concat([]);
|
||||
|
||||
|
@ -34,26 +32,22 @@ const _SplitingRegister = () => {
|
|||
}
|
||||
|
||||
(function loadDependency(dependency) {
|
||||
|
||||
if(!dependency){
|
||||
if (!dependency) {
|
||||
resolve(arrayClone);
|
||||
return;
|
||||
}
|
||||
dependency().then(function (data) {
|
||||
var _dependency = getDependency();
|
||||
loadDependency(_dependency);
|
||||
dependency().then(function(data) {
|
||||
var _dependency = getDependency();
|
||||
loadDependency(_dependency);
|
||||
});
|
||||
} (getDependency()))
|
||||
|
||||
})(getDependency());
|
||||
});
|
||||
|
||||
|
||||
},
|
||||
|
||||
write: function () {
|
||||
write: function() {
|
||||
console.log(_graph);
|
||||
}
|
||||
}
|
||||
};
|
||||
};
|
||||
window.dependencies = _SplitingRegister();
|
||||
export const SplitingRegister = window.dependencies;
|
||||
|
|
|
@ -1,20 +1,20 @@
|
|||
import {module as _module} from '../module';
|
||||
import * as resolveFactory from '../resolveDefaultComponents';
|
||||
import * as normalizerFactory from '../inputAttrsNormalizer';
|
||||
import * as util from '../util';
|
||||
|
||||
const _NAME = 'textfield';
|
||||
export const NAME = util.getName(_NAME);
|
||||
|
||||
directive.$inject =[resolveFactory.NAME, normalizerFactory.NAME];
|
||||
export function directive (resolve, normalizer){
|
||||
return{
|
||||
require:'E',
|
||||
template: function(_, attrs){
|
||||
normalizer.normalize (attrs);
|
||||
return resolve.getTemplate(_NAME, attrs);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
_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 = 'textfield';
|
||||
export const NAME = util.getName(_NAME);
|
||||
|
||||
directive.$inject = [resolveFactory.NAME, normalizerFactory.NAME];
|
||||
export function directive(resolve, normalizer) {
|
||||
return {
|
||||
require: 'E',
|
||||
template: function(_, attrs) {
|
||||
normalizer.normalize(attrs);
|
||||
return resolve.getTemplate(_NAME, attrs);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
_module.directive(NAME, directive);
|
||||
|
|
|
@ -1,25 +1,25 @@
|
|||
import {module as _module} from '../module';
|
||||
import * as util from '../util';
|
||||
import * as constant from '../constants';
|
||||
import template from './textfield.mdl.html';
|
||||
|
||||
const _NAME = 'textfield';
|
||||
const DEFAULT_LABEL = 'text';
|
||||
const DEFAULT_CLASS = 'mdl-textfield__input';
|
||||
const DEFAULT_TYPE = 'text';
|
||||
|
||||
export const NAME = util.getFactoryName(_NAME + constant.MATERIAL_DESIGN_FRAMEWORK);
|
||||
|
||||
export function factory() {
|
||||
return {
|
||||
template: template,
|
||||
default: {
|
||||
label: DEFAULT_LABEL,
|
||||
name: 'textfield',
|
||||
className: DEFAULT_CLASS,
|
||||
type: DEFAULT_TYPE
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
_module.factory(NAME, factory);
|
||||
import {module as _module} from '../module';
|
||||
import * as util from '../util';
|
||||
import * as constant from '../constants';
|
||||
import template from './textfield.mdl.html';
|
||||
|
||||
const _NAME = 'textfield';
|
||||
const DEFAULT_LABEL = 'text';
|
||||
const DEFAULT_CLASS = 'mdl-textfield__input';
|
||||
const DEFAULT_TYPE = 'text';
|
||||
|
||||
export const NAME = util.getFactoryName(_NAME + constant.MATERIAL_DESIGN_FRAMEWORK);
|
||||
|
||||
export function factory() {
|
||||
return {
|
||||
template: template,
|
||||
default: {
|
||||
label: DEFAULT_LABEL,
|
||||
name: 'textfield',
|
||||
className: DEFAULT_CLASS,
|
||||
type: DEFAULT_TYPE
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
_module.factory(NAME, factory);
|
||||
|
|
|
@ -1,47 +1,47 @@
|
|||
import * as constant from './constants';
|
||||
|
||||
const FACTORY = 'Factory';
|
||||
const SERVICE = 'Service';
|
||||
|
||||
export function getName(name) {
|
||||
return constant.PREFIX + toUpperCamelCase(name)
|
||||
}
|
||||
|
||||
export function toUpperCamelCase(stringToConvert){
|
||||
return stringToConvert.substr( 0, 1 ).toUpperCase() + stringToConvert.substr( 1 )
|
||||
}
|
||||
|
||||
export function getFactoryName(name){
|
||||
return getName(name) + FACTORY
|
||||
}
|
||||
|
||||
export function getServiceName(name){
|
||||
return getName(name) + SERVICE
|
||||
}
|
||||
|
||||
export function getModuleName(name){
|
||||
return constant.PREFIX + name;
|
||||
}
|
||||
|
||||
export function getProviderNameFromConfig(name){
|
||||
return getName(name) + 'Provider';
|
||||
}
|
||||
|
||||
export function getProviderName(name){
|
||||
return getName(name);
|
||||
}
|
||||
|
||||
export function getTemplateName(componentName,frameworkName){
|
||||
return componentName + '.' + frameworkName + '.' + '.html'
|
||||
}
|
||||
|
||||
export function getVendorDependencies(vendors){
|
||||
let dependencies = [];
|
||||
Object.keys(vendors).forEach((vendor)=>{
|
||||
let name = vendors[vendor].name;
|
||||
if(name){
|
||||
dependencies.push(name)
|
||||
}
|
||||
});
|
||||
return dependencies;
|
||||
}
|
||||
import * as constant from './constants';
|
||||
|
||||
const FACTORY = 'Factory';
|
||||
const SERVICE = 'Service';
|
||||
|
||||
export function getName(name) {
|
||||
return constant.PREFIX + toUpperCamelCase(name);
|
||||
}
|
||||
|
||||
export function toUpperCamelCase(stringToConvert) {
|
||||
return stringToConvert.substr(0, 1).toUpperCase() + stringToConvert.substr(1);
|
||||
}
|
||||
|
||||
export function getFactoryName(name) {
|
||||
return getName(name) + FACTORY;
|
||||
}
|
||||
|
||||
export function getServiceName(name) {
|
||||
return getName(name) + SERVICE;
|
||||
}
|
||||
|
||||
export function getModuleName(name) {
|
||||
return constant.PREFIX + name;
|
||||
}
|
||||
|
||||
export function getProviderNameFromConfig(name) {
|
||||
return getName(name) + 'Provider';
|
||||
}
|
||||
|
||||
export function getProviderName(name) {
|
||||
return getName(name);
|
||||
}
|
||||
|
||||
export function getTemplateName(componentName, frameworkName) {
|
||||
return componentName + '.' + frameworkName + '.html';
|
||||
}
|
||||
|
||||
export function getVendorDependencies(vendors) {
|
||||
let dependencies = [];
|
||||
Object.keys(vendors).forEach(vendor => {
|
||||
let name = vendors[vendor].name;
|
||||
if (name) {
|
||||
dependencies.push(name);
|
||||
}
|
||||
});
|
||||
return dependencies;
|
||||
}
|
||||
|
|
|
@ -1,20 +1,20 @@
|
|||
<form ng-submit="basicData.submit()" pad-large>
|
||||
<vn-title>Datos básicos</vn-title>
|
||||
<vn-horizontal>
|
||||
<vn-textfield vn-one label="Nombre" model="basicData.client.name" entity="basicData"></vn-textfield>
|
||||
<vn-textfield vn-one label="NIF/CIF" model="basicData.client.fi" entity="basicData"></vn-textfield>
|
||||
<vn-textfield vn-one label="Nombre" model="basicData.client.name" entity="basicData" name="name"></vn-textfield>
|
||||
<vn-textfield vn-one label="NIF/CIF" model="basicData.client.fi" entity="basicData" name="fi"></vn-textfield>
|
||||
</vn-horizontal>
|
||||
<vn-horizontal>
|
||||
<vn-textfield autofocus vn-one label="Razón social" model="basicData.client.socialName" entity="basicData"></vn-textfield>
|
||||
<vn-date-picker vn-one label="Fecha alta" model="basicData.client.dischargeDate" entity="basicData"></vn-date-picker>
|
||||
<vn-textfield autofocus vn-one label="Razón social" model="basicData.client.socialName" entity="basicData" name="socialName"></vn-textfield>
|
||||
<vn-date-picker vn-one label="Fecha alta" model="basicData.client.dischargeDate" entity="basicData" name="registerDate" ></vn-date-picker>
|
||||
</vn-horizontal>
|
||||
<vn-horizontal>
|
||||
<vn-textfield vn-one label="Teléfono" model="basicData.client.telefono" entity="basicData"></vn-textfield>
|
||||
<vn-textfield vn-one label="Fax" model="basicData.client.fax" entity="basicData"></vn-textfield>
|
||||
<vn-textfield vn-one label="Email" fiemodelld="basicData.client.email" entity="basicData"></vn-textfield>
|
||||
<vn-textfield vn-one label="Teléfono" model="basicData.client.telefono" entity="basicData" name="phone"></vn-textfield>
|
||||
<vn-textfield vn-one label="Fax" model="basicData.client.fax" entity="basicData" name="fax"></vn-textfield>
|
||||
<vn-textfield vn-one label="Email" model="basicData.client.email" entity="basicData" name="email"></vn-textfield>
|
||||
</vn-horizontal>
|
||||
<vn-horizontal>
|
||||
<vn-combo vn-one label="Comercial" model="basicData.client.salesPerson" entity="basicData">
|
||||
<vn-combo vn-one label="Comercial" model="basicData.client.salesPerson" entity="basicData" name="comercial">
|
||||
<option ng-repeat="p in basicData.sales" value="{{p.id}}">{{p.name}}</ng-repeat>
|
||||
</vn-combo>
|
||||
</vn-horizontal>
|
||||
|
|
|
@ -10,21 +10,21 @@ export const COMPONENT = {
|
|||
controller: function($http, $stateParams) {
|
||||
this.client = null;
|
||||
$http.get(`/client/api/Clients/${$stateParams.id}`).then(
|
||||
(json) => {
|
||||
this.client = json.data;
|
||||
json => {
|
||||
this.client = json.data;
|
||||
this.descriptor = {
|
||||
clientId: this.client.id,
|
||||
name: this.client.name,
|
||||
phone: this.client.phone
|
||||
};
|
||||
},
|
||||
(json) => console.error (json.data.error.message)
|
||||
json => console.error(json.data.error.message)
|
||||
);
|
||||
|
||||
this.items = [];
|
||||
routes['client'].routes.forEach ((i) => {
|
||||
routes.client.routes.forEach(i => {
|
||||
if (i.description)
|
||||
this.items.push ({
|
||||
this.items.push({
|
||||
description: i.description,
|
||||
icon: i.icon,
|
||||
href: i.state
|
||||
|
|
|
@ -1,39 +1,39 @@
|
|||
|
||||
<form ng-submit="frm.isValid && fiscal.submit()" pad-large>
|
||||
<form ng-submit="fiscal.submit()" pad-large>
|
||||
<vn-title>Datos fiscales y de facturación</vn-title>
|
||||
<vn-horizontal>
|
||||
<vn-check vn-one label="Cliente activo" field="active" entity="fiscal"></vn-check>
|
||||
<vn-check vn-one label="Facturar" field="invoice" entity="fiscal"></vn-check>
|
||||
<vn-check vn-one label="Factura impresa" field="mailInvoice" entity="fiscal"></vn-check>
|
||||
<vn-horizontal>
|
||||
<vn-check vn-one label="Cliente activo" model="fiscal.client.active" rule="client.active" name="active"></vn-check>
|
||||
<vn-check vn-one label="Facturar" field="hasToInvoice" entity="fiscal"></vn-check>
|
||||
<vn-check vn-one label="Factura impresa" field="invoiceByEmail" entity="fiscal"></vn-check>
|
||||
</vn-horizontal>
|
||||
<vn-horizontal>
|
||||
<vn-textfield vn-two label="Domicilio fiscal" field="consignee" entity="fiscal"></vn-textfield>
|
||||
<vn-textfield vn-one label="Municipio" field="city" entity="fiscal"></vn-textfield>
|
||||
<vn-textfield vn-two label="Domicilio fiscal" model="fiscal.client.street" rule="client.street" name="street"></vn-textfield>
|
||||
<vn-textfield vn-one label="Municipio" model="fiscal.client.city" rule="client.city" name="city"></vn-textfield>
|
||||
</vn-horizontal>
|
||||
<vn-horizontal>
|
||||
<vn-textfield vn-one label="Código postal" field="postcode" entity="fiscal"></vn-textfield>
|
||||
<vn-combo vn-one label="Provincia" field="province" entity="fiscal"></vn-combo>
|
||||
<vn-textfield vn-one label="Código postal" model="fiscal.client.postcode" rule="client.postcode" name="postcode"></vn-textfield>
|
||||
<vn-combo vn-one label="Provincia" model="fiscal.client.province" rule="client.province" name="province"></vn-combo>
|
||||
<vn-combo vn-one label="País" field="country" entity="fiscal">
|
||||
<option value="1">Comercial 1</option>
|
||||
<option value="2">Comercial 2</option>
|
||||
</vn-combo>
|
||||
</vn-horizontal>
|
||||
<vn-horizontal>
|
||||
<vn-textfield vn-one label="Teléfono Fijo" field="phone" entity="fiscal"></vn-textfield>
|
||||
<vn-textfield vn-one label="Teléfono Movil" field="mobile" entity="fiscal"></vn-textfield>
|
||||
<vn-textfield vn-one label="Correo electrónico" field="email" entity="fiscal"></vn-textfield>
|
||||
<vn-textfield vn-one label="Teléfono Fijo" model="fiscal.client.phone" rule="client.phone" name="phone"></vn-textfield>
|
||||
<vn-textfield vn-one label="Teléfono Movil" model="fiscal.client.mobile" rule="client.mobile" name="mobile"></vn-textfield>
|
||||
<vn-textfield vn-one label="Correo electrónico" model="fiscal.client.email" rule="client.email" name="email"></vn-textfield>
|
||||
</vn-horizontal>
|
||||
<vn-subtitle>Información de facturación</vn-subtitle>
|
||||
<vn-horizontal>
|
||||
<vn-combo vn-two label="Forma de pago" field="payMethod" entity="fiscal"></vn-combo>
|
||||
<vn-textfield vn-one label="Vencimiento" field="expiration" entity="fiscal"></vn-textfield>
|
||||
<vn-check vn-three label="Recargo de equivalencia" field="er" entity="fiscal"></vn-check>
|
||||
<vn-textfield vn-one label="Vencimiento" model="fiscal.client.dueDay" rule="client.dueDay" name="dueDay"></vn-textfield>
|
||||
<vn-check vn-three label="Recargo de equivalencia" model="fiscal.client.surcharge" rule="client.surcharge" name="surcharge"></vn-check>
|
||||
</vn-horizontal>
|
||||
<vn-horizontal>
|
||||
<vn-textfield vn-one label="Crédito" field="credit" entity="fiscal"></vn-textfield>
|
||||
<vn-textfield vn-one label="CyC" field="cyc" entity="fiscal"></vn-textfield>
|
||||
<vn-textfield vn-one label="IAE" field="iae" entity="fiscal"></vn-textfield>
|
||||
<vn-textfield vn-three label="IBAN" field="iban" entity="fiscal"></vn-textfield>
|
||||
<vn-textfield vn-one label="Crédito" model="fiscal.client.credit" rule="client.credit" name="credit"></vn-textfield>
|
||||
<vn-textfield vn-one label="CyC" model="fiscal.client.cyc" rule="client.cyc" name="cyc"></vn-textfield>
|
||||
<vn-textfield vn-one label="IAE" model="fiscal.client.gestdoc" rule="client.gestdoc" name="gestdoc"></vn-textfield>
|
||||
<vn-textfield vn-three label="IBAN" model="fiscal.client.iban" rule="client.iban" name="iban"></vn-textfield>
|
||||
</vn-horizontal>
|
||||
<vn-subtitle>Documentación</vn-subtitle>
|
||||
<vn-horizontal>
|
||||
|
|
|
@ -5,9 +5,19 @@ export const NAME = 'vnClientFiscalData';
|
|||
export const COMPONENT = {
|
||||
template: template,
|
||||
controllerAs: 'fiscal',
|
||||
bindings: {
|
||||
client: '<'
|
||||
},
|
||||
controller: function($http) {
|
||||
$http.get('/client/api/SalesPeople').then(
|
||||
json => {
|
||||
this.sales = json.data;
|
||||
console.log(this.sales);
|
||||
},
|
||||
json => console.error(json.data.error.message)
|
||||
);
|
||||
this.submit = function() {
|
||||
$http.post('/client/api/Clients', this.model).then(
|
||||
$http.put('/client/api/Clients', this.client).then(
|
||||
json => console.log(json.statusText),
|
||||
json => console.error(json.data.error.message)
|
||||
);
|
||||
|
|
|
@ -25,6 +25,9 @@
|
|||
url: "/fiscal-data",
|
||||
state: "clientCard.fiscalData",
|
||||
component: "vn-client-fiscal-data",
|
||||
params: {
|
||||
client: "card.client"
|
||||
},
|
||||
description: "Datos facturación",
|
||||
icon: "assignment"
|
||||
},
|
||||
|
@ -39,6 +42,9 @@
|
|||
url: "/web-access",
|
||||
state: "clientCard.webAccess",
|
||||
component: "vn-client-web-access",
|
||||
params: {
|
||||
client: "card.client"
|
||||
},
|
||||
description: "Acceso web",
|
||||
icon: "language"
|
||||
},
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<form ng-submit="web.submit()" pad-large>
|
||||
<vn-title>Acceso Web</vn-title>
|
||||
<vn-check label="Acceso web activo" field="active" entity="web"></vn-check>
|
||||
<vn-textfield label="Usuario" class="padd-medium-top" field="user" entity="web"></vn-textfield>
|
||||
<vn-check label="Acceso web activo" model="web.client.active" rule="client.active" name="active"></vn-check>
|
||||
<vn-textfield label="Usuario" class="padd-medium-top" model="web.client.user" focus></vn-textfield>
|
||||
<vn-submit label="Guardar"></vn-submit>
|
||||
</form>
|
|
@ -3,7 +3,19 @@ import {module} from '../../module';
|
|||
|
||||
export const NAME = 'vnClientWebAccess';
|
||||
export const COMPONENT = {
|
||||
template: template,
|
||||
controllerAs: 'web',
|
||||
template: template
|
||||
bindings: {
|
||||
client: '<'
|
||||
},
|
||||
controller: function($http) {
|
||||
this.submit = function() {
|
||||
$http.put('/client/api/Clients', this.client).then(
|
||||
json => console.log(json.statusText),
|
||||
json => console.error(json.data.error.message)
|
||||
);
|
||||
};
|
||||
}
|
||||
};
|
||||
module.component(NAME, COMPONENT);
|
||||
COMPONENT.controller.$inject = ['$http'];
|
||||
module.component(NAME, COMPONENT);
|
||||
|
|
|
@ -13,86 +13,86 @@ var webpackConfig = require('./webpack.config.js');
|
|||
|
||||
// Clean
|
||||
|
||||
var buildDir = '../services/nginx/static'
|
||||
var buildDir = '../services/nginx/static';
|
||||
|
||||
gulp.task('clean', function() {
|
||||
return del(buildDir +'/*', {force: true});
|
||||
return del(buildDir + '/*', {force: true});
|
||||
});
|
||||
|
||||
// Spliting
|
||||
|
||||
var splitingDir = './app/src/spliting';
|
||||
var splitingFiles = splitingDir +'/*';
|
||||
var splitingFiles = splitingDir + '/*';
|
||||
|
||||
gulp.task('spliting', function() {
|
||||
var jsonDeps = fs.readFileSync(splitingDir +'/deps.json');
|
||||
var modules = JSON.parse(jsonDeps);
|
||||
var jsonDeps = fs.readFileSync(splitingDir + '/deps.json');
|
||||
var modules = JSON.parse(jsonDeps);
|
||||
|
||||
var importTpl = fs.readFileSync(splitingDir +'/import.tpl.js', 'utf8');
|
||||
var requireTpl = fs.readFileSync(splitingDir +'/require.tpl.js', 'utf8');
|
||||
var importTpl = fs.readFileSync(splitingDir + '/import.tpl.js', 'utf8');
|
||||
var requireTpl = fs.readFileSync(splitingDir + '/require.tpl.js', 'utf8');
|
||||
|
||||
for(var modName in modules)
|
||||
for (var modName in modules)
|
||||
{
|
||||
var deps = modules[modName];
|
||||
var splitFile = './'+ modName +'/src/spliting.js';
|
||||
|
||||
try {
|
||||
fs.unlinkSync(splitFile);
|
||||
}
|
||||
catch(e) {}
|
||||
|
||||
fs.appendFileSync(splitFile, importTpl);
|
||||
|
||||
var i = deps.length;
|
||||
while(i--)
|
||||
fs.appendFileSync(splitFile,
|
||||
var deps = modules[modName];
|
||||
var splitFile = './' + modName + '/src/spliting.js';
|
||||
|
||||
try {
|
||||
fs.unlinkSync(splitFile);
|
||||
}
|
||||
catch (e) {}
|
||||
|
||||
fs.appendFileSync(splitFile, importTpl);
|
||||
|
||||
var i = deps.length;
|
||||
while (i--)
|
||||
fs.appendFileSync(splitFile,
|
||||
requireTpl.replace(/\$module/g, deps[i]));
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// Webpack
|
||||
|
||||
gulp.task('webpack', ['spliting'], function(callback) {
|
||||
var myDevConfig = Object.create(webpackConfig);
|
||||
myDevConfig.debug = true;
|
||||
var myDevConfig = Object.create(webpackConfig);
|
||||
myDevConfig.debug = true;
|
||||
|
||||
var devCompiler = webpack(myDevConfig);
|
||||
var devCompiler = webpack(myDevConfig);
|
||||
|
||||
devCompiler.run(function(err, stats) {
|
||||
if(err) throw new gutil.PluginError('webpack', err);
|
||||
gutil.log('[webpack]', stats.toString({colors: true}));
|
||||
callback();
|
||||
});
|
||||
devCompiler.run(function(err, stats) {
|
||||
if (err) throw new gutil.PluginError('webpack', err);
|
||||
gutil.log('[webpack]', stats.toString({colors: true}));
|
||||
callback();
|
||||
});
|
||||
});
|
||||
|
||||
gulp.task('webpack-dev-server', ['spliting'], function() {
|
||||
var myConfig = Object.create(webpackConfig);
|
||||
myConfig.debug = true;
|
||||
var myConfig = Object.create(webpackConfig);
|
||||
myConfig.debug = true;
|
||||
|
||||
for (var entry in myConfig.entry)
|
||||
myConfig.entry[entry]
|
||||
for (var entry in myConfig.entry)
|
||||
myConfig.entry[entry]
|
||||
.unshift('webpack-dev-server/client?http://0.0.0.0:8081/');
|
||||
|
||||
var devServer = new WebpackDevServer(webpack(myConfig), {
|
||||
publicPath: '/',
|
||||
contentBase: buildDir,
|
||||
quiet: false,
|
||||
noInfo: false,
|
||||
//hot: true,
|
||||
stats: {
|
||||
assets: true,
|
||||
colors: true,
|
||||
version: false,
|
||||
hash: false,
|
||||
timings: true,
|
||||
chunks: false,
|
||||
chunkModules: false
|
||||
}
|
||||
})
|
||||
var devServer = new WebpackDevServer(webpack(myConfig), {
|
||||
publicPath: '/',
|
||||
contentBase: buildDir,
|
||||
quiet: false,
|
||||
noInfo: false,
|
||||
// hot: true,
|
||||
stats: {
|
||||
assets: true,
|
||||
colors: true,
|
||||
version: false,
|
||||
hash: false,
|
||||
timings: true,
|
||||
chunks: false,
|
||||
chunkModules: false
|
||||
}
|
||||
})
|
||||
.listen(8081, '0.0.0.0', function(err) {
|
||||
if(err) throw new gutil.PluginError('webpack-dev-server', err);
|
||||
gutil.log('[webpack-dev-server]', 'Listening');
|
||||
});
|
||||
if (err) throw new gutil.PluginError('webpack-dev-server', err);
|
||||
gutil.log('[webpack-dev-server]', 'Listening');
|
||||
});
|
||||
});
|
||||
|
||||
// Routes
|
||||
|
@ -100,17 +100,17 @@ gulp.task('webpack-dev-server', ['spliting'], function() {
|
|||
var routeFiles = './crud/**/routes.js';
|
||||
|
||||
gulp.task('routes', function() {
|
||||
var fileTpl = '\n"<%=dirname%>": <%=contents%>';
|
||||
var globalTpl = 'var routes = {<%=contents%>\n}';
|
||||
var regex = new RegExp('^src/(.*)/routes\.js$');
|
||||
var fileTpl = '\n"<%=dirname%>": <%=contents%>';
|
||||
var globalTpl = 'var routes = {<%=contents%>\n}';
|
||||
var regex = new RegExp('^src/(.*)/routes\.js$');
|
||||
|
||||
function cb(file) {
|
||||
var relative = file.relative.replace('\\', '/');
|
||||
var dirname = relative.match(regex)[1];
|
||||
return {dirname: dirname};
|
||||
}
|
||||
function cb(file) {
|
||||
var relative = file.relative.replace(/\\/g, '/');
|
||||
var dirname = relative.match(regex)[1];
|
||||
return {dirname: dirname};
|
||||
}
|
||||
|
||||
return gulp.src(routeFiles)
|
||||
return gulp.src(routeFiles)
|
||||
.pipe(wrap(fileTpl, cb))
|
||||
.pipe(concat('salix.routes.js', {newLine: ','}))
|
||||
.pipe(wrap(globalTpl))
|
||||
|
@ -121,16 +121,16 @@ gulp.task('routes', function() {
|
|||
// Watch
|
||||
|
||||
gulp.task('watch', function() {
|
||||
gulp.watch(routeFiles, ['routes']);
|
||||
gulp.watch(splitingFiles, ['spliting']);
|
||||
gulp.watch(routeFiles, ['routes']);
|
||||
gulp.watch(splitingFiles, ['spliting']);
|
||||
});
|
||||
|
||||
// Default
|
||||
|
||||
gulp.task('build', ['clean'], function() {
|
||||
return gulp.start('routes', 'webpack');
|
||||
return gulp.start('routes', 'webpack');
|
||||
});
|
||||
|
||||
gulp.task('default', ['clean'], function() {
|
||||
return gulp.start('watch', 'routes', 'webpack-dev-server');
|
||||
return gulp.start('watch', 'routes', 'webpack-dev-server');
|
||||
});
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
"angular-translate": "^2.13.1",
|
||||
"angular-ui-router": "^1.0.0-beta.3",
|
||||
"express": "^4.14.0",
|
||||
"material-design-lite": "^1.2.1",
|
||||
"material-design-lite": "^1.3.0",
|
||||
"oclazyload": "^0.6.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import * as _materialdesignlite from 'material-design-lite';
|
||||
import * as css from 'material-design-lite/material.min.css';
|
||||
|
||||
import * as _materialdesignlite from 'material-design-lite';
|
||||
import * as css from 'material-design-lite/material.min.css';
|
||||
|
||||
export const materialdesignlite = _materialdesignlite;
|
4
db.json
4
db.json
|
@ -14,8 +14,8 @@
|
|||
"NUf7o684TmteojFX9KmPOpaDLthjP5Def4wuy83Yjv31i43HHiWgV3FyBp6pX8Ue": "{\"id\":\"NUf7o684TmteojFX9KmPOpaDLthjP5Def4wuy83Yjv31i43HHiWgV3FyBp6pX8Ue\",\"ttl\":1209600,\"created\":\"2016-11-21T11:06:11.113Z\",\"userId\":1}"
|
||||
},
|
||||
"Client": {
|
||||
"12": "{\"name\":\"Cliente 2\",\"id\":12,\"fi\":\"1111111111\",\"salesPerson\":\"2\"}",
|
||||
"14": "{\"name\":\"cliente 1\",\"id\":14}"
|
||||
"12": "{\"name\":\"fa\",\"id\":12,\"fi\":\"1111111111\",\"salesPerson\":\"2\",\"telefono\":\"654654654\",\"socialName\":\"asdfasdfasdf\",\"active\":true,\"user\":\"gva\",\"fax\":\"hn\",\"phone\":\"45745675\",\"email\":\"asdf@osij.com\",\"surcharge\":true,\"cyc\":\"2345\",\"credit\":1000,\"iban\":\"2352345234523452345\",\"street\":\"asdfasdf\",\"city\":\"algemesi\",\"postcode\":\"46680\",\"mobile\":\"654654654\",\"dueDay\":\"4\",\"gestdoc\":\"23452343\"}",
|
||||
"14": "{\"name\":\"cliente f\",\"id\":14,\"street\":\"Aaaaaaaaaa\",\"fi\":\"20420\",\"socialName\":\"sdfg\",\"fax\":\"sdfg\",\"dischargeDate\":\"sdfg\",\"telefono\":\"sdfg\",\"salesPerson\":\"2\",\"email\":\"sdfg\",\"city\":\"asdf\",\"postcode\":\"asdf\",\"phone\":\"asdf\",\"mobile\":\"asdf\",\"credit\":2345,\"cyc\":123,\"iban\":\"asdf\",\"dueDay\":345,\"gestdoc\":2435,\"surcharge\":true}"
|
||||
},
|
||||
"PaymentMethod": {
|
||||
"1": "{\"name\":\"Tarjeta\",\"id\":1}",
|
||||
|
|
9
dev.cmd
9
dev.cmd
|
@ -1,6 +1,6 @@
|
|||
@echo off
|
||||
|
||||
set currentDir=%~dp0
|
||||
set currentDir=%cd%
|
||||
set nginxPrefix=%currentDir%\services\nginx
|
||||
set nginxConf=%nginxPrefix%\conf-dev.conf
|
||||
|
||||
|
@ -12,18 +12,19 @@ goto caseUsage
|
|||
:caseStart
|
||||
call "%0" stop
|
||||
echo "################################ Starting services"
|
||||
if not exist "%nginxPrefix%\temp" (mkdir "%nginxPrefix%\temp")
|
||||
start /I nginx -c "%nginxConf%" -p "%nginxPrefix%"
|
||||
call forever start forever.json
|
||||
call forever list
|
||||
call mkdir "%nginxPrefix%\temp"
|
||||
call start /b nginx -c "%nginxConf%" -p "%nginxPrefix%"
|
||||
|
||||
cd @salix
|
||||
gulp
|
||||
goto caseExit
|
||||
|
||||
:caseStop
|
||||
echo "################################ Stoping services"
|
||||
if exist "%nginxPrefix%\temp\nginx.pid" (nginx -c "%nginxConf%" -p "%nginxPrefix%" -s stop)
|
||||
forever stopall
|
||||
nginx -c "%nginxConf%" -p "%nginxPrefix%" -s stop
|
||||
goto caseExit
|
||||
|
||||
:caseUsage
|
||||
|
|
|
@ -24,6 +24,28 @@
|
|||
"contact": {
|
||||
"type": "string"
|
||||
},
|
||||
"street": {
|
||||
"type": "string",
|
||||
"required": "true"
|
||||
},
|
||||
"consignee": {
|
||||
"type": "string",
|
||||
"required": "true"
|
||||
},
|
||||
"city": {
|
||||
"type": "string",
|
||||
"required": "true"
|
||||
},
|
||||
"postcode": {
|
||||
"type": "string"
|
||||
},
|
||||
"province": {
|
||||
"type": "Number"
|
||||
},
|
||||
"country": {
|
||||
"type": "string",
|
||||
"required": "true"
|
||||
},
|
||||
"email": {
|
||||
"type": "string"
|
||||
},
|
||||
|
@ -39,7 +61,7 @@
|
|||
"credit": {
|
||||
"type": "Number"
|
||||
},
|
||||
"creditAndCaution": {
|
||||
"cyc": {
|
||||
"type": "Number"
|
||||
},
|
||||
"iban": {
|
||||
|
@ -48,6 +70,12 @@
|
|||
"payMethod": {
|
||||
"type": "string"
|
||||
},
|
||||
"dueDay": {
|
||||
"type": "Number"
|
||||
},
|
||||
"gestdoc":{
|
||||
"type":"Number"
|
||||
},
|
||||
"surcharge": {
|
||||
"type": "boolean",
|
||||
"description": "The client has equivalence surcharge"
|
||||
|
|
|
@ -0,0 +1,18 @@
|
|||
{
|
||||
"name": "account",
|
||||
"base": "PersistedModel",
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "Number",
|
||||
"id": true,
|
||||
"description": "Identifier"
|
||||
},
|
||||
"name": {
|
||||
"type": "string",
|
||||
"required": "true"
|
||||
},
|
||||
"active": {
|
||||
"type": "boolean"
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,2 +1,3 @@
|
|||
logs/*
|
||||
static/*
|
||||
temp/*
|
|
@ -0,0 +1,16 @@
|
|||
2016/12/28 09:50:24 [notice] 5196#5988: signal process started
|
||||
2016/12/28 10:09:41 [notice] 11168#10432: signal process started
|
||||
2016/12/28 14:03:31 [notice] 10312#9012: signal process started
|
||||
2016/12/28 14:04:01 [notice] 9996#32: signal process started
|
||||
2016/12/28 14:08:07 [notice] 7984#8980: signal process started
|
||||
2016/12/28 14:13:33 [notice] 10144#6644: signal process started
|
||||
2016/12/28 14:44:57 [notice] 3248#9176: signal process started
|
||||
2017/01/02 09:41:56 [notice] 9224#8900: signal process started
|
||||
2017/01/02 10:05:09 [notice] 2788#8880: signal process started
|
||||
2017/01/02 11:46:35 [notice] 8308#7808: signal process started
|
||||
2017/01/02 12:45:38 [notice] 8064#2328: signal process started
|
||||
2017/01/02 12:58:52 [notice] 6156#4768: signal process started
|
||||
2017/01/02 12:59:47 [notice] 9624#10876: signal process started
|
||||
2017/01/02 13:00:51 [notice] 12020#492: signal process started
|
||||
2017/01/02 13:01:46 [notice] 9952#2156: signal process started
|
||||
2017/01/02 13:02:34 [notice] 7640#11040: signal process started
|
Loading…
Reference in New Issue