shirkasoft-ui-components 1.14.0 → 2.0.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.
Files changed (92) hide show
  1. package/README.md +4 -8
  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 +1624 -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 +484 -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 +517 -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 +1014 -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 +687 -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 +95 -134
  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 +527 -398
  68. package/types/shirkasoft-ui-components-fieldset.d.ts +135 -60
  69. package/types/shirkasoft-ui-components-file-upload.d.ts +176 -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 +198 -113
  76. package/types/shirkasoft-ui-components-rail-sidebar.d.ts +262 -142
  77. package/types/shirkasoft-ui-components-select.d.ts +301 -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 +231 -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 +15 -16
  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,143 +1,104 @@
1
- import { LucideX, LucideUpload, LucideTriangleAlert, LucideTrash2, LucideSearch, LucideRefreshCw, LucidePlus, LucidePanelRight, LucideMinimize2, LucideMenu, LucideMaximize2, LucideLogOut, LucideLoaderCircle, LucideLoader, LucideInfo, LucideInbox, LucideLanguages, LucideGlobe, LucideFunnel, LucideFileText, LucideFileSpreadsheet, LucideFile, LucideEyeOff, LucideEye, LucideEllipsisVertical, LucideDownload, LucideCirclePlus, LucideCircleQuestionMark, LucideChevronsRight, LucideChevronsLeft, LucideChevronRight, LucideChevronLeft, LucideChevronDown, LucideCalendarDays, LucideCheck, LucideArrowUpDown, LucideArrowUp, LucideArrowDown, LucideArrowLeft, ICON_BY_NAME } from 'shirkasoft-ui-components/icons';
2
- import * as i0 from '@angular/core';
3
- import { inject, ElementRef, afterNextRender, DestroyRef, Directive } from '@angular/core';
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
- /** Maps the icon names used across the library to their SVG data. */
1
+ import { ICON_BY_NAME, LucideArrowDown, LucideArrowLeft, LucideArrowUp, LucideArrowUpDown, LucideCalendarDays, LucideCheck, LucideChevronDown, LucideChevronLeft, LucideChevronRight, LucideChevronsLeft, LucideChevronsRight, LucideCirclePlus, LucideCircleQuestionMark, LucideDownload, LucideEllipsisVertical, LucideEye, LucideEyeOff, LucideFile, LucideFileSpreadsheet, LucideFileText, LucideFunnel, LucideGlobe, LucideInbox, LucideInfo, LucideLanguages, LucideLoader, LucideLoaderCircle, LucideLogOut, LucideMaximize2, LucideMenu, LucideMinimize2, LucidePanelRight, LucidePlus, LucideRefreshCw, LucideSearch, LucideTrash2, LucideTriangleAlert, LucideUpload, LucideX } from "shirkasoft-ui-components/icons";
2
+ import * as i0 from "@angular/core";
3
+ import { DestroyRef, Directive, ElementRef, afterNextRender, inject } from "@angular/core";
11
4
  const ICONS = {
12
- 'arrow-left': LucideArrowLeft,
13
- 'arrow-down': LucideArrowDown,
14
- 'arrow-up': LucideArrowUp,
15
- 'arrow-up-down': LucideArrowUpDown,
16
- check: LucideCheck,
17
- 'calendar-days': LucideCalendarDays,
18
- 'chevron-down': LucideChevronDown,
19
- 'chevron-left': LucideChevronLeft,
20
- 'chevron-right': LucideChevronRight,
21
- 'chevrons-left': LucideChevronsLeft,
22
- 'chevrons-right': LucideChevronsRight,
23
- 'circle-help': LucideCircleQuestionMark,
24
- 'circle-plus': LucideCirclePlus,
25
- download: LucideDownload,
26
- 'ellipsis-vertical': LucideEllipsisVertical,
27
- eye: LucideEye,
28
- 'eye-off': LucideEyeOff,
29
- file: LucideFile,
30
- 'file-spreadsheet': LucideFileSpreadsheet,
31
- 'file-text': LucideFileText,
32
- filter: LucideFunnel,
33
- globe: LucideGlobe,
34
- languages: LucideLanguages,
35
- inbox: LucideInbox,
36
- info: LucideInfo,
37
- loader: LucideLoader,
38
- 'loader-circle': LucideLoaderCircle,
39
- 'log-out': LucideLogOut,
40
- 'maximize-2': LucideMaximize2,
41
- menu: LucideMenu,
42
- 'minimize-2': LucideMinimize2,
43
- 'panel-right': LucidePanelRight,
44
- plus: LucidePlus,
45
- refresh: LucideRefreshCw,
46
- search: LucideSearch,
47
- 'trash-2': LucideTrash2,
48
- 'triangle-alert': LucideTriangleAlert,
49
- upload: LucideUpload,
50
- x: LucideX,
5
+ "arrow-left": LucideArrowLeft,
6
+ "arrow-down": LucideArrowDown,
7
+ "arrow-up": LucideArrowUp,
8
+ "arrow-up-down": LucideArrowUpDown,
9
+ check: LucideCheck,
10
+ "calendar-days": LucideCalendarDays,
11
+ "chevron-down": LucideChevronDown,
12
+ "chevron-left": LucideChevronLeft,
13
+ "chevron-right": LucideChevronRight,
14
+ "chevrons-left": LucideChevronsLeft,
15
+ "chevrons-right": LucideChevronsRight,
16
+ "circle-help": LucideCircleQuestionMark,
17
+ "circle-plus": LucideCirclePlus,
18
+ download: LucideDownload,
19
+ "ellipsis-vertical": LucideEllipsisVertical,
20
+ eye: LucideEye,
21
+ "eye-off": LucideEyeOff,
22
+ file: LucideFile,
23
+ "file-spreadsheet": LucideFileSpreadsheet,
24
+ "file-text": LucideFileText,
25
+ filter: LucideFunnel,
26
+ globe: LucideGlobe,
27
+ languages: LucideLanguages,
28
+ inbox: LucideInbox,
29
+ info: LucideInfo,
30
+ loader: LucideLoader,
31
+ "loader-circle": LucideLoaderCircle,
32
+ "log-out": LucideLogOut,
33
+ "maximize-2": LucideMaximize2,
34
+ menu: LucideMenu,
35
+ "minimize-2": LucideMinimize2,
36
+ "panel-right": LucidePanelRight,
37
+ plus: LucidePlus,
38
+ refresh: LucideRefreshCw,
39
+ search: LucideSearch,
40
+ "trash-2": LucideTrash2,
41
+ "triangle-alert": LucideTriangleAlert,
42
+ upload: LucideUpload,
43
+ x: LucideX
51
44
  };
