diff --git a/@salix/app/src/app.js b/@salix/app/src/app.js index bf5992122..b7a2c92ec 100644 --- a/@salix/app/src/app.js +++ b/@salix/app/src/app.js @@ -1,6 +1,9 @@ +import {module} from './module'; import {bootstrap} from './bootstrap'; import * as spliting from './spliting'; import * as routes from './configroutes'; +import * as run from './run'; +import * as components from './components'; import title from './styles/title.css' import padding from './styles/layout.css' diff --git a/@salix/app/src/bootstrap.js b/@salix/app/src/bootstrap.js index 5cc75fa96..2e2704312 100644 --- a/@salix/app/src/bootstrap.js +++ b/@salix/app/src/bootstrap.js @@ -1,5 +1,5 @@ import {ng} from 'vendor'; -import {NAME} from 'core'; +import {NAME as SALIX} from './module'; export const bootstrap = () => { const selector = 'selector' @@ -13,5 +13,6 @@ export const bootstrap = () => { if (!_element) { throw new Error("element is not defined"); } - ng.bootstrap(_element, [NAME]); + ng.bootstrap(_element, [SALIX]); + }; diff --git a/@salix/app/src/components.js b/@salix/app/src/components.js new file mode 100644 index 000000000..e3947825d --- /dev/null +++ b/@salix/app/src/components.js @@ -0,0 +1,6 @@ +export {NAME as VN_MAINMENU, COMPONENT as VN_MAINMENU_COMPONENT} from './components/main-menu/main-menu'; +export {NAME as ACTIONS, COMPONENT as ACTIONS_COMPONENT} from './components/left-menu/actions'; +export {NAME as DESCRIPTOR, COMPONENT as DESCRIPTOR_COMPONENT} from './components/left-menu/descriptor'; +export {NAME as LEFT_MENU, COMPONENT as LEFTMENU_COMPONENT} from './components/left-menu/left-menu'; +export {NAME as MENU_ITEM, COMPONENT as MENU_ITEM_COMPONENT} from './components/left-menu/menu-item'; +export {NAME as CLIENT_TOPBAR, COMPONENT as CLIENT_TOPBAR_COMPONENT} from './components/topbar/topbar'; diff --git a/@salix/core/src/left-menu/actions.html b/@salix/app/src/components/left-menu/actions.html similarity index 100% rename from @salix/core/src/left-menu/actions.html rename to @salix/app/src/components/left-menu/actions.html diff --git a/@salix/core/src/left-menu/actions.js b/@salix/app/src/components/left-menu/actions.js similarity index 56% rename from @salix/core/src/left-menu/actions.js rename to @salix/app/src/components/left-menu/actions.js index c9d32a8eb..01b7dd0d4 100644 --- a/@salix/core/src/left-menu/actions.js +++ b/@salix/app/src/components/left-menu/actions.js @@ -1,9 +1,7 @@ import template from './actions.html'; -import {module} from '../module'; -import * as util from '../util'; +import {module} from '../../module'; -const _NAME = 'actions'; -export const NAME = util.getName(_NAME); +export const NAME = 'vnActions'; export const COMPONENT = { template: template, bindings: { diff --git a/@salix/core/src/left-menu/descriptor.html b/@salix/app/src/components/left-menu/descriptor.html similarity index 100% rename from @salix/core/src/left-menu/descriptor.html rename to @salix/app/src/components/left-menu/descriptor.html diff --git a/@salix/core/src/left-menu/descriptor.js b/@salix/app/src/components/left-menu/descriptor.js similarity index 56% rename from @salix/core/src/left-menu/descriptor.js rename to @salix/app/src/components/left-menu/descriptor.js index 39597e846..930d8ef98 100644 --- a/@salix/core/src/left-menu/descriptor.js +++ b/@salix/app/src/components/left-menu/descriptor.js @@ -1,9 +1,7 @@ import template from './descriptor.html'; -import {module} from '../module'; -import * as util from '../util'; +import {module} from '../../module'; -const _NAME = 'descriptor'; -export const NAME = util.getName(_NAME); +export const NAME = 'vnDescriptor'; export const COMPONENT = { template: template, bindings: { diff --git a/@salix/core/src/left-menu/left-menu.html b/@salix/app/src/components/left-menu/left-menu.html similarity index 100% rename from @salix/core/src/left-menu/left-menu.html rename to @salix/app/src/components/left-menu/left-menu.html diff --git a/@salix/core/src/left-menu/left-menu.js b/@salix/app/src/components/left-menu/left-menu.js similarity index 63% rename from @salix/core/src/left-menu/left-menu.js rename to @salix/app/src/components/left-menu/left-menu.js index 6c01f5019..b6d708647 100644 --- a/@salix/core/src/left-menu/left-menu.js +++ b/@salix/app/src/components/left-menu/left-menu.js @@ -1,10 +1,8 @@ import template from './left-menu.html'; import style from './style.css'; -import {module} from '../module'; -import * as util from '../util'; +import {module} from '../../module'; -const _NAME = 'leftMenu'; -export const NAME = util.getName(_NAME); +export const NAME = "vnLeftMenu"; export const COMPONENT = { template: template, bindings: { diff --git a/@salix/core/src/left-menu/menu-item.html b/@salix/app/src/components/left-menu/menu-item.html similarity index 100% rename from @salix/core/src/left-menu/menu-item.html rename to @salix/app/src/components/left-menu/menu-item.html diff --git a/@salix/core/src/left-menu/menu-item.js b/@salix/app/src/components/left-menu/menu-item.js similarity index 56% rename from @salix/core/src/left-menu/menu-item.js rename to @salix/app/src/components/left-menu/menu-item.js index af279b7ee..a5b8f582c 100644 --- a/@salix/core/src/left-menu/menu-item.js +++ b/@salix/app/src/components/left-menu/menu-item.js @@ -1,9 +1,7 @@ import template from './menu-item.html'; -import {module} from '../module'; -import * as util from '../util'; +import {module} from '../../module'; -const _NAME = 'menuItem'; -export const NAME = util.getName(_NAME); +export const NAME = 'vnMenuItem'; export const COMPONENT = { template: template, bindings: { diff --git a/@salix/core/src/left-menu/style.css b/@salix/app/src/components/left-menu/style.css similarity index 100% rename from @salix/core/src/left-menu/style.css rename to @salix/app/src/components/left-menu/style.css diff --git a/@salix/core/src/main-menu/main-menu.html b/@salix/app/src/components/main-menu/main-menu.html similarity index 100% rename from @salix/core/src/main-menu/main-menu.html rename to @salix/app/src/components/main-menu/main-menu.html diff --git a/@salix/app/src/components/main-menu/main-menu.js b/@salix/app/src/components/main-menu/main-menu.js new file mode 100644 index 000000000..a774f7071 --- /dev/null +++ b/@salix/app/src/components/main-menu/main-menu.js @@ -0,0 +1,8 @@ +import template from './main-menu.html'; +import {module} from '../../module'; + +export const NAME = "vnMainmenu"; +export const COMPONENT = { + template: template +}; +module.component(NAME, COMPONENT); diff --git a/@salix/core/src/topbar/topbar.html b/@salix/app/src/components/topbar/topbar.html similarity index 100% rename from @salix/core/src/topbar/topbar.html rename to @salix/app/src/components/topbar/topbar.html diff --git a/@salix/app/src/components/topbar/topbar.js b/@salix/app/src/components/topbar/topbar.js new file mode 100644 index 000000000..8ace2de96 --- /dev/null +++ b/@salix/app/src/components/topbar/topbar.js @@ -0,0 +1,8 @@ +import template from './topbar.html'; +import {module} from '../../module'; + +export const NAME = "vnTopbar"; +export const COMPONENT = { + template: template +}; +module.component(NAME, COMPONENT); diff --git a/@salix/app/src/configroutes.js b/@salix/app/src/configroutes.js index 5ef97c6dc..59f8abb7b 100644 --- a/@salix/app/src/configroutes.js +++ b/@salix/app/src/configroutes.js @@ -26,8 +26,7 @@ function config($stateProvider, $urlRouterProvider) { template: route.template, resolve: { loader: loader(route) - } - + } }) }); } diff --git a/@salix/app/src/module.js b/@salix/app/src/module.js new file mode 100644 index 000000000..24d591cac --- /dev/null +++ b/@salix/app/src/module.js @@ -0,0 +1,6 @@ +import * as vendors from 'vendor'; +import * as core from 'core'; +import {NAME as CORE} from 'core'; + +export const NAME = 'salix'; +export const module = vendors.ng.module(NAME,[CORE]); diff --git a/@salix/app/src/run.js b/@salix/app/src/run.js new file mode 100644 index 000000000..01ff49e66 --- /dev/null +++ b/@salix/app/src/run.js @@ -0,0 +1,10 @@ +import {ng} from 'vendor'; +import {module} from './module'; + +export const run = function($rootScope){ + $rootScope.$on('$viewContentLoaded',()=>{ + componentHandler.upgradeAllRegistered(); + }) +} +run.$inject=['$rootScope']; +module.run(run); \ No newline at end of file diff --git a/@salix/core/src/core.js b/@salix/core/src/core.js index 2d8168c8d..93a1bb4df 100644 --- a/@salix/core/src/core.js +++ b/@salix/core/src/core.js @@ -43,11 +43,6 @@ export {NAME as COMBO_MT, factory as comboMt} from './combo/combo.mt' export {NAME as DATE_PICKER, directive as DatePickerDirective} from './date-picker/date-picker' export {NAME as DATE_PICKER_MT, factory as datePickerMt} from './date-picker/date-picker.mt' -export {NAME as VN_MAINMENU, COMPONENT as VN_MAINMENU_COMPONENT} from './main-menu/main-menu'; -export {NAME as ACTIONS, COMPONENT as ACTIONS_COMPONENT} from './left-menu/actions'; -export {NAME as DESCRIPTOR, COMPONENT as DESCRIPTOR_COMPONENT} from './left-menu/descriptor'; -export {NAME as LEFT_MENU, COMPONENT as LEFTMENU_COMPONENT} from './left-menu/left-menu'; -export {NAME as MENU_ITEM, COMPONENT as MENU_ITEM_COMPONENT} from './left-menu/menu-item'; -export {NAME as CLIENT_TOPBAR, COMPONENT as CLIENT_TOPBAR_COMPONENT} from './topbar/topbar'; + diff --git a/@salix/core/src/main-menu/main-menu.js b/@salix/core/src/main-menu/main-menu.js deleted file mode 100644 index 3dda71fe3..000000000 --- a/@salix/core/src/main-menu/main-menu.js +++ /dev/null @@ -1,10 +0,0 @@ -import template from './main-menu.html'; -import {module} from '../module'; -import * as util from '../util'; - -const _NAME = 'mainmenu'; -export const NAME = util.getName(_NAME); -export const COMPONENT = { - template: template -}; -module.component(NAME, COMPONENT); diff --git a/@salix/core/src/topbar/topbar.js b/@salix/core/src/topbar/topbar.js deleted file mode 100644 index a86c6c722..000000000 --- a/@salix/core/src/topbar/topbar.js +++ /dev/null @@ -1,10 +0,0 @@ -import template from './topbar.html'; -import {module} from '../module'; -import * as util from '../util'; - -const _NAME = 'topbar'; -export const NAME = util.getName(_NAME); -export const COMPONENT = { - template: template -}; -module.component(NAME, COMPONENT); diff --git a/@salix/crud/src/client/index/index.js b/@salix/crud/src/client/index/index.js index 973188f7c..c023b8d31 100644 --- a/@salix/crud/src/client/index/index.js +++ b/@salix/crud/src/client/index/index.js @@ -1,8 +1,6 @@ import template from './index.html'; import {module} from '../../module'; -const _NAME = 'clientIndex'; -//export const NAME = module.core.util.getName(_NAME); export const NAME = "vnClientIndex"; export const COMPONENT = { template: template,