@acorex/components 18.8.2 → 18.8.4
Sign up to get free protection for your applications and to get access to all the features.
- package/action-sheet/lib/action-sheet.component.d.ts +3 -12
- package/esm2022/action-sheet/lib/action-sheet.component.mjs +13 -22
- package/esm2022/color-palette/lib/color-palette-input.component.mjs +1 -1
- package/esm2022/color-palette/lib/color-palette-picker.component.mjs +4 -4
- package/esm2022/color-palette/lib/color-palette.component.mjs +2 -2
- package/esm2022/common/lib/components/value-component.class.mjs +1 -1
- package/esm2022/conversation/lib/conversation-messages/conversation-message-audio/conversation-message-audio.component.mjs +1 -1
- package/esm2022/data-pager/lib/data-pager-input-selector.component.mjs +1 -1
- package/esm2022/number-box/lib/number-box.component.mjs +55 -29
- package/esm2022/paint/lib/paint/paint-tools/paint-color-picker/paint-color-picker.component.mjs +3 -3
- package/esm2022/paint/lib/paint/paint-tools/paint-pen-cap/paint-pen-cap.component.mjs +3 -3
- package/esm2022/paint/lib/paint/paint-tools/paint-pen-mode-changer/paint-pen-mode-changer.component.mjs +1 -1
- package/esm2022/paint/lib/paint/paint-view/paint-view.component.mjs +4 -3
- package/esm2022/phone-box/lib/phone-box.component.mjs +3 -3
- package/esm2022/range-slider/lib/range-slider.class.mjs +1 -1
- package/esm2022/range-slider/lib/range-slider.component.mjs +159 -134
- package/esm2022/wysiwyg/lib/wysiwyg/wysiwyg-container/wysiwyg-container.component.mjs +7 -1
- package/esm2022/wysiwyg/lib/wysiwyg/wysiwyg-tools/wysiwyg-colors/wysiwyg-colors.component.mjs +29 -9
- package/esm2022/wysiwyg/lib/wysiwyg/wysiwyg-tools/wysiwyg-insert/wysiwyg-insert.component.mjs +3 -3
- package/esm2022/wysiwyg/lib/wysiwyg/wysiwyg.service.mjs +2 -1
- package/fesm2022/acorex-components-action-sheet.mjs +12 -21
- package/fesm2022/acorex-components-action-sheet.mjs.map +1 -1
- package/fesm2022/acorex-components-color-palette.mjs +6 -6
- package/fesm2022/acorex-components-color-palette.mjs.map +1 -1
- package/fesm2022/acorex-components-common.mjs.map +1 -1
- package/fesm2022/acorex-components-conversation.mjs +1 -1
- package/fesm2022/acorex-components-conversation.mjs.map +1 -1
- package/fesm2022/acorex-components-data-pager.mjs +1 -1
- package/fesm2022/acorex-components-data-pager.mjs.map +1 -1
- package/fesm2022/acorex-components-number-box.mjs +54 -28
- package/fesm2022/acorex-components-number-box.mjs.map +1 -1
- package/fesm2022/acorex-components-paint.mjs +8 -7
- package/fesm2022/acorex-components-paint.mjs.map +1 -1
- package/fesm2022/acorex-components-phone-box.mjs +2 -2
- package/fesm2022/acorex-components-phone-box.mjs.map +1 -1
- package/fesm2022/acorex-components-range-slider.mjs +157 -132
- package/fesm2022/acorex-components-range-slider.mjs.map +1 -1
- package/fesm2022/acorex-components-wysiwyg.mjs +36 -9
- package/fesm2022/acorex-components-wysiwyg.mjs.map +1 -1
- package/number-box/lib/number-box.component.d.ts +35 -30
- package/package.json +31 -31
- package/range-slider/lib/range-slider.class.d.ts +1 -0
- package/range-slider/lib/range-slider.component.d.ts +43 -11
- package/wysiwyg/lib/wysiwyg/wysiwyg-tools/wysiwyg-colors/wysiwyg-colors.component.d.ts +6 -2
- package/wysiwyg/lib/wysiwyg/wysiwyg.service.d.ts +1 -0
@@ -13,7 +13,6 @@ import { CommonModule } from '@angular/common';
|
|
13
13
|
* Range slider for selecting a range of values.
|
14
14
|
*/
|
15
15
|
class AXRangeSliderComponent extends classes((MXValueComponent)) {
|
16
|
-
//protected AXTooltip = computed(() => {});
|
17
16
|
constructor() {
|
18
17
|
super();
|
19
18
|
/**
|
@@ -66,6 +65,10 @@ class AXRangeSliderComponent extends classes((MXValueComponent)) {
|
|
66
65
|
* @description deferent modes for snap including start, end and both
|
67
66
|
*/
|
68
67
|
this.snapMode = input('start');
|
68
|
+
/**
|
69
|
+
* @description a flag for having step
|
70
|
+
*/
|
71
|
+
this.hasStep = input(true);
|
69
72
|
/**
|
70
73
|
* @description a flag for showing snap
|
71
74
|
*/
|
@@ -78,11 +81,30 @@ class AXRangeSliderComponent extends classes((MXValueComponent)) {
|
|
78
81
|
* @description a flag for showing tooltip for values
|
79
82
|
*/
|
80
83
|
this.hasTooltip = input(false);
|
84
|
+
/**
|
85
|
+
* @ignore
|
86
|
+
*/
|
81
87
|
this.height = 0.25;
|
88
|
+
/**
|
89
|
+
* @ignore
|
90
|
+
*/
|
82
91
|
this.newHeight = 'var(--ax-range-slider-base-thickness)';
|
92
|
+
/**
|
93
|
+
* @ignore
|
94
|
+
*/
|
83
95
|
this.range = computed(() => this.max() - this.min());
|
96
|
+
/**
|
97
|
+
* @ignore
|
98
|
+
*/
|
84
99
|
this.isHorizontal = computed(() => this.orientation() === 'horizontal');
|
100
|
+
/**
|
101
|
+
* @ignore
|
102
|
+
*/
|
85
103
|
this.isDual = computed(() => this.mode() === 'dual');
|
104
|
+
/**
|
105
|
+
* @ignore
|
106
|
+
*/
|
107
|
+
this.correctMinMax = computed(() => this.max() - this.min() > 0);
|
86
108
|
/**
|
87
109
|
* @ignore
|
88
110
|
*/
|
@@ -141,27 +163,31 @@ class AXRangeSliderComponent extends classes((MXValueComponent)) {
|
|
141
163
|
height: this.isDual()
|
142
164
|
? this.calculatePos()[1] - this.calculatePos()[0] + '%'
|
143
165
|
: this.calculatePos() + '%',
|
144
|
-
|
166
|
+
bottom: this.mode() === 'dual' ? this.calculatePos()[0] + '%' : '0%',
|
145
167
|
});
|
146
168
|
/**
|
147
169
|
* @ignore
|
148
170
|
*/
|
149
171
|
this.AXRangeSliderHandler1 = computed(() => this.isHorizontal()
|
150
172
|
? {
|
151
|
-
left: this.isDual()
|
173
|
+
left: this.isDual()
|
174
|
+
? this.calculatePos()[0] + 0.1 + '%'
|
175
|
+
: this.calculatePos() + 0.1 + '%',
|
152
176
|
}
|
153
177
|
: {
|
154
|
-
|
178
|
+
bottom: this.isDual()
|
179
|
+
? this.calculatePos()[0] - 5.4 + '%'
|
180
|
+
: this.calculatePos() - 5.4 + '%',
|
155
181
|
});
|
156
182
|
/**
|
157
183
|
* @ignore
|
158
184
|
*/
|
159
185
|
this.AXRangeSliderHandler2 = computed(() => this.isHorizontal()
|
160
186
|
? {
|
161
|
-
left: this.calculatePos()[1] + '%',
|
187
|
+
left: this.calculatePos()[1] + 0.1 + '%',
|
162
188
|
}
|
163
189
|
: {
|
164
|
-
|
190
|
+
bottom: this.calculatePos()[1] - 5.4 + '%',
|
165
191
|
});
|
166
192
|
/**
|
167
193
|
* @ignore
|
@@ -213,28 +239,42 @@ class AXRangeSliderComponent extends classes((MXValueComponent)) {
|
|
213
239
|
}
|
214
240
|
}
|
215
241
|
});
|
242
|
+
effect(() => this.commitValue(this.values()));
|
216
243
|
effect(() => {
|
217
|
-
this.
|
218
|
-
|
244
|
+
if (this.correctMinMax()) {
|
245
|
+
this.fixInitializeValues();
|
246
|
+
this.fixChangingMode();
|
247
|
+
}
|
248
|
+
else {
|
249
|
+
console.error(`Min = ${this.min()} And Max = ${this.max()} is not correct inputs.`);
|
250
|
+
}
|
219
251
|
}, { allowSignalWrites: true });
|
252
|
+
this.onValueChanged.subscribe((value) => {
|
253
|
+
this.values.set(value.value);
|
254
|
+
});
|
220
255
|
}
|
221
256
|
/**
|
222
257
|
* @ignore
|
223
258
|
*/
|
224
259
|
ngOnInit() {
|
225
|
-
//(window as any).rangeSlider = this; for debugging purpose only
|
226
260
|
super.ngOnInit();
|
227
|
-
|
261
|
+
//(window as any).rangeSlider = this; //for debugging purpose only
|
262
|
+
if (!this.correctMinMax()) {
|
263
|
+
console.error(`Min = ${this.min()} And Max = ${this.max()} is not correct inputs.`);
|
264
|
+
}
|
265
|
+
else {
|
266
|
+
this.initializeValues();
|
267
|
+
}
|
228
268
|
}
|
229
269
|
/**
|
230
270
|
* @ignore
|
231
271
|
*/
|
232
|
-
|
272
|
+
onStartHandler(event, circle) {
|
233
273
|
this.zone.runOutsideAngular(() => {
|
234
|
-
if (this.disabled)
|
274
|
+
if (this.disabled || this.readonly || !this.correctMinMax())
|
235
275
|
return;
|
236
276
|
event.preventDefault();
|
237
|
-
this.sliderElement = event.target.closest('ax-range-slider');
|
277
|
+
this.sliderElement = event.target.closest('.ax-range-slider');
|
238
278
|
if (this.sliderElement) {
|
239
279
|
this.choosenHandler = circle;
|
240
280
|
const moveListener = (moveEvent) => this.onMove(moveEvent, circle);
|
@@ -249,33 +289,30 @@ class AXRangeSliderComponent extends classes((MXValueComponent)) {
|
|
249
289
|
/**
|
250
290
|
* @ignore
|
251
291
|
*/
|
252
|
-
|
292
|
+
onStartBar(event) {
|
253
293
|
let circle = 'first';
|
254
|
-
this.sliderElement = event.target.closest('ax-range-slider');
|
294
|
+
this.sliderElement = event.target.closest('.ax-range-slider');
|
255
295
|
this.zone.runOutsideAngular(() => {
|
256
|
-
if (!this.sliderElement || this.disabled)
|
296
|
+
if (!this.sliderElement || this.disabled || !this.correctMinMax())
|
257
297
|
return;
|
258
|
-
const
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
298
|
+
const calculatePercent = this.calculatePercentOnMove(event);
|
299
|
+
let value = this.getValueFromPercent(calculatePercent);
|
300
|
+
value = Number.parseFloat(value.toFixed(2));
|
301
|
+
if (this.hasStep()) {
|
302
|
+
value = this.roundToStep(value);
|
303
|
+
}
|
263
304
|
if (this.isDual()) {
|
264
|
-
if (
|
265
|
-
this.values.set([
|
266
|
-
this.commitValue(this.values());
|
267
|
-
}
|
268
|
-
else if (clickPosition > this.calculatePos()[1]) {
|
305
|
+
if (value >= (this.values()[1] - this.values()[0]) / 2) {
|
306
|
+
this.values.set([this.values()[0], value]);
|
269
307
|
circle = 'second';
|
270
|
-
|
271
|
-
|
308
|
+
}
|
309
|
+
else {
|
310
|
+
this.values.set([value, this.values()[1]]);
|
311
|
+
circle = 'first';
|
272
312
|
}
|
273
313
|
}
|
274
314
|
else {
|
275
|
-
|
276
|
-
this.values.set(newValue);
|
277
|
-
this.commitValue(this.values());
|
278
|
-
}
|
315
|
+
this.values.set(value);
|
279
316
|
}
|
280
317
|
this.onStart.emit({
|
281
318
|
component: this,
|
@@ -284,64 +321,36 @@ class AXRangeSliderComponent extends classes((MXValueComponent)) {
|
|
284
321
|
data: this.values(),
|
285
322
|
});
|
286
323
|
});
|
287
|
-
this.
|
324
|
+
this.onStartHandler(event, circle);
|
288
325
|
}
|
289
326
|
/**
|
290
327
|
* @ignore
|
291
328
|
*/
|
292
329
|
onMove(event, circle) {
|
293
|
-
if (!this.sliderElement
|
330
|
+
if (!this.sliderElement)
|
294
331
|
return;
|
295
|
-
const
|
296
|
-
let
|
297
|
-
|
298
|
-
|
299
|
-
|
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()));
|
332
|
+
const calculatePercent = this.calculatePercentOnMove(event);
|
333
|
+
let value = this.getValueFromPercent(calculatePercent);
|
334
|
+
value = Number.parseFloat(value.toFixed(2));
|
335
|
+
if (this.hasStep()) {
|
336
|
+
value = this.roundToStep(value);
|
308
337
|
}
|
309
|
-
if (
|
310
|
-
if (this.
|
311
|
-
if (
|
312
|
-
|
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
|
-
}
|
338
|
+
if (this.isDual()) {
|
339
|
+
if (circle === 'first' && value < this.values()[1]) {
|
340
|
+
if (this.checkValues(value, 'first', this.values()[1]) && this.values()[0] !== value) {
|
341
|
+
this.values.set([value, this.values()[1]]);
|
328
342
|
}
|
329
343
|
}
|
330
|
-
else {
|
331
|
-
|
332
|
-
|
333
|
-
newValue = this.calculateStep(newValue);
|
334
|
-
if (this.values() !== newValue) {
|
335
|
-
this.values.set(newValue);
|
336
|
-
this.commitValue(newValue);
|
344
|
+
else if (circle === 'second' && value > this.values()[0] && this.values()[1] !== value) {
|
345
|
+
if (this.checkValues(value, 'second', this.values()[0])) {
|
346
|
+
this.values.set([this.values()[0], value]);
|
337
347
|
}
|
338
348
|
}
|
339
|
-
|
340
|
-
|
341
|
-
|
342
|
-
|
343
|
-
|
344
|
-
});
|
349
|
+
}
|
350
|
+
else {
|
351
|
+
if (this.checkValue(value) && this.values() !== value) {
|
352
|
+
this.values.set(value);
|
353
|
+
}
|
345
354
|
}
|
346
355
|
}
|
347
356
|
/**
|
@@ -373,27 +382,21 @@ class AXRangeSliderComponent extends classes((MXValueComponent)) {
|
|
373
382
|
else {
|
374
383
|
this.values.set(this.min());
|
375
384
|
}
|
376
|
-
this.commitValue(this.values());
|
377
385
|
}
|
378
386
|
}
|
379
387
|
/**
|
380
388
|
* @ignore
|
381
389
|
*/
|
382
390
|
fixInitializeValues() {
|
383
|
-
//swap value
|
384
391
|
if (this.isDual() && this.values()[0] > this.values()[1]) {
|
385
392
|
this.values.set([this.values()[1], this.values()[0]]);
|
386
|
-
this.commitValue(this.values());
|
387
393
|
}
|
388
|
-
//not in range
|
389
394
|
if (typeof this.values() === 'number' && !this.checkValue(this.values())) {
|
390
395
|
this.values.set(this.min());
|
391
|
-
this.commitValue(this.values());
|
392
396
|
}
|
393
397
|
else if (typeof this.values() !== 'number' &&
|
394
398
|
!this.checkValues(this.values()[0], 'first', this.values()[1])) {
|
395
399
|
this.values.set([this.min(), this.max()]);
|
396
|
-
this.commitValue(this.values());
|
397
400
|
}
|
398
401
|
}
|
399
402
|
/**
|
@@ -402,17 +405,13 @@ class AXRangeSliderComponent extends classes((MXValueComponent)) {
|
|
402
405
|
fixInitializeStep() {
|
403
406
|
if (this.step() !== 1) {
|
404
407
|
if (this.isDual()) {
|
405
|
-
this.values.update((old) => [this.
|
406
|
-
this.commitValue(this.values());
|
407
|
-
this.commitValue(this.values());
|
408
|
+
this.values.update((old) => [this.roundToStep(old[0]), this.roundToStep(old[1])]);
|
408
409
|
if (this.values()[0] === this.values()[1]) {
|
409
|
-
this.values.update((old) => [this.
|
410
|
-
this.commitValue(this.values());
|
410
|
+
this.values.update((old) => [this.roundToStep(old[0]), this.roundToStep(old[1]) + this.step()]);
|
411
411
|
}
|
412
412
|
}
|
413
413
|
else {
|
414
|
-
this.values.update((old) => this.
|
415
|
-
this.commitValue(this.values());
|
414
|
+
this.values.update((old) => this.roundToStep(old));
|
416
415
|
}
|
417
416
|
}
|
418
417
|
}
|
@@ -422,27 +421,47 @@ class AXRangeSliderComponent extends classes((MXValueComponent)) {
|
|
422
421
|
fixChangingMode() {
|
423
422
|
if (typeof this.values() === 'number' && this.isDual()) {
|
424
423
|
this.values.set([this.min(), this.max()]);
|
425
|
-
this.commitValue(this.values());
|
426
424
|
}
|
427
425
|
else if (typeof this.values() !== 'number' && !this.isDual()) {
|
428
426
|
this.values.set(this.min());
|
429
|
-
this.commitValue(this.values());
|
430
427
|
}
|
431
428
|
}
|
432
429
|
/**
|
433
430
|
* @ignore
|
434
431
|
*/
|
435
|
-
|
436
|
-
const
|
437
|
-
|
438
|
-
|
439
|
-
|
440
|
-
|
441
|
-
|
442
|
-
|
443
|
-
|
444
|
-
|
445
|
-
|
432
|
+
calculatePercentOnMove(event) {
|
433
|
+
const sliderRect = this.sliderElement.getBoundingClientRect();
|
434
|
+
let percent;
|
435
|
+
if (this.isHorizontal()) {
|
436
|
+
const clientX = event instanceof MouseEvent ? event.clientX : event.touches[0].clientX;
|
437
|
+
const x = clientX - sliderRect.left;
|
438
|
+
percent = (x / sliderRect.width) * 100;
|
439
|
+
}
|
440
|
+
else {
|
441
|
+
const clientY = event instanceof MouseEvent ? event.clientY : event.touches[0].clientY;
|
442
|
+
const y = -(clientY - sliderRect.bottom); //reverce slider from bottom to top
|
443
|
+
percent = (y / sliderRect.height) * 100;
|
444
|
+
}
|
445
|
+
if (percent < 0) {
|
446
|
+
percent = 0;
|
447
|
+
}
|
448
|
+
else if (percent > 100) {
|
449
|
+
percent = 100;
|
450
|
+
}
|
451
|
+
return percent;
|
452
|
+
}
|
453
|
+
/**
|
454
|
+
* @ignore
|
455
|
+
*/
|
456
|
+
roundToStep(value) {
|
457
|
+
const lower = Math.max(this.min(), Math.floor((value - this.min()) / this.step()) * this.step() + this.min());
|
458
|
+
const upper = Math.min(this.max(), lower + this.step());
|
459
|
+
if (value - lower < upper - value) {
|
460
|
+
return lower;
|
461
|
+
}
|
462
|
+
else {
|
463
|
+
return upper;
|
464
|
+
}
|
446
465
|
}
|
447
466
|
/**
|
448
467
|
* @ignore
|
@@ -474,11 +493,17 @@ class AXRangeSliderComponent extends classes((MXValueComponent)) {
|
|
474
493
|
else
|
475
494
|
return false;
|
476
495
|
}
|
496
|
+
/**
|
497
|
+
* @ignore
|
498
|
+
*/
|
499
|
+
getValueFromPercent(value) {
|
500
|
+
return this.min() + (value * (this.max() - this.min())) / 100;
|
501
|
+
}
|
477
502
|
/**
|
478
503
|
* @ignore
|
479
504
|
*/
|
480
505
|
getPercantage(value) {
|
481
|
-
return (value / this.range()) * 100;
|
506
|
+
return this.range() !== 0 ? (value / this.range()) * 100 : 0;
|
482
507
|
}
|
483
508
|
/**
|
484
509
|
* Increase a step to value if slider in single mode
|
@@ -487,11 +512,11 @@ class AXRangeSliderComponent extends classes((MXValueComponent)) {
|
|
487
512
|
*/
|
488
513
|
increaseStep() {
|
489
514
|
if (this.isDual()) {
|
490
|
-
const newValue = this.
|
515
|
+
const newValue = this.roundToStep(this.values()[1] + this.step());
|
491
516
|
this.values.set([this.values()[0], newValue]);
|
492
517
|
}
|
493
518
|
else {
|
494
|
-
const newValue = this.
|
519
|
+
const newValue = this.roundToStep(this.values() + this.step());
|
495
520
|
this.values.set(newValue);
|
496
521
|
}
|
497
522
|
}
|
@@ -502,11 +527,11 @@ class AXRangeSliderComponent extends classes((MXValueComponent)) {
|
|
502
527
|
*/
|
503
528
|
decreaseStep() {
|
504
529
|
if (this.isDual()) {
|
505
|
-
const newValue = this.
|
530
|
+
const newValue = this.roundToStep(this.values()[0] - this.step());
|
506
531
|
this.values.set([newValue, this.values()[1]]);
|
507
532
|
}
|
508
533
|
else {
|
509
|
-
const newValue = this.
|
534
|
+
const newValue = this.roundToStep(this.values() - this.step());
|
510
535
|
this.values.set(newValue);
|
511
536
|
}
|
512
537
|
}
|
@@ -516,57 +541,51 @@ class AXRangeSliderComponent extends classes((MXValueComponent)) {
|
|
516
541
|
onWheel(event) {
|
517
542
|
this.zone.runOutsideAngular(() => {
|
518
543
|
event.preventDefault();
|
519
|
-
if (!this.choosenHandler || this.readonly || this.disabled)
|
544
|
+
if (!this.choosenHandler || this.readonly || this.disabled || !this.correctMinMax())
|
520
545
|
return;
|
521
546
|
let newValue;
|
522
547
|
if (this.isDual()) {
|
523
548
|
if (event.deltaY < 0) {
|
524
549
|
if (this.choosenHandler === 'first') {
|
525
|
-
newValue = this.
|
550
|
+
newValue = this.roundToStep(this.values()[0] + this.step());
|
526
551
|
if (this.checkValues(newValue, this.choosenHandler, this.values()[1]) &&
|
527
552
|
this.values()[0] !== newValue) {
|
528
|
-
this.values.update((old) => [this.
|
529
|
-
this.commitValue(this.values());
|
553
|
+
this.values.update((old) => [this.roundToStep(old[0] + this.step()), old[1]]);
|
530
554
|
}
|
531
555
|
}
|
532
556
|
else {
|
533
|
-
newValue = this.
|
557
|
+
newValue = this.roundToStep(this.values()[1] + this.step());
|
534
558
|
if (newValue <= this.max() && this.values()[1] !== newValue) {
|
535
|
-
this.values.update((old) => [old[0], this.
|
536
|
-
this.commitValue(this.values());
|
559
|
+
this.values.update((old) => [old[0], this.roundToStep(old[1] + this.step())]);
|
537
560
|
}
|
538
561
|
}
|
539
562
|
}
|
540
563
|
else {
|
541
564
|
if (this.choosenHandler === 'first') {
|
542
|
-
newValue = this.
|
565
|
+
newValue = this.roundToStep(this.values()[0] - this.step());
|
543
566
|
if (this.checkValues(newValue, this.choosenHandler, this.values()[1]) &&
|
544
567
|
this.values() !== newValue) {
|
545
|
-
this.values.update((old) => [this.
|
546
|
-
this.commitValue(this.values());
|
568
|
+
this.values.update((old) => [this.roundToStep(old[0] - this.step()), old[1]]);
|
547
569
|
}
|
548
570
|
}
|
549
571
|
else {
|
550
|
-
newValue = this.
|
572
|
+
newValue = this.roundToStep(this.values()[1] - this.step());
|
551
573
|
if (this.checkValues(newValue, this.choosenHandler, this.values()[0]) &&
|
552
574
|
this.values()[1] !== newValue) {
|
553
|
-
this.values.update((old) => [old[0], this.
|
554
|
-
this.commitValue(this.values());
|
575
|
+
this.values.update((old) => [old[0], this.roundToStep(old[1] - this.step())]);
|
555
576
|
}
|
556
577
|
}
|
557
578
|
}
|
558
579
|
}
|
559
580
|
else {
|
560
581
|
if (event.deltaY < 0) {
|
561
|
-
if (this.checkValue(this.
|
562
|
-
this.values.update((old) => this.
|
563
|
-
this.commitValue(this.values());
|
582
|
+
if (this.checkValue(this.roundToStep(this.values() + this.step()))) {
|
583
|
+
this.values.update((old) => this.roundToStep(old + this.step()));
|
564
584
|
}
|
565
585
|
}
|
566
586
|
else {
|
567
|
-
if (this.checkValue(this.
|
568
|
-
this.values.update((old) => this.
|
569
|
-
this.commitValue(this.values());
|
587
|
+
if (this.checkValue(this.roundToStep(this.values() - this.step()))) {
|
588
|
+
this.values.update((old) => this.roundToStep(old - this.step()));
|
570
589
|
}
|
571
590
|
}
|
572
591
|
}
|
@@ -582,15 +601,18 @@ class AXRangeSliderComponent extends classes((MXValueComponent)) {
|
|
582
601
|
`${this.readonly ? 'ax-state-readonly' : ''}`,
|
583
602
|
];
|
584
603
|
}
|
604
|
+
onNgModelChange(event) {
|
605
|
+
this.values.set(event.value);
|
606
|
+
}
|
585
607
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: AXRangeSliderComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
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: [
|
608
|
+
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 }, hasStep: { classPropertyName: "hasStep", publicName: "hasStep", 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)", "onValueChanged": "onNgModelChange($event)" }, properties: { "class": "this.__hostClass" } }, providers: [
|
587
609
|
{ provide: AXValuableComponent, useExisting: AXRangeSliderComponent },
|
588
610
|
{
|
589
611
|
provide: NG_VALUE_ACCESSOR,
|
590
612
|
useExisting: forwardRef(() => AXRangeSliderComponent),
|
591
613
|
multi: true,
|
592
614
|
},
|
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 }); }
|
615
|
+
], usesInheritance: true, ngImport: i0, template: "@if (correctMinMax()) {\n <div class=\"ax-range-slider\" [class]=\"'ax-orientation-' + orientation()\">\n <div class=\"ax-range-slider-bar\" (mousedown)=\"onStartBar($event)\" (touchstart)=\"onStartBar($event)\"></div>\n <div\n class=\"ax-range-slider-highlight\"\n [ngStyle]=\"AXRangeSliderHighlight()\"\n (mousedown)=\"onStartBar($event)\"\n (touchstart)=\"onStartBar($event)\"\n ></div>\n\n <div\n class=\"ax-range-slider-handler\"\n [ngStyle]=\"AXRangeSliderHandler1()\"\n name=\"first\"\n (mousedown)=\"onStartHandler($event, 'first')\"\n (touchstart)=\"onStartHandler($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 name=\"second\"\n (mousedown)=\"onStartHandler($event, 'second')\"\n (touchstart)=\"onStartHandler($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) + '%' } : { bottom: 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}\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));cursor:pointer}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:#fff;border:1px solid gray;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));cursor:pointer}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:#fff;border:1px solid gray;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 }); }
|
594
616
|
}
|
595
617
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: AXRangeSliderComponent, decorators: [{
|
596
618
|
type: Component,
|
@@ -601,13 +623,16 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImpor
|
|
601
623
|
useExisting: forwardRef(() => AXRangeSliderComponent),
|
602
624
|
multi: true,
|
603
625
|
},
|
604
|
-
], template: "<div class=\"ax-range-slider\" [class]=\"'ax-orientation-' + orientation()\">\n
|
626
|
+
], template: "@if (correctMinMax()) {\n <div class=\"ax-range-slider\" [class]=\"'ax-orientation-' + orientation()\">\n <div class=\"ax-range-slider-bar\" (mousedown)=\"onStartBar($event)\" (touchstart)=\"onStartBar($event)\"></div>\n <div\n class=\"ax-range-slider-highlight\"\n [ngStyle]=\"AXRangeSliderHighlight()\"\n (mousedown)=\"onStartBar($event)\"\n (touchstart)=\"onStartBar($event)\"\n ></div>\n\n <div\n class=\"ax-range-slider-handler\"\n [ngStyle]=\"AXRangeSliderHandler1()\"\n name=\"first\"\n (mousedown)=\"onStartHandler($event, 'first')\"\n (touchstart)=\"onStartHandler($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 name=\"second\"\n (mousedown)=\"onStartHandler($event, 'second')\"\n (touchstart)=\"onStartHandler($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) + '%' } : { bottom: 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}\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));cursor:pointer}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:#fff;border:1px solid gray;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));cursor:pointer}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:#fff;border:1px solid gray;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
627
|
}], ctorParameters: () => [], propDecorators: { onWheel: [{
|
606
628
|
type: HostListener,
|
607
629
|
args: ['wheel', ['$event']]
|
608
630
|
}], __hostClass: [{
|
609
631
|
type: HostBinding,
|
610
632
|
args: ['class']
|
633
|
+
}], onNgModelChange: [{
|
634
|
+
type: HostListener,
|
635
|
+
args: ['onValueChanged', ['$event']]
|
611
636
|
}] } });
|
612
637
|
|
613
638
|
class AXRangeSliderModule {
|