vuetify 2.6.9 → 2.6.11

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 (49) hide show
  1. package/dist/json/web-types.json +33 -10
  2. package/dist/vuetify.css +7 -0
  3. package/dist/vuetify.css.map +1 -1
  4. package/dist/vuetify.js +50 -63
  5. package/dist/vuetify.js.map +1 -1
  6. package/dist/vuetify.min.css +2 -2
  7. package/dist/vuetify.min.js +2 -2
  8. package/es5/components/VCalendar/mixins/calendar-with-events.js +10 -13
  9. package/es5/components/VCalendar/mixins/calendar-with-events.js.map +1 -1
  10. package/es5/components/VDialog/VDialog.js +2 -2
  11. package/es5/components/VDialog/VDialog.js.map +1 -1
  12. package/es5/components/VInput/VInput.js +2 -1
  13. package/es5/components/VInput/VInput.js.map +1 -1
  14. package/es5/components/VSelect/VSelectList.js +6 -9
  15. package/es5/components/VSelect/VSelectList.js.map +1 -1
  16. package/es5/directives/click-outside/index.js +2 -2
  17. package/es5/directives/click-outside/index.js.map +1 -1
  18. package/es5/framework.js +1 -1
  19. package/es5/mixins/menuable/index.js +5 -1
  20. package/es5/mixins/menuable/index.js.map +1 -1
  21. package/es5/util/helpers.js +0 -13
  22. package/es5/util/helpers.js.map +1 -1
  23. package/lib/components/VCalendar/mixins/calendar-with-events.js +11 -14
  24. package/lib/components/VCalendar/mixins/calendar-with-events.js.map +1 -1
  25. package/lib/components/VDialog/VDialog.js +2 -2
  26. package/lib/components/VDialog/VDialog.js.map +1 -1
  27. package/lib/components/VInput/VInput.js +2 -1
  28. package/lib/components/VInput/VInput.js.map +1 -1
  29. package/lib/components/VSelect/VSelectList.js +7 -10
  30. package/lib/components/VSelect/VSelectList.js.map +1 -1
  31. package/lib/directives/click-outside/index.js +2 -2
  32. package/lib/directives/click-outside/index.js.map +1 -1
  33. package/lib/framework.js +1 -1
  34. package/lib/mixins/menuable/index.js +5 -1
  35. package/lib/mixins/menuable/index.js.map +1 -1
  36. package/lib/util/helpers.js +0 -8
  37. package/lib/util/helpers.js.map +1 -1
  38. package/package.json +2 -2
  39. package/src/components/VCalendar/mixins/calendar-with-events.ts +14 -13
  40. package/src/components/VDialog/VDialog.ts +2 -2
  41. package/src/components/VFileInput/__tests__/__snapshots__/VFileInput.spec.ts.snap +7 -0
  42. package/src/components/VInput/VInput.ts +1 -0
  43. package/src/components/VSelect/VSelectList.ts +10 -15
  44. package/src/components/VSelect/__tests__/__snapshots__/VSelect2.spec.ts.snap +2 -0
  45. package/src/components/VTextField/VTextField.sass +9 -0
  46. package/src/directives/click-outside/index.ts +2 -2
  47. package/src/mixins/menuable/index.ts +4 -1
  48. package/src/util/helpers.ts +0 -10
  49. package/types/index.d.ts +2 -2
@@ -10,9 +10,6 @@ import ripple from '../../../directives/ripple'
10
10
  // Mixins
11
11
  import CalendarBase from './calendar-base'
12
12
 
13
- // Helpers
14
- import { escapeHTML } from '../../../util/helpers'
15
-
16
13
  // Util
17
14
  import props from '../util/props'
