@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,102 +0,0 @@
|
|
|
1
|
-
import PxToggleButtonList from '@/components/PxToggleButtonList.vue';
|
|
2
|
-
import { extractArgTypes } from '@/storybook/sb-utils.js';
|
|
3
|
-
import { fruits } from '@/storybook/sb-sampledata.js';
|
|
4
|
-
import CheckSvg from '../assets/feather/check.svg';
|
|
5
|
-
|
|
6
|
-
export default {
|
|
7
|
-
component: PxToggleButtonList,
|
|
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
|
-
|
|
14
|
-
argTypes: {
|
|
15
|
-
...extractArgTypes(PxToggleButtonList),
|
|
16
|
-
// someProp: { type: 'select', options: ['one', 'two', 'three'] }
|
|
17
|
-
},
|
|
18
|
-
args: {
|
|
19
|
-
items: fruits,
|
|
20
|
-
// label: 'Hello',
|
|
21
|
-
// onClick: () => {}),
|
|
22
|
-
},
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
export const Basic = {
|
|
26
|
-
// name: 'Story Name',
|
|
27
|
-
render: (args, { argTypes }) => ({
|
|
28
|
-
setup() {
|
|
29
|
-
return { args };
|
|
30
|
-
},
|
|
31
|
-
data() {
|
|
32
|
-
return { mySelected: fruits[1].id };
|
|
33
|
-
},
|
|
34
|
-
components: { PxToggleButtonList },
|
|
35
|
-
template: `
|
|
36
|
-
<p>Selected: {{ mySelected }}</p>
|
|
37
|
-
<PxToggleButtonList v-bind="args" v-model:selected="mySelected" />
|
|
38
|
-
`,
|
|
39
|
-
}),
|
|
40
|
-
};
|
|
41
|
-
|
|
42
|
-
export const Multiselect = {
|
|
43
|
-
...Basic,
|
|
44
|
-
args: { multiSelect: true },
|
|
45
|
-
};
|
|
46
|
-
export const AutoSelectFirst = {
|
|
47
|
-
// name: 'Story Name',
|
|
48
|
-
render: (args, { argTypes }) => ({
|
|
49
|
-
setup() {
|
|
50
|
-
return { args };
|
|
51
|
-
},
|
|
52
|
-
|
|
53
|
-
data() {
|
|
54
|
-
return { mySelected: null };
|
|
55
|
-
},
|
|
56
|
-
components: { PxToggleButtonList },
|
|
57
|
-
template: `
|
|
58
|
-
<p>Selected: {{ mySelected }}</p>
|
|
59
|
-
<PxToggleButtonList v-bind="args" v-model:selected="mySelected" />
|
|
60
|
-
`,
|
|
61
|
-
}),
|
|
62
|
-
args: { autoSelectFirst: true },
|
|
63
|
-
};
|
|
64
|
-
|
|
65
|
-
export const ConnectedVariant = {
|
|
66
|
-
...Basic,
|
|
67
|
-
args: { variant: 'default connected' },
|
|
68
|
-
};
|
|
69
|
-
|
|
70
|
-
export const MultiselectConnectedVariant = {
|
|
71
|
-
...Basic,
|
|
72
|
-
args: { multiSelect: true, variant: 'default connected' },
|
|
73
|
-
};
|
|
74
|
-
|
|
75
|
-
export const Check = {
|
|
76
|
-
...Basic,
|
|
77
|
-
args: { icon: CheckSvg },
|
|
78
|
-
};
|
|
79
|
-
|
|
80
|
-
export const ConnectedVariantCheck = {
|
|
81
|
-
...Basic,
|
|
82
|
-
args: { icon: CheckSvg, variant: 'default connected' },
|
|
83
|
-
};
|
|
84
|
-
|
|
85
|
-
export const MultiselectConnectedVariantCheck = {
|
|
86
|
-
...Basic,
|
|
87
|
-
args: { multiSelect: true, variant: 'default connected', icon: CheckSvg },
|
|
88
|
-
};
|
|
89
|
-
export const OutlineVariant = {
|
|
90
|
-
...Basic,
|
|
91
|
-
args: { variant: 'outline' },
|
|
92
|
-
};
|
|
93
|
-
|
|
94
|
-
export const OutlineVariantCheck = {
|
|
95
|
-
...Basic,
|
|
96
|
-
args: { variant: 'outline', icon: CheckSvg },
|
|
97
|
-
};
|
|
98
|
-
|
|
99
|
-
// export const Advanced = {
|
|
100
|
-
// ...Basic,
|
|
101
|
-
// // args: { ... },
|
|
102
|
-
// };
|
|
@@ -1,351 +0,0 @@
|
|
|
1
|
-
// Reference:
|
|
2
|
-
// https://storybook.js.org/blog/storybook-7-docs/
|
|
3
|
-
// https://storybook.js.org/docs/7.5/writing-docs/autodocs
|
|
4
|
-
|
|
5
|
-
import { ref } from 'vue';
|
|
6
|
-
import PxToolPanel from '@/components/PxToolPanel.vue';
|
|
7
|
-
import PxToggleButton from '@/components/PxToggleButton.vue';
|
|
8
|
-
import { extractArgTypes } from '@/storybook/sb-utils.js';
|
|
9
|
-
|
|
10
|
-
export default {
|
|
11
|
-
title: 'Components/PxToolPanel',
|
|
12
|
-
component: PxToolPanel,
|
|
13
|
-
argTypes: {
|
|
14
|
-
title: { control: 'text' },
|
|
15
|
-
allowResize: {
|
|
16
|
-
control: 'select',
|
|
17
|
-
options: ['N', 'S', 'E', 'W', 'NS', 'EW', 'NSEW', 'NEWS', 'SWEN'],
|
|
18
|
-
},
|
|
19
|
-
showHeader: { control: 'boolean' },
|
|
20
|
-
teleportToBody: { control: 'boolean' },
|
|
21
|
-
minWidth: { control: 'number' },
|
|
22
|
-
minHeight: { control: 'number' },
|
|
23
|
-
constrainingRect: { control: 'object' },
|
|
24
|
-
bounds: { control: 'object' },
|
|
25
|
-
},
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
const Basic = {
|
|
29
|
-
args: {
|
|
30
|
-
title: 'Basic Panel',
|
|
31
|
-
allowResize: 'NSEW',
|
|
32
|
-
showHeader: true,
|
|
33
|
-
bounds: { x: 50, y: 50, width: 300, height: 200 },
|
|
34
|
-
},
|
|
35
|
-
render: (args, { argTypes }) => ({
|
|
36
|
-
components: { PxToolPanel },
|
|
37
|
-
setup() {
|
|
38
|
-
return { args };
|
|
39
|
-
},
|
|
40
|
-
template: `
|
|
41
|
-
<div class="drag-container">
|
|
42
|
-
<PxToolPanel v-bind="args">
|
|
43
|
-
<div class="panel-content">
|
|
44
|
-
<p>Basic panel with all resize handles enabled</p>
|
|
45
|
-
</div>
|
|
46
|
-
</PxToolPanel>
|
|
47
|
-
</div>
|
|
48
|
-
`,
|
|
49
|
-
}),
|
|
50
|
-
};
|
|
51
|
-
|
|
52
|
-
export const WithCustomHeader = {
|
|
53
|
-
...Basic,
|
|
54
|
-
args: {
|
|
55
|
-
...Basic.args,
|
|
56
|
-
headerClass: 'custom-header',
|
|
57
|
-
},
|
|
58
|
-
render: (args, { argTypes }) => ({
|
|
59
|
-
components: { PxToolPanel },
|
|
60
|
-
setup() {
|
|
61
|
-
return { args };
|
|
62
|
-
},
|
|
63
|
-
template: `
|
|
64
|
-
<div class="drag-container">
|
|
65
|
-
<PxToolPanel v-bind="args">
|
|
66
|
-
<template #header="{ title }">
|
|
67
|
-
<div style="display: flex; align-items: center; justify-content: space-between; width: 100%;">
|
|
68
|
-
<span>{{ title }}</span>
|
|
69
|
-
<button>⚙️</button>
|
|
70
|
-
</div>
|
|
71
|
-
</template>
|
|
72
|
-
<div class="panel-content">
|
|
73
|
-
<p>Panel with custom header template</p>
|
|
74
|
-
</div>
|
|
75
|
-
</PxToolPanel>
|
|
76
|
-
</div>
|
|
77
|
-
`,
|
|
78
|
-
}),
|
|
79
|
-
};
|
|
80
|
-
|
|
81
|
-
export const WithoutHeader = {
|
|
82
|
-
...Basic,
|
|
83
|
-
args: {
|
|
84
|
-
...Basic.args,
|
|
85
|
-
allowResize: 'NEWS',
|
|
86
|
-
showHeader: false,
|
|
87
|
-
},
|
|
88
|
-
};
|
|
89
|
-
|
|
90
|
-
export const AllResizeHandles = {
|
|
91
|
-
...Basic,
|
|
92
|
-
args: {
|
|
93
|
-
...Basic.args,
|
|
94
|
-
allowResize: 'NSEW',
|
|
95
|
-
title: 'All Resize Handles',
|
|
96
|
-
},
|
|
97
|
-
};
|
|
98
|
-
|
|
99
|
-
export const HorizontalResizeOnly = {
|
|
100
|
-
...Basic,
|
|
101
|
-
args: {
|
|
102
|
-
...Basic.args,
|
|
103
|
-
allowResize: 'EW',
|
|
104
|
-
title: 'Horizontal Resize Only',
|
|
105
|
-
},
|
|
106
|
-
};
|
|
107
|
-
|
|
108
|
-
export const VerticalResizeOnly = {
|
|
109
|
-
...Basic,
|
|
110
|
-
args: {
|
|
111
|
-
...Basic.args,
|
|
112
|
-
allowResize: 'NS',
|
|
113
|
-
title: 'Vertical Resize Only',
|
|
114
|
-
},
|
|
115
|
-
};
|
|
116
|
-
|
|
117
|
-
export const CustomResizeHandleWidth = {
|
|
118
|
-
...Basic,
|
|
119
|
-
args: {
|
|
120
|
-
...Basic.args,
|
|
121
|
-
allowResize: 'NSEW',
|
|
122
|
-
title: 'Custom Resize Handle Width',
|
|
123
|
-
},
|
|
124
|
-
parameters: {
|
|
125
|
-
customCSS: `
|
|
126
|
-
.drag-container { width: 100%; height: 800px; position: relative; border: 1px dashed gray; }
|
|
127
|
-
.custom-resize-handles .px-tool-panel {
|
|
128
|
-
--px-tool-panel-resize-width: 20px;
|
|
129
|
-
}
|
|
130
|
-
`,
|
|
131
|
-
},
|
|
132
|
-
render: (args, { argTypes }) => ({
|
|
133
|
-
components: { PxToolPanel },
|
|
134
|
-
setup() {
|
|
135
|
-
return { args };
|
|
136
|
-
},
|
|
137
|
-
template: `
|
|
138
|
-
<div class="drag-container custom-resize-handles">
|
|
139
|
-
<PxToolPanel v-bind="args">
|
|
140
|
-
<div class="panel-content">
|
|
141
|
-
<p>Panel with larger resize handles (20px)</p>
|
|
142
|
-
<p>The resize handles should be visibly larger than other stories.</p>
|
|
143
|
-
</div>
|
|
144
|
-
</PxToolPanel>
|
|
145
|
-
</div>
|
|
146
|
-
`,
|
|
147
|
-
}),
|
|
148
|
-
};
|
|
149
|
-
|
|
150
|
-
export const ConstrainedMovement = {
|
|
151
|
-
...Basic,
|
|
152
|
-
args: {
|
|
153
|
-
...Basic.args,
|
|
154
|
-
title: 'Constrained Panel',
|
|
155
|
-
constrainingRect: { x: 100, y: 100, width: 600, height: 400 },
|
|
156
|
-
bounds: { x: 150, y: 150, width: 300, height: 200 },
|
|
157
|
-
},
|
|
158
|
-
render: (args, { argTypes }) => ({
|
|
159
|
-
components: { PxToolPanel },
|
|
160
|
-
setup() {
|
|
161
|
-
return { args };
|
|
162
|
-
},
|
|
163
|
-
template: `
|
|
164
|
-
<div class="drag-container">
|
|
165
|
-
<!-- Visual representation of the constraining rect -->
|
|
166
|
-
<div
|
|
167
|
-
style="
|
|
168
|
-
position: absolute;
|
|
169
|
-
left: 100px;
|
|
170
|
-
top: 100px;
|
|
171
|
-
width: 600px;
|
|
172
|
-
height: 400px;
|
|
173
|
-
border: 2px dashed #666;
|
|
174
|
-
background: rgba(0,0,0,0.05);
|
|
175
|
-
"
|
|
176
|
-
></div>
|
|
177
|
-
<PxToolPanel v-bind="args">
|
|
178
|
-
<div class="panel-content">
|
|
179
|
-
<p>This panel is constrained within the dashed rectangle</p>
|
|
180
|
-
</div>
|
|
181
|
-
</PxToolPanel>
|
|
182
|
-
</div>
|
|
183
|
-
`,
|
|
184
|
-
}),
|
|
185
|
-
};
|
|
186
|
-
|
|
187
|
-
export const MultiplePanels = {
|
|
188
|
-
...Basic,
|
|
189
|
-
parameters: {
|
|
190
|
-
customCSS: `
|
|
191
|
-
.drag-container { width: min(100%, 800px); height: 800px; position: relative; border: 1px dashed gray; padding: 1em; }
|
|
192
|
-
`,
|
|
193
|
-
},
|
|
194
|
-
render: (args, { argTypes }) => ({
|
|
195
|
-
components: { PxToolPanel },
|
|
196
|
-
setup() {
|
|
197
|
-
return { args };
|
|
198
|
-
},
|
|
199
|
-
template: `
|
|
200
|
-
<div class="drag-container">
|
|
201
|
-
<PxToolPanel
|
|
202
|
-
v-bind="args"
|
|
203
|
-
title="Panel 1"
|
|
204
|
-
:bounds="{ x: 50, y: 50, width: 300, height: 200 }"
|
|
205
|
-
allowResize="NSEW"
|
|
206
|
-
>
|
|
207
|
-
<div class="panel-content">
|
|
208
|
-
<p>Try interacting with multiple panels</p>
|
|
209
|
-
</div>
|
|
210
|
-
</PxToolPanel>
|
|
211
|
-
<PxToolPanel
|
|
212
|
-
v-bind="args"
|
|
213
|
-
title="Panel 2"
|
|
214
|
-
:bounds="{ x: 400, y: 50, width: 300, height: 200 }"
|
|
215
|
-
allowResize="NSEW"
|
|
216
|
-
>
|
|
217
|
-
<div class="panel-content">
|
|
218
|
-
<p>Panels can be moved and resized independently</p>
|
|
219
|
-
</div>
|
|
220
|
-
</PxToolPanel>
|
|
221
|
-
</div>
|
|
222
|
-
`,
|
|
223
|
-
}),
|
|
224
|
-
};
|
|
225
|
-
|
|
226
|
-
export const TeleportToBody = {
|
|
227
|
-
...Basic,
|
|
228
|
-
args: {
|
|
229
|
-
...Basic.args,
|
|
230
|
-
teleportToBody: true,
|
|
231
|
-
title: 'Teleported Panel',
|
|
232
|
-
allowResize: 'NSEW',
|
|
233
|
-
},
|
|
234
|
-
render: (args, { argTypes }) => ({
|
|
235
|
-
components: { PxToolPanel, PxToggleButton },
|
|
236
|
-
setup() {
|
|
237
|
-
const showPanel = ref(false);
|
|
238
|
-
return { args, showPanel };
|
|
239
|
-
},
|
|
240
|
-
template: `
|
|
241
|
-
<div>
|
|
242
|
-
<div class="drag-container">
|
|
243
|
-
<p>Click the button below to show a panel that will be teleported to the body element.</p>
|
|
244
|
-
<p>This is the original container. When shown, the panel can move outside of it.</p>
|
|
245
|
-
<p>Panel visible: {{ showPanel }}</p>
|
|
246
|
-
<PxToggleButton v-model:checked="showPanel">
|
|
247
|
-
{{ showPanel ? 'Hide Panel' : 'Show Panel' }}
|
|
248
|
-
</PxToggleButton>
|
|
249
|
-
<PxToolPanel v-if="showPanel" v-bind="args">
|
|
250
|
-
<div class="panel-content">
|
|
251
|
-
<p>This panel is rendered directly in the body element.</p>
|
|
252
|
-
<p>You can drag it anywhere on the page!</p>
|
|
253
|
-
</div>
|
|
254
|
-
</PxToolPanel>
|
|
255
|
-
</div>
|
|
256
|
-
</div>
|
|
257
|
-
`,
|
|
258
|
-
}),
|
|
259
|
-
};
|
|
260
|
-
|
|
261
|
-
export const ContentConstrainedSize = {
|
|
262
|
-
...Basic,
|
|
263
|
-
args: {
|
|
264
|
-
...Basic.args,
|
|
265
|
-
allowResize: 'NSEW',
|
|
266
|
-
title: 'Content-Constrained Size',
|
|
267
|
-
bounds: { x: 100, y: 100, width: 200, height: 200 }, // Intentionally smaller than minWidth/minHeight
|
|
268
|
-
minWidth: 300,
|
|
269
|
-
minHeight: 300,
|
|
270
|
-
},
|
|
271
|
-
parameters: {
|
|
272
|
-
customCSS: `
|
|
273
|
-
.drag-container { width: min(100%, 800px); height: 800px; position: relative; border: 1px dashed gray; padding: 1em; }
|
|
274
|
-
.content-constrained {
|
|
275
|
-
padding: 1em;
|
|
276
|
-
}
|
|
277
|
-
.content-constrained p {
|
|
278
|
-
margin: 0.5em 0;
|
|
279
|
-
}
|
|
280
|
-
`,
|
|
281
|
-
},
|
|
282
|
-
render: (args, { argTypes }) => ({
|
|
283
|
-
components: { PxToolPanel },
|
|
284
|
-
setup() {
|
|
285
|
-
return { args };
|
|
286
|
-
},
|
|
287
|
-
template: `
|
|
288
|
-
<div class="drag-container">
|
|
289
|
-
<PxToolPanel v-bind="args">
|
|
290
|
-
<div class="panel-content content-constrained">
|
|
291
|
-
<p>Size-Constrained Panel</p>
|
|
292
|
-
<p>Try resizing the panel smaller than the minimum dimensions.</p>
|
|
293
|
-
</div>
|
|
294
|
-
</PxToolPanel>
|
|
295
|
-
</div>
|
|
296
|
-
`,
|
|
297
|
-
}),
|
|
298
|
-
};
|
|
299
|
-
|
|
300
|
-
export const AutoHeight = {
|
|
301
|
-
...Basic,
|
|
302
|
-
args: {
|
|
303
|
-
...Basic.args,
|
|
304
|
-
allowResize: 'EW', // Only allow horizontal resizing
|
|
305
|
-
title: 'Auto Height Panel',
|
|
306
|
-
bounds: {
|
|
307
|
-
x: 50,
|
|
308
|
-
y: 50,
|
|
309
|
-
width: 300, // Initial width
|
|
310
|
-
height: null, // null height for auto sizing
|
|
311
|
-
},
|
|
312
|
-
},
|
|
313
|
-
parameters: {
|
|
314
|
-
customCSS: `
|
|
315
|
-
.drag-container { width: min(100%, 800px); height: 800px; position: relative; border: 1px dashed gray; padding: 1em; }
|
|
316
|
-
.auto-height-content {
|
|
317
|
-
padding: 1em;
|
|
318
|
-
}
|
|
319
|
-
.auto-height-content p {
|
|
320
|
-
margin: 0.5em 0;
|
|
321
|
-
}
|
|
322
|
-
.spacer {
|
|
323
|
-
height: 20px;
|
|
324
|
-
}
|
|
325
|
-
`,
|
|
326
|
-
},
|
|
327
|
-
render: (args, { argTypes }) => ({
|
|
328
|
-
components: { PxToolPanel },
|
|
329
|
-
setup() {
|
|
330
|
-
return { args };
|
|
331
|
-
},
|
|
332
|
-
template: `
|
|
333
|
-
<div class="drag-container">
|
|
334
|
-
<PxToolPanel v-bind="args">
|
|
335
|
-
<div class="panel-content auto-height-content">
|
|
336
|
-
<p>This panel's height is determined by its content.</p>
|
|
337
|
-
<p>You can only resize it horizontally.</p>
|
|
338
|
-
<div class="spacer"></div>
|
|
339
|
-
<p>The panel will automatically grow...</p>
|
|
340
|
-
<div class="spacer"></div>
|
|
341
|
-
<p>...or shrink...</p>
|
|
342
|
-
<div class="spacer"></div>
|
|
343
|
-
<p>...to fit its content!</p>
|
|
344
|
-
<div class="spacer"></div>
|
|
345
|
-
<p>Try resizing horizontally - the height will stay fitted to content.</p>
|
|
346
|
-
</div>
|
|
347
|
-
</PxToolPanel>
|
|
348
|
-
</div>
|
|
349
|
-
`,
|
|
350
|
-
}),
|
|
351
|
-
};
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
import PxTransition from '@/components/PxTransition.vue';
|
|
2
|
-
import PxToggle from '@/components/PxToggle.vue';
|
|
3
|
-
import { extractArgTypes } from '@/storybook/sb-utils.js';
|
|
4
|
-
|
|
5
|
-
export default {
|
|
6
|
-
title: 'PxTransition',
|
|
7
|
-
component: PxTransition,
|
|
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(PxTransition),
|
|
15
|
-
// someProp: { type: 'select', options: ['one', 'two', 'three'] }
|
|
16
|
-
},
|
|
17
|
-
args: {
|
|
18
|
-
animation: 'up:50px zoomin',
|
|
19
|
-
duration: 0.3,
|
|
20
|
-
// label: 'Hello',
|
|
21
|
-
// onClick: () => {}),
|
|
22
|
-
},
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
export const Basic = {
|
|
26
|
-
render: (args, { argTypes }) => ({
|
|
27
|
-
components: { PxTransition, PxToggle },
|
|
28
|
-
setup() {
|
|
29
|
-
return { args };
|
|
30
|
-
},
|
|
31
|
-
data() {
|
|
32
|
-
return {
|
|
33
|
-
checked: true,
|
|
34
|
-
};
|
|
35
|
-
},
|
|
36
|
-
template: `
|
|
37
|
-
<div class="story-flex-vert">
|
|
38
|
-
<div class="story-flex">
|
|
39
|
-
<div class="story-flex-vert">
|
|
40
|
-
Reverse
|
|
41
|
-
<div class="story-bounds" style="width: 6em; height: 6em">
|
|
42
|
-
<PxTransition v-bind="args" >
|
|
43
|
-
<div v-show="checked" class="story-circle" />
|
|
44
|
-
</PxTransition>
|
|
45
|
-
</div>
|
|
46
|
-
</div>
|
|
47
|
-
<div class="story-flex-vert">
|
|
48
|
-
Continue
|
|
49
|
-
<div class="story-bounds" style="width: 6em; height: 6em">
|
|
50
|
-
<PxTransition v-bind="args" autoHide="continue">
|
|
51
|
-
<div v-show="checked" class="story-circle" />
|
|
52
|
-
</PxTransition>
|
|
53
|
-
</div>
|
|
54
|
-
</div>
|
|
55
|
-
<div class="story-flex-vert">
|
|
56
|
-
Custom (Right)
|
|
57
|
-
<div class="story-bounds" style="width: 6em; height: 6em">
|
|
58
|
-
<PxTransition v-bind="args" hideAnimation="fade right">
|
|
59
|
-
<div v-show="checked" class="story-circle" />
|
|
60
|
-
</PxTransition>
|
|
61
|
-
</div>
|
|
62
|
-
</div>
|
|
63
|
-
|
|
64
|
-
</div>
|
|
65
|
-
<PxToggle v-model:checked="checked" />
|
|
66
|
-
</div>
|
|
67
|
-
`,
|
|
68
|
-
}),
|
|
69
|
-
};
|
|
70
|
-
|
|
71
|
-
// export const Advanced = {
|
|
72
|
-
// ...Basic,
|
|
73
|
-
// // args: { ... },
|
|
74
|
-
// };
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import PxTransitionExpand from '@/components/PxTransitionExpand.vue';
|
|
2
|
-
import { extractArgTypes } from '@/storybook/sb-utils.js';
|
|
3
|
-
|
|
4
|
-
export default {
|
|
5
|
-
title: '[TODO] PxTransitionExpand',
|
|
6
|
-
component: PxTransitionExpand,
|
|
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(PxTransitionExpand),
|
|
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: { PxTransitionExpand },
|
|
25
|
-
setup() {
|
|
26
|
-
return { args };
|
|
27
|
-
},
|
|
28
|
-
template: `
|
|
29
|
-
<PxTransitionExpand v-bind="args"></PxTransitionExpand>`,
|
|
30
|
-
}),
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
// export const Advanced = {
|
|
34
|
-
// ...Basic,
|
|
35
|
-
// // args: { ... },
|
|
36
|
-
// };
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import PxTransitionItem from '@/components/PxTransitionItem.vue';
|
|
2
|
-
import { extractArgTypes } from '@/storybook/sb-utils.js';
|
|
3
|
-
|
|
4
|
-
export default {
|
|
5
|
-
title: '[TODO] PxTransitionItem',
|
|
6
|
-
component: PxTransitionItem,
|
|
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(PxTransitionItem),
|
|
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: { PxTransitionItem },
|
|
25
|
-
setup() {
|
|
26
|
-
return { args };
|
|
27
|
-
},
|
|
28
|
-
template: `
|
|
29
|
-
<PxTransitionItem v-bind="args"></PxTransitionItem>`,
|
|
30
|
-
}),
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
// export const Advanced = {
|
|
34
|
-
// ...Basic,
|
|
35
|
-
// // args: { ... },
|
|
36
|
-
// };
|
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
import PxValidator from '@/components/PxValidator.vue';
|
|
2
|
-
import PxTextbox from '@/components/PxTextbox.vue';
|
|
3
|
-
import { extractArgTypes } from '@/storybook/sb-utils.js';
|
|
4
|
-
|
|
5
|
-
export default {
|
|
6
|
-
title: 'PxValidator',
|
|
7
|
-
component: PxValidator,
|
|
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(PxValidator),
|
|
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: { PxValidator, PxTextbox },
|
|
26
|
-
setup() {
|
|
27
|
-
return { args };
|
|
28
|
-
},
|
|
29
|
-
|
|
30
|
-
data() {
|
|
31
|
-
return {
|
|
32
|
-
// validation is all data driven so the components need to
|
|
33
|
-
// have data fields associated with them
|
|
34
|
-
fieldOne: '',
|
|
35
|
-
fieldTwo: '',
|
|
36
|
-
|
|
37
|
-
// tracks validation information for all fields on the page
|
|
38
|
-
validation: {},
|
|
39
|
-
};
|
|
40
|
-
},
|
|
41
|
-
computed: {
|
|
42
|
-
fieldWithErrors() {
|
|
43
|
-
return Object.keys(this.validation).filter(key => {
|
|
44
|
-
return !this.validation[key].isValid;
|
|
45
|
-
});
|
|
46
|
-
},
|
|
47
|
-
hasErrors() {
|
|
48
|
-
return this.fieldWithErrors?.length > 0;
|
|
49
|
-
},
|
|
50
|
-
},
|
|
51
|
-
methods: {
|
|
52
|
-
validChanged(validatorData) {
|
|
53
|
-
this.validation = { ...this.validation, [validatorData.fieldId]: validatorData };
|
|
54
|
-
},
|
|
55
|
-
},
|
|
56
|
-
|
|
57
|
-
template: `
|
|
58
|
-
|
|
59
|
-
<div class="story-flex-vert">
|
|
60
|
-
<div>Has errors: {{ hasErrors }}</div>
|
|
61
|
-
|
|
62
|
-
<PxValidator
|
|
63
|
-
:value="fieldOne"
|
|
64
|
-
:active="true"
|
|
65
|
-
rules="required"
|
|
66
|
-
@valid-changed="validChanged"
|
|
67
|
-
>
|
|
68
|
-
<template #default>
|
|
69
|
-
<PxTextbox v-model:value="fieldOne" placeholder="Required" style="width: 30em" />
|
|
70
|
-
</template>
|
|
71
|
-
</PxValidator>
|
|
72
|
-
|
|
73
|
-
<px-validator
|
|
74
|
-
:value="fieldTwo"
|
|
75
|
-
:active="true"
|
|
76
|
-
:rules="{
|
|
77
|
-
apples: (value) => {
|
|
78
|
-
if (value.indexOf('apples') == -1) {
|
|
79
|
-
return 'Must mention the word apples';
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
}"
|
|
83
|
-
@valid-changed="validChanged"
|
|
84
|
-
>
|
|
85
|
-
<template #default="{ validator }">
|
|
86
|
-
<PxTextbox :class="validator.class" v-model:value="fieldTwo" placeholder="Must include 'apples'" style="width: 30em" />
|
|
87
|
-
<pre>
|
|
88
|
-
{{ JSON.stringify(validator, null, 4) }}
|
|
89
|
-
</pre>
|
|
90
|
-
</template>
|
|
91
|
-
</px-validator>
|
|
92
|
-
</div>
|
|
93
|
-
`,
|
|
94
|
-
}),
|
|
95
|
-
};
|
|
96
|
-
|
|
97
|
-
// export const Advanced = {
|
|
98
|
-
// ...Basic,
|
|
99
|
-
// // args: { ... },
|
|
100
|
-
// };
|