Init fluid refactor

pull/6011/head
Cagatay Civici 2024-07-02 11:09:44 +03:00
parent a6547b5e32
commit 2a63f6fcb9
7 changed files with 26 additions and 14 deletions

View File

@ -528,6 +528,11 @@ export interface AutoCompleteProps {
* @defaultValue false * @defaultValue false
*/ */
unstyled?: boolean; unstyled?: boolean;
/**
* Spans 100% width of the container when enabled.
* @defaultValue false
*/
fluid?: boolean;
} }
/** /**

View File

@ -178,6 +178,10 @@ export default {
ariaLabelledby: { ariaLabelledby: {
type: String, type: String,
default: null default: null
},
fluid: {
type: Boolean,
default: false
} }
}, },
style: AutoCompleteStyle, style: AutoCompleteStyle,

View File

@ -229,11 +229,11 @@ const theme = ({ dt }) => `
padding: ${dt('autocomplete.empty.message.padding')}; padding: ${dt('autocomplete.empty.message.padding')};
} }
.p-fluid .p-autocomplete { .p-autocomplete-fluid {
display: flex; display: flex;
} }
.p-fluid .p-autocomplete:has(.p-autocomplete-dropdown) .p-autocomplete-input { .p-autocomplete-fluid:has(.p-autocomplete-dropdown) .p-autocomplete-input {
width: 1%; width: 1%;
} }
`; `;
@ -251,7 +251,8 @@ const classes = {
'p-focus': instance.focused, 'p-focus': instance.focused,
'p-inputwrapper-filled': props.modelValue || isNotEmpty(instance.inputValue), 'p-inputwrapper-filled': props.modelValue || isNotEmpty(instance.inputValue),
'p-inputwrapper-focus': instance.focused, 'p-inputwrapper-focus': instance.focused,
'p-autocomplete-open': instance.overlayVisible 'p-autocomplete-open': instance.overlayVisible,
'p-autocomplete-fluid': props.fluid
} }
], ],
pcInput: 'p-autocomplete-input', pcInput: 'p-autocomplete-input',

View File

@ -78,14 +78,6 @@ const theme = ({ dt }) => `
font-weight: ${dt('button.label.font.weight')}; font-weight: ${dt('button.label.font.weight')};
} }
.p-fluid .p-button {
width: 100%;
}
.p-fluid .p-button-icon-only {
width: ${dt('button.icon.only.width')};
}
.p-button:not(:disabled):hover { .p-button:not(:disabled):hover {
background: ${dt('button.primary.hover.background')}; background: ${dt('button.primary.hover.background')};
border: 1px solid ${dt('button.primary.hover.border.color')}; border: 1px solid ${dt('button.primary.hover.border.color')};

View File

@ -131,6 +131,10 @@ export default {
ariaLabel: { ariaLabel: {
type: String, type: String,
default: null default: null
},
fluid: {
type: Boolean,
default: false
} }
}, },
style: CascadeSelectStyle, style: CascadeSelectStyle,

View File

@ -442,6 +442,11 @@ export interface CascadeSelectProps {
* @defaultValue false * @defaultValue false
*/ */
unstyled?: boolean; unstyled?: boolean;
/**
* Spans 100% width of the container when enabled.
* @defaultValue false
*/
fluid?: boolean;
} }
/** /**

View File

@ -87,11 +87,11 @@ const theme = ({ dt }) => `
visibility: hidden; visibility: hidden;
} }
.p-fluid .p-cascadeselect { .p-cascadeselect-fluid {
display: flex; display: flex;
} }
.p-fluid .p-cascadeselect .p-cascadeselect-label { .p-cascadeselect-fluid .p-cascadeselect-label {
width: 1%; width: 1%;
} }
@ -200,7 +200,8 @@ const classes = {
'p-focus': instance.focused, 'p-focus': instance.focused,
'p-inputwrapper-filled': props.modelValue, 'p-inputwrapper-filled': props.modelValue,
'p-inputwrapper-focus': instance.focused || instance.overlayVisible, 'p-inputwrapper-focus': instance.focused || instance.overlayVisible,
'p-cascadeselect-open': instance.overlayVisible 'p-cascadeselect-open': instance.overlayVisible,
'p-cascadeselect-fluid': props.fluid
} }
], ],
label: ({ instance, props }) => [ label: ({ instance, props }) => [