@antscorp/antsomi-ui 1.2.0-beta.2 → 1.2.0

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,10 +1,7 @@
1
1
  import { ConfigProviderProps as AntdConfigProviderProps } from 'antd/es/config-provider';
2
2
  import React, { ReactNode } from 'react';
3
- import { TLocale } from 'src/types';
4
- import 'src/locales/i18n';
5
- interface ConfigProviderProps extends Omit<AntdConfigProviderProps, 'locale'> {
3
+ interface ConfigProviderProps extends AntdConfigProviderProps {
6
4
  children?: ReactNode;
7
- locale?: TLocale;
8
5
  }
9
6
  declare const ConfigProvider: React.FC<ConfigProviderProps>;
10
7
  export default ConfigProvider;
@@ -11,5 +11,5 @@
11
11
  * @param {number} [value=0] - Value to be added or subtracted.
12
12
  * @param {string} [dateFormat=DEFAULT_DATE_FORMAT] - Format in which to return the new date.
13
13
  * @returns {string} The new date in the specified format.
14
- */
14
+ */
15
15
  export declare const calculationDateAdvanced: (dateTypeKey?: string, calculationTypeKey?: string, calculationDateKey?: any, value?: number, dateFormat?: string) => any;
@@ -4,6 +4,6 @@ export interface AdvancedRangePickerProps {
4
4
  timeRange: TTimeRange;
5
5
  errorMessage?: string;
6
6
  showLabel?: boolean;
7
- onChange?: ({ timeRange, mode }: TOnChangePayload) => void;
7
+ onChange?: ({ timeRange, mode, }: TOnChangePayload) => void;
8
8
  }
9
9
  export declare const AdvancedRangePicker: React.FC<AdvancedRangePickerProps>;
@@ -5,4 +5,4 @@ export { Modal } from './Modal';
5
5
  export { Select } from './Select';
6
6
  export { CustomComponent } from './CustomComponent';
7
7
  export { DatePicker } from './DatePicker';
8
- export type { AdvancedPickerProps, TAdvancedPickerOption, TAdvancedRangePickerTimeRange, } from './DatePicker';
8
+ export type { AdvancedPickerProps, TAdvancedPickerOption, TAdvancedRangePickerTimeRange } from './DatePicker';
@@ -1 +1,2 @@
1
+ import './locales/i18n';
1
2
  export * from './components';
@@ -1,71 +1,21 @@
1
1
  export declare const translationsJson: {
2
2
  en: {
3
3
  translation: {
4
- global: {
5
- minus: string;
6
- plus: string;
7
- };
4
+ global: {};
8
5
  button: {};
9
6
  datePicker: {
10
7
  startDate: string;
11
- endDate: string;
12
- dateTypes: {
13
- today: string;
14
- firstDayOfWeekMonSun: string;
15
- firstDayOfWeekSunSat: string;
16
- firstDayOfMonth: string;
17
- firstDayOfQuarter: string;
18
- firstDayOfYear: string;
19
- lastDayOfWeekMonSun: string;
20
- lastDayOfWeekSunSat: string;
21
- lastDayOfMonth: string;
22
- lastDayOfQuarter: string;
23
- lastDayOfYear: string;
24
- fixed: string;
25
- };
26
- seconds: string;
27
- minutes: string;
28
- hours: string;
29
- days: string;
30
- weeks: string;
31
- months: string;
32
- quarters: string;
33
- years: string;
8
+ enDate: string;
34
9
  };
35
10
  };
36
11
  };
37
12
  vi: {
38
13
  translation: {
39
- global: {
40
- minus: string;
41
- plus: string;
42
- };
14
+ global: {};
43
15
  button: {};
44
16
  datePicker: {
45
17
  startDate: string;
46
- endDate: string;
47
- dateTypes: {
48
- today: string;
49
- firstDayOfWeekMonSun: string;
50
- firstDayOfWeekSunSat: string;
51
- firstDayOfMonth: string;
52
- firstDayOfQuarter: string;
53
- firstDayOfYear: string;
54
- lastDayOfWeekMonSun: string;
55
- lastDayOfWeekSunSat: string;
56
- lastDayOfMonth: string;
57
- lastDayOfQuarter: string;
58
- lastDayOfYear: string;
59
- fixed: string;
60
- };
61
- seconds: string;
62
- minutes: string;
63
- hours: string;
64
- days: string;
65
- weeks: string;
66
- months: string;
67
- quarters: string;
68
- years: string;
18
+ enDate: string;
69
19
  };
70
20
  };
71
21
  };
@@ -1,37 +1,14 @@
1
1
  import { ConvertedToObjectType, TranslationJsonType } from './types';
2
+ /**
3
+ * This file is seperate from the './i18n.ts' simply to make the Hot Module Replacement work seamlessly.
4
+ * Your components can import this file in 'messages.ts' files which would ruin the HMR if this isn't a separate module
5
+ */
2
6
  export declare const translations: ConvertedToObjectType<TranslationJsonType>;
3
7
  export declare const convertLanguageJsonToObject: (json: any, objToConvertTo?: ConvertedToObjectType<{
4
- global: {
5
- minus: string;
6
- plus: string;
7
- };
8
+ global: {};
8
9
  button: {};
9
10
  datePicker: {
10
11
  startDate: string;
11
- endDate: string;
12
- dateTypes: {
13
- today: string;
14
- firstDayOfWeekMonSun: string;
15
- firstDayOfWeekSunSat: string;
16
- firstDayOfMonth: string;
17
- firstDayOfQuarter: string;
18
- firstDayOfYear: string;
19
- lastDayOfWeekMonSun: string;
20
- lastDayOfWeekSunSat: string;
21
- lastDayOfMonth: string;
22
- lastDayOfQuarter: string;
23
- lastDayOfYear: string;
24
- fixed: string;
25
- };
26
- seconds: string;
27
- minutes: string;
28
- hours: string;
29
- days: string;
30
- weeks: string;
31
- months: string;
32
- quarters: string;
33
- years: string;
12
+ enDate: string;
34
13
  };
35
14
  }>, current?: string) => void;
36
- export declare const t: (id: string, ...rest: any[]) => [string, ...any[]];
37
- export declare const getTranslateMessage: (id: string, defaultMessage?: string, value?: Record<string, unknown>) => string;
@@ -3,4 +3,3 @@ export type THandleErrorPayload = {
3
3
  name: string;
4
4
  args: Record<string, any>;
5
5
  };
6
- export type TLocale = 'en' | 'vi';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@antscorp/antsomi-ui",
3
- "version": "1.2.0-beta.2",
3
+ "version": "1.2.0",
4
4
  "description": "An enterprise-class UI design language and React UI library.",
5
5
  "main": "dist/index.js",
6
6
  "files": [
@@ -35,9 +35,6 @@
35
35
  "author": "",
36
36
  "license": "MIT",
37
37
  "dependencies": {
38
- "i18next": "^22.4.14",
39
- "i18next-browser-languagedetector": "^7.0.1",
40
- "react-i18next": "^12.2.0",
41
38
  "antd": "^5.3.2",
42
39
  "dayjs": "^1.11.7",
43
40
  "lodash": "^4.17.21",
@@ -90,6 +87,8 @@
90
87
  "eslint-plugin-storybook": "^0.6.11",
91
88
  "file-loader": "^6.2.0",
92
89
  "husky": "^8.0.3",
90
+ "i18next": "^22.4.14",
91
+ "i18next-browser-languagedetector": "^7.0.1",
93
92
  "jest": "^29.5.0",
94
93
  "jest-environment-jsdom": "^29.5.0",
95
94
  "lint-staged": "^13.2.0",
@@ -100,6 +99,7 @@
100
99
  "react": "18.2.0",
101
100
  "react-dom": "18.2.0",
102
101
  "react-fast-compare": "^3.2.1",
102
+ "react-i18next": "^12.2.0",
103
103
  "sass": "^1.60.0",
104
104
  "sass-loader": "^13.2.2",
105
105
  "style-loader": "^3.3.2",
package/dist/553.index.js DELETED
@@ -1 +0,0 @@
1
- (self.webpackChunk_antscorp_antsomi_ui=self.webpackChunk_antscorp_antsomi_ui||[]).push([[553],{7553:function(t,_,h){t.exports=function(t){"use strict";function _(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var h=_(t),n={name:"vi",weekdays:"chủ nhật_thứ hai_thứ ba_thứ tư_thứ năm_thứ sáu_thứ bảy".split("_"),months:"tháng 1_tháng 2_tháng 3_tháng 4_tháng 5_tháng 6_tháng 7_tháng 8_tháng 9_tháng 10_tháng 11_tháng 12".split("_"),weekStart:1,weekdaysShort:"CN_T2_T3_T4_T5_T6_T7".split("_"),monthsShort:"Th01_Th02_Th03_Th04_Th05_Th06_Th07_Th08_Th09_Th10_Th11_Th12".split("_"),weekdaysMin:"CN_T2_T3_T4_T5_T6_T7".split("_"),ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM [năm] YYYY",LLL:"D MMMM [năm] YYYY HH:mm",LLLL:"dddd, D MMMM [năm] YYYY HH:mm",l:"DD/M/YYYY",ll:"D MMM YYYY",lll:"D MMM YYYY HH:mm",llll:"ddd, D MMM YYYY HH:mm"},relativeTime:{future:"%s tới",past:"%s trước",s:"vài giây",m:"một phút",mm:"%d phút",h:"một giờ",hh:"%d giờ",d:"một ngày",dd:"%d ngày",M:"một tháng",MM:"%d tháng",y:"một năm",yy:"%d năm"}};return h.default.locale(n,null,!0),n}(h(7484))}}]);
@@ -1,33 +0,0 @@
1
- {
2
- "global": {
3
- "minus": "Trừ",
4
- "plus": "Cộng"
5
- },
6
- "button": {},
7
- "datePicker": {
8
- "startDate": "Ngày bắt đầu",
9
- "endDate": "Ngày kết thúc",
10
- "dateTypes": {
11
- "today": "Hôm nay",
12
- "firstDayOfWeekMonSun": "Ngày đầu tiên của tuần (T2 - CN)",
13
- "firstDayOfWeekSunSat": "Ngày đầu tiên của tuần (CN - T7)",
14
- "firstDayOfMonth": "Ngày đầu tiên của tháng",
15
- "firstDayOfQuarter": "Ngày đầu tiên của quý",
16
- "firstDayOfYear": "Ngày đầu tiên của năm",
17
- "lastDayOfWeekMonSun": "Ngày cuối cùng của tuần (T2 - CN)",
18
- "lastDayOfWeekSunSat": "Ngày cuối cùng của tuần (CN - T7)",
19
- "lastDayOfMonth": "Ngày cuối cùng của tháng",
20
- "lastDayOfQuarter": "Ngày cuối cùng của quý",
21
- "lastDayOfYear": "Ngày cuối cùng của năm",
22
- "fixed": "Cố Định"
23
- },
24
- "seconds": "Giây",
25
- "minutes": "Phút",
26
- "hours": "Giờ",
27
- "days": "Ngày",
28
- "weeks": "Tuần",
29
- "months": "Tháng",
30
- "quarters": "Quý",
31
- "years": "Năm"
32
- }
33
- }
@@ -1,33 +0,0 @@
1
- {
2
- "global": {
3
- "minus": "Minus",
4
- "plus": "Plus"
5
- },
6
- "button": {},
7
- "datePicker": {
8
- "startDate": "Start Date",
9
- "endDate": "End Date",
10
- "dateTypes": {
11
- "today": "Today",
12
- "firstDayOfWeekMonSun": "First day of this week (Mon - Sun)",
13
- "firstDayOfWeekSunSat": "First day of this week (Sun - Sat)",
14
- "firstDayOfMonth": "First day of this month",
15
- "firstDayOfQuarter": "First day of this quarter",
16
- "firstDayOfYear": "First day of this year",
17
- "lastDayOfWeekMonSun": "First day of this week (Mon - Sun)",
18
- "lastDayOfWeekSunSat": "First day of this week (Sun - Sat)",
19
- "lastDayOfMonth": "Last day of this month",
20
- "lastDayOfQuarter": "Last day of this quarter",
21
- "lastDayOfYear": "Last day of this year",
22
- "fixed": "Fixed"
23
- },
24
- "seconds": "Seconds",
25
- "minutes": "Minutes",
26
- "hours": "Hours",
27
- "days": "Days",
28
- "weeks": "Weeks",
29
- "months": "Months",
30
- "quarters": "Quarters",
31
- "years": "Years"
32
- }
33
- }