@equinor/amplify-component-lib 8.17.5 → 8.18.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.
|
@@ -22,6 +22,7 @@ export interface OptionDrawerProps<T extends {
|
|
|
22
22
|
openAll?: boolean;
|
|
23
23
|
showIntermediateParent?: boolean;
|
|
24
24
|
parentHasNestedItems?: boolean;
|
|
25
|
+
disabled?: boolean;
|
|
25
26
|
}
|
|
26
27
|
export declare const OptionDrawer: {
|
|
27
28
|
<T extends {
|
|
@@ -29,6 +30,6 @@ export declare const OptionDrawer: {
|
|
|
29
30
|
label: string;
|
|
30
31
|
parentId?: string;
|
|
31
32
|
children?: T[];
|
|
32
|
-
}>({ item, onToggle, section, selectedItems, singleSelect, siblings, animateCheck, animateUncheck, animateParent, openAll, showIntermediateParent, parentHasNestedItems, }: OptionDrawerProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
33
|
+
}>({ item, onToggle, section, selectedItems, singleSelect, siblings, animateCheck, animateUncheck, animateParent, openAll, showIntermediateParent, parentHasNestedItems, disabled, }: OptionDrawerProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
33
34
|
displayName: string;
|
|
34
35
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsxs as e,jsx as t}from"react/jsx-runtime";import{useState as n,useEffect as i}from"react";import{Button as r,Checkbox as
|
|
1
|
+
import{jsxs as e,jsx as t}from"react/jsx-runtime";import{useState as n,useEffect as i}from"react";import{Button as r,Checkbox as d}from"@equinor/eds-core-react";import{chevron_down as o,chevron_right as a}from"@equinor/eds-icons";import{StyledOptionWrapper as l,StyledOptionItem as c,StyledIcon as s,StyledOption as E}from"./OptionDrawer.styles.js";const m=e=>{if(0===e.length)return[];let t=[];return e.forEach((e=>{const n=m(e?.children??[]);t=[e,...t,...n]})),t},h=(e,t,n,i)=>{if(void 0!==t.find((t=>t.id===e.id)))return"CHECKED";if(void 0===e.children||0===e.children.length||n&&!i)return"NONE";const r=m(e?.children).map((e=>void 0!==t.find((t=>t.id===e.id))));return!n&&r.every(Boolean)?"CHECKED":r.every((e=>!e))?"NONE":"INTERMEDIATE"},p=({item:m,onToggle:g,section:C=0,selectedItems:N=[],singleSelect:f=!1,siblings:D,animateCheck:u,animateUncheck:I,animateParent:T,openAll:v,showIntermediateParent:H=!1,parentHasNestedItems:O=!1,disabled:K=!1})=>{const[k,y]=n(!1),[A,$]=n(h(m,N,f,H)),[w,b]=n(!1);i((()=>{$(h(m,N,f,H))}),[m,N,f,H]),i((()=>{y(!!v)}),[v]);const M=e=>{const t=0===m.children?.length||f||void 0===m.children?[m]:[...m.children];"CHECKED"===A?(g({items:t,toggle:!1,event:e}),y(!1)):"NONE"!==A&&"INTERMEDIATE"!==A||(g({items:t,toggle:!0,event:e}),y(!0)),b(!1)},P=(e,t)=>{t&&T?(T(!0),$("CHECKED"===A?"NONE":"CHECKED"),setTimeout((()=>{M(e)}),400)):D?M(e):(b(!0),$("CHECKED"===A?"NONE":"CHECKED"),setTimeout((()=>{M(e)}),400))},R=e=>{if(D&&T){const t=N.filter((e=>e.id.includes(m.parentId??""))).length;if(!e&&u&&t===D-1)return!0;if(e&&I&&1===t)return!0}return!1},S=e=>{"CHECKED"===A&&I?P(e,R(!0)):"NONE"!==A&&"INTERMEDIATE"!==A||!u?M(e):P(e,R(!1))},j=m.children&&0!==m.children.length;return e(l,{$section:C,$animationActive:w,"data-testid":w?"animated-"+m.id:m.id,children:[e(c,{$paddedLeft:O&&!j,children:[j&&t(r,{variant:"ghost_icon",onClick:()=>{y((e=>!e))},"data-testid":"chevron-toggler-option-drawer",children:t(s,{data:k?o:a})}),e(E,{$section:C,onClick:e=>{K||(m.children&&0!==m.children.length&&y((e=>!e)),S(e))},children:[t(d,{indeterminate:"INTERMEDIATE"===A,checked:"CHECKED"===A,color:"secondary"}),m.label]})]}),k&&m.children?.map((e=>t(p,{section:C+1,onToggle:g,selectedItems:N,item:e,singleSelect:f,siblings:m.children?.length,animateCheck:u,animateUncheck:I,animateParent:b,openAll:v,showIntermediateParent:H,parentHasNestedItems:!0,disabled:K},`OptionDrawer-${e.id}`)))]},w?`animated-StyledOptionWrapper-${m.id}`:`StyledOptionWrapper-${m.id}`)};p.displayName="OptionDrawer";export{p as OptionDrawer};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsxs as r,jsx as o}from"react/jsx-runtime";import"react";import"../../../molecules/RichTextEditor/custom-extensions/AmplifyKit.js";import"../../../molecules/RichTextEditor/RichTextEditor.types.js";import"../../../_virtual/lodash.js";import"@equinor/subsurface-app-management";import"@microsoft/signalr";import"@tanstack/react-query";import"../../../atoms/enums/Environment.js";import{environment as t}from"../../../atoms/utils/auth_environment.js";import"../../TopBar/Notifications/NotificationProvider.js";import"../../../providers/AuthProvider/AuthProvider.js";import"../../../providers/ReleaseNotesProvider.js";import"../../../providers/SideBarProvider.js";import"../../../providers/SnackbarProvider/SnackbarProvider.js";import"../../../providers/StepperProvider.js";import"../../../providers/TableOfContentsProvider.js";import"../../../providers/ThemeProvider/ThemeProvider.js";import"../../../providers/TutorialStepsProvider.js";import"../../../atoms/style/colors.js";import"../../../atoms/enums/Errors.js";import"../../../atoms/enums/Theme.js";import"../../../atoms/enums/SpacingsMode.js";import"../../../deprecated/ErrorPage/illustrations/GlitchAnimation.js";import"../../../deprecated/ErrorPage/illustrations/QuestioningAnimation.js";import"proj4";import"html2canvas";import{Status as e}from"../index.js";const i=()=>{const i=t.getAppName(import.meta.env.VITE_NAME);return r(e,{children:[o(e.Title,{title:`You don't have access to ${i}`}),o(e.Description,{text:"You can apply for acces to the app in AccessIT"}),o(e.Action,{onClick:()=>{window.open(`https://
|
|
1
|
+
import{jsxs as r,jsx as o}from"react/jsx-runtime";import"react";import"../../../molecules/RichTextEditor/custom-extensions/AmplifyKit.js";import"../../../molecules/RichTextEditor/RichTextEditor.types.js";import"../../../_virtual/lodash.js";import"@equinor/subsurface-app-management";import"@microsoft/signalr";import"@tanstack/react-query";import"../../../atoms/enums/Environment.js";import{environment as t}from"../../../atoms/utils/auth_environment.js";import"../../TopBar/Notifications/NotificationProvider.js";import"../../../providers/AuthProvider/AuthProvider.js";import"../../../providers/ReleaseNotesProvider.js";import"../../../providers/SideBarProvider.js";import"../../../providers/SnackbarProvider/SnackbarProvider.js";import"../../../providers/StepperProvider.js";import"../../../providers/TableOfContentsProvider.js";import"../../../providers/ThemeProvider/ThemeProvider.js";import"../../../providers/TutorialStepsProvider.js";import"../../../atoms/style/colors.js";import"../../../atoms/enums/Errors.js";import"../../../atoms/enums/Theme.js";import"../../../atoms/enums/SpacingsMode.js";import"../../../deprecated/ErrorPage/illustrations/GlitchAnimation.js";import"../../../deprecated/ErrorPage/illustrations/QuestioningAnimation.js";import"proj4";import"html2canvas";import{Status as e}from"../index.js";const i=()=>{const i=t.getAppName(import.meta.env.VITE_NAME);return r(e,{children:[o(e.Title,{title:`You don't have access to ${i}`}),o(e.Description,{text:"You can apply for acces to the app in AccessIT"}),o(e.Action,{onClick:()=>{window.open(`https://accessit.equinor.com/Search/Search?term=${encodeURIComponent(i)}`,"_blank")},buttonText:"Apply for access"})]})};export{i as MissingAccessToApp};
|