@pequity/squirrel 6.0.4 → 6.0.5
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.
|
@@ -71,9 +71,9 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
71
71
|
type: "secondary-outline-blue",
|
|
72
72
|
disabled: item.disabled,
|
|
73
73
|
class: vue.normalizeClass({
|
|
74
|
-
"rounded-none": index !== 0 && index !== _ctx.items.length - 1,
|
|
75
|
-
"rounded-br-none rounded-tr-none": index === 0,
|
|
76
|
-
"rounded-bl-none rounded-tl-none": index === _ctx.items.length - 1,
|
|
74
|
+
"rounded-none": index !== 0 && index !== _ctx.items.length - 1 && _ctx.items.length > 1,
|
|
75
|
+
"rounded-br-none rounded-tr-none": index === 0 && _ctx.items.length > 1,
|
|
76
|
+
"rounded-bl-none rounded-tl-none": index === _ctx.items.length - 1 && _ctx.items.length > 1,
|
|
77
77
|
"-mr-0.5": index !== _ctx.items.length - 1,
|
|
78
78
|
"flex-1": _ctx.grow
|
|
79
79
|
}),
|
|
@@ -70,9 +70,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
70
70
|
type: "secondary-outline-blue",
|
|
71
71
|
disabled: item.disabled,
|
|
72
72
|
class: normalizeClass({
|
|
73
|
-
"rounded-none": index !== 0 && index !== _ctx.items.length - 1,
|
|
74
|
-
"rounded-br-none rounded-tr-none": index === 0,
|
|
75
|
-
"rounded-bl-none rounded-tl-none": index === _ctx.items.length - 1,
|
|
73
|
+
"rounded-none": index !== 0 && index !== _ctx.items.length - 1 && _ctx.items.length > 1,
|
|
74
|
+
"rounded-br-none rounded-tr-none": index === 0 && _ctx.items.length > 1,
|
|
75
|
+
"rounded-bl-none rounded-tl-none": index === _ctx.items.length - 1 && _ctx.items.length > 1,
|
|
76
76
|
"-mr-0.5": index !== _ctx.items.length - 1,
|
|
77
77
|
"flex-1": _ctx.grow
|
|
78
78
|
}),
|
package/package.json
CHANGED
|
@@ -176,6 +176,24 @@ describe('PSelectBtn.vue', () => {
|
|
|
176
176
|
});
|
|
177
177
|
});
|
|
178
178
|
|
|
179
|
+
it('does not add rounded classes when there is only one item', async () => {
|
|
180
|
+
const singleItem = [{ textCustom: 'Option 1', valueCustom: 1 }];
|
|
181
|
+
const wrapper = createWrapperFor(PSelectBtn, {
|
|
182
|
+
props: {
|
|
183
|
+
items: singleItem,
|
|
184
|
+
itemValue: 'valueCustom',
|
|
185
|
+
itemText: 'textCustom',
|
|
186
|
+
modelValue: 1,
|
|
187
|
+
},
|
|
188
|
+
});
|
|
189
|
+
|
|
190
|
+
const button = await wrapper.find('button');
|
|
191
|
+
const roundedClasses = ['rounded-none', 'rounded-br-none', 'rounded-tr-none', 'rounded-bl-none', 'rounded-tl-none'];
|
|
192
|
+
roundedClasses.forEach((className) => {
|
|
193
|
+
expect(button.classes()).not.toContain(className);
|
|
194
|
+
});
|
|
195
|
+
});
|
|
196
|
+
|
|
179
197
|
it('renders full-width buttons', async () => {
|
|
180
198
|
const wrapper = createWrapperFor(PSelectBtn, {
|
|
181
199
|
props: {
|
|
@@ -11,9 +11,9 @@
|
|
|
11
11
|
type="secondary-outline-blue"
|
|
12
12
|
:disabled="item.disabled"
|
|
13
13
|
:class="{
|
|
14
|
-
'rounded-none': index !== 0 && index !== items.length - 1,
|
|
15
|
-
'rounded-br-none rounded-tr-none': index === 0,
|
|
16
|
-
'rounded-bl-none rounded-tl-none': index === items.length - 1,
|
|
14
|
+
'rounded-none': index !== 0 && index !== items.length - 1 && items.length > 1,
|
|
15
|
+
'rounded-br-none rounded-tr-none': index === 0 && items.length > 1,
|
|
16
|
+
'rounded-bl-none rounded-tl-none': index === items.length - 1 && items.length > 1,
|
|
17
17
|
'-mr-0.5': index !== items.length - 1,
|
|
18
18
|
'flex-1': grow,
|
|
19
19
|
}"
|