shirkasoft-ui-components 1.3.9 → 1.3.10

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.
@@ -1,4 +1,6 @@
1
1
  import { LucideX, LucideUpload, LucideTriangleAlert, LucideTrash2, LucideSearch, LucideRefreshCw, LucidePlus, LucidePanelRight, LucideMinimize2, LucideMenu, LucideMaximize2, LucideLogOut, LucideLoaderCircle, LucideLoader, LucideInfo, LucideInbox, LucideGlobe, LucideFunnel, LucideFileText, LucideFileSpreadsheet, LucideFile, LucideEyeOff, LucideEye, LucideEllipsisVertical, LucideDownload, LucideCirclePlus, LucideCircleQuestionMark, LucideChevronsRight, LucideChevronsLeft, LucideChevronRight, LucideChevronLeft, LucideChevronDown, LucideCalendarDays, LucideCheck, LucideArrowUpDown, LucideArrowUp, LucideArrowDown, LucideArrowLeft } from '@lucide/angular';
2
+ import * as i0 from '@angular/core';
3
+ import { inject, ElementRef, afterNextRender, DestroyRef, Directive } from '@angular/core';
2
4
 
3
5
  /**
4
6
  * Shirkasoft UI Components.
@@ -62,9 +64,68 @@ function getIcon(icon, fallback = LucideCircleQuestionMark) {
62
64
  return fallback;
63
65
  }
64
66
 
67
+ /**
68
+ * Shirkasoft UI Components.
69
+ * Authors: Roberto Valladares Martin (Ansem13), Julio César García García (Sanjuli14).
70
+ * Belongs to Shirkasoft.
71
+ */
72
+ /**
73
+ * Moves a floating element (dropdown panel, popup, overlay) to `document.body`
74
+ * so it always renders above the rest of the page.
75
+ *
76
+ * `position: fixed` + a high `z-index` is not enough on its own: an ancestor
77
+ * with `transform`, `filter`, `backdrop-filter`, `contain`, or its own stacking
78
+ * context (`z-index` + `position`, `sticky`, `opacity < 1`...) traps the element
79
+ * inside it. Rendering it as a direct child of `body` avoids all of that.
80
+ *
81
+ * The element keeps being managed by Angular (bindings and listeners keep
82
+ * working, and Angular removes it with `node.remove()` when it is hidden).
83
+ * If the anchor lives inside a `.dark` container, the class is copied onto the
84
+ * element so the dark theme (CSS variables, Tailwind `dark:` variants and
85
+ * component `.dark .x` rules) still applies once it is outside the host.
86
+ *
87
+ * Returns a function that removes the element from the DOM; call it when the
88
+ * owner component is destroyed so the element does not stay orphaned in `body`.
89
+ */
90
+ function portalToBody(element, anchor) {
91
+ const doc = element.ownerDocument;
92
+ if (element.parentNode !== doc.body) {
93
+ doc.body.appendChild(element);
94
+ }
95
+ element.classList.toggle('dark', !!anchor?.closest('.dark'));
96
+ return () => element.remove();
97
+ }
98
+ /**
99
+ * Renders the host element in `document.body` (see `portalToBody`) once it is
100
+ * rendered, and removes it when the element or its owner is destroyed.
101
+ *
102
+ * ```html
103
+ * @if (isOpen()) {
104
+ * <div shkPortal class="fixed z-[9999]" [style.top.px]="top">...</div>
105
+ * }
106
+ * ```
107
+ */
108
+ class PortalDirective {
109
+ constructor() {
110
+ this.el = inject(ElementRef);
111
+ let remove = null;
112
+ afterNextRender(() => {
113
+ const node = this.el.nativeElement;
114
+ remove = portalToBody(node, node.parentElement);
115
+ });
116
+ inject(DestroyRef).onDestroy(() => remove?.());
117
+ }
118
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.23", ngImport: i0, type: PortalDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
119
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.23", type: PortalDirective, isStandalone: true, selector: "[shkPortal]", ngImport: i0 }); }
120
+ }
121
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.23", ngImport: i0, type: PortalDirective, decorators: [{
122
+ type: Directive,
123
+ args: [{ selector: '[shkPortal]', standalone: true }]
124
+ }], ctorParameters: () => [] });
125
+
65
126
  /**
66
127
  * Generated bundle index. Do not edit.
67
128
  */
