react-luminus-components 1.2.116 → 1.2.117

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.
@@ -60,3 +60,5 @@ export type { default as ErrorBoundaryTexts } from './texts/ErrorBoundaryTexts';
60
60
  export type { default as PromptOptions } from './types/PromptOptions';
61
61
  export type { default as DropdownPickerOption } from './types/DropdownPickerOption';
62
62
  export type { default as UserModel } from './types/UserModel';
63
+ export { default as LoginState } from './types/LoginState';
64
+ export type { default as UserLoginState } from './types/UserLoginState';
@@ -0,0 +1,7 @@
1
+ declare enum LoginState {
2
+ LOGGING_IN = 0,
3
+ LOGGED_IN = 1,
4
+ LOGGED_OUT = 2,
5
+ LOGIN_FAILED = 3
6
+ }
7
+ export default LoginState;
@@ -0,0 +1,7 @@
1
+ import LoginState from './LoginState';
2
+ import UserModel from './UserModel';
3
+ type UserLoginState = {
4
+ state: LoginState;
5
+ user: UserModel | null;
6
+ };
7
+ export default UserLoginState;
@@ -1,16 +1,16 @@
1
- import { useContext as u, useCallback as l } from "react";
2
- import { am as p, al as h } from "./NoInputContainer-BrMG0XaD.js";
1
+ import { useContext as l, useCallback as u } from "react";
2
+ import { an as p, am as h } from "./NoInputContainer-Cl1VEez2.js";
3
3
  const P = () => {
4
- const { isShown: e, text: s, showPrompt: t, hidePrompt: r, resolveRef: o, setOptions: c } = u(p), C = l((n) => {
4
+ const { isShown: e, text: s, showPrompt: t, hidePrompt: r, resolveRef: o, setOptions: c } = l(p), C = u((n) => {
5
5
  r(), o.current(n);
6
- }, [r, o]), f = l(async (n, m) => (c((i) => ({ ...i, ...m })), t(n), new Promise((i) => {
6
+ }, [r, o]), f = u(async (n, m) => (c((i) => ({ ...i, ...m })), t(n), new Promise((i) => {
7
7
  o.current = i;
8
8
  })), [o, c, t]);
9
9
  return { isShown: e, text: s, prompt: f, onFinish: C };
10
10
  };
11
11
  let a;
12
12
  const b = () => {
13
- const { show: e, text: s, showConfirm: t, hideConfirm: r } = u(h), o = () => {
13
+ const { show: e, text: s, showConfirm: t, hideConfirm: r } = l(h), o = () => {
14
14
  r();
15
15
  };
16
16
  return { confirm: async (n) => (t(n), new Promise((m) => {
@@ -1 +1 @@
1
- "use strict";const r=require("react"),f=require("./NoInputContainer-Dnr4Gmhz.cjs"),p=()=>{const{isShown:s,text:c,showPrompt:e,hidePrompt:t,resolveRef:n,setOptions:i}=r.useContext(f.PromptContext),a=r.useCallback(o=>{t(),n.current(o)},[t,n]),l=r.useCallback(async(o,u)=>(i(m=>({...m,...u})),e(o),new Promise(m=>{n.current=m})),[n,i,e]);return{isShown:s,text:c,prompt:l,onFinish:a}};let C;const h=()=>{const{show:s,text:c,showConfirm:e,hideConfirm:t}=r.useContext(f.ConfirmContext),n=()=>{t()};return{confirm:async o=>(e(o),new Promise(u=>{C=u})),onConfirm:()=>{n(),C(!0)},onCancel:()=>{n(),C(!1)},show:s,text:c}};exports.useConfirm=h;exports.usePrompt=p;
1
+ "use strict";const r=require("react"),f=require("./NoInputContainer-BxMb-BuJ.cjs"),p=()=>{const{isShown:s,text:c,showPrompt:e,hidePrompt:t,resolveRef:n,setOptions:i}=r.useContext(f.PromptContext),a=r.useCallback(o=>{t(),n.current(o)},[t,n]),l=r.useCallback(async(o,u)=>(i(m=>({...m,...u})),e(o),new Promise(m=>{n.current=m})),[n,i,e]);return{isShown:s,text:c,prompt:l,onFinish:a}};let C;const h=()=>{const{show:s,text:c,showConfirm:e,hideConfirm:t}=r.useContext(f.ConfirmContext),n=()=>{t()};return{confirm:async o=>(e(o),new Promise(u=>{C=u})),onConfirm:()=>{n(),C(!0)},onCancel:()=>{n(),C(!1)},show:s,text:c}};exports.useConfirm=h;exports.usePrompt=p;
@@ -1 +1 @@
1
- "use strict";const r=require("react"),t=require("./NoInputContainer-Dnr4Gmhz.cjs");require("./latinize-DaqzUOla.cjs");require("react-hook-form");const o=()=>{const{user:e}=r.useContext(t.UserContext);return{checkUserHasPermissions:r.useCallback(n=>n.every(i=>{var s;return(s=e==null?void 0:e.permissions)==null?void 0:s.includes(i)}),[e])}};exports.usePermissions=o;
1
+ "use strict";const r=require("react"),t=require("./NoInputContainer-BxMb-BuJ.cjs");require("./latinize-DaqzUOla.cjs");require("react-hook-form");const o=()=>{const{user:e}=r.useContext(t.UserContext);return{checkUserHasPermissions:r.useCallback(n=>n.every(i=>{var s;return(s=e==null?void 0:e.permissions)==null?void 0:s.includes(i)}),[e])}};exports.usePermissions=o;
@@ -1,5 +1,5 @@
1
1
  import { useContext as t, useCallback as i } from "react";
2
- import { aa as n } from "./NoInputContainer-BrMG0XaD.js";
2
+ import { aa as n } from "./NoInputContainer-Cl1VEez2.js";
3
3
  import "./latinize-BQrinury.js";
4
4
  import "react-hook-form";
5
5
  const k = () => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-luminus-components",
3
- "version": "1.2.116",
3
+ "version": "1.2.117",
4
4
  "description": "Library of React Components reusable in Luminus projects (Fleetman, CAFM)",
5
5
  "type": "module",
6
6
  "repository": {
@@ -1,5 +0,0 @@
1
- import { j as o, ad as t, ak as e } from "./NoInputContainer-BrMG0XaD.js";
2
- const l = ({ text: s, placement: r, children: a }) => /* @__PURE__ */ o.jsx(t, { placement: r, overlay: /* @__PURE__ */ o.jsx(e, { className: "luminus-tooltip", children: s }), children: a });
3
- export {
4
- l as S
5
- };