@eturnity/eturnity_reusable_components 7.8.1 → 7.8.2-EPDM-7779.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eturnity/eturnity_reusable_components",
3
- "version": "7.8.1",
3
+ "version": "7.8.2-EPDM-7779.0",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "dev": "vue-cli-service serve",
@@ -63,7 +63,7 @@
63
63
  @input-change="searchChange"
64
64
  @click.native.stop
65
65
  />
66
- <selector v-else>
66
+ <selector :selectWidth="selectWidth" v-else>
67
67
  <slot name="selector" :selectedValue="selectedValue"></slot>
68
68
  </selector>
69
69
  <Caret @click.stop="toggleCaretDropdown">
@@ -154,8 +154,14 @@ const Caret = styled.div`
154
154
  margin-left: auto;
155
155
  `
156
156
 
157
- const Selector = styled.div`
158
- width: 100%;
157
+ const Selector = styled('div', { selectWidth: String })`
158
+ max-width: ${(props) =>
159
+ props.selectWidth
160
+ ? props.selectWidth
161
+ : '100%'}; // set to same width as the select
162
+ white-space: nowrap;
163
+ text-overflow: ellipsis;
164
+ overflow: hidden;
159
165
  `
160
166
 
161
167
  const labelAttrs = { fontSize: String, fontColor: String }
@@ -164,7 +170,7 @@ const InputLabel = styled('div', labelAttrs)`
164
170
  props.theme.colors[props.fontColor]
165
171
  ? props.theme.colors[props.fontColor]
166
172
  : props.fontColor};
167
- font-size: ${(props) => (props.fontSize ? props.fontSize : '13px')};
173
+ font-size: ${(props) => props.fontSize};
168
174
  font-weight: 700;
169
175
  `
170
176
  const optionalLabel = styled.span`
@@ -299,7 +305,7 @@ export default {
299
305
  },
300
306
  fontSize: {
301
307
  required: false,
302
- default: null
308
+ default: '13px'
303
309
  },
304
310
  label: {
305
311
  required: false
@@ -6,7 +6,7 @@
6
6
  @click.native="onOutsideClose()"
7
7
  :backdrop="backdrop"
8
8
  >
9
- <modal-container @click.stop>
9
+ <modal-container @click="onClickModalContainer">
10
10
  <spinner v-if="isLoading" size="50px" :limitedToModal="true" />
11
11
  <content-container :visible="!isLoading">
12
12
  <slot />
@@ -27,7 +27,7 @@
27
27
  // import Modal from "@eturnity/eturnity_reusable_components/src/components/modals/modal"
28
28
  // This is a more flexible modal box, where the parent can decide how the body of the modal looks
29
29
  // To use:
30
- // <modal :isOpen="isOpen" @on-close="$emit('on-close-summary')" :preventOutsideClose="true" :isLoading="true" :hideClose="true">
30
+ // <modal :isOpen="isOpen" @on-close="$emit('on-close-summary')" :preventOutsideClose="true" :isLoading="true" :hideClose="true" :stopPropagation="false">
31
31
  // <div>Data....</div>
32
32
  // </modal>
33
33
 
@@ -156,6 +156,10 @@ export default {
156
156
  position: {
157
157
  required: false,
158
158
  default: 'fixed'
159
+ },
160
+ stopPropagation: {
161
+ type: Boolean,
162
+ default: true
159
163
  }
160
164
  },
161
165
  methods: {
@@ -167,6 +171,11 @@ export default {
167
171
  if (!this.preventOutsideClose) {
168
172
  this.$emit('on-close')
169
173
  }
174
+ },
175
+ onClickModalContainer(event) {
176
+ if (this.stopPropagation) {
177
+ event.stopPropagation()
178
+ }
170
179
  }
171
180
  },
172
181
  watch: {
@@ -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
- {{ item.name }}
60
- </span>
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 OptionsContainer = styled.div`
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
- min-width: 220px;
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() {