/** * External dependencies */ import { map } from 'lodash'; /** * WordPress dependencies */ import { __, sprintf } from '@wordpress/i18n'; import { // eslint-disable-next-line @wordpress/no-unsafe-wp-apis __experimentalInputControl as InputControl, BaseControl, Flex, FlexBlock, FlexItem, VisuallyHidden, } from '@wordpress/components'; import { useInstanceId, useViewportMatch } from '@wordpress/compose'; import { closeSmall as removeIcon } from '@wordpress/icons'; /** * Solid dependencies */ import { Heading, TextWeight } from '@ithemes/ui'; /** * Internal dependencies */ import { Select, CreatableSelect } from '@ithemes/security-ui'; import { StyledRuleAction, halfFlexBasis } from './styles'; const DEFAULT = { inclusive: true, }; export default function RuleForm( { value, onChange, className } ) { const id = useInstanceId( RuleForm, 'solid-rule-form' ); const { config = { rules: [ DEFAULT ] } } = value; const onAndRule = ( after ) => () => { onChange( { ...value, config: { ...config, rules: config.rules.toSpliced( after + 1, 0, DEFAULT ), }, } ); }; return ( onChange( { ...value, name: next } ) } label={ __( 'Rule Name', 'better-wp-security' ) } required __next36pxDefaultSize /> { config.rules.map( ( rule, i ) => ( onChange( { ...value, config: { ...config, rules: config.rules.map( ( oldRule, j ) => j === i ? newRule : oldRule ), }, } ) } onDelete={ config.rules.length === 1 ? null : () => onChange( { ...value, config: { ...config, rules: config.rules.toSpliced( i, 1 ), }, } ) } /> ) ) } onChange( { ...value, parameter: next.value, match: { type: 'equals', }, } ) } isOptionSelected={ ( maybeOption, selected ) => selected.some( ( selectedOption ) => isField( maybeOption.value, selectedOption ) ) } required /> ); } function SubFieldControl( { field, value, onChange } ) { const { example, sanitize, display } = field.allowSubFields; return ( onChange( { ...value, parameter: field.value + sanitize( next ), } ) } required __next36pxDefaultSize /> ); } function OperatorControl( { id, operator, allowedOperators, value, onChange } ) { return (

Register

Reset Password

PESQUISA

Properties listed in Trespasse

compare
Oportunidade

Trespasse – Restaurante Central do Bom...

Oportunidade 130,000 €
2
c. banho
160 m2
área
geralmarcioimoveis-pt
Janeiro 29, 2022

Compare