From bd454e56c7e5470d547c71c3cb72e728fb9d810f Mon Sep 17 00:00:00 2001 From: avele <34437766+avele@users.noreply.github.com> Date: Wed, 6 Nov 2019 14:20:47 +0400 Subject: [PATCH] Added responsive button container component for toolbars (#412) --- front/babel.config.js | 4 +- front/build/webpack.base.conf.js | 5 +- front/client/components/CategoryHeader.vue | 106 ++------- .../client/components/CategoryItemToolbar.vue | 215 +++++++----------- .../components/ResponsiveBtnsContainer.vue | 82 +++++++ front/package-lock.json | 104 +++++++++ front/package.json | 2 + front/tsconfig.json | 1 + 8 files changed, 304 insertions(+), 215 deletions(-) create mode 100644 front/client/components/ResponsiveBtnsContainer.vue diff --git a/front/babel.config.js b/front/babel.config.js index 4cd0c4a..d15c5df 100644 --- a/front/babel.config.js +++ b/front/babel.config.js @@ -6,7 +6,9 @@ module.exports = { }, modules: 'commonjs', useBuiltIns: 'usage' - }] + } + ], + '@vue/babel-preset-jsx' ], plugins: [ '@babel/plugin-transform-runtime', diff --git a/front/build/webpack.base.conf.js b/front/build/webpack.base.conf.js index 867755c..463afd1 100644 --- a/front/build/webpack.base.conf.js +++ b/front/build/webpack.base.conf.js @@ -68,12 +68,15 @@ const config = { transpileOnly: true, appendTsSuffixTo: [/\.vue$/] } - } + }, ] }, { test: /\.tsx$/, use: [ + { + loader: 'babel-loader' + }, { loader: 'ts-loader', options: { diff --git a/front/client/components/CategoryHeader.vue b/front/client/components/CategoryHeader.vue index f5d1269..1ff7ab7 100644 --- a/front/client/components/CategoryHeader.vue +++ b/front/client/components/CategoryHeader.vue @@ -27,7 +27,24 @@ >{{ category.group }} -
+ + + -
- - - - - - - - - - - - - - - - - - + @@ -118,11 +84,13 @@ import CategorySettingsDialog from 'client/components/CategorySettingsDialog.vue import CategoryHeaderBtn from 'client/components/CategoryHeaderBtn.vue' import Confirm from 'client/helpers/ConfirmDecorator' import { ICategoryFull } from 'client/service/Category' +import ResponsiveBtnsContainer from 'client/components/ResponsiveBtnsContainer.vue' @Component({ components: { CategorySettingsDialog, - CategoryHeaderBtn + CategoryHeaderBtn, + ResponsiveBtnsContainer } }) export default class CategoryHeader extends Vue { @@ -209,41 +177,13 @@ export default class CategoryHeader extends Vue { font-weight: 600; } -.category-actions-menu-btn { - display: none; +.category-actions-mobile-menu-btn { margin: 0; width: 36px; height: 36px; } -.category-actions { - white-space: nowrap; - flex: 1; -} - -.category-actions-menu-list { - >>> .v-list-item { - height: 36px; - padding: 0; - } - - >>> button { - height: 100% !important; - padding: 0 6px; - - .v-btn__content { - justify-content: flex-start; - } - } -} - @media (max-width: 768px) { - .category-actions-menu-btn { - display: block; - } - .category-actions { - display: none; - } .category-header__second-row { /* Cause menu btn appears after page loading and causes second row to jump */ min-height: 36px; diff --git a/front/client/components/CategoryItemToolbar.vue b/front/client/components/CategoryItemToolbar.vue index 4562a2c..bf1cfaa 100644 --- a/front/client/components/CategoryItemToolbar.vue +++ b/front/client/components/CategoryItemToolbar.vue @@ -47,61 +47,12 @@ - -
- - - - $vuetify.icons.circle - - - -
- - + -