@mantine-vue/core 3.3.0 → 3.5.0
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/cjs/index.cjs +225 -68
- package/cjs/index.cjs.map +1 -1
- package/esm/index.mjs +254 -97
- package/esm/index.mjs.map +1 -1
- package/lib/components/Drawer/Drawer.context.d.ts +2 -0
- package/lib/components/Menu/Menu.types.d.ts +4 -0
- package/lib/components/ModalBase/ModalBase.types.d.ts +2 -0
- package/lib/components/ModalBase/use-modal.d.ts +1 -0
- package/lib/components/NumberInput/number-input-utils.d.ts +16 -1
- package/package.json +3 -3
- package/styles.css +36 -34
- package/styles.layer.css +36 -34
package/esm/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Comment, Fragment, Teleport, Text as Text$1, cloneVNode, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createSlots, createStaticVNode, createTextVNode, createVNode, defineComponent, getCurrentInstance, guardReactiveProps, h, inject, isVNode, mergeProps, nextTick, normalizeClass, normalizeProps, normalizeStyle, onBeforeUnmount, onBeforeUpdate, onMounted, onUnmounted, onUpdated, openBlock, provide, reactive, ref, renderList, renderSlot, resolveComponent, resolveDynamicComponent, shallowRef, toDisplayString, toRef, toValue, unref, useAttrs, useSlots, watch, watchEffect, withCtx } from "vue";
|
|
2
|
-
import { DOTS, assignRef, clampUseMovePosition, mergeRefs, normalizeRadialValue, useClickOutside, useClipboard, useCollapse, useElementSize, useFloatingWindow, useFocusReturn, useFocusTrap, useHorizontalCollapse, useId, useLongPress, useMounted, useMove, usePagination, useRadialMove, useReducedMotion, useScrollSpy, useScroller, useUncontrolled, useWindowEvent } from "@mantine-vue/hooks";
|
|
1
|
+
import { Comment, Fragment, Teleport, Text as Text$1, cloneVNode, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createSlots, createStaticVNode, createTextVNode, createVNode, defineComponent, getCurrentInstance, guardReactiveProps, h, inject, isVNode, mergeProps, nextTick, normalizeClass, normalizeProps, normalizeStyle, onBeforeUnmount, onBeforeUpdate, onMounted, onUnmounted, onUpdated, openBlock, provide, reactive, ref, renderList, renderSlot, resolveComponent, resolveDynamicComponent, shallowRef, toDisplayString, toRef, toValue, unref, useAttrs, useId, useSlots, watch, watchEffect, withCtx } from "vue";
|
|
2
|
+
import { DOTS, assignRef, clampUseMovePosition, mergeRefs, normalizeRadialValue, useClickOutside, useClipboard, useCollapse, useElementSize, useFloatingWindow, useFocusReturn, useFocusTrap, useHorizontalCollapse, useId as useId$1, useLongPress, useMounted, useMove, usePagination, useRadialMove, useReducedMotion, useScrollSpy, useScroller, useUncontrolled, useWindowEvent } from "@mantine-vue/hooks";
|
|
3
3
|
import { arrow, autoUpdate, flip, hide, inline, limitShift, offset, shift, size, useFloating } from "@floating-ui/vue";
|
|
4
4
|
//#region ../utils/esm/index.mjs
|
|
5
5
|
function keys(object) {
|
|
@@ -1737,7 +1737,7 @@ function hashStyleProps(styles, media) {
|
|
|
1737
1737
|
return `mantine-vue-${Math.abs(hash).toString(36)}`;
|
|
1738
1738
|
}
|
|
1739
1739
|
function useRandomClassName() {
|
|
1740
|
-
return `mantine-vue-${Math.random().toString(36).slice(2, 9)}`;
|
|
1740
|
+
return `mantine-vue-${(getCurrentInstance() ? useId() : Math.random().toString(36).slice(2, 9)).replace(/[^A-Za-z0-9_-]/g, "-")}`;
|
|
1741
1741
|
}
|
|
1742
1742
|
//#endregion
|
|
1743
1743
|
//#region src/core/Box/style-props/style-props-data.ts
|
|
@@ -6119,7 +6119,7 @@ var Alert = factory(/* @__PURE__ */ defineComponent({
|
|
|
6119
6119
|
const slots = useSlots();
|
|
6120
6120
|
const attrs = useAttrs();
|
|
6121
6121
|
const props = useProps("Alert", null, rawProps);
|
|
6122
|
-
const rootId = useId(props.id);
|
|
6122
|
+
const rootId = useId$1(props.id);
|
|
6123
6123
|
const getStyles = useStyles({
|
|
6124
6124
|
name: "Alert",
|
|
6125
6125
|
props,
|
|
@@ -8724,21 +8724,21 @@ var AccordionChevron = /* @__PURE__ */ defineComponent({
|
|
|
8724
8724
|
//#region src/components/Accordion/Accordion.context.ts
|
|
8725
8725
|
var [provideAccordionContext, useAccordionContext] = createSafeContext("Accordion component was not found in the tree");
|
|
8726
8726
|
var Accordion_module_default = {
|
|
8727
|
-
root: "
|
|
8728
|
-
panel: "
|
|
8729
|
-
content: "
|
|
8730
|
-
itemTitle: "
|
|
8731
|
-
control: "
|
|
8732
|
-
"control--default": "_control--
|
|
8733
|
-
"control--contained": "_control--
|
|
8734
|
-
label: "
|
|
8735
|
-
chevron: "
|
|
8736
|
-
icon: "
|
|
8737
|
-
item: "
|
|
8738
|
-
"item--default": "_item--
|
|
8739
|
-
"item--contained": "_item--
|
|
8740
|
-
"item--filled": "_item--
|
|
8741
|
-
"item--separated": "_item--
|
|
8727
|
+
root: "_root_1ysxv_1",
|
|
8728
|
+
panel: "_panel_1ysxv_5",
|
|
8729
|
+
content: "_content_1ysxv_9",
|
|
8730
|
+
itemTitle: "_itemTitle_1ysxv_14",
|
|
8731
|
+
control: "_control_1ysxv_20",
|
|
8732
|
+
"control--default": "_control--default_1ysxv_42",
|
|
8733
|
+
"control--contained": "_control--contained_1ysxv_43",
|
|
8734
|
+
label: "_label_1ysxv_57",
|
|
8735
|
+
chevron: "_chevron_1ysxv_67",
|
|
8736
|
+
icon: "_icon_1ysxv_86",
|
|
8737
|
+
item: "_item_1ysxv_14",
|
|
8738
|
+
"item--default": "_item--default_1ysxv_110",
|
|
8739
|
+
"item--contained": "_item--contained_1ysxv_114",
|
|
8740
|
+
"item--filled": "_item--filled_1ysxv_149",
|
|
8741
|
+
"item--separated": "_item--separated_1ysxv_157"
|
|
8742
8742
|
};
|
|
8743
8743
|
//#endregion
|
|
8744
8744
|
//#region src/components/Accordion/Accordion.vue?vue&type=script&setup=true&lang.ts
|
|
@@ -8826,7 +8826,7 @@ var Accordion_default = /* @__PURE__ */ defineComponent({
|
|
|
8826
8826
|
const slots = useSlots();
|
|
8827
8827
|
const attrs = useAttrs();
|
|
8828
8828
|
const props = useProps("Accordion", defaultProps$46, rawProps);
|
|
8829
|
-
const uid = useId(props.id);
|
|
8829
|
+
const uid = useId$1(props.id);
|
|
8830
8830
|
const [currentValue, setCurrentValue] = useUncontrolled({
|
|
8831
8831
|
value: () => props.value,
|
|
8832
8832
|
defaultValue: props.defaultValue,
|
|
@@ -11703,7 +11703,7 @@ var Spoiler = factory(/* @__PURE__ */ defineComponent({
|
|
|
11703
11703
|
vars: props.vars,
|
|
11704
11704
|
varsResolver: varsResolver$48
|
|
11705
11705
|
});
|
|
11706
|
-
const id = useId(props.id);
|
|
11706
|
+
const id = useId$1(props.id);
|
|
11707
11707
|
const [show, setShowState] = useUncontrolled({
|
|
11708
11708
|
value: computed(() => props.expanded),
|
|
11709
11709
|
defaultValue: props.defaultExpanded,
|
|
@@ -12435,7 +12435,7 @@ var InputWrapper = Object.assign(/* @__PURE__ */ defineComponent({
|
|
|
12435
12435
|
const slots = useSlots();
|
|
12436
12436
|
const attrs = useAttrs();
|
|
12437
12437
|
const props = useProps("InputWrapper", { labelElement: "label" }, rawProps);
|
|
12438
|
-
const idBase = useId(props.id);
|
|
12438
|
+
const idBase = useId$1(props.id);
|
|
12439
12439
|
const getStyles = useStyles({
|
|
12440
12440
|
name: "InputWrapper",
|
|
12441
12441
|
props,
|
|
@@ -13851,13 +13851,21 @@ var leadingZerosPattern = /^-?0\d+(\.\d+)?\.?$/;
|
|
|
13851
13851
|
var trailingZerosPattern = /\.\d*0$/;
|
|
13852
13852
|
var trailingDecimalSeparatorPattern = /^-?\d+\.$/;
|
|
13853
13853
|
function clamp$3(value, min, max) {
|
|
13854
|
-
return Math.min(max ??
|
|
13854
|
+
return Math.min(max ?? Number.POSITIVE_INFINITY, Math.max(min ?? Number.NEGATIVE_INFINITY, value));
|
|
13855
13855
|
}
|
|
13856
13856
|
function clampBigInt(value, min, max) {
|
|
13857
13857
|
if (min !== void 0 && value < min) return min;
|
|
13858
13858
|
if (max !== void 0 && value > max) return max;
|
|
13859
13859
|
return value;
|
|
13860
13860
|
}
|
|
13861
|
+
function canStep(value) {
|
|
13862
|
+
if (typeof value === "number") return value < Number.MAX_SAFE_INTEGER;
|
|
13863
|
+
return value === "" || value !== "-" && !Number.isNaN(Number(value)) && Number(value) < Number.MAX_SAFE_INTEGER;
|
|
13864
|
+
}
|
|
13865
|
+
function canStepBigInt(value, allowNegative) {
|
|
13866
|
+
if (typeof value === "bigint") return true;
|
|
13867
|
+
return value === "" || value !== "-" && (allowNegative || !value.startsWith("-")) && /^-?\d+$/.test(value);
|
|
13868
|
+
}
|
|
13861
13869
|
function stripFormatting(value, options) {
|
|
13862
13870
|
let next = value;
|
|
13863
13871
|
if (options.prefix && next.startsWith(options.prefix)) next = next.slice(options.prefix.length);
|
|
@@ -13887,25 +13895,77 @@ function parseNumberInputValue(rawValue, allowDecimal, allowNegative, allowLeadi
|
|
|
13887
13895
|
return parsed;
|
|
13888
13896
|
}
|
|
13889
13897
|
function sanitizeNumberInputString(rawValue, allowDecimal, allowNegative, decimalScale) {
|
|
13890
|
-
let normalized =
|
|
13891
|
-
|
|
13892
|
-
|
|
13898
|
+
let normalized = "";
|
|
13899
|
+
let hasDecimalSeparator = false;
|
|
13900
|
+
for (const character of rawValue) {
|
|
13901
|
+
if (character === "." && !allowDecimal) break;
|
|
13902
|
+
if (/\d/.test(character)) normalized += character;
|
|
13903
|
+
else if (character === "-" && allowNegative && normalized.length === 0) normalized = "-";
|
|
13904
|
+
else if (character === "." && allowDecimal && !hasDecimalSeparator) {
|
|
13905
|
+
normalized += character;
|
|
13906
|
+
hasDecimalSeparator = true;
|
|
13907
|
+
}
|
|
13908
|
+
}
|
|
13909
|
+
if (normalized.startsWith(".")) normalized = `0${normalized}`;
|
|
13910
|
+
else if (normalized.startsWith("-.")) normalized = `-0${normalized.slice(1)}`;
|
|
13893
13911
|
if (typeof decimalScale === "number" && normalized.includes(".")) {
|
|
13894
13912
|
const [integerPart, decimalPart = ""] = normalized.split(".");
|
|
13895
13913
|
return `${integerPart}.${decimalPart.slice(0, decimalScale)}`;
|
|
13896
13914
|
}
|
|
13897
13915
|
return normalized;
|
|
13898
13916
|
}
|
|
13899
|
-
function
|
|
13900
|
-
|
|
13901
|
-
|
|
13902
|
-
|
|
13903
|
-
const
|
|
13904
|
-
|
|
13905
|
-
|
|
13906
|
-
|
|
13907
|
-
if (
|
|
13908
|
-
|
|
13917
|
+
function withTrailingSeparator(value, hasTrailingDecimalSeparator) {
|
|
13918
|
+
return hasTrailingDecimalSeparator ? `${value}.` : value;
|
|
13919
|
+
}
|
|
13920
|
+
function sanitizeInputOnBlur(value, options) {
|
|
13921
|
+
const hasTrailingDecimalSeparator = trailingDecimalSeparatorPattern.test(value);
|
|
13922
|
+
const trimmed = options.trim ? value.replace(/^0+(?=\d)/, "") : value;
|
|
13923
|
+
const parsedValue = parseFloat(trimmed);
|
|
13924
|
+
if (Number.isNaN(parsedValue)) return trimmed;
|
|
13925
|
+
if (!options.clamp) return options.trim ? withTrailingSeparator(parsedValue, hasTrailingDecimalSeparator) : value;
|
|
13926
|
+
const clamped = parsedValue > Number.MAX_SAFE_INTEGER && options.max !== void 0 ? options.max : clamp$3(parsedValue, options.min, options.max);
|
|
13927
|
+
if (!options.trim && clamped === parsedValue) return value;
|
|
13928
|
+
return withTrailingSeparator(clamped, hasTrailingDecimalSeparator);
|
|
13929
|
+
}
|
|
13930
|
+
function countTrailingDigits(value, from) {
|
|
13931
|
+
let count = 0;
|
|
13932
|
+
while (from + count < value.length && /\d/.test(value[from + count])) count += 1;
|
|
13933
|
+
return count;
|
|
13934
|
+
}
|
|
13935
|
+
function normalizePastedValue(value, options) {
|
|
13936
|
+
const candidates = new Set([...options.allowedDecimalSeparators, options.decimalSeparator].filter((separator) => separator.length === 1));
|
|
13937
|
+
const chars = value.split("");
|
|
13938
|
+
const occurrences = chars.reduce((result, char, index) => {
|
|
13939
|
+
if (candidates.has(char)) result.push(index);
|
|
13940
|
+
return result;
|
|
13941
|
+
}, []);
|
|
13942
|
+
if (occurrences.length === 0) return value;
|
|
13943
|
+
const lastIndex = occurrences[occurrences.length - 1];
|
|
13944
|
+
const lastChar = chars[lastIndex];
|
|
13945
|
+
const lastCharCount = occurrences.filter((index) => chars[index] === lastChar).length;
|
|
13946
|
+
const lastGroupSize = options.thousandsGroupStyle === "wan" ? 4 : 3;
|
|
13947
|
+
let decimalIndex = -1;
|
|
13948
|
+
if (lastCharCount === 1) if (lastChar === options.decimalSeparator) decimalIndex = lastIndex;
|
|
13949
|
+
else if (lastChar === options.thousandSeparator) decimalIndex = countTrailingDigits(value, lastIndex + 1) === lastGroupSize ? -1 : lastIndex;
|
|
13950
|
+
else decimalIndex = lastIndex;
|
|
13951
|
+
return chars.map((char, index) => {
|
|
13952
|
+
if (index === decimalIndex) return options.decimalSeparator;
|
|
13953
|
+
if (candidates.has(char) && char !== options.thousandSeparator) return "";
|
|
13954
|
+
return char;
|
|
13955
|
+
}).join("");
|
|
13956
|
+
}
|
|
13957
|
+
function isSignificant(char, decimalSeparator) {
|
|
13958
|
+
return /\d/.test(char) || char === decimalSeparator;
|
|
13959
|
+
}
|
|
13960
|
+
function getCaretPositionAfterPaste(rawValue, rawCaret, formattedValue, decimalSeparator) {
|
|
13961
|
+
let remaining = 0;
|
|
13962
|
+
for (let index = 0; index < rawCaret && index < rawValue.length; index += 1) if (isSignificant(rawValue[index], decimalSeparator)) remaining += 1;
|
|
13963
|
+
if (remaining === 0) return Math.min(rawCaret, formattedValue.length);
|
|
13964
|
+
for (let index = 0; index < formattedValue.length; index += 1) if (isSignificant(formattedValue[index], decimalSeparator)) {
|
|
13965
|
+
remaining -= 1;
|
|
13966
|
+
if (remaining === 0) return index + 1;
|
|
13967
|
+
}
|
|
13968
|
+
return formattedValue.length;
|
|
13909
13969
|
}
|
|
13910
13970
|
function isInRange(value, min, max) {
|
|
13911
13971
|
if (value === void 0) return true;
|
|
@@ -14109,7 +14169,6 @@ var NumberInput = factory(/* @__PURE__ */ defineComponent({
|
|
|
14109
14169
|
const slots = useSlots();
|
|
14110
14170
|
const attrs = useAttrs();
|
|
14111
14171
|
const inputRef = ref(null);
|
|
14112
|
-
const isEditing = ref(false);
|
|
14113
14172
|
const isBigIntMode = computed(() => typeof props.modelValue === "bigint" || typeof props.defaultValue === "bigint");
|
|
14114
14173
|
const [value, setValue] = useUncontrolled({
|
|
14115
14174
|
value: () => props.modelValue,
|
|
@@ -14142,11 +14201,7 @@ var NumberInput = factory(/* @__PURE__ */ defineComponent({
|
|
|
14142
14201
|
thousandsGroupStyle: props.thousandsGroupStyle,
|
|
14143
14202
|
thousandSeparator: props.thousandSeparator
|
|
14144
14203
|
}));
|
|
14145
|
-
const
|
|
14146
|
-
...formatterOptions.value,
|
|
14147
|
-
fixedDecimalScale: isEditing.value || typeof nextValue === "string" ? false : formatterOptions.value.fixedDecimalScale
|
|
14148
|
-
});
|
|
14149
|
-
const displayValue = computed(() => value.value === "" || value.value === "-" ? String(value.value) : formatNumber(value.value, getFormatterOptions()));
|
|
14204
|
+
const displayValue = computed(() => value.value === "" || value.value === "-" ? String(value.value) : formatNumber(value.value, formatterOptions.value));
|
|
14150
14205
|
const clampCaretToFormatting = (input) => {
|
|
14151
14206
|
const { min, max } = getCaretBoundaries(input.value, formatterOptions.value);
|
|
14152
14207
|
const start = input.selectionStart;
|
|
@@ -14159,6 +14214,14 @@ var NumberInput = factory(/* @__PURE__ */ defineComponent({
|
|
|
14159
14214
|
const scheduleCaretClamp = (input) => {
|
|
14160
14215
|
setTimeout(() => clampCaretToFormatting(input), 0);
|
|
14161
14216
|
};
|
|
14217
|
+
const getFormattedCaretPosition = (value, formattedValue, position) => {
|
|
14218
|
+
let formattedPosition = 0;
|
|
14219
|
+
for (const character of value.slice(0, position)) {
|
|
14220
|
+
const nextPosition = formattedValue.indexOf(character, formattedPosition);
|
|
14221
|
+
if (nextPosition !== -1) formattedPosition = nextPosition + 1;
|
|
14222
|
+
}
|
|
14223
|
+
return formattedPosition;
|
|
14224
|
+
};
|
|
14162
14225
|
const commitValue = (nextValue, source = "event") => {
|
|
14163
14226
|
if (props.clampBehavior === "strict") {
|
|
14164
14227
|
const numeric = toNumeric(nextValue);
|
|
@@ -14170,18 +14233,19 @@ var NumberInput = factory(/* @__PURE__ */ defineComponent({
|
|
|
14170
14233
|
const raw = typeof nextValue === "bigint" ? nextValue.toString() : String(nextValue);
|
|
14171
14234
|
emit("value-change", {
|
|
14172
14235
|
floatValue: typeof nextValue === "number" ? nextValue : Number.isNaN(Number(raw)) ? void 0 : Number(raw),
|
|
14173
|
-
formattedValue: nextValue === "" ? "" : formatNumber(nextValue,
|
|
14236
|
+
formattedValue: nextValue === "" ? "" : formatNumber(nextValue, formatterOptions.value),
|
|
14174
14237
|
value: raw
|
|
14175
14238
|
}, { source });
|
|
14176
14239
|
};
|
|
14240
|
+
const canStepValue = computed(() => isBigIntMode.value ? canStepBigInt(value.value, props.allowNegative) : canStep(value.value));
|
|
14177
14241
|
const stepValue = (direction) => {
|
|
14178
|
-
if (props.disabled || props.readOnly) return;
|
|
14242
|
+
if (props.disabled || props.readOnly || !canStepValue.value) return;
|
|
14179
14243
|
if (isBigIntMode.value) {
|
|
14180
14244
|
const current = typeof value.value === "bigint" ? value.value : BigInt(0);
|
|
14181
14245
|
const step = typeof props.step === "bigint" ? props.step : BigInt(props.step);
|
|
14182
14246
|
const start = typeof props.startValue === "bigint" ? props.startValue : BigInt(props.startValue);
|
|
14183
14247
|
const next = (value.value === "" || value.value === "-" ? start : current) + step * BigInt(direction);
|
|
14184
|
-
const min = typeof props.min === "bigint" ? props.min : props.min === void 0 ? void 0 : BigInt(props.min);
|
|
14248
|
+
const min = typeof props.min === "bigint" ? props.min : props.min === void 0 ? props.allowNegative ? void 0 : BigInt(0) : BigInt(props.min);
|
|
14185
14249
|
const max = typeof props.max === "bigint" ? props.max : props.max === void 0 ? void 0 : BigInt(props.max);
|
|
14186
14250
|
const clamped = clampBigInt(next, min, max);
|
|
14187
14251
|
if (max !== void 0 && next > max) emit("max-reached");
|
|
@@ -14271,7 +14335,7 @@ var NumberInput = factory(/* @__PURE__ */ defineComponent({
|
|
|
14271
14335
|
onPointercancel: clearHold
|
|
14272
14336
|
}, () => h(NumberInputChevron, { direction: "down" }))]);
|
|
14273
14337
|
/** The step controls double as the right section unless one was supplied. */
|
|
14274
|
-
const rightSection = computed(() => props.hideControls || props.readOnly ? props.rightSection : props.rightSection !== void 0 || slots.rightSection ? props.rightSection : controls);
|
|
14338
|
+
const rightSection = computed(() => props.hideControls || props.readOnly || !canStepValue.value ? props.rightSection : props.rightSection !== void 0 || slots.rightSection ? props.rightSection : controls);
|
|
14275
14339
|
const rightSectionPointerEvents = computed(() => props.rightSectionPointerEvents ?? (props.disabled ? "none" : void 0));
|
|
14276
14340
|
const rightSectionWidth = computed(() => props.rightSectionWidth ?? `var(--ni-right-section-width-${props.size || "sm"})`);
|
|
14277
14341
|
/** `bigint` values are integers only, so the numeric keypad is the right hint. */
|
|
@@ -14288,22 +14352,52 @@ var NumberInput = factory(/* @__PURE__ */ defineComponent({
|
|
|
14288
14352
|
};
|
|
14289
14353
|
__expose({ rootElement });
|
|
14290
14354
|
function onInput(event) {
|
|
14291
|
-
isEditing.value = true;
|
|
14292
14355
|
const input = event.currentTarget;
|
|
14293
|
-
const
|
|
14356
|
+
const inputValue = input.value;
|
|
14357
|
+
const selectionStart = input.selectionStart;
|
|
14358
|
+
const selectionEnd = input.selectionEnd;
|
|
14359
|
+
const rawValue = stripFormatting(inputValue, formatterOptions.value);
|
|
14294
14360
|
const decimalSeparator = props.decimalSeparator || ".";
|
|
14295
|
-
const sanitized = sanitizeNumberInputString(props.allowedDecimalSeparators.filter((separator) => separator !== decimalSeparator).reduce((acc, separator) => acc.split(separator).join("."), rawValue.replace(decimalSeparator, ".")), props.allowDecimal, props.allowNegative, props.decimalScale);
|
|
14361
|
+
const sanitized = sanitizeNumberInputString(props.allowedDecimalSeparators.filter((separator) => separator !== decimalSeparator).reduce((acc, separator) => acc.split(separator).join("."), rawValue.replace(decimalSeparator, ".")), isBigIntMode.value ? false : props.allowDecimal, props.allowNegative, props.decimalScale);
|
|
14296
14362
|
const nextValue = isBigIntMode.value ? parseBigIntInputValue(sanitized, props.allowNegative, props.allowLeadingZeros) : parseNumberInputValue(sanitized, props.allowDecimal, props.allowNegative, props.allowLeadingZeros, props.decimalScale, props.fixedDecimalScale);
|
|
14297
14363
|
if (props.clampBehavior === "strict" && !isBigIntMode.value && !isStrictAllowed(nextValue, typeof props.min === "number" ? props.min : void 0, typeof props.max === "number" ? props.max : void 0)) {
|
|
14298
14364
|
restoreInputValue(input, displayValue.value);
|
|
14299
14365
|
return;
|
|
14300
14366
|
}
|
|
14301
|
-
const formattedNextValue = nextValue === "" || nextValue === "-" ? String(nextValue) : formatNumber(nextValue,
|
|
14302
|
-
if (input.value !== formattedNextValue)
|
|
14367
|
+
const formattedNextValue = nextValue === "" || nextValue === "-" ? String(nextValue) : formatNumber(nextValue, formatterOptions.value);
|
|
14368
|
+
if (input.value !== formattedNextValue) {
|
|
14369
|
+
restoreInputValue(input, formattedNextValue);
|
|
14370
|
+
if (props.fixedDecimalScale && selectionStart !== null && selectionEnd !== null) input.setSelectionRange(getFormattedCaretPosition(inputValue, formattedNextValue, selectionStart), getFormattedCaretPosition(inputValue, formattedNextValue, selectionEnd));
|
|
14371
|
+
}
|
|
14303
14372
|
scheduleCaretClamp(input);
|
|
14304
|
-
commitValue(nextValue);
|
|
14373
|
+
if (!Object.is(nextValue, value.value)) commitValue(nextValue);
|
|
14305
14374
|
}
|
|
14306
14375
|
function onKeydown(event) {
|
|
14376
|
+
const input = event.currentTarget;
|
|
14377
|
+
if (event.key === "Backspace" && !props.readOnly && !props.disabled && input.selectionStart !== null && input.selectionStart === input.selectionEnd) {
|
|
14378
|
+
if (input.selectionStart === 0) event.preventDefault();
|
|
14379
|
+
else if (props.fixedDecimalScale && typeof props.decimalScale === "number") {
|
|
14380
|
+
const decimalPosition = input.value.indexOf(props.decimalSeparator);
|
|
14381
|
+
const isAfterDecimalSeparator = input.value[input.selectionStart - 1] === props.decimalSeparator;
|
|
14382
|
+
const deletePosition = input.selectionStart - (isAfterDecimalSeparator ? 2 : 1);
|
|
14383
|
+
if (deletePosition >= 0 && deletePosition < decimalPosition) {
|
|
14384
|
+
const nextInputValue = input.value.slice(0, deletePosition) + input.value.slice(deletePosition + 1);
|
|
14385
|
+
const unformattedValue = stripFormatting(nextInputValue, formatterOptions.value);
|
|
14386
|
+
const [integerPart, decimalPart = ""] = (unformattedValue.startsWith("-") ? unformattedValue.slice(1) : unformattedValue).split(".");
|
|
14387
|
+
if (!/\d/.test(integerPart) && /^0*$/.test(decimalPart)) {
|
|
14388
|
+
event.preventDefault();
|
|
14389
|
+
input.value = "";
|
|
14390
|
+
input.setSelectionRange(0, 0);
|
|
14391
|
+
input.dispatchEvent(new Event("input", { bubbles: true }));
|
|
14392
|
+
} else if (isAfterDecimalSeparator) {
|
|
14393
|
+
event.preventDefault();
|
|
14394
|
+
input.value = nextInputValue;
|
|
14395
|
+
input.setSelectionRange(deletePosition, deletePosition);
|
|
14396
|
+
input.dispatchEvent(new Event("input", { bubbles: true }));
|
|
14397
|
+
}
|
|
14398
|
+
}
|
|
14399
|
+
}
|
|
14400
|
+
}
|
|
14307
14401
|
if (!props.readOnly && props.withKeyboardEvents && event.key === "ArrowUp") {
|
|
14308
14402
|
event.preventDefault();
|
|
14309
14403
|
stepValue(1);
|
|
@@ -14312,7 +14406,7 @@ var NumberInput = factory(/* @__PURE__ */ defineComponent({
|
|
|
14312
14406
|
event.preventDefault();
|
|
14313
14407
|
stepValue(-1);
|
|
14314
14408
|
}
|
|
14315
|
-
scheduleCaretClamp(
|
|
14409
|
+
scheduleCaretClamp(input);
|
|
14316
14410
|
}
|
|
14317
14411
|
function onKeyup(event) {
|
|
14318
14412
|
scheduleCaretClamp(event.currentTarget);
|
|
@@ -14321,17 +14415,44 @@ var NumberInput = factory(/* @__PURE__ */ defineComponent({
|
|
|
14321
14415
|
scheduleCaretClamp(event.currentTarget);
|
|
14322
14416
|
}
|
|
14323
14417
|
function onFocus(event) {
|
|
14324
|
-
isEditing.value = true;
|
|
14325
14418
|
if (props.selectAllOnFocus) window.setTimeout(() => inputRef.value?.select(), 0);
|
|
14326
14419
|
else scheduleCaretClamp(event.currentTarget);
|
|
14327
14420
|
}
|
|
14421
|
+
function onPaste(event) {
|
|
14422
|
+
const pastedText = event.clipboardData?.getData("text") ?? "";
|
|
14423
|
+
const decimalSeparator = props.decimalSeparator || ".";
|
|
14424
|
+
const modifiedText = normalizePastedValue(pastedText, {
|
|
14425
|
+
decimalSeparator,
|
|
14426
|
+
thousandSeparator: props.thousandSeparator === true ? "," : props.thousandSeparator === false ? void 0 : props.thousandSeparator,
|
|
14427
|
+
allowedDecimalSeparators: props.allowedDecimalSeparators,
|
|
14428
|
+
thousandsGroupStyle: props.thousandsGroupStyle
|
|
14429
|
+
});
|
|
14430
|
+
if (modifiedText !== pastedText && inputRef.value) {
|
|
14431
|
+
event.preventDefault();
|
|
14432
|
+
const input = inputRef.value;
|
|
14433
|
+
const start = input.selectionStart ?? 0;
|
|
14434
|
+
const end = input.selectionEnd ?? 0;
|
|
14435
|
+
const newValue = input.value.slice(0, start) + modifiedText + input.value.slice(end);
|
|
14436
|
+
input.value = newValue;
|
|
14437
|
+
input.dispatchEvent(new Event("input", { bubbles: true }));
|
|
14438
|
+
const rawCaret = start + modifiedText.length;
|
|
14439
|
+
setTimeout(() => {
|
|
14440
|
+
const caret = getCaretPositionAfterPaste(newValue, rawCaret, input.value, decimalSeparator);
|
|
14441
|
+
input.setSelectionRange(caret, caret);
|
|
14442
|
+
}, 0);
|
|
14443
|
+
}
|
|
14444
|
+
}
|
|
14328
14445
|
function onBlur() {
|
|
14329
|
-
isEditing.value = false;
|
|
14330
14446
|
let sanitizedValue = value.value;
|
|
14331
14447
|
const min = typeof props.min === "number" ? props.min : void 0;
|
|
14332
14448
|
const max = typeof props.max === "number" ? props.max : void 0;
|
|
14333
14449
|
if (props.clampBehavior === "blur" && typeof sanitizedValue === "number") sanitizedValue = clamp$3(sanitizedValue, min, max);
|
|
14334
|
-
if (
|
|
14450
|
+
if (!isBigIntMode.value && typeof sanitizedValue === "string") sanitizedValue = sanitizeInputOnBlur(sanitizedValue, {
|
|
14451
|
+
min,
|
|
14452
|
+
max,
|
|
14453
|
+
trim: props.trimLeadingZeroesOnBlur && getDecimalPlaces(sanitizedValue) < 15,
|
|
14454
|
+
clamp: props.clampBehavior === "blur"
|
|
14455
|
+
});
|
|
14335
14456
|
if (sanitizedValue !== value.value) commitValue(sanitizedValue, "blur");
|
|
14336
14457
|
}
|
|
14337
14458
|
return (_ctx, _cache) => {
|
|
@@ -14365,6 +14486,7 @@ var NumberInput = factory(/* @__PURE__ */ defineComponent({
|
|
|
14365
14486
|
onKeyup,
|
|
14366
14487
|
onClick,
|
|
14367
14488
|
onFocus,
|
|
14489
|
+
onPaste,
|
|
14368
14490
|
onBlur
|
|
14369
14491
|
}), createSlots({ _: 2 }, [
|
|
14370
14492
|
unref(slots).label ? {
|
|
@@ -14638,7 +14760,7 @@ var PinInput = factory(/* @__PURE__ */ defineComponent({
|
|
|
14638
14760
|
const emit = __emit;
|
|
14639
14761
|
const attrs = useAttrs();
|
|
14640
14762
|
const props = useProps("PinInput", defaultProps$29, rawProps);
|
|
14641
|
-
const uuid = useId(props.id);
|
|
14763
|
+
const uuid = useId$1(props.id);
|
|
14642
14764
|
const focusedIndex = ref(-1);
|
|
14643
14765
|
const inputsRef = ref([]);
|
|
14644
14766
|
/** Guards `onComplete` so it fires once per completion, not on every keystroke after. */
|
|
@@ -16005,8 +16127,8 @@ var Rating = factory(/* @__PURE__ */ defineComponent({
|
|
|
16005
16127
|
const hovered = ref(-1);
|
|
16006
16128
|
const isOutside = ref(true);
|
|
16007
16129
|
const { dir } = useDirection();
|
|
16008
|
-
const name = useId(props.name);
|
|
16009
|
-
const id = useId(props.id);
|
|
16130
|
+
const name = useId$1(props.name);
|
|
16131
|
+
const id = useId$1(props.id);
|
|
16010
16132
|
const [currentValue, setCurrentValue] = useUncontrolled({
|
|
16011
16133
|
value: () => props.modelValue,
|
|
16012
16134
|
defaultValue: props.defaultValue,
|
|
@@ -16445,7 +16567,7 @@ var SegmentedControl = Object.assign(/* @__PURE__ */ defineComponent({
|
|
|
16445
16567
|
const emit = __emit;
|
|
16446
16568
|
const attrs = useAttrs();
|
|
16447
16569
|
const theme = useMantineTheme();
|
|
16448
|
-
const uuid = useId(props.name);
|
|
16570
|
+
const uuid = useId$1(props.name);
|
|
16449
16571
|
const mounted = useMounted();
|
|
16450
16572
|
const parent = ref(null);
|
|
16451
16573
|
const itemRefs = reactive({});
|
|
@@ -16481,8 +16603,16 @@ var SegmentedControl = Object.assign(/* @__PURE__ */ defineComponent({
|
|
|
16481
16603
|
parent.value = node?.$el ?? node ?? null;
|
|
16482
16604
|
};
|
|
16483
16605
|
const setItemRef = (key, node) => {
|
|
16484
|
-
|
|
16606
|
+
const element = node?.$el ?? node ?? null;
|
|
16607
|
+
if (element === null) delete itemRefs[key];
|
|
16608
|
+
else itemRefs[key] = element;
|
|
16485
16609
|
};
|
|
16610
|
+
watch(normalizedData, (items) => {
|
|
16611
|
+
const values = new Set(items.map((item) => String(item.value)));
|
|
16612
|
+
Object.keys(itemRefs).forEach((key) => {
|
|
16613
|
+
if (!values.has(key)) delete itemRefs[key];
|
|
16614
|
+
});
|
|
16615
|
+
});
|
|
16486
16616
|
const ItemLabel = (item) => h("span", getStyles("innerLabel"), resolveNode(item.label));
|
|
16487
16617
|
const handleClick = (event) => {
|
|
16488
16618
|
if (props.readOnly) event.preventDefault();
|
|
@@ -17514,7 +17644,7 @@ var Tabs_default = /* @__PURE__ */ defineComponent({
|
|
|
17514
17644
|
const emit = __emit;
|
|
17515
17645
|
const attrs = useAttrs();
|
|
17516
17646
|
const props = useProps("Tabs", defaultProps$21, rawProps);
|
|
17517
|
-
const uid = useId(props.id);
|
|
17647
|
+
const uid = useId$1(props.id);
|
|
17518
17648
|
const [currentTab, setCurrentTab] = useUncontrolled({
|
|
17519
17649
|
value: () => props.modelValue,
|
|
17520
17650
|
defaultValue: props.defaultValue,
|
|
@@ -18223,6 +18353,7 @@ var Autosize_default = /* @__PURE__ */ defineComponent({
|
|
|
18223
18353
|
}
|
|
18224
18354
|
}
|
|
18225
18355
|
const cleanupFns = [];
|
|
18356
|
+
let resizeFrame = 0;
|
|
18226
18357
|
onMounted(() => {
|
|
18227
18358
|
resizeTextarea();
|
|
18228
18359
|
const onResize = () => resizeTextarea();
|
|
@@ -18234,11 +18365,15 @@ var Autosize_default = /* @__PURE__ */ defineComponent({
|
|
|
18234
18365
|
const observer = new ResizeObserver(() => {
|
|
18235
18366
|
if (textareaRef.value && textareaRef.value.offsetWidth !== widthRef.value) {
|
|
18236
18367
|
widthRef.value = textareaRef.value.offsetWidth;
|
|
18237
|
-
|
|
18368
|
+
cancelAnimationFrame(resizeFrame);
|
|
18369
|
+
resizeFrame = requestAnimationFrame(resizeTextarea);
|
|
18238
18370
|
}
|
|
18239
18371
|
});
|
|
18240
18372
|
observer.observe(node);
|
|
18241
|
-
cleanupFns.push(() =>
|
|
18373
|
+
cleanupFns.push(() => {
|
|
18374
|
+
cancelAnimationFrame(resizeFrame);
|
|
18375
|
+
observer.disconnect();
|
|
18376
|
+
});
|
|
18242
18377
|
}
|
|
18243
18378
|
const onFontsLoaded = () => resizeTextarea();
|
|
18244
18379
|
document.fonts.addEventListener("loadingdone", onFontsLoaded);
|
|
@@ -18255,6 +18390,7 @@ var Autosize_default = /* @__PURE__ */ defineComponent({
|
|
|
18255
18390
|
cleanupFns.push(() => document.body.removeEventListener("reset", onReset));
|
|
18256
18391
|
});
|
|
18257
18392
|
onUnmounted(() => {
|
|
18393
|
+
cancelAnimationFrame(resizeFrame);
|
|
18258
18394
|
cleanupFns.forEach((fn) => fn());
|
|
18259
18395
|
cleanupFns.length = 0;
|
|
18260
18396
|
});
|
|
@@ -18850,7 +18986,7 @@ var PasswordInput = Object.assign(/* @__PURE__ */ defineComponent({
|
|
|
18850
18986
|
const slots = useSlots();
|
|
18851
18987
|
const attrs = useAttrs();
|
|
18852
18988
|
const props = useProps("PasswordInput", defaultProps$19, rawProps);
|
|
18853
|
-
const uuid = useId(props.id);
|
|
18989
|
+
const uuid = useId$1(props.id);
|
|
18854
18990
|
const fallbackId = ref(`password-input-${Math.random().toString(36).slice(2)}`);
|
|
18855
18991
|
const [visible, setVisible] = useUncontrolled({
|
|
18856
18992
|
value: () => props.visible,
|
|
@@ -19867,7 +20003,7 @@ var Checkbox = factory(/* @__PURE__ */ defineComponent({
|
|
|
19867
20003
|
const slots = useSlots();
|
|
19868
20004
|
const attrs = useAttrs();
|
|
19869
20005
|
const props = useProps("Checkbox", defaultProps$17, rawProps);
|
|
19870
|
-
const uuid = useId(props.id);
|
|
20006
|
+
const uuid = useId$1(props.id);
|
|
19871
20007
|
const groupContext = useCheckboxGroupContext();
|
|
19872
20008
|
const [localChecked, setLocalChecked] = useUncontrolled({
|
|
19873
20009
|
value: () => props.modelValue !== void 0 ? props.modelValue : props.checked,
|
|
@@ -20177,7 +20313,7 @@ var Chip = factory(/* @__PURE__ */ defineComponent({
|
|
|
20177
20313
|
const attrs = useAttrs();
|
|
20178
20314
|
const props = useProps("Chip", defaultProps$16, rawProps);
|
|
20179
20315
|
const groupContext = useChipGroupContext();
|
|
20180
|
-
const uuid = useId(props.id);
|
|
20316
|
+
const uuid = useId$1(props.id);
|
|
20181
20317
|
const [value, setValue] = useUncontrolled({
|
|
20182
20318
|
value: () => props.modelValue !== void 0 ? props.modelValue : props.checked,
|
|
20183
20319
|
defaultValue: props.defaultChecked,
|
|
@@ -20934,7 +21070,7 @@ var RadioGroup = Object.assign(/* @__PURE__ */ defineComponent({
|
|
|
20934
21070
|
const slots = useSlots();
|
|
20935
21071
|
const attrs = useAttrs();
|
|
20936
21072
|
const props = useProps("RadioGroup", null, rawProps);
|
|
20937
|
-
const name = useId(props.name);
|
|
21073
|
+
const name = useId$1(props.name);
|
|
20938
21074
|
const [value, setValue] = useUncontrolled({
|
|
20939
21075
|
value: () => props.modelValue,
|
|
20940
21076
|
defaultValue: props.defaultValue,
|
|
@@ -21388,7 +21524,7 @@ var Radio = factory(/* @__PURE__ */ defineComponent({
|
|
|
21388
21524
|
const slots = useSlots();
|
|
21389
21525
|
const attrs = useAttrs();
|
|
21390
21526
|
const props = useProps("Radio", defaultProps$15, rawProps);
|
|
21391
|
-
const uuid = useId(props.id);
|
|
21527
|
+
const uuid = useId$1(props.id);
|
|
21392
21528
|
const groupContext = useRadioGroupContext();
|
|
21393
21529
|
const [localChecked, setLocalChecked] = useUncontrolled({
|
|
21394
21530
|
value: () => props.modelValue !== void 0 ? props.modelValue : props.checked,
|
|
@@ -21854,7 +21990,7 @@ var Switch = factory(/* @__PURE__ */ defineComponent({
|
|
|
21854
21990
|
const slots = useSlots();
|
|
21855
21991
|
const attrs = useAttrs();
|
|
21856
21992
|
const props = useProps("Switch", defaultProps$13, rawProps);
|
|
21857
|
-
const uuid = useId(props.id);
|
|
21993
|
+
const uuid = useId$1(props.id);
|
|
21858
21994
|
const groupContext = useSwitchGroupContext();
|
|
21859
21995
|
const [checked, setChecked] = useUncontrolled({
|
|
21860
21996
|
value: () => props.modelValue,
|
|
@@ -22768,20 +22904,30 @@ function getEl$1(value) {
|
|
|
22768
22904
|
function useDimensions(element) {
|
|
22769
22905
|
const dimensions = ref(null);
|
|
22770
22906
|
let observer = null;
|
|
22907
|
+
let frame = 0;
|
|
22771
22908
|
onMounted(() => {
|
|
22772
22909
|
const el = getEl$1(element.value);
|
|
22773
22910
|
if (!el || typeof ResizeObserver === "undefined") return;
|
|
22774
22911
|
observer = new ResizeObserver(([entry]) => {
|
|
22775
|
-
if (entry)
|
|
22776
|
-
|
|
22777
|
-
|
|
22778
|
-
|
|
22779
|
-
|
|
22780
|
-
|
|
22912
|
+
if (entry) {
|
|
22913
|
+
const nextDimensions = {
|
|
22914
|
+
width: entry.borderBoxSize?.[0]?.inlineSize ?? entry.target.clientWidth,
|
|
22915
|
+
height: entry.borderBoxSize?.[0]?.blockSize ?? entry.target.clientHeight,
|
|
22916
|
+
contentWidth: entry.contentRect.width,
|
|
22917
|
+
contentHeight: entry.contentRect.height
|
|
22918
|
+
};
|
|
22919
|
+
cancelAnimationFrame(frame);
|
|
22920
|
+
frame = requestAnimationFrame(() => {
|
|
22921
|
+
dimensions.value = nextDimensions;
|
|
22922
|
+
});
|
|
22923
|
+
}
|
|
22781
22924
|
});
|
|
22782
22925
|
observer.observe(el);
|
|
22783
22926
|
});
|
|
22784
|
-
onBeforeUnmount(() =>
|
|
22927
|
+
onBeforeUnmount(() => {
|
|
22928
|
+
cancelAnimationFrame(frame);
|
|
22929
|
+
observer?.disconnect();
|
|
22930
|
+
});
|
|
22785
22931
|
return dimensions;
|
|
22786
22932
|
}
|
|
22787
22933
|
var OverflowList_module_default = { root: "_root_uggjd_1" };
|
|
@@ -23065,7 +23211,7 @@ var TableOfContents = factory(/* @__PURE__ */ defineComponent({
|
|
|
23065
23211
|
const rawProps = __props;
|
|
23066
23212
|
const attrs = useAttrs();
|
|
23067
23213
|
const props = useProps("TableOfContents", defaultProps$9, rawProps);
|
|
23068
|
-
const id = useId();
|
|
23214
|
+
const id = useId$1();
|
|
23069
23215
|
const spy = useScrollSpy(props.scrollSpyOptions ?? {});
|
|
23070
23216
|
assignRef(props.reinitializeRef, spy.reinitialize);
|
|
23071
23217
|
const getStyles = useStyles({
|
|
@@ -28205,12 +28351,15 @@ function useLockScroll(opened) {
|
|
|
28205
28351
|
//#endregion
|
|
28206
28352
|
//#region src/components/ModalBase/use-modal.ts
|
|
28207
28353
|
function useModal(input) {
|
|
28208
|
-
const id = useId(input.id);
|
|
28354
|
+
const id = useId$1(input.id);
|
|
28209
28355
|
const titleMounted = ref(false);
|
|
28210
28356
|
const bodyMounted = ref(false);
|
|
28211
28357
|
useWindowEvent("keydown", (event) => {
|
|
28212
28358
|
const stopped = event.target?.getAttribute?.("data-mantine-stop-propagation") === "true";
|
|
28213
|
-
if (event.key === "Escape" && !event.isComposing && input.opened() && input.closeOnEscape() && !
|
|
28359
|
+
if (event.key === "Escape" && !event.isComposing && input.opened() && input.closeOnEscape() && !input.handledEscapeEvents?.has(event) && !stopped) {
|
|
28360
|
+
input.handledEscapeEvents?.add(event);
|
|
28361
|
+
input.onClose();
|
|
28362
|
+
}
|
|
28214
28363
|
}, { capture: true });
|
|
28215
28364
|
useFocusReturn({
|
|
28216
28365
|
opened: input.opened,
|
|
@@ -28229,6 +28378,7 @@ var ModalBase = factory(/* @__PURE__ */ defineComponent({
|
|
|
28229
28378
|
inheritAttrs: false,
|
|
28230
28379
|
__name: "ModalBase",
|
|
28231
28380
|
props: {
|
|
28381
|
+
__handledEscapeEvents: {},
|
|
28232
28382
|
rootRef: {},
|
|
28233
28383
|
opened: { type: Boolean },
|
|
28234
28384
|
id: { default: void 0 },
|
|
@@ -28283,14 +28433,15 @@ var ModalBase = factory(/* @__PURE__ */ defineComponent({
|
|
|
28283
28433
|
const props = __props;
|
|
28284
28434
|
const emit = __emit;
|
|
28285
28435
|
const attrs = useAttrs();
|
|
28286
|
-
const fallbackId = useId(props.id);
|
|
28436
|
+
const fallbackId = useId$1(props.id);
|
|
28287
28437
|
const modal = useModal({
|
|
28288
28438
|
id: props.id,
|
|
28289
28439
|
opened: () => props.opened,
|
|
28290
28440
|
onClose: () => emit("close"),
|
|
28291
28441
|
trapFocus: () => props.trapFocus,
|
|
28292
28442
|
closeOnEscape: () => props.closeOnEscape,
|
|
28293
|
-
returnFocus: () => props.returnFocus
|
|
28443
|
+
returnFocus: () => props.returnFocus,
|
|
28444
|
+
handledEscapeEvents: props.__handledEscapeEvents
|
|
28294
28445
|
});
|
|
28295
28446
|
useLockScroll(computed(() => props.opened && props.lockScroll));
|
|
28296
28447
|
provideModalBaseContext({
|
|
@@ -28721,6 +28872,7 @@ var ModalRoot_default = /* @__PURE__ */ defineComponent({
|
|
|
28721
28872
|
classNames: {},
|
|
28722
28873
|
styles: {},
|
|
28723
28874
|
vars: {},
|
|
28875
|
+
__handledEscapeEvents: {},
|
|
28724
28876
|
rootRef: {},
|
|
28725
28877
|
opened: { type: Boolean },
|
|
28726
28878
|
id: {},
|
|
@@ -28884,6 +29036,7 @@ var Modal_default = /* @__PURE__ */ defineComponent({
|
|
|
28884
29036
|
classNames: {},
|
|
28885
29037
|
styles: {},
|
|
28886
29038
|
vars: {},
|
|
29039
|
+
__handledEscapeEvents: {},
|
|
28887
29040
|
rootRef: {},
|
|
28888
29041
|
opened: { type: Boolean },
|
|
28889
29042
|
id: {},
|
|
@@ -29106,6 +29259,7 @@ var DrawerRoot_default = /* @__PURE__ */ defineComponent({
|
|
|
29106
29259
|
offset: { default: 0 },
|
|
29107
29260
|
size: { default: "md" },
|
|
29108
29261
|
scrollAreaComponent: {},
|
|
29262
|
+
__handledEscapeEvents: {},
|
|
29109
29263
|
rootRef: {},
|
|
29110
29264
|
opened: { type: Boolean },
|
|
29111
29265
|
id: {},
|
|
@@ -29269,6 +29423,7 @@ var Drawer_default = /* @__PURE__ */ defineComponent({
|
|
|
29269
29423
|
offset: {},
|
|
29270
29424
|
size: {},
|
|
29271
29425
|
scrollAreaComponent: {},
|
|
29426
|
+
__handledEscapeEvents: {},
|
|
29272
29427
|
rootRef: {},
|
|
29273
29428
|
opened: { type: Boolean },
|
|
29274
29429
|
id: {},
|
|
@@ -29340,7 +29495,8 @@ var Drawer_default = /* @__PURE__ */ defineComponent({
|
|
|
29340
29495
|
const isCurrent = stackCtx.currentId === props.stackId;
|
|
29341
29496
|
return {
|
|
29342
29497
|
closeOnEscape: isCurrent,
|
|
29343
|
-
trapFocus: isCurrent
|
|
29498
|
+
trapFocus: isCurrent,
|
|
29499
|
+
__handledEscapeEvents: stackCtx.handledEscapeEvents
|
|
29344
29500
|
};
|
|
29345
29501
|
});
|
|
29346
29502
|
/** One overlay for the whole stack: only the topmost drawer renders it. */
|
|
@@ -29445,7 +29601,8 @@ var DrawerStack_default = /* @__PURE__ */ defineComponent({
|
|
|
29445
29601
|
},
|
|
29446
29602
|
get maxZIndex() {
|
|
29447
29603
|
return maxZIndex.value;
|
|
29448
|
-
}
|
|
29604
|
+
},
|
|
29605
|
+
handledEscapeEvents: /* @__PURE__ */ new WeakSet()
|
|
29449
29606
|
}));
|
|
29450
29607
|
return (_ctx, _cache) => {
|
|
29451
29608
|
return renderSlot(_ctx.$slots, "default");
|
|
@@ -29955,7 +30112,7 @@ var Popover_default = /* @__PURE__ */ defineComponent({
|
|
|
29955
30112
|
const emit = __emit;
|
|
29956
30113
|
const props = useProps("Popover", defaults$2, rawProps);
|
|
29957
30114
|
const { dir } = useDirection();
|
|
29958
|
-
const id = useId(props.id);
|
|
30115
|
+
const id = useId$1(props.id);
|
|
29959
30116
|
const internal = ref(props.defaultOpened);
|
|
29960
30117
|
const isControlled = computed(() => rawProps.opened !== void 0);
|
|
29961
30118
|
const opened = computed(() => isControlled.value ? !!rawProps.opened : internal.value);
|
|
@@ -32191,6 +32348,8 @@ var MenuSub_default = /* @__PURE__ */ defineComponent({
|
|
|
32191
32348
|
inheritAttrs: false,
|
|
32192
32349
|
__name: "MenuSub",
|
|
32193
32350
|
props: {
|
|
32351
|
+
withinPortal: {},
|
|
32352
|
+
portalProps: {},
|
|
32194
32353
|
opened: {
|
|
32195
32354
|
type: Boolean,
|
|
32196
32355
|
default: void 0
|
|
@@ -32224,7 +32383,7 @@ var MenuSub_default = /* @__PURE__ */ defineComponent({
|
|
|
32224
32383
|
transitionProps: props.transitionProps,
|
|
32225
32384
|
middlewares: props.middlewares,
|
|
32226
32385
|
closeOnItemClick: false,
|
|
32227
|
-
withinPortal:
|
|
32386
|
+
withinPortal: false
|
|
32228
32387
|
}));
|
|
32229
32388
|
return (_ctx, _cache) => {
|
|
32230
32389
|
return openBlock(), createBlock(Menu_default, normalizeProps(guardReactiveProps(menuBindings.value)), {
|
|
@@ -32581,7 +32740,7 @@ var Menubar_default = /* @__PURE__ */ defineComponent({
|
|
|
32581
32740
|
const setRootRef = (el) => {
|
|
32582
32741
|
rootRef.value = el?.$el ?? el;
|
|
32583
32742
|
};
|
|
32584
|
-
const menubarId = useId();
|
|
32743
|
+
const menubarId = useId$1();
|
|
32585
32744
|
const revision = ref(0);
|
|
32586
32745
|
const [openIndexRef, setOpenIndex] = useUncontrolled({
|
|
32587
32746
|
value: () => props.openIndex,
|
|
@@ -32845,7 +33004,7 @@ var MenubarMenu = /* @__PURE__ */ defineComponent({
|
|
|
32845
33004
|
const props = __props;
|
|
32846
33005
|
const attrs = useAttrs();
|
|
32847
33006
|
const ctx = useMenubarContext();
|
|
32848
|
-
const id = useId();
|
|
33007
|
+
const id = useId$1();
|
|
32849
33008
|
const index = computed(() => props.__index);
|
|
32850
33009
|
const opened = computed(() => ctx.openIndex !== null && index.value !== -1 && ctx.openIndex === index.value);
|
|
32851
33010
|
/** Getters keep the provided object reactive without changing the shape consumers read. */
|
|
@@ -33210,7 +33369,6 @@ function useCombobox(options = {}) {
|
|
|
33210
33369
|
const items = () => Array.from(list()?.querySelectorAll("[data-combobox-option]") ?? []);
|
|
33211
33370
|
const clearSelected = () => items().forEach((item) => {
|
|
33212
33371
|
item.removeAttribute("data-combobox-selected");
|
|
33213
|
-
item.removeAttribute("aria-selected");
|
|
33214
33372
|
});
|
|
33215
33373
|
const selectOption = (index) => {
|
|
33216
33374
|
const optionsList = items();
|
|
@@ -33225,7 +33383,6 @@ function useCombobox(options = {}) {
|
|
|
33225
33383
|
selectedIndex.value = next;
|
|
33226
33384
|
clearSelected();
|
|
33227
33385
|
optionsList[next].setAttribute("data-combobox-selected", "true");
|
|
33228
|
-
optionsList[next].setAttribute("aria-selected", "true");
|
|
33229
33386
|
optionsList[next].scrollIntoView?.({
|
|
33230
33387
|
block: "nearest",
|
|
33231
33388
|
behavior: options.scrollBehavior ?? "instant"
|
|
@@ -33675,7 +33832,7 @@ var ComboboxGroup_default = /* @__PURE__ */ defineComponent({
|
|
|
33675
33832
|
const props = __props;
|
|
33676
33833
|
const attrs = useAttrs();
|
|
33677
33834
|
const ctx = useComboboxContext();
|
|
33678
|
-
const id = useId(props.id);
|
|
33835
|
+
const id = useId$1(props.id);
|
|
33679
33836
|
const groupStyles = computed(() => ctx.getStyles("group", {
|
|
33680
33837
|
className: attrs.class,
|
|
33681
33838
|
style: attrs.style
|
|
@@ -33767,7 +33924,7 @@ var ComboboxOption_default = /* @__PURE__ */ defineComponent({
|
|
|
33767
33924
|
const props = __props;
|
|
33768
33925
|
const attrs = useAttrs();
|
|
33769
33926
|
const ctx = useComboboxContext();
|
|
33770
|
-
const id = useId(props.id);
|
|
33927
|
+
const id = useId$1(props.id);
|
|
33771
33928
|
/**
|
|
33772
33929
|
* The consumer handlers are chained explicitly below, so they must not also reach the
|
|
33773
33930
|
* element through the fallthrough attributes or they would fire twice.
|
|
@@ -33842,7 +33999,7 @@ var ComboboxOptions_default = /* @__PURE__ */ defineComponent({
|
|
|
33842
33999
|
const props = __props;
|
|
33843
34000
|
const attrs = useAttrs();
|
|
33844
34001
|
const ctx = useComboboxContext();
|
|
33845
|
-
const id = useId(props.id);
|
|
34002
|
+
const id = useId$1(props.id);
|
|
33846
34003
|
onMounted(() => ctx.store.setListId(id.value));
|
|
33847
34004
|
/**
|
|
33848
34005
|
* The consumer handler is chained explicitly below, so it must not also reach the
|
|
@@ -34677,7 +34834,6 @@ var ComboboxPopover_default = /* @__PURE__ */ defineComponent({
|
|
|
34677
34834
|
onDropdownClose: () => {
|
|
34678
34835
|
emit("dropdown-close");
|
|
34679
34836
|
combobox.resetSelectedOption();
|
|
34680
|
-
if (props.searchable) combobox.focusTarget();
|
|
34681
34837
|
}
|
|
34682
34838
|
});
|
|
34683
34839
|
function handleSearchChange(val) {
|
|
@@ -34713,6 +34869,7 @@ var ComboboxPopover_default = /* @__PURE__ */ defineComponent({
|
|
|
34713
34869
|
styles: props.styles,
|
|
34714
34870
|
unstyled: props.unstyled,
|
|
34715
34871
|
onOptionSubmit: handleOptionSubmit,
|
|
34872
|
+
returnFocus: true,
|
|
34716
34873
|
...props.comboboxProps,
|
|
34717
34874
|
...attrs
|
|
34718
34875
|
}));
|
|
@@ -35622,7 +35779,7 @@ var Select = Object.assign(/* @__PURE__ */ defineComponent({
|
|
|
35622
35779
|
watch(() => search(), () => {
|
|
35623
35780
|
if (props.selectFirstOptionOnChange) nextTick(combobox.selectFirstOption);
|
|
35624
35781
|
});
|
|
35625
|
-
const id = useId(attrs.id);
|
|
35782
|
+
const id = useId$1(attrs.id);
|
|
35626
35783
|
function clear(event) {
|
|
35627
35784
|
event?.stopPropagation();
|
|
35628
35785
|
changeValue(null, null);
|
|
@@ -35925,7 +36082,7 @@ var Autocomplete = Object.assign(/* @__PURE__ */ defineComponent({
|
|
|
35925
36082
|
watch(() => current(), () => {
|
|
35926
36083
|
if (props.selectFirstOptionOnChange) nextTick(combobox.selectFirstOption);
|
|
35927
36084
|
});
|
|
35928
|
-
const id = useId(attrs.id);
|
|
36085
|
+
const id = useId$1(attrs.id);
|
|
35929
36086
|
function clear(event) {
|
|
35930
36087
|
event?.stopPropagation();
|
|
35931
36088
|
change("");
|
|
@@ -37952,7 +38109,7 @@ var Cascader = Object.assign(/* @__PURE__ */ defineComponent({
|
|
|
37952
38109
|
const emit = __emit;
|
|
37953
38110
|
const slots = useSlots();
|
|
37954
38111
|
const attrs = useAttrs();
|
|
37955
|
-
const id = useId(attrs.id);
|
|
38112
|
+
const id = useId$1(attrs.id);
|
|
37956
38113
|
const internalValue = ref(props.defaultValue ?? null);
|
|
37957
38114
|
const currentValue = computed(() => props.modelValue !== void 0 ? props.modelValue : internalValue.value);
|
|
37958
38115
|
const pathOptions = computed(() => getCascaderPathOptions(props.data, currentValue.value));
|