robbyson-frontend-library 1.0.57 → 1.0.59

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.
Files changed (44) hide show
  1. package/dist/components/line-chart /line-chart.interface.js +1 -0
  2. package/dist/components/pie-chart /pie-chart.interface.js +1 -0
  3. package/dist/components/simple-table/simple-table.interface.js +1 -0
  4. package/dist/components/staked-chart/staked-chart.interface.js +1 -0
  5. package/dist/components/tab-result/tab-result.interface.js +1 -0
  6. package/dist/components/vertical-bar-chart/vertical-bar-chart.interface.js +1 -0
  7. package/dist/utils/index.js +1 -0
  8. package/dist/utils/string.utils.js +13 -0
  9. package/index.d.ts +7 -0
  10. package/package.json +3 -2
  11. package/src/components/basic-button/basic-button.interface.ts +1 -0
  12. package/src/components/checkbox/checkbox.interface.ts +1 -0
  13. package/src/components/date-picker/date-picker.interface.ts +1 -0
  14. package/src/components/line-chart /index.d.ts +1 -0
  15. package/src/components/line-chart /line-chart.interface.ts +16 -0
  16. package/src/components/line-chart /line-chart.types.d.ts +9 -0
  17. package/src/components/pie-chart /index.d.ts +1 -0
  18. package/src/components/pie-chart /pie-chart.interface.ts +15 -0
  19. package/src/components/pie-chart /pie-chart.types.d.ts +9 -0
  20. package/src/components/primary-tag/primary-tag.interface.ts +2 -0
  21. package/src/components/result-chart/result-chart.interface.ts +2 -0
  22. package/src/components/simple-table/index.d.ts +1 -0
  23. package/src/components/simple-table/simple-table.interface.ts +6 -0
  24. package/src/components/simple-table/simple-table.types.d.ts +9 -0
  25. package/src/components/sort/sort.interface.ts +6 -4
  26. package/src/components/staked-chart/index.d.ts +1 -0
  27. package/src/components/staked-chart/staked-chart.interface.ts +19 -0
  28. package/src/components/staked-chart/staked-chart.types.d.ts +9 -0
  29. package/src/components/tab/tab.interface.ts +8 -6
  30. package/src/components/tab-result/index.d.ts +1 -0
  31. package/src/components/tab-result/tab-result.interface.ts +25 -0
  32. package/src/components/tab-result/tab-result.types.d.ts +9 -0
  33. package/src/components/table/table.interface.ts +1 -0
  34. package/src/components/tag-expand/tag-expand.interface.ts +1 -0
  35. package/src/components/text-field/text-field.interface.ts +1 -0
  36. package/src/components/time-picker/time-picker.interface.ts +1 -0
  37. package/src/components/toggle-icon-button/toggle-icon-button.interface.ts +1 -0
  38. package/src/components/vertical-bar-chart/index.d.ts +1 -0
  39. package/src/components/vertical-bar-chart/vertical-bar-chart.interface.ts +19 -0
  40. package/src/components/vertical-bar-chart/vertical-bar-chart.types.d.ts +9 -0
  41. package/src/models/notification.model.ts +32 -1
  42. package/src/models/order.model.ts +3 -3
  43. package/src/utils/index.ts +1 -0
  44. package/src/utils/string.utils.ts +11 -0
@@ -0,0 +1 @@
1
+ export {};
@@ -9,3 +9,4 @@ export * from "./layout.utils";
9
9
  export * from "./date.utils";
10
10
  export * from "./resize-image";
11
11
  export * from "./timer.utils";
12
+ export * from "./string.utils";
@@ -0,0 +1,13 @@
1
+ import { ToWords } from "to-words";
2
+ var StringUtils = /** @class */ (function () {
3
+ function StringUtils() {
4
+ }
5
+ StringUtils.numberToWords = function (num) {
6
+ return this._toWords.convert(num);
7
+ };
8
+ StringUtils._toWords = new ToWords({
9
+ localeCode: "pt-BR",
10
+ });
11
+ return StringUtils;
12
+ }());
13
+ export { StringUtils };
package/index.d.ts CHANGED
@@ -85,3 +85,10 @@ export * from "./src/components/full-balance-page";
85
85
  export * from "./src/components/guard-module";
