Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pkp/pkp-lib#9658 Add large support for FieldSelect to be consistent w… #377

Merged
merged 1 commit into from
Jul 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 19 additions & 1 deletion src/components/Form/fields/FieldSelect.vue
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
:id="controlId"
v-model="currentValue"
class="pkpFormField__input pkpFormField--select__input"
:class="inputClasses"
:name="localizedName"
:aria-describedby="describedByIds"
:aria-invalid="errors && errors.length"
Expand Down Expand Up @@ -78,8 +79,21 @@ export default {
props: {
/** An optional object containing preset information. When preset information exists, a button will appear in the toolbar. */
options: Array,
/** One of `small`, `normal` or `large`. Default: `normal`. */
size: {
default: 'normal',
validator: function (value) {
return ['normal', 'large'].indexOf(value) !== -1;
},
},
},

computed: {
inputClasses() {
let classes = ['pkpFormField--select__input--size' + this.size];
return classes;
},

/**
* Get localized set of options
*
Expand All @@ -95,10 +109,14 @@ export default {
<style lang="less">
@import '../../../styles/_import';

.pkpFormField--select__input {
.pkpFormField--select__input--sizenormal {
width: 20em;
}

.pkpFormField--select__input--sizelarge {
width: 100%;
}

.pkpFormField--select__input:-moz-focusring {
color: transparent;
text-shadow: 0 0 0 @text;
Expand Down
1 change: 1 addition & 0 deletions src/components/Form/mocks/field-select-country.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ export default {
name: 'country',
component: 'field-select',
label: 'Country',
size: 'normal',
options: [
{
value: '',
Expand Down
Loading