@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,385 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
Usage:
|
|
3
|
+
<px-calendar :date.sync="mydate" />
|
|
4
|
+
or
|
|
5
|
+
<px-calendar date="02/15/2020" @datechanged="onDateChange" />
|
|
6
|
+
|
|
7
|
+
This component always displays as a calendar. If you want to couple with a text input,
|
|
8
|
+
you can do that pretty easily on your own or else use DateTimePicker which couples this
|
|
9
|
+
with an input and a popup.
|
|
10
|
+
|
|
11
|
+
-->
|
|
12
|
+
|
|
13
|
+
<template>
|
|
14
|
+
<div
|
|
15
|
+
:class="bem()"
|
|
16
|
+
ref="calendar"
|
|
17
|
+
:style="{ height: this.fixedHeight ? this.fixedHeight + 'px' : 'auto' }"
|
|
18
|
+
></div>
|
|
19
|
+
</template>
|
|
20
|
+
|
|
21
|
+
<script>
|
|
22
|
+
import PxBaseDate from './PxBaseDate.vue';
|
|
23
|
+
import PxBase from './PxBase.vue';
|
|
24
|
+
|
|
25
|
+
const compareDates = function (a, b) {
|
|
26
|
+
if (a && b && a.getTime && b.getTime) {
|
|
27
|
+
return a.getTime() === b.getTime();
|
|
28
|
+
} else {
|
|
29
|
+
return a === b;
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
export default {
|
|
34
|
+
mixins: [PxBase, PxBaseDate],
|
|
35
|
+
props: {
|
|
36
|
+
minDate: { type: String, default: null },
|
|
37
|
+
maxDate: { type: String, default: null },
|
|
38
|
+
},
|
|
39
|
+
data() {
|
|
40
|
+
return {
|
|
41
|
+
fixedHeight: null,
|
|
42
|
+
};
|
|
43
|
+
},
|
|
44
|
+
mounted: function () {
|
|
45
|
+
// has a dependency on window, so needs to be loaded here
|
|
46
|
+
const TinyDatePicker = require('tiny-date-picker');
|
|
47
|
+
|
|
48
|
+
// create the calendar
|
|
49
|
+
this.calendar = TinyDatePicker(this.$refs.calendar, {
|
|
50
|
+
mode: 'dp-permanent',
|
|
51
|
+
min: this.minDate,
|
|
52
|
+
max: this.maxDate,
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
// set the initial date
|
|
56
|
+
if (this.date) {
|
|
57
|
+
this.setCalendarDate(this.date);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
// handle date changes
|
|
61
|
+
this.calendar.on('select', () => {
|
|
62
|
+
this.dateValue = this.getCalendarDate();
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
// fix the height when we show the year/month picker
|
|
66
|
+
this.calendar.on('statechange', () => {
|
|
67
|
+
this.fixedHeight =
|
|
68
|
+
this.calendar.state.view === 'month' || this.calendar.state.view === 'year'
|
|
69
|
+
? this.$refs.calendar.offsetHeight
|
|
70
|
+
: null;
|
|
71
|
+
});
|
|
72
|
+
},
|
|
73
|
+
|
|
74
|
+
watch: {
|
|
75
|
+
dateValue(nv) {
|
|
76
|
+
this.setCalendarDate(nv);
|
|
77
|
+
},
|
|
78
|
+
},
|
|
79
|
+
|
|
80
|
+
methods: {
|
|
81
|
+
getCalendarDate() {
|
|
82
|
+
return this.calendar.state.selectedDate;
|
|
83
|
+
},
|
|
84
|
+
|
|
85
|
+
setCalendarDate(d) {
|
|
86
|
+
if (this.calendar) {
|
|
87
|
+
if (!compareDates(this.calendar.state.selectedDate, d)) {
|
|
88
|
+
this.calendar.setState({
|
|
89
|
+
selectedDate: d,
|
|
90
|
+
highlightedDate: d,
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
},
|
|
95
|
+
},
|
|
96
|
+
};
|
|
97
|
+
</script>
|
|
98
|
+
|
|
99
|
+
<style lang="scss">
|
|
100
|
+
@use 'sass:math';
|
|
101
|
+
@use '../styles/px.scss' as *;
|
|
102
|
+
|
|
103
|
+
.px-calendar {
|
|
104
|
+
$dp-day-size: sp(3);
|
|
105
|
+
$dp-day-radius: 3px; // 50%
|
|
106
|
+
$dp-button-radius: 3px;
|
|
107
|
+
$dp-fg: clr(page-fg);
|
|
108
|
+
$dp-fg-subtle: clr(page-fg, $alpha: 0.4);
|
|
109
|
+
$dp-bg: white;
|
|
110
|
+
$dp-selection-bg: accent();
|
|
111
|
+
$dp-hover-bg: rgba(accent(), 0.1);
|
|
112
|
+
$dp-hover-fg: accent();
|
|
113
|
+
$dp-today-bg: rgba(accent(), 0.33);
|
|
114
|
+
$dp-today-fg: clr(page-fg);
|
|
115
|
+
$dp-link-fg: accent();
|
|
116
|
+
$dp-link-hover-fg: accent();
|
|
117
|
+
|
|
118
|
+
width: ($dp-day-size * 7) + sp(2);
|
|
119
|
+
|
|
120
|
+
.dp {
|
|
121
|
+
width: 100%;
|
|
122
|
+
height: 100%;
|
|
123
|
+
font-size: fs(base);
|
|
124
|
+
position: relative;
|
|
125
|
+
background: $dp-bg;
|
|
126
|
+
padding: sp(1);
|
|
127
|
+
box-sizing: border-box;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
.dp-permanent {
|
|
131
|
+
position: relative;
|
|
132
|
+
height: 100%;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
.dp-cal-month,
|
|
136
|
+
.dp-cal-year,
|
|
137
|
+
.dp-day,
|
|
138
|
+
.dp-month,
|
|
139
|
+
.dp-year {
|
|
140
|
+
box-sizing: border-box;
|
|
141
|
+
text-align: center;
|
|
142
|
+
text-decoration: none;
|
|
143
|
+
position: relative;
|
|
144
|
+
border-radius: $dp-button-radius;
|
|
145
|
+
border: 0;
|
|
146
|
+
background: transparent;
|
|
147
|
+
cursor: pointer;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
.dp-cal-header {
|
|
151
|
+
position: relative;
|
|
152
|
+
display: flex;
|
|
153
|
+
//height: $dp-day-size * 1.25;
|
|
154
|
+
align-items: center;
|
|
155
|
+
margin-bottom: sp(1);
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
.dp-cal-month,
|
|
159
|
+
.dp-cal-year {
|
|
160
|
+
//font-size: fs(md);
|
|
161
|
+
font-size: 1.1em;
|
|
162
|
+
height: sp(2.5);
|
|
163
|
+
padding: 0 0.2em;
|
|
164
|
+
|
|
165
|
+
// padding: 16px 8px 8px;
|
|
166
|
+
// outline: none;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
.dp-cal-month {
|
|
170
|
+
font-weight: 700;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
.dp-next,
|
|
174
|
+
.dp-prev {
|
|
175
|
+
@include control-reset();
|
|
176
|
+
background-color: transparent;
|
|
177
|
+
background-repeat: no-repeat;
|
|
178
|
+
background-position: center;
|
|
179
|
+
top: 0;
|
|
180
|
+
position: absolute;
|
|
181
|
+
width: $dp-day-size;
|
|
182
|
+
height: $dp-day-size;
|
|
183
|
+
left: auto;
|
|
184
|
+
text-indent: -9999px;
|
|
185
|
+
border-radius: $dp-button-radius;
|
|
186
|
+
cursor: pointer;
|
|
187
|
+
&:hover {
|
|
188
|
+
background-color: transparent;
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
.dp-next {
|
|
193
|
+
right: 0;
|
|
194
|
+
background-image: inline-svg(
|
|
195
|
+
'<svg width="8px" height="14px" viewBox="0 0 8 14" version="1.1" xmlns="http://www.w3.org/2000/svg" ><polyline stroke="stroke-value" fill="none" fill-rule="evenodd" stroke-width="2" points="1 1 7 7 1 13" stroke-linecap="round" stroke-linejoin="round"></polyline></svg>',
|
|
196
|
+
(
|
|
197
|
+
stroke-value: $dp-fg,
|
|
198
|
+
)
|
|
199
|
+
);
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
.dp-prev {
|
|
203
|
+
right: $dp-day-size;
|
|
204
|
+
background-image: inline-svg(
|
|
205
|
+
'<svg width="8px" height="14px" viewBox="0 0 8 14" version="1.1" xmlns="http://www.w3.org/2000/svg" ><polyline stroke="stroke-value" fill="none" fill-rule="evenodd" stroke-width="2" points="7 1 1 7 7 13" stroke-linecap="round" stroke-linejoin="round"></polyline></svg>',
|
|
206
|
+
(
|
|
207
|
+
stroke-value: $dp-fg,
|
|
208
|
+
)
|
|
209
|
+
);
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
.dp-day-today {
|
|
213
|
+
border-radius: $dp-day-radius;
|
|
214
|
+
background-image: linear-gradient(
|
|
215
|
+
135deg,
|
|
216
|
+
transparent 37.5%,
|
|
217
|
+
$dp-today-bg 37.5%,
|
|
218
|
+
$dp-today-bg 50%,
|
|
219
|
+
transparent 50%,
|
|
220
|
+
transparent 87.5%,
|
|
221
|
+
$dp-today-bg 87.5%,
|
|
222
|
+
$dp-today-bg 100%
|
|
223
|
+
);
|
|
224
|
+
background-size: 5.66px 5.66px;
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
.dp-cal-footer {
|
|
228
|
+
display: flex;
|
|
229
|
+
justify-content: center;
|
|
230
|
+
margin-top: sp(0.5);
|
|
231
|
+
button {
|
|
232
|
+
font-size: 0.66em;
|
|
233
|
+
text-transform: uppercase;
|
|
234
|
+
font-weight: 700;
|
|
235
|
+
height: sp(2);
|
|
236
|
+
line-height: sp(2);
|
|
237
|
+
border-radius: $dp-button-radius;
|
|
238
|
+
padding: 0 sp(0.5);
|
|
239
|
+
cursor: pointer;
|
|
240
|
+
|
|
241
|
+
&:hover {
|
|
242
|
+
color: $dp-hover-fg;
|
|
243
|
+
background-color: $dp-hover-bg;
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
.dp-permanent .dp-today,
|
|
249
|
+
.dp-permanent .dp-clear,
|
|
250
|
+
.dp-permanent .dp-close {
|
|
251
|
+
display: none;
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
@media screen and (min-device-width: 1200px) {
|
|
255
|
+
.dp-close:hover,
|
|
256
|
+
.dp-close:focus,
|
|
257
|
+
.dp-clear:hover,
|
|
258
|
+
.dp-clear:focus,
|
|
259
|
+
.dp-today:hover,
|
|
260
|
+
.dp-today:focus,
|
|
261
|
+
.dp-next:hover,
|
|
262
|
+
.dp-next:focus,
|
|
263
|
+
.dp-prev:hover,
|
|
264
|
+
.dp-prev:focus,
|
|
265
|
+
.dp-cal-month:focus,
|
|
266
|
+
.dp-cal-month:hover,
|
|
267
|
+
.dp-cal-year:hover,
|
|
268
|
+
.dp-cal-year:focus {
|
|
269
|
+
background-color: $dp-hover-bg;
|
|
270
|
+
color: $dp-hover-fg;
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
.dp-col-header,
|
|
275
|
+
.dp-day {
|
|
276
|
+
//width: 14.28571429%;
|
|
277
|
+
width: divide(1, 7) * 100%;
|
|
278
|
+
border-radius: $dp-day-radius;
|
|
279
|
+
display: inline-block;
|
|
280
|
+
text-align: center;
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
.dp-day {
|
|
284
|
+
height: $dp-day-size;
|
|
285
|
+
cursor: pointer;
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
.dp-col-header {
|
|
289
|
+
color: $dp-fg-subtle;
|
|
290
|
+
text-transform: uppercase;
|
|
291
|
+
font-size: 0.66em;
|
|
292
|
+
font-weight: 700;
|
|
293
|
+
margin-bottom: sp(0.5);
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
.dp-years,
|
|
297
|
+
.dp-months {
|
|
298
|
+
box-sizing: border-box;
|
|
299
|
+
overflow: auto !important; /* HACK for Chrome on Android */
|
|
300
|
+
@include abs;
|
|
301
|
+
padding: sp(1);
|
|
302
|
+
@include scrollbar(8px, accent(), $background: rgba(accent(), 0.1));
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
.dp-month {
|
|
306
|
+
width: 50%;
|
|
307
|
+
display: inline-block;
|
|
308
|
+
padding: sp(1 0.5);
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
.dp-year {
|
|
312
|
+
display: block;
|
|
313
|
+
padding: sp(1 0.5);
|
|
314
|
+
width: 100%;
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
.dp-edge-day {
|
|
318
|
+
color: $dp-fg-subtle;
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
.dp-day:hover,
|
|
322
|
+
.dp-day:focus,
|
|
323
|
+
.dp-month:hover,
|
|
324
|
+
.dp-year:hover {
|
|
325
|
+
outline: none;
|
|
326
|
+
background: $dp-hover-bg;
|
|
327
|
+
color: $dp-hover-fg;
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
.dp-day.dp-selected:hover,
|
|
331
|
+
.dp-day.dp-selected:focus,
|
|
332
|
+
.dp-day.dp-selected {
|
|
333
|
+
background: accent();
|
|
334
|
+
color: #fff;
|
|
335
|
+
box-shadow: shadow(5);
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
// TODO
|
|
339
|
+
.dp-day-disabled {
|
|
340
|
+
background: transparent !important;
|
|
341
|
+
color: $dp-fg-subtle !important;
|
|
342
|
+
&:before {
|
|
343
|
+
content: '';
|
|
344
|
+
position: absolute;
|
|
345
|
+
width: 100%;
|
|
346
|
+
height: 1px;
|
|
347
|
+
background-color: $dp-fg-subtle;
|
|
348
|
+
opacity: 0.5;
|
|
349
|
+
display: block;
|
|
350
|
+
left: 0%;
|
|
351
|
+
top: 50%;
|
|
352
|
+
transform: rotate(-45deg);
|
|
353
|
+
}
|
|
354
|
+
//color: $dp-
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
// // TODO
|
|
358
|
+
// .dp-day-disabled:focus,
|
|
359
|
+
// .dp-day-disabled:hover {
|
|
360
|
+
// background: #ddd;
|
|
361
|
+
// }
|
|
362
|
+
|
|
363
|
+
// // TODO?
|
|
364
|
+
// .dp-focuser {
|
|
365
|
+
// position: absolute;
|
|
366
|
+
// z-index: 0;
|
|
367
|
+
// top: 50%;
|
|
368
|
+
// left: 50%;
|
|
369
|
+
// }
|
|
370
|
+
|
|
371
|
+
/* Responsive overrides */
|
|
372
|
+
@media (max-width: 480px), (max-height: 480px) {
|
|
373
|
+
.dp-modal .dp {
|
|
374
|
+
font-size: 0.9em;
|
|
375
|
+
width: auto;
|
|
376
|
+
width: 100%;
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
.dp-day-of-week,
|
|
380
|
+
.dp-day {
|
|
381
|
+
padding: 8px;
|
|
382
|
+
}
|
|
383
|
+
}
|
|
384
|
+
}
|
|
385
|
+
</style>
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
Basic card component
|
|
3
|
+
-->
|
|
4
|
+
<template>
|
|
5
|
+
<div :class="bem()">
|
|
6
|
+
<slot />
|
|
7
|
+
</div>
|
|
8
|
+
</template>
|
|
9
|
+
|
|
10
|
+
<script>
|
|
11
|
+
// import { mapState } from 'vuex';
|
|
12
|
+
// import Component from '~/components/Component.vue';
|
|
13
|
+
// import Mixin from '~/components/Mixin.vue';
|
|
14
|
+
export default {
|
|
15
|
+
name: 'px-card',
|
|
16
|
+
// components: { Component },
|
|
17
|
+
// mixins: [ Mixin ],
|
|
18
|
+
// props: { a: { type: Boolean, default: false } },
|
|
19
|
+
// data() { return { b: 0 }; },
|
|
20
|
+
// computed: {},
|
|
21
|
+
// watch: {},
|
|
22
|
+
// mounted() {},
|
|
23
|
+
// methods: {},
|
|
24
|
+
};
|
|
25
|
+
</script>
|
|
26
|
+
|
|
27
|
+
<style lang="scss">
|
|
28
|
+
@use '../styles/px.scss' as *;
|
|
29
|
+
.px-card {
|
|
30
|
+
$card: flat-merge(
|
|
31
|
+
get(
|
|
32
|
+
'controls:card',
|
|
33
|
+
(
|
|
34
|
+
background-color: clr(page-bg),
|
|
35
|
+
padding: sp(2),
|
|
36
|
+
border-radius: 10px,
|
|
37
|
+
box-shadow: depth-shadow(10, 0.1, black),
|
|
38
|
+
aspect-ratio: calc(4 / 5),
|
|
39
|
+
min-width: 200px,
|
|
40
|
+
max-width: 600px,
|
|
41
|
+
)
|
|
42
|
+
)
|
|
43
|
+
);
|
|
44
|
+
|
|
45
|
+
@include css-map($card);
|
|
46
|
+
}
|
|
47
|
+
</style>
|