@thinkpixellab-public/px-vue 5.0.3 → 5.2.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/PxSelectionBar.vue +0 -1
- package/components/PxValidator.vue +0 -1
- package/composables/loadGsap.js +10 -10
- package/package.json +60 -42
- 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
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import PxSlides from '@/components/PxSlides.vue';
|
|
2
|
-
import { extractArgTypes } from '@/storybook/sb-utils.js';
|
|
3
|
-
import { fruitsPlusPlus } from '@/storybook/sb-sampledata.js';
|
|
4
|
-
|
|
5
|
-
export default {
|
|
6
|
-
title: 'PxSlides',
|
|
7
|
-
component: PxSlides,
|
|
8
|
-
// decorators: [ ... ],
|
|
9
|
-
// parameters: { ... },
|
|
10
|
-
|
|
11
|
-
// https://storybook.js.org/docs/vue/essentials/controls#annotation
|
|
12
|
-
// https://storybook.js.org/docs/vue/api/argtypes#available-properties
|
|
13
|
-
argTypes: {
|
|
14
|
-
...extractArgTypes(PxSlides),
|
|
15
|
-
// someProp: { type: 'select', options: ['one', 'two', 'three'] }
|
|
16
|
-
},
|
|
17
|
-
args: {
|
|
18
|
-
items: fruitsPlusPlus,
|
|
19
|
-
// label: 'Hello',
|
|
20
|
-
// onClick: () => {}),
|
|
21
|
-
},
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
export const Basic = {
|
|
25
|
-
render: (args, { argTypes }) => ({
|
|
26
|
-
components: { PxSlides },
|
|
27
|
-
setup() {
|
|
28
|
-
return { args };
|
|
29
|
-
},
|
|
30
|
-
template: `
|
|
31
|
-
|
|
32
|
-
<PxSlides v-bind="args" :style="{height: '600px'}">
|
|
33
|
-
<template #slide="{ item, index }">
|
|
34
|
-
|
|
35
|
-
<div style="height: 100%; display: flex; justify-content: center; align-items: center;">
|
|
36
|
-
|
|
37
|
-
<h1 style="padding: 0.5em; background-color: black; color: white; position: absolute; z-index: 1; text-align: center;">{{ index+1 }} - {{ item.name }}</h1>
|
|
38
|
-
|
|
39
|
-
<div
|
|
40
|
-
data-drag
|
|
41
|
-
:style="{
|
|
42
|
-
border: '1px solid black',
|
|
43
|
-
backgroundImage: cssUrl(item.image),
|
|
44
|
-
backgroundSize: 'cover',
|
|
45
|
-
backgroundPosition: 'center',
|
|
46
|
-
backgroundRepeat: 'no-repeat',
|
|
47
|
-
borderRadius: '50%',
|
|
48
|
-
aspectRatio: 1,
|
|
49
|
-
height: '100%',
|
|
50
|
-
objectFit: 'contain',
|
|
51
|
-
|
|
52
|
-
}"
|
|
53
|
-
/>
|
|
54
|
-
|
|
55
|
-
</div>
|
|
56
|
-
|
|
57
|
-
</template>
|
|
58
|
-
</PxSlides>`,
|
|
59
|
-
}),
|
|
60
|
-
};
|
|
61
|
-
|
|
62
|
-
// export const Advanced = {
|
|
63
|
-
// ...Basic,
|
|
64
|
-
// // args: { ... },
|
|
65
|
-
// };
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import PxSpinner from '@/components/PxSpinner.vue';
|
|
2
|
-
import { extractArgTypes } from '@/storybook/sb-utils.js';
|
|
3
|
-
|
|
4
|
-
export default {
|
|
5
|
-
title: 'PxSpinner',
|
|
6
|
-
component: PxSpinner,
|
|
7
|
-
// decorators: [ ... ],
|
|
8
|
-
// parameters: { ... },
|
|
9
|
-
|
|
10
|
-
// https://storybook.js.org/docs/vue/essentials/controls#annotation
|
|
11
|
-
// https://storybook.js.org/docs/vue/api/argtypes#available-properties
|
|
12
|
-
argTypes: {
|
|
13
|
-
...extractArgTypes(PxSpinner),
|
|
14
|
-
// someProp: { type: 'select', options: ['one', 'two', 'three'] }
|
|
15
|
-
},
|
|
16
|
-
args: {
|
|
17
|
-
visible: true,
|
|
18
|
-
// label: 'Hello',
|
|
19
|
-
// onClick: () => {}),
|
|
20
|
-
},
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
export const Basic = {
|
|
24
|
-
render: (args, { argTypes }) => ({
|
|
25
|
-
components: { PxSpinner },
|
|
26
|
-
setup() {
|
|
27
|
-
return { args };
|
|
28
|
-
},
|
|
29
|
-
template: `
|
|
30
|
-
<PxSpinner v-bind="args"></PxSpinner>`,
|
|
31
|
-
}),
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
// export const Advanced = {
|
|
35
|
-
// ...Basic,
|
|
36
|
-
// // args: { ... },
|
|
37
|
-
// };
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import PxSticky from '@/components/PxSticky.vue';
|
|
2
|
-
import { extractArgTypes } from '@/storybook/sb-utils.js';
|
|
3
|
-
|
|
4
|
-
export default {
|
|
5
|
-
title: '[TODO] PxSticky',
|
|
6
|
-
component: PxSticky,
|
|
7
|
-
// decorators: [ ... ],
|
|
8
|
-
// parameters: { ... },
|
|
9
|
-
|
|
10
|
-
// https://storybook.js.org/docs/vue/essentials/controls#annotation
|
|
11
|
-
// https://storybook.js.org/docs/vue/api/argtypes#available-properties
|
|
12
|
-
argTypes: {
|
|
13
|
-
...extractArgTypes(PxSticky),
|
|
14
|
-
// someProp: { type: 'select', options: ['one', 'two', 'three'] }
|
|
15
|
-
},
|
|
16
|
-
args: {
|
|
17
|
-
// label: 'Hello',
|
|
18
|
-
// onClick: () => {}),
|
|
19
|
-
},
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
export const Basic = {
|
|
23
|
-
render: (args, { argTypes }) => ({
|
|
24
|
-
components: { PxSticky },
|
|
25
|
-
setup() {
|
|
26
|
-
return { args };
|
|
27
|
-
},
|
|
28
|
-
template: `
|
|
29
|
-
<PxSticky v-bind="args"></PxSticky>`,
|
|
30
|
-
}),
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
// export const Advanced = {
|
|
34
|
-
// ...Basic,
|
|
35
|
-
// // args: { ... },
|
|
36
|
-
// };
|
package/stories/PxSvg.stories.js
DELETED
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import PxSvg from '@/components/PxSvg.vue';
|
|
2
|
-
import { extractArgTypes } from '@/storybook/sb-utils.js';
|
|
3
|
-
|
|
4
|
-
import alphaSvg from './assets/alpha.svg';
|
|
5
|
-
import alphaSizeWidthSvg from './assets/alphaSizeWidth.svg';
|
|
6
|
-
import alphaNoSizingSvg from './assets/alphaNoSizing.svg';
|
|
7
|
-
|
|
8
|
-
export default {
|
|
9
|
-
component: PxSvg,
|
|
10
|
-
// decorators: [ ... ],
|
|
11
|
-
// parameters: { ... },
|
|
12
|
-
|
|
13
|
-
// https://storybook.js.org/docs/vue/essentials/controls#annotation
|
|
14
|
-
// https://storybook.js.org/docs/vue/api/argtypes#available-properties
|
|
15
|
-
argTypes: {
|
|
16
|
-
...extractArgTypes(PxSvg),
|
|
17
|
-
// someProp: { type: 'select', options: ['one', 'two', 'three'] }
|
|
18
|
-
src: { control: 'text' },
|
|
19
|
-
},
|
|
20
|
-
args: {
|
|
21
|
-
// label: 'Hello',
|
|
22
|
-
// onClick: () => {}),
|
|
23
|
-
src: alphaSvg,
|
|
24
|
-
},
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
export const Basic = {
|
|
28
|
-
// name: 'Story Name',
|
|
29
|
-
render: (args, { argTypes }) => ({
|
|
30
|
-
components: { PxSvg },
|
|
31
|
-
setup() {
|
|
32
|
-
return { args };
|
|
33
|
-
},
|
|
34
|
-
template: `<PxSvg v-bind="args" size="200px" />`,
|
|
35
|
-
}),
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
export const WidthAndHeightNoViewBox = {
|
|
39
|
-
...Basic,
|
|
40
|
-
args: { src: alphaSizeWidthSvg },
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
export const NoSizing = {
|
|
44
|
-
...Basic,
|
|
45
|
-
args: { src: alphaNoSizingSvg },
|
|
46
|
-
};
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import PxSvgRender from '@/components/PxSvgRender.vue';
|
|
2
|
-
import { extractArgTypes } from '@/storybook/sb-utils.js';
|
|
3
|
-
import { svgArrow } from '../utils/svgIcons';
|
|
4
|
-
|
|
5
|
-
import alphaSvg from './assets/alpha.svg';
|
|
6
|
-
|
|
7
|
-
export default {
|
|
8
|
-
component: PxSvgRender,
|
|
9
|
-
// decorators: [ ... ],
|
|
10
|
-
// parameters: { ... },
|
|
11
|
-
|
|
12
|
-
// https://storybook.js.org/docs/vue/essentials/controls#annotation
|
|
13
|
-
// https://storybook.js.org/docs/vue/api/argtypes#available-properties
|
|
14
|
-
argTypes: {
|
|
15
|
-
...extractArgTypes(PxSvgRender),
|
|
16
|
-
// someProp: { type: 'select', options: ['one', 'two', 'three'] }
|
|
17
|
-
svg: { control: 'text' },
|
|
18
|
-
},
|
|
19
|
-
args: {
|
|
20
|
-
// label: 'Hello',
|
|
21
|
-
// onClick: () => {}),
|
|
22
|
-
},
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
export const Basic = {
|
|
26
|
-
// name: 'Story Name',
|
|
27
|
-
render: (args, { argTypes }) => ({
|
|
28
|
-
components: { PxSvgRender },
|
|
29
|
-
setup() {
|
|
30
|
-
return { args };
|
|
31
|
-
},
|
|
32
|
-
template: `<PxSvgRender v-bind="args" :svg="svgArrow()" />`,
|
|
33
|
-
methods: { svgArrow },
|
|
34
|
-
}),
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
export const Advanced = {
|
|
38
|
-
...Basic,
|
|
39
|
-
// args: { size: '2em' },
|
|
40
|
-
};
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import PxSyncHeight from '@/components/PxSyncHeight.vue';
|
|
2
|
-
import { extractArgTypes } from '@/storybook/sb-utils.js';
|
|
3
|
-
|
|
4
|
-
export default {
|
|
5
|
-
title: 'PxSyncHeight',
|
|
6
|
-
component: PxSyncHeight,
|
|
7
|
-
// decorators: [ ... ],
|
|
8
|
-
// parameters: { ... },
|
|
9
|
-
|
|
10
|
-
// https://storybook.js.org/docs/vue/essentials/controls#annotation
|
|
11
|
-
// https://storybook.js.org/docs/vue/api/argtypes#available-properties
|
|
12
|
-
argTypes: {
|
|
13
|
-
...extractArgTypes(PxSyncHeight),
|
|
14
|
-
// someProp: { type: 'select', options: ['one', 'two', 'three'] }
|
|
15
|
-
},
|
|
16
|
-
args: {
|
|
17
|
-
// label: 'Hello',
|
|
18
|
-
// onClick: () => {}),
|
|
19
|
-
},
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
export const Basic = {
|
|
23
|
-
render: (args, { argTypes }) => ({
|
|
24
|
-
components: { PxSyncHeight },
|
|
25
|
-
setup() {
|
|
26
|
-
return { args };
|
|
27
|
-
},
|
|
28
|
-
template: `
|
|
29
|
-
<div style="display: flex; gap: 1em; align-items: flex-start;" >
|
|
30
|
-
<PxSyncHeight v-bind="args" class="story-bounds" group="a" style="flex: 1" >
|
|
31
|
-
Many words including praesentium libero dolorem suscipit consequatur distinctio vel ipsa vel aut. Corrupti voluptatibus culpa nam voluptate incidunt a. Officia quia et magni rerum ut temporibus vel fugit perferendis assumenda et aut.
|
|
32
|
-
</PxSyncHeight>
|
|
33
|
-
<PxSyncHeight v-bind="args" class="story-bounds" group="a" style="flex: 1" >
|
|
34
|
-
Just a few words.
|
|
35
|
-
</PxSyncHeight>
|
|
36
|
-
<PxSyncHeight v-bind="args" class="story-bounds" group="a" style="flex: 1" >
|
|
37
|
-
And even fewer.
|
|
38
|
-
</PxSyncHeight>
|
|
39
|
-
</div>
|
|
40
|
-
|
|
41
|
-
`,
|
|
42
|
-
}),
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
// export const Advanced = {
|
|
46
|
-
// ...Basic,
|
|
47
|
-
// // args: { ... },
|
|
48
|
-
// };
|
|
@@ -1,145 +0,0 @@
|
|
|
1
|
-
import PxTable from '@/components/PxTable.vue';
|
|
2
|
-
import { extractArgTypes } from '@/storybook/sb-utils.js';
|
|
3
|
-
import { fruitsPlusPlus, fruitsOneHundred } from '@/storybook/sb-sampledata.js';
|
|
4
|
-
|
|
5
|
-
export default {
|
|
6
|
-
title: 'PxTable',
|
|
7
|
-
component: PxTable,
|
|
8
|
-
// decorators: [ ... ],
|
|
9
|
-
// parameters: { ... },
|
|
10
|
-
|
|
11
|
-
// https://storybook.js.org/docs/vue/essentials/controls#annotation
|
|
12
|
-
// https://storybook.js.org/docs/vue/api/argtypes#available-properties
|
|
13
|
-
argTypes: {
|
|
14
|
-
...extractArgTypes(PxTable),
|
|
15
|
-
// someProp: { type: 'select', options: ['one', 'two', 'three'] }
|
|
16
|
-
},
|
|
17
|
-
args: {
|
|
18
|
-
// label: 'Hello',
|
|
19
|
-
// onClick: () => {}),
|
|
20
|
-
},
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
export const Basic = {
|
|
24
|
-
render: (args, { argTypes }) => ({
|
|
25
|
-
components: { PxTable },
|
|
26
|
-
data() {
|
|
27
|
-
return {
|
|
28
|
-
fruits: fruitsPlusPlus,
|
|
29
|
-
};
|
|
30
|
-
},
|
|
31
|
-
setup() {
|
|
32
|
-
return { args };
|
|
33
|
-
},
|
|
34
|
-
methods: {
|
|
35
|
-
onSort(e) {
|
|
36
|
-
function moveElement(arr, oldIndex, newIndex) {
|
|
37
|
-
if (
|
|
38
|
-
oldIndex < 0 ||
|
|
39
|
-
newIndex < 0 ||
|
|
40
|
-
oldIndex >= arr.length ||
|
|
41
|
-
newIndex >= arr.length
|
|
42
|
-
) {
|
|
43
|
-
console.log('Invalid indices');
|
|
44
|
-
return;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
// Removing the element from its original position
|
|
48
|
-
const element = arr.splice(oldIndex, 1)[0];
|
|
49
|
-
|
|
50
|
-
// Inserting the element at its new position
|
|
51
|
-
arr.splice(newIndex, 0, element);
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
moveElement(this.fruits, e.oldDraggableIndex, e.newDraggableIndex);
|
|
55
|
-
},
|
|
56
|
-
},
|
|
57
|
-
template: `
|
|
58
|
-
<PxTable v-bind="args"
|
|
59
|
-
:items="fruits"
|
|
60
|
-
:columns="[
|
|
61
|
-
{ label: 'Index', template: 'index', size: '4em', },
|
|
62
|
-
{ label: 'Thumb', template: 'thumb' },
|
|
63
|
-
{ label: 'Fruit Name', property: 'name' },
|
|
64
|
-
{ label: 'Description', property: 'description', overflow: 'ellipsis' },
|
|
65
|
-
{ label: 'Purchased', property: 'lastPurchase', align: 'right'},
|
|
66
|
-
{ property: 'deliciousness', label: 'Deliciousness' },
|
|
67
|
-
{ label: 'Good', value: item => item.deliciousness > 5, align: 'center' },
|
|
68
|
-
]"
|
|
69
|
-
:dragEnabled="true"
|
|
70
|
-
>
|
|
71
|
-
<template #index="{ index }">
|
|
72
|
-
{{ index }}
|
|
73
|
-
</template>
|
|
74
|
-
|
|
75
|
-
<template #thumb="{ item }" >
|
|
76
|
-
<img :src="item.image" style="width: 3em; height: 3em; object-fit: cover; border-radius: 50%;">
|
|
77
|
-
</template>
|
|
78
|
-
|
|
79
|
-
<template #deliciousness="{ item }" >
|
|
80
|
-
<span v-for="idx in item.deliciousness" :key="idx" :style="{ background: 'currentColor', display: 'inline-block', width: '0.25em', height: '0.75em', marginLeft: '0.1em' }" />
|
|
81
|
-
</template>
|
|
82
|
-
|
|
83
|
-
<template #expand="{ item }">
|
|
84
|
-
<div style="padding: 1em">
|
|
85
|
-
<h2>{{ item.name }}</h2>
|
|
86
|
-
<p>{{ item.description }}</p>
|
|
87
|
-
</div>
|
|
88
|
-
</template>
|
|
89
|
-
|
|
90
|
-
</PxTable>`,
|
|
91
|
-
}),
|
|
92
|
-
};
|
|
93
|
-
|
|
94
|
-
export const FixedHeader = {
|
|
95
|
-
render: (args, { argTypes }) => ({
|
|
96
|
-
components: { PxTable },
|
|
97
|
-
data() {
|
|
98
|
-
return {
|
|
99
|
-
fruits: fruitsOneHundred,
|
|
100
|
-
};
|
|
101
|
-
},
|
|
102
|
-
setup() {
|
|
103
|
-
return { args };
|
|
104
|
-
},
|
|
105
|
-
methods: {
|
|
106
|
-
onSort(e) {
|
|
107
|
-
function moveElement(arr, oldIndex, newIndex) {
|
|
108
|
-
if (
|
|
109
|
-
oldIndex < 0 ||
|
|
110
|
-
newIndex < 0 ||
|
|
111
|
-
oldIndex >= arr.length ||
|
|
112
|
-
newIndex >= arr.length
|
|
113
|
-
) {
|
|
114
|
-
console.log('Invalid indices');
|
|
115
|
-
return;
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
// Removing the element from its original position
|
|
119
|
-
const element = arr.splice(oldIndex, 1)[0];
|
|
120
|
-
|
|
121
|
-
// Inserting the element at its new position
|
|
122
|
-
arr.splice(newIndex, 0, element);
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
moveElement(this.fruits, e.oldDraggableIndex, e.newDraggableIndex);
|
|
126
|
-
},
|
|
127
|
-
},
|
|
128
|
-
template: `
|
|
129
|
-
|
|
130
|
-
<PxTable v-bind="args"
|
|
131
|
-
:items="fruits"
|
|
132
|
-
:fixedHeader="true"
|
|
133
|
-
>
|
|
134
|
-
<template #color="{ item }">
|
|
135
|
-
<div :style="{ background: item.color, width: '1.5em', height: '1.5em', borderRadius: '50%' }"></div>
|
|
136
|
-
</template>
|
|
137
|
-
</PxTable>
|
|
138
|
-
`,
|
|
139
|
-
}),
|
|
140
|
-
};
|
|
141
|
-
|
|
142
|
-
// export const Advanced = {
|
|
143
|
-
// ...Basic,
|
|
144
|
-
// // args: { ... },
|
|
145
|
-
// };
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import PxTextbox from '@/components/PxTextbox.vue';
|
|
2
|
-
import { extractArgTypes } from '@/storybook/sb-utils.js';
|
|
3
|
-
|
|
4
|
-
export default {
|
|
5
|
-
component: PxTextbox,
|
|
6
|
-
// decorators: [ ... ],
|
|
7
|
-
// parameters: { ... },
|
|
8
|
-
|
|
9
|
-
// https://storybook.js.org/docs/vue/essentials/controls#annotation
|
|
10
|
-
// https://storybook.js.org/docs/vue/api/argtypes#available-properties
|
|
11
|
-
argTypes: {
|
|
12
|
-
...extractArgTypes(PxTextbox),
|
|
13
|
-
},
|
|
14
|
-
args: {
|
|
15
|
-
placeholder: 'Type something...',
|
|
16
|
-
|
|
17
|
-
// onClick: () => {}),
|
|
18
|
-
},
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
export const Basic = {
|
|
22
|
-
// name: 'Story Name',
|
|
23
|
-
render: (args, { argTypes }) => ({
|
|
24
|
-
components: { PxTextbox },
|
|
25
|
-
setup() {
|
|
26
|
-
return { args };
|
|
27
|
-
},
|
|
28
|
-
data() {
|
|
29
|
-
return { sampleText: '' };
|
|
30
|
-
},
|
|
31
|
-
template: `<input v-model="sampleText" /> <br><br> <PxTextbox v-model:text="sampleText" v-bind="args"/> <br> <br> <PxTextbox :multiline="true" v-model:text="sampleText" v-bind="args"/> <br> <br> {{sampleText}}`,
|
|
32
|
-
args: {},
|
|
33
|
-
}),
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
export const Placeholder = {
|
|
37
|
-
...Basic,
|
|
38
|
-
args: { value: '' },
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
export const Disabled = {
|
|
42
|
-
...Basic,
|
|
43
|
-
args: { disabled: true },
|
|
44
|
-
};
|
|
45
|
-
|
|
46
|
-
export const Readonly = {
|
|
47
|
-
...Basic,
|
|
48
|
-
args: { readonly: true },
|
|
49
|
-
};
|
|
50
|
-
|
|
51
|
-
export const Multiline = {
|
|
52
|
-
...Basic,
|
|
53
|
-
args: { multiline: true, showResize: true, autoResize: true, cols: 50 },
|
|
54
|
-
};
|
|
55
|
-
|
|
56
|
-
// export const Advanced = {
|
|
57
|
-
// ...Basic,
|
|
58
|
-
// // args: { ... },
|
|
59
|
-
// };
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
import PxToggle from '@/components/PxToggle.vue';
|
|
2
|
-
import { extractArgTypes } from '@/storybook/sb-utils.js';
|
|
3
|
-
|
|
4
|
-
export default {
|
|
5
|
-
title: 'PxToggle',
|
|
6
|
-
component: PxToggle,
|
|
7
|
-
// decorators: [ ... ],
|
|
8
|
-
// parameters: { ... },
|
|
9
|
-
|
|
10
|
-
// https://storybook.js.org/docs/vue/essentials/controls#annotation
|
|
11
|
-
// https://storybook.js.org/docs/vue/api/argtypes#available-properties
|
|
12
|
-
argTypes: {
|
|
13
|
-
...extractArgTypes(PxToggle),
|
|
14
|
-
// someProp: { type: 'select', options: ['one', 'two', 'three'] }
|
|
15
|
-
},
|
|
16
|
-
args: {
|
|
17
|
-
label: 'Clicking is cool.',
|
|
18
|
-
// onClick: () => {}),
|
|
19
|
-
},
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
export const Basic = {
|
|
23
|
-
render: (args, { argTypes }) => ({
|
|
24
|
-
components: { PxToggle },
|
|
25
|
-
setup() {
|
|
26
|
-
return { args };
|
|
27
|
-
},
|
|
28
|
-
data() {
|
|
29
|
-
return {
|
|
30
|
-
isChecked: true,
|
|
31
|
-
};
|
|
32
|
-
},
|
|
33
|
-
template: `
|
|
34
|
-
<div class="story-flex">
|
|
35
|
-
<PxToggle v-bind="args" v-model:checked="isChecked" /> <span>Local v-model value: {{ isChecked }}</span>
|
|
36
|
-
</div>
|
|
37
|
-
`,
|
|
38
|
-
}),
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
export const DefaultSlot = {
|
|
42
|
-
render: (args, { argTypes }) => ({
|
|
43
|
-
components: { PxToggle },
|
|
44
|
-
setup() {
|
|
45
|
-
return { args };
|
|
46
|
-
},
|
|
47
|
-
template: `
|
|
48
|
-
<PxToggle v-bind="args">
|
|
49
|
-
<template #default="{checked}">
|
|
50
|
-
I am checked: {{ checked }}
|
|
51
|
-
</template>
|
|
52
|
-
</PxToggle>`,
|
|
53
|
-
}),
|
|
54
|
-
};
|
|
55
|
-
|
|
56
|
-
export const OnOffSlot = {
|
|
57
|
-
render: (args, { argTypes }) => ({
|
|
58
|
-
components: { PxToggle },
|
|
59
|
-
setup() {
|
|
60
|
-
return { args };
|
|
61
|
-
},
|
|
62
|
-
template: `
|
|
63
|
-
<PxToggle v-bind="args">
|
|
64
|
-
<template #on-label>
|
|
65
|
-
I am checked baby!
|
|
66
|
-
</template>
|
|
67
|
-
<template #off-label>
|
|
68
|
-
Sadly, I am not checked.
|
|
69
|
-
</template>
|
|
70
|
-
</PxToggle>`,
|
|
71
|
-
}),
|
|
72
|
-
};
|
|
73
|
-
|
|
74
|
-
// export const Advanced = {
|
|
75
|
-
// ...Basic,
|
|
76
|
-
// // args: { ... },
|
|
77
|
-
// };
|
|
@@ -1,109 +0,0 @@
|
|
|
1
|
-
import PxToggleButton from '@/components/PxToggleButton.vue';
|
|
2
|
-
import { extractArgTypes } from '@/storybook/sb-utils.js';
|
|
3
|
-
import { svgCheck, svgX } from '../utils/svgIcons';
|
|
4
|
-
|
|
5
|
-
export default {
|
|
6
|
-
component: PxToggleButton,
|
|
7
|
-
// decorators: [ ... ],
|
|
8
|
-
// parameters: { ... },
|
|
9
|
-
|
|
10
|
-
// https://storybook.js.org/docs/vue/essentials/controls#annotation
|
|
11
|
-
// https://storybook.js.org/docs/vue/api/argtypes#available-properties
|
|
12
|
-
argTypes: {
|
|
13
|
-
...extractArgTypes(PxToggleButton),
|
|
14
|
-
// someProp: { type: 'select', options: ['one', 'two', 'three'] }
|
|
15
|
-
},
|
|
16
|
-
args: {
|
|
17
|
-
label: 'Yes',
|
|
18
|
-
labelUnchecked: 'No',
|
|
19
|
-
icon: svgCheck({ angle: 42 }),
|
|
20
|
-
iconUnchecked: svgX(),
|
|
21
|
-
// onClick: () => {}),
|
|
22
|
-
},
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
export const States = {
|
|
26
|
-
// name: 'Story Name',
|
|
27
|
-
render: (args, { argTypes }) => ({
|
|
28
|
-
components: { PxToggleButton },
|
|
29
|
-
setup() {
|
|
30
|
-
return { args };
|
|
31
|
-
},
|
|
32
|
-
template: `
|
|
33
|
-
<div class="story-flex">
|
|
34
|
-
<PxToggleButton v-bind="args" />
|
|
35
|
-
<PxToggleButton v-bind="args" labelUnchecked="No Way Dude" />
|
|
36
|
-
</div>
|
|
37
|
-
`,
|
|
38
|
-
}),
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
export const Basic = {
|
|
42
|
-
// name: 'Story Name',
|
|
43
|
-
render: (args, { argTypes }) => ({
|
|
44
|
-
components: { PxToggleButton },
|
|
45
|
-
setup() {
|
|
46
|
-
return { args };
|
|
47
|
-
},
|
|
48
|
-
template: `<PxToggleButton v-bind="args" />`,
|
|
49
|
-
}),
|
|
50
|
-
};
|
|
51
|
-
|
|
52
|
-
export const Checked = {
|
|
53
|
-
...Basic,
|
|
54
|
-
args: { checked: true },
|
|
55
|
-
};
|
|
56
|
-
|
|
57
|
-
export const Model = {
|
|
58
|
-
...Basic,
|
|
59
|
-
args: { checked: true },
|
|
60
|
-
render: (args, { argTypes }) => ({
|
|
61
|
-
setup() {
|
|
62
|
-
return { args };
|
|
63
|
-
},
|
|
64
|
-
data() {
|
|
65
|
-
return { isChecked: false };
|
|
66
|
-
},
|
|
67
|
-
components: { PxToggleButton },
|
|
68
|
-
template: `
|
|
69
|
-
<div>
|
|
70
|
-
<p>Checked: {{ isChecked }}</p>
|
|
71
|
-
<PxToggleButton v-bind="args" v-model:checked="isChecked" />
|
|
72
|
-
</div>
|
|
73
|
-
`,
|
|
74
|
-
}),
|
|
75
|
-
};
|
|
76
|
-
|
|
77
|
-
export const NoIcon = {
|
|
78
|
-
...Basic,
|
|
79
|
-
args: { icon: null },
|
|
80
|
-
};
|
|
81
|
-
|
|
82
|
-
export const LongTextNoIcon = {
|
|
83
|
-
...Basic,
|
|
84
|
-
args: { label: 'This Button is Checked', labelUnchecked: '', icon: '' },
|
|
85
|
-
};
|
|
86
|
-
|
|
87
|
-
export const LongTextHasIconUnchecked = {
|
|
88
|
-
...Basic,
|
|
89
|
-
args: { label: 'This Button is Checked', labelUnchecked: '', checked: false },
|
|
90
|
-
};
|
|
91
|
-
|
|
92
|
-
export const LongTextChecked = {
|
|
93
|
-
...Basic,
|
|
94
|
-
args: { label: 'This Button is Checked', checked: true },
|
|
95
|
-
};
|
|
96
|
-
|
|
97
|
-
export const Disabled = {
|
|
98
|
-
...Basic,
|
|
99
|
-
args: { disabled: true },
|
|
100
|
-
};
|
|
101
|
-
|
|
102
|
-
export const DisabledAndChecked = {
|
|
103
|
-
...Basic,
|
|
104
|
-
args: { checked: true, disabled: true },
|
|
105
|
-
};
|
|
106
|
-
export const OutlineVariant = {
|
|
107
|
-
...Basic,
|
|
108
|
-
args: { variant: 'outline' },
|
|
109
|
-
};
|