Skip to content

Commit

Permalink
Fixed #5176 - variant added
Browse files Browse the repository at this point in the history
  • Loading branch information
tugcekucukoglu committed Jan 31, 2024
1 parent d43ea02 commit ff22cfe
Show file tree
Hide file tree
Showing 45 changed files with 182 additions and 22 deletions.
5 changes: 5 additions & 0 deletions components/lib/autocomplete/AutoComplete.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,11 @@ export interface AutoCompleteProps {
* @defaultValue false
*/
disabled?: boolean | undefined;
/**
* Specifies the input variant of the component.
* @defaultValue outlined
*/
variant?: 'outlined' | 'filled' | undefined;
/**
* A property to uniquely identify an option.
*/
Expand Down
4 changes: 4 additions & 0 deletions components/lib/autocomplete/BaseAutoComplete.vue
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ export default {
type: Boolean,
default: false
},
variant: {
type: String,
default: 'outlined'
},
invalid: {
type: Boolean,
default: false
Expand Down
5 changes: 3 additions & 2 deletions components/lib/autocomplete/style/AutoCompleteStyle.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ const classes = {
{
'p-disabled': props.disabled,
'p-invalid': props.invalid,
'p-variant': props.variant === 'filled',
'p-focus': instance.focused,
'p-autocomplete-dd': props.dropdown,
'p-autocomplete-multiple': props.multiple,
Expand All @@ -127,10 +128,10 @@ const classes = {
inputToken: 'p-autocomplete-input-token',
loadingIcon: 'p-autocomplete-loader',
dropdownButton: 'p-autocomplete-dropdown',
panel: ({ instance }) => [
panel: ({ props, instance }) => [
'p-autocomplete-panel p-component',
{
'p-input-filled': instance.$primevue.config.inputStyle === 'filled',
'p-input-filled': props.variant === 'filled' || instance.$primevue.config.inputStyle === 'filled',
'p-ripple-disabled': instance.$primevue.config.ripple === false
}
],
Expand Down
4 changes: 4 additions & 0 deletions components/lib/calendar/BaseCalendar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,10 @@ export default {
type: [String, Object],
default: 'body'
},
variant: {
type: String,
default: 'outlined'
},
invalid: {
type: Boolean,
default: false
Expand Down
5 changes: 5 additions & 0 deletions components/lib/calendar/Calendar.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -721,6 +721,11 @@ export interface CalendarProps {
* @defaultValue false
*/
disabled?: boolean | undefined;
/**
* Specifies the input variant of the component.
* @defaultValue outlined
*/
variant?: 'outlined' | 'filled' | undefined;
/**
* When present, it specifies that an input field is read-only.
* @defaultValue false
Expand Down
3 changes: 2 additions & 1 deletion components/lib/calendar/style/CalendarStyle.js
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ const classes = {
'p-calendar-timeonly': props.timeOnly,
'p-calendar-disabled': props.disabled,
'p-invalid': props.invalid,
'p-variant': props.variant === 'filled',
'p-inputwrapper-filled': props.modelValue,
'p-inputwrapper-focus': state.focused,
'p-focus': state.focused || state.overlayVisible
Expand All @@ -186,7 +187,7 @@ const classes = {
'p-datepicker-monthpicker': state.currentView === 'month',
'p-datepicker-yearpicker': state.currentView === 'year',
'p-datepicker-touch-ui': props.touchUI,
'p-input-filled': instance.$primevue.config.inputStyle === 'filled',
'p-input-filled': props.variant === 'filled' || instance.$primevue.config.inputStyle === 'filled',
'p-ripple-disabled': instance.$primevue.config.ripple === false
}
],
Expand Down
4 changes: 4 additions & 0 deletions components/lib/cascadeselect/BaseCascadeSelect.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ export default {
optionGroupLabel: null,
optionGroupChildren: null,
placeholder: String,
variant: {
type: String,
default: 'outlined'
},
invalid: {
type: Boolean,
default: false
Expand Down
5 changes: 5 additions & 0 deletions components/lib/cascadeselect/CascadeSelect.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,11 @@ export interface CascadeSelectProps {
* @defaultValue false
*/
disabled?: boolean | undefined;
/**
* Specifies the input variant of the component.
* @defaultValue outlined
*/
variant?: 'outlined' | 'filled' | undefined;
/**
* A property to uniquely identify an option.
*/
Expand Down
5 changes: 3 additions & 2 deletions components/lib/cascadeselect/style/CascadeSelectStyle.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ const classes = {
{
'p-disabled': props.disabled,
'p-invalid': props.invalid,
'p-variant': props.variant === 'filled',
'p-focus': instance.focused,
'p-inputwrapper-filled': props.modelValue,
'p-inputwrapper-focus': instance.focused || instance.overlayVisible,
Expand All @@ -120,10 +121,10 @@ const classes = {
dropdownButton: 'p-cascadeselect-trigger',
loadingIcon: 'p-cascadeselect-trigger-icon',
dropdownIcon: 'p-cascadeselect-trigger-icon',
panel: ({ instance }) => [
panel: ({ props, instance }) => [
'p-cascadeselect-panel p-component',
{
'p-input-filled': instance.$primevue.config.inputStyle === 'filled',
'p-input-filled': props.variant === 'filled' || instance.$primevue.config.inputStyle === 'filled',
'p-ripple-disabled': instance.$primevue.config.ripple === false
}
],
Expand Down
4 changes: 4 additions & 0 deletions components/lib/checkbox/BaseCheckbox.vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ export default {
type: null,
default: false
},
variant: {
type: String,
default: 'outlined'
},
invalid: {
type: Boolean,
default: false
Expand Down
5 changes: 5 additions & 0 deletions components/lib/checkbox/Checkbox.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,11 @@ export interface CheckboxProps {
* @default false
*/
disabled?: boolean | undefined;
/**
* Specifies the input variant of the component.
* @defaultValue outlined
*/
variant?: 'outlined' | 'filled' | undefined;
/**
* When present, it specifies that an input field is read-only.
* @default false
Expand Down
3 changes: 2 additions & 1 deletion components/lib/checkbox/style/CheckboxStyle.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ const classes = {
{
'p-highlight': instance.checked,
'p-disabled': props.disabled,
'p-invalid': props.invalid
'p-invalid': props.invalid,
'p-variant': props.variant === 'filled'
}
],
box: 'p-checkbox-box',
Expand Down
4 changes: 4 additions & 0 deletions components/lib/chips/BaseChips.vue
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ export default {
type: String,
default: null
},
variant: {
type: String,
default: 'outlined'
},
invalid: {
type: Boolean,
default: false
Expand Down
5 changes: 5 additions & 0 deletions components/lib/chips/Chips.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,11 @@ export interface ChipsProps {
* @defaultValue false
*/
disabled?: boolean | undefined;
/**
* Specifies the input variant of the component.
* @defaultValue outlined
*/
variant?: 'outlined' | 'filled' | undefined;
/**
* Placeholder text for the input.
*/
Expand Down
1 change: 1 addition & 0 deletions components/lib/chips/style/ChipsStyle.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ const classes = {
{
'p-disabled': props.disabled,
'p-invalid': props.invalid,
'p-variant': props.variant === 'filled',
'p-focus': instance.focused,
'p-inputwrapper-filled': (props.modelValue && props.modelValue.length) || (instance.inputValue && instance.inputValue.length),
'p-inputwrapper-focus': instance.focused
Expand Down
4 changes: 4 additions & 0 deletions components/lib/dropdown/BaseDropdown.vue
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ export default {
type: String,
default: null
},
variant: {
type: String,
default: 'outlined'
},
invalid: {
type: Boolean,
default: false
Expand Down
5 changes: 5 additions & 0 deletions components/lib/dropdown/Dropdown.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,11 @@ export interface DropdownProps {
* @defaultValue false
*/
disabled?: boolean | undefined;
/**
* Specifies the input variant of the component.
* @defaultValue outlined
*/
variant?: 'outlined' | 'filled' | undefined;
/**
* A property to uniquely identify an option.
*/
Expand Down
5 changes: 3 additions & 2 deletions components/lib/dropdown/style/DropdownStyle.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ const classes = {
{
'p-disabled': props.disabled,
'p-invalid': props.invalid,
'p-variant': props.variant === 'filled',
'p-dropdown-clearable': props.showClear,
'p-focus': state.focused,
'p-inputwrapper-filled': instance.hasSelectedOption,
Expand All @@ -123,10 +124,10 @@ const classes = {
trigger: 'p-dropdown-trigger',
loadingicon: 'p-dropdown-trigger-icon',
dropdownIcon: 'p-dropdown-trigger-icon',
panel: ({ instance }) => [
panel: ({ props, instance }) => [
'p-dropdown-panel p-component',
{
'p-input-filled': instance.$primevue.config.inputStyle === 'filled',
'p-input-filled': props.variant === 'filled' || instance.$primevue.config.inputStyle === 'filled',
'p-ripple-disabled': instance.$primevue.config.ripple === false
}
],
Expand Down
8 changes: 8 additions & 0 deletions components/lib/inputmask/BaseInputMask.vue
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,14 @@ export default {
readonly: {
type: Boolean,
default: false
},
invalid: {
type: Boolean,
default: false
},
variant: {
type: String,
default: 'outlined'
}
},
style: InputMaskStyle
Expand Down
10 changes: 10 additions & 0 deletions components/lib/inputmask/InputMask.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,16 @@ export interface InputMaskProps {
* @defaultValue false
*/
readonly?: boolean | undefined;
/**
* When present, it specifies that the component should have invalid state style.
* @defaultValue false
*/
invalid?: boolean | undefined;
/**
* Specifies the input variant of the component.
* @defaultValue outlined
*/
variant?: 'outlined' | 'filled' | undefined;
/**
* Used to pass attributes to DOM elements inside the component.
* @type {InputMaskPassThroughOptions}
Expand Down
6 changes: 4 additions & 2 deletions components/lib/inputmask/style/InputMaskStyle.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
import BaseStyle from 'primevue/base/style';

const classes = {
root: ({ instance }) => [
root: ({ props, instance }) => [
'p-inputmask p-inputtext p-component',
{
'p-filled': instance.filled
'p-filled': instance.filled,
'p-invalid': props.invalid,
'p-variant': props.variant === 'filled'
}
]
};
Expand Down
4 changes: 4 additions & 0 deletions components/lib/inputnumber/BaseInputNumber.vue
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,10 @@ export default {
type: Boolean,
default: false
},
variant: {
type: String,
default: 'outlined'
},
invalid: {
type: Boolean,
default: false
Expand Down
5 changes: 5 additions & 0 deletions components/lib/inputnumber/InputNumber.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,11 @@ export interface InputNumberProps {
* @defaultValue false
*/
disabled?: boolean | undefined;
/**
* Specifies the input variant of the component.
* @defaultValue outlined
*/
variant?: 'outlined' | 'filled' | undefined;
/**
* When present, it specifies that an input field is read-only.
* @defaultValue false
Expand Down
3 changes: 2 additions & 1 deletion components/lib/inputnumber/style/InputNumberStyle.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,8 @@ const classes = {
'p-inputnumber-buttons-stacked': props.showButtons && props.buttonLayout === 'stacked',
'p-inputnumber-buttons-horizontal': props.showButtons && props.buttonLayout === 'horizontal',
'p-inputnumber-buttons-vertical': props.showButtons && props.buttonLayout === 'vertical',
'p-invalid': props.invalid
'p-invalid': props.invalid,
'p-variant': props.variant === 'filled'
}
],
input: 'p-inputnumber-input',
Expand Down
4 changes: 4 additions & 0 deletions components/lib/inputtext/BaseInputText.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ export default {
invalid: {
type: Boolean,
default: false
},
variant: {
type: String,
default: 'outlined'
}
},
style: InputTextStyle,
Expand Down
5 changes: 5 additions & 0 deletions components/lib/inputtext/InputText.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,11 @@ export interface InputTextProps extends InputHTMLAttributes {
* @defaultValue false
*/
invalid?: boolean | undefined;
/**
* Specifies the input variant of the component.
* @defaultValue outlined
*/
variant?: 'outlined' | 'filled' | undefined;
/**
* Used to pass attributes to DOM elements inside the component.
* @type {InputTextPassThroughOptions}
Expand Down
3 changes: 2 additions & 1 deletion components/lib/inputtext/style/InputTextStyle.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ const classes = {
'p-filled': instance.filled,
'p-inputtext-sm': props.size === 'small',
'p-inputtext-lg': props.size === 'large',
'p-invalid': props.invalid
'p-invalid': props.invalid,
'p-variant': props.variant === 'filled'
}
]
};
Expand Down
4 changes: 4 additions & 0 deletions components/lib/multiselect/BaseMultiSelect.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ export default {
default: '200px'
},
placeholder: String,
variant: {
type: String,
default: 'outlined'
},
invalid: {
type: Boolean,
default: false
Expand Down
5 changes: 5 additions & 0 deletions components/lib/multiselect/MultiSelect.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,11 @@ export interface MultiSelectProps {
* @defaultValue false
*/
disabled?: boolean | undefined;
/**
* Specifies the input variant of the component.
* @defaultValue outlined
*/
variant?: 'outlined' | 'filled' | undefined;
/**
* Identifier of the underlying input element.
*/
Expand Down
5 changes: 3 additions & 2 deletions components/lib/multiselect/style/MultiSelectStyle.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ const classes = {
'p-multiselect-chip': props.display === 'chip',
'p-disabled': props.disabled,
'p-invalid': props.invalid,
'p-variant': props.variant === 'filled',
'p-focus': instance.focused,
'p-inputwrapper-filled': props.modelValue && props.modelValue.length,
'p-inputwrapper-focus': instance.focused || instance.overlayVisible,
Expand All @@ -141,10 +142,10 @@ const classes = {
trigger: 'p-multiselect-trigger',
loadingIcon: 'p-multiselect-trigger-icon',
dropdownIcon: 'p-multiselect-trigger-icon',
panel: ({ instance }) => [
panel: ({ props, instance }) => [
'p-multiselect-panel p-component',
{
'p-input-filled': instance.$primevue.config.inputStyle === 'filled',
'p-input-filled': props.variant === 'filled' || instance.$primevue.config.inputStyle === 'filled',
'p-ripple-disabled': instance.$primevue.config.ripple === false
}
],
Expand Down

0 comments on commit ff22cfe

Please sign in to comment.