@bikdotai/bik-component-library 0.0.20 → 0.0.21-beta.1
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/assets/icons/chevronDown.svg.js +1 -0
- package/dist/cjs/assets/icons/errorInfo.svg.js +1 -1
- package/dist/cjs/components/dropdown/Common.styled.d.ts +1 -0
- package/dist/cjs/components/dropdown/Common.styled.js +11 -3
- package/dist/cjs/components/dropdown/Dropdown.d.ts +2 -2
- package/dist/cjs/components/dropdown/Dropdown.js +1 -0
- package/dist/cjs/components/dropdown/UnChildDropdown/UnChildDropdown.d.ts +1 -4
- package/dist/cjs/components/dropdown/UnChildDropdown/UnChildDropdown.js +1 -1
- package/dist/cjs/components/dropdown/index.d.ts +2 -0
- package/dist/cjs/components/dropdown/opennedDropdown/components/OpennedDropdown.js +1 -1
- package/dist/cjs/components/dropdown/opennedDropdown/components/menu/MenuItem.js +3 -1
- package/dist/cjs/components/dropdown/opennedDropdown/components/multiSelect/MultiSelectDropdownBottomBar.styled.js +3 -2
- package/dist/cjs/components/dropdown/opennedDropdown/components/searchbox/SearchBox.js +1 -1
- package/dist/cjs/components/dropdown/opennedDropdown/utils/iterationOnOptions.d.ts +13 -13
- package/dist/cjs/components/dropdown/type.d.ts +10 -5
- package/dist/cjs/components/fab-menu/FABMenu.d.ts +2 -2
- package/dist/cjs/components/fab-menu/FABMenu.js +1 -1
- package/dist/cjs/components/input/Input.d.ts +2 -0
- package/dist/cjs/components/input/Input.js +1 -1
- package/dist/cjs/components/input/Input.styled.js +1 -1
- package/dist/cjs/components/list-item/ListItem.d.ts +1 -0
- package/dist/cjs/components/list-item/ListItem.js +1 -1
- package/dist/cjs/index.d.ts +1 -0
- package/dist/cjs/index.js +1 -1
- package/dist/esm/assets/icons/chevronDown.svg.js +1 -0
- package/dist/esm/assets/icons/errorInfo.svg.js +1 -1
- package/dist/esm/components/dropdown/Common.styled.d.ts +1 -0
- package/dist/esm/components/dropdown/Common.styled.js +10 -2
- package/dist/esm/components/dropdown/Dropdown.d.ts +2 -2
- package/dist/esm/components/dropdown/Dropdown.js +1 -0
- package/dist/esm/components/dropdown/UnChildDropdown/UnChildDropdown.d.ts +1 -4
- package/dist/esm/components/dropdown/UnChildDropdown/UnChildDropdown.js +1 -1
- package/dist/esm/components/dropdown/index.d.ts +2 -0
- package/dist/esm/components/dropdown/opennedDropdown/components/OpennedDropdown.js +1 -1
- package/dist/esm/components/dropdown/opennedDropdown/components/menu/MenuItem.js +3 -1
- package/dist/esm/components/dropdown/opennedDropdown/components/multiSelect/MultiSelectDropdownBottomBar.styled.js +3 -2
- package/dist/esm/components/dropdown/opennedDropdown/components/searchbox/SearchBox.js +1 -1
- package/dist/esm/components/dropdown/opennedDropdown/utils/iterationOnOptions.d.ts +13 -13
- package/dist/esm/components/dropdown/type.d.ts +10 -5
- package/dist/esm/components/fab-menu/FABMenu.d.ts +2 -2
- package/dist/esm/components/fab-menu/FABMenu.js +1 -1
- package/dist/esm/components/input/Input.d.ts +2 -0
- package/dist/esm/components/input/Input.js +1 -1
- package/dist/esm/components/input/Input.styled.js +1 -1
- package/dist/esm/components/list-item/ListItem.d.ts +1 -0
- package/dist/esm/components/list-item/ListItem.js +1 -1
- package/dist/esm/index.d.ts +1 -0
- package/dist/esm/index.js +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";function e(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(r){if("default"!==r){var n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:function(){return e[r]}})}})),t.default=e,Object.freeze(t)}Object.defineProperty(exports,"__esModule",{value:!0});var t,r=e(require("react"));function n(){return n=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},n.apply(this,arguments)}var a=e=>r.createElement("svg",n({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},e),t||(t=r.createElement("path",{fill:"currentColor",d:"M7.707 10.707C7.077 10.077 7.523 9 8.414 9h7.172c.89 0 1.337 1.077.707 1.707l-3.586 3.586a1 1 0 0 1-1.414 0l-3.586-3.586Z"})));exports.default=a;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";function e(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(r){if("default"!==r){var n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:function(){return e[r]}})}})),t.default=e,Object.freeze(t)}Object.defineProperty(exports,"__esModule",{value:!0});var t,r,n
|
|
1
|
+
"use strict";function e(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(r){if("default"!==r){var n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:function(){return e[r]}})}})),t.default=e,Object.freeze(t)}Object.defineProperty(exports,"__esModule",{value:!0});var t,r,n=e(require("react"));function l(){return l=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},l.apply(this,arguments)}var a=e=>n.createElement("svg",l({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 16 16"},e),t||(t=n.createElement("path",{fill:"currentColor",d:"M8 7.333c.368 0 .667.299.667.667v2.667a.667.667 0 1 1-1.334 0V8c0-.368.299-.667.667-.667ZM8 6a.667.667 0 1 0 0-1.333A.667.667 0 0 0 8 6Z"})),r||(r=n.createElement("path",{fill:"currentColor",fillRule:"evenodd",d:"M.667 8a7.333 7.333 0 1 1 14.666 0A7.333 7.333 0 0 1 .667 8ZM8 2a6 6 0 1 0 0 12A6 6 0 0 0 8 2Z",clipRule:"evenodd"})));exports.default=a;
|
|
@@ -1,2 +1,3 @@
|
|
|
1
1
|
export declare const OverLapAbs: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
2
2
|
export declare const OpenDropdownContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
3
|
+
export declare const LoadingContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("styled-components"),r=require("../../constants/Theme.js");function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var o=t(e);const i=o.default.div`
|
|
2
2
|
position: absolute;
|
|
3
3
|
left: 0px;
|
|
4
4
|
top: 0px;
|
|
@@ -6,7 +6,15 @@
|
|
|
6
6
|
height: 100%;
|
|
7
7
|
z-index: 2;
|
|
8
8
|
cursor: pointer;
|
|
9
|
-
`,
|
|
9
|
+
`,d=o.default.div`
|
|
10
10
|
margin-top: 8px;
|
|
11
11
|
margin-bottom: 8px;
|
|
12
|
-
`;
|
|
12
|
+
`;o.default.div`
|
|
13
|
+
display: flex;
|
|
14
|
+
flex-direction: row;
|
|
15
|
+
align-items: center;
|
|
16
|
+
padding: 6px 8px;
|
|
17
|
+
background: ${r.COLORS.surface.hovered};
|
|
18
|
+
border: 1px solid ${r.COLORS.stroke.primary};
|
|
19
|
+
border-radius: 4px;
|
|
20
|
+
`,exports.OpenDropdownContainer=d,exports.OverLapAbs=i;
|
|
@@ -3,6 +3,6 @@ import { OpenDropdownProps } from './type';
|
|
|
3
3
|
export type DropdownProps = OpenDropdownProps & {
|
|
4
4
|
placeHolder?: string;
|
|
5
5
|
size?: 'default' | 'small';
|
|
6
|
+
disabled?: boolean;
|
|
6
7
|
};
|
|
7
|
-
declare const Dropdown: React.FC<DropdownProps>;
|
|
8
|
-
export default Dropdown;
|
|
8
|
+
export declare const Dropdown: React.FC<DropdownProps>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../_virtual/_tslib.js"),t=require("react/jsx-runtime"),n=require("react"),r=require("../../constants/Theme.js"),o=require("../../assets/icons/chevronDown.svg.js"),i=require("../input/Input.js"),l=require("../input/context/InputStyleProvider.js"),s=require("./UnChildDropdown/UnChildDropdown.js");function a(){}exports.Dropdown=d=>{var u,c,{placeHolder:p,size:h,onSelect:v,defaultOptions:j,disabled:g}=d,f=e.__rest(d,["placeHolder","size","onSelect","defaultOptions","disabled"]);const b=null!=h?h:"default",x=n.useRef(),[w,m]=n.useState(null!=j?j:[]);n.useEffect((()=>{var e;const t=[];null===(e=null==f?void 0:f.options)||void 0===e||e.forEach((e=>{e.options?e.options.forEach((e=>{e.selected&&t.push(Object.assign(Object.assign({},e),{label:e.label}))})):e.selected&&t.push(e)})),m([...t])}),[f.options]);const O=w.length?w.map((e=>e.label)).join(", "):void 0;return t.jsx(l.InputStyleContext.Provider,Object.assign({value:{InputWrapper:{height:"small"===b?32:48,width:null!==(u=f.width)&&void 0!==u?u:"100%",zIndex:1,cursor:"pointer",padding:"6px 8px"},input:{minHeight:"100%"}}},{children:t.jsx(s.UnChildDropdown,Object.assign({ref:x,onSelect:function(e){Array.isArray(e)?m([...e]):m([e]),null==v||v(e)},disabled:g},f,{children:t.jsx(i.Input,{state:g?"disabled":"active",value:O,errorMessage:f.error,variant:b,placeholder:null!=p?p:"Select an option",width:null!==(c=f.width)&&void 0!==c?c:"100%",onChangeText:a,rightIcon:{icon:()=>{var e;return t.jsx(o.default,{style:{transform:(null===(e=null==x?void 0:x.current)||void 0===e?void 0:e.openDropdown)?"rotate(180deg)":"rotate(0deg)"},onClick:a,width:"small"===b?20:24,height:"small"===b?20:24,color:r.COLORS.content.primary})}}})}))}))};
|
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { OpenDropdownProps } from '../type';
|
|
3
|
-
export type DropdownProps = OpenDropdownProps & {
|
|
4
|
-
isLoading?: boolean;
|
|
5
|
-
children?: React.ReactNode;
|
|
6
|
-
};
|
|
7
3
|
export declare const UnChildDropdown: React.ForwardRefExoticComponent<OpenDropdownProps & {
|
|
8
4
|
isLoading?: boolean | undefined;
|
|
9
5
|
children?: React.ReactNode;
|
|
6
|
+
disabled?: boolean | undefined;
|
|
10
7
|
} & React.RefAttributes<{
|
|
11
8
|
openDropdown: boolean;
|
|
12
9
|
}>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../_virtual/_tslib.js"),n=require("react/jsx-runtime"),r=require("react"),t=require("react-popper"),o=require("../Common.styled.js"),s=require("../opennedDropdown/components/OpennedDropdown.js");function l(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}const i=l(r).default.forwardRef(((l,i)=>{var{children:
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../_virtual/_tslib.js"),n=require("react/jsx-runtime"),r=require("react"),t=require("react-popper"),o=require("../Common.styled.js"),s=require("../opennedDropdown/components/OpennedDropdown.js");function l(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}const i=l(r).default.forwardRef(((l,i)=>{var{children:d}=l,p=e.__rest(l,["children"]);const a=i,[u,c]=r.useState(!1),[j,v]=r.useState(null),[f,b]=r.useState(null),{styles:O,attributes:w}=t.usePopper(j,f,{});return r.useImperativeHandle(a,(()=>({openDropdown:u})),[]),r.useEffect((()=>{(null==a?void 0:a.current)&&(a.current.openDropdown=u)}),[u]),n.jsxs(n.Fragment,{children:[n.jsxs("div",Object.assign({style:{position:"relative"},ref:v},{children:[n.jsx(o.OverLapAbs,{onClick:e=>{u?e.preventDefault():p.disabled||c(!0)}}),d]})),u&&n.jsx(o.OpenDropdownContainer,Object.assign({ref:b,style:Object.assign(Object.assign({},O.popper),{zIndex:3})},w.popper,{children:n.jsx(s.OpennedDropdown,Object.assign({},p,{onSelect:e=>{var n;null===(n=p.onSelect)||void 0===n||n.call(p,e),c(!1)},onClose:function(){var e;c(!1),null===(e=null==p?void 0:p.onClose)||void 0===e||e.call(p)}}))}))]})}));i.displayName="UnChildDropdown",exports.UnChildDropdown=i;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),s=require("../../../../hooks/useOutside.js"),n=require("../utils/iterationOnOptions.js"),i=require("./description/Description.js"),l=require("./menu/FreeFormMenu.js"),o=require("./menu/MenuList.js"),r=require("./menu/SelectAllMenu.js"),u=require("./multiSelect/MultiSelectDropdownBottomBar.js"),c=require("./OpennedDropdown.styled.js"),a=require("./searchbox/SearchBox.js"),d=require("./searchbox/SearchZeroState.js");const p=304,f=290;exports.OpennedDropdown=j=>{let{options:h,isSearchable:S,isMultiSelect:O,width:b,allowFreeForm:x,height:m,onClose:g,onSelect:v}=j;const[q,M]=t.useState(null!=h?h:[]),[F,w]=t.useState(null!=b?b:f),[y,D]=t.useState(""),[A,B]=t.useState(null),C=t.useRef(null);s.useOutside(C,(()=>{B(null),null==g||g()}));const L=null!=m?m:p,E="number"==typeof L?S&&O?L-96:S&&!O||!S&&O?L-48:L:L;function W(e){if(O){const t=n.iterateOnOptions(q,{selected:e.selected},(t=>t.value===e.value));M([...t])}else null==v||v(e)}t.useEffect((()=>{const e=null!=b?b:f;if(null===A)w(e);else if("number"==typeof e)w(2*e);else if("string"==typeof e&&e.endsWith("px")){const t=2*parseInt(e.replace("px",""));w(t)}}),[A]);const Z=q.map((e=>{var t;if(y){if(e.options){const t=Object.assign({},e);return t.options=t.options.filter((e=>{var t;return!!(null===(t=e.label)||void 0===t?void 0:t.includes(y))})),t.options.length>0?t:null}return(null===(t=e.label)||void 0===t?void 0:t.includes(y))?e:null}return e})).filter((e=>null!==e)),_=!!S&&y&&0===Z.length;return e.jsxs(c.OpennedDropdownContainer,Object.assign({ref:C,style:{maxWidth:A?800:400,width:F}},{children:[e.jsxs("div",Object.assign({style:{width:A?"50%":"100%",display:"flex",flexDirection:"column"}},{children:[!!S&&e.jsx(a.SearchBox,{onSearch:function(e){D(e)}}),e.jsxs(c.MenuListContainer,Object.assign({maxHeight:E},{children:[!!O&&!_&&e.jsx(r.SelectAllMenu,{options:q,onSelect:function(e){if("selectAll"===e){const e=n.iterateOnOptions(q,{selected:!0},(e=>!e.disabled));M([...e])}else if("notSelected"===e){const e=n.iterateOnOptions(q,{selected:!1},(e=>!e.disabled));M([...e])}}}),!x&&_&&e.jsx(d.SearchZeroState,{searchedString:y}),x&&_&&e.jsx(l.FreeFormMenu,{isMultiSelect:O,onSelect:function(e){if(!O)return void W({label:y,value:y,isFreeForm:!0,selected:!0});const t=q.map((t=>t.options?t:Object.assign(Object.assign({},t),{selected:t.label===y&&t.value===y&&e})));e&&(t.some((e=>e.label===y&&e.value===y))||t.unshift({label:y,value:y,isFreeForm:!0,selected:!0})),M([...t])},searchedString:y}),e.jsx(o.MenuList,{onSelect:W,showDescription:function(e,t){B(e&&t?{title:e,description:t}:null)},isMultiSelect:O,options:Z})]})),!!O&&e.jsx(u.default,{onClear:function(){const e=n.iterateOnOptions(q,{selected:!1});M([...e])},onApply:function(){const e=[];q.forEach((t=>{if(t.options){const s=t.options.filter((e=>!0===e.selected));e.push(Object.assign(Object.assign({},t),{options:[...s]}))}else t.selected&&e.push(Object.assign({},t))})),null==v||v([...e])},list:q})]})),!!A&&e.jsx(i.Description,{title:A.title,description:A.description})]}))};
|
|
@@ -1 +1,3 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("../../../../checkBox/CheckBox.js"),s=require("../../../../list-item/ListItem.js"),i=require("../../../../TypographyStyle.js"),r=require("../../../../../constants/Theme.js"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("styled-components"),n=require("../../../../checkBox/CheckBox.js"),s=require("../../../../list-item/ListItem.js"),i=require("../../../../TypographyStyle.js"),r=require("../../../../../constants/Theme.js"),o=require("./FreeFormMenu.styled.js");function l(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}const c=l(t).default(s.ListItem)`
|
|
2
|
+
padding: 14px 16px !important;
|
|
3
|
+
`;exports.MenuItem=t=>{let{option:s,isMultiSelect:l,showDescription:a,onSelect:u}=t;var d;function m(e){s.disabled||u(Object.assign(Object.assign({},s),{selected:e}))}return e.jsx(c,{onClick:e=>{e.preventDefault(),m(!s.selected)},onMouseOver:function(){s.descriptions?a(s.label,s.descriptions):a()},listItem:{value:s.value,label:s.label},subText:s.subText,leadingIcon:l?e.jsx(n.CheckBox,{isDisabled:null!==(d=s.disabled)&&void 0!==d&&d,isChecked:!!s.selected,onValueChange:m}):e.jsx(e.Fragment,{}),customComponent:s.customComponent,trailingIcon:s.isFreeForm?e.jsx(o.FreeFormContainer,{children:e.jsx(i.BodyCaption,Object.assign({style:{color:r.COLORS.content.secondary}},{children:"Freeform"}))}):s.trailingIcon?e.jsx(e.Fragment,{children:s.trailingIcon}):e.jsx(e.Fragment,{}),variant:s.disabled?"inactive":s.selected?"selected":"default"})};
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("styled-components"),t=require("../../../../../constants/Theme.js");function n(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}const r=n(e).default.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
padding: 8px 16px;
|
|
4
4
|
flex-direction: row;
|
|
5
5
|
align-items: center;
|
|
6
6
|
justify-content: end;
|
|
7
7
|
box-shadow: 0px -2px 8px rgba(0, 0, 0, 0.12);
|
|
8
|
-
|
|
8
|
+
background: ${t.COLORS.surface.standard};
|
|
9
|
+
`;exports.BottomBarContainer=r;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),r=require("react"),t=require("../../../../input/Input.js"),n=require("../../../../input/context/InputStyleProvider.js"),o=require("../../../../../constants/Theme.js"),i=require("../../../../../assets/icons/cross.svg.js"),s=require("../../../../../assets/icons/search.svg.js");exports.SearchBox=c=>{let{onSearch:u}=c;const a=r.createRef();return e.jsx(n.InputStyleContext.Provider,Object.assign({value:{InputWrapper:{borderRadius:0,border:0,borderBottom:"1px solid "+o.COLORS.stroke.primary,padding:"
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),r=require("react"),t=require("../../../../input/Input.js"),n=require("../../../../input/context/InputStyleProvider.js"),o=require("../../../../../constants/Theme.js"),i=require("../../../../../assets/icons/cross.svg.js"),s=require("../../../../../assets/icons/search.svg.js");exports.SearchBox=c=>{let{onSearch:u}=c;const a=r.createRef();return e.jsx(n.InputStyleContext.Provider,Object.assign({value:{InputWrapper:{borderRadius:0,border:0,borderBottom:"1px solid "+o.COLORS.stroke.primary,padding:"14px 16px"},IconHolder:{marginLeft:0},input:{marginLeft:4,minHeight:"100%"}}},{children:e.jsx(t.Input,{ref:a,placeholder:"Search",leftIcon:{icon:()=>e.jsx(s.default,{width:24,height:24,color:o.COLORS.content.placeholder})},rightIcon:{icon:()=>{var r;return(null===(r=null==a?void 0:a.current)||void 0===r?void 0:r.value)?e.jsx(i.default,{onClick:()=>{a.current&&(a.current.value=""),u("")},width:24,height:24,color:o.COLORS.content.placeholder}):e.jsx(e.Fragment,{})}},onChangeText:u})}))};
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
import { DropdownOption, SingleOption } from '../../type';
|
|
2
|
-
export declare function iterateOnOptions(options: DropdownOption[], newVal: SingleOption
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
descriptions?: string | undefined;
|
|
7
|
-
selected?: boolean | undefined;
|
|
8
|
-
disabled?: boolean | undefined;
|
|
9
|
-
isFreeForm?: boolean | undefined;
|
|
10
|
-
}[];
|
|
11
|
-
label?: string | undefined;
|
|
12
|
-
value?: string | undefined;
|
|
13
|
-
descriptions?: string | undefined;
|
|
3
|
+
export declare function iterateOnOptions(options: DropdownOption[], newVal: Partial<SingleOption>, checkCB?: (optionForValidation: SingleOption) => boolean): ({
|
|
4
|
+
label: string;
|
|
5
|
+
value: string;
|
|
6
|
+
descriptions?: string | null | undefined;
|
|
14
7
|
selected?: boolean | undefined;
|
|
15
8
|
disabled?: boolean | undefined;
|
|
16
9
|
isFreeForm?: boolean | undefined;
|
|
10
|
+
subText?: string | undefined;
|
|
11
|
+
trailingIcon?: JSX.Element | undefined;
|
|
12
|
+
customComponent?: JSX.Element | undefined;
|
|
17
13
|
} | {
|
|
18
14
|
label?: string | undefined;
|
|
19
15
|
value?: string | undefined;
|
|
20
|
-
descriptions?: string | undefined;
|
|
16
|
+
descriptions?: string | null | undefined;
|
|
21
17
|
selected?: boolean | undefined;
|
|
22
18
|
disabled?: boolean | undefined;
|
|
23
19
|
isFreeForm?: boolean | undefined;
|
|
20
|
+
subText?: string | undefined;
|
|
21
|
+
trailingIcon?: JSX.Element | undefined;
|
|
22
|
+
customComponent?: JSX.Element | undefined;
|
|
23
|
+
options: SingleOption[];
|
|
24
24
|
})[];
|
|
@@ -1,25 +1,30 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
export interface OpenDropdownProps {
|
|
3
|
+
defaultOptions?: DropdownOption[];
|
|
2
4
|
options: DropdownOption[];
|
|
3
5
|
isSearchable?: boolean;
|
|
4
6
|
error?: string;
|
|
5
7
|
isMultiSelect?: boolean;
|
|
6
|
-
width?:
|
|
8
|
+
width?: string;
|
|
7
9
|
height?: number | string;
|
|
8
10
|
allowFreeForm?: boolean;
|
|
9
11
|
onClose?: () => void;
|
|
10
|
-
onSelect?: (option:
|
|
12
|
+
onSelect?: (option: DropdownOption | DropdownOption[]) => void;
|
|
11
13
|
}
|
|
12
14
|
export type GroupedOption = {
|
|
13
15
|
label?: string;
|
|
14
16
|
options: (SingleOption | MultiSelectOption)[];
|
|
15
17
|
};
|
|
16
18
|
export type SingleOption = {
|
|
17
|
-
label
|
|
18
|
-
value
|
|
19
|
-
descriptions?: string;
|
|
19
|
+
label: string;
|
|
20
|
+
value: string;
|
|
21
|
+
descriptions?: string | null;
|
|
20
22
|
selected?: boolean;
|
|
21
23
|
disabled?: boolean;
|
|
22
24
|
isFreeForm?: boolean;
|
|
25
|
+
subText?: string;
|
|
26
|
+
trailingIcon?: JSX.Element;
|
|
27
|
+
customComponent?: JSX.Element;
|
|
23
28
|
};
|
|
24
29
|
export type MultiSelectOption = SingleOption;
|
|
25
30
|
export type DropdownOption = MultiSelectOption | SingleOption | GroupedOption;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { DropdownOption
|
|
2
|
+
import { DropdownOption } from '../dropdown/type';
|
|
3
3
|
import { DROP_POSITION, FAB_POSITION, MENU_ALIGNMENT } from '../floating-action-button/FloatingActionButton.styles';
|
|
4
4
|
import { TooltipPlacement } from '../tooltips';
|
|
5
5
|
export declare const FABMenu: React.FC<{
|
|
6
|
-
onSelect: (selected:
|
|
6
|
+
onSelect: (selected: DropdownOption | DropdownOption[]) => void;
|
|
7
7
|
menuOptions: DropdownOption[];
|
|
8
8
|
buttonWidth?: number;
|
|
9
9
|
buttonHeight?: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("react/jsx-runtime"),o=require("../dropdown/opennedDropdown/components/OpennedDropdown.js"),n=require("../floating-action-button/FloatingActionButton.js");require("../floating-action-button/FloatingActionButton.styles.js");exports.FABMenu=e=>{const{onSelect:i,menuOptions:r,buttonWidth:d,buttonHeight:u,buttonColor:l,buttonPosition:s,menuWidth:c,menuHeight:a,buttonIcon:p,buttonPaddingHorizontal:g,buttonPaddingVertical:b,tooltipPlacement:h,tooltipText:m,zIndex:x,isRound:P,dropPosition:j,menuAligment:w}=e;return t.jsx("div",{children:t.jsx(n.FloatingActionButton,Object.assign({icon:p,width:d,height:u,color:l,position:s,buttonPaddingHorizontal:g,buttonPaddingVertical:b,tooltipPlacement:h,tooltipText:m,zIndex:x,isRound:P,dropPosition:j,menuAligment:w},{children:t.jsx(o.OpennedDropdown,{options:r,height:a||90,width
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("react/jsx-runtime"),o=require("../dropdown/opennedDropdown/components/OpennedDropdown.js"),n=require("../floating-action-button/FloatingActionButton.js");require("../floating-action-button/FloatingActionButton.styles.js");exports.FABMenu=e=>{const{onSelect:i,menuOptions:r,buttonWidth:d,buttonHeight:u,buttonColor:l,buttonPosition:s,menuWidth:c,menuHeight:a,buttonIcon:p,buttonPaddingHorizontal:g,buttonPaddingVertical:b,tooltipPlacement:h,tooltipText:m,zIndex:x,isRound:P,dropPosition:j,menuAligment:w}=e;return t.jsx("div",{children:t.jsx(n.FloatingActionButton,Object.assign({icon:p,width:d,height:u,color:l,position:s,buttonPaddingHorizontal:g,buttonPaddingVertical:b,tooltipPlacement:h,tooltipText:m,zIndex:x,isRound:P,dropPosition:j,menuAligment:w},{children:t.jsx(o.OpennedDropdown,{options:r,height:a||90,width:`${c}px`,onSelect:i})}))})};
|
|
@@ -34,5 +34,7 @@ export interface InputProps {
|
|
|
34
34
|
suffixText?: string;
|
|
35
35
|
prefixText?: string;
|
|
36
36
|
value?: string;
|
|
37
|
+
onBlur?: () => void;
|
|
38
|
+
onFocus?: () => void;
|
|
37
39
|
}
|
|
38
40
|
export declare const Input: import("react").ForwardRefExoticComponent<InputProps & import("react").RefAttributes<HTMLInputElement | HTMLTextAreaElement>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),n=require("../button/Button.js"),i=require("../TypographyStyle.js"),r=require("../../assets/icons/errorInfo.svg.js"),l=require("./context/InputStyleProvider.js"),s=require("./Input.styled.js");const a=e=>e&&"function"==typeof e,o=t.forwardRef(((o,u)=>{var c,d,x;const{placeholder:
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),n=require("../button/Button.js"),i=require("../TypographyStyle.js"),r=require("../../assets/icons/errorInfo.svg.js"),l=require("./context/InputStyleProvider.js"),s=require("./Input.styled.js");const a=e=>e&&"function"==typeof e,o=t.forwardRef(((o,u)=>{var c,d,x;const{placeholder:v,leftIcon:h,rightIcon:j,labelText:p,maxCharLimit:f,isRequired:g,hintText:y,type:I,state:b,validate:C,variant:S,button:m,suffixText:O,prefixText:w,onChangeText:q,value:T}=Object.assign({maxCharLimit:0,type:"text",variant:"default"},o),k=null==h?void 0:h.icon,B=null==j?void 0:j.icon,[E,H]=t.useState(""),[F,L]=t.useState(!1),[M,R]=t.useState(!1),[D,P]=t.useState(),z="small"===S?"18px":"22px",A=t.useContext(l.InputStyleContext);t.useEffect((()=>{P(o.errorMessage)}),[o.errorMessage]),t.useEffect((()=>{L(!1),("invalid"===o.state||D)&&L(!0)}),[o.state,D]),t.useEffect((()=>{L(!!D)}),[D]),t.useEffect((()=>{if(q(E),!C||!a(C))return;const[e,t]=C(E);L(!e),P(t)}),[E]);const K=function(e){if(a(e)){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];e(...n)}},W=e=>{![8].includes(e.which)&&f>0&&e.target.value.length===f&&e.preventDefault()},_=e=>{H(e.target.value)},N=()=>{var t;return e.jsxs(e.Fragment,{children:["multiline"!==I&&e.jsx("input",{style:null!==(t=null==A?void 0:A.input)&&void 0!==t?t:{},ref:u,type:I,value:T,onFocus:()=>(R(!0),void K(o.onFocus)),onBlur:()=>(R(!1),void K(o.onBlur)),placeholder:v||"Enter here",onChange:_,onKeyDown:e=>W(e)}),"multiline"===I&&e.jsx("textarea",{value:T,ref:u,onFocus:()=>R(!0),onBlur:()=>R(!1),placeholder:v||"Enter here",onChange:_,onKeyDown:e=>W(e)})]})};return e.jsxs(s.RootContainer,Object.assign({width:o.width,height:o.height,state:b,type:I,style:null!==(c=null==A?void 0:A.RootContainer)&&void 0!==c?c:{}},{children:[(!!y||!!D)&&e.jsxs(s.InputFooter,Object.assign({invalid:!!D},{children:[!!D&&e.jsx(r.default,{}),D||y]})),e.jsxs(s.InputWrapper,Object.assign({variant:S,state:b,width:o.width,isActive:"active"===b||M,isInvalid:F,style:null!==(d=null==A?void 0:A.InputWrapper)&&void 0!==d?d:{}},{children:[!!k&&e.jsx(s.IconHolder,Object.assign({variant:S,iconSize:z,onClick:()=>K(null==h?void 0:h.callback),isLeft:!0,style:null!==(x=null==A?void 0:A.IconHolder)&&void 0!==x?x:{}},{children:e.jsx(k,{})})),!!w&&e.jsx(s.PrefixHolder,Object.assign({variant:S},{children:w})),"default"===S&&e.jsx(s.InputContainer,{children:N()}),"small"===S&&e.jsx(s.InputContainerSmall,{children:N()}),!!B&&e.jsx(s.IconHolder,Object.assign({variant:S,iconSize:z,onClick:()=>K(null==h?void 0:h.callback),isLeft:!1},{children:e.jsx(B,{})})),!!O&&e.jsx(s.SuffixHolder,Object.assign({variant:S},{children:O})),m&&m.text&&e.jsx(n.Button,{buttonText:m.text,onClick:()=>K(null==m?void 0:m.onClick)})]})),(!!p||!!f)&&"default"===S&&e.jsxs(s.InputHeader,Object.assign({invalid:F},{children:[e.jsxs(i.BodySecondary,{children:[p,g?e.jsx("span",{children:"*"}):""]}),f>0&&e.jsxs(s.MaxCharStyle,{children:[E.length,"/",f]})]}))]}))}));o.displayName="Input",exports.Input=o;
|