@koobiq/components 21.0.1 → 21.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/badge/_badge-theme.scss +31 -0
- package/breadcrumbs/breadcrumbs.scss +5 -1
- package/checkbox/_checkbox-theme.scss +0 -17
- package/checkbox/checkbox-tokens.scss +0 -4
- package/code-block/_code-block-theme.scss +7 -6
- package/code-block/code-block-tokens.scss +8 -4
- package/code-block/code-block.scss +54 -32
- package/content-panel/content-panel-header.scss +2 -3
- package/content-panel/content-panel.scss +3 -0
- package/core/selection/pseudo-checkbox/pseudo-checkbox-tokens.scss +0 -2
- package/fesm2022/koobiq-components-accordion.mjs +4 -4
- package/fesm2022/koobiq-components-accordion.mjs.map +1 -1
- package/fesm2022/koobiq-components-actions-panel.mjs +10 -2
- package/fesm2022/koobiq-components-actions-panel.mjs.map +1 -1
- package/fesm2022/koobiq-components-app-switcher.mjs +1 -1
- package/fesm2022/koobiq-components-app-switcher.mjs.map +1 -1
- package/fesm2022/koobiq-components-badge.mjs +2 -2
- package/fesm2022/koobiq-components-badge.mjs.map +1 -1
- package/fesm2022/koobiq-components-breadcrumbs.mjs +2 -2
- package/fesm2022/koobiq-components-breadcrumbs.mjs.map +1 -1
- package/fesm2022/koobiq-components-button-toggle.mjs +1 -1
- package/fesm2022/koobiq-components-button-toggle.mjs.map +1 -1
- package/fesm2022/koobiq-components-checkbox.mjs +18 -8
- package/fesm2022/koobiq-components-checkbox.mjs.map +1 -1
- package/fesm2022/koobiq-components-clamped-text.mjs +78 -10
- package/fesm2022/koobiq-components-clamped-text.mjs.map +1 -1
- package/fesm2022/koobiq-components-code-block.mjs +63 -379
- package/fesm2022/koobiq-components-code-block.mjs.map +1 -1
- package/fesm2022/koobiq-components-content-panel.mjs +4 -4
- package/fesm2022/koobiq-components-content-panel.mjs.map +1 -1
- package/fesm2022/koobiq-components-core.mjs +300 -37
- package/fesm2022/koobiq-components-core.mjs.map +1 -1
- package/fesm2022/koobiq-components-datepicker.mjs +151 -60
- package/fesm2022/koobiq-components-datepicker.mjs.map +1 -1
- package/fesm2022/koobiq-components-divider.mjs +3 -3
- package/fesm2022/koobiq-components-divider.mjs.map +1 -1
- package/fesm2022/koobiq-components-dropdown.mjs +3 -3
- package/fesm2022/koobiq-components-dropdown.mjs.map +1 -1
- package/fesm2022/koobiq-components-file-upload.mjs +17 -8
- package/fesm2022/koobiq-components-file-upload.mjs.map +1 -1
- package/fesm2022/koobiq-components-filter-bar.mjs +115 -36
- package/fesm2022/koobiq-components-filter-bar.mjs.map +1 -1
- package/fesm2022/koobiq-components-flag.mjs +3 -3
- package/fesm2022/koobiq-components-flag.mjs.map +1 -1
- package/fesm2022/koobiq-components-form-field.mjs +90 -27
- package/fesm2022/koobiq-components-form-field.mjs.map +1 -1
- package/fesm2022/koobiq-components-icon.mjs +2 -2
- package/fesm2022/koobiq-components-icon.mjs.map +1 -1
- package/fesm2022/koobiq-components-inline-edit.mjs +19 -2
- package/fesm2022/koobiq-components-inline-edit.mjs.map +1 -1
- package/fesm2022/koobiq-components-input.mjs +76 -17
- package/fesm2022/koobiq-components-input.mjs.map +1 -1
- package/fesm2022/koobiq-components-list.mjs +1 -1
- package/fesm2022/koobiq-components-list.mjs.map +1 -1
- package/fesm2022/koobiq-components-modal.mjs +3 -3
- package/fesm2022/koobiq-components-modal.mjs.map +1 -1
- package/fesm2022/koobiq-components-navbar.mjs +86 -25
- package/fesm2022/koobiq-components-navbar.mjs.map +1 -1
- package/fesm2022/koobiq-components-notification-center.mjs +4 -4
- package/fesm2022/koobiq-components-notification-center.mjs.map +1 -1
- package/fesm2022/koobiq-components-overflow-items.mjs +116 -38
- package/fesm2022/koobiq-components-overflow-items.mjs.map +1 -1
- package/fesm2022/koobiq-components-popover.mjs +86 -7
- package/fesm2022/koobiq-components-popover.mjs.map +1 -1
- package/fesm2022/koobiq-components-radio.mjs +41 -19
- package/fesm2022/koobiq-components-radio.mjs.map +1 -1
- package/fesm2022/koobiq-components-search-expandable.mjs +29 -17
- package/fesm2022/koobiq-components-search-expandable.mjs.map +1 -1
- package/fesm2022/koobiq-components-select.mjs +49 -12
- package/fesm2022/koobiq-components-select.mjs.map +1 -1
- package/fesm2022/koobiq-components-sidepanel.mjs +198 -186
- package/fesm2022/koobiq-components-sidepanel.mjs.map +1 -1
- package/fesm2022/koobiq-components-splitter.mjs +49 -25
- package/fesm2022/koobiq-components-splitter.mjs.map +1 -1
- package/fesm2022/koobiq-components-tabs.mjs +30 -11
- package/fesm2022/koobiq-components-tabs.mjs.map +1 -1
- package/fesm2022/koobiq-components-tags.mjs +1 -1
- package/fesm2022/koobiq-components-tags.mjs.map +1 -1
- package/fesm2022/koobiq-components-textarea.mjs +28 -11
- package/fesm2022/koobiq-components-textarea.mjs.map +1 -1
- package/fesm2022/koobiq-components-time-range.mjs +2 -2
- package/fesm2022/koobiq-components-time-range.mjs.map +1 -1
- package/fesm2022/koobiq-components-timepicker.mjs +71 -16
- package/fesm2022/koobiq-components-timepicker.mjs.map +1 -1
- package/fesm2022/koobiq-components-timezone.mjs +2 -2
- package/fesm2022/koobiq-components-timezone.mjs.map +1 -1
- package/fesm2022/koobiq-components-toast.mjs +2 -2
- package/fesm2022/koobiq-components-toast.mjs.map +1 -1
- package/fesm2022/koobiq-components-toggle.mjs +25 -9
- package/fesm2022/koobiq-components-toggle.mjs.map +1 -1
- package/fesm2022/koobiq-components-tooltip.mjs +90 -17
- package/fesm2022/koobiq-components-tooltip.mjs.map +1 -1
- package/fesm2022/koobiq-components-top-bar.mjs +27 -7
- package/fesm2022/koobiq-components-top-bar.mjs.map +1 -1
- package/fesm2022/koobiq-components-tree-select.mjs +4 -4
- package/fesm2022/koobiq-components-tree-select.mjs.map +1 -1
- package/fesm2022/koobiq-components-tree.mjs +71 -27
- package/fesm2022/koobiq-components-tree.mjs.map +1 -1
- package/file-upload/_file-upload-theme.scss +0 -12
- package/file-upload/file-upload-tokens.scss +0 -1
- package/file-upload/file-upload.scss +0 -1
- package/filter-bar/_filter-bar-theme.scss +7 -8
- package/filter-bar/filter-bar.scss +0 -1
- package/filter-bar/pipes/base-pipe.scss +36 -2
- package/filter-bar/pipes/pipe-multi-tree-select.scss +27 -0
- package/form-field/_fieldset-theme.scss +2 -7
- package/form-field/_form-field-theme.scss +9 -22
- package/form-field/_hint-theme.scss +20 -0
- package/form-field/fieldset-tokens.scss +0 -1
- package/form-field/fieldset.scss +0 -3
- package/form-field/form-field-tokens.scss +1 -1
- package/form-field/form-field.scss +9 -0
- package/form-field/hint-tokens.scss +3 -0
- package/modal/modal.scss +2 -0
- package/navbar/_navbar-item_vertical.scss +48 -2
- package/navbar/_navbar-theme.scss +11 -3
- package/navbar/navbar-item.scss +17 -0
- package/navbar/navbar-tokens.scss +3 -0
- package/package.json +4 -4
- package/popover/popover.scss +1 -1
- package/radio/_radio-theme.scss +0 -30
- package/radio/radio-tokens.scss +0 -2
- package/schematics/migrations/deprecated-icons/README.md +21 -5
- package/schematics/migrations/deprecated-icons/index.cjs +8 -22
- package/schematics/migrations/deprecated-icons/schema.json +1 -1
- package/schematics/migrations/icons-replacement/README.md +16 -2
- package/schematics/migrations/icons-replacement/index.cjs +18 -16
- package/schematics/migrations/icons-replacement/schema.json +12 -3
- package/schematics/migrations/new-icons-pack/README.md +37 -25
- package/schematics/migrations/new-icons-pack/index.cjs +22 -32
- package/schematics/migrations/new-icons-pack/replacement.json +2 -14
- package/schematics/migrations/new-icons-pack/schema.json +3 -3
- package/schematics/ng-add/index.cjs +4 -4
- package/schematics/utils/custom-data.cjs +64 -0
- package/schematics/utils/icon-migration.cjs +9 -3
- package/schematics/utils/messages.cjs +4 -0
- package/schematics/utils/package-config.cjs +19 -0
- package/select/select.scss +7 -0
- package/tabs/_tabs-common.scss +23 -0
- package/textarea/textarea-tokens.scss +4 -1
- package/toast/toast.component.scss +1 -0
- package/toggle/_toggle-theme.scss +0 -17
- package/tooltip/tooltip.scss +1 -1
- package/top-bar/top-bar-tokens.scss +1 -0
- package/top-bar/top-bar.scss +10 -0
- package/types/koobiq-components-accordion.d.ts +25 -0
- package/types/koobiq-components-button-toggle.d.ts +6 -0
- package/types/koobiq-components-checkbox.d.ts +30 -0
- package/types/koobiq-components-clamped-text.d.ts +16 -3
- package/types/koobiq-components-code-block.d.ts +17 -3
- package/types/koobiq-components-core.d.ts +226 -13
- package/types/koobiq-components-datepicker.d.ts +28 -1
- package/types/koobiq-components-divider.d.ts +28 -10
- package/types/koobiq-components-dropdown.d.ts +19 -0
- package/types/koobiq-components-filter-bar.d.ts +77 -4
- package/types/koobiq-components-flag.d.ts +18 -0
- package/types/koobiq-components-form-field.d.ts +87 -6
- package/types/koobiq-components-icon.d.ts +15 -0
- package/types/koobiq-components-inline-edit.d.ts +8 -1
- package/types/koobiq-components-input.d.ts +22 -3
- package/types/koobiq-components-list.d.ts +6 -0
- package/types/koobiq-components-modal.d.ts +7 -0
- package/types/koobiq-components-navbar.d.ts +71 -7
- package/types/koobiq-components-notification-center.d.ts +13 -0
- package/types/koobiq-components-overflow-items.d.ts +26 -2
- package/types/koobiq-components-popover.d.ts +38 -3
- package/types/koobiq-components-radio.d.ts +30 -0
- package/types/koobiq-components-search-expandable.d.ts +10 -0
- package/types/koobiq-components-select.d.ts +36 -4
- package/types/koobiq-components-sidepanel.d.ts +52 -1
- package/types/koobiq-components-splitter.d.ts +13 -4
- package/types/koobiq-components-tabs.d.ts +4 -0
- package/types/koobiq-components-tags.d.ts +6 -0
- package/types/koobiq-components-textarea.d.ts +9 -2
- package/types/koobiq-components-timepicker.d.ts +15 -0
- package/types/koobiq-components-toggle.d.ts +30 -0
- package/types/koobiq-components-tooltip.d.ts +55 -10
- package/types/koobiq-components-top-bar.d.ts +11 -3
- package/types/koobiq-components-tree-select.d.ts +12 -0
- package/types/koobiq-components-tree.d.ts +37 -2
|
@@ -5,13 +5,13 @@ import { SharedResizeObserver } from '@angular/cdk/observers/private';
|
|
|
5
5
|
import { Platform } from '@angular/cdk/platform';
|
|
6
6
|
import { DOCUMENT, NgTemplateOutlet } from '@angular/common';
|
|
7
7
|
import * as i0 from '@angular/core';
|
|
8
|
-
import {
|
|
8
|
+
import { isDevMode, Injectable, InjectionToken, inject, Renderer2, PendingTasks, signal, input, numberAttribute, booleanAttribute, computed, effect, SecurityContext, Directive, viewChild, contentChild, TemplateRef, linkedSignal, output, ElementRef, Injector, DestroyRef, afterEveryRender, untracked, ViewEncapsulation, ChangeDetectionStrategy, Component, NgModule } from '@angular/core';
|
|
9
9
|
import { takeUntilDestroyed, toObservable } from '@angular/core/rxjs-interop';
|
|
10
10
|
import { DomSanitizer } from '@angular/platform-browser';
|
|
11
11
|
import * as i3 from '@koobiq/components/button';
|
|
12
12
|
import { KbqButtonStyles, KbqButtonModule } from '@koobiq/components/button';
|
|
13
13
|
import * as i1 from '@koobiq/components/core';
|
|
14
|
-
import {
|
|
14
|
+
import { kbqInjectNativeElement, ruRULocaleData, kbqLocaleConfigurationOverrideProvider, kbqOptionalNumberAttribute, KbqLocaleOverridesDirective, KbqComponentColors, KBQ_WINDOW, KbqOverflowShadowContainer, KbqOverflowShadowTop } from '@koobiq/components/core';
|
|
15
15
|
import * as i6 from '@koobiq/components/icon';
|
|
16
16
|
import { KbqIconModule } from '@koobiq/components/icon';
|
|
17
17
|
import { KbqScrollbarViewport } from '@koobiq/components/scrollbar';
|
|
@@ -22,335 +22,6 @@ import { KbqToolTipModule } from '@koobiq/components/tooltip';
|
|
|
22
22
|
import { take, merge, fromEvent, map, debounceTime, filter } from 'rxjs';
|
|
23
23
|
import plaintext from 'highlight.js/lib/languages/plaintext';
|
|
24
24
|
|
|
25
|
-
/**
|
|
26
|
-
* The highlight.js line numbers plugin, kept apart from the code that calls it until code blocks number their lines
|
|
27
|
-
* on their own.
|
|
28
|
-
*
|
|
29
|
-
* This function is not intended for editing.
|
|
30
|
-
* Changes may lead to unpredictable behavior.
|
|
31
|
-
* Source code: https://github.com/wcoder/highlightjs-line-numbers.js/blob/v2.9.0/src/highlightjs-line-numbers.js
|
|
32
|
-
*
|
|
33
|
-
* @internal
|
|
34
|
-
*/
|
|
35
|
-
function highlightJSLineNumbersPlugin(d, w) {
|
|
36
|
-
'use strict';
|
|
37
|
-
if (!w)
|
|
38
|
-
return;
|
|
39
|
-
const TABLE_NAME = 'hljs-ln', LINE_NAME = 'hljs-ln-line', CODE_BLOCK_NAME = 'hljs-ln-code', NUMBERS_BLOCK_NAME = 'hljs-ln-numbers', NUMBER_LINE_NAME = 'hljs-ln-n', DATA_ATTR_NAME = 'data-line-number', BREAK_LINE_REGEXP = /\r\n|\r|\n/g;
|
|
40
|
-
if (w['hljs']) {
|
|
41
|
-
w['hljs'].initLineNumbersOnLoad = initLineNumbersOnLoad;
|
|
42
|
-
w['hljs'].lineNumbersBlock = lineNumbersBlock;
|
|
43
|
-
w['hljs'].lineNumbersBlockSync = lineNumbersBlockSync;
|
|
44
|
-
w['hljs'].lineNumbersValue = lineNumbersValue;
|
|
45
|
-
addStyles();
|
|
46
|
-
}
|
|
47
|
-
else {
|
|
48
|
-
// eslint-disable-next-line no-console
|
|
49
|
-
console.error('highlight.js not detected!');
|
|
50
|
-
}
|
|
51
|
-
function isHljsLnCodeDescendant(domElt) {
|
|
52
|
-
let curElt = domElt;
|
|
53
|
-
while (curElt) {
|
|
54
|
-
if (curElt.className && curElt.className.indexOf('hljs-ln-code') !== -1) {
|
|
55
|
-
return true;
|
|
56
|
-
}
|
|
57
|
-
curElt = curElt.parentNode;
|
|
58
|
-
}
|
|
59
|
-
return false;
|
|
60
|
-
}
|
|
61
|
-
function getHljsLnTable(hljsLnDomElt) {
|
|
62
|
-
let curElt = hljsLnDomElt;
|
|
63
|
-
while (curElt.nodeName !== 'TABLE') {
|
|
64
|
-
curElt = curElt.parentNode;
|
|
65
|
-
}
|
|
66
|
-
return curElt;
|
|
67
|
-
}
|
|
68
|
-
// Function to workaround a copy issue with Microsoft Edge.
|
|
69
|
-
// Due to hljs-ln wrapping the lines of code inside a <table> element,
|
|
70
|
-
// itself wrapped inside a <pre> element, window.getSelection().toString()
|
|
71
|
-
// does not contain any line breaks. So we need to get them back using the
|
|
72
|
-
// rendered code in the DOM as reference.
|
|
73
|
-
function edgeGetSelectedCodeLines(selection) {
|
|
74
|
-
// current selected text without line breaks
|
|
75
|
-
const selectionText = selection.toString();
|
|
76
|
-
// get the <td> element wrapping the first line of selected code
|
|
77
|
-
let tdAnchor = selection.anchorNode;
|
|
78
|
-
while (tdAnchor.nodeName !== 'TD') {
|
|
79
|
-
tdAnchor = tdAnchor.parentNode;
|
|
80
|
-
}
|
|
81
|
-
// get the <td> element wrapping the last line of selected code
|
|
82
|
-
let tdFocus = selection.focusNode;
|
|
83
|
-
while (tdFocus.nodeName !== 'TD') {
|
|
84
|
-
tdFocus = tdFocus.parentNode;
|
|
85
|
-
}
|
|
86
|
-
// extract line numbers
|
|
87
|
-
let firstLineNumber = parseInt(tdAnchor.dataset.lineNumber);
|
|
88
|
-
let lastLineNumber = parseInt(tdFocus.dataset.lineNumber);
|
|
89
|
-
// multi-lines copied case
|
|
90
|
-
if (firstLineNumber != lastLineNumber) {
|
|
91
|
-
let firstLineText = tdAnchor.textContent;
|
|
92
|
-
let lastLineText = tdFocus.textContent;
|
|
93
|
-
// if the selection was made backward, swap values
|
|
94
|
-
if (firstLineNumber > lastLineNumber) {
|
|
95
|
-
let tmp = firstLineNumber;
|
|
96
|
-
firstLineNumber = lastLineNumber;
|
|
97
|
-
lastLineNumber = tmp;
|
|
98
|
-
tmp = firstLineText;
|
|
99
|
-
firstLineText = lastLineText;
|
|
100
|
-
lastLineText = tmp;
|
|
101
|
-
}
|
|
102
|
-
// discard not copied characters in first line
|
|
103
|
-
while (selectionText.indexOf(firstLineText) !== 0) {
|
|
104
|
-
firstLineText = firstLineText.slice(1);
|
|
105
|
-
}
|
|
106
|
-
// discard not copied characters in last line
|
|
107
|
-
while (selectionText.lastIndexOf(lastLineText) === -1) {
|
|
108
|
-
lastLineText = lastLineText.slice(0, -1);
|
|
109
|
-
}
|
|
110
|
-
// reconstruct and return the real copied text
|
|
111
|
-
let selectedText = firstLineText;
|
|
112
|
-
const hljsLnTable = getHljsLnTable(tdAnchor);
|
|
113
|
-
for (let i = firstLineNumber + 1; i < lastLineNumber; ++i) {
|
|
114
|
-
const codeLineSel = format('.{0}[{1}="{2}"]', [CODE_BLOCK_NAME, DATA_ATTR_NAME, i]);
|
|
115
|
-
const codeLineElt = hljsLnTable.querySelector(codeLineSel);
|
|
116
|
-
selectedText += '\n' + codeLineElt.textContent;
|
|
117
|
-
}
|
|
118
|
-
selectedText += '\n' + lastLineText;
|
|
119
|
-
return selectedText;
|
|
120
|
-
// single copied line case
|
|
121
|
-
}
|
|
122
|
-
else {
|
|
123
|
-
return selectionText;
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
// ensure consistent code copy/paste behavior across all browsers
|
|
127
|
-
// (see https://github.com/wcoder/highlightjs-line-numbers.js/issues/51)
|
|
128
|
-
d.addEventListener('copy', function (e) {
|
|
129
|
-
// get current selection
|
|
130
|
-
const selection = w.getSelection();
|
|
131
|
-
// override behavior when one wants to copy line of codes
|
|
132
|
-
if (isHljsLnCodeDescendant(selection.anchorNode)) {
|
|
133
|
-
let selectionText;
|
|
134
|
-
// workaround an issue with Microsoft Edge as copied line breaks
|
|
135
|
-
// are removed otherwise from the selection string
|
|
136
|
-
if (w.navigator.userAgent.indexOf('Edge') !== -1) {
|
|
137
|
-
selectionText = edgeGetSelectedCodeLines(selection);
|
|
138
|
-
}
|
|
139
|
-
else {
|
|
140
|
-
// other browsers can directly use the selection string
|
|
141
|
-
selectionText = selection.toString();
|
|
142
|
-
}
|
|
143
|
-
e.clipboardData.setData('text/plain', selectionText);
|
|
144
|
-
e.preventDefault();
|
|
145
|
-
}
|
|
146
|
-
});
|
|
147
|
-
function addStyles() {
|
|
148
|
-
const css = d.createElement('style');
|
|
149
|
-
css.type = 'text/css';
|
|
150
|
-
css.innerHTML = format('.{0}{border-collapse:collapse}' + '.{0} td{padding:0}' + '.{1}:before{content:attr({2})}', [
|
|
151
|
-
TABLE_NAME,
|
|
152
|
-
NUMBER_LINE_NAME,
|
|
153
|
-
DATA_ATTR_NAME
|
|
154
|
-
]);
|
|
155
|
-
d.getElementsByTagName('head')[0].appendChild(css);
|
|
156
|
-
}
|
|
157
|
-
function initLineNumbersOnLoad(options) {
|
|
158
|
-
if (d.readyState === 'interactive' || d.readyState === 'complete') {
|
|
159
|
-
documentReady(options);
|
|
160
|
-
}
|
|
161
|
-
else {
|
|
162
|
-
w.addEventListener('DOMContentLoaded', function () {
|
|
163
|
-
documentReady(options);
|
|
164
|
-
});
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
function documentReady(options) {
|
|
168
|
-
try {
|
|
169
|
-
const blocks = d.querySelectorAll('code.hljs,code.nohighlight');
|
|
170
|
-
for (const i in blocks) {
|
|
171
|
-
if (blocks.hasOwnProperty(i)) {
|
|
172
|
-
if (!isPluginDisabledForBlock(blocks[i])) {
|
|
173
|
-
lineNumbersBlock(blocks[i], options);
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
}
|
|
177
|
-
}
|
|
178
|
-
catch (e) {
|
|
179
|
-
// eslint-disable-next-line no-console
|
|
180
|
-
console.error('LineNumbers error: ', e);
|
|
181
|
-
}
|
|
182
|
-
}
|
|
183
|
-
function isPluginDisabledForBlock(element) {
|
|
184
|
-
return element.classList.contains('nohljsln');
|
|
185
|
-
}
|
|
186
|
-
function lineNumbersBlock(element, options) {
|
|
187
|
-
if (typeof element !== 'object')
|
|
188
|
-
return;
|
|
189
|
-
async(function () {
|
|
190
|
-
element.innerHTML = lineNumbersInternal(element, options);
|
|
191
|
-
});
|
|
192
|
-
}
|
|
193
|
-
function lineNumbersBlockSync(element, options) {
|
|
194
|
-
if (typeof element !== 'object')
|
|
195
|
-
return;
|
|
196
|
-
element.innerHTML = lineNumbersInternal(element, options);
|
|
197
|
-
}
|
|
198
|
-
function lineNumbersValue(value, options) {
|
|
199
|
-
if (typeof value !== 'string')
|
|
200
|
-
return;
|
|
201
|
-
const element = d.createElement('code');
|
|
202
|
-
element.innerHTML = value;
|
|
203
|
-
return lineNumbersInternal(element, options);
|
|
204
|
-
}
|
|
205
|
-
function lineNumbersInternal(element, options) {
|
|
206
|
-
const internalOptions = mapOptions(element, options);
|
|
207
|
-
duplicateMultilineNodes(element);
|
|
208
|
-
return addLineNumbersBlockFor(element.innerHTML, internalOptions);
|
|
209
|
-
}
|
|
210
|
-
function addLineNumbersBlockFor(inputHtml, options) {
|
|
211
|
-
const lines = getLines(inputHtml);
|
|
212
|
-
// if last line contains only carriage return remove it
|
|
213
|
-
if (lines[lines.length - 1].trim() === '') {
|
|
214
|
-
lines.pop();
|
|
215
|
-
}
|
|
216
|
-
if (lines.length > 1 || options.singleLine) {
|
|
217
|
-
let html = '';
|
|
218
|
-
for (let i = 0, l = lines.length; i < l; i++) {
|
|
219
|
-
html += format('<tr>' +
|
|
220
|
-
'<td class="{0} {1}" {3}="{5}">' +
|
|
221
|
-
'<div class="{2}" {3}="{5}"></div>' +
|
|
222
|
-
'</td>' +
|
|
223
|
-
'<td class="{0} {4}" {3}="{5}">' +
|
|
224
|
-
'{6}' +
|
|
225
|
-
'</td>' +
|
|
226
|
-
'</tr>', [
|
|
227
|
-
LINE_NAME,
|
|
228
|
-
NUMBERS_BLOCK_NAME,
|
|
229
|
-
NUMBER_LINE_NAME,
|
|
230
|
-
DATA_ATTR_NAME,
|
|
231
|
-
CODE_BLOCK_NAME,
|
|
232
|
-
i + options.startFrom,
|
|
233
|
-
lines[i].length > 0 ? lines[i] : ' '
|
|
234
|
-
]);
|
|
235
|
-
}
|
|
236
|
-
return format('<table class="{0}">{1}</table>', [TABLE_NAME, html]);
|
|
237
|
-
}
|
|
238
|
-
return inputHtml;
|
|
239
|
-
}
|
|
240
|
-
/**
|
|
241
|
-
* @param {HTMLElement} element Code block.
|
|
242
|
-
* @param {Object} options External API options.
|
|
243
|
-
* @returns {Object} Internal API options.
|
|
244
|
-
*/
|
|
245
|
-
function mapOptions(element, options) {
|
|
246
|
-
options = options || {};
|
|
247
|
-
return {
|
|
248
|
-
singleLine: getSingleLineOption(options),
|
|
249
|
-
startFrom: getStartFromOption(element, options)
|
|
250
|
-
};
|
|
251
|
-
}
|
|
252
|
-
function getSingleLineOption(options) {
|
|
253
|
-
const defaultValue = false;
|
|
254
|
-
if (options.singleLine) {
|
|
255
|
-
return options.singleLine;
|
|
256
|
-
}
|
|
257
|
-
return defaultValue;
|
|
258
|
-
}
|
|
259
|
-
function getStartFromOption(element, options) {
|
|
260
|
-
const defaultValue = 1;
|
|
261
|
-
let startFrom = defaultValue;
|
|
262
|
-
if (isFinite(options.startFrom)) {
|
|
263
|
-
startFrom = options.startFrom;
|
|
264
|
-
}
|
|
265
|
-
// can be overridden because local option is priority
|
|
266
|
-
const value = getAttribute(element, 'data-ln-start-from');
|
|
267
|
-
if (value !== null) {
|
|
268
|
-
startFrom = toNumber(value, defaultValue);
|
|
269
|
-
}
|
|
270
|
-
return startFrom;
|
|
271
|
-
}
|
|
272
|
-
/**
|
|
273
|
-
* Recursive method for fix multi-line elements implementation in highlight.js
|
|
274
|
-
* Doing deep passage on child nodes.
|
|
275
|
-
* @param {HTMLElement} element
|
|
276
|
-
*/
|
|
277
|
-
function duplicateMultilineNodes(element) {
|
|
278
|
-
const nodes = element.childNodes;
|
|
279
|
-
for (const node in nodes) {
|
|
280
|
-
if (nodes.hasOwnProperty(node)) {
|
|
281
|
-
const child = nodes[node];
|
|
282
|
-
if (getLinesCount(child.textContent) > 0) {
|
|
283
|
-
if (child.childNodes.length > 0) {
|
|
284
|
-
duplicateMultilineNodes(child);
|
|
285
|
-
}
|
|
286
|
-
else {
|
|
287
|
-
duplicateMultilineNode(child.parentNode);
|
|
288
|
-
}
|
|
289
|
-
}
|
|
290
|
-
}
|
|
291
|
-
}
|
|
292
|
-
}
|
|
293
|
-
/**
|
|
294
|
-
* Method for fix multi-line elements implementation in highlight.js
|
|
295
|
-
* @param {HTMLElement} element
|
|
296
|
-
*/
|
|
297
|
-
function duplicateMultilineNode(element) {
|
|
298
|
-
const className = element.className;
|
|
299
|
-
if (!/hljs-/.test(className))
|
|
300
|
-
return;
|
|
301
|
-
const lines = getLines(element.innerHTML);
|
|
302
|
-
let result = '';
|
|
303
|
-
for (let i = 0; i < lines.length; i++) {
|
|
304
|
-
const lineText = lines[i].length > 0 ? lines[i] : ' ';
|
|
305
|
-
result += format('<span class="{0}">{1}</span>\n', [className, lineText]);
|
|
306
|
-
}
|
|
307
|
-
element.innerHTML = result.trim();
|
|
308
|
-
}
|
|
309
|
-
function getLines(text) {
|
|
310
|
-
if (text.length === 0)
|
|
311
|
-
return [];
|
|
312
|
-
return text.split(BREAK_LINE_REGEXP);
|
|
313
|
-
}
|
|
314
|
-
function getLinesCount(text) {
|
|
315
|
-
return (text.trim().match(BREAK_LINE_REGEXP) || []).length;
|
|
316
|
-
}
|
|
317
|
-
///
|
|
318
|
-
/// HELPERS
|
|
319
|
-
///
|
|
320
|
-
function async(func) {
|
|
321
|
-
w.setTimeout(func, 0);
|
|
322
|
-
}
|
|
323
|
-
/**
|
|
324
|
-
* {@link https://wcoder.github.io/notes/string-format-for-string-formating-in-javascript}
|
|
325
|
-
* @param {string} format
|
|
326
|
-
* @param {array} args
|
|
327
|
-
*/
|
|
328
|
-
function format(format, args) {
|
|
329
|
-
return format.replace(/\{(\d+)\}/g, function (m, n) {
|
|
330
|
-
return args[n] !== undefined ? args[n] : m;
|
|
331
|
-
});
|
|
332
|
-
}
|
|
333
|
-
/**
|
|
334
|
-
* @param {HTMLElement} element Code block.
|
|
335
|
-
* @param {String} attrName Attribute name.
|
|
336
|
-
* @returns {String} Attribute value or empty.
|
|
337
|
-
*/
|
|
338
|
-
function getAttribute(element, attrName) {
|
|
339
|
-
return element.hasAttribute(attrName) ? element.getAttribute(attrName) : null;
|
|
340
|
-
}
|
|
341
|
-
/**
|
|
342
|
-
* @param {String} str Source string.
|
|
343
|
-
* @param {Number} fallback Fallback value.
|
|
344
|
-
* @returns Parsed number or fallback value.
|
|
345
|
-
*/
|
|
346
|
-
function toNumber(str, fallback) {
|
|
347
|
-
if (!str)
|
|
348
|
-
return fallback;
|
|
349
|
-
const number = Number(str);
|
|
350
|
-
return isFinite(number) ? number : fallback;
|
|
351
|
-
}
|
|
352
|
-
}
|
|
353
|
-
|
|
354
25
|
// The core and not the full bundle: a bundler emits a chunk for every `import()` it finds, called or not, so the
|
|
355
26
|
// full bundle has to be imported by the application that asks for it. An instance of its own, as the module is one
|
|
356
27
|
// object for the whole process, the full bundle included: the languages one configuration registers on it would reach
|
|
@@ -367,7 +38,7 @@ const DEFAULT_CONFIG = {};
|
|
|
367
38
|
*/
|
|
368
39
|
const PLAIN_TEXT_LANGUAGE = 'plaintext';
|
|
369
40
|
/**
|
|
370
|
-
* Loads highlight.js once per configuration
|
|
41
|
+
* Loads highlight.js once per configuration.
|
|
371
42
|
*
|
|
372
43
|
* The configuration is passed in rather than injected: `KBQ_CODE_BLOCK_HIGHLIGHT_JS_CONFIG` may be provided by a
|
|
373
44
|
* component or a route, where a root service would not see it. Loads are shared by the identity of the configuration,
|
|
@@ -377,12 +48,9 @@ const PLAIN_TEXT_LANGUAGE = 'plaintext';
|
|
|
377
48
|
*/
|
|
378
49
|
class KbqCodeBlockHighlightJsLoader {
|
|
379
50
|
constructor() {
|
|
380
|
-
this.document = inject(DOCUMENT);
|
|
381
|
-
this.window = inject(KBQ_WINDOW);
|
|
382
51
|
// Weak, so that a configuration made for one component instance goes away with it.
|
|
383
52
|
this.loads = new WeakMap();
|
|
384
53
|
this.instances = new WeakMap();
|
|
385
|
-
this.lineNumbers = null;
|
|
386
54
|
}
|
|
387
55
|
/** The instance loaded for `config`, or `null` until it is. */
|
|
388
56
|
loaded(config) {
|
|
@@ -411,11 +79,6 @@ class KbqCodeBlockHighlightJsLoader {
|
|
|
411
79
|
}
|
|
412
80
|
return loading;
|
|
413
81
|
}
|
|
414
|
-
/** Wraps highlighted markup in the line numbers table. */
|
|
415
|
-
addLineNumbers(html, options) {
|
|
416
|
-
// The plugin cannot take empty markup: it reads the last of no lines.
|
|
417
|
-
return html ? this.lineNumbersPlugin().lineNumbersValue(html, options) : html;
|
|
418
|
-
}
|
|
419
82
|
async importInstance({ core, languages = {} }) {
|
|
420
83
|
const entries = Object.entries(languages);
|
|
421
84
|
// The languages do not need the core to load, so they load alongside it.
|
|
@@ -430,28 +93,6 @@ class KbqCodeBlockHighlightJsLoader {
|
|
|
430
93
|
instance.registerLanguage(PLAIN_TEXT_LANGUAGE, plaintext);
|
|
431
94
|
return instance;
|
|
432
95
|
}
|
|
433
|
-
/**
|
|
434
|
-
* The plugin appends a `<style>` to `<head>` and registers a document `copy` listener, and removes neither, so it
|
|
435
|
-
* is installed once, for the lifetime of the application.
|
|
436
|
-
*/
|
|
437
|
-
lineNumbersPlugin() {
|
|
438
|
-
if (!this.lineNumbers) {
|
|
439
|
-
const window = this.window;
|
|
440
|
-
// The plugin attaches its API to `w.hljs` and reads nothing else from `w` but the selection and the user
|
|
441
|
-
// agent. A host of its own keeps the plugin off the highlight.js module, which every server render in the
|
|
442
|
-
// process shares, and off the global `window.hljs`.
|
|
443
|
-
const host = {
|
|
444
|
-
hljs: {},
|
|
445
|
-
getSelection: () => window.getSelection(),
|
|
446
|
-
get navigator() {
|
|
447
|
-
return window.navigator;
|
|
448
|
-
}
|
|
449
|
-
};
|
|
450
|
-
highlightJSLineNumbersPlugin(this.document, host);
|
|
451
|
-
this.lineNumbers = host.hljs;
|
|
452
|
-
}
|
|
453
|
-
return this.lineNumbers;
|
|
454
|
-
}
|
|
455
96
|
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: KbqCodeBlockHighlightJsLoader, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
456
97
|
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: KbqCodeBlockHighlightJsLoader, providedIn: 'root' }); }
|
|
457
98
|
}
|
|
@@ -503,6 +144,7 @@ const kbqCodeBlockFallbackFileLanguageProvider = (language) => ({
|
|
|
503
144
|
* highlight.js sets on the elements it highlights itself.
|
|
504
145
|
*/
|
|
505
146
|
const HIGHLIGHTED_MARKUP_ATTRIBUTE = 'data-highlighted-markup';
|
|
147
|
+
const LINE_BREAK = /\r\n|\r|\n/;
|
|
506
148
|
/**
|
|
507
149
|
* Directive which applies syntax highlighting to the code block content.
|
|
508
150
|
*
|
|
@@ -528,18 +170,21 @@ class KbqCodeBlockHighlight {
|
|
|
528
170
|
/** The code file. */
|
|
529
171
|
this.file = input.required(...(ngDevMode ? [{ debugName: "file" }] : /* istanbul ignore next */ []));
|
|
530
172
|
/** The starting line number. */
|
|
531
|
-
this.startFrom = input(1, { ...(ngDevMode ? { debugName: "startFrom" } : /* istanbul ignore next */ {}), transform: numberAttribute });
|
|
173
|
+
this.startFrom = input(1, { ...(ngDevMode ? { debugName: "startFrom" } : /* istanbul ignore next */ {}), transform: (value) => numberAttribute(value, 1) });
|
|
532
174
|
/** Whether to display line numbers for single line code block. */
|
|
533
175
|
this.singleLine = input(false, { ...(ngDevMode ? { debugName: "singleLine" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
176
|
+
/** Number of lines of the file, a line break at its end not counted, as it starts no line. */
|
|
177
|
+
this.lineCount = computed(() => {
|
|
178
|
+
const lines = this.file().content.split(LINE_BREAK);
|
|
179
|
+
return lines.length > 1 && !lines[lines.length - 1] ? lines.length - 1 : lines.length;
|
|
180
|
+
}, ...(ngDevMode ? [{ debugName: "lineCount" }] : /* istanbul ignore next */ []));
|
|
181
|
+
/** Width of the line numbers column, in digits of its largest number. */
|
|
182
|
+
this.lineNumberDigits = computed(() => String(this.startFrom() + this.lineCount() - 1).length, ...(ngDevMode ? [{ debugName: "lineNumberDigits" }] : /* istanbul ignore next */ []));
|
|
534
183
|
effect((onCleanup) => {
|
|
535
184
|
const file = this.file();
|
|
536
|
-
// Captured here rather than read inside `highlight()`: on the load path that read happens in a
|
|
537
|
-
// microtask, where nothing is tracked, so the effect's dependencies would otherwise depend on
|
|
538
|
-
// which branch had run before.
|
|
539
|
-
const lineNumbers = { startFrom: this.startFrom(), singleLine: this.singleLine() };
|
|
540
185
|
const hljs = this.loader.loaded(this.config);
|
|
541
186
|
if (hljs) {
|
|
542
|
-
this.highlight(hljs, file
|
|
187
|
+
this.highlight(hljs, file);
|
|
543
188
|
return;
|
|
544
189
|
}
|
|
545
190
|
// The template leaves `<code>` empty, so that hydration does not look for a text node the highlighted
|
|
@@ -568,7 +213,7 @@ class KbqCodeBlockHighlight {
|
|
|
568
213
|
.load(this.config)
|
|
569
214
|
.then((loaded) => {
|
|
570
215
|
if (loaded && !cancelled)
|
|
571
|
-
this.highlight(loaded, file
|
|
216
|
+
this.highlight(loaded, file);
|
|
572
217
|
})
|
|
573
218
|
.finally(() => {
|
|
574
219
|
// A run cancelled by a newer file leaves `pending` to that one.
|
|
@@ -578,7 +223,7 @@ class KbqCodeBlockHighlight {
|
|
|
578
223
|
});
|
|
579
224
|
});
|
|
580
225
|
}
|
|
581
|
-
highlight(hljs, file
|
|
226
|
+
highlight(hljs, file) {
|
|
582
227
|
this._pending.set(true);
|
|
583
228
|
let { language } = file;
|
|
584
229
|
const isKnownLanguage = !!language && !!hljs.getLanguage(language);
|
|
@@ -600,13 +245,47 @@ class KbqCodeBlockHighlight {
|
|
|
600
245
|
if (relevance === 0 && isKnownLanguage && !isPlainText && file.content.trim()) {
|
|
601
246
|
this.warn('[KbqCodeBlock] File content does not match the specified programming language.', file);
|
|
602
247
|
}
|
|
603
|
-
const safeHTML = this.domSanitizer.sanitize(SecurityContext.HTML, highlightedHTML) ?? '';
|
|
604
|
-
const highlightedHTMLWithLineNumbers = this.loader.addLineNumbers(safeHTML, lineNumbers);
|
|
248
|
+
const safeHTML = this.domSanitizer.sanitize(SecurityContext.HTML, this.splitIntoLines(highlightedHTML)) ?? '';
|
|
605
249
|
this.renderer.setAttribute(this.nativeElement, 'data-language', highlightedLanguage);
|
|
606
|
-
this.renderer.setProperty(this.nativeElement, 'innerHTML',
|
|
250
|
+
this.renderer.setProperty(this.nativeElement, 'innerHTML', safeHTML);
|
|
607
251
|
this.renderer.setAttribute(this.nativeElement, HIGHLIGHTED_MARKUP_ATTRIBUTE, '');
|
|
608
252
|
this._pending.set(false);
|
|
609
253
|
}
|
|
254
|
+
/**
|
|
255
|
+
* Wraps every line of the highlighted markup in an element of its own, for the line numbers to count. The spans a
|
|
256
|
+
* line break crosses are closed at the end of its line and opened again on the next one. The line break stays
|
|
257
|
+
* inside its line, so that an empty line keeps its height and the text of the code is the text of the file.
|
|
258
|
+
*/
|
|
259
|
+
splitIntoLines(html) {
|
|
260
|
+
const lines = [];
|
|
261
|
+
const openSpans = [];
|
|
262
|
+
let line = '';
|
|
263
|
+
let lineHasText = false;
|
|
264
|
+
// highlight.js emits spans and escaped text. A tag of another kind, which a plugin of highlight.js may add,
|
|
265
|
+
// passes through as it is.
|
|
266
|
+
for (const [token, lineBreak] of html.matchAll(/(\r\n|\r|\n)|<span[^>]*>|<\/span>|<[^>]*>|[^<\r\n]+/g)) {
|
|
267
|
+
if (lineBreak) {
|
|
268
|
+
lines.push(`${line}${'</span>'.repeat(openSpans.length)}\n`);
|
|
269
|
+
line = openSpans.join('');
|
|
270
|
+
lineHasText = false;
|
|
271
|
+
continue;
|
|
272
|
+
}
|
|
273
|
+
if (token === '</span>') {
|
|
274
|
+
openSpans.pop();
|
|
275
|
+
}
|
|
276
|
+
else if (token.startsWith('<span')) {
|
|
277
|
+
openSpans.push(token);
|
|
278
|
+
}
|
|
279
|
+
else if (!token.startsWith('<')) {
|
|
280
|
+
lineHasText = true;
|
|
281
|
+
}
|
|
282
|
+
line += token;
|
|
283
|
+
}
|
|
284
|
+
// A line break at the end of the file starts no line, though the spans it crosses close after it.
|
|
285
|
+
if (lineHasText)
|
|
286
|
+
lines.push(line);
|
|
287
|
+
return lines.map((content) => `<span class="kbq-code-block__line">${content}</span>`).join('');
|
|
288
|
+
}
|
|
610
289
|
/** The fallback language, or plain text, which the loader registers on every instance, if it is unknown too. */
|
|
611
290
|
fallbackLanguage(hljs) {
|
|
612
291
|
if (hljs.getLanguage(this.fallbackFileLanguage))
|
|
@@ -621,14 +300,19 @@ class KbqCodeBlockHighlight {
|
|
|
621
300
|
console.warn(...messages);
|
|
622
301
|
}
|
|
623
302
|
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: KbqCodeBlockHighlight, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
624
|
-
/** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.25", type: KbqCodeBlockHighlight, isStandalone: true, selector: "code[kbqCodeBlockHighlight]", inputs: { file: { classPropertyName: "file", publicName: "file", isSignal: true, isRequired: true, transformFunction: null }, startFrom: { classPropertyName: "startFrom", publicName: "startFrom", isSignal: true, isRequired: false, transformFunction: null }, singleLine: { classPropertyName: "singleLine", publicName: "singleLine", isSignal: true, isRequired: false, transformFunction: null } }, host: { classAttribute: "hljs" }, exportAs: ["kbqCodeBlockHighlight"], ngImport: i0 }); }
|
|
303
|
+
/** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.25", type: KbqCodeBlockHighlight, isStandalone: true, selector: "code[kbqCodeBlockHighlight]", inputs: { file: { classPropertyName: "file", publicName: "file", isSignal: true, isRequired: true, transformFunction: null }, startFrom: { classPropertyName: "startFrom", publicName: "startFrom", isSignal: true, isRequired: false, transformFunction: null }, singleLine: { classPropertyName: "singleLine", publicName: "singleLine", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class.kbq-code-block__code_line-numbers": "lineCount() > 1 || singleLine()", "style.--kbq-code-block-line-numbers-start": "startFrom() - 1", "style.--kbq-code-block-line-numbers-digits": "lineNumberDigits()" }, classAttribute: "hljs" }, exportAs: ["kbqCodeBlockHighlight"], ngImport: i0 }); }
|
|
625
304
|
}
|
|
626
305
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: KbqCodeBlockHighlight, decorators: [{
|
|
627
306
|
type: Directive,
|
|
628
307
|
args: [{
|
|
629
308
|
selector: 'code[kbqCodeBlockHighlight]',
|
|
630
309
|
host: {
|
|
631
|
-
class: 'hljs'
|
|
310
|
+
class: 'hljs',
|
|
311
|
+
// Bound to the file rather than to the highlighted markup, so that markup kept from the server is numbered
|
|
312
|
+
// before highlight.js loads again.
|
|
313
|
+
'[class.kbq-code-block__code_line-numbers]': 'lineCount() > 1 || singleLine()',
|
|
314
|
+
'[style.--kbq-code-block-line-numbers-start]': 'startFrom() - 1',
|
|
315
|
+
'[style.--kbq-code-block-line-numbers-digits]': 'lineNumberDigits()'
|
|
632
316
|
},
|
|
633
317
|
exportAs: 'kbqCodeBlockHighlight'
|
|
634
318
|
}]
|
|
@@ -696,8 +380,8 @@ class KbqCodeBlock {
|
|
|
696
380
|
this.contentExceedsMaxHeight = signal(undefined, ...(ngDevMode ? [{ debugName: "contentExceedsMaxHeight" }] : /* istanbul ignore next */ []));
|
|
697
381
|
/** @docs-private */
|
|
698
382
|
this.tabLinkTemplate = contentChild(KbqCodeBlockTabLinkContent, { ...(ngDevMode ? { debugName: "tabLinkTemplate" } : /* istanbul ignore next */ {}), read: TemplateRef });
|
|
699
|
-
/** Whether to display line numbers. */
|
|
700
|
-
this.lineNumbers = input(false, { ...(ngDevMode ? { debugName: "lineNumbers" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
383
|
+
/** Whether to display line numbers. Defaults to `lineNumbers` of `KBQ_CODE_BLOCK_DEFAULT_OPTIONS`, or `false`. */
|
|
384
|
+
this.lineNumbers = input(this.defaultOptions?.lineNumbers ?? false, { ...(ngDevMode ? { debugName: "lineNumbers" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
701
385
|
/** Whether the code block should be filled. */
|
|
702
386
|
this.filled = input(false, { ...(ngDevMode ? { debugName: "filled" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
703
387
|
/** Added soft wrap toggle button. */
|
|
@@ -1102,7 +786,7 @@ class KbqCodeBlock {
|
|
|
1102
786
|
link.click();
|
|
1103
787
|
}
|
|
1104
788
|
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: KbqCodeBlock, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1105
|
-
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.25", type: KbqCodeBlock, isStandalone: true, selector: "kbq-code-block", inputs: { lineNumbers: { classPropertyName: "lineNumbers", publicName: "lineNumbers", isSignal: true, isRequired: false, transformFunction: null }, filled: { classPropertyName: "filled", publicName: "filled", isSignal: true, isRequired: false, transformFunction: null }, canToggleSoftWrap: { classPropertyName: "canToggleSoftWrap", publicName: "canToggleSoftWrap", isSignal: true, isRequired: false, transformFunction: null }, softWrapInput: { classPropertyName: "softWrapInput", publicName: "softWrap", isSignal: true, isRequired: false, transformFunction: null }, viewAllInput: { classPropertyName: "viewAllInput", publicName: "viewAll", isSignal: true, isRequired: false, transformFunction: null }, maxHeight: { classPropertyName: "maxHeight", publicName: "maxHeight", isSignal: true, isRequired: false, transformFunction: null }, canDownloadInput: { classPropertyName: "canDownloadInput", publicName: "canDownload", isSignal: true, isRequired: false, transformFunction: null }, canCopy: { classPropertyName: "canCopy", publicName: "canCopy", isSignal: true, isRequired: false, transformFunction: null }, alwaysShowActionbar: { classPropertyName: "alwaysShowActionbar", publicName: "alwaysShowActionbar", isSignal: true, isRequired: false, transformFunction: null }, filesInput: { classPropertyName: "filesInput", publicName: "files", isSignal: true, isRequired: false, transformFunction: null }, activeFileIndexInput: { classPropertyName: "activeFileIndexInput", publicName: "activeFileIndex", isSignal: true, isRequired: false, transformFunction: null }, noBorder: { classPropertyName: "noBorder", publicName: "noBorder", isSignal: true, isRequired: false, transformFunction: null }, hideTabsInput: { classPropertyName: "hideTabsInput", publicName: "hideTabs", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { softWrapChange: "softWrapChange", viewAllChange: "viewAllChange", activeFileIndexChange: "activeFileIndexChange", hideTabsChange: "hideTabsChange" }, host: { properties: { "class.kbq-code-block_filled": "filled()", "class.kbq-code-block_outline": "!filled()", "class.kbq-code-block_hide-line-numbers": "!lineNumbers()", "class.kbq-code-block_hide-tabs": "tabsHidden()", "class.kbq-code-block_no-border": "noBorder() || filled()", "class.kbq-code-block_show-actionbar": "actionbarVisible()", "class.kbq-code-block_soft-wrap": "softWrap()", "class.kbq-code-block_view-all": "viewAll()" }, classAttribute: "kbq-code-block" }, queries: [{ propertyName: "tabLinkTemplate", first: true, predicate: KbqCodeBlockTabLinkContent, descendants: true, read: TemplateRef, isSignal: true }], viewQueries: [{ propertyName: "copyButtonTooltip", first: true, predicate: ["copyButtonTooltip"], descendants: true, isSignal: true }, { propertyName: "highlight", first: true, predicate: KbqCodeBlockHighlight, descendants: true, isSignal: true }, { propertyName: "scrollbarViewport", first: true, predicate: KbqScrollbarViewport, descendants: true, isSignal: true }, { propertyName: "preElementRef", first: true, predicate: ["codeBlockPre"], descendants: true, isSignal: true }, { propertyName: "codeElementRef", first: true, predicate: ["codeBlockCode"], descendants: true, isSignal: true }], exportAs: ["kbqCodeBlock"], hostDirectives: [{ directive: i1.KbqLocaleOverridesDirective, inputs: ["kbqLocaleOverrides", "localeOverrides"] }], ngImport: i0, template: "<div class=\"kbq-code-block__header\" [kbqOverflowShadowTop]=\"codeBlockContent\">\n @if (!tabsHidden()) {\n <div class=\"kbq-code-block__header-tabs\">\n <div kbqTabNavBar transparent [tabNavPanel]=\"tabPanel\">\n @for (file of files(); track file) {\n <!-- Mark tab-link as readonly if only single file present -->\n <div\n kbqTabLink\n [active]=\"$count > 1 && renderedFileIndex() === $index\"\n [style.pointer-events]=\"$count === 1 ? 'none' : null\"\n (click)=\"onSelectedTabChange($index)\"\n >\n @if (tabLinkTemplate(); as linkTemplate) {\n <ng-container\n *ngTemplateOutlet=\"linkTemplate; context: { $implicit: file, fallbackFileName }\"\n />\n } @else {\n {{ file.filename || fallbackFileName }}\n }\n </div>\n }\n </div>\n </div>\n }\n\n <div class=\"kbq-code-block__actionbar\">\n <div class=\"kbq-code-block__actionbar__button-stack\">\n @if (canToggleSoftWrap()) {\n <button\n kbq-button\n class=\"kbq-code-block__actionbar__soft-wrap-button\"\n [attr.aria-label]=\"\n softWrap() ? localeConfiguration().softWrapOffTooltip : localeConfiguration().softWrapOnTooltip\n \"\n [color]=\"componentColor.Contrast\"\n [kbqStyle]=\"buttonStyle.Transparent\"\n [kbqTooltip]=\"\n softWrap() ? localeConfiguration().softWrapOffTooltip : localeConfiguration().softWrapOnTooltip\n \"\n (click)=\"toggleSoftWrap()\"\n >\n @if (softWrap()) {\n <i kbq-icon=\"kbq-text-overflow_16\"></i>\n } @else {\n <i kbq-icon=\"kbq-text-wrap_16\"></i>\n }\n </button>\n }\n\n @if (canDownload()) {\n <button\n kbq-button\n class=\"kbq-code-block__actionbar__download-button\"\n [attr.aria-label]=\"localeConfiguration().downloadTooltip\"\n [color]=\"componentColor.Contrast\"\n [kbqStyle]=\"buttonStyle.Transparent\"\n [kbqTooltip]=\"localeConfiguration().downloadTooltip\"\n (click)=\"downloadCode()\"\n >\n <i kbq-icon=\"kbq-arrow-down-to-line_16\"></i>\n </button>\n }\n\n @if (canCopy()) {\n <div #copyButtonTooltip=\"kbqTooltip\" [kbqTooltip]=\"localeConfiguration().copyTooltip\">\n <button\n kbq-button\n class=\"kbq-code-block__actionbar__copy-button\"\n [attr.aria-label]=\"localeConfiguration().copyTooltip\"\n [color]=\"componentColor.Contrast\"\n [kbqStyle]=\"buttonStyle.Transparent\"\n (click)=\"copyCode()\"\n >\n <i kbq-icon=\"kbq-file-multiple-o_16\"></i>\n </button>\n </div>\n }\n\n @if (activeFile()?.link) {\n <button\n kbq-button\n class=\"kbq-code-block__actionbar__link-button\"\n [attr.aria-label]=\"localeConfiguration().openExternalSystemTooltip\"\n [color]=\"componentColor.Contrast\"\n [kbqStyle]=\"buttonStyle.Transparent\"\n [kbqTooltip]=\"localeConfiguration().openExternalSystemTooltip\"\n (click)=\"openLink()\"\n >\n <i kbq-icon=\"kbq-arrow-up-right-from-square_16\"></i>\n </button>\n }\n </div>\n </div>\n</div>\n\n<div\n #tabPanel=\"kbqTabNavPanel\"\n #codeBlockContent=\"kbqOverflowShadowContainer\"\n cdkMonitorElementFocus\n kbqOverflowShadowContainer\n kbqScrollbarViewport\n kbqTabNavPanel\n class=\"kbq-code-block__main\"\n tabindex=\"0\"\n [style.max-height.px]=\"calculatedMaxHeight()\"\n>\n @if (activeFile(); as file) {\n <pre\n #codeBlockPre\n class=\"kbq-code-block__pre\"\n ><code #codeBlockCode kbqCodeBlockHighlight class=\"kbq-code-block__code\" [file]=\"file\"></code></pre>\n }\n\n @if (contentExceedsMaxHeight()) {\n <div\n class=\"kbq-code-block__view-all\"\n [class.kbq-code-block__view-all_collapsed]=\"!viewAll()\"\n [class.kbq-code-block__view-all_expanded]=\"viewAll()\"\n >\n <div class=\"kbq-code-block__view-all__wrapper\">\n <button\n kbq-button\n class=\"kbq-code-block__view-all__button\"\n [color]=\"componentColor.Theme\"\n [kbqStyle]=\"buttonStyle.Transparent\"\n (click)=\"toggleViewAll()\"\n (keydown.enter)=\"onViewAllEnterKeydown($event)\"\n >\n @if (viewAll()) {\n <i kbq-icon=\"kbq-chevron-up_16\"></i>\n {{ localeConfiguration().viewLessText }}\n } @else {\n <i kbq-icon=\"kbq-chevron-down_16\"></i>\n {{ localeConfiguration().viewAllText }}\n }\n </button>\n </div>\n </div>\n }\n</div>\n", styles: [".kbq-code-block{display:flex;flex-direction:column;position:relative;border-width:var(--kbq-code-block-size-container-border-width);border-style:solid;border-radius:var(--kbq-code-block-size-container-border-radius)}@supports (corner-shape: squircle){.kbq-code-block{corner-shape:squircle;border-radius:clamp(var(--kbq-code-block-size-container-border-radius) * 1.85,var(--kbq-code-block-size-container-border-radius) * 2.3 - 3.6px,var(--kbq-code-block-size-container-border-radius) * 2)}}.kbq-code-block{box-sizing:border-box;hyphens:none;-ms-hyphens:none;-moz-hyphens:none;-webkit-hyphens:none}.kbq-code-block .kbq-code-block__header{display:flex;align-items:center;padding:var(--kbq-size-s) var(--kbq-size-m)}.kbq-code-block .kbq-code-block__header .kbq-code-block__header-tabs{overflow:hidden;flex-grow:1}.kbq-code-block .kbq-code-block__actionbar{display:flex;justify-content:right;align-items:center;z-index:1}.kbq-code-block .kbq-code-block__actionbar .kbq-code-block__actionbar__button-stack{display:flex;gap:var(--kbq-code-block-size-actionbar-content-gap-horizontal)}.kbq-code-block:has(.kbq-code-block__view-all) .kbq-code-block__main .kbq-code-block__code{padding-bottom:var(--kbq-size-3xl)!important}.kbq-code-block .kbq-code-block__main{flex-grow:1;flex-direction:column;border-radius:var(--kbq-code-block-size-container-border-radius)}@supports (corner-shape: squircle){.kbq-code-block .kbq-code-block__main{corner-shape:squircle;border-radius:clamp(var(--kbq-code-block-size-container-border-radius) * 1.85,var(--kbq-code-block-size-container-border-radius) * 2.3 - 3.6px,var(--kbq-code-block-size-container-border-radius) * 2)}}.kbq-code-block .kbq-code-block__main.cdk-keyboard-focused{outline-style:solid;outline-width:var(--kbq-code-block-size-container-border-width-focused);outline-offset:-1px}.kbq-code-block .kbq-code-block__main .kbq-code-block__pre{margin:0;flex-grow:1}.kbq-code-block .kbq-code-block__main .kbq-code-block__code{tab-size:var(--kbq-code-block-tab-size);padding:var(--kbq-code-block-size-with-header-content-padding-top) var(--kbq-code-block-size-with-header-content-padding-horizontal) var(--kbq-code-block-size-with-header-content-padding-bottom) var(--kbq-code-block-size-with-header-content-padding-horizontal)}.kbq-code-block .kbq-code-block__main .kbq-code-block__code:focus-visible{outline:none}.kbq-code-block .kbq-code-block__main .hljs{display:block}.kbq-code-block .kbq-code-block__main .hljs-ln-numbers{padding-right:var(--kbq-code-block-size-with-header-content-content-gap-horizontal);vertical-align:baseline;text-align:right}.kbq-code-block .kbq-code-block__main .hljs-ln{border-collapse:unset}.kbq-code-block .kbq-code-block__main .hljs-ln .hljs{padding:0}.kbq-code-block .kbq-code-block__main .hljs-ln-n:before{white-space:nowrap}.kbq-code-block.kbq-code-block_hide-line-numbers .hljs-ln-line.hljs-ln-numbers{display:none}.kbq-code-block.kbq-code-block_soft-wrap .kbq-code-block__code{white-space:pre-wrap;overflow-wrap:anywhere}.kbq-code-block:not(.kbq-code-block_soft-wrap) .kbq-code-block__pre{width:max-content;min-width:100%}.kbq-code-block.kbq-code-block_view-all .kbq-code-block__main{max-height:unset;overflow:auto}.kbq-code-block:not(.kbq-code-block_view-all) .kbq-code-block__main{overflow:hidden}.kbq-code-block.kbq-code-block_hide-tabs .kbq-code-block__header{padding:0}.kbq-code-block.kbq-code-block_hide-tabs .kbq-code-block__actionbar{display:none;position:absolute;top:0;right:0;margin:var(--kbq-size-s) var(--kbq-size-s) var(--kbq-size-s) 0}.kbq-code-block.kbq-code-block_hide-tabs .kbq-code-block__actionbar .kbq-code-block__actionbar__button-stack{border-width:1px;border-style:solid;border-radius:calc(var(--kbq-size-border-radius) + 1px)}@supports (corner-shape: squircle){.kbq-code-block.kbq-code-block_hide-tabs .kbq-code-block__actionbar .kbq-code-block__actionbar__button-stack{corner-shape:squircle;border-radius:clamp((var(--kbq-size-border-radius) + 1px) * 1.85,(var(--kbq-size-border-radius) + 1px) * 2.3 - 3.6px,(var(--kbq-size-border-radius) + 1px) * 2)}}.kbq-code-block.kbq-code-block_hide-tabs .kbq-code-block__main{position:relative}.kbq-code-block.kbq-code-block_hide-tabs .kbq-code-block__main .kbq-code-block__code{padding:var(--kbq-code-block-size-no-header-content-padding-vertical) var(--kbq-code-block-size-no-header-content-padding-horizontal)}.kbq-code-block.kbq-code-block_hide-tabs .kbq-code-block__main .hljs-ln-numbers{padding-right:var(--kbq-code-block-size-no-header-content-content-gap-horizontal)}.kbq-code-block:not(.kbq-code-block_hide-tabs) .kbq-code-block__header{border-radius:var(--kbq-code-block-size-container-border-radius) var(--kbq-code-block-size-container-border-radius) 0 0}@supports (corner-shape: squircle){.kbq-code-block:not(.kbq-code-block_hide-tabs) .kbq-code-block__header{corner-shape:squircle;border-radius:clamp(var(--kbq-code-block-size-container-border-radius) * 1.85,var(--kbq-code-block-size-container-border-radius) * 2.3 - 3.6px,var(--kbq-code-block-size-container-border-radius) * 2) clamp(var(--kbq-code-block-size-container-border-radius) * 1.85,var(--kbq-code-block-size-container-border-radius) * 2.3 - 3.6px,var(--kbq-code-block-size-container-border-radius) * 2) 0 0}}.kbq-code-block:not(.kbq-code-block_hide-tabs) .kbq-code-block__main{border-radius:0 0 var(--kbq-code-block-size-container-border-radius) var(--kbq-code-block-size-container-border-radius)}@supports (corner-shape: squircle){.kbq-code-block:not(.kbq-code-block_hide-tabs) .kbq-code-block__main{corner-shape:squircle;border-radius:0 0 clamp(var(--kbq-code-block-size-container-border-radius) * 1.85,var(--kbq-code-block-size-container-border-radius) * 2.3 - 3.6px,var(--kbq-code-block-size-container-border-radius) * 2) clamp(var(--kbq-code-block-size-container-border-radius) * 1.85,var(--kbq-code-block-size-container-border-radius) * 2.3 - 3.6px,var(--kbq-code-block-size-container-border-radius) * 2)}}.kbq-code-block.kbq-code-block_show-actionbar .kbq-code-block__actionbar{display:flex}.kbq-code-block:not(:has(.kbq-code-block__view-all)) .kbq-code-block__main{overflow:auto}.kbq-code-block .kbq-code-block__view-all{display:flex;justify-content:center;width:100%;position:absolute;bottom:calc(var(--kbq-code-block-size-container-border-width) * -1);border-radius:var(--kbq-code-block-size-container-border-radius)}@supports (corner-shape: squircle){.kbq-code-block .kbq-code-block__view-all{corner-shape:squircle;border-radius:clamp(var(--kbq-code-block-size-container-border-radius) * 1.85,var(--kbq-code-block-size-container-border-radius) * 2.3 - 3.6px,var(--kbq-code-block-size-container-border-radius) * 2)}}.kbq-code-block .kbq-code-block__view-all .kbq-code-block__view-all__wrapper{border-radius:var(--kbq-size-border-radius)}@supports (corner-shape: squircle){.kbq-code-block .kbq-code-block__view-all .kbq-code-block__view-all__wrapper{corner-shape:squircle;border-radius:clamp(var(--kbq-size-border-radius) * 1.85,var(--kbq-size-border-radius) * 2.3 - 3.6px,var(--kbq-size-border-radius) * 2)}}.kbq-code-block .kbq-code-block__view-all.kbq-code-block__view-all_collapsed{padding-top:var(--kbq-code-block-size-collapse-collapsed-padding-top);padding-bottom:var(--kbq-code-block-size-collapse-collapsed-padding-bottom)}.kbq-code-block .kbq-code-block__view-all.kbq-code-block__view-all_expanded{padding-top:var(--kbq-code-block-size-collapse-expanded-padding-top);margin-bottom:var(--kbq-code-block-size-collapse-expanded-padding-bottom)}.kbq-code-block.kbq-code-block_no-border{border-color:transparent!important}.kbq-code-block .hljs-addition{background-color:var(--kbq-code-block-hljs-addition-background);color:var(--kbq-code-block-hljs-addition-color)}.kbq-code-block .hljs-attr{background-color:var(--kbq-code-block-hljs-attr-background);color:var(--kbq-code-block-hljs-attr-color)}.kbq-code-block .hljs-attribute{background-color:var(--kbq-code-block-hljs-attribute-background);color:var(--kbq-code-block-hljs-attribute-color)}.kbq-code-block .hljs-built_in{background-color:var(--kbq-code-block-hljs-built-in-background);color:var(--kbq-code-block-hljs-built-in-color)}.kbq-code-block .hljs-bullet{background-color:var(--kbq-code-block-hljs-bullet-background);color:var(--kbq-code-block-hljs-bullet-color)}.kbq-code-block .hljs-char-escape{background-color:var(--kbq-code-block-hljs-char-escape-background);color:var(--kbq-code-block-hljs-char-escape-color)}.kbq-code-block .hljs-class{background-color:var(--kbq-code-block-hljs-class-background);color:var(--kbq-code-block-hljs-class-color)}.kbq-code-block .hljs-code{background-color:var(--kbq-code-block-hljs-code-background);color:var(--kbq-code-block-hljs-code-color)}.kbq-code-block .hljs-comment{background-color:var(--kbq-code-block-hljs-comment-background);color:var(--kbq-code-block-hljs-comment-color)}.kbq-code-block .hljs-deletion{background-color:var(--kbq-code-block-hljs-deletion-background);color:var(--kbq-code-block-hljs-deletion-color)}.kbq-code-block .hljs-doctag{background-color:var(--kbq-code-block-hljs-doctag-background);color:var(--kbq-code-block-hljs-doctag-color)}.kbq-code-block .hljs-emphasis{background-color:var(--kbq-code-block-hljs-emphasis-background);color:var(--kbq-code-block-hljs-emphasis-color)}.kbq-code-block .hljs-formula{background-color:var(--kbq-code-block-hljs-formula-background);color:var(--kbq-code-block-hljs-formula-color)}.kbq-code-block .hljs-function{background-color:var(--kbq-code-block-hljs-function-background);color:var(--kbq-code-block-hljs-function-color)}.kbq-code-block .hljs-keyword{background-color:var(--kbq-code-block-hljs-keyword-background);color:var(--kbq-code-block-hljs-keyword-color)}.kbq-code-block .hljs-link{background-color:var(--kbq-code-block-hljs-link-background);color:var(--kbq-code-block-hljs-link-color)}.kbq-code-block .hljs-literal{background-color:var(--kbq-code-block-hljs-literal-background);color:var(--kbq-code-block-hljs-literal-color)}.kbq-code-block .hljs-meta{background-color:var(--kbq-code-block-hljs-meta-background);color:var(--kbq-code-block-hljs-meta-color)}.kbq-code-block .hljs-meta-keyword{background-color:var(--kbq-code-block-hljs-meta-keyword-background);color:var(--kbq-code-block-hljs-meta-keyword-color)}.kbq-code-block .hljs-meta-string{background-color:var(--kbq-code-block-hljs-meta-string-background);color:var(--kbq-code-block-hljs-meta-string-color)}.kbq-code-block .hljs-meta-prompt{background-color:var(--kbq-code-block-hljs-meta-prompt-background);color:var(--kbq-code-block-hljs-meta-prompt-color)}.kbq-code-block .hljs-name{background-color:var(--kbq-code-block-hljs-name-background);color:var(--kbq-code-block-hljs-name-color)}.kbq-code-block .hljs-number{background-color:var(--kbq-code-block-hljs-number-background);color:var(--kbq-code-block-hljs-number-color)}.kbq-code-block .hljs-operator{background-color:var(--kbq-code-block-hljs-operator-background);color:var(--kbq-code-block-hljs-operator-color)}.kbq-code-block .hljs-params{background-color:var(--kbq-code-block-hljs-params-background);color:var(--kbq-code-block-hljs-params-color)}.kbq-code-block .hljs-property{background-color:var(--kbq-code-block-hljs-property-background);color:var(--kbq-code-block-hljs-property-color)}.kbq-code-block .hljs-punctuation{background-color:var(--kbq-code-block-hljs-punctuation-background);color:var(--kbq-code-block-hljs-punctuation-color)}.kbq-code-block .hljs-quote{background-color:var(--kbq-code-block-hljs-quote-background);color:var(--kbq-code-block-hljs-quote-color)}.kbq-code-block .hljs-regexp{background-color:var(--kbq-code-block-hljs-regexp-background);color:var(--kbq-code-block-hljs-regexp-color)}.kbq-code-block .hljs-section{background-color:var(--kbq-code-block-hljs-section-background);color:var(--kbq-code-block-hljs-section-color)}.kbq-code-block .hljs-selector-attr{background-color:var(--kbq-code-block-hljs-selector-attr-background);color:var(--kbq-code-block-hljs-selector-attr-color)}.kbq-code-block .hljs-selector-class{background-color:var(--kbq-code-block-hljs-selector-class-background);color:var(--kbq-code-block-hljs-selector-class-color)}.kbq-code-block .hljs-selector-id{background-color:var(--kbq-code-block-hljs-selector-id-background);color:var(--kbq-code-block-hljs-selector-id-color)}.kbq-code-block .hljs-selector-pseudo{background-color:var(--kbq-code-block-hljs-selector-pseudo-background);color:var(--kbq-code-block-hljs-selector-pseudo-color)}.kbq-code-block .hljs-selector-tag{background-color:var(--kbq-code-block-hljs-selector-tag-background);color:var(--kbq-code-block-hljs-selector-tag-color)}.kbq-code-block .hljs-string{background-color:var(--kbq-code-block-hljs-string-background);color:var(--kbq-code-block-hljs-string-color)}.kbq-code-block .hljs-strong{background-color:var(--kbq-code-block-hljs-strong-background);color:var(--kbq-code-block-hljs-strong-color)}.kbq-code-block .hljs-subst{background-color:var(--kbq-code-block-hljs-subst-background);color:var(--kbq-code-block-hljs-subst-color)}.kbq-code-block .hljs-symbol{background-color:var(--kbq-code-block-hljs-symbol-background);color:var(--kbq-code-block-hljs-symbol-color)}.kbq-code-block .hljs-tag{background-color:var(--kbq-code-block-hljs-tag-background);color:var(--kbq-code-block-hljs-tag-color)}.kbq-code-block .hljs-template-tag{background-color:var(--kbq-code-block-hljs-template-tag-background);color:var(--kbq-code-block-hljs-template-tag-color)}.kbq-code-block .hljs-template-variable{background-color:var(--kbq-code-block-hljs-template-variable-background);color:var(--kbq-code-block-hljs-template-variable-color)}.kbq-code-block .hljs-title{background-color:var(--kbq-code-block-hljs-title-background);color:var(--kbq-code-block-hljs-title-color)}.kbq-code-block .hljs-title-class{background-color:var(--kbq-code-block-hljs-title-class-background);color:var(--kbq-code-block-hljs-title-class-color)}.kbq-code-block .hljs-title-class-inherited{background-color:var(--kbq-code-block-hljs-title-class-inherited-background);color:var(--kbq-code-block-hljs-title-class-inherited-color)}.kbq-code-block .hljs-title-function{background-color:var(--kbq-code-block-hljs-title-function-background);color:var(--kbq-code-block-hljs-title-function-color)}.kbq-code-block .hljs-title-function-invoke{background-color:var(--kbq-code-block-hljs-title-function-invoke-background);color:var(--kbq-code-block-hljs-title-function-invoke-color)}.kbq-code-block .hljs-type{background-color:var(--kbq-code-block-hljs-type-background);color:var(--kbq-code-block-hljs-type-color)}.kbq-code-block .hljs-variable{background-color:var(--kbq-code-block-hljs-variable-background);color:var(--kbq-code-block-hljs-variable-color)}.kbq-code-block .hljs-variable-constant{background-color:var(--kbq-code-block-hljs-variable-constant-background);color:var(--kbq-code-block-hljs-variable-constant-color)}.kbq-code-block .hljs-variable-language{background-color:var(--kbq-code-block-hljs-variable-language-background);color:var(--kbq-code-block-hljs-variable-language-color)}.kbq-code-block .hljs-ln-n{color:var(--kbq-code-block-hljs-line-numbers-color)}.kbq-code-block.kbq-code-block_outline{background:var(--kbq-code-block-outline-container-background);border-color:var(--kbq-code-block-outline-container-border-color)}.kbq-code-block.kbq-code-block_outline .kbq-code-block__header{background:var(--kbq-code-block-outline-header-background)}.kbq-code-block.kbq-code-block_outline.kbq-code-block_hide-tabs .kbq-code-block__actionbar .kbq-code-block__actionbar__button-stack{border-color:var(--kbq-code-block-outline-actionbar-border-color);background:var(--kbq-code-block-outline-actionbar-background)}.kbq-code-block.kbq-code-block_outline .kbq-code-block__view-all .kbq-code-block__view-all__wrapper{background:var(--kbq-code-block-outline-collapse-button-expand-background);opacity:90%}.kbq-code-block.kbq-code-block_outline .kbq-code-block__view-all.kbq-code-block__view-all_expanded{background:var(--kbq-code-block-outline-collapse-expanded-background)}.kbq-code-block.kbq-code-block_outline .kbq-code-block__view-all.kbq-code-block__view-all_collapsed{background:var(--kbq-code-block-outline-collapse-collapsed-background)}.kbq-code-block.kbq-code-block_filled{background:var(--kbq-code-block-filled-container-background);border-color:var(--kbq-code-block-filled-container-border-color)}.kbq-code-block.kbq-code-block_filled .kbq-code-block__header{background:var(--kbq-code-block-filled-header-background)}.kbq-code-block.kbq-code-block_filled.kbq-code-block_hide-tabs .kbq-code-block__actionbar .kbq-code-block__actionbar__button-stack{border-color:var(--kbq-code-block-filled-actionbar-border-color);background:var(--kbq-code-block-filled-actionbar-background)}.kbq-code-block.kbq-code-block_filled .kbq-code-block__view-all .kbq-code-block__view-all__wrapper{background:var(--kbq-code-block-filled-collapse-button-expand-background);opacity:90%}.kbq-code-block.kbq-code-block_filled .kbq-code-block__view-all.kbq-code-block__view-all_expanded{background:var(--kbq-code-block-filled-collapse-expanded-background)}.kbq-code-block.kbq-code-block_filled .kbq-code-block__view-all.kbq-code-block__view-all_collapsed{background:var(--kbq-code-block-filled-collapse-collapsed-background)}.kbq-code-block .kbq-code-block__main.cdk-keyboard-focused{outline-color:var(--kbq-states-line-focus-theme)}.kbq-code-block{font-size:var(--kbq-typography-mono-codeblock-font-size);font-style:var(--kbq-typography-mono-codeblock-font-style);font-weight:var(--kbq-typography-mono-codeblock-font-weight);line-height:var(--kbq-typography-mono-codeblock-line-height);font-family:var(--kbq-typography-mono-codeblock-font-family);text-transform:var(--kbq-typography-mono-codeblock-text-transform);font-feature-settings:var(--kbq-typography-mono-codeblock-font-feature-settings);letter-spacing:var(--kbq-typography-mono-codeblock-letter-spacing)}.kbq-code-block .kbq-code-block__pre,.kbq-code-block .kbq-code-block__code{font:inherit}\n", ".kbq-code-block{--kbq-code-block-size-container-border-width: var(--kbq-size-border-width);--kbq-code-block-size-container-border-width-focused: 2px;--kbq-code-block-size-container-border-radius: var(--kbq-size-border-radius);--kbq-code-block-size-with-header-content-padding-top: var(--kbq-size-xxs);--kbq-code-block-size-with-header-content-padding-bottom: var(--kbq-size-l);--kbq-code-block-size-with-header-content-padding-horizontal: var(--kbq-size-xl);--kbq-code-block-size-with-header-content-content-gap-horizontal: var(--kbq-size-m);--kbq-code-block-size-no-header-content-padding-vertical: 14px;--kbq-code-block-size-no-header-content-padding-horizontal: var(--kbq-size-xl);--kbq-code-block-size-no-header-content-content-gap-horizontal: var(--kbq-size-m);--kbq-code-block-size-header-content-gap-horizontal: var(--kbq-size-l);--kbq-code-block-size-actionbar-content-gap-horizontal: var(--kbq-size-3xs);--kbq-code-block-size-collapse-expanded-padding-top: 0;--kbq-code-block-size-collapse-expanded-padding-bottom: var(--kbq-size-l);--kbq-code-block-size-collapse-collapsed-padding-top: var(--kbq-size-3xl);--kbq-code-block-size-collapse-collapsed-padding-bottom: var(--kbq-size-l);--kbq-code-block-filled-container-background: var(--kbq-background-contrast-less);--kbq-code-block-filled-container-border-color: transparent;--kbq-code-block-filled-header-background: transparent;--kbq-code-block-filled-actionbar-background: var(--kbq-background-card);--kbq-code-block-filled-actionbar-border-color: var(--kbq-line-contrast-less);--kbq-code-block-filled-collapse-expanded-background: transparent;--kbq-code-block-filled-collapse-collapsed-background: linear-gradient( 180deg, transparent, var(--kbq-background-bg-secondary) 100% );--kbq-code-block-filled-collapse-button-expand-background: var(--kbq-background-bg-secondary);--kbq-code-block-outline-container-background: var(--kbq-background-card);--kbq-code-block-outline-container-border-color: var(--kbq-divider-color, var(--kbq-line-contrast-less));--kbq-code-block-outline-header-background: var(--kbq-background-card);--kbq-code-block-outline-actionbar-background: var(--kbq-background-card);--kbq-code-block-outline-actionbar-border-color: var(--kbq-line-contrast-less);--kbq-code-block-outline-collapse-expanded-background: transparent;--kbq-code-block-outline-collapse-collapsed-background: linear-gradient( 180deg, transparent, var(--kbq-background-bg) 100% );--kbq-code-block-outline-collapse-button-expand-background: var(--kbq-background-card);--kbq-code-block-tab-size: 4}\n"], dependencies: [{ kind: "ngmodule", type: KbqTabsModule }, { kind: "component", type: i2.KbqTabNavBar, selector: "[kbqTabNavBar], [kbq-tab-nav-bar]", inputs: ["transparent", "onSurface", "underlined", "tabNavPanel"], exportAs: ["kbqTabNavBar"] }, { kind: "directive", type: i2.KbqTabLink, selector: "[kbqTabLink], [kbq-tab-link]", inputs: ["id", "active", "disabled", "tabIndex"], exportAs: ["kbqTabLink"] }, { kind: "directive", type: i2.KbqTabNavPanel, selector: "[kbqTabNavPanel]", inputs: ["id"], exportAs: ["kbqTabNavPanel"] }, { kind: "ngmodule", type: KbqButtonModule }, { kind: "component", type: i3.KbqButton, selector: "[kbq-button]", inputs: ["kbqStyle", "disabled", "tabIndex"] }, { kind: "directive", type: i3.KbqButtonCssStyler, selector: "[kbq-button]" }, { kind: "directive", type: KbqCodeBlockHighlight, selector: "code[kbqCodeBlockHighlight]", inputs: ["file", "startFrom", "singleLine"], exportAs: ["kbqCodeBlockHighlight"] }, { kind: "ngmodule", type: A11yModule }, { kind: "directive", type: i4.CdkMonitorFocus, selector: "[cdkMonitorElementFocus], [cdkMonitorSubtreeFocus]", outputs: ["cdkFocusChange"], exportAs: ["cdkMonitorFocus"] }, { kind: "ngmodule", type: KbqToolTipModule }, { kind: "directive", type: i5.KbqTooltipTrigger, selector: "[kbqTooltip]", inputs: ["kbqTooltipScrollStrategy", "forDisabledComponent", "ignoreTooltipPointerEvents", "kbqTooltipSingleInstance", "kbqTrigger", "hideWithTimeout", "kbqEnterDelay", "kbqLeaveDelay", "kbqRelativeToPointer", "kbqRelativeToCaret", "kbqRelativeToCaretVertical", "kbqTooltip", "kbqTooltipHeader", "kbqTooltipModifier", "kbqTooltipContext", "kbqTooltipClass", "kbqTooltipColor", "kbqTooltipArrow", "kbqTooltipOffset", "kbqTooltipDisabled", "kbqPlacementPriority", "kbqPlacement", "kbqVisible"], outputs: ["kbqPlacementChange", "kbqVisibleChange"], exportAs: ["kbqTooltip"] }, { kind: "ngmodule", type: KbqIconModule }, { kind: "component", type: i6.KbqIcon, selector: "[kbq-icon]", inputs: ["aria-hidden", "iconSize", "autoColor", "kbq-icon"] }, { kind: "directive", type: KbqScrollbarViewport, selector: "[kbqScrollbarViewport]", inputs: ["kbqScrollbarMode", "kbqScrollbarHideDelay"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: KbqOverflowShadowContainer, selector: "[kbqOverflowShadowContainer]", inputs: ["debounce"], exportAs: ["kbqOverflowShadowContainer"] }, { kind: "directive", type: KbqOverflowShadowTop, selector: "[kbqOverflowShadowTop]", inputs: ["kbqOverflowShadowTop", "shadow"], exportAs: ["kbqOverflowShadowTop"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
789
|
+
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.25", type: KbqCodeBlock, isStandalone: true, selector: "kbq-code-block", inputs: { lineNumbers: { classPropertyName: "lineNumbers", publicName: "lineNumbers", isSignal: true, isRequired: false, transformFunction: null }, filled: { classPropertyName: "filled", publicName: "filled", isSignal: true, isRequired: false, transformFunction: null }, canToggleSoftWrap: { classPropertyName: "canToggleSoftWrap", publicName: "canToggleSoftWrap", isSignal: true, isRequired: false, transformFunction: null }, softWrapInput: { classPropertyName: "softWrapInput", publicName: "softWrap", isSignal: true, isRequired: false, transformFunction: null }, viewAllInput: { classPropertyName: "viewAllInput", publicName: "viewAll", isSignal: true, isRequired: false, transformFunction: null }, maxHeight: { classPropertyName: "maxHeight", publicName: "maxHeight", isSignal: true, isRequired: false, transformFunction: null }, canDownloadInput: { classPropertyName: "canDownloadInput", publicName: "canDownload", isSignal: true, isRequired: false, transformFunction: null }, canCopy: { classPropertyName: "canCopy", publicName: "canCopy", isSignal: true, isRequired: false, transformFunction: null }, alwaysShowActionbar: { classPropertyName: "alwaysShowActionbar", publicName: "alwaysShowActionbar", isSignal: true, isRequired: false, transformFunction: null }, filesInput: { classPropertyName: "filesInput", publicName: "files", isSignal: true, isRequired: false, transformFunction: null }, activeFileIndexInput: { classPropertyName: "activeFileIndexInput", publicName: "activeFileIndex", isSignal: true, isRequired: false, transformFunction: null }, noBorder: { classPropertyName: "noBorder", publicName: "noBorder", isSignal: true, isRequired: false, transformFunction: null }, hideTabsInput: { classPropertyName: "hideTabsInput", publicName: "hideTabs", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { softWrapChange: "softWrapChange", viewAllChange: "viewAllChange", activeFileIndexChange: "activeFileIndexChange", hideTabsChange: "hideTabsChange" }, host: { properties: { "class.kbq-code-block_filled": "filled()", "class.kbq-code-block_outline": "!filled()", "class.kbq-code-block_hide-line-numbers": "!lineNumbers()", "class.kbq-code-block_hide-tabs": "tabsHidden()", "class.kbq-code-block_no-border": "noBorder() || filled()", "class.kbq-code-block_show-actionbar": "actionbarVisible()", "class.kbq-code-block_soft-wrap": "softWrap()", "class.kbq-code-block_view-all": "viewAll()" }, classAttribute: "kbq-code-block" }, queries: [{ propertyName: "tabLinkTemplate", first: true, predicate: KbqCodeBlockTabLinkContent, descendants: true, read: TemplateRef, isSignal: true }], viewQueries: [{ propertyName: "copyButtonTooltip", first: true, predicate: ["copyButtonTooltip"], descendants: true, isSignal: true }, { propertyName: "highlight", first: true, predicate: KbqCodeBlockHighlight, descendants: true, isSignal: true }, { propertyName: "scrollbarViewport", first: true, predicate: KbqScrollbarViewport, descendants: true, isSignal: true }, { propertyName: "preElementRef", first: true, predicate: ["codeBlockPre"], descendants: true, isSignal: true }, { propertyName: "codeElementRef", first: true, predicate: ["codeBlockCode"], descendants: true, isSignal: true }], exportAs: ["kbqCodeBlock"], hostDirectives: [{ directive: i1.KbqLocaleOverridesDirective, inputs: ["kbqLocaleOverrides", "localeOverrides"] }], ngImport: i0, template: "<div class=\"kbq-code-block__header\" [kbqOverflowShadowTop]=\"codeBlockContent\">\n @if (!tabsHidden()) {\n <div class=\"kbq-code-block__header-tabs\">\n <div kbqTabNavBar transparent [tabNavPanel]=\"tabPanel\">\n @for (file of files(); track file) {\n <!-- Mark tab-link as readonly if only single file present -->\n <div\n kbqTabLink\n [active]=\"$count > 1 && renderedFileIndex() === $index\"\n [style.pointer-events]=\"$count === 1 ? 'none' : null\"\n (click)=\"onSelectedTabChange($index)\"\n >\n @if (tabLinkTemplate(); as linkTemplate) {\n <ng-container\n *ngTemplateOutlet=\"linkTemplate; context: { $implicit: file, fallbackFileName }\"\n />\n } @else {\n {{ file.filename || fallbackFileName }}\n }\n </div>\n }\n </div>\n </div>\n }\n\n <div class=\"kbq-code-block__actionbar\">\n <div class=\"kbq-code-block__actionbar__button-stack\">\n @if (canToggleSoftWrap()) {\n <button\n kbq-button\n class=\"kbq-code-block__actionbar__soft-wrap-button\"\n [attr.aria-label]=\"\n softWrap() ? localeConfiguration().softWrapOffTooltip : localeConfiguration().softWrapOnTooltip\n \"\n [color]=\"componentColor.Contrast\"\n [kbqStyle]=\"buttonStyle.Transparent\"\n [kbqTooltip]=\"\n softWrap() ? localeConfiguration().softWrapOffTooltip : localeConfiguration().softWrapOnTooltip\n \"\n (click)=\"toggleSoftWrap()\"\n >\n @if (softWrap()) {\n <i kbq-icon=\"kbq-text-overflow_16\"></i>\n } @else {\n <i kbq-icon=\"kbq-text-wrap_16\"></i>\n }\n </button>\n }\n\n @if (canDownload()) {\n <button\n kbq-button\n class=\"kbq-code-block__actionbar__download-button\"\n [attr.aria-label]=\"localeConfiguration().downloadTooltip\"\n [color]=\"componentColor.Contrast\"\n [kbqStyle]=\"buttonStyle.Transparent\"\n [kbqTooltip]=\"localeConfiguration().downloadTooltip\"\n (click)=\"downloadCode()\"\n >\n <i kbq-icon=\"kbq-arrow-down-to-line_16\"></i>\n </button>\n }\n\n @if (canCopy()) {\n <div #copyButtonTooltip=\"kbqTooltip\" [kbqTooltip]=\"localeConfiguration().copyTooltip\">\n <button\n kbq-button\n class=\"kbq-code-block__actionbar__copy-button\"\n [attr.aria-label]=\"localeConfiguration().copyTooltip\"\n [color]=\"componentColor.Contrast\"\n [kbqStyle]=\"buttonStyle.Transparent\"\n (click)=\"copyCode()\"\n >\n <i kbq-icon=\"kbq-file-multiple-o_16\"></i>\n </button>\n </div>\n }\n\n @if (activeFile()?.link) {\n <button\n kbq-button\n class=\"kbq-code-block__actionbar__link-button\"\n [attr.aria-label]=\"localeConfiguration().openExternalSystemTooltip\"\n [color]=\"componentColor.Contrast\"\n [kbqStyle]=\"buttonStyle.Transparent\"\n [kbqTooltip]=\"localeConfiguration().openExternalSystemTooltip\"\n (click)=\"openLink()\"\n >\n <i kbq-icon=\"kbq-arrow-up-right-from-square_16\"></i>\n </button>\n }\n </div>\n </div>\n</div>\n\n<div\n #tabPanel=\"kbqTabNavPanel\"\n #codeBlockContent=\"kbqOverflowShadowContainer\"\n cdkMonitorElementFocus\n kbqOverflowShadowContainer\n kbqScrollbarViewport\n kbqTabNavPanel\n class=\"kbq-code-block__main\"\n tabindex=\"0\"\n [style.max-height.px]=\"calculatedMaxHeight()\"\n>\n @if (activeFile(); as file) {\n <pre\n #codeBlockPre\n class=\"kbq-code-block__pre\"\n ><code #codeBlockCode kbqCodeBlockHighlight class=\"kbq-code-block__code\" [file]=\"file\"></code></pre>\n }\n\n @if (contentExceedsMaxHeight()) {\n <div\n class=\"kbq-code-block__view-all\"\n [class.kbq-code-block__view-all_collapsed]=\"!viewAll()\"\n [class.kbq-code-block__view-all_expanded]=\"viewAll()\"\n >\n <div class=\"kbq-code-block__view-all__wrapper\">\n <button\n kbq-button\n class=\"kbq-code-block__view-all__button\"\n [color]=\"componentColor.Theme\"\n [kbqStyle]=\"buttonStyle.Transparent\"\n (click)=\"toggleViewAll()\"\n (keydown.enter)=\"onViewAllEnterKeydown($event)\"\n >\n @if (viewAll()) {\n <i kbq-icon=\"kbq-chevron-up_16\"></i>\n {{ localeConfiguration().viewLessText }}\n } @else {\n <i kbq-icon=\"kbq-chevron-down_16\"></i>\n {{ localeConfiguration().viewAllText }}\n }\n </button>\n </div>\n </div>\n }\n</div>\n", styles: [".kbq-code-block{display:flex;flex-direction:column;position:relative;border-width:var(--kbq-code-block-size-container-border-width);border-style:solid;border-radius:var(--kbq-code-block-size-container-border-radius)}@supports (corner-shape: squircle){.kbq-code-block{corner-shape:squircle;border-radius:clamp(var(--kbq-code-block-size-container-border-radius) * 1.85,var(--kbq-code-block-size-container-border-radius) * 2.3 - 3.6px,var(--kbq-code-block-size-container-border-radius) * 2)}}.kbq-code-block{box-sizing:border-box;hyphens:none;-ms-hyphens:none;-moz-hyphens:none;-webkit-hyphens:none}.kbq-code-block .kbq-code-block__header{display:flex;align-items:center;padding:var(--kbq-size-s) var(--kbq-size-m)}.kbq-code-block .kbq-code-block__header .kbq-code-block__header-tabs{overflow:hidden;flex-grow:1}.kbq-code-block .kbq-code-block__actionbar{display:flex;justify-content:right;align-items:center;z-index:1}.kbq-code-block .kbq-code-block__actionbar .kbq-code-block__actionbar__button-stack{display:flex;gap:var(--kbq-code-block-size-actionbar-content-gap-horizontal)}.kbq-code-block:has(.kbq-code-block__view-all) .kbq-code-block__main .kbq-code-block__code{padding-bottom:calc(var(--kbq-size-3xl) + var(--kbq-code-block-size-collapse-expanded-padding-bottom))!important}.kbq-code-block .kbq-code-block__main{flex-grow:1;flex-direction:column;border-radius:var(--kbq-code-block-size-container-border-radius)}@supports (corner-shape: squircle){.kbq-code-block .kbq-code-block__main{corner-shape:squircle;border-radius:clamp(var(--kbq-code-block-size-container-border-radius) * 1.85,var(--kbq-code-block-size-container-border-radius) * 2.3 - 3.6px,var(--kbq-code-block-size-container-border-radius) * 2)}}.kbq-code-block .kbq-code-block__main.cdk-keyboard-focused{outline-style:solid;outline-width:var(--kbq-code-block-size-container-border-width-focused);outline-offset:-1px}.kbq-code-block .kbq-code-block__main .kbq-code-block__pre{margin:0;flex-grow:1}.kbq-code-block .kbq-code-block__main .kbq-code-block__code{--kbq-code-block-line-numbers-gap: var(--kbq-code-block-size-with-header-content-content-gap-horizontal);tab-size:var(--kbq-code-block-tab-size);padding:var(--kbq-code-block-size-with-header-content-padding-top) var(--kbq-code-block-size-with-header-content-padding-horizontal) var(--kbq-code-block-size-with-header-content-padding-bottom) var(--kbq-code-block-size-with-header-content-padding-horizontal)}.kbq-code-block .kbq-code-block__main .kbq-code-block__code:focus-visible{outline:none}.kbq-code-block .kbq-code-block__main .hljs,.kbq-code-block .kbq-code-block__main .kbq-code-block__line{display:block}.kbq-code-block:not(.kbq-code-block_hide-line-numbers) .kbq-code-block__code_line-numbers{--kbq-code-block-line-numbers-width: calc(var(--kbq-code-block-line-numbers-digits) * 1ch);--kbq-code-block-line-numbers-indent: calc( var(--kbq-code-block-line-numbers-width) + var(--kbq-code-block-line-numbers-gap) );counter-reset:kbq-code-block-line var(--kbq-code-block-line-numbers-start)}.kbq-code-block:not(.kbq-code-block_hide-line-numbers) .kbq-code-block__code_line-numbers .kbq-code-block__line{counter-increment:kbq-code-block-line;padding-inline-start:var(--kbq-code-block-line-numbers-indent);text-indent:calc(var(--kbq-code-block-line-numbers-indent) * -1)}.kbq-code-block:not(.kbq-code-block_hide-line-numbers) .kbq-code-block__code_line-numbers .kbq-code-block__line:before{content:counter(kbq-code-block-line)/\"\";display:inline-block;width:var(--kbq-code-block-line-numbers-width);margin-inline-end:var(--kbq-code-block-line-numbers-gap);text-align:end;text-indent:0;white-space:nowrap}.kbq-code-block.kbq-code-block_soft-wrap .kbq-code-block__code{white-space:pre-wrap;overflow-wrap:anywhere}.kbq-code-block:not(.kbq-code-block_soft-wrap) .kbq-code-block__pre{width:max-content;min-width:100%}.kbq-code-block.kbq-code-block_view-all .kbq-code-block__main{max-height:unset;overflow:auto}.kbq-code-block:not(.kbq-code-block_view-all) .kbq-code-block__main{overflow:hidden}.kbq-code-block.kbq-code-block_hide-tabs{isolation:isolate}.kbq-code-block.kbq-code-block_hide-tabs .kbq-code-block__header{padding:0}.kbq-code-block.kbq-code-block_hide-tabs .kbq-code-block__actionbar{display:none;position:absolute;top:0;right:0;padding:var(--kbq-size-s) var(--kbq-size-s) 0 0;border-top-right-radius:var(--kbq-code-block-size-container-border-radius)}@supports (corner-shape: squircle){.kbq-code-block.kbq-code-block_hide-tabs .kbq-code-block__actionbar{corner-shape:squircle;border-top-right-radius:clamp(var(--kbq-code-block-size-container-border-radius) * 1.85,var(--kbq-code-block-size-container-border-radius) * 2.3 - 3.6px,var(--kbq-code-block-size-container-border-radius) * 2)}}.kbq-code-block.kbq-code-block_hide-tabs .kbq-code-block__actionbar .kbq-code-block__actionbar__button-stack{border-width:1px;border-style:solid;border-radius:calc(var(--kbq-size-border-radius) + 1px)}@supports (corner-shape: squircle){.kbq-code-block.kbq-code-block_hide-tabs .kbq-code-block__actionbar .kbq-code-block__actionbar__button-stack{corner-shape:squircle;border-radius:clamp((var(--kbq-size-border-radius) + 1px) * 1.85,(var(--kbq-size-border-radius) + 1px) * 2.3 - 3.6px,(var(--kbq-size-border-radius) + 1px) * 2)}}.kbq-code-block.kbq-code-block_hide-tabs .kbq-code-block__main{position:relative;isolation:auto}.kbq-code-block.kbq-code-block_hide-tabs .kbq-code-block__main .kbq-code-block__code{--kbq-code-block-line-numbers-gap: var(--kbq-code-block-size-no-header-content-content-gap-horizontal);padding:var(--kbq-code-block-size-no-header-content-padding-vertical) var(--kbq-code-block-size-no-header-content-padding-horizontal)}.kbq-code-block:not(.kbq-code-block_hide-tabs) .kbq-code-block__header{border-radius:var(--kbq-code-block-size-container-border-radius) var(--kbq-code-block-size-container-border-radius) 0 0}@supports (corner-shape: squircle){.kbq-code-block:not(.kbq-code-block_hide-tabs) .kbq-code-block__header{corner-shape:squircle;border-radius:clamp(var(--kbq-code-block-size-container-border-radius) * 1.85,var(--kbq-code-block-size-container-border-radius) * 2.3 - 3.6px,var(--kbq-code-block-size-container-border-radius) * 2) clamp(var(--kbq-code-block-size-container-border-radius) * 1.85,var(--kbq-code-block-size-container-border-radius) * 2.3 - 3.6px,var(--kbq-code-block-size-container-border-radius) * 2) 0 0}}.kbq-code-block:not(.kbq-code-block_hide-tabs) .kbq-code-block__main{border-radius:0 0 var(--kbq-code-block-size-container-border-radius) var(--kbq-code-block-size-container-border-radius)}@supports (corner-shape: squircle){.kbq-code-block:not(.kbq-code-block_hide-tabs) .kbq-code-block__main{corner-shape:squircle;border-radius:0 0 clamp(var(--kbq-code-block-size-container-border-radius) * 1.85,var(--kbq-code-block-size-container-border-radius) * 2.3 - 3.6px,var(--kbq-code-block-size-container-border-radius) * 2) clamp(var(--kbq-code-block-size-container-border-radius) * 1.85,var(--kbq-code-block-size-container-border-radius) * 2.3 - 3.6px,var(--kbq-code-block-size-container-border-radius) * 2)}}.kbq-code-block.kbq-code-block_show-actionbar .kbq-code-block__actionbar{display:flex}.kbq-code-block:not(:has(.kbq-code-block__view-all)) .kbq-code-block__main{overflow:auto}.kbq-code-block .kbq-code-block__view-all{display:flex;justify-content:center;width:100%;position:absolute;bottom:calc(var(--kbq-code-block-size-container-border-width) * -1);border-radius:var(--kbq-code-block-size-container-border-radius)}@supports (corner-shape: squircle){.kbq-code-block .kbq-code-block__view-all{corner-shape:squircle;border-radius:clamp(var(--kbq-code-block-size-container-border-radius) * 1.85,var(--kbq-code-block-size-container-border-radius) * 2.3 - 3.6px,var(--kbq-code-block-size-container-border-radius) * 2)}}.kbq-code-block .kbq-code-block__view-all .kbq-code-block__view-all__wrapper{border-radius:var(--kbq-size-border-radius)}@supports (corner-shape: squircle){.kbq-code-block .kbq-code-block__view-all .kbq-code-block__view-all__wrapper{corner-shape:squircle;border-radius:clamp(var(--kbq-size-border-radius) * 1.85,var(--kbq-size-border-radius) * 2.3 - 3.6px,var(--kbq-size-border-radius) * 2)}}.kbq-code-block .kbq-code-block__view-all.kbq-code-block__view-all_collapsed{padding-top:var(--kbq-code-block-size-collapse-collapsed-padding-top);padding-bottom:var(--kbq-code-block-size-collapse-collapsed-padding-bottom)}.kbq-code-block .kbq-code-block__view-all.kbq-code-block__view-all_expanded{padding-top:var(--kbq-code-block-size-collapse-expanded-padding-top);margin-bottom:var(--kbq-code-block-size-collapse-expanded-padding-bottom)}.kbq-code-block.kbq-code-block_no-border{border-color:transparent!important}.kbq-code-block .hljs-addition{background-color:var(--kbq-code-block-hljs-addition-background);color:var(--kbq-code-block-hljs-addition-color)}.kbq-code-block .hljs-attr{background-color:var(--kbq-code-block-hljs-attr-background);color:var(--kbq-code-block-hljs-attr-color)}.kbq-code-block .hljs-attribute{background-color:var(--kbq-code-block-hljs-attribute-background);color:var(--kbq-code-block-hljs-attribute-color)}.kbq-code-block .hljs-built_in{background-color:var(--kbq-code-block-hljs-built-in-background);color:var(--kbq-code-block-hljs-built-in-color)}.kbq-code-block .hljs-bullet{background-color:var(--kbq-code-block-hljs-bullet-background);color:var(--kbq-code-block-hljs-bullet-color)}.kbq-code-block .hljs-char-escape{background-color:var(--kbq-code-block-hljs-char-escape-background);color:var(--kbq-code-block-hljs-char-escape-color)}.kbq-code-block .hljs-class{background-color:var(--kbq-code-block-hljs-class-background);color:var(--kbq-code-block-hljs-class-color)}.kbq-code-block .hljs-code{background-color:var(--kbq-code-block-hljs-code-background);color:var(--kbq-code-block-hljs-code-color)}.kbq-code-block .hljs-comment{background-color:var(--kbq-code-block-hljs-comment-background);color:var(--kbq-code-block-hljs-comment-color)}.kbq-code-block .hljs-deletion{background-color:var(--kbq-code-block-hljs-deletion-background);color:var(--kbq-code-block-hljs-deletion-color)}.kbq-code-block .hljs-doctag{background-color:var(--kbq-code-block-hljs-doctag-background);color:var(--kbq-code-block-hljs-doctag-color)}.kbq-code-block .hljs-emphasis{background-color:var(--kbq-code-block-hljs-emphasis-background);color:var(--kbq-code-block-hljs-emphasis-color)}.kbq-code-block .hljs-formula{background-color:var(--kbq-code-block-hljs-formula-background);color:var(--kbq-code-block-hljs-formula-color)}.kbq-code-block .hljs-function{background-color:var(--kbq-code-block-hljs-function-background);color:var(--kbq-code-block-hljs-function-color)}.kbq-code-block .hljs-keyword{background-color:var(--kbq-code-block-hljs-keyword-background);color:var(--kbq-code-block-hljs-keyword-color)}.kbq-code-block .hljs-link{background-color:var(--kbq-code-block-hljs-link-background);color:var(--kbq-code-block-hljs-link-color)}.kbq-code-block .hljs-literal{background-color:var(--kbq-code-block-hljs-literal-background);color:var(--kbq-code-block-hljs-literal-color)}.kbq-code-block .hljs-meta{background-color:var(--kbq-code-block-hljs-meta-background);color:var(--kbq-code-block-hljs-meta-color)}.kbq-code-block .hljs-meta-keyword{background-color:var(--kbq-code-block-hljs-meta-keyword-background);color:var(--kbq-code-block-hljs-meta-keyword-color)}.kbq-code-block .hljs-meta-string{background-color:var(--kbq-code-block-hljs-meta-string-background);color:var(--kbq-code-block-hljs-meta-string-color)}.kbq-code-block .hljs-meta-prompt{background-color:var(--kbq-code-block-hljs-meta-prompt-background);color:var(--kbq-code-block-hljs-meta-prompt-color)}.kbq-code-block .hljs-name{background-color:var(--kbq-code-block-hljs-name-background);color:var(--kbq-code-block-hljs-name-color)}.kbq-code-block .hljs-number{background-color:var(--kbq-code-block-hljs-number-background);color:var(--kbq-code-block-hljs-number-color)}.kbq-code-block .hljs-operator{background-color:var(--kbq-code-block-hljs-operator-background);color:var(--kbq-code-block-hljs-operator-color)}.kbq-code-block .hljs-params{background-color:var(--kbq-code-block-hljs-params-background);color:var(--kbq-code-block-hljs-params-color)}.kbq-code-block .hljs-property{background-color:var(--kbq-code-block-hljs-property-background);color:var(--kbq-code-block-hljs-property-color)}.kbq-code-block .hljs-punctuation{background-color:var(--kbq-code-block-hljs-punctuation-background);color:var(--kbq-code-block-hljs-punctuation-color)}.kbq-code-block .hljs-quote{background-color:var(--kbq-code-block-hljs-quote-background);color:var(--kbq-code-block-hljs-quote-color)}.kbq-code-block .hljs-regexp{background-color:var(--kbq-code-block-hljs-regexp-background);color:var(--kbq-code-block-hljs-regexp-color)}.kbq-code-block .hljs-section{background-color:var(--kbq-code-block-hljs-section-background);color:var(--kbq-code-block-hljs-section-color)}.kbq-code-block .hljs-selector-attr{background-color:var(--kbq-code-block-hljs-selector-attr-background);color:var(--kbq-code-block-hljs-selector-attr-color)}.kbq-code-block .hljs-selector-class{background-color:var(--kbq-code-block-hljs-selector-class-background);color:var(--kbq-code-block-hljs-selector-class-color)}.kbq-code-block .hljs-selector-id{background-color:var(--kbq-code-block-hljs-selector-id-background);color:var(--kbq-code-block-hljs-selector-id-color)}.kbq-code-block .hljs-selector-pseudo{background-color:var(--kbq-code-block-hljs-selector-pseudo-background);color:var(--kbq-code-block-hljs-selector-pseudo-color)}.kbq-code-block .hljs-selector-tag{background-color:var(--kbq-code-block-hljs-selector-tag-background);color:var(--kbq-code-block-hljs-selector-tag-color)}.kbq-code-block .hljs-string{background-color:var(--kbq-code-block-hljs-string-background);color:var(--kbq-code-block-hljs-string-color)}.kbq-code-block .hljs-strong{background-color:var(--kbq-code-block-hljs-strong-background);color:var(--kbq-code-block-hljs-strong-color)}.kbq-code-block .hljs-subst{background-color:var(--kbq-code-block-hljs-subst-background);color:var(--kbq-code-block-hljs-subst-color)}.kbq-code-block .hljs-symbol{background-color:var(--kbq-code-block-hljs-symbol-background);color:var(--kbq-code-block-hljs-symbol-color)}.kbq-code-block .hljs-tag{background-color:var(--kbq-code-block-hljs-tag-background);color:var(--kbq-code-block-hljs-tag-color)}.kbq-code-block .hljs-template-tag{background-color:var(--kbq-code-block-hljs-template-tag-background);color:var(--kbq-code-block-hljs-template-tag-color)}.kbq-code-block .hljs-template-variable{background-color:var(--kbq-code-block-hljs-template-variable-background);color:var(--kbq-code-block-hljs-template-variable-color)}.kbq-code-block .hljs-title{background-color:var(--kbq-code-block-hljs-title-background);color:var(--kbq-code-block-hljs-title-color)}.kbq-code-block .hljs-title-class{background-color:var(--kbq-code-block-hljs-title-class-background);color:var(--kbq-code-block-hljs-title-class-color)}.kbq-code-block .hljs-title-class-inherited{background-color:var(--kbq-code-block-hljs-title-class-inherited-background);color:var(--kbq-code-block-hljs-title-class-inherited-color)}.kbq-code-block .hljs-title-function{background-color:var(--kbq-code-block-hljs-title-function-background);color:var(--kbq-code-block-hljs-title-function-color)}.kbq-code-block .hljs-title-function-invoke{background-color:var(--kbq-code-block-hljs-title-function-invoke-background);color:var(--kbq-code-block-hljs-title-function-invoke-color)}.kbq-code-block .hljs-type{background-color:var(--kbq-code-block-hljs-type-background);color:var(--kbq-code-block-hljs-type-color)}.kbq-code-block .hljs-variable{background-color:var(--kbq-code-block-hljs-variable-background);color:var(--kbq-code-block-hljs-variable-color)}.kbq-code-block .hljs-variable-constant{background-color:var(--kbq-code-block-hljs-variable-constant-background);color:var(--kbq-code-block-hljs-variable-constant-color)}.kbq-code-block .hljs-variable-language{background-color:var(--kbq-code-block-hljs-variable-language-background);color:var(--kbq-code-block-hljs-variable-language-color)}.kbq-code-block .kbq-code-block__line:before{color:var(--kbq-code-block-hljs-line-numbers-color)}.kbq-code-block.kbq-code-block_outline{background:var(--kbq-code-block-outline-container-background);border-color:var(--kbq-code-block-outline-container-border-color)}.kbq-code-block.kbq-code-block_outline .kbq-code-block__header{background:var(--kbq-code-block-outline-header-background)}.kbq-code-block.kbq-code-block_outline.kbq-code-block_hide-tabs .kbq-code-block__actionbar{background:var(--kbq-code-block-outline-actionbar-plate-background)}.kbq-code-block.kbq-code-block_outline.kbq-code-block_hide-tabs .kbq-code-block__actionbar .kbq-code-block__actionbar__button-stack{border-color:var(--kbq-code-block-outline-actionbar-border-color);background:var(--kbq-code-block-outline-actionbar-background)}.kbq-code-block.kbq-code-block_outline .kbq-code-block__view-all.kbq-code-block__view-all_expanded{background:var(--kbq-code-block-outline-collapse-expanded-background)}.kbq-code-block.kbq-code-block_outline .kbq-code-block__view-all.kbq-code-block__view-all_collapsed{background:var(--kbq-code-block-outline-collapse-collapsed-background)}.kbq-code-block.kbq-code-block_outline .kbq-code-block__view-all.kbq-code-block__view-all_collapsed .kbq-code-block__view-all__wrapper{background:color-mix(in srgb,var(--kbq-code-block-outline-collapse-button-expand-background) 90%,transparent)}.kbq-code-block.kbq-code-block_filled{background:var(--kbq-code-block-filled-container-background);border-color:var(--kbq-code-block-filled-container-border-color)}.kbq-code-block.kbq-code-block_filled .kbq-code-block__header{background:var(--kbq-code-block-filled-header-background)}.kbq-code-block.kbq-code-block_filled.kbq-code-block_hide-tabs .kbq-code-block__actionbar{background:var(--kbq-code-block-filled-actionbar-plate-background)}.kbq-code-block.kbq-code-block_filled.kbq-code-block_hide-tabs .kbq-code-block__actionbar .kbq-code-block__actionbar__button-stack{border-color:var(--kbq-code-block-filled-actionbar-border-color);background:var(--kbq-code-block-filled-actionbar-background)}.kbq-code-block.kbq-code-block_filled .kbq-code-block__view-all.kbq-code-block__view-all_expanded{background:var(--kbq-code-block-filled-collapse-expanded-background)}.kbq-code-block.kbq-code-block_filled .kbq-code-block__view-all.kbq-code-block__view-all_collapsed{background:var(--kbq-code-block-filled-collapse-collapsed-background)}.kbq-code-block.kbq-code-block_filled .kbq-code-block__view-all.kbq-code-block__view-all_collapsed .kbq-code-block__view-all__wrapper{background:color-mix(in srgb,var(--kbq-code-block-filled-collapse-button-expand-background) 90%,transparent)}.kbq-code-block .kbq-code-block__main.cdk-keyboard-focused{outline-color:var(--kbq-states-line-focus-theme)}.kbq-code-block{font-size:var(--kbq-typography-mono-codeblock-font-size);font-style:var(--kbq-typography-mono-codeblock-font-style);font-weight:var(--kbq-typography-mono-codeblock-font-weight);line-height:var(--kbq-typography-mono-codeblock-line-height);font-family:var(--kbq-typography-mono-codeblock-font-family);text-transform:var(--kbq-typography-mono-codeblock-text-transform);font-feature-settings:var(--kbq-typography-mono-codeblock-font-feature-settings);letter-spacing:var(--kbq-typography-mono-codeblock-letter-spacing)}.kbq-code-block .kbq-code-block__pre,.kbq-code-block .kbq-code-block__code{font:inherit}\n", ".kbq-code-block{--kbq-code-block-size-container-border-width: var(--kbq-size-border-width);--kbq-code-block-size-container-border-width-focused: 2px;--kbq-code-block-size-container-border-radius: var(--kbq-size-border-radius);--kbq-code-block-size-with-header-content-padding-top: var(--kbq-size-xxs);--kbq-code-block-size-with-header-content-padding-bottom: var(--kbq-size-l);--kbq-code-block-size-with-header-content-padding-horizontal: var(--kbq-size-xl);--kbq-code-block-size-with-header-content-content-gap-horizontal: var(--kbq-size-m);--kbq-code-block-size-no-header-content-padding-vertical: 14px;--kbq-code-block-size-no-header-content-padding-horizontal: var(--kbq-size-xl);--kbq-code-block-size-no-header-content-content-gap-horizontal: var(--kbq-size-m);--kbq-code-block-size-header-content-gap-horizontal: var(--kbq-size-l);--kbq-code-block-size-actionbar-content-gap-horizontal: var(--kbq-size-3xs);--kbq-code-block-size-collapse-expanded-padding-top: 0;--kbq-code-block-size-collapse-expanded-padding-bottom: var(--kbq-size-l);--kbq-code-block-size-collapse-collapsed-padding-top: var(--kbq-size-3xl);--kbq-code-block-size-collapse-collapsed-padding-bottom: var(--kbq-size-l);--kbq-code-block-filled-container-background: var(--kbq-background-contrast-less);--kbq-code-block-filled-container-border-color: transparent;--kbq-code-block-filled-header-background: transparent;--kbq-code-block-filled-actionbar-background: var(--kbq-background-card);--kbq-code-block-filled-actionbar-border-color: var(--kbq-line-contrast-less);--kbq-code-block-filled-actionbar-plate-background: var(--kbq-background-bg-tertiary);--kbq-code-block-filled-collapse-expanded-background: transparent;--kbq-code-block-filled-collapse-collapsed-background: linear-gradient( 180deg, transparent, var(--kbq-background-bg-tertiary) 100% );--kbq-code-block-filled-collapse-button-expand-background: var(--kbq-background-bg-tertiary);--kbq-code-block-outline-container-background: var(--kbq-background-card);--kbq-code-block-outline-container-border-color: var(--kbq-divider-color, var(--kbq-line-contrast-less));--kbq-code-block-outline-header-background: var(--kbq-background-card);--kbq-code-block-outline-actionbar-background: var(--kbq-background-card);--kbq-code-block-outline-actionbar-border-color: var(--kbq-line-contrast-less);--kbq-code-block-outline-actionbar-plate-background: var(--kbq-code-block-outline-container-background);--kbq-code-block-outline-collapse-expanded-background: transparent;--kbq-code-block-outline-collapse-collapsed-background: linear-gradient( 180deg, transparent, var(--kbq-code-block-outline-container-background) 100% );--kbq-code-block-outline-collapse-button-expand-background: var(--kbq-background-bg);--kbq-code-block-tab-size: 4}\n"], dependencies: [{ kind: "ngmodule", type: KbqTabsModule }, { kind: "component", type: i2.KbqTabNavBar, selector: "[kbqTabNavBar], [kbq-tab-nav-bar]", inputs: ["transparent", "onSurface", "underlined", "tabNavPanel"], exportAs: ["kbqTabNavBar"] }, { kind: "directive", type: i2.KbqTabLink, selector: "[kbqTabLink], [kbq-tab-link]", inputs: ["id", "active", "disabled", "tabIndex"], exportAs: ["kbqTabLink"] }, { kind: "directive", type: i2.KbqTabNavPanel, selector: "[kbqTabNavPanel]", inputs: ["id"], exportAs: ["kbqTabNavPanel"] }, { kind: "ngmodule", type: KbqButtonModule }, { kind: "component", type: i3.KbqButton, selector: "[kbq-button]", inputs: ["kbqStyle", "disabled", "tabIndex"] }, { kind: "directive", type: i3.KbqButtonCssStyler, selector: "[kbq-button]" }, { kind: "directive", type: KbqCodeBlockHighlight, selector: "code[kbqCodeBlockHighlight]", inputs: ["file", "startFrom", "singleLine"], exportAs: ["kbqCodeBlockHighlight"] }, { kind: "ngmodule", type: A11yModule }, { kind: "directive", type: i4.CdkMonitorFocus, selector: "[cdkMonitorElementFocus], [cdkMonitorSubtreeFocus]", outputs: ["cdkFocusChange"], exportAs: ["cdkMonitorFocus"] }, { kind: "ngmodule", type: KbqToolTipModule }, { kind: "directive", type: i5.KbqTooltipTrigger, selector: "[kbqTooltip]", inputs: ["kbqTooltipScrollStrategy", "forDisabledComponent", "ignoreTooltipPointerEvents", "kbqTooltipSingleInstance", "kbqTrigger", "hideWithTimeout", "kbqEnterDelay", "kbqLeaveDelay", "kbqRelativeToPointer", "kbqRelativeToCaret", "kbqRelativeToCaretVertical", "kbqTooltip", "kbqTooltipHeader", "kbqTooltipModifier", "kbqTooltipContext", "kbqTooltipClass", "kbqTooltipColor", "kbqTooltipArrow", "kbqTooltipArrowCentered", "kbqTooltipOffset", "kbqTooltipDisabled", "kbqPlacementPriority", "kbqPlacement", "kbqVisible"], outputs: ["kbqPlacementChange", "kbqVisibleChange"], exportAs: ["kbqTooltip"] }, { kind: "ngmodule", type: KbqIconModule }, { kind: "component", type: i6.KbqIcon, selector: "[kbq-icon]", inputs: ["aria-hidden", "iconSize", "autoColor", "kbq-icon"] }, { kind: "directive", type: KbqScrollbarViewport, selector: "[kbqScrollbarViewport]", inputs: ["kbqScrollbarMode", "kbqScrollbarHideDelay"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: KbqOverflowShadowContainer, selector: "[kbqOverflowShadowContainer]", inputs: ["debounce"], exportAs: ["kbqOverflowShadowContainer"] }, { kind: "directive", type: KbqOverflowShadowTop, selector: "[kbqOverflowShadowTop]", inputs: ["kbqOverflowShadowTop", "shadow"], exportAs: ["kbqOverflowShadowTop"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
1106
790
|
}
|
|
1107
791
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: KbqCodeBlock, decorators: [{
|
|
1108
792
|
type: Component,
|
|
@@ -1129,7 +813,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImpo
|
|
|
1129
813
|
'[class.kbq-code-block_view-all]': 'viewAll()'
|
|
1130
814
|
}, hostDirectives: [
|
|
1131
815
|
{ directive: KbqLocaleOverridesDirective, inputs: ['kbqLocaleOverrides: localeOverrides'] }
|
|
1132
|
-
], exportAs: 'kbqCodeBlock', template: "<div class=\"kbq-code-block__header\" [kbqOverflowShadowTop]=\"codeBlockContent\">\n @if (!tabsHidden()) {\n <div class=\"kbq-code-block__header-tabs\">\n <div kbqTabNavBar transparent [tabNavPanel]=\"tabPanel\">\n @for (file of files(); track file) {\n <!-- Mark tab-link as readonly if only single file present -->\n <div\n kbqTabLink\n [active]=\"$count > 1 && renderedFileIndex() === $index\"\n [style.pointer-events]=\"$count === 1 ? 'none' : null\"\n (click)=\"onSelectedTabChange($index)\"\n >\n @if (tabLinkTemplate(); as linkTemplate) {\n <ng-container\n *ngTemplateOutlet=\"linkTemplate; context: { $implicit: file, fallbackFileName }\"\n />\n } @else {\n {{ file.filename || fallbackFileName }}\n }\n </div>\n }\n </div>\n </div>\n }\n\n <div class=\"kbq-code-block__actionbar\">\n <div class=\"kbq-code-block__actionbar__button-stack\">\n @if (canToggleSoftWrap()) {\n <button\n kbq-button\n class=\"kbq-code-block__actionbar__soft-wrap-button\"\n [attr.aria-label]=\"\n softWrap() ? localeConfiguration().softWrapOffTooltip : localeConfiguration().softWrapOnTooltip\n \"\n [color]=\"componentColor.Contrast\"\n [kbqStyle]=\"buttonStyle.Transparent\"\n [kbqTooltip]=\"\n softWrap() ? localeConfiguration().softWrapOffTooltip : localeConfiguration().softWrapOnTooltip\n \"\n (click)=\"toggleSoftWrap()\"\n >\n @if (softWrap()) {\n <i kbq-icon=\"kbq-text-overflow_16\"></i>\n } @else {\n <i kbq-icon=\"kbq-text-wrap_16\"></i>\n }\n </button>\n }\n\n @if (canDownload()) {\n <button\n kbq-button\n class=\"kbq-code-block__actionbar__download-button\"\n [attr.aria-label]=\"localeConfiguration().downloadTooltip\"\n [color]=\"componentColor.Contrast\"\n [kbqStyle]=\"buttonStyle.Transparent\"\n [kbqTooltip]=\"localeConfiguration().downloadTooltip\"\n (click)=\"downloadCode()\"\n >\n <i kbq-icon=\"kbq-arrow-down-to-line_16\"></i>\n </button>\n }\n\n @if (canCopy()) {\n <div #copyButtonTooltip=\"kbqTooltip\" [kbqTooltip]=\"localeConfiguration().copyTooltip\">\n <button\n kbq-button\n class=\"kbq-code-block__actionbar__copy-button\"\n [attr.aria-label]=\"localeConfiguration().copyTooltip\"\n [color]=\"componentColor.Contrast\"\n [kbqStyle]=\"buttonStyle.Transparent\"\n (click)=\"copyCode()\"\n >\n <i kbq-icon=\"kbq-file-multiple-o_16\"></i>\n </button>\n </div>\n }\n\n @if (activeFile()?.link) {\n <button\n kbq-button\n class=\"kbq-code-block__actionbar__link-button\"\n [attr.aria-label]=\"localeConfiguration().openExternalSystemTooltip\"\n [color]=\"componentColor.Contrast\"\n [kbqStyle]=\"buttonStyle.Transparent\"\n [kbqTooltip]=\"localeConfiguration().openExternalSystemTooltip\"\n (click)=\"openLink()\"\n >\n <i kbq-icon=\"kbq-arrow-up-right-from-square_16\"></i>\n </button>\n }\n </div>\n </div>\n</div>\n\n<div\n #tabPanel=\"kbqTabNavPanel\"\n #codeBlockContent=\"kbqOverflowShadowContainer\"\n cdkMonitorElementFocus\n kbqOverflowShadowContainer\n kbqScrollbarViewport\n kbqTabNavPanel\n class=\"kbq-code-block__main\"\n tabindex=\"0\"\n [style.max-height.px]=\"calculatedMaxHeight()\"\n>\n @if (activeFile(); as file) {\n <pre\n #codeBlockPre\n class=\"kbq-code-block__pre\"\n ><code #codeBlockCode kbqCodeBlockHighlight class=\"kbq-code-block__code\" [file]=\"file\"></code></pre>\n }\n\n @if (contentExceedsMaxHeight()) {\n <div\n class=\"kbq-code-block__view-all\"\n [class.kbq-code-block__view-all_collapsed]=\"!viewAll()\"\n [class.kbq-code-block__view-all_expanded]=\"viewAll()\"\n >\n <div class=\"kbq-code-block__view-all__wrapper\">\n <button\n kbq-button\n class=\"kbq-code-block__view-all__button\"\n [color]=\"componentColor.Theme\"\n [kbqStyle]=\"buttonStyle.Transparent\"\n (click)=\"toggleViewAll()\"\n (keydown.enter)=\"onViewAllEnterKeydown($event)\"\n >\n @if (viewAll()) {\n <i kbq-icon=\"kbq-chevron-up_16\"></i>\n {{ localeConfiguration().viewLessText }}\n } @else {\n <i kbq-icon=\"kbq-chevron-down_16\"></i>\n {{ localeConfiguration().viewAllText }}\n }\n </button>\n </div>\n </div>\n }\n</div>\n", styles: [".kbq-code-block{display:flex;flex-direction:column;position:relative;border-width:var(--kbq-code-block-size-container-border-width);border-style:solid;border-radius:var(--kbq-code-block-size-container-border-radius)}@supports (corner-shape: squircle){.kbq-code-block{corner-shape:squircle;border-radius:clamp(var(--kbq-code-block-size-container-border-radius) * 1.85,var(--kbq-code-block-size-container-border-radius) * 2.3 - 3.6px,var(--kbq-code-block-size-container-border-radius) * 2)}}.kbq-code-block{box-sizing:border-box;hyphens:none;-ms-hyphens:none;-moz-hyphens:none;-webkit-hyphens:none}.kbq-code-block .kbq-code-block__header{display:flex;align-items:center;padding:var(--kbq-size-s) var(--kbq-size-m)}.kbq-code-block .kbq-code-block__header .kbq-code-block__header-tabs{overflow:hidden;flex-grow:1}.kbq-code-block .kbq-code-block__actionbar{display:flex;justify-content:right;align-items:center;z-index:1}.kbq-code-block .kbq-code-block__actionbar .kbq-code-block__actionbar__button-stack{display:flex;gap:var(--kbq-code-block-size-actionbar-content-gap-horizontal)}.kbq-code-block:has(.kbq-code-block__view-all) .kbq-code-block__main .kbq-code-block__code{padding-bottom:var(--kbq-size-3xl)!important}.kbq-code-block .kbq-code-block__main{flex-grow:1;flex-direction:column;border-radius:var(--kbq-code-block-size-container-border-radius)}@supports (corner-shape: squircle){.kbq-code-block .kbq-code-block__main{corner-shape:squircle;border-radius:clamp(var(--kbq-code-block-size-container-border-radius) * 1.85,var(--kbq-code-block-size-container-border-radius) * 2.3 - 3.6px,var(--kbq-code-block-size-container-border-radius) * 2)}}.kbq-code-block .kbq-code-block__main.cdk-keyboard-focused{outline-style:solid;outline-width:var(--kbq-code-block-size-container-border-width-focused);outline-offset:-1px}.kbq-code-block .kbq-code-block__main .kbq-code-block__pre{margin:0;flex-grow:1}.kbq-code-block .kbq-code-block__main .kbq-code-block__code{tab-size:var(--kbq-code-block-tab-size);padding:var(--kbq-code-block-size-with-header-content-padding-top) var(--kbq-code-block-size-with-header-content-padding-horizontal) var(--kbq-code-block-size-with-header-content-padding-bottom) var(--kbq-code-block-size-with-header-content-padding-horizontal)}.kbq-code-block .kbq-code-block__main .kbq-code-block__code:focus-visible{outline:none}.kbq-code-block .kbq-code-block__main .hljs{display:block}.kbq-code-block .kbq-code-block__main .hljs-ln-numbers{padding-right:var(--kbq-code-block-size-with-header-content-content-gap-horizontal);vertical-align:baseline;text-align:right}.kbq-code-block .kbq-code-block__main .hljs-ln{border-collapse:unset}.kbq-code-block .kbq-code-block__main .hljs-ln .hljs{padding:0}.kbq-code-block .kbq-code-block__main .hljs-ln-n:before{white-space:nowrap}.kbq-code-block.kbq-code-block_hide-line-numbers .hljs-ln-line.hljs-ln-numbers{display:none}.kbq-code-block.kbq-code-block_soft-wrap .kbq-code-block__code{white-space:pre-wrap;overflow-wrap:anywhere}.kbq-code-block:not(.kbq-code-block_soft-wrap) .kbq-code-block__pre{width:max-content;min-width:100%}.kbq-code-block.kbq-code-block_view-all .kbq-code-block__main{max-height:unset;overflow:auto}.kbq-code-block:not(.kbq-code-block_view-all) .kbq-code-block__main{overflow:hidden}.kbq-code-block.kbq-code-block_hide-tabs .kbq-code-block__header{padding:0}.kbq-code-block.kbq-code-block_hide-tabs .kbq-code-block__actionbar{display:none;position:absolute;top:0;right:0;margin:var(--kbq-size-s) var(--kbq-size-s) var(--kbq-size-s) 0}.kbq-code-block.kbq-code-block_hide-tabs .kbq-code-block__actionbar .kbq-code-block__actionbar__button-stack{border-width:1px;border-style:solid;border-radius:calc(var(--kbq-size-border-radius) + 1px)}@supports (corner-shape: squircle){.kbq-code-block.kbq-code-block_hide-tabs .kbq-code-block__actionbar .kbq-code-block__actionbar__button-stack{corner-shape:squircle;border-radius:clamp((var(--kbq-size-border-radius) + 1px) * 1.85,(var(--kbq-size-border-radius) + 1px) * 2.3 - 3.6px,(var(--kbq-size-border-radius) + 1px) * 2)}}.kbq-code-block.kbq-code-block_hide-tabs .kbq-code-block__main{position:relative}.kbq-code-block.kbq-code-block_hide-tabs .kbq-code-block__main .kbq-code-block__code{padding:var(--kbq-code-block-size-no-header-content-padding-vertical) var(--kbq-code-block-size-no-header-content-padding-horizontal)}.kbq-code-block.kbq-code-block_hide-tabs .kbq-code-block__main .hljs-ln-numbers{padding-right:var(--kbq-code-block-size-no-header-content-content-gap-horizontal)}.kbq-code-block:not(.kbq-code-block_hide-tabs) .kbq-code-block__header{border-radius:var(--kbq-code-block-size-container-border-radius) var(--kbq-code-block-size-container-border-radius) 0 0}@supports (corner-shape: squircle){.kbq-code-block:not(.kbq-code-block_hide-tabs) .kbq-code-block__header{corner-shape:squircle;border-radius:clamp(var(--kbq-code-block-size-container-border-radius) * 1.85,var(--kbq-code-block-size-container-border-radius) * 2.3 - 3.6px,var(--kbq-code-block-size-container-border-radius) * 2) clamp(var(--kbq-code-block-size-container-border-radius) * 1.85,var(--kbq-code-block-size-container-border-radius) * 2.3 - 3.6px,var(--kbq-code-block-size-container-border-radius) * 2) 0 0}}.kbq-code-block:not(.kbq-code-block_hide-tabs) .kbq-code-block__main{border-radius:0 0 var(--kbq-code-block-size-container-border-radius) var(--kbq-code-block-size-container-border-radius)}@supports (corner-shape: squircle){.kbq-code-block:not(.kbq-code-block_hide-tabs) .kbq-code-block__main{corner-shape:squircle;border-radius:0 0 clamp(var(--kbq-code-block-size-container-border-radius) * 1.85,var(--kbq-code-block-size-container-border-radius) * 2.3 - 3.6px,var(--kbq-code-block-size-container-border-radius) * 2) clamp(var(--kbq-code-block-size-container-border-radius) * 1.85,var(--kbq-code-block-size-container-border-radius) * 2.3 - 3.6px,var(--kbq-code-block-size-container-border-radius) * 2)}}.kbq-code-block.kbq-code-block_show-actionbar .kbq-code-block__actionbar{display:flex}.kbq-code-block:not(:has(.kbq-code-block__view-all)) .kbq-code-block__main{overflow:auto}.kbq-code-block .kbq-code-block__view-all{display:flex;justify-content:center;width:100%;position:absolute;bottom:calc(var(--kbq-code-block-size-container-border-width) * -1);border-radius:var(--kbq-code-block-size-container-border-radius)}@supports (corner-shape: squircle){.kbq-code-block .kbq-code-block__view-all{corner-shape:squircle;border-radius:clamp(var(--kbq-code-block-size-container-border-radius) * 1.85,var(--kbq-code-block-size-container-border-radius) * 2.3 - 3.6px,var(--kbq-code-block-size-container-border-radius) * 2)}}.kbq-code-block .kbq-code-block__view-all .kbq-code-block__view-all__wrapper{border-radius:var(--kbq-size-border-radius)}@supports (corner-shape: squircle){.kbq-code-block .kbq-code-block__view-all .kbq-code-block__view-all__wrapper{corner-shape:squircle;border-radius:clamp(var(--kbq-size-border-radius) * 1.85,var(--kbq-size-border-radius) * 2.3 - 3.6px,var(--kbq-size-border-radius) * 2)}}.kbq-code-block .kbq-code-block__view-all.kbq-code-block__view-all_collapsed{padding-top:var(--kbq-code-block-size-collapse-collapsed-padding-top);padding-bottom:var(--kbq-code-block-size-collapse-collapsed-padding-bottom)}.kbq-code-block .kbq-code-block__view-all.kbq-code-block__view-all_expanded{padding-top:var(--kbq-code-block-size-collapse-expanded-padding-top);margin-bottom:var(--kbq-code-block-size-collapse-expanded-padding-bottom)}.kbq-code-block.kbq-code-block_no-border{border-color:transparent!important}.kbq-code-block .hljs-addition{background-color:var(--kbq-code-block-hljs-addition-background);color:var(--kbq-code-block-hljs-addition-color)}.kbq-code-block .hljs-attr{background-color:var(--kbq-code-block-hljs-attr-background);color:var(--kbq-code-block-hljs-attr-color)}.kbq-code-block .hljs-attribute{background-color:var(--kbq-code-block-hljs-attribute-background);color:var(--kbq-code-block-hljs-attribute-color)}.kbq-code-block .hljs-built_in{background-color:var(--kbq-code-block-hljs-built-in-background);color:var(--kbq-code-block-hljs-built-in-color)}.kbq-code-block .hljs-bullet{background-color:var(--kbq-code-block-hljs-bullet-background);color:var(--kbq-code-block-hljs-bullet-color)}.kbq-code-block .hljs-char-escape{background-color:var(--kbq-code-block-hljs-char-escape-background);color:var(--kbq-code-block-hljs-char-escape-color)}.kbq-code-block .hljs-class{background-color:var(--kbq-code-block-hljs-class-background);color:var(--kbq-code-block-hljs-class-color)}.kbq-code-block .hljs-code{background-color:var(--kbq-code-block-hljs-code-background);color:var(--kbq-code-block-hljs-code-color)}.kbq-code-block .hljs-comment{background-color:var(--kbq-code-block-hljs-comment-background);color:var(--kbq-code-block-hljs-comment-color)}.kbq-code-block .hljs-deletion{background-color:var(--kbq-code-block-hljs-deletion-background);color:var(--kbq-code-block-hljs-deletion-color)}.kbq-code-block .hljs-doctag{background-color:var(--kbq-code-block-hljs-doctag-background);color:var(--kbq-code-block-hljs-doctag-color)}.kbq-code-block .hljs-emphasis{background-color:var(--kbq-code-block-hljs-emphasis-background);color:var(--kbq-code-block-hljs-emphasis-color)}.kbq-code-block .hljs-formula{background-color:var(--kbq-code-block-hljs-formula-background);color:var(--kbq-code-block-hljs-formula-color)}.kbq-code-block .hljs-function{background-color:var(--kbq-code-block-hljs-function-background);color:var(--kbq-code-block-hljs-function-color)}.kbq-code-block .hljs-keyword{background-color:var(--kbq-code-block-hljs-keyword-background);color:var(--kbq-code-block-hljs-keyword-color)}.kbq-code-block .hljs-link{background-color:var(--kbq-code-block-hljs-link-background);color:var(--kbq-code-block-hljs-link-color)}.kbq-code-block .hljs-literal{background-color:var(--kbq-code-block-hljs-literal-background);color:var(--kbq-code-block-hljs-literal-color)}.kbq-code-block .hljs-meta{background-color:var(--kbq-code-block-hljs-meta-background);color:var(--kbq-code-block-hljs-meta-color)}.kbq-code-block .hljs-meta-keyword{background-color:var(--kbq-code-block-hljs-meta-keyword-background);color:var(--kbq-code-block-hljs-meta-keyword-color)}.kbq-code-block .hljs-meta-string{background-color:var(--kbq-code-block-hljs-meta-string-background);color:var(--kbq-code-block-hljs-meta-string-color)}.kbq-code-block .hljs-meta-prompt{background-color:var(--kbq-code-block-hljs-meta-prompt-background);color:var(--kbq-code-block-hljs-meta-prompt-color)}.kbq-code-block .hljs-name{background-color:var(--kbq-code-block-hljs-name-background);color:var(--kbq-code-block-hljs-name-color)}.kbq-code-block .hljs-number{background-color:var(--kbq-code-block-hljs-number-background);color:var(--kbq-code-block-hljs-number-color)}.kbq-code-block .hljs-operator{background-color:var(--kbq-code-block-hljs-operator-background);color:var(--kbq-code-block-hljs-operator-color)}.kbq-code-block .hljs-params{background-color:var(--kbq-code-block-hljs-params-background);color:var(--kbq-code-block-hljs-params-color)}.kbq-code-block .hljs-property{background-color:var(--kbq-code-block-hljs-property-background);color:var(--kbq-code-block-hljs-property-color)}.kbq-code-block .hljs-punctuation{background-color:var(--kbq-code-block-hljs-punctuation-background);color:var(--kbq-code-block-hljs-punctuation-color)}.kbq-code-block .hljs-quote{background-color:var(--kbq-code-block-hljs-quote-background);color:var(--kbq-code-block-hljs-quote-color)}.kbq-code-block .hljs-regexp{background-color:var(--kbq-code-block-hljs-regexp-background);color:var(--kbq-code-block-hljs-regexp-color)}.kbq-code-block .hljs-section{background-color:var(--kbq-code-block-hljs-section-background);color:var(--kbq-code-block-hljs-section-color)}.kbq-code-block .hljs-selector-attr{background-color:var(--kbq-code-block-hljs-selector-attr-background);color:var(--kbq-code-block-hljs-selector-attr-color)}.kbq-code-block .hljs-selector-class{background-color:var(--kbq-code-block-hljs-selector-class-background);color:var(--kbq-code-block-hljs-selector-class-color)}.kbq-code-block .hljs-selector-id{background-color:var(--kbq-code-block-hljs-selector-id-background);color:var(--kbq-code-block-hljs-selector-id-color)}.kbq-code-block .hljs-selector-pseudo{background-color:var(--kbq-code-block-hljs-selector-pseudo-background);color:var(--kbq-code-block-hljs-selector-pseudo-color)}.kbq-code-block .hljs-selector-tag{background-color:var(--kbq-code-block-hljs-selector-tag-background);color:var(--kbq-code-block-hljs-selector-tag-color)}.kbq-code-block .hljs-string{background-color:var(--kbq-code-block-hljs-string-background);color:var(--kbq-code-block-hljs-string-color)}.kbq-code-block .hljs-strong{background-color:var(--kbq-code-block-hljs-strong-background);color:var(--kbq-code-block-hljs-strong-color)}.kbq-code-block .hljs-subst{background-color:var(--kbq-code-block-hljs-subst-background);color:var(--kbq-code-block-hljs-subst-color)}.kbq-code-block .hljs-symbol{background-color:var(--kbq-code-block-hljs-symbol-background);color:var(--kbq-code-block-hljs-symbol-color)}.kbq-code-block .hljs-tag{background-color:var(--kbq-code-block-hljs-tag-background);color:var(--kbq-code-block-hljs-tag-color)}.kbq-code-block .hljs-template-tag{background-color:var(--kbq-code-block-hljs-template-tag-background);color:var(--kbq-code-block-hljs-template-tag-color)}.kbq-code-block .hljs-template-variable{background-color:var(--kbq-code-block-hljs-template-variable-background);color:var(--kbq-code-block-hljs-template-variable-color)}.kbq-code-block .hljs-title{background-color:var(--kbq-code-block-hljs-title-background);color:var(--kbq-code-block-hljs-title-color)}.kbq-code-block .hljs-title-class{background-color:var(--kbq-code-block-hljs-title-class-background);color:var(--kbq-code-block-hljs-title-class-color)}.kbq-code-block .hljs-title-class-inherited{background-color:var(--kbq-code-block-hljs-title-class-inherited-background);color:var(--kbq-code-block-hljs-title-class-inherited-color)}.kbq-code-block .hljs-title-function{background-color:var(--kbq-code-block-hljs-title-function-background);color:var(--kbq-code-block-hljs-title-function-color)}.kbq-code-block .hljs-title-function-invoke{background-color:var(--kbq-code-block-hljs-title-function-invoke-background);color:var(--kbq-code-block-hljs-title-function-invoke-color)}.kbq-code-block .hljs-type{background-color:var(--kbq-code-block-hljs-type-background);color:var(--kbq-code-block-hljs-type-color)}.kbq-code-block .hljs-variable{background-color:var(--kbq-code-block-hljs-variable-background);color:var(--kbq-code-block-hljs-variable-color)}.kbq-code-block .hljs-variable-constant{background-color:var(--kbq-code-block-hljs-variable-constant-background);color:var(--kbq-code-block-hljs-variable-constant-color)}.kbq-code-block .hljs-variable-language{background-color:var(--kbq-code-block-hljs-variable-language-background);color:var(--kbq-code-block-hljs-variable-language-color)}.kbq-code-block .hljs-ln-n{color:var(--kbq-code-block-hljs-line-numbers-color)}.kbq-code-block.kbq-code-block_outline{background:var(--kbq-code-block-outline-container-background);border-color:var(--kbq-code-block-outline-container-border-color)}.kbq-code-block.kbq-code-block_outline .kbq-code-block__header{background:var(--kbq-code-block-outline-header-background)}.kbq-code-block.kbq-code-block_outline.kbq-code-block_hide-tabs .kbq-code-block__actionbar .kbq-code-block__actionbar__button-stack{border-color:var(--kbq-code-block-outline-actionbar-border-color);background:var(--kbq-code-block-outline-actionbar-background)}.kbq-code-block.kbq-code-block_outline .kbq-code-block__view-all .kbq-code-block__view-all__wrapper{background:var(--kbq-code-block-outline-collapse-button-expand-background);opacity:90%}.kbq-code-block.kbq-code-block_outline .kbq-code-block__view-all.kbq-code-block__view-all_expanded{background:var(--kbq-code-block-outline-collapse-expanded-background)}.kbq-code-block.kbq-code-block_outline .kbq-code-block__view-all.kbq-code-block__view-all_collapsed{background:var(--kbq-code-block-outline-collapse-collapsed-background)}.kbq-code-block.kbq-code-block_filled{background:var(--kbq-code-block-filled-container-background);border-color:var(--kbq-code-block-filled-container-border-color)}.kbq-code-block.kbq-code-block_filled .kbq-code-block__header{background:var(--kbq-code-block-filled-header-background)}.kbq-code-block.kbq-code-block_filled.kbq-code-block_hide-tabs .kbq-code-block__actionbar .kbq-code-block__actionbar__button-stack{border-color:var(--kbq-code-block-filled-actionbar-border-color);background:var(--kbq-code-block-filled-actionbar-background)}.kbq-code-block.kbq-code-block_filled .kbq-code-block__view-all .kbq-code-block__view-all__wrapper{background:var(--kbq-code-block-filled-collapse-button-expand-background);opacity:90%}.kbq-code-block.kbq-code-block_filled .kbq-code-block__view-all.kbq-code-block__view-all_expanded{background:var(--kbq-code-block-filled-collapse-expanded-background)}.kbq-code-block.kbq-code-block_filled .kbq-code-block__view-all.kbq-code-block__view-all_collapsed{background:var(--kbq-code-block-filled-collapse-collapsed-background)}.kbq-code-block .kbq-code-block__main.cdk-keyboard-focused{outline-color:var(--kbq-states-line-focus-theme)}.kbq-code-block{font-size:var(--kbq-typography-mono-codeblock-font-size);font-style:var(--kbq-typography-mono-codeblock-font-style);font-weight:var(--kbq-typography-mono-codeblock-font-weight);line-height:var(--kbq-typography-mono-codeblock-line-height);font-family:var(--kbq-typography-mono-codeblock-font-family);text-transform:var(--kbq-typography-mono-codeblock-text-transform);font-feature-settings:var(--kbq-typography-mono-codeblock-font-feature-settings);letter-spacing:var(--kbq-typography-mono-codeblock-letter-spacing)}.kbq-code-block .kbq-code-block__pre,.kbq-code-block .kbq-code-block__code{font:inherit}\n", ".kbq-code-block{--kbq-code-block-size-container-border-width: var(--kbq-size-border-width);--kbq-code-block-size-container-border-width-focused: 2px;--kbq-code-block-size-container-border-radius: var(--kbq-size-border-radius);--kbq-code-block-size-with-header-content-padding-top: var(--kbq-size-xxs);--kbq-code-block-size-with-header-content-padding-bottom: var(--kbq-size-l);--kbq-code-block-size-with-header-content-padding-horizontal: var(--kbq-size-xl);--kbq-code-block-size-with-header-content-content-gap-horizontal: var(--kbq-size-m);--kbq-code-block-size-no-header-content-padding-vertical: 14px;--kbq-code-block-size-no-header-content-padding-horizontal: var(--kbq-size-xl);--kbq-code-block-size-no-header-content-content-gap-horizontal: var(--kbq-size-m);--kbq-code-block-size-header-content-gap-horizontal: var(--kbq-size-l);--kbq-code-block-size-actionbar-content-gap-horizontal: var(--kbq-size-3xs);--kbq-code-block-size-collapse-expanded-padding-top: 0;--kbq-code-block-size-collapse-expanded-padding-bottom: var(--kbq-size-l);--kbq-code-block-size-collapse-collapsed-padding-top: var(--kbq-size-3xl);--kbq-code-block-size-collapse-collapsed-padding-bottom: var(--kbq-size-l);--kbq-code-block-filled-container-background: var(--kbq-background-contrast-less);--kbq-code-block-filled-container-border-color: transparent;--kbq-code-block-filled-header-background: transparent;--kbq-code-block-filled-actionbar-background: var(--kbq-background-card);--kbq-code-block-filled-actionbar-border-color: var(--kbq-line-contrast-less);--kbq-code-block-filled-collapse-expanded-background: transparent;--kbq-code-block-filled-collapse-collapsed-background: linear-gradient( 180deg, transparent, var(--kbq-background-bg-secondary) 100% );--kbq-code-block-filled-collapse-button-expand-background: var(--kbq-background-bg-secondary);--kbq-code-block-outline-container-background: var(--kbq-background-card);--kbq-code-block-outline-container-border-color: var(--kbq-divider-color, var(--kbq-line-contrast-less));--kbq-code-block-outline-header-background: var(--kbq-background-card);--kbq-code-block-outline-actionbar-background: var(--kbq-background-card);--kbq-code-block-outline-actionbar-border-color: var(--kbq-line-contrast-less);--kbq-code-block-outline-collapse-expanded-background: transparent;--kbq-code-block-outline-collapse-collapsed-background: linear-gradient( 180deg, transparent, var(--kbq-background-bg) 100% );--kbq-code-block-outline-collapse-button-expand-background: var(--kbq-background-card);--kbq-code-block-tab-size: 4}\n"] }]
|
|
816
|
+
], exportAs: 'kbqCodeBlock', template: "<div class=\"kbq-code-block__header\" [kbqOverflowShadowTop]=\"codeBlockContent\">\n @if (!tabsHidden()) {\n <div class=\"kbq-code-block__header-tabs\">\n <div kbqTabNavBar transparent [tabNavPanel]=\"tabPanel\">\n @for (file of files(); track file) {\n <!-- Mark tab-link as readonly if only single file present -->\n <div\n kbqTabLink\n [active]=\"$count > 1 && renderedFileIndex() === $index\"\n [style.pointer-events]=\"$count === 1 ? 'none' : null\"\n (click)=\"onSelectedTabChange($index)\"\n >\n @if (tabLinkTemplate(); as linkTemplate) {\n <ng-container\n *ngTemplateOutlet=\"linkTemplate; context: { $implicit: file, fallbackFileName }\"\n />\n } @else {\n {{ file.filename || fallbackFileName }}\n }\n </div>\n }\n </div>\n </div>\n }\n\n <div class=\"kbq-code-block__actionbar\">\n <div class=\"kbq-code-block__actionbar__button-stack\">\n @if (canToggleSoftWrap()) {\n <button\n kbq-button\n class=\"kbq-code-block__actionbar__soft-wrap-button\"\n [attr.aria-label]=\"\n softWrap() ? localeConfiguration().softWrapOffTooltip : localeConfiguration().softWrapOnTooltip\n \"\n [color]=\"componentColor.Contrast\"\n [kbqStyle]=\"buttonStyle.Transparent\"\n [kbqTooltip]=\"\n softWrap() ? localeConfiguration().softWrapOffTooltip : localeConfiguration().softWrapOnTooltip\n \"\n (click)=\"toggleSoftWrap()\"\n >\n @if (softWrap()) {\n <i kbq-icon=\"kbq-text-overflow_16\"></i>\n } @else {\n <i kbq-icon=\"kbq-text-wrap_16\"></i>\n }\n </button>\n }\n\n @if (canDownload()) {\n <button\n kbq-button\n class=\"kbq-code-block__actionbar__download-button\"\n [attr.aria-label]=\"localeConfiguration().downloadTooltip\"\n [color]=\"componentColor.Contrast\"\n [kbqStyle]=\"buttonStyle.Transparent\"\n [kbqTooltip]=\"localeConfiguration().downloadTooltip\"\n (click)=\"downloadCode()\"\n >\n <i kbq-icon=\"kbq-arrow-down-to-line_16\"></i>\n </button>\n }\n\n @if (canCopy()) {\n <div #copyButtonTooltip=\"kbqTooltip\" [kbqTooltip]=\"localeConfiguration().copyTooltip\">\n <button\n kbq-button\n class=\"kbq-code-block__actionbar__copy-button\"\n [attr.aria-label]=\"localeConfiguration().copyTooltip\"\n [color]=\"componentColor.Contrast\"\n [kbqStyle]=\"buttonStyle.Transparent\"\n (click)=\"copyCode()\"\n >\n <i kbq-icon=\"kbq-file-multiple-o_16\"></i>\n </button>\n </div>\n }\n\n @if (activeFile()?.link) {\n <button\n kbq-button\n class=\"kbq-code-block__actionbar__link-button\"\n [attr.aria-label]=\"localeConfiguration().openExternalSystemTooltip\"\n [color]=\"componentColor.Contrast\"\n [kbqStyle]=\"buttonStyle.Transparent\"\n [kbqTooltip]=\"localeConfiguration().openExternalSystemTooltip\"\n (click)=\"openLink()\"\n >\n <i kbq-icon=\"kbq-arrow-up-right-from-square_16\"></i>\n </button>\n }\n </div>\n </div>\n</div>\n\n<div\n #tabPanel=\"kbqTabNavPanel\"\n #codeBlockContent=\"kbqOverflowShadowContainer\"\n cdkMonitorElementFocus\n kbqOverflowShadowContainer\n kbqScrollbarViewport\n kbqTabNavPanel\n class=\"kbq-code-block__main\"\n tabindex=\"0\"\n [style.max-height.px]=\"calculatedMaxHeight()\"\n>\n @if (activeFile(); as file) {\n <pre\n #codeBlockPre\n class=\"kbq-code-block__pre\"\n ><code #codeBlockCode kbqCodeBlockHighlight class=\"kbq-code-block__code\" [file]=\"file\"></code></pre>\n }\n\n @if (contentExceedsMaxHeight()) {\n <div\n class=\"kbq-code-block__view-all\"\n [class.kbq-code-block__view-all_collapsed]=\"!viewAll()\"\n [class.kbq-code-block__view-all_expanded]=\"viewAll()\"\n >\n <div class=\"kbq-code-block__view-all__wrapper\">\n <button\n kbq-button\n class=\"kbq-code-block__view-all__button\"\n [color]=\"componentColor.Theme\"\n [kbqStyle]=\"buttonStyle.Transparent\"\n (click)=\"toggleViewAll()\"\n (keydown.enter)=\"onViewAllEnterKeydown($event)\"\n >\n @if (viewAll()) {\n <i kbq-icon=\"kbq-chevron-up_16\"></i>\n {{ localeConfiguration().viewLessText }}\n } @else {\n <i kbq-icon=\"kbq-chevron-down_16\"></i>\n {{ localeConfiguration().viewAllText }}\n }\n </button>\n </div>\n </div>\n }\n</div>\n", styles: [".kbq-code-block{display:flex;flex-direction:column;position:relative;border-width:var(--kbq-code-block-size-container-border-width);border-style:solid;border-radius:var(--kbq-code-block-size-container-border-radius)}@supports (corner-shape: squircle){.kbq-code-block{corner-shape:squircle;border-radius:clamp(var(--kbq-code-block-size-container-border-radius) * 1.85,var(--kbq-code-block-size-container-border-radius) * 2.3 - 3.6px,var(--kbq-code-block-size-container-border-radius) * 2)}}.kbq-code-block{box-sizing:border-box;hyphens:none;-ms-hyphens:none;-moz-hyphens:none;-webkit-hyphens:none}.kbq-code-block .kbq-code-block__header{display:flex;align-items:center;padding:var(--kbq-size-s) var(--kbq-size-m)}.kbq-code-block .kbq-code-block__header .kbq-code-block__header-tabs{overflow:hidden;flex-grow:1}.kbq-code-block .kbq-code-block__actionbar{display:flex;justify-content:right;align-items:center;z-index:1}.kbq-code-block .kbq-code-block__actionbar .kbq-code-block__actionbar__button-stack{display:flex;gap:var(--kbq-code-block-size-actionbar-content-gap-horizontal)}.kbq-code-block:has(.kbq-code-block__view-all) .kbq-code-block__main .kbq-code-block__code{padding-bottom:calc(var(--kbq-size-3xl) + var(--kbq-code-block-size-collapse-expanded-padding-bottom))!important}.kbq-code-block .kbq-code-block__main{flex-grow:1;flex-direction:column;border-radius:var(--kbq-code-block-size-container-border-radius)}@supports (corner-shape: squircle){.kbq-code-block .kbq-code-block__main{corner-shape:squircle;border-radius:clamp(var(--kbq-code-block-size-container-border-radius) * 1.85,var(--kbq-code-block-size-container-border-radius) * 2.3 - 3.6px,var(--kbq-code-block-size-container-border-radius) * 2)}}.kbq-code-block .kbq-code-block__main.cdk-keyboard-focused{outline-style:solid;outline-width:var(--kbq-code-block-size-container-border-width-focused);outline-offset:-1px}.kbq-code-block .kbq-code-block__main .kbq-code-block__pre{margin:0;flex-grow:1}.kbq-code-block .kbq-code-block__main .kbq-code-block__code{--kbq-code-block-line-numbers-gap: var(--kbq-code-block-size-with-header-content-content-gap-horizontal);tab-size:var(--kbq-code-block-tab-size);padding:var(--kbq-code-block-size-with-header-content-padding-top) var(--kbq-code-block-size-with-header-content-padding-horizontal) var(--kbq-code-block-size-with-header-content-padding-bottom) var(--kbq-code-block-size-with-header-content-padding-horizontal)}.kbq-code-block .kbq-code-block__main .kbq-code-block__code:focus-visible{outline:none}.kbq-code-block .kbq-code-block__main .hljs,.kbq-code-block .kbq-code-block__main .kbq-code-block__line{display:block}.kbq-code-block:not(.kbq-code-block_hide-line-numbers) .kbq-code-block__code_line-numbers{--kbq-code-block-line-numbers-width: calc(var(--kbq-code-block-line-numbers-digits) * 1ch);--kbq-code-block-line-numbers-indent: calc( var(--kbq-code-block-line-numbers-width) + var(--kbq-code-block-line-numbers-gap) );counter-reset:kbq-code-block-line var(--kbq-code-block-line-numbers-start)}.kbq-code-block:not(.kbq-code-block_hide-line-numbers) .kbq-code-block__code_line-numbers .kbq-code-block__line{counter-increment:kbq-code-block-line;padding-inline-start:var(--kbq-code-block-line-numbers-indent);text-indent:calc(var(--kbq-code-block-line-numbers-indent) * -1)}.kbq-code-block:not(.kbq-code-block_hide-line-numbers) .kbq-code-block__code_line-numbers .kbq-code-block__line:before{content:counter(kbq-code-block-line)/\"\";display:inline-block;width:var(--kbq-code-block-line-numbers-width);margin-inline-end:var(--kbq-code-block-line-numbers-gap);text-align:end;text-indent:0;white-space:nowrap}.kbq-code-block.kbq-code-block_soft-wrap .kbq-code-block__code{white-space:pre-wrap;overflow-wrap:anywhere}.kbq-code-block:not(.kbq-code-block_soft-wrap) .kbq-code-block__pre{width:max-content;min-width:100%}.kbq-code-block.kbq-code-block_view-all .kbq-code-block__main{max-height:unset;overflow:auto}.kbq-code-block:not(.kbq-code-block_view-all) .kbq-code-block__main{overflow:hidden}.kbq-code-block.kbq-code-block_hide-tabs{isolation:isolate}.kbq-code-block.kbq-code-block_hide-tabs .kbq-code-block__header{padding:0}.kbq-code-block.kbq-code-block_hide-tabs .kbq-code-block__actionbar{display:none;position:absolute;top:0;right:0;padding:var(--kbq-size-s) var(--kbq-size-s) 0 0;border-top-right-radius:var(--kbq-code-block-size-container-border-radius)}@supports (corner-shape: squircle){.kbq-code-block.kbq-code-block_hide-tabs .kbq-code-block__actionbar{corner-shape:squircle;border-top-right-radius:clamp(var(--kbq-code-block-size-container-border-radius) * 1.85,var(--kbq-code-block-size-container-border-radius) * 2.3 - 3.6px,var(--kbq-code-block-size-container-border-radius) * 2)}}.kbq-code-block.kbq-code-block_hide-tabs .kbq-code-block__actionbar .kbq-code-block__actionbar__button-stack{border-width:1px;border-style:solid;border-radius:calc(var(--kbq-size-border-radius) + 1px)}@supports (corner-shape: squircle){.kbq-code-block.kbq-code-block_hide-tabs .kbq-code-block__actionbar .kbq-code-block__actionbar__button-stack{corner-shape:squircle;border-radius:clamp((var(--kbq-size-border-radius) + 1px) * 1.85,(var(--kbq-size-border-radius) + 1px) * 2.3 - 3.6px,(var(--kbq-size-border-radius) + 1px) * 2)}}.kbq-code-block.kbq-code-block_hide-tabs .kbq-code-block__main{position:relative;isolation:auto}.kbq-code-block.kbq-code-block_hide-tabs .kbq-code-block__main .kbq-code-block__code{--kbq-code-block-line-numbers-gap: var(--kbq-code-block-size-no-header-content-content-gap-horizontal);padding:var(--kbq-code-block-size-no-header-content-padding-vertical) var(--kbq-code-block-size-no-header-content-padding-horizontal)}.kbq-code-block:not(.kbq-code-block_hide-tabs) .kbq-code-block__header{border-radius:var(--kbq-code-block-size-container-border-radius) var(--kbq-code-block-size-container-border-radius) 0 0}@supports (corner-shape: squircle){.kbq-code-block:not(.kbq-code-block_hide-tabs) .kbq-code-block__header{corner-shape:squircle;border-radius:clamp(var(--kbq-code-block-size-container-border-radius) * 1.85,var(--kbq-code-block-size-container-border-radius) * 2.3 - 3.6px,var(--kbq-code-block-size-container-border-radius) * 2) clamp(var(--kbq-code-block-size-container-border-radius) * 1.85,var(--kbq-code-block-size-container-border-radius) * 2.3 - 3.6px,var(--kbq-code-block-size-container-border-radius) * 2) 0 0}}.kbq-code-block:not(.kbq-code-block_hide-tabs) .kbq-code-block__main{border-radius:0 0 var(--kbq-code-block-size-container-border-radius) var(--kbq-code-block-size-container-border-radius)}@supports (corner-shape: squircle){.kbq-code-block:not(.kbq-code-block_hide-tabs) .kbq-code-block__main{corner-shape:squircle;border-radius:0 0 clamp(var(--kbq-code-block-size-container-border-radius) * 1.85,var(--kbq-code-block-size-container-border-radius) * 2.3 - 3.6px,var(--kbq-code-block-size-container-border-radius) * 2) clamp(var(--kbq-code-block-size-container-border-radius) * 1.85,var(--kbq-code-block-size-container-border-radius) * 2.3 - 3.6px,var(--kbq-code-block-size-container-border-radius) * 2)}}.kbq-code-block.kbq-code-block_show-actionbar .kbq-code-block__actionbar{display:flex}.kbq-code-block:not(:has(.kbq-code-block__view-all)) .kbq-code-block__main{overflow:auto}.kbq-code-block .kbq-code-block__view-all{display:flex;justify-content:center;width:100%;position:absolute;bottom:calc(var(--kbq-code-block-size-container-border-width) * -1);border-radius:var(--kbq-code-block-size-container-border-radius)}@supports (corner-shape: squircle){.kbq-code-block .kbq-code-block__view-all{corner-shape:squircle;border-radius:clamp(var(--kbq-code-block-size-container-border-radius) * 1.85,var(--kbq-code-block-size-container-border-radius) * 2.3 - 3.6px,var(--kbq-code-block-size-container-border-radius) * 2)}}.kbq-code-block .kbq-code-block__view-all .kbq-code-block__view-all__wrapper{border-radius:var(--kbq-size-border-radius)}@supports (corner-shape: squircle){.kbq-code-block .kbq-code-block__view-all .kbq-code-block__view-all__wrapper{corner-shape:squircle;border-radius:clamp(var(--kbq-size-border-radius) * 1.85,var(--kbq-size-border-radius) * 2.3 - 3.6px,var(--kbq-size-border-radius) * 2)}}.kbq-code-block .kbq-code-block__view-all.kbq-code-block__view-all_collapsed{padding-top:var(--kbq-code-block-size-collapse-collapsed-padding-top);padding-bottom:var(--kbq-code-block-size-collapse-collapsed-padding-bottom)}.kbq-code-block .kbq-code-block__view-all.kbq-code-block__view-all_expanded{padding-top:var(--kbq-code-block-size-collapse-expanded-padding-top);margin-bottom:var(--kbq-code-block-size-collapse-expanded-padding-bottom)}.kbq-code-block.kbq-code-block_no-border{border-color:transparent!important}.kbq-code-block .hljs-addition{background-color:var(--kbq-code-block-hljs-addition-background);color:var(--kbq-code-block-hljs-addition-color)}.kbq-code-block .hljs-attr{background-color:var(--kbq-code-block-hljs-attr-background);color:var(--kbq-code-block-hljs-attr-color)}.kbq-code-block .hljs-attribute{background-color:var(--kbq-code-block-hljs-attribute-background);color:var(--kbq-code-block-hljs-attribute-color)}.kbq-code-block .hljs-built_in{background-color:var(--kbq-code-block-hljs-built-in-background);color:var(--kbq-code-block-hljs-built-in-color)}.kbq-code-block .hljs-bullet{background-color:var(--kbq-code-block-hljs-bullet-background);color:var(--kbq-code-block-hljs-bullet-color)}.kbq-code-block .hljs-char-escape{background-color:var(--kbq-code-block-hljs-char-escape-background);color:var(--kbq-code-block-hljs-char-escape-color)}.kbq-code-block .hljs-class{background-color:var(--kbq-code-block-hljs-class-background);color:var(--kbq-code-block-hljs-class-color)}.kbq-code-block .hljs-code{background-color:var(--kbq-code-block-hljs-code-background);color:var(--kbq-code-block-hljs-code-color)}.kbq-code-block .hljs-comment{background-color:var(--kbq-code-block-hljs-comment-background);color:var(--kbq-code-block-hljs-comment-color)}.kbq-code-block .hljs-deletion{background-color:var(--kbq-code-block-hljs-deletion-background);color:var(--kbq-code-block-hljs-deletion-color)}.kbq-code-block .hljs-doctag{background-color:var(--kbq-code-block-hljs-doctag-background);color:var(--kbq-code-block-hljs-doctag-color)}.kbq-code-block .hljs-emphasis{background-color:var(--kbq-code-block-hljs-emphasis-background);color:var(--kbq-code-block-hljs-emphasis-color)}.kbq-code-block .hljs-formula{background-color:var(--kbq-code-block-hljs-formula-background);color:var(--kbq-code-block-hljs-formula-color)}.kbq-code-block .hljs-function{background-color:var(--kbq-code-block-hljs-function-background);color:var(--kbq-code-block-hljs-function-color)}.kbq-code-block .hljs-keyword{background-color:var(--kbq-code-block-hljs-keyword-background);color:var(--kbq-code-block-hljs-keyword-color)}.kbq-code-block .hljs-link{background-color:var(--kbq-code-block-hljs-link-background);color:var(--kbq-code-block-hljs-link-color)}.kbq-code-block .hljs-literal{background-color:var(--kbq-code-block-hljs-literal-background);color:var(--kbq-code-block-hljs-literal-color)}.kbq-code-block .hljs-meta{background-color:var(--kbq-code-block-hljs-meta-background);color:var(--kbq-code-block-hljs-meta-color)}.kbq-code-block .hljs-meta-keyword{background-color:var(--kbq-code-block-hljs-meta-keyword-background);color:var(--kbq-code-block-hljs-meta-keyword-color)}.kbq-code-block .hljs-meta-string{background-color:var(--kbq-code-block-hljs-meta-string-background);color:var(--kbq-code-block-hljs-meta-string-color)}.kbq-code-block .hljs-meta-prompt{background-color:var(--kbq-code-block-hljs-meta-prompt-background);color:var(--kbq-code-block-hljs-meta-prompt-color)}.kbq-code-block .hljs-name{background-color:var(--kbq-code-block-hljs-name-background);color:var(--kbq-code-block-hljs-name-color)}.kbq-code-block .hljs-number{background-color:var(--kbq-code-block-hljs-number-background);color:var(--kbq-code-block-hljs-number-color)}.kbq-code-block .hljs-operator{background-color:var(--kbq-code-block-hljs-operator-background);color:var(--kbq-code-block-hljs-operator-color)}.kbq-code-block .hljs-params{background-color:var(--kbq-code-block-hljs-params-background);color:var(--kbq-code-block-hljs-params-color)}.kbq-code-block .hljs-property{background-color:var(--kbq-code-block-hljs-property-background);color:var(--kbq-code-block-hljs-property-color)}.kbq-code-block .hljs-punctuation{background-color:var(--kbq-code-block-hljs-punctuation-background);color:var(--kbq-code-block-hljs-punctuation-color)}.kbq-code-block .hljs-quote{background-color:var(--kbq-code-block-hljs-quote-background);color:var(--kbq-code-block-hljs-quote-color)}.kbq-code-block .hljs-regexp{background-color:var(--kbq-code-block-hljs-regexp-background);color:var(--kbq-code-block-hljs-regexp-color)}.kbq-code-block .hljs-section{background-color:var(--kbq-code-block-hljs-section-background);color:var(--kbq-code-block-hljs-section-color)}.kbq-code-block .hljs-selector-attr{background-color:var(--kbq-code-block-hljs-selector-attr-background);color:var(--kbq-code-block-hljs-selector-attr-color)}.kbq-code-block .hljs-selector-class{background-color:var(--kbq-code-block-hljs-selector-class-background);color:var(--kbq-code-block-hljs-selector-class-color)}.kbq-code-block .hljs-selector-id{background-color:var(--kbq-code-block-hljs-selector-id-background);color:var(--kbq-code-block-hljs-selector-id-color)}.kbq-code-block .hljs-selector-pseudo{background-color:var(--kbq-code-block-hljs-selector-pseudo-background);color:var(--kbq-code-block-hljs-selector-pseudo-color)}.kbq-code-block .hljs-selector-tag{background-color:var(--kbq-code-block-hljs-selector-tag-background);color:var(--kbq-code-block-hljs-selector-tag-color)}.kbq-code-block .hljs-string{background-color:var(--kbq-code-block-hljs-string-background);color:var(--kbq-code-block-hljs-string-color)}.kbq-code-block .hljs-strong{background-color:var(--kbq-code-block-hljs-strong-background);color:var(--kbq-code-block-hljs-strong-color)}.kbq-code-block .hljs-subst{background-color:var(--kbq-code-block-hljs-subst-background);color:var(--kbq-code-block-hljs-subst-color)}.kbq-code-block .hljs-symbol{background-color:var(--kbq-code-block-hljs-symbol-background);color:var(--kbq-code-block-hljs-symbol-color)}.kbq-code-block .hljs-tag{background-color:var(--kbq-code-block-hljs-tag-background);color:var(--kbq-code-block-hljs-tag-color)}.kbq-code-block .hljs-template-tag{background-color:var(--kbq-code-block-hljs-template-tag-background);color:var(--kbq-code-block-hljs-template-tag-color)}.kbq-code-block .hljs-template-variable{background-color:var(--kbq-code-block-hljs-template-variable-background);color:var(--kbq-code-block-hljs-template-variable-color)}.kbq-code-block .hljs-title{background-color:var(--kbq-code-block-hljs-title-background);color:var(--kbq-code-block-hljs-title-color)}.kbq-code-block .hljs-title-class{background-color:var(--kbq-code-block-hljs-title-class-background);color:var(--kbq-code-block-hljs-title-class-color)}.kbq-code-block .hljs-title-class-inherited{background-color:var(--kbq-code-block-hljs-title-class-inherited-background);color:var(--kbq-code-block-hljs-title-class-inherited-color)}.kbq-code-block .hljs-title-function{background-color:var(--kbq-code-block-hljs-title-function-background);color:var(--kbq-code-block-hljs-title-function-color)}.kbq-code-block .hljs-title-function-invoke{background-color:var(--kbq-code-block-hljs-title-function-invoke-background);color:var(--kbq-code-block-hljs-title-function-invoke-color)}.kbq-code-block .hljs-type{background-color:var(--kbq-code-block-hljs-type-background);color:var(--kbq-code-block-hljs-type-color)}.kbq-code-block .hljs-variable{background-color:var(--kbq-code-block-hljs-variable-background);color:var(--kbq-code-block-hljs-variable-color)}.kbq-code-block .hljs-variable-constant{background-color:var(--kbq-code-block-hljs-variable-constant-background);color:var(--kbq-code-block-hljs-variable-constant-color)}.kbq-code-block .hljs-variable-language{background-color:var(--kbq-code-block-hljs-variable-language-background);color:var(--kbq-code-block-hljs-variable-language-color)}.kbq-code-block .kbq-code-block__line:before{color:var(--kbq-code-block-hljs-line-numbers-color)}.kbq-code-block.kbq-code-block_outline{background:var(--kbq-code-block-outline-container-background);border-color:var(--kbq-code-block-outline-container-border-color)}.kbq-code-block.kbq-code-block_outline .kbq-code-block__header{background:var(--kbq-code-block-outline-header-background)}.kbq-code-block.kbq-code-block_outline.kbq-code-block_hide-tabs .kbq-code-block__actionbar{background:var(--kbq-code-block-outline-actionbar-plate-background)}.kbq-code-block.kbq-code-block_outline.kbq-code-block_hide-tabs .kbq-code-block__actionbar .kbq-code-block__actionbar__button-stack{border-color:var(--kbq-code-block-outline-actionbar-border-color);background:var(--kbq-code-block-outline-actionbar-background)}.kbq-code-block.kbq-code-block_outline .kbq-code-block__view-all.kbq-code-block__view-all_expanded{background:var(--kbq-code-block-outline-collapse-expanded-background)}.kbq-code-block.kbq-code-block_outline .kbq-code-block__view-all.kbq-code-block__view-all_collapsed{background:var(--kbq-code-block-outline-collapse-collapsed-background)}.kbq-code-block.kbq-code-block_outline .kbq-code-block__view-all.kbq-code-block__view-all_collapsed .kbq-code-block__view-all__wrapper{background:color-mix(in srgb,var(--kbq-code-block-outline-collapse-button-expand-background) 90%,transparent)}.kbq-code-block.kbq-code-block_filled{background:var(--kbq-code-block-filled-container-background);border-color:var(--kbq-code-block-filled-container-border-color)}.kbq-code-block.kbq-code-block_filled .kbq-code-block__header{background:var(--kbq-code-block-filled-header-background)}.kbq-code-block.kbq-code-block_filled.kbq-code-block_hide-tabs .kbq-code-block__actionbar{background:var(--kbq-code-block-filled-actionbar-plate-background)}.kbq-code-block.kbq-code-block_filled.kbq-code-block_hide-tabs .kbq-code-block__actionbar .kbq-code-block__actionbar__button-stack{border-color:var(--kbq-code-block-filled-actionbar-border-color);background:var(--kbq-code-block-filled-actionbar-background)}.kbq-code-block.kbq-code-block_filled .kbq-code-block__view-all.kbq-code-block__view-all_expanded{background:var(--kbq-code-block-filled-collapse-expanded-background)}.kbq-code-block.kbq-code-block_filled .kbq-code-block__view-all.kbq-code-block__view-all_collapsed{background:var(--kbq-code-block-filled-collapse-collapsed-background)}.kbq-code-block.kbq-code-block_filled .kbq-code-block__view-all.kbq-code-block__view-all_collapsed .kbq-code-block__view-all__wrapper{background:color-mix(in srgb,var(--kbq-code-block-filled-collapse-button-expand-background) 90%,transparent)}.kbq-code-block .kbq-code-block__main.cdk-keyboard-focused{outline-color:var(--kbq-states-line-focus-theme)}.kbq-code-block{font-size:var(--kbq-typography-mono-codeblock-font-size);font-style:var(--kbq-typography-mono-codeblock-font-style);font-weight:var(--kbq-typography-mono-codeblock-font-weight);line-height:var(--kbq-typography-mono-codeblock-line-height);font-family:var(--kbq-typography-mono-codeblock-font-family);text-transform:var(--kbq-typography-mono-codeblock-text-transform);font-feature-settings:var(--kbq-typography-mono-codeblock-font-feature-settings);letter-spacing:var(--kbq-typography-mono-codeblock-letter-spacing)}.kbq-code-block .kbq-code-block__pre,.kbq-code-block .kbq-code-block__code{font:inherit}\n", ".kbq-code-block{--kbq-code-block-size-container-border-width: var(--kbq-size-border-width);--kbq-code-block-size-container-border-width-focused: 2px;--kbq-code-block-size-container-border-radius: var(--kbq-size-border-radius);--kbq-code-block-size-with-header-content-padding-top: var(--kbq-size-xxs);--kbq-code-block-size-with-header-content-padding-bottom: var(--kbq-size-l);--kbq-code-block-size-with-header-content-padding-horizontal: var(--kbq-size-xl);--kbq-code-block-size-with-header-content-content-gap-horizontal: var(--kbq-size-m);--kbq-code-block-size-no-header-content-padding-vertical: 14px;--kbq-code-block-size-no-header-content-padding-horizontal: var(--kbq-size-xl);--kbq-code-block-size-no-header-content-content-gap-horizontal: var(--kbq-size-m);--kbq-code-block-size-header-content-gap-horizontal: var(--kbq-size-l);--kbq-code-block-size-actionbar-content-gap-horizontal: var(--kbq-size-3xs);--kbq-code-block-size-collapse-expanded-padding-top: 0;--kbq-code-block-size-collapse-expanded-padding-bottom: var(--kbq-size-l);--kbq-code-block-size-collapse-collapsed-padding-top: var(--kbq-size-3xl);--kbq-code-block-size-collapse-collapsed-padding-bottom: var(--kbq-size-l);--kbq-code-block-filled-container-background: var(--kbq-background-contrast-less);--kbq-code-block-filled-container-border-color: transparent;--kbq-code-block-filled-header-background: transparent;--kbq-code-block-filled-actionbar-background: var(--kbq-background-card);--kbq-code-block-filled-actionbar-border-color: var(--kbq-line-contrast-less);--kbq-code-block-filled-actionbar-plate-background: var(--kbq-background-bg-tertiary);--kbq-code-block-filled-collapse-expanded-background: transparent;--kbq-code-block-filled-collapse-collapsed-background: linear-gradient( 180deg, transparent, var(--kbq-background-bg-tertiary) 100% );--kbq-code-block-filled-collapse-button-expand-background: var(--kbq-background-bg-tertiary);--kbq-code-block-outline-container-background: var(--kbq-background-card);--kbq-code-block-outline-container-border-color: var(--kbq-divider-color, var(--kbq-line-contrast-less));--kbq-code-block-outline-header-background: var(--kbq-background-card);--kbq-code-block-outline-actionbar-background: var(--kbq-background-card);--kbq-code-block-outline-actionbar-border-color: var(--kbq-line-contrast-less);--kbq-code-block-outline-actionbar-plate-background: var(--kbq-code-block-outline-container-background);--kbq-code-block-outline-collapse-expanded-background: transparent;--kbq-code-block-outline-collapse-collapsed-background: linear-gradient( 180deg, transparent, var(--kbq-code-block-outline-container-background) 100% );--kbq-code-block-outline-collapse-button-expand-background: var(--kbq-background-bg);--kbq-code-block-tab-size: 4}\n"] }]
|
|
1133
817
|
}], ctorParameters: () => [], propDecorators: { copyButtonTooltip: [{ type: i0.ViewChild, args: ['copyButtonTooltip', { isSignal: true }] }], highlight: [{ type: i0.ViewChild, args: [i0.forwardRef(() => KbqCodeBlockHighlight), { isSignal: true }] }], scrollbarViewport: [{ type: i0.ViewChild, args: [i0.forwardRef(() => KbqScrollbarViewport), { isSignal: true }] }], preElementRef: [{ type: i0.ViewChild, args: ['codeBlockPre', { isSignal: true }] }], codeElementRef: [{ type: i0.ViewChild, args: ['codeBlockCode', { isSignal: true }] }], tabLinkTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => KbqCodeBlockTabLinkContent), { ...{ read: TemplateRef }, isSignal: true }] }], lineNumbers: [{ type: i0.Input, args: [{ isSignal: true, alias: "lineNumbers", required: false }] }], filled: [{ type: i0.Input, args: [{ isSignal: true, alias: "filled", required: false }] }], canToggleSoftWrap: [{ type: i0.Input, args: [{ isSignal: true, alias: "canToggleSoftWrap", required: false }] }], softWrapInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "softWrap", required: false }] }], softWrapChange: [{ type: i0.Output, args: ["softWrapChange"] }], viewAllInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "viewAll", required: false }] }], viewAllChange: [{ type: i0.Output, args: ["viewAllChange"] }], maxHeight: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxHeight", required: false }] }], canDownloadInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "canDownload", required: false }] }], canCopy: [{ type: i0.Input, args: [{ isSignal: true, alias: "canCopy", required: false }] }], alwaysShowActionbar: [{ type: i0.Input, args: [{ isSignal: true, alias: "alwaysShowActionbar", required: false }] }], filesInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "files", required: false }] }], activeFileIndexInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "activeFileIndex", required: false }] }], activeFileIndexChange: [{ type: i0.Output, args: ["activeFileIndexChange"] }], noBorder: [{ type: i0.Input, args: [{ isSignal: true, alias: "noBorder", required: false }] }], hideTabsInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "hideTabs", required: false }] }], hideTabsChange: [{ type: i0.Output, args: ["hideTabsChange"] }] } });
|
|
1134
818
|
|
|
1135
819
|
const COMPONENTS = [
|