buefy 0.9.13 → 0.9.14

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.
Files changed (230) hide show
  1. package/dist/buefy.css +1 -1
  2. package/dist/buefy.esm.js +167 -117
  3. package/dist/buefy.esm.min.js +2 -2
  4. package/dist/buefy.js +168 -116
  5. package/dist/buefy.min.css +1 -1
  6. package/dist/buefy.min.js +2 -2
  7. package/dist/cjs/autocomplete.js +5 -5
  8. package/dist/cjs/breadcrumb.js +1 -1
  9. package/dist/cjs/button.js +3 -3
  10. package/dist/cjs/carousel.js +4 -4
  11. package/dist/cjs/{chunk-c6fbc7b4.js → chunk-02406b6a.js} +2 -2
  12. package/dist/cjs/{chunk-d0f8ea39.js → chunk-0cc2e136.js} +6 -6
  13. package/dist/cjs/{chunk-114191ae.js → chunk-0d901f36.js} +2 -2
  14. package/dist/cjs/{chunk-9e4cf4c5.js → chunk-1061ac68.js} +1 -1
  15. package/dist/cjs/{chunk-2c7de785.js → chunk-1d2f05e0.js} +0 -0
  16. package/dist/cjs/{chunk-30670fac.js → chunk-2a2403f9.js} +78 -62
  17. package/dist/cjs/{chunk-d54e40f6.js → chunk-2cdb1a89.js} +2 -9
  18. package/dist/cjs/{chunk-34949503.js → chunk-4a3a5cf7.js} +1 -1
  19. package/dist/cjs/{chunk-fe2f57ee.js → chunk-4ebee779.js} +2 -2
  20. package/dist/cjs/{chunk-2062216d.js → chunk-5a7e385c.js} +1 -1
  21. package/dist/cjs/{chunk-f5106717.js → chunk-74fb31db.js} +3 -3
  22. package/dist/cjs/{chunk-7da0c017.js → chunk-a267720d.js} +21 -21
  23. package/dist/cjs/{chunk-a11294f9.js → chunk-a268cb3d.js} +2 -2
  24. package/dist/cjs/{chunk-c7b2aa4b.js → chunk-bb7da16a.js} +1 -1
  25. package/dist/cjs/{chunk-2ae50815.js → chunk-bebdaf0b.js} +3 -3
  26. package/dist/cjs/{chunk-9103eeda.js → chunk-c0adb618.js} +1 -1
  27. package/dist/cjs/{chunk-d120e215.js → chunk-d7d30e52.js} +1 -1
  28. package/dist/cjs/{chunk-fefd7b77.js → chunk-ddd15f05.js} +0 -0
  29. package/dist/cjs/{chunk-2911aa4b.js → chunk-e8dc6270.js} +14 -11
  30. package/dist/cjs/{chunk-3cc5d9a6.js → chunk-eb8d954b.js} +0 -0
  31. package/dist/cjs/{chunk-6cb902f8.js → chunk-f536c03f.js} +1 -1
  32. package/dist/cjs/{chunk-61023b09.js → chunk-fbf3566e.js} +2 -2
  33. package/dist/cjs/clockpicker.js +8 -8
  34. package/dist/cjs/config.js +1 -1
  35. package/dist/cjs/datepicker.js +9 -9
  36. package/dist/cjs/datetimepicker.js +11 -11
  37. package/dist/cjs/dialog.js +4 -4
  38. package/dist/cjs/dropdown.js +3 -3
  39. package/dist/cjs/field.js +2 -2
  40. package/dist/cjs/helpers.js +20 -0
  41. package/dist/cjs/icon.js +2 -2
  42. package/dist/cjs/image.js +2 -2
  43. package/dist/cjs/index.js +24 -22
  44. package/dist/cjs/input.js +4 -4
  45. package/dist/cjs/loading.js +2 -2
  46. package/dist/cjs/menu.js +2 -2
  47. package/dist/cjs/message.js +3 -3
  48. package/dist/cjs/modal.js +2 -2
  49. package/dist/cjs/navbar.js +3 -0
  50. package/dist/cjs/notification.js +4 -4
  51. package/dist/cjs/numberinput.js +4 -4
  52. package/dist/cjs/pagination.js +3 -3
  53. package/dist/cjs/progress.js +2 -2
  54. package/dist/cjs/rate.js +2 -2
  55. package/dist/cjs/select.js +4 -4
  56. package/dist/cjs/sidebar.js +1 -1
  57. package/dist/cjs/slider.js +2 -2
  58. package/dist/cjs/snackbar.js +4 -3
  59. package/dist/cjs/steps.js +5 -5
  60. package/dist/cjs/switch.js +1 -1
  61. package/dist/cjs/table.js +24 -22
  62. package/dist/cjs/tabs.js +7 -7
  63. package/dist/cjs/taginput.js +5 -5
  64. package/dist/cjs/timepicker.js +10 -10
  65. package/dist/cjs/toast.js +2 -2
  66. package/dist/cjs/tooltip.js +2 -2
  67. package/dist/cjs/upload.js +21 -7
  68. package/dist/components/autocomplete/index.js +78 -62
  69. package/dist/components/autocomplete/index.min.js +2 -2
  70. package/dist/components/breadcrumb/index.js +2 -2
  71. package/dist/components/breadcrumb/index.min.js +1 -1
  72. package/dist/components/button/index.js +2 -2
  73. package/dist/components/button/index.min.js +2 -2
  74. package/dist/components/carousel/index.js +2 -2
  75. package/dist/components/carousel/index.min.js +2 -2
  76. package/dist/components/checkbox/index.js +1 -1
  77. package/dist/components/checkbox/index.min.js +1 -1
  78. package/dist/components/clockpicker/index.js +22 -22
  79. package/dist/components/clockpicker/index.min.js +2 -2
  80. package/dist/components/collapse/index.js +1 -1
  81. package/dist/components/collapse/index.min.js +1 -1
  82. package/dist/components/datepicker/index.js +29 -26
  83. package/dist/components/datepicker/index.min.js +2 -2
  84. package/dist/components/datetimepicker/index.js +29 -26
  85. package/dist/components/datetimepicker/index.min.js +2 -2
  86. package/dist/components/dialog/index.js +2 -2
  87. package/dist/components/dialog/index.min.js +2 -2
  88. package/dist/components/dropdown/index.js +2 -2
  89. package/dist/components/dropdown/index.min.js +1 -1
  90. package/dist/components/field/index.js +22 -22
  91. package/dist/components/field/index.min.js +1 -1
  92. package/dist/components/icon/index.js +2 -2
  93. package/dist/components/icon/index.min.js +2 -2
  94. package/dist/components/image/index.js +2 -2
  95. package/dist/components/image/index.min.js +2 -2
  96. package/dist/components/input/index.js +2 -2
  97. package/dist/components/input/index.min.js +2 -2
  98. package/dist/components/loading/index.js +1 -1
  99. package/dist/components/loading/index.min.js +1 -1
  100. package/dist/components/menu/index.js +2 -2
  101. package/dist/components/menu/index.min.js +2 -2
  102. package/dist/components/message/index.js +2 -2
  103. package/dist/components/message/index.min.js +2 -2
  104. package/dist/components/modal/index.js +2 -2
  105. package/dist/components/modal/index.min.js +2 -2
  106. package/dist/components/navbar/index.js +4 -1
  107. package/dist/components/navbar/index.min.js +2 -2
  108. package/dist/components/notification/index.js +3 -10
  109. package/dist/components/notification/index.min.js +2 -2
  110. package/dist/components/numberinput/index.js +2 -2
  111. package/dist/components/numberinput/index.min.js +2 -2
  112. package/dist/components/pagination/index.js +2 -2
  113. package/dist/components/pagination/index.min.js +2 -2
  114. package/dist/components/progress/index.js +2 -2
  115. package/dist/components/progress/index.min.js +2 -2
  116. package/dist/components/radio/index.js +1 -1
  117. package/dist/components/radio/index.min.js +1 -1
  118. package/dist/components/rate/index.js +2 -2
  119. package/dist/components/rate/index.min.js +2 -2
  120. package/dist/components/select/index.js +2 -2
  121. package/dist/components/select/index.min.js +2 -2
  122. package/dist/components/sidebar/index.js +2 -2
  123. package/dist/components/sidebar/index.min.js +1 -1
  124. package/dist/components/skeleton/index.js +1 -1
  125. package/dist/components/skeleton/index.min.js +1 -1
  126. package/dist/components/slider/index.js +2 -2
  127. package/dist/components/slider/index.min.js +2 -2
  128. package/dist/components/snackbar/index.js +5 -11
  129. package/dist/components/snackbar/index.min.js +2 -2
  130. package/dist/components/steps/index.js +2 -2
  131. package/dist/components/steps/index.min.js +2 -2
  132. package/dist/components/switch/index.js +2 -2
  133. package/dist/components/switch/index.min.js +1 -1
  134. package/dist/components/table/index.js +36 -16
  135. package/dist/components/table/index.min.js +2 -2
  136. package/dist/components/tabs/index.js +4 -4
  137. package/dist/components/tabs/index.min.js +2 -2
  138. package/dist/components/tag/index.js +1 -1
  139. package/dist/components/tag/index.min.js +1 -1
  140. package/dist/components/taginput/index.js +78 -62
  141. package/dist/components/taginput/index.min.js +2 -2
  142. package/dist/components/timepicker/index.js +22 -22
  143. package/dist/components/timepicker/index.min.js +2 -2
  144. package/dist/components/toast/index.js +3 -10
  145. package/dist/components/toast/index.min.js +2 -2
  146. package/dist/components/tooltip/index.js +2 -2
  147. package/dist/components/tooltip/index.min.js +1 -1
  148. package/dist/components/upload/index.js +21 -7
  149. package/dist/components/upload/index.min.js +2 -2
  150. package/dist/esm/autocomplete.js +6 -6
  151. package/dist/esm/breadcrumb.js +1 -1
  152. package/dist/esm/button.js +4 -4
  153. package/dist/esm/carousel.js +4 -4
  154. package/dist/esm/{chunk-21fc0948.js → chunk-03f0ac1a.js} +6 -6
  155. package/dist/esm/{chunk-b0c0c6b0.js → chunk-0c4e4e90.js} +0 -0
  156. package/dist/esm/{chunk-ae8ab23a.js → chunk-113685dc.js} +3 -3
  157. package/dist/esm/{chunk-71a547bc.js → chunk-1b63211c.js} +1 -1
  158. package/dist/esm/{chunk-d7f92d97.js → chunk-1f41edb4.js} +1 -1
  159. package/dist/esm/{chunk-3773c62d.js → chunk-2229e354.js} +1 -1
  160. package/dist/esm/{chunk-83eb0d37.js → chunk-40f06d9c.js} +2 -2
  161. package/dist/esm/{chunk-75a5af93.js → chunk-590a6902.js} +1 -1
  162. package/dist/esm/{chunk-22e9f916.js → chunk-5f0c3fc4.js} +14 -11
  163. package/dist/esm/{chunk-6019fd7a.js → chunk-79ac4d01.js} +79 -63
  164. package/dist/esm/{chunk-8ed29c41.js → chunk-8cad1844.js} +1 -1
  165. package/dist/esm/{chunk-29ca0df8.js → chunk-91404fa9.js} +0 -0
  166. package/dist/esm/{chunk-b07e3182.js → chunk-97f201e0.js} +21 -21
  167. package/dist/esm/{chunk-c9c58d0c.js → chunk-9e0ae963.js} +0 -0
  168. package/dist/esm/{chunk-ece062a7.js → chunk-a8516afd.js} +2 -2
  169. package/dist/esm/{chunk-4b67a181.js → chunk-b66a83ce.js} +2 -2
  170. package/dist/esm/{chunk-9f7f7441.js → chunk-b99e83bd.js} +1 -1
  171. package/dist/esm/{chunk-18e8b067.js → chunk-bbf5d78a.js} +2 -2
  172. package/dist/esm/{chunk-8d0f95b8.js → chunk-e01e9ef0.js} +3 -3
  173. package/dist/esm/{chunk-799e084d.js → chunk-e7eb83d8.js} +2 -9
  174. package/dist/esm/{chunk-d92f0cd9.js → chunk-ea9bc877.js} +1 -1
  175. package/dist/esm/{chunk-e7c9b2cb.js → chunk-efec59b6.js} +2 -2
  176. package/dist/esm/clockpicker.js +8 -8
  177. package/dist/esm/config.js +1 -1
  178. package/dist/esm/datepicker.js +10 -10
  179. package/dist/esm/datetimepicker.js +11 -11
  180. package/dist/esm/dialog.js +4 -4
  181. package/dist/esm/dropdown.js +4 -4
  182. package/dist/esm/field.js +3 -3
  183. package/dist/esm/helpers.js +19 -1
  184. package/dist/esm/icon.js +3 -3
  185. package/dist/esm/image.js +3 -3
  186. package/dist/esm/index.js +23 -23
  187. package/dist/esm/input.js +5 -5
  188. package/dist/esm/loading.js +3 -3
  189. package/dist/esm/menu.js +2 -2
  190. package/dist/esm/message.js +3 -3
  191. package/dist/esm/modal.js +3 -3
  192. package/dist/esm/navbar.js +3 -0
  193. package/dist/esm/notification.js +4 -4
  194. package/dist/esm/numberinput.js +4 -4
  195. package/dist/esm/pagination.js +4 -4
  196. package/dist/esm/progress.js +2 -2
  197. package/dist/esm/rate.js +2 -2
  198. package/dist/esm/select.js +5 -5
  199. package/dist/esm/sidebar.js +1 -1
  200. package/dist/esm/slider.js +2 -2
  201. package/dist/esm/snackbar.js +4 -3
  202. package/dist/esm/steps.js +5 -5
  203. package/dist/esm/switch.js +1 -1
  204. package/dist/esm/table.js +25 -23
  205. package/dist/esm/tabs.js +7 -7
  206. package/dist/esm/taginput.js +5 -5
  207. package/dist/esm/timepicker.js +11 -11
  208. package/dist/esm/toast.js +2 -2
  209. package/dist/esm/tooltip.js +3 -3
  210. package/dist/esm/upload.js +21 -7
  211. package/dist/vetur/attributes.json +4 -0
  212. package/dist/vetur/tags.json +1 -0
  213. package/package.json +1 -1
  214. package/src/components/autocomplete/Autocomplete.vue +711 -701
  215. package/src/components/breadcrumb/__snapshots__/BreadcrumbItem.spec.js.snap +1 -5
  216. package/src/components/carousel/__snapshots__/CarouselList.spec.js.snap +48 -48
  217. package/src/components/datepicker/DatepickerTableRow.spec.js +26 -0
  218. package/src/components/datepicker/DatepickerTableRow.vue +4 -5
  219. package/src/components/field/Field.vue +271 -271
  220. package/src/components/navbar/NavbarDropdown.vue +4 -0
  221. package/src/components/snackbar/index.js +2 -1
  222. package/src/components/table/Table.spec.js +17 -3
  223. package/src/components/table/Table.vue +8 -9
  224. package/src/components/tabs/Tabs.vue +185 -183
  225. package/src/components/timepicker/__snapshots__/Timepicker.spec.js.snap +18 -47
  226. package/src/components/upload/Upload.vue +19 -7
  227. package/src/utils/NoticeMixin.js +1 -5
  228. package/src/utils/config.js +1 -1
  229. package/src/utils/helpers.js +16 -0
  230. package/types/components.d.ts +5 -0
