@shival99/z-ui 1.8.13 → 1.9.1
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/assets/css/tailwind.css +7 -11
- package/fesm2022/shival99-z-ui-components-z-autocomplete.mjs +45 -71
- package/fesm2022/shival99-z-ui-components-z-autocomplete.mjs.map +1 -1
- package/fesm2022/shival99-z-ui-components-z-button.mjs +21 -11
- package/fesm2022/shival99-z-ui-components-z-button.mjs.map +1 -1
- package/fesm2022/shival99-z-ui-components-z-calendar.mjs +61 -32
- package/fesm2022/shival99-z-ui-components-z-calendar.mjs.map +1 -1
- package/fesm2022/shival99-z-ui-components-z-card.mjs +1 -1
- package/fesm2022/shival99-z-ui-components-z-card.mjs.map +1 -1
- package/fesm2022/shival99-z-ui-components-z-chat.mjs +429 -0
- package/fesm2022/shival99-z-ui-components-z-chat.mjs.map +1 -0
- package/fesm2022/shival99-z-ui-components-z-checkbox.mjs +1 -1
- package/fesm2022/shival99-z-ui-components-z-checkbox.mjs.map +1 -1
- package/fesm2022/shival99-z-ui-components-z-code.mjs +51 -21
- package/fesm2022/shival99-z-ui-components-z-code.mjs.map +1 -1
- package/fesm2022/shival99-z-ui-components-z-drawer.mjs +8 -3
- package/fesm2022/shival99-z-ui-components-z-drawer.mjs.map +1 -1
- package/fesm2022/shival99-z-ui-components-z-editor.mjs +3 -3
- package/fesm2022/shival99-z-ui-components-z-editor.mjs.map +1 -1
- package/fesm2022/shival99-z-ui-components-z-empty.mjs.map +1 -1
- package/fesm2022/shival99-z-ui-components-z-filter.mjs +3 -3
- package/fesm2022/shival99-z-ui-components-z-filter.mjs.map +1 -1
- package/fesm2022/shival99-z-ui-components-z-gallery.mjs +169 -90
- package/fesm2022/shival99-z-ui-components-z-gallery.mjs.map +1 -1
- package/fesm2022/shival99-z-ui-components-z-icon.mjs +143 -360
- package/fesm2022/shival99-z-ui-components-z-icon.mjs.map +1 -1
- package/fesm2022/shival99-z-ui-components-z-input.mjs +131 -8
- package/fesm2022/shival99-z-ui-components-z-input.mjs.map +1 -1
- package/fesm2022/shival99-z-ui-components-z-loading.mjs +2 -2
- package/fesm2022/shival99-z-ui-components-z-loading.mjs.map +1 -1
- package/fesm2022/shival99-z-ui-components-z-menu.mjs +2 -2
- package/fesm2022/shival99-z-ui-components-z-menu.mjs.map +1 -1
- package/fesm2022/shival99-z-ui-components-z-modal.mjs +8 -3
- package/fesm2022/shival99-z-ui-components-z-modal.mjs.map +1 -1
- package/fesm2022/shival99-z-ui-components-z-pagination.mjs +1 -1
- package/fesm2022/shival99-z-ui-components-z-pagination.mjs.map +1 -1
- package/fesm2022/shival99-z-ui-components-z-popover.mjs +3 -3
- package/fesm2022/shival99-z-ui-components-z-popover.mjs.map +1 -1
- package/fesm2022/shival99-z-ui-components-z-select.mjs +31 -7
- package/fesm2022/shival99-z-ui-components-z-select.mjs.map +1 -1
- package/fesm2022/shival99-z-ui-components-z-skeleton.mjs +3 -3
- package/fesm2022/shival99-z-ui-components-z-skeleton.mjs.map +1 -1
- package/fesm2022/shival99-z-ui-components-z-steps.mjs +31 -29
- package/fesm2022/shival99-z-ui-components-z-steps.mjs.map +1 -1
- package/fesm2022/shival99-z-ui-components-z-switch.mjs +131 -15
- package/fesm2022/shival99-z-ui-components-z-switch.mjs.map +1 -1
- package/fesm2022/shival99-z-ui-components-z-table.mjs +57 -13
- package/fesm2022/shival99-z-ui-components-z-table.mjs.map +1 -1
- package/fesm2022/shival99-z-ui-components-z-tabs.mjs +6 -6
- package/fesm2022/shival99-z-ui-components-z-tabs.mjs.map +1 -1
- package/fesm2022/shival99-z-ui-components-z-tags.mjs +1 -1
- package/fesm2022/shival99-z-ui-components-z-tags.mjs.map +1 -1
- package/fesm2022/shival99-z-ui-components-z-timeline.mjs +6 -6
- package/fesm2022/shival99-z-ui-components-z-timeline.mjs.map +1 -1
- package/fesm2022/shival99-z-ui-components-z-tooltip.mjs +4 -4
- package/fesm2022/shival99-z-ui-components-z-tooltip.mjs.map +1 -1
- package/fesm2022/shival99-z-ui-components-z-upload.mjs +5 -4
- package/fesm2022/shival99-z-ui-components-z-upload.mjs.map +1 -1
- package/fesm2022/shival99-z-ui-i18n.mjs +12 -0
- package/fesm2022/shival99-z-ui-i18n.mjs.map +1 -1
- package/fesm2022/shival99-z-ui-pipes.mjs +18 -0
- package/fesm2022/shival99-z-ui-pipes.mjs.map +1 -1
- package/fesm2022/shival99-z-ui-providers.mjs +30 -13
- package/fesm2022/shival99-z-ui-providers.mjs.map +1 -1
- package/fesm2022/shival99-z-ui-services.mjs +53 -29
- package/fesm2022/shival99-z-ui-services.mjs.map +1 -1
- package/fesm2022/z-ui.mjs +0 -4
- package/fesm2022/z-ui.mjs.map +1 -1
- package/package.json +6 -1
- package/types/shival99-z-ui-components-z-autocomplete.d.ts +25 -38
- package/types/shival99-z-ui-components-z-breadcrumb.d.ts +4 -4
- package/types/shival99-z-ui-components-z-button.d.ts +5 -4
- package/types/shival99-z-ui-components-z-chat.d.ts +148 -0
- package/types/shival99-z-ui-components-z-drawer.d.ts +3 -1
- package/types/shival99-z-ui-components-z-dropdown-menu.d.ts +2 -2
- package/types/shival99-z-ui-components-z-empty.d.ts +3 -3
- package/types/shival99-z-ui-components-z-filter.d.ts +2 -2
- package/types/shival99-z-ui-components-z-gallery.d.ts +6 -3
- package/types/shival99-z-ui-components-z-icon.d.ts +18 -304
- package/types/shival99-z-ui-components-z-input.d.ts +42 -1
- package/types/shival99-z-ui-components-z-modal.d.ts +4 -2
- package/types/shival99-z-ui-components-z-select.d.ts +5 -2
- package/types/shival99-z-ui-components-z-steps.d.ts +4 -4
- package/types/shival99-z-ui-components-z-switch.d.ts +25 -4
- package/types/shival99-z-ui-components-z-table.d.ts +2 -0
- package/types/shival99-z-ui-pipes.d.ts +2 -0
- package/types/shival99-z-ui-providers.d.ts +10 -16
- package/types/shival99-z-ui-services.d.ts +6 -1
- package/types/z-ui.d.ts +1 -2
|
@@ -86,7 +86,7 @@ class ZSkeletonComponent {
|
|
|
86
86
|
rowsArray = computed(() => {
|
|
87
87
|
const type = this.zType();
|
|
88
88
|
if (type !== 'bar' && type !== 'text') {
|
|
89
|
-
return [{ index: 0, height: '
|
|
89
|
+
return [{ index: 0, height: '0rem' }];
|
|
90
90
|
}
|
|
91
91
|
const rowCount = this.zRows() || this._calculatedRows();
|
|
92
92
|
const gapBetweenRows = this.zGap();
|
|
@@ -123,7 +123,7 @@ class ZSkeletonComponent {
|
|
|
123
123
|
this._calculatedRows.set(1);
|
|
124
124
|
}
|
|
125
125
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: ZSkeletonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
126
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.6", type: ZSkeletonComponent, isStandalone: true, selector: "z-skeleton", inputs: { class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null }, zType: { classPropertyName: "zType", publicName: "zType", isSignal: true, isRequired: false, transformFunction: null }, zSize: { classPropertyName: "zSize", publicName: "zSize", isSignal: true, isRequired: false, transformFunction: null }, zWidth: { classPropertyName: "zWidth", publicName: "zWidth", isSignal: true, isRequired: false, transformFunction: null }, zHeight: { classPropertyName: "zHeight", publicName: "zHeight", isSignal: true, isRequired: false, transformFunction: null }, zRows: { classPropertyName: "zRows", publicName: "zRows", isSignal: true, isRequired: false, transformFunction: null }, zGap: { classPropertyName: "zGap", publicName: "zGap", isSignal: true, isRequired: false, transformFunction: null }, zAnimated: { classPropertyName: "zAnimated", publicName: "zAnimated", isSignal: true, isRequired: false, transformFunction: null }, zRadius: { classPropertyName: "zRadius", publicName: "zRadius", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "style.width": "zWidth()", "style.height": "zHeight()" }, classAttribute: "z-skeleton-host" }, ngImport: i0, template: "<div class=\"z-skeleton-container\" [class]=\"containerClass()\">\n @if (zType() === 'circle') {\n <div [class]=\"skeletonClasses()\" [style]=\"circleStyles()\"></div>\n } @else if (zType() === 'bar' || zType() === 'text') {\n @if (shouldShowMultipleRows()) {\n @for (row of rowsArray(); track row.index) {\n <div\n class=\"z-skeleton-row\"\n [class]=\"skeletonClasses()\"\n [style.margin-bottom.px]=\"row.index === rowsArray().length - 1 ? 0 : zGap()\"\n [style.height]=\"row.height\"\n [style.width]=\"zWidth()\"\n [style.border-radius]=\"zRadius()\"></div>\n }\n } @else {\n <div\n [class]=\"skeletonClasses()\"\n [style.width]=\"zWidth()\"\n [style.height]=\"zHeight() || '100%'\"\n [style.border-radius]=\"zRadius()\"></div>\n }\n }\n</div>\n", styles: [".z-skeleton-container{display:block;width:100%;height:100%}.z-skeleton{background-color:#e0e0e0;position:relative;overflow:hidden}:host-context(.dark) .z-skeleton{background-color:#374151}.z-skeleton-bar,.z-skeleton-text{width:100%;height:100%}.z-skeleton-row{width:100%}.z-skeleton-circle{border-radius:50%;aspect-ratio:1/1}.z-skeleton-circle-sm{width:
|
|
126
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.6", type: ZSkeletonComponent, isStandalone: true, selector: "z-skeleton", inputs: { class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null }, zType: { classPropertyName: "zType", publicName: "zType", isSignal: true, isRequired: false, transformFunction: null }, zSize: { classPropertyName: "zSize", publicName: "zSize", isSignal: true, isRequired: false, transformFunction: null }, zWidth: { classPropertyName: "zWidth", publicName: "zWidth", isSignal: true, isRequired: false, transformFunction: null }, zHeight: { classPropertyName: "zHeight", publicName: "zHeight", isSignal: true, isRequired: false, transformFunction: null }, zRows: { classPropertyName: "zRows", publicName: "zRows", isSignal: true, isRequired: false, transformFunction: null }, zGap: { classPropertyName: "zGap", publicName: "zGap", isSignal: true, isRequired: false, transformFunction: null }, zAnimated: { classPropertyName: "zAnimated", publicName: "zAnimated", isSignal: true, isRequired: false, transformFunction: null }, zRadius: { classPropertyName: "zRadius", publicName: "zRadius", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "style.width": "zWidth()", "style.height": "zHeight()" }, classAttribute: "z-skeleton-host" }, ngImport: i0, template: "<div class=\"z-skeleton-container\" [class]=\"containerClass()\">\n @if (zType() === 'circle') {\n <div [class]=\"skeletonClasses()\" [style]=\"circleStyles()\"></div>\n } @else if (zType() === 'bar' || zType() === 'text') {\n @if (shouldShowMultipleRows()) {\n @for (row of rowsArray(); track row.index) {\n <div\n class=\"z-skeleton-row\"\n [class]=\"skeletonClasses()\"\n [style.margin-bottom.px]=\"row.index === rowsArray().length - 1 ? 0 : zGap()\"\n [style.height]=\"row.height\"\n [style.width]=\"zWidth()\"\n [style.border-radius]=\"zRadius()\"></div>\n }\n } @else {\n <div\n [class]=\"skeletonClasses()\"\n [style.width]=\"zWidth()\"\n [style.height]=\"zHeight() || '100%'\"\n [style.border-radius]=\"zRadius()\"></div>\n }\n }\n</div>\n", styles: [".z-skeleton-container{display:block;width:100%;height:100%}.z-skeleton{background-color:#e0e0e0;position:relative;overflow:hidden}:host-context(.dark) .z-skeleton{background-color:#374151}.z-skeleton-bar,.z-skeleton-text{width:100%;height:100%}.z-skeleton-row{width:100%}.z-skeleton-circle{border-radius:50%;aspect-ratio:1/1}.z-skeleton-circle-sm{width:2rem;height:2rem}.z-skeleton-circle-default{width:3rem;height:3rem}.z-skeleton-circle-lg{width:4rem;height:4rem}.z-skeleton-text{height:1rem;border-radius:.25rem}.z-skeleton-animated:after{content:\"\";position:absolute;inset:0;background:linear-gradient(90deg,transparent 0%,rgba(255,255,255,.4) 50%,transparent 100%);animation:z-skeleton-shimmer 1.5s infinite}@keyframes z-skeleton-shimmer{0%{transform:translate(-100%)}to{transform:translate(100%)}}:host{display:block;width:100%;height:100%}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
127
127
|
}
|
|
128
128
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: ZSkeletonComponent, decorators: [{
|
|
129
129
|
type: Component,
|
|
@@ -131,7 +131,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImpor
|
|
|
131
131
|
class: 'z-skeleton-host',
|
|
132
132
|
'[style.width]': 'zWidth()',
|
|
133
133
|
'[style.height]': 'zHeight()',
|
|
134
|
-
}, template: "<div class=\"z-skeleton-container\" [class]=\"containerClass()\">\n @if (zType() === 'circle') {\n <div [class]=\"skeletonClasses()\" [style]=\"circleStyles()\"></div>\n } @else if (zType() === 'bar' || zType() === 'text') {\n @if (shouldShowMultipleRows()) {\n @for (row of rowsArray(); track row.index) {\n <div\n class=\"z-skeleton-row\"\n [class]=\"skeletonClasses()\"\n [style.margin-bottom.px]=\"row.index === rowsArray().length - 1 ? 0 : zGap()\"\n [style.height]=\"row.height\"\n [style.width]=\"zWidth()\"\n [style.border-radius]=\"zRadius()\"></div>\n }\n } @else {\n <div\n [class]=\"skeletonClasses()\"\n [style.width]=\"zWidth()\"\n [style.height]=\"zHeight() || '100%'\"\n [style.border-radius]=\"zRadius()\"></div>\n }\n }\n</div>\n", styles: [".z-skeleton-container{display:block;width:100%;height:100%}.z-skeleton{background-color:#e0e0e0;position:relative;overflow:hidden}:host-context(.dark) .z-skeleton{background-color:#374151}.z-skeleton-bar,.z-skeleton-text{width:100%;height:100%}.z-skeleton-row{width:100%}.z-skeleton-circle{border-radius:50%;aspect-ratio:1/1}.z-skeleton-circle-sm{width:
|
|
134
|
+
}, template: "<div class=\"z-skeleton-container\" [class]=\"containerClass()\">\n @if (zType() === 'circle') {\n <div [class]=\"skeletonClasses()\" [style]=\"circleStyles()\"></div>\n } @else if (zType() === 'bar' || zType() === 'text') {\n @if (shouldShowMultipleRows()) {\n @for (row of rowsArray(); track row.index) {\n <div\n class=\"z-skeleton-row\"\n [class]=\"skeletonClasses()\"\n [style.margin-bottom.px]=\"row.index === rowsArray().length - 1 ? 0 : zGap()\"\n [style.height]=\"row.height\"\n [style.width]=\"zWidth()\"\n [style.border-radius]=\"zRadius()\"></div>\n }\n } @else {\n <div\n [class]=\"skeletonClasses()\"\n [style.width]=\"zWidth()\"\n [style.height]=\"zHeight() || '100%'\"\n [style.border-radius]=\"zRadius()\"></div>\n }\n }\n</div>\n", styles: [".z-skeleton-container{display:block;width:100%;height:100%}.z-skeleton{background-color:#e0e0e0;position:relative;overflow:hidden}:host-context(.dark) .z-skeleton{background-color:#374151}.z-skeleton-bar,.z-skeleton-text{width:100%;height:100%}.z-skeleton-row{width:100%}.z-skeleton-circle{border-radius:50%;aspect-ratio:1/1}.z-skeleton-circle-sm{width:2rem;height:2rem}.z-skeleton-circle-default{width:3rem;height:3rem}.z-skeleton-circle-lg{width:4rem;height:4rem}.z-skeleton-text{height:1rem;border-radius:.25rem}.z-skeleton-animated:after{content:\"\";position:absolute;inset:0;background:linear-gradient(90deg,transparent 0%,rgba(255,255,255,.4) 50%,transparent 100%);animation:z-skeleton-shimmer 1.5s infinite}@keyframes z-skeleton-shimmer{0%{transform:translate(-100%)}to{transform:translate(100%)}}:host{display:block;width:100%;height:100%}\n"] }]
|
|
135
135
|
}], propDecorators: { class: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }], zType: [{ type: i0.Input, args: [{ isSignal: true, alias: "zType", required: false }] }], zSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "zSize", required: false }] }], zWidth: [{ type: i0.Input, args: [{ isSignal: true, alias: "zWidth", required: false }] }], zHeight: [{ type: i0.Input, args: [{ isSignal: true, alias: "zHeight", required: false }] }], zRows: [{ type: i0.Input, args: [{ isSignal: true, alias: "zRows", required: false }] }], zGap: [{ type: i0.Input, args: [{ isSignal: true, alias: "zGap", required: false }] }], zAnimated: [{ type: i0.Input, args: [{ isSignal: true, alias: "zAnimated", required: false }] }], zRadius: [{ type: i0.Input, args: [{ isSignal: true, alias: "zRadius", required: false }] }] } });
|
|
136
136
|
|
|
137
137
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shival99-z-ui-components-z-skeleton.mjs","sources":["../../../../libs/core-ui/components/z-skeleton/z-skeleton.variants.ts","../../../../libs/core-ui/components/z-skeleton/z-skeleton.component.ts","../../../../libs/core-ui/components/z-skeleton/z-skeleton.component.html","../../../../libs/core-ui/components/z-skeleton/shival99-z-ui-components-z-skeleton.ts"],"sourcesContent":["import { cva, type VariantProps } from 'class-variance-authority';\n\nexport const zSkeletonVariants = cva('z-skeleton', {\n variants: {\n type: {\n bar: 'z-skeleton-bar',\n circle: 'z-skeleton-circle',\n text: 'z-skeleton-text',\n },\n size: {\n sm: '',\n default: '',\n lg: '',\n },\n animated: {\n true: 'z-skeleton-animated',\n false: '',\n },\n },\n compoundVariants: [\n {\n type: 'circle',\n size: 'sm',\n class: 'z-skeleton-circle-sm',\n },\n {\n type: 'circle',\n size: 'default',\n class: 'z-skeleton-circle-default',\n },\n {\n type: 'circle',\n size: 'lg',\n class: 'z-skeleton-circle-lg',\n },\n ],\n defaultVariants: {\n type: 'bar',\n size: 'default',\n animated: true,\n },\n});\n\nexport type ZSkeletonVariants = VariantProps<typeof zSkeletonVariants>;\n","import {\n AfterViewInit,\n ChangeDetectionStrategy,\n Component,\n computed,\n ElementRef,\n inject,\n input,\n OnDestroy,\n signal,\n} from '@angular/core';\nimport { zMergeClasses } from '@shival99/z-ui/utils';\nimport type { ClassValue } from 'clsx';\nimport { ZSkeletonRowItem, ZSkeletonSize, ZSkeletonType } from './z-skeleton.types';\nimport { zSkeletonVariants } from './z-skeleton.variants';\n\n@Component({\n selector: 'z-skeleton',\n standalone: true,\n templateUrl: './z-skeleton.component.html',\n styleUrl: './z-skeleton.component.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n class: 'z-skeleton-host',\n '[style.width]': 'zWidth()',\n '[style.height]': 'zHeight()',\n },\n})\nexport class ZSkeletonComponent implements AfterViewInit, OnDestroy {\n private readonly _elementRef = inject(ElementRef);\n\n public readonly class = input<ClassValue>('');\n public readonly zType = input<ZSkeletonType>('bar');\n public readonly zSize = input<ZSkeletonSize>('default');\n public readonly zWidth = input<string>('100%');\n public readonly zHeight = input<string | undefined>(undefined);\n public readonly zRows = input<number>(1);\n public readonly zGap = input<number>(8);\n public readonly zAnimated = input<boolean>(true);\n public readonly zRadius = input<string>('4px');\n\n private readonly _calculatedRows = signal<number>(1);\n\n private _parentElement: HTMLElement | null = null;\n private _originalOverflow = '';\n\n ngAfterViewInit(): void {\n if (this.zType() === 'bar') {\n this._calculateBarRows();\n }\n this._setParentOverflowHidden();\n }\n\n ngOnDestroy(): void {\n this._restoreParentOverflow();\n }\n\n protected readonly containerClass = computed(() => zMergeClasses(this.class()));\n protected readonly skeletonClasses = computed(() =>\n zSkeletonVariants({\n type: this.zType(),\n size: this.zSize(),\n animated: this.zAnimated(),\n })\n );\n\n protected readonly circleStyles = computed(() => {\n if (this.zHeight() || this.zWidth() !== '100%') {\n return {\n width: this.zWidth(),\n height: this.zHeight() || this.zWidth(),\n };\n }\n return {};\n });\n\n protected readonly shouldShowMultipleRows = computed(\n () => (this.zType() === 'bar' || this.zType() === 'text') && this.zRows() > 1\n );\n\n protected readonly rowsArray = computed<ZSkeletonRowItem[]>(() => {\n const type = this.zType();\n if (type !== 'bar' && type !== 'text') {\n return [{ index: 0, height: '0px' }];\n }\n\n const rowCount = this.zRows() || this._calculatedRows();\n const gapBetweenRows = this.zGap();\n const totalGapSpace = (rowCount - 1) * gapBetweenRows;\n const height = this.zHeight();\n const rowHeight = height ?? `calc((100% - ${totalGapSpace}px) / ${rowCount})`;\n\n return Array.from({ length: rowCount }, (_, i) => ({\n index: i,\n height: rowHeight,\n }));\n });\n\n private _setParentOverflowHidden(): void {\n this._parentElement = this._elementRef.nativeElement.parentElement;\n if (this._parentElement) {\n this._originalOverflow = this._parentElement.style.overflow || '';\n this._parentElement.style.overflow = 'hidden';\n }\n }\n\n private _restoreParentOverflow(): void {\n if (this._parentElement) {\n this._parentElement.style.overflow = this._originalOverflow;\n }\n }\n\n private _calculateBarRows(): void {\n const { parentElement } = this._elementRef.nativeElement || {};\n if (!parentElement) {\n return;\n }\n\n const rows = this.zRows();\n if (rows && rows > 0) {\n this._calculatedRows.set(rows);\n return;\n }\n\n this._calculatedRows.set(1);\n }\n}\n","<div class=\"z-skeleton-container\" [class]=\"containerClass()\">\n @if (zType() === 'circle') {\n <div [class]=\"skeletonClasses()\" [style]=\"circleStyles()\"></div>\n } @else if (zType() === 'bar' || zType() === 'text') {\n @if (shouldShowMultipleRows()) {\n @for (row of rowsArray(); track row.index) {\n <div\n class=\"z-skeleton-row\"\n [class]=\"skeletonClasses()\"\n [style.margin-bottom.px]=\"row.index === rowsArray().length - 1 ? 0 : zGap()\"\n [style.height]=\"row.height\"\n [style.width]=\"zWidth()\"\n [style.border-radius]=\"zRadius()\"></div>\n }\n } @else {\n <div\n [class]=\"skeletonClasses()\"\n [style.width]=\"zWidth()\"\n [style.height]=\"zHeight() || '100%'\"\n [style.border-radius]=\"zRadius()\"></div>\n }\n }\n</div>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;AAEO,MAAM,iBAAiB,GAAG,GAAG,CAAC,YAAY,EAAE;AACjD,IAAA,QAAQ,EAAE;AACR,QAAA,IAAI,EAAE;AACJ,YAAA,GAAG,EAAE,gBAAgB;AACrB,YAAA,MAAM,EAAE,mBAAmB;AAC3B,YAAA,IAAI,EAAE,iBAAiB;AACxB,SAAA;AACD,QAAA,IAAI,EAAE;AACJ,YAAA,EAAE,EAAE,EAAE;AACN,YAAA,OAAO,EAAE,EAAE;AACX,YAAA,EAAE,EAAE,EAAE;AACP,SAAA;AACD,QAAA,QAAQ,EAAE;AACR,YAAA,IAAI,EAAE,qBAAqB;AAC3B,YAAA,KAAK,EAAE,EAAE;AACV,SAAA;AACF,KAAA;AACD,IAAA,gBAAgB,EAAE;AAChB,QAAA;AACE,YAAA,IAAI,EAAE,QAAQ;AACd,YAAA,IAAI,EA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,IAAI,CAAC,eAAe,CAAC,GAAG,CAAC,CAAC,CAAC;IAC7B;uGAjGW,kBAAkB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;AAAlB,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,kBAAkB,uxCC5B/B,o2BAuBA,EAAA,MAAA,EAAA,CAAA,i1BAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA;;2FDKa,kBAAkB,EAAA,UAAA,EAAA,CAAA;kBAZ9B,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,YAAY,cACV,IAAI,EAAA,eAAA,EAGC,uBAAuB,CAAC,MAAM,EAAA,IAAA,EACzC;AACJ,wBAAA,KAAK,EAAE,iBAAiB;AACxB,wBAAA,eAAe,EAAE,UAAU;AAC3B,wBAAA,gBAAgB,EAAE,WAAW;AAC9B,qBAAA,EAAA,QAAA,EAAA,o2BAAA,EAAA,MAAA,EAAA,CAAA,i1BAAA,CAAA,EAAA;;;AE1BH;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"shival99-z-ui-components-z-skeleton.mjs","sources":["../../../../libs/core-ui/components/z-skeleton/z-skeleton.variants.ts","../../../../libs/core-ui/components/z-skeleton/z-skeleton.component.ts","../../../../libs/core-ui/components/z-skeleton/z-skeleton.component.html","../../../../libs/core-ui/components/z-skeleton/shival99-z-ui-components-z-skeleton.ts"],"sourcesContent":["import { cva, type VariantProps } from 'class-variance-authority';\n\nexport const zSkeletonVariants = cva('z-skeleton', {\n variants: {\n type: {\n bar: 'z-skeleton-bar',\n circle: 'z-skeleton-circle',\n text: 'z-skeleton-text',\n },\n size: {\n sm: '',\n default: '',\n lg: '',\n },\n animated: {\n true: 'z-skeleton-animated',\n false: '',\n },\n },\n compoundVariants: [\n {\n type: 'circle',\n size: 'sm',\n class: 'z-skeleton-circle-sm',\n },\n {\n type: 'circle',\n size: 'default',\n class: 'z-skeleton-circle-default',\n },\n {\n type: 'circle',\n size: 'lg',\n class: 'z-skeleton-circle-lg',\n },\n ],\n defaultVariants: {\n type: 'bar',\n size: 'default',\n animated: true,\n },\n});\n\nexport type ZSkeletonVariants = VariantProps<typeof zSkeletonVariants>;\n","import {\n AfterViewInit,\n ChangeDetectionStrategy,\n Component,\n computed,\n ElementRef,\n inject,\n input,\n OnDestroy,\n signal,\n} from '@angular/core';\nimport { zMergeClasses } from '@shival99/z-ui/utils';\nimport type { ClassValue } from 'clsx';\nimport { ZSkeletonRowItem, ZSkeletonSize, ZSkeletonType } from './z-skeleton.types';\nimport { zSkeletonVariants } from './z-skeleton.variants';\n\n@Component({\n selector: 'z-skeleton',\n standalone: true,\n templateUrl: './z-skeleton.component.html',\n styleUrl: './z-skeleton.component.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n class: 'z-skeleton-host',\n '[style.width]': 'zWidth()',\n '[style.height]': 'zHeight()',\n },\n})\nexport class ZSkeletonComponent implements AfterViewInit, OnDestroy {\n private readonly _elementRef = inject(ElementRef);\n\n public readonly class = input<ClassValue>('');\n public readonly zType = input<ZSkeletonType>('bar');\n public readonly zSize = input<ZSkeletonSize>('default');\n public readonly zWidth = input<string>('100%');\n public readonly zHeight = input<string | undefined>(undefined);\n public readonly zRows = input<number>(1);\n public readonly zGap = input<number>(8);\n public readonly zAnimated = input<boolean>(true);\n public readonly zRadius = input<string>('4px');\n\n private readonly _calculatedRows = signal<number>(1);\n\n private _parentElement: HTMLElement | null = null;\n private _originalOverflow = '';\n\n ngAfterViewInit(): void {\n if (this.zType() === 'bar') {\n this._calculateBarRows();\n }\n this._setParentOverflowHidden();\n }\n\n ngOnDestroy(): void {\n this._restoreParentOverflow();\n }\n\n protected readonly containerClass = computed(() => zMergeClasses(this.class()));\n protected readonly skeletonClasses = computed(() =>\n zSkeletonVariants({\n type: this.zType(),\n size: this.zSize(),\n animated: this.zAnimated(),\n })\n );\n\n protected readonly circleStyles = computed(() => {\n if (this.zHeight() || this.zWidth() !== '100%') {\n return {\n width: this.zWidth(),\n height: this.zHeight() || this.zWidth(),\n };\n }\n return {};\n });\n\n protected readonly shouldShowMultipleRows = computed(\n () => (this.zType() === 'bar' || this.zType() === 'text') && this.zRows() > 1\n );\n\n protected readonly rowsArray = computed<ZSkeletonRowItem[]>(() => {\n const type = this.zType();\n if (type !== 'bar' && type !== 'text') {\n return [{ index: 0, height: '0rem' }];\n }\n\n const rowCount = this.zRows() || this._calculatedRows();\n const gapBetweenRows = this.zGap();\n const totalGapSpace = (rowCount - 1) * gapBetweenRows;\n const height = this.zHeight();\n const rowHeight = height ?? `calc((100% - ${totalGapSpace}px) / ${rowCount})`;\n\n return Array.from({ length: rowCount }, (_, i) => ({\n index: i,\n height: rowHeight,\n }));\n });\n\n private _setParentOverflowHidden(): void {\n this._parentElement = this._elementRef.nativeElement.parentElement;\n if (this._parentElement) {\n this._originalOverflow = this._parentElement.style.overflow || '';\n this._parentElement.style.overflow = 'hidden';\n }\n }\n\n private _restoreParentOverflow(): void {\n if (this._parentElement) {\n this._parentElement.style.overflow = this._originalOverflow;\n }\n }\n\n private _calculateBarRows(): void {\n const { parentElement } = this._elementRef.nativeElement || {};\n if (!parentElement) {\n return;\n }\n\n const rows = this.zRows();\n if (rows && rows > 0) {\n this._calculatedRows.set(rows);\n return;\n }\n\n this._calculatedRows.set(1);\n }\n}\n","<div class=\"z-skeleton-container\" [class]=\"containerClass()\">\n @if (zType() === 'circle') {\n <div [class]=\"skeletonClasses()\" [style]=\"circleStyles()\"></div>\n } @else if (zType() === 'bar' || zType() === 'text') {\n @if (shouldShowMultipleRows()) {\n @for (row of rowsArray(); track row.index) {\n <div\n class=\"z-skeleton-row\"\n [class]=\"skeletonClasses()\"\n [style.margin-bottom.px]=\"row.index === rowsArray().length - 1 ? 0 : zGap()\"\n [style.height]=\"row.height\"\n [style.width]=\"zWidth()\"\n [style.border-radius]=\"zRadius()\"></div>\n }\n } @else {\n <div\n [class]=\"skeletonClasses()\"\n [style.width]=\"zWidth()\"\n [style.height]=\"zHeight() || '100%'\"\n [style.border-radius]=\"zRadius()\"></div>\n }\n }\n</div>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;AAEO,MAAM,iBAAiB,GAAG,GAAG,CAAC,YAAY,EAAE;AACjD,IAAA,QAAQ,EAAE;AACR,QAAA,IAAI,EAAE;AACJ,YAAA,GAAG,EAAE,gBAAgB;AACrB,YAAA,MAAM,EAAE,mBAAmB;AAC3B,YAAA,IAAI,EAAE,iBAAiB;AACxB,SAAA;AACD,QAAA,IAAI,EAAE;AACJ,YAAA,EAAE,EAAE,EAAE;AACN,YAAA,OAAO,EAAE,EAAE;AACX,YAAA,EAAE,EAAE,EAAE;AACP,SAAA;AACD,QAAA,QAAQ,EAAE;AACR,YAAA,IAAI,EAAE,qBAAqB;AAC3B,YAAA,KAAK,EAAE,EAAE;AACV,SAAA;AACF,KAAA;AACD,IAAA,gBAAgB,EAAE;AAChB,QAAA;AACE,YAAA,IAAI,EAAE,QAAQ;AACd,YAAA,IAAI,EAAE,IAAI;AACV,YAAA,KAAK,EAAE,sBAAsB;AAC9B,SAAA;AACD,QAAA;AACE,YAAA,IAAI,EAAE,QAAQ;AACd,YAAA,IAAI,EAAE,SAAS;AACf,YAAA,KAAK,EAAE,2BAA2B;AACnC,SAAA;AACD,QAAA;AACE,YAAA,IAAI,EAAE,QAAQ;AACd,YAAA,IAAI,EAAE,IAAI;AACV,YAAA,KAAK,EAAE,sBAAsB;AAC9B,SAAA;AACF,KAAA;AACD,IAAA,eAAe,EAAE;AACf,QAAA,IAAI,EAAE,KAAK;AACX,QAAA,IAAI,EAAE,SAAS;AACf,QAAA,QAAQ,EAAE,IAAI;AACf,KAAA;AACF,CAAA;;MCbY,kBA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A,EAAA,CAAA;kBAZ9B,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,YAAY,cACV,IAAI,EAAA,eAAA,EAGC,uBAAuB,CAAC,MAAM,EAAA,IAAA,EACzC;AACJ,wBAAA,KAAK,EAAE,iBAAiB;AACxB,wBAAA,eAAe,EAAE,UAAU;AAC3B,wBAAA,gBAAgB,EAAE,WAAW;AAC9B,qBAAA,EAAA,QAAA,EAAA,o2BAAA,EAAA,MAAA,EAAA,CAAA,o1BAAA,CAAA,EAAA;;;AE1BH;;AAEG;;;;"}
|
|
@@ -35,19 +35,19 @@ const zStepsItemVariants = cva(['relative flex items-start'], {
|
|
|
35
35
|
},
|
|
36
36
|
});
|
|
37
37
|
const zStepsIconVariants = cva([
|
|
38
|
-
'absolute start-0 z-10 flex items-center justify-center rounded-full ring-
|
|
38
|
+
'absolute start-0 z-10 flex items-center justify-center rounded-full border shadow-sm ring-[3px] ring-background transform-gpu transition-transform duration-200 ease-out hover:scale-105',
|
|
39
39
|
], {
|
|
40
40
|
variants: {
|
|
41
41
|
size: {
|
|
42
|
-
sm: 'w-
|
|
43
|
-
default: 'w-
|
|
44
|
-
lg: 'w-
|
|
42
|
+
sm: 'w-8 h-8 text-xs',
|
|
43
|
+
default: 'w-9 h-9 text-sm',
|
|
44
|
+
lg: 'w-11 h-11 text-base',
|
|
45
45
|
},
|
|
46
46
|
status: {
|
|
47
|
-
pending: 'bg-background border
|
|
48
|
-
current: 'bg-primary text-primary-foreground ring-primary/20',
|
|
49
|
-
completed: 'bg-primary text-primary-foreground ring-primary/20',
|
|
50
|
-
error: 'bg-destructive text-destructive-foreground ring-destructive/20',
|
|
47
|
+
pending: 'bg-background border-input text-muted-foreground ring-muted/70',
|
|
48
|
+
current: 'bg-primary border-primary text-primary-foreground ring-primary/20',
|
|
49
|
+
completed: 'bg-primary border-primary text-primary-foreground ring-primary/20',
|
|
50
|
+
error: 'bg-destructive border-destructive text-destructive-foreground ring-destructive/20',
|
|
51
51
|
},
|
|
52
52
|
},
|
|
53
53
|
defaultVariants: {
|
|
@@ -55,12 +55,12 @@ const zStepsIconVariants = cva([
|
|
|
55
55
|
status: 'pending',
|
|
56
56
|
},
|
|
57
57
|
});
|
|
58
|
-
const zStepsLineVariants = cva(['absolute border-s border-input'], {
|
|
58
|
+
const zStepsLineVariants = cva(['absolute border-s-2 border-input/80'], {
|
|
59
59
|
variants: {
|
|
60
60
|
size: {
|
|
61
|
-
sm: 'start-
|
|
62
|
-
default: 'start-
|
|
63
|
-
lg: 'start-
|
|
61
|
+
sm: 'start-4 top-4 bottom-0',
|
|
62
|
+
default: 'start-[18px] top-[1.125rem] bottom-0',
|
|
63
|
+
lg: 'start-[22px] top-[1.375rem] bottom-0',
|
|
64
64
|
},
|
|
65
65
|
},
|
|
66
66
|
defaultVariants: {
|
|
@@ -88,9 +88,9 @@ const zStepsConnectorVariants = cva(['transition-colors duration-200'], {
|
|
|
88
88
|
const zStepsArrowItemVariants = cva(['z-steps-arrow-item relative flex flex-1 flex-col justify-center transition-all duration-200'], {
|
|
89
89
|
variants: {
|
|
90
90
|
size: {
|
|
91
|
-
sm: 'min-w-[
|
|
92
|
-
default: 'min-w-[
|
|
93
|
-
lg: 'min-w-[
|
|
91
|
+
sm: 'min-w-[7.5rem] py-2 px-4',
|
|
92
|
+
default: 'min-w-[9.375rem] py-3 px-5',
|
|
93
|
+
lg: 'min-w-[11.25rem] py-4 px-6',
|
|
94
94
|
},
|
|
95
95
|
status: {
|
|
96
96
|
pending: 'bg-muted text-muted-foreground',
|
|
@@ -113,9 +113,9 @@ const zStepsDotVariants = cva(['rounded-full transition-all duration-200'], {
|
|
|
113
113
|
},
|
|
114
114
|
status: {
|
|
115
115
|
pending: 'bg-muted-foreground/30',
|
|
116
|
-
current: 'bg-primary ring-
|
|
117
|
-
completed: 'bg-primary ring-
|
|
118
|
-
error: 'bg-destructive ring-
|
|
116
|
+
current: 'bg-primary ring-2 ring-primary/20',
|
|
117
|
+
completed: 'bg-primary ring-2 ring-primary/20',
|
|
118
|
+
error: 'bg-destructive ring-2 ring-destructive/20',
|
|
119
119
|
},
|
|
120
120
|
},
|
|
121
121
|
defaultVariants: {
|
|
@@ -126,8 +126,8 @@ const zStepsDotVariants = cva(['rounded-full transition-all duration-200'], {
|
|
|
126
126
|
const zStepsDotLineVariants = cva(['transition-colors duration-200'], {
|
|
127
127
|
variants: {
|
|
128
128
|
orientation: {
|
|
129
|
-
vertical: 'w-
|
|
130
|
-
horizontal: 'h-
|
|
129
|
+
vertical: 'w-[0.125rem] flex-1 min-h-14 rounded-full',
|
|
130
|
+
horizontal: 'h-[0.125rem] flex-1 rounded-full',
|
|
131
131
|
},
|
|
132
132
|
status: {
|
|
133
133
|
pending: 'bg-muted-foreground/20',
|
|
@@ -184,16 +184,18 @@ class ZStepsComponent {
|
|
|
184
184
|
orientation: this.effectiveOrientation(),
|
|
185
185
|
size: this.zSize(),
|
|
186
186
|
}), ...(ngDevMode ? [{ debugName: "getItemClasses" }] : []));
|
|
187
|
-
|
|
187
|
+
iconClassesMap = computed(() => {
|
|
188
188
|
const size = this.zSize();
|
|
189
189
|
const steps = this.mergedSteps();
|
|
190
190
|
const current = this.currentStep();
|
|
191
|
-
|
|
191
|
+
const classMap = new Map();
|
|
192
|
+
steps.forEach((step, index) => {
|
|
192
193
|
const status = this._getStepStatus(step, index, current);
|
|
193
194
|
const baseClasses = zStepsIconVariants({ size, status });
|
|
194
|
-
|
|
195
|
+
classMap.set(index, zMergeClasses(baseClasses, step.iconClass));
|
|
195
196
|
});
|
|
196
|
-
|
|
197
|
+
return classMap;
|
|
198
|
+
}, ...(ngDevMode ? [{ debugName: "iconClassesMap" }] : []));
|
|
197
199
|
lineClasses = computed(() => zStepsLineVariants({ size: this.zSize() }), ...(ngDevMode ? [{ debugName: "lineClasses" }] : []));
|
|
198
200
|
getConnectorClassesByIndex = computed(() => {
|
|
199
201
|
const orientation = this.effectiveOrientation();
|
|
@@ -263,12 +265,12 @@ class ZStepsComponent {
|
|
|
263
265
|
iconWidth = computed(() => {
|
|
264
266
|
const size = this.zSize();
|
|
265
267
|
if (size === 'sm') {
|
|
266
|
-
return
|
|
268
|
+
return 32;
|
|
267
269
|
}
|
|
268
270
|
if (size === 'lg') {
|
|
269
|
-
return
|
|
271
|
+
return 44;
|
|
270
272
|
}
|
|
271
|
-
return
|
|
273
|
+
return 36;
|
|
272
274
|
}, ...(ngDevMode ? [{ debugName: "iconWidth" }] : []));
|
|
273
275
|
ngAfterViewInit() {
|
|
274
276
|
if (this.zResponsive() && this.zOrientation() === 'horizontal') {
|
|
@@ -377,13 +379,13 @@ class ZStepsComponent {
|
|
|
377
379
|
this.zOnStepClick.emit(index);
|
|
378
380
|
}
|
|
379
381
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: ZStepsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
380
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.6", type: ZStepsComponent, isStandalone: true, selector: "z-steps", inputs: { class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null }, zSteps: { classPropertyName: "zSteps", publicName: "zSteps", isSignal: true, isRequired: true, transformFunction: null }, zCurrent: { classPropertyName: "zCurrent", publicName: "zCurrent", isSignal: true, isRequired: false, transformFunction: null }, zOrientation: { classPropertyName: "zOrientation", publicName: "zOrientation", isSignal: true, isRequired: false, transformFunction: null }, zType: { classPropertyName: "zType", publicName: "zType", isSignal: true, isRequired: false, transformFunction: null }, zSize: { classPropertyName: "zSize", publicName: "zSize", isSignal: true, isRequired: false, transformFunction: null }, zClickable: { classPropertyName: "zClickable", publicName: "zClickable", isSignal: true, isRequired: false, transformFunction: null }, zShowNumber: { classPropertyName: "zShowNumber", publicName: "zShowNumber", isSignal: true, isRequired: false, transformFunction: null }, zResponsive: { classPropertyName: "zResponsive", publicName: "zResponsive", isSignal: true, isRequired: false, transformFunction: null }, zDisabled: { classPropertyName: "zDisabled", publicName: "zDisabled", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { zOnStepClick: "zOnStepClick", zControl: "zControl" }, host: { classAttribute: "block" }, ngImport: i0, template: "<ol [class]=\"containerClasses()\">\n @for (step of mergedSteps(); track $index; let i = $index; let last = $last) {\n @if (effectiveOrientation() === 'vertical') {\n @if (zType() === 'dot') {\n <!-- Vertical Dot Layout -->\n <li\n class=\"flex items-start gap-3\"\n [class.cursor-pointer]=\"zClickable() && !step.disabled\"\n [class.cursor-not-allowed]=\"step.disabled\"\n [class.opacity-50]=\"step.disabled\"\n (click)=\"onStepClick(i)\">\n <!-- Dot + Line Column -->\n <div class=\"flex flex-col items-center\">\n <!-- Dot -->\n <span [class]=\"getDotClassesByIndex()[i]\" class=\"shrink-0\"></span>\n <!-- Vertical Line -->\n @if (!last) {\n <div [class]=\"getDotLineClassesByIndex()[i]\" class=\"my-1.5\"></div>\n }\n </div>\n\n <!-- Content (optional) -->\n @if (step.title) {\n <span\n class=\"pt-0.5 text-sm\"\n [class.text-foreground]=\"stepStatuses()[i] === 'current'\"\n [class.font-medium]=\"stepStatuses()[i] === 'current'\"\n [class.text-muted-foreground]=\"stepStatuses()[i] !== 'current'\">\n {{ step.title }}\n </span>\n }\n </li>\n } @else {\n <!-- Vertical Layout -->\n <li\n [class]=\"getItemClasses()\"\n [class.!items-start]=\"!step.description && (step.title || step.icon)\"\n [class.items-center]=\"!step.description && (step.title || step.icon)\"\n [class.cursor-pointer]=\"zClickable() && !step.disabled\"\n [class.cursor-not-allowed]=\"step.disabled\"\n [class.opacity-50]=\"step.disabled\"\n (click)=\"onStepClick(i)\">\n <!-- Vertical Line -->\n @if (!last) {\n <div [class]=\"lineClasses()\"></div>\n }\n\n <!-- Step Icon -->\n <span [class]=\"getIconClassesByStatus()[i]\">\n @switch (stepStatuses()[i]) {\n @case ('completed') {\n @if (step.icon) {\n <z-icon [zType]=\"step.icon\" [zSize]=\"getIconSizeByIndex()[i]\" />\n } @else {\n <z-icon zType=\"lucideCheck\" [zSize]=\"getIconSizeByIndex()[i]\" />\n }\n }\n @case ('error') {\n <z-icon zType=\"lucideX\" [zSize]=\"getIconSizeByIndex()[i]\" />\n }\n @default {\n @if (step.icon) {\n <z-icon [zType]=\"step.icon\" [zSize]=\"getIconSizeByIndex()[i]\" />\n } @else if (zShowNumber()) {\n <span class=\"font-medium\">{{ i + 1 }}</span>\n }\n }\n }\n </span>\n\n <!-- Content -->\n @if (step.title || step.description) {\n <div class=\"flex min-w-0 flex-col\" [style.padding-top.px]=\"!step.description ? iconWidth() / 5 : 0\">\n @if (step.title) {\n <h3 class=\"leading-tight font-medium\">{{ step.title }}</h3>\n }\n @if (step.description) {\n <p class=\"text-muted-foreground mt-1 text-sm\">{{ step.description }}</p>\n }\n </div>\n }\n </li>\n }\n } @else {\n <!-- Horizontal Layout -->\n <li\n [class]=\"zType() === 'arrow' ? 'flex-1' : 'flex-1 last:flex-none'\"\n [class.cursor-pointer]=\"zClickable() && !step.disabled\"\n [class.cursor-not-allowed]=\"step.disabled\"\n [class.opacity-50]=\"step.disabled\"\n (click)=\"onStepClick(i)\">\n @if (zType() === 'arrow') {\n <!-- Arrow Style -->\n <div [class]=\"getArrowClassesByIndex()[i]\">\n <div class=\"flex items-center gap-3.5\">\n @if (step.icon) {\n <z-icon [zType]=\"step.icon\" [zSize]=\"getIconSizeByIndex()[i]\" class=\"shrink-0\" />\n }\n <div class=\"flex min-w-0 flex-col\">\n @if (step.title) {\n <h3\n z-tooltip\n [zContent]=\"step.title\"\n [zAutoDetect]=\"true\"\n zPosition=\"top\"\n class=\"truncate text-sm leading-tight font-semibold whitespace-nowrap\">\n {{ step.title }}\n </h3>\n }\n @if (step.description) {\n <p\n z-tooltip\n [zContent]=\"step.description\"\n [zAutoDetect]=\"true\"\n zPosition=\"bottom\"\n class=\"mt-1 truncate text-xs whitespace-nowrap opacity-80\">\n {{ step.description }}\n </p>\n }\n </div>\n </div>\n </div>\n } @else if (zType() === 'dot') {\n <!-- Dot Style: Simple dots with optional labels -->\n <div class=\"flex items-center\">\n <!-- Dot -->\n <span [class]=\"getDotClassesByIndex()[i]\"></span>\n\n <!-- Content (optional) -->\n @if (step.title) {\n <span\n z-tooltip\n [zContent]=\"step.title\"\n [zAutoDetect]=\"true\"\n zPosition=\"top\"\n class=\"ms-2 max-w-20 truncate text-sm whitespace-nowrap\"\n [class.text-foreground]=\"stepStatuses()[i] === 'current'\"\n [class.text-muted-foreground]=\"stepStatuses()[i] !== 'current'\">\n {{ step.title }}\n </span>\n }\n\n <!-- Horizontal Line -->\n @if (!last) {\n <div [class]=\"getDotLineClassesByIndex()[i]\" class=\"mx-2 min-w-8\"></div>\n }\n </div>\n } @else if (zType() === 'inline') {\n <!-- Inline: Icon + Content + Line in one row -->\n <div class=\"flex items-center\">\n <!-- Step Icon -->\n <span [class]=\"getIconClassesByStatus()[i]\" class=\"relative! start-auto! shrink-0\">\n @switch (stepStatuses()[i]) {\n @case ('completed') {\n @if (step.icon) {\n <z-icon [zType]=\"step.icon\" [zSize]=\"getIconSizeByIndex()[i]\" />\n } @else {\n <z-icon zType=\"lucideCheck\" [zSize]=\"getIconSizeByIndex()[i]\" />\n }\n }\n @case ('error') {\n <z-icon zType=\"lucideX\" [zSize]=\"getIconSizeByIndex()[i]\" />\n }\n @default {\n @if (step.icon) {\n <z-icon [zType]=\"step.icon\" [zSize]=\"getIconSizeByIndex()[i]\" />\n } @else if (zShowNumber()) {\n <span class=\"font-medium\">{{ i + 1 }}</span>\n }\n }\n }\n </span>\n\n <!-- Content Inline -->\n @if (step.title || step.description) {\n <div class=\"ms-3 flex min-w-0 flex-col\">\n @if (step.title) {\n <h3\n z-tooltip\n [zContent]=\"step.title\"\n [zAutoDetect]=\"true\"\n zPosition=\"top\"\n class=\"max-w-30 truncate text-sm leading-tight font-medium whitespace-nowrap\">\n {{ step.title }}\n </h3>\n }\n @if (step.description) {\n <p\n z-tooltip\n [zContent]=\"step.description\"\n [zAutoDetect]=\"true\"\n zPosition=\"bottom\"\n class=\"text-muted-foreground mt-1 max-w-30 truncate text-xs whitespace-nowrap\">\n {{ step.description }}\n </p>\n }\n </div>\n }\n\n <!-- Horizontal Line -->\n @if (!last) {\n <div [class]=\"getConnectorClassesByIndex()[i]\"></div>\n }\n </div>\n } @else {\n <!-- Default: Icon + Line row, Content below -->\n <div class=\"flex items-center\">\n <!-- Step Icon -->\n <span [class]=\"getIconClassesByStatus()[i]\" class=\"relative! start-auto! shrink-0\">\n @switch (stepStatuses()[i]) {\n @case ('completed') {\n @if (step.icon) {\n <z-icon [zType]=\"step.icon\" [zSize]=\"getIconSizeByIndex()[i]\" />\n } @else {\n <z-icon zType=\"lucideCheck\" [zSize]=\"getIconSizeByIndex()[i]\" />\n }\n }\n @case ('error') {\n <z-icon zType=\"lucideX\" [zSize]=\"getIconSizeByIndex()[i]\" />\n }\n @default {\n @if (step.icon) {\n <z-icon [zType]=\"step.icon\" [zSize]=\"getIconSizeByIndex()[i]\" />\n } @else if (zShowNumber()) {\n <span class=\"font-medium\">{{ i + 1 }}</span>\n }\n }\n }\n </span>\n\n <!-- Horizontal Line -->\n @if (!last) {\n <div [class]=\"getConnectorClassesByIndex()[i]\"></div>\n }\n </div>\n\n <!-- Content Below -->\n @if (step.title || step.description) {\n <div\n class=\"z-steps-content mt-3 flex flex-col text-center\"\n [style.width.px]=\"150\"\n [style.margin-left.px]=\"(iconWidth() - 150) / 2\">\n @if (step.title) {\n <h3\n z-tooltip\n [zContent]=\"step.title\"\n [zAutoDetect]=\"true\"\n zPosition=\"top\"\n class=\"truncate text-sm leading-tight font-medium whitespace-nowrap\">\n {{ step.title }}\n </h3>\n }\n @if (step.description) {\n <p\n z-tooltip\n [zContent]=\"step.description\"\n [zAutoDetect]=\"true\"\n zPosition=\"bottom\"\n class=\"text-muted-foreground mt-1 truncate text-xs whitespace-nowrap\">\n {{ step.description }}\n </p>\n }\n </div>\n }\n }\n </li>\n }\n }\n</ol>\n", styles: ["z-steps ol li:not(:last-child)>div[class*=border-s]{height:calc(100% + 2rem)}z-steps ol li[class*=mb-6]:not(:last-child)>div[class*=border-s]{height:calc(100% + 1.5rem)}z-steps ol li[class*=mb-10]:not(:last-child)>div[class*=border-s]{height:calc(100% + 2.5rem)}z-steps .z-steps-arrow-item{position:relative;display:flex;flex-direction:column;justify-content:center;transition:all .2s ease-out}z-steps .z-steps-arrow-item:hover{filter:brightness(.92)}z-steps .z-steps-arrow-first{border-radius:6px 0 0 6px;clip-path:polygon(0 0,calc(100% - 16px) 0,100% 50%,calc(100% - 16px) 100%,0 100%)}z-steps .z-steps-arrow-middle{margin-left:-8px;padding-left:calc(16px + 1rem);clip-path:polygon(0 0,calc(100% - 16px) 0,100% 50%,calc(100% - 16px) 100%,0 100%,16px 50%)}z-steps .z-steps-arrow-last{margin-left:-8px;padding-left:calc(16px + 1rem);border-radius:0 6px 6px 0;clip-path:polygon(0 0,100% 0,100% 100%,0 100%,16px 50%)}\n"], dependencies: [{ kind: "component", type: ZIconComponent, selector: "z-icon, [z-icon]", inputs: ["class", "zType", "zSize", "zStrokeWidth", "zSvg"] }, { kind: "directive", type: ZTooltipDirective, selector: "[z-tooltip], [zTooltip]", inputs: ["zContent", "zPosition", "zTrigger", "zTooltipType", "zTooltipSize", "zClass", "zShowDelay", "zHideDelay", "zArrow", "zDisabled", "zOffset", "zAutoDetect", "zTriggerElement", "zAlwaysShow", "zMaxWidth"], outputs: ["zShow", "zHide"], exportAs: ["zTooltip"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
382
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.6", type: ZStepsComponent, isStandalone: true, selector: "z-steps", inputs: { class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null }, zSteps: { classPropertyName: "zSteps", publicName: "zSteps", isSignal: true, isRequired: true, transformFunction: null }, zCurrent: { classPropertyName: "zCurrent", publicName: "zCurrent", isSignal: true, isRequired: false, transformFunction: null }, zOrientation: { classPropertyName: "zOrientation", publicName: "zOrientation", isSignal: true, isRequired: false, transformFunction: null }, zType: { classPropertyName: "zType", publicName: "zType", isSignal: true, isRequired: false, transformFunction: null }, zSize: { classPropertyName: "zSize", publicName: "zSize", isSignal: true, isRequired: false, transformFunction: null }, zClickable: { classPropertyName: "zClickable", publicName: "zClickable", isSignal: true, isRequired: false, transformFunction: null }, zShowNumber: { classPropertyName: "zShowNumber", publicName: "zShowNumber", isSignal: true, isRequired: false, transformFunction: null }, zResponsive: { classPropertyName: "zResponsive", publicName: "zResponsive", isSignal: true, isRequired: false, transformFunction: null }, zDisabled: { classPropertyName: "zDisabled", publicName: "zDisabled", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { zOnStepClick: "zOnStepClick", zControl: "zControl" }, host: { classAttribute: "block" }, ngImport: i0, template: "<ol\n [class]=\"containerClasses()\"\n [class.rounded-md]=\"effectiveOrientation() === 'horizontal' && (zType() === 'inline' || zType() === 'dot')\"\n [class.border]=\"effectiveOrientation() === 'horizontal' && (zType() === 'inline' || zType() === 'dot')\"\n [class.border-border/70]=\"effectiveOrientation() === 'horizontal' && (zType() === 'inline' || zType() === 'dot')\"\n [class.bg-muted/20]=\"effectiveOrientation() === 'horizontal' && (zType() === 'inline' || zType() === 'dot')\"\n [class.p-2]=\"effectiveOrientation() === 'horizontal' && (zType() === 'inline' || zType() === 'dot')\">\n @for (step of mergedSteps(); track $index; let i = $index; let last = $last) {\n @if (effectiveOrientation() === 'vertical') {\n @if (zType() === 'dot') {\n <!-- Vertical Dot Layout -->\n <li\n class=\"flex items-start gap-3\"\n [class.cursor-pointer]=\"zClickable() && !step.disabled\"\n [class.cursor-not-allowed]=\"step.disabled\"\n [class.opacity-50]=\"step.disabled\"\n (click)=\"onStepClick(i)\">\n <!-- Dot + Line Column -->\n <div class=\"flex w-10 shrink-0 flex-col items-center\">\n <!-- Dot -->\n <span [class]=\"getDotClassesByIndex()[i]\" class=\"shrink-0\"></span>\n <!-- Vertical Line -->\n @if (!last) {\n <div\n class=\"my-1 h-10 w-[0.125rem] rounded-full\"\n [class.bg-primary]=\"stepStatuses()[i] === 'completed'\"\n [class.bg-destructive/40]=\"stepStatuses()[i] === 'error'\"\n [class.bg-muted-foreground/30]=\"\n stepStatuses()[i] !== 'completed' && stepStatuses()[i] !== 'error'\n \"></div>\n }\n </div>\n\n <!-- Content (optional) -->\n @if (step.title) {\n <span\n class=\"pt-0.5 text-sm\"\n [class.text-foreground]=\"stepStatuses()[i] === 'current'\"\n [class.font-medium]=\"stepStatuses()[i] === 'current'\"\n [class.text-muted-foreground]=\"stepStatuses()[i] !== 'current'\">\n {{ step.title }}\n </span>\n }\n </li>\n } @else {\n <!-- Vertical Layout -->\n <li\n class=\"flex items-start gap-3\"\n [class.cursor-pointer]=\"zClickable() && !step.disabled\"\n [class.cursor-not-allowed]=\"step.disabled\"\n [class.opacity-50]=\"step.disabled\"\n (click)=\"onStepClick(i)\">\n <div class=\"flex w-10 shrink-0 flex-col items-center\">\n <!-- Step Icon -->\n <span [class]=\"iconClassesMap().get(i)\" class=\"relative! start-auto!\">\n @switch (stepStatuses()[i]) {\n @case ('completed') {\n @if (step.icon) {\n <z-icon [zType]=\"step.icon\" [zSize]=\"getIconSizeByIndex()[i]\" />\n } @else {\n <z-icon zType=\"lucideCheck\" [zSize]=\"getIconSizeByIndex()[i]\" />\n }\n }\n @case ('error') {\n <z-icon zType=\"lucideX\" [zSize]=\"getIconSizeByIndex()[i]\" />\n }\n @default {\n @if (step.icon) {\n <z-icon [zType]=\"step.icon\" [zSize]=\"getIconSizeByIndex()[i]\" />\n } @else if (zShowNumber()) {\n <span class=\"font-medium\">{{ i + 1 }}</span>\n }\n }\n }\n </span>\n\n <!-- Vertical Line -->\n @if (!last) {\n <div\n class=\"my-1 h-10 w-[0.125rem] rounded-full\"\n [class.bg-primary]=\"stepStatuses()[i] === 'completed'\"\n [class.bg-destructive/40]=\"stepStatuses()[i] === 'error'\"\n [class.bg-muted-foreground/30]=\"\n stepStatuses()[i] !== 'completed' && stepStatuses()[i] !== 'error'\n \"></div>\n }\n </div>\n\n <!-- Content -->\n @if (step.title || step.description) {\n <div class=\"min-w-0 flex-1 pt-1 pb-3\">\n @if (step.title) {\n <h3 class=\"leading-tight font-medium\">{{ step.title }}</h3>\n }\n @if (step.description) {\n <p class=\"text-muted-foreground mt-1 text-sm\">{{ step.description }}</p>\n }\n </div>\n }\n </li>\n }\n } @else {\n <!-- Horizontal Layout -->\n <li\n [class]=\"zType() === 'arrow' ? 'flex-1' : 'flex-1 last:flex-none'\"\n [class.cursor-pointer]=\"zClickable() && !step.disabled\"\n [class.cursor-not-allowed]=\"step.disabled\"\n [class.opacity-50]=\"step.disabled\"\n (click)=\"onStepClick(i)\">\n @if (zType() === 'arrow') {\n <!-- Arrow Style -->\n <div [class]=\"getArrowClassesByIndex()[i]\">\n <div class=\"flex items-center gap-3.5\">\n @if (step.icon) {\n <z-icon [zType]=\"step.icon\" [zSize]=\"getIconSizeByIndex()[i]\" class=\"shrink-0\" />\n }\n <div class=\"flex min-w-0 flex-col\">\n @if (step.title) {\n <h3\n z-tooltip\n [zContent]=\"step.title\"\n [zAutoDetect]=\"true\"\n zPosition=\"top\"\n class=\"truncate text-sm leading-tight font-semibold whitespace-nowrap\">\n {{ step.title }}\n </h3>\n }\n @if (step.description) {\n <p\n z-tooltip\n [zContent]=\"step.description\"\n [zAutoDetect]=\"true\"\n zPosition=\"bottom\"\n class=\"mt-1 truncate text-xs whitespace-nowrap opacity-80\">\n {{ step.description }}\n </p>\n }\n </div>\n </div>\n </div>\n } @else if (zType() === 'dot') {\n <!-- Dot Style: Simple dots with optional labels -->\n <div class=\"flex items-center\">\n <!-- Dot -->\n <span [class]=\"getDotClassesByIndex()[i]\"></span>\n\n <!-- Content (optional) -->\n @if (step.title) {\n <span\n z-tooltip\n [zContent]=\"step.title\"\n [zAutoDetect]=\"true\"\n zPosition=\"top\"\n class=\"ms-2 max-w-24 truncate text-sm whitespace-nowrap\"\n [class.text-foreground]=\"stepStatuses()[i] === 'current'\"\n [class.font-medium]=\"stepStatuses()[i] === 'current'\"\n [class.text-muted-foreground]=\"stepStatuses()[i] !== 'current'\">\n {{ step.title }}\n </span>\n }\n\n <!-- Horizontal Line -->\n @if (!last) {\n <div\n class=\"mx-3 h-[0.1875rem] min-w-8 flex-1 rounded-full\"\n [class.bg-primary]=\"stepStatuses()[i] === 'completed'\"\n [class.bg-destructive/40]=\"stepStatuses()[i] === 'error'\"\n [class.bg-muted-foreground/25]=\"\n stepStatuses()[i] !== 'completed' && stepStatuses()[i] !== 'error'\n \"></div>\n }\n </div>\n } @else if (zType() === 'inline') {\n <!-- Inline: Icon + Content + Line in one row -->\n <div class=\"flex items-center\">\n <div class=\"flex min-w-0 flex-1 items-center gap-2.5 px-2.5 py-2\">\n <!-- Step Icon -->\n <span [class]=\"iconClassesMap().get(i)\" class=\"relative! start-auto! shrink-0\">\n @switch (stepStatuses()[i]) {\n @case ('completed') {\n @if (step.icon) {\n <z-icon [zType]=\"step.icon\" [zSize]=\"getIconSizeByIndex()[i]\" />\n } @else {\n <z-icon zType=\"lucideCheck\" [zSize]=\"getIconSizeByIndex()[i]\" />\n }\n }\n @case ('error') {\n <z-icon zType=\"lucideX\" [zSize]=\"getIconSizeByIndex()[i]\" />\n }\n @default {\n @if (step.icon) {\n <z-icon [zType]=\"step.icon\" [zSize]=\"getIconSizeByIndex()[i]\" />\n } @else if (zShowNumber()) {\n <span class=\"font-medium\">{{ i + 1 }}</span>\n }\n }\n }\n </span>\n\n <!-- Content Inline -->\n @if (step.title || step.description) {\n <div class=\"min-w-0 flex-1\">\n @if (step.title) {\n <h3\n z-tooltip\n [zContent]=\"step.title\"\n [zAutoDetect]=\"true\"\n zPosition=\"top\"\n class=\"truncate text-sm leading-tight font-medium whitespace-nowrap\">\n {{ step.title }}\n </h3>\n }\n @if (step.description) {\n <p\n z-tooltip\n [zContent]=\"step.description\"\n [zAutoDetect]=\"true\"\n zPosition=\"bottom\"\n class=\"text-muted-foreground mt-1 truncate text-xs whitespace-nowrap\">\n {{ step.description }}\n </p>\n }\n </div>\n }\n </div>\n\n <!-- Horizontal Line -->\n @if (!last) {\n <div\n class=\"mx-3 h-[0.1875rem] min-w-8 flex-1 rounded-full\"\n [class.bg-primary]=\"stepStatuses()[i] === 'completed'\"\n [class.bg-destructive/40]=\"stepStatuses()[i] === 'error'\"\n [class.bg-muted-foreground/25]=\"\n stepStatuses()[i] !== 'completed' && stepStatuses()[i] !== 'error'\n \"></div>\n }\n </div>\n } @else {\n <!-- Default: Icon + Line row, Content below -->\n <div class=\"flex items-center\">\n <!-- Step Icon -->\n <span [class]=\"iconClassesMap().get(i)\" class=\"relative! start-auto! shrink-0\">\n @switch (stepStatuses()[i]) {\n @case ('completed') {\n @if (step.icon) {\n <z-icon [zType]=\"step.icon\" [zSize]=\"getIconSizeByIndex()[i]\" />\n } @else {\n <z-icon zType=\"lucideCheck\" [zSize]=\"getIconSizeByIndex()[i]\" />\n }\n }\n @case ('error') {\n <z-icon zType=\"lucideX\" [zSize]=\"getIconSizeByIndex()[i]\" />\n }\n @default {\n @if (step.icon) {\n <z-icon [zType]=\"step.icon\" [zSize]=\"getIconSizeByIndex()[i]\" />\n } @else if (zShowNumber()) {\n <span class=\"font-medium\">{{ i + 1 }}</span>\n }\n }\n }\n </span>\n\n <!-- Horizontal Line -->\n @if (!last) {\n <div [class]=\"getConnectorClassesByIndex()[i]\"></div>\n }\n </div>\n\n <!-- Content Below -->\n @if (step.title || step.description) {\n <div\n class=\"z-steps-content mt-3 flex flex-col text-center\"\n [style.width.px]=\"150\"\n [style.margin-left.px]=\"(iconWidth() - 150) / 2\">\n @if (step.title) {\n <h3\n z-tooltip\n [zContent]=\"step.title\"\n [zAutoDetect]=\"true\"\n zPosition=\"top\"\n class=\"truncate text-sm leading-tight font-medium whitespace-nowrap\">\n {{ step.title }}\n </h3>\n }\n @if (step.description) {\n <p\n z-tooltip\n [zContent]=\"step.description\"\n [zAutoDetect]=\"true\"\n zPosition=\"bottom\"\n class=\"text-muted-foreground mt-1 truncate text-xs whitespace-nowrap\">\n {{ step.description }}\n </p>\n }\n </div>\n }\n }\n </li>\n }\n }\n</ol>\n", styles: ["z-steps ol li:not(:last-child)>div[class*=border-s]{height:calc(100% + 2rem)}z-steps ol li[class*=mb-6]:not(:last-child)>div[class*=border-s]{height:calc(100% + 1.5rem)}z-steps ol li[class*=mb-10]:not(:last-child)>div[class*=border-s]{height:calc(100% + 2.5rem)}z-steps .z-steps-arrow-item{position:relative;display:flex;flex-direction:column;justify-content:center;transition:all .2s ease-out}z-steps .z-steps-arrow-item:hover{filter:brightness(.92)}z-steps .z-steps-arrow-first{border-radius:.375rem 0 0 .375rem;clip-path:polygon(0 0,calc(100% - 16px) 0,100% 50%,calc(100% - 16px) 100%,0 100%)}z-steps .z-steps-arrow-middle{margin-left:-.5rem;padding-left:2rem;clip-path:polygon(0 0,calc(100% - 16px) 0,100% 50%,calc(100% - 16px) 100%,0 100%,16px 50%)}z-steps .z-steps-arrow-last{margin-left:-.5rem;padding-left:2rem;border-radius:0 .375rem .375rem 0;clip-path:polygon(0 0,100% 0,100% 100%,0 100%,16px 50%)}\n"], dependencies: [{ kind: "component", type: ZIconComponent, selector: "z-icon, [z-icon]", inputs: ["class", "zType", "zSize", "zStrokeWidth", "zSvg"] }, { kind: "directive", type: ZTooltipDirective, selector: "[z-tooltip], [zTooltip]", inputs: ["zContent", "zPosition", "zTrigger", "zTooltipType", "zTooltipSize", "zClass", "zShowDelay", "zHideDelay", "zArrow", "zDisabled", "zOffset", "zAutoDetect", "zTriggerElement", "zAlwaysShow", "zMaxWidth"], outputs: ["zShow", "zHide"], exportAs: ["zTooltip"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
381
383
|
}
|
|
382
384
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: ZStepsComponent, decorators: [{
|
|
383
385
|
type: Component,
|
|
384
386
|
args: [{ selector: 'z-steps', imports: [ZIconComponent, ZTooltipDirective], changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, host: {
|
|
385
387
|
class: 'block',
|
|
386
|
-
}, template: "<ol [class]=\"containerClasses()\">\n @for (step of mergedSteps(); track $index; let i = $index; let last = $last) {\n @if (effectiveOrientation() === 'vertical') {\n @if (zType() === 'dot') {\n <!-- Vertical Dot Layout -->\n <li\n class=\"flex items-start gap-3\"\n [class.cursor-pointer]=\"zClickable() && !step.disabled\"\n [class.cursor-not-allowed]=\"step.disabled\"\n [class.opacity-50]=\"step.disabled\"\n (click)=\"onStepClick(i)\">\n <!-- Dot + Line Column -->\n <div class=\"flex flex-col items-center\">\n <!-- Dot -->\n <span [class]=\"getDotClassesByIndex()[i]\" class=\"shrink-0\"></span>\n <!-- Vertical Line -->\n @if (!last) {\n <div [class]=\"getDotLineClassesByIndex()[i]\" class=\"my-1.5\"></div>\n }\n </div>\n\n <!-- Content (optional) -->\n @if (step.title) {\n <span\n class=\"pt-0.5 text-sm\"\n [class.text-foreground]=\"stepStatuses()[i] === 'current'\"\n [class.font-medium]=\"stepStatuses()[i] === 'current'\"\n [class.text-muted-foreground]=\"stepStatuses()[i] !== 'current'\">\n {{ step.title }}\n </span>\n }\n </li>\n } @else {\n <!-- Vertical Layout -->\n <li\n [class]=\"getItemClasses()\"\n [class.!items-start]=\"!step.description && (step.title || step.icon)\"\n [class.items-center]=\"!step.description && (step.title || step.icon)\"\n [class.cursor-pointer]=\"zClickable() && !step.disabled\"\n [class.cursor-not-allowed]=\"step.disabled\"\n [class.opacity-50]=\"step.disabled\"\n (click)=\"onStepClick(i)\">\n <!-- Vertical Line -->\n @if (!last) {\n <div [class]=\"lineClasses()\"></div>\n }\n\n <!-- Step Icon -->\n <span [class]=\"getIconClassesByStatus()[i]\">\n @switch (stepStatuses()[i]) {\n @case ('completed') {\n @if (step.icon) {\n <z-icon [zType]=\"step.icon\" [zSize]=\"getIconSizeByIndex()[i]\" />\n } @else {\n <z-icon zType=\"lucideCheck\" [zSize]=\"getIconSizeByIndex()[i]\" />\n }\n }\n @case ('error') {\n <z-icon zType=\"lucideX\" [zSize]=\"getIconSizeByIndex()[i]\" />\n }\n @default {\n @if (step.icon) {\n <z-icon [zType]=\"step.icon\" [zSize]=\"getIconSizeByIndex()[i]\" />\n } @else if (zShowNumber()) {\n <span class=\"font-medium\">{{ i + 1 }}</span>\n }\n }\n }\n </span>\n\n <!-- Content -->\n @if (step.title || step.description) {\n <div class=\"flex min-w-0 flex-col\" [style.padding-top.px]=\"!step.description ? iconWidth() / 5 : 0\">\n @if (step.title) {\n <h3 class=\"leading-tight font-medium\">{{ step.title }}</h3>\n }\n @if (step.description) {\n <p class=\"text-muted-foreground mt-1 text-sm\">{{ step.description }}</p>\n }\n </div>\n }\n </li>\n }\n } @else {\n <!-- Horizontal Layout -->\n <li\n [class]=\"zType() === 'arrow' ? 'flex-1' : 'flex-1 last:flex-none'\"\n [class.cursor-pointer]=\"zClickable() && !step.disabled\"\n [class.cursor-not-allowed]=\"step.disabled\"\n [class.opacity-50]=\"step.disabled\"\n (click)=\"onStepClick(i)\">\n @if (zType() === 'arrow') {\n <!-- Arrow Style -->\n <div [class]=\"getArrowClassesByIndex()[i]\">\n <div class=\"flex items-center gap-3.5\">\n @if (step.icon) {\n <z-icon [zType]=\"step.icon\" [zSize]=\"getIconSizeByIndex()[i]\" class=\"shrink-0\" />\n }\n <div class=\"flex min-w-0 flex-col\">\n @if (step.title) {\n <h3\n z-tooltip\n [zContent]=\"step.title\"\n [zAutoDetect]=\"true\"\n zPosition=\"top\"\n class=\"truncate text-sm leading-tight font-semibold whitespace-nowrap\">\n {{ step.title }}\n </h3>\n }\n @if (step.description) {\n <p\n z-tooltip\n [zContent]=\"step.description\"\n [zAutoDetect]=\"true\"\n zPosition=\"bottom\"\n class=\"mt-1 truncate text-xs whitespace-nowrap opacity-80\">\n {{ step.description }}\n </p>\n }\n </div>\n </div>\n </div>\n } @else if (zType() === 'dot') {\n <!-- Dot Style: Simple dots with optional labels -->\n <div class=\"flex items-center\">\n <!-- Dot -->\n <span [class]=\"getDotClassesByIndex()[i]\"></span>\n\n <!-- Content (optional) -->\n @if (step.title) {\n <span\n z-tooltip\n [zContent]=\"step.title\"\n [zAutoDetect]=\"true\"\n zPosition=\"top\"\n class=\"ms-2 max-w-20 truncate text-sm whitespace-nowrap\"\n [class.text-foreground]=\"stepStatuses()[i] === 'current'\"\n [class.text-muted-foreground]=\"stepStatuses()[i] !== 'current'\">\n {{ step.title }}\n </span>\n }\n\n <!-- Horizontal Line -->\n @if (!last) {\n <div [class]=\"getDotLineClassesByIndex()[i]\" class=\"mx-2 min-w-8\"></div>\n }\n </div>\n } @else if (zType() === 'inline') {\n <!-- Inline: Icon + Content + Line in one row -->\n <div class=\"flex items-center\">\n <!-- Step Icon -->\n <span [class]=\"getIconClassesByStatus()[i]\" class=\"relative! start-auto! shrink-0\">\n @switch (stepStatuses()[i]) {\n @case ('completed') {\n @if (step.icon) {\n <z-icon [zType]=\"step.icon\" [zSize]=\"getIconSizeByIndex()[i]\" />\n } @else {\n <z-icon zType=\"lucideCheck\" [zSize]=\"getIconSizeByIndex()[i]\" />\n }\n }\n @case ('error') {\n <z-icon zType=\"lucideX\" [zSize]=\"getIconSizeByIndex()[i]\" />\n }\n @default {\n @if (step.icon) {\n <z-icon [zType]=\"step.icon\" [zSize]=\"getIconSizeByIndex()[i]\" />\n } @else if (zShowNumber()) {\n <span class=\"font-medium\">{{ i + 1 }}</span>\n }\n }\n }\n </span>\n\n <!-- Content Inline -->\n @if (step.title || step.description) {\n <div class=\"ms-3 flex min-w-0 flex-col\">\n @if (step.title) {\n <h3\n z-tooltip\n [zContent]=\"step.title\"\n [zAutoDetect]=\"true\"\n zPosition=\"top\"\n class=\"max-w-30 truncate text-sm leading-tight font-medium whitespace-nowrap\">\n {{ step.title }}\n </h3>\n }\n @if (step.description) {\n <p\n z-tooltip\n [zContent]=\"step.description\"\n [zAutoDetect]=\"true\"\n zPosition=\"bottom\"\n class=\"text-muted-foreground mt-1 max-w-30 truncate text-xs whitespace-nowrap\">\n {{ step.description }}\n </p>\n }\n </div>\n }\n\n <!-- Horizontal Line -->\n @if (!last) {\n <div [class]=\"getConnectorClassesByIndex()[i]\"></div>\n }\n </div>\n } @else {\n <!-- Default: Icon + Line row, Content below -->\n <div class=\"flex items-center\">\n <!-- Step Icon -->\n <span [class]=\"getIconClassesByStatus()[i]\" class=\"relative! start-auto! shrink-0\">\n @switch (stepStatuses()[i]) {\n @case ('completed') {\n @if (step.icon) {\n <z-icon [zType]=\"step.icon\" [zSize]=\"getIconSizeByIndex()[i]\" />\n } @else {\n <z-icon zType=\"lucideCheck\" [zSize]=\"getIconSizeByIndex()[i]\" />\n }\n }\n @case ('error') {\n <z-icon zType=\"lucideX\" [zSize]=\"getIconSizeByIndex()[i]\" />\n }\n @default {\n @if (step.icon) {\n <z-icon [zType]=\"step.icon\" [zSize]=\"getIconSizeByIndex()[i]\" />\n } @else if (zShowNumber()) {\n <span class=\"font-medium\">{{ i + 1 }}</span>\n }\n }\n }\n </span>\n\n <!-- Horizontal Line -->\n @if (!last) {\n <div [class]=\"getConnectorClassesByIndex()[i]\"></div>\n }\n </div>\n\n <!-- Content Below -->\n @if (step.title || step.description) {\n <div\n class=\"z-steps-content mt-3 flex flex-col text-center\"\n [style.width.px]=\"150\"\n [style.margin-left.px]=\"(iconWidth() - 150) / 2\">\n @if (step.title) {\n <h3\n z-tooltip\n [zContent]=\"step.title\"\n [zAutoDetect]=\"true\"\n zPosition=\"top\"\n class=\"truncate text-sm leading-tight font-medium whitespace-nowrap\">\n {{ step.title }}\n </h3>\n }\n @if (step.description) {\n <p\n z-tooltip\n [zContent]=\"step.description\"\n [zAutoDetect]=\"true\"\n zPosition=\"bottom\"\n class=\"text-muted-foreground mt-1 truncate text-xs whitespace-nowrap\">\n {{ step.description }}\n </p>\n }\n </div>\n }\n }\n </li>\n }\n }\n</ol>\n", styles: ["z-steps ol li:not(:last-child)>div[class*=border-s]{height:calc(100% + 2rem)}z-steps ol li[class*=mb-6]:not(:last-child)>div[class*=border-s]{height:calc(100% + 1.5rem)}z-steps ol li[class*=mb-10]:not(:last-child)>div[class*=border-s]{height:calc(100% + 2.5rem)}z-steps .z-steps-arrow-item{position:relative;display:flex;flex-direction:column;justify-content:center;transition:all .2s ease-out}z-steps .z-steps-arrow-item:hover{filter:brightness(.92)}z-steps .z-steps-arrow-first{border-radius:6px 0 0 6px;clip-path:polygon(0 0,calc(100% - 16px) 0,100% 50%,calc(100% - 16px) 100%,0 100%)}z-steps .z-steps-arrow-middle{margin-left:-8px;padding-left:calc(16px + 1rem);clip-path:polygon(0 0,calc(100% - 16px) 0,100% 50%,calc(100% - 16px) 100%,0 100%,16px 50%)}z-steps .z-steps-arrow-last{margin-left:-8px;padding-left:calc(16px + 1rem);border-radius:0 6px 6px 0;clip-path:polygon(0 0,100% 0,100% 100%,0 100%,16px 50%)}\n"] }]
|
|
388
|
+
}, template: "<ol\n [class]=\"containerClasses()\"\n [class.rounded-md]=\"effectiveOrientation() === 'horizontal' && (zType() === 'inline' || zType() === 'dot')\"\n [class.border]=\"effectiveOrientation() === 'horizontal' && (zType() === 'inline' || zType() === 'dot')\"\n [class.border-border/70]=\"effectiveOrientation() === 'horizontal' && (zType() === 'inline' || zType() === 'dot')\"\n [class.bg-muted/20]=\"effectiveOrientation() === 'horizontal' && (zType() === 'inline' || zType() === 'dot')\"\n [class.p-2]=\"effectiveOrientation() === 'horizontal' && (zType() === 'inline' || zType() === 'dot')\">\n @for (step of mergedSteps(); track $index; let i = $index; let last = $last) {\n @if (effectiveOrientation() === 'vertical') {\n @if (zType() === 'dot') {\n <!-- Vertical Dot Layout -->\n <li\n class=\"flex items-start gap-3\"\n [class.cursor-pointer]=\"zClickable() && !step.disabled\"\n [class.cursor-not-allowed]=\"step.disabled\"\n [class.opacity-50]=\"step.disabled\"\n (click)=\"onStepClick(i)\">\n <!-- Dot + Line Column -->\n <div class=\"flex w-10 shrink-0 flex-col items-center\">\n <!-- Dot -->\n <span [class]=\"getDotClassesByIndex()[i]\" class=\"shrink-0\"></span>\n <!-- Vertical Line -->\n @if (!last) {\n <div\n class=\"my-1 h-10 w-[0.125rem] rounded-full\"\n [class.bg-primary]=\"stepStatuses()[i] === 'completed'\"\n [class.bg-destructive/40]=\"stepStatuses()[i] === 'error'\"\n [class.bg-muted-foreground/30]=\"\n stepStatuses()[i] !== 'completed' && stepStatuses()[i] !== 'error'\n \"></div>\n }\n </div>\n\n <!-- Content (optional) -->\n @if (step.title) {\n <span\n class=\"pt-0.5 text-sm\"\n [class.text-foreground]=\"stepStatuses()[i] === 'current'\"\n [class.font-medium]=\"stepStatuses()[i] === 'current'\"\n [class.text-muted-foreground]=\"stepStatuses()[i] !== 'current'\">\n {{ step.title }}\n </span>\n }\n </li>\n } @else {\n <!-- Vertical Layout -->\n <li\n class=\"flex items-start gap-3\"\n [class.cursor-pointer]=\"zClickable() && !step.disabled\"\n [class.cursor-not-allowed]=\"step.disabled\"\n [class.opacity-50]=\"step.disabled\"\n (click)=\"onStepClick(i)\">\n <div class=\"flex w-10 shrink-0 flex-col items-center\">\n <!-- Step Icon -->\n <span [class]=\"iconClassesMap().get(i)\" class=\"relative! start-auto!\">\n @switch (stepStatuses()[i]) {\n @case ('completed') {\n @if (step.icon) {\n <z-icon [zType]=\"step.icon\" [zSize]=\"getIconSizeByIndex()[i]\" />\n } @else {\n <z-icon zType=\"lucideCheck\" [zSize]=\"getIconSizeByIndex()[i]\" />\n }\n }\n @case ('error') {\n <z-icon zType=\"lucideX\" [zSize]=\"getIconSizeByIndex()[i]\" />\n }\n @default {\n @if (step.icon) {\n <z-icon [zType]=\"step.icon\" [zSize]=\"getIconSizeByIndex()[i]\" />\n } @else if (zShowNumber()) {\n <span class=\"font-medium\">{{ i + 1 }}</span>\n }\n }\n }\n </span>\n\n <!-- Vertical Line -->\n @if (!last) {\n <div\n class=\"my-1 h-10 w-[0.125rem] rounded-full\"\n [class.bg-primary]=\"stepStatuses()[i] === 'completed'\"\n [class.bg-destructive/40]=\"stepStatuses()[i] === 'error'\"\n [class.bg-muted-foreground/30]=\"\n stepStatuses()[i] !== 'completed' && stepStatuses()[i] !== 'error'\n \"></div>\n }\n </div>\n\n <!-- Content -->\n @if (step.title || step.description) {\n <div class=\"min-w-0 flex-1 pt-1 pb-3\">\n @if (step.title) {\n <h3 class=\"leading-tight font-medium\">{{ step.title }}</h3>\n }\n @if (step.description) {\n <p class=\"text-muted-foreground mt-1 text-sm\">{{ step.description }}</p>\n }\n </div>\n }\n </li>\n }\n } @else {\n <!-- Horizontal Layout -->\n <li\n [class]=\"zType() === 'arrow' ? 'flex-1' : 'flex-1 last:flex-none'\"\n [class.cursor-pointer]=\"zClickable() && !step.disabled\"\n [class.cursor-not-allowed]=\"step.disabled\"\n [class.opacity-50]=\"step.disabled\"\n (click)=\"onStepClick(i)\">\n @if (zType() === 'arrow') {\n <!-- Arrow Style -->\n <div [class]=\"getArrowClassesByIndex()[i]\">\n <div class=\"flex items-center gap-3.5\">\n @if (step.icon) {\n <z-icon [zType]=\"step.icon\" [zSize]=\"getIconSizeByIndex()[i]\" class=\"shrink-0\" />\n }\n <div class=\"flex min-w-0 flex-col\">\n @if (step.title) {\n <h3\n z-tooltip\n [zContent]=\"step.title\"\n [zAutoDetect]=\"true\"\n zPosition=\"top\"\n class=\"truncate text-sm leading-tight font-semibold whitespace-nowrap\">\n {{ step.title }}\n </h3>\n }\n @if (step.description) {\n <p\n z-tooltip\n [zContent]=\"step.description\"\n [zAutoDetect]=\"true\"\n zPosition=\"bottom\"\n class=\"mt-1 truncate text-xs whitespace-nowrap opacity-80\">\n {{ step.description }}\n </p>\n }\n </div>\n </div>\n </div>\n } @else if (zType() === 'dot') {\n <!-- Dot Style: Simple dots with optional labels -->\n <div class=\"flex items-center\">\n <!-- Dot -->\n <span [class]=\"getDotClassesByIndex()[i]\"></span>\n\n <!-- Content (optional) -->\n @if (step.title) {\n <span\n z-tooltip\n [zContent]=\"step.title\"\n [zAutoDetect]=\"true\"\n zPosition=\"top\"\n class=\"ms-2 max-w-24 truncate text-sm whitespace-nowrap\"\n [class.text-foreground]=\"stepStatuses()[i] === 'current'\"\n [class.font-medium]=\"stepStatuses()[i] === 'current'\"\n [class.text-muted-foreground]=\"stepStatuses()[i] !== 'current'\">\n {{ step.title }}\n </span>\n }\n\n <!-- Horizontal Line -->\n @if (!last) {\n <div\n class=\"mx-3 h-[0.1875rem] min-w-8 flex-1 rounded-full\"\n [class.bg-primary]=\"stepStatuses()[i] === 'completed'\"\n [class.bg-destructive/40]=\"stepStatuses()[i] === 'error'\"\n [class.bg-muted-foreground/25]=\"\n stepStatuses()[i] !== 'completed' && stepStatuses()[i] !== 'error'\n \"></div>\n }\n </div>\n } @else if (zType() === 'inline') {\n <!-- Inline: Icon + Content + Line in one row -->\n <div class=\"flex items-center\">\n <div class=\"flex min-w-0 flex-1 items-center gap-2.5 px-2.5 py-2\">\n <!-- Step Icon -->\n <span [class]=\"iconClassesMap().get(i)\" class=\"relative! start-auto! shrink-0\">\n @switch (stepStatuses()[i]) {\n @case ('completed') {\n @if (step.icon) {\n <z-icon [zType]=\"step.icon\" [zSize]=\"getIconSizeByIndex()[i]\" />\n } @else {\n <z-icon zType=\"lucideCheck\" [zSize]=\"getIconSizeByIndex()[i]\" />\n }\n }\n @case ('error') {\n <z-icon zType=\"lucideX\" [zSize]=\"getIconSizeByIndex()[i]\" />\n }\n @default {\n @if (step.icon) {\n <z-icon [zType]=\"step.icon\" [zSize]=\"getIconSizeByIndex()[i]\" />\n } @else if (zShowNumber()) {\n <span class=\"font-medium\">{{ i + 1 }}</span>\n }\n }\n }\n </span>\n\n <!-- Content Inline -->\n @if (step.title || step.description) {\n <div class=\"min-w-0 flex-1\">\n @if (step.title) {\n <h3\n z-tooltip\n [zContent]=\"step.title\"\n [zAutoDetect]=\"true\"\n zPosition=\"top\"\n class=\"truncate text-sm leading-tight font-medium whitespace-nowrap\">\n {{ step.title }}\n </h3>\n }\n @if (step.description) {\n <p\n z-tooltip\n [zContent]=\"step.description\"\n [zAutoDetect]=\"true\"\n zPosition=\"bottom\"\n class=\"text-muted-foreground mt-1 truncate text-xs whitespace-nowrap\">\n {{ step.description }}\n </p>\n }\n </div>\n }\n </div>\n\n <!-- Horizontal Line -->\n @if (!last) {\n <div\n class=\"mx-3 h-[0.1875rem] min-w-8 flex-1 rounded-full\"\n [class.bg-primary]=\"stepStatuses()[i] === 'completed'\"\n [class.bg-destructive/40]=\"stepStatuses()[i] === 'error'\"\n [class.bg-muted-foreground/25]=\"\n stepStatuses()[i] !== 'completed' && stepStatuses()[i] !== 'error'\n \"></div>\n }\n </div>\n } @else {\n <!-- Default: Icon + Line row, Content below -->\n <div class=\"flex items-center\">\n <!-- Step Icon -->\n <span [class]=\"iconClassesMap().get(i)\" class=\"relative! start-auto! shrink-0\">\n @switch (stepStatuses()[i]) {\n @case ('completed') {\n @if (step.icon) {\n <z-icon [zType]=\"step.icon\" [zSize]=\"getIconSizeByIndex()[i]\" />\n } @else {\n <z-icon zType=\"lucideCheck\" [zSize]=\"getIconSizeByIndex()[i]\" />\n }\n }\n @case ('error') {\n <z-icon zType=\"lucideX\" [zSize]=\"getIconSizeByIndex()[i]\" />\n }\n @default {\n @if (step.icon) {\n <z-icon [zType]=\"step.icon\" [zSize]=\"getIconSizeByIndex()[i]\" />\n } @else if (zShowNumber()) {\n <span class=\"font-medium\">{{ i + 1 }}</span>\n }\n }\n }\n </span>\n\n <!-- Horizontal Line -->\n @if (!last) {\n <div [class]=\"getConnectorClassesByIndex()[i]\"></div>\n }\n </div>\n\n <!-- Content Below -->\n @if (step.title || step.description) {\n <div\n class=\"z-steps-content mt-3 flex flex-col text-center\"\n [style.width.px]=\"150\"\n [style.margin-left.px]=\"(iconWidth() - 150) / 2\">\n @if (step.title) {\n <h3\n z-tooltip\n [zContent]=\"step.title\"\n [zAutoDetect]=\"true\"\n zPosition=\"top\"\n class=\"truncate text-sm leading-tight font-medium whitespace-nowrap\">\n {{ step.title }}\n </h3>\n }\n @if (step.description) {\n <p\n z-tooltip\n [zContent]=\"step.description\"\n [zAutoDetect]=\"true\"\n zPosition=\"bottom\"\n class=\"text-muted-foreground mt-1 truncate text-xs whitespace-nowrap\">\n {{ step.description }}\n </p>\n }\n </div>\n }\n }\n </li>\n }\n }\n</ol>\n", styles: ["z-steps ol li:not(:last-child)>div[class*=border-s]{height:calc(100% + 2rem)}z-steps ol li[class*=mb-6]:not(:last-child)>div[class*=border-s]{height:calc(100% + 1.5rem)}z-steps ol li[class*=mb-10]:not(:last-child)>div[class*=border-s]{height:calc(100% + 2.5rem)}z-steps .z-steps-arrow-item{position:relative;display:flex;flex-direction:column;justify-content:center;transition:all .2s ease-out}z-steps .z-steps-arrow-item:hover{filter:brightness(.92)}z-steps .z-steps-arrow-first{border-radius:.375rem 0 0 .375rem;clip-path:polygon(0 0,calc(100% - 16px) 0,100% 50%,calc(100% - 16px) 100%,0 100%)}z-steps .z-steps-arrow-middle{margin-left:-.5rem;padding-left:2rem;clip-path:polygon(0 0,calc(100% - 16px) 0,100% 50%,calc(100% - 16px) 100%,0 100%,16px 50%)}z-steps .z-steps-arrow-last{margin-left:-.5rem;padding-left:2rem;border-radius:0 .375rem .375rem 0;clip-path:polygon(0 0,100% 0,100% 100%,0 100%,16px 50%)}\n"] }]
|
|
387
389
|
}], propDecorators: { zOnStepClick: [{ type: i0.Output, args: ["zOnStepClick"] }], zControl: [{ type: i0.Output, args: ["zControl"] }], class: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }], zSteps: [{ type: i0.Input, args: [{ isSignal: true, alias: "zSteps", required: true }] }], zCurrent: [{ type: i0.Input, args: [{ isSignal: true, alias: "zCurrent", required: false }] }], zOrientation: [{ type: i0.Input, args: [{ isSignal: true, alias: "zOrientation", required: false }] }], zType: [{ type: i0.Input, args: [{ isSignal: true, alias: "zType", required: false }] }], zSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "zSize", required: false }] }], zClickable: [{ type: i0.Input, args: [{ isSignal: true, alias: "zClickable", required: false }] }], zShowNumber: [{ type: i0.Input, args: [{ isSignal: true, alias: "zShowNumber", required: false }] }], zResponsive: [{ type: i0.Input, args: [{ isSignal: true, alias: "zResponsive", required: false }] }], zDisabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "zDisabled", required: false }] }] } });
|
|
388
390
|
|
|
389
391
|
/**
|