@awes-io/ui 2.81.0 → 2.83.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,30 @@
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.83.0](https://github.com/awes-io/client/compare/@awes-io/ui@2.82.0...@awes-io/ui@2.83.0) (2023-11-15)
7
+
8
+
9
+ ### Features
10
+
11
+ * address block sends formatted address ([fd5c456](https://github.com/awes-io/client/commit/fd5c45646187c2ce5167303c35acb70a1d1f6f17))
12
+ * change hove and focus color for inputs ([087787a](https://github.com/awes-io/client/commit/087787a665c170f9b79abba22bc4b0d6a56c8bc4))
13
+ * change style for dropdown btn ([31916a6](https://github.com/awes-io/client/commit/31916a61f049a4c7d3d8354e97419d27ce03a992))
14
+
15
+
16
+
17
+
18
+
19
+ # [2.82.0](https://github.com/awes-io/client/compare/@awes-io/ui@2.81.0...@awes-io/ui@2.82.0) (2023-11-08)
20
+
21
+
22
+ ### Features
23
+
24
+ * mobile nav special behaviour added ([0c37293](https://github.com/awes-io/client/commit/0c37293ebc3b3d73a5d39c4a5a4d376d612e7013))
25
+
26
+
27
+
28
+
29
+
6
30
  # [2.81.0](https://github.com/awes-io/client/compare/@awes-io/ui@2.80.0...@awes-io/ui@2.81.0) (2023-11-08)
7
31
 
8
32
 
@@ -32,6 +32,10 @@
32
32
  &.is-active {
33
33
  @apply bg-mono-900;
34
34
  }
35
+
36
+ .aw-icon {
37
+ @apply text-mono-400;
38
+ }
35
39
  }
36
40
 
37
41
  &[disabled] > span {
@@ -1,5 +1,5 @@
1
1
  .aw-text-field {
2
- @apply border text-base;
2
+ @apply border border-mono-800 text-base;
3
3
  position: relative;
4
4
  transition: 200ms border-color;
5
5
  background-color: var(--c-surface);
@@ -17,6 +17,10 @@
17
17
  background-image: none;
18
18
  }
19
19
 
20
+ &:hover {
21
+ @apply border-mono-600;
22
+ }
23
+
20
24
  &:focus-within {
21
25
  @apply border-mono-400;
22
26
  }
@@ -14,11 +14,7 @@
14
14
  class="w-6 text-left inline-block mr-1"
15
15
  >
16
16
  <slot name="icon">
17
- <AwIcon
18
- :name="icon"
19
- :size="iconSize"
20
- class="text-mono-400"
21
- />
17
+ <AwIcon :name="icon" :size="iconSize" />
22
18
  </slot>
23
19
  </span>
24
20
  <slot>
@@ -42,11 +42,21 @@
42
42
  :class="{
43
43
  'hidden lg:block': mobileTextHidden,
44
44
  'sr-only': (theme === 'icon' || theme === 'circle') && icon,
45
- 'ml-1': icon && (text || $slots.default)
45
+ 'ml-2': icon && isContentAdded,
46
+ 'mr-2': iconRight && isContentAdded
46
47
  }"
47
48
  >
48
49
  <slot>{{ text }}</slot>
49
50
  </span>
51
+
52
+ <slot name="icon-right" v-bind="{ iconRight, iconSize }">
53
+ <AwIcon
54
+ v-if="iconRight"
55
+ :name="iconRight"
56
+ class="flex-shrink-0"
57
+ :size="iconSize"
58
+ />
59
+ </slot>
50
60
  </span>
51
61
 
52
62
  <span v-if="locked" class="aw-button__lock" v-tooltip="lockedTooltip">
@@ -108,6 +118,12 @@ export default {
108
118
  default: ''
109
119
  },
110
120
 
121
+ // Name of icon in button. Icon placed after text
122
+ iconRight: {
123
+ type: String,
124
+ default: ''
125
+ },
126
+
111
127
  // Indicates if loader spinner is shown
112
128
  loading: {
113
129
  type: [Boolean, String],
@@ -165,6 +181,10 @@ export default {
165
181
  )
166
182
  },
167
183
 
184
+ isContentAdded() {
185
+ return this.text || this.$scopedSlots.default
186
+ },
187
+
168
188
  // loadingText() {
169
189
  // return (
170
190
  // (isType('String', this.loading) && this.loading) ||
@@ -73,7 +73,7 @@ export default {
73
73
  this.$refs.select.searchPhrase = ''
74
74
  }
75
75
  this._resetSearch()
76
- this._formatAddressResponse(details).then((result) => {
76
+ this._formatAddressResponse(details, place).then((result) => {
77
77
  this.$emit('input', result)
78
78
  })
79
79
  }
@@ -148,9 +148,13 @@ export default {
148
148
  this.sessionToken = null
149
149
  },
150
150
 
151
- _formatAddressResponse(details) {
151
+ _formatAddressResponse(details, place) {
152
152
  if (details && details.address_components) {
153
- const response = {}
153
+ const response = {
154
+ description: details.formatted_address || place.description,
155
+ main: pathOr('', 'structured_formatting.main_text', place),
156
+ secondary: pathOr('', 'structured_formatting.secondary_text', place)
157
+ }
154
158
 
155
159
  details.address_components.forEach(
156
160
  ({ long_name, short_name, types }) => {
@@ -195,8 +195,11 @@ import { clone } from 'rambdax'
195
195
  import { makePreventableEventMock } from '@AwUtils/events'
196
196
 
197
197
  const BASE = {
198
+ description: null,
198
199
  meta: {
199
- google_country_name: null
200
+ google_country_name: null,
201
+ main: null,
202
+ secondary: null
200
203
  },
201
204
  country_iso: null,
202
205
  region: null,
@@ -329,6 +332,10 @@ export default {
329
332
  address.meta.county = obj.administrative_area_level_2
330
333
  }
331
334
 
335
+ address.description = obj.description
336
+ address.meta.main = obj.main
337
+ address.meta.secondary = obj.secondary
338
+
332
339
  event.data = address
333
340
 
334
341
  this.$emit('data', event)
@@ -32,7 +32,22 @@
32
32
  <slot name="buttons"></slot>
33
33
 
34
34
  <AwButton
35
- v-if="actionButton && isDesktop"
35
+ v-if="
36
+ actionButton && isDesktop && isDesktopActionBeforeMenu
37
+ "
38
+ v-bind="actionButton"
39
+ size="md"
40
+ @click="$emit('action')"
41
+ />
42
+ </template>
43
+
44
+ <template #after-menu>
45
+ <slot name="after-menu"></slot>
46
+
47
+ <AwButton
48
+ v-if="
49
+ actionButton && isDesktop && !isDesktopActionBeforeMenu
50
+ "
36
51
  v-bind="actionButton"
37
52
  size="md"
38
53
  @click="$emit('action')"
@@ -111,7 +126,7 @@
111
126
  </template>
112
127
 
113
128
  <script>
114
- import { isType } from 'rambdax'
129
+ import { isType, pathOr, omit } from 'rambdax'
115
130
  import pageMixin from '@AwMixins/page'
116
131
 
117
132
  const CONTAINER_TYPES = ['default', 'full']
@@ -182,12 +197,16 @@ export default {
182
197
  return this.$scopedSlots.preview || this.$slots.preview
183
198
  },
184
199
 
200
+ isDesktopActionBeforeMenu() {
201
+ return !!pathOr(false, 'before', this.action)
202
+ },
203
+
185
204
  actionButton() {
186
205
  if (!isType('Object', this.action)) {
187
206
  return null
188
207
  }
189
208
 
190
- return this.action
209
+ return omit(['before'], this.action)
191
210
  }
192
211
  },
193
212
 
@@ -232,10 +251,6 @@ export default {
232
251
 
233
252
  this.$options.$observer.observe(topScrollMark)
234
253
  this.$options.$observer.observe(bottomScrollMark)
235
-
236
- this.$once('hook:beforeDestroy', () => {
237
-
238
- })
239
254
  },
240
255
 
241
256
  _disableScrollWatcher() {
@@ -13,11 +13,11 @@
13
13
  </h1>
14
14
 
15
15
  <div class="aw-page-header__buttons">
16
- <slot>
17
- <!-- <EwSupportChat /> -->
18
- </slot>
16
+ <slot />
19
17
 
20
18
  <AwUserMenu v-if="!hideMenu" outline vertical caret />
19
+
20
+ <slot name="after-menu" />
21
21
  </div>
22
22
 
23
23
  <slot name="progress">
@@ -4,12 +4,13 @@
4
4
  <div class="aw-page-headline__back-wrapper">
5
5
  <slot name="headline-breadcrumb" :breadcrumb="breadcrumb">
6
6
  <AwButton
7
- v-if="backUrl"
7
+ v-if="backUrl || isMenuToggler"
8
8
  color="mono"
9
9
  class="w-10 h-10 aw-page-headline__back"
10
10
  :href="backUrl"
11
- :aria-label="breadcrumb.title"
11
+ :aria-label="isMenuToggler ? $t('Menu') : breadcrumb.title"
12
12
  content-class="p-0"
13
+ v-on="isMenuToggler ? { click: openMenu } : null"
13
14
  >
14
15
  <template #icon>
15
16
  <AwIconSystemMono name="arrow-l" size="24" />
@@ -98,7 +99,14 @@ export default {
98
99
  buttonsBreakpoint: {
99
100
  type: String,
100
101
  default: null
101
- }
102
+ },
103
+
104
+ breadcrumbMenu: {
105
+ type: Boolean,
106
+ default() {
107
+ return conf(this, 'breadcrumbMenu')
108
+ }
109
+ },
102
110
  },
103
111
 
104
112
  computed: {
@@ -122,6 +130,16 @@ export default {
122
130
  }
123
131
 
124
132
  return this.breadcrumb.href
133
+ },
134
+
135
+ isMenuToggler() {
136
+ return !this.backUrl && this.breadcrumbMenu
137
+ }
138
+ },
139
+
140
+ methods: {
141
+ openMenu() {
142
+ this.$store.commit('awesIo/TOGGLE_MOBILE_MENU', true)
125
143
  }
126
144
  }
127
145
  }
@@ -89,7 +89,8 @@
89
89
  click: () =>
90
90
  showSubmenu(
91
91
  item.children,
92
- item.subtitle || item.text
92
+ item.subtitle || item.text,
93
+ item.href
93
94
  )
94
95
  }
95
96
  : item.listeners || null
@@ -119,7 +120,8 @@
119
120
  click: () =>
120
121
  showSubmenu(
121
122
  item.children,
122
- item.subtitle || item.text
123
+ item.subtitle || item.text,
124
+ item.href
123
125
  )
124
126
  }
125
127
  : item.listeners || null
@@ -214,8 +216,11 @@
214
216
 
215
217
  <script>
216
218
  import { mapGetters } from 'vuex'
217
- import { pathOr, viewOr, lensProp, partition } from 'rambdax'
219
+ import { pathOr, viewOr, lensProp, partition, isType } from 'rambdax'
218
220
  import { disableBodyScroll, enableBodyScroll } from 'body-scroll-lock'
221
+ import { LINK_REGEX } from '@AwConfig'
222
+ import { conf } from '@AwUtils/component'
223
+ import { getPath } from '@AwUtils/router'
219
224
  import AwMobileMenuNav from '@AwLayouts/_AwMobileMenuNav.vue'
220
225
  import AwMobileMenuItemNew from '@AwLayouts/_AwMobileMenuItemNew.vue'
221
226
  // import AwMobileMenuItem from '@AwLayouts/_AwMobileMenuItem.vue'
@@ -230,6 +235,15 @@ export default {
230
235
  // AwMobileMenuItem
231
236
  },
232
237
 
238
+ props: {
239
+ navigateToFirstPage: {
240
+ type: Boolean,
241
+ default() {
242
+ return conf(this, 'navigateToFirstPage')
243
+ }
244
+ }
245
+ },
246
+
233
247
  inject: {
234
248
  layoutProvider: {
235
249
  default: null
@@ -348,7 +362,19 @@ export default {
348
362
  },
349
363
 
350
364
  methods: {
351
- showSubmenu(items, text) {
365
+ showSubmenu(items, text, href) {
366
+ if (this.navigateToFirstPage && href) {
367
+ if (isType('String', href) && LINK_REGEX.test(href)) {
368
+ window.location.assign(href)
369
+ } else if (getPath(this.$route) === getPath(href)) {
370
+ this.show = false
371
+ } else {
372
+ this.$router.push(href)
373
+ }
374
+
375
+ return
376
+ }
377
+
352
378
  const [submenu, submenuDeep] = partition(
353
379
  ({ children }) =>
354
380
  !Array.isArray(children) || children.length === 0,
@@ -33,7 +33,8 @@
33
33
  $emit(
34
34
  'click:submenu',
35
35
  item.children,
36
- item.subtitle || item.text
36
+ item.subtitle || item.text,
37
+ item.href
37
38
  )
38
39
  }
39
40
  : item.listeners || null
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@awes-io/ui",
3
- "version": "2.81.0",
3
+ "version": "2.83.0",
4
4
  "description": "User Interface (UI) components",
5
5
  "keywords": [
6
6
  "ui",
@@ -113,5 +113,5 @@
113
113
  "rollup-plugin-visualizer": "^2.6.0",
114
114
  "rollup-plugin-vue": "^5.0.1"
115
115
  },
116
- "gitHead": "4652ce2e297a512f850ff0c8eb6a6315a22733f3"
116
+ "gitHead": "ea4f770f2aa8cd95e2ea082b2a03887a766d772c"
117
117
  }