Skip to content

Commit

Permalink
Refactor #5176 - invalid property added
Browse files Browse the repository at this point in the history
  • Loading branch information
tugcekucukoglu committed Jan 30, 2024
1 parent b42c9eb commit a9a2549
Show file tree
Hide file tree
Showing 54 changed files with 198 additions and 12 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 @@ -350,6 +350,11 @@ export interface AutoCompleteProps {
* @defaultValue false
*/
loading?: boolean | undefined;
/**
* When present, it specifies that the component should have invalid state style.
* @defaultValue false
*/
invalid?: boolean | undefined;
/**
* When present, it specifies that the component should be disabled.
* @defaultValue false
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
},
invalid: {
type: Boolean,
default: false
},
disabled: {
type: Boolean,
default: false
Expand Down
1 change: 1 addition & 0 deletions components/lib/autocomplete/style/AutoCompleteStyle.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ const classes = {
'p-autocomplete p-component p-inputwrapper',
{
'p-disabled': props.disabled,
'p-invalid': props.invalid,
'p-focus': instance.focused,
'p-autocomplete-dd': props.dropdown,
'p-autocomplete-multiple': props.multiple,
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'
},
invalid: {
type: Boolean,
default: false
},
disabled: {
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 @@ -711,6 +711,11 @@ export interface CalendarProps {
* @defaultValue true
*/
manualInput?: boolean | undefined;
/**
* When present, it specifies that the component should have invalid state style.
* @defaultValue false
*/
invalid?: boolean | undefined;
/**
* When present, it specifies that the component should be disabled.
* @defaultValue false
Expand Down
1 change: 1 addition & 0 deletions components/lib/calendar/style/CalendarStyle.js
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ const classes = {
'p-input-icon-right': props.showIcon && props.iconDisplay === 'input',
'p-calendar-timeonly': props.timeOnly,
'p-calendar-disabled': props.disabled,
'p-invalid': props.invalid,
'p-inputwrapper-filled': props.modelValue,
'p-inputwrapper-focus': state.focused,
'p-focus': state.focused || state.overlayVisible
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,
invalid: {
type: Boolean,
default: false
},
disabled: Boolean,
dataKey: null,
inputId: {
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 @@ -271,6 +271,11 @@ export interface CascadeSelectProps {
* Default text to display when no option is selected.
*/
placeholder?: string | undefined;
/**
* When present, it specifies that the component should have invalid state style.
* @defaultValue false
*/
invalid?: boolean | undefined;
/**
* When present, it specifies that the component should be disabled.
* @defaultValue false
Expand Down
1 change: 1 addition & 0 deletions components/lib/cascadeselect/style/CascadeSelectStyle.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ const classes = {
'p-cascadeselect p-component p-inputwrapper',
{
'p-disabled': props.disabled,
'p-invalid': props.invalid,
'p-focus': instance.focused,
'p-inputwrapper-filled': props.modelValue,
'p-inputwrapper-focus': instance.focused || instance.overlayVisible,
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
},
invalid: {
type: Boolean,
default: false
},
disabled: {
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 @@ -111,6 +111,11 @@ export interface CheckboxProps {
* @default false
*/
binary?: boolean;
/**
* When present, it specifies that the component should have invalid state style.
* @defaultValue false
*/
invalid?: boolean | undefined;
/**
* When present, it specifies that the element should be disabled.
* @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 @@ -26,7 +26,8 @@ const classes = {
'p-checkbox p-component',
{
'p-highlight': instance.checked,
'p-disabled': props.disabled
'p-disabled': props.disabled,
'p-invalid': props.invalid
}
],
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
},
invalid: {
type: Boolean,
default: false
},
disabled: {
type: Boolean,
default: false
Expand Down
6 changes: 6 additions & 0 deletions components/lib/chips/Chips.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -184,8 +184,14 @@ export interface ChipsProps {
* @deprecated since v3.27.0. Use 'removetokenicon' slot.
*/
removeTokenIcon?: string | undefined;
/**
* When present, it specifies that the component should have invalid state style.
* @defaultValue false
*/
invalid?: boolean | undefined;
/**
* When present, it specifies that the element should be disabled.
* @defaultValue false
*/
disabled?: boolean | undefined;
/**
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 @@ -55,6 +55,7 @@ const classes = {
'p-chips p-component p-inputwrapper',
{
'p-disabled': props.disabled,
'p-invalid': props.invalid,
'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
},
invalid: {
type: Boolean,
default: false
},
disabled: {
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 @@ -319,6 +319,11 @@ export interface DropdownProps {
* Default text to display when no option is selected.
*/
placeholder?: string | undefined;
/**
* When present, it specifies that the component should have invalid state style.
* @defaultValue false
*/
invalid?: boolean | undefined;
/**
* When present, it specifies that the component should be disabled.
* @defaultValue false
Expand Down
1 change: 1 addition & 0 deletions components/lib/dropdown/style/DropdownStyle.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ const classes = {
'p-dropdown p-component p-inputwrapper',
{
'p-disabled': props.disabled,
'p-invalid': props.invalid,
'p-dropdown-clearable': props.showClear,
'p-focus': state.focused,
'p-inputwrapper-filled': instance.hasSelectedOption,
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
},
invalid: {
type: Boolean,
default: false
},
disabled: {
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 @@ -262,6 +262,11 @@ export interface InputNumberProps {
* @defaultValue false
*/
highlightOnFocus?: boolean | undefined;
/**
* When present, it specifies that the component should have invalid state style.
* @defaultValue false
*/
invalid?: boolean | undefined;
/**
* When present, it specifies that the component should be disabled.
* @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 @@ -113,7 +113,8 @@ const classes = {
'p-inputwrapper-focus': instance.focused,
'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-inputnumber-buttons-vertical': props.showButtons && props.buttonLayout === 'vertical',
'p-invalid': props.invalid
}
],
input: 'p-inputnumber-input',
Expand Down
4 changes: 4 additions & 0 deletions components/lib/inputswitch/BaseInputSwitch.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ export default {
type: null,
default: false
},
invalid: {
type: Boolean,
default: false
},
disabled: {
type: Boolean,
default: false
Expand Down
5 changes: 5 additions & 0 deletions components/lib/inputswitch/InputSwitch.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,11 @@ export interface InputSwitchProps {
* @defaultValue false
*/
falseValue?: any;
/**
* When present, it specifies that the component should have invalid state style.
* @defaultValue false
*/
invalid?: boolean | undefined;
/**
* When present, it specifies that the component should be disabled.
* @defaultValue false
Expand Down
3 changes: 2 additions & 1 deletion components/lib/inputswitch/style/InputSwitchStyle.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ const classes = {
'p-inputswitch p-component',
{
'p-highlight': instance.checked,
'p-disabled': props.disabled
'p-disabled': props.disabled,
'p-invalid': props.invalid
}
],
input: 'p-inputswitch-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 @@ -10,6 +10,10 @@ export default {
size: {
type: String,
default: null
},
invalid: {
type: Boolean,
default: false
}
},
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 @@ -91,6 +91,11 @@ export interface InputTextProps extends InputHTMLAttributes {
* Defines the size of the component.
*/
size?: 'small' | 'large' | undefined;
/**
* When present, it specifies that the component should have invalid state style.
* @defaultValue false
*/
invalid?: boolean | 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 @@ -6,7 +6,8 @@ const classes = {
{
'p-filled': instance.filled,
'p-inputtext-sm': props.size === 'small',
'p-inputtext-lg': props.size === 'large'
'p-inputtext-lg': props.size === 'large',
'p-invalid': props.invalid
}
]
};
Expand Down
4 changes: 4 additions & 0 deletions components/lib/listbox/BaseListbox.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ export default {
optionGroupLabel: null,
optionGroupChildren: null,
listStyle: null,
invalid: {
type: Boolean,
default: false
},
disabled: {
type: Boolean,
default: false
Expand Down
5 changes: 5 additions & 0 deletions components/lib/listbox/Listbox.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,11 @@ export interface ListboxProps {
* Inline style of inner list element.
*/
listStyle?: string | undefined;
/**
* When present, it specifies that the component should have invalid state style.
* @defaultValue false
*/
invalid?: boolean | undefined;
/**
* When specified, disables the component.
* @defaultValue false
Expand Down
3 changes: 2 additions & 1 deletion components/lib/listbox/style/ListboxStyle.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ const classes = {
root: ({ instance, props }) => [
'p-listbox p-component',
{
'p-disabled': props.disabled
'p-disabled': props.disabled,
'p-invalid': props.invalid
}
],
header: 'p-listbox-header',
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,
invalid: {
type: Boolean,
default: false
},
disabled: Boolean,
inputId: {
type: String,
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 @@ -331,6 +331,11 @@ export interface MultiSelectProps {
* Label to display when there are no selections.
*/
placeholder?: string | undefined;
/**
* When present, it specifies that the component should have invalid state style.
* @defaultValue false
*/
invalid?: boolean | undefined;
/**
* When present, it specifies that the component should be disabled.
* @defaultValue false
Expand Down
1 change: 1 addition & 0 deletions components/lib/multiselect/style/MultiSelectStyle.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ const classes = {
{
'p-multiselect-chip': props.display === 'chip',
'p-disabled': props.disabled,
'p-invalid': props.invalid,
'p-focus': instance.focused,
'p-inputwrapper-filled': props.modelValue && props.modelValue.length,
'p-inputwrapper-focus': instance.focused || instance.overlayVisible,
Expand Down
4 changes: 4 additions & 0 deletions components/lib/password/BasePassword.vue
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ export default {
type: String,
default: undefined
},
invalid: {
type: Boolean,
default: false
},
disabled: {
type: Boolean,
default: false
Expand Down
5 changes: 5 additions & 0 deletions components/lib/password/Password.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,11 @@ export interface PasswordProps extends InputHTMLAttributes {
* @deprecated since v3.27.0. Use 'showicon' slot.
*/
showIcon?: string | undefined;
/**
* When present, it specifies that the component should have invalid state style.
* @defaultValue false
*/
invalid?: boolean | undefined;
/**
* When present, it specifies that the component should be disabled.
* @defaultValue false
Expand Down
3 changes: 2 additions & 1 deletion components/lib/password/style/PasswordStyle.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ const classes = {
{
'p-inputwrapper-filled': instance.filled,
'p-inputwrapper-focus': instance.focused,
'p-input-icon-right': props.toggleMask
'p-input-icon-right': props.toggleMask,
'p-invalid': props.invalid
}
],
input: ({ props }) => [
Expand Down
4 changes: 4 additions & 0 deletions components/lib/radiobutton/BaseRadioButton.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ export default {
type: String,
default: null
},
invalid: {
type: Boolean,
default: false
},
disabled: {
type: Boolean,
default: false
Expand Down

0 comments on commit a9a2549

Please sign in to comment.