ngx-core-components 0.3.4 → 0.3.6
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/feedback/avatar/avatar.component.d.ts +37 -0
- package/feedback/countdown/countdown.component.d.ts +46 -0
- package/feedback/empty-state/empty-state.component.d.ts +14 -0
- package/feedback/public-api.d.ts +7 -0
- package/feedback/stat-card/stat-card.component.d.ts +18 -0
- package/fesm2022/ngx-core-components-feedback.mjs +789 -5
- package/fesm2022/ngx-core-components-feedback.mjs.map +1 -1
- package/fesm2022/ngx-core-components-inputs.mjs +611 -3
- package/fesm2022/ngx-core-components-inputs.mjs.map +1 -1
- package/fesm2022/ngx-core-components-layout.mjs +930 -2
- package/fesm2022/ngx-core-components-layout.mjs.map +1 -1
- package/fesm2022/ngx-core-components-navigation.mjs +162 -2
- package/fesm2022/ngx-core-components-navigation.mjs.map +1 -1
- package/fesm2022/ngx-core-components-views.mjs +1120 -2
- package/fesm2022/ngx-core-components-views.mjs.map +1 -1
- package/fesm2022/ngx-core-components.mjs +5 -5
- package/fesm2022/ngx-core-components.mjs.map +1 -1
- package/inputs/file-preview/file-preview.component.d.ts +61 -0
- package/inputs/public-api.d.ts +5 -0
- package/inputs/segmented-control/segmented-control.component.d.ts +20 -0
- package/inputs/tag-input/tag-input.component.d.ts +25 -0
- package/layout/carousel/carousel.component.d.ts +39 -0
- package/layout/dashboard-layout/dashboard-layout.component.d.ts +43 -0
- package/layout/dashboard-layout/models.d.ts +26 -0
- package/layout/drawer/drawer.component.d.ts +21 -0
- package/layout/public-api.d.ts +4 -0
- package/navigation/back-to-top/back-to-top.component.d.ts +15 -0
- package/navigation/public-api.d.ts +1 -0
- package/package.json +1 -1
- package/public-api.d.ts +14 -6
- package/views/image-compare/image-compare.component.d.ts +26 -0
- package/views/key-value-list/key-value-list.component.d.ts +36 -0
- package/views/public-api.d.ts +7 -0
- package/views/scheduler/models.d.ts +18 -0
- package/views/scheduler/scheduler.component.d.ts +36 -0
- package/views/virtual-list/virtual-list.component.d.ts +42 -0
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { input, output, signal, computed, forwardRef, ChangeDetectionStrategy, Component, inject, ElementRef, HostListener, effect } from '@angular/core';
|
|
3
|
-
import
|
|
2
|
+
import { input, output, signal, computed, forwardRef, ChangeDetectionStrategy, Component, inject, ElementRef, HostListener, effect, model } from '@angular/core';
|
|
3
|
+
import * as i1 from '@angular/forms';
|
|
4
|
+
import { NG_VALUE_ACCESSOR, FormsModule } from '@angular/forms';
|
|
4
5
|
import { CommonModule } from '@angular/common';
|
|
5
6
|
|
|
6
7
|
class TextBoxComponent {
|
|
@@ -2663,6 +2664,613 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImpo
|
|
|
2663
2664
|
`, styles: [":host{display:block;width:100%}.file-upload-wrapper{background:var(--bg-secondary, #ffffff);border:1px solid var(--border-color, #e2e8f0);border-radius:var(--radius-md, 10px);padding:16px;box-shadow:var(--shadow-sm);display:flex;flex-direction:column;gap:16px;transition:all .25s}.file-upload-wrapper.drag-over{border-color:var(--primary-color, #4f46e5);background:#4f46e503}.file-upload-wrapper.disabled{opacity:.65;pointer-events:none}.dropzone-area{border:2px dashed var(--border-color, #cbd5e1);border-radius:var(--radius-md, 10px);padding:32px 20px;text-align:center;cursor:pointer;background:#00000001;transition:all .2s ease-in-out;position:relative}.dropzone-area:hover{border-color:var(--primary-color, #4f46e5);background:#4f46e505}.drag-over .dropzone-area{border-color:var(--primary-color, #4f46e5);background:#4f46e50d}.hidden-file-input{display:none}.dropzone-content{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px;-webkit-user-select:none;user-select:none}.upload-icon-circle{width:44px;height:44px;border-radius:50%;background:var(--border-light, #f1f5f9);display:flex;align-items:center;justify-content:center;color:var(--text-secondary, #475569);transition:all .2s}.dropzone-area:hover .upload-icon-circle{background:var(--primary-color, #4f46e5);color:#fff;transform:scale(1.05)}.upload-arrow-svg{width:20px;height:20px}.upload-headline{font-family:var(--ngx-font-family, sans-serif);font-size:14px;font-weight:550;color:var(--text-primary, #0f172a)}.upload-headline .highlight{color:var(--primary-color, #4f46e5);font-weight:700}.upload-subtext{font-family:var(--ngx-font-family, sans-serif);font-size:11px;color:var(--text-secondary, #64748b)}.file-queue-list{display:flex;flex-direction:column;gap:12px;border-top:1px solid var(--border-color, #e2e8f0);padding-top:16px}.queue-header{display:flex;justify-content:space-between;align-items:center;font-family:var(--ngx-font-family, sans-serif)}.queue-header h4{margin:0;font-size:13px;font-weight:750;color:var(--text-primary, #0f172a);text-transform:uppercase;letter-spacing:.5px}.clear-all-btn{background:transparent;border:none;color:#ef4444;font-size:11px;font-weight:700;cursor:pointer;padding:2px 6px;border-radius:4px;transition:background .2s}.clear-all-btn:hover{background:#ef44440d}.queue-items{display:flex;flex-direction:column;gap:8px;max-height:280px;overflow-y:auto;padding-right:4px}.queue-item-card{display:flex;align-items:center;gap:12px;padding:10px 14px;border:1px solid var(--border-color, #e2e8f0);border-radius:8px;background:var(--bg-secondary, #ffffff);transition:all .2s}.queue-item-card:hover{border-color:var(--text-secondary, #94a3b8);box-shadow:var(--shadow-sm)}.queue-item-card.success{border-color:#10b9814d;background:#10b98101}.queue-item-card.error{border-color:#ef44444d;background:#ef444401}.item-icon{color:var(--text-secondary, #64748b);display:flex;align-items:center;justify-content:center}.file-icon-svg{width:20px;height:20px}.item-details{flex:1;display:flex;flex-direction:column;gap:4px;overflow:hidden;font-family:var(--ngx-font-family, sans-serif)}.item-meta{display:flex;justify-content:space-between;gap:8px}.item-name{font-size:13px;font-weight:600;color:var(--text-primary, #0f172a);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.item-size{font-size:11px;color:var(--text-secondary, #64748b);white-space:nowrap}.item-progress-wrap{display:flex;align-items:center;gap:8px}.progress-track{flex:1;height:4px;background:var(--border-light, #f1f5f9);border-radius:2px;overflow:hidden}.progress-bar-fill{height:100%;background:var(--primary-color, #4f46e5);border-radius:2px;transition:width .15s}.progress-text{font-size:10px;font-weight:700;color:var(--text-secondary, #475569);min-width:28px;text-align:right}.item-error-msg{font-size:11px;color:#ef4444;font-weight:600}.item-status-badge{font-size:10px;font-weight:700;border-radius:4px;padding:1px 6px;width:fit-content}.item-status-badge.success{background:#10b9811a;color:#10b981}.item-actions{display:flex;gap:6px}.action-btn{background:transparent;border:none;font-size:12px;cursor:pointer;width:24px;height:24px;border-radius:50%;display:flex;align-items:center;justify-content:center;color:var(--text-secondary, #64748b);transition:background .2s,color .2s}.action-btn:hover{background:var(--border-light, #f1f5f9);color:var(--text-primary, #0f172a)}.action-btn.remove-btn:hover{color:#ef4444;background:#ef44440d}.file-upload-wrapper.dark{background:#0f172a;border-color:#1f2937}.file-upload-wrapper.dark .dropzone-area{border-color:#374151}.file-upload-wrapper.dark .dropzone-area:hover{border-color:var(--primary-color, #6366f1);background:#6366f105}.file-upload-wrapper.dark .upload-icon-circle{background:#1e293b;color:#94a3b8}.file-upload-wrapper.dark .dropzone-area:hover .upload-icon-circle{background:var(--primary-color, #6366f1);color:#fff}.file-upload-wrapper.dark .upload-headline{color:#e2e8f0}.file-upload-wrapper.dark .upload-headline .highlight{color:var(--primary-color, #6366f1)}.file-upload-wrapper.dark .upload-subtext{color:#94a3b8}.file-upload-wrapper.dark .file-queue-list{border-top-color:#1f2937}.file-upload-wrapper.dark .queue-header h4{color:#e2e8f0}.file-upload-wrapper.dark .queue-item-card{border-color:#1f2937;background:#111827}.file-upload-wrapper.dark .queue-item-card:hover{border-color:#4b5563}.file-upload-wrapper.dark .queue-item-card.success{border-color:#10b98133}.file-upload-wrapper.dark .queue-item-card.error{border-color:#ef444433}.file-upload-wrapper.dark .item-name{color:#e2e8f0}.file-upload-wrapper.dark .item-size{color:#94a3b8}.file-upload-wrapper.dark .progress-track{background:#1e293b}.file-upload-wrapper.dark .progress-bar-fill{background:var(--primary-color, #6366f1)}.file-upload-wrapper.dark .progress-text{color:#94a3b8}.file-upload-wrapper.dark .action-btn:hover{background:#1e293b;color:#f8fafc}.file-upload-wrapper.dark .action-btn.remove-btn:hover{background:#ef44441a}\n"] }]
|
|
2664
2665
|
}] });
|
|
2665
2666
|
|
|
2667
|
+
class TagInputComponent {
|
|
2668
|
+
// ── Inputs ──
|
|
2669
|
+
tags = input([]);
|
|
2670
|
+
placeholder = input('Add tag...');
|
|
2671
|
+
maxTags = input(20);
|
|
2672
|
+
allowDuplicates = input(false);
|
|
2673
|
+
disabled = input(false);
|
|
2674
|
+
theme = input('light');
|
|
2675
|
+
// ── Outputs ──
|
|
2676
|
+
tagsChange = output();
|
|
2677
|
+
tagAdded = output();
|
|
2678
|
+
tagRemoved = output();
|
|
2679
|
+
// ── Internal state ──
|
|
2680
|
+
internalTags = signal([]);
|
|
2681
|
+
isFocused = signal(false);
|
|
2682
|
+
inputValue = '';
|
|
2683
|
+
isAtMax = computed(() => this.internalTags().length >= this.maxTags());
|
|
2684
|
+
/** Native input element reference (grabbed via ViewChild-less approach via the template variable). */
|
|
2685
|
+
_inputEl = null;
|
|
2686
|
+
focusInput() {
|
|
2687
|
+
if (this.disabled() || this.isAtMax())
|
|
2688
|
+
return;
|
|
2689
|
+
// Query the rendered input inside the host
|
|
2690
|
+
const input = document.querySelector('ngx-tag-input .ngx-tag-input__field');
|
|
2691
|
+
input?.focus();
|
|
2692
|
+
}
|
|
2693
|
+
onKeydown(event) {
|
|
2694
|
+
if (this.disabled())
|
|
2695
|
+
return;
|
|
2696
|
+
if (event.key === 'Enter' || event.key === ',') {
|
|
2697
|
+
event.preventDefault();
|
|
2698
|
+
this.commitTag();
|
|
2699
|
+
}
|
|
2700
|
+
else if (event.key === 'Backspace' && !this.inputValue) {
|
|
2701
|
+
// Remove last tag on backspace when input is empty
|
|
2702
|
+
const tags = this.internalTags();
|
|
2703
|
+
if (tags.length > 0) {
|
|
2704
|
+
this.removeTag(tags[tags.length - 1]);
|
|
2705
|
+
}
|
|
2706
|
+
}
|
|
2707
|
+
}
|
|
2708
|
+
onBlur() {
|
|
2709
|
+
this.isFocused.set(false);
|
|
2710
|
+
// Commit any pending text on blur
|
|
2711
|
+
if (this.inputValue.trim()) {
|
|
2712
|
+
this.commitTag();
|
|
2713
|
+
}
|
|
2714
|
+
}
|
|
2715
|
+
commitTag() {
|
|
2716
|
+
const raw = this.inputValue.replace(/,/g, '').trim();
|
|
2717
|
+
if (!raw)
|
|
2718
|
+
return;
|
|
2719
|
+
if (this.isAtMax())
|
|
2720
|
+
return;
|
|
2721
|
+
if (!this.allowDuplicates() && this.internalTags().includes(raw)) {
|
|
2722
|
+
this.inputValue = '';
|
|
2723
|
+
return;
|
|
2724
|
+
}
|
|
2725
|
+
const newTags = [...this.internalTags(), raw];
|
|
2726
|
+
this.internalTags.set(newTags);
|
|
2727
|
+
this.inputValue = '';
|
|
2728
|
+
this.tagsChange.emit(newTags);
|
|
2729
|
+
this.tagAdded.emit(raw);
|
|
2730
|
+
}
|
|
2731
|
+
removeTag(tag, event) {
|
|
2732
|
+
event?.stopPropagation();
|
|
2733
|
+
const newTags = this.internalTags().filter(t => t !== tag);
|
|
2734
|
+
this.internalTags.set(newTags);
|
|
2735
|
+
this.tagsChange.emit(newTags);
|
|
2736
|
+
this.tagRemoved.emit(tag);
|
|
2737
|
+
}
|
|
2738
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: TagInputComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2739
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.20", type: TagInputComponent, isStandalone: true, selector: "ngx-tag-input", inputs: { tags: { classPropertyName: "tags", publicName: "tags", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, maxTags: { classPropertyName: "maxTags", publicName: "maxTags", isSignal: true, isRequired: false, transformFunction: null }, allowDuplicates: { classPropertyName: "allowDuplicates", publicName: "allowDuplicates", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, theme: { classPropertyName: "theme", publicName: "theme", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { tagsChange: "tagsChange", tagAdded: "tagAdded", tagRemoved: "tagRemoved" }, ngImport: i0, template: `
|
|
2740
|
+
<div
|
|
2741
|
+
class="ngx-tag-input"
|
|
2742
|
+
[class.dark]="theme() === 'dark'"
|
|
2743
|
+
[class.disabled]="disabled()"
|
|
2744
|
+
[class.focused]="isFocused()"
|
|
2745
|
+
(click)="focusInput()"
|
|
2746
|
+
>
|
|
2747
|
+
<!-- Existing chips -->
|
|
2748
|
+
@for (tag of internalTags(); track tag + $index) {
|
|
2749
|
+
<span class="ngx-tag-chip">
|
|
2750
|
+
<span class="ngx-tag-chip__label">{{ tag }}</span>
|
|
2751
|
+
@if (!disabled()) {
|
|
2752
|
+
<button
|
|
2753
|
+
type="button"
|
|
2754
|
+
class="ngx-tag-chip__remove"
|
|
2755
|
+
(click)="removeTag(tag, $event)"
|
|
2756
|
+
[attr.aria-label]="'Remove ' + tag"
|
|
2757
|
+
>✕</button>
|
|
2758
|
+
}
|
|
2759
|
+
</span>
|
|
2760
|
+
}
|
|
2761
|
+
|
|
2762
|
+
<!-- Text input -->
|
|
2763
|
+
@if (!isAtMax()) {
|
|
2764
|
+
<input
|
|
2765
|
+
#tagInput
|
|
2766
|
+
class="ngx-tag-input__field"
|
|
2767
|
+
type="text"
|
|
2768
|
+
[placeholder]="internalTags().length === 0 ? placeholder() : ''"
|
|
2769
|
+
[disabled]="disabled()"
|
|
2770
|
+
[(ngModel)]="inputValue"
|
|
2771
|
+
(keydown)="onKeydown($event)"
|
|
2772
|
+
(focus)="isFocused.set(true)"
|
|
2773
|
+
(blur)="onBlur()"
|
|
2774
|
+
/>
|
|
2775
|
+
}
|
|
2776
|
+
|
|
2777
|
+
<!-- Max tags hint -->
|
|
2778
|
+
@if (isAtMax() && !disabled()) {
|
|
2779
|
+
<span class="ngx-tag-input__max-hint">Max {{ maxTags() }} tags</span>
|
|
2780
|
+
}
|
|
2781
|
+
</div>
|
|
2782
|
+
`, isInline: true, styles: [":host{display:block}.ngx-tag-input{display:flex;flex-wrap:wrap;align-items:center;gap:6px;padding:8px 12px;min-height:44px;border-radius:10px;border:1.5px solid var(--ngx-tag-border, hsl(220, 15%, 82%));background:var(--ngx-tag-bg, #ffffff);font-family:var(--ngx-font-family, system-ui, sans-serif);cursor:text;transition:border-color .18s ease,box-shadow .18s ease}.ngx-tag-input.focused{border-color:var(--ngx-tag-focus-border, hsl(250, 70%, 58%));box-shadow:0 0 0 3px var(--primary-glow, rgba(124, 95, 240, .15));outline:none}.ngx-tag-input.disabled{background:var(--ngx-tag-disabled-bg, hsl(220, 15%, 97%));border-color:var(--ngx-tag-disabled-border, hsl(220, 10%, 88%));cursor:not-allowed;opacity:.72}.ngx-tag-input.dark{background:var(--ngx-tag-dark-bg, hsl(225, 20%, 14%));border-color:var(--ngx-tag-dark-border, hsl(225, 15%, 28%))}.ngx-tag-input.dark.focused{border-color:var(--ngx-tag-focus-border, hsl(250, 65%, 65%));box-shadow:0 0 0 3px #7c5ff038}.ngx-tag-input.dark.disabled{background:#15171e;border-color:#31353f}.ngx-tag-chip{display:inline-flex;align-items:center;gap:4px;padding:3px 8px 3px 10px;background:var(--ngx-tag-chip-bg, hsl(250, 65%, 94%));color:var(--ngx-tag-chip-color, hsl(250, 55%, 38%));border-radius:999px;font-size:12px;font-weight:600;white-space:nowrap;border:1px solid var(--ngx-tag-chip-border, hsl(250, 55%, 85%));transition:background .15s ease,border-color .15s ease;animation:chip-pop .18s cubic-bezier(.34,1.56,.64,1)}.dark .ngx-tag-chip{background:var(--ngx-tag-chip-dark-bg, hsl(250, 45%, 20%));color:var(--ngx-tag-chip-dark-color, hsl(250, 75%, 80%));border-color:#362a6f}@keyframes chip-pop{0%{transform:scale(.7);opacity:0}to{transform:scale(1);opacity:1}}.ngx-tag-chip__label{max-width:160px;overflow:hidden;text-overflow:ellipsis}.ngx-tag-chip__remove{display:inline-flex;align-items:center;justify-content:center;width:16px;height:16px;padding:0;background:transparent;border:none;border-radius:50%;color:inherit;font-size:9px;line-height:1;cursor:pointer;opacity:.5;transition:opacity .12s ease,background .12s ease;flex-shrink:0}.ngx-tag-chip__remove:hover{opacity:1;background:#0000001a}.dark .ngx-tag-chip__remove:hover{background:#ffffff1f}.ngx-tag-input__field{flex:1;min-width:100px;border:none;outline:none;background:transparent;font-size:13px;font-family:inherit;color:var(--ngx-tag-input-color, hsl(220, 20%, 18%));padding:2px 0}.ngx-tag-input__field::placeholder{color:var(--ngx-tag-placeholder-color, hsl(220, 12%, 65%))}.ngx-tag-input__field:disabled{cursor:not-allowed}.dark .ngx-tag-input__field{color:var(--ngx-tag-input-dark-color, hsl(220, 15%, 88%))}.dark .ngx-tag-input__field::placeholder{color:#6c7689}.ngx-tag-input__max-hint{font-size:11px;font-style:italic;color:#89909f;padding:2px 4px;align-self:center}.dark .ngx-tag-input__max-hint{color:#6e7687}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
2783
|
+
}
|
|
2784
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: TagInputComponent, decorators: [{
|
|
2785
|
+
type: Component,
|
|
2786
|
+
args: [{ selector: 'ngx-tag-input', standalone: true, imports: [CommonModule, FormsModule], changeDetection: ChangeDetectionStrategy.OnPush, template: `
|
|
2787
|
+
<div
|
|
2788
|
+
class="ngx-tag-input"
|
|
2789
|
+
[class.dark]="theme() === 'dark'"
|
|
2790
|
+
[class.disabled]="disabled()"
|
|
2791
|
+
[class.focused]="isFocused()"
|
|
2792
|
+
(click)="focusInput()"
|
|
2793
|
+
>
|
|
2794
|
+
<!-- Existing chips -->
|
|
2795
|
+
@for (tag of internalTags(); track tag + $index) {
|
|
2796
|
+
<span class="ngx-tag-chip">
|
|
2797
|
+
<span class="ngx-tag-chip__label">{{ tag }}</span>
|
|
2798
|
+
@if (!disabled()) {
|
|
2799
|
+
<button
|
|
2800
|
+
type="button"
|
|
2801
|
+
class="ngx-tag-chip__remove"
|
|
2802
|
+
(click)="removeTag(tag, $event)"
|
|
2803
|
+
[attr.aria-label]="'Remove ' + tag"
|
|
2804
|
+
>✕</button>
|
|
2805
|
+
}
|
|
2806
|
+
</span>
|
|
2807
|
+
}
|
|
2808
|
+
|
|
2809
|
+
<!-- Text input -->
|
|
2810
|
+
@if (!isAtMax()) {
|
|
2811
|
+
<input
|
|
2812
|
+
#tagInput
|
|
2813
|
+
class="ngx-tag-input__field"
|
|
2814
|
+
type="text"
|
|
2815
|
+
[placeholder]="internalTags().length === 0 ? placeholder() : ''"
|
|
2816
|
+
[disabled]="disabled()"
|
|
2817
|
+
[(ngModel)]="inputValue"
|
|
2818
|
+
(keydown)="onKeydown($event)"
|
|
2819
|
+
(focus)="isFocused.set(true)"
|
|
2820
|
+
(blur)="onBlur()"
|
|
2821
|
+
/>
|
|
2822
|
+
}
|
|
2823
|
+
|
|
2824
|
+
<!-- Max tags hint -->
|
|
2825
|
+
@if (isAtMax() && !disabled()) {
|
|
2826
|
+
<span class="ngx-tag-input__max-hint">Max {{ maxTags() }} tags</span>
|
|
2827
|
+
}
|
|
2828
|
+
</div>
|
|
2829
|
+
`, styles: [":host{display:block}.ngx-tag-input{display:flex;flex-wrap:wrap;align-items:center;gap:6px;padding:8px 12px;min-height:44px;border-radius:10px;border:1.5px solid var(--ngx-tag-border, hsl(220, 15%, 82%));background:var(--ngx-tag-bg, #ffffff);font-family:var(--ngx-font-family, system-ui, sans-serif);cursor:text;transition:border-color .18s ease,box-shadow .18s ease}.ngx-tag-input.focused{border-color:var(--ngx-tag-focus-border, hsl(250, 70%, 58%));box-shadow:0 0 0 3px var(--primary-glow, rgba(124, 95, 240, .15));outline:none}.ngx-tag-input.disabled{background:var(--ngx-tag-disabled-bg, hsl(220, 15%, 97%));border-color:var(--ngx-tag-disabled-border, hsl(220, 10%, 88%));cursor:not-allowed;opacity:.72}.ngx-tag-input.dark{background:var(--ngx-tag-dark-bg, hsl(225, 20%, 14%));border-color:var(--ngx-tag-dark-border, hsl(225, 15%, 28%))}.ngx-tag-input.dark.focused{border-color:var(--ngx-tag-focus-border, hsl(250, 65%, 65%));box-shadow:0 0 0 3px #7c5ff038}.ngx-tag-input.dark.disabled{background:#15171e;border-color:#31353f}.ngx-tag-chip{display:inline-flex;align-items:center;gap:4px;padding:3px 8px 3px 10px;background:var(--ngx-tag-chip-bg, hsl(250, 65%, 94%));color:var(--ngx-tag-chip-color, hsl(250, 55%, 38%));border-radius:999px;font-size:12px;font-weight:600;white-space:nowrap;border:1px solid var(--ngx-tag-chip-border, hsl(250, 55%, 85%));transition:background .15s ease,border-color .15s ease;animation:chip-pop .18s cubic-bezier(.34,1.56,.64,1)}.dark .ngx-tag-chip{background:var(--ngx-tag-chip-dark-bg, hsl(250, 45%, 20%));color:var(--ngx-tag-chip-dark-color, hsl(250, 75%, 80%));border-color:#362a6f}@keyframes chip-pop{0%{transform:scale(.7);opacity:0}to{transform:scale(1);opacity:1}}.ngx-tag-chip__label{max-width:160px;overflow:hidden;text-overflow:ellipsis}.ngx-tag-chip__remove{display:inline-flex;align-items:center;justify-content:center;width:16px;height:16px;padding:0;background:transparent;border:none;border-radius:50%;color:inherit;font-size:9px;line-height:1;cursor:pointer;opacity:.5;transition:opacity .12s ease,background .12s ease;flex-shrink:0}.ngx-tag-chip__remove:hover{opacity:1;background:#0000001a}.dark .ngx-tag-chip__remove:hover{background:#ffffff1f}.ngx-tag-input__field{flex:1;min-width:100px;border:none;outline:none;background:transparent;font-size:13px;font-family:inherit;color:var(--ngx-tag-input-color, hsl(220, 20%, 18%));padding:2px 0}.ngx-tag-input__field::placeholder{color:var(--ngx-tag-placeholder-color, hsl(220, 12%, 65%))}.ngx-tag-input__field:disabled{cursor:not-allowed}.dark .ngx-tag-input__field{color:var(--ngx-tag-input-dark-color, hsl(220, 15%, 88%))}.dark .ngx-tag-input__field::placeholder{color:#6c7689}.ngx-tag-input__max-hint{font-size:11px;font-style:italic;color:#89909f;padding:2px 4px;align-self:center}.dark .ngx-tag-input__max-hint{color:#6e7687}\n"] }]
|
|
2830
|
+
}] });
|
|
2831
|
+
|
|
2832
|
+
class FilePreviewComponent {
|
|
2833
|
+
// Inputs
|
|
2834
|
+
files = input(null);
|
|
2835
|
+
layout = input('grid');
|
|
2836
|
+
allowDelete = input(true);
|
|
2837
|
+
allowDownload = input(true);
|
|
2838
|
+
theme = input('light');
|
|
2839
|
+
// Outputs
|
|
2840
|
+
delete = output();
|
|
2841
|
+
download = output();
|
|
2842
|
+
// Object URL cache to prevent leaks and repeat generations
|
|
2843
|
+
objectUrlCache = new Map();
|
|
2844
|
+
// Map inputs to local standardized objects
|
|
2845
|
+
previewFiles = computed(() => {
|
|
2846
|
+
const rawFiles = this.files() || [];
|
|
2847
|
+
return rawFiles.map((file, idx) => {
|
|
2848
|
+
if (file instanceof File) {
|
|
2849
|
+
return {
|
|
2850
|
+
id: `${file.name}-${idx}-${file.size}`,
|
|
2851
|
+
name: file.name,
|
|
2852
|
+
size: file.size,
|
|
2853
|
+
type: file.type,
|
|
2854
|
+
progress: 100,
|
|
2855
|
+
status: 'success',
|
|
2856
|
+
formattedSize: this.formatBytes(file.size),
|
|
2857
|
+
fileObject: file,
|
|
2858
|
+
thumbnailUrl: file.type.startsWith('image/') ? this.getObjectUrl(file) : undefined,
|
|
2859
|
+
};
|
|
2860
|
+
}
|
|
2861
|
+
else {
|
|
2862
|
+
// UploadFileItem
|
|
2863
|
+
let thumbUrl = undefined;
|
|
2864
|
+
if (file.fileObject && file.type.startsWith('image/')) {
|
|
2865
|
+
thumbUrl = this.getObjectUrl(file.fileObject);
|
|
2866
|
+
}
|
|
2867
|
+
return {
|
|
2868
|
+
id: file.id || `${file.name}-${idx}`,
|
|
2869
|
+
name: file.name,
|
|
2870
|
+
size: file.size,
|
|
2871
|
+
type: file.type,
|
|
2872
|
+
progress: file.progress !== undefined ? file.progress : 100,
|
|
2873
|
+
status: file.status || 'success',
|
|
2874
|
+
errorMessage: file.errorMessage,
|
|
2875
|
+
formattedSize: file.formattedSize || this.formatBytes(file.size),
|
|
2876
|
+
fileObject: file.fileObject,
|
|
2877
|
+
thumbnailUrl: thumbUrl,
|
|
2878
|
+
};
|
|
2879
|
+
}
|
|
2880
|
+
});
|
|
2881
|
+
});
|
|
2882
|
+
ngOnDestroy() {
|
|
2883
|
+
this.objectUrlCache.forEach((url) => URL.revokeObjectURL(url));
|
|
2884
|
+
this.objectUrlCache.clear();
|
|
2885
|
+
}
|
|
2886
|
+
onDelete(item) {
|
|
2887
|
+
// Emit original item if possible or the constructed item
|
|
2888
|
+
const orig = this.findOriginal(item);
|
|
2889
|
+
this.delete.emit(orig);
|
|
2890
|
+
}
|
|
2891
|
+
onDownload(item) {
|
|
2892
|
+
const orig = this.findOriginal(item);
|
|
2893
|
+
this.download.emit(orig);
|
|
2894
|
+
}
|
|
2895
|
+
getFileDetails(item) {
|
|
2896
|
+
const type = item.type || '';
|
|
2897
|
+
const name = item.name || '';
|
|
2898
|
+
const ext = name.split('.').pop()?.toLowerCase() || '';
|
|
2899
|
+
if (type.startsWith('image/')) {
|
|
2900
|
+
return { label: 'IMG', color: '#3b82f6', icon: '🖼️' };
|
|
2901
|
+
}
|
|
2902
|
+
if (type === 'application/pdf' || ext === 'pdf') {
|
|
2903
|
+
return { label: 'PDF', color: '#ef4444', icon: '📄' };
|
|
2904
|
+
}
|
|
2905
|
+
if (type.includes('word') || type.includes('document') || ['doc', 'docx', 'txt', 'rtf'].includes(ext)) {
|
|
2906
|
+
return { label: 'DOC', color: '#2563eb', icon: '📝' };
|
|
2907
|
+
}
|
|
2908
|
+
if (type.includes('sheet') || type.includes('excel') || ['xls', 'xlsx', 'csv'].includes(ext)) {
|
|
2909
|
+
return { label: 'XLS', color: '#16a34a', icon: '📊' };
|
|
2910
|
+
}
|
|
2911
|
+
if (type.includes('presentation') || type.includes('powerpoint') || ['ppt', 'pptx'].includes(ext)) {
|
|
2912
|
+
return { label: 'PPT', color: '#ea580c', icon: '🎭' };
|
|
2913
|
+
}
|
|
2914
|
+
if (type.includes('zip') || type.includes('compressed') || type.includes('tar') || ['zip', 'rar', '7z', 'tar', 'gz'].includes(ext)) {
|
|
2915
|
+
return { label: 'ZIP', color: '#7c3aed', icon: '📦' };
|
|
2916
|
+
}
|
|
2917
|
+
if (type.includes('javascript') ||
|
|
2918
|
+
type.includes('typescript') ||
|
|
2919
|
+
type.includes('json') ||
|
|
2920
|
+
['js', 'ts', 'html', 'css', 'json', 'py', 'go', 'rs', 'cpp'].includes(ext)) {
|
|
2921
|
+
return { label: 'CODE', color: '#0f172a', icon: '💻' };
|
|
2922
|
+
}
|
|
2923
|
+
if (type.startsWith('audio/') || ['mp3', 'wav', 'ogg', 'm4a'].includes(ext)) {
|
|
2924
|
+
return { label: 'AUDIO', color: '#06b6d4', icon: '🎵' };
|
|
2925
|
+
}
|
|
2926
|
+
if (type.startsWith('video/') || ['mp4', 'mkv', 'avi', 'mov'].includes(ext)) {
|
|
2927
|
+
return { label: 'VIDEO', color: '#6366f1', icon: '🎥' };
|
|
2928
|
+
}
|
|
2929
|
+
return { label: 'FILE', color: '#64748b', icon: '📁' };
|
|
2930
|
+
}
|
|
2931
|
+
getObjectUrl(file) {
|
|
2932
|
+
if (this.objectUrlCache.has(file)) {
|
|
2933
|
+
return this.objectUrlCache.get(file);
|
|
2934
|
+
}
|
|
2935
|
+
const url = URL.createObjectURL(file);
|
|
2936
|
+
this.objectUrlCache.set(file, url);
|
|
2937
|
+
return url;
|
|
2938
|
+
}
|
|
2939
|
+
findOriginal(item) {
|
|
2940
|
+
const list = this.files() || [];
|
|
2941
|
+
// Search original items in the list
|
|
2942
|
+
for (const f of list) {
|
|
2943
|
+
if (f instanceof File) {
|
|
2944
|
+
if (f === item.fileObject)
|
|
2945
|
+
return f;
|
|
2946
|
+
}
|
|
2947
|
+
else {
|
|
2948
|
+
if (f.id === item.id || (f.name === item.name && f.size === item.size)) {
|
|
2949
|
+
return f;
|
|
2950
|
+
}
|
|
2951
|
+
}
|
|
2952
|
+
}
|
|
2953
|
+
return item;
|
|
2954
|
+
}
|
|
2955
|
+
formatBytes(bytes, decimals = 2) {
|
|
2956
|
+
if (bytes === 0)
|
|
2957
|
+
return '0 Bytes';
|
|
2958
|
+
const k = 1024;
|
|
2959
|
+
const dm = decimals < 0 ? 0 : decimals;
|
|
2960
|
+
const sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB'];
|
|
2961
|
+
const i = Math.floor(Math.log(bytes) / Math.log(k));
|
|
2962
|
+
return parseFloat((bytes / Math.pow(k, i)).toFixed(dm)) + ' ' + sizes[i];
|
|
2963
|
+
}
|
|
2964
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: FilePreviewComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2965
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.20", type: FilePreviewComponent, isStandalone: true, selector: "ngx-file-preview", inputs: { files: { classPropertyName: "files", publicName: "files", isSignal: true, isRequired: false, transformFunction: null }, layout: { classPropertyName: "layout", publicName: "layout", isSignal: true, isRequired: false, transformFunction: null }, allowDelete: { classPropertyName: "allowDelete", publicName: "allowDelete", isSignal: true, isRequired: false, transformFunction: null }, allowDownload: { classPropertyName: "allowDownload", publicName: "allowDownload", isSignal: true, isRequired: false, transformFunction: null }, theme: { classPropertyName: "theme", publicName: "theme", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { delete: "delete", download: "download" }, ngImport: i0, template: `
|
|
2966
|
+
<div
|
|
2967
|
+
class="ngx-file-preview"
|
|
2968
|
+
[class.dark]="theme() === 'dark'"
|
|
2969
|
+
[class]="layout()"
|
|
2970
|
+
>
|
|
2971
|
+
@if (previewFiles().length === 0) {
|
|
2972
|
+
<div class="ngx-file-preview__empty">
|
|
2973
|
+
<svg viewBox="0 0 24 24" width="32" height="32" fill="none" stroke="currentColor" stroke-width="1.5">
|
|
2974
|
+
<path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"/>
|
|
2975
|
+
<polyline points="17 8 12 3 7 8"/>
|
|
2976
|
+
<line x1="12" y1="3" x2="12" y2="15"/>
|
|
2977
|
+
</svg>
|
|
2978
|
+
<span class="ngx-file-preview__empty-text">No files selected</span>
|
|
2979
|
+
</div>
|
|
2980
|
+
} @else {
|
|
2981
|
+
<div class="ngx-file-preview__grid-container">
|
|
2982
|
+
@for (item of previewFiles(); track item.id) {
|
|
2983
|
+
<div
|
|
2984
|
+
class="ngx-file-preview__card"
|
|
2985
|
+
[class]="item.status"
|
|
2986
|
+
>
|
|
2987
|
+
<!-- Image Thumbnail or Icon -->
|
|
2988
|
+
<div class="ngx-file-preview__media-wrapper">
|
|
2989
|
+
@if (item.thumbnailUrl) {
|
|
2990
|
+
<div
|
|
2991
|
+
class="ngx-file-preview__thumbnail"
|
|
2992
|
+
[style.backgroundImage]="'url(' + item.thumbnailUrl + ')'"
|
|
2993
|
+
></div>
|
|
2994
|
+
} @else {
|
|
2995
|
+
<div
|
|
2996
|
+
class="ngx-file-preview__icon-fallback"
|
|
2997
|
+
[style.background-color]="getFileDetails(item).color + '15'"
|
|
2998
|
+
[style.color]="getFileDetails(item).color"
|
|
2999
|
+
>
|
|
3000
|
+
<span class="file-icon-symbol">{{ getFileDetails(item).icon }}</span>
|
|
3001
|
+
<span class="file-icon-badge">{{ getFileDetails(item).label }}</span>
|
|
3002
|
+
</div>
|
|
3003
|
+
}
|
|
3004
|
+
|
|
3005
|
+
<!-- Delete & Download Hover Actions Overlay -->
|
|
3006
|
+
<div class="ngx-file-preview__overlay-actions">
|
|
3007
|
+
@if (allowDownload() && item.status === 'success') {
|
|
3008
|
+
<button
|
|
3009
|
+
class="ngx-file-preview__action-btn btn-download"
|
|
3010
|
+
(click)="onDownload(item)"
|
|
3011
|
+
aria-label="Download file"
|
|
3012
|
+
>
|
|
3013
|
+
<svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="2">
|
|
3014
|
+
<path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"/>
|
|
3015
|
+
<polyline points="7 10 12 15 17 10"/>
|
|
3016
|
+
<line x1="12" y1="15" x2="12" y2="3"/>
|
|
3017
|
+
</svg>
|
|
3018
|
+
</button>
|
|
3019
|
+
}
|
|
3020
|
+
@if (allowDelete()) {
|
|
3021
|
+
<button
|
|
3022
|
+
class="ngx-file-preview__action-btn btn-delete"
|
|
3023
|
+
(click)="onDelete(item)"
|
|
3024
|
+
aria-label="Delete file"
|
|
3025
|
+
>
|
|
3026
|
+
<svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="2">
|
|
3027
|
+
<polyline points="3 6 5 6 21 6" />
|
|
3028
|
+
<path d="M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2" />
|
|
3029
|
+
</svg>
|
|
3030
|
+
</button>
|
|
3031
|
+
}
|
|
3032
|
+
</div>
|
|
3033
|
+
</div>
|
|
3034
|
+
|
|
3035
|
+
<!-- Content details -->
|
|
3036
|
+
<div class="ngx-file-preview__details">
|
|
3037
|
+
<div class="ngx-file-preview__meta">
|
|
3038
|
+
<span class="ngx-file-preview__name" [title]="item.name">{{ item.name }}</span>
|
|
3039
|
+
<span class="ngx-file-preview__size">{{ item.formattedSize }}</span>
|
|
3040
|
+
</div>
|
|
3041
|
+
|
|
3042
|
+
<!-- Status details / upload meter -->
|
|
3043
|
+
@if (item.status === 'uploading') {
|
|
3044
|
+
<div class="ngx-file-preview__progress-wrap">
|
|
3045
|
+
<div class="ngx-file-preview__progress-bar">
|
|
3046
|
+
<div class="ngx-file-preview__progress-fill" [style.width.%]="item.progress"></div>
|
|
3047
|
+
</div>
|
|
3048
|
+
<span class="ngx-file-preview__progress-text">{{ item.progress }}%</span>
|
|
3049
|
+
</div>
|
|
3050
|
+
} @else if (item.status === 'error') {
|
|
3051
|
+
<span class="ngx-file-preview__error-msg">
|
|
3052
|
+
⚠️ {{ item.errorMessage || 'Upload failed' }}
|
|
3053
|
+
</span>
|
|
3054
|
+
} @else {
|
|
3055
|
+
<div class="ngx-file-preview__status-row">
|
|
3056
|
+
<span class="status-indicator" [class]="item.status"></span>
|
|
3057
|
+
<span class="status-label">{{ item.status }}</span>
|
|
3058
|
+
</div>
|
|
3059
|
+
}
|
|
3060
|
+
</div>
|
|
3061
|
+
</div>
|
|
3062
|
+
}
|
|
3063
|
+
</div>
|
|
3064
|
+
}
|
|
3065
|
+
</div>
|
|
3066
|
+
`, isInline: true, styles: [":host{display:block;width:100%}.ngx-file-preview{width:100%;font-family:var(--ngx-font-family, system-ui, sans-serif)}.ngx-file-preview__empty{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:40px;border:2px dashed rgba(0,0,0,.1);border-radius:12px;color:#64748b;background:#fff3}.dark .ngx-file-preview__empty{border-color:#ffffff14;color:#94a3b8;background:#0f172a26}.ngx-file-preview__empty svg{margin-bottom:8px;stroke:#94a3b8}.ngx-file-preview__empty-text{font-size:13px;font-weight:500}.ngx-file-preview__grid-container{display:grid;grid-template-columns:repeat(auto-fill,minmax(200px,1fr));gap:16px}.ngx-file-preview__card{display:flex;flex-direction:column;border-radius:12px;overflow:hidden;background:#ffffffb3;backdrop-filter:blur(8px);-webkit-backdrop-filter:blur(8px);border:1px solid rgba(0,0,0,.06);box-shadow:0 4px 6px -1px #00000008,0 2px 4px -1px #00000005;transition:all .2s ease}.ngx-file-preview__card:hover{transform:translateY(-2px);box-shadow:0 10px 15px -3px #0000000d,0 4px 6px -4px #0000000d;border-color:#0000001f}.dark .ngx-file-preview__card{background:#1e2030d9;border-color:#ffffff0f}.dark .ngx-file-preview__card:hover{border-color:#ffffff1f}.ngx-file-preview__media-wrapper{position:relative;width:100%;height:120px;background:#f8fafc;overflow:hidden;display:flex;align-items:center;justify-content:center}.dark .ngx-file-preview__media-wrapper{background:#1e293b}.ngx-file-preview__thumbnail{width:100%;height:100%;background-size:cover;background-position:center;background-repeat:no-repeat}.ngx-file-preview__icon-fallback{display:flex;flex-direction:column;align-items:center;justify-content:center;width:100%;height:100%;font-weight:700}.file-icon-symbol{font-size:36px;line-height:1;margin-bottom:4px}.file-icon-badge{font-size:10px;padding:2px 6px;border-radius:4px;background:#0000000d;text-transform:uppercase;letter-spacing:.5px}.dark .file-icon-badge{background:#ffffff1a}.ngx-file-preview__overlay-actions{position:absolute;top:0;left:0;width:100%;height:100%;background:#0f172a66;display:flex;align-items:center;justify-content:center;gap:12px;opacity:0;transition:opacity .2s ease;z-index:5}.ngx-file-preview__media-wrapper:hover .ngx-file-preview__overlay-actions{opacity:1}.ngx-file-preview__action-btn{width:34px;height:34px;border-radius:50%;border:none;background:#ffffffe6;color:#0f172a;display:flex;align-items:center;justify-content:center;cursor:pointer;transition:all .2s cubic-bezier(.4,0,.2,1);box-shadow:0 4px 6px #0000001a}.ngx-file-preview__action-btn:hover{transform:scale(1.1);background:#fff}.ngx-file-preview__action-btn.btn-delete:hover{background:#ef4444;color:#fff}.ngx-file-preview__action-btn.btn-download:hover{background:var(--primary-color, #3b82f6);color:#fff}.ngx-file-preview__details{padding:12px;display:flex;flex-direction:column;gap:6px;flex-grow:1}.ngx-file-preview__meta{display:flex;justify-content:space-between;align-items:baseline;gap:8px}.ngx-file-preview__name{font-size:13px;font-weight:600;color:#0f172a;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;flex-grow:1}.dark .ngx-file-preview__name{color:#f8fafc}.ngx-file-preview__size{font-size:11px;font-weight:500;color:#64748b;white-space:nowrap}.dark .ngx-file-preview__size{color:#94a3b8}.ngx-file-preview__progress-wrap{display:flex;align-items:center;gap:8px;width:100%}.ngx-file-preview__progress-bar{flex-grow:1;height:4px;border-radius:2px;background:#0000000d;overflow:hidden}.dark .ngx-file-preview__progress-bar{background:#ffffff14}.ngx-file-preview__progress-fill{height:100%;background:var(--primary-color, #3b82f6);transition:width .2s ease}.ngx-file-preview__progress-text{font-size:10px;font-weight:600;color:#64748b;width:28px;text-align:right}.ngx-file-preview__error-msg{font-size:11px;color:#ef4444;font-weight:500}.ngx-file-preview__status-row{display:flex;align-items:center;gap:6px;font-size:11px;font-weight:600;text-transform:capitalize;color:#64748b}.dark .ngx-file-preview__status-row{color:#94a3b8}.status-indicator{width:6px;height:6px;border-radius:50%;background:#64748b}.status-indicator.success{background:#10b981}.status-indicator.pending{background:#f59e0b}.ngx-file-preview.list .ngx-file-preview__grid-container{display:flex;flex-direction:column;gap:8px}.ngx-file-preview.list .ngx-file-preview__card{flex-direction:row;align-items:center;padding:8px 12px;gap:12px}.ngx-file-preview.list .ngx-file-preview__card:hover{transform:translate(2px) translateY(0)}.ngx-file-preview.list .ngx-file-preview__media-wrapper{width:42px;height:42px;border-radius:6px;flex-shrink:0}.ngx-file-preview.list .file-icon-symbol{font-size:20px;margin:0}.ngx-file-preview.list .file-icon-badge{display:none}.ngx-file-preview.list .ngx-file-preview__details{padding:0;flex-direction:row;align-items:center;justify-content:space-between;width:100%;gap:16px}.ngx-file-preview.list .ngx-file-preview__meta{flex-grow:1;width:30%;flex-direction:column;gap:2px}.ngx-file-preview.list .ngx-file-preview__progress-wrap{width:120px;flex-shrink:0}.ngx-file-preview.list .ngx-file-preview__overlay-actions{position:static;opacity:1;background:transparent;box-shadow:none;width:auto;height:auto;gap:6px;margin-left:auto}.ngx-file-preview.list .ngx-file-preview__action-btn{width:30px;height:30px;box-shadow:none;border:1px solid rgba(0,0,0,.05);background:#00000005}.dark .ngx-file-preview.list .ngx-file-preview__action-btn{border-color:#ffffff0f;background:#ffffff05;color:#cbd5e1}.ngx-file-preview.list .ngx-file-preview__action-btn:hover{transform:scale(1.05)}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
3067
|
+
}
|
|
3068
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: FilePreviewComponent, decorators: [{
|
|
3069
|
+
type: Component,
|
|
3070
|
+
args: [{ selector: 'ngx-file-preview', standalone: true, imports: [CommonModule], changeDetection: ChangeDetectionStrategy.OnPush, template: `
|
|
3071
|
+
<div
|
|
3072
|
+
class="ngx-file-preview"
|
|
3073
|
+
[class.dark]="theme() === 'dark'"
|
|
3074
|
+
[class]="layout()"
|
|
3075
|
+
>
|
|
3076
|
+
@if (previewFiles().length === 0) {
|
|
3077
|
+
<div class="ngx-file-preview__empty">
|
|
3078
|
+
<svg viewBox="0 0 24 24" width="32" height="32" fill="none" stroke="currentColor" stroke-width="1.5">
|
|
3079
|
+
<path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"/>
|
|
3080
|
+
<polyline points="17 8 12 3 7 8"/>
|
|
3081
|
+
<line x1="12" y1="3" x2="12" y2="15"/>
|
|
3082
|
+
</svg>
|
|
3083
|
+
<span class="ngx-file-preview__empty-text">No files selected</span>
|
|
3084
|
+
</div>
|
|
3085
|
+
} @else {
|
|
3086
|
+
<div class="ngx-file-preview__grid-container">
|
|
3087
|
+
@for (item of previewFiles(); track item.id) {
|
|
3088
|
+
<div
|
|
3089
|
+
class="ngx-file-preview__card"
|
|
3090
|
+
[class]="item.status"
|
|
3091
|
+
>
|
|
3092
|
+
<!-- Image Thumbnail or Icon -->
|
|
3093
|
+
<div class="ngx-file-preview__media-wrapper">
|
|
3094
|
+
@if (item.thumbnailUrl) {
|
|
3095
|
+
<div
|
|
3096
|
+
class="ngx-file-preview__thumbnail"
|
|
3097
|
+
[style.backgroundImage]="'url(' + item.thumbnailUrl + ')'"
|
|
3098
|
+
></div>
|
|
3099
|
+
} @else {
|
|
3100
|
+
<div
|
|
3101
|
+
class="ngx-file-preview__icon-fallback"
|
|
3102
|
+
[style.background-color]="getFileDetails(item).color + '15'"
|
|
3103
|
+
[style.color]="getFileDetails(item).color"
|
|
3104
|
+
>
|
|
3105
|
+
<span class="file-icon-symbol">{{ getFileDetails(item).icon }}</span>
|
|
3106
|
+
<span class="file-icon-badge">{{ getFileDetails(item).label }}</span>
|
|
3107
|
+
</div>
|
|
3108
|
+
}
|
|
3109
|
+
|
|
3110
|
+
<!-- Delete & Download Hover Actions Overlay -->
|
|
3111
|
+
<div class="ngx-file-preview__overlay-actions">
|
|
3112
|
+
@if (allowDownload() && item.status === 'success') {
|
|
3113
|
+
<button
|
|
3114
|
+
class="ngx-file-preview__action-btn btn-download"
|
|
3115
|
+
(click)="onDownload(item)"
|
|
3116
|
+
aria-label="Download file"
|
|
3117
|
+
>
|
|
3118
|
+
<svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="2">
|
|
3119
|
+
<path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"/>
|
|
3120
|
+
<polyline points="7 10 12 15 17 10"/>
|
|
3121
|
+
<line x1="12" y1="15" x2="12" y2="3"/>
|
|
3122
|
+
</svg>
|
|
3123
|
+
</button>
|
|
3124
|
+
}
|
|
3125
|
+
@if (allowDelete()) {
|
|
3126
|
+
<button
|
|
3127
|
+
class="ngx-file-preview__action-btn btn-delete"
|
|
3128
|
+
(click)="onDelete(item)"
|
|
3129
|
+
aria-label="Delete file"
|
|
3130
|
+
>
|
|
3131
|
+
<svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="2">
|
|
3132
|
+
<polyline points="3 6 5 6 21 6" />
|
|
3133
|
+
<path d="M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2" />
|
|
3134
|
+
</svg>
|
|
3135
|
+
</button>
|
|
3136
|
+
}
|
|
3137
|
+
</div>
|
|
3138
|
+
</div>
|
|
3139
|
+
|
|
3140
|
+
<!-- Content details -->
|
|
3141
|
+
<div class="ngx-file-preview__details">
|
|
3142
|
+
<div class="ngx-file-preview__meta">
|
|
3143
|
+
<span class="ngx-file-preview__name" [title]="item.name">{{ item.name }}</span>
|
|
3144
|
+
<span class="ngx-file-preview__size">{{ item.formattedSize }}</span>
|
|
3145
|
+
</div>
|
|
3146
|
+
|
|
3147
|
+
<!-- Status details / upload meter -->
|
|
3148
|
+
@if (item.status === 'uploading') {
|
|
3149
|
+
<div class="ngx-file-preview__progress-wrap">
|
|
3150
|
+
<div class="ngx-file-preview__progress-bar">
|
|
3151
|
+
<div class="ngx-file-preview__progress-fill" [style.width.%]="item.progress"></div>
|
|
3152
|
+
</div>
|
|
3153
|
+
<span class="ngx-file-preview__progress-text">{{ item.progress }}%</span>
|
|
3154
|
+
</div>
|
|
3155
|
+
} @else if (item.status === 'error') {
|
|
3156
|
+
<span class="ngx-file-preview__error-msg">
|
|
3157
|
+
⚠️ {{ item.errorMessage || 'Upload failed' }}
|
|
3158
|
+
</span>
|
|
3159
|
+
} @else {
|
|
3160
|
+
<div class="ngx-file-preview__status-row">
|
|
3161
|
+
<span class="status-indicator" [class]="item.status"></span>
|
|
3162
|
+
<span class="status-label">{{ item.status }}</span>
|
|
3163
|
+
</div>
|
|
3164
|
+
}
|
|
3165
|
+
</div>
|
|
3166
|
+
</div>
|
|
3167
|
+
}
|
|
3168
|
+
</div>
|
|
3169
|
+
}
|
|
3170
|
+
</div>
|
|
3171
|
+
`, styles: [":host{display:block;width:100%}.ngx-file-preview{width:100%;font-family:var(--ngx-font-family, system-ui, sans-serif)}.ngx-file-preview__empty{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:40px;border:2px dashed rgba(0,0,0,.1);border-radius:12px;color:#64748b;background:#fff3}.dark .ngx-file-preview__empty{border-color:#ffffff14;color:#94a3b8;background:#0f172a26}.ngx-file-preview__empty svg{margin-bottom:8px;stroke:#94a3b8}.ngx-file-preview__empty-text{font-size:13px;font-weight:500}.ngx-file-preview__grid-container{display:grid;grid-template-columns:repeat(auto-fill,minmax(200px,1fr));gap:16px}.ngx-file-preview__card{display:flex;flex-direction:column;border-radius:12px;overflow:hidden;background:#ffffffb3;backdrop-filter:blur(8px);-webkit-backdrop-filter:blur(8px);border:1px solid rgba(0,0,0,.06);box-shadow:0 4px 6px -1px #00000008,0 2px 4px -1px #00000005;transition:all .2s ease}.ngx-file-preview__card:hover{transform:translateY(-2px);box-shadow:0 10px 15px -3px #0000000d,0 4px 6px -4px #0000000d;border-color:#0000001f}.dark .ngx-file-preview__card{background:#1e2030d9;border-color:#ffffff0f}.dark .ngx-file-preview__card:hover{border-color:#ffffff1f}.ngx-file-preview__media-wrapper{position:relative;width:100%;height:120px;background:#f8fafc;overflow:hidden;display:flex;align-items:center;justify-content:center}.dark .ngx-file-preview__media-wrapper{background:#1e293b}.ngx-file-preview__thumbnail{width:100%;height:100%;background-size:cover;background-position:center;background-repeat:no-repeat}.ngx-file-preview__icon-fallback{display:flex;flex-direction:column;align-items:center;justify-content:center;width:100%;height:100%;font-weight:700}.file-icon-symbol{font-size:36px;line-height:1;margin-bottom:4px}.file-icon-badge{font-size:10px;padding:2px 6px;border-radius:4px;background:#0000000d;text-transform:uppercase;letter-spacing:.5px}.dark .file-icon-badge{background:#ffffff1a}.ngx-file-preview__overlay-actions{position:absolute;top:0;left:0;width:100%;height:100%;background:#0f172a66;display:flex;align-items:center;justify-content:center;gap:12px;opacity:0;transition:opacity .2s ease;z-index:5}.ngx-file-preview__media-wrapper:hover .ngx-file-preview__overlay-actions{opacity:1}.ngx-file-preview__action-btn{width:34px;height:34px;border-radius:50%;border:none;background:#ffffffe6;color:#0f172a;display:flex;align-items:center;justify-content:center;cursor:pointer;transition:all .2s cubic-bezier(.4,0,.2,1);box-shadow:0 4px 6px #0000001a}.ngx-file-preview__action-btn:hover{transform:scale(1.1);background:#fff}.ngx-file-preview__action-btn.btn-delete:hover{background:#ef4444;color:#fff}.ngx-file-preview__action-btn.btn-download:hover{background:var(--primary-color, #3b82f6);color:#fff}.ngx-file-preview__details{padding:12px;display:flex;flex-direction:column;gap:6px;flex-grow:1}.ngx-file-preview__meta{display:flex;justify-content:space-between;align-items:baseline;gap:8px}.ngx-file-preview__name{font-size:13px;font-weight:600;color:#0f172a;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;flex-grow:1}.dark .ngx-file-preview__name{color:#f8fafc}.ngx-file-preview__size{font-size:11px;font-weight:500;color:#64748b;white-space:nowrap}.dark .ngx-file-preview__size{color:#94a3b8}.ngx-file-preview__progress-wrap{display:flex;align-items:center;gap:8px;width:100%}.ngx-file-preview__progress-bar{flex-grow:1;height:4px;border-radius:2px;background:#0000000d;overflow:hidden}.dark .ngx-file-preview__progress-bar{background:#ffffff14}.ngx-file-preview__progress-fill{height:100%;background:var(--primary-color, #3b82f6);transition:width .2s ease}.ngx-file-preview__progress-text{font-size:10px;font-weight:600;color:#64748b;width:28px;text-align:right}.ngx-file-preview__error-msg{font-size:11px;color:#ef4444;font-weight:500}.ngx-file-preview__status-row{display:flex;align-items:center;gap:6px;font-size:11px;font-weight:600;text-transform:capitalize;color:#64748b}.dark .ngx-file-preview__status-row{color:#94a3b8}.status-indicator{width:6px;height:6px;border-radius:50%;background:#64748b}.status-indicator.success{background:#10b981}.status-indicator.pending{background:#f59e0b}.ngx-file-preview.list .ngx-file-preview__grid-container{display:flex;flex-direction:column;gap:8px}.ngx-file-preview.list .ngx-file-preview__card{flex-direction:row;align-items:center;padding:8px 12px;gap:12px}.ngx-file-preview.list .ngx-file-preview__card:hover{transform:translate(2px) translateY(0)}.ngx-file-preview.list .ngx-file-preview__media-wrapper{width:42px;height:42px;border-radius:6px;flex-shrink:0}.ngx-file-preview.list .file-icon-symbol{font-size:20px;margin:0}.ngx-file-preview.list .file-icon-badge{display:none}.ngx-file-preview.list .ngx-file-preview__details{padding:0;flex-direction:row;align-items:center;justify-content:space-between;width:100%;gap:16px}.ngx-file-preview.list .ngx-file-preview__meta{flex-grow:1;width:30%;flex-direction:column;gap:2px}.ngx-file-preview.list .ngx-file-preview__progress-wrap{width:120px;flex-shrink:0}.ngx-file-preview.list .ngx-file-preview__overlay-actions{position:static;opacity:1;background:transparent;box-shadow:none;width:auto;height:auto;gap:6px;margin-left:auto}.ngx-file-preview.list .ngx-file-preview__action-btn{width:30px;height:30px;box-shadow:none;border:1px solid rgba(0,0,0,.05);background:#00000005}.dark .ngx-file-preview.list .ngx-file-preview__action-btn{border-color:#ffffff0f;background:#ffffff05;color:#cbd5e1}.ngx-file-preview.list .ngx-file-preview__action-btn:hover{transform:scale(1.05)}\n"] }]
|
|
3172
|
+
}] });
|
|
3173
|
+
|
|
3174
|
+
class SegmentedControlComponent {
|
|
3175
|
+
// Inputs
|
|
3176
|
+
options = input([]);
|
|
3177
|
+
value = model(null); // Signal-based model for two-way binding
|
|
3178
|
+
disabled = input(false);
|
|
3179
|
+
theme = input('light');
|
|
3180
|
+
variant = input('default');
|
|
3181
|
+
id = input('ngx-segmented-' + Math.random().toString(36).substring(2, 9));
|
|
3182
|
+
// Outputs
|
|
3183
|
+
valueChange = output();
|
|
3184
|
+
// Computeds
|
|
3185
|
+
selectedIndex = computed(() => {
|
|
3186
|
+
const val = this.value();
|
|
3187
|
+
return this.options().findIndex(opt => opt.value === val);
|
|
3188
|
+
});
|
|
3189
|
+
variantClass = computed(() => {
|
|
3190
|
+
return this.variant() !== 'default' ? this.variant() : '';
|
|
3191
|
+
});
|
|
3192
|
+
selectOption(val) {
|
|
3193
|
+
if (this.disabled())
|
|
3194
|
+
return;
|
|
3195
|
+
this.value.set(val);
|
|
3196
|
+
this.valueChange.emit(val);
|
|
3197
|
+
}
|
|
3198
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: SegmentedControlComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
3199
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.20", type: SegmentedControlComponent, isStandalone: true, selector: "ngx-segmented-control", inputs: { options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, theme: { classPropertyName: "theme", publicName: "theme", isSignal: true, isRequired: false, transformFunction: null }, variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange", valueChange: "valueChange" }, ngImport: i0, template: `
|
|
3200
|
+
<div
|
|
3201
|
+
class="ngx-segmented-control"
|
|
3202
|
+
[class.dark]="theme() === 'dark'"
|
|
3203
|
+
[class.disabled]="disabled()"
|
|
3204
|
+
[attr.id]="id()"
|
|
3205
|
+
>
|
|
3206
|
+
<!-- Sliding Highlight Backdrop indicator -->
|
|
3207
|
+
@if (selectedIndex() >= 0) {
|
|
3208
|
+
<div
|
|
3209
|
+
class="ngx-segmented-control__indicator"
|
|
3210
|
+
[style.width.%]="100 / options().length"
|
|
3211
|
+
[style.transform]="'translateX(' + (selectedIndex() * 100) + '%)'"
|
|
3212
|
+
[class]="variantClass()"
|
|
3213
|
+
></div>
|
|
3214
|
+
}
|
|
3215
|
+
|
|
3216
|
+
<!-- Option buttons -->
|
|
3217
|
+
@for (opt of options(); track opt.value; let idx = $index) {
|
|
3218
|
+
<button
|
|
3219
|
+
class="ngx-segmented-control__option"
|
|
3220
|
+
[class.selected]="idx === selectedIndex()"
|
|
3221
|
+
(click)="selectOption(opt.value)"
|
|
3222
|
+
[disabled]="disabled()"
|
|
3223
|
+
[style.width.%]="100 / options().length"
|
|
3224
|
+
type="button"
|
|
3225
|
+
>
|
|
3226
|
+
<span class="ngx-segmented-control__label-text">{{ opt.label }}</span>
|
|
3227
|
+
@if (opt.badge) {
|
|
3228
|
+
<span class="ngx-segmented-control__badge">{{ opt.badge }}</span>
|
|
3229
|
+
}
|
|
3230
|
+
</button>
|
|
3231
|
+
}
|
|
3232
|
+
</div>
|
|
3233
|
+
`, isInline: true, styles: [":host{display:inline-block;min-width:240px}.ngx-segmented-control{position:relative;display:flex;width:100%;background:#0000000a;padding:3px;border-radius:10px;box-sizing:border-box;-webkit-user-select:none;user-select:none;font-family:var(--ngx-font-family, system-ui, sans-serif);border:1px solid rgba(0,0,0,.03)}.ngx-segmented-control.dark{background:#ffffff0f;border-color:#ffffff08}.ngx-segmented-control.disabled{opacity:.55;pointer-events:none}.ngx-segmented-control__indicator{position:absolute;top:3px;left:0;bottom:3px;background:#fff;border-radius:8px;box-shadow:0 1px 3px #0000001a,0 1px 2px #0000000f;transition:transform .26s cubic-bezier(.25,.8,.25,1);z-index:1}.ngx-segmented-control.dark .ngx-segmented-control__indicator{background:#ffffff26;box-shadow:none}.ngx-segmented-control__option{position:relative;display:inline-flex;align-items:center;justify-content:center;gap:6px;padding:6px 12px;font-size:13px;font-weight:600;color:#64748b;background:transparent;border:none;cursor:pointer;z-index:2;transition:color .2s ease;outline:none;height:30px;box-sizing:border-box}.ngx-segmented-control__option:hover:not([disabled]){color:#0f172a}.ngx-segmented-control__option.selected{color:#0f172a}.ngx-segmented-control.dark .ngx-segmented-control__option{color:#94a3b8}.ngx-segmented-control.dark .ngx-segmented-control__option:hover:not([disabled]),.ngx-segmented-control.dark .ngx-segmented-control__option.selected{color:#fff}.ngx-segmented-control__badge{font-size:9px;padding:1px 5px;border-radius:4px;background:#0000000f;color:#475569;font-weight:700;transition:all .2s ease}.ngx-segmented-control__option.selected .ngx-segmented-control__badge{background:#0000001a}.ngx-segmented-control.dark .ngx-segmented-control__badge{background:#ffffff14;color:#cbd5e1}.ngx-segmented-control.dark .ngx-segmented-control__option.selected .ngx-segmented-control__badge{background:#ffffff26}.ngx-segmented-control__indicator.primary{background:var(--primary-color, #3b82f6)}.ngx-segmented-control__indicator.success{background:#10b981}.ngx-segmented-control__indicator.danger{background:#ef4444}.ngx-segmented-control__indicator.warning{background:#f59e0b}.ngx-segmented-control__indicator.info{background:#3b82f6}.ngx-segmented-control__indicator.primary,.ngx-segmented-control__indicator.success,.ngx-segmented-control__indicator.danger,.ngx-segmented-control__indicator.warning,.ngx-segmented-control__indicator.info{box-shadow:none}.ngx-segmented-control__indicator:not(.default)~.ngx-segmented-control__option.selected{color:#fff}.ngx-segmented-control:has(.ngx-segmented-control__indicator:not(.default)) .ngx-segmented-control__option.selected{color:#fff!important}.ngx-segmented-control:has(.ngx-segmented-control__indicator:not(.default)) .ngx-segmented-control__option.selected .ngx-segmented-control__badge{background:#fff3;color:#fff}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
3234
|
+
}
|
|
3235
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: SegmentedControlComponent, decorators: [{
|
|
3236
|
+
type: Component,
|
|
3237
|
+
args: [{ selector: 'ngx-segmented-control', standalone: true, imports: [CommonModule], changeDetection: ChangeDetectionStrategy.OnPush, template: `
|
|
3238
|
+
<div
|
|
3239
|
+
class="ngx-segmented-control"
|
|
3240
|
+
[class.dark]="theme() === 'dark'"
|
|
3241
|
+
[class.disabled]="disabled()"
|
|
3242
|
+
[attr.id]="id()"
|
|
3243
|
+
>
|
|
3244
|
+
<!-- Sliding Highlight Backdrop indicator -->
|
|
3245
|
+
@if (selectedIndex() >= 0) {
|
|
3246
|
+
<div
|
|
3247
|
+
class="ngx-segmented-control__indicator"
|
|
3248
|
+
[style.width.%]="100 / options().length"
|
|
3249
|
+
[style.transform]="'translateX(' + (selectedIndex() * 100) + '%)'"
|
|
3250
|
+
[class]="variantClass()"
|
|
3251
|
+
></div>
|
|
3252
|
+
}
|
|
3253
|
+
|
|
3254
|
+
<!-- Option buttons -->
|
|
3255
|
+
@for (opt of options(); track opt.value; let idx = $index) {
|
|
3256
|
+
<button
|
|
3257
|
+
class="ngx-segmented-control__option"
|
|
3258
|
+
[class.selected]="idx === selectedIndex()"
|
|
3259
|
+
(click)="selectOption(opt.value)"
|
|
3260
|
+
[disabled]="disabled()"
|
|
3261
|
+
[style.width.%]="100 / options().length"
|
|
3262
|
+
type="button"
|
|
3263
|
+
>
|
|
3264
|
+
<span class="ngx-segmented-control__label-text">{{ opt.label }}</span>
|
|
3265
|
+
@if (opt.badge) {
|
|
3266
|
+
<span class="ngx-segmented-control__badge">{{ opt.badge }}</span>
|
|
3267
|
+
}
|
|
3268
|
+
</button>
|
|
3269
|
+
}
|
|
3270
|
+
</div>
|
|
3271
|
+
`, styles: [":host{display:inline-block;min-width:240px}.ngx-segmented-control{position:relative;display:flex;width:100%;background:#0000000a;padding:3px;border-radius:10px;box-sizing:border-box;-webkit-user-select:none;user-select:none;font-family:var(--ngx-font-family, system-ui, sans-serif);border:1px solid rgba(0,0,0,.03)}.ngx-segmented-control.dark{background:#ffffff0f;border-color:#ffffff08}.ngx-segmented-control.disabled{opacity:.55;pointer-events:none}.ngx-segmented-control__indicator{position:absolute;top:3px;left:0;bottom:3px;background:#fff;border-radius:8px;box-shadow:0 1px 3px #0000001a,0 1px 2px #0000000f;transition:transform .26s cubic-bezier(.25,.8,.25,1);z-index:1}.ngx-segmented-control.dark .ngx-segmented-control__indicator{background:#ffffff26;box-shadow:none}.ngx-segmented-control__option{position:relative;display:inline-flex;align-items:center;justify-content:center;gap:6px;padding:6px 12px;font-size:13px;font-weight:600;color:#64748b;background:transparent;border:none;cursor:pointer;z-index:2;transition:color .2s ease;outline:none;height:30px;box-sizing:border-box}.ngx-segmented-control__option:hover:not([disabled]){color:#0f172a}.ngx-segmented-control__option.selected{color:#0f172a}.ngx-segmented-control.dark .ngx-segmented-control__option{color:#94a3b8}.ngx-segmented-control.dark .ngx-segmented-control__option:hover:not([disabled]),.ngx-segmented-control.dark .ngx-segmented-control__option.selected{color:#fff}.ngx-segmented-control__badge{font-size:9px;padding:1px 5px;border-radius:4px;background:#0000000f;color:#475569;font-weight:700;transition:all .2s ease}.ngx-segmented-control__option.selected .ngx-segmented-control__badge{background:#0000001a}.ngx-segmented-control.dark .ngx-segmented-control__badge{background:#ffffff14;color:#cbd5e1}.ngx-segmented-control.dark .ngx-segmented-control__option.selected .ngx-segmented-control__badge{background:#ffffff26}.ngx-segmented-control__indicator.primary{background:var(--primary-color, #3b82f6)}.ngx-segmented-control__indicator.success{background:#10b981}.ngx-segmented-control__indicator.danger{background:#ef4444}.ngx-segmented-control__indicator.warning{background:#f59e0b}.ngx-segmented-control__indicator.info{background:#3b82f6}.ngx-segmented-control__indicator.primary,.ngx-segmented-control__indicator.success,.ngx-segmented-control__indicator.danger,.ngx-segmented-control__indicator.warning,.ngx-segmented-control__indicator.info{box-shadow:none}.ngx-segmented-control__indicator:not(.default)~.ngx-segmented-control__option.selected{color:#fff}.ngx-segmented-control:has(.ngx-segmented-control__indicator:not(.default)) .ngx-segmented-control__option.selected{color:#fff!important}.ngx-segmented-control:has(.ngx-segmented-control__indicator:not(.default)) .ngx-segmented-control__option.selected .ngx-segmented-control__badge{background:#fff3;color:#fff}\n"] }]
|
|
3272
|
+
}] });
|
|
3273
|
+
|
|
2666
3274
|
/*
|
|
2667
3275
|
* Public API Surface — secondary entry point: ngx-core-components/inputs
|
|
2668
3276
|
*/
|
|
@@ -2672,5 +3280,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImpo
|
|
|
2672
3280
|
* Generated bundle index. Do not edit.
|
|
2673
3281
|
*/
|
|
2674
3282
|
|
|
2675
|
-
export { AutocompleteComponent, CheckboxComponent, ColorPickerComponent, DatePickerComponent, DateRangePickerComponent, DropdownComponent, FileUploadComponent, MultiSelectComponent, NumericTextBoxComponent, RadioGroupComponent, RatingComponent, SliderComponent, SwitchComponent, TextBoxComponent, TextareaComponent, TimePickerComponent };
|
|
3283
|
+
export { AutocompleteComponent, CheckboxComponent, ColorPickerComponent, DatePickerComponent, DateRangePickerComponent, DropdownComponent, FilePreviewComponent, FileUploadComponent, MultiSelectComponent, NumericTextBoxComponent, RadioGroupComponent, RatingComponent, SegmentedControlComponent, SliderComponent, SwitchComponent, TagInputComponent, TextBoxComponent, TextareaComponent, TimePickerComponent };
|
|
2676
3284
|
//# sourceMappingURL=ngx-core-components-inputs.mjs.map
|