ngwr 14.7.0 → 14.8.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/bar-chart/styles/_index.scss +1 -0
- package/calendar-heatmap/styles/_index.scss +1 -0
- package/cascader/styles/_rules.scss +86 -14
- package/date-picker/styles/_index.scss +30 -0
- package/density/styles/_index.scss +4 -2
- package/donut-chart/styles/_index.scss +10 -0
- package/dropdown/styles/_index.scss +67 -5
- package/event-calendar/styles/_index.scss +209 -35
- package/fesm2022/ngwr-bar-chart.mjs +29 -4
- package/fesm2022/ngwr-bar-chart.mjs.map +1 -1
- package/fesm2022/ngwr-calendar-heatmap.mjs +59 -4
- package/fesm2022/ngwr-calendar-heatmap.mjs.map +1 -1
- package/fesm2022/ngwr-cascader.mjs +2 -2
- package/fesm2022/ngwr-cascader.mjs.map +1 -1
- package/fesm2022/ngwr-checkbox.mjs +12 -2
- package/fesm2022/ngwr-checkbox.mjs.map +1 -1
- package/fesm2022/ngwr-date-picker.mjs +705 -46
- package/fesm2022/ngwr-date-picker.mjs.map +1 -1
- package/fesm2022/ngwr-donut-chart.mjs +46 -4
- package/fesm2022/ngwr-donut-chart.mjs.map +1 -1
- package/fesm2022/ngwr-dropdown.mjs +166 -17
- package/fesm2022/ngwr-dropdown.mjs.map +1 -1
- package/fesm2022/ngwr-event-calendar.mjs +9 -2
- package/fesm2022/ngwr-event-calendar.mjs.map +1 -1
- package/fesm2022/ngwr-form.mjs +52 -1
- package/fesm2022/ngwr-form.mjs.map +1 -1
- package/fesm2022/ngwr-gauge.mjs +33 -4
- package/fesm2022/ngwr-gauge.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-ar.mjs +2 -0
- package/fesm2022/ngwr-i18n-ar.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-cs.mjs +2 -0
- package/fesm2022/ngwr-i18n-cs.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-de.mjs +2 -0
- package/fesm2022/ngwr-i18n-de.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-en.mjs +5 -0
- package/fesm2022/ngwr-i18n-en.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-es.mjs +2 -0
- package/fesm2022/ngwr-i18n-es.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-fr.mjs +2 -0
- package/fesm2022/ngwr-i18n-fr.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-he.mjs +2 -0
- package/fesm2022/ngwr-i18n-he.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-hi.mjs +2 -0
- package/fesm2022/ngwr-i18n-hi.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-id.mjs +2 -0
- package/fesm2022/ngwr-i18n-id.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-it.mjs +2 -0
- package/fesm2022/ngwr-i18n-it.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-ja.mjs +2 -0
- package/fesm2022/ngwr-i18n-ja.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-ko.mjs +2 -0
- package/fesm2022/ngwr-i18n-ko.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-nl.mjs +2 -0
- package/fesm2022/ngwr-i18n-nl.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-pl.mjs +2 -0
- package/fesm2022/ngwr-i18n-pl.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-pt.mjs +2 -0
- package/fesm2022/ngwr-i18n-pt.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-ru.mjs +2 -0
- package/fesm2022/ngwr-i18n-ru.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-sv.mjs +2 -0
- package/fesm2022/ngwr-i18n-sv.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-tr.mjs +2 -0
- package/fesm2022/ngwr-i18n-tr.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-uk.mjs +2 -0
- package/fesm2022/ngwr-i18n-uk.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-vi.mjs +2 -0
- package/fesm2022/ngwr-i18n-vi.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-zh-TW.mjs +2 -0
- package/fesm2022/ngwr-i18n-zh-TW.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-zh.mjs +2 -0
- package/fesm2022/ngwr-i18n-zh.mjs.map +1 -1
- package/fesm2022/ngwr-input-number.mjs +12 -0
- package/fesm2022/ngwr-input-number.mjs.map +1 -1
- package/fesm2022/ngwr-line-chart.mjs +16 -5
- package/fesm2022/ngwr-line-chart.mjs.map +1 -1
- package/fesm2022/ngwr-meter-group-testing.mjs +7 -3
- package/fesm2022/ngwr-meter-group-testing.mjs.map +1 -1
- package/fesm2022/ngwr-meter-group.mjs +24 -4
- package/fesm2022/ngwr-meter-group.mjs.map +1 -1
- package/fesm2022/ngwr-page-header.mjs +10 -2
- package/fesm2022/ngwr-page-header.mjs.map +1 -1
- package/fesm2022/ngwr-popover.mjs +569 -7
- package/fesm2022/ngwr-popover.mjs.map +1 -1
- package/fesm2022/ngwr-sidebar.mjs +7 -0
- package/fesm2022/ngwr-sidebar.mjs.map +1 -1
- package/fesm2022/ngwr-sparkline.mjs +82 -8
- package/fesm2022/ngwr-sparkline.mjs.map +1 -1
- package/fesm2022/ngwr-table.mjs +1 -1
- package/fesm2022/ngwr-table.mjs.map +1 -1
- package/fesm2022/ngwr-toolbar.mjs +7 -0
- package/fesm2022/ngwr-toolbar.mjs.map +1 -1
- package/fesm2022/ngwr-version.mjs +1 -1
- package/fesm2022/ngwr-version.mjs.map +1 -1
- package/form/styles/_index.scss +11 -1
- package/gauge/styles/_index.scss +1 -0
- package/i18n/ar.json +3 -1
- package/i18n/cs.json +3 -1
- package/i18n/de.json +3 -1
- package/i18n/en.json +3 -1
- package/i18n/es.json +3 -1
- package/i18n/fr.json +3 -1
- package/i18n/he.json +3 -1
- package/i18n/hi.json +3 -1
- package/i18n/id.json +3 -1
- package/i18n/it.json +3 -1
- package/i18n/ja.json +3 -1
- package/i18n/ko.json +3 -1
- package/i18n/nl.json +3 -1
- package/i18n/pl.json +3 -1
- package/i18n/pt.json +3 -1
- package/i18n/ru.json +3 -1
- package/i18n/sv.json +3 -1
- package/i18n/tr.json +3 -1
- package/i18n/uk.json +3 -1
- package/i18n/vi.json +3 -1
- package/i18n/zh-TW.json +3 -1
- package/i18n/zh.json +3 -1
- package/input/styles/_index.scss +19 -0
- package/input-number/styles/_index.scss +69 -0
- package/line-chart/styles/_index.scss +30 -2
- package/llms-full.txt +3 -3
- package/meter-group/styles/_index.scss +1 -0
- package/overlay/styles/_arrow.scss +27 -2
- package/package.json +1 -1
- package/page-header/styles/_index.scss +37 -1
- package/pagination/styles/_index.scss +9 -5
- package/popover/styles/_index.scss +73 -5
- package/select/styles/_index.scss +48 -9
- package/sidebar/styles/_index.scss +34 -2
- package/sparkline/styles/_index.scss +19 -0
- package/toolbar/styles/_index.scss +35 -1
- package/tree/styles/_index.scss +45 -6
- package/types/ngwr-bar-chart.d.ts +19 -1
- package/types/ngwr-calendar-heatmap.d.ts +29 -1
- package/types/ngwr-checkbox.d.ts +2 -0
- package/types/ngwr-date-picker.d.ts +308 -43
- package/types/ngwr-donut-chart.d.ts +24 -1
- package/types/ngwr-dropdown.d.ts +22 -2
- package/types/ngwr-event-calendar.d.ts +8 -0
- package/types/ngwr-form.d.ts +35 -5
- package/types/ngwr-gauge.d.ts +20 -1
- package/types/ngwr-input-number.d.ts +7 -0
- package/types/ngwr-line-chart.d.ts +9 -1
- package/types/ngwr-meter-group-testing.d.ts +3 -2
- package/types/ngwr-meter-group.d.ts +14 -1
- package/types/ngwr-page-header.d.ts +10 -2
- package/types/ngwr-popover.d.ts +154 -3
- package/types/ngwr-sidebar.d.ts +7 -0
- package/types/ngwr-sparkline.d.ts +43 -1
- package/types/ngwr-toolbar.d.ts +7 -0
- package/types/ngwr-version.d.ts +1 -1
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { coerceNumberProperty, coerceBooleanProperty } from '@angular/cdk/coercion';
|
|
2
2
|
import * as i0 from '@angular/core';
|
|
3
|
-
import { input, computed, ViewEncapsulation, Component } from '@angular/core';
|
|
3
|
+
import { input, viewChild, computed, ViewEncapsulation, Component } from '@angular/core';
|
|
4
|
+
import { useChartTooltip } from 'ngwr/popover';
|
|
4
5
|
|
|
5
6
|
/**
|
|
6
7
|
* @license
|
|
@@ -49,16 +50,31 @@ class WrSparkline {
|
|
|
49
50
|
/** CSS height. @default '2rem' */
|
|
50
51
|
height = input('2rem', /* @ts-ignore */
|
|
51
52
|
...(ngDevMode ? [{ debugName: "height" }] : /* istanbul ignore next */ []));
|
|
53
|
+
/**
|
|
54
|
+
* Show a tooltip with the value of the point nearest the pointer, marking that
|
|
55
|
+
* point, and named by `ariaLabel` when one is given. Pointer only. @default true
|
|
56
|
+
*/
|
|
57
|
+
tooltip = input(true, { ...(ngDevMode ? { debugName: "tooltip" } : /* istanbul ignore next */ {}), transform: coerceBooleanProperty });
|
|
58
|
+
svg = viewChild('svg', /* @ts-ignore */
|
|
59
|
+
...(ngDevMode ? [{ debugName: "svg" }] : /* istanbul ignore next */ []));
|
|
60
|
+
marker = viewChild('marker', /* @ts-ignore */
|
|
61
|
+
...(ngDevMode ? [{ debugName: "marker" }] : /* istanbul ignore next */ []));
|
|
52
62
|
// Drawn in a 100×40 viewBox — scales smoothly to any CSS size.
|
|
53
63
|
vbW = 100;
|
|
54
64
|
vbH = 40;
|
|
55
65
|
padding = 2;
|
|
66
|
+
/**
|
|
67
|
+
* The data as drawn. Non-finite values are dropped rather than scaled: every
|
|
68
|
+
* `min`/`max` comparison against a NaN is false, so it survived into the scale and
|
|
69
|
+
* `toFixed(2)` wrote the literal text `NaN` into the path `d` — invalid geometry,
|
|
70
|
+
* and the line vanishes. The tooltip reads this list too, so the value it shows is
|
|
71
|
+
* the one under the point it marks.
|
|
72
|
+
*/
|
|
73
|
+
values = computed(() => this.data().filter(v => Number.isFinite(v)), /* @ts-ignore */
|
|
74
|
+
...(ngDevMode ? [{ debugName: "values" }] : /* istanbul ignore next */ []));
|
|
56
75
|
/** Mapped `{ x, y }` points for the path. */
|
|
57
76
|
points = computed(() => {
|
|
58
|
-
|
|
59
|
-
// against a NaN is false, so it survived into the scale and `toFixed(2)` wrote the
|
|
60
|
-
// literal text `NaN` into the path `d` — invalid geometry, and the line vanishes.
|
|
61
|
-
const data = this.data().filter(v => Number.isFinite(v));
|
|
77
|
+
const data = this.values();
|
|
62
78
|
if (data.length === 0)
|
|
63
79
|
return [];
|
|
64
80
|
if (data.length === 1)
|
|
@@ -108,13 +124,71 @@ class WrSparkline {
|
|
|
108
124
|
}, /* @ts-ignore */
|
|
109
125
|
...(ngDevMode ? [{ debugName: "tipPoint" }] : /* istanbul ignore next */ []));
|
|
110
126
|
viewBox = `0 0 ${this.vbW} ${this.vbH}`;
|
|
127
|
+
/**
|
|
128
|
+
* One tooltip, pointing at the hovered point: above its marker, below it when there
|
|
129
|
+
* is no room. The marker is the anchor element itself, drawn for the point the
|
|
130
|
+
* tooltip reads — it renders before this runs, since both follow `tip.active()`.
|
|
131
|
+
*
|
|
132
|
+
* The chip sits INSIDE the drawing, over the stretch of line above the marker, so the
|
|
133
|
+
* helper is also told which point any spot over the drawing reads: a pointer scrubbing
|
|
134
|
+
* along the top of a sparkline would otherwise land on the chip and stop there.
|
|
135
|
+
*/
|
|
136
|
+
tip = useChartTooltip(this.tooltip, index => {
|
|
137
|
+
const value = this.values()[index];
|
|
138
|
+
const marker = this.marker()?.nativeElement;
|
|
139
|
+
if (value === undefined || !marker)
|
|
140
|
+
return null;
|
|
141
|
+
return {
|
|
142
|
+
datum: { label: this.ariaLabel() ?? undefined, value: String(value), color: this.color() },
|
|
143
|
+
anchor: marker,
|
|
144
|
+
};
|
|
145
|
+
}, (x, y) => {
|
|
146
|
+
const svg = this.svg()?.nativeElement;
|
|
147
|
+
if (!svg)
|
|
148
|
+
return null;
|
|
149
|
+
const box = svg.getBoundingClientRect();
|
|
150
|
+
if (x < box.left || x > box.right || y < box.top || y > box.bottom)
|
|
151
|
+
return null;
|
|
152
|
+
return this.indexAt(x, box);
|
|
153
|
+
});
|
|
154
|
+
/**
|
|
155
|
+
* The marker's place, as percentages of the box the drawing stretches to. An
|
|
156
|
+
* element rather than a `<circle>`: the drawing stretches to any box with
|
|
157
|
+
* `preserveAspectRatio="none"`, which would squash a circle into an ellipse.
|
|
158
|
+
*/
|
|
159
|
+
markerAt = computed(() => {
|
|
160
|
+
const index = this.tip.active();
|
|
161
|
+
const point = index === null ? undefined : this.points()[index];
|
|
162
|
+
return point ? { x: (point.x / this.vbW) * 100, y: (point.y / this.vbH) * 100 } : null;
|
|
163
|
+
}, /* @ts-ignore */
|
|
164
|
+
...(ngDevMode ? [{ debugName: "markerAt" }] : /* istanbul ignore next */ []));
|
|
165
|
+
onPointerMove(event) {
|
|
166
|
+
const index = this.indexAt(event.clientX, event.currentTarget.getBoundingClientRect());
|
|
167
|
+
if (index !== null)
|
|
168
|
+
this.tip.enter(index);
|
|
169
|
+
}
|
|
170
|
+
/**
|
|
171
|
+
* The point nearest the pointer, along x only — the points are evenly spaced, so
|
|
172
|
+
* that is a rounding rather than a search. A box with no width (nothing laid out
|
|
173
|
+
* yet) answers nothing rather than a NaN index.
|
|
174
|
+
*/
|
|
175
|
+
indexAt(clientX, box) {
|
|
176
|
+
const count = this.points().length;
|
|
177
|
+
if (count === 0 || box.width <= 0)
|
|
178
|
+
return null;
|
|
179
|
+
if (count === 1)
|
|
180
|
+
return 0;
|
|
181
|
+
const x = ((clientX - box.left) / box.width) * this.vbW;
|
|
182
|
+
const step = (this.vbW - this.padding * 2) / (count - 1);
|
|
183
|
+
return Math.min(count - 1, Math.max(0, Math.round((x - this.padding) / step)));
|
|
184
|
+
}
|
|
111
185
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: WrSparkline, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
112
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.6", type: WrSparkline, isStandalone: true, selector: "wr-sparkline", inputs: { data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: false, transformFunction: null }, strokeWidth: { classPropertyName: "strokeWidth", publicName: "strokeWidth", isSignal: true, isRequired: false, transformFunction: null }, showArea: { classPropertyName: "showArea", publicName: "showArea", isSignal: true, isRequired: false, transformFunction: null }, showTip: { classPropertyName: "showTip", publicName: "showTip", isSignal: true, isRequired: false, transformFunction: null }, width: { classPropertyName: "width", publicName: "width", isSignal: true, isRequired: false, transformFunction: null }, height: { classPropertyName: "height", publicName: "height", isSignal: true, isRequired: false, transformFunction: null } }, host: { classAttribute: "wr-sparkline" }, ngImport: i0, template: "<svg\n [attr.viewBox]=\"viewBox\"\n [style.width]=\"width()\"\n [style.height]=\"height()\"\n [attr.role]=\"ariaLabel() ? 'img' : null\"\n [attr.aria-label]=\"ariaLabel()\"\n [attr.aria-hidden]=\"ariaLabel() ? null : 'true'\"\n preserveAspectRatio=\"none\"\n>\n @if (showArea() && areaPath()) {\n <path class=\"wr-sparkline__area\" [attr.d]=\"areaPath()\" [attr.fill]=\"color()\" fill-opacity=\"0.15\" stroke=\"none\" />\n }\n @if (linePath()) {\n <path\n class=\"wr-sparkline__line\"\n [attr.d]=\"linePath()\"\n fill=\"none\"\n [attr.stroke]=\"color()\"\n [attr.stroke-width]=\"strokeWidth()\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n vector-effect=\"non-scaling-stroke\"\n />\n }\n @if (showTip() && tipPoint(); as
|
|
186
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.6", type: WrSparkline, isStandalone: true, selector: "wr-sparkline", inputs: { data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: false, transformFunction: null }, strokeWidth: { classPropertyName: "strokeWidth", publicName: "strokeWidth", isSignal: true, isRequired: false, transformFunction: null }, showArea: { classPropertyName: "showArea", publicName: "showArea", isSignal: true, isRequired: false, transformFunction: null }, showTip: { classPropertyName: "showTip", publicName: "showTip", isSignal: true, isRequired: false, transformFunction: null }, width: { classPropertyName: "width", publicName: "width", isSignal: true, isRequired: false, transformFunction: null }, height: { classPropertyName: "height", publicName: "height", isSignal: true, isRequired: false, transformFunction: null }, tooltip: { classPropertyName: "tooltip", publicName: "tooltip", isSignal: true, isRequired: false, transformFunction: null } }, host: { classAttribute: "wr-sparkline" }, viewQueries: [{ propertyName: "svg", first: true, predicate: ["svg"], descendants: true, isSignal: true }, { propertyName: "marker", first: true, predicate: ["marker"], descendants: true, isSignal: true }], ngImport: i0, template: "<svg\n #svg\n [attr.viewBox]=\"viewBox\"\n [style.width]=\"width()\"\n [style.height]=\"height()\"\n [attr.role]=\"ariaLabel() ? 'img' : null\"\n [attr.aria-label]=\"ariaLabel()\"\n [attr.aria-hidden]=\"ariaLabel() ? null : 'true'\"\n preserveAspectRatio=\"none\"\n (mousemove)=\"onPointerMove($event)\"\n (mouseleave)=\"tip.leave($event)\"\n>\n @if (showArea() && areaPath()) {\n <path class=\"wr-sparkline__area\" [attr.d]=\"areaPath()\" [attr.fill]=\"color()\" fill-opacity=\"0.15\" stroke=\"none\" />\n }\n @if (linePath()) {\n <path\n class=\"wr-sparkline__line\"\n [attr.d]=\"linePath()\"\n fill=\"none\"\n [attr.stroke]=\"color()\"\n [attr.stroke-width]=\"strokeWidth()\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n vector-effect=\"non-scaling-stroke\"\n />\n }\n @if (showTip() && tipPoint(); as last) {\n <circle class=\"wr-sparkline__tip\" [attr.cx]=\"last.x\" [attr.cy]=\"last.y\" r=\"1.5\" [attr.fill]=\"color()\" />\n }\n</svg>\n@if (markerAt(); as at) {\n <span\n #marker\n class=\"wr-sparkline__marker\"\n aria-hidden=\"true\"\n [style.left.%]=\"at.x\"\n [style.top.%]=\"at.y\"\n [style.background]=\"color()\"\n ></span>\n}\n", encapsulation: i0.ViewEncapsulation.None });
|
|
113
187
|
}
|
|
114
188
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: WrSparkline, decorators: [{
|
|
115
189
|
type: Component,
|
|
116
|
-
args: [{ selector: 'wr-sparkline', encapsulation: ViewEncapsulation.None, host: { class: 'wr-sparkline' }, template: "<svg\n [attr.viewBox]=\"viewBox\"\n [style.width]=\"width()\"\n [style.height]=\"height()\"\n [attr.role]=\"ariaLabel() ? 'img' : null\"\n [attr.aria-label]=\"ariaLabel()\"\n [attr.aria-hidden]=\"ariaLabel() ? null : 'true'\"\n preserveAspectRatio=\"none\"\n>\n @if (showArea() && areaPath()) {\n <path class=\"wr-sparkline__area\" [attr.d]=\"areaPath()\" [attr.fill]=\"color()\" fill-opacity=\"0.15\" stroke=\"none\" />\n }\n @if (linePath()) {\n <path\n class=\"wr-sparkline__line\"\n [attr.d]=\"linePath()\"\n fill=\"none\"\n [attr.stroke]=\"color()\"\n [attr.stroke-width]=\"strokeWidth()\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n vector-effect=\"non-scaling-stroke\"\n />\n }\n @if (showTip() && tipPoint(); as
|
|
117
|
-
}], propDecorators: { data: [{ type: i0.Input, args: [{ isSignal: true, alias: "data", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], color: [{ type: i0.Input, args: [{ isSignal: true, alias: "color", required: false }] }], strokeWidth: [{ type: i0.Input, args: [{ isSignal: true, alias: "strokeWidth", required: false }] }], showArea: [{ type: i0.Input, args: [{ isSignal: true, alias: "showArea", required: false }] }], showTip: [{ type: i0.Input, args: [{ isSignal: true, alias: "showTip", required: false }] }], width: [{ type: i0.Input, args: [{ isSignal: true, alias: "width", required: false }] }], height: [{ type: i0.Input, args: [{ isSignal: true, alias: "height", required: false }] }] } });
|
|
190
|
+
args: [{ selector: 'wr-sparkline', encapsulation: ViewEncapsulation.None, host: { class: 'wr-sparkline' }, template: "<svg\n #svg\n [attr.viewBox]=\"viewBox\"\n [style.width]=\"width()\"\n [style.height]=\"height()\"\n [attr.role]=\"ariaLabel() ? 'img' : null\"\n [attr.aria-label]=\"ariaLabel()\"\n [attr.aria-hidden]=\"ariaLabel() ? null : 'true'\"\n preserveAspectRatio=\"none\"\n (mousemove)=\"onPointerMove($event)\"\n (mouseleave)=\"tip.leave($event)\"\n>\n @if (showArea() && areaPath()) {\n <path class=\"wr-sparkline__area\" [attr.d]=\"areaPath()\" [attr.fill]=\"color()\" fill-opacity=\"0.15\" stroke=\"none\" />\n }\n @if (linePath()) {\n <path\n class=\"wr-sparkline__line\"\n [attr.d]=\"linePath()\"\n fill=\"none\"\n [attr.stroke]=\"color()\"\n [attr.stroke-width]=\"strokeWidth()\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n vector-effect=\"non-scaling-stroke\"\n />\n }\n @if (showTip() && tipPoint(); as last) {\n <circle class=\"wr-sparkline__tip\" [attr.cx]=\"last.x\" [attr.cy]=\"last.y\" r=\"1.5\" [attr.fill]=\"color()\" />\n }\n</svg>\n@if (markerAt(); as at) {\n <span\n #marker\n class=\"wr-sparkline__marker\"\n aria-hidden=\"true\"\n [style.left.%]=\"at.x\"\n [style.top.%]=\"at.y\"\n [style.background]=\"color()\"\n ></span>\n}\n" }]
|
|
191
|
+
}], propDecorators: { data: [{ type: i0.Input, args: [{ isSignal: true, alias: "data", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], color: [{ type: i0.Input, args: [{ isSignal: true, alias: "color", required: false }] }], strokeWidth: [{ type: i0.Input, args: [{ isSignal: true, alias: "strokeWidth", required: false }] }], showArea: [{ type: i0.Input, args: [{ isSignal: true, alias: "showArea", required: false }] }], showTip: [{ type: i0.Input, args: [{ isSignal: true, alias: "showTip", required: false }] }], width: [{ type: i0.Input, args: [{ isSignal: true, alias: "width", required: false }] }], height: [{ type: i0.Input, args: [{ isSignal: true, alias: "height", required: false }] }], tooltip: [{ type: i0.Input, args: [{ isSignal: true, alias: "tooltip", required: false }] }], svg: [{ type: i0.ViewChild, args: ['svg', { isSignal: true }] }], marker: [{ type: i0.ViewChild, args: ['marker', { isSignal: true }] }] } });
|
|
118
192
|
|
|
119
193
|
/**
|
|
120
194
|
* Generated bundle index. Do not edit.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ngwr-sparkline.mjs","sources":["../../../projects/lib/sparkline/sparkline.ts","../../../projects/lib/sparkline/sparkline.html","../../../projects/lib/sparkline/ngwr-sparkline.ts"],"sourcesContent":["/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { coerceBooleanProperty, coerceNumberProperty } from '@angular/cdk/coercion';\nimport { Component, ViewEncapsulation, computed, input } from '@angular/core';\n\n/**\n * Tiny inline trend line. SVG path drawn from `[data]: number[]` — no\n * axes, no labels, just the shape. Optional area fill + tip dot.\n *\n * @example\n * ```html\n * <wr-sparkline [data]=\"[12, 14, 9, 17, 21, 18, 23]\" />\n * <wr-sparkline [data]=\"prices\" [showArea]=\"true\" color=\"var(--wr-color-success)\" />\n * ```\n *\n * @see https://ngwr.dev/reference/components/sparkline\n */\n@Component({\n selector: 'wr-sparkline',\n templateUrl: './sparkline.html',\n encapsulation: ViewEncapsulation.None,\n host: { class: 'wr-sparkline' },\n})\nexport class WrSparkline {\n readonly data = input<readonly number[]>([]);\n\n /**\n * Accessible name. A sparkline usually sits beside the number it summarises, where\n * announcing it again is noise — so it is `aria-hidden` by default and becomes a\n * named `role=\"img\"` only when a consumer says what it shows.\n */\n readonly ariaLabel = input<string | null>(null);\n\n /** Stroke colour. @default `var(--wr-color-primary)` */\n readonly color = input<string>('var(--wr-color-primary)');\n\n /**\n * Line thickness in CSS pixels — `vector-effect=\"non-scaling-stroke\"` keeps it at\n * that width whatever the box is stretched to, so it is NOT in viewBox units.\n * @default 1.5\n */\n readonly strokeWidth = input(1.5, {\n transform: (v: unknown): number => Math.max(0.1, coerceNumberProperty(v, 1.5)),\n });\n\n /** Fill the area below the line. @default false */\n readonly showArea = input(false, { transform: coerceBooleanProperty });\n\n /** Show a dot at the last data point. @default true */\n readonly showTip = input(true, { transform: coerceBooleanProperty });\n\n /** CSS width. @default '8rem' */\n readonly width = input<string>('8rem');\n\n /** CSS height. @default '2rem' */\n readonly height = input<string>('2rem');\n\n // Drawn in a 100×40 viewBox — scales smoothly to any CSS size.\n private readonly vbW = 100;\n private readonly vbH = 40;\n private readonly padding = 2;\n\n /** Mapped `{ x, y }` points for the path. */\n protected readonly points = computed(() => {\n // Non-finite data is dropped rather than scaled: every `min`/`max` comparison\n // against a NaN is false, so it survived into the scale and `toFixed(2)` wrote the\n // literal text `NaN` into the path `d` — invalid geometry, and the line vanishes.\n const data = this.data().filter(v => Number.isFinite(v));\n if (data.length === 0) return [] as readonly { x: number; y: number }[];\n if (data.length === 1) return [{ x: this.vbW / 2, y: this.vbH / 2 }];\n\n let min = data[0];\n let max = data[0];\n for (const v of data) {\n if (v < min) min = v;\n if (v > max) max = v;\n }\n const pad = this.padding;\n const w = this.vbW - pad * 2;\n const h = this.vbH - pad * 2;\n // A series with no spread has no shape, and dividing by the old `|| 1` fallback\n // pinned every point to `pad + h` — the bottom edge — so a steady series at 500\n // read as rock bottom. Centred instead, which is what a lone datum already does.\n if (max === min) {\n return data.map((_, i) => ({ x: pad + (i / (data.length - 1)) * w, y: this.vbH / 2 }));\n }\n const span = max - min;\n return data.map((v, i) => ({\n x: pad + (i / (data.length - 1)) * w,\n y: pad + h - ((v - min) / span) * h,\n }));\n });\n\n protected readonly linePath = computed(() =>\n this.points()\n .map((p, i) => `${i === 0 ? 'M' : 'L'} ${p.x.toFixed(2)} ${p.y.toFixed(2)}`)\n .join(' ')\n );\n\n protected readonly areaPath = computed(() => {\n const pts = this.points();\n if (pts.length < 2) return '';\n const baseY = this.vbH - this.padding;\n const start = `M ${pts[0].x.toFixed(2)} ${baseY}`;\n const line = pts.map(p => `L ${p.x.toFixed(2)} ${p.y.toFixed(2)}`).join(' ');\n const close = `L ${pts[pts.length - 1].x.toFixed(2)} ${baseY} Z`;\n return `${start} ${line} ${close}`;\n });\n\n protected readonly tipPoint = computed(() => {\n const pts = this.points();\n return pts.length > 0 ? pts[pts.length - 1] : null;\n });\n\n protected readonly viewBox = `0 0 ${this.vbW} ${this.vbH}`;\n}\n","<svg\n [attr.viewBox]=\"viewBox\"\n [style.width]=\"width()\"\n [style.height]=\"height()\"\n [attr.role]=\"ariaLabel() ? 'img' : null\"\n [attr.aria-label]=\"ariaLabel()\"\n [attr.aria-hidden]=\"ariaLabel() ? null : 'true'\"\n preserveAspectRatio=\"none\"\n>\n @if (showArea() && areaPath()) {\n <path class=\"wr-sparkline__area\" [attr.d]=\"areaPath()\" [attr.fill]=\"color()\" fill-opacity=\"0.15\" stroke=\"none\" />\n }\n @if (linePath()) {\n <path\n class=\"wr-sparkline__line\"\n [attr.d]=\"linePath()\"\n fill=\"none\"\n [attr.stroke]=\"color()\"\n [attr.stroke-width]=\"strokeWidth()\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n vector-effect=\"non-scaling-stroke\"\n />\n }\n @if (showTip() && tipPoint(); as tip) {\n <circle class=\"wr-sparkline__tip\" [attr.cx]=\"tip.x\" [attr.cy]=\"tip.y\" r=\"1.5\" [attr.fill]=\"color()\" />\n }\n</svg>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;AAAA;;;;;AAKG;AAKH;;;;;;;;;;;AAWG;MAOU,WAAW,C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AAC,GAAG,IAAI;IACpD,CAAC;iFAAC;IAEiB,OAAO,GAAG,CAAA,IAAA,EAAO,IAAI,CAAC,GAAG,IAAI,IAAI,CAAC,GAAG,CAAA,CAAE;uGA3F/C,WAAW,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;AAAX,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,WAAW,2mCC5BxB,u6BA4BA,EAAA,aAAA,EAAA,EAAA,CAAA,iBAAA,CAAA,IAAA,EAAA,CAAA;;2FDAa,WAAW,EAAA,UAAA,EAAA,CAAA;kBANvB,SAAS;+BACE,cAAc,EAAA,aAAA,EAET,iBAAiB,CAAC,IAAI,QAC/B,EAAE,KAAK,EAAE,cAAc,EAAE,EAAA,QAAA,EAAA,u6BAAA,EAAA;;;AE1BjC;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"ngwr-sparkline.mjs","sources":["../../../projects/lib/sparkline/sparkline.ts","../../../projects/lib/sparkline/sparkline.html","../../../projects/lib/sparkline/ngwr-sparkline.ts"],"sourcesContent":["/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { coerceBooleanProperty, coerceNumberProperty } from '@angular/cdk/coercion';\nimport { Component, type ElementRef, ViewEncapsulation, computed, input, viewChild } from '@angular/core';\n\nimport { useChartTooltip } from 'ngwr/popover';\n\n/**\n * Tiny inline trend line. SVG path drawn from `[data]: number[]` — no\n * axes, no labels, just the shape. Optional area fill + tip dot.\n *\n * @example\n * ```html\n * <wr-sparkline [data]=\"[12, 14, 9, 17, 21, 18, 23]\" />\n * <wr-sparkline [data]=\"prices\" [showArea]=\"true\" color=\"var(--wr-color-success)\" />\n * ```\n *\n * @see https://ngwr.dev/reference/components/sparkline\n */\n@Component({\n selector: 'wr-sparkline',\n templateUrl: './sparkline.html',\n encapsulation: ViewEncapsulation.None,\n host: { class: 'wr-sparkline' },\n})\nexport class WrSparkline {\n readonly data = input<readonly number[]>([]);\n\n /**\n * Accessible name. A sparkline usually sits beside the number it summarises, where\n * announcing it again is noise — so it is `aria-hidden` by default and becomes a\n * named `role=\"img\"` only when a consumer says what it shows.\n */\n readonly ariaLabel = input<string | null>(null);\n\n /** Stroke colour. @default `var(--wr-color-primary)` */\n readonly color = input<string>('var(--wr-color-primary)');\n\n /**\n * Line thickness in CSS pixels — `vector-effect=\"non-scaling-stroke\"` keeps it at\n * that width whatever the box is stretched to, so it is NOT in viewBox units.\n * @default 1.5\n */\n readonly strokeWidth = input(1.5, {\n transform: (v: unknown): number => Math.max(0.1, coerceNumberProperty(v, 1.5)),\n });\n\n /** Fill the area below the line. @default false */\n readonly showArea = input(false, { transform: coerceBooleanProperty });\n\n /** Show a dot at the last data point. @default true */\n readonly showTip = input(true, { transform: coerceBooleanProperty });\n\n /** CSS width. @default '8rem' */\n readonly width = input<string>('8rem');\n\n /** CSS height. @default '2rem' */\n readonly height = input<string>('2rem');\n\n /**\n * Show a tooltip with the value of the point nearest the pointer, marking that\n * point, and named by `ariaLabel` when one is given. Pointer only. @default true\n */\n readonly tooltip = input(true, { transform: coerceBooleanProperty });\n\n private readonly svg = viewChild<ElementRef<SVGSVGElement>>('svg');\n private readonly marker = viewChild<ElementRef<HTMLElement>>('marker');\n\n // Drawn in a 100×40 viewBox — scales smoothly to any CSS size.\n private readonly vbW = 100;\n private readonly vbH = 40;\n private readonly padding = 2;\n\n /**\n * The data as drawn. Non-finite values are dropped rather than scaled: every\n * `min`/`max` comparison against a NaN is false, so it survived into the scale and\n * `toFixed(2)` wrote the literal text `NaN` into the path `d` — invalid geometry,\n * and the line vanishes. The tooltip reads this list too, so the value it shows is\n * the one under the point it marks.\n */\n private readonly values = computed(() => this.data().filter(v => Number.isFinite(v)));\n\n /** Mapped `{ x, y }` points for the path. */\n protected readonly points = computed(() => {\n const data = this.values();\n if (data.length === 0) return [] as readonly { x: number; y: number }[];\n if (data.length === 1) return [{ x: this.vbW / 2, y: this.vbH / 2 }];\n\n let min = data[0];\n let max = data[0];\n for (const v of data) {\n if (v < min) min = v;\n if (v > max) max = v;\n }\n const pad = this.padding;\n const w = this.vbW - pad * 2;\n const h = this.vbH - pad * 2;\n // A series with no spread has no shape, and dividing by the old `|| 1` fallback\n // pinned every point to `pad + h` — the bottom edge — so a steady series at 500\n // read as rock bottom. Centred instead, which is what a lone datum already does.\n if (max === min) {\n return data.map((_, i) => ({ x: pad + (i / (data.length - 1)) * w, y: this.vbH / 2 }));\n }\n const span = max - min;\n return data.map((v, i) => ({\n x: pad + (i / (data.length - 1)) * w,\n y: pad + h - ((v - min) / span) * h,\n }));\n });\n\n protected readonly linePath = computed(() =>\n this.points()\n .map((p, i) => `${i === 0 ? 'M' : 'L'} ${p.x.toFixed(2)} ${p.y.toFixed(2)}`)\n .join(' ')\n );\n\n protected readonly areaPath = computed(() => {\n const pts = this.points();\n if (pts.length < 2) return '';\n const baseY = this.vbH - this.padding;\n const start = `M ${pts[0].x.toFixed(2)} ${baseY}`;\n const line = pts.map(p => `L ${p.x.toFixed(2)} ${p.y.toFixed(2)}`).join(' ');\n const close = `L ${pts[pts.length - 1].x.toFixed(2)} ${baseY} Z`;\n return `${start} ${line} ${close}`;\n });\n\n protected readonly tipPoint = computed(() => {\n const pts = this.points();\n return pts.length > 0 ? pts[pts.length - 1] : null;\n });\n\n protected readonly viewBox = `0 0 ${this.vbW} ${this.vbH}`;\n\n /**\n * One tooltip, pointing at the hovered point: above its marker, below it when there\n * is no room. The marker is the anchor element itself, drawn for the point the\n * tooltip reads — it renders before this runs, since both follow `tip.active()`.\n *\n * The chip sits INSIDE the drawing, over the stretch of line above the marker, so the\n * helper is also told which point any spot over the drawing reads: a pointer scrubbing\n * along the top of a sparkline would otherwise land on the chip and stop there.\n */\n protected readonly tip = useChartTooltip(\n this.tooltip,\n index => {\n const value = this.values()[index];\n const marker = this.marker()?.nativeElement;\n if (value === undefined || !marker) return null;\n return {\n datum: { label: this.ariaLabel() ?? undefined, value: String(value), color: this.color() },\n anchor: marker,\n };\n },\n (x, y) => {\n const svg = this.svg()?.nativeElement;\n if (!svg) return null;\n const box = svg.getBoundingClientRect();\n if (x < box.left || x > box.right || y < box.top || y > box.bottom) return null;\n return this.indexAt(x, box);\n }\n );\n\n /**\n * The marker's place, as percentages of the box the drawing stretches to. An\n * element rather than a `<circle>`: the drawing stretches to any box with\n * `preserveAspectRatio=\"none\"`, which would squash a circle into an ellipse.\n */\n protected readonly markerAt = computed(() => {\n const index = this.tip.active();\n const point = index === null ? undefined : this.points()[index];\n return point ? { x: (point.x / this.vbW) * 100, y: (point.y / this.vbH) * 100 } : null;\n });\n\n protected onPointerMove(event: MouseEvent): void {\n const index = this.indexAt(event.clientX, (event.currentTarget as Element).getBoundingClientRect());\n if (index !== null) this.tip.enter(index);\n }\n\n /**\n * The point nearest the pointer, along x only — the points are evenly spaced, so\n * that is a rounding rather than a search. A box with no width (nothing laid out\n * yet) answers nothing rather than a NaN index.\n */\n private indexAt(clientX: number, box: DOMRect): number | null {\n const count = this.points().length;\n if (count === 0 || box.width <= 0) return null;\n if (count === 1) return 0;\n const x = ((clientX - box.left) / box.width) * this.vbW;\n const step = (this.vbW - this.padding * 2) / (count - 1);\n return Math.min(count - 1, Math.max(0, Math.round((x - this.padding) / step)));\n }\n}\n","<svg\n #svg\n [attr.viewBox]=\"viewBox\"\n [style.width]=\"width()\"\n [style.height]=\"height()\"\n [attr.role]=\"ariaLabel() ? 'img' : null\"\n [attr.aria-label]=\"ariaLabel()\"\n [attr.aria-hidden]=\"ariaLabel() ? null : 'true'\"\n preserveAspectRatio=\"none\"\n (mousemove)=\"onPointerMove($event)\"\n (mouseleave)=\"tip.leave($event)\"\n>\n @if (showArea() && areaPath()) {\n <path class=\"wr-sparkline__area\" [attr.d]=\"areaPath()\" [attr.fill]=\"color()\" fill-opacity=\"0.15\" stroke=\"none\" />\n }\n @if (linePath()) {\n <path\n class=\"wr-sparkline__line\"\n [attr.d]=\"linePath()\"\n fill=\"none\"\n [attr.stroke]=\"color()\"\n [attr.stroke-width]=\"strokeWidth()\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n vector-effect=\"non-scaling-stroke\"\n />\n }\n @if (showTip() && tipPoint(); as last) {\n <circle class=\"wr-sparkline__tip\" [attr.cx]=\"last.x\" [attr.cy]=\"last.y\" r=\"1.5\" [attr.fill]=\"color()\" />\n }\n</svg>\n@if (markerAt(); as at) {\n <span\n #marker\n class=\"wr-sparkline__marker\"\n aria-hidden=\"true\"\n [style.left.%]=\"at.x\"\n [style.top.%]=\"at.y\"\n [style.background]=\"color()\"\n ></span>\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;AAAA;;;;;AAKG;AAOH;;;;;;;;;;;AAWG;MAOU,WAAW,CAAA;IACb,IAAI,GAAG,KAAK,CAAoB,EAAE;6EAAC;AAE5C;;;;AAIG;IACM,SAAS,GAAG,KAAK,CAAgB,IAAI;kFAAC;;IAGtC,KAAK,GAAG,KAAK,CAAS,yBAAyB;8EAAC;AAEzD;;;;AAIG;IACM,WAAW,GAAG,KAAK,CAAC,GAAG,EAAA,EAAA,IAAA,SAAA,GAAA,EAAA,SAAA,EAAA,aAAA,EAAA,8BAAA,EAAA,CAAA,EAC9B,SAAS,EAAE,CAAC,CAAU,KAAa,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,oBAAoB,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,EAAA,CAC9E;;IAGO,QAAQ,GAAG,KAAK,CAAC,KAAK,gFAAI,SAAS,EAAE,qBAAqB,EAAA,CAAG;;IAG7D,OAAO,GAAG,KAAK,CAAC,IAAI,+EAAI,SAAS,EAAE,qBAAqB,EAAA,CAAG;;IAG3D,KAAK,GAAG,KAAK,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CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,KAAA,EAAA,SAAA,EAAA,QAAA,EAAA,KAAA,EAAA,CAAA,EAAA,CAAA,EAAA,KAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,KAAA,EAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,KAAA,EAAA,OAAA,EAAA,QAAA,EAAA,KAAA,EAAA,CAAA,EAAA,CAAA,EAAA,MAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,KAAA,EAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,KAAA,EAAA,QAAA,EAAA,QAAA,EAAA,KAAA,EAAA,CAAA,EAAA,CAAA,EAAA,OAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,KAAA,EAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,KAAA,EAAA,SAAA,EAAA,QAAA,EAAA,KAAA,EAAA,CAAA,EAAA,CAAA,EAAA,GAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,SAAA,EAAA,IAAA,EAAA,CAAA,KAAK,gEACJ,QAAQ,EAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;AEvEvE;;AAEG;;;;"}
|
package/fesm2022/ngwr-table.mjs
CHANGED
|
@@ -180,7 +180,7 @@ class WrTableFilter {
|
|
|
180
180
|
this.selectionChange.emit(this.items().filter(i => i.selected));
|
|
181
181
|
}
|
|
182
182
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: WrTableFilter, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
183
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.6", type: WrTableFilter, isStandalone: true, selector: "wr-table-filter", inputs: { filterLabel: { classPropertyName: "filterLabel", publicName: "filterLabel", isSignal: true, isRequired: false, transformFunction: null }, noMatchesLabel: { classPropertyName: "noMatchesLabel", publicName: "noMatchesLabel", isSignal: true, isRequired: false, transformFunction: null }, searchLabel: { classPropertyName: "searchLabel", publicName: "searchLabel", isSignal: true, isRequired: false, transformFunction: null }, resetLabel: { classPropertyName: "resetLabel", publicName: "resetLabel", isSignal: true, isRequired: false, transformFunction: null }, items: { classPropertyName: "items", publicName: "items", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { selectionChange: "selectionChange" }, host: { properties: { "class": "classes()" } }, ngImport: i0, template: "<button type=\"button\" class=\"wr-table-filter__trigger\" [wrDropdown]=\"menu\" [attr.aria-label]=\"resolvedFilterLabel()\">\n <svg\n class=\"wr-icon__svg\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"\n >\n <path\n d=\"M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z\"\n />\n </svg>\n @if (selectedCount() > 0) {\n <span class=\"wr-table-filter__count\">{{ selectedCount() }}</span>\n }\n</button>\n\n<wr-dropdown-menu #menu>\n <div class=\"wr-table-filter__panel\">\n <input\n class=\"wr-table-filter__search\"\n type=\"search\"\n [placeholder]=\"resolvedSearchLabel()\"\n [attr.aria-label]=\"resolvedSearchLabel()\"\n [value]=\"query()\"\n (input)=\"onSearchInput($event)\"\n (keydown)=\"onSearchKeydown($event)\"\n />\n\n <div class=\"wr-table-filter__list\">\n @for (item of visible(); track item.value) {\n <button\n type=\"button\"\n class=\"wr-table-filter__item\"\n [class.wr-table-filter__item--selected]=\"item.selected\"\n (click)=\"onToggle(item)\"\n >\n <span class=\"wr-table-filter__check\">\n <svg\n class=\"wr-icon__svg\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"\n >\n <path d=\"M20 6 9 17l-5-5\" />\n </svg>\n </span>\n <span class=\"wr-table-filter__title\">{{ item.title }}</span>\n </button>\n } @empty {\n <div class=\"wr-table-filter__empty\">{{ resolvedNoMatchesLabel() }}</div>\n }\n </div>\n\n @if (selectedCount() > 0) {\n <button type=\"button\" class=\"wr-table-filter__reset\" (click)=\"onReset()\">{{ resolvedResetLabel() }}</button>\n }\n </div>\n</wr-dropdown-menu>\n", dependencies: [{ kind: "directive", type: WrDropdown, selector: "[wrDropdown]", inputs: ["wrDropdown", "trigger", "position", "responsive"], outputs: ["opened", "closed"], exportAs: ["wrDropdown"] }, { kind: "component", type: WrDropdownMenu, selector: "wr-dropdown-menu", exportAs: ["wrDropdownMenu"] }], encapsulation: i0.ViewEncapsulation.None });
|
|
183
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.6", type: WrTableFilter, isStandalone: true, selector: "wr-table-filter", inputs: { filterLabel: { classPropertyName: "filterLabel", publicName: "filterLabel", isSignal: true, isRequired: false, transformFunction: null }, noMatchesLabel: { classPropertyName: "noMatchesLabel", publicName: "noMatchesLabel", isSignal: true, isRequired: false, transformFunction: null }, searchLabel: { classPropertyName: "searchLabel", publicName: "searchLabel", isSignal: true, isRequired: false, transformFunction: null }, resetLabel: { classPropertyName: "resetLabel", publicName: "resetLabel", isSignal: true, isRequired: false, transformFunction: null }, items: { classPropertyName: "items", publicName: "items", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { selectionChange: "selectionChange" }, host: { properties: { "class": "classes()" } }, ngImport: i0, template: "<button type=\"button\" class=\"wr-table-filter__trigger\" [wrDropdown]=\"menu\" [attr.aria-label]=\"resolvedFilterLabel()\">\n <svg\n class=\"wr-icon__svg\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"\n >\n <path\n d=\"M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z\"\n />\n </svg>\n @if (selectedCount() > 0) {\n <span class=\"wr-table-filter__count\">{{ selectedCount() }}</span>\n }\n</button>\n\n<wr-dropdown-menu #menu>\n <div class=\"wr-table-filter__panel\">\n <input\n class=\"wr-table-filter__search\"\n type=\"search\"\n [placeholder]=\"resolvedSearchLabel()\"\n [attr.aria-label]=\"resolvedSearchLabel()\"\n [value]=\"query()\"\n (input)=\"onSearchInput($event)\"\n (keydown)=\"onSearchKeydown($event)\"\n />\n\n <div class=\"wr-table-filter__list\">\n @for (item of visible(); track item.value) {\n <button\n type=\"button\"\n class=\"wr-table-filter__item\"\n [class.wr-table-filter__item--selected]=\"item.selected\"\n (click)=\"onToggle(item)\"\n >\n <span class=\"wr-table-filter__check\">\n <svg\n class=\"wr-icon__svg\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"\n >\n <path d=\"M20 6 9 17l-5-5\" />\n </svg>\n </span>\n <span class=\"wr-table-filter__title\">{{ item.title }}</span>\n </button>\n } @empty {\n <div class=\"wr-table-filter__empty\">{{ resolvedNoMatchesLabel() }}</div>\n }\n </div>\n\n @if (selectedCount() > 0) {\n <button type=\"button\" class=\"wr-table-filter__reset\" (click)=\"onReset()\">{{ resolvedResetLabel() }}</button>\n }\n </div>\n</wr-dropdown-menu>\n", dependencies: [{ kind: "directive", type: WrDropdown, selector: "[wrDropdown]", inputs: ["wrDropdown", "trigger", "position", "arrow", "responsive"], outputs: ["opened", "closed"], exportAs: ["wrDropdown"] }, { kind: "component", type: WrDropdownMenu, selector: "wr-dropdown-menu", exportAs: ["wrDropdownMenu"] }], encapsulation: i0.ViewEncapsulation.None });
|
|
184
184
|
}
|
|
185
185
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: WrTableFilter, decorators: [{
|
|
186
186
|
type: Component,
|