@dimailn/vuetify 2.7.2-alpha49 → 2.7.2-alpha50
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/dist/vuetify.js +28 -10
- package/dist/vuetify.js.map +1 -1
- package/dist/vuetify.min.css +1 -1
- package/dist/vuetify.min.js +2 -2
- package/es5/components/VPicker/VPicker.js +4 -1
- package/es5/components/VPicker/VPicker.js.map +1 -1
- package/es5/framework.js +1 -1
- package/es5/mixins/picker/index.js +8 -7
- package/es5/mixins/picker/index.js.map +1 -1
- package/es5/util/helpers.js +16 -0
- package/es5/util/helpers.js.map +1 -1
- package/lib/components/VPicker/VPicker.js +6 -2
- package/lib/components/VPicker/VPicker.js.map +1 -1
- package/lib/framework.js +1 -1
- package/lib/mixins/picker/index.js +7 -4
- package/lib/mixins/picker/index.js.map +1 -1
- package/lib/util/helpers.js +13 -1
- package/lib/util/helpers.js.map +1 -1
- package/package.json +1 -1
- package/src/components/VDatePicker/__tests__/VDatePicker.date.spec.ts +11 -0
- package/src/components/VDatePicker/__tests__/__snapshots__/VDatePicker.date.spec.ts.snap +0 -16
- package/src/components/VDatePicker/__tests__/__snapshots__/VDatePicker.month.spec.ts.snap +0 -10
- package/src/components/VPicker/VPicker.ts +5 -2
- package/src/components/VPicker/__tests__/VPicker.spec.ts +22 -0
- package/src/components/VTimePicker/__tests__/__snapshots__/VTimePicker.spec.ts.snap +0 -40
- package/src/mixins/picker/index.ts +9 -8
- package/src/util/__tests__/helpers.spec.ts +62 -1
- package/src/util/helpers.ts +17 -1
package/src/util/helpers.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent, h, resolveComponent } from 'vue'
|
|
1
|
+
import { defineComponent, h, resolveComponent, Comment } from 'vue'
|
|
2
2
|
import type { VNode, VNodeDirective } from '../types/vue-internal'
|
|
3
3
|
import { VuetifyIcon } from 'vuetify/types/services/icons'
|
|
4
4
|
import { DataTableCompareFunction, SelectItemKey, ItemGroup } from 'vuetify/types'
|
|
@@ -441,6 +441,22 @@ export function getSlot (vm: Vue, name = 'default', data?: object | (() => objec
|
|
|
441
441
|
return undefined
|
|
442
442
|
}
|
|
443
443
|
|
|
444
|
+
export function flattenSlotContent (content: VNode | VNode[] | null | undefined): VNode[] {
|
|
445
|
+
if (content == null) return []
|
|
446
|
+
|
|
447
|
+
const items = Array.isArray(content) ? content : [content]
|
|
448
|
+
|
|
449
|
+
return items.flatMap((item) => {
|
|
450
|
+
if (item == null || item.type === Comment) return []
|
|
451
|
+
if (Array.isArray(item)) return flattenSlotContent(item)
|
|
452
|
+
return [item]
|
|
453
|
+
})
|
|
454
|
+
}
|
|
455
|
+
|
|
456
|
+
export function hasSlotContent (content: VNode | VNode[] | null | undefined): boolean {
|
|
457
|
+
return flattenSlotContent(content).length > 0
|
|
458
|
+
}
|
|
459
|
+
|
|
444
460
|
export function clamp (value: number, min = 0, max = 1) {
|
|
445
461
|
return Math.max(min, Math.min(max, value))
|
|
446
462
|
}
|