@indigina/ui-kit 1.1.514 → 1.1.515
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.
|
@@ -2473,6 +2473,40 @@ const sanitizeLineForStructure = (line) => {
|
|
|
2473
2473
|
return withoutDoubleQuoted.replace(/'(?:\\.|[^'\\])*'/g, '');
|
|
2474
2474
|
};
|
|
2475
2475
|
const countMatches = (value, pattern) => pattern.exec(value)?.length ?? 0;
|
|
2476
|
+
const tokenizeScriban = (content) => {
|
|
2477
|
+
const tokens = [];
|
|
2478
|
+
let currentIndex = 0;
|
|
2479
|
+
while (currentIndex < content.length) {
|
|
2480
|
+
const directiveStartIndex = content.indexOf('{{', currentIndex);
|
|
2481
|
+
if (directiveStartIndex === -1) {
|
|
2482
|
+
tokens.push({
|
|
2483
|
+
type: 'text',
|
|
2484
|
+
value: content.slice(currentIndex),
|
|
2485
|
+
});
|
|
2486
|
+
break;
|
|
2487
|
+
}
|
|
2488
|
+
if (directiveStartIndex > currentIndex) {
|
|
2489
|
+
tokens.push({
|
|
2490
|
+
type: 'text',
|
|
2491
|
+
value: content.slice(currentIndex, directiveStartIndex),
|
|
2492
|
+
});
|
|
2493
|
+
}
|
|
2494
|
+
const directiveEndIndex = content.indexOf('}}', directiveStartIndex + 2);
|
|
2495
|
+
if (directiveEndIndex === -1) {
|
|
2496
|
+
tokens.push({
|
|
2497
|
+
type: 'text',
|
|
2498
|
+
value: content.slice(directiveStartIndex),
|
|
2499
|
+
});
|
|
2500
|
+
break;
|
|
2501
|
+
}
|
|
2502
|
+
tokens.push({
|
|
2503
|
+
type: 'directive',
|
|
2504
|
+
value: content.slice(directiveStartIndex, directiveEndIndex + 2),
|
|
2505
|
+
});
|
|
2506
|
+
currentIndex = directiveEndIndex + 2;
|
|
2507
|
+
}
|
|
2508
|
+
return tokens;
|
|
2509
|
+
};
|
|
2476
2510
|
const countLeadingClosers = (value) => {
|
|
2477
2511
|
let closersCount = 0;
|
|
2478
2512
|
for (const char of value) {
|
|
@@ -2496,6 +2530,109 @@ const getDirectiveInfo = (trimmedLine) => {
|
|
|
2496
2530
|
opensBlock: isDirectiveLine && /^\{\{[-~]?\s*(if|for|while|func|capture)\b/.test(trimmedLine),
|
|
2497
2531
|
};
|
|
2498
2532
|
};
|
|
2533
|
+
const pushCurrentScribanLine = (state, result) => {
|
|
2534
|
+
const trimmedLine = state.currentLine.trim();
|
|
2535
|
+
if (!trimmedLine) {
|
|
2536
|
+
state.currentLine = '';
|
|
2537
|
+
return;
|
|
2538
|
+
}
|
|
2539
|
+
result.push(trimmedLine);
|
|
2540
|
+
state.currentLine = '';
|
|
2541
|
+
state.lineJustClosed = true;
|
|
2542
|
+
};
|
|
2543
|
+
const pushScribanBlankLine = (state, result) => {
|
|
2544
|
+
if (state.currentLine.trim()) {
|
|
2545
|
+
pushCurrentScribanLine(state, result);
|
|
2546
|
+
return;
|
|
2547
|
+
}
|
|
2548
|
+
if (state.lineJustClosed) {
|
|
2549
|
+
state.lineJustClosed = false;
|
|
2550
|
+
return;
|
|
2551
|
+
}
|
|
2552
|
+
appendBlankLineIfNeeded(result);
|
|
2553
|
+
state.lineJustClosed = true;
|
|
2554
|
+
};
|
|
2555
|
+
const isScribanQuoteCharacter = (char) => char === '"' || char === '\'';
|
|
2556
|
+
const updateScribanActiveQuote = (activeQuote, char, previousChar) => {
|
|
2557
|
+
if (!isScribanQuoteCharacter(char) || previousChar === '\\') {
|
|
2558
|
+
return activeQuote;
|
|
2559
|
+
}
|
|
2560
|
+
if (activeQuote === char) {
|
|
2561
|
+
return null;
|
|
2562
|
+
}
|
|
2563
|
+
return activeQuote ?? char;
|
|
2564
|
+
};
|
|
2565
|
+
const getTrailingStructureCommaIndex = (text, startIndex) => {
|
|
2566
|
+
let nextIndex = startIndex + 1;
|
|
2567
|
+
while (nextIndex < text.length && /\s/.test(text[nextIndex])) {
|
|
2568
|
+
nextIndex += 1;
|
|
2569
|
+
}
|
|
2570
|
+
return text[nextIndex] === ',' ? nextIndex : null;
|
|
2571
|
+
};
|
|
2572
|
+
const appendScribanClosingStructure = (text, index, char, state, result) => {
|
|
2573
|
+
pushCurrentScribanLine(state, result);
|
|
2574
|
+
state.currentLine += char;
|
|
2575
|
+
const commaIndex = getTrailingStructureCommaIndex(text, index);
|
|
2576
|
+
if (commaIndex !== null) {
|
|
2577
|
+
state.currentLine += ',';
|
|
2578
|
+
pushCurrentScribanLine(state, result);
|
|
2579
|
+
return commaIndex + 1;
|
|
2580
|
+
}
|
|
2581
|
+
pushCurrentScribanLine(state, result);
|
|
2582
|
+
return index + 1;
|
|
2583
|
+
};
|
|
2584
|
+
const processScribanTextCharacter = (text, index, state, result) => {
|
|
2585
|
+
const char = text[index];
|
|
2586
|
+
const previousChar = index > 0 ? text[index - 1] : undefined;
|
|
2587
|
+
if (char === '\n') {
|
|
2588
|
+
pushScribanBlankLine(state, result);
|
|
2589
|
+
return index + 1;
|
|
2590
|
+
}
|
|
2591
|
+
state.lineJustClosed = false;
|
|
2592
|
+
state.activeQuote = updateScribanActiveQuote(state.activeQuote, char, previousChar);
|
|
2593
|
+
if (state.activeQuote) {
|
|
2594
|
+
state.currentLine += char;
|
|
2595
|
+
return index + 1;
|
|
2596
|
+
}
|
|
2597
|
+
if (char === '{' || char === '[' || char === ',') {
|
|
2598
|
+
state.currentLine += char;
|
|
2599
|
+
pushCurrentScribanLine(state, result);
|
|
2600
|
+
return index + 1;
|
|
2601
|
+
}
|
|
2602
|
+
if (char === '}' || char === ']') {
|
|
2603
|
+
return appendScribanClosingStructure(text, index, char, state, result);
|
|
2604
|
+
}
|
|
2605
|
+
state.currentLine += char;
|
|
2606
|
+
return index + 1;
|
|
2607
|
+
};
|
|
2608
|
+
const buildScribanLogicalLines = (content) => {
|
|
2609
|
+
const result = [];
|
|
2610
|
+
const tokens = tokenizeScriban(content);
|
|
2611
|
+
const state = { currentLine: '', lineJustClosed: false, activeQuote: null };
|
|
2612
|
+
const appendText = (text) => {
|
|
2613
|
+
let index = 0;
|
|
2614
|
+
while (index < text.length) {
|
|
2615
|
+
index = processScribanTextCharacter(text, index, state, result);
|
|
2616
|
+
}
|
|
2617
|
+
};
|
|
2618
|
+
for (const token of tokens) {
|
|
2619
|
+
if (token.type === 'text') {
|
|
2620
|
+
appendText(token.value);
|
|
2621
|
+
continue;
|
|
2622
|
+
}
|
|
2623
|
+
const trimmedDirective = token.value.trim();
|
|
2624
|
+
const directiveInfo = getDirectiveInfo(trimmedDirective);
|
|
2625
|
+
if (!directiveInfo.isDirectiveLine || (!directiveInfo.opensBlock && !directiveInfo.isElseDirective && !directiveInfo.isEndDirective)) {
|
|
2626
|
+
state.currentLine += token.value;
|
|
2627
|
+
continue;
|
|
2628
|
+
}
|
|
2629
|
+
pushCurrentScribanLine(state, result);
|
|
2630
|
+
result.push(trimmedDirective);
|
|
2631
|
+
state.lineJustClosed = true;
|
|
2632
|
+
}
|
|
2633
|
+
pushCurrentScribanLine(state, result);
|
|
2634
|
+
return result;
|
|
2635
|
+
};
|
|
2499
2636
|
const updateStructureIndentBeforeRender = (structureIndentLevel, trimmedLine) => {
|
|
2500
2637
|
const structureLine = sanitizeLineForStructure(trimmedLine);
|
|
2501
2638
|
const leadingClosers = countLeadingClosers(structureLine);
|
|
@@ -2548,7 +2685,7 @@ const formatScriban = (content) => {
|
|
|
2548
2685
|
if (!normalizedContent) {
|
|
2549
2686
|
return '';
|
|
2550
2687
|
}
|
|
2551
|
-
const lines = normalizedContent
|
|
2688
|
+
const lines = buildScribanLogicalLines(normalizedContent);
|
|
2552
2689
|
const result = [];
|
|
2553
2690
|
let state = {
|
|
2554
2691
|
blockIndentLevel: 0,
|
|
@@ -2595,7 +2732,7 @@ class KitCodeEditorFormatterService {
|
|
|
2595
2732
|
};
|
|
2596
2733
|
}
|
|
2597
2734
|
try {
|
|
2598
|
-
const value = await
|
|
2735
|
+
const value = await formatterDefinition.format(content);
|
|
2599
2736
|
return {
|
|
2600
2737
|
available: true,
|
|
2601
2738
|
value,
|
|
@@ -2804,7 +2941,7 @@ class KitCodeEditorComponent {
|
|
|
2804
2941
|
KitCodeEditorAdapterService,
|
|
2805
2942
|
KitCodeEditorFormatterService,
|
|
2806
2943
|
KitCodeEditorLanguageRegistryService,
|
|
2807
|
-
], viewQueries: [{ propertyName: "editorContainer", first: true, predicate: ["editorContainer"], descendants: true, isSignal: true }], ngImport: i0, template: "<div class=\"kit-code-editor\">\n @if (label()) {\n <kit-form-label class=\"kit-code-editor-label\"\n [text]=\"label()\"\n ></kit-form-label>\n }\n\n <div class=\"kit-code-editor-main\">\n @if (showToolbar()) {\n <div class=\"kit-code-editor-toolbar\">\n @if (showFormatAction()) {\n <kit-button class=\"kit-code-editor-toolbar-button\"\n [label]=\"'kit.codeEditor.format' | translate\"\n [disabled]=\"disabled()\"\n [type]=\"kitButtonType.GHOST\"\n [kind]=\"kitButtonKind.SMALL\"\n [icon]=\"kitSvgIcon.MAGIC_WAND\"\n [iconPosition]=\"kitButtonIconPosition.LEADING\"\n (clicked)=\"onFormatClicked()\"\n ></kit-button>\n }\n\n @if (showFindAction()) {\n <kit-button class=\"kit-code-editor-toolbar-button\"\n [label]=\"'kit.codeEditor.find' | translate\"\n [active]=\"isFindWidgetOpened()\"\n [disabled]=\"disabled()\"\n [type]=\"kitButtonType.GHOST\"\n [kind]=\"kitButtonKind.SMALL\"\n [icon]=\"kitSvgIcon.SEARCH\"\n [iconPosition]=\"kitButtonIconPosition.LEADING\"\n [iconType]=\"kitSvgIconType.STROKE\"\n (clicked)=\"onFindClicked()\"\n ></kit-button>\n }\n\n <kit-button class=\"kit-code-editor-toolbar-button\"\n [label]=\"'kit.codeEditor.lines' | translate\"\n [active]=\"localShowLineNumbers()\"\n [disabled]=\"disabled()\"\n [type]=\"kitButtonType.GHOST\"\n [kind]=\"kitButtonKind.SMALL\"\n [icon]=\"kitSvgIcon.NUMBER_LIST\"\n [iconPosition]=\"kitButtonIconPosition.LEADING\"\n (clicked)=\"onToggleLineNumbersClicked()\"\n ></kit-button>\n </div>\n }\n\n @if (toolbarMessage()) {\n <div class=\"kit-code-editor-toolbar-message\">\n {{ toolbarMessage() | translate }}\n </div>\n }\n\n <div class=\"kit-code-editor-input\"\n [style.height]=\"getEditorHeight()\"\n [class.disabled]=\"disabled()\">\n @if (!initializationError()) {\n <div #editorContainer\n class=\"kit-code-editor-container\"\n (focusout)=\"onEditorBlur()\"\n ></div>\n } @else {\n <div class=\"kit-code-editor-error\">{{ initializationError() | translate }}</div>\n }\n </div>\n </div>\n</div>\n", styles: [".kit-code-editor{display:block}.kit-code-editor-label{display:block;margin-bottom:4px}.kit-code-editor-main{padding:15px;border:1px solid var(--ui-kit-color-grey-11);border-radius:10px;background:var(--ui-kit-color-white)}.kit-code-editor-toolbar{display:flex;flex-wrap:wrap;gap:8px;margin-bottom:8px}.kit-code-editor-toolbar-message{margin-bottom:8px;color:var(--ui-kit-color-red-1);font-size:14px;line-height:1.4}.kit-code-editor-input{border:1px solid var(--ui-kit-color-grey-11)}.kit-code-editor-input.disabled{background:var(--ui-kit-color-grey-13);border-color:var(--ui-kit-color-grey-11)}.kit-code-editor-container{position:relative;width:100%;height:100%}.kit-code-editor-error{padding:8px 12px;color:var(--ui-kit-color-red-1);font-size:12px;line-height:1.4;background:var(--ui-kit-color-red-2)}.kit-code-editor .find-widget>.button.codicon-widget-close{box-sizing:content-box}.kit-code-editor .context-view{margin-bottom:5px}.kit-code-editor .context-view .hover-contents{white-space:nowrap!important}\n"], dependencies: [{ kind: "component", type: KitButtonComponent, selector: "kit-button", inputs: ["disabled", "label", "type", "icon", "iconType", "kind", "state", "iconPosition", "buttonClass", "active"], outputs: ["clicked"] }, { kind: "component", type: KitFormLabelComponent, selector: "kit-form-label", inputs: ["text", "for", "tooltip", "popoverConfig"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
2944
|
+
], viewQueries: [{ propertyName: "editorContainer", first: true, predicate: ["editorContainer"], descendants: true, isSignal: true }], ngImport: i0, template: "<div class=\"kit-code-editor\">\n @if (label()) {\n <kit-form-label class=\"kit-code-editor-label\"\n [text]=\"label()\"\n ></kit-form-label>\n }\n\n <div class=\"kit-code-editor-main\">\n @if (showToolbar()) {\n <div class=\"kit-code-editor-toolbar\">\n @if (showFormatAction()) {\n <kit-button class=\"kit-code-editor-toolbar-button\"\n [label]=\"'kit.codeEditor.format' | translate\"\n [disabled]=\"disabled()\"\n [type]=\"kitButtonType.GHOST\"\n [kind]=\"kitButtonKind.SMALL\"\n [icon]=\"kitSvgIcon.MAGIC_WAND\"\n [iconPosition]=\"kitButtonIconPosition.LEADING\"\n (clicked)=\"onFormatClicked()\"\n ></kit-button>\n }\n\n @if (showFindAction()) {\n <kit-button class=\"kit-code-editor-toolbar-button\"\n [label]=\"'kit.codeEditor.find' | translate\"\n [active]=\"isFindWidgetOpened()\"\n [disabled]=\"disabled()\"\n [type]=\"kitButtonType.GHOST\"\n [kind]=\"kitButtonKind.SMALL\"\n [icon]=\"kitSvgIcon.SEARCH\"\n [iconPosition]=\"kitButtonIconPosition.LEADING\"\n [iconType]=\"kitSvgIconType.STROKE\"\n (clicked)=\"onFindClicked()\"\n ></kit-button>\n }\n\n <kit-button class=\"kit-code-editor-toolbar-button\"\n [label]=\"'kit.codeEditor.lines' | translate\"\n [active]=\"localShowLineNumbers()\"\n [disabled]=\"disabled()\"\n [type]=\"kitButtonType.GHOST\"\n [kind]=\"kitButtonKind.SMALL\"\n [icon]=\"kitSvgIcon.NUMBER_LIST\"\n [iconPosition]=\"kitButtonIconPosition.LEADING\"\n (clicked)=\"onToggleLineNumbersClicked()\"\n ></kit-button>\n </div>\n }\n\n @if (toolbarMessage()) {\n <div class=\"kit-code-editor-toolbar-message\">\n {{ toolbarMessage() | translate }}\n </div>\n }\n\n <div class=\"kit-code-editor-input\"\n [style.height]=\"getEditorHeight()\"\n [class.disabled]=\"disabled()\">\n @if (!initializationError()) {\n <div #editorContainer\n class=\"kit-code-editor-container\"\n (focusout)=\"onEditorBlur()\"\n ></div>\n } @else {\n <div class=\"kit-code-editor-error\">{{ initializationError() | translate }}</div>\n }\n </div>\n </div>\n</div>\n", styles: [".kit-code-editor{display:block}.kit-code-editor-label{display:block;margin-bottom:4px}.kit-code-editor-main{padding:15px;border:1px solid var(--ui-kit-color-grey-11);border-radius:10px;background:var(--ui-kit-color-white)}.kit-code-editor-toolbar{display:flex;flex-wrap:wrap;gap:8px;margin-bottom:8px}.kit-code-editor-toolbar-message{margin-bottom:8px;color:var(--ui-kit-color-red-1);font-size:14px;line-height:1.4}.kit-code-editor-input{box-sizing:content-box;border:1px solid var(--ui-kit-color-grey-11)}.kit-code-editor-input.disabled{background:var(--ui-kit-color-grey-13);border-color:var(--ui-kit-color-grey-11)}.kit-code-editor-container{position:relative;width:100%;height:100%}.kit-code-editor-error{padding:8px 12px;color:var(--ui-kit-color-red-1);font-size:12px;line-height:1.4;background:var(--ui-kit-color-red-2)}.kit-code-editor .find-widget>.button.codicon-widget-close{box-sizing:content-box}.kit-code-editor .context-view{margin-bottom:5px}.kit-code-editor .context-view .hover-contents{white-space:nowrap!important}\n"], dependencies: [{ kind: "component", type: KitButtonComponent, selector: "kit-button", inputs: ["disabled", "label", "type", "icon", "iconType", "kind", "state", "iconPosition", "buttonClass", "active"], outputs: ["clicked"] }, { kind: "component", type: KitFormLabelComponent, selector: "kit-form-label", inputs: ["text", "for", "tooltip", "popoverConfig"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
2808
2945
|
}
|
|
2809
2946
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: KitCodeEditorComponent, decorators: [{
|
|
2810
2947
|
type: Component,
|
|
@@ -2821,7 +2958,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImpor
|
|
|
2821
2958
|
KitButtonComponent,
|
|
2822
2959
|
KitFormLabelComponent,
|
|
2823
2960
|
TranslatePipe,
|
|
2824
|
-
], template: "<div class=\"kit-code-editor\">\n @if (label()) {\n <kit-form-label class=\"kit-code-editor-label\"\n [text]=\"label()\"\n ></kit-form-label>\n }\n\n <div class=\"kit-code-editor-main\">\n @if (showToolbar()) {\n <div class=\"kit-code-editor-toolbar\">\n @if (showFormatAction()) {\n <kit-button class=\"kit-code-editor-toolbar-button\"\n [label]=\"'kit.codeEditor.format' | translate\"\n [disabled]=\"disabled()\"\n [type]=\"kitButtonType.GHOST\"\n [kind]=\"kitButtonKind.SMALL\"\n [icon]=\"kitSvgIcon.MAGIC_WAND\"\n [iconPosition]=\"kitButtonIconPosition.LEADING\"\n (clicked)=\"onFormatClicked()\"\n ></kit-button>\n }\n\n @if (showFindAction()) {\n <kit-button class=\"kit-code-editor-toolbar-button\"\n [label]=\"'kit.codeEditor.find' | translate\"\n [active]=\"isFindWidgetOpened()\"\n [disabled]=\"disabled()\"\n [type]=\"kitButtonType.GHOST\"\n [kind]=\"kitButtonKind.SMALL\"\n [icon]=\"kitSvgIcon.SEARCH\"\n [iconPosition]=\"kitButtonIconPosition.LEADING\"\n [iconType]=\"kitSvgIconType.STROKE\"\n (clicked)=\"onFindClicked()\"\n ></kit-button>\n }\n\n <kit-button class=\"kit-code-editor-toolbar-button\"\n [label]=\"'kit.codeEditor.lines' | translate\"\n [active]=\"localShowLineNumbers()\"\n [disabled]=\"disabled()\"\n [type]=\"kitButtonType.GHOST\"\n [kind]=\"kitButtonKind.SMALL\"\n [icon]=\"kitSvgIcon.NUMBER_LIST\"\n [iconPosition]=\"kitButtonIconPosition.LEADING\"\n (clicked)=\"onToggleLineNumbersClicked()\"\n ></kit-button>\n </div>\n }\n\n @if (toolbarMessage()) {\n <div class=\"kit-code-editor-toolbar-message\">\n {{ toolbarMessage() | translate }}\n </div>\n }\n\n <div class=\"kit-code-editor-input\"\n [style.height]=\"getEditorHeight()\"\n [class.disabled]=\"disabled()\">\n @if (!initializationError()) {\n <div #editorContainer\n class=\"kit-code-editor-container\"\n (focusout)=\"onEditorBlur()\"\n ></div>\n } @else {\n <div class=\"kit-code-editor-error\">{{ initializationError() | translate }}</div>\n }\n </div>\n </div>\n</div>\n", styles: [".kit-code-editor{display:block}.kit-code-editor-label{display:block;margin-bottom:4px}.kit-code-editor-main{padding:15px;border:1px solid var(--ui-kit-color-grey-11);border-radius:10px;background:var(--ui-kit-color-white)}.kit-code-editor-toolbar{display:flex;flex-wrap:wrap;gap:8px;margin-bottom:8px}.kit-code-editor-toolbar-message{margin-bottom:8px;color:var(--ui-kit-color-red-1);font-size:14px;line-height:1.4}.kit-code-editor-input{border:1px solid var(--ui-kit-color-grey-11)}.kit-code-editor-input.disabled{background:var(--ui-kit-color-grey-13);border-color:var(--ui-kit-color-grey-11)}.kit-code-editor-container{position:relative;width:100%;height:100%}.kit-code-editor-error{padding:8px 12px;color:var(--ui-kit-color-red-1);font-size:12px;line-height:1.4;background:var(--ui-kit-color-red-2)}.kit-code-editor .find-widget>.button.codicon-widget-close{box-sizing:content-box}.kit-code-editor .context-view{margin-bottom:5px}.kit-code-editor .context-view .hover-contents{white-space:nowrap!important}\n"] }]
|
|
2961
|
+
], template: "<div class=\"kit-code-editor\">\n @if (label()) {\n <kit-form-label class=\"kit-code-editor-label\"\n [text]=\"label()\"\n ></kit-form-label>\n }\n\n <div class=\"kit-code-editor-main\">\n @if (showToolbar()) {\n <div class=\"kit-code-editor-toolbar\">\n @if (showFormatAction()) {\n <kit-button class=\"kit-code-editor-toolbar-button\"\n [label]=\"'kit.codeEditor.format' | translate\"\n [disabled]=\"disabled()\"\n [type]=\"kitButtonType.GHOST\"\n [kind]=\"kitButtonKind.SMALL\"\n [icon]=\"kitSvgIcon.MAGIC_WAND\"\n [iconPosition]=\"kitButtonIconPosition.LEADING\"\n (clicked)=\"onFormatClicked()\"\n ></kit-button>\n }\n\n @if (showFindAction()) {\n <kit-button class=\"kit-code-editor-toolbar-button\"\n [label]=\"'kit.codeEditor.find' | translate\"\n [active]=\"isFindWidgetOpened()\"\n [disabled]=\"disabled()\"\n [type]=\"kitButtonType.GHOST\"\n [kind]=\"kitButtonKind.SMALL\"\n [icon]=\"kitSvgIcon.SEARCH\"\n [iconPosition]=\"kitButtonIconPosition.LEADING\"\n [iconType]=\"kitSvgIconType.STROKE\"\n (clicked)=\"onFindClicked()\"\n ></kit-button>\n }\n\n <kit-button class=\"kit-code-editor-toolbar-button\"\n [label]=\"'kit.codeEditor.lines' | translate\"\n [active]=\"localShowLineNumbers()\"\n [disabled]=\"disabled()\"\n [type]=\"kitButtonType.GHOST\"\n [kind]=\"kitButtonKind.SMALL\"\n [icon]=\"kitSvgIcon.NUMBER_LIST\"\n [iconPosition]=\"kitButtonIconPosition.LEADING\"\n (clicked)=\"onToggleLineNumbersClicked()\"\n ></kit-button>\n </div>\n }\n\n @if (toolbarMessage()) {\n <div class=\"kit-code-editor-toolbar-message\">\n {{ toolbarMessage() | translate }}\n </div>\n }\n\n <div class=\"kit-code-editor-input\"\n [style.height]=\"getEditorHeight()\"\n [class.disabled]=\"disabled()\">\n @if (!initializationError()) {\n <div #editorContainer\n class=\"kit-code-editor-container\"\n (focusout)=\"onEditorBlur()\"\n ></div>\n } @else {\n <div class=\"kit-code-editor-error\">{{ initializationError() | translate }}</div>\n }\n </div>\n </div>\n</div>\n", styles: [".kit-code-editor{display:block}.kit-code-editor-label{display:block;margin-bottom:4px}.kit-code-editor-main{padding:15px;border:1px solid var(--ui-kit-color-grey-11);border-radius:10px;background:var(--ui-kit-color-white)}.kit-code-editor-toolbar{display:flex;flex-wrap:wrap;gap:8px;margin-bottom:8px}.kit-code-editor-toolbar-message{margin-bottom:8px;color:var(--ui-kit-color-red-1);font-size:14px;line-height:1.4}.kit-code-editor-input{box-sizing:content-box;border:1px solid var(--ui-kit-color-grey-11)}.kit-code-editor-input.disabled{background:var(--ui-kit-color-grey-13);border-color:var(--ui-kit-color-grey-11)}.kit-code-editor-container{position:relative;width:100%;height:100%}.kit-code-editor-error{padding:8px 12px;color:var(--ui-kit-color-red-1);font-size:12px;line-height:1.4;background:var(--ui-kit-color-red-2)}.kit-code-editor .find-widget>.button.codicon-widget-close{box-sizing:content-box}.kit-code-editor .context-view{margin-bottom:5px}.kit-code-editor .context-view .hover-contents{white-space:nowrap!important}\n"] }]
|
|
2825
2962
|
}], ctorParameters: () => [], propDecorators: { language: [{ type: i0.Input, args: [{ isSignal: true, alias: "language", required: false }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }], readonly: [{ type: i0.Input, args: [{ isSignal: true, alias: "readonly", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }, { type: i0.Output, args: ["disabledChange"] }], height: [{ type: i0.Input, args: [{ isSignal: true, alias: "height", required: false }] }], wrap: [{ type: i0.Input, args: [{ isSignal: true, alias: "wrap", required: false }] }], showLineNumbers: [{ type: i0.Input, args: [{ isSignal: true, alias: "showLineNumbers", required: false }] }], showToolbar: [{ type: i0.Input, args: [{ isSignal: true, alias: "showToolbar", required: false }] }], showFormatAction: [{ type: i0.Input, args: [{ isSignal: true, alias: "showFormatAction", required: false }] }], showFindAction: [{ type: i0.Input, args: [{ isSignal: true, alias: "showFindAction", required: false }] }], editorReady: [{ type: i0.Output, args: ["editorReady"] }], contentChanged: [{ type: i0.Output, args: ["contentChanged"] }], formatFailed: [{ type: i0.Output, args: ["formatFailed"] }], findFailed: [{ type: i0.Output, args: ["findFailed"] }], editorContainer: [{ type: i0.ViewChild, args: ['editorContainer', { isSignal: true }] }] } });
|
|
2826
2963
|
|
|
2827
2964
|
var KitTextLabelState;
|