52
- /**
53
- * True when `icon` is a per-item resolver function such as `(row) => 'pencil'`.
54
- *
55
- * Classes are functions too, but must never be called: a v1 `@lucide/angular`
56
- * component passed by an app that has not migrated yet would throw
57
- * "Class constructor cannot be invoked without 'new'". Those fall through to
58
- * `getIcon()`, which renders the fallback icon instead.
59
- */
60
45
  function isIconResolver(icon) {
61
- return typeof icon === 'function' && !/^class[\s{]/.test(Function.prototype.toString.call(icon));
46
+ return typeof icon === "function" && !/^class[\s{]/.test(Function.prototype.toString.call(icon));
62
47
  }
63
- /**
64
- * Resolves the icon passed to a component into SVG data.
65
- * Accepts a registered string name or an icon node array.
66
- */
67
48
  function getIcon(icon, fallback = LucideCircleQuestionMark) {
68
- if (!icon)
69
- return null;
70
- if (typeof icon === 'string') {
71
- return ICONS[icon] ?? ICON_BY_NAME[icon] ?? fallback;
72
- }
73
- if (Array.isArray(icon)) {
74
- return icon;
75
- }
76
- return fallback;
49
+ if (!icon) return null;
50
+ if (typeof icon === "string") return ICONS[icon] ?? ICON_BY_NAME[icon] ?? fallback;
51
+ if (Array.isArray(icon)) return icon;
52
+ return fallback;
77
53
  }
78
-
79
- /**
80
- * Shirkasoft UI Components.
81
- * Authors: Roberto Valladares Martin (Ansem13), Julio César García García (Sanjuli14).
82
- * Belongs to Shirkasoft.
83
- */
84
- /**
85
- * Moves a floating element (dropdown panel, popup, overlay) to `document.body`
86
- * so it always renders above the rest of the page.
87
- *
88
- * `position: fixed` + a high `z-index` is not enough on its own: an ancestor
89
- * with `transform`, `filter`, `backdrop-filter`, `contain`, or its own stacking
90
- * context (`z-index` + `position`, `sticky`, `opacity < 1`...) traps the element
91
- * inside it. Rendering it as a direct child of `body` avoids all of that.
92
- *
93
- * The element keeps being managed by Angular (bindings and listeners keep
94
- * working, and Angular removes it with `node.remove()` when it is hidden).
95
- * If the anchor lives inside a `.dark` container, the class is copied onto the
96
- * element so the dark theme (CSS variables, Tailwind `dark:` variants and
97
- * component `.dark .x` rules) still applies once it is outside the host.
98
- *
99
- * Returns a function that removes the element from the DOM; call it when the
100
- * owner component is destroyed so the element does not stay orphaned in `body`.
101
- */
102
54
  function portalToBody(element, anchor) {
103
- const doc = element.ownerDocument;
104
- if (element.parentNode !== doc.body) {
105
- doc.body.appendChild(element);
106
- }
107
- element.classList.toggle('dark', !!anchor?.closest('.dark'));
108
- return () => element.remove();
55
+ const doc = element.ownerDocument;
56
+ if (element.parentNode !== doc.body) doc.body.appendChild(element);
57
+ element.classList.toggle("dark", !!anchor?.closest(".dark"));
58
+ return () => element.remove();
109
59
  }
110
- /**
111
- * Renders the host element in `document.body` (see `portalToBody`) once it is
112
- * rendered, and removes it when the element or its owner is destroyed.
113
- *
114
- * ```html
115
- * @if (isOpen()) {
116
- * <div shkPortal class="fixed z-[9999]" [style.top.px]="top">...</div>
117
- * }
118
- * ```
119
- */
120
- class PortalDirective {
121
- constructor() {
122
- this.el = inject(ElementRef);
123
- let remove = null;
124
- afterNextRender(() => {
125
- const node = this.el.nativeElement;
126
- remove = portalToBody(node, node.parentElement);
127
- });
128
- inject(DestroyRef).onDestroy(() => remove?.());
129
- }
130
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.27", ngImport: i0, type: PortalDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
131
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.27", type: PortalDirective, isStandalone: true, selector: "[shkPortal]", ngImport: i0 }); }
132
- }
133
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.27", ngImport: i0, type: PortalDirective, decorators: [{
134
- type: Directive,
135
- args: [{ selector: '[shkPortal]' }]
136
- }], ctorParameters: () => [] });
137
-
138
- /**
139
- * Generated bundle index. Do not edit.
140
- */
141
-
60
+ var PortalDirective = class PortalDirective {
61
+ constructor() {
62
+ this.el = inject(ElementRef);
63
+ let remove = null;
64
+ afterNextRender(() => {
65
+ const node = this.el.nativeElement;
66
+ remove = portalToBody(node, node.parentElement);
67
+ });
68
+ inject(DestroyRef).onDestroy(() => remove?.());
69
+ }
70
+ static {
71
+ this.ɵfac = i0.ɵɵngDeclareFactory({
72
+ minVersion: "12.0.0",
73
+ version: "22.3.2",
74
+ ngImport: i0,
75
+ type: PortalDirective,
76
+ deps: [],
77
+ target: i0.ɵɵFactoryTarget.Directive
78
+ });
79
+ }
80
+ static {
81
+ this.ɵdir = i0.ɵɵngDeclareDirective({
82
+ minVersion: "14.0.0",
83
+ version: "22.3.2",
84
+ type: PortalDirective,
85
+ isStandalone: true,
86
+ selector: "[shkPortal]",
87
+ ngImport: i0
88
+ });
89
+ }
90
+ };
91
+ i0.ɵɵngDeclareClassMetadata({
92
+ minVersion: "12.0.0",
93
+ version: "22.3.2",
94
+ ngImport: i0,
95
+ type: PortalDirective,
96
+ decorators: [{
97
+ type: Directive,
98
+ args: [{ selector: "[shkPortal]" }]
99
+ }],
100
+ ctorParameters: () => []
101
+ });
142
102
  export { ICONS, PortalDirective, getIcon, isIconResolver, portalToBody };
