File Editor
Directories:
.. (Back)
modules
Files:
formselector-legacy.es5.js
formselector-legacy.es5.min.js
formselector-legacy.js
Create New File
Create
Edit File: formselector-legacy.es5.min.js
!function o(n,s,a){function l(r,e){if(!s[r]){if(!n[r]){var t="function"==typeof require&&require;if(!e&&t)return t(r,!0);if(c)return c(r,!0);throw new Error("Cannot find module '"+r+"'")}e=s[r]={exports:{}};n[r][0].call(e.exports,function(e){var t=n[r][1][e];return l(t||e)},e,e.exports,o,n,s,a)}return s[r].exports}for(var c="function"==typeof require&&require,e=0;e<a.length;e++)l(a[e]);return l}({1:[function(e,t,r){"use strict";function o(e){var o;"function"==typeof window.Choices&&(e=jQuery(e.detail.block.querySelector("#wpforms-".concat(e.detail.formId))),o=window.wpforms_choicesjs_config||{},e.find(".choicesjs-select").each(function(e,t){var r,n;t instanceof HTMLSelectElement&&((r=jQuery(t)).data("choicesjs")||(n=r.closest(".wpforms-field"),o.callbackOnInit=function(){var e=this,t=jQuery(e.passedElement.element),r=jQuery(e.input.element),o=t.data("size-class");o&&jQuery(e.containerOuter.element).addClass(o),t.prop("multiple")&&(r.data("placeholder",r.attr("placeholder")),e.getValue(!0).length)&&r.removeAttr("placeholder"),this.disable(),n.find(".is-disabled").removeClass("is-disabled")},r.data("choicesjs",new window.Choices(t,o)),r.val()&&r.parent().find(".choices__input").attr("style","display: none !important")))}))}function f(e){jQuery.isEmptyObject(l)&&(t=jQuery("#wpforms-gutenberg-popup"),(r=jQuery("#wpwrap")).after(t),l=r.siblings("#wpforms-gutenberg-popup"));var t=wpforms_gutenberg_form_selector.get_started_url,r=l.find("iframe");c(e),r.attr("src",t),l.fadeIn()}function u(){return 0<wpforms_gutenberg_form_selector.forms.length}var n=wp.serverSideRender,w=void 0===n?wp.components.ServerSideRender:n,n=wp.element,s=n.createElement,d=n.Fragment,n=wp.blocks.registerBlockType,g=(wp.blockEditor||wp.editor).InspectorControls,a=wp.components,_=a.SelectControl,b=a.ToggleControl,h=a.PanelBody,v=a.Placeholder,y=wp.i18n.__,a=s("svg",{width:20,height:20,viewBox:"0 0 612 612",className:"dashicon"},s("path",{fill:"currentColor",d:"M544,0H68C30.445,0,0,30.445,0,68v476c0,37.556,30.445,68,68,68h476c37.556,0,68-30.444,68-68V68 C612,30.445,581.556,0,544,0z M464.44,68L387.6,120.02L323.34,68H464.44z M288.66,68l-64.26,52.02L147.56,68H288.66z M544,544H68 V68h22.1l136,92.14l79.9-64.6l79.56,64.6l136-92.14H544V544z M114.24,263.16h95.88v-48.28h-95.88V263.16z M114.24,360.4h95.88 v-48.62h-95.88V360.4z M242.76,360.4h255v-48.62h-255V360.4L242.76,360.4z M242.76,263.16h255v-48.28h-255V263.16L242.76,263.16z M368.22,457.3h129.54V408H368.22V457.3z"})),l={},c=function(n){l.off("wpformsBuilderInPopupClose").on("wpformsBuilderInPopupClose",function(e,t,r,o){"saved"===t&&r&&(t=wp.blocks.createBlock("wpforms/form-selector",{formId:r.toString()}),wpforms_gutenberg_form_selector.forms=[{ID:r,post_title:o}],wp.data.dispatch("core/block-editor").removeBlock(n),wp.data.dispatch("core/block-editor").insertBlocks(t))})};jQuery(function(){jQuery(window).on("wpformsFormSelectorFormLoaded",o)});n("wpforms/form-selector",{title:wpforms_gutenberg_form_selector.strings.title,description:wpforms_gutenberg_form_selector.strings.description,icon:a,keywords:wpforms_gutenberg_form_selector.strings.form_keywords,category:"widgets",attributes:{formId:{type:"string"},displayTitle:{type:"boolean"},displayDesc:{type:"boolean"},preview:{type:"boolean"}},example:{attributes:{preview:!0}},supports:{customClassName:u()},edit:function(e){var t,r,o,n=e.attributes,s=n.formId,s=void 0===s?"":s,a=n.displayTitle,a=void 0!==a&&a,l=n.displayDesc,l=void 0!==l&&l,n=n.preview,n=void 0!==n&&n,c=e.setAttributes,i=wpforms_gutenberg_form_selector.forms.map(function(e){return{value:e.ID,label:e.post_title}}),p=wpforms_gutenberg_form_selector.strings;function m(e){c({formId:e})}return i.unshift({value:"",label:wpforms_gutenberg_form_selector.strings.form_select}),u()?(o=[React.createElement(g,{key:"wpforms-gutenberg-form-selector-inspector-controls"},React.createElement(h,{title:wpforms_gutenberg_form_selector.strings.form_settings},React.createElement(_,{label:wpforms_gutenberg_form_selector.strings.form_selected,value:s,options:i,onChange:m}),React.createElement(b,{label:wpforms_gutenberg_form_selector.strings.show_title,checked:a,onChange:function(e){c({displayTitle:e})}}),React.createElement(b,{label:wpforms_gutenberg_form_selector.strings.show_description,checked:l,onChange:function(e){c({displayDesc:e})}}),React.createElement("p",{className:"wpforms-gutenberg-panel-notice wpforms-warning"},React.createElement("strong",null,p.update_wp_notice_head),p.update_wp_notice_text," ",React.createElement("a",{href:p.update_wp_notice_link,rel:"noreferrer",target:"_blank"},p.learn_more))),React.createElement(d,null,React.createElement(h,{className:"wpforms-gutenberg-panel disabled_panel",title:p.themes},React.createElement("div",{className:"wpforms-panel-preview wpforms-panel-preview-themes"})),React.createElement(h,{className:"wpforms-gutenberg-panel disabled_panel",title:p.field_styles},React.createElement("div",{className:"wpforms-panel-preview wpforms-panel-preview-field"})),React.createElement(h,{className:"wpforms-gutenberg-panel disabled_panel",title:p.label_styles},React.createElement("div",{className:"wpforms-panel-preview wpforms-panel-preview-label"})),React.createElement(h,{className:"wpforms-gutenberg-panel disabled_panel",title:p.button_styles},React.createElement("div",{className:"wpforms-panel-preview wpforms-panel-preview-button"})),React.createElement(h,{className:"wpforms-gutenberg-panel disabled_panel",title:p.container_styles},React.createElement("div",{className:"wpforms-panel-preview wpforms-panel-preview-container"})),React.createElement(h,{className:"wpforms-gutenberg-panel disabled_panel",title:p.background_styles},React.createElement("div",{className:"wpforms-panel-preview wpforms-panel-preview-background"}))))],s?o.push(React.createElement(w,{key:"wpforms-gutenberg-form-selector-server-side-renderer",block:"wpforms/form-selector",attributes:e.attributes})):n?o.push(React.createElement(d,{key:"wpforms-gutenberg-form-selector-fragment-block-preview"},React.createElement("img",{src:wpforms_gutenberg_form_selector.block_preview_url,style:{width:"100%"},alt:""}))):o.push(React.createElement(v,{key:"wpforms-gutenberg-form-selector-wrap",className:"wpforms-gutenberg-form-selector-wrap"},React.createElement("img",{src:wpforms_gutenberg_form_selector.logo_url,alt:""}),React.createElement(_,{key:"wpforms-gutenberg-form-selector-select-control",value:s,options:i,onChange:m})))):(o=[(r=e.clientId,React.createElement(g,{key:"wpforms-gutenberg-form-selector-inspector-main-settings"},React.createElement(h,{className:"wpforms-gutenberg-panel",title:p.form_settings},React.createElement("p",{className:"wpforms-gutenberg-panel-notice wpforms-warning wpforms-empty-form-notice",style:{display:"block"}},React.createElement("strong",null,y("You haven’t created a form, yet!","wpforms-lite")),y("What are you waiting for?","wpforms-lite")),React.createElement("button",{type:"button",className:"get-started-button components-button is-button is-secondary",onClick:function(){f(r)}},y("Get Started","wpforms-lite")))))]).push((t=e.clientId,React.createElement(d,{key:"wpforms-gutenberg-form-selector-fragment-block-empty"},React.createElement("div",{className:"wpforms-no-form-preview"},React.createElement("img",{src:wpforms_gutenberg_form_selector.block_empty_url,alt:""}),React.createElement("p",{dangerouslySetInnerHTML:{__html:p.wpforms_empty_info}}),React.createElement("button",{type:"button",className:"get-started-button components-button is-button is-primary",onClick:function(){f(t)}},y("Get Started","wpforms-lite")),React.createElement("p",{className:"empty-desc",dangerouslySetInnerHTML:{__html:p.wpforms_empty_help}}),React.createElement("div",{id:"wpforms-gutenberg-popup",className:"wpforms-builder-popup"},React.createElement("iframe",{src:"about:blank",width:"100%",height:"100%",id:"wpforms-builder-iframe",title:"wpforms-gutenberg-popup"})))))),o},save:function(){return null}})},{}]},{},[1]);
Save Changes
Rename File
Rename