@acorex/components 18.7.2 → 18.8.1
Sign up to get free protection for your applications and to get access to all the features.
- package/color-palette/lib/color-palette-picker.component.d.ts +3 -3
- package/color-palette/lib/color-palette.module.d.ts +4 -3
- package/conversation/lib/conversation.module.d.ts +2 -2
- package/esm2022/color-palette/lib/color-palette-picker.component.mjs +10 -10
- package/esm2022/color-palette/lib/color-palette.component.mjs +2 -2
- package/esm2022/color-palette/lib/color-palette.module.mjs +5 -2
- package/esm2022/conversation/lib/conversation-messages/conversation-message-audio/conversation-message-audio.component.mjs +8 -9
- package/esm2022/conversation/lib/conversation.module.mjs +5 -5
- package/esm2022/paint/lib/paint/paint-tools/paint-pen-mode-changer/paint-pen-mode-changer.component.mjs +5 -5
- package/esm2022/paint/lib/paint.module.mjs +18 -4
- package/esm2022/range-slider/index.mjs +3 -1
- package/esm2022/range-slider/lib/range-slider.class.mjs +3 -0
- package/esm2022/range-slider/lib/range-slider.component.mjs +599 -6
- package/esm2022/range-slider/lib/range-slider.module.mjs +3 -2
- package/esm2022/uploader/lib/uploader-drop-zone/uploader-drop-zone.component.mjs +1 -1
- package/fesm2022/acorex-components-color-palette.mjs +15 -12
- package/fesm2022/acorex-components-color-palette.mjs.map +1 -1
- package/fesm2022/acorex-components-conversation.mjs +17 -17
- package/fesm2022/acorex-components-conversation.mjs.map +1 -1
- package/fesm2022/acorex-components-paint.mjs +20 -6
- package/fesm2022/acorex-components-paint.mjs.map +1 -1
- package/fesm2022/acorex-components-range-slider.mjs +604 -8
- package/fesm2022/acorex-components-range-slider.mjs.map +1 -1
- package/fesm2022/acorex-components-uploader.mjs.map +1 -1
- package/package.json +37 -37
- package/paint/lib/paint.module.d.ts +2 -2
- package/range-slider/index.d.ts +2 -0
- package/range-slider/lib/range-slider.class.d.ts +8 -0
- package/range-slider/lib/range-slider.component.d.ts +233 -2
- package/range-slider/lib/range-slider.module.d.ts +1 -1
- package/uploader/lib/uploader-drop-zone/uploader-drop-zone.component.d.ts +1 -1
@@ -1,23 +1,618 @@
|
|
1
|
-
import {
|
1
|
+
import { MXValueComponent, AXValuableComponent } from '@acorex/components/common';
|
2
2
|
import * as i0 from '@angular/core';
|
3
|
-
import { Component, NgModule } from '@angular/core';
|
3
|
+
import { inject, NgZone, output, input, model, computed, effect, forwardRef, Component, ViewEncapsulation, ChangeDetectionStrategy, HostListener, HostBinding, NgModule } from '@angular/core';
|
4
|
+
import { NG_VALUE_ACCESSOR } from '@angular/forms';
|
5
|
+
import { classes } from 'polytype';
|
6
|
+
import * as i1 from '@angular/common';
|
7
|
+
import { CommonModule } from '@angular/common';
|
8
|
+
|
9
|
+
//import { AXRange } from '@acorex/components/common';
|
4
10
|
|
5
11
|
/**
|
6
12
|
* @category
|
7
13
|
* Range slider for selecting a range of values.
|
8
14
|
*/
|
9
|
-
class AXRangeSliderComponent {
|
15
|
+
class AXRangeSliderComponent extends classes((MXValueComponent)) {
|
16
|
+
//protected AXTooltip = computed(() => {});
|
17
|
+
constructor() {
|
18
|
+
super();
|
19
|
+
/**
|
20
|
+
* @ignore
|
21
|
+
*/
|
22
|
+
this.zone = inject(NgZone);
|
23
|
+
/**
|
24
|
+
* @event onStart when user interact with range-slider with its bar
|
25
|
+
*/
|
26
|
+
this.onStart = output();
|
27
|
+
/**
|
28
|
+
* @description orientation including vertical and horizontal
|
29
|
+
*/
|
30
|
+
this.orientation = input('horizontal');
|
31
|
+
/**
|
32
|
+
* @description color for highlight and tooltip and handler
|
33
|
+
*/
|
34
|
+
this.color = input('primary');
|
35
|
+
/**
|
36
|
+
* @description values is a number single mode
|
37
|
+
* and array of 2 number for dual mode
|
38
|
+
*/
|
39
|
+
this.values = model(this.value);
|
40
|
+
/**
|
41
|
+
* @description mode including single and dual
|
42
|
+
*/
|
43
|
+
this.mode = input('single');
|
44
|
+
/**
|
45
|
+
* @description minimum value
|
46
|
+
*/
|
47
|
+
this.min = input(0);
|
48
|
+
/**
|
49
|
+
* @description maximum value
|
50
|
+
*/
|
51
|
+
this.max = input(100);
|
52
|
+
/**
|
53
|
+
* @description step for changing values
|
54
|
+
*/
|
55
|
+
this.step = input(1);
|
56
|
+
/**
|
57
|
+
* @description act as ruler for range slider,
|
58
|
+
* its range of showing to user
|
59
|
+
*/
|
60
|
+
this.snap = input(1);
|
61
|
+
/**
|
62
|
+
* @description tooltip for showing value of handlers
|
63
|
+
*/
|
64
|
+
this.tooltipMode = input('end');
|
65
|
+
/**
|
66
|
+
* @description deferent modes for snap including start, end and both
|
67
|
+
*/
|
68
|
+
this.snapMode = input('start');
|
69
|
+
/**
|
70
|
+
* @description a flag for showing snap
|
71
|
+
*/
|
72
|
+
this.hasSnap = input(false);
|
73
|
+
/**
|
74
|
+
* @description a flag for showing snap labels
|
75
|
+
*/
|
76
|
+
this.hasLable = input(this.hasSnap());
|
77
|
+
/**
|
78
|
+
* @description a flag for showing tooltip for values
|
79
|
+
*/
|
80
|
+
this.hasTooltip = input(false);
|
81
|
+
this.height = 0.25;
|
82
|
+
this.newHeight = 'var(--ax-range-slider-base-thickness)';
|
83
|
+
this.range = computed(() => this.max() - this.min());
|
84
|
+
this.isHorizontal = computed(() => this.orientation() === 'horizontal');
|
85
|
+
this.isDual = computed(() => this.mode() === 'dual');
|
86
|
+
/**
|
87
|
+
* @ignore
|
88
|
+
*/
|
89
|
+
this.calculateSnapBar = computed(() => {
|
90
|
+
if (this.hasSnap()) {
|
91
|
+
let array = [];
|
92
|
+
for (let i = this.min(); i < this.max(); i += this.snap()) {
|
93
|
+
array.push(i);
|
94
|
+
}
|
95
|
+
array = [...array, this.max()];
|
96
|
+
if (array[0] < 0) {
|
97
|
+
array = array.map((i) => i + -array[0]).sort((a, b) => a - b);
|
98
|
+
}
|
99
|
+
if (array[0] > 0) {
|
100
|
+
array = array.map((i) => i - array[0]).sort((a, b) => a - b);
|
101
|
+
}
|
102
|
+
return array;
|
103
|
+
}
|
104
|
+
else {
|
105
|
+
return undefined;
|
106
|
+
}
|
107
|
+
});
|
108
|
+
/**
|
109
|
+
* @ignore
|
110
|
+
*/
|
111
|
+
this.calculatePos = computed(() => {
|
112
|
+
if (this.isDual() && this.values()) {
|
113
|
+
return [
|
114
|
+
((this.values()[0] - this.min()) / this.range()) * 100,
|
115
|
+
((this.values()[1] - this.min()) / this.range()) * 100,
|
116
|
+
];
|
117
|
+
}
|
118
|
+
else {
|
119
|
+
return ((this.values() - this.min()) / this.range()) * 100;
|
120
|
+
}
|
121
|
+
});
|
122
|
+
/**
|
123
|
+
* @ignore
|
124
|
+
*/
|
125
|
+
this.choosenHandler = undefined;
|
126
|
+
/**
|
127
|
+
* @ignore
|
128
|
+
*/
|
129
|
+
this.sliderElement = null;
|
130
|
+
/**
|
131
|
+
* @ignore
|
132
|
+
*/
|
133
|
+
this.AXRangeSliderHighlight = computed(() => this.isHorizontal()
|
134
|
+
? {
|
135
|
+
left: this.isDual() ? this.calculatePos()[0] + '%' : '0%',
|
136
|
+
width: this.isDual()
|
137
|
+
? this.calculatePos()[1] - this.calculatePos()[0] + '%'
|
138
|
+
: this.calculatePos() + '%',
|
139
|
+
}
|
140
|
+
: {
|
141
|
+
height: this.isDual()
|
142
|
+
? this.calculatePos()[1] - this.calculatePos()[0] + '%'
|
143
|
+
: this.calculatePos() + '%',
|
144
|
+
top: this.mode() === 'dual' ? this.calculatePos()[0] + '%' : this.min() + '%',
|
145
|
+
});
|
146
|
+
/**
|
147
|
+
* @ignore
|
148
|
+
*/
|
149
|
+
this.AXRangeSliderHandler1 = computed(() => this.isHorizontal()
|
150
|
+
? {
|
151
|
+
left: this.isDual() ? this.calculatePos()[0] + '%' : this.calculatePos() + '%',
|
152
|
+
}
|
153
|
+
: {
|
154
|
+
top: this.isDual() ? this.calculatePos()[0] + '%' : this.calculatePos() + '%',
|
155
|
+
});
|
156
|
+
/**
|
157
|
+
* @ignore
|
158
|
+
*/
|
159
|
+
this.AXRangeSliderHandler2 = computed(() => this.isHorizontal()
|
160
|
+
? {
|
161
|
+
left: this.calculatePos()[1] + '%',
|
162
|
+
}
|
163
|
+
: {
|
164
|
+
top: this.calculatePos()[1] + '%',
|
165
|
+
});
|
166
|
+
/**
|
167
|
+
* @ignore
|
168
|
+
*/
|
169
|
+
this.AXRangeSliderStep = computed(() => {
|
170
|
+
if (this.isHorizontal()) {
|
171
|
+
switch (this.snapMode()) {
|
172
|
+
case 'both':
|
173
|
+
return { top: '0', height: 8 * this.height + 'rem' };
|
174
|
+
case 'start':
|
175
|
+
return { top: 4 * this.height + 'rem', height: 4 * this.height + 'rem' };
|
176
|
+
case 'end':
|
177
|
+
return { top: -2 * this.height + 'rem', height: 4 * this.height + 'rem' };
|
178
|
+
}
|
179
|
+
}
|
180
|
+
else {
|
181
|
+
switch (this.snapMode()) {
|
182
|
+
case 'both':
|
183
|
+
return { top: '0', width: 8 * this.height + 'rem' };
|
184
|
+
case 'start':
|
185
|
+
return { left: 4 * this.height + 'rem', width: 4 * this.height + 'rem' };
|
186
|
+
case 'end':
|
187
|
+
return { left: -2 * this.height + 'rem', width: 4 * this.height + 'rem' };
|
188
|
+
}
|
189
|
+
}
|
190
|
+
});
|
191
|
+
/**
|
192
|
+
* @ignore
|
193
|
+
*/
|
194
|
+
this.AXRangeLabel = computed(() => {
|
195
|
+
if (this.isHorizontal()) {
|
196
|
+
switch (this.snapMode()) {
|
197
|
+
case 'both':
|
198
|
+
return { top: 6 * this.height + 'rem' };
|
199
|
+
case 'start':
|
200
|
+
return { top: 4 * this.height + 'rem' };
|
201
|
+
case 'end':
|
202
|
+
return { top: -6 * this.height + 'rem' };
|
203
|
+
}
|
204
|
+
}
|
205
|
+
else {
|
206
|
+
switch (this.snapMode()) {
|
207
|
+
case 'both':
|
208
|
+
return { left: 8 * this.height + 'rem' };
|
209
|
+
case 'start':
|
210
|
+
return { left: 4 * this.height + 'rem' };
|
211
|
+
case 'end':
|
212
|
+
return { left: -8 * this.height + 'rem' };
|
213
|
+
}
|
214
|
+
}
|
215
|
+
});
|
216
|
+
effect(() => {
|
217
|
+
this.fixInitializeValues();
|
218
|
+
this.fixChangingMode();
|
219
|
+
}, { allowSignalWrites: true });
|
220
|
+
}
|
221
|
+
/**
|
222
|
+
* @ignore
|
223
|
+
*/
|
224
|
+
ngOnInit() {
|
225
|
+
//(window as any).rangeSlider = this; for debugging purpose only
|
226
|
+
super.ngOnInit();
|
227
|
+
this.initializeValues();
|
228
|
+
}
|
229
|
+
/**
|
230
|
+
* @ignore
|
231
|
+
*/
|
232
|
+
handleOnStart(event, circle) {
|
233
|
+
this.zone.runOutsideAngular(() => {
|
234
|
+
if (this.disabled)
|
235
|
+
return;
|
236
|
+
event.preventDefault();
|
237
|
+
this.sliderElement = event.target.closest('ax-range-slider');
|
238
|
+
if (this.sliderElement) {
|
239
|
+
this.choosenHandler = circle;
|
240
|
+
const moveListener = (moveEvent) => this.onMove(moveEvent, circle);
|
241
|
+
const endListener = () => this.onEnd(moveListener, endListener);
|
242
|
+
window.addEventListener('mousemove', moveListener);
|
243
|
+
window.addEventListener('mouseup', endListener);
|
244
|
+
window.addEventListener('touchmove', moveListener, { passive: true });
|
245
|
+
window.addEventListener('touchend', endListener);
|
246
|
+
}
|
247
|
+
});
|
248
|
+
}
|
249
|
+
/**
|
250
|
+
* @ignore
|
251
|
+
*/
|
252
|
+
onclickBar(event) {
|
253
|
+
let circle = 'first';
|
254
|
+
this.sliderElement = event.target.closest('ax-range-slider');
|
255
|
+
this.zone.runOutsideAngular(() => {
|
256
|
+
if (!this.sliderElement || this.disabled)
|
257
|
+
return;
|
258
|
+
const clientX = event instanceof MouseEvent ? event.clientX : event.touches[0].clientX;
|
259
|
+
const sliderRect = this.sliderElement.getBoundingClientRect();
|
260
|
+
const clickPosition = ((clientX - sliderRect.left) / sliderRect.width) * 100;
|
261
|
+
let newValue = Math.round(this.min() + (clickPosition / 100) * (this.max() - this.min()));
|
262
|
+
newValue = this.calculateStep(newValue);
|
263
|
+
if (this.isDual()) {
|
264
|
+
if (clickPosition < this.calculatePos()[0]) {
|
265
|
+
this.values.set([newValue, this.values()[1]]);
|
266
|
+
this.commitValue(this.values());
|
267
|
+
}
|
268
|
+
else if (clickPosition > this.calculatePos()[1]) {
|
269
|
+
circle = 'second';
|
270
|
+
this.values.set([this.values()[0], newValue]);
|
271
|
+
this.commitValue(this.values());
|
272
|
+
}
|
273
|
+
}
|
274
|
+
else {
|
275
|
+
if (clickPosition > this.calculatePos()) {
|
276
|
+
this.values.set(newValue);
|
277
|
+
this.commitValue(this.values());
|
278
|
+
}
|
279
|
+
}
|
280
|
+
this.onStart.emit({
|
281
|
+
component: this,
|
282
|
+
htmlElement: event.target,
|
283
|
+
isUserInteraction: event.isTrusted,
|
284
|
+
data: this.values(),
|
285
|
+
});
|
286
|
+
});
|
287
|
+
this.handleOnStart(event, circle);
|
288
|
+
}
|
289
|
+
/**
|
290
|
+
* @ignore
|
291
|
+
*/
|
292
|
+
onMove(event, circle) {
|
293
|
+
if (!this.sliderElement || this.disabled)
|
294
|
+
return;
|
295
|
+
const sliderRect = this.sliderElement.getBoundingClientRect();
|
296
|
+
let newValue;
|
297
|
+
if (this.isHorizontal()) {
|
298
|
+
const clientX = event instanceof MouseEvent ? event.clientX : event.touches[0].clientX;
|
299
|
+
let newLeft = ((clientX - sliderRect.left) / sliderRect.width) * 100;
|
300
|
+
newLeft = Math.max(0, Math.min(newLeft, 100));
|
301
|
+
newValue = Math.round(this.min() + (newLeft / 100) * (this.max() - this.min()));
|
302
|
+
}
|
303
|
+
else {
|
304
|
+
const clientY = event instanceof MouseEvent ? event.clientY : event.touches[0].clientY;
|
305
|
+
let newLeft = ((clientY - sliderRect.top) / sliderRect.height) * 100;
|
306
|
+
newLeft = Math.max(0, Math.min(newLeft, 100));
|
307
|
+
newValue = Math.round(this.min() + (newLeft / 100) * (this.max() - this.min()));
|
308
|
+
}
|
309
|
+
if (!this.readonly) {
|
310
|
+
if (this.isDual()) {
|
311
|
+
if (circle === 'first') {
|
312
|
+
newValue = Math.max(this.min(), Math.min(newValue, this.values()[1] - this.step()));
|
313
|
+
if (this.step() !== 1)
|
314
|
+
newValue = this.calculateStep(newValue);
|
315
|
+
if (this.values()[0] !== newValue) {
|
316
|
+
this.values.set([newValue, this.values()[1]]);
|
317
|
+
this.commitValue(this.values());
|
318
|
+
}
|
319
|
+
}
|
320
|
+
else {
|
321
|
+
newValue = Math.min(this.max(), Math.max(newValue, this.values()[0] + this.step()));
|
322
|
+
if (this.step() !== 1)
|
323
|
+
newValue = this.calculateStep(newValue);
|
324
|
+
if (this.values()[1] !== newValue) {
|
325
|
+
this.values.set([this.values()[0], newValue]);
|
326
|
+
this.commitValue(this.values());
|
327
|
+
}
|
328
|
+
}
|
329
|
+
}
|
330
|
+
else {
|
331
|
+
newValue = Math.max(this.min(), newValue);
|
332
|
+
if (this.step() !== 1)
|
333
|
+
newValue = this.calculateStep(newValue);
|
334
|
+
if (this.values() !== newValue) {
|
335
|
+
this.values.set(newValue);
|
336
|
+
this.commitValue(newValue);
|
337
|
+
}
|
338
|
+
}
|
339
|
+
this.onStart.emit({
|
340
|
+
component: this,
|
341
|
+
htmlElement: event.target,
|
342
|
+
isUserInteraction: event.isTrusted,
|
343
|
+
data: this.values(),
|
344
|
+
});
|
345
|
+
}
|
346
|
+
}
|
347
|
+
/**
|
348
|
+
* @ignore
|
349
|
+
*/
|
350
|
+
onEnd(moveListener, endListener) {
|
351
|
+
window.removeEventListener('mousemove', moveListener);
|
352
|
+
window.removeEventListener('mouseup', endListener);
|
353
|
+
window.removeEventListener('touchmove', moveListener);
|
354
|
+
window.removeEventListener('touchend', endListener);
|
355
|
+
this.sliderElement = null;
|
356
|
+
}
|
357
|
+
/**
|
358
|
+
* @ignore
|
359
|
+
*/
|
360
|
+
initializeValues() {
|
361
|
+
this.fixInitializeUndefined();
|
362
|
+
this.fixInitializeValues();
|
363
|
+
this.fixInitializeStep();
|
364
|
+
}
|
365
|
+
/**
|
366
|
+
* @ignore
|
367
|
+
*/
|
368
|
+
fixInitializeUndefined() {
|
369
|
+
if (typeof this.values() === 'undefined') {
|
370
|
+
if (this.isDual()) {
|
371
|
+
this.values.set([this.min(), this.max()]);
|
372
|
+
}
|
373
|
+
else {
|
374
|
+
this.values.set(this.min());
|
375
|
+
}
|
376
|
+
this.commitValue(this.values());
|
377
|
+
}
|
378
|
+
}
|
379
|
+
/**
|
380
|
+
* @ignore
|
381
|
+
*/
|
382
|
+
fixInitializeValues() {
|
383
|
+
//swap value
|
384
|
+
if (this.isDual() && this.values()[0] > this.values()[1]) {
|
385
|
+
this.values.set([this.values()[1], this.values()[0]]);
|
386
|
+
this.commitValue(this.values());
|
387
|
+
}
|
388
|
+
//not in range
|
389
|
+
if (typeof this.values() === 'number' && !this.checkValue(this.values())) {
|
390
|
+
this.values.set(this.min());
|
391
|
+
this.commitValue(this.values());
|
392
|
+
}
|
393
|
+
else if (typeof this.values() !== 'number' &&
|
394
|
+
!this.checkValues(this.values()[0], 'first', this.values()[1])) {
|
395
|
+
this.values.set([this.min(), this.max()]);
|
396
|
+
this.commitValue(this.values());
|
397
|
+
}
|
398
|
+
}
|
399
|
+
/**
|
400
|
+
* @ignore
|
401
|
+
*/
|
402
|
+
fixInitializeStep() {
|
403
|
+
if (this.step() !== 1) {
|
404
|
+
if (this.isDual()) {
|
405
|
+
this.values.update((old) => [this.calculateStep(old[0]), this.calculateStep(old[1])]);
|
406
|
+
this.commitValue(this.values());
|
407
|
+
this.commitValue(this.values());
|
408
|
+
if (this.values()[0] === this.values()[1]) {
|
409
|
+
this.values.update((old) => [this.calculateStep(old[0]), this.calculateStep(old[1]) + this.step()]);
|
410
|
+
this.commitValue(this.values());
|
411
|
+
}
|
412
|
+
}
|
413
|
+
else {
|
414
|
+
this.values.update((old) => this.calculateStep(old));
|
415
|
+
this.commitValue(this.values());
|
416
|
+
}
|
417
|
+
}
|
418
|
+
}
|
419
|
+
/**
|
420
|
+
* @ignore
|
421
|
+
*/
|
422
|
+
fixChangingMode() {
|
423
|
+
if (typeof this.values() === 'number' && this.isDual()) {
|
424
|
+
this.values.set([this.min(), this.max()]);
|
425
|
+
this.commitValue(this.values());
|
426
|
+
}
|
427
|
+
else if (typeof this.values() !== 'number' && !this.isDual()) {
|
428
|
+
this.values.set(this.min());
|
429
|
+
this.commitValue(this.values());
|
430
|
+
}
|
431
|
+
}
|
432
|
+
/**
|
433
|
+
* @ignore
|
434
|
+
*/
|
435
|
+
calculateStep(x) {
|
436
|
+
const roundedValue = Math.round(x / this.step()) * this.step();
|
437
|
+
if (roundedValue > this.max())
|
438
|
+
return this.max();
|
439
|
+
else if (roundedValue < this.min())
|
440
|
+
return this.min();
|
441
|
+
//else if (x >= this.min() && x < this.min() - (this.min() % this.step())) return this.min();
|
442
|
+
else if (x <= this.max() && x > this.max() - (this.max() % this.step()))
|
443
|
+
return this.max();
|
444
|
+
else
|
445
|
+
return roundedValue;
|
446
|
+
}
|
447
|
+
/**
|
448
|
+
* @ignore
|
449
|
+
*/
|
450
|
+
checkValue(x) {
|
451
|
+
if (x >= this.min() && x <= this.max())
|
452
|
+
return true;
|
453
|
+
else
|
454
|
+
return false;
|
455
|
+
}
|
456
|
+
/**
|
457
|
+
* @ignore
|
458
|
+
*/
|
459
|
+
checkValues(value1, y, value2) {
|
460
|
+
if (value1 >= this.min() && value1 <= this.max()) {
|
461
|
+
if (y === 'first') {
|
462
|
+
if (value1 < value2 && value2 <= this.max())
|
463
|
+
return true;
|
464
|
+
else
|
465
|
+
return false;
|
466
|
+
}
|
467
|
+
else {
|
468
|
+
if (value1 > value2 && value2 >= this.min())
|
469
|
+
return true;
|
470
|
+
else
|
471
|
+
return false;
|
472
|
+
}
|
473
|
+
}
|
474
|
+
else
|
475
|
+
return false;
|
476
|
+
}
|
477
|
+
/**
|
478
|
+
* @ignore
|
479
|
+
*/
|
480
|
+
getPercantage(value) {
|
481
|
+
return (value / this.range()) * 100;
|
482
|
+
}
|
483
|
+
/**
|
484
|
+
* Increase a step to value if slider in single mode
|
485
|
+
* and increase a step the second value if slider in dual mode
|
486
|
+
* @method increaseStep
|
487
|
+
*/
|
488
|
+
increaseStep() {
|
489
|
+
if (this.isDual()) {
|
490
|
+
const newValue = this.calculateStep(this.values()[1] + this.step());
|
491
|
+
this.values.set([this.values()[0], newValue]);
|
492
|
+
}
|
493
|
+
else {
|
494
|
+
const newValue = this.calculateStep(this.values() + this.step());
|
495
|
+
this.values.set(newValue);
|
496
|
+
}
|
497
|
+
}
|
498
|
+
/**
|
499
|
+
* Decrease a step to value if slider in single mode
|
500
|
+
* and decrease a step the second value if slider in dual mode
|
501
|
+
* @method decreaseStep
|
502
|
+
*/
|
503
|
+
decreaseStep() {
|
504
|
+
if (this.isDual()) {
|
505
|
+
const newValue = this.calculateStep(this.values()[0] - this.step());
|
506
|
+
this.values.set([newValue, this.values()[1]]);
|
507
|
+
}
|
508
|
+
else {
|
509
|
+
const newValue = this.calculateStep(this.values() - this.step());
|
510
|
+
this.values.set(newValue);
|
511
|
+
}
|
512
|
+
}
|
513
|
+
/**
|
514
|
+
* @ignore
|
515
|
+
*/
|
516
|
+
onWheel(event) {
|
517
|
+
this.zone.runOutsideAngular(() => {
|
518
|
+
event.preventDefault();
|
519
|
+
if (!this.choosenHandler || this.readonly || this.disabled)
|
520
|
+
return;
|
521
|
+
let newValue;
|
522
|
+
if (this.isDual()) {
|
523
|
+
if (event.deltaY < 0) {
|
524
|
+
if (this.choosenHandler === 'first') {
|
525
|
+
newValue = this.calculateStep(this.values()[0] + this.step());
|
526
|
+
if (this.checkValues(newValue, this.choosenHandler, this.values()[1]) &&
|
527
|
+
this.values()[0] !== newValue) {
|
528
|
+
this.values.update((old) => [this.calculateStep(old[0] + this.step()), old[1]]);
|
529
|
+
this.commitValue(this.values());
|
530
|
+
}
|
531
|
+
}
|
532
|
+
else {
|
533
|
+
newValue = this.calculateStep(this.values()[1] + this.step());
|
534
|
+
if (newValue <= this.max() && this.values()[1] !== newValue) {
|
535
|
+
this.values.update((old) => [old[0], this.calculateStep(old[1] + this.step())]);
|
536
|
+
this.commitValue(this.values());
|
537
|
+
}
|
538
|
+
}
|
539
|
+
}
|
540
|
+
else {
|
541
|
+
if (this.choosenHandler === 'first') {
|
542
|
+
newValue = this.calculateStep(this.values()[0] - this.step());
|
543
|
+
if (this.checkValues(newValue, this.choosenHandler, this.values()[1]) &&
|
544
|
+
this.values() !== newValue) {
|
545
|
+
this.values.update((old) => [this.calculateStep(old[0] - this.step()), old[1]]);
|
546
|
+
this.commitValue(this.values());
|
547
|
+
}
|
548
|
+
}
|
549
|
+
else {
|
550
|
+
newValue = this.calculateStep(this.values()[1] - this.step());
|
551
|
+
if (this.checkValues(newValue, this.choosenHandler, this.values()[0]) &&
|
552
|
+
this.values()[1] !== newValue) {
|
553
|
+
this.values.update((old) => [old[0], this.calculateStep(old[1] - this.step())]);
|
554
|
+
this.commitValue(this.values());
|
555
|
+
}
|
556
|
+
}
|
557
|
+
}
|
558
|
+
}
|
559
|
+
else {
|
560
|
+
if (event.deltaY < 0) {
|
561
|
+
if (this.checkValue(this.calculateStep(this.values() + this.step()))) {
|
562
|
+
this.values.update((old) => this.calculateStep(old + this.step()));
|
563
|
+
this.commitValue(this.values());
|
564
|
+
}
|
565
|
+
}
|
566
|
+
else {
|
567
|
+
if (this.checkValue(this.calculateStep(this.values() - this.step()))) {
|
568
|
+
this.values.update((old) => this.calculateStep(old - this.step()));
|
569
|
+
this.commitValue(this.values());
|
570
|
+
}
|
571
|
+
}
|
572
|
+
}
|
573
|
+
});
|
574
|
+
}
|
575
|
+
/**
|
576
|
+
* @ignore
|
577
|
+
*/
|
578
|
+
get __hostClass() {
|
579
|
+
return [
|
580
|
+
`ax-${this.color()}-solid`,
|
581
|
+
`${this.disabled ? 'ax-state-disabled' : ''}`,
|
582
|
+
`${this.readonly ? 'ax-state-readonly' : ''}`,
|
583
|
+
];
|
584
|
+
}
|
10
585
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: AXRangeSliderComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
11
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "
|
586
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.0", type: AXRangeSliderComponent, selector: "ax-range-slider", inputs: { disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: false, isRequired: false, transformFunction: null }, readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: false, isRequired: false, transformFunction: null }, orientation: { classPropertyName: "orientation", publicName: "orientation", isSignal: true, isRequired: false, transformFunction: null }, color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: false, transformFunction: null }, values: { classPropertyName: "values", publicName: "values", isSignal: true, isRequired: false, transformFunction: null }, mode: { classPropertyName: "mode", publicName: "mode", 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 }, snap: { classPropertyName: "snap", publicName: "snap", isSignal: true, isRequired: false, transformFunction: null }, tooltipMode: { classPropertyName: "tooltipMode", publicName: "tooltipMode", isSignal: true, isRequired: false, transformFunction: null }, snapMode: { classPropertyName: "snapMode", publicName: "snapMode", isSignal: true, isRequired: false, transformFunction: null }, hasSnap: { classPropertyName: "hasSnap", publicName: "hasSnap", isSignal: true, isRequired: false, transformFunction: null }, hasLable: { classPropertyName: "hasLable", publicName: "hasLable", isSignal: true, isRequired: false, transformFunction: null }, hasTooltip: { classPropertyName: "hasTooltip", publicName: "hasTooltip", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { onStart: "onStart", values: "valuesChange" }, host: { listeners: { "wheel": "onWheel($event)" }, properties: { "class": "this.__hostClass" } }, providers: [
|
587
|
+
{ provide: AXValuableComponent, useExisting: AXRangeSliderComponent },
|
588
|
+
{
|
589
|
+
provide: NG_VALUE_ACCESSOR,
|
590
|
+
useExisting: forwardRef(() => AXRangeSliderComponent),
|
591
|
+
multi: true,
|
592
|
+
},
|
593
|
+
], usesInheritance: true, ngImport: i0, template: "<div class=\"ax-range-slider\" [class]=\"'ax-orientation-' + orientation()\">\n <div class=\"ax-range-slider-bar\" (mousedown)=\"onclickBar($event)\" (touchstart)=\"onclickBar($event)\"></div>\n <div class=\"ax-range-slider-highlight\" [ngStyle]=\"AXRangeSliderHighlight()\"></div>\n\n <div\n class=\"ax-range-slider-handler\"\n [ngStyle]=\"AXRangeSliderHandler1()\"\n (mousedown)=\"handleOnStart($event, 'first')\"\n (touchstart)=\"handleOnStart($event, 'first')\"\n >\n @if (hasTooltip()) {\n <div class=\"ax-range-slider-tooltip\">{{ isDual() ? values()[0] : values() }}</div>\n }\n </div>\n\n @if (isDual()) {\n <div\n class=\"ax-range-slider-handler\"\n [ngStyle]=\"AXRangeSliderHandler2()\"\n (mousedown)=\"handleOnStart($event, 'second')\"\n (touchstart)=\"handleOnStart($event, 'second')\"\n >\n @if (hasTooltip()) {\n <div class=\"ax-range-slider-tooltip\">{{ values()[1] }}</div>\n }\n </div>\n }\n @if (hasSnap()) {\n <div class=\"ax-range-slider-step\" [ngStyle]=\"AXRangeSliderStep()\">\n @for (item of calculateSnapBar(); track $index) {\n <div\n class=\"ax-range-slider-steps\"\n [ngStyle]=\"\n isHorizontal() ? { left: getPercantage(item) + '%' } : { top: getPercantage(item) + '%' }\n \"\n >\n @if (hasLable()) {\n <div class=\"ax-range-slider-label\" [ngStyle]=\"AXRangeLabel()\">\n {{ item + min() }}\n </div>\n }\n </div>\n }\n </div>\n }\n</div>\n", styles: [":root{--ax-range-slider-base-thickness: .25rem}ax-range-slider{display:flex;align-items:center;justify-content:center;padding:1rem;font-size:small}ax-range-slider .ax-range-slider.ax-orientation-horizontal{position:relative;width:100%;height:calc(var(--ax-range-slider-base-thickness) * 4)}ax-range-slider .ax-range-slider.ax-orientation-horizontal .ax-range-slider-bar{position:absolute;top:50%;left:0;width:100.1%;height:var(--ax-range-slider-base-thickness);transform:translateY(-50%);z-index:20;border-radius:9999rem;background-color:rgb(var(--ax-range-slider-bg));cursor:pointer}ax-range-slider .ax-range-slider.ax-orientation-horizontal .ax-range-slider-highlight{position:absolute;top:50%;height:calc(var(--ax-range-slider-base-thickness) * 3 / 2);transform:translateY(-50%);z-index:20;border-radius:9999rem;background-color:rgb(var(--ax-range-slider-fg))}ax-range-slider .ax-range-slider.ax-orientation-horizontal .ax-range-slider-handler{position:absolute;top:50%;width:calc(var(--ax-range-slider-base-thickness) * 6);height:calc(var(--ax-range-slider-base-thickness) * 6);z-index:20;background-color:rgb(var(--ax-range-slider-fg));border-radius:50%;cursor:pointer;transform:translate(-50%,-50%);transition:box-shadow .1s linear}ax-range-slider .ax-range-slider.ax-orientation-horizontal .ax-range-slider-handler:hover{box-shadow:var(--tw-ring-inset) 0 0 0 calc(.6rem + var(--tw-ring-offset-width)) rgba(var(--ax-range-slider-fg),.25)}ax-range-slider .ax-range-slider.ax-orientation-horizontal .ax-range-slider-handler:active{box-shadow:var(--tw-ring-inset) 0 0 0 calc(.6rem + var(--tw-ring-offset-width)) rgba(var(--ax-range-slider-fg),.25)}ax-range-slider .ax-range-slider.ax-orientation-horizontal .ax-range-slider-tooltip{position:absolute;left:calc(var(--ax-range-slider-base-thickness) * 2.8);top:calc(var(--ax-range-slider-base-thickness) * -2);background-color:rgb(var(--ax-range-slider-fg));color:rgb(var(--ax-range-tooltip-text));padding:5px 10px;border-radius:3px;white-space:nowrap;font-weight:600;transform:translate(-50%,-125%)}ax-range-slider .ax-range-slider.ax-orientation-horizontal .ax-range-slider-tooltip:after{content:\"\";position:absolute;top:calc(var(--ax-range-slider-base-thickness) * 7);left:50%;transform:translate(-50%);border-width:.5rem;border-style:solid;border-color:rgb(var(--ax-range-slider-fg)) transparent transparent transparent}ax-range-slider .ax-range-slider.ax-orientation-horizontal .ax-range-slider-step{position:absolute;display:flex;flex-direction:row;width:100%;z-index:10}ax-range-slider .ax-range-slider.ax-orientation-horizontal .ax-range-slider-step .ax-range-slider-steps{position:absolute;border-left:calc(var(--ax-range-slider-base-thickness) / 2) solid rgb(var(--ax-color-border-default));height:50%}ax-range-slider .ax-range-slider.ax-orientation-horizontal .ax-range-slider-step .ax-range-slider-steps .ax-range-slider-label{position:relative;text-align:center;top:calc(var(--ax-range-slider-base-thickness) * 2);left:-50%}ax-range-slider .ax-range-slider.ax-orientation-vertical{position:relative;width:calc(var(--ax-range-slider-base-thickness) * 4);height:100%}ax-range-slider .ax-range-slider.ax-orientation-vertical .ax-range-slider-bar{position:absolute;top:0;left:50%;width:var(--ax-range-slider-base-thickness);height:100.1%;transform:translate(-50%);z-index:20;border-radius:9999rem;background-color:rgb(var(--ax-range-slider-bg));cursor:pointer}ax-range-slider .ax-range-slider.ax-orientation-vertical .ax-range-slider-highlight{position:absolute;left:50%;width:calc(var(--ax-range-slider-base-thickness) * 3 / 2);transform:translate(-50%);z-index:20;border-radius:9999rem;background-color:rgb(var(--ax-range-slider-fg))}ax-range-slider .ax-range-slider.ax-orientation-vertical .ax-range-slider-handler{position:absolute;left:50%;width:calc(var(--ax-range-slider-base-thickness) * 6);height:calc(var(--ax-range-slider-base-thickness) * 6);z-index:20;background-color:rgb(var(--ax-range-slider-fg));border-radius:50%;cursor:pointer;transform:translate(-50%,-50%);transition:background-color .2s ease}ax-range-slider .ax-range-slider.ax-orientation-vertical .ax-range-slider-handler:active{border:1px solid transparent;box-shadow:var(--tw-ring-inset) 0 0 0 calc(.5rem + var(--tw-ring-offset-width)) rgba(var(--ax-range-slider-fg),.25)}ax-range-slider .ax-range-slider.ax-orientation-vertical .ax-range-slider-tooltip{position:absolute;top:calc(var(--ax-range-slider-base-thickness) * 8.5);left:calc(var(--ax-range-slider-base-thickness) * -8);background-color:rgb(var(--ax-range-slider-fg));color:rgb(var(--ax-range-tooltip-text));padding:5px 10px;border-radius:3px;font-weight:600;white-space:nowrap;transform:translate(-50%,-125%)}ax-range-slider .ax-range-slider.ax-orientation-vertical .ax-range-slider-tooltip:after{content:\"\";position:absolute;top:50%;left:97%;transform:translateY(-50%);border-width:.5rem;border-style:solid;border-color:transparent transparent transparent rgb(var(--ax-range-slider-fg))}ax-range-slider .ax-range-slider.ax-orientation-vertical .ax-range-slider-step{position:absolute;display:flex;flex-direction:column;height:100%;z-index:10}ax-range-slider .ax-range-slider.ax-orientation-vertical .ax-range-slider-step .ax-range-slider-steps{position:absolute;width:50%;border-top:calc(var(--ax-range-slider-base-thickness) / 2) solid rgb(var(--ax-color-border-default))}ax-range-slider .ax-range-slider.ax-orientation-vertical .ax-range-slider-step .ax-range-slider-steps .ax-range-slider-label{position:absolute;left:150%;top:calc(var(--ax-range-slider-base-thickness) * -3)}ax-range-slider.ax-primary-solid{--ax-range-slider-bg: var(--ax-color-primary-200);--ax-range-slider-fg: var(--ax-color-primary-500);--ax-range-tooltip-text: var(--ax-color-primary-fore)}ax-range-slider.ax-secondary-solid{--ax-range-slider-bg: var(--ax-color-secondary-200);--ax-range-slider-fg: var(--ax-color-secondary-500);--ax-range-tooltip-text: var(--ax-color-secondary-fore)}ax-range-slider.ax-success-solid{--ax-range-slider-bg: var(--ax-color-success-200);--ax-range-slider-fg: var(--ax-color-success-500);--ax-range-tooltip-text: var(--ax-color-success-fore)}ax-range-slider.ax-warning-solid{--ax-range-slider-bg: var(--ax-color-warning-200);--ax-range-slider-fg: var(--ax-color-warning-500);--ax-range-tooltip-text: var(--ax-color-warning-fore)}ax-range-slider.ax-danger-solid{--ax-range-slider-bg: var(--ax-color-danger-200);--ax-range-slider-fg: var(--ax-color-danger-500);--ax-range-tooltip-text: var(--ax-color-danger-fore)}ax-range-slider.ax-info-solid{--ax-range-slider-bg: var(--ax-color-info-200);--ax-range-slider-fg: var(--ax-color-info-500);--ax-range-tooltip-text: var(--ax-color-info-fore)}ax-range-slider.ax-state-disabled{opacity:.5;cursor:not-allowed}ax-range-slider.ax-state-readonly{opacity:.75}.ax-dark ax-range-slider.ax-primary-solid{--ax-range-slider-bg: var(--ax-color-primary-700);--ax-range-slider-fg: var(--ax-color-primary-200);--ax-range-tooltip-text: var(--ax-color-primary-fore-tint)}.ax-dark ax-range-slider.ax-secondary-solid{--ax-range-slider-bg: var(--ax-color-secondary-700);--ax-range-slider-fg: var(--ax-color-secondary-200);--ax-range-tooltip-text: var(--ax-color-secondary-fore-tint)}.ax-dark ax-range-slider.ax-success-solid{--ax-range-slider-bg: var(--ax-color-success-700);--ax-range-slider-fg: var(--ax-color-success-200);--ax-range-tooltip-text: var(--ax-color-success-fore-tint)}.ax-dark ax-range-slider.ax-warning-solid{--ax-range-slider-bg: var(--ax-color-warning-700);--ax-range-slider-fg: var(--ax-color-warning-200);--ax-range-tooltip-text: var(--ax-color-warning-fore-tint)}.ax-dark ax-range-slider.ax-danger-solid{--ax-range-slider-bg: var(--ax-color-danger-700);--ax-range-slider-fg: var(--ax-color-danger-200);--ax-range-tooltip-text: var(--ax-color-danger-fore-tint)}.ax-dark ax-range-slider.ax-info-solid{--ax-range-slider-bg: var(--ax-color-info-700);--ax-range-slider-fg: var(--ax-color-info-200);--ax-range-tooltip-text: var(--ax-color-info-fore-tint)}\n"], dependencies: [{ kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
12
594
|
}
|
13
595
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: AXRangeSliderComponent, decorators: [{
|
14
596
|
type: Component,
|
15
|
-
args: [{ selector: 'ax-range-slider',
|
16
|
-
|
597
|
+
args: [{ selector: 'ax-range-slider', inputs: ['disabled', 'readonly'], encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, providers: [
|
598
|
+
{ provide: AXValuableComponent, useExisting: AXRangeSliderComponent },
|
599
|
+
{
|
600
|
+
provide: NG_VALUE_ACCESSOR,
|
601
|
+
useExisting: forwardRef(() => AXRangeSliderComponent),
|
602
|
+
multi: true,
|
603
|
+
},
|
604
|
+
], template: "<div class=\"ax-range-slider\" [class]=\"'ax-orientation-' + orientation()\">\n <div class=\"ax-range-slider-bar\" (mousedown)=\"onclickBar($event)\" (touchstart)=\"onclickBar($event)\"></div>\n <div class=\"ax-range-slider-highlight\" [ngStyle]=\"AXRangeSliderHighlight()\"></div>\n\n <div\n class=\"ax-range-slider-handler\"\n [ngStyle]=\"AXRangeSliderHandler1()\"\n (mousedown)=\"handleOnStart($event, 'first')\"\n (touchstart)=\"handleOnStart($event, 'first')\"\n >\n @if (hasTooltip()) {\n <div class=\"ax-range-slider-tooltip\">{{ isDual() ? values()[0] : values() }}</div>\n }\n </div>\n\n @if (isDual()) {\n <div\n class=\"ax-range-slider-handler\"\n [ngStyle]=\"AXRangeSliderHandler2()\"\n (mousedown)=\"handleOnStart($event, 'second')\"\n (touchstart)=\"handleOnStart($event, 'second')\"\n >\n @if (hasTooltip()) {\n <div class=\"ax-range-slider-tooltip\">{{ values()[1] }}</div>\n }\n </div>\n }\n @if (hasSnap()) {\n <div class=\"ax-range-slider-step\" [ngStyle]=\"AXRangeSliderStep()\">\n @for (item of calculateSnapBar(); track $index) {\n <div\n class=\"ax-range-slider-steps\"\n [ngStyle]=\"\n isHorizontal() ? { left: getPercantage(item) + '%' } : { top: getPercantage(item) + '%' }\n \"\n >\n @if (hasLable()) {\n <div class=\"ax-range-slider-label\" [ngStyle]=\"AXRangeLabel()\">\n {{ item + min() }}\n </div>\n }\n </div>\n }\n </div>\n }\n</div>\n", styles: [":root{--ax-range-slider-base-thickness: .25rem}ax-range-slider{display:flex;align-items:center;justify-content:center;padding:1rem;font-size:small}ax-range-slider .ax-range-slider.ax-orientation-horizontal{position:relative;width:100%;height:calc(var(--ax-range-slider-base-thickness) * 4)}ax-range-slider .ax-range-slider.ax-orientation-horizontal .ax-range-slider-bar{position:absolute;top:50%;left:0;width:100.1%;height:var(--ax-range-slider-base-thickness);transform:translateY(-50%);z-index:20;border-radius:9999rem;background-color:rgb(var(--ax-range-slider-bg));cursor:pointer}ax-range-slider .ax-range-slider.ax-orientation-horizontal .ax-range-slider-highlight{position:absolute;top:50%;height:calc(var(--ax-range-slider-base-thickness) * 3 / 2);transform:translateY(-50%);z-index:20;border-radius:9999rem;background-color:rgb(var(--ax-range-slider-fg))}ax-range-slider .ax-range-slider.ax-orientation-horizontal .ax-range-slider-handler{position:absolute;top:50%;width:calc(var(--ax-range-slider-base-thickness) * 6);height:calc(var(--ax-range-slider-base-thickness) * 6);z-index:20;background-color:rgb(var(--ax-range-slider-fg));border-radius:50%;cursor:pointer;transform:translate(-50%,-50%);transition:box-shadow .1s linear}ax-range-slider .ax-range-slider.ax-orientation-horizontal .ax-range-slider-handler:hover{box-shadow:var(--tw-ring-inset) 0 0 0 calc(.6rem + var(--tw-ring-offset-width)) rgba(var(--ax-range-slider-fg),.25)}ax-range-slider .ax-range-slider.ax-orientation-horizontal .ax-range-slider-handler:active{box-shadow:var(--tw-ring-inset) 0 0 0 calc(.6rem + var(--tw-ring-offset-width)) rgba(var(--ax-range-slider-fg),.25)}ax-range-slider .ax-range-slider.ax-orientation-horizontal .ax-range-slider-tooltip{position:absolute;left:calc(var(--ax-range-slider-base-thickness) * 2.8);top:calc(var(--ax-range-slider-base-thickness) * -2);background-color:rgb(var(--ax-range-slider-fg));color:rgb(var(--ax-range-tooltip-text));padding:5px 10px;border-radius:3px;white-space:nowrap;font-weight:600;transform:translate(-50%,-125%)}ax-range-slider .ax-range-slider.ax-orientation-horizontal .ax-range-slider-tooltip:after{content:\"\";position:absolute;top:calc(var(--ax-range-slider-base-thickness) * 7);left:50%;transform:translate(-50%);border-width:.5rem;border-style:solid;border-color:rgb(var(--ax-range-slider-fg)) transparent transparent transparent}ax-range-slider .ax-range-slider.ax-orientation-horizontal .ax-range-slider-step{position:absolute;display:flex;flex-direction:row;width:100%;z-index:10}ax-range-slider .ax-range-slider.ax-orientation-horizontal .ax-range-slider-step .ax-range-slider-steps{position:absolute;border-left:calc(var(--ax-range-slider-base-thickness) / 2) solid rgb(var(--ax-color-border-default));height:50%}ax-range-slider .ax-range-slider.ax-orientation-horizontal .ax-range-slider-step .ax-range-slider-steps .ax-range-slider-label{position:relative;text-align:center;top:calc(var(--ax-range-slider-base-thickness) * 2);left:-50%}ax-range-slider .ax-range-slider.ax-orientation-vertical{position:relative;width:calc(var(--ax-range-slider-base-thickness) * 4);height:100%}ax-range-slider .ax-range-slider.ax-orientation-vertical .ax-range-slider-bar{position:absolute;top:0;left:50%;width:var(--ax-range-slider-base-thickness);height:100.1%;transform:translate(-50%);z-index:20;border-radius:9999rem;background-color:rgb(var(--ax-range-slider-bg));cursor:pointer}ax-range-slider .ax-range-slider.ax-orientation-vertical .ax-range-slider-highlight{position:absolute;left:50%;width:calc(var(--ax-range-slider-base-thickness) * 3 / 2);transform:translate(-50%);z-index:20;border-radius:9999rem;background-color:rgb(var(--ax-range-slider-fg))}ax-range-slider .ax-range-slider.ax-orientation-vertical .ax-range-slider-handler{position:absolute;left:50%;width:calc(var(--ax-range-slider-base-thickness) * 6);height:calc(var(--ax-range-slider-base-thickness) * 6);z-index:20;background-color:rgb(var(--ax-range-slider-fg));border-radius:50%;cursor:pointer;transform:translate(-50%,-50%);transition:background-color .2s ease}ax-range-slider .ax-range-slider.ax-orientation-vertical .ax-range-slider-handler:active{border:1px solid transparent;box-shadow:var(--tw-ring-inset) 0 0 0 calc(.5rem + var(--tw-ring-offset-width)) rgba(var(--ax-range-slider-fg),.25)}ax-range-slider .ax-range-slider.ax-orientation-vertical .ax-range-slider-tooltip{position:absolute;top:calc(var(--ax-range-slider-base-thickness) * 8.5);left:calc(var(--ax-range-slider-base-thickness) * -8);background-color:rgb(var(--ax-range-slider-fg));color:rgb(var(--ax-range-tooltip-text));padding:5px 10px;border-radius:3px;font-weight:600;white-space:nowrap;transform:translate(-50%,-125%)}ax-range-slider .ax-range-slider.ax-orientation-vertical .ax-range-slider-tooltip:after{content:\"\";position:absolute;top:50%;left:97%;transform:translateY(-50%);border-width:.5rem;border-style:solid;border-color:transparent transparent transparent rgb(var(--ax-range-slider-fg))}ax-range-slider .ax-range-slider.ax-orientation-vertical .ax-range-slider-step{position:absolute;display:flex;flex-direction:column;height:100%;z-index:10}ax-range-slider .ax-range-slider.ax-orientation-vertical .ax-range-slider-step .ax-range-slider-steps{position:absolute;width:50%;border-top:calc(var(--ax-range-slider-base-thickness) / 2) solid rgb(var(--ax-color-border-default))}ax-range-slider .ax-range-slider.ax-orientation-vertical .ax-range-slider-step .ax-range-slider-steps .ax-range-slider-label{position:absolute;left:150%;top:calc(var(--ax-range-slider-base-thickness) * -3)}ax-range-slider.ax-primary-solid{--ax-range-slider-bg: var(--ax-color-primary-200);--ax-range-slider-fg: var(--ax-color-primary-500);--ax-range-tooltip-text: var(--ax-color-primary-fore)}ax-range-slider.ax-secondary-solid{--ax-range-slider-bg: var(--ax-color-secondary-200);--ax-range-slider-fg: var(--ax-color-secondary-500);--ax-range-tooltip-text: var(--ax-color-secondary-fore)}ax-range-slider.ax-success-solid{--ax-range-slider-bg: var(--ax-color-success-200);--ax-range-slider-fg: var(--ax-color-success-500);--ax-range-tooltip-text: var(--ax-color-success-fore)}ax-range-slider.ax-warning-solid{--ax-range-slider-bg: var(--ax-color-warning-200);--ax-range-slider-fg: var(--ax-color-warning-500);--ax-range-tooltip-text: var(--ax-color-warning-fore)}ax-range-slider.ax-danger-solid{--ax-range-slider-bg: var(--ax-color-danger-200);--ax-range-slider-fg: var(--ax-color-danger-500);--ax-range-tooltip-text: var(--ax-color-danger-fore)}ax-range-slider.ax-info-solid{--ax-range-slider-bg: var(--ax-color-info-200);--ax-range-slider-fg: var(--ax-color-info-500);--ax-range-tooltip-text: var(--ax-color-info-fore)}ax-range-slider.ax-state-disabled{opacity:.5;cursor:not-allowed}ax-range-slider.ax-state-readonly{opacity:.75}.ax-dark ax-range-slider.ax-primary-solid{--ax-range-slider-bg: var(--ax-color-primary-700);--ax-range-slider-fg: var(--ax-color-primary-200);--ax-range-tooltip-text: var(--ax-color-primary-fore-tint)}.ax-dark ax-range-slider.ax-secondary-solid{--ax-range-slider-bg: var(--ax-color-secondary-700);--ax-range-slider-fg: var(--ax-color-secondary-200);--ax-range-tooltip-text: var(--ax-color-secondary-fore-tint)}.ax-dark ax-range-slider.ax-success-solid{--ax-range-slider-bg: var(--ax-color-success-700);--ax-range-slider-fg: var(--ax-color-success-200);--ax-range-tooltip-text: var(--ax-color-success-fore-tint)}.ax-dark ax-range-slider.ax-warning-solid{--ax-range-slider-bg: var(--ax-color-warning-700);--ax-range-slider-fg: var(--ax-color-warning-200);--ax-range-tooltip-text: var(--ax-color-warning-fore-tint)}.ax-dark ax-range-slider.ax-danger-solid{--ax-range-slider-bg: var(--ax-color-danger-700);--ax-range-slider-fg: var(--ax-color-danger-200);--ax-range-tooltip-text: var(--ax-color-danger-fore-tint)}.ax-dark ax-range-slider.ax-info-solid{--ax-range-slider-bg: var(--ax-color-info-700);--ax-range-slider-fg: var(--ax-color-info-200);--ax-range-tooltip-text: var(--ax-color-info-fore-tint)}\n"] }]
|
605
|
+
}], ctorParameters: () => [], propDecorators: { onWheel: [{
|
606
|
+
type: HostListener,
|
607
|
+
args: ['wheel', ['$event']]
|
608
|
+
}], __hostClass: [{
|
609
|
+
type: HostBinding,
|
610
|
+
args: ['class']
|
611
|
+
}] } });
|
17
612
|
|
18
613
|
class AXRangeSliderModule {
|
19
614
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: AXRangeSliderModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
20
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.2.0", ngImport: i0, type: AXRangeSliderModule, declarations: [AXRangeSliderComponent], imports: [CommonModule] }); }
|
615
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.2.0", ngImport: i0, type: AXRangeSliderModule, declarations: [AXRangeSliderComponent], imports: [CommonModule], exports: [AXRangeSliderComponent] }); }
|
21
616
|
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: AXRangeSliderModule, imports: [CommonModule] }); }
|
22
617
|
}
|
23
618
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: AXRangeSliderModule, decorators: [{
|
@@ -25,6 +620,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImpor
|
|
25
620
|
args: [{
|
26
621
|
declarations: [AXRangeSliderComponent],
|
27
622
|
imports: [CommonModule],
|
623
|
+
exports: [AXRangeSliderComponent],
|
28
624
|
}]
|
29
625
|
}] });
|
30
626
|
|
@@ -32,5 +628,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImpor
|
|
32
628
|
* Generated bundle index. Do not edit.
|
33
629
|
*/
|
34
630
|
|
35
|
-
export { AXRangeSliderModule };
|
631
|
+
export { AXRangeSliderComponent, AXRangeSliderModule };
|
36
632
|
//# sourceMappingURL=acorex-components-range-slider.mjs.map
|