@m1z23r/ngx-ui 1.1.59 → 1.1.60
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fesm2022/m1z23r-ngx-ui.mjs +251 -1
- package/fesm2022/m1z23r-ngx-ui.mjs.map +1 -1
- package/package.json +1 -1
- package/types/m1z23r-ngx-ui.d.ts +80 -12
|
@@ -4453,6 +4453,256 @@ function pad(n) {
|
|
|
4453
4453
|
return n < 10 ? `0${n}` : String(n);
|
|
4454
4454
|
}
|
|
4455
4455
|
|
|
4456
|
+
class NumberRangeSliderComponent {
|
|
4457
|
+
min = input(0, ...(ngDevMode ? [{ debugName: "min" }] : []));
|
|
4458
|
+
max = input(100, ...(ngDevMode ? [{ debugName: "max" }] : []));
|
|
4459
|
+
step = input(1, ...(ngDevMode ? [{ debugName: "step" }] : []));
|
|
4460
|
+
size = input('md', ...(ngDevMode ? [{ debugName: "size" }] : []));
|
|
4461
|
+
label = input('', ...(ngDevMode ? [{ debugName: "label" }] : []));
|
|
4462
|
+
disabled = input(false, ...(ngDevMode ? [{ debugName: "disabled" }] : []));
|
|
4463
|
+
bubbles = input('always', ...(ngDevMode ? [{ debugName: "bubbles" }] : []));
|
|
4464
|
+
showRange = input(false, ...(ngDevMode ? [{ debugName: "showRange" }] : []));
|
|
4465
|
+
prefix = input('', ...(ngDevMode ? [{ debugName: "prefix" }] : []));
|
|
4466
|
+
suffix = input('', ...(ngDevMode ? [{ debugName: "suffix" }] : []));
|
|
4467
|
+
decimals = input(0, ...(ngDevMode ? [{ debugName: "decimals" }] : []));
|
|
4468
|
+
formatValue = input(null, ...(ngDevMode ? [{ debugName: "formatValue" }] : []));
|
|
4469
|
+
value = model(null, ...(ngDevMode ? [{ debugName: "value" }] : []));
|
|
4470
|
+
valueCommit = output();
|
|
4471
|
+
trackEl = viewChild('track', ...(ngDevMode ? [{ debugName: "trackEl" }] : []));
|
|
4472
|
+
startVal = signal(0, ...(ngDevMode ? [{ debugName: "startVal" }] : []));
|
|
4473
|
+
endVal = signal(0, ...(ngDevMode ? [{ debugName: "endVal" }] : []));
|
|
4474
|
+
dragging = signal(null, ...(ngDevMode ? [{ debugName: "dragging" }] : []));
|
|
4475
|
+
focusedThumb = signal(null, ...(ngDevMode ? [{ debugName: "focusedThumb" }] : []));
|
|
4476
|
+
hoveredThumb = signal(null, ...(ngDevMode ? [{ debugName: "hoveredThumb" }] : []));
|
|
4477
|
+
lastEmitted = null;
|
|
4478
|
+
range = computed(() => Math.max(0, this.max() - this.min()), ...(ngDevMode ? [{ debugName: "range" }] : []));
|
|
4479
|
+
startPercent = computed(() => this.toPercent(this.startVal()), ...(ngDevMode ? [{ debugName: "startPercent" }] : []));
|
|
4480
|
+
endPercent = computed(() => this.toPercent(this.endVal()), ...(ngDevMode ? [{ debugName: "endPercent" }] : []));
|
|
4481
|
+
fillStyle = computed(() => {
|
|
4482
|
+
const start = this.startPercent();
|
|
4483
|
+
const end = this.endPercent();
|
|
4484
|
+
return { left: `${start}%`, width: `${Math.max(0, end - start)}%` };
|
|
4485
|
+
}, ...(ngDevMode ? [{ debugName: "fillStyle" }] : []));
|
|
4486
|
+
startLabel = computed(() => this.format(this.startVal()), ...(ngDevMode ? [{ debugName: "startLabel" }] : []));
|
|
4487
|
+
endLabel = computed(() => this.format(this.endVal()), ...(ngDevMode ? [{ debugName: "endLabel" }] : []));
|
|
4488
|
+
bubbleVisible = computed(() => {
|
|
4489
|
+
const mode = this.bubbles();
|
|
4490
|
+
if (mode === 'never')
|
|
4491
|
+
return { start: false, end: false };
|
|
4492
|
+
if (mode === 'always')
|
|
4493
|
+
return { start: true, end: true };
|
|
4494
|
+
const active = (t) => this.dragging() === t || this.focusedThumb() === t || this.hoveredThumb() === t;
|
|
4495
|
+
return { start: active('start'), end: active('end') };
|
|
4496
|
+
}, ...(ngDevMode ? [{ debugName: "bubbleVisible" }] : []));
|
|
4497
|
+
rootClasses = computed(() => {
|
|
4498
|
+
const classes = ['ui-number-range-slider', `ui-number-range-slider--${this.size()}`];
|
|
4499
|
+
if (this.disabled())
|
|
4500
|
+
classes.push('ui-number-range-slider--disabled');
|
|
4501
|
+
return classes.join(' ');
|
|
4502
|
+
}, ...(ngDevMode ? [{ debugName: "rootClasses" }] : []));
|
|
4503
|
+
constructor() {
|
|
4504
|
+
// Sync external value → internal thumb positions. Falls back to [min, max] when null.
|
|
4505
|
+
effect(() => {
|
|
4506
|
+
const min = this.min();
|
|
4507
|
+
const max = this.max();
|
|
4508
|
+
const v = this.value();
|
|
4509
|
+
if (v) {
|
|
4510
|
+
this.startVal.set(this.snap(this.clamp(v.start)));
|
|
4511
|
+
this.endVal.set(this.snap(this.clamp(v.end)));
|
|
4512
|
+
this.lastEmitted = v;
|
|
4513
|
+
}
|
|
4514
|
+
else {
|
|
4515
|
+
this.startVal.set(min);
|
|
4516
|
+
this.endVal.set(max);
|
|
4517
|
+
this.lastEmitted = null;
|
|
4518
|
+
}
|
|
4519
|
+
});
|
|
4520
|
+
}
|
|
4521
|
+
/** Push current thumb state into the value model (live, during interaction). */
|
|
4522
|
+
writeValue() {
|
|
4523
|
+
const next = { start: this.startVal(), end: this.endVal() };
|
|
4524
|
+
const prev = this.lastEmitted;
|
|
4525
|
+
if (prev && prev.start === next.start && prev.end === next.end) {
|
|
4526
|
+
return;
|
|
4527
|
+
}
|
|
4528
|
+
this.lastEmitted = next;
|
|
4529
|
+
this.value.set(next);
|
|
4530
|
+
}
|
|
4531
|
+
// -- Pointer handling -------------------------------------------------
|
|
4532
|
+
onThumbPointerDown(event, thumb) {
|
|
4533
|
+
if (this.disabled())
|
|
4534
|
+
return;
|
|
4535
|
+
event.preventDefault();
|
|
4536
|
+
const target = event.target;
|
|
4537
|
+
target.setPointerCapture(event.pointerId);
|
|
4538
|
+
this.dragging.set(thumb);
|
|
4539
|
+
this.focusedThumb.set(thumb);
|
|
4540
|
+
target.focus();
|
|
4541
|
+
}
|
|
4542
|
+
onThumbPointerMove(event, thumb) {
|
|
4543
|
+
if (this.dragging() !== thumb)
|
|
4544
|
+
return;
|
|
4545
|
+
event.preventDefault();
|
|
4546
|
+
const val = this.pixelToVal(event.clientX);
|
|
4547
|
+
this.setThumb(thumb, val);
|
|
4548
|
+
}
|
|
4549
|
+
onThumbPointerUp(event, thumb) {
|
|
4550
|
+
if (this.dragging() !== thumb)
|
|
4551
|
+
return;
|
|
4552
|
+
const target = event.target;
|
|
4553
|
+
if (target.hasPointerCapture(event.pointerId)) {
|
|
4554
|
+
target.releasePointerCapture(event.pointerId);
|
|
4555
|
+
}
|
|
4556
|
+
this.dragging.set(null);
|
|
4557
|
+
this.commit();
|
|
4558
|
+
}
|
|
4559
|
+
onTrackPointerDown(event) {
|
|
4560
|
+
if (this.disabled())
|
|
4561
|
+
return;
|
|
4562
|
+
if (event.target.dataset['thumb'])
|
|
4563
|
+
return; // ignore thumb hits
|
|
4564
|
+
const val = this.pixelToVal(event.clientX);
|
|
4565
|
+
const thumb = Math.abs(val - this.startVal()) <= Math.abs(val - this.endVal()) ? 'start' : 'end';
|
|
4566
|
+
this.setThumb(thumb, val);
|
|
4567
|
+
this.commit();
|
|
4568
|
+
}
|
|
4569
|
+
// -- Keyboard ---------------------------------------------------------
|
|
4570
|
+
onThumbKeyDown(event, thumb) {
|
|
4571
|
+
if (this.disabled())
|
|
4572
|
+
return;
|
|
4573
|
+
const step = this.effectiveStep();
|
|
4574
|
+
const big = step * 10;
|
|
4575
|
+
let delta = 0;
|
|
4576
|
+
let target = null;
|
|
4577
|
+
switch (event.key) {
|
|
4578
|
+
case 'ArrowLeft':
|
|
4579
|
+
case 'ArrowDown':
|
|
4580
|
+
delta = event.shiftKey ? -big : -step;
|
|
4581
|
+
break;
|
|
4582
|
+
case 'ArrowRight':
|
|
4583
|
+
case 'ArrowUp':
|
|
4584
|
+
delta = event.shiftKey ? big : step;
|
|
4585
|
+
break;
|
|
4586
|
+
case 'Home':
|
|
4587
|
+
target = thumb === 'start' ? this.min() : this.startVal();
|
|
4588
|
+
break;
|
|
4589
|
+
case 'End':
|
|
4590
|
+
target = thumb === 'end' ? this.max() : this.endVal();
|
|
4591
|
+
break;
|
|
4592
|
+
default:
|
|
4593
|
+
return;
|
|
4594
|
+
}
|
|
4595
|
+
event.preventDefault();
|
|
4596
|
+
if (target !== null) {
|
|
4597
|
+
this.setThumb(thumb, target);
|
|
4598
|
+
}
|
|
4599
|
+
else {
|
|
4600
|
+
const current = thumb === 'start' ? this.startVal() : this.endVal();
|
|
4601
|
+
this.setThumb(thumb, current + delta);
|
|
4602
|
+
}
|
|
4603
|
+
}
|
|
4604
|
+
onThumbKeyUp(event) {
|
|
4605
|
+
const keys = ['ArrowLeft', 'ArrowRight', 'ArrowUp', 'ArrowDown', 'Home', 'End'];
|
|
4606
|
+
if (keys.includes(event.key)) {
|
|
4607
|
+
this.commit();
|
|
4608
|
+
}
|
|
4609
|
+
}
|
|
4610
|
+
onThumbFocus(thumb) {
|
|
4611
|
+
this.focusedThumb.set(thumb);
|
|
4612
|
+
}
|
|
4613
|
+
onThumbBlur() {
|
|
4614
|
+
this.focusedThumb.set(null);
|
|
4615
|
+
}
|
|
4616
|
+
onThumbEnter(thumb) {
|
|
4617
|
+
this.hoveredThumb.set(thumb);
|
|
4618
|
+
}
|
|
4619
|
+
onThumbLeave() {
|
|
4620
|
+
this.hoveredThumb.set(null);
|
|
4621
|
+
}
|
|
4622
|
+
// -- Internal helpers -------------------------------------------------
|
|
4623
|
+
effectiveStep() {
|
|
4624
|
+
const step = this.step();
|
|
4625
|
+
return step > 0 ? step : 1;
|
|
4626
|
+
}
|
|
4627
|
+
setThumb(thumb, raw) {
|
|
4628
|
+
const snapped = this.snap(this.clamp(raw));
|
|
4629
|
+
let changed = false;
|
|
4630
|
+
if (thumb === 'start') {
|
|
4631
|
+
const next = Math.min(snapped, this.endVal());
|
|
4632
|
+
if (next !== this.startVal()) {
|
|
4633
|
+
this.startVal.set(next);
|
|
4634
|
+
changed = true;
|
|
4635
|
+
}
|
|
4636
|
+
}
|
|
4637
|
+
else {
|
|
4638
|
+
const next = Math.max(snapped, this.startVal());
|
|
4639
|
+
if (next !== this.endVal()) {
|
|
4640
|
+
this.endVal.set(next);
|
|
4641
|
+
changed = true;
|
|
4642
|
+
}
|
|
4643
|
+
}
|
|
4644
|
+
if (changed)
|
|
4645
|
+
this.writeValue();
|
|
4646
|
+
}
|
|
4647
|
+
commit() {
|
|
4648
|
+
if (this.lastEmitted) {
|
|
4649
|
+
this.valueCommit.emit(this.lastEmitted);
|
|
4650
|
+
}
|
|
4651
|
+
}
|
|
4652
|
+
clamp(val) {
|
|
4653
|
+
return Math.min(this.max(), Math.max(this.min(), val));
|
|
4654
|
+
}
|
|
4655
|
+
snap(val) {
|
|
4656
|
+
const min = this.min();
|
|
4657
|
+
const max = this.max();
|
|
4658
|
+
const step = this.step();
|
|
4659
|
+
if (step <= 0 || min >= max)
|
|
4660
|
+
return val;
|
|
4661
|
+
const offset = val - min;
|
|
4662
|
+
const snapped = min + Math.round(offset / step) * step;
|
|
4663
|
+
if (snapped > max)
|
|
4664
|
+
return max;
|
|
4665
|
+
if (snapped < min)
|
|
4666
|
+
return min;
|
|
4667
|
+
return snapped;
|
|
4668
|
+
}
|
|
4669
|
+
toPercent(val) {
|
|
4670
|
+
const range = this.range();
|
|
4671
|
+
if (range <= 0)
|
|
4672
|
+
return 0;
|
|
4673
|
+
return ((val - this.min()) / range) * 100;
|
|
4674
|
+
}
|
|
4675
|
+
pixelToVal(clientX) {
|
|
4676
|
+
const el = this.trackEl()?.nativeElement;
|
|
4677
|
+
if (!el)
|
|
4678
|
+
return this.min();
|
|
4679
|
+
const rect = el.getBoundingClientRect();
|
|
4680
|
+
if (rect.width <= 0)
|
|
4681
|
+
return this.min();
|
|
4682
|
+
const ratio = (clientX - rect.left) / rect.width;
|
|
4683
|
+
const clamped = Math.min(1, Math.max(0, ratio));
|
|
4684
|
+
return this.min() + clamped * this.range();
|
|
4685
|
+
}
|
|
4686
|
+
// -- Formatting -------------------------------------------------------
|
|
4687
|
+
format(val) {
|
|
4688
|
+
const fn = this.formatValue();
|
|
4689
|
+
if (fn)
|
|
4690
|
+
return fn(val);
|
|
4691
|
+
const decimals = this.decimals();
|
|
4692
|
+
const body = val.toLocaleString(undefined, {
|
|
4693
|
+
minimumFractionDigits: decimals,
|
|
4694
|
+
maximumFractionDigits: decimals,
|
|
4695
|
+
});
|
|
4696
|
+
return `${this.prefix()}${body}${this.suffix()}`;
|
|
4697
|
+
}
|
|
4698
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: NumberRangeSliderComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
4699
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.1", type: NumberRangeSliderComponent, isStandalone: true, selector: "ui-number-range-slider", inputs: { 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 }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, bubbles: { classPropertyName: "bubbles", publicName: "bubbles", isSignal: true, isRequired: false, transformFunction: null }, showRange: { classPropertyName: "showRange", publicName: "showRange", isSignal: true, isRequired: false, transformFunction: null }, prefix: { classPropertyName: "prefix", publicName: "prefix", isSignal: true, isRequired: false, transformFunction: null }, suffix: { classPropertyName: "suffix", publicName: "suffix", isSignal: true, isRequired: false, transformFunction: null }, decimals: { classPropertyName: "decimals", publicName: "decimals", isSignal: true, isRequired: false, transformFunction: null }, formatValue: { classPropertyName: "formatValue", publicName: "formatValue", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange", valueCommit: "valueCommit" }, viewQueries: [{ propertyName: "trackEl", first: true, predicate: ["track"], descendants: true, isSignal: true }], ngImport: i0, template: "@let isDisabled = disabled();\n@let bubbleVis = bubbleVisible();\n@let rangeOn = showRange();\n@let startPct = startPercent();\n@let endPct = endPercent();\n@let fill = fillStyle();\n\n<div [class]=\"rootClasses()\">\n @if (label()) {\n <label class=\"ui-number-range-slider__label\">{{ label() }}</label>\n }\n\n <div\n #track\n class=\"ui-number-range-slider__track\"\n (pointerdown)=\"onTrackPointerDown($event)\"\n >\n <div\n class=\"ui-number-range-slider__fill\"\n [style.left]=\"fill.left\"\n [style.width]=\"fill.width\"\n ></div>\n\n <div\n class=\"ui-number-range-slider__thumb ui-number-range-slider__thumb--start\"\n role=\"slider\"\n tabindex=\"0\"\n data-thumb=\"start\"\n [attr.aria-valuemin]=\"min()\"\n [attr.aria-valuemax]=\"endVal()\"\n [attr.aria-valuenow]=\"startVal()\"\n [attr.aria-valuetext]=\"startLabel()\"\n [attr.aria-disabled]=\"isDisabled\"\n aria-label=\"Start\"\n aria-orientation=\"horizontal\"\n [style.left.%]=\"startPct\"\n (pointerdown)=\"onThumbPointerDown($event, 'start')\"\n (pointermove)=\"onThumbPointerMove($event, 'start')\"\n (pointerup)=\"onThumbPointerUp($event, 'start')\"\n (pointercancel)=\"onThumbPointerUp($event, 'start')\"\n (pointerenter)=\"onThumbEnter('start')\"\n (pointerleave)=\"onThumbLeave()\"\n (keydown)=\"onThumbKeyDown($event, 'start')\"\n (keyup)=\"onThumbKeyUp($event)\"\n (focus)=\"onThumbFocus('start')\"\n (blur)=\"onThumbBlur()\"\n >\n @if (bubbleVis.start) {\n <span class=\"ui-number-range-slider__bubble\">{{ startLabel() }}</span>\n }\n </div>\n\n <div\n class=\"ui-number-range-slider__thumb ui-number-range-slider__thumb--end\"\n role=\"slider\"\n tabindex=\"0\"\n data-thumb=\"end\"\n [attr.aria-valuemin]=\"startVal()\"\n [attr.aria-valuemax]=\"max()\"\n [attr.aria-valuenow]=\"endVal()\"\n [attr.aria-valuetext]=\"endLabel()\"\n [attr.aria-disabled]=\"isDisabled\"\n aria-label=\"End\"\n aria-orientation=\"horizontal\"\n [style.left.%]=\"endPct\"\n (pointerdown)=\"onThumbPointerDown($event, 'end')\"\n (pointermove)=\"onThumbPointerMove($event, 'end')\"\n (pointerup)=\"onThumbPointerUp($event, 'end')\"\n (pointercancel)=\"onThumbPointerUp($event, 'end')\"\n (pointerenter)=\"onThumbEnter('end')\"\n (pointerleave)=\"onThumbLeave()\"\n (keydown)=\"onThumbKeyDown($event, 'end')\"\n (keyup)=\"onThumbKeyUp($event)\"\n (focus)=\"onThumbFocus('end')\"\n (blur)=\"onThumbBlur()\"\n >\n @if (bubbleVis.end) {\n <span class=\"ui-number-range-slider__bubble\">{{ endLabel() }}</span>\n }\n </div>\n </div>\n\n @if (rangeOn) {\n <div class=\"ui-number-range-slider__range\">\n <span>{{ startLabel() }}</span>\n <span class=\"ui-number-range-slider__range-arrow\" aria-hidden=\"true\">\u2192</span>\n <span>{{ endLabel() }}</span>\n </div>\n }\n</div>\n", styles: [":host{display:block}.ui-number-range-slider{display:flex;flex-direction:column;gap:var(--ui-spacing-sm);user-select:none;-webkit-user-select:none}.ui-number-range-slider__label{font-size:var(--ui-font-sm);font-weight:500;color:var(--ui-text)}.ui-number-range-slider__track{position:relative;width:100%;background:var(--ui-bg-tertiary);border-radius:var(--ui-radius-xl);cursor:pointer;touch-action:none;margin-top:var(--ui-spacing-lg)}.ui-number-range-slider__fill{position:absolute;top:0;bottom:0;background:var(--ui-primary);border-radius:var(--ui-radius-xl);pointer-events:none}.ui-number-range-slider__thumb{position:absolute;top:50%;border-radius:50%;background:var(--ui-primary);border:2px solid var(--ui-bg);box-shadow:var(--ui-shadow-sm);cursor:grab;outline:none;transition:box-shadow var(--ui-transition-fast),transform var(--ui-transition-fast);touch-action:none;transform:translate(-50%,-50%)}.ui-number-range-slider__thumb:hover:not([aria-disabled=true]){transform:translate(-50%,-50%) scale(1.1)}.ui-number-range-slider__thumb:focus-visible{box-shadow:0 0 0 3px color-mix(in srgb,var(--ui-primary) 20%,transparent)}.ui-number-range-slider__thumb:active:not([aria-disabled=true]){cursor:grabbing;transform:translate(-50%,-50%) scale(1.15);box-shadow:0 0 0 3px color-mix(in srgb,var(--ui-primary) 20%,transparent);z-index:3}.ui-number-range-slider__bubble{position:absolute;bottom:calc(100% + 8px);left:50%;transform:translate(-50%);background:var(--ui-bg);border:1px solid var(--ui-border);color:var(--ui-text);font-size:var(--ui-font-xs);font-weight:500;padding:2px var(--ui-spacing-sm);border-radius:var(--ui-radius-sm);box-shadow:var(--ui-shadow-sm);white-space:nowrap;pointer-events:none;font-variant-numeric:tabular-nums;animation:ui-number-range-slider-bubble-in var(--ui-transition-fast) ease-out}.ui-number-range-slider__bubble:after{content:\"\";position:absolute;top:100%;left:50%;transform:translate(-50%);border:4px solid transparent;border-top-color:var(--ui-border)}.ui-number-range-slider__bubble:before{content:\"\";position:absolute;top:calc(100% - 1px);left:50%;transform:translate(-50%);border:4px solid transparent;border-top-color:var(--ui-bg);z-index:1}.ui-number-range-slider__range{display:flex;align-items:center;gap:var(--ui-spacing-xs);font-size:var(--ui-font-sm);color:var(--ui-text-muted);font-variant-numeric:tabular-nums}.ui-number-range-slider__range-arrow{color:var(--ui-text-disabled)}.ui-number-range-slider--sm .ui-number-range-slider__track{height:4px}.ui-number-range-slider--sm .ui-number-range-slider__thumb{width:14px;height:14px}.ui-number-range-slider--md .ui-number-range-slider__track{height:6px}.ui-number-range-slider--md .ui-number-range-slider__thumb{width:18px;height:18px}.ui-number-range-slider--lg .ui-number-range-slider__track{height:8px}.ui-number-range-slider--lg .ui-number-range-slider__thumb{width:24px;height:24px}.ui-number-range-slider--disabled{opacity:.5}.ui-number-range-slider--disabled .ui-number-range-slider__track,.ui-number-range-slider--disabled .ui-number-range-slider__thumb{cursor:not-allowed}.ui-number-range-slider--disabled .ui-number-range-slider__thumb:hover,.ui-number-range-slider--disabled .ui-number-range-slider__thumb:active{transform:translate(-50%,-50%);box-shadow:var(--ui-shadow-sm)}@keyframes ui-number-range-slider-bubble-in{0%{opacity:0;transform:translate(-50%) translateY(4px)}to{opacity:1;transform:translate(-50%) translateY(0)}}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
4700
|
+
}
|
|
4701
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: NumberRangeSliderComponent, decorators: [{
|
|
4702
|
+
type: Component,
|
|
4703
|
+
args: [{ selector: 'ui-number-range-slider', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, template: "@let isDisabled = disabled();\n@let bubbleVis = bubbleVisible();\n@let rangeOn = showRange();\n@let startPct = startPercent();\n@let endPct = endPercent();\n@let fill = fillStyle();\n\n<div [class]=\"rootClasses()\">\n @if (label()) {\n <label class=\"ui-number-range-slider__label\">{{ label() }}</label>\n }\n\n <div\n #track\n class=\"ui-number-range-slider__track\"\n (pointerdown)=\"onTrackPointerDown($event)\"\n >\n <div\n class=\"ui-number-range-slider__fill\"\n [style.left]=\"fill.left\"\n [style.width]=\"fill.width\"\n ></div>\n\n <div\n class=\"ui-number-range-slider__thumb ui-number-range-slider__thumb--start\"\n role=\"slider\"\n tabindex=\"0\"\n data-thumb=\"start\"\n [attr.aria-valuemin]=\"min()\"\n [attr.aria-valuemax]=\"endVal()\"\n [attr.aria-valuenow]=\"startVal()\"\n [attr.aria-valuetext]=\"startLabel()\"\n [attr.aria-disabled]=\"isDisabled\"\n aria-label=\"Start\"\n aria-orientation=\"horizontal\"\n [style.left.%]=\"startPct\"\n (pointerdown)=\"onThumbPointerDown($event, 'start')\"\n (pointermove)=\"onThumbPointerMove($event, 'start')\"\n (pointerup)=\"onThumbPointerUp($event, 'start')\"\n (pointercancel)=\"onThumbPointerUp($event, 'start')\"\n (pointerenter)=\"onThumbEnter('start')\"\n (pointerleave)=\"onThumbLeave()\"\n (keydown)=\"onThumbKeyDown($event, 'start')\"\n (keyup)=\"onThumbKeyUp($event)\"\n (focus)=\"onThumbFocus('start')\"\n (blur)=\"onThumbBlur()\"\n >\n @if (bubbleVis.start) {\n <span class=\"ui-number-range-slider__bubble\">{{ startLabel() }}</span>\n }\n </div>\n\n <div\n class=\"ui-number-range-slider__thumb ui-number-range-slider__thumb--end\"\n role=\"slider\"\n tabindex=\"0\"\n data-thumb=\"end\"\n [attr.aria-valuemin]=\"startVal()\"\n [attr.aria-valuemax]=\"max()\"\n [attr.aria-valuenow]=\"endVal()\"\n [attr.aria-valuetext]=\"endLabel()\"\n [attr.aria-disabled]=\"isDisabled\"\n aria-label=\"End\"\n aria-orientation=\"horizontal\"\n [style.left.%]=\"endPct\"\n (pointerdown)=\"onThumbPointerDown($event, 'end')\"\n (pointermove)=\"onThumbPointerMove($event, 'end')\"\n (pointerup)=\"onThumbPointerUp($event, 'end')\"\n (pointercancel)=\"onThumbPointerUp($event, 'end')\"\n (pointerenter)=\"onThumbEnter('end')\"\n (pointerleave)=\"onThumbLeave()\"\n (keydown)=\"onThumbKeyDown($event, 'end')\"\n (keyup)=\"onThumbKeyUp($event)\"\n (focus)=\"onThumbFocus('end')\"\n (blur)=\"onThumbBlur()\"\n >\n @if (bubbleVis.end) {\n <span class=\"ui-number-range-slider__bubble\">{{ endLabel() }}</span>\n }\n </div>\n </div>\n\n @if (rangeOn) {\n <div class=\"ui-number-range-slider__range\">\n <span>{{ startLabel() }}</span>\n <span class=\"ui-number-range-slider__range-arrow\" aria-hidden=\"true\">\u2192</span>\n <span>{{ endLabel() }}</span>\n </div>\n }\n</div>\n", styles: [":host{display:block}.ui-number-range-slider{display:flex;flex-direction:column;gap:var(--ui-spacing-sm);user-select:none;-webkit-user-select:none}.ui-number-range-slider__label{font-size:var(--ui-font-sm);font-weight:500;color:var(--ui-text)}.ui-number-range-slider__track{position:relative;width:100%;background:var(--ui-bg-tertiary);border-radius:var(--ui-radius-xl);cursor:pointer;touch-action:none;margin-top:var(--ui-spacing-lg)}.ui-number-range-slider__fill{position:absolute;top:0;bottom:0;background:var(--ui-primary);border-radius:var(--ui-radius-xl);pointer-events:none}.ui-number-range-slider__thumb{position:absolute;top:50%;border-radius:50%;background:var(--ui-primary);border:2px solid var(--ui-bg);box-shadow:var(--ui-shadow-sm);cursor:grab;outline:none;transition:box-shadow var(--ui-transition-fast),transform var(--ui-transition-fast);touch-action:none;transform:translate(-50%,-50%)}.ui-number-range-slider__thumb:hover:not([aria-disabled=true]){transform:translate(-50%,-50%) scale(1.1)}.ui-number-range-slider__thumb:focus-visible{box-shadow:0 0 0 3px color-mix(in srgb,var(--ui-primary) 20%,transparent)}.ui-number-range-slider__thumb:active:not([aria-disabled=true]){cursor:grabbing;transform:translate(-50%,-50%) scale(1.15);box-shadow:0 0 0 3px color-mix(in srgb,var(--ui-primary) 20%,transparent);z-index:3}.ui-number-range-slider__bubble{position:absolute;bottom:calc(100% + 8px);left:50%;transform:translate(-50%);background:var(--ui-bg);border:1px solid var(--ui-border);color:var(--ui-text);font-size:var(--ui-font-xs);font-weight:500;padding:2px var(--ui-spacing-sm);border-radius:var(--ui-radius-sm);box-shadow:var(--ui-shadow-sm);white-space:nowrap;pointer-events:none;font-variant-numeric:tabular-nums;animation:ui-number-range-slider-bubble-in var(--ui-transition-fast) ease-out}.ui-number-range-slider__bubble:after{content:\"\";position:absolute;top:100%;left:50%;transform:translate(-50%);border:4px solid transparent;border-top-color:var(--ui-border)}.ui-number-range-slider__bubble:before{content:\"\";position:absolute;top:calc(100% - 1px);left:50%;transform:translate(-50%);border:4px solid transparent;border-top-color:var(--ui-bg);z-index:1}.ui-number-range-slider__range{display:flex;align-items:center;gap:var(--ui-spacing-xs);font-size:var(--ui-font-sm);color:var(--ui-text-muted);font-variant-numeric:tabular-nums}.ui-number-range-slider__range-arrow{color:var(--ui-text-disabled)}.ui-number-range-slider--sm .ui-number-range-slider__track{height:4px}.ui-number-range-slider--sm .ui-number-range-slider__thumb{width:14px;height:14px}.ui-number-range-slider--md .ui-number-range-slider__track{height:6px}.ui-number-range-slider--md .ui-number-range-slider__thumb{width:18px;height:18px}.ui-number-range-slider--lg .ui-number-range-slider__track{height:8px}.ui-number-range-slider--lg .ui-number-range-slider__thumb{width:24px;height:24px}.ui-number-range-slider--disabled{opacity:.5}.ui-number-range-slider--disabled .ui-number-range-slider__track,.ui-number-range-slider--disabled .ui-number-range-slider__thumb{cursor:not-allowed}.ui-number-range-slider--disabled .ui-number-range-slider__thumb:hover,.ui-number-range-slider--disabled .ui-number-range-slider__thumb:active{transform:translate(-50%,-50%);box-shadow:var(--ui-shadow-sm)}@keyframes ui-number-range-slider-bubble-in{0%{opacity:0;transform:translate(-50%) translateY(4px)}to{opacity:1;transform:translate(-50%) translateY(0)}}\n"] }]
|
|
4704
|
+
}], ctorParameters: () => [], propDecorators: { min: [{ type: i0.Input, args: [{ isSignal: true, alias: "min", required: false }] }], max: [{ type: i0.Input, args: [{ isSignal: true, alias: "max", required: false }] }], step: [{ type: i0.Input, args: [{ isSignal: true, alias: "step", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], bubbles: [{ type: i0.Input, args: [{ isSignal: true, alias: "bubbles", required: false }] }], showRange: [{ type: i0.Input, args: [{ isSignal: true, alias: "showRange", required: false }] }], prefix: [{ type: i0.Input, args: [{ isSignal: true, alias: "prefix", required: false }] }], suffix: [{ type: i0.Input, args: [{ isSignal: true, alias: "suffix", required: false }] }], decimals: [{ type: i0.Input, args: [{ isSignal: true, alias: "decimals", required: false }] }], formatValue: [{ type: i0.Input, args: [{ isSignal: true, alias: "formatValue", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], valueCommit: [{ type: i0.Output, args: ["valueCommit"] }], trackEl: [{ type: i0.ViewChild, args: ['track', { isSignal: true }] }] } });
|
|
4705
|
+
|
|
4456
4706
|
/** Directive to mark a custom chip template */
|
|
4457
4707
|
class ChipTemplateDirective {
|
|
4458
4708
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: ChipTemplateDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
@@ -8360,5 +8610,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImpor
|
|
|
8360
8610
|
* Generated bundle index. Do not edit.
|
|
8361
8611
|
*/
|
|
8362
8612
|
|
|
8363
|
-
export { AccordionComponent, AccordionHeaderDirective, AccordionItemComponent, AlertComponent, BadgeComponent, BreadcrumbComponent, BreadcrumbSeparatorDirective, ButtonComponent, CardComponent, CarouselComponent, CellTemplateDirective, CellValuePipe, CheckboxComponent, ChipInputComponent, ChipTemplateDirective, CircularProgressComponent, ContentComponent, ContextMenuDirective, DIALOG_DATA, DIALOG_REF, DatepickerComponent, DatetimepickerComponent, DialogRef, DialogService, DropdownComponent, DropdownDividerComponent, DropdownItemComponent, DropdownTriggerDirective, DynamicTabsComponent, FileChooserComponent, FilePreviewPipe, FileSizePipe, FooterComponent, ImageUploaderComponent, InputComponent, JsonTreeComponent, LOADABLE, LightboxComponent, LightboxService, LoadingDirective, LoadingService, ModalComponent, NavbarComponent, OptionComponent, OptionTemplateDirective, PaginationComponent, ProgressComponent, RadioComponent, RadioGroupComponent, RangeSliderComponent, SegmentedComponent, SelectComponent, ShellComponent, SidebarComponent, SidebarService, SidebarToggleComponent, SkeletonComponent, SliderComponent, SpinnerComponent, SplitComponent, SplitPaneComponent, StepperComponent, SwitchComponent, TAB_DATA, TAB_REF, TREE_HOST, TabActivePipe, TabComponent, TabIconDirective, TabRef, TableComponent, TabsComponent, TabsService, TemplateInputComponent, TemplateInputSuffixDirective, TextareaComponent, TimepickerComponent, ToastRef, ToastService, TooltipDirective, TreeComponent, TreeNodeComponent, Validators, VariablePopoverDirective, jsonToTreeNodes };
|
|
8613
|
+
export { AccordionComponent, AccordionHeaderDirective, AccordionItemComponent, AlertComponent, BadgeComponent, BreadcrumbComponent, BreadcrumbSeparatorDirective, ButtonComponent, CardComponent, CarouselComponent, CellTemplateDirective, CellValuePipe, CheckboxComponent, ChipInputComponent, ChipTemplateDirective, CircularProgressComponent, ContentComponent, ContextMenuDirective, DIALOG_DATA, DIALOG_REF, DatepickerComponent, DatetimepickerComponent, DialogRef, DialogService, DropdownComponent, DropdownDividerComponent, DropdownItemComponent, DropdownTriggerDirective, DynamicTabsComponent, FileChooserComponent, FilePreviewPipe, FileSizePipe, FooterComponent, ImageUploaderComponent, InputComponent, JsonTreeComponent, LOADABLE, LightboxComponent, LightboxService, LoadingDirective, LoadingService, ModalComponent, NavbarComponent, NumberRangeSliderComponent, OptionComponent, OptionTemplateDirective, PaginationComponent, ProgressComponent, RadioComponent, RadioGroupComponent, RangeSliderComponent, SegmentedComponent, SelectComponent, ShellComponent, SidebarComponent, SidebarService, SidebarToggleComponent, SkeletonComponent, SliderComponent, SpinnerComponent, SplitComponent, SplitPaneComponent, StepperComponent, SwitchComponent, TAB_DATA, TAB_REF, TREE_HOST, TabActivePipe, TabComponent, TabIconDirective, TabRef, TableComponent, TabsComponent, TabsService, TemplateInputComponent, TemplateInputSuffixDirective, TextareaComponent, TimepickerComponent, ToastRef, ToastService, TooltipDirective, TreeComponent, TreeNodeComponent, Validators, VariablePopoverDirective, jsonToTreeNodes };
|
|
8364
8614
|
//# sourceMappingURL=m1z23r-ngx-ui.mjs.map
|