@awes-io/ui 2.33.0 → 2.34.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.
@@ -1,11 +1,25 @@
1
+ const IS_SEARCH_KEY_RE = /^\S$/i
2
+
1
3
  export default {
4
+ computed: {
5
+ _arrowFocusSelector() {
6
+ return '[data-arrow-focus]'
7
+ },
8
+
9
+ _arrowFocusInited() {
10
+ return this.isOpened
11
+ }
12
+ },
13
+
2
14
  methods: {
3
15
  _arrowFocusItem(offset = 0, $event) {
4
- if (!this.isOpened) return
16
+ if (!this._arrowFocusInited) return
5
17
 
6
- const buttons = Array.from(
7
- this.$el.querySelectorAll('[data-arrow-focus]')
8
- )
18
+ this._arrowFocus(offset, $event)
19
+ },
20
+
21
+ _arrowFocus(offset, $event) {
22
+ const buttons = this._getFocusItems()
9
23
  const active = document.activeElement
10
24
  const activeIndex = buttons.indexOf(active)
11
25
  let nextIndex
@@ -25,6 +39,53 @@ export default {
25
39
  }
26
40
  button.focus()
27
41
  }
42
+ },
43
+
44
+ _keyFocusItem($event) {
45
+ const { key, keyCode } = $event
46
+
47
+ if (keyCode === 38 || keyCode === 40) {
48
+ const offset = keyCode === 38 ? -1 : 1
49
+
50
+ this._arrowFocus(offset, $event)
51
+ } else if (IS_SEARCH_KEY_RE.test(key)) {
52
+ const buttons = this._getFocusItems()
53
+ const active = document.activeElement
54
+ const re = new RegExp('^(\\s+)?' + key, 'i')
55
+ let button
56
+
57
+ if (buttons.includes(active) && re.test(active.textContent)) {
58
+ const currentIndex = buttons.indexOf(active)
59
+ const next = buttons[currentIndex + 1]
60
+
61
+ if (next && re.test(next.textContent)) {
62
+ button = next
63
+ } else {
64
+ const firstIndex = buttons.findIndex((_btn) =>
65
+ re.test(_btn.textContent)
66
+ )
67
+ if (firstIndex !== currentIndex) {
68
+ button = buttons[firstIndex]
69
+ }
70
+ }
71
+ } else {
72
+ button = buttons.find((_btn) => re.test(_btn.textContent))
73
+ }
74
+
75
+ if (button) {
76
+ if ($event) {
77
+ $event.preventDefault()
78
+ $event.stopPropagation()
79
+ }
80
+ button.focus()
81
+ }
82
+ }
83
+ },
84
+
85
+ _getFocusItems() {
86
+ return Array.from(
87
+ this.$el.querySelectorAll(this._arrowFocusSelector)
88
+ )
28
89
  }
29
90
  }
30
91
  }
