@mailstep/design-system 0.7.69-beta.0 → 0.7.69-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/package.json +1 -1
- package/ui/Forms/Input/Input.js +1 -0
- package/ui/index.es.js +1 -1
- package/ui/index.umd.js +1 -1
package/package.json
CHANGED
package/ui/Forms/Input/Input.js
CHANGED
|
@@ -58,6 +58,7 @@ export var Input = function (_a) {
|
|
|
58
58
|
}
|
|
59
59
|
}, [forceFocus, onBlur]);
|
|
60
60
|
var handleKeyDown = useCallback(function (event) {
|
|
61
|
+
console.log('event.key', event.key);
|
|
61
62
|
if (event.key === 'Enter') {
|
|
62
63
|
onEnter === null || onEnter === void 0 ? void 0 : onEnter();
|
|
63
64
|
}
|
package/ui/index.es.js
CHANGED
|
@@ -27854,7 +27854,7 @@ const _fe = (e) => {
|
|
|
27854
27854
|
var ee, oe, he, ye, _e;
|
|
27855
27855
|
$ == null || $(X), R && (((oe = (ee = X.relatedTarget) == null ? void 0 : ee.tagName) == null ? void 0 : oe.toLowerCase()) !== "input" || !qfe.includes((ye = (he = X.relatedTarget) == null ? void 0 : he.type) == null ? void 0 : ye.toLowerCase())) && ((_e = X.target) == null || _e.focus());
|
|
27856
27856
|
}, [R, $]), ae = fe((X) => {
|
|
27857
|
-
X.key === "Enter" && (J == null || J());
|
|
27857
|
+
console.log("event.key", X.key), X.key === "Enter" && (J == null || J());
|
|
27858
27858
|
}, [J]);
|
|
27859
27859
|
return /* @__PURE__ */ p.jsxs(F0, { spaceAround: A, className: C, children: [
|
|
27860
27860
|
/* @__PURE__ */ p.jsxs(Jfe, { children: [
|
package/ui/index.umd.js
CHANGED
|
@@ -1681,7 +1681,7 @@ Me.version="2.30.1",W1e(en),Me.fn=Ee,Me.min=Mde,Me.max=Lde,Me.now=Ode,Me.utc=Xa,
|
|
|
1681
1681
|
display: block;
|
|
1682
1682
|
}
|
|
1683
1683
|
}
|
|
1684
|
-
`,JAe=["text","number","password"],$a=({appearance:e="primary",type:t,name:n,label:r,value:i,icon:o,variant:l="default",disabled:c,error:d,isInvalid:f=void 0,spaceAround:A=!1,inputRef:g,autoComplete:v,isLoading:y,className:w,suffix:S,suffixOnClick:E,errorAppearance:I,iconPlacement:M="left",iconOnClick:L,iconTooltip:D,big:P,showArrowsController:j=!1,onClear:N,alwaysShowClear:W,setNumber:_,onEnter:X,forceFocus:B=!1,autoFocus:H=!1,onBlur:ee,asTextArea:oe=!1,...ae})=>{const q=f!==void 0?f:!!d,ce=!!N&&(!!i||W)&&!y,ge=!!S,fe=j?"left":M,Y=C.useCallback(()=>{_==null||_(Q=>Q+1)},[_]),z=C.useCallback(()=>{_==null||_(Q=>Q>1?Q-1:1)},[_]),$=C.useRef(null),ie=g||$;C.useEffect(()=>{var Q;B&&!c&&!y&&((Q=ie==null?void 0:ie.current)==null||Q.focus())},[c,B,y]);const de=C.useCallback(Q=>{var te,le,pe,ye,We;ee==null||ee(Q),B&&(((le=(te=Q.relatedTarget)==null?void 0:te.tagName)==null?void 0:le.toLowerCase())!=="input"||!JAe.includes((ye=(pe=Q.relatedTarget)==null?void 0:pe.type)==null?void 0:ye.toLowerCase()))&&((We=Q.target)==null||We.focus())},[B,ee]),se=C.useCallback(Q=>{Q.key==="Enter"&&(X==null||X())},[X]);return p.jsxs(ms,{spaceAround:A,className:w,children:[p.jsxs(_Ae,{children:[r&&p.jsx(Nc,{htmlFor:n,children:r}),p.jsxs(UAe,{hasValue:!!i,$isInvalid:q,disabled:!!c,$icon:o,variant:l,children:[p.jsx(GAe,{autoFocus:H,className:`${e} ${fe}`,type:t,name:n,"data-cy":n?`${n}Inp`:void 0,"data-testid":n?`input-${n}`:void 0,value:i,$isInvalid:q,$isClearable:ce,$hasSuffix:ge,disabled:c||y,ref:ie,autoComplete:v,onKeyDown:se,big:P,onBlur:de,$asTextArea:oe,variant:l,...ae}),o&&p.jsx(Ml,{right:j?!1:M==="right",hasValue:!!i,$isInvalid:q,disabled:c,onClick:L,children:p.jsxs(YAe,{children:[p.jsx(lt,{icon:o}),D&&p.jsx("span",{children:D})]})}),j&&p.jsxs(HAe,{children:[p.jsx(hR,{onClick:Y,children:p.jsx(lt,{icon:"goUp",fill:"gray1"})}),p.jsx(hR,{onClick:z,children:p.jsx(lt,{icon:"goDown",fill:"gray1"})})]}),ce&&p.jsx(VAe,{right:!0,onClick:N,children:p.jsx(lt,{icon:"deleteX",size:"16px",fill:"gray1"})}),S&&!y&&p.jsx(ZAe,{onClick:E,$isPointer:!!E,$isInvalid:q,children:S}),y&&p.jsx(Ml,{right:!0,children:p.jsx(l1,{variant:"sm"})})]})]}),d&&p.jsx(b1,{appearance:I,children:d})]})};function XAe(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,Zm(e,t)}function Zm(e,t){return Zm=Object.setPrototypeOf||function(r,i){return r.__proto__=i,r},Zm(e,t)}function QAe(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,o;for(o=0;o<r.length;o++)i=r[o],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}function pR(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function KAe(e,t,n){return e===t?!0:e.correspondingElement?e.correspondingElement.classList.contains(n):e.classList.contains(n)}function qAe(e,t,n){if(e===t)return!0;for(;e.parentNode||e.host;){if(e.parentNode&&KAe(e,t,n))return!0;e=e.parentNode||e.host}return e}function $Ae(e){return document.documentElement.clientWidth<=e.clientX||document.documentElement.clientHeight<=e.clientY}var e3e=function(){if(!(typeof window>"u"||typeof window.addEventListener!="function")){var t=!1,n=Object.defineProperty({},"passive",{get:function(){t=!0}}),r=function(){};return window.addEventListener("testPassiveEventSupport",r,n),window.removeEventListener("testPassiveEventSupport",r,n),t}};function t3e(e){return e===void 0&&(e=0),function(){return++e}}var n3e=t3e(),Um,M3={},Ym={},r3e=["touchstart","touchmove"],i3e="ignore-react-onclickoutside";function gR(e,t){var n={},r=r3e.indexOf(t)!==-1;return r&&Um&&(n.passive=!e.props.preventDefault),n}function a3e(e,t){var n,r,i=e.displayName||e.name||"Component";return r=n=function(o){XAe(l,o);function l(d){var f;return f=o.call(this,d)||this,f.__outsideClickHandler=function(A){if(typeof f.__clickOutsideHandlerProp=="function"){f.__clickOutsideHandlerProp(A);return}var g=f.getInstance();if(typeof g.props.handleClickOutside=="function"){g.props.handleClickOutside(A);return}if(typeof g.handleClickOutside=="function"){g.handleClickOutside(A);return}throw new Error("WrappedComponent: "+i+" lacks a handleClickOutside(event) function for processing outside click events.")},f.__getComponentNode=function(){var A=f.getInstance();return typeof A.setClickOutsideRef=="function"?A.setClickOutsideRef():yo.findDOMNode(A)},f.enableOnClickOutside=function(){if(!(typeof document>"u"||Ym[f._uid])){typeof Um>"u"&&(Um=e3e()),Ym[f._uid]=!0;var A=f.props.eventTypes;A.forEach||(A=[A]),M3[f._uid]=function(g){if(f.componentNode!==null&&!(f.initTimeStamp>g.timeStamp)&&(f.props.preventDefault&&g.preventDefault(),f.props.stopPropagation&&g.stopPropagation(),!(f.props.excludeScrollbar&&$Ae(g)))){var v=g.composed&&g.composedPath&&g.composedPath().shift()||g.target;qAe(v,f.componentNode,f.props.outsideClickIgnoreClass)===document&&f.__outsideClickHandler(g)}},A.forEach(function(g){document.addEventListener(g,M3[f._uid],gR(pR(f),g))})}},f.disableOnClickOutside=function(){delete Ym[f._uid];var A=M3[f._uid];if(A&&typeof document<"u"){var g=f.props.eventTypes;g.forEach||(g=[g]),g.forEach(function(v){return document.removeEventListener(v,A,gR(pR(f),v))}),delete M3[f._uid]}},f.getRef=function(A){return f.instanceRef=A},f._uid=n3e(),f.initTimeStamp=performance.now(),f}var c=l.prototype;return c.getInstance=function(){if(e.prototype&&!e.prototype.isReactComponent)return this;var f=this.instanceRef;return f.getInstance?f.getInstance():f},c.componentDidMount=function(){typeof document>"u"||!document.createElement||(this.getInstance(),this.componentNode=this.__getComponentNode(),!this.props.disableOnClickOutside&&this.enableOnClickOutside())},c.componentDidUpdate=function(){this.componentNode=this.__getComponentNode()},c.componentWillUnmount=function(){this.disableOnClickOutside()},c.render=function(){var f=this.props;f.excludeScrollbar;var A=QAe(f,["excludeScrollbar"]);return e.prototype&&e.prototype.isReactComponent?A.ref=this.getRef:A.wrappedRef=this.getRef,A.disableOnClickOutside=this.disableOnClickOutside,A.enableOnClickOutside=this.enableOnClickOutside,C.createElement(e,A)},l}(C.Component),n.displayName="OnClickOutside("+i+")",n.defaultProps={eventTypes:["mousedown","touchstart"],excludeScrollbar:!1,outsideClickIgnoreClass:i3e,preventDefault:!1,stopPropagation:!1},n.getClass=function(){return e.getClass?e.getClass():e},r}var Es=(e=>(e.EVERY_TODAY="every-today",e.EVERY_YESTERDAY="every-yesterday",e))(Es||{}),X1=(e=>(e.FROM="from",e.TO="to",e.AT="at",e))(X1||{});const Jm={[Es.EVERY_TODAY]:Re._({id:"dataGrid.everyToday",message:"Every today"}),[Es.EVERY_YESTERDAY]:Re._({id:"dataGrid.everyYesterday",message:"Every yesterday"})},mR={[X1.FROM]:Re._({id:"dataGrid.timepicker.from",message:"from"}),[X1.TO]:Re._({id:"dataGrid.timepicker.to",message:"to"}),[X1.AT]:Re._({id:"dataGrid.timepicker.at",message:"at"})},vR=U.div`
|
|
1684
|
+
`,JAe=["text","number","password"],$a=({appearance:e="primary",type:t,name:n,label:r,value:i,icon:o,variant:l="default",disabled:c,error:d,isInvalid:f=void 0,spaceAround:A=!1,inputRef:g,autoComplete:v,isLoading:y,className:w,suffix:S,suffixOnClick:E,errorAppearance:I,iconPlacement:M="left",iconOnClick:L,iconTooltip:D,big:P,showArrowsController:j=!1,onClear:N,alwaysShowClear:W,setNumber:_,onEnter:X,forceFocus:B=!1,autoFocus:H=!1,onBlur:ee,asTextArea:oe=!1,...ae})=>{const q=f!==void 0?f:!!d,ce=!!N&&(!!i||W)&&!y,ge=!!S,fe=j?"left":M,Y=C.useCallback(()=>{_==null||_(Q=>Q+1)},[_]),z=C.useCallback(()=>{_==null||_(Q=>Q>1?Q-1:1)},[_]),$=C.useRef(null),ie=g||$;C.useEffect(()=>{var Q;B&&!c&&!y&&((Q=ie==null?void 0:ie.current)==null||Q.focus())},[c,B,y]);const de=C.useCallback(Q=>{var te,le,pe,ye,We;ee==null||ee(Q),B&&(((le=(te=Q.relatedTarget)==null?void 0:te.tagName)==null?void 0:le.toLowerCase())!=="input"||!JAe.includes((ye=(pe=Q.relatedTarget)==null?void 0:pe.type)==null?void 0:ye.toLowerCase()))&&((We=Q.target)==null||We.focus())},[B,ee]),se=C.useCallback(Q=>{console.log("event.key",Q.key),Q.key==="Enter"&&(X==null||X())},[X]);return p.jsxs(ms,{spaceAround:A,className:w,children:[p.jsxs(_Ae,{children:[r&&p.jsx(Nc,{htmlFor:n,children:r}),p.jsxs(UAe,{hasValue:!!i,$isInvalid:q,disabled:!!c,$icon:o,variant:l,children:[p.jsx(GAe,{autoFocus:H,className:`${e} ${fe}`,type:t,name:n,"data-cy":n?`${n}Inp`:void 0,"data-testid":n?`input-${n}`:void 0,value:i,$isInvalid:q,$isClearable:ce,$hasSuffix:ge,disabled:c||y,ref:ie,autoComplete:v,onKeyDown:se,big:P,onBlur:de,$asTextArea:oe,variant:l,...ae}),o&&p.jsx(Ml,{right:j?!1:M==="right",hasValue:!!i,$isInvalid:q,disabled:c,onClick:L,children:p.jsxs(YAe,{children:[p.jsx(lt,{icon:o}),D&&p.jsx("span",{children:D})]})}),j&&p.jsxs(HAe,{children:[p.jsx(hR,{onClick:Y,children:p.jsx(lt,{icon:"goUp",fill:"gray1"})}),p.jsx(hR,{onClick:z,children:p.jsx(lt,{icon:"goDown",fill:"gray1"})})]}),ce&&p.jsx(VAe,{right:!0,onClick:N,children:p.jsx(lt,{icon:"deleteX",size:"16px",fill:"gray1"})}),S&&!y&&p.jsx(ZAe,{onClick:E,$isPointer:!!E,$isInvalid:q,children:S}),y&&p.jsx(Ml,{right:!0,children:p.jsx(l1,{variant:"sm"})})]})]}),d&&p.jsx(b1,{appearance:I,children:d})]})};function XAe(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,Zm(e,t)}function Zm(e,t){return Zm=Object.setPrototypeOf||function(r,i){return r.__proto__=i,r},Zm(e,t)}function QAe(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,o;for(o=0;o<r.length;o++)i=r[o],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}function pR(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function KAe(e,t,n){return e===t?!0:e.correspondingElement?e.correspondingElement.classList.contains(n):e.classList.contains(n)}function qAe(e,t,n){if(e===t)return!0;for(;e.parentNode||e.host;){if(e.parentNode&&KAe(e,t,n))return!0;e=e.parentNode||e.host}return e}function $Ae(e){return document.documentElement.clientWidth<=e.clientX||document.documentElement.clientHeight<=e.clientY}var e3e=function(){if(!(typeof window>"u"||typeof window.addEventListener!="function")){var t=!1,n=Object.defineProperty({},"passive",{get:function(){t=!0}}),r=function(){};return window.addEventListener("testPassiveEventSupport",r,n),window.removeEventListener("testPassiveEventSupport",r,n),t}};function t3e(e){return e===void 0&&(e=0),function(){return++e}}var n3e=t3e(),Um,M3={},Ym={},r3e=["touchstart","touchmove"],i3e="ignore-react-onclickoutside";function gR(e,t){var n={},r=r3e.indexOf(t)!==-1;return r&&Um&&(n.passive=!e.props.preventDefault),n}function a3e(e,t){var n,r,i=e.displayName||e.name||"Component";return r=n=function(o){XAe(l,o);function l(d){var f;return f=o.call(this,d)||this,f.__outsideClickHandler=function(A){if(typeof f.__clickOutsideHandlerProp=="function"){f.__clickOutsideHandlerProp(A);return}var g=f.getInstance();if(typeof g.props.handleClickOutside=="function"){g.props.handleClickOutside(A);return}if(typeof g.handleClickOutside=="function"){g.handleClickOutside(A);return}throw new Error("WrappedComponent: "+i+" lacks a handleClickOutside(event) function for processing outside click events.")},f.__getComponentNode=function(){var A=f.getInstance();return typeof A.setClickOutsideRef=="function"?A.setClickOutsideRef():yo.findDOMNode(A)},f.enableOnClickOutside=function(){if(!(typeof document>"u"||Ym[f._uid])){typeof Um>"u"&&(Um=e3e()),Ym[f._uid]=!0;var A=f.props.eventTypes;A.forEach||(A=[A]),M3[f._uid]=function(g){if(f.componentNode!==null&&!(f.initTimeStamp>g.timeStamp)&&(f.props.preventDefault&&g.preventDefault(),f.props.stopPropagation&&g.stopPropagation(),!(f.props.excludeScrollbar&&$Ae(g)))){var v=g.composed&&g.composedPath&&g.composedPath().shift()||g.target;qAe(v,f.componentNode,f.props.outsideClickIgnoreClass)===document&&f.__outsideClickHandler(g)}},A.forEach(function(g){document.addEventListener(g,M3[f._uid],gR(pR(f),g))})}},f.disableOnClickOutside=function(){delete Ym[f._uid];var A=M3[f._uid];if(A&&typeof document<"u"){var g=f.props.eventTypes;g.forEach||(g=[g]),g.forEach(function(v){return document.removeEventListener(v,A,gR(pR(f),v))}),delete M3[f._uid]}},f.getRef=function(A){return f.instanceRef=A},f._uid=n3e(),f.initTimeStamp=performance.now(),f}var c=l.prototype;return c.getInstance=function(){if(e.prototype&&!e.prototype.isReactComponent)return this;var f=this.instanceRef;return f.getInstance?f.getInstance():f},c.componentDidMount=function(){typeof document>"u"||!document.createElement||(this.getInstance(),this.componentNode=this.__getComponentNode(),!this.props.disableOnClickOutside&&this.enableOnClickOutside())},c.componentDidUpdate=function(){this.componentNode=this.__getComponentNode()},c.componentWillUnmount=function(){this.disableOnClickOutside()},c.render=function(){var f=this.props;f.excludeScrollbar;var A=QAe(f,["excludeScrollbar"]);return e.prototype&&e.prototype.isReactComponent?A.ref=this.getRef:A.wrappedRef=this.getRef,A.disableOnClickOutside=this.disableOnClickOutside,A.enableOnClickOutside=this.enableOnClickOutside,C.createElement(e,A)},l}(C.Component),n.displayName="OnClickOutside("+i+")",n.defaultProps={eventTypes:["mousedown","touchstart"],excludeScrollbar:!1,outsideClickIgnoreClass:i3e,preventDefault:!1,stopPropagation:!1},n.getClass=function(){return e.getClass?e.getClass():e},r}var Es=(e=>(e.EVERY_TODAY="every-today",e.EVERY_YESTERDAY="every-yesterday",e))(Es||{}),X1=(e=>(e.FROM="from",e.TO="to",e.AT="at",e))(X1||{});const Jm={[Es.EVERY_TODAY]:Re._({id:"dataGrid.everyToday",message:"Every today"}),[Es.EVERY_YESTERDAY]:Re._({id:"dataGrid.everyYesterday",message:"Every yesterday"})},mR={[X1.FROM]:Re._({id:"dataGrid.timepicker.from",message:"from"}),[X1.TO]:Re._({id:"dataGrid.timepicker.to",message:"to"}),[X1.AT]:Re._({id:"dataGrid.timepicker.at",message:"at"})},vR=U.div`
|
|
1685
1685
|
display: flex;
|
|
1686
1686
|
justify-content: space-between;
|
|
1687
1687
|
align-items: center;
|