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.
Files changed (425) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +70 -0
  3. package/dist/kdutify.css +12850 -0
  4. package/dist/kdutify.css.map +1 -0
  5. package/dist/kdutify.js +16285 -0
  6. package/dist/kdutify.js.map +1 -0
  7. package/dist/kdutify.min.css +7 -0
  8. package/dist/kdutify.min.css.map +1 -0
  9. package/dist/kdutify.min.js +6 -0
  10. package/es5/components/KAlert/KAlert.js +80 -0
  11. package/es5/components/KAlert/index.js +7 -0
  12. package/es5/components/KApp/KApp.js +67 -0
  13. package/es5/components/KApp/index.js +7 -0
  14. package/es5/components/KAvatar/KAvatar.js +31 -0
  15. package/es5/components/KAvatar/index.js +7 -0
  16. package/es5/components/KBadge/KBadge.js +59 -0
  17. package/es5/components/KBadge/index.js +7 -0
  18. package/es5/components/KBottomNav/KBottomNav.js +50 -0
  19. package/es5/components/KBottomNav/index.js +7 -0
  20. package/es5/components/KBottomSheet/KBottomSheet.js +36 -0
  21. package/es5/components/KBottomSheet/index.js +7 -0
  22. package/es5/components/KBreadcrumbs/KBreadcrumbs.js +36 -0
  23. package/es5/components/KBreadcrumbs/KBreadcrumbsItem.js +38 -0
  24. package/es5/components/KBreadcrumbs/index.js +11 -0
  25. package/es5/components/KBtn/KBtn.js +153 -0
  26. package/es5/components/KBtn/index.js +7 -0
  27. package/es5/components/KBtnToggle/KBtnToggle.js +92 -0
  28. package/es5/components/KBtnToggle/index.js +7 -0
  29. package/es5/components/KCard/KCard.js +63 -0
  30. package/es5/components/KCard/KCardMedia.js +41 -0
  31. package/es5/components/KCard/KCardTitle.js +21 -0
  32. package/es5/components/KCard/index.js +19 -0
  33. package/es5/components/KCarousel/KCarousel.js +178 -0
  34. package/es5/components/KCarousel/KCarouselItem.js +63 -0
  35. package/es5/components/KCarousel/index.js +11 -0
  36. package/es5/components/KCheckbox/KCheckbox.js +89 -0
  37. package/es5/components/KCheckbox/index.js +7 -0
  38. package/es5/components/KChip/KChip.js +81 -0
  39. package/es5/components/KChip/index.js +7 -0
  40. package/es5/components/KDataTable/KDataTable.js +347 -0
  41. package/es5/components/KDataTable/KEditDialog.js +108 -0
  42. package/es5/components/KDataTable/index.js +14 -0
  43. package/es5/components/KDataTable/mixins/body.js +103 -0
  44. package/es5/components/KDataTable/mixins/foot.js +118 -0
  45. package/es5/components/KDataTable/mixins/head.js +123 -0
  46. package/es5/components/KDataTable/mixins/progress.js +16 -0
  47. package/es5/components/KDatePicker/KDatePicker.js +416 -0
  48. package/es5/components/KDatePicker/index.js +7 -0
  49. package/es5/components/KDatePicker/mixins/date-header.js +68 -0
  50. package/es5/components/KDatePicker/mixins/date-table.js +101 -0
  51. package/es5/components/KDatePicker/mixins/date-title.js +64 -0
  52. package/es5/components/KDatePicker/mixins/date-years.js +53 -0
  53. package/es5/components/KDatePicker/mixins/month-table.js +91 -0
  54. package/es5/components/KDialog/KDialog.js +181 -0
  55. package/es5/components/KDialog/index.js +7 -0
  56. package/es5/components/KDivider/KDivider.js +29 -0
  57. package/es5/components/KDivider/index.js +7 -0
  58. package/es5/components/KExpansionPanel/KExpansionPanel.js +60 -0
  59. package/es5/components/KExpansionPanel/KExpansionPanelContent.js +114 -0
  60. package/es5/components/KExpansionPanel/index.js +9 -0
  61. package/es5/components/KFooter/KFooter.js +61 -0
  62. package/es5/components/KFooter/index.js +7 -0
  63. package/es5/components/KForm/KForm.js +203 -0
  64. package/es5/components/KForm/index.js +7 -0
  65. package/es5/components/KGrid/KContainer.js +5 -0
  66. package/es5/components/KGrid/KContent.js +33 -0
  67. package/es5/components/KGrid/KFlex.js +5 -0
  68. package/es5/components/KGrid/KLayout.js +5 -0
  69. package/es5/components/KGrid/grid.js +43 -0
  70. package/es5/components/KGrid/index.js +20 -0
  71. package/es5/components/KIcon/KIcon.js +93 -0
  72. package/es5/components/KIcon/index.js +7 -0
  73. package/es5/components/KList/KList.js +82 -0
  74. package/es5/components/KList/KListGroup.js +100 -0
  75. package/es5/components/KList/KListTile.js +65 -0
  76. package/es5/components/KList/KListTileAction.js +15 -0
  77. package/es5/components/KList/index.js +27 -0
  78. package/es5/components/KMenu/KMenu.js +178 -0
  79. package/es5/components/KMenu/index.js +7 -0
  80. package/es5/components/KMenu/mixins/menu-activator.js +59 -0
  81. package/es5/components/KMenu/mixins/menu-generators.js +88 -0
  82. package/es5/components/KMenu/mixins/menu-keyable.js +64 -0
  83. package/es5/components/KMenu/mixins/menu-position.js +64 -0
  84. package/es5/components/KNavigationDrawer/KNavigationDrawer.js +238 -0
  85. package/es5/components/KNavigationDrawer/index.js +7 -0
  86. package/es5/components/KPagination/KPagination.js +167 -0
  87. package/es5/components/KPagination/index.js +7 -0
  88. package/es5/components/KParallax/KParallax.js +98 -0
  89. package/es5/components/KParallax/index.js +7 -0
  90. package/es5/components/KProgressCircular/KProgressCircular.js +145 -0
  91. package/es5/components/KProgressCircular/index.js +7 -0
  92. package/es5/components/KProgressLinear/KProgressLinear.js +146 -0
  93. package/es5/components/KProgressLinear/index.js +7 -0
  94. package/es5/components/KRadioGroup/KRadio.js +148 -0
  95. package/es5/components/KRadioGroup/KRadioGroup.js +139 -0
  96. package/es5/components/KRadioGroup/index.js +11 -0
  97. package/es5/components/KSelect/KSelect.js +635 -0
  98. package/es5/components/KSelect/index.js +7 -0
  99. package/es5/components/KSelect/mixins/select-autocomplete.js +125 -0
  100. package/es5/components/KSelect/mixins/select-generators.js +298 -0
  101. package/es5/components/KSlider/KSlider.js +306 -0
  102. package/es5/components/KSlider/index.js +7 -0
  103. package/es5/components/KSnackbar/KSnackbar.js +106 -0
  104. package/es5/components/KSnackbar/index.js +7 -0
  105. package/es5/components/KSpeedDial/KSpeedDial.js +89 -0
  106. package/es5/components/KSpeedDial/index.js +7 -0
  107. package/es5/components/KStepper/KStepper.js +112 -0
  108. package/es5/components/KStepper/KStepperContent.js +134 -0
  109. package/es5/components/KStepper/KStepperStep.js +105 -0
  110. package/es5/components/KStepper/index.js +17 -0
  111. package/es5/components/KSubheader/KSubheader.js +29 -0
  112. package/es5/components/KSubheader/index.js +7 -0
  113. package/es5/components/KSwitch/KSwitch.js +55 -0
  114. package/es5/components/KSwitch/index.js +7 -0
  115. package/es5/components/KSystemBar/KSystemBar.js +54 -0
  116. package/es5/components/KSystemBar/index.js +7 -0
  117. package/es5/components/KTabs/KTabs.js +272 -0
  118. package/es5/components/KTabs/KTabsBar.js +205 -0
  119. package/es5/components/KTabs/KTabsContent.js +86 -0
  120. package/es5/components/KTabs/KTabsItem.js +103 -0
  121. package/es5/components/KTabs/KTabsItems.js +40 -0
  122. package/es5/components/KTabs/KTabsSlider.js +14 -0
  123. package/es5/components/KTabs/index.js +17 -0
  124. package/es5/components/KTextField/KTextField.js +275 -0
  125. package/es5/components/KTextField/index.js +7 -0
  126. package/es5/components/KTimePicker/KTimePicker.js +302 -0
  127. package/es5/components/KTimePicker/index.js +7 -0
  128. package/es5/components/KTimePicker/mixins/time-body.js +207 -0
  129. package/es5/components/KTimePicker/mixins/time-title.js +55 -0
  130. package/es5/components/KToolbar/KToolbar.js +193 -0
  131. package/es5/components/KToolbar/KToolbarSideIcon.js +29 -0
  132. package/es5/components/KToolbar/index.js +17 -0
  133. package/es5/components/KTooltip/KTooltip.js +156 -0
  134. package/es5/components/KTooltip/index.js +7 -0
  135. package/es5/components/Kdutify/index.js +50 -0
  136. package/es5/components/index.js +45 -0
  137. package/es5/components/transitions/expand-transition.js +36 -0
  138. package/es5/components/transitions/index.js +47 -0
  139. package/es5/components/transitions/row-expand-transition.js +38 -0
  140. package/es5/directives/click-outside.js +100 -0
  141. package/es5/directives/index.js +15 -0
  142. package/es5/directives/resize.js +30 -0
  143. package/es5/directives/ripple.js +144 -0
  144. package/es5/directives/scroll.js +32 -0
  145. package/es5/directives/touch.js +102 -0
  146. package/es5/index.js +30 -0
  147. package/es5/mixins/applicationable.js +9 -0
  148. package/es5/mixins/bootable.js +31 -0
  149. package/es5/mixins/button-group.js +82 -0
  150. package/es5/mixins/colorable.js +24 -0
  151. package/es5/mixins/contextualable.js +10 -0
  152. package/es5/mixins/delayable.js +57 -0
  153. package/es5/mixins/dependent.js +121 -0
  154. package/es5/mixins/detachable.js +41 -0
  155. package/es5/mixins/filterable.js +8 -0
  156. package/es5/mixins/input.js +219 -0
  157. package/es5/mixins/loadable.js +31 -0
  158. package/es5/mixins/maskable.js +181 -0
  159. package/es5/mixins/menuable.js +293 -0
  160. package/es5/mixins/overlayable.js +202 -0
  161. package/es5/mixins/picker.js +36 -0
  162. package/es5/mixins/positionable.js +10 -0
  163. package/es5/mixins/rippleable.js +21 -0
  164. package/es5/mixins/routable.js +66 -0
  165. package/es5/mixins/selectable.js +79 -0
  166. package/es5/mixins/stackable.js +70 -0
  167. package/es5/mixins/tab-focusable.js +7 -0
  168. package/es5/mixins/themeable.js +15 -0
  169. package/es5/mixins/toggleable.js +31 -0
  170. package/es5/mixins/transitionable.js +7 -0
  171. package/es5/mixins/translatable.js +62 -0
  172. package/es5/mixins/validatable.js +138 -0
  173. package/es5/util/breakpoint.js +128 -0
  174. package/es5/util/helpers.js +139 -0
  175. package/es5/util/load.js +15 -0
  176. package/es5/util/mask.js +159 -0
  177. package/es5/util/testing.js +160 -0
  178. package/es5/util/to-have-been-warned.js +117 -0
  179. package/es5/util/touchSupport.js +14 -0
  180. package/index.d.ts +8 -0
  181. package/package.json +134 -0
  182. package/src/components/KAlert/KAlert.js +77 -0
  183. package/src/components/KAlert/index.js +7 -0
  184. package/src/components/KApp/KApp.js +64 -0
  185. package/src/components/KApp/index.js +7 -0
  186. package/src/components/KAvatar/KAvatar.js +27 -0
  187. package/src/components/KAvatar/index.js +7 -0
  188. package/src/components/KBadge/KBadge.js +62 -0
  189. package/src/components/KBadge/index.js +7 -0
  190. package/src/components/KBottomNav/KBottomNav.js +50 -0
  191. package/src/components/KBottomNav/index.js +7 -0
  192. package/src/components/KBottomSheet/KBottomSheet.js +41 -0
  193. package/src/components/KBottomSheet/index.js +7 -0
  194. package/src/components/KBreadcrumbs/KBreadcrumbs.js +35 -0
  195. package/src/components/KBreadcrumbs/KBreadcrumbsItem.js +38 -0
  196. package/src/components/KBreadcrumbs/index.js +11 -0
  197. package/src/components/KBtn/KBtn.js +163 -0
  198. package/src/components/KBtn/index.js +7 -0
  199. package/src/components/KBtnToggle/KBtnToggle.js +92 -0
  200. package/src/components/KBtnToggle/index.js +7 -0
  201. package/src/components/KCard/KCard.js +61 -0
  202. package/src/components/KCard/KCardMedia.js +41 -0
  203. package/src/components/KCard/KCardTitle.js +17 -0
  204. package/src/components/KCard/index.js +19 -0
  205. package/src/components/KCarousel/KCarousel.js +174 -0
  206. package/src/components/KCarousel/KCarouselItem.js +65 -0
  207. package/src/components/KCarousel/index.js +11 -0
  208. package/src/components/KCheckbox/KCheckbox.js +92 -0
  209. package/src/components/KCheckbox/index.js +7 -0
  210. package/src/components/KChip/KChip.js +83 -0
  211. package/src/components/KChip/index.js +7 -0
  212. package/src/components/KDataTable/KDataTable.js +346 -0
  213. package/src/components/KDataTable/KEditDialog.js +110 -0
  214. package/src/components/KDataTable/index.js +16 -0
  215. package/src/components/KDataTable/mixins/body.js +98 -0
  216. package/src/components/KDataTable/mixins/foot.js +128 -0
  217. package/src/components/KDataTable/mixins/head.js +119 -0
  218. package/src/components/KDataTable/mixins/progress.js +16 -0
  219. package/src/components/KDatePicker/KDatePicker.js +382 -0
  220. package/src/components/KDatePicker/index.js +7 -0
  221. package/src/components/KDatePicker/mixins/date-header.js +74 -0
  222. package/src/components/KDatePicker/mixins/date-table.js +95 -0
  223. package/src/components/KDatePicker/mixins/date-title.js +76 -0
  224. package/src/components/KDatePicker/mixins/date-years.js +42 -0
  225. package/src/components/KDatePicker/mixins/month-table.js +82 -0
  226. package/src/components/KDialog/KDialog.js +184 -0
  227. package/src/components/KDialog/index.js +7 -0
  228. package/src/components/KDivider/KDivider.js +25 -0
  229. package/src/components/KDivider/index.js +7 -0
  230. package/src/components/KExpansionPanel/KExpansionPanel.js +55 -0
  231. package/src/components/KExpansionPanel/KExpansionPanelContent.js +112 -0
  232. package/src/components/KExpansionPanel/index.js +9 -0
  233. package/src/components/KFooter/KFooter.js +67 -0
  234. package/src/components/KFooter/index.js +7 -0
  235. package/src/components/KForm/KForm.js +117 -0
  236. package/src/components/KForm/index.js +7 -0
  237. package/src/components/KGrid/KContainer.js +5 -0
  238. package/src/components/KGrid/KContent.js +29 -0
  239. package/src/components/KGrid/KFlex.js +5 -0
  240. package/src/components/KGrid/KLayout.js +5 -0
  241. package/src/components/KGrid/grid.js +40 -0
  242. package/src/components/KGrid/index.js +27 -0
  243. package/src/components/KIcon/KIcon.js +87 -0
  244. package/src/components/KIcon/index.js +7 -0
  245. package/src/components/KList/KList.js +75 -0
  246. package/src/components/KList/KListGroup.js +95 -0
  247. package/src/components/KList/KListTile.js +62 -0
  248. package/src/components/KList/KListTileAction.js +12 -0
  249. package/src/components/KList/index.js +27 -0
  250. package/src/components/KMenu/KMenu.js +207 -0
  251. package/src/components/KMenu/index.js +7 -0
  252. package/src/components/KMenu/mixins/menu-activator.js +51 -0
  253. package/src/components/KMenu/mixins/menu-generators.js +84 -0
  254. package/src/components/KMenu/mixins/menu-keyable.js +68 -0
  255. package/src/components/KMenu/mixins/menu-position.js +72 -0
  256. package/src/components/KNavigationDrawer/KNavigationDrawer.js +267 -0
  257. package/src/components/KNavigationDrawer/index.js +7 -0
  258. package/src/components/KPagination/KPagination.js +168 -0
  259. package/src/components/KPagination/index.js +7 -0
  260. package/src/components/KParallax/KParallax.js +99 -0
  261. package/src/components/KParallax/index.js +7 -0
  262. package/src/components/KProgressCircular/KProgressCircular.js +160 -0
  263. package/src/components/KProgressCircular/index.js +7 -0
  264. package/src/components/KProgressLinear/KProgressLinear.js +157 -0
  265. package/src/components/KProgressLinear/index.js +7 -0
  266. package/src/components/KRadioGroup/KRadio.js +153 -0
  267. package/src/components/KRadioGroup/KRadioGroup.js +118 -0
  268. package/src/components/KRadioGroup/index.js +11 -0
  269. package/src/components/KSelect/KSelect.js +641 -0
  270. package/src/components/KSelect/index.js +7 -0
  271. package/src/components/KSelect/mixins/select-autocomplete.js +125 -0
  272. package/src/components/KSelect/mixins/select-generators.js +300 -0
  273. package/src/components/KSlider/KSlider.js +311 -0
  274. package/src/components/KSlider/index.js +7 -0
  275. package/src/components/KSnackbar/KSnackbar.js +97 -0
  276. package/src/components/KSnackbar/index.js +7 -0
  277. package/src/components/KSpeedDial/KSpeedDial.js +80 -0
  278. package/src/components/KSpeedDial/index.js +7 -0
  279. package/src/components/KStepper/KStepper.js +95 -0
  280. package/src/components/KStepper/KStepperContent.js +138 -0
  281. package/src/components/KStepper/KStepperStep.js +100 -0
  282. package/src/components/KStepper/index.js +17 -0
  283. package/src/components/KSubheader/KSubheader.js +25 -0
  284. package/src/components/KSubheader/index.js +7 -0
  285. package/src/components/KSwitch/KSwitch.js +58 -0
  286. package/src/components/KSwitch/index.js +7 -0
  287. package/src/components/KSystemBar/KSystemBar.js +54 -0
  288. package/src/components/KSystemBar/index.js +7 -0
  289. package/src/components/KTabs/KTabs.js +240 -0
  290. package/src/components/KTabs/KTabsBar.js +202 -0
  291. package/src/components/KTabs/KTabsContent.js +90 -0
  292. package/src/components/KTabs/KTabsItem.js +99 -0
  293. package/src/components/KTabs/KTabsItems.js +40 -0
  294. package/src/components/KTabs/KTabsSlider.js +14 -0
  295. package/src/components/KTabs/index.js +17 -0
  296. package/src/components/KTextField/KTextField.js +246 -0
  297. package/src/components/KTextField/index.js +7 -0
  298. package/src/components/KTimePicker/KTimePicker.js +282 -0
  299. package/src/components/KTimePicker/index.js +7 -0
  300. package/src/components/KTimePicker/mixins/time-body.js +208 -0
  301. package/src/components/KTimePicker/mixins/time-title.js +51 -0
  302. package/src/components/KToolbar/KToolbar.js +206 -0
  303. package/src/components/KToolbar/KToolbarSideIcon.js +26 -0
  304. package/src/components/KToolbar/index.js +19 -0
  305. package/src/components/KTooltip/KTooltip.js +161 -0
  306. package/src/components/KTooltip/index.js +7 -0
  307. package/src/components/Kdutify/index.js +48 -0
  308. package/src/components/index.js +45 -0
  309. package/src/components/transitions/expand-transition.js +34 -0
  310. package/src/components/transitions/index.js +50 -0
  311. package/src/components/transitions/row-expand-transition.js +38 -0
  312. package/src/directives/click-outside.js +72 -0
  313. package/src/directives/index.js +21 -0
  314. package/src/directives/resize.js +30 -0
  315. package/src/directives/ripple.js +120 -0
  316. package/src/directives/scroll.js +31 -0
  317. package/src/directives/touch.js +90 -0
  318. package/src/index.js +30 -0
  319. package/src/mixins/applicationable.js +9 -0
  320. package/src/mixins/bootable.js +31 -0
  321. package/src/mixins/button-group.js +77 -0
  322. package/src/mixins/colorable.js +20 -0
  323. package/src/mixins/contextualable.js +10 -0
  324. package/src/mixins/delayable.js +54 -0
  325. package/src/mixins/dependent.js +55 -0
  326. package/src/mixins/detachable.js +44 -0
  327. package/src/mixins/filterable.js +8 -0
  328. package/src/mixins/input.js +220 -0
  329. package/src/mixins/loadable.js +33 -0
  330. package/src/mixins/maskable.js +117 -0
  331. package/src/mixins/menuable.js +299 -0
  332. package/src/mixins/overlayable.js +180 -0
  333. package/src/mixins/picker.js +35 -0
  334. package/src/mixins/positionable.js +10 -0
  335. package/src/mixins/rippleable.js +21 -0
  336. package/src/mixins/routable.js +66 -0
  337. package/src/mixins/selectable.js +84 -0
  338. package/src/mixins/stackable.js +44 -0
  339. package/src/mixins/tab-focusable.js +7 -0
  340. package/src/mixins/themeable.js +15 -0
  341. package/src/mixins/toggleable.js +28 -0
  342. package/src/mixins/transitionable.js +7 -0
  343. package/src/mixins/translatable.js +67 -0
  344. package/src/mixins/validatable.js +124 -0
  345. package/src/stylus/app.styl +6 -0
  346. package/src/stylus/bootstrap.styl +1 -0
  347. package/src/stylus/components/_alerts.styl +44 -0
  348. package/src/stylus/components/_app.styl +21 -0
  349. package/src/stylus/components/_avatars.styl +22 -0
  350. package/src/stylus/components/_badges.styl +49 -0
  351. package/src/stylus/components/_bottom-navs.styl +86 -0
  352. package/src/stylus/components/_bottom-sheets.styl +18 -0
  353. package/src/stylus/components/_breadcrumbs.styl +46 -0
  354. package/src/stylus/components/_button-toggle.styl +55 -0
  355. package/src/stylus/components/_buttons.styl +339 -0
  356. package/src/stylus/components/_cards.styl +85 -0
  357. package/src/stylus/components/_carousel.styl +76 -0
  358. package/src/stylus/components/_chips.styl +102 -0
  359. package/src/stylus/components/_content.styl +6 -0
  360. package/src/stylus/components/_data-table.styl +113 -0
  361. package/src/stylus/components/_date-picker.styl +214 -0
  362. package/src/stylus/components/_dialogs.styl +63 -0
  363. package/src/stylus/components/_dividers.styl +19 -0
  364. package/src/stylus/components/_expansion-panel.styl +85 -0
  365. package/src/stylus/components/_footer.styl +40 -0
  366. package/src/stylus/components/_grid.styl +171 -0
  367. package/src/stylus/components/_icons.styl +32 -0
  368. package/src/stylus/components/_input-groups.styl +310 -0
  369. package/src/stylus/components/_lists.styl +263 -0
  370. package/src/stylus/components/_menus.styl +87 -0
  371. package/src/stylus/components/_navigation-drawer.styl +150 -0
  372. package/src/stylus/components/_overlay.styl +42 -0
  373. package/src/stylus/components/_pagination.styl +95 -0
  374. package/src/stylus/components/_parallax.styl +35 -0
  375. package/src/stylus/components/_pickers.styl +66 -0
  376. package/src/stylus/components/_progress-circular.styl +58 -0
  377. package/src/stylus/components/_progress-linear.styl +104 -0
  378. package/src/stylus/components/_radio-group.styl +23 -0
  379. package/src/stylus/components/_ripples.styl +31 -0
  380. package/src/stylus/components/_select.styl +153 -0
  381. package/src/stylus/components/_selection-controls.styl +122 -0
  382. package/src/stylus/components/_sliders.styl +234 -0
  383. package/src/stylus/components/_small-dialog.styl +37 -0
  384. package/src/stylus/components/_snackbars.styl +110 -0
  385. package/src/stylus/components/_speed-dial.styl +78 -0
  386. package/src/stylus/components/_steppers.styl +216 -0
  387. package/src/stylus/components/_subheaders.styl +18 -0
  388. package/src/stylus/components/_switch.styl +89 -0
  389. package/src/stylus/components/_system-bars.styl +49 -0
  390. package/src/stylus/components/_tables.styl +103 -0
  391. package/src/stylus/components/_tabs.styl +159 -0
  392. package/src/stylus/components/_text-fields.styl +243 -0
  393. package/src/stylus/components/_time-picker.styl +199 -0
  394. package/src/stylus/components/_toolbar.styl +148 -0
  395. package/src/stylus/components/_tooltips.styl +25 -0
  396. package/src/stylus/elements/_blockquote.styl +5 -0
  397. package/src/stylus/elements/_code.styl +20 -0
  398. package/src/stylus/elements/_global.styl +31 -0
  399. package/src/stylus/elements/_headings.styl +17 -0
  400. package/src/stylus/elements/_lists.styl +2 -0
  401. package/src/stylus/elements/_typography.styl +54 -0
  402. package/src/stylus/generic/_bootstrap.styl +49 -0
  403. package/src/stylus/generic/_reset.styl +332 -0
  404. package/src/stylus/generic/_transitions.styl +116 -0
  405. package/src/stylus/main.styl +2 -0
  406. package/src/stylus/settings/_colors.styl +339 -0
  407. package/src/stylus/settings/_elevations.styl +111 -0
  408. package/src/stylus/settings/_theme.styl +201 -0
  409. package/src/stylus/settings/_variables.styl +396 -0
  410. package/src/stylus/theme.styl +24 -0
  411. package/src/stylus/tools/_animations.styl +9 -0
  412. package/src/stylus/tools/_colors.styl +17 -0
  413. package/src/stylus/tools/_elevations.styl +7 -0
  414. package/src/stylus/trumps/_display.styl +14 -0
  415. package/src/stylus/trumps/_helpers.styl +5 -0
  416. package/src/stylus/trumps/_spacing.styl +37 -0
  417. package/src/stylus/trumps/_text.styl +13 -0
  418. package/src/util/breakpoint.js +134 -0
  419. package/src/util/helpers.d.ts +21 -0
  420. package/src/util/helpers.js +125 -0
  421. package/src/util/load.js +13 -0
  422. package/src/util/mask.js +138 -0
  423. package/src/util/testing.js +154 -0
  424. package/src/util/to-have-been-warned.js +68 -0
  425. package/src/util/touchSupport.js +12 -0
