@awes-io/ui 2.56.7 → 2.58.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,28 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [2.58.0](https://github.com/awes-io/client/compare/@awes-io/ui@2.57.0...@awes-io/ui@2.58.0) (2022-08-08)
7
+
8
+
9
+ ### Features
10
+
11
+ * update ([e56f315](https://github.com/awes-io/client/commit/e56f31548de6895d0dc6dfc4175914860a0c8e53))
12
+
13
+
14
+
15
+
16
+
17
+ # [2.57.0](https://github.com/awes-io/client/compare/@awes-io/ui@2.56.7...@awes-io/ui@2.57.0) (2022-08-08)
18
+
19
+
20
+ ### Features
21
+
22
+ * **aw-bottom-bar:** action button added ([0071a22](https://github.com/awes-io/client/commit/0071a22e28e3dc92976d05f5d36bd5b9f671fa46))
23
+
24
+
25
+
26
+
27
+
6
28
  ## [2.56.7](https://github.com/awes-io/client/compare/@awes-io/ui@2.56.6...@awes-io/ui@2.56.7) (2022-07-20)
7
29
 
8
30
 
@@ -23,6 +23,10 @@
23
23
  overflow: hidden;
24
24
  padding: theme('spacing.2') theme('spacing.1') theme('spacing.1');
25
25
  }
26
+
27
+ &--small {
28
+ padding: theme('spacing.2') theme('spacing.1');
29
+ }
26
30
  }
27
31
 
28
32
  &__icon-badge {
@@ -52,10 +52,10 @@
52
52
 
53
53
  /* default */
54
54
  right: 0;
55
- bottom: 0;
55
+ bottom: env(safe-area-inset-bottom, 0px);
56
56
 
57
57
  &_top {
58
- top: 0;
58
+ top: env(safe-area-inset-top, 0px);
59
59
  bottom: auto;
60
60
  }
61
61
 
@@ -8,6 +8,8 @@ export default {
8
8
  user:
9
9
  'M13.2 11.1c-1 0-1.5.6-3.2.6-1.7 0-2.1-.6-3.2-.6A4.7 4.7 0 002.1 16v1.4c0 1 .8 1.7 1.7 1.7h12.4c1 0 1.7-.8 1.7-1.7v-1.5c0-2.6-2.1-4.7-4.7-4.7zm3.6 6.2c0 .3-.3.6-.6.6H3.8a.6.6 0 01-.5-.6v-1.5c0-2 1.6-3.6 3.5-3.6.7 0 1.4.6 3.2.6 1.8 0 2.5-.6 3.2-.6 2 0 3.6 1.7 3.6 3.7v1.4zM10 10a4.5 4.5 0 100-9 4.5 4.5 0 000 9zm0-7.9A3.4 3.4 0 1110 9 3.4 3.4 0 0110 2z',
10
10
  menu: 'M1 11V9h18v2H1zm0-6V3h18v2H1zm0 12v-2h18v2H1z',
11
+ 'menu-dots':
12
+ 'M5.46 7.13a1.67 1.67 0 1 0 0-3.33 1.67 1.67 0 0 0 0 3.33Zm1.67 7.48a1.67 1.67 0 1 1-3.33 0 1.67 1.67 0 0 1 3.33 0Zm7.49-7.48a1.67 1.67 0 1 0 0-3.33 1.67 1.67 0 0 0 0 3.33Zm1.66 7.48a1.67 1.67 0 1 1-3.33 0 1.67 1.67 0 0 1 3.33 0Z',
11
13
  search:
12
14
  'M18.8 17.7l-4.3-4.3a7.6 7.6 0 10-1 1l4.2 4.4c.3.3.8.3 1 0 .4-.3.4-.8 0-1zm-10.2-3a6 6 0 110-12.2 6 6 0 010 12.2z',
13
15
  eye:
@@ -13,7 +13,8 @@
13
13
  <slot name="bottom-bar-toggler">
14
14
  <AwMenuItemIcon
15
15
  :text="$t('aw.bottom_bar.menu')"
16
- icon="menu"
16
+ icon="menu-dots"
17
+ :size="$options.ICON_SIZE"
17
18
  @click="$store.commit('awesIo/TOGGLE_MOBILE_MENU')"
18
19
  >
19
20
  <template #default="{ text }">
@@ -22,9 +23,9 @@
22
23
  tabindex="-1"
23
24
  >
24
25
  <AwIconSystemMono
25
- name="menu"
26
+ name="menu-dots"
26
27
  class="aw-icon-menu-item__icon"
27
- size="24"
28
+ :size="$options.ICON_SIZE"
28
29
  />
29
30
  </span>
30
31
  <span class="aw-icon-menu-item__text">
@@ -40,6 +41,12 @@
40
41
  import { viewOr, lensProp, omit } from 'rambdax'
41
42
  import AwMenuItemIcon from '@AwLayouts/_AwMenuItemIcon.vue'
42
43
 
44
+ const VISIBLE_ITEMS_COUNT = 4
45
+
46
+ const ICON_SIZE = 28
47
+
48
+ const ACTION_ICON_SIZE = 36
49
+
43
50
  export default {
44
51
  name: 'AwBottomBar',
45
52
 
@@ -47,6 +54,8 @@ export default {
47
54
  AwMenuItemIcon
48
55
  },
49
56
 
57
+ ICON_SIZE,
58
+
50
59
  inject: {
51
60
  layoutProvider: {
52
61
  default: null
@@ -54,6 +63,30 @@ export default {
54
63
  },
55
64
 
56
65
  computed: {
66
+ actionButton() {
67
+ const button = this.$store.state.awesIo.bottomBarAction
68
+
69
+ if (!button) {
70
+ return null
71
+ }
72
+
73
+ let result = { ...button, hideText: true }
74
+
75
+ if (!button.href || (button.listeners && !button.listeners.click)) {
76
+ result = {
77
+ ...button,
78
+ listeners: {
79
+ ...button.listeners,
80
+ click: this.$root.$emit(
81
+ 'awes-io::bottom-bar-action:click'
82
+ )
83
+ }
84
+ }
85
+ }
86
+
87
+ return result
88
+ },
89
+
57
90
  showMenu() {
58
91
  return (
59
92
  this.$scopedSlots['bottom-bar-items'] ||
@@ -66,8 +99,18 @@ export default {
66
99
 
67
100
  items() {
68
101
  const items = viewOr([], lensProp('mainMenu'), this.layoutProvider)
102
+ const itemsCount = VISIBLE_ITEMS_COUNT - (this.actionButton ? 1 : 0)
103
+ const visibleItems = items.slice(0, itemsCount)
104
+
105
+ if (this.actionButton) {
106
+ visibleItems.splice(
107
+ Math.ceil(itemsCount / 2),
108
+ 0,
109
+ this.actionButton
110
+ )
111
+ }
69
112
 
70
- return items.slice(0, 4)
113
+ return visibleItems
71
114
  },
72
115
 
73
116
  activeMenu() {
@@ -77,7 +120,10 @@ export default {
77
120
 
78
121
  methods: {
79
122
  _pickItemProps(props) {
80
- return omit('children,listeners', props)
123
+ return {
124
+ ...omit('children,listeners', props),
125
+ size: props.hideText ? ACTION_ICON_SIZE : ICON_SIZE
126
+ }
81
127
  }
82
128
  }
83
129
  }
@@ -124,7 +124,7 @@ export default {
124
124
 
125
125
  methods: {
126
126
  _getMenuItemProps(props) {
127
- return omit('children,description', props)
127
+ return omit('children,description,hideText', props)
128
128
  }
129
129
  }
130
130
  }
@@ -14,13 +14,17 @@
14
14
  v-tooltip:right="
15
15
  tooltip ? { content: text, offset: [0, -6] } : null
16
16
  "
17
- :class="{ 'aw-icon-menu-item__icon-block--clip': !tooltip }"
17
+ :class="{
18
+ 'aw-icon-menu-item__icon-block--clip':
19
+ !tooltip && !hideText,
20
+ 'aw-icon-menu-item__icon-block--small': !tooltip && hideText
21
+ }"
18
22
  class="aw-icon-menu-item__icon-block"
19
23
  tabindex="-1"
20
24
  >
21
25
  <AwIcon
22
26
  :name="(active && iconActive) || icon"
23
- size="24"
27
+ :size="size"
24
28
  :class="{
25
29
  'aw-icon-menu-item__icon--highlight': active
26
30
  }"
@@ -41,6 +45,7 @@
41
45
  </span>
42
46
  </span>
43
47
  <span
48
+ v-if="!hideText"
44
49
  v-show="!tooltip"
45
50
  class="aw-icon-menu-item__text"
46
51
  :class="{
@@ -50,6 +55,7 @@
50
55
  {{ text }}
51
56
  <AwIconSystemMono v-if="_linkExternal" name="external" />
52
57
  </span>
58
+ <span v-if="hideText" class="sr-only">{{ text }}</span>
53
59
  </slot>
54
60
  </Component>
55
61
  </template>
@@ -83,10 +89,17 @@ export default {
83
89
  default: ''
84
90
  },
85
91
 
92
+ size: {
93
+ type: [String, Number],
94
+ default: 24
95
+ },
96
+
86
97
  active: Boolean,
87
98
 
88
99
  tooltip: Boolean,
89
100
 
101
+ hideText: Boolean,
102
+
90
103
  badge: {
91
104
  type: Object,
92
105
  default: null,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@awes-io/ui",
3
- "version": "2.56.7",
3
+ "version": "2.58.0",
4
4
  "description": "User Interface (UI) components",
5
5
  "keywords": [
6
6
  "ui",
@@ -122,5 +122,5 @@
122
122
  "vue-template-compiler": "^2.6.10",
123
123
  "webfonts-generator": "^0.4.0"
124
124
  },
125
- "gitHead": "086397c15d22572a84a25863ae3bccc633016a42"
125
+ "gitHead": "50a0c95ae90eb488c21b2ee75055dfeb4b36f8db"
126
126
  }
package/store/awesIo.js CHANGED
@@ -39,6 +39,7 @@ export const state = () => ({
39
39
  mobileMenuOpened: false,
40
40
  beforeMobileMenu: null,
41
41
  afterMobileMenu: null,
42
+ bottomBarAction: null,
42
43
 
43
44
  headerNotification: null,
44
45
 
@@ -226,6 +227,14 @@ export const mutations = {
226
227
  if (payload && payload.component) {
227
228
  state.afterMobileMenu = payload.component
228
229
  }
230
+ },
231
+
232
+ SET_BOTTOM_BAR_ACTION(state, payload) {
233
+ if (isType('Object', payload)) {
234
+ state.bottomBarAction = payload
235
+ } else {
236
+ state.bottomBarAction = null
237
+ }
229
238
  }
230
239
  }
231
240