@@ -1,183 +1,185 @@
1
- <template>
2
- <div class="b-tabs" :class="mainClasses">
3
- <nav
4
- class="tabs"
5
- :class="navClasses"
6
- role="tablist"
7
- :aria-orientation="vertical ? 'vertical' : 'horizontal'"
8
- @keydown="manageTablistKeydown"
9
- >
10
- <ul>
11
- <li
12
- v-for="(childItem, childIdx) in items"
13
- :key="childItem.value"
14
- v-show="childItem.visible"
15
- :class="[ childItem.headerClass, { 'is-active': childItem.isActive,
16
- 'is-disabled': childItem.disabled }]"
17
- role="presentation"
18
- >
19
- <b-slot-component
20
- ref="tabLink"
21
- v-if="childItem.$scopedSlots.header"
22
- :component="childItem"
23
- name="header"
24
- tag="a"
25
- role="tab"
26
- :id="`${childItem.value}-label`"
27
- :aria-controls="`${childItem.value}-content`"
28
- :aria-selected="`${childItem.isActive}`"
29
- :tabindex="childItem.isActive ? 0 : -1"
30
- @focus.native="currentFocus = childIdx"
31
- @click.native="childClick(childItem)"
32
- @keydown="manageTabKeydown($event, childItem)"
33
- />
34
- <a
35
- ref="tabLink"
36
- v-else
37
- role="tab"
38
- :id="`${childItem.value}-tab`"
39
- :aria-controls="`${childItem.value}-content`"
40
- :aria-selected="`${childItem.isActive}`"
41
- :tabindex="childItem.isActive ? 0 : -1"
42
- @focus="currentFocus = childIdx"
43
- @click="childClick(childItem)"
44
- @keydown="manageTabKeydown($event, childItem)"
45
- >
46
- <b-icon
47
- v-if="childItem.icon"
48
- :icon="childItem.icon"
49
- :pack="childItem.iconPack"
50
- :size="size"/>
51
- <span>{{ childItem.label }}</span>
52
- </a>
53
- </li>
54
- </ul>
55
- </nav>
56
- <section class="tab-content" :class="{'is-transitioning': isTransitioning}">
57
- <slot/>
58
- </section>
59
- </div>
60
- </template>
61
-
62
- <script>
63
- import config from '../../utils/config'
64
- import TabbedMixin from '../../utils/TabbedMixin.js'
65
-
66
- export default {
67
- name: 'BTabs',
68
- mixins: [TabbedMixin('tab')],
69
- props: {
70
- expanded: {
71
- type: Boolean,
72
- default: () => {
73
- return config.defaultTabsExpanded
74
- }
75
- },
76
- type: {
77
- type: [String, Object],
78
- default: () => {
79
- return config.defaultTabsType
80
- }
81
- },
82
- animated: {
83
- type: Boolean,
84
- default: () => {
85
- return config.defaultTabsAnimated
86
- }
87
- },
88
- multiline: Boolean
89
- },
90
- data() {
91
- return {
92
- currentFocus: this.value
93
- }
94
- },
95
- computed: {
96
- mainClasses() {
97
- return {
98
- 'is-fullwidth': this.expanded,
99
- 'is-vertical': this.vertical,
100
- 'is-multiline': this.multiline,
101
- [this.position]: this.position && this.vertical
102
- }
103
- },
104
- navClasses() {
105
- return [
106
- this.type,
107
- this.size,
108
- {
109
- [this.position]: this.position && !this.vertical,
110
- 'is-fullwidth': this.expanded,
111
- 'is-toggle': this.type === 'is-toggle-rounded'
112
- }
113
- ]
114
- }
115
- },
116
- methods: {
117
- giveFocusToTab(tab) {
118
- if (tab.$el && tab.$el.focus) {
119
- tab.$el.focus()
120
- } else if (tab.focus) {
121
- tab.focus()
122
- }
123
- },
124
- manageTablistKeydown(event) {
125
- // https://developer.mozilla.org/fr/docs/Web/API/KeyboardEvent/key/Key_Values#Navigation_keys
126
- const { key } = event
127
- switch (key) {
128
- case this.vertical ? 'ArrowUp' : 'ArrowLeft':
129
- case this.vertical ? 'Up' : 'Left': {
130
- let prevIdx = this.getPrevItemIdx(this.currentFocus, true)
131
- if (prevIdx === null) {
132
- // We try to give focus back to the last visible element
133
- prevIdx = this.getPrevItemIdx(this.items.length, true)
134
- }
135
- if (
136
- prevIdx !== null &&
137
- this.$refs.tabLink &&
138
- prevIdx < this.$refs.tabLink.length &&
139
- !this.items[prevIdx].disabled
140
- ) {
141
- this.giveFocusToTab(this.$refs.tabLink[prevIdx])
142
- }
143
- event.preventDefault()
144
- break
145
- }
146
- case this.vertical ? 'ArrowDown' : 'ArrowRight':
147
- case this.vertical ? 'Down' : 'Right': {
148
- let nextIdx = this.getNextItemIdx(this.currentFocus, true)
149
- if (nextIdx === null) {
150
- // We try to give focus back to the first visible element
151
- nextIdx = this.getNextItemIdx(-1, true)
152
- }
153
- if (
154
- nextIdx !== null &&
155
- this.$refs.tabLink &&
156
- nextIdx < this.$refs.tabLink.length &&
157
- !this.items[nextIdx].disabled
158
- ) {
159
- this.giveFocusToTab(this.$refs.tabLink[nextIdx])
160
- }
161
- event.preventDefault()
162
- break
163
- }
164
- }
165
- },
166
-
167
- manageTabKeydown(event, childItem) {
168
- // https://developer.mozilla.org/fr/docs/Web/API/KeyboardEvent/key/Key_Values#Navigation_keys
169
- const { key } = event
170
- switch (key) {
171
- case ' ':
172
- case 'Space':
173
- case 'Spacebar':
174
- case 'Enter': {
175
- this.childClick(childItem)
176
- event.preventDefault()
177
- break
178
- }
179
- }
180
- }
181
- }
182
- }
183
- </script>
1
+ <template>
2
+ <div class="b-tabs" :class="mainClasses">
3
+ <nav
4
+ class="tabs"
5
+ :class="navClasses"
6
+ role="tablist"
7
+ :aria-orientation="vertical ? 'vertical' : 'horizontal'"
8
+ @keydown="manageTablistKeydown"
9
+ >
10
+ <slot name="start" />
11
+ <ul>
12
+ <li
13
+ v-for="(childItem, childIdx) in items"
14
+ :key="childItem.value"
15
+ v-show="childItem.visible"
16
+ :class="[ childItem.headerClass, { 'is-active': childItem.isActive,
17
+ 'is-disabled': childItem.disabled }]"
18
+ role="presentation"
19
+ >
20
+ <b-slot-component
21
+ ref="tabLink"
22
+ v-if="childItem.$scopedSlots.header"
23
+ :component="childItem"
24
+ name="header"
25
+ tag="a"
26
+ role="tab"
27
+ :id="`${childItem.value}-label`"
28
+ :aria-controls="`${childItem.value}-content`"
29
+ :aria-selected="`${childItem.isActive}`"
30
+ :tabindex="childItem.isActive ? 0 : -1"
31
+ @focus.native="currentFocus = childIdx"
32
+ @click.native="childClick(childItem)"
33
+ @keydown="manageTabKeydown($event, childItem)"
34
+ />
35
+ <a
36
+ ref="tabLink"
37
+ v-else
38
+ role="tab"
39
+ :id="`${childItem.value}-tab`"
40
+ :aria-controls="`${childItem.value}-content`"
41
+ :aria-selected="`${childItem.isActive}`"
42
+ :tabindex="childItem.isActive ? 0 : -1"
43
+ @focus="currentFocus = childIdx"
44
+ @click="childClick(childItem)"
45
+ @keydown="manageTabKeydown($event, childItem)"
46
+ >
47
+ <b-icon
48
+ v-if="childItem.icon"
49
+ :icon="childItem.icon"
50
+ :pack="childItem.iconPack"
51
+ :size="size"/>
52
+ <span>{{ childItem.label }}</span>
53
+ </a>
54
+ </li>
55
+ </ul>
56
+ <slot name="end" />
57
+ </nav>
58
+ <section class="tab-content" :class="{'is-transitioning': isTransitioning}">
59
+ <slot/>
60
+ </section>
61
+ </div>
62
+ </template>
63
+
64
+ <script>
65
+ import config from '../../utils/config'
66
+ import TabbedMixin from '../../utils/TabbedMixin.js'
67
+
68
+ export default {
69
+ name: 'BTabs',
70
+ mixins: [TabbedMixin('tab')],
71
+ props: {
72
+ expanded: {
73
+ type: Boolean,
74
+ default: () => {
75
+ return config.defaultTabsExpanded
76
+ }
77
+ },
78
+ type: {
79
+ type: [String, Object],
80
+ default: () => {
81
+ return config.defaultTabsType
82
+ }
83
+ },
84
+ animated: {
85
+ type: Boolean,
86
+ default: () => {
87
+ return config.defaultTabsAnimated
88
+ }
89
+ },
90
+ multiline: Boolean
91
+ },
92
+ data() {
93
+ return {
94
+ currentFocus: this.value
95
+ }
96
+ },
97
+ computed: {
98
+ mainClasses() {
99
+ return {
100
+ 'is-fullwidth': this.expanded,
101
+ 'is-vertical': this.vertical,
102
+ 'is-multiline': this.multiline,
103
+ [this.position]: this.position && this.vertical
104
+ }
105
+ },
106
+ navClasses() {
107
+ return [
108
+ this.type,
109
+ this.size,
110
+ {
111
+ [this.position]: this.position && !this.vertical,
112
+ 'is-fullwidth': this.expanded,
113
+ 'is-toggle': this.type === 'is-toggle-rounded'
114
+ }
115
+ ]
116
+ }
117
+ },
118
+ methods: {
119
+ giveFocusToTab(tab) {
120
+ if (tab.$el && tab.$el.focus) {
121
+ tab.$el.focus()
122
+ } else if (tab.focus) {
123
+ tab.focus()
124
+ }
125
+ },
126
+ manageTablistKeydown(event) {
127
+ // https://developer.mozilla.org/fr/docs/Web/API/KeyboardEvent/key/Key_Values#Navigation_keys
128
+ const { key } = event
129
+ switch (key) {
130
+ case this.vertical ? 'ArrowUp' : 'ArrowLeft':
131
+ case this.vertical ? 'Up' : 'Left': {
132
+ let prevIdx = this.getPrevItemIdx(this.currentFocus, true)
133
+ if (prevIdx === null) {
134
+ // We try to give focus back to the last visible element
135
+ prevIdx = this.getPrevItemIdx(this.items.length, true)
136
+ }
137
+ if (
138
+ prevIdx !== null &&
139
+ this.$refs.tabLink &&
140
+ prevIdx < this.$refs.tabLink.length &&
141
+ !this.items[prevIdx].disabled
142
+ ) {
143
+ this.giveFocusToTab(this.$refs.tabLink[prevIdx])
144
+ }
145
+ event.preventDefault()
146
+ break
147
+ }
148
+ case this.vertical ? 'ArrowDown' : 'ArrowRight':
149
+ case this.vertical ? 'Down' : 'Right': {
150
+ let nextIdx = this.getNextItemIdx(this.currentFocus, true)
151
+ if (nextIdx === null) {
152
+ // We try to give focus back to the first visible element
153
+ nextIdx = this.getNextItemIdx(-1, true)
154
+ }
155
+ if (
156
+ nextIdx !== null &&
157
+ this.$refs.tabLink &&
158
+ nextIdx < this.$refs.tabLink.length &&
159
+ !this.items[nextIdx].disabled
160
+ ) {
161
+ this.giveFocusToTab(this.$refs.tabLink[nextIdx])
162
+ }
163
+ event.preventDefault()
164
+ break
165
+ }
166
+ }
167
+ },
168
+
169
+ manageTabKeydown(event, childItem) {
170
+ // https://developer.mozilla.org/fr/docs/Web/API/KeyboardEvent/key/Key_Values#Navigation_keys
171
+ const { key } = event
172
+ switch (key) {
173
+ case ' ':
174
+ case 'Space':
175
+ case 'Spacebar':
176
+ case 'Enter': {
177
+ this.childClick(childItem)
178
+ event.preventDefault()
179
+ break
180
+ }
181
+ }
182
+ }
183
+ }
184
+ }
185
+ </script>
@@ -6,35 +6,32 @@ exports[`BTimepicker render correctly 1`] = `
6
6
  <b-dropdown-item-stub custom="true" focusable="true" ariarole="">
7
7
  <b-field-stub grouped="true" position="is-centered" addons="true">
8
8
  <b-select-stub usehtml5validation="true" statusicon="true" placeholder="00">
9
- <option value="0">
10
- 00
11
- </option>
12
9
  <option value="1">
13
- 01
10
+ 1
14
11
  </option>
15
12
  <option value="2">
16
- 02
13
+ 2
17
14
  </option>
18
15
  <option value="3">
19
- 03
16
+ 3
20
17
  </option>
21
18
  <option value="4">
22
- 04
19
+ 4
23
20
  </option>
24
21
  <option value="5">
25
- 05
22
+ 5
26
23
  </option>
27
24
  <option value="6">
28
- 06
25
+ 6
29
26
  </option>
30
27
  <option value="7">
31
- 07
28
+ 7
32
29
  </option>
33
30
  <option value="8">
34
- 08
31
+ 8
35
32
  </option>
36
33
  <option value="9">
37
- 09
34
+ 9
38
35
  </option>
39
36
  <option value="10">
40
37
  10
@@ -42,42 +39,9 @@ exports[`BTimepicker render correctly 1`] = `
42
39
  <option value="11">
