@radix-ng/primitives 0.50.0 → 0.51.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/collection/README.md +1 -0
- package/fesm2022/radix-ng-primitives-accordion.mjs +41 -40
- package/fesm2022/radix-ng-primitives-accordion.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-alert-dialog.mjs +22 -22
- package/fesm2022/radix-ng-primitives-alert-dialog.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-arrow.mjs +6 -6
- package/fesm2022/radix-ng-primitives-arrow.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-aspect-ratio.mjs +6 -6
- package/fesm2022/radix-ng-primitives-aspect-ratio.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-avatar.mjs +22 -22
- package/fesm2022/radix-ng-primitives-avatar.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-calendar.mjs +104 -103
- package/fesm2022/radix-ng-primitives-calendar.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-checkbox.mjs +51 -41
- package/fesm2022/radix-ng-primitives-checkbox.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-collapsible.mjs +28 -28
- package/fesm2022/radix-ng-primitives-collapsible.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-collection.mjs +89 -0
- package/fesm2022/radix-ng-primitives-collection.mjs.map +1 -0
- package/fesm2022/radix-ng-primitives-config.mjs +5 -5
- package/fesm2022/radix-ng-primitives-config.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-context-menu.mjs +36 -36
- package/fesm2022/radix-ng-primitives-context-menu.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-core.mjs +33 -24
- package/fesm2022/radix-ng-primitives-core.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-cropper.mjs +54 -53
- package/fesm2022/radix-ng-primitives-cropper.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-date-field.mjs +48 -47
- package/fesm2022/radix-ng-primitives-date-field.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-dialog.mjs +34 -34
- package/fesm2022/radix-ng-primitives-dialog.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-dismissable-layer.mjs +31 -33
- package/fesm2022/radix-ng-primitives-dismissable-layer.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-dropdown-menu.mjs +41 -43
- package/fesm2022/radix-ng-primitives-dropdown-menu.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-editable.mjs +20 -20
- package/fesm2022/radix-ng-primitives-editable.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-focus-guards.mjs +3 -3
- package/fesm2022/radix-ng-primitives-focus-guards.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-focus-scope.mjs +7 -7
- package/fesm2022/radix-ng-primitives-focus-scope.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-hover-card.mjs +69 -77
- package/fesm2022/radix-ng-primitives-hover-card.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-label.mjs +7 -7
- package/fesm2022/radix-ng-primitives-label.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-menu.mjs +65 -70
- package/fesm2022/radix-ng-primitives-menu.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-menubar.mjs +31 -31
- package/fesm2022/radix-ng-primitives-menubar.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-navigation-menu.mjs +113 -105
- package/fesm2022/radix-ng-primitives-navigation-menu.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-number-field.mjs +48 -47
- package/fesm2022/radix-ng-primitives-number-field.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-pagination.mjs +51 -51
- package/fesm2022/radix-ng-primitives-pagination.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-popover.mjs +67 -71
- package/fesm2022/radix-ng-primitives-popover.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-popper.mjs +61 -56
- package/fesm2022/radix-ng-primitives-popper.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-portal.mjs +7 -7
- package/fesm2022/radix-ng-primitives-portal.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-presence.mjs +4 -4
- package/fesm2022/radix-ng-primitives-presence.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-progress.mjs +16 -16
- package/fesm2022/radix-ng-primitives-progress.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-radio.mjs +38 -37
- package/fesm2022/radix-ng-primitives-radio.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-roving-focus.mjs +38 -34
- package/fesm2022/radix-ng-primitives-roving-focus.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-select.mjs +41 -43
- package/fesm2022/radix-ng-primitives-select.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-select2.mjs +897 -0
- package/fesm2022/radix-ng-primitives-select2.mjs.map +1 -0
- package/fesm2022/radix-ng-primitives-separator.mjs +11 -17
- package/fesm2022/radix-ng-primitives-separator.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-slider.mjs +88 -84
- package/fesm2022/radix-ng-primitives-slider.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-stepper.mjs +55 -53
- package/fesm2022/radix-ng-primitives-stepper.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-switch.mjs +22 -30
- package/fesm2022/radix-ng-primitives-switch.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-tabs.mjs +38 -38
- package/fesm2022/radix-ng-primitives-tabs.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-time-field.mjs +63 -78
- package/fesm2022/radix-ng-primitives-time-field.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-toggle-group.mjs +24 -24
- package/fesm2022/radix-ng-primitives-toggle-group.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-toggle.mjs +11 -11
- package/fesm2022/radix-ng-primitives-toggle.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-toolbar.mjs +31 -29
- package/fesm2022/radix-ng-primitives-toolbar.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-tooltip.mjs +69 -77
- package/fesm2022/radix-ng-primitives-tooltip.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-tooltip2.mjs +57 -62
- package/fesm2022/radix-ng-primitives-tooltip2.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-visually-hidden.mjs +31 -31
- package/fesm2022/radix-ng-primitives-visually-hidden.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives.mjs.map +1 -1
- package/package.json +63 -54
- package/select2/README.md +3 -0
- package/{accordion/index.d.ts → types/radix-ng-primitives-accordion.d.ts} +61 -60
- package/{calendar/index.d.ts → types/radix-ng-primitives-calendar.d.ts} +1 -1
- package/{checkbox/index.d.ts → types/radix-ng-primitives-checkbox.d.ts} +31 -27
- package/{collapsible/index.d.ts → types/radix-ng-primitives-collapsible.d.ts} +20 -19
- package/types/radix-ng-primitives-collection.d.ts +40 -0
- package/{core/index.d.ts → types/radix-ng-primitives-core.d.ts} +6 -2
- package/{cropper/index.d.ts → types/radix-ng-primitives-cropper.d.ts} +4 -3
- package/{date-field/index.d.ts → types/radix-ng-primitives-date-field.d.ts} +4 -4
- package/{dialog/index.d.ts → types/radix-ng-primitives-dialog.d.ts} +2 -1
- package/{hover-card/index.d.ts → types/radix-ng-primitives-hover-card.d.ts} +3 -4
- package/{menu/index.d.ts → types/radix-ng-primitives-menu.d.ts} +1 -1
- package/{navigation-menu/index.d.ts → types/radix-ng-primitives-navigation-menu.d.ts} +47 -46
- package/{number-field/index.d.ts → types/radix-ng-primitives-number-field.d.ts} +13 -12
- package/{popover/index.d.ts → types/radix-ng-primitives-popover.d.ts} +3 -4
- package/{popper/index.d.ts → types/radix-ng-primitives-popper.d.ts} +1 -0
- package/{progress/index.d.ts → types/radix-ng-primitives-progress.d.ts} +2 -1
- package/{radio/index.d.ts → types/radix-ng-primitives-radio.d.ts} +1 -1
- package/{roving-focus/index.d.ts → types/radix-ng-primitives-roving-focus.d.ts} +8 -6
- package/types/radix-ng-primitives-select2.d.ts +511 -0
- package/{slider/index.d.ts → types/radix-ng-primitives-slider.d.ts} +4 -4
- package/{stepper/index.d.ts → types/radix-ng-primitives-stepper.d.ts} +17 -16
- package/{switch/index.d.ts → types/radix-ng-primitives-switch.d.ts} +3 -2
- package/{tabs/index.d.ts → types/radix-ng-primitives-tabs.d.ts} +7 -6
- package/{time-field/index.d.ts → types/radix-ng-primitives-time-field.d.ts} +4 -4
- package/{toggle-group/index.d.ts → types/radix-ng-primitives-toggle-group.d.ts} +12 -11
- package/{tooltip/index.d.ts → types/radix-ng-primitives-tooltip.d.ts} +3 -4
- package/{tooltip2/index.d.ts → types/radix-ng-primitives-tooltip2.d.ts} +4 -4
- /package/{alert-dialog/index.d.ts → types/radix-ng-primitives-alert-dialog.d.ts} +0 -0
- /package/{arrow/index.d.ts → types/radix-ng-primitives-arrow.d.ts} +0 -0
- /package/{aspect-ratio/index.d.ts → types/radix-ng-primitives-aspect-ratio.d.ts} +0 -0
- /package/{avatar/index.d.ts → types/radix-ng-primitives-avatar.d.ts} +0 -0
- /package/{config/index.d.ts → types/radix-ng-primitives-config.d.ts} +0 -0
- /package/{context-menu/index.d.ts → types/radix-ng-primitives-context-menu.d.ts} +0 -0
- /package/{dismissable-layer/index.d.ts → types/radix-ng-primitives-dismissable-layer.d.ts} +0 -0
- /package/{dropdown-menu/index.d.ts → types/radix-ng-primitives-dropdown-menu.d.ts} +0 -0
- /package/{editable/index.d.ts → types/radix-ng-primitives-editable.d.ts} +0 -0
- /package/{focus-guards/index.d.ts → types/radix-ng-primitives-focus-guards.d.ts} +0 -0
- /package/{focus-scope/index.d.ts → types/radix-ng-primitives-focus-scope.d.ts} +0 -0
- /package/{label/index.d.ts → types/radix-ng-primitives-label.d.ts} +0 -0
- /package/{menubar/index.d.ts → types/radix-ng-primitives-menubar.d.ts} +0 -0
- /package/{pagination/index.d.ts → types/radix-ng-primitives-pagination.d.ts} +0 -0
- /package/{portal/index.d.ts → types/radix-ng-primitives-portal.d.ts} +0 -0
- /package/{presence/index.d.ts → types/radix-ng-primitives-presence.d.ts} +0 -0
- /package/{select/index.d.ts → types/radix-ng-primitives-select.d.ts} +0 -0
- /package/{separator/index.d.ts → types/radix-ng-primitives-separator.d.ts} +0 -0
- /package/{toggle/index.d.ts → types/radix-ng-primitives-toggle.d.ts} +0 -0
- /package/{toolbar/index.d.ts → types/radix-ng-primitives-toolbar.d.ts} +0 -0
- /package/{visually-hidden/index.d.ts → types/radix-ng-primitives-visually-hidden.d.ts} +0 -0
- /package/{index.d.ts → types/radix-ng-primitives.d.ts} +0 -0
|
@@ -15,9 +15,9 @@ class PressedHoldService {
|
|
|
15
15
|
this.destroyRef = inject(DestroyRef);
|
|
16
16
|
}
|
|
17
17
|
create(options) {
|
|
18
|
-
const timeout = signal(undefined, ...(ngDevMode ? [{ debugName: "timeout" }] : []));
|
|
18
|
+
const timeout = signal(undefined, ...(ngDevMode ? [{ debugName: "timeout" }] : /* istanbul ignore next */ []));
|
|
19
19
|
const triggerHook = new Subject();
|
|
20
|
-
const isPressed = signal(false, ...(ngDevMode ? [{ debugName: "isPressed" }] : []));
|
|
20
|
+
const isPressed = signal(false, ...(ngDevMode ? [{ debugName: "isPressed" }] : /* istanbul ignore next */ []));
|
|
21
21
|
const resetTimeout = () => {
|
|
22
22
|
const timer = timeout();
|
|
23
23
|
if (timer !== undefined) {
|
|
@@ -74,10 +74,10 @@ class PressedHoldService {
|
|
|
74
74
|
}
|
|
75
75
|
};
|
|
76
76
|
}
|
|
77
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
78
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
77
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: PressedHoldService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
78
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: PressedHoldService }); }
|
|
79
79
|
}
|
|
80
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
80
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: PressedHoldService, decorators: [{
|
|
81
81
|
type: Injectable
|
|
82
82
|
}] });
|
|
83
83
|
function useNumberFormatter(locale, options = signal({})) {
|
|
@@ -111,14 +111,14 @@ class RdxNumberFieldDecrementDirective {
|
|
|
111
111
|
this.elementRef = inject((ElementRef));
|
|
112
112
|
this.pressedHold = inject(PressedHoldService);
|
|
113
113
|
this.rootContext = injectNumberFieldRootContext();
|
|
114
|
-
this.disabled = input(false, ...(ngDevMode ?
|
|
114
|
+
this.disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
115
115
|
/**
|
|
116
116
|
* @ignore
|
|
117
117
|
*/
|
|
118
118
|
this.isDisabled = computed(() => this.rootContext.disabled() ||
|
|
119
119
|
this.rootContext.readonly() ||
|
|
120
120
|
this.disabled() ||
|
|
121
|
-
this.rootContext.isDecreaseDisabled(), ...(ngDevMode ? [{ debugName: "isDisabled" }] : []));
|
|
121
|
+
this.rootContext.isDecreaseDisabled(), ...(ngDevMode ? [{ debugName: "isDisabled" }] : /* istanbul ignore next */ []));
|
|
122
122
|
/**
|
|
123
123
|
* @ignore
|
|
124
124
|
*/
|
|
@@ -130,10 +130,10 @@ class RdxNumberFieldDecrementDirective {
|
|
|
130
130
|
ngOnInit() {
|
|
131
131
|
this.useHold.onTrigger(() => this.rootContext.handleDecrease());
|
|
132
132
|
}
|
|
133
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
134
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "
|
|
133
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RdxNumberFieldDecrementDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
134
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.9", type: RdxNumberFieldDecrementDirective, isStandalone: true, selector: "button[rdxNumberFieldDecrement]", inputs: { disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "tabindex": "-1", "type": "\"button\"" }, listeners: { "contextmenu": "$event.preventDefault()" }, properties: { "attr.aria-label": "\"Decrease\"", "attr.disabled": "isDisabled() ? \"\" : undefined", "attr.data-disabled": "isDisabled() ? \"\" : undefined", "attr.data-pressed": "useHold.isPressed() ? \"true\" : undefined", "style.user-select": "useHold.isPressed() ? \"none\" : null" } }, providers: [PressedHoldService], ngImport: i0 }); }
|
|
135
135
|
}
|
|
136
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
136
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RdxNumberFieldDecrementDirective, decorators: [{
|
|
137
137
|
type: Directive,
|
|
138
138
|
args: [{
|
|
139
139
|
selector: 'button[rdxNumberFieldDecrement]',
|
|
@@ -149,21 +149,21 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.3", ngImpor
|
|
|
149
149
|
'(contextmenu)': '$event.preventDefault()'
|
|
150
150
|
}
|
|
151
151
|
}]
|
|
152
|
-
}] });
|
|
152
|
+
}], propDecorators: { disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }] } });
|
|
153
153
|
|
|
154
154
|
class RdxNumberFieldIncrementDirective {
|
|
155
155
|
constructor() {
|
|
156
156
|
this.elementRef = inject((ElementRef));
|
|
157
157
|
this.pressedHold = inject(PressedHoldService);
|
|
158
158
|
this.rootContext = injectNumberFieldRootContext();
|
|
159
|
-
this.disabled = input(false, ...(ngDevMode ?
|
|
159
|
+
this.disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
160
160
|
/**
|
|
161
161
|
* @ignore
|
|
162
162
|
*/
|
|
163
163
|
this.isDisabled = computed(() => this.rootContext.disabled() ||
|
|
164
164
|
this.rootContext.readonly() ||
|
|
165
165
|
this.disabled() ||
|
|
166
|
-
this.rootContext.isIncreaseDisabled(), ...(ngDevMode ? [{ debugName: "isDisabled" }] : []));
|
|
166
|
+
this.rootContext.isIncreaseDisabled(), ...(ngDevMode ? [{ debugName: "isDisabled" }] : /* istanbul ignore next */ []));
|
|
167
167
|
/**
|
|
168
168
|
* @ignore
|
|
169
169
|
*/
|
|
@@ -175,10 +175,10 @@ class RdxNumberFieldIncrementDirective {
|
|
|
175
175
|
ngOnInit() {
|
|
176
176
|
this.useHold.onTrigger(() => this.rootContext.handleIncrease());
|
|
177
177
|
}
|
|
178
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
179
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "
|
|
178
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RdxNumberFieldIncrementDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
179
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.9", type: RdxNumberFieldIncrementDirective, isStandalone: true, selector: "button[rdxNumberFieldIncrement]", inputs: { disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "tabindex": "-1", "type": "\"button\"" }, listeners: { "contextmenu": "$event.preventDefault()" }, properties: { "attr.aria-label": "\"Increase\"", "attr.disabled": "isDisabled() ? \"\" : undefined", "attr.data-disabled": "isDisabled() ? \"\" : undefined", "attr.data-pressed": "useHold.isPressed() ? \"true\" : undefined", "style.user-select": "useHold.isPressed() ? \"none\" : null" } }, providers: [PressedHoldService], ngImport: i0 }); }
|
|
180
180
|
}
|
|
181
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
181
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RdxNumberFieldIncrementDirective, decorators: [{
|
|
182
182
|
type: Directive,
|
|
183
183
|
args: [{
|
|
184
184
|
selector: 'button[rdxNumberFieldIncrement]',
|
|
@@ -194,13 +194,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.3", ngImpor
|
|
|
194
194
|
'(contextmenu)': '$event.preventDefault()'
|
|
195
195
|
}
|
|
196
196
|
}]
|
|
197
|
-
}] });
|
|
197
|
+
}], propDecorators: { disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }] } });
|
|
198
198
|
|
|
199
199
|
class RdxNumberFieldInputDirective {
|
|
200
200
|
constructor() {
|
|
201
201
|
this.elementRef = inject((ElementRef));
|
|
202
202
|
this.rootContext = injectNumberFieldRootContext();
|
|
203
|
-
this.inputValue = signal(this.rootContext.textValue(), ...(ngDevMode ? [{ debugName: "inputValue" }] : []));
|
|
203
|
+
this.inputValue = signal(this.rootContext.textValue(), ...(ngDevMode ? [{ debugName: "inputValue" }] : /* istanbul ignore next */ []));
|
|
204
204
|
effect(() => {
|
|
205
205
|
this.inputValue.set(this.rootContext.textValue());
|
|
206
206
|
this.rootContext.setInputValue(this.inputValue());
|
|
@@ -210,12 +210,13 @@ class RdxNumberFieldInputDirective {
|
|
|
210
210
|
this.rootContext.onInputElement(this.elementRef.nativeElement);
|
|
211
211
|
}
|
|
212
212
|
onBeforeInput(event) {
|
|
213
|
-
const
|
|
213
|
+
const inputEvent = event;
|
|
214
|
+
const target = inputEvent.target;
|
|
214
215
|
const nextValue = target.value.slice(0, target.selectionStart ?? undefined) +
|
|
215
|
-
(
|
|
216
|
+
(inputEvent.data ?? '') +
|
|
216
217
|
target.value.slice(target.selectionEnd ?? undefined);
|
|
217
218
|
if (!this.rootContext.validate(nextValue)) {
|
|
218
|
-
|
|
219
|
+
inputEvent.preventDefault();
|
|
219
220
|
}
|
|
220
221
|
}
|
|
221
222
|
onWheelEvent(event) {
|
|
@@ -275,10 +276,10 @@ class RdxNumberFieldInputDirective {
|
|
|
275
276
|
event.preventDefault();
|
|
276
277
|
this.rootContext.handleDecrease();
|
|
277
278
|
}
|
|
278
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
279
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "
|
|
279
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RdxNumberFieldInputDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
280
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.9", type: RdxNumberFieldInputDirective, isStandalone: true, selector: "input[rdxNumberFieldInput]", host: { attributes: { "role": "spinbutton", "type": "text", "tabindex": "0", "autocomplete": "off", "autocorrect": "off", "spellcheck": "false", "aria-roledescription": "Number field" }, listeners: { "change": "onChange()", "input": "onInput($event)", "blur": "onKeydownEnter($event)", "beforeinput": "onBeforeInput($event)", "keydown.enter": "onKeydownEnter($event)", "keydown.arrowUp": "onKeydownUp($event)", "keydown.arrowDown": "onKeydownDown($event)", "keydown.home": "onKeydownHome($event)", "keydown.end": "onKeydownEnd($event)", "keydown.pageUp": "onKeydownPageUp($event)", "keydown.pageDown": "onKeydownPageDown($event)", "wheel": "onWheelEvent($event)" }, properties: { "attr.aria-valuenow": "rootContext.value()", "attr.aria-valuemin": "rootContext.min()", "attr.aria-valuemax": "rootContext.max()", "attr.inputmode": "rootContext.inputMode()", "attr.disabled": "rootContext.disabled() ? \"\" : undefined", "attr.data-disabled": "rootContext.disabled() ? \"\" : undefined", "attr.readonly": "rootContext.readonly() ? \"\" : undefined", "attr.data-readonly": "rootContext.readonly() ? \"\" : undefined", "attr.value": "inputValue()" } }, ngImport: i0 }); }
|
|
280
281
|
}
|
|
281
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
282
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RdxNumberFieldInputDirective, decorators: [{
|
|
282
283
|
type: Directive,
|
|
283
284
|
args: [{
|
|
284
285
|
selector: 'input[rdxNumberFieldInput]',
|
|
@@ -317,37 +318,37 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.3", ngImpor
|
|
|
317
318
|
|
|
318
319
|
class RdxNumberFieldRootDirective {
|
|
319
320
|
constructor() {
|
|
320
|
-
this.value = model(...(ngDevMode ? [undefined, { debugName: "value" }] : []));
|
|
321
|
-
this.min = input(undefined, ...(ngDevMode ?
|
|
322
|
-
this.max = input(undefined, ...(ngDevMode ?
|
|
323
|
-
this.step = input(1, ...(ngDevMode ?
|
|
324
|
-
this.stepSnapping = input(false, ...(ngDevMode ?
|
|
325
|
-
this.disableWheelChange = input(false, ...(ngDevMode ?
|
|
326
|
-
this.locale = input('en', ...(ngDevMode ? [{ debugName: "locale" }] : []));
|
|
327
|
-
this.disabled = input(false, ...(ngDevMode ?
|
|
328
|
-
this.formatOptions = input(...(ngDevMode ? [undefined, { debugName: "formatOptions" }] : []));
|
|
321
|
+
this.value = model(...(ngDevMode ? [undefined, { debugName: "value" }] : /* istanbul ignore next */ []));
|
|
322
|
+
this.min = input(undefined, { ...(ngDevMode ? { debugName: "min" } : /* istanbul ignore next */ {}), transform: numberAttribute });
|
|
323
|
+
this.max = input(undefined, { ...(ngDevMode ? { debugName: "max" } : /* istanbul ignore next */ {}), transform: numberAttribute });
|
|
324
|
+
this.step = input(1, { ...(ngDevMode ? { debugName: "step" } : /* istanbul ignore next */ {}), transform: numberAttribute });
|
|
325
|
+
this.stepSnapping = input(false, { ...(ngDevMode ? { debugName: "stepSnapping" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
326
|
+
this.disableWheelChange = input(false, { ...(ngDevMode ? { debugName: "disableWheelChange" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
327
|
+
this.locale = input('en', ...(ngDevMode ? [{ debugName: "locale" }] : /* istanbul ignore next */ []));
|
|
328
|
+
this.disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
329
|
+
this.formatOptions = input(...(ngDevMode ? [undefined, { debugName: "formatOptions" }] : /* istanbul ignore next */ []));
|
|
329
330
|
/**
|
|
330
331
|
* When <code>true</code>, the Number Field is read-only.
|
|
331
332
|
*/
|
|
332
|
-
this.readonly = input(false, ...(ngDevMode ?
|
|
333
|
+
this.readonly = input(false, { ...(ngDevMode ? { debugName: "readonly" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
333
334
|
/**
|
|
334
335
|
* @ignore
|
|
335
336
|
*/
|
|
336
|
-
this.inputEl = signal(undefined, ...(ngDevMode ? [{ debugName: "inputEl" }] : []));
|
|
337
|
+
this.inputEl = signal(undefined, ...(ngDevMode ? [{ debugName: "inputEl" }] : /* istanbul ignore next */ []));
|
|
337
338
|
/**
|
|
338
339
|
* @ignore
|
|
339
340
|
*/
|
|
340
341
|
this.isDecreaseDisabled = computed(() => !isNullish(this.value()) &&
|
|
341
342
|
(this.clampInputValue(this.value()) === this.min() || (this.min() && !isNaN(this.value()))
|
|
342
343
|
? handleDecimalOperation('-', this.value(), this.step()) < this.min()
|
|
343
|
-
: false), ...(ngDevMode ? [{ debugName: "isDecreaseDisabled" }] : []));
|
|
344
|
+
: false), ...(ngDevMode ? [{ debugName: "isDecreaseDisabled" }] : /* istanbul ignore next */ []));
|
|
344
345
|
/**
|
|
345
346
|
* @ignore
|
|
346
347
|
*/
|
|
347
348
|
this.isIncreaseDisabled = computed(() => !isNullish(this.value()) &&
|
|
348
349
|
(this.clampInputValue(this.value()) === this.max() || (this.min() && !isNaN(this.value()))
|
|
349
350
|
? handleDecimalOperation('+', this.value(), this.step()) > this.max()
|
|
350
|
-
: false), ...(ngDevMode ? [{ debugName: "isIncreaseDisabled" }] : []));
|
|
351
|
+
: false), ...(ngDevMode ? [{ debugName: "isIncreaseDisabled" }] : /* istanbul ignore next */ []));
|
|
351
352
|
/**
|
|
352
353
|
* @ignore
|
|
353
354
|
*/
|
|
@@ -358,13 +359,13 @@ class RdxNumberFieldRootDirective {
|
|
|
358
359
|
// and based on testing on various devices to determine what keys are available in each inputMode.
|
|
359
360
|
const hasDecimals = this.numberFormatter().resolvedOptions().maximumFractionDigits > 0;
|
|
360
361
|
return hasDecimals ? 'decimal' : 'numeric';
|
|
361
|
-
}, ...(ngDevMode ? [{ debugName: "inputMode" }] : []));
|
|
362
|
+
}, ...(ngDevMode ? [{ debugName: "inputMode" }] : /* istanbul ignore next */ []));
|
|
362
363
|
/**
|
|
363
364
|
* Replace negative textValue formatted using currencySign: 'accounting'
|
|
364
365
|
* with a textValue that can be announced using a minus sign.
|
|
365
366
|
* @ignore
|
|
366
367
|
*/
|
|
367
|
-
this.textValue = computed(() => isNullish(this.value()) || isNaN(this.value()) ? '' : this.textValueFormatter().format(this.value()), ...(ngDevMode ? [{ debugName: "textValue" }] : []));
|
|
368
|
+
this.textValue = computed(() => isNullish(this.value()) || isNaN(this.value()) ? '' : this.textValueFormatter().format(this.value()), ...(ngDevMode ? [{ debugName: "textValue" }] : /* istanbul ignore next */ []));
|
|
368
369
|
/**
|
|
369
370
|
* @ignore
|
|
370
371
|
*/
|
|
@@ -465,10 +466,10 @@ class RdxNumberFieldRootDirective {
|
|
|
465
466
|
}
|
|
466
467
|
}
|
|
467
468
|
}
|
|
468
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
469
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "
|
|
469
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RdxNumberFieldRootDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
470
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.9", type: RdxNumberFieldRootDirective, isStandalone: true, selector: "[rdxNumberFieldRoot]", inputs: { value: { classPropertyName: "value", publicName: "value", 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 }, stepSnapping: { classPropertyName: "stepSnapping", publicName: "stepSnapping", isSignal: true, isRequired: false, transformFunction: null }, disableWheelChange: { classPropertyName: "disableWheelChange", publicName: "disableWheelChange", isSignal: true, isRequired: false, transformFunction: null }, locale: { classPropertyName: "locale", publicName: "locale", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, formatOptions: { classPropertyName: "formatOptions", publicName: "formatOptions", isSignal: true, isRequired: false, transformFunction: null }, readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange" }, host: { attributes: { "role": "group" }, properties: { "attr.data-disabled": "disabled() ? \"\" : undefined", "attr.data-readonly": "readonly() ? \"\" : undefined" } }, providers: [provideToken(NUMBER_FIELD_ROOT_CONTEXT, RdxNumberFieldRootDirective)], exportAs: ["rdxNumberFieldRoot"], ngImport: i0 }); }
|
|
470
471
|
}
|
|
471
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
472
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RdxNumberFieldRootDirective, decorators: [{
|
|
472
473
|
type: Directive,
|
|
473
474
|
args: [{
|
|
474
475
|
selector: '[rdxNumberFieldRoot]',
|
|
@@ -480,7 +481,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.3", ngImpor
|
|
|
480
481
|
'[attr.data-readonly]': 'readonly() ? "" : undefined'
|
|
481
482
|
}
|
|
482
483
|
}]
|
|
483
|
-
}] });
|
|
484
|
+
}], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], min: [{ type: i0.Input, args: [{ isSignal: true, alias: "min", required: false }] }], max: [{ type: i0.Input, args: [{ isSignal: true, alias: "max", required: false }] }], step: [{ type: i0.Input, args: [{ isSignal: true, alias: "step", required: false }] }], stepSnapping: [{ type: i0.Input, args: [{ isSignal: true, alias: "stepSnapping", required: false }] }], disableWheelChange: [{ type: i0.Input, args: [{ isSignal: true, alias: "disableWheelChange", required: false }] }], locale: [{ type: i0.Input, args: [{ isSignal: true, alias: "locale", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], formatOptions: [{ type: i0.Input, args: [{ isSignal: true, alias: "formatOptions", required: false }] }], readonly: [{ type: i0.Input, args: [{ isSignal: true, alias: "readonly", required: false }] }] } });
|
|
484
485
|
|
|
485
486
|
const _imports = [
|
|
486
487
|
RdxNumberFieldRootDirective,
|
|
@@ -489,17 +490,17 @@ const _imports = [
|
|
|
489
490
|
RdxNumberFieldDecrementDirective
|
|
490
491
|
];
|
|
491
492
|
class RdxNumberFieldModule {
|
|
492
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
493
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "
|
|
493
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RdxNumberFieldModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
494
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.2.9", ngImport: i0, type: RdxNumberFieldModule, imports: [RdxNumberFieldRootDirective,
|
|
494
495
|
RdxNumberFieldInputDirective,
|
|
495
496
|
RdxNumberFieldIncrementDirective,
|
|
496
497
|
RdxNumberFieldDecrementDirective], exports: [RdxNumberFieldRootDirective,
|
|
497
498
|
RdxNumberFieldInputDirective,
|
|
498
499
|
RdxNumberFieldIncrementDirective,
|
|
499
500
|
RdxNumberFieldDecrementDirective] }); }
|
|
500
|
-
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "
|
|
501
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RdxNumberFieldModule }); }
|
|
501
502
|
}
|
|
502
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
503
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RdxNumberFieldModule, decorators: [{
|
|
503
504
|
type: NgModule,
|
|
504
505
|
args: [{
|
|
505
506
|
imports: [..._imports],
|