shirkasoft-ui-components 1.14.0 → 2.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (92) hide show
  1. package/README.md +12 -9
  2. package/fesm2022/shirkasoft-ui-components-breadcrumb.mjs +189 -100
  3. package/fesm2022/shirkasoft-ui-components-breadcrumb.mjs.map +1 -1
  4. package/fesm2022/shirkasoft-ui-components-button.mjs +363 -69
  5. package/fesm2022/shirkasoft-ui-components-button.mjs.map +1 -1
  6. package/fesm2022/shirkasoft-ui-components-chart.mjs +206 -142
  7. package/fesm2022/shirkasoft-ui-components-chart.mjs.map +1 -1
  8. package/fesm2022/shirkasoft-ui-components-config.mjs +905 -843
  9. package/fesm2022/shirkasoft-ui-components-config.mjs.map +1 -1
  10. package/fesm2022/shirkasoft-ui-components-confirm-dialog.mjs +307 -142
  11. package/fesm2022/shirkasoft-ui-components-confirm-dialog.mjs.map +1 -1
  12. package/fesm2022/shirkasoft-ui-components-date-picker.mjs +1697 -1440
  13. package/fesm2022/shirkasoft-ui-components-date-picker.mjs.map +1 -1
  14. package/fesm2022/shirkasoft-ui-components-fieldset.mjs +347 -92
  15. package/fesm2022/shirkasoft-ui-components-fieldset.mjs.map +1 -1
  16. package/fesm2022/shirkasoft-ui-components-file-upload.mjs +555 -300
  17. package/fesm2022/shirkasoft-ui-components-file-upload.mjs.map +1 -1
  18. package/fesm2022/shirkasoft-ui-components-icons.mjs +1028 -533
  19. package/fesm2022/shirkasoft-ui-components-icons.mjs.map +1 -1
  20. package/fesm2022/shirkasoft-ui-components-knob.mjs +389 -201
  21. package/fesm2022/shirkasoft-ui-components-knob.mjs.map +1 -1
  22. package/fesm2022/shirkasoft-ui-components-loading.mjs +505 -128
  23. package/fesm2022/shirkasoft-ui-components-loading.mjs.map +1 -1
  24. package/fesm2022/shirkasoft-ui-components-modal.mjs +311 -314
  25. package/fesm2022/shirkasoft-ui-components-modal.mjs.map +1 -1
  26. package/fesm2022/shirkasoft-ui-components-notification.mjs +188 -142
  27. package/fesm2022/shirkasoft-ui-components-notification.mjs.map +1 -1
  28. package/fesm2022/shirkasoft-ui-components-price-input.mjs +585 -327
  29. package/fesm2022/shirkasoft-ui-components-price-input.mjs.map +1 -1
  30. package/fesm2022/shirkasoft-ui-components-rail-sidebar.mjs +669 -289
  31. package/fesm2022/shirkasoft-ui-components-rail-sidebar.mjs.map +1 -1
  32. package/fesm2022/shirkasoft-ui-components-select.mjs +1076 -819
  33. package/fesm2022/shirkasoft-ui-components-select.mjs.map +1 -1
  34. package/fesm2022/shirkasoft-ui-components-sidebar.mjs +508 -184
  35. package/fesm2022/shirkasoft-ui-components-sidebar.mjs.map +1 -1
  36. package/fesm2022/shirkasoft-ui-components-skeleton.mjs +197 -57
  37. package/fesm2022/shirkasoft-ui-components-skeleton.mjs.map +1 -1
  38. package/fesm2022/shirkasoft-ui-components-table.mjs +1916 -1698
  39. package/fesm2022/shirkasoft-ui-components-table.mjs.map +1 -1
  40. package/fesm2022/shirkasoft-ui-components-tabs.mjs +419 -175
  41. package/fesm2022/shirkasoft-ui-components-tabs.mjs.map +1 -1
  42. package/fesm2022/shirkasoft-ui-components-tag.mjs +175 -49
  43. package/fesm2022/shirkasoft-ui-components-tag.mjs.map +1 -1
  44. package/fesm2022/shirkasoft-ui-components-text-field.mjs +749 -402
  45. package/fesm2022/shirkasoft-ui-components-text-field.mjs.map +1 -1
  46. package/fesm2022/shirkasoft-ui-components-theme-picker.mjs +310 -124
  47. package/fesm2022/shirkasoft-ui-components-theme-picker.mjs.map +1 -1
  48. package/fesm2022/shirkasoft-ui-components-theme.mjs +141 -174
  49. package/fesm2022/shirkasoft-ui-components-theme.mjs.map +1 -1
  50. package/fesm2022/shirkasoft-ui-components-timeline.mjs +791 -203
  51. package/fesm2022/shirkasoft-ui-components-timeline.mjs.map +1 -1
  52. package/fesm2022/shirkasoft-ui-components-toggle.mjs +179 -109
  53. package/fesm2022/shirkasoft-ui-components-toggle.mjs.map +1 -1
  54. package/fesm2022/shirkasoft-ui-components-tooltip.mjs +244 -180
  55. package/fesm2022/shirkasoft-ui-components-tooltip.mjs.map +1 -1
  56. package/fesm2022/shirkasoft-ui-components-utils.mjs +129 -133
  57. package/fesm2022/shirkasoft-ui-components-utils.mjs.map +1 -1
  58. package/fesm2022/shirkasoft-ui-components-wizard.mjs +673 -165
  59. package/fesm2022/shirkasoft-ui-components-wizard.mjs.map +1 -1
  60. package/fesm2022/shirkasoft-ui-components.mjs +0 -9
  61. package/package.json +5 -5
  62. package/types/shirkasoft-ui-components-breadcrumb.d.ts +59 -44
  63. package/types/shirkasoft-ui-components-button.d.ts +142 -49
  64. package/types/shirkasoft-ui-components-chart.d.ts +59 -44
  65. package/types/shirkasoft-ui-components-config.d.ts +193 -204
  66. package/types/shirkasoft-ui-components-confirm-dialog.d.ts +107 -66
  67. package/types/shirkasoft-ui-components-date-picker.d.ts +561 -398
  68. package/types/shirkasoft-ui-components-fieldset.d.ts +135 -60
  69. package/types/shirkasoft-ui-components-file-upload.d.ts +210 -112
  70. package/types/shirkasoft-ui-components-icons.d.ts +1302 -1294
  71. package/types/shirkasoft-ui-components-knob.d.ts +144 -78
  72. package/types/shirkasoft-ui-components-loading.d.ts +155 -64
  73. package/types/shirkasoft-ui-components-modal.d.ts +134 -136
  74. package/types/shirkasoft-ui-components-notification.d.ts +63 -59
  75. package/types/shirkasoft-ui-components-price-input.d.ts +232 -113
  76. package/types/shirkasoft-ui-components-rail-sidebar.d.ts +262 -142
  77. package/types/shirkasoft-ui-components-select.d.ts +335 -196
  78. package/types/shirkasoft-ui-components-sidebar.d.ts +198 -93
  79. package/types/shirkasoft-ui-components-skeleton.d.ts +68 -27
  80. package/types/shirkasoft-ui-components-table.d.ts +849 -660
  81. package/types/shirkasoft-ui-components-tabs.d.ts +102 -61
  82. package/types/shirkasoft-ui-components-tag.d.ts +54 -23
  83. package/types/shirkasoft-ui-components-text-field.d.ts +263 -127
  84. package/types/shirkasoft-ui-components-theme-picker.d.ts +92 -58
  85. package/types/shirkasoft-ui-components-theme.d.ts +56 -64
  86. package/types/shirkasoft-ui-components-timeline.d.ts +325 -150
  87. package/types/shirkasoft-ui-components-toggle.d.ts +73 -49
  88. package/types/shirkasoft-ui-components-tooltip.d.ts +64 -43
  89. package/types/shirkasoft-ui-components-utils.d.ts +47 -15
  90. package/types/shirkasoft-ui-components-wizard.d.ts +236 -87
  91. package/types/shirkasoft-ui-components.d.ts +1 -2
  92. package/fesm2022/shirkasoft-ui-components.mjs.map +0 -1
@@ -1,94 +1,349 @@
1
- import * as i0 from '@angular/core';
2
- import { input, model, output, ChangeDetectionStrategy, Component } from '@angular/core';
3
- import * as i1 from '@angular/common';
4
- import { CommonModule } from '@angular/common';
5
- import { LucideChevronRight, ShkIconDirective } from 'shirkasoft-ui-components/icons';
6
- import { getIcon } from 'shirkasoft-ui-components/utils';
7
-
1
+ import * as i0 from "@angular/core";
2
+ import { ChangeDetectionStrategy, Component, input, model, output } from "@angular/core";
3
+ import * as i1 from "@angular/common";
4
+ import { CommonModule } from "@angular/common";
5
+ import { LucideChevronRight, ShkIconDirective } from "shirkasoft-ui-components/icons";
6
+ import { getIcon } from "shirkasoft-ui-components/utils";
8
7
  let fieldsetCounter = 0;
