@eturnity/eturnity_reusable_components 1.2.42 → 1.2.44
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
@@ -3,8 +3,7 @@
|
|
3
3
|
<page-container>
|
4
4
|
<br />
|
5
5
|
|
6
|
-
|
7
|
-
<div :style="{ padding: '50px' }">
|
6
|
+
|
8
7
|
<input-number
|
9
8
|
:value="value"
|
10
9
|
:minNumber="0"
|
@@ -45,6 +44,50 @@
|
|
45
44
|
:disabled="false"
|
46
45
|
/>
|
47
46
|
|
47
|
+
<Select
|
48
|
+
:value="value"
|
49
|
+
selectWidth="100%"
|
50
|
+
optionWidth="50%"
|
51
|
+
label="that is a label"
|
52
|
+
alignItems="vertical"
|
53
|
+
colorMode="dark"
|
54
|
+
@input-change="value = $event"
|
55
|
+
@search-change="searchValue = $event"
|
56
|
+
>
|
57
|
+
<template #selector="{ selectedValue }">
|
58
|
+
value selected: {{ selectedValue }}
|
59
|
+
</template>
|
60
|
+
<template #dropdown>
|
61
|
+
<Option
|
62
|
+
v-for="opt in filteredOptionList"
|
63
|
+
:key="opt.id"
|
64
|
+
:value="opt.val"
|
65
|
+
>{{ opt.lookFor }}</Option
|
66
|
+
>
|
67
|
+
</template>
|
68
|
+
</Select>
|
69
|
+
<Select
|
70
|
+
:value="value"
|
71
|
+
selectWidth="100%"
|
72
|
+
optionWidth="50%"
|
73
|
+
label="that is a label"
|
74
|
+
alignItems="vertical"
|
75
|
+
colorMode="dark"
|
76
|
+
@input-change="value = $event"
|
77
|
+
@search-change="searchValue = $event"
|
78
|
+
>
|
79
|
+
<template #selector="{ selectedValue }">
|
80
|
+
value selected: {{ selectedValue }}
|
81
|
+
</template>
|
82
|
+
<template #dropdown>
|
83
|
+
<Option
|
84
|
+
v-for="opt in filteredOptionList"
|
85
|
+
:key="opt.id"
|
86
|
+
:value="opt.val"
|
87
|
+
>{{ opt.lookFor }}</Option
|
88
|
+
>
|
89
|
+
</template>
|
90
|
+
</Select>
|
48
91
|
<Select
|
49
92
|
:value="value"
|
50
93
|
selectWidth="100%"
|
@@ -68,8 +111,7 @@
|
|
68
111
|
</template>
|
69
112
|
</Select>
|
70
113
|
{{ filteredOptionList }}
|
71
|
-
|
72
|
-
</modal>
|
114
|
+
|
73
115
|
<iconCollection />
|
74
116
|
</page-container>
|
75
117
|
</ThemeProvider>
|
@@ -83,7 +125,6 @@ import InputNumber from '@/components/inputs/inputNumber'
|
|
83
125
|
import Select from '@/components/inputs/select'
|
84
126
|
import SwitchField from '@/components/inputs/switchField'
|
85
127
|
import Option from '@/components/inputs/select/option'
|
86
|
-
import Modal from '@/components/modals/modal'
|
87
128
|
import iconCollection from '@/components/icon/iconCollection'
|
88
129
|
// import TableDropdown from "@/components/tableDropdown"
|
89
130
|
|
@@ -103,7 +144,6 @@ export default {
|
|
103
144
|
ThemeProvider,
|
104
145
|
PageContainer,
|
105
146
|
InputNumber,
|
106
|
-
Modal,
|
107
147
|
Option,
|
108
148
|
Select,
|
109
149
|
SwitchField,
|
@@ -44,7 +44,7 @@
|
|
44
44
|
<div v-else>
|
45
45
|
<slot name="selector" :selectedValue="selectedValue"></slot>
|
46
46
|
</div>
|
47
|
-
<Caret :isUp="isDropdownOpen"
|
47
|
+
<Caret :isUp="isDropdownOpen" >
|
48
48
|
<icon name="arrow_up" size="12px" :color="caretColor || colorMode=='dark'?'white':'transparentBlack1'"/>
|
49
49
|
</Caret>
|
50
50
|
</selectButton>
|
@@ -279,6 +279,9 @@ const InputWrapper = styled('div', inputAttrs)`
|
|
279
279
|
mounted(){
|
280
280
|
this.selectedValue=this.value
|
281
281
|
},
|
282
|
+
beforeDestroy(){
|
283
|
+
document.removeEventListener('click', this.clickOutside)
|
284
|
+
},
|
282
285
|
methods:{
|
283
286
|
focus(){
|
284
287
|
this.isActive=true
|
@@ -286,11 +289,11 @@ const InputWrapper = styled('div', inputAttrs)`
|
|
286
289
|
blur(){
|
287
290
|
this.isActive=false
|
288
291
|
},
|
289
|
-
toggleDropdown(
|
292
|
+
toggleDropdown(){
|
290
293
|
if(this.isSearchBarVisible){return}
|
291
294
|
this.isDropdownOpen=!this.isDropdownOpen
|
292
295
|
if (this.isDropdownOpen) {
|
293
|
-
|
296
|
+
document.addEventListener('click', this.clickOutside)
|
294
297
|
} else {
|
295
298
|
document.removeEventListener('click', this.clickOutside)
|
296
299
|
}
|
@@ -299,7 +302,7 @@ const InputWrapper = styled('div', inputAttrs)`
|
|
299
302
|
openDropdown(){
|
300
303
|
this.focus()
|
301
304
|
this.isDropdownOpen=true
|
302
|
-
|
305
|
+
document.addEventListener('click', this.clickOutside)
|
303
306
|
},
|
304
307
|
closeDropdown(){
|
305
308
|
this.blur()
|
@@ -337,6 +340,7 @@ const InputWrapper = styled('div', inputAttrs)`
|
|
337
340
|
}))
|
338
341
|
},
|
339
342
|
clickOutside(event) {
|
343
|
+
console.log("click outside",event)
|
340
344
|
if (this.$el==event.target || this.$el.contains(event.target)) {
|
341
345
|
return
|
342
346
|
}
|