@itfin/components 1.2.116 → 1.2.118
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
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
<slot name="empty"></slot>
|
|
21
21
|
</template>
|
|
22
22
|
<template v-else>
|
|
23
|
-
<div v-for="(item, index) of items" :key="index" :data-card="index">
|
|
23
|
+
<div v-for="(item, index) of items" :key="index" :data-card="index" :class="item.hidden ? 'd-none' : ''">
|
|
24
24
|
<div accept-group="board-cards"
|
|
25
25
|
class="itf-board-card-space"
|
|
26
26
|
@enter="cardHighlight(index, 'enter', 'drop')"
|
|
@@ -247,11 +247,22 @@
|
|
|
247
247
|
}
|
|
248
248
|
|
|
249
249
|
.itf-board-cards-wrapper {
|
|
250
|
+
display: flex;
|
|
251
|
+
flex-direction: column;
|
|
250
252
|
overflow: auto;
|
|
251
253
|
flex-grow: 1;
|
|
252
254
|
padding-right: .25rem;
|
|
253
255
|
padding-top: .5rem;
|
|
254
256
|
|
|
257
|
+
> div:first-child > .itf-board-card-space > .itf-board-header-dropzone {
|
|
258
|
+
top: -30px;
|
|
259
|
+
z-index: 100;
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
> .itf-board-card-space:last-child {
|
|
263
|
+
flex: 1;
|
|
264
|
+
}
|
|
265
|
+
|
|
255
266
|
.draggable-source--is-dragging {
|
|
256
267
|
position: relative !important;
|
|
257
268
|
.itf-board-card {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
|
|
3
3
|
<itf-text-field
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
ref="input"
|
|
5
|
+
v-bind="$props"
|
|
6
|
+
@input="onValueChange"
|
|
7
|
+
@blur="onBlur"
|
|
8
8
|
/>
|
|
9
9
|
|
|
10
10
|
</template>
|
|
@@ -28,6 +28,7 @@ class itfHoursField extends Vue {
|
|
|
28
28
|
@Prop(Boolean) clearable;
|
|
29
29
|
@Prop(Boolean) disabled;
|
|
30
30
|
@Prop(Boolean) readonly;
|
|
31
|
+
@Prop(Boolean) negative;
|
|
31
32
|
@Prop({ type: [Number, String], default: 0 }) delayInput;
|
|
32
33
|
|
|
33
34
|
mounted() {
|
|
@@ -36,7 +37,6 @@ class itfHoursField extends Vue {
|
|
|
36
37
|
|
|
37
38
|
@Watch('hours')
|
|
38
39
|
onHoursChanged() {
|
|
39
|
-
console.info(formatHours(this.hours),this.hours)
|
|
40
40
|
this.$emit('input', formatHours(this.hours));
|
|
41
41
|
}
|
|
42
42
|
|
|
@@ -53,6 +53,7 @@ class itfHoursField extends Vue {
|
|
|
53
53
|
|
|
54
54
|
onBlur(e) {
|
|
55
55
|
const hours = parseHours(e.target.value) / 60;
|
|
56
|
+
console.info(hours);
|
|
56
57
|
this.$emit('update:hours', hours);
|
|
57
58
|
}
|
|
58
59
|
}
|
|
@@ -2,15 +2,16 @@ import { DateTime } from 'luxon';
|
|
|
2
2
|
import ITFSettings from '../ITFSettings';
|
|
3
3
|
|
|
4
4
|
export function parseHours (str, { hoursInDay } = { hoursInDay: 8 }) {
|
|
5
|
-
|
|
5
|
+
let source = (str || '').toString();
|
|
6
|
+
const isNegative = str[0] === '-' ? -1 : 1;
|
|
7
|
+
source = source.replace('-', '');
|
|
6
8
|
|
|
7
9
|
const SECONDS_IN_MINUTE = 60;
|
|
8
10
|
const MINUTES_IN_HOUR = 60;
|
|
9
|
-
|
|
10
11
|
// try parse decimal
|
|
11
12
|
const matchDecimal = source.match(/^(\d+([.,]\d+)?)$/);
|
|
12
13
|
if (matchDecimal) {
|
|
13
|
-
return Math.round(parseFloat(source.replace(',', '.')) * MINUTES_IN_HOUR * SECONDS_IN_MINUTE);
|
|
14
|
+
return isNegative * Math.round(parseFloat(source.replace(',', '.')) * MINUTES_IN_HOUR * SECONDS_IN_MINUTE);
|
|
14
15
|
}
|
|
15
16
|
|
|
16
17
|
const match = source.match(/^((\d+)d)?\s*((\d+)h)?\s*((\d+)m)?$/);
|
|
@@ -29,7 +30,7 @@ export function parseHours (str, { hoursInDay } = { hoursInDay: 8 }) {
|
|
|
29
30
|
if (minutes) {
|
|
30
31
|
seconds += Number(minutes) * SECONDS_IN_MINUTE;
|
|
31
32
|
}
|
|
32
|
-
return seconds;
|
|
33
|
+
return isNegative * seconds;
|
|
33
34
|
}
|
|
34
35
|
|
|
35
36
|
export function formatDate (date, inputFormat = 'yyyy-MM-dd', toFormat) {
|