@equinor/amplify-component-lib 9.3.0 → 9.3.2
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e,jsxs as t,Fragment as n}from"react/jsx-runtime";import{useMemo as r}from"react";import{Menu as i}from"@equinor/eds-core-react";import{AddTagItem as m}from"./AddTagItem.js";import{NoItemsFoundText as o,NoTagFoundText as d}from"./Select.styles.js";import{flattenOptions as l,getChildOffset as s}from"./Select.utils.js";import{SelectMenuItem as c}from"./SelectMenuItem.js";const a=a=>{const{search:h,items:f,itemRefs:u,onItemKeyDown:p,onSearchFilter:g}=a,I=r((()=>{if(""===h)return f;const e=new RegExp(h.trim(),"i");return l(f).filter((t=>void 0!==g?g(h,t):t.label.match(e)))}),[f,g,h]);if(0===I.length
|
|
1
|
+
import{jsx as e,jsxs as t,Fragment as n}from"react/jsx-runtime";import{useMemo as r}from"react";import{Menu as i}from"@equinor/eds-core-react";import{AddTagItem as m}from"./AddTagItem.js";import{NoItemsFoundText as o,NoTagFoundText as d}from"./Select.styles.js";import{flattenOptions as l,getChildOffset as s}from"./Select.utils.js";import{SelectMenuItem as c}from"./SelectMenuItem.js";const a=a=>{const{search:h,items:f,itemRefs:u,onItemKeyDown:p,onSearchFilter:g}=a,I=r((()=>{if(""===h)return f;const e=new RegExp(h.trim(),"i");return l(f).filter((t=>void 0!==g?g(h,t):t.label.match(e)))}),[f,g,h]);if(0===I.length&&(!a.onAddItem||""===h))return e(o,{children:"No items found"});const x=I.some((e=>e.children&&e.children.length>0)),A=I.map(((e,t)=>({childOffset:s(I,t),index:t,item:e,itemValue:e.value,parentHasNestedItems:x,...a})));return"onAddItem"in a&&a.onAddItem&&""!==h&&(1===I.length&&I.at(0)?.label.toLowerCase()!==h.trim().toLowerCase()||1!==I.length)?t(n,{children:[e(i.Section,{title:"Add tag",index:0,children:e(m,{index:0,itemRefs:u,onItemKeyDown:p,onAddItem:a.onAddItem,children:h})}),e(i.Section,{title:"Tag search results",index:1,children:A.length>0?A.map(((t,n)=>e(c,{...t,index:n+1},`menu-item-${n}-${t.item.value}`))):t(d,{children:['No tag for "',h,'" found.']})})]}):A.map(((t,n)=>e(c,{...t,index:n},`menu-item-${n}-${t.item.value}`)))};export{a as ListSelectMenu};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { FC } from 'react';
|
|
2
2
|
import { MyTutorialDto } from '@equinor/subsurface-app-management';
|
|
3
3
|
interface TutorialItemProps extends MyTutorialDto {
|
|
4
|
-
onTutorialStart: (tutorialId: string) => void;
|
|
5
4
|
onClose: () => void;
|
|
5
|
+
onTutorialStart?: (tutorialId: string) => void;
|
|
6
6
|
}
|
|
7
7
|
export declare const TutorialItem: FC<TutorialItemProps>;
|
|
8
8
|
export {};
|
|
@@ -18,4 +18,4 @@ import{jsxs as r,jsx as t}from"react/jsx-runtime";import{Icon as i,Typography as
|
|
|
18
18
|
&:hover {
|
|
19
19
|
background: ${m.interactive.primary__hover_alt.rgba};
|
|
20
20
|
}
|
|
21
|
-
`,d=({onTutorialStart:s,onClose:l,id:c,name:d})=>{const{startTutorial:g,seenTutorialIDs:u}=n(),f=u.includes(c);return r(p,{onClick:()=>{g(c),s(c),l()},children:[f&&r("header",{children:[t(i,{data:o,size:16,color:m.interactive.primary__resting.rgba}),t(a,{varinat:"caption",children:"COMPLETED"})]}),t(a,{variant:"h4",children:d}),t(i,{data:e,color:m.interactive.primary__resting.rgba})]})};export{d as TutorialItem};
|
|
21
|
+
`,d=({onTutorialStart:s,onClose:l,id:c,name:d})=>{const{startTutorial:g,seenTutorialIDs:u}=n(),f=u.includes(c);return r(p,{onClick:()=>{g(c),s?.(c),l()},children:[f&&r("header",{children:[t(i,{data:o,size:16,color:m.interactive.primary__resting.rgba}),t(a,{varinat:"caption",children:"COMPLETED"})]}),t(a,{variant:"h4",children:d}),t(i,{data:e,color:m.interactive.primary__resting.rgba})]})};export{d as TutorialItem};
|