@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
|
@@ -43,39 +43,34 @@ const props = defineProps<{
|
|
|
43
43
|
internally.
|
|
44
44
|
* When unset, a button will be rendered instead.
|
|
45
45
|
*/
|
|
46
|
-
|
|
46
|
+
href?: SynBreadcrumbItem['href'];
|
|
47
47
|
|
|
48
48
|
/**
|
|
49
|
-
* Tells the browser where to open the link.
|
|
50
|
-
* Only used when `href` is set.
|
|
51
|
-
|
|
52
|
-
|
|
49
|
+
* Tells the browser where to open the link.
|
|
50
|
+
* Only used when `href` is set.
|
|
51
|
+
*/
|
|
52
|
+
target?: SynBreadcrumbItem['target'];
|
|
53
53
|
|
|
54
54
|
/**
|
|
55
|
-
* The `rel` attribute to use on the link.
|
|
56
|
-
* Only used when `href` is set.
|
|
57
|
-
|
|
58
|
-
|
|
55
|
+
* The `rel` attribute to use on the link.
|
|
56
|
+
* Only used when `href` is set.
|
|
57
|
+
*/
|
|
58
|
+
rel?: SynBreadcrumbItem['rel'];
|
|
59
59
|
}>();
|
|
60
60
|
|
|
61
61
|
// Make sure prop binding only forwards the props that are actually there.
|
|
62
62
|
// This is needed because :param="param" also adds an empty attribute
|
|
63
63
|
// when using web-components, which breaks optional arguments like size in SynInput
|
|
64
64
|
// @see https://github.com/vuejs/core/issues/5190#issuecomment-1003112498
|
|
65
|
-
const visibleProps = computed(() =>
|
|
66
|
-
Object
|
|
67
|
-
.entries(props)
|
|
68
|
-
|
|
69
|
-
)
|
|
70
|
-
|
|
65
|
+
const visibleProps = computed(() =>
|
|
66
|
+
Object.fromEntries(
|
|
67
|
+
Object.entries(props).filter(([, value]) => typeof value !== 'undefined'),
|
|
68
|
+
),
|
|
69
|
+
);
|
|
71
70
|
</script>
|
|
72
71
|
|
|
73
72
|
<template>
|
|
74
|
-
<syn-breadcrumb-item
|
|
75
|
-
|
|
76
|
-
v-bind="visibleProps"
|
|
77
|
-
ref="nativeElement"
|
|
78
|
-
>
|
|
79
|
-
<slot />
|
|
73
|
+
<syn-breadcrumb-item v-bind="visibleProps" ref="nativeElement">
|
|
74
|
+
<slot></slot>
|
|
80
75
|
</syn-breadcrumb-item>
|
|
81
76
|
</template>
|
|
@@ -32,9 +32,10 @@
|
|
|
32
32
|
import { computed, ref } from 'vue';
|
|
33
33
|
import '@synergy-design-system/components/components/button/button.js';
|
|
34
34
|
|
|
35
|
-
import type {
|
|
36
|
-
|
|
37
|
-
} from '@synergy-design-system/components';
|
|
35
|
+
import type { SynBlurEvent } from '@synergy-design-system/components';
|
|
36
|
+
import type { SynFocusEvent } from '@synergy-design-system/components';
|
|
37
|
+
import type { SynInvalidEvent } from '@synergy-design-system/components';
|
|
38
|
+
import type { SynButton } from '@synergy-design-system/components';
|
|
38
39
|
|
|
39
40
|
// DOM Reference to the element
|
|
40
41
|
const nativeElement = ref<SynButton>();
|
|
@@ -45,33 +46,33 @@ defineExpose({
|
|
|
45
46
|
|
|
46
47
|
// Map attributes
|
|
47
48
|
const props = defineProps<{
|
|
48
|
-
|
|
49
|
+
title?: SynButton['title'];
|
|
49
50
|
|
|
50
51
|
/**
|
|
51
|
-
* The button's theme variant.
|
|
52
|
-
|
|
53
|
-
|
|
52
|
+
* The button's theme variant.
|
|
53
|
+
*/
|
|
54
|
+
variant?: SynButton['variant'];
|
|
54
55
|
|
|
55
56
|
/**
|
|
56
|
-
* The button's size.
|
|
57
|
-
|
|
58
|
-
|
|
57
|
+
* The button's size.
|
|
58
|
+
*/
|
|
59
|
+
size?: SynButton['size'];
|
|
59
60
|
|
|
60
61
|
/**
|
|
61
|
-
* Draws the button with a caret.
|
|
62
|
-
* Used to indicate that the button triggers a dropdown menu or similar behavior.
|
|
63
|
-
|
|
64
|
-
|
|
62
|
+
* Draws the button with a caret.
|
|
63
|
+
* Used to indicate that the button triggers a dropdown menu or similar behavior.
|
|
64
|
+
*/
|
|
65
|
+
caret?: SynButton['caret'];
|
|
65
66
|
|
|
66
67
|
/**
|
|
67
|
-
* Disables the button.
|
|
68
|
-
|
|
69
|
-
|
|
68
|
+
* Disables the button.
|
|
69
|
+
*/
|
|
70
|
+
disabled?: SynButton['disabled'];
|
|
70
71
|
|
|
71
72
|
/**
|
|
72
|
-
* Draws the button in a loading state.
|
|
73
|
-
|
|
74
|
-
|
|
73
|
+
* Draws the button in a loading state.
|
|
74
|
+
*/
|
|
75
|
+
loading?: SynButton['loading'];
|
|
75
76
|
|
|
76
77
|
/**
|
|
77
78
|
* The type of button.
|
|
@@ -79,31 +80,31 @@ const props = defineProps<{
|
|
|
79
80
|
`<button>` elements behave.
|
|
80
81
|
* When the type is `submit`, the button will submit the surrounding form.
|
|
81
82
|
*/
|
|
82
|
-
|
|
83
|
+
type?: SynButton['type'];
|
|
83
84
|
|
|
84
85
|
/**
|
|
85
86
|
* The name of the button, submitted as a name/value pair with form data, but only when this button is the submitter.
|
|
86
87
|
This attribute is ignored when `href` is present.
|
|
87
88
|
*/
|
|
88
|
-
|
|
89
|
+
name?: SynButton['name'];
|
|
89
90
|
|
|
90
91
|
/**
|
|
91
92
|
* The value of the button, submitted as a pair with the button's name as part of the form data, but only when this
|
|
92
93
|
button is the submitter.
|
|
93
94
|
* This attribute is ignored when `href` is present.
|
|
94
95
|
*/
|
|
95
|
-
|
|
96
|
+
value?: SynButton['value'];
|
|
96
97
|
|
|
97
98
|
/**
|
|
98
|
-
* When set, the underlying button will be rendered as an `<a>` with this `href` instead of a `<button>`.
|
|
99
|
-
|
|
100
|
-
|
|
99
|
+
* When set, the underlying button will be rendered as an `<a>` with this `href` instead of a `<button>`.
|
|
100
|
+
*/
|
|
101
|
+
href?: SynButton['href'];
|
|
101
102
|
|
|
102
103
|
/**
|
|
103
|
-
* Tells the browser where to open the link.
|
|
104
|
-
* Only used when `href` is present.
|
|
105
|
-
|
|
106
|
-
|
|
104
|
+
* Tells the browser where to open the link.
|
|
105
|
+
* Only used when `href` is present.
|
|
106
|
+
*/
|
|
107
|
+
target?: SynButton['target'];
|
|
107
108
|
|
|
108
109
|
/**
|
|
109
110
|
* When using `href`, this attribute will map to the underlying link's `rel` attribute.
|
|
@@ -114,13 +115,13 @@ specific tab/window, this will prevent that from working correctly.
|
|
|
114
115
|
* You can remove or change the default value by
|
|
115
116
|
setting the attribute to an empty string or a value of your choice, respectively.
|
|
116
117
|
*/
|
|
117
|
-
|
|
118
|
+
rel?: SynButton['rel'];
|
|
118
119
|
|
|
119
120
|
/**
|
|
120
|
-
* Tells the browser to download the linked file as this filename.
|
|
121
|
-
* Only used when `href` is present.
|
|
122
|
-
|
|
123
|
-
|
|
121
|
+
* Tells the browser to download the linked file as this filename.
|
|
122
|
+
* Only used when `href` is present.
|
|
123
|
+
*/
|
|
124
|
+
download?: SynButton['download'];
|
|
124
125
|
|
|
125
126
|
/**
|
|
126
127
|
* The "form owner" to associate the button with.
|
|
@@ -128,59 +129,59 @@ setting the attribute to an empty string or a value of your choice, respectively
|
|
|
128
129
|
* The
|
|
129
130
|
value of this attribute must be an id of a form in the same document or shadow root as the button.
|
|
130
131
|
*/
|
|
131
|
-
|
|
132
|
+
form?: SynButton['form'];
|
|
132
133
|
|
|
133
134
|
/**
|
|
134
|
-
* Used to override the form owner's `action` attribute.
|
|
135
|
-
|
|
136
|
-
|
|
135
|
+
* Used to override the form owner's `action` attribute.
|
|
136
|
+
*/
|
|
137
|
+
formAction?: SynButton['formAction'];
|
|
137
138
|
|
|
138
139
|
/**
|
|
139
|
-
* Used to override the form owner's `enctype` attribute.
|
|
140
|
-
|
|
141
|
-
|
|
140
|
+
* Used to override the form owner's `enctype` attribute.
|
|
141
|
+
*/
|
|
142
|
+
formEnctype?: SynButton['formEnctype'];
|
|
142
143
|
|
|
143
144
|
/**
|
|
144
|
-
* Used to override the form owner's `method` attribute.
|
|
145
|
-
|
|
146
|
-
|
|
145
|
+
* Used to override the form owner's `method` attribute.
|
|
146
|
+
*/
|
|
147
|
+
formMethod?: SynButton['formMethod'];
|
|
147
148
|
|
|
148
149
|
/**
|
|
149
|
-
* Used to override the form owner's `novalidate` attribute.
|
|
150
|
-
|
|
151
|
-
|
|
150
|
+
* Used to override the form owner's `novalidate` attribute.
|
|
151
|
+
*/
|
|
152
|
+
formNoValidate?: SynButton['formNoValidate'];
|
|
152
153
|
|
|
153
154
|
/**
|
|
154
|
-
* Used to override the form owner's `target` attribute.
|
|
155
|
-
|
|
156
|
-
|
|
155
|
+
* Used to override the form owner's `target` attribute.
|
|
156
|
+
*/
|
|
157
|
+
formTarget?: SynButton['formTarget'];
|
|
157
158
|
}>();
|
|
158
159
|
|
|
159
160
|
// Make sure prop binding only forwards the props that are actually there.
|
|
160
161
|
// This is needed because :param="param" also adds an empty attribute
|
|
161
162
|
// when using web-components, which breaks optional arguments like size in SynInput
|
|
162
163
|
// @see https://github.com/vuejs/core/issues/5190#issuecomment-1003112498
|
|
163
|
-
const visibleProps = computed(() =>
|
|
164
|
-
Object
|
|
165
|
-
.entries(props)
|
|
166
|
-
|
|
167
|
-
)
|
|
164
|
+
const visibleProps = computed(() =>
|
|
165
|
+
Object.fromEntries(
|
|
166
|
+
Object.entries(props).filter(([, value]) => typeof value !== 'undefined'),
|
|
167
|
+
),
|
|
168
|
+
);
|
|
168
169
|
|
|
169
170
|
// Map events
|
|
170
171
|
defineEmits<{
|
|
171
172
|
/**
|
|
172
|
-
* Emitted when the button loses focus.
|
|
173
|
-
|
|
173
|
+
* Emitted when the button loses focus.
|
|
174
|
+
*/
|
|
174
175
|
'syn-blur': [e: SynBlurEvent];
|
|
175
176
|
|
|
176
177
|
/**
|
|
177
|
-
* Emitted when the button gains focus.
|
|
178
|
-
|
|
178
|
+
* Emitted when the button gains focus.
|
|
179
|
+
*/
|
|
179
180
|
'syn-focus': [e: SynFocusEvent];
|
|
180
181
|
|
|
181
182
|
/**
|
|
182
|
-
* Emitted when the form control has been checked for validity and its constraints aren't satisfied.
|
|
183
|
-
|
|
183
|
+
* Emitted when the form control has been checked for validity and its constraints aren't satisfied.
|
|
184
|
+
*/
|
|
184
185
|
'syn-invalid': [e: SynInvalidEvent];
|
|
185
186
|
}>();
|
|
186
187
|
</script>
|
|
@@ -193,13 +194,11 @@ export type { SynInvalidEvent } from '@synergy-design-system/components';
|
|
|
193
194
|
|
|
194
195
|
<template>
|
|
195
196
|
<syn-button
|
|
196
|
-
v-bind="visibleProps"
|
|
197
|
-
ref="nativeElement"
|
|
198
197
|
@syn-blur="$emit('syn-blur', $event)"
|
|
199
|
-
|
|
200
198
|
@syn-focus="$emit('syn-focus', $event)"
|
|
201
199
|
@syn-invalid="$emit('syn-invalid', $event)"
|
|
202
|
-
|
|
203
|
-
|
|
200
|
+
v-bind="visibleProps"
|
|
201
|
+
ref="nativeElement">
|
|
202
|
+
<slot></slot>
|
|
204
203
|
</syn-button>
|
|
205
204
|
</template>
|
|
@@ -34,27 +34,22 @@ const props = defineProps<{
|
|
|
34
34
|
* This won't be displayed on the screen, but it will be announced by assistive
|
|
35
35
|
devices when interacting with the control and is strongly recommended.
|
|
36
36
|
*/
|
|
37
|
-
|
|
37
|
+
label?: SynButtonGroup['label'];
|
|
38
38
|
}>();
|
|
39
39
|
|
|
40
40
|
// Make sure prop binding only forwards the props that are actually there.
|
|
41
41
|
// This is needed because :param="param" also adds an empty attribute
|
|
42
42
|
// when using web-components, which breaks optional arguments like size in SynInput
|
|
43
43
|
// @see https://github.com/vuejs/core/issues/5190#issuecomment-1003112498
|
|
44
|
-
const visibleProps = computed(() =>
|
|
45
|
-
Object
|
|
46
|
-
.entries(props)
|
|
47
|
-
|
|
48
|
-
)
|
|
49
|
-
|
|
44
|
+
const visibleProps = computed(() =>
|
|
45
|
+
Object.fromEntries(
|
|
46
|
+
Object.entries(props).filter(([, value]) => typeof value !== 'undefined'),
|
|
47
|
+
),
|
|
48
|
+
);
|
|
50
49
|
</script>
|
|
51
50
|
|
|
52
51
|
<template>
|
|
53
|
-
<syn-button-group
|
|
54
|
-
|
|
55
|
-
v-bind="visibleProps"
|
|
56
|
-
ref="nativeElement"
|
|
57
|
-
>
|
|
58
|
-
<slot />
|
|
52
|
+
<syn-button-group v-bind="visibleProps" ref="nativeElement">
|
|
53
|
+
<slot></slot>
|
|
59
54
|
</syn-button-group>
|
|
60
55
|
</template>
|
|
@@ -42,31 +42,26 @@ defineExpose({
|
|
|
42
42
|
// Map attributes
|
|
43
43
|
const props = defineProps<{
|
|
44
44
|
/**
|
|
45
|
-
* Draws the card with sharp edges.
|
|
46
|
-
* Can be used e.g.
|
|
47
|
-
* when nesting multiple syn-cards to create hierarchy.
|
|
48
|
-
|
|
49
|
-
|
|
45
|
+
* Draws the card with sharp edges.
|
|
46
|
+
* Can be used e.g.
|
|
47
|
+
* when nesting multiple syn-cards to create hierarchy.
|
|
48
|
+
*/
|
|
49
|
+
sharp?: SynCard['sharp'];
|
|
50
50
|
}>();
|
|
51
51
|
|
|
52
52
|
// Make sure prop binding only forwards the props that are actually there.
|
|
53
53
|
// This is needed because :param="param" also adds an empty attribute
|
|
54
54
|
// when using web-components, which breaks optional arguments like size in SynInput
|
|
55
55
|
// @see https://github.com/vuejs/core/issues/5190#issuecomment-1003112498
|
|
56
|
-
const visibleProps = computed(() =>
|
|
57
|
-
Object
|
|
58
|
-
.entries(props)
|
|
59
|
-
|
|
60
|
-
)
|
|
61
|
-
|
|
56
|
+
const visibleProps = computed(() =>
|
|
57
|
+
Object.fromEntries(
|
|
58
|
+
Object.entries(props).filter(([, value]) => typeof value !== 'undefined'),
|
|
59
|
+
),
|
|
60
|
+
);
|
|
62
61
|
</script>
|
|
63
62
|
|
|
64
63
|
<template>
|
|
65
|
-
<syn-card
|
|
66
|
-
|
|
67
|
-
v-bind="visibleProps"
|
|
68
|
-
ref="nativeElement"
|
|
69
|
-
>
|
|
70
|
-
<slot />
|
|
64
|
+
<syn-card v-bind="visibleProps" ref="nativeElement">
|
|
65
|
+
<slot></slot>
|
|
71
66
|
</syn-card>
|
|
72
67
|
</template>
|
|
@@ -34,9 +34,12 @@
|
|
|
34
34
|
import { computed, ref } from 'vue';
|
|
35
35
|
import '@synergy-design-system/components/components/checkbox/checkbox.js';
|
|
36
36
|
|
|
37
|
-
import type {
|
|
38
|
-
|
|
39
|
-
} from '@synergy-design-system/components';
|
|
37
|
+
import type { SynBlurEvent } from '@synergy-design-system/components';
|
|
38
|
+
import type { SynChangeEvent } from '@synergy-design-system/components';
|
|
39
|
+
import type { SynFocusEvent } from '@synergy-design-system/components';
|
|
40
|
+
import type { SynInputEvent } from '@synergy-design-system/components';
|
|
41
|
+
import type { SynInvalidEvent } from '@synergy-design-system/components';
|
|
42
|
+
import type { SynCheckbox } from '@synergy-design-system/components';
|
|
40
43
|
|
|
41
44
|
// DOM Reference to the element
|
|
42
45
|
const nativeElement = ref<SynCheckbox>();
|
|
@@ -47,39 +50,39 @@ defineExpose({
|
|
|
47
50
|
|
|
48
51
|
// Map attributes
|
|
49
52
|
const props = defineProps<{
|
|
50
|
-
|
|
53
|
+
title?: SynCheckbox['title'];
|
|
51
54
|
|
|
52
55
|
/**
|
|
53
|
-
* The name of the checkbox, submitted as a name/value pair with form data.
|
|
54
|
-
|
|
55
|
-
|
|
56
|
+
* The name of the checkbox, submitted as a name/value pair with form data.
|
|
57
|
+
*/
|
|
58
|
+
name?: SynCheckbox['name'];
|
|
56
59
|
|
|
57
60
|
/**
|
|
58
|
-
* The current value of the checkbox, submitted as a name/value pair with form data.
|
|
59
|
-
|
|
60
|
-
|
|
61
|
+
* The current value of the checkbox, submitted as a name/value pair with form data.
|
|
62
|
+
*/
|
|
63
|
+
value?: SynCheckbox['value'];
|
|
61
64
|
|
|
62
65
|
/**
|
|
63
|
-
* The checkbox's size.
|
|
64
|
-
|
|
65
|
-
|
|
66
|
+
* The checkbox's size.
|
|
67
|
+
*/
|
|
68
|
+
size?: SynCheckbox['size'];
|
|
66
69
|
|
|
67
70
|
/**
|
|
68
|
-
* Disables the checkbox.
|
|
69
|
-
|
|
70
|
-
|
|
71
|
+
* Disables the checkbox.
|
|
72
|
+
*/
|
|
73
|
+
disabled?: SynCheckbox['disabled'];
|
|
71
74
|
|
|
72
75
|
/**
|
|
73
|
-
* Draws the checkbox in a checked state.
|
|
74
|
-
|
|
75
|
-
|
|
76
|
+
* Draws the checkbox in a checked state.
|
|
77
|
+
*/
|
|
78
|
+
checked?: SynCheckbox['checked'];
|
|
76
79
|
|
|
77
80
|
/**
|
|
78
81
|
* Draws the checkbox in an indeterminate state.
|
|
79
82
|
* This is usually applied to checkboxes that represents a "select
|
|
80
83
|
all/none" behavior when associated checkboxes have a mix of checked and unchecked states.
|
|
81
84
|
*/
|
|
82
|
-
|
|
85
|
+
indeterminate?: SynCheckbox['indeterminate'];
|
|
83
86
|
|
|
84
87
|
/**
|
|
85
88
|
* By default, form controls are associated with the nearest containing `<form>` element.
|
|
@@ -88,22 +91,22 @@ to place the form control outside of a form and associate it with the form that
|
|
|
88
91
|
* The form must be in
|
|
89
92
|
the same document or shadow root for this to work.
|
|
90
93
|
*/
|
|
91
|
-
|
|
94
|
+
form?: SynCheckbox['form'];
|
|
92
95
|
|
|
93
96
|
/**
|
|
94
|
-
* Makes the checkbox a required field.
|
|
95
|
-
|
|
96
|
-
|
|
97
|
+
* Makes the checkbox a required field.
|
|
98
|
+
*/
|
|
99
|
+
required?: SynCheckbox['required'];
|
|
97
100
|
|
|
98
101
|
/**
|
|
99
|
-
* The checkbox's help text.
|
|
100
|
-
* If you need to display HTML, use the `help-text` slot instead.
|
|
101
|
-
|
|
102
|
-
|
|
102
|
+
* The checkbox's help text.
|
|
103
|
+
* If you need to display HTML, use the `help-text` slot instead.
|
|
104
|
+
*/
|
|
105
|
+
helpText?: SynCheckbox['helpText'];
|
|
103
106
|
|
|
104
107
|
/**
|
|
105
|
-
* Support for two way data binding
|
|
106
|
-
|
|
108
|
+
* Support for two way data binding
|
|
109
|
+
*/
|
|
107
110
|
modelValue?: SynCheckbox['checked'];
|
|
108
111
|
}>();
|
|
109
112
|
|
|
@@ -111,42 +114,42 @@ the same document or shadow root for this to work.
|
|
|
111
114
|
// This is needed because :param="param" also adds an empty attribute
|
|
112
115
|
// when using web-components, which breaks optional arguments like size in SynInput
|
|
113
116
|
// @see https://github.com/vuejs/core/issues/5190#issuecomment-1003112498
|
|
114
|
-
const visibleProps = computed(() =>
|
|
115
|
-
Object
|
|
116
|
-
.entries(props)
|
|
117
|
-
|
|
118
|
-
)
|
|
117
|
+
const visibleProps = computed(() =>
|
|
118
|
+
Object.fromEntries(
|
|
119
|
+
Object.entries(props).filter(([, value]) => typeof value !== 'undefined'),
|
|
120
|
+
),
|
|
121
|
+
);
|
|
119
122
|
|
|
120
123
|
// Map events
|
|
121
124
|
defineEmits<{
|
|
122
125
|
/**
|
|
123
|
-
* Emitted when the checkbox loses focus.
|
|
124
|
-
|
|
126
|
+
* Emitted when the checkbox loses focus.
|
|
127
|
+
*/
|
|
125
128
|
'syn-blur': [e: SynBlurEvent];
|
|
126
129
|
|
|
127
130
|
/**
|
|
128
|
-
* Emitted when the checked state changes.
|
|
129
|
-
|
|
131
|
+
* Emitted when the checked state changes.
|
|
132
|
+
*/
|
|
130
133
|
'syn-change': [e: SynChangeEvent];
|
|
131
134
|
|
|
132
135
|
/**
|
|
133
|
-
* Emitted when the checkbox gains focus.
|
|
134
|
-
|
|
136
|
+
* Emitted when the checkbox gains focus.
|
|
137
|
+
*/
|
|
135
138
|
'syn-focus': [e: SynFocusEvent];
|
|
136
139
|
|
|
137
140
|
/**
|
|
138
|
-
* Emitted when the checkbox receives input.
|
|
139
|
-
|
|
141
|
+
* Emitted when the checkbox receives input.
|
|
142
|
+
*/
|
|
140
143
|
'syn-input': [e: SynInputEvent];
|
|
141
144
|
|
|
142
145
|
/**
|
|
143
|
-
* Emitted when the form control has been checked for validity and its constraints aren't satisfied.
|
|
144
|
-
|
|
146
|
+
* Emitted when the form control has been checked for validity and its constraints aren't satisfied.
|
|
147
|
+
*/
|
|
145
148
|
'syn-invalid': [e: SynInvalidEvent];
|
|
146
149
|
|
|
147
150
|
/**
|
|
148
|
-
* Support for two way data binding
|
|
149
|
-
|
|
151
|
+
* Support for two way data binding
|
|
152
|
+
*/
|
|
150
153
|
'update:modelValue': [newValue: SynCheckbox['checked']];
|
|
151
154
|
}>();
|
|
152
155
|
</script>
|
|
@@ -161,15 +164,23 @@ export type { SynInvalidEvent } from '@synergy-design-system/components';
|
|
|
161
164
|
|
|
162
165
|
<template>
|
|
163
166
|
<syn-checkbox
|
|
164
|
-
v-bind="visibleProps"
|
|
165
|
-
ref="nativeElement"
|
|
166
|
-
:checked="typeof props.modelValue !== 'undefined' ? props.modelValue : typeof props.checked !== 'undefined' ? props.checked : undefined"
|
|
167
167
|
@syn-blur="$emit('syn-blur', $event)"
|
|
168
168
|
@syn-change="$emit('syn-change', $event)"
|
|
169
169
|
@syn-focus="$emit('syn-focus', $event)"
|
|
170
|
-
@syn-input="
|
|
170
|
+
@syn-input="
|
|
171
|
+
$emit('update:modelValue', $event.target.checked);
|
|
172
|
+
$emit('syn-input', $event);
|
|
173
|
+
"
|
|
171
174
|
@syn-invalid="$emit('syn-invalid', $event)"
|
|
172
|
-
|
|
173
|
-
|
|
175
|
+
:checked="
|
|
176
|
+
typeof props.modelValue !== 'undefined'
|
|
177
|
+
? props.modelValue
|
|
178
|
+
: typeof props.checked !== 'undefined'
|
|
179
|
+
? props.checked
|
|
180
|
+
: undefined
|
|
181
|
+
"
|
|
182
|
+
v-bind="visibleProps"
|
|
183
|
+
ref="nativeElement">
|
|
184
|
+
<slot></slot>
|
|
174
185
|
</syn-checkbox>
|
|
175
186
|
</template>
|