@dpa-id-components/ui-search-bar

0.1.18 • Public • Published

@dpa-id-components/ui-input

UiSearchBar Vue 2.x input component based on the dpa Design Kit

Installation

yarn add @dpa-id-components/ui-search-bar

Usage

<!-- SomeComponent.vue using UiInput -->
<template>
  <ui-search-bar
    v-model="value"
    :placeholder="placeholder"
    @input="handleEvent"
    @focus="handleEvent"
    @blue="handleEvent"
    @keyup="handleEvent"
  />
</template>

<script>
  import UiSearchBar from "@dpa-id-components/ui-search-bar";

  export default {
    components: {
      UiSearchBar,
    },
    data() {
      return {
        value: "",
        type:"text",
        label: "Input Label",
        placeholder: "Type something...",
      };
    },
    computed: {
      errorMessage() {
        if (this.value === "error") {
          return "Oops, an error occured...";
        }
        return "";
      },
    },
    methods: {
      handleEvent: console.log,
    },
  };
</script>

Demo

View a demo of <ui-search-bar> on Storybook

API

Props

Name Type Default Description
placeholder String "" Text for the input's placeholder
value String "" The input's value
backgroundColor String "gray" sets the background-color of the search bar
hiddenFilterRules Number 0 Number of advance search criteria
isNonEditableChip Boolean false Defines if the Filter Chip is non editable

Events

Name Type Description
blur BlurEvent Emitted when the input loses focus
focus FocusEvent Emitted when the input is focused
enter KeyboardEvent Emitted when a key is entered
input String Emitted when the internal value of the input changes

Readme

Keywords

none

Package Sidebar

Install

npm i @dpa-id-components/ui-search-bar

Weekly Downloads

0

Version

0.1.18

License

MIT

Unpacked Size

405 kB

Total Files

10

Last publish

Collaborators

  • goersch.juliane
  • martinherweg
  • borchert.manja
  • roessel.nico
  • karlbanke
  • hajo.cirksena.dpa
  • schubert.florian
  • michelle3105
  • arifpehlivan
  • dpa-connect-deployment
  • antje.sommer
  • mlnmln
  • kgierke
  • andrewbeng89
  • mridul_dpa