@masmarino/gabarit 4.1.2 → 4.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fesm2022/masmarino-gabarit-accordion.mjs +2 -2
- package/fesm2022/masmarino-gabarit-accordion.mjs.map +1 -1
- package/fesm2022/masmarino-gabarit-app-shell.mjs +2 -2
- package/fesm2022/masmarino-gabarit-app-shell.mjs.map +1 -1
- package/fesm2022/masmarino-gabarit-autocomplete.mjs +2 -2
- package/fesm2022/masmarino-gabarit-autocomplete.mjs.map +1 -1
- package/fesm2022/masmarino-gabarit-avatar-group.mjs +2 -2
- package/fesm2022/masmarino-gabarit-avatar-group.mjs.map +1 -1
- package/fesm2022/masmarino-gabarit-badge.mjs +2 -2
- package/fesm2022/masmarino-gabarit-badge.mjs.map +1 -1
- package/fesm2022/masmarino-gabarit-button.mjs +2 -2
- package/fesm2022/masmarino-gabarit-button.mjs.map +1 -1
- package/fesm2022/masmarino-gabarit-card.mjs +2 -2
- package/fesm2022/masmarino-gabarit-card.mjs.map +1 -1
- package/fesm2022/masmarino-gabarit-chart.mjs +6 -6
- package/fesm2022/masmarino-gabarit-chart.mjs.map +1 -1
- package/fesm2022/masmarino-gabarit-checkbox.mjs +2 -2
- package/fesm2022/masmarino-gabarit-checkbox.mjs.map +1 -1
- package/fesm2022/masmarino-gabarit-command-palette.mjs +4 -4
- package/fesm2022/masmarino-gabarit-command-palette.mjs.map +1 -1
- package/fesm2022/masmarino-gabarit-date-picker.mjs +4 -4
- package/fesm2022/masmarino-gabarit-date-picker.mjs.map +1 -1
- package/fesm2022/masmarino-gabarit-disclosure.mjs +2 -2
- package/fesm2022/masmarino-gabarit-disclosure.mjs.map +1 -1
- package/fesm2022/masmarino-gabarit-docs.mjs +4 -4
- package/fesm2022/masmarino-gabarit-docs.mjs.map +1 -1
- package/fesm2022/masmarino-gabarit-drawer.mjs +2 -2
- package/fesm2022/masmarino-gabarit-drawer.mjs.map +1 -1
- package/fesm2022/masmarino-gabarit-file-upload.mjs +2 -2
- package/fesm2022/masmarino-gabarit-file-upload.mjs.map +1 -1
- package/fesm2022/masmarino-gabarit-funnel-chart.mjs +2 -2
- package/fesm2022/masmarino-gabarit-funnel-chart.mjs.map +1 -1
- package/fesm2022/masmarino-gabarit-ground.mjs +349 -0
- package/fesm2022/masmarino-gabarit-ground.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-input.mjs +2 -2
- package/fesm2022/masmarino-gabarit-input.mjs.map +1 -1
- package/fesm2022/masmarino-gabarit-job-graph.mjs +2 -2
- package/fesm2022/masmarino-gabarit-job-graph.mjs.map +1 -1
- package/fesm2022/masmarino-gabarit-list-row.mjs +2 -2
- package/fesm2022/masmarino-gabarit-list-row.mjs.map +1 -1
- package/fesm2022/masmarino-gabarit-list-toolbar.mjs +2 -2
- package/fesm2022/masmarino-gabarit-list-toolbar.mjs.map +1 -1
- package/fesm2022/masmarino-gabarit-menu.mjs +2 -2
- package/fesm2022/masmarino-gabarit-menu.mjs.map +1 -1
- package/fesm2022/masmarino-gabarit-modal.mjs +2 -2
- package/fesm2022/masmarino-gabarit-modal.mjs.map +1 -1
- package/fesm2022/masmarino-gabarit-nav-tabs.mjs +2 -2
- package/fesm2022/masmarino-gabarit-nav-tabs.mjs.map +1 -1
- package/fesm2022/masmarino-gabarit-pagination.mjs +2 -2
- package/fesm2022/masmarino-gabarit-pagination.mjs.map +1 -1
- package/fesm2022/masmarino-gabarit-radio-group.mjs +2 -2
- package/fesm2022/masmarino-gabarit-radio-group.mjs.map +1 -1
- package/fesm2022/masmarino-gabarit-search-bar.mjs +2 -2
- package/fesm2022/masmarino-gabarit-search-bar.mjs.map +1 -1
- package/fesm2022/masmarino-gabarit-segmented-control.mjs +2 -2
- package/fesm2022/masmarino-gabarit-segmented-control.mjs.map +1 -1
- package/fesm2022/masmarino-gabarit-select.mjs +2 -2
- package/fesm2022/masmarino-gabarit-select.mjs.map +1 -1
- package/fesm2022/masmarino-gabarit-slider.mjs +2 -2
- package/fesm2022/masmarino-gabarit-slider.mjs.map +1 -1
- package/fesm2022/masmarino-gabarit-sparkline.mjs +2 -2
- package/fesm2022/masmarino-gabarit-sparkline.mjs.map +1 -1
- package/fesm2022/masmarino-gabarit-stat-tile.mjs +2 -2
- package/fesm2022/masmarino-gabarit-stat-tile.mjs.map +1 -1
- package/fesm2022/masmarino-gabarit-stepper.mjs +2 -2
- package/fesm2022/masmarino-gabarit-stepper.mjs.map +1 -1
- package/fesm2022/masmarino-gabarit-switch.mjs +2 -2
- package/fesm2022/masmarino-gabarit-switch.mjs.map +1 -1
- package/fesm2022/masmarino-gabarit-table.mjs +2 -2
- package/fesm2022/masmarino-gabarit-table.mjs.map +1 -1
- package/fesm2022/masmarino-gabarit-tabs.mjs +2 -2
- package/fesm2022/masmarino-gabarit-tabs.mjs.map +1 -1
- package/fesm2022/masmarino-gabarit-tag-input.mjs +2 -2
- package/fesm2022/masmarino-gabarit-tag-input.mjs.map +1 -1
- package/fesm2022/masmarino-gabarit-textarea.mjs +2 -2
- package/fesm2022/masmarino-gabarit-textarea.mjs.map +1 -1
- package/fesm2022/masmarino-gabarit-toaster.mjs +2 -2
- package/fesm2022/masmarino-gabarit-toaster.mjs.map +1 -1
- package/fesm2022/masmarino-gabarit-tree.mjs +2 -2
- package/fesm2022/masmarino-gabarit-tree.mjs.map +1 -1
- package/fesm2022/masmarino-gabarit.mjs +3 -2
- package/fesm2022/masmarino-gabarit.mjs.map +1 -1
- package/ground/package.json +4 -0
- package/package.json +5 -1
- package/src/lib/tokens/_a11y.scss +3 -2
- package/src/lib/tokens/_base.scss +1 -1
- package/src/lib/tokens/_glass.scss +37 -6
- package/src/lib/tokens/_grounds.scss +33 -0
- package/src/lib/tokens/_utilities.scss +1 -1
- package/types/masmarino-gabarit-ground.d.ts +233 -0
- package/types/masmarino-gabarit.d.ts +3 -2
|
@@ -202,7 +202,7 @@ var SegmentedControl = class SegmentedControl {
|
|
|
202
202
|
}],
|
|
203
203
|
ngImport: i0,
|
|
204
204
|
template: "@if (label()) {\n <span [id]=\"labelId\" class=\"gbt-segmented-control__label\">{{ label() }}</span>\n}\n<div\n #group\n class=\"gbt-segmented-control\"\n [class.gbt-segmented-control--sm]=\"size() === 'sm'\"\n [class.gbt-segmented-control--wrap]=\"wrap()\"\n [class.gbt-segmented-control--tinted]=\"tinted()\"\n [class.gbt-segmented-control--lens]=\"!!lens()\"\n role=\"radiogroup\"\n [attr.aria-label]=\"label() ? null : ariaLabel() || null\"\n [attr.aria-labelledby]=\"label() ? labelId : null\"\n>\n @if (lens(); as box) {\n <span\n class=\"gbt-segmented-control__lens\"\n [class.gbt-segmented-control__lens--glides]=\"lensGlides()\"\n aria-hidden=\"true\"\n [style.width.px]=\"box.width\"\n [style.height.px]=\"box.height\"\n [style.transform]=\"'translate(' + box.x + 'px, ' + box.y + 'px)'\"\n ></span>\n }\n @for (option of options(); track option.value; let i = $index) {\n <button\n type=\"button\"\n role=\"radio\"\n class=\"gbt-segmented-control__option\"\n [class.gbt-segmented-control__option--selected]=\"isSelected(option.value)\"\n [attr.aria-checked]=\"isSelected(option.value)\"\n [tabIndex]=\"isSelected(option.value) ? 0 : -1\"\n [disabled]=\"disabled() || !!option.disabled\"\n (click)=\"select(option)\"\n (keydown)=\"onKeydown($event, i)\"\n >\n {{ option.label }}\n </button>\n }\n</div>\n",
|
|
205
|
-
styles: [":host(.gbt-segmented-control-host--labelled){display:inline-block}:host(.gbt-segmented-control-host--full){display:block}.gbt-segmented-control__label{display:block;margin-bottom:.375rem;color:var(--text-secondary);font-size:.8125rem;font-weight:600}.gbt-segmented-control{position:relative;display:inline-flex;gap:2px;padding:2px;border-radius:999px;background:var(--gbt-glass-liquid);-webkit-backdrop-filter:var(--gbt-liquid-blur);backdrop-filter:var(--gbt-liquid-blur);box-shadow:var(--gbt-depth-liquid);--text-discret: var(--gbt-ground-text-discret);--border-color: var(--gbt-ground-border);--color-success-text: var(--color-success-bg-text);--color-warning-text: var(--color-warning-bg-text);--color-error-text: var(--color-error-bg-text);--text-secondary: var(--gbt-liquid-text);--text-discret: var(--gbt-liquid-text)}@media(prefers-reduced-transparency:reduce){.gbt-segmented-control{background:linear-gradient(var(--gbt-glass-thick),var(--gbt-glass-thick)),var(--bg-principal);-webkit-backdrop-filter:none;backdrop-filter:none}}@media(prefers-contrast:more){.gbt-segmented-control{box-shadow:inset 0 0 0 1px var(--border-color),var(--gbt-depth-liquid)}}.gbt-segmented-control{box-shadow:inset 0 1px 0 var(--gbt-liquid-rim-top),inset 0 -1px 0 var(--gbt-liquid-rim-bottom)}@media(prefers-contrast:more){.gbt-segmented-control{box-shadow:inset 0 0 0 1px var(--border-color),inset 0 1px 0 var(--gbt-liquid-rim-top),inset 0 -1px 0 var(--gbt-liquid-rim-bottom)}}.gbt-segmented-control__lens{position:absolute;top:0;left:0;border-radius:999px;background:var(--gbt-glass-liquid);-webkit-backdrop-filter:var(--gbt-liquid-blur);backdrop-filter:var(--gbt-liquid-blur);box-shadow:var(--gbt-depth-liquid);--text-discret: var(--gbt-ground-text-discret);--border-color: var(--gbt-ground-border);--color-success-text: var(--color-success-bg-text);--color-warning-text: var(--color-warning-bg-text);--color-error-text: var(--color-error-bg-text);--text-secondary: var(--gbt-liquid-text);--text-discret: var(--gbt-liquid-text)}@media(prefers-reduced-transparency:reduce){.gbt-segmented-control__lens{background:linear-gradient(var(--gbt-glass-thick),var(--gbt-glass-thick)),var(--bg-principal);-webkit-backdrop-filter:none;backdrop-filter:none}}@media(prefers-contrast:more){.gbt-segmented-control__lens{box-shadow:inset 0 0 0 1px var(--border-color),var(--gbt-depth-liquid)}}.gbt-segmented-control__lens{box-shadow:var(--gbt-depth-liquid),inset 0 -1px 0 var(--gbt-nested-low, transparent),inset 0 -2px 3px -1px var(--gbt-nested-low-soft, transparent),0 1px 3px var(--gbt-nested-contact, transparent);color:var(--text-primary);background-image:linear-gradient(var(--gbt-relief-highlight),var(--gbt-relief-highlight));pointer-events:none}@media(prefers-reduced-motion:no-preference){.gbt-segmented-control__lens--glides{transition:transform .6s linear(0,.089,.28,.494,.685,.834,.938,1.001,1.034,1.045,1.044,1.036,1.027,1.017,1.01,1.004,1.001,.999,.998 85%,1),width .6s linear(0,.089,.28,.494,.685,.834,.938,1.001,1.034,1.045,1.044,1.036,1.027,1.017,1.01,1.004,1.001,.999,.998 85%,1),height .6s linear(0,.089,.28,.494,.685,.834,.938,1.001,1.034,1.045,1.044,1.036,1.027,1.017,1.01,1.004,1.001,.999,.998 85%,1)}}.gbt-segmented-control__option{box-sizing:border-box;display:inline-flex;align-items:center;justify-content:center;min-height:calc(var(--gbt-control-height-sm) - 4px);padding:.375rem .75rem;background:none;border:none;position:relative;border-radius:999px;color:var(--text-secondary);font-size:13px;font-weight:600;cursor:pointer;transition:background .12s cubic-bezier(.4,0,.2,1),color .12s cubic-bezier(.4,0,.2,1)}.gbt-segmented-control__option:hover:not(:disabled):not(.gbt-segmented-control__option--selected){background:var(--bg-hover);color:var(--text-primary)}.gbt-segmented-control__option:active:not(:disabled):not(.gbt-segmented-control__option--selected){background:var(--bg-press);color:var(--text-primary)}.gbt-segmented-control__option:focus-visible{outline:2px solid var(--gbt-focus-ring, var(--focus-ring));outline-offset:2px}.gbt-segmented-control__option:disabled{cursor:not-allowed;opacity:.5}.gbt-segmented-control__option--selected{background:var(--gbt-glass-liquid);-webkit-backdrop-filter:var(--gbt-liquid-blur);backdrop-filter:var(--gbt-liquid-blur);box-shadow:var(--gbt-depth-liquid);--text-discret: var(--gbt-ground-text-discret);--border-color: var(--gbt-ground-border);--color-success-text: var(--color-success-bg-text);--color-warning-text: var(--color-warning-bg-text);--color-error-text: var(--color-error-bg-text);--text-secondary: var(--gbt-liquid-text);--text-discret: var(--gbt-liquid-text)}@media(prefers-reduced-transparency:reduce){.gbt-segmented-control__option--selected{background:linear-gradient(var(--gbt-glass-thick),var(--gbt-glass-thick)),var(--bg-principal);-webkit-backdrop-filter:none;backdrop-filter:none}}@media(prefers-contrast:more){.gbt-segmented-control__option--selected{box-shadow:inset 0 0 0 1px var(--border-color),var(--gbt-depth-liquid)}}.gbt-segmented-control__option--selected{box-shadow:var(--gbt-depth-liquid),inset 0 -1px 0 var(--gbt-nested-low, transparent),inset 0 -2px 3px -1px var(--gbt-nested-low-soft, transparent),0 1px 3px var(--gbt-nested-contact, transparent);color:var(--text-primary)}.gbt-segmented-control--lens .gbt-segmented-control__option--selected,.gbt-segmented-control--lens .gbt-segmented-control__option--selected:hover:not(:disabled),.gbt-segmented-control--lens .gbt-segmented-control__option--selected:active:not(:disabled){background:none;-webkit-backdrop-filter:none;backdrop-filter:none;box-shadow:none;transform:none;transition:color .12s cubic-bezier(.4,0,.2,1)}@media(prefers-reduced-motion:reduce){.gbt-segmented-control--lens .gbt-segmented-control__option--selected,.gbt-segmented-control--lens .gbt-segmented-control__option--selected:hover:not(:disabled),.gbt-segmented-control--lens .gbt-segmented-control__option--selected:active:not(:disabled){transition:none}}.gbt-segmented-control--tinted{background:var(--bg-track)}.gbt-segmented-control--sm .gbt-segmented-control__option{padding:.1875rem .625rem;font-size:12px}.gbt-segmented-control--wrap{flex-wrap:wrap}.gbt-segmented-control--wrap .gbt-segmented-control__option{white-space:nowrap}:host(.gbt-segmented-control-host--full) .gbt-segmented-control{display:flex}:host(.gbt-segmented-control-host--full) .gbt-segmented-control__option{flex:1 1 0;min-width:0}:host(.gbt-segmented-control-host--full) .gbt-segmented-control--wrap .gbt-segmented-control__option{flex:1 1 auto}@media(prefers-reduced-motion:reduce){.gbt-segmented-control__option{transition:none}}\n"],
|
|
205
|
+
styles: [":host(.gbt-segmented-control-host--labelled){display:inline-block}:host(.gbt-segmented-control-host--full){display:block}.gbt-segmented-control__label{display:block;margin-bottom:.375rem;color:var(--text-secondary);font-size:.8125rem;font-weight:600}.gbt-segmented-control{position:relative;display:inline-flex;gap:2px;padding:2px;border-radius:999px;background:var(--gbt-glass-liquid);-webkit-backdrop-filter:var(--gbt-liquid-blur);backdrop-filter:var(--gbt-liquid-blur);box-shadow:var(--gbt-depth-liquid);--text-discret: var(--gbt-ground-text-discret);--border-color: var(--gbt-ground-border);--color-success-text: var(--color-success-bg-text);--color-warning-text: var(--color-warning-bg-text);--color-error-text: var(--color-error-bg-text);--text-secondary: var(--gbt-liquid-text);--text-discret: var(--gbt-liquid-text)}@media(prefers-reduced-transparency:reduce){.gbt-segmented-control{background:linear-gradient(var(--gbt-glass-thick),var(--gbt-glass-thick)),var(--bg-principal);-webkit-backdrop-filter:none;backdrop-filter:none}}@media(prefers-contrast:more){.gbt-segmented-control{box-shadow:inset 0 0 0 1px var(--border-color),var(--gbt-depth-liquid)}}.gbt-segmented-control{box-shadow:inset 0 1px 0 var(--gbt-liquid-rim-top),inset 0 -1px 0 var(--gbt-liquid-rim-bottom)}@media(prefers-contrast:more){.gbt-segmented-control{box-shadow:inset 0 0 0 1px var(--border-color),inset 0 1px 0 var(--gbt-liquid-rim-top),inset 0 -1px 0 var(--gbt-liquid-rim-bottom)}}.gbt-segmented-control__lens{position:absolute;top:0;left:0;border-radius:999px;background:var(--gbt-glass-liquid);-webkit-backdrop-filter:var(--gbt-liquid-blur);backdrop-filter:var(--gbt-liquid-blur);box-shadow:var(--gbt-depth-liquid);--text-discret: var(--gbt-ground-text-discret);--border-color: var(--gbt-ground-border);--color-success-text: var(--color-success-bg-text);--color-warning-text: var(--color-warning-bg-text);--color-error-text: var(--color-error-bg-text);--text-secondary: var(--gbt-liquid-text);--text-discret: var(--gbt-liquid-text)}@media(prefers-reduced-transparency:reduce){.gbt-segmented-control__lens{background:linear-gradient(var(--gbt-glass-thick),var(--gbt-glass-thick)),var(--bg-principal);-webkit-backdrop-filter:none;backdrop-filter:none}}@media(prefers-contrast:more){.gbt-segmented-control__lens{box-shadow:inset 0 0 0 1px var(--border-color),var(--gbt-depth-liquid)}}.gbt-segmented-control__lens{box-shadow:var(--gbt-depth-liquid),inset 0 -1px 0 var(--gbt-nested-low, transparent),inset 0 -2px 3px -1px var(--gbt-nested-low-soft, transparent),0 1px 3px var(--gbt-nested-contact, transparent);color:var(--text-primary);background-image:linear-gradient(var(--gbt-relief-highlight),var(--gbt-relief-highlight));pointer-events:none}@media(prefers-reduced-motion:no-preference){.gbt-segmented-control__lens--glides{transition:transform .6s linear(0,.089,.28,.494,.685,.834,.938,1.001,1.034,1.045,1.044,1.036,1.027,1.017,1.01,1.004,1.001,.999,.998 85%,1),width .6s linear(0,.089,.28,.494,.685,.834,.938,1.001,1.034,1.045,1.044,1.036,1.027,1.017,1.01,1.004,1.001,.999,.998 85%,1),height .6s linear(0,.089,.28,.494,.685,.834,.938,1.001,1.034,1.045,1.044,1.036,1.027,1.017,1.01,1.004,1.001,.999,.998 85%,1)}}.gbt-segmented-control__option{box-sizing:border-box;display:inline-flex;align-items:center;justify-content:center;min-height:calc(var(--gbt-control-height-sm) - 4px);padding:.375rem .75rem;background:none;border:none;position:relative;border-radius:999px;color:var(--text-secondary);font-size:13px;font-weight:600;cursor:pointer;transition:background .12s cubic-bezier(.4,0,.2,1),color .12s cubic-bezier(.4,0,.2,1)}.gbt-segmented-control__option:hover:not(:disabled):not(.gbt-segmented-control__option--selected){background:var(--bg-hover);color:var(--text-primary)}.gbt-segmented-control__option:active:not(:disabled):not(.gbt-segmented-control__option--selected){background:var(--bg-press);color:var(--text-primary)}.gbt-segmented-control__option:focus-visible{outline:2px solid var(--gbt-focus-ring, var(--gbt-ground-accent, var(--focus-ring)));outline-offset:2px}.gbt-segmented-control__option:disabled{cursor:not-allowed;opacity:.5}.gbt-segmented-control__option--selected{background:var(--gbt-glass-liquid);-webkit-backdrop-filter:var(--gbt-liquid-blur);backdrop-filter:var(--gbt-liquid-blur);box-shadow:var(--gbt-depth-liquid);--text-discret: var(--gbt-ground-text-discret);--border-color: var(--gbt-ground-border);--color-success-text: var(--color-success-bg-text);--color-warning-text: var(--color-warning-bg-text);--color-error-text: var(--color-error-bg-text);--text-secondary: var(--gbt-liquid-text);--text-discret: var(--gbt-liquid-text)}@media(prefers-reduced-transparency:reduce){.gbt-segmented-control__option--selected{background:linear-gradient(var(--gbt-glass-thick),var(--gbt-glass-thick)),var(--bg-principal);-webkit-backdrop-filter:none;backdrop-filter:none}}@media(prefers-contrast:more){.gbt-segmented-control__option--selected{box-shadow:inset 0 0 0 1px var(--border-color),var(--gbt-depth-liquid)}}.gbt-segmented-control__option--selected{box-shadow:var(--gbt-depth-liquid),inset 0 -1px 0 var(--gbt-nested-low, transparent),inset 0 -2px 3px -1px var(--gbt-nested-low-soft, transparent),0 1px 3px var(--gbt-nested-contact, transparent);color:var(--text-primary)}.gbt-segmented-control--lens .gbt-segmented-control__option--selected,.gbt-segmented-control--lens .gbt-segmented-control__option--selected:hover:not(:disabled),.gbt-segmented-control--lens .gbt-segmented-control__option--selected:active:not(:disabled){background:none;-webkit-backdrop-filter:none;backdrop-filter:none;box-shadow:none;transform:none;transition:color .12s cubic-bezier(.4,0,.2,1)}@media(prefers-reduced-motion:reduce){.gbt-segmented-control--lens .gbt-segmented-control__option--selected,.gbt-segmented-control--lens .gbt-segmented-control__option--selected:hover:not(:disabled),.gbt-segmented-control--lens .gbt-segmented-control__option--selected:active:not(:disabled){transition:none}}.gbt-segmented-control--tinted{background:var(--bg-track)}.gbt-segmented-control--sm .gbt-segmented-control__option{padding:.1875rem .625rem;font-size:12px}.gbt-segmented-control--wrap{flex-wrap:wrap}.gbt-segmented-control--wrap .gbt-segmented-control__option{white-space:nowrap}:host(.gbt-segmented-control-host--full) .gbt-segmented-control{display:flex}:host(.gbt-segmented-control-host--full) .gbt-segmented-control__option{flex:1 1 0;min-width:0}:host(.gbt-segmented-control-host--full) .gbt-segmented-control--wrap .gbt-segmented-control__option{flex:1 1 auto}@media(prefers-reduced-motion:reduce){.gbt-segmented-control__option{transition:none}}\n"],
|
|
206
206
|
changeDetection: i0.ChangeDetectionStrategy.OnPush
|
|
207
207
|
});
|
|
208
208
|
};
|
|
@@ -223,7 +223,7 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
223
223
|
"[class.gbt-segmented-control-host--labelled]": "!!label()"
|
|
224
224
|
},
|
|
225
225
|
template: "@if (label()) {\n <span [id]=\"labelId\" class=\"gbt-segmented-control__label\">{{ label() }}</span>\n}\n<div\n #group\n class=\"gbt-segmented-control\"\n [class.gbt-segmented-control--sm]=\"size() === 'sm'\"\n [class.gbt-segmented-control--wrap]=\"wrap()\"\n [class.gbt-segmented-control--tinted]=\"tinted()\"\n [class.gbt-segmented-control--lens]=\"!!lens()\"\n role=\"radiogroup\"\n [attr.aria-label]=\"label() ? null : ariaLabel() || null\"\n [attr.aria-labelledby]=\"label() ? labelId : null\"\n>\n @if (lens(); as box) {\n <span\n class=\"gbt-segmented-control__lens\"\n [class.gbt-segmented-control__lens--glides]=\"lensGlides()\"\n aria-hidden=\"true\"\n [style.width.px]=\"box.width\"\n [style.height.px]=\"box.height\"\n [style.transform]=\"'translate(' + box.x + 'px, ' + box.y + 'px)'\"\n ></span>\n }\n @for (option of options(); track option.value; let i = $index) {\n <button\n type=\"button\"\n role=\"radio\"\n class=\"gbt-segmented-control__option\"\n [class.gbt-segmented-control__option--selected]=\"isSelected(option.value)\"\n [attr.aria-checked]=\"isSelected(option.value)\"\n [tabIndex]=\"isSelected(option.value) ? 0 : -1\"\n [disabled]=\"disabled() || !!option.disabled\"\n (click)=\"select(option)\"\n (keydown)=\"onKeydown($event, i)\"\n >\n {{ option.label }}\n </button>\n }\n</div>\n",
|
|
226
|
-
styles: [":host(.gbt-segmented-control-host--labelled){display:inline-block}:host(.gbt-segmented-control-host--full){display:block}.gbt-segmented-control__label{display:block;margin-bottom:.375rem;color:var(--text-secondary);font-size:.8125rem;font-weight:600}.gbt-segmented-control{position:relative;display:inline-flex;gap:2px;padding:2px;border-radius:999px;background:var(--gbt-glass-liquid);-webkit-backdrop-filter:var(--gbt-liquid-blur);backdrop-filter:var(--gbt-liquid-blur);box-shadow:var(--gbt-depth-liquid);--text-discret: var(--gbt-ground-text-discret);--border-color: var(--gbt-ground-border);--color-success-text: var(--color-success-bg-text);--color-warning-text: var(--color-warning-bg-text);--color-error-text: var(--color-error-bg-text);--text-secondary: var(--gbt-liquid-text);--text-discret: var(--gbt-liquid-text)}@media(prefers-reduced-transparency:reduce){.gbt-segmented-control{background:linear-gradient(var(--gbt-glass-thick),var(--gbt-glass-thick)),var(--bg-principal);-webkit-backdrop-filter:none;backdrop-filter:none}}@media(prefers-contrast:more){.gbt-segmented-control{box-shadow:inset 0 0 0 1px var(--border-color),var(--gbt-depth-liquid)}}.gbt-segmented-control{box-shadow:inset 0 1px 0 var(--gbt-liquid-rim-top),inset 0 -1px 0 var(--gbt-liquid-rim-bottom)}@media(prefers-contrast:more){.gbt-segmented-control{box-shadow:inset 0 0 0 1px var(--border-color),inset 0 1px 0 var(--gbt-liquid-rim-top),inset 0 -1px 0 var(--gbt-liquid-rim-bottom)}}.gbt-segmented-control__lens{position:absolute;top:0;left:0;border-radius:999px;background:var(--gbt-glass-liquid);-webkit-backdrop-filter:var(--gbt-liquid-blur);backdrop-filter:var(--gbt-liquid-blur);box-shadow:var(--gbt-depth-liquid);--text-discret: var(--gbt-ground-text-discret);--border-color: var(--gbt-ground-border);--color-success-text: var(--color-success-bg-text);--color-warning-text: var(--color-warning-bg-text);--color-error-text: var(--color-error-bg-text);--text-secondary: var(--gbt-liquid-text);--text-discret: var(--gbt-liquid-text)}@media(prefers-reduced-transparency:reduce){.gbt-segmented-control__lens{background:linear-gradient(var(--gbt-glass-thick),var(--gbt-glass-thick)),var(--bg-principal);-webkit-backdrop-filter:none;backdrop-filter:none}}@media(prefers-contrast:more){.gbt-segmented-control__lens{box-shadow:inset 0 0 0 1px var(--border-color),var(--gbt-depth-liquid)}}.gbt-segmented-control__lens{box-shadow:var(--gbt-depth-liquid),inset 0 -1px 0 var(--gbt-nested-low, transparent),inset 0 -2px 3px -1px var(--gbt-nested-low-soft, transparent),0 1px 3px var(--gbt-nested-contact, transparent);color:var(--text-primary);background-image:linear-gradient(var(--gbt-relief-highlight),var(--gbt-relief-highlight));pointer-events:none}@media(prefers-reduced-motion:no-preference){.gbt-segmented-control__lens--glides{transition:transform .6s linear(0,.089,.28,.494,.685,.834,.938,1.001,1.034,1.045,1.044,1.036,1.027,1.017,1.01,1.004,1.001,.999,.998 85%,1),width .6s linear(0,.089,.28,.494,.685,.834,.938,1.001,1.034,1.045,1.044,1.036,1.027,1.017,1.01,1.004,1.001,.999,.998 85%,1),height .6s linear(0,.089,.28,.494,.685,.834,.938,1.001,1.034,1.045,1.044,1.036,1.027,1.017,1.01,1.004,1.001,.999,.998 85%,1)}}.gbt-segmented-control__option{box-sizing:border-box;display:inline-flex;align-items:center;justify-content:center;min-height:calc(var(--gbt-control-height-sm) - 4px);padding:.375rem .75rem;background:none;border:none;position:relative;border-radius:999px;color:var(--text-secondary);font-size:13px;font-weight:600;cursor:pointer;transition:background .12s cubic-bezier(.4,0,.2,1),color .12s cubic-bezier(.4,0,.2,1)}.gbt-segmented-control__option:hover:not(:disabled):not(.gbt-segmented-control__option--selected){background:var(--bg-hover);color:var(--text-primary)}.gbt-segmented-control__option:active:not(:disabled):not(.gbt-segmented-control__option--selected){background:var(--bg-press);color:var(--text-primary)}.gbt-segmented-control__option:focus-visible{outline:2px solid var(--gbt-focus-ring, var(--focus-ring));outline-offset:2px}.gbt-segmented-control__option:disabled{cursor:not-allowed;opacity:.5}.gbt-segmented-control__option--selected{background:var(--gbt-glass-liquid);-webkit-backdrop-filter:var(--gbt-liquid-blur);backdrop-filter:var(--gbt-liquid-blur);box-shadow:var(--gbt-depth-liquid);--text-discret: var(--gbt-ground-text-discret);--border-color: var(--gbt-ground-border);--color-success-text: var(--color-success-bg-text);--color-warning-text: var(--color-warning-bg-text);--color-error-text: var(--color-error-bg-text);--text-secondary: var(--gbt-liquid-text);--text-discret: var(--gbt-liquid-text)}@media(prefers-reduced-transparency:reduce){.gbt-segmented-control__option--selected{background:linear-gradient(var(--gbt-glass-thick),var(--gbt-glass-thick)),var(--bg-principal);-webkit-backdrop-filter:none;backdrop-filter:none}}@media(prefers-contrast:more){.gbt-segmented-control__option--selected{box-shadow:inset 0 0 0 1px var(--border-color),var(--gbt-depth-liquid)}}.gbt-segmented-control__option--selected{box-shadow:var(--gbt-depth-liquid),inset 0 -1px 0 var(--gbt-nested-low, transparent),inset 0 -2px 3px -1px var(--gbt-nested-low-soft, transparent),0 1px 3px var(--gbt-nested-contact, transparent);color:var(--text-primary)}.gbt-segmented-control--lens .gbt-segmented-control__option--selected,.gbt-segmented-control--lens .gbt-segmented-control__option--selected:hover:not(:disabled),.gbt-segmented-control--lens .gbt-segmented-control__option--selected:active:not(:disabled){background:none;-webkit-backdrop-filter:none;backdrop-filter:none;box-shadow:none;transform:none;transition:color .12s cubic-bezier(.4,0,.2,1)}@media(prefers-reduced-motion:reduce){.gbt-segmented-control--lens .gbt-segmented-control__option--selected,.gbt-segmented-control--lens .gbt-segmented-control__option--selected:hover:not(:disabled),.gbt-segmented-control--lens .gbt-segmented-control__option--selected:active:not(:disabled){transition:none}}.gbt-segmented-control--tinted{background:var(--bg-track)}.gbt-segmented-control--sm .gbt-segmented-control__option{padding:.1875rem .625rem;font-size:12px}.gbt-segmented-control--wrap{flex-wrap:wrap}.gbt-segmented-control--wrap .gbt-segmented-control__option{white-space:nowrap}:host(.gbt-segmented-control-host--full) .gbt-segmented-control{display:flex}:host(.gbt-segmented-control-host--full) .gbt-segmented-control__option{flex:1 1 0;min-width:0}:host(.gbt-segmented-control-host--full) .gbt-segmented-control--wrap .gbt-segmented-control__option{flex:1 1 auto}@media(prefers-reduced-motion:reduce){.gbt-segmented-control__option{transition:none}}\n"]
|
|
226
|
+
styles: [":host(.gbt-segmented-control-host--labelled){display:inline-block}:host(.gbt-segmented-control-host--full){display:block}.gbt-segmented-control__label{display:block;margin-bottom:.375rem;color:var(--text-secondary);font-size:.8125rem;font-weight:600}.gbt-segmented-control{position:relative;display:inline-flex;gap:2px;padding:2px;border-radius:999px;background:var(--gbt-glass-liquid);-webkit-backdrop-filter:var(--gbt-liquid-blur);backdrop-filter:var(--gbt-liquid-blur);box-shadow:var(--gbt-depth-liquid);--text-discret: var(--gbt-ground-text-discret);--border-color: var(--gbt-ground-border);--color-success-text: var(--color-success-bg-text);--color-warning-text: var(--color-warning-bg-text);--color-error-text: var(--color-error-bg-text);--text-secondary: var(--gbt-liquid-text);--text-discret: var(--gbt-liquid-text)}@media(prefers-reduced-transparency:reduce){.gbt-segmented-control{background:linear-gradient(var(--gbt-glass-thick),var(--gbt-glass-thick)),var(--bg-principal);-webkit-backdrop-filter:none;backdrop-filter:none}}@media(prefers-contrast:more){.gbt-segmented-control{box-shadow:inset 0 0 0 1px var(--border-color),var(--gbt-depth-liquid)}}.gbt-segmented-control{box-shadow:inset 0 1px 0 var(--gbt-liquid-rim-top),inset 0 -1px 0 var(--gbt-liquid-rim-bottom)}@media(prefers-contrast:more){.gbt-segmented-control{box-shadow:inset 0 0 0 1px var(--border-color),inset 0 1px 0 var(--gbt-liquid-rim-top),inset 0 -1px 0 var(--gbt-liquid-rim-bottom)}}.gbt-segmented-control__lens{position:absolute;top:0;left:0;border-radius:999px;background:var(--gbt-glass-liquid);-webkit-backdrop-filter:var(--gbt-liquid-blur);backdrop-filter:var(--gbt-liquid-blur);box-shadow:var(--gbt-depth-liquid);--text-discret: var(--gbt-ground-text-discret);--border-color: var(--gbt-ground-border);--color-success-text: var(--color-success-bg-text);--color-warning-text: var(--color-warning-bg-text);--color-error-text: var(--color-error-bg-text);--text-secondary: var(--gbt-liquid-text);--text-discret: var(--gbt-liquid-text)}@media(prefers-reduced-transparency:reduce){.gbt-segmented-control__lens{background:linear-gradient(var(--gbt-glass-thick),var(--gbt-glass-thick)),var(--bg-principal);-webkit-backdrop-filter:none;backdrop-filter:none}}@media(prefers-contrast:more){.gbt-segmented-control__lens{box-shadow:inset 0 0 0 1px var(--border-color),var(--gbt-depth-liquid)}}.gbt-segmented-control__lens{box-shadow:var(--gbt-depth-liquid),inset 0 -1px 0 var(--gbt-nested-low, transparent),inset 0 -2px 3px -1px var(--gbt-nested-low-soft, transparent),0 1px 3px var(--gbt-nested-contact, transparent);color:var(--text-primary);background-image:linear-gradient(var(--gbt-relief-highlight),var(--gbt-relief-highlight));pointer-events:none}@media(prefers-reduced-motion:no-preference){.gbt-segmented-control__lens--glides{transition:transform .6s linear(0,.089,.28,.494,.685,.834,.938,1.001,1.034,1.045,1.044,1.036,1.027,1.017,1.01,1.004,1.001,.999,.998 85%,1),width .6s linear(0,.089,.28,.494,.685,.834,.938,1.001,1.034,1.045,1.044,1.036,1.027,1.017,1.01,1.004,1.001,.999,.998 85%,1),height .6s linear(0,.089,.28,.494,.685,.834,.938,1.001,1.034,1.045,1.044,1.036,1.027,1.017,1.01,1.004,1.001,.999,.998 85%,1)}}.gbt-segmented-control__option{box-sizing:border-box;display:inline-flex;align-items:center;justify-content:center;min-height:calc(var(--gbt-control-height-sm) - 4px);padding:.375rem .75rem;background:none;border:none;position:relative;border-radius:999px;color:var(--text-secondary);font-size:13px;font-weight:600;cursor:pointer;transition:background .12s cubic-bezier(.4,0,.2,1),color .12s cubic-bezier(.4,0,.2,1)}.gbt-segmented-control__option:hover:not(:disabled):not(.gbt-segmented-control__option--selected){background:var(--bg-hover);color:var(--text-primary)}.gbt-segmented-control__option:active:not(:disabled):not(.gbt-segmented-control__option--selected){background:var(--bg-press);color:var(--text-primary)}.gbt-segmented-control__option:focus-visible{outline:2px solid var(--gbt-focus-ring, var(--gbt-ground-accent, var(--focus-ring)));outline-offset:2px}.gbt-segmented-control__option:disabled{cursor:not-allowed;opacity:.5}.gbt-segmented-control__option--selected{background:var(--gbt-glass-liquid);-webkit-backdrop-filter:var(--gbt-liquid-blur);backdrop-filter:var(--gbt-liquid-blur);box-shadow:var(--gbt-depth-liquid);--text-discret: var(--gbt-ground-text-discret);--border-color: var(--gbt-ground-border);--color-success-text: var(--color-success-bg-text);--color-warning-text: var(--color-warning-bg-text);--color-error-text: var(--color-error-bg-text);--text-secondary: var(--gbt-liquid-text);--text-discret: var(--gbt-liquid-text)}@media(prefers-reduced-transparency:reduce){.gbt-segmented-control__option--selected{background:linear-gradient(var(--gbt-glass-thick),var(--gbt-glass-thick)),var(--bg-principal);-webkit-backdrop-filter:none;backdrop-filter:none}}@media(prefers-contrast:more){.gbt-segmented-control__option--selected{box-shadow:inset 0 0 0 1px var(--border-color),var(--gbt-depth-liquid)}}.gbt-segmented-control__option--selected{box-shadow:var(--gbt-depth-liquid),inset 0 -1px 0 var(--gbt-nested-low, transparent),inset 0 -2px 3px -1px var(--gbt-nested-low-soft, transparent),0 1px 3px var(--gbt-nested-contact, transparent);color:var(--text-primary)}.gbt-segmented-control--lens .gbt-segmented-control__option--selected,.gbt-segmented-control--lens .gbt-segmented-control__option--selected:hover:not(:disabled),.gbt-segmented-control--lens .gbt-segmented-control__option--selected:active:not(:disabled){background:none;-webkit-backdrop-filter:none;backdrop-filter:none;box-shadow:none;transform:none;transition:color .12s cubic-bezier(.4,0,.2,1)}@media(prefers-reduced-motion:reduce){.gbt-segmented-control--lens .gbt-segmented-control__option--selected,.gbt-segmented-control--lens .gbt-segmented-control__option--selected:hover:not(:disabled),.gbt-segmented-control--lens .gbt-segmented-control__option--selected:active:not(:disabled){transition:none}}.gbt-segmented-control--tinted{background:var(--bg-track)}.gbt-segmented-control--sm .gbt-segmented-control__option{padding:.1875rem .625rem;font-size:12px}.gbt-segmented-control--wrap{flex-wrap:wrap}.gbt-segmented-control--wrap .gbt-segmented-control__option{white-space:nowrap}:host(.gbt-segmented-control-host--full) .gbt-segmented-control{display:flex}:host(.gbt-segmented-control-host--full) .gbt-segmented-control__option{flex:1 1 0;min-width:0}:host(.gbt-segmented-control-host--full) .gbt-segmented-control--wrap .gbt-segmented-control__option{flex:1 1 auto}@media(prefers-reduced-motion:reduce){.gbt-segmented-control__option{transition:none}}\n"]
|
|
227
227
|
}]
|
|
228
228
|
}],
|
|
229
229
|
ctorParameters: () => [],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"masmarino-gabarit-segmented-control.mjs","names":[],"sources":["../../../projects/gabarit/segmented-control/segmented-control.ts","../../../projects/gabarit/segmented-control/segmented-control.html"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n DestroyRef,\n ElementRef,\n afterRenderEffect,\n booleanAttribute,\n inject,\n input,\n model,\n signal,\n viewChild,\n} from '@angular/core'\n\nexport interface SegmentedControlOption<T = string> {\n value: T\n label: string\n disabled?: boolean\n}\n\nexport type SegmentedControlSize = 'md' | 'sm'\n\nlet nextSegmentedControlId = 0\n\n/** Where the lens sits, in the group's box (px). */\ninterface LensBox {\n x: number\n y: number\n width: number\n height: number\n}\n\n@Component({\n selector: 'gbt-segmented-control',\n standalone: true,\n imports: [],\n templateUrl: './segmented-control.html',\n styleUrl: './segmented-control.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n '[class.gbt-segmented-control-host--full]': 'fullWidth()',\n '[class.gbt-segmented-control-host--labelled]': '!!label()',\n },\n})\nexport class SegmentedControl<T = string> {\n private readonly group = viewChild<ElementRef<HTMLElement>>('group')\n\n options = input.required<SegmentedControlOption<T>[]>()\n value = model.required<T>()\n ariaLabel = input<string>('')\n disabled = input(false, { transform: booleanAttribute })\n label = input<string>('')\n fullWidth = input(false, { transform: booleanAttribute })\n wrap = input(false, { transform: booleanAttribute })\n size = input<SegmentedControlSize>('md')\n tinted = input(false, { transform: booleanAttribute })\n\n protected readonly labelId = `gbt-segmented-control-label-${++nextSegmentedControlId}`\n\n /** The lens of liquid glass under the chosen option (4.1): measured once the options are laid out, null before (the\n * chosen option then shows its own ground, as on a server render). */\n protected readonly lens = signal<LensBox | null>(null)\n /** The lens glides only once it has a place: it does not fly in from the corner on the first render. */\n protected readonly lensGlides = signal(false)\n\n constructor() {\n const layout = signal(0)\n if (typeof ResizeObserver !== 'undefined') {\n const observer = new ResizeObserver(() => layout.update((n) => n + 1))\n afterRenderEffect(() => {\n const group = this.group()?.nativeElement\n if (group) {\n observer.disconnect()\n observer.observe(group)\n }\n })\n inject(DestroyRef).onDestroy(() => observer.disconnect())\n }\n afterRenderEffect({\n read: () => {\n layout()\n this.value()\n this.options()\n this.place()\n },\n })\n }\n\n private place(): void {\n const group = this.group()?.nativeElement\n const chosen = group?.querySelector<HTMLElement>('[role=\"radio\"][aria-checked=\"true\"]')\n if (!group || !chosen || chosen.offsetWidth === 0) {\n this.lens.set(null)\n return\n }\n const box = {\n x: chosen.offsetLeft,\n y: chosen.offsetTop,\n width: chosen.offsetWidth,\n height: chosen.offsetHeight,\n }\n const current = this.lens()\n if (\n current &&\n current.x === box.x &&\n current.y === box.y &&\n current.width === box.width &&\n current.height === box.height\n ) {\n return\n }\n const first = current === null\n this.lens.set(box)\n if (first && typeof requestAnimationFrame !== 'undefined') {\n requestAnimationFrame(() => this.lensGlides.set(true))\n }\n }\n\n protected isSelected(value: T): boolean {\n return this.value() === value\n }\n\n protected select(option: SegmentedControlOption<T>): void {\n if (this.disabled() || option.disabled) {\n return\n }\n this.value.set(option.value)\n }\n\n protected onKeydown(event: KeyboardEvent, index: number): void {\n const options = this.options()\n const count = options.length\n if (count === 0) {\n return\n }\n let next: number | null = null\n switch (event.key) {\n case 'ArrowRight':\n case 'ArrowDown':\n next = this.nextEnabledIndex(index, 1)\n break\n case 'ArrowLeft':\n case 'ArrowUp':\n next = this.nextEnabledIndex(index, -1)\n break\n case 'Home':\n next = this.nextEnabledIndex(-1, 1)\n break\n case 'End':\n next = this.nextEnabledIndex(count, -1)\n break\n }\n if (next === null) {\n return\n }\n event.preventDefault()\n this.select(options[next])\n this.focusButton(next)\n }\n\n private nextEnabledIndex(from: number, direction: 1 | -1): number | null {\n const options = this.options()\n const count = options.length\n for (let step = 1; step <= count; step++) {\n const candidate = (from + direction * step + count) % count\n if (!options[candidate].disabled) {\n return candidate\n }\n }\n return null\n }\n\n private focusButton(index: number): void {\n this.group()?.nativeElement.querySelectorAll<HTMLElement>('[role=\"radio\"]')[index]?.focus()\n }\n}\n","@if (label()) {\n <span [id]=\"labelId\" class=\"gbt-segmented-control__label\">{{ label() }}</span>\n}\n<div\n #group\n class=\"gbt-segmented-control\"\n [class.gbt-segmented-control--sm]=\"size() === 'sm'\"\n [class.gbt-segmented-control--wrap]=\"wrap()\"\n [class.gbt-segmented-control--tinted]=\"tinted()\"\n [class.gbt-segmented-control--lens]=\"!!lens()\"\n role=\"radiogroup\"\n [attr.aria-label]=\"label() ? null : ariaLabel() || null\"\n [attr.aria-labelledby]=\"label() ? labelId : null\"\n>\n @if (lens(); as box) {\n <span\n class=\"gbt-segmented-control__lens\"\n [class.gbt-segmented-control__lens--glides]=\"lensGlides()\"\n aria-hidden=\"true\"\n [style.width.px]=\"box.width\"\n [style.height.px]=\"box.height\"\n [style.transform]=\"'translate(' + box.x + 'px, ' + box.y + 'px)'\"\n ></span>\n }\n @for (option of options(); track option.value; let i = $index) {\n <button\n type=\"button\"\n role=\"radio\"\n class=\"gbt-segmented-control__option\"\n [class.gbt-segmented-control__option--selected]=\"isSelected(option.value)\"\n [attr.aria-checked]=\"isSelected(option.value)\"\n [tabIndex]=\"isSelected(option.value) ? 0 : -1\"\n [disabled]=\"disabled() || !!option.disabled\"\n (click)=\"select(option)\"\n (keydown)=\"onKeydown($event, i)\"\n >\n {{ option.label }}\n </button>\n }\n</div>\n"],"mappings":";;AAsBA,IAAI,yBAAyB;AAsB7B,IAAa,mBAAb,MAAa,iBAAgB;CACV,QAAQ,UAAmC,SAAQ,GAAA,YAAA,CAAA,EAAA,WAAA,QAAA,CAAA,+BAAA,CAAA,CAAA;CAEpE,UAAU,MAAM,SAAuC,GAAA,YAAA,CAAA,EAAA,WAAA,UAAA,CAAA,+BAAA,CAAA,CAAA;CACvD,QAAQ,MAAM,SAAa,GAAA,YAAA,CAAA,EAAA,WAAA,QAAA,CAAA,+BAAA,CAAA,CAAA;CAC3B,YAAY,MAAc,IAAG,GAAA,YAAA,CAAA,EAAA,WAAA,YAAA,CAAA,+BAAA,CAAA,CAAA;CAC7B,WAAW,MAAM,OAAK;E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AA;EAAA,UAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,OAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,WAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,MAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,MAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,QAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;CAAA;AAAA,CAAA"}
|
|
1
|
+
{"version":3,"file":"masmarino-gabarit-segmented-control.mjs","names":[],"sources":["../../../projects/gabarit/segmented-control/segmented-control.ts","../../../projects/gabarit/segmented-control/segmented-control.html"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n DestroyRef,\n ElementRef,\n afterRenderEffect,\n booleanAttribute,\n inject,\n input,\n model,\n signal,\n viewChild,\n} from '@angular/core'\n\nexport interface SegmentedControlOption<T = string> {\n value: T\n label: string\n disabled?: boolean\n}\n\nexport type SegmentedControlSize = 'md' | 'sm'\n\nlet nextSegmentedControlId = 0\n\n/** Where the lens sits, in the group's box (px). */\ninterface LensBox {\n x: number\n y: number\n width: number\n height: number\n}\n\n@Component({\n selector: 'gbt-segmented-control',\n standalone: true,\n imports: [],\n templateUrl: './segmented-control.html',\n styleUrl: './segmented-control.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n '[class.gbt-segmented-control-host--full]': 'fullWidth()',\n '[class.gbt-segmented-control-host--labelled]': '!!label()',\n },\n})\nexport class SegmentedControl<T = string> {\n private readonly group = viewChild<ElementRef<HTMLElement>>('group')\n\n options = input.required<SegmentedControlOption<T>[]>()\n value = model.required<T>()\n ariaLabel = input<string>('')\n disabled = input(false, { transform: booleanAttribute })\n label = input<string>('')\n fullWidth = input(false, { transform: booleanAttribute })\n wrap = input(false, { transform: booleanAttribute })\n size = input<SegmentedControlSize>('md')\n tinted = input(false, { transform: booleanAttribute })\n\n protected readonly labelId = `gbt-segmented-control-label-${++nextSegmentedControlId}`\n\n /** The lens of liquid glass under the chosen option (4.1): measured once the options are laid out, null before (the\n * chosen option then shows its own ground, as on a server render). */\n protected readonly lens = signal<LensBox | null>(null)\n /** The lens glides only once it has a place: it does not fly in from the corner on the first render. */\n protected readonly lensGlides = signal(false)\n\n constructor() {\n const layout = signal(0)\n if (typeof ResizeObserver !== 'undefined') {\n const observer = new ResizeObserver(() => layout.update((n) => n + 1))\n afterRenderEffect(() => {\n const group = this.group()?.nativeElement\n if (group) {\n observer.disconnect()\n observer.observe(group)\n }\n })\n inject(DestroyRef).onDestroy(() => observer.disconnect())\n }\n afterRenderEffect({\n read: () => {\n layout()\n this.value()\n this.options()\n this.place()\n },\n })\n }\n\n private place(): void {\n const group = this.group()?.nativeElement\n const chosen = group?.querySelector<HTMLElement>('[role=\"radio\"][aria-checked=\"true\"]')\n if (!group || !chosen || chosen.offsetWidth === 0) {\n this.lens.set(null)\n return\n }\n const box = {\n x: chosen.offsetLeft,\n y: chosen.offsetTop,\n width: chosen.offsetWidth,\n height: chosen.offsetHeight,\n }\n const current = this.lens()\n if (\n current &&\n current.x === box.x &&\n current.y === box.y &&\n current.width === box.width &&\n current.height === box.height\n ) {\n return\n }\n const first = current === null\n this.lens.set(box)\n if (first && typeof requestAnimationFrame !== 'undefined') {\n requestAnimationFrame(() => this.lensGlides.set(true))\n }\n }\n\n protected isSelected(value: T): boolean {\n return this.value() === value\n }\n\n protected select(option: SegmentedControlOption<T>): void {\n if (this.disabled() || option.disabled) {\n return\n }\n this.value.set(option.value)\n }\n\n protected onKeydown(event: KeyboardEvent, index: number): void {\n const options = this.options()\n const count = options.length\n if (count === 0) {\n return\n }\n let next: number | null = null\n switch (event.key) {\n case 'ArrowRight':\n case 'ArrowDown':\n next = this.nextEnabledIndex(index, 1)\n break\n case 'ArrowLeft':\n case 'ArrowUp':\n next = this.nextEnabledIndex(index, -1)\n break\n case 'Home':\n next = this.nextEnabledIndex(-1, 1)\n break\n case 'End':\n next = this.nextEnabledIndex(count, -1)\n break\n }\n if (next === null) {\n return\n }\n event.preventDefault()\n this.select(options[next])\n this.focusButton(next)\n }\n\n private nextEnabledIndex(from: number, direction: 1 | -1): number | null {\n const options = this.options()\n const count = options.length\n for (let step = 1; step <= count; step++) {\n const candidate = (from + direction * step + count) % count\n if (!options[candidate].disabled) {\n return candidate\n }\n }\n return null\n }\n\n private focusButton(index: number): void {\n this.group()?.nativeElement.querySelectorAll<HTMLElement>('[role=\"radio\"]')[index]?.focus()\n }\n}\n","@if (label()) {\n <span [id]=\"labelId\" class=\"gbt-segmented-control__label\">{{ label() }}</span>\n}\n<div\n #group\n class=\"gbt-segmented-control\"\n [class.gbt-segmented-control--sm]=\"size() === 'sm'\"\n [class.gbt-segmented-control--wrap]=\"wrap()\"\n [class.gbt-segmented-control--tinted]=\"tinted()\"\n [class.gbt-segmented-control--lens]=\"!!lens()\"\n role=\"radiogroup\"\n [attr.aria-label]=\"label() ? null : ariaLabel() || null\"\n [attr.aria-labelledby]=\"label() ? labelId : null\"\n>\n @if (lens(); as box) {\n <span\n class=\"gbt-segmented-control__lens\"\n [class.gbt-segmented-control__lens--glides]=\"lensGlides()\"\n aria-hidden=\"true\"\n [style.width.px]=\"box.width\"\n [style.height.px]=\"box.height\"\n [style.transform]=\"'translate(' + box.x + 'px, ' + box.y + 'px)'\"\n ></span>\n }\n @for (option of options(); track option.value; let i = $index) {\n <button\n type=\"button\"\n role=\"radio\"\n class=\"gbt-segmented-control__option\"\n [class.gbt-segmented-control__option--selected]=\"isSelected(option.value)\"\n [attr.aria-checked]=\"isSelected(option.value)\"\n [tabIndex]=\"isSelected(option.value) ? 0 : -1\"\n [disabled]=\"disabled() || !!option.disabled\"\n (click)=\"select(option)\"\n (keydown)=\"onKeydown($event, i)\"\n >\n {{ option.label }}\n </button>\n }\n</div>\n"],"mappings":";;AAsBA,IAAI,yBAAyB;AAsB7B,IAAa,mBAAb,MAAa,iBAAgB;CACV,QAAQ,UAAmC,SAAQ,GAAA,YAAA,CAAA,EAAA,WAAA,QAAA,CAAA,+BAAA,CAAA,CAAA;CAEpE,UAAU,MAAM,SAAuC,GAAA,YAAA,CAAA,EAAA,WAAA,UAAA,CAAA,+BAAA,CAAA,CAAA;CACvD,QAAQ,MAAM,SAAa,GAAA,YAAA,CAAA,EAAA,WAAA,QAAA,CAAA,+BAAA,CAAA,CAAA;CAC3B,YAAY,MAAc,IAAG,GAAA,YAAA,CAAA,EAAA,WAAA,YAAA,CAAA,+BAAA,CAAA,CAAA;CAC7B,WAAW,MAAM,OAAK;EAAA,GAAA,YAAA,EAAA,WAAA,WAAA,+BAAA,CAAA;EAAI,WAAW;CAAgB,CAAA;CACrD,QAAQ,MAAc,IAAG,GAAA,YAAA,CAAA,EAAA,WAAA,QAAA,CAAA,+BAAA,CAAA,CAAA;CACzB,YAAY,MAAM,OAAK;EAAA,GAAA,YAAA,EAAA,WAAA,YAAA,+BAAA,CAAA;EAAI,WAAW;CAAgB,CAAA;CACtD,OAAO,MAAM,OAAK;EAAA,GAAA,YAAA,EAAA,WAAA,OAAA,+BAAA,CAAA;EAAI,WAAW;CAAgB,CAAA;CACjD,OAAO,MAA4B,MAAK,GAAA,YAAA,CAAA,EAAA,WAAA,OAAA,CAAA,+BAAA,CAAA,CAAA;CACxC,SAAS,MAAM,OAAK;EAAA,GAAA,YAAA,E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MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,QAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;CAAA;AAAA,CAAA"}
|
|
@@ -326,7 +326,7 @@ var Select = class Select {
|
|
|
326
326
|
}],
|
|
327
327
|
ngImport: i0,
|
|
328
328
|
template: "<div class=\"gbt-select\" [class.gbt-select--disabled]=\"isDisabled()\">\n @if (label()) {\n <label\n [id]=\"labelId()\"\n [for]=\"id()\"\n class=\"gbt-select__label\"\n [class.gbt-select__label--hidden]=\"hideLabel()\"\n >{{ label() }}{{ required() ? ' *' : '' }}</label\n >\n }\n\n <button\n type=\"button\"\n [id]=\"id()\"\n class=\"gbt-select__trigger\"\n [class.gbt-select__trigger--open]=\"open()\"\n [disabled]=\"isDisabled()\"\n role=\"combobox\"\n aria-haspopup=\"listbox\"\n [attr.aria-expanded]=\"open()\"\n [attr.aria-controls]=\"open() ? id() + '-listbox' : null\"\n [attr.aria-activedescendant]=\"activeOptionId()\"\n [attr.aria-labelledby]=\"label() ? labelId() + ' ' + id() : null\"\n [attr.aria-label]=\"label() ? null : placeholder() || null\"\n [attr.aria-required]=\"required() ? true : null\"\n [attr.aria-invalid]=\"errorMessage() ? true : null\"\n [attr.aria-describedby]=\"describedBy()\"\n (click)=\"toggleOpen()\"\n >\n @if (triggerIcon(); as icon) {\n <gbt-icon [name]=\"icon\" class=\"gbt-select__trigger-icon\" aria-hidden=\"true\" />\n }\n <span\n class=\"gbt-select__trigger-label\"\n [class.gbt-select__trigger-label--placeholder]=\"selectedOptions().length === 0\"\n >\n {{ triggerLabel() }}\n </span>\n <gbt-icon name=\"chevron-down\" class=\"gbt-select__chevron\" aria-hidden=\"true\" />\n </button>\n @if (chipsVisible()) {\n <div class=\"gbt-select__chips\" [id]=\"chipsId()\">\n @for (option of selectedOptions(); track option.value; let i = $index) {\n <gbt-tag\n [color]=\"option.color ?? '#6b7280'\"\n [removable]=\"!isDisabled()\"\n [disabled]=\"isDisabled()\"\n [removeLabel]=\"chipRemoveLabel()(option.label)\"\n (removed)=\"removeChip(option.value, i)\"\n >\n {{ option.label }}\n </gbt-tag>\n }\n </div>\n }\n @if (chips() && multiple()) {\n <div role=\"status\" aria-live=\"polite\" aria-atomic=\"true\" class=\"sr-only\">\n {{ selectedCountLabel()(selectedOptions().length) }}\n </div>\n }\n @if (open() && panelStyle(); as style) {\n @if (hasNoOptions()) {\n <div\n [id]=\"id() + '-listbox'\"\n class=\"gbt-select__panel gbt-select__empty\"\n role=\"status\"\n [style.top]=\"style.top\"\n [style.left]=\"style.left\"\n [style.width]=\"style.width\"\n >\n {{ noOptionsMessage() }}\n </div>\n } @else {\n <ul\n [id]=\"id() + '-listbox'\"\n class=\"gbt-select__panel\"\n role=\"listbox\"\n [attr.aria-label]=\"label() || placeholder()\"\n [attr.aria-multiselectable]=\"multiple()\"\n [style.top]=\"style.top\"\n [style.left]=\"style.left\"\n [style.width]=\"style.width\"\n >\n @for (option of options(); track option.value; let i = $index) {\n <li role=\"presentation\">\n <button\n [id]=\"id() + '-option-' + i\"\n type=\"button\"\n role=\"option\"\n tabindex=\"-1\"\n class=\"gbt-select__option\"\n [class.gbt-select__option--selected]=\"isSelected(option.value)\"\n [class.gbt-select__option--active]=\"i === activeIndex()\"\n [attr.aria-selected]=\"isSelected(option.value)\"\n (click)=\"selectOption(option.value)\"\n (mouseenter)=\"activeIndex.set(i)\"\n >\n @if (option.icon) {\n <gbt-icon [name]=\"option.icon\" class=\"gbt-select__option-icon\" aria-hidden=\"true\" />\n }\n <span class=\"gbt-select__option-label\">{{ option.label }}</span>\n @if (isSelected(option.value)) {\n <gbt-icon name=\"check\" class=\"gbt-select__option-check\" aria-hidden=\"true\" />\n }\n </button>\n </li>\n }\n </ul>\n }\n }\n @if (showHint()) {\n <p [id]=\"hintId()\" class=\"gbt-select__hint\">{{ hint() }}</p>\n }\n @if (errorMessage()) {\n <p [id]=\"id() + '-error'\" class=\"gbt-select__error\" role=\"alert\">{{ errorMessage() }}</p>\n }\n</div>\n",
|
|
329
|
-
styles: [":host{position:relative;display:inline-block;min-width:180px}.gbt-select{display:flex;flex-direction:column;gap:.375rem}.gbt-select--disabled{opacity:.5}.gbt-select__label{font-size:.8125rem;font-weight:600;color:var(--text-secondary)}.gbt-select__label--hidden{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}:host(.gbt-select--full){display:block;width:100%}.gbt-select__trigger{box-sizing:border-box;display:flex;align-items:center;gap:8px;width:100%;height:var(--gbt-control-height-md);padding:0 10px;border:1px solid transparent;border-radius:999px;background:var(--gbt-glass-liquid);-webkit-backdrop-filter:var(--gbt-liquid-blur);backdrop-filter:var(--gbt-liquid-blur);box-shadow:var(--gbt-depth-liquid);--text-discret: var(--gbt-ground-text-discret);--border-color: var(--gbt-ground-border);--color-success-text: var(--color-success-bg-text);--color-warning-text: var(--color-warning-bg-text);--color-error-text: var(--color-error-bg-text);--text-secondary: var(--gbt-liquid-text);--text-discret: var(--gbt-liquid-text)}@media(prefers-reduced-transparency:reduce){.gbt-select__trigger{background:linear-gradient(var(--gbt-glass-thick),var(--gbt-glass-thick)),var(--bg-principal);-webkit-backdrop-filter:none;backdrop-filter:none}}@media(prefers-contrast:more){.gbt-select__trigger{box-shadow:inset 0 0 0 1px var(--border-color),var(--gbt-depth-liquid)}}.gbt-select__trigger{box-shadow:var(--gbt-depth-liquid),inset 0 -1px 0 var(--gbt-nested-low, transparent),inset 0 -2px 3px -1px var(--gbt-nested-low-soft, transparent),0 1px 3px var(--gbt-nested-contact, transparent);color:var(--text-primary);font-size:14px;cursor:pointer}@media(prefers-reduced-motion:no-preference){.gbt-select__trigger{transition:transform .6s linear(0,.089,.28,.494,.685,.834,.938,1.001,1.034,1.045,1.044,1.036,1.027,1.017,1.01,1.004,1.001,.999,.998 85%,1),background-color var(--site-transition-fast),color var(--site-transition-fast),box-shadow var(--site-transition-fast),opacity var(--site-transition-fast)}}.gbt-select__trigger:hover:not(:disabled){background-image:linear-gradient(var(--bg-hover),var(--bg-hover))}.gbt-select__trigger:active:not(:disabled){background-image:linear-gradient(#ffffff24,#ffffff0a 50%,#ffffff24)}@media(prefers-reduced-motion:no-preference){.gbt-select__trigger:active:not(:disabled){transform:scale(1.04)}}.gbt-select__trigger--open,.gbt-select__trigger--open:hover:not(:disabled){border-color:var(--primary);box-shadow:0 0 0 4px color-mix(in srgb,var(--primary) 12%,transparent)}.gbt-select__trigger:disabled{cursor:not-allowed}:host(.gbt-select--sm){min-width:120px}:host(.gbt-select--sm) .gbt-select__trigger{height:var(--gbt-control-height-sm);padding:0 8px;font-size:13px}.gbt-select__trigger-icon{flex-shrink:0;color:var(--text-secondary)}.gbt-select__trigger-label{flex:1;min-width:0;text-align:left;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.gbt-select__trigger-label--placeholder{color:var(--text-discret)}.gbt-select__chevron{flex-shrink:0;color:var(--text-secondary);transition:transform .2s cubic-bezier(.4,0,.2,1)}.gbt-select__trigger--open .gbt-select__chevron{transform:rotate(180deg)}.gbt-select__panel{position:fixed;z-index:1000;margin:0;padding:6px;list-style:none;max-height:280px;overflow-y:auto;border-radius:var(--gbt-radius-glass);background:var(--gbt-glass-thick);-webkit-backdrop-filter:var(--gbt-liquid-blur);backdrop-filter:var(--gbt-liquid-blur);box-shadow:var(--gbt-depth-liquid);--text-discret: var(--gbt-ground-text-discret);--border-color: var(--gbt-ground-border);--color-success-text: var(--color-success-bg-text);--color-warning-text: var(--color-warning-bg-text);--color-error-text: var(--color-error-bg-text);--text-secondary: var(--gbt-liquid-text);--text-discret: var(--gbt-liquid-text)}@media(prefers-reduced-transparency:reduce){.gbt-select__panel{background:linear-gradient(var(--gbt-glass-thick),var(--gbt-glass-thick)),var(--bg-principal);-webkit-backdrop-filter:none;backdrop-filter:none}}@media(prefers-contrast:more){.gbt-select__panel{box-shadow:inset 0 0 0 1px var(--border-color),var(--gbt-depth-liquid)}}.gbt-select__panel{--gbt-nested-low: light-dark(color-mix(in srgb, var(--text-primary) 20%, transparent), transparent);--gbt-nested-low-soft: light-dark(color-mix(in srgb, var(--text-primary) 8%, transparent), transparent);--gbt-nested-contact: light-dark(var(--gbt-glass-shadow-near), transparent);--gbt-nested-hollow-shade: light-dark(color-mix(in srgb, var(--text-primary) 14%, transparent), transparent);--gbt-nested-hollow-trace: light-dark(color-mix(in srgb, var(--text-primary) 6%, transparent), transparent);--gbt-nested-hollow-light: light-dark(#fff, transparent);--gbt-nested-group-low: light-dark(color-mix(in srgb, var(--text-primary) 12%, transparent), transparent);--gbt-nested-group-shadow: light-dark(var(--gbt-glass-shadow), transparent);box-shadow:var(--gbt-depth-liquid),var(--gbt-depth-glass)}@media(prefers-contrast:more){.gbt-select__panel{box-shadow:inset 0 0 0 1px var(--border-color),var(--gbt-depth-liquid),var(--gbt-depth-glass)}}.gbt-select__panel{animation:gbt-select-scale-in .15s cubic-bezier(.34,1.56,.64,1) both}.gbt-select__panel::-webkit-scrollbar{width:6px}.gbt-select__panel::-webkit-scrollbar-track{background:transparent}.gbt-select__panel::-webkit-scrollbar-thumb{background:var(--bg-hover);border-radius:3px}.gbt-select__empty{box-sizing:border-box;padding:10px 12px;color:var(--text-secondary);font-size:13px}.gbt-select__option{box-sizing:border-box;display:flex;align-items:center;gap:8px;width:100%;padding:8px 10px;background:transparent;border:none;border-radius:var(--gbt-radius-menu, var(--gbt-radius-row));color:var(--text-primary);font-size:14px;text-align:left;cursor:pointer;transition:background .12s cubic-bezier(.4,0,.2,1)}.gbt-select__option:hover,.gbt-select__option--active{background:var(--bg-hover)}.gbt-select__option:active{background:var(--bg-press)}.gbt-select__option--selected{color:var(--primary);font-weight:600}.gbt-select__option-icon{flex-shrink:0;color:var(--text-secondary)}.gbt-select__option--selected .gbt-select__option-icon{color:var(--primary)}.gbt-select__option-label{flex:1;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.gbt-select__option-check{flex-shrink:0;color:var(--primary)}@keyframes gbt-select-scale-in{0%{opacity:0;transform:scale(.97) translateY(-4px)}to{opacity:1;transform:scale(1) translateY(0)}}.gbt-select__chips{display:flex;flex-wrap:wrap;gap:4px}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.gbt-select__hint{margin:0;font-size:.75rem;color:var(--text-secondary)}.gbt-select__error{margin:0;font-size:.75rem;color:var(--color-error-text)}@media(prefers-reduced-motion:reduce){.gbt-select__panel{animation:none}.gbt-select__trigger,.gbt-select__option,.gbt-select__chevron{transition:none}}\n"],
|
|
329
|
+
styles: [":host{position:relative;display:inline-block;min-width:180px}.gbt-select{display:flex;flex-direction:column;gap:.375rem}.gbt-select--disabled{opacity:.5}.gbt-select__label{font-size:.8125rem;font-weight:600;color:var(--text-secondary)}.gbt-select__label--hidden{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}:host(.gbt-select--full){display:block;width:100%}.gbt-select__trigger{box-sizing:border-box;display:flex;align-items:center;gap:8px;width:100%;height:var(--gbt-control-height-md);padding:0 10px;border:1px solid transparent;border-radius:999px;background:var(--gbt-glass-liquid);-webkit-backdrop-filter:var(--gbt-liquid-blur);backdrop-filter:var(--gbt-liquid-blur);box-shadow:var(--gbt-depth-liquid);--text-discret: var(--gbt-ground-text-discret);--border-color: var(--gbt-ground-border);--color-success-text: var(--color-success-bg-text);--color-warning-text: var(--color-warning-bg-text);--color-error-text: var(--color-error-bg-text);--text-secondary: var(--gbt-liquid-text);--text-discret: var(--gbt-liquid-text)}@media(prefers-reduced-transparency:reduce){.gbt-select__trigger{background:linear-gradient(var(--gbt-glass-thick),var(--gbt-glass-thick)),var(--bg-principal);-webkit-backdrop-filter:none;backdrop-filter:none}}@media(prefers-contrast:more){.gbt-select__trigger{box-shadow:inset 0 0 0 1px var(--border-color),var(--gbt-depth-liquid)}}.gbt-select__trigger{box-shadow:var(--gbt-depth-liquid),inset 0 -1px 0 var(--gbt-nested-low, transparent),inset 0 -2px 3px -1px var(--gbt-nested-low-soft, transparent),0 1px 3px var(--gbt-nested-contact, transparent);color:var(--text-primary);font-size:14px;cursor:pointer}@media(prefers-reduced-motion:no-preference){.gbt-select__trigger{transition:transform .6s linear(0,.089,.28,.494,.685,.834,.938,1.001,1.034,1.045,1.044,1.036,1.027,1.017,1.01,1.004,1.001,.999,.998 85%,1),background-color var(--site-transition-fast),color var(--site-transition-fast),box-shadow var(--site-transition-fast),opacity var(--site-transition-fast)}}.gbt-select__trigger:hover:not(:disabled){background-image:linear-gradient(var(--bg-hover),var(--bg-hover))}.gbt-select__trigger:active:not(:disabled){background-image:linear-gradient(#ffffff24,#ffffff0a 50%,#ffffff24)}@media(prefers-reduced-motion:no-preference){.gbt-select__trigger:active:not(:disabled){transform:scale(1.04)}}.gbt-select__trigger--open,.gbt-select__trigger--open:hover:not(:disabled){border-color:var(--gbt-ground-accent, var(--primary));box-shadow:0 0 0 4px color-mix(in srgb,var(--gbt-ground-accent, var(--primary)) 12%,transparent)}.gbt-select__trigger:disabled{cursor:not-allowed}:host(.gbt-select--sm){min-width:120px}:host(.gbt-select--sm) .gbt-select__trigger{height:var(--gbt-control-height-sm);padding:0 8px;font-size:13px}.gbt-select__trigger-icon{flex-shrink:0;color:var(--text-secondary)}.gbt-select__trigger-label{flex:1;min-width:0;text-align:left;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.gbt-select__trigger-label--placeholder{color:var(--text-discret)}.gbt-select__chevron{flex-shrink:0;color:var(--text-secondary);transition:transform .2s cubic-bezier(.4,0,.2,1)}.gbt-select__trigger--open .gbt-select__chevron{transform:rotate(180deg)}.gbt-select__panel{position:fixed;z-index:1000;margin:0;padding:6px;list-style:none;max-height:280px;overflow-y:auto;border-radius:var(--gbt-radius-glass);background:var(--gbt-glass-thick);-webkit-backdrop-filter:var(--gbt-liquid-blur);backdrop-filter:var(--gbt-liquid-blur);box-shadow:var(--gbt-depth-liquid);--text-discret: var(--gbt-ground-text-discret);--border-color: var(--gbt-ground-border);--color-success-text: var(--color-success-bg-text);--color-warning-text: var(--color-warning-bg-text);--color-error-text: var(--color-error-bg-text);--text-secondary: var(--gbt-liquid-text);--text-discret: var(--gbt-liquid-text)}@media(prefers-reduced-transparency:reduce){.gbt-select__panel{background:linear-gradient(var(--gbt-glass-thick),var(--gbt-glass-thick)),var(--bg-principal);-webkit-backdrop-filter:none;backdrop-filter:none}}@media(prefers-contrast:more){.gbt-select__panel{box-shadow:inset 0 0 0 1px var(--border-color),var(--gbt-depth-liquid)}}.gbt-select__panel{--gbt-nested-low: light-dark(color-mix(in srgb, var(--text-primary) 20%, transparent), transparent);--gbt-nested-low-soft: light-dark(color-mix(in srgb, var(--text-primary) 8%, transparent), transparent);--gbt-nested-contact: light-dark(var(--gbt-glass-shadow-near), transparent);--gbt-nested-hollow-shade: light-dark(color-mix(in srgb, var(--text-primary) 14%, transparent), transparent);--gbt-nested-hollow-trace: light-dark(color-mix(in srgb, var(--text-primary) 6%, transparent), transparent);--gbt-nested-hollow-light: light-dark(#fff, transparent);--gbt-nested-group-low: light-dark(color-mix(in srgb, var(--text-primary) 12%, transparent), transparent);--gbt-nested-group-shadow: light-dark(var(--gbt-glass-shadow), transparent);box-shadow:var(--gbt-depth-liquid),var(--gbt-depth-glass)}@media(prefers-contrast:more){.gbt-select__panel{box-shadow:inset 0 0 0 1px var(--border-color),var(--gbt-depth-liquid),var(--gbt-depth-glass)}}.gbt-select__panel{animation:gbt-select-scale-in .15s cubic-bezier(.34,1.56,.64,1) both}.gbt-select__panel::-webkit-scrollbar{width:6px}.gbt-select__panel::-webkit-scrollbar-track{background:transparent}.gbt-select__panel::-webkit-scrollbar-thumb{background:var(--bg-hover);border-radius:3px}.gbt-select__empty{box-sizing:border-box;padding:10px 12px;color:var(--text-secondary);font-size:13px}.gbt-select__option{box-sizing:border-box;display:flex;align-items:center;gap:8px;width:100%;padding:8px 10px;background:transparent;border:none;border-radius:var(--gbt-radius-menu, var(--gbt-radius-row));color:var(--text-primary);font-size:14px;text-align:left;cursor:pointer;transition:background .12s cubic-bezier(.4,0,.2,1)}.gbt-select__option:hover,.gbt-select__option--active{background:var(--bg-hover)}.gbt-select__option:active{background:var(--bg-press)}.gbt-select__option--selected{color:var(--gbt-ground-accent-text, var(--primary));font-weight:600}.gbt-select__option-icon{flex-shrink:0;color:var(--text-secondary)}.gbt-select__option--selected .gbt-select__option-icon{color:var(--gbt-ground-accent-text, var(--primary))}.gbt-select__option-label{flex:1;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.gbt-select__option-check{flex-shrink:0;color:var(--gbt-ground-accent-text, var(--primary))}@keyframes gbt-select-scale-in{0%{opacity:0;transform:scale(.97) translateY(-4px)}to{opacity:1;transform:scale(1) translateY(0)}}.gbt-select__chips{display:flex;flex-wrap:wrap;gap:4px}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.gbt-select__hint{margin:0;font-size:.75rem;color:var(--text-secondary)}.gbt-select__error{margin:0;font-size:.75rem;color:var(--color-error-text)}@media(prefers-reduced-motion:reduce){.gbt-select__panel{animation:none}.gbt-select__trigger,.gbt-select__option,.gbt-select__chevron{transition:none}}\n"],
|
|
330
330
|
dependencies: [{
|
|
331
331
|
kind: "component",
|
|
332
332
|
type: Icon,
|
|
@@ -372,7 +372,7 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
372
372
|
multi: true
|
|
373
373
|
}],
|
|
374
374
|
template: "<div class=\"gbt-select\" [class.gbt-select--disabled]=\"isDisabled()\">\n @if (label()) {\n <label\n [id]=\"labelId()\"\n [for]=\"id()\"\n class=\"gbt-select__label\"\n [class.gbt-select__label--hidden]=\"hideLabel()\"\n >{{ label() }}{{ required() ? ' *' : '' }}</label\n >\n }\n\n <button\n type=\"button\"\n [id]=\"id()\"\n class=\"gbt-select__trigger\"\n [class.gbt-select__trigger--open]=\"open()\"\n [disabled]=\"isDisabled()\"\n role=\"combobox\"\n aria-haspopup=\"listbox\"\n [attr.aria-expanded]=\"open()\"\n [attr.aria-controls]=\"open() ? id() + '-listbox' : null\"\n [attr.aria-activedescendant]=\"activeOptionId()\"\n [attr.aria-labelledby]=\"label() ? labelId() + ' ' + id() : null\"\n [attr.aria-label]=\"label() ? null : placeholder() || null\"\n [attr.aria-required]=\"required() ? true : null\"\n [attr.aria-invalid]=\"errorMessage() ? true : null\"\n [attr.aria-describedby]=\"describedBy()\"\n (click)=\"toggleOpen()\"\n >\n @if (triggerIcon(); as icon) {\n <gbt-icon [name]=\"icon\" class=\"gbt-select__trigger-icon\" aria-hidden=\"true\" />\n }\n <span\n class=\"gbt-select__trigger-label\"\n [class.gbt-select__trigger-label--placeholder]=\"selectedOptions().length === 0\"\n >\n {{ triggerLabel() }}\n </span>\n <gbt-icon name=\"chevron-down\" class=\"gbt-select__chevron\" aria-hidden=\"true\" />\n </button>\n @if (chipsVisible()) {\n <div class=\"gbt-select__chips\" [id]=\"chipsId()\">\n @for (option of selectedOptions(); track option.value; let i = $index) {\n <gbt-tag\n [color]=\"option.color ?? '#6b7280'\"\n [removable]=\"!isDisabled()\"\n [disabled]=\"isDisabled()\"\n [removeLabel]=\"chipRemoveLabel()(option.label)\"\n (removed)=\"removeChip(option.value, i)\"\n >\n {{ option.label }}\n </gbt-tag>\n }\n </div>\n }\n @if (chips() && multiple()) {\n <div role=\"status\" aria-live=\"polite\" aria-atomic=\"true\" class=\"sr-only\">\n {{ selectedCountLabel()(selectedOptions().length) }}\n </div>\n }\n @if (open() && panelStyle(); as style) {\n @if (hasNoOptions()) {\n <div\n [id]=\"id() + '-listbox'\"\n class=\"gbt-select__panel gbt-select__empty\"\n role=\"status\"\n [style.top]=\"style.top\"\n [style.left]=\"style.left\"\n [style.width]=\"style.width\"\n >\n {{ noOptionsMessage() }}\n </div>\n } @else {\n <ul\n [id]=\"id() + '-listbox'\"\n class=\"gbt-select__panel\"\n role=\"listbox\"\n [attr.aria-label]=\"label() || placeholder()\"\n [attr.aria-multiselectable]=\"multiple()\"\n [style.top]=\"style.top\"\n [style.left]=\"style.left\"\n [style.width]=\"style.width\"\n >\n @for (option of options(); track option.value; let i = $index) {\n <li role=\"presentation\">\n <button\n [id]=\"id() + '-option-' + i\"\n type=\"button\"\n role=\"option\"\n tabindex=\"-1\"\n class=\"gbt-select__option\"\n [class.gbt-select__option--selected]=\"isSelected(option.value)\"\n [class.gbt-select__option--active]=\"i === activeIndex()\"\n [attr.aria-selected]=\"isSelected(option.value)\"\n (click)=\"selectOption(option.value)\"\n (mouseenter)=\"activeIndex.set(i)\"\n >\n @if (option.icon) {\n <gbt-icon [name]=\"option.icon\" class=\"gbt-select__option-icon\" aria-hidden=\"true\" />\n }\n <span class=\"gbt-select__option-label\">{{ option.label }}</span>\n @if (isSelected(option.value)) {\n <gbt-icon name=\"check\" class=\"gbt-select__option-check\" aria-hidden=\"true\" />\n }\n </button>\n </li>\n }\n </ul>\n }\n }\n @if (showHint()) {\n <p [id]=\"hintId()\" class=\"gbt-select__hint\">{{ hint() }}</p>\n }\n @if (errorMessage()) {\n <p [id]=\"id() + '-error'\" class=\"gbt-select__error\" role=\"alert\">{{ errorMessage() }}</p>\n }\n</div>\n",
|
|
375
|
-
styles: [":host{position:relative;display:inline-block;min-width:180px}.gbt-select{display:flex;flex-direction:column;gap:.375rem}.gbt-select--disabled{opacity:.5}.gbt-select__label{font-size:.8125rem;font-weight:600;color:var(--text-secondary)}.gbt-select__label--hidden{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}:host(.gbt-select--full){display:block;width:100%}.gbt-select__trigger{box-sizing:border-box;display:flex;align-items:center;gap:8px;width:100%;height:var(--gbt-control-height-md);padding:0 10px;border:1px solid transparent;border-radius:999px;background:var(--gbt-glass-liquid);-webkit-backdrop-filter:var(--gbt-liquid-blur);backdrop-filter:var(--gbt-liquid-blur);box-shadow:var(--gbt-depth-liquid);--text-discret: var(--gbt-ground-text-discret);--border-color: var(--gbt-ground-border);--color-success-text: var(--color-success-bg-text);--color-warning-text: var(--color-warning-bg-text);--color-error-text: var(--color-error-bg-text);--text-secondary: var(--gbt-liquid-text);--text-discret: var(--gbt-liquid-text)}@media(prefers-reduced-transparency:reduce){.gbt-select__trigger{background:linear-gradient(var(--gbt-glass-thick),var(--gbt-glass-thick)),var(--bg-principal);-webkit-backdrop-filter:none;backdrop-filter:none}}@media(prefers-contrast:more){.gbt-select__trigger{box-shadow:inset 0 0 0 1px var(--border-color),var(--gbt-depth-liquid)}}.gbt-select__trigger{box-shadow:var(--gbt-depth-liquid),inset 0 -1px 0 var(--gbt-nested-low, transparent),inset 0 -2px 3px -1px var(--gbt-nested-low-soft, transparent),0 1px 3px var(--gbt-nested-contact, transparent);color:var(--text-primary);font-size:14px;cursor:pointer}@media(prefers-reduced-motion:no-preference){.gbt-select__trigger{transition:transform .6s linear(0,.089,.28,.494,.685,.834,.938,1.001,1.034,1.045,1.044,1.036,1.027,1.017,1.01,1.004,1.001,.999,.998 85%,1),background-color var(--site-transition-fast),color var(--site-transition-fast),box-shadow var(--site-transition-fast),opacity var(--site-transition-fast)}}.gbt-select__trigger:hover:not(:disabled){background-image:linear-gradient(var(--bg-hover),var(--bg-hover))}.gbt-select__trigger:active:not(:disabled){background-image:linear-gradient(#ffffff24,#ffffff0a 50%,#ffffff24)}@media(prefers-reduced-motion:no-preference){.gbt-select__trigger:active:not(:disabled){transform:scale(1.04)}}.gbt-select__trigger--open,.gbt-select__trigger--open:hover:not(:disabled){border-color:var(--primary);box-shadow:0 0 0 4px color-mix(in srgb,var(--primary) 12%,transparent)}.gbt-select__trigger:disabled{cursor:not-allowed}:host(.gbt-select--sm){min-width:120px}:host(.gbt-select--sm) .gbt-select__trigger{height:var(--gbt-control-height-sm);padding:0 8px;font-size:13px}.gbt-select__trigger-icon{flex-shrink:0;color:var(--text-secondary)}.gbt-select__trigger-label{flex:1;min-width:0;text-align:left;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.gbt-select__trigger-label--placeholder{color:var(--text-discret)}.gbt-select__chevron{flex-shrink:0;color:var(--text-secondary);transition:transform .2s cubic-bezier(.4,0,.2,1)}.gbt-select__trigger--open .gbt-select__chevron{transform:rotate(180deg)}.gbt-select__panel{position:fixed;z-index:1000;margin:0;padding:6px;list-style:none;max-height:280px;overflow-y:auto;border-radius:var(--gbt-radius-glass);background:var(--gbt-glass-thick);-webkit-backdrop-filter:var(--gbt-liquid-blur);backdrop-filter:var(--gbt-liquid-blur);box-shadow:var(--gbt-depth-liquid);--text-discret: var(--gbt-ground-text-discret);--border-color: var(--gbt-ground-border);--color-success-text: var(--color-success-bg-text);--color-warning-text: var(--color-warning-bg-text);--color-error-text: var(--color-error-bg-text);--text-secondary: var(--gbt-liquid-text);--text-discret: var(--gbt-liquid-text)}@media(prefers-reduced-transparency:reduce){.gbt-select__panel{background:linear-gradient(var(--gbt-glass-thick),var(--gbt-glass-thick)),var(--bg-principal);-webkit-backdrop-filter:none;backdrop-filter:none}}@media(prefers-contrast:more){.gbt-select__panel{box-shadow:inset 0 0 0 1px var(--border-color),var(--gbt-depth-liquid)}}.gbt-select__panel{--gbt-nested-low: light-dark(color-mix(in srgb, var(--text-primary) 20%, transparent), transparent);--gbt-nested-low-soft: light-dark(color-mix(in srgb, var(--text-primary) 8%, transparent), transparent);--gbt-nested-contact: light-dark(var(--gbt-glass-shadow-near), transparent);--gbt-nested-hollow-shade: light-dark(color-mix(in srgb, var(--text-primary) 14%, transparent), transparent);--gbt-nested-hollow-trace: light-dark(color-mix(in srgb, var(--text-primary) 6%, transparent), transparent);--gbt-nested-hollow-light: light-dark(#fff, transparent);--gbt-nested-group-low: light-dark(color-mix(in srgb, var(--text-primary) 12%, transparent), transparent);--gbt-nested-group-shadow: light-dark(var(--gbt-glass-shadow), transparent);box-shadow:var(--gbt-depth-liquid),var(--gbt-depth-glass)}@media(prefers-contrast:more){.gbt-select__panel{box-shadow:inset 0 0 0 1px var(--border-color),var(--gbt-depth-liquid),var(--gbt-depth-glass)}}.gbt-select__panel{animation:gbt-select-scale-in .15s cubic-bezier(.34,1.56,.64,1) both}.gbt-select__panel::-webkit-scrollbar{width:6px}.gbt-select__panel::-webkit-scrollbar-track{background:transparent}.gbt-select__panel::-webkit-scrollbar-thumb{background:var(--bg-hover);border-radius:3px}.gbt-select__empty{box-sizing:border-box;padding:10px 12px;color:var(--text-secondary);font-size:13px}.gbt-select__option{box-sizing:border-box;display:flex;align-items:center;gap:8px;width:100%;padding:8px 10px;background:transparent;border:none;border-radius:var(--gbt-radius-menu, var(--gbt-radius-row));color:var(--text-primary);font-size:14px;text-align:left;cursor:pointer;transition:background .12s cubic-bezier(.4,0,.2,1)}.gbt-select__option:hover,.gbt-select__option--active{background:var(--bg-hover)}.gbt-select__option:active{background:var(--bg-press)}.gbt-select__option--selected{color:var(--primary);font-weight:600}.gbt-select__option-icon{flex-shrink:0;color:var(--text-secondary)}.gbt-select__option--selected .gbt-select__option-icon{color:var(--primary)}.gbt-select__option-label{flex:1;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.gbt-select__option-check{flex-shrink:0;color:var(--primary)}@keyframes gbt-select-scale-in{0%{opacity:0;transform:scale(.97) translateY(-4px)}to{opacity:1;transform:scale(1) translateY(0)}}.gbt-select__chips{display:flex;flex-wrap:wrap;gap:4px}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.gbt-select__hint{margin:0;font-size:.75rem;color:var(--text-secondary)}.gbt-select__error{margin:0;font-size:.75rem;color:var(--color-error-text)}@media(prefers-reduced-motion:reduce){.gbt-select__panel{animation:none}.gbt-select__trigger,.gbt-select__option,.gbt-select__chevron{transition:none}}\n"]
|
|
375
|
+
styles: [":host{position:relative;display:inline-block;min-width:180px}.gbt-select{display:flex;flex-direction:column;gap:.375rem}.gbt-select--disabled{opacity:.5}.gbt-select__label{font-size:.8125rem;font-weight:600;color:var(--text-secondary)}.gbt-select__label--hidden{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}:host(.gbt-select--full){display:block;width:100%}.gbt-select__trigger{box-sizing:border-box;display:flex;align-items:center;gap:8px;width:100%;height:var(--gbt-control-height-md);padding:0 10px;border:1px solid transparent;border-radius:999px;background:var(--gbt-glass-liquid);-webkit-backdrop-filter:var(--gbt-liquid-blur);backdrop-filter:var(--gbt-liquid-blur);box-shadow:var(--gbt-depth-liquid);--text-discret: var(--gbt-ground-text-discret);--border-color: var(--gbt-ground-border);--color-success-text: var(--color-success-bg-text);--color-warning-text: var(--color-warning-bg-text);--color-error-text: var(--color-error-bg-text);--text-secondary: var(--gbt-liquid-text);--text-discret: var(--gbt-liquid-text)}@media(prefers-reduced-transparency:reduce){.gbt-select__trigger{background:linear-gradient(var(--gbt-glass-thick),var(--gbt-glass-thick)),var(--bg-principal);-webkit-backdrop-filter:none;backdrop-filter:none}}@media(prefers-contrast:more){.gbt-select__trigger{box-shadow:inset 0 0 0 1px var(--border-color),var(--gbt-depth-liquid)}}.gbt-select__trigger{box-shadow:var(--gbt-depth-liquid),inset 0 -1px 0 var(--gbt-nested-low, transparent),inset 0 -2px 3px -1px var(--gbt-nested-low-soft, transparent),0 1px 3px var(--gbt-nested-contact, transparent);color:var(--text-primary);font-size:14px;cursor:pointer}@media(prefers-reduced-motion:no-preference){.gbt-select__trigger{transition:transform .6s linear(0,.089,.28,.494,.685,.834,.938,1.001,1.034,1.045,1.044,1.036,1.027,1.017,1.01,1.004,1.001,.999,.998 85%,1),background-color var(--site-transition-fast),color var(--site-transition-fast),box-shadow var(--site-transition-fast),opacity var(--site-transition-fast)}}.gbt-select__trigger:hover:not(:disabled){background-image:linear-gradient(var(--bg-hover),var(--bg-hover))}.gbt-select__trigger:active:not(:disabled){background-image:linear-gradient(#ffffff24,#ffffff0a 50%,#ffffff24)}@media(prefers-reduced-motion:no-preference){.gbt-select__trigger:active:not(:disabled){transform:scale(1.04)}}.gbt-select__trigger--open,.gbt-select__trigger--open:hover:not(:disabled){border-color:var(--gbt-ground-accent, var(--primary));box-shadow:0 0 0 4px color-mix(in srgb,var(--gbt-ground-accent, var(--primary)) 12%,transparent)}.gbt-select__trigger:disabled{cursor:not-allowed}:host(.gbt-select--sm){min-width:120px}:host(.gbt-select--sm) .gbt-select__trigger{height:var(--gbt-control-height-sm);padding:0 8px;font-size:13px}.gbt-select__trigger-icon{flex-shrink:0;color:var(--text-secondary)}.gbt-select__trigger-label{flex:1;min-width:0;text-align:left;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.gbt-select__trigger-label--placeholder{color:var(--text-discret)}.gbt-select__chevron{flex-shrink:0;color:var(--text-secondary);transition:transform .2s cubic-bezier(.4,0,.2,1)}.gbt-select__trigger--open .gbt-select__chevron{transform:rotate(180deg)}.gbt-select__panel{position:fixed;z-index:1000;margin:0;padding:6px;list-style:none;max-height:280px;overflow-y:auto;border-radius:var(--gbt-radius-glass);background:var(--gbt-glass-thick);-webkit-backdrop-filter:var(--gbt-liquid-blur);backdrop-filter:var(--gbt-liquid-blur);box-shadow:var(--gbt-depth-liquid);--text-discret: var(--gbt-ground-text-discret);--border-color: var(--gbt-ground-border);--color-success-text: var(--color-success-bg-text);--color-warning-text: var(--color-warning-bg-text);--color-error-text: var(--color-error-bg-text);--text-secondary: var(--gbt-liquid-text);--text-discret: var(--gbt-liquid-text)}@media(prefers-reduced-transparency:reduce){.gbt-select__panel{background:linear-gradient(var(--gbt-glass-thick),var(--gbt-glass-thick)),var(--bg-principal);-webkit-backdrop-filter:none;backdrop-filter:none}}@media(prefers-contrast:more){.gbt-select__panel{box-shadow:inset 0 0 0 1px var(--border-color),var(--gbt-depth-liquid)}}.gbt-select__panel{--gbt-nested-low: light-dark(color-mix(in srgb, var(--text-primary) 20%, transparent), transparent);--gbt-nested-low-soft: light-dark(color-mix(in srgb, var(--text-primary) 8%, transparent), transparent);--gbt-nested-contact: light-dark(var(--gbt-glass-shadow-near), transparent);--gbt-nested-hollow-shade: light-dark(color-mix(in srgb, var(--text-primary) 14%, transparent), transparent);--gbt-nested-hollow-trace: light-dark(color-mix(in srgb, var(--text-primary) 6%, transparent), transparent);--gbt-nested-hollow-light: light-dark(#fff, transparent);--gbt-nested-group-low: light-dark(color-mix(in srgb, var(--text-primary) 12%, transparent), transparent);--gbt-nested-group-shadow: light-dark(var(--gbt-glass-shadow), transparent);box-shadow:var(--gbt-depth-liquid),var(--gbt-depth-glass)}@media(prefers-contrast:more){.gbt-select__panel{box-shadow:inset 0 0 0 1px var(--border-color),var(--gbt-depth-liquid),var(--gbt-depth-glass)}}.gbt-select__panel{animation:gbt-select-scale-in .15s cubic-bezier(.34,1.56,.64,1) both}.gbt-select__panel::-webkit-scrollbar{width:6px}.gbt-select__panel::-webkit-scrollbar-track{background:transparent}.gbt-select__panel::-webkit-scrollbar-thumb{background:var(--bg-hover);border-radius:3px}.gbt-select__empty{box-sizing:border-box;padding:10px 12px;color:var(--text-secondary);font-size:13px}.gbt-select__option{box-sizing:border-box;display:flex;align-items:center;gap:8px;width:100%;padding:8px 10px;background:transparent;border:none;border-radius:var(--gbt-radius-menu, var(--gbt-radius-row));color:var(--text-primary);font-size:14px;text-align:left;cursor:pointer;transition:background .12s cubic-bezier(.4,0,.2,1)}.gbt-select__option:hover,.gbt-select__option--active{background:var(--bg-hover)}.gbt-select__option:active{background:var(--bg-press)}.gbt-select__option--selected{color:var(--gbt-ground-accent-text, var(--primary));font-weight:600}.gbt-select__option-icon{flex-shrink:0;color:var(--text-secondary)}.gbt-select__option--selected .gbt-select__option-icon{color:var(--gbt-ground-accent-text, var(--primary))}.gbt-select__option-label{flex:1;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.gbt-select__option-check{flex-shrink:0;color:var(--gbt-ground-accent-text, var(--primary))}@keyframes gbt-select-scale-in{0%{opacity:0;transform:scale(.97) translateY(-4px)}to{opacity:1;transform:scale(1) translateY(0)}}.gbt-select__chips{display:flex;flex-wrap:wrap;gap:4px}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.gbt-select__hint{margin:0;font-size:.75rem;color:var(--text-secondary)}.gbt-select__error{margin:0;font-size:.75rem;color:var(--color-error-text)}@media(prefers-reduced-motion:reduce){.gbt-select__panel{animation:none}.gbt-select__trigger,.gbt-select__option,.gbt-select__chevron{transition:none}}\n"]
|
|
376
376
|
}]
|
|
377
377
|
}],
|
|
378
378
|
ctorParameters: () => [],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"masmarino-gabarit-select.mjs","names":[],"sources":["../../../projects/gabarit/select/select.ts","../../../projects/gabarit/select/select.html"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n ElementRef,\n booleanAttribute,\n computed,\n forwardRef,\n inject,\n input,\n signal,\n} from '@angular/core'\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms'\nimport { Icon } from '@masmarino/gabarit/icon'\nimport { Tag } from '@masmarino/gabarit/tag'\nimport { floatingPanelAnchor, followPageScroll } from '@masmarino/gabarit/floating-panel'\n\nexport interface SelectOption<T = string> {\n value: T\n label: string\n icon?: string\n color?: string\n}\n\nlet nextSelectId = 0\n\n@Component({\n selector: 'gbt-select',\n standalone: true,\n imports: [Icon, Tag],\n templateUrl: './select.html',\n styleUrl: './select.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n '(document:click)': 'handleClickOutside($event)',\n '(keydown)': 'onKeydown($event)',\n '(window:resize)': 'updatePanelPosition()',\n '[class.gbt-select--sm]': \"size() === 'sm'\",\n '[class.gbt-select--full]': 'fullWidth()',\n },\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => Select),\n multi: true,\n },\n ],\n})\nexport class Select<T = string> implements ControlValueAccessor {\n private readonly elementRef = inject(ElementRef)\n\n id = input<string>(`gbt-select-${++nextSelectId}`)\n label = input<string>('')\n size = input<'md' | 'sm'>('md')\n hint = input<string>('')\n hideLabel = input(false, { transform: booleanAttribute })\n fullWidth = input(false, { transform: booleanAttribute })\n options = input.required<SelectOption<T>[]>()\n multiple = input(false, { transform: booleanAttribute })\n chips = input(false, { transform: booleanAttribute })\n placeholder = input<string>('Select…')\n disabled = input(false, { transform: booleanAttribute })\n required = input(false, { transform: booleanAttribute })\n errorMessage = input<string | null>(null)\n selectedCountLabel = input<(count: number) => string>((count) => `${count} selected`)\n chipRemoveLabel = input<(label: string) => string>((label) => `Remove ${label}`)\n noOptionsMessage = input<string>('No options')\n\n protected readonly open = signal(false)\n protected readonly activeIndex = signal(-1)\n protected readonly selected = signal<T[]>([])\n protected readonly panelStyle = signal<{ top: string; left: string; width: string } | null>(null)\n private readonly formDisabled = signal(false)\n\n protected readonly labelId = computed(() => `${this.id()}-label`)\n protected readonly chipsId = computed(() => `${this.id()}-chips`)\n protected readonly hintId = computed(() => `${this.id()}-hint`)\n protected readonly showHint = computed(() => !!this.hint() && !this.errorMessage())\n protected readonly isDisabled = computed(() => this.disabled() || this.formDisabled())\n\n private onChange: (value: T | T[] | null) => void = () => {}\n private onTouched: () => void = () => {}\n\n setDisabledState(isDisabled: boolean): void {\n this.formDisabled.set(isDisabled)\n }\n\n writeValue(value: T | T[] | null): void {\n if (this.multiple()) {\n this.selected.set(Array.isArray(value) ? (value as T[]) : [])\n } else {\n this.selected.set(value === null || value === undefined ? [] : [value as T])\n }\n }\n\n registerOnChange(fn: (value: T | T[] | null) => void): void {\n this.onChange = fn\n }\n\n registerOnTouched(fn: () => void): void {\n this.onTouched = fn\n }\n\n protected readonly selectedOptions = computed(() => {\n const selected = this.selected()\n return this.options().filter((option) => selected.includes(option.value))\n })\n\n protected readonly triggerLabel = computed(() => {\n const opts = this.selectedOptions()\n if (opts.length === 0) {\n return this.placeholder()\n }\n if (this.chips() && this.multiple()) {\n return this.placeholder()\n }\n if (this.multiple() && opts.length > 1) {\n return this.selectedCountLabel()(opts.length)\n }\n return opts[0].label\n })\n\n protected readonly chipsVisible = computed(\n () => this.chips() && this.multiple() && this.selectedOptions().length > 0,\n )\n\n protected readonly describedBy = computed(() => {\n const ids: string[] = []\n if (this.chipsVisible()) {\n ids.push(this.chipsId())\n }\n if (this.errorMessage()) {\n ids.push(`${this.id()}-error`)\n } else if (this.showHint()) {\n ids.push(this.hintId())\n }\n return ids.length > 0 ? ids.join(' ') : null\n })\n\n protected readonly triggerIcon = computed(() => {\n const opts = this.selectedOptions()\n return opts.length === 1 ? opts[0].icon : undefined\n })\n\n protected readonly activeOptionId = computed(() =>\n this.open() && this.activeIndex() >= 0 ? `${this.id()}-option-${this.activeIndex()}` : null,\n )\n\n protected readonly hasNoOptions = computed(() => this.options().length === 0)\n\n protected isSelected(value: T): boolean {\n return this.selected().includes(value)\n }\n\n protected toggleOpen(): void {\n if (this.isDisabled()) {\n return\n }\n this.open.update((value) => !value)\n if (this.open()) {\n const options = this.options()\n this.activeIndex.set(\n options.length === 0\n ? -1\n : Math.max(\n 0,\n options.findIndex((o) => this.isSelected(o.value)),\n ),\n )\n this.updatePanelPosition()\n } else {\n this.onTouched()\n }\n }\n\n constructor() {\n followPageScroll(() => this.updatePanelPosition())\n }\n\n protected updatePanelPosition(): void {\n const trigger = this.elementRef.nativeElement.querySelector(\n '.gbt-select__trigger',\n ) as HTMLElement | null\n const anchor = floatingPanelAnchor(this.open(), trigger, (rect) => {\n const chipRow = this.elementRef.nativeElement.querySelector(\n '.gbt-select__chips',\n ) as HTMLElement | null\n return chipRow ? Math.max(rect.bottom, chipRow.getBoundingClientRect().bottom) : rect.bottom\n })\n if (anchor) {\n this.panelStyle.set({\n top: `${anchor.bottom}px`,\n left: `${anchor.left}px`,\n width: `${anchor.rect.width}px`,\n })\n }\n }\n\n protected removeChip(value: T, index: number): void {\n if (this.isDisabled()) {\n return\n }\n const host = this.elementRef.nativeElement as HTMLElement\n const removeButtons = Array.from(\n host.querySelectorAll<HTMLElement>('.gbt-select__chips .gbt-tag__remove'),\n )\n const nextFocus =\n removeButtons[index + 1] ??\n removeButtons[index - 1] ??\n host.querySelector<HTMLElement>('.gbt-select__trigger')\n this.selectOption(value)\n nextFocus?.focus()\n }\n\n protected selectOption(value: T): void {\n if (this.multiple()) {\n const current = this.selected()\n const next = current.includes(value)\n ? current.filter((v) => v !== value)\n : [...current, value]\n this.selected.set(next)\n this.onChange(next)\n this.onTouched()\n } else {\n this.selected.set([value])\n this.onChange(value)\n this.open.set(false)\n this.onTouched()\n }\n }\n\n protected handleClickOutside(event: MouseEvent): void {\n if (this.open() && !this.elementRef.nativeElement.contains(event.target)) {\n this.open.set(false)\n this.onTouched()\n }\n }\n\n protected onKeydown(event: KeyboardEvent): void {\n if (this.isDisabled()) {\n return\n }\n if (!this.open()) {\n if (event.key === 'ArrowDown' || event.key === 'Enter' || event.key === ' ') {\n event.preventDefault()\n this.toggleOpen()\n }\n return\n }\n const options = this.options()\n switch (event.key) {\n case 'Escape':\n event.preventDefault()\n event.stopPropagation()\n this.open.set(false)\n this.onTouched()\n break\n case 'ArrowDown':\n event.preventDefault()\n if (options.length > 0) {\n this.activeIndex.update((i) => Math.min(i + 1, options.length - 1))\n }\n break\n case 'ArrowUp':\n event.preventDefault()\n if (options.length > 0) {\n this.activeIndex.update((i) => Math.max(i - 1, 0))\n }\n break\n case 'Enter':\n case ' ': {\n event.preventDefault()\n const active = options[this.activeIndex()]\n if (active) {\n this.selectOption(active.value)\n }\n break\n }\n }\n }\n}\n","<div class=\"gbt-select\" [class.gbt-select--disabled]=\"isDisabled()\">\n @if (label()) {\n <label\n [id]=\"labelId()\"\n [for]=\"id()\"\n class=\"gbt-select__label\"\n [class.gbt-select__label--hidden]=\"hideLabel()\"\n >{{ label() }}{{ required() ? ' *' : '' }}</label\n >\n }\n\n <button\n type=\"button\"\n [id]=\"id()\"\n class=\"gbt-select__trigger\"\n [class.gbt-select__trigger--open]=\"open()\"\n [disabled]=\"isDisabled()\"\n role=\"combobox\"\n aria-haspopup=\"listbox\"\n [attr.aria-expanded]=\"open()\"\n [attr.aria-controls]=\"open() ? id() + '-listbox' : null\"\n [attr.aria-activedescendant]=\"activeOptionId()\"\n [attr.aria-labelledby]=\"label() ? labelId() + ' ' + id() : null\"\n [attr.aria-label]=\"label() ? null : placeholder() || null\"\n [attr.aria-required]=\"required() ? true : null\"\n [attr.aria-invalid]=\"errorMessage() ? true : null\"\n [attr.aria-describedby]=\"describedBy()\"\n (click)=\"toggleOpen()\"\n >\n @if (triggerIcon(); as icon) {\n <gbt-icon [name]=\"icon\" class=\"gbt-select__trigger-icon\" aria-hidden=\"true\" />\n }\n <span\n class=\"gbt-select__trigger-label\"\n [class.gbt-select__trigger-label--placeholder]=\"selectedOptions().length === 0\"\n >\n {{ triggerLabel() }}\n </span>\n <gbt-icon name=\"chevron-down\" class=\"gbt-select__chevron\" aria-hidden=\"true\" />\n </button>\n @if (chipsVisible()) {\n <div class=\"gbt-select__chips\" [id]=\"chipsId()\">\n @for (option of selectedOptions(); track option.value; let i = $index) {\n <gbt-tag\n [color]=\"option.color ?? '#6b7280'\"\n [removable]=\"!isDisabled()\"\n [disabled]=\"isDisabled()\"\n [removeLabel]=\"chipRemoveLabel()(option.label)\"\n (removed)=\"removeChip(option.value, i)\"\n >\n {{ option.label }}\n </gbt-tag>\n }\n </div>\n }\n @if (chips() && multiple()) {\n <div role=\"status\" aria-live=\"polite\" aria-atomic=\"true\" class=\"sr-only\">\n {{ selectedCountLabel()(selectedOptions().length) }}\n </div>\n }\n @if (open() && panelStyle(); as style) {\n @if (hasNoOptions()) {\n <div\n [id]=\"id() + '-listbox'\"\n class=\"gbt-select__panel gbt-select__empty\"\n role=\"status\"\n [style.top]=\"style.top\"\n [style.left]=\"style.left\"\n [style.width]=\"style.width\"\n >\n {{ noOptionsMessage() }}\n </div>\n } @else {\n <ul\n [id]=\"id() + '-listbox'\"\n class=\"gbt-select__panel\"\n role=\"listbox\"\n [attr.aria-label]=\"label() || placeholder()\"\n [attr.aria-multiselectable]=\"multiple()\"\n [style.top]=\"style.top\"\n [style.left]=\"style.left\"\n [style.width]=\"style.width\"\n >\n @for (option of options(); track option.value; let i = $index) {\n <li role=\"presentation\">\n <button\n [id]=\"id() + '-option-' + i\"\n type=\"button\"\n role=\"option\"\n tabindex=\"-1\"\n class=\"gbt-select__option\"\n [class.gbt-select__option--selected]=\"isSelected(option.value)\"\n [class.gbt-select__option--active]=\"i === activeIndex()\"\n [attr.aria-selected]=\"isSelected(option.value)\"\n (click)=\"selectOption(option.value)\"\n (mouseenter)=\"activeIndex.set(i)\"\n >\n @if (option.icon) {\n <gbt-icon [name]=\"option.icon\" class=\"gbt-select__option-icon\" aria-hidden=\"true\" />\n }\n <span class=\"gbt-select__option-label\">{{ option.label }}</span>\n @if (isSelected(option.value)) {\n <gbt-icon name=\"check\" class=\"gbt-select__option-check\" aria-hidden=\"true\" />\n }\n </button>\n </li>\n }\n </ul>\n }\n }\n @if (showHint()) {\n <p [id]=\"hintId()\" class=\"gbt-select__hint\">{{ hint() }}</p>\n }\n @if (errorMessage()) {\n <p [id]=\"id() + '-error'\" class=\"gbt-select__error\" role=\"alert\">{{ errorMessage() }}</p>\n }\n</div>\n"],"mappings":";;;;;;AAuBA,IAAI,eAAe;AAwBnB,IAAa,SAAb,MAAa,OAAM;CACA,aAAa,OAAO,UAAU;CAE/C,KAAK,MAAc,cAAc,EAAE,gBAAe,GAAA,YAAA,CAAA,EAAA,WAAA,KAAA,CAAA,+BAAA,CAAA,CAAA;CAClD,QAAQ,MAAc,IAAG,GAAA,YAAA,CAAA,EAAA,WAAA,QAAA,CAAA,+BAAA,CAAA,CAAA;CACzB,OAAO,MAAmB,MAAK,GAAA,YAAA,CAAA,EAAA,WAAA,OAAA,CAAA,+BAAA,CAA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GAAA,MAAE;GAAG,UAAA;GAAA,QAAA;IAAA;IAAA;IAAA;IAAA;GAAA;GAAA,SAAA,CAAA,SAAA;EAAA,CAAA;EAAA,iBAAA,GAAA,wBAAA;CAAA,CAAA;;AAmBR,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAM,YAAA,CAAA;EAtBlB,MAAA;EACW,MAAA,CAAA;GAAA,UAAA;GAAY,YACV;GAAI,SACP,CAAC,MAAM,GAAG;GAAC,iBAGH,wBAAwB;GAAM,MACzC;IACJ,oBAAoB;IACpB,aAAa;IACb,mBAAmB;IACnB,0BAA0B;IAC1B,4BAA4B;GAC7B;GAAA,WACU,CACT;IACE,SAAS;IACT,aAAa,iBAAgB,MAAO;IACpC,OAAO;GACR,CACF;GAAA,UAAA;GAAA,QAAA,CAAA,8zNAAA;EAAA,CAAA"}
|
|
1
|
+
{"version":3,"file":"masmarino-gabarit-select.mjs","names":[],"sources":["../../../projects/gabarit/select/select.ts","../../../projects/gabarit/select/select.html"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n ElementRef,\n booleanAttribute,\n computed,\n forwardRef,\n inject,\n input,\n signal,\n} from '@angular/core'\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms'\nimport { Icon } from '@masmarino/gabarit/icon'\nimport { Tag } from '@masmarino/gabarit/tag'\nimport { floatingPanelAnchor, followPageScroll } from '@masmarino/gabarit/floating-panel'\n\nexport interface SelectOption<T = string> {\n value: T\n label: string\n icon?: string\n color?: string\n}\n\nlet nextSelectId = 0\n\n@Component({\n selector: 'gbt-select',\n standalone: true,\n imports: [Icon, Tag],\n templateUrl: './select.html',\n styleUrl: './select.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n '(document:click)': 'handleClickOutside($event)',\n '(keydown)': 'onKeydown($event)',\n '(window:resize)': 'updatePanelPosition()',\n '[class.gbt-select--sm]': \"size() === 'sm'\",\n '[class.gbt-select--full]': 'fullWidth()',\n },\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => Select),\n multi: true,\n },\n ],\n})\nexport class Select<T = string> implements ControlValueAccessor {\n private readonly elementRef = inject(ElementRef)\n\n id = input<string>(`gbt-select-${++nextSelectId}`)\n label = input<string>('')\n size = input<'md' | 'sm'>('md')\n hint = input<string>('')\n hideLabel = input(false, { transform: booleanAttribute })\n fullWidth = input(false, { transform: booleanAttribute })\n options = input.required<SelectOption<T>[]>()\n multiple = input(false, { transform: booleanAttribute })\n chips = input(false, { transform: booleanAttribute })\n placeholder = input<string>('Select…')\n disabled = input(false, { transform: booleanAttribute })\n required = input(false, { transform: booleanAttribute })\n errorMessage = input<string | null>(null)\n selectedCountLabel = input<(count: number) => string>((count) => `${count} selected`)\n chipRemoveLabel = input<(label: string) => string>((label) => `Remove ${label}`)\n noOptionsMessage = input<string>('No options')\n\n protected readonly open = signal(false)\n protected readonly activeIndex = signal(-1)\n protected readonly selected = signal<T[]>([])\n protected readonly panelStyle = signal<{ top: string; left: string; width: string } | null>(null)\n private readonly formDisabled = signal(false)\n\n protected readonly labelId = computed(() => `${this.id()}-label`)\n protected readonly chipsId = computed(() => `${this.id()}-chips`)\n protected readonly hintId = computed(() => `${this.id()}-hint`)\n protected readonly showHint = computed(() => !!this.hint() && !this.errorMessage())\n protected readonly isDisabled = computed(() => this.disabled() || this.formDisabled())\n\n private onChange: (value: T | T[] | null) => void = () => {}\n private onTouched: () => void = () => {}\n\n setDisabledState(isDisabled: boolean): void {\n this.formDisabled.set(isDisabled)\n }\n\n writeValue(value: T | T[] | null): void {\n if (this.multiple()) {\n this.selected.set(Array.isArray(value) ? (value as T[]) : [])\n } else {\n this.selected.set(value === null || value === undefined ? [] : [value as T])\n }\n }\n\n registerOnChange(fn: (value: T | T[] | null) => void): void {\n this.onChange = fn\n }\n\n registerOnTouched(fn: () => void): void {\n this.onTouched = fn\n }\n\n protected readonly selectedOptions = computed(() => {\n const selected = this.selected()\n return this.options().filter((option) => selected.includes(option.value))\n })\n\n protected readonly triggerLabel = computed(() => {\n const opts = this.selectedOptions()\n if (opts.length === 0) {\n return this.placeholder()\n }\n if (this.chips() && this.multiple()) {\n return this.placeholder()\n }\n if (this.multiple() && opts.length > 1) {\n return this.selectedCountLabel()(opts.length)\n }\n return opts[0].label\n })\n\n protected readonly chipsVisible = computed(\n () => this.chips() && this.multiple() && this.selectedOptions().length > 0,\n )\n\n protected readonly describedBy = computed(() => {\n const ids: string[] = []\n if (this.chipsVisible()) {\n ids.push(this.chipsId())\n }\n if (this.errorMessage()) {\n ids.push(`${this.id()}-error`)\n } else if (this.showHint()) {\n ids.push(this.hintId())\n }\n return ids.length > 0 ? ids.join(' ') : null\n })\n\n protected readonly triggerIcon = computed(() => {\n const opts = this.selectedOptions()\n return opts.length === 1 ? opts[0].icon : undefined\n })\n\n protected readonly activeOptionId = computed(() =>\n this.open() && this.activeIndex() >= 0 ? `${this.id()}-option-${this.activeIndex()}` : null,\n )\n\n protected readonly hasNoOptions = computed(() => this.options().length === 0)\n\n protected isSelected(value: T): boolean {\n return this.selected().includes(value)\n }\n\n protected toggleOpen(): void {\n if (this.isDisabled()) {\n return\n }\n this.open.update((value) => !value)\n if (this.open()) {\n const options = this.options()\n this.activeIndex.set(\n options.length === 0\n ? -1\n : Math.max(\n 0,\n options.findIndex((o) => this.isSelected(o.value)),\n ),\n )\n this.updatePanelPosition()\n } else {\n this.onTouched()\n }\n }\n\n constructor() {\n followPageScroll(() => this.updatePanelPosition())\n }\n\n protected updatePanelPosition(): void {\n const trigger = this.elementRef.nativeElement.querySelector(\n '.gbt-select__trigger',\n ) as HTMLElement | null\n const anchor = floatingPanelAnchor(this.open(), trigger, (rect) => {\n const chipRow = this.elementRef.nativeElement.querySelector(\n '.gbt-select__chips',\n ) as HTMLElement | null\n return chipRow ? Math.max(rect.bottom, chipRow.getBoundingClientRect().bottom) : rect.bottom\n })\n if (anchor) {\n this.panelStyle.set({\n top: `${anchor.bottom}px`,\n left: `${anchor.left}px`,\n width: `${anchor.rect.width}px`,\n })\n }\n }\n\n protected removeChip(value: T, index: number): void {\n if (this.isDisabled()) {\n return\n }\n const host = this.elementRef.nativeElement as HTMLElement\n const removeButtons = Array.from(\n host.querySelectorAll<HTMLElement>('.gbt-select__chips .gbt-tag__remove'),\n )\n const nextFocus =\n removeButtons[index + 1] ??\n removeButtons[index - 1] ??\n host.querySelector<HTMLElement>('.gbt-select__trigger')\n this.selectOption(value)\n nextFocus?.focus()\n }\n\n protected selectOption(value: T): void {\n if (this.multiple()) {\n const current = this.selected()\n const next = current.includes(value)\n ? current.filter((v) => v !== value)\n : [...current, value]\n this.selected.set(next)\n this.onChange(next)\n this.onTouched()\n } else {\n this.selected.set([value])\n this.onChange(value)\n this.open.set(false)\n this.onTouched()\n }\n }\n\n protected handleClickOutside(event: MouseEvent): void {\n if (this.open() && !this.elementRef.nativeElement.contains(event.target)) {\n this.open.set(false)\n this.onTouched()\n }\n }\n\n protected onKeydown(event: KeyboardEvent): void {\n if (this.isDisabled()) {\n return\n }\n if (!this.open()) {\n if (event.key === 'ArrowDown' || event.key === 'Enter' || event.key === ' ') {\n event.preventDefault()\n this.toggleOpen()\n }\n return\n }\n const options = this.options()\n switch (event.key) {\n case 'Escape':\n event.preventDefault()\n event.stopPropagation()\n this.open.set(false)\n this.onTouched()\n break\n case 'ArrowDown':\n event.preventDefault()\n if (options.length > 0) {\n this.activeIndex.update((i) => Math.min(i + 1, options.length - 1))\n }\n break\n case 'ArrowUp':\n event.preventDefault()\n if (options.length > 0) {\n this.activeIndex.update((i) => Math.max(i - 1, 0))\n }\n break\n case 'Enter':\n case ' ': {\n event.preventDefault()\n const active = options[this.activeIndex()]\n if (active) {\n this.selectOption(active.value)\n }\n break\n }\n }\n }\n}\n","<div class=\"gbt-select\" [class.gbt-select--disabled]=\"isDisabled()\">\n @if (label()) {\n <label\n [id]=\"labelId()\"\n [for]=\"id()\"\n class=\"gbt-select__label\"\n [class.gbt-select__label--hidden]=\"hideLabel()\"\n >{{ label() }}{{ required() ? ' *' : '' }}</label\n >\n }\n\n <button\n type=\"button\"\n [id]=\"id()\"\n class=\"gbt-select__trigger\"\n [class.gbt-select__trigger--open]=\"open()\"\n [disabled]=\"isDisabled()\"\n role=\"combobox\"\n aria-haspopup=\"listbox\"\n [attr.aria-expanded]=\"open()\"\n [attr.aria-controls]=\"open() ? id() + '-listbox' : null\"\n [attr.aria-activedescendant]=\"activeOptionId()\"\n [attr.aria-labelledby]=\"label() ? labelId() + ' ' + id() : null\"\n [attr.aria-label]=\"label() ? null : placeholder() || null\"\n [attr.aria-required]=\"required() ? true : null\"\n [attr.aria-invalid]=\"errorMessage() ? true : null\"\n [attr.aria-describedby]=\"describedBy()\"\n (click)=\"toggleOpen()\"\n >\n @if (triggerIcon(); as icon) {\n <gbt-icon [name]=\"icon\" class=\"gbt-select__trigger-icon\" aria-hidden=\"true\" />\n }\n <span\n class=\"gbt-select__trigger-label\"\n [class.gbt-select__trigger-label--placeholder]=\"selectedOptions().length === 0\"\n >\n {{ triggerLabel() }}\n </span>\n <gbt-icon name=\"chevron-down\" class=\"gbt-select__chevron\" aria-hidden=\"true\" />\n </button>\n @if (chipsVisible()) {\n <div class=\"gbt-select__chips\" [id]=\"chipsId()\">\n @for (option of selectedOptions(); track option.value; let i = $index) {\n <gbt-tag\n [color]=\"option.color ?? '#6b7280'\"\n [removable]=\"!isDisabled()\"\n [disabled]=\"isDisabled()\"\n [removeLabel]=\"chipRemoveLabel()(option.label)\"\n (removed)=\"removeChip(option.value, i)\"\n >\n {{ option.label }}\n </gbt-tag>\n }\n </div>\n }\n @if (chips() && multiple()) {\n <div role=\"status\" aria-live=\"polite\" aria-atomic=\"true\" class=\"sr-only\">\n {{ selectedCountLabel()(selectedOptions().length) }}\n </div>\n }\n @if (open() && panelStyle(); as style) {\n @if (hasNoOptions()) {\n <div\n [id]=\"id() + '-listbox'\"\n class=\"gbt-select__panel gbt-select__empty\"\n role=\"status\"\n [style.top]=\"style.top\"\n [style.left]=\"style.left\"\n [style.width]=\"style.width\"\n >\n {{ noOptionsMessage() }}\n </div>\n } @else {\n <ul\n [id]=\"id() + '-listbox'\"\n class=\"gbt-select__panel\"\n role=\"listbox\"\n [attr.aria-label]=\"label() || placeholder()\"\n [attr.aria-multiselectable]=\"multiple()\"\n [style.top]=\"style.top\"\n [style.left]=\"style.left\"\n [style.width]=\"style.width\"\n >\n @for (option of options(); track option.value; let i = $index) {\n <li role=\"presentation\">\n <button\n [id]=\"id() + '-option-' + i\"\n type=\"button\"\n role=\"option\"\n tabindex=\"-1\"\n class=\"gbt-select__option\"\n [class.gbt-select__option--selected]=\"isSelected(option.value)\"\n [class.gbt-select__option--active]=\"i === activeIndex()\"\n [attr.aria-selected]=\"isSelected(option.value)\"\n (click)=\"selectOption(option.value)\"\n (mouseenter)=\"activeIndex.set(i)\"\n >\n @if (option.icon) {\n <gbt-icon [name]=\"option.icon\" class=\"gbt-select__option-icon\" aria-hidden=\"true\" />\n }\n <span class=\"gbt-select__option-label\">{{ option.label }}</span>\n @if (isSelected(option.value)) {\n <gbt-icon name=\"check\" class=\"gbt-select__option-check\" aria-hidden=\"true\" />\n }\n </button>\n </li>\n }\n </ul>\n }\n }\n @if (showHint()) {\n <p [id]=\"hintId()\" class=\"gbt-select__hint\">{{ hint() }}</p>\n }\n @if (errorMessage()) {\n <p [id]=\"id() + '-error'\" class=\"gbt-select__error\" role=\"alert\">{{ errorMessage() }}</p>\n }\n</div>\n"],"mappings":";;;;;;AAuBA,IAAI,eAAe;AAwBnB,IAAa,SAAb,MAAa,OAAM;CACA,aAAa,OAAO,UAAU;CAE/C,KAAK,MAAc,cAAc,EAAE,gBAAe,GAAA,YAAA,CAAA,EAAA,WAAA,KAAA,CAAA,+BAAA,CAAA,CAAA;CAClD,QAAQ,MAAc,IAAG,GAAA,YAAA,CAAA,EAAA,WAAA,QAAA,CAAA,+BAAA,CAAA,CAAA;CACzB,OAAO,MAAmB,MAAK,GAAA,YA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A,QAAA,CAAA,MAAA;EAAA,GAAA;GAAA,MAAA;GAAA,MAAE;GAAG,UAAA;GAAA,QAAA;IAAA;IAAA;IAAA;IAAA;GAAA;GAAA,SAAA,CAAA,SAAA;EAAA,CAAA;EAAA,iBAAA,GAAA,wBAAA;CAAA,CAAA;;AAmBR,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAM,YAAA,CAAA;EAtBlB,MAAA;EACW,MAAA,CAAA;GAAA,UAAA;GAAY,YACV;GAAI,SACP,CAAC,MAAM,GAAG;GAAC,iBAGH,wBAAwB;GAAM,MACzC;IACJ,oBAAoB;IACpB,aAAa;IACb,mBAAmB;IACnB,0BAA0B;IAC1B,4BAA4B;GAC7B;GAAA,WACU,CACT;IACE,SAAS;IACT,aAAa,iBAAgB,MAAO;IACpC,OAAO;GACR,CACF;GAAA,UAAA;GAAA,QAAA,CAAA,+8NAAA;EAAA,CAAA"}
|
|
@@ -134,7 +134,7 @@ var Slider = class Slider {
|
|
|
134
134
|
}],
|
|
135
135
|
ngImport: i0,
|
|
136
136
|
template: "<div class=\"gbt-slider\">\n <div class=\"gbt-slider__header\">\n <label [for]=\"id()\">{{ label() }}</label>\n @if (showValue()) {\n <span class=\"gbt-slider__value\">{{ formatValue()(value()) }}</span>\n }\n </div>\n <input\n type=\"range\"\n [id]=\"id()\"\n [min]=\"min()\"\n [max]=\"max()\"\n [step]=\"step()\"\n [value]=\"value()\"\n [disabled]=\"isDisabled()\"\n [style.--gbt-slider-fill.%]=\"fillPercent()\"\n [attr.aria-invalid]=\"errorMessage() ? true : null\"\n [attr.aria-describedby]=\"errorMessage() ? id() + '-error' : null\"\n (input)=\"onInput($event)\"\n (blur)=\"onBlur()\"\n />\n @if (errorMessage()) {\n <p [id]=\"id() + '-error'\" class=\"gbt-slider__error\" role=\"alert\">{{ errorMessage() }}</p>\n }\n</div>\n",
|
|
137
|
-
styles: [".gbt-slider{display:flex;flex-direction:column;gap:.375rem}.gbt-slider label{font-size:.8125rem;font-weight:600;color:var(--text-secondary)}.gbt-slider__header{display:flex;align-items:baseline;justify-content:space-between;gap:.5rem}.gbt-slider__value{font-size:.8125rem;font-weight:600;color:var(--text-primary)}.gbt-slider__error{margin:0;font-size:.75rem;color:var(--color-error-text)}input[type=range]{--gbt-slider-fill: 0;box-sizing:border-box;width:100%;height:20px;padding:0;background:transparent;appearance:none;cursor:pointer}input[type=range]:disabled{cursor:not-allowed;opacity:.5}input[type=range]:focus-visible{outline:none}input[type=range]::-webkit-slider-runnable-track{height:4px;border-radius:999px;box-shadow:var(--gbt-depth-hollow);background:linear-gradient(to right,var(--accent) 0%,var(--accent) var(--gbt-slider-fill),var(--border-color) var(--gbt-slider-fill),var(--border-color) 100%)}input[type=range]::-webkit-slider-thumb{box-sizing:border-box;width:18px;height:18px;margin-top:-7px;background:var(--gbt-knob);border:1px solid var(--border-color);border-radius:50%;box-shadow:var(--gbt-depth-knob);appearance:none;cursor:pointer;transition:scale .6s linear(0,.089,.28,.494,.685,.834,.938,1.001,1.034,1.045,1.044,1.036,1.027,1.017,1.01,1.004,1.001,.999,.998 85%,1)}@media(prefers-reduced-motion:reduce){input[type=range]::-webkit-slider-thumb{transition:none}}input[type=range]:not(:disabled):hover::-webkit-slider-thumb{border-color:var(--text-discret);box-shadow:var(--gbt-depth-knob-hover)}input[type=range]:not(:disabled):active::-webkit-slider-thumb{border-color:transparent;background:linear-gradient(#ffffff24,#ffffff0a 50%,#ffffff24),var(--gbt-glass-regular);box-shadow:var(--gbt-depth-liquid),0 1px 4px var(--gbt-liquid-shadow)}@media(prefers-reduced-motion:no-preference){input[type=range]:not(:disabled):active::-webkit-slider-thumb{scale:1.04}}@media(prefers-reduced-transparency:reduce){input[type=range]:not(:disabled):active::-webkit-slider-thumb{border-color:var(--accent);background:var(--gbt-knob);-webkit-backdrop-filter:none;backdrop-filter:none}}input[type=range]:focus-visible::-webkit-slider-thumb{outline:2px solid var(--gbt-focus-ring, var(--focus-ring));outline-offset:2px}input[type=range]::-moz-range-track{height:4px;border-radius:999px;box-shadow:var(--gbt-depth-hollow);background:var(--border-color)}input[type=range]::-moz-range-progress{height:4px;border-radius:999px;background:var(--accent);box-shadow:var(--gbt-
|
|
137
|
+
styles: [".gbt-slider{display:flex;flex-direction:column;gap:.375rem}.gbt-slider label{font-size:.8125rem;font-weight:600;color:var(--text-secondary)}.gbt-slider__header{display:flex;align-items:baseline;justify-content:space-between;gap:.5rem}.gbt-slider__value{font-size:.8125rem;font-weight:600;color:var(--text-primary)}.gbt-slider__error{margin:0;font-size:.75rem;color:var(--color-error-text)}input[type=range]{--gbt-slider-fill: 0;box-sizing:border-box;width:100%;height:20px;padding:0;background:transparent;appearance:none;cursor:pointer}input[type=range]:disabled{cursor:not-allowed;opacity:.5}input[type=range]:focus-visible{outline:none}input[type=range]::-webkit-slider-runnable-track{height:4px;border-radius:999px;box-shadow:var(--gbt-depth-hollow);background:linear-gradient(to right,var(--gbt-ground-accent, var(--accent)) 0%,var(--gbt-ground-accent, var(--accent)) var(--gbt-slider-fill),var(--border-color) var(--gbt-slider-fill),var(--border-color) 100%)}input[type=range]::-webkit-slider-thumb{box-sizing:border-box;width:18px;height:18px;margin-top:-7px;background:var(--gbt-knob);border:1px solid var(--border-color);border-radius:50%;box-shadow:var(--gbt-depth-knob);appearance:none;cursor:pointer;transition:scale .6s linear(0,.089,.28,.494,.685,.834,.938,1.001,1.034,1.045,1.044,1.036,1.027,1.017,1.01,1.004,1.001,.999,.998 85%,1)}@media(prefers-reduced-motion:reduce){input[type=range]::-webkit-slider-thumb{transition:none}}input[type=range]:not(:disabled):hover::-webkit-slider-thumb{border-color:var(--text-discret);box-shadow:var(--gbt-depth-knob-hover)}input[type=range]:not(:disabled):active::-webkit-slider-thumb{border-color:transparent;background:linear-gradient(#ffffff24,#ffffff0a 50%,#ffffff24),var(--gbt-glass-regular);box-shadow:var(--gbt-depth-liquid),0 1px 4px var(--gbt-liquid-shadow)}@media(prefers-reduced-motion:no-preference){input[type=range]:not(:disabled):active::-webkit-slider-thumb{scale:1.04}}@media(prefers-reduced-transparency:reduce){input[type=range]:not(:disabled):active::-webkit-slider-thumb{border-color:var(--gbt-ground-accent, var(--accent));background:var(--gbt-knob);-webkit-backdrop-filter:none;backdrop-filter:none}}input[type=range]:focus-visible::-webkit-slider-thumb{outline:2px solid var(--gbt-focus-ring, var(--gbt-ground-accent, var(--focus-ring)));outline-offset:2px}input[type=range]::-moz-range-track{height:4px;border-radius:999px;box-shadow:var(--gbt-depth-hollow);background:var(--border-color)}input[type=range]::-moz-range-progress{height:4px;border-radius:999px;background:var(--gbt-ground-accent, var(--accent));box-shadow:0 0 10px color-mix(in srgb,var(--gbt-ground-accent, var(--accent)) 45%,transparent)}input[type=range]::-moz-range-thumb{box-sizing:border-box;width:18px;height:18px;background:var(--gbt-knob);border:1px solid var(--border-color);border-radius:50%;box-shadow:var(--gbt-depth-knob);cursor:pointer}input[type=range]:not(:disabled):hover::-moz-range-thumb{border-color:var(--text-discret);box-shadow:var(--gbt-depth-knob-hover)}input[type=range]:not(:disabled):active::-moz-range-thumb{border-color:transparent;background:linear-gradient(#ffffff24,#ffffff0a 50%,#ffffff24),var(--gbt-glass-regular);box-shadow:var(--gbt-depth-liquid),0 1px 4px var(--gbt-liquid-shadow)}@media(prefers-reduced-motion:no-preference){input[type=range]:not(:disabled):active::-moz-range-thumb{scale:1.04}}@media(prefers-reduced-transparency:reduce){input[type=range]:not(:disabled):active::-moz-range-thumb{border-color:var(--gbt-ground-accent, var(--accent));background:var(--gbt-knob);-webkit-backdrop-filter:none;backdrop-filter:none}}input[type=range]:focus-visible::-moz-range-thumb{outline:2px solid var(--gbt-focus-ring, var(--gbt-ground-accent, var(--focus-ring)));outline-offset:2px}\n"],
|
|
138
138
|
changeDetection: i0.ChangeDetectionStrategy.OnPush
|
|
139
139
|
});
|
|
140
140
|
};
|
|
@@ -156,7 +156,7 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
156
156
|
multi: true
|
|
157
157
|
}],
|
|
158
158
|
template: "<div class=\"gbt-slider\">\n <div class=\"gbt-slider__header\">\n <label [for]=\"id()\">{{ label() }}</label>\n @if (showValue()) {\n <span class=\"gbt-slider__value\">{{ formatValue()(value()) }}</span>\n }\n </div>\n <input\n type=\"range\"\n [id]=\"id()\"\n [min]=\"min()\"\n [max]=\"max()\"\n [step]=\"step()\"\n [value]=\"value()\"\n [disabled]=\"isDisabled()\"\n [style.--gbt-slider-fill.%]=\"fillPercent()\"\n [attr.aria-invalid]=\"errorMessage() ? true : null\"\n [attr.aria-describedby]=\"errorMessage() ? id() + '-error' : null\"\n (input)=\"onInput($event)\"\n (blur)=\"onBlur()\"\n />\n @if (errorMessage()) {\n <p [id]=\"id() + '-error'\" class=\"gbt-slider__error\" role=\"alert\">{{ errorMessage() }}</p>\n }\n</div>\n",
|
|
159
|
-
styles: [".gbt-slider{display:flex;flex-direction:column;gap:.375rem}.gbt-slider label{font-size:.8125rem;font-weight:600;color:var(--text-secondary)}.gbt-slider__header{display:flex;align-items:baseline;justify-content:space-between;gap:.5rem}.gbt-slider__value{font-size:.8125rem;font-weight:600;color:var(--text-primary)}.gbt-slider__error{margin:0;font-size:.75rem;color:var(--color-error-text)}input[type=range]{--gbt-slider-fill: 0;box-sizing:border-box;width:100%;height:20px;padding:0;background:transparent;appearance:none;cursor:pointer}input[type=range]:disabled{cursor:not-allowed;opacity:.5}input[type=range]:focus-visible{outline:none}input[type=range]::-webkit-slider-runnable-track{height:4px;border-radius:999px;box-shadow:var(--gbt-depth-hollow);background:linear-gradient(to right,var(--accent) 0%,var(--accent) var(--gbt-slider-fill),var(--border-color) var(--gbt-slider-fill),var(--border-color) 100%)}input[type=range]::-webkit-slider-thumb{box-sizing:border-box;width:18px;height:18px;margin-top:-7px;background:var(--gbt-knob);border:1px solid var(--border-color);border-radius:50%;box-shadow:var(--gbt-depth-knob);appearance:none;cursor:pointer;transition:scale .6s linear(0,.089,.28,.494,.685,.834,.938,1.001,1.034,1.045,1.044,1.036,1.027,1.017,1.01,1.004,1.001,.999,.998 85%,1)}@media(prefers-reduced-motion:reduce){input[type=range]::-webkit-slider-thumb{transition:none}}input[type=range]:not(:disabled):hover::-webkit-slider-thumb{border-color:var(--text-discret);box-shadow:var(--gbt-depth-knob-hover)}input[type=range]:not(:disabled):active::-webkit-slider-thumb{border-color:transparent;background:linear-gradient(#ffffff24,#ffffff0a 50%,#ffffff24),var(--gbt-glass-regular);box-shadow:var(--gbt-depth-liquid),0 1px 4px var(--gbt-liquid-shadow)}@media(prefers-reduced-motion:no-preference){input[type=range]:not(:disabled):active::-webkit-slider-thumb{scale:1.04}}@media(prefers-reduced-transparency:reduce){input[type=range]:not(:disabled):active::-webkit-slider-thumb{border-color:var(--accent);background:var(--gbt-knob);-webkit-backdrop-filter:none;backdrop-filter:none}}input[type=range]:focus-visible::-webkit-slider-thumb{outline:2px solid var(--gbt-focus-ring, var(--focus-ring));outline-offset:2px}input[type=range]::-moz-range-track{height:4px;border-radius:999px;box-shadow:var(--gbt-depth-hollow);background:var(--border-color)}input[type=range]::-moz-range-progress{height:4px;border-radius:999px;background:var(--accent);box-shadow:var(--gbt-
|
|
159
|
+
styles: [".gbt-slider{display:flex;flex-direction:column;gap:.375rem}.gbt-slider label{font-size:.8125rem;font-weight:600;color:var(--text-secondary)}.gbt-slider__header{display:flex;align-items:baseline;justify-content:space-between;gap:.5rem}.gbt-slider__value{font-size:.8125rem;font-weight:600;color:var(--text-primary)}.gbt-slider__error{margin:0;font-size:.75rem;color:var(--color-error-text)}input[type=range]{--gbt-slider-fill: 0;box-sizing:border-box;width:100%;height:20px;padding:0;background:transparent;appearance:none;cursor:pointer}input[type=range]:disabled{cursor:not-allowed;opacity:.5}input[type=range]:focus-visible{outline:none}input[type=range]::-webkit-slider-runnable-track{height:4px;border-radius:999px;box-shadow:var(--gbt-depth-hollow);background:linear-gradient(to right,var(--gbt-ground-accent, var(--accent)) 0%,var(--gbt-ground-accent, var(--accent)) var(--gbt-slider-fill),var(--border-color) var(--gbt-slider-fill),var(--border-color) 100%)}input[type=range]::-webkit-slider-thumb{box-sizing:border-box;width:18px;height:18px;margin-top:-7px;background:var(--gbt-knob);border:1px solid var(--border-color);border-radius:50%;box-shadow:var(--gbt-depth-knob);appearance:none;cursor:pointer;transition:scale .6s linear(0,.089,.28,.494,.685,.834,.938,1.001,1.034,1.045,1.044,1.036,1.027,1.017,1.01,1.004,1.001,.999,.998 85%,1)}@media(prefers-reduced-motion:reduce){input[type=range]::-webkit-slider-thumb{transition:none}}input[type=range]:not(:disabled):hover::-webkit-slider-thumb{border-color:var(--text-discret);box-shadow:var(--gbt-depth-knob-hover)}input[type=range]:not(:disabled):active::-webkit-slider-thumb{border-color:transparent;background:linear-gradient(#ffffff24,#ffffff0a 50%,#ffffff24),var(--gbt-glass-regular);box-shadow:var(--gbt-depth-liquid),0 1px 4px var(--gbt-liquid-shadow)}@media(prefers-reduced-motion:no-preference){input[type=range]:not(:disabled):active::-webkit-slider-thumb{scale:1.04}}@media(prefers-reduced-transparency:reduce){input[type=range]:not(:disabled):active::-webkit-slider-thumb{border-color:var(--gbt-ground-accent, var(--accent));background:var(--gbt-knob);-webkit-backdrop-filter:none;backdrop-filter:none}}input[type=range]:focus-visible::-webkit-slider-thumb{outline:2px solid var(--gbt-focus-ring, var(--gbt-ground-accent, var(--focus-ring)));outline-offset:2px}input[type=range]::-moz-range-track{height:4px;border-radius:999px;box-shadow:var(--gbt-depth-hollow);background:var(--border-color)}input[type=range]::-moz-range-progress{height:4px;border-radius:999px;background:var(--gbt-ground-accent, var(--accent));box-shadow:0 0 10px color-mix(in srgb,var(--gbt-ground-accent, var(--accent)) 45%,transparent)}input[type=range]::-moz-range-thumb{box-sizing:border-box;width:18px;height:18px;background:var(--gbt-knob);border:1px solid var(--border-color);border-radius:50%;box-shadow:var(--gbt-depth-knob);cursor:pointer}input[type=range]:not(:disabled):hover::-moz-range-thumb{border-color:var(--text-discret);box-shadow:var(--gbt-depth-knob-hover)}input[type=range]:not(:disabled):active::-moz-range-thumb{border-color:transparent;background:linear-gradient(#ffffff24,#ffffff0a 50%,#ffffff24),var(--gbt-glass-regular);box-shadow:var(--gbt-depth-liquid),0 1px 4px var(--gbt-liquid-shadow)}@media(prefers-reduced-motion:no-preference){input[type=range]:not(:disabled):active::-moz-range-thumb{scale:1.04}}@media(prefers-reduced-transparency:reduce){input[type=range]:not(:disabled):active::-moz-range-thumb{border-color:var(--gbt-ground-accent, var(--accent));background:var(--gbt-knob);-webkit-backdrop-filter:none;backdrop-filter:none}}input[type=range]:focus-visible::-moz-range-thumb{outline:2px solid var(--gbt-focus-ring, var(--gbt-ground-accent, var(--focus-ring)));outline-offset:2px}\n"]
|
|
160
160
|
}]
|
|
161
161
|
}],
|
|
162
162
|
propDecorators: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"masmarino-gabarit-slider.mjs","names":[],"sources":["../../../projects/gabarit/slider/slider.ts","../../../projects/gabarit/slider/slider.html"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n booleanAttribute,\n computed,\n forwardRef,\n input,\n signal,\n} from '@angular/core'\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms'\n\nlet nextId = 0\n\n@Component({\n selector: 'gbt-slider',\n standalone: true,\n imports: [],\n templateUrl: './slider.html',\n styleUrl: './slider.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => Slider),\n multi: true,\n },\n ],\n})\nexport class Slider implements ControlValueAccessor {\n id = input<string>(`gbt-slider-${++nextId}`)\n label = input.required<string>()\n min = input(0)\n max = input(100)\n step = input(1)\n disabled = input(false, { transform: booleanAttribute })\n errorMessage = input<string | null>(null)\n showValue = input(true, { transform: booleanAttribute })\n formatValue = input<(value: number) => string>((value) => `${value}`)\n\n protected readonly value = signal(0)\n\n private readonly formDisabled = signal(false)\n protected readonly isDisabled = computed(() => this.disabled() || this.formDisabled())\n\n protected readonly fillPercent = computed(() => {\n const range = this.max() - this.min()\n if (range <= 0) {\n return 0\n }\n return ((this.value() - this.min()) / range) * 100\n })\n\n private onChange: (value: number) => void = () => {}\n private onTouched: () => void = () => {}\n\n writeValue(value: number): void {\n this.value.set(value ?? 0)\n }\n\n registerOnChange(fn: (value: number) => void): void {\n this.onChange = fn\n }\n\n registerOnTouched(fn: () => void): void {\n this.onTouched = fn\n }\n\n setDisabledState(isDisabled: boolean): void {\n this.formDisabled.set(isDisabled)\n }\n\n protected onInput(event: Event): void {\n const value = Number((event.target as HTMLInputElement).value)\n this.value.set(value)\n this.onChange(value)\n }\n\n protected onBlur(): void {\n this.onTouched()\n }\n}\n","<div class=\"gbt-slider\">\n <div class=\"gbt-slider__header\">\n <label [for]=\"id()\">{{ label() }}</label>\n @if (showValue()) {\n <span class=\"gbt-slider__value\">{{ formatValue()(value()) }}</span>\n }\n </div>\n <input\n type=\"range\"\n [id]=\"id()\"\n [min]=\"min()\"\n [max]=\"max()\"\n [step]=\"step()\"\n [value]=\"value()\"\n [disabled]=\"isDisabled()\"\n [style.--gbt-slider-fill.%]=\"fillPercent()\"\n [attr.aria-invalid]=\"errorMessage() ? true : null\"\n [attr.aria-describedby]=\"errorMessage() ? id() + '-error' : null\"\n (input)=\"onInput($event)\"\n (blur)=\"onBlur()\"\n />\n @if (errorMessage()) {\n <p [id]=\"id() + '-error'\" class=\"gbt-slider__error\" role=\"alert\">{{ errorMessage() }}</p>\n }\n</div>\n"],"mappings":";;;AAWA,IAAI,SAAS;AAiBb,IAAa,SAAb,MAAa,OAAM;CACjB,KAAK,MAAc,cAAc,EAAE,UAAS,GAAA,YAAA,CAAA,EAAA,WAAA,KAAA,CAAA,+BAAA,CAAA,CAAA;CAC5C,QAAQ,MAAM,SAAkB,GAAA,YAAA,CAAA,EAAA,WAAA,QAAA,CAAA,+BAAA,CAAA,CAAA;CAChC,MAAM,MAAM,GAAE,GAAA,YAAA,CAAA,EAAA,WAAA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IAAA,mBAAA;GAAA;EAAA;EAAA,WARN,CACT;GACE,SAAS;GACT,aAAa,iBAAiB,MAAM;GACpC,OAAO;EACR,CACF;EAAA,UAAA;EAAA,UC1BH;EAyBA,QAAA,CAAA,
|
|
1
|
+
{"version":3,"file":"masmarino-gabarit-slider.mjs","names":[],"sources":["../../../projects/gabarit/slider/slider.ts","../../../projects/gabarit/slider/slider.html"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n booleanAttribute,\n computed,\n forwardRef,\n input,\n signal,\n} from '@angular/core'\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms'\n\nlet nextId = 0\n\n@Component({\n selector: 'gbt-slider',\n standalone: true,\n imports: [],\n templateUrl: './slider.html',\n styleUrl: './slider.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => Slider),\n multi: true,\n },\n ],\n})\nexport class Slider implements ControlValueAccessor {\n id = input<string>(`gbt-slider-${++nextId}`)\n label = input.required<string>()\n min = input(0)\n max = input(100)\n step = input(1)\n disabled = input(false, { transform: booleanAttribute })\n errorMessage = input<string | null>(null)\n showValue = input(true, { transform: booleanAttribute })\n formatValue = input<(value: number) => string>((value) => `${value}`)\n\n protected readonly value = signal(0)\n\n private readonly formDisabled = signal(false)\n protected readonly isDisabled = computed(() => this.disabled() || this.formDisabled())\n\n protected readonly fillPercent = computed(() => {\n const range = this.max() - this.min()\n if (range <= 0) {\n return 0\n }\n return ((this.value() - this.min()) / range) * 100\n })\n\n private onChange: (value: number) => void = () => {}\n private onTouched: () => void = () => {}\n\n writeValue(value: number): void {\n this.value.set(value ?? 0)\n }\n\n registerOnChange(fn: (value: number) => void): void {\n this.onChange = fn\n }\n\n registerOnTouched(fn: () => void): void {\n this.onTouched = fn\n }\n\n setDisabledState(isDisabled: boolean): void {\n this.formDisabled.set(isDisabled)\n }\n\n protected onInput(event: Event): void {\n const value = Number((event.target as HTMLInputElement).value)\n this.value.set(value)\n this.onChange(value)\n }\n\n protected onBlur(): void {\n this.onTouched()\n }\n}\n","<div class=\"gbt-slider\">\n <div class=\"gbt-slider__header\">\n <label [for]=\"id()\">{{ label() }}</label>\n @if (showValue()) {\n <span class=\"gbt-slider__value\">{{ formatValue()(value()) }}</span>\n }\n </div>\n <input\n type=\"range\"\n [id]=\"id()\"\n [min]=\"min()\"\n [max]=\"max()\"\n [step]=\"step()\"\n [value]=\"value()\"\n [disabled]=\"isDisabled()\"\n [style.--gbt-slider-fill.%]=\"fillPercent()\"\n [attr.aria-invalid]=\"errorMessage() ? true : null\"\n [attr.aria-describedby]=\"errorMessage() ? id() + '-error' : null\"\n (input)=\"onInput($event)\"\n (blur)=\"onBlur()\"\n />\n @if (errorMessage()) {\n <p [id]=\"id() + '-error'\" class=\"gbt-slider__error\" role=\"alert\">{{ errorMessage() }}</p>\n }\n</div>\n"],"mappings":";;;AAWA,IAAI,SAAS;AAiBb,IAAa,SAAb,MAAa,OAAM;CACjB,KAAK,MAAc,cAAc,EAAE,UAAS,GAAA,YAAA,CAAA,EAAA,WAAA,KAAA,CAAA,+BAAA,CAAA,CAAA;CAC5C,QAAQ,MAAM,SAAkB,GAAA,YAAA,CAAA,EAAA,WAAA,QAAA,CAAA,+BAAA,CAAA,CAAA;CAChC,MAAM,MAAM,GAAE,GAAA,YAAA,CAAA,EAAA,WAAA,MAAA,CAAA,+BAAA,CAAA,CAAA;CACd,MAAM,MAAM,KAAI,GAAA,YAAA,CAAA,EAAA,WAAA,MAAA,CAAA,+BAAA,CAAA,CAAA;CAChB,OAAO,MAAM,GAAE,GAAA,YAAA,CAAA,EAAA,WAAA,OAAA,CAAA,+BAAA,CAAA,CAAA;CACf,WAAW,MAAM,OAAK;EAAA,GAAA,YAAA,EAAA,WAAA,WAAA,+BAAA,CAAA;EAAI,WAAW;CAAgB,CAAA;CACrD,eAAe,MAAqB,MAAK,GAAA,YAAA,CAAA,EAAA,WAAA,eAAA,CAAA,+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AAM,WACpC,CACT;IACE,SAAS;IACT,aAAa,iBAAgB,MAAO;IACpC,OAAO;GACR,CACF;GAAA,UAAA;GAAA,QAAA,CAAA,wrHAAA;EAAA,CAAA"}
|
|
@@ -168,7 +168,7 @@ var Sparkline = class Sparkline {
|
|
|
168
168
|
},
|
|
169
169
|
ngImport: i0,
|
|
170
170
|
template: "@if (path(); as d) {\n <div class=\"gbt-sparkline\" role=\"status\" aria-live=\"polite\">\n <svg\n class=\"gbt-sparkline__svg\"\n [attr.viewBox]=\"viewBox()\"\n [attr.width]=\"width()\"\n [attr.height]=\"height()\"\n tabindex=\"0\"\n role=\"group\"\n [attr.aria-label]=\"tableCaption()\"\n (pointermove)=\"onPointerMove($event)\"\n (pointerleave)=\"onPointerLeave($event)\"\n (keydown)=\"onKeydown($event)\"\n (blur)=\"onBlur()\"\n >\n <path class=\"gbt-sparkline__line\" [attr.d]=\"d\" />\n @if (dot(); as p) {\n <circle class=\"gbt-sparkline__dot\" [attr.cx]=\"p.x\" [attr.cy]=\"p.y\" r=\"3\" />\n }\n </svg>\n @if (tooltip(); as text) {\n <span class=\"gbt-sparkline__tooltip\">{{ text }}</span>\n }\n </div>\n <gbt-chart-table [caption]=\"tableCaption()\" [columns]=\"columns()\" [rows]=\"tableRows()\" />\n} @else {\n <gbt-chart-empty [message]=\"emptyMessage()\" />\n}\n",
|
|
171
|
-
styles: [":host{display:inline-block;line-height:0}.gbt-sparkline{position:relative;display:inline-block}.gbt-sparkline__svg:focus-visible{outline:2px solid var(--gbt-focus-ring, var(--focus-ring));outline-offset:2px}.gbt-sparkline__line{fill:none;stroke:var(--chart-series-1-base);stroke-width:1.5;stroke-linejoin:round;stroke-linecap:round}.gbt-sparkline__dot{fill:var(--chart-series-1-base);stroke:var(--bg-principal);stroke-width:1.5;pointer-events:none}.gbt-sparkline__tooltip{position:absolute;left:50%;bottom:100%;transform:translate(-50%);white-space:nowrap;padding:.125rem .375rem;border-radius:var(--gbt-radius-row);background:var(--gbt-glass-thick);-webkit-backdrop-filter:var(--gbt-liquid-blur);backdrop-filter:var(--gbt-liquid-blur);box-shadow:var(--gbt-depth-liquid);--text-discret: var(--gbt-ground-text-discret);--border-color: var(--gbt-ground-border);--color-success-text: var(--color-success-bg-text);--color-warning-text: var(--color-warning-bg-text);--color-error-text: var(--color-error-bg-text);--text-secondary: var(--gbt-liquid-text);--text-discret: var(--gbt-liquid-text)}@media(prefers-reduced-transparency:reduce){.gbt-sparkline__tooltip{background:linear-gradient(var(--gbt-glass-thick),var(--gbt-glass-thick)),var(--bg-principal);-webkit-backdrop-filter:none;backdrop-filter:none}}@media(prefers-contrast:more){.gbt-sparkline__tooltip{box-shadow:inset 0 0 0 1px var(--border-color),var(--gbt-depth-liquid)}}.gbt-sparkline__tooltip{--gbt-nested-low: light-dark(color-mix(in srgb, var(--text-primary) 20%, transparent), transparent);--gbt-nested-low-soft: light-dark(color-mix(in srgb, var(--text-primary) 8%, transparent), transparent);--gbt-nested-contact: light-dark(var(--gbt-glass-shadow-near), transparent);--gbt-nested-hollow-shade: light-dark(color-mix(in srgb, var(--text-primary) 14%, transparent), transparent);--gbt-nested-hollow-trace: light-dark(color-mix(in srgb, var(--text-primary) 6%, transparent), transparent);--gbt-nested-hollow-light: light-dark(#fff, transparent);--gbt-nested-group-low: light-dark(color-mix(in srgb, var(--text-primary) 12%, transparent), transparent);--gbt-nested-group-shadow: light-dark(var(--gbt-glass-shadow), transparent);box-shadow:var(--gbt-depth-liquid),var(--gbt-depth-glass)}@media(prefers-contrast:more){.gbt-sparkline__tooltip{box-shadow:inset 0 0 0 1px var(--border-color),var(--gbt-depth-liquid),var(--gbt-depth-glass)}}.gbt-sparkline__tooltip{font-size:.6875rem;font-variant-numeric:tabular-nums;color:var(--text-primary);pointer-events:none}\n"],
|
|
171
|
+
styles: [":host{display:inline-block;line-height:0}.gbt-sparkline{position:relative;display:inline-block}.gbt-sparkline__svg:focus-visible{outline:2px solid var(--gbt-focus-ring, var(--gbt-ground-accent, var(--focus-ring)));outline-offset:2px}.gbt-sparkline__line{fill:none;stroke:var(--chart-series-1-base);stroke-width:1.5;stroke-linejoin:round;stroke-linecap:round}.gbt-sparkline__dot{fill:var(--chart-series-1-base);stroke:var(--bg-principal);stroke-width:1.5;pointer-events:none}.gbt-sparkline__tooltip{position:absolute;left:50%;bottom:100%;transform:translate(-50%);white-space:nowrap;padding:.125rem .375rem;border-radius:var(--gbt-radius-row);background:var(--gbt-glass-thick);-webkit-backdrop-filter:var(--gbt-liquid-blur);backdrop-filter:var(--gbt-liquid-blur);box-shadow:var(--gbt-depth-liquid);--text-discret: var(--gbt-ground-text-discret);--border-color: var(--gbt-ground-border);--color-success-text: var(--color-success-bg-text);--color-warning-text: var(--color-warning-bg-text);--color-error-text: var(--color-error-bg-text);--text-secondary: var(--gbt-liquid-text);--text-discret: var(--gbt-liquid-text)}@media(prefers-reduced-transparency:reduce){.gbt-sparkline__tooltip{background:linear-gradient(var(--gbt-glass-thick),var(--gbt-glass-thick)),var(--bg-principal);-webkit-backdrop-filter:none;backdrop-filter:none}}@media(prefers-contrast:more){.gbt-sparkline__tooltip{box-shadow:inset 0 0 0 1px var(--border-color),var(--gbt-depth-liquid)}}.gbt-sparkline__tooltip{--gbt-nested-low: light-dark(color-mix(in srgb, var(--text-primary) 20%, transparent), transparent);--gbt-nested-low-soft: light-dark(color-mix(in srgb, var(--text-primary) 8%, transparent), transparent);--gbt-nested-contact: light-dark(var(--gbt-glass-shadow-near), transparent);--gbt-nested-hollow-shade: light-dark(color-mix(in srgb, var(--text-primary) 14%, transparent), transparent);--gbt-nested-hollow-trace: light-dark(color-mix(in srgb, var(--text-primary) 6%, transparent), transparent);--gbt-nested-hollow-light: light-dark(#fff, transparent);--gbt-nested-group-low: light-dark(color-mix(in srgb, var(--text-primary) 12%, transparent), transparent);--gbt-nested-group-shadow: light-dark(var(--gbt-glass-shadow), transparent);box-shadow:var(--gbt-depth-liquid),var(--gbt-depth-glass)}@media(prefers-contrast:more){.gbt-sparkline__tooltip{box-shadow:inset 0 0 0 1px var(--border-color),var(--gbt-depth-liquid),var(--gbt-depth-glass)}}.gbt-sparkline__tooltip{font-size:.6875rem;font-variant-numeric:tabular-nums;color:var(--text-primary);pointer-events:none}\n"],
|
|
172
172
|
dependencies: [{
|
|
173
173
|
kind: "component",
|
|
174
174
|
type: ChartEmpty,
|
|
@@ -201,7 +201,7 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
201
201
|
imports: [ChartEmpty, ChartTable],
|
|
202
202
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
203
203
|
template: "@if (path(); as d) {\n <div class=\"gbt-sparkline\" role=\"status\" aria-live=\"polite\">\n <svg\n class=\"gbt-sparkline__svg\"\n [attr.viewBox]=\"viewBox()\"\n [attr.width]=\"width()\"\n [attr.height]=\"height()\"\n tabindex=\"0\"\n role=\"group\"\n [attr.aria-label]=\"tableCaption()\"\n (pointermove)=\"onPointerMove($event)\"\n (pointerleave)=\"onPointerLeave($event)\"\n (keydown)=\"onKeydown($event)\"\n (blur)=\"onBlur()\"\n >\n <path class=\"gbt-sparkline__line\" [attr.d]=\"d\" />\n @if (dot(); as p) {\n <circle class=\"gbt-sparkline__dot\" [attr.cx]=\"p.x\" [attr.cy]=\"p.y\" r=\"3\" />\n }\n </svg>\n @if (tooltip(); as text) {\n <span class=\"gbt-sparkline__tooltip\">{{ text }}</span>\n }\n </div>\n <gbt-chart-table [caption]=\"tableCaption()\" [columns]=\"columns()\" [rows]=\"tableRows()\" />\n} @else {\n <gbt-chart-empty [message]=\"emptyMessage()\" />\n}\n",
|
|
204
|
-
styles: [":host{display:inline-block;line-height:0}.gbt-sparkline{position:relative;display:inline-block}.gbt-sparkline__svg:focus-visible{outline:2px solid var(--gbt-focus-ring, var(--focus-ring));outline-offset:2px}.gbt-sparkline__line{fill:none;stroke:var(--chart-series-1-base);stroke-width:1.5;stroke-linejoin:round;stroke-linecap:round}.gbt-sparkline__dot{fill:var(--chart-series-1-base);stroke:var(--bg-principal);stroke-width:1.5;pointer-events:none}.gbt-sparkline__tooltip{position:absolute;left:50%;bottom:100%;transform:translate(-50%);white-space:nowrap;padding:.125rem .375rem;border-radius:var(--gbt-radius-row);background:var(--gbt-glass-thick);-webkit-backdrop-filter:var(--gbt-liquid-blur);backdrop-filter:var(--gbt-liquid-blur);box-shadow:var(--gbt-depth-liquid);--text-discret: var(--gbt-ground-text-discret);--border-color: var(--gbt-ground-border);--color-success-text: var(--color-success-bg-text);--color-warning-text: var(--color-warning-bg-text);--color-error-text: var(--color-error-bg-text);--text-secondary: var(--gbt-liquid-text);--text-discret: var(--gbt-liquid-text)}@media(prefers-reduced-transparency:reduce){.gbt-sparkline__tooltip{background:linear-gradient(var(--gbt-glass-thick),var(--gbt-glass-thick)),var(--bg-principal);-webkit-backdrop-filter:none;backdrop-filter:none}}@media(prefers-contrast:more){.gbt-sparkline__tooltip{box-shadow:inset 0 0 0 1px var(--border-color),var(--gbt-depth-liquid)}}.gbt-sparkline__tooltip{--gbt-nested-low: light-dark(color-mix(in srgb, var(--text-primary) 20%, transparent), transparent);--gbt-nested-low-soft: light-dark(color-mix(in srgb, var(--text-primary) 8%, transparent), transparent);--gbt-nested-contact: light-dark(var(--gbt-glass-shadow-near), transparent);--gbt-nested-hollow-shade: light-dark(color-mix(in srgb, var(--text-primary) 14%, transparent), transparent);--gbt-nested-hollow-trace: light-dark(color-mix(in srgb, var(--text-primary) 6%, transparent), transparent);--gbt-nested-hollow-light: light-dark(#fff, transparent);--gbt-nested-group-low: light-dark(color-mix(in srgb, var(--text-primary) 12%, transparent), transparent);--gbt-nested-group-shadow: light-dark(var(--gbt-glass-shadow), transparent);box-shadow:var(--gbt-depth-liquid),var(--gbt-depth-glass)}@media(prefers-contrast:more){.gbt-sparkline__tooltip{box-shadow:inset 0 0 0 1px var(--border-color),var(--gbt-depth-liquid),var(--gbt-depth-glass)}}.gbt-sparkline__tooltip{font-size:.6875rem;font-variant-numeric:tabular-nums;color:var(--text-primary);pointer-events:none}\n"]
|
|
204
|
+
styles: [":host{display:inline-block;line-height:0}.gbt-sparkline{position:relative;display:inline-block}.gbt-sparkline__svg:focus-visible{outline:2px solid var(--gbt-focus-ring, var(--gbt-ground-accent, var(--focus-ring)));outline-offset:2px}.gbt-sparkline__line{fill:none;stroke:var(--chart-series-1-base);stroke-width:1.5;stroke-linejoin:round;stroke-linecap:round}.gbt-sparkline__dot{fill:var(--chart-series-1-base);stroke:var(--bg-principal);stroke-width:1.5;pointer-events:none}.gbt-sparkline__tooltip{position:absolute;left:50%;bottom:100%;transform:translate(-50%);white-space:nowrap;padding:.125rem .375rem;border-radius:var(--gbt-radius-row);background:var(--gbt-glass-thick);-webkit-backdrop-filter:var(--gbt-liquid-blur);backdrop-filter:var(--gbt-liquid-blur);box-shadow:var(--gbt-depth-liquid);--text-discret: var(--gbt-ground-text-discret);--border-color: var(--gbt-ground-border);--color-success-text: var(--color-success-bg-text);--color-warning-text: var(--color-warning-bg-text);--color-error-text: var(--color-error-bg-text);--text-secondary: var(--gbt-liquid-text);--text-discret: var(--gbt-liquid-text)}@media(prefers-reduced-transparency:reduce){.gbt-sparkline__tooltip{background:linear-gradient(var(--gbt-glass-thick),var(--gbt-glass-thick)),var(--bg-principal);-webkit-backdrop-filter:none;backdrop-filter:none}}@media(prefers-contrast:more){.gbt-sparkline__tooltip{box-shadow:inset 0 0 0 1px var(--border-color),var(--gbt-depth-liquid)}}.gbt-sparkline__tooltip{--gbt-nested-low: light-dark(color-mix(in srgb, var(--text-primary) 20%, transparent), transparent);--gbt-nested-low-soft: light-dark(color-mix(in srgb, var(--text-primary) 8%, transparent), transparent);--gbt-nested-contact: light-dark(var(--gbt-glass-shadow-near), transparent);--gbt-nested-hollow-shade: light-dark(color-mix(in srgb, var(--text-primary) 14%, transparent), transparent);--gbt-nested-hollow-trace: light-dark(color-mix(in srgb, var(--text-primary) 6%, transparent), transparent);--gbt-nested-hollow-light: light-dark(#fff, transparent);--gbt-nested-group-low: light-dark(color-mix(in srgb, var(--text-primary) 12%, transparent), transparent);--gbt-nested-group-shadow: light-dark(var(--gbt-glass-shadow), transparent);box-shadow:var(--gbt-depth-liquid),var(--gbt-depth-glass)}@media(prefers-contrast:more){.gbt-sparkline__tooltip{box-shadow:inset 0 0 0 1px var(--border-color),var(--gbt-depth-liquid),var(--gbt-depth-glass)}}.gbt-sparkline__tooltip{font-size:.6875rem;font-variant-numeric:tabular-nums;color:var(--text-primary);pointer-events:none}\n"]
|
|
205
205
|
}]
|
|
206
206
|
}],
|
|
207
207
|
propDecorators: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"masmarino-gabarit-sparkline.mjs","names":[],"sources":["../../../projects/gabarit/sparkline/sparkline.ts","../../../projects/gabarit/sparkline/sparkline.html"],"sourcesContent":["import { ChangeDetectionStrategy, Component, computed, input, signal } from '@angular/core'\nimport { ChartEmpty } from '@masmarino/gabarit/chart'\nimport { ChartTable } from '@masmarino/gabarit/chart'\nimport { formatNumber } from '@masmarino/gabarit/format'\nimport { linePath } from '@masmarino/gabarit/chart'\nimport { linearScale } from '@masmarino/gabarit/chart'\nimport { nearestIndex } from '@masmarino/gabarit/chart'\n\nconst MARGIN = 4\n\n@Component({\n selector: 'gbt-sparkline',\n standalone: true,\n imports: [ChartEmpty, ChartTable],\n templateUrl: './sparkline.html',\n styleUrl: './sparkline.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class Sparkline {\n values = input.required<number[]>()\n tableCaption = input.required<string>()\n xColumn = input.required<string>()\n yColumn = input.required<string>()\n locale = input.required<string>()\n emptyMessage = input.required<string>()\n width = input(80)\n height = input(24)\n\n protected readonly activeIndex = signal<number | null>(null)\n\n protected readonly viewBox = computed(() => `0 0 ${this.width()} ${this.height()}`)\n\n protected readonly columns = computed(() => [this.xColumn(), this.yColumn()])\n\n protected readonly tableRows = computed<(string | number)[][]>(() =>\n this.values().map((value, index) => [\n formatNumber(index + 1, this.locale()),\n formatNumber(value, this.locale()),\n ]),\n )\n\n private readonly scales = computed(() => {\n const values = this.values()\n const min = Math.min(...values)\n const max = Math.max(...values)\n return {\n x: linearScale([0, Math.max(values.length - 1, 0)], [MARGIN, this.width() - MARGIN]),\n y: linearScale([min, max], [this.height() - MARGIN, MARGIN]),\n }\n })\n\n protected readonly path = computed(() => {\n const values = this.values()\n if (values.length === 0) return null\n const { x, y } = this.scales()\n return linePath(values.map((value, index) => ({ x: x.map(index), y: y.map(value) })))\n })\n\n protected readonly positions = computed<number[]>(() => {\n const { x } = this.scales()\n return this.values().map((_, index) => x.map(index))\n })\n\n protected readonly dot = computed<{ x: number; y: number } | null>(() => {\n const index = this.activeIndex()\n if (index === null) return null\n const value = this.values()[index]\n if (value === undefined) return null\n const { x, y } = this.scales()\n return { x: x.map(index), y: y.map(value) }\n })\n\n protected readonly tooltip = computed<string | null>(() => {\n const index = this.activeIndex()\n if (index === null) return null\n const value = this.values()[index]\n if (value === undefined) return null\n return `${this.xColumn()} ${formatNumber(index + 1, this.locale())} — ${this.yColumn()} ${formatNumber(value, this.locale())}`\n })\n\n protected onPointerMove(event: PointerEvent | MouseEvent): void {\n const positions = this.positions()\n if (positions.length === 0) return\n const rect = (event.currentTarget as Element).getBoundingClientRect()\n this.activeIndex.set(nearestIndex(positions, event.clientX - rect.left))\n }\n\n protected onPointerLeave(event: PointerEvent | MouseEvent): void {\n const target = event.currentTarget as Element\n if (target.ownerDocument.activeElement === target) return\n this.activeIndex.set(null)\n }\n\n protected onBlur(): void {\n this.activeIndex.set(null)\n }\n\n protected onKeydown(event: KeyboardEvent): void {\n const lastIndex = this.values().length - 1\n if (lastIndex < 0) return\n const current = this.activeIndex()\n switch (event.key) {\n case 'ArrowRight':\n this.activeIndex.set(current === null ? 0 : Math.min(lastIndex, current + 1))\n break\n case 'ArrowLeft':\n this.activeIndex.set(current === null ? lastIndex : Math.max(0, current - 1))\n break\n case 'Home':\n this.activeIndex.set(0)\n break\n case 'End':\n this.activeIndex.set(lastIndex)\n break\n case 'Escape':\n this.activeIndex.set(null)\n break\n default:\n return\n }\n event.preventDefault()\n }\n}\n","@if (path(); as d) {\n <div class=\"gbt-sparkline\" role=\"status\" aria-live=\"polite\">\n <svg\n class=\"gbt-sparkline__svg\"\n [attr.viewBox]=\"viewBox()\"\n [attr.width]=\"width()\"\n [attr.height]=\"height()\"\n tabindex=\"0\"\n role=\"group\"\n [attr.aria-label]=\"tableCaption()\"\n (pointermove)=\"onPointerMove($event)\"\n (pointerleave)=\"onPointerLeave($event)\"\n (keydown)=\"onKeydown($event)\"\n (blur)=\"onBlur()\"\n >\n <path class=\"gbt-sparkline__line\" [attr.d]=\"d\" />\n @if (dot(); as p) {\n <circle class=\"gbt-sparkline__dot\" [attr.cx]=\"p.x\" [attr.cy]=\"p.y\" r=\"3\" />\n }\n </svg>\n @if (tooltip(); as text) {\n <span class=\"gbt-sparkline__tooltip\">{{ text }}</span>\n }\n </div>\n <gbt-chart-table [caption]=\"tableCaption()\" [columns]=\"columns()\" [rows]=\"tableRows()\" />\n} @else {\n <gbt-chart-empty [message]=\"emptyMessage()\" />\n}\n"],"mappings":";;;;AAQA,MAAM,SAAS;AAUf,IAAa,YAAb,MAAa,UAAS;CACpB,SAAS,MAAM,SAAoB,GAAA,YAAA,CAAA,EAAA,WAAA,SAAA,CAAA,+BAAA,CAAA,CAAA;CACnC,eAAe,MAAM,SAAkB,GAAA,YAAA,CAAA,EAAA,WAAA,eAAA,CAAA,+BAAA,CAAA,CAAA;CACvC,UAAU,MAAM,SAAkB,GAAA,YAAA,CAAA,EAAA,WAAA,UAAA,CAAA,+BAAA,CAAA,CAAA;CAClC,UAAU,MAAM,SAAkB,GAAA,YAAA,CAAA,EAAA,WAAA,UAAA,CAAA,+BAAA,CAAA,CAAA;CAClC,SAAS,MAAM,SAAkB,GAAA,YAAA,CAAA,EAAA,WAAA,SAAA,CAAA,+BAAA,CAAA,CAAA;CACjC,eAAe,MAAM,SAAkB,GAAA,YAAA,CAAA,EAAA,WAAA,eAAA,CAAA,+BA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A;IAAA,YAAA;IAAA,mBAAA;GAAA;GAAA,SAAA;IAAA,mBAAA;IAAA,YAAA;IAAA,UAAA;IAAA,YAAA;IAAA,mBAAA;GAAA;GAAA,SAAA;IAAA,mBAAA;IAAA,YAAA;IAAA,UAAA;IAAA,YAAA;IAAA,mBAAA;GAAA;GAAA,QAAA;IAAA,mBAAA;IAAA,YAAA;IAAA,UAAA;IAAA,YAAA;IAAA,mBAAA;GAAA;GAAA,cAAA;IAAA,mBAAA;IAAA,YAAA;IAAA,UAAA;IAAA,YAAA;IAAA,mBAAA;GAAA;GAAA,OAAA;IAAA,mBAAA;IAAA,YAAA;IAAA,UAAA;IAAA,YAAA;IAAA,mBAAA;GAAA;GAAA,QAAA;IAAA,mBAAA;IAAA,YAAA;IAAA,UAAA;IAAA,YAAA;IAAA,mBAAA;GAAA;EAAA;EAAA,UAAA;EAAA,UClBtB;EA4BA,QAAA,CAAA,
|
|
1
|
+
{"version":3,"file":"masmarino-gabarit-sparkline.mjs","names":[],"sources":["../../../projects/gabarit/sparkline/sparkline.ts","../../../projects/gabarit/sparkline/sparkline.html"],"sourcesContent":["import { ChangeDetectionStrategy, Component, computed, input, signal } from '@angular/core'\nimport { ChartEmpty } from '@masmarino/gabarit/chart'\nimport { ChartTable } from '@masmarino/gabarit/chart'\nimport { formatNumber } from '@masmarino/gabarit/format'\nimport { linePath } from '@masmarino/gabarit/chart'\nimport { linearScale } from '@masmarino/gabarit/chart'\nimport { nearestIndex } from '@masmarino/gabarit/chart'\n\nconst MARGIN = 4\n\n@Component({\n selector: 'gbt-sparkline',\n standalone: true,\n imports: [ChartEmpty, ChartTable],\n templateUrl: './sparkline.html',\n styleUrl: './sparkline.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class Sparkline {\n values = input.required<number[]>()\n tableCaption = input.required<string>()\n xColumn = input.required<string>()\n yColumn = input.required<string>()\n locale = input.required<string>()\n emptyMessage = input.required<string>()\n width = input(80)\n height = input(24)\n\n protected readonly activeIndex = signal<number | null>(null)\n\n protected readonly viewBox = computed(() => `0 0 ${this.width()} ${this.height()}`)\n\n protected readonly columns = computed(() => [this.xColumn(), this.yColumn()])\n\n protected readonly tableRows = computed<(string | number)[][]>(() =>\n this.values().map((value, index) => [\n formatNumber(index + 1, this.locale()),\n formatNumber(value, this.locale()),\n ]),\n )\n\n private readonly scales = computed(() => {\n const values = this.values()\n const min = Math.min(...values)\n const max = Math.max(...values)\n return {\n x: linearScale([0, Math.max(values.length - 1, 0)], [MARGIN, this.width() - MARGIN]),\n y: linearScale([min, max], [this.height() - MARGIN, MARGIN]),\n }\n })\n\n protected readonly path = computed(() => {\n const values = this.values()\n if (values.length === 0) return null\n const { x, y } = this.scales()\n return linePath(values.map((value, index) => ({ x: x.map(index), y: y.map(value) })))\n })\n\n protected readonly positions = computed<number[]>(() => {\n const { x } = this.scales()\n return this.values().map((_, index) => x.map(index))\n })\n\n protected readonly dot = computed<{ x: number; y: number } | null>(() => {\n const index = this.activeIndex()\n if (index === null) return null\n const value = this.values()[index]\n if (value === undefined) return null\n const { x, y } = this.scales()\n return { x: x.map(index), y: y.map(value) }\n })\n\n protected readonly tooltip = computed<string | null>(() => {\n const index = this.activeIndex()\n if (index === null) return null\n const value = this.values()[index]\n if (value === undefined) return null\n return `${this.xColumn()} ${formatNumber(index + 1, this.locale())} — ${this.yColumn()} ${formatNumber(value, this.locale())}`\n })\n\n protected onPointerMove(event: PointerEvent | MouseEvent): void {\n const positions = this.positions()\n if (positions.length === 0) return\n const rect = (event.currentTarget as Element).getBoundingClientRect()\n this.activeIndex.set(nearestIndex(positions, event.clientX - rect.left))\n }\n\n protected onPointerLeave(event: PointerEvent | MouseEvent): void {\n const target = event.currentTarget as Element\n if (target.ownerDocument.activeElement === target) return\n this.activeIndex.set(null)\n }\n\n protected onBlur(): void {\n this.activeIndex.set(null)\n }\n\n protected onKeydown(event: KeyboardEvent): void {\n const lastIndex = this.values().length - 1\n if (lastIndex < 0) return\n const current = this.activeIndex()\n switch (event.key) {\n case 'ArrowRight':\n this.activeIndex.set(current === null ? 0 : Math.min(lastIndex, current + 1))\n break\n case 'ArrowLeft':\n this.activeIndex.set(current === null ? lastIndex : Math.max(0, current - 1))\n break\n case 'Home':\n this.activeIndex.set(0)\n break\n case 'End':\n this.activeIndex.set(lastIndex)\n break\n case 'Escape':\n this.activeIndex.set(null)\n break\n default:\n return\n }\n event.preventDefault()\n }\n}\n","@if (path(); as d) {\n <div class=\"gbt-sparkline\" role=\"status\" aria-live=\"polite\">\n <svg\n class=\"gbt-sparkline__svg\"\n [attr.viewBox]=\"viewBox()\"\n [attr.width]=\"width()\"\n [attr.height]=\"height()\"\n tabindex=\"0\"\n role=\"group\"\n [attr.aria-label]=\"tableCaption()\"\n (pointermove)=\"onPointerMove($event)\"\n (pointerleave)=\"onPointerLeave($event)\"\n (keydown)=\"onKeydown($event)\"\n (blur)=\"onBlur()\"\n >\n <path class=\"gbt-sparkline__line\" [attr.d]=\"d\" />\n @if (dot(); as p) {\n <circle class=\"gbt-sparkline__dot\" [attr.cx]=\"p.x\" [attr.cy]=\"p.y\" r=\"3\" />\n }\n </svg>\n @if (tooltip(); as text) {\n <span class=\"gbt-sparkline__tooltip\">{{ text }}</span>\n }\n </div>\n <gbt-chart-table [caption]=\"tableCaption()\" [columns]=\"columns()\" [rows]=\"tableRows()\" />\n} @else {\n <gbt-chart-empty [message]=\"emptyMessage()\" />\n}\n"],"mappings":";;;;AAQA,MAAM,SAAS;AAUf,IAAa,YAAb,MAAa,UAAS;CACpB,SAAS,MAAM,SAAoB,GAAA,YAAA,CAAA,EAAA,WAAA,SAAA,CAAA,+BAAA,CAAA,CAAA;CACnC,eAAe,MAAM,SAAkB,GAAA,YAAA,CAAA,EAAA,WAAA,eAAA,CAAA,+BAAA,CAAA,CAAA;CACvC,UAAU,MAAM,SAAkB,GAAA,YAAA,CAAA,EAAA,WAAA,UAAA,CAAA,+BAAA,CAAA,CAAA;CAClC,UAAU,MAAM,SAAkB,GAAA,YA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;GAAA,QAAA,CAAA,m/EAAA;EAAA,CAAA"}
|
|
@@ -22,7 +22,7 @@ var StatTileLink = class StatTileLink {
|
|
|
22
22
|
ngImport: i0,
|
|
23
23
|
template: "<ng-content />",
|
|
24
24
|
isInline: true,
|
|
25
|
-
styles: [":host{color:inherit;text-decoration:none}:host:hover{text-decoration:underline;text-underline-offset:.2em}:host:focus-visible{outline:none}:host:after{content:\"\";position:absolute;inset:0;border-radius:var(--gbt-radius-glass)}:host:focus-visible:after{outline:2px solid var(--gbt-focus-ring, var(--focus-ring));outline-offset:2px}\n"],
|
|
25
|
+
styles: [":host{color:inherit;text-decoration:none}:host:hover{text-decoration:underline;text-underline-offset:.2em}:host:focus-visible{outline:none}:host:after{content:\"\";position:absolute;inset:0;border-radius:var(--gbt-radius-glass)}:host:focus-visible:after{outline:2px solid var(--gbt-focus-ring, var(--gbt-ground-accent, var(--focus-ring)));outline-offset:2px}\n"],
|
|
26
26
|
changeDetection: i0.ChangeDetectionStrategy.OnPush
|
|
27
27
|
});
|
|
28
28
|
};
|
|
@@ -39,7 +39,7 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
39
39
|
template: "<ng-content />",
|
|
40
40
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
41
41
|
host: { class: "gbt-stat-tile__link" },
|
|
42
|
-
styles: [":host{color:inherit;text-decoration:none}:host:hover{text-decoration:underline;text-underline-offset:.2em}:host:focus-visible{outline:none}:host:after{content:\"\";position:absolute;inset:0;border-radius:var(--gbt-radius-glass)}:host:focus-visible:after{outline:2px solid var(--gbt-focus-ring, var(--focus-ring));outline-offset:2px}\n"]
|
|
42
|
+
styles: [":host{color:inherit;text-decoration:none}:host:hover{text-decoration:underline;text-underline-offset:.2em}:host:focus-visible{outline:none}:host:after{content:\"\";position:absolute;inset:0;border-radius:var(--gbt-radius-glass)}:host:focus-visible:after{outline:2px solid var(--gbt-focus-ring, var(--gbt-ground-accent, var(--focus-ring)));outline-offset:2px}\n"]
|
|
43
43
|
}]
|
|
44
44
|
}]
|
|
45
45
|
});
|