@awes-io/ui 2.58.0 → 2.59.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 +22 -0
- package/assets/css/components/header-notification.css +1 -0
- package/assets/css/flags.css +15 -0
- package/components/1_atoms/AwInput.vue +1 -0
- package/components/3_organisms/AwTable/AwTableBuilder.vue +15 -0
- package/components/3_organisms/AwUploader.vue +15 -2
- package/components/5_layouts/_AwLayoutMenu.vue +1 -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/nuxt/templates/lang.plugin.js +4 -2
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,28 @@
|
|
|
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.1](https://github.com/awes-io/client/compare/@awes-io/ui@2.59.0...@awes-io/ui@2.59.1) (2022-10-20)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* **aw-table-builder:** skip onfetch hook if table unmounted ([284fafd](https://github.com/awes-io/client/commit/284fafdad291c2a976871859f4964c520e23ed89))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
# [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)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
### Features
|
|
21
|
+
|
|
22
|
+
* uploader and test attrs improvements ([b3ef891](https://github.com/awes-io/client/commit/b3ef8914adcb9f2ea63999d1d82345ae7b98002b))
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
6
28
|
# [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
29
|
|
|
8
30
|
|
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; }
|
|
@@ -278,6 +278,7 @@ export default {
|
|
|
278
278
|
return {
|
|
279
279
|
defaultCol: null,
|
|
280
280
|
isResetPage: true,
|
|
281
|
+
isAborted: false,
|
|
281
282
|
pagination: {
|
|
282
283
|
total: null,
|
|
283
284
|
limit: DEFAULT_LIMITS[0]
|
|
@@ -408,6 +409,7 @@ export default {
|
|
|
408
409
|
if (oldVal && this.scrollOnPage) {
|
|
409
410
|
this._scrollTop()
|
|
410
411
|
}
|
|
412
|
+
|
|
411
413
|
this.fetch()
|
|
412
414
|
}
|
|
413
415
|
},
|
|
@@ -416,6 +418,7 @@ export default {
|
|
|
416
418
|
if (this.scrollOnPage) {
|
|
417
419
|
this._scrollTop()
|
|
418
420
|
}
|
|
421
|
+
|
|
419
422
|
this.fetch()
|
|
420
423
|
}
|
|
421
424
|
},
|
|
@@ -438,7 +441,10 @@ export default {
|
|
|
438
441
|
})
|
|
439
442
|
|
|
440
443
|
this.collection.onFetchSuccess = (response) => {
|
|
444
|
+
if (this.isAborted) return
|
|
445
|
+
|
|
441
446
|
this._setPagination(response)
|
|
447
|
+
|
|
442
448
|
if (isType('Function', _oldOnFetchFuccess)) {
|
|
443
449
|
_oldOnFetchFuccess(response)
|
|
444
450
|
}
|
|
@@ -447,9 +453,12 @@ export default {
|
|
|
447
453
|
this.collection.isPaginated = () => this.infiniteScroll
|
|
448
454
|
|
|
449
455
|
this.$once('hook:beforeDestroy', () => {
|
|
456
|
+
this.isAborted = true
|
|
457
|
+
|
|
450
458
|
this.collection.getFetchQuery = _oldGetFetchQuery
|
|
451
459
|
this.collection.onFetchSuccess = _oldOnFetchFuccess
|
|
452
460
|
this.collection.isPaginated = _oldIsPaginated
|
|
461
|
+
|
|
453
462
|
_oldGetFetchQuery = null
|
|
454
463
|
_oldOnFetchFuccess = null
|
|
455
464
|
_oldIsPaginated = null
|
|
@@ -470,6 +479,7 @@ export default {
|
|
|
470
479
|
|
|
471
480
|
fetchMore() {
|
|
472
481
|
const page = this.collection.models.length / this.limit
|
|
482
|
+
|
|
473
483
|
this.collection
|
|
474
484
|
.page(1)
|
|
475
485
|
.fetch({
|
|
@@ -487,7 +497,9 @@ export default {
|
|
|
487
497
|
|
|
488
498
|
onTheadClick(col) {
|
|
489
499
|
const orderable = col.orderable
|
|
500
|
+
|
|
490
501
|
this.$emit(TABLE_HEAD_CLICK_EVENT, col)
|
|
502
|
+
|
|
491
503
|
if (orderable) {
|
|
492
504
|
const isAskValPresent =
|
|
493
505
|
this.$route.query[orderable.param] === orderable.ascValue
|
|
@@ -535,6 +547,7 @@ export default {
|
|
|
535
547
|
_isColDefault(col) {
|
|
536
548
|
const isParamPresent =
|
|
537
549
|
Object.keys(this.$route.query).indexOf(col.orderable.param) > -1
|
|
550
|
+
|
|
538
551
|
return !isParamPresent && col.orderable.default
|
|
539
552
|
},
|
|
540
553
|
|
|
@@ -594,6 +607,7 @@ export default {
|
|
|
594
607
|
if (!this.$slots.default) {
|
|
595
608
|
return null
|
|
596
609
|
}
|
|
610
|
+
|
|
597
611
|
const filtered = this.$slots.default.filter((el) =>
|
|
598
612
|
pathOr(
|
|
599
613
|
false,
|
|
@@ -601,6 +615,7 @@ export default {
|
|
|
601
615
|
el
|
|
602
616
|
)
|
|
603
617
|
)
|
|
618
|
+
|
|
604
619
|
return filtered.length ? filtered[0] : null
|
|
605
620
|
}
|
|
606
621
|
}
|
|
@@ -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
|
},
|
|
@@ -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
|
}
|
|
@@ -101,8 +101,10 @@ export default async ({ app, $axios }) => {
|
|
|
101
101
|
let _browserLang = toLocale(navigator.language)
|
|
102
102
|
|
|
103
103
|
if (!localeCodes.includes(_browserLang)) {
|
|
104
|
-
_browserLang =
|
|
105
|
-
|
|
104
|
+
_browserLang = toLocale(
|
|
105
|
+
navigator.languages.find(locale =>
|
|
106
|
+
localeCodes.includes(toLocale(locale))
|
|
107
|
+
)
|
|
106
108
|
)
|
|
107
109
|
}
|
|
108
110
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@awes-io/ui",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.59.1",
|
|
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": "b2e9cb0962e02a99d51c9d57dd1ee0b5d9459495"
|
|
126
126
|
}
|