@tactics/toddle-styleguide 1.7.22 → 1.7.25
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 +1 -1
- package/src/components/organisms/journal-entry/components/journal-entry-type/journal-entry-type.component.tsx +5 -4
- package/src/components/organisms/journal-entry/journal-entry.component.tsx +1 -1
- package/src/components/organisms/timetable-editor/timetable-editor.component.tsx +1 -11
- package/src/models/time-slot-sequence.d.ts +0 -1
- package/src/models/time-slot-sequence.ts +5 -15
package/package.json
CHANGED
|
@@ -11,7 +11,7 @@ import React from 'react';
|
|
|
11
11
|
interface JournalEntryTypeProps {
|
|
12
12
|
prio: boolean;
|
|
13
13
|
type: string;
|
|
14
|
-
happenedAt
|
|
14
|
+
happenedAt?: ToddleDateTime;
|
|
15
15
|
loading?: boolean;
|
|
16
16
|
send: boolean;
|
|
17
17
|
}
|
|
@@ -47,13 +47,14 @@ export const JournalEntryType = ({
|
|
|
47
47
|
<View style={styles.entryTypeTextContainer}>
|
|
48
48
|
<View>
|
|
49
49
|
<SmallText bold={true} textColor={context.colors.ui.darkgrey}>
|
|
50
|
-
{`${type}
|
|
50
|
+
{`${type}`}
|
|
51
51
|
</SmallText>
|
|
52
52
|
</View>
|
|
53
53
|
<View>
|
|
54
|
+
{happenedAt ?
|
|
54
55
|
<SmallText textColor={context.colors.ui.darkgrey}>
|
|
55
|
-
{happenedAt.toFormat("H:mm")}
|
|
56
|
-
</SmallText>
|
|
56
|
+
{` - ` + happenedAt.toFormat("H:mm")}
|
|
57
|
+
</SmallText> : null}
|
|
57
58
|
</View>
|
|
58
59
|
</View>
|
|
59
60
|
</>
|
|
@@ -18,7 +18,7 @@ import {LoadingIndicator} from '../loading-indicator/loading-indicator.component
|
|
|
18
18
|
interface JournalEntryProps {
|
|
19
19
|
id: string;
|
|
20
20
|
prio: boolean;
|
|
21
|
-
happenedAt
|
|
21
|
+
happenedAt?: ToddleDateTime;
|
|
22
22
|
type: string;
|
|
23
23
|
text: string;
|
|
24
24
|
visualState: VisualState;
|
|
@@ -20,7 +20,6 @@ export const TimetableEditor = ({sequence, onChange}: TimetableEditorProps) => {
|
|
|
20
20
|
const [first, setFrist] = useState<TimeSlotRecord>(sequence.first);
|
|
21
21
|
const [second, setSecond] = useState<TimeSlotRecord>(sequence.second);
|
|
22
22
|
const [third, setThird] = useState<TimeSlotRecord>(sequence.third);
|
|
23
|
-
const [fourth, setFourth] = useState<TimeSlotRecord>(sequence.fourth);
|
|
24
23
|
|
|
25
24
|
useEffect(() => {
|
|
26
25
|
const newSeq = TimeSlotSequence.fromEmpty();
|
|
@@ -30,11 +29,9 @@ export const TimetableEditor = ({sequence, onChange}: TimetableEditorProps) => {
|
|
|
30
29
|
newSeq.second.end = second.end;
|
|
31
30
|
newSeq.third.start = third.start;
|
|
32
31
|
newSeq.third.end = third.end;
|
|
33
|
-
newSeq.fourth.start = fourth.start;
|
|
34
|
-
newSeq.fourth.end = fourth.end;
|
|
35
32
|
|
|
36
33
|
onChange(newSeq);
|
|
37
|
-
}, [first, second, third
|
|
34
|
+
}, [first, second, third])
|
|
38
35
|
|
|
39
36
|
return (
|
|
40
37
|
<View style={styles.rootContainer}>
|
|
@@ -59,13 +56,6 @@ export const TimetableEditor = ({sequence, onChange}: TimetableEditorProps) => {
|
|
|
59
56
|
editState={activeIndex === 3 ? activeEditState : TimetableEditState.NONE}
|
|
60
57
|
onPressTag={(val,index) => { setActiveIndex(index); setActiveEditState(val);}}
|
|
61
58
|
/>
|
|
62
|
-
<TimetableEditWrapper
|
|
63
|
-
index={4}
|
|
64
|
-
record={fourth}
|
|
65
|
-
onUpdate={(seq) => {setFourth(TimeSlotRecord.fromRecord(seq))}}
|
|
66
|
-
editState={activeIndex === 4 ? activeEditState : TimetableEditState.NONE}
|
|
67
|
-
onPressTag={(val,index) => { setActiveIndex(index); setActiveEditState(val);}}
|
|
68
|
-
/>
|
|
69
59
|
</View>
|
|
70
60
|
);
|
|
71
61
|
}
|
|
@@ -3,7 +3,6 @@ export declare class TimeSlotSequence {
|
|
|
3
3
|
readonly first: TimeSlotRecord;
|
|
4
4
|
readonly second: TimeSlotRecord;
|
|
5
5
|
readonly third: TimeSlotRecord;
|
|
6
|
-
readonly fourth: TimeSlotRecord;
|
|
7
6
|
private constructor();
|
|
8
7
|
static fromAttendanceRecordArray(arr: TimeSlotRecord[]): TimeSlotSequence;
|
|
9
8
|
static fromTimeSlotRecordJSONArray(arr: TimeSlotRecordJSON[]): TimeSlotSequence;
|
|
@@ -5,15 +5,13 @@ export class TimeSlotSequence {
|
|
|
5
5
|
public readonly first: TimeSlotRecord,
|
|
6
6
|
public readonly second: TimeSlotRecord,
|
|
7
7
|
public readonly third: TimeSlotRecord,
|
|
8
|
-
public readonly fourth: TimeSlotRecord
|
|
9
8
|
) {}
|
|
10
9
|
|
|
11
10
|
static fromAttendanceRecordArray(arr: TimeSlotRecord[]): TimeSlotSequence {
|
|
12
11
|
return new TimeSlotSequence(
|
|
13
12
|
arr[0] ? arr[0] : TimeSlotRecord.fromEmpty(),
|
|
14
13
|
arr[1] ? arr[1] : TimeSlotRecord.fromEmpty(),
|
|
15
|
-
arr[2] ? arr[2] : TimeSlotRecord.fromEmpty()
|
|
16
|
-
arr[3] ? arr[3] : TimeSlotRecord.fromEmpty()
|
|
14
|
+
arr[2] ? arr[2] : TimeSlotRecord.fromEmpty()
|
|
17
15
|
);
|
|
18
16
|
}
|
|
19
17
|
|
|
@@ -24,7 +22,6 @@ export class TimeSlotSequence {
|
|
|
24
22
|
TimeSlotRecord.fromJson(arr[0]),
|
|
25
23
|
TimeSlotRecord.fromJson(arr[1]),
|
|
26
24
|
TimeSlotRecord.fromJson(arr[2]),
|
|
27
|
-
TimeSlotRecord.fromJson(arr[3])
|
|
28
25
|
);
|
|
29
26
|
}
|
|
30
27
|
|
|
@@ -33,16 +30,15 @@ export class TimeSlotSequence {
|
|
|
33
30
|
TimeSlotRecord.fromEmpty(),
|
|
34
31
|
TimeSlotRecord.fromEmpty(),
|
|
35
32
|
TimeSlotRecord.fromEmpty(),
|
|
36
|
-
TimeSlotRecord.fromEmpty()
|
|
37
33
|
);
|
|
38
34
|
}
|
|
39
35
|
|
|
40
36
|
asArray(): TimeSlotRecord[] {
|
|
41
|
-
return [this.first, this.second, this.third
|
|
37
|
+
return [this.first, this.second, this.third];
|
|
42
38
|
}
|
|
43
39
|
|
|
44
40
|
toJson(): TimeSlotRecord[] {
|
|
45
|
-
return [this.first, this.second, this.third
|
|
41
|
+
return [this.first, this.second, this.third];
|
|
46
42
|
}
|
|
47
43
|
|
|
48
44
|
addToNextSlot(checkInOutTime: string) {
|
|
@@ -58,10 +54,6 @@ export class TimeSlotSequence {
|
|
|
58
54
|
this.third.start = checkInOutTime;
|
|
59
55
|
} else if (this.third.end === undefined || this.third.end === '') {
|
|
60
56
|
this.third.end = checkInOutTime;
|
|
61
|
-
} else if (this.fourth.start === '') {
|
|
62
|
-
this.fourth.start = checkInOutTime;
|
|
63
|
-
} else if (this.fourth.end === undefined || this.fourth.end === '') {
|
|
64
|
-
this.fourth.end = checkInOutTime;
|
|
65
57
|
}
|
|
66
58
|
}
|
|
67
59
|
|
|
@@ -69,8 +61,7 @@ export class TimeSlotSequence {
|
|
|
69
61
|
return (
|
|
70
62
|
this.first.isComplete() &&
|
|
71
63
|
this.second.isComplete() &&
|
|
72
|
-
this.third.isComplete()
|
|
73
|
-
this.fourth.isComplete()
|
|
64
|
+
this.third.isComplete()
|
|
74
65
|
);
|
|
75
66
|
}
|
|
76
67
|
|
|
@@ -78,8 +69,7 @@ export class TimeSlotSequence {
|
|
|
78
69
|
return (
|
|
79
70
|
this.first.isEmpty() &&
|
|
80
71
|
this.second.isEmpty() &&
|
|
81
|
-
this.third.isEmpty()
|
|
82
|
-
this.fourth.isEmpty()
|
|
72
|
+
this.third.isEmpty()
|
|
83
73
|
);
|
|
84
74
|
}
|
|
85
75
|
}
|