quasar 2.4.13 → 2.5.3

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 (167) hide show
  1. package/dist/api/QCheckbox.json +27 -0
  2. package/dist/api/QRadio.json +18 -0
  3. package/dist/api/QTime.json +8 -2
  4. package/dist/api/QToggle.json +24 -24
  5. package/dist/icon-set/bootstrap-icons.umd.prod.js +1 -1
  6. package/dist/icon-set/eva-icons.umd.prod.js +1 -1
  7. package/dist/icon-set/fontawesome-v5-pro.umd.prod.js +1 -1
  8. package/dist/icon-set/fontawesome-v5.umd.prod.js +1 -1
  9. package/dist/icon-set/ionicons-v4.umd.prod.js +1 -1
  10. package/dist/icon-set/line-awesome.umd.prod.js +1 -1
  11. package/dist/icon-set/material-icons-outlined.umd.prod.js +1 -1
  12. package/dist/icon-set/material-icons-round.umd.prod.js +1 -1
  13. package/dist/icon-set/material-icons-sharp.umd.prod.js +1 -1
  14. package/dist/icon-set/material-icons.umd.prod.js +1 -1
  15. package/dist/icon-set/mdi-v3.umd.prod.js +1 -1
  16. package/dist/icon-set/mdi-v4.umd.prod.js +1 -1
  17. package/dist/icon-set/mdi-v5.umd.prod.js +1 -1
  18. package/dist/icon-set/mdi-v6.umd.prod.js +1 -1
  19. package/dist/icon-set/svg-bootstrap-icons.umd.prod.js +1 -1
  20. package/dist/icon-set/svg-eva-icons.umd.prod.js +1 -1
  21. package/dist/icon-set/svg-fontawesome-v5.umd.prod.js +1 -1
  22. package/dist/icon-set/svg-ionicons-v4.umd.prod.js +1 -1
  23. package/dist/icon-set/svg-ionicons-v5.umd.prod.js +1 -1
  24. package/dist/icon-set/svg-ionicons-v6.umd.prod.js +1 -1
  25. package/dist/icon-set/svg-line-awesome.umd.prod.js +1 -1
  26. package/dist/icon-set/svg-material-icons-outlined.umd.prod.js +1 -1
  27. package/dist/icon-set/svg-material-icons-round.umd.prod.js +1 -1
  28. package/dist/icon-set/svg-material-icons-sharp.umd.prod.js +1 -1
  29. package/dist/icon-set/svg-material-icons.umd.prod.js +1 -1
  30. package/dist/icon-set/svg-mdi-v4.umd.prod.js +1 -1
  31. package/dist/icon-set/svg-mdi-v5.umd.prod.js +1 -1
  32. package/dist/icon-set/svg-mdi-v6.umd.prod.js +1 -1
  33. package/dist/icon-set/svg-themify.umd.prod.js +1 -1
  34. package/dist/icon-set/themify.umd.prod.js +1 -1
  35. package/dist/lang/ar.umd.prod.js +1 -1
  36. package/dist/lang/az-Latn.umd.prod.js +1 -1
  37. package/dist/lang/bg.umd.prod.js +1 -1
  38. package/dist/lang/bn.umd.prod.js +1 -1
  39. package/dist/lang/ca.umd.prod.js +1 -1
  40. package/dist/lang/cs.umd.prod.js +1 -1
  41. package/dist/lang/da.umd.prod.js +1 -1
  42. package/dist/lang/de.umd.prod.js +1 -1
  43. package/dist/lang/el.umd.prod.js +1 -1
  44. package/dist/lang/en-GB.umd.prod.js +1 -1
  45. package/dist/lang/en-US.umd.prod.js +1 -1
  46. package/dist/lang/eo.umd.prod.js +1 -1
  47. package/dist/lang/es.umd.prod.js +1 -1
  48. package/dist/lang/et.umd.prod.js +1 -1
  49. package/dist/lang/fa-IR.umd.prod.js +1 -1
  50. package/dist/lang/fa.umd.prod.js +1 -1
  51. package/dist/lang/fi.umd.prod.js +1 -1
  52. package/dist/lang/fr.umd.prod.js +1 -1
  53. package/dist/lang/gn.umd.prod.js +1 -1
  54. package/dist/lang/he.umd.prod.js +1 -1
  55. package/dist/lang/hr.umd.prod.js +1 -1
  56. package/dist/lang/hu.umd.prod.js +1 -1
  57. package/dist/lang/id.umd.prod.js +1 -1
  58. package/dist/lang/is.umd.prod.js +1 -1
  59. package/dist/lang/it.umd.prod.js +1 -1
  60. package/dist/lang/ja.umd.prod.js +1 -1
  61. package/dist/lang/km.umd.prod.js +1 -1
  62. package/dist/lang/ko-KR.umd.prod.js +1 -1
  63. package/dist/lang/kur-CKB.umd.prod.js +1 -1
  64. package/dist/lang/lt.umd.prod.js +1 -1
  65. package/dist/lang/lu.umd.prod.js +1 -1
  66. package/dist/lang/lv.umd.prod.js +1 -1
  67. package/dist/lang/ml.umd.prod.js +1 -1
  68. package/dist/lang/ms.umd.prod.js +1 -1
  69. package/dist/lang/my.umd.prod.js +1 -1
  70. package/dist/lang/nb-NO.umd.prod.js +1 -1
  71. package/dist/lang/nl.umd.prod.js +1 -1
  72. package/dist/lang/pl.umd.prod.js +1 -1
  73. package/dist/lang/pt-BR.umd.prod.js +1 -1
  74. package/dist/lang/pt.umd.prod.js +1 -1
  75. package/dist/lang/ro.umd.prod.js +1 -1
  76. package/dist/lang/ru.umd.prod.js +1 -1
  77. package/dist/lang/sk.umd.prod.js +1 -1
  78. package/dist/lang/sl.umd.prod.js +1 -1
  79. package/dist/lang/sr-CYR.umd.prod.js +1 -1
  80. package/dist/lang/sr.umd.prod.js +1 -1
  81. package/dist/lang/sv.umd.prod.js +1 -1
  82. package/dist/lang/ta.umd.prod.js +1 -1
  83. package/dist/lang/th.umd.prod.js +1 -1
  84. package/dist/lang/tr.umd.prod.js +1 -1
  85. package/dist/lang/ug.umd.prod.js +1 -1
  86. package/dist/lang/uk.umd.prod.js +1 -1
  87. package/dist/lang/vi.umd.prod.js +1 -1
  88. package/dist/lang/zh-CN.umd.prod.js +1 -1
  89. package/dist/lang/zh-TW.umd.prod.js +1 -1
  90. package/dist/quasar.cjs.prod.js +2 -2
  91. package/dist/quasar.css +38 -10
  92. package/dist/quasar.esm.prod.js +2 -2
  93. package/dist/quasar.prod.css +1 -1
  94. package/dist/quasar.rtl.css +55 -23
  95. package/dist/quasar.rtl.prod.css +1 -1
  96. package/dist/quasar.sass +31 -11
  97. package/dist/quasar.umd.js +307 -158
  98. package/dist/quasar.umd.prod.js +2 -2
  99. package/dist/ssr-directives/Morph.js +1 -1
  100. package/dist/transforms/auto-import.json +39 -3
  101. package/dist/transforms/import-map.json +18 -0
  102. package/dist/types/index.d.ts +35 -13
  103. package/dist/types/utils/date.d.ts +25 -13
  104. package/dist/vetur/quasar-attributes.json +32 -12
  105. package/dist/vetur/quasar-tags.json +8 -3
  106. package/dist/web-types/web-types.json +73 -28
  107. package/package.json +13 -3
  108. package/src/components/avatar/__tests__/QAvatar.spec.js +121 -0
  109. package/src/components/badge/__tests__/QBadge.spec.js +74 -0
  110. package/src/components/breadcrumbs/QBreadcrumbs.js +1 -1
  111. package/src/components/btn/__tests__/QBtn.spec.js +55 -0
  112. package/src/components/btn/__tests__/use-btn.spec.js +189 -0
  113. package/src/components/checkbox/QCheckbox.js +34 -3
  114. package/src/components/checkbox/QCheckbox.json +17 -0
  115. package/src/components/checkbox/QCheckbox.sass +17 -5
  116. package/src/components/checkbox/use-checkbox.js +4 -0
  117. package/src/components/checkbox/use-checkbox.json +18 -0
  118. package/src/components/chip/__tests__/QChip.spec.js +155 -0
  119. package/src/components/date/__tests__/QDate.spec.js +189 -0
  120. package/src/components/date/__tests__/use-datetime.spec.js +83 -0
  121. package/src/components/dialog/__tests__/QDialog.spec.js +129 -0
  122. package/src/components/editor/__tests__/QEditor.spec.js +195 -0
  123. package/src/components/field/QField.sass +2 -0
  124. package/src/components/form/QForm.js +26 -24
  125. package/src/components/input/QInput.js +9 -0
  126. package/src/components/input/__tests__/QInput.spec.js +105 -0
  127. package/src/components/input/__tests__/use-mask.spec.js +29 -0
  128. package/src/components/menu/__tests__/QMenu.spec.js +610 -0
  129. package/src/components/menu/__tests__/WrapperOne.vue +51 -0
  130. package/src/components/menu/__tests__/WrapperTwo.vue +38 -0
  131. package/src/components/radio/QRadio.js +26 -1
  132. package/src/components/radio/QRadio.json +16 -0
  133. package/src/components/radio/QRadio.sass +17 -6
  134. package/src/components/select/QSelect.js +1 -1
  135. package/src/components/select/__tests__/QSelect.spec.js +2003 -0
  136. package/src/components/select/__tests__/WrapperOne.vue +28 -0
  137. package/src/components/table/__tests__/QTable.spec.js +635 -0
  138. package/src/components/table/__tests__/QTd.spec.js +35 -0
  139. package/src/components/table/__tests__/QTh.spec.js +27 -0
  140. package/src/components/table/__tests__/QTr.spec.js +27 -0
  141. package/src/components/tabs/__tests__/QRouteTab.spec.js +9 -0
  142. package/src/components/tabs/__tests__/QTab.spec.js +79 -0
  143. package/src/components/tabs/__tests__/QTabs.spec.js +147 -0
  144. package/src/components/time/QTime.json +2 -2
  145. package/src/components/toggle/QToggle.js +5 -13
  146. package/src/components/toggle/QToggle.json +3 -12
  147. package/src/components/tree/QTree.js +39 -41
  148. package/src/components/uploader/__tests__/QUploader.spec.js +161 -0
  149. package/src/composables/private/__tests__/FieldWrapper.vue +39 -0
  150. package/src/composables/private/__tests__/use-anchor.spec.js +99 -0
  151. package/src/composables/private/__tests__/use-field.spec.js +351 -0
  152. package/src/composables/private/__tests__/use-file.spec.js +69 -0
  153. package/src/composables/private/__tests__/use-form.spec.js +11 -0
  154. package/src/composables/private/__tests__/use-fullscreen.spec.js +37 -0
  155. package/src/composables/private/__tests__/use-model-toggle.spec.js +306 -0
  156. package/src/composables/private/__tests__/use-portal.spec.js +4 -0
  157. package/src/composables/private/__tests__/use-router-link.spec.js +55 -0
  158. package/src/composables/private/__tests__/use-size.spec.js +37 -0
  159. package/src/composables/private/__tests__/use-transition.spec.js +108 -0
  160. package/src/composables/private/__tests__/use-validate.spec.js +111 -0
  161. package/src/composables/private/use-fullscreen.js +1 -1
  162. package/src/composables/private/use-model-toggle.js +1 -1
  163. package/src/composables/private/use-validate.js +22 -22
  164. package/src/plugins/Meta.js +1 -1
  165. package/src/plugins/Screen.js +16 -9
  166. package/src/utils/date.js +111 -32
  167. package/src/utils/private/vm.js +14 -8
