@m1z23r/ngx-ui 1.1.47 → 1.1.48
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.
|
@@ -3946,6 +3946,311 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImpor
|
|
|
3946
3946
|
args: [{ selector: 'ui-slider', standalone: true, imports: [FormsModule], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"ui-slider-wrapper\" [class]=\"sliderClasses()\" [class.ui-slider-wrapper--disabled]=\"disabled()\">\n @if (label()) {\n <label class=\"ui-slider__label\" [attr.for]=\"inputId()\">\n {{ label() }}\n </label>\n }\n <div class=\"ui-slider__container\" [style.--fill]=\"fillPercent()\">\n <input\n class=\"ui-slider\"\n type=\"range\"\n [id]=\"inputId()\"\n [min]=\"min()\"\n [max]=\"max()\"\n [step]=\"step()\"\n [disabled]=\"disabled()\"\n [(ngModel)]=\"value\"\n (change)=\"valueCommit.emit(value())\"\n />\n </div>\n @if (showValue()) {\n <span class=\"ui-slider__value\">{{ value() }}</span>\n }\n</div>\n", styles: [":host{display:block}.ui-slider-wrapper{display:flex;flex-direction:column;gap:var(--ui-spacing-xs)}.ui-slider__label{font-size:var(--ui-font-sm);font-weight:500;color:var(--ui-text)}.ui-slider__value{font-size:var(--ui-font-sm);color:var(--ui-text-muted);font-variant-numeric:tabular-nums}.ui-slider__container{display:flex;align-items:center}.ui-slider{-webkit-appearance:none;-moz-appearance:none;appearance:none;width:100%;background:transparent;cursor:pointer;margin:0;padding:0}.ui-slider::-webkit-slider-runnable-track{width:100%;border-radius:var(--ui-radius-xl);background:linear-gradient(to right,var(--ui-primary) 0%,var(--ui-primary) var(--fill, 0%),var(--ui-bg-tertiary) var(--fill, 0%),var(--ui-bg-tertiary) 100%);border:none}.ui-slider::-moz-range-track{width:100%;border-radius:var(--ui-radius-xl);background:var(--ui-bg-tertiary);border:none}.ui-slider::-moz-range-progress{border-radius:var(--ui-radius-xl);background:var(--ui-primary)}.ui-slider::-webkit-slider-thumb{-webkit-appearance:none;appearance:none;border-radius:50%;background:var(--ui-primary);border:2px solid var(--ui-bg);box-shadow:var(--ui-shadow-sm);transition:box-shadow var(--ui-transition-fast),transform var(--ui-transition-fast)}.ui-slider::-moz-range-thumb{border-radius:50%;background:var(--ui-primary);border:2px solid var(--ui-bg);box-shadow:var(--ui-shadow-sm);transition:box-shadow var(--ui-transition-fast),transform var(--ui-transition-fast)}.ui-slider:focus{outline:none}.ui-slider:focus-visible::-webkit-slider-thumb{box-shadow:0 0 0 3px color-mix(in srgb,var(--ui-primary) 20%,transparent)}.ui-slider:focus-visible::-moz-range-thumb{box-shadow:0 0 0 3px color-mix(in srgb,var(--ui-primary) 20%,transparent)}.ui-slider:not(:disabled):hover::-webkit-slider-thumb{transform:scale(1.1)}.ui-slider:not(:disabled):hover::-moz-range-thumb{transform:scale(1.1)}.ui-slider:not(:disabled):active::-webkit-slider-thumb{transform:scale(1.15);box-shadow:0 0 0 3px color-mix(in srgb,var(--ui-primary) 20%,transparent)}.ui-slider:not(:disabled):active::-moz-range-thumb{transform:scale(1.15);box-shadow:0 0 0 3px color-mix(in srgb,var(--ui-primary) 20%,transparent)}.ui-slider--sm .ui-slider{height:20px}.ui-slider--sm .ui-slider::-webkit-slider-runnable-track{height:4px}.ui-slider--sm .ui-slider::-moz-range-track{height:4px}.ui-slider--sm .ui-slider::-moz-range-progress{height:4px}.ui-slider--sm .ui-slider::-webkit-slider-thumb{width:14px;height:14px;margin-top:-5px}.ui-slider--sm .ui-slider::-moz-range-thumb{width:14px;height:14px}.ui-slider--md .ui-slider{height:24px}.ui-slider--md .ui-slider::-webkit-slider-runnable-track{height:6px}.ui-slider--md .ui-slider::-moz-range-track{height:6px}.ui-slider--md .ui-slider::-moz-range-progress{height:6px}.ui-slider--md .ui-slider::-webkit-slider-thumb{width:18px;height:18px;margin-top:-6px}.ui-slider--md .ui-slider::-moz-range-thumb{width:18px;height:18px}.ui-slider--lg .ui-slider{height:32px}.ui-slider--lg .ui-slider::-webkit-slider-runnable-track{height:8px}.ui-slider--lg .ui-slider::-moz-range-track{height:8px}.ui-slider--lg .ui-slider::-moz-range-progress{height:8px}.ui-slider--lg .ui-slider::-webkit-slider-thumb{width:24px;height:24px;margin-top:-8px}.ui-slider--lg .ui-slider::-moz-range-thumb{width:24px;height:24px}.ui-slider-wrapper--disabled{opacity:.5}.ui-slider-wrapper--disabled .ui-slider{cursor:not-allowed}\n"] }]
|
|
3947
3947
|
}], 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 }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], showValue: [{ type: i0.Input, args: [{ isSignal: true, alias: "showValue", required: false }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], valueCommit: [{ type: i0.Output, args: ["valueCommit"] }] } });
|
|
3948
3948
|
|
|
3949
|
+
const MS_PER_MINUTE = 60_000;
|
|
3950
|
+
const MS_PER_DAY = 86_400_000;
|
|
3951
|
+
const DEFAULT_STEP = {
|
|
3952
|
+
time: 15 * MS_PER_MINUTE,
|
|
3953
|
+
date: MS_PER_DAY,
|
|
3954
|
+
datetime: 30 * MS_PER_MINUTE,
|
|
3955
|
+
};
|
|
3956
|
+
class RangeSliderComponent {
|
|
3957
|
+
min = input.required(...(ngDevMode ? [{ debugName: "min" }] : []));
|
|
3958
|
+
max = input.required(...(ngDevMode ? [{ debugName: "max" }] : []));
|
|
3959
|
+
mode = input('datetime', ...(ngDevMode ? [{ debugName: "mode" }] : []));
|
|
3960
|
+
size = input('md', ...(ngDevMode ? [{ debugName: "size" }] : []));
|
|
3961
|
+
label = input('', ...(ngDevMode ? [{ debugName: "label" }] : []));
|
|
3962
|
+
disabled = input(false, ...(ngDevMode ? [{ debugName: "disabled" }] : []));
|
|
3963
|
+
step = input(null, ...(ngDevMode ? [{ debugName: "step" }] : []));
|
|
3964
|
+
bubbles = input('always', ...(ngDevMode ? [{ debugName: "bubbles" }] : []));
|
|
3965
|
+
showRange = input(false, ...(ngDevMode ? [{ debugName: "showRange" }] : []));
|
|
3966
|
+
format = input(null, ...(ngDevMode ? [{ debugName: "format" }] : []));
|
|
3967
|
+
value = model(null, ...(ngDevMode ? [{ debugName: "value" }] : []));
|
|
3968
|
+
valueCommit = output();
|
|
3969
|
+
trackEl = viewChild('track', ...(ngDevMode ? [{ debugName: "trackEl" }] : []));
|
|
3970
|
+
startMs = signal(0, ...(ngDevMode ? [{ debugName: "startMs" }] : []));
|
|
3971
|
+
endMs = signal(0, ...(ngDevMode ? [{ debugName: "endMs" }] : []));
|
|
3972
|
+
dragging = signal(null, ...(ngDevMode ? [{ debugName: "dragging" }] : []));
|
|
3973
|
+
focusedThumb = signal(null, ...(ngDevMode ? [{ debugName: "focusedThumb" }] : []));
|
|
3974
|
+
hoveredThumb = signal(null, ...(ngDevMode ? [{ debugName: "hoveredThumb" }] : []));
|
|
3975
|
+
lastEmitted = null;
|
|
3976
|
+
minMs = computed(() => this.min().getTime(), ...(ngDevMode ? [{ debugName: "minMs" }] : []));
|
|
3977
|
+
maxMs = computed(() => this.max().getTime(), ...(ngDevMode ? [{ debugName: "maxMs" }] : []));
|
|
3978
|
+
range = computed(() => Math.max(0, this.maxMs() - this.minMs()), ...(ngDevMode ? [{ debugName: "range" }] : []));
|
|
3979
|
+
effectiveStep = computed(() => {
|
|
3980
|
+
const explicit = this.step();
|
|
3981
|
+
return explicit && explicit > 0 ? explicit : DEFAULT_STEP[this.mode()];
|
|
3982
|
+
}, ...(ngDevMode ? [{ debugName: "effectiveStep" }] : []));
|
|
3983
|
+
startPercent = computed(() => this.toPercent(this.startMs()), ...(ngDevMode ? [{ debugName: "startPercent" }] : []));
|
|
3984
|
+
endPercent = computed(() => this.toPercent(this.endMs()), ...(ngDevMode ? [{ debugName: "endPercent" }] : []));
|
|
3985
|
+
fillStyle = computed(() => {
|
|
3986
|
+
const start = this.startPercent();
|
|
3987
|
+
const end = this.endPercent();
|
|
3988
|
+
return { left: `${start}%`, width: `${Math.max(0, end - start)}%` };
|
|
3989
|
+
}, ...(ngDevMode ? [{ debugName: "fillStyle" }] : []));
|
|
3990
|
+
startLabel = computed(() => this.formatMs(this.startMs()), ...(ngDevMode ? [{ debugName: "startLabel" }] : []));
|
|
3991
|
+
endLabel = computed(() => this.formatMs(this.endMs()), ...(ngDevMode ? [{ debugName: "endLabel" }] : []));
|
|
3992
|
+
bubbleVisible = computed(() => {
|
|
3993
|
+
const mode = this.bubbles();
|
|
3994
|
+
if (mode === 'never')
|
|
3995
|
+
return { start: false, end: false };
|
|
3996
|
+
if (mode === 'always')
|
|
3997
|
+
return { start: true, end: true };
|
|
3998
|
+
// 'active' — visible when dragged, hovered, or focused
|
|
3999
|
+
const active = (t) => this.dragging() === t || this.focusedThumb() === t || this.hoveredThumb() === t;
|
|
4000
|
+
return { start: active('start'), end: active('end') };
|
|
4001
|
+
}, ...(ngDevMode ? [{ debugName: "bubbleVisible" }] : []));
|
|
4002
|
+
rootClasses = computed(() => {
|
|
4003
|
+
const classes = ['ui-range-slider', `ui-range-slider--${this.size()}`];
|
|
4004
|
+
if (this.disabled())
|
|
4005
|
+
classes.push('ui-range-slider--disabled');
|
|
4006
|
+
return classes.join(' ');
|
|
4007
|
+
}, ...(ngDevMode ? [{ debugName: "rootClasses" }] : []));
|
|
4008
|
+
constructor() {
|
|
4009
|
+
// Sync external value → internal thumb positions. Falls back to [min, max] when null.
|
|
4010
|
+
effect(() => {
|
|
4011
|
+
const min = this.minMs();
|
|
4012
|
+
const max = this.maxMs();
|
|
4013
|
+
const v = this.value();
|
|
4014
|
+
if (v) {
|
|
4015
|
+
this.startMs.set(this.snap(this.clamp(v.start.getTime())));
|
|
4016
|
+
this.endMs.set(this.snap(this.clamp(v.end.getTime())));
|
|
4017
|
+
this.lastEmitted = v;
|
|
4018
|
+
}
|
|
4019
|
+
else {
|
|
4020
|
+
this.startMs.set(min);
|
|
4021
|
+
this.endMs.set(max);
|
|
4022
|
+
this.lastEmitted = null;
|
|
4023
|
+
}
|
|
4024
|
+
});
|
|
4025
|
+
}
|
|
4026
|
+
/** Push current thumb state into the value model (live, during interaction). */
|
|
4027
|
+
writeValue() {
|
|
4028
|
+
const next = {
|
|
4029
|
+
start: this.materialize(this.startMs()),
|
|
4030
|
+
end: this.materialize(this.endMs()),
|
|
4031
|
+
};
|
|
4032
|
+
const prev = this.lastEmitted;
|
|
4033
|
+
if (prev &&
|
|
4034
|
+
prev.start.getTime() === next.start.getTime() &&
|
|
4035
|
+
prev.end.getTime() === next.end.getTime()) {
|
|
4036
|
+
return;
|
|
4037
|
+
}
|
|
4038
|
+
this.lastEmitted = next;
|
|
4039
|
+
this.value.set(next);
|
|
4040
|
+
}
|
|
4041
|
+
// -- Pointer handling -------------------------------------------------
|
|
4042
|
+
onThumbPointerDown(event, thumb) {
|
|
4043
|
+
if (this.disabled())
|
|
4044
|
+
return;
|
|
4045
|
+
event.preventDefault();
|
|
4046
|
+
const target = event.target;
|
|
4047
|
+
target.setPointerCapture(event.pointerId);
|
|
4048
|
+
this.dragging.set(thumb);
|
|
4049
|
+
this.focusedThumb.set(thumb);
|
|
4050
|
+
target.focus();
|
|
4051
|
+
}
|
|
4052
|
+
onThumbPointerMove(event, thumb) {
|
|
4053
|
+
if (this.dragging() !== thumb)
|
|
4054
|
+
return;
|
|
4055
|
+
event.preventDefault();
|
|
4056
|
+
const ms = this.pixelToMs(event.clientX);
|
|
4057
|
+
this.setThumb(thumb, ms);
|
|
4058
|
+
}
|
|
4059
|
+
onThumbPointerUp(event, thumb) {
|
|
4060
|
+
if (this.dragging() !== thumb)
|
|
4061
|
+
return;
|
|
4062
|
+
const target = event.target;
|
|
4063
|
+
if (target.hasPointerCapture(event.pointerId)) {
|
|
4064
|
+
target.releasePointerCapture(event.pointerId);
|
|
4065
|
+
}
|
|
4066
|
+
this.dragging.set(null);
|
|
4067
|
+
this.commit();
|
|
4068
|
+
}
|
|
4069
|
+
onTrackPointerDown(event) {
|
|
4070
|
+
if (this.disabled())
|
|
4071
|
+
return;
|
|
4072
|
+
if (event.target.dataset['thumb'])
|
|
4073
|
+
return; // ignore thumb hits
|
|
4074
|
+
const ms = this.pixelToMs(event.clientX);
|
|
4075
|
+
const thumb = Math.abs(ms - this.startMs()) <= Math.abs(ms - this.endMs()) ? 'start' : 'end';
|
|
4076
|
+
this.setThumb(thumb, ms);
|
|
4077
|
+
this.commit();
|
|
4078
|
+
}
|
|
4079
|
+
// -- Keyboard ---------------------------------------------------------
|
|
4080
|
+
onThumbKeyDown(event, thumb) {
|
|
4081
|
+
if (this.disabled())
|
|
4082
|
+
return;
|
|
4083
|
+
const step = this.effectiveStep();
|
|
4084
|
+
const big = step * 10;
|
|
4085
|
+
let delta = 0;
|
|
4086
|
+
let target = null;
|
|
4087
|
+
switch (event.key) {
|
|
4088
|
+
case 'ArrowLeft':
|
|
4089
|
+
case 'ArrowDown':
|
|
4090
|
+
delta = event.shiftKey ? -big : -step;
|
|
4091
|
+
break;
|
|
4092
|
+
case 'ArrowRight':
|
|
4093
|
+
case 'ArrowUp':
|
|
4094
|
+
delta = event.shiftKey ? big : step;
|
|
4095
|
+
break;
|
|
4096
|
+
case 'Home':
|
|
4097
|
+
target = thumb === 'start' ? this.minMs() : this.startMs();
|
|
4098
|
+
break;
|
|
4099
|
+
case 'End':
|
|
4100
|
+
target = thumb === 'end' ? this.maxMs() : this.endMs();
|
|
4101
|
+
break;
|
|
4102
|
+
default:
|
|
4103
|
+
return;
|
|
4104
|
+
}
|
|
4105
|
+
event.preventDefault();
|
|
4106
|
+
if (target !== null) {
|
|
4107
|
+
this.setThumb(thumb, target);
|
|
4108
|
+
}
|
|
4109
|
+
else {
|
|
4110
|
+
const current = thumb === 'start' ? this.startMs() : this.endMs();
|
|
4111
|
+
this.setThumb(thumb, current + delta);
|
|
4112
|
+
}
|
|
4113
|
+
}
|
|
4114
|
+
onThumbKeyUp(event) {
|
|
4115
|
+
const keys = ['ArrowLeft', 'ArrowRight', 'ArrowUp', 'ArrowDown', 'Home', 'End'];
|
|
4116
|
+
if (keys.includes(event.key)) {
|
|
4117
|
+
this.commit();
|
|
4118
|
+
}
|
|
4119
|
+
}
|
|
4120
|
+
onThumbFocus(thumb) {
|
|
4121
|
+
this.focusedThumb.set(thumb);
|
|
4122
|
+
}
|
|
4123
|
+
onThumbBlur() {
|
|
4124
|
+
this.focusedThumb.set(null);
|
|
4125
|
+
}
|
|
4126
|
+
onThumbEnter(thumb) {
|
|
4127
|
+
this.hoveredThumb.set(thumb);
|
|
4128
|
+
}
|
|
4129
|
+
onThumbLeave() {
|
|
4130
|
+
this.hoveredThumb.set(null);
|
|
4131
|
+
}
|
|
4132
|
+
// -- Internal helpers -------------------------------------------------
|
|
4133
|
+
setThumb(thumb, msRaw) {
|
|
4134
|
+
const snapped = this.snap(this.clamp(msRaw));
|
|
4135
|
+
let changed = false;
|
|
4136
|
+
if (thumb === 'start') {
|
|
4137
|
+
const next = Math.min(snapped, this.endMs());
|
|
4138
|
+
if (next !== this.startMs()) {
|
|
4139
|
+
this.startMs.set(next);
|
|
4140
|
+
changed = true;
|
|
4141
|
+
}
|
|
4142
|
+
}
|
|
4143
|
+
else {
|
|
4144
|
+
const next = Math.max(snapped, this.startMs());
|
|
4145
|
+
if (next !== this.endMs()) {
|
|
4146
|
+
this.endMs.set(next);
|
|
4147
|
+
changed = true;
|
|
4148
|
+
}
|
|
4149
|
+
}
|
|
4150
|
+
if (changed)
|
|
4151
|
+
this.writeValue();
|
|
4152
|
+
}
|
|
4153
|
+
commit() {
|
|
4154
|
+
if (this.lastEmitted) {
|
|
4155
|
+
this.valueCommit.emit(this.lastEmitted);
|
|
4156
|
+
}
|
|
4157
|
+
}
|
|
4158
|
+
clamp(ms) {
|
|
4159
|
+
return Math.min(this.maxMs(), Math.max(this.minMs(), ms));
|
|
4160
|
+
}
|
|
4161
|
+
snap(ms) {
|
|
4162
|
+
const min = this.minMs();
|
|
4163
|
+
const max = this.maxMs();
|
|
4164
|
+
const step = this.effectiveStep();
|
|
4165
|
+
if (step <= 0 || min >= max)
|
|
4166
|
+
return ms;
|
|
4167
|
+
const offset = ms - min;
|
|
4168
|
+
const snapped = min + Math.round(offset / step) * step;
|
|
4169
|
+
if (snapped > max)
|
|
4170
|
+
return max;
|
|
4171
|
+
if (snapped < min)
|
|
4172
|
+
return min;
|
|
4173
|
+
return snapped;
|
|
4174
|
+
}
|
|
4175
|
+
toPercent(ms) {
|
|
4176
|
+
const range = this.range();
|
|
4177
|
+
if (range <= 0)
|
|
4178
|
+
return 0;
|
|
4179
|
+
return ((ms - this.minMs()) / range) * 100;
|
|
4180
|
+
}
|
|
4181
|
+
pixelToMs(clientX) {
|
|
4182
|
+
const el = this.trackEl()?.nativeElement;
|
|
4183
|
+
if (!el)
|
|
4184
|
+
return this.minMs();
|
|
4185
|
+
const rect = el.getBoundingClientRect();
|
|
4186
|
+
if (rect.width <= 0)
|
|
4187
|
+
return this.minMs();
|
|
4188
|
+
const ratio = (clientX - rect.left) / rect.width;
|
|
4189
|
+
const clamped = Math.min(1, Math.max(0, ratio));
|
|
4190
|
+
return this.minMs() + clamped * this.range();
|
|
4191
|
+
}
|
|
4192
|
+
/**
|
|
4193
|
+
* Convert internal ms to a Date appropriate for the current mode.
|
|
4194
|
+
* date mode normalizes time-of-day to that of `min`.
|
|
4195
|
+
*/
|
|
4196
|
+
materialize(ms) {
|
|
4197
|
+
if (this.mode() === 'date') {
|
|
4198
|
+
const minDate = this.min();
|
|
4199
|
+
const d = new Date(ms);
|
|
4200
|
+
d.setHours(minDate.getHours(), minDate.getMinutes(), minDate.getSeconds(), minDate.getMilliseconds());
|
|
4201
|
+
return d;
|
|
4202
|
+
}
|
|
4203
|
+
return new Date(ms);
|
|
4204
|
+
}
|
|
4205
|
+
// -- Formatting -------------------------------------------------------
|
|
4206
|
+
formatMs(ms) {
|
|
4207
|
+
const date = new Date(ms);
|
|
4208
|
+
const override = this.format();
|
|
4209
|
+
if (override)
|
|
4210
|
+
return this.applyFormat(date, override);
|
|
4211
|
+
switch (this.mode()) {
|
|
4212
|
+
case 'time':
|
|
4213
|
+
return this.effectiveStep() < MS_PER_MINUTE
|
|
4214
|
+
? `${pad(date.getHours())}:${pad(date.getMinutes())}:${pad(date.getSeconds())}`
|
|
4215
|
+
: `${pad(date.getHours())}:${pad(date.getMinutes())}`;
|
|
4216
|
+
case 'date':
|
|
4217
|
+
return new Intl.DateTimeFormat(undefined, {
|
|
4218
|
+
month: 'short',
|
|
4219
|
+
day: 'numeric',
|
|
4220
|
+
year: 'numeric',
|
|
4221
|
+
}).format(date);
|
|
4222
|
+
case 'datetime':
|
|
4223
|
+
return `${new Intl.DateTimeFormat(undefined, {
|
|
4224
|
+
month: 'short',
|
|
4225
|
+
day: 'numeric',
|
|
4226
|
+
}).format(date)}, ${pad(date.getHours())}:${pad(date.getMinutes())}`;
|
|
4227
|
+
}
|
|
4228
|
+
}
|
|
4229
|
+
/** Tiny formatter for common tokens: yyyy MM dd HH mm ss MMM d. */
|
|
4230
|
+
applyFormat(date, fmt) {
|
|
4231
|
+
const months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun',
|
|
4232
|
+
'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
|
|
4233
|
+
return fmt
|
|
4234
|
+
.replace(/yyyy/g, String(date.getFullYear()))
|
|
4235
|
+
.replace(/MMM/g, months[date.getMonth()])
|
|
4236
|
+
.replace(/MM/g, pad(date.getMonth() + 1))
|
|
4237
|
+
.replace(/dd/g, pad(date.getDate()))
|
|
4238
|
+
.replace(/d/g, String(date.getDate()))
|
|
4239
|
+
.replace(/HH/g, pad(date.getHours()))
|
|
4240
|
+
.replace(/mm/g, pad(date.getMinutes()))
|
|
4241
|
+
.replace(/ss/g, pad(date.getSeconds()));
|
|
4242
|
+
}
|
|
4243
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: RangeSliderComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
4244
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.1", type: RangeSliderComponent, isStandalone: true, selector: "ui-range-slider", inputs: { min: { classPropertyName: "min", publicName: "min", isSignal: true, isRequired: true, transformFunction: null }, max: { classPropertyName: "max", publicName: "max", isSignal: true, isRequired: true, transformFunction: null }, mode: { classPropertyName: "mode", publicName: "mode", 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 }, step: { classPropertyName: "step", publicName: "step", 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 }, format: { classPropertyName: "format", publicName: "format", 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-range-slider__label\">{{ label() }}</label>\n }\n\n <div\n #track\n class=\"ui-range-slider__track\"\n (pointerdown)=\"onTrackPointerDown($event)\"\n >\n <div class=\"ui-range-slider__fill\" [style.left]=\"fill.left\" [style.width]=\"fill.width\"></div>\n\n <div\n class=\"ui-range-slider__thumb ui-range-slider__thumb--start\"\n role=\"slider\"\n tabindex=\"0\"\n data-thumb=\"start\"\n [attr.aria-valuemin]=\"minMs()\"\n [attr.aria-valuemax]=\"endMs()\"\n [attr.aria-valuenow]=\"startMs()\"\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-range-slider__bubble\">{{ startLabel() }}</span>\n }\n </div>\n\n <div\n class=\"ui-range-slider__thumb ui-range-slider__thumb--end\"\n role=\"slider\"\n tabindex=\"0\"\n data-thumb=\"end\"\n [attr.aria-valuemin]=\"startMs()\"\n [attr.aria-valuemax]=\"maxMs()\"\n [attr.aria-valuenow]=\"endMs()\"\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-range-slider__bubble\">{{ endLabel() }}</span>\n }\n </div>\n </div>\n\n @if (rangeOn) {\n <div class=\"ui-range-slider__range\">\n <span>{{ startLabel() }}</span>\n <span class=\"ui-range-slider__range-arrow\" aria-hidden=\"true\">\u2192</span>\n <span>{{ endLabel() }}</span>\n </div>\n }\n</div>\n", styles: [":host{display:block}.ui-range-slider{display:flex;flex-direction:column;gap:var(--ui-spacing-sm);user-select:none;-webkit-user-select:none}.ui-range-slider__label{font-size:var(--ui-font-sm);font-weight:500;color:var(--ui-text)}.ui-range-slider__track{position:relative;width:100%;background:var(--ui-bg-tertiary);border-radius:var(--ui-radius-xl);cursor:pointer;touch-action:none}.ui-range-slider__fill{position:absolute;top:0;bottom:0;background:var(--ui-primary);border-radius:var(--ui-radius-xl);pointer-events:none}.ui-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}.ui-range-slider__thumb:hover:not([aria-disabled=true]){transform:translate(-50%,-50%) scale(1.1)}.ui-range-slider__thumb:focus-visible{box-shadow:0 0 0 3px color-mix(in srgb,var(--ui-primary) 20%,transparent)}.ui-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-range-slider__thumb{transform:translate(-50%,-50%)}.ui-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-range-slider-bubble-in var(--ui-transition-fast) ease-out}.ui-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-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-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-range-slider__range-arrow{color:var(--ui-text-disabled)}.ui-range-slider--sm .ui-range-slider__track{height:4px}.ui-range-slider--sm .ui-range-slider__thumb{width:14px;height:14px}.ui-range-slider--md .ui-range-slider__track{height:6px}.ui-range-slider--md .ui-range-slider__thumb{width:18px;height:18px}.ui-range-slider--lg .ui-range-slider__track{height:8px}.ui-range-slider--lg .ui-range-slider__thumb{width:24px;height:24px}.ui-range-slider__track{margin-top:var(--ui-spacing-lg)}.ui-range-slider--disabled{opacity:.5}.ui-range-slider--disabled .ui-range-slider__track,.ui-range-slider--disabled .ui-range-slider__thumb{cursor:not-allowed}.ui-range-slider--disabled .ui-range-slider__thumb:hover,.ui-range-slider--disabled .ui-range-slider__thumb:active{transform:translate(-50%,-50%);box-shadow:var(--ui-shadow-sm)}@keyframes ui-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 });
|
|
4245
|
+
}
|
|
4246
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: RangeSliderComponent, decorators: [{
|
|
4247
|
+
type: Component,
|
|
4248
|
+
args: [{ selector: 'ui-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-range-slider__label\">{{ label() }}</label>\n }\n\n <div\n #track\n class=\"ui-range-slider__track\"\n (pointerdown)=\"onTrackPointerDown($event)\"\n >\n <div class=\"ui-range-slider__fill\" [style.left]=\"fill.left\" [style.width]=\"fill.width\"></div>\n\n <div\n class=\"ui-range-slider__thumb ui-range-slider__thumb--start\"\n role=\"slider\"\n tabindex=\"0\"\n data-thumb=\"start\"\n [attr.aria-valuemin]=\"minMs()\"\n [attr.aria-valuemax]=\"endMs()\"\n [attr.aria-valuenow]=\"startMs()\"\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-range-slider__bubble\">{{ startLabel() }}</span>\n }\n </div>\n\n <div\n class=\"ui-range-slider__thumb ui-range-slider__thumb--end\"\n role=\"slider\"\n tabindex=\"0\"\n data-thumb=\"end\"\n [attr.aria-valuemin]=\"startMs()\"\n [attr.aria-valuemax]=\"maxMs()\"\n [attr.aria-valuenow]=\"endMs()\"\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-range-slider__bubble\">{{ endLabel() }}</span>\n }\n </div>\n </div>\n\n @if (rangeOn) {\n <div class=\"ui-range-slider__range\">\n <span>{{ startLabel() }}</span>\n <span class=\"ui-range-slider__range-arrow\" aria-hidden=\"true\">\u2192</span>\n <span>{{ endLabel() }}</span>\n </div>\n }\n</div>\n", styles: [":host{display:block}.ui-range-slider{display:flex;flex-direction:column;gap:var(--ui-spacing-sm);user-select:none;-webkit-user-select:none}.ui-range-slider__label{font-size:var(--ui-font-sm);font-weight:500;color:var(--ui-text)}.ui-range-slider__track{position:relative;width:100%;background:var(--ui-bg-tertiary);border-radius:var(--ui-radius-xl);cursor:pointer;touch-action:none}.ui-range-slider__fill{position:absolute;top:0;bottom:0;background:var(--ui-primary);border-radius:var(--ui-radius-xl);pointer-events:none}.ui-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}.ui-range-slider__thumb:hover:not([aria-disabled=true]){transform:translate(-50%,-50%) scale(1.1)}.ui-range-slider__thumb:focus-visible{box-shadow:0 0 0 3px color-mix(in srgb,var(--ui-primary) 20%,transparent)}.ui-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-range-slider__thumb{transform:translate(-50%,-50%)}.ui-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-range-slider-bubble-in var(--ui-transition-fast) ease-out}.ui-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-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-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-range-slider__range-arrow{color:var(--ui-text-disabled)}.ui-range-slider--sm .ui-range-slider__track{height:4px}.ui-range-slider--sm .ui-range-slider__thumb{width:14px;height:14px}.ui-range-slider--md .ui-range-slider__track{height:6px}.ui-range-slider--md .ui-range-slider__thumb{width:18px;height:18px}.ui-range-slider--lg .ui-range-slider__track{height:8px}.ui-range-slider--lg .ui-range-slider__thumb{width:24px;height:24px}.ui-range-slider__track{margin-top:var(--ui-spacing-lg)}.ui-range-slider--disabled{opacity:.5}.ui-range-slider--disabled .ui-range-slider__track,.ui-range-slider--disabled .ui-range-slider__thumb{cursor:not-allowed}.ui-range-slider--disabled .ui-range-slider__thumb:hover,.ui-range-slider--disabled .ui-range-slider__thumb:active{transform:translate(-50%,-50%);box-shadow:var(--ui-shadow-sm)}@keyframes ui-range-slider-bubble-in{0%{opacity:0;transform:translate(-50%) translateY(4px)}to{opacity:1;transform:translate(-50%) translateY(0)}}\n"] }]
|
|
4249
|
+
}], ctorParameters: () => [], propDecorators: { min: [{ type: i0.Input, args: [{ isSignal: true, alias: "min", required: true }] }], max: [{ type: i0.Input, args: [{ isSignal: true, alias: "max", required: true }] }], mode: [{ type: i0.Input, args: [{ isSignal: true, alias: "mode", 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 }] }], step: [{ type: i0.Input, args: [{ isSignal: true, alias: "step", required: false }] }], bubbles: [{ type: i0.Input, args: [{ isSignal: true, alias: "bubbles", required: false }] }], showRange: [{ type: i0.Input, args: [{ isSignal: true, alias: "showRange", required: false }] }], format: [{ type: i0.Input, args: [{ isSignal: true, alias: "format", 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 }] }] } });
|
|
4250
|
+
function pad(n) {
|
|
4251
|
+
return n < 10 ? `0${n}` : String(n);
|
|
4252
|
+
}
|
|
4253
|
+
|
|
3949
4254
|
/** Directive to mark a custom chip template */
|
|
3950
4255
|
class ChipTemplateDirective {
|
|
3951
4256
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: ChipTemplateDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
@@ -6985,5 +7290,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImpor
|
|
|
6985
7290
|
* Generated bundle index. Do not edit.
|
|
6986
7291
|
*/
|
|
6987
7292
|
|
|
6988
|
-
export { AccordionComponent, AccordionHeaderDirective, AccordionItemComponent, AlertComponent, BadgeComponent, ButtonComponent, CardComponent, 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, InputComponent, LOADABLE, LoadingDirective, LoadingService, ModalComponent, NavbarComponent, OptionComponent, OptionTemplateDirective, PaginationComponent, ProgressComponent, RadioComponent, RadioGroupComponent, SelectComponent, ShellComponent, SidebarComponent, SidebarService, SidebarToggleComponent, SliderComponent, SpinnerComponent, SplitComponent, SplitPaneComponent, 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 };
|
|
7293
|
+
export { AccordionComponent, AccordionHeaderDirective, AccordionItemComponent, AlertComponent, BadgeComponent, ButtonComponent, CardComponent, 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, InputComponent, LOADABLE, LoadingDirective, LoadingService, ModalComponent, NavbarComponent, OptionComponent, OptionTemplateDirective, PaginationComponent, ProgressComponent, RadioComponent, RadioGroupComponent, RangeSliderComponent, SelectComponent, ShellComponent, SidebarComponent, SidebarService, SidebarToggleComponent, SliderComponent, SpinnerComponent, SplitComponent, SplitPaneComponent, 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 };
|
|
6989
7294
|
//# sourceMappingURL=m1z23r-ngx-ui.mjs.map
|