@eturnity/eturnity_reusable_components 1.2.37 → 1.2.38

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": "1.2.37",
3
+ "version": "1.2.38",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "dev": "vue-cli-service serve",
@@ -1,9 +1,13 @@
1
1
  <template>
2
2
  <container :inputWidth="inputWidth" :alignItems="alignItems">
3
- <label-slot-wrapper v-if="hasLabelSlot" :isInteractive="isInteractive" @mousedown="initInteraction">
3
+ <label-slot-wrapper
4
+ v-if="hasLabelSlot"
5
+ :isInteractive="isInteractive"
6
+ @mousedown="initInteraction"
7
+ >
4
8
  <slot name="label"></slot>
5
9
  </label-slot-wrapper>
6
-
10
+
7
11
  <label-wrapper v-if="labelText">
8
12
  <label-text :labelFontColor="labelFontColor">
9
13
  {{ labelText }}
@@ -108,23 +112,23 @@ const inputProps = {
108
112
  textAlign: String,
109
113
  fontSize: String,
110
114
  fontColor: String,
111
- backgroundColor:String,
115
+ backgroundColor: String,
112
116
  hasSlot: Boolean,
113
117
  hasLabelSlot: Boolean,
114
118
  slotSize: String,
115
- inputHeight:String,
116
- isInteractive:Boolean,
117
- alignItems:String,
118
- labelFontColor:String,
119
- borderColor:String
119
+ inputHeight: String,
120
+ isInteractive: Boolean,
121
+ alignItems: String,
122
+ labelFontColor: String,
123
+ borderColor: String
120
124
  }
121
125
 
122
126
  const Container = styled('div', inputProps)`
123
127
  width: ${(props) => (props.inputWidth ? props.inputWidth : '100%')};
124
128
  position: relative;
125
- display:grid;
129
+ display: grid;
126
130
  grid-template-columns: ${(props) =>
127
- props.alignItems === "vertical" ? "1fr" : "auto 1fr"};
131
+ props.alignItems === 'vertical' ? '1fr' : 'auto 1fr'};
128
132
  `
129
133
 
130
134
  const InputContainer = styled('input', inputProps)`
@@ -133,18 +137,16 @@ const InputContainer = styled('input', inputProps)`
133
137
  ? '1px solid ' + props.theme.colors.red
134
138
  : props.noBorder
135
139
  ? 'none'
136
- : props.borderColor ?
137
- props.theme.colors[props.borderColor]
138
- ? '1px solid ' + props.theme.colors[props.borderColor]
139
- : '1px solid ' + props.borderColor
140
+ : props.borderColor
141
+ ? props.theme.colors[props.borderColor]
142
+ ? '1px solid ' + props.theme.colors[props.borderColor]
143
+ : '1px solid ' + props.borderColor
140
144
  : '1px solid ' + props.theme.colors.grey4};
141
145
  padding-top: 11px;
142
146
  padding-bottom: 11px;
143
147
  padding-left: 10px;
144
148
  padding-right: ${(props) =>
145
- props.slotSize
146
- ? 'calc(' + props.slotSize + ' + 10px)'
147
- : '5px'};
149
+ props.slotSize ? 'calc(' + props.slotSize + ' + 10px)' : '5px'};
148
150
  border-radius: 4px;
149
151
  text-align: ${(props) => props.textAlign};
150
152
  cursor: ${(props) => (props.isDisabled ? 'not-allowed' : 'auto')};
@@ -157,10 +159,12 @@ const InputContainer = styled('input', inputProps)`
157
159
  : props.fontColor
158
160
  ? props.fontColor + ' !important'
159
161
  : props.theme.colors.black};
160
- background-color:${(props) => props.backgroundColor
161
- ? props.backgroundColor+' !important'
162
- : props.theme.colors.white};
163
- width: ${(props) => (props.inputWidth && !props.hasLabelSlot ? props.inputWidth : '100%')};
162
+ background-color: ${(props) =>
163
+ props.backgroundColor
164
+ ? props.backgroundColor + ' !important'
165
+ : props.theme.colors.white};
166
+ width: ${(props) =>
167
+ props.inputWidth && !props.hasLabelSlot ? props.inputWidth : '100%'};
164
168
  min-width: ${(props) => (props.minWidth ? props.minWidth : 'unset')};
165
169
  background-color: ${(props) =>
166
170
  props.isDisabled ? props.theme.colors.grey5 : '#fff'};
@@ -198,7 +202,7 @@ const UnitContainer = styled('span', inputProps)`
198
202
  : props.theme.colors.mediumGray};
199
203
  position: absolute;
200
204
  right: 10px;
201
- top: 0;
205
+ top: 10px;
202
206
  padding-left: 10px;
203
207
  text-align: right;