86
86
  export * from "./src/components/guard-permission";
87
87
  export * from "./src/components/favorite-button";
88
+ export * from "./src/components/vertical-bar-chart";
89
+ export * from "./src/components/simple-table";
90
+ export * from "./src/components/staked-chart";
91
+ export * from "./src/components/line-chart";
92
+ export * from "./src/components/pie-chart";
93
+ export * from "./src/components/radar-chart";
94
+ export * from "./src/components/tab-result";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "robbyson-frontend-library",
3
- "version": "1.0.57",
3
+ "version": "1.0.59",
4
4
  "description": "Robbyson frontend Library",
5
5
  "main": "./dist/index.js",
6
6
  "license": "MIT",
@@ -46,6 +46,7 @@
46
46
  "redux-micro-frontend": "^1.3.0",
47
47
  "redux-persist": "^6.0.0",
48
48
  "robbyson-library-v2": "^0.3.2",
49
- "socket.io-client": "^4.7.4"
49
+ "socket.io-client": "^4.7.4",
50
+ "to-words": "^4.1.0"
50
51
  }
51
52
  }
@@ -13,4 +13,5 @@ export interface IBasicButtonProps<T>
13
13
  shape?: "round" | "square";
14
14
  isModalButton?: boolean;
15
15
  ariaLabel?: string;
16
+ forwardRef?(ref: HTMLButtonElement | null): void;
16
17
  }
@@ -8,4 +8,5 @@ export interface ICheckboxProps<T> extends React.InputHTMLAttributes<T>, IBaseCo
8
8
  hasError?: boolean;
9
9
  id: string;
10
10
  preventPropagation?: boolean
11
+ ariaLabel?: string;
11
12
  }
@@ -9,6 +9,7 @@ export interface IDatePickerProps extends IBaseComponentProp {
9
9
  };
10
10
  minDate?: Date | null;
11
11
  maxDate?: Date;
12
+ ariaLabel?: string;
12
13
  }
13
14
 
14
15
  export interface IDatePickerState {
@@ -0,0 +1 @@
1
+ export * from './line-chart.interface';
@@ -0,0 +1,16 @@
1
+ import { IBaseComponentProp } from "../base-component.prop.interface";
2
+
3
+ export interface ILineChartProps<T> extends IBaseComponentProp {
4
+ data: {
5
+ labels: string[];
6
+ datasets: T[];
7
+ };
8
+ datasets: {
9
+ label: string;
10
+ backgroundColor: string;
11
+ borderColor: string;
12
+ borderWidth: number;
13
+ data: number[];
14
+ }[];
15
+
16
+ }
@@ -0,0 +1,9 @@
1
+ ///<reference types="react" />
2
+ ///<reference types="robbyson-frontend-library" />
3
+
4
+ declare module "styleguide/LineChart" {
5
+ import { ILineChartProps } from "robbyson-frontend-library";
6
+ const LineChart: React.ComponentType<ILineChartProps>;
7
+
8
+ export default LineChart;
9
+ }
@@ -0,0 +1 @@
1
+ export * from './pie-chart.interface';
@@ -0,0 +1,15 @@
1
+ import { IBaseComponentProp } from "../base-component.prop.interface";
2
+
3
+ export interface IPieChartProps<T> extends IBaseComponentProp {
4
+ data: {
5
+ labels: string[];
6
+ datasets: T[];
7
+ };
8
+ datasets: {
9
+ label: string;
10
+ backgroundColor: string;
11
+ borderColor: string;
12
+ borderWidth: number;
13
+ data: number[];
14
+ }[];
15
+ }
@@ -0,0 +1,9 @@
1
+ ///<reference types="react" />
2
+ ///<reference types="robbyson-frontend-library" />
3
+
4
+ declare module "styleguide/PieChart" {
5
+ import { IPieChartProps } from "robbyson-frontend-library";
6
+ const PieChart: React.ComponentType<IPieChartProps>;
7
+
8
+ export default PieChart;
9
+ }
@@ -3,6 +3,7 @@ import { IBaseComponentProp } from "../base-component.prop.interface";
3
3
 
4
4
  export interface IPrimaryTagState {
5
5
  show: boolean;
6
+ removeTagbuttonLabel?: string;
6
7
  }
7
8
  export interface IPrimaryTagProps<T>
8
9
  extends IBaseComponentProp,
@@ -18,4 +19,5 @@ export interface IPrimaryTagProps<T>
18
19
  iconColor?: string;
19
20
  customIcon?: React.ReactNode;
20
21
  textClassName?: string;
22
+ tagRemoveButtonLabel?: string;
21
23
  }
