636 lines
20 KiB
JavaScript
636 lines
20 KiB
JavaScript
import {
|
|
intersect_default
|
|
} from "./chunk-3JAGB4CS.js";
|
|
import {
|
|
forwardRefs
|
|
} from "./chunk-DOBNCX34.js";
|
|
import {
|
|
VInput,
|
|
makeFocusProps,
|
|
makeVInputProps,
|
|
useFocus,
|
|
useInputIcon
|
|
} from "./chunk-ZCXGZYP7.js";
|
|
import {
|
|
LoaderSlot,
|
|
makeLoaderProps,
|
|
useLoader
|
|
} from "./chunk-44S2JOLY.js";
|
|
import {
|
|
makeRoundedProps,
|
|
useRounded
|
|
} from "./chunk-24LK52JF.js";
|
|
import {
|
|
VExpandXTransition,
|
|
VSlideYTransition
|
|
} from "./chunk-JVZUVJAC.js";
|
|
import {
|
|
MaybeTransition,
|
|
makeTransitionProps
|
|
} from "./chunk-XRWT7YWI.js";
|
|
import {
|
|
useBackgroundColor,
|
|
useTextColor
|
|
} from "./chunk-ZZ55KHRR.js";
|
|
import {
|
|
IconValue
|
|
} from "./chunk-472DNWSX.js";
|
|
import {
|
|
useRtl
|
|
} from "./chunk-IR5437QA.js";
|
|
import {
|
|
useProxiedModel
|
|
} from "./chunk-PVQHDZXM.js";
|
|
import {
|
|
VLabel
|
|
} from "./chunk-J5HFPFMJ.js";
|
|
import {
|
|
makeThemeProps,
|
|
provideTheme
|
|
} from "./chunk-CYOEVGGH.js";
|
|
import {
|
|
EventProp,
|
|
animate,
|
|
callEvent,
|
|
convertToUnit,
|
|
filterInputAttrs,
|
|
genericComponent,
|
|
getUid,
|
|
isOn,
|
|
makeComponentProps,
|
|
nullifyTransforms,
|
|
pick,
|
|
propsFactory,
|
|
standardEasing,
|
|
useRender
|
|
} from "./chunk-I4KGD5X4.js";
|
|
import {
|
|
Fragment,
|
|
cloneVNode,
|
|
computed,
|
|
createVNode,
|
|
mergeProps,
|
|
nextTick,
|
|
ref,
|
|
resolveDirective,
|
|
toRef,
|
|
vShow,
|
|
watch,
|
|
withDirectives
|
|
} from "./chunk-PD2AWGJV.js";
|
|
|
|
// node_modules/vuetify/lib/components/VTextField/VTextField.mjs
|
|
import "C:/Users/Jeremy/Documents/Dev/Projects.cloudsucks.net/Vulture/VApp/node_modules/vuetify/lib/components/VTextField/VTextField.css";
|
|
|
|
// node_modules/vuetify/lib/components/VCounter/VCounter.mjs
|
|
import "C:/Users/Jeremy/Documents/Dev/Projects.cloudsucks.net/Vulture/VApp/node_modules/vuetify/lib/components/VCounter/VCounter.css";
|
|
var makeVCounterProps = propsFactory({
|
|
active: Boolean,
|
|
max: [Number, String],
|
|
value: {
|
|
type: [Number, String],
|
|
default: 0
|
|
},
|
|
...makeComponentProps(),
|
|
...makeTransitionProps({
|
|
transition: {
|
|
component: VSlideYTransition
|
|
}
|
|
})
|
|
}, "VCounter");
|
|
var VCounter = genericComponent()({
|
|
name: "VCounter",
|
|
functional: true,
|
|
props: makeVCounterProps(),
|
|
setup(props, _ref) {
|
|
let {
|
|
slots
|
|
} = _ref;
|
|
const counter = computed(() => {
|
|
return props.max ? `${props.value} / ${props.max}` : String(props.value);
|
|
});
|
|
useRender(() => createVNode(MaybeTransition, {
|
|
"transition": props.transition
|
|
}, {
|
|
default: () => [withDirectives(createVNode("div", {
|
|
"class": ["v-counter", props.class],
|
|
"style": props.style
|
|
}, [slots.default ? slots.default({
|
|
counter: counter.value,
|
|
max: props.max,
|
|
value: props.value
|
|
}) : counter.value]), [[vShow, props.active]])]
|
|
}));
|
|
return {};
|
|
}
|
|
});
|
|
|
|
// node_modules/vuetify/lib/components/VField/VField.mjs
|
|
import "C:/Users/Jeremy/Documents/Dev/Projects.cloudsucks.net/Vulture/VApp/node_modules/vuetify/lib/components/VField/VField.css";
|
|
|
|
// node_modules/vuetify/lib/components/VField/VFieldLabel.mjs
|
|
var makeVFieldLabelProps = propsFactory({
|
|
floating: Boolean,
|
|
...makeComponentProps()
|
|
}, "VFieldLabel");
|
|
var VFieldLabel = genericComponent()({
|
|
name: "VFieldLabel",
|
|
props: makeVFieldLabelProps(),
|
|
setup(props, _ref) {
|
|
let {
|
|
slots
|
|
} = _ref;
|
|
useRender(() => createVNode(VLabel, {
|
|
"class": ["v-field-label", {
|
|
"v-field-label--floating": props.floating
|
|
}, props.class],
|
|
"style": props.style,
|
|
"aria-hidden": props.floating || void 0
|
|
}, slots));
|
|
return {};
|
|
}
|
|
});
|
|
|
|
// node_modules/vuetify/lib/components/VField/VField.mjs
|
|
var allowedVariants = ["underlined", "outlined", "filled", "solo", "solo-inverted", "solo-filled", "plain"];
|
|
var makeVFieldProps = propsFactory({
|
|
appendInnerIcon: IconValue,
|
|
bgColor: String,
|
|
clearable: Boolean,
|
|
clearIcon: {
|
|
type: IconValue,
|
|
default: "$clear"
|
|
},
|
|
active: Boolean,
|
|
centerAffix: {
|
|
type: Boolean,
|
|
default: void 0
|
|
},
|
|
color: String,
|
|
baseColor: String,
|
|
dirty: Boolean,
|
|
disabled: {
|
|
type: Boolean,
|
|
default: null
|
|
},
|
|
error: Boolean,
|
|
flat: Boolean,
|
|
label: String,
|
|
persistentClear: Boolean,
|
|
prependInnerIcon: IconValue,
|
|
reverse: Boolean,
|
|
singleLine: Boolean,
|
|
variant: {
|
|
type: String,
|
|
default: "filled",
|
|
validator: (v) => allowedVariants.includes(v)
|
|
},
|
|
"onClick:clear": EventProp(),
|
|
"onClick:appendInner": EventProp(),
|
|
"onClick:prependInner": EventProp(),
|
|
...makeComponentProps(),
|
|
...makeLoaderProps(),
|
|
...makeRoundedProps(),
|
|
...makeThemeProps()
|
|
}, "VField");
|
|
var VField = genericComponent()({
|
|
name: "VField",
|
|
inheritAttrs: false,
|
|
props: {
|
|
id: String,
|
|
...makeFocusProps(),
|
|
...makeVFieldProps()
|
|
},
|
|
emits: {
|
|
"update:focused": (focused) => true,
|
|
"update:modelValue": (value) => true
|
|
},
|
|
setup(props, _ref) {
|
|
let {
|
|
attrs,
|
|
emit,
|
|
slots
|
|
} = _ref;
|
|
const {
|
|
themeClasses
|
|
} = provideTheme(props);
|
|
const {
|
|
loaderClasses
|
|
} = useLoader(props);
|
|
const {
|
|
focusClasses,
|
|
isFocused,
|
|
focus,
|
|
blur
|
|
} = useFocus(props);
|
|
const {
|
|
InputIcon
|
|
} = useInputIcon(props);
|
|
const {
|
|
roundedClasses
|
|
} = useRounded(props);
|
|
const {
|
|
rtlClasses
|
|
} = useRtl();
|
|
const isActive = computed(() => props.dirty || props.active);
|
|
const hasLabel = computed(() => !props.singleLine && !!(props.label || slots.label));
|
|
const uid = getUid();
|
|
const id = computed(() => props.id || `input-${uid}`);
|
|
const messagesId = computed(() => `${id.value}-messages`);
|
|
const labelRef = ref();
|
|
const floatingLabelRef = ref();
|
|
const controlRef = ref();
|
|
const isPlainOrUnderlined = computed(() => ["plain", "underlined"].includes(props.variant));
|
|
const {
|
|
backgroundColorClasses,
|
|
backgroundColorStyles
|
|
} = useBackgroundColor(toRef(props, "bgColor"));
|
|
const {
|
|
textColorClasses,
|
|
textColorStyles
|
|
} = useTextColor(computed(() => {
|
|
return props.error || props.disabled ? void 0 : isActive.value && isFocused.value ? props.color : props.baseColor;
|
|
}));
|
|
watch(isActive, (val) => {
|
|
if (hasLabel.value) {
|
|
const el = labelRef.value.$el;
|
|
const targetEl = floatingLabelRef.value.$el;
|
|
requestAnimationFrame(() => {
|
|
const rect = nullifyTransforms(el);
|
|
const targetRect = targetEl.getBoundingClientRect();
|
|
const x = targetRect.x - rect.x;
|
|
const y = targetRect.y - rect.y - (rect.height / 2 - targetRect.height / 2);
|
|
const targetWidth = targetRect.width / 0.75;
|
|
const width = Math.abs(targetWidth - rect.width) > 1 ? {
|
|
maxWidth: convertToUnit(targetWidth)
|
|
} : void 0;
|
|
const style = getComputedStyle(el);
|
|
const targetStyle = getComputedStyle(targetEl);
|
|
const duration = parseFloat(style.transitionDuration) * 1e3 || 150;
|
|
const scale = parseFloat(targetStyle.getPropertyValue("--v-field-label-scale"));
|
|
const color = targetStyle.getPropertyValue("color");
|
|
el.style.visibility = "visible";
|
|
targetEl.style.visibility = "hidden";
|
|
animate(el, {
|
|
transform: `translate(${x}px, ${y}px) scale(${scale})`,
|
|
color,
|
|
...width
|
|
}, {
|
|
duration,
|
|
easing: standardEasing,
|
|
direction: val ? "normal" : "reverse"
|
|
}).finished.then(() => {
|
|
el.style.removeProperty("visibility");
|
|
targetEl.style.removeProperty("visibility");
|
|
});
|
|
});
|
|
}
|
|
}, {
|
|
flush: "post"
|
|
});
|
|
const slotProps = computed(() => ({
|
|
isActive,
|
|
isFocused,
|
|
controlRef,
|
|
blur,
|
|
focus
|
|
}));
|
|
function onClick(e) {
|
|
if (e.target !== document.activeElement) {
|
|
e.preventDefault();
|
|
}
|
|
}
|
|
useRender(() => {
|
|
var _a, _b, _c;
|
|
const isOutlined = props.variant === "outlined";
|
|
const hasPrepend = slots["prepend-inner"] || props.prependInnerIcon;
|
|
const hasClear = !!(props.clearable || slots.clear);
|
|
const hasAppend = !!(slots["append-inner"] || props.appendInnerIcon || hasClear);
|
|
const label = () => slots.label ? slots.label({
|
|
...slotProps.value,
|
|
label: props.label,
|
|
props: {
|
|
for: id.value
|
|
}
|
|
}) : props.label;
|
|
return createVNode("div", mergeProps({
|
|
"class": ["v-field", {
|
|
"v-field--active": isActive.value,
|
|
"v-field--appended": hasAppend,
|
|
"v-field--center-affix": props.centerAffix ?? !isPlainOrUnderlined.value,
|
|
"v-field--disabled": props.disabled,
|
|
"v-field--dirty": props.dirty,
|
|
"v-field--error": props.error,
|
|
"v-field--flat": props.flat,
|
|
"v-field--has-background": !!props.bgColor,
|
|
"v-field--persistent-clear": props.persistentClear,
|
|
"v-field--prepended": hasPrepend,
|
|
"v-field--reverse": props.reverse,
|
|
"v-field--single-line": props.singleLine,
|
|
"v-field--no-label": !label(),
|
|
[`v-field--variant-${props.variant}`]: true
|
|
}, themeClasses.value, backgroundColorClasses.value, focusClasses.value, loaderClasses.value, roundedClasses.value, rtlClasses.value, props.class],
|
|
"style": [backgroundColorStyles.value, props.style],
|
|
"onClick": onClick
|
|
}, attrs), [createVNode("div", {
|
|
"class": "v-field__overlay"
|
|
}, null), createVNode(LoaderSlot, {
|
|
"name": "v-field",
|
|
"active": !!props.loading,
|
|
"color": props.error ? "error" : typeof props.loading === "string" ? props.loading : props.color
|
|
}, {
|
|
default: slots.loader
|
|
}), hasPrepend && createVNode("div", {
|
|
"key": "prepend",
|
|
"class": "v-field__prepend-inner"
|
|
}, [props.prependInnerIcon && createVNode(InputIcon, {
|
|
"key": "prepend-icon",
|
|
"name": "prependInner"
|
|
}, null), (_a = slots["prepend-inner"]) == null ? void 0 : _a.call(slots, slotProps.value)]), createVNode("div", {
|
|
"class": "v-field__field",
|
|
"data-no-activator": ""
|
|
}, [["filled", "solo", "solo-inverted", "solo-filled"].includes(props.variant) && hasLabel.value && createVNode(VFieldLabel, {
|
|
"key": "floating-label",
|
|
"ref": floatingLabelRef,
|
|
"class": [textColorClasses.value],
|
|
"floating": true,
|
|
"for": id.value,
|
|
"style": textColorStyles.value
|
|
}, {
|
|
default: () => [label()]
|
|
}), createVNode(VFieldLabel, {
|
|
"ref": labelRef,
|
|
"for": id.value
|
|
}, {
|
|
default: () => [label()]
|
|
}), (_b = slots.default) == null ? void 0 : _b.call(slots, {
|
|
...slotProps.value,
|
|
props: {
|
|
id: id.value,
|
|
class: "v-field__input",
|
|
"aria-describedby": messagesId.value
|
|
},
|
|
focus,
|
|
blur
|
|
})]), hasClear && createVNode(VExpandXTransition, {
|
|
"key": "clear"
|
|
}, {
|
|
default: () => [withDirectives(createVNode("div", {
|
|
"class": "v-field__clearable",
|
|
"onMousedown": (e) => {
|
|
e.preventDefault();
|
|
e.stopPropagation();
|
|
}
|
|
}, [slots.clear ? slots.clear() : createVNode(InputIcon, {
|
|
"name": "clear"
|
|
}, null)]), [[vShow, props.dirty]])]
|
|
}), hasAppend && createVNode("div", {
|
|
"key": "append",
|
|
"class": "v-field__append-inner"
|
|
}, [(_c = slots["append-inner"]) == null ? void 0 : _c.call(slots, slotProps.value), props.appendInnerIcon && createVNode(InputIcon, {
|
|
"key": "append-icon",
|
|
"name": "appendInner"
|
|
}, null)]), createVNode("div", {
|
|
"class": ["v-field__outline", textColorClasses.value],
|
|
"style": textColorStyles.value
|
|
}, [isOutlined && createVNode(Fragment, null, [createVNode("div", {
|
|
"class": "v-field__outline__start"
|
|
}, null), hasLabel.value && createVNode("div", {
|
|
"class": "v-field__outline__notch"
|
|
}, [createVNode(VFieldLabel, {
|
|
"ref": floatingLabelRef,
|
|
"floating": true,
|
|
"for": id.value
|
|
}, {
|
|
default: () => [label()]
|
|
})]), createVNode("div", {
|
|
"class": "v-field__outline__end"
|
|
}, null)]), isPlainOrUnderlined.value && hasLabel.value && createVNode(VFieldLabel, {
|
|
"ref": floatingLabelRef,
|
|
"floating": true,
|
|
"for": id.value
|
|
}, {
|
|
default: () => [label()]
|
|
})])]);
|
|
});
|
|
return {
|
|
controlRef
|
|
};
|
|
}
|
|
});
|
|
function filterFieldProps(attrs) {
|
|
const keys = Object.keys(VField.props).filter((k) => !isOn(k) && k !== "class" && k !== "style");
|
|
return pick(attrs, keys);
|
|
}
|
|
|
|
// node_modules/vuetify/lib/components/VTextField/VTextField.mjs
|
|
var activeTypes = ["color", "file", "time", "date", "datetime-local", "week", "month"];
|
|
var makeVTextFieldProps = propsFactory({
|
|
autofocus: Boolean,
|
|
counter: [Boolean, Number, String],
|
|
counterValue: [Number, Function],
|
|
prefix: String,
|
|
placeholder: String,
|
|
persistentPlaceholder: Boolean,
|
|
persistentCounter: Boolean,
|
|
suffix: String,
|
|
role: String,
|
|
type: {
|
|
type: String,
|
|
default: "text"
|
|
},
|
|
modelModifiers: Object,
|
|
...makeVInputProps(),
|
|
...makeVFieldProps()
|
|
}, "VTextField");
|
|
var VTextField = genericComponent()({
|
|
name: "VTextField",
|
|
directives: {
|
|
Intersect: intersect_default
|
|
},
|
|
inheritAttrs: false,
|
|
props: makeVTextFieldProps(),
|
|
emits: {
|
|
"click:control": (e) => true,
|
|
"mousedown:control": (e) => true,
|
|
"update:focused": (focused) => true,
|
|
"update:modelValue": (val) => true
|
|
},
|
|
setup(props, _ref) {
|
|
let {
|
|
attrs,
|
|
emit,
|
|
slots
|
|
} = _ref;
|
|
const model = useProxiedModel(props, "modelValue");
|
|
const {
|
|
isFocused,
|
|
focus,
|
|
blur
|
|
} = useFocus(props);
|
|
const counterValue = computed(() => {
|
|
return typeof props.counterValue === "function" ? props.counterValue(model.value) : typeof props.counterValue === "number" ? props.counterValue : (model.value ?? "").toString().length;
|
|
});
|
|
const max = computed(() => {
|
|
if (attrs.maxlength) return attrs.maxlength;
|
|
if (!props.counter || typeof props.counter !== "number" && typeof props.counter !== "string") return void 0;
|
|
return props.counter;
|
|
});
|
|
const isPlainOrUnderlined = computed(() => ["plain", "underlined"].includes(props.variant));
|
|
function onIntersect(isIntersecting, entries) {
|
|
var _a, _b;
|
|
if (!props.autofocus || !isIntersecting) return;
|
|
(_b = (_a = entries[0].target) == null ? void 0 : _a.focus) == null ? void 0 : _b.call(_a);
|
|
}
|
|
const vInputRef = ref();
|
|
const vFieldRef = ref();
|
|
const inputRef = ref();
|
|
const isActive = computed(() => activeTypes.includes(props.type) || props.persistentPlaceholder || isFocused.value || props.active);
|
|
function onFocus() {
|
|
var _a;
|
|
if (inputRef.value !== document.activeElement) {
|
|
(_a = inputRef.value) == null ? void 0 : _a.focus();
|
|
}
|
|
if (!isFocused.value) focus();
|
|
}
|
|
function onControlMousedown(e) {
|
|
emit("mousedown:control", e);
|
|
if (e.target === inputRef.value) return;
|
|
onFocus();
|
|
e.preventDefault();
|
|
}
|
|
function onControlClick(e) {
|
|
onFocus();
|
|
emit("click:control", e);
|
|
}
|
|
function onClear(e) {
|
|
e.stopPropagation();
|
|
onFocus();
|
|
nextTick(() => {
|
|
model.value = null;
|
|
callEvent(props["onClick:clear"], e);
|
|
});
|
|
}
|
|
function onInput(e) {
|
|
var _a;
|
|
const el = e.target;
|
|
model.value = el.value;
|
|
if (((_a = props.modelModifiers) == null ? void 0 : _a.trim) && ["text", "search", "password", "tel", "url"].includes(props.type)) {
|
|
const caretPosition = [el.selectionStart, el.selectionEnd];
|
|
nextTick(() => {
|
|
el.selectionStart = caretPosition[0];
|
|
el.selectionEnd = caretPosition[1];
|
|
});
|
|
}
|
|
}
|
|
useRender(() => {
|
|
const hasCounter = !!(slots.counter || props.counter !== false && props.counter != null);
|
|
const hasDetails = !!(hasCounter || slots.details);
|
|
const [rootAttrs, inputAttrs] = filterInputAttrs(attrs);
|
|
const {
|
|
modelValue: _,
|
|
...inputProps
|
|
} = VInput.filterProps(props);
|
|
const fieldProps = filterFieldProps(props);
|
|
return createVNode(VInput, mergeProps({
|
|
"ref": vInputRef,
|
|
"modelValue": model.value,
|
|
"onUpdate:modelValue": ($event) => model.value = $event,
|
|
"class": ["v-text-field", {
|
|
"v-text-field--prefixed": props.prefix,
|
|
"v-text-field--suffixed": props.suffix,
|
|
"v-input--plain-underlined": isPlainOrUnderlined.value
|
|
}, props.class],
|
|
"style": props.style
|
|
}, rootAttrs, inputProps, {
|
|
"centerAffix": !isPlainOrUnderlined.value,
|
|
"focused": isFocused.value
|
|
}), {
|
|
...slots,
|
|
default: (_ref2) => {
|
|
let {
|
|
id,
|
|
isDisabled,
|
|
isDirty,
|
|
isReadonly,
|
|
isValid
|
|
} = _ref2;
|
|
return createVNode(VField, mergeProps({
|
|
"ref": vFieldRef,
|
|
"onMousedown": onControlMousedown,
|
|
"onClick": onControlClick,
|
|
"onClick:clear": onClear,
|
|
"onClick:prependInner": props["onClick:prependInner"],
|
|
"onClick:appendInner": props["onClick:appendInner"],
|
|
"role": props.role
|
|
}, fieldProps, {
|
|
"id": id.value,
|
|
"active": isActive.value || isDirty.value,
|
|
"dirty": isDirty.value || props.dirty,
|
|
"disabled": isDisabled.value,
|
|
"focused": isFocused.value,
|
|
"error": isValid.value === false
|
|
}), {
|
|
...slots,
|
|
default: (_ref3) => {
|
|
let {
|
|
props: {
|
|
class: fieldClass,
|
|
...slotProps
|
|
}
|
|
} = _ref3;
|
|
const inputNode = withDirectives(createVNode("input", mergeProps({
|
|
"ref": inputRef,
|
|
"value": model.value,
|
|
"onInput": onInput,
|
|
"autofocus": props.autofocus,
|
|
"readonly": isReadonly.value,
|
|
"disabled": isDisabled.value,
|
|
"name": props.name,
|
|
"placeholder": props.placeholder,
|
|
"size": 1,
|
|
"type": props.type,
|
|
"onFocus": onFocus,
|
|
"onBlur": blur
|
|
}, slotProps, inputAttrs), null), [[resolveDirective("intersect"), {
|
|
handler: onIntersect
|
|
}, null, {
|
|
once: true
|
|
}]]);
|
|
return createVNode(Fragment, null, [props.prefix && createVNode("span", {
|
|
"class": "v-text-field__prefix"
|
|
}, [createVNode("span", {
|
|
"class": "v-text-field__prefix__text"
|
|
}, [props.prefix])]), slots.default ? createVNode("div", {
|
|
"class": fieldClass,
|
|
"data-no-activator": ""
|
|
}, [slots.default(), inputNode]) : cloneVNode(inputNode, {
|
|
class: fieldClass
|
|
}), props.suffix && createVNode("span", {
|
|
"class": "v-text-field__suffix"
|
|
}, [createVNode("span", {
|
|
"class": "v-text-field__suffix__text"
|
|
}, [props.suffix])])]);
|
|
}
|
|
});
|
|
},
|
|
details: hasDetails ? (slotProps) => {
|
|
var _a;
|
|
return createVNode(Fragment, null, [(_a = slots.details) == null ? void 0 : _a.call(slots, slotProps), hasCounter && createVNode(Fragment, null, [createVNode("span", null, null), createVNode(VCounter, {
|
|
"active": props.persistentCounter || isFocused.value,
|
|
"value": counterValue.value,
|
|
"max": max.value
|
|
}, slots.counter)])]);
|
|
} : void 0
|
|
});
|
|
});
|
|
return forwardRefs({}, vInputRef, vFieldRef, inputRef);
|
|
}
|
|
});
|
|
|
|
export {
|
|
makeVTextFieldProps,
|
|
VTextField
|
|
};
|
|
//# sourceMappingURL=chunk-7EFRYS5N.js.map
|