@dpa-id-components/dpa-shared-components 23.1.0 → 23.1.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.
- package/package.json +7 -7
- package/src/components/UiBadge/README.md +0 -15
- package/src/components/UiBadge/UiBadge.vue +14 -0
- package/src/components/UiButton/README.md +3 -18
- package/src/components/UiButton/UiButton.vue +13 -0
- package/src/components/UiCheckbox/README.md +2 -24
- package/src/components/UiCheckbox/UiCheckbox.vue +11 -0
- package/src/components/UiChip/README.md +0 -21
- package/src/components/UiChip/UiChip.vue +13 -0
- package/src/components/UiColorPicker/README.md +1 -15
- package/src/components/UiColorPicker/UiColorPicker.vue +4 -0
- package/src/components/UiDatePicker/README.md +5 -57
- package/src/components/UiDatePicker/UiDatePicker.vue +117 -0
- package/src/components/UiDialog/README.md +2 -27
- package/src/components/UiDialog/UiDialog.vue +32 -0
- package/src/components/UiFilterBadge/README.md +2 -17
- package/src/components/UiFilterBadge/UiFilterBadge.vue +23 -0
- package/src/components/UiIcon/README.md +2 -18
- package/src/components/UiIcon/UiIcon.vue +10 -0
- package/src/components/UiInfoContent/README.md +2 -17
- package/src/components/UiInfoContent/UiInfoContent.vue +22 -0
- package/src/components/UiInput/README.md +4 -32
- package/src/components/UiInput/UiInput.vue +25 -1
- package/src/components/UiLabel/README.md +2 -2
- package/src/components/UiListItem/README.md +0 -30
- package/src/components/UiListItem/UiListItem.vue +56 -0
- package/src/components/UiMediaTypeIcon/README.md +1 -10
- package/src/components/UiMediaTypeIcon/UiMediaTypeIcon.vue +7 -0
- package/src/components/UiMenu/README.md +4 -51
- package/src/components/UiMenu/UiMenu.vue +112 -0
- package/src/components/UiPopover/README.md +1 -34
- package/src/components/UiPopover/UiPopover.vue +20 -1
- package/src/components/UiRadioButton/README.md +1 -23
- package/src/components/UiRadioButton/UiRadioButton.vue +11 -0
- package/src/components/UiSearchBar/README.md +0 -29
- package/src/components/UiSearchBar/UiSearchBar.vue +42 -0
- package/src/components/UiSearchInput/README.md +1 -23
- package/src/components/UiSearchInput/UiSearchInput.vue +31 -0
- package/src/components/UiSelect/README.md +2 -28
- package/src/components/UiSelect/UiSelect.vue +7 -1
- package/src/components/UiSkeletonBox/README.md +0 -14
- package/src/components/UiSkeletonBox/UiSkeletonBox.vue +12 -0
- package/src/components/UiSnackbar/README.md +0 -26
- package/src/components/UiSnackbar/UiSnackbar.vue +38 -0
- package/src/components/UiSpinner/README.md +0 -14
- package/src/components/UiSpinner/UiSpinner.vue +9 -0
- package/src/components/UiTShirtSizeIcon/README.md +1 -1
- package/src/components/UiToggleButton/README.md +0 -26
- package/src/components/UiToggleButton/UiToggleButton.vue +16 -0
- package/src/components/UiTooltip/README.md +1 -26
- package/src/components/UiTooltip/UiTooltip.vue +32 -0
|
@@ -57,14 +57,26 @@ import UiIcon from "../UiIcon/UiIcon.vue";
|
|
|
57
57
|
const dialog = useTemplateRef<HTMLDialogElement>("dialog");
|
|
58
58
|
|
|
59
59
|
defineSlots<{
|
|
60
|
+
/**
|
|
61
|
+
* The dialog header content, shown above the main content. Receives as
|
|
62
|
+
* slot props the `close` and `requestClose` functions.
|
|
63
|
+
*/
|
|
60
64
|
header?: (props: {
|
|
61
65
|
close: typeof close;
|
|
62
66
|
requestClose: typeof requestClose;
|
|
63
67
|
}) => any;
|
|
68
|
+
/**
|
|
69
|
+
* The dialog's main content. Receives as slot props the `close` and
|
|
70
|
+
* `requestClose` functions.
|
|
71
|
+
*/
|
|
64
72
|
default?: (props: {
|
|
65
73
|
close: typeof close;
|
|
66
74
|
requestClose: typeof requestClose;
|
|
67
75
|
}) => any;
|
|
76
|
+
/**
|
|
77
|
+
* The dialog footer content, shown below the main content. Receives as
|
|
78
|
+
* slot props the `close` and `requestClose` functions.
|
|
79
|
+
*/
|
|
68
80
|
footer?: (props: {
|
|
69
81
|
close: typeof close;
|
|
70
82
|
requestClose: typeof requestClose;
|
|
@@ -76,8 +88,19 @@ const {
|
|
|
76
88
|
closeLabel = undefined,
|
|
77
89
|
animate = false,
|
|
78
90
|
} = defineProps<{
|
|
91
|
+
/**
|
|
92
|
+
* Whether to show the close button in the dialog header.
|
|
93
|
+
* @default true
|
|
94
|
+
*/
|
|
79
95
|
hasCloseButton?: boolean;
|
|
96
|
+
/**
|
|
97
|
+
* Accessible label (`aria-label`) for the close button.
|
|
98
|
+
*/
|
|
80
99
|
closeLabel?: string;
|
|
100
|
+
/**
|
|
101
|
+
* Whether to animate the opening and closing of the dialog.
|
|
102
|
+
* @default false
|
|
103
|
+
*/
|
|
81
104
|
animate?: boolean;
|
|
82
105
|
}>();
|
|
83
106
|
|
|
@@ -94,8 +117,17 @@ function showModal() {
|
|
|
94
117
|
}
|
|
95
118
|
|
|
96
119
|
defineExpose({
|
|
120
|
+
/**
|
|
121
|
+
* Exposes the native `showModal()` function of the underlying `<dialog>` element.
|
|
122
|
+
*/
|
|
97
123
|
showModal,
|
|
124
|
+
/**
|
|
125
|
+
* Exposes the native `close()` function of the underlying `<dialog>` element.
|
|
126
|
+
*/
|
|
98
127
|
close,
|
|
128
|
+
/**
|
|
129
|
+
* Exposes the native `requestClose()` function of the underlying `<dialog>` element.
|
|
130
|
+
*/
|
|
99
131
|
requestClose,
|
|
100
132
|
});
|
|
101
133
|
</script>
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
# @dpa-shared-components/UiFilterBadge
|
|
2
2
|
|
|
3
|
+
Displays a saved-search icon next to a piece of text, typically used to label active filters.
|
|
4
|
+
|
|
3
5
|
## Usage
|
|
4
6
|
|
|
5
7
|
```html
|
|
@@ -12,20 +14,3 @@
|
|
|
12
14
|
import {UiFilterBadge} from "@dpa-id-components/dpa-shared-components";
|
|
13
15
|
</script>
|
|
14
16
|
```
|
|
15
|
-
|
|
16
|
-
## API
|
|
17
|
-
|
|
18
|
-
### Props
|
|
19
|
-
|
|
20
|
-
| Name | Type | Default | Description |
|
|
21
|
-
|----------------|--------------------------------------------------|---------|--------------------------------------------------|
|
|
22
|
-
| `textColor` | `string` | `#000` | Sets the color of the text. |
|
|
23
|
-
| `iconColor` | `string` | `#333` | Sets the color of the icon. |
|
|
24
|
-
| `iconIsFilled` | `boolean` | `true` | If true, renders the filled version of the icon. |
|
|
25
|
-
| `size` | `"sm"`, `"md"`, `"lg"`, or `"xl"` | `"lg"` | Determines the font size and weight. |
|
|
26
|
-
|
|
27
|
-
### Slots
|
|
28
|
-
|
|
29
|
-
| Name | Description |
|
|
30
|
-
|-----------|--------------------------------------------|
|
|
31
|
-
| `default` | slot for the rendering the badge's content |
|
|
@@ -35,11 +35,34 @@ const {
|
|
|
35
35
|
iconIsFilled = true,
|
|
36
36
|
size = "lg",
|
|
37
37
|
} = defineProps<{
|
|
38
|
+
/**
|
|
39
|
+
* Sets the color of the text.
|
|
40
|
+
* @default "#000"
|
|
41
|
+
*/
|
|
38
42
|
textColor?: string;
|
|
43
|
+
/**
|
|
44
|
+
* Sets the color of the icon.
|
|
45
|
+
* @default "#333"
|
|
46
|
+
*/
|
|
39
47
|
iconColor?: string;
|
|
48
|
+
/**
|
|
49
|
+
* If true, renders the filled version of the icon.
|
|
50
|
+
* @default true
|
|
51
|
+
*/
|
|
40
52
|
iconIsFilled?: boolean;
|
|
53
|
+
/**
|
|
54
|
+
* Determines the font size and weight.
|
|
55
|
+
* @default "lg"
|
|
56
|
+
*/
|
|
41
57
|
size?: keyof typeof FILTER_BADGE_SIZES;
|
|
42
58
|
}>();
|
|
43
59
|
|
|
60
|
+
defineSlots<{
|
|
61
|
+
/**
|
|
62
|
+
* Slot for rendering the badge's content.
|
|
63
|
+
*/
|
|
64
|
+
default: () => any;
|
|
65
|
+
}>();
|
|
66
|
+
|
|
44
67
|
const textSizeClass = computed(() => FILTER_BADGE_SIZES[size]);
|
|
45
68
|
</script>
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
# @dpa-shared-components/UiIcon
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Renders an SVG icon by name. The icon's color is inherited from the current text color.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
## Usage
|
|
6
6
|
|
|
7
7
|
```html
|
|
8
8
|
<!-- SomeComponent.vue using UiIcon -->
|
|
@@ -14,19 +14,3 @@ Color is set by text color:
|
|
|
14
14
|
import {UiIcon} from "@dpa-id-components/dpa-shared-components";
|
|
15
15
|
</script>
|
|
16
16
|
```
|
|
17
|
-
|
|
18
|
-
## API
|
|
19
|
-
|
|
20
|
-
### Props
|
|
21
|
-
|
|
22
|
-
| Name | Type | Default | Description |
|
|
23
|
-
|---------------|-------------------------------------------------------------------------------|----------|------------------------------------------------------|
|
|
24
|
-
| `name` | `UiIconName` | required | Sets the `name`, which determines which svg is used. |
|
|
25
|
-
| `size` | `"xs" | "small" | "medium" | "large" | "xl" | "2xl"` | `large` | Sets the `size` attribute of the icon. |
|
|
26
|
-
| `sizeClasses` | `string` | `''` | Overwrites the size classes of the size prop. |
|
|
27
|
-
|
|
28
|
-
### Slots
|
|
29
|
-
|
|
30
|
-
| Name | Description |
|
|
31
|
-
|-----------|--------------------------------------------|
|
|
32
|
-
| `default` | slot for the rendering the badge's content |
|
|
@@ -32,8 +32,18 @@ const {
|
|
|
32
32
|
size = "lg",
|
|
33
33
|
sizeClasses = undefined,
|
|
34
34
|
} = defineProps<{
|
|
35
|
+
/**
|
|
36
|
+
* Sets the `name`, which determines which svg is used.
|
|
37
|
+
*/
|
|
35
38
|
name: UiIconName;
|
|
39
|
+
/**
|
|
40
|
+
* Sets the size of the icon.
|
|
41
|
+
* @default "lg"
|
|
42
|
+
*/
|
|
36
43
|
size?: keyof typeof ICON_SIZES;
|
|
44
|
+
/**
|
|
45
|
+
* Overwrites the size classes of the size prop.
|
|
46
|
+
*/
|
|
37
47
|
sizeClasses?: string;
|
|
38
48
|
}>();
|
|
39
49
|
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
# @dpa-id-components/ui-info-content
|
|
2
2
|
|
|
3
|
+
Displays an icon, a title, some content, and optional actions, typically used to communicate an empty or informational state.
|
|
4
|
+
|
|
3
5
|
## Usage
|
|
4
6
|
|
|
5
7
|
```html
|
|
@@ -23,20 +25,3 @@
|
|
|
23
25
|
import UiInfoContent from "@dpa-id-components/ui-info-content";
|
|
24
26
|
</script>
|
|
25
27
|
```
|
|
26
|
-
|
|
27
|
-
## API
|
|
28
|
-
|
|
29
|
-
## Props
|
|
30
|
-
|
|
31
|
-
| Name | Description |
|
|
32
|
-
|---------------|------------------------------------------------------------------------------------------------|
|
|
33
|
-
| `iconName` | icon to be displayed |
|
|
34
|
-
| `appearance` | Visual appearance of the component. One of `"default"`, `"default-alt"`, `"success"`. Defaults to `"default"`. |
|
|
35
|
-
|
|
36
|
-
### Slots
|
|
37
|
-
|
|
38
|
-
| Name | Description |
|
|
39
|
-
|-----------|-------------------------------------------|
|
|
40
|
-
| `title` | Optional slot for title elements |
|
|
41
|
-
| `default` | Optional slot for content elements |
|
|
42
|
-
| `actions` | Optional slot for action related elements |
|
|
@@ -62,9 +62,31 @@ const APPEARANCE_MAP = {
|
|
|
62
62
|
};
|
|
63
63
|
|
|
64
64
|
const { appearance = "default", iconName = undefined } = defineProps<{
|
|
65
|
+
/**
|
|
66
|
+
* Visual appearance of the component.
|
|
67
|
+
* @default "default"
|
|
68
|
+
*/
|
|
65
69
|
appearance?: keyof typeof APPEARANCE_MAP;
|
|
70
|
+
/**
|
|
71
|
+
* Icon to be displayed.
|
|
72
|
+
*/
|
|
66
73
|
iconName?: UiIconName;
|
|
67
74
|
}>();
|
|
68
75
|
|
|
76
|
+
defineSlots<{
|
|
77
|
+
/**
|
|
78
|
+
* Optional slot for title elements.
|
|
79
|
+
*/
|
|
80
|
+
title?: () => any;
|
|
81
|
+
/**
|
|
82
|
+
* Optional slot for content elements.
|
|
83
|
+
*/
|
|
84
|
+
default?: () => any;
|
|
85
|
+
/**
|
|
86
|
+
* Optional slot for action related elements.
|
|
87
|
+
*/
|
|
88
|
+
actions?: () => any;
|
|
89
|
+
}>();
|
|
90
|
+
|
|
69
91
|
const classes = computed(() => APPEARANCE_MAP[appearance]);
|
|
70
92
|
</script>
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
## Usage
|
|
4
4
|
|
|
5
|
-
```
|
|
5
|
+
```html
|
|
6
6
|
<UiInput
|
|
7
7
|
id="postal-code"
|
|
8
8
|
name="postal_code"
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
|
|
17
17
|
**Using `v-model`**:
|
|
18
18
|
|
|
19
|
-
```
|
|
19
|
+
```html
|
|
20
20
|
<UiInput v-model="postalCode">
|
|
21
21
|
Postal code
|
|
22
22
|
</UiInput>
|
|
@@ -24,38 +24,10 @@
|
|
|
24
24
|
|
|
25
25
|
**With `number` value**:
|
|
26
26
|
|
|
27
|
-
```
|
|
27
|
+
```html
|
|
28
28
|
<UiInput v-model="count" type="number">
|
|
29
29
|
Count
|
|
30
30
|
</UiInput>
|
|
31
31
|
```
|
|
32
32
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
### Models
|
|
36
|
-
|
|
37
|
-
| Name | Type | Default | Description |
|
|
38
|
-
|-----------|--------------------|-------------|----------------------|
|
|
39
|
-
| _default_ | `string \| number` | `undefined` | Sets the input value |
|
|
40
|
-
|
|
41
|
-
### Props
|
|
42
|
-
|
|
43
|
-
**Note**: This component binds all non-prop attributes (apart from `class`) on its principal element (either an `input` or `textarea` element) instead of the root element. This allows you to add arbitrary HTML attributes (and event listeners) on the principal element without them being explicitly supported by the component.
|
|
44
|
-
|
|
45
|
-
| Name | Type | Default | Description |
|
|
46
|
-
|--------------------|-----------------------------------------------------------------------------|------------|-------------------------------------------------------------------------------------|
|
|
47
|
-
| `type` | `HTMLInputElement` type | `text` | Sets the `type` attribute of the input |
|
|
48
|
-
| `label` | `string` | `""` | The displayed and aria label of the input |
|
|
49
|
-
| `errorMessage` | `string` | `""` | Error message to be displayed underneath the input |
|
|
50
|
-
| `warningMessage` | `string` | `""` | Warning message to be displayed underneath the input |
|
|
51
|
-
| `infoText` | `string` | `""` | Info message to be displayed underneath the input |
|
|
52
|
-
| `isTextarea` | `boolean` | `false` | Input gets rendered as textarea |
|
|
53
|
-
| `inputStatus` | `"info"`, `"warning"`, `"error"` | `"default` | The status the input is styled for |
|
|
54
|
-
|
|
55
|
-
### Slots
|
|
56
|
-
|
|
57
|
-
| Name | Description |
|
|
58
|
-
|-----------|----------------------------------------------------|
|
|
59
|
-
| `buttons` | Render extra content like a “Reveal password” button |
|
|
60
|
-
| `default` | Label content |
|
|
61
|
-
| `errors` | Validation error content that's associated with the form control via `aria-errormessage` |
|
|
33
|
+
This component binds all non-prop attributes (apart from `class`) on its principal element (either an `input` or `textarea` element) instead of the root element. This allows you to add arbitrary HTML attributes (and event listeners) on the principal element without them being explicitly supported by the component.
|
|
@@ -98,9 +98,13 @@ defineSlots<{
|
|
|
98
98
|
*/
|
|
99
99
|
default?: () => any;
|
|
100
100
|
/**
|
|
101
|
-
* Extra content.
|
|
101
|
+
* Extra content shown underneath the input, e.g. an error, warning or info
|
|
102
|
+
* message. Associated with the input via `aria-errormessage`.
|
|
102
103
|
*/
|
|
103
104
|
extra?: () => any;
|
|
105
|
+
/**
|
|
106
|
+
* Extra content rendered inside the input, e.g. a "Reveal password" button.
|
|
107
|
+
*/
|
|
104
108
|
buttons?: () => any;
|
|
105
109
|
}>();
|
|
106
110
|
|
|
@@ -111,7 +115,14 @@ const {
|
|
|
111
115
|
isTextarea = false,
|
|
112
116
|
inputStatus = undefined,
|
|
113
117
|
} = defineProps<{
|
|
118
|
+
/**
|
|
119
|
+
* The `id` attribute of the input element. Auto-generated when not set.
|
|
120
|
+
*/
|
|
114
121
|
id?: string;
|
|
122
|
+
/**
|
|
123
|
+
* Sets the `type` attribute of the input.
|
|
124
|
+
* @default "text"
|
|
125
|
+
*/
|
|
115
126
|
type?:
|
|
116
127
|
| "date"
|
|
117
128
|
| "datetime-local"
|
|
@@ -125,11 +136,24 @@ const {
|
|
|
125
136
|
| "url"
|
|
126
137
|
// Allows arbitrary strings while still offering autocompletion on the explicitly listed strings.
|
|
127
138
|
| (string & {});
|
|
139
|
+
/**
|
|
140
|
+
* The displayed and aria label of the input.
|
|
141
|
+
*/
|
|
128
142
|
label?: string;
|
|
143
|
+
/**
|
|
144
|
+
* Renders the input as a `textarea` instead of an `input` element.
|
|
145
|
+
* @default false
|
|
146
|
+
*/
|
|
129
147
|
isTextarea?: boolean;
|
|
148
|
+
/**
|
|
149
|
+
* The status the input is styled for.
|
|
150
|
+
*/
|
|
130
151
|
inputStatus?: "info" | "warning" | "error";
|
|
131
152
|
}>();
|
|
132
153
|
|
|
154
|
+
/**
|
|
155
|
+
* The input's value.
|
|
156
|
+
*/
|
|
133
157
|
const model = defineModel<ModelValue>();
|
|
134
158
|
|
|
135
159
|
const hasInput = computed(
|
|
@@ -6,7 +6,7 @@ Wraps the native `label` element. Currently only used to provide some default st
|
|
|
6
6
|
|
|
7
7
|
**Associate with input via `id` attribute**:
|
|
8
8
|
|
|
9
|
-
```
|
|
9
|
+
```html
|
|
10
10
|
<UiLabel for="name-input">
|
|
11
11
|
Name
|
|
12
12
|
</UiLabel>
|
|
@@ -16,7 +16,7 @@ Wraps the native `label` element. Currently only used to provide some default st
|
|
|
16
16
|
|
|
17
17
|
**Associate with input by wrapping**:
|
|
18
18
|
|
|
19
|
-
```
|
|
19
|
+
```html
|
|
20
20
|
<UiLabel>
|
|
21
21
|
Name
|
|
22
22
|
<UiInput name="name" required />
|
|
@@ -14,33 +14,3 @@
|
|
|
14
14
|
import {UiListItem} from "@dpa-id-components/dpa-shared-components";
|
|
15
15
|
</script>
|
|
16
16
|
```
|
|
17
|
-
|
|
18
|
-
## API
|
|
19
|
-
|
|
20
|
-
### Props
|
|
21
|
-
|
|
22
|
-
| Name | Type | Default | Description |
|
|
23
|
-
|-------------------|-----------------------------|------------|---------------------------------------------------------------------|
|
|
24
|
-
| `value` | `string` | `""` | Sets the value which gets emitted with the click event |
|
|
25
|
-
| `checkBoxMenu` | `Boolean` | `false` | Displays checkbox on the beginning of list item |
|
|
26
|
-
| `isChecked` | `Boolean` | `false` | Checked attribute of checkbox, if displayed |
|
|
27
|
-
| `selectable` | `Boolean` | `false` | Makes the list item selectable |
|
|
28
|
-
| `selected` | `Boolean` | `false` | Displays checkmark at the end of the list item |
|
|
29
|
-
| `overrideClasses` | `String` | `false` | Adds classes to the inner of the list item |
|
|
30
|
-
| `iconName` | `UiIconName` | | Icon to be displayed at the beginning of the list item |
|
|
31
|
-
| `iconSize` | `sm` `md` `lg` | | Size of the checkmark icon when selected and selectable is set true |
|
|
32
|
-
| `imageSrc` | `String` | `""` | Image to be displayed at the beginning of the list item. |
|
|
33
|
-
| `imageShape` | `"rounded" | "square"` | `"square"` | Shape pf the image to be displayed. |
|
|
34
|
-
| `checkboxColor` | `"blue" | "gray"` | `"blue"` | Checkbox color style. |
|
|
35
|
-
|
|
36
|
-
### Events
|
|
37
|
-
|
|
38
|
-
| Name | Type | Description |
|
|
39
|
-
|-------------------|----------|---------------------------------------|
|
|
40
|
-
| `list-item-click` | `string` | Emitted when the list item is clicked |
|
|
41
|
-
|
|
42
|
-
### Slots
|
|
43
|
-
|
|
44
|
-
| Name | Description |
|
|
45
|
-
|-----------|-------------------------------------------------|
|
|
46
|
-
| `default` | slot for the rendering the list items's content |
|
|
@@ -69,21 +69,77 @@ const {
|
|
|
69
69
|
isChecked = false,
|
|
70
70
|
disabled = false,
|
|
71
71
|
} = defineProps<{
|
|
72
|
+
/**
|
|
73
|
+
* Sets the value which gets emitted with the click event.
|
|
74
|
+
* @default ""
|
|
75
|
+
*/
|
|
72
76
|
value?: string;
|
|
77
|
+
/**
|
|
78
|
+
* Displays a checkbox at the beginning of the list item.
|
|
79
|
+
* @default false
|
|
80
|
+
*/
|
|
73
81
|
checkBoxMenu?: boolean;
|
|
82
|
+
/**
|
|
83
|
+
* Displays a checkmark at the end of the list item.
|
|
84
|
+
* @default false
|
|
85
|
+
*/
|
|
74
86
|
selected?: boolean;
|
|
87
|
+
/**
|
|
88
|
+
* Makes the list item selectable.
|
|
89
|
+
* @default false
|
|
90
|
+
*/
|
|
75
91
|
selectable?: boolean;
|
|
92
|
+
/**
|
|
93
|
+
* Adds classes to the inner element of the list item.
|
|
94
|
+
*/
|
|
76
95
|
overrideClasses?: string;
|
|
96
|
+
/**
|
|
97
|
+
* Icon to be displayed at the beginning of the list item.
|
|
98
|
+
*/
|
|
77
99
|
iconName?: UiIconName;
|
|
100
|
+
/**
|
|
101
|
+
* Image to be displayed at the beginning of the list item.
|
|
102
|
+
*/
|
|
78
103
|
imageSrc?: string;
|
|
104
|
+
/**
|
|
105
|
+
* Shape of the image to be displayed.
|
|
106
|
+
* @default "rounded"
|
|
107
|
+
*/
|
|
79
108
|
imageShape?: "rounded" | "square";
|
|
109
|
+
/**
|
|
110
|
+
* Size of the checkmark icon shown when `selected` and `selectable` are
|
|
111
|
+
* both set to `true`.
|
|
112
|
+
* @default "md"
|
|
113
|
+
*/
|
|
80
114
|
iconSize?: "sm" | "md" | "lg";
|
|
115
|
+
/**
|
|
116
|
+
* Color appearance of the checkbox, if displayed.
|
|
117
|
+
* @default "primary"
|
|
118
|
+
*/
|
|
81
119
|
checkboxAppearance?: "primary" | "secondary";
|
|
120
|
+
/**
|
|
121
|
+
* Checked state of the checkbox, if displayed.
|
|
122
|
+
* @default false
|
|
123
|
+
*/
|
|
82
124
|
isChecked?: boolean;
|
|
125
|
+
/**
|
|
126
|
+
* Disables the list item, preventing interaction and applying disabled styling.
|
|
127
|
+
* @default false
|
|
128
|
+
*/
|
|
83
129
|
disabled?: boolean;
|
|
84
130
|
}>();
|
|
85
131
|
|
|
132
|
+
defineSlots<{
|
|
133
|
+
/**
|
|
134
|
+
* Slot for rendering the list item's content.
|
|
135
|
+
*/
|
|
136
|
+
default: () => any;
|
|
137
|
+
}>();
|
|
138
|
+
|
|
86
139
|
defineEmits<{
|
|
140
|
+
/**
|
|
141
|
+
* Emitted when the list item is clicked.
|
|
142
|
+
*/
|
|
87
143
|
"list-item-click": [value: string];
|
|
88
144
|
}>();
|
|
89
145
|
</script>
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
## Usage
|
|
4
4
|
|
|
5
|
-
```
|
|
5
|
+
```html
|
|
6
6
|
<template>
|
|
7
7
|
<UiMediaTypeIcon name="alert" />
|
|
8
8
|
</template>
|
|
@@ -11,12 +11,3 @@
|
|
|
11
11
|
import { UiMediaTypeIcon } from "@dpa-id-components/dpa-shared-components";
|
|
12
12
|
</script>
|
|
13
13
|
```
|
|
14
|
-
|
|
15
|
-
## API
|
|
16
|
-
|
|
17
|
-
### Props
|
|
18
|
-
|
|
19
|
-
| Name | Type | Default | Description |
|
|
20
|
-
|--------|------|---------|-------------|
|
|
21
|
-
| `name` | `UiMediaTypeIconName` | | Icon name |
|
|
22
|
-
| `size` | `"xs"`, `"sm"`, `"md"`, `"lg"`, `"xl"`, or `"2xl"` | `"lg"` | Icon size |
|
|
@@ -26,7 +26,14 @@ import { icons } from "./icons.ts";
|
|
|
26
26
|
import UiMediaTypeIconLoading from "./UiMediaTypeIconLoading.vue";
|
|
27
27
|
|
|
28
28
|
const { name, size = "lg" } = defineProps<{
|
|
29
|
+
/**
|
|
30
|
+
* The name of the media type icon to display.
|
|
31
|
+
*/
|
|
29
32
|
name: UiMediaTypeIconName;
|
|
33
|
+
/**
|
|
34
|
+
* The size of the icon.
|
|
35
|
+
* @default "lg"
|
|
36
|
+
*/
|
|
30
37
|
size?: "xs" | "sm" | "md" | "lg" | "xl" | "2xl";
|
|
31
38
|
}>();
|
|
32
39
|
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
# @dpa-shared-components/UiMenu
|
|
2
2
|
|
|
3
|
+
A button that opens a popover menu of selectable options. Supports a flat list via the `options` prop or a grouped list (with optional group labels) via the `groupedOptions` prop — these are mutually exclusive. Optionally includes a search input (`hasSearch`) to filter options and a reset button (`hasResetOption`). The menu can animate its open/close transition via the `animate` prop; the transition duration can be customized by applying `placed-list-class="[--transition-duration:3000ms]"` for animating in and `placed-list-class="[--transition-close-duration:2000ms]"` for animating out.
|
|
4
|
+
|
|
3
5
|
## Usage
|
|
4
6
|
|
|
5
|
-
```
|
|
7
|
+
```html
|
|
6
8
|
<template>
|
|
7
9
|
<UiMenu :options="options" />
|
|
8
10
|
</template>
|
|
@@ -33,7 +35,7 @@ const options = ref([
|
|
|
33
35
|
|
|
34
36
|
**With search**:
|
|
35
37
|
|
|
36
|
-
```
|
|
38
|
+
```html
|
|
37
39
|
<template>
|
|
38
40
|
<UiMenu
|
|
39
41
|
v-model:query="query"
|
|
@@ -68,55 +70,6 @@ const options = ref([
|
|
|
68
70
|
</script>
|
|
69
71
|
```
|
|
70
72
|
|
|
71
|
-
## API
|
|
72
|
-
|
|
73
|
-
### Models
|
|
74
|
-
|
|
75
|
-
| Name | Type | Default | Description |
|
|
76
|
-
|--------|----------|---------|----------------------|
|
|
77
|
-
| `query`| `string` | `""` | Search `input` value |
|
|
78
|
-
|
|
79
|
-
### Props
|
|
80
|
-
|
|
81
|
-
| Name | Type | Default | Description |
|
|
82
|
-
|------------------------|-----------------------------------------------------------------------------------------------------------------|-------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
|
83
|
-
| `options` | `UiMenuOptionType<Value>[]` | required (un-grouped variant) | Array of options for selection. |
|
|
84
|
-
| `groupedOptions` | `UiMenuGroupedOption<Value>[];` | required (grouped variant) | Array of grouped options for selection. |
|
|
85
|
-
| `defaultTitle` | `string` | `""` | Default title to display when nothing is selected. |
|
|
86
|
-
| `isOpen` | `boolean` | `false` | Whether the menu is initially open. |
|
|
87
|
-
| `disabled` | `boolean` | `false` | Disables the button to open selection. |
|
|
88
|
-
| `active` | `boolean` | `false` | Sets active style to indicate an active filter selection. |
|
|
89
|
-
| `buttonAppearance` | `"primary"`, `"secondary"`, `"secondary-alt"`, or `"ghost"` | `"secondary-alt"` | |
|
|
90
|
-
| `listVariant` | `"checkbox" | "selectable" | "blank"` | `"blank"` | Menu style. |
|
|
91
|
-
| `checkboxColor` | `"blue" | "gray"` | `"blue"` | Checkbox color style. |
|
|
92
|
-
| `imageShape` | `"rounded" | "square"` | `"square"` | shape of image. |
|
|
93
|
-
| `hasResetOption` | `boolean` | `false` | Toggles option for a reset button |
|
|
94
|
-
| `resetLabel` | `string` | `""` | Sets text of reset button. |
|
|
95
|
-
| `searchPlaceholder` | `string` | `""` | Sets text of search input placeholder. |
|
|
96
|
-
| `hasSearch` | `boolean` | `false` | Toggles option for a search input. |
|
|
97
|
-
| `hasAutoFocus` | `boolean` | `false` | Toggles autofocus of input in searchfield. |
|
|
98
|
-
| `iconLeft` | `UiIconName` | `null` | Adds Icon to left side of the text. |
|
|
99
|
-
| `noTitle` | `boolean` | `false` | Enabled prop displays dropdown without a title. |
|
|
100
|
-
| `floatingStylesActive` | `boolean` | `true` | prop to disable styles from floating-ui. |
|
|
101
|
-
| `floatingUiPlacement` | `Placement` | `bottom-start` | Options for [Floating Ui](https://floating-ui.com/) [Interface](https://github.com/floating-ui/floating-ui/blob/afca34cc59321569ccfca9b41934859809c47a3d/packages/utils/src/index.ts#L8) |
|
|
102
|
-
| `animate` | `boolean` | `false` | Animate the opening and closing of the menu, the duration can be changed when applying `placed-list-class="[--transition-duration:3000ms]"` for animating in and `placed-list-class="[-transition-close-duration:2000ms]"` for animating out |
|
|
103
|
-
|
|
104
|
-
### Events
|
|
105
|
-
|
|
106
|
-
| Name | Type | Description |
|
|
107
|
-
|-------------------|----------|-------------------------------------------------------------|
|
|
108
|
-
| `open` | none | |
|
|
109
|
-
| `close` | none | |
|
|
110
|
-
| `option-selected` | `UiMenuSelectedOption<Value>` | |
|
|
111
|
-
| `reset` | none | Emitted when reset button is clicked |
|
|
112
|
-
|
|
113
|
-
### Slots
|
|
114
|
-
|
|
115
|
-
| Name | Description |
|
|
116
|
-
|-----------|----------------------------------------------------------|
|
|
117
|
-
| `default` | Slot within positioned div to build custom menu contents |
|
|
118
|
-
|
|
119
|
-
|
|
120
73
|
## SubComponents
|
|
121
74
|
### UiMenuList
|
|
122
75
|
A wrapper component for the opened Menu
|