@awes-io/ui 2.63.6 → 2.65.1

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,44 @@
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.65.1](https://github.com/awes-io/client/compare/@awes-io/ui@2.65.0...@awes-io/ui@2.65.1) (2023-07-06)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * **aw-tab-nav:** else key fixed ([fac9f72](https://github.com/awes-io/client/commit/fac9f7214606540f95fa8aa5e57782b7ad837a10))
12
+
13
+
14
+
15
+
16
+
17
+ # [2.65.0](https://github.com/awes-io/client/compare/@awes-io/ui@2.64.0...@awes-io/ui@2.65.0) (2023-07-06)
18
+
19
+
20
+ ### Bug Fixes
21
+
22
+ * tooltip shown on pointer events ([a1827a1](https://github.com/awes-io/client/commit/a1827a142e5b823ba526bce0e90ccf7a5a36dc20))
23
+
24
+
25
+ ### Features
26
+
27
+ * **aw-tab-nav:** icons added ([eb1c876](https://github.com/awes-io/client/commit/eb1c87634e47f7ca15593fd82fb5d685ffa4e9b6))
28
+
29
+
30
+
31
+
32
+
33
+ # [2.64.0](https://github.com/awes-io/client/compare/@awes-io/ui@2.63.6...@awes-io/ui@2.64.0) (2023-06-27)
34
+
35
+
36
+ ### Features
37
+
38
+ * tertiary menu added ([3c0d425](https://github.com/awes-io/client/commit/3c0d42598a9b628eeb5b347d76a8538902623e0f))
39
+
40
+
41
+
42
+
43
+
6
44
  ## [2.63.6](https://github.com/awes-io/client/compare/@awes-io/ui@2.63.5...@awes-io/ui@2.63.6) (2023-06-27)
7
45
 
8
46
 
@@ -4,6 +4,7 @@
4
4
  justify-content: center;
5
5
  align-items: center;
6
6
  color: inherit;
7
+ width: 100%;
7
8
 
8
9
  position: relative;
9
10
 
@@ -4,13 +4,14 @@
4
4
 
5
5
  display: grid;
6
6
  grid-template-columns: 60px auto;
7
- grid-template-rows: 80px auto auto 80px;
7
+ grid-template-rows: 80px minmax(0, 2fr) minmax(0, 1fr) 80px minmax(0, auto);
8
8
 
9
9
  z-index: 1;
10
10
 
11
11
  &__logo,
12
12
  &__aw-user-menu {
13
- display: block;
13
+ display: flex;
14
+ justify-content: center;
14
15
  width: 100%;
15
16
  padding: theme('spacing.3');
16
17
  margin: auto 0;
@@ -57,7 +58,7 @@
57
58
  max-height: 100vh;
58
59
 
59
60
  grid-column: 2;
60
- grid-row: 1 / 5;
61
+ grid-row: 1 / 6;
61
62
 
62
63
  overflow-y: auto;
63
64
 
@@ -12,6 +12,11 @@ export default {
12
12
  required: true
13
13
  },
14
14
 
15
+ color: {
16
+ type: String,
17
+ default: ''
18
+ },
19
+
15
20
  viewBox: {
16
21
  type: String,
17
22
  default: null
@@ -23,7 +28,7 @@ export default {
23
28
  }
24
29
  },
25
30
 
26
- render(h, { props: { name, size, viewBox }, data }) {
31
+ render(h, { props: { name, color, size, viewBox }, data }) {
27
32
  const attrs = data.attrs || {}
28
33
 
29
34
  return name
@@ -38,7 +43,9 @@ export default {
38
43
  !size && isNil(attrs.width) && isNil(attrs.height)
39
44
  }
40
45
  ],
41
- style: [data.style, data.staticStyle],
46
+ style: [data.style, data.staticStyle].concat(
47
+ color ? { fill: `var(--c-${color})` } : []
48
+ ),
42
49
  attrs: {
43
50
  'aria-hidden': true,
44
51
  width: size || null,
@@ -15,31 +15,59 @@
15
15
  :href="isDisabled ? null : route.fullPath"
16
16
  :class="[
17
17
  _cssClasses.toggler,
18
- { [_cssClasses.togglerActive]: isActive },
19
- { [_cssClasses.togglerDisabled]: isDisabled }
18
+ {
19
+ [_cssClasses.togglerActive]: isActive,
20
+ [_cssClasses.togglerDisabled]: isDisabled,
21
+ [_cssClasses.togglerNoText]: item.hideText
22
+ }
20
23
  ]"
21
24
  @click.prevent="navigate(route)"
22
25
  >
23
26
  <span tabindex="-1">
24
- {{ text }}
25
- <AwBadge v-if="item.badge" v-bind="item.badge" />
27
+ <AwIcon
28
+ v-if="item.icon"
29
+ v-bind="_toIconProps(item.icon)"
30
+ :class="{ 'mr-1': !item.hideText }"
31
+ />
32
+ <span v-if="item.hideText" class="sr-only">
33
+ {{ text }}
34
+ </span>
35
+ <template v-else>{{ text }}</template>
36
+ <AwBadge
37
+ v-if="item.badge"
38
+ v-bind="_toBadgeProps(item.badge)"
39
+ />
26
40
  </span>
27
41
  </a>
28
42
  <button
29
43
  v-else
30
- :key="key"
44
+ :key="'btn-' + key"
31
45
  :class="[
32
46
  _cssClasses.toggler,
33
- { [_cssClasses.togglerActive]: isActive },
34
- { [_cssClasses.togglerDisabled]: isDisabled }
47
+ {
48
+ [_cssClasses.togglerActive]: isActive,
49
+ [_cssClasses.togglerDisabled]: isDisabled,
50
+ [_cssClasses.togglerNoText]: item.hideText
51
+ }
35
52
  ]"
36
53
  :disabled="isDisabled ? '' : null"
37
54
  type="button"
38
55
  @click.prevent="update(i)"
39
56
  >
40
57
  <span tabindex="-1">
41
- {{ text }}
42
- <AwBadge v-if="item.badge" v-bind="item.badge" />
58
+ <AwIcon
59
+ v-if="item.icon"
60
+ v-bind="_toIconProps(item.icon)"
61
+ :class="{ 'mr-1': !item.hideText }"
62
+ />
63
+ <span v-if="item.hideText" class="sr-only">
64
+ {{ text }}
65
+ </span>
66
+ <template v-else>{{ text }}</template>
67
+ <AwBadge
68
+ v-if="item.badge"
69
+ v-bind="_toBadgeProps(item.badge)"
70
+ />
43
71
  </span>
44
72
  </button>
45
73
  </slot>
@@ -115,7 +143,8 @@ export default {
115
143
  'wrapper',
116
144
  'toggler',
117
145
  'toggler_active',
118
- 'toggler_disabled'
146
+ 'toggler_disabled',
147
+ 'toggler_no_text'
119
148
  ])
120
149
  }
121
150
  },
@@ -233,6 +262,14 @@ export default {
233
262
  }
234
263
 
235
264
  return equals(currentParams, route.query)
265
+ },
266
+
267
+ _toBadgeProps(props) {
268
+ return isType('Object', props) ? props : { text: props }
269
+ },
270
+
271
+ _toIconProps(props) {
272
+ return isType('Object', props) ? props : { name: props }
236
273
  }
237
274
  }
238
275
  }
@@ -85,6 +85,7 @@ export default {
85
85
  mainMenu: [],
86
86
  secondaryMenu: [],
87
87
  userMenu: [],
88
+ tertiaryMenu: [],
88
89
  activeMenu: null,
89
90
  activeMenuItem: null
90
91
  }
@@ -92,7 +93,12 @@ export default {
92
93
  },
93
94
 
94
95
  computed: {
95
- ...mapGetters('awesIo', ['mainMenu', 'secondaryMenu', 'userMenu']),
96
+ ...mapGetters('awesIo', [
97
+ 'mainMenu',
98
+ 'secondaryMenu',
99
+ 'userMenu',
100
+ 'tertiaryMenu'
101
+ ]),
96
102
 
97
103
  // _flatChildren() {
98
104
  // const items = []
@@ -124,6 +130,10 @@ export default {
124
130
 
125
131
  _userMenu() {
126
132
  return this._toMenuItems(this.userMenu)
133
+ },
134
+
135
+ _tertiaryMenu() {
136
+ return this._toMenuItems(this.tertiaryMenu)
127
137
  }
128
138
  },
129
139
 
@@ -155,6 +165,15 @@ export default {
155
165
  immediate: true
156
166
  },
157
167
 
168
+ _tertiaryMenu: {
169
+ handler(items) {
170
+ this.$set(this.layoutProvider, 'tertiaryMenu', items)
171
+ this._findActive()
172
+ },
173
+ deep: true,
174
+ immediate: true
175
+ },
176
+
158
177
  '$route.path': {
159
178
  handler: '_findActive',
160
179
  immediate: true
@@ -22,6 +22,7 @@
22
22
  v-else
23
23
  :key="i"
24
24
  v-bind="_getMenuItemProps(item)"
25
+ v-on="_getMenuItemListeners(item)"
25
26
  :active="item === activeMenu"
26
27
  tooltip
27
28
  />
@@ -38,6 +39,7 @@
38
39
  v-else
39
40
  :key="i"
40
41
  v-bind="_getMenuItemProps(item)"
42
+ v-on="_getMenuItemListeners(item)"
41
43
  :active="item === activeMenu"
42
44
  tooltip
43
45
  />
@@ -48,6 +50,23 @@
48
50
  <!-- user menu -->
49
51
  <AwUserMenu class="aw-layout-menu__aw-user-menu" />
50
52
 
53
+ <div class="aw-layout-menu__tertiary-menu">
54
+ <slot name="tertiary-menu">
55
+ <template v-for="(item, i) in tertiaryMenu">
56
+ <!-- eslint-disable-next-line vue/require-component-is -->
57
+ <Component v-if="item.is" :key="'cmp-' + i" v-bind="item" />
58
+ <AwMenuItemIcon
59
+ v-else
60
+ :key="i"
61
+ v-bind="_getMenuItemProps(item)"
62
+ v-on="_getMenuItemListeners(item)"
63
+ :active="item === activeMenu"
64
+ tooltip
65
+ />
66
+ </template>
67
+ </slot>
68
+ </div>
69
+
51
70
  <!-- submenu -->
52
71
  <div
53
72
  class="aw-layout-menu__submenu"
@@ -98,6 +117,10 @@ export default {
98
117
  return viewOr([], lensProp('secondaryMenu'), this.layoutProvider)
99
118
  },
100
119
 
120
+ tertiaryMenu() {
121
+ return viewOr(null, lensProp('tertiaryMenu'), this.layoutProvider)
122
+ },
123
+
101
124
  activeMenu() {
102
125
  return viewOr(null, lensProp('activeMenu'), this.layoutProvider)
103
126
  },
@@ -123,7 +146,11 @@ export default {
123
146
 
124
147
  methods: {
125
148
  _getMenuItemProps(props) {
126
- return omit('children,description,hideText', props)
149
+ return omit('children,description,hideText,listeners', props)
150
+ },
151
+
152
+ _getMenuItemListeners(props) {
153
+ return props.listeners || {}
127
154
  }
128
155
  }
129
156
  }
@@ -118,6 +118,14 @@
118
118
  @click:submenu="showSubmenu"
119
119
  />
120
120
 
121
+ <AwMobileMenuNav
122
+ v-show="!submenuOpened"
123
+ :title="$t('Tertiary menu')"
124
+ :items="tertiaryMenu"
125
+ class="aw-mobile-menu__menu"
126
+ @click:submenu="showSubmenu"
127
+ />
128
+
121
129
  <!-- submenu -->
122
130
  <template v-for="({ text, children, badge }, i) in submenu">
123
131
  <AwMobileMenuNav
@@ -215,6 +223,14 @@ export default {
215
223
  )
216
224
  },
217
225
 
226
+ tertiaryMenu() {
227
+ return viewOr(
228
+ [],
229
+ lensProp('tertiaryMenu'),
230
+ this.layoutProvider
231
+ ).filter(({ is }) => !is)
232
+ },
233
+
218
234
  show: {
219
235
  get() {
220
236
  return this.$store.state.awesIo.mobileMenuOpened
@@ -52,11 +52,11 @@ function hideTooltip() {
52
52
 
53
53
  const EVENTS = [
54
54
  {
55
- names: ['mouseenter', 'focus'],
55
+ names: ['pointerenter', 'focus'],
56
56
  handler: showTooltip
57
57
  },
58
58
  {
59
- names: ['mouseleave', 'blur'],
59
+ names: ['pointerleave', 'blur'],
60
60
  handler: hideTooltip
61
61
  }
62
62
  ]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@awes-io/ui",
3
- "version": "2.63.6",
3
+ "version": "2.65.1",
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": "13c51e132ed92120d6118f3c4daa59005a6a42f8"
125
+ "gitHead": "731b4fa90b1988fd90818a041a3a30ba09509057"
126
126
  }
package/store/awesIo.js CHANGED
@@ -34,7 +34,8 @@ export const state = () => ({
34
34
  menus: {
35
35
  main: [],
36
36
  secondary: [],
37
- user: []
37
+ user: [],
38
+ tertiary: []
38
39
  },
39
40
  mobileMenuOpened: false,
40
41
  beforeMobileMenu: null,
@@ -59,6 +60,10 @@ export const getters = {
59
60
  return castArray(state.menus.user)
60
61
  },
61
62
 
63
+ tertiaryMenu(state) {
64
+ return castArray(state.menus.tertiary)
65
+ },
66
+
62
67
  user(state, getters, rootState) {
63
68
  const user = pathOr({}, 'auth.user', rootState)
64
69
  const src = pathOr('', 'avatar', user)
@@ -1,168 +0,0 @@
1
- @font-face {
2
- font-family: "aw-icons";
3
- src: url("/fonts/aw-icons.woff2?b289fd926b2ed5447880ea85815122b1") format("woff2"),
4
- url("/fonts/aw-icons.woff?b289fd926b2ed5447880ea85815122b1") format("woff");
5
- }
6
-
7
- .aw-icon {
8
- display: inline-block;
9
- line-height: 1;
10
- overflow: hidden;
11
- vertical-align: middle;
12
- text-align: center;
13
- }
14
-
15
- .aw-icon:before {
16
- font-family: aw-icons !important;
17
- font-style: normal;
18
- font-weight: normal !important;
19
- vertical-align: top;
20
- }
21
-
22
- .aw-icon-arrow-d:before {
23
- content: "\f101";
24
- }
25
- .aw-icon-arrow-l:before {
26
- content: "\f102";
27
- }
28
- .aw-icon-arrow-r:before {
29
- content: "\f103";
30
- }
31
- .aw-icon-arrow-u:before {
32
- content: "\f104";
33
- }
34
- .aw-icon-bold:before {
35
- content: "\f105";
36
- }
37
- .aw-icon-briefcase:before {
38
- content: "\f106";
39
- }
40
- .aw-icon-burger:before {
41
- content: "\f107";
42
- }
43
- .aw-icon-check-circle:before {
44
- content: "\f108";
45
- }
46
- .aw-icon-check-solid:before {
47
- content: "\f109";
48
- }
49
- .aw-icon-check:before {
50
- content: "\f10a";
51
- }
52
- .aw-icon-chevron-d:before {
53
- content: "\f10b";
54
- }
55
- .aw-icon-chevron-l:before {
56
- content: "\f10c";
57
- }
58
- .aw-icon-chevron-r:before {
59
- content: "\f10d";
60
- }
61
- .aw-icon-chevron-u:before {
62
- content: "\f10e";
63
- }
64
- .aw-icon-circle:before {
65
- content: "\f10f";
66
- }
67
- .aw-icon-close-circle:before {
68
- content: "\f110";
69
- }
70
- .aw-icon-close-solid:before {
71
- content: "\f111";
72
- }
73
- .aw-icon-close:before {
74
- content: "\f112";
75
- }
76
- .aw-icon-copy:before {
77
- content: "\f113";
78
- }
79
- .aw-icon-drag:before {
80
- content: "\f114";
81
- }
82
- .aw-icon-external:before {
83
- content: "\f115";
84
- }
85
- .aw-icon-eye-no:before {
86
- content: "\f116";
87
- }
88
- .aw-icon-eye:before {
89
- content: "\f117";
90
- }
91
- .aw-icon-font-size:before {
92
- content: "\f118";
93
- }
94
- .aw-icon-graph:before {
95
- content: "\f119";
96
- }
97
- .aw-icon-intelligence:before {
98
- content: "\f11a";
99
- }
100
- .aw-icon-italic:before {
101
- content: "\f11b";
102
- }
103
- .aw-icon-loader:before {
104
- content: "\f11c";
105
- }
106
- .aw-icon-location:before {
107
- content: "\f11d";
108
- }
109
- .aw-icon-minus:before {
110
- content: "\f11e";
111
- }
112
- .aw-icon-more-v:before {
113
- content: "\f11f";
114
- }
115
- .aw-icon-more:before {
116
- content: "\f120";
117
- }
118
- .aw-icon-plus-solid:before {
119
- content: "\f121";
120
- }
121
- .aw-icon-plus:before {
122
- content: "\f122";
123
- }
124
- .aw-icon-quote:before {
125
- content: "\f123";
126
- }
127
- .aw-icon-schedule:before {
128
- content: "\f124";
129
- }
130
- .aw-icon-search:before {
131
- content: "\f125";
132
- }
133
- .aw-icon-settings:before {
134
- content: "\f126";
135
- }
136
- .aw-icon-speaker:before {
137
- content: "\f127";
138
- }
139
- .aw-icon-speed:before {
140
- content: "\f128";
141
- }
142
- .aw-icon-storage:before {
143
- content: "\f129";
144
- }
145
- .aw-icon-triangle-d:before {
146
- content: "\f12a";
147
- }
148
- .aw-icon-triangle-l:before {
149
- content: "\f12b";
150
- }
151
- .aw-icon-triangle-r:before {
152
- content: "\f12c";
153
- }
154
- .aw-icon-triangle-solid-r:before {
155
- content: "\f12d";
156
- }
157
- .aw-icon-triangle-u:before {
158
- content: "\f12e";
159
- }
160
- .aw-icon-upload:before {
161
- content: "\f12f";
162
- }
163
- .aw-icon-user-solid:before {
164
- content: "\f130";
165
- }
166
- .aw-icon-user:before {
167
- content: "\f131";
168
- }