diff --git a/build/rollup.config.js b/build/rollup.config.js index 64394867..f9ca0fc4 100644 --- a/build/rollup.config.js +++ b/build/rollup.config.js @@ -37,8 +37,14 @@ export default { src: 'src/styles/*', dest: 'lib/styles', // Replace all imports for scss files which will be used as theming files - transform: (content) => content.toString().replace(/~@\/assets\//g, '../assets/') - } + transform: (content) => { + return content.toString() + .replace(/~@\/assets\//g, '../assets/') + // Add scss styles from element-ui + .replace('../../node_modules/element-ui/packages/theme-chalk/src/index', './element-ui/index') + } + }, + { src: 'node_modules/element-ui/packages/theme-chalk/src/*', dest: 'lib/styles/element-ui' } ] }), typescript({ @@ -58,7 +64,7 @@ export default { resolve(), terser(), del({ - targets: ['lib/styles/index.d.ts', 'lib/plugins/'], + targets: ['lib/styles/index.d.ts'], hook: 'writeBundle' }) ] diff --git a/package.json b/package.json index 8faa8b8e..0f987500 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@soramitsu/soramitsu-js-ui", - "version": "0.2.3", + "version": "0.2.4", "private": false, "publishConfig": { "registry": "https://nexus.iroha.tech/repository/npm-soramitsu-private/" diff --git a/src/index.ts b/src/index.ts index b1fb4544..5fa8d13f 100644 --- a/src/index.ts +++ b/src/index.ts @@ -31,6 +31,7 @@ import { STooltip } from './components' import { Components } from './types/components' +import { Message, MessageBox, Notification } from './plugins/elementUI' const elements = [ { component: SApp, name: Components.SApp }, @@ -73,7 +74,10 @@ if (typeof window !== 'undefined' && window.Vue) { window.Vue.use(SoramitsuElements, {}) } -/* export { +export { + Message, + MessageBox, + Notification, SApp, SAside, SButton, @@ -102,5 +106,5 @@ if (typeof window !== 'undefined' && window.Vue) { SScrollSections, SSubmenu, STooltip -} */ +} export default SoramitsuElements diff --git a/src/plugins/elementUI.ts b/src/plugins/elementUI.ts index 55c7c9a8..792f0181 100644 --- a/src/plugins/elementUI.ts +++ b/src/plugins/elementUI.ts @@ -26,7 +26,7 @@ import { MenuItem, MenuItemGroup, Message, - MessageBox, + MessageBox as MsgBox, Notification, Option, Pagination, @@ -85,13 +85,18 @@ Vue.use(Tabs) Vue.use(TabPane) Vue.use(Loading.directive) Vue.use(Checkbox) -const MsgBox = MessageBox +const MessageBox = MsgBox MsgBox.setDefaults({ cancelButtonText: 'Cancel', confirmButtonText: 'OK' }) -Vue.prototype.$prompt = MsgBox.prompt -Vue.prototype.$alert = MsgBox.alert +Vue.prototype.$prompt = MessageBox.prompt +Vue.prototype.$alert = MessageBox.alert Vue.prototype.$message = Message Vue.prototype.$notify = Notification // locale.use(lang) // TODO: it will be used later +export { + MessageBox, + Message, + Notification +}