robbyson-frontend-library 1.0.54 → 1.0.56
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/components/pages/base-app-page.component.js +4 -3
- package/dist/components/pages/base-app-page.styles.js +2 -1
- package/dist/constants/market.constants.js +10 -0
- package/dist/models/tree/tree.model.js +6 -6
- package/dist/types/tree/tree.types.js +1 -0
- package/dist/utils/date.utils.js +4 -7
- package/package.json +1 -1
- package/src/components/context-menu/context-menu.interface.ts +1 -0
- package/src/components/daily-chart/daily-chart.interface.ts +1 -1
- package/src/components/dropdown/dropdown.interface.ts +3 -0
- package/src/components/header-context-menu/header-context-menu.interface.ts +3 -1
- package/src/components/icon-button/icon-button.interface.ts +1 -0
- package/src/components/mountain-chart/mountain-chart.interface.ts +1 -0
- package/src/components/pages/base-app-page.component.tsx +14 -7
- package/src/components/pages/base-app-page.styles.ts +5 -0
- package/src/components/radio-button/radio-button.interface.ts +1 -0
- package/src/components/result-chart/result-chart.interface.ts +1 -1
- package/src/components/sidebar/sidebar.interface.ts +1 -0
- package/src/components/tab/tab.interface.ts +2 -1
- package/src/components/toggle-icon-button/toggle-icon-button.interface.ts +12 -9
- package/src/components/tree-date-picker/tree-date-picker.interface.ts +3 -3
- package/src/components/weekly-chart/weekly-chart.interface.ts +1 -0
- package/src/constants/market.constants.ts +13 -0
- package/src/models/tree/tree.model.ts +3 -1
- package/src/models/user-session.model.ts +2 -2
- package/src/services/tree.service.interface.ts +2 -0
- package/src/states/main-container/tree-app.state.interface.ts +1 -0
- package/src/types/tree/tree.types.ts +1 -0
- package/src/utils/date.utils.ts +7 -8
|
@@ -24,7 +24,7 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
|
24
24
|
};
|
|
25
25
|
import React from "react";
|
|
26
26
|
import { IoC } from "../../ioc";
|
|
27
|
-
import { PageContainer, Header, Title, ContextMenu, Content, LeftArrowLarge, } from "./base-app-page.styles";
|
|
27
|
+
import { PageContainer, Header, Title, ContextMenu, Content, LeftArrowLarge, GenericButton, } from "./base-app-page.styles";
|
|
28
28
|
import { RobbysonNavigate } from "../../utils";
|
|
29
29
|
import { QueryParamsFactory } from "../../factories/query-params.factory";
|
|
30
30
|
var BaseAppPage = /** @class */ (function (_super) {
|
|
@@ -80,8 +80,9 @@ var BaseAppPage = /** @class */ (function (_super) {
|
|
|
80
80
|
return (React.createElement(PageContainer, null,
|
|
81
81
|
React.createElement(Header, { usePageHeader: this._usePageHeader },
|
|
82
82
|
React.createElement("div", null,
|
|
83
|
-
React.createElement(
|
|
84
|
-
|
|
83
|
+
React.createElement(GenericButton, { onClick: function () { return _this.redirect(); }, "aria-label": "Voltar" },
|
|
84
|
+
React.createElement(LeftArrowLarge, { src: this._themeService.getIconAssetUrl("left-arrow-large"), isOperacaoPage: isOperacaoPage })),
|
|
85
|
+
React.createElement(Title, { tabIndex: 0 }, this.translate(this.headerLocale))),
|
|
85
86
|
!this._avoidContextMenu && (React.createElement(ContextMenu, { className: "body-2-book" }, this.contextMenu()))),
|
|
86
87
|
React.createElement(Content, { contentMarginTop: this._contentMarginTop, usePageHeader: this._usePageHeader, avoidContextMenu: this._avoidContextMenu }, this.renderPage())));
|
|
87
88
|
};
|
|
@@ -47,4 +47,5 @@ export var LeftArrowLarge = styled(SVG)(templateObject_10 || (templateObject_10
|
|
|
47
47
|
var isOperacaoPage = _a.isOperacaoPage;
|
|
48
48
|
return (isOperacaoPage ? "grey" : "inherit");
|
|
49
49
|
}, LayoutDimensions.width.horizontalIpadMini + 1);
|
|
50
|
-
var
|
|
50
|
+
export var GenericButton = styled.button(templateObject_11 || (templateObject_11 = __makeTemplateObject(["\n background: none;\n border: none;\n"], ["\n background: none;\n border: none;\n"])));
|
|
51
|
+
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8, templateObject_9, templateObject_10, templateObject_11;
|
|
@@ -19,6 +19,15 @@ export var PRODUCT_TYPE_BY_ID = {
|
|
|
19
19
|
// 6: "donation",
|
|
20
20
|
7: "voucher",
|
|
21
21
|
};
|
|
22
|
+
export var PRODUCT_TYPE_BY_ID_LOCALES = {
|
|
23
|
+
1: "main_enumeratorProductType_experiences",
|
|
24
|
+
2: "main_enumeratorProductType_customization",
|
|
25
|
+
3: "main_enumeratorProductType_material",
|
|
26
|
+
4: "main_enumeratorProductType_raffle",
|
|
27
|
+
// 5: "auction",
|
|
28
|
+
// 6: "donation",
|
|
29
|
+
7: "main_enumeratorProductType_voucher",
|
|
30
|
+
};
|
|
22
31
|
export var PRODUCT_ORDER_STATUS_ID;
|
|
23
32
|
(function (PRODUCT_ORDER_STATUS_ID) {
|
|
24
33
|
PRODUCT_ORDER_STATUS_ID[PRODUCT_ORDER_STATUS_ID["ORDERED"] = 1] = "ORDERED";
|
|
@@ -68,6 +77,7 @@ export var MarketConstants = {
|
|
|
68
77
|
PRODUCT_TYPE_ID: PRODUCT_TYPE_ID,
|
|
69
78
|
PRODUCT_TYPE_BY_ID: PRODUCT_TYPE_BY_ID,
|
|
70
79
|
PRODUCT_ORDER_STATUS_ID: PRODUCT_ORDER_STATUS_ID,
|
|
80
|
+
PRODUCT_TYPE_BY_ID_LOCALES: PRODUCT_TYPE_BY_ID_LOCALES,
|
|
71
81
|
PURCHASED_ORDERS_PROJECTION_FILTER: PURCHASED_ORDERS_PROJECTION_FILTER,
|
|
72
82
|
PURCHASED_ORDERS_SORT_FILTER: PURCHASED_ORDERS_SORT_FILTER,
|
|
73
83
|
PRODUCTS_PROJECTION_FILTER: PRODUCTS_PROJECTION_FILTER,
|
|
@@ -53,10 +53,10 @@ var TreeModel = /** @class */ (function (_super) {
|
|
|
53
53
|
__extends(TreeModel, _super);
|
|
54
54
|
function TreeModel(props) {
|
|
55
55
|
var _this = this;
|
|
56
|
-
var _a, _b, _c, _d;
|
|
56
|
+
var _a, _b, _c, _d, _e, _f;
|
|
57
57
|
_this = _super.call(this) || this;
|
|
58
58
|
_this._id = props === null || props === void 0 ? void 0 : props._id;
|
|
59
|
-
_this.data = (props === null || props === void 0 ? void 0 : props.data)
|
|
59
|
+
_this.data = ((_b = Object.keys((_a = props === null || props === void 0 ? void 0 : props.data) !== null && _a !== void 0 ? _a : {})) === null || _b === void 0 ? void 0 : _b.length) > 0 ? {
|
|
60
60
|
i: props === null || props === void 0 ? void 0 : props.data.i,
|
|
61
61
|
d: props === null || props === void 0 ? void 0 : props.data.d,
|
|
62
62
|
g: props === null || props === void 0 ? void 0 : props.data.g,
|
|
@@ -67,12 +67,12 @@ var TreeModel = /** @class */ (function (_super) {
|
|
|
67
67
|
goalRegister: props === null || props === void 0 ? void 0 : props.data.metaCadastrada,
|
|
68
68
|
fator: props === null || props === void 0 ? void 0 : props.data.fator,
|
|
69
69
|
m: {
|
|
70
|
-
maxCoins: (
|
|
71
|
-
qtdEarning: (
|
|
72
|
-
coinsGestor: (
|
|
70
|
+
maxCoins: (_c = props === null || props === void 0 ? void 0 : props.data.m) === null || _c === void 0 ? void 0 : _c.maxCoins,
|
|
71
|
+
qtdEarning: (_d = props === null || props === void 0 ? void 0 : props.data.m) === null || _d === void 0 ? void 0 : _d.qtdGanho,
|
|
72
|
+
coinsGestor: (_e = props === null || props === void 0 ? void 0 : props.data.m) === null || _e === void 0 ? void 0 : _e.coinsGestor
|
|
73
73
|
},
|
|
74
74
|
} : {};
|
|
75
|
-
if (((
|
|
75
|
+
if (((_f = props === null || props === void 0 ? void 0 : props.data) === null || _f === void 0 ? void 0 : _f.cd) !== undefined)
|
|
76
76
|
_this.data = (props === null || props === void 0 ? void 0 : props.data) != null ? __assign(__assign({}, props === null || props === void 0 ? void 0 : props.data), { cd: props === null || props === void 0 ? void 0 : props.data.cd }) : {};
|
|
77
77
|
_this.colors = props === null || props === void 0 ? void 0 : props.colors;
|
|
78
78
|
_this.highlightColors = props === null || props === void 0 ? void 0 : props.highlightColors;
|
|
@@ -38,6 +38,7 @@ export var TypeReferenceLetterEnum;
|
|
|
38
38
|
TypeReferenceLetterEnum["M"] = "monthly";
|
|
39
39
|
TypeReferenceLetterEnum["D"] = "daily";
|
|
40
40
|
TypeReferenceLetterEnum["W"] = "weekly";
|
|
41
|
+
TypeReferenceLetterEnum["S"] = "weekly";
|
|
41
42
|
})(TypeReferenceLetterEnum || (TypeReferenceLetterEnum = {}));
|
|
42
43
|
export var TreeActionTypes;
|
|
43
44
|
(function (TreeActionTypes) {
|
package/dist/utils/date.utils.js
CHANGED
|
@@ -68,13 +68,10 @@ var DateUtils = /** @class */ (function () {
|
|
|
68
68
|
}
|
|
69
69
|
var minutes = Math.floor((secondsAsNumber % 3600) / 60);
|
|
70
70
|
var seconds = Math.floor((secondsAsNumber % 3600) % 60);
|
|
71
|
-
var
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
":" +
|
|
76
|
-
(seconds < 10 ? "0" : "") +
|
|
77
|
-
seconds;
|
|
71
|
+
var formattedHours = parseFloat(hours) > 0 ? hours.padStart(2, "0") : "00";
|
|
72
|
+
var formattedMinutes = minutes === 0 ? "00" : minutes < 10 ? "0" + minutes : minutes.toString();
|
|
73
|
+
var formattedSeconds = seconds === 0 ? "00" : seconds < 10 ? "0" + seconds : seconds.toString();
|
|
74
|
+
var result = "".concat(formattedHours, ":").concat(formattedMinutes, ":").concat(formattedSeconds);
|
|
78
75
|
if (valueNegative) {
|
|
79
76
|
result = "- ".concat(result);
|
|
80
77
|
}
|
package/package.json
CHANGED
|
@@ -29,6 +29,9 @@ export interface IDropdownProps
|
|
|
29
29
|
pointerCursor?: boolean;
|
|
30
30
|
textarea?: boolean;
|
|
31
31
|
preventCloseOnClickOutside?: boolean;
|
|
32
|
+
suffixIconHandleAriaLabel?: string;
|
|
33
|
+
outSuffixIconHandleAriaLabel?: string;
|
|
34
|
+
prefixIconHandleAriaLabel?: string;
|
|
32
35
|
}
|
|
33
36
|
export type ValuesDropdownData = {
|
|
34
37
|
labelLocaleHandle: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { IBaseComponentProp } from "../base-component.prop.interface";
|
|
2
|
-
import { ISelectDatePicker, TabKey } from "../../components/tree-date-picker";
|
|
2
|
+
import { ISelectDatePicker, TabKey, Week } from "../../components/tree-date-picker";
|
|
3
3
|
import { TreeDTO } from "../../services";
|
|
4
4
|
|
|
5
5
|
export interface IHeaderContextMenuProps extends IBaseComponentProp {
|
|
@@ -10,8 +10,10 @@ export interface IHeaderContextMenuProps extends IBaseComponentProp {
|
|
|
10
10
|
calendarHideTabs?: boolean;
|
|
11
11
|
activeTab?: TabKey;
|
|
12
12
|
selectedMonth?: Date | null;
|
|
13
|
+
selectedDate?: Date;
|
|
13
14
|
showCalendar?: boolean;
|
|
14
15
|
textBreakpointsClasses?: HeaderTextBreakpointsClasses;
|
|
16
|
+
selectedWeek?: Week;
|
|
15
17
|
onButtonClick?: (
|
|
16
18
|
buttonName: IHeaderContextMenuButtons,
|
|
17
19
|
linkTo?: string
|
|
@@ -9,6 +9,7 @@ import {
|
|
|
9
9
|
ContextMenu,
|
|
10
10
|
Content,
|
|
11
11
|
LeftArrowLarge,
|
|
12
|
+
GenericButton,
|
|
12
13
|
} from "./base-app-page.styles";
|
|
13
14
|
import { RobbysonNavigate } from "../../utils";
|
|
14
15
|
import { QueryParamsFactory } from "../../factories/query-params.factory";
|
|
@@ -80,14 +81,20 @@ export abstract class BaseAppPage<T, T1> extends React.Component<T, T1> {
|
|
|
80
81
|
<PageContainer>
|
|
81
82
|
<Header usePageHeader={this._usePageHeader}>
|
|
82
83
|
<div>
|
|
83
|
-
<
|
|
84
|
-
src={this._themeService.getIconAssetUrl(
|
|
85
|
-
"left-arrow-large"
|
|
86
|
-
)}
|
|
84
|
+
<GenericButton
|
|
87
85
|
onClick={() => this.redirect()}
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
86
|
+
aria-label="Voltar"
|
|
87
|
+
>
|
|
88
|
+
<LeftArrowLarge
|
|
89
|
+
src={this._themeService.getIconAssetUrl(
|
|
90
|
+
"left-arrow-large"
|
|
91
|
+
)}
|
|
92
|
+
isOperacaoPage={isOperacaoPage}
|
|
93
|
+
/>
|
|
94
|
+
</GenericButton>
|
|
95
|
+
<Title tabIndex={0}>
|
|
96
|
+
{this.translate(this.headerLocale)}
|
|
97
|
+
</Title>
|
|
91
98
|
</div>
|
|
92
99
|
|
|
93
100
|
{!this._avoidContextMenu && (
|
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
import { IBaseComponentProp } from "../base-component.prop.interface";
|
|
2
2
|
import { IconHandle } from "../../models";
|
|
3
3
|
|
|
4
|
-
export type ToggleActualState = "disabled" | "on" | "off"
|
|
4
|
+
export type ToggleActualState = "disabled" | "on" | "off";
|
|
5
5
|
|
|
6
|
-
export interface IToggleIconButtonProps<T>
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
6
|
+
export interface IToggleIconButtonProps<T>
|
|
7
|
+
extends React.ButtonHTMLAttributes<T>,
|
|
8
|
+
IBaseComponentProp {
|
|
9
|
+
iconHandle: IconHandle;
|
|
10
|
+
selectedIconHandle: IconHandle;
|
|
11
|
+
active?: boolean;
|
|
12
|
+
disabled?: boolean;
|
|
13
|
+
disabledIconHandle?: IconHandle;
|
|
14
|
+
fatherControl?: boolean;
|
|
15
|
+
ariaLabel?: string;
|
|
16
|
+
}
|
|
@@ -35,11 +35,11 @@ export type Week = {
|
|
|
35
35
|
|
|
36
36
|
export type Weeks = Week[];
|
|
37
37
|
|
|
38
|
-
export type TabKey = "
|
|
38
|
+
export type TabKey = "daily" | "weekly" | "monthly" | "range";
|
|
39
39
|
|
|
40
40
|
export type DateTypeMap = {
|
|
41
|
-
|
|
42
|
-
|
|
41
|
+
daily: Date | null;
|
|
42
|
+
weekly?: Date | null;
|
|
43
43
|
monthly: Date | null;
|
|
44
44
|
range: Date | null;
|
|
45
45
|
};
|
|
@@ -22,6 +22,18 @@ export const PRODUCT_TYPE_BY_ID: {
|
|
|
22
22
|
7: "voucher",
|
|
23
23
|
};
|
|
24
24
|
|
|
25
|
+
export const PRODUCT_TYPE_BY_ID_LOCALES: {
|
|
26
|
+
[key: number]: string;
|
|
27
|
+
} = {
|
|
28
|
+
1: "main_enumeratorProductType_experiences",
|
|
29
|
+
2: "main_enumeratorProductType_customization",
|
|
30
|
+
3: "main_enumeratorProductType_material",
|
|
31
|
+
4: "main_enumeratorProductType_raffle",
|
|
32
|
+
// 5: "auction",
|
|
33
|
+
// 6: "donation",
|
|
34
|
+
7: "main_enumeratorProductType_voucher",
|
|
35
|
+
};
|
|
36
|
+
|
|
25
37
|
export enum PRODUCT_ORDER_STATUS_ID {
|
|
26
38
|
ORDERED = 1,
|
|
27
39
|
BEING_PROCESSED = 2,
|
|
@@ -71,6 +83,7 @@ export const MarketConstants = {
|
|
|
71
83
|
PRODUCT_TYPE_ID,
|
|
72
84
|
PRODUCT_TYPE_BY_ID,
|
|
73
85
|
PRODUCT_ORDER_STATUS_ID,
|
|
86
|
+
PRODUCT_TYPE_BY_ID_LOCALES,
|
|
74
87
|
PURCHASED_ORDERS_PROJECTION_FILTER,
|
|
75
88
|
PURCHASED_ORDERS_SORT_FILTER,
|
|
76
89
|
PRODUCTS_PROJECTION_FILTER,
|
|
@@ -86,7 +86,9 @@ export class TreeModel extends BaseRepositoryModel {
|
|
|
86
86
|
constructor(props: ITreeOldModel){
|
|
87
87
|
super();
|
|
88
88
|
this._id = props?._id;
|
|
89
|
-
this.data =
|
|
89
|
+
this.data = Object.keys(
|
|
90
|
+
props?.data ?? {}
|
|
91
|
+
)?.length > 0 ? {
|
|
90
92
|
i : props?.data.i,
|
|
91
93
|
d : props?.data.d,
|
|
92
94
|
g : props?.data.g,
|
|
@@ -47,14 +47,14 @@ export class UserSessionModel extends BaseRepositoryModel {
|
|
|
47
47
|
_id: string;
|
|
48
48
|
active: boolean;
|
|
49
49
|
}[];
|
|
50
|
-
|
|
50
|
+
userPrimaryAttribute?: {
|
|
51
51
|
attribute: {
|
|
52
52
|
_id: string;
|
|
53
53
|
primary: boolean;
|
|
54
54
|
};
|
|
55
55
|
_id: string;
|
|
56
56
|
active: boolean;
|
|
57
|
-
}
|
|
57
|
+
};
|
|
58
58
|
name: string;
|
|
59
59
|
userHierarchyLevel: number; // Hierarquia do usuario em si, não do espelho
|
|
60
60
|
};
|
|
@@ -20,6 +20,7 @@ export interface ITreeService {
|
|
|
20
20
|
getReportPerformance(
|
|
21
21
|
params: TreePerformanceParams
|
|
22
22
|
): Promise<TreeReportPerformanceModel[]>;
|
|
23
|
+
setReduxDateTree(date: string): void;
|
|
23
24
|
getIndicators({
|
|
24
25
|
params,
|
|
25
26
|
}: TreeDTO.IGetIndicatorsTreeDTO): Promise<TreeIndicatorModel[]>;
|
|
@@ -42,6 +43,7 @@ export interface ITreeService {
|
|
|
42
43
|
params: TreeDTO.IHandleBreadCrumbTreeDTO
|
|
43
44
|
): Promise<TreeDTO.IBreadcrumbData | TreeDTO.IBreadcrumbData[] | never[] | void>;
|
|
44
45
|
setUserCurrentSelected(params?: TreeDTO.IHandleSearchUser): void;
|
|
46
|
+
setNodeTree(node: string): void;
|
|
45
47
|
handleSearch(
|
|
46
48
|
params: TreeDTO.IHandleSearchTreeDTO
|
|
47
49
|
): Promise<TreeDTO.IHandleSearchUser[]>;
|
package/src/utils/date.utils.ts
CHANGED
|
@@ -96,14 +96,13 @@ export class DateUtils {
|
|
|
96
96
|
|
|
97
97
|
const minutes = Math.floor((secondsAsNumber % 3600) / 60);
|
|
98
98
|
const seconds = Math.floor((secondsAsNumber % 3600) % 60);
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
seconds;
|
|
99
|
+
|
|
100
|
+
let formattedHours = parseFloat(hours) > 0 ? hours.padStart(2, "0") : "00";
|
|
101
|
+
let formattedMinutes = minutes === 0 ? "00" : minutes < 10 ? "0" + minutes : minutes.toString();
|
|
102
|
+
let formattedSeconds = seconds === 0 ? "00" : seconds < 10 ? "0" + seconds : seconds.toString()
|
|
103
|
+
|
|
104
|
+
let result = `${formattedHours}:${formattedMinutes}:${formattedSeconds}`;
|
|
105
|
+
|
|
107
106
|
if (valueNegative) {
|
|
108
107
|
result = `- ${result}`;
|
|
109
108
|
}
|