/**
* 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 && (
O trilho telesc\u00f3pico H35 Light \u00e9 uma ferragem utilizada em gavetas e permite uma\u00a0abertura total com deslizamento suave, preciso e resistente. Possui travas laterais que facilitam na retirada da gaveta e garantem a seguran\u00e7a e fixa\u00e7\u00e3o. Esse modelo foi desenvolvido para cargas menores (30 kgs)<\/p>\n
Caracter\u00edsticas:<\/strong><\/p>\n Acabamento: Zincado Corredi\u00e7a Telesc\u00f3pica HD H35 Light – 450mm\u00a0 O trilho telesc\u00f3pico H35 Light \u00e9 uma ferragem utilizada em gavetas e permite<\/p>\n","protected":false},"featured_media":18099,"comment_status":"open","ping_status":"closed","template":"","meta":[],"product_cat":[89,77],"product_tag":[],"class_list":{"0":"post-18170","1":"product","2":"type-product","3":"status-publish","4":"has-post-thumbnail","6":"product_cat-corredicas","7":"product_cat-corredicas-dobradicas-pistoes","9":"first","10":"instock","11":"shipping-taxable","12":"purchasable","13":"product-type-simple"},"_links":{"self":[{"href":"https:\/\/acessoriosparamoveis.com.br\/wp-json\/wp\/v2\/product\/18170"}],"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=18170"}],"version-history":[{"count":1,"href":"https:\/\/acessoriosparamoveis.com.br\/wp-json\/wp\/v2\/product\/18170\/revisions"}],"predecessor-version":[{"id":18171,"href":"https:\/\/acessoriosparamoveis.com.br\/wp-json\/wp\/v2\/product\/18170\/revisions\/18171"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/acessoriosparamoveis.com.br\/wp-json\/wp\/v2\/media\/18099"}],"wp:attachment":[{"href":"https:\/\/acessoriosparamoveis.com.br\/wp-json\/wp\/v2\/media?parent=18170"}],"wp:term":[{"taxonomy":"product_cat","embeddable":true,"href":"https:\/\/acessoriosparamoveis.com.br\/wp-json\/wp\/v2\/product_cat?post=18170"},{"taxonomy":"product_tag","embeddable":true,"href":"https:\/\/acessoriosparamoveis.com.br\/wp-json\/wp\/v2\/product_tag?post=18170"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}
\nDispon\u00edvel no tamanho: 450mm
\nEspessura da Chapa: 0,7×0,7×0,8mm
\nExtra\u00e7\u00e3o Total
\nMaterial: A\u00e7o
\n.<\/p>\n","protected":false},"excerpt":{"rendered":"