@vcita/design-system 1.11.12 → 1.11.13
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/dist/@vcita/design-system.esm.js +19885 -17
- package/dist/@vcita/design-system.min.js +2 -2
- package/dist/@vcita/design-system.ssr.js +19890 -22
- package/package.json +1 -1
- package/src/components/VcChip/VcChip.spec.js +16 -0
- package/src/components/VcChip/VcChip.stories.js +4 -0
- package/src/components/VcChip/VcChip.vue +13 -2
- package/src/components/VcChipList/VcChipList.vue +9 -1
- package/src/components/table/elements/VcColumnHeader/VcColumnHeader.vue +2 -2
- package/src/components/table/elements/VcDataTable/VcDataTable.vue +1 -0
- package/src/components/table/elements/VcTableItem/VcTableItem.vue +2 -0
package/package.json
CHANGED
|
@@ -156,4 +156,20 @@ describe("VcChip.vue", () => {
|
|
|
156
156
|
expect(chip).toHaveClass('VcChip--small')
|
|
157
157
|
})
|
|
158
158
|
|
|
159
|
+
it('Chip width', async () => {
|
|
160
|
+
const {getByTestId, updateProps} = renderWithVuetify(VcChip, {
|
|
161
|
+
props: {
|
|
162
|
+
label: 'James Howlett',
|
|
163
|
+
}
|
|
164
|
+
})
|
|
165
|
+
|
|
166
|
+
const chip = getByTestId('vc-chip')
|
|
167
|
+
expect(chip).toHaveStyle('min-width: 20px');
|
|
168
|
+
expect(chip).toHaveStyle('max-width: 116px');
|
|
169
|
+
|
|
170
|
+
await updateProps({minWidth: 50, maxWidth: 100});
|
|
171
|
+
expect(chip).toHaveStyle('min-width: 50px');
|
|
172
|
+
expect(chip).toHaveStyle('max-width: 100px');
|
|
173
|
+
})
|
|
174
|
+
|
|
159
175
|
});
|
|
@@ -15,6 +15,8 @@ const baseProps = {
|
|
|
15
15
|
selected: false,
|
|
16
16
|
small: false,
|
|
17
17
|
subLabel: '',
|
|
18
|
+
maxWidth: 116,
|
|
19
|
+
minWidth: 20,
|
|
18
20
|
}
|
|
19
21
|
|
|
20
22
|
const GeneralTemplate = (args, {argTypes}) => ({
|
|
@@ -37,6 +39,8 @@ const GeneralTemplate = (args, {argTypes}) => ({
|
|
|
37
39
|
:is-ripple="isRipple"
|
|
38
40
|
:small="small"
|
|
39
41
|
:subLabel="subLabel"
|
|
42
|
+
:max-width="maxWidth"
|
|
43
|
+
:min-width="minWidth"
|
|
40
44
|
@onChipClick="onChipClick"
|
|
41
45
|
@input="onClose">
|
|
42
46
|
</VcChip>`,
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
:ripple="isRipple"
|
|
6
6
|
close-icon="$close"
|
|
7
7
|
:disabled="disabled"
|
|
8
|
+
:style="{maxWidth: `${maxWidth}px`, minWidth: `${minWidth}px`}"
|
|
8
9
|
:class="{
|
|
9
10
|
'vc-invalid': invalid,
|
|
10
11
|
'vc-avatar': !!avatar,
|
|
@@ -82,6 +83,14 @@ export default {
|
|
|
82
83
|
type: Boolean,
|
|
83
84
|
default: false
|
|
84
85
|
},
|
|
86
|
+
maxWidth: {
|
|
87
|
+
type: Number,
|
|
88
|
+
default: 116,
|
|
89
|
+
},
|
|
90
|
+
minWidth: {
|
|
91
|
+
type: Number,
|
|
92
|
+
default: 20,
|
|
93
|
+
},
|
|
85
94
|
}
|
|
86
95
|
};
|
|
87
96
|
</script>
|
|
@@ -90,11 +99,13 @@ export default {
|
|
|
90
99
|
@import '@/../styles/variables.scss';
|
|
91
100
|
|
|
92
101
|
.VcChip {
|
|
93
|
-
max-width: fit-content;
|
|
94
102
|
border: 1px solid var(--neutral-lighten-1);
|
|
95
103
|
|
|
96
|
-
|
|
104
|
+
.label-wrap {
|
|
97
105
|
padding-inline: var(--size-value2);
|
|
106
|
+
white-space: nowrap;
|
|
107
|
+
overflow: hidden;
|
|
108
|
+
text-overflow: ellipsis;
|
|
98
109
|
}
|
|
99
110
|
|
|
100
111
|
.v-chip__content__avatar {
|
|
@@ -28,6 +28,8 @@
|
|
|
28
28
|
:is-ripple="false"
|
|
29
29
|
:close-button="showCloseButton"
|
|
30
30
|
:small="isSmall"
|
|
31
|
+
:max-width="maxChipWidth"
|
|
32
|
+
:min-width="minChipWidth"
|
|
31
33
|
data-qa="vc-chip-item-more"/>
|
|
32
34
|
<span v-else
|
|
33
35
|
v-show="hiddenChips.length"
|
|
@@ -81,7 +83,13 @@ export default {
|
|
|
81
83
|
type: String,
|
|
82
84
|
default: 'text',
|
|
83
85
|
validator: value => ['text', 'chip'].includes(value)
|
|
84
|
-
}
|
|
86
|
+
},
|
|
87
|
+
maxChipWidth: {
|
|
88
|
+
type: Number,
|
|
89
|
+
},
|
|
90
|
+
minChipWidth: {
|
|
91
|
+
type: Number,
|
|
92
|
+
},
|
|
85
93
|
},
|
|
86
94
|
data() {
|
|
87
95
|
return {
|
|
@@ -110,9 +110,9 @@ export default {
|
|
|
110
110
|
.VcColumnHeader {
|
|
111
111
|
height: var(--size-value9);
|
|
112
112
|
padding: 0 var(--size-value4);
|
|
113
|
-
color: var(--gray-darken-
|
|
113
|
+
color: var(--gray-darken-5);
|
|
114
114
|
font-size: 10px;
|
|
115
|
-
font-weight: var(--font-weight-
|
|
115
|
+
font-weight: var(--font-weight-large);
|
|
116
116
|
background-color: var(--gray-lighten-4);
|
|
117
117
|
border-bottom: var(--gray-lighten-2) solid 1px;
|
|
118
118
|
|
|
@@ -23,6 +23,8 @@
|
|
|
23
23
|
:lines="1"
|
|
24
24
|
hidden-item-display="chip"
|
|
25
25
|
:data-qa="`${dataQa}-tags`"
|
|
26
|
+
:max-chip-width="116"
|
|
27
|
+
:min-chip-width="20"
|
|
26
28
|
@onHiddenChipsChange="newValue => hiddenChips = newValue"/>
|
|
27
29
|
<VcButton ghost v-else-if="type === 'tag' && showAddTagButton" :data-qa="`${dataQa}-addTagsButton`"
|
|
28
30
|
@click="$emit('onClickToAddTag', $props)">
|