9
- /**
10
- * Shirkasoft UI Components.
11
- * Authors: Roberto Valladares Martin (Ansem13), Julio César García García (Sanjuli14).
12
- * Belongs to Shirkasoft.
13
- */
14
- /**
15
- * Collapsible content group with a legend header, optional leading icon,
16
- * badge and action buttons on the right side.
17
- */
18
- class FieldsetComponent {
19
- constructor() {
20
- this.getIcon = (name) => getIcon(name, LucideChevronRight);
21
- /** Title shown in the header. */
22
- this.legend = input('', ...(ngDevMode ? [{ debugName: "legend" }] : /* istanbul ignore next */ []));
23
- /** Collapsed state (default: collapsed). Two-way bindable with [(collapsed)]. */
24
- this.collapsed = model(true, ...(ngDevMode ? [{ debugName: "collapsed" }] : /* istanbul ignore next */ []));
25
- /** Whether the header toggles the content. */
26
- this.toggleable = input(true, ...(ngDevMode ? [{ debugName: "toggleable" }] : /* istanbul ignore next */ []));
27
- /** Shows the expand/collapse icon button. */
28
- this.showToggleIcon = input(true, ...(ngDevMode ? [{ debugName: "showToggleIcon" }] : /* istanbul ignore next */ []));
29
- /** Optional leading icon shown next to the legend. */
30
- this.icon = input('', ...(ngDevMode ? [{ debugName: "icon" }] : /* istanbul ignore next */ []));
31
- /** Optional badge/count shown after the legend. */
32
- this.badge = input('', ...(ngDevMode ? [{ debugName: "badge" }] : /* istanbul ignore next */ []));
33
- /** CSS classes for the badge (override). */
34
- this.badgeClass = input('', ...(ngDevMode ? [{ debugName: "badgeClass" }] : /* istanbul ignore next */ []));
35
- /** Icon shown when collapsed. */
36
- this.collapsedIcon = input('chevron-right', ...(ngDevMode ? [{ debugName: "collapsedIcon" }] : /* istanbul ignore next */ []));
37
- /** Icon shown when expanded. */
38
- this.expandedIcon = input('chevron-down', ...(ngDevMode ? [{ debugName: "expandedIcon" }] : /* istanbul ignore next */ []));
39
- /** Action buttons rendered on the right side of the header. */
40
- this.headerActions = input([], ...(ngDevMode ? [{ debugName: "headerActions" }] : /* istanbul ignore next */ []));
41
- /** Custom content templates: key 'legend' (context: $implicit collapsed, expanded). */
42
- this.customTemplates = input({}, ...(ngDevMode ? [{ debugName: "customTemplates" }] : /* istanbul ignore next */ []));
43
- /** CSS classes for the extra shadow styling of the panel. */
44
- this.hasShadow = input(true, ...(ngDevMode ? [{ debugName: "hasShadow" }] : /* istanbul ignore next */ []));
45
- /** Accessible label for the expand action. */
46
- this.expandLabel = input('Expandir', ...(ngDevMode ? [{ debugName: "expandLabel" }] : /* istanbul ignore next */ []));
47
- /** Accessible label for the collapse action. */
48
- this.collapseLabel = input('Colapsar', ...(ngDevMode ? [{ debugName: "collapseLabel" }] : /* istanbul ignore next */ []));
49
- /** Emits the new expanded state when toggled. */
50
- this.toggle = output();
51
- /** Emitted when the fieldset is expanded. */
52
- this.expand = output();
53
- /** Emitted when the fieldset is collapsed. */
54
- this.collapse = output();
55
- /** Stable id linking the header button and the content region. */
56
- this.contentId = `shk-fieldset-content-${++fieldsetCounter}`;
57
- }
58
- /** Toggles the collapsed state and emits the new state (unless not toggleable). */
59
- onToggle() {
60
- if (!this.toggleable())
61
- return;
62
- const wasCollapsed = this.collapsed();
63
- const nowExpanded = wasCollapsed;
64
- this.collapsed.set(!wasCollapsed);
65
- this.toggle.emit(nowExpanded);
66
- if (nowExpanded) {
67
- this.expand.emit();
68
- }
69
- else {
70
- this.collapse.emit();
71
- }
72
- }
73
- /** Whether a header action can be rendered. */
74
- isHeaderActionVisible(action) {
75
- return action.isVisible ? action.isVisible() : true;
76
- }
77
- /** Whether a header action should be disabled. */
78
- isHeaderActionDisabled(action) {
79
- return action.isDisabled ? action.isDisabled() : false;
80
- }
81
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.27", ngImport: i0, type: FieldsetComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
82
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.27", type: FieldsetComponent, isStandalone: true, selector: "shk-fieldset", inputs: { legend: { classPropertyName: "legend", publicName: "legend", isSignal: true, isRequired: false, transformFunction: null }, collapsed: { classPropertyName: "collapsed", publicName: "collapsed", isSignal: true, isRequired: false, transformFunction: null }, toggleable: { classPropertyName: "toggleable", publicName: "toggleable", isSignal: true, isRequired: false, transformFunction: null }, showToggleIcon: { classPropertyName: "showToggleIcon", publicName: "showToggleIcon", isSignal: true, isRequired: false, transformFunction: null }, icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, badge: { classPropertyName: "badge", publicName: "badge", isSignal: true, isRequired: false, transformFunction: null }, badgeClass: { classPropertyName: "badgeClass", publicName: "badgeClass", isSignal: true, isRequired: false, transformFunction: null }, collapsedIcon: { classPropertyName: "collapsedIcon", publicName: "collapsedIcon", isSignal: true, isRequired: false, transformFunction: null }, expandedIcon: { classPropertyName: "expandedIcon", publicName: "expandedIcon", isSignal: true, isRequired: false, transformFunction: null }, headerActions: { classPropertyName: "headerActions", publicName: "headerActions", isSignal: true, isRequired: false, transformFunction: null }, customTemplates: { classPropertyName: "customTemplates", publicName: "customTemplates", isSignal: true, isRequired: false, transformFunction: null }, hasShadow: { classPropertyName: "hasShadow", publicName: "hasShadow", isSignal: true, isRequired: false, transformFunction: null }, expandLabel: { classPropertyName: "expandLabel", publicName: "expandLabel", isSignal: true, isRequired: false, transformFunction: null }, collapseLabel: { classPropertyName: "collapseLabel", publicName: "collapseLabel", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { collapsed: "collapsedChange", toggle: "toggle", expand: "expand", collapse: "collapse" }, ngImport: i0, template: "<div\n class=\"rounded-xl bg-white dark:[background-color:var(--shk-surface-50)] border _shk-border overflow-hidden\"\n [class.shadow-sm]=\"hasShadow()\"\n>\n <div\n class=\"flex items-center gap-2 px-4 py-3\"\n [class.border-b]=\"!collapsed()\"\n [class._shk-border]=\"!collapsed()\"\n >\n <button\n type=\"button\"\n (click)=\"onToggle()\"\n [disabled]=\"!toggleable()\"\n [attr.aria-expanded]=\"!collapsed()\"\n [attr.aria-controls]=\"contentId\"\n class=\"flex items-center gap-2 flex-1 min-w-0 text-left group disabled:cursor-default\"\n >\n @if (customTemplates()['legend']) {\n <ng-container\n *ngTemplateOutlet=\"customTemplates()['legend']; context: { $implicit: collapsed(), expanded: !collapsed() }\"\n ></ng-container>\n } @else {\n @if (icon()) {\n <svg [shkIcon]=\"getIcon(icon())\" class=\"w-4 h-4 _shk-text-primary shrink-0\"></svg>\n }\n <span class=\"font-semibold text-sm _shk-text-surface-800 truncate\">\n {{ legend() }}\n </span>\n @if (badge() !== undefined && badge() !== null && badge() !== '') {\n <span\n [class]=\"badgeClass() || 'inline-flex items-center px-2 py-0.5 rounded-full text-xs font-semibold _shk-bg-primary-soft _shk-text-primary-700 dark:[background-color:var(--shk-primary-900)] dark:[color:var(--shk-primary-300)] shrink-0'\"\n >\n {{ badge() }}\n </span>\n }\n }\n </button>\n\n @if (headerActions().length > 0) {\n <div class=\"flex items-center gap-0.5 shrink-0\">\n @for (action of headerActions(); track $index) {\n @if (isHeaderActionVisible(action)) {\n <div class=\"relative group\">\n <button\n type=\"button\"\n (click)=\"action.onClick()\"\n [class]=\"'fieldset-action-btn ' + (action.class || '')\"\n [disabled]=\"isHeaderActionDisabled(action)\"\n [attr.aria-label]=\"action.label\"\n >\n <svg [shkIcon]=\"getIcon(action.icon)\" class=\"w-3.5 h-3.5\"></svg>\n </button>\n <span class=\"absolute bottom-full left-1/2 -translate-x-1/2 mb-1 px-2 py-1 text-xs _shk-bg-tooltip _shk-text-tooltip rounded whitespace-nowrap opacity-0 group-hover:opacity-100 transition pointer-events-none z-[9999] shadow-lg\">\n {{ action.label }}\n </span>\n </div>\n }\n }\n </div>\n }\n\n @if (toggleable() && showToggleIcon()) {\n <button\n type=\"button\"\n (click)=\"onToggle()\"\n [attr.aria-label]=\"collapsed() ? expandLabel() : collapseLabel()\"\n class=\"shk-fieldset-toggle shrink-0\"\n [disabled]=\"!toggleable()\"\n >\n <svg [shkIcon]=\"getIcon(collapsed() ? collapsedIcon() : expandedIcon())\" class=\"w-4 h-4 transition-transform\"></svg>\n </button>\n }\n </div>\n\n @if (!collapsed()) {\n <div [id]=\"contentId\" class=\"shk-fieldset-content px-4 py-3.5\">\n <ng-content></ng-content>\n </div>\n }\n</div>\n", styles: [":host{display:block}.shk-fieldset-toggle{display:inline-flex;align-items:center;justify-content:center;width:2rem;height:2rem;border-radius:.5rem;color:var(--shk-surface-400);transition:background-color .15s ease-in-out,color .15s ease-in-out}.shk-fieldset-toggle:hover:not(:disabled){background-color:var(--shk-surface-100);color:var(--shk-surface-700)}.shk-fieldset-toggle:disabled{cursor:default}.shk-fieldset-toggle svg{width:1rem!important;height:1rem!important}.fieldset-action-btn{display:inline-flex;align-items:center;justify-content:center;padding:.375rem;border-radius:.5rem;color:var(--shk-primary-600);transition:background-color .15s ease-in-out,color .15s ease-in-out,opacity .15s ease-in-out}.fieldset-action-btn:hover:not(:disabled){background-color:color-mix(in srgb,var(--shk-primary-50) 60%,transparent);color:var(--shk-primary-700)}.fieldset-action-btn:disabled{opacity:.4;cursor:not-allowed}.fieldset-action-btn svg{width:.875rem!important;height:.875rem!important}.shk-fieldset-content{animation:shk-fieldset-fade .25s ease-out}@keyframes shk-fieldset-fade{0%{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:translateY(0)}}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: ShkIconDirective, selector: "svg[shkIcon]", inputs: ["shkIcon", "size", "strokeWidth", "color"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
83
- }
84
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.27", ngImport: i0, type: FieldsetComponent, decorators: [{
85
- type: Component,
86
- args: [{ selector: 'shk-fieldset', changeDetection: ChangeDetectionStrategy.OnPush, imports: [CommonModule, ShkIconDirective], template: "<div\n class=\"rounded-xl bg-white dark:[background-color:var(--shk-surface-50)] border _shk-border overflow-hidden\"\n [class.shadow-sm]=\"hasShadow()\"\n>\n <div\n class=\"flex items-center gap-2 px-4 py-3\"\n [class.border-b]=\"!collapsed()\"\n [class._shk-border]=\"!collapsed()\"\n >\n <button\n type=\"button\"\n (click)=\"onToggle()\"\n [disabled]=\"!toggleable()\"\n [attr.aria-expanded]=\"!collapsed()\"\n [attr.aria-controls]=\"contentId\"\n class=\"flex items-center gap-2 flex-1 min-w-0 text-left group disabled:cursor-default\"\n >\n @if (customTemplates()['legend']) {\n <ng-container\n *ngTemplateOutlet=\"customTemplates()['legend']; context: { $implicit: collapsed(), expanded: !collapsed() }\"\n ></ng-container>\n } @else {\n @if (icon()) {\n <svg [shkIcon]=\"getIcon(icon())\" class=\"w-4 h-4 _shk-text-primary shrink-0\"></svg>\n }\n <span class=\"font-semibold text-sm _shk-text-surface-800 truncate\">\n {{ legend() }}\n </span>\n @if (badge() !== undefined && badge() !== null && badge() !== '') {\n <span\n [class]=\"badgeClass() || 'inline-flex items-center px-2 py-0.5 rounded-full text-xs font-semibold _shk-bg-primary-soft _shk-text-primary-700 dark:[background-color:var(--shk-primary-900)] dark:[color:var(--shk-primary-300)] shrink-0'\"\n >\n {{ badge() }}\n </span>\n }\n }\n </button>\n\n @if (headerActions().length > 0) {\n <div class=\"flex items-center gap-0.5 shrink-0\">\n @for (action of headerActions(); track $index) {\n @if (isHeaderActionVisible(action)) {\n <div class=\"relative group\">\n <button\n type=\"button\"\n (click)=\"action.onClick()\"\n [class]=\"'fieldset-action-btn ' + (action.class || '')\"\n [disabled]=\"isHeaderActionDisabled(action)\"\n [attr.aria-label]=\"action.label\"\n >\n <svg [shkIcon]=\"getIcon(action.icon)\" class=\"w-3.5 h-3.5\"></svg>\n </button>\n <span class=\"absolute bottom-full left-1/2 -translate-x-1/2 mb-1 px-2 py-1 text-xs _shk-bg-tooltip _shk-text-tooltip rounded whitespace-nowrap opacity-0 group-hover:opacity-100 transition pointer-events-none z-[9999] shadow-lg\">\n {{ action.label }}\n </span>\n </div>\n }\n }\n </div>\n }\n\n @if (toggleable() && showToggleIcon()) {\n <button\n type=\"button\"\n (click)=\"onToggle()\"\n [attr.aria-label]=\"collapsed() ? expandLabel() : collapseLabel()\"\n class=\"shk-fieldset-toggle shrink-0\"\n [disabled]=\"!toggleable()\"\n >\n <svg [shkIcon]=\"getIcon(collapsed() ? collapsedIcon() : expandedIcon())\" class=\"w-4 h-4 transition-transform\"></svg>\n </button>\n }\n </div>\n\n @if (!collapsed()) {\n <div [id]=\"contentId\" class=\"shk-fieldset-content px-4 py-3.5\">\n <ng-content></ng-content>\n </div>\n }\n</div>\n", styles: [":host{display:block}.shk-fieldset-toggle{display:inline-flex;align-items:center;justify-content:center;width:2rem;height:2rem;border-radius:.5rem;color:var(--shk-surface-400);transition:background-color .15s ease-in-out,color .15s ease-in-out}.shk-fieldset-toggle:hover:not(:disabled){background-color:var(--shk-surface-100);color:var(--shk-surface-700)}.shk-fieldset-toggle:disabled{cursor:default}.shk-fieldset-toggle svg{width:1rem!important;height:1rem!important}.fieldset-action-btn{display:inline-flex;align-items:center;justify-content:center;padding:.375rem;border-radius:.5rem;color:var(--shk-primary-600);transition:background-color .15s ease-in-out,color .15s ease-in-out,opacity .15s ease-in-out}.fieldset-action-btn:hover:not(:disabled){background-color:color-mix(in srgb,var(--shk-primary-50) 60%,transparent);color:var(--shk-primary-700)}.fieldset-action-btn:disabled{opacity:.4;cursor:not-allowed}.fieldset-action-btn svg{width:.875rem!important;height:.875rem!important}.shk-fieldset-content{animation:shk-fieldset-fade .25s ease-out}@keyframes shk-fieldset-fade{0%{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:translateY(0)}}\n"] }]
87
- }], propDecorators: { legend: [{ type: i0.Input, args: [{ isSignal: true, alias: "legend", required: false }] }], collapsed: [{ type: i0.Input, args: [{ isSignal: true, alias: "collapsed", required: false }] }, { type: i0.Output, args: ["collapsedChange"] }], toggleable: [{ type: i0.Input, args: [{ isSignal: true, alias: "toggleable", required: false }] }], showToggleIcon: [{ type: i0.Input, args: [{ isSignal: true, alias: "showToggleIcon", required: false }] }], icon: [{ type: i0.Input, args: [{ isSignal: true, alias: "icon", required: false }] }], badge: [{ type: i0.Input, args: [{ isSignal: true, alias: "badge", required: false }] }], badgeClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "badgeClass", required: false }] }], collapsedIcon: [{ type: i0.Input, args: [{ isSignal: true, alias: "collapsedIcon", required: false }] }], expandedIcon: [{ type: i0.Input, args: [{ isSignal: true, alias: "expandedIcon", required: false }] }], headerActions: [{ type: i0.Input, args: [{ isSignal: true, alias: "headerActions", required: false }] }], customTemplates: [{ type: i0.Input, args: [{ isSignal: true, alias: "customTemplates", required: false }] }], hasShadow: [{ type: i0.Input, args: [{ isSignal: true, alias: "hasShadow", required: false }] }], expandLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "expandLabel", required: false }] }], collapseLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "collapseLabel", required: false }] }], toggle: [{ type: i0.Output, args: ["toggle"] }], expand: [{ type: i0.Output, args: ["expand"] }], collapse: [{ type: i0.Output, args: ["collapse"] }] } });
88
-
89
- /**
90
- * Generated bundle index. Do not edit.
91
- */
92
-
8
+ var FieldsetComponent = class FieldsetComponent {
9
+ constructor() {
10
+ this.getIcon = (name) => getIcon(name, LucideChevronRight);
11
+ this.legend = input("", ...ngDevMode ? [{ debugName: "legend" }] : /* istanbul ignore next */ []);
12
+ this.collapsed = model(true, ...ngDevMode ? [{ debugName: "collapsed" }] : /* istanbul ignore next */ []);
13
+ this.toggleable = input(true, ...ngDevMode ? [{ debugName: "toggleable" }] : /* istanbul ignore next */ []);
14
+ this.showToggleIcon = input(true, ...ngDevMode ? [{ debugName: "showToggleIcon" }] : /* istanbul ignore next */ []);
15
+ this.icon = input("", ...ngDevMode ? [{ debugName: "icon" }] : /* istanbul ignore next */ []);
16
+ this.badge = input("", ...ngDevMode ? [{ debugName: "badge" }] : /* istanbul ignore next */ []);
17
+ this.badgeClass = input("", ...ngDevMode ? [{ debugName: "badgeClass" }] : /* istanbul ignore next */ []);
18
+ this.collapsedIcon = input("chevron-right", ...ngDevMode ? [{ debugName: "collapsedIcon" }] : /* istanbul ignore next */ []);
19
+ this.expandedIcon = input("chevron-down", ...ngDevMode ? [{ debugName: "expandedIcon" }] : /* istanbul ignore next */ []);
20
+ this.headerActions = input([], ...ngDevMode ? [{ debugName: "headerActions" }] : /* istanbul ignore next */ []);
21
+ this.customTemplates = input({}, ...ngDevMode ? [{ debugName: "customTemplates" }] : /* istanbul ignore next */ []);
22
+ this.hasShadow = input(true, ...ngDevMode ? [{ debugName: "hasShadow" }] : /* istanbul ignore next */ []);
23
+ this.expandLabel = input("Expandir", ...ngDevMode ? [{ debugName: "expandLabel" }] : /* istanbul ignore next */ []);
24
+ this.collapseLabel = input("Colapsar", ...ngDevMode ? [{ debugName: "collapseLabel" }] : /* istanbul ignore next */ []);
25
+ this.toggle = output();
26
+ this.expand = output();
27
+ this.collapse = output();
28
+ this.contentId = `shk-fieldset-content-${++fieldsetCounter}`;
29
+ }
30
+ onToggle() {
31
+ if (!this.toggleable()) return;
32
+ const wasCollapsed = this.collapsed();
33
+ const nowExpanded = wasCollapsed;
34
+ this.collapsed.set(!wasCollapsed);
35
+ this.toggle.emit(nowExpanded);
36
+ if (nowExpanded) this.expand.emit();
37
+ else this.collapse.emit();
38
+ }
39
+ isHeaderActionVisible(action) {
40
+ return action.isVisible ? action.isVisible() : true;
41
+ }
42
+ isHeaderActionDisabled(action) {
43
+ return action.isDisabled ? action.isDisabled() : false;
44
+ }
45
+ static {
46
+ this.ɵfac = i0.ɵɵngDeclareFactory({
47
+ minVersion: "12.0.0",
48
+ version: "22.3.2",
49
+ ngImport: i0,
50
+ type: FieldsetComponent,
51
+ deps: [],
52
+ target: i0.ɵɵFactoryTarget.Component
53
+ });
54
+ }
55
+ static {
56
+ this.ɵcmp = i0.ɵɵngDeclareComponent({
57
+ minVersion: "17.0.0",
58
+ version: "22.3.2",
59
+ type: FieldsetComponent,
60
+ isStandalone: true,
61
+ selector: "shk-fieldset",
62
+ inputs: {
63
+ legend: {
64
+ classPropertyName: "legend",
65
+ publicName: "legend",
66
+ isSignal: true,
67
+ isRequired: false,
68
+ transformFunction: null
69
+ },
70
+ collapsed: {
71
+ classPropertyName: "collapsed",
72
+ publicName: "collapsed",
73
+ isSignal: true,
74
+ isRequired: false,
75
+ transformFunction: null
76
+ },
77
+ toggleable: {
78
+ classPropertyName: "toggleable",
79
+ publicName: "toggleable",
80
+ isSignal: true,
81
+ isRequired: false,
82
+ transformFunction: null
83
+ },
84
+ showToggleIcon: {
85
+ classPropertyName: "showToggleIcon",
86
+ publicName: "showToggleIcon",
87
+ isSignal: true,
88
+ isRequired: false,
89
+ transformFunction: null
90
+ },
91
+ icon: {
92
+ classPropertyName: "icon",
93
+ publicName: "icon",
94
+ isSignal: true,
95
+ isRequired: false,
96
+ transformFunction: null
97
+ },
98
+ badge: {
99
+ classPropertyName: "badge",
100
+ publicName: "badge",
101
+ isSignal: true,
102
+ isRequired: false,
103
+ transformFunction: null
104
+ },
105
+ badgeClass: {
106
+ classPropertyName: "badgeClass",
107
+ publicName: "badgeClass",
108
+ isSignal: true,
109
+ isRequired: false,
110
+ transformFunction: null
111
+ },
112
+ collapsedIcon: {
113
+ classPropertyName: "collapsedIcon",
114
+ publicName: "collapsedIcon",
115
+ isSignal: true,
116
+ isRequired: false,
117
+ transformFunction: null
118
+ },
119
+ expandedIcon: {
120
+ classPropertyName: "expandedIcon",
121
+ publicName: "expandedIcon",
122
+ isSignal: true,
123
+ isRequired: false,
124
+ transformFunction: null
125
+ },
126
+ headerActions: {
127
+ classPropertyName: "headerActions",
128
+ publicName: "headerActions",
129
+ isSignal: true,
130
+ isRequired: false,
131
+ transformFunction: null
132
+ },
133
+ customTemplates: {
134
+ classPropertyName: "customTemplates",
135
+ publicName: "customTemplates",
136
+ isSignal: true,
137
+ isRequired: false,
138
+ transformFunction: null
139
+ },
140
+ hasShadow: {
141
+ classPropertyName: "hasShadow",
142
+ publicName: "hasShadow",
143
+ isSignal: true,
144
+ isRequired: false,
145
+ transformFunction: null
146
+ },
147
+ expandLabel: {
148
+ classPropertyName: "expandLabel",
149
+ publicName: "expandLabel",
150
+ isSignal: true,
151
+ isRequired: false,
152
+ transformFunction: null
153
+ },
154
+ collapseLabel: {
155
+ classPropertyName: "collapseLabel",
156
+ publicName: "collapseLabel",
157
+ isSignal: true,
158
+ isRequired: false,
159
+ transformFunction: null
160
+ }
161
+ },
162
+ outputs: {
163
+ collapsed: "collapsedChange",
164
+ toggle: "toggle",
165
+ expand: "expand",
166
+ collapse: "collapse"
167
+ },
168
+ ngImport: i0,
169
+ template: "<div\n class=\"rounded-xl bg-white dark:[background-color:var(--shk-surface-50)] border _shk-border overflow-hidden\"\n [class.shadow-sm]=\"hasShadow()\"\n>\n <div\n class=\"flex items-center gap-2 px-4 py-3\"\n [class.border-b]=\"!collapsed()\"\n [class._shk-border]=\"!collapsed()\"\n >\n <button\n type=\"button\"\n (click)=\"onToggle()\"\n [disabled]=\"!toggleable()\"\n [attr.aria-expanded]=\"!collapsed()\"\n [attr.aria-controls]=\"contentId\"\n class=\"flex items-center gap-2 flex-1 min-w-0 text-left group disabled:cursor-default\"\n >\n @if (customTemplates()['legend']) {\n <ng-container\n *ngTemplateOutlet=\"customTemplates()['legend']; context: { $implicit: collapsed(), expanded: !collapsed() }\"\n ></ng-container>\n } @else {\n @if (icon()) {\n <svg [shkIcon]=\"getIcon(icon())\" class=\"w-4 h-4 _shk-text-primary shrink-0\"></svg>\n }\n <span class=\"font-semibold text-sm _shk-text-surface-800 truncate\">\n {{ legend() }}\n </span>\n @if (badge() !== undefined && badge() !== null && badge() !== '') {\n <span\n [class]=\"badgeClass() || 'inline-flex items-center px-2 py-0.5 rounded-full text-xs font-semibold _shk-bg-primary-soft _shk-text-primary-700 dark:[background-color:var(--shk-primary-900)] dark:[color:var(--shk-primary-300)] shrink-0'\"\n >\n {{ badge() }}\n </span>\n }\n }\n </button>\n\n @if (headerActions().length > 0) {\n <div class=\"flex items-center gap-0.5 shrink-0\">\n @for (action of headerActions(); track $index) {\n @if (isHeaderActionVisible(action)) {\n <div class=\"relative group\">\n <button\n type=\"button\"\n (click)=\"action.onClick()\"\n [class]=\"'fieldset-action-btn ' + (action.class || '')\"\n [disabled]=\"isHeaderActionDisabled(action)\"\n [attr.aria-label]=\"action.label\"\n >\n <svg [shkIcon]=\"getIcon(action.icon)\" class=\"w-3.5 h-3.5\"></svg>\n </button>\n <span class=\"absolute bottom-full left-1/2 -translate-x-1/2 mb-1 px-2 py-1 text-xs _shk-bg-tooltip _shk-text-tooltip rounded whitespace-nowrap opacity-0 group-hover:opacity-100 transition pointer-events-none z-[9999] shadow-lg\">\n {{ action.label }}\n </span>\n </div>\n }\n }\n </div>\n }\n\n @if (toggleable() && showToggleIcon()) {\n <button\n type=\"button\"\n (click)=\"onToggle()\"\n [attr.aria-label]=\"collapsed() ? expandLabel() : collapseLabel()\"\n class=\"shk-fieldset-toggle shrink-0\"\n [disabled]=\"!toggleable()\"\n >\n <svg [shkIcon]=\"getIcon(collapsed() ? collapsedIcon() : expandedIcon())\" class=\"w-4 h-4 transition-transform\"></svg>\n </button>\n }\n </div>\n\n @if (!collapsed()) {\n <div [id]=\"contentId\" class=\"shk-fieldset-content px-4 py-3.5\">\n <ng-content></ng-content>\n </div>\n }\n</div>\n",
170
+ styles: [":host{display:block}.shk-fieldset-toggle{display:inline-flex;align-items:center;justify-content:center;width:2rem;height:2rem;border-radius:.5rem;color:var(--shk-surface-400);transition:background-color .15s ease-in-out,color .15s ease-in-out}.shk-fieldset-toggle:hover:not(:disabled){background-color:var(--shk-surface-100);color:var(--shk-surface-700)}.shk-fieldset-toggle:disabled{cursor:default}.shk-fieldset-toggle svg{width:1rem!important;height:1rem!important}.fieldset-action-btn{display:inline-flex;align-items:center;justify-content:center;padding:.375rem;border-radius:.5rem;color:var(--shk-primary-600);transition:background-color .15s ease-in-out,color .15s ease-in-out,opacity .15s ease-in-out}.fieldset-action-btn:hover:not(:disabled){background-color:color-mix(in srgb,var(--shk-primary-50) 60%,transparent);color:var(--shk-primary-700)}.fieldset-action-btn:disabled{opacity:.4;cursor:not-allowed}.fieldset-action-btn svg{width:.875rem!important;height:.875rem!important}.shk-fieldset-content{animation:shk-fieldset-fade .25s ease-out}@keyframes shk-fieldset-fade{0%{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:translateY(0)}}\n"],
171
+ dependencies: [
172
+ {
173
+ kind: "ngmodule",
174
+ type: CommonModule
175
+ },
176
+ {
177
+ kind: "directive",
178
+ type: i1.NgTemplateOutlet,
179
+ selector: "[ngTemplateOutlet]",
180
+ inputs: [
181
+ "ngTemplateOutletContext",
182
+ "ngTemplateOutlet",
183
+ "ngTemplateOutletInjector"
184
+ ]
185
+ },
186
+ {
187
+ kind: "directive",
188
+ type: ShkIconDirective,
189
+ selector: "svg[shkIcon]",
190
+ inputs: [
191
+ "shkIcon",
192
+ "size",
193
+ "strokeWidth",
194
+ "color"
195
+ ]
196
+ }
197
+ ],
198
+ changeDetection: i0.ChangeDetectionStrategy.OnPush
199
+ });
200
+ }
201
+ };
202
+ i0.ɵɵngDeclareClassMetadata({
203
+ minVersion: "12.0.0",
204
+ version: "22.3.2",
205
+ ngImport: i0,
206
+ type: FieldsetComponent,
207
+ decorators: [{
208
+ type: Component,
209
+ args: [{
210
+ selector: "shk-fieldset",
211
+ changeDetection: ChangeDetectionStrategy.OnPush,
212
+ imports: [CommonModule, ShkIconDirective],
213
+ template: "<div\n class=\"rounded-xl bg-white dark:[background-color:var(--shk-surface-50)] border _shk-border overflow-hidden\"\n [class.shadow-sm]=\"hasShadow()\"\n>\n <div\n class=\"flex items-center gap-2 px-4 py-3\"\n [class.border-b]=\"!collapsed()\"\n [class._shk-border]=\"!collapsed()\"\n >\n <button\n type=\"button\"\n (click)=\"onToggle()\"\n [disabled]=\"!toggleable()\"\n [attr.aria-expanded]=\"!collapsed()\"\n [attr.aria-controls]=\"contentId\"\n class=\"flex items-center gap-2 flex-1 min-w-0 text-left group disabled:cursor-default\"\n >\n @if (customTemplates()['legend']) {\n <ng-container\n *ngTemplateOutlet=\"customTemplates()['legend']; context: { $implicit: collapsed(), expanded: !collapsed() }\"\n ></ng-container>\n } @else {\n @if (icon()) {\n <svg [shkIcon]=\"getIcon(icon())\" class=\"w-4 h-4 _shk-text-primary shrink-0\"></svg>\n }\n <span class=\"font-semibold text-sm _shk-text-surface-800 truncate\">\n {{ legend() }}\n </span>\n @if (badge() !== undefined && badge() !== null && badge() !== '') {\n <span\n [class]=\"badgeClass() || 'inline-flex items-center px-2 py-0.5 rounded-full text-xs font-semibold _shk-bg-primary-soft _shk-text-primary-700 dark:[background-color:var(--shk-primary-900)] dark:[color:var(--shk-primary-300)] shrink-0'\"\n >\n {{ badge() }}\n </span>\n }\n }\n </button>\n\n @if (headerActions().length > 0) {\n <div class=\"flex items-center gap-0.5 shrink-0\">\n @for (action of headerActions(); track $index) {\n @if (isHeaderActionVisible(action)) {\n <div class=\"relative group\">\n <button\n type=\"button\"\n (click)=\"action.onClick()\"\n [class]=\"'fieldset-action-btn ' + (action.class || '')\"\n [disabled]=\"isHeaderActionDisabled(action)\"\n [attr.aria-label]=\"action.label\"\n >\n <svg [shkIcon]=\"getIcon(action.icon)\" class=\"w-3.5 h-3.5\"></svg>\n </button>\n <span class=\"absolute bottom-full left-1/2 -translate-x-1/2 mb-1 px-2 py-1 text-xs _shk-bg-tooltip _shk-text-tooltip rounded whitespace-nowrap opacity-0 group-hover:opacity-100 transition pointer-events-none z-[9999] shadow-lg\">\n {{ action.label }}\n </span>\n </div>\n }\n }\n </div>\n }\n\n @if (toggleable() && showToggleIcon()) {\n <button\n type=\"button\"\n (click)=\"onToggle()\"\n [attr.aria-label]=\"collapsed() ? expandLabel() : collapseLabel()\"\n class=\"shk-fieldset-toggle shrink-0\"\n [disabled]=\"!toggleable()\"\n >\n <svg [shkIcon]=\"getIcon(collapsed() ? collapsedIcon() : expandedIcon())\" class=\"w-4 h-4 transition-transform\"></svg>\n </button>\n }\n </div>\n\n @if (!collapsed()) {\n <div [id]=\"contentId\" class=\"shk-fieldset-content px-4 py-3.5\">\n <ng-content></ng-content>\n </div>\n }\n</div>\n",
214
+ styles: [":host{display:block}.shk-fieldset-toggle{display:inline-flex;align-items:center;justify-content:center;width:2rem;height:2rem;border-radius:.5rem;color:var(--shk-surface-400);transition:background-color .15s ease-in-out,color .15s ease-in-out}.shk-fieldset-toggle:hover:not(:disabled){background-color:var(--shk-surface-100);color:var(--shk-surface-700)}.shk-fieldset-toggle:disabled{cursor:default}.shk-fieldset-toggle svg{width:1rem!important;height:1rem!important}.fieldset-action-btn{display:inline-flex;align-items:center;justify-content:center;padding:.375rem;border-radius:.5rem;color:var(--shk-primary-600);transition:background-color .15s ease-in-out,color .15s ease-in-out,opacity .15s ease-in-out}.fieldset-action-btn:hover:not(:disabled){background-color:color-mix(in srgb,var(--shk-primary-50) 60%,transparent);color:var(--shk-primary-700)}.fieldset-action-btn:disabled{opacity:.4;cursor:not-allowed}.fieldset-action-btn svg{width:.875rem!important;height:.875rem!important}.shk-fieldset-content{animation:shk-fieldset-fade .25s ease-out}@keyframes shk-fieldset-fade{0%{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:translateY(0)}}\n"]
215
+ }]
216
+ }],
217
+ propDecorators: {
218
+ legend: [{
219
+ type: i0.Input,
220
+ args: [{
221
+ isSignal: true,
222
+ alias: "legend",
223
+ required: false
224
+ }]
225
+ }],
226
+ collapsed: [{
227
+ type: i0.Input,
228
+ args: [{
229
+ isSignal: true,
230
+ alias: "collapsed",
231
+ required: false
232
+ }]
233
+ }, {
234
+ type: i0.Output,
235
+ args: ["collapsedChange"]
236
+ }],
237
+ toggleable: [{
238
+ type: i0.Input,
239
+ args: [{
240
+ isSignal: true,
241
+ alias: "toggleable",
242
+ required: false
243
+ }]
244
+ }],
245
+ showToggleIcon: [{
246
+ type: i0.Input,
247
+ args: [{
248
+ isSignal: true,
249
+ alias: "showToggleIcon",
250
+ required: false
251
+ }]
252
+ }],
253
+ icon: [{
254
+ type: i0.Input,
255
+ args: [{
256
+ isSignal: true,
257
+ alias: "icon",
258
+ required: false
259
+ }]
260
+ }],
261
+ badge: [{
262
+ type: i0.Input,
263
+ args: [{
264
+ isSignal: true,
265
+ alias: "badge",
266
+ required: false
267
+ }]
268
+ }],
269
+ badgeClass: [{
270
+ type: i0.Input,
271
+ args: [{
272
+ isSignal: true,
273
+ alias: "badgeClass",
274
+ required: false
275
+ }]
276
+ }],
277
+ collapsedIcon: [{
278
+ type: i0.Input,
279
+ args: [{
280
+ isSignal: true,
281
+ alias: "collapsedIcon",
282
+ required: false
283
+ }]
284
+ }],
285
+ expandedIcon: [{
286
+ type: i0.Input,
287
+ args: [{
288
+ isSignal: true,
289
+ alias: "expandedIcon",
290
+ required: false
291
+ }]
292
+ }],
293
+ headerActions: [{
294
+ type: i0.Input,
295
+ args: [{
296
+ isSignal: true,
297
+ alias: "headerActions",
298
+ required: false
299
+ }]
300
+ }],
301
+ customTemplates: [{
302
+ type: i0.Input,
303
+ args: [{
304
+ isSignal: true,
305
+ alias: "customTemplates",
306
+ required: false
307
+ }]
308
+ }],
309
+ hasShadow: [{
310
+ type: i0.Input,
311
+ args: [{
312
+ isSignal: true,
313
+ alias: "hasShadow",
314
+ required: false
315
+ }]
316
+ }],
317
+ expandLabel: [{
318
+ type: i0.Input,
319
+ args: [{
320
+ isSignal: true,
321
+ alias: "expandLabel",
322
+ required: false
323
+ }]
324
+ }],
325
+ collapseLabel: [{
326
+ type: i0.Input,
327
+ args: [{
328
+ isSignal: true,
329
+ alias: "collapseLabel",
330
+ required: false
331
+ }]
332
+ }],
333
+ toggle: [{
334
+ type: i0.Output,
335
+ args: ["toggle"]
336
+ }],
337
+ expand: [{
338
+ type: i0.Output,
339
+ args: ["expand"]
340
+ }],
341
+ collapse: [{
342
+ type: i0.Output,
343
+ args: ["collapse"]
344
+ }]
345
+ }
346
+ });
93
347
  export { FieldsetComponent };
