@awes-io/ui 2.40.0 → 2.42.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,50 @@
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.42.1](https://github.com/awes-io/client/compare/@awes-io/ui@2.42.0...@awes-io/ui@2.42.1) (2022-02-10)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * locked prop for fixed button ([9e2067a](https://github.com/awes-io/client/commit/9e2067ae0abbbfe766f6ea63d9c2cc26940c90b1))
12
+
13
+
14
+
15
+
16
+
17
+ # [2.42.0](https://github.com/awes-io/client/compare/@awes-io/ui@2.41.0...@awes-io/ui@2.42.0) (2022-02-01)
18
+
19
+
20
+ ### Features
21
+
22
+ * modal appear fixed ([4838c87](https://github.com/awes-io/client/commit/4838c87fadc1b9303fa3c9a5e4ccee678c5bbcb6))
23
+
24
+
25
+
26
+
27
+
28
+ # [2.41.0](https://github.com/awes-io/client/compare/@awes-io/ui@2.40.1...@awes-io/ui@2.41.0) (2022-01-26)
29
+
30
+
31
+ ### Features
32
+
33
+ * **aw-tel:** use max metadata for phone validation ([8f5020b](https://github.com/awes-io/client/commit/8f5020bae4204c9acc710c7d97364757fab2b7bd))
34
+
35
+
36
+
37
+
38
+
39
+ ## [2.40.1](https://github.com/awes-io/client/compare/@awes-io/ui@2.40.0...@awes-io/ui@2.40.1) (2022-01-21)
40
+
41
+
42
+ ### Bug Fixes
43
+
44
+ * **aw-mobile-menu:** use correct heading for submenu ([62a3210](https://github.com/awes-io/client/commit/62a321084a295620802e7bc0fbb92e948400f19a))
45
+
46
+
47
+
48
+
49
+
6
50
  # [2.40.0](https://github.com/awes-io/client/compare/@awes-io/ui@2.39.1...@awes-io/ui@2.40.0) (2022-01-21)
7
51
 
8
52
 
@@ -12,7 +12,7 @@
12
12
  letter-spacing: 0.09375rem;
13
13
  text-transform: uppercase;
14
14
 
15
- background-color: rgba(var(--btn-bg), 1);
15
+ background-color: rgba(var(--btn-bg), var(--btn-bg-opacity, 1));
16
16
  color: rgba(var(--btn-fg), 1);
17
17
 
18
18
  box-shadow: 0px 0.25rem 0.5rem rgba(var(--btn-bg), 0.2);
@@ -35,6 +35,32 @@
35
35
  }
36
36
  }
37
37
 
38
+ &__lock {
39
+ display: flex;
40
+ align-items: center;
41
+ justify-content: center;
42
+
43
+ position: absolute;
44
+ inset: 0;
45
+
46
+ span {
47
+ background-color: var(--c-surface);
48
+ color: var(--c-on-surface);
49
+
50
+ display: flex;
51
+ align-items: center;
52
+ justify-content: center;
53
+ border-radius: 50%;
54
+
55
+ padding: 0.32em;
56
+ font-size: 1.2em;
57
+ }
58
+ }
59
+
60
+ &--locked {
61
+ position: relative;
62
+ }
63
+
38
64
  &:hover {
39
65
  background-image: linear-gradient(rgba(var(--btn-fg), 0.15), rgba(var(--btn-fg), 0.15));
40
66
  }
@@ -46,4 +72,10 @@
46
72
  &:focus-visible {
47
73
  outline: theme('focusOutline');
48
74
  }
75
+
76
+ &[disabled] {
77
+ --btn-bg-opacity: 0.5 !important;
78
+ cursor: not-allowed !important;
79
+ user-select: none !important;
80
+ }
49
81
  }
@@ -57,6 +57,8 @@ export default {
57
57
  'M18.2.66a1.5 1.5 0 00-.7-.54 1.46 1.46 0 00-.57-.12H3.07c-.2 0-.4.04-.58.12a1.49 1.49 0 00-.95 1.36v17.04a1.49 1.49 0 00.95 1.36 1.58 1.58 0 001.68-.31L10 13.96l5.83 5.6c.3.28.69.43 1.1.43a1.49 1.49 0 001.53-1.47V1.48c0-.3-.09-.58-.26-.82zm-1.43 17.45l-5.6-5.37L10 11.62l-1.18 1.12-5.59 5.37V1.7h13.54v16.42z',
58
58
  'check-light':
59
59
  'm18.328992,2.789833l-12.307024,12.307024l-4.350959,-4.350959c-0.205956,-0.205956 -0.539898,-0.205956 -0.745898,0l-0.497221,0.497221c-0.205956,0.205956 -0.205956,0.539898 0,0.745898l5.221151,5.221151c0.205956,0.205956 0.539898,0.205956 0.745898,0l13.177172,-13.177172c0.205956,-0.205956 0.205956,-0.539898 0,-0.745898l-0.497265,-0.497265c-0.205956,-0.205956 -0.539898,-0.205956 -0.745854,0z',
60
+ 'ban-light':
61
+ 'M20 10a10 10 0 1 1-20 0 10 10 0 0 1 20 0Zm-4.76 6.44A8.3 8.3 0 0 1 3.56 4.76l11.68 11.68Zm1.2-1.2L4.76 3.56a8.3 8.3 0 0 1 11.68 11.68Z',
60
62
  'check-regular':
61
63
  'm17.87334,2.466847l-11.515442,11.610536l-4.231195,-4.266136c-0.205142,-0.206836 -0.537764,-0.206836 -0.74295,0l-1.238206,1.248431c-0.205142,0.206836 -0.205142,0.542205 0,0.749085l5.840855,5.889088c0.205142,0.206836 0.537764,0.206836 0.74295,0l13.125102,-13.233488c0.205142,-0.206836 0.205142,-0.542205 0,-0.749085l-1.238206,-1.248431c-0.205142,-0.206836 -0.537764,-0.206836 -0.742906,0z',
62
64
  'times-light':
@@ -10,7 +10,7 @@
10
10
  <!-- Customization of help icon -->
11
11
  <slot name="icon">
12
12
  <!-- question-circle icon -->
13
- <span v-if="help" v-tooltip:right="help">
13
+ <span v-if="help" v-tooltip:right.prepend="help">
14
14
  <AwIconSystemMono
15
15
  class="aw-info__help-icon"
16
16
  name="info-circle"
@@ -179,6 +179,10 @@ export default {
179
179
  isChecked: {
180
180
  handler(val) {
181
181
  this.isInternalChecked = val
182
+ this.isSwitched = val
183
+ if (this.$refs.element && this.$refs.element.checked !== val) {
184
+ this.$refs.element.checked = val
185
+ }
182
186
  },
183
187
  immediate: true
184
188
  }
@@ -2,7 +2,7 @@
2
2
  <Transition
3
3
  :name="`modal-transition-${theme}`"
4
4
  @before-enter="_preOpen"
5
- @before-appear="_preOpen"
5
+ @before-appear="$nextTick(_preOpen)"
6
6
  @after-enter="$emit('opened')"
7
7
  @after-appear="$emit('opened')"
8
8
  @after-leave="_afterLeave"
@@ -47,7 +47,9 @@
47
47
  "
48
48
  >
49
49
  <AwIconSystemMono
50
- :name="phoneNumber.isValid() ? 'check-light' : 'close'"
50
+ :name="
51
+ phoneNumber.isValid() ? 'check-light' : 'ban-light'
52
+ "
51
53
  />
52
54
  </span>
53
55
  </template>
@@ -81,7 +83,7 @@ import {
81
83
  getCountryCallingCode,
82
84
  getExampleNumber,
83
85
  parsePhoneNumberFromString
84
- } from 'libphonenumber-js'
86
+ } from 'libphonenumber-js/max'
85
87
  import examples from 'libphonenumber-js/examples.mobile.json'
86
88
  import { pathOr } from 'rambdax'
87
89
  import { AwTel as _config } from '@AwConfig'
@@ -3,6 +3,8 @@
3
3
  :is="_linkComponent"
4
4
  v-bind="_linkAttrs"
5
5
  :style="buttonStyle"
6
+ :disabled="_linkAttrs.disabled || locked"
7
+ :class="{ 'aw-button-fixed--locked': locked }"
6
8
  class="aw-button-fixed"
7
9
  v-on="$listeners"
8
10
  >
@@ -16,6 +18,15 @@
16
18
  <slot name="icon">
17
19
  <AwIcon :name="icon" size="24" class="flex-shrink-0" />
18
20
  </slot>
21
+ <span
22
+ v-if="locked"
23
+ class="aw-button-fixed__lock"
24
+ v-tooltip="lockedTooltip"
25
+ >
26
+ <span>
27
+ <AwIconSystemMono name="lock" />
28
+ </span>
29
+ </span>
19
30
  </Component>
20
31
  </template>
21
32
 
@@ -15,7 +15,7 @@
15
15
  <AwButton
16
16
  theme="ghost"
17
17
  color="default"
18
- class="aw-mobile-menu__back w-10 h-10"
18
+ class="aw-mobile-menu__back w-10 h-10 flex-shrink-0"
19
19
  content-class="p-2"
20
20
  @click="submenuOpened = false"
21
21
  >
@@ -30,7 +30,7 @@
30
30
  <!-- subtitle -->
31
31
  <AwHeadline
32
32
  v-if="submenuTitle"
33
- class="aw-mobile-menu__submenu-title"
33
+ class="aw-mobile-menu__submenu-title truncate pr-2"
34
34
  >
35
35
  {{ submenuTitle }}
36
36
  </AwHeadline>
@@ -52,7 +52,7 @@
52
52
  <AwButton
53
53
  theme="ghost"
54
54
  color="default"
55
- class="aw-mobile-menu__close w-10 h-10"
55
+ class="aw-mobile-menu__close w-10 h-10 flex-shrink-0"
56
56
  content-class="p-2"
57
57
  @click="show = false"
58
58
  >
@@ -177,6 +177,7 @@ export default {
177
177
  return {
178
178
  scrolled: false,
179
179
  submenuOpened: false,
180
+ submenuTitle: '',
180
181
  submenu: []
181
182
  }
182
183
  },
@@ -189,10 +190,6 @@ export default {
189
190
  'beforeMobileMenuComponent'
190
191
  ]),
191
192
 
192
- submenuTitle() {
193
- return this.submenuOpened ? pathOr('', '0.text', this.submenu) : ''
194
- },
195
-
196
193
  profileUrl() {
197
194
  return pathOr(null, 'awesIo.profileUrl', this.$store.state)
198
195
  },
@@ -254,6 +251,7 @@ export default {
254
251
  enableBodyScroll(this.$el)
255
252
  // reset submenu
256
253
  this.submenuOpened = false
254
+ this.submenuTitle = ''
257
255
  this.submenu = []
258
256
  }
259
257
  this._triggerScrollListener(isVisible)
@@ -290,6 +288,7 @@ export default {
290
288
  ? [{ text, children: submenu }].concat(submenuDeep)
291
289
  : submenuDeep
292
290
 
291
+ this.submenuTitle = text
293
292
  this.submenuOpened = !!this.submenu.length
294
293
  },
295
294
 
package/mixins/button.js CHANGED
@@ -3,6 +3,15 @@ export default {
3
3
  color: {
4
4
  type: String,
5
5
  default: 'accent'
6
+ },
7
+
8
+ // Show lock icon and disable button
9
+ locked: Boolean,
10
+
11
+ // Tooltip when button is locked
12
+ lockedTooltip: {
13
+ type: String,
14
+ default: ''
6
15
  }
7
16
  },
8
17
 
@@ -56,7 +56,7 @@ i18nOptions.messages = mergeDeepRight(messages, i18nOptions.messages || {})
56
56
  const beforeListeners = new Map()
57
57
  const afterListeners = new Map()
58
58
 
59
- export default async ({ app }) => {
59
+ export default async ({ app, $axios }) => {
60
60
  const locales = langOptions.locales.slice().map(locale => {
61
61
  if (isType('String', locale)) {
62
62
  return { code: locale }
@@ -157,6 +157,9 @@ export default async ({ app }) => {
157
157
  app.i18n.setLocale = async locale => {
158
158
  const oldLocale = app.i18n.locale
159
159
 
160
+ // Update Accept-Language header
161
+ $axios.defaults.headers.common['Accept-Language'] = locale
162
+
160
163
  for (const beforeListener of beforeListeners.keys()) {
161
164
  await beforeListener(locale, oldLocale)
162
165
  }
@@ -179,6 +182,11 @@ export default async ({ app }) => {
179
182
  }
180
183
  }
181
184
 
185
+ /**
186
+ * Set Accept-Language header
187
+ */
188
+ $axios.defaults.headers.common['Accept-Language'] = app.i18n.locale
189
+
182
190
  /**
183
191
  * Set language on init
184
192
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@awes-io/ui",
3
- "version": "2.40.0",
3
+ "version": "2.42.1",
4
4
  "description": "User Interface (UI) components",
5
5
  "keywords": [
6
6
  "ui",
@@ -124,5 +124,5 @@
124
124
  "vue-template-compiler": "^2.6.10",
125
125
  "webfonts-generator": "^0.4.0"
126
126
  },
127
- "gitHead": "f8c3b297de47dc18bafddbee71ae48e27a121d53"
127
+ "gitHead": "a996a162c0bc3e471c6f021c861329d3ae2552eb"
128
128
  }