vue-giveworks-form
Version:
This plugin provides Vue.js component for the open [http://giveworks.net](Giveworks Platform).
406 lines (343 loc) • 13.5 kB
JavaScript
((typeof self !== 'undefined' ? self : this)["webpackJsonpGiveworksForm"] = (typeof self !== 'undefined' ? self : this)["webpackJsonpGiveworksForm"] || []).push([[6],{
/***/ "4898":
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"7ef6bfa2-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/Components/Signups/GoToWebinar.vue?vue&type=template&id=4693dcda&
var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('fieldset',[_c('legend',[_vm._v("Your information")]),_vm._m(0),_c('input-field',{attrs:{"id":"first","label":"First Name*","placeholder":"First Name*","errors":_vm.errors,"custom":""},model:{value:(_vm.form.first),callback:function ($$v) {_vm.$set(_vm.form, "first", $$v)},expression:"form.first"}}),_c('input-field',{attrs:{"id":"last","label":"Last Name*","placeholder":"Last Name*","errors":_vm.errors,"custom":""},model:{value:(_vm.form.last),callback:function ($$v) {_vm.$set(_vm.form, "last", $$v)},expression:"form.last"}}),_c('input-field',{attrs:{"id":"email","label":"Email*","placeholder":"Email*","errors":_vm.errors,"custom":""},model:{value:(_vm.form.email),callback:function ($$v) {_vm.$set(_vm.form, "email", $$v)},expression:"form.email"}}),(_vm.page.options.show_source)?_c('input-field',{attrs:{"id":"source","label":"Source","placeholder":"Source","errors":_vm.errors,"custom":""},model:{value:(_vm.form.source),callback:function ($$v) {_vm.$set(_vm.form, "source", $$v)},expression:"form.source"}}):_vm._e(),(_vm.address || _vm.page.options.show_address)?_c('input-field',{attrs:{"name":"address","label":"Address","placeholder":"Address","errors":_vm.errors,"custom":""},model:{value:(_vm.form.address),callback:function ($$v) {_vm.$set(_vm.form, "address", $$v)},expression:"form.address"}}):_vm._e(),(_vm.page.options.show_city)?_c('input-field',{attrs:{"id":"city","label":"City","placeholder":"City","errors":_vm.errors,"custom":""},model:{value:(_vm.form.city),callback:function ($$v) {_vm.$set(_vm.form, "city", $$v)},expression:"form.city"}}):_vm._e(),(_vm.page.options.show_state)?_c('input-field',{attrs:{"id":"state","label":"State","placeholder":"State","errors":_vm.errors,"custom":""},model:{value:(_vm.form.state),callback:function ($$v) {_vm.$set(_vm.form, "state", $$v)},expression:"form.state"}}):_vm._e(),(_vm.page.options.show_zip)?_c('input-field',{attrs:{"id":"zip_code","label":"Zip Code","placeholder":"Zip Code","errors":_vm.errors,"custom":""},model:{value:(_vm.form.zip_code),callback:function ($$v) {_vm.$set(_vm.form, "zip_code", $$v)},expression:"form.zip_code"}}):_vm._e(),(_vm.page.options.show_country)?_c('input-field',{attrs:{"id":"country","label":"Country","placeholder":"Country","errors":_vm.errors,"custom":""},model:{value:(_vm.form.country),callback:function ($$v) {_vm.$set(_vm.form, "country", $$v)},expression:"form.country"}}):_vm._e(),(_vm.page.options.show_phone)?_c('input-field',{attrs:{"id":"phone","label":"Phone","placeholder":"Phone","errors":_vm.errors,"custom":""},model:{value:(_vm.form.phone),callback:function ($$v) {_vm.$set(_vm.form, "phone", $$v)},expression:"form.phone"}}):_vm._e(),(_vm.page.options.show_organization)?_c('input-field',{attrs:{"id":"organization","label":"Organization","placeholder":"Organization","errors":_vm.errors,"custom":""},model:{value:(_vm.form.organization),callback:function ($$v) {_vm.$set(_vm.form, "organization", $$v)},expression:"form.organization"}}):_vm._e(),(_vm.page.options.show_job_title)?_c('input-field',{attrs:{"id":"job_title","label":"Job Title","placeholder":"Job Title","errors":_vm.errors,"custom":""},model:{value:(_vm.form.job_title),callback:function ($$v) {_vm.$set(_vm.form, "job_title", $$v)},expression:"form.job_title"}}):_vm._e(),(_vm.page.options.show_questions)?_c('textarea-field',{directives:[{name:"autogrow",rawName:"v-autogrow"}],attrs:{"id":"questions_comments","label":"Questions and Comments","placeholder":"Questions and Comments","errors":_vm.errors,"custom":""},model:{value:(_vm.form.questions_comments),callback:function ($$v) {_vm.$set(_vm.form, "questions_comments", $$v)},expression:"form.questions_comments"}}):_vm._e(),(_vm.page.options.show_industry)?_c('input-field',{attrs:{"id":"industry","label":"Industry","placeholder":"Industry","errors":_vm.errors,"custom":""},model:{value:(_vm.form.industry),callback:function ($$v) {_vm.$set(_vm.form, "industry", $$v)},expression:"form.industry"}}):_vm._e(),(_vm.page.options.show_employees)?_c('input-field',{attrs:{"id":"number_employees","label":"Number of Employees","placeholder":"Number of Employees","errors":_vm.errors,"custom":""},model:{value:(_vm.form.number_employees),callback:function ($$v) {_vm.$set(_vm.form, "number_employees", $$v)},expression:"form.number_employees"}}):_vm._e(),(_vm.page.options.show_timeframe)?_c('input-field',{attrs:{"id":"purchasing_timeframe","label":"Purchasing Timeframe","placeholder":"Purchasing Timeframe","errors":_vm.errors,"custom":""},model:{value:(_vm.form.purchasing_timeframe),callback:function ($$v) {_vm.$set(_vm.form, "purchasing_timeframe", $$v)},expression:"form.purchasing_timeframe"}}):_vm._e(),(_vm.page.options.show_role)?_c('input-field',{attrs:{"id":"purchasing_role","label":"Purchasing Role","placeholder":"Purchasing Role","errors":_vm.errors,"custom":""},model:{value:(_vm.form.purchasing_role),callback:function ($$v) {_vm.$set(_vm.form, "purchasing_role", $$v)},expression:"form.purchasing_role"}}):_vm._e(),_c('btn-activity',{attrs:{"size":"lg","type":"submit","orientation":"right","activity":_vm.submitting,"block":true,"label":_vm.buttonLabel || _vm.page.site.config.giveworks.button.signup}})],1)}
var staticRenderFns = [function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('p',[_c('em',[_vm._v("* Indicates required fields")])])}]
// CONCATENATED MODULE: ./src/Components/Signups/GoToWebinar.vue?vue&type=template&id=4693dcda&
// EXTERNAL MODULE: ./src/Mixins/FormComponent.js
var FormComponent = __webpack_require__("bb4b");
// EXTERNAL MODULE: ./node_modules/vue-interface/src/Directives/Autogrow/index.js + 1 modules
var Autogrow = __webpack_require__("ee92");
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/@vue/cli-plugin-babel/node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/Components/Signups/GoToWebinar.vue?vue&type=script&lang=js&
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
/* harmony default export */ var GoToWebinarvue_type_script_lang_js_ = ({
name: 'GoToWebinar',
components: {
InputField: () => Promise.all(/* import() | vue-interface */[__webpack_require__.e(0), __webpack_require__.e(1), __webpack_require__.e(12)]).then(__webpack_require__.bind(null, "46d8")),
BtnActivity: () => Promise.all(/* import() | vue-interface */[__webpack_require__.e(0), __webpack_require__.e(1), __webpack_require__.e(12)]).then(__webpack_require__.bind(null, "9863")),
TextareaField: () => Promise.all(/* import() | vue-interface */[__webpack_require__.e(0), __webpack_require__.e(1), __webpack_require__.e(12)]).then(__webpack_require__.bind(null, "31e0"))
},
directives: {
Autogrow: Autogrow["a" /* default */]
},
mixins: [FormComponent["a" /* default */]],
props: {
submitting: Boolean
},
computed: {
orientation() {
return this.$parent.$parent.orientation;
}
}
});
// CONCATENATED MODULE: ./src/Components/Signups/GoToWebinar.vue?vue&type=script&lang=js&
/* harmony default export */ var Signups_GoToWebinarvue_type_script_lang_js_ = (GoToWebinarvue_type_script_lang_js_);
// EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
var componentNormalizer = __webpack_require__("2877");
// CONCATENATED MODULE: ./src/Components/Signups/GoToWebinar.vue
/* normalize component */
var component = Object(componentNormalizer["a" /* default */])(
Signups_GoToWebinarvue_type_script_lang_js_,
render,
staticRenderFns,
false,
null,
null,
null
)
/* harmony default export */ var GoToWebinar = __webpack_exports__["default"] = (component.exports);
/***/ }),
/***/ "bb4b":
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var _FormEvents__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("b236");
/* harmony default export */ __webpack_exports__["a"] = ({
props: {
page: {
type: Object,
required: true
},
form: {
type: Object
},
errors: {
type: [Boolean, Object],
required: true
}
},
mixins: [_FormEvents__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"]],
computed: {
commentMessage() {
return this.page.options.comment_message || this.page.site.config.giveworks.comment_mess;
},
optinMessage() {
return this.page.options.optin_message || this.page.site.config.giveworks.optin_mess;
},
buttonLabel() {
return this.page.options.button;
}
}
});
/***/ }),
/***/ "ee92":
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
// CONCATENATED MODULE: ./node_modules/vue-interface/src/Directives/Autogrow/Autogrow.js
const STYLE_ATTRIBUTES = [
'font',
'fontFamily',
'fontKerning',
'fontSize',
'fontStretch',
'fontStyle',
'fontVariant',
'fontVariantLigatures',
'fontVariantCaps',
'fontVariantNumeric',
'fontVariantEastAsian',
'fontWeight',
'lineHeight',
'letterSpacing',
'padding',
'margin',
'textAlign',
'textAlignLast',
'textDecoration',
'textDecorationLine',
'textDecorationStyle',
'textDecorationColor',
'textDecorationSkipInk',
'textDecorationPosition',
'textIndent',
'textRendering',
'textShadow',
'textSizeAdjust',
'textOverflow',
'textTransform',
'width',
'wordBreak',
'wordSpacing',
'wordWrap'
];
function Autogrow_escape(html) {
const el = document.createElement('textarea');
el.textContent = html;
return el.innerHTML;
}
function Autogrow_unescape(html) {
const el = document.createElement('textarea');
el.innerHTML = html;
return el.textContent;
}
function Autogrow_int(str) {
if(typeof str === 'number') {
return str;
}
else if(!str || !str.replace) {
return 0;
}
return parseInt(str.replace(/[^\d.]+/g, '')) || 0;
}
function input(div, el, minHeight, maxHeight) {
div.innerHTML = Autogrow_escape(el.value).replace(/(?:\r\n|\r|\n)/g, '<br />') + ' ';
let dynamicHeight = Math.max(minHeight, height(div));
if(div.innerHTML.match(/(<br\s?\/?\>)+/)) {
dynamicHeight += Autogrow_int(style(el, 'lineHeight'));
}
el.style.height = (
(!maxHeight || dynamicHeight < maxHeight) ? dynamicHeight : maxHeight
) + 'px';
}
function height(el) {
return Autogrow_int(style(el, 'height'));
}
function style(el, attr) {
return window.getComputedStyle(el)[attr];
}
function mimic(el, minHeight) {
const div = document.createElement('div');
const styles = window.getComputedStyle(el);
div.style.position = 'absolute';
div.style.zIndex = -1;
div.style.visibility = 'hidden';
// div.style.minHeight = `${minHeight}px`;
el.parentNode.insertBefore(div, el.nextSibling);
STYLE_ATTRIBUTES.forEach(key => div.style[key] = styles[key]);
return div;
}
function init(el, binding, vnode) {
const minHeight = height(el);
const div = mimic(el, minHeight);
const maxHeight = binding.value !== true ? binding.value : 0;
el.addEventListener('input', event => {
input(div, event.target, minHeight, maxHeight);
});
input(div, el, minHeight, maxHeight);
return;
}
/* harmony default export */ var Autogrow = ({
inserted(el, binding, vnode) {
const elm = el;
if(binding.value === false) {
return;
}
if(el.tagName !== 'TEXTAREA') {
el = el.querySelector('textarea');
}
if(!el) {
throw new Error('A textarea is required for the v-autogrow directive.');
}
init(el, binding, vnode);
el.resize = function() {
vnode.context.$nextTick(() => {
el.dispatchEvent(new Event('input'));
});
};
}
});
// CONCATENATED MODULE: ./node_modules/vue-interface/src/Directives/Autogrow/index.js
/* harmony default export */ var Directives_Autogrow = __webpack_exports__["a"] = (Autogrow);
/***/ })
}]);
//# sourceMappingURL=GiveworksForm.common.go-to-webinar.js.map