@apia/scheduler-controller 5.0.0 → 5.0.3
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/dist/Scheduler/index.d.ts +58 -0
- package/dist/Scheduler/index.d.ts.map +1 -0
- package/dist/Scheduler/index.js +515 -0
- package/dist/Scheduler/index.js.map +1 -0
- package/dist/Scheduler/types.d.ts +87 -0
- package/dist/Scheduler/types.d.ts.map +1 -0
- package/dist/Scheduler/util.js +32 -0
- package/dist/Scheduler/util.js.map +1 -0
- package/dist/index.d.ts +2 -132
- package/dist/index.js +1 -537
- package/dist/index.js.map +1 -1
- package/package.json +6 -6
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { ButtonProps } from 'theme-ui';
|
|
2
|
+
|
|
3
|
+
type TSchedulerState = {
|
|
4
|
+
data?: TScheduleResult;
|
|
5
|
+
initialProps: IScheduleInitialProps;
|
|
6
|
+
url?: string;
|
|
7
|
+
selectedCell?: string | null;
|
|
8
|
+
focusStage?: string;
|
|
9
|
+
stageList?: string[];
|
|
10
|
+
selectedDay?: ISelectedDay;
|
|
11
|
+
stageData: IStage[];
|
|
12
|
+
isStageMounted: Record<string, boolean>;
|
|
13
|
+
isLoading?: 'NotLoading' | 'Today' | 'LastWeek' | 'DateInput' | 'NextWeek' | 'DeleteWeek';
|
|
14
|
+
};
|
|
15
|
+
type TSelectedDateResponse = {
|
|
16
|
+
success: boolean;
|
|
17
|
+
};
|
|
18
|
+
type TTskSchHour = {
|
|
19
|
+
hour: string;
|
|
20
|
+
disabled: boolean;
|
|
21
|
+
value: string;
|
|
22
|
+
};
|
|
23
|
+
type TTskSchDay = {
|
|
24
|
+
type: string;
|
|
25
|
+
day: string;
|
|
26
|
+
tskSchHour?: TTskSchHour | TTskSchHour[];
|
|
27
|
+
isDisabled?: boolean;
|
|
28
|
+
};
|
|
29
|
+
type TScheduleResult = {
|
|
30
|
+
calId: string;
|
|
31
|
+
mode: string;
|
|
32
|
+
overassign: string;
|
|
33
|
+
weekNotConfigured: boolean;
|
|
34
|
+
frec: string;
|
|
35
|
+
tskSchId: string;
|
|
36
|
+
mondayWeek: string;
|
|
37
|
+
success: boolean;
|
|
38
|
+
tskSchDay: TTskSchDay | TTskSchDay[];
|
|
39
|
+
};
|
|
40
|
+
interface IScheduleInitialProps {
|
|
41
|
+
schId: string;
|
|
42
|
+
proId: string;
|
|
43
|
+
proVerId: string;
|
|
44
|
+
tskId: string;
|
|
45
|
+
showDisponibility: string;
|
|
46
|
+
showAttributes: string;
|
|
47
|
+
}
|
|
48
|
+
interface ILabelSelectedDay {
|
|
49
|
+
hour: string;
|
|
50
|
+
day?: string | undefined;
|
|
51
|
+
}
|
|
52
|
+
interface ISelectedDay {
|
|
53
|
+
hour?: string;
|
|
54
|
+
day?: string;
|
|
55
|
+
mondayWeek?: string;
|
|
56
|
+
dayNumber?: number;
|
|
57
|
+
morningOrAfternoonSelected?: number | null;
|
|
58
|
+
}
|
|
59
|
+
interface IStage {
|
|
60
|
+
name: string;
|
|
61
|
+
buttons?: IStageButton[];
|
|
62
|
+
}
|
|
63
|
+
interface IStageButton extends ButtonProps {
|
|
64
|
+
label: string;
|
|
65
|
+
title: string;
|
|
66
|
+
action: () => unknown;
|
|
67
|
+
isDisabled?: boolean;
|
|
68
|
+
value?: string;
|
|
69
|
+
isSelectedSelector: () => boolean;
|
|
70
|
+
}
|
|
71
|
+
type TSchInfoResult = {
|
|
72
|
+
pro_instances: {
|
|
73
|
+
pro_instance: TProcesses;
|
|
74
|
+
};
|
|
75
|
+
};
|
|
76
|
+
type TProcesses = {
|
|
77
|
+
id: number;
|
|
78
|
+
attributes: {
|
|
79
|
+
attribute: {
|
|
80
|
+
title: string;
|
|
81
|
+
value: string;
|
|
82
|
+
}[];
|
|
83
|
+
};
|
|
84
|
+
}[];
|
|
85
|
+
|
|
86
|
+
export type { ILabelSelectedDay, IScheduleInitialProps, ISelectedDay, IStage, IStageButton, TProcesses, TSchInfoResult, TScheduleResult, TSchedulerState, TSelectedDateResponse, TTskSchDay, TTskSchHour };
|
|
87
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { getLabel } from '@apia/util';
|
|
2
|
+
|
|
3
|
+
const dayFullWord = (window) => {
|
|
4
|
+
return [
|
|
5
|
+
getLabel("lblDomingo", window).text,
|
|
6
|
+
getLabel("lblLunes", window).text,
|
|
7
|
+
getLabel("lblMartes", window).text,
|
|
8
|
+
getLabel("lblMiercoles", window).text,
|
|
9
|
+
getLabel("lblJueves", window).text,
|
|
10
|
+
getLabel("lblViernes", window).text,
|
|
11
|
+
getLabel("lblSabado", window).text
|
|
12
|
+
];
|
|
13
|
+
};
|
|
14
|
+
const monthLabels = (window) => {
|
|
15
|
+
return [
|
|
16
|
+
getLabel("lblEnero", window).text,
|
|
17
|
+
getLabel("lblFebrero", window).text,
|
|
18
|
+
getLabel("lblMarzo", window).text,
|
|
19
|
+
getLabel("lblAbril", window).text,
|
|
20
|
+
getLabel("lblMayo", window).text,
|
|
21
|
+
getLabel("lblJunio", window).text,
|
|
22
|
+
getLabel("lblJulio", window).text,
|
|
23
|
+
getLabel("lblAgosto", window).text,
|
|
24
|
+
getLabel("lblSetiembre", window).text,
|
|
25
|
+
getLabel("lblOctubre", window).text,
|
|
26
|
+
getLabel("lblNoviembre", window).text,
|
|
27
|
+
getLabel("lblDiciembre", window).text
|
|
28
|
+
];
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
export { dayFullWord, monthLabels };
|
|
32
|
+
//# sourceMappingURL=util.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"util.js","sources":["../../src/Scheduler/util.ts"],"sourcesContent":["import { getLabel } from '@apia/util';\r\n\r\nexport const dayLabels = (window?: any) => {\r\n return [\r\n getLabel('lblTskDayMon', window).text,\r\n getLabel('lblTskDayTue', window).text,\r\n getLabel('lblTskDayWed', window).text,\r\n getLabel('lblTskDayThu', window).text,\r\n getLabel('lblTskDayFri', window).text,\r\n getLabel('lblTskDaySat', window).text,\r\n getLabel('lblTskDaySun', window).text,\r\n ];\r\n};\r\nexport const dayFullWord = (window?: any) => {\r\n return [\r\n getLabel('lblDomingo', window).text,\r\n getLabel('lblLunes', window).text,\r\n getLabel('lblMartes', window).text,\r\n getLabel('lblMiercoles', window).text,\r\n getLabel('lblJueves', window).text,\r\n getLabel('lblViernes', window).text,\r\n getLabel('lblSabado', window).text,\r\n ];\r\n};\r\n\r\nexport const monthLabels = (window?: any) => {\r\n return [\r\n getLabel('lblEnero', window).text,\r\n getLabel('lblFebrero', window).text,\r\n getLabel('lblMarzo', window).text,\r\n getLabel('lblAbril', window).text,\r\n getLabel('lblMayo', window).text,\r\n getLabel('lblJunio', window).text,\r\n getLabel('lblJulio', window).text,\r\n getLabel('lblAgosto', window).text,\r\n getLabel('lblSetiembre', window).text,\r\n getLabel('lblOctubre', window).text,\r\n getLabel('lblNoviembre', window).text,\r\n getLabel('lblDiciembre', window).text,\r\n ];\r\n};\r\n"],"names":[],"mappings":";;AAaO,MAAM,WAAA,GAAc,CAAC,MAAA,KAAiB;AAC3C,EAAA,OAAO;AAAA,IACL,QAAA,CAAS,YAAA,EAAc,MAAM,CAAA,CAAE,IAAA;AAAA,IAC/B,QAAA,CAAS,UAAA,EAAY,MAAM,CAAA,CAAE,IAAA;AAAA,IAC7B,QAAA,CAAS,WAAA,EAAa,MAAM,CAAA,CAAE,IAAA;AAAA,IAC9B,QAAA,CAAS,cAAA,EAAgB,MAAM,CAAA,CAAE,IAAA;AAAA,IACjC,QAAA,CAAS,WAAA,EAAa,MAAM,CAAA,CAAE,IAAA;AAAA,IAC9B,QAAA,CAAS,YAAA,EAAc,MAAM,CAAA,CAAE,IAAA;AAAA,IAC/B,QAAA,CAAS,WAAA,EAAa,MAAM,CAAA,CAAE;AAAA,GAChC;AACF;AAEO,MAAM,WAAA,GAAc,CAAC,MAAA,KAAiB;AAC3C,EAAA,OAAO;AAAA,IACL,QAAA,CAAS,UAAA,EAAY,MAAM,CAAA,CAAE,IAAA;AAAA,IAC7B,QAAA,CAAS,YAAA,EAAc,MAAM,CAAA,CAAE,IAAA;AAAA,IAC/B,QAAA,CAAS,UAAA,EAAY,MAAM,CAAA,CAAE,IAAA;AAAA,IAC7B,QAAA,CAAS,UAAA,EAAY,MAAM,CAAA,CAAE,IAAA;AAAA,IAC7B,QAAA,CAAS,SAAA,EAAW,MAAM,CAAA,CAAE,IAAA;AAAA,IAC5B,QAAA,CAAS,UAAA,EAAY,MAAM,CAAA,CAAE,IAAA;AAAA,IAC7B,QAAA,CAAS,UAAA,EAAY,MAAM,CAAA,CAAE,IAAA;AAAA,IAC7B,QAAA,CAAS,WAAA,EAAa,MAAM,CAAA,CAAE,IAAA;AAAA,IAC9B,QAAA,CAAS,cAAA,EAAgB,MAAM,CAAA,CAAE,IAAA;AAAA,IACjC,QAAA,CAAS,YAAA,EAAc,MAAM,CAAA,CAAE,IAAA;AAAA,IAC/B,QAAA,CAAS,cAAA,EAAgB,MAAM,CAAA,CAAE,IAAA;AAAA,IACjC,QAAA,CAAS,cAAA,EAAgB,MAAM,CAAA,CAAE;AAAA,GACnC;AACF;;;;"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,133 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
type TSchedulerState = {
|
|
5
|
-
data?: TScheduleResult;
|
|
6
|
-
initialProps: IScheduleInitialProps;
|
|
7
|
-
url?: string;
|
|
8
|
-
selectedCell?: string | null;
|
|
9
|
-
focusStage?: string;
|
|
10
|
-
stageList?: string[];
|
|
11
|
-
selectedDay?: ISelectedDay;
|
|
12
|
-
stageData: IStage[];
|
|
13
|
-
isStageMounted: Record<string, boolean>;
|
|
14
|
-
isLoading?: 'NotLoading' | 'Today' | 'LastWeek' | 'DateInput' | 'NextWeek' | 'DeleteWeek';
|
|
15
|
-
};
|
|
16
|
-
type TSelectedDateResponse = {
|
|
17
|
-
success: boolean;
|
|
18
|
-
};
|
|
19
|
-
type TTskSchHour = {
|
|
20
|
-
hour: string;
|
|
21
|
-
disabled: boolean;
|
|
22
|
-
value: string;
|
|
23
|
-
};
|
|
24
|
-
type TTskSchDay = {
|
|
25
|
-
type: string;
|
|
26
|
-
day: string;
|
|
27
|
-
tskSchHour?: TTskSchHour | TTskSchHour[];
|
|
28
|
-
isDisabled?: boolean;
|
|
29
|
-
};
|
|
30
|
-
type TScheduleResult = {
|
|
31
|
-
calId: string;
|
|
32
|
-
mode: string;
|
|
33
|
-
overassign: string;
|
|
34
|
-
weekNotConfigured: boolean;
|
|
35
|
-
frec: string;
|
|
36
|
-
tskSchId: string;
|
|
37
|
-
mondayWeek: string;
|
|
38
|
-
success: boolean;
|
|
39
|
-
tskSchDay: TTskSchDay | TTskSchDay[];
|
|
40
|
-
};
|
|
41
|
-
interface IScheduleInitialProps {
|
|
42
|
-
schId: string;
|
|
43
|
-
proId: string;
|
|
44
|
-
proVerId: string;
|
|
45
|
-
tskId: string;
|
|
46
|
-
showDisponibility: string;
|
|
47
|
-
showAttributes: string;
|
|
48
|
-
}
|
|
49
|
-
interface ILabelSelectedDay {
|
|
50
|
-
hour: string;
|
|
51
|
-
day?: string | undefined;
|
|
52
|
-
}
|
|
53
|
-
interface ISelectedDay {
|
|
54
|
-
hour?: string;
|
|
55
|
-
day?: string;
|
|
56
|
-
mondayWeek?: string;
|
|
57
|
-
dayNumber?: number;
|
|
58
|
-
morningOrAfternoonSelected?: number | null;
|
|
59
|
-
}
|
|
60
|
-
interface IStage {
|
|
61
|
-
name: string;
|
|
62
|
-
buttons?: IStageButton[];
|
|
63
|
-
}
|
|
64
|
-
interface IStageButton extends ButtonProps {
|
|
65
|
-
label: string;
|
|
66
|
-
title: string;
|
|
67
|
-
action: () => unknown;
|
|
68
|
-
isDisabled?: boolean;
|
|
69
|
-
value?: string;
|
|
70
|
-
isSelectedSelector: () => boolean;
|
|
71
|
-
}
|
|
72
|
-
type TSchInfoResult = {
|
|
73
|
-
pro_instances: {
|
|
74
|
-
pro_instance: TProcesses;
|
|
75
|
-
};
|
|
76
|
-
};
|
|
77
|
-
type TProcesses = {
|
|
78
|
-
id: number;
|
|
79
|
-
attributes: {
|
|
80
|
-
attribute: {
|
|
81
|
-
title: string;
|
|
82
|
-
value: string;
|
|
83
|
-
}[];
|
|
84
|
-
};
|
|
85
|
-
}[];
|
|
86
|
-
|
|
87
|
-
interface ISchedulerDataRetriever {
|
|
88
|
-
markDay(weekDay: string, hour: string, dayNumber: number): Promise<void>;
|
|
89
|
-
deleteDate(): Promise<boolean>;
|
|
90
|
-
loadWeek(weekDay: string, schId: string, proId: string, proVerId: string, tskId: string): Promise<TScheduleResult | null>;
|
|
91
|
-
loadInfo(schId: string, weekDay: string, dayNumber: number, hour: string): Promise<TProcesses | []>;
|
|
92
|
-
}
|
|
93
|
-
declare class Scheduler {
|
|
94
|
-
retriever: ISchedulerDataRetriever;
|
|
95
|
-
type?: "RescheduleTskScheduler" | "Scheduler" | undefined;
|
|
96
|
-
window?: any | undefined;
|
|
97
|
-
state: TSchedulerState;
|
|
98
|
-
private inited;
|
|
99
|
-
protected readonly _tableController: TableController;
|
|
100
|
-
constructor(properties: IScheduleInitialProps, retriever: ISchedulerDataRetriever, type?: "RescheduleTskScheduler" | "Scheduler" | undefined, window?: any | undefined);
|
|
101
|
-
getState(): TSchedulerState;
|
|
102
|
-
setState(newState: Partial<TSchedulerState>): void;
|
|
103
|
-
get tableController(): TableController;
|
|
104
|
-
loadWeek(weekDay?: string): Promise<boolean>;
|
|
105
|
-
loadInfo(dayNumber: number, hour: string): Promise<{
|
|
106
|
-
id: number;
|
|
107
|
-
attributes: {
|
|
108
|
-
attribute: {
|
|
109
|
-
title: string;
|
|
110
|
-
value: string;
|
|
111
|
-
}[];
|
|
112
|
-
};
|
|
113
|
-
}[]>;
|
|
114
|
-
private parseRows;
|
|
115
|
-
private isMorningTime;
|
|
116
|
-
setDay(day: ISelectedDay): void;
|
|
117
|
-
setStage({ index, newStage }: {
|
|
118
|
-
index: number;
|
|
119
|
-
newStage: IStage;
|
|
120
|
-
}): void;
|
|
121
|
-
syncStage(day: TTskSchDay, hour: number): void;
|
|
122
|
-
makeDaysStage(data?: TScheduleResult): void;
|
|
123
|
-
private makeMorningOrAfternoonStage;
|
|
124
|
-
private makeHoursStage;
|
|
125
|
-
deleteDate(): Promise<void>;
|
|
126
|
-
goNextWeek(): Promise<void>;
|
|
127
|
-
goPreviousWeek(): Promise<void>;
|
|
128
|
-
parsedDateLabel: () => string;
|
|
129
|
-
getSchedulerColumns(data: TScheduleResult | null): CellState[];
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
export { type ILabelSelectedDay, type IScheduleInitialProps, type ISchedulerDataRetriever, type ISelectedDay, type IStage, type IStageButton, Scheduler, type TProcesses, type TSchInfoResult, type TScheduleResult, type TSchedulerState, type TSelectedDateResponse, type TTskSchDay, type TTskSchHour };
|
|
1
|
+
export { ISchedulerDataRetriever, Scheduler } from './Scheduler/index.js';
|
|
2
|
+
export { ILabelSelectedDay, IScheduleInitialProps, ISelectedDay, IStage, IStageButton, TProcesses, TSchInfoResult, TScheduleResult, TSchedulerState, TSelectedDateResponse, TTskSchDay, TTskSchHour } from './Scheduler/types.js';
|
|
133
3
|
//# sourceMappingURL=index.d.ts.map
|