@indigina/ui-kit 1.1.514 → 1.1.516
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;
|
|
@@ -13857,7 +13994,7 @@ class KitEntityGridComponent {
|
|
|
13857
13994
|
this.archiveModeChanged = output();
|
|
13858
13995
|
this.refreshButtonClicked = output();
|
|
13859
13996
|
this.selectionChanged = output();
|
|
13860
|
-
this.
|
|
13997
|
+
this.resetSelectedKeys = output();
|
|
13861
13998
|
this.search = viewChild('search', { ...(ngDevMode ? { debugName: "search" } : /* istanbul ignore next */ {}), read: KitGridSearchComponent });
|
|
13862
13999
|
this.kitTooltipPosition = KitTooltipPosition;
|
|
13863
14000
|
this.searchIsOpen = signal(false, ...(ngDevMode ? [{ debugName: "searchIsOpen" }] : /* istanbul ignore next */ []));
|
|
@@ -13883,12 +14020,32 @@ class KitEntityGridComponent {
|
|
|
13883
14020
|
this.kitButtonIconPosition = KitButtonIconPosition;
|
|
13884
14021
|
this.isExporting = signal(false, ...(ngDevMode ? [{ debugName: "isExporting" }] : /* istanbul ignore next */ []));
|
|
13885
14022
|
this.archiveModeEnabled = signal(false, ...(ngDevMode ? [{ debugName: "archiveModeEnabled" }] : /* istanbul ignore next */ []));
|
|
14023
|
+
this.hasInitializedResetSelectionTracking = false;
|
|
14024
|
+
this.previousFilterSignature = '';
|
|
13886
14025
|
effect(() => {
|
|
13887
14026
|
const markers = [...this.columnMarkers()];
|
|
13888
14027
|
this.isExporting.set(!!this.gridExportComponent()?.isGridExporting());
|
|
13889
14028
|
this.kitGridComponent()?.forwardedColumnMarkers.set(markers);
|
|
13890
14029
|
this.archiveModeEnabled.set(this.gridState().archive ?? false);
|
|
13891
14030
|
});
|
|
14031
|
+
effect(() => {
|
|
14032
|
+
const state = this.gridState();
|
|
14033
|
+
const currentSearch = state.search;
|
|
14034
|
+
const currentFilterSignature = this.getFilterSignature(state.filter);
|
|
14035
|
+
if (!this.hasInitializedResetSelectionTracking) {
|
|
14036
|
+
this.hasInitializedResetSelectionTracking = true;
|
|
14037
|
+
this.previousSearch = currentSearch;
|
|
14038
|
+
this.previousFilterSignature = currentFilterSignature;
|
|
14039
|
+
return;
|
|
14040
|
+
}
|
|
14041
|
+
const isSearchChanged = this.previousSearch !== currentSearch;
|
|
14042
|
+
const isFilterChanged = this.previousFilterSignature !== currentFilterSignature;
|
|
14043
|
+
this.previousSearch = currentSearch;
|
|
14044
|
+
this.previousFilterSignature = currentFilterSignature;
|
|
14045
|
+
if (isSearchChanged || isFilterChanged) {
|
|
14046
|
+
this.resetSelectedKeys.emit();
|
|
14047
|
+
}
|
|
14048
|
+
});
|
|
13892
14049
|
}
|
|
13893
14050
|
ngOnInit() {
|
|
13894
14051
|
const stateColumns = this.gridState().columns;
|
|
@@ -13934,11 +14091,15 @@ class KitEntityGridComponent {
|
|
|
13934
14091
|
onSelectionChange(event) {
|
|
13935
14092
|
this.selectionChanged.emit(event);
|
|
13936
14093
|
}
|
|
14094
|
+
getFilterSignature(filter) {
|
|
14095
|
+
const filtersWithoutNullValue = (filter ?? []).filter(item => item.value !== null);
|
|
14096
|
+
return JSON.stringify(kitBuildFilters(filtersWithoutNullValue));
|
|
14097
|
+
}
|
|
13937
14098
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: KitEntityGridComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
13938
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.4", type: KitEntityGridComponent, isStandalone: true, selector: "kit-entity-grid", inputs: { statesToReset: { classPropertyName: "statesToReset", publicName: "statesToReset", isSignal: true, isRequired: false, transformFunction: null }, gridData: { classPropertyName: "gridData", publicName: "gridData", isSignal: true, isRequired: true, transformFunction: null }, title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: true, transformFunction: null }, gridColumns: { classPropertyName: "gridColumns", publicName: "gridColumns", isSignal: true, isRequired: true, transformFunction: null }, defaultViewName: { classPropertyName: "defaultViewName", publicName: "defaultViewName", isSignal: true, isRequired: true, transformFunction: null }, viewGroup: { classPropertyName: "viewGroup", publicName: "viewGroup", isSignal: true, isRequired: true, transformFunction: null }, viewGroupConfig: { classPropertyName: "viewGroupConfig", publicName: "viewGroupConfig", isSignal: true, isRequired: true, transformFunction: null }, pdfOptions: { classPropertyName: "pdfOptions", publicName: "pdfOptions", isSignal: true, isRequired: true, transformFunction: null }, getExportedData: { classPropertyName: "getExportedData", publicName: "getExportedData", isSignal: true, isRequired: true, transformFunction: null }, defaultSorting: { classPropertyName: "defaultSorting", publicName: "defaultSorting", isSignal: true, isRequired: false, transformFunction: null }, filterExcludedColumns: { classPropertyName: "filterExcludedColumns", publicName: "filterExcludedColumns", isSignal: true, isRequired: false, transformFunction: null }, systemViews: { classPropertyName: "systemViews", publicName: "systemViews", isSignal: true, isRequired: false, transformFunction: null }, translationMap: { classPropertyName: "translationMap", publicName: "translationMap", isSignal: true, isRequired: false, transformFunction: null }, isDetailTemplateVisible: { classPropertyName: "isDetailTemplateVisible", publicName: "isDetailTemplateVisible", isSignal: true, isRequired: false, transformFunction: null }, detailTemplateExpandDisableIf: { classPropertyName: "detailTemplateExpandDisableIf", publicName: "detailTemplateExpandDisableIf", isSignal: true, isRequired: false, transformFunction: null }, gridHasData: { classPropertyName: "gridHasData", publicName: "gridHasData", isSignal: true, isRequired: false, transformFunction: null }, isLoading: { classPropertyName: "isLoading", publicName: "isLoading", isSignal: true, isRequired: false, transformFunction: null }, pagerInfoText: { classPropertyName: "pagerInfoText", publicName: "pagerInfoText", isSignal: true, isRequired: false, transformFunction: null }, showBreadcrumbs: { classPropertyName: "showBreadcrumbs", publicName: "showBreadcrumbs", isSignal: true, isRequired: false, transformFunction: null }, pageSizes: { classPropertyName: "pageSizes", publicName: "pageSizes", isSignal: true, isRequired: false, transformFunction: null }, rowClassFn: { classPropertyName: "rowClassFn", publicName: "rowClassFn", isSignal: true, isRequired: false, transformFunction: null }, showArchiveToggle: { classPropertyName: "showArchiveToggle", publicName: "showArchiveToggle", isSignal: true, isRequired: false, transformFunction: null }, showRefreshButton: { classPropertyName: "showRefreshButton", publicName: "showRefreshButton", isSignal: true, isRequired: false, transformFunction: null }, pageable: { classPropertyName: "pageable", publicName: "pageable", isSignal: true, isRequired: false, transformFunction: null }, searchVisible: { classPropertyName: "searchVisible", publicName: "searchVisible", isSignal: true, isRequired: false, transformFunction: null }, selectedKeys: { classPropertyName: "selectedKeys", publicName: "selectedKeys", isSignal: true, isRequired: false, transformFunction: null }, gridCellValueTransformMap: { classPropertyName: "gridCellValueTransformMap", publicName: "gridCellValueTransformMap", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { gridViewChanged: "gridViewChanged", archiveModeChanged: "archiveModeChanged", refreshButtonClicked: "refreshButtonClicked", selectionChanged: "selectionChanged",
|
|
14099
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.4", type: KitEntityGridComponent, isStandalone: true, selector: "kit-entity-grid", inputs: { statesToReset: { classPropertyName: "statesToReset", publicName: "statesToReset", isSignal: true, isRequired: false, transformFunction: null }, gridData: { classPropertyName: "gridData", publicName: "gridData", isSignal: true, isRequired: true, transformFunction: null }, title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: true, transformFunction: null }, gridColumns: { classPropertyName: "gridColumns", publicName: "gridColumns", isSignal: true, isRequired: true, transformFunction: null }, defaultViewName: { classPropertyName: "defaultViewName", publicName: "defaultViewName", isSignal: true, isRequired: true, transformFunction: null }, viewGroup: { classPropertyName: "viewGroup", publicName: "viewGroup", isSignal: true, isRequired: true, transformFunction: null }, viewGroupConfig: { classPropertyName: "viewGroupConfig", publicName: "viewGroupConfig", isSignal: true, isRequired: true, transformFunction: null }, pdfOptions: { classPropertyName: "pdfOptions", publicName: "pdfOptions", isSignal: true, isRequired: true, transformFunction: null }, getExportedData: { classPropertyName: "getExportedData", publicName: "getExportedData", isSignal: true, isRequired: true, transformFunction: null }, defaultSorting: { classPropertyName: "defaultSorting", publicName: "defaultSorting", isSignal: true, isRequired: false, transformFunction: null }, filterExcludedColumns: { classPropertyName: "filterExcludedColumns", publicName: "filterExcludedColumns", isSignal: true, isRequired: false, transformFunction: null }, systemViews: { classPropertyName: "systemViews", publicName: "systemViews", isSignal: true, isRequired: false, transformFunction: null }, translationMap: { classPropertyName: "translationMap", publicName: "translationMap", isSignal: true, isRequired: false, transformFunction: null }, isDetailTemplateVisible: { classPropertyName: "isDetailTemplateVisible", publicName: "isDetailTemplateVisible", isSignal: true, isRequired: false, transformFunction: null }, detailTemplateExpandDisableIf: { classPropertyName: "detailTemplateExpandDisableIf", publicName: "detailTemplateExpandDisableIf", isSignal: true, isRequired: false, transformFunction: null }, gridHasData: { classPropertyName: "gridHasData", publicName: "gridHasData", isSignal: true, isRequired: false, transformFunction: null }, isLoading: { classPropertyName: "isLoading", publicName: "isLoading", isSignal: true, isRequired: false, transformFunction: null }, pagerInfoText: { classPropertyName: "pagerInfoText", publicName: "pagerInfoText", isSignal: true, isRequired: false, transformFunction: null }, showBreadcrumbs: { classPropertyName: "showBreadcrumbs", publicName: "showBreadcrumbs", isSignal: true, isRequired: false, transformFunction: null }, pageSizes: { classPropertyName: "pageSizes", publicName: "pageSizes", isSignal: true, isRequired: false, transformFunction: null }, rowClassFn: { classPropertyName: "rowClassFn", publicName: "rowClassFn", isSignal: true, isRequired: false, transformFunction: null }, showArchiveToggle: { classPropertyName: "showArchiveToggle", publicName: "showArchiveToggle", isSignal: true, isRequired: false, transformFunction: null }, showRefreshButton: { classPropertyName: "showRefreshButton", publicName: "showRefreshButton", isSignal: true, isRequired: false, transformFunction: null }, pageable: { classPropertyName: "pageable", publicName: "pageable", isSignal: true, isRequired: false, transformFunction: null }, searchVisible: { classPropertyName: "searchVisible", publicName: "searchVisible", isSignal: true, isRequired: false, transformFunction: null }, selectedKeys: { classPropertyName: "selectedKeys", publicName: "selectedKeys", isSignal: true, isRequired: false, transformFunction: null }, gridCellValueTransformMap: { classPropertyName: "gridCellValueTransformMap", publicName: "gridCellValueTransformMap", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { gridViewChanged: "gridViewChanged", archiveModeChanged: "archiveModeChanged", refreshButtonClicked: "refreshButtonClicked", selectionChanged: "selectionChanged", resetSelectedKeys: "resetSelectedKeys" }, providers: [
|
|
13939
14100
|
KitBreadcrumbsService,
|
|
13940
14101
|
KitGridUrlStateService,
|
|
13941
|
-
], queries: [{ propertyName: "columnMarkers", predicate: KIT_GRID_COLUMN_MARKER, descendants: true, isSignal: true }, { propertyName: "gridDetailTemplate", first: true, predicate: KitGridDetailTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }], viewQueries: [{ propertyName: "search", first: true, predicate: ["search"], descendants: true, read: KitGridSearchComponent, isSignal: true }, { propertyName: "kitGridComponent", first: true, predicate: (KitGridComponent), descendants: true, isSignal: true }, { propertyName: "gridExportComponent", first: true, predicate: KitGridExportComponent, descendants: true, isSignal: true }], ngImport: i0, template: "<div class=\"kit-entity-grid\">\n @if (showBreadcrumbs()) {\n <kit-breadcrumbs [items]=\"breadcrumbs()\"></kit-breadcrumbs>\n }\n <kit-entity-title>{{ title() }}</kit-entity-title>\n <div class=\"grid-header\">\n <div class=\"grid-header-content\">\n <kit-grid-views class=\"grid-header-views\"\n [viewGroup]=\"viewGroup()\"\n [viewConfigGroup]=\"viewGroupConfig()\"\n [systemViews]=\"systemViews()\"\n [defaultColumns]=\"gridColumns()\"\n [defaultViewName]=\"defaultViewName()\"\n [defaultSorting]=\"defaultSorting()\"\n (viewChanged)=\"onGridViewChange()\"\n (viewSelectionChanged)=\"
|
|
14102
|
+
], queries: [{ propertyName: "columnMarkers", predicate: KIT_GRID_COLUMN_MARKER, descendants: true, isSignal: true }, { propertyName: "gridDetailTemplate", first: true, predicate: KitGridDetailTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }], viewQueries: [{ propertyName: "search", first: true, predicate: ["search"], descendants: true, read: KitGridSearchComponent, isSignal: true }, { propertyName: "kitGridComponent", first: true, predicate: (KitGridComponent), descendants: true, isSignal: true }, { propertyName: "gridExportComponent", first: true, predicate: KitGridExportComponent, descendants: true, isSignal: true }], ngImport: i0, template: "<div class=\"kit-entity-grid\">\n @if (showBreadcrumbs()) {\n <kit-breadcrumbs [items]=\"breadcrumbs()\"></kit-breadcrumbs>\n }\n <kit-entity-title>{{ title() }}</kit-entity-title>\n <div class=\"grid-header\">\n <div class=\"grid-header-content\">\n <kit-grid-views class=\"grid-header-views\"\n [viewGroup]=\"viewGroup()\"\n [viewConfigGroup]=\"viewGroupConfig()\"\n [systemViews]=\"systemViews()\"\n [defaultColumns]=\"gridColumns()\"\n [defaultViewName]=\"defaultViewName()\"\n [defaultSorting]=\"defaultSorting()\"\n (viewChanged)=\"onGridViewChange()\"\n (viewSelectionChanged)=\"resetSelectedKeys.emit()\"\n ></kit-grid-views>\n <div class=\"grid-header-actions\">\n <ng-content select=\"[headerActions]\"></ng-content>\n @if (showRefreshButton()) {\n <kit-button kitTooltip\n kitTooltipFilter=\"kit-button\"\n [kitTooltipPosition]=\"kitTooltipPosition.TOP\"\n [title]=\"'kit.grid.actions.refresh' | translate\"\n [type]=\"kitButtonType.GHOST\"\n [kind]=\"kitButtonKind.MEDIUM\"\n [icon]=\"kitSvgIcon.RESET\"\n (clicked)=\"onRefreshButtonClick()\"\n ></kit-button>\n }\n @if (showArchiveToggle()) {\n <kit-grid-archive-toggle (valueChange)=\"onArchiveToggle($event)\"\n ></kit-grid-archive-toggle>\n }\n <kit-grid-export [gridHasData]=\"gridHasData()\"\n [exportedFileName]=\"pdfOptions().fileName ?? ''\"\n [getExportedData]=\"getExportedData()\"\n [translationMap]=\"translationMap()\"\n [drawPdf]=\"drawPdf()\"\n [gridCellValueTransformMap]=\"gridCellValueTransformMap()\" />\n @if (filters$ | async; as filters) {\n <kit-grid-filters-toggle [filters]=\"filters\"\n [hasTooltip]=\"searchIsOpen()\"\n [active]=\"filtersVisible()\"\n (clicked)=\"onFiltersToggle()\" />\n <kit-grid-column-manager class=\"grid-column-manager\"\n [showLabel]=\"!searchIsOpen()\" />\n }\n </div>\n @if (searchVisible()) {\n <div class=\"grid-header-search\">\n <kit-grid-search #search\n [disabled]=\"isSearchDisabled()\"\n (toggleSearch)=\"searchIsOpen.set($event)\" />\n </div>\n }\n </div>\n @if (filtersVisible()) {\n <ng-content select=\"[filters]\"></ng-content>\n }\n </div>\n <ng-content select=\"[post-header-content]\"></ng-content>\n @if (gridData(); as data) {\n @if (!data.loading) {\n <kit-grid class=\"grid\"\n [data]=\"data.results\"\n [pageable]=\"pageable()\"\n [pageSize]=\"gridState().take\"\n [sort]=\"gridState().sort\"\n [sortable]=\"sortable\"\n [detailTemplateShowIf]=\"isDetailTemplateVisible()\"\n [detailTemplateExpandDisableIf]=\"detailTemplateExpandDisableIf()\"\n [pdfOptions]=\"pdfOptions()\"\n [loading]=\"isExporting() || isLoading()\"\n [skip]=\"gridState().skip\"\n [pagerInfoText]=\"pagerInfoText()\"\n [pageSizes]=\"pageSizes()\"\n [rowClassFn]=\"rowClassFn()\"\n [gridDetailTemplate]=\"gridDetailTemplate()\"\n [selectedKeys]=\"selectedKeys()\"\n (selectionChanged)=\"onSelectionChange($event)\"\n (pageChanged)=\"onPageSizeChanged($event)\"\n (dataStateChanged)=\"onDataStateChange($event)\"\n ></kit-grid>\n } @else {\n <kit-skeleton-grid class=\"kit-skeleton-grid\"\n ></kit-skeleton-grid>\n }\n }\n <ng-content select=\"[footerActions]\"></ng-content>\n</div>\n\n", styles: [".kit-entity-grid{display:flex;flex-direction:column;gap:25px;height:calc(100vh - var(--ui-kit-header-height) - 40px)}.kit-entity-grid .grid{overflow:auto}.grid-header{display:flex;flex-direction:column;gap:16px;container-type:inline-size}.grid-header-content{display:flex;gap:16px;width:100%}@container (max-width: 780px){.grid-header-content{display:grid;gap:10px;grid-template-areas:\"views .\" \"actions search\";grid-template-columns:repeat(2,1fr)}}.grid-header-views{min-width:0;flex:1;grid-area:views;grid-column:1/3}.grid-header-actions{display:flex;gap:16px;grid-area:actions}.grid-header-search{grid-area:search}@container (max-width: 780px){.grid-header-search{border:none;padding:0;display:flex;justify-content:flex-end}}.grid-header-filters{width:100%}::ng-deep .k-loading-pdf-mask{display:none}::ng-deep .k-pdf-export tbody>tr>td>a{display:none}\n"], dependencies: [{ kind: "component", type: KitBreadcrumbsComponent, selector: "kit-breadcrumbs", inputs: ["items"] }, { kind: "component", type: KitEntityTitleComponent, selector: "kit-entity-title" }, { kind: "component", type: KitGridViewsComponent, selector: "kit-grid-views", inputs: ["viewGroup", "viewConfigGroup", "defaultColumns", "defaultViewName", "defaultSorting", "systemViews"], outputs: ["viewChanged", "viewSelectionChanged"] }, { kind: "component", type: KitGridExportComponent, selector: "kit-grid-export", inputs: ["getExportedData", "translationMap", "exportedFileName", "drawPdf", "gridHasData", "gridCellValueTransformMap", "visibleColumns"] }, { kind: "component", type: KitGridColumnManagerComponent, selector: "kit-grid-column-manager", inputs: ["showLabel"] }, { kind: "component", type: KitGridSearchComponent, selector: "kit-grid-search", inputs: ["disabled"], outputs: ["toggleSearch"] }, { kind: "component", type: KitGridComponent, selector: "kit-grid", inputs: ["data", "gridDataBinding", "sortable", "sort", "pageable", "pageSize", "skip", "loading", "detailTemplateShowIf", "detailTemplateExpandDisableIf", "showFooter", "footerTitle", "footerData", "pdfOptions", "pagerButtonCount", "pageSizes", "pagerInfoText", "noRecordsText", "resizable", "gridDetailTemplate", "rowClassFn", "rowReorderable", "selectedKeys"], outputs: ["skipChange", "loadingChange", "rowReordered", "selectionChanged", "pageChanged", "sortChanged", "dataStateChanged", "detailExpanded", "detailCollapsed", "cellClicked", "excelExport", "selectedKeysChange"] }, { kind: "component", type: KitSkeletonGridComponent, selector: "kit-skeleton-grid", inputs: ["itemsCount"] }, { kind: "component", type: KitButtonComponent, selector: "kit-button", inputs: ["disabled", "label", "type", "icon", "iconType", "kind", "state", "iconPosition", "buttonClass", "active"], outputs: ["clicked"] }, { kind: "directive", type: KitTooltipDirective, selector: "[kitTooltip]", inputs: ["kitTooltipPosition", "kitTooltipFilter", "kitTooltipTemplateRef", "kitTooltipVisible"] }, { kind: "component", type: KitGridArchiveToggle, selector: "kit-grid-archive-toggle", outputs: ["valueChange"] }, { kind: "component", type: KitGridFiltersToggleComponent, selector: "kit-grid-filters-toggle", inputs: ["filters", "hasTooltip", "active"], outputs: ["clicked"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }, { kind: "pipe", type: AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
13942
14103
|
}
|
|
13943
14104
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: KitEntityGridComponent, decorators: [{
|
|
13944
14105
|
type: Component,
|
|
@@ -13960,8 +14121,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImpor
|
|
|
13960
14121
|
], providers: [
|
|
13961
14122
|
KitBreadcrumbsService,
|
|
13962
14123
|
KitGridUrlStateService,
|
|
13963
|
-
], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"kit-entity-grid\">\n @if (showBreadcrumbs()) {\n <kit-breadcrumbs [items]=\"breadcrumbs()\"></kit-breadcrumbs>\n }\n <kit-entity-title>{{ title() }}</kit-entity-title>\n <div class=\"grid-header\">\n <div class=\"grid-header-content\">\n <kit-grid-views class=\"grid-header-views\"\n [viewGroup]=\"viewGroup()\"\n [viewConfigGroup]=\"viewGroupConfig()\"\n [systemViews]=\"systemViews()\"\n [defaultColumns]=\"gridColumns()\"\n [defaultViewName]=\"defaultViewName()\"\n [defaultSorting]=\"defaultSorting()\"\n (viewChanged)=\"onGridViewChange()\"\n (viewSelectionChanged)=\"
|
|
13964
|
-
}], ctorParameters: () => [], propDecorators: { statesToReset: [{ type: i0.Input, args: [{ isSignal: true, alias: "statesToReset", required: false }] }], gridData: [{ type: i0.Input, args: [{ isSignal: true, alias: "gridData", required: true }] }], title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: true }] }], gridColumns: [{ type: i0.Input, args: [{ isSignal: true, alias: "gridColumns", required: true }] }], defaultViewName: [{ type: i0.Input, args: [{ isSignal: true, alias: "defaultViewName", required: true }] }], viewGroup: [{ type: i0.Input, args: [{ isSignal: true, alias: "viewGroup", required: true }] }], viewGroupConfig: [{ type: i0.Input, args: [{ isSignal: true, alias: "viewGroupConfig", required: true }] }], pdfOptions: [{ type: i0.Input, args: [{ isSignal: true, alias: "pdfOptions", required: true }] }], getExportedData: [{ type: i0.Input, args: [{ isSignal: true, alias: "getExportedData", required: true }] }], defaultSorting: [{ type: i0.Input, args: [{ isSignal: true, alias: "defaultSorting", required: false }] }], filterExcludedColumns: [{ type: i0.Input, args: [{ isSignal: true, alias: "filterExcludedColumns", required: false }] }], systemViews: [{ type: i0.Input, args: [{ isSignal: true, alias: "systemViews", required: false }] }], translationMap: [{ type: i0.Input, args: [{ isSignal: true, alias: "translationMap", required: false }] }], isDetailTemplateVisible: [{ type: i0.Input, args: [{ isSignal: true, alias: "isDetailTemplateVisible", required: false }] }], detailTemplateExpandDisableIf: [{ type: i0.Input, args: [{ isSignal: true, alias: "detailTemplateExpandDisableIf", required: false }] }], gridHasData: [{ type: i0.Input, args: [{ isSignal: true, alias: "gridHasData", required: false }] }], isLoading: [{ type: i0.Input, args: [{ isSignal: true, alias: "isLoading", required: false }] }], pagerInfoText: [{ type: i0.Input, args: [{ isSignal: true, alias: "pagerInfoText", required: false }] }], showBreadcrumbs: [{ type: i0.Input, args: [{ isSignal: true, alias: "showBreadcrumbs", required: false }] }], pageSizes: [{ type: i0.Input, args: [{ isSignal: true, alias: "pageSizes", required: false }] }], rowClassFn: [{ type: i0.Input, args: [{ isSignal: true, alias: "rowClassFn", required: false }] }], showArchiveToggle: [{ type: i0.Input, args: [{ isSignal: true, alias: "showArchiveToggle", required: false }] }], showRefreshButton: [{ type: i0.Input, args: [{ isSignal: true, alias: "showRefreshButton", required: false }] }], pageable: [{ type: i0.Input, args: [{ isSignal: true, alias: "pageable", required: false }] }], searchVisible: [{ type: i0.Input, args: [{ isSignal: true, alias: "searchVisible", required: false }] }], selectedKeys: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectedKeys", required: false }] }], gridCellValueTransformMap: [{ type: i0.Input, args: [{ isSignal: true, alias: "gridCellValueTransformMap", required: false }] }], gridViewChanged: [{ type: i0.Output, args: ["gridViewChanged"] }], archiveModeChanged: [{ type: i0.Output, args: ["archiveModeChanged"] }], refreshButtonClicked: [{ type: i0.Output, args: ["refreshButtonClicked"] }], selectionChanged: [{ type: i0.Output, args: ["selectionChanged"] }],
|
|
14124
|
+
], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"kit-entity-grid\">\n @if (showBreadcrumbs()) {\n <kit-breadcrumbs [items]=\"breadcrumbs()\"></kit-breadcrumbs>\n }\n <kit-entity-title>{{ title() }}</kit-entity-title>\n <div class=\"grid-header\">\n <div class=\"grid-header-content\">\n <kit-grid-views class=\"grid-header-views\"\n [viewGroup]=\"viewGroup()\"\n [viewConfigGroup]=\"viewGroupConfig()\"\n [systemViews]=\"systemViews()\"\n [defaultColumns]=\"gridColumns()\"\n [defaultViewName]=\"defaultViewName()\"\n [defaultSorting]=\"defaultSorting()\"\n (viewChanged)=\"onGridViewChange()\"\n (viewSelectionChanged)=\"resetSelectedKeys.emit()\"\n ></kit-grid-views>\n <div class=\"grid-header-actions\">\n <ng-content select=\"[headerActions]\"></ng-content>\n @if (showRefreshButton()) {\n <kit-button kitTooltip\n kitTooltipFilter=\"kit-button\"\n [kitTooltipPosition]=\"kitTooltipPosition.TOP\"\n [title]=\"'kit.grid.actions.refresh' | translate\"\n [type]=\"kitButtonType.GHOST\"\n [kind]=\"kitButtonKind.MEDIUM\"\n [icon]=\"kitSvgIcon.RESET\"\n (clicked)=\"onRefreshButtonClick()\"\n ></kit-button>\n }\n @if (showArchiveToggle()) {\n <kit-grid-archive-toggle (valueChange)=\"onArchiveToggle($event)\"\n ></kit-grid-archive-toggle>\n }\n <kit-grid-export [gridHasData]=\"gridHasData()\"\n [exportedFileName]=\"pdfOptions().fileName ?? ''\"\n [getExportedData]=\"getExportedData()\"\n [translationMap]=\"translationMap()\"\n [drawPdf]=\"drawPdf()\"\n [gridCellValueTransformMap]=\"gridCellValueTransformMap()\" />\n @if (filters$ | async; as filters) {\n <kit-grid-filters-toggle [filters]=\"filters\"\n [hasTooltip]=\"searchIsOpen()\"\n [active]=\"filtersVisible()\"\n (clicked)=\"onFiltersToggle()\" />\n <kit-grid-column-manager class=\"grid-column-manager\"\n [showLabel]=\"!searchIsOpen()\" />\n }\n </div>\n @if (searchVisible()) {\n <div class=\"grid-header-search\">\n <kit-grid-search #search\n [disabled]=\"isSearchDisabled()\"\n (toggleSearch)=\"searchIsOpen.set($event)\" />\n </div>\n }\n </div>\n @if (filtersVisible()) {\n <ng-content select=\"[filters]\"></ng-content>\n }\n </div>\n <ng-content select=\"[post-header-content]\"></ng-content>\n @if (gridData(); as data) {\n @if (!data.loading) {\n <kit-grid class=\"grid\"\n [data]=\"data.results\"\n [pageable]=\"pageable()\"\n [pageSize]=\"gridState().take\"\n [sort]=\"gridState().sort\"\n [sortable]=\"sortable\"\n [detailTemplateShowIf]=\"isDetailTemplateVisible()\"\n [detailTemplateExpandDisableIf]=\"detailTemplateExpandDisableIf()\"\n [pdfOptions]=\"pdfOptions()\"\n [loading]=\"isExporting() || isLoading()\"\n [skip]=\"gridState().skip\"\n [pagerInfoText]=\"pagerInfoText()\"\n [pageSizes]=\"pageSizes()\"\n [rowClassFn]=\"rowClassFn()\"\n [gridDetailTemplate]=\"gridDetailTemplate()\"\n [selectedKeys]=\"selectedKeys()\"\n (selectionChanged)=\"onSelectionChange($event)\"\n (pageChanged)=\"onPageSizeChanged($event)\"\n (dataStateChanged)=\"onDataStateChange($event)\"\n ></kit-grid>\n } @else {\n <kit-skeleton-grid class=\"kit-skeleton-grid\"\n ></kit-skeleton-grid>\n }\n }\n <ng-content select=\"[footerActions]\"></ng-content>\n</div>\n\n", styles: [".kit-entity-grid{display:flex;flex-direction:column;gap:25px;height:calc(100vh - var(--ui-kit-header-height) - 40px)}.kit-entity-grid .grid{overflow:auto}.grid-header{display:flex;flex-direction:column;gap:16px;container-type:inline-size}.grid-header-content{display:flex;gap:16px;width:100%}@container (max-width: 780px){.grid-header-content{display:grid;gap:10px;grid-template-areas:\"views .\" \"actions search\";grid-template-columns:repeat(2,1fr)}}.grid-header-views{min-width:0;flex:1;grid-area:views;grid-column:1/3}.grid-header-actions{display:flex;gap:16px;grid-area:actions}.grid-header-search{grid-area:search}@container (max-width: 780px){.grid-header-search{border:none;padding:0;display:flex;justify-content:flex-end}}.grid-header-filters{width:100%}::ng-deep .k-loading-pdf-mask{display:none}::ng-deep .k-pdf-export tbody>tr>td>a{display:none}\n"] }]
|
|
14125
|
+
}], ctorParameters: () => [], propDecorators: { statesToReset: [{ type: i0.Input, args: [{ isSignal: true, alias: "statesToReset", required: false }] }], gridData: [{ type: i0.Input, args: [{ isSignal: true, alias: "gridData", required: true }] }], title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: true }] }], gridColumns: [{ type: i0.Input, args: [{ isSignal: true, alias: "gridColumns", required: true }] }], defaultViewName: [{ type: i0.Input, args: [{ isSignal: true, alias: "defaultViewName", required: true }] }], viewGroup: [{ type: i0.Input, args: [{ isSignal: true, alias: "viewGroup", required: true }] }], viewGroupConfig: [{ type: i0.Input, args: [{ isSignal: true, alias: "viewGroupConfig", required: true }] }], pdfOptions: [{ type: i0.Input, args: [{ isSignal: true, alias: "pdfOptions", required: true }] }], getExportedData: [{ type: i0.Input, args: [{ isSignal: true, alias: "getExportedData", required: true }] }], defaultSorting: [{ type: i0.Input, args: [{ isSignal: true, alias: "defaultSorting", required: false }] }], filterExcludedColumns: [{ type: i0.Input, args: [{ isSignal: true, alias: "filterExcludedColumns", required: false }] }], systemViews: [{ type: i0.Input, args: [{ isSignal: true, alias: "systemViews", required: false }] }], translationMap: [{ type: i0.Input, args: [{ isSignal: true, alias: "translationMap", required: false }] }], isDetailTemplateVisible: [{ type: i0.Input, args: [{ isSignal: true, alias: "isDetailTemplateVisible", required: false }] }], detailTemplateExpandDisableIf: [{ type: i0.Input, args: [{ isSignal: true, alias: "detailTemplateExpandDisableIf", required: false }] }], gridHasData: [{ type: i0.Input, args: [{ isSignal: true, alias: "gridHasData", required: false }] }], isLoading: [{ type: i0.Input, args: [{ isSignal: true, alias: "isLoading", required: false }] }], pagerInfoText: [{ type: i0.Input, args: [{ isSignal: true, alias: "pagerInfoText", required: false }] }], showBreadcrumbs: [{ type: i0.Input, args: [{ isSignal: true, alias: "showBreadcrumbs", required: false }] }], pageSizes: [{ type: i0.Input, args: [{ isSignal: true, alias: "pageSizes", required: false }] }], rowClassFn: [{ type: i0.Input, args: [{ isSignal: true, alias: "rowClassFn", required: false }] }], showArchiveToggle: [{ type: i0.Input, args: [{ isSignal: true, alias: "showArchiveToggle", required: false }] }], showRefreshButton: [{ type: i0.Input, args: [{ isSignal: true, alias: "showRefreshButton", required: false }] }], pageable: [{ type: i0.Input, args: [{ isSignal: true, alias: "pageable", required: false }] }], searchVisible: [{ type: i0.Input, args: [{ isSignal: true, alias: "searchVisible", required: false }] }], selectedKeys: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectedKeys", required: false }] }], gridCellValueTransformMap: [{ type: i0.Input, args: [{ isSignal: true, alias: "gridCellValueTransformMap", required: false }] }], gridViewChanged: [{ type: i0.Output, args: ["gridViewChanged"] }], archiveModeChanged: [{ type: i0.Output, args: ["archiveModeChanged"] }], refreshButtonClicked: [{ type: i0.Output, args: ["refreshButtonClicked"] }], selectionChanged: [{ type: i0.Output, args: ["selectionChanged"] }], resetSelectedKeys: [{ type: i0.Output, args: ["resetSelectedKeys"] }], search: [{ type: i0.ViewChild, args: ['search', { ...{ read: KitGridSearchComponent }, isSignal: true }] }], kitGridComponent: [{ type: i0.ViewChild, args: [i0.forwardRef(() => KitGridComponent), { isSignal: true }] }], gridExportComponent: [{ type: i0.ViewChild, args: [i0.forwardRef(() => KitGridExportComponent), { isSignal: true }] }], columnMarkers: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => KIT_GRID_COLUMN_MARKER), { ...{ descendants: true }, isSignal: true }] }], gridDetailTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => KitGridDetailTemplateDirective), { ...{
|
|
13965
14126
|
read: TemplateRef,
|
|
13966
14127
|
}, isSignal: true }] }] } });
|
|
13967
14128
|
|