cmat 0.0.87 → 0.0.88
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/cmat-components-adapter.mjs +9 -9
- package/fesm2022/cmat-components-adapter.mjs.map +1 -1
- package/fesm2022/cmat-components-breadcrumb.mjs +98 -80
- package/fesm2022/cmat-components-breadcrumb.mjs.map +1 -1
- package/fesm2022/cmat-components-card.mjs +26 -34
- package/fesm2022/cmat-components-card.mjs.map +1 -1
- package/fesm2022/cmat-components-carousel.mjs +467 -556
- package/fesm2022/cmat-components-carousel.mjs.map +1 -1
- package/fesm2022/cmat-components-cascade.mjs +270 -259
- package/fesm2022/cmat-components-cascade.mjs.map +1 -1
- package/fesm2022/cmat-components-chip-input.mjs +200 -116
- package/fesm2022/cmat-components-chip-input.mjs.map +1 -1
- package/fesm2022/cmat-components-code-editor.mjs +85 -38
- package/fesm2022/cmat-components-code-editor.mjs.map +1 -1
- package/fesm2022/cmat-components-color-picker.mjs +841 -0
- package/fesm2022/cmat-components-color-picker.mjs.map +1 -0
- package/fesm2022/cmat-components-custom-formly.mjs +1395 -838
- package/fesm2022/cmat-components-custom-formly.mjs.map +1 -1
- package/fesm2022/cmat-components-data-picker.mjs +996 -0
- package/fesm2022/cmat-components-data-picker.mjs.map +1 -0
- package/fesm2022/cmat-components-date-range.mjs +310 -264
- package/fesm2022/cmat-components-date-range.mjs.map +1 -1
- package/fesm2022/cmat-components-date-time-display.mjs +16 -20
- package/fesm2022/cmat-components-date-time-display.mjs.map +1 -1
- package/fesm2022/cmat-components-drawer.mjs +120 -137
- package/fesm2022/cmat-components-drawer.mjs.map +1 -1
- package/fesm2022/cmat-components-empty-state.mjs +17 -24
- package/fesm2022/cmat-components-empty-state.mjs.map +1 -1
- package/fesm2022/cmat-components-file-preview.mjs +18 -24
- package/fesm2022/cmat-components-file-preview.mjs.map +1 -1
- package/fesm2022/cmat-components-filter-toolbar.mjs +30 -39
- package/fesm2022/cmat-components-filter-toolbar.mjs.map +1 -1
- package/fesm2022/cmat-components-form-actions.mjs +12 -12
- package/fesm2022/cmat-components-form-actions.mjs.map +1 -1
- package/fesm2022/cmat-components-fullscreen.mjs +10 -10
- package/fesm2022/cmat-components-fullscreen.mjs.map +1 -1
- package/fesm2022/cmat-components-highlight.mjs +48 -41
- package/fesm2022/cmat-components-highlight.mjs.map +1 -1
- package/fesm2022/cmat-components-image-viewer.mjs +104 -107
- package/fesm2022/cmat-components-image-viewer.mjs.map +1 -1
- package/fesm2022/cmat-components-inline-loading.mjs +12 -15
- package/fesm2022/cmat-components-inline-loading.mjs.map +1 -1
- package/fesm2022/cmat-components-json-editor.mjs +118 -75
- package/fesm2022/cmat-components-json-editor.mjs.map +1 -1
- package/fesm2022/cmat-components-knob-input.mjs +196 -178
- package/fesm2022/cmat-components-knob-input.mjs.map +1 -1
- package/fesm2022/cmat-components-masonry.mjs +26 -41
- package/fesm2022/cmat-components-masonry.mjs.map +1 -1
- package/fesm2022/cmat-components-material-color-picker.mjs +81 -80
- package/fesm2022/cmat-components-material-color-picker.mjs.map +1 -1
- package/fesm2022/cmat-components-material-datetimepicker.mjs +1212 -1287
- package/fesm2022/cmat-components-material-datetimepicker.mjs.map +1 -1
- package/fesm2022/cmat-components-navigation.mjs +467 -450
- package/fesm2022/cmat-components-navigation.mjs.map +1 -1
- package/fesm2022/cmat-components-opt-input.mjs +143 -132
- package/fesm2022/cmat-components-opt-input.mjs.map +1 -1
- package/fesm2022/cmat-components-org-chart.mjs +68 -83
- package/fesm2022/cmat-components-org-chart.mjs.map +1 -1
- package/fesm2022/cmat-components-page-header.mjs +18 -24
- package/fesm2022/cmat-components-page-header.mjs.map +1 -1
- package/fesm2022/cmat-components-pagination.mjs +220 -136
- package/fesm2022/cmat-components-pagination.mjs.map +1 -1
- package/fesm2022/cmat-components-password-strength.mjs +262 -215
- package/fesm2022/cmat-components-password-strength.mjs.map +1 -1
- package/fesm2022/cmat-components-popover.mjs +227 -195
- package/fesm2022/cmat-components-popover.mjs.map +1 -1
- package/fesm2022/cmat-components-progress-bar.mjs +15 -34
- package/fesm2022/cmat-components-progress-bar.mjs.map +1 -1
- package/fesm2022/cmat-components-qrcode.mjs +95 -88
- package/fesm2022/cmat-components-qrcode.mjs.map +1 -1
- package/fesm2022/cmat-components-rating.mjs +70 -67
- package/fesm2022/cmat-components-rating.mjs.map +1 -1
- package/fesm2022/cmat-components-rich-text-editor.mjs +23 -26
- package/fesm2022/cmat-components-rich-text-editor.mjs.map +1 -1
- package/fesm2022/cmat-components-select-search.mjs +190 -159
- package/fesm2022/cmat-components-select-search.mjs.map +1 -1
- package/fesm2022/cmat-components-select-table.mjs +276 -213
- package/fesm2022/cmat-components-select-table.mjs.map +1 -1
- package/fesm2022/cmat-components-select-tree.mjs +178 -128
- package/fesm2022/cmat-components-select-tree.mjs.map +1 -1
- package/fesm2022/cmat-components-skeleton.mjs +44 -28
- package/fesm2022/cmat-components-skeleton.mjs.map +1 -1
- package/fesm2022/cmat-components-speed-dial.mjs +107 -163
- package/fesm2022/cmat-components-speed-dial.mjs.map +1 -1
- package/fesm2022/cmat-components-status-tag.mjs +29 -36
- package/fesm2022/cmat-components-status-tag.mjs.map +1 -1
- package/fesm2022/cmat-components-table-toolbar.mjs +14 -18
- package/fesm2022/cmat-components-table-toolbar.mjs.map +1 -1
- package/fesm2022/cmat-components-timeline.mjs +111 -118
- package/fesm2022/cmat-components-timeline.mjs.map +1 -1
- package/fesm2022/cmat-components-toast.mjs +65 -66
- package/fesm2022/cmat-components-toast.mjs.map +1 -1
- package/fesm2022/cmat-components-transfer-picker.mjs +130 -160
- package/fesm2022/cmat-components-transfer-picker.mjs.map +1 -1
- package/fesm2022/cmat-components-treetable.mjs +32 -39
- package/fesm2022/cmat-components-treetable.mjs.map +1 -1
- package/fesm2022/cmat-components-upload.mjs +186 -176
- package/fesm2022/cmat-components-upload.mjs.map +1 -1
- package/fesm2022/cmat-directives-animate-on-scroll.mjs +25 -28
- package/fesm2022/cmat-directives-animate-on-scroll.mjs.map +1 -1
- package/fesm2022/cmat-directives-arrow-cursor.mjs +85 -92
- package/fesm2022/cmat-directives-arrow-cursor.mjs.map +1 -1
- package/fesm2022/cmat-directives-autofocus.mjs +3 -3
- package/fesm2022/cmat-directives-autofocus.mjs.map +1 -1
- package/fesm2022/cmat-directives-data-exporter.mjs +49 -50
- package/fesm2022/cmat-directives-data-exporter.mjs.map +1 -1
- package/fesm2022/cmat-directives-debounce.mjs +16 -19
- package/fesm2022/cmat-directives-debounce.mjs.map +1 -1
- package/fesm2022/cmat-directives-digit-only.mjs +60 -69
- package/fesm2022/cmat-directives-digit-only.mjs.map +1 -1
- package/fesm2022/cmat-directives-equal-validator.mjs +3 -3
- package/fesm2022/cmat-directives-equal-validator.mjs.map +1 -1
- package/fesm2022/cmat-directives-seamless-auto-scroll.mjs +31 -30
- package/fesm2022/cmat-directives-seamless-auto-scroll.mjs.map +1 -1
- package/fesm2022/cmat-lib-mock-api.mjs +6 -6
- package/fesm2022/cmat-lib-mock-api.mjs.map +1 -1
- package/fesm2022/cmat-pipes-bytes.mjs +3 -3
- package/fesm2022/cmat-pipes-bytes.mjs.map +1 -1
- package/fesm2022/cmat-pipes-date-format.mjs +3 -3
- package/fesm2022/cmat-pipes-date-format.mjs.map +1 -1
- package/fesm2022/cmat-pipes-find-by-key.mjs +3 -3
- package/fesm2022/cmat-pipes-find-by-key.mjs.map +1 -1
- package/fesm2022/cmat-pipes-group-by.mjs +3 -3
- package/fesm2022/cmat-pipes-group-by.mjs.map +1 -1
- package/fesm2022/cmat-pipes-keys.mjs +3 -3
- package/fesm2022/cmat-pipes-keys.mjs.map +1 -1
- package/fesm2022/cmat-pipes-secure.mjs +7 -13
- package/fesm2022/cmat-pipes-secure.mjs.map +1 -1
- package/fesm2022/cmat-pipes-uppercase.mjs +3 -3
- package/fesm2022/cmat-pipes-uppercase.mjs.map +1 -1
- package/fesm2022/cmat-services-alert.mjs +26 -27
- package/fesm2022/cmat-services-alert.mjs.map +1 -1
- package/fesm2022/cmat-services-config.mjs +14 -23
- package/fesm2022/cmat-services-config.mjs.map +1 -1
- package/fesm2022/cmat-services-confirmation.mjs +8 -8
- package/fesm2022/cmat-services-confirmation.mjs.map +1 -1
- package/fesm2022/cmat-services-data.mjs +6 -10
- package/fesm2022/cmat-services-data.mjs.map +1 -1
- package/fesm2022/cmat-services-export-as.mjs +3 -3
- package/fesm2022/cmat-services-export-as.mjs.map +1 -1
- package/fesm2022/cmat-services-loading.mjs +30 -47
- package/fesm2022/cmat-services-loading.mjs.map +1 -1
- package/fesm2022/cmat-services-local-storage.mjs +3 -3
- package/fesm2022/cmat-services-local-storage.mjs.map +1 -1
- package/fesm2022/cmat-services-media-watcher.mjs +43 -34
- package/fesm2022/cmat-services-media-watcher.mjs.map +1 -1
- package/fesm2022/cmat-services-platform.mjs +3 -3
- package/fesm2022/cmat-services-platform.mjs.map +1 -1
- package/fesm2022/cmat-services-splash-screen.mjs +3 -3
- package/fesm2022/cmat-services-splash-screen.mjs.map +1 -1
- package/fesm2022/cmat-services-title.mjs +3 -3
- package/fesm2022/cmat-services-title.mjs.map +1 -1
- package/fesm2022/cmat-services-translation.mjs +11 -11
- package/fesm2022/cmat-services-translation.mjs.map +1 -1
- package/fesm2022/cmat-services-utils.mjs +3 -3
- package/fesm2022/cmat-services-utils.mjs.map +1 -1
- package/fesm2022/cmat.mjs +9228 -7507
- package/fesm2022/cmat.mjs.map +1 -1
- package/icons/material-icons/heroicons-outline.svg +3 -0
- package/icons/material-icons/heroicons-solid.svg +3 -0
- package/package.json +10 -1
- package/styles/components/bundle.scss +21 -0
- package/styles/overrides/angular-material.scss +22 -1
- package/tailwind/plugins/theming.js +183 -183
- package/types/cmat-components-breadcrumb.d.ts +40 -37
- package/types/cmat-components-card.d.ts +11 -13
- package/types/cmat-components-carousel.d.ts +87 -113
- package/types/cmat-components-cascade.d.ts +84 -65
- package/types/cmat-components-chip-input.d.ts +29 -24
- package/types/cmat-components-code-editor.d.ts +28 -12
- package/types/cmat-components-color-picker.d.ts +236 -0
- package/types/cmat-components-custom-formly.d.ts +316 -184
- package/types/cmat-components-data-picker.d.ts +372 -0
- package/types/cmat-components-date-range.d.ts +31 -36
- package/types/cmat-components-date-time-display.d.ts +8 -8
- package/types/cmat-components-drawer.d.ts +30 -32
- package/types/cmat-components-empty-state.d.ts +9 -10
- package/types/cmat-components-file-preview.d.ts +9 -9
- package/types/cmat-components-filter-toolbar.d.ts +15 -15
- package/types/cmat-components-form-actions.d.ts +5 -5
- package/types/cmat-components-fullscreen.d.ts +5 -5
- package/types/cmat-components-highlight.d.ts +13 -14
- package/types/cmat-components-image-viewer.d.ts +29 -33
- package/types/cmat-components-inline-loading.d.ts +6 -6
- package/types/cmat-components-json-editor.d.ts +15 -17
- package/types/cmat-components-knob-input.d.ts +58 -55
- package/types/cmat-components-masonry.d.ts +9 -12
- package/types/cmat-components-material-color-picker.d.ts +16 -21
- package/types/cmat-components-material-datetimepicker.d.ts +174 -216
- package/types/cmat-components-navigation.d.ts +34 -39
- package/types/cmat-components-opt-input.d.ts +35 -33
- package/types/cmat-components-org-chart.d.ts +8 -9
- package/types/cmat-components-page-header.d.ts +9 -9
- package/types/cmat-components-pagination.d.ts +36 -40
- package/types/cmat-components-password-strength.d.ts +58 -64
- package/types/cmat-components-popover.d.ts +22 -32
- package/types/cmat-components-progress-bar.d.ts +7 -10
- package/types/cmat-components-qrcode.d.ts +22 -22
- package/types/cmat-components-rating.d.ts +17 -19
- package/types/cmat-components-rich-text-editor.d.ts +11 -12
- package/types/cmat-components-select-search.d.ts +48 -36
- package/types/cmat-components-select-table.d.ts +38 -34
- package/types/cmat-components-select-tree.d.ts +17 -15
- package/types/cmat-components-skeleton.d.ts +27 -10
- package/types/cmat-components-speed-dial.d.ts +24 -33
- package/types/cmat-components-status-tag.d.ts +19 -9
- package/types/cmat-components-table-toolbar.d.ts +7 -7
- package/types/cmat-components-timeline.d.ts +33 -34
- package/types/cmat-components-toast.d.ts +26 -30
- package/types/cmat-components-transfer-picker.d.ts +51 -56
- package/types/cmat-components-treetable.d.ts +12 -13
- package/types/cmat-components-upload.d.ts +33 -38
- package/types/cmat-components-x6-angular-shape.d.ts +1 -1
- package/types/cmat-directives-animate-on-scroll.d.ts +7 -7
- package/types/cmat-directives-arrow-cursor.d.ts +18 -20
- package/types/cmat-directives-data-exporter.d.ts +10 -10
- package/types/cmat-directives-debounce.d.ts +5 -5
- package/types/cmat-directives-digit-only.d.ts +13 -13
- package/types/cmat-directives-seamless-auto-scroll.d.ts +7 -7
- package/types/cmat-pipes-secure.d.ts +1 -3
- package/types/cmat-services-alert.d.ts +11 -12
- package/types/cmat-services-config.d.ts +2 -7
- package/types/cmat-services-confirmation.d.ts +2 -2
- package/types/cmat-services-data.d.ts +0 -1
- package/types/cmat-services-loading.d.ts +14 -22
- package/types/cmat-services-media-watcher.d.ts +5 -5
- package/types/cmat-services-translation.d.ts +4 -5
- package/types/cmat.d.ts +2167 -1746
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { coerceBooleanProperty } from '@angular/cdk/coercion';
|
|
2
2
|
import { NgStyle } from '@angular/common';
|
|
3
3
|
import * as i0 from '@angular/core';
|
|
4
|
-
import {
|
|
4
|
+
import { viewChild, input, output, signal, inject, DOCUMENT, Renderer2, ElementRef, HostListener, Input, ChangeDetectionStrategy, ViewEncapsulation, Component } from '@angular/core';
|
|
5
5
|
import { NgControl } from '@angular/forms';
|
|
6
6
|
import { MatFormFieldControl } from '@angular/material/form-field';
|
|
7
7
|
import { isNil } from 'lodash-es';
|
|
@@ -10,39 +10,118 @@ import { Subject } from 'rxjs';
|
|
|
10
10
|
/* eslint-disable @typescript-eslint/member-ordering */
|
|
11
11
|
let NEXT_ID = 0;
|
|
12
12
|
class CmatKnobInputComponent {
|
|
13
|
+
get value() {
|
|
14
|
+
return this._valueSignal() ?? this.min();
|
|
15
|
+
}
|
|
16
|
+
set value(val) {
|
|
17
|
+
const current = this._valueSignal();
|
|
18
|
+
if (val !== current) {
|
|
19
|
+
this._valueSignal.set(val);
|
|
20
|
+
this.stateChanges.next();
|
|
21
|
+
this._onModelChange(val);
|
|
22
|
+
this.valueChange.emit(val);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
get placeholder() {
|
|
26
|
+
return this._placeholderSignal();
|
|
27
|
+
}
|
|
28
|
+
set placeholder(plh) {
|
|
29
|
+
this._placeholderSignal.set(plh);
|
|
30
|
+
this.stateChanges.next();
|
|
31
|
+
}
|
|
32
|
+
get required() {
|
|
33
|
+
return this._requiredSignal();
|
|
34
|
+
}
|
|
35
|
+
set required(req) {
|
|
36
|
+
this._requiredSignal.set(coerceBooleanProperty(req));
|
|
37
|
+
this.stateChanges.next();
|
|
38
|
+
}
|
|
39
|
+
get disabled() {
|
|
40
|
+
if (!isNil(this.ngControl?.disabled)) {
|
|
41
|
+
return this.ngControl.disabled;
|
|
42
|
+
}
|
|
43
|
+
return this._disabledSignal();
|
|
44
|
+
}
|
|
45
|
+
set disabled(val) {
|
|
46
|
+
const coerced = coerceBooleanProperty(val);
|
|
47
|
+
this._disabledSignal.set(coerced);
|
|
48
|
+
if (this._focused && coerced) {
|
|
49
|
+
this._focused = false;
|
|
50
|
+
}
|
|
51
|
+
this.stateChanges.next();
|
|
52
|
+
}
|
|
53
|
+
get empty() {
|
|
54
|
+
return this._valueSignal() == null;
|
|
55
|
+
}
|
|
56
|
+
get errorState() {
|
|
57
|
+
if (this.ngControl == null)
|
|
58
|
+
return false;
|
|
59
|
+
return (this.touched() && !!this.ngControl?.invalid) ?? false;
|
|
60
|
+
}
|
|
61
|
+
get shouldLabelFloat() {
|
|
62
|
+
return this._focused || !this.empty;
|
|
63
|
+
}
|
|
64
|
+
get focused() {
|
|
65
|
+
return this._focused;
|
|
66
|
+
}
|
|
13
67
|
constructor() {
|
|
68
|
+
this.knobElementRef = viewChild('knob', /* @ts-ignore */
|
|
69
|
+
...(ngDevMode ? [{ debugName: "knobElementRef" }] : /* istanbul ignore next */ []));
|
|
70
|
+
this.valueColor = input('var(--cmat-primary)', /* @ts-ignore */
|
|
71
|
+
...(ngDevMode ? [{ debugName: "valueColor" }] : /* istanbul ignore next */ []));
|
|
72
|
+
this.rangeColor = input('var(--cmat-border)', /* @ts-ignore */
|
|
73
|
+
...(ngDevMode ? [{ debugName: "rangeColor" }] : /* istanbul ignore next */ []));
|
|
74
|
+
this.textColor = input('var(--cmat-text-default)', /* @ts-ignore */
|
|
75
|
+
...(ngDevMode ? [{ debugName: "textColor" }] : /* istanbul ignore next */ []));
|
|
76
|
+
this.valueTemplate = input('{value}', /* @ts-ignore */
|
|
77
|
+
...(ngDevMode ? [{ debugName: "valueTemplate" }] : /* istanbul ignore next */ []));
|
|
78
|
+
this.name = input(/* @ts-ignore */
|
|
79
|
+
...(ngDevMode ? [undefined, { debugName: "name" }] : /* istanbul ignore next */ []));
|
|
80
|
+
this.size = input(100, /* @ts-ignore */
|
|
81
|
+
...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
|
|
82
|
+
this.step = input(1, /* @ts-ignore */
|
|
83
|
+
...(ngDevMode ? [{ debugName: "step" }] : /* istanbul ignore next */ []));
|
|
84
|
+
this.min = input(0, /* @ts-ignore */
|
|
85
|
+
...(ngDevMode ? [{ debugName: "min" }] : /* istanbul ignore next */ []));
|
|
86
|
+
this.max = input(100, /* @ts-ignore */
|
|
87
|
+
...(ngDevMode ? [{ debugName: "max" }] : /* istanbul ignore next */ []));
|
|
88
|
+
this.strokeWidth = input(14, /* @ts-ignore */
|
|
89
|
+
...(ngDevMode ? [{ debugName: "strokeWidth" }] : /* istanbul ignore next */ []));
|
|
90
|
+
this.showValue = input(true, /* @ts-ignore */
|
|
91
|
+
...(ngDevMode ? [{ debugName: "showValue" }] : /* istanbul ignore next */ []));
|
|
92
|
+
this.valueChange = output();
|
|
14
93
|
this.id = `cmat-knob-input-${NEXT_ID++}`;
|
|
15
|
-
this.
|
|
16
|
-
this.
|
|
17
|
-
|
|
18
|
-
this.
|
|
19
|
-
|
|
20
|
-
this.
|
|
21
|
-
|
|
22
|
-
this.
|
|
23
|
-
|
|
24
|
-
this.
|
|
25
|
-
this.
|
|
94
|
+
this.stateChanges = new Subject();
|
|
95
|
+
this._valueSignal = signal(null, /* @ts-ignore */
|
|
96
|
+
...(ngDevMode ? [{ debugName: "_valueSignal" }] : /* istanbul ignore next */ []));
|
|
97
|
+
this._placeholderSignal = signal('', /* @ts-ignore */
|
|
98
|
+
...(ngDevMode ? [{ debugName: "_placeholderSignal" }] : /* istanbul ignore next */ []));
|
|
99
|
+
this._requiredSignal = signal(false, /* @ts-ignore */
|
|
100
|
+
...(ngDevMode ? [{ debugName: "_requiredSignal" }] : /* istanbul ignore next */ []));
|
|
101
|
+
this._disabledSignal = signal(false, /* @ts-ignore */
|
|
102
|
+
...(ngDevMode ? [{ debugName: "_disabledSignal" }] : /* istanbul ignore next */ []));
|
|
103
|
+
this._focused = false;
|
|
104
|
+
this.touched = signal(false, /* @ts-ignore */
|
|
105
|
+
...(ngDevMode ? [{ debugName: "touched" }] : /* istanbul ignore next */ []));
|
|
106
|
+
this.refreshVersion = signal(0, /* @ts-ignore */
|
|
107
|
+
...(ngDevMode ? [{ debugName: "refreshVersion" }] : /* istanbul ignore next */ []));
|
|
26
108
|
this.radius = 40;
|
|
27
109
|
this.midX = 50;
|
|
28
110
|
this.midY = 50;
|
|
29
111
|
this.minRadians = (4 * Math.PI) / 3;
|
|
30
112
|
this.maxRadians = -Math.PI / 3;
|
|
31
|
-
this.stateChanges = new Subject();
|
|
32
|
-
this.focused = false;
|
|
33
|
-
this.touched = false;
|
|
34
|
-
this.refreshVersion = signal(0, ...(ngDevMode ? [{ debugName: "refreshVersion" }] : /* istanbul ignore next */ []));
|
|
35
113
|
this.ngControl = inject(NgControl, { optional: true, self: true });
|
|
36
114
|
this._document = inject(DOCUMENT);
|
|
37
115
|
this._renderer = inject(Renderer2);
|
|
38
116
|
this._el = inject(ElementRef);
|
|
39
|
-
this.
|
|
40
|
-
this.
|
|
41
|
-
this.
|
|
117
|
+
this.windowMouseMoveListener = null;
|
|
118
|
+
this.windowMouseUpListener = null;
|
|
119
|
+
this.windowTouchMoveListener = null;
|
|
120
|
+
this.windowTouchEndListener = null;
|
|
121
|
+
// --- CVA Internal Functions ---
|
|
42
122
|
this._onModelChange = () => {
|
|
43
123
|
// Intentionally left blank
|
|
44
124
|
};
|
|
45
|
-
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
46
125
|
this._onTouchedChange = () => { };
|
|
47
126
|
if (this.ngControl != null) {
|
|
48
127
|
this.ngControl.valueAccessor = this;
|
|
@@ -50,51 +129,54 @@ class CmatKnobInputComponent {
|
|
|
50
129
|
}
|
|
51
130
|
ngOnDestroy() {
|
|
52
131
|
this.stateChanges.complete();
|
|
132
|
+
this._cleanupListeners();
|
|
133
|
+
}
|
|
134
|
+
_cleanupListeners() {
|
|
135
|
+
if (this.windowMouseMoveListener)
|
|
136
|
+
this.windowMouseMoveListener();
|
|
137
|
+
if (this.windowMouseUpListener)
|
|
138
|
+
this.windowMouseUpListener();
|
|
139
|
+
if (this.windowTouchMoveListener)
|
|
140
|
+
this.windowTouchMoveListener();
|
|
141
|
+
if (this.windowTouchEndListener)
|
|
142
|
+
this.windowTouchEndListener();
|
|
143
|
+
this.windowMouseMoveListener = null;
|
|
144
|
+
this.windowMouseUpListener = null;
|
|
145
|
+
this.windowTouchMoveListener = null;
|
|
146
|
+
this.windowTouchEndListener = null;
|
|
53
147
|
}
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
set placeholder(value) {
|
|
58
|
-
this._placeholder = value;
|
|
148
|
+
writeValue(value) {
|
|
149
|
+
this._valueSignal.set(value ?? this.min());
|
|
150
|
+
this.refreshVersion.update(v => v + 1);
|
|
59
151
|
this.stateChanges.next();
|
|
60
152
|
}
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
}
|
|
64
|
-
set value(value) {
|
|
65
|
-
if (value !== this.value) {
|
|
66
|
-
this._value = value;
|
|
67
|
-
this.stateChanges.next();
|
|
68
|
-
this._onModelChange(value);
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
get empty() {
|
|
72
|
-
return !this._value;
|
|
73
|
-
}
|
|
74
|
-
get errorState() {
|
|
75
|
-
if (this.ngControl == null)
|
|
76
|
-
return false;
|
|
77
|
-
return (this.touched && this.ngControl?.invalid) ?? false;
|
|
153
|
+
registerOnChange(fn) {
|
|
154
|
+
this._onModelChange = fn;
|
|
78
155
|
}
|
|
79
|
-
|
|
80
|
-
|
|
156
|
+
registerOnTouched(fn) {
|
|
157
|
+
this._onTouchedChange = fn;
|
|
81
158
|
}
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
this.
|
|
159
|
+
setDisabledState(val) {
|
|
160
|
+
this.disabled = val;
|
|
161
|
+
this.refreshVersion.update(v => v + 1);
|
|
85
162
|
this.stateChanges.next();
|
|
86
163
|
}
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
164
|
+
setDescribedByIds(ids) {
|
|
165
|
+
this.userAriaDescribedBy = ids.length ? ids.join(' ') : undefined;
|
|
166
|
+
const knobEl = this.knobElementRef()?.nativeElement;
|
|
167
|
+
if (knobEl) {
|
|
168
|
+
if (ids.length) {
|
|
169
|
+
knobEl.setAttribute('aria-describedby', ids.join(' '));
|
|
170
|
+
}
|
|
171
|
+
else {
|
|
172
|
+
knobEl.removeAttribute('aria-describedby');
|
|
173
|
+
}
|
|
90
174
|
}
|
|
91
|
-
|
|
175
|
+
this.stateChanges.next();
|
|
92
176
|
}
|
|
93
|
-
|
|
94
|
-
this.
|
|
95
|
-
|
|
96
|
-
this.focused = false;
|
|
97
|
-
this.stateChanges.next();
|
|
177
|
+
onContainerClick() {
|
|
178
|
+
if (!this.focused) {
|
|
179
|
+
this.knobElementRef()?.nativeElement.focus();
|
|
98
180
|
}
|
|
99
181
|
}
|
|
100
182
|
onKeyDown(event) {
|
|
@@ -120,12 +202,12 @@ class CmatKnobInputComponent {
|
|
|
120
202
|
}
|
|
121
203
|
case 'Home': {
|
|
122
204
|
keyboardEvent.preventDefault();
|
|
123
|
-
this.updateModelValue(this.min);
|
|
205
|
+
this.updateModelValue(this.min());
|
|
124
206
|
break;
|
|
125
207
|
}
|
|
126
208
|
case 'End': {
|
|
127
209
|
keyboardEvent.preventDefault();
|
|
128
|
-
this.updateModelValue(this.max);
|
|
210
|
+
this.updateModelValue(this.max());
|
|
129
211
|
break;
|
|
130
212
|
}
|
|
131
213
|
case 'PageUp': {
|
|
@@ -143,84 +225,63 @@ class CmatKnobInputComponent {
|
|
|
143
225
|
}
|
|
144
226
|
onMouseDown(event) {
|
|
145
227
|
if (!this.disabled) {
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
this.
|
|
228
|
+
this._cleanupListeners();
|
|
229
|
+
const win = this._document.defaultView ?? window;
|
|
230
|
+
this.windowMouseMoveListener = this._renderer.listen(win, 'mousemove', this.onMouseMove.bind(this));
|
|
231
|
+
this.windowMouseUpListener = this._renderer.listen(win, 'mouseup', this.onMouseUp.bind(this));
|
|
149
232
|
event.preventDefault();
|
|
150
233
|
}
|
|
151
234
|
}
|
|
152
235
|
onMouseUp(event) {
|
|
153
236
|
if (!this.disabled) {
|
|
154
|
-
|
|
155
|
-
this.windowMouseMoveListener();
|
|
156
|
-
this.windowMouseUpListener = null;
|
|
157
|
-
}
|
|
158
|
-
if (this.windowMouseUpListener) {
|
|
159
|
-
this.windowMouseUpListener();
|
|
160
|
-
this.windowMouseMoveListener = null;
|
|
161
|
-
}
|
|
237
|
+
this._cleanupListeners();
|
|
162
238
|
event.preventDefault();
|
|
163
239
|
}
|
|
164
240
|
}
|
|
165
241
|
onTouchStart(event) {
|
|
166
242
|
if (!this.disabled) {
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
this.
|
|
243
|
+
this._cleanupListeners();
|
|
244
|
+
const win = this._document.defaultView ?? window;
|
|
245
|
+
this.windowTouchMoveListener = this._renderer.listen(win, 'touchmove', this.onTouchMove.bind(this));
|
|
246
|
+
this.windowTouchEndListener = this._renderer.listen(win, 'touchend', this.onTouchEnd.bind(this));
|
|
170
247
|
event.preventDefault();
|
|
171
248
|
}
|
|
172
249
|
}
|
|
173
250
|
onTouchEnd(event) {
|
|
174
251
|
if (!this.disabled) {
|
|
175
|
-
|
|
176
|
-
this.windowTouchMoveListener();
|
|
177
|
-
}
|
|
178
|
-
if (this.windowTouchEndListener) {
|
|
179
|
-
this.windowTouchEndListener();
|
|
180
|
-
}
|
|
181
|
-
this.windowTouchMoveListener = null;
|
|
182
|
-
this.windowTouchEndListener = null;
|
|
252
|
+
this._cleanupListeners();
|
|
183
253
|
event.preventDefault();
|
|
184
254
|
}
|
|
185
255
|
}
|
|
186
|
-
mapRange(x, inMin, inMax, outMin, outMax) {
|
|
187
|
-
return ((x - inMin) * (outMax - outMin)) / (inMax - inMin) + outMin;
|
|
188
|
-
}
|
|
189
|
-
onClick(event) {
|
|
190
|
-
if (!this.disabled) {
|
|
191
|
-
this.updateValue(event.offsetX, event.offsetY);
|
|
192
|
-
}
|
|
193
|
-
}
|
|
194
256
|
onFocusIn() {
|
|
195
|
-
if (!this.
|
|
196
|
-
this.
|
|
257
|
+
if (!this._focused) {
|
|
258
|
+
this._focused = true;
|
|
197
259
|
this.stateChanges.next();
|
|
198
260
|
}
|
|
199
261
|
}
|
|
200
262
|
onFocusOut(event) {
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
263
|
+
const knobEl = this.knobElementRef()?.nativeElement;
|
|
264
|
+
// Check if relatedTarget is outside the component
|
|
265
|
+
if (knobEl &&
|
|
266
|
+
!knobEl.contains(event.relatedTarget)) {
|
|
267
|
+
this.touched.set(true);
|
|
268
|
+
this._focused = false;
|
|
204
269
|
this._onTouchedChange();
|
|
205
270
|
this.stateChanges.next();
|
|
206
271
|
}
|
|
207
272
|
}
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
}
|
|
212
|
-
else {
|
|
213
|
-
this._knobElementRef?.nativeElement.removeAttribute('aria-describedby');
|
|
214
|
-
}
|
|
273
|
+
// --- Logic Methods ---
|
|
274
|
+
mapRange(x, inMin, inMax, outMin, outMax) {
|
|
275
|
+
return ((x - inMin) * (outMax - outMin)) / (inMax - inMin) + outMin;
|
|
215
276
|
}
|
|
216
|
-
|
|
217
|
-
if (!this.
|
|
218
|
-
this.
|
|
277
|
+
onClick(event) {
|
|
278
|
+
if (!this.disabled) {
|
|
279
|
+
this.updateValue(event.offsetX, event.offsetY);
|
|
219
280
|
}
|
|
220
281
|
}
|
|
221
282
|
updateValue(offsetX, offsetY) {
|
|
222
|
-
let dx = offsetX - this.size / 2;
|
|
223
|
-
let dy = this.size / 2 - offsetY;
|
|
283
|
+
let dx = offsetX - this.size() / 2;
|
|
284
|
+
let dy = this.size() / 2 - offsetY;
|
|
224
285
|
let angle = Math.atan2(dy, dx);
|
|
225
286
|
let start = -Math.PI / 2 - Math.PI / 6;
|
|
226
287
|
this.updateModel(angle, start);
|
|
@@ -228,59 +289,45 @@ class CmatKnobInputComponent {
|
|
|
228
289
|
updateModel(angle, start) {
|
|
229
290
|
let mappedValue;
|
|
230
291
|
if (angle > this.maxRadians)
|
|
231
|
-
mappedValue = this.mapRange(angle, this.minRadians, this.maxRadians, this.min, this.max);
|
|
292
|
+
mappedValue = this.mapRange(angle, this.minRadians, this.maxRadians, this.min(), this.max());
|
|
232
293
|
else if (angle < start)
|
|
233
|
-
mappedValue = this.mapRange(angle + 2 * Math.PI, this.minRadians, this.maxRadians, this.min, this.max);
|
|
294
|
+
mappedValue = this.mapRange(angle + 2 * Math.PI, this.minRadians, this.maxRadians, this.min(), this.max());
|
|
234
295
|
else
|
|
235
296
|
return;
|
|
236
|
-
let newValue = Math.round((mappedValue - this.min) / this.step) * this.step +
|
|
297
|
+
let newValue = Math.round((mappedValue - this.min()) / this.step()) * this.step() +
|
|
298
|
+
this.min();
|
|
237
299
|
this.value = newValue;
|
|
238
|
-
this._onModelChange(this.value);
|
|
239
|
-
this.valueChange.emit(this.value);
|
|
240
300
|
}
|
|
241
301
|
onMouseMove(event) {
|
|
242
302
|
if (!this.disabled) {
|
|
243
303
|
this.updateValue(event.offsetX, event.offsetY);
|
|
244
304
|
event.preventDefault();
|
|
245
|
-
this.refreshVersion.update(
|
|
305
|
+
this.refreshVersion.update(v => v + 1);
|
|
246
306
|
}
|
|
247
307
|
}
|
|
248
308
|
onTouchMove(event) {
|
|
249
|
-
if (!this.disabled &&
|
|
309
|
+
if (!this.disabled &&
|
|
310
|
+
event instanceof TouchEvent &&
|
|
311
|
+
event.touches.length === 1) {
|
|
250
312
|
const rect = this._el.nativeElement.firstElementChild?.getBoundingClientRect();
|
|
251
313
|
const touch = event.targetTouches.item(0);
|
|
252
314
|
if (touch && rect) {
|
|
253
315
|
const offsetX = touch.clientX - rect.left;
|
|
254
316
|
const offsetY = touch.clientY - rect.top;
|
|
255
317
|
this.updateValue(offsetX, offsetY);
|
|
256
|
-
this.refreshVersion.update(
|
|
318
|
+
this.refreshVersion.update(v => v + 1);
|
|
257
319
|
}
|
|
258
320
|
}
|
|
259
321
|
}
|
|
260
322
|
updateModelValue(newValue) {
|
|
261
|
-
if (newValue > this.max)
|
|
262
|
-
this.value = this.max;
|
|
263
|
-
else if (newValue < this.min)
|
|
264
|
-
this.value = this.min;
|
|
323
|
+
if (newValue > this.max())
|
|
324
|
+
this.value = this.max();
|
|
325
|
+
else if (newValue < this.min())
|
|
326
|
+
this.value = this.min();
|
|
265
327
|
else
|
|
266
328
|
this.value = newValue;
|
|
267
|
-
this._onModelChange(this.value);
|
|
268
|
-
this.valueChange.emit(this.value);
|
|
269
|
-
}
|
|
270
|
-
writeValue(value) {
|
|
271
|
-
this.value = value ?? this.min;
|
|
272
|
-
this.refreshVersion.update(value => value + 1);
|
|
273
|
-
}
|
|
274
|
-
registerOnChange(fn) {
|
|
275
|
-
this._onModelChange = fn;
|
|
276
|
-
}
|
|
277
|
-
registerOnTouched(fn) {
|
|
278
|
-
this._onTouchedChange = fn;
|
|
279
|
-
}
|
|
280
|
-
setDisabledState(val) {
|
|
281
|
-
this.disabled = val;
|
|
282
|
-
this.refreshVersion.update(value => value + 1);
|
|
283
329
|
}
|
|
330
|
+
// --- SVG Path Calculations ---
|
|
284
331
|
rangePath() {
|
|
285
332
|
return `M ${this.minX()} ${this.minY()} A ${this.radius} ${this.radius} 0 1 1 ${this.maxX()} ${this.maxY()}`;
|
|
286
333
|
}
|
|
@@ -288,13 +335,13 @@ class CmatKnobInputComponent {
|
|
|
288
335
|
return `M ${this.zeroX()} ${this.zeroY()} A ${this.radius} ${this.radius} 0 ${this.largeArc()} ${this.sweep()} ${this.valueX()} ${this.valueY()}`;
|
|
289
336
|
}
|
|
290
337
|
zeroRadians() {
|
|
291
|
-
if (this.min > 0 && this.max > 0)
|
|
292
|
-
return this.mapRange(this.min, this.min, this.max, this.minRadians, this.maxRadians);
|
|
338
|
+
if (this.min() > 0 && this.max() > 0)
|
|
339
|
+
return this.mapRange(this.min(), this.min(), this.max(), this.minRadians, this.maxRadians);
|
|
293
340
|
else
|
|
294
|
-
return this.mapRange(0, this.min, this.max, this.minRadians, this.maxRadians);
|
|
341
|
+
return this.mapRange(0, this.min(), this.max(), this.minRadians, this.maxRadians);
|
|
295
342
|
}
|
|
296
343
|
valueRadians() {
|
|
297
|
-
return this.mapRange(this.value, this.min, this.max, this.minRadians, this.maxRadians);
|
|
344
|
+
return this.mapRange(this.value, this.min(), this.max(), this.minRadians, this.maxRadians);
|
|
298
345
|
}
|
|
299
346
|
minX() {
|
|
300
347
|
return this.midX + Math.cos(this.minRadians) * this.radius;
|
|
@@ -327,54 +374,25 @@ class CmatKnobInputComponent {
|
|
|
327
374
|
return this.valueRadians() > this.zeroRadians() ? 0 : 1;
|
|
328
375
|
}
|
|
329
376
|
valueToDisplay() {
|
|
330
|
-
return this.valueTemplate.replace('{value}', this.value.toString());
|
|
377
|
+
return this.valueTemplate().replace('{value}', this.value.toString());
|
|
331
378
|
}
|
|
332
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
333
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "
|
|
334
|
-
{ provide: MatFormFieldControl, useExisting: CmatKnobInputComponent }
|
|
335
|
-
], viewQueries: [{ propertyName: "
|
|
379
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: CmatKnobInputComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
380
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.2", type: CmatKnobInputComponent, isStandalone: true, selector: "cmat-knob-input", inputs: { valueColor: { classPropertyName: "valueColor", publicName: "valueColor", isSignal: true, isRequired: false, transformFunction: null }, rangeColor: { classPropertyName: "rangeColor", publicName: "rangeColor", isSignal: true, isRequired: false, transformFunction: null }, textColor: { classPropertyName: "textColor", publicName: "textColor", isSignal: true, isRequired: false, transformFunction: null }, valueTemplate: { classPropertyName: "valueTemplate", publicName: "valueTemplate", isSignal: true, isRequired: false, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, step: { classPropertyName: "step", publicName: "step", isSignal: true, isRequired: false, transformFunction: null }, min: { classPropertyName: "min", publicName: "min", isSignal: true, isRequired: false, transformFunction: null }, max: { classPropertyName: "max", publicName: "max", isSignal: true, isRequired: false, transformFunction: null }, strokeWidth: { classPropertyName: "strokeWidth", publicName: "strokeWidth", isSignal: true, isRequired: false, transformFunction: null }, showValue: { classPropertyName: "showValue", publicName: "showValue", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: false, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: false, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: false, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: false, isRequired: false, transformFunction: null } }, outputs: { valueChange: "valueChange" }, host: { listeners: { "keydown": "onKeyDown($event)", "mousedown": "onMouseDown($event)", "mouseup": "onMouseUp($event)", "touchstart": "onTouchStart($event)", "touchend": "onTouchEnd($event)" }, properties: { "attr.id": "id" } }, providers: [
|
|
381
|
+
{ provide: MatFormFieldControl, useExisting: CmatKnobInputComponent },
|
|
382
|
+
], viewQueries: [{ propertyName: "knobElementRef", first: true, predicate: ["knob"], descendants: true, isSignal: true }], exportAs: ["cmatKnobInput"], ngImport: i0, template: "<!-- eslint-disable @angular-eslint/template/no-inline-styles -->\r\n<div\r\n #knob\r\n tabindex=\"-1\"\r\n [attr.data-refresh]=\"refreshVersion()\"\r\n [class.cmat-knob-disabled]=\"disabled\"\r\n (focusin)=\"onFocusIn()\"\r\n (focusout)=\"onFocusOut($event)\"\r\n>\r\n <svg\r\n viewBox=\"0 0 100 100\"\r\n role=\"slider\"\r\n [style.width]=\"size() + 'px'\"\r\n [style.height]=\"size() + 'px'\"\r\n [attr.aria-valuemin]=\"min()\"\r\n [attr.aria-valuemax]=\"max()\"\r\n [attr.aria-valuenow]=\"value\"\r\n [attr.tabindex]=\"disabled ? -1 : 0\"\r\n (click)=\"onClick($event)\"\r\n (keydown.enter)=\"onKeyDown($event)\"\r\n (keydown.space)=\"onKeyDown($event)\"\r\n >\r\n <path\r\n class=\"knob-range\"\r\n [attr.d]=\"rangePath()\"\r\n [attr.stroke-width]=\"strokeWidth()\"\r\n [attr.stroke]=\"rangeColor()\"\r\n ></path>\r\n <path\r\n class=\"knob-value\"\r\n [attr.d]=\"valuePath()\"\r\n [attr.stroke-width]=\"strokeWidth()\"\r\n [attr.stroke]=\"valueColor()\"\r\n ></path>\r\n @if (showValue()) {\r\n <text\r\n text-anchor=\"middle\"\r\n class=\"knob-text\"\r\n [attr.x]=\"50\"\r\n [attr.y]=\"57\"\r\n [attr.fill]=\"textColor()\"\r\n [attr.name]=\"name()\"\r\n >\r\n {{ valueToDisplay() }}\r\n </text>\r\n }\r\n </svg>\r\n</div>", styles: ["cmat-knob-input .knob-range{fill:none;transition:stroke .1s ease-in}cmat-knob-input .knob-value{animation-name:dash-frame;animation-fill-mode:forwards;fill:none}cmat-knob-input .knob-text{font-size:1.3rem;text-align:center}cmat-knob-input .cmat-knob-disabled{opacity:.6}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
336
383
|
}
|
|
337
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
384
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: CmatKnobInputComponent, decorators: [{
|
|
338
385
|
type: Component,
|
|
339
386
|
args: [{ selector: 'cmat-knob-input', providers: [
|
|
340
|
-
{ provide: MatFormFieldControl, useExisting: CmatKnobInputComponent }
|
|
341
|
-
], exportAs: 'cmatKnobInput', imports: [NgStyle], encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush,
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
type: HostBinding,
|
|
347
|
-
args: ['attr.id']
|
|
348
|
-
}, {
|
|
349
|
-
type: Input
|
|
350
|
-
}], valueColor: [{
|
|
351
|
-
type: Input
|
|
352
|
-
}], rangeColor: [{
|
|
353
|
-
type: Input
|
|
354
|
-
}], textColor: [{
|
|
355
|
-
type: Input
|
|
356
|
-
}], valueTemplate: [{
|
|
357
|
-
type: Input
|
|
358
|
-
}], name: [{
|
|
359
|
-
type: Input
|
|
360
|
-
}], size: [{
|
|
387
|
+
{ provide: MatFormFieldControl, useExisting: CmatKnobInputComponent },
|
|
388
|
+
], exportAs: 'cmatKnobInput', imports: [NgStyle], encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, host: {
|
|
389
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
390
|
+
'[attr.id]': 'id',
|
|
391
|
+
}, template: "<!-- eslint-disable @angular-eslint/template/no-inline-styles -->\r\n<div\r\n #knob\r\n tabindex=\"-1\"\r\n [attr.data-refresh]=\"refreshVersion()\"\r\n [class.cmat-knob-disabled]=\"disabled\"\r\n (focusin)=\"onFocusIn()\"\r\n (focusout)=\"onFocusOut($event)\"\r\n>\r\n <svg\r\n viewBox=\"0 0 100 100\"\r\n role=\"slider\"\r\n [style.width]=\"size() + 'px'\"\r\n [style.height]=\"size() + 'px'\"\r\n [attr.aria-valuemin]=\"min()\"\r\n [attr.aria-valuemax]=\"max()\"\r\n [attr.aria-valuenow]=\"value\"\r\n [attr.tabindex]=\"disabled ? -1 : 0\"\r\n (click)=\"onClick($event)\"\r\n (keydown.enter)=\"onKeyDown($event)\"\r\n (keydown.space)=\"onKeyDown($event)\"\r\n >\r\n <path\r\n class=\"knob-range\"\r\n [attr.d]=\"rangePath()\"\r\n [attr.stroke-width]=\"strokeWidth()\"\r\n [attr.stroke]=\"rangeColor()\"\r\n ></path>\r\n <path\r\n class=\"knob-value\"\r\n [attr.d]=\"valuePath()\"\r\n [attr.stroke-width]=\"strokeWidth()\"\r\n [attr.stroke]=\"valueColor()\"\r\n ></path>\r\n @if (showValue()) {\r\n <text\r\n text-anchor=\"middle\"\r\n class=\"knob-text\"\r\n [attr.x]=\"50\"\r\n [attr.y]=\"57\"\r\n [attr.fill]=\"textColor()\"\r\n [attr.name]=\"name()\"\r\n >\r\n {{ valueToDisplay() }}\r\n </text>\r\n }\r\n </svg>\r\n</div>", styles: ["cmat-knob-input .knob-range{fill:none;transition:stroke .1s ease-in}cmat-knob-input .knob-value{animation-name:dash-frame;animation-fill-mode:forwards;fill:none}cmat-knob-input .knob-text{font-size:1.3rem;text-align:center}cmat-knob-input .cmat-knob-disabled{opacity:.6}\n"] }]
|
|
392
|
+
}], ctorParameters: () => [], propDecorators: { knobElementRef: [{ type: i0.ViewChild, args: ['knob', { isSignal: true }] }], valueColor: [{ type: i0.Input, args: [{ isSignal: true, alias: "valueColor", required: false }] }], rangeColor: [{ type: i0.Input, args: [{ isSignal: true, alias: "rangeColor", required: false }] }], textColor: [{ type: i0.Input, args: [{ isSignal: true, alias: "textColor", required: false }] }], valueTemplate: [{ type: i0.Input, args: [{ isSignal: true, alias: "valueTemplate", required: false }] }], name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], step: [{ type: i0.Input, args: [{ isSignal: true, alias: "step", required: false }] }], min: [{ type: i0.Input, args: [{ isSignal: true, alias: "min", required: false }] }], max: [{ type: i0.Input, args: [{ isSignal: true, alias: "max", required: false }] }], strokeWidth: [{ type: i0.Input, args: [{ isSignal: true, alias: "strokeWidth", required: false }] }], showValue: [{ type: i0.Input, args: [{ isSignal: true, alias: "showValue", required: false }] }], valueChange: [{ type: i0.Output, args: ["valueChange"] }], value: [{
|
|
361
393
|
type: Input
|
|
362
|
-
}], step: [{
|
|
363
|
-
type: Input
|
|
364
|
-
}], min: [{
|
|
365
|
-
type: Input
|
|
366
|
-
}], max: [{
|
|
367
|
-
type: Input
|
|
368
|
-
}], strokeWidth: [{
|
|
369
|
-
type: Input
|
|
370
|
-
}], showValue: [{
|
|
371
|
-
type: Input
|
|
372
|
-
}], valueChange: [{
|
|
373
|
-
type: Output
|
|
374
394
|
}], placeholder: [{
|
|
375
395
|
type: Input
|
|
376
|
-
}], value: [{
|
|
377
|
-
type: Input
|
|
378
396
|
}], required: [{
|
|
379
397
|
type: Input
|
|
380
398
|
}], disabled: [{
|