robbyson-frontend-library 0.0.1-rc12 → 0.0.1-rc13
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.d.ts +2 -1
- package/package.json +2 -1
- package/src/components/header-context-menu/header-context-menu.interface.ts +1 -1
- package/src/components/primary-tag/index.d.ts +1 -0
- package/src/components/primary-tag/primary-tag.interface.ts +21 -0
- package/src/components/primary-tag/primary-tag.types.d.ts +9 -0
- package/src/components/tag/index.d.ts +1 -0
- package/src/components/tag/tag.interface.ts +8 -0
- package/src/components/tag/tag.types.d.ts +9 -0
- package/src/components/timer/timer.interface.ts +1 -2
- package/src/components/tooltip/tooltip.interface.ts +18 -9
- package/src/index.ts +2 -0
- package/src/models/theme-base.ts +260 -53
- package/src/services/index.d.ts +1 -0
- package/src/services/tree.service.interface.ts +4 -0
- package/src/states/main-container/root-app.state.interface.ts +5 -0
- package/src/types/index.ts +1 -0
- package/src/types/tree/index.ts +1 -0
- package/src/types/tree/tree.types.ts +31 -0
- package/src/utils/date.utils.ts +39 -0
- package/src/components/tags/index.d.ts +0 -1
- package/src/components/tags/tags.interface.ts +0 -17
- package/src/components/tags/tags.types.d.ts +0 -9
package/index.d.ts
CHANGED
|
@@ -28,7 +28,8 @@ export * from "./src/components/text-field";
|
|
|
28
28
|
export * from "./src/components/tooltip";
|
|
29
29
|
export * from "./src/components/transitions";
|
|
30
30
|
export * from "./src/components/typography";
|
|
31
|
-
export * from "./src/components/
|
|
31
|
+
export * from "./src/components/primary-tag";
|
|
32
|
+
export * from "./src/components/tag";
|
|
32
33
|
export * from "./src/components/timer";
|
|
33
34
|
export * from "./src/components/sidebar";
|
|
34
35
|
export * from "./src/components/toggle-icon-button";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "robbyson-frontend-library",
|
|
3
|
-
"version": "0.0.1-
|
|
3
|
+
"version": "0.0.1-rc13",
|
|
4
4
|
"description": "Robbyson frontend Library",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"license": "MIT",
|
|
@@ -20,6 +20,7 @@
|
|
|
20
20
|
"@types/axios": "^0.14.0",
|
|
21
21
|
"@types/crypto-js": "^4.1.1",
|
|
22
22
|
"@types/lodash": "^4.14.199",
|
|
23
|
+
"@types/ramda": "^0.27.32",
|
|
23
24
|
"@types/react": "~18.2.0",
|
|
24
25
|
"@types/styled-components": "^5.1.26",
|
|
25
26
|
"styled-components": "^5.3.9",
|
|
@@ -10,4 +10,4 @@ export interface IHeaderContextMenuState {
|
|
|
10
10
|
activeButton: undefined | IHeaderContextMenuButtons;
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
-
export type IHeaderContextMenuButtons = "notification" | "quiz" | "informative" | "chat" | "guidance_all" | "guidance_favorites";
|
|
13
|
+
export type IHeaderContextMenuButtons = "notification" | "quiz" | "informative" | "chat" | "guidance_all" | "guidance_favorites" | "calendar";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './primary-tag.interface';
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { IconHandle } from "../../models";
|
|
2
|
+
import { IBaseComponentProp } from "../base-component.prop.interface";
|
|
3
|
+
|
|
4
|
+
export interface IPrimaryTagState {
|
|
5
|
+
show: boolean;
|
|
6
|
+
}
|
|
7
|
+
export interface IPrimaryTagProps<T>
|
|
8
|
+
extends IBaseComponentProp,
|
|
9
|
+
React.HTMLAttributes<T> {
|
|
10
|
+
iconHandle?: IconHandle;
|
|
11
|
+
type?: "success" | "error" | "warning" | "neutral";
|
|
12
|
+
size: "small" | "large";
|
|
13
|
+
disabled?: boolean;
|
|
14
|
+
textLocaleHandle?: string;
|
|
15
|
+
deletable?: boolean;
|
|
16
|
+
textColor?: string;
|
|
17
|
+
bgColor?: string;
|
|
18
|
+
iconColor?: string;
|
|
19
|
+
customIcon?: React.ReactNode;
|
|
20
|
+
textClassName?: string;
|
|
21
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
///<reference types="react" />
|
|
2
|
+
///<reference types="robbyson-frontend-library" />
|
|
3
|
+
|
|
4
|
+
declare module "styleguide/PrimaryTags" {
|
|
5
|
+
import { IPrimaryTagProps } from "robbyson-frontend-library";
|
|
6
|
+
const PrimaryTags: React.ComponentType<IPrimaryTagProps<any>>;
|
|
7
|
+
|
|
8
|
+
export default PrimaryTags;
|
|
9
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './tag.interface';
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { IBaseComponentProp } from "../base-component.prop.interface";
|
|
2
2
|
|
|
3
3
|
export interface ITimerProps extends IBaseComponentProp {
|
|
4
|
-
expirationDate:
|
|
4
|
+
expirationDate: string;
|
|
5
5
|
onTimerEnd?: () => void;
|
|
6
6
|
}
|
|
7
7
|
|
|
8
8
|
export interface ITimerState {
|
|
9
9
|
showStopWatch: boolean;
|
|
10
10
|
expirationDateStopWatch: string;
|
|
11
|
-
isFirstRender: boolean;
|
|
12
11
|
}
|
|
@@ -1,19 +1,28 @@
|
|
|
1
1
|
import { IBaseComponentProp } from "../base-component.prop.interface";
|
|
2
2
|
|
|
3
|
-
export type TooltipPosition = "top" | "bottom"
|
|
3
|
+
export type TooltipPosition = "top" | "bottom";
|
|
4
4
|
|
|
5
5
|
export interface ITooltipProps extends IBaseComponentProp {
|
|
6
6
|
textLocaleHandle: string;
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
width?:number;
|
|
10
|
-
onShow?():void;
|
|
11
|
-
onHide?():void;
|
|
12
|
-
className?:string;
|
|
7
|
+
children: React.ReactNode;
|
|
8
|
+
className?: string;
|
|
13
9
|
startDirection?: TooltipPosition;
|
|
10
|
+
width?: number;
|
|
11
|
+
/**
|
|
12
|
+
* @description
|
|
13
|
+
* Use `virtualizedId` to re-render dynamically texts, like: `states update`.
|
|
14
|
+
*/
|
|
15
|
+
virtualizedId?: string;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* @description
|
|
19
|
+
* Use `forceRecreate` to re-create tooltip component with new dimensions.
|
|
20
|
+
*
|
|
21
|
+
* This is useful when you need to re-render tooltip with dynamically texts sizes.
|
|
22
|
+
*/
|
|
23
|
+
forceRecreate?: boolean;
|
|
14
24
|
}
|
|
15
25
|
|
|
16
26
|
export interface ITooltipState {
|
|
17
|
-
hidden: boolean;
|
|
18
27
|
startDirection?: TooltipPosition;
|
|
19
|
-
}
|
|
28
|
+
}
|
package/src/index.ts
CHANGED
package/src/models/theme-base.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
|
|
2
1
|
class ThemeBaseColors {
|
|
3
2
|
primary1: string;
|
|
4
3
|
primary2: string;
|
|
@@ -12,10 +11,10 @@ class ThemeBaseColors {
|
|
|
12
11
|
solidBackground: string;
|
|
13
12
|
gradientBackground: string;
|
|
14
13
|
levels: {
|
|
15
|
-
shade100: string
|
|
16
|
-
shade75: string
|
|
17
|
-
shade50: string
|
|
18
|
-
shade25: string
|
|
14
|
+
shade100: string;
|
|
15
|
+
shade75: string;
|
|
16
|
+
shade50: string;
|
|
17
|
+
shade25: string;
|
|
19
18
|
radialGradient: string;
|
|
20
19
|
}[];
|
|
21
20
|
neutral90: string;
|
|
@@ -29,66 +28,274 @@ class ThemeBaseColors {
|
|
|
29
28
|
neutral10: string;
|
|
30
29
|
neutral0: string;
|
|
31
30
|
successes: {
|
|
32
|
-
text: string
|
|
33
|
-
hover: string
|
|
34
|
-
dark: string
|
|
35
|
-
default: string
|
|
36
|
-
light: string
|
|
37
|
-
background: string
|
|
31
|
+
text: string;
|
|
32
|
+
hover: string;
|
|
33
|
+
dark: string;
|
|
34
|
+
default: string;
|
|
35
|
+
light: string;
|
|
36
|
+
background: string;
|
|
38
37
|
};
|
|
39
38
|
errors: {
|
|
40
|
-
text: string
|
|
41
|
-
hover: string
|
|
42
|
-
dark: string
|
|
43
|
-
default: string
|
|
44
|
-
light: string
|
|
45
|
-
background: string
|
|
39
|
+
text: string;
|
|
40
|
+
hover: string;
|
|
41
|
+
dark: string;
|
|
42
|
+
default: string;
|
|
43
|
+
light: string;
|
|
44
|
+
background: string;
|
|
46
45
|
};
|
|
47
46
|
warnings: {
|
|
48
|
-
text: string
|
|
49
|
-
hover: string
|
|
50
|
-
dark: string
|
|
51
|
-
default: string
|
|
52
|
-
light: string
|
|
53
|
-
background: string
|
|
47
|
+
text: string;
|
|
48
|
+
hover: string;
|
|
49
|
+
dark: string;
|
|
50
|
+
default: string;
|
|
51
|
+
light: string;
|
|
52
|
+
background: string;
|
|
54
53
|
};
|
|
55
54
|
itemsTags: {
|
|
56
55
|
experience: {
|
|
57
|
-
text: string
|
|
58
|
-
background: string
|
|
59
|
-
}
|
|
56
|
+
text: string;
|
|
57
|
+
background: string;
|
|
58
|
+
};
|
|
60
59
|
physical: {
|
|
61
|
-
text: string
|
|
62
|
-
background: string
|
|
63
|
-
}
|
|
60
|
+
text: string;
|
|
61
|
+
background: string;
|
|
62
|
+
};
|
|
64
63
|
auction: {
|
|
65
|
-
text: string
|
|
66
|
-
background: string
|
|
67
|
-
}
|
|
64
|
+
text: string;
|
|
65
|
+
background: string;
|
|
66
|
+
};
|
|
68
67
|
raffle: {
|
|
69
|
-
text: string
|
|
70
|
-
background: string
|
|
71
|
-
}
|
|
68
|
+
text: string;
|
|
69
|
+
background: string;
|
|
70
|
+
};
|
|
72
71
|
crowdfunding: {
|
|
73
|
-
text: string
|
|
74
|
-
background: string
|
|
75
|
-
}
|
|
72
|
+
text: string;
|
|
73
|
+
background: string;
|
|
74
|
+
};
|
|
76
75
|
voucher: {
|
|
77
|
-
text: string
|
|
78
|
-
background: string
|
|
79
|
-
}
|
|
76
|
+
text: string;
|
|
77
|
+
background: string;
|
|
78
|
+
};
|
|
80
79
|
};
|
|
81
80
|
complementary: {
|
|
82
81
|
agendaReminder: string;
|
|
83
82
|
angelGodson: string;
|
|
84
83
|
angelGodfather: string;
|
|
85
84
|
};
|
|
86
|
-
|
|
87
85
|
}
|
|
88
86
|
|
|
89
|
-
export const ICON_HANDLES = [
|
|
87
|
+
export const ICON_HANDLES = [
|
|
88
|
+
"active-bold",
|
|
89
|
+
"active-thin",
|
|
90
|
+
"avatar-login",
|
|
91
|
+
"add-challenge-bold",
|
|
92
|
+
"add-challenge-thin",
|
|
93
|
+
"add-notification-bold",
|
|
94
|
+
"add-notification-thin",
|
|
95
|
+
"add-quiz-bold",
|
|
96
|
+
"add-quiz-thin",
|
|
97
|
+
"angel-friend-add-bold",
|
|
98
|
+
"angel-friend-add-thin",
|
|
99
|
+
"angel-friend-bold",
|
|
100
|
+
"angel-friend-thin",
|
|
101
|
+
"attachment-bold",
|
|
102
|
+
"attachment-thin",
|
|
103
|
+
"auction-bold",
|
|
104
|
+
"auction-thin",
|
|
105
|
+
"available-bold",
|
|
106
|
+
"available-thin",
|
|
107
|
+
"broadcast-bold",
|
|
108
|
+
"broadcast-thin",
|
|
109
|
+
"calendar-bold",
|
|
110
|
+
"calendar-thin",
|
|
111
|
+
"camera-bold",
|
|
112
|
+
"camera-thin",
|
|
113
|
+
"cancel-bold",
|
|
114
|
+
"cancel-thin",
|
|
115
|
+
"challenge-bold",
|
|
116
|
+
"challenge-thin",
|
|
117
|
+
"chat-bold",
|
|
118
|
+
"chatbot-bold",
|
|
119
|
+
"chatbot-thin",
|
|
120
|
+
"chat-fil-bold",
|
|
121
|
+
"chat-fill-thin",
|
|
122
|
+
"chat-smile-bold",
|
|
123
|
+
"chat-smile-thin",
|
|
124
|
+
"chat-thin",
|
|
125
|
+
"check-bold",
|
|
126
|
+
"check-thin",
|
|
127
|
+
"chocolate-menu",
|
|
128
|
+
"chronometer-bold",
|
|
129
|
+
"chronometer-thin",
|
|
130
|
+
"clock-bold",
|
|
131
|
+
"clock-thin",
|
|
132
|
+
"close-bold",
|
|
133
|
+
"close-thin",
|
|
134
|
+
"cloud-bold",
|
|
135
|
+
"cloud-thin",
|
|
136
|
+
"coin-bold",
|
|
137
|
+
"coin-thin",
|
|
138
|
+
"column-view-active-bold",
|
|
139
|
+
"column-view-active-thin",
|
|
140
|
+
"column-view-bold",
|
|
141
|
+
"column-view-thin",
|
|
142
|
+
"contacts-bold",
|
|
143
|
+
"contacts-thin",
|
|
144
|
+
"delete-bold",
|
|
145
|
+
"delete-thin",
|
|
146
|
+
"documents-bold",
|
|
147
|
+
"documents-thin",
|
|
148
|
+
"down-arrow",
|
|
149
|
+
"download-bold",
|
|
150
|
+
"download-thin",
|
|
151
|
+
"downward-arrow-bold",
|
|
152
|
+
"downward-arrow-thin",
|
|
153
|
+
"duplicate-bold",
|
|
154
|
+
"duplicate-thin",
|
|
155
|
+
"eagle-bold",
|
|
156
|
+
"eagle-thin",
|
|
157
|
+
"edit-bold",
|
|
158
|
+
"edit-thin",
|
|
159
|
+
"emoji-bold",
|
|
160
|
+
"emoji-thin",
|
|
161
|
+
"family-bold",
|
|
162
|
+
"family-thin",
|
|
163
|
+
"filter-active-bold",
|
|
164
|
+
"filter-active-thin",
|
|
165
|
+
"filter-inactive-bold",
|
|
166
|
+
"filter-inactive-thin",
|
|
167
|
+
"filter",
|
|
168
|
+
"forward-bold",
|
|
169
|
+
"forward-thin",
|
|
170
|
+
"goal-bold",
|
|
171
|
+
"goal-thin",
|
|
172
|
+
"grid-view-active-bold",
|
|
173
|
+
"grid-view-active-thin",
|
|
174
|
+
"grid-view-bold",
|
|
175
|
+
"grid-view-thin",
|
|
176
|
+
"group-bold",
|
|
177
|
+
"group-brackets-bold",
|
|
178
|
+
"group-brackets-thin",
|
|
179
|
+
"group-fill-bold",
|
|
180
|
+
"group-fill-thin",
|
|
181
|
+
"group-thin",
|
|
182
|
+
"guide-bold",
|
|
183
|
+
"guide-thin",
|
|
184
|
+
"health-bold",
|
|
185
|
+
"health-thin",
|
|
186
|
+
"heart-bold",
|
|
187
|
+
"heart-fill-bold",
|
|
188
|
+
"heart-fill-thin",
|
|
189
|
+
"heart-thin",
|
|
190
|
+
"humor-bold",
|
|
191
|
+
"humor-thin",
|
|
192
|
+
"inactive-bold",
|
|
193
|
+
"inactive-thin",
|
|
194
|
+
"indicator-bold",
|
|
195
|
+
"indicator-thin",
|
|
196
|
+
"info-bold",
|
|
197
|
+
"info-thin",
|
|
198
|
+
"integration-bold",
|
|
199
|
+
"integration-thin",
|
|
200
|
+
"learning-bold",
|
|
201
|
+
"learning-thin",
|
|
202
|
+
"leave-bold",
|
|
203
|
+
"leave-thin",
|
|
204
|
+
"left-arrow-large",
|
|
205
|
+
"left-arrow-small",
|
|
206
|
+
"like-bold",
|
|
207
|
+
"like-fill-bold",
|
|
208
|
+
"like-fill-thin",
|
|
209
|
+
"like-thin",
|
|
210
|
+
"magnifying-glass-bold",
|
|
211
|
+
"magnifying-glass-thin",
|
|
212
|
+
"minus",
|
|
213
|
+
"more-vert",
|
|
214
|
+
"mountain-bold",
|
|
215
|
+
"mountain-thin",
|
|
216
|
+
"new-document-bold",
|
|
217
|
+
"new-document-thin",
|
|
218
|
+
"new-tip-thin-1",
|
|
219
|
+
"new-tip-thin",
|
|
220
|
+
"notification-bold",
|
|
221
|
+
"notification-thin",
|
|
222
|
+
"objetive-bold",
|
|
223
|
+
"objetive-thin",
|
|
224
|
+
"order-bold-1",
|
|
225
|
+
"order-bold",
|
|
226
|
+
"order-thin-1",
|
|
227
|
+
"order-thin",
|
|
228
|
+
"performance-bold",
|
|
229
|
+
"performance-thin",
|
|
230
|
+
"phone-bold",
|
|
231
|
+
"phone-thin",
|
|
232
|
+
"plus",
|
|
233
|
+
"quiz-bold",
|
|
234
|
+
"quiz-thin",
|
|
235
|
+
"raffle-bold",
|
|
236
|
+
"raffle-draw-bold",
|
|
237
|
+
"raffle-draw-thin",
|
|
238
|
+
"raffle-thin",
|
|
239
|
+
"relationship-bold",
|
|
240
|
+
"relationship-thin",
|
|
241
|
+
"reports-bold",
|
|
242
|
+
"reports-thin",
|
|
243
|
+
"right-arrow-large",
|
|
244
|
+
"right-arrow-small",
|
|
245
|
+
"send-bold",
|
|
246
|
+
"send-thin",
|
|
247
|
+
"settings-bold",
|
|
248
|
+
"settings-thin",
|
|
249
|
+
"star-bold",
|
|
250
|
+
"star-thin",
|
|
251
|
+
"store-bold",
|
|
252
|
+
"store-item-bold",
|
|
253
|
+
"store-item-thin",
|
|
254
|
+
"store-thin",
|
|
255
|
+
"tag-bold",
|
|
256
|
+
"tag-thin",
|
|
257
|
+
"test-bold",
|
|
258
|
+
"test-thin",
|
|
259
|
+
"tips-bold",
|
|
260
|
+
"tips-thin",
|
|
261
|
+
"tree-bold",
|
|
262
|
+
"tree-thin",
|
|
263
|
+
"trophy-bold",
|
|
264
|
+
"trophy-thin",
|
|
265
|
+
"up-arrow",
|
|
266
|
+
"upload-bold",
|
|
267
|
+
"upload-thin",
|
|
268
|
+
"upward-arrow-bold",
|
|
269
|
+
"upward-arrow-thin",
|
|
270
|
+
"user-bold",
|
|
271
|
+
"user-thin",
|
|
272
|
+
"variable-pay-bold",
|
|
273
|
+
"variable-pay-thin",
|
|
274
|
+
"view-bold",
|
|
275
|
+
"view-thin",
|
|
276
|
+
"not-view-thin",
|
|
277
|
+
"not-view-bold",
|
|
278
|
+
"work-bold",
|
|
279
|
+
"working",
|
|
280
|
+
"work-thin",
|
|
281
|
+
"no-results-found",
|
|
282
|
+
"not-found-bold",
|
|
283
|
+
"hamburger-menu",
|
|
284
|
+
"cloud-circle",
|
|
285
|
+
"mountain-circle",
|
|
286
|
+
"star-circle",
|
|
287
|
+
"expand-image-bold",
|
|
288
|
+
"camera-off-bold",
|
|
289
|
+
"minimize-image-bold",
|
|
290
|
+
"phone-call-bold",
|
|
291
|
+
"microphone-bold",
|
|
292
|
+
"microphone-off-bold",
|
|
293
|
+
"share-screen-bold",
|
|
294
|
+
"ead-play-button",
|
|
295
|
+
"tag-left-triangle",
|
|
296
|
+
] as const;
|
|
90
297
|
|
|
91
|
-
export type IconHandle = typeof ICON_HANDLES[number];
|
|
298
|
+
export type IconHandle = (typeof ICON_HANDLES)[number];
|
|
92
299
|
|
|
93
300
|
class ThemeBaseRect {
|
|
94
301
|
top: string;
|
|
@@ -129,8 +336,8 @@ class Typography {
|
|
|
129
336
|
h6Bold: ThemeTypography;
|
|
130
337
|
subtitle2: ThemeTypography;
|
|
131
338
|
subtitle1: ThemeTypography;
|
|
132
|
-
body1Medium: ThemeTypography
|
|
133
|
-
body1Book: ThemeTypography
|
|
339
|
+
body1Medium: ThemeTypography;
|
|
340
|
+
body1Book: ThemeTypography;
|
|
134
341
|
body1BookItalic: ThemeTypography;
|
|
135
342
|
body1Link: ThemeTypography;
|
|
136
343
|
body2Medium: ThemeTypography;
|
|
@@ -144,7 +351,7 @@ class Typography {
|
|
|
144
351
|
small: ThemeTypography;
|
|
145
352
|
smallMedium: ThemeTypography;
|
|
146
353
|
toolTip: ThemeTypography;
|
|
147
|
-
}
|
|
354
|
+
}
|
|
148
355
|
|
|
149
356
|
export class ThemeBase {
|
|
150
357
|
colors: ThemeBaseColors;
|
|
@@ -152,7 +359,7 @@ export class ThemeBase {
|
|
|
152
359
|
fontFamily: string; // font-family
|
|
153
360
|
fontWeight: string; // font-weight
|
|
154
361
|
fontStyle: string; // font-style
|
|
155
|
-
src: string; // src
|
|
362
|
+
src: string; // src
|
|
156
363
|
}[];
|
|
157
364
|
transitions: ThemeTransition;
|
|
158
365
|
typography: Typography;
|
|
@@ -165,10 +372,10 @@ export class ThemeBase {
|
|
|
165
372
|
logoCompleteNegative: ThemeAssets;
|
|
166
373
|
logoIconNegative: ThemeAssets;
|
|
167
374
|
backgroundLogo: ThemeAssets;
|
|
168
|
-
humorAvatar: ThemeAssets
|
|
169
|
-
humorImGoodCircle: ThemeAssets
|
|
170
|
-
humorImTopCircle: ThemeAssets
|
|
171
|
-
humorImbadCircle: ThemeAssets
|
|
375
|
+
humorAvatar: ThemeAssets;
|
|
376
|
+
humorImGoodCircle: ThemeAssets;
|
|
377
|
+
humorImTopCircle: ThemeAssets;
|
|
378
|
+
humorImbadCircle: ThemeAssets;
|
|
172
379
|
logoMobile: ThemeAssets;
|
|
173
380
|
loginRobbysonAvatar: ThemeAssets;
|
|
174
381
|
quizThankYouAvatar: ThemeAssets;
|
|
@@ -193,4 +400,4 @@ export class ThemeBase {
|
|
|
193
400
|
quizThankYouAvatar: new ThemeAssets(),
|
|
194
401
|
};
|
|
195
402
|
}
|
|
196
|
-
}
|
|
403
|
+
}
|
package/src/services/index.d.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { Week } from "../../components/tree-date-picker";
|
|
2
|
+
|
|
1
3
|
import {
|
|
2
4
|
HumorLastModel,
|
|
3
5
|
HumorListModel,
|
|
@@ -24,5 +26,8 @@ export interface IRootApp {
|
|
|
24
26
|
lastHumor: HumorLastModel[];
|
|
25
27
|
hasRegisterMood: boolean;
|
|
26
28
|
};
|
|
29
|
+
selectedDate: Date| null,
|
|
30
|
+
selectedMonth: Date | null,
|
|
31
|
+
selectedWeek?: Week,
|
|
27
32
|
createGlobalImplementations: () => void;
|
|
28
33
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './tree';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './tree.types';
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
// import { DurationInputArg1, DurationInputArg2 } from 'moment';
|
|
2
|
+
// import { AxiosRequestConfig } from 'axios';
|
|
3
|
+
|
|
4
|
+
export enum UnitType {
|
|
5
|
+
MONTHS = 'months',
|
|
6
|
+
WEEKS = 'weeks',
|
|
7
|
+
DAYS = 'days',
|
|
8
|
+
HOURS = 'hours',
|
|
9
|
+
MINUTES = 'minutes',
|
|
10
|
+
SECONDS = 'seconds',
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
type User = {
|
|
14
|
+
_id: number;
|
|
15
|
+
contractor_id: number;
|
|
16
|
+
login: string;
|
|
17
|
+
name: string;
|
|
18
|
+
robbyson_user_id: number;
|
|
19
|
+
system_id: number;
|
|
20
|
+
identification: string;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export type JWT = {
|
|
24
|
+
iat: number;
|
|
25
|
+
exp: number;
|
|
26
|
+
sub: User;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export enum TreeActionTypes {
|
|
30
|
+
SET_DATETREE = "SET_DATETREE",
|
|
31
|
+
}
|
package/src/utils/date.utils.ts
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import _ from "lodash";
|
|
2
2
|
import moment from "moment";
|
|
3
3
|
|
|
4
|
+
type RemainingTime = {
|
|
5
|
+
timeRemainingText: string;
|
|
6
|
+
secondsDistance: number;
|
|
7
|
+
};
|
|
8
|
+
|
|
4
9
|
export class DateUtils {
|
|
5
10
|
static isSameDateAsNow(date: Date): boolean {
|
|
6
11
|
return moment(date).isSame(moment(new Date()), "day");
|
|
@@ -32,4 +37,38 @@ export class DateUtils {
|
|
|
32
37
|
|
|
33
38
|
return dates;
|
|
34
39
|
}
|
|
40
|
+
|
|
41
|
+
static getRemainingTimeFromNow(
|
|
42
|
+
compareDate: Date,
|
|
43
|
+
complementaryText: string
|
|
44
|
+
): RemainingTime {
|
|
45
|
+
if (!compareDate)
|
|
46
|
+
return {
|
|
47
|
+
secondsDistance: 0,
|
|
48
|
+
timeRemainingText: "",
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
function formatTime(time: number, length = 2): string {
|
|
52
|
+
return time.toString().padStart(length, "0");
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
const diff = moment(compareDate).diff(moment(), "seconds");
|
|
56
|
+
|
|
57
|
+
const days = formatTime(Math.floor(diff / (60 * 60 * 24)), 3);
|
|
58
|
+
const hours = formatTime(
|
|
59
|
+
Math.floor((diff % (60 * 60 * 24)) / (60 * 60))
|
|
60
|
+
);
|
|
61
|
+
const minutes = formatTime(Math.floor((diff % (60 * 60)) / 60));
|
|
62
|
+
const seconds = formatTime(Math.floor(diff % 60));
|
|
63
|
+
|
|
64
|
+
const text =
|
|
65
|
+
diff < 0
|
|
66
|
+
? `000 ${complementaryText} 00:00:00`
|
|
67
|
+
: `${days} ${complementaryText} ${hours}:${minutes}:${seconds}`;
|
|
68
|
+
|
|
69
|
+
return {
|
|
70
|
+
timeRemainingText: text,
|
|
71
|
+
secondsDistance: diff,
|
|
72
|
+
};
|
|
73
|
+
}
|
|
35
74
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './tags.interface';
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { IconHandle } from "../../models";
|
|
2
|
-
import { IBaseComponentProp } from "../base-component.prop.interface";
|
|
3
|
-
|
|
4
|
-
export interface ITagsState {
|
|
5
|
-
show: boolean;
|
|
6
|
-
}
|
|
7
|
-
export interface ITagsProps<T> extends IBaseComponentProp, React.HTMLAttributes<T> {
|
|
8
|
-
closeable?: boolean;
|
|
9
|
-
fillIcon?: string;
|
|
10
|
-
iconHandle?: IconHandle;
|
|
11
|
-
children?: any;
|
|
12
|
-
variant?: "primary" | "secondary";
|
|
13
|
-
type?: "success" | "error" | "warning";
|
|
14
|
-
size: "small" | "large";
|
|
15
|
-
disabled?: boolean
|
|
16
|
-
textLocaleHandle?: string;
|
|
17
|
-
}
|