@qualcomm-ui/angular-core 1.0.5 → 1.0.6

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.
@@ -0,0 +1,592 @@
1
+ import * as i0 from '@angular/core';
2
+ import { Injectable, input, computed, Directive, output, inject } from '@angular/core';
3
+ import { BaseApiContextService, createApiContext, useTrackBindings, useMachine, normalizeProps } from '@qualcomm-ui/angular-core/machine';
4
+ import { useId, useOnDestroy, useIsMounted } from '@qualcomm-ui/angular-core/common';
5
+ import { DOCUMENT } from '@angular/common';
6
+ import '@angular/forms';
7
+ import { AbstractBaseListCollectionFormControlDirective } from '@qualcomm-ui/angular-core/input';
8
+ import { sliderMachine, createSliderApi } from '@qualcomm-ui/core/slider';
9
+
10
+ // Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
11
+ // SPDX-License-Identifier: BSD-3-Clause-Clear
12
+ class SliderContextService extends BaseApiContextService {
13
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: SliderContextService, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
14
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: SliderContextService });
15
+ }
16
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: SliderContextService, decorators: [{
17
+ type: Injectable
18
+ }] });
19
+ const [SLIDER_CONTEXT, useSliderContext, provideSliderContext] = createApiContext("SliderContext", SliderContextService);
20
+
21
+ // Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
22
+ // SPDX-License-Identifier: BSD-3-Clause-Clear
23
+ class SliderThumbContextService extends BaseApiContextService {
24
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: SliderThumbContextService, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
25
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: SliderThumbContextService });
26
+ }
27
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: SliderThumbContextService, decorators: [{
28
+ type: Injectable
29
+ }] });
30
+ const [SLIDER_THUMB_CONTEXT, useSliderThumbContext, provideSliderThumbContext,] = createApiContext("SliderThumbContext", SliderThumbContextService);
31
+
32
+ // Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
33
+ // SPDX-License-Identifier: BSD-3-Clause-Clear
34
+ class CoreSliderControlDirective {
35
+ /**
36
+ * {@link https://www.w3schools.com/html/html_id.asp id attribute}. If
37
+ * omitted, a unique identifier will be generated for accessibility.
38
+ */
39
+ id = input(...(ngDevMode ? [undefined, { debugName: "id" }] : []));
40
+ hostId = computed(() => useId(this, this.id()), ...(ngDevMode ? [{ debugName: "hostId" }] : []));
41
+ sliderContext = useSliderContext();
42
+ onDestroy = useOnDestroy();
43
+ trackBindings = useTrackBindings(() => this.sliderContext().getControlBindings({
44
+ id: this.hostId(),
45
+ onDestroy: this.onDestroy,
46
+ }));
47
+ ngOnInit() {
48
+ this.trackBindings();
49
+ }
50
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: CoreSliderControlDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
51
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.3.12", type: CoreSliderControlDirective, isStandalone: true, inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0 });
52
+ }
53
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: CoreSliderControlDirective, decorators: [{
54
+ type: Directive
55
+ }], propDecorators: { id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: false }] }] } });
56
+
57
+ // Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
58
+ // SPDX-License-Identifier: BSD-3-Clause-Clear
59
+ class CoreSliderErrorTextDirective {
60
+ /**
61
+ * {@link https://www.w3schools.com/html/html_id.asp id attribute}. If
62
+ * omitted, a unique identifier will be generated for accessibility.
63
+ */
64
+ id = input(...(ngDevMode ? [undefined, { debugName: "id" }] : []));
65
+ hostId = computed(() => useId(this, this.id()), ...(ngDevMode ? [{ debugName: "hostId" }] : []));
66
+ sliderContext = useSliderContext();
67
+ onDestroy = useOnDestroy();
68
+ trackBindings = useTrackBindings(() => this.sliderContext().getErrorTextBindings({
69
+ id: this.hostId(),
70
+ onDestroy: this.onDestroy,
71
+ }));
72
+ ngOnInit() {
73
+ this.trackBindings();
74
+ }
75
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: CoreSliderErrorTextDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
76
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.3.12", type: CoreSliderErrorTextDirective, isStandalone: true, inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0 });
77
+ }
78
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: CoreSliderErrorTextDirective, decorators: [{
79
+ type: Directive
80
+ }], propDecorators: { id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: false }] }] } });
81
+
82
+ // Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
83
+ // SPDX-License-Identifier: BSD-3-Clause-Clear
84
+ class CoreSliderHiddenInputDirective {
85
+ /**
86
+ * {@link https://www.w3schools.com/html/html_id.asp id attribute}. If
87
+ * omitted, a unique identifier will be generated for accessibility.
88
+ */
89
+ id = input(...(ngDevMode ? [undefined, { debugName: "id" }] : []));
90
+ hostId = computed(() => useId(this, this.id()), ...(ngDevMode ? [{ debugName: "hostId" }] : []));
91
+ sliderContext = useSliderContext();
92
+ sliderThumbContext = useSliderThumbContext();
93
+ onDestroy = useOnDestroy();
94
+ trackBindings = useTrackBindings(() => this.sliderContext().getHiddenInputBindings({
95
+ id: this.hostId(),
96
+ onDestroy: this.onDestroy,
97
+ ...this.sliderThumbContext(),
98
+ }));
99
+ ngOnInit() {
100
+ this.trackBindings();
101
+ }
102
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: CoreSliderHiddenInputDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
103
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.3.12", type: CoreSliderHiddenInputDirective, isStandalone: true, inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0 });
104
+ }
105
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: CoreSliderHiddenInputDirective, decorators: [{
106
+ type: Directive
107
+ }], propDecorators: { id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: false }] }] } });
108
+
109
+ // Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
110
+ // SPDX-License-Identifier: BSD-3-Clause-Clear
111
+ class CoreSliderHintDirective {
112
+ /**
113
+ * {@link https://www.w3schools.com/html/html_id.asp id attribute}. If
114
+ * omitted, a unique identifier will be generated for accessibility.
115
+ */
116
+ id = input(...(ngDevMode ? [undefined, { debugName: "id" }] : []));
117
+ hostId = computed(() => useId(this, this.id()), ...(ngDevMode ? [{ debugName: "hostId" }] : []));
118
+ sliderContext = useSliderContext();
119
+ onDestroy = useOnDestroy();
120
+ trackBindings = useTrackBindings(() => this.sliderContext().getHintBindings({
121
+ id: this.hostId(),
122
+ onDestroy: this.onDestroy,
123
+ }));
124
+ ngOnInit() {
125
+ this.trackBindings();
126
+ }
127
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: CoreSliderHintDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
128
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.3.12", type: CoreSliderHintDirective, isStandalone: true, inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0 });
129
+ }
130
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: CoreSliderHintDirective, decorators: [{
131
+ type: Directive
132
+ }], propDecorators: { id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: false }] }] } });
133
+
134
+ // Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
135
+ // SPDX-License-Identifier: BSD-3-Clause-Clear
136
+ class CoreSliderLabelDirective {
137
+ /**
138
+ * {@link https://www.w3schools.com/html/html_id.asp id attribute}. If
139
+ * omitted, a unique identifier will be generated for accessibility.
140
+ */
141
+ id = input(...(ngDevMode ? [undefined, { debugName: "id" }] : []));
142
+ hostId = computed(() => useId(this, this.id()), ...(ngDevMode ? [{ debugName: "hostId" }] : []));
143
+ sliderContext = useSliderContext();
144
+ onDestroy = useOnDestroy();
145
+ trackBindings = useTrackBindings(() => this.sliderContext().getLabelBindings({
146
+ id: this.hostId(),
147
+ onDestroy: this.onDestroy,
148
+ }));
149
+ ngOnInit() {
150
+ this.trackBindings();
151
+ }
152
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: CoreSliderLabelDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
153
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.3.12", type: CoreSliderLabelDirective, isStandalone: true, inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0 });
154
+ }
155
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: CoreSliderLabelDirective, decorators: [{
156
+ type: Directive
157
+ }], propDecorators: { id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: false }] }] } });
158
+
159
+ // Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
160
+ // SPDX-License-Identifier: BSD-3-Clause-Clear
161
+ class CoreSliderMarkerGroupDirective {
162
+ /**
163
+ * {@link https://www.w3schools.com/html/html_id.asp id attribute}. If
164
+ * omitted, a unique identifier will be generated for accessibility.
165
+ */
166
+ id = input(...(ngDevMode ? [undefined, { debugName: "id" }] : []));
167
+ hostId = computed(() => useId(this, this.id()), ...(ngDevMode ? [{ debugName: "hostId" }] : []));
168
+ sliderContext = useSliderContext();
169
+ onDestroy = useOnDestroy();
170
+ trackBindings = useTrackBindings(() => this.sliderContext().getMarkerGroupBindings({
171
+ id: this.hostId(),
172
+ onDestroy: this.onDestroy,
173
+ }));
174
+ ngOnInit() {
175
+ this.trackBindings();
176
+ }
177
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: CoreSliderMarkerGroupDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
178
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.3.12", type: CoreSliderMarkerGroupDirective, isStandalone: true, inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0 });
179
+ }
180
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: CoreSliderMarkerGroupDirective, decorators: [{
181
+ type: Directive
182
+ }], propDecorators: { id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: false }] }] } });
183
+
184
+ // Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
185
+ // SPDX-License-Identifier: BSD-3-Clause-Clear
186
+ class CoreSliderMarkerDirective {
187
+ /**
188
+ * {@link https://www.w3schools.com/html/html_id.asp id attribute}. If
189
+ * omitted, a unique identifier will be generated for accessibility.
190
+ */
191
+ id = input(...(ngDevMode ? [undefined, { debugName: "id" }] : []));
192
+ /**
193
+ * The value the marker should indicate.
194
+ */
195
+ value = input.required(...(ngDevMode ? [{ debugName: "value" }] : []));
196
+ hostId = computed(() => useId(this, this.id()), ...(ngDevMode ? [{ debugName: "hostId" }] : []));
197
+ sliderContext = useSliderContext();
198
+ onDestroy = useOnDestroy();
199
+ trackBindings = useTrackBindings(() => this.sliderContext().getMarkerBindings({
200
+ id: this.hostId(),
201
+ onDestroy: this.onDestroy,
202
+ value: this.value(),
203
+ }));
204
+ ngOnInit() {
205
+ this.trackBindings();
206
+ }
207
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: CoreSliderMarkerDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
208
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.3.12", type: CoreSliderMarkerDirective, isStandalone: true, inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0 });
209
+ }
210
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: CoreSliderMarkerDirective, decorators: [{
211
+ type: Directive
212
+ }], propDecorators: { id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: true }] }] } });
213
+
214
+ // Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
215
+ // SPDX-License-Identifier: BSD-3-Clause-Clear
216
+ class CoreSliderMaxDirective {
217
+ /**
218
+ * {@link https://www.w3schools.com/html/html_id.asp id attribute}. If
219
+ * omitted, a unique identifier will be generated for accessibility.
220
+ */
221
+ id = input(...(ngDevMode ? [undefined, { debugName: "id" }] : []));
222
+ hostId = computed(() => useId(this, this.id()), ...(ngDevMode ? [{ debugName: "hostId" }] : []));
223
+ sliderContext = useSliderContext();
224
+ onDestroy = useOnDestroy();
225
+ trackBindings = useTrackBindings(() => {
226
+ return this.sliderContext().getMaxMarkerBindings({
227
+ id: this.hostId(),
228
+ onDestroy: this.onDestroy,
229
+ });
230
+ });
231
+ ngOnInit() {
232
+ this.trackBindings();
233
+ }
234
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: CoreSliderMaxDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
235
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.3.12", type: CoreSliderMaxDirective, isStandalone: true, inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0 });
236
+ }
237
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: CoreSliderMaxDirective, decorators: [{
238
+ type: Directive
239
+ }], propDecorators: { id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: false }] }] } });
240
+
241
+ // Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
242
+ // SPDX-License-Identifier: BSD-3-Clause-Clear
243
+ class CoreSliderMinDirective {
244
+ /**
245
+ * {@link https://www.w3schools.com/html/html_id.asp id attribute}. If
246
+ * omitted, a unique identifier will be generated for accessibility.
247
+ */
248
+ id = input(...(ngDevMode ? [undefined, { debugName: "id" }] : []));
249
+ hostId = computed(() => useId(this, this.id()), ...(ngDevMode ? [{ debugName: "hostId" }] : []));
250
+ sliderContext = useSliderContext();
251
+ onDestroy = useOnDestroy();
252
+ trackBindings = useTrackBindings(() => this.sliderContext().getMinMarkerBindings({
253
+ id: this.hostId(),
254
+ onDestroy: this.onDestroy,
255
+ }));
256
+ ngOnInit() {
257
+ this.trackBindings();
258
+ }
259
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: CoreSliderMinDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
260
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.3.12", type: CoreSliderMinDirective, isStandalone: true, inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0 });
261
+ }
262
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: CoreSliderMinDirective, decorators: [{
263
+ type: Directive
264
+ }], propDecorators: { id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: false }] }] } });
265
+
266
+ // Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
267
+ // SPDX-License-Identifier: BSD-3-Clause-Clear
268
+ class CoreSliderRangeDirective {
269
+ /**
270
+ * {@link https://www.w3schools.com/html/html_id.asp id attribute}. If
271
+ * omitted, a unique identifier will be generated for accessibility.
272
+ */
273
+ id = input(...(ngDevMode ? [undefined, { debugName: "id" }] : []));
274
+ hostId = computed(() => useId(this, this.id()), ...(ngDevMode ? [{ debugName: "hostId" }] : []));
275
+ sliderContext = useSliderContext();
276
+ onDestroy = useOnDestroy();
277
+ trackBindings = useTrackBindings(() => this.sliderContext().getRangeBindings({
278
+ id: this.hostId(),
279
+ onDestroy: this.onDestroy,
280
+ }));
281
+ ngOnInit() {
282
+ this.trackBindings();
283
+ }
284
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: CoreSliderRangeDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
285
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.3.12", type: CoreSliderRangeDirective, isStandalone: true, inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0 });
286
+ }
287
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: CoreSliderRangeDirective, decorators: [{
288
+ type: Directive
289
+ }], propDecorators: { id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: false }] }] } });
290
+
291
+ // Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
292
+ // SPDX-License-Identifier: BSD-3-Clause-Clear
293
+ class CoreSliderRootDirective extends AbstractBaseListCollectionFormControlDirective {
294
+ /**
295
+ * The document's text/writing direction.
296
+ */
297
+ dir = input(...(ngDevMode ? [undefined, { debugName: "dir" }] : []));
298
+ /**
299
+ * A root node to correctly resolve the Document in custom environments. i.e.,
300
+ * Iframes, Electron.
301
+ */
302
+ getRootNode = input(...(ngDevMode ? [undefined, { debugName: "getRootNode" }] : []));
303
+ /**
304
+ * HTML {@link https://www.w3schools.com/html/html_id.asp id attribute}. If
305
+ * omitted, a unique identifier will be generated for accessibility.)
306
+ */
307
+ id = input(...(ngDevMode ? [undefined, { debugName: "id" }] : []));
308
+ /**
309
+ * The aria-label of each slider thumb. Useful for providing an accessible name to
310
+ * the slider
311
+ */
312
+ ariaLabel = input(undefined, ...(ngDevMode ? [{ debugName: "ariaLabel", alias: "aria-label" }] : [{
313
+ alias: "aria-label",
314
+ }]));
315
+ /**
316
+ * The `id` of the elements that labels each slider thumb. Useful for providing an
317
+ * accessible name to the slider
318
+ */
319
+ ariaLabelledby = input(undefined, ...(ngDevMode ? [{ debugName: "ariaLabelledby", alias: "aria-labelledby" }] : [{
320
+ alias: "aria-labelledby",
321
+ }]));
322
+ /**
323
+ * Function that returns a human readable value for the slider thumb
324
+ */
325
+ getAriaValueText = input(...(ngDevMode ? [undefined, { debugName: "getAriaValueText" }] : []));
326
+ /**
327
+ * The maximum value of the slider
328
+ * @default 100
329
+ */
330
+ max = input(...(ngDevMode ? [undefined, { debugName: "max" }] : []));
331
+ /**
332
+ * The minimum value of the slider
333
+ * @default 0
334
+ */
335
+ min = input(...(ngDevMode ? [undefined, { debugName: "min" }] : []));
336
+ /**
337
+ * The minimum permitted steps between multiple thumbs.
338
+ *
339
+ * `minStepsBetweenThumbs` * `step` should reflect the gap between the thumbs.
340
+ *
341
+ * - `step: 1` and `minStepsBetweenThumbs: 10` => gap is `10`
342
+ * - `step: 10` and `minStepsBetweenThumbs: 2` => gap is `20`
343
+ *
344
+ * @default 0
345
+ */
346
+ minStepsBetweenThumbs = input(...(ngDevMode ? [undefined, { debugName: "minStepsBetweenThumbs" }] : []));
347
+ /**
348
+ * The orientation of the slider
349
+ * @default "horizontal"
350
+ */
351
+ orientation = input(...(ngDevMode ? [undefined, { debugName: "orientation" }] : []));
352
+ /**
353
+ * The origin of the slider range. The track is filled from the origin
354
+ * to the thumb for single values.
355
+ * - "start": Useful when the value represents an absolute value
356
+ * - "center": Useful when the value represents an offset (relative)
357
+ * - "end": Useful when the value represents an offset from the end
358
+ *
359
+ * @default "start"
360
+ */
361
+ origin = input(...(ngDevMode ? [undefined, { debugName: "origin" }] : []));
362
+ /**
363
+ * The step value of the slider
364
+ * @default 1
365
+ */
366
+ step = input(...(ngDevMode ? [undefined, { debugName: "step" }] : []));
367
+ /**
368
+ * The alignment of the slider thumb relative to the track
369
+ * - `center`: the thumb will extend beyond the bounds of the slider track.
370
+ * - `contain`: the thumb will be contained within the bounds of the track.
371
+ *
372
+ * @default "contain"
373
+ */
374
+ thumbAlignment = input(...(ngDevMode ? [undefined, { debugName: "thumbAlignment" }] : []));
375
+ /**
376
+ * The slider thumbs dimensions
377
+ */
378
+ thumbSize = input(...(ngDevMode ? [undefined, { debugName: "thumbSize" }] : []));
379
+ /**
380
+ * Value change callback.
381
+ */
382
+ valueChanged = output();
383
+ /**
384
+ * Function invoked when the slider value change is done
385
+ */
386
+ valueChangedEnd = output();
387
+ /**
388
+ * Function invoked when the slider focus changes
389
+ */
390
+ focusChanged = output();
391
+ document = inject(DOCUMENT);
392
+ sliderContextService = inject(SliderContextService);
393
+ isMounted = useIsMounted();
394
+ hostId = computed(() => useId(this, this.id()), ...(ngDevMode ? [{ debugName: "hostId" }] : []));
395
+ trackBindings = useTrackBindings(() => this.sliderContextService.context().getRootBindings({ id: this.hostId() }));
396
+ ngOnInit() {
397
+ super.ngOnInit();
398
+ const machine = useMachine(sliderMachine, computed(() => ({
399
+ "aria-label": this.ariaLabel(),
400
+ "aria-labelledby": this.ariaLabelledby(),
401
+ defaultValue: this.defaultValue(),
402
+ dir: this.dir(),
403
+ disabled: this.isDisabled(),
404
+ // angular handles this automatically with ngModel and Reactive Forms
405
+ form: undefined,
406
+ getAriaValueText: this.getAriaValueText(),
407
+ getRootNode: this.getRootNode() ?? (() => this.document),
408
+ ids: undefined,
409
+ invalid: this.isInvalid(),
410
+ max: this.max(),
411
+ min: this.min(),
412
+ minStepsBetweenThumbs: this.minStepsBetweenThumbs(),
413
+ name: this.name(),
414
+ onFocusChange: (details) => {
415
+ if (this.isMounted()) {
416
+ this.focusChanged.emit(details);
417
+ }
418
+ if (details.focusedIndex === -1) {
419
+ // only trigger onTouched on blur.
420
+ this.onTouched();
421
+ }
422
+ },
423
+ onValueChange: (details) => {
424
+ if (!this.control) {
425
+ if (this.isMounted()) {
426
+ this.valueChanged.emit(details);
427
+ }
428
+ this.value.set(details.value);
429
+ return;
430
+ }
431
+ // ngModel is bound to the root, but change events happen from internal
432
+ // elements and are passed to the machine. So we need to fire the
433
+ // form's value change event to keep it in sync.
434
+ this.onChange(details.value);
435
+ // angular handles touched/dirty internally when ngModel is bound to an
436
+ // <input> element, but we don't have that luxury here. We fire these
437
+ // manually.
438
+ if (!this.control?.touched) {
439
+ this.control.markAsTouched?.();
440
+ }
441
+ if (!this.control?.dirty) {
442
+ this.control.markAsDirty?.();
443
+ }
444
+ },
445
+ onValueChangeEnd: (details) => {
446
+ if (this.isMounted()) {
447
+ this.valueChangedEnd.emit(details);
448
+ }
449
+ },
450
+ orientation: this.orientation(),
451
+ origin: this.origin(),
452
+ readOnly: this.readOnly(),
453
+ required: this.isRequired(),
454
+ step: this.step(),
455
+ thumbAlignment: this.thumbAlignment(),
456
+ thumbSize: this.thumbSize(),
457
+ value: this.value(),
458
+ })), this.injector);
459
+ this.sliderContextService.init(computed(() => createSliderApi(machine, normalizeProps)));
460
+ this.trackBindings();
461
+ }
462
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: CoreSliderRootDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive });
463
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.3.12", type: CoreSliderRootDirective, isStandalone: true, inputs: { dir: { classPropertyName: "dir", publicName: "dir", isSignal: true, isRequired: false, transformFunction: null }, getRootNode: { classPropertyName: "getRootNode", publicName: "getRootNode", isSignal: true, isRequired: false, transformFunction: null }, id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "aria-label", isSignal: true, isRequired: false, transformFunction: null }, ariaLabelledby: { classPropertyName: "ariaLabelledby", publicName: "aria-labelledby", isSignal: true, isRequired: false, transformFunction: null }, getAriaValueText: { classPropertyName: "getAriaValueText", publicName: "getAriaValueText", isSignal: true, isRequired: false, transformFunction: null }, max: { classPropertyName: "max", publicName: "max", isSignal: true, isRequired: false, transformFunction: null }, min: { classPropertyName: "min", publicName: "min", isSignal: true, isRequired: false, transformFunction: null }, minStepsBetweenThumbs: { classPropertyName: "minStepsBetweenThumbs", publicName: "minStepsBetweenThumbs", isSignal: true, isRequired: false, transformFunction: null }, orientation: { classPropertyName: "orientation", publicName: "orientation", isSignal: true, isRequired: false, transformFunction: null }, origin: { classPropertyName: "origin", publicName: "origin", isSignal: true, isRequired: false, transformFunction: null }, step: { classPropertyName: "step", publicName: "step", isSignal: true, isRequired: false, transformFunction: null }, thumbAlignment: { classPropertyName: "thumbAlignment", publicName: "thumbAlignment", isSignal: true, isRequired: false, transformFunction: null }, thumbSize: { classPropertyName: "thumbSize", publicName: "thumbSize", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { valueChanged: "valueChanged", valueChangedEnd: "valueChangedEnd", focusChanged: "focusChanged" }, usesInheritance: true, ngImport: i0 });
464
+ }
465
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: CoreSliderRootDirective, decorators: [{
466
+ type: Directive
467
+ }], propDecorators: { dir: [{ type: i0.Input, args: [{ isSignal: true, alias: "dir", required: false }] }], getRootNode: [{ type: i0.Input, args: [{ isSignal: true, alias: "getRootNode", required: false }] }], id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-label", required: false }] }], ariaLabelledby: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-labelledby", required: false }] }], getAriaValueText: [{ type: i0.Input, args: [{ isSignal: true, alias: "getAriaValueText", required: false }] }], max: [{ type: i0.Input, args: [{ isSignal: true, alias: "max", required: false }] }], min: [{ type: i0.Input, args: [{ isSignal: true, alias: "min", required: false }] }], minStepsBetweenThumbs: [{ type: i0.Input, args: [{ isSignal: true, alias: "minStepsBetweenThumbs", required: false }] }], orientation: [{ type: i0.Input, args: [{ isSignal: true, alias: "orientation", required: false }] }], origin: [{ type: i0.Input, args: [{ isSignal: true, alias: "origin", required: false }] }], step: [{ type: i0.Input, args: [{ isSignal: true, alias: "step", required: false }] }], thumbAlignment: [{ type: i0.Input, args: [{ isSignal: true, alias: "thumbAlignment", required: false }] }], thumbSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "thumbSize", required: false }] }], valueChanged: [{ type: i0.Output, args: ["valueChanged"] }], valueChangedEnd: [{ type: i0.Output, args: ["valueChangedEnd"] }], focusChanged: [{ type: i0.Output, args: ["focusChanged"] }] } });
468
+
469
+ // Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
470
+ // SPDX-License-Identifier: BSD-3-Clause-Clear
471
+ class CoreSliderThumbIndicatorDirective {
472
+ /**
473
+ * {@link https://www.w3schools.com/html/html_id.asp id attribute}. If
474
+ * omitted, a unique identifier will be generated for accessibility.
475
+ */
476
+ id = input(...(ngDevMode ? [undefined, { debugName: "id" }] : []));
477
+ hostId = computed(() => useId(this, this.id()), ...(ngDevMode ? [{ debugName: "hostId" }] : []));
478
+ sliderContext = useSliderContext();
479
+ sliderThumbContext = useSliderThumbContext();
480
+ onDestroy = useOnDestroy();
481
+ value = computed(() => this.sliderContext().getThumbValue(this.sliderThumbContext().index), ...(ngDevMode ? [{ debugName: "value" }] : []));
482
+ trackBindings = useTrackBindings(() => this.sliderContext().getThumbIndicatorBindings({
483
+ id: this.hostId(),
484
+ index: this.sliderThumbContext().index,
485
+ onDestroy: this.onDestroy,
486
+ }));
487
+ ngOnInit() {
488
+ this.trackBindings();
489
+ }
490
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: CoreSliderThumbIndicatorDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
491
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.3.12", type: CoreSliderThumbIndicatorDirective, isStandalone: true, inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0 });
492
+ }
493
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: CoreSliderThumbIndicatorDirective, decorators: [{
494
+ type: Directive
495
+ }], propDecorators: { id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: false }] }] } });
496
+
497
+ // Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
498
+ // SPDX-License-Identifier: BSD-3-Clause-Clear
499
+ class CoreSliderThumbDirective {
500
+ /**
501
+ * {@link https://www.w3schools.com/html/html_id.asp id attribute}. If
502
+ * omitted, a unique identifier will be generated for accessibility.
503
+ */
504
+ id = input(...(ngDevMode ? [undefined, { debugName: "id" }] : []));
505
+ /**
506
+ * The slider thumb's index.
507
+ */
508
+ index = input.required(...(ngDevMode ? [{ debugName: "index" }] : []));
509
+ /**
510
+ * The name associated with the slider thumb's input (when used in a form).
511
+ */
512
+ name = input(...(ngDevMode ? [undefined, { debugName: "name" }] : []));
513
+ sliderThumbContextService = inject(SliderThumbContextService);
514
+ hostId = computed(() => useId(this, this.id()), ...(ngDevMode ? [{ debugName: "hostId" }] : []));
515
+ sliderContext = useSliderContext();
516
+ onDestroy = useOnDestroy();
517
+ trackBindings = useTrackBindings(() => this.sliderContext().getThumbBindings({
518
+ id: this.hostId(),
519
+ index: this.index(),
520
+ name: this.name(),
521
+ onDestroy: this.onDestroy,
522
+ }));
523
+ ngOnInit() {
524
+ this.sliderThumbContextService.init(computed(() => ({
525
+ index: this.index(),
526
+ name: this.name(),
527
+ })));
528
+ this.trackBindings();
529
+ }
530
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: CoreSliderThumbDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
531
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.3.12", type: CoreSliderThumbDirective, isStandalone: true, inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, index: { classPropertyName: "index", publicName: "index", isSignal: true, isRequired: true, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0 });
532
+ }
533
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: CoreSliderThumbDirective, decorators: [{
534
+ type: Directive
535
+ }], propDecorators: { id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: false }] }], index: [{ type: i0.Input, args: [{ isSignal: true, alias: "index", required: true }] }], name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: false }] }] } });
536
+
537
+ // Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
538
+ // SPDX-License-Identifier: BSD-3-Clause-Clear
539
+ class CoreSliderTrackDirective {
540
+ /**
541
+ * {@link https://www.w3schools.com/html/html_id.asp id attribute}. If
542
+ * omitted, a unique identifier will be generated for accessibility.
543
+ */
544
+ id = input(...(ngDevMode ? [undefined, { debugName: "id" }] : []));
545
+ hostId = computed(() => useId(this, this.id()), ...(ngDevMode ? [{ debugName: "hostId" }] : []));
546
+ sliderContext = useSliderContext();
547
+ onDestroy = useOnDestroy();
548
+ trackBindings = useTrackBindings(() => this.sliderContext().getTrackBindings({
549
+ id: this.hostId(),
550
+ onDestroy: this.onDestroy,
551
+ }));
552
+ ngOnInit() {
553
+ this.trackBindings();
554
+ }
555
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: CoreSliderTrackDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
556
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.3.12", type: CoreSliderTrackDirective, isStandalone: true, inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0 });
557
+ }
558
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: CoreSliderTrackDirective, decorators: [{
559
+ type: Directive
560
+ }], propDecorators: { id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: false }] }] } });
561
+
562
+ // Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
563
+ // SPDX-License-Identifier: BSD-3-Clause-Clear
564
+ class CoreSliderValueTextDirective {
565
+ /**
566
+ * {@link https://www.w3schools.com/html/html_id.asp id attribute}. If
567
+ * omitted, a unique identifier will be generated for accessibility.
568
+ */
569
+ id = input(...(ngDevMode ? [undefined, { debugName: "id" }] : []));
570
+ hostId = computed(() => useId(this, this.id()), ...(ngDevMode ? [{ debugName: "hostId" }] : []));
571
+ sliderContext = useSliderContext();
572
+ onDestroy = useOnDestroy();
573
+ trackBindings = useTrackBindings(() => this.sliderContext().getValueTextBindings({
574
+ id: this.hostId(),
575
+ onDestroy: this.onDestroy,
576
+ }));
577
+ ngOnInit() {
578
+ this.trackBindings();
579
+ }
580
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: CoreSliderValueTextDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
581
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.3.12", type: CoreSliderValueTextDirective, isStandalone: true, inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0 });
582
+ }
583
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: CoreSliderValueTextDirective, decorators: [{
584
+ type: Directive
585
+ }], propDecorators: { id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: false }] }] } });
586
+
587
+ /**
588
+ * Generated bundle index. Do not edit.
589
+ */
590
+
591
+ export { CoreSliderControlDirective, CoreSliderErrorTextDirective, CoreSliderHiddenInputDirective, CoreSliderHintDirective, CoreSliderLabelDirective, CoreSliderMarkerDirective, CoreSliderMarkerGroupDirective, CoreSliderMaxDirective, CoreSliderMinDirective, CoreSliderRangeDirective, CoreSliderRootDirective, CoreSliderThumbDirective, CoreSliderThumbIndicatorDirective, CoreSliderTrackDirective, CoreSliderValueTextDirective, SLIDER_CONTEXT, SLIDER_THUMB_CONTEXT, SliderContextService, SliderThumbContextService, provideSliderContext, provideSliderThumbContext, useSliderContext, useSliderThumbContext };
592
+ //# sourceMappingURL=qualcomm-ui-angular-core-slider.mjs.map