@antscorp/antsomi-ui 1.3.5-beta.745 → 1.3.5-beta.747

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.
@@ -1,6 +1,6 @@
1
1
  var _a;
2
2
  // Preload all images in the 96x96 directory
3
- const images = import.meta.glob('@antscorp/antsomi-ui/es/assets/images/viber/96x96/*.png', {
3
+ const images = import.meta.glob('../../../assets/images/viber/96x96/*.png', {
4
4
  eager: true,
5
5
  });
6
6
  // Map the imported images to a usable format
@@ -12,9 +12,11 @@ export const formatAttributeDisplay = ({ attribute, value, }) => {
12
12
  dataType,
13
13
  });
14
14
  let dataValue = value;
15
+ console.log({ attribute, value });
15
16
  switch (true) {
16
17
  case dataType === 'datetime':
17
18
  dataValue = formatAttributeUTCDate(value, displayFormat);
19
+ console.log('🚀 ~ dataValue:', dataValue);
18
20
  break;
19
21
  default:
20
22
  break;
@@ -63,7 +63,7 @@ export declare function getUserInfoPortal(data: Record<string, any>): {
63
63
  defaultConfig: any;
64
64
  };
65
65
  export declare const UserAndPortalDefaultConfig: {
66
- set: (portal?: Record<string, any>, user?: Record<string, any>) => Record<string, any>;
66
+ set: (portal?: Record<string, any>, user?: Record<string, any>) => any;
67
67
  setPartial: (data: Record<string, any>) => void;
68
68
  getByKey: (key: string) => any;
69
69
  };
@@ -1,4 +1,5 @@
1
1
  import { convertNumberByDisplayFormat, safeParse } from './common';
2
+ const APP_CACHE_PARAMS = {};
2
3
  export const PORTAL_KEYS = {
3
4
  CURRENCY: 'p_currency',
4
5
  USER_LANGUAGE: 'user_language',
@@ -91,13 +92,15 @@ export function getUserInfoPortal(data) {
91
92
  return Object.assign(Object.assign({}, data), { defaultConfig });
92
93
  }
93
94
  export const UserAndPortalDefaultConfig = (() => {
94
- const APP_CACHE_PARAMS = {};
95
+ function setValue(name, value) {
96
+ if (!window.APP_CACHE_PARAMS) {
97
+ window.APP_CACHE_PARAMS = {};
98
+ }
99
+ window.APP_CACHE_PARAMS[name] = value;
100
+ }
95
101
  return {
96
102
  set: (portal = {}, user = {}) => {
97
103
  const portalConfig = getUserInfoPortal(portal).defaultConfig;
98
- function setValue(name, value) {
99
- APP_CACHE_PARAMS[name] = value;
100
- }
101
104
  // info user and portal
102
105
  setValue('user_email', user.email);
103
106
  setValue('p_name', portal.portalName);
@@ -109,14 +112,14 @@ export const UserAndPortalDefaultConfig = (() => {
109
112
  setValue(PORTAL_KEYS.PORTAL_LANGUAGE, getLanguageLocale(portalConfig.language));
110
113
  setValue(PORTAL_KEYS.TIME_ZONE, portalConfig.timeZone);
111
114
  setValue(PORTAL_KEYS.DATE_TIME_FORMAT_LONG, convertDateTimeToFormatLong(portalConfig.dateAndTimeFormat));
112
- return APP_CACHE_PARAMS;
115
+ return window.APP_CACHE_PARAMS;
113
116
  },
114
117
  setPartial: (data) => {
115
118
  Object.keys(data || {}).forEach(key => {
116
- APP_CACHE_PARAMS[key] = data[key];
119
+ setValue(key, data[key]);
117
120
  });
118
121
  },
119
- getByKey: (key) => APP_CACHE_PARAMS[key],
122
+ getByKey: (key) => { var _a; return (_a = window === null || window === void 0 ? void 0 : window.APP_CACHE_PARAMS) === null || _a === void 0 ? void 0 : _a[key]; },
120
123
  };
121
124
  })();
122
125
  export function getPortalFormatDateTimeLong() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@antscorp/antsomi-ui",
3
- "version": "1.3.5-beta.745",
3
+ "version": "1.3.5-beta.747",
4
4
  "description": "An enterprise-class UI design language and React UI library.",
5
5
  "sideEffects": [
6
6
  "dist/*",