0.6.0 • Published 2 years ago

@dpa-id-components/ui-dropdown v0.6.0

Weekly downloads
-
License
MIT
Repository
-
Last release
2 years ago

@dpa-id-components/ui-dropdown

UiDropdown Vue 2.x dropdown menu component based on the dpa Design Kit

Installation

yarn add @dpa-id-components/ui-dropdown

Usage

<!-- SomeComponent.vue using UiDropdown -->
<template>
  <ui-dropdown @item-checked="handleEvent" @checked-all="handleEvent" v-bind="$props" />
</template>

<script>
  import UiDropdown from "@dpa-id-components/ui-dropdown";

  export default {
    components: {
      UiDropdown,
    },
    props: {
      overlayHeadline: "Ressorts wählen",
      submitButton: "Auswählen",
      cancelButton: "Abbrechen",
      value: [
        {
          name: "alle Ressorts",
          isChecked: false,
        },
        {
          name: "Wirtschaft",
          isChecked: false,
        },
      ],
    },
    methods: {
      handleEvent: console.log,
    },
  };
</script>

Demo

View a demo of <ui-dropdown> on Storybook

API

Props

The "CheckboxItem"-Type is used. Consisting of "name", "isChecked" and "iconName"

NameTypeDefaultDescription
valueCheckboxItem | Adds the value to the checkbox, consiting of name, isChecked and iconName ("CheckboxItem"-Type)
submitButtonStringAuswählenAdds the submit button label to the mobile overlay
cancelButtonStringAbbrechenAdds the cancel button label to the mobile overlay
overlayHeadlineString | Adds headline to the mobile overlay

Events

NameTypeDescription
checked-allEmitted when all items are selected
item-checkedEmitted when each individual item is checked
0.3.0

2 years ago

0.5.0

2 years ago

0.2.3

2 years ago

0.4.0

2 years ago

0.6.0

2 years ago

0.1.0

2 years ago