@awes-io/ui 2.56.6 → 2.59.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 +44 -0
- package/assets/css/components/header-notification.css +1 -0
- package/assets/css/components/icon-menu-item.css +4 -0
- package/assets/css/components/notification.css +2 -2
- package/assets/css/flags.css +15 -0
- package/assets/js/icons/mono.js +2 -0
- package/components/1_atoms/AwInput.vue +1 -0
- package/components/2_molecules/_AwSelectFakeInput.vue +1 -1
- package/components/3_organisms/AwBottomBar.vue +51 -5
- package/components/3_organisms/AwUploader.vue +15 -2
- package/components/5_layouts/_AwLayoutMenu.vue +2 -3
- package/components/5_layouts/_AwMenuItemIcon.vue +15 -2
- package/components/5_layouts/_AwMobileMenu.vue +2 -1
- package/components/5_layouts/_AwNoty.vue +6 -0
- package/components/5_layouts/_AwNotyContainer.vue +2 -1
- package/nuxt/index.js +14 -5
- package/package.json +2 -2
- package/store/awesIo.js +9 -0
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.59.0](https://github.com/awes-io/client/compare/@awes-io/ui@2.58.0...@awes-io/ui@2.59.0) (2022-09-08)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* uploader and test attrs improvements ([b3ef891](https://github.com/awes-io/client/commit/b3ef8914adcb9f2ea63999d1d82345ae7b98002b))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
# [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)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
### Features
|
|
21
|
+
|
|
22
|
+
* update ([e56f315](https://github.com/awes-io/client/commit/e56f31548de6895d0dc6dfc4175914860a0c8e53))
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
# [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)
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
### Features
|
|
32
|
+
|
|
33
|
+
* **aw-bottom-bar:** action button added ([0071a22](https://github.com/awes-io/client/commit/0071a22e28e3dc92976d05f5d36bd5b9f671fa46))
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
## [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)
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
### Bug Fixes
|
|
43
|
+
|
|
44
|
+
* **aw-select-fake-input:** styles fixed ([7a1a984](https://github.com/awes-io/client/commit/7a1a9846873a37c725b48286cc3120a2b2b8dbb4))
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
|
|
6
50
|
## [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)
|
|
7
51
|
|
|
8
52
|
|
package/assets/css/flags.css
CHANGED
|
@@ -9,6 +9,21 @@
|
|
|
9
9
|
background-position: -0px -48px;
|
|
10
10
|
}
|
|
11
11
|
|
|
12
|
+
.flag-2x-wrap {
|
|
13
|
+
display: inline-flex;
|
|
14
|
+
align-items: center;
|
|
15
|
+
justify-content: center;
|
|
16
|
+
width: 1.5rem;
|
|
17
|
+
height: 1.5rem;
|
|
18
|
+
vertical-align: middle;
|
|
19
|
+
|
|
20
|
+
.flag {
|
|
21
|
+
display: block !important;
|
|
22
|
+
flex-shrink: 0;
|
|
23
|
+
transform: scale(0.5);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
12
27
|
.flag.ABKHAZIA { background-position: -0px -0px; }
|
|
13
28
|
.flag.BASQUE-COUNTRY { background-position: -48px -0px; }
|
|
14
29
|
.flag.BRITISH-ANTARCTIC-TERRITORY { background-position: -96px -0px; }
|
package/assets/js/icons/mono.js
CHANGED
|
@@ -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:
|
|
@@ -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="
|
|
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
|
|
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
|
|
123
|
+
return {
|
|
124
|
+
...omit('children,listeners', props),
|
|
125
|
+
size: props.hideText ? ACTION_ICON_SIZE : ICON_SIZE
|
|
126
|
+
}
|
|
81
127
|
}
|
|
82
128
|
}
|
|
83
129
|
}
|
|
@@ -191,7 +191,15 @@ export default {
|
|
|
191
191
|
/**
|
|
192
192
|
* Hide build-in progress bar
|
|
193
193
|
*/
|
|
194
|
-
hideProgress: Boolean
|
|
194
|
+
hideProgress: Boolean,
|
|
195
|
+
|
|
196
|
+
/**
|
|
197
|
+
* Process FormData before sending
|
|
198
|
+
*/
|
|
199
|
+
processData: {
|
|
200
|
+
type: Function,
|
|
201
|
+
default: null
|
|
202
|
+
}
|
|
195
203
|
},
|
|
196
204
|
|
|
197
205
|
data() {
|
|
@@ -299,8 +307,13 @@ export default {
|
|
|
299
307
|
const [uploader, canceler] = this._createFileRecord(file)
|
|
300
308
|
const id = uploader.id
|
|
301
309
|
const data = new FormData()
|
|
310
|
+
|
|
302
311
|
data.append('file', file)
|
|
303
312
|
|
|
313
|
+
if (isType('Function', this.processData)) {
|
|
314
|
+
this.processData(data)
|
|
315
|
+
}
|
|
316
|
+
|
|
304
317
|
/**
|
|
305
318
|
* Fire on upload start, when browser validation is passed
|
|
306
319
|
* @arg { id: <Number>, file: <String>, loading: <Boolean>, progress: <Number>, cancel: <Function> }
|
|
@@ -378,7 +391,7 @@ export default {
|
|
|
378
391
|
return ($event) => {
|
|
379
392
|
const { total, loaded } = $event
|
|
380
393
|
const progress = Math.round((loaded / total) * 100)
|
|
381
|
-
uploader
|
|
394
|
+
this.$set(uploader, 'progress', progress)
|
|
382
395
|
this.totalProgress = this._getAggregateProgress()
|
|
383
396
|
/**
|
|
384
397
|
* Fire on upload start, when browser validation is passed
|
|
@@ -64,7 +64,6 @@
|
|
|
64
64
|
import { mapGetters } from 'vuex'
|
|
65
65
|
import { pathOr, viewOr, lensProp, omit } from 'rambdax'
|
|
66
66
|
import AwMenuItemIcon from '@AwLayouts/_AwMenuItemIcon.vue'
|
|
67
|
-
import AwLayoutLogo from '@AwLayouts/_AwLayoutLogo.vue'
|
|
68
67
|
import AwUserMenu from '@AwLayouts/_AwUserMenu.vue'
|
|
69
68
|
import AwNav from '@AwLayouts/_AwNav.vue'
|
|
70
69
|
|
|
@@ -73,7 +72,7 @@ export default {
|
|
|
73
72
|
|
|
74
73
|
components: {
|
|
75
74
|
AwMenuItemIcon,
|
|
76
|
-
AwLayoutLogo,
|
|
75
|
+
AwLayoutLogo: () => import('@AwLayouts/_AwLayoutLogo.vue'),
|
|
77
76
|
AwUserMenu,
|
|
78
77
|
AwNav
|
|
79
78
|
},
|
|
@@ -124,7 +123,7 @@ export default {
|
|
|
124
123
|
|
|
125
124
|
methods: {
|
|
126
125
|
_getMenuItemProps(props) {
|
|
127
|
-
return omit('children,description', props)
|
|
126
|
+
return omit('children,description,hideText', props)
|
|
128
127
|
}
|
|
129
128
|
}
|
|
130
129
|
}
|
|
@@ -14,13 +14,17 @@
|
|
|
14
14
|
v-tooltip:right="
|
|
15
15
|
tooltip ? { content: text, offset: [0, -6] } : null
|
|
16
16
|
"
|
|
17
|
-
:class="{
|
|
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="
|
|
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,
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
<template functional>
|
|
2
2
|
<div
|
|
3
|
+
:data-testid="props.testId"
|
|
3
4
|
:class="{
|
|
4
5
|
'bg-overlay': props.icon,
|
|
5
6
|
[`bg-${props.type}`]: !props.icon,
|
|
@@ -73,6 +74,11 @@ export default {
|
|
|
73
74
|
},
|
|
74
75
|
|
|
75
76
|
props: {
|
|
77
|
+
testId: {
|
|
78
|
+
type: String,
|
|
79
|
+
required: true
|
|
80
|
+
},
|
|
81
|
+
|
|
76
82
|
type: {
|
|
77
83
|
type: String,
|
|
78
84
|
required: true,
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
import { isType } from 'rambdax'
|
|
24
24
|
import AwNoty from '@AwLayouts/_AwNoty.vue'
|
|
25
25
|
|
|
26
|
-
let _notifyId =
|
|
26
|
+
let _notifyId = 1
|
|
27
27
|
|
|
28
28
|
export default {
|
|
29
29
|
name: 'AwNotyContainer',
|
|
@@ -62,6 +62,7 @@ export default {
|
|
|
62
62
|
|
|
63
63
|
const id = _notifyId++
|
|
64
64
|
item.id = id
|
|
65
|
+
item.testId = item.testId || 'notifi-' + id
|
|
65
66
|
|
|
66
67
|
const removeAfter = parseInt(item.timeout)
|
|
67
68
|
if (removeAfter && !isNaN(removeAfter)) {
|
package/nuxt/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { mergeDeepRight, pick, omit, uniq, endsWith, partition } from 'rambdax'
|
|
2
2
|
import { existsSync, readdirSync, readFileSync, lstatSync } from 'fs'
|
|
3
|
-
import { join, resolve } from 'path'
|
|
3
|
+
import { join, resolve, sep } from 'path'
|
|
4
4
|
import resolveConfig from 'tailwindcss/resolveConfig'
|
|
5
5
|
import {
|
|
6
6
|
default as configDefault,
|
|
@@ -16,6 +16,12 @@ const configDark = mergeDeepRight(configDefault, dark)
|
|
|
16
16
|
|
|
17
17
|
export const MODULE_DIR = 'awes-io'
|
|
18
18
|
|
|
19
|
+
const fixWindowsPath = (path) =>
|
|
20
|
+
path
|
|
21
|
+
.replace(/^\\\\\?\\/, '')
|
|
22
|
+
.replace(/\\/g, '/')
|
|
23
|
+
.replace(/\/\/+/g, '/')
|
|
24
|
+
|
|
19
25
|
async function AwesIoUi() {
|
|
20
26
|
/**
|
|
21
27
|
* Check store existance
|
|
@@ -246,8 +252,8 @@ async function AwesIoUi() {
|
|
|
246
252
|
|
|
247
253
|
this.addLayout(
|
|
248
254
|
{
|
|
249
|
-
src: resolve(layoutsPath, file),
|
|
250
|
-
fileName: join(MODULE_DIR, file)
|
|
255
|
+
src: fixWindowsPath(resolve(layoutsPath, file)),
|
|
256
|
+
fileName: fixWindowsPath(join(MODULE_DIR, file))
|
|
251
257
|
},
|
|
252
258
|
file.replace('.vue', '')
|
|
253
259
|
)
|
|
@@ -290,13 +296,16 @@ async function AwesIoUi() {
|
|
|
290
296
|
.reduce(collectComponents, acc)
|
|
291
297
|
} else if (stat.isFile()) {
|
|
292
298
|
const name = entry
|
|
293
|
-
.split(
|
|
299
|
+
.split(sep)
|
|
294
300
|
.pop()
|
|
295
301
|
.replace(/\.(vue|js)$/, '')
|
|
296
302
|
|
|
297
303
|
return name.startsWith('_')
|
|
298
304
|
? acc
|
|
299
|
-
: acc.concat({
|
|
305
|
+
: acc.concat({
|
|
306
|
+
name,
|
|
307
|
+
path: fixWindowsPath(entry)
|
|
308
|
+
})
|
|
300
309
|
} else {
|
|
301
310
|
return acc
|
|
302
311
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@awes-io/ui",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.59.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": "
|
|
125
|
+
"gitHead": "3f9da3ad6aaf3aee398718c495468565018c2ecd"
|
|
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
|
|