@libs-ui/components-preview-text-data 0.2.357-36 → 0.2.357-37

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.
@@ -604,13 +604,23 @@ const buildSqlErrorMessage = (doc, node) => {
604
604
  * như `b._id` bị vẽ chấm đỏ (người dùng chỉ ra 30/09/2026). `_` đứng SAU chữ/số là giữa tên, không đụng.
605
605
  */
606
606
  const isUnderscoreIdentifierStart = (doc, pos) => pos < doc.length && doc.sliceString(pos, pos + 1) === '_' && !/\w/.test(pos > 0 ? doc.sliceString(pos - 1, pos) : '');
607
+ /**
608
+ * Đoạn chữ NGAY TẠI vị trí lỗi khớp một mẫu token do ỨNG DỤNG tự thay trước khi chạy (vd `$sqlCard.ma_dn` của mobio-web)
609
+ * — báo oan, bỏ qua. Mẫu do nơi dùng truyền vào qua input `syntaxIgnoreTokens`: thư viện không biết token của dự án nào.
610
+ */
611
+ const isIgnoredTokenAt = (doc, pos, patterns) => {
612
+ if (!patterns.length || pos >= doc.length)
613
+ return false;
614
+ const text = doc.sliceString(pos, Math.min(doc.length, pos + 200));
615
+ return patterns.some((pattern) => new RegExp(`^(?:${pattern.source})`, pattern.flags.replace(/[gy]/g, '')).test(text));
616
+ };
607
617
  /** Phát hiện lỗi cú pháp SQL từ error node của syntaxTree (Lezer). */
608
- const computeSqlDiagnostics = (view) => {
618
+ const computeSqlDiagnostics = (view, ignoreTokens = []) => {
609
619
  const diagnostics = [];
610
620
  const doc = view.state.doc;
611
621
  syntaxTree(view.state).iterate({
612
622
  enter: (node) => {
613
- if (!node.type.isError || isUnderscoreIdentifierStart(doc, node.from))
623
+ if (!node.type.isError || isUnderscoreIdentifierStart(doc, node.from) || isIgnoredTokenAt(doc, node.from, ignoreTokens))
614
624
  return;
615
625
  diagnostics.push({ from: Math.max(0, node.from - 1), to: node.from, severity: 'error', message: buildSqlErrorMessage(doc, node) });
616
626
  },
@@ -1530,6 +1540,15 @@ class LibsUiComponentsPreviewTextDataComponent {
1530
1540
  lintIgnorePatterns = input(['Cannot use import statement outside a module', 'Unexpected token export', 'import ', '@angular/core'], {
1531
1541
  transform: (value) => value ?? ['Cannot use import statement outside a module', 'Unexpected token export', 'import ', '@angular/core'],
1532
1542
  });
1543
+ /**
1544
+ * Mẫu token mà ỨNG DỤNG tự thay trước khi chạy câu lệnh (vd `$sqlCard.ma_dn`) — lỗi cú pháp rơi đúng vào đầu một đoạn khớp
1545
+ * mẫu thì KHÔNG báo. Hiện áp cho bộ bắt lỗi SQL. Mặc định rỗng: thư viện không tự đoán token của dự án nào.
1546
+ * @example
1547
+ * [syntaxIgnoreTokens]="[/\$sqlCard\.[a-z0-9_]+/i]"
1548
+ */
1549
+ syntaxIgnoreTokens = input([], {
1550
+ transform: (value) => value ?? [],
1551
+ });
1533
1552
  /**
1534
1553
  * Danh sách đối tượng/biến gợi ý khi gõ — giống IntelliSense trong IDE.
1535
1554
  * Hỗ trợ dot-notation: định nghĩa `properties` để gợi ý sau dấu `.`
@@ -1803,7 +1822,7 @@ class LibsUiComponentsPreviewTextDataComponent {
1803
1822
  /** SQL linter — logic trong `linters/sql-linter.ts`. */
1804
1823
  createSqlLinter() {
1805
1824
  return linter((view) => {
1806
- const diagnostics = computeSqlDiagnostics(view);
1825
+ const diagnostics = computeSqlDiagnostics(view, this.syntaxIgnoreTokens());
1807
1826
  this.syntaxErrors.emit(diagnostics);
1808
1827
  return diagnostics;
1809
1828
  });
@@ -1904,7 +1923,7 @@ class LibsUiComponentsPreviewTextDataComponent {
1904
1923
  });
1905
1924
  }
1906
1925
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: LibsUiComponentsPreviewTextDataComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1907
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: LibsUiComponentsPreviewTextDataComponent, isStandalone: true, selector: "libs_ui-components-preview_text_data", inputs: { content: { classPropertyName: "content", publicName: "content", isSignal: true, isRequired: false, transformFunction: null }, langSelected: { classPropertyName: "langSelected", publicName: "langSelected", isSignal: true, isRequired: true, transformFunction: null }, langsAccept: { classPropertyName: "langsAccept", publicName: "langsAccept", isSignal: true, isRequired: false, transformFunction: null }, langsChangeLabel: { classPropertyName: "langsChangeLabel", publicName: "langsChangeLabel", isSignal: true, isRequired: false, transformFunction: null }, editable: { classPropertyName: "editable", publicName: "editable", isSignal: true, isRequired: false, transformFunction: null }, hiddenAction: { classPropertyName: "hiddenAction", publicName: "hiddenAction", isSignal: true, isRequired: false, transformFunction: null }, minLines: { classPropertyName: "minLines", publicName: "minLines", isSignal: true, isRequired: false, transformFunction: null }, maxLines: { classPropertyName: "maxLines", publicName: "maxLines", isSignal: true, isRequired: false, transformFunction: null }, containerElement: { classPropertyName: "containerElement", publicName: "containerElement", isSignal: true, isRequired: false, transformFunction: null }, zIndexPopover: { classPropertyName: "zIndexPopover", publicName: "zIndexPopover", isSignal: true, isRequired: false, transformFunction: null }, hiddenSearchLang: { classPropertyName: "hiddenSearchLang", publicName: "hiddenSearchLang", isSignal: true, isRequired: false, transformFunction: null }, lintIgnorePatterns: { classPropertyName: "lintIgnorePatterns", publicName: "lintIgnorePatterns", isSignal: true, isRequired: false, transformFunction: null }, completions: { classPropertyName: "completions", publicName: "completions", isSignal: true, isRequired: false, transformFunction: null }, forbiddenPatterns: { classPropertyName: "forbiddenPatterns", publicName: "forbiddenPatterns", isSignal: true, isRequired: false, transformFunction: null }, background: { classPropertyName: "background", publicName: "background", isSignal: true, isRequired: false, transformFunction: null }, showFormatAction: { classPropertyName: "showFormatAction", publicName: "showFormatAction", isSignal: true, isRequired: false, transformFunction: null }, autoFormatOnLoad: { classPropertyName: "autoFormatOnLoad", publicName: "autoFormatOnLoad", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { langSelected: "langSelectedChange", outChange: "outChange", syntaxErrors: "syntaxErrors", outViolations: "outViolations" }, viewQueries: [{ propertyName: "containerPreview", first: true, predicate: ["containerPreview"], descendants: true, isSignal: true }], ngImport: i0, template: "<div\n class=\"libs-ui-preview-data-container flex flex-col w-full h-auto rounded-[8px] libs-ui-border-general px-[8px]\"\n [style.--background-color]=\"background()\"\n [class.pt-[8px]]=\"!hiddenAction()\">\n @if (!hiddenAction()) {\n <div class=\"flex items-center content-between color-[#6a7383]\">\n <libs_ui-components-dropdown\n classInclude=\"w-[200px]\"\n [listConfig]=\"configLoadDataIsHttpConfig()\"\n [listMaxItemShow]=\"5\"\n [zIndex]=\"zIndexPopover()\"\n [isNgContent]=\"true\"\n [readonly]=\"!editable() || !acceptChangeLang()\"\n [listHasButtonUnSelectOption]=\"false\"\n [listHiddenInputSearch]=\"hiddenSearchLang()\"\n (outSelectKey)=\"handlerSelectKey($event)\">\n <libs_ui-components-buttons-button\n [type]=\"'button-link-third'\"\n [label]=\"labelLang() || ''\"\n [sizeButton]=\"'small'\"\n [classIconRight]=\"editable() && acceptChangeLang() ? 'libs-ui-icon-move-right rotate-90' : ''\"\n [classInclude]=\"'!p-[0px]' + (editable() && acceptChangeLang() ? '' : '!pointer-events-none !cursor-default hover:!text-[#6A7383]')\" />\n </libs_ui-components-dropdown>\n <div class=\"flex items-center\">\n <!-- G\u1EE3i \u00FD ph\u00EDm t\u1EAFt t\u00ECm/thay th\u1EBF \u2014 khung Ctrl + F c\u1EE7a CodeMirror kh\u00F4ng c\u00F3 n\u00FAt m\u1EDF n\u00E0o tr\u00EAn thanh c\u00F4ng c\u1EE5,\n kh\u00F4ng nh\u1EAFc th\u00EC ng\u01B0\u1EDDi d\u00F9ng kh\u00F4ng bi\u1EBFt c\u00F3 (ng\u01B0\u1EDDi d\u00F9ng y\u00EAu c\u1EA7u 30/09/2026). -->\n @if (editable()) {\n <span class=\"libs-ui-font-h6r mr-[16px] whitespace-nowrap text-[#9ca2ad]\">\n {{ 'i18n_code_editor_search_hint' | translate: { key: searchShortcut } }}\n </span>\n }\n <!-- \u0110\u1ECBnh d\u1EA1ng: \u0111\u1EE9ng tr\u01B0\u1EDBc \"Xu\u1ED1ng d\u00F2ng\" v\u00EC n\u00F3 l\u00E0 thao t\u00E1c tr\u00EAn N\u1ED8I DUNG, hai n\u00FAt sau ch\u1EC9 \u0111\u1ED5i\n c\u00E1ch hi\u1EC3n th\u1ECB. Ch\u1EC9 hi\u1EC7n khi \u00F4 s\u1EEDa \u0111\u01B0\u1EE3c v\u00E0 ng\u00F4n ng\u1EEF c\u00F3 b\u1ED9 \u0111\u1ECBnh d\u1EA1ng \u2014 xem `canFormat`. -->\n @if (canFormat()) {\n <libs_ui-components-buttons-button\n [type]=\"'button-link-third'\"\n [label]=\"'i18n_format_code'\"\n [sizeButton]=\"'small'\"\n [classIconLeft]=\"'libs-ui-icon-align-left'\"\n [classInclude]=\"'mo-lib-p-0px mo-lib-mr-16px'\"\n (outClick)=\"handlerFormat()\" />\n }\n <libs_ui-components-buttons-button\n [type]=\"'button-link-third'\"\n [label]=\"isWrap() ? 'i18n_remove_line_wrap' : 'i18n_line_wrap'\"\n [sizeButton]=\"'small'\"\n [classIconLeft]=\"isWrap() ? 'libs-ui-icon-unwrap' : 'libs-ui-icon-wrap'\"\n [classInclude]=\"'mo-lib-p-0px mo-lib-mr-16px'\"\n (outClick)=\"handlerLineWrap()\" />\n <libs_ui-components-buttons-button\n [type]=\"'button-link-third'\"\n [label]=\"'i18n_copy'\"\n [sizeButton]=\"'small'\"\n [classIconLeft]=\"'libs-ui-icon-copy'\"\n [classInclude]=\"'mo-lib-p-0px'\"\n (outClick)=\"handlerCopy()\" />\n </div>\n </div>\n }\n <div #containerPreview></div>\n</div>\n", styles: [":host ::ng-deep .libs-ui-preview-data-container{background-color:var(--background-color)!important}:host ::ng-deep .libs-ui-preview-data-container .cm-line{white-space:pre-wrap}:host ::ng-deep .libs-ui-preview-data-container .cm-lintRange-error{background-color:#ff323233;border-bottom:2px solid red}:host ::ng-deep .libs-ui-preview-data-container .cm-lintRange-warning{background-color:#ffc80026}:host ::ng-deep .libs-ui-preview-data-container .cm-tooltip-lint{background:#fff8f8;color:#d32f2f;border:1px solid #f44336;padding:8px 10px;font-size:13px;font-family:Inter,sans-serif;border-radius:6px;box-shadow:0 2px 8px #ff000026}:host ::ng-deep .libs-ui-preview-data-container .cm-focused{outline:none!important}:host ::ng-deep .libs-ui-preview-data-container .cm-content,:host ::ng-deep .libs-ui-preview-data-container .cm-gutters{font-family:JetBrains Mono,Fira Code,Cascadia Mono,Consolas,DejaVu Sans Mono,monospace;font-size:12px}:host ::ng-deep .libs-ui-preview-data-container .cm-activeLine{background-color:#f4f8ff!important}:host ::ng-deep .libs-ui-preview-data-container .cm-activeLineGutter{background-color:#f4f8ff!important;color:#1a73e8}:host ::ng-deep .libs-ui-preview-data-container .cm-lineNumbers .cm-gutterElement{color:#9aa0a6}:host ::ng-deep .libs-ui-preview-data-container .cm-cursor,:host ::ng-deep .libs-ui-preview-data-container .cm-dropCursor{border-left-color:#1a73e8!important}:host ::ng-deep .libs-ui-preview-data-container .cm-matchingBracket{background-color:#d2e3fc!important;color:inherit!important;font-weight:600}:host ::ng-deep .libs-ui-preview-data-container .cm-nonmatchingBracket{background-color:#fce8e6!important;color:#c5221f!important}:host ::ng-deep .libs-ui-preview-data-container .cm-selectionBackground{background-color:#007aff40!important}:host ::ng-deep .libs-ui-preview-data-container .cm-selectionLayer{z-index:1!important}:host ::ng-deep .libs-ui-preview-data-container .cm-gutters{background-color:var(--background-color)!important}:host ::ng-deep .libs-ui-preview-data-container .cm-tooltip-autocomplete{border:1px solid #e6e7ea;border-radius:6px;background:#fff;box-shadow:0 4px 12px #0f172a1f;overflow:hidden}:host ::ng-deep .libs-ui-preview-data-container .cm-tooltip-autocomplete>ul{max-height:260px;font-family:var(--libs-ui-font-family-name, \"Arial\")}:host ::ng-deep .libs-ui-preview-data-container .cm-tooltip-autocomplete>ul>li{display:flex;align-items:baseline;gap:10px;padding:5px 10px!important;line-height:18px}:host ::ng-deep .libs-ui-preview-data-container .cm-tooltip-autocomplete>ul>li[aria-selected]{background:#e9f1fe;color:#071631}:host ::ng-deep .libs-ui-preview-data-container .cm-tooltip-autocomplete .cm-completionLabel{flex:0 0 auto;font-family:var(--libs-ui-font-family-name, \"Arial\");font-size:12px;font-weight:500;color:#071631}:host ::ng-deep .libs-ui-preview-data-container .cm-tooltip-autocomplete .cm-completionDetail{flex:1 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-family:var(--libs-ui-font-family-name, \"Arial\");font-size:11px;font-style:normal;color:#6a7383;text-align:right}:host ::ng-deep .libs-ui-preview-data-container .cm-tooltip-autocomplete .cm-completionIcon{flex:0 0 auto;font-family:var(--libs-ui-font-family-name, \"Arial\");opacity:.5}:host ::ng-deep .libs-ui-preview-data-container .cm-completionInfo{border:1px solid #e6e7ea;border-radius:6px;background:#fff;padding:8px 10px;font-family:var(--libs-ui-font-family-name, \"Arial\");font-size:11px;color:#6a7383}:host ::ng-deep .cm-panels{background-color:#fff;color:#071631}:host ::ng-deep .cm-panels-bottom{margin:0 -8px;border-top:1px solid #e6e7ea;border-radius:0 0 8px 8px;overflow:hidden}:host ::ng-deep .cm-panels{container-type:inline-size}:host ::ng-deep .cm-panels-top{border-bottom:1px solid #e6e7ea}:host ::ng-deep .libs-ui-cm-search{--cm-search-accent: var(--libs-ui-color-default, #226ff5);--cm-search-accent-soft: var(--libs-ui-color-light-2, #e9f1fe);display:grid;grid-template-columns:max-content minmax(0,1fr) minmax(96px,max-content) minmax(96px,max-content) 28px;grid-template-areas:\"find-label find-field findNext select close\" \"replace-label replace-field replace replaceAll .\";align-items:center;gap:6px 8px;padding:8px 8px 8px 12px;background-color:#f4f5f7;font-family:var(--libs-ui-font-family-name, \"Arial\");font-size:12px;line-height:18px}:host ::ng-deep .libs-ui-cm-search [data-area=find-label]{grid-area:find-label}:host ::ng-deep .libs-ui-cm-search [data-area=find-field]{grid-area:find-field}:host ::ng-deep .libs-ui-cm-search [data-area=replace-label]{grid-area:replace-label}:host ::ng-deep .libs-ui-cm-search [data-area=replace-field]{grid-area:replace-field}:host ::ng-deep .libs-ui-cm-search [name=findNext]{grid-area:findNext}:host ::ng-deep .libs-ui-cm-search [name=select]{grid-area:select}:host ::ng-deep .libs-ui-cm-search [name=replace].libs-ui-cm-search-button{grid-area:replace}:host ::ng-deep .libs-ui-cm-search [name=replaceAll]{grid-area:replaceAll}:host ::ng-deep .libs-ui-cm-search>[name=close]{grid-area:close}:host ::ng-deep .libs-ui-cm-search-label{color:#6a7383;font-size:12px;text-align:right;white-space:nowrap}:host ::ng-deep .libs-ui-cm-search-field{display:flex;min-width:0;align-items:center;gap:2px;box-sizing:border-box;height:30px;padding:0 3px 0 8px;border:1px solid #dcdfe4;border-radius:4px;background-color:#fff;transition:border-color .15s,box-shadow .15s}:host ::ng-deep .libs-ui-cm-search-field:hover{border-color:#c4c8cf}:host ::ng-deep .libs-ui-cm-search-field:focus-within{border-color:var(--cm-search-accent);box-shadow:0 0 0 3px var(--cm-search-accent-soft)}:host ::ng-deep .libs-ui-cm-search-field.is-invalid,:host ::ng-deep .libs-ui-cm-search-field.is-invalid:focus-within{border-color:#ee2d41;box-shadow:0 0 0 3px #fdeaec}:host ::ng-deep .libs-ui-cm-search-field-icon{flex-shrink:0;margin-right:6px;line-height:0}:host ::ng-deep .libs-ui-cm-search-field-icon:before{color:#9ca2ad!important;font-size:14px}:host ::ng-deep .libs-ui-cm-search-input{flex:1 1 auto;min-width:0;height:100%;padding:0;border:none;background:transparent;color:#071631;font-family:JetBrains Mono,Fira Code,Consolas,DejaVu Sans Mono,monospace;font-size:12px;outline:none}:host ::ng-deep .libs-ui-cm-search-input::placeholder{color:#9ca2ad;font-family:var(--libs-ui-font-family-name, \"Arial\")}:host ::ng-deep .libs-ui-cm-search-count{flex-shrink:0;padding:0 4px;color:#6a7383;font-size:11px;white-space:nowrap}:host ::ng-deep .libs-ui-cm-search-count.is-empty{color:#ee2d41}:host ::ng-deep .libs-ui-cm-search-count.is-hidden{display:none}:host ::ng-deep .libs-ui-cm-search-divider{flex-shrink:0;width:1px;height:16px;margin:0 3px;background-color:#e6e7ea}:host ::ng-deep .libs-ui-cm-search-toggle{flex-shrink:0;width:24px;height:22px;padding:0;border:1px solid transparent;border-radius:3px;background:transparent;color:#6a7383;font-family:JetBrains Mono,Consolas,monospace;font-size:11px;font-weight:600;line-height:20px;cursor:pointer}:host ::ng-deep .libs-ui-cm-search-toggle:hover{background-color:#f2f4f7;color:#071631}:host ::ng-deep .libs-ui-cm-search-toggle[aria-pressed=true]{border-color:var(--cm-search-accent);background-color:var(--cm-search-accent-soft);color:var(--cm-search-accent)}:host ::ng-deep .libs-ui-cm-search-toggle[name=word]{text-decoration:underline;text-underline-offset:2px}:host ::ng-deep .libs-ui-cm-search-icon-button{display:inline-flex;flex-shrink:0;align-items:center;justify-content:center;width:22px;height:22px;padding:0;border:none;border-radius:3px;background:transparent;line-height:0;cursor:pointer}:host ::ng-deep .libs-ui-cm-search-icon-button i:before{color:#6a7383!important;font-size:12px}:host ::ng-deep .libs-ui-cm-search-icon-button[name=prev] i{transform:rotate(-90deg)}:host ::ng-deep .libs-ui-cm-search-icon-button[name=next] i{transform:rotate(90deg)}:host ::ng-deep .libs-ui-cm-search-icon-button[name=close]{width:28px;height:28px}:host ::ng-deep .libs-ui-cm-search-icon-button[name=close] i:before{font-size:14px}:host ::ng-deep .libs-ui-cm-search-icon-button:hover:not(:disabled){background-color:#e9ebee}:host ::ng-deep .libs-ui-cm-search-icon-button:hover:not(:disabled) i:before{color:#071631!important}:host ::ng-deep .libs-ui-cm-search-icon-button:disabled{opacity:.35;cursor:default}:host ::ng-deep .libs-ui-cm-search-button{box-sizing:border-box;width:100%;height:30px;padding:0 8px;overflow:hidden;border:1px solid #dcdfe4;border-radius:4px;background-color:#fff;color:#071631;font-family:inherit;font-size:12px;font-weight:500;text-overflow:ellipsis;white-space:nowrap;cursor:pointer;transition:border-color .15s,color .15s,background-color .15s}:host ::ng-deep .libs-ui-cm-search-button:hover{border-color:var(--cm-search-accent);color:var(--cm-search-accent)}:host ::ng-deep .libs-ui-cm-search-button:active{background-color:var(--cm-search-accent-soft)}:host ::ng-deep .libs-ui-cm-search-button.is-primary{border-color:var(--cm-search-accent);background-color:var(--cm-search-accent);color:#fff}:host ::ng-deep .libs-ui-cm-search-button.is-primary:hover{filter:brightness(.95);color:#fff}@container (max-width: 720px){:host ::ng-deep .libs-ui-cm-search{grid-template-columns:repeat(4,minmax(0,1fr)) 28px;grid-template-areas:\"find-field find-field find-field find-field close\" \"replace-field replace-field replace-field replace-field .\" \"findNext select replace replaceAll .\"}:host ::ng-deep .libs-ui-cm-search-label{display:none}}@container (max-width: 480px){:host ::ng-deep .libs-ui-cm-search{gap:6px 4px}:host ::ng-deep .libs-ui-cm-search-button{padding:0 4px;font-size:11px}}:host ::ng-deep .cm-searchMatch{background-color:#ffc8004d;outline:1px solid rgba(255,170,0,.5)}:host ::ng-deep .cm-searchMatch-selected{background-color:#1a73e840}\n"], dependencies: [{ kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i1.TranslatePipe, name: "translate" }, { kind: "component", type: LibsUiComponentsDropdownComponent, selector: "libs_ui-components-dropdown", inputs: ["useXssFilter", "popoverElementRefCustom", "classInclude", "ignoreStopPropagationEvent", "flagMouse", "flagMouseContent", "popoverCustomConfig", "isNgContent", "zIndex", "convertItemSelected", "getPopoverItemSelected", "httpRequestDetailItemById", "lengthKeys", "textDisplayWhenNoSelect", "textDisplayWhenMultiSelect", "classIncludeTextDisplayWhenNoSelect", "fieldLabel", "fieldGetLabel", "labelPopoverConfig", "labelPopoverFullWidth", "hasContentUnitRight", "listSearchNoDataTemplateRef", "dropdownTemplateRefNotSearchNoData", "fieldGetImage", "imageSize", "typeShape", "fieldGetIcon", "fieldGetTextAvatar", "fieldGetColorAvatar", "classAvatarInclude", "getLastTextAfterSpace", "linkImageError", "showError", "showBorderError", "disable", "readonly", "labelConfig", "disableLabel", "listSearchConfig", "isSearchOnline", "listHiddenInputSearch", "listSearchPadding", "listKeySearch", "listDividerClassInclude", "listConfig", "listButtonsOther", "listHasButtonUnSelectOption", "listClickExactly", "listBackgroundCustom", "listMaxItemShow", "listKeySelected", "listMultiKeySelected", "listKeysDisable", "listKeysHidden", "validRequired", "validMaxItemSelected", "changeValidUndefinedResetError", "allowSelectItemMultiple", "focusInputSearch", "onlyEmitDataWhenReset", "onlyEmitMultiKeyWhenManualClick", "resetKeyWhenSelectAllKey", "listConfigHasDivider", "classIncludeIcon", "classIncludeContent", "listIgnoreClassDisableDefaultWhenUseKeysDisableItem", "tabKeyActive", "tabsConfig", "ignoreBorderBottom"], outputs: ["flagMouseChange", "flagMouseContentChange", "lengthKeysChange", "showBorderErrorChange", "listKeySelectedChange", "listMultiKeySelectedChange", "tabKeyActiveChange", "outSelectKey", "outSelectMultiKey", "outFunctionsControl", "outValidEvent", "outChangStageFlagMouse", "outDataChange", "outClickButtonOther", "outShowList", "outChangeTabKeyActive"] }, { kind: "component", type: LibsUiComponentsButtonsButtonComponent, selector: "libs_ui-components-buttons-button", inputs: ["flagMouse", "type", "buttonCustom", "sizeButton", "label", "disable", "isPending", "imageLeft", "classInclude", "classIconLeft", "classIconRight", "classLabel", "iconOnlyType", "popover", "ignoreStopPropagationEvent", "zIndex", "widthLabelPopover", "styleIconLeft", "styleButton", "ignoreFocusWhenInputTab", "ignoreSetClickWhenShowPopover", "ignorePointerEvent", "isActive", "isHandlerEnterDocumentClickButton"], outputs: ["outClick", "outPopoverEvent", "outFunctionsControl"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1926
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: LibsUiComponentsPreviewTextDataComponent, isStandalone: true, selector: "libs_ui-components-preview_text_data", inputs: { content: { classPropertyName: "content", publicName: "content", isSignal: true, isRequired: false, transformFunction: null }, langSelected: { classPropertyName: "langSelected", publicName: "langSelected", isSignal: true, isRequired: true, transformFunction: null }, langsAccept: { classPropertyName: "langsAccept", publicName: "langsAccept", isSignal: true, isRequired: false, transformFunction: null }, langsChangeLabel: { classPropertyName: "langsChangeLabel", publicName: "langsChangeLabel", isSignal: true, isRequired: false, transformFunction: null }, editable: { classPropertyName: "editable", publicName: "editable", isSignal: true, isRequired: false, transformFunction: null }, hiddenAction: { classPropertyName: "hiddenAction", publicName: "hiddenAction", isSignal: true, isRequired: false, transformFunction: null }, minLines: { classPropertyName: "minLines", publicName: "minLines", isSignal: true, isRequired: false, transformFunction: null }, maxLines: { classPropertyName: "maxLines", publicName: "maxLines", isSignal: true, isRequired: false, transformFunction: null }, containerElement: { classPropertyName: "containerElement", publicName: "containerElement", isSignal: true, isRequired: false, transformFunction: null }, zIndexPopover: { classPropertyName: "zIndexPopover", publicName: "zIndexPopover", isSignal: true, isRequired: false, transformFunction: null }, hiddenSearchLang: { classPropertyName: "hiddenSearchLang", publicName: "hiddenSearchLang", isSignal: true, isRequired: false, transformFunction: null }, lintIgnorePatterns: { classPropertyName: "lintIgnorePatterns", publicName: "lintIgnorePatterns", isSignal: true, isRequired: false, transformFunction: null }, syntaxIgnoreTokens: { classPropertyName: "syntaxIgnoreTokens", publicName: "syntaxIgnoreTokens", isSignal: true, isRequired: false, transformFunction: null }, completions: { classPropertyName: "completions", publicName: "completions", isSignal: true, isRequired: false, transformFunction: null }, forbiddenPatterns: { classPropertyName: "forbiddenPatterns", publicName: "forbiddenPatterns", isSignal: true, isRequired: false, transformFunction: null }, background: { classPropertyName: "background", publicName: "background", isSignal: true, isRequired: false, transformFunction: null }, showFormatAction: { classPropertyName: "showFormatAction", publicName: "showFormatAction", isSignal: true, isRequired: false, transformFunction: null }, autoFormatOnLoad: { classPropertyName: "autoFormatOnLoad", publicName: "autoFormatOnLoad", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { langSelected: "langSelectedChange", outChange: "outChange", syntaxErrors: "syntaxErrors", outViolations: "outViolations" }, viewQueries: [{ propertyName: "containerPreview", first: true, predicate: ["containerPreview"], descendants: true, isSignal: true }], ngImport: i0, template: "<div\n class=\"libs-ui-preview-data-container flex flex-col w-full h-auto rounded-[8px] libs-ui-border-general px-[8px]\"\n [style.--background-color]=\"background()\"\n [class.pt-[8px]]=\"!hiddenAction()\">\n @if (!hiddenAction()) {\n <div class=\"flex items-center content-between color-[#6a7383]\">\n <libs_ui-components-dropdown\n classInclude=\"w-[200px]\"\n [listConfig]=\"configLoadDataIsHttpConfig()\"\n [listMaxItemShow]=\"5\"\n [zIndex]=\"zIndexPopover()\"\n [isNgContent]=\"true\"\n [readonly]=\"!editable() || !acceptChangeLang()\"\n [listHasButtonUnSelectOption]=\"false\"\n [listHiddenInputSearch]=\"hiddenSearchLang()\"\n (outSelectKey)=\"handlerSelectKey($event)\">\n <libs_ui-components-buttons-button\n [type]=\"'button-link-third'\"\n [label]=\"labelLang() || ''\"\n [sizeButton]=\"'small'\"\n [classIconRight]=\"editable() && acceptChangeLang() ? 'libs-ui-icon-move-right rotate-90' : ''\"\n [classInclude]=\"'!p-[0px]' + (editable() && acceptChangeLang() ? '' : '!pointer-events-none !cursor-default hover:!text-[#6A7383]')\" />\n </libs_ui-components-dropdown>\n <div class=\"flex items-center\">\n <!-- G\u1EE3i \u00FD ph\u00EDm t\u1EAFt t\u00ECm/thay th\u1EBF \u2014 khung Ctrl + F c\u1EE7a CodeMirror kh\u00F4ng c\u00F3 n\u00FAt m\u1EDF n\u00E0o tr\u00EAn thanh c\u00F4ng c\u1EE5,\n kh\u00F4ng nh\u1EAFc th\u00EC ng\u01B0\u1EDDi d\u00F9ng kh\u00F4ng bi\u1EBFt c\u00F3 (ng\u01B0\u1EDDi d\u00F9ng y\u00EAu c\u1EA7u 30/09/2026). -->\n @if (editable()) {\n <span class=\"libs-ui-font-h6r mr-[16px] whitespace-nowrap text-[#9ca2ad]\">\n {{ 'i18n_code_editor_search_hint' | translate: { key: searchShortcut } }}\n </span>\n }\n <!-- \u0110\u1ECBnh d\u1EA1ng: \u0111\u1EE9ng tr\u01B0\u1EDBc \"Xu\u1ED1ng d\u00F2ng\" v\u00EC n\u00F3 l\u00E0 thao t\u00E1c tr\u00EAn N\u1ED8I DUNG, hai n\u00FAt sau ch\u1EC9 \u0111\u1ED5i\n c\u00E1ch hi\u1EC3n th\u1ECB. Ch\u1EC9 hi\u1EC7n khi \u00F4 s\u1EEDa \u0111\u01B0\u1EE3c v\u00E0 ng\u00F4n ng\u1EEF c\u00F3 b\u1ED9 \u0111\u1ECBnh d\u1EA1ng \u2014 xem `canFormat`. -->\n @if (canFormat()) {\n <libs_ui-components-buttons-button\n [type]=\"'button-link-third'\"\n [label]=\"'i18n_format_code'\"\n [sizeButton]=\"'small'\"\n [classIconLeft]=\"'libs-ui-icon-align-left'\"\n [classInclude]=\"'mo-lib-p-0px mo-lib-mr-16px'\"\n (outClick)=\"handlerFormat()\" />\n }\n <libs_ui-components-buttons-button\n [type]=\"'button-link-third'\"\n [label]=\"isWrap() ? 'i18n_remove_line_wrap' : 'i18n_line_wrap'\"\n [sizeButton]=\"'small'\"\n [classIconLeft]=\"isWrap() ? 'libs-ui-icon-unwrap' : 'libs-ui-icon-wrap'\"\n [classInclude]=\"'mo-lib-p-0px mo-lib-mr-16px'\"\n (outClick)=\"handlerLineWrap()\" />\n <libs_ui-components-buttons-button\n [type]=\"'button-link-third'\"\n [label]=\"'i18n_copy'\"\n [sizeButton]=\"'small'\"\n [classIconLeft]=\"'libs-ui-icon-copy'\"\n [classInclude]=\"'mo-lib-p-0px'\"\n (outClick)=\"handlerCopy()\" />\n </div>\n </div>\n }\n <div #containerPreview></div>\n</div>\n", styles: [":host ::ng-deep .libs-ui-preview-data-container{background-color:var(--background-color)!important}:host ::ng-deep .libs-ui-preview-data-container .cm-line{white-space:pre-wrap}:host ::ng-deep .libs-ui-preview-data-container .cm-lintRange-error{background-color:#ff323233;border-bottom:2px solid red}:host ::ng-deep .libs-ui-preview-data-container .cm-lintRange-warning{background-color:#ffc80026}:host ::ng-deep .libs-ui-preview-data-container .cm-tooltip-lint{background:#fff8f8;color:#d32f2f;border:1px solid #f44336;padding:8px 10px;font-size:13px;font-family:Inter,sans-serif;border-radius:6px;box-shadow:0 2px 8px #ff000026}:host ::ng-deep .libs-ui-preview-data-container .cm-focused{outline:none!important}:host ::ng-deep .libs-ui-preview-data-container .cm-content,:host ::ng-deep .libs-ui-preview-data-container .cm-gutters{font-family:JetBrains Mono,Fira Code,Cascadia Mono,Consolas,DejaVu Sans Mono,monospace;font-size:12px}:host ::ng-deep .libs-ui-preview-data-container .cm-activeLine{background-color:#f4f8ff!important}:host ::ng-deep .libs-ui-preview-data-container .cm-activeLineGutter{background-color:#f4f8ff!important;color:#1a73e8}:host ::ng-deep .libs-ui-preview-data-container .cm-lineNumbers .cm-gutterElement{color:#9aa0a6}:host ::ng-deep .libs-ui-preview-data-container .cm-cursor,:host ::ng-deep .libs-ui-preview-data-container .cm-dropCursor{border-left-color:#1a73e8!important}:host ::ng-deep .libs-ui-preview-data-container .cm-matchingBracket{background-color:#d2e3fc!important;color:inherit!important;font-weight:600}:host ::ng-deep .libs-ui-preview-data-container .cm-nonmatchingBracket{background-color:#fce8e6!important;color:#c5221f!important}:host ::ng-deep .libs-ui-preview-data-container .cm-selectionBackground{background-color:#007aff40!important}:host ::ng-deep .libs-ui-preview-data-container .cm-selectionLayer{z-index:1!important}:host ::ng-deep .libs-ui-preview-data-container .cm-gutters{background-color:var(--background-color)!important}:host ::ng-deep .libs-ui-preview-data-container .cm-tooltip-autocomplete{border:1px solid #e6e7ea;border-radius:6px;background:#fff;box-shadow:0 4px 12px #0f172a1f;overflow:hidden}:host ::ng-deep .libs-ui-preview-data-container .cm-tooltip-autocomplete>ul{max-height:260px;font-family:var(--libs-ui-font-family-name, \"Arial\")}:host ::ng-deep .libs-ui-preview-data-container .cm-tooltip-autocomplete>ul>li{display:flex;align-items:baseline;gap:10px;padding:5px 10px!important;line-height:18px}:host ::ng-deep .libs-ui-preview-data-container .cm-tooltip-autocomplete>ul>li[aria-selected]{background:#e9f1fe;color:#071631}:host ::ng-deep .libs-ui-preview-data-container .cm-tooltip-autocomplete .cm-completionLabel{flex:0 0 auto;font-family:var(--libs-ui-font-family-name, \"Arial\");font-size:12px;font-weight:500;color:#071631}:host ::ng-deep .libs-ui-preview-data-container .cm-tooltip-autocomplete .cm-completionDetail{flex:1 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-family:var(--libs-ui-font-family-name, \"Arial\");font-size:11px;font-style:normal;color:#6a7383;text-align:right}:host ::ng-deep .libs-ui-preview-data-container .cm-tooltip-autocomplete .cm-completionIcon{flex:0 0 auto;font-family:var(--libs-ui-font-family-name, \"Arial\");opacity:.5}:host ::ng-deep .libs-ui-preview-data-container .cm-completionInfo{border:1px solid #e6e7ea;border-radius:6px;background:#fff;padding:8px 10px;font-family:var(--libs-ui-font-family-name, \"Arial\");font-size:11px;color:#6a7383}:host ::ng-deep .cm-panels{background-color:#fff;color:#071631}:host ::ng-deep .cm-panels-bottom{margin:0 -8px;border-top:1px solid #e6e7ea;border-radius:0 0 8px 8px;overflow:hidden}:host ::ng-deep .cm-panels{container-type:inline-size}:host ::ng-deep .cm-panels-top{border-bottom:1px solid #e6e7ea}:host ::ng-deep .libs-ui-cm-search{--cm-search-accent: var(--libs-ui-color-default, #226ff5);--cm-search-accent-soft: var(--libs-ui-color-light-2, #e9f1fe);display:grid;grid-template-columns:max-content minmax(0,1fr) minmax(96px,max-content) minmax(96px,max-content) 28px;grid-template-areas:\"find-label find-field findNext select close\" \"replace-label replace-field replace replaceAll .\";align-items:center;gap:6px 8px;padding:8px 8px 8px 12px;background-color:#f4f5f7;font-family:var(--libs-ui-font-family-name, \"Arial\");font-size:12px;line-height:18px}:host ::ng-deep .libs-ui-cm-search [data-area=find-label]{grid-area:find-label}:host ::ng-deep .libs-ui-cm-search [data-area=find-field]{grid-area:find-field}:host ::ng-deep .libs-ui-cm-search [data-area=replace-label]{grid-area:replace-label}:host ::ng-deep .libs-ui-cm-search [data-area=replace-field]{grid-area:replace-field}:host ::ng-deep .libs-ui-cm-search [name=findNext]{grid-area:findNext}:host ::ng-deep .libs-ui-cm-search [name=select]{grid-area:select}:host ::ng-deep .libs-ui-cm-search [name=replace].libs-ui-cm-search-button{grid-area:replace}:host ::ng-deep .libs-ui-cm-search [name=replaceAll]{grid-area:replaceAll}:host ::ng-deep .libs-ui-cm-search>[name=close]{grid-area:close}:host ::ng-deep .libs-ui-cm-search-label{color:#6a7383;font-size:12px;text-align:right;white-space:nowrap}:host ::ng-deep .libs-ui-cm-search-field{display:flex;min-width:0;align-items:center;gap:2px;box-sizing:border-box;height:30px;padding:0 3px 0 8px;border:1px solid #dcdfe4;border-radius:4px;background-color:#fff;transition:border-color .15s,box-shadow .15s}:host ::ng-deep .libs-ui-cm-search-field:hover{border-color:#c4c8cf}:host ::ng-deep .libs-ui-cm-search-field:focus-within{border-color:var(--cm-search-accent);box-shadow:0 0 0 3px var(--cm-search-accent-soft)}:host ::ng-deep .libs-ui-cm-search-field.is-invalid,:host ::ng-deep .libs-ui-cm-search-field.is-invalid:focus-within{border-color:#ee2d41;box-shadow:0 0 0 3px #fdeaec}:host ::ng-deep .libs-ui-cm-search-field-icon{flex-shrink:0;margin-right:6px;line-height:0}:host ::ng-deep .libs-ui-cm-search-field-icon:before{color:#9ca2ad!important;font-size:14px}:host ::ng-deep .libs-ui-cm-search-input{flex:1 1 auto;min-width:0;height:100%;padding:0;border:none;background:transparent;color:#071631;font-family:JetBrains Mono,Fira Code,Consolas,DejaVu Sans Mono,monospace;font-size:12px;outline:none}:host ::ng-deep .libs-ui-cm-search-input::placeholder{color:#9ca2ad;font-family:var(--libs-ui-font-family-name, \"Arial\")}:host ::ng-deep .libs-ui-cm-search-count{flex-shrink:0;padding:0 4px;color:#6a7383;font-size:11px;white-space:nowrap}:host ::ng-deep .libs-ui-cm-search-count.is-empty{color:#ee2d41}:host ::ng-deep .libs-ui-cm-search-count.is-hidden{display:none}:host ::ng-deep .libs-ui-cm-search-divider{flex-shrink:0;width:1px;height:16px;margin:0 3px;background-color:#e6e7ea}:host ::ng-deep .libs-ui-cm-search-toggle{flex-shrink:0;width:24px;height:22px;padding:0;border:1px solid transparent;border-radius:3px;background:transparent;color:#6a7383;font-family:JetBrains Mono,Consolas,monospace;font-size:11px;font-weight:600;line-height:20px;cursor:pointer}:host ::ng-deep .libs-ui-cm-search-toggle:hover{background-color:#f2f4f7;color:#071631}:host ::ng-deep .libs-ui-cm-search-toggle[aria-pressed=true]{border-color:var(--cm-search-accent);background-color:var(--cm-search-accent-soft);color:var(--cm-search-accent)}:host ::ng-deep .libs-ui-cm-search-toggle[name=word]{text-decoration:underline;text-underline-offset:2px}:host ::ng-deep .libs-ui-cm-search-icon-button{display:inline-flex;flex-shrink:0;align-items:center;justify-content:center;width:22px;height:22px;padding:0;border:none;border-radius:3px;background:transparent;line-height:0;cursor:pointer}:host ::ng-deep .libs-ui-cm-search-icon-button i:before{color:#6a7383!important;font-size:12px}:host ::ng-deep .libs-ui-cm-search-icon-button[name=prev] i{transform:rotate(-90deg)}:host ::ng-deep .libs-ui-cm-search-icon-button[name=next] i{transform:rotate(90deg)}:host ::ng-deep .libs-ui-cm-search-icon-button[name=close]{width:28px;height:28px}:host ::ng-deep .libs-ui-cm-search-icon-button[name=close] i:before{font-size:14px}:host ::ng-deep .libs-ui-cm-search-icon-button:hover:not(:disabled){background-color:#e9ebee}:host ::ng-deep .libs-ui-cm-search-icon-button:hover:not(:disabled) i:before{color:#071631!important}:host ::ng-deep .libs-ui-cm-search-icon-button:disabled{opacity:.35;cursor:default}:host ::ng-deep .libs-ui-cm-search-button{box-sizing:border-box;width:100%;height:30px;padding:0 8px;overflow:hidden;border:1px solid #dcdfe4;border-radius:4px;background-color:#fff;color:#071631;font-family:inherit;font-size:12px;font-weight:500;text-overflow:ellipsis;white-space:nowrap;cursor:pointer;transition:border-color .15s,color .15s,background-color .15s}:host ::ng-deep .libs-ui-cm-search-button:hover{border-color:var(--cm-search-accent);color:var(--cm-search-accent)}:host ::ng-deep .libs-ui-cm-search-button:active{background-color:var(--cm-search-accent-soft)}:host ::ng-deep .libs-ui-cm-search-button.is-primary{border-color:var(--cm-search-accent);background-color:var(--cm-search-accent);color:#fff}:host ::ng-deep .libs-ui-cm-search-button.is-primary:hover{filter:brightness(.95);color:#fff}@container (max-width: 720px){:host ::ng-deep .libs-ui-cm-search{grid-template-columns:repeat(4,minmax(0,1fr)) 28px;grid-template-areas:\"find-field find-field find-field find-field close\" \"replace-field replace-field replace-field replace-field .\" \"findNext select replace replaceAll .\"}:host ::ng-deep .libs-ui-cm-search-label{display:none}}@container (max-width: 480px){:host ::ng-deep .libs-ui-cm-search{gap:6px 4px}:host ::ng-deep .libs-ui-cm-search-button{padding:0 4px;font-size:11px}}:host ::ng-deep .cm-searchMatch{background-color:#ffc8004d;outline:1px solid rgba(255,170,0,.5)}:host ::ng-deep .cm-searchMatch-selected{background-color:#1a73e840}\n"], dependencies: [{ kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i1.TranslatePipe, name: "translate" }, { kind: "component", type: LibsUiComponentsDropdownComponent, selector: "libs_ui-components-dropdown", inputs: ["useXssFilter", "popoverElementRefCustom", "classInclude", "ignoreStopPropagationEvent", "flagMouse", "flagMouseContent", "popoverCustomConfig", "isNgContent", "zIndex", "convertItemSelected", "getPopoverItemSelected", "httpRequestDetailItemById", "lengthKeys", "textDisplayWhenNoSelect", "textDisplayWhenMultiSelect", "classIncludeTextDisplayWhenNoSelect", "fieldLabel", "fieldGetLabel", "labelPopoverConfig", "labelPopoverFullWidth", "hasContentUnitRight", "listSearchNoDataTemplateRef", "dropdownTemplateRefNotSearchNoData", "fieldGetImage", "imageSize", "typeShape", "fieldGetIcon", "fieldGetTextAvatar", "fieldGetColorAvatar", "classAvatarInclude", "getLastTextAfterSpace", "linkImageError", "showError", "showBorderError", "disable", "readonly", "labelConfig", "disableLabel", "listSearchConfig", "isSearchOnline", "listHiddenInputSearch", "listSearchPadding", "listKeySearch", "listDividerClassInclude", "listConfig", "listButtonsOther", "listHasButtonUnSelectOption", "listClickExactly", "listBackgroundCustom", "listMaxItemShow", "listKeySelected", "listMultiKeySelected", "listKeysDisable", "listKeysHidden", "validRequired", "validMaxItemSelected", "changeValidUndefinedResetError", "allowSelectItemMultiple", "focusInputSearch", "onlyEmitDataWhenReset", "onlyEmitMultiKeyWhenManualClick", "resetKeyWhenSelectAllKey", "listConfigHasDivider", "classIncludeIcon", "classIncludeContent", "listIgnoreClassDisableDefaultWhenUseKeysDisableItem", "tabKeyActive", "tabsConfig", "ignoreBorderBottom"], outputs: ["flagMouseChange", "flagMouseContentChange", "lengthKeysChange", "showBorderErrorChange", "listKeySelectedChange", "listMultiKeySelectedChange", "tabKeyActiveChange", "outSelectKey", "outSelectMultiKey", "outFunctionsControl", "outValidEvent", "outChangStageFlagMouse", "outDataChange", "outClickButtonOther", "outShowList", "outChangeTabKeyActive"] }, { kind: "component", type: LibsUiComponentsButtonsButtonComponent, selector: "libs_ui-components-buttons-button", inputs: ["flagMouse", "type", "buttonCustom", "sizeButton", "label", "disable", "isPending", "imageLeft", "classInclude", "classIconLeft", "classIconRight", "classLabel", "iconOnlyType", "popover", "ignoreStopPropagationEvent", "zIndex", "widthLabelPopover", "styleIconLeft", "styleButton", "ignoreFocusWhenInputTab", "ignoreSetClickWhenShowPopover", "ignorePointerEvent", "isActive", "isHandlerEnterDocumentClickButton"], outputs: ["outClick", "outPopoverEvent", "outFunctionsControl"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1908
1927
  }
1909
1928
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: LibsUiComponentsPreviewTextDataComponent, decorators: [{
1910
1929
  type: Component,