@awes-io/ui 2.56.4 → 2.58.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,61 @@
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.58.0](https://github.com/awes-io/client/compare/@awes-io/ui@2.57.0...@awes-io/ui@2.58.0) (2022-08-08)
7
+
8
+
9
+ ### Features
10
+
11
+ * update ([e56f315](https://github.com/awes-io/client/commit/e56f31548de6895d0dc6dfc4175914860a0c8e53))
12
+
13
+
14
+
15
+
16
+
17
+ # [2.57.0](https://github.com/awes-io/client/compare/@awes-io/ui@2.56.7...@awes-io/ui@2.57.0) (2022-08-08)
18
+
19
+
20
+ ### Features
21
+
22
+ * **aw-bottom-bar:** action button added ([0071a22](https://github.com/awes-io/client/commit/0071a22e28e3dc92976d05f5d36bd5b9f671fa46))
23
+
24
+
25
+
26
+
27
+
28
+ ## [2.56.7](https://github.com/awes-io/client/compare/@awes-io/ui@2.56.6...@awes-io/ui@2.56.7) (2022-07-20)
29
+
30
+
31
+ ### Bug Fixes
32
+
33
+ * **aw-select-fake-input:** styles fixed ([7a1a984](https://github.com/awes-io/client/commit/7a1a9846873a37c725b48286cc3120a2b2b8dbb4))
34
+
35
+
36
+
37
+
38
+
39
+ ## [2.56.6](https://github.com/awes-io/client/compare/@awes-io/ui@2.56.5...@awes-io/ui@2.56.6) (2022-07-20)
40
+
41
+
42
+ ### Bug Fixes
43
+
44
+ * updated yarn ([d51cfd8](https://github.com/awes-io/client/commit/d51cfd8835d872dbdcf950f108abcf57e86bef24))
45
+
46
+
47
+
48
+
49
+
50
+ ## [2.56.5](https://github.com/awes-io/client/compare/@awes-io/ui@2.56.4...@awes-io/ui@2.56.5) (2022-07-20)
51
+
52
+
53
+ ### Bug Fixes
54
+
55
+ * **aw-select-object:** ios focus lags fixed ([f0cc05d](https://github.com/awes-io/client/commit/f0cc05db37f69cd9d39bb58443060f49854116c7))
56
+
57
+
58
+
59
+
60
+
6
61
  ## [2.56.4](https://github.com/awes-io/client/compare/@awes-io/ui@2.56.3...@awes-io/ui@2.56.4) (2022-07-18)
7
62
 
8
63
 
@@ -23,6 +23,10 @@
23
23
  overflow: hidden;
24
24
  padding: theme('spacing.2') theme('spacing.1') theme('spacing.1');
25
25
  }
26
+
27
+ &--small {
28
+ padding: theme('spacing.2') theme('spacing.1');
29
+ }
26
30
  }
27
31
 
28
32
  &__icon-badge {
@@ -230,6 +230,7 @@ $modal-aside-width-large: 75vw;
230
230
  flex-direction: column;
231
231
  margin-right: 0;
232
232
  overflow: auto;
233
+ max-height: var(--viewport-height, 100vh);
233
234
  }
234
235
 
235
236
  &[class*='is-overlay-aside'] &__body {
@@ -439,7 +440,7 @@ $modal-t-dur: 250ms;
439
440
  transform: none;
440
441
 
441
442
  .aw-modal__dialog {
442
- transform: translateX(95%);
443
+ transform: translateX(80%);
443
444
  }
444
445
  }
445
446
 
@@ -52,10 +52,10 @@
52
52
 
53
53
  /* default */
54
54
  right: 0;
55
- bottom: 0;
55
+ bottom: env(safe-area-inset-bottom, 0px);
56
56
 
57
57
  &_top {
58
- top: 0;
58
+ top: env(safe-area-inset-top, 0px);
59
59
  bottom: auto;
60
60
  }
61
61
 
@@ -8,6 +8,8 @@ export default {
8
8
  user:
9
9
  'M13.2 11.1c-1 0-1.5.6-3.2.6-1.7 0-2.1-.6-3.2-.6A4.7 4.7 0 002.1 16v1.4c0 1 .8 1.7 1.7 1.7h12.4c1 0 1.7-.8 1.7-1.7v-1.5c0-2.6-2.1-4.7-4.7-4.7zm3.6 6.2c0 .3-.3.6-.6.6H3.8a.6.6 0 01-.5-.6v-1.5c0-2 1.6-3.6 3.5-3.6.7 0 1.4.6 3.2.6 1.8 0 2.5-.6 3.2-.6 2 0 3.6 1.7 3.6 3.7v1.4zM10 10a4.5 4.5 0 100-9 4.5 4.5 0 000 9zm0-7.9A3.4 3.4 0 1110 9 3.4 3.4 0 0110 2z',
10
10
  menu: 'M1 11V9h18v2H1zm0-6V3h18v2H1zm0 12v-2h18v2H1z',
11
+ 'menu-dots':
12
+ 'M5.46 7.13a1.67 1.67 0 1 0 0-3.33 1.67 1.67 0 0 0 0 3.33Zm1.67 7.48a1.67 1.67 0 1 1-3.33 0 1.67 1.67 0 0 1 3.33 0Zm7.49-7.48a1.67 1.67 0 1 0 0-3.33 1.67 1.67 0 0 0 0 3.33Zm1.66 7.48a1.67 1.67 0 1 1-3.33 0 1.67 1.67 0 0 1 3.33 0Z',
11
13
  search:
12
14
  'M18.8 17.7l-4.3-4.3a7.6 7.6 0 10-1 1l4.2 4.4c.3.3.8.3 1 0 .4-.3.4-.8 0-1zm-10.2-3a6 6 0 110-12.2 6 6 0 010 12.2z',
13
15
  eye:
@@ -25,7 +25,45 @@
25
25
  <slot name="prefix" />
26
26
 
27
27
  <slot name="toggler" v-bind="_inputSlot">
28
+ <AwSelectFakeInput
29
+ v-if="isMobile"
30
+ ref="input"
31
+ :value="inputValue"
32
+ :label="label"
33
+ :placeholder="_placeholder"
34
+ :clearable="clearable && !_isEmpty"
35
+ :is-opened="isOpened"
36
+ caret
37
+ :class="{
38
+ 'is-filled': searchable && isOpened,
39
+ 'not-searchable': !searchable
40
+ }"
41
+ class="flex-1"
42
+ v-bind="_attrs.input"
43
+ @open="open"
44
+ @clear="clear"
45
+ >
46
+ <template #prefix>
47
+ <slot
48
+ name="icon"
49
+ v-bind="{
50
+ option: value,
51
+ optionLabel: _selectedLabel,
52
+ isLoading,
53
+ isOpened
54
+ }"
55
+ ></slot>
56
+ </template>
57
+
58
+ <template #element>
59
+ <slot
60
+ name="element"
61
+ v-bind="{ value: inputValue }"
62
+ ></slot>
63
+ </template>
64
+ </AwSelectFakeInput>
28
65
  <AwSelectInput
66
+ v-else
29
67
  ref="input"
30
68
  :value="inputValue"
31
69
  :label="label"
@@ -210,7 +248,8 @@ export default {
210
248
  inheritAttrs: false,
211
249
 
212
250
  components: {
213
- AwSelectInput
251
+ AwSelectInput,
252
+ AwSelectFakeInput: () => import('./_AwSelectFakeInput.vue')
214
253
  },
215
254
 
216
255
  name: 'AwSelectObject',
@@ -0,0 +1,132 @@
1
+ <template>
2
+ <div
3
+ ref="element"
4
+ class="flex aw-text-field is-text"
5
+ :class="{
6
+ 'is-filled': value === 0 || !!value,
7
+ 'has-label': !!label,
8
+ 'has-error': hasError,
9
+ 'is-disabled': isDisabled,
10
+ 'has-icon': $slots.icon,
11
+ 'has-prefix': prefix,
12
+ 'has-postfix': postfix
13
+ }"
14
+ @click="$emit('open')"
15
+ >
16
+ <span
17
+ v-if="prefix || $scopedSlots.prefix"
18
+ v-tooltip.show.prepend="errorTooltip"
19
+ class="aw-text-field__prefix"
20
+ :class="{ 'px-4': prefix }"
21
+ :aria-describedby="errorText ? errorId : null"
22
+ >
23
+ <slot name="prefix">{{ prefix }}</slot>
24
+ </span>
25
+
26
+ <span class="block relative w-full">
27
+ <span
28
+ class="aw-text-field__element aw-text-field__element--fake"
29
+ tabindex="0"
30
+ :class="paddingClass"
31
+ >
32
+ <span v-if="inputValue" class="block h-6">
33
+ {{ inputValue }}
34
+ </span>
35
+ <span v-else class="block h-6 opacity-50">
36
+ {{ placeholder }}
37
+ </span>
38
+ </span>
39
+ <span
40
+ v-if="!!label || $scopedSlots.label"
41
+ class="aw-text-field__label"
42
+ :class="{ 'aw-text-field__label--required': isRequired }"
43
+ >
44
+ <slot name="label">
45
+ {{ label }}
46
+ </slot>
47
+ </span>
48
+ <span class="aw-text-field__icon">
49
+ <slot name="icon">
50
+ <!-- clear button -->
51
+ <AwButton
52
+ v-if="clearable"
53
+ :size="$attrs.size || 'md'"
54
+ @click.stop.prevent="$emit('clear', $event)"
55
+ theme="icon"
56
+ class="h-full"
57
+ >
58
+ <AwIconSystemMono name="close" />
59
+ </AwButton>
60
+
61
+ <!-- caret and loading -->
62
+ <AwButton
63
+ v-if="caret"
64
+ :size="$attrs.size || 'md'"
65
+ tabindex="-1"
66
+ theme="icon"
67
+ class="h-full"
68
+ @click="$emit('caret')"
69
+ >
70
+ <AwIconSystemMono
71
+ name="triangle"
72
+ class="transition-200"
73
+ :class="{ 'rotate-180': isOpened }"
74
+ />
75
+ </AwButton>
76
+ </slot>
77
+ </span>
78
+ </span>
79
+
80
+ <span
81
+ v-if="postfix || $scopedSlots.postfix"
82
+ class="aw-text-field__postfix"
83
+ :class="{ 'px-4': postfix }"
84
+ >
85
+ <slot name="postfix">{{ postfix }}</slot>
86
+ </span>
87
+ </div>
88
+ </template>
89
+
90
+ <script>
91
+ import TextFieldMixin from '@AwMixins/text-field'
92
+
93
+ export default {
94
+ name: 'AwSelectFakeInput',
95
+
96
+ mixins: [TextFieldMixin],
97
+
98
+ props: {
99
+ prefix: {
100
+ type: String,
101
+ default: ''
102
+ },
103
+
104
+ postfix: {
105
+ type: String,
106
+ default: ''
107
+ },
108
+
109
+ size: {
110
+ type: String,
111
+ default: 'md'
112
+ },
113
+
114
+ placeholder: {
115
+ type: String,
116
+ default: ''
117
+ },
118
+
119
+ clearable: Boolean,
120
+
121
+ caret: Boolean,
122
+
123
+ isOpened: Boolean
124
+ },
125
+
126
+ computed: {
127
+ paddingClass() {
128
+ return this.size === 'md' ? 'p-3' : 'p-2'
129
+ }
130
+ }
131
+ }
132
+ </script>
@@ -13,7 +13,8 @@
13
13
  <slot name="bottom-bar-toggler">
14
14
  <AwMenuItemIcon
15
15
  :text="$t('aw.bottom_bar.menu')"
16
- icon="menu"
16
+ icon="menu-dots"
17
+ :size="$options.ICON_SIZE"
17
18
  @click="$store.commit('awesIo/TOGGLE_MOBILE_MENU')"
18
19
  >
19
20
  <template #default="{ text }">
@@ -22,9 +23,9 @@
22
23
  tabindex="-1"
23
24
  >
24
25
  <AwIconSystemMono
25
- name="menu"
26
+ name="menu-dots"
26
27
  class="aw-icon-menu-item__icon"
27
- size="24"
28
+ :size="$options.ICON_SIZE"
28
29
  />
29
30
  </span>
30
31
  <span class="aw-icon-menu-item__text">
@@ -40,6 +41,12 @@
40
41
  import { viewOr, lensProp, omit } from 'rambdax'
41
42
  import AwMenuItemIcon from '@AwLayouts/_AwMenuItemIcon.vue'
42
43
 
44
+ const VISIBLE_ITEMS_COUNT = 4
45
+
46
+ const ICON_SIZE = 28
47
+
48
+ const ACTION_ICON_SIZE = 36
49
+
43
50
  export default {
44
51
  name: 'AwBottomBar',
45
52
 
@@ -47,6 +54,8 @@ export default {
47
54
  AwMenuItemIcon
48
55
  },
49
56
 
57
+ ICON_SIZE,
58
+
50
59
  inject: {
51
60
  layoutProvider: {
52
61
  default: null
@@ -54,6 +63,30 @@ export default {
54
63
  },
55
64
 
56
65
  computed: {
66
+ actionButton() {
67
+ const button = this.$store.state.awesIo.bottomBarAction
68
+
69
+ if (!button) {
70
+ return null
71
+ }
72
+
73
+ let result = { ...button, hideText: true }
74
+
75
+ if (!button.href || (button.listeners && !button.listeners.click)) {
76
+ result = {
77
+ ...button,
78
+ listeners: {
79
+ ...button.listeners,
80
+ click: this.$root.$emit(
81
+ 'awes-io::bottom-bar-action:click'
82
+ )
83
+ }
84
+ }
85
+ }
86
+
87
+ return result
88
+ },
89
+
57
90
  showMenu() {
58
91
  return (
59
92
  this.$scopedSlots['bottom-bar-items'] ||
@@ -66,8 +99,18 @@ export default {
66
99
 
67
100
  items() {
68
101
  const items = viewOr([], lensProp('mainMenu'), this.layoutProvider)
102
+ const itemsCount = VISIBLE_ITEMS_COUNT - (this.actionButton ? 1 : 0)
103
+ const visibleItems = items.slice(0, itemsCount)
104
+
105
+ if (this.actionButton) {
106
+ visibleItems.splice(
107
+ Math.ceil(itemsCount / 2),
108
+ 0,
109
+ this.actionButton
110
+ )
111
+ }
69
112
 
70
- return items.slice(0, 4)
113
+ return visibleItems
71
114
  },
72
115
 
73
116
  activeMenu() {
@@ -77,7 +120,10 @@ export default {
77
120
 
78
121
  methods: {
79
122
  _pickItemProps(props) {
80
- return omit('children,listeners', props)
123
+ return {
124
+ ...omit('children,listeners', props),
125
+ size: props.hideText ? ACTION_ICON_SIZE : ICON_SIZE
126
+ }
81
127
  }
82
128
  }
83
129
  }
@@ -124,7 +124,7 @@ export default {
124
124
 
125
125
  methods: {
126
126
  _getMenuItemProps(props) {
127
- return omit('children,description', props)
127
+ return omit('children,description,hideText', props)
128
128
  }
129
129
  }
130
130
  }
@@ -14,13 +14,17 @@
14
14
  v-tooltip:right="
15
15
  tooltip ? { content: text, offset: [0, -6] } : null
16
16
  "
17
- :class="{ 'aw-icon-menu-item__icon-block--clip': !tooltip }"
17
+ :class="{
18
+ 'aw-icon-menu-item__icon-block--clip':
19
+ !tooltip && !hideText,
20
+ 'aw-icon-menu-item__icon-block--small': !tooltip && hideText
21
+ }"
18
22
  class="aw-icon-menu-item__icon-block"
19
23
  tabindex="-1"
20
24
  >
21
25
  <AwIcon
22
26
  :name="(active && iconActive) || icon"
23
- size="24"
27
+ :size="size"
24
28
  :class="{
25
29
  'aw-icon-menu-item__icon--highlight': active
26
30
  }"
@@ -41,6 +45,7 @@
41
45
  </span>
42
46
  </span>
43
47
  <span
48
+ v-if="!hideText"
44
49
  v-show="!tooltip"
45
50
  class="aw-icon-menu-item__text"
46
51
  :class="{
@@ -50,6 +55,7 @@
50
55
  {{ text }}
51
56
  <AwIconSystemMono v-if="_linkExternal" name="external" />
52
57
  </span>
58
+ <span v-if="hideText" class="sr-only">{{ text }}</span>
53
59
  </slot>
54
60
  </Component>
55
61
  </template>
@@ -83,10 +89,17 @@ export default {
83
89
  default: ''
84
90
  },
85
91
 
92
+ size: {
93
+ type: [String, Number],
94
+ default: 24
95
+ },
96
+
86
97
  active: Boolean,
87
98
 
88
99
  tooltip: Boolean,
89
100
 
101
+ hideText: Boolean,
102
+
90
103
  badge: {
91
104
  type: Object,
92
105
  default: null,
@@ -6,6 +6,11 @@ export default {
6
6
  alt: 'Awes.io'
7
7
  },
8
8
 
9
+ fullLogo: {
10
+ src: 'https://static.awes.io/logo-blue_white.svg',
11
+ alt: 'Awes.io'
12
+ },
13
+
9
14
  background: {
10
15
  src: 'https://static.awes.io/demo/awes-background.svg'
11
16
  },
@@ -22,6 +27,11 @@ export const dark = {
22
27
  alt: 'Awes.io'
23
28
  },
24
29
 
30
+ fullLogo: {
31
+ src: 'https://static.awes.io/logo-blue.svg',
32
+ alt: 'Awes.io'
33
+ },
34
+
25
35
  background: {
26
36
  src: 'https://static.awes.io/demo/awes-background.svg'
27
37
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@awes-io/ui",
3
- "version": "2.56.4",
3
+ "version": "2.58.0",
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": "c7d677bbc549f644cc907eec78140c3d3d8a8fa7"
125
+ "gitHead": "50a0c95ae90eb488c21b2ee75055dfeb4b36f8db"
126
126
  }
package/store/awesIo.js CHANGED
@@ -39,6 +39,7 @@ export const state = () => ({
39
39
  mobileMenuOpened: false,
40
40
  beforeMobileMenu: null,
41
41
  afterMobileMenu: null,
42
+ bottomBarAction: null,
42
43
 
43
44
  headerNotification: null,
44
45
 
@@ -226,6 +227,14 @@ export const mutations = {
226
227
  if (payload && payload.component) {
227
228
  state.afterMobileMenu = payload.component
228
229
  }
230
+ },
231
+
232
+ SET_BOTTOM_BAR_ACTION(state, payload) {
233
+ if (isType('Object', payload)) {
234
+ state.bottomBarAction = payload
235
+ } else {
236
+ state.bottomBarAction = null
237
+ }
229
238
  }
230
239
  }
231
240