204
208
  color: ${(props) =>
@@ -232,23 +236,26 @@ const SlotContainer = styled('span', inputProps)`
232
236
  : props.theme.colors.mediumGray};
233
237
  `
234
238
 
235
- const LabelWrapper = styled('div',inputProps)`
239
+ const LabelWrapper = styled('div', inputProps)`
236
240
  display: flex;
237
241
  align-items: center;
238
242
  gap: 10px;
239
243
  margin-bottom: 8px;
240
- cursor: ${(props) => (props.isInteractive?'ew-resize':'auto')};
244
+ cursor: ${(props) => (props.isInteractive ? 'ew-resize' : 'auto')};
241
245
  `
242
- const LabelSlotWrapper = styled('div',inputProps)`
246
+ const LabelSlotWrapper = styled('div', inputProps)`
243
247
  display: flex;
244
248
  gap: 10px;
245
- align-items:center;
246
- cursor: ${(props) => (props.isInteractive?'ew-resize':'auto')};
249
+ align-items: center;
250
+ cursor: ${(props) => (props.isInteractive ? 'ew-resize' : 'auto')};
247
251
  `
248
252
 
249
- const LabelText = styled('div',inputProps)`
253
+ const LabelText = styled('div', inputProps)`
250
254
  font-size: 13px;
251
- color: ${(props) => props.theme.colors[props.labelFontColor]?props.theme.colors[props.labelFontColor]:props.labelFontColor};
255
+ color: ${(props) =>
256
+ props.theme.colors[props.labelFontColor]
257
+ ? props.theme.colors[props.labelFontColor]
258
+ : props.labelFontColor};
252
259
  font-weight: 700;
253
260
  `
254
261
 
@@ -265,7 +272,7 @@ export default {
265
272
  LabelText,
266
273
  InfoText,
267
274
  Icon,
268
- SlotContainer,
275
+ SlotContainer
269
276
  },
270
277
  inheritAttrs: false,
271
278
  data() {
@@ -306,7 +313,7 @@ export default {
306
313
  },
307
314
  alignItems: {
308
315
  required: false,
309
- default: "vertical",
316
+ default: 'vertical'
310
317
  },
311
318
  errorMessage: {
312
319
  required: false,
@@ -332,8 +339,8 @@ export default {
332
339
  required: false,
333
340
  default: false
334
341
  },
335
- borderColor:{
336
- required:false,
342
+ borderColor: {
343
+ required: false
337
344
  },
338
345
  textAlign: {
339
346
  required: false,
@@ -347,9 +354,9 @@ export default {
347
354
  required: false,
348
355
  default: false
349
356
  },
350
- interactionStep:{
351
- required:false,
352
- default:1
357
+ interactionStep: {
358
+ required: false,
359
+ default: 1
353
360
  },
354
361
  labelText: {
355
362
  required: false,
@@ -401,9 +408,9 @@ export default {
401
408
  slotSize: {
402
409
  required: false
403
410
  },
404
- labelFontColor:{
405
- required:false,
406
- default:'eturnityGrey'
411
+ labelFontColor: {
412
+ required: false,
413
+ default: 'eturnityGrey'
407
414
  }
408
415
  },
409
416
  computed: {
@@ -414,9 +421,9 @@ export default {
414
421
  hasSlot() {
415
422
  return !!this.$slots.default
416
423
  },
417
- hasLabelSlot(){
424
+ hasLabelSlot() {
418
425
  return !!this.$slots.label
419
- },
426
+ }
420
427
  },
421
428
  methods: {
422
429
  onChangeHandler(event) {
@@ -465,13 +472,13 @@ export default {
465
472
  }
466
473
  return evaluated
467
474
  },
468
- onInput(value){
475
+ onInput(value) {
469
476
  let evaluatedVal
470
- try{
471
- evaluatedVal=this.onEvaluateCode(value)
472
- }finally {
473
- if(evaluatedVal){
474
- this.$emit('on-input',evaluatedVal)
477
+ try {
478
+ evaluatedVal = this.onEvaluateCode(value)
479
+ } finally {
480
+ if (evaluatedVal) {
481
+ this.$emit('on-input', evaluatedVal)
475
482
  }
476
483
  }
477
484
  },
@@ -543,31 +550,30 @@ export default {
543
550
  }
544
551
  },
545
552
  initInteraction(e) {
546
- window.addEventListener('mousemove', this.interact, false);
547
- window.addEventListener('mouseup', this.stopInteract, false);
548
- e.preventDefault()
553
+ window.addEventListener('mousemove', this.interact, false)
554
+ window.addEventListener('mouseup', this.stopInteract, false)
555
+ e.preventDefault()
549
556
  this.focusInput()
550
557
  },
551
558
  interact(e) {
552
- e.preventDefault()
553
- let value=parseFloat(this.value || 0)
554
- console.log("value",value)
555
- value+=parseFloat(this.interactionStep)*parseInt(e.movementX)
556
- this.$emit('on-input',value)
559
+ e.preventDefault()
560
+ let value = parseFloat(this.value || 0)
561
+ console.log('value', value)
562
+ value += parseFloat(this.interactionStep) * parseInt(e.movementX)
563
+ this.$emit('on-input', value)
557
564
 
558
- this.textInput=numberToString({
559
- value:
560
- value && value.length ? value : this.minNumber,
561
- numberPrecision: this.numberPrecision
562
- })
565
+ this.textInput = numberToString({
566
+ value: value && value.length ? value : this.minNumber,
567
+ numberPrecision: this.numberPrecision
568
+ })
563
569
  //this.value=value
564
570
  },
565
571
  stopInteract(e) {
566
- e.preventDefault()
567
- window.removeEventListener('mousemove', this.interact, false);
568
- window.removeEventListener('mouseup', this.stopInteract, false);
572
+ e.preventDefault()
573
+ window.removeEventListener('mousemove', this.interact, false)
574
+ window.removeEventListener('mouseup', this.stopInteract, false)
569
575
  this.blurInput()
570
- },
576
+ }
571
577
  },
572
578
  created() {
573
579
  if (this.value) {