@bikdotai/bik-component-library 0.0.513-beta.0 → 0.0.513-beta.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.
- package/dist/cjs/components/bik-layout/MockMenus.d.ts +1 -0
- package/dist/cjs/components/variable-picker-v3/Content.d.ts +1 -0
- package/dist/cjs/components/variable-picker-v3/Content.js +1 -1
- package/dist/cjs/components/variable-picker-v3/SubHeaderItems.d.ts +1 -0
- package/dist/cjs/components/variable-picker-v3/SubHeaderItems.js +1 -1
- package/dist/cjs/components/variable-picker-v3/model.d.ts +1 -0
- package/dist/cjs/components/variable-picker-v3/recommendVaribles.js +1 -1
- package/dist/esm/components/bik-layout/MockMenus.d.ts +1 -0
- package/dist/esm/components/variable-picker-v3/Content.d.ts +1 -0
- package/dist/esm/components/variable-picker-v3/Content.js +1 -1
- package/dist/esm/components/variable-picker-v3/SubHeaderItems.d.ts +1 -0
- package/dist/esm/components/variable-picker-v3/SubHeaderItems.js +1 -1
- package/dist/esm/components/variable-picker-v3/model.d.ts +1 -0
- package/dist/esm/components/variable-picker-v3/recommendVaribles.js +1 -1
- package/package.json +1 -1
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { VariablePickerV3Props } from './model';
|
|
3
3
|
type Props = VariablePickerV3Props;
|
|
4
|
+
export declare const highlightSearchText: (text: string, searchText: string) => string | import("react/jsx-runtime").JSX.Element;
|
|
4
5
|
export declare const VariablePickerContent: React.FC<Props>;
|
|
5
6
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../_virtual/_tslib.js"),s=require("react/jsx-runtime"),t=require("../../assets/icons/arrow_back.svg.js"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../_virtual/_tslib.js"),s=require("react/jsx-runtime"),t=require("../../assets/icons/arrow_back.svg.js"),a=require("../../assets/icons/plus.svg.js"),i=require("../../assets/icons/triangle_error.svg.js"),l=require("react"),r=require("../../constants/Theme.js"),n=require("../accordion/Accordion.js"),c=require("../icon-button/IconButton.js"),o=require("../input/Input.js"),d=require("../list-item/ListItem.js"),h=require("../switch/Switch.js"),u=require("../tooltips/Tooltip.js"),j=require("../TypographyStyle.js"),g=require("./context.js"),b=require("./NoResult.js"),p=require("./recommendVaribles.js"),x=require("./searchVariables.js"),y=require("./styles.js"),m=require("./SubHeaderItems.js");const O=(e,t)=>{if(0===t.length)return e;const a=e.toLowerCase().indexOf(t.toLowerCase());if(-1===a)return e;const i=e.slice(0,a),l=e.slice(a,a+t.length),n=e.slice(a+t.length);return s.jsxs("span",{children:[i,s.jsx("b",Object.assign({style:{color:r.COLORS.content.primary}},{children:l})),n]})},f=/.*\..*/,v=e=>{if(e.actualValue.match(f)){const s=e.actualValue.replace("{{","").replace("}}","").split(".");let t=s[0];return s.forEach(((e,s)=>{if(0===s)return;const a=(e=>/\w+\[\d+\]/g.test(e))(e);if(a){const s=e.match(/(\w+)\[(\d+)\]/);if(s){const e=s[1],a=s[2];t+=`['${e}'][${a}]`}}else t+=`['${e}']`})),t}return e.actualValueEval?e.actualValueEval:e.actualValue};exports.VariablePickerContent=f=>{const{data:S,onSelect:C,showHeader:w,showBackButton:R,onBackButtonClick:V,isEvaluationList:k}=f,[q,L]=l.useState(S),[B,I]=l.useState(""),[T,N]=l.useState([]),[_,P]=l.useState(""),[E,H]=l.useState(!1),[$,A]=l.useState([]);l.useEffect((()=>{W(!0)}),[]),l.useEffect((()=>{T.length>0?A([T[T.length-1]]):A(S)}),[T]);const W=s=>e.__awaiter(void 0,void 0,void 0,(function*(){if(H(s),s){const e=p.showOnlyRecommendedVariables(q,T);L(e)}else if(T.length>0){const e=_==T[T.length-1].displayName;if(B.length>0&&e){const e=x.searchVariables(B,$,T);L(e)}else L([T[T.length-1].variables])}else if(B.length>0){const e=x.searchVariables(B,$,T);L(e)}else L(S)})),z=e=>{let s=104;return T.length>0&&(s+=54),`calc(${e}px - ${s}px)`};return s.jsx(g.VariablePickerContext.Provider,Object.assign({value:{variables:q,searchText:B,subHeaderStack:T,showRecommended:E,setSubHeaderStack:N,setSearchText:I,setVariables:L,setShowRecommended:H}},{children:s.jsxs("div",Object.assign({tabIndex:-1,id:"variable-picker-v3",style:{backgroundColor:"white",borderRadius:4},onClick:e=>e.stopPropagation()},{children:[(w||R)&&s.jsxs(y.HeaderWrapper,{children:[R&&s.jsx(c.IconButton,{Icon:()=>s.jsx(t.default,{width:16,height:16,style:{display:"flex",color:r.COLORS.content.primary}}),onClick:V}),w&&s.jsx(j.TitleRegular,{children:"Select Variable"})]}),s.jsx("div",Object.assign({style:{padding:"0 16px",paddingTop:12,backgroundColor:r.COLORS.surface.subdued}},{children:s.jsx(o.Input,{id:"search-bar-v3-picker",onBlur:e=>{f.onSearchBlur&&f.onSearchBlur(e)},value:B,noKeyDownChange:!0,placeholder:"Search",onChangeText:e=>{e||P("");const s=x.searchVariables(e,$,T);if(E){const e=p.showOnlyRecommendedVariables(s,T);L(e)}else L(s);I(e);const t=T.length>0?T[T.length-1].displayName:"home";P(t)}})})),s.jsxs(y.RecommendWrapper,{children:[s.jsx(j.BodySecondary,Object.assign({style:{color:r.COLORS.content.secondary}},{children:"Only Recommended"})),s.jsx(h.Switch,{value:E,onValueChange:s=>e.__awaiter(void 0,void 0,void 0,(function*(){yield W(s)}))})]}),T.length>0&&s.jsxs(y.BackHeader,{children:[s.jsx("div",Object.assign({style:{position:"absolute",left:16}},{children:s.jsx(c.IconButton,{id:"back-btn-v3",style:{display:"flex"},Icon:()=>s.jsx(t.default,{width:12,height:12,style:{color:r.COLORS.content.secondary}}),onClick:e=>{e.stopPropagation();let s=B;const t=[...T],a=t.pop();if(N(t),a.displayName===_&&(I(""),s=""),s.length>0){const e=t.length>0?[t[t.length-1]]:S,a=x.searchVariables(s,e,t);if(E){const e=p.showOnlyRecommendedVariables(a,t);L(e)}else L(a)}else if(t.length>0)if(E){const e=p.showOnlyRecommendedVariables([t[t.length-1].variables],t);L(e)}else L([t[t.length-1].variables]);else if(E){const e=p.showOnlyRecommendedVariables(S,T);L(e)}else L(S)}})})),s.jsx(j.BodyCaption,Object.assign({style:{color:r.COLORS.content.secondary}},{children:T[T.length-1].displayName}))]}),s.jsx(s.Fragment,{children:q.length>0?s.jsx(y.Container,Object.assign({height:z(500)},{children:q.map(((e,t)=>e.displayName&&void 0!==e.variables?s.jsx("div",Object.assign({style:{borderBottom:`1px solid ${r.COLORS.stroke.primary}`}},{children:s.jsx(n.BikAccordion,Object.assign({headerPadding:"12px 16px",header:s.jsx(j.TitleSmall,Object.assign({style:{color:r.COLORS.content.secondary}},{children:O(e.displayName,B)}))},{children:s.jsx(m.default,{searchText:B,variable:e.variables,onSelect:C})}))}),t):e.displayName?s.jsx(d.ListItem,{version:"2.0",leadingIcon:s.jsx(a.default,{width:14,height:14}),customListItemLabel:s.jsxs("div",Object.assign({style:{display:"flex",alignItems:"center",gap:4}},{children:[s.jsx(j.BodySecondary,Object.assign({style:{fontSize:"14px",color:r.COLORS.text.primary}},{children:O(e.displayName,B)})),!e.isAvailable&&s.jsx(u.Tooltip,Object.assign({body:"Not Recommended"},{children:s.jsx("div",Object.assign({style:{display:"flex"}},{children:s.jsx(i.default,{width:16,height:16,color:r.COLORS.content.secondary})}))}))]})),listItem:{label:e.displayName,value:e.displayName},subText:e.description||"",onClick:()=>{if(k){const s=v(e);C(Object.assign(Object.assign({},e),{actualValue:s}))}else C(e)}},t):s.jsx(m.default,{searchText:B,variable:e,onSelect:e=>{if(k){const s=v(e);C(Object.assign(Object.assign({},e),{actualValue:s}))}else C(e)}},t)))})):s.jsx(b.default,{height:z(500),searchText:B})})]}))}))},exports.highlightSearchText=O;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),s=require("../../assets/icons/chevronRight.svg.js"),t=require("../../assets/icons/plus.svg.js"),i=require("../../assets/icons/sub_category.svg.js"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),s=require("../../assets/icons/chevronRight.svg.js"),t=require("../../assets/icons/plus.svg.js"),i=require("../../assets/icons/sub_category.svg.js"),r=require("../../assets/icons/triangle_error.svg.js"),a=require("../../constants/Theme.js"),l=require("../list-item/ListItem.js"),o=require("../tooltips/Tooltip.js"),n=require("../TypographyStyle.js"),c=require("./Content.js"),d=require("./context.js"),h=require("./recommendVaribles.js");exports.default=j=>{const{onSelect:u,variable:m,searchText:x}=j,{subHeaderStack:g,setSubHeaderStack:y,setVariables:b,showRecommended:p}=d.useVariablePickerContext();return e.jsx(e.Fragment,{children:Object.keys(m).map(((d,j)=>void 0===m[d].variables?e.jsx(l.ListItem,{version:"2.0",leadingIcon:e.jsx(t.default,{width:14,height:14}),customListItemLabel:e.jsxs("div",Object.assign({style:{display:"flex",alignItems:"center",gap:4}},{children:[e.jsx(n.BodySecondary,Object.assign({style:{fontSize:"14px",color:a.COLORS.text.primary}},{children:c.highlightSearchText(m[d].displayName,x)})),!m[d].isAvailable&&e.jsx(o.Tooltip,Object.assign({body:"Not Recommended"},{children:e.jsx("div",Object.assign({style:{display:"flex"}},{children:e.jsx(r.default,{width:16,height:16,color:a.COLORS.content.secondary})}))}))]})),listItem:{label:m[d].displayName,value:m[d].displayName},subText:m[d].description||"",onClick:()=>{u(m[d])}},j):e.jsx(l.ListItem,{version:"2.0",listItem:{label:m[d].displayName,value:m[d].displayName},customListItemLabel:e.jsx("div",Object.assign({style:{display:"flex",alignItems:"center"}},{children:e.jsx(n.BodySecondary,Object.assign({style:{fontSize:"14px",color:a.COLORS.text.primary}},{children:c.highlightSearchText(m[d].displayName,x)}))})),leadingIcon:e.jsx(i.default,{width:14,height:14}),subText:m[d].description||"",trailingIcon:e.jsx(s.default,{width:10,height:10,color:"#212121"}),onClick:()=>{const e=[...g,m[d]];if(y(e),p){const s=h.showOnlyRecommendedVariables([m[d].variables],e);b(s)}else b([m[d].variables])}},j)))})};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});const e=e=>Object.keys(e).reduce(((s,a)=>(e[a]&&e[a].isAvailable&&(s[a]=e[a]),s)),{});exports.showOnlyRecommendedVariables=(s,a)=>s.map((s=>{if(s.isAvailable&&void 0===s.variables)return s;if(void 0===s.isAvailable&&void 0!==s.variables){const a=e(s.variables);return Object.assign(Object.assign({},s),{variables:a})}if(void 0===s.variables){return e(s)}{const i=e(s.variables);return a.length?i:Object.assign(Object.assign({},s),{variables:i})}})).filter((e=>Object.keys(e).length>0));
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});const e=e=>Object.keys(e).reduce(((s,a)=>(e[a]&&e[a].isAvailable&&(s[a]=e[a]),s)),{});exports.showOnlyRecommendedVariables=(s,a)=>s.map((s=>{if(s.isAvailable&&void 0===s.variables)return s;if(void 0===s.isAvailable&&void 0!==s.variables){const a=e(s.variables);return 0===Object.keys(a).length?{}:Object.assign(Object.assign({},s),{variables:a})}if(void 0===s.variables){return e(s)}{const i=e(s.variables);return a.length?i:Object.assign(Object.assign({},s),{variables:i})}})).filter((e=>Object.keys(e).length>0));
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { VariablePickerV3Props } from './model';
|
|
3
3
|
type Props = VariablePickerV3Props;
|
|
4
|
+
export declare const highlightSearchText: (text: string, searchText: string) => string | import("react/jsx-runtime").JSX.Element;
|
|
4
5
|
export declare const VariablePickerContent: React.FC<Props>;
|
|
5
6
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__awaiter as e}from"../../_virtual/_tslib.js";import{jsx as t,jsxs as
|
|
1
|
+
import{__awaiter as e}from"../../_virtual/_tslib.js";import{jsx as t,jsxs as s,Fragment as i}from"react/jsx-runtime";import o from"../../assets/icons/arrow_back.svg.js";import l from"../../assets/icons/plus.svg.js";import n from"../../assets/icons/triangle_error.svg.js";import{useState as a,useEffect as r}from"react";import{COLORS as c}from"../../constants/Theme.js";import{BikAccordion as d}from"../accordion/Accordion.js";import{IconButton as h}from"../icon-button/IconButton.js";import{Input as m}from"../input/Input.js";import{ListItem as p}from"../list-item/ListItem.js";import{Switch as g}from"../switch/Switch.js";import{Tooltip as u}from"../tooltips/Tooltip.js";import{TitleRegular as b,BodySecondary as f,BodyCaption as y,TitleSmall as v}from"../TypographyStyle.js";import{VariablePickerContext as j}from"./context.js";import x from"./NoResult.js";import{showOnlyRecommendedVariables as O}from"./recommendVaribles.js";import{searchVariables as w}from"./searchVariables.js";import{HeaderWrapper as k,RecommendWrapper as S,BackHeader as C,Container as N}from"./styles.js";import V from"./SubHeaderItems.js";const I=(e,i)=>{if(0===i.length)return e;const o=e.toLowerCase().indexOf(i.toLowerCase());if(-1===o)return e;const l=e.slice(0,o),n=e.slice(o,o+i.length),a=e.slice(o+i.length);return s("span",{children:[l,t("b",Object.assign({style:{color:c.content.primary}},{children:n})),a]})},T=/.*\..*/,B=e=>{if(e.actualValue.match(T)){const t=e.actualValue.replace("{{","").replace("}}","").split(".");let s=t[0];return t.forEach(((e,t)=>{if(0===t)return;const i=(e=>/\w+\[\d+\]/g.test(e))(e);if(i){const t=e.match(/(\w+)\[(\d+)\]/);if(t){const e=t[1],i=t[2];s+=`['${e}'][${i}]`}}else s+=`['${e}']`})),s}return e.actualValueEval?e.actualValueEval:e.actualValue},L=T=>{const{data:L,onSelect:R,showHeader:$,showBackButton:E,onBackButtonClick:H,isEvaluationList:P}=T,[_,A]=a(L),[z,D]=a(""),[K,q]=a([]),[F,G]=a(""),[J,M]=a(!1),[Q,U]=a([]);r((()=>{W(!0)}),[]),r((()=>{K.length>0?U([K[K.length-1]]):U(L)}),[K]);const W=t=>e(void 0,void 0,void 0,(function*(){if(M(t),t){const e=O(_,K);A(e)}else if(K.length>0){const e=F==K[K.length-1].displayName;if(z.length>0&&e){const e=w(z,Q,K);A(e)}else A([K[K.length-1].variables])}else if(z.length>0){const e=w(z,Q,K);A(e)}else A(L)})),X=e=>{let t=104;return K.length>0&&(t+=54),`calc(${e}px - ${t}px)`};return t(j.Provider,Object.assign({value:{variables:_,searchText:z,subHeaderStack:K,showRecommended:J,setSubHeaderStack:q,setSearchText:D,setVariables:A,setShowRecommended:M}},{children:s("div",Object.assign({tabIndex:-1,id:"variable-picker-v3",style:{backgroundColor:"white",borderRadius:4},onClick:e=>e.stopPropagation()},{children:[($||E)&&s(k,{children:[E&&t(h,{Icon:()=>t(o,{width:16,height:16,style:{display:"flex",color:c.content.primary}}),onClick:H}),$&&t(b,{children:"Select Variable"})]}),t("div",Object.assign({style:{padding:"0 16px",paddingTop:12,backgroundColor:c.surface.subdued}},{children:t(m,{id:"search-bar-v3-picker",onBlur:e=>{T.onSearchBlur&&T.onSearchBlur(e)},value:z,noKeyDownChange:!0,placeholder:"Search",onChangeText:e=>{e||G("");const t=w(e,Q,K);if(J){const e=O(t,K);A(e)}else A(t);D(e);const s=K.length>0?K[K.length-1].displayName:"home";G(s)}})})),s(S,{children:[t(f,Object.assign({style:{color:c.content.secondary}},{children:"Only Recommended"})),t(g,{value:J,onValueChange:t=>e(void 0,void 0,void 0,(function*(){yield W(t)}))})]}),K.length>0&&s(C,{children:[t("div",Object.assign({style:{position:"absolute",left:16}},{children:t(h,{id:"back-btn-v3",style:{display:"flex"},Icon:()=>t(o,{width:12,height:12,style:{color:c.content.secondary}}),onClick:e=>{e.stopPropagation();let t=z;const s=[...K],i=s.pop();if(q(s),i.displayName===F&&(D(""),t=""),t.length>0){const e=s.length>0?[s[s.length-1]]:L,i=w(t,e,s);if(J){const e=O(i,s);A(e)}else A(i)}else if(s.length>0)if(J){const e=O([s[s.length-1].variables],s);A(e)}else A([s[s.length-1].variables]);else if(J){const e=O(L,K);A(e)}else A(L)}})})),t(y,Object.assign({style:{color:c.content.secondary}},{children:K[K.length-1].displayName}))]}),t(i,{children:_.length>0?t(N,Object.assign({height:X(500)},{children:_.map(((e,i)=>e.displayName&&void 0!==e.variables?t("div",Object.assign({style:{borderBottom:`1px solid ${c.stroke.primary}`}},{children:t(d,Object.assign({headerPadding:"12px 16px",header:t(v,Object.assign({style:{color:c.content.secondary}},{children:I(e.displayName,z)}))},{children:t(V,{searchText:z,variable:e.variables,onSelect:R})}))}),i):e.displayName?t(p,{version:"2.0",leadingIcon:t(l,{width:14,height:14}),customListItemLabel:s("div",Object.assign({style:{display:"flex",alignItems:"center",gap:4}},{children:[t(f,Object.assign({style:{fontSize:"14px",color:c.text.primary}},{children:I(e.displayName,z)})),!e.isAvailable&&t(u,Object.assign({body:"Not Recommended"},{children:t("div",Object.assign({style:{display:"flex"}},{children:t(n,{width:16,height:16,color:c.content.secondary})}))}))]})),listItem:{label:e.displayName,value:e.displayName},subText:e.description||"",onClick:()=>{if(P){const t=B(e);R(Object.assign(Object.assign({},e),{actualValue:t}))}else R(e)}},i):t(V,{searchText:z,variable:e,onSelect:e=>{if(P){const t=B(e);R(Object.assign(Object.assign({},e),{actualValue:t}))}else R(e)}},i)))})):t(x,{height:X(500),searchText:z})})]}))}))};export{L as VariablePickerContent,I as highlightSearchText};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e,Fragment as s,jsxs as t}from"react/jsx-runtime";import i from"../../assets/icons/chevronRight.svg.js";import o from"../../assets/icons/plus.svg.js";import r from"../../assets/icons/sub_category.svg.js";import a from"../../assets/icons/triangle_error.svg.js";import{COLORS as l}from"../../constants/Theme.js";import{ListItem as n}from"../list-item/ListItem.js";import{Tooltip as c}from"../tooltips/Tooltip.js";import{BodySecondary as m}from"../TypographyStyle.js";import{
|
|
1
|
+
import{jsx as e,Fragment as s,jsxs as t}from"react/jsx-runtime";import i from"../../assets/icons/chevronRight.svg.js";import o from"../../assets/icons/plus.svg.js";import r from"../../assets/icons/sub_category.svg.js";import a from"../../assets/icons/triangle_error.svg.js";import{COLORS as l}from"../../constants/Theme.js";import{ListItem as n}from"../list-item/ListItem.js";import{Tooltip as c}from"../tooltips/Tooltip.js";import{BodySecondary as m}from"../TypographyStyle.js";import{highlightSearchText as d}from"./Content.js";import{useVariablePickerContext as p}from"./context.js";import{showOnlyRecommendedVariables as h}from"./recommendVaribles.js";const b=b=>{const{onSelect:g,variable:y,searchText:f}=b,{subHeaderStack:j,setSubHeaderStack:v,setVariables:u,showRecommended:x}=p();return e(s,{children:Object.keys(y).map(((s,p)=>void 0===y[s].variables?e(n,{version:"2.0",leadingIcon:e(o,{width:14,height:14}),customListItemLabel:t("div",Object.assign({style:{display:"flex",alignItems:"center",gap:4}},{children:[e(m,Object.assign({style:{fontSize:"14px",color:l.text.primary}},{children:d(y[s].displayName,f)})),!y[s].isAvailable&&e(c,Object.assign({body:"Not Recommended"},{children:e("div",Object.assign({style:{display:"flex"}},{children:e(a,{width:16,height:16,color:l.content.secondary})}))}))]})),listItem:{label:y[s].displayName,value:y[s].displayName},subText:y[s].description||"",onClick:()=>{g(y[s])}},p):e(n,{version:"2.0",listItem:{label:y[s].displayName,value:y[s].displayName},customListItemLabel:e("div",Object.assign({style:{display:"flex",alignItems:"center"}},{children:e(m,Object.assign({style:{fontSize:"14px",color:l.text.primary}},{children:d(y[s].displayName,f)}))})),leadingIcon:e(r,{width:14,height:14}),subText:y[s].description||"",trailingIcon:e(i,{width:10,height:10,color:"#212121"}),onClick:()=>{const e=[...j,y[s]];if(v(e),x){const t=h([y[s].variables],e);u(t)}else u([y[s].variables])}},p)))})};export{b as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=(e,i)=>e.map((e=>{if(e.isAvailable&&void 0===e.variables)return e;if(void 0===e.isAvailable&&void 0!==e.variables){const i=a(e.variables);return Object.assign(Object.assign({},e),{variables:i})}if(void 0===e.variables){return a(e)}{const s=a(e.variables);return i.length?s:Object.assign(Object.assign({},e),{variables:s})}})).filter((e=>Object.keys(e).length>0)),a=e=>Object.keys(e).reduce(((a,i)=>(e[i]&&e[i].isAvailable&&(a[i]=e[i]),a)),{});export{e as showOnlyRecommendedVariables};
|
|
1
|
+
const e=(e,i)=>e.map((e=>{if(e.isAvailable&&void 0===e.variables)return e;if(void 0===e.isAvailable&&void 0!==e.variables){const i=a(e.variables);return 0===Object.keys(i).length?{}:Object.assign(Object.assign({},e),{variables:i})}if(void 0===e.variables){return a(e)}{const s=a(e.variables);return i.length?s:Object.assign(Object.assign({},e),{variables:s})}})).filter((e=>Object.keys(e).length>0)),a=e=>Object.keys(e).reduce(((a,i)=>(e[i]&&e[i].isAvailable&&(a[i]=e[i]),a)),{});export{e as showOnlyRecommendedVariables};
|