@acorex/components 18.8.1 → 18.8.3
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-picker.component.mjs +8 -9
- 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/number-box/lib/number-box.component.mjs +47 -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 +156 -134
- package/esm2022/wysiwyg/lib/wysiwyg/wysiwyg-container/wysiwyg-container.component.mjs +8 -2
- package/esm2022/wysiwyg/lib/wysiwyg/wysiwyg-tools/wysiwyg-alignment/wysiwyg-alignment.component.mjs +4 -4
- package/esm2022/wysiwyg/lib/wysiwyg/wysiwyg-tools/wysiwyg-colors/wysiwyg-colors.component.mjs +33 -5
- package/esm2022/wysiwyg/lib/wysiwyg/wysiwyg-tools/wysiwyg-font-style/wysiwyg-font-style.component.mjs +1 -19
- package/esm2022/wysiwyg/lib/wysiwyg/wysiwyg-tools/wysiwyg-insert/wysiwyg-insert.component.mjs +3 -3
- package/esm2022/wysiwyg/lib/wysiwyg/wysiwyg-view/wysiwyg-view.component.mjs +18 -8
- 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 +7 -7
- 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-number-box.mjs +46 -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 +154 -132
- package/fesm2022/acorex-components-range-slider.mjs.map +1 -1
- package/fesm2022/acorex-components-wysiwyg.mjs +60 -33
- package/fesm2022/acorex-components-wysiwyg.mjs.map +1 -1
- package/number-box/lib/number-box.component.d.ts +30 -29
- package/package.json +54 -54
- 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 +8 -0
- package/wysiwyg/lib/wysiwyg/wysiwyg-tools/wysiwyg-font-style/wysiwyg-font-style.component.d.ts +0 -2
- package/wysiwyg/lib/wysiwyg/wysiwyg-view/wysiwyg-view.component.d.ts +3 -3
- 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,39 @@ 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 });
|
220
252
|
}
|
221
253
|
/**
|
222
254
|
* @ignore
|
223
255
|
*/
|
224
256
|
ngOnInit() {
|
225
|
-
//(window as any).rangeSlider = this; for debugging purpose only
|
226
257
|
super.ngOnInit();
|
227
|
-
|
258
|
+
//(window as any).rangeSlider = this; //for debugging purpose only
|
259
|
+
if (!this.correctMinMax()) {
|
260
|
+
console.error(`Min = ${this.min()} And Max = ${this.max()} is not correct inputs.`);
|
261
|
+
}
|
262
|
+
else {
|
263
|
+
this.initializeValues();
|
264
|
+
}
|
228
265
|
}
|
229
266
|
/**
|
230
267
|
* @ignore
|
231
268
|
*/
|
232
|
-
|
269
|
+
onStartHandler(event, circle) {
|
233
270
|
this.zone.runOutsideAngular(() => {
|
234
|
-
if (this.disabled)
|
271
|
+
if (this.disabled || this.readonly || !this.correctMinMax())
|
235
272
|
return;
|
236
273
|
event.preventDefault();
|
237
|
-
this.sliderElement = event.target.closest('ax-range-slider');
|
274
|
+
this.sliderElement = event.target.closest('.ax-range-slider');
|
238
275
|
if (this.sliderElement) {
|
239
276
|
this.choosenHandler = circle;
|
240
277
|
const moveListener = (moveEvent) => this.onMove(moveEvent, circle);
|
@@ -249,33 +286,30 @@ class AXRangeSliderComponent extends classes((MXValueComponent)) {
|
|
249
286
|
/**
|
250
287
|
* @ignore
|
251
288
|
*/
|
252
|
-
|
289
|
+
onStartBar(event) {
|
253
290
|
let circle = 'first';
|
254
|
-
this.sliderElement = event.target.closest('ax-range-slider');
|
291
|
+
this.sliderElement = event.target.closest('.ax-range-slider');
|
255
292
|
this.zone.runOutsideAngular(() => {
|
256
|
-
if (!this.sliderElement || this.disabled)
|
293
|
+
if (!this.sliderElement || this.disabled || !this.correctMinMax())
|
257
294
|
return;
|
258
|
-
const
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
295
|
+
const calculatePercent = this.calculatePercentOnMove(event);
|
296
|
+
let value = this.getValueFromPercent(calculatePercent);
|
297
|
+
value = Number.parseFloat(value.toFixed(2));
|
298
|
+
if (this.hasStep()) {
|
299
|
+
value = this.roundToStep(value);
|
300
|
+
}
|
263
301
|
if (this.isDual()) {
|
264
|
-
if (
|
265
|
-
this.values.set([
|
266
|
-
this.commitValue(this.values());
|
267
|
-
}
|
268
|
-
else if (clickPosition > this.calculatePos()[1]) {
|
302
|
+
if (value >= (this.values()[1] - this.values()[0]) / 2) {
|
303
|
+
this.values.set([this.values()[0], value]);
|
269
304
|
circle = 'second';
|
270
|
-
|
271
|
-
|
305
|
+
}
|
306
|
+
else {
|
307
|
+
this.values.set([value, this.values()[1]]);
|
308
|
+
circle = 'first';
|
272
309
|
}
|
273
310
|
}
|
274
311
|
else {
|
275
|
-
|
276
|
-
this.values.set(newValue);
|
277
|
-
this.commitValue(this.values());
|
278
|
-
}
|
312
|
+
this.values.set(value);
|
279
313
|
}
|
280
314
|
this.onStart.emit({
|
281
315
|
component: this,
|
@@ -284,64 +318,36 @@ class AXRangeSliderComponent extends classes((MXValueComponent)) {
|
|
284
318
|
data: this.values(),
|
285
319
|
});
|
286
320
|
});
|
287
|
-
this.
|
321
|
+
this.onStartHandler(event, circle);
|
288
322
|
}
|
289
323
|
/**
|
290
324
|
* @ignore
|
291
325
|
*/
|
292
326
|
onMove(event, circle) {
|
293
|
-
if (!this.sliderElement
|
327
|
+
if (!this.sliderElement)
|
294
328
|
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()));
|
329
|
+
const calculatePercent = this.calculatePercentOnMove(event);
|
330
|
+
let value = this.getValueFromPercent(calculatePercent);
|
331
|
+
value = Number.parseFloat(value.toFixed(2));
|
332
|
+
if (this.hasStep()) {
|
333
|
+
value = this.roundToStep(value);
|
302
334
|
}
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
|
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
|
-
}
|
335
|
+
if (this.isDual()) {
|
336
|
+
if (circle === 'first' && value < this.values()[1]) {
|
337
|
+
if (this.checkValues(value, 'first', this.values()[1]) && this.values()[0] !== value) {
|
338
|
+
this.values.set([value, this.values()[1]]);
|
328
339
|
}
|
329
340
|
}
|
330
|
-
else {
|
331
|
-
|
332
|
-
|
333
|
-
newValue = this.calculateStep(newValue);
|
334
|
-
if (this.values() !== newValue) {
|
335
|
-
this.values.set(newValue);
|
336
|
-
this.commitValue(newValue);
|
341
|
+
else if (circle === 'second' && value > this.values()[0] && this.values()[1] !== value) {
|
342
|
+
if (this.checkValues(value, 'second', this.values()[0])) {
|
343
|
+
this.values.set([this.values()[0], value]);
|
337
344
|
}
|
338
345
|
}
|
339
|
-
|
340
|
-
|
341
|
-
|
342
|
-
|
343
|
-
|
344
|
-
});
|
346
|
+
}
|
347
|
+
else {
|
348
|
+
if (this.checkValue(value) && this.values() !== value) {
|
349
|
+
this.values.set(value);
|
350
|
+
}
|
345
351
|
}
|
346
352
|
}
|
347
353
|
/**
|
@@ -373,27 +379,21 @@ class AXRangeSliderComponent extends classes((MXValueComponent)) {
|
|
373
379
|
else {
|
374
380
|
this.values.set(this.min());
|
375
381
|
}
|
376
|
-
this.commitValue(this.values());
|
377
382
|
}
|
378
383
|
}
|
379
384
|
/**
|
380
385
|
* @ignore
|
381
386
|
*/
|
382
387
|
fixInitializeValues() {
|
383
|
-
//swap value
|
384
388
|
if (this.isDual() && this.values()[0] > this.values()[1]) {
|
385
389
|
this.values.set([this.values()[1], this.values()[0]]);
|
386
|
-
this.commitValue(this.values());
|
387
390
|
}
|
388
|
-
//not in range
|
389
391
|
if (typeof this.values() === 'number' && !this.checkValue(this.values())) {
|
390
392
|
this.values.set(this.min());
|
391
|
-
this.commitValue(this.values());
|
392
393
|
}
|
393
394
|
else if (typeof this.values() !== 'number' &&
|
394
395
|
!this.checkValues(this.values()[0], 'first', this.values()[1])) {
|
395
396
|
this.values.set([this.min(), this.max()]);
|
396
|
-
this.commitValue(this.values());
|
397
397
|
}
|
398
398
|
}
|
399
399
|
/**
|
@@ -402,17 +402,13 @@ class AXRangeSliderComponent extends classes((MXValueComponent)) {
|
|
402
402
|
fixInitializeStep() {
|
403
403
|
if (this.step() !== 1) {
|
404
404
|
if (this.isDual()) {
|
405
|
-
this.values.update((old) => [this.
|
406
|
-
this.commitValue(this.values());
|
407
|
-
this.commitValue(this.values());
|
405
|
+
this.values.update((old) => [this.roundToStep(old[0]), this.roundToStep(old[1])]);
|
408
406
|
if (this.values()[0] === this.values()[1]) {
|
409
|
-
this.values.update((old) => [this.
|
410
|
-
this.commitValue(this.values());
|
407
|
+
this.values.update((old) => [this.roundToStep(old[0]), this.roundToStep(old[1]) + this.step()]);
|
411
408
|
}
|
412
409
|
}
|
413
410
|
else {
|
414
|
-
this.values.update((old) => this.
|
415
|
-
this.commitValue(this.values());
|
411
|
+
this.values.update((old) => this.roundToStep(old));
|
416
412
|
}
|
417
413
|
}
|
418
414
|
}
|
@@ -422,27 +418,47 @@ class AXRangeSliderComponent extends classes((MXValueComponent)) {
|
|
422
418
|
fixChangingMode() {
|
423
419
|
if (typeof this.values() === 'number' && this.isDual()) {
|
424
420
|
this.values.set([this.min(), this.max()]);
|
425
|
-
this.commitValue(this.values());
|
426
421
|
}
|
427
422
|
else if (typeof this.values() !== 'number' && !this.isDual()) {
|
428
423
|
this.values.set(this.min());
|
429
|
-
this.commitValue(this.values());
|
430
424
|
}
|
431
425
|
}
|
432
426
|
/**
|
433
427
|
* @ignore
|
434
428
|
*/
|
435
|
-
|
436
|
-
const
|
437
|
-
|
438
|
-
|
439
|
-
|
440
|
-
|
441
|
-
|
442
|
-
|
443
|
-
|
444
|
-
|
445
|
-
|
429
|
+
calculatePercentOnMove(event) {
|
430
|
+
const sliderRect = this.sliderElement.getBoundingClientRect();
|
431
|
+
let percent;
|
432
|
+
if (this.isHorizontal()) {
|
433
|
+
const clientX = event instanceof MouseEvent ? event.clientX : event.touches[0].clientX;
|
434
|
+
const x = clientX - sliderRect.left;
|
435
|
+
percent = (x / sliderRect.width) * 100;
|
436
|
+
}
|
437
|
+
else {
|
438
|
+
const clientY = event instanceof MouseEvent ? event.clientY : event.touches[0].clientY;
|
439
|
+
const y = -(clientY - sliderRect.bottom); //reverce slider from bottom to top
|
440
|
+
percent = (y / sliderRect.height) * 100;
|
441
|
+
}
|
442
|
+
if (percent < 0) {
|
443
|
+
percent = 0;
|
444
|
+
}
|
445
|
+
else if (percent > 100) {
|
446
|
+
percent = 100;
|
447
|
+
}
|
448
|
+
return percent;
|
449
|
+
}
|
450
|
+
/**
|
451
|
+
* @ignore
|
452
|
+
*/
|
453
|
+
roundToStep(value) {
|
454
|
+
const lower = Math.max(this.min(), Math.floor((value - this.min()) / this.step()) * this.step() + this.min());
|
455
|
+
const upper = Math.min(this.max(), lower + this.step());
|
456
|
+
if (value - lower < upper - value) {
|
457
|
+
return lower;
|
458
|
+
}
|
459
|
+
else {
|
460
|
+
return upper;
|
461
|
+
}
|
446
462
|
}
|
447
463
|
/**
|
448
464
|
* @ignore
|
@@ -474,11 +490,17 @@ class AXRangeSliderComponent extends classes((MXValueComponent)) {
|
|
474
490
|
else
|
475
491
|
return false;
|
476
492
|
}
|
493
|
+
/**
|
494
|
+
* @ignore
|
495
|
+
*/
|
496
|
+
getValueFromPercent(value) {
|
497
|
+
return this.min() + (value * (this.max() - this.min())) / 100;
|
498
|
+
}
|
477
499
|
/**
|
478
500
|
* @ignore
|
479
501
|
*/
|
480
502
|
getPercantage(value) {
|
481
|
-
return (value / this.range()) * 100;
|
503
|
+
return this.range() !== 0 ? (value / this.range()) * 100 : 0;
|
482
504
|
}
|
483
505
|
/**
|
484
506
|
* Increase a step to value if slider in single mode
|
@@ -487,11 +509,11 @@ class AXRangeSliderComponent extends classes((MXValueComponent)) {
|
|
487
509
|
*/
|
488
510
|
increaseStep() {
|
489
511
|
if (this.isDual()) {
|
490
|
-
const newValue = this.
|
512
|
+
const newValue = this.roundToStep(this.values()[1] + this.step());
|
491
513
|
this.values.set([this.values()[0], newValue]);
|
492
514
|
}
|
493
515
|
else {
|
494
|
-
const newValue = this.
|
516
|
+
const newValue = this.roundToStep(this.values() + this.step());
|
495
517
|
this.values.set(newValue);
|
496
518
|
}
|
497
519
|
}
|
@@ -502,11 +524,11 @@ class AXRangeSliderComponent extends classes((MXValueComponent)) {
|
|
502
524
|
*/
|
503
525
|
decreaseStep() {
|
504
526
|
if (this.isDual()) {
|
505
|
-
const newValue = this.
|
527
|
+
const newValue = this.roundToStep(this.values()[0] - this.step());
|
506
528
|
this.values.set([newValue, this.values()[1]]);
|
507
529
|
}
|
508
530
|
else {
|
509
|
-
const newValue = this.
|
531
|
+
const newValue = this.roundToStep(this.values() - this.step());
|
510
532
|
this.values.set(newValue);
|
511
533
|
}
|
512
534
|
}
|
@@ -516,57 +538,51 @@ class AXRangeSliderComponent extends classes((MXValueComponent)) {
|
|
516
538
|
onWheel(event) {
|
517
539
|
this.zone.runOutsideAngular(() => {
|
518
540
|
event.preventDefault();
|
519
|
-
if (!this.choosenHandler || this.readonly || this.disabled)
|
541
|
+
if (!this.choosenHandler || this.readonly || this.disabled || !this.correctMinMax())
|
520
542
|
return;
|
521
543
|
let newValue;
|
522
544
|
if (this.isDual()) {
|
523
545
|
if (event.deltaY < 0) {
|
524
546
|
if (this.choosenHandler === 'first') {
|
525
|
-
newValue = this.
|
547
|
+
newValue = this.roundToStep(this.values()[0] + this.step());
|
526
548
|
if (this.checkValues(newValue, this.choosenHandler, this.values()[1]) &&
|
527
549
|
this.values()[0] !== newValue) {
|
528
|
-
this.values.update((old) => [this.
|
529
|
-
this.commitValue(this.values());
|
550
|
+
this.values.update((old) => [this.roundToStep(old[0] + this.step()), old[1]]);
|
530
551
|
}
|
531
552
|
}
|
532
553
|
else {
|
533
|
-
newValue = this.
|
554
|
+
newValue = this.roundToStep(this.values()[1] + this.step());
|
534
555
|
if (newValue <= this.max() && this.values()[1] !== newValue) {
|
535
|
-
this.values.update((old) => [old[0], this.
|
536
|
-
this.commitValue(this.values());
|
556
|
+
this.values.update((old) => [old[0], this.roundToStep(old[1] + this.step())]);
|
537
557
|
}
|
538
558
|
}
|
539
559
|
}
|
540
560
|
else {
|
541
561
|
if (this.choosenHandler === 'first') {
|
542
|
-
newValue = this.
|
562
|
+
newValue = this.roundToStep(this.values()[0] - this.step());
|
543
563
|
if (this.checkValues(newValue, this.choosenHandler, this.values()[1]) &&
|
544
564
|
this.values() !== newValue) {
|
545
|
-
this.values.update((old) => [this.
|
546
|
-
this.commitValue(this.values());
|
565
|
+
this.values.update((old) => [this.roundToStep(old[0] - this.step()), old[1]]);
|
547
566
|
}
|
548
567
|
}
|
549
568
|
else {
|
550
|
-
newValue = this.
|
569
|
+
newValue = this.roundToStep(this.values()[1] - this.step());
|
551
570
|
if (this.checkValues(newValue, this.choosenHandler, this.values()[0]) &&
|
552
571
|
this.values()[1] !== newValue) {
|
553
|
-
this.values.update((old) => [old[0], this.
|
554
|
-
this.commitValue(this.values());
|
572
|
+
this.values.update((old) => [old[0], this.roundToStep(old[1] - this.step())]);
|
555
573
|
}
|
556
574
|
}
|
557
575
|
}
|
558
576
|
}
|
559
577
|
else {
|
560
578
|
if (event.deltaY < 0) {
|
561
|
-
if (this.checkValue(this.
|
562
|
-
this.values.update((old) => this.
|
563
|
-
this.commitValue(this.values());
|
579
|
+
if (this.checkValue(this.roundToStep(this.values() + this.step()))) {
|
580
|
+
this.values.update((old) => this.roundToStep(old + this.step()));
|
564
581
|
}
|
565
582
|
}
|
566
583
|
else {
|
567
|
-
if (this.checkValue(this.
|
568
|
-
this.values.update((old) => this.
|
569
|
-
this.commitValue(this.values());
|
584
|
+
if (this.checkValue(this.roundToStep(this.values() - this.step()))) {
|
585
|
+
this.values.update((old) => this.roundToStep(old - this.step()));
|
570
586
|
}
|
571
587
|
}
|
572
588
|
}
|
@@ -582,15 +598,18 @@ class AXRangeSliderComponent extends classes((MXValueComponent)) {
|
|
582
598
|
`${this.readonly ? 'ax-state-readonly' : ''}`,
|
583
599
|
];
|
584
600
|
}
|
601
|
+
onNgModelChange(event) {
|
602
|
+
this.values.set(event.value);
|
603
|
+
}
|
585
604
|
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: [
|
605
|
+
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
606
|
{ provide: AXValuableComponent, useExisting: AXRangeSliderComponent },
|
588
607
|
{
|
589
608
|
provide: NG_VALUE_ACCESSOR,
|
590
609
|
useExisting: forwardRef(() => AXRangeSliderComponent),
|
591
610
|
multi: true,
|
592
611
|
},
|
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 }); }
|
612
|
+
], 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
613
|
}
|
595
614
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: AXRangeSliderComponent, decorators: [{
|
596
615
|
type: Component,
|
@@ -601,13 +620,16 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImpor
|
|
601
620
|
useExisting: forwardRef(() => AXRangeSliderComponent),
|
602
621
|
multi: true,
|
603
622
|
},
|
604
|
-
], template: "<div class=\"ax-range-slider\" [class]=\"'ax-orientation-' + orientation()\">\n
|
623
|
+
], 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
624
|
}], ctorParameters: () => [], propDecorators: { onWheel: [{
|
606
625
|
type: HostListener,
|
607
626
|
args: ['wheel', ['$event']]
|
608
627
|
}], __hostClass: [{
|
609
628
|
type: HostBinding,
|
610
629
|
args: ['class']
|
630
|
+
}], onNgModelChange: [{
|
631
|
+
type: HostListener,
|
632
|
+
args: ['onValueChanged', ['$event']]
|
611
633
|
}] } });
|
612
634
|
|
613
635
|
class AXRangeSliderModule {
|