@masmarino/gabarit 2.2.1 → 3.1.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/ACCESSIBILITY.md +4 -0
- package/README.md +29 -11
- package/accordion/package.json +4 -0
- package/alert/package.json +4 -0
- package/app-shell/package.json +4 -0
- package/auth/package.json +4 -0
- package/auth-activate/package.json +4 -0
- package/auth-login/package.json +4 -0
- package/auth-register/package.json +4 -0
- package/auth-reset-password/package.json +4 -0
- package/autocomplete/package.json +4 -0
- package/avatar/package.json +4 -0
- package/avatar-group/package.json +4 -0
- package/badge/package.json +4 -0
- package/bar-chart/package.json +4 -0
- package/breadcrumb/package.json +4 -0
- package/button/package.json +4 -0
- package/card/README.md +1 -0
- package/card/package.json +4 -0
- package/chart/package.json +4 -0
- package/checkbox/package.json +4 -0
- package/checkbox-group/package.json +4 -0
- package/command-palette/package.json +4 -0
- package/confirm-danger-modal/package.json +4 -0
- package/copy-button/package.json +4 -0
- package/copy-field/package.json +4 -0
- package/date-picker/package.json +4 -0
- package/description-list/package.json +4 -0
- package/dimension-card/package.json +4 -0
- package/disclosure/package.json +4 -0
- package/divider/package.json +4 -0
- package/docs/package.json +4 -0
- package/drawer/package.json +4 -0
- package/empty-state/package.json +4 -0
- package/fesm2022/masmarino-gabarit-accordion.mjs +8 -8
- package/fesm2022/masmarino-gabarit-accordion.mjs.map +1 -1
- package/fesm2022/masmarino-gabarit-alert.mjs +5 -5
- package/fesm2022/masmarino-gabarit-alert.mjs.map +1 -1
- package/fesm2022/masmarino-gabarit-app-shell.mjs +10 -10
- package/fesm2022/masmarino-gabarit-app-shell.mjs.map +1 -1
- package/fesm2022/masmarino-gabarit-auth-activate.mjs +3 -3
- package/fesm2022/masmarino-gabarit-auth-login.mjs +3 -3
- package/fesm2022/masmarino-gabarit-auth-register.mjs +3 -3
- package/fesm2022/masmarino-gabarit-auth-reset-password.mjs +3 -3
- package/fesm2022/masmarino-gabarit-auth.mjs +12 -12
- package/fesm2022/masmarino-gabarit-autocomplete.mjs +5 -5
- package/fesm2022/masmarino-gabarit-autocomplete.mjs.map +1 -1
- package/fesm2022/masmarino-gabarit-avatar-group.mjs +5 -5
- package/fesm2022/masmarino-gabarit-avatar-group.mjs.map +1 -1
- package/fesm2022/masmarino-gabarit-avatar.mjs +3 -3
- package/fesm2022/masmarino-gabarit-badge.mjs +5 -5
- package/fesm2022/masmarino-gabarit-badge.mjs.map +1 -1
- package/fesm2022/masmarino-gabarit-bar-chart.mjs +6 -6
- package/fesm2022/masmarino-gabarit-breadcrumb.mjs +3 -3
- package/fesm2022/masmarino-gabarit-button.mjs +5 -5
- package/fesm2022/masmarino-gabarit-button.mjs.map +1 -1
- package/fesm2022/masmarino-gabarit-card.mjs +32 -13
- package/fesm2022/masmarino-gabarit-card.mjs.map +1 -1
- package/fesm2022/masmarino-gabarit-chart.mjs +23 -23
- package/fesm2022/masmarino-gabarit-chart.mjs.map +1 -1
- package/fesm2022/masmarino-gabarit-checkbox-group.mjs +3 -3
- package/fesm2022/masmarino-gabarit-checkbox.mjs +5 -5
- package/fesm2022/masmarino-gabarit-checkbox.mjs.map +1 -1
- package/fesm2022/masmarino-gabarit-command-palette.mjs +10 -10
- package/fesm2022/masmarino-gabarit-command-palette.mjs.map +1 -1
- package/fesm2022/masmarino-gabarit-confirm-danger-modal.mjs +3 -3
- package/fesm2022/masmarino-gabarit-copy-button.mjs +3 -3
- package/fesm2022/masmarino-gabarit-copy-field.mjs +3 -3
- package/fesm2022/masmarino-gabarit-date-picker.mjs +10 -10
- package/fesm2022/masmarino-gabarit-date-picker.mjs.map +1 -1
- package/fesm2022/masmarino-gabarit-description-list.mjs +3 -3
- package/fesm2022/masmarino-gabarit-dimension-card.mjs +3 -3
- package/fesm2022/masmarino-gabarit-disclosure.mjs +5 -5
- package/fesm2022/masmarino-gabarit-disclosure.mjs.map +1 -1
- package/fesm2022/masmarino-gabarit-divider.mjs +3 -3
- package/fesm2022/masmarino-gabarit-docs.mjs +26 -25
- package/fesm2022/masmarino-gabarit-docs.mjs.map +1 -1
- package/fesm2022/masmarino-gabarit-drawer.mjs +5 -5
- package/fesm2022/masmarino-gabarit-drawer.mjs.map +1 -1
- package/fesm2022/masmarino-gabarit-empty-state.mjs +3 -3
- package/fesm2022/masmarino-gabarit-file-upload.mjs +5 -5
- package/fesm2022/masmarino-gabarit-file-upload.mjs.map +1 -1
- package/fesm2022/masmarino-gabarit-format.mjs +9 -9
- package/fesm2022/masmarino-gabarit-funnel-chart.mjs +3 -3
- package/fesm2022/masmarino-gabarit-gauge-bar.mjs +5 -5
- package/fesm2022/masmarino-gabarit-gauge-bar.mjs.map +1 -1
- package/fesm2022/masmarino-gabarit-git-field.mjs +5 -5
- package/fesm2022/masmarino-gabarit-git-field.mjs.map +1 -1
- package/fesm2022/masmarino-gabarit-icon-marker.mjs +5 -5
- package/fesm2022/masmarino-gabarit-icon-marker.mjs.map +1 -1
- package/fesm2022/masmarino-gabarit-icon.mjs +6 -6
- package/fesm2022/masmarino-gabarit-input.mjs +5 -5
- package/fesm2022/masmarino-gabarit-input.mjs.map +1 -1
- package/fesm2022/masmarino-gabarit-job-graph.mjs +5 -5
- package/fesm2022/masmarino-gabarit-job-graph.mjs.map +1 -1
- package/fesm2022/masmarino-gabarit-job-status.mjs +3 -3
- package/fesm2022/masmarino-gabarit-line-chart.mjs +6 -6
- package/fesm2022/masmarino-gabarit-list-card.mjs +5 -5
- package/fesm2022/masmarino-gabarit-list-card.mjs.map +1 -1
- package/fesm2022/masmarino-gabarit-list-row.mjs +5 -5
- package/fesm2022/masmarino-gabarit-list-row.mjs.map +1 -1
- package/fesm2022/masmarino-gabarit-list-toolbar.mjs +5 -5
- package/fesm2022/masmarino-gabarit-list-toolbar.mjs.map +1 -1
- package/fesm2022/masmarino-gabarit-menu.mjs +13 -13
- package/fesm2022/masmarino-gabarit-menu.mjs.map +1 -1
- package/fesm2022/masmarino-gabarit-mfa-enrollment.mjs +12 -11
- package/fesm2022/masmarino-gabarit-mfa-enrollment.mjs.map +1 -1
- package/fesm2022/masmarino-gabarit-mfa-settings.mjs +4 -3
- package/fesm2022/masmarino-gabarit-mfa-settings.mjs.map +1 -1
- package/fesm2022/masmarino-gabarit-modal.mjs +5 -5
- package/fesm2022/masmarino-gabarit-modal.mjs.map +1 -1
- package/fesm2022/masmarino-gabarit-nav-tabs.mjs +8 -8
- package/fesm2022/masmarino-gabarit-nav-tabs.mjs.map +1 -1
- package/fesm2022/masmarino-gabarit-notification-dot.mjs +3 -3
- package/fesm2022/masmarino-gabarit-page-header.mjs +3 -3
- package/fesm2022/masmarino-gabarit-page-layout.mjs +3 -3
- package/fesm2022/masmarino-gabarit-pagination.mjs +5 -5
- package/fesm2022/masmarino-gabarit-pagination.mjs.map +1 -1
- package/fesm2022/masmarino-gabarit-panel.mjs +3 -3
- package/fesm2022/masmarino-gabarit-passkey-settings.mjs +4 -3
- package/fesm2022/masmarino-gabarit-passkey-settings.mjs.map +1 -1
- package/fesm2022/masmarino-gabarit-pie-chart.mjs +5 -5
- package/fesm2022/masmarino-gabarit-pie-chart.mjs.map +1 -1
- package/fesm2022/masmarino-gabarit-popover.mjs +3 -3
- package/fesm2022/masmarino-gabarit-radio-group.mjs +5 -5
- package/fesm2022/masmarino-gabarit-radio-group.mjs.map +1 -1
- package/fesm2022/masmarino-gabarit-save-status.mjs +3 -3
- package/fesm2022/masmarino-gabarit-search-bar.mjs +5 -5
- package/fesm2022/masmarino-gabarit-search-bar.mjs.map +1 -1
- package/fesm2022/masmarino-gabarit-secret-reveal.mjs +3 -3
- package/fesm2022/masmarino-gabarit-segmented-control.mjs +5 -5
- package/fesm2022/masmarino-gabarit-segmented-control.mjs.map +1 -1
- package/fesm2022/masmarino-gabarit-select.mjs +5 -5
- package/fesm2022/masmarino-gabarit-select.mjs.map +1 -1
- package/fesm2022/masmarino-gabarit-skeleton-list.mjs +3 -3
- package/fesm2022/masmarino-gabarit-skeleton.mjs +3 -3
- package/fesm2022/masmarino-gabarit-slider.mjs +5 -5
- package/fesm2022/masmarino-gabarit-slider.mjs.map +1 -1
- package/fesm2022/masmarino-gabarit-sparkline.mjs +3 -3
- package/fesm2022/masmarino-gabarit-spinner.mjs +3 -3
- package/fesm2022/masmarino-gabarit-stat-grid.mjs +5 -5
- package/fesm2022/masmarino-gabarit-stat-grid.mjs.map +1 -1
- package/fesm2022/masmarino-gabarit-stat-tile.mjs +10 -10
- package/fesm2022/masmarino-gabarit-stat-tile.mjs.map +1 -1
- package/fesm2022/masmarino-gabarit-stepper.mjs +5 -5
- package/fesm2022/masmarino-gabarit-stepper.mjs.map +1 -1
- package/fesm2022/masmarino-gabarit-switch.mjs +5 -5
- package/fesm2022/masmarino-gabarit-switch.mjs.map +1 -1
- package/fesm2022/masmarino-gabarit-table.mjs +5 -5
- package/fesm2022/masmarino-gabarit-table.mjs.map +1 -1
- package/fesm2022/masmarino-gabarit-tabs.mjs +8 -8
- package/fesm2022/masmarino-gabarit-tabs.mjs.map +1 -1
- package/fesm2022/masmarino-gabarit-tag-input.mjs +5 -5
- package/fesm2022/masmarino-gabarit-tag-input.mjs.map +1 -1
- package/fesm2022/masmarino-gabarit-tag.mjs +5 -5
- package/fesm2022/masmarino-gabarit-tag.mjs.map +1 -1
- package/fesm2022/masmarino-gabarit-textarea.mjs +5 -5
- package/fesm2022/masmarino-gabarit-textarea.mjs.map +1 -1
- package/fesm2022/masmarino-gabarit-timeline-chart.mjs +6 -6
- package/fesm2022/masmarino-gabarit-toaster.mjs +8 -8
- package/fesm2022/masmarino-gabarit-toaster.mjs.map +1 -1
- package/fesm2022/masmarino-gabarit-tooltip.mjs +5 -5
- package/fesm2022/masmarino-gabarit-tooltip.mjs.map +1 -1
- package/fesm2022/masmarino-gabarit-tree.mjs +5 -5
- package/fesm2022/masmarino-gabarit-tree.mjs.map +1 -1
- package/fesm2022/masmarino-gabarit-user-chip.mjs +3 -3
- package/fesm2022/masmarino-gabarit.mjs +1 -1
- package/fesm2022/masmarino-gabarit.mjs.map +1 -1
- package/file-upload/package.json +4 -0
- package/floating-panel/package.json +4 -0
- package/format/package.json +4 -0
- package/funnel-chart/package.json +4 -0
- package/gauge-bar/package.json +4 -0
- package/git-field/package.json +4 -0
- package/icon/package.json +4 -0
- package/icon-marker/package.json +4 -0
- package/input/package.json +4 -0
- package/job-graph/package.json +4 -0
- package/job-status/package.json +4 -0
- package/line-chart/package.json +4 -0
- package/list-card/package.json +4 -0
- package/list-row/package.json +4 -0
- package/list-toolbar/package.json +4 -0
- package/menu/package.json +4 -0
- package/mfa-enrollment/package.json +4 -0
- package/mfa-settings/package.json +4 -0
- package/modal/package.json +4 -0
- package/nav-tabs/package.json +4 -0
- package/notification-dot/package.json +4 -0
- package/package.json +2 -2
- package/page-header/package.json +4 -0
- package/page-layout/package.json +4 -0
- package/pagination/package.json +4 -0
- package/panel/package.json +4 -0
- package/passkey-settings/package.json +4 -0
- package/pie-chart/package.json +4 -0
- package/popover/package.json +4 -0
- package/radio-group/package.json +4 -0
- package/save-status/package.json +4 -0
- package/search-bar/package.json +4 -0
- package/secret-reveal/package.json +4 -0
- package/segmented-control/package.json +4 -0
- package/select/package.json +4 -0
- package/skeleton/package.json +4 -0
- package/skeleton-list/package.json +4 -0
- package/slider/package.json +4 -0
- package/sparkline/package.json +4 -0
- package/spinner/package.json +4 -0
- package/src/lib/tokens/_base.scss +4 -0
- package/src/lib/tokens/_depth.scss +53 -0
- package/src/lib/tokens/_palette.scss +5 -1
- package/src/lib/tokens/_semantic.scss +9 -3
- package/src/lib/tokens/_themes.scss +79 -4
- package/src/lib/tokens/_utilities.scss +25 -2
- package/src/lib/tokens/index.scss +1 -0
- package/stat-grid/package.json +4 -0
- package/stat-tile/package.json +4 -0
- package/stepper/package.json +4 -0
- package/switch/package.json +4 -0
- package/table/package.json +4 -0
- package/tabs/package.json +4 -0
- package/tag/package.json +4 -0
- package/tag-input/package.json +4 -0
- package/textarea/package.json +4 -0
- package/timeline-chart/package.json +4 -0
- package/toaster/package.json +4 -0
- package/tooltip/package.json +4 -0
- package/tree/package.json +4 -0
- package/types/masmarino-gabarit-avatar.d.ts +1 -1
- package/types/masmarino-gabarit-card.d.ts +7 -0
- package/types/masmarino-gabarit-chart.d.ts +0 -27
- package/types/masmarino-gabarit-date-picker.d.ts +0 -59
- package/types/masmarino-gabarit-line-chart.d.ts +0 -1
- package/types/masmarino-gabarit-nav-tabs.d.ts +0 -5
- package/types/masmarino-gabarit-pagination.d.ts +0 -1
- package/types/masmarino-gabarit-tree.d.ts +0 -1
- package/types/masmarino-gabarit.d.ts +1 -1
- package/user-chip/package.json +4 -0
|
@@ -17,7 +17,7 @@ var SaveStatus = class SaveStatus {
|
|
|
17
17
|
}, ...ngDevMode ? [{ debugName: "text" }] : /* istanbul ignore next */ []);
|
|
18
18
|
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
19
19
|
minVersion: "12.0.0",
|
|
20
|
-
version: "22.2.
|
|
20
|
+
version: "22.2.4",
|
|
21
21
|
ngImport: i0,
|
|
22
22
|
type: SaveStatus,
|
|
23
23
|
deps: [],
|
|
@@ -25,7 +25,7 @@ var SaveStatus = class SaveStatus {
|
|
|
25
25
|
});
|
|
26
26
|
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
27
27
|
minVersion: "17.0.0",
|
|
28
|
-
version: "22.2.
|
|
28
|
+
version: "22.2.4",
|
|
29
29
|
type: SaveStatus,
|
|
30
30
|
isStandalone: true,
|
|
31
31
|
selector: "gbt-save-status",
|
|
@@ -80,7 +80,7 @@ var SaveStatus = class SaveStatus {
|
|
|
80
80
|
};
|
|
81
81
|
i0.ɵɵngDeclareClassMetadata({
|
|
82
82
|
minVersion: "12.0.0",
|
|
83
|
-
version: "22.2.
|
|
83
|
+
version: "22.2.4",
|
|
84
84
|
ngImport: i0,
|
|
85
85
|
type: SaveStatus,
|
|
86
86
|
decorators: [{
|
|
@@ -174,7 +174,7 @@ var SearchBar = class SearchBar {
|
|
|
174
174
|
}
|
|
175
175
|
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
176
176
|
minVersion: "12.0.0",
|
|
177
|
-
version: "22.2.
|
|
177
|
+
version: "22.2.4",
|
|
178
178
|
ngImport: i0,
|
|
179
179
|
type: SearchBar,
|
|
180
180
|
deps: [],
|
|
@@ -182,7 +182,7 @@ var SearchBar = class SearchBar {
|
|
|
182
182
|
});
|
|
183
183
|
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
184
184
|
minVersion: "17.0.0",
|
|
185
|
-
version: "22.2.
|
|
185
|
+
version: "22.2.4",
|
|
186
186
|
type: SearchBar,
|
|
187
187
|
isStandalone: true,
|
|
188
188
|
selector: "gbt-search-bar",
|
|
@@ -352,7 +352,7 @@ var SearchBar = class SearchBar {
|
|
|
352
352
|
}],
|
|
353
353
|
ngImport: i0,
|
|
354
354
|
template: "@if (collapsibleMode()) {\n @if (folded()) {\n <button\n #toggle\n type=\"button\"\n class=\"gbt-sb-toggle\"\n aria-expanded=\"false\"\n [attr.aria-controls]=\"triggerId()\"\n [attr.aria-label]=\"openLabel()\"\n (click)=\"expand()\"\n >\n <gbt-icon name=\"search\" aria-hidden=\"true\" />\n </button>\n }\n}\n<!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events, @angular-eslint/template/interactive-supports-focus -->\n<div\n class=\"gbt-sb-trigger\"\n [attr.id]=\"collapsibleMode() ? triggerId() : null\"\n [attr.hidden]=\"folded() && collapsibleMode() === 'always' ? '' : null\"\n [class.gbt-sb-trigger--folded]=\"folded()\"\n [class.gbt-sb-trigger--open]=\"isFocused()\"\n (click)=\"focusSearch()\"\n>\n @if (collapsibleMode() && expanded()) {\n <button\n type=\"button\"\n class=\"gbt-sb-trigger__close\"\n [attr.aria-label]=\"closeLabel()\"\n (click)=\"close($event)\"\n >\n <gbt-icon name=\"arrow-left\" aria-hidden=\"true\" />\n </button>\n }\n <gbt-icon name=\"search\" class=\"gbt-sb-trigger__icon\" aria-hidden=\"true\" />\n <input\n #searchInput\n type=\"text\"\n role=\"combobox\"\n class=\"gbt-sb-trigger__input\"\n [placeholder]=\"placeholder()\"\n [attr.aria-label]=\"ariaLabel() || placeholder()\"\n [value]=\"searchQuery()\"\n [attr.aria-expanded]=\"showOverlay()\"\n aria-autocomplete=\"list\"\n aria-haspopup=\"listbox\"\n [attr.aria-controls]=\"showOverlay() ? panelId() : null\"\n [attr.aria-activedescendant]=\"activeItemDomId()\"\n (focus)=\"onFocus()\"\n (blur)=\"onBlur($event)\"\n (input)=\"onInput($event)\"\n autocomplete=\"off\"\n spellcheck=\"false\"\n />\n @if (searchQuery().length > 0) {\n <button\n type=\"button\"\n class=\"gbt-sb-trigger__clear\"\n (click)=\"onClear()\"\n [attr.aria-label]=\"clearLabel()\"\n >\n <gbt-icon name=\"x\" aria-hidden=\"true\" />\n </button>\n }\n</div>\n@if (showOverlay()) {\n <div role=\"status\" aria-live=\"polite\" aria-atomic=\"true\" class=\"sr-only\">\n {{ resultsAnnouncement()(resultCount()) }}\n </div>\n}\n@if (showOverlay()) {\n <div class=\"gbt-sb-backdrop\" (click)=\"blurSearch()\" aria-hidden=\"true\"></div>\n <ng-template #footer>\n <div class=\"gbt-sb-footer\" aria-hidden=\"true\">\n <span class=\"gbt-sb-footer__hint\">\n <kbd class=\"gbt-sb-kbd gbt-sb-kbd--sm\">↑</kbd>\n <kbd class=\"gbt-sb-kbd gbt-sb-kbd--sm\">↓</kbd>\n {{ navigateHint() }}\n </span>\n <span class=\"gbt-sb-footer__hint\">\n <kbd class=\"gbt-sb-kbd gbt-sb-kbd--sm\">↵</kbd>\n {{ selectHint() }}\n </span>\n <span class=\"gbt-sb-footer__hint\">\n <kbd class=\"gbt-sb-kbd gbt-sb-kbd--sm\">Esc</kbd>\n {{ closeHint() }}\n </span>\n </div>\n </ng-template>\n @if (hasNoResults()) {\n <div [id]=\"panelId()\" class=\"gbt-sb-panel\">\n <div class=\"gbt-sb-state\" role=\"status\">\n <gbt-icon name=\"search\" class=\"gbt-sb-state__icon\" aria-hidden=\"true\" />\n <span>{{ noResultsMessage() }}</span>\n <p class=\"gbt-sb-state__hint\">{{ noResultsHint() }}</p>\n </div>\n <ng-container [ngTemplateOutlet]=\"footer\"></ng-container>\n </div>\n } @else {\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events, @angular-eslint/template/interactive-supports-focus -->\n <div\n [id]=\"panelId()\"\n class=\"gbt-sb-panel\"\n role=\"listbox\"\n (mousedown)=\"$event.preventDefault()\"\n (click)=\"$event.stopPropagation()\"\n >\n @if (hasGroupedResults()) {\n <div class=\"gbt-sb-list\">\n @for (category of indexedGroupedResults(); track category.label) {\n @if (category.items.length > 0) {\n <div class=\"gbt-sb-group-label\">\n @if (category.icon) {\n <gbt-icon [name]=\"category.icon\" aria-hidden=\"true\" />\n }\n {{ category.label }}\n <span class=\"gbt-sb-group-count\" aria-hidden=\"true\">{{\n category.items.length\n }}</span>\n </div>\n @for (entry of category.indexedItems; track entry.index) {\n <button\n type=\"button\"\n role=\"option\"\n tabindex=\"-1\"\n [id]=\"itemDomId(entry.index)\"\n class=\"gbt-sb-item\"\n [attr.aria-selected]=\"entry.index === activeIndex()\"\n [class.gbt-sb-item--active]=\"entry.index === activeIndex()\"\n (click)=\"onSelect(entry.item)\"\n (mouseenter)=\"activeIndex.set(entry.index)\"\n >\n @if (itemTemplate()) {\n <ng-container\n [ngTemplateOutlet]=\"itemTemplate()!\"\n [ngTemplateOutletContext]=\"{ $implicit: entry.item }\"\n ></ng-container>\n } @else {\n @if (category.icon) {\n <gbt-icon\n [name]=\"category.icon\"\n class=\"gbt-sb-item__icon\"\n aria-hidden=\"true\"\n />\n }\n <span class=\"gbt-sb-item__label\">{{ entry.formatted }}</span>\n }\n </button>\n }\n }\n }\n </div>\n } @else if (results() && results()!.length > 0) {\n <div class=\"gbt-sb-list\">\n @for (entry of indexedResults(); track entry.index) {\n <button\n type=\"button\"\n role=\"option\"\n tabindex=\"-1\"\n [id]=\"itemDomId(entry.index)\"\n class=\"gbt-sb-item\"\n [attr.aria-selected]=\"entry.index === activeIndex()\"\n [class.gbt-sb-item--active]=\"entry.index === activeIndex()\"\n (click)=\"onSelect(entry.item)\"\n (mouseenter)=\"activeIndex.set(entry.index)\"\n >\n @if (itemTemplate()) {\n <ng-container\n [ngTemplateOutlet]=\"itemTemplate()!\"\n [ngTemplateOutletContext]=\"{ $implicit: entry.item }\"\n ></ng-container>\n } @else {\n <span class=\"gbt-sb-item__label\">{{ entry.formatted }}</span>\n }\n </button>\n }\n </div>\n }\n\n <ng-container [ngTemplateOutlet]=\"footer\"></ng-container>\n </div>\n }\n}\n",
|
|
355
|
-
styles: [":host{position:relative;display:block}.gbt-sb-trigger{position:relative;z-index:1000;box-sizing:border-box;display:flex;align-items:center;gap:8px;height:40px;width:340px;padding:0 12px;background:var(--bg-principal);border:1px solid var(--border-color);border-radius:var(--gbt-radius-search,
|
|
355
|
+
styles: [":host{position:relative;display:block}.gbt-sb-trigger{position:relative;z-index:1000;box-sizing:border-box;display:flex;align-items:center;gap:8px;height:40px;width:340px;padding:0 12px;background:var(--bg-principal);border:1px solid var(--border-color);border-radius:var(--gbt-radius-search, var(--site-border-radius-sm));box-shadow:var(--gbt-depth-hollow);transition:width .35s cubic-bezier(.34,1.56,.64,1),border-color .2s cubic-bezier(.4,0,.2,1),box-shadow .2s cubic-bezier(.4,0,.2,1);cursor:text}.gbt-sb-trigger--open{width:420px;border-color:var(--primary);box-shadow:0 0 0 4px color-mix(in srgb,var(--primary) 12%,transparent)}.gbt-sb-trigger__icon{flex-shrink:0;color:var(--text-secondary);transition:color .2s cubic-bezier(.4,0,.2,1),transform .3s cubic-bezier(.34,1.56,.64,1)}.gbt-sb-trigger--open .gbt-sb-trigger__icon{color:var(--primary);transform:scale(1.1) rotate(5deg)}.gbt-sb-trigger__input{flex:1;min-width:0;border:none;outline:none;background:transparent;color:var(--text-primary);font-size:14px;line-height:1.5}.gbt-sb-trigger__input::placeholder{color:var(--text-secondary)}.gbt-sb-trigger__clear{flex-shrink:0;display:flex;align-items:center;justify-content:center;width:28px;height:28px;padding:0;background:transparent;border:none;border-radius:var(--gbt-radius-chip, var(--site-border-radius-xs));color:var(--text-secondary);cursor:pointer;transition:background .15s cubic-bezier(.4,0,.2,1),color .15s cubic-bezier(.4,0,.2,1)}.gbt-sb-trigger__clear:hover{background:var(--bg-hover);color:var(--text-primary)}.gbt-sb-trigger__clear:active{background:var(--bg-press);color:var(--text-primary)}.gbt-sb-trigger__clear:active{transform:scale(.9)}.gbt-sb-trigger[hidden],.gbt-sb-trigger--folded{display:none}.gbt-sb-toggle{box-sizing:border-box;display:inline-flex;align-items:center;justify-content:center;width:44px;height:44px;padding:0;border:none;border-radius:var(--site-border-radius-sm);background:none;color:var(--text-primary);cursor:pointer;transition:background .15s cubic-bezier(.4,0,.2,1)}.gbt-sb-toggle:hover{background:var(--bg-hover)}.gbt-sb-toggle:active{background:var(--bg-press);color:var(--text-primary)}.gbt-sb-toggle:focus-visible{outline:2px solid var(--gbt-focus-ring, var(--focus-ring));outline-offset:2px}.gbt-sb-trigger__close{flex-shrink:0;display:flex;align-items:center;justify-content:center;width:44px;height:calc(100% + 2px);margin:-1px 0 -1px -13px;padding:0;background:transparent;border:none;border-radius:calc(var(--gbt-radius-search, var(--site-border-radius-sm)) - 1px) 0 0 calc(var(--gbt-radius-search, var(--site-border-radius-sm)) - 1px);color:var(--text-secondary);cursor:pointer;transition:background .15s cubic-bezier(.4,0,.2,1),color .15s cubic-bezier(.4,0,.2,1)}.gbt-sb-trigger__close:hover{background:var(--bg-hover);color:var(--text-primary)}.gbt-sb-trigger__close:active{background:var(--bg-press);color:var(--text-primary)}.gbt-sb-trigger__close:focus-visible{outline:2px solid var(--gbt-focus-ring, var(--focus-ring));outline-offset:-2px}@media(prefers-reduced-motion:reduce){.gbt-sb-trigger__close{transition:none}}:host([data-collapsible][data-expanded]) .gbt-sb-trigger__icon{display:none}:host([data-collapsible]) .gbt-sb-trigger{width:100%;height:44px}:host([data-collapsible]) .gbt-sb-trigger--open{width:100%}@media(min-width:769px){:host([data-collapsible=narrow]) .gbt-sb-toggle,:host([data-collapsible=narrow]) .gbt-sb-trigger__close{display:none}:host([data-collapsible=narrow]) .gbt-sb-trigger__icon{display:inline-flex}:host([data-collapsible=narrow]) .gbt-sb-trigger--folded{display:flex}:host([data-collapsible=narrow]) .gbt-sb-trigger{width:340px;height:40px}:host([data-collapsible=narrow]) .gbt-sb-trigger--open{width:420px}}.gbt-sb-backdrop{position:fixed;inset:0;background:#0000004d;backdrop-filter:blur(2px);-webkit-backdrop-filter:blur(2px);z-index:999;animation:gbt-search-bar-fade-in .2s cubic-bezier(.4,0,.2,1) both}.gbt-sb-panel{position:absolute;top:calc(100% + 8px);left:50%;transform:translate(-50%);width:420px;max-height:460px;background:var(--bg-principal);border:1px solid var(--border-color);border-radius:var(--site-border-radius-lg);box-shadow:0 16px 48px #0000002e,0 4px 12px #00000014;overflow:hidden;display:flex;flex-direction:column;z-index:1001;animation:gbt-search-bar-scale-in .25s cubic-bezier(.34,1.56,.64,1) both}.gbt-sb-list{flex:1;overflow-y:auto;padding:6px;display:flex;flex-direction:column}.gbt-sb-list::-webkit-scrollbar{width:6px}.gbt-sb-list::-webkit-scrollbar-track{background:transparent}.gbt-sb-list::-webkit-scrollbar-thumb{background:var(--bg-hover);border-radius:3px}.gbt-sb-list::-webkit-scrollbar-thumb:hover{background:var(--border-color)}.gbt-sb-group-label{display:flex;align-items:center;gap:6px;padding:10px 10px 4px;color:var(--text-secondary);font-size:11px;font-weight:600;text-transform:uppercase;letter-spacing:.5px}.gbt-sb-group-count{margin-left:auto;padding:1px 7px;background:var(--bg-hover);border-radius:var(--gbt-radius-badge, var(--site-border-radius-sm));font-size:11px;font-weight:600;color:var(--text-secondary)}.gbt-sb-item{box-sizing:border-box;display:flex;align-items:center;gap:10px;width:100%;padding:9px 10px;background:transparent;border:none;border-radius:var(--gbt-radius-menu, var(--site-border-radius-sm));text-align:left;cursor:pointer;transition:background .12s cubic-bezier(.4,0,.2,1)}.gbt-sb-item:hover{background:var(--bg-hover)}.gbt-sb-item:active{background:var(--bg-press);color:var(--text-primary)}.gbt-sb-item--active{background:color-mix(in srgb,var(--primary) 9%,transparent)}.gbt-sb-item__icon{flex-shrink:0;color:var(--text-secondary);transition:color .15s cubic-bezier(.4,0,.2,1)}.gbt-sb-item--active .gbt-sb-item__icon{color:var(--primary)}.gbt-sb-item__label{flex:1;font-size:14px;font-weight:500;color:var(--text-primary);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.gbt-sb-state{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:48px 24px;gap:12px;text-align:center}.gbt-sb-state span{color:var(--text-primary);font-size:14px;font-weight:500}.gbt-sb-state__icon{color:var(--text-secondary);opacity:.4}.gbt-sb-state__hint{margin:0;color:var(--text-secondary);font-size:12px}.gbt-sb-kbd{display:inline-flex;align-items:center;justify-content:center;min-width:22px;height:22px;padding:0 5px;background:var(--bg-hover);border:1px solid var(--border-color);border-bottom-width:2px;border-radius:var(--gbt-radius-chip, var(--site-border-radius-xs));color:var(--text-secondary);font-size:11px;font-family:var(--gbt-font-mono);font-weight:500;line-height:1}.gbt-sb-kbd--sm{min-width:18px;height:18px;font-size:10px;border-radius:4px}.gbt-sb-footer{flex-shrink:0;display:flex;align-items:center;gap:16px;padding:8px 12px;border-top:1px solid var(--border-color);background:var(--bg-hover)}.gbt-sb-footer__hint{display:flex;align-items:center;gap:4px;color:var(--text-secondary);font-size:11px}.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}@keyframes gbt-search-bar-fade-in{0%{opacity:0}to{opacity:1}}@keyframes gbt-search-bar-scale-in{0%{opacity:0;transform:translate(-50%) scale(.96) translateY(-6px)}to{opacity:1;transform:translate(-50%) scale(1) translateY(0)}}@media(prefers-reduced-motion:reduce){.gbt-sb-toggle,.gbt-sb-item,.gbt-sb-item__icon{transition:none}.gbt-sb-trigger{transition:border-color .15s,box-shadow .15s}.gbt-sb-trigger__icon{transition:color .15s;transform:none!important}.gbt-sb-trigger__clear{transition:none}.gbt-sb-trigger__clear:active{transform:none}.gbt-sb-backdrop,.gbt-sb-panel{animation:none}}@media screen and (max-width:800px){.gbt-sb-trigger,.gbt-sb-trigger--open{width:100%}.gbt-sb-panel{width:calc(100vw - 32px);max-height:360px}.gbt-sb-state{padding:32px 16px}}\n"],
|
|
356
356
|
dependencies: [{
|
|
357
357
|
kind: "component",
|
|
358
358
|
type: Icon,
|
|
@@ -373,7 +373,7 @@ var SearchBar = class SearchBar {
|
|
|
373
373
|
};
|
|
374
374
|
i0.ɵɵngDeclareClassMetadata({
|
|
375
375
|
minVersion: "12.0.0",
|
|
376
|
-
version: "22.2.
|
|
376
|
+
version: "22.2.4",
|
|
377
377
|
ngImport: i0,
|
|
378
378
|
type: SearchBar,
|
|
379
379
|
decorators: [{
|
|
@@ -390,7 +390,7 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
390
390
|
"[attr.data-expanded]": "collapsibleMode() && expanded() ? \"\" : null"
|
|
391
391
|
},
|
|
392
392
|
template: "@if (collapsibleMode()) {\n @if (folded()) {\n <button\n #toggle\n type=\"button\"\n class=\"gbt-sb-toggle\"\n aria-expanded=\"false\"\n [attr.aria-controls]=\"triggerId()\"\n [attr.aria-label]=\"openLabel()\"\n (click)=\"expand()\"\n >\n <gbt-icon name=\"search\" aria-hidden=\"true\" />\n </button>\n }\n}\n<!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events, @angular-eslint/template/interactive-supports-focus -->\n<div\n class=\"gbt-sb-trigger\"\n [attr.id]=\"collapsibleMode() ? triggerId() : null\"\n [attr.hidden]=\"folded() && collapsibleMode() === 'always' ? '' : null\"\n [class.gbt-sb-trigger--folded]=\"folded()\"\n [class.gbt-sb-trigger--open]=\"isFocused()\"\n (click)=\"focusSearch()\"\n>\n @if (collapsibleMode() && expanded()) {\n <button\n type=\"button\"\n class=\"gbt-sb-trigger__close\"\n [attr.aria-label]=\"closeLabel()\"\n (click)=\"close($event)\"\n >\n <gbt-icon name=\"arrow-left\" aria-hidden=\"true\" />\n </button>\n }\n <gbt-icon name=\"search\" class=\"gbt-sb-trigger__icon\" aria-hidden=\"true\" />\n <input\n #searchInput\n type=\"text\"\n role=\"combobox\"\n class=\"gbt-sb-trigger__input\"\n [placeholder]=\"placeholder()\"\n [attr.aria-label]=\"ariaLabel() || placeholder()\"\n [value]=\"searchQuery()\"\n [attr.aria-expanded]=\"showOverlay()\"\n aria-autocomplete=\"list\"\n aria-haspopup=\"listbox\"\n [attr.aria-controls]=\"showOverlay() ? panelId() : null\"\n [attr.aria-activedescendant]=\"activeItemDomId()\"\n (focus)=\"onFocus()\"\n (blur)=\"onBlur($event)\"\n (input)=\"onInput($event)\"\n autocomplete=\"off\"\n spellcheck=\"false\"\n />\n @if (searchQuery().length > 0) {\n <button\n type=\"button\"\n class=\"gbt-sb-trigger__clear\"\n (click)=\"onClear()\"\n [attr.aria-label]=\"clearLabel()\"\n >\n <gbt-icon name=\"x\" aria-hidden=\"true\" />\n </button>\n }\n</div>\n@if (showOverlay()) {\n <div role=\"status\" aria-live=\"polite\" aria-atomic=\"true\" class=\"sr-only\">\n {{ resultsAnnouncement()(resultCount()) }}\n </div>\n}\n@if (showOverlay()) {\n <div class=\"gbt-sb-backdrop\" (click)=\"blurSearch()\" aria-hidden=\"true\"></div>\n <ng-template #footer>\n <div class=\"gbt-sb-footer\" aria-hidden=\"true\">\n <span class=\"gbt-sb-footer__hint\">\n <kbd class=\"gbt-sb-kbd gbt-sb-kbd--sm\">↑</kbd>\n <kbd class=\"gbt-sb-kbd gbt-sb-kbd--sm\">↓</kbd>\n {{ navigateHint() }}\n </span>\n <span class=\"gbt-sb-footer__hint\">\n <kbd class=\"gbt-sb-kbd gbt-sb-kbd--sm\">↵</kbd>\n {{ selectHint() }}\n </span>\n <span class=\"gbt-sb-footer__hint\">\n <kbd class=\"gbt-sb-kbd gbt-sb-kbd--sm\">Esc</kbd>\n {{ closeHint() }}\n </span>\n </div>\n </ng-template>\n @if (hasNoResults()) {\n <div [id]=\"panelId()\" class=\"gbt-sb-panel\">\n <div class=\"gbt-sb-state\" role=\"status\">\n <gbt-icon name=\"search\" class=\"gbt-sb-state__icon\" aria-hidden=\"true\" />\n <span>{{ noResultsMessage() }}</span>\n <p class=\"gbt-sb-state__hint\">{{ noResultsHint() }}</p>\n </div>\n <ng-container [ngTemplateOutlet]=\"footer\"></ng-container>\n </div>\n } @else {\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events, @angular-eslint/template/interactive-supports-focus -->\n <div\n [id]=\"panelId()\"\n class=\"gbt-sb-panel\"\n role=\"listbox\"\n (mousedown)=\"$event.preventDefault()\"\n (click)=\"$event.stopPropagation()\"\n >\n @if (hasGroupedResults()) {\n <div class=\"gbt-sb-list\">\n @for (category of indexedGroupedResults(); track category.label) {\n @if (category.items.length > 0) {\n <div class=\"gbt-sb-group-label\">\n @if (category.icon) {\n <gbt-icon [name]=\"category.icon\" aria-hidden=\"true\" />\n }\n {{ category.label }}\n <span class=\"gbt-sb-group-count\" aria-hidden=\"true\">{{\n category.items.length\n }}</span>\n </div>\n @for (entry of category.indexedItems; track entry.index) {\n <button\n type=\"button\"\n role=\"option\"\n tabindex=\"-1\"\n [id]=\"itemDomId(entry.index)\"\n class=\"gbt-sb-item\"\n [attr.aria-selected]=\"entry.index === activeIndex()\"\n [class.gbt-sb-item--active]=\"entry.index === activeIndex()\"\n (click)=\"onSelect(entry.item)\"\n (mouseenter)=\"activeIndex.set(entry.index)\"\n >\n @if (itemTemplate()) {\n <ng-container\n [ngTemplateOutlet]=\"itemTemplate()!\"\n [ngTemplateOutletContext]=\"{ $implicit: entry.item }\"\n ></ng-container>\n } @else {\n @if (category.icon) {\n <gbt-icon\n [name]=\"category.icon\"\n class=\"gbt-sb-item__icon\"\n aria-hidden=\"true\"\n />\n }\n <span class=\"gbt-sb-item__label\">{{ entry.formatted }}</span>\n }\n </button>\n }\n }\n }\n </div>\n } @else if (results() && results()!.length > 0) {\n <div class=\"gbt-sb-list\">\n @for (entry of indexedResults(); track entry.index) {\n <button\n type=\"button\"\n role=\"option\"\n tabindex=\"-1\"\n [id]=\"itemDomId(entry.index)\"\n class=\"gbt-sb-item\"\n [attr.aria-selected]=\"entry.index === activeIndex()\"\n [class.gbt-sb-item--active]=\"entry.index === activeIndex()\"\n (click)=\"onSelect(entry.item)\"\n (mouseenter)=\"activeIndex.set(entry.index)\"\n >\n @if (itemTemplate()) {\n <ng-container\n [ngTemplateOutlet]=\"itemTemplate()!\"\n [ngTemplateOutletContext]=\"{ $implicit: entry.item }\"\n ></ng-container>\n } @else {\n <span class=\"gbt-sb-item__label\">{{ entry.formatted }}</span>\n }\n </button>\n }\n </div>\n }\n\n <ng-container [ngTemplateOutlet]=\"footer\"></ng-container>\n </div>\n }\n}\n",
|
|
393
|
-
styles: [":host{position:relative;display:block}.gbt-sb-trigger{position:relative;z-index:1000;box-sizing:border-box;display:flex;align-items:center;gap:8px;height:40px;width:340px;padding:0 12px;background:var(--bg-principal);border:1px solid var(--border-color);border-radius:var(--gbt-radius-search,
|
|
393
|
+
styles: [":host{position:relative;display:block}.gbt-sb-trigger{position:relative;z-index:1000;box-sizing:border-box;display:flex;align-items:center;gap:8px;height:40px;width:340px;padding:0 12px;background:var(--bg-principal);border:1px solid var(--border-color);border-radius:var(--gbt-radius-search, var(--site-border-radius-sm));box-shadow:var(--gbt-depth-hollow);transition:width .35s cubic-bezier(.34,1.56,.64,1),border-color .2s cubic-bezier(.4,0,.2,1),box-shadow .2s cubic-bezier(.4,0,.2,1);cursor:text}.gbt-sb-trigger--open{width:420px;border-color:var(--primary);box-shadow:0 0 0 4px color-mix(in srgb,var(--primary) 12%,transparent)}.gbt-sb-trigger__icon{flex-shrink:0;color:var(--text-secondary);transition:color .2s cubic-bezier(.4,0,.2,1),transform .3s cubic-bezier(.34,1.56,.64,1)}.gbt-sb-trigger--open .gbt-sb-trigger__icon{color:var(--primary);transform:scale(1.1) rotate(5deg)}.gbt-sb-trigger__input{flex:1;min-width:0;border:none;outline:none;background:transparent;color:var(--text-primary);font-size:14px;line-height:1.5}.gbt-sb-trigger__input::placeholder{color:var(--text-secondary)}.gbt-sb-trigger__clear{flex-shrink:0;display:flex;align-items:center;justify-content:center;width:28px;height:28px;padding:0;background:transparent;border:none;border-radius:var(--gbt-radius-chip, var(--site-border-radius-xs));color:var(--text-secondary);cursor:pointer;transition:background .15s cubic-bezier(.4,0,.2,1),color .15s cubic-bezier(.4,0,.2,1)}.gbt-sb-trigger__clear:hover{background:var(--bg-hover);color:var(--text-primary)}.gbt-sb-trigger__clear:active{background:var(--bg-press);color:var(--text-primary)}.gbt-sb-trigger__clear:active{transform:scale(.9)}.gbt-sb-trigger[hidden],.gbt-sb-trigger--folded{display:none}.gbt-sb-toggle{box-sizing:border-box;display:inline-flex;align-items:center;justify-content:center;width:44px;height:44px;padding:0;border:none;border-radius:var(--site-border-radius-sm);background:none;color:var(--text-primary);cursor:pointer;transition:background .15s cubic-bezier(.4,0,.2,1)}.gbt-sb-toggle:hover{background:var(--bg-hover)}.gbt-sb-toggle:active{background:var(--bg-press);color:var(--text-primary)}.gbt-sb-toggle:focus-visible{outline:2px solid var(--gbt-focus-ring, var(--focus-ring));outline-offset:2px}.gbt-sb-trigger__close{flex-shrink:0;display:flex;align-items:center;justify-content:center;width:44px;height:calc(100% + 2px);margin:-1px 0 -1px -13px;padding:0;background:transparent;border:none;border-radius:calc(var(--gbt-radius-search, var(--site-border-radius-sm)) - 1px) 0 0 calc(var(--gbt-radius-search, var(--site-border-radius-sm)) - 1px);color:var(--text-secondary);cursor:pointer;transition:background .15s cubic-bezier(.4,0,.2,1),color .15s cubic-bezier(.4,0,.2,1)}.gbt-sb-trigger__close:hover{background:var(--bg-hover);color:var(--text-primary)}.gbt-sb-trigger__close:active{background:var(--bg-press);color:var(--text-primary)}.gbt-sb-trigger__close:focus-visible{outline:2px solid var(--gbt-focus-ring, var(--focus-ring));outline-offset:-2px}@media(prefers-reduced-motion:reduce){.gbt-sb-trigger__close{transition:none}}:host([data-collapsible][data-expanded]) .gbt-sb-trigger__icon{display:none}:host([data-collapsible]) .gbt-sb-trigger{width:100%;height:44px}:host([data-collapsible]) .gbt-sb-trigger--open{width:100%}@media(min-width:769px){:host([data-collapsible=narrow]) .gbt-sb-toggle,:host([data-collapsible=narrow]) .gbt-sb-trigger__close{display:none}:host([data-collapsible=narrow]) .gbt-sb-trigger__icon{display:inline-flex}:host([data-collapsible=narrow]) .gbt-sb-trigger--folded{display:flex}:host([data-collapsible=narrow]) .gbt-sb-trigger{width:340px;height:40px}:host([data-collapsible=narrow]) .gbt-sb-trigger--open{width:420px}}.gbt-sb-backdrop{position:fixed;inset:0;background:#0000004d;backdrop-filter:blur(2px);-webkit-backdrop-filter:blur(2px);z-index:999;animation:gbt-search-bar-fade-in .2s cubic-bezier(.4,0,.2,1) both}.gbt-sb-panel{position:absolute;top:calc(100% + 8px);left:50%;transform:translate(-50%);width:420px;max-height:460px;background:var(--bg-principal);border:1px solid var(--border-color);border-radius:var(--site-border-radius-lg);box-shadow:0 16px 48px #0000002e,0 4px 12px #00000014;overflow:hidden;display:flex;flex-direction:column;z-index:1001;animation:gbt-search-bar-scale-in .25s cubic-bezier(.34,1.56,.64,1) both}.gbt-sb-list{flex:1;overflow-y:auto;padding:6px;display:flex;flex-direction:column}.gbt-sb-list::-webkit-scrollbar{width:6px}.gbt-sb-list::-webkit-scrollbar-track{background:transparent}.gbt-sb-list::-webkit-scrollbar-thumb{background:var(--bg-hover);border-radius:3px}.gbt-sb-list::-webkit-scrollbar-thumb:hover{background:var(--border-color)}.gbt-sb-group-label{display:flex;align-items:center;gap:6px;padding:10px 10px 4px;color:var(--text-secondary);font-size:11px;font-weight:600;text-transform:uppercase;letter-spacing:.5px}.gbt-sb-group-count{margin-left:auto;padding:1px 7px;background:var(--bg-hover);border-radius:var(--gbt-radius-badge, var(--site-border-radius-sm));font-size:11px;font-weight:600;color:var(--text-secondary)}.gbt-sb-item{box-sizing:border-box;display:flex;align-items:center;gap:10px;width:100%;padding:9px 10px;background:transparent;border:none;border-radius:var(--gbt-radius-menu, var(--site-border-radius-sm));text-align:left;cursor:pointer;transition:background .12s cubic-bezier(.4,0,.2,1)}.gbt-sb-item:hover{background:var(--bg-hover)}.gbt-sb-item:active{background:var(--bg-press);color:var(--text-primary)}.gbt-sb-item--active{background:color-mix(in srgb,var(--primary) 9%,transparent)}.gbt-sb-item__icon{flex-shrink:0;color:var(--text-secondary);transition:color .15s cubic-bezier(.4,0,.2,1)}.gbt-sb-item--active .gbt-sb-item__icon{color:var(--primary)}.gbt-sb-item__label{flex:1;font-size:14px;font-weight:500;color:var(--text-primary);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.gbt-sb-state{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:48px 24px;gap:12px;text-align:center}.gbt-sb-state span{color:var(--text-primary);font-size:14px;font-weight:500}.gbt-sb-state__icon{color:var(--text-secondary);opacity:.4}.gbt-sb-state__hint{margin:0;color:var(--text-secondary);font-size:12px}.gbt-sb-kbd{display:inline-flex;align-items:center;justify-content:center;min-width:22px;height:22px;padding:0 5px;background:var(--bg-hover);border:1px solid var(--border-color);border-bottom-width:2px;border-radius:var(--gbt-radius-chip, var(--site-border-radius-xs));color:var(--text-secondary);font-size:11px;font-family:var(--gbt-font-mono);font-weight:500;line-height:1}.gbt-sb-kbd--sm{min-width:18px;height:18px;font-size:10px;border-radius:4px}.gbt-sb-footer{flex-shrink:0;display:flex;align-items:center;gap:16px;padding:8px 12px;border-top:1px solid var(--border-color);background:var(--bg-hover)}.gbt-sb-footer__hint{display:flex;align-items:center;gap:4px;color:var(--text-secondary);font-size:11px}.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}@keyframes gbt-search-bar-fade-in{0%{opacity:0}to{opacity:1}}@keyframes gbt-search-bar-scale-in{0%{opacity:0;transform:translate(-50%) scale(.96) translateY(-6px)}to{opacity:1;transform:translate(-50%) scale(1) translateY(0)}}@media(prefers-reduced-motion:reduce){.gbt-sb-toggle,.gbt-sb-item,.gbt-sb-item__icon{transition:none}.gbt-sb-trigger{transition:border-color .15s,box-shadow .15s}.gbt-sb-trigger__icon{transition:color .15s;transform:none!important}.gbt-sb-trigger__clear{transition:none}.gbt-sb-trigger__clear:active{transform:none}.gbt-sb-backdrop,.gbt-sb-panel{animation:none}}@media screen and (max-width:800px){.gbt-sb-trigger,.gbt-sb-trigger--open{width:100%}.gbt-sb-panel{width:calc(100vw - 32px);max-height:360px}.gbt-sb-state{padding:32px 16px}}\n"]
|
|
394
394
|
}]
|
|
395
395
|
}],
|
|
396
396
|
propDecorators: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"masmarino-gabarit-search-bar.mjs","names":[],"sources":["../../../projects/gabarit/search-bar/search-bar.ts","../../../projects/gabarit/search-bar/search-bar.html"],"sourcesContent":["import {\n afterNextRender,\n booleanAttribute,\n ChangeDetectionStrategy,\n Component,\n computed,\n ElementRef,\n inject,\n Injector,\n input,\n model,\n output,\n signal,\n TemplateRef,\n viewChild,\n} from '@angular/core'\nimport { NgTemplateOutlet } from '@angular/common'\nimport { Icon } from '@masmarino/gabarit/icon'\n\nexport interface SearchResultCategory<T = unknown> {\n label: string\n icon?: string\n items: T[]\n}\n\nlet nextSearchBarId = 0\n\nexport type SearchBarCollapsible = boolean | 'narrow'\n\nfunction collapsibleAttribute(value: boolean | string | null | undefined): SearchBarCollapsible {\n return value === 'narrow' ? 'narrow' : booleanAttribute(value)\n}\n\n@Component({\n selector: 'gbt-search-bar',\n standalone: true,\n imports: [Icon, NgTemplateOutlet],\n templateUrl: './search-bar.html',\n styleUrl: './search-bar.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n '(keydown)': 'onNavigationKeydown($event)',\n '(document:click)': 'handleClickOutside($event)',\n '[attr.data-collapsible]': 'collapsibleMode()',\n '[attr.data-expanded]': 'collapsibleMode() && expanded() ? \"\" : null',\n },\n})\nexport class SearchBar<T = unknown> {\n private readonly elementRef = inject(ElementRef)\n private readonly injector = inject(Injector)\n\n id = input<string>(`gbt-search-bar-${++nextSearchBarId}`)\n results = input<T[] | null>(null)\n groupedResults = input<SearchResultCategory<T>[] | null>(null)\n placeholder = input<string>('Search…')\n ariaLabel = input<string>('')\n displayFn = input<(item: T) => string>((item) => String(item))\n itemTemplate = input<TemplateRef<unknown>>()\n keepQueryOnSelect = input(false)\n noResultsMessage = input<string>('No results')\n noResultsHint = input<string>('Try a different search.')\n clearLabel = input<string>('Clear search')\n resultsAnnouncement = input<(count: number) => string>(\n (count) => `${count} result${count !== 1 ? 's' : ''}`,\n )\n navigateHint = input<string>('Navigate')\n selectHint = input<string>('Select')\n closeHint = input<string>('Close')\n collapsible = input<SearchBarCollapsible, boolean | string | null | undefined>(false, {\n transform: collapsibleAttribute,\n })\n expanded = model(false)\n openLabel = input<string>('Search')\n closeLabel = input<string>('Close search')\n\n queryChange = output<string>()\n itemSelected = output<T>()\n clear = output<void>()\n\n protected readonly isFocused = signal(false)\n protected readonly showResults = signal(false)\n protected readonly searchQuery = signal('')\n protected readonly activeIndex = signal(0)\n\n protected readonly searchInput = viewChild<ElementRef<HTMLInputElement>>('searchInput')\n private readonly toggleButton = viewChild<ElementRef<HTMLButtonElement>>('toggle')\n\n protected readonly collapsibleMode = computed(() => {\n const mode = this.collapsible()\n return mode === 'narrow' ? 'narrow' : mode ? 'always' : null\n })\n\n protected readonly folded = computed(() => this.collapsibleMode() !== null && !this.expanded())\n\n protected readonly triggerId = computed(() => `${this.id()}-trigger`)\n\n private readonly hasGroupedResultsInput = computed(() => !!this.groupedResults())\n\n protected readonly allVisibleItems = computed<T[]>(() => {\n if (this.groupedResults()) {\n return this.groupedResults()!.flatMap((category) => category.items)\n }\n return this.results() ?? []\n })\n\n protected readonly showOverlay = computed(() => this.showResults())\n\n protected readonly panelId = computed(() => `${this.id()}-panel`)\n\n protected itemDomId(index: number): string {\n return `${this.id()}-item-${index}`\n }\n\n protected readonly indexedGroupedResults = computed(() => {\n const grouped = this.groupedResults()\n if (!grouped) return null\n const format = this.displayFn()\n let index = 0\n return grouped.map((category) => ({\n ...category,\n indexedItems: category.items.map((item) => ({\n item,\n index: index++,\n formatted: format(item),\n })),\n }))\n })\n\n protected readonly indexedResults = computed(() => {\n const format = this.displayFn()\n return (this.results() ?? []).map((item, index) => ({ item, index, formatted: format(item) }))\n })\n\n protected readonly activeItemDomId = computed(() => {\n if (!this.showOverlay()) return null\n const idx = this.activeIndex()\n\n return idx >= 0 && idx < this.allVisibleItems().length ? this.itemDomId(idx) : null\n })\n\n protected readonly resultCount = computed(() =>\n this.showOverlay() ? this.allVisibleItems().length : 0,\n )\n\n protected readonly hasGroupedResults = computed(\n () => this.hasGroupedResultsInput() && !!this.groupedResults()?.some((c) => c.items.length > 0),\n )\n\n protected readonly hasNoResults = computed(() => this.allVisibleItems().length === 0)\n\n protected onNavigationKeydown(event: KeyboardEvent): void {\n if (\n event.key === 'Escape' &&\n this.collapsibleMode() !== null &&\n this.expanded() &&\n !this.showOverlay()\n ) {\n event.preventDefault()\n this.fold(true)\n return\n }\n\n if (!this.isFocused() || !this.showOverlay()) return\n\n if (event.key === 'Escape') {\n event.preventDefault()\n this.blurSearch()\n return\n }\n\n const items = this.allVisibleItems()\n if (items.length === 0) return\n\n switch (event.key) {\n case 'ArrowDown':\n event.preventDefault()\n this.activeIndex.update((i) => Math.min(i + 1, items.length - 1))\n break\n case 'ArrowUp':\n event.preventDefault()\n this.activeIndex.update((i) => Math.max(i - 1, 0))\n break\n case 'Enter': {\n const active = items[this.activeIndex()]\n if (!active) break\n event.preventDefault()\n this.onSelect(active)\n break\n }\n }\n }\n\n protected handleClickOutside(event: MouseEvent): void {\n if (!this.elementRef.nativeElement.contains(event.target)) {\n this.showResults.set(false)\n }\n }\n\n focusSearch(): void {\n this.searchInput()?.nativeElement.focus()\n }\n\n protected blurSearch(): void {\n this.searchInput()?.nativeElement.blur()\n this.showResults.set(false)\n }\n\n protected onFocus(): void {\n this.isFocused.set(true)\n if (this.searchQuery().length > 0) this.showResults.set(true)\n }\n\n protected expand(): void {\n this.expanded.set(true)\n afterNextRender(() => this.focusSearch(), { injector: this.injector })\n }\n\n private fold(returnFocus: boolean): void {\n this.expanded.set(false)\n if (returnFocus) {\n afterNextRender(() => this.toggleButton()?.nativeElement.focus(), { injector: this.injector })\n }\n }\n\n protected close(event: Event): void {\n event.stopPropagation()\n this.showResults.set(false)\n this.fold(true)\n }\n\n protected onBlur(event?: FocusEvent): void {\n this.isFocused.set(false)\n if (\n this.collapsibleMode() !== null &&\n this.expanded() &&\n this.searchQuery().length === 0 &&\n !this.elementRef.nativeElement.contains(event?.relatedTarget)\n ) {\n this.fold(false)\n }\n setTimeout(() => {\n if (!this.elementRef.nativeElement.contains(document.activeElement)) {\n this.showResults.set(false)\n }\n }, 200)\n }\n\n protected onInput(event: Event): void {\n const value = (event.target as HTMLInputElement).value\n this.searchQuery.set(value)\n this.activeIndex.set(0)\n this.showResults.set(value.length > 0)\n\n this.queryChange.emit(value)\n }\n\n protected onClear(): void {\n this.searchQuery.set('')\n this.activeIndex.set(0)\n this.showResults.set(false)\n this.clear.emit()\n this.focusSearch()\n }\n\n protected onSelect(item: T): void {\n this.itemSelected.emit(item)\n this.showResults.set(false)\n this.searchQuery.set(this.keepQueryOnSelect() ? this.displayFn()(item) : '')\n if (this.collapsibleMode() !== null && !this.keepQueryOnSelect()) this.fold(false)\n }\n}\n","@if (collapsibleMode()) {\n @if (folded()) {\n <button\n #toggle\n type=\"button\"\n class=\"gbt-sb-toggle\"\n aria-expanded=\"false\"\n [attr.aria-controls]=\"triggerId()\"\n [attr.aria-label]=\"openLabel()\"\n (click)=\"expand()\"\n >\n <gbt-icon name=\"search\" aria-hidden=\"true\" />\n </button>\n }\n}\n<!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events, @angular-eslint/template/interactive-supports-focus -->\n<div\n class=\"gbt-sb-trigger\"\n [attr.id]=\"collapsibleMode() ? triggerId() : null\"\n [attr.hidden]=\"folded() && collapsibleMode() === 'always' ? '' : null\"\n [class.gbt-sb-trigger--folded]=\"folded()\"\n [class.gbt-sb-trigger--open]=\"isFocused()\"\n (click)=\"focusSearch()\"\n>\n @if (collapsibleMode() && expanded()) {\n <button\n type=\"button\"\n class=\"gbt-sb-trigger__close\"\n [attr.aria-label]=\"closeLabel()\"\n (click)=\"close($event)\"\n >\n <gbt-icon name=\"arrow-left\" aria-hidden=\"true\" />\n </button>\n }\n <gbt-icon name=\"search\" class=\"gbt-sb-trigger__icon\" aria-hidden=\"true\" />\n <input\n #searchInput\n type=\"text\"\n role=\"combobox\"\n class=\"gbt-sb-trigger__input\"\n [placeholder]=\"placeholder()\"\n [attr.aria-label]=\"ariaLabel() || placeholder()\"\n [value]=\"searchQuery()\"\n [attr.aria-expanded]=\"showOverlay()\"\n aria-autocomplete=\"list\"\n aria-haspopup=\"listbox\"\n [attr.aria-controls]=\"showOverlay() ? panelId() : null\"\n [attr.aria-activedescendant]=\"activeItemDomId()\"\n (focus)=\"onFocus()\"\n (blur)=\"onBlur($event)\"\n (input)=\"onInput($event)\"\n autocomplete=\"off\"\n spellcheck=\"false\"\n />\n @if (searchQuery().length > 0) {\n <button\n type=\"button\"\n class=\"gbt-sb-trigger__clear\"\n (click)=\"onClear()\"\n [attr.aria-label]=\"clearLabel()\"\n >\n <gbt-icon name=\"x\" aria-hidden=\"true\" />\n </button>\n }\n</div>\n@if (showOverlay()) {\n <div role=\"status\" aria-live=\"polite\" aria-atomic=\"true\" class=\"sr-only\">\n {{ resultsAnnouncement()(resultCount()) }}\n </div>\n}\n@if (showOverlay()) {\n <div class=\"gbt-sb-backdrop\" (click)=\"blurSearch()\" aria-hidden=\"true\"></div>\n <ng-template #footer>\n <div class=\"gbt-sb-footer\" aria-hidden=\"true\">\n <span class=\"gbt-sb-footer__hint\">\n <kbd class=\"gbt-sb-kbd gbt-sb-kbd--sm\">↑</kbd>\n <kbd class=\"gbt-sb-kbd gbt-sb-kbd--sm\">↓</kbd>\n {{ navigateHint() }}\n </span>\n <span class=\"gbt-sb-footer__hint\">\n <kbd class=\"gbt-sb-kbd gbt-sb-kbd--sm\">↵</kbd>\n {{ selectHint() }}\n </span>\n <span class=\"gbt-sb-footer__hint\">\n <kbd class=\"gbt-sb-kbd gbt-sb-kbd--sm\">Esc</kbd>\n {{ closeHint() }}\n </span>\n </div>\n </ng-template>\n @if (hasNoResults()) {\n <div [id]=\"panelId()\" class=\"gbt-sb-panel\">\n <div class=\"gbt-sb-state\" role=\"status\">\n <gbt-icon name=\"search\" class=\"gbt-sb-state__icon\" aria-hidden=\"true\" />\n <span>{{ noResultsMessage() }}</span>\n <p class=\"gbt-sb-state__hint\">{{ noResultsHint() }}</p>\n </div>\n <ng-container [ngTemplateOutlet]=\"footer\"></ng-container>\n </div>\n } @else {\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events, @angular-eslint/template/interactive-supports-focus -->\n <div\n [id]=\"panelId()\"\n class=\"gbt-sb-panel\"\n role=\"listbox\"\n (mousedown)=\"$event.preventDefault()\"\n (click)=\"$event.stopPropagation()\"\n >\n @if (hasGroupedResults()) {\n <div class=\"gbt-sb-list\">\n @for (category of indexedGroupedResults(); track category.label) {\n @if (category.items.length > 0) {\n <div class=\"gbt-sb-group-label\">\n @if (category.icon) {\n <gbt-icon [name]=\"category.icon\" aria-hidden=\"true\" />\n }\n {{ category.label }}\n <span class=\"gbt-sb-group-count\" aria-hidden=\"true\">{{\n category.items.length\n }}</span>\n </div>\n @for (entry of category.indexedItems; track entry.index) {\n <button\n type=\"button\"\n role=\"option\"\n tabindex=\"-1\"\n [id]=\"itemDomId(entry.index)\"\n class=\"gbt-sb-item\"\n [attr.aria-selected]=\"entry.index === activeIndex()\"\n [class.gbt-sb-item--active]=\"entry.index === activeIndex()\"\n (click)=\"onSelect(entry.item)\"\n (mouseenter)=\"activeIndex.set(entry.index)\"\n >\n @if (itemTemplate()) {\n <ng-container\n [ngTemplateOutlet]=\"itemTemplate()!\"\n [ngTemplateOutletContext]=\"{ $implicit: entry.item }\"\n ></ng-container>\n } @else {\n @if (category.icon) {\n <gbt-icon\n [name]=\"category.icon\"\n class=\"gbt-sb-item__icon\"\n aria-hidden=\"true\"\n />\n }\n <span class=\"gbt-sb-item__label\">{{ entry.formatted }}</span>\n }\n </button>\n }\n }\n }\n </div>\n } @else if (results() && results()!.length > 0) {\n <div class=\"gbt-sb-list\">\n @for (entry of indexedResults(); track entry.index) {\n <button\n type=\"button\"\n role=\"option\"\n tabindex=\"-1\"\n [id]=\"itemDomId(entry.index)\"\n class=\"gbt-sb-item\"\n [attr.aria-selected]=\"entry.index === activeIndex()\"\n [class.gbt-sb-item--active]=\"entry.index === activeIndex()\"\n (click)=\"onSelect(entry.item)\"\n (mouseenter)=\"activeIndex.set(entry.index)\"\n >\n @if (itemTemplate()) {\n <ng-container\n [ngTemplateOutlet]=\"itemTemplate()!\"\n [ngTemplateOutletContext]=\"{ $implicit: entry.item }\"\n ></ng-container>\n } @else {\n <span class=\"gbt-sb-item__label\">{{ entry.formatted }}</span>\n }\n </button>\n }\n </div>\n }\n\n <ng-container [ngTemplateOutlet]=\"footer\"></ng-container>\n </div>\n }\n}\n"],"mappings":";;;;AAyBA,IAAI,kBAAkB;AAItB,SAAS,qBAAqB,OAA0C;CACtE,OAAO,UAAU,WAAW,WAAW,iBAAiB,KAAK;AAC/D;AAgBA,IAAa,YAAb,MAAa,UAAS;CACH,aAAa,OAAO,UAAU;CAC9B,WAAW,OAAO,QAAQ;CAE3C,KAAK,MAAc,kBAAkB,EAAE,mBAAkB,GAAA,YAAA,CAAA,EAAA,WAAA,KAAA,CAAA,+BAAA,CAAA,CAAA;CACzD,UAAU,MAAkB,MAAK,GAAA,YAAA,CAAA,EAAA,WAAA,UAAA,CAAA,+BAAA,CAAA,CAAA;CACjC,iBAAiB,MAAwC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it-search-bar.mjs","names":[],"sources":["../../../projects/gabarit/search-bar/search-bar.ts","../../../projects/gabarit/search-bar/search-bar.html"],"sourcesContent":["import {\n afterNextRender,\n booleanAttribute,\n ChangeDetectionStrategy,\n Component,\n computed,\n ElementRef,\n inject,\n Injector,\n input,\n model,\n output,\n signal,\n TemplateRef,\n viewChild,\n} from '@angular/core'\nimport { NgTemplateOutlet } from '@angular/common'\nimport { Icon } from '@masmarino/gabarit/icon'\n\nexport interface SearchResultCategory<T = unknown> {\n label: string\n icon?: string\n items: T[]\n}\n\nlet nextSearchBarId = 0\n\nexport type SearchBarCollapsible = boolean | 'narrow'\n\nfunction collapsibleAttribute(value: boolean | string | null | undefined): SearchBarCollapsible {\n return value === 'narrow' ? 'narrow' : booleanAttribute(value)\n}\n\n@Component({\n selector: 'gbt-search-bar',\n standalone: true,\n imports: [Icon, NgTemplateOutlet],\n templateUrl: './search-bar.html',\n styleUrl: './search-bar.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n '(keydown)': 'onNavigationKeydown($event)',\n '(document:click)': 'handleClickOutside($event)',\n '[attr.data-collapsible]': 'collapsibleMode()',\n '[attr.data-expanded]': 'collapsibleMode() && expanded() ? \"\" : null',\n },\n})\nexport class SearchBar<T = unknown> {\n private readonly elementRef = inject(ElementRef)\n private readonly injector = inject(Injector)\n\n id = input<string>(`gbt-search-bar-${++nextSearchBarId}`)\n results = input<T[] | null>(null)\n groupedResults = input<SearchResultCategory<T>[] | null>(null)\n placeholder = input<string>('Search…')\n ariaLabel = input<string>('')\n displayFn = input<(item: T) => string>((item) => String(item))\n itemTemplate = input<TemplateRef<unknown>>()\n keepQueryOnSelect = input(false)\n noResultsMessage = input<string>('No results')\n noResultsHint = input<string>('Try a different search.')\n clearLabel = input<string>('Clear search')\n resultsAnnouncement = input<(count: number) => string>(\n (count) => `${count} result${count !== 1 ? 's' : ''}`,\n )\n navigateHint = input<string>('Navigate')\n selectHint = input<string>('Select')\n closeHint = input<string>('Close')\n collapsible = input<SearchBarCollapsible, boolean | string | null | undefined>(false, {\n transform: collapsibleAttribute,\n })\n expanded = model(false)\n openLabel = input<string>('Search')\n closeLabel = input<string>('Close search')\n\n queryChange = output<string>()\n itemSelected = output<T>()\n clear = output<void>()\n\n protected readonly isFocused = signal(false)\n protected readonly showResults = signal(false)\n protected readonly searchQuery = signal('')\n protected readonly activeIndex = signal(0)\n\n protected readonly searchInput = viewChild<ElementRef<HTMLInputElement>>('searchInput')\n private readonly toggleButton = viewChild<ElementRef<HTMLButtonElement>>('toggle')\n\n protected readonly collapsibleMode = computed(() => {\n const mode = this.collapsible()\n return mode === 'narrow' ? 'narrow' : mode ? 'always' : null\n })\n\n protected readonly folded = computed(() => this.collapsibleMode() !== null && !this.expanded())\n\n protected readonly triggerId = computed(() => `${this.id()}-trigger`)\n\n private readonly hasGroupedResultsInput = computed(() => !!this.groupedResults())\n\n protected readonly allVisibleItems = computed<T[]>(() => {\n if (this.groupedResults()) {\n return this.groupedResults()!.flatMap((category) => category.items)\n }\n return this.results() ?? []\n })\n\n protected readonly showOverlay = computed(() => this.showResults())\n\n protected readonly panelId = computed(() => `${this.id()}-panel`)\n\n protected itemDomId(index: number): string {\n return `${this.id()}-item-${index}`\n }\n\n protected readonly indexedGroupedResults = computed(() => {\n const grouped = this.groupedResults()\n if (!grouped) return null\n const format = this.displayFn()\n let index = 0\n return grouped.map((category) => ({\n ...category,\n indexedItems: category.items.map((item) => ({\n item,\n index: index++,\n formatted: format(item),\n })),\n }))\n })\n\n protected readonly indexedResults = computed(() => {\n const format = this.displayFn()\n return (this.results() ?? []).map((item, index) => ({ item, index, formatted: format(item) }))\n })\n\n protected readonly activeItemDomId = computed(() => {\n if (!this.showOverlay()) return null\n const idx = this.activeIndex()\n\n return idx >= 0 && idx < this.allVisibleItems().length ? this.itemDomId(idx) : null\n })\n\n protected readonly resultCount = computed(() =>\n this.showOverlay() ? this.allVisibleItems().length : 0,\n )\n\n protected readonly hasGroupedResults = computed(\n () => this.hasGroupedResultsInput() && !!this.groupedResults()?.some((c) => c.items.length > 0),\n )\n\n protected readonly hasNoResults = computed(() => this.allVisibleItems().length === 0)\n\n protected onNavigationKeydown(event: KeyboardEvent): void {\n if (\n event.key === 'Escape' &&\n this.collapsibleMode() !== null &&\n this.expanded() &&\n !this.showOverlay()\n ) {\n event.preventDefault()\n this.fold(true)\n return\n }\n\n if (!this.isFocused() || !this.showOverlay()) return\n\n if (event.key === 'Escape') {\n event.preventDefault()\n this.blurSearch()\n return\n }\n\n const items = this.allVisibleItems()\n if (items.length === 0) return\n\n switch (event.key) {\n case 'ArrowDown':\n event.preventDefault()\n this.activeIndex.update((i) => Math.min(i + 1, items.length - 1))\n break\n case 'ArrowUp':\n event.preventDefault()\n this.activeIndex.update((i) => Math.max(i - 1, 0))\n break\n case 'Enter': {\n const active = items[this.activeIndex()]\n if (!active) break\n event.preventDefault()\n this.onSelect(active)\n break\n }\n }\n }\n\n protected handleClickOutside(event: MouseEvent): void {\n if (!this.elementRef.nativeElement.contains(event.target)) {\n this.showResults.set(false)\n }\n }\n\n focusSearch(): void {\n this.searchInput()?.nativeElement.focus()\n }\n\n protected blurSearch(): void {\n this.searchInput()?.nativeElement.blur()\n this.showResults.set(false)\n }\n\n protected onFocus(): void {\n this.isFocused.set(true)\n if (this.searchQuery().length > 0) this.showResults.set(true)\n }\n\n protected expand(): void {\n this.expanded.set(true)\n afterNextRender(() => this.focusSearch(), { injector: this.injector })\n }\n\n private fold(returnFocus: boolean): void {\n this.expanded.set(false)\n if (returnFocus) {\n afterNextRender(() => this.toggleButton()?.nativeElement.focus(), { injector: this.injector })\n }\n }\n\n protected close(event: Event): void {\n event.stopPropagation()\n this.showResults.set(false)\n this.fold(true)\n }\n\n protected onBlur(event?: FocusEvent): void {\n this.isFocused.set(false)\n if (\n this.collapsibleMode() !== null &&\n this.expanded() &&\n this.searchQuery().length === 0 &&\n !this.elementRef.nativeElement.contains(event?.relatedTarget)\n ) {\n this.fold(false)\n }\n setTimeout(() => {\n if (!this.elementRef.nativeElement.contains(document.activeElement)) {\n this.showResults.set(false)\n }\n }, 200)\n }\n\n protected onInput(event: Event): void {\n const value = (event.target as HTMLInputElement).value\n this.searchQuery.set(value)\n this.activeIndex.set(0)\n this.showResults.set(value.length > 0)\n\n this.queryChange.emit(value)\n }\n\n protected onClear(): void {\n this.searchQuery.set('')\n this.activeIndex.set(0)\n this.showResults.set(false)\n this.clear.emit()\n this.focusSearch()\n }\n\n protected onSelect(item: T): void {\n this.itemSelected.emit(item)\n this.showResults.set(false)\n this.searchQuery.set(this.keepQueryOnSelect() ? this.displayFn()(item) : '')\n if (this.collapsibleMode() !== null && !this.keepQueryOnSelect()) this.fold(false)\n }\n}\n","@if (collapsibleMode()) {\n @if (folded()) {\n <button\n #toggle\n type=\"button\"\n class=\"gbt-sb-toggle\"\n aria-expanded=\"false\"\n [attr.aria-controls]=\"triggerId()\"\n [attr.aria-label]=\"openLabel()\"\n (click)=\"expand()\"\n >\n <gbt-icon name=\"search\" aria-hidden=\"true\" />\n </button>\n }\n}\n<!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events, @angular-eslint/template/interactive-supports-focus -->\n<div\n class=\"gbt-sb-trigger\"\n [attr.id]=\"collapsibleMode() ? triggerId() : null\"\n [attr.hidden]=\"folded() && collapsibleMode() === 'always' ? '' : null\"\n [class.gbt-sb-trigger--folded]=\"folded()\"\n [class.gbt-sb-trigger--open]=\"isFocused()\"\n (click)=\"focusSearch()\"\n>\n @if (collapsibleMode() && expanded()) {\n <button\n type=\"button\"\n class=\"gbt-sb-trigger__close\"\n [attr.aria-label]=\"closeLabel()\"\n (click)=\"close($event)\"\n >\n <gbt-icon name=\"arrow-left\" aria-hidden=\"true\" />\n </button>\n }\n <gbt-icon name=\"search\" class=\"gbt-sb-trigger__icon\" aria-hidden=\"true\" />\n <input\n #searchInput\n type=\"text\"\n role=\"combobox\"\n class=\"gbt-sb-trigger__input\"\n [placeholder]=\"placeholder()\"\n [attr.aria-label]=\"ariaLabel() || placeholder()\"\n [value]=\"searchQuery()\"\n [attr.aria-expanded]=\"showOverlay()\"\n aria-autocomplete=\"list\"\n aria-haspopup=\"listbox\"\n [attr.aria-controls]=\"showOverlay() ? panelId() : null\"\n [attr.aria-activedescendant]=\"activeItemDomId()\"\n (focus)=\"onFocus()\"\n (blur)=\"onBlur($event)\"\n (input)=\"onInput($event)\"\n autocomplete=\"off\"\n spellcheck=\"false\"\n />\n @if (searchQuery().length > 0) {\n <button\n type=\"button\"\n class=\"gbt-sb-trigger__clear\"\n (click)=\"onClear()\"\n [attr.aria-label]=\"clearLabel()\"\n >\n <gbt-icon name=\"x\" aria-hidden=\"true\" />\n </button>\n }\n</div>\n@if (showOverlay()) {\n <div role=\"status\" aria-live=\"polite\" aria-atomic=\"true\" class=\"sr-only\">\n {{ resultsAnnouncement()(resultCount()) }}\n </div>\n}\n@if (showOverlay()) {\n <div class=\"gbt-sb-backdrop\" (click)=\"blurSearch()\" aria-hidden=\"true\"></div>\n <ng-template #footer>\n <div class=\"gbt-sb-footer\" aria-hidden=\"true\">\n <span class=\"gbt-sb-footer__hint\">\n <kbd class=\"gbt-sb-kbd gbt-sb-kbd--sm\">↑</kbd>\n <kbd class=\"gbt-sb-kbd gbt-sb-kbd--sm\">↓</kbd>\n {{ navigateHint() }}\n </span>\n <span class=\"gbt-sb-footer__hint\">\n <kbd class=\"gbt-sb-kbd gbt-sb-kbd--sm\">↵</kbd>\n {{ selectHint() }}\n </span>\n <span class=\"gbt-sb-footer__hint\">\n <kbd class=\"gbt-sb-kbd gbt-sb-kbd--sm\">Esc</kbd>\n {{ closeHint() }}\n </span>\n </div>\n </ng-template>\n @if (hasNoResults()) {\n <div [id]=\"panelId()\" class=\"gbt-sb-panel\">\n <div class=\"gbt-sb-state\" role=\"status\">\n <gbt-icon name=\"search\" class=\"gbt-sb-state__icon\" aria-hidden=\"true\" />\n <span>{{ noResultsMessage() }}</span>\n <p class=\"gbt-sb-state__hint\">{{ noResultsHint() }}</p>\n </div>\n <ng-container [ngTemplateOutlet]=\"footer\"></ng-container>\n </div>\n } @else {\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events, @angular-eslint/template/interactive-supports-focus -->\n <div\n [id]=\"panelId()\"\n class=\"gbt-sb-panel\"\n role=\"listbox\"\n (mousedown)=\"$event.preventDefault()\"\n (click)=\"$event.stopPropagation()\"\n >\n @if (hasGroupedResults()) {\n <div class=\"gbt-sb-list\">\n @for (category of indexedGroupedResults(); track category.label) {\n @if (category.items.length > 0) {\n <div class=\"gbt-sb-group-label\">\n @if (category.icon) {\n <gbt-icon [name]=\"category.icon\" aria-hidden=\"true\" />\n }\n {{ category.label }}\n <span class=\"gbt-sb-group-count\" aria-hidden=\"true\">{{\n category.items.length\n }}</span>\n </div>\n @for (entry of category.indexedItems; track entry.index) {\n <button\n type=\"button\"\n role=\"option\"\n tabindex=\"-1\"\n [id]=\"itemDomId(entry.index)\"\n class=\"gbt-sb-item\"\n [attr.aria-selected]=\"entry.index === activeIndex()\"\n [class.gbt-sb-item--active]=\"entry.index === activeIndex()\"\n (click)=\"onSelect(entry.item)\"\n (mouseenter)=\"activeIndex.set(entry.index)\"\n >\n @if (itemTemplate()) {\n <ng-container\n [ngTemplateOutlet]=\"itemTemplate()!\"\n [ngTemplateOutletContext]=\"{ $implicit: entry.item }\"\n ></ng-container>\n } @else {\n @if (category.icon) {\n <gbt-icon\n [name]=\"category.icon\"\n class=\"gbt-sb-item__icon\"\n aria-hidden=\"true\"\n />\n }\n <span class=\"gbt-sb-item__label\">{{ entry.formatted }}</span>\n }\n </button>\n }\n }\n }\n </div>\n } @else if (results() && results()!.length > 0) {\n <div class=\"gbt-sb-list\">\n @for (entry of indexedResults(); track entry.index) {\n <button\n type=\"button\"\n role=\"option\"\n tabindex=\"-1\"\n [id]=\"itemDomId(entry.index)\"\n class=\"gbt-sb-item\"\n [attr.aria-selected]=\"entry.index === activeIndex()\"\n [class.gbt-sb-item--active]=\"entry.index === activeIndex()\"\n (click)=\"onSelect(entry.item)\"\n (mouseenter)=\"activeIndex.set(entry.index)\"\n >\n @if (itemTemplate()) {\n <ng-container\n [ngTemplateOutlet]=\"itemTemplate()!\"\n [ngTemplateOutletContext]=\"{ $implicit: entry.item }\"\n ></ng-container>\n } @else {\n <span class=\"gbt-sb-item__label\">{{ entry.formatted }}</span>\n }\n </button>\n }\n </div>\n }\n\n <ng-container [ngTemplateOutlet]=\"footer\"></ng-container>\n </div>\n }\n}\n"],"mappings":";;;;AAyBA,IAAI,kBAAkB;AAItB,SAAS,qBAAqB,OAA0C;CACtE,OAAO,UAAU,WAAW,WAAW,iBAAiB,KAAK;AAC/D;AAgBA,IAAa,YAAb,MAAa,UAAS;CACH,aAAa,OAAO,UAAU;CAC9B,WAAW,OAAO,QAAQ;CAE3C,KAAK,MAAc,kBAAkB,EAAE,mBAAkB,GAAA,YAAA,CAAA,EAAA,WAAA,KAAA,CAAA,+BAAA,CAAA,CAAA;CACzD,UAAU,MAAkB,MAAK,GAAA,YAAA,CAAA,EAAA,WAAA,UAAA,CAAA,+BAAA,CAAA,CAAA;CACjC,iBAAiB,MAAwC,MAAK,GAAA,YAAA,CAAA,EAAA,WAAA,iBAAA,CAAA,+BAAA,CAAA,CAAA;CAC9D,cAAc,MAAc,WAAU,GAAA,YAAA,CAAA,EAAA,WAAA,cAAA,CAAA,+BAAA,CAAA,CAAA;CACtC,YAAY,MAAc,IAAG,GAAA,YAAA,CAAA,EAAA,WAAA,YAAA,CAAA,+BAAA,CAAA,CAAA;CAC7B,YAAY,OAA4B,SAAS,OAAO,IAAI,GAAE,GAAA,YAAA,CAAA,EAAA,WAAA,YAAA,CAAA,+BAAA,CAAA,CAAA;CAC9D,eAAe,MAA6B,GAAA,YAAA,CAAA,QAAA,EAAA,WAAA,eAAA,CAAA,+BAAA,CAAA,CAAA;CAC5C,oBAAoB,MAAM,OAAM,GAAA,YAAA,CAAA,EAAA,WAAA,oBAAA,CAAA,+BAAA,CAAA,CAAA;CAChC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AA,CAAA;EAAA,WAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,YAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,aAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA,aAAA;EAAA,CAAA;EAAA,cAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA,cAAA;EAAA,CAAA;EAAA,OAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA,OAAA;EAAA,CAAA;EAAA,aAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA,eAAa,EAAA,UAAA,KAAA,CAAA;EAAA,CAAA;EAAA,cAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CACb,UAAQ,EAAA,UAAA,KAAA,CAAA;EAAA,CAAA;CAAA;AAAA,CAAA"}
|
|
@@ -42,7 +42,7 @@ var SecretReveal = class SecretReveal {
|
|
|
42
42
|
}
|
|
43
43
|
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
44
44
|
minVersion: "12.0.0",
|
|
45
|
-
version: "22.2.
|
|
45
|
+
version: "22.2.4",
|
|
46
46
|
ngImport: i0,
|
|
47
47
|
type: SecretReveal,
|
|
48
48
|
deps: [],
|
|
@@ -50,7 +50,7 @@ var SecretReveal = class SecretReveal {
|
|
|
50
50
|
});
|
|
51
51
|
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
52
52
|
minVersion: "17.0.0",
|
|
53
|
-
version: "22.2.
|
|
53
|
+
version: "22.2.4",
|
|
54
54
|
type: SecretReveal,
|
|
55
55
|
isStandalone: true,
|
|
56
56
|
selector: "gbt-secret-reveal",
|
|
@@ -209,7 +209,7 @@ var SecretReveal = class SecretReveal {
|
|
|
209
209
|
};
|
|
210
210
|
i0.ɵɵngDeclareClassMetadata({
|
|
211
211
|
minVersion: "12.0.0",
|
|
212
|
-
version: "22.2.
|
|
212
|
+
version: "22.2.4",
|
|
213
213
|
ngImport: i0,
|
|
214
214
|
type: SecretReveal,
|
|
215
215
|
decorators: [{
|
|
@@ -70,7 +70,7 @@ var SegmentedControl = class SegmentedControl {
|
|
|
70
70
|
}
|
|
71
71
|
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
72
72
|
minVersion: "12.0.0",
|
|
73
|
-
version: "22.2.
|
|
73
|
+
version: "22.2.4",
|
|
74
74
|
ngImport: i0,
|
|
75
75
|
type: SegmentedControl,
|
|
76
76
|
deps: [],
|
|
@@ -78,7 +78,7 @@ var SegmentedControl = class SegmentedControl {
|
|
|
78
78
|
});
|
|
79
79
|
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
80
80
|
minVersion: "17.0.0",
|
|
81
|
-
version: "22.2.
|
|
81
|
+
version: "22.2.4",
|
|
82
82
|
type: SegmentedControl,
|
|
83
83
|
isStandalone: true,
|
|
84
84
|
selector: "gbt-segmented-control",
|
|
@@ -161,13 +161,13 @@ var SegmentedControl = class SegmentedControl {
|
|
|
161
161
|
}],
|
|
162
162
|
ngImport: i0,
|
|
163
163
|
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 role=\"radiogroup\"\n [attr.aria-label]=\"label() ? null : ariaLabel() || null\"\n [attr.aria-labelledby]=\"label() ? labelId : null\"\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",
|
|
164
|
-
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{display:inline-flex;gap:2px;padding:2px;background:var(--bg-panel);border-radius:var(--site-border-radius-sm)}.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;border-radius:calc(var(--site-border-radius-sm) - 2px);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){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(--bg-principal);color:var(--text-primary);box-shadow:var(--
|
|
164
|
+
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{display:inline-flex;gap:2px;padding:2px;background:var(--bg-panel);border-radius:var(--site-border-radius-sm);box-shadow:var(--gbt-depth-hollow)}.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;border-radius:calc(var(--site-border-radius-sm) - 2px);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(--bg-principal);color:var(--text-primary);background-image:var(--gbt-sheen);box-shadow:var(--gbt-depth-raised)}.gbt-segmented-control__option--selected:hover:not(:disabled){background-image:var(--gbt-sheen-hover);box-shadow:var(--gbt-depth-raised-hover)}.gbt-segmented-control__option--selected:active:not(:disabled){background-image:var(--gbt-sunk);box-shadow:none}@media(prefers-reduced-motion:no-preference){.gbt-segmented-control__option--selected:active:not(:disabled){transform:translateY(.5px)}}.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"],
|
|
165
165
|
changeDetection: i0.ChangeDetectionStrategy.OnPush
|
|
166
166
|
});
|
|
167
167
|
};
|
|
168
168
|
i0.ɵɵngDeclareClassMetadata({
|
|
169
169
|
minVersion: "12.0.0",
|
|
170
|
-
version: "22.2.
|
|
170
|
+
version: "22.2.4",
|
|
171
171
|
ngImport: i0,
|
|
172
172
|
type: SegmentedControl,
|
|
173
173
|
decorators: [{
|
|
@@ -182,7 +182,7 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
182
182
|
"[class.gbt-segmented-control-host--labelled]": "!!label()"
|
|
183
183
|
},
|
|
184
184
|
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 role=\"radiogroup\"\n [attr.aria-label]=\"label() ? null : ariaLabel() || null\"\n [attr.aria-labelledby]=\"label() ? labelId : null\"\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",
|
|
185
|
-
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{display:inline-flex;gap:2px;padding:2px;background:var(--bg-panel);border-radius:var(--site-border-radius-sm)}.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;border-radius:calc(var(--site-border-radius-sm) - 2px);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){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(--bg-principal);color:var(--text-primary);box-shadow:var(--
|
|
185
|
+
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{display:inline-flex;gap:2px;padding:2px;background:var(--bg-panel);border-radius:var(--site-border-radius-sm);box-shadow:var(--gbt-depth-hollow)}.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;border-radius:calc(var(--site-border-radius-sm) - 2px);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(--bg-principal);color:var(--text-primary);background-image:var(--gbt-sheen);box-shadow:var(--gbt-depth-raised)}.gbt-segmented-control__option--selected:hover:not(:disabled){background-image:var(--gbt-sheen-hover);box-shadow:var(--gbt-depth-raised-hover)}.gbt-segmented-control__option--selected:active:not(:disabled){background-image:var(--gbt-sunk);box-shadow:none}@media(prefers-reduced-motion:no-preference){.gbt-segmented-control__option--selected:active:not(:disabled){transform:translateY(.5px)}}.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"]
|
|
186
186
|
}]
|
|
187
187
|
}],
|
|
188
188
|
propDecorators: {
|
|
@@ -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 ElementRef,\n booleanAttribute,\n input,\n model,\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@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 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 role=\"radiogroup\"\n [attr.aria-label]=\"label() ? null : ariaLabel() || null\"\n [attr.aria-labelledby]=\"label() ? labelId : null\"\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.dis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IAAA,YAAA;IAAA,UAAA;IAAA,YAAA;IAAA,mBAAA;GAAA;GAAA,WAAA;IAAA,mBAAA;IAAA,YAAA;IAAA,UAAA;IAAA,YAAA;IAAA,mBAAA;GAAA;GAAA,UAAA;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,WAAA;IAAA,mBAAA;IAAA,YAAA;IAAA,UAAA;IAAA,YAAA;IAAA,mBAAA;GAAA;GAAA,MAAA;IAAA,mBAAA;IAAA,YAAA;IAAA,UAAA;IAAA,YAAA;IAAA,mBAAA;GAAA;GAAA,MAAA;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,SAAA,EAAA,OAAA,cAAA;EAAA,MAAA,EAAA,YAAA;GAAA,0CAAA;GAAA,8CAAA;EAAA,EAAA;EAAA,aAAA,CAAA;GAAA,cAAA;GAAA,OAAA;GAAA,WAAA,CAAA,OAAA;GAAA,aAAA;GAAA,UAAA;EAAA,CAAA;EAAA,UAAA;EAAA,UChC7B;EA6BA,QAAA,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 ElementRef,\n booleanAttribute,\n input,\n model,\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@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 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 role=\"radiogroup\"\n [attr.aria-label]=\"label() ? null : ariaLabel() || null\"\n [attr.aria-labelledby]=\"label() ? labelId : null\"\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":";;AAkBA,IAAI,yBAAyB;AAc7B,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;CAC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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"}
|
|
@@ -182,7 +182,7 @@ var Select = class Select {
|
|
|
182
182
|
}
|
|
183
183
|
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
184
184
|
minVersion: "12.0.0",
|
|
185
|
-
version: "22.2.
|
|
185
|
+
version: "22.2.4",
|
|
186
186
|
ngImport: i0,
|
|
187
187
|
type: Select,
|
|
188
188
|
deps: [],
|
|
@@ -190,7 +190,7 @@ var Select = class Select {
|
|
|
190
190
|
});
|
|
191
191
|
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
192
192
|
minVersion: "17.0.0",
|
|
193
|
-
version: "22.2.
|
|
193
|
+
version: "22.2.4",
|
|
194
194
|
type: Select,
|
|
195
195
|
isStandalone: true,
|
|
196
196
|
selector: "gbt-select",
|
|
@@ -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;background:var(--bg-principal);border:1px solid var(--border-color);border-radius:var(--site-border-radius-sm);color:var(--text-primary);font-size:14px;cursor:pointer;transition:border-color .15s cubic-bezier(.4,0,.2,1),box-shadow .15s cubic-bezier(.4,0,.2,1)}.gbt-select__trigger:hover:not(:disabled){border-color:var(--
|
|
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;background:var(--bg-principal);border:1px solid var(--border-color);border-radius:var(--site-border-radius-sm);color:var(--text-primary);font-size:14px;cursor:pointer;background-image:var(--gbt-sheen);box-shadow:var(--gbt-depth-raised);transition:border-color .15s cubic-bezier(.4,0,.2,1),box-shadow .15s cubic-bezier(.4,0,.2,1)}.gbt-select__trigger:hover:not(:disabled){border-color:var(--text-discret);background-image:linear-gradient(var(--bg-hover),var(--bg-hover)),var(--gbt-sheen-hover);box-shadow:var(--gbt-depth-raised-hover)}.gbt-select__trigger:active:not(:disabled){background-image:var(--gbt-sunk),linear-gradient(var(--bg-press),var(--bg-press));box-shadow:none}@media(prefers-reduced-motion:no-preference){.gbt-select__trigger:active:not(:disabled){transform:translateY(.5px)}}.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;background:var(--bg-principal);border:1px solid var(--border-color);border-radius:var(--site-border-radius-sm);box-shadow:var(--site-shadow-lg);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(--site-border-radius-sm));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"],
|
|
330
330
|
dependencies: [{
|
|
331
331
|
kind: "component",
|
|
332
332
|
type: Icon,
|
|
@@ -349,7 +349,7 @@ var Select = class Select {
|
|
|
349
349
|
};
|
|
350
350
|
i0.ɵɵngDeclareClassMetadata({
|
|
351
351
|
minVersion: "12.0.0",
|
|
352
|
-
version: "22.2.
|
|
352
|
+
version: "22.2.4",
|
|
353
353
|
ngImport: i0,
|
|
354
354
|
type: Select,
|
|
355
355
|
decorators: [{
|
|
@@ -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;background:var(--bg-principal);border:1px solid var(--border-color);border-radius:var(--site-border-radius-sm);color:var(--text-primary);font-size:14px;cursor:pointer;transition:border-color .15s cubic-bezier(.4,0,.2,1),box-shadow .15s cubic-bezier(.4,0,.2,1)}.gbt-select__trigger:hover:not(:disabled){border-color:var(--
|
|
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;background:var(--bg-principal);border:1px solid var(--border-color);border-radius:var(--site-border-radius-sm);color:var(--text-primary);font-size:14px;cursor:pointer;background-image:var(--gbt-sheen);box-shadow:var(--gbt-depth-raised);transition:border-color .15s cubic-bezier(.4,0,.2,1),box-shadow .15s cubic-bezier(.4,0,.2,1)}.gbt-select__trigger:hover:not(:disabled){border-color:var(--text-discret);background-image:linear-gradient(var(--bg-hover),var(--bg-hover)),var(--gbt-sheen-hover);box-shadow:var(--gbt-depth-raised-hover)}.gbt-select__trigger:active:not(:disabled){background-image:var(--gbt-sunk),linear-gradient(var(--bg-press),var(--bg-press));box-shadow:none}@media(prefers-reduced-motion:no-preference){.gbt-select__trigger:active:not(:disabled){transform:translateY(.5px)}}.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;background:var(--bg-principal);border:1px solid var(--border-color);border-radius:var(--site-border-radius-sm);box-shadow:var(--site-shadow-lg);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(--site-border-radius-sm));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"]
|
|
376
376
|
}]
|
|
377
377
|
}],
|
|
378
378
|
ctorParameters: () => [],
|