ngx-core-components 0.3.15 → 0.3.17
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/buttons/split-button/split-button.component.d.ts +4 -0
- package/charts/area-chart/area-chart.component.d.ts +3 -0
- package/charts/candlestick-chart/candlestick-chart.component.d.ts +3 -0
- package/charts/combo-chart/combo-chart.component.d.ts +2 -0
- package/charts/gauge-chart/gauge-chart.component.d.ts +8 -1
- package/charts/heatmap-chart/heatmap-chart.component.d.ts +1 -0
- package/charts/line-chart/line-chart.component.d.ts +1 -0
- package/charts/pie-chart/pie-chart.component.d.ts +2 -0
- package/charts/radar-chart/radar-chart.component.d.ts +1 -0
- package/charts/radial-bar-chart/radial-bar-chart.component.d.ts +8 -1
- package/charts/sparkline/sparkline.component.d.ts +7 -5
- package/charts/treemap-chart/treemap-chart.component.d.ts +1 -0
- package/charts/waterfall-chart/waterfall-chart.component.d.ts +1 -0
- package/fesm2022/ngx-core-components-buttons.mjs +119 -15
- package/fesm2022/ngx-core-components-buttons.mjs.map +1 -1
- package/fesm2022/ngx-core-components-charts.mjs +1014 -243
- package/fesm2022/ngx-core-components-charts.mjs.map +1 -1
- package/fesm2022/ngx-core-components-inputs.mjs +112 -24
- 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/inputs/dropdown/dropdown.component.d.ts +1 -0
- package/inputs/file-upload/file-upload.component.d.ts +1 -0
- 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/schematics/collection.json +9 -0
- package/schematics/ng-add/index.js +64 -0
- package/themes/theme.css +34 -0
package/README.md
CHANGED
|
@@ -4,6 +4,7 @@ Angular 19 / 20 / 21 standalone component library with enterprise-ready UI build
|
|
|
4
4
|
|
|
5
5
|
[](https://www.npmjs.com/package/ngx-core-components)
|
|
6
6
|
[](LICENSE)
|
|
7
|
+
[](https://stackblitz.com/github/prajaktadube/ngx-core-components?file=projects%2Fdemo%2Fsrc%2Fapp%2Fapp.component.ts)
|
|
7
8
|
|
|
8
9
|
## Features
|
|
9
10
|
|
|
@@ -9,16 +9,20 @@ export interface SplitButtonItem {
|
|
|
9
9
|
}
|
|
10
10
|
export declare class SplitButtonComponent {
|
|
11
11
|
private el;
|
|
12
|
+
uid: string;
|
|
12
13
|
variant: import("@angular/core").InputSignal<ButtonVariant>;
|
|
13
14
|
size: import("@angular/core").InputSignal<ButtonSize>;
|
|
14
15
|
disabled: import("@angular/core").InputSignal<boolean>;
|
|
15
16
|
loading: import("@angular/core").InputSignal<boolean>;
|
|
16
17
|
items: import("@angular/core").InputSignal<SplitButtonItem[]>;
|
|
17
18
|
open: import("@angular/core").WritableSignal<boolean>;
|
|
19
|
+
focusedIndex: import("@angular/core").WritableSignal<number>;
|
|
18
20
|
mainClicked: import("@angular/core").OutputEmitterRef<MouseEvent>;
|
|
19
21
|
itemClicked: import("@angular/core").OutputEmitterRef<SplitButtonItem>;
|
|
20
22
|
toggle(): void;
|
|
21
23
|
onItemClick(item: SplitButtonItem): void;
|
|
24
|
+
handleKeydown(e: KeyboardEvent): void;
|
|
25
|
+
private moveFocus;
|
|
22
26
|
onDocClick(event: MouseEvent): void;
|
|
23
27
|
static ɵfac: i0.ɵɵFactoryDeclaration<SplitButtonComponent, never>;
|
|
24
28
|
static ɵcmp: i0.ɵɵComponentDeclaration<SplitButtonComponent, "ngx-split-button", never, { "variant": { "alias": "variant"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "loading": { "alias": "loading"; "required": false; "isSignal": true; }; "items": { "alias": "items"; "required": false; "isSignal": true; }; }, { "mainClicked": "mainClicked"; "itemClicked": "itemClicked"; }, never, ["*"], true, never>;
|
|
@@ -15,6 +15,7 @@ export declare class AreaChartComponent {
|
|
|
15
15
|
crosshair: import("@angular/core").WritableSignal<{
|
|
16
16
|
x: number;
|
|
17
17
|
} | null>;
|
|
18
|
+
activeCategoryIndex: import("@angular/core").WritableSignal<number | null>;
|
|
18
19
|
tooltip: import("@angular/core").WritableSignal<{
|
|
19
20
|
x: number;
|
|
20
21
|
y: number;
|
|
@@ -28,6 +29,7 @@ export declare class AreaChartComponent {
|
|
|
28
29
|
containerWidth: import("@angular/core").WritableSignal<number>;
|
|
29
30
|
innerW: import("@angular/core").Signal<number>;
|
|
30
31
|
innerH: import("@angular/core").Signal<number>;
|
|
32
|
+
animateState: import("@angular/core").WritableSignal<boolean>;
|
|
31
33
|
constructor();
|
|
32
34
|
private allValues;
|
|
33
35
|
private yMin;
|
|
@@ -39,6 +41,7 @@ export declare class AreaChartComponent {
|
|
|
39
41
|
linePath(s: ChartSeries): string;
|
|
40
42
|
areaPath(s: ChartSeries): string;
|
|
41
43
|
onMouseMove(event: MouseEvent): void;
|
|
44
|
+
onMouseLeave(): void;
|
|
42
45
|
readonly fmtNum: typeof fmtNum;
|
|
43
46
|
static ɵfac: i0.ɵɵFactoryDeclaration<AreaChartComponent, never>;
|
|
44
47
|
static ɵcmp: i0.ɵɵComponentDeclaration<AreaChartComponent, "ngx-area-chart", never, { "series": { "alias": "series"; "required": false; "isSignal": true; }; "categories": { "alias": "categories"; "required": false; "isSignal": true; }; "height": { "alias": "height"; "required": false; "isSignal": true; }; "showGrid": { "alias": "showGrid"; "required": false; "isSignal": true; }; "showMarkers": { "alias": "showMarkers"; "required": false; "isSignal": true; }; "showLegend": { "alias": "showLegend"; "required": false; "isSignal": true; }; "colors": { "alias": "colors"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
@@ -45,9 +45,12 @@ export declare class CandlestickChartComponent {
|
|
|
45
45
|
width: number;
|
|
46
46
|
yHigh: number;
|
|
47
47
|
yLow: number;
|
|
48
|
+
yOpen: number;
|
|
49
|
+
yClose: number;
|
|
48
50
|
y: number;
|
|
49
51
|
rectH: number;
|
|
50
52
|
color: string;
|
|
53
|
+
isBullish: boolean;
|
|
51
54
|
raw: CandlestickItem;
|
|
52
55
|
}[]>;
|
|
53
56
|
onCandleHover(event: MouseEvent, item: CandlestickItem, index: number): void;
|
|
@@ -28,7 +28,9 @@ export declare class ComboChartComponent {
|
|
|
28
28
|
suffix?: string;
|
|
29
29
|
}>;
|
|
30
30
|
} | null>;
|
|
31
|
+
animateState: import("@angular/core").WritableSignal<boolean>;
|
|
31
32
|
private container;
|
|
33
|
+
constructor();
|
|
32
34
|
innerW: import("@angular/core").Signal<number>;
|
|
33
35
|
innerH: import("@angular/core").Signal<number>;
|
|
34
36
|
private leftValues;
|
|
@@ -12,12 +12,19 @@ export declare class GaugeChartComponent {
|
|
|
12
12
|
showNeedle: import("@angular/core").InputSignal<boolean>;
|
|
13
13
|
color: import("@angular/core").InputSignal<string>;
|
|
14
14
|
thresholds: import("@angular/core").InputSignal<GaugeThreshold[]>;
|
|
15
|
+
hovered: import("@angular/core").WritableSignal<boolean>;
|
|
16
|
+
tooltipX: import("@angular/core").WritableSignal<number>;
|
|
17
|
+
tooltipY: import("@angular/core").WritableSignal<number>;
|
|
18
|
+
animateState: import("@angular/core").WritableSignal<boolean>;
|
|
19
|
+
constructor();
|
|
15
20
|
startAngle: import("@angular/core").Signal<180 | 135>;
|
|
16
21
|
endAngle: import("@angular/core").Signal<360 | 405>;
|
|
22
|
+
arcLength: import("@angular/core").Signal<number>;
|
|
23
|
+
progressDashOffset: import("@angular/core").Signal<number>;
|
|
17
24
|
backgroundArcPath: import("@angular/core").Signal<string>;
|
|
18
|
-
progressArcPath: import("@angular/core").Signal<string>;
|
|
19
25
|
needleTransformString: import("@angular/core").Signal<string>;
|
|
20
26
|
gaugeColor: import("@angular/core").Signal<string>;
|
|
27
|
+
onMouseMove(event: MouseEvent): void;
|
|
21
28
|
private polarToCartesian;
|
|
22
29
|
private describeArc;
|
|
23
30
|
static ɵfac: i0.ɵɵFactoryDeclaration<GaugeChartComponent, never>;
|
|
@@ -22,6 +22,7 @@ export declare class LineChartComponent {
|
|
|
22
22
|
crosshair: import("@angular/core").WritableSignal<{
|
|
23
23
|
x: number;
|
|
24
24
|
} | null>;
|
|
25
|
+
activeCategoryIndex: import("@angular/core").WritableSignal<number | null>;
|
|
25
26
|
tooltip: import("@angular/core").WritableSignal<{
|
|
26
27
|
x: number;
|
|
27
28
|
y: number;
|
|
@@ -15,20 +15,27 @@ export declare class RadialBarChartComponent {
|
|
|
15
15
|
colors: import("@angular/core").InputSignal<string[]>;
|
|
16
16
|
hoveredIndex: import("@angular/core").WritableSignal<number | null>;
|
|
17
17
|
tooltip: import("@angular/core").WritableSignal<any>;
|
|
18
|
+
tooltipX: import("@angular/core").WritableSignal<number>;
|
|
19
|
+
tooltipY: import("@angular/core").WritableSignal<number>;
|
|
20
|
+
animateState: import("@angular/core").WritableSignal<boolean>;
|
|
18
21
|
size: import("@angular/core").Signal<number>;
|
|
19
22
|
center: import("@angular/core").Signal<number>;
|
|
23
|
+
constructor();
|
|
20
24
|
computedRings: import("@angular/core").Signal<{
|
|
21
25
|
r: number;
|
|
22
26
|
pct: number;
|
|
23
27
|
color: string;
|
|
24
28
|
dashArray: string;
|
|
29
|
+
circumference: number;
|
|
25
30
|
label: string;
|
|
26
31
|
value: number;
|
|
27
32
|
max: number;
|
|
28
33
|
raw: RadialBarItem;
|
|
29
34
|
}[]>;
|
|
30
35
|
avgPct: import("@angular/core").Signal<number>;
|
|
31
|
-
onRingHover(
|
|
36
|
+
onRingHover(item: RadialBarItem, index: number): void;
|
|
37
|
+
onRingMouseMove(event: MouseEvent): void;
|
|
38
|
+
onMouseLeave(): void;
|
|
32
39
|
readonly fmtNum: typeof fmtNum;
|
|
33
40
|
static ɵfac: i0.ɵɵFactoryDeclaration<RadialBarChartComponent, never>;
|
|
34
41
|
static ɵcmp: i0.ɵɵComponentDeclaration<RadialBarChartComponent, "ngx-radial-bar-chart", never, { "data": { "alias": "data"; "required": false; "isSignal": true; }; "height": { "alias": "height"; "required": false; "isSignal": true; }; "showLegend": { "alias": "showLegend"; "required": false; "isSignal": true; }; "strokeWidth": { "alias": "strokeWidth"; "required": false; "isSignal": true; }; "ringGap": { "alias": "ringGap"; "required": false; "isSignal": true; }; "colors": { "alias": "colors"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
@@ -5,22 +5,24 @@ export declare class SparklineComponent {
|
|
|
5
5
|
color: import("@angular/core").InputSignal<string>;
|
|
6
6
|
width: import("@angular/core").InputSignal<number>;
|
|
7
7
|
height: import("@angular/core").InputSignal<number>;
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
PAD: number;
|
|
9
|
+
w: import("@angular/core").Signal<number>;
|
|
10
|
+
h: import("@angular/core").Signal<number>;
|
|
11
|
+
hoveredIndex: import("@angular/core").WritableSignal<number | null>;
|
|
11
12
|
private yMin;
|
|
12
13
|
private yMax;
|
|
13
|
-
|
|
14
|
+
pts: import("@angular/core").Signal<[number, number][]>;
|
|
14
15
|
linePath: import("@angular/core").Signal<string>;
|
|
15
16
|
areaPath: import("@angular/core").Signal<string>;
|
|
16
|
-
areaFill: import("@angular/core").Signal<string>;
|
|
17
17
|
endPoint: import("@angular/core").Signal<[number, number] | null>;
|
|
18
|
+
activePoint: import("@angular/core").Signal<[number, number] | null>;
|
|
18
19
|
barItems: import("@angular/core").Signal<{
|
|
19
20
|
x: number;
|
|
20
21
|
y: number;
|
|
21
22
|
w: number;
|
|
22
23
|
h: number;
|
|
23
24
|
}[]>;
|
|
25
|
+
onMouseMove(event: MouseEvent): void;
|
|
24
26
|
static ɵfac: i0.ɵɵFactoryDeclaration<SparklineComponent, never>;
|
|
25
27
|
static ɵcmp: i0.ɵɵComponentDeclaration<SparklineComponent, "ngx-sparkline", never, { "data": { "alias": "data"; "required": false; "isSignal": true; }; "type": { "alias": "type"; "required": false; "isSignal": true; }; "color": { "alias": "color"; "required": false; "isSignal": true; }; "width": { "alias": "width"; "required": false; "isSignal": true; }; "height": { "alias": "height"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
26
28
|
}
|
|
@@ -175,47 +175,133 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImpo
|
|
|
175
175
|
|
|
176
176
|
class SplitButtonComponent {
|
|
177
177
|
el = inject(ElementRef);
|
|
178
|
+
uid = 'ngx-sb-' + Math.random().toString(36).substring(2, 9);
|
|
178
179
|
variant = input('primary');
|
|
179
180
|
size = input('md');
|
|
180
181
|
disabled = input(false);
|
|
181
182
|
loading = input(false);
|
|
182
183
|
items = input([]);
|
|
183
184
|
open = signal(false);
|
|
185
|
+
focusedIndex = signal(-1);
|
|
184
186
|
mainClicked = output();
|
|
185
187
|
itemClicked = output();
|
|
186
188
|
toggle() {
|
|
187
189
|
if (this.disabled() || this.loading())
|
|
188
190
|
return;
|
|
189
191
|
this.open.update(v => !v);
|
|
192
|
+
if (this.open()) {
|
|
193
|
+
const items = this.items();
|
|
194
|
+
const firstValid = items.findIndex(item => !item.separator && !item.disabled);
|
|
195
|
+
this.focusedIndex.set(firstValid);
|
|
196
|
+
}
|
|
197
|
+
else {
|
|
198
|
+
this.focusedIndex.set(-1);
|
|
199
|
+
}
|
|
190
200
|
}
|
|
191
201
|
onItemClick(item) {
|
|
192
202
|
if (item.disabled)
|
|
193
203
|
return;
|
|
194
204
|
this.itemClicked.emit(item);
|
|
195
205
|
this.open.set(false);
|
|
206
|
+
this.focusedIndex.set(-1);
|
|
207
|
+
// Return focus to arrow trigger
|
|
208
|
+
setTimeout(() => {
|
|
209
|
+
const arrowBtn = this.el.nativeElement.querySelector('.split-arrow');
|
|
210
|
+
arrowBtn?.focus();
|
|
211
|
+
}, 0);
|
|
212
|
+
}
|
|
213
|
+
handleKeydown(e) {
|
|
214
|
+
if (!this.open())
|
|
215
|
+
return;
|
|
216
|
+
if (e.key === 'Escape') {
|
|
217
|
+
e.preventDefault();
|
|
218
|
+
this.open.set(false);
|
|
219
|
+
this.focusedIndex.set(-1);
|
|
220
|
+
// Return focus to arrow trigger
|
|
221
|
+
const arrowBtn = this.el.nativeElement.querySelector('.split-arrow');
|
|
222
|
+
arrowBtn?.focus();
|
|
223
|
+
return;
|
|
224
|
+
}
|
|
225
|
+
if (e.key === 'ArrowDown') {
|
|
226
|
+
e.preventDefault();
|
|
227
|
+
this.moveFocus(1);
|
|
228
|
+
}
|
|
229
|
+
else if (e.key === 'ArrowUp') {
|
|
230
|
+
e.preventDefault();
|
|
231
|
+
this.moveFocus(-1);
|
|
232
|
+
}
|
|
233
|
+
else if (e.key === 'Enter' || e.key === ' ') {
|
|
234
|
+
e.preventDefault();
|
|
235
|
+
const idx = this.focusedIndex();
|
|
236
|
+
const items = this.items();
|
|
237
|
+
if (idx >= 0 && idx < items.length) {
|
|
238
|
+
const item = items[idx];
|
|
239
|
+
if (!item.disabled && !item.separator) {
|
|
240
|
+
this.onItemClick(item);
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
moveFocus(delta) {
|
|
246
|
+
const items = this.items();
|
|
247
|
+
const n = items.length;
|
|
248
|
+
if (n <= 0)
|
|
249
|
+
return;
|
|
250
|
+
let idx = this.focusedIndex();
|
|
251
|
+
const start = idx;
|
|
252
|
+
do {
|
|
253
|
+
idx += delta;
|
|
254
|
+
if (idx < 0)
|
|
255
|
+
idx = n - 1;
|
|
256
|
+
if (idx >= n)
|
|
257
|
+
idx = 0;
|
|
258
|
+
if (idx === start)
|
|
259
|
+
break;
|
|
260
|
+
} while (items[idx].separator || items[idx].disabled);
|
|
261
|
+
if (!items[idx].separator && !items[idx].disabled) {
|
|
262
|
+
this.focusedIndex.set(idx);
|
|
263
|
+
}
|
|
196
264
|
}
|
|
197
265
|
onDocClick(event) {
|
|
198
266
|
if (!this.el.nativeElement.contains(event.target)) {
|
|
199
|
-
this.open
|
|
267
|
+
if (this.open()) {
|
|
268
|
+
this.open.set(false);
|
|
269
|
+
this.focusedIndex.set(-1);
|
|
270
|
+
}
|
|
200
271
|
}
|
|
201
272
|
}
|
|
202
273
|
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: `
|
|
274
|
+
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
275
|
<div class="ngx-split-btn" [class.open]="open()">
|
|
205
276
|
<ngx-button [variant]="variant()" [size]="size()" [disabled]="disabled()" [loading]="loading()" (clicked)="mainClicked.emit($event)">
|
|
206
277
|
<ng-content />
|
|
207
278
|
</ngx-button>
|
|
208
|
-
<button
|
|
279
|
+
<button
|
|
280
|
+
class="split-arrow"
|
|
281
|
+
[class]="'ngx-btn ngx-btn-' + size() + ' ngx-btn-' + variant()"
|
|
282
|
+
[disabled]="disabled()"
|
|
283
|
+
(click)="toggle()"
|
|
284
|
+
aria-haspopup="true"
|
|
285
|
+
[attr.aria-expanded]="open()"
|
|
286
|
+
[id]="uid + '-arrow'"
|
|
287
|
+
>
|
|
209
288
|
<span class="arrow-icon">▾</span>
|
|
210
289
|
</button>
|
|
211
290
|
@if (open()) {
|
|
212
|
-
<ul class="split-menu" role="menu">
|
|
213
|
-
@for (item of items(); track (item.text || item.label || $index)) {
|
|
291
|
+
<ul class="split-menu" role="menu" [attr.aria-labelledby]="uid + '-arrow'">
|
|
292
|
+
@for (item of items(); track (item.text || item.label || $index); let i = $index) {
|
|
214
293
|
@if (item.separator) {
|
|
215
294
|
<li class="split-menu-separator" role="separator"></li>
|
|
216
295
|
} @else {
|
|
217
|
-
<li
|
|
218
|
-
|
|
296
|
+
<li
|
|
297
|
+
class="split-menu-item"
|
|
298
|
+
[class.disabled]="item.disabled"
|
|
299
|
+
[class.focused]="focusedIndex() === i"
|
|
300
|
+
role="menuitem"
|
|
301
|
+
[attr.aria-disabled]="item.disabled"
|
|
302
|
+
(click)="onItemClick(item)"
|
|
303
|
+
(mouseenter)="focusedIndex.set(i)"
|
|
304
|
+
>
|
|
219
305
|
@if (item.icon) { <span class="item-icon">{{ item.icon }}</span> }
|
|
220
306
|
<span>{{ item.text || item.label }}</span>
|
|
221
307
|
</li>
|
|
@@ -224,7 +310,7 @@ class SplitButtonComponent {
|
|
|
224
310
|
</ul>
|
|
225
311
|
}
|
|
226
312
|
</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"] }] });
|
|
313
|
+
`, 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"], outputs: ["clicked"] }] });
|
|
228
314
|
}
|
|
229
315
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: SplitButtonComponent, decorators: [{
|
|
230
316
|
type: Component,
|
|
@@ -233,17 +319,32 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImpo
|
|
|
233
319
|
<ngx-button [variant]="variant()" [size]="size()" [disabled]="disabled()" [loading]="loading()" (clicked)="mainClicked.emit($event)">
|
|
234
320
|
<ng-content />
|
|
235
321
|
</ngx-button>
|
|
236
|
-
<button
|
|
322
|
+
<button
|
|
323
|
+
class="split-arrow"
|
|
324
|
+
[class]="'ngx-btn ngx-btn-' + size() + ' ngx-btn-' + variant()"
|
|
325
|
+
[disabled]="disabled()"
|
|
326
|
+
(click)="toggle()"
|
|
327
|
+
aria-haspopup="true"
|
|
328
|
+
[attr.aria-expanded]="open()"
|
|
329
|
+
[id]="uid + '-arrow'"
|
|
330
|
+
>
|
|
237
331
|
<span class="arrow-icon">▾</span>
|
|
238
332
|
</button>
|
|
239
333
|
@if (open()) {
|
|
240
|
-
<ul class="split-menu" role="menu">
|
|
241
|
-
@for (item of items(); track (item.text || item.label || $index)) {
|
|
334
|
+
<ul class="split-menu" role="menu" [attr.aria-labelledby]="uid + '-arrow'">
|
|
335
|
+
@for (item of items(); track (item.text || item.label || $index); let i = $index) {
|
|
242
336
|
@if (item.separator) {
|
|
243
337
|
<li class="split-menu-separator" role="separator"></li>
|
|
244
338
|
} @else {
|
|
245
|
-
<li
|
|
246
|
-
|
|
339
|
+
<li
|
|
340
|
+
class="split-menu-item"
|
|
341
|
+
[class.disabled]="item.disabled"
|
|
342
|
+
[class.focused]="focusedIndex() === i"
|
|
343
|
+
role="menuitem"
|
|
344
|
+
[attr.aria-disabled]="item.disabled"
|
|
345
|
+
(click)="onItemClick(item)"
|
|
346
|
+
(mouseenter)="focusedIndex.set(i)"
|
|
347
|
+
>
|
|
247
348
|
@if (item.icon) { <span class="item-icon">{{ item.icon }}</span> }
|
|
248
349
|
<span>{{ item.text || item.label }}</span>
|
|
249
350
|
</li>
|
|
@@ -252,8 +353,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImpo
|
|
|
252
353
|
</ul>
|
|
253
354
|
}
|
|
254
355
|
</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: {
|
|
356
|
+
`, 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"] }]
|
|
357
|
+
}], propDecorators: { handleKeydown: [{
|
|
358
|
+
type: HostListener,
|
|
359
|
+
args: ['keydown', ['$event']]
|
|
360
|
+
}], onDocClick: [{
|
|
257
361
|
type: HostListener,
|
|
258
362
|
args: ['document:click', ['$event']]
|
|
259
363
|
}] } });
|