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

240 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;
}
2024-04-06 20:52:27 +00:00
.p-autocomplete:has(.p-autocomplete-dropdown) .p-autocomplete-loader {
2024-02-20 21:37:50 +00:00
right: 3.25rem;
}
2024-04-06 20:52:27 +00:00
.p-autocomplete:has(.p-autocomplete-dropdown) .p-autocomplete-input {
2024-02-20 21:37:50 +00:00
flex: 1 1 auto;
width: 1%;
}
2024-04-06 20:52:27 +00:00
.p-autocomplete:has(.p-autocomplete-dropdown) .p-autocomplete-input,
.p-autocomplete:has(.p-autocomplete-dropdown) .p-autocomplete-chip-group {
2024-02-20 21:37:50 +00:00
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
}
2024-04-06 20:52:27 +00:00
.p-autocomplete .p-autocomplete-overlay {
2024-02-20 21:37:50 +00:00
min-width: 100%;
}
2024-04-06 20:52:27 +00:00
.p-autocomplete-overlay {
2024-02-20 21:37:50 +00:00
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);
}
2024-04-06 20:52:27 +00:00
.p-autocomplete-list {
2024-02-20 21:37:50 +00:00
margin: 0;
padding: 0;
list-style-type: none;
padding: 0.25rem 0.25rem;
}
2024-04-07 09:40:54 +00:00
.p-autocomplete-option {
2024-02-20 21:37:50 +00:00
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
}
2024-04-07 09:40:54 +00:00
.p-autocomplete-option:first-child {
2024-02-20 21:37:50 +00:00
margin-top: 0;
}
2024-04-07 09:40:54 +00:00
.p-autocomplete-option:last-child {
2024-02-20 21:37:50 +00:00
margin-bottom: 0;
}
2024-04-07 09:40:54 +00:00
.p-autocomplete-option:not(.p-autocomplete-option-selected):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
}
2024-04-07 09:40:54 +00:00
.p-autocomplete-option-selected {
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
}
2024-04-07 09:40:54 +00:00
.p-autocomplete-option-selected.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
}
2024-04-07 09:40:54 +00:00
.p-autocomplete-option-group {
2024-02-20 21:37:50 +00:00
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;
}
2024-04-06 20:52:27 +00:00
.p-autocomplete-chip-group {
2024-02-20 21:37:50 +00:00
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
}
2024-04-06 20:52:27 +00:00
.p-autocomplete:not(.p-disabled):hover .p-autocomplete-chip-group {
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
}
2024-04-06 20:52:27 +00:00
.p-autocomplete:not(.p-disabled).p-focus .p-autocomplete-chip-group {
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;
}
2024-04-06 20:52:27 +00:00
.p-autocomplete.p-invalid .p-autocomplete-chip-group {
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
}
2024-04-06 20:52:27 +00:00
.p-variant-filled.p-autocomplete-chip-group {
2024-03-13 11:59:34 +00:00
background: ${dt('autocomplete.input.multiple.filled.background')};
2024-02-20 21:37:50 +00:00
}
2024-04-06 20:52:27 +00:00
.p-autocomplete:not(.p-disabled).p-focus .p-variant-filled.p-autocomplete-chip-group {
2024-03-13 11:59:34 +00:00
background: ${dt('autocomplete.input.multiple.filled.focus.background')};
2024-02-20 21:37:50 +00:00
}
2024-04-06 20:52:27 +00:00
.p-autocomplete.p-disabled .p-autocomplete-chip-group {
2024-02-20 21:37:50 +00:00
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
}
2024-04-06 20:52:27 +00:00
.p-autocomplete-chip {
2024-02-20 21:37:50 +00:00
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
}
2024-04-06 20:52:27 +00:00
.p-autocomplete-chip.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
}
2024-04-06 20:52:27 +00:00
.p-autocomplete-chip-icon {
2024-02-20 21:37:50 +00:00
cursor: pointer;
margin-left: 0.375rem;
}
2024-04-06 20:52:27 +00:00
.p-autocomplete-input-chip {
flex: 1 1 auto;
display: inline-flex;
2024-02-20 21:37:50 +00:00
padding: 0.25rem 0;
margin-left: 0.5rem;
}
2024-04-06 20:52:27 +00:00
.p-autocomplete-input-chip input {
2024-02-20 21:37:50 +00:00
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;
}
2024-04-06 20:52:27 +00:00
.p-autocomplete-input-chip 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;
}
2024-04-06 20:52:27 +00:00
.p-fluid .p-autocomplete:has(.p-autocomplete-dropdown) .p-autocomplete-input {
2024-02-20 21:37:50 +00:00
width: 1%;
}
`
};