@muenchen/muc-patternlab-vue 1.13.0-beta.7 → 1.13.0-beta.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/Banner/MucBanner.stories.d.ts +70 -0
- package/components/Banner/MucBanner.vue.d.ts +37 -0
- package/components/BuisnessHours/BusinessHours.stories.d.ts +80 -0
- package/components/BuisnessHours/MucBusinessHours.vue.d.ts +56 -0
- package/components/Button/MucButton.stories.d.ts +114 -0
- package/{dist/components → components}/Button/MucButton.vue.d.ts +23 -43
- package/components/Callout/MucCallout.stories.d.ts +77 -0
- package/components/Callout/MucCallout.vue.d.ts +57 -0
- package/components/Card/MucCard.stories.d.ts +117 -0
- package/components/Card/MucCard.vue.d.ts +42 -0
- package/components/Card/MucCardContainer.stories.d.ts +124 -0
- package/components/Card/MucCardContainer.vue.d.ts +24 -0
- package/components/Comment/MucComment.stories.d.ts +82 -0
- package/components/Comment/MucComment.vue.d.ts +89 -0
- package/components/Comment/MucCommentText.stories.d.ts +51 -0
- package/components/Comment/MucCommentText.vue.d.ts +24 -0
- package/{dist/components → components}/Divider/MucDivider.stories.d.ts +1 -1
- package/{dist/components → components}/Divider/MucDivider.vue.d.ts +1 -1
- package/components/Form/MucCheckbox.stories.d.ts +33 -0
- package/components/Form/MucCheckbox.vue.d.ts +18 -0
- package/components/Form/MucCheckboxGroup.stories.d.ts +188 -0
- package/components/Form/MucCheckboxGroup.vue.d.ts +42 -0
- package/components/Form/MucCounter.stories.d.ts +63 -0
- package/components/Form/MucCounter.vue.d.ts +33 -0
- package/components/Form/MucErrorList.stories.d.ts +31 -0
- package/components/Form/MucErrorList.vue.d.ts +8 -0
- package/components/Form/MucInput.stories.d.ts +165 -0
- package/{dist/components → components}/Form/MucInput.vue.d.ts +23 -42
- package/components/Form/MucRadioButton.stories.d.ts +104 -0
- package/components/Form/MucRadioButton.vue.d.ts +38 -0
- package/components/Form/MucRadioButtonGroup.vue.d.ts +38 -0
- package/components/Form/MucSelect.stories.d.ts +82 -0
- package/{dist/components → components}/Form/MucSelect.vue.d.ts +5 -30
- package/components/Form/MucSelectItem.vue.d.ts +9 -0
- package/components/Form/MucTextArea.stories.d.ts +64 -0
- package/components/Form/MucTextArea.vue.d.ts +38 -0
- package/components/Icon/MucIcon.stories.d.ts +33 -0
- package/components/Icon/MucIcon.vue.d.ts +20 -0
- package/components/Intro/MucIntro.stories.d.ts +61 -0
- package/components/Intro/MucIntro.vue.d.ts +50 -0
- package/components/Link/MucLink.stories.d.ts +83 -0
- package/components/Link/MucLink.vue.d.ts +72 -0
- package/components/PercentageSpinner/MucPercentageSpinner.stories.d.ts +32 -0
- package/components/PercentageSpinner/MucPercentageSpinner.vue.d.ts +30 -0
- package/components/PercentageSpinner/index.d.ts +2 -0
- package/{dist/components → components}/index.d.ts +2 -1
- package/muc-patternlab-vue.es.js +1003 -0
- package/package.json +4 -7
- package/{dist/style.css → style.css} +1 -1
- package/LICENSE +0 -21
- package/README.md +0 -111
- package/dist/components/Banner/MucBanner.stories.d.ts +0 -82
- package/dist/components/Banner/MucBanner.vue.d.ts +0 -54
- package/dist/components/BuisnessHours/BusinessHours.stories.d.ts +0 -116
- package/dist/components/BuisnessHours/MucBusinessHours.vue.d.ts +0 -74
- package/dist/components/Button/MucButton.stories.d.ts +0 -158
- package/dist/components/Callout/MucCallout.stories.d.ts +0 -89
- package/dist/components/Callout/MucCallout.vue.d.ts +0 -73
- package/dist/components/Card/MucCard.stories.d.ts +0 -165
- package/dist/components/Card/MucCard.vue.d.ts +0 -46
- package/dist/components/Card/MucCardContainer.stories.d.ts +0 -148
- package/dist/components/Card/MucCardContainer.vue.d.ts +0 -19
- package/dist/components/Comment/MucComment.stories.d.ts +0 -106
- package/dist/components/Comment/MucComment.vue.d.ts +0 -105
- package/dist/components/Comment/MucCommentText.stories.d.ts +0 -93
- package/dist/components/Comment/MucCommentText.vue.d.ts +0 -47
- package/dist/components/Form/MucCheckbox.stories.d.ts +0 -40
- package/dist/components/Form/MucCheckbox.vue.d.ts +0 -26
- package/dist/components/Form/MucCheckboxGroup.stories.d.ts +0 -241
- package/dist/components/Form/MucCheckboxGroup.vue.d.ts +0 -46
- package/dist/components/Form/MucCounter.stories.d.ts +0 -89
- package/dist/components/Form/MucCounter.vue.d.ts +0 -54
- package/dist/components/Form/MucErrorList.stories.d.ts +0 -41
- package/dist/components/Form/MucErrorList.vue.d.ts +0 -17
- package/dist/components/Form/MucInput.stories.d.ts +0 -239
- package/dist/components/Form/MucRadioButton.stories.d.ts +0 -168
- package/dist/components/Form/MucRadioButton.vue.d.ts +0 -59
- package/dist/components/Form/MucRadioButtonGroup.vue.d.ts +0 -54
- package/dist/components/Form/MucSelect.stories.d.ts +0 -116
- package/dist/components/Form/MucSelectItem.vue.d.ts +0 -18
- package/dist/components/Form/MucTextArea.stories.d.ts +0 -94
- package/dist/components/Form/MucTextArea.vue.d.ts +0 -61
- package/dist/components/Icon/MucIcon.stories.d.ts +0 -43
- package/dist/components/Icon/MucIcon.vue.d.ts +0 -29
- package/dist/components/Intro/MucIntro.stories.d.ts +0 -97
- package/dist/components/Intro/MucIntro.vue.d.ts +0 -54
- package/dist/components/Link/MucLink.stories.d.ts +0 -139
- package/dist/components/Link/MucLink.vue.d.ts +0 -92
- package/dist/muc-patternlab-vue.es.js +0 -973
- package/src/components/Banner/MucBanner.stories.ts +0 -47
- package/src/components/Banner/MucBanner.vue +0 -109
- package/src/components/Banner/index.ts +0 -3
- package/src/components/BuisnessHours/BusinessHourType.ts +0 -28
- package/src/components/BuisnessHours/BusinessHours.stories.ts +0 -108
- package/src/components/BuisnessHours/MucBusinessHours.vue +0 -162
- package/src/components/Button/MucButton.stories.ts +0 -63
- package/src/components/Button/MucButton.vue +0 -89
- package/src/components/Button/index.ts +0 -3
- package/src/components/Callout/MucCallout.stories.ts +0 -49
- package/src/components/Callout/MucCallout.vue +0 -140
- package/src/components/Callout/index.ts +0 -3
- package/src/components/Card/MucCard.stories.ts +0 -55
- package/src/components/Card/MucCard.vue +0 -92
- package/src/components/Card/MucCardContainer.stories.ts +0 -43
- package/src/components/Card/MucCardContainer.vue +0 -37
- package/src/components/Card/index.ts +0 -4
- package/src/components/Comment/CommentType.ts +0 -3
- package/src/components/Comment/MucComment.stories.ts +0 -38
- package/src/components/Comment/MucComment.vue +0 -179
- package/src/components/Comment/MucCommentText.stories.ts +0 -38
- package/src/components/Comment/MucCommentText.vue +0 -61
- package/src/components/Comment/index.ts +0 -4
- package/src/components/Divider/MucDivider.stories.ts +0 -19
- package/src/components/Divider/MucDivider.vue +0 -9
- package/src/components/Divider/index.ts +0 -3
- package/src/components/Form/MucCheckbox.stories.ts +0 -25
- package/src/components/Form/MucCheckbox.vue +0 -47
- package/src/components/Form/MucCheckboxGroup.stories.ts +0 -43
- package/src/components/Form/MucCheckboxGroup.vue +0 -80
- package/src/components/Form/MucCounter.stories.ts +0 -47
- package/src/components/Form/MucCounter.vue +0 -128
- package/src/components/Form/MucErrorList.stories.ts +0 -31
- package/src/components/Form/MucErrorList.vue +0 -34
- package/src/components/Form/MucInput.stories.ts +0 -90
- package/src/components/Form/MucInput.vue +0 -198
- package/src/components/Form/MucRadioButton.stories.ts +0 -32
- package/src/components/Form/MucRadioButton.vue +0 -81
- package/src/components/Form/MucRadioButtonGroup.vue +0 -65
- package/src/components/Form/MucRadioButtonTypes.ts +0 -41
- package/src/components/Form/MucSelect.stories.ts +0 -69
- package/src/components/Form/MucSelect.vue +0 -352
- package/src/components/Form/MucSelectItem.vue +0 -25
- package/src/components/Form/MucSelectTypes.ts +0 -8
- package/src/components/Form/MucTextArea.stories.ts +0 -47
- package/src/components/Form/MucTextArea.vue +0 -80
- package/src/components/Form/index.ts +0 -23
- package/src/components/Icon/MucIcon.stories.ts +0 -35
- package/src/components/Icon/MucIcon.vue +0 -29
- package/src/components/Icon/index.ts +0 -3
- package/src/components/Intro/MucIntro.stories.ts +0 -37
- package/src/components/Intro/MucIntro.vue +0 -70
- package/src/components/Intro/index.ts +0 -3
- package/src/components/Link/MucLink.stories.ts +0 -36
- package/src/components/Link/MucLink.vue +0 -74
- package/src/components/Link/index.ts +0 -3
- package/src/components/index.ts +0 -43
- package/src/composables/useOnClickOutside.ts +0 -24
- package/src/index.ts +0 -14
- /package/{dist/assets → assets}/fonts/open-sans/open-sans-v27-latin-700.eot +0 -0
- /package/{dist/assets → assets}/fonts/open-sans/open-sans-v27-latin-700.svg +0 -0
- /package/{dist/assets → assets}/fonts/open-sans/open-sans-v27-latin-700.ttf +0 -0
- /package/{dist/assets → assets}/fonts/open-sans/open-sans-v27-latin-700.woff +0 -0
- /package/{dist/assets → assets}/fonts/open-sans/open-sans-v27-latin-700.woff2 +0 -0
- /package/{dist/assets → assets}/fonts/open-sans/open-sans-v27-latin-italic.eot +0 -0
- /package/{dist/assets → assets}/fonts/open-sans/open-sans-v27-latin-italic.svg +0 -0
- /package/{dist/assets → assets}/fonts/open-sans/open-sans-v27-latin-italic.ttf +0 -0
- /package/{dist/assets → assets}/fonts/open-sans/open-sans-v27-latin-italic.woff +0 -0
- /package/{dist/assets → assets}/fonts/open-sans/open-sans-v27-latin-italic.woff2 +0 -0
- /package/{dist/assets → assets}/fonts/open-sans/open-sans-v27-latin-regular.eot +0 -0
- /package/{dist/assets → assets}/fonts/open-sans/open-sans-v27-latin-regular.svg +0 -0
- /package/{dist/assets → assets}/fonts/open-sans/open-sans-v27-latin-regular.ttf +0 -0
- /package/{dist/assets → assets}/fonts/open-sans/open-sans-v27-latin-regular.woff +0 -0
- /package/{dist/assets → assets}/fonts/open-sans/open-sans-v27-latin-regular.woff2 +0 -0
- /package/{dist/assets → assets}/fonts/roboto-condensed/roboto-condensed-v19-latin-300.eot +0 -0
- /package/{dist/assets → assets}/fonts/roboto-condensed/roboto-condensed-v19-latin-300.svg +0 -0
- /package/{dist/assets → assets}/fonts/roboto-condensed/roboto-condensed-v19-latin-300.ttf +0 -0
- /package/{dist/assets → assets}/fonts/roboto-condensed/roboto-condensed-v19-latin-300.woff +0 -0
- /package/{dist/assets → assets}/fonts/roboto-condensed/roboto-condensed-v19-latin-300.woff2 +0 -0
- /package/{dist/assets → assets}/fonts/roboto-condensed/roboto-condensed-v19-latin-300italic.eot +0 -0
- /package/{dist/assets → assets}/fonts/roboto-condensed/roboto-condensed-v19-latin-300italic.svg +0 -0
- /package/{dist/assets → assets}/fonts/roboto-condensed/roboto-condensed-v19-latin-300italic.ttf +0 -0
- /package/{dist/assets → assets}/fonts/roboto-condensed/roboto-condensed-v19-latin-300italic.woff +0 -0
- /package/{dist/assets → assets}/fonts/roboto-condensed/roboto-condensed-v19-latin-300italic.woff2 +0 -0
- /package/{dist/assets → assets}/fonts/roboto-condensed/roboto-condensed-v19-latin-700.eot +0 -0
- /package/{dist/assets → assets}/fonts/roboto-condensed/roboto-condensed-v19-latin-700.svg +0 -0
- /package/{dist/assets → assets}/fonts/roboto-condensed/roboto-condensed-v19-latin-700.ttf +0 -0
- /package/{dist/assets → assets}/fonts/roboto-condensed/roboto-condensed-v19-latin-700.woff +0 -0
- /package/{dist/assets → assets}/fonts/roboto-condensed/roboto-condensed-v19-latin-700.woff2 +0 -0
- /package/{dist/assets → assets}/fonts/roboto-condensed/roboto-condensed-v19-latin-700italic.eot +0 -0
- /package/{dist/assets → assets}/fonts/roboto-condensed/roboto-condensed-v19-latin-700italic.svg +0 -0
- /package/{dist/assets → assets}/fonts/roboto-condensed/roboto-condensed-v19-latin-700italic.ttf +0 -0
- /package/{dist/assets → assets}/fonts/roboto-condensed/roboto-condensed-v19-latin-700italic.woff +0 -0
- /package/{dist/assets → assets}/fonts/roboto-condensed/roboto-condensed-v19-latin-700italic.woff2 +0 -0
- /package/{dist/assets → assets}/fonts/roboto-condensed/roboto-condensed-v19-latin-italic.eot +0 -0
- /package/{dist/assets → assets}/fonts/roboto-condensed/roboto-condensed-v19-latin-italic.svg +0 -0
- /package/{dist/assets → assets}/fonts/roboto-condensed/roboto-condensed-v19-latin-italic.ttf +0 -0
- /package/{dist/assets → assets}/fonts/roboto-condensed/roboto-condensed-v19-latin-italic.woff +0 -0
- /package/{dist/assets → assets}/fonts/roboto-condensed/roboto-condensed-v19-latin-italic.woff2 +0 -0
- /package/{dist/assets → assets}/fonts/roboto-condensed/roboto-condensed-v19-latin-regular.eot +0 -0
- /package/{dist/assets → assets}/fonts/roboto-condensed/roboto-condensed-v19-latin-regular.svg +0 -0
- /package/{dist/assets → assets}/fonts/roboto-condensed/roboto-condensed-v19-latin-regular.ttf +0 -0
- /package/{dist/assets → assets}/fonts/roboto-condensed/roboto-condensed-v19-latin-regular.woff +0 -0
- /package/{dist/assets → assets}/fonts/roboto-condensed/roboto-condensed-v19-latin-regular.woff2 +0 -0
- /package/{dist/assets → assets}/temporary/custom-icons.svg +0 -0
- /package/{dist/assets → assets}/temporary/custom-style.css +0 -0
- /package/{dist/assets → assets}/temporary/muc-icons.svg +0 -0
- /package/{dist/assets → assets}/temporary/muenchende-fontfaces.css +0 -0
- /package/{dist/assets → assets}/temporary/muenchende-style.css +0 -0
- /package/{dist/components → components}/Banner/index.d.ts +0 -0
- /package/{dist/components → components}/BuisnessHours/BusinessHourType.d.ts +0 -0
- /package/{dist/components → components}/Button/index.d.ts +0 -0
- /package/{dist/components → components}/Callout/index.d.ts +0 -0
- /package/{dist/components → components}/Card/index.d.ts +0 -0
- /package/{dist/components → components}/Comment/CommentType.d.ts +0 -0
- /package/{dist/components → components}/Comment/index.d.ts +0 -0
- /package/{dist/components → components}/Divider/index.d.ts +0 -0
- /package/{dist/components → components}/Form/MucRadioButtonTypes.d.ts +0 -0
- /package/{dist/components → components}/Form/MucSelectTypes.d.ts +0 -0
- /package/{dist/components → components}/Form/index.d.ts +0 -0
- /package/{dist/components → components}/Icon/index.d.ts +0 -0
- /package/{dist/components → components}/Intro/index.d.ts +0 -0
- /package/{dist/components → components}/Link/index.d.ts +0 -0
- /package/{dist/composables → composables}/useOnClickOutside.d.ts +0 -0
- /package/{dist/index.d.ts → index.d.ts} +0 -0
|
@@ -1,352 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div
|
|
3
|
-
class="m-form-group"
|
|
4
|
-
ref="selectComponentRef"
|
|
5
|
-
>
|
|
6
|
-
<label class="m-label">
|
|
7
|
-
{{ label }}
|
|
8
|
-
</label>
|
|
9
|
-
<div
|
|
10
|
-
class="m-input-wrapper"
|
|
11
|
-
:class="selectType"
|
|
12
|
-
>
|
|
13
|
-
<input
|
|
14
|
-
type="text"
|
|
15
|
-
class="m-input m-combobox m-combobox--single"
|
|
16
|
-
v-model="searchValue"
|
|
17
|
-
@click="openItemList"
|
|
18
|
-
/>
|
|
19
|
-
<span
|
|
20
|
-
class="m-input__trigger"
|
|
21
|
-
@click="toggleItemList"
|
|
22
|
-
>
|
|
23
|
-
<svg
|
|
24
|
-
aria-hidden="true"
|
|
25
|
-
class="icon"
|
|
26
|
-
>
|
|
27
|
-
<use xlink:href="#icon-chevron-down"></use>
|
|
28
|
-
</svg>
|
|
29
|
-
<span class="visually-hidden">Auswahlliste öffnen</span>
|
|
30
|
-
</span>
|
|
31
|
-
<ul
|
|
32
|
-
class="listbox"
|
|
33
|
-
:class="displayOptions"
|
|
34
|
-
@mouseleave="emptyActiveItem"
|
|
35
|
-
>
|
|
36
|
-
<li
|
|
37
|
-
v-for="(option, index) in displayedItems"
|
|
38
|
-
:key="index"
|
|
39
|
-
class="option"
|
|
40
|
-
@mouseenter="activeItem = option"
|
|
41
|
-
:class="[isActiveClass(option), isSelectedClass(option)]"
|
|
42
|
-
@click="clicked(option)"
|
|
43
|
-
>
|
|
44
|
-
<MucSelectItem
|
|
45
|
-
:item="option"
|
|
46
|
-
:item-label="itemTitle"
|
|
47
|
-
/>
|
|
48
|
-
</li>
|
|
49
|
-
<li
|
|
50
|
-
v-if="noItemsFound"
|
|
51
|
-
class="option"
|
|
52
|
-
>
|
|
53
|
-
{{ noItemFoundMessage }}
|
|
54
|
-
</li>
|
|
55
|
-
</ul>
|
|
56
|
-
</div>
|
|
57
|
-
<p
|
|
58
|
-
v-if="!!hint"
|
|
59
|
-
class="m-hint"
|
|
60
|
-
>
|
|
61
|
-
{{ hint }}
|
|
62
|
-
</p>
|
|
63
|
-
</div>
|
|
64
|
-
</template>
|
|
65
|
-
|
|
66
|
-
<script setup lang="ts">
|
|
67
|
-
import { computed, ref, watch } from "vue";
|
|
68
|
-
|
|
69
|
-
import useOnClickOutside from "../../composables/useOnClickOutside";
|
|
70
|
-
import MucSelectItem from "./MucSelectItem.vue";
|
|
71
|
-
import { ItemAsObject, MucSelectItemTypes } from "./MucSelectTypes";
|
|
72
|
-
|
|
73
|
-
/**
|
|
74
|
-
* Ref ot the component
|
|
75
|
-
*/
|
|
76
|
-
const selectComponentRef = ref();
|
|
77
|
-
|
|
78
|
-
/**
|
|
79
|
-
* Exposed selected value / values
|
|
80
|
-
*/
|
|
81
|
-
const selectedValues = defineModel<MucSelectItemTypes | MucSelectItemTypes[]>(
|
|
82
|
-
"modelValue",
|
|
83
|
-
{
|
|
84
|
-
default: [],
|
|
85
|
-
}
|
|
86
|
-
);
|
|
87
|
-
|
|
88
|
-
/**
|
|
89
|
-
* If list of items is shown
|
|
90
|
-
*/
|
|
91
|
-
const showItems = ref<boolean>(false);
|
|
92
|
-
|
|
93
|
-
/**
|
|
94
|
-
* Last interacted item - selected or deselected
|
|
95
|
-
*/
|
|
96
|
-
const lastClickedItem = ref<MucSelectItemTypes>();
|
|
97
|
-
|
|
98
|
-
/**
|
|
99
|
-
* If no items found after filtering
|
|
100
|
-
*/
|
|
101
|
-
const noItemsFound = ref<boolean>(false);
|
|
102
|
-
|
|
103
|
-
/**
|
|
104
|
-
* Index of currently actively hovered item or selected item
|
|
105
|
-
*/
|
|
106
|
-
const activeItem = ref<MucSelectItemTypes>();
|
|
107
|
-
|
|
108
|
-
const props = withDefaults(
|
|
109
|
-
defineProps<{
|
|
110
|
-
/**
|
|
111
|
-
* List of items to be available
|
|
112
|
-
*/
|
|
113
|
-
items: MucSelectItemTypes[];
|
|
114
|
-
|
|
115
|
-
/**
|
|
116
|
-
* Optional label shown above the input
|
|
117
|
-
*/
|
|
118
|
-
label?: string;
|
|
119
|
-
|
|
120
|
-
/**
|
|
121
|
-
* Optional hint shown below the input
|
|
122
|
-
*/
|
|
123
|
-
hint?: string;
|
|
124
|
-
|
|
125
|
-
/**
|
|
126
|
-
* Allow multiple selectable items
|
|
127
|
-
*/
|
|
128
|
-
multiple?: boolean;
|
|
129
|
-
|
|
130
|
-
/**
|
|
131
|
-
* Optional message shown no item is found after filtering
|
|
132
|
-
*/
|
|
133
|
-
noItemFoundMessage?: string;
|
|
134
|
-
|
|
135
|
-
/**
|
|
136
|
-
* Property that contains the value to be displayed in the list when a list of objects is used
|
|
137
|
-
*/
|
|
138
|
-
itemTitle?: string;
|
|
139
|
-
}>(),
|
|
140
|
-
{
|
|
141
|
-
multiple: false,
|
|
142
|
-
noItemFoundMessage: "No items found.",
|
|
143
|
-
itemTitle: "title",
|
|
144
|
-
}
|
|
145
|
-
);
|
|
146
|
-
|
|
147
|
-
/**
|
|
148
|
-
* Toggles the list of items and sets the previously selected item as active
|
|
149
|
-
*/
|
|
150
|
-
const toggleItemList = () => {
|
|
151
|
-
showItems.value = !showItems.value;
|
|
152
|
-
activeItem.value = lastClickedItem.value;
|
|
153
|
-
};
|
|
154
|
-
|
|
155
|
-
/**
|
|
156
|
-
* Opens the list of items and sets the previously selected item as active
|
|
157
|
-
*/
|
|
158
|
-
const openItemList = () => {
|
|
159
|
-
showItems.value = true;
|
|
160
|
-
activeItem.value = lastClickedItem.value;
|
|
161
|
-
searchValue.value = "";
|
|
162
|
-
};
|
|
163
|
-
|
|
164
|
-
/**
|
|
165
|
-
* Closes the list after clicking outside the component
|
|
166
|
-
*/
|
|
167
|
-
useOnClickOutside(selectComponentRef, () => {
|
|
168
|
-
showItems.value = false;
|
|
169
|
-
searchValue.value = outputTransformed.value;
|
|
170
|
-
});
|
|
171
|
-
|
|
172
|
-
/**
|
|
173
|
-
* Actions upon clicking an item
|
|
174
|
-
* @param clickedValue clicked item value
|
|
175
|
-
*/
|
|
176
|
-
const clicked = (clickedValue: MucSelectItemTypes) => {
|
|
177
|
-
lastClickedItem.value = clickedValue;
|
|
178
|
-
|
|
179
|
-
props.multiple
|
|
180
|
-
? updateMVMultiple(clickedValue)
|
|
181
|
-
: updateMVSingle(clickedValue);
|
|
182
|
-
|
|
183
|
-
if (!props.multiple) showItems.value = false;
|
|
184
|
-
};
|
|
185
|
-
|
|
186
|
-
/**
|
|
187
|
-
* Update the modelValue with the given. Performs conversion to string if necessary.
|
|
188
|
-
* @param newValue the new value
|
|
189
|
-
*/
|
|
190
|
-
const updateMVSingle = (newValue: MucSelectItemTypes) => {
|
|
191
|
-
if (Array.isArray(selectedValues.value))
|
|
192
|
-
selectedValues.value = selectedValues.value.join(" ");
|
|
193
|
-
|
|
194
|
-
if (
|
|
195
|
-
typeof selectedValues.value !== "string" &&
|
|
196
|
-
typeof newValue !== "string"
|
|
197
|
-
) {
|
|
198
|
-
selectedValues.value =
|
|
199
|
-
selectedValues.value[props.itemTitle] === newValue[props.itemTitle]
|
|
200
|
-
? ""
|
|
201
|
-
: newValue;
|
|
202
|
-
} else {
|
|
203
|
-
selectedValues.value = selectedValues.value === newValue ? "" : newValue;
|
|
204
|
-
}
|
|
205
|
-
};
|
|
206
|
-
|
|
207
|
-
/**
|
|
208
|
-
* Update the modelValue with the given. Performs conversion to array if necessary.
|
|
209
|
-
* @param newValue the new value
|
|
210
|
-
*/
|
|
211
|
-
const updateMVMultiple = (newValue: MucSelectItemTypes) => {
|
|
212
|
-
if (!Array.isArray(selectedValues.value))
|
|
213
|
-
selectedValues.value = [selectedValues.value];
|
|
214
|
-
|
|
215
|
-
if (Array.isArray(selectedValues.value)) {
|
|
216
|
-
if (typeof newValue === "string") {
|
|
217
|
-
selectedValues.value = selectedValues.value
|
|
218
|
-
.map((item: string) => item)
|
|
219
|
-
.includes(newValue)
|
|
220
|
-
? selectedValues.value.filter((val: string) => val !== newValue)
|
|
221
|
-
: [...selectedValues.value, newValue];
|
|
222
|
-
} else {
|
|
223
|
-
selectedValues.value = selectedValues.value
|
|
224
|
-
.map((item: ItemAsObject) => item[props.itemTitle])
|
|
225
|
-
.includes(newValue[props.itemTitle])
|
|
226
|
-
? selectedValues.value.filter(
|
|
227
|
-
(val: ItemAsObject) =>
|
|
228
|
-
val[props.itemTitle] !== newValue[props.itemTitle]
|
|
229
|
-
)
|
|
230
|
-
: [...selectedValues.value, newValue];
|
|
231
|
-
}
|
|
232
|
-
}
|
|
233
|
-
};
|
|
234
|
-
|
|
235
|
-
/**
|
|
236
|
-
* Converts the displayed text depending on the selection mode
|
|
237
|
-
*/
|
|
238
|
-
const outputTransformed = computed(() => {
|
|
239
|
-
if (typeof selectedValues.value === "string") {
|
|
240
|
-
return selectedValues.value;
|
|
241
|
-
} else if (!Array.isArray(selectedValues.value)) {
|
|
242
|
-
return selectedValues.value[props.itemTitle].toString();
|
|
243
|
-
} else if (
|
|
244
|
-
selectedValues.value.every((item: any) => typeof item === "string")
|
|
245
|
-
) {
|
|
246
|
-
return selectedValues.value.join(props.multiple ? ", " : " ");
|
|
247
|
-
} else {
|
|
248
|
-
return selectedValues.value
|
|
249
|
-
.map((item) => item[props.itemTitle].toString())
|
|
250
|
-
.join(props.multiple ? ", " : " ");
|
|
251
|
-
}
|
|
252
|
-
});
|
|
253
|
-
|
|
254
|
-
watch(outputTransformed, (newOutput) => {
|
|
255
|
-
searchValue.value = newOutput;
|
|
256
|
-
});
|
|
257
|
-
|
|
258
|
-
/**
|
|
259
|
-
* Current search value
|
|
260
|
-
*/
|
|
261
|
-
const searchValue = ref<string>(outputTransformed.value);
|
|
262
|
-
|
|
263
|
-
/**
|
|
264
|
-
* Determines whether all or only the searched elements are displayed
|
|
265
|
-
*/
|
|
266
|
-
const displayedItems = computed(() =>
|
|
267
|
-
searchValue.value == outputTransformed.value
|
|
268
|
-
? props.items
|
|
269
|
-
: updateDisplayedItems(searchValue.value)
|
|
270
|
-
);
|
|
271
|
-
|
|
272
|
-
/**
|
|
273
|
-
* Filters the list of elements after entering the search string
|
|
274
|
-
* @param search the search string
|
|
275
|
-
* @return list of searched items
|
|
276
|
-
*/
|
|
277
|
-
const updateDisplayedItems = (search: string) => {
|
|
278
|
-
noItemsFound.value = false;
|
|
279
|
-
const filteredItems = props.items.every(
|
|
280
|
-
(item: any) => typeof item === "string"
|
|
281
|
-
)
|
|
282
|
-
? props.items.filter((item) =>
|
|
283
|
-
item.toLowerCase().includes(search.toLowerCase())
|
|
284
|
-
)
|
|
285
|
-
: props.items.filter((item: any) =>
|
|
286
|
-
item[props.itemTitle]
|
|
287
|
-
.toString()
|
|
288
|
-
.toLowerCase()
|
|
289
|
-
.includes(search.toLowerCase())
|
|
290
|
-
);
|
|
291
|
-
if (filteredItems.length === 0) {
|
|
292
|
-
noItemsFound.value = true;
|
|
293
|
-
}
|
|
294
|
-
return filteredItems;
|
|
295
|
-
};
|
|
296
|
-
|
|
297
|
-
/**
|
|
298
|
-
* Apply active class to hovered item
|
|
299
|
-
* @param value of item
|
|
300
|
-
*/
|
|
301
|
-
const isActiveClass = (value: MucSelectItemTypes) =>
|
|
302
|
-
value === activeItem.value ? "active" : "";
|
|
303
|
-
|
|
304
|
-
/**
|
|
305
|
-
* Apply selected class to selected items
|
|
306
|
-
* @param value of item
|
|
307
|
-
*/
|
|
308
|
-
const isSelectedClass = (value: MucSelectItemTypes) => {
|
|
309
|
-
if (typeof value === "string")
|
|
310
|
-
return selectedValues.value.includes(value) ? "selected" : "";
|
|
311
|
-
|
|
312
|
-
if (Array.isArray(selectedValues.value)) {
|
|
313
|
-
return selectedValues.value
|
|
314
|
-
.map((item) => item[props.itemTitle])
|
|
315
|
-
.includes(value[props.itemTitle])
|
|
316
|
-
? "selected"
|
|
317
|
-
: "";
|
|
318
|
-
}
|
|
319
|
-
if (typeof selectedValues.value !== "string") {
|
|
320
|
-
return selectedValues.value[props.itemTitle] === value[props.itemTitle]
|
|
321
|
-
? "selected"
|
|
322
|
-
: "";
|
|
323
|
-
}
|
|
324
|
-
};
|
|
325
|
-
|
|
326
|
-
/**
|
|
327
|
-
* Resets the currently activeItem
|
|
328
|
-
*/
|
|
329
|
-
const emptyActiveItem = () => (activeItem.value = "");
|
|
330
|
-
|
|
331
|
-
/**
|
|
332
|
-
* Display the list of item by changing the css-display property
|
|
333
|
-
*/
|
|
334
|
-
const displayOptions = computed(() =>
|
|
335
|
-
showItems.value ? "display-listbox" : ""
|
|
336
|
-
);
|
|
337
|
-
|
|
338
|
-
/**
|
|
339
|
-
* Switches between the selection modes according to multiple. Checkboxes are shown on the multiple select
|
|
340
|
-
*/
|
|
341
|
-
const selectType = computed(() =>
|
|
342
|
-
props.multiple && !noItemsFound.value
|
|
343
|
-
? "m-input-wrapper--multiselect multiselect"
|
|
344
|
-
: "m-input-wrapper--select"
|
|
345
|
-
);
|
|
346
|
-
</script>
|
|
347
|
-
|
|
348
|
-
<style scoped>
|
|
349
|
-
.display-listbox {
|
|
350
|
-
display: block !important;
|
|
351
|
-
}
|
|
352
|
-
</style>
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<span>
|
|
3
|
-
{{ itemText }}
|
|
4
|
-
</span>
|
|
5
|
-
</template>
|
|
6
|
-
|
|
7
|
-
<script setup lang="ts">
|
|
8
|
-
import { computed } from "vue";
|
|
9
|
-
|
|
10
|
-
import { MucSelectItemTypes } from "./MucSelectTypes";
|
|
11
|
-
|
|
12
|
-
const props = defineProps<{
|
|
13
|
-
item: MucSelectItemTypes;
|
|
14
|
-
itemLabel: string;
|
|
15
|
-
}>();
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* Defines the displayed value
|
|
19
|
-
*/
|
|
20
|
-
const itemText = computed(() =>
|
|
21
|
-
typeof props.item === "string"
|
|
22
|
-
? props.item
|
|
23
|
-
: props.item[props.itemLabel].toString()
|
|
24
|
-
);
|
|
25
|
-
</script>
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import MucTextArea from "./MucTextArea.vue";
|
|
2
|
-
|
|
3
|
-
export default {
|
|
4
|
-
component: MucTextArea,
|
|
5
|
-
title: "Forms/MucTextArea",
|
|
6
|
-
tags: ["autodocs"],
|
|
7
|
-
parameters: {
|
|
8
|
-
docs: {
|
|
9
|
-
description: {
|
|
10
|
-
component: `The muc-text-area component allows bigger text based inputs then the regular input. The size is adjustable.
|
|
11
|
-
|
|
12
|
-
[🔗 Patternlab-Docs](https://patternlab.muenchen.space/?p=elements-textarea)
|
|
13
|
-
`,
|
|
14
|
-
},
|
|
15
|
-
},
|
|
16
|
-
},
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
export const Default = {
|
|
20
|
-
args: {
|
|
21
|
-
placeholder: "Write some very long text here",
|
|
22
|
-
},
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
export const Error = {
|
|
26
|
-
args: {
|
|
27
|
-
...Default.args,
|
|
28
|
-
errorMsg: "An error occured",
|
|
29
|
-
},
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
export const Required = {
|
|
33
|
-
args: {
|
|
34
|
-
label: "Required textarea",
|
|
35
|
-
...Default.args,
|
|
36
|
-
required: true,
|
|
37
|
-
},
|
|
38
|
-
};
|
|
39
|
-
|
|
40
|
-
export const BigTextArea = {
|
|
41
|
-
args: {
|
|
42
|
-
...Default.args,
|
|
43
|
-
rows: 7,
|
|
44
|
-
label: "Big textarea",
|
|
45
|
-
hint: "Write a lot of text",
|
|
46
|
-
},
|
|
47
|
-
};
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="m-form-group has-error">
|
|
3
|
-
<label
|
|
4
|
-
for="textarea"
|
|
5
|
-
class="m-label"
|
|
6
|
-
>
|
|
7
|
-
{{ label }}
|
|
8
|
-
<span
|
|
9
|
-
v-if="required"
|
|
10
|
-
aria-hidden="true"
|
|
11
|
-
class="mandatory"
|
|
12
|
-
>
|
|
13
|
-
*
|
|
14
|
-
<span class="visually-hidden">(erforderlich)</span>
|
|
15
|
-
</span>
|
|
16
|
-
</label>
|
|
17
|
-
<p class="m-error-message">
|
|
18
|
-
{{ errorMsg }}
|
|
19
|
-
</p>
|
|
20
|
-
<div class="m-input-wrapper">
|
|
21
|
-
<textarea
|
|
22
|
-
class="m-textarea"
|
|
23
|
-
:rows="rows"
|
|
24
|
-
aria-describedby="textarea input"
|
|
25
|
-
:placeholder="placeholder"
|
|
26
|
-
v-model="modelValue"
|
|
27
|
-
/>
|
|
28
|
-
</div>
|
|
29
|
-
<p class="m-hint">
|
|
30
|
-
{{ hint }}
|
|
31
|
-
</p>
|
|
32
|
-
</div>
|
|
33
|
-
</template>
|
|
34
|
-
|
|
35
|
-
<script setup lang="ts">
|
|
36
|
-
/**
|
|
37
|
-
* Input value from the form component.
|
|
38
|
-
*/
|
|
39
|
-
const modelValue = defineModel<string>({ default: "" });
|
|
40
|
-
|
|
41
|
-
withDefaults(
|
|
42
|
-
defineProps<{
|
|
43
|
-
/**
|
|
44
|
-
* Displays error message and highlights the input form with a red border.
|
|
45
|
-
*/
|
|
46
|
-
errorMsg?: string;
|
|
47
|
-
|
|
48
|
-
/**
|
|
49
|
-
* Number of rows displayed of the textarea. Default is three.
|
|
50
|
-
*/
|
|
51
|
-
rows?: number;
|
|
52
|
-
|
|
53
|
-
/**
|
|
54
|
-
* Placeholder for empty input form.
|
|
55
|
-
*/
|
|
56
|
-
placeholder?: string;
|
|
57
|
-
|
|
58
|
-
/**
|
|
59
|
-
* Displays a label above the form component.
|
|
60
|
-
*/
|
|
61
|
-
label?: string;
|
|
62
|
-
|
|
63
|
-
/**
|
|
64
|
-
* Displays a hint beneath the form component.
|
|
65
|
-
*/
|
|
66
|
-
hint?: string;
|
|
67
|
-
|
|
68
|
-
/**
|
|
69
|
-
* Sets this input form as required. Default is false.
|
|
70
|
-
*/
|
|
71
|
-
required?: boolean;
|
|
72
|
-
}>(),
|
|
73
|
-
{
|
|
74
|
-
rows: 3,
|
|
75
|
-
required: false,
|
|
76
|
-
}
|
|
77
|
-
);
|
|
78
|
-
</script>
|
|
79
|
-
|
|
80
|
-
<style scoped></style>
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import MucCheckbox from "./MucCheckbox.vue";
|
|
2
|
-
import MucCheckboxGroup from "./MucCheckboxGroup.vue";
|
|
3
|
-
import MucCounter from "./MucCounter.vue";
|
|
4
|
-
import MucErrorList from "./MucErrorList.vue";
|
|
5
|
-
import MucForm from "./MucInput.vue";
|
|
6
|
-
import MucInput from "./MucInput.vue";
|
|
7
|
-
import MucRadioButton from "./MucRadioButton.vue";
|
|
8
|
-
import MucRadioButtonGroup from "./MucRadioButtonGroup.vue";
|
|
9
|
-
import MucSelect from "./MucSelect.vue";
|
|
10
|
-
import MucTextArea from "./MucTextArea.vue";
|
|
11
|
-
|
|
12
|
-
export {
|
|
13
|
-
MucForm,
|
|
14
|
-
MucCheckbox,
|
|
15
|
-
MucCheckboxGroup,
|
|
16
|
-
MucCounter,
|
|
17
|
-
MucRadioButtonGroup,
|
|
18
|
-
MucInput,
|
|
19
|
-
MucRadioButton,
|
|
20
|
-
MucTextArea,
|
|
21
|
-
MucErrorList,
|
|
22
|
-
MucSelect,
|
|
23
|
-
};
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { fn } from "@storybook/test";
|
|
2
|
-
|
|
3
|
-
import MucIcon from "./MucIcon.vue";
|
|
4
|
-
|
|
5
|
-
export default {
|
|
6
|
-
component: MucIcon,
|
|
7
|
-
title: "MucIcon",
|
|
8
|
-
tags: ["autodocs"],
|
|
9
|
-
// 👇 Use `fn` to spy on the onClick arg, which will appear in the actions panel once invoked
|
|
10
|
-
args: { onClick: fn() },
|
|
11
|
-
parameters: {
|
|
12
|
-
docs: {
|
|
13
|
-
description: {
|
|
14
|
-
component: `The \`muc-icon\` component is a wrapper commponent for all icons in the patternlab.
|
|
15
|
-
|
|
16
|
-
[🔗 Patternlab-Docs](https://patternlab.muenchen.space/?p=viewall-guidelines-icons)
|
|
17
|
-
[🖼 Iconography](https://it-at-m.github.io/muc-patternlab-vue/?path=/docs/iconography--docs)
|
|
18
|
-
`,
|
|
19
|
-
},
|
|
20
|
-
},
|
|
21
|
-
},
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
export const Weather = {
|
|
25
|
-
args: {
|
|
26
|
-
icon: "weather",
|
|
27
|
-
},
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
export const Youtube = {
|
|
31
|
-
args: {
|
|
32
|
-
icon: "youtube",
|
|
33
|
-
color: "red",
|
|
34
|
-
},
|
|
35
|
-
};
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<svg
|
|
3
|
-
aria-hidden="true"
|
|
4
|
-
:class="iconClass"
|
|
5
|
-
:style="{ color: color }"
|
|
6
|
-
>
|
|
7
|
-
<use :href="'#icon-' + icon" />
|
|
8
|
-
</svg>
|
|
9
|
-
</template>
|
|
10
|
-
|
|
11
|
-
<script setup lang="ts">
|
|
12
|
-
import { computed, useAttrs } from "vue";
|
|
13
|
-
|
|
14
|
-
const attr = useAttrs();
|
|
15
|
-
|
|
16
|
-
defineProps<{
|
|
17
|
-
/**
|
|
18
|
-
* String of the icon to be displayed.
|
|
19
|
-
*/
|
|
20
|
-
icon: string;
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* Optional css-color for the icon.
|
|
24
|
-
*/
|
|
25
|
-
color?: string;
|
|
26
|
-
}>();
|
|
27
|
-
|
|
28
|
-
const iconClass = computed(() => attr.class ?? "icon");
|
|
29
|
-
</script>
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import MucIntro from "./MucIntro.vue";
|
|
2
|
-
|
|
3
|
-
export default {
|
|
4
|
-
component: MucIntro,
|
|
5
|
-
title: "MucIntro",
|
|
6
|
-
tags: ["autodocs"],
|
|
7
|
-
parameters: {
|
|
8
|
-
docs: {
|
|
9
|
-
description: {
|
|
10
|
-
component: `A header-like component which can be used as first heading for a component that replaces a whole page on muenchen.de.
|
|
11
|
-
|
|
12
|
-
Used e.g. in https://stadt.muenchen.de/buergerservice/anliegen.html.
|
|
13
|
-
|
|
14
|
-
[🔗 Patternlab-Docs](https://patternlab.muenchen.space/?p=components-intro-vertical-article)
|
|
15
|
-
`,
|
|
16
|
-
},
|
|
17
|
-
},
|
|
18
|
-
},
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
export const Default = {
|
|
22
|
-
args: {
|
|
23
|
-
tagline: "Tagline",
|
|
24
|
-
title: "Intro with Title",
|
|
25
|
-
divider: true,
|
|
26
|
-
default:
|
|
27
|
-
"Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum.\n" +
|
|
28
|
-
" Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.",
|
|
29
|
-
},
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
export const Minimal = {
|
|
33
|
-
args: {
|
|
34
|
-
title: "Smaller Intro with Title",
|
|
35
|
-
default: Default.args.default,
|
|
36
|
-
},
|
|
37
|
-
};
|