@factor_ec/ui 5.0.7 → 6.0.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/README.md +1 -1
- package/fesm2022/factor_ec-ui.mjs +161 -491
- package/fesm2022/factor_ec-ui.mjs.map +1 -1
- package/package.json +8 -9
- package/types/factor_ec-ui.d.ts +174 -0
- package/index.d.ts +0 -5
- package/lib/avatar/avatar.component.d.ts +0 -17
- package/lib/chart.service.d.ts +0 -18
- package/lib/icon/icon.component.d.ts +0 -14
- package/lib/image/image.component.d.ts +0 -14
- package/lib/message.service.d.ts +0 -25
- package/lib/models/chart.d.ts +0 -12
- package/lib/models/message-content.d.ts +0 -4
- package/lib/models/message-options.d.ts +0 -12
- package/lib/models/ui-options.d.ts +0 -9
- package/lib/observe-intersecting.directive.d.ts +0 -17
- package/lib/progress/progress.component.d.ts +0 -10
- package/lib/rating/rating.component.d.ts +0 -20
- package/lib/ui.module.d.ts +0 -13
- package/lib/ui.service.d.ts +0 -8
- package/public-api.d.ts +0 -13
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { inject, input, computed, signal, effect,
|
|
3
|
-
import {
|
|
4
|
-
import * as d3 from 'd3';
|
|
2
|
+
import { inject, input, computed, signal, effect, HostBinding, Component, InjectionToken, ElementRef, output, ChangeDetectionStrategy, Injectable, PLATFORM_ID, Directive } from '@angular/core';
|
|
3
|
+
import { ColorUtil, StringUtil } from '@factor_ec/utils';
|
|
5
4
|
import * as i3 from '@angular/material/dialog';
|
|
6
5
|
import { MAT_DIALOG_DATA, MatDialogModule, MatDialog } from '@angular/material/dialog';
|
|
7
6
|
import { MAT_SNACK_BAR_DATA, MatSnackBarModule, MatSnackBar } from '@angular/material/snack-bar';
|
|
@@ -10,24 +9,23 @@ import { MatButtonModule } from '@angular/material/button';
|
|
|
10
9
|
import { ReplaySubject } from 'rxjs';
|
|
11
10
|
import * as i1 from '@angular/common';
|
|
12
11
|
import { CommonModule, isPlatformBrowser } from '@angular/common';
|
|
13
|
-
import { NG_VALUE_ACCESSOR } from '@angular/forms';
|
|
14
12
|
|
|
15
|
-
class
|
|
16
|
-
colorService = inject(
|
|
17
|
-
color = input();
|
|
13
|
+
class Avatar {
|
|
14
|
+
colorService = inject(ColorUtil);
|
|
15
|
+
color = input(...(ngDevMode ? [undefined, { debugName: "color" }] : /* istanbul ignore next */ []));
|
|
18
16
|
initials = computed(() => {
|
|
19
17
|
return this.getInitials(this.label());
|
|
20
|
-
});
|
|
21
|
-
label = input.required();
|
|
22
|
-
loaded = signal(false);
|
|
23
|
-
src = input();
|
|
18
|
+
}, ...(ngDevMode ? [{ debugName: "initials" }] : /* istanbul ignore next */ []));
|
|
19
|
+
label = input.required(...(ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []));
|
|
20
|
+
loaded = signal(false, ...(ngDevMode ? [{ debugName: "loaded" }] : /* istanbul ignore next */ []));
|
|
21
|
+
src = input(...(ngDevMode ? [undefined, { debugName: "src" }] : /* istanbul ignore next */ []));
|
|
24
22
|
get backgroundColor() {
|
|
25
23
|
return this.color() || this.colorService.hex(this.label());
|
|
26
24
|
}
|
|
27
25
|
get backgroundImage() {
|
|
28
26
|
return this.src() ? `url(${this.src()})` : '';
|
|
29
27
|
}
|
|
30
|
-
class = input();
|
|
28
|
+
class = input(...(ngDevMode ? [undefined, { debugName: "class" }] : /* istanbul ignore next */ []));
|
|
31
29
|
get hostClasses() {
|
|
32
30
|
return ['ft-avatar', this.class()].join(' ');
|
|
33
31
|
}
|
|
@@ -56,312 +54,38 @@ class AvatarComponent {
|
|
|
56
54
|
const initials = ((allInitials.shift() || '') + (allInitials.pop() || '')).toUpperCase();
|
|
57
55
|
return initials;
|
|
58
56
|
}
|
|
59
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
60
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "
|
|
57
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: Avatar, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
58
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.4", type: Avatar, isStandalone: true, selector: "ft-avatar", inputs: { color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: true, transformFunction: null }, src: { classPropertyName: "src", publicName: "src", isSignal: true, isRequired: false, transformFunction: null }, class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "style.--ft-avatar-bg-color": "this.backgroundColor", "style.--ft-avatar-bg-image": "this.backgroundImage", "class": "this.hostClasses" } }, ngImport: i0, template: "@if (!loaded()) {\n<div>{{ initials() }}</div>\n}", styles: [":host{display:inline-flex;align-items:center;justify-content:center;background-color:var(--ft-avatar-bg-color, #e5e7eb);background-image:var(--ft-avatar-bg-image, none);background-size:cover;background-position:center;background-repeat:no-repeat;border-radius:calc(var(--ft-avatar-size) / 2);color:var(--ft-avatar-color, #FFF);font-size:calc(var(--ft-avatar-size) - var(--ft-avatar-size) * .6);font-weight:700;min-width:var(--ft-avatar-size);min-height:var(--ft-avatar-size);text-align:center;vertical-align:middle;cursor:default;-webkit-user-select:none;user-select:none}\n"] });
|
|
61
59
|
}
|
|
62
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
60
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: Avatar, decorators: [{
|
|
63
61
|
type: Component,
|
|
64
|
-
args: [{ selector: 'ft-avatar',
|
|
65
|
-
}], ctorParameters: () => [], propDecorators: { backgroundColor: [{
|
|
62
|
+
args: [{ selector: 'ft-avatar', imports: [], template: "@if (!loaded()) {\n<div>{{ initials() }}</div>\n}", styles: [":host{display:inline-flex;align-items:center;justify-content:center;background-color:var(--ft-avatar-bg-color, #e5e7eb);background-image:var(--ft-avatar-bg-image, none);background-size:cover;background-position:center;background-repeat:no-repeat;border-radius:calc(var(--ft-avatar-size) / 2);color:var(--ft-avatar-color, #FFF);font-size:calc(var(--ft-avatar-size) - var(--ft-avatar-size) * .6);font-weight:700;min-width:var(--ft-avatar-size);min-height:var(--ft-avatar-size);text-align:center;vertical-align:middle;cursor:default;-webkit-user-select:none;user-select:none}\n"] }]
|
|
63
|
+
}], ctorParameters: () => [], propDecorators: { color: [{ type: i0.Input, args: [{ isSignal: true, alias: "color", required: false }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: true }] }], src: [{ type: i0.Input, args: [{ isSignal: true, alias: "src", required: false }] }], backgroundColor: [{
|
|
66
64
|
type: HostBinding,
|
|
67
|
-
args: ['style
|
|
65
|
+
args: ['style.--ft-avatar-bg-color']
|
|
68
66
|
}], backgroundImage: [{
|
|
69
67
|
type: HostBinding,
|
|
70
|
-
args: ['style
|
|
71
|
-
}], hostClasses: [{
|
|
68
|
+
args: ['style.--ft-avatar-bg-image']
|
|
69
|
+
}], class: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }], hostClasses: [{
|
|
72
70
|
type: HostBinding,
|
|
73
71
|
args: ['class']
|
|
74
72
|
}] } });
|
|
75
73
|
|
|
76
|
-
class ChartService {
|
|
77
|
-
resizeTimeout;
|
|
78
|
-
charts = new Map();
|
|
79
|
-
constructor() {
|
|
80
|
-
window.addEventListener('resize', this.handleResize.bind(this));
|
|
81
|
-
}
|
|
82
|
-
remove(element) {
|
|
83
|
-
this.charts.delete(element);
|
|
84
|
-
}
|
|
85
|
-
render(element, items) {
|
|
86
|
-
// Clear svg
|
|
87
|
-
const svg = d3.select(element).html('');
|
|
88
|
-
// Resize event
|
|
89
|
-
if (!this.charts.has(element)) {
|
|
90
|
-
this.charts.set(element, items);
|
|
91
|
-
}
|
|
92
|
-
const values = [0];
|
|
93
|
-
items.forEach((item) => {
|
|
94
|
-
item.data.forEach((i) => {
|
|
95
|
-
if (typeof i[item.field] === 'number') {
|
|
96
|
-
values.push(i[item.field]);
|
|
97
|
-
}
|
|
98
|
-
});
|
|
99
|
-
});
|
|
100
|
-
if (values.length > 0) {
|
|
101
|
-
const domain = d3.extent(values);
|
|
102
|
-
// Dibujo los gráficos
|
|
103
|
-
items.forEach((item) => {
|
|
104
|
-
switch (item.type) {
|
|
105
|
-
case 'limit':
|
|
106
|
-
this.drawLimitChart(svg, { ...item, domain });
|
|
107
|
-
break;
|
|
108
|
-
case 'column':
|
|
109
|
-
this.drawColumnChart(svg, { ...item, domain });
|
|
110
|
-
break;
|
|
111
|
-
case 'line':
|
|
112
|
-
this.drawLineChart(svg, { ...item, domain });
|
|
113
|
-
break;
|
|
114
|
-
case 'circle':
|
|
115
|
-
this.drawCircleChart(svg, { ...item, domain });
|
|
116
|
-
break;
|
|
117
|
-
case 'event':
|
|
118
|
-
this.drawEventsPlaceholder(svg, { ...item, domain });
|
|
119
|
-
break;
|
|
120
|
-
}
|
|
121
|
-
});
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
drawAxis(svg, values, domain) {
|
|
125
|
-
const element = svg.node()?.getBoundingClientRect();
|
|
126
|
-
const yScale = d3
|
|
127
|
-
.scaleLinear()
|
|
128
|
-
.domain(domain)
|
|
129
|
-
.range([element?.height || 0 - 4, 4]);
|
|
130
|
-
// Dibuja el eje en X
|
|
131
|
-
svg.select('.x-axis').remove();
|
|
132
|
-
svg
|
|
133
|
-
.append('rect')
|
|
134
|
-
.attr('class', 'x-axis')
|
|
135
|
-
.attr('fill', 'rgba(0, 0, 0, 0.08)')
|
|
136
|
-
.attr('x', 0)
|
|
137
|
-
.attr('width', element?.width || 0)
|
|
138
|
-
.attr('height', 1)
|
|
139
|
-
.attr('shape-rendering', 'crispEdges')
|
|
140
|
-
.attr('y', yScale(0));
|
|
141
|
-
/*
|
|
142
|
-
const yScale = d3.scaleLinear().domain([-5000, 8000]).range([this.height, 0]);
|
|
143
|
-
const yAxisGenerator = d3.axisLeft(yScale).ticks(8);
|
|
144
|
-
this.svg.append('g').call(yAxisGenerator).style('transform', 'translateX(50px)');
|
|
145
|
-
*/
|
|
146
|
-
}
|
|
147
|
-
drawCircleChart(svg, options) {
|
|
148
|
-
const domRect = svg.node().getBoundingClientRect();
|
|
149
|
-
const xAccessor = (d) => d[options.categoryField];
|
|
150
|
-
const yAccessor = (d) => d[options.field] || 0;
|
|
151
|
-
const xScale = d3
|
|
152
|
-
.scaleBand()
|
|
153
|
-
.domain(options.data.map(xAccessor))
|
|
154
|
-
.range([0, domRect.width])
|
|
155
|
-
.padding(typeof options.padding === 'number' ? options.padding : 0);
|
|
156
|
-
const yScale = d3
|
|
157
|
-
.scaleLinear()
|
|
158
|
-
.domain(options.domain ?? [
|
|
159
|
-
Math.min(d3.min(options.data, yAccessor), 0),
|
|
160
|
-
d3.max(options.data, yAccessor),
|
|
161
|
-
])
|
|
162
|
-
.range([domRect.height - 10, 10]);
|
|
163
|
-
const circles = svg
|
|
164
|
-
.append('g')
|
|
165
|
-
.attr('class', 'ft-chart__circle')
|
|
166
|
-
.selectAll(`circle`)
|
|
167
|
-
.data(options.data);
|
|
168
|
-
circles
|
|
169
|
-
.enter()
|
|
170
|
-
.append('circle')
|
|
171
|
-
.style('stroke', options.color ?? '#ff9800')
|
|
172
|
-
.attr('stroke-width', options.strokeWidth ?? 1)
|
|
173
|
-
.style('fill', 'var(--ft-body-bg)')
|
|
174
|
-
.attr('r', 1.5)
|
|
175
|
-
.merge(circles)
|
|
176
|
-
.attr('cx', (d) => Math.round((xScale(xAccessor(d)) || 0) + xScale.bandwidth() / 2))
|
|
177
|
-
.attr('cy', (d) => Math.round(yScale(yAccessor(d))));
|
|
178
|
-
circles.exit().remove();
|
|
179
|
-
}
|
|
180
|
-
drawColumnChart(svg, options) {
|
|
181
|
-
const element = svg.node().getBoundingClientRect();
|
|
182
|
-
const xAccessor = (d) => d[options.categoryField];
|
|
183
|
-
//const xAccessor = (d: any) => (new Date(d[options.categoryField]))?.getTime();
|
|
184
|
-
const yAccessor = (d) => d[options.field] || 0;
|
|
185
|
-
const xScale = d3
|
|
186
|
-
.scaleBand()
|
|
187
|
-
.domain(options.data.map(xAccessor))
|
|
188
|
-
.range([0, element.width])
|
|
189
|
-
.padding(options.padding ?? 0.5);
|
|
190
|
-
const yScale = d3
|
|
191
|
-
.scaleLinear()
|
|
192
|
-
.domain(options.domain
|
|
193
|
-
? options.domain
|
|
194
|
-
: [
|
|
195
|
-
Math.min(d3.min(options.data, yAccessor), 0),
|
|
196
|
-
d3.max(options.data, yAccessor),
|
|
197
|
-
])
|
|
198
|
-
.range([element.height - 4, 4]);
|
|
199
|
-
const columns = svg
|
|
200
|
-
.append('g')
|
|
201
|
-
.attr('class', 'ft-chart__column')
|
|
202
|
-
.selectAll('rect')
|
|
203
|
-
.data(options.data);
|
|
204
|
-
columns
|
|
205
|
-
.enter()
|
|
206
|
-
.append('rect')
|
|
207
|
-
.attr('x', (d) => xScale(xAccessor(d)))
|
|
208
|
-
.attr('y', (d) => yScale(yAccessor(d)))
|
|
209
|
-
.attr('shape-rendering', 'crispEdges')
|
|
210
|
-
.attr('fill', options.color ?? '#ff9800')
|
|
211
|
-
.attr('title', (d) => d[options.field])
|
|
212
|
-
.merge(columns)
|
|
213
|
-
.attr('width', Math.max(1, xScale.bandwidth()))
|
|
214
|
-
.attr('height', (d) => Math.abs(yScale(yAccessor(d)) - yScale(0)));
|
|
215
|
-
columns.exit().remove();
|
|
216
|
-
}
|
|
217
|
-
drawLineChart(svg, options) {
|
|
218
|
-
const domRect = svg.node().getBoundingClientRect();
|
|
219
|
-
const xAccessor = (d) => d[options.categoryField];
|
|
220
|
-
const yAccessor = (d) => d[options.field] || 0;
|
|
221
|
-
const xScale = d3
|
|
222
|
-
.scaleBand()
|
|
223
|
-
.domain(options.data.map(xAccessor))
|
|
224
|
-
.range([0, domRect.width])
|
|
225
|
-
.padding(typeof options.padding === 'number' ? options.padding : 0);
|
|
226
|
-
const yScale = d3
|
|
227
|
-
.scaleLinear()
|
|
228
|
-
.domain(options.domain ?? [
|
|
229
|
-
Math.min(d3.min(options.data, yAccessor), 0),
|
|
230
|
-
d3.max(options.data, yAccessor),
|
|
231
|
-
])
|
|
232
|
-
.range([domRect.height - 10, 10]);
|
|
233
|
-
const lineGenerator = d3
|
|
234
|
-
.line()
|
|
235
|
-
.x((d) => Math.round((xScale(xAccessor(d)) || 0) + xScale.bandwidth() / 2))
|
|
236
|
-
.y((d) => Math.round(yScale(yAccessor(d))));
|
|
237
|
-
svg
|
|
238
|
-
.append('path')
|
|
239
|
-
.attr('class', 'ft-chart__line')
|
|
240
|
-
.attr('fill', 'none')
|
|
241
|
-
.attr('stroke', options.color ?? '#ff9800')
|
|
242
|
-
.attr('stroke-width', options.strokeWidth ?? 2)
|
|
243
|
-
.attr('stroke-linecap', 'round')
|
|
244
|
-
.attr('d', lineGenerator(options.data));
|
|
245
|
-
}
|
|
246
|
-
drawLimitChart(svg, options) {
|
|
247
|
-
const element = svg.node().getBoundingClientRect();
|
|
248
|
-
const yAccessor = (d) => d[options.field] || 0;
|
|
249
|
-
const yScale = d3
|
|
250
|
-
.scaleLinear()
|
|
251
|
-
.domain(options.domain
|
|
252
|
-
? options.domain
|
|
253
|
-
: [
|
|
254
|
-
Math.min(d3.min(options.data, yAccessor), 0),
|
|
255
|
-
d3.max(options.data, yAccessor),
|
|
256
|
-
])
|
|
257
|
-
.range([element.height - 4, 4]);
|
|
258
|
-
const line = svg.append('g').selectAll('rect').data([options.data[0]]);
|
|
259
|
-
line
|
|
260
|
-
.enter()
|
|
261
|
-
.append('rect')
|
|
262
|
-
.attr('x', 0)
|
|
263
|
-
.attr('y', (d) => yScale(yAccessor(d)) + 1)
|
|
264
|
-
.attr('shape-rendering', 'crispEdges')
|
|
265
|
-
.attr('fill', options.color ?? '#ff9800')
|
|
266
|
-
.attr('title', 0)
|
|
267
|
-
.attr('width', () => '100%')
|
|
268
|
-
.attr('height', 1);
|
|
269
|
-
line.exit().remove();
|
|
270
|
-
line
|
|
271
|
-
.enter()
|
|
272
|
-
.append('text')
|
|
273
|
-
.attr('style', 'font-weight: 600; font-size: var(--ft-text-font-size-sm);')
|
|
274
|
-
.attr('x', 0)
|
|
275
|
-
.attr('y', (d) => yScale(yAccessor(d)) + 16)
|
|
276
|
-
.attr('fill', 'var(--ft-danger-color)')
|
|
277
|
-
.text(options.label);
|
|
278
|
-
}
|
|
279
|
-
drawEventsPlaceholder(svg, options) {
|
|
280
|
-
const domRect = svg.node().getBoundingClientRect();
|
|
281
|
-
const xAccessor = (d) => d[options.categoryField];
|
|
282
|
-
const yAccessor = (d) => d[options.field] || 0;
|
|
283
|
-
const xScale = d3
|
|
284
|
-
.scaleBand()
|
|
285
|
-
.domain(options.data.map(xAccessor))
|
|
286
|
-
.range([0, domRect.width])
|
|
287
|
-
.padding(typeof options.padding === 'number' ? options.padding : 0);
|
|
288
|
-
const yScale = d3
|
|
289
|
-
.scaleLinear()
|
|
290
|
-
.domain(options.domain ?? [
|
|
291
|
-
Math.min(d3.min(options.data, yAccessor), 0),
|
|
292
|
-
d3.max(options.data, yAccessor),
|
|
293
|
-
])
|
|
294
|
-
.range([domRect.height, 0]);
|
|
295
|
-
const columns = svg
|
|
296
|
-
.append('g')
|
|
297
|
-
.attr('class', 'ft-chart__placeholder')
|
|
298
|
-
.selectAll('rect')
|
|
299
|
-
.data(options.data);
|
|
300
|
-
columns
|
|
301
|
-
.enter()
|
|
302
|
-
.append('rect')
|
|
303
|
-
.attr('x', (d) => xScale(d[options.categoryField]))
|
|
304
|
-
.attr('y', () => 0)
|
|
305
|
-
.attr('shape-rendering', 'crispEdges')
|
|
306
|
-
.attr('fill', 'rgba(0,0,0,0)')
|
|
307
|
-
.attr('tabindex', 0)
|
|
308
|
-
.merge(columns)
|
|
309
|
-
.attr('width', Math.max(1, xScale.bandwidth()))
|
|
310
|
-
.attr('height', () => yScale(0))
|
|
311
|
-
.on('click', (event, d) => {
|
|
312
|
-
if (options.click) {
|
|
313
|
-
options.click(event, d);
|
|
314
|
-
}
|
|
315
|
-
});
|
|
316
|
-
columns.exit().remove();
|
|
317
|
-
}
|
|
318
|
-
handleResize() {
|
|
319
|
-
clearTimeout(this.resizeTimeout);
|
|
320
|
-
this.resizeTimeout = setTimeout(() => {
|
|
321
|
-
for (const [element, items] of this.charts.entries()) {
|
|
322
|
-
this.render(element, items);
|
|
323
|
-
}
|
|
324
|
-
}, 300);
|
|
325
|
-
}
|
|
326
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: ChartService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
327
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: ChartService, providedIn: 'root' });
|
|
328
|
-
}
|
|
329
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: ChartService, decorators: [{
|
|
330
|
-
type: Injectable,
|
|
331
|
-
args: [{
|
|
332
|
-
providedIn: 'root',
|
|
333
|
-
}]
|
|
334
|
-
}], ctorParameters: () => [] });
|
|
335
|
-
|
|
336
74
|
const UI_OPTIONS = new InjectionToken('UI_OPTIONS');
|
|
337
75
|
|
|
338
|
-
class
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
}
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
}
|
|
346
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: UiService, decorators: [{
|
|
347
|
-
type: Injectable,
|
|
348
|
-
args: [{
|
|
349
|
-
providedIn: 'root'
|
|
350
|
-
}]
|
|
351
|
-
}] });
|
|
352
|
-
|
|
353
|
-
class IconComponent {
|
|
354
|
-
options = inject(UiService);
|
|
355
|
-
collection = input();
|
|
356
|
-
mode = input();
|
|
357
|
-
name = input.required();
|
|
358
|
-
path = input();
|
|
359
|
-
src = input();
|
|
76
|
+
class Icon {
|
|
77
|
+
UIOptions = inject(UI_OPTIONS, { optional: true });
|
|
78
|
+
options = signal(this.UIOptions || null, ...(ngDevMode ? [{ debugName: "options" }] : /* istanbul ignore next */ []));
|
|
79
|
+
collection = input(...(ngDevMode ? [undefined, { debugName: "collection" }] : /* istanbul ignore next */ []));
|
|
80
|
+
mode = input(...(ngDevMode ? [undefined, { debugName: "mode" }] : /* istanbul ignore next */ []));
|
|
81
|
+
name = input.required(...(ngDevMode ? [{ debugName: "name" }] : /* istanbul ignore next */ []));
|
|
82
|
+
path = input(...(ngDevMode ? [undefined, { debugName: "path" }] : /* istanbul ignore next */ []));
|
|
83
|
+
src = input(...(ngDevMode ? [undefined, { debugName: "src" }] : /* istanbul ignore next */ []));
|
|
360
84
|
url = computed(() => {
|
|
361
|
-
let collection = this.collection();
|
|
85
|
+
let collection = this.collection() ?? 'icons';
|
|
362
86
|
let mode = this.mode();
|
|
363
87
|
let path = this.path();
|
|
364
|
-
const options = this.options
|
|
88
|
+
const options = this.options()?.iconSettings;
|
|
365
89
|
// Set the default collection if the mode is external
|
|
366
90
|
if (!this.collection()) {
|
|
367
91
|
if (options && options.collection) {
|
|
@@ -372,7 +96,7 @@ class IconComponent {
|
|
|
372
96
|
}
|
|
373
97
|
}
|
|
374
98
|
if (!this.mode()) {
|
|
375
|
-
if (this.options
|
|
99
|
+
if (this.options()?.iconSettings && options?.mode) {
|
|
376
100
|
mode = options.mode;
|
|
377
101
|
}
|
|
378
102
|
else {
|
|
@@ -386,7 +110,7 @@ class IconComponent {
|
|
|
386
110
|
path = options.path;
|
|
387
111
|
}
|
|
388
112
|
else {
|
|
389
|
-
path = '
|
|
113
|
+
path = '';
|
|
390
114
|
}
|
|
391
115
|
}
|
|
392
116
|
return `${path}/${collection}.svg#${this.name()}`;
|
|
@@ -398,29 +122,24 @@ class IconComponent {
|
|
|
398
122
|
: this.name();
|
|
399
123
|
return `#${name}`;
|
|
400
124
|
}
|
|
401
|
-
});
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
return ['ft-icon', this.class()].join(' ');
|
|
405
|
-
}
|
|
406
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: IconComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
407
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.6", type: IconComponent, isStandalone: true, selector: "ft-icon", inputs: { collection: { classPropertyName: "collection", publicName: "collection", isSignal: true, isRequired: false, transformFunction: null }, mode: { classPropertyName: "mode", publicName: "mode", isSignal: true, isRequired: false, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: true, transformFunction: null }, path: { classPropertyName: "path", publicName: "path", isSignal: true, isRequired: false, transformFunction: null }, src: { classPropertyName: "src", publicName: "src", isSignal: true, isRequired: false, transformFunction: null }, class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "this.hostClasses" } }, ngImport: i0, template: "@if (!src()) {\n<svg>\n <use attr.href=\"{{ url() }}\" />\n</svg>\n} @else {\n<img [src]=\"src()\" alt=\"\" />\n}", styles: [":host{line-height:0;display:inline-block}:host svg{width:1em;height:1em;vertical-align:middle;fill:currentColor;display:inline-block}:host img{height:1em;vertical-align:middle;display:inline-block}:host.ft-icon--1{font-size:1rem}:host.ft-icon--2{font-size:1.5rem}:host.ft-icon--3{font-size:2rem}:host.ft-icon--4{font-size:3rem}:host.ft-icon--5{font-size:4.5rem}:host.ft-icon--6{font-size:8rem}:host.ft-icon--7{font-size:16rem}:host.ft-icon--8{font-size:32rem}\n"] });
|
|
125
|
+
}, ...(ngDevMode ? [{ debugName: "url" }] : /* istanbul ignore next */ []));
|
|
126
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: Icon, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
127
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.4", type: Icon, isStandalone: true, selector: "ft-icon", inputs: { collection: { classPropertyName: "collection", publicName: "collection", isSignal: true, isRequired: false, transformFunction: null }, mode: { classPropertyName: "mode", publicName: "mode", isSignal: true, isRequired: false, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: true, transformFunction: null }, path: { classPropertyName: "path", publicName: "path", isSignal: true, isRequired: false, transformFunction: null }, src: { classPropertyName: "src", publicName: "src", isSignal: true, isRequired: false, transformFunction: null } }, host: { classAttribute: "ft-icon" }, ngImport: i0, template: "@if (!src()) {\n<svg>\n <use attr.href=\"{{ url() }}\" />\n</svg>\n} @else {\n<img [src]=\"src()\" alt=\"\" />\n}", styles: [":host{display:inline-block;line-height:0;vertical-align:middle}svg{width:1em;height:1em;display:block}img{max-width:100%;height:auto;display:block}\n"] });
|
|
408
128
|
}
|
|
409
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
129
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: Icon, decorators: [{
|
|
410
130
|
type: Component,
|
|
411
|
-
args: [{ selector: 'ft-icon',
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
}] } });
|
|
131
|
+
args: [{ selector: 'ft-icon', imports: [], host: {
|
|
132
|
+
class: 'ft-icon'
|
|
133
|
+
}, template: "@if (!src()) {\n<svg>\n <use attr.href=\"{{ url() }}\" />\n</svg>\n} @else {\n<img [src]=\"src()\" alt=\"\" />\n}", styles: [":host{display:inline-block;line-height:0;vertical-align:middle}svg{width:1em;height:1em;display:block}img{max-width:100%;height:auto;display:block}\n"] }]
|
|
134
|
+
}], propDecorators: { collection: [{ type: i0.Input, args: [{ isSignal: true, alias: "collection", required: false }] }], mode: [{ type: i0.Input, args: [{ isSignal: true, alias: "mode", required: false }] }], name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: true }] }], path: [{ type: i0.Input, args: [{ isSignal: true, alias: "path", required: false }] }], src: [{ type: i0.Input, args: [{ isSignal: true, alias: "src", required: false }] }] } });
|
|
416
135
|
|
|
417
|
-
class
|
|
136
|
+
class LazyImage {
|
|
418
137
|
element = inject(ElementRef);
|
|
419
|
-
class = input('');
|
|
138
|
+
class = input('', ...(ngDevMode ? [{ debugName: "class" }] : /* istanbul ignore next */ []));
|
|
420
139
|
error;
|
|
421
140
|
loading = false;
|
|
422
|
-
src = input.required();
|
|
423
|
-
alt = input('');
|
|
141
|
+
src = input.required(...(ngDevMode ? [{ debugName: "src" }] : /* istanbul ignore next */ []));
|
|
142
|
+
alt = input('', ...(ngDevMode ? [{ debugName: "alt" }] : /* istanbul ignore next */ []));
|
|
424
143
|
shown = false;
|
|
425
144
|
ngOnInit() {
|
|
426
145
|
if ('IntersectionObserver' in window) {
|
|
@@ -467,27 +186,101 @@ class ImageComponent {
|
|
|
467
186
|
get hostClasses() {
|
|
468
187
|
return ['ft-image', this.class()].join(' ');
|
|
469
188
|
}
|
|
470
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
471
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "
|
|
189
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: LazyImage, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
190
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.4", type: LazyImage, isStandalone: true, selector: "ft-lazy-image", inputs: { class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null }, src: { classPropertyName: "src", publicName: "src", isSignal: true, isRequired: true, transformFunction: null }, alt: { classPropertyName: "alt", publicName: "alt", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class.ft-image--error": "this.error", "class.ft-image--loading": "this.loading", "class": "this.hostClasses" } }, ngImport: i0, template: "@if (shown) {\n <img [src]=\"src()\" [alt]=\"alt()\" />\n}\n@if (error) {\n <ft-icon name=\"warning\" />\n}\n", styles: [""], dependencies: [{ kind: "component", type: Icon, selector: "ft-icon", inputs: ["collection", "mode", "name", "path", "src"] }] });
|
|
472
191
|
}
|
|
473
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
192
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: LazyImage, decorators: [{
|
|
474
193
|
type: Component,
|
|
475
|
-
args: [{ selector: 'ft-image',
|
|
476
|
-
}], propDecorators: { error: [{
|
|
194
|
+
args: [{ selector: 'ft-lazy-image', imports: [Icon], template: "@if (shown) {\n <img [src]=\"src()\" [alt]=\"alt()\" />\n}\n@if (error) {\n <ft-icon name=\"warning\" />\n}\n" }]
|
|
195
|
+
}], propDecorators: { class: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }], error: [{
|
|
477
196
|
type: HostBinding,
|
|
478
197
|
args: ['class.ft-image--error']
|
|
479
198
|
}], loading: [{
|
|
480
199
|
type: HostBinding,
|
|
481
200
|
args: ['class.ft-image--loading']
|
|
482
|
-
}], hostClasses: [{
|
|
201
|
+
}], src: [{ type: i0.Input, args: [{ isSignal: true, alias: "src", required: true }] }], alt: [{ type: i0.Input, args: [{ isSignal: true, alias: "alt", required: false }] }], hostClasses: [{
|
|
202
|
+
type: HostBinding,
|
|
203
|
+
args: ['class']
|
|
204
|
+
}] } });
|
|
205
|
+
|
|
206
|
+
class Progress {
|
|
207
|
+
mode = input('indeterminate', ...(ngDevMode ? [{ debugName: "mode" }] : /* istanbul ignore next */ []));
|
|
208
|
+
overlay = input(false, ...(ngDevMode ? [{ debugName: "overlay" }] : /* istanbul ignore next */ []));
|
|
209
|
+
value = input(0, ...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
|
|
210
|
+
class = input('', ...(ngDevMode ? [{ debugName: "class" }] : /* istanbul ignore next */ []));
|
|
211
|
+
get hostClasses() {
|
|
212
|
+
return [
|
|
213
|
+
'ft-progress',
|
|
214
|
+
this.overlay() ? 'ft-progress--overlay' : '',
|
|
215
|
+
this.class()
|
|
216
|
+
].join(' ');
|
|
217
|
+
}
|
|
218
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: Progress, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
219
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.4", type: Progress, isStandalone: true, selector: "ft-progress", inputs: { mode: { classPropertyName: "mode", publicName: "mode", isSignal: true, isRequired: false, transformFunction: null }, overlay: { classPropertyName: "overlay", publicName: "overlay", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "this.hostClasses" } }, ngImport: i0, template: "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 100 100\" preserveAspectRatio=\"xMidYMid\">\n <circle class=\"ft-track\" cx=\"50\" cy=\"50\" r=\"40\" />\n <circle class=\"ft-bar\" \n [class.ft-bar--determinate]=\"mode() === 'determinate'\"\n [class.ft-bar--indeterminate]=\"mode() === 'indeterminate'\"\n cx=\"50\" cy=\"50\" r=\"40\"\n [style.stroke-dashoffset]=\"mode() === 'determinate' ? 'calc((3.14159265 * 40 * 2 * (100 - ' + value() + ')) / 100)' : null\">\n </circle>\n</svg>", styles: [":host{line-height:0;display:inline-block}svg{width:1em;height:1em;vertical-align:middle}svg .ft-track{fill:none;stroke-width:10;stroke:var(--ft-progress-track-color)}svg .ft-bar{fill:none;stroke-opacity:.9;stroke-width:6;stroke:var(--ft-progress-bar-color)}svg .ft-bar--indeterminate{animation:ft-progress-rotation 2s infinite linear}svg .ft-bar--determinate{stroke-dasharray:calc(2 * 3.1415926536 * 40)}@keyframes ft-progress-reveal{0%{transform:translateY(-100%);opacity:0}to{transform:translateY(0);opacity:1}}@keyframes ft-progress-rotation{0%{stroke-dashoffset:0;stroke-dasharray:150.6 100.4}50%{stroke-dasharray:1 250}to{stroke-dashoffset:502;stroke-dasharray:150.6 100.4}}\n"] });
|
|
220
|
+
}
|
|
221
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: Progress, decorators: [{
|
|
222
|
+
type: Component,
|
|
223
|
+
args: [{ selector: 'ft-progress', imports: [], template: "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 100 100\" preserveAspectRatio=\"xMidYMid\">\n <circle class=\"ft-track\" cx=\"50\" cy=\"50\" r=\"40\" />\n <circle class=\"ft-bar\" \n [class.ft-bar--determinate]=\"mode() === 'determinate'\"\n [class.ft-bar--indeterminate]=\"mode() === 'indeterminate'\"\n cx=\"50\" cy=\"50\" r=\"40\"\n [style.stroke-dashoffset]=\"mode() === 'determinate' ? 'calc((3.14159265 * 40 * 2 * (100 - ' + value() + ')) / 100)' : null\">\n </circle>\n</svg>", styles: [":host{line-height:0;display:inline-block}svg{width:1em;height:1em;vertical-align:middle}svg .ft-track{fill:none;stroke-width:10;stroke:var(--ft-progress-track-color)}svg .ft-bar{fill:none;stroke-opacity:.9;stroke-width:6;stroke:var(--ft-progress-bar-color)}svg .ft-bar--indeterminate{animation:ft-progress-rotation 2s infinite linear}svg .ft-bar--determinate{stroke-dasharray:calc(2 * 3.1415926536 * 40)}@keyframes ft-progress-reveal{0%{transform:translateY(-100%);opacity:0}to{transform:translateY(0);opacity:1}}@keyframes ft-progress-rotation{0%{stroke-dashoffset:0;stroke-dasharray:150.6 100.4}50%{stroke-dasharray:1 250}to{stroke-dashoffset:502;stroke-dasharray:150.6 100.4}}\n"] }]
|
|
224
|
+
}], propDecorators: { mode: [{ type: i0.Input, args: [{ isSignal: true, alias: "mode", required: false }] }], overlay: [{ type: i0.Input, args: [{ isSignal: true, alias: "overlay", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }], class: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }], hostClasses: [{
|
|
483
225
|
type: HostBinding,
|
|
484
226
|
args: ['class']
|
|
485
227
|
}] } });
|
|
486
228
|
|
|
229
|
+
class Rating {
|
|
230
|
+
readOnly = input(false, ...(ngDevMode ? [{ debugName: "readOnly" }] : /* istanbul ignore next */ []));
|
|
231
|
+
value = input(0, ...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
|
|
232
|
+
disabled = input(false, ...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
|
|
233
|
+
valueChange = output();
|
|
234
|
+
stars = [
|
|
235
|
+
{ value: 1 },
|
|
236
|
+
{ value: 2 },
|
|
237
|
+
{ value: 3 },
|
|
238
|
+
{ value: 4 },
|
|
239
|
+
{ value: 5 }
|
|
240
|
+
];
|
|
241
|
+
hoverValue = signal(0, ...(ngDevMode ? [{ debugName: "hoverValue" }] : /* istanbul ignore next */ []));
|
|
242
|
+
isHovered = computed(() => (starValue) => {
|
|
243
|
+
return this.hoverValue() >= starValue;
|
|
244
|
+
}, ...(ngDevMode ? [{ debugName: "isHovered" }] : /* istanbul ignore next */ []));
|
|
245
|
+
isActive = computed(() => (starValue) => {
|
|
246
|
+
return this.value() >= starValue;
|
|
247
|
+
}, ...(ngDevMode ? [{ debugName: "isActive" }] : /* istanbul ignore next */ []));
|
|
248
|
+
iconClasses = computed(() => (starValue) => {
|
|
249
|
+
const hovered = this.isHovered()(starValue);
|
|
250
|
+
const active = this.isActive()(starValue);
|
|
251
|
+
return {
|
|
252
|
+
'ft-rating__item-icon--hover': hovered,
|
|
253
|
+
'ft-rating__item-icon--active': active
|
|
254
|
+
};
|
|
255
|
+
}, ...(ngDevMode ? [{ debugName: "iconClasses" }] : /* istanbul ignore next */ []));
|
|
256
|
+
setRate(value, isHover = false) {
|
|
257
|
+
if (isHover) {
|
|
258
|
+
this.hoverValue.set(value);
|
|
259
|
+
}
|
|
260
|
+
else {
|
|
261
|
+
this.valueChange.emit(value);
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
clearHover() {
|
|
265
|
+
this.hoverValue.set(0);
|
|
266
|
+
}
|
|
267
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: Rating, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
268
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.4", type: Rating, isStandalone: true, selector: "ft-rating", inputs: { readOnly: { classPropertyName: "readOnly", publicName: "readOnly", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { valueChange: "valueChange" }, ngImport: i0, template: "@for (star of stars; track star.value) {\n @if (!readOnly()) {\n <button \n type=\"button\" \n class=\"ft-rating__item\" \n [disabled]=\"disabled()\" \n (mouseover)=\"setRate(star.value, true)\"\n (focus)=\"setRate(star.value, true)\" \n (blur)=\"clearHover()\" \n (mouseout)=\"clearHover()\"\n (click)=\"setRate(star.value)\">\n <svg \n [class]=\"iconClasses()(star.value)\"\n viewBox=\"0 0 24 24\"\n aria-hidden=\"true\">\n <path\n d=\"M17.93 21.315c-.534.408-5.22-3.186-5.881-3.181-.663 0-5.307 3.656-5.846 3.254-.537-.403 1.29-6.165 1.081-6.822-.209-.656-4.972-4.138-4.772-4.796.201-.658 6.015-.627 6.55-1.036.533-.41 2.233-6.215 2.895-6.219.663 0 2.43 5.779 2.968 6.182.539.403 6.352.297 6.56.953.21.656-4.513 4.197-4.714 4.856-.2.658 1.692 6.398 1.159 6.808z\" />\n </svg>\n </button>\n } @else {\n <svg \n [class]=\"iconClasses()(star.value)\"\n viewBox=\"0 0 24 24\"\n aria-hidden=\"true\">\n <path\n d=\"M17.93 21.315c-.534.408-5.22-3.186-5.881-3.181-.663 0-5.307 3.656-5.846 3.254-.537-.403 1.29-6.165 1.081-6.822-.209-.656-4.972-4.138-4.772-4.796.201-.658 6.015-.627 6.55-1.036.533-.41 2.233-6.215 2.895-6.219.663 0 2.43 5.779 2.968 6.182.539.403 6.352.297 6.56.953.21.656-4.513 4.197-4.714 4.856-.2.658 1.692 6.398 1.159 6.808z\" />\n </svg>\n }\n}\n", styles: [".ft-rating__item{background-color:transparent;border:0;padding:0;cursor:pointer;outline:none;transition:transform .2s ease}.ft-rating__item:hover:not(:disabled){transform:scale(1.1)}.ft-rating__item:disabled{cursor:not-allowed;opacity:.5}.ft-rating__item:focus-visible{outline:2px solid #3b82f6;outline-offset:2px;border-radius:.25rem}.ft-rating__item-icon--active{fill:var(--ft-rating-active-color, #fbbf24);transition:fill .2s ease}.ft-rating__item-icon--hover{fill:var(--ft-rating-hover-color, #fcd34d);transition:fill .2s ease}svg:not(.ft-rating__item-icon--active):not(.ft-rating__item-icon--hover){fill:var(--ft-rating-default-color, #d1d5db);transition:fill .2s ease}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
269
|
+
}
|
|
270
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: Rating, decorators: [{
|
|
271
|
+
type: Component,
|
|
272
|
+
args: [{ selector: 'ft-rating', imports: [], changeDetection: ChangeDetectionStrategy.OnPush, template: "@for (star of stars; track star.value) {\n @if (!readOnly()) {\n <button \n type=\"button\" \n class=\"ft-rating__item\" \n [disabled]=\"disabled()\" \n (mouseover)=\"setRate(star.value, true)\"\n (focus)=\"setRate(star.value, true)\" \n (blur)=\"clearHover()\" \n (mouseout)=\"clearHover()\"\n (click)=\"setRate(star.value)\">\n <svg \n [class]=\"iconClasses()(star.value)\"\n viewBox=\"0 0 24 24\"\n aria-hidden=\"true\">\n <path\n d=\"M17.93 21.315c-.534.408-5.22-3.186-5.881-3.181-.663 0-5.307 3.656-5.846 3.254-.537-.403 1.29-6.165 1.081-6.822-.209-.656-4.972-4.138-4.772-4.796.201-.658 6.015-.627 6.55-1.036.533-.41 2.233-6.215 2.895-6.219.663 0 2.43 5.779 2.968 6.182.539.403 6.352.297 6.56.953.21.656-4.513 4.197-4.714 4.856-.2.658 1.692 6.398 1.159 6.808z\" />\n </svg>\n </button>\n } @else {\n <svg \n [class]=\"iconClasses()(star.value)\"\n viewBox=\"0 0 24 24\"\n aria-hidden=\"true\">\n <path\n d=\"M17.93 21.315c-.534.408-5.22-3.186-5.881-3.181-.663 0-5.307 3.656-5.846 3.254-.537-.403 1.29-6.165 1.081-6.822-.209-.656-4.972-4.138-4.772-4.796.201-.658 6.015-.627 6.55-1.036.533-.41 2.233-6.215 2.895-6.219.663 0 2.43 5.779 2.968 6.182.539.403 6.352.297 6.56.953.21.656-4.513 4.197-4.714 4.856-.2.658 1.692 6.398 1.159 6.808z\" />\n </svg>\n }\n}\n", styles: [".ft-rating__item{background-color:transparent;border:0;padding:0;cursor:pointer;outline:none;transition:transform .2s ease}.ft-rating__item:hover:not(:disabled){transform:scale(1.1)}.ft-rating__item:disabled{cursor:not-allowed;opacity:.5}.ft-rating__item:focus-visible{outline:2px solid #3b82f6;outline-offset:2px;border-radius:.25rem}.ft-rating__item-icon--active{fill:var(--ft-rating-active-color, #fbbf24);transition:fill .2s ease}.ft-rating__item-icon--hover{fill:var(--ft-rating-hover-color, #fcd34d);transition:fill .2s ease}svg:not(.ft-rating__item-icon--active):not(.ft-rating__item-icon--hover){fill:var(--ft-rating-default-color, #d1d5db);transition:fill .2s ease}\n"] }]
|
|
273
|
+
}], propDecorators: { readOnly: [{ type: i0.Input, args: [{ isSignal: true, alias: "readOnly", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], valueChange: [{ type: i0.Output, args: ["valueChange"] }] } });
|
|
274
|
+
|
|
275
|
+
const MESSAGE_POSITION = {
|
|
276
|
+
TOP: 'top',
|
|
277
|
+
BOTTOM: 'bottom'
|
|
278
|
+
};
|
|
279
|
+
|
|
487
280
|
class MessageContentComponent {
|
|
488
281
|
data = inject(MAT_SNACK_BAR_DATA);
|
|
489
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
490
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "
|
|
282
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: MessageContentComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
283
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.4", type: MessageContentComponent, isStandalone: true, selector: "ng-component", ngImport: i0, template: `
|
|
491
284
|
@if (data.options.icon) {
|
|
492
285
|
<ft-icon [name]="data.options.icon" class="ft-icon--2" />
|
|
493
286
|
} @switch (data.message?.type) { @case ('html') {
|
|
@@ -495,13 +288,13 @@ class MessageContentComponent {
|
|
|
495
288
|
} @default {
|
|
496
289
|
{{ data.message?.content }}
|
|
497
290
|
} }
|
|
498
|
-
`, isInline: true, dependencies: [{ kind: "ngmodule", type: MatSnackBarModule }, { kind: "component", type:
|
|
291
|
+
`, isInline: true, dependencies: [{ kind: "ngmodule", type: MatSnackBarModule }, { kind: "component", type: Icon, selector: "ft-icon", inputs: ["collection", "mode", "name", "path", "src"] }] });
|
|
499
292
|
}
|
|
500
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
293
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: MessageContentComponent, decorators: [{
|
|
501
294
|
type: Component,
|
|
502
295
|
args: [{
|
|
503
296
|
standalone: true,
|
|
504
|
-
imports: [MatSnackBarModule,
|
|
297
|
+
imports: [MatSnackBarModule, Icon],
|
|
505
298
|
template: `
|
|
506
299
|
@if (data.options.icon) {
|
|
507
300
|
<ft-icon [name]="data.options.icon" class="ft-icon--2" />
|
|
@@ -519,8 +312,8 @@ class MessageDialogComponent {
|
|
|
519
312
|
select(value) {
|
|
520
313
|
this.beforeSelect.emit(value);
|
|
521
314
|
}
|
|
522
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
523
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "
|
|
315
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: MessageDialogComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
316
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.4", type: MessageDialogComponent, isStandalone: true, selector: "ng-component", outputs: { beforeSelect: "beforeSelect" }, ngImport: i0, template: `
|
|
524
317
|
@if (data.options?.title) {
|
|
525
318
|
<h1 mat-dialog-title class="ft-message__title">
|
|
526
319
|
@if (data.options?.titleIcon) {
|
|
@@ -563,7 +356,7 @@ class MessageDialogComponent {
|
|
|
563
356
|
>
|
|
564
357
|
{{ action.label }}
|
|
565
358
|
</button>
|
|
566
|
-
} @case ('flat') {
|
|
359
|
+
} @case ('flat') @case ('filled') {
|
|
567
360
|
<button
|
|
568
361
|
type="button"
|
|
569
362
|
mat-flat-button
|
|
@@ -572,7 +365,7 @@ class MessageDialogComponent {
|
|
|
572
365
|
>
|
|
573
366
|
{{ action.label }}
|
|
574
367
|
</button>
|
|
575
|
-
} @case ('stroked') {
|
|
368
|
+
} @case ('stroked') @case ('outlined') {
|
|
576
369
|
<button
|
|
577
370
|
type="button"
|
|
578
371
|
mat-stroked-button
|
|
@@ -598,13 +391,13 @@ class MessageDialogComponent {
|
|
|
598
391
|
}
|
|
599
392
|
</div>
|
|
600
393
|
}
|
|
601
|
-
`, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i2.MatButton, selector: " button[mat-button], button[mat-raised-button],
|
|
394
|
+
`, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i2.MatButton, selector: " button[matButton], a[matButton], button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button], a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button] ", inputs: ["matButton"], exportAs: ["matButton", "matAnchor"] }, { kind: "ngmodule", type: MatDialogModule }, { kind: "directive", type: i3.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { kind: "directive", type: i3.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]", inputs: ["align"] }, { kind: "directive", type: i3.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { kind: "component", type: Icon, selector: "ft-icon", inputs: ["collection", "mode", "name", "path", "src"] }] });
|
|
602
395
|
}
|
|
603
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
396
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: MessageDialogComponent, decorators: [{
|
|
604
397
|
type: Component,
|
|
605
398
|
args: [{
|
|
606
399
|
standalone: true,
|
|
607
|
-
imports: [CommonModule, MatButtonModule, MatDialogModule,
|
|
400
|
+
imports: [CommonModule, MatButtonModule, MatDialogModule, Icon],
|
|
608
401
|
template: `
|
|
609
402
|
@if (data.options?.title) {
|
|
610
403
|
<h1 mat-dialog-title class="ft-message__title">
|
|
@@ -648,7 +441,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.6", ngImpor
|
|
|
648
441
|
>
|
|
649
442
|
{{ action.label }}
|
|
650
443
|
</button>
|
|
651
|
-
} @case ('flat') {
|
|
444
|
+
} @case ('flat') @case ('filled') {
|
|
652
445
|
<button
|
|
653
446
|
type="button"
|
|
654
447
|
mat-flat-button
|
|
@@ -657,7 +450,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.6", ngImpor
|
|
|
657
450
|
>
|
|
658
451
|
{{ action.label }}
|
|
659
452
|
</button>
|
|
660
|
-
} @case ('stroked') {
|
|
453
|
+
} @case ('stroked') @case ('outlined') {
|
|
661
454
|
<button
|
|
662
455
|
type="button"
|
|
663
456
|
mat-stroked-button
|
|
@@ -685,11 +478,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.6", ngImpor
|
|
|
685
478
|
}
|
|
686
479
|
`,
|
|
687
480
|
}]
|
|
688
|
-
}] });
|
|
481
|
+
}], propDecorators: { beforeSelect: [{ type: i0.Output, args: ["beforeSelect"] }] } });
|
|
689
482
|
class MessageService {
|
|
690
483
|
snackBar = inject(MatSnackBar);
|
|
691
484
|
dialog = inject(MatDialog);
|
|
692
|
-
|
|
485
|
+
stringUtil = inject(StringUtil);
|
|
693
486
|
show(message, options) {
|
|
694
487
|
const selectionSource = new ReplaySubject(undefined);
|
|
695
488
|
const selection = selectionSource.asObservable();
|
|
@@ -716,8 +509,8 @@ class MessageService {
|
|
|
716
509
|
data,
|
|
717
510
|
panelClass,
|
|
718
511
|
duration: options.duration ??
|
|
719
|
-
Math.min(this.
|
|
720
|
-
verticalPosition:
|
|
512
|
+
Math.min(this.stringUtil.calculateReadingTime(typeof message === 'string' ? message : message.content), 30000),
|
|
513
|
+
verticalPosition: MESSAGE_POSITION.TOP,
|
|
721
514
|
});
|
|
722
515
|
snackBarRef.onAction().subscribe(() => {
|
|
723
516
|
snackBarRef.dismiss();
|
|
@@ -739,28 +532,28 @@ class MessageService {
|
|
|
739
532
|
}
|
|
740
533
|
return selection;
|
|
741
534
|
}
|
|
742
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
743
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
535
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: MessageService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
536
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: MessageService, providedIn: 'root' });
|
|
744
537
|
}
|
|
745
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
538
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: MessageService, decorators: [{
|
|
746
539
|
type: Injectable,
|
|
747
540
|
args: [{
|
|
748
541
|
providedIn: 'root',
|
|
749
542
|
}]
|
|
750
543
|
}] });
|
|
751
544
|
|
|
752
|
-
class
|
|
545
|
+
class ObserveIntersecting {
|
|
753
546
|
element = inject(ElementRef);
|
|
754
547
|
platformId = inject(PLATFORM_ID);
|
|
755
548
|
elementObserver = null;
|
|
756
|
-
ftObserveIntersectingOptions = input();
|
|
757
|
-
|
|
549
|
+
ftObserveIntersectingOptions = input(...(ngDevMode ? [undefined, { debugName: "ftObserveIntersectingOptions" }] : /* istanbul ignore next */ []));
|
|
550
|
+
ftObserveIntersecting = output();
|
|
758
551
|
ngOnInit() {
|
|
759
552
|
if (isPlatformBrowser(this.platformId)) {
|
|
760
553
|
if ('IntersectionObserver' in window) {
|
|
761
554
|
this.elementObserver = new IntersectionObserver((entries) => {
|
|
762
555
|
entries.forEach((entry) => {
|
|
763
|
-
this.
|
|
556
|
+
this.ftObserveIntersecting.emit(entry.isIntersecting);
|
|
764
557
|
});
|
|
765
558
|
}, this.ftObserveIntersectingOptions());
|
|
766
559
|
this.elementObserver.observe(this.element.nativeElement);
|
|
@@ -776,152 +569,29 @@ class ObserveIntersectingDirective {
|
|
|
776
569
|
this.elementObserver = null;
|
|
777
570
|
}
|
|
778
571
|
}
|
|
779
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
780
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "
|
|
572
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: ObserveIntersecting, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
573
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.4", type: ObserveIntersecting, isStandalone: true, selector: "[ftObserveIntersecting]", inputs: { ftObserveIntersectingOptions: { classPropertyName: "ftObserveIntersectingOptions", publicName: "ftObserveIntersectingOptions", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { ftObserveIntersecting: "ftObserveIntersecting" }, ngImport: i0 });
|
|
781
574
|
}
|
|
782
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
575
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: ObserveIntersecting, decorators: [{
|
|
783
576
|
type: Directive,
|
|
784
577
|
args: [{
|
|
785
|
-
selector: '[ftObserveIntersecting]'
|
|
786
|
-
standalone: true
|
|
578
|
+
selector: '[ftObserveIntersecting]'
|
|
787
579
|
}]
|
|
788
|
-
}] });
|
|
789
|
-
|
|
790
|
-
class ProgressComponent {
|
|
791
|
-
mode = input('indeterminate');
|
|
792
|
-
overlay = input(false);
|
|
793
|
-
value = input(0);
|
|
794
|
-
class = input('');
|
|
795
|
-
get hostClasses() {
|
|
796
|
-
return [
|
|
797
|
-
'ft-progress',
|
|
798
|
-
this.overlay() ? 'ft-progress--overlay' : '',
|
|
799
|
-
this.class()
|
|
800
|
-
].join(' ');
|
|
801
|
-
}
|
|
802
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: ProgressComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
803
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.0.6", type: ProgressComponent, isStandalone: true, selector: "ft-progress", inputs: { mode: { classPropertyName: "mode", publicName: "mode", isSignal: true, isRequired: false, transformFunction: null }, overlay: { classPropertyName: "overlay", publicName: "overlay", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "this.hostClasses" } }, ngImport: i0, template: "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 100 100\"\n preserveAspectRatio=\"xMidYMid\">\n <circle class=\"ft-track\" cx=\"50\" cy=\"50\" r=\"40\" />\n <circle class=\"ft-bar\" [ngClass]=\"mode() === 'determinate' ? 'ft-bar--determinate' : 'ft-bar--indeterminate'\" cx=\"50\"\n cy=\"50\" r=\"40\"\n [ngStyle]=\"{'stroke-dashoffset': mode() === 'determinate'? 'calc((3.14159265 * 40 * 2 * (100 - ' + value() + ')) / 100)' : null}\">\n </circle>\n</svg>", styles: [":host{line-height:0;display:inline-block}:host.ft-progress--1{font-size:1rem}:host.ft-progress--2{font-size:1.5rem}:host.ft-progress--3{font-size:2rem}:host.ft-progress--4{font-size:3rem}:host.ft-progress--5{font-size:4.5rem}:host.ft-progress--6{font-size:8rem}:host.ft-progress--7{font-size:16rem}:host.ft-progress--8{font-size:32rem}:host.ft-progress--overlay{position:fixed;display:flex;align-items:center;justify-content:center;pointer-events:none;z-index:10000;inset:0;font-size:42px}:host.ft-progress--overlay svg{background:#fff9;-webkit-backdrop-filter:saturate(50%) blur(3px);backdrop-filter:saturate(50%) blur(3px);box-shadow:0 3px 3px -2px #0003,0 3px 4px #00000024,0 1px 8px #0000001f;border-radius:100vh;padding:.3125rem;animation:ft-progress-reveal .2s;animation-fill-mode:forwards}:host.ft-progress--overlay svg .ft-track{display:none}svg{width:1em;height:1em;vertical-align:middle}svg .ft-track{fill:none;stroke-width:10;stroke:var(--ft-progress-track-color)}svg .ft-bar{fill:none;stroke-opacity:.9;stroke-width:6;stroke:var(--ft-progress-bar-color)}svg .ft-bar--indeterminate{animation:ft-progress-rotation 2s infinite linear}svg .ft-bar--determinate{stroke-dasharray:251.327412288}@keyframes ft-progress-reveal{0%{transform:translateY(-100%);opacity:0}to{transform:translateY(0);opacity:1}}@keyframes ft-progress-rotation{0%{stroke-dashoffset:0;stroke-dasharray:150.6 100.4}50%{stroke-dasharray:1 250}to{stroke-dashoffset:502;stroke-dasharray:150.6 100.4}}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }] });
|
|
804
|
-
}
|
|
805
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: ProgressComponent, decorators: [{
|
|
806
|
-
type: Component,
|
|
807
|
-
args: [{ selector: 'ft-progress', standalone: true, imports: [CommonModule], template: "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 100 100\"\n preserveAspectRatio=\"xMidYMid\">\n <circle class=\"ft-track\" cx=\"50\" cy=\"50\" r=\"40\" />\n <circle class=\"ft-bar\" [ngClass]=\"mode() === 'determinate' ? 'ft-bar--determinate' : 'ft-bar--indeterminate'\" cx=\"50\"\n cy=\"50\" r=\"40\"\n [ngStyle]=\"{'stroke-dashoffset': mode() === 'determinate'? 'calc((3.14159265 * 40 * 2 * (100 - ' + value() + ')) / 100)' : null}\">\n </circle>\n</svg>", styles: [":host{line-height:0;display:inline-block}:host.ft-progress--1{font-size:1rem}:host.ft-progress--2{font-size:1.5rem}:host.ft-progress--3{font-size:2rem}:host.ft-progress--4{font-size:3rem}:host.ft-progress--5{font-size:4.5rem}:host.ft-progress--6{font-size:8rem}:host.ft-progress--7{font-size:16rem}:host.ft-progress--8{font-size:32rem}:host.ft-progress--overlay{position:fixed;display:flex;align-items:center;justify-content:center;pointer-events:none;z-index:10000;inset:0;font-size:42px}:host.ft-progress--overlay svg{background:#fff9;-webkit-backdrop-filter:saturate(50%) blur(3px);backdrop-filter:saturate(50%) blur(3px);box-shadow:0 3px 3px -2px #0003,0 3px 4px #00000024,0 1px 8px #0000001f;border-radius:100vh;padding:.3125rem;animation:ft-progress-reveal .2s;animation-fill-mode:forwards}:host.ft-progress--overlay svg .ft-track{display:none}svg{width:1em;height:1em;vertical-align:middle}svg .ft-track{fill:none;stroke-width:10;stroke:var(--ft-progress-track-color)}svg .ft-bar{fill:none;stroke-opacity:.9;stroke-width:6;stroke:var(--ft-progress-bar-color)}svg .ft-bar--indeterminate{animation:ft-progress-rotation 2s infinite linear}svg .ft-bar--determinate{stroke-dasharray:251.327412288}@keyframes ft-progress-reveal{0%{transform:translateY(-100%);opacity:0}to{transform:translateY(0);opacity:1}}@keyframes ft-progress-rotation{0%{stroke-dashoffset:0;stroke-dasharray:150.6 100.4}50%{stroke-dasharray:1 250}to{stroke-dashoffset:502;stroke-dasharray:150.6 100.4}}\n"] }]
|
|
808
|
-
}], propDecorators: { hostClasses: [{
|
|
809
|
-
type: HostBinding,
|
|
810
|
-
args: ['class']
|
|
811
|
-
}] } });
|
|
580
|
+
}], propDecorators: { ftObserveIntersectingOptions: [{ type: i0.Input, args: [{ isSignal: true, alias: "ftObserveIntersectingOptions", required: false }] }], ftObserveIntersecting: [{ type: i0.Output, args: ["ftObserveIntersecting"] }] } });
|
|
812
581
|
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
readOnly = input(false);
|
|
818
|
-
stars = [
|
|
819
|
-
{ value: 1 },
|
|
820
|
-
{ value: 2 },
|
|
821
|
-
{ value: 3 },
|
|
822
|
-
{ value: 4 },
|
|
823
|
-
{ value: 5 }
|
|
824
|
-
];
|
|
825
|
-
_value;
|
|
826
|
-
get value() {
|
|
827
|
-
return this._value;
|
|
828
|
-
}
|
|
829
|
-
// TODO: Skipped for migration because:
|
|
830
|
-
// Accessor inputs cannot be migrated as they are too complex.
|
|
831
|
-
set value(value) {
|
|
832
|
-
this._value = value;
|
|
833
|
-
this.propagateChange(this._value);
|
|
834
|
-
}
|
|
835
|
-
registerOnChange(fn) {
|
|
836
|
-
this.propagateChange = fn;
|
|
837
|
-
}
|
|
838
|
-
registerOnTouched(fn) {
|
|
839
|
-
//this.propagateChange = fn;
|
|
840
|
-
}
|
|
841
|
-
setDisabledState(isDisabled) {
|
|
842
|
-
this.disabled = isDisabled;
|
|
843
|
-
}
|
|
844
|
-
setRate(value, isHover) {
|
|
845
|
-
if (isHover) {
|
|
846
|
-
this.hoverValue = value;
|
|
847
|
-
}
|
|
848
|
-
else {
|
|
849
|
-
this.value = value;
|
|
850
|
-
}
|
|
851
|
-
}
|
|
852
|
-
updateValue(event) {
|
|
853
|
-
this.value = event.target.value;
|
|
854
|
-
}
|
|
855
|
-
writeValue(value) {
|
|
856
|
-
this.value = value;
|
|
857
|
-
}
|
|
858
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: RatingComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
859
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.6", type: RatingComponent, isStandalone: true, selector: "ft-rating", inputs: { readOnly: { classPropertyName: "readOnly", publicName: "readOnly", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: false, isRequired: false, transformFunction: null } }, providers: [
|
|
860
|
-
{
|
|
861
|
-
provide: NG_VALUE_ACCESSOR,
|
|
862
|
-
useExisting: RatingComponent,
|
|
863
|
-
multi: true
|
|
864
|
-
}
|
|
865
|
-
], ngImport: i0, template: "@for (star of stars; track star) {\n <ng-container *ngTemplateOutlet=\"!readOnly()? buttonTemplate : starTemplate; context:{star:star}\"></ng-container>\n}\n<ng-template #buttonTemplate let-star=\"star\">\n @if (!readOnly()) {\n <button type=\"button\" class=\"ft-rating__item\" [disabled]=\"disabled\"\n (mouseover)=\"setRate(star.value, true)\" (focus)=\"setRate(star.value, true)\" (blur)=\"setRate(0, true)\"\n (mouseout)=\"setRate(0, true)\" (click)=\"setRate(star.value)\">\n <ng-container *ngTemplateOutlet=\"starTemplate; context:{star:star}\"></ng-container>\n </button>\n } @else {\n <svg [ngClass]=\"{'ft-rating__item-icon--hover': hoverValue >= star.value, 'ft-rating__item-icon--active': value >= star.value}\"\n viewBox=\"0 0 24 24\">\n <path\n d=\"M17.93 21.315c-.534.408-5.22-3.186-5.881-3.181-.663 0-5.307 3.656-5.846 3.254-.537-.403 1.29-6.165 1.081-6.822-.209-.656-4.972-4.138-4.772-4.796.201-.658 6.015-.627 6.55-1.036.533-.41 2.233-6.215 2.895-6.219.663 0 2.43 5.779 2.968 6.182.539.403 6.352.297 6.56.953.21.656-4.513 4.197-4.714 4.856-.2.658 1.692 6.398 1.159 6.808z\" />\n </svg>\n }\n</ng-template>\n<ng-template #starTemplate let-star=\"star\">\n <svg [ngClass]=\"{'ft-rating__item-icon--hover': hoverValue >= star.value, 'ft-rating__item-icon--active': value >= star.value}\"\n viewBox=\"0 0 24 24\">\n <path\n d=\"M17.93 21.315c-.534.408-5.22-3.186-5.881-3.181-.663 0-5.307 3.656-5.846 3.254-.537-.403 1.29-6.165 1.081-6.822-.209-.656-4.972-4.138-4.772-4.796.201-.658 6.015-.627 6.55-1.036.533-.41 2.233-6.215 2.895-6.219.663 0 2.43 5.779 2.968 6.182.539.403 6.352.297 6.56.953.21.656-4.513 4.197-4.714 4.856-.2.658 1.692 6.398 1.159 6.808z\" />\n </svg>\n</ng-template>", styles: [""], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] });
|
|
866
|
-
}
|
|
867
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: RatingComponent, decorators: [{
|
|
868
|
-
type: Component,
|
|
869
|
-
args: [{ selector: 'ft-rating', standalone: true, imports: [CommonModule], providers: [
|
|
870
|
-
{
|
|
871
|
-
provide: NG_VALUE_ACCESSOR,
|
|
872
|
-
useExisting: RatingComponent,
|
|
873
|
-
multi: true
|
|
874
|
-
}
|
|
875
|
-
], template: "@for (star of stars; track star) {\n <ng-container *ngTemplateOutlet=\"!readOnly()? buttonTemplate : starTemplate; context:{star:star}\"></ng-container>\n}\n<ng-template #buttonTemplate let-star=\"star\">\n @if (!readOnly()) {\n <button type=\"button\" class=\"ft-rating__item\" [disabled]=\"disabled\"\n (mouseover)=\"setRate(star.value, true)\" (focus)=\"setRate(star.value, true)\" (blur)=\"setRate(0, true)\"\n (mouseout)=\"setRate(0, true)\" (click)=\"setRate(star.value)\">\n <ng-container *ngTemplateOutlet=\"starTemplate; context:{star:star}\"></ng-container>\n </button>\n } @else {\n <svg [ngClass]=\"{'ft-rating__item-icon--hover': hoverValue >= star.value, 'ft-rating__item-icon--active': value >= star.value}\"\n viewBox=\"0 0 24 24\">\n <path\n d=\"M17.93 21.315c-.534.408-5.22-3.186-5.881-3.181-.663 0-5.307 3.656-5.846 3.254-.537-.403 1.29-6.165 1.081-6.822-.209-.656-4.972-4.138-4.772-4.796.201-.658 6.015-.627 6.55-1.036.533-.41 2.233-6.215 2.895-6.219.663 0 2.43 5.779 2.968 6.182.539.403 6.352.297 6.56.953.21.656-4.513 4.197-4.714 4.856-.2.658 1.692 6.398 1.159 6.808z\" />\n </svg>\n }\n</ng-template>\n<ng-template #starTemplate let-star=\"star\">\n <svg [ngClass]=\"{'ft-rating__item-icon--hover': hoverValue >= star.value, 'ft-rating__item-icon--active': value >= star.value}\"\n viewBox=\"0 0 24 24\">\n <path\n d=\"M17.93 21.315c-.534.408-5.22-3.186-5.881-3.181-.663 0-5.307 3.656-5.846 3.254-.537-.403 1.29-6.165 1.081-6.822-.209-.656-4.972-4.138-4.772-4.796.201-.658 6.015-.627 6.55-1.036.533-.41 2.233-6.215 2.895-6.219.663 0 2.43 5.779 2.968 6.182.539.403 6.352.297 6.56.953.21.656-4.513 4.197-4.714 4.856-.2.658 1.692 6.398 1.159 6.808z\" />\n </svg>\n</ng-template>" }]
|
|
876
|
-
}], propDecorators: { value: [{
|
|
877
|
-
type: Input
|
|
878
|
-
}] } });
|
|
582
|
+
const MESSAGE_TYPE = {
|
|
583
|
+
MODAL: 'modal',
|
|
584
|
+
NOTIFICATION: 'notification'
|
|
585
|
+
};
|
|
879
586
|
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
IconComponent,
|
|
885
|
-
ImageComponent,
|
|
886
|
-
ProgressComponent,
|
|
887
|
-
RatingComponent,
|
|
888
|
-
ObserveIntersectingDirective], exports: [AvatarComponent,
|
|
889
|
-
IconComponent,
|
|
890
|
-
ImageComponent,
|
|
891
|
-
ProgressComponent,
|
|
892
|
-
RatingComponent,
|
|
893
|
-
ObserveIntersectingDirective] });
|
|
894
|
-
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: UiModule, imports: [CommonModule,
|
|
895
|
-
ProgressComponent,
|
|
896
|
-
RatingComponent] });
|
|
897
|
-
}
|
|
898
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: UiModule, decorators: [{
|
|
899
|
-
type: NgModule,
|
|
900
|
-
args: [{
|
|
901
|
-
declarations: [],
|
|
902
|
-
imports: [
|
|
903
|
-
CommonModule,
|
|
904
|
-
AvatarComponent,
|
|
905
|
-
IconComponent,
|
|
906
|
-
ImageComponent,
|
|
907
|
-
ProgressComponent,
|
|
908
|
-
RatingComponent,
|
|
909
|
-
ObserveIntersectingDirective
|
|
910
|
-
],
|
|
911
|
-
exports: [
|
|
912
|
-
AvatarComponent,
|
|
913
|
-
IconComponent,
|
|
914
|
-
ImageComponent,
|
|
915
|
-
ProgressComponent,
|
|
916
|
-
RatingComponent,
|
|
917
|
-
ObserveIntersectingDirective
|
|
918
|
-
]
|
|
919
|
-
}]
|
|
920
|
-
}] });
|
|
587
|
+
/*
|
|
588
|
+
* Public API Surface of ui
|
|
589
|
+
*/
|
|
590
|
+
// Components
|
|
921
591
|
|
|
922
592
|
/**
|
|
923
593
|
* Generated bundle index. Do not edit.
|
|
924
594
|
*/
|
|
925
595
|
|
|
926
|
-
export {
|
|
596
|
+
export { Avatar, Icon, LazyImage, MESSAGE_POSITION, MESSAGE_TYPE, MessageContentComponent, MessageDialogComponent, MessageService, ObserveIntersecting, Progress, Rating, UI_OPTIONS };
|
|
927
597
|
//# sourceMappingURL=factor_ec-ui.mjs.map
|