@radix-ng/primitives 1.0.0-beta.5 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/composite/README.md +3 -0
- package/fesm2022/radix-ng-primitives-accordion.mjs +20 -44
- package/fesm2022/radix-ng-primitives-accordion.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-checkbox.mjs +134 -58
- package/fesm2022/radix-ng-primitives-checkbox.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-composite.mjs +599 -0
- package/fesm2022/radix-ng-primitives-composite.mjs.map +1 -0
- package/fesm2022/radix-ng-primitives-drawer.mjs +442 -2
- package/fesm2022/radix-ng-primitives-drawer.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-menu.mjs +315 -68
- package/fesm2022/radix-ng-primitives-menu.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-menubar.mjs +91 -36
- package/fesm2022/radix-ng-primitives-menubar.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-navigation-menu.mjs +281 -88
- package/fesm2022/radix-ng-primitives-navigation-menu.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-popover.mjs +40 -15
- package/fesm2022/radix-ng-primitives-popover.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-popper.mjs +73 -65
- package/fesm2022/radix-ng-primitives-popper.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-radio.mjs +63 -27
- package/fesm2022/radix-ng-primitives-radio.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-scroll-area.mjs +56 -25
- package/fesm2022/radix-ng-primitives-scroll-area.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-select.mjs +59 -29
- package/fesm2022/radix-ng-primitives-select.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-slider.mjs +57 -13
- package/fesm2022/radix-ng-primitives-slider.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-tabs.mjs +335 -73
- package/fesm2022/radix-ng-primitives-tabs.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-toggle-group.mjs +66 -21
- package/fesm2022/radix-ng-primitives-toggle-group.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-toggle.mjs +29 -11
- package/fesm2022/radix-ng-primitives-toggle.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-toolbar.mjs +68 -36
- package/fesm2022/radix-ng-primitives-toolbar.mjs.map +1 -1
- package/navigation-menu/README.md +5 -2
- package/package.json +6 -10
- package/types/radix-ng-primitives-accordion.d.ts +12 -16
- package/types/radix-ng-primitives-checkbox.d.ts +98 -70
- package/types/radix-ng-primitives-composite.d.ts +195 -0
- package/types/radix-ng-primitives-drawer.d.ts +40 -2
- package/types/radix-ng-primitives-menu.d.ts +46 -16
- package/types/radix-ng-primitives-menubar.d.ts +12 -5
- package/types/radix-ng-primitives-navigation-menu.d.ts +65 -33
- package/types/radix-ng-primitives-popover.d.ts +9 -5
- package/types/radix-ng-primitives-popper.d.ts +1 -0
- package/types/radix-ng-primitives-radio.d.ts +11 -9
- package/types/radix-ng-primitives-scroll-area.d.ts +4 -1
- package/types/radix-ng-primitives-select.d.ts +46 -32
- package/types/radix-ng-primitives-slider.d.ts +19 -4
- package/types/radix-ng-primitives-tabs.d.ts +69 -14
- package/types/radix-ng-primitives-toggle-group.d.ts +27 -16
- package/types/radix-ng-primitives-toggle.d.ts +5 -5
- package/types/radix-ng-primitives-toolbar.d.ts +84 -69
- package/collection/README.md +0 -1
- package/fesm2022/radix-ng-primitives-collection.mjs +0 -72
- package/fesm2022/radix-ng-primitives-collection.mjs.map +0 -1
- package/fesm2022/radix-ng-primitives-roving-focus.mjs +0 -388
- package/fesm2022/radix-ng-primitives-roving-focus.mjs.map +0 -1
- package/roving-focus/README.md +0 -3
- package/types/radix-ng-primitives-collection.d.ts +0 -44
- package/types/radix-ng-primitives-roving-focus.d.ts +0 -187
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { inject, ElementRef, DestroyRef, Directive, computed, input, numberAttribute, booleanAttribute, model, output, signal, afterNextRender, afterRenderEffect, untracked, NgModule } from '@angular/core';
|
|
2
|
+
import { inject, ElementRef, DestroyRef, Directive, computed, input, numberAttribute, booleanAttribute, model, output, signal, effect, afterNextRender, afterRenderEffect, untracked, NgModule } from '@angular/core';
|
|
3
3
|
import { DOCUMENT } from '@angular/common';
|
|
4
|
-
import * as
|
|
4
|
+
import * as i2 from '@radix-ng/primitives/core';
|
|
5
5
|
import { createContext, clamp, injectControlValueAccessor, injectDocument, injectId, createCancelableChangeEventDetails, RdxControlValueAccessor } from '@radix-ng/primitives/core';
|
|
6
6
|
export { clamp } from '@radix-ng/primitives/core';
|
|
7
|
+
import * as i1 from '@radix-ng/primitives/composite';
|
|
8
|
+
import { RdxCompositeList, RdxCompositeListItem } from '@radix-ng/primitives/composite';
|
|
7
9
|
import { injectDirection } from '@radix-ng/primitives/direction-provider';
|
|
8
10
|
|
|
9
11
|
/**
|
|
@@ -720,6 +722,7 @@ class RdxSliderRoot {
|
|
|
720
722
|
/** @ignore */
|
|
721
723
|
this.cva = injectControlValueAccessor();
|
|
722
724
|
this.document = injectDocument();
|
|
725
|
+
this.compositeList = inject(RdxCompositeList, { self: true });
|
|
723
726
|
this.id = input(injectId('rdx-slider-'), ...(ngDevMode ? [{ debugName: "id" }] : /* istanbul ignore next */ []));
|
|
724
727
|
/**
|
|
725
728
|
* The minimum value of the slider.
|
|
@@ -832,6 +835,10 @@ class RdxSliderRoot {
|
|
|
832
835
|
this.thumbs = signal([], ...(ngDevMode ? [{ debugName: "thumbs" }] : /* istanbul ignore next */ []));
|
|
833
836
|
/** Registered thumbs in DOM order. */
|
|
834
837
|
this.thumbList = this.thumbs.asReadonly();
|
|
838
|
+
/** Input ids registered by thumbs, in DOM order. */
|
|
839
|
+
this.thumbInputIds = computed(() => Array.from(this.compositeList.itemMap().values())
|
|
840
|
+
.map((metadata) => metadata['inputId'])
|
|
841
|
+
.filter((inputId) => typeof inputId === 'string' && inputId.length > 0), ...(ngDevMode ? [{ debugName: "thumbInputIds" }] : /* istanbul ignore next */ []));
|
|
835
842
|
}
|
|
836
843
|
/** @ignore */
|
|
837
844
|
registerThumb(thumb) {
|
|
@@ -954,7 +961,7 @@ class RdxSliderRoot {
|
|
|
954
961
|
return this.document.defaultView ?? undefined;
|
|
955
962
|
}
|
|
956
963
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RdxSliderRoot, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
957
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.9", type: RdxSliderRoot, isStandalone: true, selector: "div[rdxSliderRoot]", inputs: { id: { classPropertyName: "id", publicName: "id", 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 }, step: { classPropertyName: "step", publicName: "step", isSignal: true, isRequired: false, transformFunction: null }, largeStep: { classPropertyName: "largeStep", publicName: "largeStep", isSignal: true, isRequired: false, transformFunction: null }, minStepsBetweenValues: { classPropertyName: "minStepsBetweenValues", publicName: "minStepsBetweenValues", isSignal: true, isRequired: false, transformFunction: null }, orientation: { classPropertyName: "orientation", publicName: "orientation", isSignal: true, isRequired: false, transformFunction: null }, dirInput: { classPropertyName: "dirInput", publicName: "dir", isSignal: true, isRequired: false, transformFunction: null }, thumbCollisionBehavior: { classPropertyName: "thumbCollisionBehavior", publicName: "thumbCollisionBehavior", isSignal: true, isRequired: false, transformFunction: null }, thumbAlignment: { classPropertyName: "thumbAlignment", publicName: "thumbAlignment", isSignal: true, isRequired: false, transformFunction: null }, format: { classPropertyName: "format", publicName: "format", isSignal: true, isRequired: false, transformFunction: null }, locale: { classPropertyName: "locale", publicName: "locale", isSignal: true, isRequired: false, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null }, form: { classPropertyName: "form", publicName: "form", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, defaultValue: { classPropertyName: "defaultValue", publicName: "defaultValue", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, ariaLabelledBy: { classPropertyName: "ariaLabelledBy", publicName: "aria-labelledby", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange", onValueChange: "onValueChange", onValueCommitted: "onValueCommitted" }, host: { attributes: { "role": "group" }, properties: { "id": "id()", "attr.aria-labelledby": "ariaLabelledBy()", "attr.dir": "dir()", "attr.data-orientation": "orientation()", "attr.data-disabled": "isDisabled() ? \"\" : undefined", "attr.data-dragging": "dragging() ? \"\" : undefined" } }, providers: [provideSliderRootContext(() => inject(RdxSliderRoot))], exportAs: ["rdxSliderRoot"], hostDirectives: [{ directive: i1.RdxControlValueAccessor, inputs: ["value", "value", "disabled", "disabled"] }], ngImport: i0 }); }
|
|
964
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.9", type: RdxSliderRoot, isStandalone: true, selector: "div[rdxSliderRoot]", inputs: { id: { classPropertyName: "id", publicName: "id", 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 }, step: { classPropertyName: "step", publicName: "step", isSignal: true, isRequired: false, transformFunction: null }, largeStep: { classPropertyName: "largeStep", publicName: "largeStep", isSignal: true, isRequired: false, transformFunction: null }, minStepsBetweenValues: { classPropertyName: "minStepsBetweenValues", publicName: "minStepsBetweenValues", isSignal: true, isRequired: false, transformFunction: null }, orientation: { classPropertyName: "orientation", publicName: "orientation", isSignal: true, isRequired: false, transformFunction: null }, dirInput: { classPropertyName: "dirInput", publicName: "dir", isSignal: true, isRequired: false, transformFunction: null }, thumbCollisionBehavior: { classPropertyName: "thumbCollisionBehavior", publicName: "thumbCollisionBehavior", isSignal: true, isRequired: false, transformFunction: null }, thumbAlignment: { classPropertyName: "thumbAlignment", publicName: "thumbAlignment", isSignal: true, isRequired: false, transformFunction: null }, format: { classPropertyName: "format", publicName: "format", isSignal: true, isRequired: false, transformFunction: null }, locale: { classPropertyName: "locale", publicName: "locale", isSignal: true, isRequired: false, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null }, form: { classPropertyName: "form", publicName: "form", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, defaultValue: { classPropertyName: "defaultValue", publicName: "defaultValue", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, ariaLabelledBy: { classPropertyName: "ariaLabelledBy", publicName: "aria-labelledby", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange", onValueChange: "onValueChange", onValueCommitted: "onValueCommitted" }, host: { attributes: { "role": "group" }, properties: { "id": "id()", "attr.aria-labelledby": "ariaLabelledBy()", "attr.dir": "dir()", "attr.data-orientation": "orientation()", "attr.data-disabled": "isDisabled() ? \"\" : undefined", "attr.data-dragging": "dragging() ? \"\" : undefined" } }, providers: [provideSliderRootContext(() => inject(RdxSliderRoot))], exportAs: ["rdxSliderRoot"], hostDirectives: [{ directive: i1.RdxCompositeList }, { directive: i2.RdxControlValueAccessor, inputs: ["value", "value", "disabled", "disabled"] }], ngImport: i0 }); }
|
|
958
965
|
}
|
|
959
966
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RdxSliderRoot, decorators: [{
|
|
960
967
|
type: Directive,
|
|
@@ -963,6 +970,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
|
|
|
963
970
|
exportAs: 'rdxSliderRoot',
|
|
964
971
|
providers: [provideSliderRootContext(() => inject(RdxSliderRoot))],
|
|
965
972
|
hostDirectives: [
|
|
973
|
+
RdxCompositeList,
|
|
966
974
|
{
|
|
967
975
|
directive: RdxControlValueAccessor,
|
|
968
976
|
inputs: ['value: value', 'disabled']
|
|
@@ -989,16 +997,28 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
|
|
|
989
997
|
class RdxSliderThumb {
|
|
990
998
|
constructor() {
|
|
991
999
|
this.root = injectSliderRootContext();
|
|
1000
|
+
this.listItem = inject(RdxCompositeListItem, { self: true });
|
|
992
1001
|
this.element = inject(ElementRef).nativeElement;
|
|
993
1002
|
/** The nested range input, set by `[rdxSliderThumbInput]`. */
|
|
994
1003
|
this.inputElement = null;
|
|
1004
|
+
this.inputId = signal(undefined, ...(ngDevMode ? [{ debugName: "inputId" }] : /* istanbul ignore next */ []));
|
|
995
1005
|
/** Explicit index for this thumb (required for SSR range sliders). */
|
|
996
1006
|
this.indexInput = input(undefined, { ...(ngDevMode ? { debugName: "indexInput" } : /* istanbul ignore next */ {}), alias: 'index',
|
|
997
1007
|
transform: (v) => (v == null ? undefined : numberAttribute(v)) });
|
|
998
1008
|
/** Disables this individual thumb. */
|
|
999
1009
|
this.thumbDisabled = input(false, { ...(ngDevMode ? { debugName: "thumbDisabled" } : /* istanbul ignore next */ {}), alias: 'disabled', transform: booleanAttribute });
|
|
1000
1010
|
/** The position of this thumb among its siblings. */
|
|
1001
|
-
this.index = computed(() =>
|
|
1011
|
+
this.index = computed(() => {
|
|
1012
|
+
if (!this.root.range()) {
|
|
1013
|
+
return 0;
|
|
1014
|
+
}
|
|
1015
|
+
const explicitIndex = this.indexInput();
|
|
1016
|
+
if (explicitIndex !== undefined) {
|
|
1017
|
+
return explicitIndex;
|
|
1018
|
+
}
|
|
1019
|
+
const compositeIndex = this.listItem.index();
|
|
1020
|
+
return compositeIndex === -1 ? this.root.thumbIndexOf(this) : compositeIndex;
|
|
1021
|
+
}, ...(ngDevMode ? [{ debugName: "index" }] : /* istanbul ignore next */ []));
|
|
1002
1022
|
/** Whether this thumb is disabled (own state OR root disabled). */
|
|
1003
1023
|
this.disabled = computed(() => this.thumbDisabled() || this.root.isDisabled(), ...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
|
|
1004
1024
|
/** The value represented by this thumb. */
|
|
@@ -1046,6 +1066,11 @@ class RdxSliderThumb {
|
|
|
1046
1066
|
}
|
|
1047
1067
|
return style;
|
|
1048
1068
|
}, ...(ngDevMode ? [{ debugName: "thumbStyle" }] : /* istanbul ignore next */ []));
|
|
1069
|
+
effect(() => {
|
|
1070
|
+
this.listItem.setMetadata({
|
|
1071
|
+
inputId: this.inputId()
|
|
1072
|
+
});
|
|
1073
|
+
});
|
|
1049
1074
|
// Registration is DOM-order sorted on the root and reads no inputs, so the constructor
|
|
1050
1075
|
// (where the host element already exists) is the right place; cleanup goes via DestroyRef.
|
|
1051
1076
|
this.root.registerThumb(this);
|
|
@@ -1103,14 +1128,28 @@ class RdxSliderThumb {
|
|
|
1103
1128
|
this.root.pressedInput = this.inputElement;
|
|
1104
1129
|
}
|
|
1105
1130
|
}
|
|
1131
|
+
/** @ignore */
|
|
1132
|
+
setInputElement(input, id) {
|
|
1133
|
+
this.inputElement = input;
|
|
1134
|
+
this.inputId.set(id);
|
|
1135
|
+
}
|
|
1136
|
+
/** @ignore */
|
|
1137
|
+
clearInputElement(input) {
|
|
1138
|
+
if (this.inputElement !== input) {
|
|
1139
|
+
return;
|
|
1140
|
+
}
|
|
1141
|
+
this.inputElement = null;
|
|
1142
|
+
this.inputId.set(undefined);
|
|
1143
|
+
}
|
|
1106
1144
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RdxSliderThumb, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
1107
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.9", type: RdxSliderThumb, isStandalone: true, selector: "div[rdxSliderThumb]", inputs: { indexInput: { classPropertyName: "indexInput", publicName: "index", isSignal: true, isRequired: false, transformFunction: null }, thumbDisabled: { classPropertyName: "thumbDisabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "pointerdown": "onPointerDown($event)" }, properties: { "style": "thumbStyle()", "attr.data-index": "index()", "attr.data-orientation": "root.orientation()", "attr.data-disabled": "disabled() ? \"\" : undefined", "attr.data-dragging": "root.dragging() ? \"\" : undefined" } }, exportAs: ["rdxSliderThumb"], ngImport: i0 }); }
|
|
1145
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.9", type: RdxSliderThumb, isStandalone: true, selector: "div[rdxSliderThumb]", inputs: { indexInput: { classPropertyName: "indexInput", publicName: "index", isSignal: true, isRequired: false, transformFunction: null }, thumbDisabled: { classPropertyName: "thumbDisabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "pointerdown": "onPointerDown($event)" }, properties: { "style": "thumbStyle()", "attr.data-index": "index()", "attr.data-orientation": "root.orientation()", "attr.data-disabled": "disabled() ? \"\" : undefined", "attr.data-dragging": "root.dragging() ? \"\" : undefined" } }, exportAs: ["rdxSliderThumb"], hostDirectives: [{ directive: i1.RdxCompositeListItem }], ngImport: i0 }); }
|
|
1108
1146
|
}
|
|
1109
1147
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RdxSliderThumb, decorators: [{
|
|
1110
1148
|
type: Directive,
|
|
1111
1149
|
args: [{
|
|
1112
1150
|
selector: 'div[rdxSliderThumb]',
|
|
1113
1151
|
exportAs: 'rdxSliderThumb',
|
|
1152
|
+
hostDirectives: [RdxCompositeListItem],
|
|
1114
1153
|
host: {
|
|
1115
1154
|
'[style]': 'thumbStyle()',
|
|
1116
1155
|
'[attr.data-index]': 'index()',
|
|
@@ -1134,18 +1173,17 @@ class RdxSliderThumbInput {
|
|
|
1134
1173
|
this.root = injectSliderRootContext();
|
|
1135
1174
|
this.thumb = inject(RdxSliderThumb);
|
|
1136
1175
|
this.element = inject(ElementRef).nativeElement;
|
|
1176
|
+
this.id = input(injectId('rdx-slider-thumb-input-'), ...(ngDevMode ? [{ debugName: "id" }] : /* istanbul ignore next */ []));
|
|
1137
1177
|
this.ariaLabel = input(undefined, { ...(ngDevMode ? { debugName: "ariaLabel" } : /* istanbul ignore next */ {}), alias: 'aria-label' });
|
|
1138
1178
|
this.ariaValueTextInput = input(undefined, { ...(ngDevMode ? { debugName: "ariaValueTextInput" } : /* istanbul ignore next */ {}), alias: 'aria-valuetext' });
|
|
1139
1179
|
this.writingMode = computed(() => this.root.orientation() === 'vertical' ? (this.root.dir() === 'rtl' ? 'vertical-rl' : 'vertical-lr') : undefined, ...(ngDevMode ? [{ debugName: "writingMode" }] : /* istanbul ignore next */ []));
|
|
1140
1180
|
this.ariaLabelledBy = computed(() => this.ariaLabel() == null ? this.root.ariaLabelledBy() : undefined, ...(ngDevMode ? [{ debugName: "ariaLabelledBy" }] : /* istanbul ignore next */ []));
|
|
1141
1181
|
this.valueText = computed(() => this.ariaValueTextInput() ??
|
|
1142
1182
|
getDefaultAriaValueText(this.root.values(), this.thumb.index(), this.root.format(), this.root.locale()), ...(ngDevMode ? [{ debugName: "valueText" }] : /* istanbul ignore next */ []));
|
|
1143
|
-
// Host element exists in the constructor
|
|
1144
|
-
this.thumb.
|
|
1183
|
+
// Host element exists in the constructor; the id may be user-provided and can update.
|
|
1184
|
+
effect(() => this.thumb.setInputElement(this.element, this.id()));
|
|
1145
1185
|
inject(DestroyRef).onDestroy(() => {
|
|
1146
|
-
|
|
1147
|
-
this.thumb.inputElement = null;
|
|
1148
|
-
}
|
|
1186
|
+
this.thumb.clearInputElement(this.element);
|
|
1149
1187
|
});
|
|
1150
1188
|
}
|
|
1151
1189
|
onChange(event) {
|
|
@@ -1219,7 +1257,7 @@ class RdxSliderThumbInput {
|
|
|
1219
1257
|
}
|
|
1220
1258
|
}
|
|
1221
1259
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RdxSliderThumbInput, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
1222
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.9", type: RdxSliderThumbInput, isStandalone: true, selector: "input[rdxSliderThumbInput]", inputs: { ariaLabel: { classPropertyName: "ariaLabel", publicName: "aria-label", isSignal: true, isRequired: false, transformFunction: null }, ariaValueTextInput: { classPropertyName: "ariaValueTextInput", publicName: "aria-valuetext", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "type": "range" }, listeners: { "keydown": "onKeyDown($event)", "change": "onChange($event)", "focus": "onFocus()", "blur": "onBlur()" }, properties: { "style.writing-mode": "writingMode()", "attr.min": "root.min()", "attr.max": "root.max()", "attr.step": "root.step()", "value": "thumb.value() ?? \"\"", "disabled": "thumb.disabled()", "attr.name": "root.name()", "attr.form": "root.form()", "attr.aria-orientation": "root.orientation()", "attr.aria-valuenow": "thumb.value()", "attr.aria-valuetext": "valueText()", "attr.aria-label": "ariaLabel()", "attr.aria-labelledby": "ariaLabelledBy()", "attr.data-index": "thumb.index()" }, styleAttribute: "position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; padding: 0; opacity: 0; cursor: inherit;" }, exportAs: ["rdxSliderThumbInput"], ngImport: i0 }); }
|
|
1260
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.9", type: RdxSliderThumbInput, isStandalone: true, selector: "input[rdxSliderThumbInput]", inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "aria-label", isSignal: true, isRequired: false, transformFunction: null }, ariaValueTextInput: { classPropertyName: "ariaValueTextInput", publicName: "aria-valuetext", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "type": "range" }, listeners: { "keydown": "onKeyDown($event)", "change": "onChange($event)", "focus": "onFocus()", "blur": "onBlur()" }, properties: { "id": "id()", "style.writing-mode": "writingMode()", "attr.min": "root.min()", "attr.max": "root.max()", "attr.step": "root.step()", "value": "thumb.value() ?? \"\"", "disabled": "thumb.disabled()", "attr.name": "root.name()", "attr.form": "root.form()", "attr.aria-orientation": "root.orientation()", "attr.aria-valuenow": "thumb.value()", "attr.aria-valuetext": "valueText()", "attr.aria-label": "ariaLabel()", "attr.aria-labelledby": "ariaLabelledBy()", "attr.data-index": "thumb.index()" }, styleAttribute: "position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; padding: 0; opacity: 0; cursor: inherit;" }, exportAs: ["rdxSliderThumbInput"], ngImport: i0 }); }
|
|
1223
1261
|
}
|
|
1224
1262
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RdxSliderThumbInput, decorators: [{
|
|
1225
1263
|
type: Directive,
|
|
@@ -1229,6 +1267,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
|
|
|
1229
1267
|
host: {
|
|
1230
1268
|
type: 'range',
|
|
1231
1269
|
style: 'position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; padding: 0; opacity: 0; cursor: inherit;',
|
|
1270
|
+
'[id]': 'id()',
|
|
1232
1271
|
'[style.writing-mode]': 'writingMode()',
|
|
1233
1272
|
'[attr.min]': 'root.min()',
|
|
1234
1273
|
'[attr.max]': 'root.max()',
|
|
@@ -1249,7 +1288,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
|
|
|
1249
1288
|
'(blur)': 'onBlur()'
|
|
1250
1289
|
}
|
|
1251
1290
|
}]
|
|
1252
|
-
}], ctorParameters: () => [], propDecorators: { ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-label", required: false }] }], ariaValueTextInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-valuetext", required: false }] }] } });
|
|
1291
|
+
}], ctorParameters: () => [], propDecorators: { id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-label", required: false }] }], ariaValueTextInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-valuetext", required: false }] }] } });
|
|
1253
1292
|
|
|
1254
1293
|
/**
|
|
1255
1294
|
* The track of the slider — the positioning context for the indicator and thumbs.
|
|
@@ -1288,13 +1327,17 @@ class RdxSliderValue {
|
|
|
1288
1327
|
this.root = injectSliderRootContext();
|
|
1289
1328
|
/** The separator placed between values of a range slider. */
|
|
1290
1329
|
this.separator = input(' – ', ...(ngDevMode ? [{ debugName: "separator" }] : /* istanbul ignore next */ []));
|
|
1330
|
+
this.forAttr = computed(() => {
|
|
1331
|
+
const inputIds = this.root.thumbInputIds();
|
|
1332
|
+
return inputIds.length > 0 ? inputIds.join(' ') : undefined;
|
|
1333
|
+
}, ...(ngDevMode ? [{ debugName: "forAttr" }] : /* istanbul ignore next */ []));
|
|
1291
1334
|
this.display = computed(() => this.root
|
|
1292
1335
|
.values()
|
|
1293
1336
|
.map((value) => this.root.formatValue(value) || `${value}`)
|
|
1294
1337
|
.join(this.separator()), ...(ngDevMode ? [{ debugName: "display" }] : /* istanbul ignore next */ []));
|
|
1295
1338
|
}
|
|
1296
1339
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RdxSliderValue, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
1297
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.9", type: RdxSliderValue, isStandalone: true, selector: "output[rdxSliderValue]", inputs: { separator: { classPropertyName: "separator", publicName: "separator", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "aria-live": "off" }, properties: { "textContent": "display()" } }, exportAs: ["rdxSliderValue"], ngImport: i0 }); }
|
|
1340
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.9", type: RdxSliderValue, isStandalone: true, selector: "output[rdxSliderValue]", inputs: { separator: { classPropertyName: "separator", publicName: "separator", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "aria-live": "off" }, properties: { "attr.for": "forAttr()", "textContent": "display()" } }, exportAs: ["rdxSliderValue"], ngImport: i0 }); }
|
|
1298
1341
|
}
|
|
1299
1342
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RdxSliderValue, decorators: [{
|
|
1300
1343
|
type: Directive,
|
|
@@ -1303,6 +1346,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
|
|
|
1303
1346
|
exportAs: 'rdxSliderValue',
|
|
1304
1347
|
host: {
|
|
1305
1348
|
'aria-live': 'off',
|
|
1349
|
+
'[attr.for]': 'forAttr()',
|
|
1306
1350
|
'[textContent]': 'display()'
|
|
1307
1351
|
}
|
|
1308
1352
|
}]
|