68
129
 
69
- export { ICONS, getIcon };
130
+ export { ICONS, PortalDirective, getIcon, portalToBody };
70
131
  //# 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/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 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 '@lucide/angular';\n\n/** Maps the icon names used across the library to their Lucide component. */\nexport const ICONS: Record<string, any> = {\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 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 * Resolves the icon passed to a component into a lucide component.\n * Accepts a registered string name, an existing lucide component or a LucideIconData object.\n */\nexport function getIcon(icon?: any, fallback: any = LucideCircleQuestionMark): any {\n if (!icon) return null;\n if (typeof icon === 'string') {\n return ICONS[icon] ?? fallback;\n }\n if (typeof icon === 'function') {\n return icon;\n }\n return fallback;\n}","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;AAAA;;;;AAIG;AA0CH;AACO,MAAM,KAAK,GAAwB;AACxC,IAAA,YAAY,EAAE,eAAe;AAC7B,IAAA,YAAY,EAAE,eAAe;AAC7B,IAAA,UAAU,EAAE,aAAa;AACzB,IAAA,eAAe,EAAE,iBAAiB;AAClC,IAAA,KAAK,EAAE,WAAW;AAClB,IAAA,eAAe,EAAE,kBAAkB;AACnC,IAAA,cAAc,EAAE,iBAAiB;AACjC,IAAA,cAAc,EAAE,iBAAiB;AACjC,IAAA,eAAe,EAAE,kBAAkB;AACnC,IAAA,eAAe,EAAE,kBAAkB;AACnC,IAAA,gBAAgB,EAAE,mBAAmB;AACrC,IAAA,aAAa,EAAE,wBAAwB;AACvC,IAAA,aAAa,EAAE,gBAAgB;AAC/B,IAAA,QAAQ,EAAE,cAAc;AACxB,IAAA,mBAAmB,EAAE,sBAAsB;AAC3C,IAAA,GAAG,EAAE,SAAS;AACd,IAAA,SAAS,EAAE,YAAY;AACvB,IAAA,IAAI,EAAE,UAAU;AAChB,IAAA,kBAAkB,EAAE,qBAAqB;AACzC,IAAA,WAAW,EAAE,cAAc;AAC3B,IAAA,MAAM,EAAE,YAAY;AACpB,IAAA,KAAK,EAAE,WAAW;AAClB,IAAA,KAAK,EAAE,WAAW;AAClB,IAAA,IAAI,EAAE,UAAU;AAChB,IAAA,MAAM,EAAE,YAAY;AACpB,IAAA,eAAe,EAAE,kBAAkB;AACnC,IAAA,SAAS,EAAE,YAAY;AACvB,IAAA,YAAY,EAAE,eAAe;AAC7B,IAAA,IAAI,EAAE,UAAU;AAChB,IAAA,YAAY,EAAE,eAAe;AAC7B,IAAA,aAAa,EAAE,gBAAgB;AAC/B,IAAA,IAAI,EAAE,UAAU;AAChB,IAAA,OAAO,EAAE,eAAe;AACxB,IAAA,MAAM,EAAE,YAAY;AACpB,IAAA,SAAS,EAAE,YAAY;AACvB,IAAA,gBAAgB,EAAE,mBAAmB;AACrC,IAAA,MAAM,EAAE,YAAY;AACpB,IAAA,CAAC,EAAE,OAAO;;AAGZ;;;AAGG;SACa,OAAO,CAAC,IAAU,EAAE,WAAgB,wBAAwB,EAAA;AAC1E,IAAA,IAAI,CAAC,IAAI;AAAE,QAAA,OAAO,IAAI;AACtB,IAAA,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE;AAC5B,QAAA,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,QAAQ;IAChC;AACA,IAAA,IAAI,OAAO,IAAI,KAAK,UAAU,EAAE;AAC9B,QAAA,OAAO,IAAI;IACb;AACA,IAAA,OAAO,QAAQ;AACjB;;ACrGA;;AAEG;;;;"}
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 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 '@lucide/angular';\n\n/** Maps the icon names used across the library to their Lucide component. */\nexport const ICONS: Record<string, any> = {\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 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 * Resolves the icon passed to a component into a lucide component.\n * Accepts a registered string name, an existing lucide component or a LucideIconData object.\n */\nexport function getIcon(icon?: any, fallback: any = LucideCircleQuestionMark): any {\n if (!icon) return null;\n if (typeof icon === 'string') {\n return ICONS[icon] ?? fallback;\n }\n if (typeof icon === 'function') {\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]', standalone: true })\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","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":"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"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shirkasoft-ui-components",
3
- "version": "1.3.9",
3
+ "version": "1.3.10",
4
4
  "description": "Angular UI Components Library — themeable via CSS custom properties",
5
5
  "keywords": [
6
6
  "angular",
package/src/theme.css CHANGED
@@ -500,6 +500,15 @@ textarea.shk-control.shk-control-valid:focus {
500
500
  border-color: var(--shk-success-600);
501
501
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--shk-success-600) 22%, transparent);
502
502
  }
503
+ /* Invalid field (validation error): red border in every state and theme.
504
+ Specificity (0,2,1) beats Tailwind `dark:[border-color:…]` utilities. */
505
+ input.shk-control[aria-invalid='true'],
506
+ textarea.shk-control[aria-invalid='true'],
507
+ div.shk-control[aria-invalid='true'],
508
+ div.shk-dropzone[aria-invalid='true'],
509
+ div.shk-dropzone[aria-invalid='true']:hover {
510
+ border-color: var(--shk-error-500);
511
+ }
503
512
  input.shk-control[aria-invalid='true']:focus,
504
513
  textarea.shk-control[aria-invalid='true']:focus,
505
514
  div.shk-control[aria-invalid='true']:focus-within,
@@ -30,8 +30,10 @@ declare class DatePickerComponent implements ControlValueAccessor {
30
30
  label: _angular_core.InputSignal<string>;
31
31
  /** Placeholder of the input. */
32
32
  placeholder: _angular_core.InputSignal<string>;
33
- /** FormGroup used to resolve the control from `label`. */
33
+ /** FormGroup used to resolve the control from `controlName` (or `label`). */
34
34
  formGroup: _angular_core.InputSignal<FormGroup<any> | undefined>;
35
+ /** Name of the control inside `formGroup`. Takes precedence over `label`. */
36
+ controlName: _angular_core.InputSignal<string>;
35
37
  /** Directly bound FormControl. */
36
38
  control: _angular_core.InputSignal<FormControl<any> | undefined>;
37
39
  /** Disables the picker. */
@@ -58,6 +60,15 @@ declare class DatePickerComponent implements ControlValueAccessor {
58
60
  showSeconds: _angular_core.InputSignal<boolean>;
59
61
  /** Step (in minutes) for the minute selector. */
60
62
  minuteStep: _angular_core.InputSignal<number>;
63
+ /**
64
+ * Format of the value received from and emitted to the form control.
65
+ * Tokens: YYYY, MM, DD, HH, mm, ss (e.g. 'DD-MM-YYYY', 'DD/MM/YYYY HH:mm').
66
+ * Empty (default) keeps the ISO format ('YYYY-MM-DD', 'YYYY-MM', 'YYYY',
67
+ * 'YYYY-MM-DDTHH:mm', 'HH:mm').
68
+ */
69
+ valueFormat: _angular_core.InputSignal<string>;
70
+ /** Overlay (backdrop + calendar), rendered in <body> while open (shkPortal). */
71
+ private overlay;
61
72
  /** Whether the dropdown calendar is open. */
62
73
  isOpen: _angular_core.WritableSignal<boolean>;
63
74
  /** Year currently displayed in the calendar. */
@@ -298,11 +309,40 @@ declare class DatePickerComponent implements ControlValueAccessor {
298
309
  isSelectedYear(year: number): boolean;
299
310
  isCurrentYear(year: number): boolean;
300
311
  writeValue(value: any): void;
312
+ /**
313
+ * Normalizes an incoming value to the internal ISO string format expected
314
+ * for the current configuration:
315
+ * - date/week: "YYYY-MM-DD" (or "YYYY-MM-DDTHH:mm[:ss]" with showTime)
316
+ * - month: "YYYY-MM"
317
+ * - year: "YYYY"
318
+ * - timeOnly: "HH:mm[:ss]"
319
+ *
320
+ * Accepts ISO strings, `Date` objects, timestamps and day-first strings
321
+ * ("DD-MM-YYYY", "DD/MM/YYYY", "DD.MM.YYYY"; month-first when locale is
322
+ * 'en'). Values that cannot be interpreted are discarded (returns null)
323
+ * instead of breaking the formatted label.
324
+ */
325
+ private normalizeValue;
326
+ /** Matches the tokens supported by `valueFormat`. */
327
+ private static readonly FORMAT_TOKENS;
328
+ /**
329
+ * Parses a string using the `valueFormat` pattern and returns the internal
330
+ * ISO value, or null if it does not match.
331
+ */
332
+ private parseWithFormat;
333
+ /** Converts the internal ISO value to the configured `valueFormat`. */
334
+ private toOutputValue;
335
+ /** Builds the internal value from a Date according to the configuration. */
336
+ private fromDate;
337
+ /** Formats "HH:mm[:ss]" honoring the showSeconds option. */
338
+ private buildTime;
339
+ /** Warns about an unparseable value and discards it. */
340
+ private invalidValue;
301
341
  registerOnChange(fn: any): void;
302
342
  registerOnTouched(fn: any): void;
303
343
  setDisabledState(isDisabled: boolean): void;
304
344
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<DatePickerComponent, never>;
305
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<DatePickerComponent, "shk-date-picker", never, { "id": { "alias": "id"; "required": false; "isSignal": true; }; "view": { "alias": "view"; "required": false; "isSignal": true; }; "weekStart": { "alias": "weekStart"; "required": false; "isSignal": true; }; "label": { "alias": "label"; "required": false; "isSignal": true; }; "placeholder": { "alias": "placeholder"; "required": false; "isSignal": true; }; "formGroup": { "alias": "formGroup"; "required": false; "isSignal": true; }; "control": { "alias": "control"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "errorMessage": { "alias": "errorMessage"; "required": false; "isSignal": true; }; "errorMessages": { "alias": "errorMessages"; "required": false; "isSignal": true; }; "minValue": { "alias": "minValue"; "required": false; "isSignal": true; }; "maxValue": { "alias": "maxValue"; "required": false; "isSignal": true; }; "locale": { "alias": "locale"; "required": false; "isSignal": true; }; "timeOnly": { "alias": "timeOnly"; "required": false; "isSignal": true; }; "showTime": { "alias": "showTime"; "required": false; "isSignal": true; }; "hourFormat": { "alias": "hourFormat"; "required": false; "isSignal": true; }; "showSeconds": { "alias": "showSeconds"; "required": false; "isSignal": true; }; "minuteStep": { "alias": "minuteStep"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
345
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<DatePickerComponent, "shk-date-picker", never, { "id": { "alias": "id"; "required": false; "isSignal": true; }; "view": { "alias": "view"; "required": false; "isSignal": true; }; "weekStart": { "alias": "weekStart"; "required": false; "isSignal": true; }; "label": { "alias": "label"; "required": false; "isSignal": true; }; "placeholder": { "alias": "placeholder"; "required": false; "isSignal": true; }; "formGroup": { "alias": "formGroup"; "required": false; "isSignal": true; }; "controlName": { "alias": "controlName"; "required": false; "isSignal": true; }; "control": { "alias": "control"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "errorMessage": { "alias": "errorMessage"; "required": false; "isSignal": true; }; "errorMessages": { "alias": "errorMessages"; "required": false; "isSignal": true; }; "minValue": { "alias": "minValue"; "required": false; "isSignal": true; }; "maxValue": { "alias": "maxValue"; "required": false; "isSignal": true; }; "locale": { "alias": "locale"; "required": false; "isSignal": true; }; "timeOnly": { "alias": "timeOnly"; "required": false; "isSignal": true; }; "showTime": { "alias": "showTime"; "required": false; "isSignal": true; }; "hourFormat": { "alias": "hourFormat"; "required": false; "isSignal": true; }; "showSeconds": { "alias": "showSeconds"; "required": false; "isSignal": true; }; "minuteStep": { "alias": "minuteStep"; "required": false; "isSignal": true; }; "valueFormat": { "alias": "valueFormat"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
306
346
  }
307
347
 
308
348
  export { DatePickerComponent };
@@ -50,6 +50,7 @@ declare class PriceInputComponent implements ControlValueAccessor {
50
50
  /** Message rendered when the field is in error state. */
51
51
  errorMessage: _angular_core.InputSignal<string>;
52
52
  private destroyRef;
53
+ private transloco;
53
54
  /** Text currently shown in the input (raw while focused, formatted on blur). */
54
55
  displayText: _angular_core.WritableSignal<string>;
55
56
  /** Whether the native input currently has focus. */
@@ -58,6 +59,15 @@ declare class PriceInputComponent implements ControlValueAccessor {
58
59
  private controlDisabled;
59
60
  /** Prevents re-subscribing to the same form control. */
60
61
  private ctrlSubscribed;
62
+ /** Bumped on control status changes / blur so error computeds refresh. */
63
+ private statusTick;
64
+ /**
65
+ * Whether the error state is shown: forced with `showError`, or when the
66
+ * bound `control` is invalid and has been touched or modified.
67
+ */
68
+ hasError: _angular_core.Signal<boolean>;
69
+ /** Message shown under the field: `errorMessage` or one derived from the control errors. */
70
+ errorText: _angular_core.Signal<string>;
61
71
  /** Effective disabled state combining the input and the form binding. */
62
72
  isDisabled: _angular_core.Signal<boolean>;
63
73
  /** Callbacks used by the ControlValueAccessor contract. */
@@ -162,6 +162,8 @@ declare class SelectComponent implements ControlValueAccessor {
162
162
  nextPage(): void;
163
163
  /** Goes to the previous options page when possible. */
164
164
  previousPage(): void;
165
+ /** Whether a node belongs to the component or to its (portaled) dropdown panel. */
166
+ private isInsideComponent;
165
167
  /** Closes the dropdown when a click happens outside the component. */
166
168
  onClickOutside(event: MouseEvent): void;
167
169
  /** Selects a typed free-text value as a new custom entry. */
@@ -1,3 +1,5 @@
1
+ import * as i0 from '@angular/core';
2
+
1
3
  /** Maps the icon names used across the library to their Lucide component. */
2
4
  declare const ICONS: Record<string, any>;
3
5
  /**
@@ -6,4 +8,45 @@ declare const ICONS: Record<string, any>;
6
8
  */
7
9
  declare function getIcon(icon?: any, fallback?: any): any;
8
10
 
9
- export { ICONS, getIcon };
11
+ /**
12
+ * Shirkasoft UI Components.
13
+ * Authors: Roberto Valladares Martin (Ansem13), Julio César García García (Sanjuli14).
14
+ * Belongs to Shirkasoft.
15
+ */
16
+ /**
17
+ * Moves a floating element (dropdown panel, popup, overlay) to `document.body`
18
+ * so it always renders above the rest of the page.
19
+ *
20
+ * `position: fixed` + a high `z-index` is not enough on its own: an ancestor
21
+ * with `transform`, `filter`, `backdrop-filter`, `contain`, or its own stacking
22
+ * context (`z-index` + `position`, `sticky`, `opacity < 1`...) traps the element
23
+ * inside it. Rendering it as a direct child of `body` avoids all of that.
24
+ *
25
+ * The element keeps being managed by Angular (bindings and listeners keep
26
+ * working, and Angular removes it with `node.remove()` when it is hidden).
27
+ * If the anchor lives inside a `.dark` container, the class is copied onto the
28
+ * element so the dark theme (CSS variables, Tailwind `dark:` variants and
29
+ * component `.dark .x` rules) still applies once it is outside the host.
30
+ *
31
+ * Returns a function that removes the element from the DOM; call it when the
32
+ * owner component is destroyed so the element does not stay orphaned in `body`.
33
+ */
34
+ declare function portalToBody(element: HTMLElement, anchor?: HTMLElement | null): () => void;
35
+ /**
36
+ * Renders the host element in `document.body` (see `portalToBody`) once it is
37
+ * rendered, and removes it when the element or its owner is destroyed.
38
+ *
39
+ * ```html
40
+ * @if (isOpen()) {
41
+ * <div shkPortal class="fixed z-[9999]" [style.top.px]="top">...</div>
42
+ * }
43
+ * ```
44
+ */
45
+ declare class PortalDirective {
46
+ private readonly el;
47
+ constructor();
48
+ static ɵfac: i0.ɵɵFactoryDeclaration<PortalDirective, never>;
49
+ static ɵdir: i0.ɵɵDirectiveDeclaration<PortalDirective, "[shkPortal]", never, {}, {}, never, never, true, never>;
50
+ }
51
+
52
+ export { ICONS, PortalDirective, getIcon, portalToBody };