primevue-mirror/components/lib/themes/primeone/base/autocomplete/index.js

243 lines
6.8 KiB
JavaScript
Raw Normal View History

2024-02-20 21:37:50 +00:00
export default {
css: ({ dt }) => `
2024-02-20 21:37:50 +00:00
.p-autocomplete {
display: inline-flex;
}
.p-autocomplete-loader {
position: absolute;
top: 50%;
margin-top: -0.5rem;
right: 0.75rem;
}
.p-autocomplete-dd .p-autocomplete-loader {
right: 3.25rem;
}
.p-autocomplete-dd .p-autocomplete-input {
flex: 1 1 auto;
width: 1%;
}
.p-autocomplete-dd .p-autocomplete-input,
.p-autocomplete-dd .p-autocomplete-multiple-container {
border-top-right-radius: 0;
border-bottom-right-radius: 0;
}
.p-autocomplete-dropdown {
cursor: pointer;
display: inline-flex;
cursor: pointer;
user-select: none;
align-items: center;
justify-content: center;
overflow: hidden;
position: relative;
width: ${dt('autocomplete.dropdown.width')};
border-top-right-radius: ${dt('rounded.base')};
border-bottom-right-radius: ${dt('rounded.base')};
background: ${dt('autocomplete.dropdown.background')};
border: 1px solid ${dt('autocomplete.dropdown.border.color')};
border-left: 0 none;
background: ${dt('autocomplete.dropdown.background')};
transition: background-color ${dt('transition.duration')}, color ${dt('transition.duration')}, border-color ${dt('transition.duration')}, outline-color ${dt('transition.duration')};
outline-color: transparent;
}
.p-autocomplete-dropdown:not(:disabled):hover {
background: ${dt('autocomplete.dropdown.hover.background')};
border-color: ${dt('autocomplete.dropdown.hover.border.color')};
background: ${dt('autocomplete.dropdown.hover.background')};
}
.p-autocomplete-dropdown:not(:disabled):active {
background: ${dt('autocomplete.dropdown.active.background')};
border-color: ${dt('autocomplete.dropdown.active.border.color')};
background: ${dt('autocomplete.dropdown.active.background')};
}
.p-autocomplete-dropdown:focus-visible {
outline: ${dt('focus.ring.width')} ${dt('focus.ring.style')} ${dt('button.primary.background')};
outline-offset: ${dt('focus.ring.offset')};
2024-02-20 21:37:50 +00:00
}
.p-autocomplete .p-autocomplete-panel {
min-width: 100%;
}
.p-autocomplete-panel {
position: absolute;
overflow: auto;
top: 0;
left: 0;
2024-03-13 11:59:34 +00:00
background: ${dt('autocomplete.overlay.background')};
color: ${dt('autocomplete.overlay.color')};
border: 1px solid ${dt('autocomplete.overlay.border.color')};
border-radius: ${dt('rounded.base')};
2024-02-20 21:37:50 +00:00
box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
}
.p-autocomplete-items {
margin: 0;
padding: 0;
list-style-type: none;
padding: 0.25rem 0.25rem;
}
.p-autocomplete-item {
cursor: pointer;
white-space: nowrap;
position: relative;
overflow: hidden;
margin: 2px 0;
padding: 0.5rem 0.75rem;
border: 0 none;
2024-03-13 11:59:34 +00:00
color: ${dt('autocomplete.item.color')};
2024-02-20 21:37:50 +00:00
background: transparent;
transition: background-color ${dt('transition.duration')}, color ${dt('transition.duration')}, border-color ${dt('transition.duration')};
2024-03-13 11:59:34 +00:00
border-radius: ${dt('rounded.sm')};
2024-02-20 21:37:50 +00:00
}
.p-autocomplete-item:first-child {
margin-top: 0;
}
.p-autocomplete-item:last-child {
margin-bottom: 0;
}
.p-autocomplete-item:not(.p-highlight):not(.p-disabled).p-focus {
2024-03-13 11:59:34 +00:00
background: ${dt('autocomplete.item.focus.background')};
color: ${dt('autocomplete.item.focus.color')};
2024-02-20 21:37:50 +00:00
}
.p-autocomplete-item.p-highlight {
2024-03-13 11:59:34 +00:00
background: ${dt('autocomplete.item.selected.background')};
color: ${dt('autocomplete.item.selected.color')};
2024-02-20 21:37:50 +00:00
}
.p-autocomplete-item.p-highlight.p-focus {
2024-03-13 11:59:34 +00:00
background: ${dt('autocomplete.item.selected.focus.background')};
color: ${dt('autocomplete.item.selected.focus.color')};
2024-02-20 21:37:50 +00:00
}
.p-autocomplete-item-group {
margin: 0;
padding: 0.5rem 0.75rem;
2024-03-13 11:59:34 +00:00
color: ${dt('autocomplete.item.group.color')};
background: ${dt('autocomplete.item.group.background')};
2024-02-20 21:37:50 +00:00
font-weight: 600;
}
.p-autocomplete-multiple-container {
margin: 0;
padding: 0;
list-style-type: none;
cursor: text;
overflow: hidden;
display: flex;
align-items: center;
flex-wrap: wrap;
padding: 0.25rem 0.25rem;
gap: 0.25rem;
2024-03-13 11:59:34 +00:00
color: ${dt('autocomplete.input.multiple.color')};
background: ${dt('autocomplete.input.multiple.background')};
border: 1px solid ${dt('autocomplete.input.multiple.border.color')};
border-radius: ${dt('rounded.base')};
2024-02-20 21:37:50 +00:00
width: 100%;
transition: background-color ${dt('transition.duration')}, color ${dt('transition.duration')}, border-color ${dt('transition.duration')}, outline-color ${dt('transition.duration')};
2024-02-20 21:37:50 +00:00
outline-color: transparent;
2024-03-13 11:59:34 +00:00
box-shadow: ${dt('autocomplete.input.multiple.box.shadow')};
2024-02-20 21:37:50 +00:00
}
.p-autocomplete:not(.p-disabled):hover .p-autocomplete-multiple-container {
2024-03-13 11:59:34 +00:00
border-color: ${dt('autocomplete.input.multiple.hover.border.color')};
2024-02-20 21:37:50 +00:00
}
.p-autocomplete:not(.p-disabled).p-focus .p-autocomplete-multiple-container {
2024-03-13 11:59:34 +00:00
border-color: ${dt('autocomplete.input.multiple.focus.border.color')};
2024-02-20 21:37:50 +00:00
outline: 0 none;
}
.p-autocomplete.p-invalid .p-autocomplete-multiple-container {
2024-03-13 11:59:34 +00:00
border-color: ${dt('autocomplete.input.multiple.invalid.border.color')};
2024-02-20 21:37:50 +00:00
}
.p-variant-filled.p-autocomplete-multiple-container {
2024-03-13 11:59:34 +00:00
background: ${dt('autocomplete.input.multiple.filled.background')};
2024-02-20 21:37:50 +00:00
}
.p-autocomplete:not(.p-disabled).p-focus .p-variant-filled.p-autocomplete-multiple-container {
2024-03-13 11:59:34 +00:00
background: ${dt('autocomplete.input.multiple.filled.focus.background')};
2024-02-20 21:37:50 +00:00
}
.p-autocomplete.p-disabled .p-autocomplete-multiple-container {
opacity: 1;
2024-03-13 11:59:34 +00:00
background: ${dt('autocomplete.input.multiple.disabled.background')};
color: ${dt('autocomplete.input.multiple.disabled.color')};
2024-02-20 21:37:50 +00:00
}
.p-autocomplete-token {
cursor: default;
display: inline-flex;
align-items: center;
flex: 0 0 auto;
padding: 0.25rem 0.75rem;
2024-03-13 11:59:34 +00:00
background: ${dt('autocomplete.chip.background')};
color: ${dt('autocomplete.chip.color')};
border-radius: ${dt('rounded.sm')};
2024-02-20 21:37:50 +00:00
}
.p-autocomplete-token.p-focus {
2024-03-13 11:59:34 +00:00
background: ${dt('autocomplete.chip.focus.background')};
color: ${dt('autocomplete.chip.focus.color')};
2024-02-20 21:37:50 +00:00
}
.p-autocomplete-input-token {
flex: 1 1 auto;
display: inline-flex;
}
.p-autocomplete-token-icon {
cursor: pointer;
margin-left: 0.375rem;
}
.p-autocomplete-input-token {
padding: 0.25rem 0;
margin-left: 0.5rem;
}
.p-autocomplete-input-token input {
border: 0 none;
outline: 0 none;
background-color: transparent;
margin: 0;
padding: 0;
box-shadow: none;
border-radius: 0;
width: 100%;
font-family: inherit;
font-feature-settings: inherit;
font-size: 1rem;
color: inherit;
padding: 0;
margin: 0;
}
.p-autocomplete-input-token input::placeholder {
2024-03-13 11:59:34 +00:00
color: ${dt('autocomplete.input.multiple.placeholder.color')};
2024-02-20 21:37:50 +00:00
}
.p-fluid .p-autocomplete {
display: flex;
}
.p-fluid .p-autocomplete-dd .p-autocomplete-input {
width: 1%;
}
`
};