1mpacto-react-ui 0.0.28 → 0.0.30
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.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +22 -22
- package/dist/index.mjs.map +1 -1
- package/dist/src/hooks/useAsyncDebounce.d.ts +1 -1
- package/dist/src/hooks/useCombinedResizeObserver.d.ts +1 -1
- package/dist/src/interfaces/components/FilterContainer/index.d.ts +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
@@ -106,5 +106,5 @@ You should wrap it with \`css\` like this:
|
|
106
106
|
Prefix can't start with '-' when allowNegative is true.
|
107
107
|
prefix: `+a+`
|
108
108
|
allowNegative: `+o+`
|
109
|
-
`),o=!1),Object.assign(Object.assign({},e),{allowNegative:o})}function u$(e){e=i$(e),e.decimalSeparator,e.allowedDecimalSeparators,e.thousandsGroupStyle;var t=e.suffix,n=e.allowNegative,r=e.allowLeadingZeros,a=e.onKeyDown;a===void 0&&(a=fn);var o=e.onBlur;o===void 0&&(o=fn);var i=e.thousandSeparator,u=e.decimalScale,s=e.fixedDecimalScale,l=e.prefix;l===void 0&&(l="");var c=e.defaultValue,f=e.value,g=e.valueIsNumericString,d=e.onValueChange,m=Wl(e,["decimalSeparator","allowedDecimalSeparators","thousandsGroupStyle","suffix","allowNegative","allowLeadingZeros","onKeyDown","onBlur","thousandSeparator","decimalScale","fixedDecimalScale","prefix","defaultValue","value","valueIsNumericString","onValueChange"]),h=zi(e),y=h.decimalSeparator,p=h.allowedDecimalSeparators,b=function(B){return Df(B,e)},C=function(B,$){return a$(B,$,e)},w=ir(f)?c:f,x=g??r$(w,l,t);ir(f)?ir(c)||(x=x||typeof c=="number"):x=x||typeof f=="number";var I=function(B){return $b(B)?B:(typeof B=="number"&&(B=Ab(B)),x&&typeof u=="number"?xf(B,u,!!s):B)},F=Vb(I(f),I(c),!!x,b,C,d),D=F[0],T=D.numAsString,V=D.formattedValue,S=F[1],k=function(B){var $=B.target,L=B.key,H=$.selectionStart,G=$.selectionEnd,O=$.value;if(O===void 0&&(O=""),(L==="Backspace"||L==="Delete")&&G<l.length){B.preventDefault();return}if(H!==G){a(B);return}L==="Backspace"&&O[0]==="-"&&H===l.length+1&&n&&Fn($,1),u&&s&&(L==="Backspace"&&O[H-1]===y?(Fn($,H-1),B.preventDefault()):L==="Delete"&&O[H]===y&&B.preventDefault()),p!=null&&p.includes(L)&&O[H]===y&&Fn($,H+1);var W=i===!0?",":i;L==="Backspace"&&O[H-1]===W&&Fn($,H-1),L==="Delete"&&O[H]===W&&Fn($,H+1),a(B)},P=function(B){var $=T;if($.match(/\d/g)||($=""),r||($=Z5($)),s&&u&&($=xf($,u,s)),$!==T){var L=Df($,e);S({formattedValue:L,value:$,floatValue:parseFloat($)},{event:B,source:ja.event})}o(B)},R=function(B){return B===y?!0:mr(B)},_=function(B){var $=B.currentValue,L=B.lastValue,H=B.formattedValue,G=B.currentValueIndex,O=B.formattedValueIndex,W=$[G],oe=H[O],ye=Pb(L,$),J=ye.to;return G>=J.start&&G<J.end&&p&&p.includes(W)&&oe===y?!0:W===oe};return Object.assign(Object.assign({},m),{value:V,valueIsNumericString:!1,isValidInputCharacter:R,isCharacterSame:_,onValueChange:S,format:b,removeFormatting:C,getCaretBoundary:function(B){return o$(B,e)},onKeyDown:k,onBlur:P})}function s$(e){var t=u$(e);return v.createElement(kb,Object.assign({},t))}function l$(e,t){var n=t.format,r=t.allowEmptyFormatting,a=t.mask,o=t.patternChar;if(o===void 0&&(o="#"),e===""&&!r)return"";for(var i=0,u=n.split(""),s=0,l=n.length;s<l;s++)n[s]===o&&(u[s]=e[i]||Tb(a,i),i+=1);return u.join("")}function c$(e,t,n){t===void 0&&(t=Bb(e));var r=n.format,a=n.patternChar;a===void 0&&(a="#");var o=t.from,i=t.to,u=t.lastValue;u===void 0&&(u="");var s=function(y){return r[y]===a},l=function(y,p){for(var b="",C=0;C<y.length;C++)s(p+C)&&mr(y[C])&&(b+=y[C]);return b},c=function(y){return y.replace(/[^0-9]/g,"")};if(!r.match(/\d/))return c(e);if((u===""||o.end-o.start===u.length)&&e.length===r.length){for(var f="",g=0;g<e.length;g++)if(s(g))mr(e[g])&&(f+=e[g]);else if(e[g]!==r[g])return c(e);return f}var d=u.substring(0,o.start),m=e.substring(i.start,i.end),h=u.substring(o.end);return""+l(d,0)+c(m)+l(h,o.end)}function d$(e,t){var n=t.format,r=t.mask,a=t.patternChar;a===void 0&&(a="#");var o=Array.from({length:e.length+1}).map(function(){return!0}),i=0,u=-1,s={};n.split("").forEach(function(g,d){var m=void 0;g===a&&(i++,m=Tb(r,i-1),u===-1&&e[d]===m&&(u=d)),s[d]=m});for(var l=function(g){return n[g]===a&&e[g]!==s[g]},c=0,f=o.length;c<f;c++)o[c]=c===u||l(c)||l(c-1);return o[n.indexOf(a)]=!0,o}function f$(e){var t=e.mask;if(t){var n=t==="string"?t:t.toString();if(n.match(/\d/g))throw new Error("Mask "+t+" should not contain numeric character;")}}function g$(e,t){return e===""?!0:!(t!=null&&t.match(/\d/))&&typeof e=="string"&&(!!e.match(/^\d+$/)||e==="")}function m$(e){e.mask,e.allowEmptyFormatting;var t=e.format,n=e.inputMode;n===void 0&&(n="numeric");var r=e.onKeyDown;r===void 0&&(r=fn);var a=e.patternChar;a===void 0&&(a="#");var o=e.value,i=e.defaultValue,u=e.valueIsNumericString,s=Wl(e,["mask","allowEmptyFormatting","format","inputMode","onKeyDown","patternChar","value","defaultValue","valueIsNumericString"]);f$(e);var l=function(m){return d$(m,e)},c=function(m){var h=m.key,y=m.target,p=y.selectionStart,b=y.selectionEnd,C=y.value;if(p!==b){r(m);return}var w=p;if(h==="Backspace"||h==="Delete"){var x="right";if(h==="Backspace"){for(;w>0&&t[w-1]!==a;)w--;x="left"}else{for(var I=t.length;w<I&&t[w]!==a;)w++;x="right"}w=wi(C,w,l(C),x)}else t[w]!==a&&h!=="ArrowLeft"&&h!=="ArrowRight"&&(w=wi(C,w+1,l(C),"right"));w!==p&&Fn(y,w),r(m)},f=ir(o)?i:o,g=u??g$(f,t),d=Object.assign(Object.assign({},e),{valueIsNumericString:g});return Object.assign(Object.assign({},s),{value:o,defaultValue:i,valueIsNumericString:g,inputMode:n,format:function(m){return l$(m,d)},removeFormatting:function(m,h){return c$(m,h,d)},getCaretBoundary:l,onKeyDown:c})}function p$(e){var t=m$(e);return v.createElement(kb,Object.assign({},t))}const h$=({max:e,min:t,onChange:n,...r})=>E.jsx(s$,{isAllowed:a=>e&&Number(a.value)>e?(typeof n=="function"&&n({target:{value:e.toString()}}),!1):t&&Number(a.value)<t?(typeof n=="function"&&n({target:{value:t.toString()}}),!1):!0,onValueChange:a=>{typeof n=="function"&&n({target:{value:a.value}})},decimalSeparator:",",thousandSeparator:".",decimalScale:2,valueIsNumericString:!0,thousandsGroupStyle:"thousand",...r}),b$=({children:e,containerId:t="portal-root"})=>{const[n,r]=v.useState(null);return v.useEffect(()=>{let a=document.getElementById(t);return a||(a=document.createElement("div"),a.id=t,document.body.appendChild(a)),r(a),()=>{a&&!document.getElementById(t)&&document.body.removeChild(a)}},[t]),n?za.createPortal(e,n):null};function v$(e,t=null){const[n,r]=v.useState(!1);return v.useEffect(()=>{let a=null,o=null;const i=()=>{const u=a instanceof HTMLElement?a.getBoundingClientRect().width:window.innerWidth,s=window.matchMedia(e.replace("WIDTH",u.toString()));r(s.matches)};if(t){if(a=document.getElementById(t),!a)return;o=new ResizeObserver(i),o.observe(a)}else a=window,window.addEventListener("resize",i);return i(),()=>{o?o.disconnect():window.removeEventListener("resize",i)}},[e,t]),n}const y$=e=>{const[t,n]=v.useState(e.hours*3600),[r,a]=v.useState(e.running??!1);return v.useEffect(()=>{let s;return r&&(s=setInterval(()=>{n(l=>l-1)},e.intervalMs)),()=>{s&&clearInterval(s)}},[r,e.intervalMs]),{count:t,startCountdown:()=>{a(!0)},stopCountdown:()=>{a(!1)},resetCountdown:()=>{n(e.hours*3600),a(!1)}}};function C$(e,t=0){const n=v.useRef({promise:null,resolve:null,reject:null,timeout:null});return v.useCallback((...a)=>(n.current.timeout&&clearTimeout(n.current.timeout),n.current.promise||(n.current.promise=new Promise((o,i)=>{n.current.resolve=o,n.current.reject=i})),n.current.timeout=setTimeout(()=>{e(...a).then(o=>{n.current.resolve&&n.current.resolve(o)}).catch(o=>{n.current.reject&&n.current.reject(o)}).finally(()=>{n.current.promise=null,n.current.resolve=null,n.current.reject=null,n.current.timeout=null})},t),n.current.promise),[e,t])}const x$=
|
109
|
+
`),o=!1),Object.assign(Object.assign({},e),{allowNegative:o})}function u$(e){e=i$(e),e.decimalSeparator,e.allowedDecimalSeparators,e.thousandsGroupStyle;var t=e.suffix,n=e.allowNegative,r=e.allowLeadingZeros,a=e.onKeyDown;a===void 0&&(a=fn);var o=e.onBlur;o===void 0&&(o=fn);var i=e.thousandSeparator,u=e.decimalScale,s=e.fixedDecimalScale,l=e.prefix;l===void 0&&(l="");var c=e.defaultValue,f=e.value,g=e.valueIsNumericString,d=e.onValueChange,m=Wl(e,["decimalSeparator","allowedDecimalSeparators","thousandsGroupStyle","suffix","allowNegative","allowLeadingZeros","onKeyDown","onBlur","thousandSeparator","decimalScale","fixedDecimalScale","prefix","defaultValue","value","valueIsNumericString","onValueChange"]),h=zi(e),y=h.decimalSeparator,p=h.allowedDecimalSeparators,b=function(B){return Df(B,e)},C=function(B,$){return a$(B,$,e)},w=ir(f)?c:f,x=g??r$(w,l,t);ir(f)?ir(c)||(x=x||typeof c=="number"):x=x||typeof f=="number";var I=function(B){return $b(B)?B:(typeof B=="number"&&(B=Ab(B)),x&&typeof u=="number"?xf(B,u,!!s):B)},F=Vb(I(f),I(c),!!x,b,C,d),D=F[0],T=D.numAsString,V=D.formattedValue,S=F[1],k=function(B){var $=B.target,L=B.key,H=$.selectionStart,G=$.selectionEnd,O=$.value;if(O===void 0&&(O=""),(L==="Backspace"||L==="Delete")&&G<l.length){B.preventDefault();return}if(H!==G){a(B);return}L==="Backspace"&&O[0]==="-"&&H===l.length+1&&n&&Fn($,1),u&&s&&(L==="Backspace"&&O[H-1]===y?(Fn($,H-1),B.preventDefault()):L==="Delete"&&O[H]===y&&B.preventDefault()),p!=null&&p.includes(L)&&O[H]===y&&Fn($,H+1);var W=i===!0?",":i;L==="Backspace"&&O[H-1]===W&&Fn($,H-1),L==="Delete"&&O[H]===W&&Fn($,H+1),a(B)},P=function(B){var $=T;if($.match(/\d/g)||($=""),r||($=Z5($)),s&&u&&($=xf($,u,s)),$!==T){var L=Df($,e);S({formattedValue:L,value:$,floatValue:parseFloat($)},{event:B,source:ja.event})}o(B)},R=function(B){return B===y?!0:mr(B)},_=function(B){var $=B.currentValue,L=B.lastValue,H=B.formattedValue,G=B.currentValueIndex,O=B.formattedValueIndex,W=$[G],oe=H[O],ye=Pb(L,$),J=ye.to;return G>=J.start&&G<J.end&&p&&p.includes(W)&&oe===y?!0:W===oe};return Object.assign(Object.assign({},m),{value:V,valueIsNumericString:!1,isValidInputCharacter:R,isCharacterSame:_,onValueChange:S,format:b,removeFormatting:C,getCaretBoundary:function(B){return o$(B,e)},onKeyDown:k,onBlur:P})}function s$(e){var t=u$(e);return v.createElement(kb,Object.assign({},t))}function l$(e,t){var n=t.format,r=t.allowEmptyFormatting,a=t.mask,o=t.patternChar;if(o===void 0&&(o="#"),e===""&&!r)return"";for(var i=0,u=n.split(""),s=0,l=n.length;s<l;s++)n[s]===o&&(u[s]=e[i]||Tb(a,i),i+=1);return u.join("")}function c$(e,t,n){t===void 0&&(t=Bb(e));var r=n.format,a=n.patternChar;a===void 0&&(a="#");var o=t.from,i=t.to,u=t.lastValue;u===void 0&&(u="");var s=function(y){return r[y]===a},l=function(y,p){for(var b="",C=0;C<y.length;C++)s(p+C)&&mr(y[C])&&(b+=y[C]);return b},c=function(y){return y.replace(/[^0-9]/g,"")};if(!r.match(/\d/))return c(e);if((u===""||o.end-o.start===u.length)&&e.length===r.length){for(var f="",g=0;g<e.length;g++)if(s(g))mr(e[g])&&(f+=e[g]);else if(e[g]!==r[g])return c(e);return f}var d=u.substring(0,o.start),m=e.substring(i.start,i.end),h=u.substring(o.end);return""+l(d,0)+c(m)+l(h,o.end)}function d$(e,t){var n=t.format,r=t.mask,a=t.patternChar;a===void 0&&(a="#");var o=Array.from({length:e.length+1}).map(function(){return!0}),i=0,u=-1,s={};n.split("").forEach(function(g,d){var m=void 0;g===a&&(i++,m=Tb(r,i-1),u===-1&&e[d]===m&&(u=d)),s[d]=m});for(var l=function(g){return n[g]===a&&e[g]!==s[g]},c=0,f=o.length;c<f;c++)o[c]=c===u||l(c)||l(c-1);return o[n.indexOf(a)]=!0,o}function f$(e){var t=e.mask;if(t){var n=t==="string"?t:t.toString();if(n.match(/\d/g))throw new Error("Mask "+t+" should not contain numeric character;")}}function g$(e,t){return e===""?!0:!(t!=null&&t.match(/\d/))&&typeof e=="string"&&(!!e.match(/^\d+$/)||e==="")}function m$(e){e.mask,e.allowEmptyFormatting;var t=e.format,n=e.inputMode;n===void 0&&(n="numeric");var r=e.onKeyDown;r===void 0&&(r=fn);var a=e.patternChar;a===void 0&&(a="#");var o=e.value,i=e.defaultValue,u=e.valueIsNumericString,s=Wl(e,["mask","allowEmptyFormatting","format","inputMode","onKeyDown","patternChar","value","defaultValue","valueIsNumericString"]);f$(e);var l=function(m){return d$(m,e)},c=function(m){var h=m.key,y=m.target,p=y.selectionStart,b=y.selectionEnd,C=y.value;if(p!==b){r(m);return}var w=p;if(h==="Backspace"||h==="Delete"){var x="right";if(h==="Backspace"){for(;w>0&&t[w-1]!==a;)w--;x="left"}else{for(var I=t.length;w<I&&t[w]!==a;)w++;x="right"}w=wi(C,w,l(C),x)}else t[w]!==a&&h!=="ArrowLeft"&&h!=="ArrowRight"&&(w=wi(C,w+1,l(C),"right"));w!==p&&Fn(y,w),r(m)},f=ir(o)?i:o,g=u??g$(f,t),d=Object.assign(Object.assign({},e),{valueIsNumericString:g});return Object.assign(Object.assign({},s),{value:o,defaultValue:i,valueIsNumericString:g,inputMode:n,format:function(m){return l$(m,d)},removeFormatting:function(m,h){return c$(m,h,d)},getCaretBoundary:l,onKeyDown:c})}function p$(e){var t=m$(e);return v.createElement(kb,Object.assign({},t))}const h$=({max:e,min:t,onChange:n,...r})=>E.jsx(s$,{isAllowed:a=>e&&Number(a.value)>e?(typeof n=="function"&&n({target:{value:e.toString()}}),!1):t&&Number(a.value)<t?(typeof n=="function"&&n({target:{value:t.toString()}}),!1):!0,onValueChange:a=>{typeof n=="function"&&n({target:{value:a.value}})},decimalSeparator:",",thousandSeparator:".",decimalScale:2,valueIsNumericString:!0,thousandsGroupStyle:"thousand",...r}),b$=({children:e,containerId:t="portal-root"})=>{const[n,r]=v.useState(null);return v.useEffect(()=>{let a=document.getElementById(t);return a||(a=document.createElement("div"),a.id=t,document.body.appendChild(a)),r(a),()=>{a&&!document.getElementById(t)&&document.body.removeChild(a)}},[t]),n?za.createPortal(e,n):null};function v$(e,t=null){const[n,r]=v.useState(!1);return v.useEffect(()=>{let a=null,o=null;const i=()=>{const u=a instanceof HTMLElement?a.getBoundingClientRect().width:window.innerWidth,s=window.matchMedia(e.replace("WIDTH",u.toString()));r(s.matches)};if(t){if(a=document.getElementById(t),!a)return;o=new ResizeObserver(i),o.observe(a)}else a=window,window.addEventListener("resize",i);return i(),()=>{o?o.disconnect():window.removeEventListener("resize",i)}},[e,t]),n}const y$=e=>{const[t,n]=v.useState(e.hours*3600),[r,a]=v.useState(e.running??!1);return v.useEffect(()=>{let s;return r&&(s=setInterval(()=>{n(l=>l-1)},e.intervalMs)),()=>{s&&clearInterval(s)}},[r,e.intervalMs]),{count:t,startCountdown:()=>{a(!0)},stopCountdown:()=>{a(!1)},resetCountdown:()=>{n(e.hours*3600),a(!1)}}};function C$(e,t=0){const n=v.useRef({promise:null,resolve:null,reject:null,timeout:null});return v.useCallback((...a)=>(n.current.timeout&&clearTimeout(n.current.timeout),n.current.promise||(n.current.promise=new Promise((o,i)=>{n.current.resolve=o,n.current.reject=i})),n.current.timeout=setTimeout(()=>{e(...a).then(o=>{n.current.resolve&&n.current.resolve(o)}).catch(o=>{n.current.reject&&n.current.reject(o)}).finally(()=>{n.current.promise=null,n.current.resolve=null,n.current.reject=null,n.current.timeout=null})},t),n.current.promise),[e,t])}const x$=e=>{const[t,n]=v.useState({width:window.innerWidth,height:window.innerHeight}),[r,a]=v.useState({width:0,height:0,top:0,left:0,bottom:0,right:0,x:0,y:0}),o=v.useRef(null);return v.useLayoutEffect(()=>{const i=()=>{n({width:window.innerWidth,height:window.innerHeight})},u=c=>{for(const f of c){const{width:g,height:d,top:m,left:h,bottom:y,right:p,x:b,y:C}=f.contentRect;a({width:g,height:d,top:m,left:h,bottom:y,right:p,x:b,y:C})}},s=o.current,l=new ResizeObserver(u);return s&&l.observe(s),window.addEventListener("resize",i),()=>{s&&l.unobserve(s),window.removeEventListener("resize",i)}},[e]),{ref:o,windowSize:t,contentRect:r}};exports.Badges=Db;exports.Breadcrumbs=S5;exports.Button=jr;exports.ButtonIcon=xb;exports.Calendar=Gl;exports.CalendarRange=yb;exports.Chips=wb;exports.Collapse=T5;exports.ConfigColors=k1;exports.ConfigTable=Lt;exports.DatePicker=l5;exports.DateRangePicker=Cb;exports.DefaultCheckedChecboxIcon=Ib;exports.DefaultRadioChecboxIcon=Eb;exports.FilterContainer=L5;exports.FilterDate=c5;exports.InputFloatingInner=ug;exports.InputReguler=sg;exports.ListVirtualization=mm;exports.ModalDialog=k5;exports.NumberFormat=h$;exports.Pagination=wx;exports.PatternFormat=p$;exports.Popover=Ya;exports.PortalComponent=b$;exports.RadioCheckbox=Hl;exports.RadioCheckboxLabel=C5;exports.SelectDropdownContainer=rp;exports.SelectDropdownContainerComponents=zm;exports.Sidebar=A5;exports.Switch=f5;exports.TPublish=L1;exports.TabPanel=Dx;exports.Table=px;exports.TableVirtualization=ol;exports.Tabs=xx;exports.Timeline=O5;exports.configScreens=_1;exports.configTypography=M1;exports.configTypographyLabaBisnis=Tf;exports.configTypographyPayhere=Bf;exports.formatDate=Af;exports.formatDateRange=B1;exports.formatNumber=Pr;exports.groupByKey=Pf;exports.transformDataHistory=T1;exports.useAsyncDebounce=C$;exports.useCombinedResizeObserver=x$;exports.useCountdown=y$;exports.useElementOrWindowMediaQuery=v$;exports.utilTable=EC;
|
110
110
|
//# sourceMappingURL=index.cjs.map
|