robbyson-frontend-library 1.0.55 → 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/header-context-menu/header-context-menu.interface.ts +3 -1
- 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/tab/tab.interface.ts +2 -1
- package/src/components/tree-date-picker/tree-date-picker.interface.ts +3 -3
- package/src/services/tree.service.interface.ts +2 -0
- package/src/types/tree/tree.types.ts +1 -0
|
@@ -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
|
@@ -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 && (
|
|
@@ -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
|
};
|
|
@@ -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[]>;
|