@muenchen/muc-patternlab-vue 1.11.0-beta.2 → 1.11.0-beta.3
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/README.md +1 -4
- package/dist/components/Form/MucCheckbox.stories.d.ts +34 -0
- package/dist/components/Form/MucCheckbox.vue.d.ts +18 -0
- package/dist/components/Form/MucCheckboxGroup.stories.d.ts +223 -0
- package/dist/components/Form/MucCheckboxGroup.vue.d.ts +46 -0
- package/dist/components/Form/MucErrorList.stories.d.ts +41 -0
- package/dist/components/Form/MucErrorList.vue.d.ts +17 -0
- package/dist/components/Form/MucInput.stories.d.ts +225 -0
- package/dist/components/Form/MucInput.vue.d.ts +86 -0
- package/dist/components/Form/MucRadioButton.stories.d.ts +154 -0
- package/dist/components/Form/MucRadioButton.vue.d.ts +59 -0
- package/dist/components/Form/MucRadioButtonGroup.vue.d.ts +37 -0
- package/dist/components/Form/MucSelect.stories.d.ts +64 -0
- package/dist/components/Form/MucSelect.vue.d.ts +36 -0
- package/dist/components/Form/MucTextArea.stories.d.ts +86 -0
- package/dist/components/Form/MucTextArea.vue.d.ts +49 -0
- package/dist/components/Form/RadioButtonTypes.d.ts +30 -0
- package/dist/components/Form/index.d.ts +10 -0
- package/dist/components/index.d.ts +2 -1
- package/dist/muc-patternlab-vue.es.js +311 -240
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/src/components/Banner/MucBanner.vue +6 -6
- package/src/components/BuisnessHours/MucBusinessHours.vue +7 -11
- package/src/components/Button/MucButton.vue +5 -5
- package/src/components/Callout/MucCallout.vue +3 -6
- package/src/components/Comment/MucComment.vue +7 -21
- package/src/components/Form/MucCheckbox.stories.ts +25 -0
- package/src/components/Form/MucCheckbox.vue +47 -0
- package/src/components/Form/MucCheckboxGroup.stories.ts +43 -0
- package/src/components/Form/MucCheckboxGroup.vue +80 -0
- package/src/components/Form/MucErrorList.stories.ts +31 -0
- package/src/components/Form/MucErrorList.vue +34 -0
- package/src/components/Form/MucInput.stories.ts +90 -0
- package/src/components/Form/MucInput.vue +198 -0
- package/src/components/Form/MucRadioButton.stories.ts +32 -0
- package/src/components/Form/MucRadioButton.vue +81 -0
- package/src/components/Form/MucRadioButtonGroup.vue +62 -0
- package/src/components/Form/MucSelect.stories.ts +34 -0
- package/src/components/Form/MucSelect.vue +201 -0
- package/src/components/Form/MucTextArea.stories.ts +47 -0
- package/src/components/Form/MucTextArea.vue +80 -0
- package/src/components/Form/RadioButtonTypes.ts +41 -0
- package/src/components/Form/index.ts +23 -0
- package/src/components/Icon/MucIcon.vue +7 -1
- package/src/components/Intro/MucIntro.vue +2 -2
- package/src/components/index.ts +2 -0
|
@@ -0,0 +1,80 @@
|
|
|
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>
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { InjectionKey, Ref } from "vue";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Key for inject and provide
|
|
5
|
+
*
|
|
6
|
+
* @type {InjectionKey<RadioButtonGroupInjection>}
|
|
7
|
+
*/
|
|
8
|
+
export const RadioButtonGroupKey: InjectionKey<RadioButtonGroupInjection> =
|
|
9
|
+
Symbol("mucRadioGroup");
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Type getting injected / provided
|
|
13
|
+
*/
|
|
14
|
+
export type RadioButtonGroupInjection = {
|
|
15
|
+
/**
|
|
16
|
+
* Function for setting the value of the current selected radiobutton
|
|
17
|
+
* @param {RadioButtonValueTypes} value - Value being set as the new current selected radiobutton
|
|
18
|
+
*/
|
|
19
|
+
set: (value: RadioButtonValueTypes) => void;
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Current value of the currently selected radiobutton
|
|
23
|
+
*/
|
|
24
|
+
modelValue: Readonly<Ref<RadioButtonValueTypes | undefined>>;
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Deactivate all child radiobuttons
|
|
28
|
+
*/
|
|
29
|
+
disabled: Readonly<Ref<boolean>>;
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Different possible types used as value for a radiobutton-values
|
|
34
|
+
*/
|
|
35
|
+
export type RadioButtonValueTypes =
|
|
36
|
+
| boolean
|
|
37
|
+
| string
|
|
38
|
+
| unknown[]
|
|
39
|
+
| Record<string, unknown>
|
|
40
|
+
| number
|
|
41
|
+
| null;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import MucCheckbox from "./MucCheckbox.vue";
|
|
2
|
+
import MucCheckboxGroup from "./MucCheckboxGroup.vue";
|
|
3
|
+
import MucErrorList from "./MucErrorList.vue";
|
|
4
|
+
import MucForm from "./MucInput.vue";
|
|
5
|
+
import MucInput from "./MucInput.vue";
|
|
6
|
+
import MucRadioButton from "./MucRadioButton.vue";
|
|
7
|
+
import MucRadioButtonGroup from "./MucRadioButtonGroup.vue";
|
|
8
|
+
import MucSingleSelect from "./MucSelect.vue";
|
|
9
|
+
import MucSelect from "./MucSelect.vue";
|
|
10
|
+
import MucTextArea from "./MucTextArea.vue";
|
|
11
|
+
|
|
12
|
+
export {
|
|
13
|
+
MucForm,
|
|
14
|
+
MucCheckbox,
|
|
15
|
+
MucCheckboxGroup,
|
|
16
|
+
MucRadioButtonGroup,
|
|
17
|
+
MucInput,
|
|
18
|
+
MucRadioButton,
|
|
19
|
+
MucTextArea,
|
|
20
|
+
MucSingleSelect,
|
|
21
|
+
MucErrorList,
|
|
22
|
+
MucSelect,
|
|
23
|
+
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<svg
|
|
3
3
|
aria-hidden="true"
|
|
4
|
-
class="
|
|
4
|
+
:class="iconClass"
|
|
5
5
|
:style="{ color: color }"
|
|
6
6
|
>
|
|
7
7
|
<use :href="'#icon-' + icon" />
|
|
@@ -9,6 +9,10 @@
|
|
|
9
9
|
</template>
|
|
10
10
|
|
|
11
11
|
<script setup lang="ts">
|
|
12
|
+
import { computed, useAttrs } from "vue";
|
|
13
|
+
|
|
14
|
+
const attr = useAttrs();
|
|
15
|
+
|
|
12
16
|
defineProps<{
|
|
13
17
|
/**
|
|
14
18
|
* String of the icon to be displayed.
|
|
@@ -20,4 +24,6 @@ defineProps<{
|
|
|
20
24
|
*/
|
|
21
25
|
color?: string;
|
|
22
26
|
}>();
|
|
27
|
+
|
|
28
|
+
const iconClass = computed(() => attr.class ?? "icon");
|
|
23
29
|
</script>
|
package/src/components/index.ts
CHANGED
|
@@ -3,6 +3,7 @@ import { MucButton } from "./Button";
|
|
|
3
3
|
import { MucCallout } from "./Callout";
|
|
4
4
|
import { MucCard, MucCardContainer } from "./Card";
|
|
5
5
|
import { MucComment, MucCommentText } from "./Comment/";
|
|
6
|
+
import { MucForm } from "./Form";
|
|
6
7
|
import { MucIcon } from "./Icon";
|
|
7
8
|
import { MucIntro } from "./Intro";
|
|
8
9
|
|
|
@@ -15,5 +16,6 @@ export {
|
|
|
15
16
|
MucCardContainer,
|
|
16
17
|
MucComment,
|
|
17
18
|
MucCommentText,
|
|
19
|
+
MucForm,
|
|
18
20
|
MucIcon,
|
|
19
21
|
};
|