File "control.js"
Full Path: /home/jlklyejr/public_html/post-date/wp-content/plugins/kirki/pro-src/packages/kirki-pro-margin-padding/dist/control.js
File size: 4.47 KB
MIME-type: text/plain
Charset: utf-8
!function(){function t(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function e(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t))return Array.from(t)}(t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}var n={};n=React;var r=function(r){var o=r.control,i=r.customizerSetting,a=r.defaultArray,c=r.valueArray,l=r.valueUnit,s=e(n.useState((function(){return c}))),u=s[0],m=s[1],p=function(t){var e="",n="",r="";return""!==t&&(r=-1<(t=(t="string"!=typeof t?t.toString():t).trim()).indexOf("-")?"-":"",""!==(t=t.replace(r,""))?(e=t.replace(/\d+/g,""),n=r+(n=t.replace(e,"")).trim(),n=parseFloat(n)):n=r),{unit:e,number:n}},f=function(t){var e;for(var n in t)Object.hasOwnProperty.call(t,n)&&(""!==(e=t[n])&&(e=(e=p(e)).number+l),t[n]=e);return t};o.updateComponentState=function(t){m(function(t){var e;for(var n in t)Object.hasOwnProperty.call(t,n)&&(e=p(t[n]),t[n]=e.number);return t}(t))};var d=function(e,n){var r=function(e){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{},o=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(o=o.concat(Object.getOwnPropertySymbols(r).filter((function(t){return Object.getOwnPropertyDescriptor(r,t).enumerable})))),o.forEach((function(n){t(e,n,r[n])}))}return e}({},u);r[n]=e.target.value,i.set(f(r))},v="kirki-control-input-".concat(r.type,"-top"),b=n.useRef(null);return React.createElement("div",{className:"kirki-control-form",tabIndex:"1"},(r.label||r.description)&&React.createElement(React.Fragment,null,React.createElement("label",{className:"kirki-control-label",htmlFor:v},r.label&&React.createElement("span",{className:"customize-control-title"},r.label),r.description&&React.createElement("span",{className:"customize-control-description description",dangerouslySetInnerHTML:{__html:r.description}})),React.createElement("div",{className:"customize-control-notifications-container",ref:r.setNotificationContainer})),React.createElement("button",{type:"button",className:"kirki-control-reset",onClick:function(t){var e=""!==r.default&&void 0!==r.default?a:c;i.set(f(e))}},React.createElement("i",{className:"dashicons dashicons-image-rotate"})),React.createElement("div",{className:"kirki-control-cols"},React.createElement("div",{className:"kirki-control-left-col"},React.createElement("div",{class:"kirki-control-fields"},function(){var t=[];for(var e in u)Object.hasOwnProperty.call(u,e)&&t.push({position:e,value:u[e]});return t}().map((function(t){var e="kirki-control-input kirki-control-input-".concat(t.position),n="kirki-control-input-".concat(r.type,"-").concat(t.position);return React.createElement("div",{class:"kirki-control-field"},React.createElement("input",{id:n,type:"number",value:t.value||0===t.value?t.value:"",className:e,onChange:function(e){return d(e,t.position)}}),React.createElement("label",{class:"kirki-control-sublabel",htmlFor:n},t.position))})))),React.createElement("div",{className:"kirki-control-right-col"},React.createElement("span",{ref:b,className:"kirki-control-unit"},l))))};function o(){return o=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},o.apply(this,arguments)}var i=wp.customize.Control.extend({initialize:function(t,e){var n=this;n.setNotificationContainer=n.setNotificationContainer.bind(n),wp.customize.Control.prototype.initialize.call(n,t,e),wp.customize.control.bind("removed",(function t(e){n===e&&(n.destroy(),n.container.remove(),wp.customize.control.unbind("removed",t))}))},setNotificationContainer:function(t){this.notifications.container=jQuery(t),this.notifications.render()},renderContent:function(){var t=this;ReactDOM.render(React.createElement(r,o({},t.params,{control:t,customizerSetting:t.setting,setNotificationContainer:t.setNotificationCotainer,value:t.params.value})),t.container[0]),!1!==t.params.choices.allowCollapse&&t.container.addClass("allowCollapse")},ready:function(){var t=this;t.setting.bind((function(e){t.updateComponentState(e)}))},updateComponentState:function(t){},destroy:function(){ReactDOM.unmountComponentAtNode(this.container[0]),wp.customize.Control.prototype.destroy&&wp.customize.Control.prototype.destroy.call(this)}});wp.customize.controlConstructor["kirki-margin"]=i,wp.customize.controlConstructor["kirki-padding"]=i}();
//# sourceMappingURL=control.js.map