primeng 17.8.0 → 17.10.0
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/api/primeicons.d.ts +5 -5
- package/api/translation.d.ts +1 -0
- package/api/translationkeys.d.ts +1 -0
- package/buttongroup/buttongroup.d.ts +11 -0
- package/buttongroup/index.d.ts +5 -0
- package/buttongroup/public_api.d.ts +1 -0
- package/colorpicker/colorpicker.d.ts +1 -0
- package/esm2022/api/primeicons.mjs +6 -6
- package/esm2022/api/primengconfig.mjs +3 -2
- package/esm2022/api/translation.mjs +1 -1
- package/esm2022/api/translationkeys.mjs +2 -1
- package/esm2022/autocomplete/autocomplete.mjs +11 -11
- package/esm2022/buttongroup/buttongroup.mjs +38 -0
- package/esm2022/buttongroup/primeng-buttongroup.mjs +5 -0
- package/esm2022/buttongroup/public_api.mjs +2 -0
- package/esm2022/calendar/calendar.mjs +9 -9
- package/esm2022/cascadeselect/cascadeselect.mjs +7 -7
- package/esm2022/colorpicker/colorpicker.mjs +7 -1
- package/esm2022/dialog/dialog.mjs +4 -2
- package/esm2022/dropdown/dropdown.mjs +15 -13
- package/esm2022/floatlabel/floatlabel.mjs +44 -0
- package/esm2022/floatlabel/primeng-floatlabel.mjs +5 -0
- package/esm2022/floatlabel/public_api.mjs +2 -0
- package/esm2022/iconfield/iconfield.mjs +44 -0
- package/esm2022/iconfield/primeng-iconfield.mjs +5 -0
- package/esm2022/iconfield/public_api.mjs +2 -0
- package/esm2022/inputicon/inputicon.mjs +38 -0
- package/esm2022/inputicon/primeng-inputicon.mjs +5 -0
- package/esm2022/inputicon/public_api.mjs +2 -0
- package/esm2022/inputnumber/inputnumber.interface.mjs +1 -1
- package/esm2022/inputnumber/inputnumber.mjs +27 -12
- package/esm2022/metergroup/metergroup.interface.mjs +2 -0
- package/esm2022/metergroup/metergroup.mjs +277 -0
- package/esm2022/metergroup/primeng-metergroup.mjs +5 -0
- package/esm2022/metergroup/public_api.mjs +3 -0
- package/esm2022/multiselect/multiselect.mjs +7 -7
- package/esm2022/password/password.mjs +3 -3
- package/esm2022/selectbutton/selectbutton.mjs +2 -2
- package/esm2022/table/table.mjs +27 -15
- package/esm2022/tabmenu/tabmenu.mjs +11 -3
- package/esm2022/togglebutton/togglebutton.mjs +2 -2
- package/esm2022/tree/tree.mjs +14 -7
- package/esm2022/treeselect/treeselect.mjs +9 -9
- package/esm2022/treetable/treetable.mjs +2 -2
- package/esm2022/utils/objectutils.mjs +2 -2
- package/fesm2022/primeng-api.mjs +8 -6
- package/fesm2022/primeng-api.mjs.map +1 -1
- package/fesm2022/primeng-autocomplete.mjs +10 -10
- package/fesm2022/primeng-autocomplete.mjs.map +1 -1
- package/fesm2022/primeng-buttongroup.mjs +45 -0
- package/fesm2022/primeng-buttongroup.mjs.map +1 -0
- package/fesm2022/primeng-calendar.mjs +8 -8
- package/fesm2022/primeng-calendar.mjs.map +1 -1
- package/fesm2022/primeng-cascadeselect.mjs +6 -6
- package/fesm2022/primeng-cascadeselect.mjs.map +1 -1
- package/fesm2022/primeng-colorpicker.mjs +7 -1
- package/fesm2022/primeng-colorpicker.mjs.map +1 -1
- package/fesm2022/primeng-dialog.mjs +3 -1
- package/fesm2022/primeng-dialog.mjs.map +1 -1
- package/fesm2022/primeng-dropdown.mjs +14 -12
- package/fesm2022/primeng-dropdown.mjs.map +1 -1
- package/fesm2022/primeng-floatlabel.mjs +51 -0
- package/fesm2022/primeng-floatlabel.mjs.map +1 -0
- package/fesm2022/primeng-iconfield.mjs +51 -0
- package/fesm2022/primeng-iconfield.mjs.map +1 -0
- package/fesm2022/primeng-inputicon.mjs +45 -0
- package/fesm2022/primeng-inputicon.mjs.map +1 -0
- package/fesm2022/primeng-inputnumber.mjs +26 -11
- package/fesm2022/primeng-inputnumber.mjs.map +1 -1
- package/fesm2022/primeng-metergroup.mjs +284 -0
- package/fesm2022/primeng-metergroup.mjs.map +1 -0
- package/fesm2022/primeng-multiselect.mjs +6 -6
- package/fesm2022/primeng-multiselect.mjs.map +1 -1
- package/fesm2022/primeng-password.mjs +2 -2
- package/fesm2022/primeng-password.mjs.map +1 -1
- package/fesm2022/primeng-selectbutton.mjs +2 -2
- package/fesm2022/primeng-selectbutton.mjs.map +1 -1
- package/fesm2022/primeng-table.mjs +26 -14
- package/fesm2022/primeng-table.mjs.map +1 -1
- package/fesm2022/primeng-tabmenu.mjs +10 -2
- package/fesm2022/primeng-tabmenu.mjs.map +1 -1
- package/fesm2022/primeng-togglebutton.mjs +2 -2
- package/fesm2022/primeng-togglebutton.mjs.map +1 -1
- package/fesm2022/primeng-tree.mjs +13 -6
- package/fesm2022/primeng-tree.mjs.map +1 -1
- package/fesm2022/primeng-treeselect.mjs +8 -8
- package/fesm2022/primeng-treeselect.mjs.map +1 -1
- package/fesm2022/primeng-treetable.mjs +1 -1
- package/fesm2022/primeng-treetable.mjs.map +1 -1
- package/fesm2022/primeng-utils.mjs +1 -1
- package/fesm2022/primeng-utils.mjs.map +1 -1
- package/floatlabel/floatlabel.d.ts +17 -0
- package/floatlabel/index.d.ts +5 -0
- package/floatlabel/public_api.d.ts +1 -0
- package/iconfield/iconfield.d.ts +25 -0
- package/iconfield/index.d.ts +5 -0
- package/iconfield/public_api.d.ts +1 -0
- package/inputicon/index.d.ts +5 -0
- package/inputicon/inputicon.d.ts +21 -0
- package/inputicon/public_api.d.ts +1 -0
- package/inputnumber/inputnumber.d.ts +3 -2
- package/inputnumber/inputnumber.interface.d.ts +1 -1
- package/metergroup/index.d.ts +5 -0
- package/metergroup/metergroup.d.ts +101 -0
- package/metergroup/metergroup.interface.d.ts +106 -0
- package/metergroup/public_api.d.ts +2 -0
- package/package.json +103 -73
- package/resources/components/button/button.css +32 -9
- package/resources/components/iconfield/iconfield.css +5 -0
- package/resources/components/inputicon/inputicon.css +6 -0
- package/resources/primeng.css +32 -9
- package/resources/primeng.min.css +1 -1
- package/resources/themes/arya-blue/theme.css +129 -0
- package/resources/themes/arya-green/theme.css +129 -0
- package/resources/themes/arya-orange/theme.css +129 -0
- package/resources/themes/arya-purple/theme.css +129 -0
- package/resources/themes/bootstrap4-dark-blue/theme.css +129 -0
- package/resources/themes/bootstrap4-dark-purple/theme.css +129 -0
- package/resources/themes/bootstrap4-light-blue/theme.css +129 -0
- package/resources/themes/bootstrap4-light-purple/theme.css +129 -0
- package/resources/themes/fluent-light/theme.css +129 -0
- package/resources/themes/lara-dark-blue/theme.css +129 -0
- package/resources/themes/lara-dark-indigo/theme.css +129 -0
- package/resources/themes/lara-dark-purple/theme.css +129 -0
- package/resources/themes/lara-dark-teal/theme.css +129 -0
- package/resources/themes/lara-light-blue/theme.css +129 -0
- package/resources/themes/lara-light-indigo/theme.css +129 -0
- package/resources/themes/lara-light-purple/theme.css +129 -0
- package/resources/themes/lara-light-teal/theme.css +129 -0
- package/resources/themes/luna-amber/theme.css +129 -0
- package/resources/themes/luna-blue/theme.css +129 -0
- package/resources/themes/luna-green/theme.css +129 -0
- package/resources/themes/luna-pink/theme.css +129 -0
- package/resources/themes/md-dark-deeppurple/theme.css +129 -0
- package/resources/themes/md-dark-indigo/theme.css +129 -0
- package/resources/themes/md-light-deeppurple/theme.css +129 -0
- package/resources/themes/md-light-indigo/theme.css +129 -0
- package/resources/themes/mdc-dark-deeppurple/theme.css +129 -0
- package/resources/themes/mdc-dark-indigo/theme.css +129 -0
- package/resources/themes/mdc-light-deeppurple/theme.css +129 -0
- package/resources/themes/mdc-light-indigo/theme.css +129 -0
- package/resources/themes/mira/theme.css +129 -0
- package/resources/themes/nano/theme.css +129 -0
- package/resources/themes/nova/theme.css +129 -0
- package/resources/themes/nova-accent/theme.css +129 -0
- package/resources/themes/nova-alt/theme.css +129 -0
- package/resources/themes/rhea/theme.css +129 -0
- package/resources/themes/saga-blue/theme.css +129 -0
- package/resources/themes/saga-green/theme.css +129 -0
- package/resources/themes/saga-orange/theme.css +129 -0
- package/resources/themes/saga-purple/theme.css +129 -0
- package/resources/themes/soho-dark/theme.css +129 -0
- package/resources/themes/soho-light/theme.css +129 -0
- package/resources/themes/tailwind-light/theme.css +129 -0
- package/resources/themes/vela-blue/theme.css +129 -0
- package/resources/themes/vela-green/theme.css +129 -0
- package/resources/themes/vela-orange/theme.css +129 -0
- package/resources/themes/vela-purple/theme.css +129 -0
- package/resources/themes/viva-dark/theme.css +129 -0
- package/resources/themes/viva-light/theme.css +129 -0
- package/table/table.d.ts +3 -1
- package/tabmenu/tabmenu.d.ts +3 -1
- package/treeselect/treeselect.d.ts +2 -2
- package/treetable/treetable.d.ts +1 -1
@@ -0,0 +1,284 @@
|
|
1
|
+
import * as i1 from '@angular/common';
|
2
|
+
import { CommonModule } from '@angular/common';
|
3
|
+
import * as i0 from '@angular/core';
|
4
|
+
import { inject, forwardRef, Component, Input, ContentChildren, viewChild, ElementRef, effect, ChangeDetectionStrategy, ViewEncapsulation, NgModule } from '@angular/core';
|
5
|
+
import { PrimeTemplate, SharedModule } from 'primeng/api';
|
6
|
+
import { DomHandler } from 'primeng/dom';
|
7
|
+
|
8
|
+
class MeterGroupLabel {
|
9
|
+
value = null;
|
10
|
+
labelPosition = 'end';
|
11
|
+
labelOrientation = 'horizontal';
|
12
|
+
min;
|
13
|
+
max;
|
14
|
+
iconTemplate;
|
15
|
+
templates;
|
16
|
+
get labelClass() {
|
17
|
+
return {
|
18
|
+
'p-metergroup-labels p-component': true,
|
19
|
+
'p-metergroup-labels-vertical': this.labelOrientation === 'vertical',
|
20
|
+
'p-metergroup-labels-horizontal': this.labelOrientation === 'horizontal'
|
21
|
+
};
|
22
|
+
}
|
23
|
+
parentInstance = inject(forwardRef(() => MeterGroup));
|
24
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.2.2", ngImport: i0, type: MeterGroupLabel, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
25
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.2.2", type: MeterGroupLabel, selector: "p-meterGroupLabel", inputs: { value: "value", labelPosition: "labelPosition", labelOrientation: "labelOrientation", min: "min", max: "max", iconTemplate: "iconTemplate" }, queries: [{ propertyName: "templates", predicate: PrimeTemplate }], ngImport: i0, template: `
|
26
|
+
<ol [ngClass]="labelClass">
|
27
|
+
<li *ngFor="let labelItem of value; let index = index; trackBy: parentInstance.trackByFn" class="p-metergroup-label">
|
28
|
+
<ng-container *ngIf="!iconTemplate">
|
29
|
+
<i *ngIf="labelItem.icon" [class]="labelItem.icon" [ngClass]="{ 'p-metergroup-label-icon': true }" [ngStyle]="{ color: labelItem.color }"></i>
|
30
|
+
<span *ngIf="!labelItem.icon" class="p-metergroup-label-marker" [ngStyle]="{ backgroundColor: labelItem.color }"></span>
|
31
|
+
</ng-container>
|
32
|
+
<ng-container *ngTemplateOutlet="iconTemplate; context: { $implicit: labelItem, icon: labelItem.icon }"></ng-container>
|
33
|
+
<span class="p-metergroup-label-text">{{ labelItem.label }} ({{ parentInstance?.percentValue(labelItem.value) }})</span>
|
34
|
+
</li>
|
35
|
+
</ol>
|
36
|
+
`, isInline: true, dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }] });
|
37
|
+
}
|
38
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.2", ngImport: i0, type: MeterGroupLabel, decorators: [{
|
39
|
+
type: Component,
|
40
|
+
args: [{
|
41
|
+
selector: 'p-meterGroupLabel',
|
42
|
+
template: `
|
43
|
+
<ol [ngClass]="labelClass">
|
44
|
+
<li *ngFor="let labelItem of value; let index = index; trackBy: parentInstance.trackByFn" class="p-metergroup-label">
|
45
|
+
<ng-container *ngIf="!iconTemplate">
|
46
|
+
<i *ngIf="labelItem.icon" [class]="labelItem.icon" [ngClass]="{ 'p-metergroup-label-icon': true }" [ngStyle]="{ color: labelItem.color }"></i>
|
47
|
+
<span *ngIf="!labelItem.icon" class="p-metergroup-label-marker" [ngStyle]="{ backgroundColor: labelItem.color }"></span>
|
48
|
+
</ng-container>
|
49
|
+
<ng-container *ngTemplateOutlet="iconTemplate; context: { $implicit: labelItem, icon: labelItem.icon }"></ng-container>
|
50
|
+
<span class="p-metergroup-label-text">{{ labelItem.label }} ({{ parentInstance?.percentValue(labelItem.value) }})</span>
|
51
|
+
</li>
|
52
|
+
</ol>
|
53
|
+
`
|
54
|
+
}]
|
55
|
+
}], propDecorators: { value: [{
|
56
|
+
type: Input
|
57
|
+
}], labelPosition: [{
|
58
|
+
type: Input
|
59
|
+
}], labelOrientation: [{
|
60
|
+
type: Input
|
61
|
+
}], min: [{
|
62
|
+
type: Input
|
63
|
+
}], max: [{
|
64
|
+
type: Input
|
65
|
+
}], iconTemplate: [{
|
66
|
+
type: Input
|
67
|
+
}], templates: [{
|
68
|
+
type: ContentChildren,
|
69
|
+
args: [PrimeTemplate]
|
70
|
+
}] } });
|
71
|
+
/**
|
72
|
+
* MeterGroup displays scalar measurements within a known range.
|
73
|
+
* @group Components
|
74
|
+
*/
|
75
|
+
class MeterGroup {
|
76
|
+
/**
|
77
|
+
* Current value of the metergroup.
|
78
|
+
* @group Props
|
79
|
+
*/
|
80
|
+
value;
|
81
|
+
/**
|
82
|
+
* Mininum boundary value.
|
83
|
+
* @group Props
|
84
|
+
*/
|
85
|
+
min = 0;
|
86
|
+
/**
|
87
|
+
* Maximum boundary value.
|
88
|
+
* @group Props
|
89
|
+
*/
|
90
|
+
max = 100;
|
91
|
+
/**
|
92
|
+
* Specifies the layout of the component, valid values are 'horizontal' and 'vertical'.
|
93
|
+
* @group Props
|
94
|
+
*/
|
95
|
+
orientation = 'horizontal';
|
96
|
+
/**
|
97
|
+
* Specifies the label position of the component, valid values are 'start' and 'end'.
|
98
|
+
* @group Props
|
99
|
+
*/
|
100
|
+
labelPosition = 'end';
|
101
|
+
/**
|
102
|
+
* Specifies the label orientation of the component, valid values are 'horizontal' and 'vertical'.
|
103
|
+
* @group Props
|
104
|
+
*/
|
105
|
+
labelOrientation = 'horizontal';
|
106
|
+
/**
|
107
|
+
* Inline style of the element.
|
108
|
+
* @group Props
|
109
|
+
*/
|
110
|
+
style;
|
111
|
+
/**
|
112
|
+
* Style class of the element.
|
113
|
+
* @group Props
|
114
|
+
*/
|
115
|
+
styleClass;
|
116
|
+
templates;
|
117
|
+
get vertical() {
|
118
|
+
return this.orientation === 'vertical';
|
119
|
+
}
|
120
|
+
get containerClass() {
|
121
|
+
return {
|
122
|
+
'p-metergroup p-component': true,
|
123
|
+
'p-metergroup-horizontal': this.orientation === 'horizontal',
|
124
|
+
'p-metergroup-vertical': this.orientation === 'vertical'
|
125
|
+
};
|
126
|
+
}
|
127
|
+
labelTemplate;
|
128
|
+
meterTemplate;
|
129
|
+
endTemplate;
|
130
|
+
startTemplate;
|
131
|
+
iconTemplate;
|
132
|
+
container = viewChild('container', { read: ElementRef });
|
133
|
+
containerEffect = effect(() => {
|
134
|
+
const _container = this.container();
|
135
|
+
const height = DomHandler.getOuterHeight(_container.nativeElement);
|
136
|
+
this.vertical && (this.container().nativeElement.style.height = height + 'px');
|
137
|
+
});
|
138
|
+
ngAfterContentInit() {
|
139
|
+
this.templates?.forEach((item) => {
|
140
|
+
switch (item.getType()) {
|
141
|
+
case 'label':
|
142
|
+
this.labelTemplate = item.template;
|
143
|
+
break;
|
144
|
+
case 'meter':
|
145
|
+
this.meterTemplate = item.template;
|
146
|
+
break;
|
147
|
+
case 'icon':
|
148
|
+
this.iconTemplate = item.template;
|
149
|
+
break;
|
150
|
+
case 'start':
|
151
|
+
this.startTemplate = item.template;
|
152
|
+
break;
|
153
|
+
case 'end':
|
154
|
+
this.endTemplate = item.template;
|
155
|
+
break;
|
156
|
+
default:
|
157
|
+
break;
|
158
|
+
}
|
159
|
+
});
|
160
|
+
}
|
161
|
+
percent(meter = 0) {
|
162
|
+
const percentOfItem = ((meter - this.min) / (this.max - this.min)) * 100;
|
163
|
+
return Math.round(Math.max(0, Math.min(100, percentOfItem)));
|
164
|
+
}
|
165
|
+
percentValue(meter) {
|
166
|
+
return this.percent(meter) + '%';
|
167
|
+
}
|
168
|
+
meterStyle(val) {
|
169
|
+
return {
|
170
|
+
backgroundColor: val.color,
|
171
|
+
width: this.orientation === 'horizontal' && this.percentValue(val.value),
|
172
|
+
height: this.orientation === 'vertical' && this.percentValue(val.value)
|
173
|
+
};
|
174
|
+
}
|
175
|
+
totalPercent() {
|
176
|
+
return this.percent(this.value.reduce((total, val) => total + val.value, 0));
|
177
|
+
}
|
178
|
+
percentages() {
|
179
|
+
let sum = 0;
|
180
|
+
const sumsArray = [];
|
181
|
+
this.value.forEach((item) => {
|
182
|
+
sum += item.value;
|
183
|
+
sumsArray.push(sum);
|
184
|
+
});
|
185
|
+
return sumsArray;
|
186
|
+
}
|
187
|
+
trackByFn(index) {
|
188
|
+
return index;
|
189
|
+
}
|
190
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.2.2", ngImport: i0, type: MeterGroup, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
191
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.2.2", type: MeterGroup, selector: "p-meterGroup", inputs: { value: "value", min: "min", max: "max", orientation: "orientation", labelPosition: "labelPosition", labelOrientation: "labelOrientation", style: "style", styleClass: "styleClass" }, queries: [{ propertyName: "templates", predicate: PrimeTemplate }], viewQueries: [{ propertyName: "container", first: true, predicate: ["container"], descendants: true, read: ElementRef, isSignal: true }], ngImport: i0, template: `
|
192
|
+
<div #container [ngClass]="containerClass" role="meter" [attr.aria-valuemin]="min" [attr.aria-valuemax]="max" [attr.aria-valuenow]="totalPercent()" [ngStyle]="style" [class]="styleClass">
|
193
|
+
@if(labelPosition ==='start') {
|
194
|
+
<p-meterGroupLabel *ngIf="!labelTemplate" [value]="value" [labelPosition]="labelPosition" [labelOrientation]="labelOrientation" [min]="min" [max]="max" [iconTemplate]="iconTemplate" />
|
195
|
+
<ng-container *ngTemplateOutlet="labelTemplate; context: { $implicit: value, totalPercent: totalPercent(), percentages: percentages() }"></ng-container>
|
196
|
+
}
|
197
|
+
<ng-container *ngTemplateOutlet="startTemplate; context: { $implicit: value, totalPercent: totalPercent(), percentages: percentages() }"></ng-container>
|
198
|
+
<div class="p-metergroup-meters">
|
199
|
+
<ng-container *ngFor="let meterItem of value; let index = index; trackBy: trackByFn">
|
200
|
+
<ng-container *ngTemplateOutlet="meterTemplate; context: { $implicit: meterItem, index: index, orientation: this.orientation, class: 'p-metergroup-meter', size: percentValue(meterItem.value), totalPercent: totalPercent() }">
|
201
|
+
</ng-container>
|
202
|
+
<ng-container *ngIf="!meterTemplate">
|
203
|
+
<span class="p-metergroup-meter" [ngStyle]="meterStyle(meterItem)"></span>
|
204
|
+
</ng-container>
|
205
|
+
</ng-container>
|
206
|
+
</div>
|
207
|
+
<ng-container *ngTemplateOutlet="endTemplate; context: { $implicit: value, totalPercent: totalPercent(), percentages: percentages() }"></ng-container>
|
208
|
+
@if(labelPosition === 'end') {
|
209
|
+
<p-meterGroupLabel *ngIf="!labelTemplate" [value]="value" [labelPosition]="labelPosition" [labelOrientation]="labelOrientation" [min]="min" [max]="max" [iconTemplate]="iconTemplate" />
|
210
|
+
<ng-container *ngTemplateOutlet="labelTemplate; context: { $implicit: value, totalPercent: totalPercent(), percentages: percentages() }"></ng-container>
|
211
|
+
}
|
212
|
+
</div>
|
213
|
+
`, isInline: true, dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "component", type: MeterGroupLabel, selector: "p-meterGroupLabel", inputs: ["value", "labelPosition", "labelOrientation", "min", "max", "iconTemplate"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
214
|
+
}
|
215
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.2", ngImport: i0, type: MeterGroup, decorators: [{
|
216
|
+
type: Component,
|
217
|
+
args: [{
|
218
|
+
selector: 'p-meterGroup',
|
219
|
+
template: `
|
220
|
+
<div #container [ngClass]="containerClass" role="meter" [attr.aria-valuemin]="min" [attr.aria-valuemax]="max" [attr.aria-valuenow]="totalPercent()" [ngStyle]="style" [class]="styleClass">
|
221
|
+
@if(labelPosition ==='start') {
|
222
|
+
<p-meterGroupLabel *ngIf="!labelTemplate" [value]="value" [labelPosition]="labelPosition" [labelOrientation]="labelOrientation" [min]="min" [max]="max" [iconTemplate]="iconTemplate" />
|
223
|
+
<ng-container *ngTemplateOutlet="labelTemplate; context: { $implicit: value, totalPercent: totalPercent(), percentages: percentages() }"></ng-container>
|
224
|
+
}
|
225
|
+
<ng-container *ngTemplateOutlet="startTemplate; context: { $implicit: value, totalPercent: totalPercent(), percentages: percentages() }"></ng-container>
|
226
|
+
<div class="p-metergroup-meters">
|
227
|
+
<ng-container *ngFor="let meterItem of value; let index = index; trackBy: trackByFn">
|
228
|
+
<ng-container *ngTemplateOutlet="meterTemplate; context: { $implicit: meterItem, index: index, orientation: this.orientation, class: 'p-metergroup-meter', size: percentValue(meterItem.value), totalPercent: totalPercent() }">
|
229
|
+
</ng-container>
|
230
|
+
<ng-container *ngIf="!meterTemplate">
|
231
|
+
<span class="p-metergroup-meter" [ngStyle]="meterStyle(meterItem)"></span>
|
232
|
+
</ng-container>
|
233
|
+
</ng-container>
|
234
|
+
</div>
|
235
|
+
<ng-container *ngTemplateOutlet="endTemplate; context: { $implicit: value, totalPercent: totalPercent(), percentages: percentages() }"></ng-container>
|
236
|
+
@if(labelPosition === 'end') {
|
237
|
+
<p-meterGroupLabel *ngIf="!labelTemplate" [value]="value" [labelPosition]="labelPosition" [labelOrientation]="labelOrientation" [min]="min" [max]="max" [iconTemplate]="iconTemplate" />
|
238
|
+
<ng-container *ngTemplateOutlet="labelTemplate; context: { $implicit: value, totalPercent: totalPercent(), percentages: percentages() }"></ng-container>
|
239
|
+
}
|
240
|
+
</div>
|
241
|
+
`,
|
242
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
243
|
+
encapsulation: ViewEncapsulation.None
|
244
|
+
}]
|
245
|
+
}], propDecorators: { value: [{
|
246
|
+
type: Input
|
247
|
+
}], min: [{
|
248
|
+
type: Input
|
249
|
+
}], max: [{
|
250
|
+
type: Input
|
251
|
+
}], orientation: [{
|
252
|
+
type: Input
|
253
|
+
}], labelPosition: [{
|
254
|
+
type: Input
|
255
|
+
}], labelOrientation: [{
|
256
|
+
type: Input
|
257
|
+
}], style: [{
|
258
|
+
type: Input
|
259
|
+
}], styleClass: [{
|
260
|
+
type: Input
|
261
|
+
}], templates: [{
|
262
|
+
type: ContentChildren,
|
263
|
+
args: [PrimeTemplate]
|
264
|
+
}] } });
|
265
|
+
class MeterGroupModule {
|
266
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.2.2", ngImport: i0, type: MeterGroupModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
267
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.2.2", ngImport: i0, type: MeterGroupModule, declarations: [MeterGroup, MeterGroupLabel], imports: [CommonModule, SharedModule], exports: [MeterGroup, SharedModule] });
|
268
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.2.2", ngImport: i0, type: MeterGroupModule, imports: [CommonModule, SharedModule, SharedModule] });
|
269
|
+
}
|
270
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.2", ngImport: i0, type: MeterGroupModule, decorators: [{
|
271
|
+
type: NgModule,
|
272
|
+
args: [{
|
273
|
+
imports: [CommonModule, SharedModule],
|
274
|
+
exports: [MeterGroup, SharedModule],
|
275
|
+
declarations: [MeterGroup, MeterGroupLabel]
|
276
|
+
}]
|
277
|
+
}] });
|
278
|
+
|
279
|
+
/**
|
280
|
+
* Generated bundle index. Do not edit.
|
281
|
+
*/
|
282
|
+
|
283
|
+
export { MeterGroup, MeterGroupLabel, MeterGroupModule };
|
284
|
+
//# sourceMappingURL=primeng-metergroup.mjs.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"primeng-metergroup.mjs","sources":["../../src/app/components/metergroup/metergroup.ts","../../src/app/components/metergroup/primeng-metergroup.ts"],"sourcesContent":["import { CommonModule } from '@angular/common';\nimport { AfterContentInit, ChangeDetectionStrategy, Component, ContentChildren, ElementRef, Input, NgModule, QueryList, TemplateRef, ViewChild, ViewEncapsulation, effect, forwardRef, inject, viewChild } from '@angular/core';\nimport { PrimeTemplate, SharedModule } from 'primeng/api';\nimport { DomHandler } from 'primeng/dom';\nimport { MeterItem } from './metergroup.interface';\n\n@Component({\n selector: 'p-meterGroupLabel',\n template: `\n <ol [ngClass]=\"labelClass\">\n <li *ngFor=\"let labelItem of value; let index = index; trackBy: parentInstance.trackByFn\" class=\"p-metergroup-label\">\n <ng-container *ngIf=\"!iconTemplate\">\n <i *ngIf=\"labelItem.icon\" [class]=\"labelItem.icon\" [ngClass]=\"{ 'p-metergroup-label-icon': true }\" [ngStyle]=\"{ color: labelItem.color }\"></i>\n <span *ngIf=\"!labelItem.icon\" class=\"p-metergroup-label-marker\" [ngStyle]=\"{ backgroundColor: labelItem.color }\"></span>\n </ng-container>\n <ng-container *ngTemplateOutlet=\"iconTemplate; context: { $implicit: labelItem, icon: labelItem.icon }\"></ng-container>\n <span class=\"p-metergroup-label-text\">{{ labelItem.label }} ({{ parentInstance?.percentValue(labelItem.value) }})</span>\n </li>\n </ol>\n `\n})\nexport class MeterGroupLabel {\n @Input() value: any[] = null;\n\n @Input() labelPosition: 'start' | 'end' = 'end';\n\n @Input() labelOrientation: 'horizontal' | 'vertical' = 'horizontal';\n\n @Input() min: number;\n\n @Input() max: number;\n\n @Input() iconTemplate: TemplateRef<any> | undefined;\n\n @ContentChildren(PrimeTemplate) templates: QueryList<PrimeTemplate> | undefined;\n\n get labelClass(): { [key: string]: boolean } {\n return {\n 'p-metergroup-labels p-component': true,\n 'p-metergroup-labels-vertical': this.labelOrientation === 'vertical',\n 'p-metergroup-labels-horizontal': this.labelOrientation === 'horizontal'\n };\n }\n\n parentInstance: MeterGroup = inject(forwardRef(() => MeterGroup));\n}\n/**\n * MeterGroup displays scalar measurements within a known range.\n * @group Components\n */\n@Component({\n selector: 'p-meterGroup',\n template: `\n <div #container [ngClass]=\"containerClass\" role=\"meter\" [attr.aria-valuemin]=\"min\" [attr.aria-valuemax]=\"max\" [attr.aria-valuenow]=\"totalPercent()\" [ngStyle]=\"style\" [class]=\"styleClass\">\n @if(labelPosition ==='start') {\n <p-meterGroupLabel *ngIf=\"!labelTemplate\" [value]=\"value\" [labelPosition]=\"labelPosition\" [labelOrientation]=\"labelOrientation\" [min]=\"min\" [max]=\"max\" [iconTemplate]=\"iconTemplate\" />\n <ng-container *ngTemplateOutlet=\"labelTemplate; context: { $implicit: value, totalPercent: totalPercent(), percentages: percentages() }\"></ng-container>\n }\n <ng-container *ngTemplateOutlet=\"startTemplate; context: { $implicit: value, totalPercent: totalPercent(), percentages: percentages() }\"></ng-container>\n <div class=\"p-metergroup-meters\">\n <ng-container *ngFor=\"let meterItem of value; let index = index; trackBy: trackByFn\">\n <ng-container *ngTemplateOutlet=\"meterTemplate; context: { $implicit: meterItem, index: index, orientation: this.orientation, class: 'p-metergroup-meter', size: percentValue(meterItem.value), totalPercent: totalPercent() }\">\n </ng-container>\n <ng-container *ngIf=\"!meterTemplate\">\n <span class=\"p-metergroup-meter\" [ngStyle]=\"meterStyle(meterItem)\"></span>\n </ng-container>\n </ng-container>\n </div>\n <ng-container *ngTemplateOutlet=\"endTemplate; context: { $implicit: value, totalPercent: totalPercent(), percentages: percentages() }\"></ng-container>\n @if(labelPosition === 'end') {\n <p-meterGroupLabel *ngIf=\"!labelTemplate\" [value]=\"value\" [labelPosition]=\"labelPosition\" [labelOrientation]=\"labelOrientation\" [min]=\"min\" [max]=\"max\" [iconTemplate]=\"iconTemplate\" />\n <ng-container *ngTemplateOutlet=\"labelTemplate; context: { $implicit: value, totalPercent: totalPercent(), percentages: percentages() }\"></ng-container>\n }\n </div>\n `,\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None\n})\nexport class MeterGroup implements AfterContentInit {\n /**\n * Current value of the metergroup.\n * @group Props\n */\n @Input() value: MeterItem[] | undefined;\n /**\n * Mininum boundary value.\n * @group Props\n */\n @Input() min: number = 0;\n /**\n * Maximum boundary value.\n * @group Props\n */\n @Input() max: number = 100;\n /**\n * Specifies the layout of the component, valid values are 'horizontal' and 'vertical'.\n * @group Props\n */\n @Input() orientation: 'horizontal' | 'vertical' = 'horizontal';\n /**\n * Specifies the label position of the component, valid values are 'start' and 'end'.\n * @group Props\n */\n @Input() labelPosition: 'start' | 'end' = 'end';\n /**\n * Specifies the label orientation of the component, valid values are 'horizontal' and 'vertical'.\n * @group Props\n */\n @Input() labelOrientation: string = 'horizontal';\n /**\n * Inline style of the element.\n * @group Props\n */\n @Input() style: { [klass: string]: any } | null | undefined;\n /**\n * Style class of the element.\n * @group Props\n */\n @Input() styleClass: string | undefined;\n\n @ContentChildren(PrimeTemplate) templates: QueryList<PrimeTemplate> | undefined;\n\n get vertical(): boolean {\n return this.orientation === 'vertical';\n }\n\n get containerClass() {\n return {\n 'p-metergroup p-component': true,\n 'p-metergroup-horizontal': this.orientation === 'horizontal',\n 'p-metergroup-vertical': this.orientation === 'vertical'\n };\n }\n\n labelTemplate: TemplateRef<any> | undefined;\n\n meterTemplate: TemplateRef<any> | undefined;\n\n endTemplate: TemplateRef<any> | undefined;\n\n startTemplate: TemplateRef<any> | undefined;\n\n iconTemplate: TemplateRef<any> | undefined;\n\n container = viewChild('container', { read: ElementRef });\n\n containerEffect = effect(() => {\n const _container = this.container();\n const height = DomHandler.getOuterHeight(_container.nativeElement);\n this.vertical && (this.container().nativeElement.style.height = height + 'px');\n });\n\n ngAfterContentInit() {\n this.templates?.forEach((item) => {\n switch (item.getType()) {\n case 'label':\n this.labelTemplate = item.template;\n break;\n case 'meter':\n this.meterTemplate = item.template;\n break;\n case 'icon':\n this.iconTemplate = item.template;\n break;\n case 'start':\n this.startTemplate = item.template;\n break;\n case 'end':\n this.endTemplate = item.template;\n break;\n default:\n break;\n }\n });\n }\n\n percent(meter = 0) {\n const percentOfItem = ((meter - this.min) / (this.max - this.min)) * 100;\n\n return Math.round(Math.max(0, Math.min(100, percentOfItem)));\n }\n percentValue(meter) {\n return this.percent(meter) + '%';\n }\n meterStyle(val) {\n return {\n backgroundColor: val.color,\n width: this.orientation === 'horizontal' && this.percentValue(val.value),\n height: this.orientation === 'vertical' && this.percentValue(val.value)\n };\n }\n\n totalPercent() {\n return this.percent(this.value.reduce((total, val) => total + val.value, 0));\n }\n\n percentages() {\n let sum = 0;\n const sumsArray = [];\n\n this.value.forEach((item) => {\n sum += item.value;\n sumsArray.push(sum);\n });\n\n return sumsArray;\n }\n\n trackByFn(index: number): number {\n return index;\n }\n}\n\n@NgModule({\n imports: [CommonModule, SharedModule],\n exports: [MeterGroup, SharedModule],\n declarations: [MeterGroup, MeterGro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,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,gBAAgB,EAJf,OAAA,EAAA,CAAA,YAAY,EAAE,YAAY,EACd,YAAY,CAAA,EAAA,CAAA,CAAA;;2FAGzB,gBAAgB,EAAA,UAAA,EAAA,CAAA;kBAL5B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACN,oBAAA,OAAO,EAAE,CAAC,YAAY,EAAE,YAAY,CAAC;AACrC,oBAAA,OAAO,EAAE,CAAC,UAAU,EAAE,YAAY,CAAC;AACnC,oBAAA,YAAY,EAAE,CAAC,UAAU,EAAE,eAAe,CAAC;AAC9C,iBAAA,CAAA;;;ACzND;;AAEG;;;;"}
|
@@ -757,7 +757,7 @@ class MultiSelect {
|
|
757
757
|
filteredOptions = this.filterService.filter(options, this.searchFields(), this._filterValue(), this.filterMatchMode, this.filterLocale);
|
758
758
|
}
|
759
759
|
else {
|
760
|
-
filteredOptions = options.filter((option) => option.toLocaleLowerCase().includes(this._filterValue().toLocaleLowerCase()));
|
760
|
+
filteredOptions = options.filter((option) => option.toString().toLocaleLowerCase().includes(this._filterValue().toLocaleLowerCase()));
|
761
761
|
}
|
762
762
|
if (this.group) {
|
763
763
|
const optionGroups = this.options || [];
|
@@ -1035,7 +1035,7 @@ class MultiSelect {
|
|
1035
1035
|
return (this.modelValue() || []).some((value) => ObjectUtils.equals(value, optionValue, this.equalityKey()));
|
1036
1036
|
}
|
1037
1037
|
isOptionMatched(option) {
|
1038
|
-
return this.isValidOption(option) && this.getOptionLabel(option).toLocaleLowerCase(this.filterLocale).startsWith(this.searchValue.toLocaleLowerCase(this.filterLocale));
|
1038
|
+
return this.isValidOption(option) && this.getOptionLabel(option).toString().toLocaleLowerCase(this.filterLocale).startsWith(this.searchValue.toLocaleLowerCase(this.filterLocale));
|
1039
1039
|
}
|
1040
1040
|
isEmpty() {
|
1041
1041
|
return !this._options() || (this.visibleOptions() && this.visibleOptions().length === 0);
|
@@ -1651,8 +1651,8 @@ class MultiSelect {
|
|
1651
1651
|
[attr.aria-label]="ariaLabel"
|
1652
1652
|
[attr.aria-labelledby]="ariaLabelledBy"
|
1653
1653
|
[attr.aria-haspopup]="'listbox'"
|
1654
|
-
[attr.aria-expanded]="overlayVisible"
|
1655
|
-
[attr.aria-controls]="id + '_list'"
|
1654
|
+
[attr.aria-expanded]="overlayVisible ?? false"
|
1655
|
+
[attr.aria-controls]="overlayVisible ? id + '_list' : null"
|
1656
1656
|
[attr.tabindex]="!disabled ? tabindex : -1"
|
1657
1657
|
[attr.aria-activedescendant]="focused ? focusedOptionId : undefined"
|
1658
1658
|
(focus)="onInputFocus($event)"
|
@@ -1896,8 +1896,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.2", ngImpor
|
|
1896
1896
|
[attr.aria-label]="ariaLabel"
|
1897
1897
|
[attr.aria-labelledby]="ariaLabelledBy"
|
1898
1898
|
[attr.aria-haspopup]="'listbox'"
|
1899
|
-
[attr.aria-expanded]="overlayVisible"
|
1900
|
-
[attr.aria-controls]="id + '_list'"
|
1899
|
+
[attr.aria-expanded]="overlayVisible ?? false"
|
1900
|
+
[attr.aria-controls]="overlayVisible ? id + '_list' : null"
|
1901
1901
|
[attr.tabindex]="!disabled ? tabindex : -1"
|
1902
1902
|
[attr.aria-activedescendant]="focused ? focusedOptionId : undefined"
|
1903
1903
|
(focus)="onInputFocus($event)"
|