@shival99/z-ui 2.6.8 → 2.6.9
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/fesm2022/shival99-z-ui-components-z-autocomplete.mjs +1211 -0
- package/fesm2022/shival99-z-ui-components-z-autocomplete.mjs.map +1 -0
- package/fesm2022/shival99-z-ui-components-z-drawer.mjs +991 -0
- package/fesm2022/shival99-z-ui-components-z-drawer.mjs.map +1 -0
- package/fesm2022/shival99-z-ui-components-z-dropdown-menu.mjs +99 -0
- package/fesm2022/shival99-z-ui-components-z-dropdown-menu.mjs.map +1 -0
- package/fesm2022/shival99-z-ui-components-z-filter.mjs +962 -0
- package/fesm2022/shival99-z-ui-components-z-filter.mjs.map +1 -0
- package/fesm2022/shival99-z-ui-components-z-number-ticker.mjs +352 -0
- package/fesm2022/shival99-z-ui-components-z-number-ticker.mjs.map +1 -0
- package/fesm2022/shival99-z-ui-components-z-pagination.mjs +179 -0
- package/fesm2022/shival99-z-ui-components-z-pagination.mjs.map +1 -0
- package/fesm2022/shival99-z-ui-components-z-qrcode.mjs +429 -0
- package/fesm2022/shival99-z-ui-components-z-qrcode.mjs.map +1 -0
- package/fesm2022/shival99-z-ui-components-z-radio.mjs +183 -0
- package/fesm2022/shival99-z-ui-components-z-radio.mjs.map +1 -0
- package/fesm2022/shival99-z-ui-components-z-scrollarea.mjs +137 -0
- package/fesm2022/shival99-z-ui-components-z-scrollarea.mjs.map +1 -0
- package/fesm2022/shival99-z-ui-components-z-show-more.mjs +138 -0
- package/fesm2022/shival99-z-ui-components-z-show-more.mjs.map +1 -0
- package/fesm2022/shival99-z-ui-components-z-skeleton-auto.mjs +80 -0
- package/fesm2022/shival99-z-ui-components-z-skeleton-auto.mjs.map +1 -0
- package/fesm2022/shival99-z-ui-components-z-steps.mjs +420 -0
- package/fesm2022/shival99-z-ui-components-z-steps.mjs.map +1 -0
- package/fesm2022/shival99-z-ui-components-z-table.mjs +11424 -0
- package/fesm2022/shival99-z-ui-components-z-table.mjs.map +1 -0
- package/fesm2022/shival99-z-ui-components-z-tabs.mjs +1102 -0
- package/fesm2022/shival99-z-ui-components-z-tabs.mjs.map +1 -0
- package/fesm2022/shival99-z-ui-components-z-tags.mjs +364 -0
- package/fesm2022/shival99-z-ui-components-z-tags.mjs.map +1 -0
- package/fesm2022/shival99-z-ui-components-z-timeline.mjs +254 -0
- package/fesm2022/shival99-z-ui-components-z-timeline.mjs.map +1 -0
- package/fesm2022/shival99-z-ui-services-excel.mjs +672 -0
- package/fesm2022/shival99-z-ui-services-excel.mjs.map +1 -0
- package/package.json +1 -1
- package/types/shival99-z-ui-components-z-autocomplete.d.ts +301 -0
- package/types/shival99-z-ui-components-z-drawer.d.ts +298 -0
- package/types/shival99-z-ui-components-z-dropdown-menu.d.ts +52 -0
- package/types/shival99-z-ui-components-z-filter.d.ts +285 -0
- package/types/shival99-z-ui-components-z-modal.d.ts +1 -1
- package/types/shival99-z-ui-components-z-number-ticker.d.ts +110 -0
- package/types/shival99-z-ui-components-z-pagination.d.ts +55 -0
- package/types/shival99-z-ui-components-z-qrcode.d.ts +79 -0
- package/types/shival99-z-ui-components-z-radio.d.ts +69 -0
- package/types/shival99-z-ui-components-z-scrollarea.d.ts +48 -0
- package/types/shival99-z-ui-components-z-show-more.d.ts +36 -0
- package/types/shival99-z-ui-components-z-skeleton-auto.d.ts +35 -0
- package/types/shival99-z-ui-components-z-steps.d.ts +106 -0
- package/types/shival99-z-ui-components-z-table.d.ts +2386 -0
- package/types/shival99-z-ui-components-z-tabs.d.ts +196 -0
- package/types/shival99-z-ui-components-z-tags.d.ts +127 -0
- package/types/shival99-z-ui-components-z-timeline.d.ts +71 -0
- package/types/shival99-z-ui-services-excel.d.ts +36 -0
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { input, computed, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
|
+
import { ZSkeletonComponent } from '@shival99/z-ui/components/z-skeleton';
|
|
4
|
+
import { zTransform, zMergeClasses } from '@shival99/z-ui/utils';
|
|
5
|
+
import { SkeletonComponent } from 'boneyard-js/angular';
|
|
6
|
+
|
|
7
|
+
class ZSkeletonAutoComponent {
|
|
8
|
+
class = input('', /* @ts-ignore */
|
|
9
|
+
...(ngDevMode ? [{ debugName: "class" }] : /* istanbul ignore next */ []));
|
|
10
|
+
zLoading = input(false, { ...(ngDevMode ? { debugName: "zLoading" } : /* istanbul ignore next */ {}), transform: zTransform });
|
|
11
|
+
zName = input('z-skeleton-auto', /* @ts-ignore */
|
|
12
|
+
...(ngDevMode ? [{ debugName: "zName" }] : /* istanbul ignore next */ []));
|
|
13
|
+
zColor = input('#e0e0e0', /* @ts-ignore */
|
|
14
|
+
...(ngDevMode ? [{ debugName: "zColor" }] : /* istanbul ignore next */ []));
|
|
15
|
+
zDarkColor = input('#374151', /* @ts-ignore */
|
|
16
|
+
...(ngDevMode ? [{ debugName: "zDarkColor" }] : /* istanbul ignore next */ []));
|
|
17
|
+
zAnimate = input('shimmer', /* @ts-ignore */
|
|
18
|
+
...(ngDevMode ? [{ debugName: "zAnimate" }] : /* istanbul ignore next */ []));
|
|
19
|
+
zWavePreset = input('legacy-strong', /* @ts-ignore */
|
|
20
|
+
...(ngDevMode ? [{ debugName: "zWavePreset" }] : /* istanbul ignore next */ []));
|
|
21
|
+
zWaveDuration = input(1.5, /* @ts-ignore */
|
|
22
|
+
...(ngDevMode ? [{ debugName: "zWaveDuration" }] : /* istanbul ignore next */ []));
|
|
23
|
+
zInitialBones = input(undefined, /* @ts-ignore */
|
|
24
|
+
...(ngDevMode ? [{ debugName: "zInitialBones" }] : /* istanbul ignore next */ []));
|
|
25
|
+
zStagger = input(false, /* @ts-ignore */
|
|
26
|
+
...(ngDevMode ? [{ debugName: "zStagger" }] : /* istanbul ignore next */ []));
|
|
27
|
+
zTransition = input(false, /* @ts-ignore */
|
|
28
|
+
...(ngDevMode ? [{ debugName: "zTransition" }] : /* istanbul ignore next */ []));
|
|
29
|
+
zBoneClass = input('', /* @ts-ignore */
|
|
30
|
+
...(ngDevMode ? [{ debugName: "zBoneClass" }] : /* istanbul ignore next */ []));
|
|
31
|
+
zFallbackRows = input(3, /* @ts-ignore */
|
|
32
|
+
...(ngDevMode ? [{ debugName: "zFallbackRows" }] : /* istanbul ignore next */ []));
|
|
33
|
+
zFallbackGap = input(8, /* @ts-ignore */
|
|
34
|
+
...(ngDevMode ? [{ debugName: "zFallbackGap" }] : /* istanbul ignore next */ []));
|
|
35
|
+
zFallbackRowHeight = input('12px', /* @ts-ignore */
|
|
36
|
+
...(ngDevMode ? [{ debugName: "zFallbackRowHeight" }] : /* istanbul ignore next */ []));
|
|
37
|
+
zFallbackRadius = input('var(--radius-sm)', /* @ts-ignore */
|
|
38
|
+
...(ngDevMode ? [{ debugName: "zFallbackRadius" }] : /* istanbul ignore next */ []));
|
|
39
|
+
containerClass = computed(() => zMergeClasses('block w-full', this.class()), /* @ts-ignore */
|
|
40
|
+
...(ngDevMode ? [{ debugName: "containerClass" }] : /* istanbul ignore next */ []));
|
|
41
|
+
effectiveAnimate = computed(() => {
|
|
42
|
+
if (this.zWavePreset() === 'legacy-strong') {
|
|
43
|
+
return false;
|
|
44
|
+
}
|
|
45
|
+
return this.zAnimate();
|
|
46
|
+
}, /* @ts-ignore */
|
|
47
|
+
...(ngDevMode ? [{ debugName: "effectiveAnimate" }] : /* istanbul ignore next */ []));
|
|
48
|
+
waveDurationStyle = computed(() => {
|
|
49
|
+
const seconds = this.zWaveDuration();
|
|
50
|
+
if (seconds <= 0) {
|
|
51
|
+
return '1.5s';
|
|
52
|
+
}
|
|
53
|
+
return `${seconds}s`;
|
|
54
|
+
}, /* @ts-ignore */
|
|
55
|
+
...(ngDevMode ? [{ debugName: "waveDurationStyle" }] : /* istanbul ignore next */ []));
|
|
56
|
+
resolvedBoneClass = computed(() => {
|
|
57
|
+
const presetClass = this.zWavePreset() === 'legacy-strong' ? 'z-skeleton-auto-bone-legacy' : '';
|
|
58
|
+
const merged = zMergeClasses(presetClass, this.zBoneClass());
|
|
59
|
+
if (!merged) {
|
|
60
|
+
return undefined;
|
|
61
|
+
}
|
|
62
|
+
return merged;
|
|
63
|
+
}, /* @ts-ignore */
|
|
64
|
+
...(ngDevMode ? [{ debugName: "resolvedBoneClass" }] : /* istanbul ignore next */ []));
|
|
65
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: ZSkeletonAutoComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
66
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.1.6", type: ZSkeletonAutoComponent, isStandalone: true, selector: "z-skeleton-auto", inputs: { class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null }, zLoading: { classPropertyName: "zLoading", publicName: "zLoading", isSignal: true, isRequired: false, transformFunction: null }, zName: { classPropertyName: "zName", publicName: "zName", isSignal: true, isRequired: false, transformFunction: null }, zColor: { classPropertyName: "zColor", publicName: "zColor", isSignal: true, isRequired: false, transformFunction: null }, zDarkColor: { classPropertyName: "zDarkColor", publicName: "zDarkColor", isSignal: true, isRequired: false, transformFunction: null }, zAnimate: { classPropertyName: "zAnimate", publicName: "zAnimate", isSignal: true, isRequired: false, transformFunction: null }, zWavePreset: { classPropertyName: "zWavePreset", publicName: "zWavePreset", isSignal: true, isRequired: false, transformFunction: null }, zWaveDuration: { classPropertyName: "zWaveDuration", publicName: "zWaveDuration", isSignal: true, isRequired: false, transformFunction: null }, zInitialBones: { classPropertyName: "zInitialBones", publicName: "zInitialBones", isSignal: true, isRequired: false, transformFunction: null }, zStagger: { classPropertyName: "zStagger", publicName: "zStagger", isSignal: true, isRequired: false, transformFunction: null }, zTransition: { classPropertyName: "zTransition", publicName: "zTransition", isSignal: true, isRequired: false, transformFunction: null }, zBoneClass: { classPropertyName: "zBoneClass", publicName: "zBoneClass", isSignal: true, isRequired: false, transformFunction: null }, zFallbackRows: { classPropertyName: "zFallbackRows", publicName: "zFallbackRows", isSignal: true, isRequired: false, transformFunction: null }, zFallbackGap: { classPropertyName: "zFallbackGap", publicName: "zFallbackGap", isSignal: true, isRequired: false, transformFunction: null }, zFallbackRowHeight: { classPropertyName: "zFallbackRowHeight", publicName: "zFallbackRowHeight", isSignal: true, isRequired: false, transformFunction: null }, zFallbackRadius: { classPropertyName: "zFallbackRadius", publicName: "zFallbackRadius", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "style.--z-skeleton-auto-wave-duration": "waveDurationStyle()" } }, ngImport: i0, template: "<boneyard-skeleton\n [loading]=\"zLoading()\"\n [name]=\"zName()\"\n [initialBones]=\"zInitialBones()\"\n [color]=\"zColor()\"\n [darkColor]=\"zDarkColor()\"\n [animate]=\"effectiveAnimate()\"\n [stagger]=\"zStagger()\"\n [transition]=\"zTransition()\"\n [boneClass]=\"resolvedBoneClass()\"\n [cssClass]=\"containerClass()\">\n <ng-content />\n\n <div fallback class=\"w-full\">\n <z-skeleton\n zType=\"text\"\n class=\"w-full\"\n [zRows]=\"zFallbackRows()\"\n [zGap]=\"zFallbackGap()\"\n [zHeight]=\"zFallbackRowHeight()\"\n [zRadius]=\"zFallbackRadius()\" />\n </div>\n</boneyard-skeleton>\n", styles: [":host{display:block}:host ::ng-deep .z-skeleton-auto-bone-legacy{position:relative;overflow:hidden}:host ::ng-deep .z-skeleton-auto-bone-legacy:after{content:\"\";position:absolute;inset:0;background:linear-gradient(90deg,transparent 0%,rgba(255,255,255,.42) 50%,transparent 100%);animation:z-skeleton-auto-legacy-wave var(--z-skeleton-auto-wave-duration, 1.5s) infinite}:host-context(.dark) ::ng-deep .z-skeleton-auto-bone-legacy:after{background:linear-gradient(90deg,transparent 0%,rgba(255,255,255,.24) 50%,transparent 100%)}@keyframes z-skeleton-auto-legacy-wave{0%{transform:translate(-100%)}to{transform:translate(100%)}}\n"], dependencies: [{ kind: "component", type: SkeletonComponent, selector: "boneyard-skeleton", inputs: ["loading", "name", "initialBones", "color", "darkColor", "animate", "stagger", "transition", "boneClass", "cssClass", "snapshotConfig", "select"] }, { kind: "component", type: ZSkeletonComponent, selector: "z-skeleton", inputs: ["class", "zType", "zSize", "zWidth", "zHeight", "zRows", "zGap", "zAnimated", "zRadius"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
67
|
+
}
|
|
68
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: ZSkeletonAutoComponent, decorators: [{
|
|
69
|
+
type: Component,
|
|
70
|
+
args: [{ selector: 'z-skeleton-auto', imports: [SkeletonComponent, ZSkeletonComponent], standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, host: {
|
|
71
|
+
'[style.--z-skeleton-auto-wave-duration]': 'waveDurationStyle()',
|
|
72
|
+
}, template: "<boneyard-skeleton\n [loading]=\"zLoading()\"\n [name]=\"zName()\"\n [initialBones]=\"zInitialBones()\"\n [color]=\"zColor()\"\n [darkColor]=\"zDarkColor()\"\n [animate]=\"effectiveAnimate()\"\n [stagger]=\"zStagger()\"\n [transition]=\"zTransition()\"\n [boneClass]=\"resolvedBoneClass()\"\n [cssClass]=\"containerClass()\">\n <ng-content />\n\n <div fallback class=\"w-full\">\n <z-skeleton\n zType=\"text\"\n class=\"w-full\"\n [zRows]=\"zFallbackRows()\"\n [zGap]=\"zFallbackGap()\"\n [zHeight]=\"zFallbackRowHeight()\"\n [zRadius]=\"zFallbackRadius()\" />\n </div>\n</boneyard-skeleton>\n", styles: [":host{display:block}:host ::ng-deep .z-skeleton-auto-bone-legacy{position:relative;overflow:hidden}:host ::ng-deep .z-skeleton-auto-bone-legacy:after{content:\"\";position:absolute;inset:0;background:linear-gradient(90deg,transparent 0%,rgba(255,255,255,.42) 50%,transparent 100%);animation:z-skeleton-auto-legacy-wave var(--z-skeleton-auto-wave-duration, 1.5s) infinite}:host-context(.dark) ::ng-deep .z-skeleton-auto-bone-legacy:after{background:linear-gradient(90deg,transparent 0%,rgba(255,255,255,.24) 50%,transparent 100%)}@keyframes z-skeleton-auto-legacy-wave{0%{transform:translate(-100%)}to{transform:translate(100%)}}\n"] }]
|
|
73
|
+
}], propDecorators: { class: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }], zLoading: [{ type: i0.Input, args: [{ isSignal: true, alias: "zLoading", required: false }] }], zName: [{ type: i0.Input, args: [{ isSignal: true, alias: "zName", required: false }] }], zColor: [{ type: i0.Input, args: [{ isSignal: true, alias: "zColor", required: false }] }], zDarkColor: [{ type: i0.Input, args: [{ isSignal: true, alias: "zDarkColor", required: false }] }], zAnimate: [{ type: i0.Input, args: [{ isSignal: true, alias: "zAnimate", required: false }] }], zWavePreset: [{ type: i0.Input, args: [{ isSignal: true, alias: "zWavePreset", required: false }] }], zWaveDuration: [{ type: i0.Input, args: [{ isSignal: true, alias: "zWaveDuration", required: false }] }], zInitialBones: [{ type: i0.Input, args: [{ isSignal: true, alias: "zInitialBones", required: false }] }], zStagger: [{ type: i0.Input, args: [{ isSignal: true, alias: "zStagger", required: false }] }], zTransition: [{ type: i0.Input, args: [{ isSignal: true, alias: "zTransition", required: false }] }], zBoneClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "zBoneClass", required: false }] }], zFallbackRows: [{ type: i0.Input, args: [{ isSignal: true, alias: "zFallbackRows", required: false }] }], zFallbackGap: [{ type: i0.Input, args: [{ isSignal: true, alias: "zFallbackGap", required: false }] }], zFallbackRowHeight: [{ type: i0.Input, args: [{ isSignal: true, alias: "zFallbackRowHeight", required: false }] }], zFallbackRadius: [{ type: i0.Input, args: [{ isSignal: true, alias: "zFallbackRadius", required: false }] }] } });
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* Generated bundle index. Do not edit.
|
|
77
|
+
*/
|
|
78
|
+
|
|
79
|
+
export { ZSkeletonAutoComponent };
|
|
80
|
+
//# sourceMappingURL=shival99-z-ui-components-z-skeleton-auto.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shival99-z-ui-components-z-skeleton-auto.mjs","sources":["../../../../libs/core-ui/components/z-skeleton-auto/z-skeleton-auto.component.ts","../../../../libs/core-ui/components/z-skeleton-auto/z-skeleton-auto.component.html","../../../../libs/core-ui/components/z-skeleton-auto/shival99-z-ui-components-z-skeleton-auto.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, computed, input } from '@angular/core';\nimport { ZSkeletonComponent } from '@shival99/z-ui/components/z-skeleton';\nimport { zMergeClasses, zTransform } from '@shival99/z-ui/utils';\nimport { SkeletonComponent as BoneyardSkeletonComponent } from 'boneyard-js/angular';\nimport type { ClassValue } from 'clsx';\nimport type { ZSkeletonAutoAnimate, ZSkeletonAutoBones } from './z-skeleton-auto.types';\n\n@Component({\n selector: 'z-skeleton-auto',\n imports: [BoneyardSkeletonComponent, ZSkeletonComponent],\n standalone: true,\n templateUrl: './z-skeleton-auto.component.html',\n styleUrl: './z-skeleton-auto.component.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n '[style.--z-skeleton-auto-wave-duration]': 'waveDurationStyle()',\n },\n})\nexport class ZSkeletonAutoComponent {\n public readonly class = input<ClassValue>('');\n public readonly zLoading = input(false, { transform: zTransform });\n public readonly zName = input<string>('z-skeleton-auto');\n\n public readonly zColor = input<string | undefined>('#e0e0e0');\n public readonly zDarkColor = input<string | undefined>('#374151');\n public readonly zAnimate = input<ZSkeletonAutoAnimate>('shimmer');\n public readonly zWavePreset = input<'boneyard' | 'legacy-strong'>('legacy-strong');\n public readonly zWaveDuration = input<number>(1.5);\n public readonly zInitialBones = input<ZSkeletonAutoBones | undefined>(undefined);\n public readonly zStagger = input<number | boolean>(false);\n public readonly zTransition = input<number | boolean>(false);\n public readonly zBoneClass = input<string>('');\n\n public readonly zFallbackRows = input<number>(3);\n public readonly zFallbackGap = input<number>(8);\n public readonly zFallbackRowHeight = input<string>('12px');\n public readonly zFallbackRadius = input<string>('var(--radius-sm)');\n\n protected readonly containerClass = computed(() => zMergeClasses('block w-full', this.class()));\n protected readonly effectiveAnimate = computed<ZSkeletonAutoAnimate>(() => {\n if (this.zWavePreset() === 'legacy-strong') {\n return false;\n }\n\n return this.zAnimate();\n });\n\n protected readonly waveDurationStyle = computed(() => {\n const seconds = this.zWaveDuration();\n if (seconds <= 0) {\n return '1.5s';\n }\n\n return `${seconds}s`;\n });\n\n protected readonly resolvedBoneClass = computed(() => {\n const presetClass = this.zWavePreset() === 'legacy-strong' ? 'z-skeleton-auto-bone-legacy' : '';\n const merged = zMergeClasses(presetClass, this.zBoneClass());\n if (!merged) {\n return undefined;\n }\n\n return merged;\n });\n}\n","<boneyard-skeleton\n [loading]=\"zLoading()\"\n [name]=\"zName()\"\n [initialBones]=\"zInitialBones()\"\n [color]=\"zColor()\"\n [darkColor]=\"zDarkColor()\"\n [animate]=\"effectiveAnimate()\"\n [stagger]=\"zStagger()\"\n [transition]=\"zTransition()\"\n [boneClass]=\"resolvedBoneClass()\"\n [cssClass]=\"containerClass()\">\n <ng-content />\n\n <div fallback class=\"w-full\">\n <z-skeleton\n zType=\"text\"\n class=\"w-full\"\n [zRows]=\"zFallbackRows()\"\n [zGap]=\"zFallbackGap()\"\n [zHeight]=\"zFallbackRowHeight()\"\n [zRadius]=\"zFallbackRadius()\" />\n </div>\n</boneyard-skeleton>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["BoneyardSkeletonComponent"],"mappings":";;;;;;MAkBa,sBAAsB,CAAA;IACjB,KAAK,GAAG,KAAK,CAAa,EAAE;8EAAC;IAC7B,QAAQ,GAAG,KAAK,CAAC,KAAK,gFAAI,SAAS,EAAE,UAAU,EAAA,CAAG;IAClD,KAAK,GAAG,KAAK,CAAS,iBAAiB;8EAAC;IAExC,MAAM,GAAG,KAAK,CAAqB,SAAS;+EAAC;IAC7C,UAAU,GAAG,KAAK,CAAqB,SAAS;mFAAC;IACjD,QAAQ,GAAG,KAAK,CAAu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
2
|
+
import { inject, ElementRef, DestroyRef, output, input, signal, computed, ViewEncapsulation, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
|
+
import { ZIconComponent } from '@shival99/z-ui/components/z-icon';
|
|
4
|
+
import { ZTooltipDirective } from '@shival99/z-ui/components/z-tooltip';
|
|
5
|
+
import { zTransform, zMergeClasses } from '@shival99/z-ui/utils';
|
|
6
|
+
import { cva } from 'class-variance-authority';
|
|
7
|
+
|
|
8
|
+
const zStepsContainerVariants = cva(['relative list-none m-0 p-0'], {
|
|
9
|
+
variants: {
|
|
10
|
+
orientation: {
|
|
11
|
+
vertical: 'text-foreground',
|
|
12
|
+
horizontal: 'flex items-center w-full',
|
|
13
|
+
},
|
|
14
|
+
},
|
|
15
|
+
defaultVariants: {
|
|
16
|
+
orientation: 'vertical',
|
|
17
|
+
},
|
|
18
|
+
});
|
|
19
|
+
const zStepsItemVariants = cva(['relative flex items-start'], {
|
|
20
|
+
variants: {
|
|
21
|
+
orientation: {
|
|
22
|
+
vertical: 'last:mb-0',
|
|
23
|
+
horizontal: 'flex-1 last:flex-none',
|
|
24
|
+
},
|
|
25
|
+
size: {
|
|
26
|
+
sm: 'mb-6 ps-10 min-h-6',
|
|
27
|
+
default: 'mb-8 ps-12 min-h-8',
|
|
28
|
+
lg: 'mb-10 ps-14 min-h-10',
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
compoundVariants: [{ orientation: 'horizontal', class: 'mb-0 ps-0 min-h-0' }],
|
|
32
|
+
defaultVariants: {
|
|
33
|
+
orientation: 'vertical',
|
|
34
|
+
size: 'default',
|
|
35
|
+
},
|
|
36
|
+
});
|
|
37
|
+
const zStepsIconVariants = cva([
|
|
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
|
+
], {
|
|
40
|
+
variants: {
|
|
41
|
+
size: {
|
|
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
|
+
},
|
|
46
|
+
status: {
|
|
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
|
+
},
|
|
52
|
+
},
|
|
53
|
+
defaultVariants: {
|
|
54
|
+
size: 'default',
|
|
55
|
+
status: 'pending',
|
|
56
|
+
},
|
|
57
|
+
});
|
|
58
|
+
const zStepsLineVariants = cva(['absolute border-s-2 border-input/80'], {
|
|
59
|
+
variants: {
|
|
60
|
+
size: {
|
|
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
|
+
},
|
|
65
|
+
},
|
|
66
|
+
defaultVariants: {
|
|
67
|
+
size: 'default',
|
|
68
|
+
},
|
|
69
|
+
});
|
|
70
|
+
const zStepsConnectorVariants = cva(['transition-colors duration-200'], {
|
|
71
|
+
variants: {
|
|
72
|
+
orientation: {
|
|
73
|
+
vertical: 'hidden',
|
|
74
|
+
horizontal: 'flex-1 h-1 mx-4 rounded-full',
|
|
75
|
+
},
|
|
76
|
+
status: {
|
|
77
|
+
pending: 'bg-input',
|
|
78
|
+
current: 'bg-input',
|
|
79
|
+
completed: 'bg-primary',
|
|
80
|
+
error: 'bg-destructive/30',
|
|
81
|
+
},
|
|
82
|
+
},
|
|
83
|
+
defaultVariants: {
|
|
84
|
+
orientation: 'vertical',
|
|
85
|
+
status: 'pending',
|
|
86
|
+
},
|
|
87
|
+
});
|
|
88
|
+
const zStepsArrowItemVariants = cva(['z-steps-arrow-item relative flex flex-1 flex-col justify-center transition-all duration-200'], {
|
|
89
|
+
variants: {
|
|
90
|
+
size: {
|
|
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
|
+
},
|
|
95
|
+
status: {
|
|
96
|
+
pending: 'bg-muted text-muted-foreground',
|
|
97
|
+
current: 'bg-primary text-primary-foreground z-steps-arrow-active',
|
|
98
|
+
completed: 'bg-primary text-primary-foreground z-steps-arrow-active',
|
|
99
|
+
error: 'bg-destructive text-destructive-foreground',
|
|
100
|
+
},
|
|
101
|
+
},
|
|
102
|
+
defaultVariants: {
|
|
103
|
+
size: 'default',
|
|
104
|
+
status: 'pending',
|
|
105
|
+
},
|
|
106
|
+
});
|
|
107
|
+
const zStepsDotVariants = cva(['rounded-full transition-all duration-200'], {
|
|
108
|
+
variants: {
|
|
109
|
+
size: {
|
|
110
|
+
sm: 'w-2 h-2',
|
|
111
|
+
default: 'w-2.5 h-2.5',
|
|
112
|
+
lg: 'w-3 h-3',
|
|
113
|
+
},
|
|
114
|
+
status: {
|
|
115
|
+
pending: 'bg-muted-foreground/30',
|
|
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
|
+
},
|
|
120
|
+
},
|
|
121
|
+
defaultVariants: {
|
|
122
|
+
size: 'default',
|
|
123
|
+
status: 'pending',
|
|
124
|
+
},
|
|
125
|
+
});
|
|
126
|
+
const zStepsDotLineVariants = cva(['transition-colors duration-200'], {
|
|
127
|
+
variants: {
|
|
128
|
+
orientation: {
|
|
129
|
+
vertical: 'w-[0.125rem] flex-1 min-h-14 rounded-full',
|
|
130
|
+
horizontal: 'h-[0.125rem] flex-1 rounded-full',
|
|
131
|
+
},
|
|
132
|
+
status: {
|
|
133
|
+
pending: 'bg-muted-foreground/20',
|
|
134
|
+
current: 'bg-muted-foreground/20',
|
|
135
|
+
completed: 'bg-primary',
|
|
136
|
+
error: 'bg-destructive/30',
|
|
137
|
+
},
|
|
138
|
+
},
|
|
139
|
+
defaultVariants: {
|
|
140
|
+
orientation: 'horizontal',
|
|
141
|
+
status: 'pending',
|
|
142
|
+
},
|
|
143
|
+
});
|
|
144
|
+
|
|
145
|
+
const RESPONSIVE_BREAKPOINT = 640;
|
|
146
|
+
class ZStepsComponent {
|
|
147
|
+
_elementRef = inject(ElementRef);
|
|
148
|
+
_destroyRef = inject(DestroyRef);
|
|
149
|
+
zOnStepClick = output();
|
|
150
|
+
zControl = output();
|
|
151
|
+
class = input('', /* @ts-ignore */
|
|
152
|
+
...(ngDevMode ? [{ debugName: "class" }] : /* istanbul ignore next */ []));
|
|
153
|
+
zSteps = input.required(/* @ts-ignore */
|
|
154
|
+
...(ngDevMode ? [{ debugName: "zSteps" }] : /* istanbul ignore next */ []));
|
|
155
|
+
zCurrent = input(0, /* @ts-ignore */
|
|
156
|
+
...(ngDevMode ? [{ debugName: "zCurrent" }] : /* istanbul ignore next */ []));
|
|
157
|
+
zOrientation = input('vertical', /* @ts-ignore */
|
|
158
|
+
...(ngDevMode ? [{ debugName: "zOrientation" }] : /* istanbul ignore next */ []));
|
|
159
|
+
zType = input('default', /* @ts-ignore */
|
|
160
|
+
...(ngDevMode ? [{ debugName: "zType" }] : /* istanbul ignore next */ []));
|
|
161
|
+
zSize = input('default', /* @ts-ignore */
|
|
162
|
+
...(ngDevMode ? [{ debugName: "zSize" }] : /* istanbul ignore next */ []));
|
|
163
|
+
zClickable = input(false, { ...(ngDevMode ? { debugName: "zClickable" } : /* istanbul ignore next */ {}), transform: zTransform });
|
|
164
|
+
zShowNumber = input(true, { ...(ngDevMode ? { debugName: "zShowNumber" } : /* istanbul ignore next */ {}), transform: zTransform });
|
|
165
|
+
zResponsive = input(true, { ...(ngDevMode ? { debugName: "zResponsive" } : /* istanbul ignore next */ {}), transform: zTransform });
|
|
166
|
+
zDisabled = input(false, { ...(ngDevMode ? { debugName: "zDisabled" } : /* istanbul ignore next */ {}), transform: zTransform });
|
|
167
|
+
_internalCurrent = signal(null, /* @ts-ignore */
|
|
168
|
+
...(ngDevMode ? [{ debugName: "_internalCurrent" }] : /* istanbul ignore next */ []));
|
|
169
|
+
_stepOverrides = signal(new Map(), /* @ts-ignore */
|
|
170
|
+
...(ngDevMode ? [{ debugName: "_stepOverrides" }] : /* istanbul ignore next */ []));
|
|
171
|
+
_resizeObserver = null;
|
|
172
|
+
isResponsiveVertical = signal(false, /* @ts-ignore */
|
|
173
|
+
...(ngDevMode ? [{ debugName: "isResponsiveVertical" }] : /* istanbul ignore next */ []));
|
|
174
|
+
currentStep = computed(() => this._internalCurrent() ?? this.zCurrent(), /* @ts-ignore */
|
|
175
|
+
...(ngDevMode ? [{ debugName: "currentStep" }] : /* istanbul ignore next */ []));
|
|
176
|
+
mergedSteps = computed(() => {
|
|
177
|
+
const steps = this.zSteps();
|
|
178
|
+
const overrides = this._stepOverrides();
|
|
179
|
+
return steps.map((step, index) => {
|
|
180
|
+
const override = overrides.get(index);
|
|
181
|
+
return override ? { ...step, ...override } : step;
|
|
182
|
+
});
|
|
183
|
+
}, /* @ts-ignore */
|
|
184
|
+
...(ngDevMode ? [{ debugName: "mergedSteps" }] : /* istanbul ignore next */ []));
|
|
185
|
+
effectiveOrientation = computed(() => {
|
|
186
|
+
if (this.zResponsive() && this.isResponsiveVertical()) {
|
|
187
|
+
return 'vertical';
|
|
188
|
+
}
|
|
189
|
+
return this.zOrientation();
|
|
190
|
+
}, /* @ts-ignore */
|
|
191
|
+
...(ngDevMode ? [{ debugName: "effectiveOrientation" }] : /* istanbul ignore next */ []));
|
|
192
|
+
containerClasses = computed(() => zMergeClasses(zStepsContainerVariants({
|
|
193
|
+
orientation: this.effectiveOrientation(),
|
|
194
|
+
}), this.class()), /* @ts-ignore */
|
|
195
|
+
...(ngDevMode ? [{ debugName: "containerClasses" }] : /* istanbul ignore next */ []));
|
|
196
|
+
getItemClasses = computed(() => zStepsItemVariants({
|
|
197
|
+
orientation: this.effectiveOrientation(),
|
|
198
|
+
size: this.zSize(),
|
|
199
|
+
}), /* @ts-ignore */
|
|
200
|
+
...(ngDevMode ? [{ debugName: "getItemClasses" }] : /* istanbul ignore next */ []));
|
|
201
|
+
iconClassesMap = computed(() => {
|
|
202
|
+
const size = this.zSize();
|
|
203
|
+
const steps = this.mergedSteps();
|
|
204
|
+
const current = this.currentStep();
|
|
205
|
+
const classMap = new Map();
|
|
206
|
+
steps.forEach((step, index) => {
|
|
207
|
+
const status = this._getStepStatus(step, index, current);
|
|
208
|
+
const baseClasses = zStepsIconVariants({ size, status });
|
|
209
|
+
classMap.set(index, zMergeClasses(baseClasses, step.iconClass));
|
|
210
|
+
});
|
|
211
|
+
return classMap;
|
|
212
|
+
}, /* @ts-ignore */
|
|
213
|
+
...(ngDevMode ? [{ debugName: "iconClassesMap" }] : /* istanbul ignore next */ []));
|
|
214
|
+
lineClasses = computed(() => zStepsLineVariants({ size: this.zSize() }), /* @ts-ignore */
|
|
215
|
+
...(ngDevMode ? [{ debugName: "lineClasses" }] : /* istanbul ignore next */ []));
|
|
216
|
+
getConnectorClassesByIndex = computed(() => {
|
|
217
|
+
const orientation = this.effectiveOrientation();
|
|
218
|
+
const steps = this.mergedSteps();
|
|
219
|
+
const current = this.currentStep();
|
|
220
|
+
return steps.map((step, index) => {
|
|
221
|
+
const status = this._getConnectorStatus(step, index, current);
|
|
222
|
+
return zStepsConnectorVariants({ orientation, status });
|
|
223
|
+
});
|
|
224
|
+
}, /* @ts-ignore */
|
|
225
|
+
...(ngDevMode ? [{ debugName: "getConnectorClassesByIndex" }] : /* istanbul ignore next */ []));
|
|
226
|
+
stepStatuses = computed(() => {
|
|
227
|
+
const steps = this.mergedSteps();
|
|
228
|
+
const current = this.currentStep();
|
|
229
|
+
return steps.map((step, index) => this._getStepStatus(step, index, current));
|
|
230
|
+
}, /* @ts-ignore */
|
|
231
|
+
...(ngDevMode ? [{ debugName: "stepStatuses" }] : /* istanbul ignore next */ []));
|
|
232
|
+
getArrowClassesByIndex = computed(() => {
|
|
233
|
+
const size = this.zSize();
|
|
234
|
+
const steps = this.mergedSteps();
|
|
235
|
+
const current = this.currentStep();
|
|
236
|
+
const total = steps.length;
|
|
237
|
+
return steps.map((step, index) => {
|
|
238
|
+
const status = this._getStepStatus(step, index, current);
|
|
239
|
+
const baseClasses = zStepsArrowItemVariants({ size, status });
|
|
240
|
+
let positionClass = 'z-steps-arrow-middle';
|
|
241
|
+
if (index === 0) {
|
|
242
|
+
positionClass = 'z-steps-arrow-first';
|
|
243
|
+
}
|
|
244
|
+
if (index === total - 1) {
|
|
245
|
+
positionClass = 'z-steps-arrow-last';
|
|
246
|
+
}
|
|
247
|
+
return zMergeClasses(baseClasses, positionClass);
|
|
248
|
+
});
|
|
249
|
+
}, /* @ts-ignore */
|
|
250
|
+
...(ngDevMode ? [{ debugName: "getArrowClassesByIndex" }] : /* istanbul ignore next */ []));
|
|
251
|
+
getDotClassesByIndex = computed(() => {
|
|
252
|
+
const size = this.zSize();
|
|
253
|
+
const steps = this.mergedSteps();
|
|
254
|
+
const current = this.currentStep();
|
|
255
|
+
return steps.map((step, index) => {
|
|
256
|
+
const status = this._getStepStatus(step, index, current);
|
|
257
|
+
return zStepsDotVariants({ size, status });
|
|
258
|
+
});
|
|
259
|
+
}, /* @ts-ignore */
|
|
260
|
+
...(ngDevMode ? [{ debugName: "getDotClassesByIndex" }] : /* istanbul ignore next */ []));
|
|
261
|
+
getDotLineClassesByIndex = computed(() => {
|
|
262
|
+
const orientation = this.effectiveOrientation();
|
|
263
|
+
const steps = this.mergedSteps();
|
|
264
|
+
const current = this.currentStep();
|
|
265
|
+
return steps.map((step, index) => {
|
|
266
|
+
const status = this._getConnectorStatus(step, index, current);
|
|
267
|
+
return zStepsDotLineVariants({ orientation, status });
|
|
268
|
+
});
|
|
269
|
+
}, /* @ts-ignore */
|
|
270
|
+
...(ngDevMode ? [{ debugName: "getDotLineClassesByIndex" }] : /* istanbul ignore next */ []));
|
|
271
|
+
defaultIconSize = computed(() => {
|
|
272
|
+
const size = this.zSize();
|
|
273
|
+
if (size === 'sm') {
|
|
274
|
+
return '16';
|
|
275
|
+
}
|
|
276
|
+
if (size === 'lg') {
|
|
277
|
+
return '24';
|
|
278
|
+
}
|
|
279
|
+
return '20';
|
|
280
|
+
}, /* @ts-ignore */
|
|
281
|
+
...(ngDevMode ? [{ debugName: "defaultIconSize" }] : /* istanbul ignore next */ []));
|
|
282
|
+
getIconSizeByIndex = computed(() => {
|
|
283
|
+
const defaultSize = this.defaultIconSize();
|
|
284
|
+
const steps = this.mergedSteps();
|
|
285
|
+
return steps.map(step => step.iconSize ?? defaultSize);
|
|
286
|
+
}, /* @ts-ignore */
|
|
287
|
+
...(ngDevMode ? [{ debugName: "getIconSizeByIndex" }] : /* istanbul ignore next */ []));
|
|
288
|
+
iconWidth = computed(() => {
|
|
289
|
+
const size = this.zSize();
|
|
290
|
+
if (size === 'sm') {
|
|
291
|
+
return 32;
|
|
292
|
+
}
|
|
293
|
+
if (size === 'lg') {
|
|
294
|
+
return 44;
|
|
295
|
+
}
|
|
296
|
+
return 36;
|
|
297
|
+
}, /* @ts-ignore */
|
|
298
|
+
...(ngDevMode ? [{ debugName: "iconWidth" }] : /* istanbul ignore next */ []));
|
|
299
|
+
ngAfterViewInit() {
|
|
300
|
+
if (this.zResponsive() && this.zOrientation() === 'horizontal') {
|
|
301
|
+
this._setupResizeObserver();
|
|
302
|
+
}
|
|
303
|
+
this._destroyRef.onDestroy(() => {
|
|
304
|
+
this._resizeObserver?.disconnect();
|
|
305
|
+
});
|
|
306
|
+
this.zControl.emit({
|
|
307
|
+
setActive: (index) => {
|
|
308
|
+
if (this.zDisabled()) {
|
|
309
|
+
return;
|
|
310
|
+
}
|
|
311
|
+
if (index >= 0 && index < this.zSteps().length) {
|
|
312
|
+
this._internalCurrent.set(index);
|
|
313
|
+
}
|
|
314
|
+
},
|
|
315
|
+
next: () => {
|
|
316
|
+
if (this.zDisabled()) {
|
|
317
|
+
return;
|
|
318
|
+
}
|
|
319
|
+
const current = this.currentStep();
|
|
320
|
+
const total = this.zSteps().length;
|
|
321
|
+
if (current < total - 1) {
|
|
322
|
+
this._internalCurrent.set(current + 1);
|
|
323
|
+
}
|
|
324
|
+
},
|
|
325
|
+
prev: () => {
|
|
326
|
+
if (this.zDisabled()) {
|
|
327
|
+
return;
|
|
328
|
+
}
|
|
329
|
+
const current = this.currentStep();
|
|
330
|
+
if (current > 0) {
|
|
331
|
+
this._internalCurrent.set(current - 1);
|
|
332
|
+
}
|
|
333
|
+
},
|
|
334
|
+
reset: () => {
|
|
335
|
+
if (this.zDisabled()) {
|
|
336
|
+
return;
|
|
337
|
+
}
|
|
338
|
+
this._internalCurrent.set(0);
|
|
339
|
+
this._stepOverrides.set(new Map());
|
|
340
|
+
},
|
|
341
|
+
setDisabled: (index, disabled) => {
|
|
342
|
+
if (this.zDisabled()) {
|
|
343
|
+
return;
|
|
344
|
+
}
|
|
345
|
+
this._updateStepOverride(index, { disabled });
|
|
346
|
+
},
|
|
347
|
+
setStatus: (index, status) => {
|
|
348
|
+
if (this.zDisabled()) {
|
|
349
|
+
return;
|
|
350
|
+
}
|
|
351
|
+
this._updateStepOverride(index, { status });
|
|
352
|
+
},
|
|
353
|
+
getCurrent: () => this.currentStep(),
|
|
354
|
+
getTotal: () => this.zSteps().length,
|
|
355
|
+
});
|
|
356
|
+
}
|
|
357
|
+
_updateStepOverride(index, override) {
|
|
358
|
+
const overrides = new Map(this._stepOverrides());
|
|
359
|
+
const existing = overrides.get(index) || {};
|
|
360
|
+
overrides.set(index, { ...existing, ...override });
|
|
361
|
+
this._stepOverrides.set(overrides);
|
|
362
|
+
}
|
|
363
|
+
_setupResizeObserver() {
|
|
364
|
+
const container = this._elementRef.nativeElement;
|
|
365
|
+
this._resizeObserver = new ResizeObserver(entries => {
|
|
366
|
+
const width = entries[0]?.contentRect.width || 0;
|
|
367
|
+
this.isResponsiveVertical.set(width < RESPONSIVE_BREAKPOINT);
|
|
368
|
+
});
|
|
369
|
+
this._resizeObserver.observe(container);
|
|
370
|
+
}
|
|
371
|
+
_getStepStatus(step, index, current) {
|
|
372
|
+
if (step.status) {
|
|
373
|
+
return step.status;
|
|
374
|
+
}
|
|
375
|
+
if (index < current) {
|
|
376
|
+
return 'completed';
|
|
377
|
+
}
|
|
378
|
+
if (index === current) {
|
|
379
|
+
return 'current';
|
|
380
|
+
}
|
|
381
|
+
return 'pending';
|
|
382
|
+
}
|
|
383
|
+
_getConnectorStatus(step, index, current) {
|
|
384
|
+
if (step.status === 'error') {
|
|
385
|
+
return 'error';
|
|
386
|
+
}
|
|
387
|
+
if (index < current) {
|
|
388
|
+
return 'completed';
|
|
389
|
+
}
|
|
390
|
+
return 'pending';
|
|
391
|
+
}
|
|
392
|
+
onStepClick(index) {
|
|
393
|
+
if (this.zDisabled()) {
|
|
394
|
+
return;
|
|
395
|
+
}
|
|
396
|
+
const step = this.zSteps()[index];
|
|
397
|
+
if (step.disabled) {
|
|
398
|
+
return;
|
|
399
|
+
}
|
|
400
|
+
if (!this.zClickable()) {
|
|
401
|
+
return;
|
|
402
|
+
}
|
|
403
|
+
this.zOnStepClick.emit(index);
|
|
404
|
+
}
|
|
405
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: ZStepsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
406
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.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:var(--radius-md) 0 0 var(--radius-md);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 var(--radius-md) var(--radius-md) 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", "zAnimatedType", "zAnimate", "zAnimationTrigger", "zSize", "zStrokeWidth", "zSvg"] }, { kind: "directive", type: ZTooltipDirective, selector: "[z-tooltip], [zTooltip]", inputs: ["zContent", "zContext", "zPosition", "zTooltipPosition", "zTrigger", "zTooltipTrigger", "zTooltipType", "zTooltipSize", "zClass", "zTooltipClass", "zShowDelay", "zTooltipShowDelay", "zHideDelay", "zTooltipHideDelay", "zArrow", "zTooltipArrow", "zDisabled", "zTooltipDisabled", "zOffset", "zTooltipOffset", "zAutoDetect", "zTriggerElement", "zAlwaysShow", "zMaxWidth"], outputs: ["zShow", "zHide"], exportAs: ["zTooltip"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
407
|
+
}
|
|
408
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: ZStepsComponent, decorators: [{
|
|
409
|
+
type: Component,
|
|
410
|
+
args: [{ selector: 'z-steps', imports: [ZIconComponent, ZTooltipDirective], changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, host: {
|
|
411
|
+
class: 'block',
|
|
412
|
+
}, 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:var(--radius-md) 0 0 var(--radius-md);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 var(--radius-md) var(--radius-md) 0;clip-path:polygon(0 0,100% 0,100% 100%,0 100%,16px 50%)}\n"] }]
|
|
413
|
+
}], 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 }] }] } });
|
|
414
|
+
|
|
415
|
+
/**
|
|
416
|
+
* Generated bundle index. Do not edit.
|
|
417
|
+
*/
|
|
418
|
+
|
|
419
|
+
export { ZStepsComponent, zStepsArrowItemVariants, zStepsConnectorVariants, zStepsContainerVariants, zStepsIconVariants, zStepsItemVariants, zStepsLineVariants };
|
|
420
|
+
//# sourceMappingURL=shival99-z-ui-components-z-steps.mjs.map
|