sixseconds-modules 1.6.10 → 1.6.12

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/README.md CHANGED
@@ -1,50 +0,0 @@
1
- # React + TypeScript + Vite
2
-
3
- This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
4
-
5
- Currently, two official plugins are available:
6
-
7
- - [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react/README.md) uses [Babel](https://babeljs.io/) for Fast Refresh
8
- - [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh
9
-
10
- ## Expanding the ESLint configuration
11
-
12
- If you are developing a production application, we recommend updating the configuration to enable type aware lint rules:
13
-
14
- - Configure the top-level `parserOptions` property like this:
15
-
16
- ```js
17
- export default tseslint.config({
18
- languageOptions: {
19
- // other options...
20
- parserOptions: {
21
- project: ["./tsconfig.node.json", "./tsconfig.app.json"],
22
- tsconfigRootDir: import.meta.dirname,
23
- },
24
- },
25
- })
26
- ```
27
-
28
- - Replace `tseslint.configs.recommended` to `tseslint.configs.recommendedTypeChecked` or `tseslint.configs.strictTypeChecked`
29
- - Optionally add `...tseslint.configs.stylisticTypeChecked`
30
- - Install [eslint-plugin-react](https://github.com/jsx-eslint/eslint-plugin-react) and update the config:
31
-
32
- ```js
33
- // eslint.config.js
34
- import react from "eslint-plugin-react"
35
-
36
- export default tseslint.config({
37
- // Set the react version
38
- settings: { react: { version: "18.3" } },
39
- plugins: {
40
- // Add the react plugin
41
- react,
42
- },
43
- rules: {
44
- // other rules...
45
- // Enable its recommended rules
46
- ...react.configs.recommended.rules,
47
- ...react.configs["jsx-runtime"].rules,
48
- },
49
- })
50
- ```
@@ -1,2 +1,2 @@
1
1
  import { IHeaderProps } from './type';
2
- export declare const Header: ({ frontCustomComponent, endCustomComponents, userData, interFaceLangList, centerCustomComponents, updateInterfaceLang, selectedInterFaceLang, logoutHandler, logo, isNotification, extraMenuOptions, isMenu, isAccessAppMenu, notificationAccessApps, sx, t, }: IHeaderProps) => import("react/jsx-runtime").JSX.Element;
2
+ export declare const Header: ({ router, frontCustomComponent, endCustomComponents, userData, interFaceLangList, centerCustomComponents, updateInterfaceLang, selectedInterFaceLang, logoutHandler, logo, isNotification, extraMenuOptions, isMenu, isAccessAppMenu, notificationAccessApps, sx, t, }: IHeaderProps) => import("react/jsx-runtime").JSX.Element;
@@ -47,6 +47,7 @@ export interface IInterFaceLang {
47
47
 
48
48
  export interface IHeaderProps {
49
49
  t: t
50
+ router?: any
50
51
  notificationAccessApps?: {
51
52
  name: string
52
53
  }[]
@@ -6,6 +6,7 @@ interface IProps {
6
6
  setInitialState?: SetStateAction<IState>;
7
7
  extraMenuOptions?: any;
8
8
  t: t;
9
+ router?: any;
9
10
  }
10
- declare const UserProfile: ({ t, userData, setInitialState, extraMenuOptions }: IProps) => import("react/jsx-runtime").JSX.Element;
11
+ declare const UserProfile: ({ t, userData, setInitialState, extraMenuOptions, router }: IProps) => import("react/jsx-runtime").JSX.Element;
11
12
  export default UserProfile;
package/dist/index.cjs.js CHANGED
@@ -4273,8 +4273,15 @@ function formatDateUtil(dateString, flag, formatDate = MAIN_DATE_FORMAT) {
4273
4273
  const dateTime = hooks.utc(dateString).local();
4274
4274
  return dateString ? formatTwoValues(dateTime.format(formatDate), dateTime.format(MAIN_TIME_FORMAT)) : "";
4275
4275
  }
4276
- const UserProfile = ({ t: t2, userData, setInitialState, extraMenuOptions }) => {
4276
+ const UserProfile = ({ t: t2, userData, setInitialState, extraMenuOptions, router }) => {
4277
4277
  const [state, setState] = React.useState({ toggles: { userProfile: false } });
4278
+ const handleRedirection2 = (appName, url2) => {
4279
+ if (router && appName === APP_NAMES.sso) {
4280
+ router.push(url2);
4281
+ } else {
4282
+ window.open(url2, "_blank");
4283
+ }
4284
+ };
4278
4285
  return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
4279
4286
  /* @__PURE__ */ jsxRuntime.jsxs(
4280
4287
  material.Box,
@@ -4327,9 +4334,7 @@ const UserProfile = ({ t: t2, userData, setInitialState, extraMenuOptions }) =>
4327
4334
  direction: "row",
4328
4335
  spacing: 1,
4329
4336
  alignItems: "center",
4330
- component: material.Link,
4331
- href: SSO_ROUTES(userData?.appName).viewProfile,
4332
- target: userData?.appName === APP_NAMES.sso ? "_self" : "_blank",
4337
+ onClick: () => handleRedirection2(userData?.appName, SSO_ROUTES().viewProfile),
4333
4338
  sx: { color: "#1A1919", cursor: "pointer", textDecoration: "none" },
4334
4339
  children: [
4335
4340
  /* @__PURE__ */ jsxRuntime.jsx(SVG.CheckedPerson, {}),
@@ -4354,9 +4359,7 @@ const UserProfile = ({ t: t2, userData, setInitialState, extraMenuOptions }) =>
4354
4359
  direction: "row",
4355
4360
  spacing: 1,
4356
4361
  alignItems: "center",
4357
- component: material.Link,
4358
- href: SSO_ROUTES(userData?.appName).editProfile,
4359
- target: userData?.appName === APP_NAMES.sso ? "_self" : "_blank",
4362
+ onClick: () => handleRedirection2(userData?.appName, SSO_ROUTES().editProfile),
4360
4363
  sx: { color: "#1A1919", textDecoration: "none" },
4361
4364
  children: [
4362
4365
  /* @__PURE__ */ jsxRuntime.jsx(SVG.UserEdit, {}),
@@ -4381,9 +4384,7 @@ const UserProfile = ({ t: t2, userData, setInitialState, extraMenuOptions }) =>
4381
4384
  direction: "row",
4382
4385
  spacing: 1,
4383
4386
  alignItems: "center",
4384
- component: material.Link,
4385
- href: SSO_ROUTES(userData?.appName).changePasswordDialog,
4386
- target: userData?.appName === APP_NAMES.sso ? "_self" : "_blank",
4387
+ onClick: () => handleRedirection2(userData?.appName, SSO_ROUTES().changePasswordDialog),
4387
4388
  sx: { cursor: "pointer", textDecoration: "none" },
4388
4389
  children: [
4389
4390
  /* @__PURE__ */ jsxRuntime.jsx(SVG.CheckedPerson, {}),
@@ -5279,7 +5280,7 @@ const AppMenus = ({ menuItems, setInitialState, t: t2, appName }) => {
5279
5280
  material.Grid,
5280
5281
  {
5281
5282
  component: material.Link,
5282
- href: `${item.link}?source=${appName}`,
5283
+ href: item.link + appName === APP_NAMES.sso ? "" : `?source=${appName}`,
5283
5284
  target: item.type === "tab" ? "_self" : "_blank",
5284
5285
  item: true,
5285
5286
  md: 4,
@@ -5329,6 +5330,7 @@ const AppMenus = ({ menuItems, setInitialState, t: t2, appName }) => {
5329
5330
  )) }) }) });
5330
5331
  };
5331
5332
  const Header = ({
5333
+ router,
5332
5334
  frontCustomComponent,
5333
5335
  endCustomComponents,
5334
5336
  userData,
@@ -5481,6 +5483,7 @@ const Header = ({
5481
5483
  Boolean(userData?.fullName) && /* @__PURE__ */ jsxRuntime.jsx(
5482
5484
  UserProfile,
5483
5485
  {
5486
+ router,
5484
5487
  t,
5485
5488
  userData,
5486
5489
  initialState: state,