kdutify 0.16.9-rc.0
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/LICENSE +21 -0
- package/README.md +70 -0
- package/dist/kdutify.css +12850 -0
- package/dist/kdutify.css.map +1 -0
- package/dist/kdutify.js +16285 -0
- package/dist/kdutify.js.map +1 -0
- package/dist/kdutify.min.css +7 -0
- package/dist/kdutify.min.css.map +1 -0
- package/dist/kdutify.min.js +6 -0
- package/es5/components/KAlert/KAlert.js +80 -0
- package/es5/components/KAlert/index.js +7 -0
- package/es5/components/KApp/KApp.js +67 -0
- package/es5/components/KApp/index.js +7 -0
- package/es5/components/KAvatar/KAvatar.js +31 -0
- package/es5/components/KAvatar/index.js +7 -0
- package/es5/components/KBadge/KBadge.js +59 -0
- package/es5/components/KBadge/index.js +7 -0
- package/es5/components/KBottomNav/KBottomNav.js +50 -0
- package/es5/components/KBottomNav/index.js +7 -0
- package/es5/components/KBottomSheet/KBottomSheet.js +36 -0
- package/es5/components/KBottomSheet/index.js +7 -0
- package/es5/components/KBreadcrumbs/KBreadcrumbs.js +36 -0
- package/es5/components/KBreadcrumbs/KBreadcrumbsItem.js +38 -0
- package/es5/components/KBreadcrumbs/index.js +11 -0
- package/es5/components/KBtn/KBtn.js +153 -0
- package/es5/components/KBtn/index.js +7 -0
- package/es5/components/KBtnToggle/KBtnToggle.js +92 -0
- package/es5/components/KBtnToggle/index.js +7 -0
- package/es5/components/KCard/KCard.js +63 -0
- package/es5/components/KCard/KCardMedia.js +41 -0
- package/es5/components/KCard/KCardTitle.js +21 -0
- package/es5/components/KCard/index.js +19 -0
- package/es5/components/KCarousel/KCarousel.js +178 -0
- package/es5/components/KCarousel/KCarouselItem.js +63 -0
- package/es5/components/KCarousel/index.js +11 -0
- package/es5/components/KCheckbox/KCheckbox.js +89 -0
- package/es5/components/KCheckbox/index.js +7 -0
- package/es5/components/KChip/KChip.js +81 -0
- package/es5/components/KChip/index.js +7 -0
- package/es5/components/KDataTable/KDataTable.js +347 -0
- package/es5/components/KDataTable/KEditDialog.js +108 -0
- package/es5/components/KDataTable/index.js +14 -0
- package/es5/components/KDataTable/mixins/body.js +103 -0
- package/es5/components/KDataTable/mixins/foot.js +118 -0
- package/es5/components/KDataTable/mixins/head.js +123 -0
- package/es5/components/KDataTable/mixins/progress.js +16 -0
- package/es5/components/KDatePicker/KDatePicker.js +416 -0
- package/es5/components/KDatePicker/index.js +7 -0
- package/es5/components/KDatePicker/mixins/date-header.js +68 -0
- package/es5/components/KDatePicker/mixins/date-table.js +101 -0
- package/es5/components/KDatePicker/mixins/date-title.js +64 -0
- package/es5/components/KDatePicker/mixins/date-years.js +53 -0
- package/es5/components/KDatePicker/mixins/month-table.js +91 -0
- package/es5/components/KDialog/KDialog.js +181 -0
- package/es5/components/KDialog/index.js +7 -0
- package/es5/components/KDivider/KDivider.js +29 -0
- package/es5/components/KDivider/index.js +7 -0
- package/es5/components/KExpansionPanel/KExpansionPanel.js +60 -0
- package/es5/components/KExpansionPanel/KExpansionPanelContent.js +114 -0
- package/es5/components/KExpansionPanel/index.js +9 -0
- package/es5/components/KFooter/KFooter.js +61 -0
- package/es5/components/KFooter/index.js +7 -0
- package/es5/components/KForm/KForm.js +203 -0
- package/es5/components/KForm/index.js +7 -0
- package/es5/components/KGrid/KContainer.js +5 -0
- package/es5/components/KGrid/KContent.js +33 -0
- package/es5/components/KGrid/KFlex.js +5 -0
- package/es5/components/KGrid/KLayout.js +5 -0
- package/es5/components/KGrid/grid.js +43 -0
- package/es5/components/KGrid/index.js +20 -0
- package/es5/components/KIcon/KIcon.js +93 -0
- package/es5/components/KIcon/index.js +7 -0
- package/es5/components/KList/KList.js +82 -0
- package/es5/components/KList/KListGroup.js +100 -0
- package/es5/components/KList/KListTile.js +65 -0
- package/es5/components/KList/KListTileAction.js +15 -0
- package/es5/components/KList/index.js +27 -0
- package/es5/components/KMenu/KMenu.js +178 -0
- package/es5/components/KMenu/index.js +7 -0
- package/es5/components/KMenu/mixins/menu-activator.js +59 -0
- package/es5/components/KMenu/mixins/menu-generators.js +88 -0
- package/es5/components/KMenu/mixins/menu-keyable.js +64 -0
- package/es5/components/KMenu/mixins/menu-position.js +64 -0
- package/es5/components/KNavigationDrawer/KNavigationDrawer.js +238 -0
- package/es5/components/KNavigationDrawer/index.js +7 -0
- package/es5/components/KPagination/KPagination.js +167 -0
- package/es5/components/KPagination/index.js +7 -0
- package/es5/components/KParallax/KParallax.js +98 -0
- package/es5/components/KParallax/index.js +7 -0
- package/es5/components/KProgressCircular/KProgressCircular.js +145 -0
- package/es5/components/KProgressCircular/index.js +7 -0
- package/es5/components/KProgressLinear/KProgressLinear.js +146 -0
- package/es5/components/KProgressLinear/index.js +7 -0
- package/es5/components/KRadioGroup/KRadio.js +148 -0
- package/es5/components/KRadioGroup/KRadioGroup.js +139 -0
- package/es5/components/KRadioGroup/index.js +11 -0
- package/es5/components/KSelect/KSelect.js +635 -0
- package/es5/components/KSelect/index.js +7 -0
- package/es5/components/KSelect/mixins/select-autocomplete.js +125 -0
- package/es5/components/KSelect/mixins/select-generators.js +298 -0
- package/es5/components/KSlider/KSlider.js +306 -0
- package/es5/components/KSlider/index.js +7 -0
- package/es5/components/KSnackbar/KSnackbar.js +106 -0
- package/es5/components/KSnackbar/index.js +7 -0
- package/es5/components/KSpeedDial/KSpeedDial.js +89 -0
- package/es5/components/KSpeedDial/index.js +7 -0
- package/es5/components/KStepper/KStepper.js +112 -0
- package/es5/components/KStepper/KStepperContent.js +134 -0
- package/es5/components/KStepper/KStepperStep.js +105 -0
- package/es5/components/KStepper/index.js +17 -0
- package/es5/components/KSubheader/KSubheader.js +29 -0
- package/es5/components/KSubheader/index.js +7 -0
- package/es5/components/KSwitch/KSwitch.js +55 -0
- package/es5/components/KSwitch/index.js +7 -0
- package/es5/components/KSystemBar/KSystemBar.js +54 -0
- package/es5/components/KSystemBar/index.js +7 -0
- package/es5/components/KTabs/KTabs.js +272 -0
- package/es5/components/KTabs/KTabsBar.js +205 -0
- package/es5/components/KTabs/KTabsContent.js +86 -0
- package/es5/components/KTabs/KTabsItem.js +103 -0
- package/es5/components/KTabs/KTabsItems.js +40 -0
- package/es5/components/KTabs/KTabsSlider.js +14 -0
- package/es5/components/KTabs/index.js +17 -0
- package/es5/components/KTextField/KTextField.js +275 -0
- package/es5/components/KTextField/index.js +7 -0
- package/es5/components/KTimePicker/KTimePicker.js +302 -0
- package/es5/components/KTimePicker/index.js +7 -0
- package/es5/components/KTimePicker/mixins/time-body.js +207 -0
- package/es5/components/KTimePicker/mixins/time-title.js +55 -0
- package/es5/components/KToolbar/KToolbar.js +193 -0
- package/es5/components/KToolbar/KToolbarSideIcon.js +29 -0
- package/es5/components/KToolbar/index.js +17 -0
- package/es5/components/KTooltip/KTooltip.js +156 -0
- package/es5/components/KTooltip/index.js +7 -0
- package/es5/components/Kdutify/index.js +50 -0
- package/es5/components/index.js +45 -0
- package/es5/components/transitions/expand-transition.js +36 -0
- package/es5/components/transitions/index.js +47 -0
- package/es5/components/transitions/row-expand-transition.js +38 -0
- package/es5/directives/click-outside.js +100 -0
- package/es5/directives/index.js +15 -0
- package/es5/directives/resize.js +30 -0
- package/es5/directives/ripple.js +144 -0
- package/es5/directives/scroll.js +32 -0
- package/es5/directives/touch.js +102 -0
- package/es5/index.js +30 -0
- package/es5/mixins/applicationable.js +9 -0
- package/es5/mixins/bootable.js +31 -0
- package/es5/mixins/button-group.js +82 -0
- package/es5/mixins/colorable.js +24 -0
- package/es5/mixins/contextualable.js +10 -0
- package/es5/mixins/delayable.js +57 -0
- package/es5/mixins/dependent.js +121 -0
- package/es5/mixins/detachable.js +41 -0
- package/es5/mixins/filterable.js +8 -0
- package/es5/mixins/input.js +219 -0
- package/es5/mixins/loadable.js +31 -0
- package/es5/mixins/maskable.js +181 -0
- package/es5/mixins/menuable.js +293 -0
- package/es5/mixins/overlayable.js +202 -0
- package/es5/mixins/picker.js +36 -0
- package/es5/mixins/positionable.js +10 -0
- package/es5/mixins/rippleable.js +21 -0
- package/es5/mixins/routable.js +66 -0
- package/es5/mixins/selectable.js +79 -0
- package/es5/mixins/stackable.js +70 -0
- package/es5/mixins/tab-focusable.js +7 -0
- package/es5/mixins/themeable.js +15 -0
- package/es5/mixins/toggleable.js +31 -0
- package/es5/mixins/transitionable.js +7 -0
- package/es5/mixins/translatable.js +62 -0
- package/es5/mixins/validatable.js +138 -0
- package/es5/util/breakpoint.js +128 -0
- package/es5/util/helpers.js +139 -0
- package/es5/util/load.js +15 -0
- package/es5/util/mask.js +159 -0
- package/es5/util/testing.js +160 -0
- package/es5/util/to-have-been-warned.js +117 -0
- package/es5/util/touchSupport.js +14 -0
- package/index.d.ts +8 -0
- package/package.json +134 -0
- package/src/components/KAlert/KAlert.js +77 -0
- package/src/components/KAlert/index.js +7 -0
- package/src/components/KApp/KApp.js +64 -0
- package/src/components/KApp/index.js +7 -0
- package/src/components/KAvatar/KAvatar.js +27 -0
- package/src/components/KAvatar/index.js +7 -0
- package/src/components/KBadge/KBadge.js +62 -0
- package/src/components/KBadge/index.js +7 -0
- package/src/components/KBottomNav/KBottomNav.js +50 -0
- package/src/components/KBottomNav/index.js +7 -0
- package/src/components/KBottomSheet/KBottomSheet.js +41 -0
- package/src/components/KBottomSheet/index.js +7 -0
- package/src/components/KBreadcrumbs/KBreadcrumbs.js +35 -0
- package/src/components/KBreadcrumbs/KBreadcrumbsItem.js +38 -0
- package/src/components/KBreadcrumbs/index.js +11 -0
- package/src/components/KBtn/KBtn.js +163 -0
- package/src/components/KBtn/index.js +7 -0
- package/src/components/KBtnToggle/KBtnToggle.js +92 -0
- package/src/components/KBtnToggle/index.js +7 -0
- package/src/components/KCard/KCard.js +61 -0
- package/src/components/KCard/KCardMedia.js +41 -0
- package/src/components/KCard/KCardTitle.js +17 -0
- package/src/components/KCard/index.js +19 -0
- package/src/components/KCarousel/KCarousel.js +174 -0
- package/src/components/KCarousel/KCarouselItem.js +65 -0
- package/src/components/KCarousel/index.js +11 -0
- package/src/components/KCheckbox/KCheckbox.js +92 -0
- package/src/components/KCheckbox/index.js +7 -0
- package/src/components/KChip/KChip.js +83 -0
- package/src/components/KChip/index.js +7 -0
- package/src/components/KDataTable/KDataTable.js +346 -0
- package/src/components/KDataTable/KEditDialog.js +110 -0
- package/src/components/KDataTable/index.js +16 -0
- package/src/components/KDataTable/mixins/body.js +98 -0
- package/src/components/KDataTable/mixins/foot.js +128 -0
- package/src/components/KDataTable/mixins/head.js +119 -0
- package/src/components/KDataTable/mixins/progress.js +16 -0
- package/src/components/KDatePicker/KDatePicker.js +382 -0
- package/src/components/KDatePicker/index.js +7 -0
- package/src/components/KDatePicker/mixins/date-header.js +74 -0
- package/src/components/KDatePicker/mixins/date-table.js +95 -0
- package/src/components/KDatePicker/mixins/date-title.js +76 -0
- package/src/components/KDatePicker/mixins/date-years.js +42 -0
- package/src/components/KDatePicker/mixins/month-table.js +82 -0
- package/src/components/KDialog/KDialog.js +184 -0
- package/src/components/KDialog/index.js +7 -0
- package/src/components/KDivider/KDivider.js +25 -0
- package/src/components/KDivider/index.js +7 -0
- package/src/components/KExpansionPanel/KExpansionPanel.js +55 -0
- package/src/components/KExpansionPanel/KExpansionPanelContent.js +112 -0
- package/src/components/KExpansionPanel/index.js +9 -0
- package/src/components/KFooter/KFooter.js +67 -0
- package/src/components/KFooter/index.js +7 -0
- package/src/components/KForm/KForm.js +117 -0
- package/src/components/KForm/index.js +7 -0
- package/src/components/KGrid/KContainer.js +5 -0
- package/src/components/KGrid/KContent.js +29 -0
- package/src/components/KGrid/KFlex.js +5 -0
- package/src/components/KGrid/KLayout.js +5 -0
- package/src/components/KGrid/grid.js +40 -0
- package/src/components/KGrid/index.js +27 -0
- package/src/components/KIcon/KIcon.js +87 -0
- package/src/components/KIcon/index.js +7 -0
- package/src/components/KList/KList.js +75 -0
- package/src/components/KList/KListGroup.js +95 -0
- package/src/components/KList/KListTile.js +62 -0
- package/src/components/KList/KListTileAction.js +12 -0
- package/src/components/KList/index.js +27 -0
- package/src/components/KMenu/KMenu.js +207 -0
- package/src/components/KMenu/index.js +7 -0
- package/src/components/KMenu/mixins/menu-activator.js +51 -0
- package/src/components/KMenu/mixins/menu-generators.js +84 -0
- package/src/components/KMenu/mixins/menu-keyable.js +68 -0
- package/src/components/KMenu/mixins/menu-position.js +72 -0
- package/src/components/KNavigationDrawer/KNavigationDrawer.js +267 -0
- package/src/components/KNavigationDrawer/index.js +7 -0
- package/src/components/KPagination/KPagination.js +168 -0
- package/src/components/KPagination/index.js +7 -0
- package/src/components/KParallax/KParallax.js +99 -0
- package/src/components/KParallax/index.js +7 -0
- package/src/components/KProgressCircular/KProgressCircular.js +160 -0
- package/src/components/KProgressCircular/index.js +7 -0
- package/src/components/KProgressLinear/KProgressLinear.js +157 -0
- package/src/components/KProgressLinear/index.js +7 -0
- package/src/components/KRadioGroup/KRadio.js +153 -0
- package/src/components/KRadioGroup/KRadioGroup.js +118 -0
- package/src/components/KRadioGroup/index.js +11 -0
- package/src/components/KSelect/KSelect.js +641 -0
- package/src/components/KSelect/index.js +7 -0
- package/src/components/KSelect/mixins/select-autocomplete.js +125 -0
- package/src/components/KSelect/mixins/select-generators.js +300 -0
- package/src/components/KSlider/KSlider.js +311 -0
- package/src/components/KSlider/index.js +7 -0
- package/src/components/KSnackbar/KSnackbar.js +97 -0
- package/src/components/KSnackbar/index.js +7 -0
- package/src/components/KSpeedDial/KSpeedDial.js +80 -0
- package/src/components/KSpeedDial/index.js +7 -0
- package/src/components/KStepper/KStepper.js +95 -0
- package/src/components/KStepper/KStepperContent.js +138 -0
- package/src/components/KStepper/KStepperStep.js +100 -0
- package/src/components/KStepper/index.js +17 -0
- package/src/components/KSubheader/KSubheader.js +25 -0
- package/src/components/KSubheader/index.js +7 -0
- package/src/components/KSwitch/KSwitch.js +58 -0
- package/src/components/KSwitch/index.js +7 -0
- package/src/components/KSystemBar/KSystemBar.js +54 -0
- package/src/components/KSystemBar/index.js +7 -0
- package/src/components/KTabs/KTabs.js +240 -0
- package/src/components/KTabs/KTabsBar.js +202 -0
- package/src/components/KTabs/KTabsContent.js +90 -0
- package/src/components/KTabs/KTabsItem.js +99 -0
- package/src/components/KTabs/KTabsItems.js +40 -0
- package/src/components/KTabs/KTabsSlider.js +14 -0
- package/src/components/KTabs/index.js +17 -0
- package/src/components/KTextField/KTextField.js +246 -0
- package/src/components/KTextField/index.js +7 -0
- package/src/components/KTimePicker/KTimePicker.js +282 -0
- package/src/components/KTimePicker/index.js +7 -0
- package/src/components/KTimePicker/mixins/time-body.js +208 -0
- package/src/components/KTimePicker/mixins/time-title.js +51 -0
- package/src/components/KToolbar/KToolbar.js +206 -0
- package/src/components/KToolbar/KToolbarSideIcon.js +26 -0
- package/src/components/KToolbar/index.js +19 -0
- package/src/components/KTooltip/KTooltip.js +161 -0
- package/src/components/KTooltip/index.js +7 -0
- package/src/components/Kdutify/index.js +48 -0
- package/src/components/index.js +45 -0
- package/src/components/transitions/expand-transition.js +34 -0
- package/src/components/transitions/index.js +50 -0
- package/src/components/transitions/row-expand-transition.js +38 -0
- package/src/directives/click-outside.js +72 -0
- package/src/directives/index.js +21 -0
- package/src/directives/resize.js +30 -0
- package/src/directives/ripple.js +120 -0
- package/src/directives/scroll.js +31 -0
- package/src/directives/touch.js +90 -0
- package/src/index.js +30 -0
- package/src/mixins/applicationable.js +9 -0
- package/src/mixins/bootable.js +31 -0
- package/src/mixins/button-group.js +77 -0
- package/src/mixins/colorable.js +20 -0
- package/src/mixins/contextualable.js +10 -0
- package/src/mixins/delayable.js +54 -0
- package/src/mixins/dependent.js +55 -0
- package/src/mixins/detachable.js +44 -0
- package/src/mixins/filterable.js +8 -0
- package/src/mixins/input.js +220 -0
- package/src/mixins/loadable.js +33 -0
- package/src/mixins/maskable.js +117 -0
- package/src/mixins/menuable.js +299 -0
- package/src/mixins/overlayable.js +180 -0
- package/src/mixins/picker.js +35 -0
- package/src/mixins/positionable.js +10 -0
- package/src/mixins/rippleable.js +21 -0
- package/src/mixins/routable.js +66 -0
- package/src/mixins/selectable.js +84 -0
- package/src/mixins/stackable.js +44 -0
- package/src/mixins/tab-focusable.js +7 -0
- package/src/mixins/themeable.js +15 -0
- package/src/mixins/toggleable.js +28 -0
- package/src/mixins/transitionable.js +7 -0
- package/src/mixins/translatable.js +67 -0
- package/src/mixins/validatable.js +124 -0
- package/src/stylus/app.styl +6 -0
- package/src/stylus/bootstrap.styl +1 -0
- package/src/stylus/components/_alerts.styl +44 -0
- package/src/stylus/components/_app.styl +21 -0
- package/src/stylus/components/_avatars.styl +22 -0
- package/src/stylus/components/_badges.styl +49 -0
- package/src/stylus/components/_bottom-navs.styl +86 -0
- package/src/stylus/components/_bottom-sheets.styl +18 -0
- package/src/stylus/components/_breadcrumbs.styl +46 -0
- package/src/stylus/components/_button-toggle.styl +55 -0
- package/src/stylus/components/_buttons.styl +339 -0
- package/src/stylus/components/_cards.styl +85 -0
- package/src/stylus/components/_carousel.styl +76 -0
- package/src/stylus/components/_chips.styl +102 -0
- package/src/stylus/components/_content.styl +6 -0
- package/src/stylus/components/_data-table.styl +113 -0
- package/src/stylus/components/_date-picker.styl +214 -0
- package/src/stylus/components/_dialogs.styl +63 -0
- package/src/stylus/components/_dividers.styl +19 -0
- package/src/stylus/components/_expansion-panel.styl +85 -0
- package/src/stylus/components/_footer.styl +40 -0
- package/src/stylus/components/_grid.styl +171 -0
- package/src/stylus/components/_icons.styl +32 -0
- package/src/stylus/components/_input-groups.styl +310 -0
- package/src/stylus/components/_lists.styl +263 -0
- package/src/stylus/components/_menus.styl +87 -0
- package/src/stylus/components/_navigation-drawer.styl +150 -0
- package/src/stylus/components/_overlay.styl +42 -0
- package/src/stylus/components/_pagination.styl +95 -0
- package/src/stylus/components/_parallax.styl +35 -0
- package/src/stylus/components/_pickers.styl +66 -0
- package/src/stylus/components/_progress-circular.styl +58 -0
- package/src/stylus/components/_progress-linear.styl +104 -0
- package/src/stylus/components/_radio-group.styl +23 -0
- package/src/stylus/components/_ripples.styl +31 -0
- package/src/stylus/components/_select.styl +153 -0
- package/src/stylus/components/_selection-controls.styl +122 -0
- package/src/stylus/components/_sliders.styl +234 -0
- package/src/stylus/components/_small-dialog.styl +37 -0
- package/src/stylus/components/_snackbars.styl +110 -0
- package/src/stylus/components/_speed-dial.styl +78 -0
- package/src/stylus/components/_steppers.styl +216 -0
- package/src/stylus/components/_subheaders.styl +18 -0
- package/src/stylus/components/_switch.styl +89 -0
- package/src/stylus/components/_system-bars.styl +49 -0
- package/src/stylus/components/_tables.styl +103 -0
- package/src/stylus/components/_tabs.styl +159 -0
- package/src/stylus/components/_text-fields.styl +243 -0
- package/src/stylus/components/_time-picker.styl +199 -0
- package/src/stylus/components/_toolbar.styl +148 -0
- package/src/stylus/components/_tooltips.styl +25 -0
- package/src/stylus/elements/_blockquote.styl +5 -0
- package/src/stylus/elements/_code.styl +20 -0
- package/src/stylus/elements/_global.styl +31 -0
- package/src/stylus/elements/_headings.styl +17 -0
- package/src/stylus/elements/_lists.styl +2 -0
- package/src/stylus/elements/_typography.styl +54 -0
- package/src/stylus/generic/_bootstrap.styl +49 -0
- package/src/stylus/generic/_reset.styl +332 -0
- package/src/stylus/generic/_transitions.styl +116 -0
- package/src/stylus/main.styl +2 -0
- package/src/stylus/settings/_colors.styl +339 -0
- package/src/stylus/settings/_elevations.styl +111 -0
- package/src/stylus/settings/_theme.styl +201 -0
- package/src/stylus/settings/_variables.styl +396 -0
- package/src/stylus/theme.styl +24 -0
- package/src/stylus/tools/_animations.styl +9 -0
- package/src/stylus/tools/_colors.styl +17 -0
- package/src/stylus/tools/_elevations.styl +7 -0
- package/src/stylus/trumps/_display.styl +14 -0
- package/src/stylus/trumps/_helpers.styl +5 -0
- package/src/stylus/trumps/_spacing.styl +37 -0
- package/src/stylus/trumps/_text.styl +13 -0
- package/src/util/breakpoint.js +134 -0
- package/src/util/helpers.d.ts +21 -0
- package/src/util/helpers.js +125 -0
- package/src/util/load.js +13 -0
- package/src/util/mask.js +138 -0
- package/src/util/testing.js +154 -0
- package/src/util/to-have-been-warned.js +68 -0
- package/src/util/touchSupport.js +12 -0
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
require('../../stylus/components/_parallax.styl')
|
|
2
|
+
|
|
3
|
+
import Translatable from '../../mixins/translatable'
|
|
4
|
+
|
|
5
|
+
export default {
|
|
6
|
+
name: 'k-parallax',
|
|
7
|
+
|
|
8
|
+
mixins: [Translatable],
|
|
9
|
+
|
|
10
|
+
data () {
|
|
11
|
+
return {
|
|
12
|
+
isBooted: false
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
|
|
16
|
+
props: {
|
|
17
|
+
alt: String,
|
|
18
|
+
height: {
|
|
19
|
+
type: [String, Number],
|
|
20
|
+
default: 500
|
|
21
|
+
},
|
|
22
|
+
jumbotron: Boolean,
|
|
23
|
+
src: String
|
|
24
|
+
},
|
|
25
|
+
|
|
26
|
+
computed: {
|
|
27
|
+
styles () {
|
|
28
|
+
return {
|
|
29
|
+
display: 'block',
|
|
30
|
+
opacity: this.isBooted ? 1 : 0,
|
|
31
|
+
transform: `translate3d(-50%, ${this.jumbotron ? 0 : this.parallax + 'px'}, 0)`
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
|
|
36
|
+
watch: {
|
|
37
|
+
parallax () {
|
|
38
|
+
this.isBooted = true
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
|
|
42
|
+
methods: {
|
|
43
|
+
init () {
|
|
44
|
+
if (!this.$refs.img) return
|
|
45
|
+
|
|
46
|
+
if (this.$refs.img.complete) {
|
|
47
|
+
this.translate()
|
|
48
|
+
this.listeners()
|
|
49
|
+
} else {
|
|
50
|
+
this.$refs.img.addEventListener('load', () => {
|
|
51
|
+
this.translate()
|
|
52
|
+
this.listeners()
|
|
53
|
+
}, false)
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
objHeight () {
|
|
57
|
+
return this.$refs.img.naturalHeight
|
|
58
|
+
},
|
|
59
|
+
elOffsetTop () {
|
|
60
|
+
return this.$el.offsetTop
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
|
|
64
|
+
render (h) {
|
|
65
|
+
const imgData = {
|
|
66
|
+
staticClass: 'parallax__image',
|
|
67
|
+
'class': {
|
|
68
|
+
'parallax__image--jumbotron': this.jumbotron
|
|
69
|
+
},
|
|
70
|
+
style: this.styles,
|
|
71
|
+
attrs: {
|
|
72
|
+
src: this.src
|
|
73
|
+
},
|
|
74
|
+
ref: 'img'
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
if (this.alt) imgData.attrs.alt = this.alt
|
|
78
|
+
|
|
79
|
+
const container = h('div', {
|
|
80
|
+
staticClass: 'parallax__image-container'
|
|
81
|
+
}, [
|
|
82
|
+
h('img', imgData)
|
|
83
|
+
])
|
|
84
|
+
|
|
85
|
+
const content = h('div', {
|
|
86
|
+
staticClass: 'parallax__content'
|
|
87
|
+
}, this.$slots.default)
|
|
88
|
+
|
|
89
|
+
return h('div', {
|
|
90
|
+
staticClass: 'parallax',
|
|
91
|
+
style: {
|
|
92
|
+
height: this.jumbotron
|
|
93
|
+
? this.normalizedHeight
|
|
94
|
+
: `${this.normalizedHeight}px`
|
|
95
|
+
},
|
|
96
|
+
on: this.$listeners
|
|
97
|
+
}, [container, content])
|
|
98
|
+
}
|
|
99
|
+
}
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
require('../../stylus/components/_progress-circular.styl')
|
|
2
|
+
|
|
3
|
+
import Colorable from '../../mixins/colorable'
|
|
4
|
+
|
|
5
|
+
export default {
|
|
6
|
+
name: 'k-progress-circular',
|
|
7
|
+
|
|
8
|
+
mixins: [Colorable],
|
|
9
|
+
|
|
10
|
+
props: {
|
|
11
|
+
button: Boolean,
|
|
12
|
+
|
|
13
|
+
fill: {
|
|
14
|
+
type: String,
|
|
15
|
+
default () { return this.indeterminate ? 'none' : 'transparent' }
|
|
16
|
+
},
|
|
17
|
+
|
|
18
|
+
indeterminate: Boolean,
|
|
19
|
+
|
|
20
|
+
rotate: {
|
|
21
|
+
type: Number,
|
|
22
|
+
default: 0
|
|
23
|
+
},
|
|
24
|
+
|
|
25
|
+
size: {
|
|
26
|
+
type: [Number, String],
|
|
27
|
+
default: 32
|
|
28
|
+
},
|
|
29
|
+
|
|
30
|
+
width: {
|
|
31
|
+
type: Number,
|
|
32
|
+
default: 4
|
|
33
|
+
},
|
|
34
|
+
|
|
35
|
+
value: {
|
|
36
|
+
type: Number,
|
|
37
|
+
default: 0
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
|
|
41
|
+
computed: {
|
|
42
|
+
calculatedSize () {
|
|
43
|
+
let size = Number(this.size)
|
|
44
|
+
|
|
45
|
+
if (this.button) {
|
|
46
|
+
size += 8
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
return size
|
|
50
|
+
},
|
|
51
|
+
|
|
52
|
+
circumference () {
|
|
53
|
+
return 2 * Math.PI * this.radius
|
|
54
|
+
},
|
|
55
|
+
|
|
56
|
+
classes () {
|
|
57
|
+
return this.addTextColorClassChecks({
|
|
58
|
+
'progress-circular': true,
|
|
59
|
+
'progress-circular--indeterminate': this.indeterminate,
|
|
60
|
+
'progress-circular--button': this.button
|
|
61
|
+
})
|
|
62
|
+
},
|
|
63
|
+
|
|
64
|
+
cxy () {
|
|
65
|
+
return this.indeterminate && !this.button ? 50 : this.calculatedSize / 2
|
|
66
|
+
},
|
|
67
|
+
|
|
68
|
+
normalizedValue () {
|
|
69
|
+
if (this.value < 0) {
|
|
70
|
+
return 0
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
if (this.value > 100) {
|
|
74
|
+
return 100
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
return this.value
|
|
78
|
+
},
|
|
79
|
+
|
|
80
|
+
radius () {
|
|
81
|
+
return this.indeterminate &&
|
|
82
|
+
!this.button
|
|
83
|
+
? 20
|
|
84
|
+
: (this.calculatedSize - this.width) / 2
|
|
85
|
+
},
|
|
86
|
+
|
|
87
|
+
strokeDashArray () {
|
|
88
|
+
return Math.round(this.circumference * 1000) / 1000
|
|
89
|
+
},
|
|
90
|
+
|
|
91
|
+
strokeDashOffset () {
|
|
92
|
+
return ((100 - this.normalizedValue) / 100) * this.circumference + 'px'
|
|
93
|
+
},
|
|
94
|
+
|
|
95
|
+
styles () {
|
|
96
|
+
return {
|
|
97
|
+
height: `${this.calculatedSize}px`,
|
|
98
|
+
width: `${this.calculatedSize}px`
|
|
99
|
+
}
|
|
100
|
+
},
|
|
101
|
+
|
|
102
|
+
svgSize () {
|
|
103
|
+
return this.indeterminate ? false : this.calculatedSize
|
|
104
|
+
},
|
|
105
|
+
|
|
106
|
+
svgStyles () {
|
|
107
|
+
return {
|
|
108
|
+
transform: `rotate(${this.rotate}deg)`
|
|
109
|
+
}
|
|
110
|
+
},
|
|
111
|
+
|
|
112
|
+
viewBox () {
|
|
113
|
+
return this.indeterminate ? '25 25 50 50' : false
|
|
114
|
+
}
|
|
115
|
+
},
|
|
116
|
+
|
|
117
|
+
methods: {
|
|
118
|
+
genCircle (h, name, offset) {
|
|
119
|
+
return h('circle', {
|
|
120
|
+
class: `progress-circular__${name}`,
|
|
121
|
+
attrs: {
|
|
122
|
+
fill: 'transparent',
|
|
123
|
+
cx: this.cxy,
|
|
124
|
+
cy: this.cxy,
|
|
125
|
+
r: this.radius,
|
|
126
|
+
'stroke-width': this.width,
|
|
127
|
+
'stroke-dasharray': this.strokeDashArray,
|
|
128
|
+
'stroke-dashoffset': offset
|
|
129
|
+
}
|
|
130
|
+
})
|
|
131
|
+
},
|
|
132
|
+
genSvg (h) {
|
|
133
|
+
const children = [
|
|
134
|
+
!this.indeterminate && this.genCircle(h, 'underlay', 0),
|
|
135
|
+
this.genCircle(h, 'overlay', this.strokeDashOffset)
|
|
136
|
+
]
|
|
137
|
+
|
|
138
|
+
return h('svg', {
|
|
139
|
+
style: this.svgStyles,
|
|
140
|
+
attrs: {
|
|
141
|
+
xmlns: 'http://www.w3.org/2000/svg',
|
|
142
|
+
height: this.svgSize,
|
|
143
|
+
width: this.svgSize,
|
|
144
|
+
viewBox: this.viewBox
|
|
145
|
+
}
|
|
146
|
+
}, children)
|
|
147
|
+
}
|
|
148
|
+
},
|
|
149
|
+
|
|
150
|
+
render (h) {
|
|
151
|
+
const info = h('div', { class: 'progress-circular__info' }, [this.$slots.default])
|
|
152
|
+
const svg = this.genSvg(h)
|
|
153
|
+
|
|
154
|
+
return h('div', {
|
|
155
|
+
class: this.classes,
|
|
156
|
+
style: this.styles,
|
|
157
|
+
on: this.$listeners
|
|
158
|
+
}, [svg, info])
|
|
159
|
+
}
|
|
160
|
+
}
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
require('../../stylus/components/_progress-linear.styl')
|
|
2
|
+
|
|
3
|
+
import Colorable from '../../mixins/colorable'
|
|
4
|
+
|
|
5
|
+
import {
|
|
6
|
+
KFadeTransition,
|
|
7
|
+
KSlideXTransition
|
|
8
|
+
} from '../transitions'
|
|
9
|
+
|
|
10
|
+
export default {
|
|
11
|
+
name: 'k-progress-linear',
|
|
12
|
+
|
|
13
|
+
components: {
|
|
14
|
+
KFadeTransition,
|
|
15
|
+
KSlideXTransition
|
|
16
|
+
},
|
|
17
|
+
|
|
18
|
+
mixins: [Colorable],
|
|
19
|
+
|
|
20
|
+
props: {
|
|
21
|
+
active: {
|
|
22
|
+
type: Boolean,
|
|
23
|
+
default: true
|
|
24
|
+
},
|
|
25
|
+
backgroundColor: {
|
|
26
|
+
type: String,
|
|
27
|
+
default: null
|
|
28
|
+
},
|
|
29
|
+
backgroundOpacity: {
|
|
30
|
+
type: [Number, String],
|
|
31
|
+
default: null
|
|
32
|
+
},
|
|
33
|
+
bufferValue: {
|
|
34
|
+
type: [Number, String],
|
|
35
|
+
default: 100
|
|
36
|
+
},
|
|
37
|
+
color: {
|
|
38
|
+
type: String,
|
|
39
|
+
default: 'primary'
|
|
40
|
+
},
|
|
41
|
+
height: {
|
|
42
|
+
type: [Number, String],
|
|
43
|
+
default: 7
|
|
44
|
+
},
|
|
45
|
+
indeterminate: Boolean,
|
|
46
|
+
query: Boolean,
|
|
47
|
+
value: {
|
|
48
|
+
type: [Number, String],
|
|
49
|
+
default: 0
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
|
|
53
|
+
computed: {
|
|
54
|
+
styles () {
|
|
55
|
+
const styles = {}
|
|
56
|
+
|
|
57
|
+
if (!this.active) {
|
|
58
|
+
styles.height = 0
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
if (!this.indeterminate && parseInt(this.bufferValue, 10) !== 100) {
|
|
62
|
+
styles.width = `${this.bufferValue}%`
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
return styles
|
|
66
|
+
},
|
|
67
|
+
effectiveWidth () {
|
|
68
|
+
if (!this.bufferValue) {
|
|
69
|
+
return 0
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
return this.value * 100 / this.bufferValue
|
|
73
|
+
},
|
|
74
|
+
bufferStyles () {
|
|
75
|
+
const styles = {}
|
|
76
|
+
|
|
77
|
+
if (!this.active) {
|
|
78
|
+
styles.height = 0
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
return styles
|
|
82
|
+
},
|
|
83
|
+
backgroundStyle () {
|
|
84
|
+
const backgroundOpacity = this.backgroundOpacity == null
|
|
85
|
+
? (this.backgroundColor ? 1 : 0.3)
|
|
86
|
+
: parseFloat(this.backgroundOpacity)
|
|
87
|
+
|
|
88
|
+
return {
|
|
89
|
+
height: this.active ? 'auto' : 0,
|
|
90
|
+
opacity: backgroundOpacity,
|
|
91
|
+
width: `${this.bufferValue}%`
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
},
|
|
95
|
+
|
|
96
|
+
methods: {
|
|
97
|
+
genDeterminate (h) {
|
|
98
|
+
return h('div', {
|
|
99
|
+
ref: 'front',
|
|
100
|
+
staticClass: `progress-linear__bar__determinate`,
|
|
101
|
+
class: this.addBackgroundColorClassChecks({}),
|
|
102
|
+
style: {
|
|
103
|
+
width: `${this.effectiveWidth}%`
|
|
104
|
+
}
|
|
105
|
+
})
|
|
106
|
+
},
|
|
107
|
+
genBar (h, name) {
|
|
108
|
+
return h('div', {
|
|
109
|
+
staticClass: 'progress-linear__bar__indeterminate',
|
|
110
|
+
class: this.addBackgroundColorClassChecks({
|
|
111
|
+
[name]: true
|
|
112
|
+
})
|
|
113
|
+
})
|
|
114
|
+
},
|
|
115
|
+
genIndeterminate (h) {
|
|
116
|
+
return h('div', {
|
|
117
|
+
ref: 'front',
|
|
118
|
+
staticClass: 'progress-linear__bar__indeterminate',
|
|
119
|
+
class: {
|
|
120
|
+
'progress-linear__bar__indeterminate--active': this.active
|
|
121
|
+
}
|
|
122
|
+
}, [
|
|
123
|
+
this.genBar(h, 'long'),
|
|
124
|
+
this.genBar(h, 'short')
|
|
125
|
+
])
|
|
126
|
+
}
|
|
127
|
+
},
|
|
128
|
+
|
|
129
|
+
render (h) {
|
|
130
|
+
const fade = h('k-fade-transition', [this.indeterminate && this.genIndeterminate(h)])
|
|
131
|
+
const slide = h('k-slide-x-transition', [!this.indeterminate && this.genDeterminate(h)])
|
|
132
|
+
|
|
133
|
+
const bar = h('div', {
|
|
134
|
+
staticClass: 'progress-linear__bar',
|
|
135
|
+
style: this.styles
|
|
136
|
+
}, [fade, slide])
|
|
137
|
+
const background = h('div', {
|
|
138
|
+
staticClass: 'progress-linear__background',
|
|
139
|
+
class: [this.backgroundColor || this.color],
|
|
140
|
+
style: this.backgroundStyle
|
|
141
|
+
})
|
|
142
|
+
|
|
143
|
+
return h('div', {
|
|
144
|
+
staticClass: 'progress-linear',
|
|
145
|
+
class: {
|
|
146
|
+
'progress-linear--query': this.query
|
|
147
|
+
},
|
|
148
|
+
style: {
|
|
149
|
+
height: `${this.height}px`
|
|
150
|
+
},
|
|
151
|
+
on: this.$listeners
|
|
152
|
+
}, [
|
|
153
|
+
background,
|
|
154
|
+
bar
|
|
155
|
+
])
|
|
156
|
+
}
|
|
157
|
+
}
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
import { KFadeTransition } from '../transitions'
|
|
2
|
+
import KIcon from '../KIcon'
|
|
3
|
+
|
|
4
|
+
import Colorable from '../../mixins/colorable'
|
|
5
|
+
import Rippleable from '../../mixins/rippleable'
|
|
6
|
+
import TabFocusable from '../../mixins/tab-focusable'
|
|
7
|
+
import Themeable from '../../mixins/themeable'
|
|
8
|
+
|
|
9
|
+
export default {
|
|
10
|
+
name: 'k-radio',
|
|
11
|
+
|
|
12
|
+
inheritAttrs: false,
|
|
13
|
+
|
|
14
|
+
inject: ['isMandatory', 'name', 'registerChild', 'unregisterChild'],
|
|
15
|
+
|
|
16
|
+
components: {
|
|
17
|
+
KFadeTransition,
|
|
18
|
+
KIcon
|
|
19
|
+
},
|
|
20
|
+
|
|
21
|
+
mixins: [Colorable, Rippleable, TabFocusable, Themeable],
|
|
22
|
+
|
|
23
|
+
props: {
|
|
24
|
+
disabled: Boolean,
|
|
25
|
+
value: null,
|
|
26
|
+
label: String
|
|
27
|
+
},
|
|
28
|
+
|
|
29
|
+
data () {
|
|
30
|
+
return {
|
|
31
|
+
isActive: false
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
|
|
35
|
+
computed: {
|
|
36
|
+
classes () {
|
|
37
|
+
return this.addTextColorClassChecks({
|
|
38
|
+
'input-group': true,
|
|
39
|
+
'input-group--active': this.isActive,
|
|
40
|
+
'input-group--disabled': this.disabled,
|
|
41
|
+
'input-group--selection-controls': true,
|
|
42
|
+
'input-group--tab-focused': this.tabFocused,
|
|
43
|
+
'radio': true,
|
|
44
|
+
'theme--dark': this.dark,
|
|
45
|
+
'theme--light': this.light
|
|
46
|
+
})
|
|
47
|
+
},
|
|
48
|
+
|
|
49
|
+
icon () {
|
|
50
|
+
return this.isActive ? 'radio_button_checked' : 'radio_button_unchecked'
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
|
|
54
|
+
methods: {
|
|
55
|
+
genInput (radio) {
|
|
56
|
+
const value = ['string', 'number'].includes(typeof this.value)
|
|
57
|
+
? this.value
|
|
58
|
+
: JSON.stringify(this.value)
|
|
59
|
+
const input = this.$createElement('input', {
|
|
60
|
+
ref: 'input',
|
|
61
|
+
style: {
|
|
62
|
+
display: 'none'
|
|
63
|
+
},
|
|
64
|
+
attrs: Object.assign({
|
|
65
|
+
name: this.name && this.name(),
|
|
66
|
+
id: this.id,
|
|
67
|
+
type: 'radio',
|
|
68
|
+
value
|
|
69
|
+
}, this.$attrs)
|
|
70
|
+
}, [value])
|
|
71
|
+
|
|
72
|
+
radio.push(input)
|
|
73
|
+
|
|
74
|
+
return this.$createElement('div', {
|
|
75
|
+
class: 'input-group__input'
|
|
76
|
+
}, radio)
|
|
77
|
+
},
|
|
78
|
+
genWrapper (radio) {
|
|
79
|
+
const children = []
|
|
80
|
+
|
|
81
|
+
children.push(this.genLabel())
|
|
82
|
+
children.push(this.genInput(radio))
|
|
83
|
+
|
|
84
|
+
return this.$createElement('div', {
|
|
85
|
+
class: this.classes,
|
|
86
|
+
attrs: {
|
|
87
|
+
role: 'radio',
|
|
88
|
+
'aria-checked': this.isActive && 'true' || 'false',
|
|
89
|
+
'aria-label': this.label
|
|
90
|
+
},
|
|
91
|
+
on: {
|
|
92
|
+
keydown: e => {
|
|
93
|
+
if ([13, 32].includes(e.keyCode)) {
|
|
94
|
+
e.preventDefault()
|
|
95
|
+
this.toggle()
|
|
96
|
+
}
|
|
97
|
+
},
|
|
98
|
+
blur: e => {
|
|
99
|
+
this.$emit('blur', e)
|
|
100
|
+
this.tabFocused = false
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
}, children)
|
|
104
|
+
},
|
|
105
|
+
genLabel () {
|
|
106
|
+
return this.$createElement('label', {
|
|
107
|
+
on: {
|
|
108
|
+
click: this.toggle
|
|
109
|
+
}
|
|
110
|
+
}, this.$slots.label || this.label)
|
|
111
|
+
},
|
|
112
|
+
toggle () {
|
|
113
|
+
const mandatory = this.isMandatory &&
|
|
114
|
+
this.isMandatory() || false
|
|
115
|
+
|
|
116
|
+
if (!this.disabled && (!this.isActive || !mandatory)) {
|
|
117
|
+
this.$refs.input.checked = true
|
|
118
|
+
this.isActive = true
|
|
119
|
+
this.$emit('change', this.value)
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
},
|
|
123
|
+
|
|
124
|
+
created () {
|
|
125
|
+
// Semantic check to help people identify the reason for the inject error above it.
|
|
126
|
+
if (!this.$parent || !this.$parent.$knode || !this.$parent.$knode.tag ||
|
|
127
|
+
!this.$parent.$knode.tag.endsWith('k-radio-group')) {
|
|
128
|
+
console.warn('[Kdutify] Warn: The k-radio component must have an immediate parent of k-radio-group.')
|
|
129
|
+
}
|
|
130
|
+
},
|
|
131
|
+
|
|
132
|
+
mounted () {
|
|
133
|
+
this.registerChild(this)
|
|
134
|
+
},
|
|
135
|
+
|
|
136
|
+
beforeDestroy () {
|
|
137
|
+
this.unregisterChild(this)
|
|
138
|
+
},
|
|
139
|
+
|
|
140
|
+
render (h) {
|
|
141
|
+
const transition = h('k-fade-transition', {}, [
|
|
142
|
+
h('k-icon', {
|
|
143
|
+
staticClass: 'icon--selection-control',
|
|
144
|
+
'class': {
|
|
145
|
+
'icon--radio': this.isActive
|
|
146
|
+
},
|
|
147
|
+
key: this.icon
|
|
148
|
+
}, this.icon)
|
|
149
|
+
])
|
|
150
|
+
|
|
151
|
+
return this.genWrapper([transition, this.genRipple()])
|
|
152
|
+
}
|
|
153
|
+
}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
require('../../stylus/components/_input-groups.styl')
|
|
2
|
+
require('../../stylus/components/_selection-controls.styl')
|
|
3
|
+
require('../../stylus/components/_radio-group.styl')
|
|
4
|
+
|
|
5
|
+
import Input from '../../mixins/input'
|
|
6
|
+
|
|
7
|
+
export default {
|
|
8
|
+
name: 'k-radio-group',
|
|
9
|
+
|
|
10
|
+
mixins: [Input],
|
|
11
|
+
|
|
12
|
+
model: {
|
|
13
|
+
prop: 'inputValue',
|
|
14
|
+
event: 'change'
|
|
15
|
+
},
|
|
16
|
+
|
|
17
|
+
provide () {
|
|
18
|
+
return {
|
|
19
|
+
isMandatory: () => this.mandatory,
|
|
20
|
+
name: () => this.name,
|
|
21
|
+
registerChild: this.registerChild,
|
|
22
|
+
unregisterChild: this.unregisterChild
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
|
|
26
|
+
props: {
|
|
27
|
+
column: {
|
|
28
|
+
type: Boolean,
|
|
29
|
+
default: true
|
|
30
|
+
},
|
|
31
|
+
inputValue: null,
|
|
32
|
+
mandatory: {
|
|
33
|
+
type: Boolean,
|
|
34
|
+
default: true
|
|
35
|
+
},
|
|
36
|
+
name: String,
|
|
37
|
+
row: Boolean
|
|
38
|
+
},
|
|
39
|
+
|
|
40
|
+
data () {
|
|
41
|
+
return {
|
|
42
|
+
internalTabIndex: -1
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
|
|
46
|
+
watch: {
|
|
47
|
+
inputValue (val) {
|
|
48
|
+
this.getRadios().forEach((radio) => {
|
|
49
|
+
radio.isActive = val === radio.value
|
|
50
|
+
})
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
|
|
54
|
+
computed: {
|
|
55
|
+
classes () {
|
|
56
|
+
return {
|
|
57
|
+
'radio-group': true,
|
|
58
|
+
'radio-group--column': this.column && !this.row,
|
|
59
|
+
'radio-group--row': this.row
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
|
|
64
|
+
methods: {
|
|
65
|
+
getRadios () {
|
|
66
|
+
return this.$children
|
|
67
|
+
.filter((child) => child.$el.classList.contains('radio'))
|
|
68
|
+
},
|
|
69
|
+
toggleRadio (value) {
|
|
70
|
+
if (this.disabled) {
|
|
71
|
+
return
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
this.shouldValidate = true
|
|
75
|
+
this.$emit('change', value)
|
|
76
|
+
this.$nextTick(() => this.validate())
|
|
77
|
+
|
|
78
|
+
this.getRadios()
|
|
79
|
+
.filter(r => r.value !== value)
|
|
80
|
+
.forEach(r => r.isActive = false)
|
|
81
|
+
},
|
|
82
|
+
radioBlur (e) {
|
|
83
|
+
if (!e.relatedTarget || !e.relatedTarget.classList.contains('radio')) {
|
|
84
|
+
this.shouldValidate = true
|
|
85
|
+
this.$emit('blur', this.inputValue)
|
|
86
|
+
}
|
|
87
|
+
},
|
|
88
|
+
registerChild (radio) {
|
|
89
|
+
radio.isActive = this.inputValue === radio.value
|
|
90
|
+
radio.$el.tabIndex = radio.$el.tabIndex > 0 ? radio.$el.tabIndex : 0
|
|
91
|
+
radio.$on('change', this.toggleRadio)
|
|
92
|
+
radio.$on('blur', this.radioBlur)
|
|
93
|
+
radio.$on('focus', this.radioFocus)
|
|
94
|
+
},
|
|
95
|
+
unregisterChild (radio) {
|
|
96
|
+
radio.$off('change', this.toggleRadio)
|
|
97
|
+
radio.$off('blur', this.radioBlur)
|
|
98
|
+
radio.$off('focus', this.radioFocus)
|
|
99
|
+
}
|
|
100
|
+
},
|
|
101
|
+
|
|
102
|
+
mounted () {
|
|
103
|
+
this.getRadios().forEach(radio => this.registerChild(radio))
|
|
104
|
+
},
|
|
105
|
+
|
|
106
|
+
beforeDestroy () {
|
|
107
|
+
this.getRadios().forEach(radio => this.unregisterChild(radio))
|
|
108
|
+
},
|
|
109
|
+
|
|
110
|
+
render (h) {
|
|
111
|
+
const data = {
|
|
112
|
+
attrs: {
|
|
113
|
+
role: 'radiogroup'
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
return this.genInputGroup(this.$slots.default, data)
|
|
117
|
+
}
|
|
118
|
+
}
|