Show field as labels.

@param string $style

@return Field
494125
public function label($style = 'success')
    {
        return $this->unescape()->as(function ($value) use ($style) {
            if ($value instanceof Arrayable) {
                $value = $value->toArray();
            }

            return collect((array) $value)->map(function ($name) use ($style) {
                return "<span class='label label-{$style}'>$name</span>";
            })->implode('&nbsp;');
        });
    }
807896
public function apply(string $style, string $text): string
    {
        return $this->format(self::wrap($text, $style));
    }
542692
public function renderLabel($content, $class = '', $style = '')
    {
        $styleAttr = ($style) ? ' style="' . $style . '"' : '';
        $classes = ($class) ? ' ' . $class : '';
        $renderLabel = '';
        $renderLabel .= '<span class="fs-label' . $classes . '"' . $style . '>';
        $renderLabel .= $content;
        $renderLabel .= '</span>';
        return $renderLabel;
    }
448260
public function style($style)
    {
        if (in_array($style, ['arrow', 'dot', 'bar'])) {
            $this->attributes->removeAttributeClass('breadcrumb-*');
            $this->attributes->addAttributeClass('breadcrumb-' . $style);
        }

        return $this;
    }
635455
protected function setLabels(&$properties)
    {
        $label = $properties['name'];

        if (Helpers::isKeyExists($properties, 'labels')) {
            $label = $properties['labels'];
        }

        $properties['labels'] = $this->getLabels($label, $properties['name']);

        return $this;
    }
1100744
public function getExportTranslationLabel($key, $field)
    {
        $label = $this->getTranslationLabel($field, 'export', 'label');
        $transLabel = $this->trans($label);

        if ($transLabel === $label) {
            $label = $this->getTranslationLabel($field, 'list', 'label');
            $transLabel = $this->trans($label);
        }

        if ($transLabel === $label) {
            $label = $this->getTranslationLabel($key, 'export', 'label');
            $transLabel = $this->trans($label);
        }

        if ($transLabel === $label) {
            $label = $this->getTranslationLabel($key, 'list', 'label');
            $transLabel = $this->trans($label);
        }

        if ($transLabel === $label) {
            $transLabel = $key;
        }

        return $transLabel;
    }
219482
public function withStyles(array $styles)
    {
        foreach ($styles as $name => $args) {
            $this->formatter()->setStyle($name, new OutputFormatterStyle(...$args));
        }

        return $this;
    }
1184126
public function label($content)
    {
        // Handle long labels by splitting them across several lines
        $lines = [];
        $stop = mb_strlen($content);
        $width = $this->util->width();
        for ($i = 0; $i < $stop; $i += $width) {
            $lines[] = mb_substr($content, $i, $width);
        }
        $content = array_pop($lines);

        foreach ($lines as $line) {
            $this->output->write($this->parser->apply($line));
        }

        $content = $this->padContent($content);
        $content = $this->parser->apply($content);

        $this->output->sameLine();
        $this->output->write($content);

        return $this;
    }
1124695
public static function label(string $label): self
    {
        $item = new self();

        $item->label = $label;
        $item->slug = Str::slug($label);

        return $item;
    }
927365
public function getFieldLabel($fieldName)
    {
        $result = $this->getField($fieldName, 'label_'.$this->locale, $this->getField($fieldName, 'label'));

        if ($result === null && array_key_exists($fieldName, $this->standardFieldLabels)) {
            $result = $this->standardFieldLabels[$fieldName];
        }

        if ($result === null) {
            $result = $fieldName;
        }

        return $result;
    }
637180
public function labels($labels)
    {
        if ($labels instanceof Collection) {
            $labels = $labels->toArray();
        }

        $this->labels = $labels;

        return $this;
    }
699513
public function addCSSDeclaration($style){
		if(!isset($this->controller)){
			return false;
			}
		$this->controller->style[]=$style;
		return true;
		}
717441
function createLabelStyle(style) {
    return React.createClass({
        displayName: Label.displayName + style,
        render() {
            return <Label {...this.props} style={style.toLowerCase()} />;
        }
    });
}
886877
public function addStyle(Style $style)
    {
        if (!$this->styleSet) {
            $this->styleSet = new DefaultStyleSet();
        }

        $this->styleSet->add($style);

        return $this;
    }
815309
private function label_map_callback($key)
    {
        if (strpos($key, $this->ID.'.') === 0) {
            return $key;
        }

        return $this->ID.'.'.$key;
    }
1191520
protected function registerFill($style)
    {
        $styleId = $style->getId();

        // Currently - only solid backgrounds are supported
        // so $backgroundColor is a scalar value (RGB Color)
        $backgroundColor = $style->getBackgroundColor();

        if ($backgroundColor) {
            $isBackgroundColorRegistered = isset($this->registeredFills[$backgroundColor]);

            // We need to track the already registered background definitions
            if ($isBackgroundColorRegistered) {
                $registeredStyleId = $this->registeredFills[$backgroundColor];
                $registeredFillId = $this->styleIdToFillMappingTable[$registeredStyleId];
                $this->styleIdToFillMappingTable[$styleId] = $registeredFillId;
            } else {
                $this->registeredFills[$backgroundColor] = $styleId;
                $this->styleIdToFillMappingTable[$styleId] = $this->fillIndex++;
            }

        } else {
            // The fillId maps a style to a fill declaration
            // When there is no background color definition - we default to 0
            $this->styleIdToFillMappingTable[$styleId] = 0;
        }
    }
979787
public function &inline($styles)
    {
        $css_object = new CssObject();

        $css_object->setType('inline');
        $css_object->setCss($styles);

        $this->add($css_object);

        return $css_object;
    }