From f1a3e2dd5837c6b7a66486b5566e422ca10a8399 Mon Sep 17 00:00:00 2001 From: jgallego Date: Wed, 5 Oct 2016 15:13:28 +0200 Subject: [PATCH 1/7] componentes basicos con prueba basica --- @salix/core/src/button/button.bt.js | 2 +- @salix/core/src/button/button.mt.html | 4 +- @salix/core/src/button/button.mt.js | 2 +- @salix/core/src/check/check.bt.html | 2 + @salix/core/src/check/check.bt.js | 1 + @salix/core/src/check/check.js | 18 +++++ @salix/core/src/check/check.mt.html | 3 + @salix/core/src/check/check.mt.js | 23 +++++++ @salix/core/src/core.js | 12 ++++ @salix/core/src/interpolate.js | 76 ++++++++++++++++----- @salix/core/src/radio/radio.bt.html | 2 + @salix/core/src/radio/radio.bt.js | 1 + @salix/core/src/radio/radio.js | 18 +++++ @salix/core/src/radio/radio.mt.html | 2 + @salix/core/src/radio/radio.mt.js | 23 +++++++ @salix/core/src/resolveDefaultComponents.js | 16 +++-- @salix/core/src/textfield/textfield.bt.html | 2 + @salix/core/src/textfield/textfield.bt.js | 1 + @salix/core/src/textfield/textfield.js | 18 +++++ @salix/core/src/textfield/textfield.mt.html | 4 ++ @salix/core/src/textfield/textfield.mt.js | 25 +++++++ @salix/core/src/txt/txt.bt.html | 2 + @salix/core/src/txt/txt.bt.js | 1 + @salix/core/src/txt/txt.js | 18 +++++ @salix/core/src/txt/txt.mt.html | 1 + @salix/core/src/txt/txt.mt.js | 20 ++++++ @salix/vendor/src/angular-vendor.js | 4 +- index.html | 9 +++ npm-debug.log | 26 ------- 29 files changed, 280 insertions(+), 56 deletions(-) create mode 100644 @salix/core/src/check/check.bt.html create mode 100644 @salix/core/src/check/check.bt.js create mode 100644 @salix/core/src/check/check.js create mode 100644 @salix/core/src/check/check.mt.html create mode 100644 @salix/core/src/check/check.mt.js create mode 100644 @salix/core/src/radio/radio.bt.html create mode 100644 @salix/core/src/radio/radio.bt.js create mode 100644 @salix/core/src/radio/radio.js create mode 100644 @salix/core/src/radio/radio.mt.html create mode 100644 @salix/core/src/radio/radio.mt.js create mode 100644 @salix/core/src/textfield/textfield.bt.html create mode 100644 @salix/core/src/textfield/textfield.bt.js create mode 100644 @salix/core/src/textfield/textfield.js create mode 100644 @salix/core/src/textfield/textfield.mt.html create mode 100644 @salix/core/src/textfield/textfield.mt.js create mode 100644 @salix/core/src/txt/txt.bt.html create mode 100644 @salix/core/src/txt/txt.bt.js create mode 100644 @salix/core/src/txt/txt.js create mode 100644 @salix/core/src/txt/txt.mt.html create mode 100644 @salix/core/src/txt/txt.mt.js delete mode 100644 npm-debug.log diff --git a/@salix/core/src/button/button.bt.js b/@salix/core/src/button/button.bt.js index bffd70bd11..7312e96b3b 100644 --- a/@salix/core/src/button/button.bt.js +++ b/@salix/core/src/button/button.bt.js @@ -13,7 +13,7 @@ export function factory() { return { template: template, default: { - texto: DEFAULT_TEXT, + text: DEFAULT_TEXT, className: DEFAULT_CLASS, enabled: 'true', typeName: 'button' diff --git a/@salix/core/src/button/button.mt.html b/@salix/core/src/button/button.mt.html index 0ff8edbeb0..2119632887 100644 --- a/@salix/core/src/button/button.mt.html +++ b/@salix/core/src/button/button.mt.html @@ -1,3 +1,3 @@ - \ No newline at end of file diff --git a/@salix/core/src/button/button.mt.js b/@salix/core/src/button/button.mt.js index d1b28ced10..9f053d63f3 100644 --- a/@salix/core/src/button/button.mt.js +++ b/@salix/core/src/button/button.mt.js @@ -13,7 +13,7 @@ export function factory() { return { template: template, default: { - texto: DEFAULT_TEXT, + text: DEFAULT_TEXT, className: DEFAULT_CLASS, enabled: 'true', typeName: 'button' diff --git a/@salix/core/src/check/check.bt.html b/@salix/core/src/check/check.bt.html new file mode 100644 index 0000000000..4505aeb41a --- /dev/null +++ b/@salix/core/src/check/check.bt.html @@ -0,0 +1,2 @@ + + diff --git a/@salix/core/src/check/check.bt.js b/@salix/core/src/check/check.bt.js new file mode 100644 index 0000000000..a5cf0bd452 --- /dev/null +++ b/@salix/core/src/check/check.bt.js @@ -0,0 +1 @@ +// por definir diff --git a/@salix/core/src/check/check.js b/@salix/core/src/check/check.js new file mode 100644 index 0000000000..e6b3e282dc --- /dev/null +++ b/@salix/core/src/check/check.js @@ -0,0 +1,18 @@ +import {module as _module} from '../module'; +import * as resolveFactory from '../resolveDefaultComponents'; +import * as util from '../util'; + +const _NAME = 'check'; +export const NAME = util.getName(_NAME); + +directive.$inject =[resolveFactory.NAME]; +export function directive (resolve){ + return{ + require:'E', + template: function(_,attr){ + return resolve.getTemplate(_NAME, attr); + } + } +} + +_module.directive(NAME,directive); diff --git a/@salix/core/src/check/check.mt.html b/@salix/core/src/check/check.mt.html new file mode 100644 index 0000000000..13d98afe29 --- /dev/null +++ b/@salix/core/src/check/check.mt.html @@ -0,0 +1,3 @@ + + *[text]* + diff --git a/@salix/core/src/check/check.mt.js b/@salix/core/src/check/check.mt.js new file mode 100644 index 0000000000..5c043ad4ba --- /dev/null +++ b/@salix/core/src/check/check.mt.js @@ -0,0 +1,23 @@ +import {module as _module} from '../module'; +import * as util from '../util'; +import * as constant from '../constants'; +import template from './check.mt.html'; + +const _NAME = 'check'; +const DEFAULT_TEXT = 'check'; +const DEFAULT_CLASS = 'mdl-checkbox mdl-js-checkbox mdl-js-ripple-effect'; + +export const NAME = util.getFactoryName(_NAME + constant.MATERIAL_DESIGN_FRAMEWORK); + +export function factory() { + return { + template: template, + default: { + text: DEFAULT_TEXT, + enabled: 'true', + className: DEFAULT_CLASS + } + } +} + +_module.factory(NAME, factory); diff --git a/@salix/core/src/core.js b/@salix/core/src/core.js index 511f8e75be..933f71f984 100644 --- a/@salix/core/src/core.js +++ b/@salix/core/src/core.js @@ -8,3 +8,15 @@ export {NAME as INTERPOLATE,Interpolate} from './interpolate' export {NAME as BUTTON,directive as ButtonDirective} from './button/button' export {NAME as BUTTONMT,factory as buttonmt} from './button/button.mt' export {NAME as BUTTONBT,factory as buttonbt} from './button/button.bt' +export {NAME as CHECK,directive as CheckDirective} from './check/check' +export {NAME as CHECKMT,factory as checknmt} from './check/check.mt' +export {NAME as CHECKBT,factory as checkbt} from './check/check.bt' +export {NAME as RADIO,directive as RadioDirective} from './radio/radio' +export {NAME as RADIOMT,factory as radionmt} from './radio/radio.mt' +export {NAME as RADIOBT,factory as radiobt} from './radio/radio.bt' +export {NAME as TEXTFIELD,directive as TextfieldDirective} from './textfield/textfield' +export {NAME as TEXTFIELDMT,factory as textfieldmt} from './textfield/textfield.mt' +export {NAME as TEXTFIELDBT,factory as textfieldbt} from './textfield/textfield.bt' +export {NAME as TXT,directive as TxtDirective} from './txt/txt' +export {NAME as TXTMT,factory as txtmt} from './txt/txt.mt' +export {NAME as TXTBT,factory as txtbt} from './txt/txt.bt' \ No newline at end of file diff --git a/@salix/core/src/interpolate.js b/@salix/core/src/interpolate.js index f65e54dcb1..cdcc387ff3 100644 --- a/@salix/core/src/interpolate.js +++ b/@salix/core/src/interpolate.js @@ -1,16 +1,54 @@ import {module as _module} from './module'; import * as util from './util'; +import {ng} from '@salix/vendor' export const NAME = util.getProviderName('interpolate'); -export class Interpolate -{ - contructor (){ - this._startSymbol='*['; - - this._endSymbol = ']'; + + 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()); + }; + + + +export class Interpolate +{ + constructor (){ + this._startSymbol='*['; + + this._endSymbol = ']*'; + } + set startSymbol (value) { if (value) { this._startSymbol = value; @@ -27,20 +65,22 @@ export class Interpolate } else { return this._endSymbol; } - }; + }; + $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'); + escapedEndRegexp = new RegExp(this._endSymbol.replace(/./g, escape), 'g'), + self = this; function escape(ch) { return '\\\\\\' + ch; } function unescapeText(text) { - return text.replace(escapedStartRegexp, this._startSymbol). - replace(escapedEndRegexp, this._endSymbol); + return text.replace(escapedStartRegexp, self._startSymbol). + replace(escapedEndRegexp, self._endSymbol); } // TODO: this is the same as the constantWatchDelegate in parse.js @@ -52,10 +92,10 @@ export class Interpolate return unwatch; } - function $interpolate(text, mustHaveExpression, trustedContext, allOrNothing) - { + function $interpolate(text, mustHaveExpression, trustedContext, allOrNothing) + { // Provide a quick exit and simplified result function for text with no interpolation - if (!text.length || text.indexOf(this._startSymbol) === -1) + if (!text.length || text.indexOf(self._startSymbol) === -1) { var constantInterp; if (!mustHaveExpression) { @@ -80,12 +120,12 @@ export class Interpolate expressionPositions = []; while (index < textLength) { - if (((startIndex = text.indexOf(this._startSymbol, index)) !== -1) && - ((endIndex = text.indexOf(this._endSymbol, startIndex + this._startSymbolLength)) !== -1)) { + 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 + this._startSymbolLength, endIndex); + exp = text.substring(startIndex + startSymbolLength, endIndex); expressions.push(exp); parseFns.push($parse(exp, parseStringifyInterceptor)); index = endIndex + endSymbolLength; @@ -158,10 +198,10 @@ export class Interpolate $interpolate.endSymbol = function () { return endSymbol; }; - + return $interpolate; } } -_module.provider(NAME, Interpolate); +_module.provider(NAME, () => new Interpolate()); diff --git a/@salix/core/src/radio/radio.bt.html b/@salix/core/src/radio/radio.bt.html new file mode 100644 index 0000000000..4505aeb41a --- /dev/null +++ b/@salix/core/src/radio/radio.bt.html @@ -0,0 +1,2 @@ + + diff --git a/@salix/core/src/radio/radio.bt.js b/@salix/core/src/radio/radio.bt.js new file mode 100644 index 0000000000..a5cf0bd452 --- /dev/null +++ b/@salix/core/src/radio/radio.bt.js @@ -0,0 +1 @@ +// por definir diff --git a/@salix/core/src/radio/radio.js b/@salix/core/src/radio/radio.js new file mode 100644 index 0000000000..b84ffce6e9 --- /dev/null +++ b/@salix/core/src/radio/radio.js @@ -0,0 +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{ + require:'E', + template: function(_,attr){ + return resolve.getTemplate(_NAME, attr); + } + } +} + +_module.directive(NAME,directive); diff --git a/@salix/core/src/radio/radio.mt.html b/@salix/core/src/radio/radio.mt.html new file mode 100644 index 0000000000..0d9e7e77c9 --- /dev/null +++ b/@salix/core/src/radio/radio.mt.html @@ -0,0 +1,2 @@ + + *[text]* diff --git a/@salix/core/src/radio/radio.mt.js b/@salix/core/src/radio/radio.mt.js new file mode 100644 index 0000000000..1fee7e5977 --- /dev/null +++ b/@salix/core/src/radio/radio.mt.js @@ -0,0 +1,23 @@ +import {module as _module} from '../module'; +import * as util from '../util'; +import * as constant from '../constants'; +import template from './radio.mt.html'; + +const _NAME = 'radio'; +const DEFAULT_TEXT = '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: { + text: DEFAULT_TEXT, + enabled: 'true', + className: DEFAULT_CLASS + } + } +} + +_module.factory(NAME, factory); diff --git a/@salix/core/src/resolveDefaultComponents.js b/@salix/core/src/resolveDefaultComponents.js index 563361f74f..4013a77d2c 100644 --- a/@salix/core/src/resolveDefaultComponents.js +++ b/@salix/core/src/resolveDefaultComponents.js @@ -1,37 +1,39 @@ import {module as _module} from './module'; import * as util from './util'; import constant from './constants'; -import interpolate from './interpolate'; +import Interpolate from './interpolate'; export const NAME = util.getProviderName('ResolveDefaultComponent'); export class ResolveDefaultComponent { constructor(){ - this._name="mt"; + this._frameworkName="mt"; } set frameworkName(value){ //mt or bt this._frameworkName = value; } - $get($injector,interpolate){ + $get($injector,vnInterpolate){ //Service Locator return { getTemplate:function(name ,attr){ + this._frameworkName="mt"; let _name = util.getFactoryName( name + this._frameworkName); - let defaultfactory = $injector.has(_name) ? $injector.get():undefined; // vnbutonmtFactory + let defaultfactory = $injector.has(_name) ? $injector.get(_name):undefined; // vnbutonmtFactory if(!defaultfactory) { - throw new Error("factoty is not defined"); + throw new Error("factory is not defined"); } let defaultValues = defaultfactory.default; let template = defaultfactory.template; let scope = Object.assign(defaultValues || {},attr||{}); - return template && interpolate(template)(scope); + return template && vnInterpolate(template)(scope); } }; } } -_module.provider(NAME,ResolveDefaultComponent) +// _module.provider(NAME,ResolveDefaultComponent) +_module.provider(NAME,() => new ResolveDefaultComponent()); \ No newline at end of file diff --git a/@salix/core/src/textfield/textfield.bt.html b/@salix/core/src/textfield/textfield.bt.html new file mode 100644 index 0000000000..4505aeb41a --- /dev/null +++ b/@salix/core/src/textfield/textfield.bt.html @@ -0,0 +1,2 @@ + + diff --git a/@salix/core/src/textfield/textfield.bt.js b/@salix/core/src/textfield/textfield.bt.js new file mode 100644 index 0000000000..a5cf0bd452 --- /dev/null +++ b/@salix/core/src/textfield/textfield.bt.js @@ -0,0 +1 @@ +// por definir diff --git a/@salix/core/src/textfield/textfield.js b/@salix/core/src/textfield/textfield.js new file mode 100644 index 0000000000..8cdbfe1286 --- /dev/null +++ b/@salix/core/src/textfield/textfield.js @@ -0,0 +1,18 @@ +import {module as _module} from '../module'; +import * as resolveFactory from '../resolveDefaultComponents'; +import * as util from '../util'; + +const _NAME = 'textfield'; +export const NAME = util.getName(_NAME); + +directive.$inject =[resolveFactory.NAME]; +export function directive (resolve){ + return{ + require:'E', + template: function(_,attr){ + return resolve.getTemplate(_NAME, attr); + } + } +} + +_module.directive(NAME,directive); diff --git a/@salix/core/src/textfield/textfield.mt.html b/@salix/core/src/textfield/textfield.mt.html new file mode 100644 index 0000000000..03c0555034 --- /dev/null +++ b/@salix/core/src/textfield/textfield.mt.html @@ -0,0 +1,4 @@ +
+ + +
\ No newline at end of file diff --git a/@salix/core/src/textfield/textfield.mt.js b/@salix/core/src/textfield/textfield.mt.js new file mode 100644 index 0000000000..7caf83369e --- /dev/null +++ b/@salix/core/src/textfield/textfield.mt.js @@ -0,0 +1,25 @@ +import {module as _module} from '../module'; +import * as util from '../util'; +import * as constant from '../constants'; +import template from './textfield.mt.html'; + +const _NAME = 'textfield'; +const DEFAULT_TEXT = '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: { + text: DEFAULT_TEXT, + enabled: 'enabled', + className: DEFAULT_CLASS, + type: DEFAULT_TYPE + } + } +} + +_module.factory(NAME, factory); diff --git a/@salix/core/src/txt/txt.bt.html b/@salix/core/src/txt/txt.bt.html new file mode 100644 index 0000000000..4505aeb41a --- /dev/null +++ b/@salix/core/src/txt/txt.bt.html @@ -0,0 +1,2 @@ + + diff --git a/@salix/core/src/txt/txt.bt.js b/@salix/core/src/txt/txt.bt.js new file mode 100644 index 0000000000..a5cf0bd452 --- /dev/null +++ b/@salix/core/src/txt/txt.bt.js @@ -0,0 +1 @@ +// por definir diff --git a/@salix/core/src/txt/txt.js b/@salix/core/src/txt/txt.js new file mode 100644 index 0000000000..2ad20698cb --- /dev/null +++ b/@salix/core/src/txt/txt.js @@ -0,0 +1,18 @@ +import {module as _module} from '../module'; +import * as resolveFactory from '../resolveDefaultComponents'; +import * as util from '../util'; + +const _NAME = 'txt'; +export const NAME = util.getName(_NAME); + +directive.$inject =[resolveFactory.NAME]; +export function directive (resolve){ + return{ + require:'E', + template: function(_,attr){ + return resolve.getTemplate(_NAME, attr); + } + } +} + +_module.directive(NAME,directive); diff --git a/@salix/core/src/txt/txt.mt.html b/@salix/core/src/txt/txt.mt.html new file mode 100644 index 0000000000..9f95f13b3c --- /dev/null +++ b/@salix/core/src/txt/txt.mt.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/@salix/core/src/txt/txt.mt.js b/@salix/core/src/txt/txt.mt.js new file mode 100644 index 0000000000..15f7745866 --- /dev/null +++ b/@salix/core/src/txt/txt.mt.js @@ -0,0 +1,20 @@ +import {module as _module} from '../module'; +import * as util from '../util'; +import * as constant from '../constants'; +import template from './txt.mt.html'; + +const _NAME = 'txt'; +const DEFAULT_TEXT = 'txt'; + +export const NAME = util.getFactoryName(_NAME + constant.MATERIAL_DESIGN_FRAMEWORK); + +export function factory() { + return { + template: template, + default: { + text: DEFAULT_TEXT + } + } +} + +_module.factory(NAME, factory); diff --git a/@salix/vendor/src/angular-vendor.js b/@salix/vendor/src/angular-vendor.js index 8196ff52ab..e18821ded4 100644 --- a/@salix/vendor/src/angular-vendor.js +++ b/@salix/vendor/src/angular-vendor.js @@ -2,5 +2,7 @@ import * as _angular from 'angular'; export const ng = { module: _angular.module, - bootstrap: _angular.bootstrap + bootstrap: _angular.bootstrap, + $$minErr :_angular.$$minErr, + angular:_angular } diff --git a/index.html b/index.html index 48130766f5..3a1252f4e2 100644 --- a/index.html +++ b/index.html @@ -3,11 +3,20 @@ Salix + + +
{{1+1}} +
+
+
+
+
+ diff --git a/npm-debug.log b/npm-debug.log deleted file mode 100644 index dc027a8b7e..0000000000 --- a/npm-debug.log +++ /dev/null @@ -1,26 +0,0 @@ -0 info it worked if it ends with ok -1 verbose cli [ '/usr/bin/nodejs', '/usr/bin/npm', 'run', 'dev' ] -2 info using npm@1.4.21 -3 info using node@v4.4.7 -4 verbose run-script [ 'predev', 'dev', 'postdev' ] -5 info predev salix-app@1.0.0 -6 info dev salix-app@1.0.0 -7 verbose unsafe-perm in lifecycle true -8 info salix-app@1.0.0 Failed to exec dev script -9 error salix-app@1.0.0 dev: `webpack --progress --colors --watch` -9 error Exit status 1 -10 error Failed at the salix-app@1.0.0 dev script. -10 error This is most likely a problem with the salix-app package, -10 error not with npm itself. -10 error Tell the author that this fails on your system: -10 error webpack --progress --colors --watch -10 error You can get their info via: -10 error npm owner ls salix-app -10 error There is likely additional logging output above. -11 error System Linux 4.7.0-1-amd64 -12 error command "/usr/bin/nodejs" "/usr/bin/npm" "run" "dev" -13 error cwd /home/juan/Proyectos/salix -14 error node -v v4.4.7 -15 error npm -v 1.4.21 -16 error code ELIFECYCLE -17 verbose exit [ 1, true ] From f42d6273eb7f7dc6bea103dc7e90d9df89b1b16f Mon Sep 17 00:00:00 2001 From: nelo Date: Wed, 5 Oct 2016 15:19:28 +0200 Subject: [PATCH 2/7] =?UTF-8?q?integraci=C3=B3n=20oclazyload=20y=20ui=20ro?= =?UTF-8?q?uter?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- @salix/app/src/app.js | 5 +++- @salix/app/src/bootstrap.js | 2 +- @salix/app/src/package.json | 10 ++++++++ @salix/app/src/routes.js | 24 ++++++++++++++++++ @salix/app/src/spliting.js | 11 ++++---- @salix/core/src/core.js | 2 +- @salix/core/src/module.js | 1 + @salix/crud/.gitignore | 1 + @salix/crud/index.js | 4 +-- @salix/crud/package.json | 10 ++++++++ @salix/crud/src/crud.js | 4 +++ @salix/crud/src/customer/index/index.html | 1 + @salix/crud/src/customer/index/index.js | 16 ++++++++++++ @salix/crud/src/customer/routes.js | 31 +++++++++++++++++++++++ @salix/crud/src/module.js | 12 +++++++++ index.html | 5 ++++ npm-debug.log | 26 ------------------- package.json | 6 ++--- 18 files changed, 131 insertions(+), 40 deletions(-) create mode 100644 @salix/app/src/package.json create mode 100644 @salix/app/src/routes.js create mode 100644 @salix/crud/.gitignore create mode 100644 @salix/crud/package.json create mode 100644 @salix/crud/src/crud.js create mode 100644 @salix/crud/src/customer/index/index.html create mode 100644 @salix/crud/src/customer/index/index.js create mode 100644 @salix/crud/src/customer/routes.js create mode 100644 @salix/crud/src/module.js delete mode 100644 npm-debug.log diff --git a/@salix/app/src/app.js b/@salix/app/src/app.js index a4cf9ee7cd..6f2c434cc1 100644 --- a/@salix/app/src/app.js +++ b/@salix/app/src/app.js @@ -1,3 +1,6 @@ import {bootstrap} from './bootstrap'; -import * as spliting from './spliting' +import * as spliting from './spliting'; +import * as routes from './routes'; + + bootstrap(); diff --git a/@salix/app/src/bootstrap.js b/@salix/app/src/bootstrap.js index cb1dcaf4a7..0c99807035 100644 --- a/@salix/app/src/bootstrap.js +++ b/@salix/app/src/bootstrap.js @@ -13,5 +13,5 @@ export const bootstrap = () => { if (!_element) { throw new Error("element is not defined"); } - ng.bootstrap(_element, [NAME]); + ng.bootstrap(_element, [NAME]); }; \ No newline at end of file diff --git a/@salix/app/src/package.json b/@salix/app/src/package.json new file mode 100644 index 0000000000..626726422e --- /dev/null +++ b/@salix/app/src/package.json @@ -0,0 +1,10 @@ +{ + "name": "@salix/core", + "version": "0.0.0", + "description": "", + "main": "index.js", + "repository": { + "type": "git", + "url": "http://git.verdnatura.es:/salix" + } +} diff --git a/@salix/app/src/routes.js b/@salix/app/src/routes.js new file mode 100644 index 0000000000..444663d474 --- /dev/null +++ b/@salix/app/src/routes.js @@ -0,0 +1,24 @@ +import * as core from '@salix/core'; +import * as spliting from './spliting'; + + +core.module.config(function($stateProvider, $urlRouterProvider) { + + $urlRouterProvider.otherwise("/"); + + $stateProvider + .state('index', { + url: "/index", + component:'customer.add', + templateProvider: function(){ + console.log("hello"); + }, + resolve: { + loader: function($ocLazyLoad, $q){ + return $q((resolve) => { + spliting.crud($ocLazyLoad, resolve); + }); + } + } + }) +}); diff --git a/@salix/app/src/spliting.js b/@salix/app/src/spliting.js index a672cea560..0526206315 100644 --- a/@salix/app/src/spliting.js +++ b/@salix/app/src/spliting.js @@ -1,19 +1,20 @@ -const crud = () => { +export const crud = (lazy, resolve) => { require.ensure([], () => { - require('@salix/crud') + var module = require('@salix/crud'); + resolve(lazy.load({name:'crud'})); }, "salix.crud"); }; -const compras = () => { +export const compras = () => { require.ensure([], () => { require('@salix/compras') }, "salix.compras"); }; -const ventas = () => { +export const ventas = () => { require.ensure([], () => { require('@salix/ventas') }, "salix.ventas"); }; -const pagos = () => { +export const pagos = () => { require.ensure([], () => { require('@salix/pagos') }, "salix.pagos"); diff --git a/@salix/core/src/core.js b/@salix/core/src/core.js index 511f8e75be..76e4176924 100644 --- a/@salix/core/src/core.js +++ b/@salix/core/src/core.js @@ -1,7 +1,7 @@ /** * export public module */ -export {NAME} from './module'; +export * from './module'; export * from './util'; export {NAME as RESOLVEDEFAULTCOMPONENT, ResolveDefaultComponent} from './resolveDefaultComponents' export {NAME as INTERPOLATE,Interpolate} from './interpolate' diff --git a/@salix/core/src/module.js b/@salix/core/src/module.js index 43b13f4444..a3391528cf 100644 --- a/@salix/core/src/module.js +++ b/@salix/core/src/module.js @@ -5,3 +5,4 @@ const DEPENDENCIES = getVendorDependencies(vendors) export const NAME = getModuleName('core'); export const module = vendors.ng.module(NAME,DEPENDENCIES); + diff --git a/@salix/crud/.gitignore b/@salix/crud/.gitignore new file mode 100644 index 0000000000..b512c09d47 --- /dev/null +++ b/@salix/crud/.gitignore @@ -0,0 +1 @@ +node_modules \ No newline at end of file diff --git a/@salix/crud/index.js b/@salix/crud/index.js index 9044df30e3..9d8de22977 100644 --- a/@salix/crud/index.js +++ b/@salix/crud/index.js @@ -1,3 +1 @@ -import * as vendors from '@salix/vendor' -import * as core from '@salix/core' -console.log('crud'); \ No newline at end of file +export * from './src/crud'; \ No newline at end of file diff --git a/@salix/crud/package.json b/@salix/crud/package.json new file mode 100644 index 0000000000..3f8fd3f3c0 --- /dev/null +++ b/@salix/crud/package.json @@ -0,0 +1,10 @@ +{ + "name": "@salix/crud", + "version": "0.0.0", + "description": "", + "main": "index.js", + "repository": { + "type": "git", + "url": "http://git.verdnatura.es:/salix" + } +} diff --git a/@salix/crud/src/crud.js b/@salix/crud/src/crud.js new file mode 100644 index 0000000000..7d4627b16d --- /dev/null +++ b/@salix/crud/src/crud.js @@ -0,0 +1,4 @@ +export * from './module'; +export * from './customer/routes'; + +export {NAME as CUSTOMER_INDEX, COMPONENT as CUSTOMER_INDEX_COMPONENT} from './customer/index' \ No newline at end of file diff --git a/@salix/crud/src/customer/index/index.html b/@salix/crud/src/customer/index/index.html new file mode 100644 index 0000000000..8470ef54c4 --- /dev/null +++ b/@salix/crud/src/customer/index/index.html @@ -0,0 +1 @@ +
index
\ No newline at end of file diff --git a/@salix/crud/src/customer/index/index.js b/@salix/crud/src/customer/index/index.js new file mode 100644 index 0000000000..6a33f5473a --- /dev/null +++ b/@salix/crud/src/customer/index/index.js @@ -0,0 +1,16 @@ +import template from './index.html'; +import {module} from '../../module'; + +export const NAME = 'customer.add'; +export const COMPONENT = { + template: template, + controller: function() { + this.user = {name: 'world'}; + } +}; + +module.component(NAME, COMPONENT); +module.factory('hello',function(){return true}); +module.controller('pepito',function(hello){ + console.log(hello); +}); diff --git a/@salix/crud/src/customer/routes.js b/@salix/crud/src/customer/routes.js new file mode 100644 index 0000000000..92032b1531 --- /dev/null +++ b/@salix/crud/src/customer/routes.js @@ -0,0 +1,31 @@ +import * as core from '@salix/core'; +import * as index from './index'; + +core.module.config(function($stateProvider, $urlRouterProvider) { + + $urlRouterProvider.otherwise("/"); + + $stateProvider + .state('index', { + url: "/index", + component: index.CUSTOMER_INDEX, + resolve:{ + load:function(){ + console.log('hello'); + } + } + }) + .state('add', { + url: "/add", + template: "
add
" + }) + .state('edit', { + url: "/edit", + template: "
edit
" + }) + .state('delete', { + url: "/delete", + template: "
delete
" + }) + +}); diff --git a/@salix/crud/src/module.js b/@salix/crud/src/module.js new file mode 100644 index 0000000000..39bbd21082 --- /dev/null +++ b/@salix/crud/src/module.js @@ -0,0 +1,12 @@ +import * as vendors from '@salix/vendor'; +import * as core from '@salix/core'; + +//import {getModuleName,getVendorDependencies} from './util'; + +export const NAME = 'crud'; +export const module = vendors.ng.module(NAME,[]); + + + + + diff --git a/index.html b/index.html index 48130766f5..0190f001a5 100644 --- a/index.html +++ b/index.html @@ -7,6 +7,11 @@
{{1+1}} +
+ index + add + edit + delete
diff --git a/npm-debug.log b/npm-debug.log deleted file mode 100644 index dc027a8b7e..0000000000 --- a/npm-debug.log +++ /dev/null @@ -1,26 +0,0 @@ -0 info it worked if it ends with ok -1 verbose cli [ '/usr/bin/nodejs', '/usr/bin/npm', 'run', 'dev' ] -2 info using npm@1.4.21 -3 info using node@v4.4.7 -4 verbose run-script [ 'predev', 'dev', 'postdev' ] -5 info predev salix-app@1.0.0 -6 info dev salix-app@1.0.0 -7 verbose unsafe-perm in lifecycle true -8 info salix-app@1.0.0 Failed to exec dev script -9 error salix-app@1.0.0 dev: `webpack --progress --colors --watch` -9 error Exit status 1 -10 error Failed at the salix-app@1.0.0 dev script. -10 error This is most likely a problem with the salix-app package, -10 error not with npm itself. -10 error Tell the author that this fails on your system: -10 error webpack --progress --colors --watch -10 error You can get their info via: -10 error npm owner ls salix-app -10 error There is likely additional logging output above. -11 error System Linux 4.7.0-1-amd64 -12 error command "/usr/bin/nodejs" "/usr/bin/npm" "run" "dev" -13 error cwd /home/juan/Proyectos/salix -14 error node -v v4.4.7 -15 error npm -v 1.4.21 -16 error code ELIFECYCLE -17 verbose exit [ 1, true ] diff --git a/package.json b/package.json index 083501fea4..701721c005 100644 --- a/package.json +++ b/package.json @@ -9,9 +9,9 @@ "url": "http://git.verdnatura.es:/salix" }, "dependencies": { - "angular": "^1.5.8", - "angular-ui-router": "^0.3.1", - "oclazyload": "^1.0.9" + "angular": "^1.4.1", + "angular-ui-router": "^0.2.15", + "oclazyload": "^0.6.3" }, "devDependencies": { "webpack": "*", From 5c9f7fd04e83326069fe3d9ae499471434fdd09d Mon Sep 17 00:00:00 2001 From: nelo Date: Wed, 5 Oct 2016 15:22:10 +0200 Subject: [PATCH 3/7] merge bien hecho --- index.html | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/index.html b/index.html index ca2e14b018..5f37df36e6 100644 --- a/index.html +++ b/index.html @@ -10,20 +10,17 @@
{{1+1}} -<<<<<<< HEAD
- index - add - edit - delete -======= -
-
-
-
- ->>>>>>> f1a3e2dd5837c6b7a66486b5566e422ca10a8399 -
+ index + add + edit + delete +
+
+
+
+ + From cee4fb2bcd4c0d6e689071c7cea88f6223126ff4 Mon Sep 17 00:00:00 2001 From: nelo Date: Thu, 6 Oct 2016 07:44:13 +0200 Subject: [PATCH 4/7] =?UTF-8?q?cambios=20en=20la=20versi=C3=B3n=20de=20los?= =?UTF-8?q?=20paquetes=20para:=20angular=20v1.5.8=20ui-router=20v1.0.0-bet?= =?UTF-8?q?a.3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 701721c005..987bb7e694 100644 --- a/package.json +++ b/package.json @@ -9,8 +9,8 @@ "url": "http://git.verdnatura.es:/salix" }, "dependencies": { - "angular": "^1.4.1", - "angular-ui-router": "^0.2.15", + "angular": "^1.5.8", + "angular-ui-router": "^1.0.0-beta.3", "oclazyload": "^0.6.3" }, "devDependencies": { From de3a2895801580e68d72d5f4c6e971bf5b9bd258 Mon Sep 17 00:00:00 2001 From: jgallego Date: Thu, 6 Oct 2016 07:44:20 +0200 Subject: [PATCH 5/7] cambio de txt por label --- @salix/core/src/core.js | 6 +++--- @salix/core/src/{txt/txt.bt.html => label/label.bt.html} | 0 @salix/core/src/{txt/txt.bt.js => label/label.bt.js} | 0 @salix/core/src/{txt/txt.js => label/label.js} | 2 +- @salix/core/src/{txt/txt.mt.html => label/label.mt.html} | 0 @salix/core/src/{txt/txt.mt.js => label/label.mt.js} | 6 +++--- 6 files changed, 7 insertions(+), 7 deletions(-) rename @salix/core/src/{txt/txt.bt.html => label/label.bt.html} (100%) rename @salix/core/src/{txt/txt.bt.js => label/label.bt.js} (100%) rename @salix/core/src/{txt/txt.js => label/label.js} (91%) rename @salix/core/src/{txt/txt.mt.html => label/label.mt.html} (100%) rename @salix/core/src/{txt/txt.mt.js => label/label.mt.js} (76%) diff --git a/@salix/core/src/core.js b/@salix/core/src/core.js index 9a401ac3ab..244e3735ae 100644 --- a/@salix/core/src/core.js +++ b/@salix/core/src/core.js @@ -17,6 +17,6 @@ export {NAME as RADIOBT,factory as radiobt} from './radio/radio.bt' export {NAME as TEXTFIELD,directive as TextfieldDirective} from './textfield/textfield' export {NAME as TEXTFIELDMT,factory as textfieldmt} from './textfield/textfield.mt' export {NAME as TEXTFIELDBT,factory as textfieldbt} from './textfield/textfield.bt' -export {NAME as TXT,directive as TxtDirective} from './txt/txt' -export {NAME as TXTMT,factory as txtmt} from './txt/txt.mt' -export {NAME as TXTBT,factory as txtbt} from './txt/txt.bt' \ No newline at end of file +export {NAME as LABEL,directive as LabelDirective} from './label/label' +export {NAME as LABELMT,factory as labelmt} from './label/label.mt' +export {NAME as LABELBT,factory as labelbt} from './label/label.bt' \ No newline at end of file diff --git a/@salix/core/src/txt/txt.bt.html b/@salix/core/src/label/label.bt.html similarity index 100% rename from @salix/core/src/txt/txt.bt.html rename to @salix/core/src/label/label.bt.html diff --git a/@salix/core/src/txt/txt.bt.js b/@salix/core/src/label/label.bt.js similarity index 100% rename from @salix/core/src/txt/txt.bt.js rename to @salix/core/src/label/label.bt.js diff --git a/@salix/core/src/txt/txt.js b/@salix/core/src/label/label.js similarity index 91% rename from @salix/core/src/txt/txt.js rename to @salix/core/src/label/label.js index 2ad20698cb..fb59785d34 100644 --- a/@salix/core/src/txt/txt.js +++ b/@salix/core/src/label/label.js @@ -2,7 +2,7 @@ import {module as _module} from '../module'; import * as resolveFactory from '../resolveDefaultComponents'; import * as util from '../util'; -const _NAME = 'txt'; +const _NAME = 'label'; export const NAME = util.getName(_NAME); directive.$inject =[resolveFactory.NAME]; diff --git a/@salix/core/src/txt/txt.mt.html b/@salix/core/src/label/label.mt.html similarity index 100% rename from @salix/core/src/txt/txt.mt.html rename to @salix/core/src/label/label.mt.html diff --git a/@salix/core/src/txt/txt.mt.js b/@salix/core/src/label/label.mt.js similarity index 76% rename from @salix/core/src/txt/txt.mt.js rename to @salix/core/src/label/label.mt.js index 15f7745866..3d1144510b 100644 --- a/@salix/core/src/txt/txt.mt.js +++ b/@salix/core/src/label/label.mt.js @@ -1,10 +1,10 @@ import {module as _module} from '../module'; import * as util from '../util'; import * as constant from '../constants'; -import template from './txt.mt.html'; +import template from './label.mt.html'; -const _NAME = 'txt'; -const DEFAULT_TEXT = 'txt'; +const _NAME = 'label'; +const DEFAULT_TEXT = 'label'; export const NAME = util.getFactoryName(_NAME + constant.MATERIAL_DESIGN_FRAMEWORK); From 9d5885777aa824e658c4c12670fc457990d94998 Mon Sep 17 00:00:00 2001 From: nelo Date: Thu, 6 Oct 2016 07:59:39 +0200 Subject: [PATCH 6/7] montado el ui-router con oclazyload --- @salix/app/src/routes.js | 5 +--- @salix/crud/src/customer/index/index.html | 2 +- @salix/crud/src/customer/index/index.js | 8 +++---- index.html | 29 ++++++++++------------- 4 files changed, 17 insertions(+), 27 deletions(-) diff --git a/@salix/app/src/routes.js b/@salix/app/src/routes.js index 444663d474..4259fcd639 100644 --- a/@salix/app/src/routes.js +++ b/@salix/app/src/routes.js @@ -9,10 +9,7 @@ core.module.config(function($stateProvider, $urlRouterProvider) { $stateProvider .state('index', { url: "/index", - component:'customer.add', - templateProvider: function(){ - console.log("hello"); - }, + template :'', resolve: { loader: function($ocLazyLoad, $q){ return $q((resolve) => { diff --git a/@salix/crud/src/customer/index/index.html b/@salix/crud/src/customer/index/index.html index 8470ef54c4..bf833f5d0c 100644 --- a/@salix/crud/src/customer/index/index.html +++ b/@salix/crud/src/customer/index/index.html @@ -1 +1 @@ -
index
\ No newline at end of file +
index from component
\ No newline at end of file diff --git a/@salix/crud/src/customer/index/index.js b/@salix/crud/src/customer/index/index.js index 6a33f5473a..3f404ca5af 100644 --- a/@salix/crud/src/customer/index/index.js +++ b/@salix/crud/src/customer/index/index.js @@ -1,7 +1,7 @@ import template from './index.html'; import {module} from '../../module'; -export const NAME = 'customer.add'; +export const NAME = 'customerAdd'; export const COMPONENT = { template: template, controller: function() { @@ -10,7 +10,5 @@ export const COMPONENT = { }; module.component(NAME, COMPONENT); -module.factory('hello',function(){return true}); -module.controller('pepito',function(hello){ - console.log(hello); -}); + + diff --git a/index.html b/index.html index 5f37df36e6..418528def0 100644 --- a/index.html +++ b/index.html @@ -3,25 +3,20 @@ Salix - - -
- {{1+1}} -
- index - add - edit - delete -
-
-
-
- -
- - +
+ +
+ index + add + edit + delete + +
+ + + From fc2d75ddc33e89a4e888490bfd266875dd78bf09 Mon Sep 17 00:00:00 2001 From: jgallego Date: Thu, 6 Oct 2016 09:20:57 +0200 Subject: [PATCH 7/7] css con webpack --- @salix/vendor/src/materialdesignlite-vendor.js | 4 ++++ @salix/vendor/src/vendor.js | 3 ++- index.html | 7 +------ package.json | 13 ++++++++----- webpack.config.js | 3 +++ 5 files changed, 18 insertions(+), 12 deletions(-) create mode 100644 @salix/vendor/src/materialdesignlite-vendor.js diff --git a/@salix/vendor/src/materialdesignlite-vendor.js b/@salix/vendor/src/materialdesignlite-vendor.js new file mode 100644 index 0000000000..7765281a99 --- /dev/null +++ b/@salix/vendor/src/materialdesignlite-vendor.js @@ -0,0 +1,4 @@ +import * as _materialdesignlite from 'material-design-lite'; +import * as css from 'material-design-lite/material.min.css'; + +export const materialdesignlite = _materialdesignlite; \ No newline at end of file diff --git a/@salix/vendor/src/vendor.js b/@salix/vendor/src/vendor.js index 343a9365ab..5d9cded94f 100644 --- a/@salix/vendor/src/vendor.js +++ b/@salix/vendor/src/vendor.js @@ -1,3 +1,4 @@ export * from './angular-vendor'; export * from './oclazyload-vendor'; -export * from './uirouter-vendor'; \ No newline at end of file +export * from './uirouter-vendor'; +export * from './materialdesignlite-vendor'; \ No newline at end of file diff --git a/index.html b/index.html index 5f37df36e6..eb9f5620ef 100644 --- a/index.html +++ b/index.html @@ -1,11 +1,7 @@ - Salix - - -
@@ -19,9 +15,8 @@


- +
- diff --git a/package.json b/package.json index 987bb7e694..563bd1b2ed 100644 --- a/package.json +++ b/package.json @@ -11,17 +11,20 @@ "dependencies": { "angular": "^1.5.8", "angular-ui-router": "^1.0.0-beta.3", + "material-design-lite": "^1.2.1", "oclazyload": "^0.6.3" }, "devDependencies": { - "webpack": "*", - "webpack-dev-server": "*", "babel-core": "*", - "babel-preset-es2015": "*", "babel-loader": "*", - "raw-loader": "*" + "babel-preset-es2015": "*", + "css-loader": "^0.25.0", + "raw-loader": "*", + "style-loader": "^0.13.1", + "webpack": "*", + "webpack-dev-server": "*" }, "scripts": { - "dev": "webpack --progress --colors --watch" + "build": "webpack --progress --colors --watch" } } diff --git a/webpack.config.js b/webpack.config.js index a14c565e95..a23e95e37b 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -25,6 +25,9 @@ module.exports = }, { test: /\.html$/, loader: 'raw' + }, { + test: /\.css$/, + loader: 'style!css' } ] },