@antscorp/antsomi-ui 1.3.5-beta.742 → 1.3.5-beta.743

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.
@@ -19,7 +19,6 @@ import { createFilterStore } from '../store/FilterStore';
19
19
  import { useDeepCompareEffect } from '@antscorp/antsomi-ui/es/hooks';
20
20
  export const FilterProvider = props => {
21
21
  const { children } = props, restOfProps = __rest(props, ["children"]);
22
- console.log('🚀 ~ restOfProps:', restOfProps);
23
22
  const storeRef = useRef();
24
23
  if (!storeRef.current) {
25
24
  storeRef.current = createFilterStore(restOfProps);
@@ -1,3 +1,68 @@
1
+ export declare const PORTAL_MAP_DATE: {
2
+ en: {
3
+ 'MM/DD/YYYY': {
4
+ long: string;
5
+ medium: string;
6
+ short: string;
7
+ };
8
+ 'MM/YYYY': {
9
+ long: string;
10
+ medium: string;
11
+ short: string;
12
+ };
13
+ 'DD/MM/YYYY': {
14
+ long: string;
15
+ medium: string;
16
+ short: string;
17
+ };
18
+ };
19
+ vi: {
20
+ 'MM/DD/YYYY': {
21
+ long: string;
22
+ medium: string;
23
+ short: string;
24
+ };
25
+ 'MM/YYYY': {
26
+ long: string;
27
+ medium: string;
28
+ short: string;
29
+ };
30
+ 'DD/MM/YYYY': {
31
+ long: string;
32
+ medium: string;
33
+ short: string;
34
+ };
35
+ };
36
+ ja: {
37
+ 'MM/DD/YYYY': {
38
+ long: string;
39
+ medium: string;
40
+ short: string;
41
+ };
42
+ 'MM/YYYY': {
43
+ long: string;
44
+ medium: string;
45
+ short: string;
46
+ };
47
+ 'DD/MM/YYYY': {
48
+ long: string;
49
+ medium: string;
50
+ short: string;
51
+ };
52
+ };
53
+ };
54
+ export declare const PORTAL_MAP_TIME: {
55
+ '12': {
56
+ long: string;
57
+ medium: string;
58
+ short: string;
59
+ };
60
+ '24': {
61
+ long: string;
62
+ medium: string;
63
+ short: string;
64
+ };
65
+ };
1
66
  export declare const TIME_ZONES: {
2
67
  label: string;
3
68
  value: string;
@@ -1,3 +1,68 @@
1
+ export const PORTAL_MAP_DATE = {
2
+ en: {
3
+ 'MM/DD/YYYY': {
4
+ long: 'MMMM DD, YYYY',
5
+ medium: 'MMM DD, YYYY',
6
+ short: 'MM/DD/YYYY',
7
+ },
8
+ 'MM/YYYY': {
9
+ long: 'MMMM YYYY',
10
+ medium: 'MMM YYYY',
11
+ short: 'MMM YYYY',
12
+ },
13
+ 'DD/MM/YYYY': {
14
+ long: 'DD MMMM, YYYY',
15
+ medium: 'DD MMM YYYY',
16
+ short: 'DD/MM/YYYY',
17
+ },
18
+ },
19
+ vi: {
20
+ 'MM/DD/YYYY': {
21
+ long: '[Ngày] DD [tháng] MM, YYYY',
22
+ medium: '[Ngày] DD [thg] MM, YYYY',
23
+ short: 'DD/MM/YYYY',
24
+ },
25
+ 'MM/YYYY': {
26
+ long: '[Tháng] MM YYYY',
27
+ medium: '[Thg] MM YYYY',
28
+ short: '[Thg] MM YYYY',
29
+ },
30
+ 'DD/MM/YYYY': {
31
+ long: '[Ngày] DD [tháng] MM, YYYY',
32
+ medium: '[Ngày] DD [thg] MM, YYYY',
33
+ short: 'DD/MM/YYYY',
34
+ },
35
+ },
36
+ ja: {
37
+ 'MM/DD/YYYY': {
38
+ long: 'YYYY[年]MM[月]dd[日]',
39
+ medium: 'YYYY/MM/DD',
40
+ short: 'YYYY/MM/DD',
41
+ },
42
+ 'MM/YYYY': {
43
+ long: 'YYYY[年]MM[月]',
44
+ medium: 'YYYY[年]MM[月]',
45
+ short: 'YYYY[年]MM[月]',
46
+ },
47
+ 'DD/MM/YYYY': {
48
+ long: 'YYYY[年]MM[月]dd[日]',
49
+ medium: 'YYYY/MM/dd',
50
+ short: 'YYYY/MM/dd',
51
+ },
52
+ },
53
+ };
54
+ export const PORTAL_MAP_TIME = {
55
+ '12': {
56
+ long: 'hh:mm:ss.SSS a O',
57
+ medium: 'hh:mm:ss.SSS a',
58
+ short: 'hh:mm a',
59
+ },
60
+ '24': {
61
+ long: 'HH:mm:ss.SSS O',
62
+ medium: 'HH:mm:ss.SSS',
63
+ short: 'HH:mm',
64
+ },
65
+ };
1
66
  export const TIME_ZONES = [
2
67
  {
3
68
  label: "Visitor's Local Time",
@@ -11,3 +11,4 @@ export * from './queries';
11
11
  export * from './theme';
12
12
  export * from './postMessage';
13
13
  export * from './condition';
14
+ export * from './portal';
@@ -11,3 +11,4 @@ export * from './queries';
11
11
  export * from './theme';
12
12
  export * from './postMessage';
13
13
  export * from './condition';
14
+ export * from './portal';
@@ -0,0 +1,12 @@
1
+ export declare const PORTAL_KEYS: {
2
+ CURRENCY: string;
3
+ USER_LANGUAGE: string;
4
+ PORTAL_LANGUAGE: string;
5
+ TIME_ZONE: string;
6
+ CURRENCY_FORMAT: string;
7
+ DATE_TIME_FORMAT: string;
8
+ DATE_TIME_FORMAT_LONG: string;
9
+ NUMBER_FORMAT: string;
10
+ PERCENTAGE_FORMAT: string;
11
+ VERSION: string;
12
+ };
@@ -0,0 +1,12 @@
1
+ export const PORTAL_KEYS = {
2
+ CURRENCY: 'p_currency',
3
+ USER_LANGUAGE: 'user_language',
4
+ PORTAL_LANGUAGE: 'p_language',
5
+ TIME_ZONE: 'p_timezone',
6
+ CURRENCY_FORMAT: 'p_f_currency',
7
+ DATE_TIME_FORMAT: 'p_f_datetime',
8
+ DATE_TIME_FORMAT_LONG: 'p_f_longdatetime',
9
+ NUMBER_FORMAT: 'p_f_number',
10
+ PERCENTAGE_FORMAT: 'p_f_percentage',
11
+ VERSION: '_ver',
12
+ };
@@ -37,4 +37,5 @@ export declare const QUERY_KEYS: {
37
37
  GET_SEARCH_LIST: string;
38
38
  GET_MATCHES_ANY_LIST: string;
39
39
  GET_INFINITE_MATCHES_ANY_LIST: string;
40
+ GET_LOGGED_USER: string;
40
41
  };
@@ -50,4 +50,6 @@ export const QUERY_KEYS = {
50
50
  GET_SEARCH_LIST: 'GET_SEARCH_LIST',
51
51
  GET_MATCHES_ANY_LIST: 'GET_MATCHES_ANY_LIST',
52
52
  GET_INFINITE_MATCHES_ANY_LIST: 'GET_INFINITE_MATCHES_ANY_LIST',
53
+ // USER
54
+ GET_LOGGED_USER: 'GET_LOGGED_USER',
53
55
  };
@@ -66,7 +66,7 @@
66
66
  "_ACT_EXPORT": "輸出",
67
67
  "_ACT_FORECAST": "予報",
68
68
  "_TILT_FORECAST": "の予測結果",
69
- "_SEG_RESULT_MESS_1": "選択した時間範囲が有効期間外であるため、データが不十分です",
69
+ "_SEG_RESULT_MESS_1": "選択した時間範囲が Time to Live の範囲外であるため、データが不十分です",
70
70
  "_BTN_CREATE_SEG": "セグメントの作成",
71
71
  "_ACT_GO_BACK": "戻る",
72
72
  "_ACT_HAVE_ATTRIBUTE": "属性を持つ",
@@ -514,7 +514,7 @@
514
514
  "_IMPORT_FILE_META_INCORRECT": "不正なメタデータ",
515
515
  "_IMPORT_FILE_NOT_FOUND": "ファイルが見つかりません",
516
516
  "_IMPORT_INVALID_FILE": "無効なファイル",
517
- "_IMPORT_LIMIT_COLUMNS_SIZE": "ファイル列が許容制限を超えています",
517
+ "_IMPORT_LIMIT_COLUMNS_SIZE": "許可された制限を超えたファイル列",
518
518
  "_IMPORT_LIMIT_ROWS_SIZE": "ファイル行が許容制限を超えています",
519
519
  "_IMPORT_MAPPING_FIELDS_ERROR": "フィールドのマッピングエラー",
520
520
  "_IMPORT_MISSING_REQUIRED_FIELD": "必須フィールドが欠落しています",
@@ -722,7 +722,7 @@
722
722
  "_NOTI_ADD_CRITERIA": "少なくとも 1 つの条件を追加してください",
723
723
  "_NOTI_ADD_EVENT_BEFORE_ASSIGN_ATTRIBUTE": "イベント属性と参照オブジェクトを割り当てる前に、ソースにイベントを追加する必要があります",
724
724
  "_NOTI_ALERT_EDIT_DESTINATION": "この宛先を編集すると、他の機能の入力に影響します",
725
- "_NOTI_AM_BEING_COMPUTED": "このモデルは計算中です。構築プロセスが完了するまで一部のフィールドを変更できません",
725
+ "_NOTI_AM_BEING_COMPUTED": "このモデルは計算中です。構築プロセスが完了するまで一部のフィールドは変更できません",
726
726
  "_NOTI_ASSIGN_ATTRIBUTE_ERROR": "属性の割り当てエラー",
727
727
  "_NOTI_ATTR_HAS_BEEN_REMOVE": "属性が削除されました",
728
728
  "_NOTI_ATTRIBUTE_BEING_COMPUTED": "この属性は計算中です。構築プロセスが完了するまで一部のフィールドは変更できません",
@@ -797,7 +797,7 @@
797
797
  "_NOTI_UPLOAD_ICON_SUCCESS": "成功!ファイルがアップロードされました。",
798
798
  "_NOTI_VALIDATE_END_DATE_GREATER_CURRENT": "終了日は現在の日付より後の日付にする必要があります",
799
799
  "_NOTI_VALIDATE_END_TIME_GREATER": "終了時間は開始時間よりも長くする必要があります",
800
- "_NOTI_VALIDATE_FILE_FORMAT": "ファイルの形式が正しくありません。もう一度試してください。",
800
+ "_NOTI_VALIDATE_FILE_FORMAT": "ファイルの形式が正しくありません。もう一度お試しください。",
801
801
  "_NOTI_VALIDATE_FORMAT_CSS_SELECTOR": "CSS セレクターは接頭辞 で始まる必要があります。または #",
802
802
  "_NOTI_VALIDATE_ICON_FORMAT": "画像の形式が正しくありません。もう一度お試しください。",
803
803
  "_NOTI_VALIDATE_ONE_DAY": "少なくとも 1 日を選択してください",
@@ -1010,7 +1010,7 @@
1010
1010
  "_TITL_COMPRESS_FILE": "ファイルを圧縮する",
1011
1011
  "_TITL_COMPUTE_SCHEDULE": "コンピューティングスケジュール",
1012
1012
  "_TITL_COMPUTE_TIME_RANGE": "計算時間範囲",
1013
- "_TITL_COMPUTE_WITH_CONDITION": "以下の条件で計算してください",
1013
+ "_TITL_COMPUTE_WITH_CONDITION": "以下の条件で計算します",
1014
1014
  "_TITL_COMPUTED_ATTR_TYPE": "計算された属性のタイプ",
1015
1015
  "_TITL_CONFIGURE_FIELD": "フィールドの構成",
1016
1016
  "_TITL_CONFIGURE_LAYOUT_VARIABLE": "レイアウト変数を設定する",
@@ -1194,7 +1194,7 @@
1194
1194
  "_TITL_ROW_ACCESS": "行アクセス",
1195
1195
  "_TITL_ALL_ROW": "すべての行",
1196
1196
  "_TITL_SPECIFIED_ROW": "指定された行",
1197
- "_TITL_COLUMN_ACCESS": "列アクセス",
1197
+ "_TITL_COLUMN_ACCESS": "カラムアクセス",
1198
1198
  "_TITL_ALL_COLUMN": "すべての列",
1199
1199
  "_TITL_SPECIFIED_COLUMN": "指定された列",
1200
1200
  "_TITL_COLUMN_SELECTED": "選択された列",
@@ -1719,7 +1719,7 @@
1719
1719
  "_TITL_TAG_ACTION_HISTORY_DETAIL": "行動履歴詳細",
1720
1720
  "_TITL_TAG_SCHEDULE_HISTORY_DETAIL": "スケジュール履歴の詳細",
1721
1721
  "_INFO_AD_ZONE_CODE": "ゾーンコード",
1722
- "_STATE_COMPLETED": "完了",
1722
+ "_STATE_COMPLETED": "完了しました",
1723
1723
  "_STATE_END": "終わり",
1724
1724
  "_STATE_EXIT_JOURNEY": "出口行程",
1725
1725
  "_STATE_VIOLATE_TRIGGER_FC": "トリガーのフリークエンシー キャップに違反する",
@@ -1740,7 +1740,7 @@
1740
1740
  "_USER_GUIDE_SEG_STATUS_ARCHIVE": "セグメントは間隔の構築を停止したため、他のオブジェクトでは使用できません",
1741
1741
  "_USER_GUIDE_COL_STATUS_ENABLE": "コレクションはインターバルビルド可能で、他のオブジェクトでも使用可能",
1742
1742
  "_USER_GUIDE_COL_STATUS_DISABLE": "コレクションは間隔の構築を停止しました。 コレクションは他のオブジェクトで使用できますが、新しいデータは使用できません",
1743
- "_USER_GUIDE_COL_STATUS_ARCHIVE": "コレクションは間隔構築を停止したため、他のオブジェクトは使用できません",
1743
+ "_USER_GUIDE_COL_STATUS_ARCHIVE": "コレクションは間隔構築を停止したため、他のオブジェクトでは使用できません",
1744
1744
  "_USER_GUIDE_COMPUTE_STATUS_WAITING_INITIAL": "オブジェクトは計算スケジュールを待っています",
1745
1745
  "_USER_GUIDE_COMPUTE_STATUS_WAITING": "オブジェクトは計算を待っています",
1746
1746
  "_USER_GUIDE_COMPUTE_STATUS_COMPUTING": "オブジェクトは計算中です",
@@ -1807,7 +1807,7 @@
1807
1807
  "_USER_GUIDE_PLAN_PROCESSING": "処理...",
1808
1808
  "_USER_GUIDE_MOVE_GROUP_INCLUDE": "人を含めるためにグループをここに移動します",
1809
1809
  "_USER_GUIDE_MOVE_GROUP_EXCLUDE": "ユーザーを除外するにはグループをここに移動します",
1810
- "_USER_GUIDE_NOTIFY_PROCESSING_SUCCESS": "{{セグメント名}} セグメントのデータ処理が完了しました",
1810
+ "_USER_GUIDE_NOTIFY_PROCESSING_SUCCESS": "{{セグメント名}}セグメントのデータ処理が完了しました",
1811
1811
  "_USER_GUIDE_NOTIFY_PROCESSING_FAILT": "{{セグメント名}} セグメントのデータ処理に失敗しました",
1812
1812
  "_TITLE_NOTIFY_HIDE": "隠れる",
1813
1813
  "_TITLE_BTN_RECOMPUTED": "再計算された",
@@ -1878,7 +1878,7 @@
1878
1878
  "_USER_GUIDE_CATALOG_CONFIRM_DISABLE": "選択したカタログを無効にしてもよろしいですか?",
1879
1879
  "_USER_GUIDE_CATALOG_CONFIRM_REMOVE": "選択したカタログを削除してもよろしいですか?",
1880
1880
  "_USER_GUIDE_CATALOG_SELECT_CATALOG_INIT": "初期化するカタログを選択してください",
1881
- "_USER_GUIDE_CATALOG_SELECT_CHANNEL": "選択した宛先チャンネル",
1881
+ "_USER_GUIDE_CATALOG_SELECT_CHANNEL": "選択された宛先チャンネル",
1882
1882
  "_USER_GUIDE_CATALOG_SEARCH_CHANNEL": "宛先チャンネルの検索",
1883
1883
  "_USER_GUIDE_CATALOG_SELECT_CATALOG": "厳選されたカタログ",
1884
1884
  "_USER_GUIDE_CATALOG_SEARCH_CATALOG": "カタログを検索する",
@@ -2098,7 +2098,7 @@
2098
2098
  "_PREDICT_MODEL_NEW_CUSTOMERS": "新規のお客様",
2099
2099
  "_PREDICT_MODEL_POTENTIAL_LOYALISTS": "潜在的なロイヤリスト",
2100
2100
  "_PREDICT_MODEL_NEED_ATTENTION": "注意が必要です ",
2101
- "_PREDICT_MODEL_VISUALIZATION_ERROR": "データは視覚化できない",
2101
+ "_PREDICT_MODEL_VISUALIZATION_ERROR": "データを視覚化できない",
2102
2102
  "_PREDICT_MODEL_VISUALIZATION_TIP": "購入金額の価値 ",
2103
2103
  "_PREDICT_MODEL_LIMIT_EQUAL_TO": "に等しい",
2104
2104
  "_PREDICT_MODEL_LIMIT_GREATER_THAN_OR_EQUAL_TO": "以上 ",
@@ -2395,7 +2395,7 @@
2395
2395
  "_OBJ_DES_WEB_1": "没入型のブラウジング体験に合わせてコンテンツを調整することで、セッションが長くなり、エンゲージメント指標が向上します",
2396
2396
  "_OBJ_DES_WEB_2": "より多くのコンバージョンと売上を促進するために、ユーザーの興味やニーズに合った製品やコンテンツをユーザーに提示します。",
2397
2397
  "_OBJ_DES_WEB_3": "視聴者とのより深いつながりを育み、ロイヤルティと維持率を高めます",
2398
- "_OBJ_DES_WEB_4": "それぞれの訪問者のインタラクションの価値を最大化するために、独自のパーソナライズされたオファーを提供します",
2398
+ "_OBJ_DES_WEB_4": "それぞれの訪問者のインタラクションの価値を最大化するために、ユニークでパーソナライズされたオファーを提供します",
2399
2399
  "_OBJ_DES_WEB_5": "ユーザーインタラクションを分析してコンテンツを洗練し、戦略をセグメント化し、Web サイトのレイアウトを最適化します。",
2400
2400
  "_OBJ_DES_WEB_NOTI_1": "タイムリーな更新、プロモーション、アラートでユーザーに即座に連絡します",
2401
2401
  "_OBJ_DES_WEB_NOTI_2": "新しいコンテンツ、製品リリース、または期間限定オファーをユーザーに通知することで、Web サイトへのトラフィックを促進します",
@@ -2409,7 +2409,7 @@
2409
2409
  "_OBJ_DES_APP_NOTI_5": "アカウント、トランザクション更新などの関連情報をユーザーのブラウザに直接配信します。",
2410
2410
  "_OBJ_DES_EMAIL_1": "魅力的なコンテンツと電子メールの行動喚起 (CTA) でユーザーを Web サイトに誘導します",
2411
2411
  "_OBJ_DES_EMAIL_2": "貴重なコンテンツやインセンティブを提供してサインアップや問い合わせを促進することで見込み顧客を獲得します。",
2412
- "_OBJ_DES_EMAIL_3": "ターゲットを絞ったコンテンツと自動化された電子メール シーケンスを使用して、セールスファネルを通じてリードを誘導します。",
2412
+ "_OBJ_DES_EMAIL_3": "ターゲットを絞ったコンテンツと自動化された電子メール シーケンスを使用して、セールス ファネルを通じてリードを誘導します。",
2413
2413
  "_OBJ_DES_EMAIL_4": "関連するアップデート、オファー、限定コンテンツで顧客の関心とロイヤルティを維持します",
2414
2414
  "_OBJ_DES_EMAIL_5": "製品やサービスを紹介して売上とコンバージョンを促進する",
2415
2415
  "_OBJ_DES_EMAIL_6": "一貫性があり、有益で魅力的なコンテンツを通じてブランド アイデンティティと価値を強化する",
@@ -2419,8 +2419,8 @@
2419
2419
  "_OBJ_DES_SMS_4": "予定や予約のリマインダーと確認を送信してノーショーを減らします",
2420
2420
  "_OBJ_DES_SMS_5": "注文確認、出荷通知、アカウント更新をリアルタイムで提供します",
2421
2421
  "_OBJ_DES_SMART_INB_1": "通知を集約し、ユーザーがメッセージを 1 か所で簡単に表示および管理できるようにします。",
2422
- "_OBJ_DES_SMART_INB_2": "プラットフォーム間で通知にアクセスし、通知を操作するためのシームレスで直感的なインターフェイスを提供します。",
2423
- "_OBJ_DES_SMART_INB_3": "通知によるタイムリーな応答と対話を促進し、ユーザー エンゲージメントと満足度を最大化します。",
2422
+ "_OBJ_DES_SMART_INB_2": "プラットフォーム間で通知にアクセスし、操作するためのシームレスで直感的なインターフェイスを提供します。",
2423
+ "_OBJ_DES_SMART_INB_3": "通知によるタイムリーな応答と対話を促進し、ユーザー エンゲージメントと満足度を最大化します",
2424
2424
  "_OBJ_DES_SMART_INB_4": "Web プッシュやアプリ プッシュなどのさまざまなチャネルからの通知を統合し、ユーザーとの一貫性のある一貫したコミュニケーションを確保します。",
2425
2425
  "_OBJ_DES_FB_MESS_1": "ターゲットを絞ったプロモーションやオファーをブロードキャストして、エンゲージメントと販売を促進します",
2426
2426
  "_OBJ_DES_FB_MESS_2": "鮮やかなメッセージ テンプレートを使用してタイムリーで関連性のある更新を提供します",
@@ -2540,7 +2540,7 @@
2540
2540
  "_REALTIME_FACEBOOK_MESSENGER_OBJ_1": "カスタマーサポートの強化",
2541
2541
  "_REALTIME_FACEBOOK_MESSENGER_DES_1": "インタラクション データを活用してタイムリーかつパーソナライズされたサポートを提供し、顧客満足度とロイヤルティを向上させます。",
2542
2542
  "_REALTIME_FACEBOOK_MESSENGER_OBJ_2": "マーケティング戦略を洗練する",
2543
- "_REALTIME_FACEBOOK_MESSENGER_DES_2": "インタラクション パターンを分析して顧客の関心や行動をより深く理解し、マーケティング活動を調整できるようにします。",
2543
+ "_REALTIME_FACEBOOK_MESSENGER_DES_2": "インタラクション パターンを分析して顧客の興味や行動をより深く理解し、マーケティング活動を調整できるようにします。",
2544
2544
  "_REALTIME_FACEBOOK_MESSENGER_OBJ_3": "対応管理を自動化する",
2545
2545
  "_REALTIME_FACEBOOK_MESSENGER_DES_3": "マーケティング ハブ機能と統合すると、応答とフォローアップが自動化され、顧客の質問に答えられないことがなくなります。",
2546
2546
  "_REALTIME_FACEBOOK_MESSENGER_OBJ_4": "エンゲージメントを高める",
@@ -0,0 +1,28 @@
1
+ export interface Attribute {
2
+ itemTypeId: number;
3
+ itemPropertyName: string;
4
+ itemPropertyDisplay: string;
5
+ dataType: string;
6
+ type: number;
7
+ autoSuggestion: number;
8
+ displayFormat?: {
9
+ type: string;
10
+ config: Record<string, any>;
11
+ };
12
+ isSort: number;
13
+ isFilter: number;
14
+ propertyDisplayMultilang: Record<string, string>;
15
+ descriptionMultilang: string;
16
+ description_multilang: string;
17
+ groupId: number;
18
+ computeType: number | null;
19
+ computePropertyName: string | null;
20
+ computeItemTypeId: number | null;
21
+ isEncrypt: number;
22
+ isRequired: number;
23
+ isIdentity: number;
24
+ status: string | number;
25
+ translateLabel: string;
26
+ isPk: number;
27
+ isOutputProductId: number;
28
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,12 @@
1
+ export interface LoggedUser {
2
+ user_id: string;
3
+ full_name: string;
4
+ avatar: string;
5
+ address: string | null;
6
+ phone: string | null;
7
+ gender: string;
8
+ email: string;
9
+ birthday: string;
10
+ language: string;
11
+ account_type: string;
12
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -1,6 +1,8 @@
1
1
  // Libraries
2
2
  import React, { useState } from 'react';
3
3
  import { createContext } from 'use-context-selector';
4
+ // Types
5
+ import { useGetLoggedUser } from '../../..';
4
6
  // Components
5
7
  import { Spin } from '@antscorp/antsomi-ui/es/components';
6
8
  // Hooks
@@ -17,6 +19,11 @@ const AppConfigProvider = props => {
17
19
  }, [value, appConfig]);
18
20
  const mergedValue = useDeepCompareMemo(() => (Object.assign(Object.assign({}, appConfig), { setAppConfig })), [appConfig]);
19
21
  const { isLoading } = useGetUserInfo(mergedValue);
22
+ useGetLoggedUser({
23
+ args: {
24
+ auth: mergedValue.auth,
25
+ },
26
+ });
20
27
  return (React.createElement(AppConfigContext.Provider, { value: mergedValue }, isLoading ? React.createElement(Spin, { indicatorSize: 24, fullscreen: true }) : children));
21
28
  };
22
29
  export { AppConfigContext, AppConfigProvider };
@@ -0,0 +1,8 @@
1
+ import { UseQueryOptions } from '@tanstack/react-query';
2
+ import { TGetLoggedUserArgs } from '../../services/User';
3
+ import { LoggedUser } from '../../models/LoggedUser';
4
+ export type TUseGetLoggedUser = {
5
+ args: TGetLoggedUserArgs;
6
+ options?: UseQueryOptions<LoggedUser, any, LoggedUser, any[]>;
7
+ };
8
+ export declare const useGetLoggedUser: (params: TUseGetLoggedUser) => import("@tanstack/react-query").UseQueryResult<LoggedUser, any>;
@@ -1 +1,13 @@
1
- "use strict";
1
+ import { useQuery } from '@tanstack/react-query';
2
+ // Services
3
+ import { userServices } from '../../services/User';
4
+ import { PORTAL_KEYS, QUERY_KEYS } from '../../constants';
5
+ import { UserAndPortalDefaultConfig } from '../../utils/portal';
6
+ export const useGetLoggedUser = (params) => {
7
+ const { args, options } = params;
8
+ return useQuery(Object.assign({ queryKey: [QUERY_KEYS.GET_LOGGED_USER, args], queryFn: () => userServices.getLoggedUser(args), onSuccess(data) {
9
+ UserAndPortalDefaultConfig.setPartial({
10
+ [PORTAL_KEYS.USER_LANGUAGE]: data.language,
11
+ });
12
+ } }, options));
13
+ };
@@ -9,3 +9,4 @@ export * from './TemplateListing';
9
9
  export * from './Media';
10
10
  export * from './Permission';
11
11
  export * from './DataTable';
12
+ export * from './User';
@@ -9,3 +9,4 @@ export * from './TemplateListing';
9
9
  export * from './Media';
10
10
  export * from './Permission';
11
11
  export * from './DataTable';
12
+ export * from './User';
@@ -1 +1,9 @@
1
+ import { TServiceAuth } from '../../types';
2
+ import { LoggedUser } from '../../models/LoggedUser';
1
3
  export { getUserInfo } from './getUserInfo';
4
+ export type TGetLoggedUserArgs = {
5
+ auth?: TServiceAuth;
6
+ };
7
+ export declare const userServices: {
8
+ getLoggedUser: (args: TGetLoggedUserArgs) => Promise<LoggedUser>;
9
+ };
@@ -1 +1,36 @@
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8
+ });
9
+ };
10
+ // Libraries
11
+ import { get } from 'lodash';
12
+ import axios from 'axios';
13
+ // Constants
14
+ import { IAM_API } from '../../constants';
1
15
  export { getUserInfo } from './getUserInfo';
16
+ export const userServices = {
17
+ getLoggedUser: (args) => __awaiter(void 0, void 0, void 0, function* () {
18
+ try {
19
+ const { auth } = args || {};
20
+ const { userId, portalId } = auth || {};
21
+ const response = yield axios({
22
+ method: 'GET',
23
+ url: `${IAM_API}/api/3rd/info`,
24
+ params: {
25
+ type: 'user-info',
26
+ userId,
27
+ networkId: portalId,
28
+ },
29
+ });
30
+ return get(response, 'data.data', {});
31
+ }
32
+ catch (error) {
33
+ return Promise.reject(error);
34
+ }
35
+ }),
36
+ };
@@ -0,0 +1,9 @@
1
+ export type TPortalFormatDate = {
2
+ check?: boolean;
3
+ value: 'long' | 'medium' | 'short';
4
+ };
5
+ export type TPortalFormatTime = {
6
+ check?: boolean;
7
+ value: 'long' | 'medium' | 'short';
8
+ timeFormat?: '12' | '24';
9
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -24,6 +24,7 @@ export * from './postMessage';
24
24
  export * from './actionsButton';
25
25
  export * from './condition';
26
26
  export * from './api';
27
+ export * from './date';
27
28
  export type PayloadInfo = {
28
29
  url?: string;
29
30
  userId?: string;
package/es/types/index.js CHANGED
@@ -8,3 +8,4 @@ export * from './postMessage';
8
8
  export * from './actionsButton';
9
9
  export * from './condition';
10
10
  export * from './api';
11
+ export * from './date';
@@ -0,0 +1,21 @@
1
+ import { Attribute } from '../models/Attribute';
2
+ type FormatAttributeDisplayArgs = {
3
+ attribute: Attribute;
4
+ value: any;
5
+ };
6
+ /**
7
+ * Format attribute value according to its data type and display format.
8
+ * @param {{ attribute: Attribute, value: any }} args - attribute and its value.
9
+ * @returns {string} Formatted value or '--' if value is empty.
10
+ */
11
+ export declare const formatAttributeDisplay: ({ attribute, value, }: FormatAttributeDisplayArgs) => string;
12
+ /**
13
+ * Get display label of an attribute, based on user language.
14
+ * It will return the label of attribute in the language that the user is currently using.
15
+ * If the attribute does not have a label in that language, it will return the default label.
16
+ * If the attribute does not have a default label, it will return an empty string.
17
+ * @param {Attribute} attribute - attribute to get display label
18
+ * @returns {string} display label of the attribute
19
+ */
20
+ export declare const getAttributeDisplayLabel: (attribute: Attribute, defaultLabel?: string) => string;
21
+ export {};
@@ -0,0 +1,38 @@
1
+ // Utils
2
+ import { formatAttributeUTCDate } from './date';
3
+ import { getUserLocaleLanguage, safeParseDisplayFormat } from './portal';
4
+ /**
5
+ * Format attribute value according to its data type and display format.
6
+ * @param {{ attribute: Attribute, value: any }} args - attribute and its value.
7
+ * @returns {string} Formatted value or '--' if value is empty.
8
+ */
9
+ export const formatAttributeDisplay = ({ attribute, value, }) => {
10
+ const { dataType } = attribute || {};
11
+ const displayFormat = safeParseDisplayFormat(attribute === null || attribute === void 0 ? void 0 : attribute.displayFormat, {
12
+ dataType,
13
+ });
14
+ let dataValue = value;
15
+ switch (true) {
16
+ case dataType === 'datetime':
17
+ dataValue = formatAttributeUTCDate(value, displayFormat);
18
+ break;
19
+ default:
20
+ break;
21
+ }
22
+ return dataValue || '--';
23
+ };
24
+ /**
25
+ * Get display label of an attribute, based on user language.
26
+ * It will return the label of attribute in the language that the user is currently using.
27
+ * If the attribute does not have a label in that language, it will return the default label.
28
+ * If the attribute does not have a default label, it will return an empty string.
29
+ * @param {Attribute} attribute - attribute to get display label
30
+ * @returns {string} display label of the attribute
31
+ */
32
+ export const getAttributeDisplayLabel = (attribute, defaultLabel) => {
33
+ var _a;
34
+ const { propertyDisplayMultilang, itemPropertyDisplay } = attribute || {};
35
+ const { DEFAULT_LANG } = propertyDisplayMultilang || {};
36
+ const userLanguage = ((_a = getUserLocaleLanguage()) === null || _a === void 0 ? void 0 : _a.toUpperCase()) || DEFAULT_LANG;
37
+ return (propertyDisplayMultilang === null || propertyDisplayMultilang === void 0 ? void 0 : propertyDisplayMultilang[userLanguage]) || itemPropertyDisplay || defaultLabel || '';
38
+ };
@@ -1,5 +1,12 @@
1
+ import { TPortalFormatDate, TPortalFormatTime } from '../types';
2
+ import { Attribute } from '../models/Attribute';
1
3
  export declare const startOfMonth: (date: Date) => Date;
2
4
  export declare const differenceInMonths: (dateA: Date, dateB: Date) => number;
3
5
  export declare const subMonths: (date: Date, number: number) => Date;
4
6
  export declare const formatDateTZ: (date: Date | string, format: string, timezone?: string) => string;
5
7
  export declare const formatDate: (date: Date | string, format: string) => string;
8
+ /** Portal Settings */
9
+ export declare function getDateFormat(date: TPortalFormatDate, format: string): any;
10
+ export declare function getTimeFormat(time: TPortalFormatTime): string;
11
+ export declare function getDateTimeFormatTranslate(displayFormat?: any): any;
12
+ export declare function formatAttributeUTCDate(timestamp: string, displayFormat: Attribute['displayFormat']): string;
package/es/utils/date.js CHANGED
@@ -1,6 +1,11 @@
1
+ // Libraries
1
2
  import dayjs from 'dayjs';
2
3
  import timezone from 'dayjs/plugin/timezone';
3
- import { getPortalTimeZone } from './portal';
4
+ // Utils
5
+ import { getPortalFormatDateTime, getPortalTimeZone, getUserLocaleLanguage } from './portal';
6
+ // Constants
7
+ import { PORTAL_MAP_DATE, PORTAL_MAP_TIME } from '../constants';
8
+ import { safeParse } from './common';
4
9
  dayjs.extend(timezone);
5
10
  export const startOfMonth = (date) => dayjs(date).startOf('month').toDate();
6
11
  export const differenceInMonths = (dateA, dateB) => dayjs(dateA).diff(dateB, 'month');
@@ -10,3 +15,57 @@ export const formatDateTZ = (date, format, timezone) => {
10
15
  return dayjs.tz(date, timezone || defaultTimezone).format(format);
11
16
  };
12
17
  export const formatDate = (date, format) => dayjs(date).format(format);
18
+ /** Portal Settings */
19
+ export function getDateFormat(date, format) {
20
+ var _a, _b, _c;
21
+ const { check, value } = date || {};
22
+ if (check) {
23
+ if (value && format) {
24
+ return (_c = (_b = PORTAL_MAP_DATE[(_a = getUserLocaleLanguage()) === null || _a === void 0 ? void 0 : _a.toLowerCase()]) === null || _b === void 0 ? void 0 : _b[format]) === null || _c === void 0 ? void 0 : _c[date.value];
25
+ }
26
+ return PORTAL_MAP_DATE.en['MM/DD/YYYY'].medium;
27
+ }
28
+ return '';
29
+ }
30
+ export function getTimeFormat(time) {
31
+ var _a;
32
+ const { check, value, timeFormat } = time || {};
33
+ if (check) {
34
+ if (timeFormat && value) {
35
+ return (_a = PORTAL_MAP_TIME[timeFormat]) === null || _a === void 0 ? void 0 : _a[value];
36
+ }
37
+ return PORTAL_MAP_TIME[12].medium;
38
+ }
39
+ return '';
40
+ }
41
+ export function getDateTimeFormatTranslate(displayFormat = {}) {
42
+ if (Object.keys(displayFormat).length === 0) {
43
+ // eslint-disable-next-line no-param-reassign
44
+ displayFormat = getPortalFormatDateTime();
45
+ }
46
+ const dateFormat = getDateFormat(displayFormat.date, displayFormat.format);
47
+ const timeFormat = getTimeFormat(safeParse(displayFormat.time, {}));
48
+ if (dateFormat !== '' && timeFormat !== '') {
49
+ return `${dateFormat} ${timeFormat}`;
50
+ }
51
+ if (dateFormat !== '') {
52
+ return dateFormat;
53
+ }
54
+ if (timeFormat !== '') {
55
+ return timeFormat;
56
+ }
57
+ return "MMM dd',' yyyy p";
58
+ }
59
+ export function formatAttributeUTCDate(timestamp, displayFormat) {
60
+ try {
61
+ const isValid = dayjs(timestamp).isValid();
62
+ if (!isValid) {
63
+ return timestamp;
64
+ }
65
+ const format = getDateTimeFormatTranslate((displayFormat === null || displayFormat === void 0 ? void 0 : displayFormat.config) || {});
66
+ return formatDateTZ(timestamp, format);
67
+ }
68
+ catch (error) {
69
+ return timestamp;
70
+ }
71
+ }
@@ -4,6 +4,8 @@ export * from './handleError';
4
4
  export * from './templateListing';
5
5
  export * from './styles';
6
6
  export * from './variables';
7
+ export * from './date';
7
8
  export * from './actionButtons';
8
9
  export * from './dataTable';
9
10
  export * from './cookie';
11
+ export * from './attribute';
package/es/utils/index.js CHANGED
@@ -4,6 +4,8 @@ export * from './handleError';
4
4
  export * from './templateListing';
5
5
  export * from './styles';
6
6
  export * from './variables';
7
+ export * from './date';
7
8
  export * from './actionButtons';
8
9
  export * from './dataTable';
9
10
  export * from './cookie';
11
+ export * from './attribute';
@@ -64,11 +64,22 @@ export declare function getUserInfoPortal(data: Record<string, any>): {
64
64
  };
65
65
  export declare const UserAndPortalDefaultConfig: {
66
66
  set: (portal?: Record<string, any>, user?: Record<string, any>) => Record<string, any>;
67
+ setPartial: (data: Record<string, any>) => void;
67
68
  getByKey: (key: string) => any;
68
69
  };
69
70
  export declare function getPortalFormatDateTimeLong(): any;
70
71
  export declare function getPortalTimeZone(): any;
71
72
  export declare function getUserLocaleLanguage(): any;
73
+ export declare function getPortalFormatDateTime(): any;
72
74
  export declare function getPortalFormatCurrency(): any;
73
75
  export declare function getPortalCurrency(): any;
76
+ export declare function getPortalFormatNumber(): any;
74
77
  export declare function safeParseDisplayFormatCurrency(value: number, displayFormat?: Record<string, any>): string;
78
+ export declare function getPortalFormatPercentage(): any;
79
+ export declare function safeParseDisplayFormat(displayFormat?: {
80
+ config: Record<string, any>;
81
+ type: string;
82
+ } | null, params?: any): {
83
+ type: string;
84
+ config: any;
85
+ };
@@ -111,6 +111,11 @@ export const UserAndPortalDefaultConfig = (() => {
111
111
  setValue(PORTAL_KEYS.DATE_TIME_FORMAT_LONG, convertDateTimeToFormatLong(portalConfig.dateAndTimeFormat));
112
112
  return APP_CACHE_PARAMS;
113
113
  },
114
+ setPartial: (data) => {
115
+ Object.keys(data || {}).forEach(key => {
116
+ APP_CACHE_PARAMS[key] = data[key];
117
+ });
118
+ },
114
119
  getByKey: (key) => APP_CACHE_PARAMS[key],
115
120
  };
116
121
  })();
@@ -124,12 +129,18 @@ export function getPortalTimeZone() {
124
129
  export function getUserLocaleLanguage() {
125
130
  return UserAndPortalDefaultConfig.getByKey(PORTAL_KEYS.USER_LANGUAGE) || 'EN';
126
131
  }
132
+ export function getPortalFormatDateTime() {
133
+ return UserAndPortalDefaultConfig.getByKey(PORTAL_KEYS.DATE_TIME_FORMAT);
134
+ }
127
135
  export function getPortalFormatCurrency() {
128
136
  return UserAndPortalDefaultConfig.getByKey(PORTAL_KEYS.CURRENCY_FORMAT);
129
137
  }
130
138
  export function getPortalCurrency() {
131
139
  return safeParse(UserAndPortalDefaultConfig.getByKey(PORTAL_KEYS.CURRENCY), 'USD');
132
140
  }
141
+ export function getPortalFormatNumber() {
142
+ return UserAndPortalDefaultConfig.getByKey(PORTAL_KEYS.NUMBER_FORMAT);
143
+ }
133
144
  export function safeParseDisplayFormatCurrency(value, displayFormat = {}) {
134
145
  if (Object.keys(displayFormat).length === 0) {
135
146
  displayFormat = getPortalFormatCurrency();
@@ -137,3 +148,76 @@ export function safeParseDisplayFormatCurrency(value, displayFormat = {}) {
137
148
  const temp = convertNumberByDisplayFormat(value, displayFormat.group, displayFormat.decimal, displayFormat.decimalPlace);
138
149
  return `${temp} ${displayFormat.currency}`;
139
150
  }
151
+ export function getPortalFormatPercentage() {
152
+ return UserAndPortalDefaultConfig.getByKey(PORTAL_KEYS.PERCENTAGE_FORMAT);
153
+ }
154
+ export function safeParseDisplayFormat(displayFormat = null, params = {}) {
155
+ if (displayFormat !== null) {
156
+ const { type } = displayFormat || {};
157
+ const config = safeParse(displayFormat.config, {});
158
+ // if (config !== undefined && Object.keys(config).length > 0) {
159
+ // return displayFormat;
160
+ // }
161
+ if (type === 'NUMBER') {
162
+ return {
163
+ type: 'NUMBER',
164
+ config: Object.assign(Object.assign({}, getPortalFormatNumber()), config),
165
+ };
166
+ }
167
+ if (type === 'CURRENCY') {
168
+ return {
169
+ type: 'CURRENCY',
170
+ config: Object.assign(Object.assign({}, getPortalFormatCurrency()), config),
171
+ };
172
+ }
173
+ if (type === 'PERCENTAGE') {
174
+ return {
175
+ type: 'PERCENTAGE',
176
+ config: Object.assign(Object.assign({}, getPortalFormatPercentage()), config),
177
+ };
178
+ }
179
+ if (type === 'DATE_AND_TIME') {
180
+ return {
181
+ type: 'DATE_AND_TIME',
182
+ config: Object.assign(Object.assign({}, getPortalFormatDateTime()), config),
183
+ };
184
+ }
185
+ if (type === 'RAW_STRING' || type === 'IMAGE' || type === 'LINK' || type === 'CUSTOM_LINK') {
186
+ return {
187
+ type,
188
+ config: Object.assign({}, config),
189
+ };
190
+ }
191
+ }
192
+ const { dataType } = params || {};
193
+ if (dataType === 'number') {
194
+ const { isCurrency } = params || {};
195
+ if (parseInt(isCurrency) === 1) {
196
+ return {
197
+ type: 'CURRENCY',
198
+ config: getPortalFormatCurrency(),
199
+ };
200
+ }
201
+ return {
202
+ type: 'NUMBER',
203
+ config: getPortalFormatNumber(),
204
+ };
205
+ }
206
+ if (dataType === 'datetime') {
207
+ return {
208
+ type: 'DATE_AND_TIME',
209
+ config: getPortalFormatDateTime(),
210
+ };
211
+ }
212
+ if (dataType === 'string') {
213
+ return {
214
+ type: 'RAW_STRING',
215
+ config: {},
216
+ };
217
+ }
218
+ // string is default
219
+ return {
220
+ type: 'RAW_STRING',
221
+ config: {},
222
+ };
223
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@antscorp/antsomi-ui",
3
- "version": "1.3.5-beta.742",
3
+ "version": "1.3.5-beta.743",
4
4
  "description": "An enterprise-class UI design language and React UI library.",
5
5
  "sideEffects": [
6
6
  "dist/*",
@@ -20,7 +20,7 @@
20
20
  "types": "es/index.d.ts",
21
21
  "scripts": {
22
22
  "prepublishOnly": "yarn && yarn build:es",
23
- "build:es": "npm run translate:init && npm run clean && npm run copy-files && npm run ts-compile",
23
+ "build:es": "npm run clean && npm run copy-files && npm run ts-compile",
24
24
  "clean": "rimraf dist lib es",
25
25
  "dev": "vite",
26
26
  "build:dist": "webpack --config webpack.build.js",