@thalassic/ui 0.8.0 → 0.8.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fesm2022/thalassic-ui-charts.mjs +340 -0
- package/fesm2022/thalassic-ui-charts.mjs.map +1 -0
- package/fesm2022/thalassic-ui.mjs +24 -369
- package/fesm2022/thalassic-ui.mjs.map +1 -1
- package/package.json +6 -1
- package/types/thalassic-ui-charts.d.ts +102 -0
- package/types/thalassic-ui.d.ts +5 -102
|
@@ -1,18 +1,17 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { InjectionToken, inject, input, booleanAttribute, computed, Component, Directive,
|
|
2
|
+
import { InjectionToken, inject, input, booleanAttribute, computed, Component, Directive, Injectable, model, contentChild, ViewContainerRef, DestroyRef, viewChild, signal, output, effect, forwardRef, viewChildren, contentChildren, TemplateRef, ElementRef, Renderer2, makeEnvironmentProviders } from '@angular/core';
|
|
3
3
|
import { NgTemplateOutlet } from '@angular/common';
|
|
4
4
|
import { RouterLink } from '@angular/router';
|
|
5
|
-
import { takeUntilDestroyed, rxResource, toObservable } from '@angular/core/rxjs-interop';
|
|
6
|
-
import { ThemeService } from '@thalassic/core';
|
|
7
|
-
import { Chart as Chart$1, BarController, BarElement, CategoryScale, LinearScale, BubbleController, PointElement, DoughnutController, ArcElement, LineController, LineElement, PieController, PolarAreaController, RadialLinearScale, RadarController, ScatterController } from 'chart.js';
|
|
8
5
|
import { CdkDialogContainer, DialogRef, Dialog as Dialog$1 } from '@angular/cdk/dialog';
|
|
9
6
|
import { CdkPortalOutlet, TemplatePortal, ComponentPortal } from '@angular/cdk/portal';
|
|
10
7
|
import { format, startOfMonth, endOfMonth, eachDayOfInterval, endOfWeek, startOfWeek, subMonths, addMonths, isSameDay, isSameMonth, isToday, setMonth, subYears, addYears, getYear, getMonth, getHours, getMinutes, startOfDay, setHours, setMinutes, setYear } from 'date-fns';
|
|
11
8
|
import { Overlay } from '@angular/cdk/overlay';
|
|
9
|
+
import { takeUntilDestroyed, rxResource, toObservable } from '@angular/core/rxjs-interop';
|
|
12
10
|
import { HttpClient } from '@angular/common/http';
|
|
13
11
|
import { DomSanitizer } from '@angular/platform-browser';
|
|
14
12
|
import { throwError, map, shareReplay } from 'rxjs';
|
|
15
13
|
import { CdkTable, CdkHeaderCell, CdkCell, CdkCellDef, CdkHeaderCellDef, CdkColumnDef, CdkHeaderRow, CdkHeaderRowDef, CdkRow, CdkRowDef } from '@angular/cdk/table';
|
|
14
|
+
import { deepMerge } from '@thalassic/core';
|
|
16
15
|
|
|
17
16
|
const DEFAULT_ALERT_CONFIG = {
|
|
18
17
|
color: 'primary',
|
|
@@ -154,325 +153,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImpor
|
|
|
154
153
|
}]
|
|
155
154
|
}] });
|
|
156
155
|
|
|
157
|
-
const CHART_ELEMENT = new InjectionToken('CHART_ELEMENT');
|
|
158
|
-
class ChartElement {
|
|
159
|
-
dataset = input.required({ ...(ngDevMode ? { debugName: "dataset" } : {}), transform: value => ({
|
|
160
|
-
type: this.type,
|
|
161
|
-
...value,
|
|
162
|
-
}) });
|
|
163
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: ChartElement, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
164
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.1", type: ChartElement, isStandalone: true, inputs: { dataset: { classPropertyName: "dataset", publicName: "dataset", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0 });
|
|
165
|
-
}
|
|
166
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: ChartElement, decorators: [{
|
|
167
|
-
type: Directive
|
|
168
|
-
}], propDecorators: { dataset: [{ type: i0.Input, args: [{ isSignal: true, alias: "dataset", required: true }] }] } });
|
|
169
|
-
|
|
170
|
-
const CARTESIAN_CHARTS = [
|
|
171
|
-
'bar',
|
|
172
|
-
'line',
|
|
173
|
-
'scatter',
|
|
174
|
-
'bubble',
|
|
175
|
-
];
|
|
176
|
-
const RADIAL_CHARTS = ['polarArea', 'radar'];
|
|
177
|
-
|
|
178
|
-
class ChartService {
|
|
179
|
-
_elementRef = inject(ElementRef);
|
|
180
|
-
getColorOptions(chartElements) {
|
|
181
|
-
const scaleTypes = this._getScaleTypes(chartElements);
|
|
182
|
-
const computedStyle = getComputedStyle(this._elementRef.nativeElement);
|
|
183
|
-
return {
|
|
184
|
-
backgroundColor: computedStyle.getPropertyValue('--tls-chart-background-color'),
|
|
185
|
-
borderColor: computedStyle.getPropertyValue('--tls-chart-border-color'),
|
|
186
|
-
color: computedStyle.getPropertyValue('--tls-chart-color'),
|
|
187
|
-
scales: this._getScales(scaleTypes),
|
|
188
|
-
};
|
|
189
|
-
}
|
|
190
|
-
// Private methods
|
|
191
|
-
_getScales(scaleTypes) {
|
|
192
|
-
const scales = {};
|
|
193
|
-
if (scaleTypes.includes('cartesian')) {
|
|
194
|
-
scales['x'] = this._getCartesianScales('x');
|
|
195
|
-
scales['y'] = this._getCartesianScales('y');
|
|
196
|
-
}
|
|
197
|
-
if (scaleTypes.includes('radial')) {
|
|
198
|
-
scales['r'] = this._getRadialScales();
|
|
199
|
-
}
|
|
200
|
-
return scales;
|
|
201
|
-
}
|
|
202
|
-
_getCartesianScales(axis) {
|
|
203
|
-
const computedStyle = getComputedStyle(this._elementRef.nativeElement);
|
|
204
|
-
return {
|
|
205
|
-
ticks: {
|
|
206
|
-
color: computedStyle.getPropertyValue(`--tls-chart-${axis}-ticks-color`),
|
|
207
|
-
},
|
|
208
|
-
grid: {
|
|
209
|
-
color: computedStyle.getPropertyValue(`--tls-chart-${axis}-grid-color`),
|
|
210
|
-
},
|
|
211
|
-
border: {
|
|
212
|
-
color: computedStyle.getPropertyValue(`--tls-chart-${axis}-axis-color`),
|
|
213
|
-
},
|
|
214
|
-
};
|
|
215
|
-
}
|
|
216
|
-
_getRadialScales() {
|
|
217
|
-
const computedStyle = getComputedStyle(this._elementRef.nativeElement);
|
|
218
|
-
return {
|
|
219
|
-
angleLines: {
|
|
220
|
-
color: computedStyle.getPropertyValue('--tls-chart-r-angle-lines-color'),
|
|
221
|
-
},
|
|
222
|
-
grid: {
|
|
223
|
-
color: computedStyle.getPropertyValue('--tls-chart-r-grid-color'),
|
|
224
|
-
},
|
|
225
|
-
pointLabels: {
|
|
226
|
-
color: computedStyle.getPropertyValue('--tls-chart-r-labels-color'),
|
|
227
|
-
},
|
|
228
|
-
ticks: {
|
|
229
|
-
color: computedStyle.getPropertyValue('--tls-chart-r-ticks-color'),
|
|
230
|
-
backdropColor: computedStyle.getPropertyValue('--tls-chart-r-ticks-backdrop-color'),
|
|
231
|
-
},
|
|
232
|
-
};
|
|
233
|
-
}
|
|
234
|
-
_getScaleTypes(chartElements) {
|
|
235
|
-
const types = [];
|
|
236
|
-
if (chartElements.some(element => CARTESIAN_CHARTS.includes(element.type)))
|
|
237
|
-
types.push('cartesian');
|
|
238
|
-
if (chartElements.some(element => RADIAL_CHARTS.includes(element.type)))
|
|
239
|
-
types.push('radial');
|
|
240
|
-
return types;
|
|
241
|
-
}
|
|
242
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: ChartService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
243
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: ChartService });
|
|
244
|
-
}
|
|
245
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: ChartService, decorators: [{
|
|
246
|
-
type: Injectable
|
|
247
|
-
}] });
|
|
248
|
-
|
|
249
|
-
const DEFAULT_CHART_CONFIG = {
|
|
250
|
-
options: {
|
|
251
|
-
maintainAspectRatio: false,
|
|
252
|
-
},
|
|
253
|
-
};
|
|
254
|
-
|
|
255
|
-
const CHART_CONFIG = new InjectionToken('CHART_CONFIG', {
|
|
256
|
-
factory: () => DEFAULT_CHART_CONFIG,
|
|
257
|
-
});
|
|
258
|
-
|
|
259
|
-
class Chart {
|
|
260
|
-
_config = inject(CHART_CONFIG);
|
|
261
|
-
_chartService = inject(ChartService);
|
|
262
|
-
_destroyRef = inject(DestroyRef);
|
|
263
|
-
_themeService = inject(ThemeService, { optional: true });
|
|
264
|
-
canvasRef = viewChild('canvas', ...(ngDevMode ? [{ debugName: "canvasRef" }] : []));
|
|
265
|
-
chartElements = contentChildren(CHART_ELEMENT, ...(ngDevMode ? [{ debugName: "chartElements" }] : []));
|
|
266
|
-
_chart = null;
|
|
267
|
-
labels = input([], ...(ngDevMode ? [{ debugName: "labels" }] : []));
|
|
268
|
-
options = input(undefined, ...(ngDevMode ? [{ debugName: "options" }] : []));
|
|
269
|
-
// Computed
|
|
270
|
-
_options = computed(() => {
|
|
271
|
-
const options = this.options();
|
|
272
|
-
const colorOptions = this._chartService.getColorOptions(this.chartElements());
|
|
273
|
-
if (options)
|
|
274
|
-
return { ...colorOptions, ...this._config.options, ...options };
|
|
275
|
-
else
|
|
276
|
-
return { ...colorOptions, ...this._config.options };
|
|
277
|
-
}, ...(ngDevMode ? [{ debugName: "_options" }] : []));
|
|
278
|
-
_datasets = computed(() => this.chartElements().map(element => element.dataset()), ...(ngDevMode ? [{ debugName: "_datasets" }] : []));
|
|
279
|
-
hostClasses = computed(() => {
|
|
280
|
-
const className = 'tls-chart';
|
|
281
|
-
const array = [className];
|
|
282
|
-
return array;
|
|
283
|
-
}, ...(ngDevMode ? [{ debugName: "hostClasses" }] : []));
|
|
284
|
-
constructor() {
|
|
285
|
-
afterNextRender(() => {
|
|
286
|
-
if (this.canvasElement) {
|
|
287
|
-
const config = {
|
|
288
|
-
options: this._options(),
|
|
289
|
-
data: {
|
|
290
|
-
labels: this.labels(),
|
|
291
|
-
datasets: this._datasets(),
|
|
292
|
-
},
|
|
293
|
-
};
|
|
294
|
-
this._chart = new Chart$1(this.canvasElement, config);
|
|
295
|
-
}
|
|
296
|
-
});
|
|
297
|
-
}
|
|
298
|
-
// Accessors
|
|
299
|
-
get canvasElement() {
|
|
300
|
-
return this.canvasRef()?.nativeElement;
|
|
301
|
-
}
|
|
302
|
-
// Private methods
|
|
303
|
-
_tryInitThemeListener() {
|
|
304
|
-
if (this._themeService) {
|
|
305
|
-
this._themeService.onThemeChange.pipe(takeUntilDestroyed(this._destroyRef)).subscribe(() => {
|
|
306
|
-
if (this._chart) {
|
|
307
|
-
const colorOptions = this._chartService.getColorOptions(this.chartElements());
|
|
308
|
-
this._chart.options = { ...this._options(), ...colorOptions };
|
|
309
|
-
this._chart.update('none');
|
|
310
|
-
}
|
|
311
|
-
});
|
|
312
|
-
}
|
|
313
|
-
}
|
|
314
|
-
// Lifecycle
|
|
315
|
-
ngOnInit() {
|
|
316
|
-
this._tryInitThemeListener();
|
|
317
|
-
}
|
|
318
|
-
ngOnDestroy() {
|
|
319
|
-
if (this._chart)
|
|
320
|
-
this._chart.destroy();
|
|
321
|
-
}
|
|
322
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: Chart, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
323
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "21.2.1", type: Chart, isStandalone: true, selector: "tls-chart", inputs: { labels: { classPropertyName: "labels", publicName: "labels", isSignal: true, isRequired: false, transformFunction: null }, options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "hostClasses()" } }, providers: [ChartService], queries: [{ propertyName: "chartElements", predicate: CHART_ELEMENT, isSignal: true }], viewQueries: [{ propertyName: "canvasRef", first: true, predicate: ["canvas"], descendants: true, isSignal: true }], ngImport: i0, template: "<canvas #canvas></canvas>\n", styles: [":host{position:relative;display:block}\n"] });
|
|
324
|
-
}
|
|
325
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: Chart, decorators: [{
|
|
326
|
-
type: Component,
|
|
327
|
-
args: [{ selector: 'tls-chart', imports: [], host: {
|
|
328
|
-
'[class]': 'hostClasses()',
|
|
329
|
-
}, providers: [ChartService], template: "<canvas #canvas></canvas>\n", styles: [":host{position:relative;display:block}\n"] }]
|
|
330
|
-
}], ctorParameters: () => [], propDecorators: { canvasRef: [{ type: i0.ViewChild, args: ['canvas', { isSignal: true }] }], chartElements: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => CHART_ELEMENT), { isSignal: true }] }], labels: [{ type: i0.Input, args: [{ isSignal: true, alias: "labels", required: false }] }], options: [{ type: i0.Input, args: [{ isSignal: true, alias: "options", required: false }] }] } });
|
|
331
|
-
|
|
332
|
-
class BarChart extends ChartElement {
|
|
333
|
-
type = 'bar';
|
|
334
|
-
constructor() {
|
|
335
|
-
super();
|
|
336
|
-
Chart$1.register(BarController, BarElement, CategoryScale, LinearScale);
|
|
337
|
-
}
|
|
338
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: BarChart, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
339
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.1", type: BarChart, isStandalone: true, selector: "tls-bar-chart", providers: [{ provide: CHART_ELEMENT, useExisting: forwardRef(() => BarChart) }], usesInheritance: true, ngImport: i0, template: '', isInline: true });
|
|
340
|
-
}
|
|
341
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: BarChart, decorators: [{
|
|
342
|
-
type: Component,
|
|
343
|
-
args: [{
|
|
344
|
-
selector: 'tls-bar-chart',
|
|
345
|
-
template: '',
|
|
346
|
-
providers: [{ provide: CHART_ELEMENT, useExisting: forwardRef(() => BarChart) }],
|
|
347
|
-
}]
|
|
348
|
-
}], ctorParameters: () => [] });
|
|
349
|
-
|
|
350
|
-
class BubbleChart extends ChartElement {
|
|
351
|
-
type = 'bubble';
|
|
352
|
-
constructor() {
|
|
353
|
-
super();
|
|
354
|
-
Chart$1.register(BubbleController, PointElement, LinearScale);
|
|
355
|
-
}
|
|
356
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: BubbleChart, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
357
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.1", type: BubbleChart, isStandalone: true, selector: "tls-bubble-chart", providers: [{ provide: CHART_ELEMENT, useExisting: forwardRef(() => BubbleChart) }], usesInheritance: true, ngImport: i0, template: '', isInline: true });
|
|
358
|
-
}
|
|
359
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: BubbleChart, decorators: [{
|
|
360
|
-
type: Component,
|
|
361
|
-
args: [{
|
|
362
|
-
selector: 'tls-bubble-chart',
|
|
363
|
-
template: '',
|
|
364
|
-
providers: [{ provide: CHART_ELEMENT, useExisting: forwardRef(() => BubbleChart) }],
|
|
365
|
-
}]
|
|
366
|
-
}], ctorParameters: () => [] });
|
|
367
|
-
|
|
368
|
-
class DoughnutChart extends ChartElement {
|
|
369
|
-
type = 'doughnut';
|
|
370
|
-
constructor() {
|
|
371
|
-
super();
|
|
372
|
-
Chart$1.register(DoughnutController, ArcElement);
|
|
373
|
-
}
|
|
374
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: DoughnutChart, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
375
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.1", type: DoughnutChart, isStandalone: true, selector: "tls-doughnut-chart", providers: [{ provide: CHART_ELEMENT, useExisting: forwardRef(() => DoughnutChart) }], usesInheritance: true, ngImport: i0, template: '', isInline: true });
|
|
376
|
-
}
|
|
377
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: DoughnutChart, decorators: [{
|
|
378
|
-
type: Component,
|
|
379
|
-
args: [{
|
|
380
|
-
selector: 'tls-doughnut-chart',
|
|
381
|
-
template: '',
|
|
382
|
-
providers: [{ provide: CHART_ELEMENT, useExisting: forwardRef(() => DoughnutChart) }],
|
|
383
|
-
}]
|
|
384
|
-
}], ctorParameters: () => [] });
|
|
385
|
-
|
|
386
|
-
class LineChart extends ChartElement {
|
|
387
|
-
type = 'line';
|
|
388
|
-
constructor() {
|
|
389
|
-
super();
|
|
390
|
-
Chart$1.register(LineController, LineElement, PointElement, CategoryScale, LinearScale);
|
|
391
|
-
}
|
|
392
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: LineChart, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
393
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.1", type: LineChart, isStandalone: true, selector: "tls-line-chart", providers: [{ provide: CHART_ELEMENT, useExisting: forwardRef(() => LineChart) }], usesInheritance: true, ngImport: i0, template: '', isInline: true });
|
|
394
|
-
}
|
|
395
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: LineChart, decorators: [{
|
|
396
|
-
type: Component,
|
|
397
|
-
args: [{
|
|
398
|
-
selector: 'tls-line-chart',
|
|
399
|
-
template: '',
|
|
400
|
-
providers: [{ provide: CHART_ELEMENT, useExisting: forwardRef(() => LineChart) }],
|
|
401
|
-
}]
|
|
402
|
-
}], ctorParameters: () => [] });
|
|
403
|
-
|
|
404
|
-
class PieChart extends ChartElement {
|
|
405
|
-
type = 'pie';
|
|
406
|
-
constructor() {
|
|
407
|
-
super();
|
|
408
|
-
Chart$1.register(PieController, ArcElement);
|
|
409
|
-
}
|
|
410
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: PieChart, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
411
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.1", type: PieChart, isStandalone: true, selector: "tls-pie-chart", providers: [{ provide: CHART_ELEMENT, useExisting: forwardRef(() => PieChart) }], usesInheritance: true, ngImport: i0, template: '', isInline: true });
|
|
412
|
-
}
|
|
413
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: PieChart, decorators: [{
|
|
414
|
-
type: Component,
|
|
415
|
-
args: [{
|
|
416
|
-
selector: 'tls-pie-chart',
|
|
417
|
-
template: '',
|
|
418
|
-
providers: [{ provide: CHART_ELEMENT, useExisting: forwardRef(() => PieChart) }],
|
|
419
|
-
}]
|
|
420
|
-
}], ctorParameters: () => [] });
|
|
421
|
-
|
|
422
|
-
class PolarAreaChart extends ChartElement {
|
|
423
|
-
type = 'polarArea';
|
|
424
|
-
constructor() {
|
|
425
|
-
super();
|
|
426
|
-
Chart$1.register(PolarAreaController, ArcElement, RadialLinearScale);
|
|
427
|
-
}
|
|
428
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: PolarAreaChart, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
429
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.1", type: PolarAreaChart, isStandalone: true, selector: "tls-polar-area-chart", providers: [{ provide: CHART_ELEMENT, useExisting: forwardRef(() => PolarAreaChart) }], usesInheritance: true, ngImport: i0, template: '', isInline: true });
|
|
430
|
-
}
|
|
431
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: PolarAreaChart, decorators: [{
|
|
432
|
-
type: Component,
|
|
433
|
-
args: [{
|
|
434
|
-
selector: 'tls-polar-area-chart',
|
|
435
|
-
template: '',
|
|
436
|
-
providers: [{ provide: CHART_ELEMENT, useExisting: forwardRef(() => PolarAreaChart) }],
|
|
437
|
-
}]
|
|
438
|
-
}], ctorParameters: () => [] });
|
|
439
|
-
|
|
440
|
-
class RadarChart extends ChartElement {
|
|
441
|
-
type = 'radar';
|
|
442
|
-
constructor() {
|
|
443
|
-
super();
|
|
444
|
-
Chart$1.register(RadarController, LineElement, PointElement, RadialLinearScale);
|
|
445
|
-
}
|
|
446
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: RadarChart, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
447
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.1", type: RadarChart, isStandalone: true, selector: "tls-radar-chart", providers: [{ provide: CHART_ELEMENT, useExisting: forwardRef(() => RadarChart) }], usesInheritance: true, ngImport: i0, template: '', isInline: true });
|
|
448
|
-
}
|
|
449
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: RadarChart, decorators: [{
|
|
450
|
-
type: Component,
|
|
451
|
-
args: [{
|
|
452
|
-
selector: 'tls-radar-chart',
|
|
453
|
-
template: '',
|
|
454
|
-
providers: [{ provide: CHART_ELEMENT, useExisting: forwardRef(() => RadarChart) }],
|
|
455
|
-
}]
|
|
456
|
-
}], ctorParameters: () => [] });
|
|
457
|
-
|
|
458
|
-
class ScatterChart extends ChartElement {
|
|
459
|
-
type = 'scatter';
|
|
460
|
-
constructor() {
|
|
461
|
-
super();
|
|
462
|
-
Chart$1.register(ScatterController, PointElement, LinearScale);
|
|
463
|
-
}
|
|
464
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: ScatterChart, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
465
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.1", type: ScatterChart, isStandalone: true, selector: "tls-scatter-chart", providers: [{ provide: CHART_ELEMENT, useExisting: forwardRef(() => ScatterChart) }], usesInheritance: true, ngImport: i0, template: '', isInline: true });
|
|
466
|
-
}
|
|
467
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: ScatterChart, decorators: [{
|
|
468
|
-
type: Component,
|
|
469
|
-
args: [{
|
|
470
|
-
selector: 'tls-scatter-chart',
|
|
471
|
-
template: '',
|
|
472
|
-
providers: [{ provide: CHART_ELEMENT, useExisting: forwardRef(() => ScatterChart) }],
|
|
473
|
-
}]
|
|
474
|
-
}], ctorParameters: () => [] });
|
|
475
|
-
|
|
476
156
|
const DEFAULT_DIALOG_CONFIG = {
|
|
477
157
|
size: 'md',
|
|
478
158
|
closeable: true,
|
|
@@ -910,22 +590,6 @@ const buildOverlayPositions = (position, offset) => {
|
|
|
910
590
|
}));
|
|
911
591
|
};
|
|
912
592
|
|
|
913
|
-
const isPlainObject = (value) => value !== null && typeof value === 'object' && !Array.isArray(value);
|
|
914
|
-
|
|
915
|
-
const mergeConfig = (defaults, overrides) => {
|
|
916
|
-
if (!overrides)
|
|
917
|
-
return defaults;
|
|
918
|
-
const result = { ...defaults };
|
|
919
|
-
for (const key in overrides) {
|
|
920
|
-
const defaultValue = defaults[key];
|
|
921
|
-
const overrideValue = overrides[key];
|
|
922
|
-
result[key] = (isPlainObject(defaultValue) && isPlainObject(overrideValue)
|
|
923
|
-
? mergeConfig(defaultValue, overrideValue)
|
|
924
|
-
: overrideValue);
|
|
925
|
-
}
|
|
926
|
-
return result;
|
|
927
|
-
};
|
|
928
|
-
|
|
929
593
|
const DEFAULT_POPOVER_CONFIG = {
|
|
930
594
|
position: 'bottom',
|
|
931
595
|
offset: { x: 0, y: 4 },
|
|
@@ -1631,7 +1295,7 @@ class Select extends ValueFormControl {
|
|
|
1631
1295
|
_panelTemplate = viewChild('panel', ...(ngDevMode ? [{ debugName: "_panelTemplate" }] : []));
|
|
1632
1296
|
_overlayRef = null;
|
|
1633
1297
|
_portal = null;
|
|
1634
|
-
value = model(
|
|
1298
|
+
value = model(null, ...(ngDevMode ? [{ debugName: "value" }] : []));
|
|
1635
1299
|
inputId = input(null, ...(ngDevMode ? [{ debugName: "inputId" }] : []));
|
|
1636
1300
|
options = input([], ...(ngDevMode ? [{ debugName: "options" }] : []));
|
|
1637
1301
|
optionLabel = input(undefined, ...(ngDevMode ? [{ debugName: "optionLabel" }] : []));
|
|
@@ -1740,7 +1404,7 @@ class Select extends ValueFormControl {
|
|
|
1740
1404
|
this.close();
|
|
1741
1405
|
}
|
|
1742
1406
|
clear() {
|
|
1743
|
-
this.value.set(
|
|
1407
|
+
this.value.set(null);
|
|
1744
1408
|
}
|
|
1745
1409
|
onOptionHover(index, disabled) {
|
|
1746
1410
|
if (!disabled)
|
|
@@ -2710,77 +2374,68 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImpor
|
|
|
2710
2374
|
|
|
2711
2375
|
// Features
|
|
2712
2376
|
|
|
2713
|
-
const provideThalassicChartConfig = (config) => {
|
|
2714
|
-
return makeEnvironmentProviders([
|
|
2715
|
-
{
|
|
2716
|
-
provide: CHART_CONFIG,
|
|
2717
|
-
useValue: mergeConfig(DEFAULT_CHART_CONFIG, config),
|
|
2718
|
-
},
|
|
2719
|
-
]);
|
|
2720
|
-
};
|
|
2721
|
-
|
|
2722
2377
|
const provideThalassicUIConfig = (config) => {
|
|
2723
2378
|
return makeEnvironmentProviders([
|
|
2724
2379
|
// Components
|
|
2725
2380
|
{
|
|
2726
2381
|
provide: ALERT_CONFIG,
|
|
2727
|
-
useValue:
|
|
2382
|
+
useValue: deepMerge(DEFAULT_ALERT_CONFIG, config.components.alert),
|
|
2728
2383
|
},
|
|
2729
2384
|
{
|
|
2730
2385
|
provide: BUTTON_CONFIG,
|
|
2731
|
-
useValue:
|
|
2386
|
+
useValue: deepMerge(DEFAULT_BUTTON_CONFIG, config.components.button),
|
|
2732
2387
|
},
|
|
2733
2388
|
{
|
|
2734
2389
|
provide: DATE_TIME_PICKER_CONFIG,
|
|
2735
|
-
useValue:
|
|
2390
|
+
useValue: deepMerge(DEFAULT_DATE_TIME_PICKER_CONFIG, config.components.dateTimePicker),
|
|
2736
2391
|
},
|
|
2737
2392
|
{
|
|
2738
2393
|
provide: DIALOG_CONFIG,
|
|
2739
|
-
useValue:
|
|
2394
|
+
useValue: deepMerge(DEFAULT_DIALOG_CONFIG, config.components.dialog),
|
|
2740
2395
|
},
|
|
2741
2396
|
{
|
|
2742
2397
|
provide: DIVIDER_CONFIG,
|
|
2743
|
-
useValue:
|
|
2398
|
+
useValue: deepMerge(DEFAULT_DIVIDER_CONFIG, config.components.divider),
|
|
2744
2399
|
},
|
|
2745
|
-
{ provide: INPUT_CONFIG, useValue:
|
|
2400
|
+
{ provide: INPUT_CONFIG, useValue: deepMerge(DEFAULT_INPUT_CONFIG, config.components.input) },
|
|
2746
2401
|
{
|
|
2747
2402
|
provide: PASSWORD_CONFIG,
|
|
2748
|
-
useValue:
|
|
2403
|
+
useValue: deepMerge(DEFAULT_PASSWORD_CONFIG, config.components.password),
|
|
2749
2404
|
},
|
|
2750
2405
|
{
|
|
2751
2406
|
provide: SELECT_CONFIG,
|
|
2752
|
-
useValue:
|
|
2407
|
+
useValue: deepMerge(DEFAULT_SELECT_CONFIG, config.components.select),
|
|
2753
2408
|
},
|
|
2754
2409
|
{
|
|
2755
2410
|
provide: SWITCH_CONFIG,
|
|
2756
|
-
useValue:
|
|
2411
|
+
useValue: deepMerge(DEFAULT_SWITCH_CONFIG, config.components.switch),
|
|
2757
2412
|
},
|
|
2758
2413
|
{
|
|
2759
2414
|
provide: FORM_ITEM_CONFIG,
|
|
2760
|
-
useValue:
|
|
2415
|
+
useValue: deepMerge(DEFAULT_FORM_ITEM_CONFIG, config.components.formItem),
|
|
2761
2416
|
},
|
|
2762
|
-
{ provide: ICON_CONFIG, useValue:
|
|
2417
|
+
{ provide: ICON_CONFIG, useValue: deepMerge(DEFAULT_ICON_CONFIG, config.components.icon) },
|
|
2763
2418
|
{
|
|
2764
2419
|
provide: PAGINATION_CONFIG,
|
|
2765
|
-
useValue:
|
|
2420
|
+
useValue: deepMerge(DEFAULT_PAGINATION_CONFIG, config.components.pagination),
|
|
2766
2421
|
},
|
|
2767
2422
|
{
|
|
2768
2423
|
provide: POPOVER_CONFIG,
|
|
2769
|
-
useValue:
|
|
2424
|
+
useValue: deepMerge(DEFAULT_POPOVER_CONFIG, config.components.popover),
|
|
2770
2425
|
},
|
|
2771
2426
|
{
|
|
2772
2427
|
provide: SKELETON_CONFIG,
|
|
2773
|
-
useValue:
|
|
2428
|
+
useValue: deepMerge(DEFAULT_SKELETON_CONFIG, config.components.skeleton),
|
|
2774
2429
|
},
|
|
2775
2430
|
{
|
|
2776
2431
|
provide: STEPPER_CONFIG,
|
|
2777
|
-
useValue:
|
|
2432
|
+
useValue: deepMerge(DEFAULT_STEPPER_CONFIG, config.components.stepper),
|
|
2778
2433
|
},
|
|
2779
|
-
{ provide: TABLE_CONFIG, useValue:
|
|
2780
|
-
{ provide: TABS_CONFIG, useValue:
|
|
2434
|
+
{ provide: TABLE_CONFIG, useValue: deepMerge(DEFAULT_TABLE_CONFIG, config.components.table) },
|
|
2435
|
+
{ provide: TABS_CONFIG, useValue: deepMerge(DEFAULT_TABS_CONFIG, config.components.tabs) },
|
|
2781
2436
|
{
|
|
2782
2437
|
provide: TOOLTIP_CONFIG,
|
|
2783
|
-
useValue:
|
|
2438
|
+
useValue: deepMerge(DEFAULT_TOOLTIP_CONFIG, config.components.tooltip),
|
|
2784
2439
|
},
|
|
2785
2440
|
]);
|
|
2786
2441
|
};
|
|
@@ -2789,5 +2444,5 @@ const provideThalassicUIConfig = (config) => {
|
|
|
2789
2444
|
* Generated bundle index. Do not edit.
|
|
2790
2445
|
*/
|
|
2791
2446
|
|
|
2792
|
-
export { ALERT_CONFIG, Alert, BUTTON_CONFIG,
|
|
2447
|
+
export { ALERT_CONFIG, Alert, BUTTON_CONFIG, Button, ButtonDirective, CHECKBOX_CONFIG, Checkbox, DATE_TIME_PICKER_CONFIG, DEFAULT_ALERT_CONFIG, DEFAULT_BUTTON_CONFIG, DEFAULT_CHECKBOX_CONFIG, DEFAULT_DATE_TIME_PICKER_CONFIG, DEFAULT_DIALOG_CONFIG, DEFAULT_DIVIDER_CONFIG, DEFAULT_FORM_ITEM_CONFIG, DEFAULT_ICON_CONFIG, DEFAULT_INPUT_CONFIG, DEFAULT_LOADER_CONFIG, DEFAULT_PAGINATION_CONFIG, DEFAULT_PASSWORD_CONFIG, DEFAULT_PIN_INPUT_CONFIG, DEFAULT_POPOVER_CONFIG, DEFAULT_RADIO_BUTTON_CONFIG, DEFAULT_SELECT_CONFIG, DEFAULT_SKELETON_CONFIG, DEFAULT_STEPPER_CONFIG, DEFAULT_STEP_CONFIG, DEFAULT_SWITCH_CONFIG, DEFAULT_TABLE_CONFIG, DEFAULT_TABS_CONFIG, DEFAULT_TOOLTIP_CONFIG, DIALOG_CONFIG, DIVIDER_CONFIG, DateTimePicker, Dialog, DialogService, Divider, FORM_ITEM_CONFIG, FormItem, ICON_CONFIG, INPUT_CONFIG, Icon, Input, InputDirective, LOADER_CONFIG, Loader, PAGINATION_CONFIG, PASSWORD_CONFIG, PIN_INPUT_CONFIG, POPOVER_CONFIG, Pagination, Password, PinInput, Popover, RADIO_BUTTON_CONFIG, RadioButton, SELECT_CONFIG, SKELETON_CONFIG, STEPPER_CONFIG, SWITCH_CONFIG, Select, Skeleton, Step, Stepper, Switch, TABLE_CONFIG, TABS_CONFIG, TOOLTIP_CONFIG, Tab, Table, TableColumn, Tabs, TooltipDirective, provideThalassicUIConfig };
|
|
2793
2448
|
//# sourceMappingURL=thalassic-ui.mjs.map
|