shirkasoft-ui-components 1.2.0 → 1.3.0
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/shirkasoft-ui-components-breadcrumb.mjs +199 -0
- package/fesm2022/shirkasoft-ui-components-breadcrumb.mjs.map +1 -0
- package/fesm2022/shirkasoft-ui-components-button.mjs +148 -0
- package/fesm2022/shirkasoft-ui-components-button.mjs.map +1 -0
- package/fesm2022/shirkasoft-ui-components-chart.mjs +153 -0
- package/fesm2022/shirkasoft-ui-components-chart.mjs.map +1 -0
- package/fesm2022/shirkasoft-ui-components-confirm-dialog.mjs +143 -0
- package/fesm2022/shirkasoft-ui-components-confirm-dialog.mjs.map +1 -0
- package/fesm2022/shirkasoft-ui-components-date-picker.mjs +638 -0
- package/fesm2022/shirkasoft-ui-components-date-picker.mjs.map +1 -0
- package/fesm2022/shirkasoft-ui-components-fieldset.mjs +94 -0
- package/fesm2022/shirkasoft-ui-components-fieldset.mjs.map +1 -0
- package/fesm2022/shirkasoft-ui-components-file-upload.mjs +242 -0
- package/fesm2022/shirkasoft-ui-components-file-upload.mjs.map +1 -0
- package/fesm2022/shirkasoft-ui-components-knob.mjs +269 -0
- package/fesm2022/shirkasoft-ui-components-knob.mjs.map +1 -0
- package/fesm2022/shirkasoft-ui-components-loading.mjs +255 -0
- package/fesm2022/shirkasoft-ui-components-loading.mjs.map +1 -0
- package/fesm2022/shirkasoft-ui-components-modal.mjs +290 -0
- package/fesm2022/shirkasoft-ui-components-modal.mjs.map +1 -0
- package/fesm2022/shirkasoft-ui-components-notification.mjs +143 -0
- package/fesm2022/shirkasoft-ui-components-notification.mjs.map +1 -0
- package/fesm2022/shirkasoft-ui-components-price-input.mjs +64 -0
- package/fesm2022/shirkasoft-ui-components-price-input.mjs.map +1 -0
- package/fesm2022/shirkasoft-ui-components-rail-sidebar.mjs +205 -0
- package/fesm2022/shirkasoft-ui-components-rail-sidebar.mjs.map +1 -0
- package/fesm2022/shirkasoft-ui-components-select.mjs +737 -0
- package/fesm2022/shirkasoft-ui-components-select.mjs.map +1 -0
- package/fesm2022/shirkasoft-ui-components-sidebar.mjs +185 -0
- package/fesm2022/shirkasoft-ui-components-sidebar.mjs.map +1 -0
- package/fesm2022/shirkasoft-ui-components-skeleton.mjs +74 -0
- package/fesm2022/shirkasoft-ui-components-skeleton.mjs.map +1 -0
- package/fesm2022/shirkasoft-ui-components-table.mjs +689 -0
- package/fesm2022/shirkasoft-ui-components-table.mjs.map +1 -0
- package/fesm2022/shirkasoft-ui-components-tabs.mjs +249 -0
- package/fesm2022/shirkasoft-ui-components-tabs.mjs.map +1 -0
- package/fesm2022/shirkasoft-ui-components-tag.mjs +70 -0
- package/fesm2022/shirkasoft-ui-components-tag.mjs.map +1 -0
- package/fesm2022/shirkasoft-ui-components-text-field.mjs +370 -0
- package/fesm2022/shirkasoft-ui-components-text-field.mjs.map +1 -0
- package/fesm2022/shirkasoft-ui-components-timeline.mjs +222 -0
- package/fesm2022/shirkasoft-ui-components-timeline.mjs.map +1 -0
- package/fesm2022/shirkasoft-ui-components-toggle.mjs +186 -0
- package/fesm2022/shirkasoft-ui-components-toggle.mjs.map +1 -0
- package/fesm2022/shirkasoft-ui-components-tooltip.mjs +169 -0
- package/fesm2022/shirkasoft-ui-components-tooltip.mjs.map +1 -0
- package/fesm2022/shirkasoft-ui-components-utils.mjs +64 -0
- package/fesm2022/shirkasoft-ui-components-utils.mjs.map +1 -0
- package/fesm2022/shirkasoft-ui-components-wizard.mjs +167 -0
- package/fesm2022/shirkasoft-ui-components-wizard.mjs.map +1 -0
- package/fesm2022/shirkasoft-ui-components.mjs +0 -5729
- package/fesm2022/shirkasoft-ui-components.mjs.map +1 -1
- package/package.json +101 -1
- package/types/shirkasoft-ui-components-breadcrumb.d.ts +68 -0
- package/types/shirkasoft-ui-components-button.d.ts +59 -0
- package/types/shirkasoft-ui-components-chart.d.ts +65 -0
- package/types/shirkasoft-ui-components-confirm-dialog.d.ts +88 -0
- package/types/shirkasoft-ui-components-date-picker.d.ts +200 -0
- package/types/shirkasoft-ui-components-fieldset.d.ts +72 -0
- package/types/shirkasoft-ui-components-file-upload.d.ts +87 -0
- package/types/shirkasoft-ui-components-knob.d.ts +69 -0
- package/types/shirkasoft-ui-components-loading.d.ts +94 -0
- package/types/shirkasoft-ui-components-modal.d.ts +139 -0
- package/types/shirkasoft-ui-components-notification.d.ts +82 -0
- package/types/shirkasoft-ui-components-price-input.d.ts +41 -0
- package/types/shirkasoft-ui-components-rail-sidebar.d.ts +121 -0
- package/types/shirkasoft-ui-components-select.d.ts +182 -0
- package/types/shirkasoft-ui-components-sidebar.d.ts +106 -0
- package/types/shirkasoft-ui-components-skeleton.d.ts +36 -0
- package/types/shirkasoft-ui-components-table.d.ts +293 -0
- package/types/shirkasoft-ui-components-tabs.d.ts +102 -0
- package/types/shirkasoft-ui-components-tag.d.ts +31 -0
- package/types/shirkasoft-ui-components-text-field.d.ts +120 -0
- package/types/shirkasoft-ui-components-timeline.d.ts +178 -0
- package/types/shirkasoft-ui-components-toggle.d.ts +48 -0
- package/types/shirkasoft-ui-components-tooltip.d.ts +47 -0
- package/types/shirkasoft-ui-components-utils.d.ts +9 -0
- package/types/shirkasoft-ui-components-wizard.d.ts +101 -0
- package/types/shirkasoft-ui-components.d.ts +1 -2333
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { Injectable, inject, input, signal, computed, effect, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
|
+
import { RouterLink } from '@angular/router';
|
|
4
|
+
import { BehaviorSubject } from 'rxjs';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Global breadcrumb state. Components and pages write the current trail via
|
|
8
|
+
* `set()` and observatories read it through `breadcrumbs$`.
|
|
9
|
+
*/
|
|
10
|
+
class BreadcrumbService {
|
|
11
|
+
constructor() {
|
|
12
|
+
/** Internal buffer holding the current breadcrumb trail. */
|
|
13
|
+
this.breadcrumbsSubject = new BehaviorSubject([]);
|
|
14
|
+
/** Observable emitted with the latest breadcrumb trail. */
|
|
15
|
+
this.breadcrumbs$ = this.breadcrumbsSubject.asObservable();
|
|
16
|
+
}
|
|
17
|
+
/** Replaces the whole breadcrumb trail. */
|
|
18
|
+
set(items) {
|
|
19
|
+
this.breadcrumbsSubject.next(items);
|
|
20
|
+
}
|
|
21
|
+
/** Empties the breadcrumb trail. */
|
|
22
|
+
clear() {
|
|
23
|
+
this.breadcrumbsSubject.next([]);
|
|
24
|
+
}
|
|
25
|
+
/** Returns the breadcrumb trail currently held (snapshot). */
|
|
26
|
+
getCurrent() {
|
|
27
|
+
return this.breadcrumbsSubject.getValue();
|
|
28
|
+
}
|
|
29
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.18", ngImport: i0, type: BreadcrumbService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
30
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.18", ngImport: i0, type: BreadcrumbService, providedIn: 'root' }); }
|
|
31
|
+
}
|
|
32
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.18", ngImport: i0, type: BreadcrumbService, decorators: [{
|
|
33
|
+
type: Injectable,
|
|
34
|
+
args: [{
|
|
35
|
+
providedIn: 'root',
|
|
36
|
+
}]
|
|
37
|
+
}] });
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Shirkasoft UI Components.
|
|
41
|
+
* Authors: Roberto Valladares Martin (Ansem13), Julio César García García (Sanjuli14).
|
|
42
|
+
* Belongs to Shirkasoft.
|
|
43
|
+
*/
|
|
44
|
+
/**
|
|
45
|
+
* Navigation breadcrumb showing the current page hierarchy. Can be fed with
|
|
46
|
+
* static items or driven by the shared BreadcrumbService.
|
|
47
|
+
*/
|
|
48
|
+
class BreadcrumbComponent {
|
|
49
|
+
constructor() {
|
|
50
|
+
this.breadcrumbService = inject(BreadcrumbService);
|
|
51
|
+
/** Static list of breadcrumb items. Takes precedence over the service items. */
|
|
52
|
+
this.items = input([], ...(ngDevMode ? [{ debugName: "items" }] : /* istanbul ignore next */ []));
|
|
53
|
+
/** Visual separator between items: 'chevron', 'slash' or 'arrow'. */
|
|
54
|
+
this.separator = input('chevron', ...(ngDevMode ? [{ debugName: "separator" }] : /* istanbul ignore next */ []));
|
|
55
|
+
/** When true, subscribes to the BreadcrumbService to resolve items. */
|
|
56
|
+
this.useService = input(true, ...(ngDevMode ? [{ debugName: "useService" }] : /* istanbul ignore next */ []));
|
|
57
|
+
/** Items received from the BreadcrumbService. */
|
|
58
|
+
this.serviceItems = signal([], ...(ngDevMode ? [{ debugName: "serviceItems" }] : /* istanbul ignore next */ []));
|
|
59
|
+
/** Final items: static `items` if provided, otherwise the service items. */
|
|
60
|
+
this.resolvedItems = computed(() => {
|
|
61
|
+
const staticItems = this.items();
|
|
62
|
+
if (staticItems.length > 0)
|
|
63
|
+
return staticItems;
|
|
64
|
+
if (this.useService())
|
|
65
|
+
return this.serviceItems();
|
|
66
|
+
return [];
|
|
67
|
+
}, ...(ngDevMode ? [{ debugName: "resolvedItems" }] : /* istanbul ignore next */ []));
|
|
68
|
+
/** Active subscription to the breadcrumb stream. */
|
|
69
|
+
this.serviceSub = null;
|
|
70
|
+
effect(() => {
|
|
71
|
+
this.resolvedItems();
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
/** Subscribes to the BreadcrumbService when `useService` is enabled. */
|
|
75
|
+
ngOnInit() {
|
|
76
|
+
if (this.useService()) {
|
|
77
|
+
this.serviceSub = this.breadcrumbService.breadcrumbs$.subscribe((items) => {
|
|
78
|
+
this.serviceItems.set(items);
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
/** Unsubscribes from the breadcrumb stream to avoid leaks. */
|
|
83
|
+
ngOnDestroy() {
|
|
84
|
+
this.serviceSub?.unsubscribe();
|
|
85
|
+
}
|
|
86
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.18", ngImport: i0, type: BreadcrumbComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
87
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.18", type: BreadcrumbComponent, isStandalone: true, selector: "shk-breadcrumb", inputs: { items: { classPropertyName: "items", publicName: "items", isSignal: true, isRequired: false, transformFunction: null }, separator: { classPropertyName: "separator", publicName: "separator", isSignal: true, isRequired: false, transformFunction: null }, useService: { classPropertyName: "useService", publicName: "useService", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: `
|
|
88
|
+
<nav class="shk-breadcrumb" aria-label="Breadcrumb">
|
|
89
|
+
<ol class="shk-breadcrumb-list">
|
|
90
|
+
@for (item of resolvedItems(); track $index; let last = $last) {
|
|
91
|
+
<li class="shk-breadcrumb-item">
|
|
92
|
+
@if (!last && item.route) {
|
|
93
|
+
<a
|
|
94
|
+
[routerLink]="item.route"
|
|
95
|
+
class="shk-breadcrumb-link"
|
|
96
|
+
[attr.aria-current]="null"
|
|
97
|
+
>
|
|
98
|
+
{{ item.label }}
|
|
99
|
+
</a>
|
|
100
|
+
} @else {
|
|
101
|
+
<span
|
|
102
|
+
class="shk-breadcrumb-current"
|
|
103
|
+
[attr.aria-current]="last ? 'page' : null"
|
|
104
|
+
>
|
|
105
|
+
{{ item.label }}
|
|
106
|
+
</span>
|
|
107
|
+
}
|
|
108
|
+
@if (!last) {
|
|
109
|
+
<span class="shk-breadcrumb-separator" aria-hidden="true">
|
|
110
|
+
@switch (separator()) {
|
|
111
|
+
@case ('slash') {
|
|
112
|
+
<span class="shk-breadcrumb-separator-text">/</span>
|
|
113
|
+
}
|
|
114
|
+
@case ('arrow') {
|
|
115
|
+
<span class="shk-breadcrumb-separator-text">></span>
|
|
116
|
+
}
|
|
117
|
+
@default {
|
|
118
|
+
<svg
|
|
119
|
+
class="shk-breadcrumb-separator-icon"
|
|
120
|
+
viewBox="0 0 24 24"
|
|
121
|
+
fill="none"
|
|
122
|
+
stroke="currentColor"
|
|
123
|
+
stroke-width="2"
|
|
124
|
+
stroke-linecap="round"
|
|
125
|
+
stroke-linejoin="round"
|
|
126
|
+
>
|
|
127
|
+
<polyline points="9 18 15 12 9 6" />
|
|
128
|
+
</svg>
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
</span>
|
|
132
|
+
}
|
|
133
|
+
</li>
|
|
134
|
+
}
|
|
135
|
+
</ol>
|
|
136
|
+
</nav>
|
|
137
|
+
`, isInline: true, styles: [":host{display:block}.shk-breadcrumb-list{display:flex;align-items:center;flex-wrap:wrap;gap:.375rem;list-style:none;margin:0;padding:0;font-size:.9375rem;line-height:1.25rem}.shk-breadcrumb-item{display:inline-flex;align-items:center;gap:.375rem;min-width:0}.shk-breadcrumb-link{color:var(--shk-surface-500);text-decoration:none;transition:color .15s ease;cursor:pointer}.shk-breadcrumb-link:hover{color:var(--shk-primary-600)}.shk-breadcrumb-current{color:var(--shk-primary-700);font-weight:600}.shk-breadcrumb-separator{display:inline-flex;align-items:center;justify-content:center;color:var(--shk-surface-300);-webkit-user-select:none;user-select:none;margin:0 .25rem}.shk-breadcrumb-separator-text{font-size:.875rem}.shk-breadcrumb-separator-icon{width:.875rem;height:.875rem}\n"], dependencies: [{ kind: "directive", type: RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
138
|
+
}
|
|
139
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.18", ngImport: i0, type: BreadcrumbComponent, decorators: [{
|
|
140
|
+
type: Component,
|
|
141
|
+
args: [{ selector: 'shk-breadcrumb', standalone: true, imports: [RouterLink], changeDetection: ChangeDetectionStrategy.OnPush, template: `
|
|
142
|
+
<nav class="shk-breadcrumb" aria-label="Breadcrumb">
|
|
143
|
+
<ol class="shk-breadcrumb-list">
|
|
144
|
+
@for (item of resolvedItems(); track $index; let last = $last) {
|
|
145
|
+
<li class="shk-breadcrumb-item">
|
|
146
|
+
@if (!last && item.route) {
|
|
147
|
+
<a
|
|
148
|
+
[routerLink]="item.route"
|
|
149
|
+
class="shk-breadcrumb-link"
|
|
150
|
+
[attr.aria-current]="null"
|
|
151
|
+
>
|
|
152
|
+
{{ item.label }}
|
|
153
|
+
</a>
|
|
154
|
+
} @else {
|
|
155
|
+
<span
|
|
156
|
+
class="shk-breadcrumb-current"
|
|
157
|
+
[attr.aria-current]="last ? 'page' : null"
|
|
158
|
+
>
|
|
159
|
+
{{ item.label }}
|
|
160
|
+
</span>
|
|
161
|
+
}
|
|
162
|
+
@if (!last) {
|
|
163
|
+
<span class="shk-breadcrumb-separator" aria-hidden="true">
|
|
164
|
+
@switch (separator()) {
|
|
165
|
+
@case ('slash') {
|
|
166
|
+
<span class="shk-breadcrumb-separator-text">/</span>
|
|
167
|
+
}
|
|
168
|
+
@case ('arrow') {
|
|
169
|
+
<span class="shk-breadcrumb-separator-text">></span>
|
|
170
|
+
}
|
|
171
|
+
@default {
|
|
172
|
+
<svg
|
|
173
|
+
class="shk-breadcrumb-separator-icon"
|
|
174
|
+
viewBox="0 0 24 24"
|
|
175
|
+
fill="none"
|
|
176
|
+
stroke="currentColor"
|
|
177
|
+
stroke-width="2"
|
|
178
|
+
stroke-linecap="round"
|
|
179
|
+
stroke-linejoin="round"
|
|
180
|
+
>
|
|
181
|
+
<polyline points="9 18 15 12 9 6" />
|
|
182
|
+
</svg>
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
</span>
|
|
186
|
+
}
|
|
187
|
+
</li>
|
|
188
|
+
}
|
|
189
|
+
</ol>
|
|
190
|
+
</nav>
|
|
191
|
+
`, styles: [":host{display:block}.shk-breadcrumb-list{display:flex;align-items:center;flex-wrap:wrap;gap:.375rem;list-style:none;margin:0;padding:0;font-size:.9375rem;line-height:1.25rem}.shk-breadcrumb-item{display:inline-flex;align-items:center;gap:.375rem;min-width:0}.shk-breadcrumb-link{color:var(--shk-surface-500);text-decoration:none;transition:color .15s ease;cursor:pointer}.shk-breadcrumb-link:hover{color:var(--shk-primary-600)}.shk-breadcrumb-current{color:var(--shk-primary-700);font-weight:600}.shk-breadcrumb-separator{display:inline-flex;align-items:center;justify-content:center;color:var(--shk-surface-300);-webkit-user-select:none;user-select:none;margin:0 .25rem}.shk-breadcrumb-separator-text{font-size:.875rem}.shk-breadcrumb-separator-icon{width:.875rem;height:.875rem}\n"] }]
|
|
192
|
+
}], ctorParameters: () => [], propDecorators: { items: [{ type: i0.Input, args: [{ isSignal: true, alias: "items", required: false }] }], separator: [{ type: i0.Input, args: [{ isSignal: true, alias: "separator", required: false }] }], useService: [{ type: i0.Input, args: [{ isSignal: true, alias: "useService", required: false }] }] } });
|
|
193
|
+
|
|
194
|
+
/**
|
|
195
|
+
* Generated bundle index. Do not edit.
|
|
196
|
+
*/
|
|
197
|
+
|
|
198
|
+
export { BreadcrumbComponent, BreadcrumbService };
|
|
199
|
+
//# sourceMappingURL=shirkasoft-ui-components-breadcrumb.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shirkasoft-ui-components-breadcrumb.mjs","sources":["../../../projects/ui-components/breadcrumb/breadcrumb.service.ts","../../../projects/ui-components/breadcrumb/breadcrumb.component.ts","../../../projects/ui-components/breadcrumb/shirkasoft-ui-components-breadcrumb.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\nimport { BehaviorSubject, Observable } from 'rxjs';\n\n/**\n * Shirkasoft UI Components.\n * Authors: Roberto Valladares Martin (Ansem13), Julio César García García (Sanjuli14).\n * Belongs to Shirkasoft.\n */\n\n/** A single breadcrumb entry with an optional navigation route. */\nexport interface BreadcrumbItem {\n label: string;\n route?: string;\n}\n\n/**\n * Global breadcrumb state. Components and pages write the current trail via\n * `set()` and observatories read it through `breadcrumbs$`.\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class BreadcrumbService {\n /** Internal buffer holding the current breadcrumb trail. */\n private breadcrumbsSubject = new BehaviorSubject<BreadcrumbItem[]>([]);\n /** Observable emitted with the latest breadcrumb trail. */\n breadcrumbs$: Observable<BreadcrumbItem[]> = this.breadcrumbsSubject.asObservable();\n\n /** Replaces the whole breadcrumb trail. */\n set(items: BreadcrumbItem[]): void {\n this.breadcrumbsSubject.next(items);\n }\n\n /** Empties the breadcrumb trail. */\n clear(): void {\n this.breadcrumbsSubject.next([]);\n }\n\n /** Returns the breadcrumb trail currently held (snapshot). */\n getCurrent(): BreadcrumbItem[] {\n return this.breadcrumbsSubject.getValue();\n }\n}","import {\n ChangeDetectionStrategy,\n Component,\n computed,\n effect,\n inject,\n input,\n OnDestroy,\n OnInit,\n signal,\n} from '@angular/core';\nimport { RouterLink } from '@angular/router';\nimport { BreadcrumbItem, BreadcrumbService } from './breadcrumb.service';\n\nexport type BreadcrumbSeparator = 'chevron' | 'slash' | 'arrow';\n\n/**\n * Shirkasoft UI Components.\n * Authors: Roberto Valladares Martin (Ansem13), Julio César García García (Sanjuli14).\n * Belongs to Shirkasoft.\n */\n\n/**\n * Navigation breadcrumb showing the current page hierarchy. Can be fed with\n * static items or driven by the shared BreadcrumbService.\n */\n@Component({\n selector: 'shk-breadcrumb',\n standalone: true,\n imports: [RouterLink],\n changeDetection: ChangeDetectionStrategy.OnPush,\n template: `\n <nav class=\"shk-breadcrumb\" aria-label=\"Breadcrumb\">\n <ol class=\"shk-breadcrumb-list\">\n @for (item of resolvedItems(); track $index; let last = $last) {\n <li class=\"shk-breadcrumb-item\">\n @if (!last && item.route) {\n <a\n [routerLink]=\"item.route\"\n class=\"shk-breadcrumb-link\"\n [attr.aria-current]=\"null\"\n >\n {{ item.label }}\n </a>\n } @else {\n <span\n class=\"shk-breadcrumb-current\"\n [attr.aria-current]=\"last ? 'page' : null\"\n >\n {{ item.label }}\n </span>\n }\n @if (!last) {\n <span class=\"shk-breadcrumb-separator\" aria-hidden=\"true\">\n @switch (separator()) {\n @case ('slash') {\n <span class=\"shk-breadcrumb-separator-text\">/</span>\n }\n @case ('arrow') {\n <span class=\"shk-breadcrumb-separator-text\">></span>\n }\n @default {\n <svg\n class=\"shk-breadcrumb-separator-icon\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n >\n <polyline points=\"9 18 15 12 9 6\" />\n </svg>\n }\n }\n </span>\n }\n </li>\n }\n </ol>\n </nav>\n `,\n styles: [\n `\n :host {\n display: block;\n }\n .shk-breadcrumb-list {\n display: flex;\n align-items: center;\n flex-wrap: wrap;\n gap: 0.375rem;\n list-style: none;\n margin: 0;\n padding: 0;\n font-size: 0.9375rem;\n line-height: 1.25rem;\n }\n .shk-breadcrumb-item {\n display: inline-flex;\n align-items: center;\n gap: 0.375rem;\n min-width: 0;\n }\n .shk-breadcrumb-link {\n color: var(--shk-surface-500);\n text-decoration: none;\n transition: color 0.15s ease;\n cursor: pointer;\n }\n .shk-breadcrumb-link:hover {\n color: var(--shk-primary-600);\n }\n .shk-breadcrumb-current {\n color: var(--shk-primary-700);\n font-weight: 600;\n }\n .shk-breadcrumb-separator {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n color: var(--shk-surface-300);\n user-select: none;\n margin: 0 0.25rem;\n }\n .shk-breadcrumb-separator-text {\n font-size: 0.875rem;\n }\n .shk-breadcrumb-separator-icon {\n width: 0.875rem;\n height: 0.875rem;\n }\n `,\n ],\n})\nexport class BreadcrumbComponent implements OnInit, OnDestroy {\n private readonly breadcrumbService = inject(BreadcrumbService);\n\n /** Static list of breadcrumb items. Takes precedence over the service items. */\n items = input<BreadcrumbItem[]>([]);\n /** Visual separator between items: 'chevron', 'slash' or 'arrow'. */\n separator = input<BreadcrumbSeparator>('chevron');\n /** When true, subscribes to the BreadcrumbService to resolve items. */\n useService = input<boolean>(true);\n\n /** Items received from the BreadcrumbService. */\n protected serviceItems = signal<BreadcrumbItem[]>([]);\n\n /** Final items: static `items` if provided, otherwise the service items. */\n protected resolvedItems = computed<BreadcrumbItem[]>(() => {\n const staticItems = this.items();\n if (staticItems.length > 0) return staticItems;\n if (this.useService()) return this.serviceItems();\n return [];\n });\n\n /** Active subscription to the breadcrumb stream. */\n private serviceSub: { unsubscribe(): void } | null = null;\n\n constructor() {\n effect(() => {\n this.resolvedItems();\n });\n }\n\n /** Subscribes to the BreadcrumbService when `useService` is enabled. */\n ngOnInit(): void {\n if (this.useService()) {\n this.serviceSub = this.breadcrumbService.breadcrumbs$.subscribe((items) => {\n this.serviceItems.set(items);\n });\n }\n }\n\n /** Unsubscribes from the breadcrumb stream to avoid leaks. */\n ngOnDestroy(): void {\n this.serviceSub?.unsubscribe();\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;AAeA;;;AAGG;MAIU,iBAAiB,CAAA;AAH9B,IAAA,WAAA,GAAA;;AAKU,QAAA,IAAA,CAAA,kBAAkB,GAAG,IAAI,eAAe,CAAmB,EAAE,CAAC;;AAEtE,QAAA,IAAA,CAAA,YAAY,GAAiC,IAAI,CAAC,kBAAkB,CAAC,YAAY,EAAE;AAgBpF,IAAA;;AAbC,IAAA,GAAG,CAAC,KAAuB,EAAA;AACzB,QAAA,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,KAAK,CAAC;IACrC;;IAGA,KAAK,GAAA;AACH,QAAA,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,EAAE,CAAC;IAClC;;IAGA,UAAU,GAAA;AACR,QAAA,OAAO,IAAI,CAAC,kBAAkB,CAAC,QAAQ,EAAE;IAC3C;+GAnBW,iBAAiB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAA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,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EApDS,UAAU,EAAA,QAAA,EAAA,cAAA,EAAA,MAAA,EAAA,CAAA,QAAA,EAAA,aAAA,EAAA,UAAA,EAAA,qBAAA,EAAA,OAAA,EAAA,MAAA,EAAA,YAAA,EAAA,kBAAA,EAAA,oBAAA,EAAA,YAAA,EAAA,YAAA,CAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA,CAAA;;4FA0GT,mBAAmB,EAAA,UAAA,EAAA,CAAA;kBA7G/B,SAAS;+BACE,gBAAgB,EAAA,UAAA,EACd,IAAI,EAAA,OAAA,EACP,CAAC,UAAU,CAAC,EAAA,eAAA,EACJ,uBAAuB,CAAC,MAAM,EAAA,QAAA,EACrC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkDT,EAAA,CAAA,EAAA,MAAA,EAAA,CAAA,gxBAAA,CAAA,EAAA;;;ACjFH;;AAEG;;;;"}
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { input, output, computed, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
|
+
import { LucideDynamicIcon } from '@lucide/angular';
|
|
4
|
+
import { getIcon } from 'shirkasoft-ui-components/utils';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Shirkasoft UI Components.
|
|
8
|
+
* Authors: Roberto Valladares Martin (Ansem13), Julio César García García (Sanjuli14).
|
|
9
|
+
* Belongs to Shirkasoft.
|
|
10
|
+
*/
|
|
11
|
+
/** Generic button with icon, severity variants, loading state and sizes. */
|
|
12
|
+
class ButtonComponent {
|
|
13
|
+
constructor() {
|
|
14
|
+
/** Text shown inside the button. */
|
|
15
|
+
this.label = input('', ...(ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []));
|
|
16
|
+
/** Optional leading lucide icon name or component. */
|
|
17
|
+
this.icon = input('', ...(ngDevMode ? [{ debugName: "icon" }] : /* istanbul ignore next */ []));
|
|
18
|
+
/** Position of the icon relative to the label. */
|
|
19
|
+
this.iconPos = input('left', ...(ngDevMode ? [{ debugName: "iconPos" }] : /* istanbul ignore next */ []));
|
|
20
|
+
/** Color variant. Defaults to 'primary'. */
|
|
21
|
+
this.severity = input('primary', ...(ngDevMode ? [{ debugName: "severity" }] : /* istanbul ignore next */ []));
|
|
22
|
+
/** Transparent background with a colored border. */
|
|
23
|
+
this.outlined = input(false, ...(ngDevMode ? [{ debugName: "outlined" }] : /* istanbul ignore next */ []));
|
|
24
|
+
/** Borderless button with a colored label. */
|
|
25
|
+
this.text = input(false, ...(ngDevMode ? [{ debugName: "text" }] : /* istanbul ignore next */ []));
|
|
26
|
+
/** Adds a soft shadow. */
|
|
27
|
+
this.raised = input(false, ...(ngDevMode ? [{ debugName: "raised" }] : /* istanbul ignore next */ []));
|
|
28
|
+
/** Fully rounded corners (pill). */
|
|
29
|
+
this.rounded = input(false, ...(ngDevMode ? [{ debugName: "rounded" }] : /* istanbul ignore next */ []));
|
|
30
|
+
/** Size variant. */
|
|
31
|
+
this.size = input(undefined, ...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
|
|
32
|
+
/** Disables the button. */
|
|
33
|
+
this.disabled = input(false, ...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
|
|
34
|
+
/** Shows a spinner and disables the button. */
|
|
35
|
+
this.loading = input(false, ...(ngDevMode ? [{ debugName: "loading" }] : /* istanbul ignore next */ []));
|
|
36
|
+
/** Icon shown while loading. Defaults to 'refresh'. */
|
|
37
|
+
this.loadingIcon = input('refresh', ...(ngDevMode ? [{ debugName: "loadingIcon" }] : /* istanbul ignore next */ []));
|
|
38
|
+
/** Optional text shown instead of the label while loading. */
|
|
39
|
+
this.loadingText = input('', ...(ngDevMode ? [{ debugName: "loadingText" }] : /* istanbul ignore next */ []));
|
|
40
|
+
/** Native button type. */
|
|
41
|
+
this.type = input('button', ...(ngDevMode ? [{ debugName: "type" }] : /* istanbul ignore next */ []));
|
|
42
|
+
/** Accessible label when the button is icon-only. */
|
|
43
|
+
this.ariaLabel = input('', ...(ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []));
|
|
44
|
+
/** Native title tooltip. */
|
|
45
|
+
this.title = input('', ...(ngDevMode ? [{ debugName: "title" }] : /* istanbul ignore next */ []));
|
|
46
|
+
/** Inline styles applied to the button. */
|
|
47
|
+
this.style = input({}, ...(ngDevMode ? [{ debugName: "style" }] : /* istanbul ignore next */ []));
|
|
48
|
+
/** Extra CSS classes. */
|
|
49
|
+
this.styleClass = input('', ...(ngDevMode ? [{ debugName: "styleClass" }] : /* istanbul ignore next */ []));
|
|
50
|
+
/** Emitted on click with the original MouseEvent. */
|
|
51
|
+
this.onClick = output();
|
|
52
|
+
this.getIcon = getIcon;
|
|
53
|
+
this.iconOnly = computed(() => !this.label() && !!this.icon(), ...(ngDevMode ? [{ debugName: "iconOnly" }] : /* istanbul ignore next */ []));
|
|
54
|
+
}
|
|
55
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.18", ngImport: i0, type: ButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
56
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.18", type: ButtonComponent, isStandalone: true, selector: "shk-button", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, iconPos: { classPropertyName: "iconPos", publicName: "iconPos", isSignal: true, isRequired: false, transformFunction: null }, severity: { classPropertyName: "severity", publicName: "severity", isSignal: true, isRequired: false, transformFunction: null }, outlined: { classPropertyName: "outlined", publicName: "outlined", isSignal: true, isRequired: false, transformFunction: null }, text: { classPropertyName: "text", publicName: "text", isSignal: true, isRequired: false, transformFunction: null }, raised: { classPropertyName: "raised", publicName: "raised", isSignal: true, isRequired: false, transformFunction: null }, rounded: { classPropertyName: "rounded", publicName: "rounded", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, loadingIcon: { classPropertyName: "loadingIcon", publicName: "loadingIcon", isSignal: true, isRequired: false, transformFunction: null }, loadingText: { classPropertyName: "loadingText", publicName: "loadingText", isSignal: true, isRequired: false, transformFunction: null }, type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, style: { classPropertyName: "style", publicName: "style", isSignal: true, isRequired: false, transformFunction: null }, styleClass: { classPropertyName: "styleClass", publicName: "styleClass", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { onClick: "onClick" }, ngImport: i0, template: `
|
|
57
|
+
<button
|
|
58
|
+
[attr.type]="type()"
|
|
59
|
+
class="shk-button"
|
|
60
|
+
[class.shk-button-primary]="severity() === 'primary' || !severity()"
|
|
61
|
+
[class.shk-button-secondary]="severity() === 'secondary'"
|
|
62
|
+
[class.shk-button-success]="severity() === 'success'"
|
|
63
|
+
[class.shk-button-info]="severity() === 'info'"
|
|
64
|
+
[class.shk-button-warning]="severity() === 'warning'"
|
|
65
|
+
[class.shk-button-danger]="severity() === 'danger'"
|
|
66
|
+
[class.shk-button-help]="severity() === 'help'"
|
|
67
|
+
[class.shk-button-contrast]="severity() === 'contrast'"
|
|
68
|
+
[class.shk-button-outlined]="outlined()"
|
|
69
|
+
[class.shk-button-text]="text()"
|
|
70
|
+
[class.shk-button-raised]="raised()"
|
|
71
|
+
[class.shk-button-rounded]="rounded()"
|
|
72
|
+
[class.shk-button-sm]="size() === 'small'"
|
|
73
|
+
[class.shk-button-lg]="size() === 'large'"
|
|
74
|
+
[class.shk-button-icon-right]="iconPos() === 'right'"
|
|
75
|
+
[class.shk-button-icon-top]="iconPos() === 'top'"
|
|
76
|
+
[class.shk-button-icon-bottom]="iconPos() === 'bottom'"
|
|
77
|
+
[class.shk-button-icon-only]="iconOnly()"
|
|
78
|
+
[class.shk-button-loading]="loading()"
|
|
79
|
+
[class]="styleClass()"
|
|
80
|
+
[style]="style()"
|
|
81
|
+
[disabled]="disabled() || loading()"
|
|
82
|
+
[attr.aria-label]="ariaLabel() || undefined"
|
|
83
|
+
[attr.title]="title() || undefined"
|
|
84
|
+
(click)="onClick.emit($event)"
|
|
85
|
+
>
|
|
86
|
+
@if (loading()) {
|
|
87
|
+
<svg [lucideIcon]="getIcon(loadingIcon())" class="shk-button-icon shk-button-spin"></svg>
|
|
88
|
+
} @else if (icon()) {
|
|
89
|
+
<svg [lucideIcon]="getIcon(icon())" class="shk-button-icon"></svg>
|
|
90
|
+
}
|
|
91
|
+
@if (label()) {
|
|
92
|
+
<span>{{ loading() && loadingText() ? loadingText() : label() }}</span>
|
|
93
|
+
}
|
|
94
|
+
<ng-content></ng-content>
|
|
95
|
+
</button>
|
|
96
|
+
`, isInline: true, styles: [":host{display:inline-block}.shk-button{display:inline-flex;align-items:center;justify-content:center;gap:.5rem;padding:.5rem 1rem;border-radius:.5rem;border:1px solid transparent;font-size:.875rem;font-weight:500;line-height:1.25rem;cursor:pointer;-webkit-user-select:none;user-select:none;white-space:nowrap;transition:background-color .15s ease-in-out,border-color .15s ease-in-out,color .15s ease-in-out,box-shadow .15s ease-in-out,opacity .15s ease-in-out}.shk-button:focus-visible{outline:2px solid var(--shk-primary-400);outline-offset:2px}.shk-button:disabled{opacity:.55;cursor:not-allowed}.shk-button-icon{width:1rem;height:1rem;flex-shrink:0}.shk-button-primary{--shk-btn-bg: var(--shk-primary-600);--shk-btn-color: #ffffff;--shk-btn-border: var(--shk-primary-600)}.shk-button-secondary{--shk-btn-bg: var(--shk-surface-100);--shk-btn-color: var(--shk-surface-700);--shk-btn-border: var(--shk-surface-200)}.shk-button-success{--shk-btn-bg: var(--shk-success-600);--shk-btn-color: #ffffff;--shk-btn-border: var(--shk-success-600)}.shk-button-info{--shk-btn-bg: var(--shk-info-600);--shk-btn-color: #ffffff;--shk-btn-border: var(--shk-info-600)}.shk-button-warning{--shk-btn-bg: var(--shk-warning-600);--shk-btn-color: #ffffff;--shk-btn-border: var(--shk-warning-600)}.shk-button-danger{--shk-btn-bg: var(--shk-error-600);--shk-btn-color: #ffffff;--shk-btn-border: var(--shk-error-600)}.shk-button-help{--shk-btn-bg: var(--shk-primary-500);--shk-btn-color: #ffffff;--shk-btn-border: var(--shk-primary-500)}.shk-button-contrast{--shk-btn-bg: var(--shk-surface-900);--shk-btn-color: var(--shk-surface-50);--shk-btn-border: var(--shk-surface-900)}.shk-button{background-color:var(--shk-btn-bg);color:var(--shk-btn-color);border-color:var(--shk-btn-border)}.shk-button:hover:not(:disabled){background-color:color-mix(in srgb,var(--shk-btn-bg) 88%,#000000)}.shk-button-outlined,.shk-button-text{background-color:transparent}.shk-button-outlined{border-color:var(--shk-btn-color)}.shk-button-text{border-color:transparent}.shk-button-text:hover:not(:disabled),.shk-button-outlined:hover:not(:disabled){background-color:color-mix(in srgb,var(--shk-btn-color) 12%,transparent)}.shk-button-raised{box-shadow:0 1px 2px #0000000f,0 4px 8px #0000001a}.shk-button-rounded{border-radius:9999px}.shk-button-sm{padding:.375rem .75rem;font-size:.8125rem}.shk-button-sm .shk-button-icon{width:.875rem;height:.875rem}.shk-button-lg{padding:.75rem 1.5rem;font-size:1rem}.shk-button-lg .shk-button-icon{width:1.25rem;height:1.25rem}.shk-button-icon-only{padding:.5rem}.shk-button-sm.shk-button-icon-only{padding:.375rem}.shk-button-lg.shk-button-icon-only{padding:.75rem}.shk-button-icon-right{flex-direction:row-reverse}.shk-button-icon-top{flex-direction:column}.shk-button-icon-bottom{flex-direction:column-reverse}.shk-button-loading .shk-button-spin{animation:shk-button-spin 1s linear infinite}@keyframes shk-button-spin{to{transform:rotate(360deg)}}\n"], dependencies: [{ kind: "component", type: LucideDynamicIcon, selector: "svg[lucideIcon]", inputs: ["lucideIcon"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
97
|
+
}
|
|
98
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.18", ngImport: i0, type: ButtonComponent, decorators: [{
|
|
99
|
+
type: Component,
|
|
100
|
+
args: [{ selector: 'shk-button', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, imports: [LucideDynamicIcon], template: `
|
|
101
|
+
<button
|
|
102
|
+
[attr.type]="type()"
|
|
103
|
+
class="shk-button"
|
|
104
|
+
[class.shk-button-primary]="severity() === 'primary' || !severity()"
|
|
105
|
+
[class.shk-button-secondary]="severity() === 'secondary'"
|
|
106
|
+
[class.shk-button-success]="severity() === 'success'"
|
|
107
|
+
[class.shk-button-info]="severity() === 'info'"
|
|
108
|
+
[class.shk-button-warning]="severity() === 'warning'"
|
|
109
|
+
[class.shk-button-danger]="severity() === 'danger'"
|
|
110
|
+
[class.shk-button-help]="severity() === 'help'"
|
|
111
|
+
[class.shk-button-contrast]="severity() === 'contrast'"
|
|
112
|
+
[class.shk-button-outlined]="outlined()"
|
|
113
|
+
[class.shk-button-text]="text()"
|
|
114
|
+
[class.shk-button-raised]="raised()"
|
|
115
|
+
[class.shk-button-rounded]="rounded()"
|
|
116
|
+
[class.shk-button-sm]="size() === 'small'"
|
|
117
|
+
[class.shk-button-lg]="size() === 'large'"
|
|
118
|
+
[class.shk-button-icon-right]="iconPos() === 'right'"
|
|
119
|
+
[class.shk-button-icon-top]="iconPos() === 'top'"
|
|
120
|
+
[class.shk-button-icon-bottom]="iconPos() === 'bottom'"
|
|
121
|
+
[class.shk-button-icon-only]="iconOnly()"
|
|
122
|
+
[class.shk-button-loading]="loading()"
|
|
123
|
+
[class]="styleClass()"
|
|
124
|
+
[style]="style()"
|
|
125
|
+
[disabled]="disabled() || loading()"
|
|
126
|
+
[attr.aria-label]="ariaLabel() || undefined"
|
|
127
|
+
[attr.title]="title() || undefined"
|
|
128
|
+
(click)="onClick.emit($event)"
|
|
129
|
+
>
|
|
130
|
+
@if (loading()) {
|
|
131
|
+
<svg [lucideIcon]="getIcon(loadingIcon())" class="shk-button-icon shk-button-spin"></svg>
|
|
132
|
+
} @else if (icon()) {
|
|
133
|
+
<svg [lucideIcon]="getIcon(icon())" class="shk-button-icon"></svg>
|
|
134
|
+
}
|
|
135
|
+
@if (label()) {
|
|
136
|
+
<span>{{ loading() && loadingText() ? loadingText() : label() }}</span>
|
|
137
|
+
}
|
|
138
|
+
<ng-content></ng-content>
|
|
139
|
+
</button>
|
|
140
|
+
`, styles: [":host{display:inline-block}.shk-button{display:inline-flex;align-items:center;justify-content:center;gap:.5rem;padding:.5rem 1rem;border-radius:.5rem;border:1px solid transparent;font-size:.875rem;font-weight:500;line-height:1.25rem;cursor:pointer;-webkit-user-select:none;user-select:none;white-space:nowrap;transition:background-color .15s ease-in-out,border-color .15s ease-in-out,color .15s ease-in-out,box-shadow .15s ease-in-out,opacity .15s ease-in-out}.shk-button:focus-visible{outline:2px solid var(--shk-primary-400);outline-offset:2px}.shk-button:disabled{opacity:.55;cursor:not-allowed}.shk-button-icon{width:1rem;height:1rem;flex-shrink:0}.shk-button-primary{--shk-btn-bg: var(--shk-primary-600);--shk-btn-color: #ffffff;--shk-btn-border: var(--shk-primary-600)}.shk-button-secondary{--shk-btn-bg: var(--shk-surface-100);--shk-btn-color: var(--shk-surface-700);--shk-btn-border: var(--shk-surface-200)}.shk-button-success{--shk-btn-bg: var(--shk-success-600);--shk-btn-color: #ffffff;--shk-btn-border: var(--shk-success-600)}.shk-button-info{--shk-btn-bg: var(--shk-info-600);--shk-btn-color: #ffffff;--shk-btn-border: var(--shk-info-600)}.shk-button-warning{--shk-btn-bg: var(--shk-warning-600);--shk-btn-color: #ffffff;--shk-btn-border: var(--shk-warning-600)}.shk-button-danger{--shk-btn-bg: var(--shk-error-600);--shk-btn-color: #ffffff;--shk-btn-border: var(--shk-error-600)}.shk-button-help{--shk-btn-bg: var(--shk-primary-500);--shk-btn-color: #ffffff;--shk-btn-border: var(--shk-primary-500)}.shk-button-contrast{--shk-btn-bg: var(--shk-surface-900);--shk-btn-color: var(--shk-surface-50);--shk-btn-border: var(--shk-surface-900)}.shk-button{background-color:var(--shk-btn-bg);color:var(--shk-btn-color);border-color:var(--shk-btn-border)}.shk-button:hover:not(:disabled){background-color:color-mix(in srgb,var(--shk-btn-bg) 88%,#000000)}.shk-button-outlined,.shk-button-text{background-color:transparent}.shk-button-outlined{border-color:var(--shk-btn-color)}.shk-button-text{border-color:transparent}.shk-button-text:hover:not(:disabled),.shk-button-outlined:hover:not(:disabled){background-color:color-mix(in srgb,var(--shk-btn-color) 12%,transparent)}.shk-button-raised{box-shadow:0 1px 2px #0000000f,0 4px 8px #0000001a}.shk-button-rounded{border-radius:9999px}.shk-button-sm{padding:.375rem .75rem;font-size:.8125rem}.shk-button-sm .shk-button-icon{width:.875rem;height:.875rem}.shk-button-lg{padding:.75rem 1.5rem;font-size:1rem}.shk-button-lg .shk-button-icon{width:1.25rem;height:1.25rem}.shk-button-icon-only{padding:.5rem}.shk-button-sm.shk-button-icon-only{padding:.375rem}.shk-button-lg.shk-button-icon-only{padding:.75rem}.shk-button-icon-right{flex-direction:row-reverse}.shk-button-icon-top{flex-direction:column}.shk-button-icon-bottom{flex-direction:column-reverse}.shk-button-loading .shk-button-spin{animation:shk-button-spin 1s linear infinite}@keyframes shk-button-spin{to{transform:rotate(360deg)}}\n"] }]
|
|
141
|
+
}], propDecorators: { label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], icon: [{ type: i0.Input, args: [{ isSignal: true, alias: "icon", required: false }] }], iconPos: [{ type: i0.Input, args: [{ isSignal: true, alias: "iconPos", required: false }] }], severity: [{ type: i0.Input, args: [{ isSignal: true, alias: "severity", required: false }] }], outlined: [{ type: i0.Input, args: [{ isSignal: true, alias: "outlined", required: false }] }], text: [{ type: i0.Input, args: [{ isSignal: true, alias: "text", required: false }] }], raised: [{ type: i0.Input, args: [{ isSignal: true, alias: "raised", required: false }] }], rounded: [{ type: i0.Input, args: [{ isSignal: true, alias: "rounded", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], loading: [{ type: i0.Input, args: [{ isSignal: true, alias: "loading", required: false }] }], loadingIcon: [{ type: i0.Input, args: [{ isSignal: true, alias: "loadingIcon", required: false }] }], loadingText: [{ type: i0.Input, args: [{ isSignal: true, alias: "loadingText", required: false }] }], type: [{ type: i0.Input, args: [{ isSignal: true, alias: "type", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: false }] }], style: [{ type: i0.Input, args: [{ isSignal: true, alias: "style", required: false }] }], styleClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "styleClass", required: false }] }], onClick: [{ type: i0.Output, args: ["onClick"] }] } });
|
|
142
|
+
|
|
143
|
+
/**
|
|
144
|
+
* Generated bundle index. Do not edit.
|
|
145
|
+
*/
|
|
146
|
+
|
|
147
|
+
export { ButtonComponent };
|
|
148
|
+
//# sourceMappingURL=shirkasoft-ui-components-button.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shirkasoft-ui-components-button.mjs","sources":["../../../projects/ui-components/button/button.component.ts","../../../projects/ui-components/button/shirkasoft-ui-components-button.ts"],"sourcesContent":["import { Component, computed, input, output, ChangeDetectionStrategy } from '@angular/core';\nimport { LucideDynamicIcon } from '@lucide/angular';\nimport { getIcon } from 'shirkasoft-ui-components/utils';\n\nexport type ButtonSeverity =\n 'primary' | 'secondary' | 'success' | 'info' | 'warning' | 'danger' | 'help' | 'contrast';\nexport type ButtonSize = 'small' | 'large';\nexport type ButtonIconPosition = 'left' | 'right' | 'top' | 'bottom';\n\n/**\n * Shirkasoft UI Components.\n * Authors: Roberto Valladares Martin (Ansem13), Julio César García García (Sanjuli14).\n * Belongs to Shirkasoft.\n */\n\n/** Generic button with icon, severity variants, loading state and sizes. */\n@Component({\n selector: 'shk-button',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [LucideDynamicIcon],\n template: `\n <button\n [attr.type]=\"type()\"\n class=\"shk-button\"\n [class.shk-button-primary]=\"severity() === 'primary' || !severity()\"\n [class.shk-button-secondary]=\"severity() === 'secondary'\"\n [class.shk-button-success]=\"severity() === 'success'\"\n [class.shk-button-info]=\"severity() === 'info'\"\n [class.shk-button-warning]=\"severity() === 'warning'\"\n [class.shk-button-danger]=\"severity() === 'danger'\"\n [class.shk-button-help]=\"severity() === 'help'\"\n [class.shk-button-contrast]=\"severity() === 'contrast'\"\n [class.shk-button-outlined]=\"outlined()\"\n [class.shk-button-text]=\"text()\"\n [class.shk-button-raised]=\"raised()\"\n [class.shk-button-rounded]=\"rounded()\"\n [class.shk-button-sm]=\"size() === 'small'\"\n [class.shk-button-lg]=\"size() === 'large'\"\n [class.shk-button-icon-right]=\"iconPos() === 'right'\"\n [class.shk-button-icon-top]=\"iconPos() === 'top'\"\n [class.shk-button-icon-bottom]=\"iconPos() === 'bottom'\"\n [class.shk-button-icon-only]=\"iconOnly()\"\n [class.shk-button-loading]=\"loading()\"\n [class]=\"styleClass()\"\n [style]=\"style()\"\n [disabled]=\"disabled() || loading()\"\n [attr.aria-label]=\"ariaLabel() || undefined\"\n [attr.title]=\"title() || undefined\"\n (click)=\"onClick.emit($event)\"\n >\n @if (loading()) {\n <svg [lucideIcon]=\"getIcon(loadingIcon())\" class=\"shk-button-icon shk-button-spin\"></svg>\n } @else if (icon()) {\n <svg [lucideIcon]=\"getIcon(icon())\" class=\"shk-button-icon\"></svg>\n }\n @if (label()) {\n <span>{{ loading() && loadingText() ? loadingText() : label() }}</span>\n }\n <ng-content></ng-content>\n </button>\n `,\n styles: [\n `\n :host {\n display: inline-block;\n }\n .shk-button {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n gap: 0.5rem;\n padding: 0.5rem 1rem;\n border-radius: 0.5rem;\n border: 1px solid transparent;\n font-size: 0.875rem;\n font-weight: 500;\n line-height: 1.25rem;\n cursor: pointer;\n user-select: none;\n white-space: nowrap;\n transition:\n background-color 0.15s ease-in-out,\n border-color 0.15s ease-in-out,\n color 0.15s ease-in-out,\n box-shadow 0.15s ease-in-out,\n opacity 0.15s ease-in-out;\n }\n .shk-button:focus-visible {\n outline: 2px solid var(--shk-primary-400);\n outline-offset: 2px;\n }\n .shk-button:disabled {\n opacity: 0.55;\n cursor: not-allowed;\n }\n .shk-button-icon {\n width: 1rem;\n height: 1rem;\n flex-shrink: 0;\n }\n\n .shk-button-primary {\n --shk-btn-bg: var(--shk-primary-600);\n --shk-btn-color: #ffffff;\n --shk-btn-border: var(--shk-primary-600);\n }\n .shk-button-secondary {\n --shk-btn-bg: var(--shk-surface-100);\n --shk-btn-color: var(--shk-surface-700);\n --shk-btn-border: var(--shk-surface-200);\n }\n .shk-button-success {\n --shk-btn-bg: var(--shk-success-600);\n --shk-btn-color: #ffffff;\n --shk-btn-border: var(--shk-success-600);\n }\n .shk-button-info {\n --shk-btn-bg: var(--shk-info-600);\n --shk-btn-color: #ffffff;\n --shk-btn-border: var(--shk-info-600);\n }\n .shk-button-warning {\n --shk-btn-bg: var(--shk-warning-600);\n --shk-btn-color: #ffffff;\n --shk-btn-border: var(--shk-warning-600);\n }\n .shk-button-danger {\n --shk-btn-bg: var(--shk-error-600);\n --shk-btn-color: #ffffff;\n --shk-btn-border: var(--shk-error-600);\n }\n .shk-button-help {\n --shk-btn-bg: var(--shk-primary-500);\n --shk-btn-color: #ffffff;\n --shk-btn-border: var(--shk-primary-500);\n }\n .shk-button-contrast {\n --shk-btn-bg: var(--shk-surface-900);\n --shk-btn-color: var(--shk-surface-50);\n --shk-btn-border: var(--shk-surface-900);\n }\n\n .shk-button {\n background-color: var(--shk-btn-bg);\n color: var(--shk-btn-color);\n border-color: var(--shk-btn-border);\n }\n .shk-button:hover:not(:disabled) {\n background-color: color-mix(in srgb, var(--shk-btn-bg) 88%, #000000);\n }\n .shk-button-outlined,\n .shk-button-text {\n background-color: transparent;\n }\n .shk-button-outlined {\n border-color: var(--shk-btn-color);\n }\n .shk-button-text {\n border-color: transparent;\n }\n .shk-button-text:hover:not(:disabled),\n .shk-button-outlined:hover:not(:disabled) {\n background-color: color-mix(in srgb, var(--shk-btn-color) 12%, transparent);\n }\n .shk-button-raised {\n box-shadow:\n 0 1px 2px rgba(0, 0, 0, 0.06),\n 0 4px 8px rgba(0, 0, 0, 0.1);\n }\n .shk-button-rounded {\n border-radius: 9999px;\n }\n .shk-button-sm {\n padding: 0.375rem 0.75rem;\n font-size: 0.8125rem;\n }\n .shk-button-sm .shk-button-icon {\n width: 0.875rem;\n height: 0.875rem;\n }\n .shk-button-lg {\n padding: 0.75rem 1.5rem;\n font-size: 1rem;\n }\n .shk-button-lg .shk-button-icon {\n width: 1.25rem;\n height: 1.25rem;\n }\n .shk-button-icon-only {\n padding: 0.5rem;\n }\n .shk-button-sm.shk-button-icon-only {\n padding: 0.375rem;\n }\n .shk-button-lg.shk-button-icon-only {\n padding: 0.75rem;\n }\n .shk-button-icon-right {\n flex-direction: row-reverse;\n }\n .shk-button-icon-top {\n flex-direction: column;\n }\n .shk-button-icon-bottom {\n flex-direction: column-reverse;\n }\n .shk-button-loading .shk-button-spin {\n animation: shk-button-spin 1s linear infinite;\n }\n @keyframes shk-button-spin {\n to {\n transform: rotate(360deg);\n }\n }\n `,\n ],\n})\nexport class ButtonComponent {\n /** Text shown inside the button. */\n label = input<string>('');\n /** Optional leading lucide icon name or component. */\n icon = input<string | any>('');\n /** Position of the icon relative to the label. */\n iconPos = input<ButtonIconPosition>('left');\n /** Color variant. Defaults to 'primary'. */\n severity = input<ButtonSeverity>('primary');\n /** Transparent background with a colored border. */\n outlined = input<boolean>(false);\n /** Borderless button with a colored label. */\n text = input<boolean>(false);\n /** Adds a soft shadow. */\n raised = input<boolean>(false);\n /** Fully rounded corners (pill). */\n rounded = input<boolean>(false);\n /** Size variant. */\n size = input<ButtonSize | undefined>(undefined);\n /** Disables the button. */\n disabled = input<boolean>(false);\n /** Shows a spinner and disables the button. */\n loading = input<boolean>(false);\n /** Icon shown while loading. Defaults to 'refresh'. */\n loadingIcon = input<string>('refresh');\n /** Optional text shown instead of the label while loading. */\n loadingText = input<string>('');\n /** Native button type. */\n type = input<'button' | 'submit' | 'reset'>('button');\n /** Accessible label when the button is icon-only. */\n ariaLabel = input<string>('');\n /** Native title tooltip. */\n title = input<string>('');\n /** Inline styles applied to the button. */\n style = input<Record<string, string | number>>({});\n /** Extra CSS classes. */\n styleClass = input<string>('');\n\n /** Emitted on click with the original MouseEvent. */\n onClick = output<MouseEvent>();\n\n protected getIcon = getIcon;\n\n protected iconOnly = computed(() => !this.label() && !!this.icon());\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;AASA;;;;AAIG;AAEH;MA2Ma,eAAe,CAAA;AA1M5B,IAAA,WAAA,GAAA;;AA4ME,QAAA,IAAA,CAAA,KAAK,GAAG,KAAK,CAAS,EAAE,4EAAC;;AAEzB,QAAA,IAAA,CAAA,IAAI,GAAG,KAAK,CAAe,EAAE,2EAAC;;AAE9B,QAAA,IAAA,CAAA,OAAO,GAAG,KAAK,CAAqB,MAAM,8EAAC;;AAE3C,QAAA,IAAA,CAAA,QAAQ,GAAG,KAAK,CAAiB,SAAS,+EAAC;;AAE3C,QAAA,IAAA,CAAA,QAAQ,GAAG,KAAK,CAAU,KAAK,+EAAC;;AAEhC,QAAA,IAAA,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EAAA,EAAA,KAAA,EAAA,EAAA,iBAAA,EAAA,OAAA,EAAA,UAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,UAAA,EAAA,EAAA,iBAAA,EAAA,YAAA,EAAA,UAAA,EAAA,YAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,EAAA,OAAA,EAAA,EAAA,OAAA,EAAA,SAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,EArMhB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwCT,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,MAAA,EAAA,CAAA,k4FAAA,CAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAzCS,iBAAiB,EAAA,QAAA,EAAA,iBAAA,EAAA,MAAA,EAAA,CAAA,YAAA,CAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA,CAAA;;4FAsMhB,eAAe,EAAA,UAAA,EAAA,CAAA;kBA1M3B,SAAS;+BACE,YAAY,EAAA,UAAA,EACV,IAAI,EAAA,eAAA,EACC,uBAAuB,CAAC,MAAM,EAAA,OAAA,EACtC,CAAC,iBAAiB,CAAC,EAAA,QAAA,EAClB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwCT,EAAA,CAAA,EAAA,MAAA,EAAA,CAAA,k4FAAA,CAAA,EAAA;;;AC7DH;;AAEG;;;;"}
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { input, viewChild, effect, untracked, Component } from '@angular/core';
|
|
3
|
+
import { Chart, registerables } from 'chart.js';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Shirkasoft UI Components.
|
|
7
|
+
* Authors: Roberto Valladares Martin (Ansem13), Julio César García García (Sanjuli14).
|
|
8
|
+
* Belongs to Shirkasoft.
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* Chart.js wrapper that renders line, bar, pie, doughnut or polarArea charts
|
|
12
|
+
* and updates them reactively as the inputs change.
|
|
13
|
+
*/
|
|
14
|
+
class ChartComponent {
|
|
15
|
+
/** Guarantees Chart.js plugins are only registered once. */
|
|
16
|
+
static { this.registered = false; }
|
|
17
|
+
constructor() {
|
|
18
|
+
/** Type of chart to render. */
|
|
19
|
+
this.type = input('bar', ...(ngDevMode ? [{ debugName: "type" }] : /* istanbul ignore next */ []));
|
|
20
|
+
/** Chart.js datasets payload. */
|
|
21
|
+
this.data = input({ datasets: [] }, ...(ngDevMode ? [{ debugName: "data" }] : /* istanbul ignore next */ []));
|
|
22
|
+
/** Chart.js options object. */
|
|
23
|
+
this.options = input({}, ...(ngDevMode ? [{ debugName: "options" }] : /* istanbul ignore next */ []));
|
|
24
|
+
/** Reference to the inner canvas element. */
|
|
25
|
+
this.canvasRef = viewChild.required('canvas');
|
|
26
|
+
/** Live Chart.js instance. */
|
|
27
|
+
this.chartInstance = null;
|
|
28
|
+
/** Whether the view has been initialized yet. */
|
|
29
|
+
this.initialized = false;
|
|
30
|
+
if (!ChartComponent.registered) {
|
|
31
|
+
Chart.register(...registerables);
|
|
32
|
+
ChartComponent.registered = true;
|
|
33
|
+
}
|
|
34
|
+
effect(() => {
|
|
35
|
+
const t = this.type();
|
|
36
|
+
const d = this.data();
|
|
37
|
+
const o = this.options();
|
|
38
|
+
untracked(() => {
|
|
39
|
+
if (!this.initialized)
|
|
40
|
+
return;
|
|
41
|
+
this.updateChart(t, d, o);
|
|
42
|
+
});
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
/** Creates the initial chart once the canvas is available. */
|
|
46
|
+
ngAfterViewInit() {
|
|
47
|
+
this.initialized = true;
|
|
48
|
+
this.initChart();
|
|
49
|
+
}
|
|
50
|
+
/** Destroys the Chart.js instance. */
|
|
51
|
+
ngOnDestroy() {
|
|
52
|
+
this.chartInstance?.destroy();
|
|
53
|
+
}
|
|
54
|
+
/** Clears the canvas by reassigning its width. */
|
|
55
|
+
resetCanvas() {
|
|
56
|
+
const canvas = this.canvasRef().nativeElement;
|
|
57
|
+
canvas.width = canvas.width;
|
|
58
|
+
}
|
|
59
|
+
/** Creates a new Chart.js instance on the canvas. */
|
|
60
|
+
initChart() {
|
|
61
|
+
this.resetCanvas();
|
|
62
|
+
const canvas = this.canvasRef().nativeElement;
|
|
63
|
+
const ctx = canvas.getContext('2d');
|
|
64
|
+
if (!ctx)
|
|
65
|
+
return;
|
|
66
|
+
this.chartInstance = new Chart(ctx, {
|
|
67
|
+
type: this.type(),
|
|
68
|
+
data: this.deepClone(this.data()),
|
|
69
|
+
options: this.deepClone(this.options()),
|
|
70
|
+
});
|
|
71
|
+
this.chartInstance.resize();
|
|
72
|
+
}
|
|
73
|
+
/** Deep clones a value to detach it from Angular's reactive objects. */
|
|
74
|
+
deepClone(value) {
|
|
75
|
+
try {
|
|
76
|
+
if (typeof structuredClone === 'function')
|
|
77
|
+
return structuredClone(value);
|
|
78
|
+
}
|
|
79
|
+
catch { }
|
|
80
|
+
return JSON.parse(JSON.stringify(value));
|
|
81
|
+
}
|
|
82
|
+
/** Applies the new data/options, rebuilding the chart when the type changes. */
|
|
83
|
+
updateChart(type, data, options) {
|
|
84
|
+
if (!this.chartInstance) {
|
|
85
|
+
this.initChart();
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
88
|
+
const config = this.chartInstance.config;
|
|
89
|
+
if (type !== config.type) {
|
|
90
|
+
this.chartInstance.stop();
|
|
91
|
+
this.chartInstance.destroy();
|
|
92
|
+
this.chartInstance = null;
|
|
93
|
+
this.resetCanvas();
|
|
94
|
+
this.initChart();
|
|
95
|
+
return;
|
|
96
|
+
}
|
|
97
|
+
this.chartInstance.data = data;
|
|
98
|
+
this.chartInstance.options = options;
|
|
99
|
+
this.chartInstance.update();
|
|
100
|
+
}
|
|
101
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.18", ngImport: i0, type: ChartComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
102
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "21.2.18", type: ChartComponent, isStandalone: true, selector: "shk-chart", inputs: { type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null }, data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: false, transformFunction: null }, options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null } }, viewQueries: [{ propertyName: "canvasRef", first: true, predicate: ["canvas"], descendants: true, isSignal: true }], ngImport: i0, template: `
|
|
103
|
+
<div class="relative h-full w-full">
|
|
104
|
+
<canvas #canvas></canvas>
|
|
105
|
+
</div>
|
|
106
|
+
`, isInline: true }); }
|
|
107
|
+
}
|
|
108
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.18", ngImport: i0, type: ChartComponent, decorators: [{
|
|
109
|
+
type: Component,
|
|
110
|
+
args: [{
|
|
111
|
+
selector: 'shk-chart',
|
|
112
|
+
standalone: true,
|
|
113
|
+
template: `
|
|
114
|
+
<div class="relative h-full w-full">
|
|
115
|
+
<canvas #canvas></canvas>
|
|
116
|
+
</div>
|
|
117
|
+
`,
|
|
118
|
+
}]
|
|
119
|
+
}], ctorParameters: () => [], propDecorators: { type: [{ type: i0.Input, args: [{ isSignal: true, alias: "type", required: false }] }], data: [{ type: i0.Input, args: [{ isSignal: true, alias: "data", required: false }] }], options: [{ type: i0.Input, args: [{ isSignal: true, alias: "options", required: false }] }], canvasRef: [{ type: i0.ViewChild, args: ['canvas', { isSignal: true }] }] } });
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* Shirkasoft UI Components.
|
|
123
|
+
* Authors: Roberto Valladares Martin (Ansem13), Julio César García García (Sanjuli14).
|
|
124
|
+
* Belongs to Shirkasoft.
|
|
125
|
+
*/
|
|
126
|
+
/** Default dataset colors used by the ChartComponent when no palette is provided. */
|
|
127
|
+
const COLOR_PALETTE = [
|
|
128
|
+
{ bg: 'rgba(59, 130, 246, 0.2)', border: 'rgb(59, 130, 246)' },
|
|
129
|
+
{ bg: 'rgba(34, 197, 94, 0.2)', border: 'rgb(34, 197, 94)' },
|
|
130
|
+
{ bg: 'rgba(249, 115, 22, 0.2)', border: 'rgb(249, 115, 22)' },
|
|
131
|
+
{ bg: 'rgba(139, 92, 246, 0.2)', border: 'rgb(139, 92, 246)' },
|
|
132
|
+
{ bg: 'rgba(236, 72, 153, 0.2)', border: 'rgb(236, 72, 153)' },
|
|
133
|
+
{ bg: 'rgba(6, 182, 212, 0.2)', border: 'rgb(6, 182, 212)' },
|
|
134
|
+
];
|
|
135
|
+
/**
|
|
136
|
+
* Reads the current `--shk-*` CSS variables from the document and returns
|
|
137
|
+
* the text, muted and border colors used by charts to follow the active theme.
|
|
138
|
+
*/
|
|
139
|
+
function readThemeColors() {
|
|
140
|
+
const docStyle = getComputedStyle(document.documentElement);
|
|
141
|
+
return {
|
|
142
|
+
text: docStyle.getPropertyValue('--shk-surface-900') || '#27272a',
|
|
143
|
+
muted: docStyle.getPropertyValue('--shk-surface-500') || '#71717a',
|
|
144
|
+
border: docStyle.getPropertyValue('--shk-surface-200') || '#e4e4e7',
|
|
145
|
+
};
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
/**
|
|
149
|
+
* Generated bundle index. Do not edit.
|
|
150
|
+
*/
|
|
151
|
+
|
|
152
|
+
export { COLOR_PALETTE, ChartComponent, readThemeColors };
|
|
153
|
+
//# sourceMappingURL=shirkasoft-ui-components-chart.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shirkasoft-ui-components-chart.mjs","sources":["../../../projects/ui-components/chart/chart.component.ts","../../../projects/ui-components/chart/chart.utils.ts","../../../projects/ui-components/chart/shirkasoft-ui-components-chart.ts"],"sourcesContent":["import {\n Component,\n input,\n viewChild,\n ElementRef,\n effect,\n untracked,\n AfterViewInit,\n OnDestroy,\n} from '@angular/core';\nimport { Chart, registerables } from 'chart.js';\n\n/**\n * Shirkasoft UI Components.\n * Authors: Roberto Valladares Martin (Ansem13), Julio César García García (Sanjuli14).\n * Belongs to Shirkasoft.\n */\n\n/**\n * Chart.js wrapper that renders line, bar, pie, doughnut or polarArea charts\n * and updates them reactively as the inputs change.\n */\n@Component({\n selector: 'shk-chart',\n standalone: true,\n template: `\n <div class=\"relative h-full w-full\">\n <canvas #canvas></canvas>\n </div>\n `,\n})\nexport class ChartComponent implements AfterViewInit, OnDestroy {\n /** Guarantees Chart.js plugins are only registered once. */\n private static registered = false;\n\n /** Type of chart to render. */\n type = input<'line' | 'bar' | 'pie' | 'doughnut' | 'polarArea'>('bar');\n /** Chart.js datasets payload. */\n data = input<any>({ datasets: [] });\n /** Chart.js options object. */\n options = input<any>({});\n\n /** Reference to the inner canvas element. */\n private canvasRef = viewChild.required<ElementRef<HTMLCanvasElement>>('canvas');\n /** Live Chart.js instance. */\n private chartInstance: Chart | null = null;\n /** Whether the view has been initialized yet. */\n private initialized = false;\n\n constructor() {\n if (!ChartComponent.registered) {\n Chart.register(...registerables);\n ChartComponent.registered = true;\n }\n\n effect(() => {\n const t = this.type();\n const d = this.data();\n const o = this.options();\n untracked(() => {\n if (!this.initialized) return;\n this.updateChart(t, d, o);\n });\n });\n }\n\n /** Creates the initial chart once the canvas is available. */\n ngAfterViewInit(): void {\n this.initialized = true;\n this.initChart();\n }\n\n /** Destroys the Chart.js instance. */\n ngOnDestroy(): void {\n this.chartInstance?.destroy();\n }\n\n /** Clears the canvas by reassigning its width. */\n private resetCanvas(): void {\n const canvas = this.canvasRef().nativeElement;\n canvas.width = canvas.width;\n }\n\n /** Creates a new Chart.js instance on the canvas. */\n private initChart(): void {\n this.resetCanvas();\n const canvas = this.canvasRef().nativeElement;\n const ctx = canvas.getContext('2d');\n if (!ctx) return;\n this.chartInstance = new Chart(ctx, {\n type: this.type(),\n data: this.deepClone(this.data()),\n options: this.deepClone(this.options()),\n });\n this.chartInstance.resize();\n }\n\n /** Deep clones a value to detach it from Angular's reactive objects. */\n private deepClone<T>(value: T): T {\n try {\n if (typeof structuredClone === 'function') return structuredClone(value);\n } catch {}\n return JSON.parse(JSON.stringify(value));\n }\n\n /** Applies the new data/options, rebuilding the chart when the type changes. */\n private updateChart(type: string, data: any, options: any): void {\n if (!this.chartInstance) {\n this.initChart();\n return;\n }\n\n const config = this.chartInstance.config as any;\n if (type !== config.type) {\n this.chartInstance.stop();\n this.chartInstance.destroy();\n this.chartInstance = null;\n this.resetCanvas();\n this.initChart();\n return;\n }\n\n this.chartInstance.data = data;\n this.chartInstance.options = options;\n this.chartInstance.update();\n }\n}\n","/**\n * Shirkasoft UI Components.\n * Authors: Roberto Valladares Martin (Ansem13), Julio César García García (Sanjuli14).\n * Belongs to Shirkasoft.\n */\n\n/** Default dataset colors used by the ChartComponent when no palette is provided. */\nexport const COLOR_PALETTE = [\n { bg: 'rgba(59, 130, 246, 0.2)', border: 'rgb(59, 130, 246)' },\n { bg: 'rgba(34, 197, 94, 0.2)', border: 'rgb(34, 197, 94)' },\n { bg: 'rgba(249, 115, 22, 0.2)', border: 'rgb(249, 115, 22)' },\n { bg: 'rgba(139, 92, 246, 0.2)', border: 'rgb(139, 92, 246)' },\n { bg: 'rgba(236, 72, 153, 0.2)', border: 'rgb(236, 72, 153)' },\n { bg: 'rgba(6, 182, 212, 0.2)', border: 'rgb(6, 182, 212)' },\n];\n\n/**\n * Reads the current `--shk-*` CSS variables from the document and returns\n * the text, muted and border colors used by charts to follow the active theme.\n */\nexport function readThemeColors() {\n const docStyle = getComputedStyle(document.documentElement);\n return {\n text: docStyle.getPropertyValue('--shk-surface-900') || '#27272a',\n muted: docStyle.getPropertyValue('--shk-surface-500') || '#71717a',\n border: docStyle.getPropertyValue('--shk-surface-200') || '#e4e4e7',\n };\n}","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;AAYA;;;;AAIG;AAEH;;;AAGG;MAUU,cAAc,CAAA;;aAEV,IAAA,CAAA,UAAU,GAAG,KAAH,CAAS;AAgBlC,IAAA,WAAA,GAAA;;AAbA,QAAA,IAAA,CAAA,IAAI,GAAG,KAAK,CAAoD,KAAK,2EAAC;;QAEtE,IAAA,CAAA,IAAI,GAAG,KAAK,CAAM,EAAE,QAAQ,EAAE,EAAE,EAAE,EAAA,IAAA,SAAA,GAAA,CAAA,EAAA,SAAA,EAAA,MAAA,EAAA,CAAA,8BAAA,EAAA,CAAA,CAAC;;AAEnC,QAAA,IAAA,CAAA,OAAO,GAAG,KAAK,CAAM,EAAE,8EAAC;;AAGhB,QAAA,IAAA,CAAA,SAAS,GAAG,SAAS,CAAC,QAAQ,CAAgC,QAAQ,CAAC;;QAEvE,IAAA,CAAA,aAAa,GAAiB,IAAI;;QAElC,IAAA,CAAA,WAAW,GAAG,KAAK;AAGzB,QAAA,IAAI,CAAC,cAAc,CAAC,UAAU,EAAE;AAC9B,YAAA,KAAK,CAAC,QAAQ,CAAC,GAAG,aAAa,CAAC;AAChC,YAAA,cAAc,CAAC,UAAU,GAAG,IAAI;QAClC;QAEA,MAAM,CAAC,MAAK;AACV,YAAA,MAAM,CAAC,GAAG,IAAI,CAAC,IAAI,EAAE;AACrB,YAAA,MAAM,CAAC,GAAG,IAAI,CAAC,IAAI,EAAE;AACrB,YAAA,MAAM,CAAC,GAAG,IAAI,CAAC,OAAO,EAAE;YACxB,SAAS,CAAC,MAAK;gBACb,IAAI,CAAC,IAAI,CAAC,WAAW;oBAAE;gBACvB,IAAI,CAAC,WAAW,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;AAC3B,YAAA,CAAC,CAAC;AACJ,QAAA,CAAC,CAAC;IACJ;;IAGA,e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