@filip.mazev/blocks 1.4.10 → 1.4.12
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/README.md +15 -3
- package/core/styles/_choice-finish.scss +49 -0
- package/core/styles/_helpers.scss +1 -0
- package/core/styles/_index.scss +7 -0
- package/core/styles/_overlay.scss +4 -0
- package/core/styles/_palettes.scss +42 -0
- package/core/styles/_slider.scss +5 -5
- package/core/styles/_theme-engine.scss +156 -144
- package/core/styles/themes/_azure-coral-theme.scss +4 -0
- package/core/styles/themes/_blue-theme.scss +4 -3
- package/core/styles/themes/_cyberpunk-theme.scss +3 -2
- package/core/styles/themes/_graphite-sky-blue-theme.scss +19 -0
- package/core/styles/themes/_green-theme.scss +4 -3
- package/core/styles/themes/_high-contrast-theme.scss +25 -6
- package/core/styles/themes/_lime-violet-theme.scss +4 -0
- package/core/styles/themes/_orange-theme.scss +4 -3
- package/core/styles/themes/_purple-theme.scss +4 -3
- package/core/styles/themes/_red-theme.scss +4 -3
- package/core/styles/themes/_scarlet-cyan-theme.scss +4 -0
- package/core/styles/themes/_tangerine-indigo-theme.scss +4 -0
- package/core/styles/themes/_violet-teal-theme.scss +4 -0
- package/core/styles/themes/_white-theme.scss +4 -27
- package/effects/effects.css +4 -0
- package/effects/runtime/README.md +1 -1
- package/fesm2022/filip.mazev-blocks-core.mjs +139 -35
- package/fesm2022/filip.mazev-blocks-core.mjs.map +1 -1
- package/fesm2022/filip.mazev-blocks-effects-runtime.mjs +24 -27
- package/fesm2022/filip.mazev-blocks-effects-runtime.mjs.map +1 -1
- package/fesm2022/filip.mazev-blocks-forms.mjs +27 -61
- package/fesm2022/filip.mazev-blocks-forms.mjs.map +1 -1
- package/fesm2022/filip.mazev-blocks-primitives.mjs +496 -41
- package/fesm2022/filip.mazev-blocks-primitives.mjs.map +1 -1
- package/fesm2022/filip.mazev-blocks.mjs +1 -1
- package/fesm2022/filip.mazev-blocks.mjs.map +1 -1
- package/package.json +1 -1
- package/schematics/ng-add/index.d.ts +10 -1
- package/schematics/ng-add/index.js +15 -4
- package/schematics/ng-add/schema.json +23 -17
- package/types/filip.mazev-blocks-core.d.ts +20 -7
- package/types/filip.mazev-blocks-forms.d.ts +2 -3
- package/types/filip.mazev-blocks-primitives.d.ts +118 -4
- package/types/filip.mazev-blocks.d.ts +1 -1
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { BxSurfaceDirective } from "@filip.mazev/blocks/effects";
|
|
2
2
|
import * as i0 from "@angular/core";
|
|
3
|
-
import { ChangeDetectionStrategy, Component, DestroyRef, Directive, ElementRef, HostListener, InjectionToken, NgZone, PLATFORM_ID, ViewContainerRef, booleanAttribute, computed, effect, forwardRef, inject, input, output, signal } from "@angular/core";
|
|
4
|
-
import { BX_I18N, BxA11yService, BxOverlayPositionService, BxShortcutService, inheritOverlayTheme, isTextWithKey, uuidv4 } from "@filip.mazev/blocks/core";
|
|
3
|
+
import { ChangeDetectionStrategy, Component, DestroyRef, Directive, ElementRef, HostListener, InjectionToken, NgZone, PLATFORM_ID, TemplateRef, ViewContainerRef, afterNextRender, afterRenderEffect, booleanAttribute, computed, contentChild, contentChildren, effect, forwardRef, inject, input, model, output, signal, viewChild, viewChildren } from "@angular/core";
|
|
4
|
+
import { BX_I18N, BxA11yService, BxOverlayPositionService, BxShortcutService, inheritOverlayTheme, isTextWithKey, resolveTokenToCssVar, trackOverlayOrigin, uuidv4 } from "@filip.mazev/blocks/core";
|
|
5
5
|
import { Icon } from "@filip.mazev/blocks/icons";
|
|
6
|
+
import { NgTemplateOutlet, isPlatformBrowser } from "@angular/common";
|
|
6
7
|
import { AriaDescriber, FocusMonitor } from "@angular/cdk/a11y";
|
|
7
8
|
import { Overlay } from "@angular/cdk/overlay";
|
|
8
9
|
import { ComponentPortal, TemplatePortal } from "@angular/cdk/portal";
|
|
9
10
|
import { createGlassTransition, inheritGlassLighting } from "@filip.mazev/blocks/effects/runtime";
|
|
10
11
|
import { Subscription } from "rxjs";
|
|
11
|
-
import { isPlatformBrowser } from "@angular/common";
|
|
12
12
|
var Tooltip = class Tooltip {
|
|
13
13
|
i18n = inject(BX_I18N, { optional: true });
|
|
14
14
|
a11y = inject(BxA11yService);
|
|
@@ -44,7 +44,7 @@ var Tooltip = class Tooltip {
|
|
|
44
44
|
} },
|
|
45
45
|
ngImport: i0,
|
|
46
46
|
template: "<div class=\"bx-tooltip-surface\" bxSurface [class.bx-tooltip-animated]=\"isAnimated()\">\n @if (resolvedText()) {\n {{ resolvedText() }}\n }\n</div>",
|
|
47
|
-
styles: [":host{display:block;pointer-events:none;z-index:600}.bx-tooltip-surface[data-bx-surface]{position:relative;padding:.25rem .5rem;border:1px solid var(--bx-glass-edge);border-radius:var(--bx-glass-radius, var(--bx-rounded-sm, .25rem));font-size:.75rem;font-family:inherit;max-width:min(22rem,100vw - 1.5rem);white-space:normal;overflow-wrap:anywhere;--bx-glass-unified-lighting: 1;--bx-glass-surface: var(--bx-bg-neutral);--bx-glass-edge: var(--bx-border-default);--bx-glass-text: var(--bx-text-primary);--bx-glass-shadow: 0 2px 4px 0 rgba(0, 0, 0, .1), 0 1px 2px -1px rgba(0, 0, 0, .1);--bx-glass-min-opacity: 1;--bx-glass-decoration-opacity: 0;--bx-glass-rim-visibility: .35;-webkit-backdrop-filter:none;backdrop-filter:none}.bx-tooltip-surface[data-bx-surface]:after{content:\"\";position:absolute;z-index:2;width:.5rem;height:.5rem;box-sizing:border-box;border-radius:0;background:var(--bx-glass-surface);border:0 solid var(--bx-tooltip-arrow-edge, var(--bx-glass-edge));transform:translate(-50%,-50%) rotate(45deg);pointer-events:none}@media(prefers-contrast:more){.bx-tooltip-surface[data-bx-surface]{--bx-glass-surface: var(--bx-bg-surface);--bx-glass-edge: currentcolor}.bx-tooltip-surface[data-bx-surface]:after{border-color:currentcolor}}:host-context(.bx-overlay-pos-bottom) .bx-tooltip-surface{--bx-tooltip-arrow-edge: var(--bx-glass-lit-edge-top, var(--bx-glass-edge))}:host-context(.bx-overlay-pos-bottom) .bx-tooltip-surface:after{top:-1px;left:clamp(.75rem,var(--bx-tooltip-arrow-x, 50%),100% - .75rem);border-top-width:1px;border-left-width:1px}:host-context(.bx-overlay-pos-top) .bx-tooltip-surface{--bx-tooltip-arrow-edge: var(--bx-glass-lit-edge-bottom, var(--bx-glass-edge))}:host-context(.bx-overlay-pos-top) .bx-tooltip-surface:after{top:calc(100% + 1px);left:clamp(.75rem,var(--bx-tooltip-arrow-x, 50%),100% - .75rem);border-right-width:1px;border-bottom-width:1px}:host-context(.bx-overlay-pos-left) .bx-tooltip-surface{--bx-tooltip-arrow-edge: var(--bx-glass-lit-edge-right, var(--bx-glass-edge))}:host-context(.bx-overlay-pos-left) .bx-tooltip-surface:after{left:calc(100% + 1px);top:clamp(.5rem,var(--bx-tooltip-arrow-y, 50%),100% - .5rem);border-top-width:1px;border-right-width:1px}:host-context(.bx-overlay-pos-right) .bx-tooltip-surface{--bx-tooltip-arrow-edge: var(--bx-glass-lit-edge-left, var(--bx-glass-edge))}:host-context(.bx-overlay-pos-right) .bx-tooltip-surface:after{left:-1px;top:clamp(.5rem,var(--bx-tooltip-arrow-y, 50%),100% - .5rem);border-bottom-width:1px;border-left-width:1px}@media(forced-colors:active){.bx-tooltip-surface[data-bx-surface]:after{background:Canvas;border-color:CanvasText}}\n"],
|
|
47
|
+
styles: [":host{display:block;pointer-events:none;z-index:600}.bx-tooltip-surface[data-bx-surface]{--bx-glass-radius: var(--bx-rounded-sm, .25rem);position:relative;padding:.25rem .5rem;border:1px solid var(--bx-glass-edge);border-radius:var(--bx-glass-radius, var(--bx-rounded-sm, .25rem));font-size:.75rem;font-family:inherit;max-width:min(22rem,100vw - 1.5rem);white-space:normal;overflow-wrap:anywhere;--bx-glass-unified-lighting: 1;--bx-glass-surface: var(--bx-bg-neutral);--bx-glass-edge: var(--bx-border-default);--bx-glass-text: var(--bx-text-primary);--bx-glass-shadow: 0 2px 4px 0 rgba(0, 0, 0, .1), 0 1px 2px -1px rgba(0, 0, 0, .1);--bx-glass-min-opacity: 1;--bx-glass-decoration-opacity: 0;--bx-glass-rim-visibility: .35;-webkit-backdrop-filter:none;backdrop-filter:none}.bx-tooltip-surface[data-bx-surface]:after{content:\"\";position:absolute;z-index:2;width:.5rem;height:.5rem;box-sizing:border-box;border-radius:0;background:var(--bx-glass-surface);border:0 solid var(--bx-tooltip-arrow-edge, var(--bx-glass-edge));transform:translate(-50%,-50%) rotate(45deg);pointer-events:none}@media(prefers-contrast:more){.bx-tooltip-surface[data-bx-surface]{--bx-glass-surface: var(--bx-bg-surface);--bx-glass-edge: currentcolor}.bx-tooltip-surface[data-bx-surface]:after{border-color:currentcolor}}:host-context(.bx-overlay-pos-bottom) .bx-tooltip-surface{--bx-tooltip-arrow-edge: var(--bx-glass-lit-edge-top, var(--bx-glass-edge))}:host-context(.bx-overlay-pos-bottom) .bx-tooltip-surface:after{top:-1px;left:clamp(.75rem,var(--bx-tooltip-arrow-x, 50%),100% - .75rem);border-top-width:1px;border-left-width:1px}:host-context(.bx-overlay-pos-top) .bx-tooltip-surface{--bx-tooltip-arrow-edge: var(--bx-glass-lit-edge-bottom, var(--bx-glass-edge))}:host-context(.bx-overlay-pos-top) .bx-tooltip-surface:after{top:calc(100% + 1px);left:clamp(.75rem,var(--bx-tooltip-arrow-x, 50%),100% - .75rem);border-right-width:1px;border-bottom-width:1px}:host-context(.bx-overlay-pos-left) .bx-tooltip-surface{--bx-tooltip-arrow-edge: var(--bx-glass-lit-edge-right, var(--bx-glass-edge))}:host-context(.bx-overlay-pos-left) .bx-tooltip-surface:after{left:calc(100% + 1px);top:clamp(.5rem,var(--bx-tooltip-arrow-y, 50%),100% - .5rem);border-top-width:1px;border-right-width:1px}:host-context(.bx-overlay-pos-right) .bx-tooltip-surface{--bx-tooltip-arrow-edge: var(--bx-glass-lit-edge-left, var(--bx-glass-edge))}:host-context(.bx-overlay-pos-right) .bx-tooltip-surface:after{left:-1px;top:clamp(.5rem,var(--bx-tooltip-arrow-y, 50%),100% - .5rem);border-bottom-width:1px;border-left-width:1px}@media(forced-colors:active){.bx-tooltip-surface[data-bx-surface]:after{background:Canvas;border-color:CanvasText}}\n"],
|
|
48
48
|
dependencies: [{
|
|
49
49
|
kind: "directive",
|
|
50
50
|
type: BxSurfaceDirective,
|
|
@@ -73,7 +73,7 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
73
73
|
imports: [BxSurfaceDirective],
|
|
74
74
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
75
75
|
template: "<div class=\"bx-tooltip-surface\" bxSurface [class.bx-tooltip-animated]=\"isAnimated()\">\n @if (resolvedText()) {\n {{ resolvedText() }}\n }\n</div>",
|
|
76
|
-
styles: [":host{display:block;pointer-events:none;z-index:600}.bx-tooltip-surface[data-bx-surface]{position:relative;padding:.25rem .5rem;border:1px solid var(--bx-glass-edge);border-radius:var(--bx-glass-radius, var(--bx-rounded-sm, .25rem));font-size:.75rem;font-family:inherit;max-width:min(22rem,100vw - 1.5rem);white-space:normal;overflow-wrap:anywhere;--bx-glass-unified-lighting: 1;--bx-glass-surface: var(--bx-bg-neutral);--bx-glass-edge: var(--bx-border-default);--bx-glass-text: var(--bx-text-primary);--bx-glass-shadow: 0 2px 4px 0 rgba(0, 0, 0, .1), 0 1px 2px -1px rgba(0, 0, 0, .1);--bx-glass-min-opacity: 1;--bx-glass-decoration-opacity: 0;--bx-glass-rim-visibility: .35;-webkit-backdrop-filter:none;backdrop-filter:none}.bx-tooltip-surface[data-bx-surface]:after{content:\"\";position:absolute;z-index:2;width:.5rem;height:.5rem;box-sizing:border-box;border-radius:0;background:var(--bx-glass-surface);border:0 solid var(--bx-tooltip-arrow-edge, var(--bx-glass-edge));transform:translate(-50%,-50%) rotate(45deg);pointer-events:none}@media(prefers-contrast:more){.bx-tooltip-surface[data-bx-surface]{--bx-glass-surface: var(--bx-bg-surface);--bx-glass-edge: currentcolor}.bx-tooltip-surface[data-bx-surface]:after{border-color:currentcolor}}:host-context(.bx-overlay-pos-bottom) .bx-tooltip-surface{--bx-tooltip-arrow-edge: var(--bx-glass-lit-edge-top, var(--bx-glass-edge))}:host-context(.bx-overlay-pos-bottom) .bx-tooltip-surface:after{top:-1px;left:clamp(.75rem,var(--bx-tooltip-arrow-x, 50%),100% - .75rem);border-top-width:1px;border-left-width:1px}:host-context(.bx-overlay-pos-top) .bx-tooltip-surface{--bx-tooltip-arrow-edge: var(--bx-glass-lit-edge-bottom, var(--bx-glass-edge))}:host-context(.bx-overlay-pos-top) .bx-tooltip-surface:after{top:calc(100% + 1px);left:clamp(.75rem,var(--bx-tooltip-arrow-x, 50%),100% - .75rem);border-right-width:1px;border-bottom-width:1px}:host-context(.bx-overlay-pos-left) .bx-tooltip-surface{--bx-tooltip-arrow-edge: var(--bx-glass-lit-edge-right, var(--bx-glass-edge))}:host-context(.bx-overlay-pos-left) .bx-tooltip-surface:after{left:calc(100% + 1px);top:clamp(.5rem,var(--bx-tooltip-arrow-y, 50%),100% - .5rem);border-top-width:1px;border-right-width:1px}:host-context(.bx-overlay-pos-right) .bx-tooltip-surface{--bx-tooltip-arrow-edge: var(--bx-glass-lit-edge-left, var(--bx-glass-edge))}:host-context(.bx-overlay-pos-right) .bx-tooltip-surface:after{left:-1px;top:clamp(.5rem,var(--bx-tooltip-arrow-y, 50%),100% - .5rem);border-bottom-width:1px;border-left-width:1px}@media(forced-colors:active){.bx-tooltip-surface[data-bx-surface]:after{background:Canvas;border-color:CanvasText}}\n"]
|
|
76
|
+
styles: [":host{display:block;pointer-events:none;z-index:600}.bx-tooltip-surface[data-bx-surface]{--bx-glass-radius: var(--bx-rounded-sm, .25rem);position:relative;padding:.25rem .5rem;border:1px solid var(--bx-glass-edge);border-radius:var(--bx-glass-radius, var(--bx-rounded-sm, .25rem));font-size:.75rem;font-family:inherit;max-width:min(22rem,100vw - 1.5rem);white-space:normal;overflow-wrap:anywhere;--bx-glass-unified-lighting: 1;--bx-glass-surface: var(--bx-bg-neutral);--bx-glass-edge: var(--bx-border-default);--bx-glass-text: var(--bx-text-primary);--bx-glass-shadow: 0 2px 4px 0 rgba(0, 0, 0, .1), 0 1px 2px -1px rgba(0, 0, 0, .1);--bx-glass-min-opacity: 1;--bx-glass-decoration-opacity: 0;--bx-glass-rim-visibility: .35;-webkit-backdrop-filter:none;backdrop-filter:none}.bx-tooltip-surface[data-bx-surface]:after{content:\"\";position:absolute;z-index:2;width:.5rem;height:.5rem;box-sizing:border-box;border-radius:0;background:var(--bx-glass-surface);border:0 solid var(--bx-tooltip-arrow-edge, var(--bx-glass-edge));transform:translate(-50%,-50%) rotate(45deg);pointer-events:none}@media(prefers-contrast:more){.bx-tooltip-surface[data-bx-surface]{--bx-glass-surface: var(--bx-bg-surface);--bx-glass-edge: currentcolor}.bx-tooltip-surface[data-bx-surface]:after{border-color:currentcolor}}:host-context(.bx-overlay-pos-bottom) .bx-tooltip-surface{--bx-tooltip-arrow-edge: var(--bx-glass-lit-edge-top, var(--bx-glass-edge))}:host-context(.bx-overlay-pos-bottom) .bx-tooltip-surface:after{top:-1px;left:clamp(.75rem,var(--bx-tooltip-arrow-x, 50%),100% - .75rem);border-top-width:1px;border-left-width:1px}:host-context(.bx-overlay-pos-top) .bx-tooltip-surface{--bx-tooltip-arrow-edge: var(--bx-glass-lit-edge-bottom, var(--bx-glass-edge))}:host-context(.bx-overlay-pos-top) .bx-tooltip-surface:after{top:calc(100% + 1px);left:clamp(.75rem,var(--bx-tooltip-arrow-x, 50%),100% - .75rem);border-right-width:1px;border-bottom-width:1px}:host-context(.bx-overlay-pos-left) .bx-tooltip-surface{--bx-tooltip-arrow-edge: var(--bx-glass-lit-edge-right, var(--bx-glass-edge))}:host-context(.bx-overlay-pos-left) .bx-tooltip-surface:after{left:calc(100% + 1px);top:clamp(.5rem,var(--bx-tooltip-arrow-y, 50%),100% - .5rem);border-top-width:1px;border-right-width:1px}:host-context(.bx-overlay-pos-right) .bx-tooltip-surface{--bx-tooltip-arrow-edge: var(--bx-glass-lit-edge-left, var(--bx-glass-edge))}:host-context(.bx-overlay-pos-right) .bx-tooltip-surface:after{left:-1px;top:clamp(.5rem,var(--bx-tooltip-arrow-y, 50%),100% - .5rem);border-bottom-width:1px;border-left-width:1px}@media(forced-colors:active){.bx-tooltip-surface[data-bx-surface]:after{background:Canvas;border-color:CanvasText}}\n"]
|
|
77
77
|
}]
|
|
78
78
|
}],
|
|
79
79
|
propDecorators: { text: [{
|
|
@@ -105,21 +105,8 @@ var Menu = class Menu {
|
|
|
105
105
|
isStandalone: true,
|
|
106
106
|
selector: "bx-menu",
|
|
107
107
|
ngImport: i0,
|
|
108
|
-
template: "<div
|
|
109
|
-
styles: [":host{display:block}.bx-menu-wrapper{--bx-glass-surface: var(--bx-bg-surface);--bx-glass-text: var(--bx-text-primary);--bx-glass-edge: var(--bx-border-default);--bx-glass-
|
|
110
|
-
dependencies: [{
|
|
111
|
-
kind: "directive",
|
|
112
|
-
type: BxSurfaceDirective,
|
|
113
|
-
selector: "[bxSurface]",
|
|
114
|
-
inputs: [
|
|
115
|
-
"bxSurfaceInteractive",
|
|
116
|
-
"bxSurfaceGlassiness",
|
|
117
|
-
"bxSurfaceEmission",
|
|
118
|
-
"bxSurfaceFocusEmission",
|
|
119
|
-
"bxReducedTransparency"
|
|
120
|
-
],
|
|
121
|
-
exportAs: ["bxSurface"]
|
|
122
|
-
}],
|
|
108
|
+
template: "<div data-bx-surface=\"solid\" role=\"menu\" class=\"bx-menu-wrapper\" [class.bx-menu-animated]=\"isAnimated()\">\n <ng-content></ng-content>\n</div>\n",
|
|
109
|
+
styles: [":host{display:block}.bx-menu-wrapper{--bx-glass-surface: var(--bx-bg-surface);--bx-glass-text: var(--bx-text-primary);--bx-glass-edge: var(--bx-border-default);--bx-glass-shadow: 0 2px 4px 0 rgba(0, 0, 0, .1), 0 1px 2px -1px rgba(0, 0, 0, .1);--bx-glass-radius: var(--bx-rounded-lg, .75rem);background-color:var(--bx-glass-surface);border:1px solid var(--bx-glass-edge);border-radius:var(--bx-glass-radius, var(--bx-rounded-lg, .75rem));box-shadow:0 2px 4px #0000001a,0 1px 2px -1px #0000001a;padding:.25rem;display:flex;flex-direction:column;min-width:12rem}.bx-menu-wrapper[data-bx-surface=solid]{background:var(--bx-glass-surface)!important;-webkit-backdrop-filter:none;backdrop-filter:none}.bx-menu-wrapper.bx-menu-animated{transition:transform .2s cubic-bezier(.25,.8,.25,1)}.bx-menu-wrapper{transform-origin:top}.bx-menu-wrapper.is-hidden{opacity:0;transform:scaleY(.95);pointer-events:none}:host([data-bx-surface]){border-radius:var(--bx-glass-radius, var(--bx-rounded-lg, .75rem));--bx-glass-shadow: 0 2px 4px 0 rgba(0, 0, 0, .1), 0 1px 2px -1px rgba(0, 0, 0, .1);color:var(--bx-glass-text, var(--bx-text-primary))}:host([data-bx-surface]) .bx-menu-wrapper{background:transparent;border-color:transparent;border-radius:inherit;box-shadow:none}\n"],
|
|
123
110
|
changeDetection: i0.ChangeDetectionStrategy.OnPush
|
|
124
111
|
});
|
|
125
112
|
};
|
|
@@ -132,10 +119,9 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
132
119
|
type: Component,
|
|
133
120
|
args: [{
|
|
134
121
|
selector: "bx-menu",
|
|
135
|
-
imports: [BxSurfaceDirective],
|
|
136
122
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
137
|
-
template: "<div
|
|
138
|
-
styles: [":host{display:block}.bx-menu-wrapper{--bx-glass-surface: var(--bx-bg-surface);--bx-glass-text: var(--bx-text-primary);--bx-glass-edge: var(--bx-border-default);--bx-glass-
|
|
123
|
+
template: "<div data-bx-surface=\"solid\" role=\"menu\" class=\"bx-menu-wrapper\" [class.bx-menu-animated]=\"isAnimated()\">\n <ng-content></ng-content>\n</div>\n",
|
|
124
|
+
styles: [":host{display:block}.bx-menu-wrapper{--bx-glass-surface: var(--bx-bg-surface);--bx-glass-text: var(--bx-text-primary);--bx-glass-edge: var(--bx-border-default);--bx-glass-shadow: 0 2px 4px 0 rgba(0, 0, 0, .1), 0 1px 2px -1px rgba(0, 0, 0, .1);--bx-glass-radius: var(--bx-rounded-lg, .75rem);background-color:var(--bx-glass-surface);border:1px solid var(--bx-glass-edge);border-radius:var(--bx-glass-radius, var(--bx-rounded-lg, .75rem));box-shadow:0 2px 4px #0000001a,0 1px 2px -1px #0000001a;padding:.25rem;display:flex;flex-direction:column;min-width:12rem}.bx-menu-wrapper[data-bx-surface=solid]{background:var(--bx-glass-surface)!important;-webkit-backdrop-filter:none;backdrop-filter:none}.bx-menu-wrapper.bx-menu-animated{transition:transform .2s cubic-bezier(.25,.8,.25,1)}.bx-menu-wrapper{transform-origin:top}.bx-menu-wrapper.is-hidden{opacity:0;transform:scaleY(.95);pointer-events:none}:host([data-bx-surface]){border-radius:var(--bx-glass-radius, var(--bx-rounded-lg, .75rem));--bx-glass-shadow: 0 2px 4px 0 rgba(0, 0, 0, .1), 0 1px 2px -1px rgba(0, 0, 0, .1);color:var(--bx-glass-text, var(--bx-text-primary))}:host([data-bx-surface]) .bx-menu-wrapper{background:transparent;border-color:transparent;border-radius:inherit;box-shadow:none}\n"]
|
|
139
125
|
}]
|
|
140
126
|
}]
|
|
141
127
|
});
|
|
@@ -346,6 +332,491 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
346
332
|
}]
|
|
347
333
|
}
|
|
348
334
|
});
|
|
335
|
+
const DEFAULT_TABS_VARIANT = "segmented";
|
|
336
|
+
const DEFAULT_TABS_LABEL = "Tabs";
|
|
337
|
+
const TAB_NAVIGATION_KEYS = /* @__PURE__ */ new Set([
|
|
338
|
+
"ArrowLeft",
|
|
339
|
+
"ArrowRight",
|
|
340
|
+
"Home",
|
|
341
|
+
"End"
|
|
342
|
+
]);
|
|
343
|
+
const DEFAULT_TAB_COLOR = "primary";
|
|
344
|
+
const TAB_EMISSION_OPACITY = .15;
|
|
345
|
+
const TAB_COLOR_TOKENS = {
|
|
346
|
+
primary: "primary",
|
|
347
|
+
accent: "accent",
|
|
348
|
+
success: "text-success",
|
|
349
|
+
danger: "text-danger",
|
|
350
|
+
info: "text-info",
|
|
351
|
+
warn: "text-warn",
|
|
352
|
+
grayscale: "text-primary"
|
|
353
|
+
};
|
|
354
|
+
function resolveTabText(text, adapter) {
|
|
355
|
+
adapter?.version?.();
|
|
356
|
+
return isTextWithKey(text) ? adapter?.translate(text.key) ?? text.key : text;
|
|
357
|
+
}
|
|
358
|
+
function resolveTabColor(color) {
|
|
359
|
+
return color ? resolveTokenToCssVar(color) : null;
|
|
360
|
+
}
|
|
361
|
+
var TabContentDirective = class TabContentDirective {
|
|
362
|
+
template = inject(TemplateRef);
|
|
363
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
364
|
+
minVersion: "12.0.0",
|
|
365
|
+
version: "22.2.3",
|
|
366
|
+
ngImport: i0,
|
|
367
|
+
type: TabContentDirective,
|
|
368
|
+
deps: [],
|
|
369
|
+
target: i0.ɵɵFactoryTarget.Directive
|
|
370
|
+
});
|
|
371
|
+
static ɵdir = i0.ɵɵngDeclareDirective({
|
|
372
|
+
minVersion: "14.0.0",
|
|
373
|
+
version: "22.2.3",
|
|
374
|
+
type: TabContentDirective,
|
|
375
|
+
isStandalone: true,
|
|
376
|
+
selector: "ng-template[bxTabContent]",
|
|
377
|
+
ngImport: i0
|
|
378
|
+
});
|
|
379
|
+
};
|
|
380
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
381
|
+
minVersion: "12.0.0",
|
|
382
|
+
version: "22.2.3",
|
|
383
|
+
ngImport: i0,
|
|
384
|
+
type: TabContentDirective,
|
|
385
|
+
decorators: [{
|
|
386
|
+
type: Directive,
|
|
387
|
+
args: [{
|
|
388
|
+
selector: "ng-template[bxTabContent]",
|
|
389
|
+
standalone: true
|
|
390
|
+
}]
|
|
391
|
+
}]
|
|
392
|
+
});
|
|
393
|
+
var Tab = class Tab {
|
|
394
|
+
id = uuidv4();
|
|
395
|
+
i18n = inject(BX_I18N, { optional: true });
|
|
396
|
+
projectedContent = viewChild("content", ...ngDevMode ? [{ debugName: "projectedContent" }] : /* istanbul ignore next */ []);
|
|
397
|
+
lazyContent = contentChild(TabContentDirective, ...ngDevMode ? [{ debugName: "lazyContent" }] : /* istanbul ignore next */ []);
|
|
398
|
+
label = input.required(...ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []);
|
|
399
|
+
value = input(this.id, ...ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []);
|
|
400
|
+
disabled = input(false, {
|
|
401
|
+
...ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {},
|
|
402
|
+
transform: booleanAttribute
|
|
403
|
+
});
|
|
404
|
+
color = input(DEFAULT_TAB_COLOR, ...ngDevMode ? [{ debugName: "color" }] : /* istanbul ignore next */ []);
|
|
405
|
+
textColor = input(...ngDevMode ? [void 0, { debugName: "textColor" }] : /* istanbul ignore next */ []);
|
|
406
|
+
highlightColor = input(...ngDevMode ? [void 0, { debugName: "highlightColor" }] : /* istanbul ignore next */ []);
|
|
407
|
+
contentColor = input(...ngDevMode ? [void 0, { debugName: "contentColor" }] : /* istanbul ignore next */ []);
|
|
408
|
+
icon = input(...ngDevMode ? [void 0, { debugName: "icon" }] : /* istanbul ignore next */ []);
|
|
409
|
+
endIcon = input(...ngDevMode ? [void 0, { debugName: "endIcon" }] : /* istanbul ignore next */ []);
|
|
410
|
+
triggerId = `bx-tab-${this.id}`;
|
|
411
|
+
panelId = `bx-tab-panel-${this.id}`;
|
|
412
|
+
resolvedLabel = computed(() => resolveTabText(this.label(), this.i18n), ...ngDevMode ? [{ debugName: "resolvedLabel" }] : /* istanbul ignore next */ []);
|
|
413
|
+
resolvedHighlight = computed(() => resolveTabColor(this.highlightColor() ?? TAB_COLOR_TOKENS[this.color()]), ...ngDevMode ? [{ debugName: "resolvedHighlight" }] : /* istanbul ignore next */ []);
|
|
414
|
+
resolvedEmission = computed(() => `color-mix(in srgb, ${this.resolvedHighlight()} ${TAB_EMISSION_OPACITY * 100}%, transparent)`, ...ngDevMode ? [{ debugName: "resolvedEmission" }] : /* istanbul ignore next */ []);
|
|
415
|
+
resolvedTextColor = computed(() => resolveTabColor(this.textColor()), ...ngDevMode ? [{ debugName: "resolvedTextColor" }] : /* istanbul ignore next */ []);
|
|
416
|
+
resolvedSelectedText = computed(() => this.resolvedTextColor() ?? resolveTabColor(this.color() === "primary" ? "text-brand" : this.color() === "accent" ? "text-accent" : TAB_COLOR_TOKENS[this.color()]), ...ngDevMode ? [{ debugName: "resolvedSelectedText" }] : /* istanbul ignore next */ []);
|
|
417
|
+
resolvedContentColor = computed(() => resolveTabColor(this.contentColor()), ...ngDevMode ? [{ debugName: "resolvedContentColor" }] : /* istanbul ignore next */ []);
|
|
418
|
+
template = computed(() => this.lazyContent()?.template ?? this.projectedContent(), ...ngDevMode ? [{ debugName: "template" }] : /* istanbul ignore next */ []);
|
|
419
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
420
|
+
minVersion: "12.0.0",
|
|
421
|
+
version: "22.2.3",
|
|
422
|
+
ngImport: i0,
|
|
423
|
+
type: Tab,
|
|
424
|
+
deps: [],
|
|
425
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
426
|
+
});
|
|
427
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
428
|
+
minVersion: "17.2.0",
|
|
429
|
+
version: "22.2.3",
|
|
430
|
+
type: Tab,
|
|
431
|
+
isStandalone: true,
|
|
432
|
+
selector: "bx-tab",
|
|
433
|
+
inputs: {
|
|
434
|
+
label: {
|
|
435
|
+
classPropertyName: "label",
|
|
436
|
+
publicName: "label",
|
|
437
|
+
isSignal: true,
|
|
438
|
+
isRequired: true,
|
|
439
|
+
transformFunction: null
|
|
440
|
+
},
|
|
441
|
+
value: {
|
|
442
|
+
classPropertyName: "value",
|
|
443
|
+
publicName: "value",
|
|
444
|
+
isSignal: true,
|
|
445
|
+
isRequired: false,
|
|
446
|
+
transformFunction: null
|
|
447
|
+
},
|
|
448
|
+
disabled: {
|
|
449
|
+
classPropertyName: "disabled",
|
|
450
|
+
publicName: "disabled",
|
|
451
|
+
isSignal: true,
|
|
452
|
+
isRequired: false,
|
|
453
|
+
transformFunction: null
|
|
454
|
+
},
|
|
455
|
+
color: {
|
|
456
|
+
classPropertyName: "color",
|
|
457
|
+
publicName: "color",
|
|
458
|
+
isSignal: true,
|
|
459
|
+
isRequired: false,
|
|
460
|
+
transformFunction: null
|
|
461
|
+
},
|
|
462
|
+
textColor: {
|
|
463
|
+
classPropertyName: "textColor",
|
|
464
|
+
publicName: "textColor",
|
|
465
|
+
isSignal: true,
|
|
466
|
+
isRequired: false,
|
|
467
|
+
transformFunction: null
|
|
468
|
+
},
|
|
469
|
+
highlightColor: {
|
|
470
|
+
classPropertyName: "highlightColor",
|
|
471
|
+
publicName: "highlightColor",
|
|
472
|
+
isSignal: true,
|
|
473
|
+
isRequired: false,
|
|
474
|
+
transformFunction: null
|
|
475
|
+
},
|
|
476
|
+
contentColor: {
|
|
477
|
+
classPropertyName: "contentColor",
|
|
478
|
+
publicName: "contentColor",
|
|
479
|
+
isSignal: true,
|
|
480
|
+
isRequired: false,
|
|
481
|
+
transformFunction: null
|
|
482
|
+
},
|
|
483
|
+
icon: {
|
|
484
|
+
classPropertyName: "icon",
|
|
485
|
+
publicName: "icon",
|
|
486
|
+
isSignal: true,
|
|
487
|
+
isRequired: false,
|
|
488
|
+
transformFunction: null
|
|
489
|
+
},
|
|
490
|
+
endIcon: {
|
|
491
|
+
classPropertyName: "endIcon",
|
|
492
|
+
publicName: "endIcon",
|
|
493
|
+
isSignal: true,
|
|
494
|
+
isRequired: false,
|
|
495
|
+
transformFunction: null
|
|
496
|
+
}
|
|
497
|
+
},
|
|
498
|
+
queries: [{
|
|
499
|
+
propertyName: "lazyContent",
|
|
500
|
+
first: true,
|
|
501
|
+
predicate: TabContentDirective,
|
|
502
|
+
descendants: true,
|
|
503
|
+
isSignal: true
|
|
504
|
+
}],
|
|
505
|
+
viewQueries: [{
|
|
506
|
+
propertyName: "projectedContent",
|
|
507
|
+
first: true,
|
|
508
|
+
predicate: ["content"],
|
|
509
|
+
descendants: true,
|
|
510
|
+
isSignal: true
|
|
511
|
+
}],
|
|
512
|
+
ngImport: i0,
|
|
513
|
+
template: "<ng-template #content><ng-content></ng-content></ng-template>\n",
|
|
514
|
+
styles: [":host{display:none}\n"],
|
|
515
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush
|
|
516
|
+
});
|
|
517
|
+
};
|
|
518
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
519
|
+
minVersion: "12.0.0",
|
|
520
|
+
version: "22.2.3",
|
|
521
|
+
ngImport: i0,
|
|
522
|
+
type: Tab,
|
|
523
|
+
decorators: [{
|
|
524
|
+
type: Component,
|
|
525
|
+
args: [{
|
|
526
|
+
selector: "bx-tab",
|
|
527
|
+
standalone: true,
|
|
528
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
529
|
+
template: "<ng-template #content><ng-content></ng-content></ng-template>\n",
|
|
530
|
+
styles: [":host{display:none}\n"]
|
|
531
|
+
}]
|
|
532
|
+
}],
|
|
533
|
+
propDecorators: {
|
|
534
|
+
projectedContent: [{
|
|
535
|
+
type: i0.ViewChild,
|
|
536
|
+
args: ["content", { isSignal: true }]
|
|
537
|
+
}],
|
|
538
|
+
lazyContent: [{
|
|
539
|
+
type: i0.ContentChild,
|
|
540
|
+
args: [i0.forwardRef(() => TabContentDirective), { isSignal: true }]
|
|
541
|
+
}],
|
|
542
|
+
label: [{
|
|
543
|
+
type: i0.Input,
|
|
544
|
+
args: [{
|
|
545
|
+
isSignal: true,
|
|
546
|
+
alias: "label",
|
|
547
|
+
required: true
|
|
548
|
+
}]
|
|
549
|
+
}],
|
|
550
|
+
value: [{
|
|
551
|
+
type: i0.Input,
|
|
552
|
+
args: [{
|
|
553
|
+
isSignal: true,
|
|
554
|
+
alias: "value",
|
|
555
|
+
required: false
|
|
556
|
+
}]
|
|
557
|
+
}],
|
|
558
|
+
disabled: [{
|
|
559
|
+
type: i0.Input,
|
|
560
|
+
args: [{
|
|
561
|
+
isSignal: true,
|
|
562
|
+
alias: "disabled",
|
|
563
|
+
required: false
|
|
564
|
+
}]
|
|
565
|
+
}],
|
|
566
|
+
color: [{
|
|
567
|
+
type: i0.Input,
|
|
568
|
+
args: [{
|
|
569
|
+
isSignal: true,
|
|
570
|
+
alias: "color",
|
|
571
|
+
required: false
|
|
572
|
+
}]
|
|
573
|
+
}],
|
|
574
|
+
textColor: [{
|
|
575
|
+
type: i0.Input,
|
|
576
|
+
args: [{
|
|
577
|
+
isSignal: true,
|
|
578
|
+
alias: "textColor",
|
|
579
|
+
required: false
|
|
580
|
+
}]
|
|
581
|
+
}],
|
|
582
|
+
highlightColor: [{
|
|
583
|
+
type: i0.Input,
|
|
584
|
+
args: [{
|
|
585
|
+
isSignal: true,
|
|
586
|
+
alias: "highlightColor",
|
|
587
|
+
required: false
|
|
588
|
+
}]
|
|
589
|
+
}],
|
|
590
|
+
contentColor: [{
|
|
591
|
+
type: i0.Input,
|
|
592
|
+
args: [{
|
|
593
|
+
isSignal: true,
|
|
594
|
+
alias: "contentColor",
|
|
595
|
+
required: false
|
|
596
|
+
}]
|
|
597
|
+
}],
|
|
598
|
+
icon: [{
|
|
599
|
+
type: i0.Input,
|
|
600
|
+
args: [{
|
|
601
|
+
isSignal: true,
|
|
602
|
+
alias: "icon",
|
|
603
|
+
required: false
|
|
604
|
+
}]
|
|
605
|
+
}],
|
|
606
|
+
endIcon: [{
|
|
607
|
+
type: i0.Input,
|
|
608
|
+
args: [{
|
|
609
|
+
isSignal: true,
|
|
610
|
+
alias: "endIcon",
|
|
611
|
+
required: false
|
|
612
|
+
}]
|
|
613
|
+
}]
|
|
614
|
+
}
|
|
615
|
+
});
|
|
616
|
+
var Tabs = class Tabs {
|
|
617
|
+
i18n = inject(BX_I18N, { optional: true });
|
|
618
|
+
triggers = viewChildren("trigger", ...ngDevMode ? [{ debugName: "triggers" }] : /* istanbul ignore next */ []);
|
|
619
|
+
a11y = inject(BxA11yService);
|
|
620
|
+
hasRendered = signal(false, ...ngDevMode ? [{ debugName: "hasRendered" }] : /* istanbul ignore next */ []);
|
|
621
|
+
tabs = contentChildren(Tab, ...ngDevMode ? [{ debugName: "tabs" }] : /* istanbul ignore next */ []);
|
|
622
|
+
activeTab = computed(() => {
|
|
623
|
+
const enabled = this.tabs().filter((tab) => !tab.disabled());
|
|
624
|
+
return enabled.find((tab) => tab.value() === this.selectedValue()) ?? enabled[0];
|
|
625
|
+
}, ...ngDevMode ? [{ debugName: "activeTab" }] : /* istanbul ignore next */ []);
|
|
626
|
+
resolvedLabel = computed(() => resolveTabText(this.ariaLabel(), this.i18n), ...ngDevMode ? [{ debugName: "resolvedLabel" }] : /* istanbul ignore next */ []);
|
|
627
|
+
variant = input(DEFAULT_TABS_VARIANT, ...ngDevMode ? [{ debugName: "variant" }] : /* istanbul ignore next */ []);
|
|
628
|
+
ariaLabel = input(DEFAULT_TABS_LABEL, ...ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []);
|
|
629
|
+
selectedValue = model(null, ...ngDevMode ? [{ debugName: "selectedValue" }] : /* istanbul ignore next */ []);
|
|
630
|
+
constructor() {
|
|
631
|
+
afterNextRender(() => this.hasRendered.set(true));
|
|
632
|
+
afterRenderEffect(() => {
|
|
633
|
+
const value = this.activeTab()?.value() ?? null;
|
|
634
|
+
if (this.selectedValue() !== value) this.selectedValue.set(value);
|
|
635
|
+
});
|
|
636
|
+
}
|
|
637
|
+
select(value) {
|
|
638
|
+
if (this.tabs().find((item) => item.value() === value && !item.disabled())) this.selectedValue.set(value);
|
|
639
|
+
}
|
|
640
|
+
onTabKey(event, tab) {
|
|
641
|
+
if (event.altKey || event.ctrlKey || event.metaKey || !TAB_NAVIGATION_KEYS.has(event.key)) return;
|
|
642
|
+
const enabled = this.tabs().filter((item) => !item.disabled());
|
|
643
|
+
const current = enabled.indexOf(tab);
|
|
644
|
+
if (current < 0) return;
|
|
645
|
+
event.preventDefault();
|
|
646
|
+
event.stopPropagation();
|
|
647
|
+
const button = event.currentTarget;
|
|
648
|
+
const rtl = button.ownerDocument.defaultView?.getComputedStyle(button).direction === "rtl";
|
|
649
|
+
const direction = (event.key === "ArrowRight" ? 1 : -1) * (rtl ? -1 : 1);
|
|
650
|
+
const next = enabled[event.key === "Home" ? 0 : event.key === "End" ? enabled.length - 1 : (current + direction + enabled.length) % enabled.length];
|
|
651
|
+
this.select(next.value());
|
|
652
|
+
const trigger = this.triggers().find((item) => item.nativeElement.id === next.triggerId)?.nativeElement;
|
|
653
|
+
trigger?.focus({ preventScroll: true });
|
|
654
|
+
trigger?.scrollIntoView({
|
|
655
|
+
block: "nearest",
|
|
656
|
+
inline: "nearest"
|
|
657
|
+
});
|
|
658
|
+
}
|
|
659
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
660
|
+
minVersion: "12.0.0",
|
|
661
|
+
version: "22.2.3",
|
|
662
|
+
ngImport: i0,
|
|
663
|
+
type: Tabs,
|
|
664
|
+
deps: [],
|
|
665
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
666
|
+
});
|
|
667
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
668
|
+
minVersion: "17.0.0",
|
|
669
|
+
version: "22.2.3",
|
|
670
|
+
type: Tabs,
|
|
671
|
+
isStandalone: true,
|
|
672
|
+
selector: "bx-tabs",
|
|
673
|
+
inputs: {
|
|
674
|
+
variant: {
|
|
675
|
+
classPropertyName: "variant",
|
|
676
|
+
publicName: "variant",
|
|
677
|
+
isSignal: true,
|
|
678
|
+
isRequired: false,
|
|
679
|
+
transformFunction: null
|
|
680
|
+
},
|
|
681
|
+
ariaLabel: {
|
|
682
|
+
classPropertyName: "ariaLabel",
|
|
683
|
+
publicName: "ariaLabel",
|
|
684
|
+
isSignal: true,
|
|
685
|
+
isRequired: false,
|
|
686
|
+
transformFunction: null
|
|
687
|
+
},
|
|
688
|
+
selectedValue: {
|
|
689
|
+
classPropertyName: "selectedValue",
|
|
690
|
+
publicName: "selectedValue",
|
|
691
|
+
isSignal: true,
|
|
692
|
+
isRequired: false,
|
|
693
|
+
transformFunction: null
|
|
694
|
+
}
|
|
695
|
+
},
|
|
696
|
+
outputs: { selectedValue: "selectedValueChange" },
|
|
697
|
+
host: { properties: {
|
|
698
|
+
"class.bx-tabs-underline": "variant() === \"underline\"",
|
|
699
|
+
"class.bx-tabs-animated": "hasRendered() && !a11y.isReducedMotion()"
|
|
700
|
+
} },
|
|
701
|
+
queries: [{
|
|
702
|
+
propertyName: "tabs",
|
|
703
|
+
predicate: Tab,
|
|
704
|
+
isSignal: true
|
|
705
|
+
}],
|
|
706
|
+
viewQueries: [{
|
|
707
|
+
propertyName: "triggers",
|
|
708
|
+
predicate: ["trigger"],
|
|
709
|
+
descendants: true,
|
|
710
|
+
isSignal: true
|
|
711
|
+
}],
|
|
712
|
+
ngImport: i0,
|
|
713
|
+
template: "<ng-content select=\"bx-tab\"></ng-content>\n\n<div bxSurface data-bx-surface=\"glass\" class=\"bx-tab-header\" role=\"tablist\" [attr.aria-label]=\"resolvedLabel()\" aria-orientation=\"horizontal\">\n<div class=\"bx-tab-list\">\n @for (tab of tabs(); track tab) {\n <button #trigger bxSurface data-bx-surface=\"glass\" class=\"bx-tab-trigger\" type=\"button\" role=\"tab\"\n [bxSurfaceEmission]=\"tab.resolvedEmission()\"\n [style.--bx-tab-highlight]=\"tab.resolvedHighlight()\" [style.--bx-tab-text]=\"tab.resolvedTextColor()\"\n [style.--bx-tab-selected-text]=\"tab.resolvedSelectedText()\"\n [id]=\"tab.triggerId\" [attr.aria-controls]=\"tab.panelId\" [attr.aria-selected]=\"tab === activeTab()\"\n [attr.tabindex]=\"tab === activeTab() ? 0 : -1\" [disabled]=\"tab.disabled()\"\n [class.is-selected]=\"tab === activeTab()\" (click)=\"select(tab.value())\" (keydown)=\"onTabKey($event, tab)\">\n @if (tab.icon()) { <bx-icon [name]=\"tab.icon()!\" size=\"16\" /> }\n <span>{{ tab.resolvedLabel() }}</span>\n @if (tab.endIcon()) { <bx-icon [name]=\"tab.endIcon()!\" size=\"16\" /> }\n </button>\n }\n</div>\n</div>\n\n<div class=\"bx-tab-panels\">\n @for (tab of tabs(); track tab) {\n <div class=\"bx-tab-panel\" role=\"tabpanel\" tabindex=\"0\" [id]=\"tab.panelId\"\n [style.color]=\"tab.resolvedContentColor()\"\n [attr.aria-labelledby]=\"tab.triggerId\" [hidden]=\"tab !== activeTab()\">\n @if (tab === activeTab()) {\n <ng-container [ngTemplateOutlet]=\"tab.template()\"></ng-container>\n }\n </div>\n }\n</div>\n",
|
|
714
|
+
styles: [":host{display:flex;flex-direction:column;min-width:0;min-height:0;box-sizing:border-box;width:100%;max-width:100%;gap:var(--bx-tabs-panel-gap, 1.5rem)}.bx-tab-header{--bx-glass-surface: var(--bx-bg-surface-alt);--bx-glass-edge: var(--bx-border-default);--bx-glass-shadow: none;--bx-glass-opacity: calc(.1 + .25 * var(--bx-glassiness, .5));--bx-glass-radius: .5rem;display:flex;align-self:flex-start;flex:none;box-sizing:border-box;width:fit-content;max-width:100%;padding:.25rem;border:1px solid var(--bx-border-default);border-radius:.5rem}.bx-tab-list{display:flex;flex:1 1 auto;gap:.25rem;min-width:0;padding:1px;overflow:auto hidden;overscroll-behavior-x:contain;scrollbar-width:thin}.bx-tab-trigger{--bx-glass-surface: var(--bx-bg-surface);--bx-glass-text: var(--bx-tab-text, var(--bx-text-secondary));--bx-glass-edge: transparent;--bx-glass-radius: .25rem;--bx-glass-opacity: 0;--bx-glass-decoration-opacity: 0;--bx-glass-rim-visibility: 0;--bx-glass-shadow: none;display:inline-flex;align-items:center;gap:.5rem;flex:none;padding:.5rem .75rem;border:1px solid transparent;border-radius:.25rem;font:inherit;font-size:.875rem;white-space:nowrap;cursor:pointer}.bx-tab-trigger:hover:not(:disabled,.is-selected){--bx-glass-text: var(--bx-tab-text, var(--bx-text-primary));--bx-glass-opacity: .15}.bx-tab-trigger.is-selected{--bx-glass-surface: color-mix( in srgb, var(--bx-tab-highlight, var(--bx-primary)) 35%, var(--bx-bg-surface) );--bx-glass-text: var(--bx-tab-selected-text, var(--bx-text-brand));--bx-glass-edge: color-mix( in srgb, var(--bx-tab-highlight, var(--bx-primary)) 35%, transparent );--bx-glass-opacity: .45;--bx-glass-decoration-opacity: .5;--bx-glass-rim-visibility: .65;--bx-glass-shadow: 0 2px 4px 0 rgba(0, 0, 0, .1), 0 1px 2px -1px rgba(0, 0, 0, .1)}.bx-tab-trigger:disabled{opacity:.4;cursor:not-allowed}.bx-tab-trigger:focus-visible{outline:2px solid var(--bx-tab-highlight, var(--bx-border-brand));outline-offset:-2px}.bx-tab-panels{flex:1 1 auto;min-width:0;min-height:0;max-height:var(--bx-tabs-max-panel-height, none);overflow:var(--bx-tabs-panel-overflow, visible)}.bx-tab-panel{min-width:0}.bx-tab-panel:focus-visible{outline:2px solid var(--bx-border-brand);outline-offset:-2px}:host(.bx-tabs-animated) .bx-tab-trigger{transition:background-color .1s ease-in-out,color .1s ease-in-out,box-shadow .1s ease-in-out}:host(.bx-tabs-underline){gap:var(--bx-tabs-panel-gap, 0)}:host(.bx-tabs-underline) .bx-tab-header{align-self:stretch;width:auto;padding:0;border:0;border-bottom:1px solid var(--bx-border-default);border-radius:0}:host(.bx-tabs-underline) .bx-tab-list{gap:0}:host(.bx-tabs-underline) .bx-tab-trigger{padding:.75rem 1rem;border-inline-end:1px solid var(--bx-border-default);border-radius:0;font-size:.8rem}:host(.bx-tabs-underline) .bx-tab-trigger.is-selected{--bx-glass-shadow: inset 0 -2px 0 var(--bx-tab-highlight, var(--bx-border-brand))}@media(forced-colors:active){.bx-tab-trigger.is-selected{outline:2px solid Highlight;outline-offset:-2px}}\n"],
|
|
715
|
+
dependencies: [
|
|
716
|
+
{
|
|
717
|
+
kind: "directive",
|
|
718
|
+
type: NgTemplateOutlet,
|
|
719
|
+
selector: "[ngTemplateOutlet]",
|
|
720
|
+
inputs: [
|
|
721
|
+
"ngTemplateOutletContext",
|
|
722
|
+
"ngTemplateOutlet",
|
|
723
|
+
"ngTemplateOutletInjector"
|
|
724
|
+
]
|
|
725
|
+
},
|
|
726
|
+
{
|
|
727
|
+
kind: "directive",
|
|
728
|
+
type: BxSurfaceDirective,
|
|
729
|
+
selector: "[bxSurface]",
|
|
730
|
+
inputs: [
|
|
731
|
+
"bxSurfaceInteractive",
|
|
732
|
+
"bxSurfaceGlassiness",
|
|
733
|
+
"bxSurfaceEmission",
|
|
734
|
+
"bxSurfaceFocusEmission",
|
|
735
|
+
"bxReducedTransparency"
|
|
736
|
+
],
|
|
737
|
+
exportAs: ["bxSurface"]
|
|
738
|
+
},
|
|
739
|
+
{
|
|
740
|
+
kind: "component",
|
|
741
|
+
type: Icon,
|
|
742
|
+
selector: "bx-icon",
|
|
743
|
+
inputs: [
|
|
744
|
+
"name",
|
|
745
|
+
"size",
|
|
746
|
+
"color",
|
|
747
|
+
"bgColor",
|
|
748
|
+
"strokeWidth",
|
|
749
|
+
"decorative",
|
|
750
|
+
"ariaLabel"
|
|
751
|
+
]
|
|
752
|
+
}
|
|
753
|
+
],
|
|
754
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush
|
|
755
|
+
});
|
|
756
|
+
};
|
|
757
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
758
|
+
minVersion: "12.0.0",
|
|
759
|
+
version: "22.2.3",
|
|
760
|
+
ngImport: i0,
|
|
761
|
+
type: Tabs,
|
|
762
|
+
decorators: [{
|
|
763
|
+
type: Component,
|
|
764
|
+
args: [{
|
|
765
|
+
selector: "bx-tabs",
|
|
766
|
+
standalone: true,
|
|
767
|
+
imports: [
|
|
768
|
+
NgTemplateOutlet,
|
|
769
|
+
BxSurfaceDirective,
|
|
770
|
+
Icon
|
|
771
|
+
],
|
|
772
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
773
|
+
host: {
|
|
774
|
+
"[class.bx-tabs-underline]": "variant() === \"underline\"",
|
|
775
|
+
"[class.bx-tabs-animated]": "hasRendered() && !a11y.isReducedMotion()"
|
|
776
|
+
},
|
|
777
|
+
template: "<ng-content select=\"bx-tab\"></ng-content>\n\n<div bxSurface data-bx-surface=\"glass\" class=\"bx-tab-header\" role=\"tablist\" [attr.aria-label]=\"resolvedLabel()\" aria-orientation=\"horizontal\">\n<div class=\"bx-tab-list\">\n @for (tab of tabs(); track tab) {\n <button #trigger bxSurface data-bx-surface=\"glass\" class=\"bx-tab-trigger\" type=\"button\" role=\"tab\"\n [bxSurfaceEmission]=\"tab.resolvedEmission()\"\n [style.--bx-tab-highlight]=\"tab.resolvedHighlight()\" [style.--bx-tab-text]=\"tab.resolvedTextColor()\"\n [style.--bx-tab-selected-text]=\"tab.resolvedSelectedText()\"\n [id]=\"tab.triggerId\" [attr.aria-controls]=\"tab.panelId\" [attr.aria-selected]=\"tab === activeTab()\"\n [attr.tabindex]=\"tab === activeTab() ? 0 : -1\" [disabled]=\"tab.disabled()\"\n [class.is-selected]=\"tab === activeTab()\" (click)=\"select(tab.value())\" (keydown)=\"onTabKey($event, tab)\">\n @if (tab.icon()) { <bx-icon [name]=\"tab.icon()!\" size=\"16\" /> }\n <span>{{ tab.resolvedLabel() }}</span>\n @if (tab.endIcon()) { <bx-icon [name]=\"tab.endIcon()!\" size=\"16\" /> }\n </button>\n }\n</div>\n</div>\n\n<div class=\"bx-tab-panels\">\n @for (tab of tabs(); track tab) {\n <div class=\"bx-tab-panel\" role=\"tabpanel\" tabindex=\"0\" [id]=\"tab.panelId\"\n [style.color]=\"tab.resolvedContentColor()\"\n [attr.aria-labelledby]=\"tab.triggerId\" [hidden]=\"tab !== activeTab()\">\n @if (tab === activeTab()) {\n <ng-container [ngTemplateOutlet]=\"tab.template()\"></ng-container>\n }\n </div>\n }\n</div>\n",
|
|
778
|
+
styles: [":host{display:flex;flex-direction:column;min-width:0;min-height:0;box-sizing:border-box;width:100%;max-width:100%;gap:var(--bx-tabs-panel-gap, 1.5rem)}.bx-tab-header{--bx-glass-surface: var(--bx-bg-surface-alt);--bx-glass-edge: var(--bx-border-default);--bx-glass-shadow: none;--bx-glass-opacity: calc(.1 + .25 * var(--bx-glassiness, .5));--bx-glass-radius: .5rem;display:flex;align-self:flex-start;flex:none;box-sizing:border-box;width:fit-content;max-width:100%;padding:.25rem;border:1px solid var(--bx-border-default);border-radius:.5rem}.bx-tab-list{display:flex;flex:1 1 auto;gap:.25rem;min-width:0;padding:1px;overflow:auto hidden;overscroll-behavior-x:contain;scrollbar-width:thin}.bx-tab-trigger{--bx-glass-surface: var(--bx-bg-surface);--bx-glass-text: var(--bx-tab-text, var(--bx-text-secondary));--bx-glass-edge: transparent;--bx-glass-radius: .25rem;--bx-glass-opacity: 0;--bx-glass-decoration-opacity: 0;--bx-glass-rim-visibility: 0;--bx-glass-shadow: none;display:inline-flex;align-items:center;gap:.5rem;flex:none;padding:.5rem .75rem;border:1px solid transparent;border-radius:.25rem;font:inherit;font-size:.875rem;white-space:nowrap;cursor:pointer}.bx-tab-trigger:hover:not(:disabled,.is-selected){--bx-glass-text: var(--bx-tab-text, var(--bx-text-primary));--bx-glass-opacity: .15}.bx-tab-trigger.is-selected{--bx-glass-surface: color-mix( in srgb, var(--bx-tab-highlight, var(--bx-primary)) 35%, var(--bx-bg-surface) );--bx-glass-text: var(--bx-tab-selected-text, var(--bx-text-brand));--bx-glass-edge: color-mix( in srgb, var(--bx-tab-highlight, var(--bx-primary)) 35%, transparent );--bx-glass-opacity: .45;--bx-glass-decoration-opacity: .5;--bx-glass-rim-visibility: .65;--bx-glass-shadow: 0 2px 4px 0 rgba(0, 0, 0, .1), 0 1px 2px -1px rgba(0, 0, 0, .1)}.bx-tab-trigger:disabled{opacity:.4;cursor:not-allowed}.bx-tab-trigger:focus-visible{outline:2px solid var(--bx-tab-highlight, var(--bx-border-brand));outline-offset:-2px}.bx-tab-panels{flex:1 1 auto;min-width:0;min-height:0;max-height:var(--bx-tabs-max-panel-height, none);overflow:var(--bx-tabs-panel-overflow, visible)}.bx-tab-panel{min-width:0}.bx-tab-panel:focus-visible{outline:2px solid var(--bx-border-brand);outline-offset:-2px}:host(.bx-tabs-animated) .bx-tab-trigger{transition:background-color .1s ease-in-out,color .1s ease-in-out,box-shadow .1s ease-in-out}:host(.bx-tabs-underline){gap:var(--bx-tabs-panel-gap, 0)}:host(.bx-tabs-underline) .bx-tab-header{align-self:stretch;width:auto;padding:0;border:0;border-bottom:1px solid var(--bx-border-default);border-radius:0}:host(.bx-tabs-underline) .bx-tab-list{gap:0}:host(.bx-tabs-underline) .bx-tab-trigger{padding:.75rem 1rem;border-inline-end:1px solid var(--bx-border-default);border-radius:0;font-size:.8rem}:host(.bx-tabs-underline) .bx-tab-trigger.is-selected{--bx-glass-shadow: inset 0 -2px 0 var(--bx-tab-highlight, var(--bx-border-brand))}@media(forced-colors:active){.bx-tab-trigger.is-selected{outline:2px solid Highlight;outline-offset:-2px}}\n"]
|
|
779
|
+
}]
|
|
780
|
+
}],
|
|
781
|
+
ctorParameters: () => [],
|
|
782
|
+
propDecorators: {
|
|
783
|
+
triggers: [{
|
|
784
|
+
type: i0.ViewChildren,
|
|
785
|
+
args: ["trigger", { isSignal: true }]
|
|
786
|
+
}],
|
|
787
|
+
tabs: [{
|
|
788
|
+
type: i0.ContentChildren,
|
|
789
|
+
args: [i0.forwardRef(() => Tab), { isSignal: true }]
|
|
790
|
+
}],
|
|
791
|
+
variant: [{
|
|
792
|
+
type: i0.Input,
|
|
793
|
+
args: [{
|
|
794
|
+
isSignal: true,
|
|
795
|
+
alias: "variant",
|
|
796
|
+
required: false
|
|
797
|
+
}]
|
|
798
|
+
}],
|
|
799
|
+
ariaLabel: [{
|
|
800
|
+
type: i0.Input,
|
|
801
|
+
args: [{
|
|
802
|
+
isSignal: true,
|
|
803
|
+
alias: "ariaLabel",
|
|
804
|
+
required: false
|
|
805
|
+
}]
|
|
806
|
+
}],
|
|
807
|
+
selectedValue: [{
|
|
808
|
+
type: i0.Input,
|
|
809
|
+
args: [{
|
|
810
|
+
isSignal: true,
|
|
811
|
+
alias: "selectedValue",
|
|
812
|
+
required: false
|
|
813
|
+
}]
|
|
814
|
+
}, {
|
|
815
|
+
type: i0.Output,
|
|
816
|
+
args: ["selectedValueChange"]
|
|
817
|
+
}]
|
|
818
|
+
}
|
|
819
|
+
});
|
|
349
820
|
const BX_OVERLAY_CONTEXT = new InjectionToken("BX_OVERLAY_CONTEXT");
|
|
350
821
|
var ContextMenuDirective = class ContextMenuDirective {
|
|
351
822
|
overlay = inject(Overlay);
|
|
@@ -1163,7 +1634,7 @@ var DropdownDirective = class DropdownDirective {
|
|
|
1163
1634
|
this.disconnectTheme = this.zone.runOutsideAngular(() => inheritOverlayTheme(this.elementRef.nativeElement, overlay.overlayElement));
|
|
1164
1635
|
this.disconnectLighting = inheritGlassLighting(overlay.overlayElement, this.elementRef.nativeElement);
|
|
1165
1636
|
this.subscriptions = new Subscription();
|
|
1166
|
-
this.
|
|
1637
|
+
this.subscriptions.add(this.zone.runOutsideAngular(() => trackOverlayOrigin(overlay, this.elementRef.nativeElement)));
|
|
1167
1638
|
this.subscriptions.add(overlay.backdropClick().subscribe(() => this.close()));
|
|
1168
1639
|
this.subscriptions.add(overlay.outsidePointerEvents().subscribe((event) => {
|
|
1169
1640
|
if (!this.elementRef.nativeElement.contains(event.target)) this.close();
|
|
@@ -1181,22 +1652,6 @@ var DropdownDirective = class DropdownDirective {
|
|
|
1181
1652
|
overlay.attach(new TemplatePortal(this.bxDropdown(), this.vcr)).detectChanges();
|
|
1182
1653
|
overlay.updatePosition();
|
|
1183
1654
|
}
|
|
1184
|
-
trackScroll(overlay, positionStrategy) {
|
|
1185
|
-
const source = this.elementRef.nativeElement;
|
|
1186
|
-
const view = source.ownerDocument.defaultView;
|
|
1187
|
-
if (!view) return;
|
|
1188
|
-
this.zone.runOutsideAngular(() => {
|
|
1189
|
-
const reposition = (event) => {
|
|
1190
|
-
const target = event.target;
|
|
1191
|
-
if (overlay.hasAttached() && (target === view || target instanceof Node && target.contains(source))) positionStrategy.reapplyLastPosition();
|
|
1192
|
-
};
|
|
1193
|
-
view.addEventListener("scroll", reposition, {
|
|
1194
|
-
capture: true,
|
|
1195
|
-
passive: true
|
|
1196
|
-
});
|
|
1197
|
-
this.subscriptions.add(() => view.removeEventListener("scroll", reposition, true));
|
|
1198
|
-
});
|
|
1199
|
-
}
|
|
1200
1655
|
isDisabled() {
|
|
1201
1656
|
const element = this.elementRef.nativeElement;
|
|
1202
1657
|
return element.hasAttribute("disabled") || element.getAttribute("aria-disabled") === "true";
|
|
@@ -1418,6 +1873,6 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
1418
1873
|
}]
|
|
1419
1874
|
}] }
|
|
1420
1875
|
});
|
|
1421
|
-
export { BX_OVERLAY_CONTEXT, BxOverlayContextDirective, ContextMenuDirective, DropdownDirective, Menu, MenuItem, Tooltip, TooltipDirective };
|
|
1876
|
+
export { BX_OVERLAY_CONTEXT, BxOverlayContextDirective, ContextMenuDirective, DropdownDirective, Menu, MenuItem, Tab, TabContentDirective, Tabs, Tooltip, TooltipDirective };
|
|
1422
1877
|
|
|
1423
1878
|
//# sourceMappingURL=filip.mazev-blocks-primitives.mjs.map
|