@itfin/components 1.0.79 → 1.0.83
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
|
<template>
|
|
2
2
|
|
|
3
|
-
<div class="itf-modal modal" ref="modal" tabindex="-1" :aria-labelledby="modalId" aria-hidden="true">
|
|
3
|
+
<div class="itf-modal modal fade" ref="modal" tabindex="-1" :aria-labelledby="modalId" aria-hidden="true">
|
|
4
4
|
<div
|
|
5
5
|
class="modal-dialog modal-fullscreen-sm-down"
|
|
6
6
|
:class="{[`modal-${size}`]: size}"
|
|
@@ -35,11 +35,6 @@
|
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
37
|
}
|
|
38
|
-
//.modal-open .itf-app {
|
|
39
|
-
// -webkit-filter: blur(5px) grayscale(1);
|
|
40
|
-
// -moz-filter: blur(5px) grayscale(1);
|
|
41
|
-
// filter: blur(5px) grayscale(1);
|
|
42
|
-
//}
|
|
43
38
|
</style>
|
|
44
39
|
<script>
|
|
45
40
|
import { Vue, Component, Prop, Watch, PropSync, Inject } from 'vue-property-decorator';
|
|
@@ -98,7 +93,7 @@ class itfModal extends Vue {
|
|
|
98
93
|
setTimeout(() => {
|
|
99
94
|
this.modalEl.show();
|
|
100
95
|
modalStack.push(this);
|
|
101
|
-
}, 500);
|
|
96
|
+
}, modalStack.length ? 500 : 0);
|
|
102
97
|
} else {
|
|
103
98
|
this.modalEl.hide();
|
|
104
99
|
modalStack.pop();
|
|
@@ -106,7 +101,7 @@ class itfModal extends Vue {
|
|
|
106
101
|
setTimeout(() => {
|
|
107
102
|
modalStack[modalStack.length - 1].show();
|
|
108
103
|
modalStack[modalStack.length - 1].bindEvents();
|
|
109
|
-
}, 500);
|
|
104
|
+
}, modalStack.length ? 500 : 0);
|
|
110
105
|
}
|
|
111
106
|
}
|
|
112
107
|
}
|
|
@@ -133,12 +128,16 @@ class itfModal extends Vue {
|
|
|
133
128
|
|
|
134
129
|
bindEvents() {
|
|
135
130
|
this.preventEvents = false;
|
|
136
|
-
this.$refs.modal
|
|
131
|
+
if (this.$refs.modal) {
|
|
132
|
+
this.$refs.modal.addEventListener('hidden.bs.modal', this.onClose);
|
|
133
|
+
}
|
|
137
134
|
}
|
|
138
135
|
|
|
139
136
|
unbindEvents() {
|
|
140
137
|
this.preventEvents = true;
|
|
141
|
-
this.$refs.modal
|
|
138
|
+
if (this.$refs.modal) {
|
|
139
|
+
this.$refs.modal.removeEventListener('hidden.bs.modal', this.onClose);
|
|
140
|
+
}
|
|
142
141
|
}
|
|
143
142
|
|
|
144
143
|
show() {
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
|
|
15
15
|
<slot
|
|
16
16
|
v-if="!isValueEmpty && !multiple && customRender"
|
|
17
|
-
|
|
17
|
+
:option="getOption(localValue)"
|
|
18
18
|
/>
|
|
19
19
|
<template v-else>
|
|
20
20
|
{{ getOptionLabel(localValue) }}
|
|
@@ -28,11 +28,9 @@
|
|
|
28
28
|
>
|
|
29
29
|
<slot
|
|
30
30
|
v-if="customRender"
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
remove: removeOptionValue
|
|
35
|
-
}"
|
|
31
|
+
:option="getOption(optionValue)"
|
|
32
|
+
:value="optionValue"
|
|
33
|
+
:remove="removeOptionValue"
|
|
36
34
|
/>
|
|
37
35
|
<div v-else class="valueMultiItem text-textDarkest" :style="getOptionColor(optionValue) ? `background-color: #${getOptionColor(optionValue)}; color: #fff` : ''">
|
|
38
36
|
<div class="valueMultiItemLabel">
|
|
@@ -68,11 +66,11 @@
|
|
|
68
66
|
</div>
|
|
69
67
|
</div>
|
|
70
68
|
|
|
71
|
-
<
|
|
69
|
+
<icon
|
|
72
70
|
v-if="(!multiple || isValueEmpty) && variant !== 'empty'"
|
|
73
71
|
class="ml-auto mr-1"
|
|
74
|
-
name="
|
|
75
|
-
></
|
|
72
|
+
name="chevron_down"
|
|
73
|
+
></icon>
|
|
76
74
|
</div>
|
|
77
75
|
|
|
78
76
|
<Dropdown
|
|
@@ -92,9 +90,9 @@
|
|
|
92
90
|
@change="handleChange"
|
|
93
91
|
@searchValueChange="handleSearchValueChange"
|
|
94
92
|
>
|
|
95
|
-
<template
|
|
96
|
-
<slot v-if="customRenderOption" name="option"
|
|
97
|
-
<slot v-else
|
|
93
|
+
<template #option="{ option }">
|
|
94
|
+
<slot v-if="customRenderOption" name="option" :option="option" />
|
|
95
|
+
<slot v-else :option="option" />
|
|
98
96
|
</template>
|
|
99
97
|
</Dropdown>
|
|
100
98
|
</div>
|
|
@@ -103,6 +101,7 @@
|
|
|
103
101
|
<script>
|
|
104
102
|
import { Component, Model, Prop, Ref } from 'vue-property-decorator';
|
|
105
103
|
import Vue from 'vue';
|
|
104
|
+
import Icon from '../icon/Icon.vue';
|
|
106
105
|
import Dropdown from './Dropdown.vue';
|
|
107
106
|
import { useOutsideClick } from './useOutsideClick';
|
|
108
107
|
|
|
@@ -110,7 +109,7 @@ const { bind, unbind } = useOutsideClick();
|
|
|
110
109
|
|
|
111
110
|
export default @Component({
|
|
112
111
|
name: 'itfAirSelect',
|
|
113
|
-
components: { Dropdown },
|
|
112
|
+
components: { Dropdown, Icon },
|
|
114
113
|
})
|
|
115
114
|
class itfAirSelect extends Vue {
|
|
116
115
|
@Model('input', { type: [Array, String, Number], default: undefined }) value;
|
|
@@ -139,6 +138,9 @@ class itfAirSelect extends Vue {
|
|
|
139
138
|
|
|
140
139
|
@Prop({ type: Boolean, default: false }) withClearValue;
|
|
141
140
|
|
|
141
|
+
@Prop({ type: Boolean, default: false }) customRender;
|
|
142
|
+
@Prop({ type: Boolean, default: false }) customRenderOption;
|
|
143
|
+
|
|
142
144
|
@Ref('selectRef') selectRef;
|
|
143
145
|
|
|
144
146
|
@Ref('dropdownRef') dropdownRef;
|
|
@@ -147,14 +149,6 @@ class itfAirSelect extends Vue {
|
|
|
147
149
|
|
|
148
150
|
searchValue = '';
|
|
149
151
|
|
|
150
|
-
get customRender() {
|
|
151
|
-
return !!this.$slots.default;
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
get customRenderOption() {
|
|
155
|
-
return !!this.$slots.option;
|
|
156
|
-
}
|
|
157
|
-
|
|
158
152
|
data() {
|
|
159
153
|
return {
|
|
160
154
|
stateValue: this.defaultValue || (this.multiple ? [] : null),
|
|
@@ -170,7 +164,6 @@ class itfAirSelect extends Vue {
|
|
|
170
164
|
}
|
|
171
165
|
|
|
172
166
|
getOptionColor(optionValue) {
|
|
173
|
-
console.info((this.getOption(optionValue) || { [this.itemColor]: '' })[this.itemColor])
|
|
174
167
|
return (this.getOption(optionValue) || { [this.itemColor]: '' })[this.itemColor];
|
|
175
168
|
}
|
|
176
169
|
|
|
@@ -267,6 +260,7 @@ class itfAirSelect extends Vue {
|
|
|
267
260
|
align-items: center;
|
|
268
261
|
width: 100%;
|
|
269
262
|
min-height: 32px;
|
|
263
|
+
justify-content: space-between;
|
|
270
264
|
}
|
|
271
265
|
.placeholder {
|
|
272
266
|
color: #8993a4;
|