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.
@@ -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(LeftArrowLarge, { src: this._themeService.getIconAssetUrl("left-arrow-large"), onClick: function () { return _this.redirect(); }, isOperacaoPage: isOperacaoPage }),
84
- React.createElement(Title, null, this.translate(this.headerLocale))),
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 templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8, templateObject_9, templateObject_10;
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) != null ? {
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: (_a = props === null || props === void 0 ? void 0 : props.data.m) === null || _a === void 0 ? void 0 : _a.maxCoins,
71
- qtdEarning: (_b = props === null || props === void 0 ? void 0 : props.data.m) === null || _b === void 0 ? void 0 : _b.qtdGanho,
72
- coinsGestor: (_c = props === null || props === void 0 ? void 0 : props.data.m) === null || _c === void 0 ? void 0 : _c.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 (((_d = props === null || props === void 0 ? void 0 : props.data) === null || _d === void 0 ? void 0 : _d.cd) !== undefined)
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) {
@@ -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 result = (parseFloat(hours) > 0
72
- ? hours + ":" + (minutes < 10 ? "0" : "")
73
- : "00:") +
74
- minutes +
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,6 +1,6 @@
1
1
  {
2
2
  "name": "robbyson-frontend-library",
3
- "version": "1.0.55",
3
+ "version": "1.0.56",
4
4
  "description": "Robbyson frontend Library",
5
5
  "main": "./dist/index.js",
6
6
  "license": "MIT",
@@ -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
@@ -7,4 +7,5 @@ export interface IMountainChartProps extends IBaseComponentProp {
7
7
  color: string;
8
8
  height: number;
9
9
  shouldShowMeta?: boolean;
10
+ tabIndex?: number;
10
11
  }
@@ -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
- <LeftArrowLarge
84
- src={this._themeService.getIconAssetUrl(
85
- "left-arrow-large"
86
- )}
84
+ <GenericButton
87
85
  onClick={() => this.redirect()}
88
- isOperacaoPage={isOperacaoPage}
89
- />
90
- <Title>{this.translate(this.headerLocale)}</Title>
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 && (
@@ -162,3 +162,8 @@ export const LeftArrowLarge = styled(SVG)<LeftArrowLargeProps>`
162
162
  display: block;
163
163
  }
164
164
  `;
165
+
166
+ export const GenericButton = styled.button`
167
+ background: none;
168
+ border: none;
169
+ `;
@@ -2,4 +2,5 @@ import { IBaseComponentProp } from "../base-component.prop.interface";
2
2
 
3
3
  export interface IRadioButtonProps<T> extends React.InputHTMLAttributes<T>, IBaseComponentProp {
4
4
  labelLocaleHandle?: string;
5
+ alternativeType?: 'checkbox';
5
6
  }
@@ -9,7 +9,8 @@ export interface ITabProps<T> extends IBaseComponentProp {
9
9
  hideTabs?:boolean;
10
10
  onShowFilter?(filter:any):void;
11
11
  attributes?:AttributeValueModel[];
12
- selectedFilter?:[]
12
+ selectedFilter?:[],
13
+ showFilter?: boolean;
13
14
  }
14
15
 
15
16
  interface TabOptions<T> {
@@ -35,11 +35,11 @@ export type Week = {
35
35
 
36
36
  export type Weeks = Week[];
37
37
 
38
- export type TabKey = "day" | "week" | "monthly" | "range";
38
+ export type TabKey = "daily" | "weekly" | "monthly" | "range";
39
39
 
40
40
  export type DateTypeMap = {
41
- day: Date | null;
42
- week?: Date | null;
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[]>;
@@ -49,6 +49,7 @@ export enum TypeReferenceLetterEnum {
49
49
  M = "monthly",
50
50
  D = "daily",
51
51
  W = "weekly",
52
+ S = "weekly",
52
53
  }
53
54
 
54
55
  export enum TreeActionTypes {