@awes-io/ui 2.41.0 → 2.43.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,39 @@
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.43.0](https://github.com/awes-io/client/compare/@awes-io/ui@2.42.1...@awes-io/ui@2.43.0) (2022-02-28)
7
+
8
+
9
+ ### Features
10
+
11
+ * blocked twofactor auth ([dbef9a3](https://github.com/awes-io/client/commit/dbef9a3d9989d8a33ba276a73c3a32ec184b5e5e))
12
+
13
+
14
+
15
+
16
+
17
+ ## [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)
18
+
19
+
20
+ ### Bug Fixes
21
+
22
+ * locked prop for fixed button ([9e2067a](https://github.com/awes-io/client/commit/9e2067ae0abbbfe766f6ea63d9c2cc26940c90b1))
23
+
24
+
25
+
26
+
27
+
28
+ # [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)
29
+
30
+
31
+ ### Features
32
+
33
+ * modal appear fixed ([4838c87](https://github.com/awes-io/client/commit/4838c87fadc1b9303fa3c9a5e4ccee678c5bbcb6))
34
+
35
+
36
+
37
+
38
+
6
39
  # [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)
7
40
 
8
41
 
@@ -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
  }
@@ -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
  }
@@ -1,6 +1,7 @@
1
1
  <template>
2
2
  <div class="aw-date" @click="onDateClick">
3
3
  <AwInput
4
+ ref="input"
4
5
  v-bind="{ ...$attrs, label, id }"
5
6
  :value="inputValue"
6
7
  :prefix="prefix"
@@ -192,6 +193,10 @@ export default {
192
193
 
193
194
  watch: {
194
195
  value(value) {
196
+ if (this.$refs.input && this.$refs.input.hasError) {
197
+ this.$refs.input.setError('')
198
+ }
199
+
195
200
  if (value !== null && this.isOpened) {
196
201
  this.isOpened = false
197
202
  }
@@ -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"
@@ -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
 
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.41.0",
3
+ "version": "2.43.0",
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": "7541d3d4f47c11602993afd6e8aec69187f90605"
127
+ "gitHead": "6d43cecd75903d0f328f138505003cf2020ac4c5"
128
128
  }