diff --git a/@salix/app/src/components/main-menu/main-menu.html b/@salix/app/src/components/main-menu/main-menu.html index 981e64bc1..16a8112ad 100644 --- a/@salix/app/src/components/main-menu/main-menu.html +++ b/@salix/app/src/components/main-menu/main-menu.html @@ -3,12 +3,12 @@ + ---> \ No newline at end of file diff --git a/@salix/app/src/components/main-menu/main-menu.js b/@salix/app/src/components/main-menu/main-menu.js index e9c1e4626..b79f64141 100644 --- a/@salix/app/src/components/main-menu/main-menu.js +++ b/@salix/app/src/components/main-menu/main-menu.js @@ -7,12 +7,11 @@ export const COMPONENT = { template: template, controllerAs: "mainMenu", controller: function() { - this.onLogoutClick = function () - { + this.onLogoutClick = function() { let appName = 'salix'; document.cookie = `${appName}-session=; expires=Thu, 01 Jan 1970 00:00:01 GMT;`; window.location = `/account?api_key=${appName}`; - } + }; } }; module.component(NAME, COMPONENT); diff --git a/@salix/app/src/components/searchbar/searchbar.html b/@salix/app/src/components/searchbar/searchbar.html index 49442dbd8..2f11a5998 100644 --- a/@salix/app/src/components/searchbar/searchbar.html +++ b/@salix/app/src/components/searchbar/searchbar.html @@ -1,6 +1,8 @@ - - + + - - \ No newline at end of file + + + + \ No newline at end of file diff --git a/@salix/app/src/components/searchbar/searchbar.js b/@salix/app/src/components/searchbar/searchbar.js index a3f36dd72..574924c34 100644 --- a/@salix/app/src/components/searchbar/searchbar.js +++ b/@salix/app/src/components/searchbar/searchbar.js @@ -1,8 +1,18 @@ import template from './searchbar.html'; import {module} from '../../module'; +require('./style.css'); export const NAME = 'vnSearchbar' export const COMPONENT = { - template: template + template: template, + transclude: true, + controllerAs: 'searchbar', + controller: function($element) { + this.onClick = function(event) { + var popover = $element.find('vn-popover'); + popover.controller('vnPopover').show($element); + }; + } }; +COMPONENT.controller.$inject = ['$element']; module.component(NAME, COMPONENT); diff --git a/@salix/app/src/components/searchbar/style.css b/@salix/app/src/components/searchbar/style.css new file mode 100644 index 000000000..e69de29bb diff --git a/@salix/core/src/core.js b/@salix/core/src/core.js index 45eeb58bc..f70bb48e4 100644 --- a/@salix/core/src/core.js +++ b/@salix/core/src/core.js @@ -1,52 +1,54 @@ -require('./mdl-override.css'); - -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 {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 CARD, directive as CardDirective} from './card/card'; -export {NAME as CARD_MDL, factory as cardMdl} from './card/card.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'; +require('./mdl-override.css'); + +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 {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 CARD, directive as CardDirective} from './card/card'; +export {NAME as CARD_MDL, factory as cardMdl} from './card/card.mdl'; +export {NAME as SWITCH, directive as SwitchDirective} from './switch/switch'; +export {NAME as SWITCH_MDL, factory as switchdMdl} from './switch/switch.mdl'; + +export {directive as Popover} from './popover/popover'; +export {factory as PopoverMdl} from './popover/popover.mdl'; +export {directive as Icon} from './icon/icon'; +export {factory as IconMdl} from './icon/icon.mdl'; + +export {NAME as TITLE, COMPONENT as TITLE_COMPONENT} from './title/title'; +export {NAME as SUBTITLE, COMPONENT as SUBTITLE_COMPONENT} from './subtitle/subtitle'; diff --git a/@salix/core/src/module.js b/@salix/core/src/module.js index 98383f185..83c25dd76 100644 --- a/@salix/core/src/module.js +++ b/@salix/core/src/module.js @@ -1,6 +1,6 @@ -import * as vendors from 'vendor'; -import {getModuleName,getVendorDependencies} from './util'; - -const DEPENDENCIES = getVendorDependencies(vendors) -export const NAME = getModuleName('core'); -export const module = vendors.ng.module(NAME,DEPENDENCIES); +import * as vendors from 'vendor'; +import {getModuleName, getVendorDependencies} from './util'; + +const DEPENDENCIES = getVendorDependencies(vendors); +export const NAME = getModuleName('core'); +export const module = vendors.ng.module(NAME, DEPENDENCIES); diff --git a/@salix/core/src/popover/popover.js b/@salix/core/src/popover/popover.js index 84f09415b..22b632893 100644 --- a/@salix/core/src/popover/popover.js +++ b/@salix/core/src/popover/popover.js @@ -9,13 +9,70 @@ export function directive(resolver) { return { restrict: 'E', transclude: true, + controllerAs: 'popover', template: function(_, attrs) { return resolver.getTemplate(_NAME, attrs); }, - controller: function() { - this.onClick = function (event) { - event.stopPropagation(); + controller: function($element) { + var self = this; + var doc = angular.element(document); + function docMouseDownHandler (event) { + if (event != self.lastEvent) + self.hide(); } + this.onMouseDown = function(event) { + this.lastEvent = event; + }; + this.hide = function () + { + $element[0].style.display = 'none'; + doc.off('mousedown', docMouseDownHandler); + } + this.show = function(parent) { + var node = $element[0]; + var style = node.style; + + var spacing = 4; + var margin = 20; + var dblMargin = margin * 2; + + var width = node.offsetWidth; + var height = node.offsetHeight; + var innerWidth = window.innerWidth; + var innerHeight = window.innerHeight; + + if(width + dblMargin > innerWidth) { + width = innerWidth - dblMargin; + style.width = width +'px'; + } + if(height + dblMargin > innerHeight) { + height = innerHeight - dblMargin; + style.height = height +'px'; + } + + if(parent) { + var parentNode = parent[0]; + var rect = parentNode.getBoundingClientRect(); + var left = rect.left; + var top = rect.top + spacing + parentNode.offsetHeight; + + if(left + width > innerWidth) + left -= (left + width) - window.innerWidth + margin; + if(top + height > innerHeight) + top -= height + parentNode.offsetHeight + spacing * 2; + + if(left < 0) + left = margin; + if(top < 0) + top = margin; + + style.top = (top) +'px'; + style.left = (left) +'px'; + } + + style.display = 'block'; + doc.on('mousedown', docMouseDownHandler); + }; } } } diff --git a/@salix/core/src/popover/popover.mdl.html b/@salix/core/src/popover/popover.mdl.html index 01cd51cc0..886efd8bc 100644 --- a/@salix/core/src/popover/popover.mdl.html +++ b/@salix/core/src/popover/popover.mdl.html @@ -1,7 +1,5 @@
\ No newline at end of file diff --git a/@salix/core/src/popover/style.css b/@salix/core/src/popover/style.css index 6ec8f95d8..ef40ec2ac 100644 --- a/@salix/core/src/popover/style.css +++ b/@salix/core/src/popover/style.css @@ -1,4 +1,9 @@ vn-popover { display: none; - position: absolute; + position: fixed; + box-shadow: 0 0 .2em rgba(1,1,1,.4); + background-color: white; + z-index: 100; + top: 0; + left: 0; } \ No newline at end of file diff --git a/@salix/core/src/rule.js b/@salix/core/src/rule.js index b7d768f1d..addf815d2 100644 --- a/@salix/core/src/rule.js +++ b/@salix/core/src/rule.js @@ -4,8 +4,8 @@ export const NAME = 'vnRule'; export function directive() { return { restrict: 'A', - link: function (attrs, element) { - } + link: function(attrs, element) { + } }; } module.directive(NAME, directive); diff --git a/@salix/core/src/switch/switch.js b/@salix/core/src/switch/switch.js new file mode 100644 index 000000000..506d7c5ca --- /dev/null +++ b/@salix/core/src/switch/switch.js @@ -0,0 +1,28 @@ +import {module as _module} from '../module'; +import * as resolveFactory from '../resolveDefaultComponents'; +import * as normalizerFactory from '../inputAttrsNormalizer'; +import * as util from '../util'; + +const _NAME = 'switch'; +export const NAME = util.getName(_NAME); + +directive.$inject = [resolveFactory.NAME, normalizerFactory.NAME]; +export function directive(resolve, normalizer) { + return { + restrict: 'E', + template: function(_, attrs) { + normalizer.normalize(attrs); + return resolve.getTemplate(_NAME, attrs); + }, + link: function(scope, element, attrs) { + scope.$watch(attrs.model, () => { + let mdlField = element[0].firstChild.MaterialSwitch; + if (mdlField) + mdlField.updateClasses_(); + }); + } + }; +} + +_module.directive(NAME, directive); + diff --git a/@salix/core/src/switch/switch.mdl.html b/@salix/core/src/switch/switch.mdl.html new file mode 100644 index 000000000..845e1b951 --- /dev/null +++ b/@salix/core/src/switch/switch.mdl.html @@ -0,0 +1,4 @@ + \ No newline at end of file diff --git a/@salix/core/src/switch/switch.mdl.js b/@salix/core/src/switch/switch.mdl.js new file mode 100644 index 000000000..c88b1d996 --- /dev/null +++ b/@salix/core/src/switch/switch.mdl.js @@ -0,0 +1,21 @@ +import {module as _module} from '../module'; +import * as util from '../util'; +import * as constant from '../constants'; +import template from './switch.mdl.html'; + +const _NAME = 'switch'; +const DEFAULT_CLASS = 'mdl-switch__input'; + +export const NAME = util.getFactoryName(_NAME + constant.MATERIAL_DESIGN_FRAMEWORK); + +export function factory() { + return { + template: template, + default: { + className: DEFAULT_CLASS, + label: "" + } + } +} + +_module.factory(NAME, factory); diff --git a/@salix/crud/src/client/basic-data/index.html b/@salix/crud/src/client/basic-data/index.html index b999d5509..aeb0eb2d1 100644 --- a/@salix/crud/src/client/basic-data/index.html +++ b/@salix/crud/src/client/basic-data/index.html @@ -5,13 +5,10 @@ - - - - + @@ -19,6 +16,7 @@ + diff --git a/@salix/crud/src/client/basic-data/index.js b/@salix/crud/src/client/basic-data/index.js index 4f4a41754..5e283f555 100644 --- a/@salix/crud/src/client/basic-data/index.js +++ b/@salix/crud/src/client/basic-data/index.js @@ -6,7 +6,7 @@ export const COMPONENT = { template: template, controllerAs: 'basicData', bindings: { - client: '<' + client: '=' }, controller: function($http) { $http.get('/client/api/SalesPeople').then( diff --git a/@salix/crud/src/client/card/card.html b/@salix/crud/src/client/card/card.html index 84cae97d3..57bd9441d 100644 --- a/@salix/crud/src/client/card/card.html +++ b/@salix/crud/src/client/card/card.html @@ -1,7 +1,7 @@ - + diff --git a/@salix/crud/src/client/card/card.js b/@salix/crud/src/client/card/card.js index dd44f8eb6..e38652026 100644 --- a/@salix/crud/src/client/card/card.js +++ b/@salix/crud/src/client/card/card.js @@ -1,3 +1,4 @@ +import './style.css'; import template from './card.html'; import {module} from '../../module'; @@ -15,7 +16,8 @@ export const COMPONENT = { this.descriptor = { clientId: this.client.id, name: this.client.name, - phone: this.client.phone + phone: this.client.phone, + active: this.client.active }; }, json => console.error(json.data.error.message) diff --git a/@salix/crud/src/client/card/style.css b/@salix/crud/src/client/card/style.css new file mode 100644 index 000000000..f788e35c6 --- /dev/null +++ b/@salix/crud/src/client/card/style.css @@ -0,0 +1,3 @@ +vn-descriptor{ + font-family: raleway-bold; +} \ No newline at end of file diff --git a/@salix/crud/src/client/create/index.html b/@salix/crud/src/client/create/index.html index 7b563bc80..c1df86615 100644 --- a/@salix/crud/src/client/create/index.html +++ b/@salix/crud/src/client/create/index.html @@ -1,16 +1,21 @@ +
- Crear Cliente - - - - - - - - - - - - - + + + Crear Cliente + + + + + + + + + + + + + + +
\ No newline at end of file diff --git a/@salix/crud/src/client/descriptor/descriptor.html b/@salix/crud/src/client/descriptor/descriptor.html index 2f103ed59..cdd9bec0c 100644 --- a/@salix/crud/src/client/descriptor/descriptor.html +++ b/@salix/crud/src/client/descriptor/descriptor.html @@ -1,12 +1,15 @@ - - - person - - -
{{descriptor.descriptor.clientId}}
-
{{descriptor.descriptor.name}}
-
{{descriptor.descriptor.phone}}
-
-
+ + + + person + + +
{{descriptor.descriptor.clientId}}
+
{{descriptor.descriptor.name}}
+
{{descriptor.descriptor.phone}}
+
+
+ +
diff --git a/@salix/crud/src/client/descriptor/descriptor.js b/@salix/crud/src/client/descriptor/descriptor.js index 012ad8f5d..36de83103 100644 --- a/@salix/crud/src/client/descriptor/descriptor.js +++ b/@salix/crud/src/client/descriptor/descriptor.js @@ -1,3 +1,4 @@ +import './style.css'; import template from './descriptor.html'; import {module} from '../../module'; diff --git a/@salix/crud/src/client/descriptor/style.css b/@salix/crud/src/client/descriptor/style.css new file mode 100644 index 000000000..d5f633d8c --- /dev/null +++ b/@salix/crud/src/client/descriptor/style.css @@ -0,0 +1,3 @@ +.descriptor-icon{ + font-size:60px; +} \ 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 edee93333..733fc935b 100644 --- a/@salix/crud/src/client/index/index.html +++ b/@salix/crud/src/client/index/index.html @@ -17,7 +17,4 @@ - - Popover test! -
diff --git a/@salix/crud/src/client/index/index.js b/@salix/crud/src/client/index/index.js index 81785d2ea..96af0bb41 100644 --- a/@salix/crud/src/client/index/index.js +++ b/@salix/crud/src/client/index/index.js @@ -8,14 +8,12 @@ export const COMPONENT = { controllerAs: 'search', controller: function($http) { this.clients = []; - $http.get('/client/api/Clients').then( json => { this.clients = json.data; }, json => console.error(json.data.error.message) ); - this.submit = function() { var query = {where: model}; var self = this; diff --git a/@salix/crud/src/client/index/item-client.html b/@salix/crud/src/client/index/item-client.html index 8e29478bd..a5812c4d9 100644 --- a/@salix/crud/src/client/index/item-client.html +++ b/@salix/crud/src/client/index/item-client.html @@ -1,11 +1,11 @@ -
{{itemClient.client.name}}
-
{{itemClient.client.phone}}, {{itemClient.client.contact}}
+
{{itemClient.client.name}}
+
{{itemClient.client.id}}
- +
\ No newline at end of file diff --git a/@salix/crud/src/client/index/style.css b/@salix/crud/src/client/index/style.css index d12d1c754..5329ae742 100644 --- a/@salix/crud/src/client/index/style.css +++ b/@salix/crud/src/client/index/style.css @@ -8,4 +8,8 @@ vn-item-client a { } vn-item-client a:hover { background-color: rgba(0, 0, 0, .1); +} + +.vn-item-client-name{ + font-family: raleway-bold; } \ 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 e06ce70ec..272bc1618 100644 --- a/@salix/crud/src/client/search-panel/search-panel.html +++ b/@salix/crud/src/client/search-panel/search-panel.html @@ -1,5 +1,5 @@ -
-
+
+ @@ -18,9 +18,7 @@ - - add_shopping_cartAdd to shopping cart - +
diff --git a/@salix/vendor/src/util.js b/@salix/vendor/src/util.js index fdf3a36d8..494f1f6e0 100644 --- a/@salix/vendor/src/util.js +++ b/@salix/vendor/src/util.js @@ -1,11 +1,11 @@ -export function getComponentName(name, isProvider){ - if(isProvider){ +export function getComponentName(name, isProvider) { + if (isProvider) { return { - name: name, + name: name, provider: name + "Provider" - } - } + }; + } return { name: name - } + }; } diff --git a/services/client/common/models/Client.json b/services/client/common/models/Client.json index 80ac6775a..a965ffd4a 100644 --- a/services/client/common/models/Client.json +++ b/services/client/common/models/Client.json @@ -25,16 +25,13 @@ "type": "string" }, "street": { - "type": "string", - "required": "true" + "type": "string" }, "consignee": { - "type": "string", - "required": "true" + "type": "string" }, "city": { - "type": "string", - "required": "true" + "type": "string" }, "postcode": { "type": "string" @@ -43,8 +40,7 @@ "type": "Number" }, "country": { - "type": "string", - "required": "true" + "type": "string" }, "email": { "type": "string"