���Root Mod By V1rus_Alfa
User / IP
:
216.73.217.78
Host / Server
:
195.214.235.115 / npln.ir
System
:
Linux damavand.pws-dns.net 5.14.0-503.35.1.el9_5.x86_64 #1 SMP PREEMPT_DYNAMIC Fri Apr 4 05:23:43 EDT 2025 x86_64
Command
|
Upload
|
Mass Deface
|
Create
:
/
home2
/
cutunixc
/
.trash
/
node_modules
/
@nuxt
/
ui
/
dist
/
runtime
/
components
/
forms
/
Viewing: Range.vue
<template> <div :class="wrapperClass"> <input :id="inputId" ref="input" v-model.number="value" :name="name" :min="min" :max="max" :disabled="disabled" :step="step" type="range" :class="[inputClass, thumbClass, trackClass]" v-bind="attrs" @change="onChange" > <span :class="progressClass" :style="progressStyle" /> </div> </template> <script> import { computed, toRef, defineComponent } from "vue"; import { twMerge, twJoin } from "tailwind-merge"; import { useUI } from "../../composables/useUI"; import { useFormGroup } from "../../composables/useFormGroup"; import { mergeConfig } from "../../utils"; import appConfig from "#build/app.config"; import { range } from "#ui/ui.config"; const config = mergeConfig(appConfig.ui.strategy, appConfig.ui.range, range); export default defineComponent({ inheritAttrs: false, props: { modelValue: { type: Number, default: 0 }, id: { type: String, default: null }, name: { type: String, default: null }, disabled: { type: Boolean, default: false }, min: { type: Number, default: 0 }, max: { type: Number, default: 100 }, step: { type: Number, default: 1 }, size: { type: String, default: null, validator(value) { return Object.keys(config.size).includes(value); } }, color: { type: String, default: () => config.default.color, validator(value) { return appConfig.ui.colors.includes(value); } }, inputClass: { type: String, default: null }, class: { type: [String, Object, Array], default: () => "" }, ui: { type: Object, default: () => ({}) } }, emits: ["update:modelValue", "change"], setup(props, { emit }) { const { ui, attrs } = useUI("range", toRef(props, "ui"), config); const { emitFormChange, inputId, color, size, name } = useFormGroup(props, config); const value = computed({ get() { return props.modelValue; }, set(value2) { emit("update:modelValue", value2); } }); const onChange = (event) => { emit("change", event.target.value); emitFormChange(); }; const wrapperClass = computed(() => { return twMerge(twJoin( ui.value.wrapper, ui.value.size[size.value] ), props.class); }); const inputClass = computed(() => { return twMerge(twJoin( ui.value.base, ui.value.background, ui.value.rounded, color.value && ui.value.ring.replaceAll("{color}", color.value), ui.value.size[size.value] ), props.inputClass); }); const thumbClass = computed(() => { return twJoin( ui.value.thumb.base, // Intermediate class to allow thumb ring or background color (set to `current`) as it's impossible to safelist with arbitrary values color.value && ui.value.thumb.color.replaceAll("{color}", color.value), ui.value.thumb.ring, ui.value.thumb.background, ui.value.thumb.size[size.value] ); }); const trackClass = computed(() => { return twJoin( ui.value.track.base, ui.value.track.background, ui.value.track.rounded, ui.value.track.size[size.value] ); }); const progressClass = computed(() => { return twJoin( ui.value.progress.base, ui.value.progress.rounded, color.value && ui.value.progress.background.replaceAll("{color}", color.value), ui.value.progress.size[size.value] ); }); const progressStyle = computed(() => { const { modelValue, min, max } = props; const clampedValue = Math.max(min, Math.min(modelValue, max)); const relativeValue = (clampedValue - min) / (max - min); return { width: `${relativeValue * 100}%` }; }); return { // eslint-disable-next-line vue/no-dupe-keys ui, attrs, // eslint-disable-next-line vue/no-dupe-keys name, inputId, value, wrapperClass, // eslint-disable-next-line vue/no-dupe-keys inputClass, thumbClass, trackClass, progressClass, progressStyle, onChange }; } }); </script>
Coded With 💗 by
0x6ick Mod By V1rus_Alfa