@@ -37,12 +37,16 @@ export default function (focused, innerLoading) {
37
37
  let validateIndex = 0, unwatchRules
38
38
 
39
39
  const hasRules = computed(() =>
40
- props.disable !== true
41
- && props.rules !== void 0
40
+ props.rules !== void 0
42
41
  && props.rules !== null
43
42
  && props.rules.length > 0
44
43
  )
45
44
 
45
+ const hasActiveRules = computed(() =>
46
+ props.disable !== true
47
+ && hasRules.value === true
48
+ )
49
+
46
50
  const hasError = computed(() =>
47
51
  props.error === true || innerError.value === true
48
52
  )
@@ -80,7 +84,14 @@ export default function (focused, innerLoading) {
80
84
  else if (isDirtyModel.value === false) {
81
85
  isDirtyModel.value = true
82
86
 
83
- if (hasRules.value === true && props.lazyRules !== 'ondemand') {
87
+ if (
88
+ hasActiveRules.value === true
89
+ && props.lazyRules !== 'ondemand'
90
+ // Don't re-trigger if it's already in progress;
91
+ // It might mean that focus switched to submit btn and
92
+ // QForm's submit() has been called already (ENTER key)
93
+ && innerLoading.value === false
94
+ ) {
84
95
  debouncedValidate()
85
96
  }
86
97
  }
@@ -102,11 +113,11 @@ export default function (focused, innerLoading) {
102
113
  * - Promise (pending async validation)
103
114
  */
104
115
  function validate (val = props.modelValue) {
105
- if (hasRules.value !== true) {
116
+ if (hasActiveRules.value !== true) {
106
117
  return true
107
118
  }
108
119
 
109
- validateIndex++
120
+ const index = ++validateIndex
110
121
 
111
122
  if (innerLoading.value !== true && props.lazyRules !== true) {
112
123
  isDirtyModel.value = true
@@ -123,9 +134,7 @@ export default function (focused, innerLoading) {
123
134
  innerErrorMessage.value = m
124
135
  }
125
136
 
126
- if (innerLoading.value !== false) {
127
- innerLoading.value = false
128
- }
137
+ innerLoading.value = false
129
138
  }
130
139
 
131
140
  const promises = []
@@ -155,42 +164,33 @@ export default function (focused, innerLoading) {
155
164
  return true
156
165
  }
157
166
 
158
- if (innerLoading.value !== true) {
159
- innerLoading.value = true
160
- }
161
-
162
- const index = validateIndex
167
+ innerLoading.value = true
163
168
 
164
169
  return Promise.all(promises).then(
165
170
  res => {
166
- if (index !== validateIndex) {
167
- return true
168
- }
169
-
170
171
  if (res === void 0 || Array.isArray(res) === false || res.length === 0) {
171
- update(false)
172
+ index === validateIndex && update(false)
172
173
  return true
173
174
  }
174
175
 
175
176
  const msg = res.find(r => r === false || typeof r === 'string')
176
- update(msg !== void 0, msg)
177
+ index === validateIndex && update(msg !== void 0, msg)
177
178
  return msg === void 0
178
179
  },
179
180
  e => {
180
181
  if (index === validateIndex) {
181
182
  console.error(e)
182
183
  update(true)
183
- return false
184
184
  }
185
185
 
186
- return true
186
+ return false
187
187
  }
188
188
  )
189
189
  }
190
190
 
191
191
  function validateIfNeeded (changedRules) {
192
192
  if (
193
- hasRules.value === true
193
+ hasActiveRules.value === true
194
194
  && props.lazyRules !== 'ondemand'
195
195
  && (isDirtyModel.value === true || (props.lazyRules !== true && changedRules !== true))
196
196
  ) {
@@ -140,7 +140,7 @@ function apply ({ add, remove }) {
140
140
  function getAttr (seed) {
141
141
  return att => {
142
142
  const val = seed[ att ]
143
- return att + (val !== void 0 ? `="${ val }"` : '')
143
+ return att + (val !== true && val !== void 0 ? `="${ val }"` : '')
144
144
  }
145
145
  }
146
146
 
@@ -1,4 +1,4 @@
1
- import { isRuntimeSsrPreHydration } from './Platform.js'
1
+ import { isRuntimeSsrPreHydration, client } from './Platform.js'
2
2
 
3
3
  import defineReactivePlugin from '../utils/private/define-reactive-plugin.js'
4
4
  import { listenOpts, noop } from '../utils/event.js'
@@ -58,12 +58,23 @@ export default defineReactivePlugin({
58
58
  return
59
59
  }
60
60
 
61
+ const { visualViewport } = window
62
+ const target = visualViewport || window
63
+ const scrollingElement = document.scrollingElement || document.documentElement
64
+ const getSize = visualViewport === void 0 || client.is.mobile === true
65
+ ? () => [
66
+ Math.max(window.innerWidth, scrollingElement.clientWidth),
67
+ Math.max(window.innerHeight, scrollingElement.clientHeight)
68
+ ]
69
+ : () => [
70
+ visualViewport.width * visualViewport.scale + window.innerWidth - scrollingElement.clientWidth,
71
+ visualViewport.height * visualViewport.scale + window.innerHeight - scrollingElement.clientHeight
72
+ ]
73
+
61
74
  const classes = $q.config.screen !== void 0 && $q.config.screen.bodyClasses === true
62
75
 
63
76
  this.__update = force => {
64
- const
65
- w = window.innerWidth,
66
- h = window.innerHeight
77
+ const [ w, h ] = getSize()
67
78
 
68
79
  if (h !== this.height) {
69
80
  this.height = h
@@ -121,11 +132,7 @@ export default defineReactivePlugin({
121
132
  }
122
133
 
123
134
  const start = () => {
124
- const
125
- style = getComputedStyle(document.body),
126
- target = window.visualViewport !== void 0
127
- ? window.visualViewport
128
- : window
135
+ const style = getComputedStyle(document.body)
129
136
 
130
137
  // if css props available
131
138
  if (style.getPropertyValue('--q-size-sm')) {
package/src/utils/date.js CHANGED
@@ -174,19 +174,18 @@ function formatTimezone (offset, delimeter = '') {
174
174
  function applyYearMonthDayChange (date, mod, sign) {
175
175
  let
176
176
  year = date.getFullYear(),
177
- month = date.getMonth(),
178
- day = date.getDate()
177
+ month = date.getMonth()
179
178
 
180
- if (mod.years !== void 0) {
181
- year += sign * mod.years
182
- }
179
+ const day = date.getDate()
183
180
 
184
- if (mod.months !== void 0) {
185
- month += sign * mod.months
181
+ if (mod.year !== void 0) {
182
+ year += sign * mod.year
183
+ delete mod.year
186
184
  }
187
185
 
188
- if (mod.days !== void 0) {
189
- day += sign * mod.days
186
+ if (mod.month !== void 0) {
187
+ month += sign * mod.month
188
+ delete mod.month
190
189
  }
191
190
 
192
191
  date.setDate(1)
@@ -194,26 +193,14 @@ function applyYearMonthDayChange (date, mod, sign) {
194
193
 
195
194
  date.setFullYear(year)
196
195
  date.setMonth(month)
197
- date.setDate(day)
198
-
199
- return date
200
- }
196
+ date.setDate(Math.min(day, daysInMonth(date)))
201
197
 
202
- function getChange (date, mod, sign) {
203
- const
204
- d = new Date(date),
205
- t = mod.years !== void 0 || mod.months !== void 0 || mod.days !== void 0
206
- ? applyYearMonthDayChange(d, mod, sign)
207
- : d
208
-
209
- for (const key in mod) {
210
- if (key !== 'years' && key !== 'months' && key !== 'days') {
211
- const op = capitalize(key)
212
- t[ `set${ op }` ](t[ `get${ op }` ]() + sign * mod[ key ])
213
- }
198
+ if (mod.date !== void 0) {
199
+ date.setDate(date.getDate() + sign * mod.date)
200
+ delete mod.date
214
201
  }
215
202
 
216
- return t
203
+ return date
217
204
  }
218
205
 
219
206
  function applyYearMonthDay (date, mod, middle) {
@@ -230,22 +217,86 @@ function applyYearMonthDay (date, mod, middle) {
230
217
  date[ `set${ middle }Month` ](month)
231
218
  date[ `set${ middle }Date` ](day)
232
219
 
220
+ delete mod.year
221
+ delete mod.month
222
+ delete mod.date
223
+
233
224
  return date
234
225
  }
235
226
 
236
- export function adjustDate (date, mod, utc) {
227
+ function getChange (date, rawMod, sign) {
237
228
  const
229
+ mod = normalizeMod(rawMod),
230
+ d = new Date(date),
231
+ t = mod.year !== void 0 || mod.month !== void 0 || mod.date !== void 0
232
+ ? applyYearMonthDayChange(d, mod, sign) // removes year/month/day
233
+ : d
234
+
235
+ for (const key in mod) {
236
+ const op = capitalize(key)
237
+ t[ `set${ op }` ](t[ `get${ op }` ]() + sign * mod[ key ])
238
+ }
239
+
240
+ return t
241
+ }
242
+
243
+ function normalizeMod (mod) {
244
+ const acc = { ...mod }
245
+
246
+ if (mod.years !== void 0) {
247
+ acc.year = mod.years
248
+ delete acc.years
249
+ }
250
+
251
+ if (mod.months !== void 0) {
252
+ acc.month = mod.months
253
+ delete acc.months
254
+ }
255
+
256
+ if (mod.days !== void 0) {
257
+ acc.date = mod.days
258
+ delete acc.days
259
+ }
260
+ if (mod.day !== void 0) {
261
+ acc.date = mod.day
262
+ delete acc.day
263
+ }
264
+
265
+ if (mod.hour !== void 0) {
266
+ acc.hours = mod.hour
267
+ delete acc.hour
268
+ }
269
+
270
+ if (mod.minute !== void 0) {
271
+ acc.minutes = mod.minute
272
+ delete acc.minute
273
+ }
274
+
275
+ if (mod.second !== void 0) {
276
+ acc.seconds = mod.second
277
+ delete acc.second
278
+ }
279
+
280
+ if (mod.millisecond !== void 0) {
281
+ acc.milliseconds = mod.millisecond
282
+ delete acc.millisecond
283
+ }
284
+
285
+ return acc
286
+ }
287
+
288
+ export function adjustDate (date, rawMod, utc) {
289
+ const
290
+ mod = normalizeMod(rawMod),
238
291
  middle = utc === true ? 'UTC' : '',
239
292
  d = new Date(date),
240
293
  t = mod.year !== void 0 || mod.month !== void 0 || mod.date !== void 0
241
- ? applyYearMonthDay(d, mod, middle)
294
+ ? applyYearMonthDay(d, mod, middle) // removes year/month/day
242
295
  : d
243
296
 
244
297
  for (const key in mod) {
245
- if (key !== 'year' && key !== 'month' && key !== 'date') {
246
- const op = key.charAt(0).toUpperCase() + key.slice(1)
247
- t[ `set${ middle }${ op }` ](mod[ key ])
248
- }
298
+ const op = key.charAt(0).toUpperCase() + key.slice(1)
299
+ t[ `set${ middle }${ op }` ](mod[ key ])
249
300
  }
250
301
 
251
302
  return t
@@ -479,16 +530,23 @@ export function startOfDate (date, unit, utc) {
479
530
 
480
531
  switch (unit) {
481
532
  case 'year':
533
+ case 'years':
482
534
  t[ `${ prefix }Month` ](0)
483
535
  case 'month':
536
+ case 'months':
484
537
  t[ `${ prefix }Date` ](1)
485
538
  case 'day':
539
+ case 'days':
540
+ case 'date':
486
541
  t[ `${ prefix }Hours` ](0)
487
542
  case 'hour':
543
+ case 'hours':
488
544
  t[ `${ prefix }Minutes` ](0)
489
545
  case 'minute':
546
+ case 'minutes':
490
547
  t[ `${ prefix }Seconds` ](0)
491
548
  case 'second':
549
+ case 'seconds':
492
550
  t[ `${ prefix }Milliseconds` ](0)
493
551
  }
494
552
  return t
@@ -501,16 +559,23 @@ export function endOfDate (date, unit, utc) {
501
559
 
502
560
  switch (unit) {
503
561
  case 'year':
562
+ case 'years':
504
563
  t[ `${ prefix }Month` ](11)
505
564
  case 'month':
565
+ case 'months':
506
566
  t[ `${ prefix }Date` ](daysInMonth(t))
507
567
  case 'day':
568
+ case 'days':
569
+ case 'date':
508
570
  t[ `${ prefix }Hours` ](23)
509
571
  case 'hour':
572
+ case 'hours':
510
573
  t[ `${ prefix }Minutes` ](59)
511
574
  case 'minute':
575
+ case 'minutes':
512
576
  t[ `${ prefix }Seconds` ](59)
513
577
  case 'second':
578
+ case 'seconds':
514
579
  t[ `${ prefix }Milliseconds` ](999)
515
580
  }
516
581
  return t
@@ -546,21 +611,28 @@ export function getDateDiff (date, subtract, unit = 'days') {
546
611
 
547
612
  switch (unit) {
548
613
  case 'years':
614
+ case 'year':
549
615
  return (t.getFullYear() - sub.getFullYear())
550
616
 
551
617
  case 'months':
618
+ case 'month':
552
619
  return (t.getFullYear() - sub.getFullYear()) * 12 + t.getMonth() - sub.getMonth()
553
620
 
554
621
  case 'days':
622
+ case 'day':
623
+ case 'date':
555
624
  return getDiff(startOfDate(t, 'day'), startOfDate(sub, 'day'), MILLISECONDS_IN_DAY)
556
625
 
557
626
  case 'hours':
627
+ case 'hour':
558
628
  return getDiff(startOfDate(t, 'hour'), startOfDate(sub, 'hour'), MILLISECONDS_IN_HOUR)
559
629
 
560
630
  case 'minutes':
631
+ case 'minute':
561
632
  return getDiff(startOfDate(t, 'minute'), startOfDate(sub, 'minute'), MILLISECONDS_IN_MINUTE)
562
633
 
563
634
  case 'seconds':
635
+ case 'second':
564
636
  return getDiff(startOfDate(t, 'second'), startOfDate(sub, 'second'), 1000)
565
637
  }
566
638
  }
@@ -606,26 +678,33 @@ export function isSameDate (date, date2, unit) {
606
678
 
607
679
  switch (unit) {
608
680
  case 'second':
681
+ case 'seconds':
609
682
  if (t.getSeconds() !== d.getSeconds()) {
610
683
  return false
611
684
  }
612
685
  case 'minute': // intentional fall-through
686
+ case 'minutes':
613
687
  if (t.getMinutes() !== d.getMinutes()) {
614
688
  return false
615
689
  }
616
690
  case 'hour': // intentional fall-through
691
+ case 'hours':
617
692
  if (t.getHours() !== d.getHours()) {
618
693
  return false
619
694
  }
620
695
  case 'day': // intentional fall-through
696
+ case 'days':
697
+ case 'date':
621
698
  if (t.getDate() !== d.getDate()) {
622
699
  return false
623
700
  }
624
701
  case 'month': // intentional fall-through
702
+ case 'months':
625
703
  if (t.getMonth() !== d.getMonth()) {
626
704
  return false
627
705
  }
628
706
  case 'year': // intentional fall-through
707
+ case 'years':
629
708
  if (t.getFullYear() !== d.getFullYear()) {
630
709
  return false
631
710
  }
@@ -15,19 +15,25 @@ export function getParentVm (vm) {
15
15
  }
16
16
  }
17
17
 
18
+ function fillNormalizedVNodes (children, vnode) {
19
+ if (typeof vnode.type === 'symbol') {
20
+ if (Array.isArray(vnode.children) === true) {
21
+ vnode.children.forEach(child => {
22
+ fillNormalizedVNodes(children, child)
23
+ })
24
+ }
25
+ }
26
+ else {
27
+ children.add(vnode)
28
+ }
29
+ }
30
+
18
31
  // vnodes from rendered in advanced slots
19
32
  export function getNormalizedVNodes (vnodes) {
20
33
  const children = new Set()
21
34
 
22
35
  vnodes.forEach(vnode => {
23
- if (typeof vnode.type === 'symbol' && Array.isArray(vnode.children) === true) {
24
- vnode.children.forEach(child => {
25
- children.add(child)
26
- })
27
- }
28
- else {
29
- children.add(vnode)
30
- }
36
+ fillNormalizedVNodes(children, vnode)
31
37
  })
32
38
 
33
39
  return Array.from(children)