ngx-core-components 0.3.13 → 0.3.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fesm2022/ngx-core-components-grid.mjs +182 -38
- package/fesm2022/ngx-core-components-grid.mjs.map +1 -1
- package/fesm2022/ngx-core-components-layout.mjs +353 -70
- package/fesm2022/ngx-core-components-layout.mjs.map +1 -1
- package/fesm2022/ngx-core-components-navigation.mjs +170 -18
- package/fesm2022/ngx-core-components-navigation.mjs.map +1 -1
- package/fesm2022/ngx-core-components-views.mjs +521 -123
- package/fesm2022/ngx-core-components-views.mjs.map +1 -1
- package/fesm2022/ngx-core-components.mjs +1 -1
- package/fesm2022/ngx-core-components.mjs.map +1 -1
- package/grid/data-grid/data-grid.component.d.ts +4 -0
- package/layout/accordion/accordion.component.d.ts +17 -1
- package/layout/card/card.component.d.ts +1 -1
- package/layout/public-api.d.ts +2 -2
- package/layout/stepper/stepper.component.d.ts +12 -1
- package/layout/tab-strip/tab-strip.component.d.ts +12 -3
- package/navigation/breadcrumb/breadcrumb.component.d.ts +9 -1
- package/navigation/context-menu/context-menu.component.d.ts +11 -0
- package/package.json +1 -1
- package/public-api.d.ts +1 -1
- package/views/public-api.d.ts +2 -2
- package/views/scheduler/scheduler.component.d.ts +13 -3
- package/views/timeline/timeline.component.d.ts +22 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { input, output, computed, Component, signal, contentChildren, effect,
|
|
2
|
+
import { input, output, computed, Component, signal, viewChild, contentChildren, effect, untracked, inject, TemplateRef, Directive, ChangeDetectionStrategy, model, HostListener } from '@angular/core';
|
|
3
3
|
import * as i1 from '@angular/common';
|
|
4
|
-
import { CommonModule } from '@angular/common';
|
|
4
|
+
import { NgTemplateOutlet, CommonModule } from '@angular/common';
|
|
5
5
|
|
|
6
6
|
class CardComponent {
|
|
7
7
|
title = input('');
|
|
@@ -45,7 +45,7 @@ class CardComponent {
|
|
|
45
45
|
</div>
|
|
46
46
|
<ng-content select="[cardFooter]" />
|
|
47
47
|
</div>
|
|
48
|
-
`, isInline: true, styles: [":host{display:block}.ngx-card{background:var(--ngx-card-bg, #
|
|
48
|
+
`, isInline: true, styles: [":host{display:block}.ngx-card{background:var(--ngx-card-bg, var(--bg-primary, #ffffff));border-radius:var(--ngx-card-radius, 12px);overflow:hidden;font-family:inherit;transition:all .25s cubic-bezier(.4,0,.2,1)}.ngx-card-default{border:1px solid var(--ngx-card-border, var(--border-color, #e2e8f0))}.ngx-card-outlined{border:2px solid var(--ngx-card-border, var(--border-color, #cbd5e1))}.ngx-card-elevated{border:1px solid var(--ngx-card-border, rgba(0, 0, 0, .04));box-shadow:var(--ngx-card-shadow, 0 4px 20px -2px rgba(0, 0, 0, .05), 0 2px 8px -1px rgba(0, 0, 0, .03))}.ngx-card-filled{background:var(--ngx-card-filled-bg, var(--bg-secondary, #f8fafc));border:1px solid transparent}.ngx-card-glass{background:var(--ngx-card-glass-bg, rgba(255, 255, 255, .45));backdrop-filter:blur(16px);-webkit-backdrop-filter:blur(16px);border:1px solid var(--ngx-card-glass-border, rgba(255, 255, 255, .2));box-shadow:var(--ngx-card-glass-shadow, 0 8px 32px 0 rgba(31, 38, 135, .04))}.ngx-card.hoverable{cursor:pointer}.ngx-card.hoverable:hover{box-shadow:var(--ngx-card-hover-shadow, 0 12px 25px -4px rgba(0, 0, 0, .08), 0 4px 12px -2px rgba(0, 0, 0, .05));transform:translateY(-4px) scale(1.01)}.ngx-card.selectable{cursor:pointer}.ngx-card.selected{border-color:var(--ngx-card-selected-border, var(--primary-color, #1a73e8));box-shadow:0 0 0 2px var(--ngx-card-selected-outline, rgba(26, 115, 232, .15))}.card-header{display:flex;align-items:center;gap:10px;padding:20px 20px 0}.card-header-icon{font-size:20px;flex-shrink:0}.card-header-text{flex:1;min-width:0}.card-title{font-size:15px;font-weight:750;color:var(--ngx-card-title-color, var(--text-primary, #0f172a))}.card-subtitle{font-size:12px;color:var(--ngx-card-subtitle-color, var(--text-secondary, #64748b));margin-top:2px;font-weight:500}.card-header-actions{display:flex;align-items:center;gap:6px}.card-image img{width:100%;height:180px;object-fit:cover;display:block}.card-body{padding:var(--ngx-card-padding, 20px);font-size:14px;color:var(--ngx-card-text, var(--text-primary, #334155));line-height:1.6}\n"] });
|
|
49
49
|
}
|
|
50
50
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: CardComponent, decorators: [{
|
|
51
51
|
type: Component,
|
|
@@ -78,7 +78,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImpo
|
|
|
78
78
|
</div>
|
|
79
79
|
<ng-content select="[cardFooter]" />
|
|
80
80
|
</div>
|
|
81
|
-
`, styles: [":host{display:block}.ngx-card{background:var(--ngx-card-bg, #
|
|
81
|
+
`, styles: [":host{display:block}.ngx-card{background:var(--ngx-card-bg, var(--bg-primary, #ffffff));border-radius:var(--ngx-card-radius, 12px);overflow:hidden;font-family:inherit;transition:all .25s cubic-bezier(.4,0,.2,1)}.ngx-card-default{border:1px solid var(--ngx-card-border, var(--border-color, #e2e8f0))}.ngx-card-outlined{border:2px solid var(--ngx-card-border, var(--border-color, #cbd5e1))}.ngx-card-elevated{border:1px solid var(--ngx-card-border, rgba(0, 0, 0, .04));box-shadow:var(--ngx-card-shadow, 0 4px 20px -2px rgba(0, 0, 0, .05), 0 2px 8px -1px rgba(0, 0, 0, .03))}.ngx-card-filled{background:var(--ngx-card-filled-bg, var(--bg-secondary, #f8fafc));border:1px solid transparent}.ngx-card-glass{background:var(--ngx-card-glass-bg, rgba(255, 255, 255, .45));backdrop-filter:blur(16px);-webkit-backdrop-filter:blur(16px);border:1px solid var(--ngx-card-glass-border, rgba(255, 255, 255, .2));box-shadow:var(--ngx-card-glass-shadow, 0 8px 32px 0 rgba(31, 38, 135, .04))}.ngx-card.hoverable{cursor:pointer}.ngx-card.hoverable:hover{box-shadow:var(--ngx-card-hover-shadow, 0 12px 25px -4px rgba(0, 0, 0, .08), 0 4px 12px -2px rgba(0, 0, 0, .05));transform:translateY(-4px) scale(1.01)}.ngx-card.selectable{cursor:pointer}.ngx-card.selected{border-color:var(--ngx-card-selected-border, var(--primary-color, #1a73e8));box-shadow:0 0 0 2px var(--ngx-card-selected-outline, rgba(26, 115, 232, .15))}.card-header{display:flex;align-items:center;gap:10px;padding:20px 20px 0}.card-header-icon{font-size:20px;flex-shrink:0}.card-header-text{flex:1;min-width:0}.card-title{font-size:15px;font-weight:750;color:var(--ngx-card-title-color, var(--text-primary, #0f172a))}.card-subtitle{font-size:12px;color:var(--ngx-card-subtitle-color, var(--text-secondary, #64748b));margin-top:2px;font-weight:500}.card-header-actions{display:flex;align-items:center;gap:6px}.card-image img{width:100%;height:180px;object-fit:cover;display:block}.card-body{padding:var(--ngx-card-padding, 20px);font-size:14px;color:var(--ngx-card-text, var(--text-primary, #334155));line-height:1.6}\n"] }]
|
|
82
82
|
}] });
|
|
83
83
|
|
|
84
84
|
class TabComponent {
|
|
@@ -86,9 +86,11 @@ class TabComponent {
|
|
|
86
86
|
icon = input('');
|
|
87
87
|
disabled = input(false);
|
|
88
88
|
badge = input('');
|
|
89
|
+
closable = input(false);
|
|
89
90
|
isActive = signal(false);
|
|
91
|
+
tabClose = output();
|
|
90
92
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: TabComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
91
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.2.20", type: TabComponent, isStandalone: true, selector: "ngx-tab", inputs: { title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: true, transformFunction: null }, icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, badge: { classPropertyName: "badge", publicName: "badge", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: `
|
|
93
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.2.20", type: TabComponent, isStandalone: true, selector: "ngx-tab", inputs: { title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: true, transformFunction: null }, icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, badge: { classPropertyName: "badge", publicName: "badge", isSignal: true, isRequired: false, transformFunction: null }, closable: { classPropertyName: "closable", publicName: "closable", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { tabClose: "tabClose" }, ngImport: i0, template: `
|
|
92
94
|
<div [hidden]="!isActive()">
|
|
93
95
|
<ng-content />
|
|
94
96
|
</div>
|
|
@@ -110,9 +112,21 @@ class TabStripComponent {
|
|
|
110
112
|
position = input('top');
|
|
111
113
|
activeIndex = signal(0);
|
|
112
114
|
indicatorLeft = signal(0);
|
|
115
|
+
indicatorTop = signal(0);
|
|
113
116
|
indicatorWidth = signal(0);
|
|
117
|
+
indicatorHeight = signal(0);
|
|
118
|
+
tabListEl = viewChild('tabList');
|
|
114
119
|
tabs = contentChildren(TabComponent);
|
|
115
120
|
tabChange = output();
|
|
121
|
+
tabClose = output();
|
|
122
|
+
constructor() {
|
|
123
|
+
effect(() => {
|
|
124
|
+
const idx = this.activeIndex();
|
|
125
|
+
// Track tabs list changes
|
|
126
|
+
const currentTabs = this.tabs();
|
|
127
|
+
this.updateIndicator(idx);
|
|
128
|
+
});
|
|
129
|
+
}
|
|
116
130
|
ngAfterContentInit() {
|
|
117
131
|
this._syncActiveTabs();
|
|
118
132
|
}
|
|
@@ -121,15 +135,43 @@ class TabStripComponent {
|
|
|
121
135
|
this._syncActiveTabs();
|
|
122
136
|
this.tabChange.emit(index);
|
|
123
137
|
}
|
|
138
|
+
closeTab(event, index) {
|
|
139
|
+
event.stopPropagation();
|
|
140
|
+
const tabs = this.tabs();
|
|
141
|
+
const closedTab = tabs[index];
|
|
142
|
+
if (closedTab) {
|
|
143
|
+
closedTab.tabClose.emit();
|
|
144
|
+
}
|
|
145
|
+
this.tabClose.emit(index);
|
|
146
|
+
}
|
|
147
|
+
updateIndicator(index) {
|
|
148
|
+
setTimeout(() => {
|
|
149
|
+
const list = this.tabListEl()?.nativeElement;
|
|
150
|
+
if (!list)
|
|
151
|
+
return;
|
|
152
|
+
const btns = list.querySelectorAll('.tab-btn');
|
|
153
|
+
const activeBtn = btns[index];
|
|
154
|
+
if (activeBtn) {
|
|
155
|
+
this.indicatorLeft.set(activeBtn.offsetLeft);
|
|
156
|
+
this.indicatorTop.set(activeBtn.offsetTop);
|
|
157
|
+
this.indicatorWidth.set(activeBtn.offsetWidth);
|
|
158
|
+
this.indicatorHeight.set(activeBtn.offsetHeight);
|
|
159
|
+
}
|
|
160
|
+
else {
|
|
161
|
+
this.indicatorWidth.set(0);
|
|
162
|
+
this.indicatorHeight.set(0);
|
|
163
|
+
}
|
|
164
|
+
}, 0);
|
|
165
|
+
}
|
|
124
166
|
_syncActiveTabs() {
|
|
125
167
|
const tabs = this.tabs();
|
|
126
168
|
const active = this.activeIndex();
|
|
127
169
|
tabs.forEach((tab, i) => tab.isActive.set(i === active));
|
|
128
170
|
}
|
|
129
171
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: TabStripComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
130
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.20", type: TabStripComponent, isStandalone: true, selector: "ngx-tab-strip", inputs: { position: { classPropertyName: "position", publicName: "position", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { tabChange: "tabChange" }, queries: [{ propertyName: "tabs", predicate: TabComponent, isSignal: true }], ngImport: i0, template: `
|
|
172
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.20", type: TabStripComponent, isStandalone: true, selector: "ngx-tab-strip", inputs: { position: { classPropertyName: "position", publicName: "position", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { tabChange: "tabChange", tabClose: "tabClose" }, queries: [{ propertyName: "tabs", predicate: TabComponent, isSignal: true }], viewQueries: [{ propertyName: "tabListEl", first: true, predicate: ["tabList"], descendants: true, isSignal: true }], ngImport: i0, template: `
|
|
131
173
|
<div class="ngx-tab-strip" [class]="'tabs-' + position()">
|
|
132
|
-
<div class="tab-list" role="tablist">
|
|
174
|
+
<div class="tab-list" #tabList role="tablist">
|
|
133
175
|
@for (tab of tabs(); track tab.title(); let i = $index) {
|
|
134
176
|
<button
|
|
135
177
|
class="tab-btn"
|
|
@@ -143,20 +185,37 @@ class TabStripComponent {
|
|
|
143
185
|
@if (tab.icon()) { <span class="tab-icon" aria-hidden="true">{{ tab.icon() }}</span> }
|
|
144
186
|
<span class="tab-title">{{ tab.title() }}</span>
|
|
145
187
|
@if (tab.badge()) { <span class="tab-badge">{{ tab.badge() }}</span> }
|
|
188
|
+
@if (tab.closable()) {
|
|
189
|
+
<button
|
|
190
|
+
class="tab-close-btn"
|
|
191
|
+
(click)="closeTab($event, i)"
|
|
192
|
+
title="Close Tab"
|
|
193
|
+
type="button"
|
|
194
|
+
>
|
|
195
|
+
×
|
|
196
|
+
</button>
|
|
197
|
+
}
|
|
146
198
|
</button>
|
|
147
199
|
}
|
|
200
|
+
<div
|
|
201
|
+
class="tab-indicator"
|
|
202
|
+
[style.left.px]="indicatorLeft()"
|
|
203
|
+
[style.top.px]="indicatorTop()"
|
|
204
|
+
[style.width.px]="position() === 'top' || position() === 'bottom' ? indicatorWidth() : 3"
|
|
205
|
+
[style.height.px]="position() === 'left' || position() === 'right' ? indicatorHeight() : 3"
|
|
206
|
+
></div>
|
|
148
207
|
</div>
|
|
149
208
|
<div class="tab-content" role="tabpanel">
|
|
150
209
|
<ng-content />
|
|
151
210
|
</div>
|
|
152
211
|
</div>
|
|
153
|
-
`, isInline: true, styles: [":host{display:block}.ngx-tab-strip{display:flex
|
|
212
|
+
`, isInline: true, styles: [":host{display:block}.ngx-tab-strip{display:flex}.ngx-tab-strip.tabs-top{flex-direction:column}.ngx-tab-strip.tabs-bottom{flex-direction:column-reverse}.ngx-tab-strip.tabs-left{flex-direction:row}.ngx-tab-strip.tabs-right{flex-direction:row-reverse}.tab-list{display:flex;position:relative;overflow-x:auto;gap:0;border-color:var(--ngx-tab-border, var(--border-color, #e2e8f0));border-style:solid;border-width:0}.tabs-top .tab-list{border-bottom-width:2px;flex-direction:row}.tabs-bottom .tab-list{border-top-width:2px;flex-direction:row}.tabs-left .tab-list{border-right-width:2px;flex-direction:column;overflow-y:auto;overflow-x:hidden}.tabs-right .tab-list{border-left-width:2px;flex-direction:column;overflow-y:auto;overflow-x:hidden}.tab-btn{display:inline-flex;align-items:center;gap:6px;padding:12px 20px;background:none;border:none;font-size:13px;font-weight:500;color:var(--ngx-tab-color, var(--text-secondary, #64748b));cursor:pointer;font-family:inherit;transition:all .2s ease;white-space:nowrap;position:relative;outline:none;-webkit-user-select:none;user-select:none}.tabs-top .tab-btn{margin-bottom:-2px;border-bottom:2px solid transparent}.tabs-bottom .tab-btn{margin-top:-2px;border-top:2px solid transparent}.tabs-left .tab-btn{margin-right:-2px;border-right:2px solid transparent;text-align:left;justify-content:flex-start;width:100%}.tabs-right .tab-btn{margin-left:-2px;border-left:2px solid transparent;text-align:right;justify-content:flex-end;width:100%}.tab-btn:hover:not(:disabled):not(.active){color:var(--ngx-tab-hover-color, var(--text-primary, #0f172a));background:var(--ngx-tab-hover-bg, var(--bg-secondary, #f8fafc))}.tab-btn.active{color:var(--ngx-tab-active-color, var(--primary-color, #1a73e8));font-weight:600}.tab-btn.disabled{opacity:.45;cursor:not-allowed}.tab-icon{font-size:15px;display:inline-flex;align-items:center}.tab-badge{background:var(--ngx-tab-badge-bg, var(--error-color, #ef4444));color:#fff;font-size:10px;font-weight:700;padding:1px 6px;border-radius:999px;min-width:18px;text-align:center}.tab-close-btn{background:transparent;border:none;font-size:14px;color:var(--text-secondary, #94a3b8);cursor:pointer;display:inline-flex;align-items:center;justify-content:center;width:16px;height:16px;border-radius:50%;margin-left:4px;padding:0;transition:all .15s ease}.tab-close-btn:hover{background:#00000014;color:var(--error-color, #ef4444)}.tab-indicator{position:absolute;background:var(--ngx-tab-active-color, var(--primary-color, #1a73e8));transition:all .25s cubic-bezier(.4,0,.2,1);z-index:2}.tabs-top .tab-indicator{bottom:0}.tabs-bottom .tab-indicator{top:0}.tabs-left .tab-indicator{right:0}.tabs-right .tab-indicator{left:0}.tab-content{flex:1;padding:var(--ngx-tab-content-padding, 20px);min-width:0}\n"] });
|
|
154
213
|
}
|
|
155
214
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: TabStripComponent, decorators: [{
|
|
156
215
|
type: Component,
|
|
157
216
|
args: [{ selector: 'ngx-tab-strip', standalone: true, imports: [], template: `
|
|
158
217
|
<div class="ngx-tab-strip" [class]="'tabs-' + position()">
|
|
159
|
-
<div class="tab-list" role="tablist">
|
|
218
|
+
<div class="tab-list" #tabList role="tablist">
|
|
160
219
|
@for (tab of tabs(); track tab.title(); let i = $index) {
|
|
161
220
|
<button
|
|
162
221
|
class="tab-btn"
|
|
@@ -170,20 +229,89 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImpo
|
|
|
170
229
|
@if (tab.icon()) { <span class="tab-icon" aria-hidden="true">{{ tab.icon() }}</span> }
|
|
171
230
|
<span class="tab-title">{{ tab.title() }}</span>
|
|
172
231
|
@if (tab.badge()) { <span class="tab-badge">{{ tab.badge() }}</span> }
|
|
232
|
+
@if (tab.closable()) {
|
|
233
|
+
<button
|
|
234
|
+
class="tab-close-btn"
|
|
235
|
+
(click)="closeTab($event, i)"
|
|
236
|
+
title="Close Tab"
|
|
237
|
+
type="button"
|
|
238
|
+
>
|
|
239
|
+
×
|
|
240
|
+
</button>
|
|
241
|
+
}
|
|
173
242
|
</button>
|
|
174
243
|
}
|
|
244
|
+
<div
|
|
245
|
+
class="tab-indicator"
|
|
246
|
+
[style.left.px]="indicatorLeft()"
|
|
247
|
+
[style.top.px]="indicatorTop()"
|
|
248
|
+
[style.width.px]="position() === 'top' || position() === 'bottom' ? indicatorWidth() : 3"
|
|
249
|
+
[style.height.px]="position() === 'left' || position() === 'right' ? indicatorHeight() : 3"
|
|
250
|
+
></div>
|
|
175
251
|
</div>
|
|
176
252
|
<div class="tab-content" role="tabpanel">
|
|
177
253
|
<ng-content />
|
|
178
254
|
</div>
|
|
179
255
|
</div>
|
|
180
|
-
`, styles: [":host{display:block}.ngx-tab-strip{display:flex
|
|
181
|
-
}] });
|
|
256
|
+
`, styles: [":host{display:block}.ngx-tab-strip{display:flex}.ngx-tab-strip.tabs-top{flex-direction:column}.ngx-tab-strip.tabs-bottom{flex-direction:column-reverse}.ngx-tab-strip.tabs-left{flex-direction:row}.ngx-tab-strip.tabs-right{flex-direction:row-reverse}.tab-list{display:flex;position:relative;overflow-x:auto;gap:0;border-color:var(--ngx-tab-border, var(--border-color, #e2e8f0));border-style:solid;border-width:0}.tabs-top .tab-list{border-bottom-width:2px;flex-direction:row}.tabs-bottom .tab-list{border-top-width:2px;flex-direction:row}.tabs-left .tab-list{border-right-width:2px;flex-direction:column;overflow-y:auto;overflow-x:hidden}.tabs-right .tab-list{border-left-width:2px;flex-direction:column;overflow-y:auto;overflow-x:hidden}.tab-btn{display:inline-flex;align-items:center;gap:6px;padding:12px 20px;background:none;border:none;font-size:13px;font-weight:500;color:var(--ngx-tab-color, var(--text-secondary, #64748b));cursor:pointer;font-family:inherit;transition:all .2s ease;white-space:nowrap;position:relative;outline:none;-webkit-user-select:none;user-select:none}.tabs-top .tab-btn{margin-bottom:-2px;border-bottom:2px solid transparent}.tabs-bottom .tab-btn{margin-top:-2px;border-top:2px solid transparent}.tabs-left .tab-btn{margin-right:-2px;border-right:2px solid transparent;text-align:left;justify-content:flex-start;width:100%}.tabs-right .tab-btn{margin-left:-2px;border-left:2px solid transparent;text-align:right;justify-content:flex-end;width:100%}.tab-btn:hover:not(:disabled):not(.active){color:var(--ngx-tab-hover-color, var(--text-primary, #0f172a));background:var(--ngx-tab-hover-bg, var(--bg-secondary, #f8fafc))}.tab-btn.active{color:var(--ngx-tab-active-color, var(--primary-color, #1a73e8));font-weight:600}.tab-btn.disabled{opacity:.45;cursor:not-allowed}.tab-icon{font-size:15px;display:inline-flex;align-items:center}.tab-badge{background:var(--ngx-tab-badge-bg, var(--error-color, #ef4444));color:#fff;font-size:10px;font-weight:700;padding:1px 6px;border-radius:999px;min-width:18px;text-align:center}.tab-close-btn{background:transparent;border:none;font-size:14px;color:var(--text-secondary, #94a3b8);cursor:pointer;display:inline-flex;align-items:center;justify-content:center;width:16px;height:16px;border-radius:50%;margin-left:4px;padding:0;transition:all .15s ease}.tab-close-btn:hover{background:#00000014;color:var(--error-color, #ef4444)}.tab-indicator{position:absolute;background:var(--ngx-tab-active-color, var(--primary-color, #1a73e8));transition:all .25s cubic-bezier(.4,0,.2,1);z-index:2}.tabs-top .tab-indicator{bottom:0}.tabs-bottom .tab-indicator{top:0}.tabs-left .tab-indicator{right:0}.tabs-right .tab-indicator{left:0}.tab-content{flex:1;padding:var(--ngx-tab-content-padding, 20px);min-width:0}\n"] }]
|
|
257
|
+
}], ctorParameters: () => [] });
|
|
182
258
|
|
|
259
|
+
class AccordionItemComponent {
|
|
260
|
+
title = input.required();
|
|
261
|
+
icon = input('');
|
|
262
|
+
disabled = input(false);
|
|
263
|
+
expanded = input(false);
|
|
264
|
+
contentTemplate = viewChild('contentTemplate');
|
|
265
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: AccordionItemComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
266
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "19.2.20", type: AccordionItemComponent, isStandalone: true, selector: "ngx-accordion-item", inputs: { title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: true, transformFunction: null }, icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, expanded: { classPropertyName: "expanded", publicName: "expanded", isSignal: true, isRequired: false, transformFunction: null } }, viewQueries: [{ propertyName: "contentTemplate", first: true, predicate: ["contentTemplate"], descendants: true, isSignal: true }], ngImport: i0, template: `
|
|
267
|
+
<ng-template #contentTemplate>
|
|
268
|
+
<ng-content />
|
|
269
|
+
</ng-template>
|
|
270
|
+
`, isInline: true });
|
|
271
|
+
}
|
|
272
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: AccordionItemComponent, decorators: [{
|
|
273
|
+
type: Component,
|
|
274
|
+
args: [{
|
|
275
|
+
selector: 'ngx-accordion-item',
|
|
276
|
+
standalone: true,
|
|
277
|
+
template: `
|
|
278
|
+
<ng-template #contentTemplate>
|
|
279
|
+
<ng-content />
|
|
280
|
+
</ng-template>
|
|
281
|
+
`
|
|
282
|
+
}]
|
|
283
|
+
}] });
|
|
183
284
|
class AccordionComponent {
|
|
184
285
|
items = input([]);
|
|
185
286
|
multi = input(false);
|
|
287
|
+
accordionItems = contentChildren(AccordionItemComponent);
|
|
186
288
|
expanded = signal(new Set());
|
|
289
|
+
constructor() {
|
|
290
|
+
effect(() => {
|
|
291
|
+
const children = this.accordionItems();
|
|
292
|
+
const arrayItems = this.items();
|
|
293
|
+
const current = new Set();
|
|
294
|
+
if (children.length > 0) {
|
|
295
|
+
children.forEach((child, i) => {
|
|
296
|
+
if (child.expanded()) {
|
|
297
|
+
current.add(i);
|
|
298
|
+
}
|
|
299
|
+
});
|
|
300
|
+
}
|
|
301
|
+
else {
|
|
302
|
+
arrayItems.forEach((item, i) => {
|
|
303
|
+
if (item.expanded) {
|
|
304
|
+
current.add(i);
|
|
305
|
+
}
|
|
306
|
+
});
|
|
307
|
+
}
|
|
308
|
+
untracked(() => {
|
|
309
|
+
if (this.expanded().size === 0 && current.size > 0) {
|
|
310
|
+
this.expanded.set(current);
|
|
311
|
+
}
|
|
312
|
+
});
|
|
313
|
+
});
|
|
314
|
+
}
|
|
187
315
|
isExpanded(i) {
|
|
188
316
|
return this.expanded().has(i);
|
|
189
317
|
}
|
|
@@ -193,84 +321,221 @@ class AccordionComponent {
|
|
|
193
321
|
s.delete(i);
|
|
194
322
|
}
|
|
195
323
|
else {
|
|
196
|
-
if (!this.multi())
|
|
324
|
+
if (!this.multi()) {
|
|
197
325
|
s.clear();
|
|
326
|
+
}
|
|
327
|
+
s.add(i);
|
|
328
|
+
}
|
|
329
|
+
this.expanded.set(s);
|
|
330
|
+
}
|
|
331
|
+
expandAll() {
|
|
332
|
+
const total = this.accordionItems().length > 0 ? this.accordionItems().length : this.items().length;
|
|
333
|
+
const s = new Set();
|
|
334
|
+
for (let i = 0; i < total; i++) {
|
|
198
335
|
s.add(i);
|
|
199
336
|
}
|
|
200
337
|
this.expanded.set(s);
|
|
201
338
|
}
|
|
339
|
+
collapseAll() {
|
|
340
|
+
this.expanded.set(new Set());
|
|
341
|
+
}
|
|
342
|
+
expandItem(index) {
|
|
343
|
+
const s = new Set(this.expanded());
|
|
344
|
+
if (!this.multi()) {
|
|
345
|
+
s.clear();
|
|
346
|
+
}
|
|
347
|
+
s.add(index);
|
|
348
|
+
this.expanded.set(s);
|
|
349
|
+
}
|
|
350
|
+
collapseItem(index) {
|
|
351
|
+
const s = new Set(this.expanded());
|
|
352
|
+
s.delete(index);
|
|
353
|
+
this.expanded.set(s);
|
|
354
|
+
}
|
|
202
355
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: AccordionComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
203
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.20", type: AccordionComponent, isStandalone: true, selector: "ngx-accordion", inputs: { items: { classPropertyName: "items", publicName: "items", isSignal: true, isRequired: false, transformFunction: null }, multi: { classPropertyName: "multi", publicName: "multi", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: `
|
|
356
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.20", type: AccordionComponent, isStandalone: true, selector: "ngx-accordion", inputs: { items: { classPropertyName: "items", publicName: "items", isSignal: true, isRequired: false, transformFunction: null }, multi: { classPropertyName: "multi", publicName: "multi", isSignal: true, isRequired: false, transformFunction: null } }, queries: [{ propertyName: "accordionItems", predicate: AccordionItemComponent, isSignal: true }], ngImport: i0, template: `
|
|
204
357
|
<div class="ngx-accordion">
|
|
205
|
-
@
|
|
206
|
-
|
|
207
|
-
<
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
358
|
+
@if (accordionItems().length > 0) {
|
|
359
|
+
@for (child of accordionItems(); track child.title(); let i = $index) {
|
|
360
|
+
<div class="accordion-item" [class.expanded]="isExpanded(i)" [class.disabled]="child.disabled()">
|
|
361
|
+
<button
|
|
362
|
+
class="accordion-header"
|
|
363
|
+
[attr.aria-expanded]="isExpanded(i)"
|
|
364
|
+
[disabled]="child.disabled()"
|
|
365
|
+
(click)="toggle(i)"
|
|
366
|
+
>
|
|
367
|
+
@if (child.icon()) { <span class="acc-icon" aria-hidden="true">{{ child.icon() }}</span> }
|
|
368
|
+
<span class="acc-title">{{ child.title() }}</span>
|
|
369
|
+
<span class="acc-chevron" [class.open]="isExpanded(i)">
|
|
370
|
+
<svg viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" class="chevron-icon">
|
|
371
|
+
<polyline points="9 18 15 12 9 6"></polyline>
|
|
372
|
+
</svg>
|
|
373
|
+
</span>
|
|
374
|
+
</button>
|
|
375
|
+
<div class="accordion-body-wrapper" [class.expanded]="isExpanded(i)">
|
|
376
|
+
<div class="accordion-body" role="region">
|
|
377
|
+
@if (child.contentTemplate()) {
|
|
378
|
+
<ng-container *ngTemplateOutlet="child.contentTemplate()!" />
|
|
379
|
+
}
|
|
380
|
+
</div>
|
|
220
381
|
</div>
|
|
221
|
-
|
|
222
|
-
|
|
382
|
+
</div>
|
|
383
|
+
}
|
|
384
|
+
} @else {
|
|
385
|
+
@for (item of items(); track item.title; let i = $index) {
|
|
386
|
+
<div class="accordion-item" [class.expanded]="isExpanded(i)" [class.disabled]="item.disabled">
|
|
387
|
+
<button
|
|
388
|
+
class="accordion-header"
|
|
389
|
+
[attr.aria-expanded]="isExpanded(i)"
|
|
390
|
+
[disabled]="item.disabled"
|
|
391
|
+
(click)="toggle(i)"
|
|
392
|
+
>
|
|
393
|
+
@if (item.icon) { <span class="acc-icon" aria-hidden="true">{{ item.icon }}</span> }
|
|
394
|
+
<span class="acc-title">{{ item.title }}</span>
|
|
395
|
+
<span class="acc-chevron" [class.open]="isExpanded(i)">
|
|
396
|
+
<svg viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" class="chevron-icon">
|
|
397
|
+
<polyline points="9 18 15 12 9 6"></polyline>
|
|
398
|
+
</svg>
|
|
399
|
+
</span>
|
|
400
|
+
</button>
|
|
401
|
+
<div class="accordion-body-wrapper" [class.expanded]="isExpanded(i)">
|
|
402
|
+
<div class="accordion-body" role="region">
|
|
403
|
+
{{ item.content }}
|
|
404
|
+
</div>
|
|
405
|
+
</div>
|
|
406
|
+
</div>
|
|
407
|
+
}
|
|
223
408
|
}
|
|
224
409
|
</div>
|
|
225
|
-
`, isInline: true, styles: [":host{display:block}.ngx-accordion{border:1px solid var(--ngx-acc-border, #
|
|
410
|
+
`, isInline: true, styles: [":host{display:block}.ngx-accordion{border:1px solid var(--ngx-acc-border, var(--border-color, #e2e8f0));border-radius:var(--ngx-acc-radius, 12px);overflow:hidden;background:var(--ngx-acc-bg, var(--bg-primary, #ffffff));box-shadow:var(--ngx-acc-shadow, 0 4px 6px -1px rgba(0,0,0,.02), 0 2px 4px -1px rgba(0,0,0,.01))}.accordion-item{border-bottom:1px solid var(--ngx-acc-border, var(--border-color, #e2e8f0));transition:all .2s ease}.accordion-item:last-child{border-bottom:none}.accordion-item.disabled{opacity:.5}.accordion-header{display:flex;align-items:center;gap:12px;width:100%;padding:16px 20px;background:var(--ngx-acc-header-bg, var(--bg-primary, #ffffff));border:none;cursor:pointer;font-family:inherit;font-size:14px;font-weight:600;color:var(--ngx-acc-header-color, var(--text-primary, #0f172a));text-align:left;transition:all .2s ease;outline:none}.accordion-header:hover:not(:disabled){background:var(--ngx-acc-header-hover-bg, var(--bg-secondary, #f8fafc));color:var(--ngx-acc-header-hover-color, var(--primary-color, #1a73e8))}.accordion-item.expanded .accordion-header{background:var(--ngx-acc-expanded-bg, var(--bg-primary, #ffffff));color:var(--ngx-acc-expanded-color, var(--primary-color, #1a73e8))}.acc-icon{font-size:16px;flex-shrink:0;display:inline-flex;align-items:center}.acc-title{flex:1}.acc-chevron{display:inline-flex;align-items:center;justify-content:center;color:var(--ngx-acc-chevron-color, var(--text-secondary, #94a3b8));transition:transform .25s cubic-bezier(.4,0,.2,1);flex-shrink:0}.acc-chevron.open{transform:rotate(90deg);color:var(--ngx-acc-chevron-active-color, var(--primary-color, #1a73e8))}.accordion-body-wrapper{max-height:0;opacity:0;overflow:hidden;transition:max-height .3s cubic-bezier(.4,0,.2,1),opacity .25s ease-out;box-sizing:border-box}.accordion-body-wrapper.expanded{max-height:1000px;opacity:1}.accordion-body{padding:16px 20px 20px;font-size:14px;color:var(--ngx-acc-body-color, var(--text-primary, #334155));line-height:1.6;background:var(--ngx-acc-body-bg, var(--bg-primary, #ffffff));border-top:1px solid var(--ngx-acc-border, var(--border-color, #e2e8f0))}\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] });
|
|
226
411
|
}
|
|
227
412
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: AccordionComponent, decorators: [{
|
|
228
413
|
type: Component,
|
|
229
|
-
args: [{ selector: 'ngx-accordion', standalone: true, imports: [
|
|
414
|
+
args: [{ selector: 'ngx-accordion', standalone: true, imports: [NgTemplateOutlet], template: `
|
|
230
415
|
<div class="ngx-accordion">
|
|
231
|
-
@
|
|
232
|
-
|
|
233
|
-
<
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
416
|
+
@if (accordionItems().length > 0) {
|
|
417
|
+
@for (child of accordionItems(); track child.title(); let i = $index) {
|
|
418
|
+
<div class="accordion-item" [class.expanded]="isExpanded(i)" [class.disabled]="child.disabled()">
|
|
419
|
+
<button
|
|
420
|
+
class="accordion-header"
|
|
421
|
+
[attr.aria-expanded]="isExpanded(i)"
|
|
422
|
+
[disabled]="child.disabled()"
|
|
423
|
+
(click)="toggle(i)"
|
|
424
|
+
>
|
|
425
|
+
@if (child.icon()) { <span class="acc-icon" aria-hidden="true">{{ child.icon() }}</span> }
|
|
426
|
+
<span class="acc-title">{{ child.title() }}</span>
|
|
427
|
+
<span class="acc-chevron" [class.open]="isExpanded(i)">
|
|
428
|
+
<svg viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" class="chevron-icon">
|
|
429
|
+
<polyline points="9 18 15 12 9 6"></polyline>
|
|
430
|
+
</svg>
|
|
431
|
+
</span>
|
|
432
|
+
</button>
|
|
433
|
+
<div class="accordion-body-wrapper" [class.expanded]="isExpanded(i)">
|
|
434
|
+
<div class="accordion-body" role="region">
|
|
435
|
+
@if (child.contentTemplate()) {
|
|
436
|
+
<ng-container *ngTemplateOutlet="child.contentTemplate()!" />
|
|
437
|
+
}
|
|
438
|
+
</div>
|
|
246
439
|
</div>
|
|
247
|
-
|
|
248
|
-
|
|
440
|
+
</div>
|
|
441
|
+
}
|
|
442
|
+
} @else {
|
|
443
|
+
@for (item of items(); track item.title; let i = $index) {
|
|
444
|
+
<div class="accordion-item" [class.expanded]="isExpanded(i)" [class.disabled]="item.disabled">
|
|
445
|
+
<button
|
|
446
|
+
class="accordion-header"
|
|
447
|
+
[attr.aria-expanded]="isExpanded(i)"
|
|
448
|
+
[disabled]="item.disabled"
|
|
449
|
+
(click)="toggle(i)"
|
|
450
|
+
>
|
|
451
|
+
@if (item.icon) { <span class="acc-icon" aria-hidden="true">{{ item.icon }}</span> }
|
|
452
|
+
<span class="acc-title">{{ item.title }}</span>
|
|
453
|
+
<span class="acc-chevron" [class.open]="isExpanded(i)">
|
|
454
|
+
<svg viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" class="chevron-icon">
|
|
455
|
+
<polyline points="9 18 15 12 9 6"></polyline>
|
|
456
|
+
</svg>
|
|
457
|
+
</span>
|
|
458
|
+
</button>
|
|
459
|
+
<div class="accordion-body-wrapper" [class.expanded]="isExpanded(i)">
|
|
460
|
+
<div class="accordion-body" role="region">
|
|
461
|
+
{{ item.content }}
|
|
462
|
+
</div>
|
|
463
|
+
</div>
|
|
464
|
+
</div>
|
|
465
|
+
}
|
|
249
466
|
}
|
|
250
467
|
</div>
|
|
251
|
-
`, styles: [":host{display:block}.ngx-accordion{border:1px solid var(--ngx-acc-border, #
|
|
252
|
-
}] });
|
|
468
|
+
`, styles: [":host{display:block}.ngx-accordion{border:1px solid var(--ngx-acc-border, var(--border-color, #e2e8f0));border-radius:var(--ngx-acc-radius, 12px);overflow:hidden;background:var(--ngx-acc-bg, var(--bg-primary, #ffffff));box-shadow:var(--ngx-acc-shadow, 0 4px 6px -1px rgba(0,0,0,.02), 0 2px 4px -1px rgba(0,0,0,.01))}.accordion-item{border-bottom:1px solid var(--ngx-acc-border, var(--border-color, #e2e8f0));transition:all .2s ease}.accordion-item:last-child{border-bottom:none}.accordion-item.disabled{opacity:.5}.accordion-header{display:flex;align-items:center;gap:12px;width:100%;padding:16px 20px;background:var(--ngx-acc-header-bg, var(--bg-primary, #ffffff));border:none;cursor:pointer;font-family:inherit;font-size:14px;font-weight:600;color:var(--ngx-acc-header-color, var(--text-primary, #0f172a));text-align:left;transition:all .2s ease;outline:none}.accordion-header:hover:not(:disabled){background:var(--ngx-acc-header-hover-bg, var(--bg-secondary, #f8fafc));color:var(--ngx-acc-header-hover-color, var(--primary-color, #1a73e8))}.accordion-item.expanded .accordion-header{background:var(--ngx-acc-expanded-bg, var(--bg-primary, #ffffff));color:var(--ngx-acc-expanded-color, var(--primary-color, #1a73e8))}.acc-icon{font-size:16px;flex-shrink:0;display:inline-flex;align-items:center}.acc-title{flex:1}.acc-chevron{display:inline-flex;align-items:center;justify-content:center;color:var(--ngx-acc-chevron-color, var(--text-secondary, #94a3b8));transition:transform .25s cubic-bezier(.4,0,.2,1);flex-shrink:0}.acc-chevron.open{transform:rotate(90deg);color:var(--ngx-acc-chevron-active-color, var(--primary-color, #1a73e8))}.accordion-body-wrapper{max-height:0;opacity:0;overflow:hidden;transition:max-height .3s cubic-bezier(.4,0,.2,1),opacity .25s ease-out;box-sizing:border-box}.accordion-body-wrapper.expanded{max-height:1000px;opacity:1}.accordion-body{padding:16px 20px 20px;font-size:14px;color:var(--ngx-acc-body-color, var(--text-primary, #334155));line-height:1.6;background:var(--ngx-acc-body-bg, var(--bg-primary, #ffffff));border-top:1px solid var(--ngx-acc-border, var(--border-color, #e2e8f0))}\n"] }]
|
|
469
|
+
}], ctorParameters: () => [] });
|
|
253
470
|
|
|
471
|
+
class NgxStepContentDirective {
|
|
472
|
+
stepIndex = input.required({ alias: 'ngxStepContent' });
|
|
473
|
+
templateRef = inject(TemplateRef);
|
|
474
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: NgxStepContentDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
475
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.20", type: NgxStepContentDirective, isStandalone: true, selector: "[ngxStepContent]", inputs: { stepIndex: { classPropertyName: "stepIndex", publicName: "ngxStepContent", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0 });
|
|
476
|
+
}
|
|
477
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: NgxStepContentDirective, decorators: [{
|
|
478
|
+
type: Directive,
|
|
479
|
+
args: [{
|
|
480
|
+
selector: '[ngxStepContent]',
|
|
481
|
+
standalone: true
|
|
482
|
+
}]
|
|
483
|
+
}] });
|
|
254
484
|
class StepperComponent {
|
|
255
485
|
steps = input([]);
|
|
256
486
|
currentStep = signal(0);
|
|
257
487
|
orientation = input('horizontal');
|
|
258
488
|
showContent = input(true);
|
|
259
489
|
showActions = input(true);
|
|
490
|
+
linear = input(true);
|
|
491
|
+
stepTemplates = contentChildren(NgxStepContentDirective);
|
|
260
492
|
stepChange = output();
|
|
261
|
-
next() {
|
|
262
|
-
this.currentStep
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
493
|
+
next() {
|
|
494
|
+
if (this.currentStep() < this.steps().length - 1) {
|
|
495
|
+
this.currentStep.update(v => v + 1);
|
|
496
|
+
this.stepChange.emit(this.currentStep());
|
|
497
|
+
}
|
|
498
|
+
}
|
|
499
|
+
back() {
|
|
500
|
+
if (this.currentStep() > 0) {
|
|
501
|
+
this.currentStep.update(v => v - 1);
|
|
502
|
+
this.stepChange.emit(this.currentStep());
|
|
503
|
+
}
|
|
504
|
+
}
|
|
505
|
+
selectStep(index) {
|
|
506
|
+
if (index === this.currentStep())
|
|
507
|
+
return;
|
|
508
|
+
const step = this.steps()[index];
|
|
509
|
+
if (!step)
|
|
510
|
+
return;
|
|
511
|
+
if (this.linear()) {
|
|
512
|
+
const current = this.currentStep();
|
|
513
|
+
// Allow moving back to any previous step, or moving forward exactly to the next step
|
|
514
|
+
if (index <= current || index === current + 1) {
|
|
515
|
+
this.currentStep.set(index);
|
|
516
|
+
this.stepChange.emit(index);
|
|
517
|
+
}
|
|
518
|
+
}
|
|
519
|
+
else {
|
|
520
|
+
this.currentStep.set(index);
|
|
521
|
+
this.stepChange.emit(index);
|
|
522
|
+
}
|
|
523
|
+
}
|
|
524
|
+
resolveStepTemplate(index) {
|
|
525
|
+
const match = this.stepTemplates().find(t => Number(t.stepIndex()) === index);
|
|
526
|
+
return match ? match.templateRef : null;
|
|
527
|
+
}
|
|
269
528
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: StepperComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
270
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.20", type: StepperComponent, isStandalone: true, selector: "ngx-stepper", inputs: { steps: { classPropertyName: "steps", publicName: "steps", isSignal: true, isRequired: false, transformFunction: null }, orientation: { classPropertyName: "orientation", publicName: "orientation", isSignal: true, isRequired: false, transformFunction: null }, showContent: { classPropertyName: "showContent", publicName: "showContent", isSignal: true, isRequired: false, transformFunction: null }, showActions: { classPropertyName: "showActions", publicName: "showActions", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { stepChange: "stepChange" }, ngImport: i0, template: `
|
|
529
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.20", type: StepperComponent, isStandalone: true, selector: "ngx-stepper", inputs: { steps: { classPropertyName: "steps", publicName: "steps", isSignal: true, isRequired: false, transformFunction: null }, orientation: { classPropertyName: "orientation", publicName: "orientation", isSignal: true, isRequired: false, transformFunction: null }, showContent: { classPropertyName: "showContent", publicName: "showContent", isSignal: true, isRequired: false, transformFunction: null }, showActions: { classPropertyName: "showActions", publicName: "showActions", isSignal: true, isRequired: false, transformFunction: null }, linear: { classPropertyName: "linear", publicName: "linear", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { stepChange: "stepChange" }, queries: [{ propertyName: "stepTemplates", predicate: NgxStepContentDirective, isSignal: true }], ngImport: i0, template: `
|
|
271
530
|
<div class="ngx-stepper" [class.stepper-vertical]="orientation() === 'vertical'">
|
|
272
531
|
@for (step of steps(); track step.label; let i = $index) {
|
|
273
|
-
<div
|
|
532
|
+
<div
|
|
533
|
+
class="stepper-step"
|
|
534
|
+
[class.completed]="i < currentStep()"
|
|
535
|
+
[class.active]="i === currentStep()"
|
|
536
|
+
[class.error]="step.state === 'error'"
|
|
537
|
+
(click)="selectStep(i)"
|
|
538
|
+
>
|
|
274
539
|
<div class="step-header">
|
|
275
540
|
<div class="step-indicator">
|
|
276
541
|
@if (i < currentStep()) {
|
|
@@ -282,7 +547,9 @@ class StepperComponent {
|
|
|
282
547
|
}
|
|
283
548
|
</div>
|
|
284
549
|
@if (i < steps().length - 1) {
|
|
285
|
-
<div class="step-connector"
|
|
550
|
+
<div class="step-connector">
|
|
551
|
+
<div class="step-connector-fill" [class.filled]="i < currentStep()"></div>
|
|
552
|
+
</div>
|
|
286
553
|
}
|
|
287
554
|
</div>
|
|
288
555
|
<div class="step-content">
|
|
@@ -295,7 +562,11 @@ class StepperComponent {
|
|
|
295
562
|
</div>
|
|
296
563
|
@if (showContent()) {
|
|
297
564
|
<div class="stepper-content">
|
|
298
|
-
|
|
565
|
+
@if (resolveStepTemplate(currentStep()); as activeTpl) {
|
|
566
|
+
<ng-container *ngTemplateOutlet="activeTpl" />
|
|
567
|
+
} @else {
|
|
568
|
+
<ng-content />
|
|
569
|
+
}
|
|
299
570
|
</div>
|
|
300
571
|
@if (showActions()) {
|
|
301
572
|
<div class="stepper-actions">
|
|
@@ -306,14 +577,20 @@ class StepperComponent {
|
|
|
306
577
|
</div>
|
|
307
578
|
}
|
|
308
579
|
}
|
|
309
|
-
`, isInline: true, styles: [":host{display:block}.ngx-stepper{display:flex;align-items:flex-start;gap:0}.ngx-stepper.stepper-vertical{flex-direction:column}.stepper-step{display:flex;flex-direction:column;align-items:center;flex:1}.stepper-vertical .stepper-step{flex-direction:row;flex:initial;align-items:flex-start;width:100%}.step-header{display:flex;align-items:center;flex-direction:column;width:100
|
|
580
|
+
`, isInline: true, styles: [":host{display:block}.ngx-stepper{display:flex;align-items:flex-start;gap:0}.ngx-stepper.stepper-vertical{flex-direction:column}.stepper-step{display:flex;flex-direction:column;align-items:center;flex:1;cursor:pointer;-webkit-user-select:none;user-select:none}.stepper-vertical .stepper-step{flex-direction:row;flex:initial;align-items:flex-start;width:100%}.step-header{display:flex;align-items:center;flex-direction:column;width:100%;position:relative}.stepper-vertical .step-header{flex-direction:column;align-items:center;margin-right:14px;flex-shrink:0;width:32px}.step-indicator{width:32px;height:32px;border-radius:50%;display:flex;align-items:center;justify-content:center;background:var(--ngx-stepper-pending-bg, var(--bg-secondary, #f8fafc));color:var(--ngx-stepper-pending-color, var(--text-secondary, #94a3b8));border:2px solid var(--ngx-stepper-pending-border, var(--border-color, #e2e8f0));font-size:13px;font-weight:700;transition:all .25s cubic-bezier(.4,0,.2,1);flex-shrink:0;z-index:1}.active .step-indicator{background:var(--ngx-stepper-active-bg, var(--primary-color, #1a73e8));color:#fff;border-color:var(--ngx-stepper-active-bg, var(--primary-color, #1a73e8));transform:scale(1.1);box-shadow:0 4px 10px #1a73e833}.completed .step-indicator{background:var(--ngx-stepper-complete-bg, var(--success-color, #10b981));color:#fff;border-color:var(--ngx-stepper-complete-bg, var(--success-color, #10b981))}.error .step-indicator{background:var(--ngx-stepper-error-bg, var(--error-color, #ef4444));color:#fff;border-color:var(--ngx-stepper-error-bg, var(--error-color, #ef4444))}.step-check,.step-error-icon{font-size:14px;font-weight:800}.step-connector{flex:1;height:3px;background:var(--ngx-stepper-line, var(--border-color, #e2e8f0));width:100%;margin:16px 0 0;position:absolute;left:calc(50% + 16px);right:calc(-50% + 16px);z-index:0;overflow:hidden}.stepper-vertical .step-connector{width:3px;height:32px;margin:0;position:relative;left:0;top:4px;bottom:4px}.step-connector-fill{position:absolute;top:0;left:0;width:0;height:100%;background:var(--ngx-stepper-complete-bg, var(--success-color, #10b981));transition:width .3s cubic-bezier(.4,0,.2,1)}.stepper-vertical .step-connector-fill{width:100%;height:0;transition:height .3s cubic-bezier(.4,0,.2,1)}.step-connector-fill.filled{width:100%}.stepper-vertical .step-connector-fill.filled{height:100%}.step-content{text-align:center;padding:8px 4px 0}.stepper-vertical .step-content{text-align:left;padding:4px 0 24px}.step-label{font-size:13px;font-weight:600;color:var(--ngx-stepper-label, var(--text-primary, #0f172a));transition:color .2s ease}.active .step-label{color:var(--ngx-stepper-active-bg, var(--primary-color, #1a73e8))}.step-desc{font-size:11px;color:var(--text-secondary, #64748b);margin-top:2px}.step-optional{font-size:10px;color:var(--text-secondary, #94a3b8);font-style:italic;margin-top:2px}.stepper-content{padding:24px;background:var(--bg-secondary, #f8fafc);border-radius:12px;border:1px dashed var(--border-color, #e2e8f0);margin-top:20px;min-height:80px}.stepper-actions{display:flex;gap:10px;margin-top:16px;justify-content:flex-end}.stepper-btn{padding:8px 18px;font-size:13px;font-weight:600;border-radius:8px;cursor:pointer;font-family:inherit;transition:all .2s}.stepper-btn-back{background:var(--bg-primary, #ffffff);color:var(--text-secondary, #475569);border:1px solid var(--border-color, #cbd5e1)}.stepper-btn-back:hover:not(:disabled){background:var(--bg-secondary, #f1f5f9)}.stepper-btn-next{background:var(--primary-color, #1a73e8);color:#fff;border:1px solid var(--primary-color, #1a73e8)}.stepper-btn-next:hover:not(:disabled){background:var(--ngx-btn-primary-hover, #1557b0)}.stepper-btn:disabled{opacity:.45;cursor:not-allowed}\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] });
|
|
310
581
|
}
|
|
311
582
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: StepperComponent, decorators: [{
|
|
312
583
|
type: Component,
|
|
313
|
-
args: [{ selector: 'ngx-stepper', standalone: true, template: `
|
|
584
|
+
args: [{ selector: 'ngx-stepper', standalone: true, imports: [NgTemplateOutlet], template: `
|
|
314
585
|
<div class="ngx-stepper" [class.stepper-vertical]="orientation() === 'vertical'">
|
|
315
586
|
@for (step of steps(); track step.label; let i = $index) {
|
|
316
|
-
<div
|
|
587
|
+
<div
|
|
588
|
+
class="stepper-step"
|
|
589
|
+
[class.completed]="i < currentStep()"
|
|
590
|
+
[class.active]="i === currentStep()"
|
|
591
|
+
[class.error]="step.state === 'error'"
|
|
592
|
+
(click)="selectStep(i)"
|
|
593
|
+
>
|
|
317
594
|
<div class="step-header">
|
|
318
595
|
<div class="step-indicator">
|
|
319
596
|
@if (i < currentStep()) {
|
|
@@ -325,7 +602,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImpo
|
|
|
325
602
|
}
|
|
326
603
|
</div>
|
|
327
604
|
@if (i < steps().length - 1) {
|
|
328
|
-
<div class="step-connector"
|
|
605
|
+
<div class="step-connector">
|
|
606
|
+
<div class="step-connector-fill" [class.filled]="i < currentStep()"></div>
|
|
607
|
+
</div>
|
|
329
608
|
}
|
|
330
609
|
</div>
|
|
331
610
|
<div class="step-content">
|
|
@@ -338,7 +617,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImpo
|
|
|
338
617
|
</div>
|
|
339
618
|
@if (showContent()) {
|
|
340
619
|
<div class="stepper-content">
|
|
341
|
-
|
|
620
|
+
@if (resolveStepTemplate(currentStep()); as activeTpl) {
|
|
621
|
+
<ng-container *ngTemplateOutlet="activeTpl" />
|
|
622
|
+
} @else {
|
|
623
|
+
<ng-content />
|
|
624
|
+
}
|
|
342
625
|
</div>
|
|
343
626
|
@if (showActions()) {
|
|
344
627
|
<div class="stepper-actions">
|
|
@@ -349,7 +632,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImpo
|
|
|
349
632
|
</div>
|
|
350
633
|
}
|
|
351
634
|
}
|
|
352
|
-
`, styles: [":host{display:block}.ngx-stepper{display:flex;align-items:flex-start;gap:0}.ngx-stepper.stepper-vertical{flex-direction:column}.stepper-step{display:flex;flex-direction:column;align-items:center;flex:1}.stepper-vertical .stepper-step{flex-direction:row;flex:initial;align-items:flex-start;width:100%}.step-header{display:flex;align-items:center;flex-direction:column;width:100
|
|
635
|
+
`, styles: [":host{display:block}.ngx-stepper{display:flex;align-items:flex-start;gap:0}.ngx-stepper.stepper-vertical{flex-direction:column}.stepper-step{display:flex;flex-direction:column;align-items:center;flex:1;cursor:pointer;-webkit-user-select:none;user-select:none}.stepper-vertical .stepper-step{flex-direction:row;flex:initial;align-items:flex-start;width:100%}.step-header{display:flex;align-items:center;flex-direction:column;width:100%;position:relative}.stepper-vertical .step-header{flex-direction:column;align-items:center;margin-right:14px;flex-shrink:0;width:32px}.step-indicator{width:32px;height:32px;border-radius:50%;display:flex;align-items:center;justify-content:center;background:var(--ngx-stepper-pending-bg, var(--bg-secondary, #f8fafc));color:var(--ngx-stepper-pending-color, var(--text-secondary, #94a3b8));border:2px solid var(--ngx-stepper-pending-border, var(--border-color, #e2e8f0));font-size:13px;font-weight:700;transition:all .25s cubic-bezier(.4,0,.2,1);flex-shrink:0;z-index:1}.active .step-indicator{background:var(--ngx-stepper-active-bg, var(--primary-color, #1a73e8));color:#fff;border-color:var(--ngx-stepper-active-bg, var(--primary-color, #1a73e8));transform:scale(1.1);box-shadow:0 4px 10px #1a73e833}.completed .step-indicator{background:var(--ngx-stepper-complete-bg, var(--success-color, #10b981));color:#fff;border-color:var(--ngx-stepper-complete-bg, var(--success-color, #10b981))}.error .step-indicator{background:var(--ngx-stepper-error-bg, var(--error-color, #ef4444));color:#fff;border-color:var(--ngx-stepper-error-bg, var(--error-color, #ef4444))}.step-check,.step-error-icon{font-size:14px;font-weight:800}.step-connector{flex:1;height:3px;background:var(--ngx-stepper-line, var(--border-color, #e2e8f0));width:100%;margin:16px 0 0;position:absolute;left:calc(50% + 16px);right:calc(-50% + 16px);z-index:0;overflow:hidden}.stepper-vertical .step-connector{width:3px;height:32px;margin:0;position:relative;left:0;top:4px;bottom:4px}.step-connector-fill{position:absolute;top:0;left:0;width:0;height:100%;background:var(--ngx-stepper-complete-bg, var(--success-color, #10b981));transition:width .3s cubic-bezier(.4,0,.2,1)}.stepper-vertical .step-connector-fill{width:100%;height:0;transition:height .3s cubic-bezier(.4,0,.2,1)}.step-connector-fill.filled{width:100%}.stepper-vertical .step-connector-fill.filled{height:100%}.step-content{text-align:center;padding:8px 4px 0}.stepper-vertical .step-content{text-align:left;padding:4px 0 24px}.step-label{font-size:13px;font-weight:600;color:var(--ngx-stepper-label, var(--text-primary, #0f172a));transition:color .2s ease}.active .step-label{color:var(--ngx-stepper-active-bg, var(--primary-color, #1a73e8))}.step-desc{font-size:11px;color:var(--text-secondary, #64748b);margin-top:2px}.step-optional{font-size:10px;color:var(--text-secondary, #94a3b8);font-style:italic;margin-top:2px}.stepper-content{padding:24px;background:var(--bg-secondary, #f8fafc);border-radius:12px;border:1px dashed var(--border-color, #e2e8f0);margin-top:20px;min-height:80px}.stepper-actions{display:flex;gap:10px;margin-top:16px;justify-content:flex-end}.stepper-btn{padding:8px 18px;font-size:13px;font-weight:600;border-radius:8px;cursor:pointer;font-family:inherit;transition:all .2s}.stepper-btn-back{background:var(--bg-primary, #ffffff);color:var(--text-secondary, #475569);border:1px solid var(--border-color, #cbd5e1)}.stepper-btn-back:hover:not(:disabled){background:var(--bg-secondary, #f1f5f9)}.stepper-btn-next{background:var(--primary-color, #1a73e8);color:#fff;border:1px solid var(--primary-color, #1a73e8)}.stepper-btn-next:hover:not(:disabled){background:var(--ngx-btn-primary-hover, #1557b0)}.stepper-btn:disabled{opacity:.45;cursor:not-allowed}\n"] }]
|
|
353
636
|
}] });
|
|
354
637
|
|
|
355
638
|
class SplitterComponent {
|
|
@@ -1381,5 +1664,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImpo
|
|
|
1381
1664
|
* Generated bundle index. Do not edit.
|
|
1382
1665
|
*/
|
|
1383
1666
|
|
|
1384
|
-
export { AccordionComponent, CardComponent, CarouselComponent, DashboardLayoutComponent, DrawerComponent, SplitterComponent, StepperComponent, TabComponent, TabStripComponent };
|
|
1667
|
+
export { AccordionComponent, AccordionItemComponent, CardComponent, CarouselComponent, DashboardLayoutComponent, DrawerComponent, NgxStepContentDirective, SplitterComponent, StepperComponent, TabComponent, TabStripComponent };
|
|
1385
1668
|
//# sourceMappingURL=ngx-core-components-layout.mjs.map
|