mirror of
https://github.com/thalikbussacro/graph-filter-builder.git
synced 2026-07-22 06:52:03 +00:00
painel flutuante no graph view com linhas estruturadas include/exclude por tag/path/file, autocomplete e escrita ao input de filtro nativo do obsidian.
264 lines
5.2 KiB
CSS
264 lines
5.2 KiB
CSS
/* ============= floating panel container ============= */
|
|
.gfb-floating {
|
|
position: absolute;
|
|
top: 16px;
|
|
left: 16px;
|
|
z-index: 10;
|
|
width: 340px;
|
|
font-size: var(--font-ui-small);
|
|
}
|
|
|
|
.gfb-floating.is-collapsed {
|
|
width: auto;
|
|
}
|
|
|
|
/* ============= expanded card ============= */
|
|
.gfb-card {
|
|
background: var(--background-secondary);
|
|
border: 1px solid var(--background-modifier-border);
|
|
border-radius: 8px;
|
|
overflow: hidden;
|
|
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
|
|
}
|
|
|
|
.gfb-floating.is-collapsed .gfb-card {
|
|
display: none;
|
|
}
|
|
|
|
/* header */
|
|
.gfb-header {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 6px;
|
|
padding: 8px 10px;
|
|
cursor: pointer;
|
|
user-select: none;
|
|
font-weight: 600;
|
|
}
|
|
|
|
.gfb-header:hover {
|
|
background: var(--background-modifier-hover);
|
|
}
|
|
|
|
.gfb-collapse-icon {
|
|
display: inline-block;
|
|
width: 14px;
|
|
text-align: center;
|
|
color: var(--text-muted);
|
|
font-size: 12px;
|
|
}
|
|
|
|
.gfb-title {
|
|
flex: 1;
|
|
}
|
|
|
|
.gfb-reload-btn {
|
|
background: transparent;
|
|
border: none;
|
|
padding: 4px;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
color: var(--text-muted);
|
|
cursor: pointer;
|
|
border-radius: 4px;
|
|
}
|
|
|
|
.gfb-reload-btn:hover {
|
|
color: var(--text-normal);
|
|
background: var(--background-modifier-hover);
|
|
}
|
|
|
|
.gfb-reload-btn svg {
|
|
width: 14px;
|
|
height: 14px;
|
|
}
|
|
|
|
/* body */
|
|
.gfb-body {
|
|
padding: 10px;
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: 8px;
|
|
border-top: 1px solid var(--background-modifier-border);
|
|
}
|
|
|
|
/* ============= collapsed icon button ============= */
|
|
.gfb-collapsed-btn {
|
|
display: none;
|
|
width: 36px;
|
|
height: 36px;
|
|
align-items: center;
|
|
justify-content: center;
|
|
background: var(--background-secondary);
|
|
border: 1px solid var(--background-modifier-border);
|
|
border-radius: 8px;
|
|
color: var(--text-normal);
|
|
cursor: pointer;
|
|
padding: 0;
|
|
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
|
|
}
|
|
|
|
.gfb-floating.is-collapsed .gfb-collapsed-btn {
|
|
display: flex;
|
|
}
|
|
|
|
.gfb-collapsed-btn:hover {
|
|
background: var(--background-modifier-hover);
|
|
color: var(--text-accent);
|
|
}
|
|
|
|
.gfb-collapsed-btn svg {
|
|
width: 18px;
|
|
height: 18px;
|
|
}
|
|
|
|
/* ============= lines ============= */
|
|
.gfb-lines {
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: 4px;
|
|
}
|
|
|
|
.gfb-line-row {
|
|
display: flex;
|
|
gap: 4px;
|
|
align-items: center;
|
|
}
|
|
|
|
/* Include / Exclude */
|
|
.gfb-incl-btn {
|
|
width: 70px;
|
|
flex-shrink: 0;
|
|
padding: 2px 0;
|
|
font-size: var(--font-ui-smaller);
|
|
font-weight: 500;
|
|
background: var(--background-primary);
|
|
color: var(--text-normal);
|
|
border: 1px solid var(--background-modifier-border);
|
|
border-radius: 4px;
|
|
}
|
|
|
|
.gfb-incl-btn:hover {
|
|
background: var(--background-modifier-hover);
|
|
}
|
|
|
|
/* Type select with custom chevron */
|
|
.gfb-line-type {
|
|
flex-shrink: 0;
|
|
width: 72px;
|
|
padding: 2px 18px 2px 6px;
|
|
font-size: var(--font-ui-smaller);
|
|
background-color: var(--background-primary);
|
|
color: var(--text-normal);
|
|
border: 1px solid var(--background-modifier-border);
|
|
border-radius: 4px;
|
|
appearance: none;
|
|
-webkit-appearance: none;
|
|
background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
|
|
background-position: right 4px center;
|
|
background-repeat: no-repeat;
|
|
}
|
|
|
|
/* Value input */
|
|
.gfb-line-value {
|
|
flex: 1;
|
|
min-width: 0;
|
|
font-family: var(--font-monospace);
|
|
font-size: var(--font-ui-smaller);
|
|
padding: 2px 6px;
|
|
}
|
|
|
|
.gfb-line-value:disabled {
|
|
opacity: 0.5;
|
|
cursor: not-allowed;
|
|
}
|
|
|
|
/* remove (trash) */
|
|
.gfb-remove-btn {
|
|
width: 28px;
|
|
height: 26px;
|
|
flex-shrink: 0;
|
|
padding: 0;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
background: transparent;
|
|
border: 1px solid transparent;
|
|
color: var(--text-muted);
|
|
border-radius: 4px;
|
|
}
|
|
|
|
.gfb-remove-btn:hover {
|
|
color: var(--text-error);
|
|
background: var(--background-modifier-hover);
|
|
}
|
|
|
|
.gfb-remove-btn svg {
|
|
width: 14px;
|
|
height: 14px;
|
|
}
|
|
|
|
/* ============= add button ============= */
|
|
.gfb-add-btn {
|
|
width: 100%;
|
|
font-size: var(--font-ui-smaller);
|
|
margin-top: 2px;
|
|
}
|
|
|
|
.gfb-add-btn::before {
|
|
content: "+ ";
|
|
}
|
|
|
|
/* ============= autocomplete ============= */
|
|
.gfb-autocomplete {
|
|
position: fixed;
|
|
z-index: 1100;
|
|
background: var(--background-primary);
|
|
border: 1px solid var(--background-modifier-border);
|
|
border-radius: 6px;
|
|
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
|
|
max-height: 240px;
|
|
overflow-y: auto;
|
|
min-width: 200px;
|
|
display: none;
|
|
}
|
|
|
|
.gfb-autocomplete.is-visible {
|
|
display: block;
|
|
}
|
|
|
|
/* ============= utility ============= */
|
|
/* Used to forcibly hide Obsidian's native search-suggestion popup that
|
|
reappears asynchronously after the filter input dispatches input events. */
|
|
.gfb-hidden {
|
|
display: none !important;
|
|
}
|
|
|
|
.gfb-ac-item {
|
|
display: flex;
|
|
justify-content: space-between;
|
|
align-items: center;
|
|
padding: 6px 10px;
|
|
cursor: pointer;
|
|
font-family: var(--font-monospace);
|
|
font-size: var(--font-ui-small);
|
|
}
|
|
|
|
.gfb-ac-item:hover,
|
|
.gfb-ac-item.is-selected {
|
|
background: var(--background-modifier-hover);
|
|
}
|
|
|
|
.gfb-ac-value {
|
|
flex: 1;
|
|
white-space: nowrap;
|
|
overflow: hidden;
|
|
text-overflow: ellipsis;
|
|
}
|
|
|
|
.gfb-ac-detail {
|
|
color: var(--text-muted);
|
|
font-size: 0.85em;
|
|
margin-left: 8px;
|
|
}
|