@vuetify/nightly 3.0.0-beta.3 → 3.0.0-beta.6
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/CHANGELOG.md +43 -2
- package/dist/_component-variables.sass +61 -0
- package/dist/json/attributes.json +261 -205
- package/dist/json/importMap.json +175 -219
- package/dist/json/tags.json +74 -104
- package/dist/json/web-types.json +880 -835
- package/dist/vuetify.css +597 -407
- package/dist/vuetify.d.ts +6770 -2144
- package/dist/vuetify.esm.js +9075 -8454
- package/dist/vuetify.esm.js.map +1 -1
- package/dist/vuetify.js +9074 -8453
- package/dist/vuetify.js.map +1 -1
- package/dist/vuetify.min.css +2 -2
- package/dist/vuetify.min.js +1078 -1040
- package/dist/vuetify.min.js.map +1 -1
- package/lib/blueprints/index.mjs +4 -0
- package/lib/blueprints/index.mjs.map +1 -0
- package/lib/blueprints/md1.mjs +63 -0
- package/lib/blueprints/md1.mjs.map +1 -0
- package/lib/blueprints/md2.mjs +60 -0
- package/lib/blueprints/md2.mjs.map +1 -0
- package/lib/blueprints/md3.mjs +74 -0
- package/lib/blueprints/md3.mjs.map +1 -0
- package/lib/components/VAlert/VAlert.css +5 -5
- package/lib/components/VAlert/VAlert.mjs +8 -2
- package/lib/components/VAlert/VAlert.mjs.map +1 -1
- package/lib/components/VAlert/VAlert.sass +0 -2
- package/lib/components/VApp/VApp.css +2 -5
- package/lib/components/VApp/VApp.mjs +3 -4
- package/lib/components/VApp/VApp.mjs.map +1 -1
- package/lib/components/VApp/VApp.sass +11 -12
- package/lib/components/VApp/variables.scss +6 -0
- package/lib/components/VAppBar/VAppBar.mjs +4 -3
- package/lib/components/VAppBar/VAppBar.mjs.map +1 -1
- package/lib/components/VAppBar/VAppBar.sass +0 -1
- package/lib/components/VAppBar/VAppBarNavIcon.mjs +7 -12
- package/lib/components/VAppBar/VAppBarNavIcon.mjs.map +1 -1
- package/lib/components/VAppBar/VAppBarTitle.mjs +4 -3
- package/lib/components/VAppBar/VAppBarTitle.mjs.map +1 -1
- package/lib/components/VAppBar/_variables.scss +2 -0
- package/lib/components/VAutocomplete/VAutocomplete.mjs +54 -21
- package/lib/components/VAutocomplete/VAutocomplete.mjs.map +1 -1
- package/lib/components/VAutocomplete/VAutocomplete.sass +0 -2
- package/lib/components/VAvatar/VAvatar.css +1 -1
- package/lib/components/VAvatar/VAvatar.mjs.map +1 -1
- package/lib/components/VAvatar/VAvatar.sass +1 -2
- package/lib/components/VAvatar/_mixins.scss +0 -1
- package/lib/components/VBadge/VBadge.mjs +8 -7
- package/lib/components/VBadge/VBadge.mjs.map +1 -1
- package/lib/components/VBadge/VBadge.sass +0 -1
- package/lib/components/VBadge/_variables.scss +2 -2
- package/lib/components/VBanner/VBanner.css +7 -7
- package/lib/components/VBanner/VBanner.mjs +24 -17
- package/lib/components/VBanner/VBanner.mjs.map +1 -1
- package/lib/components/VBanner/VBanner.sass +6 -8
- package/lib/components/VBanner/VBannerActions.mjs +1 -1
- package/lib/components/VBanner/VBannerActions.mjs.map +1 -1
- package/lib/components/VBanner/index.mjs +0 -2
- package/lib/components/VBanner/index.mjs.map +1 -1
- package/lib/components/VBottomNavigation/VBottomNavigation.css +4 -11
- package/lib/components/VBottomNavigation/VBottomNavigation.mjs +4 -3
- package/lib/components/VBottomNavigation/VBottomNavigation.mjs.map +1 -1
- package/lib/components/VBottomNavigation/VBottomNavigation.sass +5 -13
- package/lib/components/VBottomNavigation/_variables.scss +7 -8
- package/lib/components/VBreadcrumbs/VBreadcrumbs.css +13 -6
- package/lib/components/VBreadcrumbs/VBreadcrumbs.mjs +30 -19
- package/lib/components/VBreadcrumbs/VBreadcrumbs.mjs.map +1 -1
- package/lib/components/VBreadcrumbs/VBreadcrumbs.sass +8 -4
- package/lib/components/VBreadcrumbs/VBreadcrumbsItem.mjs +5 -8
- package/lib/components/VBreadcrumbs/VBreadcrumbsItem.mjs.map +1 -1
- package/lib/components/VBreadcrumbs/_variables.scss +2 -1
- package/lib/components/VBtn/VBtn.css +72 -15
- package/lib/components/VBtn/VBtn.mjs +70 -27
- package/lib/components/VBtn/VBtn.mjs.map +1 -1
- package/lib/components/VBtn/VBtn.sass +70 -13
- package/lib/components/VBtn/_variables.scss +4 -1
- package/lib/components/VBtnGroup/VBtnGroup.sass +0 -1
- package/lib/components/VBtnGroup/_variables.scss +2 -0
- package/lib/components/VBtnToggle/VBtnToggle.sass +0 -1
- package/lib/components/VBtnToggle/_variables.scss +1 -0
- package/lib/components/VCard/VCard.css +86 -69
- package/lib/components/VCard/VCard.mjs +52 -66
- package/lib/components/VCard/VCard.mjs.map +1 -1
- package/lib/components/VCard/VCard.sass +74 -62
- package/lib/components/VCard/VCardActions.mjs +1 -1
- package/lib/components/VCard/VCardActions.mjs.map +1 -1
- package/lib/components/VCard/VCardItem.mjs +88 -0
- package/lib/components/VCard/VCardItem.mjs.map +1 -0
- package/lib/components/VCard/_variables.scss +40 -24
- package/lib/components/VCard/index.mjs +1 -5
- package/lib/components/VCard/index.mjs.map +1 -1
- package/lib/components/VCarousel/VCarousel.mjs +5 -4
- package/lib/components/VCarousel/VCarousel.mjs.map +1 -1
- package/lib/components/VCarousel/VCarousel.sass +0 -1
- package/lib/components/VCarousel/VCarouselItem.mjs.map +1 -1
- package/lib/components/VCarousel/_variables.scss +1 -0
- package/lib/components/VCheckbox/VCheckbox.mjs +13 -46
- package/lib/components/VCheckbox/VCheckbox.mjs.map +1 -1
- package/lib/components/VCheckbox/VCheckbox.sass +0 -1
- package/lib/components/VCheckbox/VCheckboxBtn.mjs +67 -0
- package/lib/components/VCheckbox/VCheckboxBtn.mjs.map +1 -0
- package/lib/components/VCheckbox/index.mjs +1 -0
- package/lib/components/VCheckbox/index.mjs.map +1 -1
- package/lib/components/VChip/VChip.css +142 -65
- package/lib/components/VChip/VChip.mjs +77 -38
- package/lib/components/VChip/VChip.mjs.map +1 -1
- package/lib/components/VChip/VChip.sass +6 -1
- package/lib/components/VChip/_mixins.scss +26 -6
- package/lib/components/VChip/_variables.scss +1 -5
- package/lib/components/VChipGroup/VChipGroup.mjs +5 -4
- package/lib/components/VChipGroup/VChipGroup.mjs.map +1 -1
- package/lib/components/VChipGroup/VChipGroup.sass +1 -1
- package/lib/components/VChipGroup/_variables.scss +1 -1
- package/lib/components/VCode/VCode.sass +1 -2
- package/lib/components/VCode/_variables.scss +1 -1
- package/lib/components/VColorPicker/VColorPicker.mjs +16 -10
- package/lib/components/VColorPicker/VColorPicker.mjs.map +1 -1
- package/lib/components/VColorPicker/VColorPicker.sass +0 -1
- package/lib/components/VColorPicker/VColorPickerCanvas.mjs +5 -4
- package/lib/components/VColorPicker/VColorPickerCanvas.mjs.map +1 -1
- package/lib/components/VColorPicker/VColorPickerCanvas.sass +0 -1
- package/lib/components/VColorPicker/VColorPickerEdit.mjs +4 -3
- package/lib/components/VColorPicker/VColorPickerEdit.mjs.map +1 -1
- package/lib/components/VColorPicker/VColorPickerEdit.sass +0 -1
- package/lib/components/VColorPicker/VColorPickerPreview.mjs +4 -3
- package/lib/components/VColorPicker/VColorPickerPreview.mjs.map +1 -1
- package/lib/components/VColorPicker/VColorPickerPreview.sass +0 -1
- package/lib/components/VColorPicker/VColorPickerSwatches.mjs +6 -5
- package/lib/components/VColorPicker/VColorPickerSwatches.mjs.map +1 -1
- package/lib/components/VColorPicker/VColorPickerSwatches.sass +0 -1
- package/lib/components/VColorPicker/_variables.scss +17 -10
- package/lib/components/VCombobox/VCombobox.mjs +52 -36
- package/lib/components/VCombobox/VCombobox.mjs.map +1 -1
- package/lib/components/VCombobox/VCombobox.sass +0 -2
- package/lib/components/VCounter/VCounter.mjs +16 -16
- package/lib/components/VCounter/VCounter.mjs.map +1 -1
- package/lib/components/VCounter/VCounter.sass +1 -2
- package/lib/components/VCounter/_variables.scss +2 -1
- package/lib/components/VDialog/VDialog.css +2 -5
- package/lib/components/VDialog/VDialog.mjs +25 -25
- package/lib/components/VDialog/VDialog.mjs.map +1 -1
- package/lib/components/VDialog/VDialog.sass +1 -5
- package/lib/components/VDialog/_variables.scss +0 -1
- package/lib/components/VDivider/VDivider.mjs +16 -17
- package/lib/components/VDivider/VDivider.mjs.map +1 -1
- package/lib/components/VDivider/VDivider.sass +0 -1
- package/lib/components/VDivider/_variables.scss +3 -1
- package/lib/components/VExpansionPanel/VExpansionPanel.css +1 -0
- package/lib/components/VExpansionPanel/VExpansionPanel.mjs +9 -4
- package/lib/components/VExpansionPanel/VExpansionPanel.mjs.map +1 -1
- package/lib/components/VExpansionPanel/VExpansionPanel.sass +1 -1
- package/lib/components/VExpansionPanel/VExpansionPanelTitle.mjs +7 -7
- package/lib/components/VExpansionPanel/VExpansionPanelTitle.mjs.map +1 -1
- package/lib/components/VExpansionPanel/VExpansionPanels.mjs.map +1 -1
- package/lib/components/VExpansionPanel/_variables.scss +15 -10
- package/lib/components/VField/VField.css +11 -11
- package/lib/components/VField/VField.mjs +19 -12
- package/lib/components/VField/VField.mjs.map +1 -1
- package/lib/components/VField/VField.sass +8 -10
- package/lib/components/VField/VFieldLabel.mjs +8 -9
- package/lib/components/VField/VFieldLabel.mjs.map +1 -1
- package/lib/components/VField/_variables.scss +3 -3
- package/lib/components/VFileInput/VFileInput.css +3 -3
- package/lib/components/VFileInput/VFileInput.mjs +12 -7
- package/lib/components/VFileInput/VFileInput.mjs.map +1 -1
- package/lib/components/VFileInput/VFileInput.sass +3 -4
- package/lib/components/VFooter/VFooter.mjs +4 -3
- package/lib/components/VFooter/VFooter.mjs.map +1 -1
- package/lib/components/VFooter/VFooter.sass +0 -1
- package/lib/components/VFooter/_variables.scss +2 -1
- package/lib/components/VForm/VForm.mjs +3 -3
- package/lib/components/VForm/VForm.mjs.map +1 -1
- package/lib/components/VGrid/VCol.mjs.map +1 -1
- package/lib/components/VGrid/VContainer.mjs +4 -3
- package/lib/components/VGrid/VContainer.mjs.map +1 -1
- package/lib/components/VGrid/VRow.mjs.map +1 -1
- package/lib/components/VIcon/VIcon.css +0 -8
- package/lib/components/VIcon/VIcon.mjs +20 -21
- package/lib/components/VIcon/VIcon.mjs.map +1 -1
- package/lib/components/VIcon/VIcon.sass +0 -9
- package/lib/components/VIcon/_variables.scss +2 -5
- package/lib/components/VIcon/index.mjs.map +1 -1
- package/lib/components/VImg/VImg.sass +0 -1
- package/lib/components/VInput/VInput.mjs +13 -9
- package/lib/components/VInput/VInput.mjs.map +1 -1
- package/lib/components/VInput/VInput.sass +0 -1
- package/lib/components/VItemGroup/VItem.mjs +3 -0
- package/lib/components/VItemGroup/VItem.mjs.map +1 -1
- package/lib/components/VItemGroup/VItemGroup.sass +0 -1
- package/lib/components/VKbd/VKbd.sass +0 -1
- package/lib/components/VKbd/_variables.scss +1 -1
- package/lib/components/VLabel/VLabel.mjs +4 -3
- package/lib/components/VLabel/VLabel.mjs.map +1 -1
- package/lib/components/VLabel/VLabel.sass +0 -1
- package/lib/components/VLabel/_variables.scss +1 -0
- package/lib/components/VLazy/VLazy.mjs +5 -3
- package/lib/components/VLazy/VLazy.mjs.map +1 -1
- package/lib/components/VList/VList.css +2 -2
- package/lib/components/VList/VList.mjs +16 -18
- package/lib/components/VList/VList.mjs.map +1 -1
- package/lib/components/VList/VList.sass +1 -2
- package/lib/components/VList/VListChildren.mjs +7 -6
- package/lib/components/VList/VListChildren.mjs.map +1 -1
- package/lib/components/VList/VListGroup.mjs +45 -31
- package/lib/components/VList/VListGroup.mjs.map +1 -1
- package/lib/components/VList/VListItem.css +84 -58
- package/lib/components/VList/VListItem.mjs +78 -45
- package/lib/components/VList/VListItem.mjs.map +1 -1
- package/lib/components/VList/VListItem.sass +68 -40
- package/lib/components/VList/VListItemAction.mjs +8 -9
- package/lib/components/VList/VListItemAction.mjs.map +1 -1
- package/lib/components/VList/VListItemMedia.mjs +4 -3
- package/lib/components/VList/VListItemMedia.mjs.map +1 -1
- package/lib/components/VList/VListSubheader.mjs +4 -3
- package/lib/components/VList/VListSubheader.mjs.map +1 -1
- package/lib/components/VList/_variables.scss +11 -5
- package/lib/components/VList/index.mjs +2 -5
- package/lib/components/VList/index.mjs.map +1 -1
- package/lib/components/VLocaleProvider/VLocaleProvider.mjs +5 -3
- package/lib/components/VLocaleProvider/VLocaleProvider.mjs.map +1 -1
- package/lib/components/VMain/VMain.mjs +4 -3
- package/lib/components/VMain/VMain.mjs.map +1 -1
- package/lib/components/VMain/VMain.sass +0 -1
- package/lib/components/VMain/_variables.scss +1 -1
- package/lib/components/VMenu/VMenu.mjs +5 -5
- package/lib/components/VMenu/VMenu.mjs.map +1 -1
- package/lib/components/VMenu/VMenu.sass +0 -1
- package/lib/components/VMessages/VMessages.mjs +5 -3
- package/lib/components/VMessages/VMessages.mjs.map +1 -1
- package/lib/components/VMessages/VMessages.sass +0 -1
- package/lib/components/VMessages/_variables.scss +1 -1
- package/lib/components/VNavigationDrawer/VNavigationDrawer.mjs +10 -4
- package/lib/components/VNavigationDrawer/VNavigationDrawer.mjs.map +1 -1
- package/lib/components/VNavigationDrawer/VNavigationDrawer.sass +0 -1
- package/lib/components/VNavigationDrawer/_variables.scss +2 -1
- package/lib/components/VNavigationDrawer/touch.mjs +5 -2
- package/lib/components/VNavigationDrawer/touch.mjs.map +1 -1
- package/lib/components/VNoSsr/VNoSsr.mjs.map +1 -1
- package/lib/components/VOverlay/VOverlay.mjs +10 -8
- package/lib/components/VOverlay/VOverlay.mjs.map +1 -1
- package/lib/components/VOverlay/VOverlay.sass +0 -1
- package/lib/components/VOverlay/locationStrategies.mjs +267 -78
- package/lib/components/VOverlay/locationStrategies.mjs.map +1 -1
- package/lib/components/VOverlay/useActivator.mjs +4 -3
- package/lib/components/VOverlay/useActivator.mjs.map +1 -1
- package/lib/components/VOverlay/util/point.mjs +3 -3
- package/lib/components/VOverlay/util/point.mjs.map +1 -1
- package/lib/components/VPagination/VPagination.mjs +41 -23
- package/lib/components/VPagination/VPagination.mjs.map +1 -1
- package/lib/components/VPagination/VPagination.sass +0 -1
- package/lib/components/VParallax/VParallax.mjs +5 -5
- package/lib/components/VParallax/VParallax.mjs.map +1 -1
- package/lib/components/VProgressCircular/VProgressCircular.mjs +6 -5
- package/lib/components/VProgressCircular/VProgressCircular.mjs.map +1 -1
- package/lib/components/VProgressCircular/VProgressCircular.sass +0 -1
- package/lib/components/VProgressCircular/_variables.scss +2 -0
- package/lib/components/VProgressLinear/VProgressLinear.mjs +5 -3
- package/lib/components/VProgressLinear/VProgressLinear.mjs.map +1 -1
- package/lib/components/VProgressLinear/VProgressLinear.sass +0 -1
- package/lib/components/VProgressLinear/_variables.scss +1 -0
- package/lib/components/VRadioGroup/VRadioGroup.mjs +6 -3
- package/lib/components/VRadioGroup/VRadioGroup.mjs.map +1 -1
- package/lib/components/VRadioGroup/VRadioGroup.sass +5 -3
- package/lib/components/VRadioGroup/_variables.scss +3 -4
- package/lib/components/VRangeSlider/VRangeSlider.mjs +12 -13
- package/lib/components/VRangeSlider/VRangeSlider.mjs.map +1 -1
- package/lib/components/VRating/VRating.mjs +6 -5
- package/lib/components/VRating/VRating.mjs.map +1 -1
- package/lib/components/VRating/VRating.sass +2 -1
- package/lib/components/VResponsive/VResponsive.mjs +7 -6
- package/lib/components/VResponsive/VResponsive.mjs.map +1 -1
- package/lib/components/VSelect/VSelect.mjs +61 -22
- package/lib/components/VSelect/VSelect.mjs.map +1 -1
- package/lib/components/VSelect/VSelect.sass +0 -2
- package/lib/components/VSelectionControl/VSelectionControl.css +1 -0
- package/lib/components/VSelectionControl/VSelectionControl.mjs +12 -10
- package/lib/components/VSelectionControl/VSelectionControl.mjs.map +1 -1
- package/lib/components/VSelectionControl/VSelectionControl.sass +1 -1
- package/lib/components/VSelectionControl/_variables.scss +1 -0
- package/lib/components/VSelectionControlGroup/VSelectionControlGroup.mjs +3 -3
- package/lib/components/VSelectionControlGroup/VSelectionControlGroup.mjs.map +1 -1
- package/lib/components/VSelectionControlGroup/VSelectionControlGroup.sass +1 -6
- package/lib/components/VSelectionControlGroup/_variables.scss +1 -4
- package/lib/components/VSheet/VSheet.mjs +3 -3
- package/lib/components/VSheet/VSheet.mjs.map +1 -1
- package/lib/components/VSheet/VSheet.sass +0 -1
- package/lib/components/VSheet/_variables.scss +3 -2
- package/lib/components/VSlideGroup/VSlideGroup.mjs +47 -49
- package/lib/components/VSlideGroup/VSlideGroup.mjs.map +1 -1
- package/lib/components/VSlideGroup/VSlideGroup.sass +0 -1
- package/lib/components/VSlideGroup/VSlideGroupItem.mjs +7 -3
- package/lib/components/VSlideGroup/VSlideGroupItem.mjs.map +1 -1
- package/lib/components/VSlideGroup/_variables.scss +0 -5
- package/lib/components/VSlideGroup/index.mjs +2 -2
- package/lib/components/VSlideGroup/index.mjs.map +1 -1
- package/lib/components/VSlider/VSlider.mjs +7 -9
- package/lib/components/VSlider/VSlider.mjs.map +1 -1
- package/lib/components/VSlider/VSlider.sass +0 -2
- package/lib/components/VSlider/VSliderThumb.mjs +6 -5
- package/lib/components/VSlider/VSliderThumb.mjs.map +1 -1
- package/lib/components/VSlider/VSliderThumb.sass +0 -2
- package/lib/components/VSlider/VSliderTrack.mjs +11 -10
- package/lib/components/VSlider/VSliderTrack.mjs.map +1 -1
- package/lib/components/VSlider/VSliderTrack.sass +0 -2
- package/lib/components/VSlider/slider.mjs +4 -4
- package/lib/components/VSlider/slider.mjs.map +1 -1
- package/lib/components/VSnackbar/VSnackbar.css +5 -5
- package/lib/components/VSnackbar/VSnackbar.mjs +49 -49
- package/lib/components/VSnackbar/VSnackbar.mjs.map +1 -1
- package/lib/components/VSnackbar/VSnackbar.sass +0 -1
- package/lib/components/VSnackbar/_variables.scss +2 -0
- package/lib/components/VSwitch/VSwitch.css +7 -0
- package/lib/components/VSwitch/VSwitch.mjs +8 -2
- package/lib/components/VSwitch/VSwitch.mjs.map +1 -1
- package/lib/components/VSwitch/VSwitch.sass +6 -1
- package/lib/components/VSwitch/_variables.scss +1 -0
- package/lib/components/VSystemBar/VSystemBar.mjs +5 -13
- package/lib/components/VSystemBar/VSystemBar.mjs.map +1 -1
- package/lib/components/VSystemBar/VSystemBar.sass +0 -1
- package/lib/components/VSystemBar/_variables.scss +2 -1
- package/lib/components/VTable/VTable.css +1 -0
- package/lib/components/VTable/VTable.mjs +9 -8
- package/lib/components/VTable/VTable.mjs.map +1 -1
- package/lib/components/VTable/VTable.sass +1 -1
- package/lib/components/VTable/_variables.scss +2 -0
- package/lib/components/VTabs/VTab.css +3 -1
- package/lib/components/VTabs/VTab.mjs +4 -4
- package/lib/components/VTabs/VTab.mjs.map +1 -1
- package/lib/components/VTabs/VTab.sass +4 -2
- package/lib/components/VTabs/VTabs.mjs +15 -12
- package/lib/components/VTabs/VTabs.mjs.map +1 -1
- package/lib/components/VTabs/VTabs.sass +0 -1
- package/lib/components/VTabs/_variables.scss +2 -0
- package/lib/components/VTextField/VTextField.mjs +25 -13
- package/lib/components/VTextField/VTextField.mjs.map +1 -1
- package/lib/components/VTextField/VTextField.sass +0 -1
- package/lib/components/VTextField/_variables.scss +1 -1
- package/lib/components/VTextarea/VTextarea.mjs +22 -12
- package/lib/components/VTextarea/VTextarea.mjs.map +1 -1
- package/lib/components/VTextarea/VTextarea.sass +0 -2
- package/lib/components/VTextarea/_variables.scss +1 -0
- package/lib/components/VTimeline/VTimeline.mjs +24 -25
- package/lib/components/VTimeline/VTimeline.mjs.map +1 -1
- package/lib/components/VTimeline/VTimeline.sass +3 -3
- package/lib/components/VTimeline/VTimelineDivider.mjs +41 -38
- package/lib/components/VTimeline/VTimelineDivider.mjs.map +1 -1
- package/lib/components/VTimeline/VTimelineItem.mjs +10 -11
- package/lib/components/VTimeline/VTimelineItem.mjs.map +1 -1
- package/lib/components/VTimeline/_variables.scss +11 -6
- package/lib/components/VToolbar/VToolbar.css +15 -6
- package/lib/components/VToolbar/VToolbar.mjs +9 -9
- package/lib/components/VToolbar/VToolbar.mjs.map +1 -1
- package/lib/components/VToolbar/VToolbar.sass +15 -7
- package/lib/components/VToolbar/VToolbarItems.mjs +12 -8
- package/lib/components/VToolbar/VToolbarItems.mjs.map +1 -1
- package/lib/components/VToolbar/_variables.scss +6 -2
- package/lib/components/VTooltip/VTooltip.mjs +41 -39
- package/lib/components/VTooltip/VTooltip.mjs.map +1 -1
- package/lib/components/VTooltip/VTooltip.sass +0 -1
- package/lib/components/VTooltip/_variables.scss +1 -0
- package/lib/components/VWindow/VWindow.mjs +4 -4
- package/lib/components/VWindow/VWindow.mjs.map +1 -1
- package/lib/components/VWindow/VWindow.sass +0 -2
- package/lib/components/VWindow/VWindowItem.mjs +21 -11
- package/lib/components/VWindow/VWindowItem.mjs.map +1 -1
- package/lib/components/VWindow/_variables.scss +1 -0
- package/lib/components/index.d.ts +7316 -2666
- package/lib/components/transitions/dialog-transition.mjs +3 -0
- package/lib/components/transitions/dialog-transition.mjs.map +1 -1
- package/lib/components/transitions/index.mjs +0 -5
- package/lib/components/transitions/index.mjs.map +1 -1
- package/lib/composables/border.mjs +5 -6
- package/lib/composables/border.mjs.map +1 -1
- package/lib/composables/display.mjs +13 -11
- package/lib/composables/display.mjs.map +1 -1
- package/lib/composables/form.mjs +6 -6
- package/lib/composables/form.mjs.map +1 -1
- package/lib/composables/group.mjs.map +1 -1
- package/lib/composables/items.mjs +2 -2
- package/lib/composables/items.mjs.map +1 -1
- package/lib/composables/location.mjs +4 -8
- package/lib/composables/location.mjs.map +1 -1
- package/lib/composables/proxiedModel.mjs +2 -1
- package/lib/composables/proxiedModel.mjs.map +1 -1
- package/lib/composables/size.mjs +2 -2
- package/lib/composables/size.mjs.map +1 -1
- package/lib/composables/ssrBoot.mjs +3 -2
- package/lib/composables/ssrBoot.mjs.map +1 -1
- package/lib/composables/stack.mjs +7 -7
- package/lib/composables/stack.mjs.map +1 -1
- package/lib/composables/theme.mjs +15 -6
- package/lib/composables/theme.mjs.map +1 -1
- package/lib/composables/validation.mjs +15 -8
- package/lib/composables/validation.mjs.map +1 -1
- package/lib/composables/variant.mjs +7 -5
- package/lib/composables/variant.mjs.map +1 -1
- package/lib/directives/ripple/VRipple.sass +0 -1
- package/lib/entry-bundler.mjs +1 -1
- package/lib/framework.mjs +29 -7
- package/lib/framework.mjs.map +1 -1
- package/lib/index.d.ts +68 -70
- package/lib/styles/generic/_transitions.scss +13 -77
- package/lib/styles/main.css +44 -58
- package/lib/styles/tools/_variant.sass +6 -6
- package/lib/util/anchor.mjs +34 -28
- package/lib/util/anchor.mjs.map +1 -1
- package/lib/util/animation.mjs +2 -2
- package/lib/util/animation.mjs.map +1 -1
- package/lib/util/box.mjs +12 -0
- package/lib/util/box.mjs.map +1 -1
- package/lib/util/getCurrentInstance.mjs +19 -0
- package/lib/util/getCurrentInstance.mjs.map +1 -1
- package/lib/util/helpers.mjs +21 -5
- package/lib/util/helpers.mjs.map +1 -1
- package/package.json +16 -10
- package/lib/components/VBanner/VBannerAvatar.mjs +0 -20
- package/lib/components/VBanner/VBannerAvatar.mjs.map +0 -1
- package/lib/components/VBanner/VBannerIcon.mjs +0 -20
- package/lib/components/VBanner/VBannerIcon.mjs.map +0 -1
- package/lib/components/VBreadcrumbs/shared.mjs +0 -2
- package/lib/components/VBreadcrumbs/shared.mjs.map +0 -1
- package/lib/components/VCard/VCardAvatar.mjs +0 -3
- package/lib/components/VCard/VCardAvatar.mjs.map +0 -1
- package/lib/components/VCard/VCardContent.mjs +0 -3
- package/lib/components/VCard/VCardContent.mjs.map +0 -1
- package/lib/components/VCard/VCardHeader.mjs +0 -3
- package/lib/components/VCard/VCardHeader.mjs.map +0 -1
- package/lib/components/VCard/VCardHeaderText.mjs +0 -3
- package/lib/components/VCard/VCardHeaderText.mjs.map +0 -1
- package/lib/components/VCard/VCardImg.mjs +0 -3
- package/lib/components/VCard/VCardImg.mjs.map +0 -1
- package/lib/components/VList/VListItemAvatar.mjs +0 -23
- package/lib/components/VList/VListItemAvatar.mjs.map +0 -1
- package/lib/components/VList/VListItemHeader.mjs +0 -3
- package/lib/components/VList/VListItemHeader.mjs.map +0 -1
- package/lib/components/VList/VListItemIcon.mjs +0 -23
- package/lib/components/VList/VListItemIcon.mjs.map +0 -1
- package/lib/components/VTimeline/shared.mjs +0 -2
- package/lib/components/VTimeline/shared.mjs.map +0 -1
- package/lib/presets/default/index.mjs +0 -71
- package/lib/presets/default/index.mjs.map +0 -1
|
@@ -3,19 +3,19 @@ import { mergeProps as _mergeProps, Fragment as _Fragment, withDirectives as _wi
|
|
|
3
3
|
import "./VField.css"; // Components
|
|
4
4
|
|
|
5
5
|
import { VExpandXTransition } from "../transitions/index.mjs";
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
6
|
+
import { VFieldLabel } from "./VFieldLabel.mjs";
|
|
7
|
+
import { VIcon } from "../VIcon/index.mjs"; // Composables
|
|
8
8
|
|
|
9
|
+
import { IconValue } from "../../composables/icons.mjs";
|
|
9
10
|
import { LoaderSlot, makeLoaderProps, useLoader } from "../../composables/loader.mjs";
|
|
10
|
-
import { makeThemeProps, provideTheme } from "../../composables/theme.mjs";
|
|
11
|
-
import { useBackgroundColor, useTextColor } from "../../composables/color.mjs";
|
|
12
11
|
import { makeFocusProps, useFocus } from "../../composables/focus.mjs";
|
|
13
|
-
import {
|
|
12
|
+
import { makeThemeProps, provideTheme } from "../../composables/theme.mjs";
|
|
13
|
+
import { useBackgroundColor, useTextColor } from "../../composables/color.mjs"; // Utilities
|
|
14
14
|
|
|
15
15
|
import { computed, ref, toRef, watch } from 'vue';
|
|
16
16
|
import { convertToUnit, genericComponent, getUid, nullifyTransforms, pick, propsFactory, standardEasing, useRender } from "../../util/index.mjs"; // Types
|
|
17
17
|
|
|
18
|
-
const allowedVariants = ['underlined', 'outlined', 'filled', '
|
|
18
|
+
const allowedVariants = ['underlined', 'outlined', 'filled', 'solo', 'plain'];
|
|
19
19
|
export const makeVFieldProps = propsFactory({
|
|
20
20
|
appendInnerIcon: IconValue,
|
|
21
21
|
bgColor: String,
|
|
@@ -145,9 +145,9 @@ export const VField = genericComponent()({
|
|
|
145
145
|
var _slots$prependInner, _slots$default, _slots$appendInner;
|
|
146
146
|
|
|
147
147
|
const isOutlined = props.variant === 'outlined';
|
|
148
|
-
const hasPrepend = slots
|
|
148
|
+
const hasPrepend = slots['prepend-inner'] || props.prependInnerIcon;
|
|
149
149
|
const hasClear = !!(props.clearable || slots.clear);
|
|
150
|
-
const hasAppend = !!(slots
|
|
150
|
+
const hasAppend = !!(slots['append-inner'] || props.appendInnerIcon || hasClear);
|
|
151
151
|
const label = slots.label ? slots.label({
|
|
152
152
|
label: props.label,
|
|
153
153
|
props: {
|
|
@@ -180,14 +180,17 @@ export const VField = genericComponent()({
|
|
|
180
180
|
}, {
|
|
181
181
|
default: slots.loader
|
|
182
182
|
}), hasPrepend && _createVNode("div", {
|
|
183
|
+
"key": "prepend",
|
|
183
184
|
"class": "v-field__prepend-inner"
|
|
184
185
|
}, [props.prependInnerIcon && _createVNode(VIcon, {
|
|
186
|
+
"key": "prepend-icon",
|
|
185
187
|
"onClick": attrs['onClick:prependInner'],
|
|
186
188
|
"icon": props.prependInnerIcon
|
|
187
|
-
}, null),
|
|
189
|
+
}, null), (_slots$prependInner = slots['prepend-inner']) == null ? void 0 : _slots$prependInner.call(slots, slotProps.value)]), _createVNode("div", {
|
|
188
190
|
"class": "v-field__field",
|
|
189
191
|
"data-no-activator": ""
|
|
190
|
-
}, [['
|
|
192
|
+
}, [['solo', 'filled'].includes(props.variant) && hasLabel.value && _createVNode(VFieldLabel, {
|
|
193
|
+
"key": "floating-label",
|
|
191
194
|
"ref": floatingLabelRef,
|
|
192
195
|
"class": [textColorClasses.value],
|
|
193
196
|
"floating": true
|
|
@@ -205,7 +208,9 @@ export const VField = genericComponent()({
|
|
|
205
208
|
},
|
|
206
209
|
focus,
|
|
207
210
|
blur
|
|
208
|
-
})]), hasClear && _createVNode(VExpandXTransition,
|
|
211
|
+
})]), hasClear && _createVNode(VExpandXTransition, {
|
|
212
|
+
"key": "clear"
|
|
213
|
+
}, {
|
|
209
214
|
default: () => [_withDirectives(_createVNode("div", {
|
|
210
215
|
"class": "v-field__clearable"
|
|
211
216
|
}, [slots.clear ? slots.clear() : _createVNode(VIcon, {
|
|
@@ -213,8 +218,10 @@ export const VField = genericComponent()({
|
|
|
213
218
|
"icon": props.clearIcon
|
|
214
219
|
}, null)]), [[_vShow, props.dirty]])]
|
|
215
220
|
}), hasAppend && _createVNode("div", {
|
|
221
|
+
"key": "append",
|
|
216
222
|
"class": "v-field__append-inner"
|
|
217
|
-
}, [
|
|
223
|
+
}, [(_slots$appendInner = slots['append-inner']) == null ? void 0 : _slots$appendInner.call(slots, slotProps.value), props.appendInnerIcon && _createVNode(VIcon, {
|
|
224
|
+
"key": "append-icon",
|
|
218
225
|
"onClick": attrs['onClick:appendInner'],
|
|
219
226
|
"icon": props.appendInnerIcon
|
|
220
227
|
}, null)]), _createVNode("div", {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VField.mjs","names":["VExpandXTransition","VIcon","VFieldLabel","LoaderSlot","makeLoaderProps","useLoader","makeThemeProps","provideTheme","useBackgroundColor","useTextColor","makeFocusProps","useFocus","IconValue","computed","ref","toRef","watch","convertToUnit","genericComponent","getUid","nullifyTransforms","pick","propsFactory","standardEasing","useRender","allowedVariants","makeVFieldProps","appendInnerIcon","bgColor","String","clearable","Boolean","clearIcon","type","default","active","color","dirty","disabled","error","label","persistentClear","prependInnerIcon","reverse","singleLine","variant","validator","v","includes","VField","name","inheritAttrs","props","id","emits","e","focused","val","setup","attrs","emit","slots","themeClasses","loaderClasses","focusClasses","isFocused","focus","blur","isActive","hasLabel","uid","labelRef","floatingLabelRef","controlRef","backgroundColorClasses","backgroundColorStyles","textColorClasses","textColorStyles","value","undefined","el","$el","targetEl","rect","targetRect","getBoundingClientRect","x","y","height","targetWidth","width","Math","abs","maxWidth","duration","parseFloat","getComputedStyle","transitionDuration","scale","getPropertyValue","style","visibility","animate","transform","easing","direction","finished","then","removeProperty","flush","slotProps","onClick","target","document","activeElement","preventDefault","isOutlined","hasPrepend","prependInner","hasClear","clear","hasAppend","appendInner","for","loading","loader","class","filterFieldProps","Object","keys"],"sources":["../../../src/components/VField/VField.tsx"],"sourcesContent":["// Styles\nimport './VField.sass'\n\n// Components\nimport { VExpandXTransition } from '@/components/transitions'\nimport { VIcon } from '@/components/VIcon'\nimport { VFieldLabel } from './VFieldLabel'\n\n// Composables\nimport { LoaderSlot, makeLoaderProps, useLoader } from '@/composables/loader'\nimport { makeThemeProps, provideTheme } from '@/composables/theme'\nimport { useBackgroundColor, useTextColor } from '@/composables/color'\nimport { makeFocusProps, useFocus } from '@/composables/focus'\nimport { IconValue } from '@/composables/icons'\n\n// Utilities\nimport { computed, ref, toRef, watch } from 'vue'\nimport {\n convertToUnit,\n genericComponent,\n getUid,\n nullifyTransforms,\n pick,\n propsFactory,\n standardEasing,\n useRender,\n} from '@/util'\n\n// Types\nimport type { VInputSlot } from '@/components/VInput/VInput'\nimport type { LoaderSlotProps } from '@/composables/loader'\nimport type { PropType, Ref } from 'vue'\nimport type { MakeSlots } from '@/util'\n\nconst allowedVariants = ['underlined', 'outlined', 'filled', 'contained', 'plain'] as const\ntype Variant = typeof allowedVariants[number]\n\nexport interface DefaultInputSlot {\n isActive: Ref<boolean>\n isFocused: Ref<boolean>\n controlRef: Ref<HTMLElement | undefined>\n focus: () => void\n blur: () => void\n}\n\nexport interface VFieldSlot extends DefaultInputSlot {\n props: Record<string, unknown>\n}\n\nexport const makeVFieldProps = propsFactory({\n appendInnerIcon: IconValue,\n bgColor: String,\n clearable: Boolean,\n clearIcon: {\n type: IconValue,\n default: '$clear',\n },\n active: Boolean,\n color: String,\n dirty: Boolean,\n disabled: Boolean,\n error: Boolean,\n label: String,\n persistentClear: Boolean,\n prependInnerIcon: IconValue,\n reverse: Boolean,\n singleLine: Boolean,\n variant: {\n type: String as PropType<Variant>,\n default: 'filled',\n validator: (v: any) => allowedVariants.includes(v),\n },\n\n ...makeThemeProps(),\n ...makeLoaderProps(),\n}, 'v-field')\n\nexport type VFieldSlots = MakeSlots<{\n clear: []\n prependInner: [DefaultInputSlot & VInputSlot]\n appendInner: [DefaultInputSlot & VInputSlot]\n label: [DefaultInputSlot & VInputSlot]\n loader: [LoaderSlotProps]\n default: [VFieldSlot]\n}>\n\nexport const VField = genericComponent<new <T>() => {\n $props: {\n modelValue?: T\n 'onUpdate:modelValue'?: (val: T) => any\n }\n $slots: VFieldSlots\n}>()({\n name: 'VField',\n\n inheritAttrs: false,\n\n props: {\n id: String,\n\n ...makeFocusProps(),\n ...makeVFieldProps(),\n },\n\n emits: {\n 'click:clear': (e: MouseEvent) => true,\n 'click:control': (e: MouseEvent) => true,\n 'update:focused': (focused: boolean) => true,\n 'update:modelValue': (val: any) => true,\n },\n\n setup (props, { attrs, emit, slots }) {\n const { themeClasses } = provideTheme(props)\n const { loaderClasses } = useLoader(props)\n const { focusClasses, isFocused, focus, blur } = useFocus(props)\n\n const isActive = computed(() => props.dirty || props.active)\n const hasLabel = computed(() => !props.singleLine && !!(props.label || slots.label))\n\n const uid = getUid()\n const id = computed(() => props.id || `input-${uid}`)\n\n const labelRef = ref<VFieldLabel>()\n const floatingLabelRef = ref<VFieldLabel>()\n const controlRef = ref<HTMLElement>()\n\n const { backgroundColorClasses, backgroundColorStyles } = useBackgroundColor(toRef(props, 'bgColor'))\n const { textColorClasses, textColorStyles } = useTextColor(computed(() => {\n return (\n isActive.value &&\n isFocused.value &&\n !props.error &&\n !props.disabled\n ) ? props.color : undefined\n }))\n\n watch(isActive, val => {\n if (hasLabel.value) {\n const el: HTMLElement = labelRef.value!.$el\n const targetEl: HTMLElement = floatingLabelRef.value!.$el\n const rect = nullifyTransforms(el)\n const targetRect = targetEl.getBoundingClientRect()\n\n const x = targetRect.x - rect.x\n const y = targetRect.y - rect.y - (rect.height / 2 - targetRect.height / 2)\n\n const targetWidth = targetRect.width / 0.75\n const width = Math.abs(targetWidth - rect.width) > 1\n ? { maxWidth: convertToUnit(targetWidth) }\n : undefined\n\n const duration = parseFloat(getComputedStyle(el).transitionDuration) * 1000\n const scale = parseFloat(getComputedStyle(targetEl).getPropertyValue('--v-field-label-scale'))\n\n el.style.visibility = 'visible'\n targetEl.style.visibility = 'hidden'\n\n el.animate([\n { transform: 'translate(0)' },\n { transform: `translate(${x}px, ${y}px) scale(${scale})`, ...width },\n ], {\n duration,\n easing: standardEasing,\n direction: val ? 'normal' : 'reverse',\n }).finished.then(() => {\n el.style.removeProperty('visibility')\n targetEl.style.removeProperty('visibility')\n })\n }\n }, { flush: 'post' })\n\n const slotProps = computed<DefaultInputSlot>(() => ({\n isActive,\n isFocused,\n controlRef,\n blur,\n focus,\n }))\n\n function onClick (e: MouseEvent) {\n if (e.target !== document.activeElement) {\n e.preventDefault()\n }\n\n emit('click:control', e)\n }\n\n useRender(() => {\n const isOutlined = props.variant === 'outlined'\n const hasPrepend = (slots.prependInner || props.prependInnerIcon)\n const hasClear = !!(props.clearable || slots.clear)\n const hasAppend = !!(slots.appendInner || props.appendInnerIcon || hasClear)\n const label = slots.label\n ? slots.label({\n label: props.label,\n props: { for: id.value },\n })\n : props.label\n\n return (\n <div\n class={[\n 'v-field',\n {\n 'v-field--active': isActive.value,\n 'v-field--appended': hasAppend,\n 'v-field--disabled': props.disabled,\n 'v-field--dirty': props.dirty,\n 'v-field--error': props.error,\n 'v-field--has-background': !!props.bgColor,\n 'v-field--persistent-clear': props.persistentClear,\n 'v-field--prepended': hasPrepend,\n 'v-field--reverse': props.reverse,\n 'v-field--single-line': props.singleLine,\n 'v-field--has-label': !!label,\n [`v-field--variant-${props.variant}`]: true,\n },\n themeClasses.value,\n backgroundColorClasses.value,\n focusClasses.value,\n loaderClasses.value,\n ]}\n style={[\n backgroundColorStyles.value,\n textColorStyles.value,\n ]}\n onClick={ onClick }\n { ...attrs }\n >\n <div class=\"v-field__overlay\" />\n\n <LoaderSlot\n name=\"v-field\"\n active={ props.loading }\n color={ props.error ? 'error' : props.color }\n v-slots={{ default: slots.loader }}\n />\n\n { hasPrepend && (\n <div\n class=\"v-field__prepend-inner\"\n >\n { props.prependInnerIcon && (\n <VIcon\n onClick={ attrs['onClick:prependInner'] }\n icon={ props.prependInnerIcon }\n />\n ) }\n\n { slots?.prependInner?.(slotProps.value) }\n </div>\n ) }\n\n <div class=\"v-field__field\" data-no-activator=\"\">\n { ['contained', 'filled'].includes(props.variant) && hasLabel.value && (\n <VFieldLabel\n ref={ floatingLabelRef }\n class={[textColorClasses.value]}\n floating\n >\n { label }\n </VFieldLabel>\n ) }\n\n <VFieldLabel ref={ labelRef } for={ id.value }>\n { label }\n </VFieldLabel>\n\n { slots.default?.({\n ...slotProps.value,\n props: {\n id: id.value,\n class: 'v-field__input',\n },\n focus,\n blur,\n } as VFieldSlot) }\n </div>\n\n { hasClear && (\n <VExpandXTransition>\n <div\n class=\"v-field__clearable\"\n v-show={ props.dirty }\n >\n { slots.clear\n ? slots.clear()\n : (\n <VIcon\n onClick={ (e: MouseEvent) => emit('click:clear', e) }\n icon={ props.clearIcon }\n />\n )\n }\n </div>\n </VExpandXTransition>\n ) }\n\n { hasAppend && (\n <div\n class=\"v-field__append-inner\"\n >\n { slots?.appendInner?.(slotProps.value) }\n\n { props.appendInnerIcon && (\n <VIcon\n onClick={ attrs['onClick:appendInner'] }\n icon={ props.appendInnerIcon }\n />\n ) }\n </div>\n ) }\n\n <div\n class={[\n 'v-field__outline',\n textColorClasses.value,\n ]}\n >\n { isOutlined && (\n <>\n <div class=\"v-field__outline__start\" />\n\n { hasLabel.value && (\n <div class=\"v-field__outline__notch\">\n <VFieldLabel ref={ floatingLabelRef } floating>\n { label }\n </VFieldLabel>\n </div>\n ) }\n\n <div class=\"v-field__outline__end\" />\n </>\n ) }\n\n { ['plain', 'underlined'].includes(props.variant) && hasLabel.value && (\n <VFieldLabel ref={ floatingLabelRef } floating>\n { label }\n </VFieldLabel>\n ) }\n </div>\n </div>\n )\n })\n\n return {\n controlRef,\n }\n },\n})\n\nexport type VField = InstanceType<typeof VField>\n\n// TODO: this is kinda slow, might be better to implicitly inherit props instead\nexport function filterFieldProps (attrs: Record<string, unknown>) {\n return pick(attrs, Object.keys(VField.props))\n}\n"],"mappings":";AAAA;AACA,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D,KAJK,0CAILA,KAAK,CAAE6D,WAJF,qBAIL,wBAAA7D,KAAK,EAAgBiD,SAAS,CAAChC,KAA1B,CAJA,EAML1B,KAAK,CAACzB,eAAN;QAAA,WAEYgC,KAAK,CAAC,qBAAD,CAFjB;QAAA,QAGSP,KAAK,CAACzB;MAHf,QANK,EAnGf;QAAA,SAmHa,CACL,kBADK,EAELiD,gBAAgB,CAACE,KAFZ;MAnHb,IAwHQsC,UAAU;QAAA,SAEG;MAFH,UAIN/C,QAAQ,CAACS,KAAT;QAAA,SACW;MADX;QAAA,OAEqBN,gBAFrB;QAAA;MAAA;QAAA,gBAGMhC,KAHN;MAAA,IAJM;QAAA,SAYG;MAZH,UAxHlB,EAwIQ,CAAC,OAAD,EAAU,YAAV,EAAwBQ,QAAxB,CAAiCI,KAAK,CAACP,OAAvC,KAAmDwB,QAAQ,CAACS,KAA5D;QAAA,OACmBN,gBADnB;QAAA;MAAA;QAAA,gBAEIhC,KAFJ;MAAA,EAxIR;IAgJD,CA5JQ,CAAT;IA8JA,OAAO;MACLiC;IADK,CAAP;EAGD;;AAhQE,CANiC,CAA/B;AA2QP;AACA,OAAO,SAASsD,gBAAT,CAA2BpE,KAA3B,EAA2D;EAChE,OAAOtC,IAAI,CAACsC,KAAD,EAAQqE,MAAM,CAACC,IAAP,CAAYhF,MAAM,CAACG,KAAnB,CAAR,CAAX;AACD"}
|
|
1
|
+
{"version":3,"file":"VField.mjs","names":["VExpandXTransition","VFieldLabel","VIcon","IconValue","LoaderSlot","makeLoaderProps","useLoader","makeFocusProps","useFocus","makeThemeProps","provideTheme","useBackgroundColor","useTextColor","computed","ref","toRef","watch","convertToUnit","genericComponent","getUid","nullifyTransforms","pick","propsFactory","standardEasing","useRender","allowedVariants","makeVFieldProps","appendInnerIcon","bgColor","String","clearable","Boolean","clearIcon","type","default","active","color","dirty","disabled","error","label","persistentClear","prependInnerIcon","reverse","singleLine","variant","validator","v","includes","VField","name","inheritAttrs","props","id","emits","e","focused","val","setup","attrs","emit","slots","themeClasses","loaderClasses","focusClasses","isFocused","focus","blur","isActive","hasLabel","uid","labelRef","floatingLabelRef","controlRef","backgroundColorClasses","backgroundColorStyles","textColorClasses","textColorStyles","value","undefined","el","$el","targetEl","rect","targetRect","getBoundingClientRect","x","y","height","targetWidth","width","Math","abs","maxWidth","duration","parseFloat","getComputedStyle","transitionDuration","scale","getPropertyValue","style","visibility","animate","transform","easing","direction","finished","then","removeProperty","flush","slotProps","onClick","target","document","activeElement","preventDefault","isOutlined","hasPrepend","hasClear","clear","hasAppend","for","loading","loader","class","filterFieldProps","Object","keys"],"sources":["../../../src/components/VField/VField.tsx"],"sourcesContent":["// Styles\nimport './VField.sass'\n\n// Components\nimport { VExpandXTransition } from '@/components/transitions'\nimport { VFieldLabel } from './VFieldLabel'\nimport { VIcon } from '@/components/VIcon'\n\n// Composables\nimport { IconValue } from '@/composables/icons'\nimport { LoaderSlot, makeLoaderProps, useLoader } from '@/composables/loader'\nimport { makeFocusProps, useFocus } from '@/composables/focus'\nimport { makeThemeProps, provideTheme } from '@/composables/theme'\nimport { useBackgroundColor, useTextColor } from '@/composables/color'\n\n// Utilities\nimport { computed, ref, toRef, watch } from 'vue'\nimport {\n convertToUnit,\n genericComponent,\n getUid,\n nullifyTransforms,\n pick,\n propsFactory,\n standardEasing,\n useRender,\n} from '@/util'\n\n// Types\nimport type { LoaderSlotProps } from '@/composables/loader'\nimport type { MakeSlots } from '@/util'\nimport type { PropType, Ref } from 'vue'\nimport type { VInputSlot } from '@/components/VInput/VInput'\n\nconst allowedVariants = ['underlined', 'outlined', 'filled', 'solo', 'plain'] as const\ntype Variant = typeof allowedVariants[number]\n\nexport interface DefaultInputSlot {\n isActive: Ref<boolean>\n isFocused: Ref<boolean>\n controlRef: Ref<HTMLElement | undefined>\n focus: () => void\n blur: () => void\n}\n\nexport interface VFieldSlot extends DefaultInputSlot {\n props: Record<string, unknown>\n}\n\nexport const makeVFieldProps = propsFactory({\n appendInnerIcon: IconValue,\n bgColor: String,\n clearable: Boolean,\n clearIcon: {\n type: IconValue,\n default: '$clear',\n },\n active: Boolean,\n color: String,\n dirty: Boolean,\n disabled: Boolean,\n error: Boolean,\n label: String,\n persistentClear: Boolean,\n prependInnerIcon: IconValue,\n reverse: Boolean,\n singleLine: Boolean,\n variant: {\n type: String as PropType<Variant>,\n default: 'filled',\n validator: (v: any) => allowedVariants.includes(v),\n },\n\n ...makeThemeProps(),\n ...makeLoaderProps(),\n}, 'v-field')\n\nexport type VFieldSlots = MakeSlots<{\n clear: []\n 'prepend-inner': [DefaultInputSlot & VInputSlot]\n 'append-inner': [DefaultInputSlot & VInputSlot]\n label: [DefaultInputSlot & VInputSlot]\n loader: [LoaderSlotProps]\n default: [VFieldSlot]\n}>\n\nexport const VField = genericComponent<new <T>() => {\n $props: {\n modelValue?: T\n 'onUpdate:modelValue'?: (val: T) => any\n }\n $slots: VFieldSlots\n}>()({\n name: 'VField',\n\n inheritAttrs: false,\n\n props: {\n id: String,\n\n ...makeFocusProps(),\n ...makeVFieldProps(),\n },\n\n emits: {\n 'click:clear': (e: MouseEvent) => true,\n 'click:control': (e: MouseEvent) => true,\n 'update:focused': (focused: boolean) => true,\n 'update:modelValue': (val: any) => true,\n },\n\n setup (props, { attrs, emit, slots }) {\n const { themeClasses } = provideTheme(props)\n const { loaderClasses } = useLoader(props)\n const { focusClasses, isFocused, focus, blur } = useFocus(props)\n\n const isActive = computed(() => props.dirty || props.active)\n const hasLabel = computed(() => !props.singleLine && !!(props.label || slots.label))\n\n const uid = getUid()\n const id = computed(() => props.id || `input-${uid}`)\n\n const labelRef = ref<VFieldLabel>()\n const floatingLabelRef = ref<VFieldLabel>()\n const controlRef = ref<HTMLElement>()\n\n const { backgroundColorClasses, backgroundColorStyles } = useBackgroundColor(toRef(props, 'bgColor'))\n const { textColorClasses, textColorStyles } = useTextColor(computed(() => {\n return (\n isActive.value &&\n isFocused.value &&\n !props.error &&\n !props.disabled\n ) ? props.color : undefined\n }))\n\n watch(isActive, val => {\n if (hasLabel.value) {\n const el: HTMLElement = labelRef.value!.$el\n const targetEl: HTMLElement = floatingLabelRef.value!.$el\n const rect = nullifyTransforms(el)\n const targetRect = targetEl.getBoundingClientRect()\n\n const x = targetRect.x - rect.x\n const y = targetRect.y - rect.y - (rect.height / 2 - targetRect.height / 2)\n\n const targetWidth = targetRect.width / 0.75\n const width = Math.abs(targetWidth - rect.width) > 1\n ? { maxWidth: convertToUnit(targetWidth) }\n : undefined\n\n const duration = parseFloat(getComputedStyle(el).transitionDuration) * 1000\n const scale = parseFloat(getComputedStyle(targetEl).getPropertyValue('--v-field-label-scale'))\n\n el.style.visibility = 'visible'\n targetEl.style.visibility = 'hidden'\n\n el.animate([\n { transform: 'translate(0)' },\n { transform: `translate(${x}px, ${y}px) scale(${scale})`, ...width },\n ], {\n duration,\n easing: standardEasing,\n direction: val ? 'normal' : 'reverse',\n }).finished.then(() => {\n el.style.removeProperty('visibility')\n targetEl.style.removeProperty('visibility')\n })\n }\n }, { flush: 'post' })\n\n const slotProps = computed<DefaultInputSlot>(() => ({\n isActive,\n isFocused,\n controlRef,\n blur,\n focus,\n }))\n\n function onClick (e: MouseEvent) {\n if (e.target !== document.activeElement) {\n e.preventDefault()\n }\n\n emit('click:control', e)\n }\n\n useRender(() => {\n const isOutlined = props.variant === 'outlined'\n const hasPrepend = (slots['prepend-inner'] || props.prependInnerIcon)\n const hasClear = !!(props.clearable || slots.clear)\n const hasAppend = !!(slots['append-inner'] || props.appendInnerIcon || hasClear)\n const label = slots.label\n ? slots.label({\n label: props.label,\n props: { for: id.value },\n })\n : props.label\n\n return (\n <div\n class={[\n 'v-field',\n {\n 'v-field--active': isActive.value,\n 'v-field--appended': hasAppend,\n 'v-field--disabled': props.disabled,\n 'v-field--dirty': props.dirty,\n 'v-field--error': props.error,\n 'v-field--has-background': !!props.bgColor,\n 'v-field--persistent-clear': props.persistentClear,\n 'v-field--prepended': hasPrepend,\n 'v-field--reverse': props.reverse,\n 'v-field--single-line': props.singleLine,\n 'v-field--has-label': !!label,\n [`v-field--variant-${props.variant}`]: true,\n },\n themeClasses.value,\n backgroundColorClasses.value,\n focusClasses.value,\n loaderClasses.value,\n ]}\n style={[\n backgroundColorStyles.value,\n textColorStyles.value,\n ]}\n onClick={ onClick }\n { ...attrs }\n >\n <div class=\"v-field__overlay\" />\n\n <LoaderSlot\n name=\"v-field\"\n active={ props.loading }\n color={ props.error ? 'error' : props.color }\n v-slots={{ default: slots.loader }}\n />\n\n { hasPrepend && (\n <div key=\"prepend\" class=\"v-field__prepend-inner\">\n { props.prependInnerIcon && (\n <VIcon\n key=\"prepend-icon\"\n onClick={ attrs['onClick:prependInner'] }\n icon={ props.prependInnerIcon }\n />\n ) }\n\n { slots['prepend-inner']?.(slotProps.value) }\n </div>\n ) }\n\n <div class=\"v-field__field\" data-no-activator=\"\">\n { ['solo', 'filled'].includes(props.variant) && hasLabel.value && (\n <VFieldLabel\n key=\"floating-label\"\n ref={ floatingLabelRef }\n class={[textColorClasses.value]}\n floating\n >\n { label }\n </VFieldLabel>\n ) }\n\n <VFieldLabel ref={ labelRef } for={ id.value }>\n { label }\n </VFieldLabel>\n\n { slots.default?.({\n ...slotProps.value,\n props: {\n id: id.value,\n class: 'v-field__input',\n },\n focus,\n blur,\n } as VFieldSlot) }\n </div>\n\n { hasClear && (\n <VExpandXTransition key=\"clear\">\n <div\n class=\"v-field__clearable\"\n v-show={ props.dirty }\n >\n { slots.clear\n ? slots.clear()\n : (\n <VIcon\n onClick={ (e: MouseEvent) => emit('click:clear', e) }\n icon={ props.clearIcon }\n />\n )\n }\n </div>\n </VExpandXTransition>\n ) }\n\n { hasAppend && (\n <div key=\"append\" class=\"v-field__append-inner\">\n { slots['append-inner']?.(slotProps.value) }\n\n { props.appendInnerIcon && (\n <VIcon\n key=\"append-icon\"\n onClick={ attrs['onClick:appendInner'] }\n icon={ props.appendInnerIcon }\n />\n ) }\n </div>\n ) }\n\n <div\n class={[\n 'v-field__outline',\n textColorClasses.value,\n ]}\n >\n { isOutlined && (\n <>\n <div class=\"v-field__outline__start\" />\n\n { hasLabel.value && (\n <div class=\"v-field__outline__notch\">\n <VFieldLabel ref={ floatingLabelRef } floating>\n { label }\n </VFieldLabel>\n </div>\n ) }\n\n <div class=\"v-field__outline__end\" />\n </>\n ) }\n\n { ['plain', 'underlined'].includes(props.variant) && hasLabel.value && (\n <VFieldLabel ref={ floatingLabelRef } floating>\n { label }\n </VFieldLabel>\n ) }\n </div>\n </div>\n )\n })\n\n return {\n controlRef,\n }\n },\n})\n\nexport type VField = InstanceType<typeof VField>\n\n// TODO: this is kinda slow, might be better to implicitly inherit props instead\nexport function filterFieldProps (attrs: Record<string, unknown>) {\n return pick(attrs, Object.keys(VField.props))\n}\n"],"mappings":";AAAA;AACA,sB,CAEA;;SACSA,kB;SACAC,W;SACAC,K,8BAET;;SACSC,S;SACAC,U,EAAYC,e,EAAiBC,S;SAC7BC,c,EAAgBC,Q;SAChBC,c,EAAgBC,Y;SAChBC,kB,EAAoBC,Y,uCAE7B;;AACA,SAASC,QAAT,EAAmBC,GAAnB,EAAwBC,KAAxB,EAA+BC,KAA/B,QAA4C,KAA5C;SAEEC,a,EACAC,gB,EACAC,M,EACAC,iB,EACAC,I,EACAC,Y,EACAC,c,EACAC,S,gCAGF;;AAMA,MAAMC,eAAe,GAAG,CAAC,YAAD,EAAe,UAAf,EAA2B,QAA3B,EAAqC,MAArC,EAA6C,OAA7C,CAAxB;AAeA,OAAO,MAAMC,eAAe,GAAGJ,YAAY,CAAC;EAC1CK,eAAe,EAAExB,SADyB;EAE1CyB,OAAO,EAAEC,MAFiC;EAG1CC,SAAS,EAAEC,OAH+B;EAI1CC,SAAS,EAAE;IACTC,IAAI,EAAE9B,SADG;IAET+B,OAAO,EAAE;EAFA,CAJ+B;EAQ1CC,MAAM,EAAEJ,OARkC;EAS1CK,KAAK,EAAEP,MATmC;EAU1CQ,KAAK,EAAEN,OAVmC;EAW1CO,QAAQ,EAAEP,OAXgC;EAY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CAAP;EAGD;;AA/PE,CANiC,CAA/B;AA0QP;AACA,OAAO,SAASoD,gBAAT,CAA2BlE,KAA3B,EAA2D;EAChE,OAAOtC,IAAI,CAACsC,KAAD,EAAQmE,MAAM,CAACC,IAAP,CAAY9E,MAAM,CAACG,KAAnB,CAAR,CAAX;AACD"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
@forward './variables'
|
|
2
1
|
@use 'sass:map'
|
|
3
2
|
@use 'sass:selector'
|
|
4
3
|
@use '../../styles/settings'
|
|
@@ -42,14 +41,13 @@
|
|
|
42
41
|
&--appended
|
|
43
42
|
padding-inline-end: $field-control-affixed-padding
|
|
44
43
|
|
|
45
|
-
&--variant-
|
|
46
|
-
background: $field-control-
|
|
44
|
+
&--variant-solo
|
|
45
|
+
background: $field-control-solo-background
|
|
47
46
|
border-color: transparent
|
|
48
|
-
color: $field-control-
|
|
47
|
+
color: $field-control-solo-color
|
|
49
48
|
|
|
50
|
-
@include tools.elevation($field-control-
|
|
49
|
+
@include tools.elevation($field-control-solo-elevation)
|
|
51
50
|
|
|
52
|
-
&--variant-contained,
|
|
53
51
|
&--variant-filled
|
|
54
52
|
border-bottom-left-radius: 0
|
|
55
53
|
border-bottom-right-radius: 0
|
|
@@ -69,7 +67,7 @@
|
|
|
69
67
|
&--single-line
|
|
70
68
|
--v-field-padding-top: 0
|
|
71
69
|
|
|
72
|
-
&--variant-
|
|
70
|
+
&--variant-solo,
|
|
73
71
|
&--variant-filled
|
|
74
72
|
$root: &
|
|
75
73
|
|
|
@@ -91,7 +89,6 @@
|
|
|
91
89
|
/* endregion */
|
|
92
90
|
/* region ELEMENTS */
|
|
93
91
|
.v-field__input
|
|
94
|
-
align-self: stretch
|
|
95
92
|
color: inherit
|
|
96
93
|
display: flex
|
|
97
94
|
flex-wrap: wrap
|
|
@@ -100,7 +97,8 @@
|
|
|
100
97
|
padding-inline-start: var(--v-field-padding-start)
|
|
101
98
|
padding-inline-end: var(--v-field-padding-end)
|
|
102
99
|
padding-top: var(--v-field-padding-top, $field-control-padding-top)
|
|
103
|
-
|
|
100
|
+
flex: 1 0 0
|
|
101
|
+
min-width: 0
|
|
104
102
|
|
|
105
103
|
input
|
|
106
104
|
letter-spacing: inherit
|
|
@@ -210,7 +208,7 @@
|
|
|
210
208
|
.v-field.v-field--active &
|
|
211
209
|
visibility: visible
|
|
212
210
|
|
|
213
|
-
.v-field--variant-
|
|
211
|
+
.v-field--variant-solo &,
|
|
214
212
|
.v-field--variant-filled &
|
|
215
213
|
$root: &
|
|
216
214
|
|
|
@@ -2,7 +2,7 @@ import { createVNode as _createVNode, resolveDirective as _resolveDirective } fr
|
|
|
2
2
|
// Components
|
|
3
3
|
import { VLabel } from "../VLabel/index.mjs"; // Utilities
|
|
4
4
|
|
|
5
|
-
import { defineComponent } from "../../util/index.mjs";
|
|
5
|
+
import { defineComponent, useRender } from "../../util/index.mjs";
|
|
6
6
|
export const VFieldLabel = defineComponent({
|
|
7
7
|
name: 'VFieldLabel',
|
|
8
8
|
props: {
|
|
@@ -13,14 +13,13 @@ export const VFieldLabel = defineComponent({
|
|
|
13
13
|
let {
|
|
14
14
|
slots
|
|
15
15
|
} = _ref;
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
};
|
|
16
|
+
useRender(() => _createVNode(VLabel, {
|
|
17
|
+
"class": ['v-field-label', {
|
|
18
|
+
'v-field-label--floating': props.floating
|
|
19
|
+
}],
|
|
20
|
+
"aria-hidden": props.floating || undefined
|
|
21
|
+
}, slots));
|
|
22
|
+
return {};
|
|
24
23
|
}
|
|
25
24
|
|
|
26
25
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VFieldLabel.mjs","names":["VLabel","defineComponent","VFieldLabel","name","props","floating","Boolean","setup","slots","undefined"],"sources":["../../../src/components/VField/VFieldLabel.tsx"],"sourcesContent":["// Components\nimport { VLabel } from '@/components/VLabel'\n\n// Utilities\nimport { defineComponent } from '@/util'\n\nexport const VFieldLabel = defineComponent({\n name: 'VFieldLabel',\n\n props: {\n floating: Boolean,\n },\n\n setup (props, { slots }) {\n
|
|
1
|
+
{"version":3,"file":"VFieldLabel.mjs","names":["VLabel","defineComponent","useRender","VFieldLabel","name","props","floating","Boolean","setup","slots","undefined"],"sources":["../../../src/components/VField/VFieldLabel.tsx"],"sourcesContent":["// Components\nimport { VLabel } from '@/components/VLabel'\n\n// Utilities\nimport { defineComponent, useRender } from '@/util'\n\nexport const VFieldLabel = defineComponent({\n name: 'VFieldLabel',\n\n props: {\n floating: Boolean,\n },\n\n setup (props, { slots }) {\n useRender(() => (\n <VLabel\n class={[\n 'v-field-label',\n { 'v-field-label--floating': props.floating },\n ]}\n aria-hidden={ props.floating || undefined }\n v-slots={ slots }\n />\n ))\n\n return {}\n },\n})\n\nexport type VFieldLabel = InstanceType<typeof VFieldLabel>\n"],"mappings":";AAAA;SACSA,M,+BAET;;SACSC,e,EAAiBC,S;AAE1B,OAAO,MAAMC,WAAW,GAAGF,eAAe,CAAC;EACzCG,IAAI,EAAE,aADmC;EAGzCC,KAAK,EAAE;IACLC,QAAQ,EAAEC;EADL,CAHkC;;EAOzCC,KAAK,CAAEH,KAAF,QAAoB;IAAA,IAAX;MAAEI;IAAF,CAAW;IACvBP,SAAS,CAAC;MAAA,SAEC,CACL,eADK,EAEL;QAAE,2BAA2BG,KAAK,CAACC;MAAnC,CAFK,CAFD;MAAA,eAMQD,KAAK,CAACC,QAAN,IAAkBI;IAN1B,GAOID,KAPJ,CAAD,CAAT;IAWA,OAAO,EAAP;EACD;;AApBwC,CAAD,CAAnC"}
|
|
@@ -15,9 +15,9 @@ $field-clearable-margin: 4px !default;
|
|
|
15
15
|
$field-clearable-transition: .15s opacity, .15s width settings.$standard-easing !default;
|
|
16
16
|
|
|
17
17
|
// CONTROL
|
|
18
|
-
$field-control-
|
|
19
|
-
$field-control-
|
|
20
|
-
$field-control-
|
|
18
|
+
$field-control-solo-background: rgb(var(--v-theme-surface)) !default;
|
|
19
|
+
$field-control-solo-color: rgba(var(--v-theme-on-surface), var(--v-high-emphasis-opacity)) !default;
|
|
20
|
+
$field-control-solo-elevation: 2 !default;
|
|
21
21
|
$field-control-filled-background: rgba(var(--v-theme-on-surface), var(--v-idle-opacity)) !default;
|
|
22
22
|
$field-control-padding-start: 16px !default;
|
|
23
23
|
$field-control-padding-end: 16px !default;
|
|
@@ -3,19 +3,19 @@ import { resolveDirective as _resolveDirective, createVNode as _createVNode, mer
|
|
|
3
3
|
import "./VFileInput.css"; // Components
|
|
4
4
|
|
|
5
5
|
import { filterFieldProps, makeVFieldProps } from "../VField/VField.mjs";
|
|
6
|
+
import { filterInputProps, makeVInputProps, VInput } from "../VInput/VInput.mjs";
|
|
6
7
|
import { VChip } from "../VChip/index.mjs";
|
|
7
8
|
import { VCounter } from "../VCounter/index.mjs";
|
|
8
9
|
import { VField } from "../VField/index.mjs"; // Composables
|
|
9
10
|
|
|
11
|
+
import { IconValue } from "../../composables/icons.mjs";
|
|
10
12
|
import { useForwardRef } from "../../composables/forwardRef.mjs";
|
|
11
13
|
import { useLocale } from "../../composables/locale.mjs";
|
|
12
|
-
import { useProxiedModel } from "../../composables/proxiedModel.mjs";
|
|
13
|
-
import { IconValue } from "../../composables/icons.mjs"; // Utilities
|
|
14
|
+
import { useProxiedModel } from "../../composables/proxiedModel.mjs"; // Utilities
|
|
14
15
|
|
|
15
16
|
import { computed, nextTick, ref } from 'vue';
|
|
16
17
|
import { defineComponent, filterInputAttrs, humanReadableFileSize, useRender, wrapInArray } from "../../util/index.mjs"; // Types
|
|
17
18
|
|
|
18
|
-
import { filterInputProps, makeVInputProps, VInput } from "../VInput/VInput.mjs";
|
|
19
19
|
export const VFileInput = defineComponent({
|
|
20
20
|
name: 'VFileInput',
|
|
21
21
|
inheritAttrs: false,
|
|
@@ -145,6 +145,7 @@ export const VFileInput = defineComponent({
|
|
|
145
145
|
|
|
146
146
|
useRender(() => {
|
|
147
147
|
const hasCounter = !!(slots.counter || props.counter);
|
|
148
|
+
const hasDetails = !!(hasCounter || slots.details);
|
|
148
149
|
const [rootAttrs, inputAttrs] = filterInputAttrs(attrs);
|
|
149
150
|
const [{
|
|
150
151
|
modelValue: _,
|
|
@@ -221,10 +222,14 @@ export const VFileInput = defineComponent({
|
|
|
221
222
|
}
|
|
222
223
|
});
|
|
223
224
|
},
|
|
224
|
-
details:
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
225
|
+
details: hasDetails ? slotProps => {
|
|
226
|
+
var _slots$details;
|
|
227
|
+
|
|
228
|
+
return _createVNode(_Fragment, null, [(_slots$details = slots.details) == null ? void 0 : _slots$details.call(slots, slotProps), hasCounter && _createVNode(_Fragment, null, [_createVNode("span", null, null), _createVNode(VCounter, {
|
|
229
|
+
"active": !!model.value.length,
|
|
230
|
+
"value": counterValue.value
|
|
231
|
+
}, slots.counter)])]);
|
|
232
|
+
} : undefined
|
|
228
233
|
});
|
|
229
234
|
});
|
|
230
235
|
return useForwardRef({}, vInputRef, vFieldRef, inputRef);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VFileInput.mjs","names":["filterFieldProps","makeVFieldProps","VChip","VCounter","VField","useForwardRef","useLocale","useProxiedModel","IconValue","computed","nextTick","ref","defineComponent","filterInputAttrs","humanReadableFileSize","useRender","wrapInArray","filterInputProps","makeVInputProps","VInput","VFileInput","name","inheritAttrs","props","chips","Boolean","counter","counterSizeString","type","String","default","counterString","multiple","hint","persistentHint","placeholder","showSize","Number","validator","v","includes","prependIcon","modelValue","Array","val","every","clearable","emits","e","files","setup","attrs","emit","slots","t","model","base","undefined","totalBytes","value","reduce","bytes","size","totalBytesReadable","fileNames","map","file","counterValue","fileCount","length","vInputRef","vFieldRef","isFocused","inputRef","messages","onFocus","document","activeElement","focus","onControlClick","click","onClear","stopPropagation","hasCounter","rootAttrs","inputAttrs","_","inputProps","fieldProps","isDisabled","isDirty","isReadonly","isValid","class","fieldClass","slotProps","target","selection","text","color","join","details"],"sources":["../../../src/components/VFileInput/VFileInput.tsx"],"sourcesContent":["// Styles\nimport './VFileInput.sass'\n\n// Components\nimport { filterFieldProps, makeVFieldProps } from '@/components/VField/VField'\nimport { VChip } from '@/components/VChip'\nimport { VCounter } from '@/components/VCounter'\nimport { VField } from '@/components/VField'\n\n// Composables\nimport { useForwardRef } from '@/composables/forwardRef'\nimport { useLocale } from '@/composables/locale'\nimport { useProxiedModel } from '@/composables/proxiedModel'\nimport { IconValue } from '@/composables/icons'\n\n// Utilities\nimport { computed, nextTick, ref } from 'vue'\nimport { defineComponent, filterInputAttrs, humanReadableFileSize, useRender, wrapInArray } from '@/util'\n\n// Types\nimport type { PropType } from 'vue'\nimport { filterInputProps, makeVInputProps, VInput } from '@/components/VInput/VInput'\n\nexport const VFileInput = defineComponent({\n name: 'VFileInput',\n\n inheritAttrs: false,\n\n props: {\n chips: Boolean,\n counter: Boolean,\n counterSizeString: {\n type: String,\n default: '$vuetify.fileInput.counterSize',\n },\n counterString: {\n type: String,\n default: '$vuetify.fileInput.counter',\n },\n multiple: Boolean,\n hint: String,\n persistentHint: Boolean,\n placeholder: String,\n showSize: {\n type: [Boolean, Number] as PropType<boolean | 1000 | 1024>,\n default: false,\n validator: (v: boolean | number) => {\n return (\n typeof v === 'boolean' ||\n [1000, 1024].includes(v)\n )\n },\n },\n\n ...makeVInputProps(),\n\n prependIcon: {\n type: IconValue,\n default: '$file',\n },\n modelValue: {\n type: Array as PropType<File[]>,\n default: () => ([]),\n validator: (val: any) => {\n return wrapInArray(val).every(v => v != null && typeof v === 'object')\n },\n },\n\n ...makeVFieldProps({ clearable: true }),\n },\n\n emits: {\n 'click:clear': (e: MouseEvent) => true,\n 'click:control': (e: MouseEvent) => true,\n 'update:modelValue': (files: File[]) => true,\n },\n\n setup (props, { attrs, emit, slots }) {\n const { t } = useLocale()\n const model = useProxiedModel(props, 'modelValue')\n const base = computed(() => typeof props.showSize !== 'boolean' ? props.showSize : undefined)\n const totalBytes = computed(() => (model.value ?? []).reduce((bytes, { size = 0 }) => bytes + size, 0))\n const totalBytesReadable = computed(() => humanReadableFileSize(totalBytes.value, base.value))\n\n const fileNames = computed(() => (model.value ?? []).map(file => {\n const { name = '', size = 0 } = file\n\n return !props.showSize\n ? name\n : `${name} (${humanReadableFileSize(size, base.value)})`\n }))\n\n const counterValue = computed(() => {\n const fileCount = model.value?.length ?? 0\n if (props.showSize) return t(props.counterSizeString, fileCount, totalBytesReadable.value)\n else return t(props.counterString, fileCount)\n })\n const vInputRef = ref<VInput>()\n const vFieldRef = ref<VInput>()\n const isFocused = ref(false)\n const inputRef = ref<HTMLInputElement>()\n const messages = computed(() => {\n return props.messages.length\n ? props.messages\n : (props.persistentHint) ? props.hint : ''\n })\n function onFocus () {\n if (inputRef.value !== document.activeElement) {\n inputRef.value?.focus()\n }\n\n if (!isFocused.value) {\n isFocused.value = true\n }\n }\n function onControlClick (e: MouseEvent) {\n inputRef.value?.click()\n\n emit('click:control', e)\n }\n function onClear (e: MouseEvent) {\n e.stopPropagation()\n\n onFocus()\n\n nextTick(() => {\n model.value = []\n\n if (inputRef?.value) {\n inputRef.value.value = ''\n }\n\n emit('click:clear', e)\n })\n }\n\n useRender(() => {\n const hasCounter = !!(slots.counter || props.counter)\n const [rootAttrs, inputAttrs] = filterInputAttrs(attrs)\n const [{ modelValue: _, ...inputProps }] = filterInputProps(props)\n const [fieldProps] = filterFieldProps(props)\n\n return (\n <VInput\n ref={ vInputRef }\n v-model={ model.value }\n class=\"v-file-input\"\n { ...rootAttrs }\n { ...inputProps }\n onClick:prepend={ onControlClick }\n messages={ messages.value }\n >\n {{\n ...slots,\n default: ({\n isDisabled,\n isDirty,\n isReadonly,\n isValid,\n }) => (\n <VField\n ref={ vFieldRef }\n prepend-icon={ props.prependIcon }\n onClick:control={ onControlClick }\n onClick:clear={ onClear }\n { ...fieldProps }\n active={ isDirty.value || isFocused.value }\n dirty={ isDirty.value }\n focused={ isFocused.value }\n error={ isValid.value === false }\n >\n {{\n ...slots,\n default: ({\n props: { class: fieldClass, ...slotProps },\n }) => (\n <>\n <input\n ref={ inputRef }\n type=\"file\"\n readonly={ isReadonly.value }\n disabled={ isDisabled.value }\n multiple={ props.multiple }\n name={ props.name }\n onClick={ e => {\n e.stopPropagation()\n\n onFocus()\n } }\n onChange={ e => {\n if (!e.target) return\n\n const target = e.target as HTMLInputElement\n model.value = [...target.files ?? []]\n } }\n onFocus={ onFocus }\n onBlur={ () => (isFocused.value = false) }\n { ...slotProps }\n { ...inputAttrs }\n />\n\n { model.value.length > 0 && (\n <div class={ fieldClass }>\n { slots.selection ? slots.selection({\n fileNames: fileNames.value,\n totalBytes: totalBytes.value,\n totalBytesReadable: totalBytesReadable.value,\n })\n : props.chips ? fileNames.value.map(text => (\n <VChip\n key={ text }\n size=\"small\"\n color={ props.color }\n >{ text }</VChip>\n ))\n : fileNames.value.join(', ') }\n </div>\n ) }\n </>\n ),\n }}\n </VField>\n ),\n details: hasCounter ? () => (\n <>\n <span />\n\n <VCounter\n active={ !!model.value.length }\n value={ counterValue.value }\n v-slots={ slots.counter }\n />\n </>\n ) : undefined,\n }}\n </VInput>\n )\n })\n\n return useForwardRef({}, vInputRef, vFieldRef, inputRef)\n },\n})\n\nexport type VFileInput = InstanceType<typeof VFileInput>\n"],"mappings":";AAAA;AACA,0B,CAEA;;SACSA,gB,EAAkBC,e;SAClBC,K;SACAC,Q;SACAC,M,+BAET;;SACSC,a;SACAC,S;SACAC,e;SACAC,S,uCAET;;AACA,SAASC,QAAT,EAAmBC,QAAnB,EAA6BC,GAA7B,QAAwC,KAAxC;SACSC,e,EAAiBC,gB,EAAkBC,qB,EAAuBC,S,EAAWC,W,gCAE9E;;SAESC,gB,EAAkBC,e,EAAiBC,M;AAE5C,OAAO,MAAMC,UAAU,GAAGR,eAAe,CAAC;EACxCS,IAAI,EAAE,YADkC;EAGxCC,YAAY,EAAE,KAH0B;EAKxCC,KAAK,EAAE;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ALP;UAAA,SAMRF,YAAY,CAACR;QANL,GAONN,KAAK,CAAC3B,OAPA,GAAH,GAUf+B;MA3FV;IA+FD,CArGQ,CAAT;IAuGA,OAAOpD,aAAa,CAAC,EAAD,EAAKiE,SAAL,EAAgBC,SAAhB,EAA2BE,QAA3B,CAApB;EACD;;AAzNuC,CAAD,CAAlC"}
|
|
1
|
+
{"version":3,"file":"VFileInput.mjs","names":["filterFieldProps","makeVFieldProps","filterInputProps","makeVInputProps","VInput","VChip","VCounter","VField","IconValue","useForwardRef","useLocale","useProxiedModel","computed","nextTick","ref","defineComponent","filterInputAttrs","humanReadableFileSize","useRender","wrapInArray","VFileInput","name","inheritAttrs","props","chips","Boolean","counter","counterSizeString","type","String","default","counterString","multiple","hint","persistentHint","placeholder","showSize","Number","validator","v","includes","prependIcon","modelValue","Array","val","every","clearable","emits","e","files","setup","attrs","emit","slots","t","model","base","undefined","totalBytes","value","reduce","bytes","size","totalBytesReadable","fileNames","map","file","counterValue","fileCount","length","vInputRef","vFieldRef","isFocused","inputRef","messages","onFocus","document","activeElement","focus","onControlClick","click","onClear","stopPropagation","hasCounter","hasDetails","details","rootAttrs","inputAttrs","_","inputProps","fieldProps","isDisabled","isDirty","isReadonly","isValid","class","fieldClass","slotProps","target","selection","text","color","join"],"sources":["../../../src/components/VFileInput/VFileInput.tsx"],"sourcesContent":["// Styles\nimport './VFileInput.sass'\n\n// Components\nimport { filterFieldProps, makeVFieldProps } from '@/components/VField/VField'\nimport { filterInputProps, makeVInputProps, VInput } from '@/components/VInput/VInput'\nimport { VChip } from '@/components/VChip'\nimport { VCounter } from '@/components/VCounter'\nimport { VField } from '@/components/VField'\n\n// Composables\nimport { IconValue } from '@/composables/icons'\nimport { useForwardRef } from '@/composables/forwardRef'\nimport { useLocale } from '@/composables/locale'\nimport { useProxiedModel } from '@/composables/proxiedModel'\n\n// Utilities\nimport { computed, nextTick, ref } from 'vue'\nimport { defineComponent, filterInputAttrs, humanReadableFileSize, useRender, wrapInArray } from '@/util'\n\n// Types\nimport type { PropType } from 'vue'\n\nexport const VFileInput = defineComponent({\n name: 'VFileInput',\n\n inheritAttrs: false,\n\n props: {\n chips: Boolean,\n counter: Boolean,\n counterSizeString: {\n type: String,\n default: '$vuetify.fileInput.counterSize',\n },\n counterString: {\n type: String,\n default: '$vuetify.fileInput.counter',\n },\n multiple: Boolean,\n hint: String,\n persistentHint: Boolean,\n placeholder: String,\n showSize: {\n type: [Boolean, Number] as PropType<boolean | 1000 | 1024>,\n default: false,\n validator: (v: boolean | number) => {\n return (\n typeof v === 'boolean' ||\n [1000, 1024].includes(v)\n )\n },\n },\n\n ...makeVInputProps(),\n\n prependIcon: {\n type: IconValue,\n default: '$file',\n },\n modelValue: {\n type: Array as PropType<File[]>,\n default: () => ([]),\n validator: (val: any) => {\n return wrapInArray(val).every(v => v != null && typeof v === 'object')\n },\n },\n\n ...makeVFieldProps({ clearable: true }),\n },\n\n emits: {\n 'click:clear': (e: MouseEvent) => true,\n 'click:control': (e: MouseEvent) => true,\n 'update:modelValue': (files: File[]) => true,\n },\n\n setup (props, { attrs, emit, slots }) {\n const { t } = useLocale()\n const model = useProxiedModel(props, 'modelValue')\n const base = computed(() => typeof props.showSize !== 'boolean' ? props.showSize : undefined)\n const totalBytes = computed(() => (model.value ?? []).reduce((bytes, { size = 0 }) => bytes + size, 0))\n const totalBytesReadable = computed(() => humanReadableFileSize(totalBytes.value, base.value))\n\n const fileNames = computed(() => (model.value ?? []).map(file => {\n const { name = '', size = 0 } = file\n\n return !props.showSize\n ? name\n : `${name} (${humanReadableFileSize(size, base.value)})`\n }))\n\n const counterValue = computed(() => {\n const fileCount = model.value?.length ?? 0\n if (props.showSize) return t(props.counterSizeString, fileCount, totalBytesReadable.value)\n else return t(props.counterString, fileCount)\n })\n const vInputRef = ref<VInput>()\n const vFieldRef = ref<VInput>()\n const isFocused = ref(false)\n const inputRef = ref<HTMLInputElement>()\n const messages = computed(() => {\n return props.messages.length\n ? props.messages\n : (props.persistentHint) ? props.hint : ''\n })\n function onFocus () {\n if (inputRef.value !== document.activeElement) {\n inputRef.value?.focus()\n }\n\n if (!isFocused.value) {\n isFocused.value = true\n }\n }\n function onControlClick (e: MouseEvent) {\n inputRef.value?.click()\n\n emit('click:control', e)\n }\n function onClear (e: MouseEvent) {\n e.stopPropagation()\n\n onFocus()\n\n nextTick(() => {\n model.value = []\n\n if (inputRef?.value) {\n inputRef.value.value = ''\n }\n\n emit('click:clear', e)\n })\n }\n\n useRender(() => {\n const hasCounter = !!(slots.counter || props.counter)\n const hasDetails = !!(hasCounter || slots.details)\n const [rootAttrs, inputAttrs] = filterInputAttrs(attrs)\n const [{ modelValue: _, ...inputProps }] = filterInputProps(props)\n const [fieldProps] = filterFieldProps(props)\n\n return (\n <VInput\n ref={ vInputRef }\n v-model={ model.value }\n class=\"v-file-input\"\n { ...rootAttrs }\n { ...inputProps }\n onClick:prepend={ onControlClick }\n messages={ messages.value }\n >\n {{\n ...slots,\n default: ({\n isDisabled,\n isDirty,\n isReadonly,\n isValid,\n }) => (\n <VField\n ref={ vFieldRef }\n prepend-icon={ props.prependIcon }\n onClick:control={ onControlClick }\n onClick:clear={ onClear }\n { ...fieldProps }\n active={ isDirty.value || isFocused.value }\n dirty={ isDirty.value }\n focused={ isFocused.value }\n error={ isValid.value === false }\n >\n {{\n ...slots,\n default: ({\n props: { class: fieldClass, ...slotProps },\n }) => (\n <>\n <input\n ref={ inputRef }\n type=\"file\"\n readonly={ isReadonly.value }\n disabled={ isDisabled.value }\n multiple={ props.multiple }\n name={ props.name }\n onClick={ e => {\n e.stopPropagation()\n\n onFocus()\n } }\n onChange={ e => {\n if (!e.target) return\n\n const target = e.target as HTMLInputElement\n model.value = [...target.files ?? []]\n } }\n onFocus={ onFocus }\n onBlur={ () => (isFocused.value = false) }\n { ...slotProps }\n { ...inputAttrs }\n />\n\n { model.value.length > 0 && (\n <div class={ fieldClass }>\n { slots.selection ? slots.selection({\n fileNames: fileNames.value,\n totalBytes: totalBytes.value,\n totalBytesReadable: totalBytesReadable.value,\n })\n : props.chips ? fileNames.value.map(text => (\n <VChip\n key={ text }\n size=\"small\"\n color={ props.color }\n >{ text }</VChip>\n ))\n : fileNames.value.join(', ') }\n </div>\n ) }\n </>\n ),\n }}\n </VField>\n ),\n details: hasDetails ? slotProps => (\n <>\n { slots.details?.(slotProps) }\n\n { hasCounter && (\n <>\n <span />\n\n <VCounter\n active={ !!model.value.length }\n value={ counterValue.value }\n v-slots={ slots.counter }\n />\n </>\n ) }\n </>\n ) : undefined,\n }}\n </VInput>\n )\n })\n\n return useForwardRef({}, vInputRef, vFieldRef, inputRef)\n },\n})\n\nexport type VFileInput = InstanceType<typeof VFileInput>\n"],"mappings":";AAAA;AACA,0B,CAEA;;SACSA,gB,EAAkBC,e;SAClBC,gB,EAAkBC,e,EAAiBC,M;SACnCC,K;SACAC,Q;SACAC,M,+BAET;;SACSC,S;SACAC,a;SACAC,S;SACAC,e,8CAET;;AACA,SAASC,QAAT,EAAmBC,QAAnB,EAA6BC,GAA7B,QAAwC,KAAxC;SACSC,e,EAAiBC,gB,EAAkBC,qB,EAAuBC,S,EAAWC,W,gCAE9E;;AAGA,OAAO,MAAMC,UAAU,GAAGL,eAAe,CAAC;EACxCM,IAAI,EAAE,YADkC;EAGxCC,YAAY,EAAE,KAH0B;EAKxCC,KAAK,EAAE;IACLC,KAAK,EAAEC,OADF;IAELC,OAAO,EAAED,OAFJ;IAGLE,iBAAiB,EAAE;MACjBC,IAAI,EAAEC,MADW;MAEjBC,OAAO,EAAE;IAFQ,CAHd;IAOLC,aAAa,EAAE;MACbH,IAAI,EAAEC,MADO;MAEbC,OAAO,EAAE;IAFI,CAPV;IAWLE,QAAQ,EAAEP,OAXL;IAYLQ,IAAI,EAAEJ,MAZD;IAaLK,cAAc,EAAET,OAbX;IAcLU,WAAW,EAAEN,MAdR;IAeLO,QAAQ,EAAE;MACRR,IAAI,EAAE,CAACH,OAAD,EAAUY,MAAV,CADE;MAERP,OAAO,EAA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AhOuC,CAAD,CAAlC"}
|
|
@@ -12,7 +12,7 @@ import { useBackgroundColor } from "../../composables/color.mjs";
|
|
|
12
12
|
import { useResizeObserver } from "../../composables/resizeObserver.mjs"; // Utilities
|
|
13
13
|
|
|
14
14
|
import { computed, ref, toRef } from 'vue';
|
|
15
|
-
import { defineComponent } from "../../util/index.mjs";
|
|
15
|
+
import { defineComponent, useRender } from "../../util/index.mjs";
|
|
16
16
|
export const VFooter = defineComponent({
|
|
17
17
|
name: 'VFooter',
|
|
18
18
|
props: {
|
|
@@ -71,11 +71,12 @@ export const VFooter = defineComponent({
|
|
|
71
71
|
active: computed(() => props.app),
|
|
72
72
|
absolute: toRef(props, 'absolute')
|
|
73
73
|
});
|
|
74
|
-
|
|
74
|
+
useRender(() => _createVNode(props.tag, {
|
|
75
75
|
"ref": resizeRef,
|
|
76
76
|
"class": ['v-footer', themeClasses.value, backgroundColorClasses.value, borderClasses.value, elevationClasses.value, roundedClasses.value],
|
|
77
77
|
"style": [backgroundColorStyles, props.app ? layoutItemStyles.value : undefined]
|
|
78
|
-
}, slots);
|
|
78
|
+
}, slots));
|
|
79
|
+
return {};
|
|
79
80
|
}
|
|
80
81
|
|
|
81
82
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VFooter.mjs","names":["makeBorderProps","useBorder","makeElevationProps","useElevation","makeLayoutItemProps","useLayoutItem","makeRoundedProps","useRounded","makeTagProps","makeThemeProps","provideTheme","useBackgroundColor","useResizeObserver","computed","ref","toRef","defineComponent","VFooter","name","props","app","Boolean","color","String","height","type","Number","default","tag","setup","slots","themeClasses","backgroundColorClasses","backgroundColorStyles","borderClasses","elevationClasses","roundedClasses","autoHeight","resizeRef","entries","length","value","target","clientHeight","parseInt","layoutItemStyles","id","order","position","layoutSize","elementSize","undefined","active","absolute"],"sources":["../../../src/components/VFooter/VFooter.tsx"],"sourcesContent":["// Styles\nimport './VFooter.sass'\n\n// Composables\nimport { makeBorderProps, useBorder } from '@/composables/border'\nimport { makeElevationProps, useElevation } from '@/composables/elevation'\nimport { makeLayoutItemProps, useLayoutItem } from '@/composables/layout'\nimport { makeRoundedProps, useRounded } from '@/composables/rounded'\nimport { makeTagProps } from '@/composables/tag'\nimport { makeThemeProps, provideTheme } from '@/composables/theme'\nimport { useBackgroundColor } from '@/composables/color'\nimport { useResizeObserver } from '@/composables/resizeObserver'\n\n// Utilities\nimport { computed, ref, toRef } from 'vue'\nimport { defineComponent } from '@/util'\n\nexport const VFooter = defineComponent({\n name: 'VFooter',\n\n props: {\n app: Boolean,\n color: String,\n height: {\n type: [Number, String],\n default: 'auto',\n },\n\n ...makeBorderProps(),\n ...makeElevationProps(),\n ...makeLayoutItemProps(),\n ...makeRoundedProps(),\n ...makeTagProps({ tag: 'footer' }),\n ...makeThemeProps(),\n },\n\n setup (props, { slots }) {\n const { themeClasses } = provideTheme(props)\n const { backgroundColorClasses, backgroundColorStyles } = useBackgroundColor(toRef(props, 'color'))\n const { borderClasses } = useBorder(props)\n const { elevationClasses } = useElevation(props)\n const { roundedClasses } = useRounded(props)\n\n const autoHeight = ref(32)\n const { resizeRef } = useResizeObserver(entries => {\n if (!entries.length) return\n autoHeight.value = entries[0].target.clientHeight\n })\n const height = computed(() => props.height === 'auto' ? autoHeight.value : parseInt(props.height, 10))\n const { layoutItemStyles } = useLayoutItem({\n id: props.name,\n order: computed(() => parseInt(props.order, 10)),\n position: computed(() => 'bottom'),\n layoutSize: height,\n elementSize: computed(() => props.height === 'auto' ? undefined : height.value),\n active: computed(() => props.app),\n absolute: toRef(props, 'absolute'),\n })\n\n
|
|
1
|
+
{"version":3,"file":"VFooter.mjs","names":["makeBorderProps","useBorder","makeElevationProps","useElevation","makeLayoutItemProps","useLayoutItem","makeRoundedProps","useRounded","makeTagProps","makeThemeProps","provideTheme","useBackgroundColor","useResizeObserver","computed","ref","toRef","defineComponent","useRender","VFooter","name","props","app","Boolean","color","String","height","type","Number","default","tag","setup","slots","themeClasses","backgroundColorClasses","backgroundColorStyles","borderClasses","elevationClasses","roundedClasses","autoHeight","resizeRef","entries","length","value","target","clientHeight","parseInt","layoutItemStyles","id","order","position","layoutSize","elementSize","undefined","active","absolute"],"sources":["../../../src/components/VFooter/VFooter.tsx"],"sourcesContent":["// Styles\nimport './VFooter.sass'\n\n// Composables\nimport { makeBorderProps, useBorder } from '@/composables/border'\nimport { makeElevationProps, useElevation } from '@/composables/elevation'\nimport { makeLayoutItemProps, useLayoutItem } from '@/composables/layout'\nimport { makeRoundedProps, useRounded } from '@/composables/rounded'\nimport { makeTagProps } from '@/composables/tag'\nimport { makeThemeProps, provideTheme } from '@/composables/theme'\nimport { useBackgroundColor } from '@/composables/color'\nimport { useResizeObserver } from '@/composables/resizeObserver'\n\n// Utilities\nimport { computed, ref, toRef } from 'vue'\nimport { defineComponent, useRender } from '@/util'\n\nexport const VFooter = defineComponent({\n name: 'VFooter',\n\n props: {\n app: Boolean,\n color: String,\n height: {\n type: [Number, String],\n default: 'auto',\n },\n\n ...makeBorderProps(),\n ...makeElevationProps(),\n ...makeLayoutItemProps(),\n ...makeRoundedProps(),\n ...makeTagProps({ tag: 'footer' }),\n ...makeThemeProps(),\n },\n\n setup (props, { slots }) {\n const { themeClasses } = provideTheme(props)\n const { backgroundColorClasses, backgroundColorStyles } = useBackgroundColor(toRef(props, 'color'))\n const { borderClasses } = useBorder(props)\n const { elevationClasses } = useElevation(props)\n const { roundedClasses } = useRounded(props)\n\n const autoHeight = ref(32)\n const { resizeRef } = useResizeObserver(entries => {\n if (!entries.length) return\n autoHeight.value = entries[0].target.clientHeight\n })\n const height = computed(() => props.height === 'auto' ? autoHeight.value : parseInt(props.height, 10))\n const { layoutItemStyles } = useLayoutItem({\n id: props.name,\n order: computed(() => parseInt(props.order, 10)),\n position: computed(() => 'bottom'),\n layoutSize: height,\n elementSize: computed(() => props.height === 'auto' ? undefined : height.value),\n active: computed(() => props.app),\n absolute: toRef(props, 'absolute'),\n })\n\n useRender(() => (\n <props.tag\n ref={ resizeRef }\n class={[\n 'v-footer',\n themeClasses.value,\n backgroundColorClasses.value,\n borderClasses.value,\n elevationClasses.value,\n roundedClasses.value,\n ]}\n style={[\n backgroundColorStyles,\n props.app ? layoutItemStyles.value : undefined,\n ]}\n v-slots={ slots }\n />\n ))\n\n return {}\n },\n})\n"],"mappings":";AAAA;AACA,uB,CAEA;;SACSA,e,EAAiBC,S;SACjBC,kB,EAAoBC,Y;SACpBC,mB,EAAqBC,a;SACrBC,gB,EAAkBC,U;SAClBC,Y;SACAC,c,EAAgBC,Y;SAChBC,kB;SACAC,iB,gDAET;;AACA,SAASC,QAAT,EAAmBC,GAAnB,EAAwBC,KAAxB,QAAqC,KAArC;SACSC,e,EAAiBC,S;AAE1B,OAAO,MAAMC,OAAO,GAAGF,eAAe,CAAC;EACrCG,IAAI,EAAE,SAD+B;EAGrCC,KAAK,EAAE;IACLC,GAAG,EAAEC,OADA;IAELC,KAAK,EAAEC,MAFF;IAGLC,MAAM,EAAE;MACNC,IAAI,EAAE,CAACC,MAAD,EAASH,MAAT,CADA;MAENI,OAAO,EAAE;IAFH,CAHH;IAQL,GAAG5B,eAAe,EARb;IASL,GAAGE,kBAAkB,EAThB;IAUL,GAAGE,mBAAmB,EAVjB;IAWL,GAAGE,gBAAgB,EAXd;IAYL,GAAGE,YAAY,CAAC;MAAEqB,GAAG,EAAE;IAAP,CAAD,CAZV;IAaL,GAAGpB,cAAc;EAbZ,CAH8B;;EAmBrCqB,KAAK,CAAEV,KAAF,QAAoB;IAAA,IAAX;MAAEW;IAAF,CAAW;IACvB,MAAM;MAAEC;IAAF,IAAmBtB,YAAY,CAACU,KAAD,CAArC;IACA,MAAM;MAAEa,sBAAF;MAA0BC;IAA1B,IAAoDvB,kBAAkB,CAACI,KAAK,CAACK,KAAD,EAAQ,OAAR,CAAN,CAA5E;IACA,MAAM;MAAEe;IAAF,IAAoBlC,SAAS,CAACmB,KAAD,CAAnC;IACA,MAAM;MAAEgB;IAAF,IAAuBjC,YAAY,CAAC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M,KALZ,EAMLL,cAAc,CAACK,KANV,CAHD;MAAA,SAWC,CACLR,qBADK,EAELd,KAAK,CAACC,GAAN,GAAYyB,gBAAgB,CAACJ,KAA7B,GAAqCU,SAFhC;IAXD,GAeIrB,KAfJ,CAAD,CAAT;IAmBA,OAAO,EAAP;EACD;;AA9DoC,CAAD,CAA/B"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
@use 'sass:map';
|
|
2
2
|
@use '../../styles/settings';
|
|
3
3
|
|
|
4
|
-
//
|
|
4
|
+
// VFooter
|
|
5
5
|
$footer-background: rgb(var(--v-theme-surface)) !default;
|
|
6
6
|
$footer-border-radius: map.get(settings.$rounded, 0) !default;
|
|
7
7
|
$footer-color: rgba(var(--v-theme-on-surface), var(--v-high-emphasis-opacity)) !default;
|
|
@@ -12,6 +12,7 @@ $footer-padding: 8px 16px !default;
|
|
|
12
12
|
$footer-positions: absolute fixed !default;
|
|
13
13
|
$footer-rounded-border-radius: settings.$border-radius-root !default;
|
|
14
14
|
|
|
15
|
+
// Lists
|
|
15
16
|
$footer-theme: (
|
|
16
17
|
$footer-background,
|
|
17
18
|
$footer-color
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { createVNode as _createVNode } from "vue";
|
|
2
2
|
// Composables
|
|
3
|
-
import { createForm, makeFormProps } from "../../composables/form.mjs";
|
|
3
|
+
import { createForm, makeFormProps } from "../../composables/form.mjs";
|
|
4
|
+
import { useForwardRef } from "../../composables/forwardRef.mjs"; // Utilities
|
|
4
5
|
|
|
5
6
|
import { ref } from 'vue';
|
|
6
|
-
import { defineComponent, useRender } from "../../util/index.mjs";
|
|
7
|
-
import { useForwardRef } from "../../composables/forwardRef.mjs"; // Types
|
|
7
|
+
import { defineComponent, useRender } from "../../util/index.mjs"; // Types
|
|
8
8
|
|
|
9
9
|
export const VForm = defineComponent({
|
|
10
10
|
name: 'VForm',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VForm.mjs","names":["createForm","makeFormProps","ref","defineComponent","useRender","
|
|
1
|
+
{"version":3,"file":"VForm.mjs","names":["createForm","makeFormProps","useForwardRef","ref","defineComponent","useRender","VForm","name","props","emits","val","submit","e","setup","slots","emit","form","formRef","onReset","preventDefault","reset","onSubmit","_e","ready","validate","then","bind","catch","finally","defaultPrevented","valid","value","default"],"sources":["../../../src/components/VForm/VForm.tsx"],"sourcesContent":["// Composables\nimport { createForm, makeFormProps } from '@/composables/form'\nimport { useForwardRef } from '@/composables/forwardRef'\n\n// Utilities\nimport { ref } from 'vue'\nimport { defineComponent, useRender } from '@/util'\n\n// Types\nimport type { SubmitEventPromise } from '@/composables/form'\n\nexport const VForm = defineComponent({\n name: 'VForm',\n\n props: {\n ...makeFormProps(),\n },\n\n emits: {\n 'update:modelValue': (val: boolean | null) => true,\n submit: (e: SubmitEventPromise) => true,\n },\n\n setup (props, { slots, emit }) {\n const form = createForm(props)\n const formRef = ref<HTMLFormElement>()\n\n function onReset (e: Event) {\n e.preventDefault()\n form.reset()\n }\n\n function onSubmit (_e: Event) {\n const e = _e as SubmitEventPromise\n\n const ready = form.validate()\n e.then = ready.then.bind(ready)\n e.catch = ready.catch.bind(ready)\n e.finally = ready.finally.bind(ready)\n\n emit('submit', e)\n\n if (!e.defaultPrevented) {\n ready.then(({ valid }) => {\n if (valid) {\n formRef.value?.submit()\n }\n })\n }\n\n e.preventDefault()\n }\n\n useRender(() => ((\n <form\n ref={ formRef }\n class=\"v-form\"\n novalidate\n onReset={ onReset }\n onSubmit={ onSubmit }\n >\n { slots.default?.(form) }\n </form>\n )))\n\n return useForwardRef(form, formRef)\n },\n})\n\nexport type VForm = InstanceType<typeof VForm>\n"],"mappings":";AAAA;SACSA,U,EAAYC,a;SACZC,a,4CAET;;AACA,SAASC,GAAT,QAAoB,KAApB;SACSC,e,EAAiBC,S,gCAE1B;;AAGA,OAAO,MAAMC,KAAK,GAAGF,eAAe,CAAC;EACnCG,IAAI,EAAE,OAD6B;EAGnCC,KAAK,EAA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