@dpa-id-components/dpa-shared-components 22.0.0-next.9 → 22.0.1

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.
Files changed (143) hide show
  1. package/dist/assets/icons/bot.vue.d.ts +3 -0
  2. package/dist/bot-C103nFwL.js +19 -0
  3. package/dist/components/UiCheckbox/UiCheckbox.vue.d.ts +1 -1
  4. package/dist/components/UiIcon/icons.d.ts +1 -0
  5. package/dist/components/UiInput/UiInput.vue.d.ts +1 -1
  6. package/dist/components/UiMenu/UiMenu.vue.d.ts +1 -1
  7. package/dist/components/index.d.ts +1 -18
  8. package/dist/dpa-shared-components.js +3326 -3978
  9. package/dist/eslint.base.config.js +1 -4
  10. package/dist/src/assets/icons/bot.vue +14 -0
  11. package/dist/src/components/UiChip/UiChip.spec.ts +1 -1
  12. package/dist/src/components/UiChip/UiChip.vue +2 -2
  13. package/dist/src/components/UiDatePicker/UiDatePicker.vue +11 -8
  14. package/dist/src/components/UiDialog/UiDialog.vue +10 -7
  15. package/dist/src/components/UiFilterBadge/UiFilterBadge.stories.ts +1 -3
  16. package/dist/src/components/UiIcon/UiIcon.stories.ts +1 -1
  17. package/dist/src/components/UiIcon/icons.ts +1 -0
  18. package/dist/src/components/UiListItem/README.md +13 -12
  19. package/dist/src/components/UiListItem/UiListItem.stories.ts +0 -26
  20. package/dist/src/components/UiListItem/UiListItem.vue +4 -2
  21. package/dist/src/components/UiMediaTypeIcon/UiMediaTypeIcon.stories.ts +1 -1
  22. package/dist/src/components/UiMenu/UiMenu.stories.ts +85 -2
  23. package/dist/src/components/UiMenu/UiMenu.vue +7 -8
  24. package/dist/src/components/UiSelect/UiSelect.vue +1 -1
  25. package/dist/src/components/index.ts +0 -33
  26. package/dist/src/tailwindPreset.css +70 -62
  27. package/dist/style.css +2 -2
  28. package/dist/tailwindPreset.css +70 -62
  29. package/package.json +22 -22
  30. package/src/assets/icons/bot.vue +14 -0
  31. package/src/components/UiChip/UiChip.vue +2 -2
  32. package/src/components/UiDatePicker/UiDatePicker.vue +11 -8
  33. package/src/components/UiDialog/UiDialog.vue +10 -7
  34. package/src/components/UiIcon/icons.ts +1 -0
  35. package/src/components/UiListItem/README.md +13 -12
  36. package/src/components/UiListItem/UiListItem.vue +4 -2
  37. package/src/components/UiMenu/UiMenu.vue +7 -8
  38. package/src/components/UiSelect/UiSelect.vue +1 -1
  39. package/src/tailwindPreset.css +70 -62
  40. package/dist/components/DpaMediaItem/DpaMediaItem.vue.d.ts +0 -43
  41. package/dist/components/UiButtonGroup/UiButtonGroup.vue.d.ts +0 -7
  42. package/dist/components/UiCard/UiCard.vue.d.ts +0 -7
  43. package/dist/components/UiCheckBoxGroup/UiCheckBoxGroup.vue.d.ts +0 -33
  44. package/dist/components/UiCollapseNavigation/UiCollapseNavigation.vue.d.ts +0 -28
  45. package/dist/components/UiFilterButton/UiFilterButton.vue.d.ts +0 -54
  46. package/dist/components/UiIconButton/UiIconButton.vue.d.ts +0 -30
  47. package/dist/components/UiList/UiList.vue.d.ts +0 -7
  48. package/dist/components/UiMenu/UiMenuItem.vue.d.ts +0 -35
  49. package/dist/components/UiMenu/UiMenuList.vue.d.ts +0 -20
  50. package/dist/components/UiOverlay/UiOverlay.vue.d.ts +0 -18
  51. package/dist/components/UiOverlayMenu/UiOverlayMenu.vue.d.ts +0 -24
  52. package/dist/components/UiRadioInputGroup/UiRadioInputGroup.vue.d.ts +0 -35
  53. package/dist/components/UiSection/UiSection.vue.d.ts +0 -29
  54. package/dist/components/UiSectionDivider/UiSectionDivider.vue.d.ts +0 -16
  55. package/dist/components/UiTextButton/UiTextButton.vue.d.ts +0 -42
  56. package/dist/src/components/DpaMediaItem/DpaMediaItem.spec.ts +0 -123
  57. package/dist/src/components/DpaMediaItem/DpaMediaItem.stories.ts +0 -140
  58. package/dist/src/components/DpaMediaItem/DpaMediaItem.vue +0 -146
  59. package/dist/src/components/DpaMediaItem/README.md +0 -42
  60. package/dist/src/components/UiButtonGroup/README.md +0 -29
  61. package/dist/src/components/UiButtonGroup/UiButtonGroup.spec.ts +0 -16
  62. package/dist/src/components/UiButtonGroup/UiButtonGroup.stories.ts +0 -53
  63. package/dist/src/components/UiButtonGroup/UiButtonGroup.vue +0 -29
  64. package/dist/src/components/UiCard/README.md +0 -32
  65. package/dist/src/components/UiCard/UiCard.spec.ts +0 -16
  66. package/dist/src/components/UiCard/UiCard.stories.ts +0 -30
  67. package/dist/src/components/UiCard/UiCard.vue +0 -28
  68. package/dist/src/components/UiCheckBoxGroup/README.md +0 -35
  69. package/dist/src/components/UiCheckBoxGroup/UiCheckBoxGroup.spec.ts +0 -70
  70. package/dist/src/components/UiCheckBoxGroup/UiCheckBoxGroup.stories.ts +0 -59
  71. package/dist/src/components/UiCheckBoxGroup/UiCheckBoxGroup.vue +0 -106
  72. package/dist/src/components/UiCollapseNavigation/README.md +0 -37
  73. package/dist/src/components/UiCollapseNavigation/UiCollapseNavigation.spec.ts +0 -21
  74. package/dist/src/components/UiCollapseNavigation/UiCollapseNavigation.stories.ts +0 -67
  75. package/dist/src/components/UiCollapseNavigation/UiCollapseNavigation.vue +0 -79
  76. package/dist/src/components/UiFilterButton/README.md +0 -37
  77. package/dist/src/components/UiFilterButton/UiFilterButton.spec.ts +0 -79
  78. package/dist/src/components/UiFilterButton/UiFilterButton.stories.ts +0 -90
  79. package/dist/src/components/UiFilterButton/UiFilterButton.vue +0 -170
  80. package/dist/src/components/UiIconButton/README.md +0 -31
  81. package/dist/src/components/UiIconButton/UiIconButton.spec.ts +0 -78
  82. package/dist/src/components/UiIconButton/UiIconButton.stories.ts +0 -65
  83. package/dist/src/components/UiIconButton/UiIconButton.vue +0 -112
  84. package/dist/src/components/UiList/README.md +0 -31
  85. package/dist/src/components/UiList/UiList.spec.ts +0 -23
  86. package/dist/src/components/UiList/UiList.stories.ts +0 -66
  87. package/dist/src/components/UiList/UiList.vue +0 -29
  88. package/dist/src/components/UiMenu/UiMenuItem.vue +0 -71
  89. package/dist/src/components/UiMenu/UiMenuList.vue +0 -40
  90. package/dist/src/components/UiOverlay/README.md +0 -38
  91. package/dist/src/components/UiOverlay/UiOverlay.spec.ts +0 -16
  92. package/dist/src/components/UiOverlay/UiOverlay.stories.ts +0 -22
  93. package/dist/src/components/UiOverlay/UiOverlay.vue +0 -36
  94. package/dist/src/components/UiOverlayMenu/README.md +0 -40
  95. package/dist/src/components/UiOverlayMenu/UiOverlayMenu.spec.ts +0 -33
  96. package/dist/src/components/UiOverlayMenu/UiOverlayMenu.stories.ts +0 -40
  97. package/dist/src/components/UiOverlayMenu/UiOverlayMenu.vue +0 -51
  98. package/dist/src/components/UiRadioInputGroup/README.md +0 -51
  99. package/dist/src/components/UiRadioInputGroup/UiRadioInputGroup.spec.ts +0 -66
  100. package/dist/src/components/UiRadioInputGroup/UiRadioInputGroup.stories.ts +0 -45
  101. package/dist/src/components/UiRadioInputGroup/UiRadioInputGroup.vue +0 -76
  102. package/dist/src/components/UiSection/README.md +0 -33
  103. package/dist/src/components/UiSection/UiSection.spec.ts +0 -49
  104. package/dist/src/components/UiSection/UiSection.stories.ts +0 -61
  105. package/dist/src/components/UiSection/UiSection.vue +0 -63
  106. package/dist/src/components/UiSectionDivider/README.md +0 -29
  107. package/dist/src/components/UiSectionDivider/UiSectionDivider.spec.ts +0 -19
  108. package/dist/src/components/UiSectionDivider/UiSectionDivider.stories.ts +0 -49
  109. package/dist/src/components/UiSectionDivider/UiSectionDivider.vue +0 -44
  110. package/dist/src/components/UiTextButton/README.md +0 -41
  111. package/dist/src/components/UiTextButton/UiTextButton.spec.ts +0 -99
  112. package/dist/src/components/UiTextButton/UiTextButton.stories.ts +0 -62
  113. package/dist/src/components/UiTextButton/UiTextButton.vue +0 -173
  114. package/src/components/DpaMediaItem/DpaMediaItem.vue +0 -146
  115. package/src/components/DpaMediaItem/README.md +0 -42
  116. package/src/components/UiButtonGroup/README.md +0 -29
  117. package/src/components/UiButtonGroup/UiButtonGroup.vue +0 -29
  118. package/src/components/UiCard/README.md +0 -32
  119. package/src/components/UiCard/UiCard.vue +0 -28
  120. package/src/components/UiCheckBoxGroup/README.md +0 -35
  121. package/src/components/UiCheckBoxGroup/UiCheckBoxGroup.vue +0 -106
  122. package/src/components/UiCollapseNavigation/README.md +0 -37
  123. package/src/components/UiCollapseNavigation/UiCollapseNavigation.vue +0 -79
  124. package/src/components/UiFilterButton/README.md +0 -37
  125. package/src/components/UiFilterButton/UiFilterButton.vue +0 -170
  126. package/src/components/UiIconButton/README.md +0 -31
  127. package/src/components/UiIconButton/UiIconButton.vue +0 -112
  128. package/src/components/UiList/README.md +0 -31
  129. package/src/components/UiList/UiList.vue +0 -29
  130. package/src/components/UiMenu/UiMenuItem.vue +0 -71
  131. package/src/components/UiMenu/UiMenuList.vue +0 -40
  132. package/src/components/UiOverlay/README.md +0 -38
  133. package/src/components/UiOverlay/UiOverlay.vue +0 -36
  134. package/src/components/UiOverlayMenu/README.md +0 -40
  135. package/src/components/UiOverlayMenu/UiOverlayMenu.vue +0 -51
  136. package/src/components/UiRadioInputGroup/README.md +0 -51
  137. package/src/components/UiRadioInputGroup/UiRadioInputGroup.vue +0 -76
  138. package/src/components/UiSection/README.md +0 -33
  139. package/src/components/UiSection/UiSection.vue +0 -63
  140. package/src/components/UiSectionDivider/README.md +0 -29
  141. package/src/components/UiSectionDivider/UiSectionDivider.vue +0 -44
  142. package/src/components/UiTextButton/README.md +0 -41
  143. package/src/components/UiTextButton/UiTextButton.vue +0 -173
