Skip to content

Commit 2815c2d

Browse files
authored
🐛 Merge pull request #185 from it-at-m/beta
🐛 resolving bug of wrong imports
2 parents 310c73e + c747361 commit 2815c2d

File tree

9 files changed

+1617
-1826
lines changed

9 files changed

+1617
-1826
lines changed

package-lock.json

Lines changed: 1577 additions & 1813 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@
7272
"npm-run-all2": "^6.1.1",
7373
"prettier": "^3.0.3",
7474
"rimraf": "^6.0.0",
75-
"semantic-release": "^22.0.0",
75+
"semantic-release": "^23.1.1",
7676
"semantic-release-gitmoji": "^1.6.5",
7777
"storybook": "^8.0.9",
7878
"typescript": "~5.5.0",

src/components/Comment/MucComment.vue

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -126,17 +126,27 @@ const showDate = computed(() => {
126126
return !!slots["date"];
127127
});
128128
129+
/**
130+
* Computes class for given variant
131+
*/
129132
const commentClass = computed(() => {
130133
return props.variant === "slider"
131134
? "m-comment--slider"
132135
: "m-comment--listing";
133136
});
134137
138+
/**
139+
* Computes rating with min and max limits
140+
*/
141+
const computedRating = computed(() =>
142+
Math.min(Math.max(props.rating, 0), MAX_STARS)
143+
);
144+
135145
/*
136146
* Converts the dot used on decimal numbers and converts it to a comma.
137147
*/
138148
const ratingWithDecimalComma = computed(() => {
139-
return props.rating.toLocaleString(LOCALES.valueOf(), {
149+
return computedRating.value.toLocaleString(LOCALES.valueOf(), {
140150
minimumFractionDigits: 1,
141151
});
142152
});
@@ -145,14 +155,14 @@ const ratingWithDecimalComma = computed(() => {
145155
Calculates the amount of full, empty and half-stars to be displayed.
146156
*/
147157
const evaluateRating = computed(() => {
148-
const decimalPart = +(props.rating % 1).toFixed(1); // ask Brendan Eich why "3.3 % 1 = 0.2999999999999998" and then come back
158+
const decimalPart = +(computedRating.value % 1).toFixed(1); // ask Brendan Eich why "3.3 % 1 = 0.2999999999999998" and then come back
149159
150-
let fullStars = Math.min(Math.floor(props.rating), MAX_STARS);
151-
let emptyStars = Math.floor(MAX_STARS - props.rating);
160+
let fullStars = Math.min(Math.floor(computedRating.value), MAX_STARS);
161+
let emptyStars = Math.floor(MAX_STARS - computedRating.value);
152162
let isHalfStar = false;
153163
154164
// evaluating half-stars and if the rating is e.g. 3.9 an extra full star needs to be displayed
155-
if (props.rating !== 0.0 && props.rating !== MAX_STARS) {
165+
if (computedRating.value !== 0.0 && computedRating.value !== MAX_STARS) {
156166
if (decimalPart <= LOWER_THRESHOLD) emptyStars++;
157167
else if (decimalPart >= UPPER_THRESHOLD) fullStars++;
158168
else isHalfStar = true;

src/components/Form/MucRadioButton.stories.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import MucRadioButtonGroup from "./MucRadioButtonGroup.vue";
33

44
export default {
55
component: MucRadioButton,
6-
title: "Forms/RadioButton",
6+
title: "Forms/MucRadioButton",
77
tags: ["autodocs"],
88
parameters: {
99
docs: {

src/components/Form/MucRadioButton.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
<script setup lang="ts">
2626
import { computed, inject } from "vue";
2727
28-
import { RadioButtonGroupKey } from "./RadioButtonTypes";
28+
import { RadioButtonGroupKey } from "./MucRadioButtonTypes";
2929
3030
const props = withDefaults(
3131
defineProps<{

src/components/Form/MucRadioButtonGroup.vue

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,10 @@
1616
<script setup lang="ts">
1717
import { provide, readonly, toRef } from "vue";
1818
19-
import { RadioButtonGroupKey, RadioButtonValueTypes } from "./RadioButtonTypes";
19+
import {
20+
RadioButtonGroupKey,
21+
RadioButtonValueTypes,
22+
} from "./MucRadioButtonTypes";
2023
2124
/**
2225
* exposed two-way binding of the currently selected radiobuttons-value

src/components/Form/index.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import MucForm from "./MucInput.vue";
55
import MucInput from "./MucInput.vue";
66
import MucRadioButton from "./MucRadioButton.vue";
77
import MucRadioButtonGroup from "./MucRadioButtonGroup.vue";
8-
import MucSingleSelect from "./MucSelect.vue";
98
import MucSelect from "./MucSelect.vue";
109
import MucTextArea from "./MucTextArea.vue";
1110

@@ -17,7 +16,6 @@ export {
1716
MucInput,
1817
MucRadioButton,
1918
MucTextArea,
20-
MucSingleSelect,
2119
MucErrorList,
2220
MucSelect,
2321
};

src/components/index.ts

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,16 @@ import { MucButton } from "./Button";
33
import { MucCallout } from "./Callout";
44
import { MucCard, MucCardContainer } from "./Card";
55
import { MucComment, MucCommentText } from "./Comment/";
6-
import { MucForm } from "./Form";
6+
import {
7+
MucCheckbox,
8+
MucCheckboxGroup,
9+
MucErrorList,
10+
MucInput,
11+
MucRadioButton,
12+
MucRadioButtonGroup,
13+
MucSelect,
14+
MucTextArea,
15+
} from "./Form";
716
import { MucIcon } from "./Icon";
817
import { MucIntro } from "./Intro";
918

@@ -16,6 +25,13 @@ export {
1625
MucCardContainer,
1726
MucComment,
1827
MucCommentText,
19-
MucForm,
28+
MucRadioButton,
29+
MucRadioButtonGroup,
30+
MucInput,
31+
MucTextArea,
32+
MucCheckboxGroup,
33+
MucCheckbox,
34+
MucSelect,
35+
MucErrorList,
2036
MucIcon,
2137
};

0 commit comments

Comments
 (0)