437 lines
12 KiB
JavaScript
437 lines
12 KiB
JavaScript
import {
|
|
consoleError,
|
|
consoleWarn,
|
|
getCurrentInstance,
|
|
getObjectValueByPath,
|
|
toKebabCase
|
|
} from "./chunk-ADPJOAU6.js";
|
|
import {
|
|
computed,
|
|
effectScope,
|
|
inject,
|
|
onScopeDispose,
|
|
ref,
|
|
shallowRef,
|
|
toRaw,
|
|
toRef,
|
|
watch
|
|
} from "./chunk-FIAHBV72.js";
|
|
|
|
// node_modules/vuetify/lib/composables/toggleScope.js
|
|
function useToggleScope(source, fn) {
|
|
let scope;
|
|
function start() {
|
|
scope = effectScope();
|
|
scope.run(() => fn.length ? fn(() => {
|
|
scope == null ? void 0 : scope.stop();
|
|
start();
|
|
}) : fn());
|
|
}
|
|
watch(source, (active) => {
|
|
if (active && !scope) {
|
|
start();
|
|
} else if (!active) {
|
|
scope == null ? void 0 : scope.stop();
|
|
scope = void 0;
|
|
}
|
|
}, {
|
|
immediate: true
|
|
});
|
|
onScopeDispose(() => {
|
|
scope == null ? void 0 : scope.stop();
|
|
});
|
|
}
|
|
|
|
// node_modules/vuetify/lib/composables/proxiedModel.js
|
|
function useProxiedModel(props, prop, defaultValue) {
|
|
let transformIn = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : (v) => v;
|
|
let transformOut = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : (v) => v;
|
|
const vm = getCurrentInstance("useProxiedModel");
|
|
const internal = ref(props[prop] !== void 0 ? props[prop] : defaultValue);
|
|
const kebabProp = toKebabCase(prop);
|
|
const checkKebab = kebabProp !== prop;
|
|
const isControlled = checkKebab ? computed(() => {
|
|
var _a, _b, _c, _d;
|
|
void props[prop];
|
|
return !!((((_a = vm.vnode.props) == null ? void 0 : _a.hasOwnProperty(prop)) || ((_b = vm.vnode.props) == null ? void 0 : _b.hasOwnProperty(kebabProp))) && (((_c = vm.vnode.props) == null ? void 0 : _c.hasOwnProperty(`onUpdate:${prop}`)) || ((_d = vm.vnode.props) == null ? void 0 : _d.hasOwnProperty(`onUpdate:${kebabProp}`))));
|
|
}) : computed(() => {
|
|
var _a, _b;
|
|
void props[prop];
|
|
return !!(((_a = vm.vnode.props) == null ? void 0 : _a.hasOwnProperty(prop)) && ((_b = vm.vnode.props) == null ? void 0 : _b.hasOwnProperty(`onUpdate:${prop}`)));
|
|
});
|
|
useToggleScope(() => !isControlled.value, () => {
|
|
watch(() => props[prop], (val) => {
|
|
internal.value = val;
|
|
});
|
|
});
|
|
const model = computed({
|
|
get() {
|
|
const externalValue = props[prop];
|
|
return transformIn(isControlled.value ? externalValue : internal.value);
|
|
},
|
|
set(internalValue) {
|
|
const newValue = transformOut(internalValue);
|
|
const value = toRaw(isControlled.value ? props[prop] : internal.value);
|
|
if (value === newValue || transformIn(value) === internalValue) {
|
|
return;
|
|
}
|
|
internal.value = newValue;
|
|
vm == null ? void 0 : vm.emit(`update:${prop}`, newValue);
|
|
}
|
|
});
|
|
Object.defineProperty(model, "externalValue", {
|
|
get: () => isControlled.value ? props[prop] : internal.value
|
|
});
|
|
return model;
|
|
}
|
|
|
|
// node_modules/vuetify/lib/locale/en.js
|
|
var en_default = {
|
|
badge: "Badge",
|
|
open: "Open",
|
|
close: "Close",
|
|
dismiss: "Dismiss",
|
|
confirmEdit: {
|
|
ok: "OK",
|
|
cancel: "Cancel"
|
|
},
|
|
dataIterator: {
|
|
noResultsText: "No matching records found",
|
|
loadingText: "Loading items..."
|
|
},
|
|
dataTable: {
|
|
itemsPerPageText: "Rows per page:",
|
|
ariaLabel: {
|
|
sortDescending: "Sorted descending.",
|
|
sortAscending: "Sorted ascending.",
|
|
sortNone: "Not sorted.",
|
|
activateNone: "Activate to remove sorting.",
|
|
activateDescending: "Activate to sort descending.",
|
|
activateAscending: "Activate to sort ascending."
|
|
},
|
|
sortBy: "Sort by"
|
|
},
|
|
dataFooter: {
|
|
itemsPerPageText: "Items per page:",
|
|
itemsPerPageAll: "All",
|
|
nextPage: "Next page",
|
|
prevPage: "Previous page",
|
|
firstPage: "First page",
|
|
lastPage: "Last page",
|
|
pageText: "{0}-{1} of {2}"
|
|
},
|
|
dateRangeInput: {
|
|
divider: "to"
|
|
},
|
|
datePicker: {
|
|
itemsSelected: "{0} selected",
|
|
range: {
|
|
title: "Select dates",
|
|
header: "Enter dates"
|
|
},
|
|
title: "Select date",
|
|
header: "Enter date",
|
|
input: {
|
|
placeholder: "Enter date"
|
|
},
|
|
ariaLabel: {
|
|
previousMonth: "Previous month",
|
|
nextMonth: "Next month",
|
|
selectYear: "Select year",
|
|
selectDate: "{0}",
|
|
// Full date format
|
|
currentDate: "Today, {0}"
|
|
}
|
|
},
|
|
noDataText: "No data available",
|
|
carousel: {
|
|
prev: "Previous visual",
|
|
next: "Next visual",
|
|
ariaLabel: {
|
|
delimiter: "Carousel slide {0} of {1}"
|
|
}
|
|
},
|
|
calendar: {
|
|
moreEvents: "{0} more",
|
|
today: "Today"
|
|
},
|
|
input: {
|
|
clear: "Clear {0}",
|
|
prependAction: "{0} prepended action",
|
|
appendAction: "{0} appended action",
|
|
otp: "Please enter OTP character {0}"
|
|
},
|
|
fileInput: {
|
|
counter: "{0} files",
|
|
counterSize: "{0} files ({1} in total)"
|
|
},
|
|
fileUpload: {
|
|
title: "Drag and drop files here",
|
|
divider: "or",
|
|
browse: "Browse Files"
|
|
},
|
|
timePicker: {
|
|
am: "AM",
|
|
pm: "PM",
|
|
title: "Select Time"
|
|
},
|
|
pagination: {
|
|
ariaLabel: {
|
|
root: "Pagination Navigation",
|
|
next: "Next page",
|
|
previous: "Previous page",
|
|
page: "Go to page {0}",
|
|
currentPage: "Page {0}, Current page",
|
|
first: "First page",
|
|
last: "Last page"
|
|
}
|
|
},
|
|
stepper: {
|
|
next: "Next",
|
|
prev: "Previous"
|
|
},
|
|
rating: {
|
|
ariaLabel: {
|
|
item: "Rating {0} of {1}"
|
|
}
|
|
},
|
|
loading: "Loading...",
|
|
infiniteScroll: {
|
|
loadMore: "Load more",
|
|
empty: "No more"
|
|
},
|
|
rules: {
|
|
required: "This field is required",
|
|
email: "Please enter a valid email",
|
|
number: "This field can only contain numbers",
|
|
integer: "This field can only contain integer values",
|
|
capital: "This field can only contain uppercase letters",
|
|
maxLength: "You must enter a maximum of {0} characters",
|
|
minLength: "You must enter a minimum of {0} characters",
|
|
strictLength: "The length of the entered field is invalid",
|
|
exclude: "The {0} character is not allowed",
|
|
notEmpty: "Please choose at least one value",
|
|
pattern: "Invalid format"
|
|
},
|
|
hotkey: {
|
|
then: "then",
|
|
ctrl: "Ctrl",
|
|
command: "Command",
|
|
space: "Space",
|
|
shift: "Shift",
|
|
alt: "Alt",
|
|
enter: "Enter",
|
|
escape: "Escape",
|
|
upArrow: "Up Arrow",
|
|
downArrow: "Down Arrow",
|
|
leftArrow: "Left Arrow",
|
|
rightArrow: "Right Arrow",
|
|
backspace: "Backspace",
|
|
option: "Option",
|
|
plus: "plus",
|
|
shortcut: "Keyboard shortcut: {0}"
|
|
},
|
|
video: {
|
|
play: "Play",
|
|
pause: "Pause",
|
|
seek: "Seek",
|
|
volume: "Volume",
|
|
showVolume: "Show volume control",
|
|
mute: "Mute",
|
|
unmute: "Unmute",
|
|
enterFullscreen: "Full screen",
|
|
exitFullscreen: "Exit full screen"
|
|
}
|
|
};
|
|
|
|
// node_modules/vuetify/lib/locale/adapters/vuetify.js
|
|
var LANG_PREFIX = "$vuetify.";
|
|
var replace = (str, params) => {
|
|
return str.replace(/\{(\d+)\}/g, (match, index) => {
|
|
return String(params[Number(index)]);
|
|
});
|
|
};
|
|
var createTranslateFunction = (current, fallback, messages) => {
|
|
return function(key) {
|
|
for (var _len = arguments.length, params = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
params[_key - 1] = arguments[_key];
|
|
}
|
|
if (!key.startsWith(LANG_PREFIX)) {
|
|
return replace(key, params);
|
|
}
|
|
const shortKey = key.replace(LANG_PREFIX, "");
|
|
const currentLocale = current.value && messages.value[current.value];
|
|
const fallbackLocale = fallback.value && messages.value[fallback.value];
|
|
let str = getObjectValueByPath(currentLocale, shortKey, null);
|
|
if (!str) {
|
|
consoleWarn(`Translation key "${key}" not found in "${current.value}", trying fallback locale`);
|
|
str = getObjectValueByPath(fallbackLocale, shortKey, null);
|
|
}
|
|
if (!str) {
|
|
consoleError(`Translation key "${key}" not found in fallback`);
|
|
str = key;
|
|
}
|
|
if (typeof str !== "string") {
|
|
consoleError(`Translation key "${key}" has a non-string value`);
|
|
str = key;
|
|
}
|
|
return replace(str, params);
|
|
};
|
|
};
|
|
function createNumberFunction(current, fallback) {
|
|
return (value, options) => {
|
|
const numberFormat = new Intl.NumberFormat([current.value, fallback.value], options);
|
|
return numberFormat.format(value);
|
|
};
|
|
}
|
|
function inferDecimalSeparator(current, fallback) {
|
|
const format = createNumberFunction(current, fallback);
|
|
return format(0.1).includes(",") ? "," : ".";
|
|
}
|
|
function useProvided(props, prop, provided) {
|
|
const internal = useProxiedModel(props, prop, props[prop] ?? provided.value);
|
|
internal.value = props[prop] ?? provided.value;
|
|
watch(provided, (v) => {
|
|
if (props[prop] == null) {
|
|
internal.value = provided.value;
|
|
}
|
|
});
|
|
return internal;
|
|
}
|
|
function createProvideFunction(state) {
|
|
return (props) => {
|
|
const current = useProvided(props, "locale", state.current);
|
|
const fallback = useProvided(props, "fallback", state.fallback);
|
|
const messages = useProvided(props, "messages", state.messages);
|
|
return {
|
|
name: "vuetify",
|
|
current,
|
|
fallback,
|
|
messages,
|
|
decimalSeparator: toRef(() => inferDecimalSeparator(current, fallback)),
|
|
t: createTranslateFunction(current, fallback, messages),
|
|
n: createNumberFunction(current, fallback),
|
|
provide: createProvideFunction({
|
|
current,
|
|
fallback,
|
|
messages
|
|
})
|
|
};
|
|
};
|
|
}
|
|
function createVuetifyAdapter(options) {
|
|
const current = shallowRef((options == null ? void 0 : options.locale) ?? "en");
|
|
const fallback = shallowRef((options == null ? void 0 : options.fallback) ?? "en");
|
|
const messages = ref({
|
|
en: en_default,
|
|
...options == null ? void 0 : options.messages
|
|
});
|
|
return {
|
|
name: "vuetify",
|
|
current,
|
|
fallback,
|
|
messages,
|
|
decimalSeparator: toRef(() => (options == null ? void 0 : options.decimalSeparator) ?? inferDecimalSeparator(current, fallback)),
|
|
t: createTranslateFunction(current, fallback, messages),
|
|
n: createNumberFunction(current, fallback),
|
|
provide: createProvideFunction({
|
|
current,
|
|
fallback,
|
|
messages
|
|
})
|
|
};
|
|
}
|
|
|
|
// node_modules/vuetify/lib/composables/locale.js
|
|
var LocaleSymbol = Symbol.for("vuetify:locale");
|
|
function isLocaleInstance(obj) {
|
|
return obj.name != null;
|
|
}
|
|
function createLocale(options) {
|
|
const i18n = (options == null ? void 0 : options.adapter) && isLocaleInstance(options == null ? void 0 : options.adapter) ? options == null ? void 0 : options.adapter : createVuetifyAdapter(options);
|
|
const rtl = createRtl(i18n, options);
|
|
return {
|
|
...i18n,
|
|
...rtl
|
|
};
|
|
}
|
|
function useLocale() {
|
|
const locale = inject(LocaleSymbol);
|
|
if (!locale) throw new Error("[Vuetify] Could not find injected locale instance");
|
|
return locale;
|
|
}
|
|
var RtlSymbol = Symbol.for("vuetify:rtl");
|
|
function genDefaults() {
|
|
return {
|
|
af: false,
|
|
ar: true,
|
|
bg: false,
|
|
ca: false,
|
|
ckb: false,
|
|
cs: false,
|
|
de: false,
|
|
el: false,
|
|
en: false,
|
|
es: false,
|
|
et: false,
|
|
fa: true,
|
|
fi: false,
|
|
fr: false,
|
|
hr: false,
|
|
hu: false,
|
|
he: true,
|
|
id: false,
|
|
it: false,
|
|
ja: false,
|
|
km: false,
|
|
ko: false,
|
|
lv: false,
|
|
lt: false,
|
|
nl: false,
|
|
no: false,
|
|
pl: false,
|
|
pt: false,
|
|
ro: false,
|
|
ru: false,
|
|
sk: false,
|
|
sl: false,
|
|
srCyrl: false,
|
|
srLatn: false,
|
|
sv: false,
|
|
th: false,
|
|
tr: false,
|
|
az: false,
|
|
uk: false,
|
|
vi: false,
|
|
zhHans: false,
|
|
zhHant: false
|
|
};
|
|
}
|
|
function createRtl(i18n, options) {
|
|
const rtl = ref((options == null ? void 0 : options.rtl) ?? genDefaults());
|
|
const isRtl = computed(() => rtl.value[i18n.current.value] ?? false);
|
|
return {
|
|
isRtl,
|
|
rtl,
|
|
rtlClasses: toRef(() => `v-locale--is-${isRtl.value ? "rtl" : "ltr"}`)
|
|
};
|
|
}
|
|
function useRtl() {
|
|
const locale = inject(LocaleSymbol);
|
|
if (!locale) throw new Error("[Vuetify] Could not find injected rtl instance");
|
|
return {
|
|
isRtl: locale.isRtl,
|
|
rtlClasses: locale.rtlClasses
|
|
};
|
|
}
|
|
|
|
export {
|
|
useToggleScope,
|
|
useProxiedModel,
|
|
LocaleSymbol,
|
|
createLocale,
|
|
useLocale,
|
|
useRtl
|
|
};
|
|
//# sourceMappingURL=chunk-QN4ZFON4.js.map
|