@thinkpixellab-public/px-vue 3.0.1

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 (398) hide show
  1. package/.eslintrc.js +14 -0
  2. package/.prettierrc.js +10 -0
  3. package/LICENSE.md +9 -0
  4. package/README.md +83 -0
  5. package/assets/feather/activity.svg +1 -0
  6. package/assets/feather/airplay.svg +1 -0
  7. package/assets/feather/alert-circle.svg +1 -0
  8. package/assets/feather/alert-octagon.svg +1 -0
  9. package/assets/feather/alert-triangle.svg +1 -0
  10. package/assets/feather/align-center.svg +1 -0
  11. package/assets/feather/align-justify.svg +1 -0
  12. package/assets/feather/align-left.svg +1 -0
  13. package/assets/feather/align-right.svg +1 -0
  14. package/assets/feather/anchor.svg +1 -0
  15. package/assets/feather/aperture.svg +1 -0
  16. package/assets/feather/archive.svg +1 -0
  17. package/assets/feather/arrow-down-circle.svg +1 -0
  18. package/assets/feather/arrow-down-left.svg +1 -0
  19. package/assets/feather/arrow-down-right.svg +1 -0
  20. package/assets/feather/arrow-down.svg +1 -0
  21. package/assets/feather/arrow-left-circle.svg +1 -0
  22. package/assets/feather/arrow-left.svg +1 -0
  23. package/assets/feather/arrow-right-circle.svg +1 -0
  24. package/assets/feather/arrow-right.svg +1 -0
  25. package/assets/feather/arrow-up-circle.svg +1 -0
  26. package/assets/feather/arrow-up-left.svg +1 -0
  27. package/assets/feather/arrow-up-right.svg +1 -0
  28. package/assets/feather/arrow-up.svg +1 -0
  29. package/assets/feather/at-sign.svg +1 -0
  30. package/assets/feather/award.svg +1 -0
  31. package/assets/feather/bar-chart-2.svg +1 -0
  32. package/assets/feather/bar-chart.svg +1 -0
  33. package/assets/feather/battery-charging.svg +1 -0
  34. package/assets/feather/battery.svg +1 -0
  35. package/assets/feather/bell-off.svg +1 -0
  36. package/assets/feather/bell.svg +1 -0
  37. package/assets/feather/bluetooth.svg +1 -0
  38. package/assets/feather/bold.svg +1 -0
  39. package/assets/feather/book-open.svg +1 -0
  40. package/assets/feather/book.svg +1 -0
  41. package/assets/feather/bookmark.svg +1 -0
  42. package/assets/feather/box.svg +1 -0
  43. package/assets/feather/briefcase.svg +1 -0
  44. package/assets/feather/calendar.svg +1 -0
  45. package/assets/feather/camera-off.svg +1 -0
  46. package/assets/feather/camera.svg +1 -0
  47. package/assets/feather/cast.svg +1 -0
  48. package/assets/feather/check-circle.svg +1 -0
  49. package/assets/feather/check-square.svg +1 -0
  50. package/assets/feather/check.svg +1 -0
  51. package/assets/feather/chevron-down.svg +1 -0
  52. package/assets/feather/chevron-left.svg +1 -0
  53. package/assets/feather/chevron-right.svg +1 -0
  54. package/assets/feather/chevron-up.svg +1 -0
  55. package/assets/feather/chevrons-down.svg +1 -0
  56. package/assets/feather/chevrons-left.svg +1 -0
  57. package/assets/feather/chevrons-right.svg +1 -0
  58. package/assets/feather/chevrons-up.svg +1 -0
  59. package/assets/feather/chrome.svg +1 -0
  60. package/assets/feather/circle.svg +1 -0
  61. package/assets/feather/clipboard.svg +1 -0
  62. package/assets/feather/clock.svg +1 -0
  63. package/assets/feather/cloud-drizzle.svg +1 -0
  64. package/assets/feather/cloud-lightning.svg +1 -0
  65. package/assets/feather/cloud-off.svg +1 -0
  66. package/assets/feather/cloud-rain.svg +1 -0
  67. package/assets/feather/cloud-snow.svg +1 -0
  68. package/assets/feather/cloud.svg +1 -0
  69. package/assets/feather/code.svg +1 -0
  70. package/assets/feather/codepen.svg +1 -0
  71. package/assets/feather/codesandbox.svg +1 -0
  72. package/assets/feather/coffee.svg +1 -0
  73. package/assets/feather/columns.svg +1 -0
  74. package/assets/feather/command.svg +1 -0
  75. package/assets/feather/compass.svg +1 -0
  76. package/assets/feather/copy.svg +1 -0
  77. package/assets/feather/corner-down-left.svg +1 -0
  78. package/assets/feather/corner-down-right.svg +1 -0
  79. package/assets/feather/corner-left-down.svg +1 -0
  80. package/assets/feather/corner-left-up.svg +1 -0
  81. package/assets/feather/corner-right-down.svg +1 -0
  82. package/assets/feather/corner-right-up.svg +1 -0
  83. package/assets/feather/corner-up-left.svg +1 -0
  84. package/assets/feather/corner-up-right.svg +1 -0
  85. package/assets/feather/cpu.svg +1 -0
  86. package/assets/feather/credit-card.svg +1 -0
  87. package/assets/feather/crop.svg +1 -0
  88. package/assets/feather/crosshair.svg +1 -0
  89. package/assets/feather/database.svg +1 -0
  90. package/assets/feather/delete.svg +1 -0
  91. package/assets/feather/disc.svg +1 -0
  92. package/assets/feather/divide-circle.svg +1 -0
  93. package/assets/feather/divide-square.svg +1 -0
  94. package/assets/feather/divide.svg +1 -0
  95. package/assets/feather/dollar-sign.svg +1 -0
  96. package/assets/feather/download-cloud.svg +1 -0
  97. package/assets/feather/download.svg +1 -0
  98. package/assets/feather/dribbble.svg +1 -0
  99. package/assets/feather/droplet.svg +1 -0
  100. package/assets/feather/edit-2.svg +1 -0
  101. package/assets/feather/edit-3.svg +1 -0
  102. package/assets/feather/edit.svg +1 -0
  103. package/assets/feather/external-link.svg +1 -0
  104. package/assets/feather/eye-off.svg +1 -0
  105. package/assets/feather/eye.svg +1 -0
  106. package/assets/feather/facebook.svg +1 -0
  107. package/assets/feather/fast-forward.svg +1 -0
  108. package/assets/feather/feather.svg +1 -0
  109. package/assets/feather/figma.svg +1 -0
  110. package/assets/feather/file-minus.svg +1 -0
  111. package/assets/feather/file-plus.svg +1 -0
  112. package/assets/feather/file-text.svg +1 -0
  113. package/assets/feather/file.svg +1 -0
  114. package/assets/feather/film.svg +1 -0
  115. package/assets/feather/filter.svg +1 -0
  116. package/assets/feather/flag.svg +1 -0
  117. package/assets/feather/folder-minus.svg +1 -0
  118. package/assets/feather/folder-plus.svg +1 -0
  119. package/assets/feather/folder.svg +1 -0
  120. package/assets/feather/framer.svg +1 -0
  121. package/assets/feather/frown.svg +1 -0
  122. package/assets/feather/gift.svg +1 -0
  123. package/assets/feather/git-branch.svg +1 -0
  124. package/assets/feather/git-commit.svg +1 -0
  125. package/assets/feather/git-merge.svg +1 -0
  126. package/assets/feather/git-pull-request.svg +1 -0
  127. package/assets/feather/github.svg +1 -0
  128. package/assets/feather/gitlab.svg +1 -0
  129. package/assets/feather/globe.svg +1 -0
  130. package/assets/feather/grid.svg +1 -0
  131. package/assets/feather/hard-drive.svg +1 -0
  132. package/assets/feather/hash.svg +1 -0
  133. package/assets/feather/headphones.svg +1 -0
  134. package/assets/feather/heart.svg +1 -0
  135. package/assets/feather/help-circle.svg +1 -0
  136. package/assets/feather/hexagon.svg +1 -0
  137. package/assets/feather/home.svg +1 -0
  138. package/assets/feather/image.svg +1 -0
  139. package/assets/feather/inbox.svg +1 -0
  140. package/assets/feather/info.svg +1 -0
  141. package/assets/feather/instagram.svg +1 -0
  142. package/assets/feather/italic.svg +1 -0
  143. package/assets/feather/key.svg +1 -0
  144. package/assets/feather/layers.svg +1 -0
  145. package/assets/feather/layout.svg +1 -0
  146. package/assets/feather/life-buoy.svg +1 -0
  147. package/assets/feather/link-2.svg +1 -0
  148. package/assets/feather/link.svg +1 -0
  149. package/assets/feather/linkedin.svg +1 -0
  150. package/assets/feather/list.svg +1 -0
  151. package/assets/feather/loader.svg +1 -0
  152. package/assets/feather/lock.svg +1 -0
  153. package/assets/feather/log-in.svg +1 -0
  154. package/assets/feather/log-out.svg +1 -0
  155. package/assets/feather/mail.svg +1 -0
  156. package/assets/feather/map-pin.svg +1 -0
  157. package/assets/feather/map.svg +1 -0
  158. package/assets/feather/maximize-2.svg +1 -0
  159. package/assets/feather/maximize.svg +1 -0
  160. package/assets/feather/meh.svg +1 -0
  161. package/assets/feather/menu.svg +1 -0
  162. package/assets/feather/message-circle.svg +1 -0
  163. package/assets/feather/message-square.svg +1 -0
  164. package/assets/feather/mic-off.svg +1 -0
  165. package/assets/feather/mic.svg +1 -0
  166. package/assets/feather/minimize-2.svg +1 -0
  167. package/assets/feather/minimize.svg +1 -0
  168. package/assets/feather/minus-circle.svg +1 -0
  169. package/assets/feather/minus-square.svg +1 -0
  170. package/assets/feather/minus.svg +1 -0
  171. package/assets/feather/monitor.svg +1 -0
  172. package/assets/feather/moon.svg +1 -0
  173. package/assets/feather/more-horizontal.svg +1 -0
  174. package/assets/feather/more-vertical.svg +1 -0
  175. package/assets/feather/mouse-pointer.svg +1 -0
  176. package/assets/feather/move.svg +1 -0
  177. package/assets/feather/music.svg +1 -0
  178. package/assets/feather/navigation-2.svg +1 -0
  179. package/assets/feather/navigation.svg +1 -0
  180. package/assets/feather/octagon.svg +1 -0
  181. package/assets/feather/package.svg +1 -0
  182. package/assets/feather/paperclip.svg +1 -0
  183. package/assets/feather/pause-circle.svg +1 -0
  184. package/assets/feather/pause.svg +1 -0
  185. package/assets/feather/pen-tool.svg +1 -0
  186. package/assets/feather/percent.svg +1 -0
  187. package/assets/feather/phone-call.svg +1 -0
  188. package/assets/feather/phone-forwarded.svg +1 -0
  189. package/assets/feather/phone-incoming.svg +1 -0
  190. package/assets/feather/phone-missed.svg +1 -0
  191. package/assets/feather/phone-off.svg +1 -0
  192. package/assets/feather/phone-outgoing.svg +1 -0
  193. package/assets/feather/phone.svg +1 -0
  194. package/assets/feather/pie-chart.svg +1 -0
  195. package/assets/feather/play-circle.svg +1 -0
  196. package/assets/feather/play.svg +1 -0
  197. package/assets/feather/plus-circle.svg +1 -0
  198. package/assets/feather/plus-square.svg +1 -0
  199. package/assets/feather/plus.svg +1 -0
  200. package/assets/feather/pocket.svg +1 -0
  201. package/assets/feather/power.svg +1 -0
  202. package/assets/feather/printer.svg +1 -0
  203. package/assets/feather/radio.svg +1 -0
  204. package/assets/feather/refresh-ccw.svg +1 -0
  205. package/assets/feather/refresh-cw.svg +1 -0
  206. package/assets/feather/repeat.svg +1 -0
  207. package/assets/feather/rewind.svg +1 -0
  208. package/assets/feather/rotate-ccw.svg +1 -0
  209. package/assets/feather/rotate-cw.svg +1 -0
  210. package/assets/feather/rss.svg +1 -0
  211. package/assets/feather/save.svg +1 -0
  212. package/assets/feather/scissors.svg +1 -0
  213. package/assets/feather/search.svg +1 -0
  214. package/assets/feather/send.svg +1 -0
  215. package/assets/feather/server.svg +1 -0
  216. package/assets/feather/settings.svg +1 -0
  217. package/assets/feather/share-2.svg +1 -0
  218. package/assets/feather/share.svg +1 -0
  219. package/assets/feather/shield-off.svg +1 -0
  220. package/assets/feather/shield.svg +1 -0
  221. package/assets/feather/shopping-bag.svg +1 -0
  222. package/assets/feather/shopping-cart.svg +1 -0
  223. package/assets/feather/shuffle.svg +1 -0
  224. package/assets/feather/sidebar.svg +1 -0
  225. package/assets/feather/skip-back.svg +1 -0
  226. package/assets/feather/skip-forward.svg +1 -0
  227. package/assets/feather/slack.svg +1 -0
  228. package/assets/feather/slash.svg +1 -0
  229. package/assets/feather/sliders.svg +1 -0
  230. package/assets/feather/smartphone.svg +1 -0
  231. package/assets/feather/smile.svg +1 -0
  232. package/assets/feather/speaker.svg +1 -0
  233. package/assets/feather/square.svg +1 -0
  234. package/assets/feather/star.svg +1 -0
  235. package/assets/feather/stop-circle.svg +1 -0
  236. package/assets/feather/sun.svg +1 -0
  237. package/assets/feather/sunrise.svg +1 -0
  238. package/assets/feather/sunset.svg +1 -0
  239. package/assets/feather/table.svg +1 -0
  240. package/assets/feather/tablet.svg +1 -0
  241. package/assets/feather/tag.svg +1 -0
  242. package/assets/feather/target.svg +1 -0
  243. package/assets/feather/terminal.svg +1 -0
  244. package/assets/feather/thermometer.svg +1 -0
  245. package/assets/feather/thumbs-down.svg +1 -0
  246. package/assets/feather/thumbs-up.svg +1 -0
  247. package/assets/feather/toggle-left.svg +1 -0
  248. package/assets/feather/toggle-right.svg +1 -0
  249. package/assets/feather/tool.svg +1 -0
  250. package/assets/feather/trash-2.svg +1 -0
  251. package/assets/feather/trash.svg +1 -0
  252. package/assets/feather/trello.svg +1 -0
  253. package/assets/feather/trending-down.svg +1 -0
  254. package/assets/feather/trending-up.svg +1 -0
  255. package/assets/feather/triangle.svg +1 -0
  256. package/assets/feather/truck.svg +1 -0
  257. package/assets/feather/tv.svg +1 -0
  258. package/assets/feather/twitch.svg +1 -0
  259. package/assets/feather/twitter.svg +1 -0
  260. package/assets/feather/type.svg +1 -0
  261. package/assets/feather/umbrella.svg +1 -0
  262. package/assets/feather/underline.svg +1 -0
  263. package/assets/feather/unlock.svg +1 -0
  264. package/assets/feather/upload-cloud.svg +1 -0
  265. package/assets/feather/upload.svg +1 -0
  266. package/assets/feather/user-check.svg +1 -0
  267. package/assets/feather/user-minus.svg +1 -0
  268. package/assets/feather/user-plus.svg +1 -0
  269. package/assets/feather/user-x.svg +1 -0
  270. package/assets/feather/user.svg +1 -0
  271. package/assets/feather/users.svg +1 -0
  272. package/assets/feather/video-off.svg +1 -0
  273. package/assets/feather/video.svg +1 -0
  274. package/assets/feather/voicemail.svg +1 -0
  275. package/assets/feather/volume-1.svg +1 -0
  276. package/assets/feather/volume-2.svg +1 -0
  277. package/assets/feather/volume-x.svg +1 -0
  278. package/assets/feather/volume.svg +1 -0
  279. package/assets/feather/watch.svg +1 -0
  280. package/assets/feather/wifi-off.svg +1 -0
  281. package/assets/feather/wifi.svg +1 -0
  282. package/assets/feather/wind.svg +1 -0
  283. package/assets/feather/x-circle.svg +1 -0
  284. package/assets/feather/x-octagon.svg +1 -0
  285. package/assets/feather/x-square.svg +1 -0
  286. package/assets/feather/x.svg +1 -0
  287. package/assets/feather/youtube.svg +1 -0
  288. package/assets/feather/zap-off.svg +1 -0
  289. package/assets/feather/zap.svg +1 -0
  290. package/assets/feather/zoom-in.svg +1 -0
  291. package/assets/feather/zoom-out.svg +1 -0
  292. package/assets/icons/calendar.svg +6 -0
  293. package/assets/icons/check.svg +1 -0
  294. package/assets/icons/close-sm.svg +1 -0
  295. package/assets/icons/close.svg +1 -0
  296. package/assets/icons/copy.svg +1 -0
  297. package/assets/icons/dropdown.svg +8 -0
  298. package/assets/icons/invalid.svg +1 -0
  299. package/assets/icons/menu.svg +1 -0
  300. package/assets/icons/nav-next.svg +1 -0
  301. package/assets/icons/nav-prev.svg +1 -0
  302. package/assets/icons/sort-asc.svg +1 -0
  303. package/assets/icons/sort-desc.svg +1 -0
  304. package/assets/test/README.md +1 -0
  305. package/assets/test/trash.svg +8 -0
  306. package/babel.config.js +16 -0
  307. package/components/PxAspect.vue +127 -0
  308. package/components/PxAutoClamp.vue +75 -0
  309. package/components/PxBalancedText.vue +118 -0
  310. package/components/PxBase.vue +15 -0
  311. package/components/PxBaseDate.vue +27 -0
  312. package/components/PxBaseItems.vue +72 -0
  313. package/components/PxBaseItemsSelect.vue +230 -0
  314. package/components/PxBaseResize.vue +60 -0
  315. package/components/PxBaseToggle.vue +56 -0
  316. package/components/PxBaseVariants.vue +62 -0
  317. package/components/PxBaseVisible.vue +40 -0
  318. package/components/PxCalendar.vue +385 -0
  319. package/components/PxCard.vue +47 -0
  320. package/components/PxCardGrid.vue +386 -0
  321. package/components/PxClock.vue +510 -0
  322. package/components/PxCopyText.vue +78 -0
  323. package/components/PxDatePicker.vue +249 -0
  324. package/components/PxDropdown.vue +181 -0
  325. package/components/PxExpander.vue +46 -0
  326. package/components/PxFeatherIcon.vue +29 -0
  327. package/components/PxFeatherIconButton.vue +19 -0
  328. package/components/PxFit.vue +274 -0
  329. package/components/PxFlex.vue +93 -0
  330. package/components/PxFloat.vue +32 -0
  331. package/components/PxIcon.vue +43 -0
  332. package/components/PxIconButton.vue +115 -0
  333. package/components/PxIdUniquer.vue +59 -0
  334. package/components/PxModal.vue +365 -0
  335. package/components/PxNineGrid.vue +94 -0
  336. package/components/PxPivot.vue +207 -0
  337. package/components/PxPopup.vue +230 -0
  338. package/components/PxPortal.vue +138 -0
  339. package/components/PxPortalTarget.vue +25 -0
  340. package/components/PxProgressCircle.vue +73 -0
  341. package/components/PxRadioButton.vue +83 -0
  342. package/components/PxSideDrawer.vue +164 -0
  343. package/components/PxSlideTransition.vue +116 -0
  344. package/components/PxSlides.vue +217 -0
  345. package/components/PxStylesPreview.vue +129 -0
  346. package/components/PxSvg.vue +157 -0
  347. package/components/PxSwiper.vue +271 -0
  348. package/components/PxSwiperSlide.vue +42 -0
  349. package/components/PxSyncHeight.vue +137 -0
  350. package/components/PxTable.vue +323 -0
  351. package/components/PxTabs.vue +1 -0
  352. package/components/PxTextbox.vue +90 -0
  353. package/components/PxToggle.vue +125 -0
  354. package/components/PxToggleButton.vue +139 -0
  355. package/components/PxToggleButtonList.vue +131 -0
  356. package/components/PxTransitionExpand.vue +100 -0
  357. package/components/PxValidator.vue +431 -0
  358. package/components/PxVueTest.vue +761 -0
  359. package/components/README.md +0 -0
  360. package/dev/data/fruits.js +59 -0
  361. package/dev/data/random.js +13 -0
  362. package/dev/demos/Demo-PxBaseDrag.vue +94 -0
  363. package/dev/demos/Demo-PxCardGrid.vue +53 -0
  364. package/dev/demos/Demo-PxPivot.vue +58 -0
  365. package/dev/demos/Demo-PxSideDrawer.vue +72 -0
  366. package/dev/demos/Demo-PxSlideTransition.vue +86 -0
  367. package/dev/demos/Demo-PxSlides.vue +142 -0
  368. package/dev/demos/Demo-PxStylesPreview.vue +46 -0
  369. package/dev/demos/Demo-PxSwiper.vue +44 -0
  370. package/dev/demos/DemoPicker.vue +79 -0
  371. package/dev/dev.vue +56 -0
  372. package/dev/serve.js +17 -0
  373. package/package.json +45 -0
  374. package/plugins/common-client.js +13 -0
  375. package/plugins/common-lib.js +4 -0
  376. package/plugins/common.js +39 -0
  377. package/plugins/filters/aspect.js +14 -0
  378. package/plugins/filters/date.js +26 -0
  379. package/plugins/filters/kebab.js +9 -0
  380. package/plugins/filters/phone.js +7 -0
  381. package/plugins/filters/slug.js +26 -0
  382. package/plugins/filters/spacenator.js +11 -0
  383. package/plugins/filters/stringToItems.js +28 -0
  384. package/plugins/filters/striphtml.js +10 -0
  385. package/plugins/mixins/eventBus.js +23 -0
  386. package/px-styles.config.scss +12 -0
  387. package/styles/helpers.scss +14 -0
  388. package/styles/px.scss +6 -0
  389. package/utils/balanceText.js +123 -0
  390. package/utils/bem.js +99 -0
  391. package/utils/cardGrid.js +383 -0
  392. package/utils/cssStr.js +45 -0
  393. package/utils/drag.js +363 -0
  394. package/utils/fit.js +73 -0
  395. package/utils/tween.js +129 -0
  396. package/utils/utils.js +167 -0
  397. package/utils/variants.js +33 -0
  398. package/vue.config.js +12 -0
