infinity-forge
Version:
199 lines • 9.14 kB
JavaScript
"use strict";
var __assign = (this && this.__assign) || function () {
__assign = Object.assign || function(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
t[p] = s[p];
}
return t;
};
return __assign.apply(this, arguments);
};
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || (function () {
var ownKeys = function(o) {
ownKeys = Object.getOwnPropertyNames || function (o) {
var ar = [];
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
return ar;
};
return ownKeys(o);
};
return function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
__setModuleDefault(result, mod);
return result;
};
})();
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
if (ar || !(i in from)) {
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
ar[i] = from[i];
}
}
return to.concat(ar || Array.prototype.slice.call(from));
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.Contact = Contact;
var jsx_runtime_1 = require("react/jsx-runtime");
var ui_1 = require("../../../../../../ui/index.js");
var Versions = __importStar(require("./versions/index.js"));
var S = __importStar(require("./styles.js"));
function Contact(_a) {
var _b, _c, _d, _e;
var isGlobal = _a.isGlobal, formHandler = _a.formHandler, _f = _a.sendToPanel, sendToPanel = _f === void 0 ? true : _f, customRef = _a.customRef;
var VersionsElement = Versions;
var i18nIsActive = (0, ui_1.useI18n)().i18nIsActive;
var dynamicProps = {
refSection: customRef || 'ContactAtenaPages',
isGlobal: isGlobal,
templates: { VersionsElement: VersionsElement },
customForm: {
modal: {
styles: {
maxWidth: '98%',
},
},
inputs: __spreadArray(__spreadArray([
[
{
name: 'jsonContent.inputName',
InputComponent: 'InputSwitch',
label: 'Input de nome',
i18n: { disabled: true },
},
{
name: 'jsonContent.inputEmail',
InputComponent: 'InputSwitch',
label: 'Input de email',
i18n: { disabled: true },
},
{
name: 'jsonContent.inputPhone',
InputComponent: 'InputSwitch',
label: 'Input de telefone',
i18n: { disabled: true },
},
{
name: 'jsonContent.inputDescription',
InputComponent: 'InputSwitch',
label: 'Input de descrição',
i18n: { disabled: true },
},
]
], (i18nIsActive
? [
[
{ name: 'jsonContent.inputNameLabel', InputComponent: 'Input', label: 'Label do input de nome' },
{ name: 'jsonContent.inputEmailLabel', InputComponent: 'Input', label: 'Label do input de email' },
],
[
{ name: 'jsonContent.inputPhoneLabel', InputComponent: 'Input', label: 'Label do input de telefone' },
{
name: 'jsonContent.inputDescriptionLabel',
InputComponent: 'Input',
label: 'Label do input de descrição',
},
],
[
{
name: 'jsonContent.inputNamePlaceholder',
InputComponent: 'Input',
label: 'Placeholder do input de nome',
},
{
name: 'jsonContent.inputEmailPlaceholder',
InputComponent: 'Input',
label: 'Placeholder do input de email',
},
],
[
{
name: 'jsonContent.inputPhonePlaceholder',
InputComponent: 'Input',
label: 'Placeholder do input de telefone',
},
{
name: 'jsonContent.inputDescriptionPlaceholder',
InputComponent: 'Input',
label: 'Placeholder do input de descrição',
},
],
[
{
name: 'jsonContent.submitButtonText',
InputComponent: 'Input',
label: 'Texto do botão de enviar',
},
],
]
: []), true), [
[
{
name: 'jsonContent.messageProviderKey',
InputComponent: 'Input',
label: 'Refêrencia do formulário no mensage provider por exemplo se no message provider o caminho estiver https://mysite.com.br/mykey então neste campo deverá ser colocado o "mykey"',
i18n: { disabled: true },
},
{ name: 'jsonContent.recaptcha', InputComponent: 'Input', label: 'Recaptcha', i18n: { disabled: true } },
],
[
{
name: 'items',
InputComponent: 'InputManager',
i18n: { disabled: true },
inputs: [
[
{ InputComponent: 'Input', name: 'titulo', label: 'Título' },
{ InputComponent: 'InputURL', name: 'link', label: 'Link', i18n: { disabled: false } },
],
[
{ InputComponent: 'InputSwitch', name: 'target', label: 'Abrir em nova aba' },
{ InputComponent: 'SelectIcon', name: 'icon', label: 'Icone' },
],
],
},
],
], false),
},
fields: {
title: {},
description: {},
images: {
disable: true,
},
linkText: {
disable: true,
},
linkUrl: {
disable: true,
},
videoUrl: {
disable: true,
},
},
};
var section = (0, ui_1.useDynamicSection)(dynamicProps);
var Component = VersionsElement[((_b = section === null || section === void 0 ? void 0 : section.jsonContent) === null || _b === void 0 ? void 0 : _b.version) || 'Default'];
return ((0, jsx_runtime_1.jsx)(section.Section, { children: (0, jsx_runtime_1.jsx)(S.Contact, { id: section.ref, "$css": (_c = section === null || section === void 0 ? void 0 : section.jsonContent) === null || _c === void 0 ? void 0 : _c.css, children: (0, jsx_runtime_1.jsx)(Component, __assign({}, dynamicProps, { sendToPanel: sendToPanel, formHandler: __assign({ recaptcha: (_d = section === null || section === void 0 ? void 0 : section.jsonContent) === null || _d === void 0 ? void 0 : _d.recaptcha, messageProvider: { messageProviderKey: (_e = section === null || section === void 0 ? void 0 : section.jsonContent) === null || _e === void 0 ? void 0 : _e.messageProviderKey, enabled: true } }, formHandler) })) }) }));
}
//# sourceMappingURL=index.js.map