woocommerce/packages/woocommerce-blocks/build/checkout-blocks/shipping-address-frontend.js

1 line
9.0 KiB
JavaScript
Raw Normal View History

2021-12-10 12:03:04 +00:00
(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[40],{175:function(e,t,n){"use strict";var c=n(14),i=n.n(c),r=n(23),o=n.n(r),a=n(6),s=n.n(a),l=(n(10),n(248),["children","className","headingLevel"]);t.a=function(e){var t=e.children,n=e.className,c=e.headingLevel,r=o()(e,l),a=s()("wc-block-components-title",n),u="h".concat(c);return React.createElement(u,i()({className:a},r),t)}},248:function(e,t){},345:function(e,t,n){"use strict";var c=n(14),i=n.n(c),r=n(188);t.a=function(e){return function(t){return function(n){var c=Object(r.a)(e,n);return React.createElement(t,i()({},n,c))}}}},346:function(e,t){},347:function(e,t,n){"use strict";var c=n(14),i=n.n(c),r=n(23),o=n.n(r),a=n(24),s=n(6),l=n.n(s),u=(n(348),["className","label","id","instanceId","onChange","children","hasError"]);t.a=Object(a.withInstanceId)((function(e){var t=e.className,n=e.label,c=e.id,r=e.instanceId,a=e.onChange,s=e.children,d=e.hasError,p=void 0!==d&&d,b=o()(e,u),h=c||"checkbox-control-".concat(r);return React.createElement("label",{className:l()("wc-block-components-checkbox",{"has-error":p},t),htmlFor:h},React.createElement("input",i()({id:h,className:"wc-block-components-checkbox__input",type:"checkbox",onChange:function(e){return a(e.target.checked)},"aria-invalid":!0===p},b)),React.createElement("svg",{className:"wc-block-components-checkbox__mark","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 20"},React.createElement("path",{d:"M9 16.2L4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4L9 16.2z"})),n&&React.createElement("span",{className:"wc-block-components-checkbox__label"},n),s)}))},348:function(e,t){},349:function(e,t,n){"use strict";var c=n(1);t.a=function(e){var t=e.defaultTitle,n=void 0===t?Object(c.__)("Step",'woocommerce'):t,i=e.defaultDescription,r=void 0===i?Object(c.__)("Step description text.",'woocommerce'):i,o=e.defaultShowStepNumber;return{title:{type:"string",default:n},description:{type:"string",default:r},showStepNumber:{type:"boolean",default:void 0===o||o}}}},350:function(e,t,n){"use strict";var c=n(6),i=n.n(c),r=(n(10),n(175)),o=(n(346),function(e){var t=e.title,n=e.stepHeadingContent;return React.createElement("div",{className:"wc-block-components-checkout-step__heading"},React.createElement(r.a,{"aria-hidden":"true",className:"wc-block-components-checkout-step__title",headingLevel:"2"},t),!!n&&React.createElement("span",{className:"wc-block-components-checkout-step__heading-content"},n))});t.a=function(e){var t=e.id,n=e.className,c=e.title,r=e.legend,a=e.description,s=e.children,l=e.disabled,u=void 0!==l&&l,d=e.showStepNumber,p=void 0===d||d,b=e.stepHeadingContent,h=void 0===b?function(){}:b,m=r||c?"fieldset":"div";return React.createElement(m,{className:i()(n,"wc-block-components-checkout-step",{"wc-block-components-checkout-step--with-step-number":p,"wc-block-components-checkout-step--disabled":u}),id:t,disabled:u},!(!r&&!c)&&React.createElement("legend",{className:"screen-reader-text"},r||c),!!c&&React.createElement(o,{title:c,stepHeadingContent:h()}),React.createElement("div",{className:"wc-block-components-checkout-step__container"},!!a&&React.createElement("p",{className:"wc-block-components-checkout-step__description"},a),React.createElement("div",{className:"wc-block-components-checkout-step__content"},s)))}},352:function(e,t,n){"use strict";n.d(t,"a",(function(){return b}));var c=n(4),i=n.n(c),r=n(23),o=n.n(r),a=n(2),s=n(0),l=n(66),u=n(60),d=["email"];function p(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);t&&(c=c.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,c)}return n}var b=function(){var e=Object(l.b)().needsShipping,t=Object(u.b)(),n=t.billingData,c=t.setBillingData,r=t.shippingAddress,b=t.setShippingAddress,h=t.shippingAsBilling,m=t.setShippingAsBilling,f=Object(s.useRef)(h),g=Object(s.useRef)(n),O=Object(s.useCallback)((function(e){b(e),h&&c(e)}),[h,b,c]),v=Object(s.useCallback)((function(t){c(t),e||b(t)}),[e,b,c]);Object(s.useEffect)((function(){if(f.current!==h){if(h)g.current=n