Add VSF list card layout: Neue Liste anlegen Karte
This commit is contained in:
+128
-42
@@ -12,56 +12,142 @@
|
||||
|
||||
<section id="layout-vsf-list-card">
|
||||
<p class="sg-preview-label">Layout: VSF List Card</p>
|
||||
<p class="sg-body">Diese Layout-Seite zeigt VSF-spezifische Statusvarianten der List Card als Grundlage fuer weitere Ausdifferenzierungen.</p>
|
||||
<p class="sg-body">Diese Layout-Seite zeigt VSF-spezifische List-Card-Layouts als Grundlage fuer weitere Ausdifferenzierungen.</p>
|
||||
|
||||
<h2 class="sg-sub-heading sg-section-h2">Status: Default</h2>
|
||||
<div class="sg-object-card-grid" aria-label="VSF List Card Status Default">
|
||||
<article class="sg-card sg-object-card" data-pattern="company-card" aria-label="VSF List Card Default">
|
||||
<header class="sg-card-segment sg-card-segment--header sg-card-segment--darkblue sg-object-card__header">
|
||||
<div class="sg-strong">Alphabet Inc.</div>
|
||||
<h2 class="sg-sub-heading sg-section-h2">Layout 1: Neue Liste anlegen Karte</h2>
|
||||
<div class="sg-object-card-grid" aria-label="VSF List Card Layout Neue Liste anlegen">
|
||||
<article class="sg-card sg-object-card" data-pattern="object-group-card" aria-label="Neue Liste anlegen Karte">
|
||||
<header class="sg-card-segment sg-card-segment--header sg-card-segment--darkblue sg-object-card__header" data-pattern-part="object-group-card-header">
|
||||
<div class="sg-strong">Neue Liste anlegen</div>
|
||||
</header>
|
||||
<div class="sg-card-segment sg-card-segment--body sg-card-segment--lightgrey">
|
||||
<p class="sg-body">Status-Referenz: Default</p>
|
||||
</div>
|
||||
</article>
|
||||
</div>
|
||||
<div class="sg-card-segment sg-card-segment--body sg-object-card__content" data-pattern-part="object-group-card-content">
|
||||
<form class="sg-form-sections-card" action="#" method="post" aria-label="Neue Liste anlegen Formular">
|
||||
<div class="sg-form-sections-card__field-group">
|
||||
<label class="sg-labeled-input-row">
|
||||
<span class="sg-label">Listentyp</span>
|
||||
<span class="sg-pulldown-demo" data-open="false" data-align="left" data-selection-mode="single" data-component="pulldown" data-component-context="form" data-component-state="inactive-selectable">
|
||||
<button class="sg-interaction-element sg-pulldown sg-pulldown-demo__trigger" type="button" aria-expanded="false" aria-label="Pulldown Listentyp" data-component-part="pulldown-trigger" data-label-base="Listentyp">
|
||||
Listentyp
|
||||
</button>
|
||||
<span class="sg-pulldown-panel" aria-label="Geoeffnetes Pulldown Listentyp" data-component-part="pulldown-panel">
|
||||
<ul class="sg-pulldown-option-list" aria-label="Listentyp Optionen">
|
||||
<li class="sg-pulldown-option" role="checkbox" aria-checked="false" data-pulldown-option><span>Watchlist</span></li>
|
||||
<li class="sg-pulldown-option" role="checkbox" aria-checked="false" data-pulldown-option><span>Portfolio</span></li>
|
||||
<li class="sg-pulldown-option" role="checkbox" aria-checked="false" data-pulldown-option><span>Screening</span></li>
|
||||
</ul>
|
||||
</span>
|
||||
</span>
|
||||
</label>
|
||||
|
||||
<h2 class="sg-sub-heading sg-section-h2">Status: Hover</h2>
|
||||
<div class="sg-object-card-grid" aria-label="VSF List Card Status Hover">
|
||||
<article class="sg-card sg-object-card" data-pattern="company-card" data-component-state="hover" aria-label="VSF List Card Hover">
|
||||
<header class="sg-card-segment sg-card-segment--header sg-card-segment--darkblue sg-object-card__header">
|
||||
<div class="sg-strong">Microsoft Corp.</div>
|
||||
</header>
|
||||
<div class="sg-card-segment sg-card-segment--body sg-card-segment--lightgrey">
|
||||
<p class="sg-body">Status-Referenz: Hover</p>
|
||||
</div>
|
||||
</article>
|
||||
</div>
|
||||
<label class="sg-labeled-input-row">
|
||||
<span class="sg-label">Name</span>
|
||||
<input
|
||||
class="sg-interaction-element sg-input-single-line sg-input-single-line--inactive-selectable sg-form-inactive-selectable"
|
||||
type="text"
|
||||
placeholder="Name eingeben"
|
||||
aria-label="Name"
|
||||
maxlength="80"
|
||||
>
|
||||
</label>
|
||||
|
||||
<h2 class="sg-sub-heading sg-section-h2">Status: Selected</h2>
|
||||
<div class="sg-object-card-grid" aria-label="VSF List Card Status Selected">
|
||||
<article class="sg-card sg-object-card" data-pattern="company-card" data-component-state="selected" aria-label="VSF List Card Selected">
|
||||
<header class="sg-card-segment sg-card-segment--header sg-card-segment--darkblue sg-object-card__header">
|
||||
<div class="sg-strong">Amazon.com, Inc.</div>
|
||||
</header>
|
||||
<div class="sg-card-segment sg-card-segment--body sg-card-segment--lightgrey">
|
||||
<p class="sg-body">Status-Referenz: Selected</p>
|
||||
</div>
|
||||
</article>
|
||||
</div>
|
||||
|
||||
<h2 class="sg-sub-heading sg-section-h2">Status: Disabled</h2>
|
||||
<div class="sg-object-card-grid" aria-label="VSF List Card Status Disabled">
|
||||
<article class="sg-card sg-object-card" data-pattern="company-card" data-component-state="disabled" aria-label="VSF List Card Disabled" aria-disabled="true">
|
||||
<header class="sg-card-segment sg-card-segment--header sg-card-segment--darkblue sg-object-card__header">
|
||||
<div class="sg-strong">Tesla, Inc.</div>
|
||||
</header>
|
||||
<div class="sg-card-segment sg-card-segment--body sg-card-segment--lightgrey">
|
||||
<p class="sg-body">Status-Referenz: Disabled</p>
|
||||
<label class="sg-labeled-input-row">
|
||||
<span class="sg-label">Beschreibung</span>
|
||||
<textarea
|
||||
class="sg-input-multi-line sg-form-inactive-selectable"
|
||||
rows="4"
|
||||
placeholder="Beschreibung eingeben"
|
||||
aria-label="Beschreibung"
|
||||
maxlength="350"
|
||||
></textarea>
|
||||
</label>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</article>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<script>
|
||||
const updatePulldownSelectionState = (demo) => {
|
||||
const trigger = demo.querySelector('.sg-pulldown-demo__trigger');
|
||||
const selectableOptions = demo.querySelectorAll('[data-pulldown-option]');
|
||||
|
||||
if (!trigger || selectableOptions.length === 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
const selectedCount = Array.from(selectableOptions).filter((option) => {
|
||||
return option.getAttribute('aria-checked') === 'true';
|
||||
}).length;
|
||||
const labelBase = trigger.dataset.labelBase || 'Auswahl';
|
||||
|
||||
trigger.textContent = selectedCount > 0 ? `${labelBase} (${selectedCount})` : labelBase;
|
||||
trigger.classList.toggle('sg-pulldown--selected', selectedCount > 0);
|
||||
trigger.classList.toggle('sg-form-active', selectedCount > 0);
|
||||
trigger.dataset.componentState = selectedCount > 0 ? 'selected' : 'inactive-selectable';
|
||||
demo.dataset.componentState = selectedCount > 0 ? 'selected' : 'inactive-selectable';
|
||||
};
|
||||
|
||||
document.querySelectorAll('.sg-pulldown-demo').forEach((demo) => {
|
||||
const trigger = demo.querySelector('.sg-pulldown-demo__trigger');
|
||||
if (!trigger) {
|
||||
return;
|
||||
}
|
||||
|
||||
trigger.addEventListener('click', (event) => {
|
||||
event.stopPropagation();
|
||||
const nextState = demo.dataset.open !== 'true';
|
||||
|
||||
document.querySelectorAll('.sg-pulldown-demo').forEach((otherDemo) => {
|
||||
const otherTrigger = otherDemo.querySelector('.sg-pulldown-demo__trigger');
|
||||
otherDemo.dataset.open = 'false';
|
||||
if (otherTrigger) {
|
||||
otherTrigger.setAttribute('aria-expanded', 'false');
|
||||
}
|
||||
});
|
||||
|
||||
demo.dataset.open = String(nextState);
|
||||
trigger.setAttribute('aria-expanded', String(nextState));
|
||||
});
|
||||
});
|
||||
|
||||
document.querySelectorAll('.sg-pulldown-option[data-pulldown-option]').forEach((option) => {
|
||||
option.addEventListener('click', (event) => {
|
||||
event.stopPropagation();
|
||||
const pulldownDemo = option.closest('.sg-pulldown-demo');
|
||||
if (!pulldownDemo) {
|
||||
return;
|
||||
}
|
||||
|
||||
pulldownDemo.querySelectorAll('[data-pulldown-option]').forEach((otherOption) => {
|
||||
otherOption.setAttribute('aria-checked', String(otherOption === option));
|
||||
});
|
||||
|
||||
updatePulldownSelectionState(pulldownDemo);
|
||||
const trigger = pulldownDemo.querySelector('.sg-pulldown-demo__trigger');
|
||||
pulldownDemo.dataset.open = 'false';
|
||||
if (trigger) {
|
||||
trigger.setAttribute('aria-expanded', 'false');
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
document.querySelectorAll('.sg-pulldown-demo').forEach(updatePulldownSelectionState);
|
||||
|
||||
document.addEventListener('click', (event) => {
|
||||
if (event.target.closest('.sg-pulldown-demo')) {
|
||||
return;
|
||||
}
|
||||
|
||||
document.querySelectorAll('.sg-pulldown-demo').forEach((demo) => {
|
||||
const trigger = demo.querySelector('.sg-pulldown-demo__trigger');
|
||||
demo.dataset.open = 'false';
|
||||
if (trigger) {
|
||||
trigger.setAttribute('aria-expanded', 'false');
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user