@tactics/toddle-styleguide 5.4.2 → 5.4.4
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/index.tsx
CHANGED
|
@@ -5,77 +5,70 @@ import 'intl/locale-data/jsonp/en';
|
|
|
5
5
|
|
|
6
6
|
import App from './App';
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
if (!webBuild) {
|
|
8
|
+
if (!process.env.EXPO_PUBLIC_WEBBUILD) {
|
|
10
9
|
registerRootComponent(App);
|
|
11
10
|
}
|
|
12
11
|
|
|
13
|
-
//
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
30
|
-
import {
|
|
31
|
-
import {
|
|
32
|
-
import {
|
|
33
|
-
import {
|
|
34
|
-
import {
|
|
35
|
-
import {
|
|
36
|
-
import {
|
|
37
|
-
import {
|
|
38
|
-
import {
|
|
39
|
-
import {
|
|
40
|
-
import {
|
|
41
|
-
import {
|
|
42
|
-
import {
|
|
43
|
-
import {
|
|
44
|
-
import {
|
|
45
|
-
import {
|
|
46
|
-
import {
|
|
47
|
-
import {
|
|
48
|
-
import {
|
|
49
|
-
import {
|
|
50
|
-
import {
|
|
51
|
-
import {
|
|
52
|
-
import {
|
|
12
|
+
// ================================
|
|
13
|
+
// Components
|
|
14
|
+
// ================================
|
|
15
|
+
import { Avatar } from './src/components/molecules/avatar/avatar.component';
|
|
16
|
+
import { Button } from './src/components/molecules/button/button.component';
|
|
17
|
+
import { CancelLink } from './src/components/molecules/cancel-link/cancel-link.component';
|
|
18
|
+
import { Check } from './src/components/atoms/check-switch/check-switch.component';
|
|
19
|
+
import { Checkbox } from './src/components/molecules/checkbox/checkbox.component';
|
|
20
|
+
import { ChildListItem } from './src/components/organisms/child-list-item/child-list-item.component';
|
|
21
|
+
import { ContactItem } from './src/components/organisms/contact-item/contact-item.component';
|
|
22
|
+
import { FilterTab } from './src/components/molecules/filter-tab/filter-tab.component';
|
|
23
|
+
import { SplitContainer } from './src/components/atoms/split-container/split-container.component';
|
|
24
|
+
import { ImageBubble } from './src/components/atoms/image-bubble/image-bubble.component';
|
|
25
|
+
import { Info } from './src/components/molecules/info/info.component';
|
|
26
|
+
import { Pill } from './src/components/molecules/pill/pill.component';
|
|
27
|
+
import { Popover } from './src/components/templates/popover/popover.component';
|
|
28
|
+
import { PressableIcon } from './src/components/molecules/pressable-icon/pressable-icon.component';
|
|
29
|
+
import { QuickFilter } from './src/components/molecules/quick-filter/quick-filter.component';
|
|
30
|
+
import { SelectListItem } from './src/components/molecules/select-list-item/select-list-item.component';
|
|
31
|
+
import { Snackbar } from './src/components/molecules/snackbar/snackbar.component';
|
|
32
|
+
import { Tag } from './src/components/molecules/tag/tag.component';
|
|
33
|
+
import { TextBubble } from './src/components/organisms/text-bubble/text-bubble.component';
|
|
34
|
+
import { TextInput } from './src/components/atoms/text-input/text-input.component';
|
|
35
|
+
import { TimeTracker } from './src/components/molecules/time-tracker/time-tracker.component';
|
|
36
|
+
import { WideButton } from './src/components/molecules/wide-button/wide-button.component';
|
|
37
|
+
import { Icon } from './src/icons';
|
|
38
|
+
import { Calendar } from './src/components/atoms/calendar/calendar.component';
|
|
39
|
+
import { IncrementInput } from './src/components/atoms/increment-input/increment-input.component';
|
|
40
|
+
import { Logo } from './src/components/atoms/logo/logo.component';
|
|
41
|
+
import { Search } from './src/components/molecules/search-input/search.component';
|
|
42
|
+
import { BlockedMessage } from './src/components/molecules/blocked-message/blocked-message.component';
|
|
43
|
+
import { DepartmentLogo } from './src/components/molecules/department_logo/department-logo.component';
|
|
44
|
+
import { ContactRole } from './src/components/molecules/contact-role/contact-role.component';
|
|
45
|
+
import { TimeLine } from './src/components/molecules/timeline/timeline.component';
|
|
46
|
+
import { SelectPicker } from './src/components/molecules/select-picker/select-picker.component';
|
|
47
|
+
import { CalendarSelect } from './src/components/molecules/calendar-select/calendar-select.component';
|
|
48
|
+
import { DateInput } from './src/components/molecules/date-input/date-input.component';
|
|
49
|
+
import { FilterRange } from './src/components/molecules/filter-range/filter-range.component';
|
|
50
|
+
import { Footer } from './src/components/atoms/footer/footer.component';
|
|
51
|
+
import { DefaultSelect } from './src/components/molecules/default-select/default-select.component';
|
|
52
|
+
import { PasswordInput } from './src/components/molecules/password-input/password-input.component';
|
|
53
|
+
import { MessageInput } from './src/components/molecules/message-input/message-input.component';
|
|
53
54
|
import {
|
|
54
|
-
AllCapsHeading,
|
|
55
|
-
Heading1,
|
|
56
|
-
Heading2,
|
|
57
|
-
Heading3,
|
|
58
|
-
Heading4,
|
|
55
|
+
AllCapsHeading, Heading1, Heading2, Heading3, Heading4
|
|
59
56
|
} from './src/components/atoms/heading-components';
|
|
60
|
-
import {
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
} from './src/components/
|
|
65
|
-
import {
|
|
66
|
-
import {
|
|
67
|
-
import {
|
|
68
|
-
import {
|
|
69
|
-
import {
|
|
70
|
-
import {
|
|
71
|
-
import {
|
|
72
|
-
import {
|
|
73
|
-
import {
|
|
74
|
-
import {
|
|
75
|
-
import {QuickMessage} from './src/components/atoms/quick-message/quick-message.component';
|
|
76
|
-
import {Line} from './src/components/atoms/line/line.component';
|
|
77
|
-
import {JournalEntry} from './src/components/organisms/journal-entry/journal-entry.component';
|
|
78
|
-
import {TimetableEdit} from './src/components/organisms/timetable-edit/timetable-edit.component';
|
|
57
|
+
import { Paragraph, SmallText, TinyText } from './src/components/atoms/paragraph-components';
|
|
58
|
+
import { SelectLink } from './src/components/molecules/select-link/select-link.component';
|
|
59
|
+
import { MyChildListItem } from './src/components/organisms/my-child-list-item/my-child-list-item.component';
|
|
60
|
+
import { MoreInfoButton } from './src/components/molecules/more-info-button/more-info-button.component';
|
|
61
|
+
import { LanguageButton } from './src/components/molecules/language-button/language-button.component';
|
|
62
|
+
import { Modal } from './src/components/templates/modal/modal.component';
|
|
63
|
+
import { LoadingIndicator } from './src/components/organisms/loading-indicator/loading-indicator.component';
|
|
64
|
+
import { WaveBackground } from './src/components/molecules/wave-background/wave.component';
|
|
65
|
+
import { BackgroundGradient } from './src/components/atoms/background-gradient/background-gradient.component';
|
|
66
|
+
import { PersonInfoCard } from './src/components/organisms/person-info-card/person-info-card.component';
|
|
67
|
+
import { TimePicker } from './src/components/molecules/time-picker/time-picker.component';
|
|
68
|
+
import { QuickMessage } from './src/components/atoms/quick-message/quick-message.component';
|
|
69
|
+
import { Line } from './src/components/atoms/line/line.component';
|
|
70
|
+
import { JournalEntry } from './src/components/organisms/journal-entry/journal-entry.component';
|
|
71
|
+
import { TimetableEdit } from './src/components/organisms/timetable-edit/timetable-edit.component';
|
|
79
72
|
import { ContextLabel } from './src/components/molecules/context-label/context-label.component';
|
|
80
73
|
import { Count } from './src/components/atoms/count/count.component';
|
|
81
74
|
import { Amount } from './src/components/molecules/amount/amount.component';
|
|
@@ -87,45 +80,58 @@ import { SelectableListItem } from './src/components/molecules/selectable-list-i
|
|
|
87
80
|
import { SwipeableContainer } from './src/components/molecules/swipeable/swipeable-container.component';
|
|
88
81
|
import { SwipeableAction } from './src/components/molecules/swipeable/swipeable-action.component';
|
|
89
82
|
import { ContactAddress } from './src/components/molecules/contact-address/contact-address.component';
|
|
83
|
+
import { Day } from './src/components/molecules/day/day.component';
|
|
90
84
|
|
|
91
|
-
//
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
import {
|
|
95
|
-
import {
|
|
85
|
+
// ================================
|
|
86
|
+
// Enums
|
|
87
|
+
// ================================
|
|
88
|
+
import { BubbleAlignment } from './src/types/bubble-alignment.enum';
|
|
89
|
+
import { KeyBoardTypes } from './src/types/keyboard-types.enum';
|
|
90
|
+
import { Size } from './src/types/size.enum';
|
|
91
|
+
import { VisualState } from './src/types/visual-state.enum';
|
|
96
92
|
|
|
97
|
-
//
|
|
98
|
-
|
|
93
|
+
// ================================
|
|
94
|
+
// Models
|
|
95
|
+
// ================================
|
|
96
|
+
import { Initials } from './src/models/initials.model';
|
|
99
97
|
import { TimeSlotRecord } from './src/models/time-slot-record';
|
|
100
98
|
import { TimeSlotSequence } from './src/models/time-slot-sequence';
|
|
101
99
|
|
|
102
|
-
//
|
|
103
|
-
|
|
100
|
+
// ================================
|
|
101
|
+
// Context
|
|
102
|
+
// ================================
|
|
103
|
+
import { ThemeCtx } from './src/context/theme.context';
|
|
104
104
|
|
|
105
|
-
//
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
105
|
+
// ================================
|
|
106
|
+
// Theme / Style
|
|
107
|
+
// ================================
|
|
108
|
+
import { Scale } from './src/theme/scale/index';
|
|
109
109
|
import CreateResponsiveStyle from './src/theme/responsive/index';
|
|
110
|
-
import { ClockInterface, SystemClock } from "./src/utilities/datetime/clock.class";
|
|
111
|
-
import { YearAndMonth, YearAndMonthInterface, YearAndMonthLocaleAwareOutputFormat, YearAndMonthOutputFormat } from "./src/utilities/datetime/yearandmonth.class";
|
|
112
|
-
import { Year, YearInterface, YearOutputFormat } from "./src/utilities/datetime/year.class";
|
|
113
|
-
import {SystemTimezone, TimeZone, TimeZoneInterface, UTCTimezone } from "./src/utilities/datetime/timezone.class";
|
|
114
|
-
import { Time, TimeInputFormat, TimeInterface, TimeOutputFormat } from "./src/utilities/datetime/time.class";
|
|
115
|
-
import { Second, SecondInterface, SecondOutputFormat } from "./src/utilities/datetime/second.class";
|
|
116
|
-
import { Month, MonthIndex, MonthInterface, MonthLocalAwareOutputFormat, MonthOutputFormat } from "./src/utilities/datetime/month.class";
|
|
117
|
-
import { Minute, MinuteInterface, MinuteOutputFormat } from "./src/utilities/datetime/minute.class";
|
|
118
|
-
import { Millisecond, MillisecondInterface, MilliSecondOutputFormat } from "./src/utilities/datetime/millisecond.class";
|
|
119
|
-
import { Locale } from "./src/utilities/datetime/locale";
|
|
120
|
-
import { Hour, HourInterface, HourOutputFormat } from "./src/utilities/datetime/hour.class";
|
|
121
|
-
import { DayOfWeek, DayOfWeekIndex, DayOfWeekLocaleAwareOutputFormat, DayOfWeekOutputFormat, IDayOfWeek,
|
|
122
|
-
Iso8601WeekdayNumbers, ZeroBasedWeekdayNumbers } from "./src/utilities/datetime/dayoftheweek.class";
|
|
123
|
-
import { Day } from "./src/components/molecules/day/day.component";
|
|
124
|
-
import { DayInterface, DayOutputFormat } from "./src/utilities/datetime/day.class";
|
|
125
|
-
import { DateTime, DateTimeCalculation, DateTimeInterface, DateTimeOutputFormat } from "./src/utilities/datetime/datetime.class";
|
|
126
|
-
import { DateOnly, DateOnlyInterface, DateOnlyLocaleAwareOutputFormat, DateOnlyOutputFormat } from "./src/utilities/datetime/dateonly.class";
|
|
127
110
|
|
|
111
|
+
// ================================
|
|
112
|
+
// Date / Time Utilities
|
|
113
|
+
// ================================
|
|
114
|
+
import { ClockInterface, SystemClock } from './src/utilities/datetime/clock.class';
|
|
115
|
+
import { YearAndMonth, YearAndMonthInterface, YearAndMonthLocaleAwareOutputFormat, YearAndMonthOutputFormat } from './src/utilities/datetime/yearandmonth.class';
|
|
116
|
+
import { Year, YearInterface, YearOutputFormat } from './src/utilities/datetime/year.class';
|
|
117
|
+
import { SystemTimezone, TimeZone, TimeZoneInterface, UTCTimezone } from './src/utilities/datetime/timezone.class';
|
|
118
|
+
import { Time, TimeInputFormat, TimeInterface, TimeOutputFormat } from './src/utilities/datetime/time.class';
|
|
119
|
+
import { Second, SecondInterface, SecondOutputFormat } from './src/utilities/datetime/second.class';
|
|
120
|
+
import { Month, MonthIndex, MonthInterface, MonthLocalAwareOutputFormat, MonthOutputFormat } from './src/utilities/datetime/month.class';
|
|
121
|
+
import { Minute, MinuteInterface, MinuteOutputFormat } from './src/utilities/datetime/minute.class';
|
|
122
|
+
import { Millisecond, MillisecondInterface, MilliSecondOutputFormat } from './src/utilities/datetime/millisecond.class';
|
|
123
|
+
import { Locale } from './src/utilities/datetime/locale';
|
|
124
|
+
import { Hour, HourInterface, HourOutputFormat } from './src/utilities/datetime/hour.class';
|
|
125
|
+
import { DayOfWeek, DayOfWeekIndex, DayOfWeekLocaleAwareOutputFormat, DayOfWeekOutputFormat, IDayOfWeek, Iso8601WeekdayNumbers, ZeroBasedWeekdayNumbers } from './src/utilities/datetime/dayoftheweek.class';
|
|
126
|
+
import { DayInterface, DayOutputFormat } from './src/utilities/datetime/day.class';
|
|
127
|
+
import { DateTime, DateTimeCalculation, DateTimeInterface, DateTimeOutputFormat } from './src/utilities/datetime/datetime.class';
|
|
128
|
+
import { DateOnly, DateOnlyInterface, DateOnlyLocaleAwareOutputFormat, DateOnlyOutputFormat } from './src/utilities/datetime/dateonly.class';
|
|
129
|
+
|
|
130
|
+
// ================================
|
|
131
|
+
// Exports
|
|
132
|
+
// ================================
|
|
128
133
|
export {
|
|
134
|
+
// Components
|
|
129
135
|
AllCapsHeading,
|
|
130
136
|
Avatar,
|
|
131
137
|
BackgroundGradient,
|
|
@@ -187,78 +193,88 @@ export {
|
|
|
187
193
|
TinyText,
|
|
188
194
|
WaveBackground,
|
|
189
195
|
WideButton,
|
|
190
|
-
BubbleAlignment,
|
|
191
|
-
Initials,
|
|
192
|
-
KeyBoardTypes,
|
|
193
|
-
Size,
|
|
194
|
-
ThemeCtx,
|
|
195
|
-
VisualState,
|
|
196
|
-
CreateResponsiveStyle,
|
|
197
|
-
Scale,
|
|
198
|
-
TimetableEdit,
|
|
199
196
|
ContextLabel,
|
|
200
197
|
Count,
|
|
201
198
|
Amount,
|
|
199
|
+
TimetableEdit,
|
|
202
200
|
TimetableEditor,
|
|
203
201
|
TimetableEditorStaff,
|
|
204
|
-
TimeSlotRecord,
|
|
205
|
-
TimeSlotSequence,
|
|
206
202
|
InlineError,
|
|
207
203
|
InlineNotice,
|
|
208
204
|
SelectableListItem,
|
|
209
205
|
SwipeableContainer,
|
|
210
206
|
SwipeableAction,
|
|
207
|
+
Day,
|
|
208
|
+
|
|
209
|
+
// Enums
|
|
210
|
+
BubbleAlignment,
|
|
211
|
+
KeyBoardTypes,
|
|
212
|
+
Size,
|
|
213
|
+
VisualState,
|
|
214
|
+
|
|
215
|
+
// Models
|
|
216
|
+
Initials,
|
|
217
|
+
TimeSlotRecord,
|
|
218
|
+
TimeSlotSequence,
|
|
219
|
+
|
|
220
|
+
// Context
|
|
221
|
+
ThemeCtx,
|
|
222
|
+
|
|
223
|
+
// Theme
|
|
224
|
+
Scale,
|
|
225
|
+
CreateResponsiveStyle,
|
|
226
|
+
|
|
227
|
+
// Date / Time Utilities
|
|
211
228
|
ClockInterface,
|
|
212
229
|
SystemClock,
|
|
213
|
-
DateOnlyOutputFormat,
|
|
214
|
-
DateOnlyLocaleAwareOutputFormat,
|
|
215
|
-
DateOnlyInterface,
|
|
216
230
|
DateOnly,
|
|
217
|
-
|
|
231
|
+
DateOnlyInterface,
|
|
232
|
+
DateOnlyLocaleAwareOutputFormat,
|
|
233
|
+
DateOnlyOutputFormat,
|
|
234
|
+
DateTime,
|
|
218
235
|
DateTimeCalculation,
|
|
219
236
|
DateTimeInterface,
|
|
220
|
-
|
|
221
|
-
DayOutputFormat,
|
|
237
|
+
DateTimeOutputFormat,
|
|
222
238
|
DayInterface,
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
239
|
+
DayOutputFormat,
|
|
240
|
+
DayOfWeek,
|
|
241
|
+
DayOfWeekIndex,
|
|
226
242
|
DayOfWeekLocaleAwareOutputFormat,
|
|
227
243
|
DayOfWeekOutputFormat,
|
|
228
|
-
DayOfWeekIndex,
|
|
229
244
|
IDayOfWeek,
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
HourInterface,
|
|
245
|
+
Iso8601WeekdayNumbers,
|
|
246
|
+
ZeroBasedWeekdayNumbers,
|
|
233
247
|
Hour,
|
|
248
|
+
HourInterface,
|
|
249
|
+
HourOutputFormat,
|
|
234
250
|
Locale,
|
|
235
|
-
MilliSecondOutputFormat,
|
|
236
|
-
MillisecondInterface,
|
|
237
251
|
Millisecond,
|
|
238
|
-
|
|
239
|
-
|
|
252
|
+
MillisecondInterface,
|
|
253
|
+
MilliSecondOutputFormat,
|
|
240
254
|
Minute,
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
MonthInterface,
|
|
244
|
-
MonthIndex,
|
|
255
|
+
MinuteInterface,
|
|
256
|
+
MinuteOutputFormat,
|
|
245
257
|
Month,
|
|
246
|
-
|
|
247
|
-
|
|
258
|
+
MonthIndex,
|
|
259
|
+
MonthInterface,
|
|
260
|
+
MonthLocalAwareOutputFormat,
|
|
261
|
+
MonthOutputFormat,
|
|
248
262
|
Second,
|
|
263
|
+
SecondInterface,
|
|
264
|
+
SecondOutputFormat,
|
|
265
|
+
Time,
|
|
249
266
|
TimeInputFormat,
|
|
250
|
-
TimeOutputFormat,
|
|
251
267
|
TimeInterface,
|
|
252
|
-
|
|
253
|
-
TimeZoneInterface,
|
|
268
|
+
TimeOutputFormat,
|
|
254
269
|
TimeZone,
|
|
255
270
|
SystemTimezone,
|
|
271
|
+
TimeZoneInterface,
|
|
256
272
|
UTCTimezone,
|
|
257
|
-
YearOutputFormat,
|
|
258
|
-
YearInterface,
|
|
259
273
|
Year,
|
|
260
|
-
|
|
261
|
-
|
|
274
|
+
YearInterface,
|
|
275
|
+
YearOutputFormat,
|
|
276
|
+
YearAndMonth,
|
|
262
277
|
YearAndMonthInterface,
|
|
263
|
-
|
|
264
|
-
|
|
278
|
+
YearAndMonthLocaleAwareOutputFormat,
|
|
279
|
+
YearAndMonthOutputFormat
|
|
280
|
+
}
|
package/package.json
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import React, {useContext, useEffect, useState} from 'react';
|
|
2
2
|
import {View} from 'react-native';
|
|
3
3
|
import {TimeSlotRecord} from '../../../models/time-slot-record';
|
|
4
|
-
import {TimeSlotSequence} from '../../../models/time-slot-sequence';
|
|
5
4
|
import {TimetableEditWrapper} from './components/timetable-edit-wrapper';
|
|
6
5
|
import {TimetableEditState} from '../../../types/timetable-edit.enum';
|
|
7
6
|
import {ThemeCtx} from '../../../context/theme.context';
|
|
8
7
|
import {Stylesheet} from './timetable-editor.styles';
|
|
8
|
+
import {TimeSlotEmployeeSequence} from '../../../models/time-slot-employee-sequence';
|
|
9
9
|
|
|
10
10
|
interface TimetableEditorStaffProps {
|
|
11
|
-
sequence:
|
|
12
|
-
onChange: (seq:
|
|
11
|
+
sequence: TimeSlotEmployeeSequence;
|
|
12
|
+
onChange: (seq: TimeSlotEmployeeSequence) => void;
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
export const TimetableEditorStaff = ({
|
|
@@ -22,17 +22,41 @@ export const TimetableEditorStaff = ({
|
|
|
22
22
|
const [activeEditState, setActiveEditState] = useState(
|
|
23
23
|
TimetableEditState.NONE
|
|
24
24
|
);
|
|
25
|
-
const [first,
|
|
25
|
+
const [first, setFirst] = useState<TimeSlotRecord>(sequence.first);
|
|
26
26
|
const [second, setSecond] = useState<TimeSlotRecord>(sequence.second);
|
|
27
|
+
const [third, setThird] = useState<TimeSlotRecord>(sequence.third);
|
|
28
|
+
const [fourth, setFourth] = useState<TimeSlotRecord>(sequence.fourth);
|
|
29
|
+
const [fifth, setFifth] = useState<TimeSlotRecord>(sequence.fifth);
|
|
30
|
+
const [sixth, setSixth] = useState<TimeSlotRecord>(sequence.sixth);
|
|
31
|
+
const [seventh, setSeventh] = useState<TimeSlotRecord>(sequence.seventh);
|
|
32
|
+
const [eighth, setEighth] = useState<TimeSlotRecord>(sequence.eighth);
|
|
33
|
+
const [nineth, setNinth] = useState<TimeSlotRecord>(sequence.ninth);
|
|
34
|
+
const [tenth, setTenth] = useState<TimeSlotRecord>(sequence.tenth);
|
|
35
|
+
|
|
27
36
|
|
|
28
37
|
useEffect(() => {
|
|
29
|
-
const newSeq =
|
|
38
|
+
const newSeq = TimeSlotEmployeeSequence.fromEmpty();
|
|
30
39
|
newSeq.first.start = first.start;
|
|
31
40
|
newSeq.first.end = first.end;
|
|
32
41
|
newSeq.second.start = second.start;
|
|
33
42
|
newSeq.second.end = second.end;
|
|
34
|
-
newSeq.third.start =
|
|
35
|
-
newSeq.third.end =
|
|
43
|
+
newSeq.third.start = third.start;
|
|
44
|
+
newSeq.third.end = third.end;
|
|
45
|
+
|
|
46
|
+
newSeq.fourth.start = fourth.start;
|
|
47
|
+
newSeq.fourth.end = fourth.end;
|
|
48
|
+
newSeq.fifth.start = fifth.start;
|
|
49
|
+
newSeq.fifth.end = fifth.end;
|
|
50
|
+
newSeq.sixth.start = sixth.start;
|
|
51
|
+
newSeq.sixth.end = sixth.end;
|
|
52
|
+
newSeq.seventh.start = seventh.start;
|
|
53
|
+
newSeq.seventh.end = seventh.end;
|
|
54
|
+
newSeq.eighth.start = eighth.start;
|
|
55
|
+
newSeq.eighth.end = eighth.end;
|
|
56
|
+
newSeq.ninth.start = nineth.start;
|
|
57
|
+
newSeq.ninth.end = nineth.end;
|
|
58
|
+
newSeq.tenth.start = tenth.start;
|
|
59
|
+
newSeq.tenth.end = tenth.end;
|
|
36
60
|
|
|
37
61
|
onChange(newSeq);
|
|
38
62
|
}, [first, second]);
|
|
@@ -43,7 +67,7 @@ export const TimetableEditorStaff = ({
|
|
|
43
67
|
index={1}
|
|
44
68
|
record={first}
|
|
45
69
|
onUpdate={(seq) => {
|
|
46
|
-
|
|
70
|
+
setFirst(TimeSlotRecord.fromRecord(seq));
|
|
47
71
|
}}
|
|
48
72
|
editState={
|
|
49
73
|
activeIndex === 1 ? activeEditState : TimetableEditState.NONE
|
|
@@ -67,6 +91,118 @@ export const TimetableEditorStaff = ({
|
|
|
67
91
|
setActiveEditState(val);
|
|
68
92
|
}}
|
|
69
93
|
/>
|
|
94
|
+
<TimetableEditWrapper
|
|
95
|
+
index={3}
|
|
96
|
+
record={third}
|
|
97
|
+
onUpdate={(seq) => {
|
|
98
|
+
setThird(TimeSlotRecord.fromRecord(seq));
|
|
99
|
+
}}
|
|
100
|
+
editState={
|
|
101
|
+
activeIndex === 3 ? activeEditState : TimetableEditState.NONE
|
|
102
|
+
}
|
|
103
|
+
onPressTag={(val, index) => {
|
|
104
|
+
setActiveIndex(index);
|
|
105
|
+
setActiveEditState(val);
|
|
106
|
+
}}
|
|
107
|
+
/>
|
|
108
|
+
<TimetableEditWrapper
|
|
109
|
+
index={4}
|
|
110
|
+
record={fourth}
|
|
111
|
+
onUpdate={(seq) => {
|
|
112
|
+
setFourth(TimeSlotRecord.fromRecord(seq));
|
|
113
|
+
}}
|
|
114
|
+
editState={
|
|
115
|
+
activeIndex === 4 ? activeEditState : TimetableEditState.NONE
|
|
116
|
+
}
|
|
117
|
+
onPressTag={(val, index) => {
|
|
118
|
+
setActiveIndex(index);
|
|
119
|
+
setActiveEditState(val);
|
|
120
|
+
}}
|
|
121
|
+
/>
|
|
122
|
+
<TimetableEditWrapper
|
|
123
|
+
index={5}
|
|
124
|
+
record={fifth}
|
|
125
|
+
onUpdate={(seq) => {
|
|
126
|
+
setFifth(TimeSlotRecord.fromRecord(seq));
|
|
127
|
+
}}
|
|
128
|
+
editState={
|
|
129
|
+
activeIndex === 5 ? activeEditState : TimetableEditState.NONE
|
|
130
|
+
}
|
|
131
|
+
onPressTag={(val, index) => {
|
|
132
|
+
setActiveIndex(index);
|
|
133
|
+
setActiveEditState(val);
|
|
134
|
+
}}
|
|
135
|
+
/>
|
|
136
|
+
<TimetableEditWrapper
|
|
137
|
+
index={6}
|
|
138
|
+
record={sixth}
|
|
139
|
+
onUpdate={(seq) => {
|
|
140
|
+
setSixth(TimeSlotRecord.fromRecord(seq));
|
|
141
|
+
}}
|
|
142
|
+
editState={
|
|
143
|
+
activeIndex === 6 ? activeEditState : TimetableEditState.NONE
|
|
144
|
+
}
|
|
145
|
+
onPressTag={(val, index) => {
|
|
146
|
+
setActiveIndex(index);
|
|
147
|
+
setActiveEditState(val);
|
|
148
|
+
}}
|
|
149
|
+
/>
|
|
150
|
+
<TimetableEditWrapper
|
|
151
|
+
index={7}
|
|
152
|
+
record={seventh}
|
|
153
|
+
onUpdate={(seq) => {
|
|
154
|
+
setSeventh(TimeSlotRecord.fromRecord(seq));
|
|
155
|
+
}}
|
|
156
|
+
editState={
|
|
157
|
+
activeIndex === 7 ? activeEditState : TimetableEditState.NONE
|
|
158
|
+
}
|
|
159
|
+
onPressTag={(val, index) => {
|
|
160
|
+
setActiveIndex(index);
|
|
161
|
+
setActiveEditState(val);
|
|
162
|
+
}}
|
|
163
|
+
/>
|
|
164
|
+
<TimetableEditWrapper
|
|
165
|
+
index={8}
|
|
166
|
+
record={eighth}
|
|
167
|
+
onUpdate={(seq) => {
|
|
168
|
+
setEighth(TimeSlotRecord.fromRecord(seq));
|
|
169
|
+
}}
|
|
170
|
+
editState={
|
|
171
|
+
activeIndex === 8 ? activeEditState : TimetableEditState.NONE
|
|
172
|
+
}
|
|
173
|
+
onPressTag={(val, index) => {
|
|
174
|
+
setActiveIndex(index);
|
|
175
|
+
setActiveEditState(val);
|
|
176
|
+
}}
|
|
177
|
+
/>
|
|
178
|
+
<TimetableEditWrapper
|
|
179
|
+
index={9}
|
|
180
|
+
record={nineth}
|
|
181
|
+
onUpdate={(seq) => {
|
|
182
|
+
setNinth(TimeSlotRecord.fromRecord(seq));
|
|
183
|
+
}}
|
|
184
|
+
editState={
|
|
185
|
+
activeIndex === 9 ? activeEditState : TimetableEditState.NONE
|
|
186
|
+
}
|
|
187
|
+
onPressTag={(val, index) => {
|
|
188
|
+
setActiveIndex(index);
|
|
189
|
+
setActiveEditState(val);
|
|
190
|
+
}}
|
|
191
|
+
/>
|
|
192
|
+
<TimetableEditWrapper
|
|
193
|
+
index={10}
|
|
194
|
+
record={tenth}
|
|
195
|
+
onUpdate={(seq) => {
|
|
196
|
+
setTenth(TimeSlotRecord.fromRecord(seq));
|
|
197
|
+
}}
|
|
198
|
+
editState={
|
|
199
|
+
activeIndex === 10 ? activeEditState : TimetableEditState.NONE
|
|
200
|
+
}
|
|
201
|
+
onPressTag={(val, index) => {
|
|
202
|
+
setActiveIndex(index);
|
|
203
|
+
setActiveEditState(val);
|
|
204
|
+
}}
|
|
205
|
+
/>
|
|
70
206
|
</View>
|
|
71
207
|
);
|
|
72
208
|
};
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
import {TimeSlotRecord, TimeSlotRecordJSON} from './time-slot-record';
|
|
2
|
+
|
|
3
|
+
export class TimeSlotEmployeeSequence {
|
|
4
|
+
private constructor(
|
|
5
|
+
public readonly first: TimeSlotRecord,
|
|
6
|
+
public readonly second: TimeSlotRecord,
|
|
7
|
+
public readonly third: TimeSlotRecord,
|
|
8
|
+
public readonly fourth: TimeSlotRecord,
|
|
9
|
+
public readonly fifth: TimeSlotRecord,
|
|
10
|
+
public readonly sixth: TimeSlotRecord,
|
|
11
|
+
public readonly seventh: TimeSlotRecord,
|
|
12
|
+
public readonly eighth: TimeSlotRecord,
|
|
13
|
+
public readonly ninth: TimeSlotRecord,
|
|
14
|
+
public readonly tenth: TimeSlotRecord,
|
|
15
|
+
) {}
|
|
16
|
+
|
|
17
|
+
static fromAttendanceRecordArray(arr: TimeSlotRecord[]): TimeSlotEmployeeSequence {
|
|
18
|
+
return new TimeSlotEmployeeSequence(
|
|
19
|
+
arr[0] ? arr[0] : TimeSlotRecord.fromEmpty(),
|
|
20
|
+
arr[1] ? arr[1] : TimeSlotRecord.fromEmpty(),
|
|
21
|
+
arr[2] ? arr[2] : TimeSlotRecord.fromEmpty(),
|
|
22
|
+
arr[3] ? arr[2] : TimeSlotRecord.fromEmpty(),
|
|
23
|
+
arr[4] ? arr[4] : TimeSlotRecord.fromEmpty(),
|
|
24
|
+
arr[5] ? arr[5] : TimeSlotRecord.fromEmpty(),
|
|
25
|
+
arr[6] ? arr[6] : TimeSlotRecord.fromEmpty(),
|
|
26
|
+
arr[7] ? arr[7] : TimeSlotRecord.fromEmpty(),
|
|
27
|
+
arr[8] ? arr[8] : TimeSlotRecord.fromEmpty(),
|
|
28
|
+
arr[9] ? arr[9] : TimeSlotRecord.fromEmpty(),
|
|
29
|
+
);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
static fromTimeSlotRecordJSONArray(
|
|
33
|
+
arr: TimeSlotRecordJSON[]
|
|
34
|
+
): TimeSlotEmployeeSequence {
|
|
35
|
+
return new TimeSlotEmployeeSequence(
|
|
36
|
+
TimeSlotRecord.fromJson(
|
|
37
|
+
arr[0] ? arr[0] : TimeSlotRecord.fromEmpty().toJson()
|
|
38
|
+
),
|
|
39
|
+
TimeSlotRecord.fromJson(
|
|
40
|
+
arr[1] ? arr[1] : TimeSlotRecord.fromEmpty().toJson()
|
|
41
|
+
),
|
|
42
|
+
TimeSlotRecord.fromJson(
|
|
43
|
+
arr[2] ? arr[2] : TimeSlotRecord.fromEmpty().toJson()
|
|
44
|
+
),
|
|
45
|
+
TimeSlotRecord.fromJson(
|
|
46
|
+
arr[3] ? arr[3] : TimeSlotRecord.fromEmpty().toJson()
|
|
47
|
+
),
|
|
48
|
+
TimeSlotRecord.fromJson(
|
|
49
|
+
arr[4] ? arr[4] : TimeSlotRecord.fromEmpty().toJson()
|
|
50
|
+
),
|
|
51
|
+
TimeSlotRecord.fromJson(
|
|
52
|
+
arr[5] ? arr[5] : TimeSlotRecord.fromEmpty().toJson()
|
|
53
|
+
),
|
|
54
|
+
TimeSlotRecord.fromJson(
|
|
55
|
+
arr[6] ? arr[6] : TimeSlotRecord.fromEmpty().toJson()
|
|
56
|
+
),
|
|
57
|
+
TimeSlotRecord.fromJson(
|
|
58
|
+
arr[7] ? arr[7] : TimeSlotRecord.fromEmpty().toJson()
|
|
59
|
+
),
|
|
60
|
+
TimeSlotRecord.fromJson(
|
|
61
|
+
arr[8] ? arr[8] : TimeSlotRecord.fromEmpty().toJson()
|
|
62
|
+
),
|
|
63
|
+
TimeSlotRecord.fromJson(
|
|
64
|
+
arr[9] ? arr[9] : TimeSlotRecord.fromEmpty().toJson()
|
|
65
|
+
)
|
|
66
|
+
);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
static fromEmpty(): TimeSlotEmployeeSequence {
|
|
70
|
+
return new TimeSlotEmployeeSequence(
|
|
71
|
+
TimeSlotRecord.fromEmpty(),
|
|
72
|
+
TimeSlotRecord.fromEmpty(),
|
|
73
|
+
TimeSlotRecord.fromEmpty(),
|
|
74
|
+
TimeSlotRecord.fromEmpty(),
|
|
75
|
+
TimeSlotRecord.fromEmpty(),
|
|
76
|
+
TimeSlotRecord.fromEmpty(),
|
|
77
|
+
TimeSlotRecord.fromEmpty(),
|
|
78
|
+
TimeSlotRecord.fromEmpty(),
|
|
79
|
+
TimeSlotRecord.fromEmpty(),
|
|
80
|
+
TimeSlotRecord.fromEmpty(),
|
|
81
|
+
);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
asArray(): TimeSlotRecord[] {
|
|
85
|
+
return [this.first, this.second, this.third, this.fourth, this.fifth, this.sixth, this.seventh, this.eighth, this.ninth , this.tenth];
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
toJson(): TimeSlotRecord[] {
|
|
89
|
+
return this.asArray();
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
addToNextSlot(checkInOutTime: string) {
|
|
93
|
+
if (this.first.start === '') {
|
|
94
|
+
this.first.start = checkInOutTime;
|
|
95
|
+
} else if (this.first.end === undefined || this.first.end === '') {
|
|
96
|
+
this.first.end = checkInOutTime;
|
|
97
|
+
} else if (this.second.start === '') {
|
|
98
|
+
this.second.start = checkInOutTime;
|
|
99
|
+
} else if (this.second.end === undefined || this.second.end === '') {
|
|
100
|
+
this.second.end = checkInOutTime;
|
|
101
|
+
} else if (this.third.start === '') {
|
|
102
|
+
this.third.start = checkInOutTime;
|
|
103
|
+
} else if (this.third.end === undefined || this.third.end === '') {
|
|
104
|
+
this.third.end = checkInOutTime;
|
|
105
|
+
} else if (this.fourth.start === '') {
|
|
106
|
+
this.fourth.start = checkInOutTime;
|
|
107
|
+
} else if (this.fourth.end === undefined || this.fourth.end === '') {
|
|
108
|
+
this.fourth.end = checkInOutTime;
|
|
109
|
+
} else if (this.fifth.start === '') {
|
|
110
|
+
this.fifth.start = checkInOutTime;
|
|
111
|
+
} else if (this.fifth.end === undefined || this.fifth.end === '') {
|
|
112
|
+
this.fifth.end = checkInOutTime;
|
|
113
|
+
} else if (this.sixth.start === '') {
|
|
114
|
+
this.sixth.start = checkInOutTime;
|
|
115
|
+
} else if (this.sixth.end === undefined || this.sixth.end === '') {
|
|
116
|
+
this.sixth.end = checkInOutTime;
|
|
117
|
+
} else if (this.seventh.start === '') {
|
|
118
|
+
this.seventh.start = checkInOutTime;
|
|
119
|
+
} else if (this.seventh.end === undefined || this.seventh.end === '') {
|
|
120
|
+
this.seventh.end = checkInOutTime;
|
|
121
|
+
} else if (this.eighth.start === '') {
|
|
122
|
+
this.eighth.start = checkInOutTime;
|
|
123
|
+
} else if (this.eighth.end === undefined || this.eighth.end === '') {
|
|
124
|
+
this.eighth.end = checkInOutTime;
|
|
125
|
+
} else if (this.ninth.start === '') {
|
|
126
|
+
this.ninth.start = checkInOutTime;
|
|
127
|
+
} else if (this.ninth.end === undefined || this.ninth.end === '') {
|
|
128
|
+
this.ninth.end = checkInOutTime;
|
|
129
|
+
} else if (this.tenth.start === '') {
|
|
130
|
+
this.tenth.start = checkInOutTime;
|
|
131
|
+
} else if (this.tenth.end === undefined || this.tenth.end === '') {
|
|
132
|
+
this.tenth.end = checkInOutTime;
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
isComplete(): boolean {
|
|
137
|
+
return (
|
|
138
|
+
this.first.isComplete() &&
|
|
139
|
+
this.second.isComplete() &&
|
|
140
|
+
this.third.isComplete() &&
|
|
141
|
+
this.fourth.isComplete() &&
|
|
142
|
+
this.fifth.isComplete() &&
|
|
143
|
+
this.sixth.isComplete() &&
|
|
144
|
+
this.seventh.isComplete() &&
|
|
145
|
+
this.eighth.isComplete() &&
|
|
146
|
+
this.ninth.isComplete() &&
|
|
147
|
+
this.tenth.isComplete()
|
|
148
|
+
);
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
isEmpty(): boolean {
|
|
152
|
+
return (
|
|
153
|
+
this.first.isEmpty() &&
|
|
154
|
+
this.second.isEmpty() &&
|
|
155
|
+
this.third.isEmpty() &&
|
|
156
|
+
this.fourth.isEmpty() &&
|
|
157
|
+
this.fifth.isEmpty() &&
|
|
158
|
+
this.sixth.isEmpty() &&
|
|
159
|
+
this.seventh.isEmpty() &&
|
|
160
|
+
this.eighth.isEmpty() &&
|
|
161
|
+
this.ninth.isEmpty() &&
|
|
162
|
+
this.tenth.isEmpty()
|
|
163
|
+
);
|
|
164
|
+
}
|
|
165
|
+
}
|