@eturnity/eturnity_reusable_components 7.8.1 → 7.8.2
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/package.json
CHANGED
@@ -38,11 +38,12 @@
|
|
38
38
|
{{ child.name }}
|
39
39
|
</option-child>
|
40
40
|
</children-container>
|
41
|
-
<options-container v-if="!isLoading">
|
41
|
+
<options-container v-if="!isLoading" :textWrap="textWrap">
|
42
42
|
<option-item
|
43
43
|
v-for="(item, index) in options"
|
44
44
|
:key="item.value"
|
45
45
|
tabindex="0"
|
46
|
+
:textWrap="textWrap"
|
46
47
|
@click.stop="onSelect({ item: item, hasChildren: hasChildren(item) })"
|
47
48
|
@keyup.enter="
|
48
49
|
onSelect({ item: item, hasChildren: hasChildren(item) })
|
@@ -56,8 +57,8 @@
|
|
56
57
|
v-if="hasChildren(item)"
|
57
58
|
/>
|
58
59
|
<span>
|
59
|
-
|
60
|
-
|
60
|
+
{{ item.name }}
|
61
|
+
</span>
|
61
62
|
</option-item>
|
62
63
|
</options-container>
|
63
64
|
</template>
|
@@ -184,22 +185,20 @@ const LoadingContainer = styled.div`
|
|
184
185
|
background: #fff;
|
185
186
|
`
|
186
187
|
|
187
|
-
const
|
188
|
+
const OptionsContainerAttrs = { textWrap: Boolean }
|
189
|
+
const OptionsContainer = styled('div', OptionsContainerAttrs)`
|
188
190
|
border: 1px solid ${(props) => props.theme.colors.grey3};
|
189
191
|
display: grid;
|
190
192
|
grid-template-columns: 1fr;
|
191
|
-
|
192
|
-
max-width: 220px;
|
193
|
-
width: max-content;
|
193
|
+
${(props) => props.textWrap ? 'width: 220px' : 'width: max-content' };
|
194
194
|
border-radius: 4px;
|
195
195
|
background-color: #fff;
|
196
196
|
max-height: 220px;
|
197
197
|
overflow: auto;
|
198
198
|
height: max-content;
|
199
|
-
white-space: normal;
|
200
199
|
`
|
201
200
|
|
202
|
-
const optionAttrs = { isDisabled: Boolean }
|
201
|
+
const optionAttrs = { isDisabled: Boolean, textWrap: Boolean }
|
203
202
|
const OptionItem = styled('div', optionAttrs)`
|
204
203
|
padding: 12px;
|
205
204
|
cursor: ${(props) => (props.isDisabled ? 'not-allowed' : 'pointer')};
|
@@ -207,6 +206,7 @@ const OptionItem = styled('div', optionAttrs)`
|
|
207
206
|
position: relative;
|
208
207
|
${(props) => (props.isDisabled ? `background-color: ${ props.theme.colors.grey5 }!important` : '')};
|
209
208
|
${(props) => (props.isDisabled ? `color: ${ props.theme.colors.grey2 }` : '')};
|
209
|
+
${(props) => props.textWrap ? '' : 'white-space: nowrap'};
|
210
210
|
|
211
211
|
&:hover {
|
212
212
|
background-color: #ebeef4;
|
@@ -288,6 +288,10 @@ export default {
|
|
288
288
|
isLoading: {
|
289
289
|
required: false,
|
290
290
|
default: false
|
291
|
+
},
|
292
|
+
textWrap: {
|
293
|
+
required: false,
|
294
|
+
default: true
|
291
295
|
}
|
292
296
|
},
|
293
297
|
data() {
|