18
15
  import {
@@ -116,7 +113,7 @@ export default CalendarBase.extend({
116
113
  eventNameFunction (): CalendarEventNameFunction {
117
114
  return typeof this.eventName === 'function'
118
115
  ? this.eventName
119
- : (event, timedEvent) => escapeHTML(event.input[this.eventName as string] as string || '')
116
+ : (event, timedEvent) => event.input[this.eventName as string] as string || ''
120
117
  },
121
118
  eventModeFunction (): CalendarEventOverlapMode {
122
119
  return typeof this.eventOverlapMode === 'function'
@@ -303,16 +300,23 @@ export default CalendarBase.extend({
303
300
  const eventSummary = () => {
304
301
  const name = this.eventNameFunction(event, timedEvent)
305
302
  if (event.start.hasTime) {
306
- const eventSummaryClass = 'v-event-summary'
307
303
  if (timedEvent) {
308
304
  const time = timeSummary()
309
- const delimiter = singline ? ', ' : '<br>'
305
+ const delimiter = singline ? ', ' : this.$createElement('br')
310
306
 
311
- return `<span class="${eventSummaryClass}"><strong>${name}</strong>${delimiter}${time}</span>`
307
+ return this.$createElement('span', { staticClass: 'v-event-summary' }, [
308
+ this.$createElement('strong', [name]),
309
+ delimiter,
310
+ time,
311
+ ])
312
312
  } else {
313
313
  const time = formatTime(event.start, true)
314
314
 
315
- return `<span class="${eventSummaryClass}"><strong>${time}</strong> ${name}</span>`
315
+ return this.$createElement('span', { staticClass: 'v-event-summary' }, [
316
+ this.$createElement('strong', [time]),
317
+ ' ',
318
+ name,
319
+ ])
316
320
  }
317
321
  }
318
322
 
@@ -345,13 +349,10 @@ export default CalendarBase.extend({
345
349
  : [this.genName(eventSummary)]
346
350
  )
347
351
  },
348
- genName (eventSummary: () => string): VNode {
352
+ genName (eventSummary: () => string | VNode): VNode {
349
353
  return this.$createElement('div', {
350
354
  staticClass: 'pl-1',
351
- domProps: {
352
- innerHTML: eventSummary(),
353
- },
354
- })
355
+ }, [eventSummary()])
355
356
  },
356
357
  genPlaceholder (day: CalendarTimestamp): VNode {
357
358
  const height = this.eventHeight + this.eventMarginBottom
@@ -234,8 +234,8 @@ export default baseMixins.extend({
234
234
  // So we must have focused something outside the dialog and its children
235
235
  ) {
236
236
  // Find and focus the first available element inside the dialog
237
- const focusable = this.$refs.dialog.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])')
238
- const el = [...focusable].find(el => !el.hasAttribute('disabled')) as HTMLElement | undefined
237
+ const focusable = this.$refs.dialog.querySelectorAll('button, [href], input:not([type="hidden"]), select, textarea, [tabindex]:not([tabindex="-1"])')
238
+ const el = [...focusable].find(el => !el.hasAttribute('disabled') && !el.matches('[tabindex="-1"]')) as HTMLElement | undefined
239
239
  el && el.focus()
240
240
  }
241
241
  },
@@ -61,6 +61,7 @@ exports[`VFileInput.ts should display file size 1`] = `
61
61
  <div class="v-input__icon v-input__icon--clear">
62
62
  <button type="button"
63
63
  aria-label="clear icon"
64
+ tabindex="-1"
64
65
  class="v-icon notranslate v-icon--link material-icons theme--light"
65
66
  >
66
67
  $clear
@@ -107,6 +108,7 @@ exports[`VFileInput.ts should display file size 2`] = `
107
108
  <div class="v-input__icon v-input__icon--clear">
108
109
  <button type="button"
109
110
  aria-label="clear icon"
111
+ tabindex="-1"
110
112
  class="v-icon notranslate v-icon--link material-icons theme--light"
111
113
  >
112
114
  $clear
@@ -153,6 +155,7 @@ exports[`VFileInput.ts should display total size in counter 1`] = `
153
155
  <div class="v-input__icon v-input__icon--clear">
154
156
  <button type="button"
155
157
  aria-label="clear icon"
158
+ tabindex="-1"
156
159
  class="v-icon notranslate v-icon--link material-icons theme--light"
157
160
  >
158
161
  $clear
@@ -202,6 +205,7 @@ exports[`VFileInput.ts should display total size in counter 2`] = `
202
205
  <div class="v-input__icon v-input__icon--clear">
203
206
  <button type="button"
204
207
  aria-label="clear icon"
208
+ tabindex="-1"
205
209
  class="v-icon notranslate v-icon--link material-icons theme--light"
206
210
  >
207
211
  $clear
@@ -294,6 +298,7 @@ exports[`VFileInput.ts should render chips 1`] = `
294
298
  <div class="v-input__icon v-input__icon--clear">
295
299
  <button type="button"
296
300
  aria-label="clear icon"
301
+ tabindex="-1"
297
302
  class="v-icon notranslate v-icon--link material-icons theme--light"
298
303
  >
299
304
  $clear
@@ -340,6 +345,7 @@ exports[`VFileInput.ts should render counter 1`] = `
340
345
  <div class="v-input__icon v-input__icon--clear">
341
346
  <button type="button"
342
347
  aria-label="clear icon"
348
+ tabindex="-1"
343
349
  class="v-icon notranslate v-icon--link material-icons theme--light"
344
350
  >
345
351
  $clear
@@ -433,6 +439,7 @@ exports[`VFileInput.ts should render small chips 1`] = `
433
439
  <div class="v-input__icon v-input__icon--clear">
434
440
  <button type="button"
435
441
  aria-label="clear icon"
442
+ tabindex="-1"
436
443
  class="v-icon notranslate v-icon--link material-icons theme--light"
437
444
  >
438
445
  $clear
@@ -184,6 +184,7 @@ export default baseMixins.extend<options>().extend({
184
184
  dark: this.dark,
185
185
  disabled: this.isDisabled,
186
186
  light: this.light,
187
+ tabindex: type === 'clear' ? -1 : undefined,
187
188
  },
188
189
  on: !hasListener
189
190
  ? undefined
@@ -18,10 +18,7 @@ import Colorable from '../../mixins/colorable'
18
18
  import Themeable from '../../mixins/themeable'
19
19
 
20
20
  // Helpers
21
- import {
22
- escapeHTML,
23
- getPropertyFromItem,
24
- } from '../../util/helpers'
21
+ import { getPropertyFromItem } from '../../util/helpers'
25
22
 
26
23
  // Types
27
24
  import mixins from '../../util/mixins'
@@ -113,17 +110,17 @@ export default mixins(Colorable, Themeable).extend({
113
110
  genFilteredText (text: string) {
114
111
  text = text || ''
115
112
 
116
- if (!this.searchInput || this.noFilter) return escapeHTML(text)
113
+ if (!this.searchInput || this.noFilter) return text
117
114
 
118
115
  const { start, middle, end } = this.getMaskedCharacters(text)
119
116
 
120
- return `${escapeHTML(start)}${this.genHighlight(middle)}${escapeHTML(end)}`
117
+ return [start, this.genHighlight(middle), end]
121
118
  },
122
119
  genHeader (props: { [key: string]: any }): VNode {
123
120
  return this.$createElement(VSubheader, { props }, props.header)
124
121
  },
125
- genHighlight (text: string): string {
126
- return `<span class="v-list-item__mask">${escapeHTML(text)}</span>`
122
+ genHighlight (text: string) {
123
+ return this.$createElement('span', { staticClass: 'v-list-item__mask' }, text)
127
124
  },
128
125
  getMaskedCharacters (text: string): {
129
126
  start: string
@@ -202,13 +199,11 @@ export default mixins(Colorable, Themeable).extend({
202
199
  : scopedSlot
203
200
  },
204
201
  genTileContent (item: any, index = 0): VNode {
205
- const innerHTML = this.genFilteredText(this.getText(item))
206
-
207
- return this.$createElement(VListItemContent,
208
- [this.$createElement(VListItemTitle, {
209
- domProps: { innerHTML },
210
- })]
211
- )
202
+ return this.$createElement(VListItemContent, [
203
+ this.$createElement(VListItemTitle, [
204
+ this.genFilteredText(this.getText(item)),
205
+ ]),
206
+ ])
212
207
  },
213
208
  hasItem (item: object) {
214
209
  return this.parsedItems.indexOf(this.getValue(item)) > -1
@@ -25,6 +25,7 @@ exports[`VSelect.ts should be clearable with prop, dirty and multi select 1`] =
25
25
  <div class="v-input__icon v-input__icon--clear">
26
26
  <button type="button"
27
27
  aria-label="clear icon"
28
+ tabindex="-1"
28
29
  class="v-icon notranslate v-icon--link material-icons theme--light"
29
30
  >
30
31
  $clear
@@ -85,6 +86,7 @@ exports[`VSelect.ts should be clearable with prop, dirty and single select 1`] =
85
86
  <div class="v-input__icon v-input__icon--clear">
86
87
  <button type="button"
87
88
  aria-label="clear icon"
89
+ tabindex="-1"
88
90
  class="v-icon notranslate v-icon--link material-icons theme--light"
89
91
  >
90
92
  $clear
@@ -504,6 +504,15 @@
504
504
  &.v-input--has-state > .v-input__control > .v-input__slot:before
505
505
  border-color: currentColor
506
506
 
507
+ .v-input__icon--clear
508
+ opacity: 0
509
+ transition: opacity $primary-transition
510
+
511
+ &.v-input--is-focused,
512
+ &.v-input--is-dirty:hover
513
+ .v-input__icon--clear
514
+ opacity: 1
515
+
507
516
  // TODO: where are the corresponding rules for LTR?
508
517
  //
509
518
  // +rtl()
@@ -53,7 +53,7 @@ function checkIsActive (e: PointerEvent, binding: ClickOutsideDirective): boolea
53
53
  return isActive(e)
54
54
  }
55
55
 
56
- function directive (e: PointerEvent, el: HTMLElement, binding: ClickOutsideDirective, vnode: VNode) {
56
+ function directive (e: PointerEvent, el: HTMLElement, binding: ClickOutsideDirective) {
57
57
  const handler = typeof binding.value === 'function' ? binding.value : binding.value!.handler
58
58
 
59
59
  el._clickOutside!.lastMousedownWasOutside && checkEvent(e, el, binding) && setTimeout(() => {
@@ -78,7 +78,7 @@ export const ClickOutside = {
78
78
  // available, iOS does not support
79
79
  // clicks on body
80
80
  inserted (el: HTMLElement, binding: ClickOutsideDirective, vnode: VNode) {
81
- const onClick = (e: Event) => directive(e as PointerEvent, el, binding, vnode)
81
+ const onClick = (e: Event) => directive(e as PointerEvent, el, binding)
82
82
  const onMousedown = (e: Event) => {
83
83
  el._clickOutside!.lastMousedownWasOutside = checkEvent(e as PointerEvent, el, binding)
84
84
  }
@@ -281,7 +281,10 @@ export default baseMixins.extend<options>().extend({
281
281
  }
282
282
  },
283
283
  checkActivatorFixed () {
284
- if (this.attach !== false) return
284
+ if (this.attach !== false) {
285
+ this.activatorFixed = false
286
+ return
287
+ }
285
288
  let el = this.getActivator()
286
289
  while (el) {
287
290
  if (window.getComputedStyle(el).position === 'fixed') {
@@ -162,16 +162,6 @@ export function getZIndex (el?: Element | null): number {
162
162
  return index
163
163
  }
164
164
 
165
- const tagsToReplace = {
166
- '&': '&amp;',
167
- '<': '&lt;',
168
- '>': '&gt;',
169
- } as any
170
-
171
- export function escapeHTML (str: string): string {
172
- return str.replace(/[&<>]/g, tag => tagsToReplace[tag] || tag)
173
- }
174
-
175
165
  export function filterObjectOnKeys<T, K extends keyof T> (obj: T, keys: K[]): { [N in K]: T[N] } {
176
166
  const filtered = {} as { [N in K]: T[N] }
177
167
 
package/types/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import Vue, { Component, PluginFunction, VueConstructor, DirectiveOptions } from 'vue'
1
+ import Vue, { Component, PluginFunction, VueConstructor, DirectiveOptions, VNode } from 'vue'
2
2
  import './lib'
3
3
  import './alacarte'
4
4
  import './colors'
@@ -275,7 +275,7 @@ export type CalendarEventTimedFunction = (event: CalendarEvent) => boolean
275
275
 
276
276
  export type CalendarEventCategoryFunction = (event: CalendarEvent) => string
277
277
 
278
- export type CalendarEventNameFunction = (event: CalendarEventParsed, timedEvent: boolean) => string
278
+ export type CalendarEventNameFunction = (event: CalendarEventParsed, timedEvent: boolean) => string | VNode
279
279
 
280
280
  export type DataTableFilterFunction = (value: any, search: string | null, item: any) => boolean
281
281