@thinkpixellab-public/px-vue 4.0.15 → 4.0.17
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/.storybook/main.js +2 -2
- package/.storybook/preview.js +3 -22
- package/.storybook/preview.scss +1 -255
- package/assets/icons/ellipsis.svg +1 -1
- package/assets/icons/eyedropper.svg +1 -1
- package/bases/PxBaseIconProp.vue +21 -0
- package/bases/PxBaseItemsSelect.vue +0 -1
- package/chromatic.config.json +5 -0
- package/components/PxArrowScroller.vue +3 -3
- package/components/PxCodeSample.vue +7 -0
- package/components/PxColorPalette.vue +9 -5
- package/components/PxColorPaletteButton.vue +0 -3
- package/components/PxColorPicker.vue +5 -0
- package/components/PxFloat.vue +16 -9
- package/components/PxIcon.vue +1 -1
- package/components/PxIconButton.vue +1 -1
- package/components/PxQrCode.vue +1 -0
- package/components/PxTable.vue +3 -1
- package/components/PxToggle.vue +4 -0
- package/components/PxToggleButton.vue +150 -57
- package/package.json +78 -72
- package/stories/PxAnimate.stories.js +3 -3
- package/stories/PxArrow.stories.js +1 -1
- package/stories/PxArrowScroller.stories.js +3 -3
- package/stories/PxAspect.stories.js +3 -3
- package/stories/PxAutoClamp.stories.js +3 -3
- package/stories/PxBalancedText.stories.js +3 -3
- package/stories/PxButton.stories.js +3 -3
- package/stories/PxCalendar.stories.js +3 -3
- package/stories/PxCard.stories.js +3 -3
- package/stories/PxCardGrid.stories.js +4 -4
- package/stories/PxClock.stories.js +3 -3
- package/stories/PxCodeSample.stories.js +3 -3
- package/stories/PxColorPalette.stories.js +3 -3
- package/stories/PxColorPanel.stories.js +6 -20
- package/stories/PxColorPicker.stories.js +10 -13
- package/stories/PxContain.stories.js +3 -3
- package/stories/PxCopyText.stories.js +3 -3
- package/stories/PxDatePicker.stories.js +3 -3
- package/stories/PxDropdown.stories.js +4 -4
- package/stories/PxFit.stories.js +3 -3
- package/stories/PxFlex.stories.js +3 -3
- package/stories/PxFlip.stories.js +3 -3
- package/stories/PxFloat.stories.js +40 -3
- package/stories/PxGsapScrubber.stories.js +3 -3
- package/stories/PxIcon.stories.js +30 -39
- package/stories/PxIconButton.stories.js +3 -3
- package/stories/PxLabeledInput.stories.js +3 -3
- package/stories/PxMeasureContainer.stories.js +3 -3
- package/stories/PxMenu.stories.js +3 -3
- package/stories/PxPivot.stories.js +2 -2
- package/stories/PxPopupButton.stories.js +3 -3
- package/stories/PxProgressCircle.stories.js +3 -3
- package/stories/PxQrCode.stories.js +3 -3
- package/stories/PxRadioButton.stories.js +3 -3
- package/stories/PxResizer.stories.js +3 -3
- package/stories/PxScrubber.stories.js +3 -3
- package/stories/PxSideDrawer.stories.js +3 -3
- package/stories/PxSlides.stories.js +4 -4
- package/stories/PxSpinner.stories.js +3 -3
- package/stories/PxSticky.stories.js +3 -3
- package/stories/PxSvg.stories.js +3 -3
- package/stories/PxSvgRender.stories.js +3 -3
- package/stories/PxSyncHeight.stories.js +3 -3
- package/stories/PxTable.stories.js +4 -4
- package/stories/PxTextbox.stories.js +3 -3
- package/stories/PxToggle.stories.js +3 -3
- package/stories/PxToggleButton.stories.js +22 -3
- package/stories/PxToggleButtonList.stories.js +4 -4
- package/stories/PxTransition.stories.js +3 -3
- package/stories/PxTransitionExpand.stories.js +3 -3
- package/stories/PxTransitionItem.stories.js +3 -3
- package/stories/PxValidator.stories.js +3 -3
- package/stories/makestories.js +3 -3
- package/storybook/sb-styles.scss +174 -0
- package/{stories/helpers/extractArgTypes.js → storybook/sb-utils.js} +1 -1
- package/utils/propsFilter.js +3 -2
- package/utils/svgIcons.js +68 -12
- package/stories/helpers/scratch.vue +0 -30
- /package/{stories/helpers/sampleData.js → storybook/sb-sampledata.js} +0 -0
package/.storybook/main.js
CHANGED
package/.storybook/preview.js
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import { setup } from '@storybook/vue3';
|
|
2
|
-
import { themes } from '@storybook/theming';
|
|
3
2
|
import common from '../plugins/common.js';
|
|
4
|
-
|
|
5
3
|
import './preview.scss';
|
|
6
4
|
|
|
7
5
|
// px-vue common plugins
|
|
@@ -11,7 +9,6 @@ setup(app => {
|
|
|
11
9
|
|
|
12
10
|
const preview = {
|
|
13
11
|
parameters: {
|
|
14
|
-
//actions: { argTypesRegex: '^on[A-Z].*' },
|
|
15
12
|
controls: {
|
|
16
13
|
matchers: {
|
|
17
14
|
color: /(background|color)$/i,
|
|
@@ -20,26 +17,10 @@ const preview = {
|
|
|
20
17
|
},
|
|
21
18
|
},
|
|
22
19
|
order: ['Intro', 'Components'],
|
|
23
|
-
storySort: (a, b) =>
|
|
24
|
-
|
|
25
|
-
// theme
|
|
26
|
-
// darkMode: {
|
|
27
|
-
// // Override the default dark theme
|
|
28
|
-
// dark: { ...themes.dark, appBg: '#2A2C2E' },
|
|
29
|
-
// // Override the default light theme
|
|
30
|
-
// light: { ...themes.normal },
|
|
31
|
-
|
|
32
|
-
// darkClass: 'theme-dark',
|
|
33
|
-
// lightClass: 'theme-light',
|
|
34
|
-
// stylePreview: true,
|
|
35
|
-
// classTarget: 'body',
|
|
36
|
-
// },
|
|
37
|
-
|
|
38
|
-
docs: {
|
|
39
|
-
// requires import { themes } from '@storybook/theming';
|
|
40
|
-
// theme: themes.dark,
|
|
41
|
-
},
|
|
20
|
+
storySort: (a, b) => a.id === b.id ? 0 : a.id.localeCompare(b.id, undefined, { numeric: true }),
|
|
21
|
+
docs: { },
|
|
42
22
|
},
|
|
23
|
+
tags: ['autodocs']
|
|
43
24
|
};
|
|
44
25
|
|
|
45
26
|
export default preview;
|
package/.storybook/preview.scss
CHANGED
|
@@ -1,257 +1,3 @@
|
|
|
1
1
|
@use '../styles/px.scss' as *;
|
|
2
2
|
@use '@thinkpixellab-public/px-styles/src/modules/controls' as *;
|
|
3
|
-
|
|
4
|
-
@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600&family=Public+Sans:wght@300;400;500;600&family=Work+Sans:wght@400;600&display=swap');
|
|
5
|
-
|
|
6
|
-
@if get('is-fluent', false) {
|
|
7
|
-
@font-face {
|
|
8
|
-
font-family: segoe-vf;
|
|
9
|
-
font-weight: 100;
|
|
10
|
-
src:
|
|
11
|
-
url(https://edgestatic.azureedge.net/shared/edgeweb/fonts/segoeui-vf-display-light.e452665.woff2)
|
|
12
|
-
format('woff2'),
|
|
13
|
-
url(https://edgestatic.azureedge.net/shared/edgeweb/fonts/segoeui-vf-display-light.68c90c4.woff)
|
|
14
|
-
format('woff'),
|
|
15
|
-
url(https://edgestatic.azureedge.net/shared/edgeweb/fonts/segoeui-vf-display-light.9d3d90d.ttf)
|
|
16
|
-
format('truetype');
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
@font-face {
|
|
20
|
-
font-family: segoe-vf;
|
|
21
|
-
font-weight: 300;
|
|
22
|
-
src:
|
|
23
|
-
url(https://edgestatic.azureedge.net/shared/edgeweb/fonts/segoeui-vf-display-semilight.1338e9a.woff2)
|
|
24
|
-
format('woff2'),
|
|
25
|
-
url(https://edgestatic.azureedge.net/shared/edgeweb/fonts/segoeui-vf-display-semilight.9c37400.woff)
|
|
26
|
-
format('woff'),
|
|
27
|
-
url(https://edgestatic.azureedge.net/shared/edgeweb/fonts/segoeui-vf-display-semilight.f65cf1c.ttf)
|
|
28
|
-
format('truetype');
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
@font-face {
|
|
32
|
-
font-family: segoe-vf;
|
|
33
|
-
font-weight: 400;
|
|
34
|
-
src:
|
|
35
|
-
url(https://edgestatic.azureedge.net/shared/edgeweb/fonts/segoeui-vf-display.e85854a.woff2)
|
|
36
|
-
format('woff2'),
|
|
37
|
-
url(https://edgestatic.azureedge.net/shared/edgeweb/fonts/segoeui-vf-display.f8bb08f.woff)
|
|
38
|
-
format('woff'),
|
|
39
|
-
url(https://edgestatic.azureedge.net/shared/edgeweb/fonts/segoeui-vf-display.dc5de3f.ttf)
|
|
40
|
-
format('truetype');
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
@font-face {
|
|
44
|
-
font-family: segoe-vf;
|
|
45
|
-
font-weight: 600;
|
|
46
|
-
src:
|
|
47
|
-
url(https://edgestatic.azureedge.net/shared/edgeweb/fonts/segoeui-vf-display-semibold.1977a17.woff2)
|
|
48
|
-
format('woff2'),
|
|
49
|
-
url(https://edgestatic.azureedge.net/shared/edgeweb/fonts/segoeui-vf-display-semibold.3326bd2.woff)
|
|
50
|
-
format('woff'),
|
|
51
|
-
url(https://edgestatic.azureedge.net/shared/edgeweb/fonts/segoeui-vf-display-semibold.0f5cc00.ttf)
|
|
52
|
-
format('truetype');
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
@font-face {
|
|
56
|
-
font-family: segoe-vf;
|
|
57
|
-
font-weight: 700;
|
|
58
|
-
src:
|
|
59
|
-
url(https://edgestatic.azureedge.net/shared/edgeweb/fonts/segoeui-vf-display-bold.2756fcb.woff2)
|
|
60
|
-
format('woff2'),
|
|
61
|
-
url(https://edgestatic.azureedge.net/shared/edgeweb/fonts/segoeui-vf-display-bold.65cd9e3.woff)
|
|
62
|
-
format('woff'),
|
|
63
|
-
url(https://edgestatic.azureedge.net/shared/edgeweb/fonts/segoeui-vf-display-bold.4f8bd09.ttf)
|
|
64
|
-
format('truetype');
|
|
65
|
-
}
|
|
66
|
-
@include fluent-themes();
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
// .sbdocs-h2,
|
|
70
|
-
// .sbdocs-h3,
|
|
71
|
-
// .sbdocs-h4,
|
|
72
|
-
// .sbdocs-h5,
|
|
73
|
-
// .sbdocs h1:where(:not(.sb-unstyled h1)),
|
|
74
|
-
// .sbdocs h2:where(:not(.sb-unstyled h2)),
|
|
75
|
-
// .sbdocs h3:where(:not(.sb-unstyled h3)),
|
|
76
|
-
// .sbdocs h4:where(:not(.sb-unstyled h4)),
|
|
77
|
-
// .sbdocs h5:where(:not(.sb-unstyled h5)),
|
|
78
|
-
// .sbdocs-title,
|
|
79
|
-
// .sbdocs-content p,
|
|
80
|
-
// .docblock-argstable,
|
|
81
|
-
// .docblock-argstable tr,
|
|
82
|
-
// .docblock-argstable th,
|
|
83
|
-
// .docblock-argstable td,
|
|
84
|
-
// .docblock-argstable td button {
|
|
85
|
-
// font-family: $font !important;
|
|
86
|
-
// }
|
|
87
|
-
|
|
88
|
-
// Update this to test font inheritance
|
|
89
|
-
.sbdocs {
|
|
90
|
-
font-family: sans-serif;
|
|
91
|
-
perspective: 6000px;
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
body {
|
|
95
|
-
font-family: sans-serif;
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
.story-flex {
|
|
99
|
-
display: flex;
|
|
100
|
-
gap: 1em;
|
|
101
|
-
justify-content: center;
|
|
102
|
-
align-items: center;
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
.story-flex-top {
|
|
106
|
-
display: flex;
|
|
107
|
-
gap: 1em;
|
|
108
|
-
justify-content: center;
|
|
109
|
-
align-items: flex-start;
|
|
110
|
-
}
|
|
111
|
-
.story-flex-vert {
|
|
112
|
-
display: flex;
|
|
113
|
-
gap: 1em;
|
|
114
|
-
justify-content: center;
|
|
115
|
-
align-items: center;
|
|
116
|
-
text-align: center;
|
|
117
|
-
flex-direction: column;
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
.story-flex-bounds {
|
|
121
|
-
@extend .story-flex;
|
|
122
|
-
> * {
|
|
123
|
-
@extend .story-bounds;
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
.story-bounds {
|
|
128
|
-
display: inline-block;
|
|
129
|
-
height: auto;
|
|
130
|
-
width: auto;
|
|
131
|
-
padding: 0;
|
|
132
|
-
margin: 0;
|
|
133
|
-
display: block;
|
|
134
|
-
border: 1px dashed rgba(black, 0.33);
|
|
135
|
-
perspective: 20em;
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
.story-square {
|
|
139
|
-
background-color: tomato;
|
|
140
|
-
width: 6em;
|
|
141
|
-
height: 6em;
|
|
142
|
-
border-radius: 0.5em;
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
.story-circle {
|
|
146
|
-
background-color: tomato;
|
|
147
|
-
width: 6em;
|
|
148
|
-
height: 6em;
|
|
149
|
-
border-radius: 100%;
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
.story-orange {
|
|
153
|
-
background-color: tomato;
|
|
154
|
-
padding: 0.5em;
|
|
155
|
-
color: white;
|
|
156
|
-
border-radius: 0.5em;
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
.story-fill {
|
|
160
|
-
background-color: tomato;
|
|
161
|
-
width: 100%;
|
|
162
|
-
height: 100%;
|
|
163
|
-
border-radius: 8px;
|
|
164
|
-
color: white;
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
.story-center {
|
|
168
|
-
display: flex;
|
|
169
|
-
align-items: center;
|
|
170
|
-
justify-content: center;
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
.story-aspect-16-9 {
|
|
174
|
-
background-color: tomato;
|
|
175
|
-
width: 100%;
|
|
176
|
-
border-radius: 8px;
|
|
177
|
-
aspect-ratio: 16/9;
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
.story-gradient {
|
|
181
|
-
background-image: repeating-linear-gradient(
|
|
182
|
-
-45deg,
|
|
183
|
-
rgba(black, 0.1) 0 20px,
|
|
184
|
-
rgba(black, 0) 20px 40px
|
|
185
|
-
),
|
|
186
|
-
linear-gradient(135deg, tomato, purple);
|
|
187
|
-
width: 100%;
|
|
188
|
-
height: 100%;
|
|
189
|
-
border-radius: 8px;
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
.story-state-blue {
|
|
193
|
-
background-color: dodgerblue;
|
|
194
|
-
color: white;
|
|
195
|
-
width: 3em;
|
|
196
|
-
height: 3em;
|
|
197
|
-
border-radius: 8px;
|
|
198
|
-
padding: 1em;
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
.story-state-orange {
|
|
202
|
-
background-color: tomato;
|
|
203
|
-
color: white;
|
|
204
|
-
width: 7em;
|
|
205
|
-
height: 7em;
|
|
206
|
-
border-radius: 8px;
|
|
207
|
-
padding: 1em;
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
.story-size-xs {
|
|
211
|
-
width: 2em;
|
|
212
|
-
height: 2em;
|
|
213
|
-
}
|
|
214
|
-
|
|
215
|
-
.story-size-sm {
|
|
216
|
-
width: 4em;
|
|
217
|
-
height: 4em;
|
|
218
|
-
}
|
|
219
|
-
|
|
220
|
-
.story-size-base {
|
|
221
|
-
width: 6em;
|
|
222
|
-
height: 6em;
|
|
223
|
-
}
|
|
224
|
-
.story-size-md {
|
|
225
|
-
width: 8em;
|
|
226
|
-
height: 8em;
|
|
227
|
-
}
|
|
228
|
-
|
|
229
|
-
.story-popup {
|
|
230
|
-
font-family: sans-serif;
|
|
231
|
-
padding: 1em;
|
|
232
|
-
@include popup();
|
|
233
|
-
}
|
|
234
|
-
|
|
235
|
-
.story-tooltip {
|
|
236
|
-
@include popup(
|
|
237
|
-
(
|
|
238
|
-
font-family: sans-serif,
|
|
239
|
-
padding: 0.5em,
|
|
240
|
-
font-size: 14px,
|
|
241
|
-
background-color: mix(dodgerblue, white, 15%),
|
|
242
|
-
)
|
|
243
|
-
);
|
|
244
|
-
}
|
|
245
|
-
|
|
246
|
-
// icons
|
|
247
|
-
|
|
248
|
-
.story-inline-border {
|
|
249
|
-
display: inline-block;
|
|
250
|
-
border: 1px dotted tomato;
|
|
251
|
-
margin-inline: 0.25em;
|
|
252
|
-
}
|
|
253
|
-
|
|
254
|
-
.theme-dark {
|
|
255
|
-
background-color: #151617;
|
|
256
|
-
color: white;
|
|
257
|
-
}
|
|
3
|
+
@use '../storybook/sb-styles.scss' as *;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
<svg viewBox="0 0 24 24"><g transform="translate(4 11)" fill="
|
|
1
|
+
<svg viewBox="0 0 24 24"><g transform="translate(4 11)" fill="currentColor" fill-rule="evenodd"><circle cx="1.5" cy="1.5" r="1.5"/><circle cx="8" cy="1.5" r="1.5"/><circle cx="14.5" cy="1.5" r="1.5"/></g></svg>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
<svg viewBox="0 0 24 24"><g fill="none" fill-rule="evenodd" stroke-linecap="round" stroke-linejoin="round" stroke="
|
|
1
|
+
<svg viewBox="0 0 24 24"><g fill="none" fill-rule="evenodd" stroke-linecap="round" stroke-linejoin="round" stroke="currentColor" stroke-width="2"><path d="M16.716 2.498a3.067 3.067 0 0 1 2.962-.793c1.059.283 2.654 1.878 2.937 2.937a3.067 3.067 0 0 1-.793 2.962l-4.152 4.152-.538-.537-9.72 9.72L1.6 22.72l1.78-5.811 9.721-9.721-.537-.538 4.152-4.152ZM11.315 5.402l7.526 7.526"/></g></svg>
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
import { PxIconSrcOrAttrs } from '../components/PxIcon.vue';
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
props: {
|
|
6
|
+
/**
|
|
7
|
+
* The icon. If a string is provided, it will be interpreted as the src of the icon. If an
|
|
8
|
+
* object is provided, it will be passed directly to the icon component as props (with a
|
|
9
|
+
* filter applied to ensure no unused attributes get set on the element). See PxIcon for the
|
|
10
|
+
* full list of supported attributes.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
icon: { type: [String, Object], default: null },
|
|
14
|
+
},
|
|
15
|
+
computed: {
|
|
16
|
+
iconAttrs() {
|
|
17
|
+
return PxIconSrcOrAttrs(this.icon);
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
};
|
|
21
|
+
</script>
|
|
@@ -122,7 +122,6 @@ export default {
|
|
|
122
122
|
if (nv != null) {
|
|
123
123
|
const name =
|
|
124
124
|
'bem' in this ? this.bem() : this.$options?.name || 'UnknownComponent';
|
|
125
|
-
console.log(`nv: ${nv}`);
|
|
126
125
|
console.error(
|
|
127
126
|
`[MIGRATION] PxBaseItemsSelect (${name}): v-model has syntax has changed. Please replace <${name} v-model="mySelection" /> with <${name} v-model:selected="mySelection" />.`,
|
|
128
127
|
);
|
|
@@ -53,8 +53,8 @@ ar
|
|
|
53
53
|
import PxBaseResize from '../bases/PxBaseResize.vue';
|
|
54
54
|
import PxIconButton from './PxIconButton.vue';
|
|
55
55
|
import PxIcon from './PxIcon.vue';
|
|
56
|
-
import arrowStartIconDefault from '../assets/feather/arrow-left.svg?url';
|
|
57
|
-
import arrowEndIconDefault from '../assets/feather/arrow-right.svg?url';
|
|
56
|
+
// import arrowStartIconDefault from '../assets/feather/arrow-left.svg?url';
|
|
57
|
+
// import arrowEndIconDefault from '../assets/feather/arrow-right.svg?url';
|
|
58
58
|
import { svgArrow } from '../utils/svgIcons.js';
|
|
59
59
|
|
|
60
60
|
import propsFilter from '../utils/propsFilter.js';
|
|
@@ -64,7 +64,7 @@ import propsFilter from '../utils/propsFilter.js';
|
|
|
64
64
|
Creates a horizontally scrolling container with an invisible scrollbar and arrows on either side.
|
|
65
65
|
|
|
66
66
|
```html
|
|
67
|
-
<px-arrow-scroller :arrow-start-src="
|
|
67
|
+
<px-arrow-scroller :arrow-start-src="yourCustomArrowStartIcon" :arrow-end-src="yourCustomArrowEndIcon">
|
|
68
68
|
|
|
69
69
|
<template #button="{location}">
|
|
70
70
|
// this can look like a button but it will ultimately be wrapped by a button
|
|
@@ -15,6 +15,13 @@
|
|
|
15
15
|
</template>
|
|
16
16
|
|
|
17
17
|
<script>
|
|
18
|
+
// Note: for Nuxt projects, the following nuxt.config.js setting may be necessary:
|
|
19
|
+
// vite: {
|
|
20
|
+
// optimizeDeps: {
|
|
21
|
+
// include: ['highlight.js'],
|
|
22
|
+
// }
|
|
23
|
+
// }
|
|
24
|
+
|
|
18
25
|
import hljs from 'highlight.js/lib/core';
|
|
19
26
|
import javascript from 'highlight.js/lib/languages/javascript';
|
|
20
27
|
import xml from 'highlight.js/lib/languages/xml';
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
<!--
|
|
2
|
-
Describe this component...
|
|
3
|
-
-->
|
|
4
1
|
<template>
|
|
5
2
|
<div :class="bem()">
|
|
6
3
|
<PxColorPaletteButton
|
|
@@ -36,7 +33,8 @@ export default {
|
|
|
36
33
|
/**
|
|
37
34
|
* Array of colors to display in the palette
|
|
38
35
|
*/
|
|
39
|
-
palette: { type: Array, default:
|
|
36
|
+
palette: { type: Array, default: () => [] },
|
|
37
|
+
paletteInitColor: { type: String, default: null },
|
|
40
38
|
|
|
41
39
|
// none | picker | eyedropper | eyedropper-only
|
|
42
40
|
pickerMode: { type: String, default: 'none' },
|
|
@@ -87,15 +85,21 @@ export default {
|
|
|
87
85
|
return this.pickerMode != 'none';
|
|
88
86
|
},
|
|
89
87
|
},
|
|
90
|
-
|
|
88
|
+
watch: {
|
|
89
|
+
paletteInitColor(val) {
|
|
90
|
+
this.setColorHsva(this.colorStrToHsva(val));
|
|
91
|
+
},
|
|
92
|
+
},
|
|
91
93
|
mounted() {},
|
|
92
94
|
methods: {
|
|
93
95
|
onPaletteClick(color) {
|
|
94
96
|
this.pickerActive = false;
|
|
95
97
|
this.setColorHsva(color.hsva);
|
|
98
|
+
this.$emit('paletteClick');
|
|
96
99
|
},
|
|
97
100
|
onPickerClick() {
|
|
98
101
|
this.pickerActive = true;
|
|
102
|
+
this.$emit('pickerClick');
|
|
99
103
|
},
|
|
100
104
|
onPickerChange(e) {
|
|
101
105
|
if (this.pickerActive) {
|
package/components/PxFloat.vue
CHANGED
|
@@ -10,8 +10,8 @@
|
|
|
10
10
|
>
|
|
11
11
|
<transition
|
|
12
12
|
:name="calcTransitionName"
|
|
13
|
-
@before-enter="
|
|
14
|
-
@after-leave="
|
|
13
|
+
@before-enter="transitionBeforeEnter"
|
|
14
|
+
@after-leave="transitionAfterLeave"
|
|
15
15
|
>
|
|
16
16
|
<div
|
|
17
17
|
:class="[rootClass, bem({ ...variantsMap, absolute: strategy == 'absolute' })]"
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
<script>
|
|
56
56
|
import PxBaseVariants from '../bases/PxBaseVariants.vue';
|
|
57
57
|
import { computePosition, autoUpdate, flip, shift, offset, size } from '@floating-ui/dom';
|
|
58
|
-
import { disableBodyScroll, clearAllBodyScrollLocks } from 'body-scroll-lock';
|
|
58
|
+
import { disableBodyScroll, enableBodyScroll, clearAllBodyScrollLocks } from 'body-scroll-lock';
|
|
59
59
|
|
|
60
60
|
const FOCUS_ELEMENTS = [
|
|
61
61
|
'button',
|
|
@@ -290,7 +290,7 @@ export default {
|
|
|
290
290
|
computed: {
|
|
291
291
|
// the name of the transition to use ()
|
|
292
292
|
calcTransitionName() {
|
|
293
|
-
if (this.transitionName) {
|
|
293
|
+
if (this.transitionName !== null) {
|
|
294
294
|
return this.transitionName;
|
|
295
295
|
}
|
|
296
296
|
|
|
@@ -407,9 +407,7 @@ export default {
|
|
|
407
407
|
}
|
|
408
408
|
}
|
|
409
409
|
} else {
|
|
410
|
-
|
|
411
|
-
globalClearLayerIndex = 0;
|
|
412
|
-
}
|
|
410
|
+
// see watcher for transitionVisible
|
|
413
411
|
}
|
|
414
412
|
|
|
415
413
|
// show and hide events (also see beforeshow/beforehide in visibleValue watcher)
|
|
@@ -423,9 +421,10 @@ export default {
|
|
|
423
421
|
});
|
|
424
422
|
},
|
|
425
423
|
|
|
426
|
-
transitionVisible(
|
|
427
|
-
if (!
|
|
424
|
+
transitionVisible() {
|
|
425
|
+
if (!this.transitionVisible) {
|
|
428
426
|
this.$emit('afterhide');
|
|
427
|
+
enableBodyScroll(this.$refs.popup, { reserveScrollBarGap: true });
|
|
429
428
|
}
|
|
430
429
|
},
|
|
431
430
|
},
|
|
@@ -635,6 +634,14 @@ export default {
|
|
|
635
634
|
getPopupElement() {
|
|
636
635
|
return this.$refs.popup;
|
|
637
636
|
},
|
|
637
|
+
|
|
638
|
+
transitionBeforeEnter() {
|
|
639
|
+
this.transitionVisible = true;
|
|
640
|
+
},
|
|
641
|
+
|
|
642
|
+
transitionAfterLeave() {
|
|
643
|
+
this.transitionVisible = false;
|
|
644
|
+
},
|
|
638
645
|
},
|
|
639
646
|
};
|
|
640
647
|
</script>
|
package/components/PxIcon.vue
CHANGED
|
@@ -189,7 +189,7 @@ const PxIcon = {
|
|
|
189
189
|
// helper function that filters out props that are not defined in the component when using v-bind to
|
|
190
190
|
// set icon props
|
|
191
191
|
function PxIconPropsFilter(attrs) {
|
|
192
|
-
return propsFilter(PxIcon)(attrs);
|
|
192
|
+
return propsFilter(PxIcon, ['class', 'style'])(attrs);
|
|
193
193
|
}
|
|
194
194
|
|
|
195
195
|
// helper function that makes that creates PxIcon attributes from a src string or attrs object
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
</template>
|
|
15
15
|
|
|
16
16
|
<script>
|
|
17
|
-
import { PxIcon, PxIconSrcOrAttrs } from './PxIcon.vue';
|
|
17
|
+
import { PxIcon, PxIconSrcOrAttrs, PxIconPropsFilter } from './PxIcon.vue';
|
|
18
18
|
import PxBase from '../bases/PxBase.vue';
|
|
19
19
|
import PxBaseToggle from '../bases/PxBaseToggle.vue';
|
|
20
20
|
|
package/components/PxQrCode.vue
CHANGED
package/components/PxTable.vue
CHANGED
package/components/PxToggle.vue
CHANGED
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
aria-role="switch"
|
|
8
8
|
:aria-checked="checkedValue"
|
|
9
9
|
@click="toggleChecked"
|
|
10
|
+
:type="buttonType"
|
|
10
11
|
>
|
|
11
12
|
<span
|
|
12
13
|
:class="[bem('track'), trackClass]"
|
|
@@ -66,6 +67,9 @@ export default {
|
|
|
66
67
|
|
|
67
68
|
/** Toggle the label/toggle order */
|
|
68
69
|
reverse: { type: Boolean, default: false },
|
|
70
|
+
|
|
71
|
+
// 'submit' (default for <button> if not set), 'reset' (resets form) or 'button' (no action)
|
|
72
|
+
buttonType: { type: String, default: 'button' },
|
|
69
73
|
},
|
|
70
74
|
};
|
|
71
75
|
</script>
|