@omniumretail/component-library 0.1.15 → 0.1.17
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.
- package/.storybook/preview.js +3 -1
- package/dist/bundle.js +113 -26
- package/dist/main.css +11 -11
- package/dist/types/components/{Header/Header.stories.d.ts → Navigation/Navigation.stories.d.ts} +2 -2
- package/dist/types/components/Navigation/index.d.ts +10 -0
- package/dist/types/components/Select/index.d.ts +4 -1
- package/dist/types/components/Table/Table.stories.d.ts +1 -0
- package/dist/types/components/Table/index.d.ts +6 -0
- package/dist/types/components/index.d.ts +1 -1
- package/dist/types/constants/i18n.d.ts +1 -1
- package/dist/types/index.d.ts +1 -0
- package/package.json +2 -1
- package/src/components/DatePicker/styles.module.scss +1 -2
- package/src/components/{Header/Header.stories.tsx → Navigation/Navigation.stories.tsx} +5 -4
- package/src/components/{Header → Navigation}/index.tsx +10 -8
- package/src/components/{Header → Navigation}/styles.module.scss +1 -1
- package/src/components/Select/index.tsx +7 -3
- package/src/components/Table/Table.stories.tsx +59 -3
- package/src/components/Table/index.tsx +49 -26
- package/src/components/index.tsx +1 -1
- package/src/constants/i18n.ts +6 -3
- package/src/index.ts +1 -0
- package/src/locales/en.json +4 -0
- package/src/locales/es.json +4 -0
- package/src/locales/pt.json +4 -0
- package/dist/types/components/Header/index.d.ts +0 -8
package/dist/main.css
CHANGED
|
@@ -52,10 +52,10 @@
|
|
|
52
52
|
color: var(--button-disabled-default-text-color);
|
|
53
53
|
pointer-events: none;
|
|
54
54
|
}
|
|
55
|
-
|
|
56
|
-
!*** css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[0].use[1]!./node_modules/sass-loader/dist/cjs.js!./src/components/
|
|
57
|
-
|
|
58
|
-
.
|
|
55
|
+
/*!*******************************************************************************************************************************************************************!*\
|
|
56
|
+
!*** css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[0].use[1]!./node_modules/sass-loader/dist/cjs.js!./src/components/Navigation/styles.module.scss ***!
|
|
57
|
+
\*******************************************************************************************************************************************************************/
|
|
58
|
+
.UxfXOleP69PjM5rFOMTD {
|
|
59
59
|
display: grid;
|
|
60
60
|
grid-template-columns: repeat(3, 1fr);
|
|
61
61
|
justify-items: center;
|
|
@@ -65,23 +65,23 @@
|
|
|
65
65
|
position: relative;
|
|
66
66
|
}
|
|
67
67
|
@media (max-width: 767px) {
|
|
68
|
-
.
|
|
68
|
+
.UxfXOleP69PjM5rFOMTD {
|
|
69
69
|
padding-top: 32px;
|
|
70
70
|
display: flex;
|
|
71
71
|
align-items: center;
|
|
72
72
|
justify-content: space-between;
|
|
73
73
|
}
|
|
74
74
|
}
|
|
75
|
-
.
|
|
75
|
+
.UxfXOleP69PjM5rFOMTD .LzcTbjk0fp70tXlKd3eS {
|
|
76
76
|
font-size: var(--font-size-body-4);
|
|
77
77
|
font-weight: var(--font-weight-semibold);
|
|
78
78
|
text-transform: uppercase;
|
|
79
79
|
}
|
|
80
|
-
.
|
|
80
|
+
.UxfXOleP69PjM5rFOMTD .gn06XRZhFG00HaVjAqNc {
|
|
81
81
|
align-self: center;
|
|
82
82
|
}
|
|
83
83
|
@media (max-width: 767px) {
|
|
84
|
-
.
|
|
84
|
+
.UxfXOleP69PjM5rFOMTD .gn06XRZhFG00HaVjAqNc {
|
|
85
85
|
position: absolute;
|
|
86
86
|
top: 0;
|
|
87
87
|
margin: 0 auto;
|
|
@@ -90,10 +90,10 @@
|
|
|
90
90
|
text-align: center;
|
|
91
91
|
}
|
|
92
92
|
}
|
|
93
|
-
.
|
|
93
|
+
.UxfXOleP69PjM5rFOMTD .UK3esJZjnri5Jb9Jxcca {
|
|
94
94
|
justify-self: start;
|
|
95
95
|
}
|
|
96
|
-
.
|
|
96
|
+
.UxfXOleP69PjM5rFOMTD .U5tZ7kRlrIHUKsuduD1S {
|
|
97
97
|
justify-self: end;
|
|
98
98
|
}
|
|
99
99
|
/*!*************************************************************************************************************************************************************!*\
|
|
@@ -273,7 +273,7 @@
|
|
|
273
273
|
!*** css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[0].use[1]!./node_modules/sass-loader/dist/cjs.js!./src/components/DatePicker/styles.module.scss ***!
|
|
274
274
|
\*******************************************************************************************************************************************************************/
|
|
275
275
|
.vdTO5pKaLXA2FdyblLq5 {
|
|
276
|
-
border:
|
|
276
|
+
border-color: rgba(var(--color-black-rgb), 0.5);
|
|
277
277
|
}
|
|
278
278
|
/*!**************************************************************************************************************************************************************!*\
|
|
279
279
|
!*** css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[0].use[1]!./node_modules/sass-loader/dist/cjs.js!./src/components/Radio/styles.module.scss ***!
|
package/dist/types/components/{Header/Header.stories.d.ts → Navigation/Navigation.stories.d.ts}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Meta, Story } from "@storybook/react";
|
|
2
|
-
import {
|
|
2
|
+
import { NavigationProps } from '.';
|
|
3
3
|
declare const _default: Meta<import("@storybook/react").Args>;
|
|
4
4
|
export default _default;
|
|
5
|
-
export declare const Primary: Story<
|
|
5
|
+
export declare const Primary: Story<NavigationProps>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export interface NavigationProps {
|
|
2
|
+
backLink?: boolean;
|
|
3
|
+
title: string;
|
|
4
|
+
homeLink?: boolean;
|
|
5
|
+
loginLink?: boolean;
|
|
6
|
+
loginOnClickFunction?: () => void;
|
|
7
|
+
backLinkOnClickFunction?: () => void;
|
|
8
|
+
homeOnClickFunction?: () => void;
|
|
9
|
+
}
|
|
10
|
+
export declare const Navigation: (props: NavigationProps) => JSX.Element;
|
|
@@ -4,6 +4,10 @@ export interface FilterOptions {
|
|
|
4
4
|
label: string;
|
|
5
5
|
direction: string;
|
|
6
6
|
}
|
|
7
|
+
export interface Actions {
|
|
8
|
+
key: string;
|
|
9
|
+
label: string;
|
|
10
|
+
}
|
|
7
11
|
export declare enum sortBy {
|
|
8
12
|
asc = "asc",
|
|
9
13
|
desc = "desc"
|
|
@@ -15,5 +19,7 @@ export interface customTableProps extends TableProps<any> {
|
|
|
15
19
|
sortInfo?: any;
|
|
16
20
|
paginationInfo?: any;
|
|
17
21
|
headingTranslationsKey?: string;
|
|
22
|
+
actions: boolean;
|
|
23
|
+
actionsArray: any;
|
|
18
24
|
}
|
|
19
25
|
export declare const CustomTable: (props: customTableProps) => JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export declare const mergei18n: (appResources: any) => void;
|
package/dist/types/index.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@omniumretail/component-library",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.17",
|
|
4
4
|
"private": false,
|
|
5
5
|
"main": "dist/bundle.js",
|
|
6
6
|
"typings": "./dist/types/index",
|
|
@@ -43,6 +43,7 @@
|
|
|
43
43
|
"jest": "^27.4.3",
|
|
44
44
|
"jest-resolve": "^27.4.2",
|
|
45
45
|
"jest-watch-typeahead": "^1.0.0",
|
|
46
|
+
"lodash.merge": "^4.6.2",
|
|
46
47
|
"mini-css-extract-plugin": "^2.7.2",
|
|
47
48
|
"moment": "^2.29.4",
|
|
48
49
|
"postcss": "^8.4.4",
|
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
import { Meta, Story } from "@storybook/react";
|
|
2
|
-
import {
|
|
2
|
+
import { Navigation, NavigationProps } from '.';
|
|
3
3
|
|
|
4
4
|
export default {
|
|
5
|
-
title: '
|
|
6
|
-
component:
|
|
5
|
+
title: 'Navigation',
|
|
6
|
+
component: Navigation,
|
|
7
7
|
} as Meta;
|
|
8
8
|
|
|
9
|
-
const Template: Story<
|
|
9
|
+
const Template: Story<NavigationProps> = (args) => <Navigation {...args}></Navigation>;
|
|
10
10
|
|
|
11
11
|
export const Primary = Template.bind({});
|
|
12
12
|
Primary.args = {
|
|
13
13
|
backLink: true,
|
|
14
14
|
title: 'Gestão de Aplicações',
|
|
15
15
|
homeLink: true,
|
|
16
|
+
loginLink: true,
|
|
16
17
|
};
|
|
@@ -2,29 +2,31 @@ import styles from './styles.module.scss';
|
|
|
2
2
|
import { Link } from '../Link';
|
|
3
3
|
import { ArrowLeftOutlined, HomeOutlined, LogoutOutlined } from '@ant-design/icons';
|
|
4
4
|
import { useTranslation } from 'react-i18next';
|
|
5
|
-
export interface
|
|
5
|
+
export interface NavigationProps {
|
|
6
6
|
backLink?: boolean;
|
|
7
7
|
title: string;
|
|
8
8
|
homeLink?: boolean;
|
|
9
9
|
loginLink?: boolean;
|
|
10
|
-
|
|
10
|
+
loginOnClickFunction?: () => void;
|
|
11
|
+
backLinkOnClickFunction?: () => void;
|
|
12
|
+
homeOnClickFunction?: () => void;
|
|
11
13
|
}
|
|
12
14
|
|
|
13
|
-
export const
|
|
14
|
-
const { backLink, title, homeLink,
|
|
15
|
+
export const Navigation = (props: NavigationProps) => {
|
|
16
|
+
const { backLink, title, homeLink, loginOnClickFunction, loginLink, backLinkOnClickFunction, homeOnClickFunction } = props;
|
|
15
17
|
const { t } = useTranslation();
|
|
16
18
|
|
|
17
19
|
return (
|
|
18
|
-
<div className={styles.
|
|
20
|
+
<div className={styles.navigation}>
|
|
19
21
|
<div className={styles.columnLeft}>
|
|
20
|
-
{ backLink && <Link href="#" icon={<ArrowLeftOutlined />} linkSecondary> {t('navigation.back')} </Link> }
|
|
22
|
+
{ backLink && <Link href="#" icon={<ArrowLeftOutlined />} linkSecondary onClick={backLinkOnClickFunction}> {t('navigation.back')} </Link> }
|
|
21
23
|
</div>
|
|
22
24
|
<div className={styles.columnCenter}>
|
|
23
25
|
<h1 className={styles.title}>{title}</h1>
|
|
24
26
|
</div>
|
|
25
27
|
<div className={styles.columnRight}>
|
|
26
|
-
{homeLink && <Link href="#" icon={<HomeOutlined />} linkSecondary iconAlignRight> {t('navigation.home')} </Link>}
|
|
27
|
-
{loginLink && <Link href="#" onClick={
|
|
28
|
+
{homeLink && <Link href="#" icon={<HomeOutlined />} linkSecondary iconAlignRight onClick={homeOnClickFunction}> {t('navigation.home')} </Link>}
|
|
29
|
+
{loginLink && <Link href="#" onClick={loginOnClickFunction} icon={<LogoutOutlined />} linkSecondary iconAlignRight> {t('navigation.logout')} </Link>}
|
|
28
30
|
</div>
|
|
29
31
|
</div>
|
|
30
32
|
)
|
|
@@ -1,13 +1,17 @@
|
|
|
1
1
|
import styles from './styles.module.scss';
|
|
2
2
|
import { Select, SelectProps } from 'antd';
|
|
3
3
|
|
|
4
|
-
export
|
|
5
|
-
|
|
4
|
+
export interface CustomSelectProps extends SelectProps {
|
|
5
|
+
customClass?: string;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export const CustomSelect = (props: CustomSelectProps) => {
|
|
9
|
+
const { defaultValue, options, customClass } = props;
|
|
6
10
|
|
|
7
11
|
return (
|
|
8
12
|
(options || defaultValue) &&
|
|
9
13
|
<Select
|
|
10
|
-
className={styles.select}
|
|
14
|
+
className={`${styles.select} ${customClass}`}
|
|
11
15
|
defaultValue={defaultValue}
|
|
12
16
|
style={{ minWidth: 180 }}
|
|
13
17
|
options={options}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Meta, Story } from "@storybook/react";
|
|
2
2
|
import { CustomTable, customTableProps } from '.';
|
|
3
3
|
import { useState } from "react";
|
|
4
|
+
import { useTranslation } from "react-i18next";
|
|
4
5
|
|
|
5
6
|
export default {
|
|
6
7
|
title: 'customTable',
|
|
@@ -8,20 +9,30 @@ export default {
|
|
|
8
9
|
} as Meta;
|
|
9
10
|
|
|
10
11
|
const Template: Story<customTableProps> = (args) => {
|
|
12
|
+
const { t } = useTranslation();
|
|
11
13
|
const [pageInfo, setPageInfo] = useState<any>({});
|
|
12
14
|
// const [sortingInfo, setSortingInfo] = useState<any>({});
|
|
13
15
|
const [sortBy, setSortBy] = useState<string[]>(['key', 'desc']);
|
|
14
16
|
|
|
15
17
|
const newDataSource = args.dataSource?.slice().sort((a, b) => {
|
|
16
|
-
if(sortBy[1] === 'asc') {
|
|
18
|
+
if (sortBy[1] === 'asc') {
|
|
17
19
|
return a[sortBy[0]].localeCompare(b[sortBy[0]]);
|
|
18
20
|
} else {
|
|
19
|
-
debugger;
|
|
20
21
|
return b[sortBy[0]].localeCompare(a[sortBy[0]]);
|
|
21
22
|
}
|
|
22
23
|
});
|
|
23
24
|
|
|
24
|
-
return <CustomTable {...args} dataSource={newDataSource} onSort={(field, sort) => setSortBy([field, sort])
|
|
25
|
+
return <CustomTable {...args} dataSource={newDataSource} onSort={(field, sort) => setSortBy([field, sort])} paginationInfo={setPageInfo} headingTranslationsKey={'tableHeadings'} actionsArray={
|
|
26
|
+
[
|
|
27
|
+
{ key: '1', label: `${t('actions.one')}`, onClick: () => {
|
|
28
|
+
console.log('oi');
|
|
29
|
+
} },
|
|
30
|
+
{ key: '2', label: `${t('actions.two')}` },
|
|
31
|
+
{
|
|
32
|
+
key: '3', label: 'label 3'
|
|
33
|
+
}
|
|
34
|
+
]
|
|
35
|
+
}></CustomTable>;
|
|
25
36
|
};
|
|
26
37
|
|
|
27
38
|
export const Primary = Template.bind({});
|
|
@@ -150,3 +161,48 @@ WithCheckbox.args = {
|
|
|
150
161
|
type: "checkbox"
|
|
151
162
|
}
|
|
152
163
|
};
|
|
164
|
+
|
|
165
|
+
export const withActions = Template.bind({});
|
|
166
|
+
withActions.args = {
|
|
167
|
+
fieldsToSort: ['store', 'mecanographicNumber'],
|
|
168
|
+
selectPlaceholder: 'Order by',
|
|
169
|
+
dataSource: [
|
|
170
|
+
{
|
|
171
|
+
key: `1`,
|
|
172
|
+
name: `John Brown`,
|
|
173
|
+
mecanographicNumber: "232",
|
|
174
|
+
store: `Levi's Sta Catarina`,
|
|
175
|
+
role: `Gerente`,
|
|
176
|
+
type: `Efetivo`
|
|
177
|
+
},
|
|
178
|
+
{
|
|
179
|
+
key: `2`,
|
|
180
|
+
name: `Mary Brown`,
|
|
181
|
+
mecanographicNumber: "32",
|
|
182
|
+
store: `Levi's Sta Catarina`,
|
|
183
|
+
role: `Comercial`,
|
|
184
|
+
type: `Efetivo`
|
|
185
|
+
},
|
|
186
|
+
{
|
|
187
|
+
key: `3`,
|
|
188
|
+
name: `Anna Astori`,
|
|
189
|
+
mecanographicNumber: "3212",
|
|
190
|
+
store: `Levi's Sta Catarina`,
|
|
191
|
+
role: `Funcionário`,
|
|
192
|
+
type: `Efetivo`
|
|
193
|
+
},
|
|
194
|
+
{
|
|
195
|
+
key: `4`,
|
|
196
|
+
name: `Yield Ona`,
|
|
197
|
+
mecanographicNumber: "21232",
|
|
198
|
+
store: `Adidas Restaurantes`,
|
|
199
|
+
role: `Gerente`,
|
|
200
|
+
type: `Efetivo`
|
|
201
|
+
},
|
|
202
|
+
],
|
|
203
|
+
pagination: {
|
|
204
|
+
total: 24,
|
|
205
|
+
pageSize: 4
|
|
206
|
+
},
|
|
207
|
+
actions: true,
|
|
208
|
+
};
|
|
@@ -1,14 +1,20 @@
|
|
|
1
1
|
import { useState, useEffect } from 'react';
|
|
2
|
-
import { Space, TableProps, Select } from 'antd';
|
|
2
|
+
import { Space, TableProps, Select, Dropdown, MenuProps } from 'antd';
|
|
3
3
|
import { Table } from 'antd';
|
|
4
4
|
import type { ColumnsType } from 'antd/es/table/interface';
|
|
5
5
|
import styles from './styles.module.scss';
|
|
6
6
|
import { useTranslation } from 'react-i18next';
|
|
7
|
+
import { EllipsisOutlined } from '@ant-design/icons';
|
|
7
8
|
|
|
8
9
|
export interface FilterOptions {
|
|
9
|
-
value: string
|
|
10
|
-
label: string
|
|
11
|
-
direction: string
|
|
10
|
+
value: string;
|
|
11
|
+
label: string;
|
|
12
|
+
direction: string;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export interface Actions {
|
|
16
|
+
key: string;
|
|
17
|
+
label: string;
|
|
12
18
|
}
|
|
13
19
|
|
|
14
20
|
export enum sortBy {
|
|
@@ -23,18 +29,22 @@ export interface customTableProps extends TableProps<any> {
|
|
|
23
29
|
sortInfo?: any;
|
|
24
30
|
paginationInfo?: any;
|
|
25
31
|
headingTranslationsKey?: string;
|
|
32
|
+
actions: boolean;
|
|
33
|
+
actionsArray: any;
|
|
26
34
|
}
|
|
27
35
|
|
|
28
36
|
export const CustomTable = (props: customTableProps) => {
|
|
29
37
|
const { t } = useTranslation();
|
|
30
38
|
|
|
31
|
-
const {
|
|
32
|
-
dataSource,
|
|
33
|
-
fieldsToSort = ['key', 'name', 'store'],
|
|
34
|
-
selectPlaceholder, onSort,
|
|
35
|
-
headingTranslationsKey
|
|
39
|
+
const {
|
|
40
|
+
dataSource,
|
|
41
|
+
fieldsToSort = ['key', 'name', 'store'],
|
|
42
|
+
selectPlaceholder, onSort,
|
|
43
|
+
headingTranslationsKey,
|
|
44
|
+
actions,
|
|
45
|
+
actionsArray: items,
|
|
36
46
|
} = props;
|
|
37
|
-
|
|
47
|
+
|
|
38
48
|
const [customFilters, setCustomFilters] = useState<any>([]);
|
|
39
49
|
const [customColumns, setCustomColumns] = useState<ColumnsType<any>>([]);
|
|
40
50
|
const [sortInfo, setSortInfo] = useState<any>([]);
|
|
@@ -44,7 +54,7 @@ export const CustomTable = (props: customTableProps) => {
|
|
|
44
54
|
currentPage: pagination.current,
|
|
45
55
|
}
|
|
46
56
|
|
|
47
|
-
const getSortAndPaginationInfo = {...sortInfo, ...getPagination}
|
|
57
|
+
const getSortAndPaginationInfo = { ...sortInfo, ...getPagination }
|
|
48
58
|
props.paginationInfo(getSortAndPaginationInfo);
|
|
49
59
|
};
|
|
50
60
|
|
|
@@ -60,12 +70,32 @@ export const CustomTable = (props: customTableProps) => {
|
|
|
60
70
|
|
|
61
71
|
useEffect(() => {
|
|
62
72
|
// Columns
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
73
|
+
let columns = Object.keys(dataSource?.[0]).map(key => {
|
|
74
|
+
return ({
|
|
75
|
+
title: headingTranslationsKey ? t(`${headingTranslationsKey}.${key}`) : key,
|
|
76
|
+
dataIndex: key,
|
|
77
|
+
key: key,
|
|
78
|
+
ellipsis: true,
|
|
79
|
+
})
|
|
80
|
+
});
|
|
81
|
+
|
|
82
|
+
let columnActions = {
|
|
83
|
+
title: 'Action',
|
|
84
|
+
key: 'action',
|
|
85
|
+
dataIndex: 6,
|
|
86
|
+
ellipsis: false,
|
|
87
|
+
render: () => (
|
|
88
|
+
<Space size="middle">
|
|
89
|
+
<Dropdown menu={{ items }}>
|
|
90
|
+
<a>
|
|
91
|
+
<EllipsisOutlined />
|
|
92
|
+
</a>
|
|
93
|
+
</Dropdown>
|
|
94
|
+
</Space>
|
|
95
|
+
),
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
actions && columns.push(columnActions as any);
|
|
69
99
|
|
|
70
100
|
setCustomColumns(columns);
|
|
71
101
|
|
|
@@ -113,15 +143,8 @@ export const CustomTable = (props: customTableProps) => {
|
|
|
113
143
|
dataSource={dataSource}
|
|
114
144
|
onChange={handleChange}
|
|
115
145
|
{...props}
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
<Table.Column
|
|
119
|
-
key={column.key}
|
|
120
|
-
title={headingTranslationsKey ? t(column.title as string) : column.title}
|
|
121
|
-
dataIndex={(column as any).dataIndex}
|
|
122
|
-
/>
|
|
123
|
-
))}
|
|
124
|
-
</Table>
|
|
146
|
+
columns={customColumns}
|
|
147
|
+
/>
|
|
125
148
|
</div>
|
|
126
149
|
);
|
|
127
150
|
}
|
package/src/components/index.tsx
CHANGED
package/src/constants/i18n.ts
CHANGED
|
@@ -4,19 +4,22 @@ import { initReactI18next } from "react-i18next";
|
|
|
4
4
|
import en from '../locales/en.json';
|
|
5
5
|
import es from '../locales/es.json';
|
|
6
6
|
import pt from '../locales/pt.json';
|
|
7
|
+
var merge = require('lodash.merge');
|
|
7
8
|
|
|
8
|
-
|
|
9
|
+
export const mergei18n = (appResources: any) => {
|
|
10
|
+
i18next
|
|
9
11
|
.use(initReactI18next)
|
|
10
12
|
.use(LanguageDetector)
|
|
11
13
|
.init({
|
|
12
|
-
resources: {
|
|
14
|
+
resources: merge({
|
|
13
15
|
en: { translation: en },
|
|
14
16
|
pt: { translation: pt },
|
|
15
17
|
es: { translation: es },
|
|
16
|
-
},
|
|
18
|
+
}, appResources),
|
|
17
19
|
detection: {
|
|
18
20
|
order: ['querystring', 'navigator', 'htmlTag'],
|
|
19
21
|
lookupQuerystring: 'lng',
|
|
20
22
|
htmlTag: document.documentElement,
|
|
21
23
|
},
|
|
22
24
|
});
|
|
25
|
+
}
|
package/src/index.ts
CHANGED
package/src/locales/en.json
CHANGED
package/src/locales/es.json
CHANGED
package/src/locales/pt.json
CHANGED