robbyson-frontend-library 1.0.63 → 1.0.64

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.
@@ -217,6 +217,7 @@ export var ICON_HANDLES = [
217
217
  "cloud-circle",
218
218
  "mountain-circle",
219
219
  "star-circle",
220
+ "eagle-circle",
220
221
  "ead-status",
221
222
  "expand-image-bold",
222
223
  "camera-off-bold",
@@ -1,5 +1,6 @@
1
1
  import _ from "lodash";
2
2
  import moment from "moment";
3
+ import { GlobalStore } from "redux-micro-frontend";
3
4
  var DateUtils = /** @class */ (function () {
4
5
  function DateUtils() {
5
6
  }
@@ -26,11 +27,21 @@ var DateUtils = /** @class */ (function () {
26
27
  return dates;
27
28
  };
28
29
  DateUtils.formatDate = function (dateString) {
29
- return new Date(dateString).toLocaleDateString(navigator.language, {
30
- day: "2-digit",
31
- month: "long",
32
- timeZone: "UTC",
33
- });
30
+ var _a, _b, _c, _d, _e;
31
+ if (!dateString)
32
+ return "";
33
+ try {
34
+ var globalState = GlobalStore.Get().GetGlobalState();
35
+ var locale = ((_e = (_d = (_c = (_b = (_a = globalState === null || globalState === void 0 ? void 0 : globalState.Global) === null || _a === void 0 ? void 0 : _a.RootApp) === null || _b === void 0 ? void 0 : _b.userSession) === null || _c === void 0 ? void 0 : _c.contractor) === null || _d === void 0 ? void 0 : _d.locale) === null || _e === void 0 ? void 0 : _e.identifier) || "pt-BR";
36
+ return new Date(dateString).toLocaleDateString(locale, {
37
+ day: "2-digit",
38
+ month: "long",
39
+ timeZone: "UTC",
40
+ });
41
+ }
42
+ catch (_f) {
43
+ return "";
44
+ }
34
45
  };
35
46
  DateUtils.toLocaleDateString = function (dateString, locale) {
36
47
  try {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "robbyson-frontend-library",
3
- "version": "1.0.63",
3
+ "version": "1.0.64",
4
4
  "description": "Robbyson frontend Library",
5
5
  "main": "./dist/index.js",
6
6
  "license": "MIT",
@@ -10,6 +10,8 @@ export interface IContextMenuProps
10
10
  children: React.ReactNode;
11
11
  position?: "center" | "left" | "right";
12
12
  width?: string | number;
13
+ minWidth?: string | number;
14
+ height?:string | number;
13
15
  offset?: number;
14
16
  ariaLabel?: string;
15
17
  isLeft?: boolean;
@@ -57,6 +57,8 @@ export interface ITableState<T> {
57
57
  }
58
58
 
59
59
  export interface ITableProps<T> extends IBaseComponentProp {
60
+ itemsPerPage?: number;
61
+ paginate?: boolean;
60
62
  tableStructure: {
61
63
  titles: Title[];
62
64
  headers: Header[];
@@ -303,6 +303,7 @@ export const ICON_HANDLES = [
303
303
  "cloud-circle",
304
304
  "mountain-circle",
305
305
  "star-circle",
306
+ "eagle-circle",
306
307
  "ead-status",
307
308
  "expand-image-bold",
308
309
  "camera-off-bold",
@@ -1,5 +1,7 @@
1
1
  import _ from "lodash";
2
2
  import moment from "moment";
3
+ import { GlobalStore } from "redux-micro-frontend";
4
+ import { IPlatformState } from "../states";
3
5
 
4
6
  type RemainingTime = {
5
7
  timeRemainingText: string;
@@ -39,11 +41,23 @@ export class DateUtils {
39
41
  }
40
42
 
41
43
  static formatDate(dateString: string): string {
42
- return new Date(dateString).toLocaleDateString(navigator.language, {
43
- day: "2-digit",
44
- month: "long",
45
- timeZone: "UTC",
46
- });
44
+ if (!dateString) return "";
45
+
46
+ try {
47
+ const globalState: IPlatformState =
48
+ GlobalStore.Get().GetGlobalState();
49
+ const locale =
50
+ globalState?.Global?.RootApp?.userSession?.contractor?.locale
51
+ ?.identifier || "pt-BR";
52
+
53
+ return new Date(dateString).toLocaleDateString(locale, {
54
+ day: "2-digit",
55
+ month: "long",
56
+ timeZone: "UTC",
57
+ });
58
+ } catch {
59
+ return "";
60
+ }
47
61
  }
48
62
 
49
63
  static toLocaleDateString(