@tetacom/ng-components 1.0.8 → 1.0.12
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/assets/intersect.svg +3 -0
- package/assets/lithotype-icons.svg +7 -1
- package/component/chart/model/plot-band.d.ts +2 -0
- package/component/icon/icon-sprite.directive.d.ts +1 -1
- package/component/input/text-field/text-field.component.d.ts +3 -1
- package/esm2020/component/chart/core/chart.mjs +21 -8
- package/esm2020/component/chart/drawer/spline-drawer.mjs +2 -1
- package/esm2020/component/chart/model/plot-band.mjs +2 -1
- package/esm2020/component/icon/icon-sprite.directive.mjs +9 -2
- package/esm2020/component/input/text-field/text-field.component.mjs +15 -6
- package/esm2020/directive/only-number/only-number.directive.mjs +1 -4
- package/fesm2015/tetacom-ng-components.mjs +45 -16
- package/fesm2015/tetacom-ng-components.mjs.map +1 -1
- package/fesm2020/tetacom-ng-components.mjs +44 -16
- package/fesm2020/tetacom-ng-components.mjs.map +1 -1
- package/package.json +1 -1
- package/style/scroll.scss +9 -0
|
@@ -240,7 +240,14 @@ class IconSpriteDirective {
|
|
|
240
240
|
this.bypassInterceptors = true;
|
|
241
241
|
}
|
|
242
242
|
ngOnInit() {
|
|
243
|
-
|
|
243
|
+
if (typeof this.tetaIconSprite === 'string') {
|
|
244
|
+
this._iconService.addSprite(this.tetaIconSprite, this.bypassInterceptors);
|
|
245
|
+
}
|
|
246
|
+
if (this.tetaIconSprite instanceof Array && this.tetaIconSprite?.length) {
|
|
247
|
+
this.tetaIconSprite.forEach((sprite) => {
|
|
248
|
+
this._iconService.addSprite(sprite, this.bypassInterceptors);
|
|
249
|
+
});
|
|
250
|
+
}
|
|
244
251
|
}
|
|
245
252
|
}
|
|
246
253
|
IconSpriteDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: IconSpriteDirective, deps: [{ token: IconService }], target: i0.ɵɵFactoryTarget.Directive });
|
|
@@ -2620,9 +2627,7 @@ class OnlyNumberDirective {
|
|
|
2620
2627
|
if (this.tetaOnlyNumber === false) {
|
|
2621
2628
|
return;
|
|
2622
2629
|
}
|
|
2623
|
-
console.log(value);
|
|
2624
2630
|
value = value.replace(',', '.').trim();
|
|
2625
|
-
console.log(value);
|
|
2626
2631
|
let regex = this._integerUnsigned;
|
|
2627
2632
|
if (!this.allowDecimals && !this.allowSign) {
|
|
2628
2633
|
regex = this._integerUnsigned;
|
|
@@ -2675,7 +2680,6 @@ class OnlyNumberDirective {
|
|
|
2675
2680
|
value = '0.0';
|
|
2676
2681
|
}
|
|
2677
2682
|
const valid = new RegExp(regex).test(value.toString());
|
|
2678
|
-
console.log(value, valid);
|
|
2679
2683
|
this._control.control.setValue(valid ? value : this._previousValue ?? 0);
|
|
2680
2684
|
}
|
|
2681
2685
|
}
|
|
@@ -3534,6 +3538,7 @@ class TextFieldComponent {
|
|
|
3534
3538
|
this.placeholder = '';
|
|
3535
3539
|
this.disabled = false;
|
|
3536
3540
|
this.onlyNumber = false;
|
|
3541
|
+
this.tabindex = 0;
|
|
3537
3542
|
this.textField = true;
|
|
3538
3543
|
this.value = '';
|
|
3539
3544
|
}
|
|
@@ -3545,6 +3550,9 @@ class TextFieldComponent {
|
|
|
3545
3550
|
this.input.nativeElement.blur();
|
|
3546
3551
|
}
|
|
3547
3552
|
}
|
|
3553
|
+
emitBlur() {
|
|
3554
|
+
this.onTouched();
|
|
3555
|
+
}
|
|
3548
3556
|
registerOnChange(fn) {
|
|
3549
3557
|
this.onChange = fn;
|
|
3550
3558
|
}
|
|
@@ -3559,17 +3567,19 @@ class TextFieldComponent {
|
|
|
3559
3567
|
this.value = input;
|
|
3560
3568
|
this._cdr.detectChanges();
|
|
3561
3569
|
}
|
|
3562
|
-
onChange(input) {
|
|
3563
|
-
|
|
3570
|
+
onChange(input) {
|
|
3571
|
+
}
|
|
3572
|
+
onTouched() {
|
|
3573
|
+
}
|
|
3564
3574
|
}
|
|
3565
3575
|
TextFieldComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: TextFieldComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
3566
|
-
TextFieldComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.0.1", type: TextFieldComponent, selector: "teta-text-field", inputs: { placeholder: "placeholder", leftIconName: "leftIconName", disabled: "disabled", onlyNumber: "onlyNumber", invalid: "invalid" }, host: { listeners: { "click": "onFocus()" }, properties: { "class.text-field_disabled": "this.disabled", "class.text-field_invalid": "this.invalid", "class.text-field": "this.textField" } }, providers: [
|
|
3576
|
+
TextFieldComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.0.1", type: TextFieldComponent, selector: "teta-text-field", inputs: { placeholder: "placeholder", leftIconName: "leftIconName", disabled: "disabled", onlyNumber: "onlyNumber", invalid: "invalid" }, host: { listeners: { "click": "onFocus()" }, properties: { "class.text-field_disabled": "this.disabled", "class.text-field_invalid": "this.invalid", "attr.tabindex": "this.tabindex", "class.text-field": "this.textField" } }, providers: [
|
|
3567
3577
|
{
|
|
3568
3578
|
provide: NG_VALUE_ACCESSOR,
|
|
3569
3579
|
useExisting: forwardRef(() => TextFieldComponent),
|
|
3570
3580
|
multi: true,
|
|
3571
3581
|
},
|
|
3572
|
-
], viewQueries: [{ propertyName: "input", first: true, predicate: ["input"], descendants: true }], ngImport: i0, template: "<teta-icon *ngIf=\"leftIconName\" [name]=\"leftIconName\"></teta-icon>\n<input\n #input\n [ngModel]=\"value\"\n [tetaOnlyNumber]=\"onlyNumber\"\n (ngModelChange)=\"value = $event; onChange($event);\"\n [placeholder]=\"placeholder\"\n [disabled]=\"disabled\"\n (keydown)=\"keyPress($event)\"\n autocomplete=\"off\"\n type=\"text\"\n/>\n<teta-icon\n *ngIf=\"value && !disabled\"\n class=\"close-icon\"\n [name]=\"'closeCircle'\"\n (click)=\"value = ''; onChange('');\"\n></teta-icon>\n", styles: [""], components: [{ type: IconComponent, selector: "teta-icon", inputs: ["name", "size", "palette", "class"] }], directives: [{ type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i3.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i3.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: OnlyNumberDirective, selector: "[tetaOnlyNumber]", inputs: ["tetaOnlyNumber", "allowDecimals", "allowSign", "decimalSeparator", "commaSeparator"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
3582
|
+
], viewQueries: [{ propertyName: "input", first: true, predicate: ["input"], descendants: true }], ngImport: i0, template: "<teta-icon *ngIf=\"leftIconName\" [name]=\"leftIconName\"></teta-icon>\n<input\n #input\n [ngModel]=\"value\"\n [tetaOnlyNumber]=\"onlyNumber\"\n (ngModelChange)=\"value = $event; onChange($event);\"\n [placeholder]=\"placeholder\"\n [disabled]=\"disabled\"\n (blur)=\"emitBlur()\"\n (keydown)=\"keyPress($event)\"\n autocomplete=\"off\"\n type=\"text\"\n/>\n<teta-icon\n *ngIf=\"value && !disabled\"\n class=\"close-icon\"\n [name]=\"'closeCircle'\"\n (click)=\"value = ''; onChange('');\"\n></teta-icon>\n", styles: [""], components: [{ type: IconComponent, selector: "teta-icon", inputs: ["name", "size", "palette", "class"] }], directives: [{ type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i3.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i3.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: OnlyNumberDirective, selector: "[tetaOnlyNumber]", inputs: ["tetaOnlyNumber", "allowDecimals", "allowSign", "decimalSeparator", "commaSeparator"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
3573
3583
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: TextFieldComponent, decorators: [{
|
|
3574
3584
|
type: Component,
|
|
3575
3585
|
args: [{ selector: 'teta-text-field', providers: [
|
|
@@ -3578,7 +3588,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.1", ngImpor
|
|
|
3578
3588
|
useExisting: forwardRef(() => TextFieldComponent),
|
|
3579
3589
|
multi: true,
|
|
3580
3590
|
},
|
|
3581
|
-
], changeDetection: ChangeDetectionStrategy.OnPush, template: "<teta-icon *ngIf=\"leftIconName\" [name]=\"leftIconName\"></teta-icon>\n<input\n #input\n [ngModel]=\"value\"\n [tetaOnlyNumber]=\"onlyNumber\"\n (ngModelChange)=\"value = $event; onChange($event);\"\n [placeholder]=\"placeholder\"\n [disabled]=\"disabled\"\n (keydown)=\"keyPress($event)\"\n autocomplete=\"off\"\n type=\"text\"\n/>\n<teta-icon\n *ngIf=\"value && !disabled\"\n class=\"close-icon\"\n [name]=\"'closeCircle'\"\n (click)=\"value = ''; onChange('');\"\n></teta-icon>\n", styles: [""] }]
|
|
3591
|
+
], changeDetection: ChangeDetectionStrategy.OnPush, template: "<teta-icon *ngIf=\"leftIconName\" [name]=\"leftIconName\"></teta-icon>\n<input\n #input\n [ngModel]=\"value\"\n [tetaOnlyNumber]=\"onlyNumber\"\n (ngModelChange)=\"value = $event; onChange($event);\"\n [placeholder]=\"placeholder\"\n [disabled]=\"disabled\"\n (blur)=\"emitBlur()\"\n (keydown)=\"keyPress($event)\"\n autocomplete=\"off\"\n type=\"text\"\n/>\n<teta-icon\n *ngIf=\"value && !disabled\"\n class=\"close-icon\"\n [name]=\"'closeCircle'\"\n (click)=\"value = ''; onChange('');\"\n></teta-icon>\n", styles: [""] }]
|
|
3582
3592
|
}], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }]; }, propDecorators: { placeholder: [{
|
|
3583
3593
|
type: Input
|
|
3584
3594
|
}], leftIconName: [{
|
|
@@ -3598,6 +3608,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.1", ngImpor
|
|
|
3598
3608
|
}], input: [{
|
|
3599
3609
|
type: ViewChild,
|
|
3600
3610
|
args: ['input', { static: false }]
|
|
3611
|
+
}], tabindex: [{
|
|
3612
|
+
type: HostBinding,
|
|
3613
|
+
args: ['attr.tabindex']
|
|
3601
3614
|
}], textField: [{
|
|
3602
3615
|
type: HostBinding,
|
|
3603
3616
|
args: ['class.text-field']
|
|
@@ -10085,6 +10098,7 @@ class SplineDrawer {
|
|
|
10085
10098
|
const path = d3
|
|
10086
10099
|
.line()
|
|
10087
10100
|
.curve(d3.curveCatmullRom)
|
|
10101
|
+
.defined((d) => d.x != null && d.y != null)
|
|
10088
10102
|
.x((d) => scaleX(d.x))
|
|
10089
10103
|
.y((d) => scaleY(d.y));
|
|
10090
10104
|
context
|
|
@@ -10720,12 +10734,15 @@ class TetaChart {
|
|
|
10720
10734
|
className: annotation.className,
|
|
10721
10735
|
};
|
|
10722
10736
|
});
|
|
10723
|
-
const makeAnnotations = d3annotation
|
|
10737
|
+
const makeAnnotations = d3annotation
|
|
10738
|
+
.annotation()
|
|
10739
|
+
.annotations(annotations ?? []);
|
|
10724
10740
|
this._chart
|
|
10725
10741
|
.append('g')
|
|
10726
10742
|
.attr('class', 'annotations')
|
|
10727
10743
|
.attr('clip-path', `url(#draw-window-${this.uniqId})`)
|
|
10728
|
-
.call(makeAnnotations)
|
|
10744
|
+
.call(makeAnnotations)
|
|
10745
|
+
.lower();
|
|
10729
10746
|
}
|
|
10730
10747
|
drawPlotLines() {
|
|
10731
10748
|
this._chart.selectAll('.plotlines').remove();
|
|
@@ -10921,7 +10938,12 @@ class TetaChart {
|
|
|
10921
10938
|
.attr('x', (d) => x(d.from))
|
|
10922
10939
|
.attr('y', 0)
|
|
10923
10940
|
.attr('width', (d) => Math.abs(x(d.to) - x(d.from)))
|
|
10924
|
-
.attr('fill', (d) =>
|
|
10941
|
+
.attr('fill', (d) => {
|
|
10942
|
+
if (d.image) {
|
|
10943
|
+
return `url(#${d.image})`;
|
|
10944
|
+
}
|
|
10945
|
+
return d.color;
|
|
10946
|
+
})
|
|
10925
10947
|
.style('opacity', (d) => d.opacity ?? 1)
|
|
10926
10948
|
.attr('height', plotBandHeight > 0 ? plotBandHeight : 0)
|
|
10927
10949
|
.attr('transform', `translate(0, ${this._options.bounds.top})`);
|
|
@@ -11161,7 +11183,12 @@ class TetaChart {
|
|
|
11161
11183
|
.attr('x', 0)
|
|
11162
11184
|
.attr('y', (d) => y(d.from))
|
|
11163
11185
|
.attr('width', (d) => plotBandWidth)
|
|
11164
|
-
.attr('fill', (d) =>
|
|
11186
|
+
.attr('fill', (d) => {
|
|
11187
|
+
if (d.image) {
|
|
11188
|
+
return `url(#${d.image})`;
|
|
11189
|
+
}
|
|
11190
|
+
return d.color;
|
|
11191
|
+
})
|
|
11165
11192
|
.style('opacity', (d) => d.opacity ?? 1)
|
|
11166
11193
|
.attr('height', (d) => Math.abs(y(d.to) - y(d.from)))
|
|
11167
11194
|
.attr('cursor', (d) => (d.draggable ? 'move' : 'default'));
|
|
@@ -11233,7 +11260,7 @@ class TetaChart {
|
|
|
11233
11260
|
}
|
|
11234
11261
|
drawChart() {
|
|
11235
11262
|
const series = this._options.series?.filter((_) => _.visible);
|
|
11236
|
-
this._chart.selectAll('.
|
|
11263
|
+
this._chart.selectAll('.series').remove();
|
|
11237
11264
|
if (!series || series.length < 1) {
|
|
11238
11265
|
d3.select(this._container.nativeElement)
|
|
11239
11266
|
.select('canvas')
|
|
@@ -11353,7 +11380,7 @@ class TetaChart {
|
|
|
11353
11380
|
color: d.color,
|
|
11354
11381
|
name: d.name,
|
|
11355
11382
|
});
|
|
11356
|
-
return `translate(${!isNaN(data?.x) ? foundX(data.x) : -10}, ${!isNaN(data?.y) ? foundY(data.y) : -10})`;
|
|
11383
|
+
return `translate(${!isNaN(data?.x) && data?.x != null ? foundX(data.x) : -10}, ${!isNaN(data?.y) && data?.y != null ? foundY(data.y) : -10})`;
|
|
11357
11384
|
}
|
|
11358
11385
|
if (this._options.tooltip.tracking === 'y') {
|
|
11359
11386
|
const sorted = [...d.data].sort((a, b) => d3.ascending(a.y, b.y));
|
|
@@ -11366,7 +11393,7 @@ class TetaChart {
|
|
|
11366
11393
|
color: d.color,
|
|
11367
11394
|
name: d.name,
|
|
11368
11395
|
});
|
|
11369
|
-
return `translate(${foundX(data.x)}, ${foundY(data.y)})`;
|
|
11396
|
+
return `translate(${!isNaN(data?.x) && data?.x != null ? foundX(data.x) : -10}, ${!isNaN(data?.y) && data?.y != null ? foundY(data.y) : -10})`;
|
|
11370
11397
|
}
|
|
11371
11398
|
});
|
|
11372
11399
|
if (this._options.tooltip?.format) {
|
|
@@ -12064,6 +12091,7 @@ class PlotBand {
|
|
|
12064
12091
|
this.to = options?.to;
|
|
12065
12092
|
this.label = options?.label;
|
|
12066
12093
|
this.color = options?.color || '#59AE501A';
|
|
12094
|
+
this.image = options?.image;
|
|
12067
12095
|
this.showGrabbers =
|
|
12068
12096
|
options?.showGrabbers != null ? options.showGrabbers : true;
|
|
12069
12097
|
this.draggable = options?.draggable != null ? options?.draggable : false;
|