forstok-ui-lib 8.10.0 → 8.10.3
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/index.d.ts +12 -8
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2 -2
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/components/date/index.tsx +101 -59
- package/src/components/date/ref.tsx +88 -63
- package/src/components/textarea/ref.tsx +8 -2
package/dist/index.d.ts
CHANGED
|
@@ -764,10 +764,12 @@ type TDate$1 = {
|
|
|
764
764
|
allowEmpty?: boolean;
|
|
765
765
|
setForceUpdate?: TState<boolean>;
|
|
766
766
|
showTimeInput?: boolean;
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
767
|
+
minDate?: any;
|
|
768
|
+
minTime?: any;
|
|
769
|
+
"data-qa-id"?: string;
|
|
770
|
+
"data-tip"?: string;
|
|
771
|
+
"data-place"?: string;
|
|
772
|
+
"data-type"?: string;
|
|
771
773
|
};
|
|
772
774
|
declare const DateComponent: react.ForwardRefExoticComponent<TDate$1 & react.RefAttributes<unknown>>;
|
|
773
775
|
|
|
@@ -790,11 +792,13 @@ type TDate = {
|
|
|
790
792
|
placeholderText?: string;
|
|
791
793
|
portalId?: string;
|
|
792
794
|
isIcon?: boolean;
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
795
|
+
"data-qa-id"?: string;
|
|
796
|
+
"data-tip"?: string;
|
|
797
|
+
"data-place"?: string;
|
|
798
|
+
"data-type"?: string;
|
|
797
799
|
disabled?: boolean;
|
|
800
|
+
minDate?: any;
|
|
801
|
+
minTime?: any;
|
|
798
802
|
};
|
|
799
803
|
declare const DateRefComponent: react.ForwardRefExoticComponent<TDate & react.RefAttributes<unknown>>;
|
|
800
804
|
|
package/dist/index.js
CHANGED
|
@@ -4562,7 +4562,7 @@ function O(e,t){if(!1===e||null==e)throw new Error(t)}function M(e,t){if(!e){"un
|
|
|
4562
4562
|
${({$isError:e})=>{if(e)return t.css`
|
|
4563
4563
|
border:1px solid var(--err-clr-ln);
|
|
4564
4564
|
`}}
|
|
4565
|
-
`,Da=r.forwardRef(((t,i)=>{var{$isError:n,$isEmoji:a,$emojiStyles:o}=t,
|
|
4565
|
+
`,Da=r.forwardRef(((t,i)=>{var{$isError:n,$isEmoji:a,$emojiStyles:o,disabled:l}=t,s=b(t,["$isError","$isEmoji","$emojiStyles","disabled"]);const d=r.useRef(null);r.useImperativeHandle(i,(()=>d.current));return e.jsxs("div",{style:{position:"relative"},children:[e.jsx(ba,Object.assign({ref:d,$isError:n,disabled:l},s)),a?e.jsx(Aa,Object.assign({$mode:"textarea",evChange:e=>{var t,r,i;const n=d.current;if(!n)return;const a=null!==(t=n.selectionStart)&&void 0!==t?t:n.value.length,o=null!==(r=n.selectionEnd)&&void 0!==r?r:n.value.length,l=`${n.value.slice(0,a)}${e}${n.value.slice(o)}`,s=a+e.length,c=null===(i=Object.getOwnPropertyDescriptor(HTMLTextAreaElement.prototype,"value"))||void 0===i?void 0:i.set;null==c||c.call(n,l),n.focus(),n.setSelectionRange(s,s),n.dispatchEvent(new Event("input",{bubbles:!0}))},isDisabled:l},o&&{$emojiStyles:o})):null]})})),Ea=t.css`
|
|
4566
4566
|
align-items: center;
|
|
4567
4567
|
display: flex;
|
|
4568
4568
|
flex: 1;
|
|
@@ -4800,7 +4800,7 @@ function O(e,t){if(!1===e||null==e)throw new Error(t)}function M(e,t){if(!e){"un
|
|
|
4800
4800
|
border: 1px solid var(--ck-clr-ln);
|
|
4801
4801
|
border-radius: var(--ter-rd);
|
|
4802
4802
|
`}
|
|
4803
|
-
`,Ua=r.forwardRef(((t,i)=>{var{dateFormat:n="MMM dd, yyyy",name:a,evChange:o,isField:l,saveFormat:s,showFormat:d,evChangeCustom:c,value:C,isForceUpdate:p,setForceUpdate:g,isError:
|
|
4803
|
+
`,Ua=r.forwardRef(((t,i)=>{var{dateFormat:n="MMM dd, yyyy",name:a,evChange:o,isField:l,saveFormat:s,showFormat:d,evChangeCustom:c,value:C,isForceUpdate:p,setForceUpdate:g,minDate:h,minTime:x,isError:m=!1,showTimeInput:u=!1,allowEmpty:v=!1}=t,f=b(t,["dateFormat","name","evChange","isField","saveFormat","showFormat","evChangeCustom","value","isForceUpdate","setForceUpdate","minDate","minTime","isError","showTimeInput","allowEmpty"]);const[w,F]=r.useState(C||(v?null:new Date)),D=e=>{F(e),o&&o(a,e),l&&c&&c(a,e?A.default(e).format(s):e)};return r.useEffect((()=>{if(p){const e=C||(v?null:new Date);F(e),g&&g(!1)}}),[p,g,C,v]),e.jsxs(Ya,Object.assign({$isError:m},f["data-qa-id"]&&{"data-qa-id":f["data-qa-id"]},{children:[e.jsx(y.default,Object.assign({selected:w,name:a,portalId:"popup-portal",dateFormat:n,onChange:D,showTimeInput:u,onKeyDown:e=>e.preventDefault(),ref:i},h&&{minDate:h},x&&{minTime:x})),v&&w?e.jsx(Va,{onClick:()=>D(null),title:"clear",children:e.jsx("svg",{height:"20",width:"20",viewBox:"0 0 20 20","aria-hidden":"true",focusable:"false",children:e.jsx("path",{d:"M14.348 14.849c-0.469 0.469-1.229 0.469-1.697 0l-2.651-3.030-2.651 3.029c-0.469 0.469-1.229 0.469-1.697 0-0.469-0.469-0.469-1.229 0-1.697l2.758-3.15-2.759-3.152c-0.469-0.469-0.469-1.228 0-1.697s1.228-0.469 1.697 0l2.652 3.031 2.651-3.031c0.469-0.469 1.228-0.469 1.697 0s0.469 1.229 0 1.697l-2.758 3.152 2.758 3.15c0.469 0.469 0.469 1.229 0 1.698z"})})}):null]}))})),Ra=r.forwardRef(((t,i)=>{const{dateFormat:n="MMM dd, yyyy",name:a,evChange:o,isField:l,saveFormat:s,showFormat:d,evChangeCustom:c,value:C,reset:p,setReset:g,isForceUpdate:h,setForceUpdate:x,isError:m=!1,showTimeInput:u=!1,allowEmpty:v=!1,placeholderText:f,portalId:w,isIcon:F,disabled:D,minDate:E,minTime:B}=t,j=b(t,["dateFormat","name","evChange","isField","saveFormat","showFormat","evChangeCustom","value","reset","setReset","isForceUpdate","setForceUpdate","isError","showTimeInput","allowEmpty","placeholderText","portalId","isIcon","disabled","minDate","minTime"]),[k,O]=r.useState(void 0!==C?C:v?null:new Date),M=e=>{O(e),o&&o(a,e),l&&c&&c(a,e?A.default(e).format(s):e)};return r.useEffect((()=>{if(p&&(O(null),g&&g(!1)),h){const e=C||(v?null:new Date);O(e),x&&x(!1)}}),[h,x,C,v,p,g]),e.jsxs(Ya,Object.assign({$isError:m},j["data-tip"]&&{"data-tip":j["data-tip"],"data-place":j["data-place"],"data-type":j["data-type"]},j["data-qa-id"]&&{"data-qa-id":j["data-qa-id"]},{children:[F&&e.jsx(yn,{$name:"calendar",$width:"20px"}),e.jsx(y.default,Object.assign({selected:k,name:a,dateFormat:n,onChange:M,showTimeInput:u,onKeyDown:e=>e.preventDefault(),placeholderText:f,ref:i},D&&{disabled:!0},w&&{portalId:w},E&&{minDate:E},B&&{minTime:B})),v&&k?e.jsx(Va,{onClick:()=>M(null),title:"clear",children:e.jsx("svg",{height:"20",width:"20",viewBox:"0 0 20 20","aria-hidden":"true",focusable:"false",children:e.jsx("path",{d:"M14.348 14.849c-0.469 0.469-1.229 0.469-1.697 0l-2.651-3.030-2.651 3.029c-0.469 0.469-1.229 0.469-1.697 0-0.469-0.469-0.469-1.229 0-1.697l2.758-3.15-2.759-3.152c-0.469-0.469-0.469-1.228 0-1.697s1.228-0.469 1.697 0l2.652 3.031 2.651-3.031c0.469-0.469 1.228-0.469 1.697 0s0.469 1.229 0 1.697l-2.758 3.152 2.758 3.15c0.469 0.469 0.469 1.229 0 1.698z"})})}):null]}))})),Ga=m.default.div`
|
|
4804
4804
|
display: grid;
|
|
4805
4805
|
`,Za=m.default.div`
|
|
4806
4806
|
display: grid;
|