0.1.18 • Published 1 year ago

@dpa-id-components/ui-search-bar v0.1.18

Weekly downloads
-
License
MIT
Repository
-
Last release
1 year ago

@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

NameTypeDefaultDescription
placeholderString""Text for the input's placeholder
valueString""The input's value
backgroundColorString"gray"sets the background-color of the search bar
hiddenFilterRulesNumber0Number of advance search criteria
isNonEditableChipBooleanfalseDefines if the Filter Chip is non editable

Events

NameTypeDescription
blurBlurEventEmitted when the input loses focus
focusFocusEventEmitted when the input is focused
enterKeyboardEventEmitted when a key is entered
inputStringEmitted when the internal value of the input changes
0.1.11

1 year ago

0.1.12

1 year ago

0.1.13

1 year ago

0.1.14

1 year ago

0.1.15

1 year ago

0.1.16

1 year ago

0.1.17

1 year ago

0.1.18

1 year ago

0.1.10

2 years ago

0.1.8

2 years ago

0.1.7

2 years ago

0.1.6

2 years ago

0.1.5

2 years ago

0.1.4

2 years ago

0.1.3

2 years ago

0.1.2

2 years ago