@@ -1,146 +0,0 @@
1
- <template>
2
- <div
3
- class="mb-px w-full bg-neutral pt-2 pr-4 pb-3 pl-3 md:pt-3"
4
- :class="classObject"
5
- data-testid="rootDiv"
6
- >
7
- <div
8
- class="flex"
9
- :class="{
10
- 'flex-col-reverse': $slots.timePublished,
11
- 'flex-col': !$slots.timePublished,
12
- 'px-1': isFulfilled,
13
- }"
14
- >
15
- <!-- Meta description -->
16
- <div class="flex items-center justify-between py-1">
17
- <div class="flex items-center pr-2">
18
- <UiIcon
19
- size="sm"
20
- :name="genreIcon"
21
- class="mr-2 shrink-0 fill-current text-neutral-subtle"
22
- />
23
- <span class="text-xs font-medium text-neutral-primary">
24
- <slot name="description" />
25
- </span>
26
- </div>
27
- <span
28
- v-if="$slots.planning"
29
- class="w-16 shrink-0 text-right text-xs text-neutral-subtle"
30
- ><slot name="planning"
31
- /></span>
32
- </div>
33
-
34
- <div class="flex flex-col">
35
- <!-- Image and headline -->
36
- <div v-if="imgSrc || $slots.default" class="flex py-1">
37
- <div v-if="imgSrc" class="relative mr-2 flex-none">
38
- <img
39
- :src="imgSrc"
40
- class="h-14 object-cover"
41
- :alt="`Thumbnail${imgAlt ? ` :${imgAlt}` : ''}`"
42
- />
43
- <span
44
- v-if="imgCount > 1"
45
- class="absolute right-1 bottom-1 inline-block h-4 rounded-full bg-neutral-primary px-1 align-middle text-xs/4 font-semibold text-neutral"
46
- data-testid="imageCount"
47
- >{{ imgCount }}</span
48
- >
49
- </div>
50
- <h3
51
- v-if="$slots.default"
52
- class="text-sm/5 font-medium group-hover:underline"
53
- :class="{
54
- 'ml-6': !isFulfilled,
55
- 'mr-1': $slots.planning,
56
- 'pr-16': $slots.planning,
57
- }"
58
- >
59
- <slot />
60
- </h3>
61
- </div>
62
-
63
- <!-- Text length -->
64
- <span
65
- v-if="$slots.textLength"
66
- class="text-xs text-neutral-subtle"
67
- :class="!isFulfilled ? 'ml-6' : ''"
68
- ><slot name="textLength"
69
- /></span>
70
- </div>
71
-
72
- <!-- Time published -->
73
- <span
74
- v-if="$slots.timePublished"
75
- class="pt-1 text-xs font-medium text-neutral-subtle"
76
- ><slot name="timePublished"
77
- /></span>
78
- </div>
79
- </div>
80
- </template>
81
- <script lang="ts">
82
- /**
83
- * @deprecated
84
- * Please replace with your own component
85
- */
86
- export default {
87
- name: "DpaMediaItem",
88
- };
89
- </script>
90
- <script setup lang="ts">
91
- import { computed, onMounted } from "vue";
92
-
93
- import UiIcon, { type UiIconName } from "../UiIcon/UiIcon.vue";
94
-
95
- type Genre = "audio" | "video" | "text" | "picture" | "graphic";
96
-
97
- const props = withDefaults(
98
- defineProps<{
99
- genre?: Genre;
100
- isFulfilled?: boolean;
101
- imgSrc?: string;
102
- imgAlt?: string;
103
- imgCount?: number;
104
- disabled?: boolean;
105
- }>(),
106
- {
107
- genre: "text",
108
- isFulfilled: false,
109
- imgSrc: "",
110
- imgAlt: "",
111
- imgCount: 0,
112
- disabled: false,
113
- },
114
- );
115
-
116
- const genreIcon = computed<UiIconName>(() => {
117
- const icons: Record<Genre, UiIconName> = {
118
- audio: props.isFulfilled ? "audio" : "audio",
119
- video: props.isFulfilled ? "video" : "video",
120
- text: props.isFulfilled ? "text" : "text",
121
- picture: props.isFulfilled ? "picture" : "picture",
122
- graphic: props.isFulfilled ? "graphic" : "graphic",
123
- };
124
-
125
- return icons[props.genre];
126
- });
127
-
128
- const classObject = computed(() => {
129
- const { isFulfilled } = props;
130
- if (!isFulfilled) {
131
- return "cursor-auto";
132
- }
133
- return props.disabled
134
- ? "cursor-not-allowed transition shadow-sm border border-neutral-faint"
135
- : "cursor-pointer transition shadow-sm hover:shadow-md group border border-neutral-faint hover:border-neutral-muted";
136
- });
137
-
138
- onMounted(() => {
139
- if (window.location.origin.includes("local")) {
140
- // eslint-disable-next-line no-console
141
- console.warn(
142
- "Component is deprecated. It will be removed in a future update.",
143
- );
144
- }
145
- });
146
- </script>
@@ -1,42 +0,0 @@
1
- # @deprecated
2
- Component will be removed in a future update
3
- # @dpa-shared-components/dpa-media-item
4
-
5
-
6
- ## Usage
7
-
8
- ```html
9
- <!-- SomeComponent.vue using DpaMediaItem -->
10
- <template>
11
- <dpa-media-item genre="text" is-fulfilled auto-size style="cursor: pointer;">
12
- <template #timePublished>15.11.2021 16:41</template>
13
- <tempate #description>News Feature im Basisdienst</tempate>
14
- <span>BKA-Chef: Cannabis bleibt beliebteste Droge in Deutschland</span>
15
- <template #textLength>104 dpa-Zeilen / 7176 Zeichen</template>
16
- </dpa-media-item>
17
- </template>
18
-
19
- <script setup>
20
- import DpaMediaItem from "@dpa-id-components/dpa-shared-components";
21
- </script>
22
- ```
23
-
24
- ## API
25
-
26
- ### Props
27
- | Name | Type | Default | Description |
28
- |---------------|--------------------------------------------------------------------------|----------|------------------------------------------------------------------------------------|
29
- | `genre` | `"audio" &#124; "video" &#124; "text" &#124; "picture" &#124; "graphic"` | `"text"` | Genre variant; either `"text"`, `"picture"` , `"graphic"`, `"video"` or `"audio"` |
30
- | `isFulfilled` | `Boolean` | `false` | Whether the media item has been fulfilled/delivered (`true`), or planned (`false`) |
31
- | `imgSrc` | `String` | `""` | The `src` attribute of the `img` tag used for the thumbnail of pictures |
32
- | `imgAlt` | `String` | `""` | The `alt` attribute of the `img` tag used for the thumbnail of pictures |
33
- | `imgCount` | `Number` | `0` | The number of pictures published in this media coverage item |
34
- | `disabled` | `Boolean` | `false` | Sets the cursor and hover state of the DpaMediaItem |
35
- ### Slots
36
- | Name | Description |
37
- |-----------------|-------------------------------------------------------------------------------------------------|
38
- | `default` | slot for the media item's headline/title |
39
- | `timePublished` | slot for the media item's time of publishing for fulfilled items |
40
- | `description` | slot for the media item's description placed above the headline |
41
- | `planning` | slot for the media item's planning notes (e.g. schedule) placed to the right of the description |
42
- | `textLength` | slot for the media item's text length (e.g. schedule) placed below the description/headline |
@@ -1,29 +0,0 @@
1
- # @dpa-shared-components/UiButtonGroup
2
-
3
- ## Usage
4
- A container component for groups of `UiButton` components.
5
-
6
-
7
- ```html
8
- <!-- SomeComponent.vue using UiButtonGroup -->
9
- <template>
10
- <UiButton
11
- >
12
- Click
13
- </UiButton>
14
- <UiButton
15
- >
16
- me
17
- </UiButton>
18
- </template>
19
-
20
- <script setup lang="ts">
21
- import {UiButton, UiButtonGroup} from "@dpa-id-components/dpa-shared-components";
22
- </script>
23
- ```
24
-
25
- ### Slots
26
-
27
- | Name | Description |
28
- |-----------|---------------------------------------------|
29
- | `default` | slot for the contain the button groups's content (either `UiButton` or `UiRadioButton`) |
@@ -1,29 +0,0 @@
1
- <template>
2
- <div
3
- class="flex *:rounded-none *:border *:border-r-0 *:border-neutral-faint [&>*:first-child]:rounded-l-full [&>*:last-child]:rounded-r-full [&>*:last-child]:border-r"
4
- >
5
- <slot />
6
- </div>
7
- </template>
8
-
9
- <script lang="ts">
10
- import { onMounted } from "vue";
11
-
12
- /**
13
- * @deprecated
14
- * Please replace with your own component
15
- */
16
- export default {
17
- name: "UiMenuList",
18
- setup() {
19
- onMounted(() => {
20
- if (window.location.origin.includes("local")) {
21
- // eslint-disable-next-line no-console
22
- console.warn(
23
- "Component is deprecated. It will be removed in a future update.",
24
- );
25
- }
26
- });
27
- },
28
- };
29
- </script>
@@ -1,32 +0,0 @@
1
- # @deprecated
2
- Component will be removed in a future update
3
- # @dpa-shared-components/UiCard
4
-
5
- ## Usage
6
-
7
- ```html
8
- <!-- SomeComponent.vue using UiCard -->
9
- <template>
10
- <UiCard>Autor: Max Mustermann (Berlin), +49 30 1234-56478, max.mustermann@dpa.com</UiCard>
11
- </template>
12
-
13
- <script setup lang="ts">
14
- import { UiCard } from "@dpa-id-components/dpa-shared-components";
15
- </script>
16
- ```
17
-
18
- ## API
19
-
20
- ### Props
21
-
22
- This component has no properties
23
-
24
- ### Events
25
-
26
- This component emits no events
27
-
28
- ### Slots
29
-
30
- | Name | Description |
31
- |-----------|--------------------------------------------|
32
- | `default` | Slot for the rendering the cards's content |
@@ -1,28 +0,0 @@
1
- <template>
2
- <li
3
- class="mb-4 rounded-2xl bg-neutral-whisper px-8 py-4 text-sm font-medium sm:w-full md:mr-7 md:w-[45.5%] lg:mr-8 lg:w-[46.5%]"
4
- >
5
- <slot></slot>
6
- </li>
7
- </template>
8
- <script lang="ts">
9
- import { onMounted } from "vue";
10
-
11
- /**
12
- * @deprecated
13
- * Please replace with your own component
14
- */
15
- export default {
16
- name: "UiCard",
17
- setup() {
18
- onMounted(() => {
19
- if (window.location.origin.includes("local")) {
20
- // eslint-disable-next-line no-console
21
- console.warn(
22
- "Component is deprecated. It will be removed in a future update.",
23
- );
24
- }
25
- });
26
- },
27
- };
28
- </script>
@@ -1,35 +0,0 @@
1
- # @deprecated
2
- Component will be removed in a future update
3
- # @dpa-shared-components/UiCheckBoxGroup
4
-
5
- ## Usage
6
-
7
- ```html
8
- <!-- SomeComponent.vue using UiCheckBoxGroup -->
9
-
10
- <template>
11
- <UiCheckBoxGroup :item="checkboxes" :first-entry-checks-all="true" @item-checked="handleEvent"
12
- @checked-all="handleEvent" />
13
- </template>
14
-
15
- <script setup lang="ts">
16
- import { UiCheckBoxGroup } from "@dpa-id-components/dpa-shared-components";
17
- </script>
18
-
19
- ```
20
- ### Props
21
-
22
- The "CheckboxItem"-Type is used. Consisting of "name", "isChecked" and "iconName"
23
-
24
- | Name | Type | Default | Description |
25
- |-----------------------|----------------|---------|--------------------------------------------------------------------------------------------------|
26
- | `item` | `CheckboxItem` | `` | Adds the value to the checkbox, consiting of name, isChecked and iconName ("CheckboxItem"-Type) |
27
- | `firstEntryChecksAll` | `Boolean` | `false` | Wether the first item checks all the boxes |
28
-
29
- ### Events
30
-
31
- | Name | Type | Description |
32
- |----------------|------|----------------------------------------------|
33
- | `checked-all` | `boolean` | Emitted when all items are selected |
34
- | `input` | `CheckboxItem[]` | |
35
- | `item-checked` | `CheckboxItem` | Emitted when each individual item is checked |
@@ -1,106 +0,0 @@
1
- <template>
2
- <UiList class="grid grid-cols-2 flex-wrap border-none pt-2 lg:flex lg:pt-0">
3
- <UiListItem
4
- v-for="(entry, index) in checkboxItems"
5
- :key="entry.name"
6
- :is-checked="entry.isChecked"
7
- class="flex h-8 items-center border-none py-2 text-sm shadow-none lg:py-3"
8
- check-box-menu
9
- :disabled="disabled"
10
- :icon-name="entry.iconName"
11
- @list-item-click="toggle(index)"
12
- >{{ entry.name }}
13
- </UiListItem>
14
- </UiList>
15
- </template>
16
- <script lang="ts">
17
- /**
18
- * @deprecated
19
- * Please replace with your own component
20
- */
21
- export default {
22
- name: "UiCheckBoxGroup",
23
- };
24
-
25
- export type CheckboxItem = {
26
- name: string;
27
- isChecked: boolean;
28
- iconName?: UiIconName;
29
- };
30
- </script>
31
- <script setup lang="ts">
32
- import { computed, onMounted, ref, watchEffect } from "vue";
33
-
34
- import type { UiIconName } from "../UiIcon/UiIcon.vue";
35
- import UiList from "../UiList/UiList.vue";
36
- import UiListItem from "../UiListItem/UiListItem.vue";
37
-
38
- const emit = defineEmits<{
39
- "checked-all": [boolean];
40
- input: [CheckboxItem[]];
41
- "item-checked": [CheckboxItem];
42
- }>();
43
-
44
- const props = withDefaults(
45
- defineProps<{
46
- item?: CheckboxItem[];
47
- firstEntryChecksAll?: boolean;
48
- disabled?: boolean;
49
- }>(),
50
- {
51
- item: () => [],
52
- firstEntryChecksAll: false,
53
- disabled: false,
54
- },
55
- );
56
-
57
- const checkboxItems = ref<CheckboxItem[]>(props.item);
58
-
59
- watchEffect(() => {
60
- checkboxItems.value = props.item;
61
- });
62
-
63
- const areAllChecked = computed(() => {
64
- const checkboxEntries = checkboxItems.value.slice(1);
65
- return checkboxEntries.every((entry: CheckboxItem) => entry.isChecked);
66
- });
67
-
68
- const toggleAll = () => {
69
- checkboxItems.value = checkboxItems.value.map((entry: CheckboxItem) => {
70
- const isChecked = !checkboxItems.value[0].isChecked;
71
- return {
72
- ...entry,
73
- isChecked,
74
- };
75
- });
76
- emit("checked-all", checkboxItems.value[0].isChecked);
77
- emit("input", checkboxItems.value);
78
- };
79
-
80
- const toggle = (index: number) => {
81
- // With List Item Click we are overriding the normal checkbox `input` event, hence the disabled attribute has no effect
82
- if (props.disabled) {
83
- return;
84
- }
85
- if (index === 0 && props.firstEntryChecksAll) {
86
- toggleAll();
87
- } else {
88
- checkboxItems.value[index].isChecked =
89
- !checkboxItems.value[index].isChecked;
90
- if (props.firstEntryChecksAll) {
91
- checkboxItems.value[0].isChecked = areAllChecked.value;
92
- }
93
- }
94
- emit("item-checked", checkboxItems.value[index]);
95
- emit("input", checkboxItems.value);
96
- };
97
-
98
- onMounted(() => {
99
- if (window.location.origin.includes("local")) {
100
- // eslint-disable-next-line no-console
101
- console.warn(
102
- "Component is deprecated. It will be removed in a future update.",
103
- );
104
- }
105
- });
106
- </script>
@@ -1,37 +0,0 @@
1
- # @deprecated
2
- Component will be removed in a future update
3
- # @dpa-shared-components/UiCollapseNavigation
4
-
5
- ## Usage
6
-
7
- ```html
8
- <!-- SomeComponent.vue using UiCollapseNavigation -->
9
- <template>
10
- <UiCollapseNavigation headline="Menu eins">
11
- <UiButton> test eins </UiButton>
12
- <UiButton> test zwei </UiButton>
13
- <UiButton> test drei </UiButton>
14
- </UiCollapseNavigation>
15
- </template>
16
-
17
- <script>
18
- import UiCollapseNavigation from "./UiCollapseNavigation.vue";
19
- </script>
20
- ```
21
-
22
- ## API
23
-
24
- ### Props
25
-
26
- | Name | Type | Default | Description |
27
- |-----------------|---------|---------|-----------------------------------|
28
- | `headline` | string | '' | Headline of the menu |
29
- | `borderTop` | boolean | true | Has top border |
30
- | `openAsDefault` | boolean | true | defines default state of the menu |
31
-
32
-
33
- ### Slots
34
-
35
- | Name | Description |
36
- |-----------|----------------------------|
37
- | `default` | slot for the menus content |
@@ -1,79 +0,0 @@
1
- <template>
2
- <div :class="hasBorderTop ? 'border-t border-t-neutral-faint' : ''" />
3
- <UiButton
4
- appearance="outline-emphasis"
5
- class="flex w-full justify-between border-none"
6
- @click="toggleMenuHandler"
7
- >
8
- <h3
9
- class="text-xs font-semibold tracking-widest text-neutral-subtle uppercase"
10
- >
11
- {{ headline }}
12
- </h3>
13
- <UiIcon
14
- name="chevron-down"
15
- class="rounded-full text-neutral-subtle transition-transform duration-500 hover:bg-neutral-faint"
16
- :class="{ 'rotate-180': openMenu }"
17
- />
18
- </UiButton>
19
- <transition
20
- enter-active-class="duration-200"
21
- enter-from-class="transform -translate-y-[20px] opacity-0"
22
- enter-to-class="transform translate-y-0 opacity-1"
23
- leave-active-class="duration-200"
24
- leave-from-class="transform translate-y-0 opacity-1"
25
- leave-to-class="transform -translate-y-[20px] opacity-0"
26
- >
27
- <div v-if="openMenu">
28
- <slot />
29
- </div>
30
- </transition>
31
- </template>
32
- <script lang="ts">
33
- /**
34
- * @deprecated
35
- * Please replace with your own component
36
- */
37
- export default {
38
- name: "UiCollapseNavigation",
39
- };
40
- </script>
41
- <script setup lang="ts">
42
- import { onMounted, ref, watchEffect } from "vue";
43
-
44
- import UiButton from "../UiButton/UiButton.vue";
45
- import UiIcon from "../UiIcon/UiIcon.vue";
46
-
47
- const props = withDefaults(
48
- defineProps<{
49
- headline?: string;
50
- hasBorderTop?: boolean;
51
- openAsDefault?: boolean;
52
- }>(),
53
- {
54
- headline: "",
55
- hasBorderTop: true,
56
- openAsDefault: true,
57
- },
58
- );
59
-
60
- const openMenu = ref();
61
-
62
- watchEffect(() => {
63
- openMenu.value = props.openAsDefault;
64
- });
65
-
66
- const toggleMenuHandler = () => {
67
- openMenu.value = !openMenu.value;
68
- };
69
-
70
- onMounted(() => {
71
- if (window.location.origin.includes("local")) {
72
- // eslint-disable-next-line no-console
73
- console.warn(
74
- "Component is deprecated. It will be removed in a future update.",
75
- );
76
- }
77
- });
78
- defineExpose({ openMenu });
79
- </script>
@@ -1,37 +0,0 @@
1
- # @deprecated
2
- Component will be removed in a future update
3
- # @dpa-shared-components/UiFilterButton
4
-
5
- ## Usage
6
-
7
- ```html
8
- <!-- SomeComponent.vue using UiFilterBadge -->
9
- <template>
10
- <UiFilterButton title="Filter" @click="doSomething" />
11
- </template>
12
-
13
- <script>
14
- import { UiFilterButton } from "@dpa-id-components/dpa-shared-components";
15
- </script>
16
- ```
17
-
18
- ## API
19
-
20
- ### Props
21
-
22
- | Name | Type | Default | Description |
23
- |---------------|-------------------------------------------------------------------------------------|-------------------|---------------------------------------------------------------------------------------|
24
- | `title` | `String` | `` | Sets the label of the Button. |
25
- | `variant` | `"white-rounded" &#124; "blue-rounded" &#124; "transparent-rounded" &#124; "blank"` | `"white-rounded"` | Visual variants of the button |
26
- | `chevronIcon` | `UiIconName` | `"chevron-down"` | If the Icon should change when the Component is in dirty state put in Icon name here. |
27
- | `iconLeft` | `UiIconName` | null | If you want an icon left of the title put in icon name here. |
28
- | `rotateIcon` | `Boolean` | `false` | Rotates the icon. |
29
- | `iconSize` | `"small" &#124; "medium" &#124; "large"` | `"small"` | Icon size. |
30
- | `disabled` | `Boolean` | `false` | Disables the button. |
31
- | `active` | `Boolean` | `false` | Sets active style for the button. |
32
-
33
- ### Events
34
-
35
- | Name | Type | Description |
36
- |---------|---------|-------------|
37
- | `click` | none | |