@@ -0,0 +1,635 @@
1
+ var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
2
+
3
+ require('../../../src/stylus/components/_text-fields.styl');
4
+ require('../../../src/stylus/components/_input-groups.styl');
5
+ require('../../../src/stylus/components/_select.styl');
6
+
7
+ // Components
8
+ import KCard from '../KCard';
9
+ import KCheckbox from '../KCheckbox';
10
+ import { KList, KListTile, KListTileAction, KListTileContent, KListTileTitle } from '../KList';
11
+ import KMenu from '../KMenu';
12
+ import KBtn from '../KBtn';
13
+
14
+ // Mixins
15
+ import Colorable from '../../mixins/colorable';
16
+ import Dependent from '../../mixins/dependent';
17
+ import Filterable from '../../mixins/filterable';
18
+ import Input from '../../mixins/input';
19
+ import Maskable from '../../mixins/maskable';
20
+
21
+ // Component level mixins
22
+ import Autocomplete from './mixins/select-autocomplete';
23
+ import Generators from './mixins/select-generators';
24
+
25
+ // Directives
26
+ import ClickOutside from '../../directives/click-outside';
27
+
28
+ // Helpers
29
+ import { getObjectValueByPath } from '../../util/helpers';
30
+
31
+ export default {
32
+ name: 'k-select',
33
+
34
+ inheritAttrs: false,
35
+
36
+ components: {
37
+ KCard: KCard,
38
+ KCheckbox: KCheckbox,
39
+ KList: KList,
40
+ KListTile: KListTile,
41
+ KListTileAction: KListTileAction,
42
+ KListTileContent: KListTileContent,
43
+ KListTileTitle: KListTileTitle,
44
+ KMenu: KMenu,
45
+ KBtn: KBtn
46
+ },
47
+
48
+ directives: {
49
+ ClickOutside: ClickOutside
50
+ },
51
+
52
+ mixins: [Autocomplete, Colorable, Dependent, Filterable, Generators, Input, Maskable],
53
+
54
+ data: function data() {
55
+ return {
56
+ cachedItems: [],
57
+ content: {},
58
+ inputValue: (this.multiple || this.tags) && !this.value ? [] : this.value,
59
+ isBooted: false,
60
+ lastItem: 20,
61
+ lazySearch: null,
62
+ isActive: false,
63
+ menuIsActive: false,
64
+ searchTimeout: null,
65
+ selectedIndex: -1,
66
+ selectedItems: [],
67
+ shouldBreak: false
68
+ };
69
+ },
70
+
71
+
72
+ props: {
73
+ appendIcon: {
74
+ type: String,
75
+ default: 'arrow_drop_down'
76
+ },
77
+ appendIconCb: Function,
78
+ auto: Boolean,
79
+ autocomplete: Boolean,
80
+ cacheItems: Boolean,
81
+ chips: Boolean,
82
+ clearable: Boolean,
83
+ color: {
84
+ type: String,
85
+ default: 'primary'
86
+ },
87
+ combobox: Boolean,
88
+ debounceSearch: {
89
+ type: [Number, String],
90
+ default: 200
91
+ },
92
+ browserAutocomplete: {
93
+ type: String,
94
+ default: 'on'
95
+ },
96
+ items: {
97
+ type: Array,
98
+ default: function _default() {
99
+ return [];
100
+ }
101
+ },
102
+ itemAvatar: {
103
+ type: String,
104
+ default: 'avatar'
105
+ },
106
+ itemText: {
107
+ type: String,
108
+ default: 'text'
109
+ },
110
+ itemValue: {
111
+ type: String,
112
+ default: 'value'
113
+ },
114
+ itemDisabled: {
115
+ type: String,
116
+ default: 'disabled'
117
+ },
118
+ maxHeight: {
119
+ type: [Number, String],
120
+ default: 300
121
+ },
122
+ minWidth: {
123
+ type: [Boolean, Number, String],
124
+ default: false
125
+ },
126
+ multiple: Boolean,
127
+ multiLine: Boolean,
128
+ solo: Boolean,
129
+ searchInput: {
130
+ default: null
131
+ },
132
+ singleLine: Boolean,
133
+ tags: Boolean,
134
+ returnObject: Boolean,
135
+ overflow: Boolean,
136
+ segmented: Boolean,
137
+ editable: Boolean
138
+ },
139
+
140
+ computed: {
141
+ classes: function classes() {
142
+ var classes = {
143
+ 'input-group--text-field input-group--select': true,
144
+ 'input-group--auto': this.auto,
145
+ 'input-group--overflow': this.overflow,
146
+ 'input-group--segmented': this.segmented,
147
+ 'input-group--editable': this.editable,
148
+ 'input-group--autocomplete': this.isAutocomplete,
149
+ 'input-group--single-line': this.singleLine || this.isDropdown,
150
+ 'input-group--multi-line': this.multiLine,
151
+ 'input-group--chips': this.chips,
152
+ 'input-group--solo': this.solo,
153
+ 'input-group--multiple': this.multiple
154
+ };
155
+
156
+ if (this.hasError) {
157
+ classes['error--text'] = true;
158
+ } else {
159
+ return this.addTextColorClassChecks(classes);
160
+ }
161
+
162
+ return classes;
163
+ },
164
+ computedContentClass: function computedContentClass() {
165
+ var children = ['menu__content--select', this.auto ? 'menu__content--auto' : '', this.isDropdown ? 'menu__content--dropdown' : '', this.isAutocomplete ? 'menu__content--autocomplete' : ''];
166
+
167
+ return children.join(' ');
168
+ },
169
+ computedItems: function computedItems() {
170
+ return this.filterDuplicates(this.cachedItems.concat(this.items));
171
+ },
172
+
173
+ /**
174
+ * The range of the current input text
175
+ *
176
+ * @return {Number}
177
+ */
178
+ currentRange: function currentRange() {
179
+ return this.getText(this.selectedItem || '').length;
180
+ },
181
+ filteredItems: function filteredItems() {
182
+ // If we are not actively filtering
183
+ // Show all available items
184
+ var items = this.isNotFiltering ? this.computedItems : this.filterSearch();
185
+
186
+ return !this.auto ? items.slice(0, this.lastItem) : items;
187
+ },
188
+ hideSelections: function hideSelections() {
189
+ return this.isAutocomplete && !this.isMultiple && this.isFocused && !this.chips;
190
+ },
191
+ isNotFiltering: function isNotFiltering() {
192
+ return this.isAutocomplete && this.isDirty && this.searchValue === this.getText(this.selectedItem);
193
+ },
194
+ isAutocomplete: function isAutocomplete() {
195
+ return this.autocomplete || this.editable || this.tags || this.combobox;
196
+ },
197
+ isDirty: function isDirty() {
198
+ return this.selectedItems.length > 0;
199
+ },
200
+ isDropdown: function isDropdown() {
201
+ return this.segmented || this.overflow || this.editable || this.solo;
202
+ },
203
+ isMultiple: function isMultiple() {
204
+ return this.multiple || this.tags;
205
+ },
206
+
207
+ searchValue: {
208
+ get: function get() {
209
+ return this.lazySearch;
210
+ },
211
+ set: function set(val) {
212
+ var _this = this;
213
+
214
+ if (!this.isAutocomplete || this.selectedIndex > -1) return;
215
+
216
+ this.lazySearch = val;
217
+
218
+ clearTimeout(this.searchTimeout);
219
+
220
+ this.searchTimeout = setTimeout(function () {
221
+ _this.$emit('update:searchInput', val);
222
+ }, this.debounceSearch);
223
+ }
224
+ },
225
+ selectedItem: function selectedItem() {
226
+ var _this2 = this;
227
+
228
+ if (this.isMultiple) return null;
229
+
230
+ return this.selectedItems.find(function (i) {
231
+ return _this2.getValue(i) === _this2.getValue(_this2.inputValue);
232
+ }) || null;
233
+ }
234
+ },
235
+
236
+ watch: {
237
+ inputValue: function inputValue(val) {
238
+ // Populate selected items
239
+ this.genSelectedItems(val);
240
+
241
+ this.$emit('input', val);
242
+
243
+ // When inputValue is changed
244
+ // and combobox is true set
245
+ // menu property to false
246
+ if (this.combobox) this.menuIsActive = false;
247
+ },
248
+ isActive: function isActive(val) {
249
+ if (!val) {
250
+ this.searchValue = null;
251
+ this.menuIsActive = false;
252
+ this.isFocused = false;
253
+ this.selectedIndex = -1;
254
+ } else {
255
+ this.searchValue = this.getText(this.selectedItem);
256
+ }
257
+
258
+ // this.lastItem += !val ? 20 : 0
259
+ },
260
+ isBooted: function isBooted() {
261
+ var _this3 = this;
262
+
263
+ this.$nextTick(function () {
264
+ if (_this3.content && _this3.content.addEventListener) {
265
+ _this3.content.addEventListener('scroll', _this3.onScroll, false);
266
+ }
267
+ });
268
+ },
269
+ isFocused: function isFocused(val) {
270
+ var _this4 = this;
271
+
272
+ // When focusing the input
273
+ // re-set the caret position
274
+ if (this.isAutocomplete && !this.mask && !this.isMultiple && val) {
275
+ this.setCaretPosition(this.currentRange);
276
+ this.shouldBreak && this.$nextTick(function () {
277
+ _this4.$refs.input.scrollLeft = _this4.$refs.input.scrollWidth;
278
+ });
279
+ }
280
+ },
281
+ items: function items(val) {
282
+ var _this5 = this;
283
+
284
+ if (this.cacheItems) {
285
+ this.cachedItems = this.filterDuplicates(this.cachedItems.concat(val));
286
+ }
287
+
288
+ this.$refs.menu.listIndex = -1;
289
+
290
+ this.searchValue && this.$nextTick(function () {
291
+ _this5.$refs.menu && (_this5.$refs.menu.listIndex = 0);
292
+ });
293
+
294
+ this.genSelectedItems();
295
+ },
296
+ menuIsActive: function menuIsActive(val) {
297
+ if (!val) return;
298
+
299
+ this.isBooted = true;
300
+ this.isActive = true;
301
+ },
302
+ isMultiple: function isMultiple(val) {
303
+ this.inputValue = val ? [] : null;
304
+ },
305
+ searchInput: function searchInput(val) {
306
+ this.searchValue = val;
307
+ },
308
+ searchValue: function searchValue(val) {
309
+ var _this6 = this;
310
+
311
+ // Wrap input to next line if overflowing
312
+ if (this.$refs.input.scrollWidth > this.$refs.input.clientWidth) {
313
+ this.shouldBreak = true;
314
+ this.$nextTick(this.$refs.menu.updateDimensions);
315
+ } else if (val === null) {
316
+ this.shouldBreak = false;
317
+ }
318
+
319
+ // Activate menu if inactive and searching
320
+ if (this.isActive && !this.menuIsActive && val !== this.getValue(this.selectedItem)) {
321
+ this.menuIsActive = true;
322
+ }
323
+
324
+ this.$refs.menu.listIndex = null;
325
+
326
+ this.$nextTick(function () {
327
+ _this6.$refs.menu && (_this6.$refs.menu.listIndex = val ? 0 : -1);
328
+ });
329
+ },
330
+ selectedItems: function selectedItems() {
331
+ clearTimeout(this.searchTimeout);
332
+
333
+ if (this.isAutocomplete) {
334
+ this.$nextTick(this.$refs.menu.updateDimensions);
335
+ }
336
+ },
337
+ value: function value(val) {
338
+ this.inputValue = val;
339
+ this.validate();
340
+ }
341
+ },
342
+
343
+ mounted: function mounted() {
344
+ // If instance is being destroyed
345
+ // do not run mounted functions
346
+ if (this._isDestroyed) return;
347
+
348
+ // Evaluate the selected items immediately
349
+ // to avoid a unnecessary label transition
350
+ this.genSelectedItems();
351
+
352
+ this.content = this.$refs.menu.$refs.content;
353
+ },
354
+ beforeDestroy: function beforeDestroy() {
355
+ if (this.isBooted) {
356
+ if (this.content) {
357
+ this.content.removeEventListener('scroll', this.onScroll, false);
358
+ }
359
+ }
360
+ },
361
+
362
+
363
+ methods: {
364
+ blur: function blur() {
365
+ var _this7 = this;
366
+
367
+ this.$emit('blur');
368
+ if (this.isAutocomplete && this.$refs.input) this.$refs.input.blur();
369
+ this.$nextTick(function () {
370
+ return _this7.isActive = false;
371
+ });
372
+ },
373
+ changeSelectedIndex: function changeSelectedIndex(keyCode) {
374
+ // backspace, left, right, delete
375
+ if (![8, 37, 39, 46].includes(keyCode)) return;
376
+
377
+ var indexes = this.selectedItems.length - 1;
378
+
379
+ if (keyCode === 37) {
380
+ // Left arrow
381
+ this.selectedIndex = this.selectedIndex === -1 ? indexes : this.selectedIndex - 1;
382
+ } else if (keyCode === 39) {
383
+ // Right arrow
384
+ this.selectedIndex = this.selectedIndex >= indexes ? -1 : this.selectedIndex + 1;
385
+ } else if (this.selectedIndex === -1) {
386
+ this.selectedIndex = indexes;
387
+ return;
388
+ }
389
+
390
+ // backspace/delete
391
+ if ([8, 46].includes(keyCode)) {
392
+ var newIndex = this.selectedIndex === indexes ? this.selectedIndex - 1 : this.selectedItems[this.selectedIndex + 1] ? this.selectedIndex : -1;
393
+
394
+ this.selectItem(this.selectedItems[this.selectedIndex]);
395
+ this.selectedIndex = newIndex;
396
+ }
397
+ },
398
+ compareObjects: function compareObjects(a, b) {
399
+ var aProps = Object.keys(a);
400
+ var bProps = Object.keys(b);
401
+
402
+ if (aProps.length !== bProps.length) return false;
403
+
404
+ for (var i = 0, length = aProps.length; i < length; i++) {
405
+ var propName = aProps[i];
406
+
407
+ if (a[propName] !== b[propName]) return false;
408
+ }
409
+
410
+ return true;
411
+ },
412
+ filterDuplicates: function filterDuplicates(arr) {
413
+ var values = arr.map(this.getValue);
414
+ return arr.filter(function (el, i) {
415
+ return i === values.indexOf(values[i]);
416
+ });
417
+ },
418
+ focus: function focus() {
419
+ this.isActive = true;
420
+ this.isFocused = true;
421
+
422
+ if (this.$refs.input && this.isAutocomplete) {
423
+ this.$refs.input.focus();
424
+ } else {
425
+ this.$el.focus();
426
+ }
427
+
428
+ this.$emit('focus');
429
+ },
430
+ genDirectives: function genDirectives() {
431
+ var _this8 = this;
432
+
433
+ return [{
434
+ name: 'click-outside',
435
+ value: function value(e) {
436
+ return _this8.$refs.menu && !_this8.$refs.menu.$refs.content.contains(e.target);
437
+ }
438
+ }];
439
+ },
440
+ genListeners: function genListeners() {
441
+ var _this9 = this;
442
+
443
+ var listeners = Object.assign({}, this.$listeners);
444
+ delete listeners.input;
445
+
446
+ return _extends({}, listeners, {
447
+ click: function click() {
448
+ if (_this9.disabled || _this9.readonly) return;
449
+ _this9.showMenuItems();
450
+ _this9.selectedIndex = -1;
451
+ },
452
+ focus: function focus() {
453
+ if (_this9.disabled || _this9.readonly) return;
454
+
455
+ !_this9.isFocused && _this9.focus();
456
+ },
457
+ keydown: this.onKeyDown // Located in mixins/select-autocomplete.js
458
+ });
459
+ },
460
+ genLabel: function genLabel() {
461
+ var singleLine = this.singleLine || this.isDropdown;
462
+ if (singleLine && this.isDirty || singleLine && this.isFocused && this.searchValue) return null;
463
+
464
+ var data = {};
465
+
466
+ if (this.id) data.attrs = { for: this.id };
467
+
468
+ return this.$createElement('label', data, this.$slots.label || this.label);
469
+ },
470
+ getPropertyFromItem: function getPropertyFromItem(item, field) {
471
+ if (item !== Object(item)) return item;
472
+
473
+ var value = getObjectValueByPath(item, field);
474
+
475
+ return typeof value === 'undefined' ? item : value;
476
+ },
477
+ genSelectedItems: function genSelectedItems() {
478
+ var _this10 = this;
479
+
480
+ var val = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.inputValue;
481
+
482
+ // If we are using tags, don't filter results
483
+ if (this.tags) return this.selectedItems = val;
484
+
485
+ // Combobox is the single version
486
+ // of a taggable select element
487
+ if (this.combobox) return this.selectedItems = val ? [val] : [];
488
+
489
+ var selectedItems = this.computedItems.filter(function (i) {
490
+ if (!_this10.isMultiple) {
491
+ return _this10.getValue(i) === _this10.getValue(val);
492
+ } else {
493
+ // Always return Boolean
494
+ return val.find(function (j) {
495
+ var a = _this10.getValue(j);
496
+ var b = _this10.getValue(i);
497
+
498
+ if (a !== Object(a)) return a === b;
499
+
500
+ return _this10.compareObjects(a, b);
501
+ }) !== undefined;
502
+ }
503
+ });
504
+
505
+ if (!selectedItems.length && val != null && this.tags) {
506
+ selectedItems = Array.isArray(val) ? val : [val];
507
+ }
508
+
509
+ this.selectedItems = selectedItems;
510
+ },
511
+ getText: function getText(item) {
512
+ return this.getPropertyFromItem(item, this.itemText);
513
+ },
514
+ getValue: function getValue(item) {
515
+ return this.getPropertyFromItem(item, this.itemValue);
516
+ },
517
+ clearableCallback: function clearableCallback() {
518
+ var inputValue = this.isMultiple ? [] : null;
519
+
520
+ this.inputValue = inputValue;
521
+ this.searchValue = null;
522
+ this.$emit('change', inputValue);
523
+ this.genSelectedItems();
524
+ this.showMenu();
525
+ },
526
+ showMenu: function showMenu() {
527
+ this.showMenuItems();
528
+ this.isAutocomplete && this.focus();
529
+ },
530
+ onScroll: function onScroll() {
531
+ var _this11 = this;
532
+
533
+ if (!this.isActive) {
534
+ requestAnimationFrame(function () {
535
+ return _this11.content.scrollTop = 0;
536
+ });
537
+ } else {
538
+ if (this.lastItem >= this.computedItems.length) return;
539
+
540
+ var showMoreItems = this.content.scrollHeight - (this.content.scrollTop + this.content.clientHeight) < 200;
541
+
542
+ if (showMoreItems) {
543
+ this.lastItem += 20;
544
+ }
545
+ }
546
+ },
547
+ selectItem: function selectItem(item) {
548
+ var _this12 = this;
549
+
550
+ if (!this.isMultiple) {
551
+ this.inputValue = this.returnObject ? item : this.getValue(item);
552
+ this.selectedItems = [item];
553
+ } else {
554
+ var selectedItems = [];
555
+ var inputValue = this.inputValue.slice();
556
+ var i = this.inputValue.findIndex(function (i) {
557
+ var a = _this12.getValue(i);
558
+ var b = _this12.getValue(item);
559
+
560
+ if (a !== Object(a)) return a === b;
561
+
562
+ return _this12.compareObjects(a, b);
563
+ });
564
+
565
+ i !== -1 && inputValue.splice(i, 1) || inputValue.push(item);
566
+ this.inputValue = inputValue.map(function (i) {
567
+ selectedItems.push(i);
568
+ return _this12.returnObject ? i : _this12.getValue(i);
569
+ });
570
+
571
+ this.selectedItems = selectedItems;
572
+ }
573
+
574
+ this.searchValue = !this.isMultiple || this.chips ? this.getText(this.selectedItem) : '';
575
+
576
+ this.$emit('change', this.inputValue);
577
+
578
+ // List tile will re-render, reset index to
579
+ // maintain highlighting
580
+ var savedIndex = this.$refs.menu.listIndex;
581
+ this.$refs.menu.listIndex = -1;
582
+
583
+ // After selecting an item
584
+ // refocus the input and
585
+ // reset the caret pos
586
+ this.$nextTick(function () {
587
+ _this12.focus();
588
+ _this12.setCaretPosition(_this12.currentRange);
589
+ _this12.$refs.menu && (_this12.$refs.menu.listIndex = savedIndex);
590
+ });
591
+ },
592
+ showMenuItems: function showMenuItems() {
593
+ this.isActive = true;
594
+ this.menuIsActive = true;
595
+ this.chips && (this.$refs.menu.listIndex = -1);
596
+ }
597
+ },
598
+
599
+ render: function render(h) {
600
+ var _this13 = this;
601
+
602
+ var data = {
603
+ attrs: _extends({
604
+ tabindex: this.isAutocomplete || this.disabled ? -1 : this.tabindex
605
+ }, this.isAutocomplete ? null : this.$attrs, {
606
+ role: this.isAutocomplete ? null : 'combobox'
607
+ })
608
+ };
609
+
610
+ if (!this.isAutocomplete) {
611
+ data.on = this.genListeners();
612
+ data.directives = this.genDirectives();
613
+ } else {
614
+ data.on = {
615
+ click: function click() {
616
+ if (_this13.disabled || _this13.readonly) return;
617
+
618
+ // Workaround for clicking select
619
+ // when using autocomplete
620
+ // and click doesn't target the input
621
+ setTimeout(function () {
622
+ if (_this13.menuIsActive) return;
623
+
624
+ _this13.focus();
625
+ _this13.menuIsActive = true;
626
+ }, 100);
627
+ }
628
+ };
629
+ }
630
+
631
+ return this.genInputGroup([this.genSelectionsAndSearch(), this.genMenu()], data, function () {
632
+ return _this13.showMenu();
633
+ });
634
+ }
635
+ };
@@ -0,0 +1,7 @@
1
+ import KSelect from './KSelect';
2
+
3
+ KSelect.install = function install(Kdu) {
4
+ Kdu.component(KSelect.name, KSelect);
5
+ };
6
+
7
+ export default KSelect;