@eturnity/eturnity_reusable_components 7.12.3 → 7.12.5
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
package/src/App.vue
CHANGED
@@ -14,87 +14,42 @@
|
|
14
14
|
textAlign="left"
|
15
15
|
:isInteractive="true"
|
16
16
|
:interactionStep="1"
|
17
|
-
@on-input="
|
17
|
+
@on-input="inputHandler"
|
18
18
|
@input-change="changeHandler"
|
19
19
|
@input-focus="focusHandler"
|
20
20
|
@input-blur="blurHandler"
|
21
21
|
>
|
22
22
|
<template v-slot:label>
|
23
|
-
<div>Interactive Label</div>
|
23
|
+
<div>Interactive Label 1</div>
|
24
24
|
</template>
|
25
25
|
</input-number>
|
26
26
|
|
27
|
-
<
|
28
|
-
<template #trigger><i>Click Me</i></template>
|
29
|
-
<template #dropdown>
|
30
|
-
<div>
|
31
|
-
<a href="">test1</a>
|
32
|
-
<button href="">test2</button>
|
33
|
-
<br />
|
34
|
-
<p>Text</p>
|
35
|
-
</div>
|
36
|
-
</template>
|
37
|
-
</dropdown-component>
|
38
|
-
|
39
|
-
<videoThumbnail
|
40
|
-
src="https://musicart.xboxlive.com/6/cfaf1e9d-0000-0000-0000-000000000009/504/image.jpg?w=1920&h=1080"
|
41
|
-
playIconColor="red"
|
42
|
-
playIconSize="20px"
|
43
|
-
width="400px"
|
44
|
-
height="600px"
|
45
|
-
/>
|
27
|
+
<hr>
|
46
28
|
|
47
|
-
<
|
48
|
-
@on-switch-change="onInputChange($event)"
|
49
|
-
:options="[
|
50
|
-
{ value: 0, content: 'zero' },
|
51
|
-
{ value: 1, content: 'one' },
|
52
|
-
{ value: 2, content: 'two' }
|
53
|
-
]"
|
54
|
-
:value="value"
|
55
|
-
label="label"
|
56
|
-
toggleColor="red"
|
57
|
-
size="large"
|
58
|
-
backgroundColor="blue"
|
59
|
-
labelAlign="left"
|
60
|
-
fontColor="black"
|
61
|
-
:disabled="false"
|
62
|
-
/>
|
63
|
-
<icon
|
64
|
-
name="opacity"
|
65
|
-
color="red"
|
66
|
-
hoveredColor="blue"
|
67
|
-
size="60px"
|
68
|
-
cursor="default"
|
69
|
-
isStriked="true"
|
70
|
-
/>
|
71
|
-
<Select
|
29
|
+
<input-number
|
72
30
|
:value="value"
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
31
|
+
:minNumber="0"
|
32
|
+
unitName="mm"
|
33
|
+
:numberPrecision="0"
|
34
|
+
backgroundColor="transparent"
|
35
|
+
borderColor="eturnityGrey"
|
36
|
+
inputHeight="34px"
|
37
|
+
inputWidth="420px"
|
38
|
+
textAlign="left"
|
39
|
+
:isInteractive="true"
|
40
|
+
:interactionStep="1"
|
41
|
+
@on-input="inputHandler"
|
42
|
+
@input-change="changeHandler"
|
43
|
+
@input-focus="focusHandler"
|
44
|
+
@input-blur="blurHandler"
|
81
45
|
>
|
82
|
-
<template
|
83
|
-
|
84
|
-
</template>
|
85
|
-
<template #dropdown>
|
86
|
-
<Option
|
87
|
-
v-for="opt in filteredOptionList"
|
88
|
-
:key="opt.id"
|
89
|
-
:value="opt.val"
|
90
|
-
>{{ opt.lookFor }}
|
91
|
-
</Option>
|
46
|
+
<template v-slot:label>
|
47
|
+
<div>Interactive Label 2</div>
|
92
48
|
</template>
|
93
|
-
</
|
94
|
-
|
95
|
-
{{ filteredOptionList }}
|
49
|
+
</input-number>
|
96
50
|
|
97
|
-
<
|
51
|
+
<hr>
|
52
|
+
<button @click="value=42">Click to set at 42</button>
|
98
53
|
</page-container>
|
99
54
|
</ThemeProvider>
|
100
55
|
</template>
|
@@ -104,64 +59,24 @@ import { ThemeProvider } from 'vue-styled-components'
|
|
104
59
|
import theme from './assets/theme'
|
105
60
|
import styled from 'vue-styled-components'
|
106
61
|
import InputNumber from '@/components/inputs/inputNumber'
|
107
|
-
import Select from '@/components/inputs/select'
|
108
|
-
import SwitchField from '@/components/inputs/switchField'
|
109
|
-
import Option from '@/components/inputs/select/option'
|
110
|
-
import iconCollection from '@/components/icon/iconCollection'
|
111
|
-
import dropdownComponent from '@/components/dropdown'
|
112
|
-
import videoThumbnail from '@/components/videoThumbnail'
|
113
|
-
import icon from '@/components/icon'
|
114
|
-
// import infoCard from '@/components/infoCard'
|
115
|
-
// import TableDropdown from "@/components/tableDropdown"
|
116
62
|
|
117
63
|
const PageContainer = styled.div`
|
118
64
|
padding: 40px;
|
119
65
|
`
|
120
66
|
|
121
|
-
// const RowContainer = styled.div`
|
122
|
-
// display: inline-flex;
|
123
|
-
// gap: 10px;
|
124
|
-
// flex-wrap: wrap;
|
125
|
-
// `
|
126
|
-
|
127
67
|
export default {
|
128
68
|
name: 'App',
|
129
69
|
components: {
|
130
70
|
ThemeProvider,
|
131
71
|
PageContainer,
|
132
72
|
InputNumber,
|
133
|
-
Option,
|
134
|
-
Select,
|
135
|
-
SwitchField,
|
136
|
-
iconCollection,
|
137
|
-
dropdownComponent,
|
138
|
-
videoThumbnail,
|
139
|
-
icon,
|
140
73
|
},
|
141
74
|
data() {
|
142
75
|
return {
|
143
76
|
value: 42,
|
144
|
-
value2: 42,
|
145
|
-
companyName: 'toto',
|
146
|
-
optionList: [
|
147
|
-
{ id: 'a', val: 'A', lookFor: 'babababa' },
|
148
|
-
{ id: 'b', val: 'B', lookFor: 'abab' },
|
149
|
-
{ id: 'c', val: 'C', lookFor: 'ccc' },
|
150
|
-
{ id: 'd', val: 'D', lookFor: 'ddd' },
|
151
|
-
{ id: 'e', val: 'E', lookFor: 'dddee' },
|
152
|
-
{ id: 'f', val: 'F', lookFor: 'ddfff' },
|
153
|
-
{ id: 'g', val: 'G', lookFor: 'dggg' },
|
154
|
-
{ id: 'h', val: 'H', lookFor: 'dddhhh' }
|
155
|
-
],
|
156
|
-
searchValue: ''
|
157
77
|
}
|
158
78
|
},
|
159
79
|
computed: {
|
160
|
-
filteredOptionList() {
|
161
|
-
return this.optionList.filter((opt) =>
|
162
|
-
opt.lookFor.includes(this.searchValue)
|
163
|
-
)
|
164
|
-
}
|
165
80
|
},
|
166
81
|
methods: {
|
167
82
|
blurHandler(e) {
|
@@ -174,64 +89,12 @@ export default {
|
|
174
89
|
console.log('focus', e)
|
175
90
|
},
|
176
91
|
inputHandler(e) {
|
177
|
-
this.value2 = e
|
178
92
|
console.log('input', e)
|
179
|
-
|
180
|
-
|
181
|
-
console.log('test', e)
|
93
|
+
//this.value = e
|
94
|
+
setTimeout(()=>{this.value = e},1000)
|
182
95
|
},
|
183
96
|
getTheme() {
|
184
97
|
return theme
|
185
|
-
},
|
186
|
-
onInputChange(event) {
|
187
|
-
this.inputValue = event
|
188
|
-
},
|
189
|
-
onInputBlur(event) {
|
190
|
-
console.log(event)
|
191
|
-
},
|
192
|
-
isDropdownOpen() {
|
193
|
-
return this.dropdownOpen
|
194
|
-
},
|
195
|
-
onClickButton() {
|
196
|
-
console.log('Test')
|
197
|
-
},
|
198
|
-
toggleDropdownOpen() {
|
199
|
-
this.dropdownOpen = !this.dropdownOpen
|
200
|
-
},
|
201
|
-
getDropdownValues() {
|
202
|
-
let items = []
|
203
|
-
items = [
|
204
|
-
{
|
205
|
-
value: this.getComponentInfo({
|
206
|
-
row: this.itemOptions[0],
|
207
|
-
value: 'display_name'
|
208
|
-
})
|
209
|
-
},
|
210
|
-
{
|
211
|
-
value: this.getComponentInfo({
|
212
|
-
row: this.itemOptions[0],
|
213
|
-
value: 'company_item_number'
|
214
|
-
})
|
215
|
-
},
|
216
|
-
{
|
217
|
-
value: this.getComponentInfo({
|
218
|
-
row: this.itemOptions[0],
|
219
|
-
value: 'model'
|
220
|
-
})
|
221
|
-
}
|
222
|
-
]
|
223
|
-
return items
|
224
|
-
},
|
225
|
-
getComponentInfo({ row, value }) {
|
226
|
-
let item
|
227
|
-
if (row.selectedValue && row.selectedValue[value]) {
|
228
|
-
item = row.selectedValue[value]
|
229
|
-
} else if (row[value]) {
|
230
|
-
item = row[value]
|
231
|
-
} else {
|
232
|
-
item = '-'
|
233
|
-
}
|
234
|
-
return item
|
235
98
|
}
|
236
99
|
}
|
237
100
|
}
|
@@ -98,7 +98,9 @@
|
|
98
98
|
// labelInfoAlign="left"
|
99
99
|
// :minNumber="0"
|
100
100
|
// fontColor="blue"
|
101
|
-
//
|
101
|
+
// >
|
102
|
+
//<template name=label><img>....</template>
|
103
|
+
//</inputNumber>
|
102
104
|
import styled from 'vue-styled-components'
|
103
105
|
import {
|
104
106
|
stringToNumber,
|
@@ -467,7 +469,7 @@ export default {
|
|
467
469
|
}
|
468
470
|
},
|
469
471
|
methods: {
|
470
|
-
onEnterPress(
|
472
|
+
onEnterPress(){
|
471
473
|
this.$emit('on-enter-click')
|
472
474
|
this.$refs.inputField1.$el.blur()
|
473
475
|
},
|
@@ -547,6 +549,9 @@ export default {
|
|
547
549
|
return array
|
548
550
|
},
|
549
551
|
onInput(value) {
|
552
|
+
// if(!this.isFocused){
|
553
|
+
// return
|
554
|
+
// }
|
550
555
|
if (this.isBlurred) {
|
551
556
|
this.isBlurred = false
|
552
557
|
return
|
@@ -653,7 +658,7 @@ export default {
|
|
653
658
|
e.preventDefault()
|
654
659
|
let value = parseFloat(this.value || 0)
|
655
660
|
value += parseFloat(this.interactionStep) * parseInt(e.movementX)
|
656
|
-
this.$emit('on-input', value)
|
661
|
+
this.$emit('on-input-drag', value)
|
657
662
|
|
658
663
|
this.textInput = numberToString({
|
659
664
|
value: value && value.length ? value : this.minNumber,
|
@@ -74,7 +74,7 @@ export const datePickerLang = (lang) => {
|
|
74
74
|
return 'it'
|
75
75
|
} else if (lang === 'en-us' || lang === 'en-gb') {
|
76
76
|
return 'en'
|
77
|
-
} else if (lang === 'es-es' || lang === 'ca-es') {
|
77
|
+
} else if (lang === 'es-es' || lang === 'ca-es' || lang === 'pt-pt') {
|
78
78
|
return 'es'
|
79
79
|
} else {
|
80
80
|
return lang
|