94
- //# sourceMappingURL=shirkasoft-ui-components-fieldset.mjs.map
348
+
349
+ //# sourceMappingURL=shirkasoft-ui-components-fieldset.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"shirkasoft-ui-components-fieldset.mjs","sources":["../../../projects/ui-components/fieldset/fieldset.component.ts","../../../projects/ui-components/fieldset/fieldset.component.html","../../../projects/ui-components/fieldset/shirkasoft-ui-components-fieldset.ts"],"sourcesContent":["import { Component, input, model, output, ChangeDetectionStrategy } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { ShkIconDirective, LucideChevronRight } from 'shirkasoft-ui-components/icons';\nimport { getIcon as getIconFromCentral } from 'shirkasoft-ui-components/utils';\n\n/** An action button rendered on the right side of the fieldset header. */\nexport interface FieldsetHeaderAction {\n label: string;\n icon: string | any;\n onClick: () => void;\n class?: string;\n isVisible?: () => boolean;\n isDisabled?: () => boolean;\n}\n\nlet fieldsetCounter = 0;\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 * Collapsible content group with a legend header, optional leading icon,\n * badge and action buttons on the right side.\n */\n@Component({\n selector: 'shk-fieldset',\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [CommonModule, ShkIconDirective],\n templateUrl: './fieldset.component.html',\n styles: [\n `\n :host {\n display: block;\n }\n .shk-fieldset-toggle {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 2rem;\n height: 2rem;\n border-radius: 0.5rem;\n color: var(--shk-surface-400);\n transition: background-color 0.15s ease-in-out, color 0.15s ease-in-out;\n }\n .shk-fieldset-toggle:hover:not(:disabled) {\n background-color: var(--shk-surface-100);\n color: var(--shk-surface-700);\n }\n .shk-fieldset-toggle:disabled {\n cursor: default;\n }\n .shk-fieldset-toggle svg {\n width: 1rem !important;\n height: 1rem !important;\n }\n .fieldset-action-btn {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n padding: 0.375rem;\n border-radius: 0.5rem;\n color: var(--shk-primary-600);\n transition: background-color 0.15s ease-in-out, color 0.15s ease-in-out,\n opacity 0.15s ease-in-out;\n }\n .fieldset-action-btn:hover:not(:disabled) {\n background-color: color-mix(in srgb, var(--shk-primary-50) 60%, transparent);\n color: var(--shk-primary-700);\n }\n .fieldset-action-btn:disabled {\n opacity: 0.4;\n cursor: not-allowed;\n }\n .fieldset-action-btn svg {\n width: 0.875rem !important;\n height: 0.875rem !important;\n }\n .shk-fieldset-content {\n animation: shk-fieldset-fade 0.25s ease-out;\n }\n @keyframes shk-fieldset-fade {\n from {\n opacity: 0;\n transform: translateY(-4px);\n }\n to {\n opacity: 1;\n transform: translateY(0);\n }\n }\n `,\n ],\n})\nexport class FieldsetComponent {\n protected getIcon = (name: any) => getIconFromCentral(name, LucideChevronRight);\n\n /** Title shown in the header. */\n legend = input<string>('');\n /** Collapsed state (default: collapsed). Two-way bindable with [(collapsed)]. */\n collapsed = model<boolean>(true);\n /** Whether the header toggles the content. */\n toggleable = input<boolean>(true);\n /** Shows the expand/collapse icon button. */\n showToggleIcon = input<boolean>(true);\n /** Optional leading icon shown next to the legend. */\n icon = input<string | any>('');\n /** Optional badge/count shown after the legend. */\n badge = input<string | number>('');\n /** CSS classes for the badge (override). */\n badgeClass = input<string>('');\n /** Icon shown when collapsed. */\n collapsedIcon = input<string>('chevron-right');\n /** Icon shown when expanded. */\n expandedIcon = input<string>('chevron-down');\n /** Action buttons rendered on the right side of the header. */\n headerActions = input<FieldsetHeaderAction[]>([]);\n /** Custom content templates: key 'legend' (context: $implicit collapsed, expanded). */\n customTemplates = input<{ [key: string]: any }>({});\n /** CSS classes for the extra shadow styling of the panel. */\n hasShadow = input<boolean>(true);\n /** Accessible label for the expand action. */\n expandLabel = input<string>('Expandir');\n /** Accessible label for the collapse action. */\n collapseLabel = input<string>('Colapsar');\n\n /** Emits the new expanded state when toggled. */\n toggle = output<boolean>();\n /** Emitted when the fieldset is expanded. */\n expand = output<void>();\n /** Emitted when the fieldset is collapsed. */\n collapse = output<void>();\n\n /** Stable id linking the header button and the content region. */\n contentId = `shk-fieldset-content-${++fieldsetCounter}`;\n\n /** Toggles the collapsed state and emits the new state (unless not toggleable). */\n onToggle(): void {\n if (!this.toggleable()) return;\n const wasCollapsed = this.collapsed();\n const nowExpanded = wasCollapsed;\n this.collapsed.set(!wasCollapsed);\n this.toggle.emit(nowExpanded);\n if (nowExpanded) {\n this.expand.emit();\n } else {\n this.collapse.emit();\n }\n }\n\n /** Whether a header action can be rendered. */\n isHeaderActionVisible(action: FieldsetHeaderAction): boolean {\n return action.isVisible ? action.isVisible() : true;\n }\n\n /** Whether a header action should be disabled. */\n isHeaderActionDisabled(action: FieldsetHeaderAction): boolean {\n return action.isDisabled ? action.isDisabled() : false;\n }\n}\n","<div\n class=\"rounded-xl bg-white dark:[background-color:var(--shk-surface-50)] border _shk-border overflow-hidden\"\n [class.shadow-sm]=\"hasShadow()\"\n>\n <div\n class=\"flex items-center gap-2 px-4 py-3\"\n [class.border-b]=\"!collapsed()\"\n [class._shk-border]=\"!collapsed()\"\n >\n <button\n type=\"button\"\n (click)=\"onToggle()\"\n [disabled]=\"!toggleable()\"\n [attr.aria-expanded]=\"!collapsed()\"\n [attr.aria-controls]=\"contentId\"\n class=\"flex items-center gap-2 flex-1 min-w-0 text-left group disabled:cursor-default\"\n >\n @if (customTemplates()['legend']) {\n <ng-container\n *ngTemplateOutlet=\"customTemplates()['legend']; context: { $implicit: collapsed(), expanded: !collapsed() }\"\n ></ng-container>\n } @else {\n @if (icon()) {\n <svg [shkIcon]=\"getIcon(icon())\" class=\"w-4 h-4 _shk-text-primary shrink-0\"></svg>\n }\n <span class=\"font-semibold text-sm _shk-text-surface-800 truncate\">\n {{ legend() }}\n </span>\n @if (badge() !== undefined && badge() !== null && badge() !== '') {\n <span\n [class]=\"badgeClass() || 'inline-flex items-center px-2 py-0.5 rounded-full text-xs font-semibold _shk-bg-primary-soft _shk-text-primary-700 dark:[background-color:var(--shk-primary-900)] dark:[color:var(--shk-primary-300)] shrink-0'\"\n >\n {{ badge() }}\n </span>\n }\n }\n </button>\n\n @if (headerActions().length > 0) {\n <div class=\"flex items-center gap-0.5 shrink-0\">\n @for (action of headerActions(); track $index) {\n @if (isHeaderActionVisible(action)) {\n <div class=\"relative group\">\n <button\n type=\"button\"\n (click)=\"action.onClick()\"\n [class]=\"'fieldset-action-btn ' + (action.class || '')\"\n [disabled]=\"isHeaderActionDisabled(action)\"\n [attr.aria-label]=\"action.label\"\n >\n <svg [shkIcon]=\"getIcon(action.icon)\" class=\"w-3.5 h-3.5\"></svg>\n </button>\n <span class=\"absolute bottom-full left-1/2 -translate-x-1/2 mb-1 px-2 py-1 text-xs _shk-bg-tooltip _shk-text-tooltip rounded whitespace-nowrap opacity-0 group-hover:opacity-100 transition pointer-events-none z-[9999] shadow-lg\">\n {{ action.label }}\n </span>\n </div>\n }\n }\n </div>\n }\n\n @if (toggleable() && showToggleIcon()) {\n <button\n type=\"button\"\n (click)=\"onToggle()\"\n [attr.aria-label]=\"collapsed() ? expandLabel() : collapseLabel()\"\n class=\"shk-fieldset-toggle shrink-0\"\n [disabled]=\"!toggleable()\"\n >\n <svg [shkIcon]=\"getIcon(collapsed() ? collapsedIcon() : expandedIcon())\" class=\"w-4 h-4 transition-transform\"></svg>\n </button>\n }\n </div>\n\n @if (!collapsed()) {\n <div [id]=\"contentId\" class=\"shk-fieldset-content px-4 py-3.5\">\n <ng-content></ng-content>\n </div>\n }\n</div>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["getIconFromCentral"],"mappings":";;;;;;;AAeA,IAAI,eAAe,GAAG,CAAC;AAEvB;;;;AAIG;AAEH;;;AAGG;MAsEU,iBAAiB,CAAA;AArE9B,IAAA,WAAA,GAAA;AAsEY,QAAA,IAAA,CAAA,OAAO,GAAG,CAAC,IAAS,KAAKA,OAAkB,CAAC,IAAI,EAAE,kBAAkB,CAAC;;AAG/E,QAAA,IAAA,CAAA,MAAM,GAAG,KAAK,CAAS,EAAE,6EAAC;;AAE1B,QAAA,IAAA,CAAA,SAAS,GAAG,KAAK,CAAU,IAAI,gFAAC;;AAEhC,QAAA,IAAA,CAAA,UAAU,GAAG,KAAK,CAAU,IAAI,iFAAC;;AAEjC,QAAA,IAAA,CAAA,cAAc,GAAG,KAAK,CAAU,IAAI,qFAAC;;AAErC,QAAA,IAAA,CAAA,IAAI,GAAG,KAAK,CAAe,EAAE,2EAAC;;AAE9B,QAAA,IAAA,CAAA,KAAK,GAAG,KAAK,CAAkB,EAAE,4EAAC;;AAElC,QAAA,IAAA,CAAA,UAAU,GAAG,KAAK,CA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AA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,EAAA,OAAA,EAAA,EAAA,SAAA,EAAA,iBAAA,EAAA,MAAA,EAAA,QAAA,EAAA,MAAA,EAAA,QAAA,EAAA,QAAA,EAAA,UAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,EChG9B,umGAgFA,EAAA,MAAA,EAAA,CAAA,0oCAAA,CAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,EDlDY,YAAY,sMAAE,gBAAgB,EAAA,QAAA,EAAA,cAAA,EAAA,MAAA,EAAA,CAAA,SAAA,EAAA,MAAA,EAAA,aAAA,EAAA,OAAA,CAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA,CAAA;;4FAkE7B,iBAAiB,EAAA,UAAA,EAAA,CAAA;kBArE7B,SAAS;+BACE,cAAc,EAAA,eAAA,EACP,uBAAuB,CAAC,MAAM,WACtC,CAAC,YAAY,EAAE,gBAAgB,CAAC,EAAA,QAAA,EAAA,umGAAA,EAAA,MAAA,EAAA,CAAA,0oCAAA,CAAA,EAAA;;;AE9B3C;;AAEG;;;;"}
1
+ {"version":3,"file":"shirkasoft-ui-components-fieldset.mjs","names":["getIconFromCentral"],"sources":["../../../projects/ui-components/fieldset/fieldset.component.ts","../../../projects/ui-components/fieldset/fieldset.component.html"],"sourcesContent":["import { Component, input, model, output, ChangeDetectionStrategy } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { ShkIconDirective, LucideChevronRight } from 'shirkasoft-ui-components/icons';\nimport { getIcon as getIconFromCentral } from 'shirkasoft-ui-components/utils';\n\n/** An action button rendered on the right side of the fieldset header. */\nexport interface FieldsetHeaderAction {\n label: string;\n icon: string | any;\n onClick: () => void;\n class?: string;\n isVisible?: () => boolean;\n isDisabled?: () => boolean;\n}\n\nlet fieldsetCounter = 0;\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 * Collapsible content group with a legend header, optional leading icon,\n * badge and action buttons on the right side.\n */\n@Component({\n selector: 'shk-fieldset',\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [CommonModule, ShkIconDirective],\n templateUrl: './fieldset.component.html',\n styles: [\n `\n :host {\n display: block;\n }\n .shk-fieldset-toggle {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 2rem;\n height: 2rem;\n border-radius: 0.5rem;\n color: var(--shk-surface-400);\n transition: background-color 0.15s ease-in-out, color 0.15s ease-in-out;\n }\n .shk-fieldset-toggle:hover:not(:disabled) {\n background-color: var(--shk-surface-100);\n color: var(--shk-surface-700);\n }\n .shk-fieldset-toggle:disabled {\n cursor: default;\n }\n .shk-fieldset-toggle svg {\n width: 1rem !important;\n height: 1rem !important;\n }\n .fieldset-action-btn {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n padding: 0.375rem;\n border-radius: 0.5rem;\n color: var(--shk-primary-600);\n transition: background-color 0.15s ease-in-out, color 0.15s ease-in-out,\n opacity 0.15s ease-in-out;\n }\n .fieldset-action-btn:hover:not(:disabled) {\n background-color: color-mix(in srgb, var(--shk-primary-50) 60%, transparent);\n color: var(--shk-primary-700);\n }\n .fieldset-action-btn:disabled {\n opacity: 0.4;\n cursor: not-allowed;\n }\n .fieldset-action-btn svg {\n width: 0.875rem !important;\n height: 0.875rem !important;\n }\n .shk-fieldset-content {\n animation: shk-fieldset-fade 0.25s ease-out;\n }\n @keyframes shk-fieldset-fade {\n from {\n opacity: 0;\n transform: translateY(-4px);\n }\n to {\n opacity: 1;\n transform: translateY(0);\n }\n }\n `,\n ],\n})\nexport class FieldsetComponent {\n protected getIcon = (name: any) => getIconFromCentral(name, LucideChevronRight);\n\n /** Title shown in the header. */\n legend = input<string>('');\n /** Collapsed state (default: collapsed). Two-way bindable with [(collapsed)]. */\n collapsed = model<boolean>(true);\n /** Whether the header toggles the content. */\n toggleable = input<boolean>(true);\n /** Shows the expand/collapse icon button. */\n showToggleIcon = input<boolean>(true);\n /** Optional leading icon shown next to the legend. */\n icon = input<string | any>('');\n /** Optional badge/count shown after the legend. */\n badge = input<string | number>('');\n /** CSS classes for the badge (override). */\n badgeClass = input<string>('');\n /** Icon shown when collapsed. */\n collapsedIcon = input<string>('chevron-right');\n /** Icon shown when expanded. */\n expandedIcon = input<string>('chevron-down');\n /** Action buttons rendered on the right side of the header. */\n headerActions = input<FieldsetHeaderAction[]>([]);\n /** Custom content templates: key 'legend' (context: $implicit collapsed, expanded). */\n customTemplates = input<{ [key: string]: any }>({});\n /** CSS classes for the extra shadow styling of the panel. */\n hasShadow = input<boolean>(true);\n /** Accessible label for the expand action. */\n expandLabel = input<string>('Expandir');\n /** Accessible label for the collapse action. */\n collapseLabel = input<string>('Colapsar');\n\n /** Emits the new expanded state when toggled. */\n toggle = output<boolean>();\n /** Emitted when the fieldset is expanded. */\n expand = output<void>();\n /** Emitted when the fieldset is collapsed. */\n collapse = output<void>();\n\n /** Stable id linking the header button and the content region. */\n contentId = `shk-fieldset-content-${++fieldsetCounter}`;\n\n /** Toggles the collapsed state and emits the new state (unless not toggleable). */\n onToggle(): void {\n if (!this.toggleable()) return;\n const wasCollapsed = this.collapsed();\n const nowExpanded = wasCollapsed;\n this.collapsed.set(!wasCollapsed);\n this.toggle.emit(nowExpanded);\n if (nowExpanded) {\n this.expand.emit();\n } else {\n this.collapse.emit();\n }\n }\n\n /** Whether a header action can be rendered. */\n isHeaderActionVisible(action: FieldsetHeaderAction): boolean {\n return action.isVisible ? action.isVisible() : true;\n }\n\n /** Whether a header action should be disabled. */\n isHeaderActionDisabled(action: FieldsetHeaderAction): boolean {\n return action.isDisabled ? action.isDisabled() : false;\n }\n}\n","<div\n class=\"rounded-xl bg-white dark:[background-color:var(--shk-surface-50)] border _shk-border overflow-hidden\"\n [class.shadow-sm]=\"hasShadow()\"\n>\n <div\n class=\"flex items-center gap-2 px-4 py-3\"\n [class.border-b]=\"!collapsed()\"\n [class._shk-border]=\"!collapsed()\"\n >\n <button\n type=\"button\"\n (click)=\"onToggle()\"\n [disabled]=\"!toggleable()\"\n [attr.aria-expanded]=\"!collapsed()\"\n [attr.aria-controls]=\"contentId\"\n class=\"flex items-center gap-2 flex-1 min-w-0 text-left group disabled:cursor-default\"\n >\n @if (customTemplates()['legend']) {\n <ng-container\n *ngTemplateOutlet=\"customTemplates()['legend']; context: { $implicit: collapsed(), expanded: !collapsed() }\"\n ></ng-container>\n } @else {\n @if (icon()) {\n <svg [shkIcon]=\"getIcon(icon())\" class=\"w-4 h-4 _shk-text-primary shrink-0\"></svg>\n }\n <span class=\"font-semibold text-sm _shk-text-surface-800 truncate\">\n {{ legend() }}\n </span>\n @if (badge() !== undefined && badge() !== null && badge() !== '') {\n <span\n [class]=\"badgeClass() || 'inline-flex items-center px-2 py-0.5 rounded-full text-xs font-semibold _shk-bg-primary-soft _shk-text-primary-700 dark:[background-color:var(--shk-primary-900)] dark:[color:var(--shk-primary-300)] shrink-0'\"\n >\n {{ badge() }}\n </span>\n }\n }\n </button>\n\n @if (headerActions().length > 0) {\n <div class=\"flex items-center gap-0.5 shrink-0\">\n @for (action of headerActions(); track $index) {\n @if (isHeaderActionVisible(action)) {\n <div class=\"relative group\">\n <button\n type=\"button\"\n (click)=\"action.onClick()\"\n [class]=\"'fieldset-action-btn ' + (action.class || '')\"\n [disabled]=\"isHeaderActionDisabled(action)\"\n [attr.aria-label]=\"action.label\"\n >\n <svg [shkIcon]=\"getIcon(action.icon)\" class=\"w-3.5 h-3.5\"></svg>\n </button>\n <span class=\"absolute bottom-full left-1/2 -translate-x-1/2 mb-1 px-2 py-1 text-xs _shk-bg-tooltip _shk-text-tooltip rounded whitespace-nowrap opacity-0 group-hover:opacity-100 transition pointer-events-none z-[9999] shadow-lg\">\n {{ action.label }}\n </span>\n </div>\n }\n }\n </div>\n }\n\n @if (toggleable() && showToggleIcon()) {\n <button\n type=\"button\"\n (click)=\"onToggle()\"\n [attr.aria-label]=\"collapsed() ? expandLabel() : collapseLabel()\"\n class=\"shk-fieldset-toggle shrink-0\"\n [disabled]=\"!toggleable()\"\n >\n <svg [shkIcon]=\"getIcon(collapsed() ? collapsedIcon() : expandedIcon())\" class=\"w-4 h-4 transition-transform\"></svg>\n </button>\n }\n </div>\n\n @if (!collapsed()) {\n <div [id]=\"contentId\" class=\"shk-fieldset-content px-4 py-3.5\">\n <ng-content></ng-content>\n </div>\n }\n</div>\n"],"mappings":";;;;;;AAeA,IAAI,kBAAkB;AAiFtB,IAAa,oBAAb,MAAa,kBAAiB;CArE9B,cAAA;EAsEY,KAAA,WAAW,SAAcA,QAAmB,MAAM,kBAAkB;EAG9E,KAAA,SAAS,MAAc,IAAG,GAAA,YAAA,CAAA,EAAA,WAAA,SAAA,CAAA,+BAAA,CAAA,CAAA;EAE1B,KAAA,YAAY,MAAe,MAAK,GAAA,YAAA,CAAA,EAAA,WAAA,YAAA,CAAA,+BAAA,CAAA,CAAA;EAEhC,KAAA,aAAa,MAAe,MAAK,GAAA,YAAA,CAAA,EAAA,WAAA,aAAA,CAAA,+BAAA,CAAA,CAAA;EAEjC,KAAA,iBAAiB,MAAe,MAAK,GAAA,YAAA,CAAA,EAAA,WAAA,iBAAA,CAAA,+BAAA,CAAA,CAAA;EAErC,KAAA,OAAO,MAAoB,IAAG,GAAA,YAAA,CAAA,EAAA,WAAA,OAAA,CAAA,+BAAA,CAAA,CAAA;EAE9B,KAAA,QAAQ,MAAuB,IAAG,GAAA,YAAA,CAAA,EAAA,WAAA,QAAA,CAAA,+BAAA,CAAA,CAAA;EAElC,KAAA,aAAa,MAAc,IAAG,GAAA,YAAA,CAAA,EAAA,WAAA,aAAA,CAAA,+BAAA,CAAA,CAAA;EAE9B,KAAA,gBAAgB,MAAc,iBAAgB,GAAA,YAAA,CAAA,EAAA,WAAA,gBAAA,CAAA,+BAAA,CAAA,CAAA;EAE9C,KAAA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