ngx-core-components 0.3.16 → 0.3.18
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 +1 -0
- package/ai/ai-audio-wave/ai-audio-wave.component.d.ts +18 -4
- package/ai/ai-chat/ai-chat.component.d.ts +35 -2
- package/ai/ai-chat/models.d.ts +6 -0
- package/ai/ai-code-editor/ai-code-editor.component.d.ts +15 -1
- package/ai/ai-rag-inspector/ai-rag-inspector.component.d.ts +22 -0
- package/ai/ai-rag-inspector/models.d.ts +15 -0
- package/ai/public-api.d.ts +2 -0
- package/buttons/button/button.component.d.ts +15 -1
- package/buttons/split-button/split-button.component.d.ts +4 -0
- package/charts/bubble-chart/bubble-chart.component.d.ts +75 -0
- package/charts/public-api.d.ts +4 -0
- package/charts/sunburst-chart/sunburst-chart.component.d.ts +63 -0
- package/fesm2022/ngx-core-components-ai.mjs +910 -48
- package/fesm2022/ngx-core-components-ai.mjs.map +1 -1
- package/fesm2022/ngx-core-components-buttons.mjs +231 -30
- package/fesm2022/ngx-core-components-buttons.mjs.map +1 -1
- package/fesm2022/ngx-core-components-charts.mjs +940 -1
- package/fesm2022/ngx-core-components-charts.mjs.map +1 -1
- package/fesm2022/ngx-core-components-inputs.mjs +858 -237
- package/fesm2022/ngx-core-components-inputs.mjs.map +1 -1
- package/fesm2022/ngx-core-components-layout.mjs +172 -25
- package/fesm2022/ngx-core-components-layout.mjs.map +1 -1
- package/fesm2022/ngx-core-components-views.mjs +422 -2
- package/fesm2022/ngx-core-components-views.mjs.map +1 -1
- package/fesm2022/ngx-core-components.mjs +2 -2
- package/fesm2022/ngx-core-components.mjs.map +1 -1
- package/inputs/checkbox/checkbox.component.d.ts +6 -2
- package/inputs/date-range-picker/date-range-picker.component.d.ts +1 -1
- package/inputs/dropdown/dropdown.component.d.ts +1 -0
- package/inputs/file-preview/file-preview.component.d.ts +1 -1
- package/inputs/file-upload/file-upload.component.d.ts +1 -0
- package/inputs/numeric-textbox/numeric-textbox.component.d.ts +5 -1
- package/inputs/radio/radio-group.component.d.ts +12 -2
- package/inputs/rating/rating.component.d.ts +17 -4
- package/inputs/segmented-control/segmented-control.component.d.ts +2 -2
- package/inputs/switch/switch.component.d.ts +14 -4
- package/inputs/textarea/textarea.component.d.ts +3 -1
- package/inputs/textbox/textbox.component.d.ts +4 -1
- package/layout/accordion/accordion.component.d.ts +2 -0
- package/layout/tab-strip/tab-strip.component.d.ts +5 -1
- package/package.json +2 -1
- package/public-api.d.ts +6 -2
- package/schematics/collection.json +9 -0
- package/schematics/ng-add/index.js +64 -0
- package/themes/theme.css +34 -0
- package/views/calendar/calendar.component.d.ts +54 -0
- package/views/public-api.d.ts +2 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { input, output, Component, inject, ElementRef,
|
|
2
|
+
import { input, output, signal, Component, inject, ElementRef, HostListener } from '@angular/core';
|
|
3
3
|
import { CommonModule } from '@angular/common';
|
|
4
4
|
|
|
5
5
|
class ButtonComponent {
|
|
@@ -12,7 +12,16 @@ class ButtonComponent {
|
|
|
12
12
|
prefixIcon = input('');
|
|
13
13
|
suffixIcon = input('');
|
|
14
14
|
ariaLabel = input('');
|
|
15
|
+
// Enterprise features
|
|
16
|
+
ripple = input(true);
|
|
17
|
+
fullWidth = input(false);
|
|
18
|
+
selected = input(false);
|
|
19
|
+
badge = input('');
|
|
20
|
+
badgePosition = input('top-right');
|
|
21
|
+
badgeVariant = input('danger');
|
|
15
22
|
clicked = output();
|
|
23
|
+
ripples = signal([]);
|
|
24
|
+
rippleId = 0;
|
|
16
25
|
btnClass() {
|
|
17
26
|
const parts = [
|
|
18
27
|
`ngx-btn-${this.size()}`,
|
|
@@ -22,27 +31,82 @@ class ButtonComponent {
|
|
|
22
31
|
parts.push(`ngx-btn-${this.shape()}`);
|
|
23
32
|
return parts.join(' ');
|
|
24
33
|
}
|
|
34
|
+
isClassIcon(icon) {
|
|
35
|
+
if (!icon)
|
|
36
|
+
return false;
|
|
37
|
+
const classRegex = /^[a-zA-Z0-9\s-_:]+$/;
|
|
38
|
+
return icon.length > 2 && classRegex.test(icon);
|
|
39
|
+
}
|
|
40
|
+
onButtonClick(event) {
|
|
41
|
+
if (this.disabled() || this.loading())
|
|
42
|
+
return;
|
|
43
|
+
this.clicked.emit(event);
|
|
44
|
+
if (!this.ripple())
|
|
45
|
+
return;
|
|
46
|
+
const button = event.currentTarget;
|
|
47
|
+
const rect = button.getBoundingClientRect();
|
|
48
|
+
const x = event.clientX - rect.left;
|
|
49
|
+
const y = event.clientY - rect.top;
|
|
50
|
+
const id = this.rippleId++;
|
|
51
|
+
this.ripples.update(r => [...r, { x, y, id }]);
|
|
52
|
+
setTimeout(() => {
|
|
53
|
+
this.ripples.update(r => r.filter(item => item.id !== id));
|
|
54
|
+
}, 600);
|
|
55
|
+
}
|
|
25
56
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: ButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
26
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.20", type: ButtonComponent, isStandalone: true, selector: "ngx-button", inputs: { variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, shape: { classPropertyName: "shape", publicName: "shape", isSignal: true, isRequired: false, transformFunction: null }, type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, prefixIcon: { classPropertyName: "prefixIcon", publicName: "prefixIcon", isSignal: true, isRequired: false, transformFunction: null }, suffixIcon: { classPropertyName: "suffixIcon", publicName: "suffixIcon", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { clicked: "clicked" }, ngImport: i0, template: `
|
|
57
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.20", type: ButtonComponent, isStandalone: true, selector: "ngx-button", inputs: { variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, shape: { classPropertyName: "shape", publicName: "shape", isSignal: true, isRequired: false, transformFunction: null }, type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, prefixIcon: { classPropertyName: "prefixIcon", publicName: "prefixIcon", isSignal: true, isRequired: false, transformFunction: null }, suffixIcon: { classPropertyName: "suffixIcon", publicName: "suffixIcon", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, ripple: { classPropertyName: "ripple", publicName: "ripple", isSignal: true, isRequired: false, transformFunction: null }, fullWidth: { classPropertyName: "fullWidth", publicName: "fullWidth", isSignal: true, isRequired: false, transformFunction: null }, selected: { classPropertyName: "selected", publicName: "selected", isSignal: true, isRequired: false, transformFunction: null }, badge: { classPropertyName: "badge", publicName: "badge", isSignal: true, isRequired: false, transformFunction: null }, badgePosition: { classPropertyName: "badgePosition", publicName: "badgePosition", isSignal: true, isRequired: false, transformFunction: null }, badgeVariant: { classPropertyName: "badgeVariant", publicName: "badgeVariant", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { clicked: "clicked" }, ngImport: i0, template: `
|
|
27
58
|
<button
|
|
28
59
|
class="ngx-btn"
|
|
29
60
|
[class]="btnClass()"
|
|
61
|
+
[class.btn-loading]="loading()"
|
|
62
|
+
[class.btn-block]="fullWidth()"
|
|
63
|
+
[class.btn-selected]="selected()"
|
|
30
64
|
[type]="type()"
|
|
31
65
|
[disabled]="disabled() || loading()"
|
|
32
66
|
[attr.aria-label]="ariaLabel() || null"
|
|
33
|
-
|
|
67
|
+
[attr.aria-busy]="loading() ? 'true' : null"
|
|
68
|
+
[attr.aria-disabled]="disabled() || loading() ? 'true' : null"
|
|
69
|
+
(click)="onButtonClick($event)"
|
|
34
70
|
>
|
|
71
|
+
@if (ripple()) {
|
|
72
|
+
<span class="btn-ripple-container" aria-hidden="true">
|
|
73
|
+
@for (r of ripples(); track r.id) {
|
|
74
|
+
<span class="btn-ripple" [style.left.px]="r.x" [style.top.px]="r.y"></span>
|
|
75
|
+
}
|
|
76
|
+
</span>
|
|
77
|
+
}
|
|
78
|
+
|
|
35
79
|
@if (loading()) {
|
|
36
|
-
<span class="btn-spinner" aria-hidden="true"
|
|
37
|
-
|
|
38
|
-
|
|
80
|
+
<span class="btn-spinner-container" aria-hidden="true">
|
|
81
|
+
<span class="btn-spinner"></span>
|
|
82
|
+
</span>
|
|
83
|
+
} @else {
|
|
84
|
+
<ng-content select="[prefix]" />
|
|
85
|
+
@if (prefixIcon()) {
|
|
86
|
+
@if (isClassIcon(prefixIcon())) {
|
|
87
|
+
<span class="btn-icon" [class]="prefixIcon()" aria-hidden="true"></span>
|
|
88
|
+
} @else {
|
|
89
|
+
<span class="btn-icon" aria-hidden="true">{{ prefixIcon() }}</span>
|
|
90
|
+
}
|
|
91
|
+
}
|
|
39
92
|
}
|
|
40
93
|
<span class="btn-text"><ng-content /></span>
|
|
41
94
|
@if (suffixIcon()) {
|
|
42
|
-
|
|
95
|
+
@if (isClassIcon(suffixIcon())) {
|
|
96
|
+
<span class="btn-icon btn-icon-suffix" [class]="suffixIcon()" aria-hidden="true"></span>
|
|
97
|
+
} @else {
|
|
98
|
+
<span class="btn-icon btn-icon-suffix" aria-hidden="true">{{ suffixIcon() }}</span>
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
<ng-content select="[suffix]" />
|
|
102
|
+
|
|
103
|
+
@if (badge()) {
|
|
104
|
+
<span class="btn-badge btn-badge-{{ badgeVariant() }} btn-badge-{{ badgePosition() }}">
|
|
105
|
+
{{ badge() }}
|
|
106
|
+
</span>
|
|
43
107
|
}
|
|
44
108
|
</button>
|
|
45
|
-
`, isInline: true, styles: [":host{display:inline-block}.ngx-btn{display:inline-flex;align-items:center;justify-content:center;gap:6px;font-family:inherit;font-weight:
|
|
109
|
+
`, isInline: true, styles: [":host{display:inline-block;--ngx-btn-focus-ring-bg: #ffffff;position:relative}:host-context(body.dark),:host-context(.dark),:host-context(.dark-theme){--ngx-btn-focus-ring-bg: #0f172a}.ngx-btn{display:inline-flex;align-items:center;justify-content:center;gap:6px;font-family:inherit;font-weight:550;cursor:pointer;background:var(--ngx-btn-bg);color:var(--ngx-btn-color);border:1px solid var(--ngx-btn-border);box-shadow:var(--ngx-btn-shadow);transition:all .25s cubic-bezier(.4,0,.2,1);outline:none;text-decoration:none;white-space:nowrap;position:relative;overflow:visible;-webkit-user-select:none;user-select:none}.ngx-btn:hover:not(:disabled){background:var(--ngx-btn-hover-bg);box-shadow:var(--ngx-btn-hover-shadow);transform:translateY(-2px)}.ngx-btn:active:not(:disabled){background:var(--ngx-btn-active-bg);box-shadow:var(--ngx-btn-active-shadow);transform:translateY(1px) scale(.97)}.ngx-btn:focus-visible{outline:none;box-shadow:0 0 0 2px var(--ngx-btn-focus-ring-bg),0 0 0 4px var(--ngx-btn-focus-ring-color)}.ngx-btn:disabled{opacity:.6;cursor:not-allowed;transform:none!important;box-shadow:none!important}.ngx-btn.btn-block{width:100%;display:flex}.ngx-btn.btn-selected{background:var(--ngx-btn-active-bg)!important;box-shadow:var(--ngx-btn-active-shadow)!important;border-color:currentColor!important}.ngx-btn-sm{font-size:12px;padding:5px 12px;border-radius:var(--ngx-btn-radius, 6px)}.ngx-btn-md{font-size:14px;padding:8px 18px;border-radius:var(--ngx-btn-radius, 8px)}.ngx-btn-lg{font-size:16px;padding:10px 22px;border-radius:var(--ngx-btn-radius, 12px)}.ngx-btn-pill{border-radius:999px!important}.ngx-btn-square{padding-left:0!important;padding-right:0!important;aspect-ratio:1;justify-content:center}.ngx-btn-rounded{border-radius:8px!important}.ngx-btn-primary{--ngx-btn-bg: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%);--ngx-btn-hover-bg: linear-gradient(135deg, #4338ca 0%, #4f46e5 100%);--ngx-btn-active-bg: linear-gradient(135deg, #3730a3 0%, #4338ca 100%);--ngx-btn-color: #ffffff;--ngx-btn-border: transparent;--ngx-btn-shadow: 0 4px 10px rgba(79, 70, 229, .2);--ngx-btn-hover-shadow: 0 6px 16px rgba(79, 70, 229, .3);--ngx-btn-active-shadow: 0 2px 6px rgba(79, 70, 229, .15);--ngx-btn-focus-ring-color: #4f46e5}.ngx-btn-secondary{--ngx-btn-bg: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);--ngx-btn-hover-bg: linear-gradient(135deg, #e2e8f0 0%, #cbd5e1 100%);--ngx-btn-active-bg: linear-gradient(135deg, #cbd5e1 0%, #94a3b8 100%);--ngx-btn-color: #0f172a;--ngx-btn-border: #cbd5e1;--ngx-btn-shadow: 0 2px 4px rgba(0, 0, 0, .05);--ngx-btn-hover-shadow: 0 4px 8px rgba(0, 0, 0, .08);--ngx-btn-active-shadow: 0 1px 3px rgba(0, 0, 0, .04);--ngx-btn-focus-ring-color: #64748b}:host-context(body.dark) .ngx-btn-secondary,:host-context(.dark) .ngx-btn-secondary,:host-context(.dark-theme) .ngx-btn-secondary{--ngx-btn-bg: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);--ngx-btn-hover-bg: linear-gradient(135deg, #334155 0%, #1e293b 100%);--ngx-btn-active-bg: linear-gradient(135deg, #475569 0%, #334155 100%);--ngx-btn-color: #f8fafc;--ngx-btn-border: #334155;--ngx-btn-shadow: 0 2px 4px rgba(0, 0, 0, .2);--ngx-btn-hover-shadow: 0 4px 8px rgba(0, 0, 0, .3);--ngx-btn-active-shadow: 0 1px 3px rgba(0, 0, 0, .15);--ngx-btn-focus-ring-color: #94a3b8}.ngx-btn-danger{--ngx-btn-bg: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);--ngx-btn-hover-bg: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);--ngx-btn-active-bg: linear-gradient(135deg, #b91c1c 0%, #991b1b 100%);--ngx-btn-color: #ffffff;--ngx-btn-border: transparent;--ngx-btn-shadow: 0 4px 10px rgba(239, 68, 68, .2);--ngx-btn-hover-shadow: 0 6px 16px rgba(239, 68, 68, .3);--ngx-btn-active-shadow: 0 2px 6px rgba(239, 68, 68, .15);--ngx-btn-focus-ring-color: #ef4444}.ngx-btn-success{--ngx-btn-bg: linear-gradient(135deg, #10b981 0%, #059669 100%);--ngx-btn-hover-bg: linear-gradient(135deg, #059669 0%, #047857 100%);--ngx-btn-active-bg: linear-gradient(135deg, #047857 0%, #065f46 100%);--ngx-btn-color: #ffffff;--ngx-btn-border: transparent;--ngx-btn-shadow: 0 4px 10px rgba(16, 185, 129, .2);--ngx-btn-hover-shadow: 0 6px 16px rgba(16, 185, 129, .3);--ngx-btn-active-shadow: 0 2px 6px rgba(16, 185, 129, .15);--ngx-btn-focus-ring-color: #10b981}.ngx-btn-warning{--ngx-btn-bg: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);--ngx-btn-hover-bg: linear-gradient(135deg, #d97706 0%, #b45309 100%);--ngx-btn-active-bg: linear-gradient(135deg, #b45309 0%, #92400e 100%);--ngx-btn-color: #ffffff;--ngx-btn-border: transparent;--ngx-btn-shadow: 0 4px 10px rgba(245, 158, 11, .2);--ngx-btn-hover-shadow: 0 6px 16px rgba(245, 158, 11, .3);--ngx-btn-active-shadow: 0 2px 6px rgba(245, 158, 11, .15);--ngx-btn-focus-ring-color: #f59e0b}.ngx-btn-info{--ngx-btn-bg: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);--ngx-btn-hover-bg: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);--ngx-btn-active-bg: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);--ngx-btn-color: #ffffff;--ngx-btn-border: transparent;--ngx-btn-shadow: 0 4px 10px rgba(59, 130, 246, .2);--ngx-btn-hover-shadow: 0 6px 16px rgba(59, 130, 246, .3);--ngx-btn-active-shadow: 0 2px 6px rgba(59, 130, 246, .15);--ngx-btn-focus-ring-color: #3b82f6}.ngx-btn-ghost{--ngx-btn-bg: transparent;--ngx-btn-hover-bg: rgba(79, 70, 229, .08);--ngx-btn-active-bg: rgba(79, 70, 229, .15);--ngx-btn-color: var(--ngx-btn-ghost-color, #4f46e5);--ngx-btn-border: var(--ngx-btn-ghost-border, #4f46e5);--ngx-btn-shadow: none;--ngx-btn-hover-shadow: none;--ngx-btn-active-shadow: none;--ngx-btn-focus-ring-color: #4f46e5}:host-context(body.dark) .ngx-btn-ghost,:host-context(.dark) .ngx-btn-ghost,:host-context(.dark-theme) .ngx-btn-ghost{--ngx-btn-hover-bg: rgba(129, 140, 248, .1);--ngx-btn-active-bg: rgba(129, 140, 248, .2);--ngx-btn-color: #818cf8;--ngx-btn-border: #818cf8;--ngx-btn-focus-ring-color: #818cf8}.ngx-btn-link{--ngx-btn-bg: transparent;--ngx-btn-hover-bg: transparent;--ngx-btn-active-bg: transparent;--ngx-btn-color: var(--ngx-btn-link-color, #4f46e5);--ngx-btn-border: transparent;--ngx-btn-shadow: none;--ngx-btn-hover-shadow: none;--ngx-btn-active-shadow: none;--ngx-btn-focus-ring-color: #4f46e5}.ngx-btn-link:hover:not(:disabled){color:var(--ngx-btn-link-hover, #4338ca);text-decoration:underline;transform:none!important}.ngx-btn-link:active:not(:disabled){transform:scale(.97)!important}:host-context(body.dark) .ngx-btn-link,:host-context(.dark) .ngx-btn-link,:host-context(.dark-theme) .ngx-btn-link{--ngx-btn-color: #818cf8;--ngx-btn-focus-ring-color: #818cf8}.btn-ripple-container{position:absolute;inset:0;overflow:hidden;pointer-events:none;border-radius:inherit}.btn-ripple{position:absolute;border-radius:50%;transform:translate(-50%,-50%) scale(0);width:80px;height:80px;background:currentColor;opacity:.15;pointer-events:none;animation:ripple-effect .6s cubic-bezier(.1,.8,.3,1)}@keyframes ripple-effect{to{transform:translate(-50%,-50%) scale(4);opacity:0}}.btn-badge{display:inline-flex;align-items:center;justify-content:center;font-size:10px;font-weight:700;line-height:1;border-radius:999px;padding:3px 6px;min-width:16px;height:16px;box-sizing:border-box;pointer-events:none}.btn-badge-danger{background:#ef4444;color:#fff}.btn-badge-warning{background:#f59e0b;color:#fff}.btn-badge-success{background:#10b981;color:#fff}.btn-badge-info{background:#3b82f6;color:#fff}.btn-badge-inline{margin-left:6px;flex-shrink:0}.btn-badge-top-right{position:absolute;top:-4px;right:-4px;transform:translate(25%,-25%);border:1.5px solid var(--ngx-btn-focus-ring-bg, #ffffff);box-shadow:0 2px 4px #00000026;z-index:10}.btn-spinner-container{display:inline-flex;align-items:center;justify-content:center;overflow:hidden;width:14px;height:14px;animation:spinner-enter .25s cubic-bezier(.4,0,.2,1) forwards;flex-shrink:0}.btn-spinner{width:14px;height:14px;border:2px solid currentColor;border-top-color:transparent;border-radius:50%;animation:btn-spin .6s linear infinite;flex-shrink:0}@keyframes spinner-enter{0%{width:0;opacity:0;transform:scale(.5)}to{width:14px;opacity:1;transform:scale(1)}}@keyframes btn-spin{to{transform:rotate(360deg)}}.btn-icon{font-size:.9em}\n"] });
|
|
46
110
|
}
|
|
47
111
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: ButtonComponent, decorators: [{
|
|
48
112
|
type: Component,
|
|
@@ -50,22 +114,55 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImpo
|
|
|
50
114
|
<button
|
|
51
115
|
class="ngx-btn"
|
|
52
116
|
[class]="btnClass()"
|
|
117
|
+
[class.btn-loading]="loading()"
|
|
118
|
+
[class.btn-block]="fullWidth()"
|
|
119
|
+
[class.btn-selected]="selected()"
|
|
53
120
|
[type]="type()"
|
|
54
121
|
[disabled]="disabled() || loading()"
|
|
55
122
|
[attr.aria-label]="ariaLabel() || null"
|
|
56
|
-
|
|
123
|
+
[attr.aria-busy]="loading() ? 'true' : null"
|
|
124
|
+
[attr.aria-disabled]="disabled() || loading() ? 'true' : null"
|
|
125
|
+
(click)="onButtonClick($event)"
|
|
57
126
|
>
|
|
127
|
+
@if (ripple()) {
|
|
128
|
+
<span class="btn-ripple-container" aria-hidden="true">
|
|
129
|
+
@for (r of ripples(); track r.id) {
|
|
130
|
+
<span class="btn-ripple" [style.left.px]="r.x" [style.top.px]="r.y"></span>
|
|
131
|
+
}
|
|
132
|
+
</span>
|
|
133
|
+
}
|
|
134
|
+
|
|
58
135
|
@if (loading()) {
|
|
59
|
-
<span class="btn-spinner" aria-hidden="true"
|
|
60
|
-
|
|
61
|
-
|
|
136
|
+
<span class="btn-spinner-container" aria-hidden="true">
|
|
137
|
+
<span class="btn-spinner"></span>
|
|
138
|
+
</span>
|
|
139
|
+
} @else {
|
|
140
|
+
<ng-content select="[prefix]" />
|
|
141
|
+
@if (prefixIcon()) {
|
|
142
|
+
@if (isClassIcon(prefixIcon())) {
|
|
143
|
+
<span class="btn-icon" [class]="prefixIcon()" aria-hidden="true"></span>
|
|
144
|
+
} @else {
|
|
145
|
+
<span class="btn-icon" aria-hidden="true">{{ prefixIcon() }}</span>
|
|
146
|
+
}
|
|
147
|
+
}
|
|
62
148
|
}
|
|
63
149
|
<span class="btn-text"><ng-content /></span>
|
|
64
150
|
@if (suffixIcon()) {
|
|
65
|
-
|
|
151
|
+
@if (isClassIcon(suffixIcon())) {
|
|
152
|
+
<span class="btn-icon btn-icon-suffix" [class]="suffixIcon()" aria-hidden="true"></span>
|
|
153
|
+
} @else {
|
|
154
|
+
<span class="btn-icon btn-icon-suffix" aria-hidden="true">{{ suffixIcon() }}</span>
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
<ng-content select="[suffix]" />
|
|
158
|
+
|
|
159
|
+
@if (badge()) {
|
|
160
|
+
<span class="btn-badge btn-badge-{{ badgeVariant() }} btn-badge-{{ badgePosition() }}">
|
|
161
|
+
{{ badge() }}
|
|
162
|
+
</span>
|
|
66
163
|
}
|
|
67
164
|
</button>
|
|
68
|
-
`, styles: [":host{display:inline-block}.ngx-btn{display:inline-flex;align-items:center;justify-content:center;gap:6px;font-family:inherit;font-weight:
|
|
165
|
+
`, styles: [":host{display:inline-block;--ngx-btn-focus-ring-bg: #ffffff;position:relative}:host-context(body.dark),:host-context(.dark),:host-context(.dark-theme){--ngx-btn-focus-ring-bg: #0f172a}.ngx-btn{display:inline-flex;align-items:center;justify-content:center;gap:6px;font-family:inherit;font-weight:550;cursor:pointer;background:var(--ngx-btn-bg);color:var(--ngx-btn-color);border:1px solid var(--ngx-btn-border);box-shadow:var(--ngx-btn-shadow);transition:all .25s cubic-bezier(.4,0,.2,1);outline:none;text-decoration:none;white-space:nowrap;position:relative;overflow:visible;-webkit-user-select:none;user-select:none}.ngx-btn:hover:not(:disabled){background:var(--ngx-btn-hover-bg);box-shadow:var(--ngx-btn-hover-shadow);transform:translateY(-2px)}.ngx-btn:active:not(:disabled){background:var(--ngx-btn-active-bg);box-shadow:var(--ngx-btn-active-shadow);transform:translateY(1px) scale(.97)}.ngx-btn:focus-visible{outline:none;box-shadow:0 0 0 2px var(--ngx-btn-focus-ring-bg),0 0 0 4px var(--ngx-btn-focus-ring-color)}.ngx-btn:disabled{opacity:.6;cursor:not-allowed;transform:none!important;box-shadow:none!important}.ngx-btn.btn-block{width:100%;display:flex}.ngx-btn.btn-selected{background:var(--ngx-btn-active-bg)!important;box-shadow:var(--ngx-btn-active-shadow)!important;border-color:currentColor!important}.ngx-btn-sm{font-size:12px;padding:5px 12px;border-radius:var(--ngx-btn-radius, 6px)}.ngx-btn-md{font-size:14px;padding:8px 18px;border-radius:var(--ngx-btn-radius, 8px)}.ngx-btn-lg{font-size:16px;padding:10px 22px;border-radius:var(--ngx-btn-radius, 12px)}.ngx-btn-pill{border-radius:999px!important}.ngx-btn-square{padding-left:0!important;padding-right:0!important;aspect-ratio:1;justify-content:center}.ngx-btn-rounded{border-radius:8px!important}.ngx-btn-primary{--ngx-btn-bg: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%);--ngx-btn-hover-bg: linear-gradient(135deg, #4338ca 0%, #4f46e5 100%);--ngx-btn-active-bg: linear-gradient(135deg, #3730a3 0%, #4338ca 100%);--ngx-btn-color: #ffffff;--ngx-btn-border: transparent;--ngx-btn-shadow: 0 4px 10px rgba(79, 70, 229, .2);--ngx-btn-hover-shadow: 0 6px 16px rgba(79, 70, 229, .3);--ngx-btn-active-shadow: 0 2px 6px rgba(79, 70, 229, .15);--ngx-btn-focus-ring-color: #4f46e5}.ngx-btn-secondary{--ngx-btn-bg: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);--ngx-btn-hover-bg: linear-gradient(135deg, #e2e8f0 0%, #cbd5e1 100%);--ngx-btn-active-bg: linear-gradient(135deg, #cbd5e1 0%, #94a3b8 100%);--ngx-btn-color: #0f172a;--ngx-btn-border: #cbd5e1;--ngx-btn-shadow: 0 2px 4px rgba(0, 0, 0, .05);--ngx-btn-hover-shadow: 0 4px 8px rgba(0, 0, 0, .08);--ngx-btn-active-shadow: 0 1px 3px rgba(0, 0, 0, .04);--ngx-btn-focus-ring-color: #64748b}:host-context(body.dark) .ngx-btn-secondary,:host-context(.dark) .ngx-btn-secondary,:host-context(.dark-theme) .ngx-btn-secondary{--ngx-btn-bg: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);--ngx-btn-hover-bg: linear-gradient(135deg, #334155 0%, #1e293b 100%);--ngx-btn-active-bg: linear-gradient(135deg, #475569 0%, #334155 100%);--ngx-btn-color: #f8fafc;--ngx-btn-border: #334155;--ngx-btn-shadow: 0 2px 4px rgba(0, 0, 0, .2);--ngx-btn-hover-shadow: 0 4px 8px rgba(0, 0, 0, .3);--ngx-btn-active-shadow: 0 1px 3px rgba(0, 0, 0, .15);--ngx-btn-focus-ring-color: #94a3b8}.ngx-btn-danger{--ngx-btn-bg: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);--ngx-btn-hover-bg: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);--ngx-btn-active-bg: linear-gradient(135deg, #b91c1c 0%, #991b1b 100%);--ngx-btn-color: #ffffff;--ngx-btn-border: transparent;--ngx-btn-shadow: 0 4px 10px rgba(239, 68, 68, .2);--ngx-btn-hover-shadow: 0 6px 16px rgba(239, 68, 68, .3);--ngx-btn-active-shadow: 0 2px 6px rgba(239, 68, 68, .15);--ngx-btn-focus-ring-color: #ef4444}.ngx-btn-success{--ngx-btn-bg: linear-gradient(135deg, #10b981 0%, #059669 100%);--ngx-btn-hover-bg: linear-gradient(135deg, #059669 0%, #047857 100%);--ngx-btn-active-bg: linear-gradient(135deg, #047857 0%, #065f46 100%);--ngx-btn-color: #ffffff;--ngx-btn-border: transparent;--ngx-btn-shadow: 0 4px 10px rgba(16, 185, 129, .2);--ngx-btn-hover-shadow: 0 6px 16px rgba(16, 185, 129, .3);--ngx-btn-active-shadow: 0 2px 6px rgba(16, 185, 129, .15);--ngx-btn-focus-ring-color: #10b981}.ngx-btn-warning{--ngx-btn-bg: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);--ngx-btn-hover-bg: linear-gradient(135deg, #d97706 0%, #b45309 100%);--ngx-btn-active-bg: linear-gradient(135deg, #b45309 0%, #92400e 100%);--ngx-btn-color: #ffffff;--ngx-btn-border: transparent;--ngx-btn-shadow: 0 4px 10px rgba(245, 158, 11, .2);--ngx-btn-hover-shadow: 0 6px 16px rgba(245, 158, 11, .3);--ngx-btn-active-shadow: 0 2px 6px rgba(245, 158, 11, .15);--ngx-btn-focus-ring-color: #f59e0b}.ngx-btn-info{--ngx-btn-bg: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);--ngx-btn-hover-bg: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);--ngx-btn-active-bg: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);--ngx-btn-color: #ffffff;--ngx-btn-border: transparent;--ngx-btn-shadow: 0 4px 10px rgba(59, 130, 246, .2);--ngx-btn-hover-shadow: 0 6px 16px rgba(59, 130, 246, .3);--ngx-btn-active-shadow: 0 2px 6px rgba(59, 130, 246, .15);--ngx-btn-focus-ring-color: #3b82f6}.ngx-btn-ghost{--ngx-btn-bg: transparent;--ngx-btn-hover-bg: rgba(79, 70, 229, .08);--ngx-btn-active-bg: rgba(79, 70, 229, .15);--ngx-btn-color: var(--ngx-btn-ghost-color, #4f46e5);--ngx-btn-border: var(--ngx-btn-ghost-border, #4f46e5);--ngx-btn-shadow: none;--ngx-btn-hover-shadow: none;--ngx-btn-active-shadow: none;--ngx-btn-focus-ring-color: #4f46e5}:host-context(body.dark) .ngx-btn-ghost,:host-context(.dark) .ngx-btn-ghost,:host-context(.dark-theme) .ngx-btn-ghost{--ngx-btn-hover-bg: rgba(129, 140, 248, .1);--ngx-btn-active-bg: rgba(129, 140, 248, .2);--ngx-btn-color: #818cf8;--ngx-btn-border: #818cf8;--ngx-btn-focus-ring-color: #818cf8}.ngx-btn-link{--ngx-btn-bg: transparent;--ngx-btn-hover-bg: transparent;--ngx-btn-active-bg: transparent;--ngx-btn-color: var(--ngx-btn-link-color, #4f46e5);--ngx-btn-border: transparent;--ngx-btn-shadow: none;--ngx-btn-hover-shadow: none;--ngx-btn-active-shadow: none;--ngx-btn-focus-ring-color: #4f46e5}.ngx-btn-link:hover:not(:disabled){color:var(--ngx-btn-link-hover, #4338ca);text-decoration:underline;transform:none!important}.ngx-btn-link:active:not(:disabled){transform:scale(.97)!important}:host-context(body.dark) .ngx-btn-link,:host-context(.dark) .ngx-btn-link,:host-context(.dark-theme) .ngx-btn-link{--ngx-btn-color: #818cf8;--ngx-btn-focus-ring-color: #818cf8}.btn-ripple-container{position:absolute;inset:0;overflow:hidden;pointer-events:none;border-radius:inherit}.btn-ripple{position:absolute;border-radius:50%;transform:translate(-50%,-50%) scale(0);width:80px;height:80px;background:currentColor;opacity:.15;pointer-events:none;animation:ripple-effect .6s cubic-bezier(.1,.8,.3,1)}@keyframes ripple-effect{to{transform:translate(-50%,-50%) scale(4);opacity:0}}.btn-badge{display:inline-flex;align-items:center;justify-content:center;font-size:10px;font-weight:700;line-height:1;border-radius:999px;padding:3px 6px;min-width:16px;height:16px;box-sizing:border-box;pointer-events:none}.btn-badge-danger{background:#ef4444;color:#fff}.btn-badge-warning{background:#f59e0b;color:#fff}.btn-badge-success{background:#10b981;color:#fff}.btn-badge-info{background:#3b82f6;color:#fff}.btn-badge-inline{margin-left:6px;flex-shrink:0}.btn-badge-top-right{position:absolute;top:-4px;right:-4px;transform:translate(25%,-25%);border:1.5px solid var(--ngx-btn-focus-ring-bg, #ffffff);box-shadow:0 2px 4px #00000026;z-index:10}.btn-spinner-container{display:inline-flex;align-items:center;justify-content:center;overflow:hidden;width:14px;height:14px;animation:spinner-enter .25s cubic-bezier(.4,0,.2,1) forwards;flex-shrink:0}.btn-spinner{width:14px;height:14px;border:2px solid currentColor;border-top-color:transparent;border-radius:50%;animation:btn-spin .6s linear infinite;flex-shrink:0}@keyframes spinner-enter{0%{width:0;opacity:0;transform:scale(.5)}to{width:14px;opacity:1;transform:scale(1)}}@keyframes btn-spin{to{transform:rotate(360deg)}}.btn-icon{font-size:.9em}\n"] }]
|
|
69
166
|
}] });
|
|
70
167
|
|
|
71
168
|
class ButtonGroupComponent {
|
|
@@ -175,47 +272,133 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImpo
|
|
|
175
272
|
|
|
176
273
|
class SplitButtonComponent {
|
|
177
274
|
el = inject(ElementRef);
|
|
275
|
+
uid = 'ngx-sb-' + Math.random().toString(36).substring(2, 9);
|
|
178
276
|
variant = input('primary');
|
|
179
277
|
size = input('md');
|
|
180
278
|
disabled = input(false);
|
|
181
279
|
loading = input(false);
|
|
182
280
|
items = input([]);
|
|
183
281
|
open = signal(false);
|
|
282
|
+
focusedIndex = signal(-1);
|
|
184
283
|
mainClicked = output();
|
|
185
284
|
itemClicked = output();
|
|
186
285
|
toggle() {
|
|
187
286
|
if (this.disabled() || this.loading())
|
|
188
287
|
return;
|
|
189
288
|
this.open.update(v => !v);
|
|
289
|
+
if (this.open()) {
|
|
290
|
+
const items = this.items();
|
|
291
|
+
const firstValid = items.findIndex(item => !item.separator && !item.disabled);
|
|
292
|
+
this.focusedIndex.set(firstValid);
|
|
293
|
+
}
|
|
294
|
+
else {
|
|
295
|
+
this.focusedIndex.set(-1);
|
|
296
|
+
}
|
|
190
297
|
}
|
|
191
298
|
onItemClick(item) {
|
|
192
299
|
if (item.disabled)
|
|
193
300
|
return;
|
|
194
301
|
this.itemClicked.emit(item);
|
|
195
302
|
this.open.set(false);
|
|
303
|
+
this.focusedIndex.set(-1);
|
|
304
|
+
// Return focus to arrow trigger
|
|
305
|
+
setTimeout(() => {
|
|
306
|
+
const arrowBtn = this.el.nativeElement.querySelector('.split-arrow');
|
|
307
|
+
arrowBtn?.focus();
|
|
308
|
+
}, 0);
|
|
309
|
+
}
|
|
310
|
+
handleKeydown(e) {
|
|
311
|
+
if (!this.open())
|
|
312
|
+
return;
|
|
313
|
+
if (e.key === 'Escape') {
|
|
314
|
+
e.preventDefault();
|
|
315
|
+
this.open.set(false);
|
|
316
|
+
this.focusedIndex.set(-1);
|
|
317
|
+
// Return focus to arrow trigger
|
|
318
|
+
const arrowBtn = this.el.nativeElement.querySelector('.split-arrow');
|
|
319
|
+
arrowBtn?.focus();
|
|
320
|
+
return;
|
|
321
|
+
}
|
|
322
|
+
if (e.key === 'ArrowDown') {
|
|
323
|
+
e.preventDefault();
|
|
324
|
+
this.moveFocus(1);
|
|
325
|
+
}
|
|
326
|
+
else if (e.key === 'ArrowUp') {
|
|
327
|
+
e.preventDefault();
|
|
328
|
+
this.moveFocus(-1);
|
|
329
|
+
}
|
|
330
|
+
else if (e.key === 'Enter' || e.key === ' ') {
|
|
331
|
+
e.preventDefault();
|
|
332
|
+
const idx = this.focusedIndex();
|
|
333
|
+
const items = this.items();
|
|
334
|
+
if (idx >= 0 && idx < items.length) {
|
|
335
|
+
const item = items[idx];
|
|
336
|
+
if (!item.disabled && !item.separator) {
|
|
337
|
+
this.onItemClick(item);
|
|
338
|
+
}
|
|
339
|
+
}
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
moveFocus(delta) {
|
|
343
|
+
const items = this.items();
|
|
344
|
+
const n = items.length;
|
|
345
|
+
if (n <= 0)
|
|
346
|
+
return;
|
|
347
|
+
let idx = this.focusedIndex();
|
|
348
|
+
const start = idx;
|
|
349
|
+
do {
|
|
350
|
+
idx += delta;
|
|
351
|
+
if (idx < 0)
|
|
352
|
+
idx = n - 1;
|
|
353
|
+
if (idx >= n)
|
|
354
|
+
idx = 0;
|
|
355
|
+
if (idx === start)
|
|
356
|
+
break;
|
|
357
|
+
} while (items[idx].separator || items[idx].disabled);
|
|
358
|
+
if (!items[idx].separator && !items[idx].disabled) {
|
|
359
|
+
this.focusedIndex.set(idx);
|
|
360
|
+
}
|
|
196
361
|
}
|
|
197
362
|
onDocClick(event) {
|
|
198
363
|
if (!this.el.nativeElement.contains(event.target)) {
|
|
199
|
-
this.open
|
|
364
|
+
if (this.open()) {
|
|
365
|
+
this.open.set(false);
|
|
366
|
+
this.focusedIndex.set(-1);
|
|
367
|
+
}
|
|
200
368
|
}
|
|
201
369
|
}
|
|
202
370
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: SplitButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
203
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.20", type: SplitButtonComponent, isStandalone: true, selector: "ngx-split-button", inputs: { variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, items: { classPropertyName: "items", publicName: "items", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { mainClicked: "mainClicked", itemClicked: "itemClicked" }, host: { listeners: { "document:click": "onDocClick($event)" } }, ngImport: i0, template: `
|
|
371
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.20", type: SplitButtonComponent, isStandalone: true, selector: "ngx-split-button", inputs: { variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, items: { classPropertyName: "items", publicName: "items", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { mainClicked: "mainClicked", itemClicked: "itemClicked" }, host: { listeners: { "keydown": "handleKeydown($event)", "document:click": "onDocClick($event)" } }, ngImport: i0, template: `
|
|
204
372
|
<div class="ngx-split-btn" [class.open]="open()">
|
|
205
373
|
<ngx-button [variant]="variant()" [size]="size()" [disabled]="disabled()" [loading]="loading()" (clicked)="mainClicked.emit($event)">
|
|
206
374
|
<ng-content />
|
|
207
375
|
</ngx-button>
|
|
208
|
-
<button
|
|
376
|
+
<button
|
|
377
|
+
class="split-arrow"
|
|
378
|
+
[class]="'ngx-btn ngx-btn-' + size() + ' ngx-btn-' + variant()"
|
|
379
|
+
[disabled]="disabled()"
|
|
380
|
+
(click)="toggle()"
|
|
381
|
+
aria-haspopup="true"
|
|
382
|
+
[attr.aria-expanded]="open()"
|
|
383
|
+
[id]="uid + '-arrow'"
|
|
384
|
+
>
|
|
209
385
|
<span class="arrow-icon">▾</span>
|
|
210
386
|
</button>
|
|
211
387
|
@if (open()) {
|
|
212
|
-
<ul class="split-menu" role="menu">
|
|
213
|
-
@for (item of items(); track (item.text || item.label || $index)) {
|
|
388
|
+
<ul class="split-menu" role="menu" [attr.aria-labelledby]="uid + '-arrow'">
|
|
389
|
+
@for (item of items(); track (item.text || item.label || $index); let i = $index) {
|
|
214
390
|
@if (item.separator) {
|
|
215
391
|
<li class="split-menu-separator" role="separator"></li>
|
|
216
392
|
} @else {
|
|
217
|
-
<li
|
|
218
|
-
|
|
393
|
+
<li
|
|
394
|
+
class="split-menu-item"
|
|
395
|
+
[class.disabled]="item.disabled"
|
|
396
|
+
[class.focused]="focusedIndex() === i"
|
|
397
|
+
role="menuitem"
|
|
398
|
+
[attr.aria-disabled]="item.disabled"
|
|
399
|
+
(click)="onItemClick(item)"
|
|
400
|
+
(mouseenter)="focusedIndex.set(i)"
|
|
401
|
+
>
|
|
219
402
|
@if (item.icon) { <span class="item-icon">{{ item.icon }}</span> }
|
|
220
403
|
<span>{{ item.text || item.label }}</span>
|
|
221
404
|
</li>
|
|
@@ -224,7 +407,7 @@ class SplitButtonComponent {
|
|
|
224
407
|
</ul>
|
|
225
408
|
}
|
|
226
409
|
</div>
|
|
227
|
-
`, isInline: true, styles: [":host{display:inline-block;position:relative}.ngx-split-btn{display:inline-flex;position:relative}.ngx-split-btn ngx-button :global(.ngx-btn){border-radius:var(--ngx-btn-radius, 4px) 0 0 var(--ngx-btn-radius, 4px)!important;border-right:none}.split-arrow{border-radius:0 var(--ngx-btn-radius, 4px) var(--ngx-btn-radius, 4px) 0!important;padding:0 10px;cursor:pointer;font-family:inherit;border-left:1px solid rgba(255,255,255,.3)}.split-arrow:disabled{opacity:.55;cursor:not-allowed}.split-menu{position:absolute;top:100%;left:0;min-width:100%;margin-top:2px;background:var(--ngx-menu-bg, #fff);border:1px solid var(--ngx-menu-border, #dee2e6);border-radius:6px;box-shadow:0 4px 16px #0000001f;list-style:none;padding:4px 0;z-index:1000}.split-menu-item{display:flex;align-items:center;gap:8px;padding:8px 14px;font-size:13px;cursor:pointer;color:#212529}.split-menu-item:hover:not(.disabled){background:#f1f3f5}.split-menu-item.disabled{color:#adb5bd;cursor:not-allowed}.split-menu-separator{margin:4px 0;height:1px;background:var(--ngx-menu-separator, #dee2e6);list-style:none}.item-icon{font-size:14px}\n"], dependencies: [{ kind: "component", type: ButtonComponent, selector: "ngx-button", inputs: ["variant", "size", "shape", "type", "disabled", "loading", "prefixIcon", "suffixIcon", "ariaLabel"], outputs: ["clicked"] }] });
|
|
410
|
+
`, isInline: true, styles: [":host{display:inline-block;position:relative}.ngx-split-btn{display:inline-flex;position:relative}.ngx-split-btn ngx-button :global(.ngx-btn){border-radius:var(--ngx-btn-radius, 4px) 0 0 var(--ngx-btn-radius, 4px)!important;border-right:none}.split-arrow{border-radius:0 var(--ngx-btn-radius, 4px) var(--ngx-btn-radius, 4px) 0!important;padding:0 10px;cursor:pointer;font-family:inherit;border-left:1px solid rgba(255,255,255,.3);outline:none}.split-arrow:disabled{opacity:.55;cursor:not-allowed}.split-arrow:focus-visible{outline:2px solid var(--primary-color, #4f46e5);outline-offset:-2px;z-index:2}.split-menu{position:absolute;top:100%;left:0;min-width:100%;margin-top:2px;background:var(--ngx-menu-bg, #fff);border:1px solid var(--ngx-menu-border, #dee2e6);border-radius:6px;box-shadow:0 4px 16px #0000001f;list-style:none;padding:4px 0;z-index:1000}.split-menu-item{display:flex;align-items:center;gap:8px;padding:8px 14px;font-size:13px;cursor:pointer;color:#212529}.split-menu-item:hover:not(.disabled),.split-menu-item.focused{background:#f1f3f5}.split-menu-item.disabled{color:#adb5bd;cursor:not-allowed}.split-menu-item.disabled:hover{background:none}.split-menu-separator{margin:4px 0;height:1px;background:var(--ngx-menu-separator, #dee2e6);list-style:none}.item-icon{font-size:14px}\n"], dependencies: [{ kind: "component", type: ButtonComponent, selector: "ngx-button", inputs: ["variant", "size", "shape", "type", "disabled", "loading", "prefixIcon", "suffixIcon", "ariaLabel", "ripple", "fullWidth", "selected", "badge", "badgePosition", "badgeVariant"], outputs: ["clicked"] }] });
|
|
228
411
|
}
|
|
229
412
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: SplitButtonComponent, decorators: [{
|
|
230
413
|
type: Component,
|
|
@@ -233,17 +416,32 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImpo
|
|
|
233
416
|
<ngx-button [variant]="variant()" [size]="size()" [disabled]="disabled()" [loading]="loading()" (clicked)="mainClicked.emit($event)">
|
|
234
417
|
<ng-content />
|
|
235
418
|
</ngx-button>
|
|
236
|
-
<button
|
|
419
|
+
<button
|
|
420
|
+
class="split-arrow"
|
|
421
|
+
[class]="'ngx-btn ngx-btn-' + size() + ' ngx-btn-' + variant()"
|
|
422
|
+
[disabled]="disabled()"
|
|
423
|
+
(click)="toggle()"
|
|
424
|
+
aria-haspopup="true"
|
|
425
|
+
[attr.aria-expanded]="open()"
|
|
426
|
+
[id]="uid + '-arrow'"
|
|
427
|
+
>
|
|
237
428
|
<span class="arrow-icon">▾</span>
|
|
238
429
|
</button>
|
|
239
430
|
@if (open()) {
|
|
240
|
-
<ul class="split-menu" role="menu">
|
|
241
|
-
@for (item of items(); track (item.text || item.label || $index)) {
|
|
431
|
+
<ul class="split-menu" role="menu" [attr.aria-labelledby]="uid + '-arrow'">
|
|
432
|
+
@for (item of items(); track (item.text || item.label || $index); let i = $index) {
|
|
242
433
|
@if (item.separator) {
|
|
243
434
|
<li class="split-menu-separator" role="separator"></li>
|
|
244
435
|
} @else {
|
|
245
|
-
<li
|
|
246
|
-
|
|
436
|
+
<li
|
|
437
|
+
class="split-menu-item"
|
|
438
|
+
[class.disabled]="item.disabled"
|
|
439
|
+
[class.focused]="focusedIndex() === i"
|
|
440
|
+
role="menuitem"
|
|
441
|
+
[attr.aria-disabled]="item.disabled"
|
|
442
|
+
(click)="onItemClick(item)"
|
|
443
|
+
(mouseenter)="focusedIndex.set(i)"
|
|
444
|
+
>
|
|
247
445
|
@if (item.icon) { <span class="item-icon">{{ item.icon }}</span> }
|
|
248
446
|
<span>{{ item.text || item.label }}</span>
|
|
249
447
|
</li>
|
|
@@ -252,8 +450,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImpo
|
|
|
252
450
|
</ul>
|
|
253
451
|
}
|
|
254
452
|
</div>
|
|
255
|
-
`, styles: [":host{display:inline-block;position:relative}.ngx-split-btn{display:inline-flex;position:relative}.ngx-split-btn ngx-button :global(.ngx-btn){border-radius:var(--ngx-btn-radius, 4px) 0 0 var(--ngx-btn-radius, 4px)!important;border-right:none}.split-arrow{border-radius:0 var(--ngx-btn-radius, 4px) var(--ngx-btn-radius, 4px) 0!important;padding:0 10px;cursor:pointer;font-family:inherit;border-left:1px solid rgba(255,255,255,.3)}.split-arrow:disabled{opacity:.55;cursor:not-allowed}.split-menu{position:absolute;top:100%;left:0;min-width:100%;margin-top:2px;background:var(--ngx-menu-bg, #fff);border:1px solid var(--ngx-menu-border, #dee2e6);border-radius:6px;box-shadow:0 4px 16px #0000001f;list-style:none;padding:4px 0;z-index:1000}.split-menu-item{display:flex;align-items:center;gap:8px;padding:8px 14px;font-size:13px;cursor:pointer;color:#212529}.split-menu-item:hover:not(.disabled){background:#f1f3f5}.split-menu-item.disabled{color:#adb5bd;cursor:not-allowed}.split-menu-separator{margin:4px 0;height:1px;background:var(--ngx-menu-separator, #dee2e6);list-style:none}.item-icon{font-size:14px}\n"] }]
|
|
256
|
-
}], propDecorators: {
|
|
453
|
+
`, styles: [":host{display:inline-block;position:relative}.ngx-split-btn{display:inline-flex;position:relative}.ngx-split-btn ngx-button :global(.ngx-btn){border-radius:var(--ngx-btn-radius, 4px) 0 0 var(--ngx-btn-radius, 4px)!important;border-right:none}.split-arrow{border-radius:0 var(--ngx-btn-radius, 4px) var(--ngx-btn-radius, 4px) 0!important;padding:0 10px;cursor:pointer;font-family:inherit;border-left:1px solid rgba(255,255,255,.3);outline:none}.split-arrow:disabled{opacity:.55;cursor:not-allowed}.split-arrow:focus-visible{outline:2px solid var(--primary-color, #4f46e5);outline-offset:-2px;z-index:2}.split-menu{position:absolute;top:100%;left:0;min-width:100%;margin-top:2px;background:var(--ngx-menu-bg, #fff);border:1px solid var(--ngx-menu-border, #dee2e6);border-radius:6px;box-shadow:0 4px 16px #0000001f;list-style:none;padding:4px 0;z-index:1000}.split-menu-item{display:flex;align-items:center;gap:8px;padding:8px 14px;font-size:13px;cursor:pointer;color:#212529}.split-menu-item:hover:not(.disabled),.split-menu-item.focused{background:#f1f3f5}.split-menu-item.disabled{color:#adb5bd;cursor:not-allowed}.split-menu-item.disabled:hover{background:none}.split-menu-separator{margin:4px 0;height:1px;background:var(--ngx-menu-separator, #dee2e6);list-style:none}.item-icon{font-size:14px}\n"] }]
|
|
454
|
+
}], propDecorators: { handleKeydown: [{
|
|
455
|
+
type: HostListener,
|
|
456
|
+
args: ['keydown', ['$event']]
|
|
457
|
+
}], onDocClick: [{
|
|
257
458
|
type: HostListener,
|
|
258
459
|
args: ['document:click', ['$event']]
|
|
259
460
|
}] } });
|
|
@@ -284,7 +485,7 @@ class DropDownButtonComponent {
|
|
|
284
485
|
</ul>
|
|
285
486
|
}
|
|
286
487
|
</div>
|
|
287
|
-
`, isInline: true, styles: [":host{display:inline-block;position:relative}.ngx-dd-btn{display:inline-flex;position:relative}.dd-menu{position:absolute;top:100%;left:0;min-width:160px;margin-top:2px;background:var(--ngx-menu-bg, #fff);border:1px solid var(--ngx-menu-border, #dee2e6);border-radius:6px;box-shadow:0 4px 16px #0000001f;list-style:none;padding:4px 0;z-index:1000}.dd-menu-item{display:flex;align-items:center;gap:8px;padding:8px 14px;font-size:13px;cursor:pointer;color:#212529}.dd-menu-item:hover:not(.disabled){background:#f1f3f5}.dd-menu-item.disabled{color:#adb5bd;cursor:not-allowed}.item-icon{font-size:14px}\n"], dependencies: [{ kind: "component", type: ButtonComponent, selector: "ngx-button", inputs: ["variant", "size", "shape", "type", "disabled", "loading", "prefixIcon", "suffixIcon", "ariaLabel"], outputs: ["clicked"] }] });
|
|
488
|
+
`, isInline: true, styles: [":host{display:inline-block;position:relative}.ngx-dd-btn{display:inline-flex;position:relative}.dd-menu{position:absolute;top:100%;left:0;min-width:160px;margin-top:2px;background:var(--ngx-menu-bg, #fff);border:1px solid var(--ngx-menu-border, #dee2e6);border-radius:6px;box-shadow:0 4px 16px #0000001f;list-style:none;padding:4px 0;z-index:1000}.dd-menu-item{display:flex;align-items:center;gap:8px;padding:8px 14px;font-size:13px;cursor:pointer;color:#212529}.dd-menu-item:hover:not(.disabled){background:#f1f3f5}.dd-menu-item.disabled{color:#adb5bd;cursor:not-allowed}.item-icon{font-size:14px}\n"], dependencies: [{ kind: "component", type: ButtonComponent, selector: "ngx-button", inputs: ["variant", "size", "shape", "type", "disabled", "loading", "prefixIcon", "suffixIcon", "ariaLabel", "ripple", "fullWidth", "selected", "badge", "badgePosition", "badgeVariant"], outputs: ["clicked"] }] });
|
|
288
489
|
}
|
|
289
490
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: DropDownButtonComponent, decorators: [{
|
|
290
491
|
type: Component,
|