@synergy-design-system/vue 2.7.1 → 2.7.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/dist/components/SynVueAccordion.vue.d.ts +12 -12
- package/dist/components/SynVueAlert.vue.d.ts +13 -9
- package/dist/components/SynVueBadge.vue.d.ts +4 -4
- package/dist/components/SynVueBreadcrumbItem.vue.d.ts +12 -12
- package/dist/components/SynVueButton.vue.d.ts +62 -59
- package/dist/components/SynVueCard.vue.d.ts +8 -8
- package/dist/components/SynVueCheckbox.vue.d.ts +40 -35
- package/dist/components/SynVueDetails.vue.d.ts +23 -19
- package/dist/components/SynVueDialog.vue.d.ts +7 -1
- package/dist/components/SynVueDivider.vue.d.ts +4 -4
- package/dist/components/SynVueDrawer.vue.d.ts +11 -5
- package/dist/components/SynVueDropdown.vue.d.ts +21 -17
- package/dist/components/SynVueFile.vue.d.ts +40 -35
- package/dist/components/SynVueHeader.vue.d.ts +10 -7
- package/dist/components/SynVueIcon.vue.d.ts +13 -11
- package/dist/components/SynVueIconButton.vue.d.ts +37 -35
- package/dist/components/SynVueInput.vue.d.ts +115 -109
- package/dist/components/SynVueMenu.vue.d.ts +2 -1
- package/dist/components/SynVueMenuItem.vue.d.ts +24 -24
- package/dist/components/SynVueNavItem.vue.d.ts +13 -9
- package/dist/components/SynVueOptgroup.vue.d.ts +10 -10
- package/dist/components/SynVueOption.vue.d.ts +4 -4
- package/dist/components/SynVuePopup.vue.d.ts +34 -33
- package/dist/components/SynVueProgressBar.vue.d.ts +12 -12
- package/dist/components/SynVueProgressRing.vue.d.ts +8 -8
- package/dist/components/SynVueRadio.vue.d.ts +13 -11
- package/dist/components/SynVueRadioButton.vue.d.ts +17 -15
- package/dist/components/SynVueRadioGroup.vue.d.ts +32 -29
- package/dist/components/SynVueRange.vue.d.ts +57 -51
- package/dist/components/SynVueRangeTick.vue.d.ts +4 -4
- package/dist/components/SynVueSelect.vue.d.ts +55 -45
- package/dist/components/SynVueSideNav.vue.d.ts +5 -1
- package/dist/components/SynVueSwitch.vue.d.ts +40 -35
- package/dist/components/SynVueTab.vue.d.ts +20 -19
- package/dist/components/SynVueTabGroup.vue.d.ts +21 -19
- package/dist/components/SynVueTabPanel.vue.d.ts +8 -8
- package/dist/components/SynVueTag.vue.d.ts +10 -9
- package/dist/components/SynVueTextarea.vue.d.ts +86 -81
- package/dist/components/SynVueTooltip.vue.d.ts +29 -25
- package/package.json +2 -2
- package/src/components/SynVueAccordion.vue +16 -21
- package/src/components/SynVueAlert.vue +29 -29
- package/src/components/SynVueBadge.vue +10 -15
- package/src/components/SynVueBreadcrumb.vue +8 -13
- package/src/components/SynVueBreadcrumbItem.vue +16 -21
- package/src/components/SynVueButton.vue +66 -67
- package/src/components/SynVueButtonGroup.vue +8 -13
- package/src/components/SynVueCard.vue +12 -17
- package/src/components/SynVueCheckbox.vue +64 -53
- package/src/components/SynVueDetails.vue +35 -35
- package/src/components/SynVueDialog.vue +33 -31
- package/src/components/SynVueDivider.vue +9 -14
- package/src/components/SynVueDrawer.vue +37 -35
- package/src/components/SynVueDropdown.vue +37 -37
- package/src/components/SynVueFile.vue +69 -58
- package/src/components/SynVueHeader.vue +23 -24
- package/src/components/SynVueIcon.vue +26 -25
- package/src/components/SynVueIconButton.vue +42 -41
- package/src/components/SynVueInput.vue +123 -111
- package/src/components/SynVueMenu.vue +6 -9
- package/src/components/SynVueMenuItem.vue +24 -29
- package/src/components/SynVueMenuLabel.vue +2 -6
- package/src/components/SynVueNavItem.vue +32 -32
- package/src/components/SynVueOptgroup.vue +14 -19
- package/src/components/SynVueOption.vue +11 -16
- package/src/components/SynVuePopup.vue +51 -52
- package/src/components/SynVuePrioNav.vue +2 -6
- package/src/components/SynVueProgressBar.vue +16 -21
- package/src/components/SynVueProgressRing.vue +13 -18
- package/src/components/SynVueRadio.vue +23 -23
- package/src/components/SynVueRadioButton.vue +26 -26
- package/src/components/SynVueRadioGroup.vue +52 -43
- package/src/components/SynVueRange.vue +77 -65
- package/src/components/SynVueRangeTick.vue +10 -15
- package/src/components/SynVueSelect.vue +90 -74
- package/src/components/SynVueSideNav.vue +24 -24
- package/src/components/SynVueSpinner.vue +1 -5
- package/src/components/SynVueSwitch.vue +63 -52
- package/src/components/SynVueTab.vue +25 -26
- package/src/components/SynVueTabGroup.vue +31 -31
- package/src/components/SynVueTabPanel.vue +13 -18
- package/src/components/SynVueTag.vue +18 -19
- package/src/components/SynVueTextarea.vue +99 -88
- package/src/components/SynVueTooltip.vue +41 -41
|
@@ -35,9 +35,11 @@
|
|
|
35
35
|
import { computed, ref } from 'vue';
|
|
36
36
|
import '@synergy-design-system/components/components/details/details.js';
|
|
37
37
|
|
|
38
|
-
import type {
|
|
39
|
-
|
|
40
|
-
} from '@synergy-design-system/components';
|
|
38
|
+
import type { SynShowEvent } from '@synergy-design-system/components';
|
|
39
|
+
import type { SynAfterShowEvent } from '@synergy-design-system/components';
|
|
40
|
+
import type { SynHideEvent } from '@synergy-design-system/components';
|
|
41
|
+
import type { SynAfterHideEvent } from '@synergy-design-system/components';
|
|
42
|
+
import type { SynDetails } from '@synergy-design-system/components';
|
|
41
43
|
|
|
42
44
|
// DOM Reference to the element
|
|
43
45
|
const nativeElement = ref<SynDetails>();
|
|
@@ -53,60 +55,60 @@ const props = defineProps<{
|
|
|
53
55
|
* You can toggle this attribute to show and hide the details, or you
|
|
54
56
|
can use the `show()` and `hide()` methods and this attribute will reflect the details' open state.
|
|
55
57
|
*/
|
|
56
|
-
|
|
58
|
+
open?: SynDetails['open'];
|
|
57
59
|
|
|
58
60
|
/**
|
|
59
|
-
* The summary to show in the header.
|
|
60
|
-
* If you need to display HTML, use the `summary` slot instead.
|
|
61
|
-
|
|
62
|
-
|
|
61
|
+
* The summary to show in the header.
|
|
62
|
+
* If you need to display HTML, use the `summary` slot instead.
|
|
63
|
+
*/
|
|
64
|
+
summary?: SynDetails['summary'];
|
|
63
65
|
|
|
64
66
|
/**
|
|
65
|
-
* Disables the details so it can't be toggled.
|
|
66
|
-
|
|
67
|
-
|
|
67
|
+
* Disables the details so it can't be toggled.
|
|
68
|
+
*/
|
|
69
|
+
disabled?: SynDetails['disabled'];
|
|
68
70
|
|
|
69
71
|
/**
|
|
70
|
-
* Draws the details as contained element.
|
|
71
|
-
|
|
72
|
-
|
|
72
|
+
* Draws the details as contained element.
|
|
73
|
+
*/
|
|
74
|
+
contained?: SynDetails['contained'];
|
|
73
75
|
|
|
74
76
|
/**
|
|
75
|
-
* The details's size.
|
|
76
|
-
|
|
77
|
-
|
|
77
|
+
* The details's size.
|
|
78
|
+
*/
|
|
79
|
+
size?: SynDetails['size'];
|
|
78
80
|
}>();
|
|
79
81
|
|
|
80
82
|
// Make sure prop binding only forwards the props that are actually there.
|
|
81
83
|
// This is needed because :param="param" also adds an empty attribute
|
|
82
84
|
// when using web-components, which breaks optional arguments like size in SynInput
|
|
83
85
|
// @see https://github.com/vuejs/core/issues/5190#issuecomment-1003112498
|
|
84
|
-
const visibleProps = computed(() =>
|
|
85
|
-
Object
|
|
86
|
-
.entries(props)
|
|
87
|
-
|
|
88
|
-
)
|
|
86
|
+
const visibleProps = computed(() =>
|
|
87
|
+
Object.fromEntries(
|
|
88
|
+
Object.entries(props).filter(([, value]) => typeof value !== 'undefined'),
|
|
89
|
+
),
|
|
90
|
+
);
|
|
89
91
|
|
|
90
92
|
// Map events
|
|
91
93
|
defineEmits<{
|
|
92
94
|
/**
|
|
93
|
-
* Emitted when the details opens.
|
|
94
|
-
|
|
95
|
+
* Emitted when the details opens.
|
|
96
|
+
*/
|
|
95
97
|
'syn-show': [e: SynShowEvent];
|
|
96
98
|
|
|
97
99
|
/**
|
|
98
|
-
* Emitted after the details opens and all animations are complete.
|
|
99
|
-
|
|
100
|
+
* Emitted after the details opens and all animations are complete.
|
|
101
|
+
*/
|
|
100
102
|
'syn-after-show': [e: SynAfterShowEvent];
|
|
101
103
|
|
|
102
104
|
/**
|
|
103
|
-
* Emitted when the details closes.
|
|
104
|
-
|
|
105
|
+
* Emitted when the details closes.
|
|
106
|
+
*/
|
|
105
107
|
'syn-hide': [e: SynHideEvent];
|
|
106
108
|
|
|
107
109
|
/**
|
|
108
|
-
* Emitted after the details closes and all animations are complete.
|
|
109
|
-
|
|
110
|
+
* Emitted after the details closes and all animations are complete.
|
|
111
|
+
*/
|
|
110
112
|
'syn-after-hide': [e: SynAfterHideEvent];
|
|
111
113
|
}>();
|
|
112
114
|
</script>
|
|
@@ -120,14 +122,12 @@ export type { SynAfterHideEvent } from '@synergy-design-system/components';
|
|
|
120
122
|
|
|
121
123
|
<template>
|
|
122
124
|
<syn-details
|
|
123
|
-
v-bind="visibleProps"
|
|
124
|
-
ref="nativeElement"
|
|
125
125
|
@syn-show="$emit('syn-show', $event)"
|
|
126
126
|
@syn-after-show="$emit('syn-after-show', $event)"
|
|
127
|
-
|
|
128
127
|
@syn-hide="$emit('syn-hide', $event)"
|
|
129
128
|
@syn-after-hide="$emit('syn-after-hide', $event)"
|
|
130
|
-
|
|
131
|
-
|
|
129
|
+
v-bind="visibleProps"
|
|
130
|
+
ref="nativeElement">
|
|
131
|
+
<slot></slot>
|
|
132
132
|
</syn-details>
|
|
133
133
|
</template>
|
|
@@ -58,9 +58,13 @@
|
|
|
58
58
|
import { computed, ref } from 'vue';
|
|
59
59
|
import '@synergy-design-system/components/components/dialog/dialog.js';
|
|
60
60
|
|
|
61
|
-
import type {
|
|
62
|
-
|
|
63
|
-
} from '@synergy-design-system/components';
|
|
61
|
+
import type { SynShowEvent } from '@synergy-design-system/components';
|
|
62
|
+
import type { SynAfterShowEvent } from '@synergy-design-system/components';
|
|
63
|
+
import type { SynHideEvent } from '@synergy-design-system/components';
|
|
64
|
+
import type { SynAfterHideEvent } from '@synergy-design-system/components';
|
|
65
|
+
import type { SynInitialFocusEvent } from '@synergy-design-system/components';
|
|
66
|
+
import type { SynRequestCloseEvent } from '@synergy-design-system/components';
|
|
67
|
+
import type { SynDialog } from '@synergy-design-system/components';
|
|
64
68
|
|
|
65
69
|
// DOM Reference to the element
|
|
66
70
|
const nativeElement = ref<SynDialog>();
|
|
@@ -76,7 +80,7 @@ const props = defineProps<{
|
|
|
76
80
|
* You can toggle this attribute to show and hide the dialog, or you can
|
|
77
81
|
use the `show()` and `hide()` methods and this attribute will reflect the dialog's open state.
|
|
78
82
|
*/
|
|
79
|
-
|
|
83
|
+
open?: SynDialog['open'];
|
|
80
84
|
|
|
81
85
|
/**
|
|
82
86
|
* The dialog's label as displayed in the header.
|
|
@@ -84,59 +88,59 @@ use the `show()` and `hide()` methods and this attribute will reflect the dialog
|
|
|
84
88
|
`no-header`, as it is required for proper accessibility.
|
|
85
89
|
* If you need to display HTML, use the `label` slot instead.
|
|
86
90
|
*/
|
|
87
|
-
|
|
91
|
+
label?: SynDialog['label'];
|
|
88
92
|
|
|
89
93
|
/**
|
|
90
94
|
* Disables the header.
|
|
91
95
|
* This will also remove the default close button, so please ensure you provide an easy,
|
|
92
96
|
accessible way for users to dismiss the dialog.
|
|
93
97
|
*/
|
|
94
|
-
|
|
98
|
+
noHeader?: SynDialog['noHeader'];
|
|
95
99
|
}>();
|
|
96
100
|
|
|
97
101
|
// Make sure prop binding only forwards the props that are actually there.
|
|
98
102
|
// This is needed because :param="param" also adds an empty attribute
|
|
99
103
|
// when using web-components, which breaks optional arguments like size in SynInput
|
|
100
104
|
// @see https://github.com/vuejs/core/issues/5190#issuecomment-1003112498
|
|
101
|
-
const visibleProps = computed(() =>
|
|
102
|
-
Object
|
|
103
|
-
.entries(props)
|
|
104
|
-
|
|
105
|
-
)
|
|
105
|
+
const visibleProps = computed(() =>
|
|
106
|
+
Object.fromEntries(
|
|
107
|
+
Object.entries(props).filter(([, value]) => typeof value !== 'undefined'),
|
|
108
|
+
),
|
|
109
|
+
);
|
|
106
110
|
|
|
107
111
|
// Map events
|
|
108
112
|
defineEmits<{
|
|
109
113
|
/**
|
|
110
|
-
* Emitted when the dialog opens.
|
|
111
|
-
|
|
114
|
+
* Emitted when the dialog opens.
|
|
115
|
+
*/
|
|
112
116
|
'syn-show': [e: SynShowEvent];
|
|
113
117
|
|
|
114
118
|
/**
|
|
115
|
-
* Emitted after the dialog opens and all animations are complete.
|
|
116
|
-
|
|
119
|
+
* Emitted after the dialog opens and all animations are complete.
|
|
120
|
+
*/
|
|
117
121
|
'syn-after-show': [e: SynAfterShowEvent];
|
|
118
122
|
|
|
119
123
|
/**
|
|
120
|
-
* Emitted when the dialog closes.
|
|
121
|
-
|
|
124
|
+
* Emitted when the dialog closes.
|
|
125
|
+
*/
|
|
122
126
|
'syn-hide': [e: SynHideEvent];
|
|
123
127
|
|
|
124
128
|
/**
|
|
125
|
-
* Emitted after the dialog closes and all animations are complete.
|
|
126
|
-
|
|
129
|
+
* Emitted after the dialog closes and all animations are complete.
|
|
130
|
+
*/
|
|
127
131
|
'syn-after-hide': [e: SynAfterHideEvent];
|
|
128
132
|
|
|
129
133
|
/**
|
|
130
|
-
* Emitted when the dialog opens and is ready to receive focus.
|
|
131
|
-
* Calling `event.preventDefault()` will prevent focusing and allow you to set it on a different element, such as an input.
|
|
132
|
-
|
|
134
|
+
* Emitted when the dialog opens and is ready to receive focus.
|
|
135
|
+
* Calling `event.preventDefault()` will prevent focusing and allow you to set it on a different element, such as an input.
|
|
136
|
+
*/
|
|
133
137
|
'syn-initial-focus': [e: SynInitialFocusEvent];
|
|
134
138
|
|
|
135
139
|
/**
|
|
136
|
-
* Emitted when the user attempts to close the dialog by clicking the close button, clicking the overlay, or pressing escape.
|
|
137
|
-
* Calling `event.preventDefault()` will keep the dialog open.
|
|
138
|
-
* Avoid using this unless closing the dialog will result in destructive behavior such as data loss.
|
|
139
|
-
|
|
140
|
+
* Emitted when the user attempts to close the dialog by clicking the close button, clicking the overlay, or pressing escape.
|
|
141
|
+
* Calling `event.preventDefault()` will keep the dialog open.
|
|
142
|
+
* Avoid using this unless closing the dialog will result in destructive behavior such as data loss.
|
|
143
|
+
*/
|
|
140
144
|
'syn-request-close': [e: SynRequestCloseEvent];
|
|
141
145
|
}>();
|
|
142
146
|
</script>
|
|
@@ -152,16 +156,14 @@ export type { SynRequestCloseEvent } from '@synergy-design-system/components';
|
|
|
152
156
|
|
|
153
157
|
<template>
|
|
154
158
|
<syn-dialog
|
|
155
|
-
v-bind="visibleProps"
|
|
156
|
-
ref="nativeElement"
|
|
157
159
|
@syn-show="$emit('syn-show', $event)"
|
|
158
160
|
@syn-after-show="$emit('syn-after-show', $event)"
|
|
159
161
|
@syn-hide="$emit('syn-hide', $event)"
|
|
160
162
|
@syn-after-hide="$emit('syn-after-hide', $event)"
|
|
161
|
-
|
|
162
163
|
@syn-initial-focus="$emit('syn-initial-focus', $event)"
|
|
163
164
|
@syn-request-close="$emit('syn-request-close', $event)"
|
|
164
|
-
|
|
165
|
-
|
|
165
|
+
v-bind="visibleProps"
|
|
166
|
+
ref="nativeElement">
|
|
167
|
+
<slot></slot>
|
|
166
168
|
</syn-dialog>
|
|
167
169
|
</template>
|
|
@@ -30,27 +30,22 @@ defineExpose({
|
|
|
30
30
|
// Map attributes
|
|
31
31
|
const props = defineProps<{
|
|
32
32
|
/**
|
|
33
|
-
* Draws the divider in a vertical orientation.
|
|
34
|
-
|
|
35
|
-
|
|
33
|
+
* Draws the divider in a vertical orientation.
|
|
34
|
+
*/
|
|
35
|
+
vertical?: SynDivider['vertical'];
|
|
36
36
|
}>();
|
|
37
37
|
|
|
38
38
|
// Make sure prop binding only forwards the props that are actually there.
|
|
39
39
|
// This is needed because :param="param" also adds an empty attribute
|
|
40
40
|
// when using web-components, which breaks optional arguments like size in SynInput
|
|
41
41
|
// @see https://github.com/vuejs/core/issues/5190#issuecomment-1003112498
|
|
42
|
-
const visibleProps = computed(() =>
|
|
43
|
-
Object
|
|
44
|
-
.entries(props)
|
|
45
|
-
|
|
46
|
-
)
|
|
47
|
-
|
|
42
|
+
const visibleProps = computed(() =>
|
|
43
|
+
Object.fromEntries(
|
|
44
|
+
Object.entries(props).filter(([, value]) => typeof value !== 'undefined'),
|
|
45
|
+
),
|
|
46
|
+
);
|
|
48
47
|
</script>
|
|
49
48
|
|
|
50
49
|
<template>
|
|
51
|
-
<syn-divider
|
|
52
|
-
|
|
53
|
-
v-bind="visibleProps"
|
|
54
|
-
ref="nativeElement"
|
|
55
|
-
/>
|
|
50
|
+
<syn-divider v-bind="visibleProps" ref="nativeElement"> </syn-divider>
|
|
56
51
|
</template>
|
|
@@ -65,9 +65,13 @@
|
|
|
65
65
|
import { computed, ref } from 'vue';
|
|
66
66
|
import '@synergy-design-system/components/components/drawer/drawer.js';
|
|
67
67
|
|
|
68
|
-
import type {
|
|
69
|
-
|
|
70
|
-
} from '@synergy-design-system/components';
|
|
68
|
+
import type { SynShowEvent } from '@synergy-design-system/components';
|
|
69
|
+
import type { SynAfterShowEvent } from '@synergy-design-system/components';
|
|
70
|
+
import type { SynHideEvent } from '@synergy-design-system/components';
|
|
71
|
+
import type { SynAfterHideEvent } from '@synergy-design-system/components';
|
|
72
|
+
import type { SynInitialFocusEvent } from '@synergy-design-system/components';
|
|
73
|
+
import type { SynRequestCloseEvent } from '@synergy-design-system/components';
|
|
74
|
+
import type { SynDrawer } from '@synergy-design-system/components';
|
|
71
75
|
|
|
72
76
|
// DOM Reference to the element
|
|
73
77
|
const nativeElement = ref<SynDrawer>();
|
|
@@ -83,7 +87,7 @@ const props = defineProps<{
|
|
|
83
87
|
* You can toggle this attribute to show and hide the drawer, or you can
|
|
84
88
|
use the `show()` and `hide()` methods and this attribute will reflect the drawer's open state.
|
|
85
89
|
*/
|
|
86
|
-
|
|
90
|
+
open?: SynDrawer['open'];
|
|
87
91
|
|
|
88
92
|
/**
|
|
89
93
|
* The drawer's label as displayed in the header.
|
|
@@ -91,71 +95,71 @@ use the `show()` and `hide()` methods and this attribute will reflect the drawer
|
|
|
91
95
|
`no-header`, as it is required for proper accessibility.
|
|
92
96
|
* If you need to display HTML, use the `label` slot instead.
|
|
93
97
|
*/
|
|
94
|
-
|
|
98
|
+
label?: SynDrawer['label'];
|
|
95
99
|
|
|
96
100
|
/**
|
|
97
|
-
* The direction from which the drawer will open.
|
|
98
|
-
|
|
99
|
-
|
|
101
|
+
* The direction from which the drawer will open.
|
|
102
|
+
*/
|
|
103
|
+
placement?: SynDrawer['placement'];
|
|
100
104
|
|
|
101
105
|
/**
|
|
102
106
|
* By default, the drawer slides out of its containing block (usually the viewport).
|
|
103
107
|
* To make the drawer slide out of
|
|
104
108
|
its parent element, set this attribute and add `position: relative` to the parent.
|
|
105
109
|
*/
|
|
106
|
-
|
|
110
|
+
contained?: SynDrawer['contained'];
|
|
107
111
|
|
|
108
112
|
/**
|
|
109
113
|
* Removes the header.
|
|
110
114
|
* This will also remove the default close button, so please ensure you provide an easy,
|
|
111
115
|
accessible way for users to dismiss the drawer.
|
|
112
116
|
*/
|
|
113
|
-
|
|
117
|
+
noHeader?: SynDrawer['noHeader'];
|
|
114
118
|
}>();
|
|
115
119
|
|
|
116
120
|
// Make sure prop binding only forwards the props that are actually there.
|
|
117
121
|
// This is needed because :param="param" also adds an empty attribute
|
|
118
122
|
// when using web-components, which breaks optional arguments like size in SynInput
|
|
119
123
|
// @see https://github.com/vuejs/core/issues/5190#issuecomment-1003112498
|
|
120
|
-
const visibleProps = computed(() =>
|
|
121
|
-
Object
|
|
122
|
-
.entries(props)
|
|
123
|
-
|
|
124
|
-
)
|
|
124
|
+
const visibleProps = computed(() =>
|
|
125
|
+
Object.fromEntries(
|
|
126
|
+
Object.entries(props).filter(([, value]) => typeof value !== 'undefined'),
|
|
127
|
+
),
|
|
128
|
+
);
|
|
125
129
|
|
|
126
130
|
// Map events
|
|
127
131
|
defineEmits<{
|
|
128
132
|
/**
|
|
129
|
-
* Emitted when the drawer opens.
|
|
130
|
-
|
|
133
|
+
* Emitted when the drawer opens.
|
|
134
|
+
*/
|
|
131
135
|
'syn-show': [e: SynShowEvent];
|
|
132
136
|
|
|
133
137
|
/**
|
|
134
|
-
* Emitted after the drawer opens and all animations are complete.
|
|
135
|
-
|
|
138
|
+
* Emitted after the drawer opens and all animations are complete.
|
|
139
|
+
*/
|
|
136
140
|
'syn-after-show': [e: SynAfterShowEvent];
|
|
137
141
|
|
|
138
142
|
/**
|
|
139
|
-
* Emitted when the drawer closes.
|
|
140
|
-
|
|
143
|
+
* Emitted when the drawer closes.
|
|
144
|
+
*/
|
|
141
145
|
'syn-hide': [e: SynHideEvent];
|
|
142
146
|
|
|
143
147
|
/**
|
|
144
|
-
* Emitted after the drawer closes and all animations are complete.
|
|
145
|
-
|
|
148
|
+
* Emitted after the drawer closes and all animations are complete.
|
|
149
|
+
*/
|
|
146
150
|
'syn-after-hide': [e: SynAfterHideEvent];
|
|
147
151
|
|
|
148
152
|
/**
|
|
149
|
-
* Emitted when the drawer opens and is ready to receive focus.
|
|
150
|
-
* Calling `event.preventDefault()` will prevent focusing and allow you to set it on a different element, such as an input.
|
|
151
|
-
|
|
153
|
+
* Emitted when the drawer opens and is ready to receive focus.
|
|
154
|
+
* Calling `event.preventDefault()` will prevent focusing and allow you to set it on a different element, such as an input.
|
|
155
|
+
*/
|
|
152
156
|
'syn-initial-focus': [e: SynInitialFocusEvent];
|
|
153
157
|
|
|
154
158
|
/**
|
|
155
|
-
* Emitted when the user attempts to close the drawer by clicking the close button, clicking the overlay, or pressing escape.
|
|
156
|
-
* Calling `event.preventDefault()` will keep the drawer open.
|
|
157
|
-
* Avoid using this unless closing the drawer will result in destructive behavior such as data loss.
|
|
158
|
-
|
|
159
|
+
* Emitted when the user attempts to close the drawer by clicking the close button, clicking the overlay, or pressing escape.
|
|
160
|
+
* Calling `event.preventDefault()` will keep the drawer open.
|
|
161
|
+
* Avoid using this unless closing the drawer will result in destructive behavior such as data loss.
|
|
162
|
+
*/
|
|
159
163
|
'syn-request-close': [e: SynRequestCloseEvent];
|
|
160
164
|
}>();
|
|
161
165
|
</script>
|
|
@@ -171,16 +175,14 @@ export type { SynRequestCloseEvent } from '@synergy-design-system/components';
|
|
|
171
175
|
|
|
172
176
|
<template>
|
|
173
177
|
<syn-drawer
|
|
174
|
-
v-bind="visibleProps"
|
|
175
|
-
ref="nativeElement"
|
|
176
178
|
@syn-show="$emit('syn-show', $event)"
|
|
177
179
|
@syn-after-show="$emit('syn-after-show', $event)"
|
|
178
180
|
@syn-hide="$emit('syn-hide', $event)"
|
|
179
181
|
@syn-after-hide="$emit('syn-after-hide', $event)"
|
|
180
|
-
|
|
181
182
|
@syn-initial-focus="$emit('syn-initial-focus', $event)"
|
|
182
183
|
@syn-request-close="$emit('syn-request-close', $event)"
|
|
183
|
-
|
|
184
|
-
|
|
184
|
+
v-bind="visibleProps"
|
|
185
|
+
ref="nativeElement">
|
|
186
|
+
<slot></slot>
|
|
185
187
|
</syn-drawer>
|
|
186
188
|
</template>
|
|
@@ -32,9 +32,11 @@
|
|
|
32
32
|
import { computed, ref } from 'vue';
|
|
33
33
|
import '@synergy-design-system/components/components/dropdown/dropdown.js';
|
|
34
34
|
|
|
35
|
-
import type {
|
|
36
|
-
|
|
37
|
-
} from '@synergy-design-system/components';
|
|
35
|
+
import type { SynShowEvent } from '@synergy-design-system/components';
|
|
36
|
+
import type { SynAfterShowEvent } from '@synergy-design-system/components';
|
|
37
|
+
import type { SynHideEvent } from '@synergy-design-system/components';
|
|
38
|
+
import type { SynAfterHideEvent } from '@synergy-design-system/components';
|
|
39
|
+
import type { SynDropdown } from '@synergy-design-system/components';
|
|
38
40
|
|
|
39
41
|
// DOM Reference to the element
|
|
40
42
|
const nativeElement = ref<SynDropdown>();
|
|
@@ -50,19 +52,19 @@ const props = defineProps<{
|
|
|
50
52
|
* You can toggle this attribute to show and hide the dropdown, or you
|
|
51
53
|
can use the `show()` and `hide()` methods and this attribute will reflect the dropdown's open state.
|
|
52
54
|
*/
|
|
53
|
-
|
|
55
|
+
open?: SynDropdown['open'];
|
|
54
56
|
|
|
55
57
|
/**
|
|
56
58
|
* The preferred placement of the dropdown panel.
|
|
57
59
|
* Note that the actual placement may vary as needed to keep the panel
|
|
58
60
|
inside of the viewport.
|
|
59
61
|
*/
|
|
60
|
-
|
|
62
|
+
placement?: SynDropdown['placement'];
|
|
61
63
|
|
|
62
64
|
/**
|
|
63
|
-
* Disables the dropdown so the panel will not open.
|
|
64
|
-
|
|
65
|
-
|
|
65
|
+
* Disables the dropdown so the panel will not open.
|
|
66
|
+
*/
|
|
67
|
+
disabled?: SynDropdown['disabled'];
|
|
66
68
|
|
|
67
69
|
/**
|
|
68
70
|
* By default, the dropdown is closed when an item is selected.
|
|
@@ -70,61 +72,61 @@ inside of the viewport.
|
|
|
70
72
|
* Useful for
|
|
71
73
|
dropdowns that allow for multiple interactions.
|
|
72
74
|
*/
|
|
73
|
-
|
|
75
|
+
stayOpenOnSelect?: SynDropdown['stayOpenOnSelect'];
|
|
74
76
|
|
|
75
77
|
/**
|
|
76
|
-
* The distance in pixels from which to offset the panel away from its trigger.
|
|
77
|
-
|
|
78
|
-
|
|
78
|
+
* The distance in pixels from which to offset the panel away from its trigger.
|
|
79
|
+
*/
|
|
80
|
+
distance?: SynDropdown['distance'];
|
|
79
81
|
|
|
80
82
|
/**
|
|
81
|
-
* The distance in pixels from which to offset the panel along its trigger.
|
|
82
|
-
|
|
83
|
-
|
|
83
|
+
* The distance in pixels from which to offset the panel along its trigger.
|
|
84
|
+
*/
|
|
85
|
+
skidding?: SynDropdown['skidding'];
|
|
84
86
|
|
|
85
87
|
/**
|
|
86
88
|
* Enable this option to prevent the panel from being clipped when the component is placed inside a container with
|
|
87
89
|
`overflow: auto|scroll`.
|
|
88
90
|
* Hoisting uses a fixed positioning strategy that works in many, but not all, scenarios.
|
|
89
91
|
*/
|
|
90
|
-
|
|
92
|
+
hoist?: SynDropdown['hoist'];
|
|
91
93
|
|
|
92
94
|
/**
|
|
93
|
-
* Syncs the popup width or height to that of the trigger element.
|
|
94
|
-
|
|
95
|
-
|
|
95
|
+
* Syncs the popup width or height to that of the trigger element.
|
|
96
|
+
*/
|
|
97
|
+
sync?: SynDropdown['sync'];
|
|
96
98
|
}>();
|
|
97
99
|
|
|
98
100
|
// Make sure prop binding only forwards the props that are actually there.
|
|
99
101
|
// This is needed because :param="param" also adds an empty attribute
|
|
100
102
|
// when using web-components, which breaks optional arguments like size in SynInput
|
|
101
103
|
// @see https://github.com/vuejs/core/issues/5190#issuecomment-1003112498
|
|
102
|
-
const visibleProps = computed(() =>
|
|
103
|
-
Object
|
|
104
|
-
.entries(props)
|
|
105
|
-
|
|
106
|
-
)
|
|
104
|
+
const visibleProps = computed(() =>
|
|
105
|
+
Object.fromEntries(
|
|
106
|
+
Object.entries(props).filter(([, value]) => typeof value !== 'undefined'),
|
|
107
|
+
),
|
|
108
|
+
);
|
|
107
109
|
|
|
108
110
|
// Map events
|
|
109
111
|
defineEmits<{
|
|
110
112
|
/**
|
|
111
|
-
* Emitted when the dropdown opens.
|
|
112
|
-
|
|
113
|
+
* Emitted when the dropdown opens.
|
|
114
|
+
*/
|
|
113
115
|
'syn-show': [e: SynShowEvent];
|
|
114
116
|
|
|
115
117
|
/**
|
|
116
|
-
* Emitted after the dropdown opens and all animations are complete.
|
|
117
|
-
|
|
118
|
+
* Emitted after the dropdown opens and all animations are complete.
|
|
119
|
+
*/
|
|
118
120
|
'syn-after-show': [e: SynAfterShowEvent];
|
|
119
121
|
|
|
120
122
|
/**
|
|
121
|
-
* Emitted when the dropdown closes.
|
|
122
|
-
|
|
123
|
+
* Emitted when the dropdown closes.
|
|
124
|
+
*/
|
|
123
125
|
'syn-hide': [e: SynHideEvent];
|
|
124
126
|
|
|
125
127
|
/**
|
|
126
|
-
* Emitted after the dropdown closes and all animations are complete.
|
|
127
|
-
|
|
128
|
+
* Emitted after the dropdown closes and all animations are complete.
|
|
129
|
+
*/
|
|
128
130
|
'syn-after-hide': [e: SynAfterHideEvent];
|
|
129
131
|
}>();
|
|
130
132
|
</script>
|
|
@@ -138,14 +140,12 @@ export type { SynAfterHideEvent } from '@synergy-design-system/components';
|
|
|
138
140
|
|
|
139
141
|
<template>
|
|
140
142
|
<syn-dropdown
|
|
141
|
-
v-bind="visibleProps"
|
|
142
|
-
ref="nativeElement"
|
|
143
143
|
@syn-show="$emit('syn-show', $event)"
|
|
144
144
|
@syn-after-show="$emit('syn-after-show', $event)"
|
|
145
|
-
|
|
146
145
|
@syn-hide="$emit('syn-hide', $event)"
|
|
147
146
|
@syn-after-hide="$emit('syn-after-hide', $event)"
|
|
148
|
-
|
|
149
|
-
|
|
147
|
+
v-bind="visibleProps"
|
|
148
|
+
ref="nativeElement">
|
|
149
|
+
<slot></slot>
|
|
150
150
|
</syn-dropdown>
|
|
151
151
|
</template>
|