Your IP : 3.17.156.98


Current Path : /home/ephorei/www/wp-includes/images/media/q2m9hb/
Upload File :
Current File : /home/ephorei/www/wp-includes/images/media/q2m9hb/dropdown.tar

block.php000064400000001213150062045100006335 0ustar00<?php
/**
 * PHP render form dropdown Block.
 *
 * @package SureForms.
 */

namespace SRFM\Inc\Blocks\Dropdown;

use SRFM\Inc\Blocks\Base;
use SRFM\Inc\Fields\Dropdown_Markup;

if ( ! defined( 'ABSPATH' ) ) {
	exit; // Exit if accessed directly.
}

/**
 * Dropdown Block.
 */
class Block extends Base {
	/**
	 * Render the block
	 *
	 * @param array<mixed> $attributes Block attributes.
	 *
	 * @return string|bool
	 */
	public function render( $attributes ) {
		if ( ! empty( $attributes ) ) {
			$markup_class = new Dropdown_Markup( $attributes );
			ob_start();
			// phpcs:ignore
			echo $markup_class->markup();
		}
		return ob_get_clean();
	}
}
block.json000064400000002526150062045100006527 0ustar00{
	"name": "srfm/dropdown",
	"title": "Dropdown",
	"description": "Displays a SureForm Dropdown Field",
	"category": "sureforms",
	"keywords": [ "select", "dropdown", "options", "field" ],
	"textdomain": "sureforms",
	"supports": {
		"reusable": false,
		"html": false
	},
	"example": {
		"attributes": {
			"preview": true
		}
	},
	"attributes": {
		"preview": {
			"type": "boolean",
			"default": false
		},
		"block_id": {
			"type": "string"
		},
		"required": {
			"type": "boolean"
		},
		"multiSelect": {
			"type": "boolean",
			"default": false
		},
    "minValue": {
      "type": "number"
    },
    "maxValue": {
      "type": "number"
    },
		"searchable": {
			"type": "boolean",
			"default": true
		},
		"options": {
			"type": "array",
			"default": [
				{ "label": "Option 1", "icon": "" },
				{ "label": "Option 2", "icon": "" }
			 ]
		},
		"fieldWidth": {
			"type": "number",
			"default": 100
		},
		"label": {
			"default": "Dropdown",
			"type": "string"
		},
		"help": {
			"type": "string",
			"default": ""
		},
		"errorMsg": {
			"type": "string",
			"default": ""
		},
		"formId": {
			"type": "number",
			"default": ""
		},
		"placeholder": {
			"type": "string",
			"default": "Select an option"
		},
		"isConditionalLogic":{
			"type":"boolean",
			"default":false
		},
    "slug":{
			"type":"string",
			"default":""
		}
	}
}