43
40
  11
44
41
  </option>
45
- <option value="12">
42
+ <option value="0">
46
43
  12
47
44
  </option>
48
- <option value="13">
49
- 13
50
- </option>
51
- <option value="14">
52
- 14
53
- </option>
54
- <option value="15">
55
- 15
56
- </option>
57
- <option value="16">
58
- 16
59
- </option>
60
- <option value="17">
61
- 17
62
- </option>
63
- <option value="18">
64
- 18
65
- </option>
66
- <option value="19">
67
- 19
68
- </option>
69
- <option value="20">
70
- 20
71
- </option>
72
- <option value="21">
73
- 21
74
- </option>
75
- <option value="22">
76
- 22
77
- </option>
78
- <option value="23">
79
- 23
80
- </option>
81
45
  </b-select-stub> <span class="control is-colon">:</span>
82
46
  <b-select-stub usehtml5validation="true" statusicon="true" placeholder="00">
83
47
  <option value="0">
@@ -262,7 +226,14 @@ exports[`BTimepicker render correctly 1`] = `
262
226
  </option>
263
227
  </b-select-stub>
264
228
  <!---->
265
- <!---->
229
+ <b-select-stub usehtml5validation="true" statusicon="true" value="AM">
230
+ <option value="AM">
231
+ AM
232
+ </option>
233
+ <option value="PM">
234
+ PM
235
+ </option>
236
+ </b-select-stub>
266
237
  </b-field-stub>
267
238
  <!---->
268
239
  </b-dropdown-item-stub>
@@ -75,7 +75,7 @@ export default {
75
75
  /**
76
76
  * When v-model is changed:
77
77
  * 1. Set internal value.
78
- * 2. Reset interna input file value
78
+ * 2. Reset internal input file value
79
79
  * 3. If it's invalid, validate again.
80
80
  */
81
81
  value(value) {
@@ -104,8 +104,15 @@ export default {
104
104
  else {
105
105
  const file = value[0]
106
106
  if (this.checkType(file)) this.newValue = file
107
- else if (this.newValue) this.newValue = null
108
- else return
107
+ else if (this.newValue) {
108
+ this.newValue = null
109
+ this.clearInput()
110
+ } else {
111
+ // Force input back to empty state and recheck validity
112
+ this.clearInput()
113
+ this.checkHtml5Validity()
114
+ return
115
+ }
109
116
  }
110
117
  } else {
111
118
  // always new values if native or undefined local
@@ -127,6 +134,13 @@ export default {
127
134
  !this.dragDrop && this.checkHtml5Validity()
128
135
  },
129
136
 
137
+ /*
138
+ * Reset file input value
139
+ */
140
+ clearInput() {
141
+ this.$refs.input.value = null
142
+ },
143
+
130
144
  /**
131
145
  * Listen drag-drop to update internal variable
132
146
  */
@@ -149,10 +163,8 @@ export default {
149
163
  if (type) {
150
164
  if (type.substring(0, 1) === '.') {
151
165
  // check extension
152
- const extIndex = file.name.lastIndexOf('.')
153
- const extension = extIndex >= 0
154
- ? file.name.substring(extIndex) : ''
155
- if (extension.toLowerCase() === type.toLowerCase()) {
166
+ const extension = file.name.toLowerCase().slice(-type.length)
167
+ if (extension === type.toLowerCase()) {
156
168
  valid = true
157
169
  }
158
170
  } else {
@@ -126,11 +126,7 @@ export default {
126
126
  },
127
127
 
128
128
  showNotice() {
129
- if (this.shouldQueue()) {
130
- // Call recursively if should queue
131
- setTimeout(() => this.showNotice(), 250)
132
- return
133
- }
129
+ if (this.shouldQueue()) this.correctParent.innerHTML = ''
134
130
  this.correctParent.insertAdjacentElement('afterbegin', this.$el)
135
131
  this.isActive = true
136
132
 
@@ -31,7 +31,7 @@ let config = {
31
31
  defaultModalScroll: null,
32
32
  defaultDatepickerMobileNative: true,
33
33
  defaultTimepickerMobileNative: true,
34
- defaultNoticeQueue: true,
34
+ defaultNoticeQueue: false,
35
35
  defaultInputHasCounter: true,
36
36
  defaultTaginputHasCounter: true,
37
37
  defaultUseHtml5Validation: true,
@@ -174,6 +174,15 @@ export function escapeRegExpChars(value) {
174
174
  // eslint-disable-next-line
175
175
  return value.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, '\\$&')
176
176
  }
177
+ /**
178
+ * Remove accents/diacritics in a string in JavaScript
179
+ * https://stackoverflow.com/a/37511463
180
+ */
181
+ export function removeDiacriticsFromString(value) {
182
+ if (!value) return value
183
+
184
+ return value.normalize('NFD').replace(/[\u0300-\u036f]/g, '')
185
+ }
177
186
 
178
187
  export function multiColumnSort(inputArray, sortingPriority) {
179
188
  // clone it to prevent the any watchers from triggering every sorting iteration
@@ -289,3 +298,10 @@ export function isCustomElement(vm) {
289
298
  }
290
299
 
291
300
  export const isDefined = (d) => d !== undefined
301
+
302
+ /**
303
+ * Checks if a value is null or undefined.
304
+ * Based on
305
+ * https://github.com/lodash/lodash/blob/master/isNil.js
306
+ */
307
+ export const isNil = (value) => value !== null || value !== undefined
@@ -303,6 +303,11 @@ declare type BModalConfig = {
303
303
  */
304
304
  ariaModal?: boolean;
305
305
 
306
+ /**
307
+ * Aria label attribute to be passed to the close button for better accessibility.
308
+ */
309
+ closeButtonAriaLabel?: string;
310
+
306
311
  /**
307
312
  * CSS classes to be applied on modal
308
313
  */