@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.
- package/.eslintrc.js +14 -0
- package/.prettierrc.js +10 -0
- package/LICENSE.md +9 -0
- package/README.md +83 -0
- package/assets/feather/activity.svg +1 -0
- package/assets/feather/airplay.svg +1 -0
- package/assets/feather/alert-circle.svg +1 -0
- package/assets/feather/alert-octagon.svg +1 -0
- package/assets/feather/alert-triangle.svg +1 -0
- package/assets/feather/align-center.svg +1 -0
- package/assets/feather/align-justify.svg +1 -0
- package/assets/feather/align-left.svg +1 -0
- package/assets/feather/align-right.svg +1 -0
- package/assets/feather/anchor.svg +1 -0
- package/assets/feather/aperture.svg +1 -0
- package/assets/feather/archive.svg +1 -0
- package/assets/feather/arrow-down-circle.svg +1 -0
- package/assets/feather/arrow-down-left.svg +1 -0
- package/assets/feather/arrow-down-right.svg +1 -0
- package/assets/feather/arrow-down.svg +1 -0
- package/assets/feather/arrow-left-circle.svg +1 -0
- package/assets/feather/arrow-left.svg +1 -0
- package/assets/feather/arrow-right-circle.svg +1 -0
- package/assets/feather/arrow-right.svg +1 -0
- package/assets/feather/arrow-up-circle.svg +1 -0
- package/assets/feather/arrow-up-left.svg +1 -0
- package/assets/feather/arrow-up-right.svg +1 -0
- package/assets/feather/arrow-up.svg +1 -0
- package/assets/feather/at-sign.svg +1 -0
- package/assets/feather/award.svg +1 -0
- package/assets/feather/bar-chart-2.svg +1 -0
- package/assets/feather/bar-chart.svg +1 -0
- package/assets/feather/battery-charging.svg +1 -0
- package/assets/feather/battery.svg +1 -0
- package/assets/feather/bell-off.svg +1 -0
- package/assets/feather/bell.svg +1 -0
- package/assets/feather/bluetooth.svg +1 -0
- package/assets/feather/bold.svg +1 -0
- package/assets/feather/book-open.svg +1 -0
- package/assets/feather/book.svg +1 -0
- package/assets/feather/bookmark.svg +1 -0
- package/assets/feather/box.svg +1 -0
- package/assets/feather/briefcase.svg +1 -0
- package/assets/feather/calendar.svg +1 -0
- package/assets/feather/camera-off.svg +1 -0
- package/assets/feather/camera.svg +1 -0
- package/assets/feather/cast.svg +1 -0
- package/assets/feather/check-circle.svg +1 -0
- package/assets/feather/check-square.svg +1 -0
- package/assets/feather/check.svg +1 -0
- package/assets/feather/chevron-down.svg +1 -0
- package/assets/feather/chevron-left.svg +1 -0
- package/assets/feather/chevron-right.svg +1 -0
- package/assets/feather/chevron-up.svg +1 -0
- package/assets/feather/chevrons-down.svg +1 -0
- package/assets/feather/chevrons-left.svg +1 -0
- package/assets/feather/chevrons-right.svg +1 -0
- package/assets/feather/chevrons-up.svg +1 -0
- package/assets/feather/chrome.svg +1 -0
- package/assets/feather/circle.svg +1 -0
- package/assets/feather/clipboard.svg +1 -0
- package/assets/feather/clock.svg +1 -0
- package/assets/feather/cloud-drizzle.svg +1 -0
- package/assets/feather/cloud-lightning.svg +1 -0
- package/assets/feather/cloud-off.svg +1 -0
- package/assets/feather/cloud-rain.svg +1 -0
- package/assets/feather/cloud-snow.svg +1 -0
- package/assets/feather/cloud.svg +1 -0
- package/assets/feather/code.svg +1 -0
- package/assets/feather/codepen.svg +1 -0
- package/assets/feather/codesandbox.svg +1 -0
- package/assets/feather/coffee.svg +1 -0
- package/assets/feather/columns.svg +1 -0
- package/assets/feather/command.svg +1 -0
- package/assets/feather/compass.svg +1 -0
- package/assets/feather/copy.svg +1 -0
- package/assets/feather/corner-down-left.svg +1 -0
- package/assets/feather/corner-down-right.svg +1 -0
- package/assets/feather/corner-left-down.svg +1 -0
- package/assets/feather/corner-left-up.svg +1 -0
- package/assets/feather/corner-right-down.svg +1 -0
- package/assets/feather/corner-right-up.svg +1 -0
- package/assets/feather/corner-up-left.svg +1 -0
- package/assets/feather/corner-up-right.svg +1 -0
- package/assets/feather/cpu.svg +1 -0
- package/assets/feather/credit-card.svg +1 -0
- package/assets/feather/crop.svg +1 -0
- package/assets/feather/crosshair.svg +1 -0
- package/assets/feather/database.svg +1 -0
- package/assets/feather/delete.svg +1 -0
- package/assets/feather/disc.svg +1 -0
- package/assets/feather/divide-circle.svg +1 -0
- package/assets/feather/divide-square.svg +1 -0
- package/assets/feather/divide.svg +1 -0
- package/assets/feather/dollar-sign.svg +1 -0
- package/assets/feather/download-cloud.svg +1 -0
- package/assets/feather/download.svg +1 -0
- package/assets/feather/dribbble.svg +1 -0
- package/assets/feather/droplet.svg +1 -0
- package/assets/feather/edit-2.svg +1 -0
- package/assets/feather/edit-3.svg +1 -0
- package/assets/feather/edit.svg +1 -0
- package/assets/feather/external-link.svg +1 -0
- package/assets/feather/eye-off.svg +1 -0
- package/assets/feather/eye.svg +1 -0
- package/assets/feather/facebook.svg +1 -0
- package/assets/feather/fast-forward.svg +1 -0
- package/assets/feather/feather.svg +1 -0
- package/assets/feather/figma.svg +1 -0
- package/assets/feather/file-minus.svg +1 -0
- package/assets/feather/file-plus.svg +1 -0
- package/assets/feather/file-text.svg +1 -0
- package/assets/feather/file.svg +1 -0
- package/assets/feather/film.svg +1 -0
- package/assets/feather/filter.svg +1 -0
- package/assets/feather/flag.svg +1 -0
- package/assets/feather/folder-minus.svg +1 -0
- package/assets/feather/folder-plus.svg +1 -0
- package/assets/feather/folder.svg +1 -0
- package/assets/feather/framer.svg +1 -0
- package/assets/feather/frown.svg +1 -0
- package/assets/feather/gift.svg +1 -0
- package/assets/feather/git-branch.svg +1 -0
- package/assets/feather/git-commit.svg +1 -0
- package/assets/feather/git-merge.svg +1 -0
- package/assets/feather/git-pull-request.svg +1 -0
- package/assets/feather/github.svg +1 -0
- package/assets/feather/gitlab.svg +1 -0
- package/assets/feather/globe.svg +1 -0
- package/assets/feather/grid.svg +1 -0
- package/assets/feather/hard-drive.svg +1 -0
- package/assets/feather/hash.svg +1 -0
- package/assets/feather/headphones.svg +1 -0
- package/assets/feather/heart.svg +1 -0
- package/assets/feather/help-circle.svg +1 -0
- package/assets/feather/hexagon.svg +1 -0
- package/assets/feather/home.svg +1 -0
- package/assets/feather/image.svg +1 -0
- package/assets/feather/inbox.svg +1 -0
- package/assets/feather/info.svg +1 -0
- package/assets/feather/instagram.svg +1 -0
- package/assets/feather/italic.svg +1 -0
- package/assets/feather/key.svg +1 -0
- package/assets/feather/layers.svg +1 -0
- package/assets/feather/layout.svg +1 -0
- package/assets/feather/life-buoy.svg +1 -0
- package/assets/feather/link-2.svg +1 -0
- package/assets/feather/link.svg +1 -0
- package/assets/feather/linkedin.svg +1 -0
- package/assets/feather/list.svg +1 -0
- package/assets/feather/loader.svg +1 -0
- package/assets/feather/lock.svg +1 -0
- package/assets/feather/log-in.svg +1 -0
- package/assets/feather/log-out.svg +1 -0
- package/assets/feather/mail.svg +1 -0
- package/assets/feather/map-pin.svg +1 -0
- package/assets/feather/map.svg +1 -0
- package/assets/feather/maximize-2.svg +1 -0
- package/assets/feather/maximize.svg +1 -0
- package/assets/feather/meh.svg +1 -0
- package/assets/feather/menu.svg +1 -0
- package/assets/feather/message-circle.svg +1 -0
- package/assets/feather/message-square.svg +1 -0
- package/assets/feather/mic-off.svg +1 -0
- package/assets/feather/mic.svg +1 -0
- package/assets/feather/minimize-2.svg +1 -0
- package/assets/feather/minimize.svg +1 -0
- package/assets/feather/minus-circle.svg +1 -0
- package/assets/feather/minus-square.svg +1 -0
- package/assets/feather/minus.svg +1 -0
- package/assets/feather/monitor.svg +1 -0
- package/assets/feather/moon.svg +1 -0
- package/assets/feather/more-horizontal.svg +1 -0
- package/assets/feather/more-vertical.svg +1 -0
- package/assets/feather/mouse-pointer.svg +1 -0
- package/assets/feather/move.svg +1 -0
- package/assets/feather/music.svg +1 -0
- package/assets/feather/navigation-2.svg +1 -0
- package/assets/feather/navigation.svg +1 -0
- package/assets/feather/octagon.svg +1 -0
- package/assets/feather/package.svg +1 -0
- package/assets/feather/paperclip.svg +1 -0
- package/assets/feather/pause-circle.svg +1 -0
- package/assets/feather/pause.svg +1 -0
- package/assets/feather/pen-tool.svg +1 -0
- package/assets/feather/percent.svg +1 -0
- package/assets/feather/phone-call.svg +1 -0
- package/assets/feather/phone-forwarded.svg +1 -0
- package/assets/feather/phone-incoming.svg +1 -0
- package/assets/feather/phone-missed.svg +1 -0
- package/assets/feather/phone-off.svg +1 -0
- package/assets/feather/phone-outgoing.svg +1 -0
- package/assets/feather/phone.svg +1 -0
- package/assets/feather/pie-chart.svg +1 -0
- package/assets/feather/play-circle.svg +1 -0
- package/assets/feather/play.svg +1 -0
- package/assets/feather/plus-circle.svg +1 -0
- package/assets/feather/plus-square.svg +1 -0
- package/assets/feather/plus.svg +1 -0
- package/assets/feather/pocket.svg +1 -0
- package/assets/feather/power.svg +1 -0
- package/assets/feather/printer.svg +1 -0
- package/assets/feather/radio.svg +1 -0
- package/assets/feather/refresh-ccw.svg +1 -0
- package/assets/feather/refresh-cw.svg +1 -0
- package/assets/feather/repeat.svg +1 -0
- package/assets/feather/rewind.svg +1 -0
- package/assets/feather/rotate-ccw.svg +1 -0
- package/assets/feather/rotate-cw.svg +1 -0
- package/assets/feather/rss.svg +1 -0
- package/assets/feather/save.svg +1 -0
- package/assets/feather/scissors.svg +1 -0
- package/assets/feather/search.svg +1 -0
- package/assets/feather/send.svg +1 -0
- package/assets/feather/server.svg +1 -0
- package/assets/feather/settings.svg +1 -0
- package/assets/feather/share-2.svg +1 -0
- package/assets/feather/share.svg +1 -0
- package/assets/feather/shield-off.svg +1 -0
- package/assets/feather/shield.svg +1 -0
- package/assets/feather/shopping-bag.svg +1 -0
- package/assets/feather/shopping-cart.svg +1 -0
- package/assets/feather/shuffle.svg +1 -0
- package/assets/feather/sidebar.svg +1 -0
- package/assets/feather/skip-back.svg +1 -0
- package/assets/feather/skip-forward.svg +1 -0
- package/assets/feather/slack.svg +1 -0
- package/assets/feather/slash.svg +1 -0
- package/assets/feather/sliders.svg +1 -0
- package/assets/feather/smartphone.svg +1 -0
- package/assets/feather/smile.svg +1 -0
- package/assets/feather/speaker.svg +1 -0
- package/assets/feather/square.svg +1 -0
- package/assets/feather/star.svg +1 -0
- package/assets/feather/stop-circle.svg +1 -0
- package/assets/feather/sun.svg +1 -0
- package/assets/feather/sunrise.svg +1 -0
- package/assets/feather/sunset.svg +1 -0
- package/assets/feather/table.svg +1 -0
- package/assets/feather/tablet.svg +1 -0
- package/assets/feather/tag.svg +1 -0
- package/assets/feather/target.svg +1 -0
- package/assets/feather/terminal.svg +1 -0
- package/assets/feather/thermometer.svg +1 -0
- package/assets/feather/thumbs-down.svg +1 -0
- package/assets/feather/thumbs-up.svg +1 -0
- package/assets/feather/toggle-left.svg +1 -0
- package/assets/feather/toggle-right.svg +1 -0
- package/assets/feather/tool.svg +1 -0
- package/assets/feather/trash-2.svg +1 -0
- package/assets/feather/trash.svg +1 -0
- package/assets/feather/trello.svg +1 -0
- package/assets/feather/trending-down.svg +1 -0
- package/assets/feather/trending-up.svg +1 -0
- package/assets/feather/triangle.svg +1 -0
- package/assets/feather/truck.svg +1 -0
- package/assets/feather/tv.svg +1 -0
- package/assets/feather/twitch.svg +1 -0
- package/assets/feather/twitter.svg +1 -0
- package/assets/feather/type.svg +1 -0
- package/assets/feather/umbrella.svg +1 -0
- package/assets/feather/underline.svg +1 -0
- package/assets/feather/unlock.svg +1 -0
- package/assets/feather/upload-cloud.svg +1 -0
- package/assets/feather/upload.svg +1 -0
- package/assets/feather/user-check.svg +1 -0
- package/assets/feather/user-minus.svg +1 -0
- package/assets/feather/user-plus.svg +1 -0
- package/assets/feather/user-x.svg +1 -0
- package/assets/feather/user.svg +1 -0
- package/assets/feather/users.svg +1 -0
- package/assets/feather/video-off.svg +1 -0
- package/assets/feather/video.svg +1 -0
- package/assets/feather/voicemail.svg +1 -0
- package/assets/feather/volume-1.svg +1 -0
- package/assets/feather/volume-2.svg +1 -0
- package/assets/feather/volume-x.svg +1 -0
- package/assets/feather/volume.svg +1 -0
- package/assets/feather/watch.svg +1 -0
- package/assets/feather/wifi-off.svg +1 -0
- package/assets/feather/wifi.svg +1 -0
- package/assets/feather/wind.svg +1 -0
- package/assets/feather/x-circle.svg +1 -0
- package/assets/feather/x-octagon.svg +1 -0
- package/assets/feather/x-square.svg +1 -0
- package/assets/feather/x.svg +1 -0
- package/assets/feather/youtube.svg +1 -0
- package/assets/feather/zap-off.svg +1 -0
- package/assets/feather/zap.svg +1 -0
- package/assets/feather/zoom-in.svg +1 -0
- package/assets/feather/zoom-out.svg +1 -0
- package/assets/icons/calendar.svg +6 -0
- package/assets/icons/check.svg +1 -0
- package/assets/icons/close-sm.svg +1 -0
- package/assets/icons/close.svg +1 -0
- package/assets/icons/copy.svg +1 -0
- package/assets/icons/dropdown.svg +8 -0
- package/assets/icons/invalid.svg +1 -0
- package/assets/icons/menu.svg +1 -0
- package/assets/icons/nav-next.svg +1 -0
- package/assets/icons/nav-prev.svg +1 -0
- package/assets/icons/sort-asc.svg +1 -0
- package/assets/icons/sort-desc.svg +1 -0
- package/assets/test/README.md +1 -0
- package/assets/test/trash.svg +8 -0
- package/babel.config.js +16 -0
- package/components/PxAspect.vue +127 -0
- package/components/PxAutoClamp.vue +75 -0
- package/components/PxBalancedText.vue +118 -0
- package/components/PxBase.vue +15 -0
- package/components/PxBaseDate.vue +27 -0
- package/components/PxBaseItems.vue +72 -0
- package/components/PxBaseItemsSelect.vue +230 -0
- package/components/PxBaseResize.vue +60 -0
- package/components/PxBaseToggle.vue +56 -0
- package/components/PxBaseVariants.vue +62 -0
- package/components/PxBaseVisible.vue +40 -0
- package/components/PxCalendar.vue +385 -0
- package/components/PxCard.vue +47 -0
- package/components/PxCardGrid.vue +386 -0
- package/components/PxClock.vue +510 -0
- package/components/PxCopyText.vue +78 -0
- package/components/PxDatePicker.vue +249 -0
- package/components/PxDropdown.vue +181 -0
- package/components/PxExpander.vue +46 -0
- package/components/PxFeatherIcon.vue +29 -0
- package/components/PxFeatherIconButton.vue +19 -0
- package/components/PxFit.vue +274 -0
- package/components/PxFlex.vue +93 -0
- package/components/PxFloat.vue +32 -0
- package/components/PxIcon.vue +43 -0
- package/components/PxIconButton.vue +115 -0
- package/components/PxIdUniquer.vue +59 -0
- package/components/PxModal.vue +365 -0
- package/components/PxNineGrid.vue +94 -0
- package/components/PxPivot.vue +207 -0
- package/components/PxPopup.vue +230 -0
- package/components/PxPortal.vue +138 -0
- package/components/PxPortalTarget.vue +25 -0
- package/components/PxProgressCircle.vue +73 -0
- package/components/PxRadioButton.vue +83 -0
- package/components/PxSideDrawer.vue +164 -0
- package/components/PxSlideTransition.vue +116 -0
- package/components/PxSlides.vue +217 -0
- package/components/PxStylesPreview.vue +129 -0
- package/components/PxSvg.vue +157 -0
- package/components/PxSwiper.vue +271 -0
- package/components/PxSwiperSlide.vue +42 -0
- package/components/PxSyncHeight.vue +137 -0
- package/components/PxTable.vue +323 -0
- package/components/PxTabs.vue +1 -0
- package/components/PxTextbox.vue +90 -0
- package/components/PxToggle.vue +125 -0
- package/components/PxToggleButton.vue +139 -0
- package/components/PxToggleButtonList.vue +131 -0
- package/components/PxTransitionExpand.vue +100 -0
- package/components/PxValidator.vue +431 -0
- package/components/PxVueTest.vue +761 -0
- package/components/README.md +0 -0
- package/dev/data/fruits.js +59 -0
- package/dev/data/random.js +13 -0
- package/dev/demos/Demo-PxBaseDrag.vue +94 -0
- package/dev/demos/Demo-PxCardGrid.vue +53 -0
- package/dev/demos/Demo-PxPivot.vue +58 -0
- package/dev/demos/Demo-PxSideDrawer.vue +72 -0
- package/dev/demos/Demo-PxSlideTransition.vue +86 -0
- package/dev/demos/Demo-PxSlides.vue +142 -0
- package/dev/demos/Demo-PxStylesPreview.vue +46 -0
- package/dev/demos/Demo-PxSwiper.vue +44 -0
- package/dev/demos/DemoPicker.vue +79 -0
- package/dev/dev.vue +56 -0
- package/dev/serve.js +17 -0
- package/package.json +45 -0
- package/plugins/common-client.js +13 -0
- package/plugins/common-lib.js +4 -0
- package/plugins/common.js +39 -0
- package/plugins/filters/aspect.js +14 -0
- package/plugins/filters/date.js +26 -0
- package/plugins/filters/kebab.js +9 -0
- package/plugins/filters/phone.js +7 -0
- package/plugins/filters/slug.js +26 -0
- package/plugins/filters/spacenator.js +11 -0
- package/plugins/filters/stringToItems.js +28 -0
- package/plugins/filters/striphtml.js +10 -0
- package/plugins/mixins/eventBus.js +23 -0
- package/px-styles.config.scss +12 -0
- package/styles/helpers.scss +14 -0
- package/styles/px.scss +6 -0
- package/utils/balanceText.js +123 -0
- package/utils/bem.js +99 -0
- package/utils/cardGrid.js +383 -0
- package/utils/cssStr.js +45 -0
- package/utils/drag.js +363 -0
- package/utils/fit.js +73 -0
- package/utils/tween.js +129 -0
- package/utils/utils.js +167 -0
- package/utils/variants.js +33 -0
- package/vue.config.js +12 -0
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
<px-side-drawer toggle-class="my-trigger" >
|
|
3
|
+
|
|
4
|
+
<template #toggle="{isMenuVisible}">
|
|
5
|
+
// this content will be placed in an otherwise invisible button
|
|
6
|
+
</template>
|
|
7
|
+
|
|
8
|
+
<template>
|
|
9
|
+
// this will be rendered into the drawer which is a basic styled container by default.
|
|
10
|
+
// For control over the drawer-class, set the drawer-class property.
|
|
11
|
+
</template>
|
|
12
|
+
|
|
13
|
+
</px-side-drawer>
|
|
14
|
+
-->
|
|
15
|
+
<template>
|
|
16
|
+
<div>
|
|
17
|
+
<px-toggle-button :class="toggleButtonClass" variant="icon" :checked.sync="visibleValue">
|
|
18
|
+
<px-icon :src="toggleIcon" />
|
|
19
|
+
</px-toggle-button>
|
|
20
|
+
|
|
21
|
+
<px-modal
|
|
22
|
+
:visible.sync="visibleValue"
|
|
23
|
+
:overlayClass="[bem('overlay-base'), overlayClass].join(' ')"
|
|
24
|
+
v-bind="modalProps"
|
|
25
|
+
transition-name="px-side-drawer__tr"
|
|
26
|
+
>
|
|
27
|
+
<div :class="bem()">
|
|
28
|
+
<div :class="drawerClass">
|
|
29
|
+
<div :class="bem('top')">
|
|
30
|
+
<div :class="bem('close')">
|
|
31
|
+
<button :class="closeButtonClass" @click="visibleValue = false">
|
|
32
|
+
<px-icon :src="closeIcon" />
|
|
33
|
+
</button>
|
|
34
|
+
</div>
|
|
35
|
+
<slot name="default" />
|
|
36
|
+
</div>
|
|
37
|
+
<div :class="bem('bottom')">
|
|
38
|
+
<slot name="bottom" />
|
|
39
|
+
</div>
|
|
40
|
+
</div>
|
|
41
|
+
</div>
|
|
42
|
+
</px-modal>
|
|
43
|
+
</div>
|
|
44
|
+
</template>
|
|
45
|
+
|
|
46
|
+
<script>
|
|
47
|
+
import PxBaseVisibleVue from './PxBaseVisible.vue';
|
|
48
|
+
import PxIcon from './PxIcon.vue';
|
|
49
|
+
import PxModal from './PxModal.vue';
|
|
50
|
+
import PxToggleButton from './PxToggleButton.vue';
|
|
51
|
+
|
|
52
|
+
// import { mapState } from 'vuex';
|
|
53
|
+
// import Component from '~/components/Component.vue';
|
|
54
|
+
// import Mixin from '~/components/Mixin.vue';
|
|
55
|
+
export default {
|
|
56
|
+
name: 'px-side-drawer',
|
|
57
|
+
components: { PxModal, PxToggleButton, PxIcon },
|
|
58
|
+
mixins: [PxBaseVisibleVue],
|
|
59
|
+
props: {
|
|
60
|
+
dockTo: { type: String, default: 'screen' }, // screen | parent
|
|
61
|
+
|
|
62
|
+
// default icon used for the toggle (only shown in default toggle slot)
|
|
63
|
+
toggleIcon: { type: String, default: require('../assets/icons/menu.svg') },
|
|
64
|
+
toggleIconSize: { default: null },
|
|
65
|
+
|
|
66
|
+
// icon shown in the drawer by default (set to null to hide)
|
|
67
|
+
closeIcon: { type: String, default: require('../assets/icons/close-sm.svg') },
|
|
68
|
+
closeIconSize: { default: null },
|
|
69
|
+
|
|
70
|
+
// custom classes
|
|
71
|
+
toggleButtonClass: { type: String, default: 'px-side-drawer__icon-button' },
|
|
72
|
+
closeButtonClass: { type: String, default: 'px-side-drawer__icon-button' },
|
|
73
|
+
overlayClass: { type: String, default: 'px-side-drawer__overlay' },
|
|
74
|
+
drawerClass: { type: String, default: 'px-side-drawer__drawer' },
|
|
75
|
+
|
|
76
|
+
// PxModal (see PxModal for details)
|
|
77
|
+
modalProps: { type: Object },
|
|
78
|
+
},
|
|
79
|
+
// data() { return { b: 0 }; },
|
|
80
|
+
// computed: {},
|
|
81
|
+
// watch: {},
|
|
82
|
+
// mounted() {},
|
|
83
|
+
// methods: {},
|
|
84
|
+
};
|
|
85
|
+
</script>
|
|
86
|
+
|
|
87
|
+
<style lang="scss">
|
|
88
|
+
@use '../styles/px.scss' as *;
|
|
89
|
+
|
|
90
|
+
// @include vue-transition-fade('px-side-drawer__tr', $dur: 3000ms);
|
|
91
|
+
|
|
92
|
+
$dur: 400ms;
|
|
93
|
+
|
|
94
|
+
@include vue-transition('px-side-drawer__tr') {
|
|
95
|
+
@include vt-transition {
|
|
96
|
+
@include transition(color, $dur: $dur);
|
|
97
|
+
.px-side-drawer__overlay-base {
|
|
98
|
+
@include transition(opacity, $dur: $dur);
|
|
99
|
+
}
|
|
100
|
+
.px-side-drawer__drawer {
|
|
101
|
+
@include transition(transform, $dur: $dur);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
@include vt-hidden() {
|
|
106
|
+
.px-side-drawer__overlay-base {
|
|
107
|
+
opacity: 0;
|
|
108
|
+
}
|
|
109
|
+
.px-side-drawer__drawer {
|
|
110
|
+
transform: translateX(100%);
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
.px-side-drawer {
|
|
116
|
+
position: fixed;
|
|
117
|
+
right: 0;
|
|
118
|
+
top: 0;
|
|
119
|
+
height: 100%;
|
|
120
|
+
min-width: 10px;
|
|
121
|
+
|
|
122
|
+
&__overlay {
|
|
123
|
+
background-color: clr(accent, -6, 0.2);
|
|
124
|
+
backdrop-filter: blur(10px);
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
&__drawer,
|
|
128
|
+
&__top,
|
|
129
|
+
&__bottom {
|
|
130
|
+
display: flex;
|
|
131
|
+
flex-direction: column;
|
|
132
|
+
align-items: stretch;
|
|
133
|
+
gap: 1em;
|
|
134
|
+
> section {
|
|
135
|
+
display: flex;
|
|
136
|
+
flex-direction: column;
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
&__drawer {
|
|
141
|
+
justify-content: space-between;
|
|
142
|
+
width: 320px;
|
|
143
|
+
max-width: 100vw;
|
|
144
|
+
height: 100%;
|
|
145
|
+
background-color: clr(page-bg);
|
|
146
|
+
box-shadow: depth-shadow(15, 0.1);
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
&__close {
|
|
150
|
+
display: flex;
|
|
151
|
+
justify-content: flex-end;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
&__icon-button {
|
|
155
|
+
@include button-icon(
|
|
156
|
+
(
|
|
157
|
+
padding: 0.5em,
|
|
158
|
+
min-height: 0,
|
|
159
|
+
min-width: 0,
|
|
160
|
+
)
|
|
161
|
+
);
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
</style>
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
Handle transitions between slides in PxSlide. Uses a hybrid css/javascript transition where
|
|
3
|
+
fades are in css and the drag movement is done with gsap.
|
|
4
|
+
-->
|
|
5
|
+
<template>
|
|
6
|
+
<!--
|
|
7
|
+
before-enter
|
|
8
|
+
before-leave
|
|
9
|
+
before-appear
|
|
10
|
+
enter
|
|
11
|
+
leave
|
|
12
|
+
appear
|
|
13
|
+
after-enter
|
|
14
|
+
after-leave
|
|
15
|
+
after-appear
|
|
16
|
+
enter-cancelled
|
|
17
|
+
leave-cancelled (v-show only)
|
|
18
|
+
appear-cancelled
|
|
19
|
+
-->
|
|
20
|
+
|
|
21
|
+
<transition
|
|
22
|
+
@before-enter="beforeEnter"
|
|
23
|
+
@enter="enter"
|
|
24
|
+
@leave="leave"
|
|
25
|
+
v-on="$listeners"
|
|
26
|
+
name="px-slide-transition-fade"
|
|
27
|
+
>
|
|
28
|
+
<slot />
|
|
29
|
+
</transition>
|
|
30
|
+
</template>
|
|
31
|
+
|
|
32
|
+
<script>
|
|
33
|
+
import gsap from 'gsap';
|
|
34
|
+
|
|
35
|
+
export default {
|
|
36
|
+
name: 'px-slide-transition',
|
|
37
|
+
props: {
|
|
38
|
+
// selector used to find children of the element that should slide during the transition
|
|
39
|
+
dragSelector: { type: String, default: '[data-drag]' },
|
|
40
|
+
|
|
41
|
+
// if true, slide the parent element if no slideSelect children are found (false will result just fading)
|
|
42
|
+
dragElementFallback: { type: Boolean, default: true },
|
|
43
|
+
|
|
44
|
+
// 1 moves to the right, -1 moves to the left
|
|
45
|
+
direction: { type: Number, default: 1 },
|
|
46
|
+
// TODO rtlAdjust: {type: Boolean, default: false }
|
|
47
|
+
|
|
48
|
+
duration: { type: Number, default: 1 },
|
|
49
|
+
ease: { type: String, default: 'power3.out' },
|
|
50
|
+
slideAmount: { default: '40vw' },
|
|
51
|
+
},
|
|
52
|
+
computed: {
|
|
53
|
+
tweenShared() {
|
|
54
|
+
return {
|
|
55
|
+
duration: this.duration,
|
|
56
|
+
ease: this.ease,
|
|
57
|
+
};
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
methods: {
|
|
61
|
+
directionAmount(direction, addEquals = false) {
|
|
62
|
+
let dir;
|
|
63
|
+
if (addEquals) {
|
|
64
|
+
dir = direction < 0 ? '-=' : '+=';
|
|
65
|
+
} else {
|
|
66
|
+
dir = direction < 0 ? '-' : '';
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
return dir + this.slideAmount;
|
|
70
|
+
},
|
|
71
|
+
slideElements(element) {
|
|
72
|
+
if (!element) {
|
|
73
|
+
return [];
|
|
74
|
+
}
|
|
75
|
+
return element.querySelectorAll(this.dragSelector);
|
|
76
|
+
},
|
|
77
|
+
|
|
78
|
+
beforeEnter() {},
|
|
79
|
+
|
|
80
|
+
enter(element, done) {
|
|
81
|
+
let slideElements = this.slideElements(element);
|
|
82
|
+
if (slideElements?.length) {
|
|
83
|
+
// slide elements
|
|
84
|
+
gsap.fromTo(
|
|
85
|
+
slideElements,
|
|
86
|
+
//{ x: this.slideAmount * this.direction * -1 },
|
|
87
|
+
{ x: this.directionAmount(this.direction * -1) },
|
|
88
|
+
{ x: 0, ...this.tweenShared, onComplete: done }
|
|
89
|
+
);
|
|
90
|
+
}
|
|
91
|
+
},
|
|
92
|
+
leave(element, done) {
|
|
93
|
+
// slide elements
|
|
94
|
+
let slideElements = this.slideElements(element);
|
|
95
|
+
if (slideElements?.length) {
|
|
96
|
+
gsap.to(slideElements, {
|
|
97
|
+
x: this.directionAmount(this.direction, true),
|
|
98
|
+
...this.tweenShared,
|
|
99
|
+
onComplete: done,
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
},
|
|
103
|
+
},
|
|
104
|
+
};
|
|
105
|
+
</script>
|
|
106
|
+
|
|
107
|
+
<style lang="scss">
|
|
108
|
+
@use '../styles/helpers.scss' as *;
|
|
109
|
+
@use '../styles/px.scss' as *;
|
|
110
|
+
|
|
111
|
+
@include vue-transition-fade(px-slide-transition-fade, $dur: 1s);
|
|
112
|
+
|
|
113
|
+
.slide-transition {
|
|
114
|
+
// add styles here
|
|
115
|
+
}
|
|
116
|
+
</style>
|
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
Describe this component...
|
|
3
|
+
-->
|
|
4
|
+
<template>
|
|
5
|
+
<div :class="bem()">
|
|
6
|
+
<div
|
|
7
|
+
v-for="(item, index) in items"
|
|
8
|
+
:key="getItemKey(item)"
|
|
9
|
+
ref="slide"
|
|
10
|
+
:class="bem('slide-wrapper', { selected: isItemSelected(item) })"
|
|
11
|
+
>
|
|
12
|
+
<px-slide-transition
|
|
13
|
+
:direction="direction"
|
|
14
|
+
@before-leave="transitionStart"
|
|
15
|
+
@after-leave="transitionEnd"
|
|
16
|
+
@leave-cancelled="transitionEnd"
|
|
17
|
+
>
|
|
18
|
+
<div :class="bem('slide')" v-show="isItemSelected(item)">
|
|
19
|
+
<slot
|
|
20
|
+
name="slide"
|
|
21
|
+
:selected="isItemSelected(item)"
|
|
22
|
+
:item="item"
|
|
23
|
+
:index="index"
|
|
24
|
+
></slot>
|
|
25
|
+
</div>
|
|
26
|
+
</px-slide-transition>
|
|
27
|
+
</div>
|
|
28
|
+
</div>
|
|
29
|
+
</template>
|
|
30
|
+
|
|
31
|
+
<script>
|
|
32
|
+
import PxBaseItemsSelect from './PxBaseItemsSelect.vue';
|
|
33
|
+
import PxSlideTransition from './PxSlideTransition.vue';
|
|
34
|
+
import gsap from 'gsap';
|
|
35
|
+
import Drag from '../utils/drag.js';
|
|
36
|
+
|
|
37
|
+
export default {
|
|
38
|
+
name: 'px-slides',
|
|
39
|
+
mixins: [PxBaseItemsSelect],
|
|
40
|
+
components: { PxSlideTransition },
|
|
41
|
+
|
|
42
|
+
props: {
|
|
43
|
+
// whether drag interaction is enabled
|
|
44
|
+
dragEnabled: { type: Boolean, default: true },
|
|
45
|
+
|
|
46
|
+
// if true, slides loop to the first slide once last slide is reached
|
|
47
|
+
loop: { type: Boolean, default: true },
|
|
48
|
+
|
|
49
|
+
// selector used to find drag elements in the dom
|
|
50
|
+
dragSelector: { type: String, default: '[data-drag]' },
|
|
51
|
+
|
|
52
|
+
// exclude from drag
|
|
53
|
+
dragExcludeSelector: { type: String, default: 'input, button, [data-no-drag]' },
|
|
54
|
+
|
|
55
|
+
// override default
|
|
56
|
+
autoSelectFirst: { type: Boolean, default: true },
|
|
57
|
+
},
|
|
58
|
+
|
|
59
|
+
data() {
|
|
60
|
+
return {
|
|
61
|
+
direction: 1,
|
|
62
|
+
activeTransitions: 0,
|
|
63
|
+
};
|
|
64
|
+
},
|
|
65
|
+
computed: {},
|
|
66
|
+
watch: {
|
|
67
|
+
syncSelected(nv, ov) {
|
|
68
|
+
let newIndex = this.itemKeys.indexOf(nv);
|
|
69
|
+
let oldIndex = this.itemKeys.indexOf(ov);
|
|
70
|
+
|
|
71
|
+
this.$emit('slide-change', {
|
|
72
|
+
key: nv,
|
|
73
|
+
oldKey: ov,
|
|
74
|
+
index: newIndex,
|
|
75
|
+
previousIndex: oldIndex,
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
newIndex = this.selectedRelativeIndex(newIndex);
|
|
79
|
+
oldIndex = this.selectedRelativeIndex(oldIndex);
|
|
80
|
+
|
|
81
|
+
this.direction = oldIndex > newIndex ? 1 : -1;
|
|
82
|
+
},
|
|
83
|
+
dragEnabled(nv) {
|
|
84
|
+
if (!this.drag) {
|
|
85
|
+
return;
|
|
86
|
+
}
|
|
87
|
+
if (!nv) {
|
|
88
|
+
this.drag.disable();
|
|
89
|
+
} else {
|
|
90
|
+
this.drag.enable();
|
|
91
|
+
}
|
|
92
|
+
},
|
|
93
|
+
},
|
|
94
|
+
mounted() {
|
|
95
|
+
this.drag = new Drag(this.$el, {
|
|
96
|
+
lock: 'x',
|
|
97
|
+
onStart: this.onDragStart,
|
|
98
|
+
onDrag: this.onDrag,
|
|
99
|
+
onEnd: this.onDragEnd,
|
|
100
|
+
excludeSelector: this.dragExcludeSelector,
|
|
101
|
+
disabled: !this.dragEnabled,
|
|
102
|
+
});
|
|
103
|
+
},
|
|
104
|
+
beforeDestroy() {
|
|
105
|
+
if (this.drag) {
|
|
106
|
+
this.drag.destroy();
|
|
107
|
+
}
|
|
108
|
+
},
|
|
109
|
+
methods: {
|
|
110
|
+
transitionStart() {
|
|
111
|
+
if (!this.activeTransitions) {
|
|
112
|
+
this.$emit('transitions-start');
|
|
113
|
+
}
|
|
114
|
+
this.activeTransitions++;
|
|
115
|
+
},
|
|
116
|
+
|
|
117
|
+
transitionEnd() {
|
|
118
|
+
this.activeTransitions--;
|
|
119
|
+
if (!this.activeTransitions) {
|
|
120
|
+
this.$emit('transitions-end', {
|
|
121
|
+
toIndex: this.itemKeys.indexOf(this.syncSelected),
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
},
|
|
125
|
+
|
|
126
|
+
onDragStart() {
|
|
127
|
+
// get drag elements
|
|
128
|
+
let slide = this.$refs.slide[this.selectedIndex];
|
|
129
|
+
|
|
130
|
+
if (slide) {
|
|
131
|
+
this.dragElements = [...slide.querySelectorAll(this.dragSelector)];
|
|
132
|
+
}
|
|
133
|
+
},
|
|
134
|
+
|
|
135
|
+
onDrag(ev) {
|
|
136
|
+
if (this.dragElements?.length) {
|
|
137
|
+
if (gsap.isTweening(this.dragElements[0])) {
|
|
138
|
+
gsap.killTweensOf(this.dragElements);
|
|
139
|
+
}
|
|
140
|
+
gsap.set(this.dragElements, { x: ev.startDelta.x });
|
|
141
|
+
}
|
|
142
|
+
},
|
|
143
|
+
|
|
144
|
+
onDragEnd(ev) {
|
|
145
|
+
if (Math.abs(ev.delta.x) < 10) {
|
|
146
|
+
gsap.to(this.dragElements, { x: 0 });
|
|
147
|
+
} else {
|
|
148
|
+
if (ev.delta.x > 0) {
|
|
149
|
+
this.previous();
|
|
150
|
+
} else {
|
|
151
|
+
this.next();
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
},
|
|
155
|
+
|
|
156
|
+
next() {
|
|
157
|
+
this.selectOffsetSafe(1, this.loop);
|
|
158
|
+
},
|
|
159
|
+
|
|
160
|
+
previous() {
|
|
161
|
+
this.selectOffsetSafe(-1, this.loop);
|
|
162
|
+
},
|
|
163
|
+
|
|
164
|
+
// returns the index of the item relative to the selected item, if looped
|
|
165
|
+
// then half of the items will be before and half after
|
|
166
|
+
selectedRelativeIndex(idx) {
|
|
167
|
+
if (this.selectedIndex == -1) {
|
|
168
|
+
return 0;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
idx = idx - this.selectedIndex;
|
|
172
|
+
|
|
173
|
+
if (this.loop) {
|
|
174
|
+
let half = Math.floor(this.items.length / 2);
|
|
175
|
+
|
|
176
|
+
if (idx >= half) {
|
|
177
|
+
idx = idx - this.items.length;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
if (idx < -half) {
|
|
181
|
+
idx = idx + this.items.length;
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
return idx;
|
|
186
|
+
},
|
|
187
|
+
},
|
|
188
|
+
};
|
|
189
|
+
</script>
|
|
190
|
+
|
|
191
|
+
<style lang="scss">
|
|
192
|
+
@use '../styles/helpers.scss' as *;
|
|
193
|
+
@use '../styles/px.scss' as *;
|
|
194
|
+
|
|
195
|
+
.px-slides {
|
|
196
|
+
display: grid;
|
|
197
|
+
grid-template-columns: 100%;
|
|
198
|
+
grid-template-rows: 100%;
|
|
199
|
+
grid-template-areas: 'content';
|
|
200
|
+
-webkit-transform-style: preserve-3d;
|
|
201
|
+
|
|
202
|
+
&__slide-wrapper {
|
|
203
|
+
grid-area: content;
|
|
204
|
+
width: 100%;
|
|
205
|
+
height: 100%;
|
|
206
|
+
&--selected {
|
|
207
|
+
z-index: 1;
|
|
208
|
+
pointer-events: initial;
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
&__slide {
|
|
213
|
+
width: 100%;
|
|
214
|
+
height: 100%;
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
</style>
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
All in one component for previewing a px-styles configuration.
|
|
3
|
+
-->
|
|
4
|
+
<template>
|
|
5
|
+
<div :class="bem()">
|
|
6
|
+
<div :class="bem('section', { color: true })">
|
|
7
|
+
<h3 class="h3">Color</h3>
|
|
8
|
+
|
|
9
|
+
<div :class="bem('colors-list')">
|
|
10
|
+
<div :class="bem('color-item')" v-for="clr in paletteColors" :key="clr.name">
|
|
11
|
+
{{ clr.name }}: {{ clr.color }}
|
|
12
|
+
<div :class="bem('color', { color: clr.name })"></div>
|
|
13
|
+
|
|
14
|
+
<div :class="bem('color-shades')">
|
|
15
|
+
<div
|
|
16
|
+
v-for="i in 21"
|
|
17
|
+
:key="i"
|
|
18
|
+
:class="bem('color', { sm: true, color: `${clr.name}-${i - 11}` })"
|
|
19
|
+
></div>
|
|
20
|
+
</div>
|
|
21
|
+
</div>
|
|
22
|
+
</div>
|
|
23
|
+
</div>
|
|
24
|
+
</div>
|
|
25
|
+
</template>
|
|
26
|
+
|
|
27
|
+
<script>
|
|
28
|
+
// import { mapState } from 'vuex';
|
|
29
|
+
// import Component from '~/components/Component.vue';
|
|
30
|
+
// import Mixin from '~/components/Mixin.vue';
|
|
31
|
+
export default {
|
|
32
|
+
name: 'px-styles-preview',
|
|
33
|
+
// components: { Component },
|
|
34
|
+
// mixins: [ Mixin ],
|
|
35
|
+
// props: { a: { type: Boolean, default: false } },
|
|
36
|
+
data() {
|
|
37
|
+
return { config: null };
|
|
38
|
+
},
|
|
39
|
+
computed: {
|
|
40
|
+
paletteColors() {
|
|
41
|
+
if (!this.config?.colors) {
|
|
42
|
+
return [];
|
|
43
|
+
}
|
|
44
|
+
let f = Object.keys(this.config?.colors).filter(c => {
|
|
45
|
+
return ![
|
|
46
|
+
'contrast-dark',
|
|
47
|
+
'contrast-light',
|
|
48
|
+
'page-bg',
|
|
49
|
+
'page-fg',
|
|
50
|
+
'selection-bg',
|
|
51
|
+
'selection-fg',
|
|
52
|
+
].includes(c);
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
console.log(`f: 👉 ${JSON.stringify(f, null, 4)}`);
|
|
56
|
+
|
|
57
|
+
return f.map(colorName => {
|
|
58
|
+
return {
|
|
59
|
+
name: colorName,
|
|
60
|
+
color: this.config.colors[colorName],
|
|
61
|
+
};
|
|
62
|
+
});
|
|
63
|
+
},
|
|
64
|
+
},
|
|
65
|
+
// watch: {},
|
|
66
|
+
mounted() {
|
|
67
|
+
let configStr = getComputedStyle(this.$el)
|
|
68
|
+
.getPropertyValue('--px-styles-config')
|
|
69
|
+
.trim()
|
|
70
|
+
.slice(1, -1);
|
|
71
|
+
|
|
72
|
+
try {
|
|
73
|
+
this.config = JSON.parse(configStr);
|
|
74
|
+
} catch {
|
|
75
|
+
console.error('Could not parse px-styles config string.');
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
console.log(configStr);
|
|
79
|
+
},
|
|
80
|
+
// methods: {},
|
|
81
|
+
};
|
|
82
|
+
</script>
|
|
83
|
+
|
|
84
|
+
<style lang="scss">
|
|
85
|
+
@use '../styles/px.scss' as *;
|
|
86
|
+
|
|
87
|
+
.px-styles-preview {
|
|
88
|
+
$config-json: encode(get-config-map());
|
|
89
|
+
--px-styles-config: (#{$config-json});
|
|
90
|
+
|
|
91
|
+
&__section {
|
|
92
|
+
margin: 0 auto;
|
|
93
|
+
width: 90vw;
|
|
94
|
+
max-width: 1200px;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
&__color-item {
|
|
98
|
+
width: 100%;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
&__color {
|
|
102
|
+
height: 60px;
|
|
103
|
+
width: 100%;
|
|
104
|
+
border-radius: 4px;
|
|
105
|
+
|
|
106
|
+
&--sm {
|
|
107
|
+
width: 24px;
|
|
108
|
+
height: 24px;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
@each $name, $color in get(colors) {
|
|
112
|
+
&--color-#{$name} {
|
|
113
|
+
background-color: clr($name);
|
|
114
|
+
}
|
|
115
|
+
@for $i from -10 to 10 {
|
|
116
|
+
&--color-#{$name}-#{$i} {
|
|
117
|
+
background-color: clr($name, $i);
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
&__color-shades {
|
|
124
|
+
margin-top: 1px;
|
|
125
|
+
display: flex;
|
|
126
|
+
gap: 1px;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
</style>
|