shirkasoft-ui-components 1.3.13 → 1.3.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +32 -4
- package/fesm2022/shirkasoft-ui-components-modal.mjs +13 -2
- package/fesm2022/shirkasoft-ui-components-modal.mjs.map +1 -1
- package/fesm2022/shirkasoft-ui-components-table.mjs +58 -19
- package/fesm2022/shirkasoft-ui-components-table.mjs.map +1 -1
- package/package.json +1 -1
- package/types/shirkasoft-ui-components-modal.d.ts +9 -0
- package/types/shirkasoft-ui-components-table.d.ts +54 -11
package/README.md
CHANGED
|
@@ -484,12 +484,14 @@ interface FilterChangeEvent {
|
|
|
484
484
|
| `globalFilterFields` | `string[]` (dot paths) | `[]` (all primitive values) |
|
|
485
485
|
| `showGridlines` | `boolean` | `false` |
|
|
486
486
|
| `validateRequired` | `boolean` | `false` |
|
|
487
|
+
| `missingAsError` | `boolean` (with `validateRequired`) | `true` |
|
|
488
|
+
| `requiredFields` | `(string \| RequiredField)[]` | `[]` |
|
|
487
489
|
| `resizableColumns` | `boolean` (only with `showGridlines`) | `true` |
|
|
488
490
|
| `columnWidths` | `Record<string, number>` (two-way `[(columnWidths)]`) | `{}` |
|
|
489
491
|
| `stateKey` | `string` (persists column widths) | `''` |
|
|
490
492
|
| `stateStorage` | `'local' \| 'session'` | `'local'` |
|
|
491
493
|
| `rowHover` | `boolean` | `true` |
|
|
492
|
-
| `showClearButton` | `boolean` | `
|
|
494
|
+
| `showClearButton` | `boolean` | `false` |
|
|
493
495
|
| `showPageReport` | `boolean` | `true` |
|
|
494
496
|
| `showRowsPerPage` | `boolean` | `true` |
|
|
495
497
|
| `emptyMessage` | `string` | `''` |
|
|
@@ -530,7 +532,7 @@ i18n keys used: `table.selected` (`{{count}}`), `table.selectAll`, `table.select
|
|
|
530
532
|
- `boolean`: tri-state checkbox (any → yes → no), applied immediately.
|
|
531
533
|
- `range`: two-thumb slider between `filterMin` and `filterMax`, applied on release.
|
|
532
534
|
|
|
533
|
-
**Missing data validation.** Opt-in with `[validateRequired]="true"` and mark the mandatory columns with `required: true`. Rows where one of them is empty (`null`, `undefined`, blank text or empty array; `0` and `false` are valid) get a
|
|
535
|
+
**Missing data validation.** Opt-in with `[validateRequired]="true"` and mark the mandatory columns with `required: true`. Rows where one of them is empty (`null`, `undefined`, blank text or empty array; `0` and `false` are valid) get a red (error) background and stripe, an error icon whose tooltip lists the missing fields, and the empty cell shows "Falta <header>" (or `missingMessage`). The caption shows how many rows are incomplete (whole dataset in client mode, current page in server mode). Use `isMissing: (row) => boolean` for custom rules.
|
|
534
536
|
|
|
535
537
|
```typescript
|
|
536
538
|
cols: Column[] = [
|
|
@@ -542,6 +544,31 @@ cols: Column[] = [
|
|
|
542
544
|
<shk-table [data]="users" [columns]="cols" [validateRequired]="true" />
|
|
543
545
|
```
|
|
544
546
|
|
|
547
|
+
Fields that aren't columns can be required too with `requiredFields`: a field name (`'phone'`) or `{ field, label?, isMissing? }`. They flag the row the same way and appear in the tooltip (there's no cell to write "Falta…" in), and `validateRow` checks them as well.
|
|
548
|
+
|
|
549
|
+
```html
|
|
550
|
+
<shk-table [data]="users()" [columns]="cols" [validateRequired]="true"
|
|
551
|
+
[requiredFields]="[{ field: 'phone', label: 'Teléfono' }, 'address.street']" />
|
|
552
|
+
```
|
|
553
|
+
|
|
554
|
+
Incomplete rows are shown as errors (red) by default; set `[missingAsError]="false"` to show them as warnings (amber) instead.
|
|
555
|
+
|
|
556
|
+
**Validating a modal payload.** `validateRow(obj)` returns the `required` columns and `requiredFields` the object is missing (`[{ field, header }]`, empty when complete); it works even with `validateRequired` off. Combined with the modal's optional `onAccept`, the data coming from a form can be added and flagged:
|
|
557
|
+
|
|
558
|
+
```typescript
|
|
559
|
+
table = viewChild.required(TableComponent);
|
|
560
|
+
|
|
561
|
+
this.modalSrv.open({
|
|
562
|
+
title: 'Nuevo usuario',
|
|
563
|
+
component: NewUserFormComponent, // submitSuccess.emit(this.form.getRawValue())
|
|
564
|
+
onAccept: (payload) => {
|
|
565
|
+
const missing = this.table().validateRow(payload);
|
|
566
|
+
this.users.update((u) => [...u, payload]); // the row is flagged by validateRequired
|
|
567
|
+
if (missing.length) this.notify('Faltan: ' + missing.map((m) => m.header).join(', '));
|
|
568
|
+
},
|
|
569
|
+
});
|
|
570
|
+
```
|
|
571
|
+
|
|
545
572
|
i18n: `table.missing.{summary, row, cell, column}` (Spanish fallbacks).
|
|
546
573
|
|
|
547
574
|
**Resizable columns.** With `[showGridlines]="true"` each header has a handle on its right border: drag it to widen/narrow the column (minimum 60px; the table scrolls horizontally when it no longer fits), use the arrow keys on it (Shift = 50px steps), or double click it to go back to the automatic width. Disable it with `[resizableColumns]="false"`. Every change emits `columnResize`. The row actions column can be resized too (its width is stored under the `actions` key); its automatic width fits the most actions visible in a row of the current page (honouring each action's `isVisible`), not every action defined.
|
|
@@ -556,7 +583,7 @@ To keep the widths, either give the table a `stateKey` (saved in `localStorage`
|
|
|
556
583
|
[(columnWidths)]="widths" (columnResize)="savePreferences()" />
|
|
557
584
|
```
|
|
558
585
|
|
|
559
|
-
|
|
586
|
+
With `[showClearButton]="true"`, a **Clear** button next to the search resets the search, every column filter, the sort and the page. In server mode, `filterChange` carries both the simple `filters` map and the full `filterMeta`.
|
|
560
587
|
|
|
561
588
|
```typescript
|
|
562
589
|
columns: Column[] = [
|
|
@@ -599,6 +626,7 @@ interface ModalConfig {
|
|
|
599
626
|
acceptLabel?: string;
|
|
600
627
|
cancelLabel?: string;
|
|
601
628
|
onClose?: () => void;
|
|
629
|
+
onAccept?: (payload: any) => void; // optional: receives the form payload on accept
|
|
602
630
|
}
|
|
603
631
|
```
|
|
604
632
|
|
|
@@ -606,7 +634,7 @@ The injected component **must** expose:
|
|
|
606
634
|
|
|
607
635
|
- `form?: FormGroup` (optional, for validation)
|
|
608
636
|
- `onSubmit()` → calls `submitSuccess` or `submitError`
|
|
609
|
-
- `submitSuccess?: EventEmitter<void>` (optional)
|
|
637
|
+
- `submitSuccess?: EventEmitter<void | any>` (optional; the emitted value is passed to `onAccept`, otherwise `form.getRawValue()` is used)
|
|
610
638
|
- `submitError?: EventEmitter<void>` (optional)
|
|
611
639
|
- `handleCancel?: () => void` (optional)
|
|
612
640
|
|
|
@@ -162,7 +162,7 @@ class ModalComponent {
|
|
|
162
162
|
this.isFormValid.set(valid);
|
|
163
163
|
this.cdr.markForCheck();
|
|
164
164
|
});
|
|
165
|
-
this.subscribeToOutput(instance.submitSuccess, () => this.handleSubmit(true));
|
|
165
|
+
this.subscribeToOutput(instance.submitSuccess, (payload) => this.handleSubmit(true, payload));
|
|
166
166
|
this.subscribeToOutput(instance.submitError, () => this.handleSubmit(false));
|
|
167
167
|
this.componentRef.changeDetectorRef.markForCheck();
|
|
168
168
|
this.cdr.markForCheck();
|
|
@@ -174,14 +174,25 @@ class ModalComponent {
|
|
|
174
174
|
}
|
|
175
175
|
}
|
|
176
176
|
/** Finalizes the submit flow, accepting the modal on success. */
|
|
177
|
-
handleSubmit(success) {
|
|
177
|
+
handleSubmit(success, payload) {
|
|
178
178
|
this.isProcessing.set(false);
|
|
179
179
|
this.loading.set(false);
|
|
180
180
|
this.cdr.markForCheck();
|
|
181
181
|
if (success) {
|
|
182
|
+
// Hand the payload to `onAccept` (only when the modal config defines it).
|
|
183
|
+
const onAccept = this.currentConfig()?.onAccept;
|
|
184
|
+
if (onAccept) {
|
|
185
|
+
untracked(() => onAccept(payload !== undefined ? payload : this.getFormValue()));
|
|
186
|
+
}
|
|
182
187
|
untracked(() => this.modalSrv.accept());
|
|
183
188
|
}
|
|
184
189
|
}
|
|
190
|
+
/** Raw value of the dynamic component's form, or undefined when it has none. */
|
|
191
|
+
getFormValue() {
|
|
192
|
+
const instance = this.componentRef?.instance;
|
|
193
|
+
const form = instance ? this.getForm(instance) : null;
|
|
194
|
+
return form ? form.getRawValue() : undefined;
|
|
195
|
+
}
|
|
185
196
|
/** Closes the modal, calling the dynamic component's `handleCancel` if any. */
|
|
186
197
|
closeModal() {
|
|
187
198
|
if (this.componentRef?.instance?.handleCancel) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shirkasoft-ui-components-modal.mjs","sources":["../../../projects/ui-components/modal/modal.service.ts","../../../projects/ui-components/modal/modal.component.ts","../../../projects/ui-components/modal/modal.component.html","../../../projects/ui-components/modal/shirkasoft-ui-components-modal.ts"],"sourcesContent":["import { Injectable, Type, signal, computed, inject, DestroyRef } from '@angular/core';\nimport { Router } from '@angular/router';\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/** Options for opening a modal through the service. */\nexport interface ModalConfig {\n /** Title shown in the modal header. */\n title: string;\n /** Component rendered inside the modal body. */\n component: Type<any>;\n /** Data passed to the modal component via inputs. */\n data?: Record<string, any>;\n /** Modal width (CSS value). */\n width?: string;\n /** Whether the accept/cancel buttons are shown. */\n showButtons?: boolean;\n /** Whether the expand (fullscreen) button is shown. */\n showExpandButton?: boolean;\n /** Label of the accept button. */\n acceptLabel?: string;\n /** Label of the cancel button. */\n cancelLabel?: string;\n /** Optional callback invoked when the modal closes. */\n onClose?: () => void;\n}\n\n/**\n * Global modal manager. Opens modals on a stack, exposing reactive access to\n * the current modal and the top-most opened config.\n */\n@Injectable({ providedIn: 'root' })\nexport class ModalService {\n /** Stack of open modals (top-most renders on top). */\n private stackSignal = signal<ModalConfig[]>([]);\n /** Counter emitted on each close, used to trigger close animations. */\n private closeRequestSignal = signal<number>(0);\n private router = inject(Router);\n private destroyRef = inject(DestroyRef);\n\n constructor() {\n // Close all modals on navigation and on service destruction.\n this.router.events.subscribe(() => {\n this.stackSignal.set([]);\n });\n this.destroyRef.onDestroy(() => this.stackSignal.set([]));\n }\n\n /** Reactive list of open modals. */\n modalStack = computed(() => this.stackSignal());\n /** Top-most modal on the stack, or null. */\n currentModal = computed<ModalConfig | null>(() => {\n const stack = this.stackSignal();\n return stack.length > 0 ? stack[stack.length - 1] : null;\n });\n /** Reactive close-request counter. */\n closeRequest = computed(() => this.closeRequestSignal());\n\n /** Opens a new modal on top of the stack. */\n open(config: ModalConfig) {\n this.stackSignal.update((stack) => [...stack, config]);\n }\n\n /** Alias of `close()` used by the accept button. */\n accept() {\n this.close();\n }\n\n /** Closes the top-most modal, invoking its onClose callback. */\n close() {\n const stack = this.stackSignal();\n if (stack.length > 0) {\n stack[stack.length - 1]?.onClose?.();\n this.stackSignal.set(stack.slice(0, -1));\n this.closeRequestSignal.update((v) => v + 1);\n }\n }\n\n /** Closes all open modals at once. */\n clear() {\n this.stackSignal.set([]);\n }\n}","import {\n Component,\n viewChild,\n ViewContainerRef,\n ComponentRef,\n inject,\n effect,\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n signal,\n DestroyRef,\n computed,\n untracked,\n} from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport {\n LucideDynamicIcon,\n LucideX,\n} from '@lucide/angular';\nimport { Subscription } from 'rxjs';\nimport { FormControl, FormGroup } from '@angular/forms';\nimport { TranslocoService } from '@jsverse/transloco';\nimport { ModalService, ModalConfig } from './modal.service';\nimport { NotificationService } from 'shirkasoft-ui-components/notification';\nimport { getIcon as getIconFromCentral } from 'shirkasoft-ui-components/utils';\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 * Modal dialog that renders a dynamically loaded component, tracks its\n * form validity and submit outputs, and delegates accept/cancel to the\n * shared ModalService.\n */\n@Component({\n selector: 'shk-modal',\n standalone: true,\n imports: [CommonModule, LucideDynamicIcon],\n templateUrl: './modal.component.html',\n styles: [\n `\n /* Own enter animation (the animate-in/zoom-in utilities used before\n need a Tailwind plugin that isn't part of the library). */\n .shk-dialog-backdrop {\n animation: shk-dialog-fade 0.15s ease-out;\n }\n .shk-dialog-panel {\n border: 1px solid var(--shk-surface-200);\n box-shadow:\n 0 24px 48px -12px rgba(0, 0, 0, 0.25),\n 0 8px 16px -8px rgba(0, 0, 0, 0.1);\n animation: shk-dialog-in 0.2s cubic-bezier(0.21, 1.02, 0.73, 1);\n }\n :host-context(.dark) .shk-dialog-panel {\n box-shadow:\n 0 24px 48px -12px rgba(0, 0, 0, 0.7),\n 0 8px 16px -8px rgba(0, 0, 0, 0.5);\n }\n @keyframes shk-dialog-fade {\n from {\n opacity: 0;\n }\n }\n @keyframes shk-dialog-in {\n from {\n opacity: 0;\n transform: translateY(8px) scale(0.97);\n }\n }\n .shk-modal-header {\n padding-top: 1.25rem;\n }\n `,\n ],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class ModalComponent {\n protected getIcon = (name: any) => getIconFromCentral(name, LucideX);\n\n private notificationSrv = inject(NotificationService);\n private destroyRef = inject(DestroyRef);\n private modalSrv = inject(ModalService);\n private transloco = inject(TranslocoService);\n private cdr = inject(ChangeDetectorRef);\n\n /** Reference where the dynamic content is rendered. */\n container = viewChild('dynamicContent', { read: ViewContainerRef });\n\n /** Configuration of the modal currently open (from the service). */\n currentConfig = signal<ModalConfig | null>(null);\n /** Modal title. */\n title = signal('');\n /** Whether the modal is visible. */\n visible = signal(false);\n /** Generic loading flag for the footer actions. */\n loading = signal(false);\n /** Whether the accept action is being processed. */\n isProcessing = signal(false);\n /** Whether the modal is currently expanded to fullscreen. */\n isExpanded = signal(false);\n /** True when the dynamic component reports a valid form. */\n isFormValid = signal(false);\n\n /** Reference to the dynamically created component. */\n componentRef: ComponentRef<any> | null = null;\n /** Subscriptions to the dynamic component outputs. */\n private subscriptions: Subscription[] = [];\n\n /** Width of the modal (fullscreen when expanded). */\n computedModalWidth = computed(() => {\n return this.isExpanded() ? '100vw' : (this.currentConfig()?.width ?? '560px');\n });\n\n /** Whether the footer buttons should be rendered. */\n modalButtonsVisible = computed(() => this.currentConfig()?.showButtons ?? true);\n /** Whether the expand/fullscreen button is shown. */\n showExpandButton = computed(() => this.currentConfig()?.showExpandButton ?? false);\n /** Resolved cancel button label. */\n cancelLabel = computed(() => this.currentConfig()?.cancelLabel || 'Cancelar');\n /** Resolved accept button label. */\n acceptLabel = computed(() => this.currentConfig()?.acceptLabel || 'Aceptar');\n\n constructor() {\n effect(() => {\n const config = this.modalSrv.currentModal();\n if (config) {\n this.currentConfig.set(config);\n this.title.set(config.title);\n this.isExpanded.set(false);\n this.visible.set(true);\n this.isProcessing.set(false);\n this.loading.set(false);\n this.cdr.markForCheck();\n setTimeout(() => {\n untracked(() => this.loadComponent(config));\n });\n } else {\n this.visible.set(false);\n this.currentConfig.set(null);\n this.cdr.markForCheck();\n }\n });\n\n this.destroyRef.onDestroy(() => this.cleanup());\n }\n\n /** Updates visibility when the backdrop/close controls change. */\n onVisibleChange(show: boolean) {\n this.visible.set(show);\n if (!show) {\n this.closeModal();\n }\n this.cdr.markForCheck();\n }\n\n /** Creates the dynamic component and wires its form/submit outputs. */\n private loadComponent(config: ModalConfig) {\n const containerRef = this.container();\n if (!containerRef) return;\n\n this.cleanup();\n containerRef.clear();\n\n this.componentRef = containerRef.createComponent(config.component);\n\n if (config.data) {\n Object.entries(config.data).forEach(([key, value]) => {\n this.componentRef?.setInput(key, value);\n });\n }\n\n const instance = this.componentRef.instance;\n\n this.subscribeToOutput(instance.formValid, (valid: boolean) => {\n this.isFormValid.set(valid);\n this.cdr.markForCheck();\n });\n this.subscribeToOutput(instance.submitSuccess, () =>\n this.handleSubmit(true),\n );\n this.subscribeToOutput(instance.submitError, () =>\n this.handleSubmit(false),\n );\n\n this.componentRef.changeDetectorRef.markForCheck();\n this.cdr.markForCheck();\n }\n\n /** Subscribes to a dynamic component output if it exists. */\n private subscribeToOutput(output: any, callback: (value: any) => void) {\n if (output?.subscribe) {\n this.subscriptions.push(output.subscribe(callback));\n }\n }\n\n /** Finalizes the submit flow, accepting the modal on success. */\n private handleSubmit(success: boolean) {\n this.isProcessing.set(false);\n this.loading.set(false);\n this.cdr.markForCheck();\n if (success) {\n untracked(() => this.modalSrv.accept());\n }\n }\n\n /** Closes the modal, calling the dynamic component's `handleCancel` if any. */\n closeModal() {\n if (this.componentRef?.instance?.handleCancel) {\n this.componentRef.instance.handleCancel();\n }\n this.doClose();\n }\n\n /** Performs the actual close sequence and cleanup. */\n doClose() {\n this.visible.set(false);\n this.isProcessing.set(false);\n this.loading.set(false);\n if (this.isExpanded()) {\n this.isExpanded.set(false);\n }\n this.cdr.markForCheck();\n setTimeout(() => {\n this.cleanup();\n this.modalSrv.close();\n }, 100);\n }\n\n /** Toggles between normal width and fullscreen. */\n toggleExpand() {\n this.isExpanded.update((v) => !v);\n this.cdr.markForCheck();\n }\n\n /** Validates the dynamic component form and triggers its `onSubmit`. */\n onAccept() {\n if (!this.componentRef || !this.isDynamicComponent(this.componentRef.instance)) return;\n\n if (this.isProcessing()) return;\n\n const instance = this.componentRef.instance;\n const form = this.getForm(instance);\n\n if (form) {\n this.markAllAsTouched(form);\n this.componentRef.changeDetectorRef.markForCheck();\n this.cdr.markForCheck();\n\n if (this.hasRealErrors(form)) {\n this.notificationSrv.addNotification(\n this.transloco.translate('modal.formInvalid'),\n 'warning',\n );\n return;\n }\n }\n\n this.isProcessing.set(true);\n this.loading.set(true);\n this.cdr.markForCheck();\n instance.onSubmit();\n }\n\n /** Resolves the dynamic component's form (property or getter function). */\n private getForm(instance: any): FormGroup | null {\n if (!instance['form']) return null;\n return typeof instance['form'] === 'function'\n ? instance['form']()\n : instance['form'];\n }\n\n /** Recursively checks for real validation errors (ignoring 'warning'). */\n private hasRealErrors(control: FormGroup | FormControl): boolean {\n if (control instanceof FormControl) {\n const errors = control.errors;\n return errors\n ? Object.keys(errors).some((key) => key !== 'warning')\n : false;\n }\n\n const groupErrors = control.errors;\n if (\n groupErrors &&\n Object.keys(groupErrors).some((key) => key !== 'warning')\n ) {\n return true;\n }\n\n return Object.values(control.controls).some((child) =>\n this.hasRealErrors(child as any),\n );\n }\n\n /** Marks a form (and all its descendants) as touched. */\n private markAllAsTouched(control: FormGroup | FormControl): void {\n control.markAsTouched();\n control.updateValueAndValidity({ onlySelf: true, emitEvent: true });\n\n if (control instanceof FormGroup) {\n Object.values(control.controls).forEach((child) =>\n this.markAllAsTouched(child as any),\n );\n }\n }\n\n /**\n * True when the component exposes `onSubmit`. The `form` is optional:\n * without it, validation is skipped and `onSubmit` runs directly.\n */\n private isDynamicComponent(instance: any): boolean {\n return typeof instance?.onSubmit === 'function';\n }\n\n /** Unsubscribes outputs and destroys the dynamic component. */\n private cleanup() {\n this.subscriptions.forEach((sub) => sub.unsubscribe());\n this.subscriptions = [];\n\n if (this.componentRef) {\n this.componentRef.destroy();\n this.componentRef = null;\n }\n }\n}\n","@if (visible()) {\n <div\n class=\"shk-dialog-backdrop fixed inset-0 bg-black/40 backdrop-blur-sm flex items-center justify-center z-40 p-4 pt-4 overflow-y-auto _shk-scrollbar\"\n (click)=\"closeModal()\"\n >\n <div\n class=\"shk-dialog-panel bg-white dark:[background-color:var(--shk-surface-100)] rounded-xl shadow-2xl overflow-hidden flex flex-col\"\n [class.w-[95vw]]=\"isExpanded()\"\n [class.h-[90vh]]=\"isExpanded()\"\n [class.w-full]=\"!isExpanded()\"\n [style.max-width]=\"isExpanded() ? undefined : computedModalWidth()\"\n (click)=\"$event.stopPropagation()\"\n >\n <div class=\"shk-modal-header flex items-center justify-between px-6 pt-4 pb-2 shrink-0\">\n <span class=\"font-semibold text-lg _shk-text-surface-800 dark:[color:var(--shk-surface-800)]\">{{ title() }}</span>\n <div class=\"flex items-center gap-2\">\n @if (showExpandButton()) {\n <button\n type=\"button\"\n (click)=\"toggleExpand()\"\n class=\"p-1.5 rounded-lg hover:[background-color:var(--shk-surface-100)] dark:hover:[background-color:var(--shk-surface-200)] _shk-text-surface-500 dark:[color:var(--shk-surface-500)] transition-colors\"\n >\n @if (isExpanded()) {\n <svg [lucideIcon]=\"getIcon('minimize-2')\" class=\"w-4 h-4\"></svg>\n } @else {\n <svg [lucideIcon]=\"getIcon('maximize-2')\" class=\"w-4 h-4\"></svg>\n }\n </button>\n }\n <button\n type=\"button\"\n (click)=\"closeModal()\"\n class=\"p-1.5 rounded-lg hover:[background-color:var(--shk-surface-100)] dark:hover:[background-color:var(--shk-surface-200)] _shk-text-surface-500 dark:[color:var(--shk-surface-500)] transition-colors\"\n >\n <svg [lucideIcon]=\"getIcon('x')\" class=\"w-4 h-4\"></svg>\n </button>\n </div>\n </div>\n\n <div class=\"overflow-y-auto px-6 py-4 flex-1 max-h-[70vh] _shk-scrollbar\">\n <ng-container #dynamicContent></ng-container>\n </div>\n\n @if (modalButtonsVisible()) {\n <hr class=\"border-t _shk-border dark:[border-color:var(--shk-surface-200)] shrink-0\" />\n <div class=\"flex justify-end gap-3 px-6 py-4 shrink-0\">\n <button\n type=\"button\"\n (click)=\"closeModal()\"\n [disabled]=\"loading()\"\n class=\"px-4 py-2 text-sm font-semibold _shk-text-surface-600 dark:[color:var(--shk-surface-600)] _shk-bg-surface-100 dark:[background-color:var(--shk-surface-200)] hover:[background-color:var(--shk-surface-200)] dark:hover:[background-color:var(--shk-surface-300)] rounded-lg transition-colors flex items-center gap-2 disabled:opacity-50\"\n >\n <svg [lucideIcon]=\"getIcon('x')\" class=\"w-4 h-4\"></svg>\n {{ cancelLabel() }}\n </button>\n <button\n type=\"button\"\n (click)=\"onAccept()\"\n [disabled]=\"loading()\"\n class=\"px-4 py-2 text-sm font-semibold _shk-text-white _shk-bg-emerald hover:[background-color:var(--shk-emerald-700)] rounded-lg shadow-md transition-all flex items-center gap-2 disabled:opacity-50\"\n >\n @if (loading()) {\n <svg [lucideIcon]=\"getIcon('loader-circle')\" class=\"w-4 h-4 animate-spin\"></svg>\n } @else {\n <svg [lucideIcon]=\"getIcon('check')\" class=\"w-4 h-4\"></svg>\n }\n {{ acceptLabel() }}\n </button>\n </div>\n }\n </div>\n </div>\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["getIconFromCentral"],"mappings":";;;;;;;;;;AA+BA;;;AAG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,SAAA,CAAA,EAAA,cAAA,EAAA,MAAA,EAAA,EAAA,cAAA,EAAA,EAAA,SAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,SAAA,EAAA,IAAA,EAAA,CAAA,gBAAgB,EAAA,EAAA,GAAE,EAAE,IAAI,EAAE,gBAAgB,EAAE,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;AEzFpE;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"shirkasoft-ui-components-modal.mjs","sources":["../../../projects/ui-components/modal/modal.service.ts","../../../projects/ui-components/modal/modal.component.ts","../../../projects/ui-components/modal/modal.component.html","../../../projects/ui-components/modal/shirkasoft-ui-components-modal.ts"],"sourcesContent":["import { Injectable, Type, signal, computed, inject, DestroyRef } from '@angular/core';\nimport { Router } from '@angular/router';\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/** Options for opening a modal through the service. */\nexport interface ModalConfig {\n /** Title shown in the modal header. */\n title: string;\n /** Component rendered inside the modal body. */\n component: Type<any>;\n /** Data passed to the modal component via inputs. */\n data?: Record<string, any>;\n /** Modal width (CSS value). */\n width?: string;\n /** Whether the accept/cancel buttons are shown. */\n showButtons?: boolean;\n /** Whether the expand (fullscreen) button is shown. */\n showExpandButton?: boolean;\n /** Label of the accept button. */\n acceptLabel?: string;\n /** Label of the cancel button. */\n cancelLabel?: string;\n /** Optional callback invoked when the modal closes. */\n onClose?: () => void;\n /**\n * Optional callback invoked when the modal is accepted, with the payload of\n * the dynamic component: the value emitted by its `submitSuccess` output or,\n * when it emits nothing, the raw value of its `form`. Omit it to keep the\n * previous behaviour.\n */\n onAccept?: (payload: any) => void;\n}\n\n/**\n * Global modal manager. Opens modals on a stack, exposing reactive access to\n * the current modal and the top-most opened config.\n */\n@Injectable({ providedIn: 'root' })\nexport class ModalService {\n /** Stack of open modals (top-most renders on top). */\n private stackSignal = signal<ModalConfig[]>([]);\n /** Counter emitted on each close, used to trigger close animations. */\n private closeRequestSignal = signal<number>(0);\n private router = inject(Router);\n private destroyRef = inject(DestroyRef);\n\n constructor() {\n // Close all modals on navigation and on service destruction.\n this.router.events.subscribe(() => {\n this.stackSignal.set([]);\n });\n this.destroyRef.onDestroy(() => this.stackSignal.set([]));\n }\n\n /** Reactive list of open modals. */\n modalStack = computed(() => this.stackSignal());\n /** Top-most modal on the stack, or null. */\n currentModal = computed<ModalConfig | null>(() => {\n const stack = this.stackSignal();\n return stack.length > 0 ? stack[stack.length - 1] : null;\n });\n /** Reactive close-request counter. */\n closeRequest = computed(() => this.closeRequestSignal());\n\n /** Opens a new modal on top of the stack. */\n open(config: ModalConfig) {\n this.stackSignal.update((stack) => [...stack, config]);\n }\n\n /** Alias of `close()` used by the accept button. */\n accept() {\n this.close();\n }\n\n /** Closes the top-most modal, invoking its onClose callback. */\n close() {\n const stack = this.stackSignal();\n if (stack.length > 0) {\n stack[stack.length - 1]?.onClose?.();\n this.stackSignal.set(stack.slice(0, -1));\n this.closeRequestSignal.update((v) => v + 1);\n }\n }\n\n /** Closes all open modals at once. */\n clear() {\n this.stackSignal.set([]);\n }\n}","import {\n Component,\n viewChild,\n ViewContainerRef,\n ComponentRef,\n inject,\n effect,\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n signal,\n DestroyRef,\n computed,\n untracked,\n} from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport {\n LucideDynamicIcon,\n LucideX,\n} from '@lucide/angular';\nimport { Subscription } from 'rxjs';\nimport { FormControl, FormGroup } from '@angular/forms';\nimport { TranslocoService } from '@jsverse/transloco';\nimport { ModalService, ModalConfig } from './modal.service';\nimport { NotificationService } from 'shirkasoft-ui-components/notification';\nimport { getIcon as getIconFromCentral } from 'shirkasoft-ui-components/utils';\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 * Modal dialog that renders a dynamically loaded component, tracks its\n * form validity and submit outputs, and delegates accept/cancel to the\n * shared ModalService.\n */\n@Component({\n selector: 'shk-modal',\n standalone: true,\n imports: [CommonModule, LucideDynamicIcon],\n templateUrl: './modal.component.html',\n styles: [\n `\n /* Own enter animation (the animate-in/zoom-in utilities used before\n need a Tailwind plugin that isn't part of the library). */\n .shk-dialog-backdrop {\n animation: shk-dialog-fade 0.15s ease-out;\n }\n .shk-dialog-panel {\n border: 1px solid var(--shk-surface-200);\n box-shadow:\n 0 24px 48px -12px rgba(0, 0, 0, 0.25),\n 0 8px 16px -8px rgba(0, 0, 0, 0.1);\n animation: shk-dialog-in 0.2s cubic-bezier(0.21, 1.02, 0.73, 1);\n }\n :host-context(.dark) .shk-dialog-panel {\n box-shadow:\n 0 24px 48px -12px rgba(0, 0, 0, 0.7),\n 0 8px 16px -8px rgba(0, 0, 0, 0.5);\n }\n @keyframes shk-dialog-fade {\n from {\n opacity: 0;\n }\n }\n @keyframes shk-dialog-in {\n from {\n opacity: 0;\n transform: translateY(8px) scale(0.97);\n }\n }\n .shk-modal-header {\n padding-top: 1.25rem;\n }\n `,\n ],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class ModalComponent {\n protected getIcon = (name: any) => getIconFromCentral(name, LucideX);\n\n private notificationSrv = inject(NotificationService);\n private destroyRef = inject(DestroyRef);\n private modalSrv = inject(ModalService);\n private transloco = inject(TranslocoService);\n private cdr = inject(ChangeDetectorRef);\n\n /** Reference where the dynamic content is rendered. */\n container = viewChild('dynamicContent', { read: ViewContainerRef });\n\n /** Configuration of the modal currently open (from the service). */\n currentConfig = signal<ModalConfig | null>(null);\n /** Modal title. */\n title = signal('');\n /** Whether the modal is visible. */\n visible = signal(false);\n /** Generic loading flag for the footer actions. */\n loading = signal(false);\n /** Whether the accept action is being processed. */\n isProcessing = signal(false);\n /** Whether the modal is currently expanded to fullscreen. */\n isExpanded = signal(false);\n /** True when the dynamic component reports a valid form. */\n isFormValid = signal(false);\n\n /** Reference to the dynamically created component. */\n componentRef: ComponentRef<any> | null = null;\n /** Subscriptions to the dynamic component outputs. */\n private subscriptions: Subscription[] = [];\n\n /** Width of the modal (fullscreen when expanded). */\n computedModalWidth = computed(() => {\n return this.isExpanded() ? '100vw' : (this.currentConfig()?.width ?? '560px');\n });\n\n /** Whether the footer buttons should be rendered. */\n modalButtonsVisible = computed(() => this.currentConfig()?.showButtons ?? true);\n /** Whether the expand/fullscreen button is shown. */\n showExpandButton = computed(() => this.currentConfig()?.showExpandButton ?? false);\n /** Resolved cancel button label. */\n cancelLabel = computed(() => this.currentConfig()?.cancelLabel || 'Cancelar');\n /** Resolved accept button label. */\n acceptLabel = computed(() => this.currentConfig()?.acceptLabel || 'Aceptar');\n\n constructor() {\n effect(() => {\n const config = this.modalSrv.currentModal();\n if (config) {\n this.currentConfig.set(config);\n this.title.set(config.title);\n this.isExpanded.set(false);\n this.visible.set(true);\n this.isProcessing.set(false);\n this.loading.set(false);\n this.cdr.markForCheck();\n setTimeout(() => {\n untracked(() => this.loadComponent(config));\n });\n } else {\n this.visible.set(false);\n this.currentConfig.set(null);\n this.cdr.markForCheck();\n }\n });\n\n this.destroyRef.onDestroy(() => this.cleanup());\n }\n\n /** Updates visibility when the backdrop/close controls change. */\n onVisibleChange(show: boolean) {\n this.visible.set(show);\n if (!show) {\n this.closeModal();\n }\n this.cdr.markForCheck();\n }\n\n /** Creates the dynamic component and wires its form/submit outputs. */\n private loadComponent(config: ModalConfig) {\n const containerRef = this.container();\n if (!containerRef) return;\n\n this.cleanup();\n containerRef.clear();\n\n this.componentRef = containerRef.createComponent(config.component);\n\n if (config.data) {\n Object.entries(config.data).forEach(([key, value]) => {\n this.componentRef?.setInput(key, value);\n });\n }\n\n const instance = this.componentRef.instance;\n\n this.subscribeToOutput(instance.formValid, (valid: boolean) => {\n this.isFormValid.set(valid);\n this.cdr.markForCheck();\n });\n this.subscribeToOutput(instance.submitSuccess, (payload: any) =>\n this.handleSubmit(true, payload),\n );\n this.subscribeToOutput(instance.submitError, () =>\n this.handleSubmit(false),\n );\n\n this.componentRef.changeDetectorRef.markForCheck();\n this.cdr.markForCheck();\n }\n\n /** Subscribes to a dynamic component output if it exists. */\n private subscribeToOutput(output: any, callback: (value: any) => void) {\n if (output?.subscribe) {\n this.subscriptions.push(output.subscribe(callback));\n }\n }\n\n /** Finalizes the submit flow, accepting the modal on success. */\n private handleSubmit(success: boolean, payload?: any) {\n this.isProcessing.set(false);\n this.loading.set(false);\n this.cdr.markForCheck();\n if (success) {\n // Hand the payload to `onAccept` (only when the modal config defines it).\n const onAccept = this.currentConfig()?.onAccept;\n if (onAccept) {\n untracked(() => onAccept(payload !== undefined ? payload : this.getFormValue()));\n }\n untracked(() => this.modalSrv.accept());\n }\n }\n\n /** Raw value of the dynamic component's form, or undefined when it has none. */\n private getFormValue(): any {\n const instance = this.componentRef?.instance;\n const form = instance ? this.getForm(instance) : null;\n return form ? form.getRawValue() : undefined;\n }\n\n /** Closes the modal, calling the dynamic component's `handleCancel` if any. */\n closeModal() {\n if (this.componentRef?.instance?.handleCancel) {\n this.componentRef.instance.handleCancel();\n }\n this.doClose();\n }\n\n /** Performs the actual close sequence and cleanup. */\n doClose() {\n this.visible.set(false);\n this.isProcessing.set(false);\n this.loading.set(false);\n if (this.isExpanded()) {\n this.isExpanded.set(false);\n }\n this.cdr.markForCheck();\n setTimeout(() => {\n this.cleanup();\n this.modalSrv.close();\n }, 100);\n }\n\n /** Toggles between normal width and fullscreen. */\n toggleExpand() {\n this.isExpanded.update((v) => !v);\n this.cdr.markForCheck();\n }\n\n /** Validates the dynamic component form and triggers its `onSubmit`. */\n onAccept() {\n if (!this.componentRef || !this.isDynamicComponent(this.componentRef.instance)) return;\n\n if (this.isProcessing()) return;\n\n const instance = this.componentRef.instance;\n const form = this.getForm(instance);\n\n if (form) {\n this.markAllAsTouched(form);\n this.componentRef.changeDetectorRef.markForCheck();\n this.cdr.markForCheck();\n\n if (this.hasRealErrors(form)) {\n this.notificationSrv.addNotification(\n this.transloco.translate('modal.formInvalid'),\n 'warning',\n );\n return;\n }\n }\n\n this.isProcessing.set(true);\n this.loading.set(true);\n this.cdr.markForCheck();\n instance.onSubmit();\n }\n\n /** Resolves the dynamic component's form (property or getter function). */\n private getForm(instance: any): FormGroup | null {\n if (!instance['form']) return null;\n return typeof instance['form'] === 'function'\n ? instance['form']()\n : instance['form'];\n }\n\n /** Recursively checks for real validation errors (ignoring 'warning'). */\n private hasRealErrors(control: FormGroup | FormControl): boolean {\n if (control instanceof FormControl) {\n const errors = control.errors;\n return errors\n ? Object.keys(errors).some((key) => key !== 'warning')\n : false;\n }\n\n const groupErrors = control.errors;\n if (\n groupErrors &&\n Object.keys(groupErrors).some((key) => key !== 'warning')\n ) {\n return true;\n }\n\n return Object.values(control.controls).some((child) =>\n this.hasRealErrors(child as any),\n );\n }\n\n /** Marks a form (and all its descendants) as touched. */\n private markAllAsTouched(control: FormGroup | FormControl): void {\n control.markAsTouched();\n control.updateValueAndValidity({ onlySelf: true, emitEvent: true });\n\n if (control instanceof FormGroup) {\n Object.values(control.controls).forEach((child) =>\n this.markAllAsTouched(child as any),\n );\n }\n }\n\n /**\n * True when the component exposes `onSubmit`. The `form` is optional:\n * without it, validation is skipped and `onSubmit` runs directly.\n */\n private isDynamicComponent(instance: any): boolean {\n return typeof instance?.onSubmit === 'function';\n }\n\n /** Unsubscribes outputs and destroys the dynamic component. */\n private cleanup() {\n this.subscriptions.forEach((sub) => sub.unsubscribe());\n this.subscriptions = [];\n\n if (this.componentRef) {\n this.componentRef.destroy();\n this.componentRef = null;\n }\n }\n}\n","@if (visible()) {\n <div\n class=\"shk-dialog-backdrop fixed inset-0 bg-black/40 backdrop-blur-sm flex items-center justify-center z-40 p-4 pt-4 overflow-y-auto _shk-scrollbar\"\n (click)=\"closeModal()\"\n >\n <div\n class=\"shk-dialog-panel bg-white dark:[background-color:var(--shk-surface-100)] rounded-xl shadow-2xl overflow-hidden flex flex-col\"\n [class.w-[95vw]]=\"isExpanded()\"\n [class.h-[90vh]]=\"isExpanded()\"\n [class.w-full]=\"!isExpanded()\"\n [style.max-width]=\"isExpanded() ? undefined : computedModalWidth()\"\n (click)=\"$event.stopPropagation()\"\n >\n <div class=\"shk-modal-header flex items-center justify-between px-6 pt-4 pb-2 shrink-0\">\n <span class=\"font-semibold text-lg _shk-text-surface-800 dark:[color:var(--shk-surface-800)]\">{{ title() }}</span>\n <div class=\"flex items-center gap-2\">\n @if (showExpandButton()) {\n <button\n type=\"button\"\n (click)=\"toggleExpand()\"\n class=\"p-1.5 rounded-lg hover:[background-color:var(--shk-surface-100)] dark:hover:[background-color:var(--shk-surface-200)] _shk-text-surface-500 dark:[color:var(--shk-surface-500)] transition-colors\"\n >\n @if (isExpanded()) {\n <svg [lucideIcon]=\"getIcon('minimize-2')\" class=\"w-4 h-4\"></svg>\n } @else {\n <svg [lucideIcon]=\"getIcon('maximize-2')\" class=\"w-4 h-4\"></svg>\n }\n </button>\n }\n <button\n type=\"button\"\n (click)=\"closeModal()\"\n class=\"p-1.5 rounded-lg hover:[background-color:var(--shk-surface-100)] dark:hover:[background-color:var(--shk-surface-200)] _shk-text-surface-500 dark:[color:var(--shk-surface-500)] transition-colors\"\n >\n <svg [lucideIcon]=\"getIcon('x')\" class=\"w-4 h-4\"></svg>\n </button>\n </div>\n </div>\n\n <div class=\"overflow-y-auto px-6 py-4 flex-1 max-h-[70vh] _shk-scrollbar\">\n <ng-container #dynamicContent></ng-container>\n </div>\n\n @if (modalButtonsVisible()) {\n <hr class=\"border-t _shk-border dark:[border-color:var(--shk-surface-200)] shrink-0\" />\n <div class=\"flex justify-end gap-3 px-6 py-4 shrink-0\">\n <button\n type=\"button\"\n (click)=\"closeModal()\"\n [disabled]=\"loading()\"\n class=\"px-4 py-2 text-sm font-semibold _shk-text-surface-600 dark:[color:var(--shk-surface-600)] _shk-bg-surface-100 dark:[background-color:var(--shk-surface-200)] hover:[background-color:var(--shk-surface-200)] dark:hover:[background-color:var(--shk-surface-300)] rounded-lg transition-colors flex items-center gap-2 disabled:opacity-50\"\n >\n <svg [lucideIcon]=\"getIcon('x')\" class=\"w-4 h-4\"></svg>\n {{ cancelLabel() }}\n </button>\n <button\n type=\"button\"\n (click)=\"onAccept()\"\n [disabled]=\"loading()\"\n class=\"px-4 py-2 text-sm font-semibold _shk-text-white _shk-bg-emerald hover:[background-color:var(--shk-emerald-700)] rounded-lg shadow-md transition-all flex items-center gap-2 disabled:opacity-50\"\n >\n @if (loading()) {\n <svg [lucideIcon]=\"getIcon('loader-circle')\" class=\"w-4 h-4 animate-spin\"></svg>\n } @else {\n <svg [lucideIcon]=\"getIcon('check')\" class=\"w-4 h-4\"></svg>\n }\n {{ acceptLabel() }}\n </button>\n </div>\n }\n </div>\n </div>\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["getIconFromCentral"],"mappings":";;;;;;;;;;AAsCA;;;AAGG;MAEU,YAAY,CAAA;AAQvB,IAAA,WAAA,GAAA;;AANQ,QAAA,IAAA,CAAA,WAAW,GAAG,MAAM,CAAgB,EAAE,kFAAC;;AAEvC,QAAA,IAAA,CAAA,kBAAkB,GAAG,MAAM,CAAS,CAAC,yFAAC;AACtC,QAAA,IAAA,CAAA,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;AACvB,QAAA,IAAA,CAAA,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC;;QAWvC,IAAA,CAAA,UAAU,GAAG,QAAQ,CAAC,MAAM,IAAI,CAAC,WAAW,EAAE,EAAA,IAAA,SAAA,GAAA,CAAA,EAAA,SAAA,EAAA,YAAA,EAAA,CAAA,8BAAA,EAAA,CAAA,CAAC;;AAE/C,QAAA,IAAA,CAAA,YAAY,GAAG,QAAQ,CAAqB,MAAK;AAC/C,YAAA,MAAM,KAAK,GAAG,IAAI,CAAC,WAAW,EAAE;YAChC,OAAO,KAAK,CAAC,MAAM,GAAG,CAAC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