@synergy-design-system/vue 2.7.2 → 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
|
@@ -49,9 +49,13 @@
|
|
|
49
49
|
import { computed, ref } from 'vue';
|
|
50
50
|
import '@synergy-design-system/components/components/input/input.js';
|
|
51
51
|
|
|
52
|
-
import type {
|
|
53
|
-
|
|
54
|
-
} from '@synergy-design-system/components';
|
|
52
|
+
import type { SynBlurEvent } from '@synergy-design-system/components';
|
|
53
|
+
import type { SynChangeEvent } from '@synergy-design-system/components';
|
|
54
|
+
import type { SynClearEvent } from '@synergy-design-system/components';
|
|
55
|
+
import type { SynFocusEvent } from '@synergy-design-system/components';
|
|
56
|
+
import type { SynInputEvent } from '@synergy-design-system/components';
|
|
57
|
+
import type { SynInvalidEvent } from '@synergy-design-system/components';
|
|
58
|
+
import type { SynInput } from '@synergy-design-system/components';
|
|
55
59
|
|
|
56
60
|
// DOM Reference to the element
|
|
57
61
|
const nativeElement = ref<SynInput>();
|
|
@@ -62,7 +66,7 @@ defineExpose({
|
|
|
62
66
|
|
|
63
67
|
// Map attributes
|
|
64
68
|
const props = defineProps<{
|
|
65
|
-
|
|
69
|
+
title?: SynInput['title'];
|
|
66
70
|
|
|
67
71
|
/**
|
|
68
72
|
* The type of input.
|
|
@@ -70,71 +74,71 @@ const props = defineProps<{
|
|
|
70
74
|
* Defaults
|
|
71
75
|
to `text`.
|
|
72
76
|
*/
|
|
73
|
-
|
|
77
|
+
type?: SynInput['type'];
|
|
74
78
|
|
|
75
79
|
/**
|
|
76
|
-
* The name of the input, submitted as a name/value pair with form data.
|
|
77
|
-
|
|
78
|
-
|
|
80
|
+
* The name of the input, submitted as a name/value pair with form data.
|
|
81
|
+
*/
|
|
82
|
+
name?: SynInput['name'];
|
|
79
83
|
|
|
80
84
|
/**
|
|
81
|
-
* The current value of the input, submitted as a name/value pair with form data.
|
|
82
|
-
|
|
83
|
-
|
|
85
|
+
* The current value of the input, submitted as a name/value pair with form data.
|
|
86
|
+
*/
|
|
87
|
+
value?: SynInput['value'];
|
|
84
88
|
|
|
85
89
|
/**
|
|
86
|
-
* The input's size.
|
|
87
|
-
|
|
88
|
-
|
|
90
|
+
* The input's size.
|
|
91
|
+
*/
|
|
92
|
+
size?: SynInput['size'];
|
|
89
93
|
|
|
90
94
|
/**
|
|
91
|
-
* The input's label.
|
|
92
|
-
* If you need to display HTML, use the `label` slot instead.
|
|
93
|
-
|
|
94
|
-
|
|
95
|
+
* The input's label.
|
|
96
|
+
* If you need to display HTML, use the `label` slot instead.
|
|
97
|
+
*/
|
|
98
|
+
label?: SynInput['label'];
|
|
95
99
|
|
|
96
100
|
/**
|
|
97
|
-
* The input's help text.
|
|
98
|
-
* If you need to display HTML, use the `help-text` slot instead.
|
|
99
|
-
|
|
100
|
-
|
|
101
|
+
* The input's help text.
|
|
102
|
+
* If you need to display HTML, use the `help-text` slot instead.
|
|
103
|
+
*/
|
|
104
|
+
helpText?: SynInput['helpText'];
|
|
101
105
|
|
|
102
106
|
/**
|
|
103
|
-
* Adds a clear button when the input is not empty.
|
|
104
|
-
|
|
105
|
-
|
|
107
|
+
* Adds a clear button when the input is not empty.
|
|
108
|
+
*/
|
|
109
|
+
clearable?: SynInput['clearable'];
|
|
106
110
|
|
|
107
111
|
/**
|
|
108
|
-
* Disables the input.
|
|
109
|
-
|
|
110
|
-
|
|
112
|
+
* Disables the input.
|
|
113
|
+
*/
|
|
114
|
+
disabled?: SynInput['disabled'];
|
|
111
115
|
|
|
112
116
|
/**
|
|
113
|
-
* Placeholder text to show as a hint when the input is empty.
|
|
114
|
-
|
|
115
|
-
|
|
117
|
+
* Placeholder text to show as a hint when the input is empty.
|
|
118
|
+
*/
|
|
119
|
+
placeholder?: SynInput['placeholder'];
|
|
116
120
|
|
|
117
121
|
/**
|
|
118
|
-
* Makes the input readonly.
|
|
119
|
-
|
|
120
|
-
|
|
122
|
+
* Makes the input readonly.
|
|
123
|
+
*/
|
|
124
|
+
readonly?: SynInput['readonly'];
|
|
121
125
|
|
|
122
126
|
/**
|
|
123
|
-
* Adds a button to toggle the password's visibility.
|
|
124
|
-
* Only applies to password types.
|
|
125
|
-
|
|
126
|
-
|
|
127
|
+
* Adds a button to toggle the password's visibility.
|
|
128
|
+
* Only applies to password types.
|
|
129
|
+
*/
|
|
130
|
+
passwordToggle?: SynInput['passwordToggle'];
|
|
127
131
|
|
|
128
132
|
/**
|
|
129
|
-
* Determines whether or not the password is currently visible.
|
|
130
|
-
* Only applies to password input types.
|
|
131
|
-
|
|
132
|
-
|
|
133
|
+
* Determines whether or not the password is currently visible.
|
|
134
|
+
* Only applies to password input types.
|
|
135
|
+
*/
|
|
136
|
+
passwordVisible?: SynInput['passwordVisible'];
|
|
133
137
|
|
|
134
138
|
/**
|
|
135
|
-
* Hides the increment/decrement spin buttons for number inputs.
|
|
136
|
-
|
|
137
|
-
|
|
139
|
+
* Hides the increment/decrement spin buttons for number inputs.
|
|
140
|
+
*/
|
|
141
|
+
noSpinButtons?: SynInput['noSpinButtons'];
|
|
138
142
|
|
|
139
143
|
/**
|
|
140
144
|
* By default, form controls are associated with the nearest containing `<form>` element.
|
|
@@ -143,88 +147,88 @@ to place the form control outside of a form and associate it with the form that
|
|
|
143
147
|
* The form must be in
|
|
144
148
|
the same document or shadow root for this to work.
|
|
145
149
|
*/
|
|
146
|
-
|
|
150
|
+
form?: SynInput['form'];
|
|
147
151
|
|
|
148
152
|
/**
|
|
149
|
-
* Makes the input a required field.
|
|
150
|
-
|
|
151
|
-
|
|
153
|
+
* Makes the input a required field.
|
|
154
|
+
*/
|
|
155
|
+
required?: SynInput['required'];
|
|
152
156
|
|
|
153
157
|
/**
|
|
154
|
-
* A regular expression pattern to validate input against.
|
|
155
|
-
|
|
156
|
-
|
|
158
|
+
* A regular expression pattern to validate input against.
|
|
159
|
+
*/
|
|
160
|
+
pattern?: SynInput['pattern'];
|
|
157
161
|
|
|
158
162
|
/**
|
|
159
|
-
* The minimum length of input that will be considered valid.
|
|
160
|
-
|
|
161
|
-
|
|
163
|
+
* The minimum length of input that will be considered valid.
|
|
164
|
+
*/
|
|
165
|
+
minlength?: SynInput['minlength'];
|
|
162
166
|
|
|
163
167
|
/**
|
|
164
|
-
* The maximum length of input that will be considered valid.
|
|
165
|
-
|
|
166
|
-
|
|
168
|
+
* The maximum length of input that will be considered valid.
|
|
169
|
+
*/
|
|
170
|
+
maxlength?: SynInput['maxlength'];
|
|
167
171
|
|
|
168
172
|
/**
|
|
169
|
-
* The input's minimum value.
|
|
170
|
-
* Only applies to date and number input types.
|
|
171
|
-
|
|
172
|
-
|
|
173
|
+
* The input's minimum value.
|
|
174
|
+
* Only applies to date and number input types.
|
|
175
|
+
*/
|
|
176
|
+
min?: SynInput['min'];
|
|
173
177
|
|
|
174
178
|
/**
|
|
175
|
-
* The input's maximum value.
|
|
176
|
-
* Only applies to date and number input types.
|
|
177
|
-
|
|
178
|
-
|
|
179
|
+
* The input's maximum value.
|
|
180
|
+
* Only applies to date and number input types.
|
|
181
|
+
*/
|
|
182
|
+
max?: SynInput['max'];
|
|
179
183
|
|
|
180
184
|
/**
|
|
181
185
|
* Specifies the granularity that the value must adhere to, or the special value `any` which means no stepping is
|
|
182
186
|
implied, allowing any numeric value.
|
|
183
187
|
* Only applies to date and number input types.
|
|
184
188
|
*/
|
|
185
|
-
|
|
189
|
+
step?: SynInput['step'];
|
|
186
190
|
|
|
187
191
|
/**
|
|
188
|
-
* Controls whether and how text input is automatically capitalized as it is entered by the user.
|
|
189
|
-
|
|
190
|
-
|
|
192
|
+
* Controls whether and how text input is automatically capitalized as it is entered by the user.
|
|
193
|
+
*/
|
|
194
|
+
autocapitalize?: SynInput['autocapitalize'];
|
|
191
195
|
|
|
192
196
|
/**
|
|
193
|
-
* Indicates whether the browser's autocorrect feature is on or off.
|
|
194
|
-
|
|
195
|
-
|
|
197
|
+
* Indicates whether the browser's autocorrect feature is on or off.
|
|
198
|
+
*/
|
|
199
|
+
autocorrect?: SynInput['autocorrect'];
|
|
196
200
|
|
|
197
201
|
/**
|
|
198
202
|
* Specifies what permission the browser has to provide assistance in filling out form field values.
|
|
199
203
|
* Refer to
|
|
200
204
|
[this page on MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete) for available values.
|
|
201
205
|
*/
|
|
202
|
-
|
|
206
|
+
autocomplete?: SynInput['autocomplete'];
|
|
203
207
|
|
|
204
208
|
/**
|
|
205
|
-
* Indicates that the input should receive focus on page load.
|
|
206
|
-
|
|
207
|
-
|
|
209
|
+
* Indicates that the input should receive focus on page load.
|
|
210
|
+
*/
|
|
211
|
+
autofocus?: SynInput['autofocus'];
|
|
208
212
|
|
|
209
213
|
/**
|
|
210
|
-
* Used to customize the label or icon of the Enter key on virtual keyboards.
|
|
211
|
-
|
|
212
|
-
|
|
214
|
+
* Used to customize the label or icon of the Enter key on virtual keyboards.
|
|
215
|
+
*/
|
|
216
|
+
enterkeyhint?: SynInput['enterkeyhint'];
|
|
213
217
|
|
|
214
218
|
/**
|
|
215
|
-
* Enables spell checking on the input.
|
|
216
|
-
|
|
217
|
-
|
|
219
|
+
* Enables spell checking on the input.
|
|
220
|
+
*/
|
|
221
|
+
spellcheck?: SynInput['spellcheck'];
|
|
218
222
|
|
|
219
223
|
/**
|
|
220
224
|
* Tells the browser what type of data will be entered by the user, allowing it to display the appropriate virtual
|
|
221
225
|
keyboard on supportive devices.
|
|
222
226
|
*/
|
|
223
|
-
|
|
227
|
+
inputmode?: SynInput['inputmode'];
|
|
224
228
|
|
|
225
229
|
/**
|
|
226
|
-
* Support for two way data binding
|
|
227
|
-
|
|
230
|
+
* Support for two way data binding
|
|
231
|
+
*/
|
|
228
232
|
modelValue?: SynInput['value'];
|
|
229
233
|
}>();
|
|
230
234
|
|
|
@@ -232,47 +236,47 @@ keyboard on supportive devices.
|
|
|
232
236
|
// This is needed because :param="param" also adds an empty attribute
|
|
233
237
|
// when using web-components, which breaks optional arguments like size in SynInput
|
|
234
238
|
// @see https://github.com/vuejs/core/issues/5190#issuecomment-1003112498
|
|
235
|
-
const visibleProps = computed(() =>
|
|
236
|
-
Object
|
|
237
|
-
.entries(props)
|
|
238
|
-
|
|
239
|
-
)
|
|
239
|
+
const visibleProps = computed(() =>
|
|
240
|
+
Object.fromEntries(
|
|
241
|
+
Object.entries(props).filter(([, value]) => typeof value !== 'undefined'),
|
|
242
|
+
),
|
|
243
|
+
);
|
|
240
244
|
|
|
241
245
|
// Map events
|
|
242
246
|
defineEmits<{
|
|
243
247
|
/**
|
|
244
|
-
* Emitted when the control loses focus.
|
|
245
|
-
|
|
248
|
+
* Emitted when the control loses focus.
|
|
249
|
+
*/
|
|
246
250
|
'syn-blur': [e: SynBlurEvent];
|
|
247
251
|
|
|
248
252
|
/**
|
|
249
|
-
* Emitted when an alteration to the control's value is committed by the user.
|
|
250
|
-
|
|
253
|
+
* Emitted when an alteration to the control's value is committed by the user.
|
|
254
|
+
*/
|
|
251
255
|
'syn-change': [e: SynChangeEvent];
|
|
252
256
|
|
|
253
257
|
/**
|
|
254
|
-
* Emitted when the clear button is activated.
|
|
255
|
-
|
|
258
|
+
* Emitted when the clear button is activated.
|
|
259
|
+
*/
|
|
256
260
|
'syn-clear': [e: SynClearEvent];
|
|
257
261
|
|
|
258
262
|
/**
|
|
259
|
-
* Emitted when the control gains focus.
|
|
260
|
-
|
|
263
|
+
* Emitted when the control gains focus.
|
|
264
|
+
*/
|
|
261
265
|
'syn-focus': [e: SynFocusEvent];
|
|
262
266
|
|
|
263
267
|
/**
|
|
264
|
-
* Emitted when the control receives input.
|
|
265
|
-
|
|
268
|
+
* Emitted when the control receives input.
|
|
269
|
+
*/
|
|
266
270
|
'syn-input': [e: SynInputEvent];
|
|
267
271
|
|
|
268
272
|
/**
|
|
269
|
-
* Emitted when the form control has been checked for validity and its constraints aren't satisfied.
|
|
270
|
-
|
|
273
|
+
* Emitted when the form control has been checked for validity and its constraints aren't satisfied.
|
|
274
|
+
*/
|
|
271
275
|
'syn-invalid': [e: SynInvalidEvent];
|
|
272
276
|
|
|
273
277
|
/**
|
|
274
|
-
* Support for two way data binding
|
|
275
|
-
|
|
278
|
+
* Support for two way data binding
|
|
279
|
+
*/
|
|
276
280
|
'update:modelValue': [newValue: SynInput['value']];
|
|
277
281
|
}>();
|
|
278
282
|
</script>
|
|
@@ -288,16 +292,24 @@ export type { SynInvalidEvent } from '@synergy-design-system/components';
|
|
|
288
292
|
|
|
289
293
|
<template>
|
|
290
294
|
<syn-input
|
|
291
|
-
v-bind="visibleProps"
|
|
292
|
-
ref="nativeElement"
|
|
293
|
-
:value="typeof props.modelValue !== 'undefined' ? props.modelValue : typeof props.value !== 'undefined' ? props.value : undefined"
|
|
294
295
|
@syn-blur="$emit('syn-blur', $event)"
|
|
295
296
|
@syn-change="$emit('syn-change', $event)"
|
|
296
297
|
@syn-clear="$emit('syn-clear', $event)"
|
|
297
298
|
@syn-focus="$emit('syn-focus', $event)"
|
|
298
|
-
@syn-input="
|
|
299
|
+
@syn-input="
|
|
300
|
+
$emit('update:modelValue', $event.target.value);
|
|
301
|
+
$emit('syn-input', $event);
|
|
302
|
+
"
|
|
299
303
|
@syn-invalid="$emit('syn-invalid', $event)"
|
|
300
|
-
|
|
301
|
-
|
|
304
|
+
:value="
|
|
305
|
+
typeof props.modelValue !== 'undefined'
|
|
306
|
+
? props.modelValue
|
|
307
|
+
: typeof props.value !== 'undefined'
|
|
308
|
+
? props.value
|
|
309
|
+
: undefined
|
|
310
|
+
"
|
|
311
|
+
v-bind="visibleProps"
|
|
312
|
+
ref="nativeElement">
|
|
313
|
+
<slot></slot>
|
|
302
314
|
</syn-input>
|
|
303
315
|
</template>
|
|
@@ -18,7 +18,8 @@
|
|
|
18
18
|
import { computed, ref } from 'vue';
|
|
19
19
|
import '@synergy-design-system/components/components/menu/menu.js';
|
|
20
20
|
|
|
21
|
-
import type {
|
|
21
|
+
import type { SynSelectEvent } from '@synergy-design-system/components';
|
|
22
|
+
import type { SynMenu } from '@synergy-design-system/components';
|
|
22
23
|
|
|
23
24
|
// DOM Reference to the element
|
|
24
25
|
const nativeElement = ref<SynMenu>();
|
|
@@ -30,8 +31,8 @@ defineExpose({
|
|
|
30
31
|
// Map events
|
|
31
32
|
defineEmits<{
|
|
32
33
|
/**
|
|
33
|
-
* Emitted when a menu item is selected.
|
|
34
|
-
|
|
34
|
+
* Emitted when a menu item is selected.
|
|
35
|
+
*/
|
|
35
36
|
'syn-select': [e: SynSelectEvent];
|
|
36
37
|
}>();
|
|
37
38
|
</script>
|
|
@@ -41,11 +42,7 @@ export type { SynSelectEvent } from '@synergy-design-system/components';
|
|
|
41
42
|
</script>
|
|
42
43
|
|
|
43
44
|
<template>
|
|
44
|
-
<syn-menu
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
@syn-select="$emit('syn-select', $event)"
|
|
48
|
-
>
|
|
49
|
-
<slot />
|
|
45
|
+
<syn-menu @syn-select="$emit('syn-select', $event)" ref="nativeElement">
|
|
46
|
+
<slot></slot>
|
|
50
47
|
</syn-menu>
|
|
51
48
|
</template>
|
|
@@ -46,51 +46,46 @@ defineExpose({
|
|
|
46
46
|
// Map attributes
|
|
47
47
|
const props = defineProps<{
|
|
48
48
|
/**
|
|
49
|
-
* The type of menu item to render.
|
|
50
|
-
* To use `checked`, this value must be set to `checkbox`.
|
|
51
|
-
|
|
52
|
-
|
|
49
|
+
* The type of menu item to render.
|
|
50
|
+
* To use `checked`, this value must be set to `checkbox`.
|
|
51
|
+
*/
|
|
52
|
+
type?: SynMenuItem['type'];
|
|
53
53
|
|
|
54
54
|
/**
|
|
55
|
-
* Draws the item in a checked state.
|
|
56
|
-
|
|
57
|
-
|
|
55
|
+
* Draws the item in a checked state.
|
|
56
|
+
*/
|
|
57
|
+
checked?: SynMenuItem['checked'];
|
|
58
58
|
|
|
59
59
|
/**
|
|
60
|
-
* A unique value to store in the menu item.
|
|
61
|
-
* This can be used as a way to identify menu items when selected.
|
|
62
|
-
|
|
63
|
-
|
|
60
|
+
* A unique value to store in the menu item.
|
|
61
|
+
* This can be used as a way to identify menu items when selected.
|
|
62
|
+
*/
|
|
63
|
+
value?: SynMenuItem['value'];
|
|
64
64
|
|
|
65
65
|
/**
|
|
66
|
-
* Draws the menu item in a loading state.
|
|
67
|
-
|
|
68
|
-
|
|
66
|
+
* Draws the menu item in a loading state.
|
|
67
|
+
*/
|
|
68
|
+
loading?: SynMenuItem['loading'];
|
|
69
69
|
|
|
70
70
|
/**
|
|
71
|
-
* Draws the menu item in a disabled state, preventing selection.
|
|
72
|
-
|
|
73
|
-
|
|
71
|
+
* Draws the menu item in a disabled state, preventing selection.
|
|
72
|
+
*/
|
|
73
|
+
disabled?: SynMenuItem['disabled'];
|
|
74
74
|
}>();
|
|
75
75
|
|
|
76
76
|
// Make sure prop binding only forwards the props that are actually there.
|
|
77
77
|
// This is needed because :param="param" also adds an empty attribute
|
|
78
78
|
// when using web-components, which breaks optional arguments like size in SynInput
|
|
79
79
|
// @see https://github.com/vuejs/core/issues/5190#issuecomment-1003112498
|
|
80
|
-
const visibleProps = computed(() =>
|
|
81
|
-
Object
|
|
82
|
-
.entries(props)
|
|
83
|
-
|
|
84
|
-
)
|
|
85
|
-
|
|
80
|
+
const visibleProps = computed(() =>
|
|
81
|
+
Object.fromEntries(
|
|
82
|
+
Object.entries(props).filter(([, value]) => typeof value !== 'undefined'),
|
|
83
|
+
),
|
|
84
|
+
);
|
|
86
85
|
</script>
|
|
87
86
|
|
|
88
87
|
<template>
|
|
89
|
-
<syn-menu-item
|
|
90
|
-
|
|
91
|
-
v-bind="visibleProps"
|
|
92
|
-
ref="nativeElement"
|
|
93
|
-
>
|
|
94
|
-
<slot />
|
|
88
|
+
<syn-menu-item v-bind="visibleProps" ref="nativeElement">
|
|
89
|
+
<slot></slot>
|
|
95
90
|
</syn-menu-item>
|
|
96
91
|
</template>
|
|
@@ -32,14 +32,10 @@ const nativeElement = ref<SynMenuLabel>();
|
|
|
32
32
|
defineExpose({
|
|
33
33
|
nativeElement,
|
|
34
34
|
});
|
|
35
|
-
|
|
36
35
|
</script>
|
|
37
36
|
|
|
38
37
|
<template>
|
|
39
|
-
<syn-menu-label
|
|
40
|
-
|
|
41
|
-
ref="nativeElement"
|
|
42
|
-
>
|
|
43
|
-
<slot />
|
|
38
|
+
<syn-menu-label ref="nativeElement">
|
|
39
|
+
<slot></slot>
|
|
44
40
|
</syn-menu-label>
|
|
45
41
|
</template>
|
|
@@ -53,9 +53,11 @@
|
|
|
53
53
|
import { computed, ref } from 'vue';
|
|
54
54
|
import '@synergy-design-system/components/components/nav-item/nav-item.js';
|
|
55
55
|
|
|
56
|
-
import type {
|
|
57
|
-
|
|
58
|
-
} from '@synergy-design-system/components';
|
|
56
|
+
import type { SynShowEvent } from '@synergy-design-system/components';
|
|
57
|
+
import type { SynHideEvent } from '@synergy-design-system/components';
|
|
58
|
+
import type { SynBlurEvent } from '@synergy-design-system/components';
|
|
59
|
+
import type { SynFocusEvent } from '@synergy-design-system/components';
|
|
60
|
+
import type { SynNavItem } from '@synergy-design-system/components';
|
|
59
61
|
|
|
60
62
|
// DOM Reference to the element
|
|
61
63
|
const nativeElement = ref<SynNavItem>();
|
|
@@ -73,69 +75,69 @@ If provided, the navigation item will use an anchor tag otherwise it will use a
|
|
|
73
75
|
If the 'children' slot is provided, the navigation item will ignore the 'href' and use
|
|
74
76
|
accordion behavior.
|
|
75
77
|
*/
|
|
76
|
-
|
|
78
|
+
href?: SynNavItem['href'];
|
|
77
79
|
|
|
78
|
-
|
|
80
|
+
current?: SynNavItem['current'];
|
|
79
81
|
|
|
80
82
|
/**
|
|
81
|
-
* Disables the navigation item.
|
|
82
|
-
|
|
83
|
-
|
|
83
|
+
* Disables the navigation item.
|
|
84
|
+
*/
|
|
85
|
+
disabled?: SynNavItem['disabled'];
|
|
84
86
|
|
|
85
87
|
/**
|
|
86
|
-
* The navigation item's orientation.
|
|
87
|
-
|
|
88
|
-
|
|
88
|
+
* The navigation item's orientation.
|
|
89
|
+
*/
|
|
90
|
+
horizontal?: SynNavItem['horizontal'];
|
|
89
91
|
|
|
90
92
|
/**
|
|
91
93
|
* Appends a chevron to the right side of a navigation item.
|
|
92
94
|
Only used if `horizontal` is false.
|
|
93
95
|
*/
|
|
94
|
-
|
|
96
|
+
chevron?: SynNavItem['chevron'];
|
|
95
97
|
|
|
96
98
|
/**
|
|
97
99
|
* Reflects HTML details element state and allows control from parent.
|
|
98
100
|
Only used if `horizontal` is false and `children` is defined.
|
|
99
101
|
*/
|
|
100
|
-
|
|
102
|
+
open?: SynNavItem['open'];
|
|
101
103
|
|
|
102
104
|
/**
|
|
103
105
|
* Toggle to true to show a divider above the element.
|
|
104
106
|
Only available when horizontal is false.
|
|
105
107
|
*/
|
|
106
|
-
|
|
108
|
+
divider?: SynNavItem['divider'];
|
|
107
109
|
}>();
|
|
108
110
|
|
|
109
111
|
// Make sure prop binding only forwards the props that are actually there.
|
|
110
112
|
// This is needed because :param="param" also adds an empty attribute
|
|
111
113
|
// when using web-components, which breaks optional arguments like size in SynInput
|
|
112
114
|
// @see https://github.com/vuejs/core/issues/5190#issuecomment-1003112498
|
|
113
|
-
const visibleProps = computed(() =>
|
|
114
|
-
Object
|
|
115
|
-
.entries(props)
|
|
116
|
-
|
|
117
|
-
)
|
|
115
|
+
const visibleProps = computed(() =>
|
|
116
|
+
Object.fromEntries(
|
|
117
|
+
Object.entries(props).filter(([, value]) => typeof value !== 'undefined'),
|
|
118
|
+
),
|
|
119
|
+
);
|
|
118
120
|
|
|
119
121
|
// Map events
|
|
120
122
|
defineEmits<{
|
|
121
123
|
/**
|
|
122
|
-
* Emitted when the navigation item: - has children, - and is clicked while HTML details are hidden.
|
|
123
|
-
|
|
124
|
+
* Emitted when the navigation item: - has children, - and is clicked while HTML details are hidden.
|
|
125
|
+
*/
|
|
124
126
|
'syn-show': [e: SynShowEvent];
|
|
125
127
|
|
|
126
128
|
/**
|
|
127
|
-
* Emitted when the navigation item: - has children, - and is clicked while HTML details are shown.
|
|
128
|
-
|
|
129
|
+
* Emitted when the navigation item: - has children, - and is clicked while HTML details are shown.
|
|
130
|
+
*/
|
|
129
131
|
'syn-hide': [e: SynHideEvent];
|
|
130
132
|
|
|
131
133
|
/**
|
|
132
|
-
* Emitted when the button loses focus.
|
|
133
|
-
|
|
134
|
+
* Emitted when the button loses focus.
|
|
135
|
+
*/
|
|
134
136
|
'syn-blur': [e: SynBlurEvent];
|
|
135
137
|
|
|
136
138
|
/**
|
|
137
|
-
* Emitted when the button gains focus.
|
|
138
|
-
|
|
139
|
+
* Emitted when the button gains focus.
|
|
140
|
+
*/
|
|
139
141
|
'syn-focus': [e: SynFocusEvent];
|
|
140
142
|
}>();
|
|
141
143
|
</script>
|
|
@@ -149,14 +151,12 @@ export type { SynFocusEvent } from '@synergy-design-system/components';
|
|
|
149
151
|
|
|
150
152
|
<template>
|
|
151
153
|
<syn-nav-item
|
|
152
|
-
v-bind="visibleProps"
|
|
153
|
-
ref="nativeElement"
|
|
154
154
|
@syn-show="$emit('syn-show', $event)"
|
|
155
155
|
@syn-hide="$emit('syn-hide', $event)"
|
|
156
|
-
|
|
157
156
|
@syn-blur="$emit('syn-blur', $event)"
|
|
158
157
|
@syn-focus="$emit('syn-focus', $event)"
|
|
159
|
-
|
|
160
|
-
|
|
158
|
+
v-bind="visibleProps"
|
|
159
|
+
ref="nativeElement">
|
|
160
|
+
<slot></slot>
|
|
161
161
|
</syn-nav-item>
|
|
162
162
|
</template>
|
|
@@ -42,35 +42,30 @@ defineExpose({
|
|
|
42
42
|
// Map attributes
|
|
43
43
|
const props = defineProps<{
|
|
44
44
|
/**
|
|
45
|
-
* Disables all options in the optgroup.
|
|
46
|
-
|
|
47
|
-
|
|
45
|
+
* Disables all options in the optgroup.
|
|
46
|
+
*/
|
|
47
|
+
disabled?: SynOptgroup['disabled'];
|
|
48
48
|
|
|
49
49
|
/**
|
|
50
|
-
* The optgroups label.
|
|
51
|
-
* If you need to display HTML, use the `label` slot instead.
|
|
52
|
-
|
|
53
|
-
|
|
50
|
+
* The optgroups label.
|
|
51
|
+
* If you need to display HTML, use the `label` slot instead.
|
|
52
|
+
*/
|
|
53
|
+
label?: SynOptgroup['label'];
|
|
54
54
|
}>();
|
|
55
55
|
|
|
56
56
|
// Make sure prop binding only forwards the props that are actually there.
|
|
57
57
|
// This is needed because :param="param" also adds an empty attribute
|
|
58
58
|
// when using web-components, which breaks optional arguments like size in SynInput
|
|
59
59
|
// @see https://github.com/vuejs/core/issues/5190#issuecomment-1003112498
|
|
60
|
-
const visibleProps = computed(() =>
|
|
61
|
-
Object
|
|
62
|
-
.entries(props)
|
|
63
|
-
|
|
64
|
-
)
|
|
65
|
-
|
|
60
|
+
const visibleProps = computed(() =>
|
|
61
|
+
Object.fromEntries(
|
|
62
|
+
Object.entries(props).filter(([, value]) => typeof value !== 'undefined'),
|
|
63
|
+
),
|
|
64
|
+
);
|
|
66
65
|
</script>
|
|
67
66
|
|
|
68
67
|
<template>
|
|
69
|
-
<syn-optgroup
|
|
70
|
-
|
|
71
|
-
v-bind="visibleProps"
|
|
72
|
-
ref="nativeElement"
|
|
73
|
-
>
|
|
74
|
-
<slot />
|
|
68
|
+
<syn-optgroup v-bind="visibleProps" ref="nativeElement">
|
|
69
|
+
<slot></slot>
|
|
75
70
|
</syn-optgroup>
|
|
76
71
|
</template>
|