2023-11-02 12:48:32 +00:00
|
|
|
import BaseStyle from 'primevue/base/style';
|
|
|
|
|
2024-05-01 08:26:48 +00:00
|
|
|
const theme = ({ dt }) => `
|
|
|
|
.p-inputgroup {
|
|
|
|
display: flex;
|
|
|
|
align-items: stretch;
|
|
|
|
width: 100%;
|
|
|
|
}
|
|
|
|
|
2024-05-22 13:45:58 +00:00
|
|
|
.p-inputgroupaddon {
|
2024-05-01 08:26:48 +00:00
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
justify-content: center;
|
|
|
|
padding: 0.5rem;
|
|
|
|
background: ${dt('inputgroup.addon.background')};
|
|
|
|
color: ${dt('inputgroup.addon.color')};
|
|
|
|
border-top: 1px solid ${dt('inputgroup.addon.border.color')};
|
|
|
|
border-left: 1px solid ${dt('inputgroup.addon.border.color')};
|
|
|
|
border-bottom: 1px solid ${dt('inputgroup.addon.border.color')};
|
|
|
|
padding: 0.5rem 0.75rem;
|
|
|
|
min-width: 2.5rem;
|
|
|
|
}
|
|
|
|
|
2024-05-22 13:45:58 +00:00
|
|
|
.p-inputgroup .p-floatlabel {
|
2024-05-01 08:26:48 +00:00
|
|
|
display: flex;
|
|
|
|
align-items: stretch;
|
|
|
|
width: 100%;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-inputgroup .p-inputtext,
|
|
|
|
.p-fluid .p-inputgroup .p-inputtext,
|
|
|
|
.p-inputgroup .p-inputwrapper,
|
|
|
|
.p-fluid .p-inputgroup .p-input {
|
|
|
|
flex: 1 1 auto;
|
|
|
|
width: 1%;
|
|
|
|
}
|
|
|
|
|
2024-05-22 13:45:58 +00:00
|
|
|
.p-inputgroupaddon:last-child {
|
2024-05-01 08:26:48 +00:00
|
|
|
border-right: 1px solid ${dt('inputgroup.addon.border.color')};
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-inputgroup > .p-component,
|
|
|
|
.p-inputgroup > .p-inputwrapper > .p-inputtext,
|
2024-05-22 13:45:58 +00:00
|
|
|
.p-inputgroup > .p-floatlabel > .p-component {
|
2024-05-01 08:26:48 +00:00
|
|
|
border-radius: 0;
|
|
|
|
margin: 0;
|
|
|
|
}
|
|
|
|
|
2024-05-22 13:45:58 +00:00
|
|
|
.p-inputgroup > .p-component + .p-inputgroupaddon,
|
|
|
|
.p-inputgroup > .p-inputwrapper > .p-inputtext + .p-inputgroupaddon,
|
|
|
|
.p-inputgroup > .p-floatlabel > .p-component + .p-inputgroupaddon {
|
2024-05-01 08:26:48 +00:00
|
|
|
border-left: 0 none;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-inputgroup > .p-component:focus,
|
|
|
|
.p-inputgroup > .p-inputwrapper > .p-inputtext:focus,
|
2024-05-22 13:45:58 +00:00
|
|
|
.p-inputgroup > .p-floatlabel > .p-component:focus {
|
2024-05-01 08:26:48 +00:00
|
|
|
z-index: 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-inputgroup > .p-component:focus ~ label,
|
|
|
|
.p-inputgroup > .p-inputwrapper > .p-inputtext:focus~label,
|
2024-05-22 13:45:58 +00:00
|
|
|
.p-inputgroup > .p-floatlabel > .p-component:focus~label {
|
2024-05-01 08:26:48 +00:00
|
|
|
z-index: 1;
|
|
|
|
}
|
|
|
|
|
2024-05-22 13:45:58 +00:00
|
|
|
.p-inputgroupaddon:first-child,
|
2024-05-01 08:26:48 +00:00
|
|
|
.p-inputgroup button:first-child,
|
|
|
|
.p-inputgroup input:first-child,
|
|
|
|
.p-inputgroup > .p-inputwrapper:first-child,
|
|
|
|
.p-inputgroup > .p-inputwrapper:first-child > .p-inputtext {
|
2024-05-07 09:56:35 +00:00
|
|
|
border-top-left-radius: ${dt('inputgroup.addon.border.radius')};
|
|
|
|
border-bottom-left-radius: ${dt('inputgroup.addon.border.radius')};
|
2024-05-01 08:26:48 +00:00
|
|
|
}
|
|
|
|
|
2024-05-22 13:45:58 +00:00
|
|
|
.p-inputgroup .p-floatlabel:first-child input {
|
2024-05-07 09:56:35 +00:00
|
|
|
border-top-left-radius: ${dt('inputgroup.addon.border.radius')};
|
|
|
|
border-bottom-left-radius: ${dt('inputgroup.addon.border.radius')};
|
2024-05-01 08:26:48 +00:00
|
|
|
}
|
|
|
|
|
2024-05-22 13:45:58 +00:00
|
|
|
.p-inputgroupaddon:last-child,
|
2024-05-01 08:26:48 +00:00
|
|
|
.p-inputgroup button:last-child,
|
|
|
|
.p-inputgroup input:last-child,
|
|
|
|
.p-inputgroup > .p-inputwrapper:last-child,
|
|
|
|
.p-inputgroup > .p-inputwrapper:last-child > .p-inputtext {
|
2024-05-07 09:56:35 +00:00
|
|
|
border-top-right-radius: ${dt('inputgroup.addon.border.radius')};
|
|
|
|
border-bottom-right-radius: ${dt('inputgroup.addon.border.radius')};
|
2024-05-01 08:26:48 +00:00
|
|
|
}
|
|
|
|
|
2024-05-22 13:45:58 +00:00
|
|
|
.p-inputgroup .p-floatlabel:last-child input {
|
2024-05-07 09:56:35 +00:00
|
|
|
border-top-right-radius: ${dt('inputgroup.addon.border.radius')};
|
|
|
|
border-bottom-right-radius: ${dt('inputgroup.addon.border.radius')};
|
2024-05-01 08:26:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.p-fluid .p-inputgroup .p-button {
|
|
|
|
width: auto;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-fluid .p-inputgroup .p-button.p-button-icon-only {
|
|
|
|
width: 2.5rem;
|
|
|
|
}
|
|
|
|
`;
|
|
|
|
|
2023-11-02 12:48:32 +00:00
|
|
|
const classes = {
|
|
|
|
root: 'p-inputgroup'
|
|
|
|
};
|
|
|
|
|
|
|
|
export default BaseStyle.extend({
|
|
|
|
name: 'inputgroup',
|
2024-05-01 08:26:48 +00:00
|
|
|
theme,
|
2023-11-02 12:48:32 +00:00
|
|
|
classes
|
|
|
|
});
|