@tectra-ng/ui 0.0.0-stage → 0.1.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/LICENSE +21 -0
- package/README.md +26 -2
- package/amount/README.md +28 -0
- package/autocomplete/README.md +82 -0
- package/avatar/README.md +43 -0
- package/badge/README.md +19 -0
- package/button/README.md +46 -0
- package/button-group/README.md +8 -0
- package/card/README.md +30 -0
- package/cascade-select/README.md +49 -0
- package/checkbox/README.md +64 -0
- package/chip/README.md +38 -0
- package/chips-input/README.md +47 -0
- package/color-picker/README.md +43 -0
- package/confirm/README.md +46 -0
- package/country/README.md +23 -0
- package/country-select/README.md +39 -0
- package/dialog/README.md +84 -0
- package/divider/README.md +24 -0
- package/drawer/README.md +54 -0
- package/email-suggestion/README.md +20 -0
- package/fesm2022/tectra-ng-ui-amount.mjs +415 -0
- package/fesm2022/tectra-ng-ui-amount.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-autocomplete.mjs +730 -0
- package/fesm2022/tectra-ng-ui-autocomplete.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-avatar.mjs +670 -0
- package/fesm2022/tectra-ng-ui-avatar.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-badge.mjs +191 -0
- package/fesm2022/tectra-ng-ui-badge.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-button-group.mjs +50 -0
- package/fesm2022/tectra-ng-ui-button-group.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-button.mjs +725 -0
- package/fesm2022/tectra-ng-ui-button.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-card.mjs +210 -0
- package/fesm2022/tectra-ng-ui-card.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-cascade-select.mjs +887 -0
- package/fesm2022/tectra-ng-ui-cascade-select.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-checkbox.mjs +1150 -0
- package/fesm2022/tectra-ng-ui-checkbox.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-chip.mjs +344 -0
- package/fesm2022/tectra-ng-ui-chip.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-chips-input.mjs +649 -0
- package/fesm2022/tectra-ng-ui-chips-input.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-color-picker.mjs +828 -0
- package/fesm2022/tectra-ng-ui-color-picker.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-confirm.mjs +489 -0
- package/fesm2022/tectra-ng-ui-confirm.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-country-select.mjs +545 -0
- package/fesm2022/tectra-ng-ui-country-select.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-country.mjs +313 -0
- package/fesm2022/tectra-ng-ui-country.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-dialog.mjs +1539 -0
- package/fesm2022/tectra-ng-ui-dialog.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-divider.mjs +194 -0
- package/fesm2022/tectra-ng-ui-divider.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-drawer.mjs +540 -0
- package/fesm2022/tectra-ng-ui-drawer.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-email-suggestion.mjs +341 -0
- package/fesm2022/tectra-ng-ui-email-suggestion.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-field.mjs +492 -0
- package/fesm2022/tectra-ng-ui-field.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-fieldset.mjs +258 -0
- package/fesm2022/tectra-ng-ui-fieldset.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-highlight-text.mjs +246 -0
- package/fesm2022/tectra-ng-ui-highlight-text.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-icon-field.mjs +478 -0
- package/fesm2022/tectra-ng-ui-icon-field.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-input-group.mjs +113 -0
- package/fesm2022/tectra-ng-ui-input-group.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-input-mask.mjs +413 -0
- package/fesm2022/tectra-ng-ui-input-mask.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-input-number.mjs +1045 -0
- package/fesm2022/tectra-ng-ui-input-number.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-input-otp.mjs +553 -0
- package/fesm2022/tectra-ng-ui-input-otp.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-input.mjs +260 -0
- package/fesm2022/tectra-ng-ui-input.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-key-filter.mjs +185 -0
- package/fesm2022/tectra-ng-ui-key-filter.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-knob.mjs +630 -0
- package/fesm2022/tectra-ng-ui-knob.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-label.mjs +271 -0
- package/fesm2022/tectra-ng-ui-label.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-link.mjs +699 -0
- package/fesm2022/tectra-ng-ui-link.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-listbox.mjs +484 -0
- package/fesm2022/tectra-ng-ui-listbox.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-mention-textarea.mjs +717 -0
- package/fesm2022/tectra-ng-ui-mention-textarea.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-menu.mjs +1484 -0
- package/fesm2022/tectra-ng-ui-menu.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-message.mjs +975 -0
- package/fesm2022/tectra-ng-ui-message.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-multiselect.mjs +569 -0
- package/fesm2022/tectra-ng-ui-multiselect.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-overlay-badge.mjs +345 -0
- package/fesm2022/tectra-ng-ui-overlay-badge.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-paginator.mjs +849 -0
- package/fesm2022/tectra-ng-ui-paginator.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-panel.mjs +317 -0
- package/fesm2022/tectra-ng-ui-panel.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-password-generator.mjs +292 -0
- package/fesm2022/tectra-ng-ui-password-generator.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-password.mjs +871 -0
- package/fesm2022/tectra-ng-ui-password.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-pill.mjs +361 -0
- package/fesm2022/tectra-ng-ui-pill.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-popover.mjs +742 -0
- package/fesm2022/tectra-ng-ui-popover.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-progress-bar.mjs +440 -0
- package/fesm2022/tectra-ng-ui-progress-bar.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-progress-spinner.mjs +265 -0
- package/fesm2022/tectra-ng-ui-progress-spinner.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-radio-button.mjs +817 -0
- package/fesm2022/tectra-ng-ui-radio-button.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-rating.mjs +584 -0
- package/fesm2022/tectra-ng-ui-rating.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-select.mjs +2478 -0
- package/fesm2022/tectra-ng-ui-select.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-skeleton.mjs +548 -0
- package/fesm2022/tectra-ng-ui-skeleton.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-slider.mjs +630 -0
- package/fesm2022/tectra-ng-ui-slider.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-speed-dial.mjs +669 -0
- package/fesm2022/tectra-ng-ui-speed-dial.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-split-button.mjs +614 -0
- package/fesm2022/tectra-ng-ui-split-button.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-status-icon.mjs +295 -0
- package/fesm2022/tectra-ng-ui-status-icon.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-table.mjs +5997 -0
- package/fesm2022/tectra-ng-ui-table.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-tag.mjs +422 -0
- package/fesm2022/tectra-ng-ui-tag.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-textarea.mjs +482 -0
- package/fesm2022/tectra-ng-ui-textarea.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-toast.mjs +668 -0
- package/fesm2022/tectra-ng-ui-toast.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-toggle-button.mjs +416 -0
- package/fesm2022/tectra-ng-ui-toggle-button.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-toggle-switch.mjs +560 -0
- package/fesm2022/tectra-ng-ui-toggle-switch.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-tooltip.mjs +835 -0
- package/fesm2022/tectra-ng-ui-tooltip.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-tree-select.mjs +986 -0
- package/fesm2022/tectra-ng-ui-tree-select.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui.mjs +4 -0
- package/fesm2022/tectra-ng-ui.mjs.map +1 -0
- package/field/README.md +43 -0
- package/fieldset/README.md +36 -0
- package/highlight-text/README.md +20 -0
- package/icon-field/README.md +30 -0
- package/input/README.md +22 -0
- package/input-group/README.md +21 -0
- package/input-mask/README.md +30 -0
- package/input-number/README.md +61 -0
- package/input-otp/README.md +44 -0
- package/key-filter/README.md +31 -0
- package/knob/README.md +50 -0
- package/label/README.md +29 -0
- package/link/README.md +47 -0
- package/listbox/README.md +68 -0
- package/mention-textarea/README.md +47 -0
- package/menu/README.md +65 -0
- package/message/README.md +58 -0
- package/multiselect/README.md +85 -0
- package/overlay-badge/README.md +30 -0
- package/package.json +301 -3
- package/paginator/README.md +60 -0
- package/panel/README.md +45 -0
- package/password/README.md +60 -0
- package/password-generator/README.md +34 -0
- package/pill/README.md +42 -0
- package/popover/README.md +67 -0
- package/progress-bar/README.md +32 -0
- package/progress-spinner/README.md +22 -0
- package/radio-button/README.md +54 -0
- package/rating/README.md +49 -0
- package/select/README.md +78 -0
- package/skeleton/README.md +27 -0
- package/slider/README.md +48 -0
- package/speed-dial/README.md +49 -0
- package/split-button/README.md +45 -0
- package/status-icon/README.md +22 -0
- package/table/README.md +178 -0
- package/tag/README.md +42 -0
- package/textarea/README.md +37 -0
- package/toast/README.md +52 -0
- package/toggle-button/README.md +34 -0
- package/toggle-switch/README.md +49 -0
- package/tooltip/README.md +60 -0
- package/tree-select/README.md +49 -0
- package/types/tectra-ng-ui-amount.d.ts +135 -0
- package/types/tectra-ng-ui-amount.d.ts.map +1 -0
- package/types/tectra-ng-ui-autocomplete.d.ts +250 -0
- package/types/tectra-ng-ui-autocomplete.d.ts.map +1 -0
- package/types/tectra-ng-ui-avatar.d.ts +289 -0
- package/types/tectra-ng-ui-avatar.d.ts.map +1 -0
- package/types/tectra-ng-ui-badge.d.ts +119 -0
- package/types/tectra-ng-ui-badge.d.ts.map +1 -0
- package/types/tectra-ng-ui-button-group.d.ts +6 -0
- package/types/tectra-ng-ui-button-group.d.ts.map +1 -0
- package/types/tectra-ng-ui-button.d.ts +466 -0
- package/types/tectra-ng-ui-button.d.ts.map +1 -0
- package/types/tectra-ng-ui-card.d.ts +71 -0
- package/types/tectra-ng-ui-card.d.ts.map +1 -0
- package/types/tectra-ng-ui-cascade-select.d.ts +244 -0
- package/types/tectra-ng-ui-cascade-select.d.ts.map +1 -0
- package/types/tectra-ng-ui-checkbox.d.ts +450 -0
- package/types/tectra-ng-ui-checkbox.d.ts.map +1 -0
- package/types/tectra-ng-ui-chip.d.ts +106 -0
- package/types/tectra-ng-ui-chip.d.ts.map +1 -0
- package/types/tectra-ng-ui-chips-input.d.ts +187 -0
- package/types/tectra-ng-ui-chips-input.d.ts.map +1 -0
- package/types/tectra-ng-ui-color-picker.d.ts +237 -0
- package/types/tectra-ng-ui-color-picker.d.ts.map +1 -0
- package/types/tectra-ng-ui-confirm.d.ts +80 -0
- package/types/tectra-ng-ui-confirm.d.ts.map +1 -0
- package/types/tectra-ng-ui-country-select.d.ts +235 -0
- package/types/tectra-ng-ui-country-select.d.ts.map +1 -0
- package/types/tectra-ng-ui-country.d.ts +105 -0
- package/types/tectra-ng-ui-country.d.ts.map +1 -0
- package/types/tectra-ng-ui-dialog.d.ts +453 -0
- package/types/tectra-ng-ui-dialog.d.ts.map +1 -0
- package/types/tectra-ng-ui-divider.d.ts +70 -0
- package/types/tectra-ng-ui-divider.d.ts.map +1 -0
- package/types/tectra-ng-ui-drawer.d.ts +188 -0
- package/types/tectra-ng-ui-drawer.d.ts.map +1 -0
- package/types/tectra-ng-ui-email-suggestion.d.ts +84 -0
- package/types/tectra-ng-ui-email-suggestion.d.ts.map +1 -0
- package/types/tectra-ng-ui-field.d.ts +139 -0
- package/types/tectra-ng-ui-field.d.ts.map +1 -0
- package/types/tectra-ng-ui-fieldset.d.ts +74 -0
- package/types/tectra-ng-ui-fieldset.d.ts.map +1 -0
- package/types/tectra-ng-ui-highlight-text.d.ts +75 -0
- package/types/tectra-ng-ui-highlight-text.d.ts.map +1 -0
- package/types/tectra-ng-ui-icon-field.d.ts +77 -0
- package/types/tectra-ng-ui-icon-field.d.ts.map +1 -0
- package/types/tectra-ng-ui-input-group.d.ts +18 -0
- package/types/tectra-ng-ui-input-group.d.ts.map +1 -0
- package/types/tectra-ng-ui-input-mask.d.ts +91 -0
- package/types/tectra-ng-ui-input-mask.d.ts.map +1 -0
- package/types/tectra-ng-ui-input-number.d.ts +326 -0
- package/types/tectra-ng-ui-input-number.d.ts.map +1 -0
- package/types/tectra-ng-ui-input-otp.d.ts +173 -0
- package/types/tectra-ng-ui-input-otp.d.ts.map +1 -0
- package/types/tectra-ng-ui-input.d.ts +113 -0
- package/types/tectra-ng-ui-input.d.ts.map +1 -0
- package/types/tectra-ng-ui-key-filter.d.ts +43 -0
- package/types/tectra-ng-ui-key-filter.d.ts.map +1 -0
- package/types/tectra-ng-ui-knob.d.ts +207 -0
- package/types/tectra-ng-ui-knob.d.ts.map +1 -0
- package/types/tectra-ng-ui-label.d.ts +53 -0
- package/types/tectra-ng-ui-label.d.ts.map +1 -0
- package/types/tectra-ng-ui-link.d.ts +223 -0
- package/types/tectra-ng-ui-link.d.ts.map +1 -0
- package/types/tectra-ng-ui-listbox.d.ts +131 -0
- package/types/tectra-ng-ui-listbox.d.ts.map +1 -0
- package/types/tectra-ng-ui-mention-textarea.d.ts +169 -0
- package/types/tectra-ng-ui-mention-textarea.d.ts.map +1 -0
- package/types/tectra-ng-ui-menu.d.ts +512 -0
- package/types/tectra-ng-ui-menu.d.ts.map +1 -0
- package/types/tectra-ng-ui-message.d.ts +390 -0
- package/types/tectra-ng-ui-message.d.ts.map +1 -0
- package/types/tectra-ng-ui-multiselect.d.ts +216 -0
- package/types/tectra-ng-ui-multiselect.d.ts.map +1 -0
- package/types/tectra-ng-ui-overlay-badge.d.ts +104 -0
- package/types/tectra-ng-ui-overlay-badge.d.ts.map +1 -0
- package/types/tectra-ng-ui-paginator.d.ts +293 -0
- package/types/tectra-ng-ui-paginator.d.ts.map +1 -0
- package/types/tectra-ng-ui-panel.d.ts +133 -0
- package/types/tectra-ng-ui-panel.d.ts.map +1 -0
- package/types/tectra-ng-ui-password-generator.d.ts +80 -0
- package/types/tectra-ng-ui-password-generator.d.ts.map +1 -0
- package/types/tectra-ng-ui-password.d.ts +271 -0
- package/types/tectra-ng-ui-password.d.ts.map +1 -0
- package/types/tectra-ng-ui-pill.d.ts +167 -0
- package/types/tectra-ng-ui-pill.d.ts.map +1 -0
- package/types/tectra-ng-ui-popover.d.ts +244 -0
- package/types/tectra-ng-ui-popover.d.ts.map +1 -0
- package/types/tectra-ng-ui-progress-bar.d.ts +151 -0
- package/types/tectra-ng-ui-progress-bar.d.ts.map +1 -0
- package/types/tectra-ng-ui-progress-spinner.d.ts +95 -0
- package/types/tectra-ng-ui-progress-spinner.d.ts.map +1 -0
- package/types/tectra-ng-ui-radio-button.d.ts +380 -0
- package/types/tectra-ng-ui-radio-button.d.ts.map +1 -0
- package/types/tectra-ng-ui-rating.d.ts +195 -0
- package/types/tectra-ng-ui-rating.d.ts.map +1 -0
- package/types/tectra-ng-ui-select.d.ts +761 -0
- package/types/tectra-ng-ui-select.d.ts.map +1 -0
- package/types/tectra-ng-ui-skeleton.d.ts +182 -0
- package/types/tectra-ng-ui-skeleton.d.ts.map +1 -0
- package/types/tectra-ng-ui-slider.d.ts +220 -0
- package/types/tectra-ng-ui-slider.d.ts.map +1 -0
- package/types/tectra-ng-ui-speed-dial.d.ts +175 -0
- package/types/tectra-ng-ui-speed-dial.d.ts.map +1 -0
- package/types/tectra-ng-ui-split-button.d.ts +139 -0
- package/types/tectra-ng-ui-split-button.d.ts.map +1 -0
- package/types/tectra-ng-ui-status-icon.d.ts +105 -0
- package/types/tectra-ng-ui-status-icon.d.ts.map +1 -0
- package/types/tectra-ng-ui-table.d.ts +1301 -0
- package/types/tectra-ng-ui-table.d.ts.map +1 -0
- package/types/tectra-ng-ui-tag.d.ts +157 -0
- package/types/tectra-ng-ui-tag.d.ts.map +1 -0
- package/types/tectra-ng-ui-textarea.d.ts +146 -0
- package/types/tectra-ng-ui-textarea.d.ts.map +1 -0
- package/types/tectra-ng-ui-toast.d.ts +268 -0
- package/types/tectra-ng-ui-toast.d.ts.map +1 -0
- package/types/tectra-ng-ui-toggle-button.d.ts +184 -0
- package/types/tectra-ng-ui-toggle-button.d.ts.map +1 -0
- package/types/tectra-ng-ui-toggle-switch.d.ts +226 -0
- package/types/tectra-ng-ui-toggle-switch.d.ts.map +1 -0
- package/types/tectra-ng-ui-tooltip.d.ts +275 -0
- package/types/tectra-ng-ui-tooltip.d.ts.map +1 -0
- package/types/tectra-ng-ui-tree-select.d.ts +339 -0
- package/types/tectra-ng-ui-tree-select.d.ts.map +1 -0
- package/types/tectra-ng-ui.d.ts +2 -0
- package/types/tectra-ng-ui.d.ts.map +1 -0
|
@@ -0,0 +1,630 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import { ChangeDetectionStrategy, Component, Directive, TemplateRef, booleanAttribute, computed, contentChild, forwardRef, inject, input, numberAttribute, output, signal, viewChild } from "@angular/core";
|
|
3
|
+
import { NgTemplateOutlet } from "@angular/common";
|
|
4
|
+
import { NG_VALUE_ACCESSOR } from "@angular/forms";
|
|
5
|
+
import { injectPassThrough, injectUnstyled } from "@tectra-ng/core/config";
|
|
6
|
+
import { TxFormControlBase, injectFieldInvalid } from "@tectra-ng/core/forms";
|
|
7
|
+
import { TxLocaleService } from "@tectra-ng/core/i18n";
|
|
8
|
+
import { optionalBoolean, optionalNumber } from "@tectra-ng/core/utils";
|
|
9
|
+
import { toStyleObject } from "@tectra-ng/themes";
|
|
10
|
+
var TxKnobValueTemplate = class TxKnobValueTemplate {
|
|
11
|
+
templateRef = inject(TemplateRef);
|
|
12
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
13
|
+
minVersion: "12.0.0",
|
|
14
|
+
version: "22.2.3",
|
|
15
|
+
ngImport: i0,
|
|
16
|
+
type: TxKnobValueTemplate,
|
|
17
|
+
deps: [],
|
|
18
|
+
target: i0.ɵɵFactoryTarget.Directive
|
|
19
|
+
});
|
|
20
|
+
static ɵdir = i0.ɵɵngDeclareDirective({
|
|
21
|
+
minVersion: "14.0.0",
|
|
22
|
+
version: "22.2.3",
|
|
23
|
+
type: TxKnobValueTemplate,
|
|
24
|
+
isStandalone: true,
|
|
25
|
+
selector: "ng-template[txKnobValue]",
|
|
26
|
+
ngImport: i0
|
|
27
|
+
});
|
|
28
|
+
};
|
|
29
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
30
|
+
minVersion: "12.0.0",
|
|
31
|
+
version: "22.2.3",
|
|
32
|
+
ngImport: i0,
|
|
33
|
+
type: TxKnobValueTemplate,
|
|
34
|
+
decorators: [{
|
|
35
|
+
type: Directive,
|
|
36
|
+
args: [{ selector: "ng-template[txKnobValue]" }]
|
|
37
|
+
}]
|
|
38
|
+
});
|
|
39
|
+
const CENTER = 50;
|
|
40
|
+
var TxKnob = class TxKnob extends TxFormControlBase {
|
|
41
|
+
localeService = inject(TxLocaleService);
|
|
42
|
+
lastFraction = 0;
|
|
43
|
+
min = input(0, {
|
|
44
|
+
...ngDevMode ? { debugName: "min" } : /* istanbul ignore next */ {},
|
|
45
|
+
transform: numberAttribute
|
|
46
|
+
});
|
|
47
|
+
max = input(100, {
|
|
48
|
+
...ngDevMode ? { debugName: "max" } : /* istanbul ignore next */ {},
|
|
49
|
+
transform: numberAttribute
|
|
50
|
+
});
|
|
51
|
+
step = input(1, {
|
|
52
|
+
...ngDevMode ? { debugName: "step" } : /* istanbul ignore next */ {},
|
|
53
|
+
transform: numberAttribute
|
|
54
|
+
});
|
|
55
|
+
limit = input(void 0, {
|
|
56
|
+
...ngDevMode ? { debugName: "limit" } : /* istanbul ignore next */ {},
|
|
57
|
+
transform: optionalNumber
|
|
58
|
+
});
|
|
59
|
+
size = input(100, {
|
|
60
|
+
...ngDevMode ? { debugName: "size" } : /* istanbul ignore next */ {},
|
|
61
|
+
transform: numberAttribute
|
|
62
|
+
});
|
|
63
|
+
strokeWidth = input(12, {
|
|
64
|
+
...ngDevMode ? { debugName: "strokeWidth" } : /* istanbul ignore next */ {},
|
|
65
|
+
transform: numberAttribute
|
|
66
|
+
});
|
|
67
|
+
arc = input("dial", ...ngDevMode ? [{ debugName: "arc" }] : /* istanbul ignore next */ []);
|
|
68
|
+
showValue = input(true, {
|
|
69
|
+
...ngDevMode ? { debugName: "showValue" } : /* istanbul ignore next */ {},
|
|
70
|
+
transform: booleanAttribute
|
|
71
|
+
});
|
|
72
|
+
showHandle = input(void 0, {
|
|
73
|
+
...ngDevMode ? { debugName: "showHandle" } : /* istanbul ignore next */ {},
|
|
74
|
+
transform: optionalBoolean
|
|
75
|
+
});
|
|
76
|
+
valueTemplate = input("{value}", ...ngDevMode ? [{ debugName: "valueTemplate" }] : /* istanbul ignore next */ []);
|
|
77
|
+
invalid = input(void 0, {
|
|
78
|
+
...ngDevMode ? { debugName: "invalid" } : /* istanbul ignore next */ {},
|
|
79
|
+
transform: optionalBoolean
|
|
80
|
+
});
|
|
81
|
+
disabledInput = input(false, {
|
|
82
|
+
...ngDevMode ? { debugName: "disabledInput" } : /* istanbul ignore next */ {},
|
|
83
|
+
alias: "disabled",
|
|
84
|
+
transform: booleanAttribute
|
|
85
|
+
});
|
|
86
|
+
readonly = input(false, {
|
|
87
|
+
...ngDevMode ? { debugName: "readonly" } : /* istanbul ignore next */ {},
|
|
88
|
+
transform: booleanAttribute
|
|
89
|
+
});
|
|
90
|
+
ariaLabel = input(void 0, ...ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []);
|
|
91
|
+
ariaLabelledBy = input(void 0, ...ngDevMode ? [{ debugName: "ariaLabelledBy" }] : /* istanbul ignore next */ []);
|
|
92
|
+
tabindex = input(void 0, {
|
|
93
|
+
...ngDevMode ? { debugName: "tabindex" } : /* istanbul ignore next */ {},
|
|
94
|
+
transform: optionalNumber
|
|
95
|
+
});
|
|
96
|
+
dt = input(void 0, ...ngDevMode ? [{ debugName: "dt" }] : /* istanbul ignore next */ []);
|
|
97
|
+
pt = input(void 0, ...ngDevMode ? [{ debugName: "pt" }] : /* istanbul ignore next */ []);
|
|
98
|
+
ptOptions = input(void 0, ...ngDevMode ? [{ debugName: "ptOptions" }] : /* istanbul ignore next */ []);
|
|
99
|
+
unstyled = input(void 0, {
|
|
100
|
+
...ngDevMode ? { debugName: "unstyled" } : /* istanbul ignore next */ {},
|
|
101
|
+
transform: optionalBoolean
|
|
102
|
+
});
|
|
103
|
+
changed = output();
|
|
104
|
+
template = contentChild(TxKnobValueTemplate, ...ngDevMode ? [{ debugName: "template" }] : /* istanbul ignore next */ []);
|
|
105
|
+
svg = viewChild.required("svg", ...ngDevMode ? [{ debugName: "svg" }] : /* istanbul ignore next */ []);
|
|
106
|
+
isUnstyled = injectUnstyled(this.unstyled);
|
|
107
|
+
isInvalid = injectFieldInvalid(this.invalid);
|
|
108
|
+
passThrough = injectPassThrough("knob", this, this.pt, this.ptOptions);
|
|
109
|
+
isDragging = signal(false, ...ngDevMode ? [{ debugName: "isDragging" }] : /* istanbul ignore next */ []);
|
|
110
|
+
isDisabled = computed(() => this.disabled() || this.disabledInput(), ...ngDevMode ? [{ debugName: "isDisabled" }] : /* istanbul ignore next */ []);
|
|
111
|
+
isEditable = computed(() => !this.isDisabled() && !this.readonly(), ...ngDevMode ? [{ debugName: "isEditable" }] : /* istanbul ignore next */ []);
|
|
112
|
+
ceiling = computed(() => Math.min(this.max(), this.limit() ?? this.max()), ...ngDevMode ? [{ debugName: "ceiling" }] : /* istanbul ignore next */ []);
|
|
113
|
+
current = computed(() => this.clamp(this.value() ?? this.min()), ...ngDevMode ? [{ debugName: "current" }] : /* istanbul ignore next */ []);
|
|
114
|
+
radius = computed(() => CENTER - this.strokeWidth() / 2 - (this.hasHandle() ? 3 : 0), ...ngDevMode ? [{ debugName: "radius" }] : /* istanbul ignore next */ []);
|
|
115
|
+
sweep = computed(() => this.arc() === "ring" ? 360 : 270, ...ngDevMode ? [{ debugName: "sweep" }] : /* istanbul ignore next */ []);
|
|
116
|
+
start = computed(() => this.arc() === "ring" ? -90 : 135, ...ngDevMode ? [{ debugName: "start" }] : /* istanbul ignore next */ []);
|
|
117
|
+
span = computed(() => this.sweep() / 360 * 100, ...ngDevMode ? [{ debugName: "span" }] : /* istanbul ignore next */ []);
|
|
118
|
+
hasHandle = computed(() => this.showHandle() ?? this.arc() === "ring", ...ngDevMode ? [{ debugName: "hasHandle" }] : /* istanbul ignore next */ []);
|
|
119
|
+
fraction = computed(() => this.fractionOf(this.current()), ...ngDevMode ? [{ debugName: "fraction" }] : /* istanbul ignore next */ []);
|
|
120
|
+
limitFraction = computed(() => this.limit() === void 0 ? 1 : this.fractionOf(this.ceiling()), ...ngDevMode ? [{ debugName: "limitFraction" }] : /* istanbul ignore next */ []);
|
|
121
|
+
rotate = computed(() => `rotate(${this.start()} ${CENTER} ${CENTER})`, ...ngDevMode ? [{ debugName: "rotate" }] : /* istanbul ignore next */ []);
|
|
122
|
+
valueDash = computed(() => `${this.fraction() * this.span()} 100`, ...ngDevMode ? [{ debugName: "valueDash" }] : /* istanbul ignore next */ []);
|
|
123
|
+
rangeDash = computed(() => `${this.span()} 100`, ...ngDevMode ? [{ debugName: "rangeDash" }] : /* istanbul ignore next */ []);
|
|
124
|
+
limitDash = computed(() => `0 ${this.limitFraction() * this.span()} ${(1 - this.limitFraction()) * this.span()} 100`, ...ngDevMode ? [{ debugName: "limitDash" }] : /* istanbul ignore next */ []);
|
|
125
|
+
handle = computed(() => this.point(this.fraction()), ...ngDevMode ? [{ debugName: "handle" }] : /* istanbul ignore next */ []);
|
|
126
|
+
text = computed(() => this.valueTemplate().replace("{value}", this.localeService.formatNumber(this.current())), ...ngDevMode ? [{ debugName: "text" }] : /* istanbul ignore next */ []);
|
|
127
|
+
hostStyle = computed(() => ({
|
|
128
|
+
...toStyleObject(this.dt(), "--tx-knob"),
|
|
129
|
+
width: `${this.size()}px`,
|
|
130
|
+
height: `${this.size()}px`,
|
|
131
|
+
...this.passThrough().root?.style
|
|
132
|
+
}), ...ngDevMode ? [{ debugName: "hostStyle" }] : /* istanbul ignore next */ []);
|
|
133
|
+
center = CENTER;
|
|
134
|
+
onPointerDown(event) {
|
|
135
|
+
if (!this.isEditable() || event.button !== 0) return;
|
|
136
|
+
event.preventDefault();
|
|
137
|
+
event.currentTarget.setPointerCapture?.(event.pointerId);
|
|
138
|
+
event.currentTarget.focus();
|
|
139
|
+
this.isDragging.set(true);
|
|
140
|
+
this.lastFraction = this.fraction();
|
|
141
|
+
this.moveTo(event, true);
|
|
142
|
+
}
|
|
143
|
+
onPointerMove(event) {
|
|
144
|
+
if (this.isDragging()) this.moveTo(event, false);
|
|
145
|
+
}
|
|
146
|
+
onPointerUp() {
|
|
147
|
+
if (this.isDragging()) {
|
|
148
|
+
this.isDragging.set(false);
|
|
149
|
+
this.markTouched();
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
onKeydown(event) {
|
|
153
|
+
if (!this.isEditable()) return;
|
|
154
|
+
const value = this.current();
|
|
155
|
+
const step = this.step();
|
|
156
|
+
const moves = {
|
|
157
|
+
ArrowRight: value + step,
|
|
158
|
+
ArrowUp: value + step,
|
|
159
|
+
ArrowLeft: value - step,
|
|
160
|
+
ArrowDown: value - step,
|
|
161
|
+
PageUp: value + step * 10,
|
|
162
|
+
PageDown: value - step * 10,
|
|
163
|
+
Home: this.min(),
|
|
164
|
+
End: this.ceiling()
|
|
165
|
+
};
|
|
166
|
+
if (event.key in moves) {
|
|
167
|
+
event.preventDefault();
|
|
168
|
+
this.commit(moves[event.key], event);
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
onBlur() {
|
|
172
|
+
this.markTouched();
|
|
173
|
+
}
|
|
174
|
+
moveTo(event, first) {
|
|
175
|
+
const rect = this.svg().nativeElement.getBoundingClientRect();
|
|
176
|
+
if (!rect.width) return;
|
|
177
|
+
const x = (event.clientX - rect.left) / rect.width * 100 - CENTER;
|
|
178
|
+
const y = (event.clientY - rect.top) / rect.height * 100 - CENTER;
|
|
179
|
+
let relative = (Math.atan2(y, x) * 180 / Math.PI - this.start() + 720) % 360;
|
|
180
|
+
if (relative > this.sweep()) relative = relative > this.sweep() + (360 - this.sweep()) / 2 ? 0 : this.sweep();
|
|
181
|
+
let fraction = relative / this.sweep();
|
|
182
|
+
if (!first && this.arc() === "ring" && Math.abs(fraction - this.lastFraction) > .5) fraction = this.lastFraction > .5 ? 1 : 0;
|
|
183
|
+
this.lastFraction = fraction;
|
|
184
|
+
this.commit(this.min() + fraction * (this.max() - this.min()), event);
|
|
185
|
+
}
|
|
186
|
+
commit(raw, event) {
|
|
187
|
+
const step = this.step();
|
|
188
|
+
const snapped = Math.round((raw - this.min()) / step) * step + this.min();
|
|
189
|
+
const value = Number(this.clamp(snapped).toFixed(decimals(step)));
|
|
190
|
+
if (value !== this.value()) {
|
|
191
|
+
this.updateValue(value);
|
|
192
|
+
this.changed.emit({
|
|
193
|
+
value,
|
|
194
|
+
originalEvent: event
|
|
195
|
+
});
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
clamp(value) {
|
|
199
|
+
return Math.min(this.ceiling(), Math.max(this.min(), value));
|
|
200
|
+
}
|
|
201
|
+
fractionOf(value) {
|
|
202
|
+
const range = this.max() - this.min();
|
|
203
|
+
return range > 0 ? (value - this.min()) / range : 0;
|
|
204
|
+
}
|
|
205
|
+
point(fraction) {
|
|
206
|
+
const angle = (this.start() + fraction * this.sweep()) * Math.PI / 180;
|
|
207
|
+
return {
|
|
208
|
+
x: CENTER + this.radius() * Math.cos(angle),
|
|
209
|
+
y: CENTER + this.radius() * Math.sin(angle)
|
|
210
|
+
};
|
|
211
|
+
}
|
|
212
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
213
|
+
minVersion: "12.0.0",
|
|
214
|
+
version: "22.2.3",
|
|
215
|
+
ngImport: i0,
|
|
216
|
+
type: TxKnob,
|
|
217
|
+
deps: null,
|
|
218
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
219
|
+
});
|
|
220
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
221
|
+
minVersion: "17.0.0",
|
|
222
|
+
version: "22.2.3",
|
|
223
|
+
type: TxKnob,
|
|
224
|
+
isStandalone: true,
|
|
225
|
+
selector: "tx-knob",
|
|
226
|
+
inputs: {
|
|
227
|
+
min: {
|
|
228
|
+
classPropertyName: "min",
|
|
229
|
+
publicName: "min",
|
|
230
|
+
isSignal: true,
|
|
231
|
+
isRequired: false,
|
|
232
|
+
transformFunction: null
|
|
233
|
+
},
|
|
234
|
+
max: {
|
|
235
|
+
classPropertyName: "max",
|
|
236
|
+
publicName: "max",
|
|
237
|
+
isSignal: true,
|
|
238
|
+
isRequired: false,
|
|
239
|
+
transformFunction: null
|
|
240
|
+
},
|
|
241
|
+
step: {
|
|
242
|
+
classPropertyName: "step",
|
|
243
|
+
publicName: "step",
|
|
244
|
+
isSignal: true,
|
|
245
|
+
isRequired: false,
|
|
246
|
+
transformFunction: null
|
|
247
|
+
},
|
|
248
|
+
limit: {
|
|
249
|
+
classPropertyName: "limit",
|
|
250
|
+
publicName: "limit",
|
|
251
|
+
isSignal: true,
|
|
252
|
+
isRequired: false,
|
|
253
|
+
transformFunction: null
|
|
254
|
+
},
|
|
255
|
+
size: {
|
|
256
|
+
classPropertyName: "size",
|
|
257
|
+
publicName: "size",
|
|
258
|
+
isSignal: true,
|
|
259
|
+
isRequired: false,
|
|
260
|
+
transformFunction: null
|
|
261
|
+
},
|
|
262
|
+
strokeWidth: {
|
|
263
|
+
classPropertyName: "strokeWidth",
|
|
264
|
+
publicName: "strokeWidth",
|
|
265
|
+
isSignal: true,
|
|
266
|
+
isRequired: false,
|
|
267
|
+
transformFunction: null
|
|
268
|
+
},
|
|
269
|
+
arc: {
|
|
270
|
+
classPropertyName: "arc",
|
|
271
|
+
publicName: "arc",
|
|
272
|
+
isSignal: true,
|
|
273
|
+
isRequired: false,
|
|
274
|
+
transformFunction: null
|
|
275
|
+
},
|
|
276
|
+
showValue: {
|
|
277
|
+
classPropertyName: "showValue",
|
|
278
|
+
publicName: "showValue",
|
|
279
|
+
isSignal: true,
|
|
280
|
+
isRequired: false,
|
|
281
|
+
transformFunction: null
|
|
282
|
+
},
|
|
283
|
+
showHandle: {
|
|
284
|
+
classPropertyName: "showHandle",
|
|
285
|
+
publicName: "showHandle",
|
|
286
|
+
isSignal: true,
|
|
287
|
+
isRequired: false,
|
|
288
|
+
transformFunction: null
|
|
289
|
+
},
|
|
290
|
+
valueTemplate: {
|
|
291
|
+
classPropertyName: "valueTemplate",
|
|
292
|
+
publicName: "valueTemplate",
|
|
293
|
+
isSignal: true,
|
|
294
|
+
isRequired: false,
|
|
295
|
+
transformFunction: null
|
|
296
|
+
},
|
|
297
|
+
invalid: {
|
|
298
|
+
classPropertyName: "invalid",
|
|
299
|
+
publicName: "invalid",
|
|
300
|
+
isSignal: true,
|
|
301
|
+
isRequired: false,
|
|
302
|
+
transformFunction: null
|
|
303
|
+
},
|
|
304
|
+
disabledInput: {
|
|
305
|
+
classPropertyName: "disabledInput",
|
|
306
|
+
publicName: "disabled",
|
|
307
|
+
isSignal: true,
|
|
308
|
+
isRequired: false,
|
|
309
|
+
transformFunction: null
|
|
310
|
+
},
|
|
311
|
+
readonly: {
|
|
312
|
+
classPropertyName: "readonly",
|
|
313
|
+
publicName: "readonly",
|
|
314
|
+
isSignal: true,
|
|
315
|
+
isRequired: false,
|
|
316
|
+
transformFunction: null
|
|
317
|
+
},
|
|
318
|
+
ariaLabel: {
|
|
319
|
+
classPropertyName: "ariaLabel",
|
|
320
|
+
publicName: "ariaLabel",
|
|
321
|
+
isSignal: true,
|
|
322
|
+
isRequired: false,
|
|
323
|
+
transformFunction: null
|
|
324
|
+
},
|
|
325
|
+
ariaLabelledBy: {
|
|
326
|
+
classPropertyName: "ariaLabelledBy",
|
|
327
|
+
publicName: "ariaLabelledBy",
|
|
328
|
+
isSignal: true,
|
|
329
|
+
isRequired: false,
|
|
330
|
+
transformFunction: null
|
|
331
|
+
},
|
|
332
|
+
tabindex: {
|
|
333
|
+
classPropertyName: "tabindex",
|
|
334
|
+
publicName: "tabindex",
|
|
335
|
+
isSignal: true,
|
|
336
|
+
isRequired: false,
|
|
337
|
+
transformFunction: null
|
|
338
|
+
},
|
|
339
|
+
dt: {
|
|
340
|
+
classPropertyName: "dt",
|
|
341
|
+
publicName: "dt",
|
|
342
|
+
isSignal: true,
|
|
343
|
+
isRequired: false,
|
|
344
|
+
transformFunction: null
|
|
345
|
+
},
|
|
346
|
+
pt: {
|
|
347
|
+
classPropertyName: "pt",
|
|
348
|
+
publicName: "pt",
|
|
349
|
+
isSignal: true,
|
|
350
|
+
isRequired: false,
|
|
351
|
+
transformFunction: null
|
|
352
|
+
},
|
|
353
|
+
ptOptions: {
|
|
354
|
+
classPropertyName: "ptOptions",
|
|
355
|
+
publicName: "ptOptions",
|
|
356
|
+
isSignal: true,
|
|
357
|
+
isRequired: false,
|
|
358
|
+
transformFunction: null
|
|
359
|
+
},
|
|
360
|
+
unstyled: {
|
|
361
|
+
classPropertyName: "unstyled",
|
|
362
|
+
publicName: "unstyled",
|
|
363
|
+
isSignal: true,
|
|
364
|
+
isRequired: false,
|
|
365
|
+
transformFunction: null
|
|
366
|
+
}
|
|
367
|
+
},
|
|
368
|
+
outputs: { changed: "changed" },
|
|
369
|
+
host: {
|
|
370
|
+
properties: {
|
|
371
|
+
"class": "passThrough().root?.class",
|
|
372
|
+
"style": "hostStyle()",
|
|
373
|
+
"attr.data-styled": "!isUnstyled() || null",
|
|
374
|
+
"attr.data-arc": "arc()",
|
|
375
|
+
"class.tx-knob--dragging": "isDragging()",
|
|
376
|
+
"class.tx-knob--disabled": "isDisabled()",
|
|
377
|
+
"class.tx-knob--readonly": "readonly()",
|
|
378
|
+
"class.tx-knob--invalid": "isInvalid()"
|
|
379
|
+
},
|
|
380
|
+
classAttribute: "tx-knob"
|
|
381
|
+
},
|
|
382
|
+
providers: [{
|
|
383
|
+
provide: NG_VALUE_ACCESSOR,
|
|
384
|
+
useExisting: forwardRef(() => TxKnob),
|
|
385
|
+
multi: true
|
|
386
|
+
}],
|
|
387
|
+
queries: [{
|
|
388
|
+
propertyName: "template",
|
|
389
|
+
first: true,
|
|
390
|
+
predicate: TxKnobValueTemplate,
|
|
391
|
+
descendants: true,
|
|
392
|
+
isSignal: true
|
|
393
|
+
}],
|
|
394
|
+
viewQueries: [{
|
|
395
|
+
propertyName: "svg",
|
|
396
|
+
first: true,
|
|
397
|
+
predicate: ["svg"],
|
|
398
|
+
descendants: true,
|
|
399
|
+
isSignal: true
|
|
400
|
+
}],
|
|
401
|
+
usesInheritance: true,
|
|
402
|
+
ngImport: i0,
|
|
403
|
+
template: "<div\n class=\"tx-knob__control\"\n role=\"slider\"\n [attr.tabindex]=\"isDisabled() ? -1 : (tabindex() ?? 0)\"\n [attr.aria-label]=\"ariaLabel() ?? null\"\n [attr.aria-labelledby]=\"ariaLabelledBy() ?? null\"\n [attr.aria-valuemin]=\"min()\"\n [attr.aria-valuemax]=\"ceiling()\"\n [attr.aria-valuenow]=\"current()\"\n [attr.aria-valuetext]=\"text()\"\n [attr.aria-readonly]=\"readonly() || null\"\n [attr.aria-disabled]=\"isDisabled() || null\"\n [attr.aria-invalid]=\"isInvalid() || null\"\n (pointerdown)=\"onPointerDown($event)\"\n (pointermove)=\"onPointerMove($event)\"\n (pointerup)=\"onPointerUp()\"\n (pointercancel)=\"onPointerUp()\"\n (keydown)=\"onKeydown($event)\"\n (blur)=\"onBlur()\"\n>\n <svg #svg class=\"tx-knob__svg\" viewBox=\"0 0 100 100\" aria-hidden=\"true\" [class]=\"passThrough().svg?.class\" [style]=\"passThrough().svg?.style\">\n <circle\n class=\"tx-knob__range\"\n pathLength=\"100\"\n fill=\"none\"\n [class]=\"passThrough().range?.class\"\n [style]=\"passThrough().range?.style\"\n [attr.cx]=\"center\"\n [attr.cy]=\"center\"\n [attr.r]=\"radius()\"\n [attr.stroke-width]=\"strokeWidth()\"\n [attr.stroke-dasharray]=\"rangeDash()\"\n [attr.transform]=\"rotate()\"\n />\n @if (limit() !== undefined && limitFraction() < 1) {\n <circle\n class=\"tx-knob__limit\"\n pathLength=\"100\"\n fill=\"none\"\n [attr.cx]=\"center\"\n [attr.cy]=\"center\"\n [attr.r]=\"radius()\"\n [attr.stroke-width]=\"strokeWidth()\"\n [attr.stroke-dasharray]=\"limitDash()\"\n [attr.transform]=\"rotate()\"\n />\n }\n @if (fraction() > 0) {\n <circle\n class=\"tx-knob__value\"\n pathLength=\"100\"\n fill=\"none\"\n [class]=\"passThrough().value?.class\"\n [style]=\"passThrough().value?.style\"\n [attr.cx]=\"center\"\n [attr.cy]=\"center\"\n [attr.r]=\"radius()\"\n [attr.stroke-width]=\"strokeWidth()\"\n [attr.stroke-dasharray]=\"valueDash()\"\n [attr.transform]=\"rotate()\"\n />\n }\n @if (hasHandle()) {\n <circle\n class=\"tx-knob__handle\"\n [class]=\"passThrough().handle?.class\"\n [style]=\"passThrough().handle?.style\"\n [attr.cx]=\"handle().x\"\n [attr.cy]=\"handle().y\"\n [attr.r]=\"strokeWidth() / 2 + 2\"\n />\n }\n </svg>\n @if (showValue()) {\n <span class=\"tx-knob__text\" [class]=\"passThrough().text?.class\" [style]=\"passThrough().text?.style\">\n @if (template(); as custom) {\n <ng-container [ngTemplateOutlet]=\"custom.templateRef\" [ngTemplateOutletContext]=\"{ $implicit: current() }\" />\n } @else {\n {{ text() }}\n }\n </span>\n }\n</div>\n",
|
|
404
|
+
styles: [":host{display:inline-block;vertical-align:top}.tx-knob__control{position:relative;container-type:size;width:100%;height:100%;touch-action:none;-webkit-user-select:none;user-select:none}.tx-knob__svg{display:block;width:100%;height:100%;overflow:visible}.tx-knob__text{position:absolute;inset:0;display:grid;place-items:center;pointer-events:none}:host([data-styled]) .tx-knob__control{border-radius:50%;outline:none;cursor:grab}:host([data-styled]) .tx-knob__control:focus-visible{outline:var(--tx-knob-focus-ring-width) solid var(--tx-knob-focus-ring-color);outline-offset:var(--tx-knob-focus-ring-offset)}:host([data-styled].tx-knob--dragging) .tx-knob__control{cursor:grabbing}:host([data-styled]) .tx-knob__range{stroke:var(--tx-knob-range-color);stroke-linecap:round}:host([data-styled]) .tx-knob__limit{stroke:var(--tx-knob-limit-color)}:host([data-styled]) .tx-knob__value{stroke:var(--tx-knob-value-color);stroke-linecap:round;transition:stroke-dasharray var(--tx-knob-transition-duration)}:host([data-styled].tx-knob--dragging) .tx-knob__value{transition:none}:host([data-styled]) .tx-knob__handle{fill:var(--tx-knob-handle-color);stroke:var(--tx-knob-handle-border-color);stroke-width:2.5}:host([data-styled]) .tx-knob__text{color:var(--tx-knob-text-color);font-family:var(--tx-font-family);font-size:var(--tx-knob-text-font-size);font-weight:var(--tx-knob-text-font-weight)}:host([data-styled].tx-knob--invalid) .tx-knob__range{stroke:var(--tx-form-field-invalid-border-color)}:host([data-styled].tx-knob--readonly) .tx-knob__control{cursor:default}:host([data-styled].tx-knob--disabled) .tx-knob__control{cursor:not-allowed;opacity:var(--tx-knob-disabled-opacity)}@media(prefers-reduced-motion:reduce){:host([data-styled]) .tx-knob__value{transition:none}}\n"],
|
|
405
|
+
dependencies: [{
|
|
406
|
+
kind: "directive",
|
|
407
|
+
type: NgTemplateOutlet,
|
|
408
|
+
selector: "[ngTemplateOutlet]",
|
|
409
|
+
inputs: [
|
|
410
|
+
"ngTemplateOutletContext",
|
|
411
|
+
"ngTemplateOutlet",
|
|
412
|
+
"ngTemplateOutletInjector"
|
|
413
|
+
]
|
|
414
|
+
}],
|
|
415
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush
|
|
416
|
+
});
|
|
417
|
+
};
|
|
418
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
419
|
+
minVersion: "12.0.0",
|
|
420
|
+
version: "22.2.3",
|
|
421
|
+
ngImport: i0,
|
|
422
|
+
type: TxKnob,
|
|
423
|
+
decorators: [{
|
|
424
|
+
type: Component,
|
|
425
|
+
args: [{
|
|
426
|
+
selector: "tx-knob",
|
|
427
|
+
imports: [NgTemplateOutlet],
|
|
428
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
429
|
+
providers: [{
|
|
430
|
+
provide: NG_VALUE_ACCESSOR,
|
|
431
|
+
useExisting: forwardRef(() => TxKnob),
|
|
432
|
+
multi: true
|
|
433
|
+
}],
|
|
434
|
+
host: {
|
|
435
|
+
class: "tx-knob",
|
|
436
|
+
"[class]": "passThrough().root?.class",
|
|
437
|
+
"[style]": "hostStyle()",
|
|
438
|
+
"[attr.data-styled]": "!isUnstyled() || null",
|
|
439
|
+
"[attr.data-arc]": "arc()",
|
|
440
|
+
"[class.tx-knob--dragging]": "isDragging()",
|
|
441
|
+
"[class.tx-knob--disabled]": "isDisabled()",
|
|
442
|
+
"[class.tx-knob--readonly]": "readonly()",
|
|
443
|
+
"[class.tx-knob--invalid]": "isInvalid()"
|
|
444
|
+
},
|
|
445
|
+
template: "<div\n class=\"tx-knob__control\"\n role=\"slider\"\n [attr.tabindex]=\"isDisabled() ? -1 : (tabindex() ?? 0)\"\n [attr.aria-label]=\"ariaLabel() ?? null\"\n [attr.aria-labelledby]=\"ariaLabelledBy() ?? null\"\n [attr.aria-valuemin]=\"min()\"\n [attr.aria-valuemax]=\"ceiling()\"\n [attr.aria-valuenow]=\"current()\"\n [attr.aria-valuetext]=\"text()\"\n [attr.aria-readonly]=\"readonly() || null\"\n [attr.aria-disabled]=\"isDisabled() || null\"\n [attr.aria-invalid]=\"isInvalid() || null\"\n (pointerdown)=\"onPointerDown($event)\"\n (pointermove)=\"onPointerMove($event)\"\n (pointerup)=\"onPointerUp()\"\n (pointercancel)=\"onPointerUp()\"\n (keydown)=\"onKeydown($event)\"\n (blur)=\"onBlur()\"\n>\n <svg #svg class=\"tx-knob__svg\" viewBox=\"0 0 100 100\" aria-hidden=\"true\" [class]=\"passThrough().svg?.class\" [style]=\"passThrough().svg?.style\">\n <circle\n class=\"tx-knob__range\"\n pathLength=\"100\"\n fill=\"none\"\n [class]=\"passThrough().range?.class\"\n [style]=\"passThrough().range?.style\"\n [attr.cx]=\"center\"\n [attr.cy]=\"center\"\n [attr.r]=\"radius()\"\n [attr.stroke-width]=\"strokeWidth()\"\n [attr.stroke-dasharray]=\"rangeDash()\"\n [attr.transform]=\"rotate()\"\n />\n @if (limit() !== undefined && limitFraction() < 1) {\n <circle\n class=\"tx-knob__limit\"\n pathLength=\"100\"\n fill=\"none\"\n [attr.cx]=\"center\"\n [attr.cy]=\"center\"\n [attr.r]=\"radius()\"\n [attr.stroke-width]=\"strokeWidth()\"\n [attr.stroke-dasharray]=\"limitDash()\"\n [attr.transform]=\"rotate()\"\n />\n }\n @if (fraction() > 0) {\n <circle\n class=\"tx-knob__value\"\n pathLength=\"100\"\n fill=\"none\"\n [class]=\"passThrough().value?.class\"\n [style]=\"passThrough().value?.style\"\n [attr.cx]=\"center\"\n [attr.cy]=\"center\"\n [attr.r]=\"radius()\"\n [attr.stroke-width]=\"strokeWidth()\"\n [attr.stroke-dasharray]=\"valueDash()\"\n [attr.transform]=\"rotate()\"\n />\n }\n @if (hasHandle()) {\n <circle\n class=\"tx-knob__handle\"\n [class]=\"passThrough().handle?.class\"\n [style]=\"passThrough().handle?.style\"\n [attr.cx]=\"handle().x\"\n [attr.cy]=\"handle().y\"\n [attr.r]=\"strokeWidth() / 2 + 2\"\n />\n }\n </svg>\n @if (showValue()) {\n <span class=\"tx-knob__text\" [class]=\"passThrough().text?.class\" [style]=\"passThrough().text?.style\">\n @if (template(); as custom) {\n <ng-container [ngTemplateOutlet]=\"custom.templateRef\" [ngTemplateOutletContext]=\"{ $implicit: current() }\" />\n } @else {\n {{ text() }}\n }\n </span>\n }\n</div>\n",
|
|
446
|
+
styles: [":host{display:inline-block;vertical-align:top}.tx-knob__control{position:relative;container-type:size;width:100%;height:100%;touch-action:none;-webkit-user-select:none;user-select:none}.tx-knob__svg{display:block;width:100%;height:100%;overflow:visible}.tx-knob__text{position:absolute;inset:0;display:grid;place-items:center;pointer-events:none}:host([data-styled]) .tx-knob__control{border-radius:50%;outline:none;cursor:grab}:host([data-styled]) .tx-knob__control:focus-visible{outline:var(--tx-knob-focus-ring-width) solid var(--tx-knob-focus-ring-color);outline-offset:var(--tx-knob-focus-ring-offset)}:host([data-styled].tx-knob--dragging) .tx-knob__control{cursor:grabbing}:host([data-styled]) .tx-knob__range{stroke:var(--tx-knob-range-color);stroke-linecap:round}:host([data-styled]) .tx-knob__limit{stroke:var(--tx-knob-limit-color)}:host([data-styled]) .tx-knob__value{stroke:var(--tx-knob-value-color);stroke-linecap:round;transition:stroke-dasharray var(--tx-knob-transition-duration)}:host([data-styled].tx-knob--dragging) .tx-knob__value{transition:none}:host([data-styled]) .tx-knob__handle{fill:var(--tx-knob-handle-color);stroke:var(--tx-knob-handle-border-color);stroke-width:2.5}:host([data-styled]) .tx-knob__text{color:var(--tx-knob-text-color);font-family:var(--tx-font-family);font-size:var(--tx-knob-text-font-size);font-weight:var(--tx-knob-text-font-weight)}:host([data-styled].tx-knob--invalid) .tx-knob__range{stroke:var(--tx-form-field-invalid-border-color)}:host([data-styled].tx-knob--readonly) .tx-knob__control{cursor:default}:host([data-styled].tx-knob--disabled) .tx-knob__control{cursor:not-allowed;opacity:var(--tx-knob-disabled-opacity)}@media(prefers-reduced-motion:reduce){:host([data-styled]) .tx-knob__value{transition:none}}\n"]
|
|
447
|
+
}]
|
|
448
|
+
}],
|
|
449
|
+
propDecorators: {
|
|
450
|
+
min: [{
|
|
451
|
+
type: i0.Input,
|
|
452
|
+
args: [{
|
|
453
|
+
isSignal: true,
|
|
454
|
+
alias: "min",
|
|
455
|
+
required: false
|
|
456
|
+
}]
|
|
457
|
+
}],
|
|
458
|
+
max: [{
|
|
459
|
+
type: i0.Input,
|
|
460
|
+
args: [{
|
|
461
|
+
isSignal: true,
|
|
462
|
+
alias: "max",
|
|
463
|
+
required: false
|
|
464
|
+
}]
|
|
465
|
+
}],
|
|
466
|
+
step: [{
|
|
467
|
+
type: i0.Input,
|
|
468
|
+
args: [{
|
|
469
|
+
isSignal: true,
|
|
470
|
+
alias: "step",
|
|
471
|
+
required: false
|
|
472
|
+
}]
|
|
473
|
+
}],
|
|
474
|
+
limit: [{
|
|
475
|
+
type: i0.Input,
|
|
476
|
+
args: [{
|
|
477
|
+
isSignal: true,
|
|
478
|
+
alias: "limit",
|
|
479
|
+
required: false
|
|
480
|
+
}]
|
|
481
|
+
}],
|
|
482
|
+
size: [{
|
|
483
|
+
type: i0.Input,
|
|
484
|
+
args: [{
|
|
485
|
+
isSignal: true,
|
|
486
|
+
alias: "size",
|
|
487
|
+
required: false
|
|
488
|
+
}]
|
|
489
|
+
}],
|
|
490
|
+
strokeWidth: [{
|
|
491
|
+
type: i0.Input,
|
|
492
|
+
args: [{
|
|
493
|
+
isSignal: true,
|
|
494
|
+
alias: "strokeWidth",
|
|
495
|
+
required: false
|
|
496
|
+
}]
|
|
497
|
+
}],
|
|
498
|
+
arc: [{
|
|
499
|
+
type: i0.Input,
|
|
500
|
+
args: [{
|
|
501
|
+
isSignal: true,
|
|
502
|
+
alias: "arc",
|
|
503
|
+
required: false
|
|
504
|
+
}]
|
|
505
|
+
}],
|
|
506
|
+
showValue: [{
|
|
507
|
+
type: i0.Input,
|
|
508
|
+
args: [{
|
|
509
|
+
isSignal: true,
|
|
510
|
+
alias: "showValue",
|
|
511
|
+
required: false
|
|
512
|
+
}]
|
|
513
|
+
}],
|
|
514
|
+
showHandle: [{
|
|
515
|
+
type: i0.Input,
|
|
516
|
+
args: [{
|
|
517
|
+
isSignal: true,
|
|
518
|
+
alias: "showHandle",
|
|
519
|
+
required: false
|
|
520
|
+
}]
|
|
521
|
+
}],
|
|
522
|
+
valueTemplate: [{
|
|
523
|
+
type: i0.Input,
|
|
524
|
+
args: [{
|
|
525
|
+
isSignal: true,
|
|
526
|
+
alias: "valueTemplate",
|
|
527
|
+
required: false
|
|
528
|
+
}]
|
|
529
|
+
}],
|
|
530
|
+
invalid: [{
|
|
531
|
+
type: i0.Input,
|
|
532
|
+
args: [{
|
|
533
|
+
isSignal: true,
|
|
534
|
+
alias: "invalid",
|
|
535
|
+
required: false
|
|
536
|
+
}]
|
|
537
|
+
}],
|
|
538
|
+
disabledInput: [{
|
|
539
|
+
type: i0.Input,
|
|
540
|
+
args: [{
|
|
541
|
+
isSignal: true,
|
|
542
|
+
alias: "disabled",
|
|
543
|
+
required: false
|
|
544
|
+
}]
|
|
545
|
+
}],
|
|
546
|
+
readonly: [{
|
|
547
|
+
type: i0.Input,
|
|
548
|
+
args: [{
|
|
549
|
+
isSignal: true,
|
|
550
|
+
alias: "readonly",
|
|
551
|
+
required: false
|
|
552
|
+
}]
|
|
553
|
+
}],
|
|
554
|
+
ariaLabel: [{
|
|
555
|
+
type: i0.Input,
|
|
556
|
+
args: [{
|
|
557
|
+
isSignal: true,
|
|
558
|
+
alias: "ariaLabel",
|
|
559
|
+
required: false
|
|
560
|
+
}]
|
|
561
|
+
}],
|
|
562
|
+
ariaLabelledBy: [{
|
|
563
|
+
type: i0.Input,
|
|
564
|
+
args: [{
|
|
565
|
+
isSignal: true,
|
|
566
|
+
alias: "ariaLabelledBy",
|
|
567
|
+
required: false
|
|
568
|
+
}]
|
|
569
|
+
}],
|
|
570
|
+
tabindex: [{
|
|
571
|
+
type: i0.Input,
|
|
572
|
+
args: [{
|
|
573
|
+
isSignal: true,
|
|
574
|
+
alias: "tabindex",
|
|
575
|
+
required: false
|
|
576
|
+
}]
|
|
577
|
+
}],
|
|
578
|
+
dt: [{
|
|
579
|
+
type: i0.Input,
|
|
580
|
+
args: [{
|
|
581
|
+
isSignal: true,
|
|
582
|
+
alias: "dt",
|
|
583
|
+
required: false
|
|
584
|
+
}]
|
|
585
|
+
}],
|
|
586
|
+
pt: [{
|
|
587
|
+
type: i0.Input,
|
|
588
|
+
args: [{
|
|
589
|
+
isSignal: true,
|
|
590
|
+
alias: "pt",
|
|
591
|
+
required: false
|
|
592
|
+
}]
|
|
593
|
+
}],
|
|
594
|
+
ptOptions: [{
|
|
595
|
+
type: i0.Input,
|
|
596
|
+
args: [{
|
|
597
|
+
isSignal: true,
|
|
598
|
+
alias: "ptOptions",
|
|
599
|
+
required: false
|
|
600
|
+
}]
|
|
601
|
+
}],
|
|
602
|
+
unstyled: [{
|
|
603
|
+
type: i0.Input,
|
|
604
|
+
args: [{
|
|
605
|
+
isSignal: true,
|
|
606
|
+
alias: "unstyled",
|
|
607
|
+
required: false
|
|
608
|
+
}]
|
|
609
|
+
}],
|
|
610
|
+
changed: [{
|
|
611
|
+
type: i0.Output,
|
|
612
|
+
args: ["changed"]
|
|
613
|
+
}],
|
|
614
|
+
template: [{
|
|
615
|
+
type: i0.ContentChild,
|
|
616
|
+
args: [i0.forwardRef(() => TxKnobValueTemplate), { isSignal: true }]
|
|
617
|
+
}],
|
|
618
|
+
svg: [{
|
|
619
|
+
type: i0.ViewChild,
|
|
620
|
+
args: ["svg", { isSignal: true }]
|
|
621
|
+
}]
|
|
622
|
+
}
|
|
623
|
+
});
|
|
624
|
+
function decimals(value) {
|
|
625
|
+
const text = String(value);
|
|
626
|
+
return text.includes(".") ? text.split(".")[1].length : 0;
|
|
627
|
+
}
|
|
628
|
+
export { TxKnob, TxKnobValueTemplate };
|
|
629
|
+
|
|
630
|
+
//# sourceMappingURL=tectra-ng-ui-knob.mjs.map
|