package/nuxt/icons.css ADDED
@@ -0,0 +1,168 @@
1
+ @font-face {
2
+ font-family: "aw-icons";
3
+ src: url("../dist/fonts/aw-icons.woff2?f7781284402a16642f82aa8273369343") format("woff2"),
4
+ url("../dist/fonts/aw-icons.woff?f7781284402a16642f82aa8273369343") format("woff");
5
+ }
6
+
7
+ .aw-icon {
8
+ display: inline-block;
9
+ line-height: 1;
10
+ overflow: hidden;
11
+ vertical-align: middle;
12
+ text-align: center;
13
+ }
14
+
15
+ .aw-icon:before {
16
+ font-family: aw-icons !important;
17
+ font-style: normal;
18
+ font-weight: normal !important;
19
+ vertical-align: top;
20
+ }
21
+
22
+ .aw-icon-arrow-d:before {
23
+ content: "\f101";
24
+ }
25
+ .aw-icon-arrow-l:before {
26
+ content: "\f102";
27
+ }
28
+ .aw-icon-arrow-r:before {
29
+ content: "\f103";
30
+ }
31
+ .aw-icon-arrow-u:before {
32
+ content: "\f104";
33
+ }
34
+ .aw-icon-bold:before {
35
+ content: "\f105";
36
+ }
37
+ .aw-icon-briefcase:before {
38
+ content: "\f106";
39
+ }
40
+ .aw-icon-burger:before {
41
+ content: "\f107";
42
+ }
43
+ .aw-icon-check-circle:before {
44
+ content: "\f108";
45
+ }
46
+ .aw-icon-check-solid:before {
47
+ content: "\f109";
48
+ }
49
+ .aw-icon-check:before {
50
+ content: "\f10a";
51
+ }
52
+ .aw-icon-chevron-d:before {
53
+ content: "\f10b";
54
+ }
55
+ .aw-icon-chevron-l:before {
56
+ content: "\f10c";
57
+ }
58
+ .aw-icon-chevron-r:before {
59
+ content: "\f10d";
60
+ }
61
+ .aw-icon-chevron-u:before {
62
+ content: "\f10e";
63
+ }
64
+ .aw-icon-circle:before {
65
+ content: "\f10f";
66
+ }
67
+ .aw-icon-close-circle:before {
68
+ content: "\f110";
69
+ }
70
+ .aw-icon-close-solid:before {
71
+ content: "\f111";
72
+ }
73
+ .aw-icon-close:before {
74
+ content: "\f112";
75
+ }
76
+ .aw-icon-copy:before {
77
+ content: "\f113";
78
+ }
79
+ .aw-icon-drag:before {
80
+ content: "\f114";
81
+ }
82
+ .aw-icon-external:before {
83
+ content: "\f115";
84
+ }
85
+ .aw-icon-eye-no:before {
86
+ content: "\f116";
87
+ }
88
+ .aw-icon-eye:before {
89
+ content: "\f117";
90
+ }
91
+ .aw-icon-font-size:before {
92
+ content: "\f118";
93
+ }
94
+ .aw-icon-graph:before {
95
+ content: "\f119";
96
+ }
97
+ .aw-icon-intelligence:before {
98
+ content: "\f11a";
99
+ }
100
+ .aw-icon-italic:before {
101
+ content: "\f11b";
102
+ }
103
+ .aw-icon-loader:before {
104
+ content: "\f11c";
105
+ }
106
+ .aw-icon-location:before {
107
+ content: "\f11d";
108
+ }
109
+ .aw-icon-minus:before {
110
+ content: "\f11e";
111
+ }
112
+ .aw-icon-more-v:before {
113
+ content: "\f11f";
114
+ }
115
+ .aw-icon-more:before {
116
+ content: "\f120";
117
+ }
118
+ .aw-icon-plus-solid:before {
119
+ content: "\f121";
120
+ }
121
+ .aw-icon-plus:before {
122
+ content: "\f122";
123
+ }
124
+ .aw-icon-quote:before {
125
+ content: "\f123";
126
+ }
127
+ .aw-icon-schedule:before {
128
+ content: "\f124";
129
+ }
130
+ .aw-icon-search:before {
131
+ content: "\f125";
132
+ }
133
+ .aw-icon-settings:before {
134
+ content: "\f126";
135
+ }
136
+ .aw-icon-speaker:before {
137
+ content: "\f127";
138
+ }
139
+ .aw-icon-speed:before {
140
+ content: "\f128";
141
+ }
142
+ .aw-icon-storage:before {
143
+ content: "\f129";
144
+ }
145
+ .aw-icon-triangle-d:before {
146
+ content: "\f12a";
147
+ }
148
+ .aw-icon-triangle-l:before {
149
+ content: "\f12b";
150
+ }
151
+ .aw-icon-triangle-r:before {
152
+ content: "\f12c";
153
+ }
154
+ .aw-icon-triangle-solid-r:before {
155
+ content: "\f12d";
156
+ }
157
+ .aw-icon-triangle-u:before {
158
+ content: "\f12e";
159
+ }
160
+ .aw-icon-upload:before {
161
+ content: "\f12f";
162
+ }
163
+ .aw-icon-user-solid:before {
164
+ content: "\f130";
165
+ }
166
+ .aw-icon-user:before {
167
+ content: "\f131";
168
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@awes-io/ui",
3
- "version": "2.33.0",
3
+ "version": "2.34.0",
4
4
  "description": "User Interface (UI) components",
5
5
  "keywords": [
6
6
  "ui",
@@ -51,7 +51,7 @@
51
51
  "dependencies": {
52
52
  "@casl/ability": "^4.1.6",
53
53
  "@casl/vue": "^1.1.1",
54
- "@nuxtjs/axios": "^5.12.4",
54
+ "@nuxtjs/axios": "^5.13.6",
55
55
  "@nuxtjs/svg-sprite": "^0.5.2",
56
56
  "@popperjs/core": "^2.0.5",
57
57
  "autosize": "^4.0.2",
@@ -66,6 +66,7 @@
66
66
  "hammerjs": "^2.0.8",
67
67
  "insane": "^2.6.2",
68
68
  "js-cookie": "^2.2.1",
69
+ "libphonenumber-js": "^1.9.43",
69
70
  "loadjs": "^3.6.1",
70
71
  "marked": "^0.7.0",
71
72
  "postcss-color-function": "^4.1.0",
@@ -76,7 +77,7 @@
76
77
  "tailwindcss": "^1.9.6",
77
78
  "vue-currency-input": "^1.22.3",
78
79
  "vue-i18n": "^8.14.0",
79
- "vue-tel-input": "5.3.0"
80
+ "world-flags-sprite": "^0.0.2"
80
81
  },
81
82
  "devDependencies": {
82
83
  "@babel/core": "^7.5.5",
@@ -123,5 +124,5 @@
123
124
  "vue-template-compiler": "^2.6.10",
124
125
  "webfonts-generator": "^0.4.0"
125
126
  },
126
- "gitHead": "a606ff331a97cd5cff79579935f12bde2ec2eedb"
127
+ "gitHead": "7cf70f84e64609355c655b32e92cbee0452c4765"
127
128
  }