@@ -0,0 +1,761 @@
1
+ <!--
2
+
3
+ -->
4
+ <template>
5
+ <div class="px-vue-test">
6
+ <px-tester>
7
+ <px-test test-id="px-nine-grid" name="px-nine-grid" :size="{ h: 300 }">
8
+ <px-nine-grid
9
+ slice="50"
10
+ src="https://harnerdesigns.com/wp-content/uploads/2018/08/border.svg"
11
+ :src-width="300"
12
+ :src-height="300"
13
+ :style="{ width: cssPcnt(1), height: cssPcnt(1) }"
14
+ />
15
+ </px-test>
16
+
17
+ <px-test test-id="px-card-grd" name="px-card-grid" :size="{ h: 300 }">
18
+ <px-card-grid />
19
+ </px-test>
20
+
21
+ <px-test test-id="px-fit" name="px-fit" :size="{ h: 300 }">
22
+ <px-fit :fits="['lg', 'md', 'sm']" :debug="false">
23
+ <template #default="{ fit }">
24
+ <div :class="`fit fit--${fit}`">
25
+ <span v-if="fit == 'lg'">LARGE</span>
26
+ <span v-if="fit == 'md'">MEDIUM</span>
27
+ <span v-if="fit == 'sm'">SMALL</span>
28
+ One Two Three Four Five Size Seven Eight Nine Ten
29
+ </div>
30
+ </template>
31
+ </px-fit>
32
+ </px-test>
33
+
34
+ <px-test test-id="px-table" name="px-table" :size="{ h: 300 }">
35
+ <!--
36
+ id: 'orange',
37
+ name: 'Orange',
38
+ color: 'orange',
39
+ deliciousNess: 8,
40
+ lastPurchase: new Date('2022-02-01T00:00:00.000Z'),
41
+
42
+ -->
43
+
44
+ <px-table
45
+ :items="fruits"
46
+ items-key-property="id"
47
+ :columns="[
48
+ {
49
+ property: 'name',
50
+ align: 'start',
51
+ },
52
+ {
53
+ template: 'color',
54
+ headerTemplate: 'color-header',
55
+ label: 'COLOR',
56
+ sortable: false,
57
+ },
58
+ {
59
+ property: 'deliciousNess',
60
+ },
61
+ {
62
+ property: 'description',
63
+ overflow: 'ellipsis',
64
+ align: 'start',
65
+ },
66
+ {
67
+ property: 'lastPurchase',
68
+ },
69
+ ]"
70
+ >
71
+ <!-- color column slot -->
72
+ <template #color="{ item }">
73
+ <div
74
+ :style="{
75
+ width: '1em',
76
+ height: '1em',
77
+ borderRadius: '50%',
78
+ backgroundColor: item.color,
79
+ }"
80
+ />
81
+ </template>
82
+
83
+ <!-- color-header column header slot -->
84
+ <template #color-header>
85
+ <div
86
+ :style="{
87
+ width: '1em',
88
+ height: '1em',
89
+ borderRadius: '50%',
90
+ background: 'silver',
91
+ }"
92
+ />
93
+ </template>
94
+ </px-table>
95
+ </px-test>
96
+ <px-test test-id="px-validator" name="px-validator">
97
+ <px-flex vertical :style="{ maxWidth: '400px', margin: '0 auto' }" gap="1">
98
+ <span>Has errors: {{ !allValid }}</span>
99
+
100
+ <px-validator
101
+ :value="validateThree"
102
+ @valid-changed="onValidChanged"
103
+ :rules="{
104
+ apple: val => {
105
+ if (val !== 'apple') {
106
+ return 'Must be apple';
107
+ }
108
+ },
109
+ }"
110
+ >
111
+ <px-dropdown
112
+ v-model="validateThree"
113
+ tag="button"
114
+ trigger="click"
115
+ :items="fruits"
116
+ items-value-property="id"
117
+ items-label-property="name"
118
+ items-key-property="id"
119
+ placeholder="Select a fruit..."
120
+ ></px-dropdown>
121
+ </px-validator>
122
+
123
+ PHONE
124
+ <br />
125
+ <px-validator
126
+ :value="validateOne"
127
+ rules="required phone"
128
+ @valid-changed="onValidChanged"
129
+ >
130
+ <template #default="v">
131
+ <px-textbox
132
+ v-model="validateOne"
133
+ :class="[v.class, v.requiredClass, v.violationClasses]"
134
+ />
135
+ </template>
136
+ </px-validator>
137
+
138
+ <px-validator
139
+ :value="validateTwo"
140
+ rules="required"
141
+ @valid-changed="onValidChanged"
142
+ >
143
+ <template #default="v">
144
+ <px-textbox
145
+ v-model="validateTwo"
146
+ :class="[v.class, v.requiredClass, v.violationClasses]"
147
+ />
148
+ </template>
149
+ </px-validator>
150
+ </px-flex>
151
+ </px-test>
152
+
153
+ <px-test test-id="px-progress-circle" name="px-progress-circle">
154
+ <px-progress-circle
155
+ :progress="0.5"
156
+ :stroke-width="4"
157
+ style="width: 60px; color: black"
158
+ />
159
+ </px-test>
160
+
161
+ <px-test test-id="px-aspect" name="px-aspect">
162
+ <px-aspect :debug="true">
163
+ <div :style="{ backgroundColor: 'gold' }">
164
+ Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor.
165
+ Nullam id dolor id nibh ultricies vehicula ut id elit. Sed posuere
166
+ consectetur est at lobortis. Duis mollis, est non commodo luctus, nisi erat
167
+ porttitor ligula, eget lacinia odio sem nec elit. Vivamus sagittis lacus vel
168
+ augue laoreet rutrum faucibus dolor auctor. Nullam id dolor id nibh
169
+ ultricies vehicula ut id elit. Sed posuere consectetur est at lobortis. Duis
170
+ mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia
171
+ odio sem nec elit.
172
+ </div>
173
+
174
+ <img
175
+ :style="{ opacity: 0.5 }"
176
+ src="https://images.unsplash.com/photo-1650923500748-eee80ee6e7d1?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1920&q=80"
177
+ />
178
+ </px-aspect>
179
+ </px-test>
180
+
181
+ <px-test test-id="px-swiper-cards" name="Card Swiper">
182
+ <div>
183
+ <px-swiper>
184
+ <px-swiper-slide>
185
+ <px-card>This is some content</px-card>
186
+ </px-swiper-slide>
187
+ <px-swiper-slide>
188
+ <px-card>This is some content</px-card>
189
+ </px-swiper-slide>
190
+ <px-swiper-slide>
191
+ <px-card>This is some content</px-card>
192
+ </px-swiper-slide>
193
+ </px-swiper>
194
+ </div>
195
+
196
+ <!-- <px-swiper :loop="true">
197
+ <px-swiper-slide>
198
+ <div class="swiper-max-width">
199
+ <img
200
+ class="swiper-img"
201
+ src="https://picsum.photos/1600/900?grayscale"
202
+ />
203
+ </div>
204
+ </px-swiper-slide>
205
+ <px-swiper-slide>
206
+ <img class="swiper-img" src="https://picsum.photos/1601/900?grayscale" />
207
+ </px-swiper-slide>
208
+ <px-swiper-slide>
209
+ <img class="swiper-img" src="https://picsum.photos/1602/900?grayscale" />
210
+ </px-swiper-slide>
211
+ </px-swiper> -->
212
+ </px-test>
213
+
214
+ <px-test test-id="px-date-picker" name="px-date-picker">
215
+ <px-flex vertical align="center" gap="1">
216
+ <span>Selected Date: {{ currentDateNull }}</span>
217
+ <px-date-picker mode="textbox" v-model="currentDateNull" />
218
+ <px-date-picker mode="textbox" clock v-model="currentDateNull" />
219
+ <px-date-picker v-model="currentDateNull" />
220
+ <px-date-picker time v-model="currentDateNull" />
221
+ </px-flex>
222
+ </px-test>
223
+
224
+ <px-test test-id="px-clock" name="px-clock">
225
+ <px-clock v-model="currentDate" />
226
+ Selected Date: {{ currentDate }}
227
+ </px-test>
228
+
229
+ <px-test test-id="px-calendar" name="px-calendar">
230
+ <px-calendar v-model="currentDate" />
231
+ Selected Date: {{ currentDate }}
232
+ </px-test>
233
+
234
+ <px-test test-id="single-vs-multiple" name="Single vs Multiple Selection">
235
+ <px-flex align="center" gap="1">
236
+ <!-- dynamic select -->
237
+
238
+ <px-toggle-button-list
239
+ :multi-select="supportsMultiSelect"
240
+ :items="fruits"
241
+ items-key-property="id"
242
+ items-value-property="id"
243
+ items-label-property="name"
244
+ v-model="currentFruitOrFruits"
245
+ ></px-toggle-button-list>
246
+
247
+ <px-toggle v-model="supportsMultiSelect">Multi-select</px-toggle>
248
+ <span>{{ currentFruitOrFruits }}</span>
249
+ </px-flex>
250
+ </px-test>
251
+
252
+ <px-test test-id="px-textbox" name="px-textbox">
253
+ <px-flex :vertical="true" :gap="1">
254
+ <div>currentText: {{ currentText }}</div>
255
+
256
+ <px-textbox v-model="currentText" placeholder="Say what you want..." />
257
+
258
+ <px-textbox
259
+ multiline
260
+ v-model="currentText"
261
+ rows="5"
262
+ placeholder="Say it longer..."
263
+ />
264
+
265
+ <px-textbox type="password" />
266
+ <px-textbox :value="'hello@thinkpixellab.com'" type="email" />
267
+ </px-flex>
268
+ </px-test>
269
+
270
+ <px-test test-id="px-dropdown" name="px-dropdown">
271
+ <px-flex gap="1" align="center" justify="center">
272
+ <px-dropdown
273
+ v-model="currentFruit"
274
+ tag="button"
275
+ trigger="click"
276
+ :items="fruits"
277
+ items-value-property="id"
278
+ items-label-property="name"
279
+ items-key-property="id"
280
+ placeholder="Select a fruit..."
281
+ >
282
+ Button Label
283
+
284
+ <template #popup>
285
+ <div class="popup-menu">
286
+ <button>Menu Option 1</button>
287
+ <button>Menu Option 2</button>
288
+ </div>
289
+ </template>
290
+ </px-dropdown>
291
+ <span>{{ currentFruit }}</span>
292
+ </px-flex>
293
+ </px-test>
294
+
295
+ <px-test test-id="px-popup" name="px-popup">
296
+ <px-flex vertical gap="1" align="center">
297
+ <px-popup tag="button" trigger="click">
298
+ Click This Button
299
+
300
+ <template #popup>
301
+ <px-flex vertical class="popup-menu">
302
+ <button>Option 1</button>
303
+ <button>Option 2</button>
304
+ <button>Option 3</button>
305
+ <button>Option 4</button>
306
+ </px-flex>
307
+ </template>
308
+ </px-popup>
309
+
310
+ <px-popup tag="button" trigger="hover">
311
+ Hover Over This
312
+
313
+ <template #popup>
314
+ <px-flex vertical class="popup-menu">
315
+ <button>Option 1</button>
316
+ <button>Option 2</button>
317
+ <button>Option 3</button>
318
+ <button>Option 4</button>
319
+ </px-flex>
320
+ </template>
321
+ </px-popup>
322
+
323
+ <px-popup tag="button" trigger="contextmenu">
324
+ Context Menu
325
+
326
+ <template #popup>
327
+ <px-flex vertical class="popup-menu">
328
+ <button>Option 1</button>
329
+ <button>Option 2</button>
330
+ <button>Option 3</button>
331
+ <button>Option 4</button>
332
+ </px-flex>
333
+ </template>
334
+ </px-popup>
335
+ </px-flex>
336
+ </px-test>
337
+
338
+ <px-test test-id="px-swiper" name="px-swiper" :size="{ w: 1440 }">
339
+ <px-swiper :loop="true">
340
+ <px-swiper-slide>
341
+ <div class="swiper-max-width">
342
+ <img
343
+ class="swiper-img"
344
+ src="https://picsum.photos/1600/900?grayscale"
345
+ />
346
+ </div>
347
+ </px-swiper-slide>
348
+ <px-swiper-slide>
349
+ <img class="swiper-img" src="https://picsum.photos/1601/900?grayscale" />
350
+ </px-swiper-slide>
351
+ <px-swiper-slide>
352
+ <img class="swiper-img" src="https://picsum.photos/1602/900?grayscale" />
353
+ </px-swiper-slide>
354
+ </px-swiper>
355
+ </px-test>
356
+
357
+ <px-test test-id="px-icon-button" name="px-icon-button">
358
+ <px-flex gap="3" justify="center">
359
+ <px-icon-button :src="require('../assets/test/trash.svg')" />
360
+
361
+ <px-icon-button :src="require('../assets/test/trash.svg')" variant="basic" />
362
+ <px-icon-button
363
+ :src="require('../assets/test/trash.svg')"
364
+ variant="basic accent-hover"
365
+ />
366
+ <px-icon-button
367
+ :src="require('../assets/test/trash.svg')"
368
+ variant="default accent-hover"
369
+ />
370
+ <px-icon v-if="false" :src="require('../assets/test/trash.svg')" />
371
+ <px-svg v-if="false" :src="require('../assets/test/trash.svg')" />
372
+ </px-flex>
373
+ </px-test>
374
+
375
+ <px-test test-id="toggle-button-list" name="px-toggle-button-list">
376
+ <px-toggle-button-list
377
+ :items="fruits"
378
+ items-value-property="id"
379
+ items-label-property="name"
380
+ items-key-property="id"
381
+ />
382
+
383
+ <br />
384
+
385
+ <px-toggle-button-list
386
+ :items="fruits"
387
+ items-value-property="id"
388
+ items-label-property="name"
389
+ items-key-property="id"
390
+ :multi-select="true"
391
+ @change="toggleButtonChange"
392
+ />
393
+
394
+ <br />
395
+
396
+ <px-toggle-button-list
397
+ :items="fruits"
398
+ items-value-property="id"
399
+ items-label-property="name"
400
+ items-key-property="id"
401
+ variant="radio"
402
+ />
403
+
404
+ <br />
405
+
406
+ <px-toggle-button-list
407
+ :items="fruits"
408
+ items-value-property="id"
409
+ items-label-property="name"
410
+ items-key-property="id"
411
+ variant="vertical radio"
412
+ />
413
+
414
+ <br />
415
+
416
+ <px-toggle-button-list
417
+ :items="fruits"
418
+ items-value-property="id"
419
+ items-label-property="name"
420
+ items-key-property="id"
421
+ variant="default connected"
422
+ />
423
+
424
+ <br />
425
+
426
+ <px-toggle-button-list
427
+ :items="fruits"
428
+ items-value-property="id"
429
+ items-label-property="name"
430
+ items-key-property="id"
431
+ >
432
+ <template v-slot:item="{ item, checked }">
433
+ <span
434
+ :style="{
435
+ width: '0.5em',
436
+ height: '0.5em',
437
+ backgroundColor: item.color,
438
+ display: 'inline-block',
439
+ transform: checked ? 'scale(1.5)' : null,
440
+ }"
441
+ ></span>
442
+ {{ item.name }}
443
+ </template>
444
+ </px-toggle-button-list>
445
+
446
+ <br />
447
+
448
+ <px-toggle-button-list
449
+ :items="fruits"
450
+ items-value-property="id"
451
+ items-label-property="name"
452
+ items-key-property="id"
453
+ variant="outline"
454
+ />
455
+
456
+ <br />
457
+
458
+ <px-toggle-button-list
459
+ :items="fruits"
460
+ items-value-property="id"
461
+ items-label-property="name"
462
+ items-key-property="id"
463
+ variant="connected outline"
464
+ />
465
+
466
+ <br />
467
+
468
+ <div style="max-width: 400px">
469
+ <px-toggle-button-list
470
+ :items="fruits"
471
+ items-value-property="id"
472
+ items-label-property="name"
473
+ items-key-property="id"
474
+ variant="default wrap"
475
+ />
476
+ </div>
477
+
478
+ <br />
479
+
480
+ <px-toggle-button-list
481
+ :items="fruits"
482
+ items-value-property="id"
483
+ items-label-property="name"
484
+ items-key-property="id"
485
+ variant="tags wrap"
486
+ :multi-select="true"
487
+ />
488
+ </px-test>
489
+
490
+ <px-test test-id="px-flex" name="px-flex">
491
+ <px-flex gap="2" class="flex-test" justify="center">
492
+ <px-flex :vertical="true" class="flex-test" gap="1">
493
+ <div class="flex-item"></div>
494
+ <div class="flex-item flex-item--small"></div>
495
+ <div class="flex-item"></div>
496
+ </px-flex>
497
+
498
+ <px-flex :vertical="true" :reverse="true" class="flex-test" gap="1">
499
+ <div class="flex-item"></div>
500
+ <div class="flex-item flex-item--small"></div>
501
+ <div class="flex-item"></div>
502
+ </px-flex>
503
+
504
+ <px-flex align-y="center" :vertical="false" class="flex-test" gap="20px">
505
+ <div class="flex-item"></div>
506
+ <div class="flex-item flex-item--small"></div>
507
+ <div class="flex-item"></div>
508
+ </px-flex>
509
+
510
+ <px-flex class="flex-test" :reverse="true" gap="0.5">
511
+ <div class="flex-item"></div>
512
+ <div class="flex-item flex-item--small"></div>
513
+ <div class="flex-item"></div>
514
+ </px-flex>
515
+ </px-flex>
516
+ </px-test>
517
+
518
+ <px-test test-id="px-toggle" name="px-toggle">
519
+ <px-toggle>Test</px-toggle>
520
+ </px-test>
521
+
522
+ <px-test test-id="px-toggle-button" name="px-toggle">
523
+ <div>
524
+ <px-toggle-button>Test</px-toggle-button>
525
+ </div>
526
+ </px-test>
527
+ </px-tester>
528
+ </div>
529
+ </template>
530
+
531
+ <script>
532
+ // import { mapState } from 'vuex';
533
+ // import Component from '~/components/Component.vue';
534
+ import { PxTester, PxTest } from '@thinkpixellab/px-vue-tester';
535
+ import PxToggle from './PxToggle.vue';
536
+ import PxToggleButton from './PxToggleButton.vue';
537
+ import PxFlex from './PxFlex.vue';
538
+ import PxToggleButtonList from './PxToggleButtonList.vue';
539
+ import PxIconButton from './PxIconButton.vue';
540
+ import PxIcon from './PxIcon.vue';
541
+ import PxSvg from './PxSvg.vue';
542
+ import PxSwiper from './PxSwiper.vue';
543
+ import PxSwiperSlide from './PxSwiperSlide.vue';
544
+ import PxDropdown from './PxDropdown.vue';
545
+ import PxPopup from './PxPopup.vue';
546
+ import PxTextbox from './PxTextbox.vue';
547
+ import PxCalendar from './PxCalendar.vue';
548
+ import PxClock from './PxClock.vue';
549
+ import PxDatePicker from './PxDatePicker.vue';
550
+ import PxCard from './PxCard.vue';
551
+ import PxAspect from './PxAspect.vue';
552
+ import PxProgressCircle from './PxProgressCircle.vue';
553
+ import PxValidator from './PxValidator.vue';
554
+ import PxTable from './PxTable.vue';
555
+ import PxFit from './PxFit.vue';
556
+ import PxCardGrid from './PxCardGrid.vue';
557
+ import PxNineGrid from './PxNineGrid.vue';
558
+
559
+ export default {
560
+ name: 'px-vue-test',
561
+ components: {
562
+ PxTester,
563
+ PxTest,
564
+ PxToggle,
565
+ PxToggleButton,
566
+ PxFlex,
567
+ PxToggleButtonList,
568
+ PxIconButton,
569
+ PxIcon,
570
+ PxSvg,
571
+ PxSwiper,
572
+ PxSwiperSlide,
573
+ PxPopup,
574
+ PxDropdown,
575
+ PxTextbox,
576
+ PxCalendar,
577
+ PxClock,
578
+ PxDatePicker,
579
+ PxCard,
580
+ PxAspect,
581
+ PxProgressCircle,
582
+ PxValidator,
583
+ PxTable,
584
+ PxFit,
585
+ PxCardGrid,
586
+ PxNineGrid,
587
+ },
588
+
589
+ data() {
590
+ return {
591
+ validateOne: null,
592
+ validateTwo: null,
593
+ validateThree: null,
594
+ validation: {},
595
+
596
+ currentDate: new Date(),
597
+ currentDateNull: null,
598
+ supportsMultiSelect: false,
599
+ currentFruitOrFruits: null,
600
+ currentFruits: ['orange', 'apple'],
601
+ currentFruit: 'orange',
602
+ fruits: [
603
+ {
604
+ id: 'apple',
605
+ name: 'Apple',
606
+ color: 'red',
607
+ deliciousNess: 7,
608
+ description:
609
+ 'Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Etiam porta sem malesuada magna mollis euismod. Nulla vitae elit libero, a pharetra augue.',
610
+ lastPurchase: new Date('2022-03-01T00:00:00.000Z'),
611
+ },
612
+ {
613
+ id: 'orange',
614
+ name: 'Orange',
615
+ color: 'orange',
616
+ deliciousNess: 8,
617
+ description:
618
+ 'Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Etiam porta sem malesuada magna mollis euismod.',
619
+ lastPurchase: new Date('2022-02-01T00:00:00.000Z'),
620
+ },
621
+ {
622
+ id: 'lime',
623
+ name: 'Lime',
624
+ color: 'yellowgreen',
625
+ deliciousNess: 3,
626
+ description:
627
+ 'Donec sed odio dui. Nullam id dolor id nibh ultricies vehicula ut id elit.',
628
+ lastPurchase: new Date('2022-01-01T00:00:00.000Z'),
629
+ },
630
+ {
631
+ id: 'banana',
632
+ name: 'Banana',
633
+ color: 'gold',
634
+ deliciousNess: 7,
635
+ description: 'Donec id elit non mi porta gravida at eget metus.',
636
+ lastPurchase: new Date('2021-12-01T00:00:00.000Z'),
637
+ },
638
+ {
639
+ id: 'grape',
640
+ name: 'Grape',
641
+ color: 'purple',
642
+ deliciousNess: 5,
643
+ description:
644
+ 'Etiam porta sem malesuada magna mollis euismod. Morbi leo risus, porta ac consectetur ac, vestibulum at eros.',
645
+ lastPurchase: new Date('2021-11-01T00:00:00.000Z'),
646
+ },
647
+ {
648
+ id: 'strawberry',
649
+ name: 'Strawberry',
650
+ color: 'pink',
651
+ deliciousNess: 9,
652
+ description: 'Donec ullamcorper nulla non metus auctor fringilla.',
653
+ lastPurchase: new Date('2021-10-01T00:00:00.000Z'),
654
+ },
655
+ ],
656
+ currentText: 'Howdy',
657
+ };
658
+ },
659
+ computed: {
660
+ allValid() {
661
+ return Object.values(this.validation).reduce((acc, val) => {
662
+ return acc && val;
663
+ }, true);
664
+ },
665
+ },
666
+ methods: {
667
+ toggleButtonChange(nv) {
668
+ console.log(`selectedKeys: 👉 ${JSON.stringify(nv, null, 4)}`);
669
+ },
670
+ onValidChanged(isValid, id) {
671
+ this.$set(this.validation, id, isValid);
672
+ },
673
+ },
674
+ };
675
+ </script>
676
+
677
+ <style lang="scss">
678
+ @use '../styles/px.scss' as *;
679
+
680
+ .px-vue-test {
681
+ .fit {
682
+ white-space: nowrap;
683
+ color: black;
684
+ }
685
+
686
+ .fit--sm {
687
+ font-size: 12px;
688
+ color: red;
689
+ }
690
+
691
+ .fit--md {
692
+ font-size: 18px;
693
+ color: purple;
694
+ }
695
+
696
+ .fit--lg {
697
+ font-size: 24px;
698
+ color: blue;
699
+ }
700
+
701
+ .swiper-max-width {
702
+ max-width: 800px;
703
+ margin: 0 auto;
704
+ img {
705
+ width: 100%;
706
+ height: 100%;
707
+ object-fit: contain;
708
+ }
709
+ }
710
+ .swiper-img {
711
+ width: 100%;
712
+ font-size: 0;
713
+ display: block;
714
+ width: 100%;
715
+ height: 100%;
716
+ object-fit: contain;
717
+ }
718
+ .flex-item {
719
+ background-color: accent();
720
+ width: 80px;
721
+ height: 80px;
722
+ border-radius: 10px;
723
+ &--small {
724
+ width: 50px;
725
+ height: 50px;
726
+ }
727
+
728
+ &:nth-child(2) {
729
+ background-color: accent(2);
730
+ }
731
+ &:nth-child(3) {
732
+ background-color: accent(4);
733
+ }
734
+ }
735
+ .flex-test {
736
+ border: 2px dashed gray();
737
+ padding: 2px;
738
+ border-radius: 12px;
739
+ }
740
+
741
+ // custom toggle button variant
742
+ .px-toggle-button-list--tags {
743
+ .px-toggle-button-list__button {
744
+ @include button(
745
+ (
746
+ font-size: fs(xs),
747
+ background-color: #f6c268,
748
+ border-radius: 2px,
749
+ min-height: 2em,
750
+ min-width: 0,
751
+ padding: 0 0.5em,
752
+ checked: (
753
+ background-color: accent(-2),
754
+ color: white,
755
+ ),
756
+ )
757
+ );
758
+ }
759
+ }
760
+ }
761
+ </style>