@awes-io/ui 2.91.1 → 2.93.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,40 @@
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.93.0](https://github.com/awes-io/client/compare/@awes-io/ui@2.92.0...@awes-io/ui@2.93.0) (2024-02-01)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * release fixes ([fae62d8](https://github.com/awes-io/client/commit/fae62d8883f56900794dfe54d1c433b10700cb74))
12
+
13
+
14
+ ### Features
15
+
16
+ * add header slot for modal ([65b06f9](https://github.com/awes-io/client/commit/65b06f95372628dac9e8a39523219297550f4eed))
17
+
18
+
19
+
20
+
21
+
22
+ # [2.92.0](https://github.com/awes-io/client/compare/@awes-io/ui@2.91.1...@awes-io/ui@2.92.0) (2024-01-29)
23
+
24
+
25
+ ### Bug Fixes
26
+
27
+ * **aw-modal:** remove get param if non closable ([3a591b5](https://github.com/awes-io/client/commit/3a591b502a12fda867c22e60e5c12e1464716207))
28
+
29
+
30
+ ### Features
31
+
32
+ * add btn for close mobile select ([b590540](https://github.com/awes-io/client/commit/b590540cc235075dfd9071ba0be42e57bd610a65))
33
+ * add props for not closing modal ([00bd65c](https://github.com/awes-io/client/commit/00bd65c7741ec12b1314c15158cbd3d57c40e7b9))
34
+ * create page for mobile menu ([9b9b80a](https://github.com/awes-io/client/commit/9b9b80a67f97b6126e6196ffbcb862d4629df0a3))
35
+
36
+
37
+
38
+
39
+
6
40
  ## [2.91.1](https://github.com/awes-io/client/compare/@awes-io/ui@2.91.0...@awes-io/ui@2.91.1) (2024-01-25)
7
41
 
8
42
 
@@ -63,8 +63,8 @@
63
63
  @import './layout-menu.css';
64
64
  @import './mobile-menu-nav.css';
65
65
  @import './mobile-menu-item.css';
66
- @import './mobile-menu-item-new.css';
67
66
  @import './mobile-menu.css';
67
+ @import './more.css';
68
68
  @import './icon-menu-item.css';
69
69
  @import './user-menu.css';
70
70
  @import './nav.css';
@@ -12,16 +12,12 @@
12
12
  padding: 0;
13
13
  }
14
14
 
15
- &__toggler,
16
- &__toggler > span {
17
- @apply text-mono-400;
15
+ &__toggler {
16
+ @apply bg-mono-900 text-mono-400;
17
+
18
18
  display: flex;
19
19
  align-items: center;
20
20
  justify-content: center;
21
- }
22
-
23
- &__toggler {
24
- @apply bg-mono-900;
25
21
 
26
22
  position: relative;
27
23
  white-space: nowrap;
@@ -50,17 +46,20 @@
50
46
  }
51
47
 
52
48
  &__toggler > span {
49
+ @apply text-mono-400;
50
+
53
51
  display: flex;
54
52
  align-items: center;
55
53
  justify-content: center;
56
54
 
57
- height: 2.75rem;
55
+ min-height: 2.75rem;
58
56
  min-width: 6.25rem;
57
+ height: 100%;
59
58
  width: 100%;
60
59
  border-radius: 0.5rem;
61
60
 
62
- padding-left: 0.5rem;
63
- padding-right: 0.5rem;
61
+ padding-left: 1.5rem;
62
+ padding-right: 1.5rem;
64
63
  }
65
64
 
66
65
  &__toggler:focus,
@@ -139,19 +138,6 @@
139
138
  }
140
139
  }
141
140
 
142
- &__arrow-btn.aw-button.theme-ghost {
143
- align-items: center;
144
-
145
- width: 2.5rem;
146
- height: 2.5rem;
147
-
148
- border-radius: 0.625rem;
149
-
150
- .aw-button__overlay {
151
- border-radius: 0.625rem;
152
- }
153
- }
154
-
155
141
  &--pagination {
156
142
  .aw-button-nav {
157
143
  &__toggler {
@@ -169,7 +155,7 @@
169
155
  }
170
156
 
171
157
  & > span {
172
- height: 2.375rem;
158
+ min-height: 2.375rem;
173
159
  border-radius: 0.5625rem;
174
160
  min-width: 0;
175
161
  width: 2.6rem;
@@ -221,7 +207,7 @@
221
207
 
222
208
  & > span {
223
209
  border-radius: 0.5rem;
224
- height: 2.25rem;
210
+ min-height: 2.25rem;
225
211
  }
226
212
  }
227
213
 
@@ -4,7 +4,6 @@
4
4
  display: flex;
5
5
  align-items: center;
6
6
  width: 100%;
7
- padding: 1rem 1.5rem;
8
7
 
9
8
  &:hover,
10
9
  &:focus {
@@ -13,24 +12,16 @@
13
12
  }
14
13
 
15
14
  &--active {
16
- color: var(--c-accent);
15
+ color: var(--c-mono-100);
17
16
  font-weight: bold;
18
- }
19
17
 
20
- &__icon-bg {
21
- border-radius: 0.3125rem;
22
- line-height: 1;
23
- flex: none;
18
+ .aw-mobile-menu-item__icon-bg {
19
+ color: var(--c-mono-100);
20
+ }
24
21
  }
25
22
 
26
- /* &__icon {} */
27
-
28
- &__text {
29
- display: flex;
30
- flex-direction: column;
31
- justify-content: center;
32
- padding: 0 1rem;
33
- flex-grow: 1;
23
+ &__icon-bg {
24
+ color: var(--c-mono-300);
34
25
  }
35
26
 
36
27
  &__description {
@@ -42,4 +33,52 @@
42
33
  &__arrow {
43
34
  flex: none;
44
35
  }
36
+
37
+ &--primary {
38
+ padding: 1rem 1.5rem;
39
+
40
+ .aw-mobile-menu-item {
41
+ &__icon-bg {
42
+ border-radius: 0.3125rem;
43
+ line-height: 1;
44
+ flex: none;
45
+ }
46
+
47
+ &__text {
48
+ display: flex;
49
+ flex-direction: column;
50
+ justify-content: center;
51
+ padding: 0 1rem;
52
+ flex-grow: 1;
53
+ }
54
+ }
55
+ }
56
+
57
+ &--island {
58
+ padding: 1.5rem;
59
+ border-radius: 1.25rem;
60
+
61
+ .aw-mobile-menu-item {
62
+ &__icon-bg {
63
+ margin-right: 1rem;
64
+ align-self: start;
65
+ }
66
+
67
+ &__text {
68
+ font-size: 1rem;
69
+ line-height: 1.5rem;
70
+ margin-right: 1rem;
71
+ }
72
+
73
+ &__description {
74
+ display: block;
75
+ font-weight: 400;
76
+ margin-top: 0.25rem;
77
+ }
78
+
79
+ &__arrow {
80
+ margin-left: auto;
81
+ }
82
+ }
83
+ }
45
84
  }
@@ -7,7 +7,7 @@
7
7
  line-height: 1rem;
8
8
  font-weight: bold;
9
9
  padding: 0 1.5rem;
10
- margin-bottom: 1rem;
10
+ margin-bottom: 1.5rem;
11
11
  }
12
12
 
13
13
  ol, ul {
@@ -34,7 +34,7 @@
34
34
  }
35
35
  }
36
36
 
37
- li + li .aw-mobile-menu-item-new {
37
+ li + li .aw-mobile-menu-item--island {
38
38
  position: relative;
39
39
  margin-top: 0.125rem;
40
40
  }
@@ -115,6 +115,7 @@
115
115
  padding: 0.8125rem 1.5rem;
116
116
 
117
117
  &-icon {
118
+ color: var(--c-mono-300);
118
119
  margin-right: 1rem;
119
120
  }
120
121
 
@@ -57,17 +57,17 @@ $modal-aside-width-large: 75vw;
57
57
  }
58
58
 
59
59
  &__close {
60
- margin-left: auto;
61
60
  width: 3rem;
62
61
  height: 3rem;
63
62
  }
64
63
 
65
64
  &__title {
66
- @apply m-0 pr-6 text-left leading-tight font-heading truncate;
65
+ @apply my-0 ml-0 pr-6 text-left leading-tight font-heading truncate;
67
66
 
68
67
  font-size: 1.25rem;
69
68
  line-height: 1.5rem;
70
69
  font-weight: 700;
70
+ margin-right: auto;
71
71
  }
72
72
 
73
73
  &__subtitle {
@@ -0,0 +1,48 @@
1
+ .aw-more {
2
+ @apply bg-page-bg;
3
+ width: 100%;
4
+ min-height: 100vh;
5
+ padding-bottom: calc(5rem + var(--page-buttons-bottom, 0px));
6
+
7
+ &__profile {
8
+ display: flex;
9
+ justify-content: center;
10
+ align-items: center;
11
+ flex-direction: column;
12
+
13
+ background: var(--c-surface);
14
+ border-radius: 0 0 0.9375rem 0.9375rem;
15
+ padding: 1.9375rem 1.5rem 1.5rem;
16
+ }
17
+
18
+ &__theme {
19
+ @apply bg-surface;
20
+
21
+ display: flex;
22
+ align-items: center;
23
+ position: relative;
24
+
25
+ padding: 0.8125rem 1.5rem;
26
+
27
+ &-icon {
28
+ color: var(--c-mono-300);
29
+ margin-right: 1rem;
30
+ }
31
+
32
+ &-text {
33
+ font-size: 1rem;
34
+ font-weight: 400;
35
+ line-height: 1.3125rem;
36
+ }
37
+
38
+ &-switcher {
39
+ margin-left: auto;
40
+ padding-top: 0;
41
+ padding-bottom: 0;
42
+
43
+ .aw-switch-field__switch {
44
+ margin: 0.1875rem;
45
+ }
46
+ }
47
+ }
48
+ }
@@ -61,6 +61,10 @@
61
61
  &--reverse {
62
62
  order: -1;
63
63
  }
64
+
65
+ &--column:empty {
66
+ display: none;
67
+ }
64
68
  }
65
69
 
66
70
  &__top-scroll-mark {
@@ -66,6 +66,11 @@
66
66
  width: 100%;
67
67
  max-height: 1px;
68
68
  } */
69
+
70
+ .aw-text-field__prefix {
71
+ background: transparent;
72
+ padding-left: 0.25rem;
73
+ }
69
74
  }
70
75
 
71
76
  &__notify {
@@ -85,7 +90,7 @@
85
90
  &__mobile-input {
86
91
  position: sticky;
87
92
  top: 0;
88
-
93
+
89
94
  &.opened,
90
95
  & .aw-text-field__element {
91
96
  border-bottom-left-radius: 0;
@@ -109,6 +114,11 @@
109
114
  &.opened .aw-text-field__label {
110
115
  left: 1rem;
111
116
  }
117
+
118
+ .aw-text-field__prefix {
119
+ background: transparent;
120
+ padding-left: 0.25rem;
121
+ }
112
122
  }
113
123
 
114
124
  &--mobile-opened .aw-select__dropdown {
@@ -79,3 +79,24 @@ export function getLayout(context) {
79
79
 
80
80
  return 'default'
81
81
  }
82
+
83
+ /**
84
+ * Merges vue-router routes recursively
85
+ * @param {Array} existingRoutes
86
+ * @param {Array} newRoutes
87
+ */
88
+ export function mergeRoutes(existingRoutes, newRoutes) {
89
+ newRoutes.forEach(newRoute => {
90
+ const existing = existingRoutes.find(
91
+ ({ path }) => path === newRoute.path
92
+ )
93
+
94
+ if (existing && existing.children) {
95
+ return mergeRoutes(existing.children, newRoute.children)
96
+ }
97
+
98
+ if (!existing) {
99
+ existingRoutes.push(newRoute)
100
+ }
101
+ })
102
+ }
@@ -138,6 +138,14 @@
138
138
  autocomplete="off"
139
139
  @input="_applySearch"
140
140
  >
141
+ <template #prefix>
142
+ <AwButton color="mono" v-if="isOpened" @click="_close">
143
+ <template #icon>
144
+ <AwIconSystemMono name="arrow" />
145
+ </template>
146
+ </AwButton>
147
+ </template>
148
+
141
149
  <template #icon>
142
150
  <AwButton
143
151
  v-if="_isCreateButton"
@@ -151,15 +151,15 @@
151
151
  @clear="clear"
152
152
  >
153
153
  <template #prefix>
154
- <slot
155
- name="icon"
156
- v-bind="{
157
- option: value,
158
- optionLabel: _selectedLabel,
159
- isLoading,
160
- isOpened
161
- }"
162
- ></slot>
154
+ <AwButton
155
+ color="mono"
156
+ v-if="isOpened"
157
+ @click="close"
158
+ >
159
+ <template #icon>
160
+ <AwIconSystemMono name="arrow" />
161
+ </template>
162
+ </AwButton>
163
163
  </template>
164
164
 
165
165
  <template #caret="data">
@@ -15,7 +15,8 @@
15
15
  :text="$t('Menu')"
16
16
  icon="menu-dots"
17
17
  :size="$options.ICON_SIZE"
18
- @click="$store.commit('awesIo/TOGGLE_MOBILE_MENU')"
18
+ href="/more"
19
+ :active="!activeMenu"
19
20
  >
20
21
  <template #default="{ text }">
21
22
  <span
@@ -42,7 +43,7 @@
42
43
  import { viewOr, lensProp, omit } from 'rambdax'
43
44
  import AwMenuItemIcon from '@AwLayouts/_AwMenuItemIcon.vue'
44
45
 
45
- const VISIBLE_ITEMS_COUNT = 4
46
+ export const VISIBLE_ITEMS_COUNT = 4
46
47
 
47
48
  const ICON_SIZE = 28
48
49
 
@@ -23,22 +23,29 @@
23
23
  <div :class="elClasses.dialog" role="document">
24
24
  <!-- header -->
25
25
  <div ref="header" tabindex="-1" :class="elClasses.header">
26
- <div :class="elClasses.title">
27
- {{ title }}
28
- </div>
29
-
30
- <AwButton
31
- :class="elClasses.close"
32
- :title="$t('Close')"
33
- :aria-label="$t('Close')"
34
- color="mono-light"
35
- tabindex="0"
36
- @click.prevent="close()"
37
- >
38
- <template #icon>
39
- <AwIconSystemMono name="close" size="16" />
40
- </template>
41
- </AwButton>
26
+ <slot name="header" :title="title" :close="close">
27
+ <slot name="before-title" />
28
+
29
+ <div :class="elClasses.title">
30
+ {{ title }}
31
+ </div>
32
+
33
+ <slot name="after-title" />
34
+
35
+ <AwButton
36
+ v-if="!notClosing"
37
+ :class="elClasses.close"
38
+ :title="$t('Close')"
39
+ :aria-label="$t('Close')"
40
+ color="mono-light"
41
+ tabindex="0"
42
+ @click.prevent="close()"
43
+ >
44
+ <template #icon>
45
+ <AwIconSystemMono name="close" size="16" />
46
+ </template>
47
+ </AwButton>
48
+ </slot>
42
49
  </div>
43
50
  <!-- / header -->
44
51
 
@@ -133,6 +140,8 @@ export default {
133
140
  }
134
141
  },
135
142
 
143
+ notClosing: Boolean,
144
+
136
145
  name: {
137
146
  type: String,
138
147
  default: () => `modal-${_uniqModalId++}`
@@ -206,6 +215,10 @@ export default {
206
215
  },
207
216
 
208
217
  paramComputed() {
218
+ if (this.notClosing) {
219
+ return null
220
+ }
221
+
209
222
  switch (typeof this.param) {
210
223
  case 'string':
211
224
  return this.param || DEFAULT_GET_PARAM
@@ -245,9 +258,15 @@ export default {
245
258
  if (typeof document === 'undefined') return
246
259
  this.lastFocused = document.activeElement
247
260
  this.$nextTick(() => this.$refs.header.focus())
248
- window.addEventListener('keyup', this._escButtonHandler)
261
+
262
+ if (!this.notClosing) {
263
+ window.addEventListener('keyup', this._escButtonHandler)
264
+ }
249
265
  } else {
250
- window.removeEventListener('keyup', this._escButtonHandler)
266
+ if (!this.notClosing) {
267
+ window.removeEventListener('keyup', this._escButtonHandler)
268
+ }
269
+
251
270
  if (this.lastFocused) {
252
271
  this.lastFocused.focus()
253
272
  this.lastFocused = null // clear reference
@@ -293,7 +312,7 @@ export default {
293
312
  },
294
313
 
295
314
  selfClose() {
296
- if (this.fullscreen || !this.bgClickClose) return
315
+ if (this.fullscreen || !this.bgClickClose || this.notClosing) return
297
316
  let self = this
298
317
  window.addEventListener('mouseup', function onUp(e) {
299
318
  window.removeEventListener('mouseup', onUp)
@@ -7,9 +7,8 @@
7
7
  v-if="backUrl || isMenuToggler"
8
8
  class="aw-page-headline__back"
9
9
  color="mono"
10
- :href="backUrl"
10
+ :href="backUrl || '/more'"
11
11
  :aria-label="isMenuToggler ? $t('Menu') : breadcrumb.title"
12
- v-on="isMenuToggler ? { click: openMenu } : null"
13
12
  >
14
13
  <template #icon>
15
14
  <AwIconSystemMono name="arrow" />
@@ -134,12 +133,6 @@ export default {
134
133
  isMenuToggler() {
135
134
  return !this.backUrl && !this.$screen.lg && this.breadcrumbMenu
136
135
  }
137
- },
138
-
139
- methods: {
140
- openMenu() {
141
- this.$store.commit('awesIo/TOGGLE_MOBILE_MENU', true)
142
- }
143
136
  }
144
137
  }
145
138
  </script>
@@ -1,13 +1,13 @@
1
1
  <template>
2
2
  <AwLayoutProvider class="aw-layout">
3
- <AwMobileMenu v-if="!$screen.lg">
4
- <template
5
- v-for="(index, name) in $scopedSlots"
6
- v-slot:[name]="data"
7
- >
8
- <slot :name="name" v-bind="data"></slot>
9
- </template>
10
- </AwMobileMenu>
3
+ <!-- <AwMobileMenu v-if="!$screen.lg">-->
4
+ <!-- <template-->
5
+ <!-- v-for="(index, name) in $scopedSlots"-->
6
+ <!-- v-slot:[name]="data"-->
7
+ <!-- >-->
8
+ <!-- <slot :name="name" v-bind="data"></slot>-->
9
+ <!-- </template>-->
10
+ <!-- </AwMobileMenu>-->
11
11
 
12
12
  <AwLayoutMenu v-if="$screen.lg" class="aw-layout__aw-layout-menu">
13
13
  <template
@@ -25,7 +25,7 @@
25
25
  </template>
26
26
 
27
27
  <script>
28
- import AwMobileMenu from '@AwLayouts/_AwMobileMenu.vue'
28
+ // import AwMobileMenu from '@AwLayouts/_AwMobileMenu.vue'
29
29
  import AwLayoutMenu from '@AwLayouts/_AwLayoutMenu.vue'
30
30
  import AwHeaderNotification from '@AwLayouts/_AwHeaderNotification.vue'
31
31
 
@@ -33,7 +33,7 @@ export default {
33
33
  name: 'AwLayout',
34
34
 
35
35
  components: {
36
- AwMobileMenu,
36
+ // AwMobileMenu,
37
37
  AwLayoutMenu,
38
38
  AwHeaderNotification
39
39
  }
@@ -70,11 +70,12 @@
70
70
  >
71
71
  <template #default="{items, _getChildrenCount, isActive }">
72
72
  <li v-for="(item, i) in items" :key="i" v-show="!item.abstract">
73
- <AwMobileMenuItemNew
73
+ <AwMobileMenuItem
74
74
  v-bind="item"
75
75
  :href="_getChildrenCount(item) ? null : item.href"
76
76
  :arrow="!!(item.href || _getChildrenCount(item))"
77
77
  :active="isActive(item)"
78
+ theme="island"
78
79
  v-on="
79
80
  _getChildrenCount(item)
80
81
  ? {
@@ -101,11 +102,12 @@
101
102
  >
102
103
  <template #default="{items, _getChildrenCount, isActive }">
103
104
  <li v-for="(item, i) in items" :key="i" v-show="!item.abstract">
104
- <AwMobileMenuItemNew
105
+ <AwMobileMenuItem
105
106
  v-bind="item"
106
107
  :href="_getChildrenCount(item) ? null : item.href"
107
108
  :arrow="!!(item.href || _getChildrenCount(item))"
108
109
  :active="isActive(item)"
110
+ theme="isalnd"
109
111
  v-on="
110
112
  _getChildrenCount(item)
111
113
  ? {
@@ -214,7 +216,7 @@ import { LINK_REGEX } from '@AwConfig'
214
216
  import { conf } from '@AwUtils/component'
215
217
  import { getPath } from '@AwUtils/router'
216
218
  import AwMobileMenuNav from '@AwLayouts/_AwMobileMenuNav.vue'
217
- import AwMobileMenuItemNew from '@AwLayouts/_AwMobileMenuItemNew.vue'
219
+ import AwMobileMenuItem from '@AwLayouts/_AwMobileMenuItem.vue'
218
220
  // import AwMobileMenuItem from '@AwLayouts/_AwMobileMenuItem.vue'
219
221
 
220
222
  export default {
@@ -223,7 +225,7 @@ export default {
223
225
  components: {
224
226
  AwMobileMenuNav,
225
227
  AwLayoutLogo: () => import('@AwLayouts/_AwLayoutLogo.vue'),
226
- AwMobileMenuItemNew
228
+ AwMobileMenuItem
227
229
  // AwMobileMenuItem
228
230
  },
229
231
 
@@ -2,7 +2,11 @@
2
2
  <Component
3
3
  :is="_linkComponent"
4
4
  v-bind="_linkAttrs"
5
- :class="{ 'aw-mobile-menu-item--active': active }"
5
+ :class="{
6
+ 'aw-mobile-menu-item--active': active,
7
+ 'aw-mobile-menu-item--primary': theme === 'primary',
8
+ 'aw-mobile-menu-item--island': theme === 'island'
9
+ }"
6
10
  class="aw-mobile-menu-item focus-outline"
7
11
  v-on="$listeners"
8
12
  >
@@ -27,6 +31,13 @@
27
31
  v-html="$sanitize(description)"
28
32
  class="aw-mobile-menu-item__description"
29
33
  ></span>
34
+
35
+ <span
36
+ v-else-if="childrenDescription && theme === 'island'"
37
+ class="aw-mobile-menu-item__description"
38
+ >
39
+ {{ childrenDescription }}
40
+ </span>
30
41
  </span>
31
42
 
32
43
  <AwBadge v-if="badge" v-bind="badge" class="mr-2" />
@@ -35,13 +46,14 @@
35
46
  v-if="_linkExternal"
36
47
  name="external"
37
48
  size="24"
38
- class="aw-mobile-menu-item__arrow text-on-surface"
49
+ class="aw-mobile-menu-item__arrow text-mono-400"
39
50
  />
40
51
 
41
52
  <AwIconSystemMono
42
53
  v-else-if="arrow"
43
54
  name="angle"
44
55
  rotate="180"
56
+ size="24"
45
57
  class="aw-mobile-menu-item__arrow text-mono-400"
46
58
  />
47
59
  </slot>
@@ -67,11 +79,21 @@ export default {
67
79
  default: ''
68
80
  },
69
81
 
82
+ theme: {
83
+ type: String,
84
+ default: 'primary' // primary, island
85
+ },
86
+
70
87
  href: {
71
88
  type: [String, Object],
72
89
  default: ''
73
90
  },
74
91
 
92
+ children: {
93
+ type: Array,
94
+ default: () => []
95
+ },
96
+
75
97
  icon: {
76
98
  type: String,
77
99
  default: ''
@@ -105,6 +127,12 @@ export default {
105
127
  color: '#fff'
106
128
  }
107
129
  : null
130
+ },
131
+
132
+ childrenDescription() {
133
+ const childrenText = this.children.map((item) => this.$t(item.text))
134
+
135
+ return childrenText.join(' • ')
108
136
  }
109
137
  }
110
138
  }
package/nuxt/index.js CHANGED
@@ -11,6 +11,7 @@ import {
11
11
  notify as configNotify
12
12
  } from './awes.config.js'
13
13
  import defaultTailwindConfig from '../tailwind.config.js'
14
+ import { mergeRoutes } from '../assets/js/router.js'
14
15
 
15
16
  const DEFAULT_DAYJS_LOCALE = 'en'
16
17
 
@@ -409,6 +410,15 @@ async function AwesIoUi() {
409
410
  })
410
411
  }
411
412
  })
413
+
414
+ this.nuxt.hook('build:extendRoutes', (routes = []) => {
415
+ mergeRoutes(routes, [
416
+ {
417
+ path: '/more',
418
+ component: resolve(__dirname, './pages/more.vue')
419
+ }
420
+ ])
421
+ })
412
422
  }
413
423
 
414
424
  AwesIoUi.meta = JSON.parse(
@@ -0,0 +1,179 @@
1
+ <template>
2
+ <div class="aw-more">
3
+ <div class="aw-more__profile" v-if="user">
4
+ <AwAvatar :src="user.src" :name="user.name" size="144" />
5
+
6
+ <AwHeadline tag="span" class="aw-more__profile-name mt-2">
7
+ {{ user.name }}
8
+ </AwHeadline>
9
+
10
+ <AwDescription
11
+ v-if="user.description"
12
+ tag="div"
13
+ class="aw-more__profile-description mt-2"
14
+ >
15
+ {{ user.description }}
16
+ </AwDescription>
17
+
18
+ <AwButton
19
+ class="mt-6 w-full"
20
+ :text="$t('Your profile')"
21
+ color="dark"
22
+ :href="profileUrl"
23
+ />
24
+ </div>
25
+
26
+ <slot name="before-mobile-menu">
27
+ <Component
28
+ v-if="beforeMobileMenuComponent"
29
+ :is="beforeMobileMenuComponent.is"
30
+ v-bind="beforeMobileMenuComponent.props"
31
+ />
32
+ </slot>
33
+
34
+ <AwMobileMenuNav :title="$t('More')" :items="mainMenu" class="mt-6">
35
+ <template #default="{items, _getChildrenCount, isActive }">
36
+ <li v-for="(item, i) in items" :key="i" v-show="!item.abstract">
37
+ <AwMobileMenuItem
38
+ v-bind="item"
39
+ :href="item.href"
40
+ theme="island"
41
+ :arrow="!!(item.href || _getChildrenCount(item))"
42
+ :active="isActive(item)"
43
+ v-on="item.listeners"
44
+ />
45
+ </li>
46
+ </template>
47
+ </AwMobileMenuNav>
48
+
49
+ <AwMobileMenuNav :items="secondaryMenu" class="mt-6">
50
+ <template #default="{items, _getChildrenCount, isActive }">
51
+ <li v-for="(item, i) in items" :key="i" v-show="!item.abstract">
52
+ <AwMobileMenuItem
53
+ v-bind="item"
54
+ :href="item.href"
55
+ theme="island"
56
+ :arrow="!!(item.href || _getChildrenCount(item))"
57
+ :active="isActive(item)"
58
+ v-on="item.listeners"
59
+ />
60
+ </li>
61
+ </template>
62
+ </AwMobileMenuNav>
63
+
64
+ <AwMobileMenuNav :items="userMenu" class="mt-6">
65
+ <template #before>
66
+ <div class="aw-more__theme">
67
+ <AwIconSystemMono
68
+ :size="24"
69
+ class="aw-more__theme-icon"
70
+ name="light"
71
+ />
72
+
73
+ <span class="aw-more__theme-text">{{
74
+ $t('Dark theme')
75
+ }}</span>
76
+
77
+ <AwSwitcher
78
+ v-model="isDarkTheme"
79
+ class="aw-more__theme-switcher"
80
+ />
81
+ </div>
82
+ </template>
83
+ </AwMobileMenuNav>
84
+
85
+ <AwMobileMenuNav :items="tertiaryMenu" class="my-6" />
86
+
87
+ <slot name="after-mobile-menu">
88
+ <Component
89
+ v-if="afterMobileMenuComponent"
90
+ :is="afterMobileMenuComponent.is"
91
+ v-bind="afterMobileMenuComponent.props"
92
+ />
93
+ </slot>
94
+
95
+ <AwBottomBar />
96
+ </div>
97
+ </template>
98
+
99
+ <script>
100
+ import { mapGetters } from 'vuex'
101
+ import { lensProp, pathOr, viewOr } from 'rambdax'
102
+
103
+ import AwMobileMenuNav from '@AwLayouts/_AwMobileMenuNav.vue'
104
+ import AwMobileMenuItem from '@AwLayouts/_AwMobileMenuItem.vue'
105
+ import { VISIBLE_ITEMS_COUNT } from '@AwOrganisms/AwBottomBar.vue'
106
+
107
+ export default {
108
+ name: 'More',
109
+
110
+ layout: 'empty',
111
+
112
+ inject: {
113
+ layoutProvider: {
114
+ default: null
115
+ }
116
+ },
117
+
118
+ components: {
119
+ AwMobileMenuNav,
120
+ AwMobileMenuItem
121
+ },
122
+
123
+ computed: {
124
+ ...mapGetters('awesIo', [
125
+ 'user',
126
+ 'logoComponent',
127
+ 'afterMobileMenuComponent',
128
+ 'beforeMobileMenuComponent',
129
+ 'bottomBarAction'
130
+ ]),
131
+
132
+ profileUrl() {
133
+ return pathOr(null, 'awesIo.profileUrl', this.$store.state)
134
+ },
135
+
136
+ menuItemsStartIndex() {
137
+ return VISIBLE_ITEMS_COUNT - (this.bottomBarAction ? 2 : 1)
138
+ },
139
+
140
+ mainMenu() {
141
+ return viewOr([], lensProp('mainMenu'), this.layoutProvider).filter(
142
+ ({ is }) => !is
143
+ ).slice(this.menuItemsStartIndex)
144
+ },
145
+
146
+ secondaryMenu() {
147
+ return viewOr(
148
+ [],
149
+ lensProp('secondaryMenu'),
150
+ this.layoutProvider
151
+ ).filter(({ is }) => !is)
152
+ },
153
+
154
+ tertiaryMenu() {
155
+ return viewOr(
156
+ [],
157
+ lensProp('tertiaryMenu'),
158
+ this.layoutProvider
159
+ ).filter(({ is }) => !is)
160
+ },
161
+
162
+ userMenu() {
163
+ return viewOr([], lensProp('userMenu'), this.layoutProvider).filter(
164
+ ({ is }) => !is
165
+ )
166
+ },
167
+
168
+ isDarkTheme: {
169
+ get() {
170
+ return this.$store.getters['awesIo/isDarkTheme']
171
+ },
172
+
173
+ set(val) {
174
+ this.$store.commit('awesIo/SET_DARK_THEME', val)
175
+ }
176
+ }
177
+ }
178
+ }
179
+ </script>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@awes-io/ui",
3
- "version": "2.91.1",
3
+ "version": "2.93.0",
4
4
  "description": "User Interface (UI) components",
5
5
  "keywords": [
6
6
  "ui",
@@ -114,5 +114,5 @@
114
114
  "rollup-plugin-visualizer": "^2.6.0",
115
115
  "rollup-plugin-vue": "^5.0.1"
116
116
  },
117
- "gitHead": "67ab5fc3f0f2cda7aad811b8ccfee1f179325cca"
117
+ "gitHead": "f26263752064890282eda08c1e201dc59adc25ac"
118
118
  }
@@ -1,45 +0,0 @@
1
- .aw-mobile-menu-item-new {
2
- @apply bg-surface;
3
- font-size: theme('fontSize.base', 1rem);
4
- display: flex;
5
- align-items: center;
6
- width: 100%;
7
- padding: 1.5rem;
8
- border-radius: 1.25rem;
9
-
10
- &:hover,
11
- &:focus {
12
- oultine: none;
13
- text-decoration: none;
14
- }
15
-
16
- &--active {
17
- color: var(--c-accent);
18
- font-weight: bold;
19
- }
20
-
21
- &__icon-bg {
22
- margin-right: 1rem;
23
- align-self: start;
24
- }
25
-
26
- &__text {
27
- font-size: 1rem;
28
- line-height: 1.5rem;
29
- margin-right: 1rem;
30
- }
31
-
32
- &__description {
33
- display: block;
34
- font-weight: 400;
35
- color: var(--c-mono-400);
36
- font-size: 0.875rem;
37
- line-height: 1rem;
38
- margin-top: 0.25rem;
39
- }
40
-
41
- &__arrow {
42
- margin-left: auto;
43
- flex: none;
44
- }
45
- }
@@ -1,128 +0,0 @@
1
- <template>
2
- <Component
3
- :is="_linkComponent"
4
- v-bind="_linkAttrs"
5
- :class="{ 'aw-mobile-menu-item-new--active': active }"
6
- class="aw-mobile-menu-item-new focus-outline"
7
- v-on="$listeners"
8
- >
9
- <slot>
10
- <span
11
- v-if="icon"
12
- class="aw-mobile-menu-item-new__icon-bg"
13
- :style="iconColor"
14
- >
15
- <AwIcon
16
- :name="(active && iconActive) || icon"
17
- size="24"
18
- class="aw-mobile-menu-item-new__icon"
19
- />
20
- </span>
21
-
22
- <span class="aw-mobile-menu-item-new__text" tabindex="-1">
23
- {{ text }}
24
-
25
- <span
26
- v-if="description"
27
- v-html="$sanitize(description)"
28
- class="aw-mobile-menu-item-new__description"
29
- ></span>
30
-
31
- <span
32
- v-else-if="childrenDescription"
33
- class="aw-mobile-menu-item-new__description"
34
- >
35
- {{ childrenDescription }}
36
- </span>
37
- </span>
38
-
39
- <AwBadge v-if="badge" v-bind="badge" class="mr-2" />
40
-
41
- <AwIconSystemMono
42
- v-if="_linkExternal"
43
- name="external"
44
- class="aw-mobile-menu-item-new__arrow text-on-surface"
45
- />
46
-
47
- <AwIconSystemMono
48
- v-else-if="arrow"
49
- name="angle"
50
- rotate="180"
51
- class="aw-mobile-menu-item-new__arrow text-mono-400"
52
- />
53
- </slot>
54
- </Component>
55
- </template>
56
-
57
- <script>
58
- import linkMixin from '@AwMixins/link'
59
-
60
- export default {
61
- name: 'AwMobileMenuItemNew',
62
-
63
- mixins: [linkMixin],
64
-
65
- props: {
66
- text: {
67
- type: String,
68
- required: true
69
- },
70
-
71
- description: {
72
- type: String,
73
- default: ''
74
- },
75
-
76
- href: {
77
- type: [String, Object],
78
- default: ''
79
- },
80
-
81
- children: {
82
- type: Array,
83
- default: () => []
84
- },
85
-
86
- icon: {
87
- type: String,
88
- default: ''
89
- },
90
-
91
- iconBg: {
92
- type: String,
93
- default: ''
94
- },
95
-
96
- iconActive: {
97
- type: String,
98
- default: ''
99
- },
100
-
101
- badge: {
102
- type: Object,
103
- default: null
104
- },
105
-
106
- arrow: Boolean,
107
-
108
- active: Boolean
109
- },
110
-
111
- computed: {
112
- iconColor() {
113
- return this.iconBg
114
- ? {
115
- backgroundColor: this.iconBg,
116
- color: '#fff'
117
- }
118
- : null
119
- },
120
-
121
- childrenDescription() {
122
- const childrenText = this.children.map((item) => this.$t(item.text))
123
-
124
- return childrenText.join(' • ')
125
- }
126
- }
127
- }
128
- </script>