@econnect/webcomponents-library
Documentation
Styleguide
Documentation
Styleguide
  • Getting Started

    • Installation
    • Patch Notes
    • Styleguide
  • Styling

    • e-connect colors
  • UI Components

    • Form

      • Search Field
      • Form Field
      • Forms
    • Filter

      • Filter
      • Search Filter
    • Grid

      • Grid
      • Grid Row
    • Inputs

      • File Input
      • Input Checkbox
      • Input Dropdown
      • Input Date
      • Input Date Time
      • Input Date Time Local
      • Input File
      • Input Label
      • Input Multi Select
      • Input Number
      • Input Radio
      • Input Range
      • Input Select
      • Input Switch
      • Input Slider
      • Input Text
      • Input TextArea
      • Input Time
      • Input Time Range
    • Controls

      • Booleans
      • Button
      • Checkboxes
      • Date Displays
      • Dropdown Lists
      • Text Displays
    • Headers

      • e-header
    • Cards

      • e-card
    • Images

      • Icon
      • Images
      • Flag Image
      • Hamburger
    • Iframe
    • Pager
    • Settings
    • Document Validation
    • Navigation

      • Navigation
      • Navigation Menu
      • Navigation Footer
      • Navigation Button
      • Navigation Button Item
      • Navigation Search Item

Text Displays v1.0

The <e-text-display> component is a component that can be used for .

Usage

An unavailable has attributes that must be provided,

<e-text-display
  modelValue=''
/>

Attributes

modelValue | Type: String | Default: ''

Examples

Below a few interactive examples of unavailable can be found.

modelValue='Example textDisplay'
<e-text-display
  modelValue='Example textDisplay'
/>
Example textDisplay

Source Code

e-text-display.vue
<script lang="ts" setup>
import { computed } from 'vue';

import { Dictionary } from 'types/Dictionary';

export type Props = {
  modelValue: string;
  options?: Dictionary & {
    error?: boolean;
    retry?: boolean;
    success?: boolean;
    monospaced?: boolean;
  };
};
const props = withDefaults(defineProps<Props>(), {
  modelValue: '',
  options: () => {
    return {
      monospaced: false
    };
  }
});

const text = computed(() => {
  return props.modelValue;
});

const classes = computed(() => {
  return {
    error: props.options?.error,
    retry: props.options?.retry,
    success: props.options?.success,
    monospaced: props.options.monospaced
  };
});
</script>

<template>
  <div
    class="e-text-display"
    :class="classes"
  >
    <span
      :title="text"
      v-text="text"
    />
  </div>
</template>

<style scoped lang="scss">
.e-text-display {
  font-family: var(--e-body-font-family);
  font-weight: normal;
  font-style: normal;
  display: flex;
  flex-direction: column;
  text-align: left;
  overflow: hidden;
  white-space: nowrap;

  span {
    text-overflow: ellipsis;
    overflow: hidden;
    font-family: inherit;
  }

  &.success span {
    color: limegreen;
  }

  &.error span {
    color: red;
  }

  &.retry span {
    color: var(--e-accent);
  }

  &.monospaced {
    span {
      font-family: var(--e-code-font-family), 'Courier New';
      font-size: var(--e-code-font-size);
      line-height: var(--e-code-font-line-height);
      font-weight: var(--e-code-font-weight);
    }
  }
}
</style>
Last Updated:: 10/10/24, 2:56 PM
Contributors: Antony Elfferich, Roeland Krijgsman, AzureAD\MarcelLommers, Marcel Lommers
Prev
Dropdown Lists