@nova-ui/bits 21.0.4 → 21.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fesm2022/nova-ui-bits.mjs +209 -22
- package/fesm2022/nova-ui-bits.mjs.map +1 -1
- package/package.json +1 -1
- package/types/nova-ui-bits.d.ts +34 -10
|
@@ -9583,8 +9583,16 @@ class SwitchComponent {
|
|
|
9583
9583
|
* Label element id used to dynamically compute accessible name.
|
|
9584
9584
|
*/
|
|
9585
9585
|
this.labelId = `nui-switch-label-${switchLabelCounter++}`;
|
|
9586
|
+
this.defaultAriaLabel = $localize `:Accessible name for a switch without a label:Switch`;
|
|
9586
9587
|
this.valueChange = new EventEmitter();
|
|
9587
9588
|
}
|
|
9589
|
+
get accessibleLabel() {
|
|
9590
|
+
return (this.ariaLabel ||
|
|
9591
|
+
(!this.hasProjectedLabel ? this.defaultAriaLabel : null));
|
|
9592
|
+
}
|
|
9593
|
+
get labelIdIfProjected() {
|
|
9594
|
+
return this.ariaLabel || !this.hasProjectedLabel ? null : this.labelId;
|
|
9595
|
+
}
|
|
9588
9596
|
toggle() {
|
|
9589
9597
|
if (this.disabled) {
|
|
9590
9598
|
return;
|
|
@@ -9617,6 +9625,9 @@ class SwitchComponent {
|
|
|
9617
9625
|
ngOnInit() {
|
|
9618
9626
|
this.value = !!this.value;
|
|
9619
9627
|
}
|
|
9628
|
+
get hasProjectedLabel() {
|
|
9629
|
+
return !!this.switchLabel?.nativeElement.textContent?.trim();
|
|
9630
|
+
}
|
|
9620
9631
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.23", ngImport: i0, type: SwitchComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
9621
9632
|
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.23", type: SwitchComponent, isStandalone: false, selector: "nui-switch", inputs: { value: "value", disabled: "disabled", ariaLabel: "ariaLabel", id: "id" }, outputs: { valueChange: "valueChange" }, providers: [
|
|
9622
9633
|
{
|
|
@@ -9629,7 +9640,7 @@ class SwitchComponent {
|
|
|
9629
9640
|
useExisting: forwardRef(() => SwitchComponent),
|
|
9630
9641
|
multi: true,
|
|
9631
9642
|
},
|
|
9632
|
-
], ngImport: i0, template: "<div\n class=\"nui-switch\"\n [class.nui-switched]=\"value\"\n [class.nui-disabled]=\"disabled\"\n [attr.disabled]=\"disabled\">\n <div class=\"nui-switch__container\">\n <div\n class=\"nui-switch__bar\"\n
|
|
9643
|
+
], viewQueries: [{ propertyName: "switchLabel", first: true, predicate: ["switchLabel"], descendants: true, static: true }], ngImport: i0, template: "<div\n class=\"nui-switch\"\n [class.nui-switched]=\"value\"\n [class.nui-disabled]=\"disabled\"\n [attr.disabled]=\"disabled\">\n <div class=\"nui-switch__container\">\n <div\n class=\"nui-switch__bar\"\n (click)=\"toggle()\"\n (keydown.enter)=\"$event.preventDefault(); toggle()\"\n (keydown.space)=\"$event.preventDefault(); toggle()\"\n tabindex=\"{{ disabled ? -1 : 0 }}\"\n role=\"checkbox\"\n [attr.aria-checked]=\"value\"\n [attr.aria-disabled]=\"disabled || null\"\n [attr.aria-label]=\"accessibleLabel\"\n [attr.aria-labelledby]=\"labelIdIfProjected\">\n <div class=\"nui-switch__on\">\n <svg\n aria-hidden=\"true\"\n class=\"nui-switch__svg\"\n viewBox=\"0 0 7.1 6.7\">\n <polyline\n class=\"nui-switch__icon-on\"\n points=\"0.6,2.9 3.2,4.8 7.2,1.0 \" />\n </svg>\n </div>\n <div class=\"nui-switch__thumb\">\n <svg\n aria-hidden=\"true\"\n class=\"nui-switch__svg\"\n viewBox=\"0 0 7.1 6.7\"></svg>\n </div>\n </div>\n <label #switchLabel class=\"nui-switch__label\" [attr.id]=\"labelId\">\n <ng-content></ng-content>\n </label>\n </div>\n</div>\n", styles: [":host .nui-switch{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none}:host .nui-switch[disabled=true]{cursor:default;pointer-events:none;opacity:.4;filter:alpha(opacity=40)}:host .nui-switch:focus{outline:none}:host .nui-switch.nui-switched .nui-switch__bar{background-color:var(--nui-color-on,#00a753)}:host .nui-switch.nui-switched .nui-switch__thumb{transform:translate(20px)}:host .nui-switch__container{display:inline-block}:host .nui-switch__label{margin:0 0 0 10px}:host .nui-switch__bar{cursor:pointer;height:20px;width:40px;border-radius:10px;background-color:var(--nui-color-off,#4d4d4d);position:relative;float:left;transition:background-color ease .3s}:host .nui-switch__bar:focus-visible{outline:none;box-shadow:0 0 0 2px #00c4d280}:host .nui-switch__on,:host .nui-switch__off,:host .nui-switch__thumb{width:14px;height:14px;text-align:center;position:relative;top:3px}:host .nui-switch__thumb{width:14px;height:14px;border-radius:10px;background-color:var(--nui-color-bg-light,#fff);position:absolute;left:3px;top:3px;transition:transform ease .3s}:host .nui-switch__svg{width:10px;height:10px;display:block;margin:1px 6px}:host .nui-switch__icon-on{fill:none;stroke:var(--nui-color-line-inverse,#fff);stroke-width:1;stroke-miterlimit:10}:host .nui-switch__icon-off{fill:none;stroke:var(--nui-color-line-inverse,#fff);stroke-width:1;stroke-miterlimit:10}:host .nui-switch__icon-thumb{fill:none;stroke:var(--nui-color-line-default,#d9d9d9);stroke-miterlimit:10}:host .nui-switch__label:focus{outline:none}\n"] }); }
|
|
9633
9644
|
}
|
|
9634
9645
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.23", ngImport: i0, type: SwitchComponent, decorators: [{
|
|
9635
9646
|
type: Component,
|
|
@@ -9644,7 +9655,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.23", ngImpo
|
|
|
9644
9655
|
useExisting: forwardRef(() => SwitchComponent),
|
|
9645
9656
|
multi: true,
|
|
9646
9657
|
},
|
|
9647
|
-
], encapsulation: ViewEncapsulation.Emulated, standalone: false, template: "<div\n class=\"nui-switch\"\n [class.nui-switched]=\"value\"\n [class.nui-disabled]=\"disabled\"\n [attr.disabled]=\"disabled\">\n <div class=\"nui-switch__container\">\n <div\n class=\"nui-switch__bar\"\n
|
|
9658
|
+
], encapsulation: ViewEncapsulation.Emulated, standalone: false, template: "<div\n class=\"nui-switch\"\n [class.nui-switched]=\"value\"\n [class.nui-disabled]=\"disabled\"\n [attr.disabled]=\"disabled\">\n <div class=\"nui-switch__container\">\n <div\n class=\"nui-switch__bar\"\n (click)=\"toggle()\"\n (keydown.enter)=\"$event.preventDefault(); toggle()\"\n (keydown.space)=\"$event.preventDefault(); toggle()\"\n tabindex=\"{{ disabled ? -1 : 0 }}\"\n role=\"checkbox\"\n [attr.aria-checked]=\"value\"\n [attr.aria-disabled]=\"disabled || null\"\n [attr.aria-label]=\"accessibleLabel\"\n [attr.aria-labelledby]=\"labelIdIfProjected\">\n <div class=\"nui-switch__on\">\n <svg\n aria-hidden=\"true\"\n class=\"nui-switch__svg\"\n viewBox=\"0 0 7.1 6.7\">\n <polyline\n class=\"nui-switch__icon-on\"\n points=\"0.6,2.9 3.2,4.8 7.2,1.0 \" />\n </svg>\n </div>\n <div class=\"nui-switch__thumb\">\n <svg\n aria-hidden=\"true\"\n class=\"nui-switch__svg\"\n viewBox=\"0 0 7.1 6.7\"></svg>\n </div>\n </div>\n <label #switchLabel class=\"nui-switch__label\" [attr.id]=\"labelId\">\n <ng-content></ng-content>\n </label>\n </div>\n</div>\n", styles: [":host .nui-switch{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none}:host .nui-switch[disabled=true]{cursor:default;pointer-events:none;opacity:.4;filter:alpha(opacity=40)}:host .nui-switch:focus{outline:none}:host .nui-switch.nui-switched .nui-switch__bar{background-color:var(--nui-color-on,#00a753)}:host .nui-switch.nui-switched .nui-switch__thumb{transform:translate(20px)}:host .nui-switch__container{display:inline-block}:host .nui-switch__label{margin:0 0 0 10px}:host .nui-switch__bar{cursor:pointer;height:20px;width:40px;border-radius:10px;background-color:var(--nui-color-off,#4d4d4d);position:relative;float:left;transition:background-color ease .3s}:host .nui-switch__bar:focus-visible{outline:none;box-shadow:0 0 0 2px #00c4d280}:host .nui-switch__on,:host .nui-switch__off,:host .nui-switch__thumb{width:14px;height:14px;text-align:center;position:relative;top:3px}:host .nui-switch__thumb{width:14px;height:14px;border-radius:10px;background-color:var(--nui-color-bg-light,#fff);position:absolute;left:3px;top:3px;transition:transform ease .3s}:host .nui-switch__svg{width:10px;height:10px;display:block;margin:1px 6px}:host .nui-switch__icon-on{fill:none;stroke:var(--nui-color-line-inverse,#fff);stroke-width:1;stroke-miterlimit:10}:host .nui-switch__icon-off{fill:none;stroke:var(--nui-color-line-inverse,#fff);stroke-width:1;stroke-miterlimit:10}:host .nui-switch__icon-thumb{fill:none;stroke:var(--nui-color-line-default,#d9d9d9);stroke-miterlimit:10}:host .nui-switch__label:focus{outline:none}\n"] }]
|
|
9648
9659
|
}], propDecorators: { value: [{
|
|
9649
9660
|
type: Input
|
|
9650
9661
|
}], disabled: [{
|
|
@@ -9653,6 +9664,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.23", ngImpo
|
|
|
9653
9664
|
type: Input
|
|
9654
9665
|
}], id: [{
|
|
9655
9666
|
type: Input
|
|
9667
|
+
}], switchLabel: [{
|
|
9668
|
+
type: ViewChild,
|
|
9669
|
+
args: ["switchLabel", { static: true }]
|
|
9656
9670
|
}], valueChange: [{
|
|
9657
9671
|
type: Output
|
|
9658
9672
|
}] } });
|
|
@@ -20069,6 +20083,28 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.23", ngImpo
|
|
|
20069
20083
|
type: Input
|
|
20070
20084
|
}] } });
|
|
20071
20085
|
|
|
20086
|
+
// © 2026 SolarWinds Worldwide, LLC. All rights reserved.
|
|
20087
|
+
//
|
|
20088
|
+
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
20089
|
+
// of this software and associated documentation files (the "Software"), to
|
|
20090
|
+
// deal in the Software without restriction, including without limitation the
|
|
20091
|
+
// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
|
20092
|
+
// sell copies of the Software, and to permit persons to whom the Software is
|
|
20093
|
+
// furnished to do so, subject to the following conditions:
|
|
20094
|
+
//
|
|
20095
|
+
// The above copyright notice and this permission notice shall be included in
|
|
20096
|
+
// all copies or substantial portions of the Software.
|
|
20097
|
+
//
|
|
20098
|
+
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
20099
|
+
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
20100
|
+
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
20101
|
+
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
20102
|
+
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20103
|
+
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
20104
|
+
// THE SOFTWARE.
|
|
20105
|
+
const TAB_ID_PREFIX = "tab-";
|
|
20106
|
+
const TAB_PANEL_ID_PREFIX = "panel-";
|
|
20107
|
+
|
|
20072
20108
|
// © 2022 SolarWinds Worldwide, LLC. All rights reserved.
|
|
20073
20109
|
//
|
|
20074
20110
|
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
@@ -20111,6 +20147,24 @@ class TabGroupComponent {
|
|
|
20111
20147
|
ngAfterViewInit() {
|
|
20112
20148
|
this.checkTraverse();
|
|
20113
20149
|
}
|
|
20150
|
+
ngAfterContentInit() {
|
|
20151
|
+
this.setInitialActiveTab();
|
|
20152
|
+
}
|
|
20153
|
+
setInitialActiveTab() {
|
|
20154
|
+
const activeTab = this.tabs.find(tab => tab.active);
|
|
20155
|
+
const firstEnabledTab = this.tabs.find(tab => !tab.disabled);
|
|
20156
|
+
if (activeTab && !activeTab.disabled) {
|
|
20157
|
+
return;
|
|
20158
|
+
}
|
|
20159
|
+
this.tabs.forEach(tab => {
|
|
20160
|
+
if (tab.active && tab !== firstEnabledTab) {
|
|
20161
|
+
tab.active = false;
|
|
20162
|
+
}
|
|
20163
|
+
});
|
|
20164
|
+
if (firstEnabledTab) {
|
|
20165
|
+
this.selectTab(firstEnabledTab);
|
|
20166
|
+
}
|
|
20167
|
+
}
|
|
20114
20168
|
checkTraverse() {
|
|
20115
20169
|
this.hasTraverse = this.allowTraverse();
|
|
20116
20170
|
this.changeDetectorRef.detectChanges();
|
|
@@ -20133,6 +20187,35 @@ class TabGroupComponent {
|
|
|
20133
20187
|
});
|
|
20134
20188
|
}
|
|
20135
20189
|
}
|
|
20190
|
+
onKeyDown(event) {
|
|
20191
|
+
const tabElement = event.target?.closest?.("[role='tab']");
|
|
20192
|
+
const tabElements = Array.from(this.el.nativeElement.querySelectorAll("[role='tab']"));
|
|
20193
|
+
const currentIndex = tabElements.indexOf(tabElement);
|
|
20194
|
+
if (currentIndex < 0) {
|
|
20195
|
+
return;
|
|
20196
|
+
}
|
|
20197
|
+
const isForwardKey = (!this.vertical && event.code === KEYBOARD_CODE.ARROW_RIGHT) ||
|
|
20198
|
+
(this.vertical && event.code === KEYBOARD_CODE.ARROW_DOWN);
|
|
20199
|
+
const isBackwardKey = (!this.vertical && event.code === KEYBOARD_CODE.ARROW_LEFT) ||
|
|
20200
|
+
(this.vertical && event.code === KEYBOARD_CODE.ARROW_UP);
|
|
20201
|
+
let nextIndex = -1;
|
|
20202
|
+
if (isForwardKey) {
|
|
20203
|
+
nextIndex = this.findEnabledTabIndex(currentIndex, 1);
|
|
20204
|
+
}
|
|
20205
|
+
else if (isBackwardKey) {
|
|
20206
|
+
nextIndex = this.findEnabledTabIndex(currentIndex, -1);
|
|
20207
|
+
}
|
|
20208
|
+
else if (event.code === KEYBOARD_CODE.HOME) {
|
|
20209
|
+
nextIndex = this.findEnabledTabIndex(-1, 1);
|
|
20210
|
+
}
|
|
20211
|
+
else if (event.code === KEYBOARD_CODE.END) {
|
|
20212
|
+
nextIndex = this.findEnabledTabIndex(tabElements.length, -1);
|
|
20213
|
+
}
|
|
20214
|
+
if (nextIndex >= 0) {
|
|
20215
|
+
event.preventDefault();
|
|
20216
|
+
tabElements[nextIndex].focus();
|
|
20217
|
+
}
|
|
20218
|
+
}
|
|
20136
20219
|
allowTraverse() {
|
|
20137
20220
|
const holderSize = this.getElementSize("nui-tabs__holder");
|
|
20138
20221
|
const contentSize = this.getElementSize("nui-tabs__container");
|
|
@@ -20173,6 +20256,17 @@ class TabGroupComponent {
|
|
|
20173
20256
|
const margin = Math.abs(this.getNumberFromPixels(leftMargin));
|
|
20174
20257
|
return margin < maxAllowedMargin;
|
|
20175
20258
|
}
|
|
20259
|
+
findEnabledTabIndex(startIndex, direction) {
|
|
20260
|
+
const tabCount = this.tabs.length;
|
|
20261
|
+
let index = startIndex;
|
|
20262
|
+
for (let offset = 0; offset < tabCount; offset++) {
|
|
20263
|
+
index = (index + direction + tabCount) % tabCount;
|
|
20264
|
+
if (!this.tabs[index].disabled) {
|
|
20265
|
+
return index;
|
|
20266
|
+
}
|
|
20267
|
+
}
|
|
20268
|
+
return -1;
|
|
20269
|
+
}
|
|
20176
20270
|
isTraverseRightAllowed(margin) {
|
|
20177
20271
|
return this.getNumberFromPixels(margin) < 0;
|
|
20178
20272
|
}
|
|
@@ -20200,13 +20294,13 @@ class TabGroupComponent {
|
|
|
20200
20294
|
this.isDestroyed = true;
|
|
20201
20295
|
}
|
|
20202
20296
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.23", ngImport: i0, type: TabGroupComponent, deps: [{ token: i0.ElementRef }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
20203
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.23", type: TabGroupComponent, isStandalone: false, selector: "nui-tab-group", inputs: { vertical: "vertical" }, host: { listeners: { "window:resize": "checkTraverse()" } }, ngImport: i0, template: "<div class=\"nui-tabgroup\" [class.flex-column]=\"!vertical\">\n <div\n class=\"nui-tabs__holder\"\n [class.vertical]=\"vertical\"\n (click)=\"$event.preventDefault()\">\n @if (hasTraverse) {\n <div\n class=\"btn-caret-left\"\n [class.disabled]=\"!rightTraverseEnabled\"\n (click)=\"traverseRight()\">\n <nui-icon\n [icon]=\"'caret-left'\"\n [iconColor]=\"!rightTraverseEnabled ? 'gray' : 'default'\"></nui-icon>\n </div>\n }\n <div class=\"nui-tabs\">\n <div\n class=\"nui-tabs__container\"\n role=\"tablist\"\n [class.flex-column]=\"vertical\">\n @for (tab of tabs; track tab) {\n <div\n class=\"nui-tab\"\n [class.active]=\"tab.active && !vertical\"\n [class.horizontal]=\"tab.active && !vertical\"\n [class.disabled]=\"tab.disabled\"\n [class.active__vertical]=\"tab.active && vertical\">\n <span\n class=\"tab-link\"\n role=\"tab\"\n [id]=\"tab.
|
|
20297
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.23", type: TabGroupComponent, isStandalone: false, selector: "nui-tab-group", inputs: { vertical: "vertical" }, host: { listeners: { "window:resize": "checkTraverse()" } }, ngImport: i0, template: "<div class=\"nui-tabgroup\" [class.flex-column]=\"!vertical\">\n <div\n class=\"nui-tabs__holder\"\n [class.vertical]=\"vertical\"\n (click)=\"$event.preventDefault()\">\n @if (hasTraverse) {\n <div\n class=\"btn-caret-left\"\n [class.disabled]=\"!rightTraverseEnabled\"\n (click)=\"traverseRight()\">\n <nui-icon\n [icon]=\"'caret-left'\"\n [iconColor]=\"!rightTraverseEnabled ? 'gray' : 'default'\"></nui-icon>\n </div>\n }\n <div class=\"nui-tabs\">\n <div\n class=\"nui-tabs__container\"\n role=\"tablist\"\n [class.flex-column]=\"vertical\"\n [attr.aria-orientation]=\"vertical ? 'vertical' : null\"\n (keydown)=\"onKeyDown($event)\">\n @for (tab of tabs; track tab) {\n <div\n class=\"nui-tab\"\n [class.active]=\"tab.active && !vertical\"\n [class.horizontal]=\"tab.active && !vertical\"\n [class.disabled]=\"tab.disabled\"\n [class.active__vertical]=\"tab.active && vertical\">\n <span\n class=\"tab-link\"\n role=\"tab\"\n [id]=\"tab.tabControlId\"\n [attr.aria-controls]=\"tab.panelId\"\n [attr.tabindex]=\"\n tab.disabled || !tab.active ? -1 : 0\n \"\n [attr.aria-selected]=\"tab.active\"\n [attr.aria-disabled]=\"tab.disabled || null\"\n (click)=\"selectTab(tab)\"\n (keydown.enter)=\"selectTab(tab)\"\n (keydown.space)=\"\n $event.preventDefault(); selectTab(tab)\n \">\n <span\n [nuiTabHeadingCustomTemplateRef]=\"tab.headingRef\"\n >{{ tab.heading }}</span\n >\n </span>\n </div>\n }\n </div>\n </div>\n @if (hasTraverse) {\n <div\n class=\"btn-caret-right\"\n [class.disabled]=\"!leftTraverseEnabled\"\n (click)=\"traverseLeft()\">\n <nui-icon\n [icon]=\"'caret-right'\"\n [iconColor]=\"!leftTraverseEnabled ? 'gray' : 'default'\"></nui-icon>\n </div>\n }\n </div>\n <div class=\"nui-tabgroup__content\">\n <ng-content></ng-content>\n </div>\n</div>\n", styles: [".nui-tabgroup{display:flex;height:100%}.nui-tabgroup .nui-tabs{display:flex;justify-content:flex-start;margin-bottom:0;overflow:hidden}.nui-tabgroup .nui-tabs__holder{display:flex;border-bottom:1px solid #d9d9d9;border-bottom:1px solid var(--nui-color-line-default, #d9d9d9);flex-direction:row;background-color:var(--nui-color-bg-content,#fff)}.nui-tabgroup .nui-tabs__holder.vertical{border-right:1px solid #d9d9d9;border-right:1px solid var(--nui-color-line-default, #d9d9d9);border-bottom:0!important;margin-right:5px;margin-bottom:5px}.nui-tabgroup .nui-tabs__holder .btn-caret-right{align-items:center;justify-content:center;display:flex;flex:1;background:#fff;min-width:30px;max-width:30px;min-height:20px;z-index:2;border-bottom:none;cursor:pointer;border-left:1px solid #d9d9d9;border-left:1px solid var(--nui-color-line-default, #d9d9d9);box-shadow:-2px 0 2px #d9d9d9;box-shadow:-2px 0 2px var(--nui-color-line-default, #d9d9d9)}.nui-tabgroup .nui-tabs__holder .btn-caret-right:focus-visible{outline:none;box-shadow:0 0 0 2px #00c4d280}.nui-tabgroup .nui-tabs__holder .btn-caret-right.disabled{cursor:auto}.nui-tabgroup .nui-tabs__holder .btn-caret-left{align-items:center;justify-content:center;display:flex;flex:1;background:#fff;min-width:30px;max-width:30px;min-height:20px;z-index:2;border-bottom:none;cursor:pointer;border-right:1px solid #d9d9d9;border-right:1px solid var(--nui-color-line-default, #d9d9d9);box-shadow:2px 0 2px #d9d9d9;box-shadow:2px 0 2px var(--nui-color-line-default, #d9d9d9)}.nui-tabgroup .nui-tabs__holder .btn-caret-left:focus-visible{outline:none;box-shadow:0 0 0 2px #00c4d280}.nui-tabgroup .nui-tabs__holder .btn-caret-left.disabled{cursor:auto}.nui-tabgroup .nui-tabs__container{display:flex}.nui-tabgroup .nui-tabs__container .nui-tab{margin-bottom:-1px;white-space:nowrap}.nui-tabgroup .nui-tabs__container .nui-tab.horizontal{border-left:none}.nui-tabgroup .nui-tabs__container .nui-tab.active{border-bottom:3px solid #00c4d2;border-bottom:3px solid var(--nui-color-selected-contrast, #00c4d2)}.nui-tabgroup .nui-tabs__container .nui-tab.active>.tab-link{color:var(--nui-color-text-default,#111);background-color:var(--nui-color-bg-transparent,transparent)}.nui-tabgroup .nui-tabs__container .nui-tab.active__vertical{border-left:3px solid #00c4d2;border-left:3px solid var(--nui-color-selected-contrast, #00c4d2)}.nui-tabgroup .nui-tabs__container .nui-tab.disabled>.tab-link{cursor:not-allowed;color:var(--nui-color-text-disabled,rgba(17, 17, 17, .3))}.nui-tabgroup .nui-tabs__container .nui-tab.disabled>.tab-link:hover{background:transparent}.nui-tabgroup .nui-tabs__container .nui-tab:hover{background:var(--nui-color-bg-light-hover,#f2f2f2)}.nui-tabgroup .nui-tabs__container .nui-tab .tab-link{display:block;padding:5px 10px;cursor:pointer;text-transform:uppercase;font-size:13px;font-weight:600;line-height:18px;color:var(--nui-color-text-secondary,rgba(17, 17, 17, .6))}.nui-tabgroup .nui-tabs__container .nui-tab .tab-link:hover{background:var(--nui-color-bg-light-hover,#f2f2f2)}.nui-tabgroup .nui-tabs__container .nui-tab .tab-link:focus-visible{outline:none;box-shadow:0 0 0 2px #00c4d280}.nui-tabgroup__content,.full-width{width:100%}.flex-column{flex-direction:column}.caret-button{align-items:center;justify-content:center;display:flex;flex:1;background:#fff;min-width:30px;max-width:30px;min-height:20px;z-index:2;border-bottom:none;cursor:pointer}.caret-button:focus-visible{outline:none;box-shadow:0 0 0 2px #00c4d280}.caret-button.disabled{cursor:auto}\n"], dependencies: [{ kind: "component", type: IconComponent, selector: "nui-icon", inputs: ["iconColor", "brushType", "iconHoverColor", "iconSize", "cssClass", "fillContainer", "status", "childStatus", "icon", "counter", "decorative", "ariaLabel", "explicitRole"] }, { kind: "directive", type: TabHeadingCustomTemplateRefDirective, selector: "[nuiTabHeadingCustomTemplateRef]", inputs: ["nuiTabHeadingCustomTemplateRef"] }], encapsulation: i0.ViewEncapsulation.None }); }
|
|
20204
20298
|
}
|
|
20205
20299
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.23", ngImport: i0, type: TabGroupComponent, decorators: [{
|
|
20206
20300
|
type: Component,
|
|
20207
20301
|
args: [{ selector: "nui-tab-group", host: {
|
|
20208
20302
|
"(window:resize)": "checkTraverse()",
|
|
20209
|
-
}, encapsulation: ViewEncapsulation.None, standalone: false, template: "<div class=\"nui-tabgroup\" [class.flex-column]=\"!vertical\">\n <div\n class=\"nui-tabs__holder\"\n [class.vertical]=\"vertical\"\n (click)=\"$event.preventDefault()\">\n @if (hasTraverse) {\n <div\n class=\"btn-caret-left\"\n [class.disabled]=\"!rightTraverseEnabled\"\n (click)=\"traverseRight()\">\n <nui-icon\n [icon]=\"'caret-left'\"\n [iconColor]=\"!rightTraverseEnabled ? 'gray' : 'default'\"></nui-icon>\n </div>\n }\n <div class=\"nui-tabs\">\n <div\n class=\"nui-tabs__container\"\n role=\"tablist\"\n [class.flex-column]=\"vertical\">\n @for (tab of tabs; track tab) {\n <div\n class=\"nui-tab\"\n [class.active]=\"tab.active && !vertical\"\n [class.horizontal]=\"tab.active && !vertical\"\n [class.disabled]=\"tab.disabled\"\n [class.active__vertical]=\"tab.active && vertical\">\n <span\n class=\"tab-link\"\n role=\"tab\"\n [id]=\"tab.
|
|
20303
|
+
}, encapsulation: ViewEncapsulation.None, standalone: false, template: "<div class=\"nui-tabgroup\" [class.flex-column]=\"!vertical\">\n <div\n class=\"nui-tabs__holder\"\n [class.vertical]=\"vertical\"\n (click)=\"$event.preventDefault()\">\n @if (hasTraverse) {\n <div\n class=\"btn-caret-left\"\n [class.disabled]=\"!rightTraverseEnabled\"\n (click)=\"traverseRight()\">\n <nui-icon\n [icon]=\"'caret-left'\"\n [iconColor]=\"!rightTraverseEnabled ? 'gray' : 'default'\"></nui-icon>\n </div>\n }\n <div class=\"nui-tabs\">\n <div\n class=\"nui-tabs__container\"\n role=\"tablist\"\n [class.flex-column]=\"vertical\"\n [attr.aria-orientation]=\"vertical ? 'vertical' : null\"\n (keydown)=\"onKeyDown($event)\">\n @for (tab of tabs; track tab) {\n <div\n class=\"nui-tab\"\n [class.active]=\"tab.active && !vertical\"\n [class.horizontal]=\"tab.active && !vertical\"\n [class.disabled]=\"tab.disabled\"\n [class.active__vertical]=\"tab.active && vertical\">\n <span\n class=\"tab-link\"\n role=\"tab\"\n [id]=\"tab.tabControlId\"\n [attr.aria-controls]=\"tab.panelId\"\n [attr.tabindex]=\"\n tab.disabled || !tab.active ? -1 : 0\n \"\n [attr.aria-selected]=\"tab.active\"\n [attr.aria-disabled]=\"tab.disabled || null\"\n (click)=\"selectTab(tab)\"\n (keydown.enter)=\"selectTab(tab)\"\n (keydown.space)=\"\n $event.preventDefault(); selectTab(tab)\n \">\n <span\n [nuiTabHeadingCustomTemplateRef]=\"tab.headingRef\"\n >{{ tab.heading }}</span\n >\n </span>\n </div>\n }\n </div>\n </div>\n @if (hasTraverse) {\n <div\n class=\"btn-caret-right\"\n [class.disabled]=\"!leftTraverseEnabled\"\n (click)=\"traverseLeft()\">\n <nui-icon\n [icon]=\"'caret-right'\"\n [iconColor]=\"!leftTraverseEnabled ? 'gray' : 'default'\"></nui-icon>\n </div>\n }\n </div>\n <div class=\"nui-tabgroup__content\">\n <ng-content></ng-content>\n </div>\n</div>\n", styles: [".nui-tabgroup{display:flex;height:100%}.nui-tabgroup .nui-tabs{display:flex;justify-content:flex-start;margin-bottom:0;overflow:hidden}.nui-tabgroup .nui-tabs__holder{display:flex;border-bottom:1px solid #d9d9d9;border-bottom:1px solid var(--nui-color-line-default, #d9d9d9);flex-direction:row;background-color:var(--nui-color-bg-content,#fff)}.nui-tabgroup .nui-tabs__holder.vertical{border-right:1px solid #d9d9d9;border-right:1px solid var(--nui-color-line-default, #d9d9d9);border-bottom:0!important;margin-right:5px;margin-bottom:5px}.nui-tabgroup .nui-tabs__holder .btn-caret-right{align-items:center;justify-content:center;display:flex;flex:1;background:#fff;min-width:30px;max-width:30px;min-height:20px;z-index:2;border-bottom:none;cursor:pointer;border-left:1px solid #d9d9d9;border-left:1px solid var(--nui-color-line-default, #d9d9d9);box-shadow:-2px 0 2px #d9d9d9;box-shadow:-2px 0 2px var(--nui-color-line-default, #d9d9d9)}.nui-tabgroup .nui-tabs__holder .btn-caret-right:focus-visible{outline:none;box-shadow:0 0 0 2px #00c4d280}.nui-tabgroup .nui-tabs__holder .btn-caret-right.disabled{cursor:auto}.nui-tabgroup .nui-tabs__holder .btn-caret-left{align-items:center;justify-content:center;display:flex;flex:1;background:#fff;min-width:30px;max-width:30px;min-height:20px;z-index:2;border-bottom:none;cursor:pointer;border-right:1px solid #d9d9d9;border-right:1px solid var(--nui-color-line-default, #d9d9d9);box-shadow:2px 0 2px #d9d9d9;box-shadow:2px 0 2px var(--nui-color-line-default, #d9d9d9)}.nui-tabgroup .nui-tabs__holder .btn-caret-left:focus-visible{outline:none;box-shadow:0 0 0 2px #00c4d280}.nui-tabgroup .nui-tabs__holder .btn-caret-left.disabled{cursor:auto}.nui-tabgroup .nui-tabs__container{display:flex}.nui-tabgroup .nui-tabs__container .nui-tab{margin-bottom:-1px;white-space:nowrap}.nui-tabgroup .nui-tabs__container .nui-tab.horizontal{border-left:none}.nui-tabgroup .nui-tabs__container .nui-tab.active{border-bottom:3px solid #00c4d2;border-bottom:3px solid var(--nui-color-selected-contrast, #00c4d2)}.nui-tabgroup .nui-tabs__container .nui-tab.active>.tab-link{color:var(--nui-color-text-default,#111);background-color:var(--nui-color-bg-transparent,transparent)}.nui-tabgroup .nui-tabs__container .nui-tab.active__vertical{border-left:3px solid #00c4d2;border-left:3px solid var(--nui-color-selected-contrast, #00c4d2)}.nui-tabgroup .nui-tabs__container .nui-tab.disabled>.tab-link{cursor:not-allowed;color:var(--nui-color-text-disabled,rgba(17, 17, 17, .3))}.nui-tabgroup .nui-tabs__container .nui-tab.disabled>.tab-link:hover{background:transparent}.nui-tabgroup .nui-tabs__container .nui-tab:hover{background:var(--nui-color-bg-light-hover,#f2f2f2)}.nui-tabgroup .nui-tabs__container .nui-tab .tab-link{display:block;padding:5px 10px;cursor:pointer;text-transform:uppercase;font-size:13px;font-weight:600;line-height:18px;color:var(--nui-color-text-secondary,rgba(17, 17, 17, .6))}.nui-tabgroup .nui-tabs__container .nui-tab .tab-link:hover{background:var(--nui-color-bg-light-hover,#f2f2f2)}.nui-tabgroup .nui-tabs__container .nui-tab .tab-link:focus-visible{outline:none;box-shadow:0 0 0 2px #00c4d280}.nui-tabgroup__content,.full-width{width:100%}.flex-column{flex-direction:column}.caret-button{align-items:center;justify-content:center;display:flex;flex:1;background:#fff;min-width:30px;max-width:30px;min-height:20px;z-index:2;border-bottom:none;cursor:pointer}.caret-button:focus-visible{outline:none;box-shadow:0 0 0 2px #00c4d280}.caret-button.disabled{cursor:auto}\n"] }]
|
|
20210
20304
|
}], ctorParameters: () => [{ type: i0.ElementRef }, { type: i0.ChangeDetectorRef }], propDecorators: { vertical: [{
|
|
20211
20305
|
type: Input
|
|
20212
20306
|
}] } });
|
|
@@ -20232,7 +20326,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.23", ngImpo
|
|
|
20232
20326
|
// THE SOFTWARE.
|
|
20233
20327
|
/** @ignore */
|
|
20234
20328
|
class TabComponent {
|
|
20235
|
-
|
|
20329
|
+
get tabControlId() {
|
|
20330
|
+
return TAB_ID_PREFIX + this.tabId;
|
|
20331
|
+
}
|
|
20332
|
+
get panelId() {
|
|
20333
|
+
return TAB_PANEL_ID_PREFIX + this.tabId;
|
|
20334
|
+
}
|
|
20236
20335
|
/** Tab active state toggle */
|
|
20237
20336
|
get active() {
|
|
20238
20337
|
return this._active;
|
|
@@ -20251,17 +20350,19 @@ class TabComponent {
|
|
|
20251
20350
|
this._active = active;
|
|
20252
20351
|
this.selected.emit(this);
|
|
20253
20352
|
}
|
|
20353
|
+
get tabIndex() {
|
|
20354
|
+
return this.active ? 0 : -1;
|
|
20355
|
+
}
|
|
20254
20356
|
get idAttr() {
|
|
20255
20357
|
return this.panelId;
|
|
20256
20358
|
}
|
|
20257
20359
|
get ariaLabelledbyAttr() {
|
|
20258
|
-
return this.
|
|
20360
|
+
return this.tabControlId;
|
|
20259
20361
|
}
|
|
20260
20362
|
constructor(tabGroup) {
|
|
20261
20363
|
this.tabGroup = tabGroup;
|
|
20262
|
-
/** Unique
|
|
20263
|
-
this.tabId =
|
|
20264
|
-
this.panelId = `${this.tabId}-panel`;
|
|
20364
|
+
/** Unique identifier for the tab and its panel. Can be supplied by a consumer or generated automatically. */
|
|
20365
|
+
this.tabId = _uniqueId("nui-tab-");
|
|
20265
20366
|
/** Event is fired when tab became active, $event:Tab equals to selected instance of Tab component */
|
|
20266
20367
|
this.selected = new EventEmitter();
|
|
20267
20368
|
/** Event is fired when tab became inactive, $event:Tab equals to deselected instance of Tab component */
|
|
@@ -20271,7 +20372,7 @@ class TabComponent {
|
|
|
20271
20372
|
this.tabGroup.addTab(this);
|
|
20272
20373
|
}
|
|
20273
20374
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.23", ngImport: i0, type: TabComponent, deps: [{ token: TabGroupComponent }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
20274
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.23", type: TabComponent, isStandalone: false, selector: "nui-tab", inputs: { heading: "heading", disabled: "disabled", templateRef: "templateRef", active: "active" }, outputs: { selected: "selected", deselected: "deselected" }, host: { properties: { "class.tab-pane": "this.addClass", "attr.role": "this.role", "attr.id": "this.idAttr", "attr.aria-labelledby": "this.ariaLabelledbyAttr" } }, ngImport: i0, template: `
|
|
20375
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.23", type: TabComponent, isStandalone: false, selector: "nui-tab", inputs: { tabId: "tabId", heading: "heading", disabled: "disabled", templateRef: "templateRef", active: "active" }, outputs: { selected: "selected", deselected: "deselected" }, host: { properties: { "class.tab-pane": "this.addClass", "attr.role": "this.role", "attr.tabindex": "this.tabIndex", "attr.id": "this.idAttr", "attr.aria-labelledby": "this.ariaLabelledbyAttr" } }, ngImport: i0, template: `
|
|
20275
20376
|
<div [hidden]="!active"><ng-content></ng-content></div>
|
|
20276
20377
|
@if (active) {
|
|
20277
20378
|
<ng-template [ngTemplateOutlet]="templateRef"> </ng-template>
|
|
@@ -20291,7 +20392,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.23", ngImpo
|
|
|
20291
20392
|
encapsulation: ViewEncapsulation.None,
|
|
20292
20393
|
standalone: false,
|
|
20293
20394
|
}]
|
|
20294
|
-
}], ctorParameters: () => [{ type: TabGroupComponent }], propDecorators: {
|
|
20395
|
+
}], ctorParameters: () => [{ type: TabGroupComponent }], propDecorators: { tabId: [{
|
|
20396
|
+
type: Input
|
|
20397
|
+
}], heading: [{
|
|
20295
20398
|
type: Input
|
|
20296
20399
|
}], disabled: [{
|
|
20297
20400
|
type: Input
|
|
@@ -20309,6 +20412,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.23", ngImpo
|
|
|
20309
20412
|
}], role: [{
|
|
20310
20413
|
type: HostBinding,
|
|
20311
20414
|
args: ["attr.role"]
|
|
20415
|
+
}], tabIndex: [{
|
|
20416
|
+
type: HostBinding,
|
|
20417
|
+
args: ["attr.tabindex"]
|
|
20312
20418
|
}], idAttr: [{
|
|
20313
20419
|
type: HostBinding,
|
|
20314
20420
|
args: ["attr.id"]
|
|
@@ -20386,11 +20492,28 @@ class TabHeadingComponent {
|
|
|
20386
20492
|
get active() {
|
|
20387
20493
|
return this._active;
|
|
20388
20494
|
}
|
|
20495
|
+
/**
|
|
20496
|
+
* Identifier used to associate this tab with its consumer-owned panel.
|
|
20497
|
+
* Can be supplied by a consumer or generated automatically.
|
|
20498
|
+
*/
|
|
20499
|
+
set tabId(tabId) {
|
|
20500
|
+
this._tabId = tabId || _uniqueId("nui-tab-heading-");
|
|
20501
|
+
}
|
|
20502
|
+
get tabId() {
|
|
20503
|
+
return this._tabId;
|
|
20504
|
+
}
|
|
20505
|
+
get tabControlId() {
|
|
20506
|
+
return TAB_ID_PREFIX + this.tabId;
|
|
20507
|
+
}
|
|
20508
|
+
get panelId() {
|
|
20509
|
+
return TAB_PANEL_ID_PREFIX + this.tabId;
|
|
20510
|
+
}
|
|
20389
20511
|
constructor(changeDetector, elementRef) {
|
|
20390
20512
|
this.changeDetector = changeDetector;
|
|
20391
20513
|
this.elementRef = elementRef;
|
|
20392
20514
|
/** Event is fired when tab became active, $event:Tab equals to selected instance of Tab component */
|
|
20393
20515
|
this.selected = new EventEmitter();
|
|
20516
|
+
this._tabId = _uniqueId("nui-tab-heading-");
|
|
20394
20517
|
}
|
|
20395
20518
|
selectTab() {
|
|
20396
20519
|
if (!this.disabled) {
|
|
@@ -20401,15 +20524,20 @@ class TabHeadingComponent {
|
|
|
20401
20524
|
if (event.code === KEYBOARD_CODE.ENTER ||
|
|
20402
20525
|
event.code === KEYBOARD_CODE.SPACE) {
|
|
20403
20526
|
event.preventDefault();
|
|
20404
|
-
this.
|
|
20527
|
+
this.selectTab();
|
|
20528
|
+
// Forwards activation to host-level directives such as routerLink,
|
|
20529
|
+
// which only react to clicks.
|
|
20530
|
+
if (!this.disabled) {
|
|
20531
|
+
this.elementRef.nativeElement.click();
|
|
20532
|
+
}
|
|
20405
20533
|
}
|
|
20406
20534
|
}
|
|
20407
20535
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.23", ngImport: i0, type: TabHeadingComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
20408
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.23", type: TabHeadingComponent, isStandalone: false, selector: "nui-tab-heading", inputs: { disabled: "disabled", active: "active", tabId: "tabId" }, outputs: { selected: "selected" }, host: { properties: { "class.disabled": "this.isDisabled" } }, ngImport: i0, template: "
|
|
20536
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.23", type: TabHeadingComponent, isStandalone: false, selector: "nui-tab-heading", inputs: { disabled: "disabled", active: "active", tabId: "tabId", ariaControls: "ariaControls", ariaLabel: "ariaLabel" }, outputs: { selected: "selected" }, host: { properties: { "class.disabled": "this.isDisabled" } }, ngImport: i0, template: "<div\n class=\"nui-tab-heading\"\n [class.active]=\"active\"\n [tabindex]=\"disabled || !active ? -1 : 0\"\n [attr.aria-selected]=\"active ? 'true' : 'false'\"\n [attr.aria-disabled]=\"disabled ? 'true' : null\"\n [attr.id]=\"tabControlId\"\n [attr.aria-controls]=\"ariaControls\"\n [attr.aria-label]=\"ariaLabel\"\n role=\"tab\"\n (click)=\"selectTab()\"\n (keydown)=\"onKeyDown($event)\">\n <span class=\"tab-link\">\n <ng-content></ng-content>\n </span>\n</div>\n", styles: [":host{max-width:250px;min-height:37px;background-color:var(--nui-color-bg-transparent,transparent)}:host .nui-tab-heading{white-space:nowrap}:host .nui-tab-heading.active{border-left:none;border-bottom:3px solid;border-bottom-color:var(--nui-color-selected-contrast,#00c4d2)}:host .nui-tab-heading.active>.tab-link{color:var(--nui-color-text-default,#111);background-color:var(--nui-color-bg-content,#fff)}:host .nui-tab-heading:focus{outline:none;background:var(--nui-color-bg-transparent-hover,rgba(17, 17, 17, .05))}:host .nui-tab-heading:focus-visible{outline:none;box-shadow:0 0 0 2px #00c4d280}:host .nui-tab-heading .tab-link{background:var(--nui-color-bg-transparent,transparent);color:var(--nui-color-text-secondary,rgba(17, 17, 17, .6));line-height:var(--nui-line-height-default,18px);font-weight:var(--nui-font-weight-semibold,600);font-size:var(--nui-font-size-default,13px);display:block;padding:10px 15px;text-transform:uppercase;min-height:37px;cursor:pointer}:host .nui-tab-heading .tab-link:hover{background:var(--transparent,transparent)}:host.disabled>.nui-tab-heading .tab-link{cursor:not-allowed;color:var(--nui-color-text-disabled,rgba(17, 17, 17, .3))}:host.disabled>.nui-tab-heading .tab-link:hover{background:transparent}:host.disabled:hover{background:transparent}:host:hover{background:var(--nui-color-bg-transparent-hover,rgba(17, 17, 17, .05))}:host-context(nui-tab-heading-group.vertical) .nui-tab-heading{max-width:250px;min-height:40px;border-left:3px solid transparent}:host-context(nui-tab-heading-group.vertical) .nui-tab-heading.active{border-bottom:none;border-left:3px solid;border-left-color:var(--nui-color-selected-contrast,#00c4d2)}:host-context(nui-tab-heading-group.vertical) .nui-tab-heading .tab-link{min-height:40px}\n"] }); }
|
|
20409
20537
|
}
|
|
20410
20538
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.23", ngImport: i0, type: TabHeadingComponent, decorators: [{
|
|
20411
20539
|
type: Component,
|
|
20412
|
-
args: [{ selector: "nui-tab-heading", standalone: false, template: "
|
|
20540
|
+
args: [{ selector: "nui-tab-heading", standalone: false, template: "<div\n class=\"nui-tab-heading\"\n [class.active]=\"active\"\n [tabindex]=\"disabled || !active ? -1 : 0\"\n [attr.aria-selected]=\"active ? 'true' : 'false'\"\n [attr.aria-disabled]=\"disabled ? 'true' : null\"\n [attr.id]=\"tabControlId\"\n [attr.aria-controls]=\"ariaControls\"\n [attr.aria-label]=\"ariaLabel\"\n role=\"tab\"\n (click)=\"selectTab()\"\n (keydown)=\"onKeyDown($event)\">\n <span class=\"tab-link\">\n <ng-content></ng-content>\n </span>\n</div>\n", styles: [":host{max-width:250px;min-height:37px;background-color:var(--nui-color-bg-transparent,transparent)}:host .nui-tab-heading{white-space:nowrap}:host .nui-tab-heading.active{border-left:none;border-bottom:3px solid;border-bottom-color:var(--nui-color-selected-contrast,#00c4d2)}:host .nui-tab-heading.active>.tab-link{color:var(--nui-color-text-default,#111);background-color:var(--nui-color-bg-content,#fff)}:host .nui-tab-heading:focus{outline:none;background:var(--nui-color-bg-transparent-hover,rgba(17, 17, 17, .05))}:host .nui-tab-heading:focus-visible{outline:none;box-shadow:0 0 0 2px #00c4d280}:host .nui-tab-heading .tab-link{background:var(--nui-color-bg-transparent,transparent);color:var(--nui-color-text-secondary,rgba(17, 17, 17, .6));line-height:var(--nui-line-height-default,18px);font-weight:var(--nui-font-weight-semibold,600);font-size:var(--nui-font-size-default,13px);display:block;padding:10px 15px;text-transform:uppercase;min-height:37px;cursor:pointer}:host .nui-tab-heading .tab-link:hover{background:var(--transparent,transparent)}:host.disabled>.nui-tab-heading .tab-link{cursor:not-allowed;color:var(--nui-color-text-disabled,rgba(17, 17, 17, .3))}:host.disabled>.nui-tab-heading .tab-link:hover{background:transparent}:host.disabled:hover{background:transparent}:host:hover{background:var(--nui-color-bg-transparent-hover,rgba(17, 17, 17, .05))}:host-context(nui-tab-heading-group.vertical) .nui-tab-heading{max-width:250px;min-height:40px;border-left:3px solid transparent}:host-context(nui-tab-heading-group.vertical) .nui-tab-heading.active{border-bottom:none;border-left:3px solid;border-left-color:var(--nui-color-selected-contrast,#00c4d2)}:host-context(nui-tab-heading-group.vertical) .nui-tab-heading .tab-link{min-height:40px}\n"] }]
|
|
20413
20541
|
}], ctorParameters: () => [{ type: i0.ChangeDetectorRef }, { type: i0.ElementRef }], propDecorators: { isDisabled: [{
|
|
20414
20542
|
type: HostBinding,
|
|
20415
20543
|
args: ["class.disabled"]
|
|
@@ -20419,6 +20547,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.23", ngImpo
|
|
|
20419
20547
|
type: Input
|
|
20420
20548
|
}], tabId: [{
|
|
20421
20549
|
type: Input
|
|
20550
|
+
}], ariaControls: [{
|
|
20551
|
+
type: Input
|
|
20552
|
+
}], ariaLabel: [{
|
|
20553
|
+
type: Input
|
|
20422
20554
|
}], selected: [{
|
|
20423
20555
|
type: Output
|
|
20424
20556
|
}] } });
|
|
@@ -20482,15 +20614,55 @@ class TabHeadingGroupComponent {
|
|
|
20482
20614
|
this.checkTraverse();
|
|
20483
20615
|
});
|
|
20484
20616
|
}
|
|
20617
|
+
ngAfterContentInit() {
|
|
20618
|
+
this.setActiveTab();
|
|
20619
|
+
}
|
|
20485
20620
|
setActiveTab() {
|
|
20486
|
-
|
|
20487
|
-
|
|
20488
|
-
|
|
20621
|
+
const activeTab = this.getActiveTab();
|
|
20622
|
+
const firstEnabledTab = this._tabs.find(tab => !tab.disabled);
|
|
20623
|
+
if (activeTab && !activeTab.disabled) {
|
|
20624
|
+
return;
|
|
20625
|
+
}
|
|
20626
|
+
if (activeTab) {
|
|
20627
|
+
activeTab.active = false;
|
|
20628
|
+
}
|
|
20629
|
+
if (firstEnabledTab) {
|
|
20630
|
+
firstEnabledTab.active = true;
|
|
20631
|
+
this.selected.emit(firstEnabledTab.tabId);
|
|
20489
20632
|
}
|
|
20490
20633
|
}
|
|
20491
20634
|
getActiveTab() {
|
|
20492
20635
|
return this._tabs.filter((tab) => tab.active)[0];
|
|
20493
20636
|
}
|
|
20637
|
+
onKeyDown(event) {
|
|
20638
|
+
const tabElement = event.target?.closest?.("[role='tab']");
|
|
20639
|
+
const tabElements = Array.from(this.el.nativeElement.querySelectorAll("[role='tab']"));
|
|
20640
|
+
const currentIndex = tabElements.indexOf(tabElement);
|
|
20641
|
+
if (currentIndex < 0) {
|
|
20642
|
+
return;
|
|
20643
|
+
}
|
|
20644
|
+
const isForwardKey = (!this.vertical && event.code === KEYBOARD_CODE.ARROW_RIGHT) ||
|
|
20645
|
+
(this.vertical && event.code === KEYBOARD_CODE.ARROW_DOWN);
|
|
20646
|
+
const isBackwardKey = (!this.vertical && event.code === KEYBOARD_CODE.ARROW_LEFT) ||
|
|
20647
|
+
(this.vertical && event.code === KEYBOARD_CODE.ARROW_UP);
|
|
20648
|
+
let nextIndex = -1;
|
|
20649
|
+
if (isForwardKey) {
|
|
20650
|
+
nextIndex = this.findEnabledTabIndex(currentIndex, 1);
|
|
20651
|
+
}
|
|
20652
|
+
else if (isBackwardKey) {
|
|
20653
|
+
nextIndex = this.findEnabledTabIndex(currentIndex, -1);
|
|
20654
|
+
}
|
|
20655
|
+
else if (event.code === KEYBOARD_CODE.HOME) {
|
|
20656
|
+
nextIndex = this.findEnabledTabIndex(-1, 1);
|
|
20657
|
+
}
|
|
20658
|
+
else if (event.code === KEYBOARD_CODE.END) {
|
|
20659
|
+
nextIndex = this.findEnabledTabIndex(tabElements.length, -1);
|
|
20660
|
+
}
|
|
20661
|
+
if (nextIndex >= 0) {
|
|
20662
|
+
event.preventDefault();
|
|
20663
|
+
tabElements[nextIndex].focus();
|
|
20664
|
+
}
|
|
20665
|
+
}
|
|
20494
20666
|
checkTraverse() {
|
|
20495
20667
|
this.hasTraverse = this.allowTraverse();
|
|
20496
20668
|
this.changeDetectorRef.detectChanges();
|
|
@@ -20555,6 +20727,18 @@ class TabHeadingGroupComponent {
|
|
|
20555
20727
|
const margin = Math.abs(this.getNumberFromPixels(leftMargin));
|
|
20556
20728
|
return margin < maxAllowedMargin;
|
|
20557
20729
|
}
|
|
20730
|
+
findEnabledTabIndex(startIndex, direction) {
|
|
20731
|
+
const tabs = this._tabs.toArray();
|
|
20732
|
+
const tabCount = tabs.length;
|
|
20733
|
+
let index = startIndex;
|
|
20734
|
+
for (let offset = 0; offset < tabCount; offset++) {
|
|
20735
|
+
index = (index + direction + tabCount) % tabCount;
|
|
20736
|
+
if (!tabs[index].disabled) {
|
|
20737
|
+
return index;
|
|
20738
|
+
}
|
|
20739
|
+
}
|
|
20740
|
+
return -1;
|
|
20741
|
+
}
|
|
20558
20742
|
isTraverseRightAllowed(margin) {
|
|
20559
20743
|
return this.getNumberFromPixels(margin) < 0;
|
|
20560
20744
|
}
|
|
@@ -20578,16 +20762,19 @@ class TabHeadingGroupComponent {
|
|
|
20578
20762
|
return value + increment + "px";
|
|
20579
20763
|
}
|
|
20580
20764
|
ngOnDestroy() {
|
|
20581
|
-
this._changesSubscription
|
|
20765
|
+
this._changesSubscription?.unsubscribe();
|
|
20582
20766
|
this._tabSelectedSubscriptions.forEach(sub => sub.unsubscribe());
|
|
20583
|
-
this._ro
|
|
20767
|
+
this._ro?.disconnect();
|
|
20584
20768
|
}
|
|
20585
20769
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.23", ngImport: i0, type: TabHeadingGroupComponent, deps: [{ token: i0.ElementRef }, { token: i0.ChangeDetectorRef }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
20586
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.23", type: TabHeadingGroupComponent, isStandalone: false, selector: "nui-tab-heading-group", inputs: { vertical: "vertical" }, outputs: { selected: "selected" }, host: { attributes: { "role": "tablist" }, properties: { "class.vertical": "this.isVertical" } }, queries: [{ propertyName: "_tabs", predicate: TabHeadingComponent }], viewQueries: [{ propertyName: "resizableArea", first: true, predicate: ["resizableArea"], descendants: true }], ngImport: i0, template: "<div
|
|
20770
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.23", type: TabHeadingGroupComponent, isStandalone: false, selector: "nui-tab-heading-group", inputs: { vertical: "vertical" }, outputs: { selected: "selected" }, host: { attributes: { "role": "tablist" }, properties: { "attr.aria-orientation": "vertical ? 'vertical' : null", "class.vertical": "this.isVertical" } }, queries: [{ propertyName: "_tabs", predicate: TabHeadingComponent }], viewQueries: [{ propertyName: "resizableArea", first: true, predicate: ["resizableArea"], descendants: true }], ngImport: i0, template: "<div\n class=\"nui-tab-headings__holder\"\n (click)=\"$event.preventDefault()\"\n (keydown)=\"onKeyDown($event)\">\n @if (hasTraverse) {\n <!-- a11y: WCAG 2.5.8 Target Size - TODO: NUI-6279 -->\n <div\n class=\"btn-caret-left\"\n [class.disabled]=\"!rightTraverseEnabled\"\n (click)=\"traverseRight()\">\n <nui-icon\n iconSize=\"default\"\n icon=\"caret-left\"\n [iconColor]=\"!rightTraverseEnabled ? 'disabled-gray' : 'gray'\"></nui-icon>\n </div>\n }\n <div class=\"nui-tab-headings\">\n <div\n class=\"nui-tab-headings__container\"\n #resizableArea\n [class.flex-column]=\"vertical\">\n <ng-content></ng-content>\n </div>\n </div>\n @if (hasTraverse) {\n <!-- a11y: WCAG 2.5.8 Target Size - TODO: NUI-6279 -->\n <div\n class=\"btn-caret-right\"\n [class.disabled]=\"!leftTraverseEnabled\"\n (click)=\"traverseLeft()\">\n <nui-icon\n iconSize=\"default\"\n icon=\"caret-right\"\n [iconColor]=\"!leftTraverseEnabled ? 'disabled-gray' : 'gray'\"></nui-icon>\n </div>\n }\n</div>\n", styles: [":host{display:flex;height:100%}:host .nui-tab-headings{display:flex;justify-content:flex-start;margin-bottom:0;overflow:hidden}:host .nui-tab-headings__holder{display:flex;border-bottom:1px solid #d9d9d9;border-bottom:1px solid var(--nui-color-line-default, #d9d9d9);width:100%}:host .nui-tab-headings__holder .btn-caret-right{align-items:center;justify-content:center;display:flex;flex:1;background:var(--nui-color-bg-content,#fff);min-width:40px;max-width:40px;min-height:40px;z-index:0;border-bottom:none;cursor:pointer;border-left:1px solid;border-left-color:var(--nui-color-line-default,#d9d9d9);box-shadow:-6px 0 5px -5px var(--nui-shadow-color, rgba(17, 17, 17, .3))}:host .nui-tab-headings__holder .btn-caret-right:focus-visible{outline:none;box-shadow:0 0 0 2px #00c4d280}:host .nui-tab-headings__holder .btn-caret-right.disabled{cursor:auto}:host .nui-tab-headings__holder .btn-caret-left{border-right:1px solid;border-right-color:var(--nui-color-line-default,#d9d9d9);box-shadow:6px 0 5px -5px var(--nui-shadow-color, rgba(17, 17, 17, .3));align-items:center;justify-content:center;display:flex;flex:1;background:var(--nui-color-bg-content,#fff);min-width:40px;max-width:40px;min-height:40px;z-index:0;border-bottom:none;cursor:pointer}:host .nui-tab-headings__holder .btn-caret-left:focus-visible{outline:none;box-shadow:0 0 0 2px #00c4d280}:host .nui-tab-headings__holder .btn-caret-left.disabled{cursor:auto}:host .nui-tab-headings__container{display:flex}.caret-button{align-items:center;justify-content:center;display:flex;flex:1;background:var(--nui-color-bg-content,#fff);min-width:40px;max-width:40px;min-height:40px;z-index:0;border-bottom:none;cursor:pointer}.caret-button:focus-visible{outline:none;box-shadow:0 0 0 2px #00c4d280}.caret-button.disabled{cursor:auto}:host-context(nui-tab-heading-group.vertical) .nui-tab-headings__holder{flex-direction:column;border-right:1px solid;border-right-color:var(--nui-color-line-default,#d9d9d9);border-bottom:0;background:var(--nui-color-bg-secondary,#fafafa)}:host-context(nui-tab-heading-group.vertical) .nui-tab-headings__container{width:100%}\n"], dependencies: [{ kind: "component", type: IconComponent, selector: "nui-icon", inputs: ["iconColor", "brushType", "iconHoverColor", "iconSize", "cssClass", "fillContainer", "status", "childStatus", "icon", "counter", "decorative", "ariaLabel", "explicitRole"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
20587
20771
|
}
|
|
20588
20772
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.23", ngImport: i0, type: TabHeadingGroupComponent, decorators: [{
|
|
20589
20773
|
type: Component,
|
|
20590
|
-
args: [{ selector: "nui-tab-heading-group", changeDetection: ChangeDetectionStrategy.OnPush, host: {
|
|
20774
|
+
args: [{ selector: "nui-tab-heading-group", changeDetection: ChangeDetectionStrategy.OnPush, host: {
|
|
20775
|
+
"role": "tablist",
|
|
20776
|
+
"[attr.aria-orientation]": "vertical ? 'vertical' : null",
|
|
20777
|
+
}, standalone: false, template: "<div\n class=\"nui-tab-headings__holder\"\n (click)=\"$event.preventDefault()\"\n (keydown)=\"onKeyDown($event)\">\n @if (hasTraverse) {\n <!-- a11y: WCAG 2.5.8 Target Size - TODO: NUI-6279 -->\n <div\n class=\"btn-caret-left\"\n [class.disabled]=\"!rightTraverseEnabled\"\n (click)=\"traverseRight()\">\n <nui-icon\n iconSize=\"default\"\n icon=\"caret-left\"\n [iconColor]=\"!rightTraverseEnabled ? 'disabled-gray' : 'gray'\"></nui-icon>\n </div>\n }\n <div class=\"nui-tab-headings\">\n <div\n class=\"nui-tab-headings__container\"\n #resizableArea\n [class.flex-column]=\"vertical\">\n <ng-content></ng-content>\n </div>\n </div>\n @if (hasTraverse) {\n <!-- a11y: WCAG 2.5.8 Target Size - TODO: NUI-6279 -->\n <div\n class=\"btn-caret-right\"\n [class.disabled]=\"!leftTraverseEnabled\"\n (click)=\"traverseLeft()\">\n <nui-icon\n iconSize=\"default\"\n icon=\"caret-right\"\n [iconColor]=\"!leftTraverseEnabled ? 'disabled-gray' : 'gray'\"></nui-icon>\n </div>\n }\n</div>\n", styles: [":host{display:flex;height:100%}:host .nui-tab-headings{display:flex;justify-content:flex-start;margin-bottom:0;overflow:hidden}:host .nui-tab-headings__holder{display:flex;border-bottom:1px solid #d9d9d9;border-bottom:1px solid var(--nui-color-line-default, #d9d9d9);width:100%}:host .nui-tab-headings__holder .btn-caret-right{align-items:center;justify-content:center;display:flex;flex:1;background:var(--nui-color-bg-content,#fff);min-width:40px;max-width:40px;min-height:40px;z-index:0;border-bottom:none;cursor:pointer;border-left:1px solid;border-left-color:var(--nui-color-line-default,#d9d9d9);box-shadow:-6px 0 5px -5px var(--nui-shadow-color, rgba(17, 17, 17, .3))}:host .nui-tab-headings__holder .btn-caret-right:focus-visible{outline:none;box-shadow:0 0 0 2px #00c4d280}:host .nui-tab-headings__holder .btn-caret-right.disabled{cursor:auto}:host .nui-tab-headings__holder .btn-caret-left{border-right:1px solid;border-right-color:var(--nui-color-line-default,#d9d9d9);box-shadow:6px 0 5px -5px var(--nui-shadow-color, rgba(17, 17, 17, .3));align-items:center;justify-content:center;display:flex;flex:1;background:var(--nui-color-bg-content,#fff);min-width:40px;max-width:40px;min-height:40px;z-index:0;border-bottom:none;cursor:pointer}:host .nui-tab-headings__holder .btn-caret-left:focus-visible{outline:none;box-shadow:0 0 0 2px #00c4d280}:host .nui-tab-headings__holder .btn-caret-left.disabled{cursor:auto}:host .nui-tab-headings__container{display:flex}.caret-button{align-items:center;justify-content:center;display:flex;flex:1;background:var(--nui-color-bg-content,#fff);min-width:40px;max-width:40px;min-height:40px;z-index:0;border-bottom:none;cursor:pointer}.caret-button:focus-visible{outline:none;box-shadow:0 0 0 2px #00c4d280}.caret-button.disabled{cursor:auto}:host-context(nui-tab-heading-group.vertical) .nui-tab-headings__holder{flex-direction:column;border-right:1px solid;border-right-color:var(--nui-color-line-default,#d9d9d9);border-bottom:0;background:var(--nui-color-bg-secondary,#fafafa)}:host-context(nui-tab-heading-group.vertical) .nui-tab-headings__container{width:100%}\n"] }]
|
|
20591
20778
|
}], ctorParameters: () => [{ type: i0.ElementRef }, { type: i0.ChangeDetectorRef }, { type: i0.NgZone }], propDecorators: { _tabs: [{
|
|
20592
20779
|
type: ContentChildren,
|
|
20593
20780
|
args: [TabHeadingComponent]
|
|
@@ -33205,7 +33392,7 @@ class ExampleWrapperComponent {
|
|
|
33205
33392
|
component.fileType === fileType)?.fileContent ?? "");
|
|
33206
33393
|
}
|
|
33207
33394
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.23", ngImport: i0, type: ExampleWrapperComponent, deps: [{ token: SourcesService }, { token: CodeSandboxService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
33208
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.23", type: ExampleWrapperComponent, isStandalone: false, selector: "nui-example-wrapper", inputs: { filenamePrefix: "filenamePrefix", exampleTitle: "exampleTitle", showSource: "showSource" }, ngImport: i0, template: "<div class=\"nui-example-wrapper__container\">\n <div class=\"nui-example-wrapper__header\">\n <h4 class=\"nui-example-wrapper__title\">{{ exampleTitle }}</h4>\n <div>\n <button\n nui-button\n type=\"button\"\n displayStyle=\"action\"\n icon=\"{{\n showSource ? 'double-caret-up' : 'double-caret-down'\n }}\"\n ariaLabel=\"Toggle source code\"\n i18n-ariaLabel\n [nuiTooltip]=\"getTooltip()\"\n tooltipPlacement=\"bottom\"\n (click)=\"showSource = !showSource\"></button>\n <button\n nui-button\n type=\"button\"\n displayStyle=\"action\"\n icon=\"external-link\"\n ariaLabel=\"Open in CodeSandbox\"\n i18n-ariaLabel\n nuiTooltip=\"Open in Code Sandbox (only self-contained examples are opened properly)\"\n tooltipPlacement=\"bottom\"\n (click)=\"openCodeSandboxExample()\"></button>\n </div>\n </div>\n @if (showSource) {\n <div class=\"nui-example-wrapper__source\">\n <nui-tab-group>\n @if (!!getExampleComponents('html')) {\n <nui-tab heading=\"HTML\">\n <div class=\"media-body\">\n <nui-copy-text\n fileContent=\"{{ getExampleComponents('html') }}\"></nui-copy-text>\n <nui-example-code\n language=\"html\"\n [code]=\"getExampleComponents('html')\" />\n </div>\n </nui-tab>\n } @if (!!getExampleComponents('ts')) {\n <nui-tab heading=\"Typescript\">\n <nui-copy-text\n fileContent=\"{{ getExampleComponents('ts') }}\"></nui-copy-text>\n <div class=\"media-body\">\n <nui-example-code\n language=\"typescript\"\n [code]=\"getExampleComponents('ts')\" />\n </div>\n </nui-tab>\n } @if (!!getExampleComponents('less')) {\n <nui-tab heading=\"Less\">\n <nui-copy-text\n fileContent=\"{{ getExampleComponents('less') }}\"></nui-copy-text>\n <div class=\"media-body\">\n @if (!!getExampleComponents('less')) {\n <nui-example-code [code]=\"getExampleComponents('less')\" />\n } @else {\n <ng-template #noLess>\n <!-- existing noLess content goes here -->\n </ng-template>\n }\n <ng-template #noLess>\n <nui-image image=\"no-data-to-show\"></nui-image>\n </ng-template>\n </div>\n </nui-tab>\n }\n </nui-tab-group>\n </div>\n }\n <div class=\"nui-example-wrapper__content\">\n <ng-content></ng-content>\n </div>\n</div>\n", styles: [".nui-example-wrapper__theme{display:inline-block}.nui-example-wrapper__content{background-color:var(--nui-color-bg-light,#fff)}.nui-example-wrapper__container{display:flex;flex-direction:column;border:1px solid;border-color:var(--nui-color-line-default,#d9d9d9);box-shadow:0 2px 2px #1111114d;margin-bottom:20px}.nui-example-wrapper__header{display:flex;flex-direction:row;background-color:var(--page-header-border-color,#d9d9d9);color:var(--nui-color-line-default,#d9d9d9);padding:5px 10px}.nui-example-wrapper__header button{outline:none}.nui-example-wrapper__title{flex-grow:1}.nui-example-wrapper__content{padding:20px}\n"], dependencies: [{ kind: "component", type: TabComponent, selector: "nui-tab", inputs: ["heading", "disabled", "templateRef", "active"], outputs: ["selected", "deselected"] }, { kind: "component", type: TabGroupComponent, selector: "nui-tab-group", inputs: ["vertical"] }, { kind: "directive", type: TooltipDirective, selector: "[nuiTooltip]", inputs: ["tooltipPlacement", "nuiTooltipDisabled", "nuiTooltipEllipsis", "nuiTooltip"], exportAs: ["nuiTooltip"] }, { kind: "component", type: ButtonComponent, selector: "[nui-button]", inputs: ["displayStyle", "icon", "iconColor", "iconRight", "isBusy", "isEmpty", "ariaLabel", "isRepeat", "size"] }, { kind: "component", type: ImageComponent, selector: "nui-image", inputs: ["image", "description", "float", "margin", "isWatermark", "width", "height", "autoFill", "role"] }, { kind: "component", type: CopyTextComponent, selector: "nui-copy-text", inputs: ["fileContent"] }, { kind: "component", type: ExampleCodeComponent, selector: "nui-example-code", inputs: ["language", "code"] }] }); }
|
|
33395
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.23", type: ExampleWrapperComponent, isStandalone: false, selector: "nui-example-wrapper", inputs: { filenamePrefix: "filenamePrefix", exampleTitle: "exampleTitle", showSource: "showSource" }, ngImport: i0, template: "<div class=\"nui-example-wrapper__container\">\n <div class=\"nui-example-wrapper__header\">\n <h4 class=\"nui-example-wrapper__title\">{{ exampleTitle }}</h4>\n <div>\n <button\n nui-button\n type=\"button\"\n displayStyle=\"action\"\n icon=\"{{\n showSource ? 'double-caret-up' : 'double-caret-down'\n }}\"\n ariaLabel=\"Toggle source code\"\n i18n-ariaLabel\n [nuiTooltip]=\"getTooltip()\"\n tooltipPlacement=\"bottom\"\n (click)=\"showSource = !showSource\"></button>\n <button\n nui-button\n type=\"button\"\n displayStyle=\"action\"\n icon=\"external-link\"\n ariaLabel=\"Open in CodeSandbox\"\n i18n-ariaLabel\n nuiTooltip=\"Open in Code Sandbox (only self-contained examples are opened properly)\"\n tooltipPlacement=\"bottom\"\n (click)=\"openCodeSandboxExample()\"></button>\n </div>\n </div>\n @if (showSource) {\n <div class=\"nui-example-wrapper__source\">\n <nui-tab-group>\n @if (!!getExampleComponents('html')) {\n <nui-tab heading=\"HTML\">\n <div class=\"media-body\">\n <nui-copy-text\n fileContent=\"{{ getExampleComponents('html') }}\"></nui-copy-text>\n <nui-example-code\n language=\"html\"\n [code]=\"getExampleComponents('html')\" />\n </div>\n </nui-tab>\n } @if (!!getExampleComponents('ts')) {\n <nui-tab heading=\"Typescript\">\n <nui-copy-text\n fileContent=\"{{ getExampleComponents('ts') }}\"></nui-copy-text>\n <div class=\"media-body\">\n <nui-example-code\n language=\"typescript\"\n [code]=\"getExampleComponents('ts')\" />\n </div>\n </nui-tab>\n } @if (!!getExampleComponents('less')) {\n <nui-tab heading=\"Less\">\n <nui-copy-text\n fileContent=\"{{ getExampleComponents('less') }}\"></nui-copy-text>\n <div class=\"media-body\">\n @if (!!getExampleComponents('less')) {\n <nui-example-code [code]=\"getExampleComponents('less')\" />\n } @else {\n <ng-template #noLess>\n <!-- existing noLess content goes here -->\n </ng-template>\n }\n <ng-template #noLess>\n <nui-image image=\"no-data-to-show\"></nui-image>\n </ng-template>\n </div>\n </nui-tab>\n }\n </nui-tab-group>\n </div>\n }\n <div class=\"nui-example-wrapper__content\">\n <ng-content></ng-content>\n </div>\n</div>\n", styles: [".nui-example-wrapper__theme{display:inline-block}.nui-example-wrapper__content{background-color:var(--nui-color-bg-light,#fff)}.nui-example-wrapper__container{display:flex;flex-direction:column;border:1px solid;border-color:var(--nui-color-line-default,#d9d9d9);box-shadow:0 2px 2px #1111114d;margin-bottom:20px}.nui-example-wrapper__header{display:flex;flex-direction:row;background-color:var(--page-header-border-color,#d9d9d9);color:var(--nui-color-line-default,#d9d9d9);padding:5px 10px}.nui-example-wrapper__header button{outline:none}.nui-example-wrapper__title{flex-grow:1}.nui-example-wrapper__content{padding:20px}\n"], dependencies: [{ kind: "component", type: TabComponent, selector: "nui-tab", inputs: ["tabId", "heading", "disabled", "templateRef", "active"], outputs: ["selected", "deselected"] }, { kind: "component", type: TabGroupComponent, selector: "nui-tab-group", inputs: ["vertical"] }, { kind: "directive", type: TooltipDirective, selector: "[nuiTooltip]", inputs: ["tooltipPlacement", "nuiTooltipDisabled", "nuiTooltipEllipsis", "nuiTooltip"], exportAs: ["nuiTooltip"] }, { kind: "component", type: ButtonComponent, selector: "[nui-button]", inputs: ["displayStyle", "icon", "iconColor", "iconRight", "isBusy", "isEmpty", "ariaLabel", "isRepeat", "size"] }, { kind: "component", type: ImageComponent, selector: "nui-image", inputs: ["image", "description", "float", "margin", "isWatermark", "width", "height", "autoFill", "role"] }, { kind: "component", type: CopyTextComponent, selector: "nui-copy-text", inputs: ["fileContent"] }, { kind: "component", type: ExampleCodeComponent, selector: "nui-example-code", inputs: ["language", "code"] }] }); }
|
|
33209
33396
|
}
|
|
33210
33397
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.23", ngImport: i0, type: ExampleWrapperComponent, decorators: [{
|
|
33211
33398
|
type: Component,
|