diff --git a/@salix/app/src/styles/margin.scss b/@salix/app/src/styles/margin.scss index 1a3d500d4..961998e56 100644 --- a/@salix/app/src/styles/margin.scss +++ b/@salix/app/src/styles/margin.scss @@ -28,13 +28,13 @@ html [margin-small-bottom], .margin-small-bottom { margin-bottom: $margin-small; } html [margin-small-v], .margin-small-v { - margin-left: $margin-small; - margin-right: $margin-small; -} -html [margin-small-h], .margin-small-h { margin-top: $margin-small; margin-bottom: $margin-small; } +html [margin-small-h], .margin-small-h { + margin-left: $margin-small; + margin-right: $margin-small; +} /* Medium */ @@ -54,13 +54,13 @@ html [margin-medium-bottom], .margin-medium-bottom { margin-bottom: $margin-medium; } html [margin-medium-v], .margin-medium-v { - margin-left: $margin-medium; - margin-right: $margin-medium; -} -html [margin-medium-h], .margin-medium-h { margin-top: $margin-medium; margin-bottom: $margin-medium; } +html [margin-medium-h], .margin-medium-h { + margin-left: $margin-medium; + margin-right: $margin-medium; +} /* Large */ @@ -80,10 +80,10 @@ html [margin-large-bottom], .margin-large-bottom { margin-bottom: $margin-large; } html [margin-large-v], .margin-large-v { - margin-left: $margin-large; - margin-right: $margin-large; -} -html [margin-large-h], .margin-large-h { margin-top: $margin-large; margin-bottom: $margin-large; } +html [margin-large-h], .margin-large-h { + margin-left: $margin-large; + margin-right: $margin-large; +} diff --git a/@salix/app/src/styles/padding.scss b/@salix/app/src/styles/padding.scss index 3543c2c29..6014d0038 100644 --- a/@salix/app/src/styles/padding.scss +++ b/@salix/app/src/styles/padding.scss @@ -28,13 +28,13 @@ html [pad-small-bottom], .pad-small-bottom { padding-bottom: $pad-small; } html [pad-small-v], .pad-small-v { - padding-left: $pad-small; - padding-right: $pad-small; -} -html [pad-small-h], .pad-small-h { padding-top: $pad-small; padding-bottom: $pad-small; } +html [pad-small-h], .pad-small-h { + padding-left: $pad-small; + padding-right: $pad-small; +} /* Medium */ @@ -54,13 +54,13 @@ html [pad-medium-bottom], .pad-medium-bottom { padding-bottom: $pad-medium; } html [pad-medium-v], .pad-medium-v { - padding-left: $pad-medium; - padding-right: $pad-medium; -} -html [pad-medium-h], .pad-medium-h { padding-top: $pad-medium; padding-bottom: $pad-medium; } +html [pad-medium-h], .pad-medium-h { + padding-left: $pad-medium; + padding-right: $pad-medium; +} /* Large */ @@ -80,10 +80,10 @@ html [pad-large-bottom], .pad-large-bottom { padding-bottom: $pad-large; } html [pad-large-v], .pad-large-v { - padding-left: $pad-large; - padding-right: $pad-large; -} -html [pad-large-h], .pad-large-h { padding-top: $pad-large; padding-bottom: $pad-large; } +html [pad-large-h], .pad-large-h { + padding-left: $pad-large; + padding-right: $pad-large; +} diff --git a/@salix/core/src/button/button.mdl.html b/@salix/core/src/button/button.mdl.html index 211963288..913521dcb 100644 --- a/@salix/core/src/button/button.mdl.html +++ b/@salix/core/src/button/button.mdl.html @@ -1,3 +1,3 @@ \ No newline at end of file diff --git a/@salix/core/src/button/button.mdl.js b/@salix/core/src/button/button.mdl.js index ab0ac07a8..ef46569d9 100644 --- a/@salix/core/src/button/button.mdl.js +++ b/@salix/core/src/button/button.mdl.js @@ -4,17 +4,14 @@ import * as constant from '../constants'; import template from './button.mdl.html'; const _NAME = 'button'; -const DEFAULT_CLASS = 'mdl-button mdl-js-button mdl-button--raised'; -const DEFAULT_TEXT = 'Button'; - export const NAME = util.getFactoryName(_NAME + constant.MATERIAL_DESIGN_FRAMEWORK); export function factory() { return { template: template, default: { - text: DEFAULT_TEXT, - className: DEFAULT_CLASS, + label: 'Submit', + className: 'mdl-button mdl-js-button mdl-button--raised', enabled: 'true', typeName: 'button' } diff --git a/@salix/core/src/check/check.js b/@salix/core/src/check/check.js index e6b3e282d..4e76b4cf0 100644 --- a/@salix/core/src/check/check.js +++ b/@salix/core/src/check/check.js @@ -1,16 +1,18 @@ 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]; -export function directive (resolve){ +directive.$inject =[resolveFactory.NAME, normalizerFactory.NAME]; +export function directive (resolve, normalizer){ return{ require:'E', - template: function(_,attr){ - return resolve.getTemplate(_NAME, attr); + template: function(_,attrs){ + normalizer.normalize (attrs); + return resolve.getTemplate(_NAME, attrs); } } } diff --git a/@salix/core/src/check/check.mdl.html b/@salix/core/src/check/check.mdl.html index 732d3bf8d..f28da1331 100644 --- a/@salix/core/src/check/check.mdl.html +++ b/@salix/core/src/check/check.mdl.html @@ -1,4 +1,4 @@ diff --git a/@salix/core/src/combo/combo.js b/@salix/core/src/combo/combo.js index f8b7a5a68..3c29a815c 100644 --- a/@salix/core/src/combo/combo.js +++ b/@salix/core/src/combo/combo.js @@ -1,17 +1,19 @@ import {module as _module} from '../module'; import * as resolveFactory from '../resolveDefaultComponents'; +import * as normalizerFactory from '../inputAttrsNormalizer'; import * as util from '../util'; const _NAME = 'combo'; export const NAME = util.getName(_NAME); -directive.$inject = [resolveFactory.NAME]; -export function directive(resolve) { +directive.$inject = [resolveFactory.NAME, normalizerFactory.NAME]; +export function directive(resolve, normalizer) { return { require: 'E', transclude: true, - template: function(_, attr) { - return resolve.getTemplate(_NAME, attr); + template: function(_, attrs) { + normalizer.normalize (attrs); + return resolve.getTemplate(_NAME, attrs); } }; } diff --git a/@salix/core/src/combo/combo.mdl.html b/@salix/core/src/combo/combo.mdl.html index 8691bd716..9d6f31cf0 100644 --- a/@salix/core/src/combo/combo.mdl.html +++ b/@salix/core/src/combo/combo.mdl.html @@ -1,5 +1,5 @@
-
diff --git a/@salix/core/src/core.js b/@salix/core/src/core.js index 5949f15c2..52c973f65 100644 --- a/@salix/core/src/core.js +++ b/@salix/core/src/core.js @@ -8,6 +8,9 @@ export {NAME as RESOLVEDEFAULTCOMPONENT, ResolveDefaultComponent} from './resolv 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 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' @@ -39,7 +42,4 @@ export {NAME as DATE_PICKER, directive as DatePickerDirective} from './date-pick 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' diff --git a/@salix/core/src/date-picker/date-picker.js b/@salix/core/src/date-picker/date-picker.js index 2fe1d58f9..5e5ca2e4d 100644 --- a/@salix/core/src/date-picker/date-picker.js +++ b/@salix/core/src/date-picker/date-picker.js @@ -1,16 +1,18 @@ import {module as _module} from '../module'; import * as resolveFactory from '../resolveDefaultComponents'; +import * as normalizerFactory from '../inputAttrsNormalizer'; import * as util from '../util'; const _NAME = 'datePicker'; export const NAME = util.getName(_NAME); -directive.$inject = [resolveFactory.NAME]; -export function directive(resolve) { +directive.$inject = [resolveFactory.NAME, normalizerFactory.NAME]; +export function directive(resolve, normalizer) { return { require: 'E', - template: function(_, attr) { - return resolve.getTemplate(_NAME, attr); + template: function(_, attrs) { + normalizer.normalize (attrs); + return resolve.getTemplate(_NAME, attrs); } }; } diff --git a/@salix/core/src/date-picker/date-picker.mdl.html b/@salix/core/src/date-picker/date-picker.mdl.html index 3bf3b5514..5f0b7ed63 100644 --- a/@salix/core/src/date-picker/date-picker.mdl.html +++ b/@salix/core/src/date-picker/date-picker.mdl.html @@ -1,4 +1,4 @@
- +
diff --git a/@salix/core/src/focus.js b/@salix/core/src/focus.js new file mode 100644 index 000000000..196c904f3 --- /dev/null +++ b/@salix/core/src/focus.js @@ -0,0 +1,16 @@ +import {module} from './module'; + +export const NAME = 'vnFocus'; +export function directive() { + return { + restrict: 'A', + link: function (scope, elements, attrs){ + let element = elements[0]; + element.focus(); + let len = element.value ? element.value.length : 0; + element.setSelectionRange(0, len); + //element.select(); + } + }; +} +module.directive(NAME, directive); diff --git a/@salix/core/src/inputAttrsNormalizer.js b/@salix/core/src/inputAttrsNormalizer.js new file mode 100644 index 000000000..39da1bcf5 --- /dev/null +++ b/@salix/core/src/inputAttrsNormalizer.js @@ -0,0 +1,31 @@ +import {module} from './module'; + +export const NAME = 'vnInputAttrsNormalizer'; +export class InputAttrsNormalizer { + constructor () {} + $get(){ + return { + normalize: function(attrs) { +/* + if (!attrs.entity) + throw new Error(`Attribute 'entity' not defined on input`); + if (!attrs.field) + throw new Error(`Attribute 'field' not defined on input`); +*/ + if (attrs.model === undefined) + attrs.model = `${attrs.entity}.model.${attrs.field}`; + if (attrs.rule === undefined) + attrs.rule = `${attrs.entity}.${attrs.field}`; + if (attrs.label === undefined) + attrs.label = `${attrs.entity}.${attrs.field}`; + if (attrs.name === undefined) + attrs.name = attrs.field; + + if (attrs.focus !== undefined) + attrs.focus = 'vn-focus'; + } + }; + } +} + +module.provider (NAME, () => new InputAttrsNormalizer ()) \ No newline at end of file diff --git a/@salix/core/src/password/password.js b/@salix/core/src/password/password.js index c43d266d8..8acd37bdf 100644 --- a/@salix/core/src/password/password.js +++ b/@salix/core/src/password/password.js @@ -1,16 +1,18 @@ import {module as _module} from '../module'; import * as resolveFactory from '../resolveDefaultComponents'; +import * as normalizerFactory from '../inputAttrsNormalizer'; import * as util from '../util'; const _NAME = 'password'; export const NAME = util.getName(_NAME); -directive.$inject =[resolveFactory.NAME]; -export function directive (resolve){ +directive.$inject =[resolveFactory.NAME, normalizerFactory.NAME]; +export function directive (resolve, normalizer){ return{ require:'E', - template: function(_,attr){ - return resolve.getTemplate(_NAME, attr); + template: function(_, attrs){ + normalizer.normalize (attrs); + return resolve.getTemplate(_NAME, attrs); } } } diff --git a/@salix/core/src/password/password.mdl.html b/@salix/core/src/password/password.mdl.html index 87f755a45..471f99c77 100644 --- a/@salix/core/src/password/password.mdl.html +++ b/@salix/core/src/password/password.mdl.html @@ -1,4 +1,4 @@
- +
diff --git a/@salix/core/src/resolveDefaultComponents.js b/@salix/core/src/resolveDefaultComponents.js index 0fa9232a9..fa45672c2 100644 --- a/@salix/core/src/resolveDefaultComponents.js +++ b/@salix/core/src/resolveDefaultComponents.js @@ -5,9 +5,9 @@ import Interpolate from './interpolate'; export const NAME = util.getProviderName('ResolveDefaultComponent'); -function $get($injector,vnInterpolate){ +function $get($injector, vnInterpolate){ return { - getTemplate:function(name ,attr) { + getTemplate:function(name, attrs) { this._frameworkName = 'Mdl'; let _name = util.getFactoryName( name + this._frameworkName); let defaultfactory = $injector.has(_name) ? $injector.get(_name) : undefined; @@ -18,7 +18,7 @@ function $get($injector,vnInterpolate){ let defaultValues = defaultfactory.default; let template = defaultfactory.template; - let scope = Object.assign(defaultValues || {},attr||{}); + let scope = Object.assign({}, defaultValues || {}, attrs || {}); return template && vnInterpolate(template)(scope); } }; diff --git a/@salix/core/src/rule.js b/@salix/core/src/rule.js new file mode 100644 index 000000000..3d7eb6d41 --- /dev/null +++ b/@salix/core/src/rule.js @@ -0,0 +1,11 @@ +import {module} from './module'; + +export const NAME = 'vnRule'; +export function directive() { + return { + restrict: 'A', + link: function (attrs, element){ + } + }; +} +module.directive(NAME, directive); diff --git a/@salix/core/src/subtitle/subtitle.html b/@salix/core/src/subtitle/subtitle.html new file mode 100644 index 000000000..c3acdabf7 --- /dev/null +++ b/@salix/core/src/subtitle/subtitle.html @@ -0,0 +1,2 @@ +
+
\ No newline at end of file diff --git a/@salix/core/src/subtitle/subtitle.js b/@salix/core/src/subtitle/subtitle.js new file mode 100644 index 000000000..658ac5acb --- /dev/null +++ b/@salix/core/src/subtitle/subtitle.js @@ -0,0 +1,9 @@ +import template from './subtitle.html'; +import {module} from '../module'; + +export const NAME = "vnSubtitle"; +export const COMPONENT = { + template: template, + transclude: true +}; +module.component(NAME, COMPONENT); diff --git a/@salix/core/src/textfield/textfield.js b/@salix/core/src/textfield/textfield.js index 8cdbfe128..30130329a 100644 --- a/@salix/core/src/textfield/textfield.js +++ b/@salix/core/src/textfield/textfield.js @@ -1,16 +1,18 @@ 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]; -export function directive (resolve){ +directive.$inject =[resolveFactory.NAME, normalizerFactory.NAME]; +export function directive (resolve, normalizer){ return{ require:'E', - template: function(_,attr){ - return resolve.getTemplate(_NAME, attr); + template: function(_, attrs){ + normalizer.normalize (attrs); + return resolve.getTemplate(_NAME, attrs); } } } diff --git a/@salix/core/src/textfield/textfield.mdl.html b/@salix/core/src/textfield/textfield.mdl.html index 5e522f231..3af2dd79a 100644 --- a/@salix/core/src/textfield/textfield.mdl.html +++ b/@salix/core/src/textfield/textfield.mdl.html @@ -1,4 +1,4 @@
- +
diff --git a/@salix/core/src/textfield/textfield.mdl.js b/@salix/core/src/textfield/textfield.mdl.js index 2820dcd96..a8b2554c1 100644 --- a/@salix/core/src/textfield/textfield.mdl.js +++ b/@salix/core/src/textfield/textfield.mdl.js @@ -16,10 +16,8 @@ export function factory() { default: { label: DEFAULT_LABEL, name: 'textfield', - enabled: 'enabled', className: DEFAULT_CLASS, - type: DEFAULT_TYPE, - model: '$ctrl.model' + type: DEFAULT_TYPE } } } diff --git a/@salix/crud/src/client/basic-data/index.html b/@salix/crud/src/client/basic-data/index.html index df06e842a..a9ae55985 100644 --- a/@salix/crud/src/client/basic-data/index.html +++ b/@salix/crud/src/client/basic-data/index.html @@ -1,28 +1,28 @@
Datos básicos - - + + - - + + - - - + + + - + - +
\ No newline at end of file diff --git a/@salix/crud/src/client/basic-data/index.js b/@salix/crud/src/client/basic-data/index.js index ade962318..c26858545 100644 --- a/@salix/crud/src/client/basic-data/index.js +++ b/@salix/crud/src/client/basic-data/index.js @@ -15,7 +15,8 @@ export const COMPONENT = { json => console.error(json.data.error.message) ); }; - } + }, + controllerAs: 'client' }; COMPONENT.controller.$inject = ['$http']; module.component(NAME, COMPONENT); diff --git a/@salix/crud/src/client/descriptor/descriptor.html b/@salix/crud/src/client/descriptor/descriptor.html index ce29df7b7..d4e10065a 100644 --- a/@salix/crud/src/client/descriptor/descriptor.html +++ b/@salix/crud/src/client/descriptor/descriptor.html @@ -7,5 +7,4 @@ {{descriptor.descriptor.name}} {{descriptor.descriptor.phone}} - diff --git a/@salix/crud/src/client/fiscal-data/index.html b/@salix/crud/src/client/fiscal-data/index.html index 77e1fb625..c7f9532e3 100644 --- a/@salix/crud/src/client/fiscal-data/index.html +++ b/@salix/crud/src/client/fiscal-data/index.html @@ -2,48 +2,48 @@
Datos fiscales y de facturación - - - + + + - - + + - - - + + + - - - + + +
Información de facturación
- - - + + + - - - - + + + +
Documentación
- - - + + + - +
\ No newline at end of file diff --git a/@salix/crud/src/client/index/index.html b/@salix/crud/src/client/index/index.html index 575bbbb37..deb5fb19f 100644 --- a/@salix/crud/src/client/index/index.html +++ b/@salix/crud/src/client/index/index.html @@ -9,8 +9,8 @@ - + - + \ No newline at end of file diff --git a/@salix/crud/src/client/index/item-client.html b/@salix/crud/src/client/index/item-client.html index cfd940ac2..6c4fb9521 100644 --- a/@salix/crud/src/client/index/item-client.html +++ b/@salix/crud/src/client/index/item-client.html @@ -6,7 +6,7 @@
{{itemClient.client.phone}}, {{itemClient.client.contact}}
- + \ No newline at end of file diff --git a/@salix/crud/src/client/notes/index.html b/@salix/crud/src/client/notes/index.html index 39ccf46d0..2abf3ef09 100644 --- a/@salix/crud/src/client/notes/index.html +++ b/@salix/crud/src/client/notes/index.html @@ -1,5 +1,5 @@
Notas - - + +
\ No newline at end of file diff --git a/@salix/crud/src/client/search-panel/search-panel.html b/@salix/crud/src/client/search-panel/search-panel.html index 96c819fdc..1e57a813b 100644 --- a/@salix/crud/src/client/search-panel/search-panel.html +++ b/@salix/crud/src/client/search-panel/search-panel.html @@ -1,22 +1,22 @@
- - + + - + - + - - + + - - + + add_shopping_cartAdd to shopping cart diff --git a/@salix/crud/src/client/web-access/index.html b/@salix/crud/src/client/web-access/index.html index 16542a5b6..d14b7f2f7 100644 --- a/@salix/crud/src/client/web-access/index.html +++ b/@salix/crud/src/client/web-access/index.html @@ -1,6 +1,6 @@ Acceso Web - - - + + + \ No newline at end of file diff --git a/@salix/login/src/login/login.html b/@salix/login/src/login/login.html index b13b93150..6c27e7af0 100755 --- a/@salix/login/src/login/login.html +++ b/@salix/login/src/login/login.html @@ -3,9 +3,9 @@
- - - + + +