@itfin/components 1.2.104 → 1.2.106
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
|
@@ -40,8 +40,8 @@
|
|
|
40
40
|
</div>
|
|
41
41
|
</div>
|
|
42
42
|
<div class="align-items-end d-flex pb-1">
|
|
43
|
-
<slot name="add-column"
|
|
44
|
-
<itf-button icon small>
|
|
43
|
+
<slot name="add-column">
|
|
44
|
+
<itf-button icon small @click="$emit('add-сolumn')">
|
|
45
45
|
<itf-icon name="plus" />
|
|
46
46
|
</itf-button>
|
|
47
47
|
</slot>
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div class="itf-board-card shadow-sm">
|
|
2
|
+
<div class="itf-board-card shadow-sm" @click="$emit('click')" tabindex="0">
|
|
3
3
|
<slot name="header"></slot>
|
|
4
4
|
|
|
5
|
-
<div class="itf-board-card-inner d-flex"
|
|
5
|
+
<div class="itf-board-card-inner d-flex">
|
|
6
6
|
<div class="flex-grow-1 itf-board-card-inner-content">
|
|
7
7
|
<slot>{{text}}</slot>
|
|
8
8
|
</div>
|
|
9
|
-
<div>
|
|
10
|
-
<itf-button icon small>
|
|
9
|
+
<div v-if="dropdown">
|
|
10
|
+
<itf-button icon small @click.prevent.stop="">
|
|
11
11
|
<itf-icon name="menu_horizontal" />
|
|
12
12
|
</itf-button>
|
|
13
13
|
</div>
|
|
14
14
|
</div>
|
|
15
15
|
|
|
16
|
-
<div class="itf-board-card-footer d-flex">
|
|
16
|
+
<div class="itf-board-card-footer pt-1 d-flex">
|
|
17
17
|
<slot name="footer"></slot>
|
|
18
18
|
</div>
|
|
19
19
|
</div>
|
|
@@ -39,5 +39,6 @@ export default @Component({
|
|
|
39
39
|
})
|
|
40
40
|
class BoardColumn extends Vue {
|
|
41
41
|
@Prop() text;
|
|
42
|
+
@Prop(Boolean) dropdown;
|
|
42
43
|
}
|
|
43
44
|
</script>
|
|
@@ -1,9 +1,18 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="itf-board-column-wrapper">
|
|
3
|
-
<
|
|
3
|
+
<div v-if="isNewOptionVisible">
|
|
4
|
+
<itf-text-field
|
|
5
|
+
style="margin: -4px 0"
|
|
6
|
+
ref="newOptionInput"
|
|
7
|
+
v-model="newOption"
|
|
8
|
+
:placeholder="newItemPlaceholder"
|
|
9
|
+
@blur="onBlurOption"
|
|
10
|
+
@keydown.enter="submitNewOption"
|
|
11
|
+
/>
|
|
12
|
+
</div>
|
|
13
|
+
<itf-button v-else-if="showAddButton" :loading="loading" block small class="text-muted" @click="addNewOption">
|
|
4
14
|
<itf-icon name="plus" />
|
|
5
|
-
|
|
6
|
-
Add entry
|
|
15
|
+
{{ newItemText }}
|
|
7
16
|
</itf-button>
|
|
8
17
|
|
|
9
18
|
<div class="itf-board-cards-wrapper" ref="container">
|
|
@@ -43,6 +52,7 @@ import itfButton from '../button/Button';
|
|
|
43
52
|
import loading from '../../directives/loading';
|
|
44
53
|
import itfForm from '../form/Form';
|
|
45
54
|
import itfEditButton from '../editable/EditButton';
|
|
55
|
+
import itfTextField from '../text-field/TextField.vue';
|
|
46
56
|
import createDraggable from '../sortable/draggable';
|
|
47
57
|
|
|
48
58
|
const { Node, ...draggableDirectives } = createDraggable({
|
|
@@ -59,6 +69,7 @@ const { Node, ...draggableDirectives } = createDraggable({
|
|
|
59
69
|
|
|
60
70
|
export default @Component({
|
|
61
71
|
components: {
|
|
72
|
+
itfTextField,
|
|
62
73
|
itfIcon,
|
|
63
74
|
itfForm,
|
|
64
75
|
itfEditButton,
|
|
@@ -77,6 +88,12 @@ class BoardColumn extends Vue {
|
|
|
77
88
|
@Prop(Array) items;
|
|
78
89
|
@Prop(Boolean) showAddButton;
|
|
79
90
|
@Prop(Boolean) cardSorting;
|
|
91
|
+
@Prop(Boolean) loading;
|
|
92
|
+
@Prop({ type: String, default: 'Add new task' }) newItemText;
|
|
93
|
+
@Prop({ type: String, default: 'Type a new task...' }) newItemPlaceholder;
|
|
94
|
+
|
|
95
|
+
isNewOptionVisible = false;
|
|
96
|
+
newOption = '';
|
|
80
97
|
|
|
81
98
|
beforeDestroy() {
|
|
82
99
|
if (this.cardSorting) {
|
|
@@ -107,5 +124,26 @@ class BoardColumn extends Vue {
|
|
|
107
124
|
}
|
|
108
125
|
});
|
|
109
126
|
}
|
|
127
|
+
|
|
128
|
+
onBlurOption() {
|
|
129
|
+
this.isNewOptionVisible = false;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
addNewOption() {
|
|
133
|
+
this.newOption = '';
|
|
134
|
+
this.isNewOptionVisible = true;
|
|
135
|
+
this.$nextTick(() => {
|
|
136
|
+
this.$refs.newOptionInput.focus();
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
submitNewOption() {
|
|
141
|
+
const newOption = this.newOption;
|
|
142
|
+
if (newOption) {
|
|
143
|
+
this.$emit('create', newOption);
|
|
144
|
+
this.newOption = '';
|
|
145
|
+
this.isNewOptionVisible = false;
|
|
146
|
+
}
|
|
147
|
+
}
|
|
110
148
|
}
|
|
111
149
|
</script>
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
:root {
|
|
2
|
-
--itf-board-column-hover-color:
|
|
2
|
+
--itf-board-column-hover-color: rgba(0, 0, 0, .05);
|
|
3
3
|
--itf-board-column-width: 300px;
|
|
4
4
|
--itf-board-placeholder-color: #47BEFF;
|
|
5
5
|
--itf-board-placeholder-border-color: #0567eb;
|
|
6
6
|
--itf-board-placeholder-bg-color: #ebeffe;
|
|
7
7
|
--itf-board-card-bg-color: #fff;
|
|
8
|
+
--itf-board-card-hover-color: rgba(0, 0, 0, .05);
|
|
8
9
|
--itf-board-card-border-color: #ccc;
|
|
9
10
|
}
|
|
10
11
|
|
|
11
12
|
[data-theme="dark"] {
|
|
12
|
-
--itf-board-column-hover-color:
|
|
13
|
+
--itf-board-column-hover-color: rgba(255, 255, 255, .05);
|
|
13
14
|
--itf-board-placeholder-color: #FFCC00;
|
|
14
15
|
--itf-board-placeholder-border-color: #FFCC00;
|
|
15
16
|
--itf-board-placeholder-bg-color: #383b41;
|
|
@@ -214,6 +215,11 @@
|
|
|
214
215
|
overflow: hidden;
|
|
215
216
|
user-select: none;
|
|
216
217
|
padding: .5rem;
|
|
218
|
+
cursor: pointer;
|
|
219
|
+
|
|
220
|
+
&:hover, &:focus {
|
|
221
|
+
background-color: var(--itf-board-card-hover-bg-color);
|
|
222
|
+
}
|
|
217
223
|
|
|
218
224
|
.itf-board-card-inner {
|
|
219
225
|
font-size: .875rem;
|