/**
* WordPress dependencies
*/
import { __ } from "@wordpress/i18n";
import { useBlockProps, RichText, InnerBlocks } from "@wordpress/block-editor";
import { useEffect, useState, useRef } from "@wordpress/element";
import { select, dispatch, useSelect } from "@wordpress/data";
/**
* Internal dependencies
*/
const {
duplicateBlockIdFix,
filterBlocksByName,
getBlockParentClientId,
EBDisplayIcon,
DynamicInputValueHandler,
BlockProps
} = EBControls;
import classnames from "classnames";
import Inspector from "./inspector";
import Style from "./style";
export default function Edit(props) {
const {
attributes,
setAttributes,
isSelected,
clientId,
className,
name,
} = props;
const {
resOption,
blockMeta,
parentBlockId,
blockId,
classHook,
showLabel,
labelText,
fieldName,
defaultValue,
placeholderText,
isRequired,
validationMessage,
validationRules,
numberValidationMessage,
isIcon,
icon,
formStyle,
parentBlockPaddingLeft,
parentBlockPaddingUnit,
parentBlockIconSize,
parentIconColor,
} = attributes;
// you must declare this variable
const enhancedProps = {
...props,
blockPrefix: 'eb-number-field',
rootClass: "eb-guten-block-main-parent-wrapper eb-form-field",
style:
};
//UseEffect for set Validation rules
useEffect(() => {
const rules = {
[fieldName]: {
isRequired: {
status: isRequired,
message: validationMessage,
},
isNumber: {
message: numberValidationMessage,
},
},
};
setAttributes({ validationRules: rules });
}, [isRequired, fieldName, validationMessage]);
return (
<>
{isSelected && (
Produto<\/th>\n | Puxador<\/td>\n<\/tr>\n |
---|---|
Cor<\/th>\n | Preto<\/td>\n<\/tr>\n |
Tonalidade<\/th>\n | Preto<\/td>\n<\/tr>\n |
Acabamento<\/th>\n | Fosco<\/td>\n<\/tr>\n |
Uso Indicado<\/th>\n | para Portas<\/td>\n<\/tr>\n |
Tipo de Instala\u00e7\u00e3o dos Puxadores<\/th>\n | Embutir<\/td>\n<\/tr>\n |
Quantidade de Furos<\/th>\n | 2 furo(s)<\/td>\n<\/tr>\n |
Durabilidade<\/th>\n | Mais de 10 anos<\/td>\n<\/tr>\n |
Marca<\/th>\n | Pauma<\/td>\n<\/tr>\n |
Quantidade de Pe\u00e7as<\/th>\n | 1 pe\u00e7a(s)<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n","protected":false},"excerpt":{"rendered":" Produto Puxador Cor Preto Tonalidade Preto Acabamento Fosco Uso Indicado para Portas Tipo de Instala\u00e7\u00e3o dos Puxadores Embutir Quantidade de<\/p>\n","protected":false},"featured_media":17452,"comment_status":"open","ping_status":"closed","template":"","meta":[],"product_cat":[94,85],"product_tag":[],"class_list":{"0":"post-17447","1":"product","2":"type-product","3":"status-publish","4":"has-post-thumbnail","6":"product_cat-pauma","7":"product_cat-puxadores-componentes-para-moveis","9":"first","10":"instock","11":"shipping-taxable","12":"purchasable","13":"product-type-variable"},"_links":{"self":[{"href":"https:\/\/acessoriosparamoveis.com.br\/wp-json\/wp\/v2\/product\/17447"}],"collection":[{"href":"https:\/\/acessoriosparamoveis.com.br\/wp-json\/wp\/v2\/product"}],"about":[{"href":"https:\/\/acessoriosparamoveis.com.br\/wp-json\/wp\/v2\/types\/product"}],"replies":[{"embeddable":true,"href":"https:\/\/acessoriosparamoveis.com.br\/wp-json\/wp\/v2\/comments?post=17447"}],"version-history":[{"count":1,"href":"https:\/\/acessoriosparamoveis.com.br\/wp-json\/wp\/v2\/product\/17447\/revisions"}],"predecessor-version":[{"id":17453,"href":"https:\/\/acessoriosparamoveis.com.br\/wp-json\/wp\/v2\/product\/17447\/revisions\/17453"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/acessoriosparamoveis.com.br\/wp-json\/wp\/v2\/media\/17452"}],"wp:attachment":[{"href":"https:\/\/acessoriosparamoveis.com.br\/wp-json\/wp\/v2\/media?parent=17447"}],"wp:term":[{"taxonomy":"product_cat","embeddable":true,"href":"https:\/\/acessoriosparamoveis.com.br\/wp-json\/wp\/v2\/product_cat?post=17447"},{"taxonomy":"product_tag","embeddable":true,"href":"https:\/\/acessoriosparamoveis.com.br\/wp-json\/wp\/v2\/product_tag?post=17447"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}} |