@shival99/z-ui 1.1.3 → 1.1.5
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-filter.mjs +1 -1
- package/fesm2022/shival99-z-ui-components-z-filter.mjs.map +1 -1
- package/fesm2022/shival99-z-ui-components-z-select.mjs +4 -0
- package/fesm2022/shival99-z-ui-components-z-select.mjs.map +1 -1
- package/fesm2022/shival99-z-ui-components-z-switch.mjs +19 -7
- package/fesm2022/shival99-z-ui-components-z-switch.mjs.map +1 -1
- package/fesm2022/shival99-z-ui-components-z-toast.mjs +14 -7
- package/fesm2022/shival99-z-ui-components-z-toast.mjs.map +1 -1
- package/package.json +1 -1
- package/types/shival99-z-ui-components-z-calendar.d.ts +4 -4
- package/types/shival99-z-ui-components-z-modal.d.ts +1 -1
- package/types/shival99-z-ui-components-z-switch.d.ts +3 -1
- package/types/shival99-z-ui-components-z-timeline.d.ts +6 -6
- package/types/shival99-z-ui-components-z-toast.d.ts +2 -0
- package/types/shival99-z-ui-components-z-upload.d.ts +3 -3
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { input, model, output, signal, computed, forwardRef, ViewEncapsulation, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
3
|
import { NG_VALUE_ACCESSOR } from '@angular/forms';
|
|
4
|
+
import { ZIconComponent } from '@shival99/z-ui/components/z-icon';
|
|
4
5
|
import { zTransform, zMergeClasses } from '@shival99/z-ui/utils';
|
|
5
6
|
import { cva } from 'class-variance-authority';
|
|
6
7
|
|
|
@@ -24,7 +25,7 @@ const zSwitchVariants = cva([
|
|
|
24
25
|
},
|
|
25
26
|
});
|
|
26
27
|
const zSwitchThumbVariants = cva([
|
|
27
|
-
'pointer-events-none
|
|
28
|
+
'pointer-events-none flex items-center justify-center rounded-full bg-white shadow-[0_2px_6px_rgba(0,0,0,0.2)] ring-0',
|
|
28
29
|
'transition-transform duration-200',
|
|
29
30
|
], {
|
|
30
31
|
variants: {
|
|
@@ -57,11 +58,12 @@ class ZSwitchComponent {
|
|
|
57
58
|
zLabel = input('', ...(ngDevMode ? [{ debugName: "zLabel" }] : []));
|
|
58
59
|
zText = input('', ...(ngDevMode ? [{ debugName: "zText" }] : []));
|
|
59
60
|
zDisabled = input(false, { ...(ngDevMode ? { debugName: "zDisabled" } : {}), transform: zTransform });
|
|
61
|
+
zLoading = input(false, { ...(ngDevMode ? { debugName: "zLoading" } : {}), transform: zTransform });
|
|
60
62
|
zTextPosition = input('right', ...(ngDevMode ? [{ debugName: "zTextPosition" }] : []));
|
|
61
63
|
zChecked = model(false, ...(ngDevMode ? [{ debugName: "zChecked" }] : []));
|
|
62
64
|
zChange = output();
|
|
63
65
|
_disabled = signal(false, ...(ngDevMode ? [{ debugName: "_disabled" }] : []));
|
|
64
|
-
isDisabled = computed(() => this.zDisabled() || this._disabled(), ...(ngDevMode ? [{ debugName: "isDisabled" }] : []));
|
|
66
|
+
isDisabled = computed(() => this.zDisabled() || this._disabled() || this.zLoading(), ...(ngDevMode ? [{ debugName: "isDisabled" }] : []));
|
|
65
67
|
hostClasses = computed(() => {
|
|
66
68
|
const hasLabel = !!this.zLabel();
|
|
67
69
|
if (hasLabel) {
|
|
@@ -73,6 +75,16 @@ class ZSwitchComponent {
|
|
|
73
75
|
thumbClasses = computed(() => zSwitchThumbVariants({ zSize: this.zSize() }), ...(ngDevMode ? [{ debugName: "thumbClasses" }] : []));
|
|
74
76
|
labelClasses = computed(() => zSwitchLabelVariants({ zSize: this.zSize() }), ...(ngDevMode ? [{ debugName: "labelClasses" }] : []));
|
|
75
77
|
switchState = computed(() => (this.zChecked() ? 'checked' : 'unchecked'), ...(ngDevMode ? [{ debugName: "switchState" }] : []));
|
|
78
|
+
loadingIconSize = computed(() => {
|
|
79
|
+
const size = this.zSize();
|
|
80
|
+
if (size === 'sm') {
|
|
81
|
+
return '10';
|
|
82
|
+
}
|
|
83
|
+
if (size === 'lg') {
|
|
84
|
+
return '16';
|
|
85
|
+
}
|
|
86
|
+
return '12';
|
|
87
|
+
}, ...(ngDevMode ? [{ debugName: "loadingIconSize" }] : []));
|
|
76
88
|
_onChange = () => { };
|
|
77
89
|
_onTouched = () => { };
|
|
78
90
|
writeValue(value) {
|
|
@@ -98,17 +110,17 @@ class ZSwitchComponent {
|
|
|
98
110
|
this._onTouched();
|
|
99
111
|
}
|
|
100
112
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: ZSwitchComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
101
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.6", type: ZSwitchComponent, isStandalone: true, selector: "z-switch", inputs: { class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null }, zSize: { classPropertyName: "zSize", publicName: "zSize", isSignal: true, isRequired: false, transformFunction: null }, zLabel: { classPropertyName: "zLabel", publicName: "zLabel", isSignal: true, isRequired: false, transformFunction: null }, zText: { classPropertyName: "zText", publicName: "zText", isSignal: true, isRequired: false, transformFunction: null }, zDisabled: { classPropertyName: "zDisabled", publicName: "zDisabled", isSignal: true, isRequired: false, transformFunction: null }, zTextPosition: { classPropertyName: "zTextPosition", publicName: "zTextPosition", isSignal: true, isRequired: false, transformFunction: null }, zChecked: { classPropertyName: "zChecked", publicName: "zChecked", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { zChecked: "zCheckedChange", zChange: "zChange" }, host: { properties: { "class": "hostClasses()" } }, providers: [
|
|
113
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.6", type: ZSwitchComponent, isStandalone: true, selector: "z-switch", inputs: { class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null }, zSize: { classPropertyName: "zSize", publicName: "zSize", isSignal: true, isRequired: false, transformFunction: null }, zLabel: { classPropertyName: "zLabel", publicName: "zLabel", isSignal: true, isRequired: false, transformFunction: null }, zText: { classPropertyName: "zText", publicName: "zText", isSignal: true, isRequired: false, transformFunction: null }, zDisabled: { classPropertyName: "zDisabled", publicName: "zDisabled", isSignal: true, isRequired: false, transformFunction: null }, zLoading: { classPropertyName: "zLoading", publicName: "zLoading", isSignal: true, isRequired: false, transformFunction: null }, zTextPosition: { classPropertyName: "zTextPosition", publicName: "zTextPosition", isSignal: true, isRequired: false, transformFunction: null }, zChecked: { classPropertyName: "zChecked", publicName: "zChecked", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { zChecked: "zCheckedChange", zChange: "zChange" }, host: { properties: { "class": "hostClasses()" } }, providers: [
|
|
102
114
|
{
|
|
103
115
|
provide: NG_VALUE_ACCESSOR,
|
|
104
116
|
useExisting: forwardRef(() => ZSwitchComponent),
|
|
105
117
|
multi: true,
|
|
106
118
|
},
|
|
107
|
-
], ngImport: i0, template: "<!-- Label above -->\n@if (zLabel()) {\n <label class=\"text-xs leading-none font-medium\">{{ zLabel() }}</label>\n}\n\n<div class=\"inline-flex items-center gap-3\">\n @if (zText() && zTextPosition() === 'left') {\n <label [class]=\"labelClasses()\" (click)=\"onSwitchClick()\">{{ zText() }}</label>\n }\n\n <button\n type=\"button\"\n role=\"switch\"\n [class]=\"switchClasses()\"\n [attr.aria-checked]=\"zChecked()\"\n [attr.data-state]=\"switchState()\"\n [disabled]=\"isDisabled()\"\n (click)=\"onSwitchClick()\">\n <span [class]=\"thumbClasses()\" [attr.data-state]=\"switchState()\"
|
|
119
|
+
], ngImport: i0, template: "<!-- Label above -->\n@if (zLabel()) {\n <label class=\"text-xs leading-none font-medium\">{{ zLabel() }}</label>\n}\n\n<div class=\"inline-flex items-center gap-3\">\n @if (zText() && zTextPosition() === 'left') {\n <label [class]=\"labelClasses()\" (click)=\"onSwitchClick()\">{{ zText() }}</label>\n }\n\n <button\n type=\"button\"\n role=\"switch\"\n [class]=\"switchClasses()\"\n [attr.aria-checked]=\"zChecked()\"\n [attr.data-state]=\"switchState()\"\n [attr.data-loading]=\"zLoading()\"\n [disabled]=\"isDisabled()\"\n (click)=\"onSwitchClick()\">\n <span [class]=\"thumbClasses()\" [attr.data-state]=\"switchState()\" [attr.data-loading]=\"zLoading()\">\n @if (zLoading()) {\n <z-icon zType=\"lucideLoader2\" [zSize]=\"loadingIconSize()\" class=\"text-muted-foreground animate-spin\" />\n }\n </span>\n </button>\n\n @if (zText() && zTextPosition() === 'right') {\n <label [class]=\"labelClasses()\" (click)=\"onSwitchClick()\">{{ zText() }}</label>\n }\n</div>\n", dependencies: [{ kind: "component", type: ZIconComponent, selector: "z-icon, [z-icon]", inputs: ["class", "zType", "zSize", "zStrokeWidth", "zSvg"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
108
120
|
}
|
|
109
121
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: ZSwitchComponent, decorators: [{
|
|
110
122
|
type: Component,
|
|
111
|
-
args: [{ selector: 'z-switch', imports: [], standalone: true, providers: [
|
|
123
|
+
args: [{ selector: 'z-switch', imports: [ZIconComponent], standalone: true, providers: [
|
|
112
124
|
{
|
|
113
125
|
provide: NG_VALUE_ACCESSOR,
|
|
114
126
|
useExisting: forwardRef(() => ZSwitchComponent),
|
|
@@ -116,8 +128,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImpor
|
|
|
116
128
|
},
|
|
117
129
|
], changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, host: {
|
|
118
130
|
'[class]': 'hostClasses()',
|
|
119
|
-
}, template: "<!-- Label above -->\n@if (zLabel()) {\n <label class=\"text-xs leading-none font-medium\">{{ zLabel() }}</label>\n}\n\n<div class=\"inline-flex items-center gap-3\">\n @if (zText() && zTextPosition() === 'left') {\n <label [class]=\"labelClasses()\" (click)=\"onSwitchClick()\">{{ zText() }}</label>\n }\n\n <button\n type=\"button\"\n role=\"switch\"\n [class]=\"switchClasses()\"\n [attr.aria-checked]=\"zChecked()\"\n [attr.data-state]=\"switchState()\"\n [disabled]=\"isDisabled()\"\n (click)=\"onSwitchClick()\">\n <span [class]=\"thumbClasses()\" [attr.data-state]=\"switchState()\"
|
|
120
|
-
}], propDecorators: { class: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }], zSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "zSize", required: false }] }], zLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "zLabel", required: false }] }], zText: [{ type: i0.Input, args: [{ isSignal: true, alias: "zText", required: false }] }], zDisabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "zDisabled", required: false }] }], zTextPosition: [{ type: i0.Input, args: [{ isSignal: true, alias: "zTextPosition", required: false }] }], zChecked: [{ type: i0.Input, args: [{ isSignal: true, alias: "zChecked", required: false }] }, { type: i0.Output, args: ["zCheckedChange"] }], zChange: [{ type: i0.Output, args: ["zChange"] }] } });
|
|
131
|
+
}, template: "<!-- Label above -->\n@if (zLabel()) {\n <label class=\"text-xs leading-none font-medium\">{{ zLabel() }}</label>\n}\n\n<div class=\"inline-flex items-center gap-3\">\n @if (zText() && zTextPosition() === 'left') {\n <label [class]=\"labelClasses()\" (click)=\"onSwitchClick()\">{{ zText() }}</label>\n }\n\n <button\n type=\"button\"\n role=\"switch\"\n [class]=\"switchClasses()\"\n [attr.aria-checked]=\"zChecked()\"\n [attr.data-state]=\"switchState()\"\n [attr.data-loading]=\"zLoading()\"\n [disabled]=\"isDisabled()\"\n (click)=\"onSwitchClick()\">\n <span [class]=\"thumbClasses()\" [attr.data-state]=\"switchState()\" [attr.data-loading]=\"zLoading()\">\n @if (zLoading()) {\n <z-icon zType=\"lucideLoader2\" [zSize]=\"loadingIconSize()\" class=\"text-muted-foreground animate-spin\" />\n }\n </span>\n </button>\n\n @if (zText() && zTextPosition() === 'right') {\n <label [class]=\"labelClasses()\" (click)=\"onSwitchClick()\">{{ zText() }}</label>\n }\n</div>\n" }]
|
|
132
|
+
}], propDecorators: { class: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }], zSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "zSize", required: false }] }], zLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "zLabel", required: false }] }], zText: [{ type: i0.Input, args: [{ isSignal: true, alias: "zText", required: false }] }], zDisabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "zDisabled", required: false }] }], zLoading: [{ type: i0.Input, args: [{ isSignal: true, alias: "zLoading", required: false }] }], zTextPosition: [{ type: i0.Input, args: [{ isSignal: true, alias: "zTextPosition", required: false }] }], zChecked: [{ type: i0.Input, args: [{ isSignal: true, alias: "zChecked", required: false }] }, { type: i0.Output, args: ["zCheckedChange"] }], zChange: [{ type: i0.Output, args: ["zChange"] }] } });
|
|
121
133
|
|
|
122
134
|
/**
|
|
123
135
|
* Generated bundle index. Do not edit.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shival99-z-ui-components-z-switch.mjs","sources":["../../../../libs/core-ui/components/z-switch/z-switch.variants.ts","../../../../libs/core-ui/components/z-switch/z-switch.component.ts","../../../../libs/core-ui/components/z-switch/z-switch.component.html","../../../../libs/core-ui/components/z-switch/shival99-z-ui-components-z-switch.ts"],"sourcesContent":["import { cva, type VariantProps } from 'class-variance-authority';\n\nexport const zSwitchVariants = cva(\n [\n 'relative inline-flex shrink-0 cursor-pointer items-center rounded-full',\n 'border-2 border-transparent transition-colors duration-200',\n 'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2',\n 'disabled:cursor-not-allowed disabled:opacity-50',\n 'bg-input',\n 'data-[state=checked]:bg-primary',\n ],\n {\n variants: {\n zSize: {\n sm: 'h-5 w-9',\n default: 'h-6 w-11',\n lg: 'h-7 w-14',\n },\n },\n defaultVariants: {\n zSize: 'default',\n },\n }\n);\n\nexport const zSwitchThumbVariants = cva(\n [\n 'pointer-events-none block rounded-full bg-white shadow-[0_2px_6px_rgba(0,0,0,0.2)] ring-0',\n 'transition-transform duration-200',\n ],\n {\n variants: {\n zSize: {\n sm: 'size-4 data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0',\n default: 'size-5 data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0',\n lg: 'size-6 data-[state=checked]:translate-x-7 data-[state=unchecked]:translate-x-0',\n },\n },\n defaultVariants: {\n zSize: 'default',\n },\n }\n);\n\nexport const zSwitchLabelVariants = cva(\n 'select-none cursor-pointer peer-disabled:cursor-not-allowed peer-disabled:opacity-70',\n {\n variants: {\n zSize: {\n sm: 'text-xs',\n default: 'text-sm',\n lg: 'text-base',\n },\n },\n defaultVariants: {\n zSize: 'default',\n },\n }\n);\n\nexport type ZSwitchVariants = VariantProps<typeof zSwitchVariants>;\n","import {\n ChangeDetectionStrategy,\n Component,\n computed,\n forwardRef,\n input,\n model,\n output,\n signal,\n ViewEncapsulation,\n} from '@angular/core';\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';\nimport { zMergeClasses, zTransform } from '@shival99/z-ui/utils';\nimport type { ClassValue } from 'clsx';\nimport type { ZSwitchSize } from './z-switch.types';\nimport { zSwitchLabelVariants, zSwitchThumbVariants, zSwitchVariants } from './z-switch.variants';\n\n@Component({\n selector: 'z-switch',\n imports: [],\n standalone: true,\n templateUrl: './z-switch.component.html',\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => ZSwitchComponent),\n multi: true,\n },\n ],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n host: {\n '[class]': 'hostClasses()',\n },\n})\nexport class ZSwitchComponent implements ControlValueAccessor {\n public readonly class = input<ClassValue>('');\n public readonly zSize = input<ZSwitchSize>('default');\n public readonly zLabel = input<string>('');\n public readonly zText = input<string>('');\n public readonly zDisabled = input(false, { transform: zTransform });\n public readonly zTextPosition = input<'left' | 'right'>('right');\n\n public readonly zChecked = model<boolean>(false);\n\n public readonly zChange = output<boolean>();\n\n private readonly _disabled = signal(false);\n\n protected readonly isDisabled = computed(() => this.zDisabled() || this._disabled());\n\n protected readonly hostClasses = computed(() => {\n const hasLabel = !!this.zLabel();\n if (hasLabel) {\n return zMergeClasses('flex flex-col gap-2', this.class());\n }\n return zMergeClasses('inline-flex items-center gap-3', this.class());\n });\n\n protected readonly switchClasses = computed(() => zSwitchVariants({ zSize: this.zSize() }));\n\n protected readonly thumbClasses = computed(() => zSwitchThumbVariants({ zSize: this.zSize() }));\n\n protected readonly labelClasses = computed(() => zSwitchLabelVariants({ zSize: this.zSize() }));\n\n protected readonly switchState = computed(() => (this.zChecked() ? 'checked' : 'unchecked'));\n\n private _onChange: (value: boolean) => void = () => {};\n private _onTouched: () => void = () => {};\n\n public writeValue(value: boolean | null): void {\n this.zChecked.set(!!value);\n }\n\n public registerOnChange(fn: (value: boolean) => void): void {\n this._onChange = fn;\n }\n\n public registerOnTouched(fn: () => void): void {\n this._onTouched = fn;\n }\n\n public setDisabledState(isDisabled: boolean): void {\n this._disabled.set(isDisabled);\n }\n\n protected onSwitchClick(): void {\n if (this.isDisabled()) {\n return;\n }\n\n const newValue = !this.zChecked();\n this.zChecked.set(newValue);\n this.zChange.emit(newValue);\n this._onChange(newValue);\n this._onTouched();\n }\n}\n","<!-- Label above -->\n@if (zLabel()) {\n <label class=\"text-xs leading-none font-medium\">{{ zLabel() }}</label>\n}\n\n<div class=\"inline-flex items-center gap-3\">\n @if (zText() && zTextPosition() === 'left') {\n <label [class]=\"labelClasses()\" (click)=\"onSwitchClick()\">{{ zText() }}</label>\n }\n\n <button\n type=\"button\"\n role=\"switch\"\n [class]=\"switchClasses()\"\n [attr.aria-checked]=\"zChecked()\"\n [attr.data-state]=\"switchState()\"\n [disabled]=\"isDisabled()\"\n (click)=\"onSwitchClick()\">\n <span [class]=\"thumbClasses()\" [attr.data-state]=\"switchState()\"></span>\n </button>\n\n @if (zText() && zTextPosition() === 'right') {\n <label [class]=\"labelClasses()\" (click)=\"onSwitchClick()\">{{ zText() }}</label>\n }\n</div>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;AAEO,MAAM,eAAe,GAAG,GAAG,CAChC;IACE,wEAAwE;IACxE,4DAA4D;IAC5D,qGAAqG;IACrG,iDAAiD;IACjD,UAAU;IACV,iCAAiC;CAClC,EACD;AACE,IAAA,QAAQ,EAAE;AACR,QAAA,KAAK,EAAE;AACL,YAAA,EAAE,EAAE,SAAS;AACb,YAAA,OAAO,EAAE,UAAU;AACnB,YAAA,EAAE,EAAE,UAAU;AACf,SAAA;AACF,KAAA;AACD,IAAA,eAAe,EAAE;AACf,QAAA,KAAK,EAAE,SAAS;AACjB,KAAA;AACF,CAAA;AAGI,MAAM,oBAAoB,GAAG,GAAG,CACrC;IACE,2FAA2F;IAC3F,mCAAmC;CACpC,EACD;AACE,IAAA,QAAQ,EAAE;AACR,QAAA,KAAK,EAAE;AACL,YAAA,EAAE,EAAE,gFAAgF;AACpF,YAAA,OAAO,EAAE,gFAAgF;AACzF,YAAA,EAAE,EAAE,gFAAgF;AACrF,SAAA;AACF,KAAA;AACD,IAAA,eAAe,EAAE;AACf,QAAA,KAAK,EAAE,SAAS;AACjB,KAAA;AACF,CAAA;AAGI,MAAM,oBAAoB,GAAG,GAAG,CACrC,sFAAsF,EACtF;AACE,IAAA,QAAQ,EAAE;AACR,QAAA,KAAK,EAAE;AACL,YAAA,EAAE,EAAE,SAAS;AACb,YAAA,OAAO,EAAE,SAAS;AAClB,YAAA,EAAE,EAAE,WAAW;AAChB,SAAA;AACF,KAAA;AACD,IAAA,eAAe,EAAE;AACf,QAAA,KAAK,EAAE,SAAS;AACjB,KAAA;AACF,CAAA;;MCtBU,gBAAgB,CAAA;AACX,IAAA,KAAK,GAAG,KAAK,CAAa,EAAE,iDAAC;AAC7B,IAAA,KAAK,GAAG,KA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iB;AAC1B,gBAAA,WAAW,EAAE,UAAU,CAAC,MAAM,gBAAgB,CAAC;AAC/C,gBAAA,KAAK,EAAE,IAAI;AACZ,aAAA;AACF,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,EC5BH,+xBAyBA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,aAAA,EAAA,EAAA,CAAA,iBAAA,CAAA,IAAA,EAAA,CAAA;;2FDUa,gBAAgB,EAAA,UAAA,EAAA,CAAA;kBAlB5B,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,UAAU,EAAA,OAAA,EACX,EAAE,EAAA,UAAA,EACC,IAAI,EAAA,SAAA,EAEL;AACT,wBAAA;AACE,4BAAA,OAAO,EAAE,iBAAiB;AAC1B,4BAAA,WAAW,EAAE,UAAU,CAAC,sBAAsB,CAAC;AAC/C,4BAAA,KAAK,EAAE,IAAI;AACZ,yBAAA;AACF,qBAAA,EAAA,eAAA,EACgB,uBAAuB,CAAC,MAAM,iBAChC,iBAAiB,CAAC,IAAI,EAAA,IAAA,EAC/B;AACJ,wBAAA,SAAS,EAAE,eAAe;AAC3B,qBAAA,EAAA,QAAA,EAAA,+xBAAA,EAAA;;;AEjCH;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"shival99-z-ui-components-z-switch.mjs","sources":["../../../../libs/core-ui/components/z-switch/z-switch.variants.ts","../../../../libs/core-ui/components/z-switch/z-switch.component.ts","../../../../libs/core-ui/components/z-switch/z-switch.component.html","../../../../libs/core-ui/components/z-switch/shival99-z-ui-components-z-switch.ts"],"sourcesContent":["import { cva, type VariantProps } from 'class-variance-authority';\n\nexport const zSwitchVariants = cva(\n [\n 'relative inline-flex shrink-0 cursor-pointer items-center rounded-full',\n 'border-2 border-transparent transition-colors duration-200',\n 'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2',\n 'disabled:cursor-not-allowed disabled:opacity-50',\n 'bg-input',\n 'data-[state=checked]:bg-primary',\n ],\n {\n variants: {\n zSize: {\n sm: 'h-5 w-9',\n default: 'h-6 w-11',\n lg: 'h-7 w-14',\n },\n },\n defaultVariants: {\n zSize: 'default',\n },\n }\n);\n\nexport const zSwitchThumbVariants = cva(\n [\n 'pointer-events-none flex items-center justify-center rounded-full bg-white shadow-[0_2px_6px_rgba(0,0,0,0.2)] ring-0',\n 'transition-transform duration-200',\n ],\n {\n variants: {\n zSize: {\n sm: 'size-4 data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0',\n default: 'size-5 data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0',\n lg: 'size-6 data-[state=checked]:translate-x-7 data-[state=unchecked]:translate-x-0',\n },\n },\n defaultVariants: {\n zSize: 'default',\n },\n }\n);\n\nexport const zSwitchLabelVariants = cva(\n 'select-none cursor-pointer peer-disabled:cursor-not-allowed peer-disabled:opacity-70',\n {\n variants: {\n zSize: {\n sm: 'text-xs',\n default: 'text-sm',\n lg: 'text-base',\n },\n },\n defaultVariants: {\n zSize: 'default',\n },\n }\n);\n\nexport type ZSwitchVariants = VariantProps<typeof zSwitchVariants>;\n","import {\n ChangeDetectionStrategy,\n Component,\n computed,\n forwardRef,\n input,\n model,\n output,\n signal,\n ViewEncapsulation,\n} from '@angular/core';\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';\nimport { ZIconComponent } from '@shival99/z-ui/components/z-icon';\nimport { zMergeClasses, zTransform } from '@shival99/z-ui/utils';\nimport type { ClassValue } from 'clsx';\nimport type { ZSwitchSize } from './z-switch.types';\nimport { zSwitchLabelVariants, zSwitchThumbVariants, zSwitchVariants } from './z-switch.variants';\n\n@Component({\n selector: 'z-switch',\n imports: [ZIconComponent],\n standalone: true,\n templateUrl: './z-switch.component.html',\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => ZSwitchComponent),\n multi: true,\n },\n ],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n host: {\n '[class]': 'hostClasses()',\n },\n})\nexport class ZSwitchComponent implements ControlValueAccessor {\n public readonly class = input<ClassValue>('');\n public readonly zSize = input<ZSwitchSize>('default');\n public readonly zLabel = input<string>('');\n public readonly zText = input<string>('');\n public readonly zDisabled = input(false, { transform: zTransform });\n public readonly zLoading = input(false, { transform: zTransform });\n public readonly zTextPosition = input<'left' | 'right'>('right');\n\n public readonly zChecked = model<boolean>(false);\n public readonly zChange = output<boolean>();\n private readonly _disabled = signal(false);\n protected readonly isDisabled = computed(() => this.zDisabled() || this._disabled() || this.zLoading());\n\n protected readonly hostClasses = computed(() => {\n const hasLabel = !!this.zLabel();\n if (hasLabel) {\n return zMergeClasses('flex flex-col gap-2', this.class());\n }\n return zMergeClasses('inline-flex items-center gap-3', this.class());\n });\n\n protected readonly switchClasses = computed(() => zSwitchVariants({ zSize: this.zSize() }));\n protected readonly thumbClasses = computed(() => zSwitchThumbVariants({ zSize: this.zSize() }));\n protected readonly labelClasses = computed(() => zSwitchLabelVariants({ zSize: this.zSize() }));\n protected readonly switchState = computed(() => (this.zChecked() ? 'checked' : 'unchecked'));\n protected readonly loadingIconSize = computed(() => {\n const size = this.zSize();\n if (size === 'sm') {\n return '10';\n }\n if (size === 'lg') {\n return '16';\n }\n return '12';\n });\n\n private _onChange: (value: boolean) => void = () => {};\n private _onTouched: () => void = () => {};\n\n public writeValue(value: boolean | null): void {\n this.zChecked.set(!!value);\n }\n\n public registerOnChange(fn: (value: boolean) => void): void {\n this._onChange = fn;\n }\n\n public registerOnTouched(fn: () => void): void {\n this._onTouched = fn;\n }\n\n public setDisabledState(isDisabled: boolean): void {\n this._disabled.set(isDisabled);\n }\n\n protected onSwitchClick(): void {\n if (this.isDisabled()) {\n return;\n }\n\n const newValue = !this.zChecked();\n this.zChecked.set(newValue);\n this.zChange.emit(newValue);\n this._onChange(newValue);\n this._onTouched();\n }\n}\n","<!-- Label above -->\n@if (zLabel()) {\n <label class=\"text-xs leading-none font-medium\">{{ zLabel() }}</label>\n}\n\n<div class=\"inline-flex items-center gap-3\">\n @if (zText() && zTextPosition() === 'left') {\n <label [class]=\"labelClasses()\" (click)=\"onSwitchClick()\">{{ zText() }}</label>\n }\n\n <button\n type=\"button\"\n role=\"switch\"\n [class]=\"switchClasses()\"\n [attr.aria-checked]=\"zChecked()\"\n [attr.data-state]=\"switchState()\"\n [attr.data-loading]=\"zLoading()\"\n [disabled]=\"isDisabled()\"\n (click)=\"onSwitchClick()\">\n <span [class]=\"thumbClasses()\" [attr.data-state]=\"switchState()\" [attr.data-loading]=\"zLoading()\">\n @if (zLoading()) {\n <z-icon zType=\"lucideLoader2\" [zSize]=\"loadingIconSize()\" class=\"text-muted-foreground animate-spin\" />\n }\n </span>\n </button>\n\n @if (zText() && zTextPosition() === 'right') {\n <label [class]=\"labelClasses()\" (click)=\"onSwitchClick()\">{{ zText() }}</label>\n }\n</div>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;AAEO,MAAM,eAAe,GAAG,GAAG,CAChC;IACE,wEAAwE;IACxE,4DAA4D;IAC5D,qGAAqG;IACrG,iDAAiD;IACjD,UAAU;IACV,iCAAiC;CAClC,EACD;AACE,IAAA,QAAQ,EAAE;AACR,QAAA,KAAK,EAAE;AACL,YAAA,EAAE,EAAE,SAAS;AACb,YAAA,OAAO,EAAE,UAAU;AACnB,YAAA,EAAE,EAAE,UAAU;AACf,SAAA;AACF,KAAA;AACD,IAAA,eAAe,EAAE;AACf,QAAA,KAAK,EAAE,SAAS;AACjB,KAAA;AACF,CAAA;AAGI,MAAM,oBAAoB,GAAG,GAAG,CACrC;IACE,sHAAsH;IACtH,mCAAmC;CACpC,EACD;AACE,IAAA,QAAQ,EAAE;AACR,QAAA,KAAK,EAAE;AACL,YAAA,EAAE,EAAE,gFAAgF;AACpF,YAAA,OAAO,EAAE,gFAAgF;AACzF,YAAA,EAAE,EAAE,gFAAgF;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A,QAAA,EC7BH,0gCA8BA,4CDVY,cAAc,EAAA,QAAA,EAAA,kBAAA,EAAA,MAAA,EAAA,CAAA,OAAA,EAAA,OAAA,EAAA,OAAA,EAAA,cAAA,EAAA,MAAA,CAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,aAAA,EAAA,EAAA,CAAA,iBAAA,CAAA,IAAA,EAAA,CAAA;;2FAgBb,gBAAgB,EAAA,UAAA,EAAA,CAAA;kBAlB5B,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,UAAU,WACX,CAAC,cAAc,CAAC,EAAA,UAAA,EACb,IAAI,EAAA,SAAA,EAEL;AACT,wBAAA;AACE,4BAAA,OAAO,EAAE,iBAAiB;AAC1B,4BAAA,WAAW,EAAE,UAAU,CAAC,sBAAsB,CAAC;AAC/C,4BAAA,KAAK,EAAE,IAAI;AACZ,yBAAA;AACF,qBAAA,EAAA,eAAA,EACgB,uBAAuB,CAAC,MAAM,iBAChC,iBAAiB,CAAC,IAAI,EAAA,IAAA,EAC/B;AACJ,wBAAA,SAAS,EAAE,eAAe;AAC3B,qBAAA,EAAA,QAAA,EAAA,0gCAAA,EAAA;;;AElCH;;AAEG;;;;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { InjectionToken, input, inject, computed, ViewEncapsulation, ChangeDetectionStrategy, Component, makeEnvironmentProviders, Injector, PLATFORM_ID, NgZone, Injectable } from '@angular/core';
|
|
3
|
-
import { ZThemeService } from '@shival99/z-ui/services';
|
|
3
|
+
import { ZThemeService, ZTranslateService } from '@shival99/z-ui/services';
|
|
4
4
|
import { zMergeClasses } from '@shival99/z-ui/utils';
|
|
5
5
|
import { NgxSonnerToaster, toast } from 'ngx-sonner';
|
|
6
6
|
import { cva } from 'class-variance-authority';
|
|
@@ -112,6 +112,7 @@ class ZToastService {
|
|
|
112
112
|
_document = inject(DOCUMENT);
|
|
113
113
|
_ngZone = inject(NgZone);
|
|
114
114
|
_providedConfig = inject(Z_TOASTER_CONFIG, { optional: true });
|
|
115
|
+
_zTranslate = inject(ZTranslateService);
|
|
115
116
|
_overlayRef = null;
|
|
116
117
|
_toasterAttached = false;
|
|
117
118
|
_mutationObserver = null;
|
|
@@ -124,32 +125,32 @@ class ZToastService {
|
|
|
124
125
|
show(message, options) {
|
|
125
126
|
this._ensureToasterAttached();
|
|
126
127
|
this._moveToTop();
|
|
127
|
-
return toast(message, options);
|
|
128
|
+
return toast(this._translate(message), options);
|
|
128
129
|
}
|
|
129
130
|
success(message, options) {
|
|
130
131
|
this._ensureToasterAttached();
|
|
131
132
|
this._moveToTop();
|
|
132
|
-
return toast.success(message, options);
|
|
133
|
+
return toast.success(this._translate(message), options);
|
|
133
134
|
}
|
|
134
135
|
error(message, options) {
|
|
135
136
|
this._ensureToasterAttached();
|
|
136
137
|
this._moveToTop();
|
|
137
|
-
return toast.error(message, options);
|
|
138
|
+
return toast.error(this._translate(message), options);
|
|
138
139
|
}
|
|
139
140
|
warning(message, options) {
|
|
140
141
|
this._ensureToasterAttached();
|
|
141
142
|
this._moveToTop();
|
|
142
|
-
return toast.warning(message, options);
|
|
143
|
+
return toast.warning(this._translate(message), options);
|
|
143
144
|
}
|
|
144
145
|
info(message, options) {
|
|
145
146
|
this._ensureToasterAttached();
|
|
146
147
|
this._moveToTop();
|
|
147
|
-
return toast.info(message, options);
|
|
148
|
+
return toast.info(this._translate(message), options);
|
|
148
149
|
}
|
|
149
150
|
loading(message, options) {
|
|
150
151
|
this._ensureToasterAttached();
|
|
151
152
|
this._moveToTop();
|
|
152
|
-
return toast.loading(message, options);
|
|
153
|
+
return toast.loading(this._translate(message), options);
|
|
153
154
|
}
|
|
154
155
|
promise(promise, messages) {
|
|
155
156
|
this._ensureToasterAttached();
|
|
@@ -260,6 +261,12 @@ class ZToastService {
|
|
|
260
261
|
overlayRef.overlayElement.style.zIndex = '99999';
|
|
261
262
|
return overlayRef;
|
|
262
263
|
}
|
|
264
|
+
_translate(message) {
|
|
265
|
+
if (!message || !message.startsWith('i18n_')) {
|
|
266
|
+
return message;
|
|
267
|
+
}
|
|
268
|
+
return this._zTranslate.instant(message);
|
|
269
|
+
}
|
|
263
270
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: ZToastService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
264
271
|
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: ZToastService, providedIn: 'root' });
|
|
265
272
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shival99-z-ui-components-z-toast.mjs","sources":["../../../../libs/core-ui/components/z-toast/z-toast.types.ts","../../../../libs/core-ui/components/z-toast/z-toast.variants.ts","../../../../libs/core-ui/components/z-toast/z-toast.component.ts","../../../../libs/core-ui/components/z-toast/z-toast.component.html","../../../../libs/core-ui/components/z-toast/z-toast.provider.ts","../../../../libs/core-ui/components/z-toast/z-toast.service.ts","../../../../libs/core-ui/components/z-toast/shival99-z-ui-components-z-toast.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { InjectionToken } from '@angular/core';\nimport type { ExternalToast } from 'ngx-sonner';\n\nexport type ZToastTheme = 'light' | 'dark' | 'system';\nexport type ZToastPosition = 'top-left' | 'top-center' | 'top-right' | 'bottom-left' | 'bottom-center' | 'bottom-right';\nexport type ZToastDir = 'ltr' | 'rtl' | 'auto';\nexport type ZToastType = 'default' | 'success' | 'error' | 'warning' | 'info' | 'loading';\n\nexport const Z_TOAST_DATA = new InjectionToken<any>('Z_TOAST_DATA');\nexport const Z_TOAST_ANIMATION_DURATION = 200;\nexport const Z_TOASTER_CONFIG = new InjectionToken<ZToasterConfig>('Z_TOASTER_CONFIG');\n\nexport interface ZToastOptions extends ExternalToast {\n description?: string;\n duration?: number;\n id?: string | number;\n}\n\nexport interface ZToastPromiseMessages<T> {\n loading: string;\n success: string | ((data: T) => string);\n error: string | ((error: unknown) => string);\n}\n\nexport interface ZToasterConfig {\n zTheme?: ZToastTheme;\n zPosition?: ZToastPosition;\n zRichColors?: boolean;\n zExpand?: boolean;\n zDuration?: number;\n zVisibleToasts?: number;\n zCloseButton?: boolean;\n zDir?: ZToastDir;\n}\n\nexport const Z_TOASTER_DEFAULT_CONFIG: ZToasterConfig = {\n zTheme: 'system',\n zPosition: 'top-right',\n zRichColors: true,\n zExpand: true,\n zDuration: 2500,\n zVisibleToasts: 3,\n zCloseButton: true,\n zDir: 'auto',\n};\n","import { cva, type VariantProps } from 'class-variance-authority';\n\nexport const zToastVariants = cva(\n 'group toast group-[.toaster]:bg-background group-[.toaster]:text-foreground group-[.toaster]:border-border group-[.toaster]:shadow-lg',\n {\n variants: {\n zVariant: {\n default: 'group-[.toaster]:bg-background group-[.toaster]:text-foreground',\n success:\n 'group-[.toaster]:bg-green-50 group-[.toaster]:text-green-800 group-[.toaster]:border-green-200 dark:group-[.toaster]:bg-green-950 dark:group-[.toaster]:text-green-200 dark:group-[.toaster]:border-green-800',\n error:\n 'group-[.toaster]:bg-red-50 group-[.toaster]:text-red-800 group-[.toaster]:border-red-200 dark:group-[.toaster]:bg-red-950 dark:group-[.toaster]:text-red-200 dark:group-[.toaster]:border-red-800',\n warning:\n 'group-[.toaster]:bg-amber-50 group-[.toaster]:text-amber-800 group-[.toaster]:border-amber-200 dark:group-[.toaster]:bg-amber-950 dark:group-[.toaster]:text-amber-200 dark:group-[.toaster]:border-amber-800',\n info: 'group-[.toaster]:bg-blue-50 group-[.toaster]:text-blue-800 group-[.toaster]:border-blue-200 dark:group-[.toaster]:bg-blue-950 dark:group-[.toaster]:text-blue-200 dark:group-[.toaster]:border-blue-800',\n },\n },\n defaultVariants: {\n zVariant: 'default',\n },\n }\n);\n\nexport type ZToastVariants = VariantProps<typeof zToastVariants>;\n","import { ChangeDetectionStrategy, Component, computed, inject, input, ViewEncapsulation } from '@angular/core';\nimport { ZThemeService } from '@shival99/z-ui/services';\nimport { zMergeClasses } from '@shival99/z-ui/utils';\nimport type { ClassValue } from 'clsx';\nimport { NgxSonnerToaster } from 'ngx-sonner';\nimport {\n Z_TOASTER_CONFIG,\n Z_TOASTER_DEFAULT_CONFIG,\n type ZToasterConfig,\n type ZToastDir,\n type ZToastOptions,\n type ZToastPosition,\n type ZToastTheme,\n} from './z-toast.types';\nimport { zToastVariants, type ZToastVariants } from './z-toast.variants';\n\n@Component({\n selector: 'z-toast, z-toaster',\n imports: [NgxSonnerToaster],\n standalone: true,\n templateUrl: './z-toast.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n exportAs: 'zToast',\n})\nexport class ZToastComponent {\n public readonly class = input<ClassValue>('');\n public readonly zVariant = input<ZToastVariants['zVariant']>('default');\n public readonly zTheme = input<ZToastTheme>();\n public readonly zPosition = input<ZToastPosition>();\n public readonly zRichColors = input<boolean>();\n public readonly zExpand = input<boolean>();\n public readonly zDuration = input<number>();\n public readonly zVisibleToasts = input<number>();\n public readonly zCloseButton = input<boolean>();\n public readonly zToastOptions = input<ZToastOptions>({});\n public readonly zDir = input<ZToastDir>();\n\n private readonly _themeService = inject(ZThemeService);\n private readonly _config: ZToasterConfig = inject(Z_TOASTER_CONFIG, { optional: true }) ?? Z_TOASTER_DEFAULT_CONFIG;\n\n protected readonly effectiveTheme = computed(() => this.zTheme() ?? this._config.zTheme ?? 'system');\n protected readonly effectivePosition = computed(() => this.zPosition() ?? this._config.zPosition ?? 'bottom-right');\n protected readonly effectiveRichColors = computed(() => this.zRichColors() ?? this._config.zRichColors ?? true);\n protected readonly effectiveExpand = computed(() => this.zExpand() ?? this._config.zExpand ?? false);\n protected readonly effectiveDuration = computed(() => this.zDuration() ?? this._config.zDuration ?? 4000);\n protected readonly effectiveVisibleToasts = computed(() => this.zVisibleToasts() ?? this._config.zVisibleToasts ?? 3);\n\n protected readonly effectiveCloseButton = computed(() => this.zCloseButton() ?? this._config.zCloseButton ?? false);\n protected readonly effectiveDir = computed(() => this.zDir() ?? this._config.zDir ?? 'auto');\n\n protected readonly zClasses = computed(() =>\n zMergeClasses('toaster group', zToastVariants({ zVariant: this.zVariant() }), this.class())\n );\n\n protected readonly detectTheme = computed(() => {\n const theme = this.effectiveTheme();\n if (theme !== 'system') {\n return theme;\n }\n\n return this._themeService.isDark() ? 'dark' : 'light';\n });\n}\n","<ngx-sonner-toaster\n [theme]=\"detectTheme()\"\n [class]=\"zClasses()\"\n [position]=\"effectivePosition()\"\n [richColors]=\"effectiveRichColors()\"\n [expand]=\"effectiveExpand()\"\n [duration]=\"effectiveDuration()\"\n [visibleToasts]=\"effectiveVisibleToasts()\"\n [closeButton]=\"effectiveCloseButton()\"\n [toastOptions]=\"zToastOptions()\"\n [dir]=\"effectiveDir()\" />\n","import { type EnvironmentProviders, makeEnvironmentProviders } from '@angular/core';\nimport { Z_TOASTER_CONFIG, Z_TOASTER_DEFAULT_CONFIG, type ZToasterConfig } from './z-toast.types';\n\n/**\n * Provides global toast configuration options\n * Use this in app.config.ts: providers: [provideZToast({ zPosition: 'top-right' })]\n *\n * @param config - Partial configuration to override default options\n * @returns EnvironmentProviders for the toast service\n *\n * @example\n * ```typescript\n * // In app.config.ts\n * export const appConfig: ApplicationConfig = {\n * providers: [\n * provideZToast({\n * zPosition: 'top-right',\n * zDuration: 5000,\n * zCloseButton: true,\n * }),\n * ],\n * };\n * ```\n */\nexport function provideZToast(config?: Partial<ZToasterConfig>): EnvironmentProviders {\n const mergedConfig: ZToasterConfig = {\n ...Z_TOASTER_DEFAULT_CONFIG,\n ...config,\n };\n\n return makeEnvironmentProviders([{ provide: Z_TOASTER_CONFIG, useValue: mergedConfig }]);\n}\n","import { Overlay, OverlayConfig, OverlayRef } from '@angular/cdk/overlay';\nimport { ComponentPortal } from '@angular/cdk/portal';\nimport { DOCUMENT, isPlatformBrowser } from '@angular/common';\nimport { inject, Injectable, Injector, NgZone, OnDestroy, PLATFORM_ID } from '@angular/core';\nimport { toast } from 'ngx-sonner';\nimport { ZToastComponent } from './z-toast.component';\nimport {\n Z_TOASTER_CONFIG,\n Z_TOASTER_DEFAULT_CONFIG,\n type ZToasterConfig,\n type ZToastOptions,\n type ZToastPromiseMessages,\n} from './z-toast.types';\n\n@Injectable({ providedIn: 'root' })\nexport class ZToastService implements OnDestroy {\n private readonly _overlay = inject(Overlay);\n private readonly _injector = inject(Injector);\n private readonly _platformId = inject(PLATFORM_ID);\n private readonly _document = inject(DOCUMENT);\n private readonly _ngZone = inject(NgZone);\n private readonly _providedConfig = inject(Z_TOASTER_CONFIG, { optional: true });\n\n private _overlayRef: OverlayRef | null = null;\n private _toasterAttached = false;\n private _mutationObserver: MutationObserver | null = null;\n\n public create(config?: ZToasterConfig): void {\n if (this._toasterAttached) {\n return;\n }\n\n this._attachToaster(config);\n }\n\n public show(message: string, options?: ZToastOptions): string | number {\n this._ensureToasterAttached();\n this._moveToTop();\n return toast(message, options);\n }\n\n public success(message: string, options?: ZToastOptions): string | number {\n this._ensureToasterAttached();\n this._moveToTop();\n return toast.success(message, options);\n }\n\n public error(message: string, options?: ZToastOptions): string | number {\n this._ensureToasterAttached();\n this._moveToTop();\n return toast.error(message, options);\n }\n\n public warning(message: string, options?: ZToastOptions): string | number {\n this._ensureToasterAttached();\n this._moveToTop();\n return toast.warning(message, options);\n }\n\n public info(message: string, options?: ZToastOptions): string | number {\n this._ensureToasterAttached();\n this._moveToTop();\n return toast.info(message, options);\n }\n\n public loading(message: string, options?: ZToastOptions): string | number {\n this._ensureToasterAttached();\n this._moveToTop();\n return toast.loading(message, options);\n }\n\n public promise<T>(promise: Promise<T>, messages: ZToastPromiseMessages<T>): string | number | undefined {\n this._ensureToasterAttached();\n this._moveToTop();\n return toast.promise(promise, messages);\n }\n\n public dismiss(toastId?: string | number): void {\n toast.dismiss(toastId);\n }\n\n public dismissAll(): void {\n toast.dismiss();\n }\n\n public destroy(): void {\n this._disconnectObserver();\n\n if (this._overlayRef) {\n this._overlayRef.dispose();\n this._overlayRef = null;\n this._toasterAttached = false;\n }\n }\n\n public ngOnDestroy(): void {\n this.destroy();\n }\n\n private _ensureToasterAttached(): void {\n if (!this._toasterAttached) {\n this._attachToaster();\n }\n }\n\n private _moveToTop(): void {\n const wrapperElement = this._overlayRef?.overlayElement?.parentElement as HTMLElement | null;\n if (!wrapperElement?.hasAttribute('popover')) {\n return;\n }\n\n try {\n wrapperElement.hidePopover();\n wrapperElement.showPopover();\n } catch {\n console.warn('Popover API not supported on this browser.');\n }\n }\n\n private _setupOverlayObserver(): void {\n if (!isPlatformBrowser(this._platformId)) {\n return;\n }\n\n if (this._mutationObserver) {\n return;\n }\n\n const overlayContainer = this._document.querySelector('.cdk-overlay-container');\n if (!overlayContainer) {\n return;\n }\n\n this._ngZone.runOutsideAngular(() => {\n this._mutationObserver = new MutationObserver(mutations => {\n const hasNewPopover = mutations.some(\n mutation =>\n mutation.type === 'childList' &&\n Array.from(mutation.addedNodes).some(\n node => node instanceof HTMLElement && node.classList.contains('cdk-overlay-popover')\n )\n );\n\n if (hasNewPopover) {\n this._moveToTop();\n }\n });\n\n this._mutationObserver.observe(overlayContainer, {\n childList: true,\n subtree: false,\n });\n });\n }\n\n private _disconnectObserver(): void {\n if (this._mutationObserver) {\n this._mutationObserver.disconnect();\n this._mutationObserver = null;\n }\n }\n\n private _attachToaster(config?: ZToasterConfig): void {\n if (!isPlatformBrowser(this._platformId)) {\n return;\n }\n\n if (this._toasterAttached) {\n return;\n }\n\n this._overlayRef = this._createOverlay();\n if (!this._overlayRef) {\n return;\n }\n\n const effectiveConfig: ZToasterConfig = {\n ...Z_TOASTER_DEFAULT_CONFIG,\n ...this._providedConfig,\n ...config,\n };\n\n const injector = Injector.create({\n parent: this._injector,\n providers: [{ provide: Z_TOASTER_CONFIG, useValue: effectiveConfig }],\n });\n\n const portal = new ComponentPortal(ZToastComponent, null, injector);\n this._overlayRef.attach(portal);\n this._toasterAttached = true;\n\n this._setupOverlayObserver();\n }\n\n private _createOverlay(): OverlayRef | null {\n if (!isPlatformBrowser(this._platformId)) {\n return null;\n }\n\n const overlayConfig = new OverlayConfig({\n hasBackdrop: false,\n positionStrategy: this._overlay.position().global(),\n scrollStrategy: this._overlay.scrollStrategies.noop(),\n });\n\n const overlayRef = this._overlay.create(overlayConfig);\n overlayRef.overlayElement.style.zIndex = '99999';\n\n return overlayRef;\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;AAAA;MASa,YAAY,GAAG,IAAI,cAAc,CAAM,cAAc;AAC3D,MAAM,0BAA0B,GAAG,GAAG;MAChC,gBAAgB,GAAG,IAAI,cAAc,CAAiB,kBAAkB;AAyB9E,MAAM,wBAAwB,GAAmB;AACtD,IAAA,MAAM,EAAE,QAAQ;AAChB,IAAA,SAAS,EAAE,WAAW;AACtB,IAAA,WAAW,EAAE,IAAI;AACjB,IAAA,OAAO,EAAE,IAAI;AACb,IAAA,SAAS,EAAE,IAAI;AACf,IAAA,cAAc,EAAE,CAAC;AACjB,IAAA,YAAY,EAAE,IAAI;AAClB,IAAA,IAAI,EAAE,MAAM;;;AC1CP,MAAM,cAAc,GAAG,GAAG,CAC/B,uIAAuI,EACvI;AACE,IAAA,QAAQ,EAAE;AACR,QAAA,QAAQ,EAAE;AACR,YAAA,OAAO,EAAE,iEAAiE;AAC1E,YAAA,OAAO,EACL,+MAA+M;AACjN,YAAA,KAAK,EACH,mMAAmM;AACrM,YAAA,OAAO,EACL,+MAA+M;AACjN,YAAA,IAAI,EAAE,yMAAyM;AAChN,SAAA;AACF,KAAA;AACD,IAAA,eAAe,EAAE;AACf,QAAA,QAAQ,EAAE,SAAS;AACpB,KAAA;AACF,CAAA;;MCKU,eAAe,CAAA;AACV,IAAA,KAAK,GAAG,KAAK,CAAa,EAAE,iDAAC;AAC7B,IAAA,QAAQ,GAAG,KAAK,CAA6B,SAAS,oDAA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E,UAAU,EAAE,MAAM,EAAE;;;ACdlC;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"shival99-z-ui-components-z-toast.mjs","sources":["../../../../libs/core-ui/components/z-toast/z-toast.types.ts","../../../../libs/core-ui/components/z-toast/z-toast.variants.ts","../../../../libs/core-ui/components/z-toast/z-toast.component.ts","../../../../libs/core-ui/components/z-toast/z-toast.component.html","../../../../libs/core-ui/components/z-toast/z-toast.provider.ts","../../../../libs/core-ui/components/z-toast/z-toast.service.ts","../../../../libs/core-ui/components/z-toast/shival99-z-ui-components-z-toast.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { InjectionToken } from '@angular/core';\nimport type { ExternalToast } from 'ngx-sonner';\n\nexport type ZToastTheme = 'light' | 'dark' | 'system';\nexport type ZToastPosition = 'top-left' | 'top-center' | 'top-right' | 'bottom-left' | 'bottom-center' | 'bottom-right';\nexport type ZToastDir = 'ltr' | 'rtl' | 'auto';\nexport type ZToastType = 'default' | 'success' | 'error' | 'warning' | 'info' | 'loading';\n\nexport const Z_TOAST_DATA = new InjectionToken<any>('Z_TOAST_DATA');\nexport const Z_TOAST_ANIMATION_DURATION = 200;\nexport const Z_TOASTER_CONFIG = new InjectionToken<ZToasterConfig>('Z_TOASTER_CONFIG');\n\nexport interface ZToastOptions extends ExternalToast {\n description?: string;\n duration?: number;\n id?: string | number;\n}\n\nexport interface ZToastPromiseMessages<T> {\n loading: string;\n success: string | ((data: T) => string);\n error: string | ((error: unknown) => string);\n}\n\nexport interface ZToasterConfig {\n zTheme?: ZToastTheme;\n zPosition?: ZToastPosition;\n zRichColors?: boolean;\n zExpand?: boolean;\n zDuration?: number;\n zVisibleToasts?: number;\n zCloseButton?: boolean;\n zDir?: ZToastDir;\n}\n\nexport const Z_TOASTER_DEFAULT_CONFIG: ZToasterConfig = {\n zTheme: 'system',\n zPosition: 'top-right',\n zRichColors: true,\n zExpand: true,\n zDuration: 2500,\n zVisibleToasts: 3,\n zCloseButton: true,\n zDir: 'auto',\n};\n","import { cva, type VariantProps } from 'class-variance-authority';\n\nexport const zToastVariants = cva(\n 'group toast group-[.toaster]:bg-background group-[.toaster]:text-foreground group-[.toaster]:border-border group-[.toaster]:shadow-lg',\n {\n variants: {\n zVariant: {\n default: 'group-[.toaster]:bg-background group-[.toaster]:text-foreground',\n success:\n 'group-[.toaster]:bg-green-50 group-[.toaster]:text-green-800 group-[.toaster]:border-green-200 dark:group-[.toaster]:bg-green-950 dark:group-[.toaster]:text-green-200 dark:group-[.toaster]:border-green-800',\n error:\n 'group-[.toaster]:bg-red-50 group-[.toaster]:text-red-800 group-[.toaster]:border-red-200 dark:group-[.toaster]:bg-red-950 dark:group-[.toaster]:text-red-200 dark:group-[.toaster]:border-red-800',\n warning:\n 'group-[.toaster]:bg-amber-50 group-[.toaster]:text-amber-800 group-[.toaster]:border-amber-200 dark:group-[.toaster]:bg-amber-950 dark:group-[.toaster]:text-amber-200 dark:group-[.toaster]:border-amber-800',\n info: 'group-[.toaster]:bg-blue-50 group-[.toaster]:text-blue-800 group-[.toaster]:border-blue-200 dark:group-[.toaster]:bg-blue-950 dark:group-[.toaster]:text-blue-200 dark:group-[.toaster]:border-blue-800',\n },\n },\n defaultVariants: {\n zVariant: 'default',\n },\n }\n);\n\nexport type ZToastVariants = VariantProps<typeof zToastVariants>;\n","import { ChangeDetectionStrategy, Component, computed, inject, input, ViewEncapsulation } from '@angular/core';\nimport { ZThemeService } from '@shival99/z-ui/services';\nimport { zMergeClasses } from '@shival99/z-ui/utils';\nimport type { ClassValue } from 'clsx';\nimport { NgxSonnerToaster } from 'ngx-sonner';\nimport {\n Z_TOASTER_CONFIG,\n Z_TOASTER_DEFAULT_CONFIG,\n type ZToasterConfig,\n type ZToastDir,\n type ZToastOptions,\n type ZToastPosition,\n type ZToastTheme,\n} from './z-toast.types';\nimport { zToastVariants, type ZToastVariants } from './z-toast.variants';\n\n@Component({\n selector: 'z-toast, z-toaster',\n imports: [NgxSonnerToaster],\n standalone: true,\n templateUrl: './z-toast.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n exportAs: 'zToast',\n})\nexport class ZToastComponent {\n public readonly class = input<ClassValue>('');\n public readonly zVariant = input<ZToastVariants['zVariant']>('default');\n public readonly zTheme = input<ZToastTheme>();\n public readonly zPosition = input<ZToastPosition>();\n public readonly zRichColors = input<boolean>();\n public readonly zExpand = input<boolean>();\n public readonly zDuration = input<number>();\n public readonly zVisibleToasts = input<number>();\n public readonly zCloseButton = input<boolean>();\n public readonly zToastOptions = input<ZToastOptions>({});\n public readonly zDir = input<ZToastDir>();\n\n private readonly _themeService = inject(ZThemeService);\n private readonly _config: ZToasterConfig = inject(Z_TOASTER_CONFIG, { optional: true }) ?? Z_TOASTER_DEFAULT_CONFIG;\n\n protected readonly effectiveTheme = computed(() => this.zTheme() ?? this._config.zTheme ?? 'system');\n protected readonly effectivePosition = computed(() => this.zPosition() ?? this._config.zPosition ?? 'bottom-right');\n protected readonly effectiveRichColors = computed(() => this.zRichColors() ?? this._config.zRichColors ?? true);\n protected readonly effectiveExpand = computed(() => this.zExpand() ?? this._config.zExpand ?? false);\n protected readonly effectiveDuration = computed(() => this.zDuration() ?? this._config.zDuration ?? 4000);\n protected readonly effectiveVisibleToasts = computed(() => this.zVisibleToasts() ?? this._config.zVisibleToasts ?? 3);\n\n protected readonly effectiveCloseButton = computed(() => this.zCloseButton() ?? this._config.zCloseButton ?? false);\n protected readonly effectiveDir = computed(() => this.zDir() ?? this._config.zDir ?? 'auto');\n\n protected readonly zClasses = computed(() =>\n zMergeClasses('toaster group', zToastVariants({ zVariant: this.zVariant() }), this.class())\n );\n\n protected readonly detectTheme = computed(() => {\n const theme = this.effectiveTheme();\n if (theme !== 'system') {\n return theme;\n }\n\n return this._themeService.isDark() ? 'dark' : 'light';\n });\n}\n","<ngx-sonner-toaster\n [theme]=\"detectTheme()\"\n [class]=\"zClasses()\"\n [position]=\"effectivePosition()\"\n [richColors]=\"effectiveRichColors()\"\n [expand]=\"effectiveExpand()\"\n [duration]=\"effectiveDuration()\"\n [visibleToasts]=\"effectiveVisibleToasts()\"\n [closeButton]=\"effectiveCloseButton()\"\n [toastOptions]=\"zToastOptions()\"\n [dir]=\"effectiveDir()\" />\n","import { type EnvironmentProviders, makeEnvironmentProviders } from '@angular/core';\nimport { Z_TOASTER_CONFIG, Z_TOASTER_DEFAULT_CONFIG, type ZToasterConfig } from './z-toast.types';\n\n/**\n * Provides global toast configuration options\n * Use this in app.config.ts: providers: [provideZToast({ zPosition: 'top-right' })]\n *\n * @param config - Partial configuration to override default options\n * @returns EnvironmentProviders for the toast service\n *\n * @example\n * ```typescript\n * // In app.config.ts\n * export const appConfig: ApplicationConfig = {\n * providers: [\n * provideZToast({\n * zPosition: 'top-right',\n * zDuration: 5000,\n * zCloseButton: true,\n * }),\n * ],\n * };\n * ```\n */\nexport function provideZToast(config?: Partial<ZToasterConfig>): EnvironmentProviders {\n const mergedConfig: ZToasterConfig = {\n ...Z_TOASTER_DEFAULT_CONFIG,\n ...config,\n };\n\n return makeEnvironmentProviders([{ provide: Z_TOASTER_CONFIG, useValue: mergedConfig }]);\n}\n","import { Overlay, OverlayConfig, OverlayRef } from '@angular/cdk/overlay';\nimport { ComponentPortal } from '@angular/cdk/portal';\nimport { DOCUMENT, isPlatformBrowser } from '@angular/common';\nimport { inject, Injectable, Injector, NgZone, OnDestroy, PLATFORM_ID } from '@angular/core';\nimport { ZTranslateService } from '@shival99/z-ui/services';\nimport { toast } from 'ngx-sonner';\nimport { ZToastComponent } from './z-toast.component';\nimport {\n Z_TOASTER_CONFIG,\n Z_TOASTER_DEFAULT_CONFIG,\n type ZToasterConfig,\n type ZToastOptions,\n type ZToastPromiseMessages,\n} from './z-toast.types';\n\n@Injectable({ providedIn: 'root' })\nexport class ZToastService implements OnDestroy {\n private readonly _overlay = inject(Overlay);\n private readonly _injector = inject(Injector);\n private readonly _platformId = inject(PLATFORM_ID);\n private readonly _document = inject(DOCUMENT);\n private readonly _ngZone = inject(NgZone);\n private readonly _providedConfig = inject(Z_TOASTER_CONFIG, { optional: true });\n private readonly _zTranslate = inject(ZTranslateService);\n\n private _overlayRef: OverlayRef | null = null;\n private _toasterAttached = false;\n private _mutationObserver: MutationObserver | null = null;\n\n public create(config?: ZToasterConfig): void {\n if (this._toasterAttached) {\n return;\n }\n\n this._attachToaster(config);\n }\n\n public show(message: string, options?: ZToastOptions): string | number {\n this._ensureToasterAttached();\n this._moveToTop();\n return toast(this._translate(message), options);\n }\n\n public success(message: string, options?: ZToastOptions): string | number {\n this._ensureToasterAttached();\n this._moveToTop();\n return toast.success(this._translate(message), options);\n }\n\n public error(message: string, options?: ZToastOptions): string | number {\n this._ensureToasterAttached();\n this._moveToTop();\n return toast.error(this._translate(message), options);\n }\n\n public warning(message: string, options?: ZToastOptions): string | number {\n this._ensureToasterAttached();\n this._moveToTop();\n return toast.warning(this._translate(message), options);\n }\n\n public info(message: string, options?: ZToastOptions): string | number {\n this._ensureToasterAttached();\n this._moveToTop();\n return toast.info(this._translate(message), options);\n }\n\n public loading(message: string, options?: ZToastOptions): string | number {\n this._ensureToasterAttached();\n this._moveToTop();\n return toast.loading(this._translate(message), options);\n }\n\n public promise<T>(promise: Promise<T>, messages: ZToastPromiseMessages<T>): string | number | undefined {\n this._ensureToasterAttached();\n this._moveToTop();\n return toast.promise(promise, messages);\n }\n\n public dismiss(toastId?: string | number): void {\n toast.dismiss(toastId);\n }\n\n public dismissAll(): void {\n toast.dismiss();\n }\n\n public destroy(): void {\n this._disconnectObserver();\n\n if (this._overlayRef) {\n this._overlayRef.dispose();\n this._overlayRef = null;\n this._toasterAttached = false;\n }\n }\n\n public ngOnDestroy(): void {\n this.destroy();\n }\n\n private _ensureToasterAttached(): void {\n if (!this._toasterAttached) {\n this._attachToaster();\n }\n }\n\n private _moveToTop(): void {\n const wrapperElement = this._overlayRef?.overlayElement?.parentElement as HTMLElement | null;\n if (!wrapperElement?.hasAttribute('popover')) {\n return;\n }\n\n try {\n wrapperElement.hidePopover();\n wrapperElement.showPopover();\n } catch {\n console.warn('Popover API not supported on this browser.');\n }\n }\n\n private _setupOverlayObserver(): void {\n if (!isPlatformBrowser(this._platformId)) {\n return;\n }\n\n if (this._mutationObserver) {\n return;\n }\n\n const overlayContainer = this._document.querySelector('.cdk-overlay-container');\n if (!overlayContainer) {\n return;\n }\n\n this._ngZone.runOutsideAngular(() => {\n this._mutationObserver = new MutationObserver(mutations => {\n const hasNewPopover = mutations.some(\n mutation =>\n mutation.type === 'childList' &&\n Array.from(mutation.addedNodes).some(\n node => node instanceof HTMLElement && node.classList.contains('cdk-overlay-popover')\n )\n );\n\n if (hasNewPopover) {\n this._moveToTop();\n }\n });\n\n this._mutationObserver.observe(overlayContainer, {\n childList: true,\n subtree: false,\n });\n });\n }\n\n private _disconnectObserver(): void {\n if (this._mutationObserver) {\n this._mutationObserver.disconnect();\n this._mutationObserver = null;\n }\n }\n\n private _attachToaster(config?: ZToasterConfig): void {\n if (!isPlatformBrowser(this._platformId)) {\n return;\n }\n\n if (this._toasterAttached) {\n return;\n }\n\n this._overlayRef = this._createOverlay();\n if (!this._overlayRef) {\n return;\n }\n\n const effectiveConfig: ZToasterConfig = {\n ...Z_TOASTER_DEFAULT_CONFIG,\n ...this._providedConfig,\n ...config,\n };\n\n const injector = Injector.create({\n parent: this._injector,\n providers: [{ provide: Z_TOASTER_CONFIG, useValue: effectiveConfig }],\n });\n\n const portal = new ComponentPortal(ZToastComponent, null, injector);\n this._overlayRef.attach(portal);\n this._toasterAttached = true;\n\n this._setupOverlayObserver();\n }\n\n private _createOverlay(): OverlayRef | null {\n if (!isPlatformBrowser(this._platformId)) {\n return null;\n }\n\n const overlayConfig = new OverlayConfig({\n hasBackdrop: false,\n positionStrategy: this._overlay.position().global(),\n scrollStrategy: this._overlay.scrollStrategies.noop(),\n });\n\n const overlayRef = this._overlay.create(overlayConfig);\n overlayRef.overlayElement.style.zIndex = '99999';\n\n return overlayRef;\n }\n\n private _translate(message: string): string {\n if (!message || !message.startsWith('i18n_')) {\n return message;\n }\n\n return this._zTranslate.instant(message);\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;AAAA;MASa,YAAY,GAAG,IAAI,cAAc,CAAM,cAAc;AAC3D,MAAM,0BAA0B,GAAG,GAAG;MAChC,gBAAgB,GAAG,IAAI,cAAc,CAAiB,kBAAkB;AAyB9E,MAAM,wBAAwB,GAAmB;AACtD,IAAA,MAAM,EAAE,QAAQ;AAChB,IAAA,SAAS,EAAE,WAAW;AACtB,IAAA,WAAW,EAAE,IAAI;AACjB,IAAA,OAAO,EAAE,IAAI;AACb,IAAA,SAAS,EAAE,IAAI;AACf,IAAA,cAAc,EAAE,CAAC;AACjB,IAAA,YAAY,EAAE,IAAI;AAClB,IAAA,IAAI,EAAE,MAAM;;;AC1CP,MAAM,cAAc,GAAG,GAAG,CAC/B,uIAAuI,EACvI;AACE,IAAA,QAAQ,EAAE;AACR,QAAA,QAAQ,EAAE;AACR,YAAA,OAAO,EAAE,iEAAiE;AAC1E,YAAA,OAAO,EACL,+MAA+M;AACjN,YAAA,KAAK,EACH,mMAAmM;AACrM,YAAA,OAAO,EACL,+MAA+M;AACjN,YAAA,IAAI,EAAE,yMAAyM;AAChN,SAAA;AACF,KAAA;AACD,IAAA,eAAe,EAAE;AACf,QAAA,QAAQ,EAAE,SAAS;AACpB,KAAA;AACF,CAAA;;MCKU,eAAe,CAAA;AACV,IAAA,KAAK,GAAG,KAAK,CAAa,EAAE,iDAAC;AAC7B,IAAA,QAAQ,GAAG,KAAK,CAA6B,SAAS,oDAAC;IACvD,MAAM,GAAG,KAAK,CAAA,IAAA,SAAA,GAAA,CAAA,SAAA,EAAA,EAAA,SAAA,EAAA,QAAA,EAAA,CAAA,GAAA,EAAA,CAAA,CAAe;IAC7B,SAAS,GAAG,KAAK,CAAA,IAAA,SAAA,GAAA,CAAA,SAAA,EAAA,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,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA;AAAb,IAAA,OAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,aAAa,cADA,MAAM,EAAA,CAAA;;2FACnB,aAAa,EAAA,UAAA,EAAA,CAAA;kBADzB,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;;ACflC;;AAEG;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shival99/z-ui",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.5",
|
|
4
4
|
"description": "Z-UI: Modern Angular UI Component Library - A comprehensive, high-performance design system built with Angular 20+, featuring 40+ customizable components with dark mode, accessibility, and enterprise-ready features.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"angular",
|
|
@@ -286,16 +286,16 @@ declare class ZCalendarComponent implements OnInit, ControlValueAccessor {
|
|
|
286
286
|
|
|
287
287
|
declare const zCalendarVariants: (props?: ({
|
|
288
288
|
zSize?: "sm" | "default" | "lg" | null | undefined;
|
|
289
|
-
zStatus?: "default" | "disabled" | "
|
|
289
|
+
zStatus?: "default" | "disabled" | "open" | "error" | "readonly" | null | undefined;
|
|
290
290
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
291
291
|
declare const zCalendarDayVariants: (props?: ({
|
|
292
|
-
state?: "default" | "
|
|
292
|
+
state?: "default" | "today" | "selected" | "inRange" | "rangeStart" | "rangeEnd" | "rangeSingle" | "disabled" | "otherMonth" | "hovered" | null | undefined;
|
|
293
293
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
294
294
|
declare const zCalendarMonthVariants: (props?: ({
|
|
295
|
-
state?: "default" | "
|
|
295
|
+
state?: "default" | "selected" | "disabled" | "current" | null | undefined;
|
|
296
296
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
297
297
|
declare const zCalendarYearVariants: (props?: ({
|
|
298
|
-
state?: "default" | "
|
|
298
|
+
state?: "default" | "selected" | "disabled" | "current" | null | undefined;
|
|
299
299
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
300
300
|
|
|
301
301
|
export { ZCalendarComponent, zCalendarDayVariants, zCalendarMonthVariants, zCalendarVariants, zCalendarYearVariants };
|
|
@@ -218,7 +218,7 @@ declare class ZModalComponent<T, U> extends BasePortalOutlet implements OnDestro
|
|
|
218
218
|
protected readonly effectiveOkText: _angular_core.Signal<string | null | undefined>;
|
|
219
219
|
protected readonly effectiveCancelText: _angular_core.Signal<string | null | undefined>;
|
|
220
220
|
protected readonly effectiveOkDestructive: _angular_core.Signal<boolean | undefined>;
|
|
221
|
-
protected readonly effectiveTypeOk: _angular_core.Signal<"info" | "warning" | "error" | "default" | "primary" | "secondary" | "destructive" | "success" | "outline" | "outline-primary" | "outline-secondary" | "outline-success" | "outline-info" | "outline-warning" | "outline-error" | "outline-destructive" | "outline-success-secondary" | "outline-info-secondary" | "outline-warning-secondary" | "outline-error-secondary" | "outline-destructive-secondary" | "outline-primary-secondary" | "ghost" | "ghost-primary" | "ghost-success" | "ghost-info" | "ghost-warning" | "ghost-error" | "ghost-destructive" | "subtle" |
|
|
221
|
+
protected readonly effectiveTypeOk: _angular_core.Signal<"info" | "warning" | "error" | "link" | "default" | "primary" | "secondary" | "destructive" | "success" | "outline" | "outline-primary" | "outline-secondary" | "outline-success" | "outline-info" | "outline-warning" | "outline-error" | "outline-destructive" | "outline-success-secondary" | "outline-info-secondary" | "outline-warning-secondary" | "outline-error-secondary" | "outline-destructive-secondary" | "outline-primary-secondary" | "ghost" | "ghost-primary" | "ghost-success" | "ghost-info" | "ghost-warning" | "ghost-error" | "ghost-destructive" | "subtle" | null | undefined>;
|
|
222
222
|
protected readonly effectiveOkDisabled: _angular_core.Signal<boolean | undefined>;
|
|
223
223
|
protected readonly effectiveLoading: _angular_core.Signal<boolean>;
|
|
224
224
|
protected readonly effectiveContentLoading: _angular_core.Signal<boolean>;
|
|
@@ -12,6 +12,7 @@ declare class ZSwitchComponent implements ControlValueAccessor {
|
|
|
12
12
|
readonly zLabel: _angular_core.InputSignal<string>;
|
|
13
13
|
readonly zText: _angular_core.InputSignal<string>;
|
|
14
14
|
readonly zDisabled: _angular_core.InputSignalWithTransform<boolean, string | boolean>;
|
|
15
|
+
readonly zLoading: _angular_core.InputSignalWithTransform<boolean, string | boolean>;
|
|
15
16
|
readonly zTextPosition: _angular_core.InputSignal<"left" | "right">;
|
|
16
17
|
readonly zChecked: _angular_core.ModelSignal<boolean>;
|
|
17
18
|
readonly zChange: _angular_core.OutputEmitterRef<boolean>;
|
|
@@ -22,6 +23,7 @@ declare class ZSwitchComponent implements ControlValueAccessor {
|
|
|
22
23
|
protected readonly thumbClasses: _angular_core.Signal<string>;
|
|
23
24
|
protected readonly labelClasses: _angular_core.Signal<string>;
|
|
24
25
|
protected readonly switchState: _angular_core.Signal<"checked" | "unchecked">;
|
|
26
|
+
protected readonly loadingIconSize: _angular_core.Signal<"10" | "16" | "12">;
|
|
25
27
|
private _onChange;
|
|
26
28
|
private _onTouched;
|
|
27
29
|
writeValue(value: boolean | null): void;
|
|
@@ -30,7 +32,7 @@ declare class ZSwitchComponent implements ControlValueAccessor {
|
|
|
30
32
|
setDisabledState(isDisabled: boolean): void;
|
|
31
33
|
protected onSwitchClick(): void;
|
|
32
34
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<ZSwitchComponent, never>;
|
|
33
|
-
static ɵcmp: _angular_core.ɵɵComponentDeclaration<ZSwitchComponent, "z-switch", never, { "class": { "alias": "class"; "required": false; "isSignal": true; }; "zSize": { "alias": "zSize"; "required": false; "isSignal": true; }; "zLabel": { "alias": "zLabel"; "required": false; "isSignal": true; }; "zText": { "alias": "zText"; "required": false; "isSignal": true; }; "zDisabled": { "alias": "zDisabled"; "required": false; "isSignal": true; }; "zTextPosition": { "alias": "zTextPosition"; "required": false; "isSignal": true; }; "zChecked": { "alias": "zChecked"; "required": false; "isSignal": true; }; }, { "zChecked": "zCheckedChange"; "zChange": "zChange"; }, never, never, true, never>;
|
|
35
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<ZSwitchComponent, "z-switch", never, { "class": { "alias": "class"; "required": false; "isSignal": true; }; "zSize": { "alias": "zSize"; "required": false; "isSignal": true; }; "zLabel": { "alias": "zLabel"; "required": false; "isSignal": true; }; "zText": { "alias": "zText"; "required": false; "isSignal": true; }; "zDisabled": { "alias": "zDisabled"; "required": false; "isSignal": true; }; "zLoading": { "alias": "zLoading"; "required": false; "isSignal": true; }; "zTextPosition": { "alias": "zTextPosition"; "required": false; "isSignal": true; }; "zChecked": { "alias": "zChecked"; "required": false; "isSignal": true; }; }, { "zChecked": "zCheckedChange"; "zChange": "zChange"; }, never, never, true, never>;
|
|
34
36
|
}
|
|
35
37
|
|
|
36
38
|
declare const zSwitchVariants: (props?: ({
|
|
@@ -32,7 +32,7 @@ declare class ZTimelineComponent {
|
|
|
32
32
|
readonly class: _angular_core.InputSignal<ClassValue>;
|
|
33
33
|
readonly zItems: _angular_core.InputSignal<ZTimelineItem[]>;
|
|
34
34
|
readonly zSize: _angular_core.InputSignal<ZTimelineSize>;
|
|
35
|
-
readonly zTimeVariant: _angular_core.InputSignal<"default" | "
|
|
35
|
+
readonly zTimeVariant: _angular_core.InputSignal<"default" | "outline" | "secondary" | "muted">;
|
|
36
36
|
readonly zLineStyle: _angular_core.InputSignal<ZTimelineLineStyle>;
|
|
37
37
|
readonly zIconStyle: _angular_core.InputSignal<ZTimelineIconStyle>;
|
|
38
38
|
readonly zLayout: _angular_core.InputSignal<ZTimelineLayout>;
|
|
@@ -57,7 +57,7 @@ declare class ZTimelineClassPipe implements PipeTransform {
|
|
|
57
57
|
}
|
|
58
58
|
|
|
59
59
|
declare const zTimelineVariants: (props?: ({
|
|
60
|
-
zSize?: "
|
|
60
|
+
zSize?: "default" | "sm" | "lg" | null | undefined;
|
|
61
61
|
zLayout?: "default" | "reversed" | "alternate" | null | undefined;
|
|
62
62
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
63
63
|
declare const zTimelineItemVariants: (props?: ({
|
|
@@ -71,18 +71,18 @@ declare const zTimelineHeaderVariants: (props?: ({
|
|
|
71
71
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
72
72
|
declare const zTimelineIconVariants: (props?: ({
|
|
73
73
|
zColor?: "default" | "primary" | "success" | "warning" | "error" | "info" | null | undefined;
|
|
74
|
-
zIconStyle?: "
|
|
74
|
+
zIconStyle?: "filled" | "outline" | null | undefined;
|
|
75
75
|
zLayout?: "default" | "reversed" | "alternate" | null | undefined;
|
|
76
76
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
77
77
|
declare const zTimelineTitleVariants: (props?: ({
|
|
78
|
-
zSize?: "
|
|
78
|
+
zSize?: "default" | "sm" | "lg" | null | undefined;
|
|
79
79
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
80
80
|
declare const zTimelineTimeVariants: (props?: ({
|
|
81
|
-
zVariant?: "default" | "
|
|
81
|
+
zVariant?: "default" | "outline" | "secondary" | "muted" | null | undefined;
|
|
82
82
|
zLayout?: "default" | "reversed" | "alternate" | null | undefined;
|
|
83
83
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
84
84
|
declare const zTimelineDescriptionVariants: (props?: ({
|
|
85
|
-
zSize?: "
|
|
85
|
+
zSize?: "default" | "sm" | "lg" | null | undefined;
|
|
86
86
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
87
87
|
declare const zTimelineContentVariants: (props?: ({
|
|
88
88
|
zContentStyle?: "simple" | "card" | null | undefined;
|
|
@@ -91,6 +91,7 @@ declare class ZToastService implements OnDestroy {
|
|
|
91
91
|
private readonly _document;
|
|
92
92
|
private readonly _ngZone;
|
|
93
93
|
private readonly _providedConfig;
|
|
94
|
+
private readonly _zTranslate;
|
|
94
95
|
private _overlayRef;
|
|
95
96
|
private _toasterAttached;
|
|
96
97
|
private _mutationObserver;
|
|
@@ -112,6 +113,7 @@ declare class ZToastService implements OnDestroy {
|
|
|
112
113
|
private _disconnectObserver;
|
|
113
114
|
private _attachToaster;
|
|
114
115
|
private _createOverlay;
|
|
116
|
+
private _translate;
|
|
115
117
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<ZToastService, never>;
|
|
116
118
|
static ɵprov: _angular_core.ɵɵInjectableDeclaration<ZToastService>;
|
|
117
119
|
}
|
|
@@ -87,7 +87,7 @@ declare class ZUploadComponent implements OnInit, ControlValueAccessor {
|
|
|
87
87
|
protected readonly hasError: _angular_core.Signal<boolean>;
|
|
88
88
|
protected readonly showError: _angular_core.Signal<boolean>;
|
|
89
89
|
protected readonly errorMessage: _angular_core.Signal<string>;
|
|
90
|
-
protected readonly currentStatus: _angular_core.Signal<"default" | "
|
|
90
|
+
protected readonly currentStatus: _angular_core.Signal<"default" | "error" | "disabled" | "readonly" | "active">;
|
|
91
91
|
protected readonly dropzoneClasses: _angular_core.Signal<string>;
|
|
92
92
|
protected readonly acceptTypes: _angular_core.Signal<string>;
|
|
93
93
|
protected readonly formatFileSize: (bytes: number) => string;
|
|
@@ -126,11 +126,11 @@ declare class ZUploadComponent implements OnInit, ControlValueAccessor {
|
|
|
126
126
|
|
|
127
127
|
declare const zUploadDropzoneVariants: (props?: ({
|
|
128
128
|
zSize?: "sm" | "default" | "lg" | null | undefined;
|
|
129
|
-
zStatus?: "default" | "
|
|
129
|
+
zStatus?: "default" | "error" | "active" | "disabled" | "readonly" | null | undefined;
|
|
130
130
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
131
131
|
type ZUploadDropzoneVariants = VariantProps<typeof zUploadDropzoneVariants>;
|
|
132
132
|
declare const zUploadFileItemVariants: (props?: ({
|
|
133
|
-
zStatus?: "
|
|
133
|
+
zStatus?: "pending" | "uploading" | "success" | "error" | null | undefined;
|
|
134
134
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
135
135
|
type ZUploadFileItemVariants = VariantProps<typeof zUploadFileItemVariants>;
|
|
136
136
|
|