143
- //# sourceMappingURL=shirkasoft-ui-components-utils.mjs.map
103
+
104
+ //# sourceMappingURL=shirkasoft-ui-components-utils.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"shirkasoft-ui-components-utils.mjs","sources":["../../../projects/ui-components/utils/icons.ts","../../../projects/ui-components/utils/portal.ts","../../../projects/ui-components/utils/shirkasoft-ui-components-utils.ts"],"sourcesContent":["/**\n * Shirkasoft UI Components.\n * Authors: Roberto Valladares Martin (Ansem13), Julio César García García (Sanjuli14).\n * Belongs to Shirkasoft.\n */\nimport {\n LucideArrowDown,\n LucideArrowLeft,\n LucideArrowUp,\n LucideArrowUpDown,\n LucideCalendarDays,\n LucideCheck,\n LucideChevronDown,\n LucideChevronLeft,\n LucideChevronRight,\n LucideChevronsLeft,\n LucideChevronsRight,\n LucideCircleQuestionMark,\n LucideCirclePlus,\n LucideDownload,\n LucideEllipsisVertical,\n LucideEye,\n LucideEyeOff,\n LucideFile,\n LucideFileSpreadsheet,\n LucideFileText,\n LucideFunnel,\n LucideGlobe,\n LucideLanguages,\n LucideInbox,\n LucideInfo,\n LucideLoader,\n LucideLoaderCircle,\n LucideLogOut,\n LucideMaximize2,\n LucideMenu,\n LucideMinimize2,\n LucidePanelRight,\n LucidePlus,\n LucideRefreshCw,\n LucideSearch,\n LucideTrash2,\n LucideTriangleAlert,\n LucideUpload,\n LucideX,\n} from 'shirkasoft-ui-components/icons';\nimport { ICON_BY_NAME } from 'shirkasoft-ui-components/icons';\nimport type { IconNode } from 'shirkasoft-ui-components/icons';\n\n/** Maps the icon names used across the library to their SVG data. */\nexport const ICONS: Record<string, IconNode> = {\n 'arrow-left': LucideArrowLeft,\n 'arrow-down': LucideArrowDown,\n 'arrow-up': LucideArrowUp,\n 'arrow-up-down': LucideArrowUpDown,\n check: LucideCheck,\n 'calendar-days': LucideCalendarDays,\n 'chevron-down': LucideChevronDown,\n 'chevron-left': LucideChevronLeft,\n 'chevron-right': LucideChevronRight,\n 'chevrons-left': LucideChevronsLeft,\n 'chevrons-right': LucideChevronsRight,\n 'circle-help': LucideCircleQuestionMark,\n 'circle-plus': LucideCirclePlus,\n download: LucideDownload,\n 'ellipsis-vertical': LucideEllipsisVertical,\n eye: LucideEye,\n 'eye-off': LucideEyeOff,\n file: LucideFile,\n 'file-spreadsheet': LucideFileSpreadsheet,\n 'file-text': LucideFileText,\n filter: LucideFunnel,\n globe: LucideGlobe,\n languages: LucideLanguages,\n inbox: LucideInbox,\n info: LucideInfo,\n loader: LucideLoader,\n 'loader-circle': LucideLoaderCircle,\n 'log-out': LucideLogOut,\n 'maximize-2': LucideMaximize2,\n menu: LucideMenu,\n 'minimize-2': LucideMinimize2,\n 'panel-right': LucidePanelRight,\n plus: LucidePlus,\n refresh: LucideRefreshCw,\n search: LucideSearch,\n 'trash-2': LucideTrash2,\n 'triangle-alert': LucideTriangleAlert,\n upload: LucideUpload,\n x: LucideX,\n};\n\n/**\n * True when `icon` is a per-item resolver function such as `(row) => 'pencil'`.\n *\n * Classes are functions too, but must never be called: a v1 `@lucide/angular`\n * component passed by an app that has not migrated yet would throw\n * \"Class constructor cannot be invoked without 'new'\". Those fall through to\n * `getIcon()`, which renders the fallback icon instead.\n */\nexport function isIconResolver(icon: unknown): icon is (...args: any[]) => unknown {\n return typeof icon === 'function' && !/^class[\\s{]/.test(Function.prototype.toString.call(icon));\n}\n\n/**\n * Resolves the icon passed to a component into SVG data.\n * Accepts a registered string name or an icon node array.\n */\nexport function getIcon(icon?: any, fallback: any = LucideCircleQuestionMark): IconNode | null {\n if (!icon) return null;\n if (typeof icon === 'string') {\n return ICONS[icon] ?? ICON_BY_NAME[icon] ?? fallback;\n }\n if (Array.isArray(icon)) {\n return icon;\n }\n return fallback;\n}","import { Directive, DestroyRef, ElementRef, afterNextRender, inject } from '@angular/core';\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 * Moves a floating element (dropdown panel, popup, overlay) to `document.body`\n * so it always renders above the rest of the page.\n *\n * `position: fixed` + a high `z-index` is not enough on its own: an ancestor\n * with `transform`, `filter`, `backdrop-filter`, `contain`, or its own stacking\n * context (`z-index` + `position`, `sticky`, `opacity < 1`...) traps the element\n * inside it. Rendering it as a direct child of `body` avoids all of that.\n *\n * The element keeps being managed by Angular (bindings and listeners keep\n * working, and Angular removes it with `node.remove()` when it is hidden).\n * If the anchor lives inside a `.dark` container, the class is copied onto the\n * element so the dark theme (CSS variables, Tailwind `dark:` variants and\n * component `.dark .x` rules) still applies once it is outside the host.\n *\n * Returns a function that removes the element from the DOM; call it when the\n * owner component is destroyed so the element does not stay orphaned in `body`.\n */\nexport function portalToBody(element: HTMLElement, anchor?: HTMLElement | null): () => void {\n const doc = element.ownerDocument;\n if (element.parentNode !== doc.body) {\n doc.body.appendChild(element);\n }\n element.classList.toggle('dark', !!anchor?.closest('.dark'));\n return () => element.remove();\n}\n\n/**\n * Renders the host element in `document.body` (see `portalToBody`) once it is\n * rendered, and removes it when the element or its owner is destroyed.\n *\n * ```html\n * @if (isOpen()) {\n * <div shkPortal class=\"fixed z-[9999]\" [style.top.px]=\"top\">...</div>\n * }\n * ```\n */\n@Directive({ selector: '[shkPortal]' })\nexport class PortalDirective {\n private readonly el = inject<ElementRef<HTMLElement>>(ElementRef);\n\n constructor() {\n let remove: (() => void) | null = null;\n afterNextRender(() => {\n const node = this.el.nativeElement;\n remove = portalToBody(node, node.parentElement);\n });\n inject(DestroyRef).onDestroy(() => remove?.());\n }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GAAG,MAAM,CAA0B,UAAU,CAAC;QAG/D,IAAI,MAAM,GAAwB,IAAI;QACtC,eAAe,CAAC,MAAK;AACnB,YAAA,MAAM,IAAI,GAAG,IAAI,CAAC,EAAE,CAAC,aAAa;YAClC,MAAM,GAAG,YAAY,CAAC,IAAI,EAAE,IAAI,CAAC,aAAa,CAAC;AACjD,QAAA,CAAC,CAAC;AACF,QAAA,MAAM,CAAC,UAAU,CAAC,CAAC,SAAS,CAAC,MAAM,MAAM,IAAI,CAAC;IAChD;+GAVW,eAAe,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;mGAAf,eAAe,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,aAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;;4FAAf,eAAe,EAAA,UAAA,EAAA,CAAA;kBAD3B,SAAS;mBAAC,EAAE,QAAQ,EAAE,aAAa,EAAE;;;AC7CtC;;AAEG;;;;"}
1
+ {"version":3,"file":"shirkasoft-ui-components-utils.mjs","names":[],"sources":["../../../projects/ui-components/utils/icons.ts","../../../projects/ui-components/utils/portal.ts"],"sourcesContent":["/**\n * Shirkasoft UI Components.\n * Authors: Roberto Valladares Martin (Ansem13), Julio César García García (Sanjuli14).\n * Belongs to Shirkasoft.\n */\nimport {\n LucideArrowDown,\n LucideArrowLeft,\n LucideArrowUp,\n LucideArrowUpDown,\n LucideCalendarDays,\n LucideCheck,\n LucideChevronDown,\n LucideChevronLeft,\n LucideChevronRight,\n LucideChevronsLeft,\n LucideChevronsRight,\n LucideCircleQuestionMark,\n LucideCirclePlus,\n LucideDownload,\n LucideEllipsisVertical,\n LucideEye,\n LucideEyeOff,\n LucideFile,\n LucideFileSpreadsheet,\n LucideFileText,\n LucideFunnel,\n LucideGlobe,\n LucideLanguages,\n LucideInbox,\n LucideInfo,\n LucideLoader,\n LucideLoaderCircle,\n LucideLogOut,\n LucideMaximize2,\n LucideMenu,\n LucideMinimize2,\n LucidePanelRight,\n LucidePlus,\n LucideRefreshCw,\n LucideSearch,\n LucideTrash2,\n LucideTriangleAlert,\n LucideUpload,\n LucideX,\n} from 'shirkasoft-ui-components/icons';\nimport { ICON_BY_NAME } from 'shirkasoft-ui-components/icons';\nimport type { IconNode } from 'shirkasoft-ui-components/icons';\n\n/** Maps the icon names used across the library to their SVG data. */\nexport const ICONS: Record<string, IconNode> = {\n 'arrow-left': LucideArrowLeft,\n 'arrow-down': LucideArrowDown,\n 'arrow-up': LucideArrowUp,\n 'arrow-up-down': LucideArrowUpDown,\n check: LucideCheck,\n 'calendar-days': LucideCalendarDays,\n 'chevron-down': LucideChevronDown,\n 'chevron-left': LucideChevronLeft,\n 'chevron-right': LucideChevronRight,\n 'chevrons-left': LucideChevronsLeft,\n 'chevrons-right': LucideChevronsRight,\n 'circle-help': LucideCircleQuestionMark,\n 'circle-plus': LucideCirclePlus,\n download: LucideDownload,\n 'ellipsis-vertical': LucideEllipsisVertical,\n eye: LucideEye,\n 'eye-off': LucideEyeOff,\n file: LucideFile,\n 'file-spreadsheet': LucideFileSpreadsheet,\n 'file-text': LucideFileText,\n filter: LucideFunnel,\n globe: LucideGlobe,\n languages: LucideLanguages,\n inbox: LucideInbox,\n info: LucideInfo,\n loader: LucideLoader,\n 'loader-circle': LucideLoaderCircle,\n 'log-out': LucideLogOut,\n 'maximize-2': LucideMaximize2,\n menu: LucideMenu,\n 'minimize-2': LucideMinimize2,\n 'panel-right': LucidePanelRight,\n plus: LucidePlus,\n refresh: LucideRefreshCw,\n search: LucideSearch,\n 'trash-2': LucideTrash2,\n 'triangle-alert': LucideTriangleAlert,\n upload: LucideUpload,\n x: LucideX,\n};\n\n/**\n * True when `icon` is a per-item resolver function such as `(row) => 'pencil'`.\n *\n * Classes are functions too, but must never be called: a v1 `@lucide/angular`\n * component passed by an app that has not migrated yet would throw\n * \"Class constructor cannot be invoked without 'new'\". Those fall through to\n * `getIcon()`, which renders the fallback icon instead.\n */\nexport function isIconResolver(icon: unknown): icon is (...args: any[]) => unknown {\n return typeof icon === 'function' && !/^class[\\s{]/.test(Function.prototype.toString.call(icon));\n}\n\n/**\n * Resolves the icon passed to a component into SVG data.\n * Accepts a registered string name or an icon node array.\n */\nexport function getIcon(icon?: any, fallback: any = LucideCircleQuestionMark): IconNode | null {\n if (!icon) return null;\n if (typeof icon === 'string') {\n return ICONS[icon] ?? ICON_BY_NAME[icon] ?? fallback;\n }\n if (Array.isArray(icon)) {\n return icon;\n }\n return fallback;\n}","import { Directive, DestroyRef, ElementRef, afterNextRender, inject } from '@angular/core';\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 * Moves a floating element (dropdown panel, popup, overlay) to `document.body`\n * so it always renders above the rest of the page.\n *\n * `position: fixed` + a high `z-index` is not enough on its own: an ancestor\n * with `transform`, `filter`, `backdrop-filter`, `contain`, or its own stacking\n * context (`z-index` + `position`, `sticky`, `opacity < 1`...) traps the element\n * inside it. Rendering it as a direct child of `body` avoids all of that.\n *\n * The element keeps being managed by Angular (bindings and listeners keep\n * working, and Angular removes it with `node.remove()` when it is hidden).\n * If the anchor lives inside a `.dark` container, the class is copied onto the\n * element so the dark theme (CSS variables, Tailwind `dark:` variants and\n * component `.dark .x` rules) still applies once it is outside the host.\n *\n * Returns a function that removes the element from the DOM; call it when the\n * owner component is destroyed so the element does not stay orphaned in `body`.\n */\nexport function portalToBody(element: HTMLElement, anchor?: HTMLElement | null): () => void {\n const doc = element.ownerDocument;\n if (element.parentNode !== doc.body) {\n doc.body.appendChild(element);\n }\n element.classList.toggle('dark', !!anchor?.closest('.dark'));\n return () => element.remove();\n}\n\n/**\n * Renders the host element in `document.body` (see `portalToBody`) once it is\n * rendered, and removes it when the element or its owner is destroyed.\n *\n * ```html\n * @if (isOpen()) {\n * <div shkPortal class=\"fixed z-[9999]\" [style.top.px]=\"top\">...</div>\n * }\n * ```\n */\n@Directive({ selector: '[shkPortal]' })\nexport class PortalDirective {\n private readonly el = inject<ElementRef<HTMLElement>>(ElementRef);\n\n constructor() {\n let remove: (() => void) | null = null;\n afterNextRender(() => {\n const node = this.el.nativeElement;\n remove = portalToBody(node, node.parentElement);\n });\n inject(DestroyRef).onDestroy(() => remove?.());\n }\n}\n"],"mappings":";;;AAkDA,MAAa,QAAkC;CAC7C,cAAc;CACd,cAAc;CACd,YAAY;CACZ,iBAAiB;CACjB,OAAO;CACP,iBAAiB;CACjB,gBAAgB;CAChB,gBAAgB;CAChB,iBAAiB;CACjB,iBAAiB;CACjB,kBAAkB;CAClB,eAAe;CACf,eAAe;CACf,UAAU;CACV,qBAAqB;CACrB,KAAK;CACL,WAAW;CACX,MAAM;CACN,oBAAoB;CACpB,aAAa;CACb,QAAQ;CACR,OAAO;CACP,WAAW;CACX,OAAO;CACP,MAAM;CACN,QAAQ;CACR,iBAAiB;CACjB,WAAW;CACX,cAAc;CACd,MAAM;CACN,cAAc;CACd,eAAe;CACf,MAAM;CACN,SAAS;CACT,QAAQ;CACR,WAAW;CACX,kBAAkB;CAClB,QAAQ;CACR,GAAG;AACJ;AAUD,SAAgB,eAAe,MAAa;CAC1C,OAAO,OAAO,SAAS,cAAc,CAAC,cAAc,KAAK,SAAS,UAAU,SAAS,KAAK,IAAI,CAAC;AACjG;AAMA,SAAgB,QAAQ,MAAY,WAAgB,0BAAwB;CAC1E,IAAI,CAAC,MAAM,OAAO;CAClB,IAAI,OAAO,SAAS,UAClB,OAAO,MAAM,SAAS,aAAa,SAAS;CAE9C,IAAI,MAAM,QAAQ,IAAI,GACpB,OAAO;CAET,OAAO;AACT;AC3FA,SAAgB,aAAa,SAAsB,QAA2B;CAC5E,MAAM,MAAM,QAAQ;CACpB,IAAI,QAAQ,eAAe,IAAI,MAC7B,IAAI,KAAK,YAAY,OAAO;CAE9B,QAAQ,UAAU,OAAO,QAAQ,CAAC,CAAC,QAAQ,QA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