@bikdotai/bik-component-library 0.0.581-aidd-beta.16 → 0.0.581-aidd-beta.18
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/dropdown/Common.styled.d.ts +1 -0
- package/dist/cjs/components/dropdown/Common.styled.js +8 -6
- package/dist/cjs/components/dropdown/DropdownPopover/index.d.ts +1 -0
- package/dist/cjs/components/dropdown/DropdownPopover/index.js +1 -1
- package/dist/esm/components/dropdown/Common.styled.d.ts +1 -0
- package/dist/esm/components/dropdown/Common.styled.js +6 -4
- package/dist/esm/components/dropdown/DropdownPopover/index.d.ts +1 -0
- package/dist/esm/components/dropdown/DropdownPopover/index.js +1 -1
- package/package.json +1 -1
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export declare const OverLapAbs: import("styled-components").StyledComponent<"div", any, {
|
|
2
2
|
disabled?: boolean | undefined;
|
|
3
|
+
allowEvents?: boolean | undefined;
|
|
3
4
|
}, never>;
|
|
4
5
|
export declare const OpenDropdownContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
5
6
|
export declare const LoadingContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
@@ -1,15 +1,17 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("styled-components"),t=require("../../constants/Theme.js");function
|
|
2
|
-
position:
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("styled-components"),t=require("../../constants/Theme.js");function i(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var r=i(e);const o=r.default.div`
|
|
2
|
+
position:
|
|
3
|
+
// if allowEvents is true, then position is relative, else position is absolute
|
|
4
|
+
${e=>(null==e?void 0:e.allowEvents)?"relative":"absolute"};
|
|
3
5
|
left: 0px;
|
|
4
6
|
top: 0px;
|
|
5
7
|
width: 100%;
|
|
6
8
|
height: 100%;
|
|
7
9
|
z-index: 2;
|
|
8
10
|
cursor: ${e=>(null==e?void 0:e.disabled)?"not-allowed":"pointer"};
|
|
9
|
-
`,p=
|
|
11
|
+
`,p=r.default.div`
|
|
10
12
|
margin-top: 8px;
|
|
11
13
|
margin-bottom: 8px;
|
|
12
|
-
`;
|
|
14
|
+
`;r.default.div`
|
|
13
15
|
display: flex;
|
|
14
16
|
flex-direction: row;
|
|
15
17
|
align-items: center;
|
|
@@ -17,7 +19,7 @@
|
|
|
17
19
|
background: ${t.COLORS.surface.hovered};
|
|
18
20
|
border: 1px solid ${t.COLORS.stroke.primary};
|
|
19
21
|
border-radius: 4px;
|
|
20
|
-
`;const
|
|
22
|
+
`;const n=r.default.div`
|
|
21
23
|
width: 360px;
|
|
22
24
|
height: 100%;
|
|
23
25
|
padding: 8px;
|
|
@@ -32,4 +34,4 @@
|
|
|
32
34
|
flex-wrap: wrap;
|
|
33
35
|
align-items: center;
|
|
34
36
|
}
|
|
35
|
-
`;exports.ChipInputWrapper=
|
|
37
|
+
`;exports.ChipInputWrapper=n,exports.OpenDropdownContainer=p,exports.OverLapAbs=o;
|
|
@@ -10,6 +10,7 @@ export declare const DropdownPopover: React.ForwardRefExoticComponent<OpenDropdo
|
|
|
10
10
|
tooltipContent?: string | undefined;
|
|
11
11
|
tooltipDirection?: Placement | undefined;
|
|
12
12
|
showTooltipArrow?: boolean | undefined;
|
|
13
|
+
allowEvents?: boolean | undefined;
|
|
13
14
|
} & React.RefAttributes<{
|
|
14
15
|
openDropdown: boolean;
|
|
15
16
|
}>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../_virtual/_tslib.js"),o=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../_virtual/_tslib.js"),o=require("react/jsx-runtime"),n=require("react"),t=require("react-popper"),r=require("../../dropShadow/DropShadow.js"),l=require("../../tooltips/Tooltip.js"),s=require("../Common.styled.js"),i=require("../OpenedDropdown/components/OpennedDropdown.js");function a(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}const d=a(n).default.forwardRef(((a,d)=>{var{children:p,onDropdownVisbilityChange:c,version:u="1.0",tooltipContent:v,tooltipDirection:j,showTooltipArrow:w}=a,b=e.__rest(a,["children","onDropdownVisbilityChange","version","tooltipContent","tooltipDirection","showTooltipArrow"]);const f=d,[h,D]=n.useState(!1),[O,g]=n.useState(null),[x,y]=n.useState(null),m=n.useRef(null),{styles:S,attributes:C}=t.usePopper(O,x,{placement:b.placement,strategy:b.strategy}),q=e=>{var o,n;"2.0"===u&&b.isMultiSelect&&e&&(null===(o=b.onSelect)||void 0===o||o.call(b,[...e])),D(!1),null===(n=null==b?void 0:b.onClose)||void 0===n||n.call(b)};n.useImperativeHandle(f,(()=>({openDropdown:h})),[]),n.useEffect((()=>{(null==f?void 0:f.current)&&(f.current.openDropdown=h)}),[h]),n.useEffect((()=>{null==c||c(h)}),[h]);const E=()=>o.jsxs(o.Fragment,{children:[o.jsxs("div",Object.assign({style:{position:"relative"},ref:g},{children:[o.jsx(s.OverLapAbs,Object.assign({ref:m,allowEvents:b.allowEvents,disabled:b.disabled,onClick:e=>{var o;null===(o=b.onDropdownOpen)||void 0===o||o.call(b),h?(D(!1),e.preventDefault()):b.disabled||D(!0)}},{children:b.allowEvents?p:null})),b.allowEvents?null:p]})),h&&o.jsx(s.OpenDropdownContainer,Object.assign({ref:y,style:Object.assign(Object.assign({},S.popper),{zIndex:3})},C.popper,{children:o.jsx(r.default,Object.assign({level:"z2",position:"down",style:{borderRadius:8}},{children:o.jsx(i.OpenedDropdown,Object.assign({},b,{onSelect:e=>{var o;"2.0"===u&&b.isMultiSelect||(null===(o=b.onSelect)||void 0===o||o.call(b,e),D(!1))},onClose:q,version:u,headerRef:m}))}))}))]});return o.jsx(o.Fragment,{children:h||void 0===v?E():o.jsx(l.Tooltip,Object.assign({body:v,placement:j,hideArrow:!w},{children:o.jsx("div",{children:E()})}))})}));d.displayName="DropdownPopover",exports.DropdownPopover=d;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export declare const OverLapAbs: import("styled-components").StyledComponent<"div", any, {
|
|
2
2
|
disabled?: boolean | undefined;
|
|
3
|
+
allowEvents?: boolean | undefined;
|
|
3
4
|
}, never>;
|
|
4
5
|
export declare const OpenDropdownContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
5
6
|
export declare const LoadingContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import e from"styled-components";import{COLORS as i}from"../../constants/Theme.js";const
|
|
2
|
-
position:
|
|
1
|
+
import e from"styled-components";import{COLORS as i}from"../../constants/Theme.js";const t=e.div`
|
|
2
|
+
position:
|
|
3
|
+
// if allowEvents is true, then position is relative, else position is absolute
|
|
4
|
+
${e=>(null==e?void 0:e.allowEvents)?"relative":"absolute"};
|
|
3
5
|
left: 0px;
|
|
4
6
|
top: 0px;
|
|
5
7
|
width: 100%;
|
|
@@ -17,7 +19,7 @@ import e from"styled-components";import{COLORS as i}from"../../constants/Theme.j
|
|
|
17
19
|
background: ${i.surface.hovered};
|
|
18
20
|
border: 1px solid ${i.stroke.primary};
|
|
19
21
|
border-radius: 4px;
|
|
20
|
-
`;const
|
|
22
|
+
`;const r=e.div`
|
|
21
23
|
width: 360px;
|
|
22
24
|
height: 100%;
|
|
23
25
|
padding: 8px;
|
|
@@ -32,4 +34,4 @@ import e from"styled-components";import{COLORS as i}from"../../constants/Theme.j
|
|
|
32
34
|
flex-wrap: wrap;
|
|
33
35
|
align-items: center;
|
|
34
36
|
}
|
|
35
|
-
`;export{
|
|
37
|
+
`;export{r as ChipInputWrapper,o as OpenDropdownContainer,t as OverLapAbs};
|
|
@@ -10,6 +10,7 @@ export declare const DropdownPopover: React.ForwardRefExoticComponent<OpenDropdo
|
|
|
10
10
|
tooltipContent?: string | undefined;
|
|
11
11
|
tooltipDirection?: Placement | undefined;
|
|
12
12
|
showTooltipArrow?: boolean | undefined;
|
|
13
|
+
allowEvents?: boolean | undefined;
|
|
13
14
|
} & React.RefAttributes<{
|
|
14
15
|
openDropdown: boolean;
|
|
15
16
|
}>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__rest as o}from"../../../_virtual/_tslib.js";import{jsx as e,Fragment as
|
|
1
|
+
import{__rest as o}from"../../../_virtual/_tslib.js";import{jsx as e,Fragment as l,jsxs as n}from"react/jsx-runtime";import t,{useState as r,useRef as i,useImperativeHandle as s,useEffect as p}from"react";import{usePopper as d}from"react-popper";import a from"../../dropShadow/DropShadow.js";import{Tooltip as c}from"../../tooltips/Tooltip.js";import{OverLapAbs as v,OpenDropdownContainer as m}from"../Common.styled.js";import{OpenedDropdown as u}from"../OpenedDropdown/components/OpennedDropdown.js";const w=t.forwardRef(((t,w)=>{var{children:h,onDropdownVisbilityChange:b,version:f="1.0",tooltipContent:j,tooltipDirection:g,showTooltipArrow:D}=t,y=o(t,["children","onDropdownVisbilityChange","version","tooltipContent","tooltipDirection","showTooltipArrow"]);const O=w,[C,S]=r(!1),[E,x]=r(null),[A,R]=r(null),T=i(null),{styles:z,attributes:M}=d(E,A,{placement:y.placement,strategy:y.strategy}),V=o=>{var e,l;"2.0"===f&&y.isMultiSelect&&o&&(null===(e=y.onSelect)||void 0===e||e.call(y,[...o])),S(!1),null===(l=null==y?void 0:y.onClose)||void 0===l||l.call(y)};s(O,(()=>({openDropdown:C})),[]),p((()=>{(null==O?void 0:O.current)&&(O.current.openDropdown=C)}),[C]),p((()=>{null==b||b(C)}),[C]);const _=()=>n(l,{children:[n("div",Object.assign({style:{position:"relative"},ref:x},{children:[e(v,Object.assign({ref:T,allowEvents:y.allowEvents,disabled:y.disabled,onClick:o=>{var e;null===(e=y.onDropdownOpen)||void 0===e||e.call(y),C?(S(!1),o.preventDefault()):y.disabled||S(!0)}},{children:y.allowEvents?h:null})),y.allowEvents?null:h]})),C&&e(m,Object.assign({ref:R,style:Object.assign(Object.assign({},z.popper),{zIndex:3})},M.popper,{children:e(a,Object.assign({level:"z2",position:"down",style:{borderRadius:8}},{children:e(u,Object.assign({},y,{onSelect:o=>{var e;"2.0"===f&&y.isMultiSelect||(null===(e=y.onSelect)||void 0===e||e.call(y,o),S(!1))},onClose:V,version:f,headerRef:T}))}))}))]});return e(l,{children:C||void 0===j?_():e(c,Object.assign({body:j,placement:g,hideArrow:!D},{children:e("div",{children:_()})}))})}));w.displayName="DropdownPopover";export{w as DropdownPopover};
|