@antscorp/antsomi-ui 1.3.5-beta.754 → 1.3.5-beta.756

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.
@@ -12,6 +12,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
12
12
  import axios from 'axios';
13
13
  import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';
14
14
  import { CookiesProvider, useCookies } from 'react-cookie';
15
+ import { useInView } from 'react-intersection-observer';
15
16
  // Icons
16
17
  import { Button, Flex, Popover, Spin, Text, Typography } from '../../atoms';
17
18
  import { AccountProfile } from '../AccountProfile';
@@ -34,8 +35,16 @@ import { ENV } from '@antscorp/antsomi-ui/es/config';
34
35
  // };
35
36
  const InputSearch = props => {
36
37
  const { value, onChange, className, onClickRemove } = props;
37
- return (React.createElement(InputSearchStyled, { className: className || '' },
38
- React.createElement("input", { className: "input-search-account", placeholder: "Search...", value: value, onChange: e => onChange(e.target.value) }),
38
+ const inputRef = useRef(null);
39
+ const { ref: wrapperRef, inView: componentInView } = useInView();
40
+ useEffect(() => {
41
+ var _a;
42
+ if (componentInView) {
43
+ (_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.focus();
44
+ }
45
+ }, [componentInView]);
46
+ return (React.createElement(InputSearchStyled, { className: className || '', ref: wrapperRef },
47
+ React.createElement("input", { className: "input-search-account", placeholder: "Search...", value: value, onChange: e => onChange(e.target.value), ref: inputRef }),
39
48
  value ? (React.createElement(CloseIcon, { className: "remove-icon", onClick: onClickRemove })) : (React.createElement(SearchIcon, { className: "search-icon" }))));
40
49
  };
41
50
  export const AccountSharing = props => {
@@ -25,9 +25,6 @@ import { THEME } from '@antscorp/antsomi-ui/es/constants';
25
25
  // Style
26
26
  import '@antscorp/antsomi-ui/es/assets/css/main.scss';
27
27
  import { GlobalStyle } from './GlobalStyle';
28
- // Initialize languages
29
- // import '@antscorp/antsomi-ui/es/locales/i18n';
30
- import i18next from '@antscorp/antsomi-ui/es/locales/i18n';
31
28
  import 'animate.css';
32
29
  import { AppConfigProvider } from '../AppConfigProvider';
33
30
  // Hooks
@@ -82,11 +79,11 @@ const ConfigProvider = props => {
82
79
  characterDataOldValue: true,
83
80
  });
84
81
  // Effects
85
- useEffect(() => {
86
- if (locale) {
87
- i18next.changeLanguage(locale);
88
- }
89
- }, [locale]);
82
+ // useEffect(() => {
83
+ // if (locale) {
84
+ // i18next.changeLanguage(locale);
85
+ // }
86
+ // }, [locale]);
90
87
  useEffect(() => {
91
88
  const containers = document.getElementsByClassName('antsomi-scroll-box');
92
89
  handleScrollAction(Array.from(containers));
@@ -1,4 +1,5 @@
1
1
  import { useQuery } from '@tanstack/react-query';
2
+ import i18next from '@antscorp/antsomi-ui/es/locales/i18n';
2
3
  // Services
3
4
  import { userServices } from '../../services/User';
4
5
  import { PORTAL_KEYS, QUERY_KEYS } from '../../constants';
@@ -9,5 +10,6 @@ export const useGetLoggedUser = (params) => {
9
10
  UserAndPortalDefaultConfig.setPartial({
10
11
  [PORTAL_KEYS.USER_LANGUAGE]: data.language,
11
12
  });
13
+ i18next.changeLanguage(`${data.language || 'en'}`.toLowerCase());
12
14
  } }, options));
13
15
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@antscorp/antsomi-ui",
3
- "version": "1.3.5-beta.754",
3
+ "version": "1.3.5-beta.756",
4
4
  "description": "An enterprise-class UI design language and React UI library.",
5
5
  "sideEffects": [
6
6
  "dist/*",