@nsshunt/stsvueutils 1.0.113 → 1.0.115

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.
@@ -1594,14 +1594,14 @@ var __privateMethod = (obj, member, method) => {
1594
1594
  const results = [];
1595
1595
  const chunks = arguments_.trim().split(/\s*,\s*/g);
1596
1596
  let matches;
1597
- for (const chunk2 of chunks) {
1598
- const number = Number(chunk2);
1597
+ for (const chunk of chunks) {
1598
+ const number = Number(chunk);
1599
1599
  if (!Number.isNaN(number)) {
1600
1600
  results.push(number);
1601
- } else if (matches = chunk2.match(STRING_REGEX)) {
1601
+ } else if (matches = chunk.match(STRING_REGEX)) {
1602
1602
  results.push(matches[2].replace(ESCAPE_REGEX, (m, escape2, character) => escape2 ? unescape(escape2) : character));
1603
1603
  } else {
1604
- throw new Error(`Invalid Chalk template style argument: ${chunk2} (in style '${name}')`);
1604
+ throw new Error(`Invalid Chalk template style argument: ${chunk} (in style '${name}')`);
1605
1605
  }
1606
1606
  }
1607
1607
  return results;
@@ -1643,27 +1643,27 @@ var __privateMethod = (obj, member, method) => {
1643
1643
  templates = (chalk2, temporary) => {
1644
1644
  const styles2 = [];
1645
1645
  const chunks = [];
1646
- let chunk2 = [];
1646
+ let chunk = [];
1647
1647
  temporary.replace(TEMPLATE_REGEX, (m, escapeCharacter, inverse, style, close, character) => {
1648
1648
  if (escapeCharacter) {
1649
- chunk2.push(unescape(escapeCharacter));
1649
+ chunk.push(unescape(escapeCharacter));
1650
1650
  } else if (style) {
1651
- const string = chunk2.join("");
1652
- chunk2 = [];
1651
+ const string = chunk.join("");
1652
+ chunk = [];
1653
1653
  chunks.push(styles2.length === 0 ? string : buildStyle(chalk2, styles2)(string));
1654
1654
  styles2.push({ inverse, styles: parseStyle(style) });
1655
1655
  } else if (close) {
1656
1656
  if (styles2.length === 0) {
1657
1657
  throw new Error("Found extraneous } in Chalk template literal");
1658
1658
  }
1659
- chunks.push(buildStyle(chalk2, styles2)(chunk2.join("")));
1660
- chunk2 = [];
1659
+ chunks.push(buildStyle(chalk2, styles2)(chunk.join("")));
1660
+ chunk = [];
1661
1661
  styles2.pop();
1662
1662
  } else {
1663
- chunk2.push(character);
1663
+ chunk.push(character);
1664
1664
  }
1665
1665
  });
1666
- chunks.push(chunk2.join(""));
1666
+ chunks.push(chunk.join(""));
1667
1667
  if (styles2.length > 0) {
1668
1668
  const errMessage = `Chalk template literal is missing ${styles2.length} closing bracket${styles2.length === 1 ? "" : "s"} (\`}\`)`;
1669
1669
  throw new Error(errMessage);
@@ -2466,4607 +2466,6 @@ var __privateMethod = (obj, member, method) => {
2466
2466
  _SetMessagePort = new WeakMap();
2467
2467
  _AddAsyncRunner = new WeakMap();
2468
2468
  _StopRunners = new WeakMap();
2469
- const IN_BROWSER = typeof window !== "undefined";
2470
- const SUPPORTS_INTERSECTION = IN_BROWSER && "IntersectionObserver" in window;
2471
- function deepEqual(a, b) {
2472
- if (a === b)
2473
- return true;
2474
- if (a instanceof Date && b instanceof Date && a.getTime() !== b.getTime()) {
2475
- return false;
2476
- }
2477
- if (a !== Object(a) || b !== Object(b)) {
2478
- return false;
2479
- }
2480
- const props = Object.keys(a);
2481
- if (props.length !== Object.keys(b).length) {
2482
- return false;
2483
- }
2484
- return props.every((p) => deepEqual(a[p], b[p]));
2485
- }
2486
- function createRange(length) {
2487
- let start = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0;
2488
- return Array.from({
2489
- length
2490
- }, (v, k) => start + k);
2491
- }
2492
- function convertToUnit(str) {
2493
- let unit = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "px";
2494
- if (str == null || str === "") {
2495
- return void 0;
2496
- } else if (isNaN(+str)) {
2497
- return String(str);
2498
- } else if (!isFinite(+str)) {
2499
- return void 0;
2500
- } else {
2501
- return `${Number(str)}${unit}`;
2502
- }
2503
- }
2504
- function isObject(obj) {
2505
- return obj !== null && typeof obj === "object" && !Array.isArray(obj);
2506
- }
2507
- const keyCodes = Object.freeze({
2508
- enter: 13,
2509
- tab: 9,
2510
- delete: 46,
2511
- esc: 27,
2512
- space: 32,
2513
- up: 38,
2514
- down: 40,
2515
- left: 37,
2516
- right: 39,
2517
- end: 35,
2518
- home: 36,
2519
- del: 46,
2520
- backspace: 8,
2521
- insert: 45,
2522
- pageup: 33,
2523
- pagedown: 34,
2524
- shift: 16
2525
- });
2526
- const keyValues = Object.freeze({
2527
- enter: "Enter",
2528
- tab: "Tab",
2529
- delete: "Delete",
2530
- esc: "Escape",
2531
- space: "Space",
2532
- up: "ArrowUp",
2533
- down: "ArrowDown",
2534
- left: "ArrowLeft",
2535
- right: "ArrowRight",
2536
- end: "End",
2537
- home: "Home",
2538
- del: "Delete",
2539
- backspace: "Backspace",
2540
- insert: "Insert",
2541
- pageup: "PageUp",
2542
- pagedown: "PageDown",
2543
- shift: "Shift"
2544
- });
2545
- function has(obj, key) {
2546
- return key.every((k) => obj.hasOwnProperty(k));
2547
- }
2548
- function pick(obj, paths) {
2549
- const found = {};
2550
- const keys = new Set(Object.keys(obj));
2551
- for (const path of paths) {
2552
- if (keys.has(path)) {
2553
- found[path] = obj[path];
2554
- }
2555
- }
2556
- return found;
2557
- }
2558
- function pickWithRest(obj, paths, exclude) {
2559
- const found = /* @__PURE__ */ Object.create(null);
2560
- const rest = /* @__PURE__ */ Object.create(null);
2561
- for (const key in obj) {
2562
- if (paths.some((path) => path instanceof RegExp ? path.test(key) : path === key) && !(exclude == null ? void 0 : exclude.some((path) => path === key))) {
2563
- found[key] = obj[key];
2564
- } else {
2565
- rest[key] = obj[key];
2566
- }
2567
- }
2568
- return [found, rest];
2569
- }
2570
- function omit(obj, exclude) {
2571
- const clone = {
2572
- ...obj
2573
- };
2574
- exclude.forEach((prop) => delete clone[prop]);
2575
- return clone;
2576
- }
2577
- const onRE = /^on[^a-z]/;
2578
- const isOn = (key) => onRE.test(key);
2579
- const bubblingEvents = ["onAfterscriptexecute", "onAnimationcancel", "onAnimationend", "onAnimationiteration", "onAnimationstart", "onAuxclick", "onBeforeinput", "onBeforescriptexecute", "onChange", "onClick", "onCompositionend", "onCompositionstart", "onCompositionupdate", "onContextmenu", "onCopy", "onCut", "onDblclick", "onFocusin", "onFocusout", "onFullscreenchange", "onFullscreenerror", "onGesturechange", "onGestureend", "onGesturestart", "onGotpointercapture", "onInput", "onKeydown", "onKeypress", "onKeyup", "onLostpointercapture", "onMousedown", "onMousemove", "onMouseout", "onMouseover", "onMouseup", "onMousewheel", "onPaste", "onPointercancel", "onPointerdown", "onPointerenter", "onPointerleave", "onPointermove", "onPointerout", "onPointerover", "onPointerup", "onReset", "onSelect", "onSubmit", "onTouchcancel", "onTouchend", "onTouchmove", "onTouchstart", "onTransitioncancel", "onTransitionend", "onTransitionrun", "onTransitionstart", "onWheel"];
2580
- function filterInputAttrs(attrs) {
2581
- const [events, props] = pickWithRest(attrs, [onRE]);
2582
- const inputEvents = omit(events, bubblingEvents);
2583
- const [rootAttrs, inputAttrs] = pickWithRest(props, ["class", "style", "id", /^data-/]);
2584
- Object.assign(rootAttrs, events);
2585
- Object.assign(inputAttrs, inputEvents);
2586
- return [rootAttrs, inputAttrs];
2587
- }
2588
- function wrapInArray(v) {
2589
- return v == null ? [] : Array.isArray(v) ? v : [v];
2590
- }
2591
- function clamp(value) {
2592
- let min = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0;
2593
- let max = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : 1;
2594
- return Math.max(min, Math.min(max, value));
2595
- }
2596
- function getDecimals(value) {
2597
- const trimmedStr = value.toString().trim();
2598
- return trimmedStr.includes(".") ? trimmedStr.length - trimmedStr.indexOf(".") - 1 : 0;
2599
- }
2600
- function padEnd(str, length) {
2601
- let char = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : "0";
2602
- return str + char.repeat(Math.max(0, length - str.length));
2603
- }
2604
- function chunk(str) {
2605
- let size = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 1;
2606
- const chunked = [];
2607
- let index = 0;
2608
- while (index < str.length) {
2609
- chunked.push(str.substr(index, size));
2610
- index += size;
2611
- }
2612
- return chunked;
2613
- }
2614
- function mergeDeep() {
2615
- let source2 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
2616
- let target = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
2617
- let arrayFn = arguments.length > 2 ? arguments[2] : void 0;
2618
- const out = {};
2619
- for (const key in source2) {
2620
- out[key] = source2[key];
2621
- }
2622
- for (const key in target) {
2623
- const sourceProperty = source2[key];
2624
- const targetProperty = target[key];
2625
- if (isObject(sourceProperty) && isObject(targetProperty)) {
2626
- out[key] = mergeDeep(sourceProperty, targetProperty, arrayFn);
2627
- continue;
2628
- }
2629
- if (Array.isArray(sourceProperty) && Array.isArray(targetProperty) && arrayFn) {
2630
- out[key] = arrayFn(sourceProperty, targetProperty);
2631
- continue;
2632
- }
2633
- out[key] = targetProperty;
2634
- }
2635
- return out;
2636
- }
2637
- function flattenFragments(nodes) {
2638
- return nodes.map((node) => {
2639
- if (node.type === vue.Fragment) {
2640
- return flattenFragments(node.children);
2641
- } else {
2642
- return node;
2643
- }
2644
- }).flat();
2645
- }
2646
- function toKebabCase() {
2647
- let str = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "";
2648
- if (toKebabCase.cache.has(str))
2649
- return toKebabCase.cache.get(str);
2650
- const kebab = str.replace(/[^a-z]/gi, "-").replace(/\B([A-Z])/g, "-$1").toLowerCase();
2651
- toKebabCase.cache.set(str, kebab);
2652
- return kebab;
2653
- }
2654
- toKebabCase.cache = /* @__PURE__ */ new Map();
2655
- function destructComputed(getter) {
2656
- const refs = vue.reactive({});
2657
- const base = vue.computed(getter);
2658
- vue.watchEffect(() => {
2659
- for (const key in base.value) {
2660
- refs[key] = base.value[key];
2661
- }
2662
- }, {
2663
- flush: "sync"
2664
- });
2665
- return vue.toRefs(refs);
2666
- }
2667
- function includes(arr, val) {
2668
- return arr.includes(val);
2669
- }
2670
- const EventProp = () => [Function, Array];
2671
- function callEvent(handler) {
2672
- for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
2673
- args[_key2 - 1] = arguments[_key2];
2674
- }
2675
- if (Array.isArray(handler)) {
2676
- for (const h of handler) {
2677
- h(...args);
2678
- }
2679
- } else if (typeof handler === "function") {
2680
- handler(...args);
2681
- }
2682
- }
2683
- function matchesSelector(el, selector) {
2684
- const supportsSelector = IN_BROWSER && typeof CSS !== "undefined" && typeof CSS.supports !== "undefined" && CSS.supports(`selector(${selector})`);
2685
- if (!supportsSelector)
2686
- return null;
2687
- try {
2688
- return !!el && el.matches(selector);
2689
- } catch (err) {
2690
- return null;
2691
- }
2692
- }
2693
- const block = ["top", "bottom"];
2694
- const inline = ["start", "end", "left", "right"];
2695
- function parseAnchor(anchor, isRtl) {
2696
- let [side, align] = anchor.split(" ");
2697
- if (!align) {
2698
- align = includes(block, side) ? "start" : includes(inline, side) ? "top" : "center";
2699
- }
2700
- return {
2701
- side: toPhysical(side, isRtl),
2702
- align: toPhysical(align, isRtl)
2703
- };
2704
- }
2705
- function toPhysical(str, isRtl) {
2706
- if (str === "start")
2707
- return isRtl ? "right" : "left";
2708
- if (str === "end")
2709
- return isRtl ? "left" : "right";
2710
- return str;
2711
- }
2712
- class Box {
2713
- constructor(_ref) {
2714
- let {
2715
- x,
2716
- y,
2717
- width,
2718
- height
2719
- } = _ref;
2720
- this.x = x;
2721
- this.y = y;
2722
- this.width = width;
2723
- this.height = height;
2724
- }
2725
- get top() {
2726
- return this.y;
2727
- }
2728
- get bottom() {
2729
- return this.y + this.height;
2730
- }
2731
- get left() {
2732
- return this.x;
2733
- }
2734
- get right() {
2735
- return this.x + this.width;
2736
- }
2737
- }
2738
- function nullifyTransforms(el) {
2739
- const rect = el.getBoundingClientRect();
2740
- const style = getComputedStyle(el);
2741
- const tx = style.transform;
2742
- if (tx) {
2743
- let ta, sx, sy, dx, dy;
2744
- if (tx.startsWith("matrix3d(")) {
2745
- ta = tx.slice(9, -1).split(/, /);
2746
- sx = +ta[0];
2747
- sy = +ta[5];
2748
- dx = +ta[12];
2749
- dy = +ta[13];
2750
- } else if (tx.startsWith("matrix(")) {
2751
- ta = tx.slice(7, -1).split(/, /);
2752
- sx = +ta[0];
2753
- sy = +ta[3];
2754
- dx = +ta[4];
2755
- dy = +ta[5];
2756
- } else {
2757
- return new Box(rect);
2758
- }
2759
- const to = style.transformOrigin;
2760
- const x = rect.x - dx - (1 - sx) * parseFloat(to);
2761
- const y = rect.y - dy - (1 - sy) * parseFloat(to.slice(to.indexOf(" ") + 1));
2762
- const w = sx ? rect.width / sx : el.offsetWidth + 1;
2763
- const h = sy ? rect.height / sy : el.offsetHeight + 1;
2764
- return new Box({
2765
- x,
2766
- y,
2767
- width: w,
2768
- height: h
2769
- });
2770
- } else {
2771
- return new Box(rect);
2772
- }
2773
- }
2774
- function animate(el, keyframes, options) {
2775
- if (typeof el.animate === "undefined")
2776
- return {
2777
- finished: Promise.resolve()
2778
- };
2779
- let animation;
2780
- try {
2781
- animation = el.animate(keyframes, options);
2782
- } catch (err) {
2783
- return {
2784
- finished: Promise.resolve()
2785
- };
2786
- }
2787
- if (typeof animation.finished === "undefined") {
2788
- animation.finished = new Promise((resolve) => {
2789
- animation.onfinish = () => {
2790
- resolve(animation);
2791
- };
2792
- });
2793
- }
2794
- return animation;
2795
- }
2796
- const mainTRC = 2.4;
2797
- const Rco = 0.2126729;
2798
- const Gco = 0.7151522;
2799
- const Bco = 0.072175;
2800
- const normBG = 0.55;
2801
- const normTXT = 0.58;
2802
- const revTXT = 0.57;
2803
- const revBG = 0.62;
2804
- const blkThrs = 0.03;
2805
- const blkClmp = 1.45;
2806
- const deltaYmin = 5e-4;
2807
- const scaleBoW = 1.25;
2808
- const scaleWoB = 1.25;
2809
- const loConThresh = 0.078;
2810
- const loConFactor = 12.82051282051282;
2811
- const loConOffset = 0.06;
2812
- const loClip = 1e-3;
2813
- function APCAcontrast(text, background) {
2814
- const Rtxt = (text.r / 255) ** mainTRC;
2815
- const Gtxt = (text.g / 255) ** mainTRC;
2816
- const Btxt = (text.b / 255) ** mainTRC;
2817
- const Rbg = (background.r / 255) ** mainTRC;
2818
- const Gbg = (background.g / 255) ** mainTRC;
2819
- const Bbg = (background.b / 255) ** mainTRC;
2820
- let Ytxt = Rtxt * Rco + Gtxt * Gco + Btxt * Bco;
2821
- let Ybg = Rbg * Rco + Gbg * Gco + Bbg * Bco;
2822
- if (Ytxt <= blkThrs)
2823
- Ytxt += (blkThrs - Ytxt) ** blkClmp;
2824
- if (Ybg <= blkThrs)
2825
- Ybg += (blkThrs - Ybg) ** blkClmp;
2826
- if (Math.abs(Ybg - Ytxt) < deltaYmin)
2827
- return 0;
2828
- let outputContrast;
2829
- if (Ybg > Ytxt) {
2830
- const SAPC = (Ybg ** normBG - Ytxt ** normTXT) * scaleBoW;
2831
- outputContrast = SAPC < loClip ? 0 : SAPC < loConThresh ? SAPC - SAPC * loConFactor * loConOffset : SAPC - loConOffset;
2832
- } else {
2833
- const SAPC = (Ybg ** revBG - Ytxt ** revTXT) * scaleWoB;
2834
- outputContrast = SAPC > -loClip ? 0 : SAPC > -loConThresh ? SAPC - SAPC * loConFactor * loConOffset : SAPC + loConOffset;
2835
- }
2836
- return outputContrast * 100;
2837
- }
2838
- function consoleWarn(message) {
2839
- vue.warn(`Vuetify: ${message}`);
2840
- }
2841
- function isCssColor(color) {
2842
- return !!color && /^(#|var\(--|(rgb|hsl)a?\()/.test(color);
2843
- }
2844
- function isParsableColor(color) {
2845
- return isCssColor(color) && !/^((rgb|hsl)a?\()?var\(--/.test(color);
2846
- }
2847
- const cssColorRe = /^(?<fn>(?:rgb|hsl)a?)\((?<values>.+)\)/;
2848
- const mappers = {
2849
- rgb: (r, g, b, a) => ({
2850
- r,
2851
- g,
2852
- b,
2853
- a
2854
- }),
2855
- rgba: (r, g, b, a) => ({
2856
- r,
2857
- g,
2858
- b,
2859
- a
2860
- }),
2861
- hsl: (h, s, l, a) => HSLtoRGB({
2862
- h,
2863
- s,
2864
- l,
2865
- a
2866
- }),
2867
- hsla: (h, s, l, a) => HSLtoRGB({
2868
- h,
2869
- s,
2870
- l,
2871
- a
2872
- }),
2873
- hsv: (h, s, v, a) => HSVtoRGB({
2874
- h,
2875
- s,
2876
- v,
2877
- a
2878
- }),
2879
- hsva: (h, s, v, a) => HSVtoRGB({
2880
- h,
2881
- s,
2882
- v,
2883
- a
2884
- })
2885
- };
2886
- function parseColor(color) {
2887
- if (typeof color === "number") {
2888
- if (isNaN(color) || color < 0 || color > 16777215) {
2889
- consoleWarn(`'${color}' is not a valid hex color`);
2890
- }
2891
- return {
2892
- r: (color & 16711680) >> 16,
2893
- g: (color & 65280) >> 8,
2894
- b: color & 255
2895
- };
2896
- } else if (typeof color === "string" && cssColorRe.test(color)) {
2897
- const {
2898
- groups
2899
- } = color.match(cssColorRe);
2900
- const {
2901
- fn,
2902
- values
2903
- } = groups;
2904
- const realValues = values.split(/,\s*/).map((v) => {
2905
- if (v.endsWith("%") && ["hsl", "hsla", "hsv", "hsva"].includes(fn)) {
2906
- return parseFloat(v) / 100;
2907
- } else {
2908
- return parseFloat(v);
2909
- }
2910
- });
2911
- return mappers[fn](...realValues);
2912
- } else if (typeof color === "string") {
2913
- let hex = color.startsWith("#") ? color.slice(1) : color;
2914
- if ([3, 4].includes(hex.length)) {
2915
- hex = hex.split("").map((char) => char + char).join("");
2916
- } else if (![6, 8].includes(hex.length)) {
2917
- consoleWarn(`'${color}' is not a valid hex(a) color`);
2918
- }
2919
- const int = parseInt(hex, 16);
2920
- if (isNaN(int) || int < 0 || int > 4294967295) {
2921
- consoleWarn(`'${color}' is not a valid hex(a) color`);
2922
- }
2923
- return HexToRGB(hex);
2924
- } else if (typeof color === "object") {
2925
- if (has(color, ["r", "g", "b"])) {
2926
- return color;
2927
- } else if (has(color, ["h", "s", "l"])) {
2928
- return HSVtoRGB(HSLtoHSV(color));
2929
- } else if (has(color, ["h", "s", "v"])) {
2930
- return HSVtoRGB(color);
2931
- }
2932
- }
2933
- throw new TypeError(`Invalid color: ${color == null ? color : String(color) || color.constructor.name}
2934
- Expected #hex, #hexa, rgb(), rgba(), hsl(), hsla(), object or number`);
2935
- }
2936
- function HSVtoRGB(hsva) {
2937
- const {
2938
- h,
2939
- s,
2940
- v,
2941
- a
2942
- } = hsva;
2943
- const f = (n) => {
2944
- const k = (n + h / 60) % 6;
2945
- return v - v * s * Math.max(Math.min(k, 4 - k, 1), 0);
2946
- };
2947
- const rgb = [f(5), f(3), f(1)].map((v2) => Math.round(v2 * 255));
2948
- return {
2949
- r: rgb[0],
2950
- g: rgb[1],
2951
- b: rgb[2],
2952
- a
2953
- };
2954
- }
2955
- function HSLtoRGB(hsla) {
2956
- return HSVtoRGB(HSLtoHSV(hsla));
2957
- }
2958
- function HSLtoHSV(hsl) {
2959
- const {
2960
- h,
2961
- s,
2962
- l,
2963
- a
2964
- } = hsl;
2965
- const v = l + s * Math.min(l, 1 - l);
2966
- const sprime = v === 0 ? 0 : 2 - 2 * l / v;
2967
- return {
2968
- h,
2969
- s: sprime,
2970
- v,
2971
- a
2972
- };
2973
- }
2974
- function HexToRGB(hex) {
2975
- hex = parseHex(hex);
2976
- let [r, g, b, a] = chunk(hex, 2).map((c) => parseInt(c, 16));
2977
- a = a === void 0 ? a : a / 255;
2978
- return {
2979
- r,
2980
- g,
2981
- b,
2982
- a
2983
- };
2984
- }
2985
- function parseHex(hex) {
2986
- if (hex.startsWith("#")) {
2987
- hex = hex.slice(1);
2988
- }
2989
- hex = hex.replace(/([^0-9a-f])/gi, "F");
2990
- if (hex.length === 3 || hex.length === 4) {
2991
- hex = hex.split("").map((x) => x + x).join("");
2992
- }
2993
- if (hex.length !== 6) {
2994
- hex = padEnd(padEnd(hex, 6), 8, "F");
2995
- }
2996
- return hex;
2997
- }
2998
- function getForeground(color) {
2999
- const blackContrast = Math.abs(APCAcontrast(parseColor(0), parseColor(color)));
3000
- const whiteContrast = Math.abs(APCAcontrast(parseColor(16777215), parseColor(color)));
3001
- return whiteContrast > Math.min(blackContrast, 50) ? "#fff" : "#000";
3002
- }
3003
- function propsFactory(props, source2) {
3004
- return (defaults) => {
3005
- return Object.keys(props).reduce((obj, prop) => {
3006
- const isObjectDefinition = typeof props[prop] === "object" && props[prop] != null && !Array.isArray(props[prop]);
3007
- const definition = isObjectDefinition ? props[prop] : {
3008
- type: props[prop]
3009
- };
3010
- if (defaults && prop in defaults) {
3011
- obj[prop] = {
3012
- ...definition,
3013
- default: defaults[prop]
3014
- };
3015
- } else {
3016
- obj[prop] = definition;
3017
- }
3018
- if (source2 && !obj[prop].source) {
3019
- obj[prop].source = source2;
3020
- }
3021
- return obj;
3022
- }, {});
3023
- };
3024
- }
3025
- const makeComponentProps = propsFactory({
3026
- class: [String, Array],
3027
- style: {
3028
- type: [String, Array, Object],
3029
- default: null
3030
- }
3031
- }, "component");
3032
- const DefaultsSymbol = Symbol.for("vuetify:defaults");
3033
- function injectDefaults() {
3034
- const defaults = vue.inject(DefaultsSymbol);
3035
- if (!defaults)
3036
- throw new Error("[Vuetify] Could not find defaults instance");
3037
- return defaults;
3038
- }
3039
- function provideDefaults(defaults, options) {
3040
- const injectedDefaults = injectDefaults();
3041
- const providedDefaults = vue.ref(defaults);
3042
- const newDefaults = vue.computed(() => {
3043
- const disabled = vue.unref(options == null ? void 0 : options.disabled);
3044
- if (disabled)
3045
- return injectedDefaults.value;
3046
- const scoped = vue.unref(options == null ? void 0 : options.scoped);
3047
- const reset = vue.unref(options == null ? void 0 : options.reset);
3048
- const root = vue.unref(options == null ? void 0 : options.root);
3049
- if (providedDefaults.value == null && !(scoped || reset || root))
3050
- return injectedDefaults.value;
3051
- let properties = mergeDeep(providedDefaults.value, {
3052
- prev: injectedDefaults.value
3053
- });
3054
- if (scoped)
3055
- return properties;
3056
- if (reset || root) {
3057
- const len = Number(reset || Infinity);
3058
- for (let i = 0; i <= len; i++) {
3059
- if (!properties || !("prev" in properties)) {
3060
- break;
3061
- }
3062
- properties = properties.prev;
3063
- }
3064
- if (properties && typeof root === "string" && root in properties) {
3065
- properties = mergeDeep(mergeDeep(properties, {
3066
- prev: properties
3067
- }), properties[root]);
3068
- }
3069
- return properties;
3070
- }
3071
- return properties.prev ? mergeDeep(properties.prev, properties) : properties;
3072
- });
3073
- vue.provide(DefaultsSymbol, newDefaults);
3074
- return newDefaults;
3075
- }
3076
- function propIsDefined(vnode, prop) {
3077
- var _a, _b;
3078
- return typeof ((_a = vnode.props) == null ? void 0 : _a[prop]) !== "undefined" || typeof ((_b = vnode.props) == null ? void 0 : _b[toKebabCase(prop)]) !== "undefined";
3079
- }
3080
- function internalUseDefaults() {
3081
- let props = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
3082
- let name = arguments.length > 1 ? arguments[1] : void 0;
3083
- let defaults = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : injectDefaults();
3084
- const vm = getCurrentInstance("useDefaults");
3085
- name = name ?? vm.type.name ?? vm.type.__name;
3086
- if (!name) {
3087
- throw new Error("[Vuetify] Could not determine component name");
3088
- }
3089
- const componentDefaults = vue.computed(() => {
3090
- var _a;
3091
- return (_a = defaults.value) == null ? void 0 : _a[props._as ?? name];
3092
- });
3093
- const _props = new Proxy(props, {
3094
- get(target, prop) {
3095
- var _a, _b, _c, _d;
3096
- const propValue = Reflect.get(target, prop);
3097
- if (prop === "class" || prop === "style") {
3098
- return [(_a = componentDefaults.value) == null ? void 0 : _a[prop], propValue].filter((v) => v != null);
3099
- } else if (typeof prop === "string" && !propIsDefined(vm.vnode, prop)) {
3100
- return ((_b = componentDefaults.value) == null ? void 0 : _b[prop]) ?? ((_d = (_c = defaults.value) == null ? void 0 : _c.global) == null ? void 0 : _d[prop]) ?? propValue;
3101
- }
3102
- return propValue;
3103
- }
3104
- });
3105
- const _subcomponentDefaults = vue.shallowRef();
3106
- vue.watchEffect(() => {
3107
- if (componentDefaults.value) {
3108
- const subComponents = Object.entries(componentDefaults.value).filter((_ref) => {
3109
- let [key] = _ref;
3110
- return key.startsWith(key[0].toUpperCase());
3111
- });
3112
- _subcomponentDefaults.value = subComponents.length ? Object.fromEntries(subComponents) : void 0;
3113
- } else {
3114
- _subcomponentDefaults.value = void 0;
3115
- }
3116
- });
3117
- function provideSubDefaults() {
3118
- const injected = injectSelf(DefaultsSymbol, vm);
3119
- vue.provide(DefaultsSymbol, vue.computed(() => {
3120
- return _subcomponentDefaults.value ? mergeDeep((injected == null ? void 0 : injected.value) ?? {}, _subcomponentDefaults.value) : injected == null ? void 0 : injected.value;
3121
- }));
3122
- }
3123
- return {
3124
- props: _props,
3125
- provideSubDefaults
3126
- };
3127
- }
3128
- function defineComponent(options) {
3129
- options._setup = options._setup ?? options.setup;
3130
- if (!options.name) {
3131
- consoleWarn("The component is missing an explicit name, unable to generate default prop value");
3132
- return options;
3133
- }
3134
- if (options._setup) {
3135
- options.props = propsFactory(options.props ?? {}, options.name)();
3136
- const propKeys = Object.keys(options.props).filter((key) => key !== "class" && key !== "style");
3137
- options.filterProps = function filterProps(props) {
3138
- return pick(props, propKeys);
3139
- };
3140
- options.props._as = String;
3141
- options.setup = function setup(props, ctx) {
3142
- const defaults = injectDefaults();
3143
- if (!defaults.value)
3144
- return options._setup(props, ctx);
3145
- const {
3146
- props: _props,
3147
- provideSubDefaults
3148
- } = internalUseDefaults(props, props._as ?? options.name, defaults);
3149
- const setupBindings = options._setup(_props, ctx);
3150
- provideSubDefaults();
3151
- return setupBindings;
3152
- };
3153
- }
3154
- return options;
3155
- }
3156
- function genericComponent() {
3157
- let exposeDefaults = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : true;
3158
- return (options) => (exposeDefaults ? defineComponent : vue.defineComponent)(options);
3159
- }
3160
- const standardEasing = "cubic-bezier(0.4, 0, 0.2, 1)";
3161
- function getCurrentInstance(name, message) {
3162
- const vm = vue.getCurrentInstance();
3163
- if (!vm) {
3164
- throw new Error(`[Vuetify] ${name} ${message || "must be called from inside a setup function"}`);
3165
- }
3166
- return vm;
3167
- }
3168
- function getCurrentInstanceName() {
3169
- let name = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "composables";
3170
- const vm = getCurrentInstance(name).type;
3171
- return toKebabCase((vm == null ? void 0 : vm.aliasName) || (vm == null ? void 0 : vm.name));
3172
- }
3173
- let _uid = 0;
3174
- let _map = /* @__PURE__ */ new WeakMap();
3175
- function getUid() {
3176
- const vm = getCurrentInstance("getUid");
3177
- if (_map.has(vm))
3178
- return _map.get(vm);
3179
- else {
3180
- const uid = _uid++;
3181
- _map.set(vm, uid);
3182
- return uid;
3183
- }
3184
- }
3185
- getUid.reset = () => {
3186
- _uid = 0;
3187
- _map = /* @__PURE__ */ new WeakMap();
3188
- };
3189
- function injectSelf(key) {
3190
- let vm = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : getCurrentInstance("injectSelf");
3191
- const {
3192
- provides
3193
- } = vm;
3194
- if (provides && key in provides) {
3195
- return provides[key];
3196
- }
3197
- return void 0;
3198
- }
3199
- function useRender(render) {
3200
- const vm = getCurrentInstance("useRender");
3201
- vm.render = render;
3202
- }
3203
- function useColor(colors) {
3204
- return destructComputed(() => {
3205
- const classes = [];
3206
- const styles2 = {};
3207
- if (colors.value.background) {
3208
- if (isCssColor(colors.value.background)) {
3209
- styles2.backgroundColor = colors.value.background;
3210
- if (!colors.value.text && isParsableColor(colors.value.background)) {
3211
- const backgroundColor = parseColor(colors.value.background);
3212
- if (backgroundColor.a == null || backgroundColor.a === 1) {
3213
- const textColor = getForeground(backgroundColor);
3214
- styles2.color = textColor;
3215
- styles2.caretColor = textColor;
3216
- }
3217
- }
3218
- } else {
3219
- classes.push(`bg-${colors.value.background}`);
3220
- }
3221
- }
3222
- if (colors.value.text) {
3223
- if (isCssColor(colors.value.text)) {
3224
- styles2.color = colors.value.text;
3225
- styles2.caretColor = colors.value.text;
3226
- } else {
3227
- classes.push(`text-${colors.value.text}`);
3228
- }
3229
- }
3230
- return {
3231
- colorClasses: classes,
3232
- colorStyles: styles2
3233
- };
3234
- });
3235
- }
3236
- function useTextColor(props, name) {
3237
- const colors = vue.computed(() => ({
3238
- text: vue.isRef(props) ? props.value : name ? props[name] : null
3239
- }));
3240
- const {
3241
- colorClasses: textColorClasses,
3242
- colorStyles: textColorStyles
3243
- } = useColor(colors);
3244
- return {
3245
- textColorClasses,
3246
- textColorStyles
3247
- };
3248
- }
3249
- function useBackgroundColor(props, name) {
3250
- const colors = vue.computed(() => ({
3251
- background: vue.isRef(props) ? props.value : name ? props[name] : null
3252
- }));
3253
- const {
3254
- colorClasses: backgroundColorClasses,
3255
- colorStyles: backgroundColorStyles
3256
- } = useColor(colors);
3257
- return {
3258
- backgroundColorClasses,
3259
- backgroundColorStyles
3260
- };
3261
- }
3262
- const IconValue = [String, Function, Object, Array];
3263
- const IconSymbol = Symbol.for("vuetify:icons");
3264
- const makeIconProps = propsFactory({
3265
- icon: {
3266
- type: IconValue
3267
- },
3268
- // Could not remove this and use makeTagProps, types complained because it is not required
3269
- tag: {
3270
- type: String,
3271
- required: true
3272
- }
3273
- }, "icon");
3274
- const VComponentIcon = genericComponent()({
3275
- name: "VComponentIcon",
3276
- props: makeIconProps(),
3277
- setup(props, _ref) {
3278
- let {
3279
- slots
3280
- } = _ref;
3281
- return () => {
3282
- const Icon = props.icon;
3283
- return vue.createVNode(props.tag, null, {
3284
- default: () => {
3285
- var _a;
3286
- return [props.icon ? vue.createVNode(Icon, null, null) : (_a = slots.default) == null ? void 0 : _a.call(slots)];
3287
- }
3288
- });
3289
- };
3290
- }
3291
- });
3292
- const VSvgIcon = defineComponent({
3293
- name: "VSvgIcon",
3294
- inheritAttrs: false,
3295
- props: makeIconProps(),
3296
- setup(props, _ref2) {
3297
- let {
3298
- attrs
3299
- } = _ref2;
3300
- return () => {
3301
- return vue.createVNode(props.tag, vue.mergeProps(attrs, {
3302
- "style": null
3303
- }), {
3304
- default: () => [vue.createVNode("svg", {
3305
- "class": "v-icon__svg",
3306
- "xmlns": "http://www.w3.org/2000/svg",
3307
- "viewBox": "0 0 24 24",
3308
- "role": "img",
3309
- "aria-hidden": "true"
3310
- }, [Array.isArray(props.icon) ? props.icon.map((path) => Array.isArray(path) ? vue.createVNode("path", {
3311
- "d": path[0],
3312
- "fill-opacity": path[1]
3313
- }, null) : vue.createVNode("path", {
3314
- "d": path
3315
- }, null)) : vue.createVNode("path", {
3316
- "d": props.icon
3317
- }, null)])]
3318
- });
3319
- };
3320
- }
3321
- });
3322
- defineComponent({
3323
- name: "VLigatureIcon",
3324
- props: makeIconProps(),
3325
- setup(props) {
3326
- return () => {
3327
- return vue.createVNode(props.tag, null, {
3328
- default: () => [props.icon]
3329
- });
3330
- };
3331
- }
3332
- });
3333
- defineComponent({
3334
- name: "VClassIcon",
3335
- props: makeIconProps(),
3336
- setup(props) {
3337
- return () => {
3338
- return vue.createVNode(props.tag, {
3339
- "class": props.icon
3340
- }, null);
3341
- };
3342
- }
3343
- });
3344
- const useIcon = (props) => {
3345
- const icons = vue.inject(IconSymbol);
3346
- if (!icons)
3347
- throw new Error("Missing Vuetify Icons provide!");
3348
- const iconData = vue.computed(() => {
3349
- var _a;
3350
- const iconAlias = vue.unref(props);
3351
- if (!iconAlias)
3352
- return {
3353
- component: VComponentIcon
3354
- };
3355
- let icon = iconAlias;
3356
- if (typeof icon === "string") {
3357
- icon = icon.trim();
3358
- if (icon.startsWith("$")) {
3359
- icon = (_a = icons.aliases) == null ? void 0 : _a[icon.slice(1)];
3360
- }
3361
- }
3362
- if (!icon)
3363
- throw new Error(`Could not find aliased icon "${iconAlias}"`);
3364
- if (Array.isArray(icon)) {
3365
- return {
3366
- component: VSvgIcon,
3367
- icon
3368
- };
3369
- } else if (typeof icon !== "string") {
3370
- return {
3371
- component: VComponentIcon,
3372
- icon
3373
- };
3374
- }
3375
- const iconSetName = Object.keys(icons.sets).find((setName) => typeof icon === "string" && icon.startsWith(`${setName}:`));
3376
- const iconName = iconSetName ? icon.slice(iconSetName.length + 1) : icon;
3377
- const iconSet = icons.sets[iconSetName ?? icons.defaultSet];
3378
- return {
3379
- component: iconSet.component,
3380
- icon: iconName
3381
- };
3382
- });
3383
- return {
3384
- iconData
3385
- };
3386
- };
3387
- const predefinedSizes = ["x-small", "small", "default", "large", "x-large"];
3388
- const makeSizeProps = propsFactory({
3389
- size: {
3390
- type: [String, Number],
3391
- default: "default"
3392
- }
3393
- }, "size");
3394
- function useSize(props) {
3395
- let name = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : getCurrentInstanceName();
3396
- return destructComputed(() => {
3397
- let sizeClasses;
3398
- let sizeStyles;
3399
- if (includes(predefinedSizes, props.size)) {
3400
- sizeClasses = `${name}--size-${props.size}`;
3401
- } else if (props.size) {
3402
- sizeStyles = {
3403
- width: convertToUnit(props.size),
3404
- height: convertToUnit(props.size)
3405
- };
3406
- }
3407
- return {
3408
- sizeClasses,
3409
- sizeStyles
3410
- };
3411
- });
3412
- }
3413
- const makeTagProps = propsFactory({
3414
- tag: {
3415
- type: String,
3416
- default: "div"
3417
- }
3418
- }, "tag");
3419
- const ThemeSymbol = Symbol.for("vuetify:theme");
3420
- const makeThemeProps = propsFactory({
3421
- theme: String
3422
- }, "theme");
3423
- function provideTheme(props) {
3424
- getCurrentInstance("provideTheme");
3425
- const theme = vue.inject(ThemeSymbol, null);
3426
- if (!theme)
3427
- throw new Error("Could not find Vuetify theme injection");
3428
- const name = vue.computed(() => {
3429
- return props.theme ?? theme.name.value;
3430
- });
3431
- const current = vue.computed(() => theme.themes.value[name.value]);
3432
- const themeClasses = vue.computed(() => theme.isDisabled ? void 0 : `v-theme--${name.value}`);
3433
- const newTheme = {
3434
- ...theme,
3435
- name,
3436
- current,
3437
- themeClasses
3438
- };
3439
- vue.provide(ThemeSymbol, newTheme);
3440
- return newTheme;
3441
- }
3442
- const makeVIconProps = propsFactory({
3443
- color: String,
3444
- disabled: Boolean,
3445
- start: Boolean,
3446
- end: Boolean,
3447
- icon: IconValue,
3448
- ...makeComponentProps(),
3449
- ...makeSizeProps(),
3450
- ...makeTagProps({
3451
- tag: "i"
3452
- }),
3453
- ...makeThemeProps()
3454
- }, "VIcon");
3455
- const VIcon = genericComponent()({
3456
- name: "VIcon",
3457
- props: makeVIconProps(),
3458
- setup(props, _ref) {
3459
- let {
3460
- attrs,
3461
- slots
3462
- } = _ref;
3463
- const slotIcon = vue.ref();
3464
- const {
3465
- themeClasses
3466
- } = provideTheme(props);
3467
- const {
3468
- iconData
3469
- } = useIcon(vue.computed(() => slotIcon.value || props.icon));
3470
- const {
3471
- sizeClasses
3472
- } = useSize(props);
3473
- const {
3474
- textColorClasses,
3475
- textColorStyles
3476
- } = useTextColor(vue.toRef(props, "color"));
3477
- useRender(() => {
3478
- var _a, _b;
3479
- const slotValue = (_a = slots.default) == null ? void 0 : _a.call(slots);
3480
- if (slotValue) {
3481
- slotIcon.value = (_b = flattenFragments(slotValue).filter((node) => node.type === vue.Text && node.children && typeof node.children === "string")[0]) == null ? void 0 : _b.children;
3482
- }
3483
- const hasClick = !!(attrs.onClick || attrs.onClickOnce);
3484
- return vue.createVNode(iconData.value.component, {
3485
- "tag": props.tag,
3486
- "icon": iconData.value.icon,
3487
- "class": ["v-icon", "notranslate", themeClasses.value, sizeClasses.value, textColorClasses.value, {
3488
- "v-icon--clickable": hasClick,
3489
- "v-icon--disabled": props.disabled,
3490
- "v-icon--start": props.start,
3491
- "v-icon--end": props.end
3492
- }, props.class],
3493
- "style": [!sizeClasses.value ? {
3494
- fontSize: convertToUnit(props.size),
3495
- height: convertToUnit(props.size),
3496
- width: convertToUnit(props.size)
3497
- } : void 0, textColorStyles.value, props.style],
3498
- "role": hasClick ? "button" : void 0,
3499
- "aria-hidden": !hasClick,
3500
- "tabindex": hasClick ? props.disabled ? -1 : 0 : void 0
3501
- }, {
3502
- default: () => [slotValue]
3503
- });
3504
- });
3505
- return {};
3506
- }
3507
- });
3508
- const makeVLabelProps = propsFactory({
3509
- text: String,
3510
- onClick: EventProp(),
3511
- ...makeComponentProps(),
3512
- ...makeThemeProps()
3513
- }, "VLabel");
3514
- const VLabel = genericComponent()({
3515
- name: "VLabel",
3516
- props: makeVLabelProps(),
3517
- setup(props, _ref) {
3518
- let {
3519
- slots
3520
- } = _ref;
3521
- useRender(() => {
3522
- var _a;
3523
- return vue.createVNode("label", {
3524
- "class": ["v-label", {
3525
- "v-label--clickable": !!props.onClick
3526
- }, props.class],
3527
- "style": props.style,
3528
- "onClick": props.onClick
3529
- }, [props.text, (_a = slots.default) == null ? void 0 : _a.call(slots)]);
3530
- });
3531
- return {};
3532
- }
3533
- });
3534
- const allowedDensities = [null, "default", "comfortable", "compact"];
3535
- const makeDensityProps = propsFactory({
3536
- density: {
3537
- type: String,
3538
- default: "default",
3539
- validator: (v) => allowedDensities.includes(v)
3540
- }
3541
- }, "density");
3542
- function useDensity(props) {
3543
- let name = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : getCurrentInstanceName();
3544
- const densityClasses = vue.computed(() => {
3545
- return `${name}--density-${props.density}`;
3546
- });
3547
- return {
3548
- densityClasses
3549
- };
3550
- }
3551
- function useToggleScope(source2, fn) {
3552
- let scope;
3553
- function start() {
3554
- scope = vue.effectScope();
3555
- scope.run(() => fn.length ? fn(() => {
3556
- scope == null ? void 0 : scope.stop();
3557
- start();
3558
- }) : fn());
3559
- }
3560
- vue.watch(source2, (active) => {
3561
- if (active && !scope) {
3562
- start();
3563
- } else if (!active) {
3564
- scope == null ? void 0 : scope.stop();
3565
- scope = void 0;
3566
- }
3567
- }, {
3568
- immediate: true
3569
- });
3570
- vue.onScopeDispose(() => {
3571
- scope == null ? void 0 : scope.stop();
3572
- });
3573
- }
3574
- function useProxiedModel(props, prop, defaultValue) {
3575
- let transformIn = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : (v) => v;
3576
- let transformOut = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : (v) => v;
3577
- const vm = getCurrentInstance("useProxiedModel");
3578
- const internal = vue.ref(props[prop] !== void 0 ? props[prop] : defaultValue);
3579
- const kebabProp = toKebabCase(prop);
3580
- const checkKebab = kebabProp !== prop;
3581
- const isControlled = checkKebab ? vue.computed(() => {
3582
- var _a, _b, _c, _d;
3583
- void props[prop];
3584
- 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}`))));
3585
- }) : vue.computed(() => {
3586
- var _a, _b;
3587
- void props[prop];
3588
- return !!(((_a = vm.vnode.props) == null ? void 0 : _a.hasOwnProperty(prop)) && ((_b = vm.vnode.props) == null ? void 0 : _b.hasOwnProperty(`onUpdate:${prop}`)));
3589
- });
3590
- useToggleScope(() => !isControlled.value, () => {
3591
- vue.watch(() => props[prop], (val) => {
3592
- internal.value = val;
3593
- });
3594
- });
3595
- const model = vue.computed({
3596
- get() {
3597
- const externalValue = props[prop];
3598
- return transformIn(isControlled.value ? externalValue : internal.value);
3599
- },
3600
- set(internalValue) {
3601
- const newValue = transformOut(internalValue);
3602
- const value = vue.toRaw(isControlled.value ? props[prop] : internal.value);
3603
- if (value === newValue || transformIn(value) === internalValue) {
3604
- return;
3605
- }
3606
- internal.value = newValue;
3607
- vm == null ? void 0 : vm.emit(`update:${prop}`, newValue);
3608
- }
3609
- });
3610
- Object.defineProperty(model, "externalValue", {
3611
- get: () => isControlled.value ? props[prop] : internal.value
3612
- });
3613
- return model;
3614
- }
3615
- const VSelectionControlGroupSymbol = Symbol.for("vuetify:selection-control-group");
3616
- const makeSelectionControlGroupProps = propsFactory({
3617
- color: String,
3618
- disabled: {
3619
- type: Boolean,
3620
- default: null
3621
- },
3622
- defaultsTarget: String,
3623
- error: Boolean,
3624
- id: String,
3625
- inline: Boolean,
3626
- falseIcon: IconValue,
3627
- trueIcon: IconValue,
3628
- ripple: {
3629
- type: [Boolean, Object],
3630
- default: true
3631
- },
3632
- multiple: {
3633
- type: Boolean,
3634
- default: null
3635
- },
3636
- name: String,
3637
- readonly: {
3638
- type: Boolean,
3639
- default: null
3640
- },
3641
- modelValue: null,
3642
- type: String,
3643
- valueComparator: {
3644
- type: Function,
3645
- default: deepEqual
3646
- },
3647
- ...makeComponentProps(),
3648
- ...makeDensityProps(),
3649
- ...makeThemeProps()
3650
- }, "SelectionControlGroup");
3651
- const makeVSelectionControlGroupProps = propsFactory({
3652
- ...makeSelectionControlGroupProps({
3653
- defaultsTarget: "VSelectionControl"
3654
- })
3655
- }, "VSelectionControlGroup");
3656
- const VSelectionControlGroup = genericComponent()({
3657
- name: "VSelectionControlGroup",
3658
- props: makeVSelectionControlGroupProps(),
3659
- emits: {
3660
- "update:modelValue": (value) => true
3661
- },
3662
- setup(props, _ref) {
3663
- let {
3664
- slots
3665
- } = _ref;
3666
- const modelValue = useProxiedModel(props, "modelValue");
3667
- const uid = getUid();
3668
- const id = vue.computed(() => props.id || `v-selection-control-group-${uid}`);
3669
- const name = vue.computed(() => props.name || id.value);
3670
- const updateHandlers = /* @__PURE__ */ new Set();
3671
- vue.provide(VSelectionControlGroupSymbol, {
3672
- modelValue,
3673
- forceUpdate: () => {
3674
- updateHandlers.forEach((fn) => fn());
3675
- },
3676
- onForceUpdate: (cb) => {
3677
- updateHandlers.add(cb);
3678
- vue.onScopeDispose(() => {
3679
- updateHandlers.delete(cb);
3680
- });
3681
- }
3682
- });
3683
- provideDefaults({
3684
- [props.defaultsTarget]: {
3685
- color: vue.toRef(props, "color"),
3686
- disabled: vue.toRef(props, "disabled"),
3687
- density: vue.toRef(props, "density"),
3688
- error: vue.toRef(props, "error"),
3689
- inline: vue.toRef(props, "inline"),
3690
- modelValue,
3691
- multiple: vue.computed(() => !!props.multiple || props.multiple == null && Array.isArray(modelValue.value)),
3692
- name,
3693
- falseIcon: vue.toRef(props, "falseIcon"),
3694
- trueIcon: vue.toRef(props, "trueIcon"),
3695
- readonly: vue.toRef(props, "readonly"),
3696
- ripple: vue.toRef(props, "ripple"),
3697
- type: vue.toRef(props, "type"),
3698
- valueComparator: vue.toRef(props, "valueComparator")
3699
- }
3700
- });
3701
- useRender(() => {
3702
- var _a;
3703
- return vue.createVNode("div", {
3704
- "class": ["v-selection-control-group", {
3705
- "v-selection-control-group--inline": props.inline
3706
- }, props.class],
3707
- "style": props.style,
3708
- "role": props.type === "radio" ? "radiogroup" : void 0
3709
- }, [(_a = slots.default) == null ? void 0 : _a.call(slots)]);
3710
- });
3711
- return {};
3712
- }
3713
- });
3714
- const stopSymbol = Symbol("rippleStop");
3715
- const DELAY_RIPPLE = 80;
3716
- function transform(el, value) {
3717
- el.style.transform = value;
3718
- el.style.webkitTransform = value;
3719
- }
3720
- function isTouchEvent(e) {
3721
- return e.constructor.name === "TouchEvent";
3722
- }
3723
- function isKeyboardEvent(e) {
3724
- return e.constructor.name === "KeyboardEvent";
3725
- }
3726
- const calculate = function(e, el) {
3727
- var _a;
3728
- let value = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
3729
- let localX = 0;
3730
- let localY = 0;
3731
- if (!isKeyboardEvent(e)) {
3732
- const offset = el.getBoundingClientRect();
3733
- const target = isTouchEvent(e) ? e.touches[e.touches.length - 1] : e;
3734
- localX = target.clientX - offset.left;
3735
- localY = target.clientY - offset.top;
3736
- }
3737
- let radius = 0;
3738
- let scale = 0.3;
3739
- if ((_a = el._ripple) == null ? void 0 : _a.circle) {
3740
- scale = 0.15;
3741
- radius = el.clientWidth / 2;
3742
- radius = value.center ? radius : radius + Math.sqrt((localX - radius) ** 2 + (localY - radius) ** 2) / 4;
3743
- } else {
3744
- radius = Math.sqrt(el.clientWidth ** 2 + el.clientHeight ** 2) / 2;
3745
- }
3746
- const centerX = `${(el.clientWidth - radius * 2) / 2}px`;
3747
- const centerY = `${(el.clientHeight - radius * 2) / 2}px`;
3748
- const x = value.center ? centerX : `${localX - radius}px`;
3749
- const y = value.center ? centerY : `${localY - radius}px`;
3750
- return {
3751
- radius,
3752
- scale,
3753
- x,
3754
- y,
3755
- centerX,
3756
- centerY
3757
- };
3758
- };
3759
- const ripples = {
3760
- /* eslint-disable max-statements */
3761
- show(e, el) {
3762
- var _a;
3763
- let value = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
3764
- if (!((_a = el == null ? void 0 : el._ripple) == null ? void 0 : _a.enabled)) {
3765
- return;
3766
- }
3767
- const container = document.createElement("span");
3768
- const animation = document.createElement("span");
3769
- container.appendChild(animation);
3770
- container.className = "v-ripple__container";
3771
- if (value.class) {
3772
- container.className += ` ${value.class}`;
3773
- }
3774
- const {
3775
- radius,
3776
- scale,
3777
- x,
3778
- y,
3779
- centerX,
3780
- centerY
3781
- } = calculate(e, el, value);
3782
- const size = `${radius * 2}px`;
3783
- animation.className = "v-ripple__animation";
3784
- animation.style.width = size;
3785
- animation.style.height = size;
3786
- el.appendChild(container);
3787
- const computed = window.getComputedStyle(el);
3788
- if (computed && computed.position === "static") {
3789
- el.style.position = "relative";
3790
- el.dataset.previousPosition = "static";
3791
- }
3792
- animation.classList.add("v-ripple__animation--enter");
3793
- animation.classList.add("v-ripple__animation--visible");
3794
- transform(animation, `translate(${x}, ${y}) scale3d(${scale},${scale},${scale})`);
3795
- animation.dataset.activated = String(performance.now());
3796
- setTimeout(() => {
3797
- animation.classList.remove("v-ripple__animation--enter");
3798
- animation.classList.add("v-ripple__animation--in");
3799
- transform(animation, `translate(${centerX}, ${centerY}) scale3d(1,1,1)`);
3800
- }, 0);
3801
- },
3802
- hide(el) {
3803
- var _a;
3804
- if (!((_a = el == null ? void 0 : el._ripple) == null ? void 0 : _a.enabled))
3805
- return;
3806
- const ripples2 = el.getElementsByClassName("v-ripple__animation");
3807
- if (ripples2.length === 0)
3808
- return;
3809
- const animation = ripples2[ripples2.length - 1];
3810
- if (animation.dataset.isHiding)
3811
- return;
3812
- else
3813
- animation.dataset.isHiding = "true";
3814
- const diff = performance.now() - Number(animation.dataset.activated);
3815
- const delay = Math.max(250 - diff, 0);
3816
- setTimeout(() => {
3817
- animation.classList.remove("v-ripple__animation--in");
3818
- animation.classList.add("v-ripple__animation--out");
3819
- setTimeout(() => {
3820
- var _a2;
3821
- const ripples3 = el.getElementsByClassName("v-ripple__animation");
3822
- if (ripples3.length === 1 && el.dataset.previousPosition) {
3823
- el.style.position = el.dataset.previousPosition;
3824
- delete el.dataset.previousPosition;
3825
- }
3826
- if (((_a2 = animation.parentNode) == null ? void 0 : _a2.parentNode) === el)
3827
- el.removeChild(animation.parentNode);
3828
- }, 300);
3829
- }, delay);
3830
- }
3831
- };
3832
- function isRippleEnabled(value) {
3833
- return typeof value === "undefined" || !!value;
3834
- }
3835
- function rippleShow(e) {
3836
- const value = {};
3837
- const element = e.currentTarget;
3838
- if (!(element == null ? void 0 : element._ripple) || element._ripple.touched || e[stopSymbol])
3839
- return;
3840
- e[stopSymbol] = true;
3841
- if (isTouchEvent(e)) {
3842
- element._ripple.touched = true;
3843
- element._ripple.isTouch = true;
3844
- } else {
3845
- if (element._ripple.isTouch)
3846
- return;
3847
- }
3848
- value.center = element._ripple.centered || isKeyboardEvent(e);
3849
- if (element._ripple.class) {
3850
- value.class = element._ripple.class;
3851
- }
3852
- if (isTouchEvent(e)) {
3853
- if (element._ripple.showTimerCommit)
3854
- return;
3855
- element._ripple.showTimerCommit = () => {
3856
- ripples.show(e, element, value);
3857
- };
3858
- element._ripple.showTimer = window.setTimeout(() => {
3859
- var _a;
3860
- if ((_a = element == null ? void 0 : element._ripple) == null ? void 0 : _a.showTimerCommit) {
3861
- element._ripple.showTimerCommit();
3862
- element._ripple.showTimerCommit = null;
3863
- }
3864
- }, DELAY_RIPPLE);
3865
- } else {
3866
- ripples.show(e, element, value);
3867
- }
3868
- }
3869
- function rippleStop(e) {
3870
- e[stopSymbol] = true;
3871
- }
3872
- function rippleHide(e) {
3873
- const element = e.currentTarget;
3874
- if (!(element == null ? void 0 : element._ripple))
3875
- return;
3876
- window.clearTimeout(element._ripple.showTimer);
3877
- if (e.type === "touchend" && element._ripple.showTimerCommit) {
3878
- element._ripple.showTimerCommit();
3879
- element._ripple.showTimerCommit = null;
3880
- element._ripple.showTimer = window.setTimeout(() => {
3881
- rippleHide(e);
3882
- });
3883
- return;
3884
- }
3885
- window.setTimeout(() => {
3886
- if (element._ripple) {
3887
- element._ripple.touched = false;
3888
- }
3889
- });
3890
- ripples.hide(element);
3891
- }
3892
- function rippleCancelShow(e) {
3893
- const element = e.currentTarget;
3894
- if (!(element == null ? void 0 : element._ripple))
3895
- return;
3896
- if (element._ripple.showTimerCommit) {
3897
- element._ripple.showTimerCommit = null;
3898
- }
3899
- window.clearTimeout(element._ripple.showTimer);
3900
- }
3901
- let keyboardRipple = false;
3902
- function keyboardRippleShow(e) {
3903
- if (!keyboardRipple && (e.keyCode === keyCodes.enter || e.keyCode === keyCodes.space)) {
3904
- keyboardRipple = true;
3905
- rippleShow(e);
3906
- }
3907
- }
3908
- function keyboardRippleHide(e) {
3909
- keyboardRipple = false;
3910
- rippleHide(e);
3911
- }
3912
- function focusRippleHide(e) {
3913
- if (keyboardRipple) {
3914
- keyboardRipple = false;
3915
- rippleHide(e);
3916
- }
3917
- }
3918
- function updateRipple(el, binding, wasEnabled) {
3919
- const {
3920
- value,
3921
- modifiers
3922
- } = binding;
3923
- const enabled = isRippleEnabled(value);
3924
- if (!enabled) {
3925
- ripples.hide(el);
3926
- }
3927
- el._ripple = el._ripple ?? {};
3928
- el._ripple.enabled = enabled;
3929
- el._ripple.centered = modifiers.center;
3930
- el._ripple.circle = modifiers.circle;
3931
- if (isObject(value) && value.class) {
3932
- el._ripple.class = value.class;
3933
- }
3934
- if (enabled && !wasEnabled) {
3935
- if (modifiers.stop) {
3936
- el.addEventListener("touchstart", rippleStop, {
3937
- passive: true
3938
- });
3939
- el.addEventListener("mousedown", rippleStop);
3940
- return;
3941
- }
3942
- el.addEventListener("touchstart", rippleShow, {
3943
- passive: true
3944
- });
3945
- el.addEventListener("touchend", rippleHide, {
3946
- passive: true
3947
- });
3948
- el.addEventListener("touchmove", rippleCancelShow, {
3949
- passive: true
3950
- });
3951
- el.addEventListener("touchcancel", rippleHide);
3952
- el.addEventListener("mousedown", rippleShow);
3953
- el.addEventListener("mouseup", rippleHide);
3954
- el.addEventListener("mouseleave", rippleHide);
3955
- el.addEventListener("keydown", keyboardRippleShow);
3956
- el.addEventListener("keyup", keyboardRippleHide);
3957
- el.addEventListener("blur", focusRippleHide);
3958
- el.addEventListener("dragstart", rippleHide, {
3959
- passive: true
3960
- });
3961
- } else if (!enabled && wasEnabled) {
3962
- removeListeners(el);
3963
- }
3964
- }
3965
- function removeListeners(el) {
3966
- el.removeEventListener("mousedown", rippleShow);
3967
- el.removeEventListener("touchstart", rippleShow);
3968
- el.removeEventListener("touchend", rippleHide);
3969
- el.removeEventListener("touchmove", rippleCancelShow);
3970
- el.removeEventListener("touchcancel", rippleHide);
3971
- el.removeEventListener("mouseup", rippleHide);
3972
- el.removeEventListener("mouseleave", rippleHide);
3973
- el.removeEventListener("keydown", keyboardRippleShow);
3974
- el.removeEventListener("keyup", keyboardRippleHide);
3975
- el.removeEventListener("dragstart", rippleHide);
3976
- el.removeEventListener("blur", focusRippleHide);
3977
- }
3978
- function mounted$1(el, binding) {
3979
- updateRipple(el, binding, false);
3980
- }
3981
- function unmounted$1(el) {
3982
- delete el._ripple;
3983
- removeListeners(el);
3984
- }
3985
- function updated(el, binding) {
3986
- if (binding.value === binding.oldValue) {
3987
- return;
3988
- }
3989
- const wasEnabled = isRippleEnabled(binding.oldValue);
3990
- updateRipple(el, binding, wasEnabled);
3991
- }
3992
- const Ripple = {
3993
- mounted: mounted$1,
3994
- unmounted: unmounted$1,
3995
- updated
3996
- };
3997
- const makeVSelectionControlProps = propsFactory({
3998
- label: String,
3999
- baseColor: String,
4000
- trueValue: null,
4001
- falseValue: null,
4002
- value: null,
4003
- ...makeComponentProps(),
4004
- ...makeSelectionControlGroupProps()
4005
- }, "VSelectionControl");
4006
- function useSelectionControl(props) {
4007
- const group = vue.inject(VSelectionControlGroupSymbol, void 0);
4008
- const {
4009
- densityClasses
4010
- } = useDensity(props);
4011
- const modelValue = useProxiedModel(props, "modelValue");
4012
- const trueValue = vue.computed(() => props.trueValue !== void 0 ? props.trueValue : props.value !== void 0 ? props.value : true);
4013
- const falseValue = vue.computed(() => props.falseValue !== void 0 ? props.falseValue : false);
4014
- const isMultiple = vue.computed(() => !!props.multiple || props.multiple == null && Array.isArray(modelValue.value));
4015
- const model = vue.computed({
4016
- get() {
4017
- const val = group ? group.modelValue.value : modelValue.value;
4018
- return isMultiple.value ? wrapInArray(val).some((v) => props.valueComparator(v, trueValue.value)) : props.valueComparator(val, trueValue.value);
4019
- },
4020
- set(val) {
4021
- if (props.readonly)
4022
- return;
4023
- const currentValue = val ? trueValue.value : falseValue.value;
4024
- let newVal = currentValue;
4025
- if (isMultiple.value) {
4026
- newVal = val ? [...wrapInArray(modelValue.value), currentValue] : wrapInArray(modelValue.value).filter((item) => !props.valueComparator(item, trueValue.value));
4027
- }
4028
- if (group) {
4029
- group.modelValue.value = newVal;
4030
- } else {
4031
- modelValue.value = newVal;
4032
- }
4033
- }
4034
- });
4035
- const {
4036
- textColorClasses,
4037
- textColorStyles
4038
- } = useTextColor(vue.computed(() => {
4039
- if (props.error || props.disabled)
4040
- return void 0;
4041
- return model.value ? props.color : props.baseColor;
4042
- }));
4043
- const {
4044
- backgroundColorClasses,
4045
- backgroundColorStyles
4046
- } = useBackgroundColor(vue.computed(() => {
4047
- return model.value && !props.error && !props.disabled ? props.color : void 0;
4048
- }));
4049
- const icon = vue.computed(() => model.value ? props.trueIcon : props.falseIcon);
4050
- return {
4051
- group,
4052
- densityClasses,
4053
- trueValue,
4054
- falseValue,
4055
- model,
4056
- textColorClasses,
4057
- textColorStyles,
4058
- backgroundColorClasses,
4059
- backgroundColorStyles,
4060
- icon
4061
- };
4062
- }
4063
- const VSelectionControl = genericComponent()({
4064
- name: "VSelectionControl",
4065
- directives: {
4066
- Ripple
4067
- },
4068
- inheritAttrs: false,
4069
- props: makeVSelectionControlProps(),
4070
- emits: {
4071
- "update:modelValue": (value) => true
4072
- },
4073
- setup(props, _ref) {
4074
- let {
4075
- attrs,
4076
- slots
4077
- } = _ref;
4078
- const {
4079
- group,
4080
- densityClasses,
4081
- icon,
4082
- model,
4083
- textColorClasses,
4084
- textColorStyles,
4085
- backgroundColorClasses,
4086
- backgroundColorStyles,
4087
- trueValue
4088
- } = useSelectionControl(props);
4089
- const uid = getUid();
4090
- const isFocused = vue.shallowRef(false);
4091
- const isFocusVisible = vue.shallowRef(false);
4092
- const input = vue.ref();
4093
- const id = vue.computed(() => props.id || `input-${uid}`);
4094
- const isInteractive = vue.computed(() => !props.disabled && !props.readonly);
4095
- group == null ? void 0 : group.onForceUpdate(() => {
4096
- if (input.value) {
4097
- input.value.checked = model.value;
4098
- }
4099
- });
4100
- function onFocus(e) {
4101
- if (!isInteractive.value)
4102
- return;
4103
- isFocused.value = true;
4104
- if (matchesSelector(e.target, ":focus-visible") !== false) {
4105
- isFocusVisible.value = true;
4106
- }
4107
- }
4108
- function onBlur() {
4109
- isFocused.value = false;
4110
- isFocusVisible.value = false;
4111
- }
4112
- function onClickLabel(e) {
4113
- e.stopPropagation();
4114
- }
4115
- function onInput(e) {
4116
- if (!isInteractive.value)
4117
- return;
4118
- if (props.readonly && group) {
4119
- vue.nextTick(() => group.forceUpdate());
4120
- }
4121
- model.value = e.target.checked;
4122
- }
4123
- useRender(() => {
4124
- var _a, _b;
4125
- const label = slots.label ? slots.label({
4126
- label: props.label,
4127
- props: {
4128
- for: id.value
4129
- }
4130
- }) : props.label;
4131
- const [rootAttrs, inputAttrs] = filterInputAttrs(attrs);
4132
- const inputNode = vue.createVNode("input", vue.mergeProps({
4133
- "ref": input,
4134
- "checked": model.value,
4135
- "disabled": !!props.disabled,
4136
- "id": id.value,
4137
- "onBlur": onBlur,
4138
- "onFocus": onFocus,
4139
- "onInput": onInput,
4140
- "aria-disabled": !!props.disabled,
4141
- "aria-label": props.label,
4142
- "type": props.type,
4143
- "value": trueValue.value,
4144
- "name": props.name,
4145
- "aria-checked": props.type === "checkbox" ? model.value : void 0
4146
- }, inputAttrs), null);
4147
- return vue.createVNode("div", vue.mergeProps({
4148
- "class": ["v-selection-control", {
4149
- "v-selection-control--dirty": model.value,
4150
- "v-selection-control--disabled": props.disabled,
4151
- "v-selection-control--error": props.error,
4152
- "v-selection-control--focused": isFocused.value,
4153
- "v-selection-control--focus-visible": isFocusVisible.value,
4154
- "v-selection-control--inline": props.inline
4155
- }, densityClasses.value, props.class]
4156
- }, rootAttrs, {
4157
- "style": props.style
4158
- }), [vue.createVNode("div", {
4159
- "class": ["v-selection-control__wrapper", textColorClasses.value],
4160
- "style": textColorStyles.value
4161
- }, [(_a = slots.default) == null ? void 0 : _a.call(slots, {
4162
- backgroundColorClasses,
4163
- backgroundColorStyles
4164
- }), vue.withDirectives(vue.createVNode("div", {
4165
- "class": ["v-selection-control__input"]
4166
- }, [((_b = slots.input) == null ? void 0 : _b.call(slots, {
4167
- model,
4168
- textColorClasses,
4169
- textColorStyles,
4170
- backgroundColorClasses,
4171
- backgroundColorStyles,
4172
- inputNode,
4173
- icon: icon.value,
4174
- props: {
4175
- onFocus,
4176
- onBlur,
4177
- id: id.value
4178
- }
4179
- })) ?? vue.createVNode(vue.Fragment, null, [icon.value && vue.createVNode(VIcon, {
4180
- "key": "icon",
4181
- "icon": icon.value
4182
- }, null), inputNode])]), [[vue.resolveDirective("ripple"), props.ripple && [!props.disabled && !props.readonly, null, ["center", "circle"]]]])]), label && vue.createVNode(VLabel, {
4183
- "for": id.value,
4184
- "onClick": onClickLabel
4185
- }, {
4186
- default: () => [label]
4187
- })]);
4188
- });
4189
- return {
4190
- isFocused,
4191
- input
4192
- };
4193
- }
4194
- });
4195
- const makeVCheckboxBtnProps = propsFactory({
4196
- indeterminate: Boolean,
4197
- indeterminateIcon: {
4198
- type: IconValue,
4199
- default: "$checkboxIndeterminate"
4200
- },
4201
- ...makeVSelectionControlProps({
4202
- falseIcon: "$checkboxOff",
4203
- trueIcon: "$checkboxOn"
4204
- })
4205
- }, "VCheckboxBtn");
4206
- const VCheckboxBtn = genericComponent()({
4207
- name: "VCheckboxBtn",
4208
- props: makeVCheckboxBtnProps(),
4209
- emits: {
4210
- "update:modelValue": (value) => true,
4211
- "update:indeterminate": (value) => true
4212
- },
4213
- setup(props, _ref) {
4214
- let {
4215
- slots
4216
- } = _ref;
4217
- const indeterminate = useProxiedModel(props, "indeterminate");
4218
- const model = useProxiedModel(props, "modelValue");
4219
- function onChange(v) {
4220
- if (indeterminate.value) {
4221
- indeterminate.value = false;
4222
- }
4223
- }
4224
- const falseIcon = vue.computed(() => {
4225
- return indeterminate.value ? props.indeterminateIcon : props.falseIcon;
4226
- });
4227
- const trueIcon = vue.computed(() => {
4228
- return indeterminate.value ? props.indeterminateIcon : props.trueIcon;
4229
- });
4230
- useRender(() => {
4231
- const controlProps = omit(VSelectionControl.filterProps(props), ["modelValue"]);
4232
- return vue.createVNode(VSelectionControl, vue.mergeProps(controlProps, {
4233
- "modelValue": model.value,
4234
- "onUpdate:modelValue": [($event) => model.value = $event, onChange],
4235
- "class": ["v-checkbox-btn", props.class],
4236
- "style": props.style,
4237
- "type": "checkbox",
4238
- "falseIcon": falseIcon.value,
4239
- "trueIcon": trueIcon.value,
4240
- "aria-checked": indeterminate.value ? "mixed" : void 0
4241
- }), slots);
4242
- });
4243
- return {};
4244
- }
4245
- });
4246
- const LocaleSymbol = Symbol.for("vuetify:locale");
4247
- function useLocale() {
4248
- const locale = vue.inject(LocaleSymbol);
4249
- if (!locale)
4250
- throw new Error("[Vuetify] Could not find injected locale instance");
4251
- return locale;
4252
- }
4253
- function useRtl() {
4254
- const locale = vue.inject(LocaleSymbol);
4255
- if (!locale)
4256
- throw new Error("[Vuetify] Could not find injected rtl instance");
4257
- return {
4258
- isRtl: locale.isRtl,
4259
- rtlClasses: locale.rtlClasses
4260
- };
4261
- }
4262
- function useInputIcon(props) {
4263
- const {
4264
- t
4265
- } = useLocale();
4266
- function InputIcon(_ref) {
4267
- let {
4268
- name
4269
- } = _ref;
4270
- const localeKey = {
4271
- prepend: "prependAction",
4272
- prependInner: "prependAction",
4273
- append: "appendAction",
4274
- appendInner: "appendAction",
4275
- clear: "clear"
4276
- }[name];
4277
- const listener = props[`onClick:${name}`];
4278
- const label = listener && localeKey ? t(`$vuetify.input.${localeKey}`, props.label ?? "") : void 0;
4279
- return vue.createVNode(VIcon, {
4280
- "icon": props[`${name}Icon`],
4281
- "aria-label": label,
4282
- "onClick": listener
4283
- }, null);
4284
- }
4285
- return {
4286
- InputIcon
4287
- };
4288
- }
4289
- const makeTransitionProps$1 = propsFactory({
4290
- disabled: Boolean,
4291
- group: Boolean,
4292
- hideOnLeave: Boolean,
4293
- leaveAbsolute: Boolean,
4294
- mode: String,
4295
- origin: String
4296
- }, "transition");
4297
- function createCssTransition(name, origin, mode) {
4298
- return genericComponent()({
4299
- name,
4300
- props: makeTransitionProps$1({
4301
- mode,
4302
- origin
4303
- }),
4304
- setup(props, _ref) {
4305
- let {
4306
- slots
4307
- } = _ref;
4308
- const functions = {
4309
- onBeforeEnter(el) {
4310
- if (props.origin) {
4311
- el.style.transformOrigin = props.origin;
4312
- }
4313
- },
4314
- onLeave(el) {
4315
- if (props.leaveAbsolute) {
4316
- const {
4317
- offsetTop,
4318
- offsetLeft,
4319
- offsetWidth,
4320
- offsetHeight
4321
- } = el;
4322
- el._transitionInitialStyles = {
4323
- position: el.style.position,
4324
- top: el.style.top,
4325
- left: el.style.left,
4326
- width: el.style.width,
4327
- height: el.style.height
4328
- };
4329
- el.style.position = "absolute";
4330
- el.style.top = `${offsetTop}px`;
4331
- el.style.left = `${offsetLeft}px`;
4332
- el.style.width = `${offsetWidth}px`;
4333
- el.style.height = `${offsetHeight}px`;
4334
- }
4335
- if (props.hideOnLeave) {
4336
- el.style.setProperty("display", "none", "important");
4337
- }
4338
- },
4339
- onAfterLeave(el) {
4340
- if (props.leaveAbsolute && (el == null ? void 0 : el._transitionInitialStyles)) {
4341
- const {
4342
- position,
4343
- top,
4344
- left,
4345
- width,
4346
- height
4347
- } = el._transitionInitialStyles;
4348
- delete el._transitionInitialStyles;
4349
- el.style.position = position || "";
4350
- el.style.top = top || "";
4351
- el.style.left = left || "";
4352
- el.style.width = width || "";
4353
- el.style.height = height || "";
4354
- }
4355
- }
4356
- };
4357
- return () => {
4358
- const tag = props.group ? vue.TransitionGroup : vue.Transition;
4359
- return vue.h(tag, {
4360
- name: props.disabled ? "" : name,
4361
- css: !props.disabled,
4362
- ...props.group ? void 0 : {
4363
- mode: props.mode
4364
- },
4365
- ...props.disabled ? {} : functions
4366
- }, slots.default);
4367
- };
4368
- }
4369
- });
4370
- }
4371
- function createJavascriptTransition(name, functions) {
4372
- let mode = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : "in-out";
4373
- return genericComponent()({
4374
- name,
4375
- props: {
4376
- mode: {
4377
- type: String,
4378
- default: mode
4379
- },
4380
- disabled: Boolean
4381
- },
4382
- setup(props, _ref2) {
4383
- let {
4384
- slots
4385
- } = _ref2;
4386
- return () => {
4387
- return vue.h(vue.Transition, {
4388
- name: props.disabled ? "" : name,
4389
- css: !props.disabled,
4390
- // mode: props.mode, // TODO: vuejs/vue-next#3104
4391
- ...props.disabled ? {} : functions
4392
- }, slots.default);
4393
- };
4394
- }
4395
- });
4396
- }
4397
- function ExpandTransitionGenerator() {
4398
- let expandedParentClass = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "";
4399
- let x = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false;
4400
- const sizeProperty = x ? "width" : "height";
4401
- const offsetProperty = vue.camelize(`offset-${sizeProperty}`);
4402
- return {
4403
- onBeforeEnter(el) {
4404
- el._parent = el.parentNode;
4405
- el._initialStyle = {
4406
- transition: el.style.transition,
4407
- overflow: el.style.overflow,
4408
- [sizeProperty]: el.style[sizeProperty]
4409
- };
4410
- },
4411
- onEnter(el) {
4412
- const initialStyle = el._initialStyle;
4413
- el.style.setProperty("transition", "none", "important");
4414
- el.style.overflow = "hidden";
4415
- const offset = `${el[offsetProperty]}px`;
4416
- el.style[sizeProperty] = "0";
4417
- void el.offsetHeight;
4418
- el.style.transition = initialStyle.transition;
4419
- if (expandedParentClass && el._parent) {
4420
- el._parent.classList.add(expandedParentClass);
4421
- }
4422
- requestAnimationFrame(() => {
4423
- el.style[sizeProperty] = offset;
4424
- });
4425
- },
4426
- onAfterEnter: resetStyles,
4427
- onEnterCancelled: resetStyles,
4428
- onLeave(el) {
4429
- el._initialStyle = {
4430
- transition: "",
4431
- overflow: el.style.overflow,
4432
- [sizeProperty]: el.style[sizeProperty]
4433
- };
4434
- el.style.overflow = "hidden";
4435
- el.style[sizeProperty] = `${el[offsetProperty]}px`;
4436
- void el.offsetHeight;
4437
- requestAnimationFrame(() => el.style[sizeProperty] = "0");
4438
- },
4439
- onAfterLeave,
4440
- onLeaveCancelled: onAfterLeave
4441
- };
4442
- function onAfterLeave(el) {
4443
- if (expandedParentClass && el._parent) {
4444
- el._parent.classList.remove(expandedParentClass);
4445
- }
4446
- resetStyles(el);
4447
- }
4448
- function resetStyles(el) {
4449
- const size = el._initialStyle[sizeProperty];
4450
- el.style.overflow = el._initialStyle.overflow;
4451
- if (size != null)
4452
- el.style[sizeProperty] = size;
4453
- delete el._initialStyle;
4454
- }
4455
- }
4456
- createCssTransition("fab-transition", "center center", "out-in");
4457
- createCssTransition("dialog-bottom-transition");
4458
- createCssTransition("dialog-top-transition");
4459
- createCssTransition("fade-transition");
4460
- const VScaleTransition = createCssTransition("scale-transition");
4461
- createCssTransition("scroll-x-transition");
4462
- createCssTransition("scroll-x-reverse-transition");
4463
- createCssTransition("scroll-y-transition");
4464
- createCssTransition("scroll-y-reverse-transition");
4465
- createCssTransition("slide-x-transition");
4466
- createCssTransition("slide-x-reverse-transition");
4467
- const VSlideYTransition = createCssTransition("slide-y-transition");
4468
- createCssTransition("slide-y-reverse-transition");
4469
- createJavascriptTransition("expand-transition", ExpandTransitionGenerator());
4470
- const VExpandXTransition = createJavascriptTransition("expand-x-transition", ExpandTransitionGenerator("", true));
4471
- const makeTransitionProps = propsFactory({
4472
- transition: {
4473
- type: [Boolean, String, Object],
4474
- default: "fade-transition",
4475
- validator: (val) => val !== true
4476
- }
4477
- }, "transition");
4478
- const MaybeTransition = (props, _ref) => {
4479
- let {
4480
- slots
4481
- } = _ref;
4482
- const {
4483
- transition,
4484
- disabled,
4485
- group,
4486
- ...rest
4487
- } = props;
4488
- const {
4489
- component = group ? vue.TransitionGroup : vue.Transition,
4490
- ...customProps
4491
- } = typeof transition === "object" ? transition : {};
4492
- return vue.h(component, vue.mergeProps(typeof transition === "string" ? {
4493
- name: disabled ? "" : transition
4494
- } : customProps, typeof transition === "string" ? {} : Object.fromEntries(Object.entries({
4495
- disabled,
4496
- group
4497
- }).filter((_ref2) => {
4498
- let [_, v] = _ref2;
4499
- return v !== void 0;
4500
- })), rest), slots);
4501
- };
4502
- const makeVMessagesProps = propsFactory({
4503
- active: Boolean,
4504
- color: String,
4505
- messages: {
4506
- type: [Array, String],
4507
- default: () => []
4508
- },
4509
- ...makeComponentProps(),
4510
- ...makeTransitionProps({
4511
- transition: {
4512
- component: VSlideYTransition,
4513
- leaveAbsolute: true,
4514
- group: true
4515
- }
4516
- })
4517
- }, "VMessages");
4518
- const VMessages = genericComponent()({
4519
- name: "VMessages",
4520
- props: makeVMessagesProps(),
4521
- setup(props, _ref) {
4522
- let {
4523
- slots
4524
- } = _ref;
4525
- const messages = vue.computed(() => wrapInArray(props.messages));
4526
- const {
4527
- textColorClasses,
4528
- textColorStyles
4529
- } = useTextColor(vue.computed(() => props.color));
4530
- useRender(() => vue.createVNode(MaybeTransition, {
4531
- "transition": props.transition,
4532
- "tag": "div",
4533
- "class": ["v-messages", textColorClasses.value, props.class],
4534
- "style": [textColorStyles.value, props.style],
4535
- "role": "alert",
4536
- "aria-live": "polite"
4537
- }, {
4538
- default: () => [props.active && messages.value.map((message, i) => vue.createVNode("div", {
4539
- "class": "v-messages__message",
4540
- "key": `${i}-${messages.value}`
4541
- }, [slots.message ? slots.message({
4542
- message
4543
- }) : message]))]
4544
- }));
4545
- return {};
4546
- }
4547
- });
4548
- const makeFocusProps = propsFactory({
4549
- focused: Boolean,
4550
- "onUpdate:focused": EventProp()
4551
- }, "focus");
4552
- function useFocus(props) {
4553
- let name = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : getCurrentInstanceName();
4554
- const isFocused = useProxiedModel(props, "focused");
4555
- const focusClasses = vue.computed(() => {
4556
- return {
4557
- [`${name}--focused`]: isFocused.value
4558
- };
4559
- });
4560
- function focus() {
4561
- isFocused.value = true;
4562
- }
4563
- function blur() {
4564
- isFocused.value = false;
4565
- }
4566
- return {
4567
- focusClasses,
4568
- isFocused,
4569
- focus,
4570
- blur
4571
- };
4572
- }
4573
- const FormKey = Symbol.for("vuetify:form");
4574
- function useForm() {
4575
- return vue.inject(FormKey, null);
4576
- }
4577
- const makeValidationProps = propsFactory({
4578
- disabled: {
4579
- type: Boolean,
4580
- default: null
4581
- },
4582
- error: Boolean,
4583
- errorMessages: {
4584
- type: [Array, String],
4585
- default: () => []
4586
- },
4587
- maxErrors: {
4588
- type: [Number, String],
4589
- default: 1
4590
- },
4591
- name: String,
4592
- label: String,
4593
- readonly: {
4594
- type: Boolean,
4595
- default: null
4596
- },
4597
- rules: {
4598
- type: Array,
4599
- default: () => []
4600
- },
4601
- modelValue: null,
4602
- validateOn: String,
4603
- validationValue: null,
4604
- ...makeFocusProps()
4605
- }, "validation");
4606
- function useValidation(props) {
4607
- let name = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : getCurrentInstanceName();
4608
- let id = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : getUid();
4609
- const model = useProxiedModel(props, "modelValue");
4610
- const validationModel = vue.computed(() => props.validationValue === void 0 ? model.value : props.validationValue);
4611
- const form = useForm();
4612
- const internalErrorMessages = vue.ref([]);
4613
- const isPristine = vue.shallowRef(true);
4614
- const isDirty = vue.computed(() => !!(wrapInArray(model.value === "" ? null : model.value).length || wrapInArray(validationModel.value === "" ? null : validationModel.value).length));
4615
- const isDisabled = vue.computed(() => !!(props.disabled ?? (form == null ? void 0 : form.isDisabled.value)));
4616
- const isReadonly = vue.computed(() => !!(props.readonly ?? (form == null ? void 0 : form.isReadonly.value)));
4617
- const errorMessages = vue.computed(() => {
4618
- var _a;
4619
- return ((_a = props.errorMessages) == null ? void 0 : _a.length) ? wrapInArray(props.errorMessages).concat(internalErrorMessages.value).slice(0, Math.max(0, +props.maxErrors)) : internalErrorMessages.value;
4620
- });
4621
- const validateOn = vue.computed(() => {
4622
- let value = (props.validateOn ?? (form == null ? void 0 : form.validateOn.value)) || "input";
4623
- if (value === "lazy")
4624
- value = "input lazy";
4625
- const set = new Set((value == null ? void 0 : value.split(" ")) ?? []);
4626
- return {
4627
- blur: set.has("blur") || set.has("input"),
4628
- input: set.has("input"),
4629
- submit: set.has("submit"),
4630
- lazy: set.has("lazy")
4631
- };
4632
- });
4633
- const isValid = vue.computed(() => {
4634
- var _a;
4635
- if (props.error || ((_a = props.errorMessages) == null ? void 0 : _a.length))
4636
- return false;
4637
- if (!props.rules.length)
4638
- return true;
4639
- if (isPristine.value) {
4640
- return internalErrorMessages.value.length || validateOn.value.lazy ? null : true;
4641
- } else {
4642
- return !internalErrorMessages.value.length;
4643
- }
4644
- });
4645
- const isValidating = vue.shallowRef(false);
4646
- const validationClasses = vue.computed(() => {
4647
- return {
4648
- [`${name}--error`]: isValid.value === false,
4649
- [`${name}--dirty`]: isDirty.value,
4650
- [`${name}--disabled`]: isDisabled.value,
4651
- [`${name}--readonly`]: isReadonly.value
4652
- };
4653
- });
4654
- const uid = vue.computed(() => props.name ?? vue.unref(id));
4655
- vue.onBeforeMount(() => {
4656
- form == null ? void 0 : form.register({
4657
- id: uid.value,
4658
- validate,
4659
- reset,
4660
- resetValidation
4661
- });
4662
- });
4663
- vue.onBeforeUnmount(() => {
4664
- form == null ? void 0 : form.unregister(uid.value);
4665
- });
4666
- vue.onMounted(async () => {
4667
- if (!validateOn.value.lazy) {
4668
- await validate(true);
4669
- }
4670
- form == null ? void 0 : form.update(uid.value, isValid.value, errorMessages.value);
4671
- });
4672
- useToggleScope(() => validateOn.value.input, () => {
4673
- vue.watch(validationModel, () => {
4674
- if (validationModel.value != null) {
4675
- validate();
4676
- } else if (props.focused) {
4677
- const unwatch = vue.watch(() => props.focused, (val) => {
4678
- if (!val)
4679
- validate();
4680
- unwatch();
4681
- });
4682
- }
4683
- });
4684
- });
4685
- useToggleScope(() => validateOn.value.blur, () => {
4686
- vue.watch(() => props.focused, (val) => {
4687
- if (!val)
4688
- validate();
4689
- });
4690
- });
4691
- vue.watch([isValid, errorMessages], () => {
4692
- form == null ? void 0 : form.update(uid.value, isValid.value, errorMessages.value);
4693
- });
4694
- async function reset() {
4695
- model.value = null;
4696
- await vue.nextTick();
4697
- await resetValidation();
4698
- }
4699
- async function resetValidation() {
4700
- isPristine.value = true;
4701
- if (!validateOn.value.lazy) {
4702
- await validate(true);
4703
- } else {
4704
- internalErrorMessages.value = [];
4705
- }
4706
- }
4707
- async function validate() {
4708
- let silent = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : false;
4709
- const results = [];
4710
- isValidating.value = true;
4711
- for (const rule of props.rules) {
4712
- if (results.length >= +(props.maxErrors ?? 1)) {
4713
- break;
4714
- }
4715
- const handler = typeof rule === "function" ? rule : () => rule;
4716
- const result = await handler(validationModel.value);
4717
- if (result === true)
4718
- continue;
4719
- if (result !== false && typeof result !== "string") {
4720
- console.warn(`${result} is not a valid value. Rule functions must return boolean true or a string.`);
4721
- continue;
4722
- }
4723
- results.push(result || "");
4724
- }
4725
- internalErrorMessages.value = results;
4726
- isValidating.value = false;
4727
- isPristine.value = silent;
4728
- return internalErrorMessages.value;
4729
- }
4730
- return {
4731
- errorMessages,
4732
- isDirty,
4733
- isDisabled,
4734
- isReadonly,
4735
- isPristine,
4736
- isValid,
4737
- isValidating,
4738
- reset,
4739
- resetValidation,
4740
- validate,
4741
- validationClasses
4742
- };
4743
- }
4744
- const makeVInputProps = propsFactory({
4745
- id: String,
4746
- appendIcon: IconValue,
4747
- centerAffix: {
4748
- type: Boolean,
4749
- default: true
4750
- },
4751
- prependIcon: IconValue,
4752
- hideDetails: [Boolean, String],
4753
- hideSpinButtons: Boolean,
4754
- hint: String,
4755
- persistentHint: Boolean,
4756
- messages: {
4757
- type: [Array, String],
4758
- default: () => []
4759
- },
4760
- direction: {
4761
- type: String,
4762
- default: "horizontal",
4763
- validator: (v) => ["horizontal", "vertical"].includes(v)
4764
- },
4765
- "onClick:prepend": EventProp(),
4766
- "onClick:append": EventProp(),
4767
- ...makeComponentProps(),
4768
- ...makeDensityProps(),
4769
- ...makeValidationProps()
4770
- }, "VInput");
4771
- const VInput = genericComponent()({
4772
- name: "VInput",
4773
- props: {
4774
- ...makeVInputProps()
4775
- },
4776
- emits: {
4777
- "update:modelValue": (value) => true
4778
- },
4779
- setup(props, _ref) {
4780
- let {
4781
- attrs,
4782
- slots,
4783
- emit
4784
- } = _ref;
4785
- const {
4786
- densityClasses
4787
- } = useDensity(props);
4788
- const {
4789
- rtlClasses
4790
- } = useRtl();
4791
- const {
4792
- InputIcon
4793
- } = useInputIcon(props);
4794
- const uid = getUid();
4795
- const id = vue.computed(() => props.id || `input-${uid}`);
4796
- const messagesId = vue.computed(() => `${id.value}-messages`);
4797
- const {
4798
- errorMessages,
4799
- isDirty,
4800
- isDisabled,
4801
- isReadonly,
4802
- isPristine,
4803
- isValid,
4804
- isValidating,
4805
- reset,
4806
- resetValidation,
4807
- validate,
4808
- validationClasses
4809
- } = useValidation(props, "v-input", id);
4810
- const slotProps = vue.computed(() => ({
4811
- id,
4812
- messagesId,
4813
- isDirty,
4814
- isDisabled,
4815
- isReadonly,
4816
- isPristine,
4817
- isValid,
4818
- isValidating,
4819
- reset,
4820
- resetValidation,
4821
- validate
4822
- }));
4823
- const messages = vue.computed(() => {
4824
- var _a;
4825
- if (((_a = props.errorMessages) == null ? void 0 : _a.length) || !isPristine.value && errorMessages.value.length) {
4826
- return errorMessages.value;
4827
- } else if (props.hint && (props.persistentHint || props.focused)) {
4828
- return props.hint;
4829
- } else {
4830
- return props.messages;
4831
- }
4832
- });
4833
- useRender(() => {
4834
- var _a, _b, _c, _d;
4835
- const hasPrepend = !!(slots.prepend || props.prependIcon);
4836
- const hasAppend = !!(slots.append || props.appendIcon);
4837
- const hasMessages = messages.value.length > 0;
4838
- const hasDetails = !props.hideDetails || props.hideDetails === "auto" && (hasMessages || !!slots.details);
4839
- return vue.createVNode("div", {
4840
- "class": ["v-input", `v-input--${props.direction}`, {
4841
- "v-input--center-affix": props.centerAffix,
4842
- "v-input--hide-spin-buttons": props.hideSpinButtons
4843
- }, densityClasses.value, rtlClasses.value, validationClasses.value, props.class],
4844
- "style": props.style
4845
- }, [hasPrepend && vue.createVNode("div", {
4846
- "key": "prepend",
4847
- "class": "v-input__prepend"
4848
- }, [(_a = slots.prepend) == null ? void 0 : _a.call(slots, slotProps.value), props.prependIcon && vue.createVNode(InputIcon, {
4849
- "key": "prepend-icon",
4850
- "name": "prepend"
4851
- }, null)]), slots.default && vue.createVNode("div", {
4852
- "class": "v-input__control"
4853
- }, [(_b = slots.default) == null ? void 0 : _b.call(slots, slotProps.value)]), hasAppend && vue.createVNode("div", {
4854
- "key": "append",
4855
- "class": "v-input__append"
4856
- }, [props.appendIcon && vue.createVNode(InputIcon, {
4857
- "key": "append-icon",
4858
- "name": "append"
4859
- }, null), (_c = slots.append) == null ? void 0 : _c.call(slots, slotProps.value)]), hasDetails && vue.createVNode("div", {
4860
- "class": "v-input__details"
4861
- }, [vue.createVNode(VMessages, {
4862
- "id": messagesId.value,
4863
- "active": hasMessages,
4864
- "messages": messages.value
4865
- }, {
4866
- message: slots.message
4867
- }), (_d = slots.details) == null ? void 0 : _d.call(slots, slotProps.value)])]);
4868
- });
4869
- return {
4870
- reset,
4871
- resetValidation,
4872
- validate,
4873
- isValid,
4874
- errorMessages
4875
- };
4876
- }
4877
- });
4878
- const makeVCheckboxProps = propsFactory({
4879
- ...makeVInputProps(),
4880
- ...omit(makeVCheckboxBtnProps(), ["inline"])
4881
- }, "VCheckbox");
4882
- const VCheckbox = genericComponent()({
4883
- name: "VCheckbox",
4884
- inheritAttrs: false,
4885
- props: makeVCheckboxProps(),
4886
- emits: {
4887
- "update:modelValue": (value) => true,
4888
- "update:focused": (focused) => true
4889
- },
4890
- setup(props, _ref) {
4891
- let {
4892
- attrs,
4893
- slots
4894
- } = _ref;
4895
- const model = useProxiedModel(props, "modelValue");
4896
- const {
4897
- isFocused,
4898
- focus,
4899
- blur
4900
- } = useFocus(props);
4901
- const uid = getUid();
4902
- const id = vue.computed(() => props.id || `checkbox-${uid}`);
4903
- useRender(() => {
4904
- const [rootAttrs, controlAttrs] = filterInputAttrs(attrs);
4905
- const inputProps = VInput.filterProps(props);
4906
- const checkboxProps = VCheckboxBtn.filterProps(props);
4907
- return vue.createVNode(VInput, vue.mergeProps({
4908
- "class": ["v-checkbox", props.class]
4909
- }, rootAttrs, inputProps, {
4910
- "modelValue": model.value,
4911
- "onUpdate:modelValue": ($event) => model.value = $event,
4912
- "id": id.value,
4913
- "focused": isFocused.value,
4914
- "style": props.style
4915
- }), {
4916
- ...slots,
4917
- default: (_ref2) => {
4918
- let {
4919
- id: id2,
4920
- messagesId,
4921
- isDisabled,
4922
- isReadonly,
4923
- isValid
4924
- } = _ref2;
4925
- return vue.createVNode(VCheckboxBtn, vue.mergeProps(checkboxProps, {
4926
- "id": id2.value,
4927
- "aria-describedby": messagesId.value,
4928
- "disabled": isDisabled.value,
4929
- "readonly": isReadonly.value
4930
- }, controlAttrs, {
4931
- "error": isValid.value === false,
4932
- "modelValue": model.value,
4933
- "onUpdate:modelValue": ($event) => model.value = $event,
4934
- "onFocus": focus,
4935
- "onBlur": blur
4936
- }), slots);
4937
- }
4938
- });
4939
- });
4940
- return {};
4941
- }
4942
- });
4943
- const makeVDividerProps = propsFactory({
4944
- color: String,
4945
- inset: Boolean,
4946
- length: [Number, String],
4947
- thickness: [Number, String],
4948
- vertical: Boolean,
4949
- ...makeComponentProps(),
4950
- ...makeThemeProps()
4951
- }, "VDivider");
4952
- const VDivider = genericComponent()({
4953
- name: "VDivider",
4954
- props: makeVDividerProps(),
4955
- setup(props, _ref) {
4956
- let {
4957
- attrs
4958
- } = _ref;
4959
- const {
4960
- themeClasses
4961
- } = provideTheme(props);
4962
- const {
4963
- textColorClasses,
4964
- textColorStyles
4965
- } = useTextColor(vue.toRef(props, "color"));
4966
- const dividerStyles = vue.computed(() => {
4967
- const styles2 = {};
4968
- if (props.length) {
4969
- styles2[props.vertical ? "maxHeight" : "maxWidth"] = convertToUnit(props.length);
4970
- }
4971
- if (props.thickness) {
4972
- styles2[props.vertical ? "borderRightWidth" : "borderTopWidth"] = convertToUnit(props.thickness);
4973
- }
4974
- return styles2;
4975
- });
4976
- useRender(() => vue.createVNode("hr", {
4977
- "class": [{
4978
- "v-divider": true,
4979
- "v-divider--inset": props.inset,
4980
- "v-divider--vertical": props.vertical
4981
- }, themeClasses.value, textColorClasses.value, props.class],
4982
- "style": [dividerStyles.value, textColorStyles.value, props.style],
4983
- "aria-orientation": !attrs.role || attrs.role === "separator" ? props.vertical ? "vertical" : "horizontal" : void 0,
4984
- "role": `${attrs.role || "separator"}`
4985
- }, null));
4986
- return {};
4987
- }
4988
- });
4989
- const makeVContainerProps = propsFactory({
4990
- fluid: {
4991
- type: Boolean,
4992
- default: false
4993
- },
4994
- ...makeComponentProps(),
4995
- ...makeTagProps()
4996
- }, "VContainer");
4997
- const VContainer = genericComponent()({
4998
- name: "VContainer",
4999
- props: makeVContainerProps(),
5000
- setup(props, _ref) {
5001
- let {
5002
- slots
5003
- } = _ref;
5004
- const {
5005
- rtlClasses
5006
- } = useRtl();
5007
- useRender(() => vue.createVNode(props.tag, {
5008
- "class": ["v-container", {
5009
- "v-container--fluid": props.fluid
5010
- }, rtlClasses.value, props.class],
5011
- "style": props.style
5012
- }, slots));
5013
- return {};
5014
- }
5015
- });
5016
- const breakpoints = ["sm", "md", "lg", "xl", "xxl"];
5017
- const breakpointProps = (() => {
5018
- return breakpoints.reduce((props, val) => {
5019
- props[val] = {
5020
- type: [Boolean, String, Number],
5021
- default: false
5022
- };
5023
- return props;
5024
- }, {});
5025
- })();
5026
- const offsetProps = (() => {
5027
- return breakpoints.reduce((props, val) => {
5028
- const offsetKey = "offset" + vue.capitalize(val);
5029
- props[offsetKey] = {
5030
- type: [String, Number],
5031
- default: null
5032
- };
5033
- return props;
5034
- }, {});
5035
- })();
5036
- const orderProps = (() => {
5037
- return breakpoints.reduce((props, val) => {
5038
- const orderKey = "order" + vue.capitalize(val);
5039
- props[orderKey] = {
5040
- type: [String, Number],
5041
- default: null
5042
- };
5043
- return props;
5044
- }, {});
5045
- })();
5046
- const propMap$1 = {
5047
- col: Object.keys(breakpointProps),
5048
- offset: Object.keys(offsetProps),
5049
- order: Object.keys(orderProps)
5050
- };
5051
- function breakpointClass$1(type, prop, val) {
5052
- let className = type;
5053
- if (val == null || val === false) {
5054
- return void 0;
5055
- }
5056
- if (prop) {
5057
- const breakpoint = prop.replace(type, "");
5058
- className += `-${breakpoint}`;
5059
- }
5060
- if (type === "col") {
5061
- className = "v-" + className;
5062
- }
5063
- if (type === "col" && (val === "" || val === true)) {
5064
- return className.toLowerCase();
5065
- }
5066
- className += `-${val}`;
5067
- return className.toLowerCase();
5068
- }
5069
- const ALIGN_SELF_VALUES = ["auto", "start", "end", "center", "baseline", "stretch"];
5070
- const makeVColProps = propsFactory({
5071
- cols: {
5072
- type: [Boolean, String, Number],
5073
- default: false
5074
- },
5075
- ...breakpointProps,
5076
- offset: {
5077
- type: [String, Number],
5078
- default: null
5079
- },
5080
- ...offsetProps,
5081
- order: {
5082
- type: [String, Number],
5083
- default: null
5084
- },
5085
- ...orderProps,
5086
- alignSelf: {
5087
- type: String,
5088
- default: null,
5089
- validator: (str) => ALIGN_SELF_VALUES.includes(str)
5090
- },
5091
- ...makeComponentProps(),
5092
- ...makeTagProps()
5093
- }, "VCol");
5094
- const VCol = genericComponent()({
5095
- name: "VCol",
5096
- props: makeVColProps(),
5097
- setup(props, _ref) {
5098
- let {
5099
- slots
5100
- } = _ref;
5101
- const classes = vue.computed(() => {
5102
- const classList = [];
5103
- let type;
5104
- for (type in propMap$1) {
5105
- propMap$1[type].forEach((prop) => {
5106
- const value = props[prop];
5107
- const className = breakpointClass$1(type, prop, value);
5108
- if (className)
5109
- classList.push(className);
5110
- });
5111
- }
5112
- const hasColClasses = classList.some((className) => className.startsWith("v-col-"));
5113
- classList.push({
5114
- // Default to .v-col if no other col-{bp}-* classes generated nor `cols` specified.
5115
- "v-col": !hasColClasses || !props.cols,
5116
- [`v-col-${props.cols}`]: props.cols,
5117
- [`offset-${props.offset}`]: props.offset,
5118
- [`order-${props.order}`]: props.order,
5119
- [`align-self-${props.alignSelf}`]: props.alignSelf
5120
- });
5121
- return classList;
5122
- });
5123
- return () => {
5124
- var _a;
5125
- return vue.h(props.tag, {
5126
- class: [classes.value, props.class],
5127
- style: props.style
5128
- }, (_a = slots.default) == null ? void 0 : _a.call(slots));
5129
- };
5130
- }
5131
- });
5132
- const ALIGNMENT = ["start", "end", "center"];
5133
- const SPACE = ["space-between", "space-around", "space-evenly"];
5134
- function makeRowProps(prefix, def) {
5135
- return breakpoints.reduce((props, val) => {
5136
- const prefixKey = prefix + vue.capitalize(val);
5137
- props[prefixKey] = def();
5138
- return props;
5139
- }, {});
5140
- }
5141
- const ALIGN_VALUES = [...ALIGNMENT, "baseline", "stretch"];
5142
- const alignValidator = (str) => ALIGN_VALUES.includes(str);
5143
- const alignProps = makeRowProps("align", () => ({
5144
- type: String,
5145
- default: null,
5146
- validator: alignValidator
5147
- }));
5148
- const JUSTIFY_VALUES = [...ALIGNMENT, ...SPACE];
5149
- const justifyValidator = (str) => JUSTIFY_VALUES.includes(str);
5150
- const justifyProps = makeRowProps("justify", () => ({
5151
- type: String,
5152
- default: null,
5153
- validator: justifyValidator
5154
- }));
5155
- const ALIGN_CONTENT_VALUES = [...ALIGNMENT, ...SPACE, "stretch"];
5156
- const alignContentValidator = (str) => ALIGN_CONTENT_VALUES.includes(str);
5157
- const alignContentProps = makeRowProps("alignContent", () => ({
5158
- type: String,
5159
- default: null,
5160
- validator: alignContentValidator
5161
- }));
5162
- const propMap = {
5163
- align: Object.keys(alignProps),
5164
- justify: Object.keys(justifyProps),
5165
- alignContent: Object.keys(alignContentProps)
5166
- };
5167
- const classMap = {
5168
- align: "align",
5169
- justify: "justify",
5170
- alignContent: "align-content"
5171
- };
5172
- function breakpointClass(type, prop, val) {
5173
- let className = classMap[type];
5174
- if (val == null) {
5175
- return void 0;
5176
- }
5177
- if (prop) {
5178
- const breakpoint = prop.replace(type, "");
5179
- className += `-${breakpoint}`;
5180
- }
5181
- className += `-${val}`;
5182
- return className.toLowerCase();
5183
- }
5184
- const makeVRowProps = propsFactory({
5185
- dense: Boolean,
5186
- noGutters: Boolean,
5187
- align: {
5188
- type: String,
5189
- default: null,
5190
- validator: alignValidator
5191
- },
5192
- ...alignProps,
5193
- justify: {
5194
- type: String,
5195
- default: null,
5196
- validator: justifyValidator
5197
- },
5198
- ...justifyProps,
5199
- alignContent: {
5200
- type: String,
5201
- default: null,
5202
- validator: alignContentValidator
5203
- },
5204
- ...alignContentProps,
5205
- ...makeComponentProps(),
5206
- ...makeTagProps()
5207
- }, "VRow");
5208
- const VRow = genericComponent()({
5209
- name: "VRow",
5210
- props: makeVRowProps(),
5211
- setup(props, _ref) {
5212
- let {
5213
- slots
5214
- } = _ref;
5215
- const classes = vue.computed(() => {
5216
- const classList = [];
5217
- let type;
5218
- for (type in propMap) {
5219
- propMap[type].forEach((prop) => {
5220
- const value = props[prop];
5221
- const className = breakpointClass(type, prop, value);
5222
- if (className)
5223
- classList.push(className);
5224
- });
5225
- }
5226
- classList.push({
5227
- "v-row--no-gutters": props.noGutters,
5228
- "v-row--dense": props.dense,
5229
- [`align-${props.align}`]: props.align,
5230
- [`justify-${props.justify}`]: props.justify,
5231
- [`align-content-${props.alignContent}`]: props.alignContent
5232
- });
5233
- return classList;
5234
- });
5235
- return () => {
5236
- var _a;
5237
- return vue.h(props.tag, {
5238
- class: ["v-row", classes.value, props.class],
5239
- style: props.style
5240
- }, (_a = slots.default) == null ? void 0 : _a.call(slots));
5241
- };
5242
- }
5243
- });
5244
- const makeVRadioProps = propsFactory({
5245
- ...makeVSelectionControlProps({
5246
- falseIcon: "$radioOff",
5247
- trueIcon: "$radioOn"
5248
- })
5249
- }, "VRadio");
5250
- const VRadio = genericComponent()({
5251
- name: "VRadio",
5252
- props: makeVRadioProps(),
5253
- setup(props, _ref) {
5254
- let {
5255
- slots
5256
- } = _ref;
5257
- useRender(() => vue.createVNode(VSelectionControl, vue.mergeProps(props, {
5258
- "class": ["v-radio", props.class],
5259
- "style": props.style,
5260
- "type": "radio"
5261
- }), slots));
5262
- return {};
5263
- }
5264
- });
5265
- const makeVRadioGroupProps = propsFactory({
5266
- height: {
5267
- type: [Number, String],
5268
- default: "auto"
5269
- },
5270
- ...makeVInputProps(),
5271
- ...omit(makeSelectionControlGroupProps(), ["multiple"]),
5272
- trueIcon: {
5273
- type: IconValue,
5274
- default: "$radioOn"
5275
- },
5276
- falseIcon: {
5277
- type: IconValue,
5278
- default: "$radioOff"
5279
- },
5280
- type: {
5281
- type: String,
5282
- default: "radio"
5283
- }
5284
- }, "VRadioGroup");
5285
- const VRadioGroup = genericComponent()({
5286
- name: "VRadioGroup",
5287
- inheritAttrs: false,
5288
- props: makeVRadioGroupProps(),
5289
- emits: {
5290
- "update:modelValue": (value) => true
5291
- },
5292
- setup(props, _ref) {
5293
- let {
5294
- attrs,
5295
- slots
5296
- } = _ref;
5297
- const uid = getUid();
5298
- const id = vue.computed(() => props.id || `radio-group-${uid}`);
5299
- const model = useProxiedModel(props, "modelValue");
5300
- useRender(() => {
5301
- const [rootAttrs, controlAttrs] = filterInputAttrs(attrs);
5302
- const inputProps = VInput.filterProps(props);
5303
- const controlProps = VSelectionControl.filterProps(props);
5304
- const label = slots.label ? slots.label({
5305
- label: props.label,
5306
- props: {
5307
- for: id.value
5308
- }
5309
- }) : props.label;
5310
- return vue.createVNode(VInput, vue.mergeProps({
5311
- "class": ["v-radio-group", props.class],
5312
- "style": props.style
5313
- }, rootAttrs, inputProps, {
5314
- "modelValue": model.value,
5315
- "onUpdate:modelValue": ($event) => model.value = $event,
5316
- "id": id.value
5317
- }), {
5318
- ...slots,
5319
- default: (_ref2) => {
5320
- let {
5321
- id: id2,
5322
- messagesId,
5323
- isDisabled,
5324
- isReadonly
5325
- } = _ref2;
5326
- return vue.createVNode(vue.Fragment, null, [label && vue.createVNode(VLabel, {
5327
- "id": id2.value
5328
- }, {
5329
- default: () => [label]
5330
- }), vue.createVNode(VSelectionControlGroup, vue.mergeProps(controlProps, {
5331
- "id": id2.value,
5332
- "aria-describedby": messagesId.value,
5333
- "defaultsTarget": "VRadio",
5334
- "trueIcon": props.trueIcon,
5335
- "falseIcon": props.falseIcon,
5336
- "type": props.type,
5337
- "disabled": isDisabled.value,
5338
- "readonly": isReadonly.value,
5339
- "aria-labelledby": label ? id2.value : void 0,
5340
- "multiple": false
5341
- }, controlAttrs, {
5342
- "modelValue": model.value,
5343
- "onUpdate:modelValue": ($event) => model.value = $event
5344
- }), slots)]);
5345
- }
5346
- });
5347
- });
5348
- return {};
5349
- }
5350
- });
5351
- const makeElevationProps = propsFactory({
5352
- elevation: {
5353
- type: [Number, String],
5354
- validator(v) {
5355
- const value = parseInt(v);
5356
- return !isNaN(value) && value >= 0 && // Material Design has a maximum elevation of 24
5357
- // https://material.io/design/environment/elevation.html#default-elevations
5358
- value <= 24;
5359
- }
5360
- }
5361
- }, "elevation");
5362
- function useElevation(props) {
5363
- const elevationClasses = vue.computed(() => {
5364
- const elevation = vue.isRef(props) ? props.value : props.elevation;
5365
- const classes = [];
5366
- if (elevation == null)
5367
- return classes;
5368
- classes.push(`elevation-${elevation}`);
5369
- return classes;
5370
- });
5371
- return {
5372
- elevationClasses
5373
- };
5374
- }
5375
- const makeRoundedProps = propsFactory({
5376
- rounded: {
5377
- type: [Boolean, Number, String],
5378
- default: void 0
5379
- },
5380
- tile: Boolean
5381
- }, "rounded");
5382
- function useRounded(props) {
5383
- let name = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : getCurrentInstanceName();
5384
- const roundedClasses = vue.computed(() => {
5385
- const rounded = vue.isRef(props) ? props.value : props.rounded;
5386
- const tile = vue.isRef(props) ? props.value : props.tile;
5387
- const classes = [];
5388
- if (rounded === true || rounded === "") {
5389
- classes.push(`${name}--rounded`);
5390
- } else if (typeof rounded === "string" || rounded === 0) {
5391
- for (const value of String(rounded).split(" ")) {
5392
- classes.push(`rounded-${value}`);
5393
- }
5394
- } else if (tile) {
5395
- classes.push("rounded-0");
5396
- }
5397
- return classes;
5398
- });
5399
- return {
5400
- roundedClasses
5401
- };
5402
- }
5403
- const VSliderSymbol = Symbol.for("vuetify:v-slider");
5404
- function getOffset(e, el, direction) {
5405
- const vertical = direction === "vertical";
5406
- const rect = el.getBoundingClientRect();
5407
- const touch = "touches" in e ? e.touches[0] : e;
5408
- return vertical ? touch.clientY - (rect.top + rect.height / 2) : touch.clientX - (rect.left + rect.width / 2);
5409
- }
5410
- function getPosition(e, position) {
5411
- if ("touches" in e && e.touches.length)
5412
- return e.touches[0][position];
5413
- else if ("changedTouches" in e && e.changedTouches.length)
5414
- return e.changedTouches[0][position];
5415
- else
5416
- return e[position];
5417
- }
5418
- const makeSliderProps = propsFactory({
5419
- disabled: {
5420
- type: Boolean,
5421
- default: null
5422
- },
5423
- error: Boolean,
5424
- readonly: {
5425
- type: Boolean,
5426
- default: null
5427
- },
5428
- max: {
5429
- type: [Number, String],
5430
- default: 100
5431
- },
5432
- min: {
5433
- type: [Number, String],
5434
- default: 0
5435
- },
5436
- step: {
5437
- type: [Number, String],
5438
- default: 0
5439
- },
5440
- thumbColor: String,
5441
- thumbLabel: {
5442
- type: [Boolean, String],
5443
- default: void 0,
5444
- validator: (v) => typeof v === "boolean" || v === "always"
5445
- },
5446
- thumbSize: {
5447
- type: [Number, String],
5448
- default: 20
5449
- },
5450
- showTicks: {
5451
- type: [Boolean, String],
5452
- default: false,
5453
- validator: (v) => typeof v === "boolean" || v === "always"
5454
- },
5455
- ticks: {
5456
- type: [Array, Object]
5457
- },
5458
- tickSize: {
5459
- type: [Number, String],
5460
- default: 2
5461
- },
5462
- color: String,
5463
- trackColor: String,
5464
- trackFillColor: String,
5465
- trackSize: {
5466
- type: [Number, String],
5467
- default: 4
5468
- },
5469
- direction: {
5470
- type: String,
5471
- default: "horizontal",
5472
- validator: (v) => ["vertical", "horizontal"].includes(v)
5473
- },
5474
- reverse: Boolean,
5475
- ...makeRoundedProps(),
5476
- ...makeElevationProps({
5477
- elevation: 2
5478
- }),
5479
- ripple: {
5480
- type: Boolean,
5481
- default: true
5482
- }
5483
- }, "Slider");
5484
- const useSteps = (props) => {
5485
- const min = vue.computed(() => parseFloat(props.min));
5486
- const max = vue.computed(() => parseFloat(props.max));
5487
- const step = vue.computed(() => +props.step > 0 ? parseFloat(props.step) : 0);
5488
- const decimals = vue.computed(() => Math.max(getDecimals(step.value), getDecimals(min.value)));
5489
- function roundValue(value) {
5490
- value = parseFloat(value);
5491
- if (step.value <= 0)
5492
- return value;
5493
- const clamped = clamp(value, min.value, max.value);
5494
- const offset = min.value % step.value;
5495
- const newValue = Math.round((clamped - offset) / step.value) * step.value + offset;
5496
- return parseFloat(Math.min(newValue, max.value).toFixed(decimals.value));
5497
- }
5498
- return {
5499
- min,
5500
- max,
5501
- step,
5502
- decimals,
5503
- roundValue
5504
- };
5505
- };
5506
- const useSlider = (_ref) => {
5507
- let {
5508
- props,
5509
- steps,
5510
- onSliderStart,
5511
- onSliderMove,
5512
- onSliderEnd,
5513
- getActiveThumb
5514
- } = _ref;
5515
- const {
5516
- isRtl
5517
- } = useRtl();
5518
- const isReversed = vue.toRef(props, "reverse");
5519
- const vertical = vue.computed(() => props.direction === "vertical");
5520
- const indexFromEnd = vue.computed(() => vertical.value !== isReversed.value);
5521
- const {
5522
- min,
5523
- max,
5524
- step,
5525
- decimals,
5526
- roundValue
5527
- } = steps;
5528
- const thumbSize = vue.computed(() => parseInt(props.thumbSize, 10));
5529
- const tickSize = vue.computed(() => parseInt(props.tickSize, 10));
5530
- const trackSize = vue.computed(() => parseInt(props.trackSize, 10));
5531
- const numTicks = vue.computed(() => (max.value - min.value) / step.value);
5532
- const disabled = vue.toRef(props, "disabled");
5533
- const thumbColor = vue.computed(() => props.error || props.disabled ? void 0 : props.thumbColor ?? props.color);
5534
- const trackColor = vue.computed(() => props.error || props.disabled ? void 0 : props.trackColor ?? props.color);
5535
- const trackFillColor = vue.computed(() => props.error || props.disabled ? void 0 : props.trackFillColor ?? props.color);
5536
- const mousePressed = vue.shallowRef(false);
5537
- const startOffset = vue.shallowRef(0);
5538
- const trackContainerRef = vue.ref();
5539
- const activeThumbRef = vue.ref();
5540
- function parseMouseMove(e) {
5541
- var _a;
5542
- const vertical2 = props.direction === "vertical";
5543
- const start = vertical2 ? "top" : "left";
5544
- const length = vertical2 ? "height" : "width";
5545
- const position2 = vertical2 ? "clientY" : "clientX";
5546
- const {
5547
- [start]: trackStart,
5548
- [length]: trackLength
5549
- } = (_a = trackContainerRef.value) == null ? void 0 : _a.$el.getBoundingClientRect();
5550
- const clickOffset = getPosition(e, position2);
5551
- let clickPos = Math.min(Math.max((clickOffset - trackStart - startOffset.value) / trackLength, 0), 1) || 0;
5552
- if (vertical2 ? indexFromEnd.value : indexFromEnd.value !== isRtl.value)
5553
- clickPos = 1 - clickPos;
5554
- return roundValue(min.value + clickPos * (max.value - min.value));
5555
- }
5556
- const handleStop = (e) => {
5557
- onSliderEnd({
5558
- value: parseMouseMove(e)
5559
- });
5560
- mousePressed.value = false;
5561
- startOffset.value = 0;
5562
- };
5563
- const handleStart = (e) => {
5564
- activeThumbRef.value = getActiveThumb(e);
5565
- if (!activeThumbRef.value)
5566
- return;
5567
- activeThumbRef.value.focus();
5568
- mousePressed.value = true;
5569
- if (activeThumbRef.value.contains(e.target)) {
5570
- startOffset.value = getOffset(e, activeThumbRef.value, props.direction);
5571
- } else {
5572
- startOffset.value = 0;
5573
- onSliderMove({
5574
- value: parseMouseMove(e)
5575
- });
5576
- }
5577
- onSliderStart({
5578
- value: parseMouseMove(e)
5579
- });
5580
- };
5581
- const moveListenerOptions = {
5582
- passive: true,
5583
- capture: true
5584
- };
5585
- function onMouseMove(e) {
5586
- onSliderMove({
5587
- value: parseMouseMove(e)
5588
- });
5589
- }
5590
- function onSliderMouseUp(e) {
5591
- e.stopPropagation();
5592
- e.preventDefault();
5593
- handleStop(e);
5594
- window.removeEventListener("mousemove", onMouseMove, moveListenerOptions);
5595
- window.removeEventListener("mouseup", onSliderMouseUp);
5596
- }
5597
- function onSliderTouchend(e) {
5598
- var _a;
5599
- handleStop(e);
5600
- window.removeEventListener("touchmove", onMouseMove, moveListenerOptions);
5601
- (_a = e.target) == null ? void 0 : _a.removeEventListener("touchend", onSliderTouchend);
5602
- }
5603
- function onSliderTouchstart(e) {
5604
- var _a;
5605
- handleStart(e);
5606
- window.addEventListener("touchmove", onMouseMove, moveListenerOptions);
5607
- (_a = e.target) == null ? void 0 : _a.addEventListener("touchend", onSliderTouchend, {
5608
- passive: false
5609
- });
5610
- }
5611
- function onSliderMousedown(e) {
5612
- e.preventDefault();
5613
- handleStart(e);
5614
- window.addEventListener("mousemove", onMouseMove, moveListenerOptions);
5615
- window.addEventListener("mouseup", onSliderMouseUp, {
5616
- passive: false
5617
- });
5618
- }
5619
- const position = (val) => {
5620
- const percentage = (val - min.value) / (max.value - min.value) * 100;
5621
- return clamp(isNaN(percentage) ? 0 : percentage, 0, 100);
5622
- };
5623
- const showTicks = vue.toRef(props, "showTicks");
5624
- const parsedTicks = vue.computed(() => {
5625
- if (!showTicks.value)
5626
- return [];
5627
- if (!props.ticks) {
5628
- return numTicks.value !== Infinity ? createRange(numTicks.value + 1).map((t) => {
5629
- const value = min.value + t * step.value;
5630
- return {
5631
- value,
5632
- position: position(value)
5633
- };
5634
- }) : [];
5635
- }
5636
- if (Array.isArray(props.ticks))
5637
- return props.ticks.map((t) => ({
5638
- value: t,
5639
- position: position(t),
5640
- label: t.toString()
5641
- }));
5642
- return Object.keys(props.ticks).map((key) => ({
5643
- value: parseFloat(key),
5644
- position: position(parseFloat(key)),
5645
- label: props.ticks[key]
5646
- }));
5647
- });
5648
- const hasLabels = vue.computed(() => parsedTicks.value.some((_ref2) => {
5649
- let {
5650
- label
5651
- } = _ref2;
5652
- return !!label;
5653
- }));
5654
- const data = {
5655
- activeThumbRef,
5656
- color: vue.toRef(props, "color"),
5657
- decimals,
5658
- disabled,
5659
- direction: vue.toRef(props, "direction"),
5660
- elevation: vue.toRef(props, "elevation"),
5661
- hasLabels,
5662
- isReversed,
5663
- indexFromEnd,
5664
- min,
5665
- max,
5666
- mousePressed,
5667
- numTicks,
5668
- onSliderMousedown,
5669
- onSliderTouchstart,
5670
- parsedTicks,
5671
- parseMouseMove,
5672
- position,
5673
- readonly: vue.toRef(props, "readonly"),
5674
- rounded: vue.toRef(props, "rounded"),
5675
- roundValue,
5676
- showTicks,
5677
- startOffset,
5678
- step,
5679
- thumbSize,
5680
- thumbColor,
5681
- thumbLabel: vue.toRef(props, "thumbLabel"),
5682
- ticks: vue.toRef(props, "ticks"),
5683
- tickSize,
5684
- trackColor,
5685
- trackContainerRef,
5686
- trackFillColor,
5687
- trackSize,
5688
- vertical
5689
- };
5690
- vue.provide(VSliderSymbol, data);
5691
- return data;
5692
- };
5693
- const makeVSliderThumbProps = propsFactory({
5694
- focused: Boolean,
5695
- max: {
5696
- type: Number,
5697
- required: true
5698
- },
5699
- min: {
5700
- type: Number,
5701
- required: true
5702
- },
5703
- modelValue: {
5704
- type: Number,
5705
- required: true
5706
- },
5707
- position: {
5708
- type: Number,
5709
- required: true
5710
- },
5711
- ripple: {
5712
- type: [Boolean, Object],
5713
- default: true
5714
- },
5715
- ...makeComponentProps()
5716
- }, "VSliderThumb");
5717
- const VSliderThumb = genericComponent()({
5718
- name: "VSliderThumb",
5719
- directives: {
5720
- Ripple
5721
- },
5722
- props: makeVSliderThumbProps(),
5723
- emits: {
5724
- "update:modelValue": (v) => true
5725
- },
5726
- setup(props, _ref) {
5727
- let {
5728
- slots,
5729
- emit
5730
- } = _ref;
5731
- const slider = vue.inject(VSliderSymbol);
5732
- const {
5733
- isRtl,
5734
- rtlClasses
5735
- } = useRtl();
5736
- if (!slider)
5737
- throw new Error("[Vuetify] v-slider-thumb must be used inside v-slider or v-range-slider");
5738
- const {
5739
- thumbColor,
5740
- step,
5741
- disabled,
5742
- thumbSize,
5743
- thumbLabel,
5744
- direction,
5745
- isReversed,
5746
- vertical,
5747
- readonly,
5748
- elevation,
5749
- mousePressed,
5750
- decimals,
5751
- indexFromEnd
5752
- } = slider;
5753
- const elevationProps = vue.computed(() => !disabled.value ? elevation.value : void 0);
5754
- const {
5755
- elevationClasses
5756
- } = useElevation(elevationProps);
5757
- const {
5758
- textColorClasses,
5759
- textColorStyles
5760
- } = useTextColor(thumbColor);
5761
- const {
5762
- pageup,
5763
- pagedown,
5764
- end,
5765
- home,
5766
- left,
5767
- right,
5768
- down,
5769
- up
5770
- } = keyValues;
5771
- const relevantKeys = [pageup, pagedown, end, home, left, right, down, up];
5772
- const multipliers = vue.computed(() => {
5773
- if (step.value)
5774
- return [1, 2, 3];
5775
- else
5776
- return [1, 5, 10];
5777
- });
5778
- function parseKeydown(e, value) {
5779
- if (!relevantKeys.includes(e.key))
5780
- return;
5781
- e.preventDefault();
5782
- const _step = step.value || 0.1;
5783
- const steps = (props.max - props.min) / _step;
5784
- if ([left, right, down, up].includes(e.key)) {
5785
- const increase = vertical.value ? [isRtl.value ? left : right, isReversed.value ? down : up] : indexFromEnd.value !== isRtl.value ? [left, up] : [right, up];
5786
- const direction2 = increase.includes(e.key) ? 1 : -1;
5787
- const multiplier = e.shiftKey ? 2 : e.ctrlKey ? 1 : 0;
5788
- value = value + direction2 * _step * multipliers.value[multiplier];
5789
- } else if (e.key === home) {
5790
- value = props.min;
5791
- } else if (e.key === end) {
5792
- value = props.max;
5793
- } else {
5794
- const direction2 = e.key === pagedown ? 1 : -1;
5795
- value = value - direction2 * _step * (steps > 100 ? steps / 10 : 10);
5796
- }
5797
- return Math.max(props.min, Math.min(props.max, value));
5798
- }
5799
- function onKeydown(e) {
5800
- const newValue = parseKeydown(e, props.modelValue);
5801
- newValue != null && emit("update:modelValue", newValue);
5802
- }
5803
- useRender(() => {
5804
- const positionPercentage = convertToUnit(indexFromEnd.value ? 100 - props.position : props.position, "%");
5805
- return vue.createVNode("div", {
5806
- "class": ["v-slider-thumb", {
5807
- "v-slider-thumb--focused": props.focused,
5808
- "v-slider-thumb--pressed": props.focused && mousePressed.value
5809
- }, props.class, rtlClasses.value],
5810
- "style": [{
5811
- "--v-slider-thumb-position": positionPercentage,
5812
- "--v-slider-thumb-size": convertToUnit(thumbSize.value)
5813
- }, props.style],
5814
- "role": "slider",
5815
- "tabindex": disabled.value ? -1 : 0,
5816
- "aria-valuemin": props.min,
5817
- "aria-valuemax": props.max,
5818
- "aria-valuenow": props.modelValue,
5819
- "aria-readonly": !!readonly.value,
5820
- "aria-orientation": direction.value,
5821
- "onKeydown": !readonly.value ? onKeydown : void 0
5822
- }, [vue.createVNode("div", {
5823
- "class": ["v-slider-thumb__surface", textColorClasses.value, elevationClasses.value],
5824
- "style": {
5825
- ...textColorStyles.value
5826
- }
5827
- }, null), vue.withDirectives(vue.createVNode("div", {
5828
- "class": ["v-slider-thumb__ripple", textColorClasses.value],
5829
- "style": textColorStyles.value
5830
- }, null), [[vue.resolveDirective("ripple"), props.ripple, null, {
5831
- circle: true,
5832
- center: true
5833
- }]]), vue.createVNode(VScaleTransition, {
5834
- "origin": "bottom center"
5835
- }, {
5836
- default: () => {
5837
- var _a;
5838
- return [vue.withDirectives(vue.createVNode("div", {
5839
- "class": "v-slider-thumb__label-container"
5840
- }, [vue.createVNode("div", {
5841
- "class": ["v-slider-thumb__label"]
5842
- }, [vue.createVNode("div", null, [((_a = slots["thumb-label"]) == null ? void 0 : _a.call(slots, {
5843
- modelValue: props.modelValue
5844
- })) ?? props.modelValue.toFixed(step.value ? decimals.value : 1)])])]), [[vue.vShow, thumbLabel.value && props.focused || thumbLabel.value === "always"]])];
5845
- }
5846
- })]);
5847
- });
5848
- return {};
5849
- }
5850
- });
5851
- const makeVSliderTrackProps = propsFactory({
5852
- start: {
5853
- type: Number,
5854
- required: true
5855
- },
5856
- stop: {
5857
- type: Number,
5858
- required: true
5859
- },
5860
- ...makeComponentProps()
5861
- }, "VSliderTrack");
5862
- const VSliderTrack = genericComponent()({
5863
- name: "VSliderTrack",
5864
- props: makeVSliderTrackProps(),
5865
- emits: {},
5866
- setup(props, _ref) {
5867
- let {
5868
- slots
5869
- } = _ref;
5870
- const slider = vue.inject(VSliderSymbol);
5871
- if (!slider)
5872
- throw new Error("[Vuetify] v-slider-track must be inside v-slider or v-range-slider");
5873
- const {
5874
- color,
5875
- parsedTicks,
5876
- rounded,
5877
- showTicks,
5878
- tickSize,
5879
- trackColor,
5880
- trackFillColor,
5881
- trackSize,
5882
- vertical,
5883
- min,
5884
- max,
5885
- indexFromEnd
5886
- } = slider;
5887
- const {
5888
- roundedClasses
5889
- } = useRounded(rounded);
5890
- const {
5891
- backgroundColorClasses: trackFillColorClasses,
5892
- backgroundColorStyles: trackFillColorStyles
5893
- } = useBackgroundColor(trackFillColor);
5894
- const {
5895
- backgroundColorClasses: trackColorClasses,
5896
- backgroundColorStyles: trackColorStyles
5897
- } = useBackgroundColor(trackColor);
5898
- const startDir = vue.computed(() => `inset-${vertical.value ? "block" : "inline"}-${indexFromEnd.value ? "end" : "start"}`);
5899
- const endDir = vue.computed(() => vertical.value ? "height" : "width");
5900
- const backgroundStyles = vue.computed(() => {
5901
- return {
5902
- [startDir.value]: "0%",
5903
- [endDir.value]: "100%"
5904
- };
5905
- });
5906
- const trackFillWidth = vue.computed(() => props.stop - props.start);
5907
- const trackFillStyles = vue.computed(() => {
5908
- return {
5909
- [startDir.value]: convertToUnit(props.start, "%"),
5910
- [endDir.value]: convertToUnit(trackFillWidth.value, "%")
5911
- };
5912
- });
5913
- const computedTicks = vue.computed(() => {
5914
- if (!showTicks.value)
5915
- return [];
5916
- const ticks = vertical.value ? parsedTicks.value.slice().reverse() : parsedTicks.value;
5917
- return ticks.map((tick, index) => {
5918
- var _a;
5919
- const directionValue = tick.value !== min.value && tick.value !== max.value ? convertToUnit(tick.position, "%") : void 0;
5920
- return vue.createVNode("div", {
5921
- "key": tick.value,
5922
- "class": ["v-slider-track__tick", {
5923
- "v-slider-track__tick--filled": tick.position >= props.start && tick.position <= props.stop,
5924
- "v-slider-track__tick--first": tick.value === min.value,
5925
- "v-slider-track__tick--last": tick.value === max.value
5926
- }],
5927
- "style": {
5928
- [startDir.value]: directionValue
5929
- }
5930
- }, [(tick.label || slots["tick-label"]) && vue.createVNode("div", {
5931
- "class": "v-slider-track__tick-label"
5932
- }, [((_a = slots["tick-label"]) == null ? void 0 : _a.call(slots, {
5933
- tick,
5934
- index
5935
- })) ?? tick.label])]);
5936
- });
5937
- });
5938
- useRender(() => {
5939
- return vue.createVNode("div", {
5940
- "class": ["v-slider-track", roundedClasses.value, props.class],
5941
- "style": [{
5942
- "--v-slider-track-size": convertToUnit(trackSize.value),
5943
- "--v-slider-tick-size": convertToUnit(tickSize.value)
5944
- }, props.style]
5945
- }, [vue.createVNode("div", {
5946
- "class": ["v-slider-track__background", trackColorClasses.value, {
5947
- "v-slider-track__background--opacity": !!color.value || !trackFillColor.value
5948
- }],
5949
- "style": {
5950
- ...backgroundStyles.value,
5951
- ...trackColorStyles.value
5952
- }
5953
- }, null), vue.createVNode("div", {
5954
- "class": ["v-slider-track__fill", trackFillColorClasses.value],
5955
- "style": {
5956
- ...trackFillStyles.value,
5957
- ...trackFillColorStyles.value
5958
- }
5959
- }, null), showTicks.value && vue.createVNode("div", {
5960
- "class": ["v-slider-track__ticks", {
5961
- "v-slider-track__ticks--always-show": showTicks.value === "always"
5962
- }]
5963
- }, [computedTicks.value])]);
5964
- });
5965
- return {};
5966
- }
5967
- });
5968
- const makeVSliderProps = propsFactory({
5969
- ...makeFocusProps(),
5970
- ...makeSliderProps(),
5971
- ...makeVInputProps(),
5972
- modelValue: {
5973
- type: [Number, String],
5974
- default: 0
5975
- }
5976
- }, "VSlider");
5977
- const VSlider = genericComponent()({
5978
- name: "VSlider",
5979
- props: makeVSliderProps(),
5980
- emits: {
5981
- "update:focused": (value) => true,
5982
- "update:modelValue": (v) => true,
5983
- start: (value) => true,
5984
- end: (value) => true
5985
- },
5986
- setup(props, _ref) {
5987
- let {
5988
- slots,
5989
- emit
5990
- } = _ref;
5991
- const thumbContainerRef = vue.ref();
5992
- const {
5993
- rtlClasses
5994
- } = useRtl();
5995
- const steps = useSteps(props);
5996
- const model = useProxiedModel(props, "modelValue", void 0, (value) => {
5997
- return steps.roundValue(value == null ? steps.min.value : value);
5998
- });
5999
- const {
6000
- min,
6001
- max,
6002
- mousePressed,
6003
- roundValue,
6004
- onSliderMousedown,
6005
- onSliderTouchstart,
6006
- trackContainerRef,
6007
- position,
6008
- hasLabels,
6009
- readonly
6010
- } = useSlider({
6011
- props,
6012
- steps,
6013
- onSliderStart: () => {
6014
- emit("start", model.value);
6015
- },
6016
- onSliderEnd: (_ref2) => {
6017
- let {
6018
- value
6019
- } = _ref2;
6020
- const roundedValue = roundValue(value);
6021
- model.value = roundedValue;
6022
- emit("end", roundedValue);
6023
- },
6024
- onSliderMove: (_ref3) => {
6025
- let {
6026
- value
6027
- } = _ref3;
6028
- return model.value = roundValue(value);
6029
- },
6030
- getActiveThumb: () => {
6031
- var _a;
6032
- return (_a = thumbContainerRef.value) == null ? void 0 : _a.$el;
6033
- }
6034
- });
6035
- const {
6036
- isFocused,
6037
- focus,
6038
- blur
6039
- } = useFocus(props);
6040
- const trackStop = vue.computed(() => position(model.value));
6041
- useRender(() => {
6042
- const inputProps = VInput.filterProps(props);
6043
- const hasPrepend = !!(props.label || slots.label || slots.prepend);
6044
- return vue.createVNode(VInput, vue.mergeProps({
6045
- "class": ["v-slider", {
6046
- "v-slider--has-labels": !!slots["tick-label"] || hasLabels.value,
6047
- "v-slider--focused": isFocused.value,
6048
- "v-slider--pressed": mousePressed.value,
6049
- "v-slider--disabled": props.disabled
6050
- }, rtlClasses.value, props.class],
6051
- "style": props.style
6052
- }, inputProps, {
6053
- "focused": isFocused.value
6054
- }), {
6055
- ...slots,
6056
- prepend: hasPrepend ? (slotProps) => {
6057
- var _a, _b;
6058
- return vue.createVNode(vue.Fragment, null, [((_a = slots.label) == null ? void 0 : _a.call(slots, slotProps)) ?? (props.label ? vue.createVNode(VLabel, {
6059
- "id": slotProps.id.value,
6060
- "class": "v-slider__label",
6061
- "text": props.label
6062
- }, null) : void 0), (_b = slots.prepend) == null ? void 0 : _b.call(slots, slotProps)]);
6063
- } : void 0,
6064
- default: (_ref4) => {
6065
- let {
6066
- id,
6067
- messagesId
6068
- } = _ref4;
6069
- return vue.createVNode("div", {
6070
- "class": "v-slider__container",
6071
- "onMousedown": !readonly.value ? onSliderMousedown : void 0,
6072
- "onTouchstartPassive": !readonly.value ? onSliderTouchstart : void 0
6073
- }, [vue.createVNode("input", {
6074
- "id": id.value,
6075
- "name": props.name || id.value,
6076
- "disabled": !!props.disabled,
6077
- "readonly": !!props.readonly,
6078
- "tabindex": "-1",
6079
- "value": model.value
6080
- }, null), vue.createVNode(VSliderTrack, {
6081
- "ref": trackContainerRef,
6082
- "start": 0,
6083
- "stop": trackStop.value
6084
- }, {
6085
- "tick-label": slots["tick-label"]
6086
- }), vue.createVNode(VSliderThumb, {
6087
- "ref": thumbContainerRef,
6088
- "aria-describedby": messagesId.value,
6089
- "focused": isFocused.value,
6090
- "min": min.value,
6091
- "max": max.value,
6092
- "modelValue": model.value,
6093
- "onUpdate:modelValue": (v) => model.value = v,
6094
- "position": trackStop.value,
6095
- "elevation": props.elevation,
6096
- "onFocus": focus,
6097
- "onBlur": blur,
6098
- "ripple": props.ripple
6099
- }, {
6100
- "thumb-label": slots["thumb-label"]
6101
- })]);
6102
- }
6103
- });
6104
- });
6105
- return {};
6106
- }
6107
- });
6108
- const makeVCounterProps = propsFactory({
6109
- active: Boolean,
6110
- max: [Number, String],
6111
- value: {
6112
- type: [Number, String],
6113
- default: 0
6114
- },
6115
- ...makeComponentProps(),
6116
- ...makeTransitionProps({
6117
- transition: {
6118
- component: VSlideYTransition
6119
- }
6120
- })
6121
- }, "VCounter");
6122
- const VCounter = genericComponent()({
6123
- name: "VCounter",
6124
- functional: true,
6125
- props: makeVCounterProps(),
6126
- setup(props, _ref) {
6127
- let {
6128
- slots
6129
- } = _ref;
6130
- const counter = vue.computed(() => {
6131
- return props.max ? `${props.value} / ${props.max}` : String(props.value);
6132
- });
6133
- useRender(() => vue.createVNode(MaybeTransition, {
6134
- "transition": props.transition
6135
- }, {
6136
- default: () => [vue.withDirectives(vue.createVNode("div", {
6137
- "class": ["v-counter", props.class],
6138
- "style": props.style
6139
- }, [slots.default ? slots.default({
6140
- counter: counter.value,
6141
- max: props.max,
6142
- value: props.value
6143
- }) : counter.value]), [[vue.vShow, props.active]])]
6144
- }));
6145
- return {};
6146
- }
6147
- });
6148
- const makeVFieldLabelProps = propsFactory({
6149
- floating: Boolean,
6150
- ...makeComponentProps()
6151
- }, "VFieldLabel");
6152
- const VFieldLabel = genericComponent()({
6153
- name: "VFieldLabel",
6154
- props: makeVFieldLabelProps(),
6155
- setup(props, _ref) {
6156
- let {
6157
- slots
6158
- } = _ref;
6159
- useRender(() => vue.createVNode(VLabel, {
6160
- "class": ["v-field-label", {
6161
- "v-field-label--floating": props.floating
6162
- }, props.class],
6163
- "style": props.style,
6164
- "aria-hidden": props.floating || void 0
6165
- }, slots));
6166
- return {};
6167
- }
6168
- });
6169
- function useIntersectionObserver(callback, options) {
6170
- const intersectionRef = vue.ref();
6171
- const isIntersecting = vue.shallowRef(false);
6172
- if (SUPPORTS_INTERSECTION) {
6173
- const observer = new IntersectionObserver((entries) => {
6174
- callback == null ? void 0 : callback(entries, observer);
6175
- isIntersecting.value = !!entries.find((entry) => entry.isIntersecting);
6176
- }, options);
6177
- vue.onBeforeUnmount(() => {
6178
- observer.disconnect();
6179
- });
6180
- vue.watch(intersectionRef, (newValue, oldValue) => {
6181
- if (oldValue) {
6182
- observer.unobserve(oldValue);
6183
- isIntersecting.value = false;
6184
- }
6185
- if (newValue)
6186
- observer.observe(newValue);
6187
- }, {
6188
- flush: "post"
6189
- });
6190
- }
6191
- return {
6192
- intersectionRef,
6193
- isIntersecting
6194
- };
6195
- }
6196
- const oppositeMap = {
6197
- center: "center",
6198
- top: "bottom",
6199
- bottom: "top",
6200
- left: "right",
6201
- right: "left"
6202
- };
6203
- const makeLocationProps = propsFactory({
6204
- location: String
6205
- }, "location");
6206
- function useLocation(props) {
6207
- let opposite = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false;
6208
- let offset = arguments.length > 2 ? arguments[2] : void 0;
6209
- const {
6210
- isRtl
6211
- } = useRtl();
6212
- const locationStyles = vue.computed(() => {
6213
- if (!props.location)
6214
- return {};
6215
- const {
6216
- side,
6217
- align
6218
- } = parseAnchor(props.location.split(" ").length > 1 ? props.location : `${props.location} center`, isRtl.value);
6219
- function getOffset2(side2) {
6220
- return offset ? offset(side2) : 0;
6221
- }
6222
- const styles2 = {};
6223
- if (side !== "center") {
6224
- if (opposite)
6225
- styles2[oppositeMap[side]] = `calc(100% - ${getOffset2(side)}px)`;
6226
- else
6227
- styles2[side] = 0;
6228
- }
6229
- if (align !== "center") {
6230
- if (opposite)
6231
- styles2[oppositeMap[align]] = `calc(100% - ${getOffset2(align)}px)`;
6232
- else
6233
- styles2[align] = 0;
6234
- } else {
6235
- if (side === "center")
6236
- styles2.top = styles2.left = "50%";
6237
- else {
6238
- styles2[{
6239
- top: "left",
6240
- bottom: "left",
6241
- left: "top",
6242
- right: "top"
6243
- }[side]] = "50%";
6244
- }
6245
- styles2.transform = {
6246
- top: "translateX(-50%)",
6247
- bottom: "translateX(-50%)",
6248
- left: "translateY(-50%)",
6249
- right: "translateY(-50%)",
6250
- center: "translate(-50%, -50%)"
6251
- }[side];
6252
- }
6253
- return styles2;
6254
- });
6255
- return {
6256
- locationStyles
6257
- };
6258
- }
6259
- const makeVProgressLinearProps = propsFactory({
6260
- absolute: Boolean,
6261
- active: {
6262
- type: Boolean,
6263
- default: true
6264
- },
6265
- bgColor: String,
6266
- bgOpacity: [Number, String],
6267
- bufferValue: {
6268
- type: [Number, String],
6269
- default: 0
6270
- },
6271
- clickable: Boolean,
6272
- color: String,
6273
- height: {
6274
- type: [Number, String],
6275
- default: 4
6276
- },
6277
- indeterminate: Boolean,
6278
- max: {
6279
- type: [Number, String],
6280
- default: 100
6281
- },
6282
- modelValue: {
6283
- type: [Number, String],
6284
- default: 0
6285
- },
6286
- reverse: Boolean,
6287
- stream: Boolean,
6288
- striped: Boolean,
6289
- roundedBar: Boolean,
6290
- ...makeComponentProps(),
6291
- ...makeLocationProps({
6292
- location: "top"
6293
- }),
6294
- ...makeRoundedProps(),
6295
- ...makeTagProps(),
6296
- ...makeThemeProps()
6297
- }, "VProgressLinear");
6298
- const VProgressLinear = genericComponent()({
6299
- name: "VProgressLinear",
6300
- props: makeVProgressLinearProps(),
6301
- emits: {
6302
- "update:modelValue": (value) => true
6303
- },
6304
- setup(props, _ref) {
6305
- let {
6306
- slots
6307
- } = _ref;
6308
- const progress = useProxiedModel(props, "modelValue");
6309
- const {
6310
- isRtl,
6311
- rtlClasses
6312
- } = useRtl();
6313
- const {
6314
- themeClasses
6315
- } = provideTheme(props);
6316
- const {
6317
- locationStyles
6318
- } = useLocation(props);
6319
- const {
6320
- textColorClasses,
6321
- textColorStyles
6322
- } = useTextColor(props, "color");
6323
- const {
6324
- backgroundColorClasses,
6325
- backgroundColorStyles
6326
- } = useBackgroundColor(vue.computed(() => props.bgColor || props.color));
6327
- const {
6328
- backgroundColorClasses: barColorClasses,
6329
- backgroundColorStyles: barColorStyles
6330
- } = useBackgroundColor(props, "color");
6331
- const {
6332
- roundedClasses
6333
- } = useRounded(props);
6334
- const {
6335
- intersectionRef,
6336
- isIntersecting
6337
- } = useIntersectionObserver();
6338
- const max = vue.computed(() => parseInt(props.max, 10));
6339
- const height = vue.computed(() => parseInt(props.height, 10));
6340
- const normalizedBuffer = vue.computed(() => parseFloat(props.bufferValue) / max.value * 100);
6341
- const normalizedValue = vue.computed(() => parseFloat(progress.value) / max.value * 100);
6342
- const isReversed = vue.computed(() => isRtl.value !== props.reverse);
6343
- const transition = vue.computed(() => props.indeterminate ? "fade-transition" : "slide-x-transition");
6344
- const opacity = vue.computed(() => {
6345
- return props.bgOpacity == null ? props.bgOpacity : parseFloat(props.bgOpacity);
6346
- });
6347
- function handleClick(e) {
6348
- if (!intersectionRef.value)
6349
- return;
6350
- const {
6351
- left,
6352
- right,
6353
- width
6354
- } = intersectionRef.value.getBoundingClientRect();
6355
- const value = isReversed.value ? width - e.clientX + (right - width) : e.clientX - left;
6356
- progress.value = Math.round(value / width * max.value);
6357
- }
6358
- useRender(() => vue.createVNode(props.tag, {
6359
- "ref": intersectionRef,
6360
- "class": ["v-progress-linear", {
6361
- "v-progress-linear--absolute": props.absolute,
6362
- "v-progress-linear--active": props.active && isIntersecting.value,
6363
- "v-progress-linear--reverse": isReversed.value,
6364
- "v-progress-linear--rounded": props.rounded,
6365
- "v-progress-linear--rounded-bar": props.roundedBar,
6366
- "v-progress-linear--striped": props.striped
6367
- }, roundedClasses.value, themeClasses.value, rtlClasses.value, props.class],
6368
- "style": [{
6369
- bottom: props.location === "bottom" ? 0 : void 0,
6370
- top: props.location === "top" ? 0 : void 0,
6371
- height: props.active ? convertToUnit(height.value) : 0,
6372
- "--v-progress-linear-height": convertToUnit(height.value),
6373
- ...locationStyles.value
6374
- }, props.style],
6375
- "role": "progressbar",
6376
- "aria-hidden": props.active ? "false" : "true",
6377
- "aria-valuemin": "0",
6378
- "aria-valuemax": props.max,
6379
- "aria-valuenow": props.indeterminate ? void 0 : normalizedValue.value,
6380
- "onClick": props.clickable && handleClick
6381
- }, {
6382
- default: () => [props.stream && vue.createVNode("div", {
6383
- "key": "stream",
6384
- "class": ["v-progress-linear__stream", textColorClasses.value],
6385
- "style": {
6386
- ...textColorStyles.value,
6387
- [isReversed.value ? "left" : "right"]: convertToUnit(-height.value),
6388
- borderTop: `${convertToUnit(height.value / 2)} dotted`,
6389
- opacity: opacity.value,
6390
- top: `calc(50% - ${convertToUnit(height.value / 4)})`,
6391
- width: convertToUnit(100 - normalizedBuffer.value, "%"),
6392
- "--v-progress-linear-stream-to": convertToUnit(height.value * (isReversed.value ? 1 : -1))
6393
- }
6394
- }, null), vue.createVNode("div", {
6395
- "class": ["v-progress-linear__background", backgroundColorClasses.value],
6396
- "style": [backgroundColorStyles.value, {
6397
- opacity: opacity.value,
6398
- width: convertToUnit(!props.stream ? 100 : normalizedBuffer.value, "%")
6399
- }]
6400
- }, null), vue.createVNode(vue.Transition, {
6401
- "name": transition.value
6402
- }, {
6403
- default: () => [!props.indeterminate ? vue.createVNode("div", {
6404
- "class": ["v-progress-linear__determinate", barColorClasses.value],
6405
- "style": [barColorStyles.value, {
6406
- width: convertToUnit(normalizedValue.value, "%")
6407
- }]
6408
- }, null) : vue.createVNode("div", {
6409
- "class": "v-progress-linear__indeterminate"
6410
- }, [["long", "short"].map((bar) => vue.createVNode("div", {
6411
- "key": bar,
6412
- "class": ["v-progress-linear__indeterminate", bar, barColorClasses.value],
6413
- "style": barColorStyles.value
6414
- }, null))])]
6415
- }), slots.default && vue.createVNode("div", {
6416
- "class": "v-progress-linear__content"
6417
- }, [slots.default({
6418
- value: normalizedValue.value,
6419
- buffer: normalizedBuffer.value
6420
- })])]
6421
- }));
6422
- return {};
6423
- }
6424
- });
6425
- const makeLoaderProps = propsFactory({
6426
- loading: [Boolean, String]
6427
- }, "loader");
6428
- function useLoader(props) {
6429
- let name = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : getCurrentInstanceName();
6430
- const loaderClasses = vue.computed(() => ({
6431
- [`${name}--loading`]: props.loading
6432
- }));
6433
- return {
6434
- loaderClasses
6435
- };
6436
- }
6437
- function LoaderSlot(props, _ref) {
6438
- var _a;
6439
- let {
6440
- slots
6441
- } = _ref;
6442
- return vue.createVNode("div", {
6443
- "class": `${props.name}__loader`
6444
- }, [((_a = slots.default) == null ? void 0 : _a.call(slots, {
6445
- color: props.color,
6446
- isActive: props.active
6447
- })) || vue.createVNode(VProgressLinear, {
6448
- "absolute": props.absolute,
6449
- "active": props.active,
6450
- "color": props.color,
6451
- "height": "2",
6452
- "indeterminate": true
6453
- }, null)]);
6454
- }
6455
- const allowedVariants = ["underlined", "outlined", "filled", "solo", "solo-inverted", "solo-filled", "plain"];
6456
- const makeVFieldProps = propsFactory({
6457
- appendInnerIcon: IconValue,
6458
- bgColor: String,
6459
- clearable: Boolean,
6460
- clearIcon: {
6461
- type: IconValue,
6462
- default: "$clear"
6463
- },
6464
- active: Boolean,
6465
- centerAffix: {
6466
- type: Boolean,
6467
- default: void 0
6468
- },
6469
- color: String,
6470
- baseColor: String,
6471
- dirty: Boolean,
6472
- disabled: {
6473
- type: Boolean,
6474
- default: null
6475
- },
6476
- error: Boolean,
6477
- flat: Boolean,
6478
- label: String,
6479
- persistentClear: Boolean,
6480
- prependInnerIcon: IconValue,
6481
- reverse: Boolean,
6482
- singleLine: Boolean,
6483
- variant: {
6484
- type: String,
6485
- default: "filled",
6486
- validator: (v) => allowedVariants.includes(v)
6487
- },
6488
- "onClick:clear": EventProp(),
6489
- "onClick:appendInner": EventProp(),
6490
- "onClick:prependInner": EventProp(),
6491
- ...makeComponentProps(),
6492
- ...makeLoaderProps(),
6493
- ...makeRoundedProps(),
6494
- ...makeThemeProps()
6495
- }, "VField");
6496
- const VField = genericComponent()({
6497
- name: "VField",
6498
- inheritAttrs: false,
6499
- props: {
6500
- id: String,
6501
- ...makeFocusProps(),
6502
- ...makeVFieldProps()
6503
- },
6504
- emits: {
6505
- "update:focused": (focused) => true,
6506
- "update:modelValue": (value) => true
6507
- },
6508
- setup(props, _ref) {
6509
- let {
6510
- attrs,
6511
- emit,
6512
- slots
6513
- } = _ref;
6514
- const {
6515
- themeClasses
6516
- } = provideTheme(props);
6517
- const {
6518
- loaderClasses
6519
- } = useLoader(props);
6520
- const {
6521
- focusClasses,
6522
- isFocused,
6523
- focus,
6524
- blur
6525
- } = useFocus(props);
6526
- const {
6527
- InputIcon
6528
- } = useInputIcon(props);
6529
- const {
6530
- roundedClasses
6531
- } = useRounded(props);
6532
- const {
6533
- rtlClasses
6534
- } = useRtl();
6535
- const isActive = vue.computed(() => props.dirty || props.active);
6536
- const hasLabel = vue.computed(() => !props.singleLine && !!(props.label || slots.label));
6537
- const uid = getUid();
6538
- const id = vue.computed(() => props.id || `input-${uid}`);
6539
- const messagesId = vue.computed(() => `${id.value}-messages`);
6540
- const labelRef = vue.ref();
6541
- const floatingLabelRef = vue.ref();
6542
- const controlRef = vue.ref();
6543
- const isPlainOrUnderlined = vue.computed(() => ["plain", "underlined"].includes(props.variant));
6544
- const {
6545
- backgroundColorClasses,
6546
- backgroundColorStyles
6547
- } = useBackgroundColor(vue.toRef(props, "bgColor"));
6548
- const {
6549
- textColorClasses,
6550
- textColorStyles
6551
- } = useTextColor(vue.computed(() => {
6552
- return props.error || props.disabled ? void 0 : isActive.value && isFocused.value ? props.color : props.baseColor;
6553
- }));
6554
- vue.watch(isActive, (val) => {
6555
- if (hasLabel.value) {
6556
- const el = labelRef.value.$el;
6557
- const targetEl = floatingLabelRef.value.$el;
6558
- requestAnimationFrame(() => {
6559
- const rect = nullifyTransforms(el);
6560
- const targetRect = targetEl.getBoundingClientRect();
6561
- const x = targetRect.x - rect.x;
6562
- const y = targetRect.y - rect.y - (rect.height / 2 - targetRect.height / 2);
6563
- const targetWidth = targetRect.width / 0.75;
6564
- const width = Math.abs(targetWidth - rect.width) > 1 ? {
6565
- maxWidth: convertToUnit(targetWidth)
6566
- } : void 0;
6567
- const style = getComputedStyle(el);
6568
- const targetStyle = getComputedStyle(targetEl);
6569
- const duration = parseFloat(style.transitionDuration) * 1e3 || 150;
6570
- const scale = parseFloat(targetStyle.getPropertyValue("--v-field-label-scale"));
6571
- const color = targetStyle.getPropertyValue("color");
6572
- el.style.visibility = "visible";
6573
- targetEl.style.visibility = "hidden";
6574
- animate(el, {
6575
- transform: `translate(${x}px, ${y}px) scale(${scale})`,
6576
- color,
6577
- ...width
6578
- }, {
6579
- duration,
6580
- easing: standardEasing,
6581
- direction: val ? "normal" : "reverse"
6582
- }).finished.then(() => {
6583
- el.style.removeProperty("visibility");
6584
- targetEl.style.removeProperty("visibility");
6585
- });
6586
- });
6587
- }
6588
- }, {
6589
- flush: "post"
6590
- });
6591
- const slotProps = vue.computed(() => ({
6592
- isActive,
6593
- isFocused,
6594
- controlRef,
6595
- blur,
6596
- focus
6597
- }));
6598
- function onClick(e) {
6599
- if (e.target !== document.activeElement) {
6600
- e.preventDefault();
6601
- }
6602
- }
6603
- useRender(() => {
6604
- var _a, _b, _c;
6605
- const isOutlined = props.variant === "outlined";
6606
- const hasPrepend = !!(slots["prepend-inner"] || props.prependInnerIcon);
6607
- const hasClear = !!(props.clearable || slots.clear);
6608
- const hasAppend = !!(slots["append-inner"] || props.appendInnerIcon || hasClear);
6609
- const label = () => slots.label ? slots.label({
6610
- ...slotProps.value,
6611
- label: props.label,
6612
- props: {
6613
- for: id.value
6614
- }
6615
- }) : props.label;
6616
- return vue.createVNode("div", vue.mergeProps({
6617
- "class": ["v-field", {
6618
- "v-field--active": isActive.value,
6619
- "v-field--appended": hasAppend,
6620
- "v-field--center-affix": props.centerAffix ?? !isPlainOrUnderlined.value,
6621
- "v-field--disabled": props.disabled,
6622
- "v-field--dirty": props.dirty,
6623
- "v-field--error": props.error,
6624
- "v-field--flat": props.flat,
6625
- "v-field--has-background": !!props.bgColor,
6626
- "v-field--persistent-clear": props.persistentClear,
6627
- "v-field--prepended": hasPrepend,
6628
- "v-field--reverse": props.reverse,
6629
- "v-field--single-line": props.singleLine,
6630
- "v-field--no-label": !label(),
6631
- [`v-field--variant-${props.variant}`]: true
6632
- }, themeClasses.value, backgroundColorClasses.value, focusClasses.value, loaderClasses.value, roundedClasses.value, rtlClasses.value, props.class],
6633
- "style": [backgroundColorStyles.value, props.style],
6634
- "onClick": onClick
6635
- }, attrs), [vue.createVNode("div", {
6636
- "class": "v-field__overlay"
6637
- }, null), vue.createVNode(LoaderSlot, {
6638
- "name": "v-field",
6639
- "active": !!props.loading,
6640
- "color": props.error ? "error" : typeof props.loading === "string" ? props.loading : props.color
6641
- }, {
6642
- default: slots.loader
6643
- }), hasPrepend && vue.createVNode("div", {
6644
- "key": "prepend",
6645
- "class": "v-field__prepend-inner"
6646
- }, [props.prependInnerIcon && vue.createVNode(InputIcon, {
6647
- "key": "prepend-icon",
6648
- "name": "prependInner"
6649
- }, null), (_a = slots["prepend-inner"]) == null ? void 0 : _a.call(slots, slotProps.value)]), vue.createVNode("div", {
6650
- "class": "v-field__field",
6651
- "data-no-activator": ""
6652
- }, [["filled", "solo", "solo-inverted", "solo-filled"].includes(props.variant) && hasLabel.value && vue.createVNode(VFieldLabel, {
6653
- "key": "floating-label",
6654
- "ref": floatingLabelRef,
6655
- "class": [textColorClasses.value],
6656
- "floating": true,
6657
- "for": id.value,
6658
- "style": textColorStyles.value
6659
- }, {
6660
- default: () => [label()]
6661
- }), vue.createVNode(VFieldLabel, {
6662
- "ref": labelRef,
6663
- "for": id.value
6664
- }, {
6665
- default: () => [label()]
6666
- }), (_b = slots.default) == null ? void 0 : _b.call(slots, {
6667
- ...slotProps.value,
6668
- props: {
6669
- id: id.value,
6670
- class: "v-field__input",
6671
- "aria-describedby": messagesId.value
6672
- },
6673
- focus,
6674
- blur
6675
- })]), hasClear && vue.createVNode(VExpandXTransition, {
6676
- "key": "clear"
6677
- }, {
6678
- default: () => [vue.withDirectives(vue.createVNode("div", {
6679
- "class": "v-field__clearable",
6680
- "onMousedown": (e) => {
6681
- e.preventDefault();
6682
- e.stopPropagation();
6683
- }
6684
- }, [slots.clear ? slots.clear() : vue.createVNode(InputIcon, {
6685
- "name": "clear"
6686
- }, null)]), [[vue.vShow, props.dirty]])]
6687
- }), hasAppend && vue.createVNode("div", {
6688
- "key": "append",
6689
- "class": "v-field__append-inner"
6690
- }, [(_c = slots["append-inner"]) == null ? void 0 : _c.call(slots, slotProps.value), props.appendInnerIcon && vue.createVNode(InputIcon, {
6691
- "key": "append-icon",
6692
- "name": "appendInner"
6693
- }, null)]), vue.createVNode("div", {
6694
- "class": ["v-field__outline", textColorClasses.value],
6695
- "style": textColorStyles.value
6696
- }, [isOutlined && vue.createVNode(vue.Fragment, null, [vue.createVNode("div", {
6697
- "class": "v-field__outline__start"
6698
- }, null), hasLabel.value && vue.createVNode("div", {
6699
- "class": "v-field__outline__notch"
6700
- }, [vue.createVNode(VFieldLabel, {
6701
- "ref": floatingLabelRef,
6702
- "floating": true,
6703
- "for": id.value
6704
- }, {
6705
- default: () => [label()]
6706
- })]), vue.createVNode("div", {
6707
- "class": "v-field__outline__end"
6708
- }, null)]), isPlainOrUnderlined.value && hasLabel.value && vue.createVNode(VFieldLabel, {
6709
- "ref": floatingLabelRef,
6710
- "floating": true,
6711
- "for": id.value
6712
- }, {
6713
- default: () => [label()]
6714
- })])]);
6715
- });
6716
- return {
6717
- controlRef
6718
- };
6719
- }
6720
- });
6721
- function filterFieldProps(attrs) {
6722
- const keys = Object.keys(VField.props).filter((k) => !isOn(k) && k !== "class" && k !== "style");
6723
- return pick(attrs, keys);
6724
- }
6725
- const Refs = Symbol("Forwarded refs");
6726
- function getDescriptor(obj, key) {
6727
- let currentObj = obj;
6728
- while (currentObj) {
6729
- const descriptor = Reflect.getOwnPropertyDescriptor(currentObj, key);
6730
- if (descriptor)
6731
- return descriptor;
6732
- currentObj = Object.getPrototypeOf(currentObj);
6733
- }
6734
- return void 0;
6735
- }
6736
- function forwardRefs(target) {
6737
- for (var _len = arguments.length, refs = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
6738
- refs[_key - 1] = arguments[_key];
6739
- }
6740
- target[Refs] = refs;
6741
- return new Proxy(target, {
6742
- get(target2, key) {
6743
- if (Reflect.has(target2, key)) {
6744
- return Reflect.get(target2, key);
6745
- }
6746
- if (typeof key === "symbol" || key.startsWith("$") || key.startsWith("__"))
6747
- return;
6748
- for (const ref of refs) {
6749
- if (ref.value && Reflect.has(ref.value, key)) {
6750
- const val = Reflect.get(ref.value, key);
6751
- return typeof val === "function" ? val.bind(ref.value) : val;
6752
- }
6753
- }
6754
- },
6755
- has(target2, key) {
6756
- if (Reflect.has(target2, key)) {
6757
- return true;
6758
- }
6759
- if (typeof key === "symbol" || key.startsWith("$") || key.startsWith("__"))
6760
- return false;
6761
- for (const ref of refs) {
6762
- if (ref.value && Reflect.has(ref.value, key)) {
6763
- return true;
6764
- }
6765
- }
6766
- return false;
6767
- },
6768
- set(target2, key, value) {
6769
- if (Reflect.has(target2, key)) {
6770
- return Reflect.set(target2, key, value);
6771
- }
6772
- if (typeof key === "symbol" || key.startsWith("$") || key.startsWith("__"))
6773
- return false;
6774
- for (const ref of refs) {
6775
- if (ref.value && Reflect.has(ref.value, key)) {
6776
- return Reflect.set(ref.value, key, value);
6777
- }
6778
- }
6779
- return false;
6780
- },
6781
- getOwnPropertyDescriptor(target2, key) {
6782
- var _a;
6783
- const descriptor = Reflect.getOwnPropertyDescriptor(target2, key);
6784
- if (descriptor)
6785
- return descriptor;
6786
- if (typeof key === "symbol" || key.startsWith("$") || key.startsWith("__"))
6787
- return;
6788
- for (const ref of refs) {
6789
- if (!ref.value)
6790
- continue;
6791
- const descriptor2 = getDescriptor(ref.value, key) ?? ("_" in ref.value ? getDescriptor((_a = ref.value._) == null ? void 0 : _a.setupState, key) : void 0);
6792
- if (descriptor2)
6793
- return descriptor2;
6794
- }
6795
- for (const ref of refs) {
6796
- const childRefs = ref.value && ref.value[Refs];
6797
- if (!childRefs)
6798
- continue;
6799
- const queue = childRefs.slice();
6800
- while (queue.length) {
6801
- const ref2 = queue.shift();
6802
- const descriptor2 = getDescriptor(ref2.value, key);
6803
- if (descriptor2)
6804
- return descriptor2;
6805
- const childRefs2 = ref2.value && ref2.value[Refs];
6806
- if (childRefs2)
6807
- queue.push(...childRefs2);
6808
- }
6809
- }
6810
- return void 0;
6811
- }
6812
- });
6813
- }
6814
- function mounted(el, binding) {
6815
- if (!SUPPORTS_INTERSECTION)
6816
- return;
6817
- const modifiers = binding.modifiers || {};
6818
- const value = binding.value;
6819
- const {
6820
- handler,
6821
- options
6822
- } = typeof value === "object" ? value : {
6823
- handler: value,
6824
- options: {}
6825
- };
6826
- const observer = new IntersectionObserver(function() {
6827
- var _a;
6828
- let entries = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : [];
6829
- let observer2 = arguments.length > 1 ? arguments[1] : void 0;
6830
- const _observe = (_a = el._observe) == null ? void 0 : _a[binding.instance.$.uid];
6831
- if (!_observe)
6832
- return;
6833
- const isIntersecting = entries.some((entry) => entry.isIntersecting);
6834
- if (handler && (!modifiers.quiet || _observe.init) && (!modifiers.once || isIntersecting || _observe.init)) {
6835
- handler(isIntersecting, entries, observer2);
6836
- }
6837
- if (isIntersecting && modifiers.once)
6838
- unmounted(el, binding);
6839
- else
6840
- _observe.init = true;
6841
- }, options);
6842
- el._observe = Object(el._observe);
6843
- el._observe[binding.instance.$.uid] = {
6844
- init: false,
6845
- observer
6846
- };
6847
- observer.observe(el);
6848
- }
6849
- function unmounted(el, binding) {
6850
- var _a;
6851
- const observe = (_a = el._observe) == null ? void 0 : _a[binding.instance.$.uid];
6852
- if (!observe)
6853
- return;
6854
- observe.observer.unobserve(el);
6855
- delete el._observe[binding.instance.$.uid];
6856
- }
6857
- const Intersect = {
6858
- mounted,
6859
- unmounted
6860
- };
6861
- const Intersect$1 = Intersect;
6862
- const activeTypes = ["color", "file", "time", "date", "datetime-local", "week", "month"];
6863
- const makeVTextFieldProps = propsFactory({
6864
- autofocus: Boolean,
6865
- counter: [Boolean, Number, String],
6866
- counterValue: [Number, Function],
6867
- prefix: String,
6868
- placeholder: String,
6869
- persistentPlaceholder: Boolean,
6870
- persistentCounter: Boolean,
6871
- suffix: String,
6872
- role: String,
6873
- type: {
6874
- type: String,
6875
- default: "text"
6876
- },
6877
- modelModifiers: Object,
6878
- ...makeVInputProps(),
6879
- ...makeVFieldProps()
6880
- }, "VTextField");
6881
- const VTextField = genericComponent()({
6882
- name: "VTextField",
6883
- directives: {
6884
- Intersect: Intersect$1
6885
- },
6886
- inheritAttrs: false,
6887
- props: makeVTextFieldProps(),
6888
- emits: {
6889
- "click:control": (e) => true,
6890
- "mousedown:control": (e) => true,
6891
- "update:focused": (focused) => true,
6892
- "update:modelValue": (val) => true
6893
- },
6894
- setup(props, _ref) {
6895
- let {
6896
- attrs,
6897
- emit,
6898
- slots
6899
- } = _ref;
6900
- const model = useProxiedModel(props, "modelValue");
6901
- const {
6902
- isFocused,
6903
- focus,
6904
- blur
6905
- } = useFocus(props);
6906
- const counterValue = vue.computed(() => {
6907
- return typeof props.counterValue === "function" ? props.counterValue(model.value) : typeof props.counterValue === "number" ? props.counterValue : (model.value ?? "").toString().length;
6908
- });
6909
- const max = vue.computed(() => {
6910
- if (attrs.maxlength)
6911
- return attrs.maxlength;
6912
- if (!props.counter || typeof props.counter !== "number" && typeof props.counter !== "string")
6913
- return void 0;
6914
- return props.counter;
6915
- });
6916
- const isPlainOrUnderlined = vue.computed(() => ["plain", "underlined"].includes(props.variant));
6917
- function onIntersect(isIntersecting, entries) {
6918
- var _a, _b;
6919
- if (!props.autofocus || !isIntersecting)
6920
- return;
6921
- (_b = (_a = entries[0].target) == null ? void 0 : _a.focus) == null ? void 0 : _b.call(_a);
6922
- }
6923
- const vInputRef = vue.ref();
6924
- const vFieldRef = vue.ref();
6925
- const inputRef = vue.ref();
6926
- const isActive = vue.computed(() => activeTypes.includes(props.type) || props.persistentPlaceholder || isFocused.value || props.active);
6927
- function onFocus() {
6928
- var _a;
6929
- if (inputRef.value !== document.activeElement) {
6930
- (_a = inputRef.value) == null ? void 0 : _a.focus();
6931
- }
6932
- if (!isFocused.value)
6933
- focus();
6934
- }
6935
- function onControlMousedown(e) {
6936
- emit("mousedown:control", e);
6937
- if (e.target === inputRef.value)
6938
- return;
6939
- onFocus();
6940
- e.preventDefault();
6941
- }
6942
- function onControlClick(e) {
6943
- onFocus();
6944
- emit("click:control", e);
6945
- }
6946
- function onClear(e) {
6947
- e.stopPropagation();
6948
- onFocus();
6949
- vue.nextTick(() => {
6950
- model.value = null;
6951
- callEvent(props["onClick:clear"], e);
6952
- });
6953
- }
6954
- function onInput(e) {
6955
- var _a;
6956
- const el = e.target;
6957
- model.value = el.value;
6958
- if (((_a = props.modelModifiers) == null ? void 0 : _a.trim) && ["text", "search", "password", "tel", "url"].includes(props.type)) {
6959
- const caretPosition = [el.selectionStart, el.selectionEnd];
6960
- vue.nextTick(() => {
6961
- el.selectionStart = caretPosition[0];
6962
- el.selectionEnd = caretPosition[1];
6963
- });
6964
- }
6965
- }
6966
- useRender(() => {
6967
- const hasCounter = !!(slots.counter || props.counter !== false && props.counter != null);
6968
- const hasDetails = !!(hasCounter || slots.details);
6969
- const [rootAttrs, inputAttrs] = filterInputAttrs(attrs);
6970
- const {
6971
- modelValue: _,
6972
- ...inputProps
6973
- } = VInput.filterProps(props);
6974
- const fieldProps = filterFieldProps(props);
6975
- return vue.createVNode(VInput, vue.mergeProps({
6976
- "ref": vInputRef,
6977
- "modelValue": model.value,
6978
- "onUpdate:modelValue": ($event) => model.value = $event,
6979
- "class": ["v-text-field", {
6980
- "v-text-field--prefixed": props.prefix,
6981
- "v-text-field--suffixed": props.suffix,
6982
- "v-input--plain-underlined": isPlainOrUnderlined.value
6983
- }, props.class],
6984
- "style": props.style
6985
- }, rootAttrs, inputProps, {
6986
- "centerAffix": !isPlainOrUnderlined.value,
6987
- "focused": isFocused.value
6988
- }), {
6989
- ...slots,
6990
- default: (_ref2) => {
6991
- let {
6992
- id,
6993
- isDisabled,
6994
- isDirty,
6995
- isReadonly,
6996
- isValid
6997
- } = _ref2;
6998
- return vue.createVNode(VField, vue.mergeProps({
6999
- "ref": vFieldRef,
7000
- "onMousedown": onControlMousedown,
7001
- "onClick": onControlClick,
7002
- "onClick:clear": onClear,
7003
- "onClick:prependInner": props["onClick:prependInner"],
7004
- "onClick:appendInner": props["onClick:appendInner"],
7005
- "role": props.role
7006
- }, fieldProps, {
7007
- "id": id.value,
7008
- "active": isActive.value || isDirty.value,
7009
- "dirty": isDirty.value || props.dirty,
7010
- "disabled": isDisabled.value,
7011
- "focused": isFocused.value,
7012
- "error": isValid.value === false
7013
- }), {
7014
- ...slots,
7015
- default: (_ref3) => {
7016
- let {
7017
- props: {
7018
- class: fieldClass,
7019
- ...slotProps
7020
- }
7021
- } = _ref3;
7022
- const inputNode = vue.withDirectives(vue.createVNode("input", vue.mergeProps({
7023
- "ref": inputRef,
7024
- "value": model.value,
7025
- "onInput": onInput,
7026
- "autofocus": props.autofocus,
7027
- "readonly": isReadonly.value,
7028
- "disabled": isDisabled.value,
7029
- "name": props.name,
7030
- "placeholder": props.placeholder,
7031
- "size": 1,
7032
- "type": props.type,
7033
- "onFocus": onFocus,
7034
- "onBlur": blur
7035
- }, slotProps, inputAttrs), null), [[vue.resolveDirective("intersect"), {
7036
- handler: onIntersect
7037
- }, null, {
7038
- once: true
7039
- }]]);
7040
- return vue.createVNode(vue.Fragment, null, [props.prefix && vue.createVNode("span", {
7041
- "class": "v-text-field__prefix"
7042
- }, [vue.createVNode("span", {
7043
- "class": "v-text-field__prefix__text"
7044
- }, [props.prefix])]), slots.default ? vue.createVNode("div", {
7045
- "class": fieldClass,
7046
- "data-no-activator": ""
7047
- }, [slots.default(), inputNode]) : vue.cloneVNode(inputNode, {
7048
- class: fieldClass
7049
- }), props.suffix && vue.createVNode("span", {
7050
- "class": "v-text-field__suffix"
7051
- }, [vue.createVNode("span", {
7052
- "class": "v-text-field__suffix__text"
7053
- }, [props.suffix])])]);
7054
- }
7055
- });
7056
- },
7057
- details: hasDetails ? (slotProps) => {
7058
- var _a;
7059
- return vue.createVNode(vue.Fragment, null, [(_a = slots.details) == null ? void 0 : _a.call(slots, slotProps), hasCounter && vue.createVNode(vue.Fragment, null, [vue.createVNode("span", null, null), vue.createVNode(VCounter, {
7060
- "active": props.persistentCounter || isFocused.value,
7061
- "value": counterValue.value,
7062
- "max": max.value
7063
- }, slots.counter)])]);
7064
- } : void 0
7065
- });
7066
- });
7067
- return forwardRefs({}, vInputRef, vFieldRef, inputRef);
7068
- }
7069
- });
7070
2469
  const _hoisted_1 = /* @__PURE__ */ vue.createElementVNode("div", null, " UXTestForm ", -1);
7071
2470
  const _hoisted_2 = { class: "text-wrap" };
7072
2471
  const _hoisted_3 = { class: "ml-0 text-caption" };
@@ -7127,21 +2526,30 @@ Expected #hex, #hexa, rgb(), rgba(), hsl(), hsla(), object or number`);
7127
2526
  }
7128
2527
  ]);
7129
2528
  return (_ctx, _cache) => {
7130
- return vue.openBlock(), vue.createBlock(VContainer, { class: "yellowgreen" }, {
2529
+ const _component_v_divider = vue.resolveComponent("v-divider");
2530
+ const _component_v_row = vue.resolveComponent("v-row");
2531
+ const _component_v_col = vue.resolveComponent("v-col");
2532
+ const _component_v_radio = vue.resolveComponent("v-radio");
2533
+ const _component_v_radio_group = vue.resolveComponent("v-radio-group");
2534
+ const _component_v_text_field = vue.resolveComponent("v-text-field");
2535
+ const _component_v_checkbox = vue.resolveComponent("v-checkbox");
2536
+ const _component_v_slider = vue.resolveComponent("v-slider");
2537
+ const _component_v_container = vue.resolveComponent("v-container");
2538
+ return vue.openBlock(), vue.createBlock(_component_v_container, { class: "yellowgreen" }, {
7131
2539
  default: vue.withCtx(() => [
7132
- vue.createVNode(VRow, null, {
2540
+ vue.createVNode(_component_v_row, null, {
7133
2541
  default: vue.withCtx(() => [
7134
2542
  _hoisted_1,
7135
- vue.createVNode(VDivider)
2543
+ vue.createVNode(_component_v_divider)
7136
2544
  ]),
7137
2545
  _: 1
7138
2546
  }),
7139
- _ctx.showFormValues ? (vue.openBlock(), vue.createBlock(VRow, { key: 0 }, {
2547
+ _ctx.showFormValues ? (vue.openBlock(), vue.createBlock(_component_v_row, { key: 0 }, {
7140
2548
  default: vue.withCtx(() => [
7141
- vue.createVNode(VCol, { cols: "12" }, {
2549
+ vue.createVNode(_component_v_col, { cols: "12" }, {
7142
2550
  default: vue.withCtx(() => [
7143
2551
  (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(formData.value, (formDataElement, index) => {
7144
- return vue.openBlock(), vue.createBlock(VRow, {
2552
+ return vue.openBlock(), vue.createBlock(_component_v_row, {
7145
2553
  key: index,
7146
2554
  class: "ml-1 text-caption"
7147
2555
  }, {
@@ -7157,39 +2565,39 @@ Expected #hex, #hexa, rgb(), rgba(), hsl(), hsla(), object or number`);
7157
2565
  ]),
7158
2566
  _: 1
7159
2567
  })) : vue.createCommentVNode("", true),
7160
- vue.createVNode(VRow, null, {
2568
+ vue.createVNode(_component_v_row, null, {
7161
2569
  default: vue.withCtx(() => [
7162
- vue.createVNode(VDivider)
2570
+ vue.createVNode(_component_v_divider)
7163
2571
  ]),
7164
2572
  _: 1
7165
2573
  }),
7166
2574
  (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(formData.value, (formDataElement, index) => {
7167
- return vue.openBlock(), vue.createBlock(VRow, { key: index }, {
2575
+ return vue.openBlock(), vue.createBlock(_component_v_row, { key: index }, {
7168
2576
  default: vue.withCtx(() => [
7169
- formDataElement.elementType.localeCompare("divider") === 0 ? (vue.openBlock(), vue.createBlock(VCol, {
2577
+ formDataElement.elementType.localeCompare("divider") === 0 ? (vue.openBlock(), vue.createBlock(_component_v_col, {
7170
2578
  key: 0,
7171
2579
  cols: "12",
7172
2580
  class: "ma-0 pa-0"
7173
2581
  }, {
7174
2582
  default: vue.withCtx(() => [
7175
- vue.createVNode(VDivider)
2583
+ vue.createVNode(_component_v_divider)
7176
2584
  ]),
7177
2585
  _: 1
7178
2586
  })) : vue.createCommentVNode("", true),
7179
- formDataElement.elementType.localeCompare("radio") === 0 ? (vue.openBlock(), vue.createBlock(VCol, {
2587
+ formDataElement.elementType.localeCompare("radio") === 0 ? (vue.openBlock(), vue.createBlock(_component_v_col, {
7180
2588
  key: 1,
7181
2589
  cols: "12",
7182
2590
  class: "ma-0 pa-0"
7183
2591
  }, {
7184
2592
  default: vue.withCtx(() => [
7185
- vue.createVNode(VRadioGroup, {
2593
+ vue.createVNode(_component_v_radio_group, {
7186
2594
  modelValue: formDataElement.model,
7187
2595
  "onUpdate:modelValue": ($event) => formDataElement.model = $event,
7188
2596
  "hide-details": true
7189
2597
  }, {
7190
2598
  default: vue.withCtx(() => [
7191
2599
  (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(formDataElement.radioGroup, (n) => {
7192
- return vue.openBlock(), vue.createBlock(VRadio, {
2600
+ return vue.openBlock(), vue.createBlock(_component_v_radio, {
7193
2601
  key: n.key,
7194
2602
  label: `${n.label}`,
7195
2603
  value: n.value
@@ -7201,13 +2609,13 @@ Expected #hex, #hexa, rgb(), rgba(), hsl(), hsla(), object or number`);
7201
2609
  ]),
7202
2610
  _: 2
7203
2611
  }, 1024)) : vue.createCommentVNode("", true),
7204
- formDataElement.elementType.localeCompare("textField") === 0 ? (vue.openBlock(), vue.createBlock(VCol, {
2612
+ formDataElement.elementType.localeCompare("textField") === 0 ? (vue.openBlock(), vue.createBlock(_component_v_col, {
7205
2613
  key: 2,
7206
2614
  cols: "12",
7207
2615
  class: "ma-0 pa-0"
7208
2616
  }, {
7209
2617
  default: vue.withCtx(() => [
7210
- vue.createVNode(VTextField, {
2618
+ vue.createVNode(_component_v_text_field, {
7211
2619
  modelValue: formDataElement.model,
7212
2620
  "onUpdate:modelValue": ($event) => formDataElement.model = $event,
7213
2621
  label: formDataElement.label,
@@ -7218,13 +2626,13 @@ Expected #hex, #hexa, rgb(), rgba(), hsl(), hsla(), object or number`);
7218
2626
  ]),
7219
2627
  _: 2
7220
2628
  }, 1024)) : vue.createCommentVNode("", true),
7221
- formDataElement.elementType.localeCompare("checkbox") === 0 ? (vue.openBlock(), vue.createBlock(VCol, {
2629
+ formDataElement.elementType.localeCompare("checkbox") === 0 ? (vue.openBlock(), vue.createBlock(_component_v_col, {
7222
2630
  key: 3,
7223
2631
  cols: "12",
7224
2632
  class: "ma-0 pa-0"
7225
2633
  }, {
7226
2634
  default: vue.withCtx(() => [
7227
- vue.createVNode(VCheckbox, {
2635
+ vue.createVNode(_component_v_checkbox, {
7228
2636
  modelValue: formDataElement.model,
7229
2637
  "onUpdate:modelValue": ($event) => formDataElement.model = $event,
7230
2638
  "hide-details": true
@@ -7237,7 +2645,7 @@ Expected #hex, #hexa, rgb(), rgba(), hsl(), hsla(), object or number`);
7237
2645
  ]),
7238
2646
  _: 2
7239
2647
  }, 1024)) : vue.createCommentVNode("", true),
7240
- formDataElement.elementType.localeCompare("slider") === 0 ? (vue.openBlock(), vue.createBlock(VCol, {
2648
+ formDataElement.elementType.localeCompare("slider") === 0 ? (vue.openBlock(), vue.createBlock(_component_v_col, {
7241
2649
  key: 4,
7242
2650
  cols: "12",
7243
2651
  class: "mx-3",
@@ -7245,7 +2653,7 @@ Expected #hex, #hexa, rgb(), rgba(), hsl(), hsla(), object or number`);
7245
2653
  }, {
7246
2654
  default: vue.withCtx(() => [
7247
2655
  vue.createElementVNode("div", _hoisted_3, vue.toDisplayString(formDataElement.description), 1),
7248
- vue.createVNode(VSlider, {
2656
+ vue.createVNode(_component_v_slider, {
7249
2657
  modelValue: formDataElement.model,
7250
2658
  "onUpdate:modelValue": ($event) => formDataElement.model = $event,
7251
2659
  class: "align-center",
@@ -7257,7 +2665,7 @@ Expected #hex, #hexa, rgb(), rgba(), hsl(), hsla(), object or number`);
7257
2665
  "hide-details": ""
7258
2666
  }, {
7259
2667
  append: vue.withCtx(() => [
7260
- vue.createVNode(VTextField, {
2668
+ vue.createVNode(_component_v_text_field, {
7261
2669
  modelValue: formDataElement.model,
7262
2670
  "onUpdate:modelValue": ($event) => formDataElement.model = $event,
7263
2671
  "hide-details": "",