From 44ec872bc4ea6a51389a1ed73756134904d4b7bd Mon Sep 17 00:00:00 2001 From: Stefan Popov Date: Fri, 31 Jul 2020 00:15:36 +0400 Subject: [PATCH 1/2] Fix styles --- build/rollup.config.js | 12 +++++++++--- src/index.ts | 8 ++++++-- src/plugins/elementUI.ts | 13 +++++++++---- 3 files changed, 24 insertions(+), 9 deletions(-) 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/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 +} From b09ca0fdc28b94989c6bc0271007bcb478e59593 Mon Sep 17 00:00:00 2001 From: Stefan Popov Date: Fri, 31 Jul 2020 00:16:09 +0400 Subject: [PATCH 2/2] Update version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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/"