@bikdotai/bik-component-library 0.0.321-beta.1 → 0.0.322-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/components/QueryBuilder/helpers/MetaCustomProcessor.d.ts +1 -1
- package/dist/cjs/components/bik-layout/MockMenus.d.ts +1 -0
- package/dist/cjs/components/input/Input.d.ts +1 -4
- package/dist/cjs/components/input/Input.js +1 -1
- package/dist/cjs/components/stepper/WorkingStepper.d.ts +1 -0
- package/dist/esm/components/QueryBuilder/helpers/MetaCustomProcessor.d.ts +1 -1
- package/dist/esm/components/bik-layout/MockMenus.d.ts +1 -0
- package/dist/esm/components/input/Input.d.ts +1 -4
- package/dist/esm/components/input/Input.js +1 -1
- package/dist/esm/components/stepper/WorkingStepper.d.ts +1 -0
- package/package.json +1 -1
|
@@ -36,7 +36,7 @@ export declare class MetaCustomProcessor {
|
|
|
36
36
|
value: {
|
|
37
37
|
operator: string;
|
|
38
38
|
dataType: import("../types").QueryBuilderConnectorType;
|
|
39
|
-
value?: string | number |
|
|
39
|
+
value?: string | number | string[] | number[] | Date | Date[] | undefined;
|
|
40
40
|
};
|
|
41
41
|
key: string;
|
|
42
42
|
refresh?: boolean | undefined;
|
|
@@ -49,7 +49,4 @@ export interface InputProps {
|
|
|
49
49
|
skipFocus?: boolean;
|
|
50
50
|
version?: '1.0' | '2.0';
|
|
51
51
|
}
|
|
52
|
-
export declare const Input:
|
|
53
|
-
(props: InputProps): JSX.Element;
|
|
54
|
-
displayName: string;
|
|
55
|
-
};
|
|
52
|
+
export declare const Input: React.ForwardRefExoticComponent<InputProps & React.RefAttributes<HTMLInputElement | HTMLTextAreaElement | null>>;
|
|
@@ -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("./Input-helper.js"),r=require("../TypographyStyle.js"),
|
|
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("./Input-helper.js"),r=require("../TypographyStyle.js"),l=require("../../assets/icons/errorInfo.svg.js"),s=require("./context/InputStyleProvider.js"),o=require("./Input.styled.js");const a=t.forwardRef(((a,u)=>{var c,d,v,h,x;const{placeholder:p,leftIcon:f,rightIcon:j,labelText:g,maxCharLimit:y,isRequired:I,hintText:b,type:C,state:m,validate:S,variant:w,button:E,suffixText:O,prefixText:q,onChangeText:F,value:k,noErrorHint:H,reset:T,rangeValidation:B,noKeyDownChange:M,version:R}=Object.assign({maxCharLimit:0,type:"text",variant:"default"},a),A=null==f?void 0:f.icon,L=null==j?void 0:j.icon,[z,D]=t.useState(!1),[K,P]=t.useState(!1),[W,_]=t.useState(),N="small"===w?"18px":"22px",V=t.useContext(s.InputStyleContext),[G,J]=t.useState(),Q=t.useRef(null),U=null!=u?u:Q;t.useEffect((()=>{J(k)}),[k]),t.useEffect((()=>{var e;U.current&&(null===(e=a.onReferenceInit)||void 0===e||e.call(a,U.current))}),[U]),t.useEffect((()=>{T&&J("")}),[T]),t.useEffect((()=>{var e;P(!!a.isActive),a.isActive&&(null===(e=U.current)||void 0===e||e.focus())}),[a.isActive]),t.useEffect((()=>{_(a.errorMessage)}),[a.errorMessage]),t.useEffect((()=>{var e;D(!1),("invalid"===a.state||W)&&D(!0),"active"===a.state&&(null===(e=U.current)||void 0===e||e.focus())}),[a.state,W]),t.useEffect((()=>{D(!!W)}),[W]);const X=function(e){if(i.isFunction(e)){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];e(...n)}},Y=e=>{const t=y||("zip"===C?6:60);M||F(k||"",e),![8].includes(e.which)&&t>0&&e.target.value.length===t&&e.preventDefault()},Z=e=>{const t=e.target.value;F(t,e),J(t);const n=S||i.validateInput;if(!n||!i.isFunction(n))return;const[r,l]=n(t,C,B);D(!r),_(a.errorMessage?a.errorMessage:l)},$=()=>{a.skipFocus||P(!0),X(a.onFocus)},ee=e=>{var t;a.skipFocus||P(!1),X(null===(t=a.onBlur)||void 0===t?void 0:t.call(a,e))},te=()=>{var t;return e.jsxs(e.Fragment,{children:["multiline"!==C&&e.jsx("input",{id:a.id,style:null!==(t=null==V?void 0:V.input)&&void 0!==t?t:{},ref:U,type:["phonenumber","zip","number"].includes(C)?"number":C,value:G,onFocus:()=>$(),onBlur:e=>ee(e),placeholder:p||"Enter here",onChange:Z,onKeyDown:e=>Y(e)}),"multiline"===C&&e.jsx("textarea",{value:G,ref:U,onFocus:()=>$(),onBlur:e=>ee(e),placeholder:p||"Enter here",onChange:Z,onKeyDown:e=>Y(e),maxLength:y>0?y:void 0})]})};return e.jsxs(o.RootContainer,Object.assign({width:a.width,height:a.height,state:m,type:C,style:null!==(c=null==V?void 0:V.RootContainer)&&void 0!==c?c:{}},{children:[!H&&(!!b||!!W)&&e.jsxs(o.InputFooter,Object.assign({invalid:!!W},{children:[!!W&&e.jsx(l.default,{width:16,height:16}),W||b]})),e.jsxs(o.InputWrapper,Object.assign({variant:w,state:m,width:a.width,isActive:"active"===m||K,isInvalid:z,style:null!==(d=null==V?void 0:V.InputWrapper)&&void 0!==d?d:{},version:R},{children:[!!A&&e.jsx(o.IconHolder,Object.assign({variant:w,iconSize:N,onClick:()=>X(null==f?void 0:f.callback),isLeft:!0,style:null!==(v=null==V?void 0:V.IconHolder)&&void 0!==v?v:{}},{children:e.jsx(A,{})})),!!q&&e.jsx(o.PrefixHolder,Object.assign({variant:w},{children:q})),"default"===w&&e.jsx(o.InputContainer,{children:te()}),"small"===w&&e.jsx(o.InputContainerSmall,{children:te()}),!!L&&e.jsx(o.IconHolder,Object.assign({variant:w,iconSize:N,onClick:()=>X(null==j?void 0:j.callback),isLeft:!1},{children:e.jsx(L,{})})),!!O&&e.jsx(o.SuffixHolder,Object.assign({variant:w},{children:O})),E&&E.text&&e.jsx(n.Button,{buttonText:E.text,onClick:()=>X(null==E?void 0:E.onClick)})]})),(!!g||!!y)&&e.jsxs(o.InputHeader,Object.assign({invalid:z},{children:[e.jsxs(r.BodySecondary,{children:[g,I?e.jsx("span",{children:"*"}):""]}),y>0&&e.jsxs(o.MaxCharStyle,{children:[null!==(x=null===(h=a.value)||void 0===h?void 0:h.length)&&void 0!==x?x:0,"/",y]})]}))]}))}));a.displayName="Input",exports.Input=a;
|
|
@@ -36,7 +36,7 @@ export declare class MetaCustomProcessor {
|
|
|
36
36
|
value: {
|
|
37
37
|
operator: string;
|
|
38
38
|
dataType: import("../types").QueryBuilderConnectorType;
|
|
39
|
-
value?: string | number |
|
|
39
|
+
value?: string | number | string[] | number[] | Date | Date[] | undefined;
|
|
40
40
|
};
|
|
41
41
|
key: string;
|
|
42
42
|
refresh?: boolean | undefined;
|
|
@@ -49,7 +49,4 @@ export interface InputProps {
|
|
|
49
49
|
skipFocus?: boolean;
|
|
50
50
|
version?: '1.0' | '2.0';
|
|
51
51
|
}
|
|
52
|
-
export declare const Input:
|
|
53
|
-
(props: InputProps): JSX.Element;
|
|
54
|
-
displayName: string;
|
|
55
|
-
};
|
|
52
|
+
export declare const Input: React.ForwardRefExoticComponent<InputProps & React.RefAttributes<HTMLInputElement | HTMLTextAreaElement | null>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsxs as e,jsx as n,Fragment as t}from"react/jsx-runtime";import{
|
|
1
|
+
import{jsxs as e,jsx as n,Fragment as t}from"react/jsx-runtime";import{forwardRef as i,useState as r,useContext as l,useRef as o,useEffect as a}from"react";import{Button as s}from"../button/Button.js";import{isFunction as c,validateInput as u}from"./Input-helper.js";import{BodySecondary as d}from"../TypographyStyle.js";import v from"../../assets/icons/errorInfo.svg.js";import{InputStyleContext as h}from"./context/InputStyleProvider.js";import{RootContainer as p,InputFooter as g,InputWrapper as m,IconHolder as f,PrefixHolder as x,InputContainer as b,InputContainerSmall as y,SuffixHolder as j,InputHeader as C,MaxCharStyle as I}from"./Input.styled.js";const w=i(((i,w)=>{var O,k,T,A,F;const{placeholder:L,leftIcon:z,rightIcon:B,labelText:D,maxCharLimit:M,isRequired:S,hintText:E,type:K,state:R,validate:H,variant:q,button:N,suffixText:P,prefixText:V,onChangeText:W,value:G,noErrorHint:J,reset:Q,rangeValidation:U,noKeyDownChange:X,version:Y}=Object.assign({maxCharLimit:0,type:"text",variant:"default"},i),Z=null==z?void 0:z.icon,$=null==B?void 0:B.icon,[_,ee]=r(!1),[ne,te]=r(!1),[ie,re]=r(),le="small"===q?"18px":"22px",oe=l(h),[ae,se]=r(),ce=o(null),ue=null!=w?w:ce;a((()=>{se(G)}),[G]),a((()=>{var e;ue.current&&(null===(e=i.onReferenceInit)||void 0===e||e.call(i,ue.current))}),[ue]),a((()=>{Q&&se("")}),[Q]),a((()=>{var e;te(!!i.isActive),i.isActive&&(null===(e=ue.current)||void 0===e||e.focus())}),[i.isActive]),a((()=>{re(i.errorMessage)}),[i.errorMessage]),a((()=>{var e;ee(!1),("invalid"===i.state||ie)&&ee(!0),"active"===i.state&&(null===(e=ue.current)||void 0===e||e.focus())}),[i.state,ie]),a((()=>{ee(!!ie)}),[ie]);const de=function(e){if(c(e)){for(var n=arguments.length,t=new Array(n>1?n-1:0),i=1;i<n;i++)t[i-1]=arguments[i];e(...t)}},ve=e=>{const n=M||("zip"===K?6:60);X||W(G||"",e),![8].includes(e.which)&&n>0&&e.target.value.length===n&&e.preventDefault()},he=e=>{const n=e.target.value;W(n,e),se(n);const t=H||u;if(!t||!c(t))return;const[r,l]=t(n,K,U);ee(!r),re(i.errorMessage?i.errorMessage:l)},pe=()=>{i.skipFocus||te(!0),de(i.onFocus)},ge=e=>{var n;i.skipFocus||te(!1),de(null===(n=i.onBlur)||void 0===n?void 0:n.call(i,e))},me=()=>{var r;return e(t,{children:["multiline"!==K&&n("input",{id:i.id,style:null!==(r=null==oe?void 0:oe.input)&&void 0!==r?r:{},ref:ue,type:["phonenumber","zip","number"].includes(K)?"number":K,value:ae,onFocus:()=>pe(),onBlur:e=>ge(e),placeholder:L||"Enter here",onChange:he,onKeyDown:e=>ve(e)}),"multiline"===K&&n("textarea",{value:ae,ref:ue,onFocus:()=>pe(),onBlur:e=>ge(e),placeholder:L||"Enter here",onChange:he,onKeyDown:e=>ve(e),maxLength:M>0?M:void 0})]})};return e(p,Object.assign({width:i.width,height:i.height,state:R,type:K,style:null!==(O=null==oe?void 0:oe.RootContainer)&&void 0!==O?O:{}},{children:[!J&&(!!E||!!ie)&&e(g,Object.assign({invalid:!!ie},{children:[!!ie&&n(v,{width:16,height:16}),ie||E]})),e(m,Object.assign({variant:q,state:R,width:i.width,isActive:"active"===R||ne,isInvalid:_,style:null!==(k=null==oe?void 0:oe.InputWrapper)&&void 0!==k?k:{},version:Y},{children:[!!Z&&n(f,Object.assign({variant:q,iconSize:le,onClick:()=>de(null==z?void 0:z.callback),isLeft:!0,style:null!==(T=null==oe?void 0:oe.IconHolder)&&void 0!==T?T:{}},{children:n(Z,{})})),!!V&&n(x,Object.assign({variant:q},{children:V})),"default"===q&&n(b,{children:me()}),"small"===q&&n(y,{children:me()}),!!$&&n(f,Object.assign({variant:q,iconSize:le,onClick:()=>de(null==B?void 0:B.callback),isLeft:!1},{children:n($,{})})),!!P&&n(j,Object.assign({variant:q},{children:P})),N&&N.text&&n(s,{buttonText:N.text,onClick:()=>de(null==N?void 0:N.onClick)})]})),(!!D||!!M)&&e(C,Object.assign({invalid:_},{children:[e(d,{children:[D,S?n("span",{children:"*"}):""]}),M>0&&e(I,{children:[null!==(F=null===(A=i.value)||void 0===A?void 0:A.length)&&void 0!==F?F:0,"/",M]})]}))]}))}));w.displayName="Input";export{w as Input};
|