@shival99/z-ui 2.6.10 → 2.6.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/.npmignore ADDED
@@ -0,0 +1,58 @@
1
+ # Nested package.json's are only needed for development.
2
+ i18n/package.json
3
+ pipes/package.json
4
+ providers/package.json
5
+ services/package.json
6
+ utils/package.json
7
+ components/z-accordion/package.json
8
+ components/z-audio-player/package.json
9
+ components/z-autocomplete/package.json
10
+ components/z-avatar/package.json
11
+ components/z-badge/package.json
12
+ components/z-breadcrumb/package.json
13
+ components/z-button/package.json
14
+ components/z-button-group/package.json
15
+ components/z-calendar/package.json
16
+ components/z-card/package.json
17
+ components/z-chat/package.json
18
+ components/z-checkbox/package.json
19
+ components/z-code/package.json
20
+ components/z-command/package.json
21
+ components/z-drawer/package.json
22
+ components/z-dropdown-menu/package.json
23
+ components/z-editor/package.json
24
+ components/z-empty/package.json
25
+ components/z-filter/package.json
26
+ components/z-gallery/package.json
27
+ components/z-hover-glide/package.json
28
+ components/z-icon/package.json
29
+ components/z-input/package.json
30
+ components/z-kanban/package.json
31
+ components/z-loading/package.json
32
+ components/z-marquee/package.json
33
+ components/z-media-player/package.json
34
+ components/z-menu/package.json
35
+ components/z-metric-card/package.json
36
+ components/z-modal/package.json
37
+ components/z-number-ticker/package.json
38
+ components/z-overlay/package.json
39
+ components/z-pagination/package.json
40
+ components/z-popover/package.json
41
+ components/z-qrcode/package.json
42
+ components/z-radio/package.json
43
+ components/z-scrollarea/package.json
44
+ components/z-select/package.json
45
+ components/z-show-more/package.json
46
+ components/z-skeleton/package.json
47
+ components/z-skeleton-auto/package.json
48
+ components/z-steps/package.json
49
+ components/z-switch/package.json
50
+ components/z-table/package.json
51
+ components/z-tabs/package.json
52
+ components/z-tags/package.json
53
+ components/z-toast/package.json
54
+ components/z-timeline/package.json
55
+ components/z-tooltip/package.json
56
+ components/z-upload/package.json
57
+ services/excel/package.json
58
+ services/office/package.json
@@ -3,6 +3,7 @@ import { inject, viewChild, input, signal, computed, effect, ChangeDetectionStra
3
3
  import { DomSanitizer } from '@angular/platform-browser';
4
4
  import { ZButtonComponent } from '@shival99/z-ui/components/z-button';
5
5
  import { ZIconComponent } from '@shival99/z-ui/components/z-icon';
6
+ import { ZSkeletonComponent } from '@shival99/z-ui/components/z-skeleton';
6
7
  import { ZToastService } from '@shival99/z-ui/components/z-toast';
7
8
  import { ZTranslateService } from '@shival99/z-ui/services';
8
9
  import { zMergeClasses } from '@shival99/z-ui/utils';
@@ -112,7 +113,7 @@ class ZCodeComponent {
112
113
  ...(ngDevMode ? [{ debugName: "zHighlightLines" }] : /* istanbul ignore next */ []));
113
114
  zScrollable = input(false, /* @ts-ignore */
114
115
  ...(ngDevMode ? [{ debugName: "zScrollable" }] : /* istanbul ignore next */ []));
115
- /** Maximum body height in px; only applied when `zScrollable` is set. */
116
+ /** Maximum body height in px or a CSS length; only applied when `zScrollable` is set. */
116
117
  zMaxHeight = input(400, /* @ts-ignore */
117
118
  ...(ngDevMode ? [{ debugName: "zMaxHeight" }] : /* istanbul ignore next */ []));
118
119
  copied = signal(false, /* @ts-ignore */
@@ -143,7 +144,13 @@ class ZCodeComponent {
143
144
  ...(ngDevMode ? [{ debugName: "headerLabel" }] : /* istanbul ignore next */ []));
144
145
  contentClasses = computed(() => zMergeClasses('overflow-x-auto p-4', this.zShowLineNumbers() ? 'z-code-numbered' : '', this.zHighlightLines().length > 0 ? 'z-code-banded' : '', this.zScrollable() ? 'overflow-y-auto' : ''), /* @ts-ignore */
145
146
  ...(ngDevMode ? [{ debugName: "contentClasses" }] : /* istanbul ignore next */ []));
146
- bodyMaxHeight = computed(() => (this.zScrollable() ? `${this.zMaxHeight()}px` : null), /* @ts-ignore */
147
+ bodyMaxHeight = computed(() => {
148
+ if (!this.zScrollable()) {
149
+ return null;
150
+ }
151
+ const maxHeight = this.zMaxHeight();
152
+ return typeof maxHeight === 'number' ? `${maxHeight}px` : maxHeight;
153
+ }, /* @ts-ignore */
147
154
  ...(ngDevMode ? [{ debugName: "bodyMaxHeight" }] : /* istanbul ignore next */ []));
148
155
  constructor() {
149
156
  effect(() => {
@@ -207,11 +214,11 @@ class ZCodeComponent {
207
214
  });
208
215
  }
209
216
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: ZCodeComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
210
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.6", type: ZCodeComponent, isStandalone: true, selector: "z-code", inputs: { class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null }, zTitle: { classPropertyName: "zTitle", publicName: "zTitle", isSignal: true, isRequired: false, transformFunction: null }, zLanguage: { classPropertyName: "zLanguage", publicName: "zLanguage", isSignal: true, isRequired: false, transformFunction: null }, zCode: { classPropertyName: "zCode", publicName: "zCode", isSignal: true, isRequired: false, transformFunction: null }, zTheme: { classPropertyName: "zTheme", publicName: "zTheme", isSignal: true, isRequired: false, transformFunction: null }, zShowLineNumbers: { classPropertyName: "zShowLineNumbers", publicName: "zShowLineNumbers", isSignal: true, isRequired: false, transformFunction: null }, zHighlightLines: { classPropertyName: "zHighlightLines", publicName: "zHighlightLines", isSignal: true, isRequired: false, transformFunction: null }, zScrollable: { classPropertyName: "zScrollable", publicName: "zScrollable", isSignal: true, isRequired: false, transformFunction: null }, zMaxHeight: { classPropertyName: "zMaxHeight", publicName: "zMaxHeight", isSignal: true, isRequired: false, transformFunction: null } }, viewQueries: [{ propertyName: "codeEl", first: true, predicate: ["codeEl"], descendants: true, isSignal: true }], ngImport: i0, template: "<div [class]=\"wrapperClasses()\">\n <!-- Always rendered: without it a title-less block floated its copy button in a strip of empty\n padding, with nothing to anchor the button or separate it from the code. -->\n <div class=\"z-code-header border-border bg-muted/50 flex items-center justify-between gap-2 border-b px-4 py-2\">\n <div class=\"text-muted-foreground flex min-w-0 items-center gap-2\">\n <z-icon zType=\"lucideFileCode\" zSize=\"14\" class=\"shrink-0\" />\n <span class=\"truncate font-mono text-xs\">{{ headerLabel() }}</span>\n </div>\n <button\n z-button\n zType=\"ghost\"\n zSize=\"xs\"\n zIconOnly=\"true\"\n [zWave]=\"false\"\n class=\"shrink-0\"\n [attr.aria-label]=\"copied() ? 'Copied' : 'Copy code'\"\n (click)=\"copyCode()\">\n @if (copied()) {\n <z-icon zType=\"lucideCheck\" zSize=\"14\" class=\"text-green-500\" />\n } @else {\n <z-icon zType=\"lucideCopy\" zSize=\"14\" />\n }\n </button>\n </div>\n <div class=\"relative\">\n @if (isHighlighting()) {\n <div class=\"p-4\">\n <div class=\"bg-muted h-4 w-3/4 animate-pulse rounded-sm\"></div>\n <div class=\"bg-muted mt-2 h-4 w-1/2 animate-pulse rounded-sm\"></div>\n <div class=\"bg-muted mt-2 h-4 w-2/3 animate-pulse rounded-sm\"></div>\n </div>\n } @else {\n <div\n #codeEl\n [class]=\"contentClasses()\"\n [style.max-height]=\"bodyMaxHeight()\"\n [innerHTML]=\"highlightedCode()\"></div>\n }\n </div>\n</div>\n", styles: [":host{display:block}:host ::ng-deep .shiki{margin:0;padding:0;overflow-x:auto;background:transparent!important;background-color:transparent!important}:host ::ng-deep .shiki code{font-family:ui-monospace,SFMono-Regular,SF Mono,Menlo,Consolas,Liberation Mono,monospace;font-size:.875rem;line-height:1.7;display:block;counter-reset:line}:host ::ng-deep .shiki .line{display:inline-block;width:100%}:host ::ng-deep .z-code-numbered .shiki .line:before{counter-increment:line;content:counter(line);display:inline-block;width:2rem;margin-right:1rem;text-align:right;color:var(--muted-foreground);opacity:.5;-webkit-user-select:none;user-select:none}:host ::ng-deep .z-code-banded .shiki .line-highlighted{display:inline-block;width:calc(100% + 2rem);margin:0 -1rem;padding:0 1rem;background:color-mix(in oklab,var(--primary) 12%,transparent);box-shadow:inset .125rem 0 0 var(--primary)}:host-context(.dark) ::ng-deep .shiki,:host-context(.dark) ::ng-deep .shiki span{color:var(--shiki-dark, inherit)!important;font-style:var(--shiki-dark-font-style, inherit)!important;font-weight:var(--shiki-dark-font-weight, inherit)!important;text-decoration:var(--shiki-dark-text-decoration, inherit)!important}\n"], dependencies: [{ kind: "component", type: ZIconComponent, selector: "z-icon, [z-icon]", inputs: ["class", "zType", "zAnimatedType", "zAnimate", "zAnimationTrigger", "zSize", "zStrokeWidth", "zSvg"] }, { kind: "component", type: ZButtonComponent, selector: "z-button, button[z-button], a[z-button]", inputs: ["class", "zType", "zSize", "zShape", "zLabel", "zLoading", "zDisabled", "zTypeIcon", "zAnimatedTypeIcon", "zAnimateIcon", "zAnimationTriggerIcon", "zSizeIcon", "zStrokeWidthIcon", "zWave"], exportAs: ["zButton"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
217
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.6", type: ZCodeComponent, isStandalone: true, selector: "z-code", inputs: { class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null }, zTitle: { classPropertyName: "zTitle", publicName: "zTitle", isSignal: true, isRequired: false, transformFunction: null }, zLanguage: { classPropertyName: "zLanguage", publicName: "zLanguage", isSignal: true, isRequired: false, transformFunction: null }, zCode: { classPropertyName: "zCode", publicName: "zCode", isSignal: true, isRequired: false, transformFunction: null }, zTheme: { classPropertyName: "zTheme", publicName: "zTheme", isSignal: true, isRequired: false, transformFunction: null }, zShowLineNumbers: { classPropertyName: "zShowLineNumbers", publicName: "zShowLineNumbers", isSignal: true, isRequired: false, transformFunction: null }, zHighlightLines: { classPropertyName: "zHighlightLines", publicName: "zHighlightLines", isSignal: true, isRequired: false, transformFunction: null }, zScrollable: { classPropertyName: "zScrollable", publicName: "zScrollable", isSignal: true, isRequired: false, transformFunction: null }, zMaxHeight: { classPropertyName: "zMaxHeight", publicName: "zMaxHeight", isSignal: true, isRequired: false, transformFunction: null } }, viewQueries: [{ propertyName: "codeEl", first: true, predicate: ["codeEl"], descendants: true, isSignal: true }], ngImport: i0, template: "<div [class]=\"wrapperClasses()\">\n <!-- Always rendered: without it a title-less block floated its copy button in a strip of empty\n padding, with nothing to anchor the button or separate it from the code. -->\n <div class=\"z-code-header border-border bg-muted/50 flex items-center justify-between gap-2 border-b px-4 py-2\">\n <div class=\"text-muted-foreground flex min-w-0 items-center gap-2\">\n <z-icon zType=\"lucideFileCode\" zSize=\"14\" class=\"shrink-0\" />\n <span class=\"truncate font-mono text-xs\">{{ headerLabel() }}</span>\n </div>\n <button\n z-button\n zType=\"ghost\"\n zSize=\"xs\"\n zIconOnly=\"true\"\n [zWave]=\"false\"\n class=\"shrink-0\"\n [attr.aria-label]=\"copied() ? 'Copied' : 'Copy code'\"\n (click)=\"copyCode()\">\n @if (copied()) {\n <z-icon zType=\"lucideCheck\" zSize=\"14\" class=\"text-green-500\" />\n } @else {\n <z-icon zType=\"lucideCopy\" zSize=\"14\" />\n }\n </button>\n </div>\n <div class=\"relative min-h-0\" [class.flex-1]=\"zScrollable()\">\n @if (isHighlighting()) {\n @if (zScrollable()) {\n <div class=\"flex h-full flex-col p-4\">\n <z-skeleton class=\"h-full\" [zRows]=\"10\" />\n </div>\n } @else {\n <div class=\"p-4\">\n <z-skeleton zType=\"text\" [zRows]=\"3\" zHeight=\"1rem\" />\n </div>\n }\n } @else {\n <div\n #codeEl\n [class]=\"contentClasses()\"\n [style.max-height]=\"bodyMaxHeight()\"\n [innerHTML]=\"highlightedCode()\"></div>\n }\n </div>\n</div>\n", styles: [":host{display:block}:host ::ng-deep .shiki{margin:0;padding:0;overflow-x:auto;background:transparent!important;background-color:transparent!important}:host ::ng-deep .shiki code{font-family:ui-monospace,SFMono-Regular,SF Mono,Menlo,Consolas,Liberation Mono,monospace;font-size:.875rem;line-height:1.7;display:block;counter-reset:line}:host ::ng-deep .shiki .line{display:inline-block;width:100%}:host ::ng-deep .z-code-numbered .shiki .line:before{counter-increment:line;content:counter(line);display:inline-block;width:2rem;margin-right:1rem;text-align:right;color:var(--muted-foreground);opacity:.5;-webkit-user-select:none;user-select:none}:host ::ng-deep .z-code-banded .shiki .line-highlighted{display:inline-block;width:calc(100% + 2rem);margin:0 -1rem;padding:0 1rem;background:color-mix(in oklab,var(--primary) 12%,transparent);box-shadow:inset .125rem 0 0 var(--primary)}:host-context(.dark) ::ng-deep .shiki,:host-context(.dark) ::ng-deep .shiki span{color:var(--shiki-dark, inherit)!important;font-style:var(--shiki-dark-font-style, inherit)!important;font-weight:var(--shiki-dark-font-weight, inherit)!important;text-decoration:var(--shiki-dark-text-decoration, inherit)!important}\n"], dependencies: [{ kind: "component", type: ZIconComponent, selector: "z-icon, [z-icon]", inputs: ["class", "zType", "zAnimatedType", "zAnimate", "zAnimationTrigger", "zSize", "zStrokeWidth", "zSvg"] }, { kind: "component", type: ZButtonComponent, selector: "z-button, button[z-button], a[z-button]", inputs: ["class", "zType", "zSize", "zShape", "zLabel", "zLoading", "zDisabled", "zTypeIcon", "zAnimatedTypeIcon", "zAnimateIcon", "zAnimationTriggerIcon", "zSizeIcon", "zStrokeWidthIcon", "zWave"], exportAs: ["zButton"] }, { kind: "component", type: ZSkeletonComponent, selector: "z-skeleton", inputs: ["class", "zType", "zSize", "zWidth", "zHeight", "zRows", "zGap", "zAnimated", "zRadius"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
211
218
  }
212
219
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: ZCodeComponent, decorators: [{
213
220
  type: Component,
214
- args: [{ selector: 'z-code', imports: [ZIconComponent, ZButtonComponent], standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, template: "<div [class]=\"wrapperClasses()\">\n <!-- Always rendered: without it a title-less block floated its copy button in a strip of empty\n padding, with nothing to anchor the button or separate it from the code. -->\n <div class=\"z-code-header border-border bg-muted/50 flex items-center justify-between gap-2 border-b px-4 py-2\">\n <div class=\"text-muted-foreground flex min-w-0 items-center gap-2\">\n <z-icon zType=\"lucideFileCode\" zSize=\"14\" class=\"shrink-0\" />\n <span class=\"truncate font-mono text-xs\">{{ headerLabel() }}</span>\n </div>\n <button\n z-button\n zType=\"ghost\"\n zSize=\"xs\"\n zIconOnly=\"true\"\n [zWave]=\"false\"\n class=\"shrink-0\"\n [attr.aria-label]=\"copied() ? 'Copied' : 'Copy code'\"\n (click)=\"copyCode()\">\n @if (copied()) {\n <z-icon zType=\"lucideCheck\" zSize=\"14\" class=\"text-green-500\" />\n } @else {\n <z-icon zType=\"lucideCopy\" zSize=\"14\" />\n }\n </button>\n </div>\n <div class=\"relative\">\n @if (isHighlighting()) {\n <div class=\"p-4\">\n <div class=\"bg-muted h-4 w-3/4 animate-pulse rounded-sm\"></div>\n <div class=\"bg-muted mt-2 h-4 w-1/2 animate-pulse rounded-sm\"></div>\n <div class=\"bg-muted mt-2 h-4 w-2/3 animate-pulse rounded-sm\"></div>\n </div>\n } @else {\n <div\n #codeEl\n [class]=\"contentClasses()\"\n [style.max-height]=\"bodyMaxHeight()\"\n [innerHTML]=\"highlightedCode()\"></div>\n }\n </div>\n</div>\n", styles: [":host{display:block}:host ::ng-deep .shiki{margin:0;padding:0;overflow-x:auto;background:transparent!important;background-color:transparent!important}:host ::ng-deep .shiki code{font-family:ui-monospace,SFMono-Regular,SF Mono,Menlo,Consolas,Liberation Mono,monospace;font-size:.875rem;line-height:1.7;display:block;counter-reset:line}:host ::ng-deep .shiki .line{display:inline-block;width:100%}:host ::ng-deep .z-code-numbered .shiki .line:before{counter-increment:line;content:counter(line);display:inline-block;width:2rem;margin-right:1rem;text-align:right;color:var(--muted-foreground);opacity:.5;-webkit-user-select:none;user-select:none}:host ::ng-deep .z-code-banded .shiki .line-highlighted{display:inline-block;width:calc(100% + 2rem);margin:0 -1rem;padding:0 1rem;background:color-mix(in oklab,var(--primary) 12%,transparent);box-shadow:inset .125rem 0 0 var(--primary)}:host-context(.dark) ::ng-deep .shiki,:host-context(.dark) ::ng-deep .shiki span{color:var(--shiki-dark, inherit)!important;font-style:var(--shiki-dark-font-style, inherit)!important;font-weight:var(--shiki-dark-font-weight, inherit)!important;text-decoration:var(--shiki-dark-text-decoration, inherit)!important}\n"] }]
221
+ args: [{ selector: 'z-code', imports: [ZIconComponent, ZButtonComponent, ZSkeletonComponent], standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, template: "<div [class]=\"wrapperClasses()\">\n <!-- Always rendered: without it a title-less block floated its copy button in a strip of empty\n padding, with nothing to anchor the button or separate it from the code. -->\n <div class=\"z-code-header border-border bg-muted/50 flex items-center justify-between gap-2 border-b px-4 py-2\">\n <div class=\"text-muted-foreground flex min-w-0 items-center gap-2\">\n <z-icon zType=\"lucideFileCode\" zSize=\"14\" class=\"shrink-0\" />\n <span class=\"truncate font-mono text-xs\">{{ headerLabel() }}</span>\n </div>\n <button\n z-button\n zType=\"ghost\"\n zSize=\"xs\"\n zIconOnly=\"true\"\n [zWave]=\"false\"\n class=\"shrink-0\"\n [attr.aria-label]=\"copied() ? 'Copied' : 'Copy code'\"\n (click)=\"copyCode()\">\n @if (copied()) {\n <z-icon zType=\"lucideCheck\" zSize=\"14\" class=\"text-green-500\" />\n } @else {\n <z-icon zType=\"lucideCopy\" zSize=\"14\" />\n }\n </button>\n </div>\n <div class=\"relative min-h-0\" [class.flex-1]=\"zScrollable()\">\n @if (isHighlighting()) {\n @if (zScrollable()) {\n <div class=\"flex h-full flex-col p-4\">\n <z-skeleton class=\"h-full\" [zRows]=\"10\" />\n </div>\n } @else {\n <div class=\"p-4\">\n <z-skeleton zType=\"text\" [zRows]=\"3\" zHeight=\"1rem\" />\n </div>\n }\n } @else {\n <div\n #codeEl\n [class]=\"contentClasses()\"\n [style.max-height]=\"bodyMaxHeight()\"\n [innerHTML]=\"highlightedCode()\"></div>\n }\n </div>\n</div>\n", styles: [":host{display:block}:host ::ng-deep .shiki{margin:0;padding:0;overflow-x:auto;background:transparent!important;background-color:transparent!important}:host ::ng-deep .shiki code{font-family:ui-monospace,SFMono-Regular,SF Mono,Menlo,Consolas,Liberation Mono,monospace;font-size:.875rem;line-height:1.7;display:block;counter-reset:line}:host ::ng-deep .shiki .line{display:inline-block;width:100%}:host ::ng-deep .z-code-numbered .shiki .line:before{counter-increment:line;content:counter(line);display:inline-block;width:2rem;margin-right:1rem;text-align:right;color:var(--muted-foreground);opacity:.5;-webkit-user-select:none;user-select:none}:host ::ng-deep .z-code-banded .shiki .line-highlighted{display:inline-block;width:calc(100% + 2rem);margin:0 -1rem;padding:0 1rem;background:color-mix(in oklab,var(--primary) 12%,transparent);box-shadow:inset .125rem 0 0 var(--primary)}:host-context(.dark) ::ng-deep .shiki,:host-context(.dark) ::ng-deep .shiki span{color:var(--shiki-dark, inherit)!important;font-style:var(--shiki-dark-font-style, inherit)!important;font-weight:var(--shiki-dark-font-weight, inherit)!important;text-decoration:var(--shiki-dark-text-decoration, inherit)!important}\n"] }]
215
222
  }], ctorParameters: () => [], propDecorators: { codeEl: [{ type: i0.ViewChild, args: ['codeEl', { isSignal: true }] }], class: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }], zTitle: [{ type: i0.Input, args: [{ isSignal: true, alias: "zTitle", required: false }] }], zLanguage: [{ type: i0.Input, args: [{ isSignal: true, alias: "zLanguage", required: false }] }], zCode: [{ type: i0.Input, args: [{ isSignal: true, alias: "zCode", required: false }] }], zTheme: [{ type: i0.Input, args: [{ isSignal: true, alias: "zTheme", required: false }] }], zShowLineNumbers: [{ type: i0.Input, args: [{ isSignal: true, alias: "zShowLineNumbers", required: false }] }], zHighlightLines: [{ type: i0.Input, args: [{ isSignal: true, alias: "zHighlightLines", required: false }] }], zScrollable: [{ type: i0.Input, args: [{ isSignal: true, alias: "zScrollable", required: false }] }], zMaxHeight: [{ type: i0.Input, args: [{ isSignal: true, alias: "zMaxHeight", required: false }] }] } });
216
223
 
217
224
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"shival99-z-ui-components-z-code.mjs","sources":["../../../../libs/core-ui/components/z-code/z-code.utils.ts","../../../../libs/core-ui/components/z-code/z-code.component.ts","../../../../libs/core-ui/components/z-code/z-code.component.html","../../../../libs/core-ui/components/z-code/shival99-z-ui-components-z-code.ts"],"sourcesContent":["import type { BundledLanguage, BundledTheme, HighlighterGeneric, ShikiTransformer } from 'shiki';\nimport { createBundledHighlighter } from 'shiki/core';\n\nconst Z_CODE_LANGS = [\n 'typescript',\n 'javascript',\n 'html',\n 'css',\n 'scss',\n 'json',\n 'bash',\n 'shell',\n 'markdown',\n 'yaml',\n 'python',\n 'java',\n 'sql',\n 'xml',\n 'angular-ts',\n 'angular-html',\n] as const;\n\nconst Z_CODE_THEMES = ['github-dark', 'github-light', 'vitesse-dark', 'one-dark-pro'] as const;\n\nconst createZCodeHighlighter = createBundledHighlighter({\n langs: {\n typescript: () => import('shiki/dist/langs/typescript.mjs'),\n javascript: () => import('shiki/dist/langs/javascript.mjs'),\n html: () => import('shiki/dist/langs/html.mjs'),\n css: () => import('shiki/dist/langs/css.mjs'),\n scss: () => import('shiki/dist/langs/scss.mjs'),\n json: () => import('shiki/dist/langs/json.mjs'),\n bash: () => import('shiki/dist/langs/bash.mjs'),\n shell: () => import('shiki/dist/langs/shell.mjs'),\n markdown: () => import('shiki/dist/langs/markdown.mjs'),\n yaml: () => import('shiki/dist/langs/yaml.mjs'),\n python: () => import('shiki/dist/langs/python.mjs'),\n java: () => import('shiki/dist/langs/java.mjs'),\n sql: () => import('shiki/dist/langs/sql.mjs'),\n xml: () => import('shiki/dist/langs/xml.mjs'),\n 'angular-ts': () => import('shiki/dist/langs/angular-ts.mjs'),\n 'angular-html': () => import('shiki/dist/langs/angular-html.mjs'),\n },\n themes: {\n 'github-dark': () => import('shiki/dist/themes/github-dark.mjs'),\n 'github-light': () => import('shiki/dist/themes/github-light.mjs'),\n 'vitesse-dark': () => import('shiki/dist/themes/vitesse-dark.mjs'),\n 'one-dark-pro': () => import('shiki/dist/themes/one-dark-pro.mjs'),\n },\n engine: () => import('shiki/engine/javascript').then(m => m.createJavaScriptRegexEngine()),\n});\n\nexport const getHighlighter = (() => {\n let cache: Promise<HighlighterGeneric<BundledLanguage, BundledTheme>> | null = null;\n\n return async (): Promise<HighlighterGeneric<BundledLanguage, BundledTheme>> => {\n if (cache) {\n return cache;\n }\n\n cache = createZCodeHighlighter({\n themes: [...Z_CODE_THEMES],\n langs: [...Z_CODE_LANGS],\n }) as Promise<HighlighterGeneric<BundledLanguage, BundledTheme>>;\n\n return cache;\n };\n})();\n\nexport function escapeHtml(text: string): string {\n const div = document.createElement('div');\n div.textContent = text;\n return div.innerHTML;\n}\n\n/**\n * Marks the requested 1-based line numbers so the stylesheet can band them. Shiki hands each line's\n * node to `line()` along with its number, which is the only reliable way to target a line — the\n * rendered markup carries no index of its own.\n */\nexport function zCodeHighlightLines(lines: readonly number[]): ShikiTransformer {\n const wanted = new Set(lines);\n return {\n name: 'z-code-highlight-lines',\n line(node, line) {\n if (wanted.has(line)) {\n this.addClassToHast(node, 'line-highlighted');\n }\n },\n };\n}\n","import {\n AfterViewInit,\n ChangeDetectionStrategy,\n Component,\n computed,\n effect,\n ElementRef,\n inject,\n input,\n signal,\n viewChild,\n} from '@angular/core';\nimport { DomSanitizer, SafeHtml } from '@angular/platform-browser';\nimport { ZButtonComponent } from '@shival99/z-ui/components/z-button';\nimport { ZIconComponent } from '@shival99/z-ui/components/z-icon';\nimport { ZToastService } from '@shival99/z-ui/components/z-toast';\nimport { ZTranslateService } from '@shival99/z-ui/services';\nimport { zMergeClasses } from '@shival99/z-ui/utils';\nimport type { ClassValue } from 'clsx';\nimport type { BundledLanguage, BundledTheme, CodeOptionsThemes } from 'shiki';\nimport { type ZCodeTheme } from './z-code.types';\nimport { escapeHtml, getHighlighter, zCodeHighlightLines } from './z-code.utils';\n\n@Component({\n selector: 'z-code',\n imports: [ZIconComponent, ZButtonComponent],\n standalone: true,\n templateUrl: './z-code.component.html',\n styleUrl: './z-code.component.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class ZCodeComponent implements AfterViewInit {\n private readonly _toast = inject(ZToastService);\n private readonly _sanitizer = inject(DomSanitizer);\n private readonly _zTranslate = inject(ZTranslateService);\n\n protected readonly codeEl = viewChild<ElementRef<HTMLDivElement>>('codeEl');\n\n public readonly class = input<ClassValue>('');\n public readonly zTitle = input<string>('');\n public readonly zLanguage = input<BundledLanguage>('typescript');\n public readonly zCode = input<string>('');\n public readonly zTheme = input<ZCodeTheme | ''>('');\n public readonly zShowLineNumbers = input<boolean>(true);\n /** 1-based line numbers to band. */\n public readonly zHighlightLines = input<readonly number[]>([]);\n public readonly zScrollable = input<boolean>(false);\n /** Maximum body height in px; only applied when `zScrollable` is set. */\n public readonly zMaxHeight = input<number>(400);\n\n protected readonly copied = signal(false);\n protected readonly highlightedCode = signal<SafeHtml>('');\n protected readonly isHighlighting = signal(true);\n\n private _rawCode = '';\n\n /**\n * With no explicit `zTheme`, both palettes are rendered at once: Shiki emits the light colours\n * inline and the dark ones as `--shiki-dark` custom properties, and the stylesheet swaps between\n * them under `.dark`. Switching theme is then a repaint instead of a fresh asynchronous highlight\n * of every block on the page.\n */\n private readonly _themeOptions = computed<CodeOptionsThemes<BundledTheme>>(() => {\n const theme = this.zTheme();\n if (theme) {\n return { theme };\n }\n\n return { themes: { light: 'github-light', dark: 'github-dark' } };\n });\n\n protected readonly wrapperClasses = computed(() =>\n zMergeClasses('border-border bg-card overflow-hidden rounded-lg border', this.class())\n );\n\n /** Falls back to the language, as the header is always shown and always needs something to name. */\n protected readonly headerLabel = computed(() => this.zTitle() || this.zLanguage());\n\n protected readonly contentClasses = computed(() =>\n zMergeClasses(\n 'overflow-x-auto p-4',\n this.zShowLineNumbers() ? 'z-code-numbered' : '',\n this.zHighlightLines().length > 0 ? 'z-code-banded' : '',\n this.zScrollable() ? 'overflow-y-auto' : ''\n )\n );\n\n protected readonly bodyMaxHeight = computed(() => (this.zScrollable() ? `${this.zMaxHeight()}px` : null));\n\n constructor() {\n effect(() => {\n const code = this.zCode();\n const lang = this.zLanguage();\n const themeOptions = this._themeOptions();\n const highlightLines = this.zHighlightLines();\n\n if (!code) {\n return;\n }\n\n this._rawCode = code;\n void this._highlightCode(code, lang, themeOptions, highlightLines);\n });\n }\n\n ngAfterViewInit(): void {\n if (this.zCode()) {\n return;\n }\n\n const codeEl = this.codeEl()?.nativeElement;\n if (!codeEl) {\n return;\n }\n\n const preEl = codeEl.querySelector('pre');\n const codeContent = preEl?.querySelector('code');\n const rawText = codeContent?.textContent ?? preEl?.textContent ?? codeEl.textContent ?? '';\n\n if (!rawText.trim()) {\n return;\n }\n\n this._rawCode = rawText.trim();\n void this._highlightCode(this._rawCode, this.zLanguage(), this._themeOptions(), this.zHighlightLines());\n }\n\n private async _highlightCode(\n code: string,\n lang: BundledLanguage,\n themeOptions: CodeOptionsThemes<BundledTheme>,\n highlightLines: readonly number[]\n ): Promise<void> {\n this.isHighlighting.set(true);\n try {\n const highlighter = await getHighlighter();\n const html = highlighter.codeToHtml(code, {\n lang,\n transformers: highlightLines.length > 0 ? [zCodeHighlightLines(highlightLines)] : [],\n ...themeOptions,\n });\n const safeHtml = this._sanitizer.bypassSecurityTrustHtml(html);\n this.highlightedCode.set(safeHtml);\n } catch (error) {\n console.warn('Shiki highlighting failed, falling back to plain text:', error);\n const escapedHtml = `<pre class=\"shiki\"><code>${escapeHtml(code)}</code></pre>`;\n this.highlightedCode.set(this._sanitizer.bypassSecurityTrustHtml(escapedHtml));\n } finally {\n this.isHighlighting.set(false);\n }\n }\n\n protected copyCode(): void {\n const code = this._rawCode.trim();\n\n void navigator.clipboard.writeText(code).then(() => {\n this.copied.set(true);\n this._toast.success(this._zTranslate.instant('i18n_z_ui_code_copied'));\n setTimeout(() => {\n this.copied.set(false);\n }, 2000);\n });\n }\n}\n","<div [class]=\"wrapperClasses()\">\n <!-- Always rendered: without it a title-less block floated its copy button in a strip of empty\n padding, with nothing to anchor the button or separate it from the code. -->\n <div class=\"z-code-header border-border bg-muted/50 flex items-center justify-between gap-2 border-b px-4 py-2\">\n <div class=\"text-muted-foreground flex min-w-0 items-center gap-2\">\n <z-icon zType=\"lucideFileCode\" zSize=\"14\" class=\"shrink-0\" />\n <span class=\"truncate font-mono text-xs\">{{ headerLabel() }}</span>\n </div>\n <button\n z-button\n zType=\"ghost\"\n zSize=\"xs\"\n zIconOnly=\"true\"\n [zWave]=\"false\"\n class=\"shrink-0\"\n [attr.aria-label]=\"copied() ? 'Copied' : 'Copy code'\"\n (click)=\"copyCode()\">\n @if (copied()) {\n <z-icon zType=\"lucideCheck\" zSize=\"14\" class=\"text-green-500\" />\n } @else {\n <z-icon zType=\"lucideCopy\" zSize=\"14\" />\n }\n </button>\n </div>\n <div class=\"relative\">\n @if (isHighlighting()) {\n <div class=\"p-4\">\n <div class=\"bg-muted h-4 w-3/4 animate-pulse rounded-sm\"></div>\n <div class=\"bg-muted mt-2 h-4 w-1/2 animate-pulse rounded-sm\"></div>\n <div class=\"bg-muted mt-2 h-4 w-2/3 animate-pulse rounded-sm\"></div>\n </div>\n } @else {\n <div\n #codeEl\n [class]=\"contentClasses()\"\n [style.max-height]=\"bodyMaxHeight()\"\n [innerHTML]=\"highlightedCode()\"></div>\n }\n </div>\n</div>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;AAGA,MAAM,YAAY,GAAG;IACnB,YAAY;IACZ,YAAY;IACZ,MAAM;IACN,KAAK;IACL,MAAM;IACN,MAAM;IACN,MAAM;IACN,OAAO;IACP,UAAU;IACV,MAAM;IACN,QAAQ;IACR,MAAM;IACN,KAAK;IACL,KAAK;IACL,YAAY;IACZ,cAAc;CACN;AAEV,MAAM,aAAa,GAAG,CAAC,aAAa,EAAE,cAAc,EAAE,cAAc,EAAE,cAAc,CAAU;AAE9F,MAAM,sBAAsB,GAAG,wBAAwB,CAAC;AACtD,IAAA,KAAK,EAAE;AACL,QAAA,UAAU,EAAE,MAAM,OAAO,iCAAiC,CAAC;AAC3D,QAAA,UAAU,EAAE,MAAM,OAAO,iCAAiC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A,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,KAAA,EAAA,kBAAA,EAAA,QAAA,EAAA,KAAA,EAAA,CAAA,EAAA,CAAA,EAAA,eAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,KAAA,EAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,QAAA,EAAA,KAAA,EAAA,CAAA,EAAA,CAAA,EAAA,WAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,KAAA,EAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,KAAA,EAAA,aAAA,EAAA,QAAA,EAAA,KAAA,EAAA,CAAA,EAAA,CAAA,EAAA,UAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,KAAA,EAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,KAAA,EAAA,YAAA,EAAA,QAAA,EAAA,KAAA,EAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;AEpC5E;;AAEG;;"}
1
+ {"version":3,"file":"shival99-z-ui-components-z-code.mjs","sources":["../../../../libs/core-ui/components/z-code/z-code.utils.ts","../../../../libs/core-ui/components/z-code/z-code.component.ts","../../../../libs/core-ui/components/z-code/z-code.component.html","../../../../libs/core-ui/components/z-code/shival99-z-ui-components-z-code.ts"],"sourcesContent":["import type { BundledLanguage, BundledTheme, HighlighterGeneric, ShikiTransformer } from 'shiki';\nimport { createBundledHighlighter } from 'shiki/core';\n\nconst Z_CODE_LANGS = [\n 'typescript',\n 'javascript',\n 'html',\n 'css',\n 'scss',\n 'json',\n 'bash',\n 'shell',\n 'markdown',\n 'yaml',\n 'python',\n 'java',\n 'sql',\n 'xml',\n 'angular-ts',\n 'angular-html',\n] as const;\n\nconst Z_CODE_THEMES = ['github-dark', 'github-light', 'vitesse-dark', 'one-dark-pro'] as const;\n\nconst createZCodeHighlighter = createBundledHighlighter({\n langs: {\n typescript: () => import('shiki/dist/langs/typescript.mjs'),\n javascript: () => import('shiki/dist/langs/javascript.mjs'),\n html: () => import('shiki/dist/langs/html.mjs'),\n css: () => import('shiki/dist/langs/css.mjs'),\n scss: () => import('shiki/dist/langs/scss.mjs'),\n json: () => import('shiki/dist/langs/json.mjs'),\n bash: () => import('shiki/dist/langs/bash.mjs'),\n shell: () => import('shiki/dist/langs/shell.mjs'),\n markdown: () => import('shiki/dist/langs/markdown.mjs'),\n yaml: () => import('shiki/dist/langs/yaml.mjs'),\n python: () => import('shiki/dist/langs/python.mjs'),\n java: () => import('shiki/dist/langs/java.mjs'),\n sql: () => import('shiki/dist/langs/sql.mjs'),\n xml: () => import('shiki/dist/langs/xml.mjs'),\n 'angular-ts': () => import('shiki/dist/langs/angular-ts.mjs'),\n 'angular-html': () => import('shiki/dist/langs/angular-html.mjs'),\n },\n themes: {\n 'github-dark': () => import('shiki/dist/themes/github-dark.mjs'),\n 'github-light': () => import('shiki/dist/themes/github-light.mjs'),\n 'vitesse-dark': () => import('shiki/dist/themes/vitesse-dark.mjs'),\n 'one-dark-pro': () => import('shiki/dist/themes/one-dark-pro.mjs'),\n },\n engine: () => import('shiki/engine/javascript').then(m => m.createJavaScriptRegexEngine()),\n});\n\nexport const getHighlighter = (() => {\n let cache: Promise<HighlighterGeneric<BundledLanguage, BundledTheme>> | null = null;\n\n return async (): Promise<HighlighterGeneric<BundledLanguage, BundledTheme>> => {\n if (cache) {\n return cache;\n }\n\n cache = createZCodeHighlighter({\n themes: [...Z_CODE_THEMES],\n langs: [...Z_CODE_LANGS],\n }) as Promise<HighlighterGeneric<BundledLanguage, BundledTheme>>;\n\n return cache;\n };\n})();\n\nexport function escapeHtml(text: string): string {\n const div = document.createElement('div');\n div.textContent = text;\n return div.innerHTML;\n}\n\n/**\n * Marks the requested 1-based line numbers so the stylesheet can band them. Shiki hands each line's\n * node to `line()` along with its number, which is the only reliable way to target a line — the\n * rendered markup carries no index of its own.\n */\nexport function zCodeHighlightLines(lines: readonly number[]): ShikiTransformer {\n const wanted = new Set(lines);\n return {\n name: 'z-code-highlight-lines',\n line(node, line) {\n if (wanted.has(line)) {\n this.addClassToHast(node, 'line-highlighted');\n }\n },\n };\n}\n","import {\n AfterViewInit,\n ChangeDetectionStrategy,\n Component,\n computed,\n effect,\n ElementRef,\n inject,\n input,\n signal,\n viewChild,\n} from '@angular/core';\nimport { DomSanitizer, SafeHtml } from '@angular/platform-browser';\nimport { ZButtonComponent } from '@shival99/z-ui/components/z-button';\nimport { ZIconComponent } from '@shival99/z-ui/components/z-icon';\nimport { ZSkeletonComponent } from '@shival99/z-ui/components/z-skeleton';\nimport { ZToastService } from '@shival99/z-ui/components/z-toast';\nimport { ZTranslateService } from '@shival99/z-ui/services';\nimport { zMergeClasses } from '@shival99/z-ui/utils';\nimport type { ClassValue } from 'clsx';\nimport type { BundledLanguage, BundledTheme, CodeOptionsThemes } from 'shiki';\nimport { type ZCodeTheme } from './z-code.types';\nimport { escapeHtml, getHighlighter, zCodeHighlightLines } from './z-code.utils';\n\n@Component({\n selector: 'z-code',\n imports: [ZIconComponent, ZButtonComponent, ZSkeletonComponent],\n standalone: true,\n templateUrl: './z-code.component.html',\n styleUrl: './z-code.component.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class ZCodeComponent implements AfterViewInit {\n private readonly _toast = inject(ZToastService);\n private readonly _sanitizer = inject(DomSanitizer);\n private readonly _zTranslate = inject(ZTranslateService);\n\n protected readonly codeEl = viewChild<ElementRef<HTMLDivElement>>('codeEl');\n\n public readonly class = input<ClassValue>('');\n public readonly zTitle = input<string>('');\n public readonly zLanguage = input<BundledLanguage>('typescript');\n public readonly zCode = input<string>('');\n public readonly zTheme = input<ZCodeTheme | ''>('');\n public readonly zShowLineNumbers = input<boolean>(true);\n /** 1-based line numbers to band. */\n public readonly zHighlightLines = input<readonly number[]>([]);\n public readonly zScrollable = input<boolean>(false);\n /** Maximum body height in px or a CSS length; only applied when `zScrollable` is set. */\n public readonly zMaxHeight = input<number | string>(400);\n\n protected readonly copied = signal(false);\n protected readonly highlightedCode = signal<SafeHtml>('');\n protected readonly isHighlighting = signal(true);\n\n private _rawCode = '';\n\n /**\n * With no explicit `zTheme`, both palettes are rendered at once: Shiki emits the light colours\n * inline and the dark ones as `--shiki-dark` custom properties, and the stylesheet swaps between\n * them under `.dark`. Switching theme is then a repaint instead of a fresh asynchronous highlight\n * of every block on the page.\n */\n private readonly _themeOptions = computed<CodeOptionsThemes<BundledTheme>>(() => {\n const theme = this.zTheme();\n if (theme) {\n return { theme };\n }\n\n return { themes: { light: 'github-light', dark: 'github-dark' } };\n });\n\n protected readonly wrapperClasses = computed(() =>\n zMergeClasses('border-border bg-card overflow-hidden rounded-lg border', this.class())\n );\n\n /** Falls back to the language, as the header is always shown and always needs something to name. */\n protected readonly headerLabel = computed(() => this.zTitle() || this.zLanguage());\n\n protected readonly contentClasses = computed(() =>\n zMergeClasses(\n 'overflow-x-auto p-4',\n this.zShowLineNumbers() ? 'z-code-numbered' : '',\n this.zHighlightLines().length > 0 ? 'z-code-banded' : '',\n this.zScrollable() ? 'overflow-y-auto' : ''\n )\n );\n\n protected readonly bodyMaxHeight = computed(() => {\n if (!this.zScrollable()) {\n return null;\n }\n\n const maxHeight = this.zMaxHeight();\n return typeof maxHeight === 'number' ? `${maxHeight}px` : maxHeight;\n });\n\n constructor() {\n effect(() => {\n const code = this.zCode();\n const lang = this.zLanguage();\n const themeOptions = this._themeOptions();\n const highlightLines = this.zHighlightLines();\n\n if (!code) {\n return;\n }\n\n this._rawCode = code;\n void this._highlightCode(code, lang, themeOptions, highlightLines);\n });\n }\n\n ngAfterViewInit(): void {\n if (this.zCode()) {\n return;\n }\n\n const codeEl = this.codeEl()?.nativeElement;\n if (!codeEl) {\n return;\n }\n\n const preEl = codeEl.querySelector('pre');\n const codeContent = preEl?.querySelector('code');\n const rawText = codeContent?.textContent ?? preEl?.textContent ?? codeEl.textContent ?? '';\n\n if (!rawText.trim()) {\n return;\n }\n\n this._rawCode = rawText.trim();\n void this._highlightCode(this._rawCode, this.zLanguage(), this._themeOptions(), this.zHighlightLines());\n }\n\n private async _highlightCode(\n code: string,\n lang: BundledLanguage,\n themeOptions: CodeOptionsThemes<BundledTheme>,\n highlightLines: readonly number[]\n ): Promise<void> {\n this.isHighlighting.set(true);\n try {\n const highlighter = await getHighlighter();\n const html = highlighter.codeToHtml(code, {\n lang,\n transformers: highlightLines.length > 0 ? [zCodeHighlightLines(highlightLines)] : [],\n ...themeOptions,\n });\n const safeHtml = this._sanitizer.bypassSecurityTrustHtml(html);\n this.highlightedCode.set(safeHtml);\n } catch (error) {\n console.warn('Shiki highlighting failed, falling back to plain text:', error);\n const escapedHtml = `<pre class=\"shiki\"><code>${escapeHtml(code)}</code></pre>`;\n this.highlightedCode.set(this._sanitizer.bypassSecurityTrustHtml(escapedHtml));\n } finally {\n this.isHighlighting.set(false);\n }\n }\n\n protected copyCode(): void {\n const code = this._rawCode.trim();\n\n void navigator.clipboard.writeText(code).then(() => {\n this.copied.set(true);\n this._toast.success(this._zTranslate.instant('i18n_z_ui_code_copied'));\n setTimeout(() => {\n this.copied.set(false);\n }, 2000);\n });\n }\n}\n","<div [class]=\"wrapperClasses()\">\n <!-- Always rendered: without it a title-less block floated its copy button in a strip of empty\n padding, with nothing to anchor the button or separate it from the code. -->\n <div class=\"z-code-header border-border bg-muted/50 flex items-center justify-between gap-2 border-b px-4 py-2\">\n <div class=\"text-muted-foreground flex min-w-0 items-center gap-2\">\n <z-icon zType=\"lucideFileCode\" zSize=\"14\" class=\"shrink-0\" />\n <span class=\"truncate font-mono text-xs\">{{ headerLabel() }}</span>\n </div>\n <button\n z-button\n zType=\"ghost\"\n zSize=\"xs\"\n zIconOnly=\"true\"\n [zWave]=\"false\"\n class=\"shrink-0\"\n [attr.aria-label]=\"copied() ? 'Copied' : 'Copy code'\"\n (click)=\"copyCode()\">\n @if (copied()) {\n <z-icon zType=\"lucideCheck\" zSize=\"14\" class=\"text-green-500\" />\n } @else {\n <z-icon zType=\"lucideCopy\" zSize=\"14\" />\n }\n </button>\n </div>\n <div class=\"relative min-h-0\" [class.flex-1]=\"zScrollable()\">\n @if (isHighlighting()) {\n @if (zScrollable()) {\n <div class=\"flex h-full flex-col p-4\">\n <z-skeleton class=\"h-full\" [zRows]=\"10\" />\n </div>\n } @else {\n <div class=\"p-4\">\n <z-skeleton zType=\"text\" [zRows]=\"3\" zHeight=\"1rem\" />\n </div>\n }\n } @else {\n <div\n #codeEl\n [class]=\"contentClasses()\"\n [style.max-height]=\"bodyMaxHeight()\"\n [innerHTML]=\"highlightedCode()\"></div>\n }\n </div>\n</div>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;AAGA,MAAM,YAAY,GAAG;IACnB,YAAY;IACZ,YAAY;IACZ,MAAM;IACN,KAAK;IACL,MAAM;IACN,MAAM;IACN,MAAM;IACN,OAAO;IACP,UAAU;IACV,MAAM;IACN,QAAQ;IACR,MAAM;IACN,KAAK;IACL,KAAK;IACL,YAAY;IACZ,cAAc;CACN;AAEV,MAAM,aAAa,GAAG,CAAC,aAAa,EAAE,cAAc,EAAE,cAAc,EAAE,cAAc,CAAU;AAE9F,MAAM,sBAAsB,GAAG,wBAAwB,CAAC;AACtD,IAAA,KAAK,EAAE;AACL,QAAA,UAAU,EAAE,MAAM,OAAO,iCAAiC,CAAC;AAC3D,QAAA,UAAU,EAAE,MAAM,OAAO,iCAAiC,CAAC;AAC3D,QAAA,IAAI,EAAE,MAAM,OAAO,2BAA2B,CAAC;AAC/C,QAAA,GAAG,EAAE,MAAM,OAAO,0BAA0B,CAAC;AAC7C,QAAA,IAAI,EAAE,MAAM,OAAO,2BAA2B,CAAC;AAC/C,QAAA,IAAI,EAAE,MAAM,OAAO,2BAA2B,CAAC;AAC/C,QAAA,IAAI,EAAE,MAAM,OAAO,2BAA2B,CAAC;AAC/C,QAAA,KAAK,EAAE,MAA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,KAAA,EAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,KAAA,EAAA,aAAA,EAAA,QAAA,EAAA,KAAA,EAAA,CAAA,EAAA,CAAA,EAAA,UAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,KAAA,EAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,KAAA,EAAA,YAAA,EAAA,QAAA,EAAA,KAAA,EAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;AErC5E;;AAEG;;"}
@@ -201,11 +201,11 @@ class ZDrawerComponent {
201
201
  ...(ngDevMode ? [{ debugName: "zClosable" }] : /* istanbul ignore next */ []));
202
202
  zMaskClosable = input(true, /* @ts-ignore */
203
203
  ...(ngDevMode ? [{ debugName: "zMaskClosable" }] : /* istanbul ignore next */ []));
204
- zDisableShadow = input(false, /* @ts-ignore */
204
+ zDisableShadow = input(true, /* @ts-ignore */
205
205
  ...(ngDevMode ? [{ debugName: "zDisableShadow" }] : /* istanbul ignore next */ []));
206
- zHeaderBorder = input(false, /* @ts-ignore */
206
+ zHeaderBorder = input(true, /* @ts-ignore */
207
207
  ...(ngDevMode ? [{ debugName: "zHeaderBorder" }] : /* istanbul ignore next */ []));
208
- zFooterBorder = input(false, /* @ts-ignore */
208
+ zFooterBorder = input(true, /* @ts-ignore */
209
209
  ...(ngDevMode ? [{ debugName: "zFooterBorder" }] : /* istanbul ignore next */ []));
210
210
  zHideFooter = input(false, /* @ts-ignore */
211
211
  ...(ngDevMode ? [{ debugName: "zHideFooter" }] : /* istanbul ignore next */ []));
@@ -351,13 +351,13 @@ class ZDrawerComponent {
351
351
  ...(ngDevMode ? [{ debugName: "bodyClasses" }] : /* istanbul ignore next */ []));
352
352
  effectiveClosable = computed(() => this.isServiceMode() ? (this.config.zClosable ?? true) : this.zClosable(), /* @ts-ignore */
353
353
  ...(ngDevMode ? [{ debugName: "effectiveClosable" }] : /* istanbul ignore next */ []));
354
- effectiveDisableShadow = computed(() => this.isServiceMode() ? (this.config.zDisableShadow ?? false) : this.zDisableShadow(), /* @ts-ignore */
354
+ effectiveDisableShadow = computed(() => this.isServiceMode() ? (this.config.zDisableShadow ?? true) : this.zDisableShadow(), /* @ts-ignore */
355
355
  ...(ngDevMode ? [{ debugName: "effectiveDisableShadow" }] : /* istanbul ignore next */ []));
356
356
  shouldShowShadow = computed(() => !this.effectiveDisableShadow(), /* @ts-ignore */
357
357
  ...(ngDevMode ? [{ debugName: "shouldShowShadow" }] : /* istanbul ignore next */ []));
358
- effectiveHeaderBorder = computed(() => this.isServiceMode() ? (this.config.zHeaderBorder ?? false) : this.zHeaderBorder(), /* @ts-ignore */
358
+ effectiveHeaderBorder = computed(() => this.isServiceMode() ? (this.config.zHeaderBorder ?? true) : this.zHeaderBorder(), /* @ts-ignore */
359
359
  ...(ngDevMode ? [{ debugName: "effectiveHeaderBorder" }] : /* istanbul ignore next */ []));
360
- effectiveFooterBorder = computed(() => this.isServiceMode() ? (this.config.zFooterBorder ?? false) : this.zFooterBorder(), /* @ts-ignore */
360
+ effectiveFooterBorder = computed(() => this.isServiceMode() ? (this.config.zFooterBorder ?? true) : this.zFooterBorder(), /* @ts-ignore */
361
361
  ...(ngDevMode ? [{ debugName: "effectiveFooterBorder" }] : /* istanbul ignore next */ []));
362
362
  effectiveHideFooter = computed(() => this.isServiceMode() ? this.config.zHideFooter : this.zHideFooter(), /* @ts-ignore */
363
363
  ...(ngDevMode ? [{ debugName: "effectiveHideFooter" }] : /* istanbul ignore next */ []));