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 @@
\ 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 @@
\ 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 @@
-
+
\ 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 @@
\ 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 @@