@thinkpixellab-public/px-vue 5.0.2 → 5.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -15
- package/bases/PxBaseScroll.vue +0 -1
- package/components/PxColorPanel.vue +2 -1
- package/components/PxFloat.vue +8 -0
- package/components/PxSelectionBar.vue +0 -1
- package/components/PxValidator.vue +0 -1
- package/composables/loadGsap.js +10 -10
- package/package.json +59 -41
- package/plugins/common-client.js +0 -3
- package/plugins/common.js +0 -3
- package/utils/SharedHeightManager.js +2 -2
- package/utils/cardGridLayoutHelper.js +1 -1
- package/utils/scrollWatcher.js +6 -6
- package/utils/smootherCorners.js +33 -38
- package/.eslintrc.js +0 -14
- package/.prettierrc.json +0 -10
- package/.storybook/main.js +0 -26
- package/.storybook/manager-head.html +0 -0
- package/.storybook/manager.js +0 -6
- package/.storybook/preview-head.html +0 -3
- package/.storybook/preview.js +0 -26
- package/.storybook/preview.scss +0 -3
- package/.storybook/px-styles.config.scss +0 -26
- package/babel.config.js +0 -16
- package/chromatic.config.json +0 -5
- package/dev/data/fruits.js +0 -59
- package/dev/data/random.js +0 -13
- package/dev/demos/Demo-PxBaseDrag.vue +0 -94
- package/dev/demos/Demo-PxCardGrid.vue +0 -50
- package/dev/demos/Demo-PxContain.vue +0 -106
- package/dev/demos/Demo-PxFlip.vue +0 -104
- package/dev/demos/Demo-PxFloat.vue +0 -105
- package/dev/demos/Demo-PxMenu.vue +0 -94
- package/dev/demos/Demo-PxPivot.vue +0 -55
- package/dev/demos/Demo-PxSideDrawer.vue +0 -62
- package/dev/demos/Demo-PxSlideTransition.vue +0 -84
- package/dev/demos/Demo-PxSlides.vue +0 -142
- package/dev/demos/Demo-PxStylesPreview.vue +0 -41
- package/dev/demos/Demo-PxSwiper.vue +0 -36
- package/dev/demos/DemoPicker.vue +0 -77
- package/dev/dev.vue +0 -64
- package/dev/serve.js +0 -17
- package/stories/Intro.mdx +0 -1
- package/stories/PxAnimate.stories.js +0 -184
- package/stories/PxArrow.stories.js +0 -74
- package/stories/PxArrowScroller.stories.js +0 -38
- package/stories/PxAspect.stories.js +0 -66
- package/stories/PxAutoClamp.stories.js +0 -47
- package/stories/PxBackgroundFader.stories.js +0 -42
- package/stories/PxBalancedText.stories.js +0 -66
- package/stories/PxButton.stories.js +0 -83
- package/stories/PxCalendar.stories.js +0 -36
- package/stories/PxCard.stories.js +0 -31
- package/stories/PxCardGrid.stories.js +0 -60
- package/stories/PxClock.stories.js +0 -36
- package/stories/PxCodeSample.stories.js +0 -53
- package/stories/PxColorPalette.stories.js +0 -59
- package/stories/PxColorPanel.stories.js +0 -31
- package/stories/PxColorPicker.stories.js +0 -41
- package/stories/PxContain.stories.js +0 -80
- package/stories/PxCopyText.stories.js +0 -35
- package/stories/PxCorners.stories.js +0 -187
- package/stories/PxDatePicker.stories.js +0 -36
- package/stories/PxDropdown.stories.js +0 -56
- package/stories/PxExpander.stories.js +0 -33
- package/stories/PxFit.stories.js +0 -40
- package/stories/PxFlex.stories.js +0 -41
- package/stories/PxFlip.stories.js +0 -51
- package/stories/PxFloat.stories.js +0 -147
- package/stories/PxGsapScrubber.stories.js +0 -36
- package/stories/PxIcon.stories.js +0 -189
- package/stories/PxIconButton.stories.js +0 -87
- package/stories/PxImage.stories.js +0 -113
- package/stories/PxLabeledInput.stories.js +0 -44
- package/stories/PxMeasureContainer.stories.js +0 -50
- package/stories/PxMenu.stories.js +0 -99
- package/stories/PxPivot.stories.js +0 -42
- package/stories/PxPopupButton.stories.js +0 -69
- package/stories/PxProgressCircle.stories.js +0 -39
- package/stories/PxQrCode.stories.js +0 -36
- package/stories/PxRadioButton.stories.js +0 -35
- package/stories/PxResizer.stories.js +0 -40
- package/stories/PxScrubber.stories.js +0 -58
- package/stories/PxSideDrawer.stories.js +0 -36
- package/stories/PxSlides.stories.js +0 -65
- package/stories/PxSpinner.stories.js +0 -37
- package/stories/PxSticky.stories.js +0 -36
- package/stories/PxSvg.stories.js +0 -46
- package/stories/PxSvgRender.stories.js +0 -40
- package/stories/PxSyncHeight.stories.js +0 -48
- package/stories/PxTable.stories.js +0 -145
- package/stories/PxTextbox.stories.js +0 -59
- package/stories/PxToggle.stories.js +0 -77
- package/stories/PxToggleButton.stories.js +0 -109
- package/stories/PxToggleButtonList.stories.js +0 -102
- package/stories/PxToolPanel.stories.js +0 -351
- package/stories/PxTransition.stories.js +0 -74
- package/stories/PxTransitionExpand.stories.js +0 -36
- package/stories/PxTransitionItem.stories.js +0 -36
- package/stories/PxValidator.stories.js +0 -100
- package/stories/assets/alpha.svg +0 -6
- package/stories/assets/alphaNoSizing.svg +0 -6
- package/stories/assets/alphaSizeWidth.svg +0 -6
- package/stories/assets/px-01.jpg +0 -0
- package/stories/assets/px-02.jpg +0 -0
- package/stories/assets/px-03.jpg +0 -0
- package/stories/assets/px-04.jpg +0 -0
- package/stories/makestories.js +0 -65
- package/stories/svgIcon.stories.js +0 -67
- package/storybook/sb-sampledata.js +0 -664
- package/storybook/sb-styles.scss +0 -200
- package/storybook/sb-utils.js +0 -30
- package/test/MockComponent.vue +0 -12
- package/test/PxBaseColor.test.js +0 -54
- package/test/PxBaseItems.test.js +0 -95
- package/test/PxBaseItemsSelect.test.js +0 -470
- package/test/PxBaseUniqueId.test.js +0 -29
- package/test/PxBaseVariants.test.js +0 -166
- package/test/PxBaseVariantsOverride.test.js +0 -87
- package/test/animation.test.js +0 -120
- package/test/cssStr.test.js +0 -287
- package/test/utils.test.js +0 -60
- package/test/variants.test.js +0 -92
- package/vite.config.js +0 -37
- package/vue.config.js +0 -12
package/.storybook/preview.js
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { setup } from '@storybook/vue3';
|
|
2
|
-
import common from '../plugins/common.js';
|
|
3
|
-
import './preview.scss';
|
|
4
|
-
|
|
5
|
-
// px-vue common plugins
|
|
6
|
-
setup(app => {
|
|
7
|
-
app.use(common);
|
|
8
|
-
});
|
|
9
|
-
|
|
10
|
-
const preview = {
|
|
11
|
-
parameters: {
|
|
12
|
-
controls: {
|
|
13
|
-
matchers: {
|
|
14
|
-
color: /(background|color)$/i,
|
|
15
|
-
date: /Date$/,
|
|
16
|
-
string: /(itemsKey|itemsDisabled)$/i,
|
|
17
|
-
},
|
|
18
|
-
},
|
|
19
|
-
order: ['Intro', 'Components'],
|
|
20
|
-
storySort: (a, b) => a.id === b.id ? 0 : a.id.localeCompare(b.id, undefined, { numeric: true }),
|
|
21
|
-
docs: { },
|
|
22
|
-
},
|
|
23
|
-
tags: ['autodocs']
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
export default preview;
|
package/.storybook/preview.scss
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
// ----------------------------------------------------------------------------
|
|
2
|
-
// Default version (uncomment lines to force recognizable color/font)
|
|
3
|
-
// ----------------------------------------------------------------------------
|
|
4
|
-
|
|
5
|
-
@forward '@thinkpixellab-public/px-styles/all.scss';
|
|
6
|
-
@use '@thinkpixellab-public/px-styles/all.scss' as *;
|
|
7
|
-
|
|
8
|
-
// @include config('controls.base.font-family', 'Georgia');
|
|
9
|
-
// @include config('colors.accent', #e4346f);
|
|
10
|
-
|
|
11
|
-
@include init();
|
|
12
|
-
|
|
13
|
-
// ----------------------------------------------------------------------------
|
|
14
|
-
// Fluent version of styles (must be run with dev-px in order to get a reference
|
|
15
|
-
// to the px-styles-fluent.scss file)
|
|
16
|
-
// ----------------------------------------------------------------------------
|
|
17
|
-
|
|
18
|
-
// @forward '@thinkpixellab-public/px-styles/all.scss';
|
|
19
|
-
// @forward '@thinkpixellab/px-edge-shared/styles/px-styles-fluent.scss';
|
|
20
|
-
|
|
21
|
-
// @use '@thinkpixellab-public/px-styles/all.scss' as *;
|
|
22
|
-
// @use '@thinkpixellab/px-edge-shared/styles/px-styles-fluent.scss' as *;
|
|
23
|
-
|
|
24
|
-
// @include fluent-defaults();
|
|
25
|
-
|
|
26
|
-
// @include init();
|
package/babel.config.js
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
const devPresets = ['@vue/babel-preset-app'];
|
|
2
|
-
const buildPresets = [
|
|
3
|
-
[
|
|
4
|
-
'@babel/preset-env',
|
|
5
|
-
// Config for @babel/preset-env
|
|
6
|
-
{
|
|
7
|
-
// Example: Always transpile optional chaining/nullish coalescing
|
|
8
|
-
// include: [
|
|
9
|
-
// /(optional-chaining|nullish-coalescing)/
|
|
10
|
-
// ],
|
|
11
|
-
},
|
|
12
|
-
],
|
|
13
|
-
];
|
|
14
|
-
module.exports = {
|
|
15
|
-
presets: process.env.NODE_ENV === 'development' ? devPresets : buildPresets,
|
|
16
|
-
};
|
package/chromatic.config.json
DELETED
package/dev/data/fruits.js
DELETED
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
export default [
|
|
2
|
-
{
|
|
3
|
-
id: 'apple',
|
|
4
|
-
name: 'Apple',
|
|
5
|
-
color: 'red',
|
|
6
|
-
deliciousNess: 7,
|
|
7
|
-
description:
|
|
8
|
-
'Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Etiam porta sem malesuada magna mollis euismod. Nulla vitae elit libero, a pharetra augue.',
|
|
9
|
-
lastPurchase: new Date('2022-03-01T00:00:00.000Z'),
|
|
10
|
-
image: 'https://source.unsplash.com/MardkT836BU/?w=400&h=400',
|
|
11
|
-
},
|
|
12
|
-
{
|
|
13
|
-
id: 'orange',
|
|
14
|
-
name: 'Orange',
|
|
15
|
-
color: 'orange',
|
|
16
|
-
deliciousNess: 8,
|
|
17
|
-
description:
|
|
18
|
-
'Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Etiam porta sem malesuada magna mollis euismod.',
|
|
19
|
-
lastPurchase: new Date('2022-02-01T00:00:00.000Z'),
|
|
20
|
-
image: 'https://source.unsplash.com/U1iYwZ8Dx7k/?w=400&h=400',
|
|
21
|
-
},
|
|
22
|
-
{
|
|
23
|
-
id: 'lime',
|
|
24
|
-
name: 'Lime',
|
|
25
|
-
color: 'yellowgreen',
|
|
26
|
-
deliciousNess: 3,
|
|
27
|
-
description: 'Donec sed odio dui. Nullam id dolor id nibh ultricies vehicula ut id elit.',
|
|
28
|
-
lastPurchase: new Date('2022-01-01T00:00:00.000Z'),
|
|
29
|
-
image: 'https://source.unsplash.com/fjc3Ynol3Bs/?w=400&h=400',
|
|
30
|
-
},
|
|
31
|
-
{
|
|
32
|
-
id: 'banana',
|
|
33
|
-
name: 'Banana',
|
|
34
|
-
color: 'gold',
|
|
35
|
-
deliciousNess: 7,
|
|
36
|
-
description: 'Donec id elit non mi porta gravida at eget metus.',
|
|
37
|
-
lastPurchase: new Date('2021-12-01T00:00:00.000Z'),
|
|
38
|
-
image: 'https://source.unsplash.com/sf_1ZDA1YFw/?w=400&h=400',
|
|
39
|
-
},
|
|
40
|
-
{
|
|
41
|
-
id: 'grape',
|
|
42
|
-
name: 'Grape',
|
|
43
|
-
color: 'purple',
|
|
44
|
-
deliciousNess: 5,
|
|
45
|
-
description:
|
|
46
|
-
'Etiam porta sem malesuada magna mollis euismod. Morbi leo risus, porta ac consectetur ac, vestibulum at eros.',
|
|
47
|
-
lastPurchase: new Date('2021-11-01T00:00:00.000Z'),
|
|
48
|
-
image: 'https://source.unsplash.com/ASKgnwyif3E/?w=400&h=400',
|
|
49
|
-
},
|
|
50
|
-
{
|
|
51
|
-
id: 'strawberry',
|
|
52
|
-
name: 'Strawberry',
|
|
53
|
-
color: 'pink',
|
|
54
|
-
deliciousNess: 9,
|
|
55
|
-
description: 'Donec ullamcorper nulla non metus auctor fringilla.',
|
|
56
|
-
lastPurchase: new Date('2021-10-01T00:00:00.000Z'),
|
|
57
|
-
image: 'https://source.unsplash.com/xnRg3xDcNnE/?w=400&h=400',
|
|
58
|
-
},
|
|
59
|
-
];
|
package/dev/data/random.js
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import fruits from './fruits.js';
|
|
2
|
-
|
|
3
|
-
export default {
|
|
4
|
-
randomFruits(count) {
|
|
5
|
-
let f = [];
|
|
6
|
-
for (let i = 0; i < count; i++) {
|
|
7
|
-
let randomFruit = fruits[Math.floor(Math.random() * fruits.length)];
|
|
8
|
-
|
|
9
|
-
f.push({ ...randomFruit, id: randomFruit.id + '-' + i });
|
|
10
|
-
}
|
|
11
|
-
return f;
|
|
12
|
-
},
|
|
13
|
-
};
|
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
<!--
|
|
2
|
-
Describe this component...
|
|
3
|
-
-->
|
|
4
|
-
<template>
|
|
5
|
-
<div :class="bem()">
|
|
6
|
-
<div :class="bem('status')"></div>
|
|
7
|
-
<div
|
|
8
|
-
:class="bem('ball')"
|
|
9
|
-
:style="{ transform: `translate(${cssPx(dx)},${cssPx(dy)})` }"
|
|
10
|
-
></div>
|
|
11
|
-
<div :class="bem('status')">
|
|
12
|
-
<div>dx:{{ dx }}</div>
|
|
13
|
-
<div>dy:{{ dy }}</div>
|
|
14
|
-
<div>isDragging:{{ isDragging }}</div>
|
|
15
|
-
<div>isMoving:{{ isMoving }}</div>
|
|
16
|
-
</div>
|
|
17
|
-
</div>
|
|
18
|
-
</template>
|
|
19
|
-
|
|
20
|
-
<script>
|
|
21
|
-
import drag from '../../utils/drag.js';
|
|
22
|
-
|
|
23
|
-
export default {
|
|
24
|
-
name: 'demo-px-drag-base',
|
|
25
|
-
props: {},
|
|
26
|
-
data() {
|
|
27
|
-
return { dx: 0, dy: 0, isMoving: false, isDragging: false };
|
|
28
|
-
},
|
|
29
|
-
// computed: {},
|
|
30
|
-
// watch: {},
|
|
31
|
-
mounted() {
|
|
32
|
-
this.drag = new drag(this.$el, {
|
|
33
|
-
lock: 'x',
|
|
34
|
-
onStart: () => {
|
|
35
|
-
this.isDragging = true;
|
|
36
|
-
},
|
|
37
|
-
onDrag: ev => {
|
|
38
|
-
this.isMoving = true;
|
|
39
|
-
if (ev.delta) {
|
|
40
|
-
this.dx += ev.delta.x;
|
|
41
|
-
this.dy += ev.delta.y;
|
|
42
|
-
}
|
|
43
|
-
},
|
|
44
|
-
onEnd: ev => {
|
|
45
|
-
// this.dx = 0;
|
|
46
|
-
// this.dy = 0;
|
|
47
|
-
this.isDragging = false;
|
|
48
|
-
console.log(ev.delta);
|
|
49
|
-
},
|
|
50
|
-
onMoveEnd: () => {
|
|
51
|
-
this.isMoving = false;
|
|
52
|
-
},
|
|
53
|
-
});
|
|
54
|
-
},
|
|
55
|
-
// methods: {},
|
|
56
|
-
};
|
|
57
|
-
</script>
|
|
58
|
-
|
|
59
|
-
<style lang="scss">
|
|
60
|
-
@use '../../styles/px.scss' as *;
|
|
61
|
-
|
|
62
|
-
.demo-px-drag-base {
|
|
63
|
-
width: 100vw;
|
|
64
|
-
height: 60vh;
|
|
65
|
-
background-color: peachpuff;
|
|
66
|
-
border: 4px solid tomato;
|
|
67
|
-
box-sizing: border-box;
|
|
68
|
-
position: relative;
|
|
69
|
-
&__ball {
|
|
70
|
-
position: absolute;
|
|
71
|
-
top: 50%;
|
|
72
|
-
left: 50%;
|
|
73
|
-
margin-left: -60px;
|
|
74
|
-
margin-top: -60px;
|
|
75
|
-
width: 120px;
|
|
76
|
-
height: 120px;
|
|
77
|
-
background-color: tomato;
|
|
78
|
-
border-radius: 50%;
|
|
79
|
-
}
|
|
80
|
-
&__status {
|
|
81
|
-
background-color: accent(-6);
|
|
82
|
-
color: accent(8);
|
|
83
|
-
position: fixed;
|
|
84
|
-
top: 20px;
|
|
85
|
-
right: 20px;
|
|
86
|
-
width: 16em;
|
|
87
|
-
padding: 1.5em;
|
|
88
|
-
border-radius: 0.5em;
|
|
89
|
-
font-family: get('code-font-family');
|
|
90
|
-
font-size: 10px;
|
|
91
|
-
line-height: 1.5;
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
</style>
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
<!--
|
|
2
|
-
Describe this component...
|
|
3
|
-
-->
|
|
4
|
-
<template>
|
|
5
|
-
<div :class="bem()">
|
|
6
|
-
<px-card-grid
|
|
7
|
-
:items="fruits"
|
|
8
|
-
:debug="true"
|
|
9
|
-
:gap="60"
|
|
10
|
-
:allow-orphans="true"
|
|
11
|
-
:pad-orphans="true"
|
|
12
|
-
:maxColumns="4"
|
|
13
|
-
:templates="{
|
|
14
|
-
4: ['== -- -----', '-- == -- --', '----- -- ==', '-- -- == --'],
|
|
15
|
-
3: ['== -- --', '-- -- ==', '-- == --'],
|
|
16
|
-
2: ['-- --', '-----', '== --'],
|
|
17
|
-
}"
|
|
18
|
-
>
|
|
19
|
-
<template #default="{ item }">{{ item.name }}</template>
|
|
20
|
-
</px-card-grid>
|
|
21
|
-
</div>
|
|
22
|
-
</template>
|
|
23
|
-
|
|
24
|
-
<script>
|
|
25
|
-
import PxCardGrid from '../../components/PxCardGrid.vue';
|
|
26
|
-
import random from '../data/random.js';
|
|
27
|
-
|
|
28
|
-
export default {
|
|
29
|
-
components: { PxCardGrid },
|
|
30
|
-
name: 'demo-px-card-grid',
|
|
31
|
-
// components: { Component },
|
|
32
|
-
// mixins: [ Mixin ],
|
|
33
|
-
// props: { a: { type: Boolean, default: false } },
|
|
34
|
-
data() {
|
|
35
|
-
return { fruits: [] };
|
|
36
|
-
},
|
|
37
|
-
// computed: {},
|
|
38
|
-
// watch: {},
|
|
39
|
-
mounted() {
|
|
40
|
-
this.fruits = random.randomFruits(20);
|
|
41
|
-
},
|
|
42
|
-
// methods: {},
|
|
43
|
-
};
|
|
44
|
-
</script>
|
|
45
|
-
|
|
46
|
-
<style lang="scss">
|
|
47
|
-
.demo-px-card-grid {
|
|
48
|
-
padding: 5vh 0 10vh;
|
|
49
|
-
}
|
|
50
|
-
</style>
|
|
@@ -1,106 +0,0 @@
|
|
|
1
|
-
<!--
|
|
2
|
-
Describe this component...
|
|
3
|
-
-->
|
|
4
|
-
<template>
|
|
5
|
-
<div>
|
|
6
|
-
<px-tester>
|
|
7
|
-
<px-test name="Aspect" testId="pxcontain-aspect" :size="{ h: 600 }">
|
|
8
|
-
<px-contain aspect="16:9" :px="true">
|
|
9
|
-
<template #default="{ top, left, width, height }">
|
|
10
|
-
<div
|
|
11
|
-
:style="{
|
|
12
|
-
position: 'absolute',
|
|
13
|
-
left,
|
|
14
|
-
top,
|
|
15
|
-
width,
|
|
16
|
-
height,
|
|
17
|
-
background: 'red',
|
|
18
|
-
}"
|
|
19
|
-
/>
|
|
20
|
-
</template>
|
|
21
|
-
</px-contain>
|
|
22
|
-
</px-test>
|
|
23
|
-
|
|
24
|
-
<px-test name="Width / Height" testId="pxcontain-wh" :size="{ h: 600 }">
|
|
25
|
-
<px-contain :naturalWidth="1600" :naturalHeight="900">
|
|
26
|
-
<template #default="{ top, left, width, height }">
|
|
27
|
-
<div
|
|
28
|
-
:style="{
|
|
29
|
-
position: 'absolute',
|
|
30
|
-
left,
|
|
31
|
-
top,
|
|
32
|
-
width,
|
|
33
|
-
height,
|
|
34
|
-
background: 'gold',
|
|
35
|
-
}"
|
|
36
|
-
/>
|
|
37
|
-
</template>
|
|
38
|
-
</px-contain>
|
|
39
|
-
</px-test>
|
|
40
|
-
|
|
41
|
-
<px-test name="Scale" testId="pxcontain-scale" :size="{ h: 600 }">
|
|
42
|
-
<px-contain :naturalWidth="1600" :naturalHeight="900">
|
|
43
|
-
<template #default="{ top, left, scale }">
|
|
44
|
-
<div
|
|
45
|
-
:style="{
|
|
46
|
-
position: 'absolute',
|
|
47
|
-
width: '1600px',
|
|
48
|
-
height: '900px',
|
|
49
|
-
top,
|
|
50
|
-
left,
|
|
51
|
-
transformOrigin: '0 0',
|
|
52
|
-
transform: `scale(${scale})`,
|
|
53
|
-
background: 'gold',
|
|
54
|
-
}"
|
|
55
|
-
/>
|
|
56
|
-
</template>
|
|
57
|
-
</px-contain>
|
|
58
|
-
</px-test>
|
|
59
|
-
<px-test name="Basic with Padding" testId="pxcontain-pad" :size="{ h: 600 }">
|
|
60
|
-
<div
|
|
61
|
-
:style="{
|
|
62
|
-
width: '100%',
|
|
63
|
-
height: '100%',
|
|
64
|
-
padding: '49px',
|
|
65
|
-
border: '1px solid red',
|
|
66
|
-
boxSizing: 'border-box',
|
|
67
|
-
}"
|
|
68
|
-
>
|
|
69
|
-
<px-contain :aspect="4 / 3">
|
|
70
|
-
<template #default="{ top, left, width, height }">
|
|
71
|
-
<div
|
|
72
|
-
:style="{
|
|
73
|
-
position: 'absolute',
|
|
74
|
-
left,
|
|
75
|
-
top,
|
|
76
|
-
width,
|
|
77
|
-
height,
|
|
78
|
-
background: 'lightblue',
|
|
79
|
-
}"
|
|
80
|
-
>
|
|
81
|
-
{{ width }} x {{ height }}
|
|
82
|
-
</div>
|
|
83
|
-
</template>
|
|
84
|
-
</px-contain>
|
|
85
|
-
</div>
|
|
86
|
-
</px-test>
|
|
87
|
-
</px-tester>
|
|
88
|
-
</div>
|
|
89
|
-
</template>
|
|
90
|
-
|
|
91
|
-
<script>
|
|
92
|
-
import { PxTester, PxTest } from '@thinkpixellab-public/px-vue-tester';
|
|
93
|
-
import PxContain from '../../components/PxContain.vue';
|
|
94
|
-
|
|
95
|
-
export default {
|
|
96
|
-
name: 'demo-px-contain',
|
|
97
|
-
components: { PxTester, PxTest, PxContain },
|
|
98
|
-
// mixins: [ Mixin ],
|
|
99
|
-
// props: { a: { type: Boolean, default: false } },
|
|
100
|
-
// data() { return { b: 0 }; },
|
|
101
|
-
// computed: {},
|
|
102
|
-
// watch: {},
|
|
103
|
-
// mounted() {},
|
|
104
|
-
// methods: {},
|
|
105
|
-
};
|
|
106
|
-
</script>
|
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
'one | two | 50%'
|
|
2
|
-
<!--
|
|
3
|
-
Describe this component...
|
|
4
|
-
-->
|
|
5
|
-
<template>
|
|
6
|
-
<div :class="bem()">
|
|
7
|
-
<PxFlip ref="flip" :states="['one', 'two']" :current="currentState">
|
|
8
|
-
<template #default="{ state }">
|
|
9
|
-
{{ state }}
|
|
10
|
-
<br />
|
|
11
|
-
<br />
|
|
12
|
-
<div :class="bem('container', { state })">
|
|
13
|
-
<div :class="bem('red')" data-flip />
|
|
14
|
-
<div :class="bem('gold')" data-flip />
|
|
15
|
-
<div :class="bem('blue')" data-flip />
|
|
16
|
-
</div>
|
|
17
|
-
</template>
|
|
18
|
-
</PxFlip>
|
|
19
|
-
<button @click="toggleState">Toggle</button>
|
|
20
|
-
</div>
|
|
21
|
-
</template>
|
|
22
|
-
|
|
23
|
-
<script>
|
|
24
|
-
import PxFlip from '../../components/PxFlip.vue';
|
|
25
|
-
|
|
26
|
-
export default {
|
|
27
|
-
name: 'demo-px-flip',
|
|
28
|
-
components: { PxFlip },
|
|
29
|
-
|
|
30
|
-
// mixins: [ Mixin ],
|
|
31
|
-
// props: { a: { type: Boolean, default: false } },
|
|
32
|
-
data() {
|
|
33
|
-
return {
|
|
34
|
-
currentState: 'one',
|
|
35
|
-
};
|
|
36
|
-
},
|
|
37
|
-
// computed: {},
|
|
38
|
-
// watch: {},
|
|
39
|
-
// mounted() {},
|
|
40
|
-
methods: {
|
|
41
|
-
toggleState() {
|
|
42
|
-
if (this.currentState == 'one') {
|
|
43
|
-
this.currentState = 'two';
|
|
44
|
-
} else {
|
|
45
|
-
this.currentState = 'one';
|
|
46
|
-
}
|
|
47
|
-
},
|
|
48
|
-
},
|
|
49
|
-
};
|
|
50
|
-
</script>
|
|
51
|
-
|
|
52
|
-
<style lang="scss">
|
|
53
|
-
@use '../../styles/px.scss' as *;
|
|
54
|
-
.demo-px-flip {
|
|
55
|
-
padding: 5em;
|
|
56
|
-
&__container {
|
|
57
|
-
width: 200px;
|
|
58
|
-
height: 200px;
|
|
59
|
-
border: 1px solid black;
|
|
60
|
-
|
|
61
|
-
// prettier-ignore
|
|
62
|
-
@include grid-art(
|
|
63
|
-
(
|
|
64
|
-
'50% | 50% | ',
|
|
65
|
-
'red | gold | 50%',
|
|
66
|
-
'blue | blue | 50%'
|
|
67
|
-
)
|
|
68
|
-
);
|
|
69
|
-
|
|
70
|
-
span {
|
|
71
|
-
width: 100%;
|
|
72
|
-
height: 0.5em;
|
|
73
|
-
background-color: currentColor;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
&--state-one {
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
&--state-two {
|
|
80
|
-
// prettier-ignore
|
|
81
|
-
@include grid-art(
|
|
82
|
-
(
|
|
83
|
-
'33% | 67% | ',
|
|
84
|
-
'blue | red | 50%',
|
|
85
|
-
'gold | gold | 50%'
|
|
86
|
-
)
|
|
87
|
-
);
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
&__red {
|
|
92
|
-
background-color: tomato;
|
|
93
|
-
grid-area: red;
|
|
94
|
-
}
|
|
95
|
-
&__gold {
|
|
96
|
-
background-color: gold;
|
|
97
|
-
grid-area: gold;
|
|
98
|
-
}
|
|
99
|
-
&__blue {
|
|
100
|
-
background-color: lightblue;
|
|
101
|
-
grid-area: blue;
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
</style>
|
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
<!--
|
|
2
|
-
Describe this component...
|
|
3
|
-
-->
|
|
4
|
-
<template>
|
|
5
|
-
<div :class="bem()">
|
|
6
|
-
<div :class="bem('dialog-buttons')">
|
|
7
|
-
<button :class="bem('button')" @click="visible = true">Toggle Dialog</button>
|
|
8
|
-
|
|
9
|
-
<px-float v-model:visible="visible" variant="dialog gray" :disablesScroll="false">
|
|
10
|
-
This is some content
|
|
11
|
-
|
|
12
|
-
<button :class="bem('button')" @click="innerVisible = true">Inner Toggle</button>
|
|
13
|
-
|
|
14
|
-
<!-- inner dialogs need to be used with a portal if they are contained -->
|
|
15
|
-
<px-float v-model:visible="innerVisible" variant="dialog blur">
|
|
16
|
-
This is some inner content
|
|
17
|
-
|
|
18
|
-
<button :class="bem('button')" @click="innerInnerVisible = true">
|
|
19
|
-
Inner Inner Toggle
|
|
20
|
-
</button>
|
|
21
|
-
|
|
22
|
-
<!-- inner dialogs need to be used with a portal if they are contained -->
|
|
23
|
-
<px-float v-model:visible="innerInnerVisible" variant="dialog blur gray">
|
|
24
|
-
Wow this is deep
|
|
25
|
-
</px-float>
|
|
26
|
-
</px-float>
|
|
27
|
-
</px-float>
|
|
28
|
-
</div>
|
|
29
|
-
|
|
30
|
-
<div :class="bem('position-buttons')">
|
|
31
|
-
<div :class="bem('button')" @click="showPosition('top')">Top</div>
|
|
32
|
-
<px-float
|
|
33
|
-
v-model:visible="positionVisible"
|
|
34
|
-
:placement="'top-start'"
|
|
35
|
-
:disablesScroll="false"
|
|
36
|
-
:offset="10"
|
|
37
|
-
>
|
|
38
|
-
Position: {{ position }}
|
|
39
|
-
</px-float>
|
|
40
|
-
</div>
|
|
41
|
-
|
|
42
|
-
<!-- mouse -->
|
|
43
|
-
<div :class="bem('button')" @click="showMouseFloat">Mouse</div>
|
|
44
|
-
<px-float ref="mouseFloat" :placement="'bottom-start'" variant="dialog sm">
|
|
45
|
-
Positioned with showAtCursor! (Note: needs to be done pogramatically because we only
|
|
46
|
-
have access to mouse coordinates in a mouse event.)
|
|
47
|
-
</px-float>
|
|
48
|
-
</div>
|
|
49
|
-
</template>
|
|
50
|
-
|
|
51
|
-
<script>
|
|
52
|
-
import PxFloat from '../../components/PxFloat.vue';
|
|
53
|
-
export default {
|
|
54
|
-
name: 'demo-px-swiper',
|
|
55
|
-
components: { PxFloat },
|
|
56
|
-
// mixins: [ Mixin ],
|
|
57
|
-
// props: { a: { type: Boolean, default: false } },
|
|
58
|
-
data() {
|
|
59
|
-
return {
|
|
60
|
-
visible: false,
|
|
61
|
-
innerVisible: false,
|
|
62
|
-
innerInnerVisible: false,
|
|
63
|
-
position: 'top',
|
|
64
|
-
positionVisible: false,
|
|
65
|
-
};
|
|
66
|
-
},
|
|
67
|
-
// computed: {},
|
|
68
|
-
// watch: {},
|
|
69
|
-
// mounted() {},
|
|
70
|
-
methods: {
|
|
71
|
-
showPosition(pos) {
|
|
72
|
-
this.position = pos;
|
|
73
|
-
this.positionVisible = true;
|
|
74
|
-
},
|
|
75
|
-
showMouseFloat(e) {
|
|
76
|
-
this.$refs.mouseFloat.showAtCursor(e);
|
|
77
|
-
},
|
|
78
|
-
},
|
|
79
|
-
};
|
|
80
|
-
</script>
|
|
81
|
-
|
|
82
|
-
<style lang="scss">
|
|
83
|
-
@use '../../styles/px.scss' as *;
|
|
84
|
-
|
|
85
|
-
.demo-px-swiper {
|
|
86
|
-
min-height: 500vh;
|
|
87
|
-
@include debug-zebra(rgba(black, 0.03), rgba(black, 0));
|
|
88
|
-
&__button {
|
|
89
|
-
position: relative;
|
|
90
|
-
margin-top: 20px;
|
|
91
|
-
margin-left: 20px;
|
|
92
|
-
@include button();
|
|
93
|
-
&:focus {
|
|
94
|
-
outline: 2px dashed accent();
|
|
95
|
-
outline-offset: 5px;
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
&__position-buttons {
|
|
99
|
-
@include center(0%, 50%);
|
|
100
|
-
display: flex;
|
|
101
|
-
flex-direction: column;
|
|
102
|
-
gap: 20px;
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
</style>
|