@@ -20,10 +20,12 @@ export interface IResultChartProps extends IBaseComponentProp {
20
20
  isInitialPosition?: boolean;
21
21
  tabIndex?: number;
22
22
  node_id?: string;
23
+ dailyAriaLabel?: string;
23
24
  }
24
25
 
25
26
  export interface IResultChartState {
26
27
  active: boolean;
28
+ isLoadingDays?: boolean;
27
29
  }
28
30
 
29
31
  type ChartDataResults = {
@@ -0,0 +1 @@
1
+ export * from "./simple-table.interface";
@@ -0,0 +1,6 @@
1
+ import React from "react";
2
+ import { IBaseComponentProp } from "../base-component.prop.interface";
3
+
4
+ export interface ISimpleTableProps<T> extends IBaseComponentProp {
5
+ message?: T;
6
+ }
@@ -0,0 +1,9 @@
1
+ ///<reference types="react" />
2
+ ///<reference types="robbyson-frontend-library" />
3
+
4
+ declare module 'styleguide/SimpleTable' {
5
+ import { ISimpleTableProps } from "robbyson-frontend-library";
6
+ const SimpleTable: React.ComponentType<ISimpleTableProps>;
7
+
8
+ export default SimpleTable;
9
+ }
@@ -3,10 +3,7 @@ import { IBaseComponentProp } from "../base-component.prop.interface";
3
3
 
4
4
  export interface ISortProps extends IBaseComponentProp {
5
5
  titleLocaleHandle?: string;
6
- options: Array<{
7
- nameLocaleHandle: string;
8
- value: string | number;
9
- }>;
6
+ options: ISortOptions[];
10
7
  defaultOption?: string | number;
11
8
  selectedKeys?: string[];
12
9
  icon: IconHandle;
@@ -26,3 +23,8 @@ export interface ISortState {
26
23
  showSort: boolean;
27
24
  sortValue?: string | number;
28
25
  }
26
+
27
+ export interface ISortOptions {
28
+ nameLocaleHandle: string;
29
+ value: string | number;
30
+ }
@@ -0,0 +1 @@
1
+ export * from './staked-chart.interface';
@@ -0,0 +1,19 @@
1
+ import { IBaseComponentProp } from "../base-component.prop.interface";
2
+
3
+ export interface StakedChartProps<T> extends IBaseComponentProp {
4
+ data: {
5
+ labels: string[];
6
+ datasets: T[];
7
+ };
8
+ datasets: {
9
+ label: string;
10
+ backgroundColor: string;
11
+ borderColor: string;
12
+ borderWidth: number;
13
+ data: number[];
14
+ }[];
15
+ }
16
+
17
+
18
+ export interface StakedChartState {
19
+ }
@@ -0,0 +1,9 @@
1
+ ///<reference types="react" />
2
+ ///<reference types="robbyson-frontend-library" />
3
+
4
+ declare module "styleguide/StakedChart" {
5
+ import { IStakedChartProps } from "robbyson-frontend-library";
6
+ const StakedChart: React.ComponentType<IStakedChartProps>;
7
+
8
+ export default StakedChart;
9
+ }
@@ -6,15 +6,16 @@ export interface ITabProps<T> extends IBaseComponentProp {
6
6
  tabOptions: TabOptions<T>[];
7
7
  className?: string;
8
8
  activeTab: T;
9
- hideTabs?:boolean;
10
- onShowFilter?(filter:any):void;
11
- attributes?:AttributeValueModel[];
12
- selectedFilter?:[],
9
+ hideTabs?: boolean;
10
+ onShowFilter?(filter: any): void;
11
+ attributes?: AttributeValueModel[];
12
+ selectedFilter?: [];
13
13
  showFilter?: boolean;
14
+ getTabRef?: (ref: any) => void;
14
15
  }
15
16
 
16
17
  interface TabOptions<T> {
17
- hasArrow?: boolean
18
+ hasArrow?: boolean;
18
19
  tabKey: T;
19
20
  className?: string;
20
21
  tabLocaleHandle: string;
@@ -22,4 +23,5 @@ interface TabOptions<T> {
22
23
  prefix?: JSX.Element;
23
24
  content?: React.ReactNode;
24
25
  disabled?: boolean;
25
- }
26
+ ariaLabel?: string;
27
+ }
@@ -0,0 +1 @@
1
+ export * from './tab-result.interface';
@@ -0,0 +1,25 @@
1
+ import { AttributeValueModel } from "../../models";
2
+ import { IBaseComponentProp } from "../base-component.prop.interface";
3
+
4
+ export interface ITabResultProps<T> extends IBaseComponentProp {
5
+ onClickTab(tabKey: T): void;
6
+ tabOptions: TabResultOptions<T>[];
7
+ className?: string;
8
+ activeTab: T;
9
+ hideTabs?:boolean;
10
+ onShowFilter?(filter:any):void;
11
+ attributes?:AttributeValueModel[];
12
+ selectedFilter?:[],
13
+ showFilter?: boolean;
14
+ }
15
+
16
+ interface TabResultOptions<T> {
17
+ hasArrow?: boolean
18
+ tabKey: T;
19
+ className?: string;
20
+ tabLocaleHandle: string;
21
+ suffix?: JSX.Element;
22
+ prefix?: JSX.Element;
23
+ content?: React.ReactNode;
24
+ disabled?: boolean;
25
+ }
@@ -0,0 +1,9 @@
1
+ ///<reference types="react" />
2
+ ///<reference types="robbyson-frontend-library" />
3
+
4
+ declare module 'styleguide/TabResultComponent' {
5
+ import { ITabResultProps } from "robbyson-frontend-library";
6
+ const TabResultComponent: React.ComponentType<ITabResultProps<any>>;
7
+
8
+ export default TabResultComponent;
9
+ }
@@ -6,6 +6,7 @@ interface Title {
6
6
  titleLocaleHandle: string | React.ReactNode;
7
7
  color: string;
8
8
  numberOfColumn: number;
9
+ tabIndex?: number;
9
10
  }
10
11
 
11
12
  interface Header {
@@ -7,4 +7,5 @@ export interface ITagExpandProps<T> extends IBaseComponentProp {
7
7
  text?: string;
8
8
  textLocaleHandle?: string;
9
9
  bg?: string
10
+ ariaLabel?: string
10
11
  }
@@ -28,4 +28,5 @@ export interface ITextFieldProps
28
28
  outSuffixContextMenuProps?: IContextMenuProps;
29
29
  isPlaceholderItalic?: boolean;
30
30
  avoidMovePlaceHolderUp?: boolean;
31
+ maskPlaceholder?: string;
31
32
  }
@@ -8,6 +8,7 @@ export interface ITimePickerProps extends IBaseComponentProp {
8
8
  onClickTime(hour: string, minutes: string): void;
9
9
  timerPickerValue: string;
10
10
  inputProps?: Omit<ITextFieldProps, "value" | "dataTestId">;
11
+ ariaLabel?: string;
11
12
  }
12
13
 
13
14
  export interface ITimePickerState {
@@ -13,4 +13,5 @@ export interface IToggleIconButtonProps<T>
13
13
  disabledIconHandle?: IconHandle;
14
14
  fatherControl?: boolean;
15
15
  ariaLabel?: string;
16
+ forwardRef?: (ref: HTMLButtonElement | null) => void;
16
17
  }
@@ -0,0 +1 @@
1
+ export * from './vertical-bar-chart.interface';
@@ -0,0 +1,19 @@
1
+ import { IBaseComponentProp } from "../base-component.prop.interface";
2
+
3
+ export interface VerticalBarChartProps<T> extends IBaseComponentProp {
4
+ data: {
5
+ labels: string[];
6
+ datasets: T[];
7
+ };
8
+ datasets: {
9
+ label: string;
10
+ backgroundColor: string;
11
+ borderColor: string;
12
+ borderWidth: number;
13
+ data: number[];
14
+ }[];
15
+ }
16
+
17
+
18
+ export interface VerticalBarChartState {
19
+ }
@@ -0,0 +1,9 @@
1
+ ///<reference types="react" />
2
+ ///<reference types="robbyson-frontend-library" />
3
+
4
+ declare module "styleguide/VerticalBarChart" {
5
+ import { IVerticalBarChartProps } from "robbyson-frontend-library";
6
+ const VerticalBarChart: React.ComponentType<IVerticalBarChartProps>;
7
+
8
+ export default VerticalBarChart;
9
+ }
@@ -42,9 +42,40 @@ export class NotificationModel extends BaseRepositoryModel {
42
42
  tags: [{ _id: false; text: string }];
43
43
  context: [{ _id: false; flag: string; url: string }];
44
44
  targetSystems: [number];
45
- payloadTemplate: {};
45
+ payloadTemplate: Template[];
46
46
  previewContent?: Blob | MediaSource;
47
47
  imageContent?: Blob | MediaSource;
48
48
  pdfUrl?: string;
49
49
  videoContent?: Blob | MediaSource;
50
50
  }
51
+ export type Template = {
52
+ type: 'text' | 'button' | 'table' | 'image' | 'video' | 'user' | 'list' | 'link' | 'chart' | 'open_chat' | '';
53
+ createdAt: string;
54
+ title: string;
55
+ footer: string;
56
+ voiceDescription: string;
57
+ payload: {
58
+ header: [{
59
+ value: string;
60
+ requestPayload: any;
61
+ color?: string;
62
+ style?: string;
63
+ tag?: string;
64
+ tooltip?: string;
65
+ }];
66
+ content: [{
67
+ subtype?: any;
68
+ value: any;
69
+ requestPayload: any;
70
+ color?: {
71
+ background: string;
72
+ text: string;
73
+ };
74
+ style?: string;
75
+ tag?: string;
76
+ tooltip?: string;
77
+ child?: any[];
78
+ // customization?: Partial<TemplateCustomization>;
79
+ }]
80
+ },
81
+ }
@@ -1,5 +1,5 @@
1
1
  import { BaseRepositoryModel } from "./base.repository.model";
2
- import { MarketProductModel } from './market-product.model';
2
+ import { MarketProductModel } from "./market-product.model";
3
3
 
4
4
  export class OrderStatusModel extends BaseRepositoryModel {
5
5
  status: {
@@ -38,7 +38,7 @@ export class OrderModel extends BaseRepositoryModel {
38
38
  currency: "coins" | "points";
39
39
  };
40
40
  _id: string;
41
- date: string;
41
+ date: string | Date;
42
42
  lastUpdate: string;
43
43
  product: {
44
44
  _id: string;
@@ -73,5 +73,5 @@ export class OrderModel extends BaseRepositoryModel {
73
73
  name: string;
74
74
  identification: string;
75
75
  }[];
76
- productDetails: MarketProductModel
76
+ productDetails: MarketProductModel;
77
77
  }
@@ -9,3 +9,4 @@ export * from "./layout.utils";
9
9
  export * from "./date.utils";
10
10
  export * from "./resize-image";
11
11
  export * from "./timer.utils";
12
+ export * from "./string.utils";
@@ -0,0 +1,11 @@
1
+ import { ToWords } from "to-words";
2
+
3
+ export class StringUtils {
4
+ private static _toWords = new ToWords({
5
+ localeCode: "pt-BR",
6
+ });
7
+
8
+ public static numberToWords(num: number): string {
9
+ return this._toWords.convert(num);
10
+ }
11
+ }