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