Skip to content

Commit

Permalink
Fixed #6000 - Remove .p-fluid and add new fluid property
Browse files Browse the repository at this point in the history
  • Loading branch information
tugcekucukoglu committed Jul 2, 2024
1 parent f85d3a5 commit 544fe3f
Show file tree
Hide file tree
Showing 41 changed files with 183 additions and 49 deletions.
10 changes: 5 additions & 5 deletions packages/primevue/src/autocomplete/AutoComplete.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -501,6 +501,11 @@ export interface AutoCompleteProps {
* Index of the element in tabbing order.
*/
tabindex?: number | string | undefined;
/**
* Spans 100% width of the container when enabled.
* @defaultValue false
*/
fluid?: boolean;
/**
* Defines a string value that labels an interactive element.
*/
Expand Down Expand Up @@ -528,11 +533,6 @@ export interface AutoCompleteProps {
* @defaultValue false
*/
unstyled?: boolean;
/**
* Spans 100% width of the container when enabled.
* @defaultValue false
*/
fluid?: boolean;
}

/**
Expand Down
4 changes: 4 additions & 0 deletions packages/primevue/src/button/BaseButton.vue
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,10 @@ export default {
plain: {
type: Boolean,
default: false
},
fluid: {
type: Boolean,
default: false
}
},
style: ButtonStyle,
Expand Down
5 changes: 5 additions & 0 deletions packages/primevue/src/button/Button.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,11 @@ export interface ButtonProps extends ButtonHTMLAttributes {
* @defaultValue false
*/
plain?: boolean | undefined;
/**
* Spans 100% width of the container when enabled.
* @defaultValue false
*/
fluid?: boolean;
/**
* It generates scoped CSS variables using design tokens for the component.
*/
Expand Down
11 changes: 10 additions & 1 deletion packages/primevue/src/button/style/ButtonStyle.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,14 @@ const theme = ({ dt }) => `
font-weight: ${dt('button.label.font.weight')};
}
.p-button-fluid {
width: 100%;
}
.p-button-fluid.p-button-icon-only {
width: ${dt('button.icon.only.width')};
}
.p-button:not(:disabled):hover {
background: ${dt('button.primary.hover.background')};
border: 1px solid ${dt('button.primary.hover.border.color')};
Expand Down Expand Up @@ -607,7 +615,8 @@ const classes = {
'p-button-outlined': props.outlined,
'p-button-sm': props.size === 'small',
'p-button-lg': props.size === 'large',
'p-button-plain': props.plain
'p-button-plain': props.plain,
'p-button-fluid': props.fluid
}
],
loadingIcon: 'p-button-loading-icon',
Expand Down
10 changes: 5 additions & 5 deletions packages/primevue/src/cascadeselect/CascadeSelect.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -415,6 +415,11 @@ export interface CascadeSelectProps {
* Index of the element in tabbing order.
*/
tabindex?: number | string | undefined;
/**
* Spans 100% width of the container when enabled.
* @defaultValue false
*/
fluid?: boolean;
/**
* Establishes relationships between the component and label(s) where its value should be one or more element IDs.
*/
Expand Down Expand Up @@ -442,11 +447,6 @@ export interface CascadeSelectProps {
* @defaultValue false
*/
unstyled?: boolean;
/**
* Spans 100% width of the container when enabled.
* @defaultValue false
*/
fluid?: boolean;
}

/**
Expand Down
4 changes: 4 additions & 0 deletions packages/primevue/src/datepicker/BaseDatePicker.vue
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,10 @@ export default {
return { severity: 'secondary', text: true, rounded: true };
}
},
fluid: {
type: Boolean,
default: false
},
ariaLabelledby: {
type: String,
default: null
Expand Down
5 changes: 5 additions & 0 deletions packages/primevue/src/datepicker/DatePicker.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -784,6 +784,11 @@ export interface DatePickerProps {
* @defaultValue { severity: 'secondary', text: true }
*/
timepickerButtonProps?: object | undefined;
/**
* Spans 100% width of the container when enabled.
* @defaultValue false
*/
fluid?: boolean;
/**
* Establishes relationships between the component and label(s) where its value should be one or more element IDs.
*/
Expand Down
5 changes: 3 additions & 2 deletions packages/primevue/src/datepicker/style/DatePickerStyle.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,11 @@ const theme = ({ dt }) => `
color: ${dt('datepicker.input.icon.color')};
}
.p-fluid .p-datepicker {
.p-datepicker-fluid {
display: flex;
}
.p-fluid .p-datepicker-input {
.p-datepicker-fluid .p-datepicker-input {
width: 1%;
}
Expand Down Expand Up @@ -374,6 +374,7 @@ const classes = {
'p-datepicker p-component p-inputwrapper',
{
'p-invalid': props.invalid,
'p-datepicker-fluid': props.fluid,
'p-inputwrapper-filled': props.modelValue,
'p-inputwrapper-focus': state.focused,
'p-focus': state.focused || state.overlayVisible
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,6 @@ const theme = ({ dt }) => `
width: 0;
}
.p-fluid .p-inlinemessage {
display: flex;
}
.p-inlinemessage-info {
background: ${dt('inlinemessage.info.background')};
border: 1px solid ${dt('inlinemessage.info.border.color')};
Expand Down
4 changes: 0 additions & 4 deletions packages/primevue/src/inputchips/style/InputChipsStyle.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,6 @@ const theme = ({ dt }) => `
.p-inputchips-input-item input::placeholder {
color: ${dt('inputchips.placeholder.color')};
}
.p-fluid .p-inputchips {
display: flex;
}
`;

const classes = {
Expand Down
6 changes: 6 additions & 0 deletions packages/primevue/src/inputgroup/BaseInputGroup.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ import InputGroupStyle from 'primevue/inputgroup/style';
export default {
name: 'BaseInputGroup',
extends: BaseComponent,
props: {
fluid: {
type: Boolean,
default: false
}
},
style: InputGroupStyle,
provide() {
return {
Expand Down
9 changes: 9 additions & 0 deletions packages/primevue/src/inputgroup/InputGroup.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ export interface InputGroupPassThroughMethodOptions {
* Defines instance.
*/
instance: any;
/**
* Defines valid properties.
*/
props: InputGroupProps;
/**
* Defines valid attributes.
*/
Expand Down Expand Up @@ -63,6 +67,11 @@ export interface InputGroupPassThroughAttributes {
* Defines valid properties in InputGroup component.
*/
export interface InputGroupProps {
/**
* Spans 100% width of the container when enabled.
* @defaultValue false
*/
fluid?: boolean;
/**
* It generates scoped CSS variables using design tokens for the component.
*/
Expand Down
15 changes: 10 additions & 5 deletions packages/primevue/src/inputgroup/style/InputGroupStyle.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ const theme = ({ dt }) => `
}
.p-inputgroup .p-inputtext,
.p-fluid .p-inputgroup .p-inputtext,
.p-inputgroup-fluid .p-inputtext,
.p-inputgroup .p-inputwrapper,
.p-fluid .p-inputgroup .p-input {
.p-inputgroup-fluid .p-input {
flex: 1 1 auto;
width: 1%;
}
Expand Down Expand Up @@ -92,17 +92,22 @@ const theme = ({ dt }) => `
border-bottom-right-radius: ${dt('inputgroup.addon.border.radius')};
}
.p-fluid .p-inputgroup .p-button {
.p-inputgroup-fluid .p-button {
width: auto;
}
.p-fluid .p-inputgroup .p-button.p-button-icon-only {
.p-inputgroup-fluid .p-button.p-button-icon-only {
width: 2.5rem;
}
`;

const classes = {
root: 'p-inputgroup'
root: ({ props }) => [
'p-inputgroup',
{
'p-inputgroup-fluid': props.fluid
}
]
};

export default BaseStyle.extend({
Expand Down
4 changes: 4 additions & 0 deletions packages/primevue/src/inputmask/BaseInputMask.vue
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ export default {
variant: {
type: String,
default: null
},
fluid: {
type: Boolean,
default: false
}
},
style: InputMaskStyle,
Expand Down
5 changes: 5 additions & 0 deletions packages/primevue/src/inputmask/InputMask.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,11 @@ export interface InputMaskProps {
* @defaultValue outlined
*/
variant?: 'outlined' | 'filled' | undefined;
/**
* Spans 100% width of the container when enabled.
* @defaultValue false
*/
fluid?: boolean;
/**
* When present, it specifies that the component should be disabled.
* @defaultValue false
Expand Down
1 change: 1 addition & 0 deletions packages/primevue/src/inputmask/InputMask.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
:invalid="invalid"
:variant="variant"
:placeholder="placeholder"
:fluid="fluid"
:unstyled="unstyled"
@input="onInput"
@focus="onFocus"
Expand Down
4 changes: 4 additions & 0 deletions packages/primevue/src/inputnumber/BaseInputNumber.vue
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,10 @@ export default {
type: String,
default: null
},
fluid: {
type: Boolean,
default: false
},
inputId: {
type: String,
default: null
Expand Down
5 changes: 5 additions & 0 deletions packages/primevue/src/inputnumber/InputNumber.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,11 @@ export interface InputNumberProps {
* Placeholder text for the input.
*/
placeholder?: string | undefined;
/**
* Spans 100% width of the container when enabled.
* @defaultValue false
*/
fluid?: boolean;
/**
* Identifier of the focus input to match a label defined for the chips.
*/
Expand Down
9 changes: 5 additions & 4 deletions packages/primevue/src/inputnumber/style/InputNumberStyle.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,15 +131,15 @@ const theme = ({ dt }) => `
flex: 1 1 auto;
}
.p-fluid .p-inputnumber {
.p-inputnumber-fluid {
width: 100%;
}
.p-fluid .p-inputnumber .p-inputnumber-input {
.p-inputnumber-fluid .p-inputnumber-input {
width: 1%;
}
.p-fluid .p-inputnumber-vertical .p-inputnumber-input {
.p-inputnumber-fluid.p-inputnumber-vertical .p-inputnumber-input {
width: 100%;
}
`;
Expand All @@ -152,7 +152,8 @@ const classes = {
'p-inputwrapper-focus': instance.focused,
'p-inputnumber-stacked': props.showButtons && props.buttonLayout === 'stacked',
'p-inputnumber-horizontal': props.showButtons && props.buttonLayout === 'horizontal',
'p-inputnumber-vertical': props.showButtons && props.buttonLayout === 'vertical'
'p-inputnumber-vertical': props.showButtons && props.buttonLayout === 'vertical',
'p-inputnumber-fluid': instance.fluid
}
],
pcInput: 'p-inputnumber-input',
Expand Down
4 changes: 4 additions & 0 deletions packages/primevue/src/inputtext/BaseInputText.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ export default {
variant: {
type: String,
default: null
},
fluid: {
type: Boolean,
default: false
}
},
style: InputTextStyle,
Expand Down
5 changes: 5 additions & 0 deletions packages/primevue/src/inputtext/InputText.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,11 @@ export interface InputTextProps extends InputHTMLAttributes {
* @defaultValue outlined
*/
variant?: 'outlined' | 'filled' | undefined;
/**
* Spans 100% width of the container when enabled.
* @defaultValue false
*/
fluid?: boolean;
/**
* It generates scoped CSS variables using design tokens for the component.
*/
Expand Down
5 changes: 3 additions & 2 deletions packages/primevue/src/inputtext/style/InputTextStyle.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ const theme = ({ dt }) => `
padding: ${dt('inputtext.lg.padding.y')} ${dt('inputtext.lg.padding.x')};
}
.p-fluid .p-inputtext {
.p-inputtext-fluid {
width: 100%;
}
`;
Expand All @@ -74,7 +74,8 @@ const classes = {
'p-inputtext-sm': props.size === 'small',
'p-inputtext-lg': props.size === 'large',
'p-invalid': props.invalid,
'p-variant-filled': props.variant ? props.variant === 'filled' : instance.$primevue.config.inputStyle === 'filled' || instance.$primevue.config.inputVariant === 'filled'
'p-variant-filled': props.variant ? props.variant === 'filled' : instance.$primevue.config.inputStyle === 'filled' || instance.$primevue.config.inputVariant === 'filled',
'p-inputtext-fluid': props.fluid
}
]
};
Expand Down
9 changes: 8 additions & 1 deletion packages/primevue/src/multiselect/BaseMultiSelect.vue
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,14 @@ export default {
type: Boolean,
default: false
},
disabled: Boolean,
disabled: {
type: Boolean,
default: false
},
fluid: {
type: Boolean,
default: false
},
inputId: {
type: String,
default: null
Expand Down
5 changes: 5 additions & 0 deletions packages/primevue/src/multiselect/MultiSelect.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,11 @@ export interface MultiSelectProps {
* @defaultValue outlined
*/
variant?: 'outlined' | 'filled' | undefined;
/**
* Spans 100% width of the container when enabled.
* @defaultValue false
*/
fluid?: boolean;
/**
* Identifier of the underlying input element.
*/
Expand Down
Loading

0 comments on commit 544fe3f

Please sign in to comment.