woocommerce/packages/woocommerce-blocks/build/checkout-blocks/contact-information-frontend.js

1 line
12 KiB
JavaScript
Raw Normal View History

2021-12-10 12:03:04 +00:00
(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[34],{175:function(e,t,n){"use strict";var c=n(14),r=n.n(c),a=n(23),o=n.n(a),i=n(6),l=n.n(i),s=(n(10),n(248),["children","className","headingLevel"]);t.a=function(e){var t=e.children,n=e.className,c=e.headingLevel,a=o()(e,s),i=l()("wc-block-components-title",n),u="h".concat(c);return React.createElement(u,r()({className:i},a),t)}},206:function(e,t){},248:function(e,t){},250:function(e,t){},258:function(e,t,n){"use strict";n.d(t,"a",(function(){return r})),n(10);var c=n(127),r=(n(250),function(e){var t=e.errorMessage,n=void 0===t?"":t,r=e.propertyName,a=void 0===r?"":r,o=e.elementId,i=void 0===o?"":o,l=Object(c.b)(),s=l.getValidationError,u=l.getValidationErrorId;if(!n||"string"!=typeof n){var d=s(a)||{};if(!d.message||d.hidden)return null;n=d.message}return React.createElement("div",{className:"wc-block-components-validation-error",role:"alert"},React.createElement("p",{id:u(i)},n))})},276:function(e,t,n){"use strict";var c=n(14),r=n.n(c),a=n(4),o=n.n(a),i=n(5),l=n.n(i),s=n(23),u=n.n(s),d=n(1),b=n(3),p=n(6),f=n.n(p),m=n(127),g=n(48),h=n(258),v=n(24),O=n(49),w=n(0),j=n(51),k=(n(206),["className","id","type","ariaLabel","ariaDescribedBy","label","screenReaderLabel","disabled","help","autoCapitalize","autoComplete","value","onChange","required","onBlur","feedback"]),E=Object(b.forwardRef)((function(e,t){var n=e.className,c=e.id,a=e.type,o=void 0===a?"text":a,i=e.ariaLabel,s=e.ariaDescribedBy,d=e.label,b=e.screenReaderLabel,p=e.disabled,m=e.help,g=e.autoCapitalize,h=void 0===g?"off":g,v=e.autoComplete,O=void 0===v?"off":v,E=e.value,y=void 0===E?"":E,R=e.onChange,_=e.required,N=void 0!==_&&_,C=e.onBlur,P=void 0===C?function(){}:C,S=e.feedback,D=u()(e,k),B=Object(w.useState)(!1),I=l()(B,2),x=I[0],A=I[1];return React.createElement("div",{className:f()("wc-block-components-text-input",n,{"is-active":x||y})},React.createElement("input",r()({type:o,id:c,value:y,ref:t,autoCapitalize:h,autoComplete:O,onChange:function(e){R(e.target.value)},onFocus:function(){return A(!0)},onBlur:function(e){P(e.target.value),A(!1)},"aria-label":i||d,disabled:p,"aria-describedby":m&&!s?c+"__help":s,required:N},D)),React.createElement(j.a,{label:d,screenReaderLabel:b||d,wrapperElement:"label",wrapperProps:{htmlFor:c},htmlFor:c}),!!m&&React.createElement("p",{id:c+"__help",className:"wc-block-components-text-input__help"},m),S)})),y=["className","instanceId","id","ariaDescribedBy","errorId","validateOnMount","focusOnMount","onChange","showError","errorMessage"];t.a=Object(v.withInstanceId)((function(e){var t=e.className,n=e.instanceId,c=e.id,a=e.ariaDescribedBy,i=e.errorId,s=e.validateOnMount,p=void 0===s||s,v=e.focusOnMount,w=void 0!==v&&v,j=e.onChange,k=e.showError,R=void 0===k||k,_=e.errorMessage,N=void 0===_?"":_,C=u()(e,y),P=Object(b.useState)(!0),S=l()(P,2),D=S[0],B=S[1],I=Object(b.useRef)(null),x=Object(m.b)(),A=x.getValidationError,F=x.hideValidationError,L=x.setValidationErrors,M=x.clearValidationError,V=x.getValidationErrorId,q=Object(g.b)().isBeforeProcessing,z=void 0!==c?c:"textinput-"+n,H=void 0!==i?i:z,W=Object(b.useCallback)((function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=I.current||null;if(t){t.value=t.value.trim();var n=t.checkValidity();n?M(H):L(o()({},H,{message:t.validationMessage||Object(d.__)("Invalid value.",'woocommerce'),hidden:e}))}}),[M,H,L]);Object(b.useEffect)((function(){var e;D&&(w&&(null===(e=I.current)||void 0===e||e.focus()),B(!1))}),[w,D,B]),Object(b.useEffect)((function(){D&&(p&&W(),B(!1))}),[D,B,p,W]),Object(b.useEffect)((function(){q&&W()}),[q,W]),Object(b.useEffect)((function(){return function(){M(H)}}),[M,H]);var J=A(H)||{};Object(O.c)(N)&&""!==N&&(J.message=N);var T=J.message&&!J.hidden,G=R&&T&&V(H)?V(H):a;return React.createElement(E,r()({className:f()(t,{"has-error":T}),"aria-invalid":!0===T,id:z,onBlur:function(){W(!1)},feedback:R&&React.createElement(h.a,{errorMessage:N,propertyName:H}),ref:I,onChange:function(e){F(H),j(e)},ariaDescribedBy:G},C))}))},345:function(e,t,n){"use strict";var c=n(14),r=n.n(c),a=n(18