$attributes Block attributes. * @since 0.0.2 */ public function __construct( $attributes ) { $this->slug = 'number'; $this->set_properties( $attributes ); $this->min_value = $attributes['minValue'] ?? ''; $this->max_value = $attributes['maxValue'] ?? ''; $this->format_type = $attributes['formatType'] ?? ''; $this->format_attr = $this->format_type ? ' format-type="' . esc_attr( $this->format_type ) . '" ' : ''; $this->min_value_attr = $this->min_value ? ' min="' . esc_attr( $this->min_value ) . '" ' : ''; $this->max_value_attr = $this->max_value ? ' max="' . esc_attr( $this->max_value ) . '" ' : ''; $this->prefix = $attributes['prefix'] ?? ''; $this->suffix = $attributes['suffix'] ?? ''; $this->read_only = ! empty( trim( $this->default ) ) && $attributes['readOnly']; $this->set_input_label( __( 'Number', 'sureforms' ) ); $this->set_error_msg( $attributes, 'srfm_number_block_required_text' ); $this->set_unique_slug(); $this->set_field_name( $this->unique_slug ); $this->set_markup_properties( $this->input_label ); $this->set_aria_described_by(); $this->set_label_as_placeholder( $this->input_label ); } /** * Render the sureforms number classic styling * * @since 0.0.2 * @return string|bool */ public function markup() { $data_config = $this->field_config; $this->class_name = $this->get_field_classes( $this->read_only ? [ 'srfm-read-only' ] : [] ); ob_start(); ?>