@itfin/components 1.3.18 → 1.3.20
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
|
@@ -88,7 +88,7 @@
|
|
|
88
88
|
pointer-events: none;
|
|
89
89
|
display: block;
|
|
90
90
|
position: relative;
|
|
91
|
-
z-index: 2;
|
|
91
|
+
//z-index: 2;
|
|
92
92
|
-webkit-transition: all .2s ease;
|
|
93
93
|
transition: all .2s ease;
|
|
94
94
|
will-change: transform;
|
|
@@ -96,7 +96,7 @@
|
|
|
96
96
|
}
|
|
97
97
|
|
|
98
98
|
input {
|
|
99
|
-
z-index: 2;
|
|
99
|
+
//z-index: 2;
|
|
100
100
|
position: absolute;
|
|
101
101
|
top: 0;
|
|
102
102
|
left: 0;
|
|
@@ -119,7 +119,7 @@
|
|
|
119
119
|
&:checked + label::before,
|
|
120
120
|
&:checked + label::after {
|
|
121
121
|
background: var(--itf-segmeneted-control--background);
|
|
122
|
-
z-index: 1;
|
|
122
|
+
//z-index: 1;
|
|
123
123
|
}
|
|
124
124
|
}
|
|
125
125
|
}
|
|
@@ -132,7 +132,7 @@
|
|
|
132
132
|
border-radius: var(--itf-segmeneted-control--border-radius);
|
|
133
133
|
grid-column: 1;
|
|
134
134
|
grid-row: 1;
|
|
135
|
-
z-index: 2;
|
|
135
|
+
//z-index: 2;
|
|
136
136
|
will-change: transform;
|
|
137
137
|
-webkit-transition: transform .2s ease;
|
|
138
138
|
transition: transform .2s ease;
|
|
@@ -1,32 +1,3 @@
|
|
|
1
|
-
<!--template>
|
|
2
|
-
|
|
3
|
-
<div class="itf-dropdown" :class="`drop${placement}`">
|
|
4
|
-
<div v-if="disabled"><slot name="button">{{label}}</slot></div>
|
|
5
|
-
<itf-button
|
|
6
|
-
v-else-if="!text"
|
|
7
|
-
:class="{ 'dropdown-toggle': toggle }"
|
|
8
|
-
v-bind="buttonOptions"
|
|
9
|
-
ref="toggle"
|
|
10
|
-
:id="modalId"
|
|
11
|
-
data-bs-toggle="dropdown"
|
|
12
|
-
aria-expanded="false"
|
|
13
|
-
>
|
|
14
|
-
<slot name="button">{{label}}</slot>
|
|
15
|
-
</itf-button>
|
|
16
|
-
<div v-else :class="{ 'dropdown-toggle': toggle }" ref="toggle" :id="modalId" data-bs-toggle="dropdown" aria-expanded="false">
|
|
17
|
-
<slot name="button">{{label}}</slot>
|
|
18
|
-
</div>
|
|
19
|
-
<div
|
|
20
|
-
class="itf-dropdown__menu dropdown-menu"
|
|
21
|
-
:class="{'dropdown-menu-end': right, 'shadow': shadow}"
|
|
22
|
-
ref="dropdown"
|
|
23
|
-
v-bind="menuOptions"
|
|
24
|
-
:aria-labelledby="modalId">
|
|
25
|
-
<slot></slot>
|
|
26
|
-
</div>
|
|
27
|
-
</div>
|
|
28
|
-
|
|
29
|
-
</template-->
|
|
30
1
|
<script>
|
|
31
2
|
import { Vue, Component, Prop, Watch, PropSync } from 'vue-property-decorator';
|
|
32
3
|
import itfButton from '../button/Button';
|
|
@@ -49,7 +20,7 @@ class itfDropdown extends Vue {
|
|
|
49
20
|
@Prop({ type: Boolean }) shadow;
|
|
50
21
|
@Prop({ type: Boolean }) disabled;
|
|
51
22
|
@Prop({ type: Boolean }) text;
|
|
52
|
-
@Prop({ type: Boolean }) appendToBody;
|
|
23
|
+
@Prop({ type: Boolean, default: true }) appendToBody;
|
|
53
24
|
@Prop({ validator: (value) => [true, false, 'inside', 'outside'].includes(value), default: true }) autoclose;
|
|
54
25
|
@Prop({ type: Object, default: () => ({}) }) buttonOptions;
|
|
55
26
|
@Prop({ type: Object, default: () => ({}) }) menuOptions;
|
|
@@ -80,23 +51,24 @@ class itfDropdown extends Vue {
|
|
|
80
51
|
staticClass: 'dropdown'
|
|
81
52
|
}, [
|
|
82
53
|
createElement(
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
54
|
+
'itf-button',
|
|
55
|
+
{
|
|
56
|
+
props: this.buttonOptions || {},
|
|
57
|
+
class: { 'dropdown-toggle': this.toggle },
|
|
58
|
+
attrs: { id: modalId, 'data-bs-toggle': 'dropdown', 'aria-expanded': 'false' },
|
|
59
|
+
ref: 'toggle',
|
|
60
|
+
},
|
|
61
|
+
this.$slots.button || label
|
|
91
62
|
),
|
|
92
63
|
createElement(
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
64
|
+
'div',
|
|
65
|
+
{
|
|
66
|
+
attrs: { rel: 'dropdown' , 'aria-labelledby': modalId},
|
|
67
|
+
class: { 'dropdown-menu-end': right, 'shadow': shadow },
|
|
68
|
+
staticClass: 'itf-dropdown__menu dropdown-menu',
|
|
69
|
+
ref: 'dropdown',
|
|
70
|
+
},
|
|
71
|
+
this.$slots.default
|
|
100
72
|
)
|
|
101
73
|
]);
|
|
102
74
|
}
|
|
@@ -110,15 +82,19 @@ class itfDropdown extends Vue {
|
|
|
110
82
|
if (typeof window === 'undefined' || !this.$refs.toggle) {
|
|
111
83
|
return;
|
|
112
84
|
}
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
this.$refs.dropdown
|
|
121
|
-
|
|
85
|
+
try {
|
|
86
|
+
const {default: Dropdown} = await import('bootstrap/js/src/dropdown.js');
|
|
87
|
+
this.modalEl = new Dropdown(this.$refs.toggle, {
|
|
88
|
+
reference: 'toggle',
|
|
89
|
+
autoClose: this.autoclose
|
|
90
|
+
});
|
|
91
|
+
let context = document.body;
|
|
92
|
+
if (this.appendToBody && this.$refs.dropdown instanceof Node && this.$refs.dropdown.parentNode) {
|
|
93
|
+
this.$refs.dropdown.parentNode.removeChild(this.$refs.dropdown);
|
|
94
|
+
context.appendChild(this.$refs.dropdown); // should append only to body
|
|
95
|
+
}
|
|
96
|
+
} catch (err) {
|
|
97
|
+
// ignore
|
|
122
98
|
}
|
|
123
99
|
|
|
124
100
|
this.$el.addEventListener('shown.bs.dropdown', () => {
|