@eturnity/eturnity_reusable_components 7.12.6 → 7.12.7-EPDM-10299.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.12.6",
3
+ "version": "7.12.7-EPDM-10299.0",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "dev": "vue-cli-service serve",
@@ -469,7 +469,7 @@ export default {
469
469
  }
470
470
  },
471
471
  methods: {
472
- onEnterPress(){
472
+ onEnterPress() {
473
473
  this.$emit('on-enter-click')
474
474
  this.$refs.inputField1.$el.blur()
475
475
  },
@@ -549,9 +549,6 @@ export default {
549
549
  return array
550
550
  },
551
551
  onInput(value) {
552
- // if(!this.isFocused){
553
- // return
554
- // }
555
552
  if (this.isBlurred) {
556
553
  this.isBlurred = false
557
554
  return
@@ -563,7 +560,7 @@ export default {
563
560
  try {
564
561
  evaluatedVal = this.onEvaluateCode(value)
565
562
  } finally {
566
- if (evaluatedVal) {
563
+ if (evaluatedVal && this.value != evaluatedVal) {
567
564
  this.$emit('on-input', evaluatedVal)
568
565
  }
569
566
  }
@@ -649,10 +646,10 @@ export default {
649
646
  }
650
647
  },
651
648
  initInteraction(e) {
649
+ this.focusInput()
650
+ e.preventDefault()
652
651
  window.addEventListener('mousemove', this.interact, false)
653
652
  window.addEventListener('mouseup', this.stopInteract, false)
654
- e.preventDefault()
655
- this.focusInput()
656
653
  },
657
654
  interact(e) {
658
655
  e.preventDefault()
@@ -46,7 +46,10 @@
46
46
  :data-id="dataId"
47
47
  :paddingLeft="paddingLeft"
48
48
  >
49
- <draggableInputHandle v-if="isDraggable && !isSearchBarVisible" :height="selectHeight" />
49
+ <draggableInputHandle
50
+ v-if="isDraggable && !isSearchBarVisible"
51
+ :height="selectHeight"
52
+ />
50
53
  <inputText
51
54
  v-if="isSearchBarVisible"
52
55
  ref="searchInput"
@@ -63,7 +66,12 @@
63
66
  @input-change="searchChange"
64
67
  @click.native.stop
65
68
  />
66
- <selector v-else :selectWidth="selectWidth" :paddingLeft="paddingLeft">
69
+ <selector
70
+ v-else
71
+ :showBorder="showBorder"
72
+ :selectWidth="selectWidth"
73
+ :paddingLeft="paddingLeft"
74
+ >
67
75
  <slot name="selector" :selectedValue="selectedValue"></slot>
68
76
  </selector>
69
77
  <Caret @click.stop="toggleCaretDropdown">
@@ -158,11 +166,23 @@ const Caret = styled.div`
158
166
  margin-left: auto;
159
167
  `
160
168
 
161
- const Selector = styled('div', { selectWidth: String, paddingLeft: String })`
162
- width: ${(props) => `calc(${props.selectWidth} - (${CARET_WIDTH} + ${props.paddingLeft} + (${BORDER_WIDTH} * 2)))`};
163
- white-space: nowrap;
164
- text-overflow: ellipsis;
165
- overflow: hidden;
169
+ const selectorProps = {
170
+ selectWidth: String,
171
+ paddingLeft: String,
172
+ showBorder: Boolean
173
+ }
174
+ const Selector = styled('div', selectorProps)`
175
+ ${(props) => props.selectWidth === '100%' ? 'width: 100%;' : `width: calc(${props.selectWidth} -
176
+ (
177
+ ${CARET_WIDTH} +
178
+ ${props.paddingLeft}
179
+ ${props.showBorder ? `+ (${BORDER_WIDTH} * 2)` : ''}
180
+ )
181
+ );
182
+ white-space: nowrap;
183
+ text-overflow: ellipsis;
184
+ overflow: hidden;`
185
+ }
166
186
  `
167
187
 
168
188
  const labelAttrs = { fontSize: String, fontColor: String }
@@ -214,7 +234,8 @@ const selectButton = styled('div', selectButtonAttrs)`
214
234
  position: relative;
215
235
  box-sizing: border-box;
216
236
  border-radius: 4px;
217
- ${(props) => (props.isSearchBarVisible ? '' : `padding-left: ${props.paddingLeft}` )};
237
+ ${(props) =>
238
+ props.isSearchBarVisible ? '' : `padding-left: ${props.paddingLeft}`};
218
239
  text-align: left;
219
240
  min-height: ${(props) =>
220
241
  props.selectHeight
@@ -230,7 +251,9 @@ const selectButton = styled('div', selectButtonAttrs)`
230
251
  ${({ showBorder, theme, hasError }) =>
231
252
  showBorder &&
232
253
  `
233
- border: ${BORDER_WIDTH} solid ${hasError ? theme.colors.red : theme.colors.grey4}
254
+ border: ${BORDER_WIDTH} solid ${
255
+ hasError ? theme.colors.red : theme.colors.grey4
256
+ }
234
257
  `}
235
258
  background-color:${(props) =>
236
259
  props.disabled
@@ -244,8 +267,10 @@ const selectButton = styled('div', selectButtonAttrs)`
244
267
  : props.fontColor};
245
268
  ${(props) => (props.disabled ? 'pointer-events: none' : '')};
246
269
  overflow: hidden;
247
- & >.handle{
248
- border-right:${(props) =>props.hasError ? props.theme.colors.red : props.theme.colors.grey4} 1px solid;
270
+ & > .handle {
271
+ border-right: ${(props) =>
272
+ props.hasError ? props.theme.colors.red : props.theme.colors.grey4}
273
+ 1px solid;
249
274
  }
250
275
  `
251
276
  const selectDropdownAttrs = {
@@ -258,34 +283,34 @@ const selectDropdownAttrs = {
258
283
  selectedValue: Number | String
259
284
  }
260
285
  const selectDropdown = styled('div', selectDropdownAttrs)`
261
- box-sizing: border-box;
262
- z-index:${(props) => (props.isActive ? '2' : '1')};
263
- position:absolute;
264
- top:5px;
265
- border: ${BORDER_WIDTH} solid ${(props) => props.theme.colors.grey4};
266
- border-radius:4px;
267
- display: flex;
268
- flex-direction: column;
269
- align-items: flex-start;
270
- padding: 0px;
271
- box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
272
- width: ${(props) => (props.optionWidth ? props.optionWidth : '100%')};
273
- background-color:${(props) =>
274
- props.theme.colors[props.bgColor]
275
- ? props.theme.colors[props.bgColor]
276
- : props.bgColor};
277
- color:${(props) =>
278
- props.theme.colors[props.fontColor]
279
- ? props.theme.colors[props.fontColor]
280
- : props.fontColor};
281
- max-height:300px;
282
- overflow-y:auto;
283
- &>div[data-value="${(props) => props.hoveredValue}"]{
284
- background-color:${(props) =>
285
- props.theme.colors[props.hoveredBgColor]
286
- ? props.theme.colors[props.hoveredBgColor]
287
- : props.hoveredBgColor};
288
- }
286
+ box-sizing: border-box;
287
+ z-index: ${(props) => (props.isActive ? '2' : '1')};
288
+ position: absolute;
289
+ top: 5px;
290
+ border: ${BORDER_WIDTH} solid ${(props) => props.theme.colors.grey4};
291
+ border-radius: 4px;
292
+ display: flex;
293
+ flex-direction: column;
294
+ align-items: flex-start;
295
+ padding: 0px;
296
+ box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.2);
297
+ width: ${(props) => (props.optionWidth ? props.optionWidth : '100%')};
298
+ background-color: ${(props) =>
299
+ props.theme.colors[props.bgColor]
300
+ ? props.theme.colors[props.bgColor]
301
+ : props.bgColor};
302
+ color: ${(props) =>
303
+ props.theme.colors[props.fontColor]
304
+ ? props.theme.colors[props.fontColor]
305
+ : props.fontColor};
306
+ max-height: 300px;
307
+ overflow-y: auto;
308
+ & > div[data-value='${(props) => props.hoveredValue}'] {
309
+ background-color: ${(props) =>
310
+ props.theme.colors[props.hoveredBgColor]
311
+ ? props.theme.colors[props.hoveredBgColor]
312
+ : props.hoveredBgColor};
313
+ }
289
314
  `
290
315
  const DropdownWrapper = styled('div')`
291
316
  position: relative;