@milaboratories/uikit 2.10.26 → 2.10.28
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/.turbo/turbo-build.log +40 -41
- package/.turbo/turbo-formatter$colon$check.log +2 -2
- package/.turbo/turbo-linter$colon$check.log +2 -2
- package/.turbo/turbo-types$colon$check.log +1 -1
- package/CHANGELOG.md +12 -0
- package/dist/components/DataTable/TableComponent.vue.js +16 -17
- package/dist/components/DataTable/TableComponent.vue.js.map +1 -1
- package/dist/components/PlAccordion/ExpandTransition.vue3.js +2 -2
- package/dist/components/PlAccordion/PlAccordionSection.vue2.js +2 -2
- package/dist/components/PlAutocomplete/PlAutocomplete.vue.js +33 -33
- package/dist/components/PlAutocompleteMulti/PlAutocompleteMulti.vue.js +17 -17
- package/dist/components/PlBtnGroup/PlBtnGroup.vue.js +17 -17
- package/dist/components/PlCheckboxGroup/PlCheckboxGroup.vue.js +12 -12
- package/dist/components/PlChip/PlChip.vue.js +8 -8
- package/dist/components/PlDropdown/PlDropdown.vue.js +27 -27
- package/dist/components/PlDropdownLegacy/PlDropdownLegacy.vue.js +39 -39
- package/dist/components/PlDropdownMulti/PlDropdownMulti.vue.js +20 -20
- package/dist/components/PlFileDialog/PlFileDialog.vue.d.ts +3 -1
- package/dist/components/PlFileDialog/PlFileDialog.vue.d.ts.map +1 -1
- package/dist/components/PlFileDialog/Remote.vue.d.ts +3 -1
- package/dist/components/PlFileDialog/Remote.vue.d.ts.map +1 -1
- package/dist/components/PlFileDialog/Remote.vue.js +80 -76
- package/dist/components/PlFileDialog/Remote.vue.js.map +1 -1
- package/dist/components/PlFileDialog/Shortcuts.vue.d.ts +4 -1
- package/dist/components/PlFileDialog/Shortcuts.vue.d.ts.map +1 -1
- package/dist/components/PlFileDialog/Shortcuts.vue2.js +18 -14
- package/dist/components/PlFileDialog/Shortcuts.vue2.js.map +1 -1
- package/dist/components/PlFileInput/PlFileInput.vue.js +17 -17
- package/dist/components/PlLogView/PlLogView.vue.js +22 -22
- package/dist/components/PlNumberField/PlNumberField.vue.js +8 -8
- package/dist/components/PlSearchField/PlSearchField.vue.d.ts +28 -4
- package/dist/components/PlSearchField/PlSearchField.vue.d.ts.map +1 -1
- package/dist/components/PlSearchField/PlSearchField.vue2.js +40 -30
- package/dist/components/PlSearchField/PlSearchField.vue2.js.map +1 -1
- package/dist/components/PlSlideModal/PlPureSlideModal.vue.js +3 -4
- package/dist/components/PlSlideModal/PlPureSlideModal.vue.js.map +1 -1
- package/dist/components/PlTabs/Tab.vue.d.ts +42 -12
- package/dist/components/PlTabs/Tab.vue.d.ts.map +1 -1
- package/dist/components/PlTabs/Tab.vue.js +6 -6
- package/dist/components/PlTextArea/PlTextArea.vue.js +22 -22
- package/dist/components/PlTextField/PlTextField.vue.js +14 -14
- package/dist/components/PlTooltip/PlTooltip.vue.d.ts +30 -3
- package/dist/components/PlTooltip/PlTooltip.vue.d.ts.map +1 -1
- package/dist/components/PlTooltip/PlTooltip.vue.js +7 -110
- package/dist/components/PlTooltip/PlTooltip.vue.js.map +1 -1
- package/dist/components/PlTooltip/PlTooltip.vue2.js +132 -2
- package/dist/components/PlTooltip/PlTooltip.vue2.js.map +1 -1
- package/dist/components/PlTooltip/PlTooltip.vue3.js +26 -0
- package/dist/components/PlTooltip/PlTooltip.vue3.js.map +1 -0
- package/dist/components/Slider.vue.d.ts +1 -1
- package/dist/components/Slider.vue.d.ts.map +1 -1
- package/dist/components/Slider.vue.js +21 -21
- package/dist/components/SliderRange.vue.d.ts +1 -1
- package/dist/components/SliderRange.vue.d.ts.map +1 -1
- package/dist/components/SliderRange.vue.js +31 -31
- package/dist/components/SliderRangeTriple.vue.d.ts +1 -1
- package/dist/components/SliderRangeTriple.vue.d.ts.map +1 -1
- package/dist/components/SliderRangeTriple.vue.js +23 -23
- package/dist/index.js +1 -1
- package/dist/utils/DoubleContour.vue2.js +23 -0
- package/dist/utils/DoubleContour.vue2.js.map +1 -0
- package/package.json +3 -3
- package/src/assets/base.scss +4 -1
- package/src/assets/mixins.scss +1 -2
- package/src/assets/utils.scss +1 -1
- package/src/components/PlFileDialog/Remote.vue +5 -3
- package/src/components/PlFileDialog/Shortcuts.vue +5 -1
- package/src/components/PlSearchField/PlSearchField.vue +22 -17
- package/src/components/PlTooltip/PlTooltip.vue +228 -33
- package/dist/components/PlTooltip/Beak.vue.d.ts +0 -3
- package/dist/components/PlTooltip/Beak.vue.d.ts.map +0 -1
- package/dist/components/PlTooltip/Beak.vue.js +0 -23
- package/dist/components/PlTooltip/Beak.vue.js.map +0 -1
- package/dist/components/PlTooltip/useTooltipPosition.d.ts +0 -12
- package/dist/components/PlTooltip/useTooltipPosition.d.ts.map +0 -1
- package/dist/components/PlTooltip/useTooltipPosition.js +0 -18
- package/dist/components/PlTooltip/useTooltipPosition.js.map +0 -1
- package/src/components/PlTooltip/Beak.vue +0 -12
- package/src/components/PlTooltip/pl-tooltip.scss +0 -117
- package/src/components/PlTooltip/useTooltipPosition.ts +0 -59
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useMouseCapture as
|
|
3
|
-
import { tapIf as
|
|
1
|
+
import { defineComponent as P, useSlots as z, reactive as F, computed as r, ref as v, watch as I, createElementBlock as i, openBlock as s, normalizeClass as R, createElementVNode as l, createCommentVNode as a, createBlock as K, toDisplayString as m, unref as p, withCtx as U, renderSlot as O, normalizeStyle as h, Fragment as T, renderList as j } from "vue";
|
|
2
|
+
import { useMouseCapture as q } from "../composition/useMouseCapture.js";
|
|
3
|
+
import { tapIf as G } from "../helpers/functions.js";
|
|
4
4
|
import { clamp as b } from "../helpers/math.js";
|
|
5
|
-
import
|
|
6
|
-
import { useSliderBreakpoints as
|
|
7
|
-
import { getErrorMessage as
|
|
5
|
+
import H from "./PlTooltip/PlTooltip.vue.js";
|
|
6
|
+
import { useSliderBreakpoints as J } from "../composition/useSliderBreakpoints.js";
|
|
7
|
+
import { getErrorMessage as Q } from "../helpers/error.js";
|
|
8
8
|
const W = { class: "ui-slider__wrapper" }, X = { class: "ui-slider__label-section" }, Y = {
|
|
9
9
|
key: 0,
|
|
10
10
|
class: "text-s"
|
|
@@ -14,7 +14,7 @@ const W = { class: "ui-slider__wrapper" }, X = { class: "ui-slider__label-sectio
|
|
|
14
14
|
}, ee = { class: "ui-slider__base" }, te = { class: "ui-slider__container" }, le = { class: "ui-slider__container ui-slider__container-thumb" }, oe = { class: "ui-slider__input-wrapper d-flex" }, se = ["value"], re = {
|
|
15
15
|
key: 0,
|
|
16
16
|
class: "ui-slider__error"
|
|
17
|
-
},
|
|
17
|
+
}, pe = /* @__PURE__ */ P({
|
|
18
18
|
__name: "Slider",
|
|
19
19
|
props: {
|
|
20
20
|
modelValue: {},
|
|
@@ -31,37 +31,37 @@ const W = { class: "ui-slider__wrapper" }, X = { class: "ui-slider__label-sectio
|
|
|
31
31
|
},
|
|
32
32
|
emits: ["update:modelValue"],
|
|
33
33
|
setup(n, { emit: A }) {
|
|
34
|
-
const B =
|
|
34
|
+
const B = z(), V = A, e = n, d = F({
|
|
35
35
|
deltaValue: 0
|
|
36
36
|
}), y = r(() => e.max - e.min), x = r(() => b((e.modelValue ?? 0) + d.deltaValue, e.min, e.max)), c = v(e.modelValue), g = r(() => {
|
|
37
37
|
const t = e.modelValue;
|
|
38
|
-
return Number.isFinite(t) ? t < e.min ? `Min value: ${e.min}` : t > e.max ? `Max value: ${e.max}` :
|
|
39
|
-
}), C = r(() => e),
|
|
38
|
+
return Number.isFinite(t) ? t < e.min ? `Min value: ${e.min}` : t > e.max ? `Max value: ${e.max}` : Q(e.error) : "Not a number";
|
|
39
|
+
}), C = r(() => e), N = J(C), k = r(() => (x.value - e.min) / y.value), $ = r(() => ({
|
|
40
40
|
right: Math.ceil((1 - k.value) * 100) + "%"
|
|
41
41
|
})), E = r(() => ({
|
|
42
42
|
right: `calc(${Math.ceil((1 - k.value) * 100)}%) `
|
|
43
43
|
})), w = v(), S = v();
|
|
44
|
-
|
|
44
|
+
I(
|
|
45
45
|
() => e.modelValue,
|
|
46
46
|
(t) => {
|
|
47
47
|
c.value = t;
|
|
48
48
|
}
|
|
49
49
|
);
|
|
50
|
-
function
|
|
50
|
+
function _(t) {
|
|
51
51
|
const o = b(t, e.min, e.max);
|
|
52
52
|
return Math.round((o + Number.EPSILON) * (1 / e.step)) / (1 / e.step);
|
|
53
53
|
}
|
|
54
|
-
|
|
54
|
+
q(S, (t) => {
|
|
55
55
|
var o;
|
|
56
|
-
|
|
56
|
+
G((o = p(w)) == null ? void 0 : o.getBoundingClientRect(), (u) => {
|
|
57
57
|
const { dx: f } = t;
|
|
58
|
-
d.deltaValue = f / u.width * y.value, c.value =
|
|
58
|
+
d.deltaValue = f / u.width * y.value, c.value = _(
|
|
59
59
|
b((e.modelValue ?? 0) + d.deltaValue, e.min, e.max)
|
|
60
|
-
), t.stop && (V("update:modelValue",
|
|
60
|
+
), t.stop && (V("update:modelValue", _(x.value)), d.deltaValue = 0);
|
|
61
61
|
});
|
|
62
62
|
});
|
|
63
63
|
function M(t) {
|
|
64
|
-
V("update:modelValue",
|
|
64
|
+
V("update:modelValue", _(t));
|
|
65
65
|
}
|
|
66
66
|
function D(t) {
|
|
67
67
|
M(+t.target.value);
|
|
@@ -81,7 +81,7 @@ const W = { class: "ui-slider__wrapper" }, X = { class: "ui-slider__label-sectio
|
|
|
81
81
|
l("div", X, [
|
|
82
82
|
n.label ? (s(), i("label", Y, [
|
|
83
83
|
l("span", null, m(n.label), 1),
|
|
84
|
-
|
|
84
|
+
p(B).tooltip ? (s(), K(p(H), {
|
|
85
85
|
key: 0,
|
|
86
86
|
class: "info",
|
|
87
87
|
position: "top"
|
|
@@ -103,12 +103,12 @@ const W = { class: "ui-slider__wrapper" }, X = { class: "ui-slider__label-sectio
|
|
|
103
103
|
}, [
|
|
104
104
|
l("div", {
|
|
105
105
|
class: "ui-slider__progress",
|
|
106
|
-
style: h(
|
|
106
|
+
style: h($.value)
|
|
107
107
|
}, null, 4)
|
|
108
108
|
], 512)
|
|
109
109
|
]),
|
|
110
110
|
l("div", le, [
|
|
111
|
-
e.breakpoints ? (s(!0), i(
|
|
111
|
+
e.breakpoints ? (s(!0), i(T, { key: 0 }, j(p(N), (u, f) => (s(), i("div", {
|
|
112
112
|
key: f,
|
|
113
113
|
style: h({ right: `${u}%` }),
|
|
114
114
|
class: "ui-slider__thumb-step"
|
|
@@ -140,6 +140,6 @@ const W = { class: "ui-slider__wrapper" }, X = { class: "ui-slider__label-sectio
|
|
|
140
140
|
}
|
|
141
141
|
});
|
|
142
142
|
export {
|
|
143
|
-
|
|
143
|
+
pe as default
|
|
144
144
|
};
|
|
145
145
|
//# sourceMappingURL=Slider.vue.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SliderRange.vue.d.ts","sourceRoot":"","sources":["../../src/components/SliderRange.vue"],"names":[],"mappings":"AAgRA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAS3C,KAAK,WAAW,GAAG;IACf,UAAU,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC7B,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AAmLJ,iBAAS,cAAc;WA6JT,OAAO,IAA6B;;yBAbrB,GAAG;;;;;;;;EAkB/B;AAyBD,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAC9D,QAAA,MAAM,eAAe;;;;;WAtXT,MAAM;;
|
|
1
|
+
{"version":3,"file":"SliderRange.vue.d.ts","sourceRoot":"","sources":["../../src/components/SliderRange.vue"],"names":[],"mappings":"AAgRA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAS3C,KAAK,WAAW,GAAG;IACf,UAAU,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC7B,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AAmLJ,iBAAS,cAAc;WA6JT,OAAO,IAA6B;;yBAbrB,GAAG;;;;;;;;EAkB/B;AAyBD,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAC9D,QAAA,MAAM,eAAe;;;;;WAtXT,MAAM;;UAGP,UAAU;cAGN,OAAO;SATZ,MAAM;UAEL,MAAM;YAEJ,MAAM;aAGL,MAAM;iBACF,OAAO;;;;;OA0XvB,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAAnG,wBAAoG;AAapG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACxC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useMouseCapture as
|
|
3
|
-
import { tapIf as
|
|
1
|
+
import { defineComponent as Q, useSlots as W, reactive as X, ref as d, computed as a, watch as Y, createElementBlock as m, openBlock as u, normalizeClass as $, createElementVNode as s, createCommentVNode as c, createBlock as K, toDisplayString as M, unref as b, withCtx as Z, renderSlot as ee, normalizeStyle as y, Fragment as te, renderList as le } from "vue";
|
|
2
|
+
import { useMouseCapture as P } from "../composition/useMouseCapture.js";
|
|
3
|
+
import { tapIf as U } from "../helpers/functions.js";
|
|
4
4
|
import { clamp as p } from "../helpers/math.js";
|
|
5
5
|
import oe from "./PlTooltip/PlTooltip.vue.js";
|
|
6
6
|
import se from "./InputRange.vue.js";
|
|
@@ -12,10 +12,10 @@ const re = { class: "ui-slider__wrapper" }, ue = { class: "ui-slider__label-sect
|
|
|
12
12
|
}, de = {
|
|
13
13
|
key: 1,
|
|
14
14
|
class: "ui-slider__value-static text-s"
|
|
15
|
-
}, me = { class: "ui-slider__base" }, ce = { class: "ui-slider__container" }, pe = { class: "ui-slider__container ui-slider__container-thumb" },
|
|
15
|
+
}, me = { class: "ui-slider__base" }, ce = { class: "ui-slider__container" }, pe = { class: "ui-slider__container ui-slider__container-thumb" }, ve = { class: "ui-slider__input-wrapper d-flex" }, fe = {
|
|
16
16
|
key: 0,
|
|
17
17
|
class: "ui-slider__error"
|
|
18
|
-
}, ke = /* @__PURE__ */
|
|
18
|
+
}, ke = /* @__PURE__ */ Q({
|
|
19
19
|
__name: "SliderRange",
|
|
20
20
|
props: {
|
|
21
21
|
modelValue: {},
|
|
@@ -31,53 +31,53 @@ const re = { class: "ui-slider__wrapper" }, ue = { class: "ui-slider__label-sect
|
|
|
31
31
|
disabled: { type: Boolean, default: !1 }
|
|
32
32
|
},
|
|
33
33
|
emits: ["update:modelValue"],
|
|
34
|
-
setup(g, { emit:
|
|
35
|
-
const
|
|
34
|
+
setup(g, { emit: z }) {
|
|
35
|
+
const F = W(), I = z, e = g, r = X({
|
|
36
36
|
deltaValue1: 0,
|
|
37
37
|
deltaValue2: 0
|
|
38
|
-
}), x = d(), S = d(), B = d(),
|
|
39
|
-
() => [
|
|
38
|
+
}), x = d(), S = d(), B = d(), v = d(e.modelValue), f = d(e.modelValue[0]), _ = d(e.modelValue[1]), j = a(() => e), O = ae(j), T = a(
|
|
39
|
+
() => [f.value, _.value].sort((t, l) => t - l).join("-")
|
|
40
40
|
), h = a(() => e.max - e.min), w = a(() => p((e.modelValue[0] ?? 0) + r.deltaValue1, e.min, e.max)), k = a(
|
|
41
41
|
() => p((e.modelValue[1] ?? 0) + r.deltaValue2, e.min, e.max)
|
|
42
42
|
), C = a(() => {
|
|
43
43
|
const t = e.modelValue;
|
|
44
44
|
return Array.isArray(t) && t.length === 2 && t.every((o) => Number.isFinite(o)) ? ie(e.error) : "Expected model [number, number]";
|
|
45
|
-
}), D = a(() => (w.value - e.min) / h.value), E = a(() => (k.value - e.min) / h.value), L = a(() =>
|
|
45
|
+
}), D = a(() => (w.value - e.min) / h.value), E = a(() => (k.value - e.min) / h.value), L = a(() => J()), q = a(() => ({
|
|
46
46
|
right: L.value[0] + "%",
|
|
47
47
|
left: 100 - L.value[1] + "%"
|
|
48
|
-
})),
|
|
48
|
+
})), G = a(() => ({
|
|
49
49
|
right: Math.ceil((1 - D.value) * 100) + "%"
|
|
50
|
-
})),
|
|
50
|
+
})), H = a(() => ({
|
|
51
51
|
right: Math.ceil((1 - E.value) * 100) + "%"
|
|
52
52
|
}));
|
|
53
53
|
Y(
|
|
54
54
|
() => e.modelValue,
|
|
55
55
|
(t) => {
|
|
56
|
-
|
|
56
|
+
v.value = t, f.value = +t[0], _.value = +t[1];
|
|
57
57
|
},
|
|
58
58
|
{ immediate: !0 }
|
|
59
|
-
),
|
|
59
|
+
), P(S, (t) => {
|
|
60
60
|
var l;
|
|
61
|
-
|
|
61
|
+
U((l = b(x)) == null ? void 0 : l.getBoundingClientRect(), (o) => {
|
|
62
62
|
const { dx: i } = t;
|
|
63
|
-
r.deltaValue1 = i / o.width * h.value,
|
|
63
|
+
r.deltaValue1 = i / o.width * h.value, f.value = n(
|
|
64
64
|
p((e.modelValue[0] ?? 0) + r.deltaValue1, e.min, e.max)
|
|
65
|
-
),
|
|
65
|
+
), v.value = [f.value, _.value].sort(
|
|
66
66
|
(R, A) => R - A
|
|
67
67
|
), t.stop && (V([n(w.value), n(k.value)]), r.deltaValue1 = 0);
|
|
68
68
|
});
|
|
69
|
-
}),
|
|
69
|
+
}), P(B, (t) => {
|
|
70
70
|
var l;
|
|
71
|
-
|
|
71
|
+
U((l = b(x)) == null ? void 0 : l.getBoundingClientRect(), (o) => {
|
|
72
72
|
const { dx: i } = t;
|
|
73
73
|
r.deltaValue2 = i / o.width * h.value, _.value = n(
|
|
74
74
|
p((e.modelValue[1] ?? 0) + r.deltaValue2, e.min, e.max)
|
|
75
|
-
),
|
|
75
|
+
), v.value = [f.value, _.value].sort(
|
|
76
76
|
(R, A) => R - A
|
|
77
77
|
), t.stop && (V([n(w.value), n(k.value)]), r.deltaValue2 = 0);
|
|
78
78
|
});
|
|
79
79
|
});
|
|
80
|
-
function
|
|
80
|
+
function J() {
|
|
81
81
|
const t = Math.ceil((1 - D.value) * 100), l = Math.ceil((1 - E.value) * 100);
|
|
82
82
|
return [t, l].sort((o, i) => o - i);
|
|
83
83
|
}
|
|
@@ -86,7 +86,7 @@ const re = { class: "ui-slider__wrapper" }, ue = { class: "ui-slider__label-sect
|
|
|
86
86
|
return Math.round((l + Number.EPSILON) * (1 / e.step)) / (1 / e.step);
|
|
87
87
|
}
|
|
88
88
|
function V(t) {
|
|
89
|
-
|
|
89
|
+
I("update:modelValue", t);
|
|
90
90
|
}
|
|
91
91
|
function N(t, l) {
|
|
92
92
|
["ArrowDown", "ArrowUp", "ArrowRight", "ArrowLeft", "Enter"].includes(t.code) && t.preventDefault();
|
|
@@ -103,7 +103,7 @@ const re = { class: "ui-slider__wrapper" }, ue = { class: "ui-slider__label-sect
|
|
|
103
103
|
s("div", ue, [
|
|
104
104
|
g.label ? (u(), m("label", ne, [
|
|
105
105
|
s("span", null, M(g.label), 1),
|
|
106
|
-
b(
|
|
106
|
+
b(F).tooltip ? (u(), K(b(oe), {
|
|
107
107
|
key: 0,
|
|
108
108
|
class: "info",
|
|
109
109
|
position: "top"
|
|
@@ -114,7 +114,7 @@ const re = { class: "ui-slider__wrapper" }, ue = { class: "ui-slider__label-sect
|
|
|
114
114
|
_: 3
|
|
115
115
|
})) : c("", !0)
|
|
116
116
|
])) : c("", !0),
|
|
117
|
-
e.mode === "text" ? (u(), m("div", de, M(
|
|
117
|
+
e.mode === "text" ? (u(), m("div", de, M(T.value), 1)) : c("", !0)
|
|
118
118
|
]),
|
|
119
119
|
s("div", me, [
|
|
120
120
|
s("div", ce, [
|
|
@@ -125,7 +125,7 @@ const re = { class: "ui-slider__wrapper" }, ue = { class: "ui-slider__label-sect
|
|
|
125
125
|
}, [
|
|
126
126
|
s("div", {
|
|
127
127
|
class: "ui-slider__progress",
|
|
128
|
-
style: y(
|
|
128
|
+
style: y(q.value)
|
|
129
129
|
}, null, 4)
|
|
130
130
|
], 512)
|
|
131
131
|
]),
|
|
@@ -138,7 +138,7 @@ const re = { class: "ui-slider__wrapper" }, ue = { class: "ui-slider__label-sect
|
|
|
138
138
|
s("div", {
|
|
139
139
|
ref_key: "thumbRef1",
|
|
140
140
|
ref: S,
|
|
141
|
-
style: y(
|
|
141
|
+
style: y(G.value),
|
|
142
142
|
class: "ui-slider__thumb",
|
|
143
143
|
tabindex: "0",
|
|
144
144
|
onKeydown: l[0] || (l[0] = (o) => N(o, 0))
|
|
@@ -148,7 +148,7 @@ const re = { class: "ui-slider__wrapper" }, ue = { class: "ui-slider__label-sect
|
|
|
148
148
|
s("div", {
|
|
149
149
|
ref_key: "thumbRef2",
|
|
150
150
|
ref: B,
|
|
151
|
-
style: y(
|
|
151
|
+
style: y(H.value),
|
|
152
152
|
class: "ui-slider__thumb",
|
|
153
153
|
tabindex: "0",
|
|
154
154
|
onKeydown: l[1] || (l[1] = (o) => N(o, 1))
|
|
@@ -158,17 +158,17 @@ const re = { class: "ui-slider__wrapper" }, ue = { class: "ui-slider__label-sect
|
|
|
158
158
|
])
|
|
159
159
|
])
|
|
160
160
|
]),
|
|
161
|
-
s("div",
|
|
161
|
+
s("div", ve, [
|
|
162
162
|
e.mode === "input" ? (u(), K(se, {
|
|
163
163
|
key: 0,
|
|
164
|
-
modelValue:
|
|
165
|
-
"onUpdate:modelValue": l[2] || (l[2] = (o) =>
|
|
164
|
+
modelValue: v.value,
|
|
165
|
+
"onUpdate:modelValue": l[2] || (l[2] = (o) => v.value = o),
|
|
166
166
|
class: "ui-focused-border",
|
|
167
167
|
onChange: V
|
|
168
168
|
}, null, 8, ["modelValue"])) : c("", !0)
|
|
169
169
|
])
|
|
170
170
|
], 2),
|
|
171
|
-
C.value ? (u(), m("div",
|
|
171
|
+
C.value ? (u(), m("div", fe, M(C.value), 1)) : c("", !0)
|
|
172
172
|
], 2));
|
|
173
173
|
}
|
|
174
174
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SliderRangeTriple.vue.d.ts","sourceRoot":"","sources":["../../src/components/SliderRangeTriple.vue"],"names":[],"mappings":"AA+UA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAI3C,KAAK,SAAS,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;AAK1C,KAAK,WAAW,GAAG;IACf,UAAU,EAAE,SAAS,CAAC;IACtB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AAsOJ,iBAAS,cAAc;WAyJT,OAAO,IAA6B;;yBAdrB,GAAG;;;;;;;;;EAmB/B;AAuBD,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAC9D,QAAA,MAAM,eAAe;;;;;WAnaT,MAAM;;
|
|
1
|
+
{"version":3,"file":"SliderRangeTriple.vue.d.ts","sourceRoot":"","sources":["../../src/components/SliderRangeTriple.vue"],"names":[],"mappings":"AA+UA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAI3C,KAAK,SAAS,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;AAK1C,KAAK,WAAW,GAAG;IACf,UAAU,EAAE,SAAS,CAAC;IACtB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AAsOJ,iBAAS,cAAc;WAyJT,OAAO,IAA6B;;yBAdrB,GAAG;;;;;;;;;EAmB/B;AAuBD,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAC9D,QAAA,MAAM,eAAe;;;;;WAnaT,MAAM;;UAGP,UAAU;cAGN,OAAO;SATZ,MAAM;UAEL,MAAM;YAEJ,MAAM;aAGL,MAAM;iBACF,OAAO;;;;;;kBAwavB,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAAnG,wBAAoG;AAapG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACxC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { defineComponent as W, useSlots as X, reactive as Y, ref as w, computed as r, onMounted as Z, createElementBlock as h, openBlock as d, normalizeClass as
|
|
1
|
+
import { defineComponent as W, useSlots as X, reactive as Y, ref as w, computed as r, onMounted as Z, createElementBlock as h, openBlock as d, normalizeClass as z, createElementVNode as o, createCommentVNode as R, createBlock as ee, toDisplayString as I, unref as m, withCtx as te, renderSlot as le, normalizeStyle as _, Fragment as ae, renderList as ie } from "vue";
|
|
2
2
|
import { useMouseCapture as $ } from "../composition/useMouseCapture.js";
|
|
3
3
|
import { tapIf as D } from "../helpers/functions.js";
|
|
4
4
|
import { clamp as c } from "../helpers/math.js";
|
|
5
5
|
import oe from "./PlTooltip/PlTooltip.vue.js";
|
|
6
6
|
import { useSliderBreakpoints as re } from "../composition/useSliderBreakpoints.js";
|
|
7
|
-
import { getErrorMessage as
|
|
8
|
-
const
|
|
7
|
+
import { getErrorMessage as ue } from "../helpers/error.js";
|
|
8
|
+
const se = { class: "ui-slider__wrapper" }, ne = { class: "ui-slider__label-section" }, de = {
|
|
9
9
|
key: 0,
|
|
10
10
|
class: "text-s"
|
|
11
11
|
}, me = { class: "ui-slider__base" }, ce = { class: "ui-slider__container" }, pe = { class: "ui-slider__container ui-slider__container-thumb" }, ve = ["data-percent"], fe = ["data-percent"], he = ["data-percent"], _e = {
|
|
@@ -28,16 +28,16 @@ const ue = { class: "ui-slider__wrapper" }, ne = { class: "ui-slider__label-sect
|
|
|
28
28
|
},
|
|
29
29
|
emits: ["update:modelValue"],
|
|
30
30
|
setup(k, { emit: U }) {
|
|
31
|
-
const j = X(), H = U, e = k,
|
|
31
|
+
const j = X(), H = U, e = k, u = Y({
|
|
32
32
|
deltaValue1: 0,
|
|
33
33
|
deltaValue2: 0,
|
|
34
34
|
deltaValue3: 0
|
|
35
35
|
}), b = w(), p = w(), v = w(), f = w(), n = r(() => e.max - e.min), O = r(() => e), q = re(O), g = r(
|
|
36
|
-
() => c((e.modelValue[0] ?? 0) +
|
|
36
|
+
() => c((e.modelValue[0] ?? 0) + u.deltaValue1, e.min, e.max)
|
|
37
37
|
), V = r(
|
|
38
|
-
() => c((e.modelValue[1] ?? 0) +
|
|
38
|
+
() => c((e.modelValue[1] ?? 0) + u.deltaValue2, e.min, e.max)
|
|
39
39
|
), y = r(
|
|
40
|
-
() => c((e.modelValue[2] ?? 0) +
|
|
40
|
+
() => c((e.modelValue[2] ?? 0) + u.deltaValue3, e.min, e.max)
|
|
41
41
|
), L = r(() => {
|
|
42
42
|
const l = e.modelValue;
|
|
43
43
|
if (!(Array.isArray(l) && l.length === 3 && l.every((a) => Number.isFinite(a))))
|
|
@@ -45,45 +45,45 @@ const ue = { class: "ui-slider__wrapper" }, ne = { class: "ui-slider__label-sect
|
|
|
45
45
|
const i = [];
|
|
46
46
|
return [...e.modelValue].forEach((a) => {
|
|
47
47
|
a > e.max && i.push(`Max model value must be lower than max props ${e.max}.`), a < e.min && i.push("Min model value must be greater than max props.");
|
|
48
|
-
}), i.length > 0 ? i.join(" ") :
|
|
49
|
-
}), K = r(() => (g.value - e.min) / n.value), F = r(() => (V.value - e.min) / n.value),
|
|
50
|
-
right:
|
|
51
|
-
left: 100 -
|
|
48
|
+
}), i.length > 0 ? i.join(" ") : ue(e.error);
|
|
49
|
+
}), K = r(() => (g.value - e.min) / n.value), F = r(() => (V.value - e.min) / n.value), P = r(() => (y.value - e.min) / n.value), T = r(() => J()), G = r(() => ({
|
|
50
|
+
right: T.value[0] + "%",
|
|
51
|
+
left: 100 - T.value[2] + "%"
|
|
52
52
|
})), M = r(() => ({
|
|
53
53
|
right: Math.ceil((1 - K.value) * 100) + "%"
|
|
54
54
|
})), S = r(() => ({
|
|
55
55
|
right: Math.ceil((1 - F.value) * 100) + "%"
|
|
56
56
|
})), A = r(() => ({
|
|
57
|
-
right: Math.ceil((1 -
|
|
57
|
+
right: Math.ceil((1 - P.value) * 100) + "%"
|
|
58
58
|
}));
|
|
59
59
|
$(p, (l) => {
|
|
60
60
|
var t;
|
|
61
61
|
D((t = m(b)) == null ? void 0 : t.getBoundingClientRect(), (i) => {
|
|
62
62
|
const { dx: a } = l;
|
|
63
|
-
|
|
63
|
+
u.deltaValue1 = a / i.width * n.value, p.value && B(p.value, e.modelValue[0], u.deltaValue1), l.stop && (x([s(g.value), s(V.value), s(y.value)]), u.deltaValue1 = 0);
|
|
64
64
|
});
|
|
65
65
|
}), $(v, (l) => {
|
|
66
66
|
var t;
|
|
67
67
|
D((t = m(b)) == null ? void 0 : t.getBoundingClientRect(), (i) => {
|
|
68
68
|
const { dx: a } = l;
|
|
69
|
-
|
|
69
|
+
u.deltaValue2 = a / i.width * n.value, v.value && B(v.value, e.modelValue[1], u.deltaValue2), l.stop && (x([s(g.value), s(V.value), s(y.value)]), u.deltaValue2 = 0);
|
|
70
70
|
});
|
|
71
71
|
}), $(f, (l) => {
|
|
72
72
|
var t;
|
|
73
73
|
D((t = m(b)) == null ? void 0 : t.getBoundingClientRect(), (i) => {
|
|
74
74
|
const { dx: a } = l;
|
|
75
|
-
|
|
75
|
+
u.deltaValue3 = a / i.width * n.value, f.value && B(f.value, e.modelValue[2], u.deltaValue3), l.stop && (x([s(g.value), s(V.value), s(y.value)]), u.deltaValue3 = 0);
|
|
76
76
|
});
|
|
77
77
|
});
|
|
78
78
|
function B(l, t, i) {
|
|
79
|
-
const a =
|
|
79
|
+
const a = s(c((t ?? 0) + i, e.min, e.max));
|
|
80
80
|
l.dataset.percent = `${a}${e.measure}`, C();
|
|
81
81
|
}
|
|
82
82
|
function J() {
|
|
83
|
-
const l = Math.ceil((1 - K.value) * 100), t = Math.ceil((1 - F.value) * 100), i = Math.ceil((1 -
|
|
83
|
+
const l = Math.ceil((1 - K.value) * 100), t = Math.ceil((1 - F.value) * 100), i = Math.ceil((1 - P.value) * 100);
|
|
84
84
|
return [l, t, i].sort((a, E) => a - E);
|
|
85
85
|
}
|
|
86
|
-
function
|
|
86
|
+
function s(l) {
|
|
87
87
|
const t = c(l, e.min, e.max);
|
|
88
88
|
return Math.round((t + Number.EPSILON) * (1 / e.step)) / (1 / e.step);
|
|
89
89
|
}
|
|
@@ -106,15 +106,15 @@ const ue = { class: "ui-slider__wrapper" }, ne = { class: "ui-slider__label-sect
|
|
|
106
106
|
return Z(() => {
|
|
107
107
|
C();
|
|
108
108
|
}), (l, t) => (d(), h("div", {
|
|
109
|
-
class:
|
|
109
|
+
class: z([e.disabled ? "ui-slider__disabled" : void 0, "ui-slider__envelope ui-slider__triple"])
|
|
110
110
|
}, [
|
|
111
111
|
o("div", {
|
|
112
|
-
class:
|
|
112
|
+
class: z([`ui-slider__mode-${e.mode}`, "ui-slider"])
|
|
113
113
|
}, [
|
|
114
|
-
o("div",
|
|
114
|
+
o("div", se, [
|
|
115
115
|
o("div", ne, [
|
|
116
116
|
k.label ? (d(), h("label", de, [
|
|
117
|
-
o("span", null,
|
|
117
|
+
o("span", null, I(k.label), 1),
|
|
118
118
|
m(j).tooltip ? (d(), ee(m(oe), {
|
|
119
119
|
key: 0,
|
|
120
120
|
class: "info",
|
|
@@ -187,7 +187,7 @@ const ue = { class: "ui-slider__wrapper" }, ne = { class: "ui-slider__label-sect
|
|
|
187
187
|
]),
|
|
188
188
|
t[6] || (t[6] = o("div", { class: "ui-slider__input-wrapper d-flex" }, null, -1))
|
|
189
189
|
], 2),
|
|
190
|
-
L.value ? (d(), h("div", _e,
|
|
190
|
+
L.value ? (d(), h("div", _e, I(L.value), 1)) : R("", !0)
|
|
191
191
|
], 2));
|
|
192
192
|
}
|
|
193
193
|
});
|