@awes-io/ui 2.58.0 → 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 CHANGED
@@ -3,6 +3,17 @@
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
+
6
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)
7
18
 
8
19
 
@@ -1,6 +1,7 @@
1
1
  .aw-header-notification {
2
2
  display: flex;
3
3
  align-items: flex-start;
4
+ padding-top: env(safe-area-inset-top, 0px);
4
5
 
5
6
  &__content {
6
7
  flex-grow: 1;
@@ -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; }
@@ -38,6 +38,7 @@
38
38
  v-bind="mergedAttributes"
39
39
  :value="inputValue"
40
40
  :aria-describedby="errorText ? errorId : null"
41
+ :data-error="errorText || hasError || null"
41
42
  v-on="mergedListeners"
42
43
  v-tooltip.show.prepend="errorTooltip"
43
44
  ref="element"
@@ -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.progress = progress
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
  },
@@ -163,7 +163,8 @@ export default {
163
163
  name: 'AwMobileMenu',
164
164
 
165
165
  components: {
166
- AwMobileMenuNav
166
+ AwMobileMenuNav,
167
+ AwLayoutLogo: () => import('@AwLayouts/_AwLayoutLogo.vue')
167
168
  // AwMobileMenuItem
168
169
  },
169
170
 
@@ -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 = 0
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({ name, path: entry })
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.58.0",
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": "50a0c95ae90eb488c21b2ee75055dfeb4b36f8db"
125
+ "gitHead": "3f9da3ad6aaf3aee398718c495468565018c2ecd"
126
126
  }