@profitliga/ui 2.0.1 → 2.0.3
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/components/BottomSheet/BottomSheet.css +1 -1
- package/dist/components/BottomSheet/BottomSheet.vue.js +1 -1
- package/dist/components/BottomSheet/BottomSheet.vue2.js +56 -56
- package/dist/components/Drawer/Drawer.vue.d.ts +1 -1
- package/dist/components/Drawer/Drawer.vue.js +4 -4
- package/dist/components/RangeCalendar/RangeCalendar.css +1 -1
- package/dist/components/RangeCalendar/RangeCalendar.vue.js +2 -2
- package/dist/components/RangeCalendar/RangeCalendar.vue2.js +42 -42
- package/dist/components/v2/Checkbox/Checkbox.css +1 -1
- package/dist/components/v2/Checkbox/Checkbox.vue.js +2 -2
- package/dist/components/v2/Checkbox/Checkbox.vue2.js +26 -26
- package/dist/components/v2/Combobox/Combobox.css +1 -1
- package/dist/components/v2/Combobox/Combobox.types.d.ts +63 -3
- package/dist/components/v2/Combobox/Combobox.vue.d.ts +24 -52
- package/dist/components/v2/Combobox/Combobox.vue.js +2 -2
- package/dist/components/v2/Combobox/Combobox.vue2.js +328 -257
- package/dist/components/v2/DatePicker/DatePicker.vue.d.ts +2 -2
- package/dist/components/v2/Divider/Divider.css +1 -1
- package/dist/components/v2/Divider/Divider.vue.js +2 -2
- package/dist/components/v2/Divider/Divider.vue2.js +10 -10
- package/dist/components/v2/DropdownMenu/DropdownMenu.vue.d.ts +2 -2
- package/dist/components/v2/File/FilePreviewDialog.vue.d.ts +1 -1
- package/dist/components/v2/FileUpload/FileUpload.vue.d.ts +1 -1
- package/dist/components/v2/FileUpload/FileUploadInline.vue.d.ts +1 -1
- package/dist/components/v2/Input/Input.css +1 -1
- package/dist/components/v2/Input/Input.vue.js +2 -2
- package/dist/components/v2/Input/Input.vue2.js +113 -107
- package/dist/components/v2/InputNumber/InputNumber.css +1 -1
- package/dist/components/v2/InputNumber/InputNumber.vue.js +2 -2
- package/dist/components/v2/InputNumber/InputNumber.vue2.js +2 -2
- package/dist/components/v2/InputSelect/InputSelect.vue.d.ts +1 -1
- package/dist/components/v2/Popover/Popover.vue.d.ts +1 -1
- package/dist/components/v2/Select/Select.css +1 -1
- package/dist/components/v2/Select/Select.types.d.ts +50 -3
- package/dist/components/v2/Select/Select.vue.d.ts +20 -40
- package/dist/components/v2/Select/Select.vue.js +1 -1
- package/dist/components/v2/Select/Select.vue2.js +191 -162
- package/dist/components/v2/Tooltip/Tooltip.vue.d.ts +1 -1
- package/dist/components/v2/Tooltip/TooltipContent.vue.d.ts +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
[data-v-
|
|
1
|
+
[data-v-7b1882bc] .drawer-content__header{display:none}[data-v-7b1882bc] .drag-closing-overlay{visibility:hidden}[data-v-7b1882bc] .drawer-content{height:max-content;max-height:calc(100vh - 40px)}.drawer-content[data-v-7b1882bc]{flex-direction:column;height:max-content;display:flex}.drawer-content--bottom[data-v-7b1882bc]{max-height:100%!important}[data-v-7b1882bc] .drawer-content__content{height:max-content;max-height:100vh;padding:0}[data-v-7b1882bc] .drawer-content__wrapper{gap:0;height:100%;overflow:hidden}.bottom-sheet-handle[data-v-7b1882bc]{cursor:grab;touch-action:none;flex-shrink:0;justify-content:center;align-items:flex-end;width:100%;height:24px;display:flex}.bottom-sheet-handle[data-v-7b1882bc]:active{cursor:grabbing}.bottom-sheet-handle__dot[data-v-7b1882bc]{background-color:var(--theme-neutral-icon-primary);border-radius:2px;width:48px;height:4px}.bottom-sheet-body[data-v-7b1882bc]{flex:1;justify-content:flex-start;align-items:flex-start;width:100%;height:max-content;min-height:0;display:flex;overflow-y:auto}
|
|
@@ -2,7 +2,7 @@ import './BottomSheet.css';
|
|
|
2
2
|
import o from "./BottomSheet.vue2.js";
|
|
3
3
|
/* empty css */
|
|
4
4
|
import t from "../../_virtual/_plugin-vue_export-helper.js";
|
|
5
|
-
const p = /* @__PURE__ */ t(o, [["__scopeId", "data-v-
|
|
5
|
+
const p = /* @__PURE__ */ t(o, [["__scopeId", "data-v-7b1882bc"]]);
|
|
6
6
|
export {
|
|
7
7
|
p as default
|
|
8
8
|
};
|
|
@@ -1,91 +1,91 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
const
|
|
1
|
+
import { defineComponent as x, useModel as E, useTemplateRef as T, ref as a, watch as Y, nextTick as z, openBlock as _, createBlock as $, withCtx as i, renderSlot as D, createCommentVNode as k, createVNode as c, createElementVNode as d, normalizeStyle as M, normalizeClass as B, withModifiers as L, mergeModels as S } from "vue";
|
|
2
|
+
import N from "../Drawer/DrawerContent.vue.js";
|
|
3
|
+
import R from "../Drawer/DrawerOverlay.vue.js";
|
|
4
|
+
import V from "../Drawer/DrawerPortal.vue.js";
|
|
5
|
+
import H from "../Drawer/DrawerRoot.vue.js";
|
|
6
|
+
import I from "../Drawer/DrawerTrigger.vue.js";
|
|
7
|
+
const O = { class: "bottom-sheet-body" }, J = /* @__PURE__ */ x({
|
|
8
8
|
__name: "BottomSheet",
|
|
9
|
-
props: /* @__PURE__ */
|
|
9
|
+
props: /* @__PURE__ */ S({
|
|
10
10
|
zIndex: { default: 1003 }
|
|
11
11
|
}, {
|
|
12
12
|
open: { type: Boolean, default: !1 },
|
|
13
13
|
openModifiers: {}
|
|
14
14
|
}),
|
|
15
15
|
emits: ["update:open"],
|
|
16
|
-
setup(
|
|
17
|
-
const
|
|
18
|
-
o.value = !0,
|
|
19
|
-
},
|
|
16
|
+
setup(m, { expose: w }) {
|
|
17
|
+
const l = E(m, "open"), v = T("content"), o = a(!1), s = a(!1), n = a(0), u = a(0), f = a(0), y = (e) => {
|
|
18
|
+
o.value = !0, u.value = e.touches[0].clientY;
|
|
19
|
+
}, b = (e) => {
|
|
20
20
|
if (!o.value) return;
|
|
21
|
-
const t = e.touches[0].clientY -
|
|
21
|
+
const t = e.touches[0].clientY - u.value;
|
|
22
22
|
t > 0 && (e.preventDefault(), n.value = t);
|
|
23
|
-
},
|
|
23
|
+
}, p = () => {
|
|
24
24
|
if (!o.value) return;
|
|
25
|
-
const e =
|
|
26
|
-
n.value > e ? (n.value =
|
|
27
|
-
|
|
25
|
+
const e = f.value * 0.3;
|
|
26
|
+
n.value > e ? (n.value = f.value + 50, o.value = !1, setTimeout(() => {
|
|
27
|
+
s.value = !0, l.value = !1;
|
|
28
28
|
}, 200)) : (n.value = 0, o.value = !1);
|
|
29
|
-
},
|
|
30
|
-
o.value = !0,
|
|
31
|
-
const t = (
|
|
29
|
+
}, C = (e) => {
|
|
30
|
+
o.value = !0, u.value = e.clientY;
|
|
31
|
+
const t = (h) => {
|
|
32
32
|
if (!o.value) return;
|
|
33
|
-
const
|
|
34
|
-
|
|
35
|
-
},
|
|
36
|
-
|
|
33
|
+
const g = h.clientY - u.value;
|
|
34
|
+
g > 0 && (h.preventDefault(), n.value = g);
|
|
35
|
+
}, r = () => {
|
|
36
|
+
p(), document.removeEventListener("mousemove", t), document.removeEventListener("mouseup", r);
|
|
37
37
|
};
|
|
38
|
-
document.addEventListener("mousemove", t), document.addEventListener("mouseup",
|
|
38
|
+
document.addEventListener("mousemove", t), document.addEventListener("mouseup", r);
|
|
39
39
|
};
|
|
40
|
-
return
|
|
41
|
-
e && (
|
|
42
|
-
}),
|
|
43
|
-
$elContent:
|
|
44
|
-
}), (e, t) => (
|
|
45
|
-
open:
|
|
46
|
-
"onUpdate:open": t[0] || (t[0] = (
|
|
40
|
+
return Y(l, async (e) => {
|
|
41
|
+
e && (s.value = !1, n.value = 0, await z(), v.value?.$el && (f.value = v.value.$el.offsetHeight));
|
|
42
|
+
}), w({
|
|
43
|
+
$elContent: v.value
|
|
44
|
+
}), (e, t) => (_(), $(H, {
|
|
45
|
+
open: l.value,
|
|
46
|
+
"onUpdate:open": t[0] || (t[0] = (r) => l.value = r)
|
|
47
47
|
}, {
|
|
48
|
-
default:
|
|
49
|
-
e.$slots.trigger ? (
|
|
48
|
+
default: i(() => [
|
|
49
|
+
e.$slots.trigger ? (_(), $(I, {
|
|
50
50
|
key: 0,
|
|
51
51
|
"as-child": ""
|
|
52
52
|
}, {
|
|
53
|
-
default:
|
|
54
|
-
|
|
53
|
+
default: i(() => [
|
|
54
|
+
D(e.$slots, "trigger", {}, void 0, !0)
|
|
55
55
|
]),
|
|
56
56
|
_: 3
|
|
57
|
-
})) :
|
|
58
|
-
|
|
59
|
-
default:
|
|
60
|
-
|
|
61
|
-
style:
|
|
57
|
+
})) : k("", !0),
|
|
58
|
+
c(V, null, {
|
|
59
|
+
default: i(() => [
|
|
60
|
+
d("div", {
|
|
61
|
+
style: M(`position: relative; z-index: ${m.zIndex}`)
|
|
62
62
|
}, [
|
|
63
|
-
|
|
64
|
-
class:
|
|
63
|
+
c(R, {
|
|
64
|
+
class: B({ "drag-closing-overlay": s.value })
|
|
65
65
|
}, null, 8, ["class"]),
|
|
66
|
-
|
|
66
|
+
c(N, {
|
|
67
67
|
ref: "content",
|
|
68
68
|
position: "bottom",
|
|
69
69
|
"close-button": { enabled: !1 },
|
|
70
|
-
style:
|
|
70
|
+
style: M({
|
|
71
71
|
transform: n.value > 0 ? `translateY(${n.value}px)` : void 0,
|
|
72
72
|
transition: o.value ? "none" : "transform 0.2s ease-out",
|
|
73
|
-
animation:
|
|
73
|
+
animation: s.value ? "none" : void 0,
|
|
74
74
|
overflow: "visible"
|
|
75
75
|
})
|
|
76
76
|
}, {
|
|
77
|
-
default:
|
|
78
|
-
|
|
77
|
+
default: i(() => [
|
|
78
|
+
d("div", {
|
|
79
79
|
class: "bottom-sheet-handle",
|
|
80
|
-
onTouchstart:
|
|
81
|
-
onTouchmove:
|
|
82
|
-
onTouchend:
|
|
83
|
-
onMousedown:
|
|
80
|
+
onTouchstart: y,
|
|
81
|
+
onTouchmove: L(b, ["prevent"]),
|
|
82
|
+
onTouchend: p,
|
|
83
|
+
onMousedown: C
|
|
84
84
|
}, [...t[1] || (t[1] = [
|
|
85
|
-
|
|
85
|
+
d("div", { class: "bottom-sheet-handle__dot" }, null, -1)
|
|
86
86
|
])], 32),
|
|
87
|
-
|
|
88
|
-
|
|
87
|
+
d("div", O, [
|
|
88
|
+
D(e.$slots, "default", {}, void 0, !0)
|
|
89
89
|
])
|
|
90
90
|
]),
|
|
91
91
|
_: 3
|
|
@@ -100,5 +100,5 @@ const U = { class: "bottom-sheet-body" }, K = /* @__PURE__ */ E({
|
|
|
100
100
|
}
|
|
101
101
|
});
|
|
102
102
|
export {
|
|
103
|
-
|
|
103
|
+
J as default
|
|
104
104
|
};
|
|
@@ -35,8 +35,8 @@ declare const __VLS_component: DefineComponent<__VLS_PublicProps, {}, {}, {}, {}
|
|
|
35
35
|
closeButton: IDrawerCloseProps;
|
|
36
36
|
position: "right" | "left" | "top" | "bottom";
|
|
37
37
|
zIndex: number;
|
|
38
|
-
contentClass: string | string[];
|
|
39
38
|
breakpointMobile: TBreakpoints;
|
|
39
|
+
contentClass: string | string[];
|
|
40
40
|
}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
|
|
41
41
|
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
42
42
|
export default _default;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as p, useModel as c, toRef as g, unref as b, openBlock as a, createBlock as s, createSlots as k, withCtx as o, renderSlot as n, createCommentVNode as $, createVNode as d, createElementVNode as v, normalizeStyle as w, normalizeClass as z, mergeModels as h } from "vue";
|
|
2
2
|
import { breakpoints as y } from "../../utils/breakpoints.util.js";
|
|
3
3
|
import C from "../BottomSheet/BottomSheet.vue.js";
|
|
4
4
|
import M from "./DrawerContent.vue.js";
|
|
@@ -6,7 +6,7 @@ import B from "./DrawerOverlay.vue.js";
|
|
|
6
6
|
import I from "./DrawerPortal.vue.js";
|
|
7
7
|
import S from "./DrawerRoot.vue.js";
|
|
8
8
|
import D from "./DrawerTrigger.vue.js";
|
|
9
|
-
const q = /* @__PURE__ */
|
|
9
|
+
const q = /* @__PURE__ */ p({
|
|
10
10
|
__name: "Drawer",
|
|
11
11
|
props: /* @__PURE__ */ h({
|
|
12
12
|
position: { default: "right" },
|
|
@@ -21,8 +21,8 @@ const q = /* @__PURE__ */ c({
|
|
|
21
21
|
}),
|
|
22
22
|
emits: ["update:open"],
|
|
23
23
|
setup(e) {
|
|
24
|
-
const
|
|
25
|
-
return (t, i) =>
|
|
24
|
+
const f = e, l = c(e, "open"), m = g(f, "breakpointMobile"), u = y.smaller(m.value);
|
|
25
|
+
return (t, i) => b(u) ? (a(), s(C, {
|
|
26
26
|
key: 0,
|
|
27
27
|
open: l.value,
|
|
28
28
|
"onUpdate:open": i[0] || (i[0] = (r) => l.value = r),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.calendar--vertical[data-v-
|
|
1
|
+
.calendar--vertical[data-v-ab011612]{padding:0 40px}.button--absolute[data-v-ab011612]{position:absolute;top:50%}.button--absolute.button-prev[data-v-ab011612]{left:0}.button--absolute.button-next[data-v-ab011612]{right:0}.mounth-title[data-v-ab011612]{color:var(--theme-neutral-text-body);text-transform:capitalize;margin:0 auto 8px;font-size:20px;font-weight:700;line-height:24px}
|
|
@@ -2,7 +2,7 @@ import './RangeCalendar.css';
|
|
|
2
2
|
import a from "./RangeCalendar.vue2.js";
|
|
3
3
|
/* empty css */
|
|
4
4
|
import o from "../../_virtual/_plugin-vue_export-helper.js";
|
|
5
|
-
const
|
|
5
|
+
const m = /* @__PURE__ */ o(a, [["__scopeId", "data-v-ab011612"]]);
|
|
6
6
|
export {
|
|
7
|
-
|
|
7
|
+
m as default
|
|
8
8
|
};
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { defineComponent as B, useModel as k, openBlock as
|
|
1
|
+
import { defineComponent as B, useModel as k, openBlock as a, createBlock as n, mergeProps as x, unref as f, withCtx as t, createVNode as l, normalizeStyle as O, normalizeClass as y, createCommentVNode as p, createElementBlock as o, Fragment as u, renderList as d, toDisplayString as C, createTextVNode as D, mergeModels as b } from "vue";
|
|
2
2
|
import { useForwardPropsEmits as w, RangeCalendarGridHead as S } from "reka-ui";
|
|
3
|
-
import H from "
|
|
4
|
-
import N from "./
|
|
5
|
-
import P from "./
|
|
6
|
-
import $ from "./
|
|
3
|
+
import { dayjs as H } from "../../utils/dayjs.util.js";
|
|
4
|
+
import N from "./RangeCalendarCell.vue.js";
|
|
5
|
+
import P from "./RangeCalendarCellTrigger.vue.js";
|
|
6
|
+
import $ from "./RangeCalendarGrid.vue.js";
|
|
7
|
+
import z from "./RangeCalendarGridBody.vue.js";
|
|
7
8
|
import h from "./RangeCalendarGridRow.vue.js";
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import { dayjs as E } from "../../utils/dayjs.util.js";
|
|
9
|
+
import F from "./RangeCalendarHeadCell.vue.js";
|
|
10
|
+
import G from "./RangeCalendarHeader.vue.js";
|
|
11
|
+
import Y from "./RangeCalendarHeading.vue.js";
|
|
12
|
+
import T from "./RangeCalendarNext.vue.js";
|
|
13
|
+
import j from "./RangeCalendarPrev.vue.js";
|
|
14
|
+
import E from "./RangeCalendarRoot.vue.js";
|
|
15
15
|
const L = {
|
|
16
16
|
key: 0,
|
|
17
17
|
class: "mounth-title"
|
|
@@ -55,9 +55,9 @@ const L = {
|
|
|
55
55
|
emits: /* @__PURE__ */ b(["update:modelValue", "update:validModelValue", "update:placeholder", "update:startValue"], ["update:modelValue"]),
|
|
56
56
|
setup(e, { emit: v }) {
|
|
57
57
|
const c = k(e, "modelValue"), V = w(e, v);
|
|
58
|
-
return (W, g) => (
|
|
58
|
+
return (W, g) => (a(), n(E, x(f(V), {
|
|
59
59
|
modelValue: c.value,
|
|
60
|
-
"onUpdate:modelValue": g[0] || (g[0] = (
|
|
60
|
+
"onUpdate:modelValue": g[0] || (g[0] = (m) => c.value = m),
|
|
61
61
|
"number-of-months": e.numberOfMonths,
|
|
62
62
|
class: [{ "calendar--vertical": e.orientation === "vertical" }],
|
|
63
63
|
style: {
|
|
@@ -65,14 +65,14 @@ const L = {
|
|
|
65
65
|
position: "relative"
|
|
66
66
|
}
|
|
67
67
|
}), {
|
|
68
|
-
default:
|
|
69
|
-
|
|
68
|
+
default: t(({ grid: m, weekDays: M }) => [
|
|
69
|
+
l(G, {
|
|
70
70
|
style: O({
|
|
71
71
|
gridColumn: e.orientation === "vertical" ? "span 1" : `span ${e.numberOfMonths}`
|
|
72
72
|
})
|
|
73
73
|
}, {
|
|
74
|
-
default:
|
|
75
|
-
|
|
74
|
+
default: t(() => [
|
|
75
|
+
l(j, {
|
|
76
76
|
class: y([
|
|
77
77
|
"button-prev",
|
|
78
78
|
{
|
|
@@ -80,8 +80,8 @@ const L = {
|
|
|
80
80
|
}
|
|
81
81
|
])
|
|
82
82
|
}, null, 8, ["class"]),
|
|
83
|
-
e.orientation === "horizontal" || e.numberOfMonths === 1 ? (
|
|
84
|
-
|
|
83
|
+
e.orientation === "horizontal" || e.numberOfMonths === 1 ? (a(), n(Y, { key: 0 })) : p("", !0),
|
|
84
|
+
l(T, {
|
|
85
85
|
class: y([
|
|
86
86
|
"button-next",
|
|
87
87
|
{
|
|
@@ -92,18 +92,18 @@ const L = {
|
|
|
92
92
|
]),
|
|
93
93
|
_: 1
|
|
94
94
|
}, 8, ["style"]),
|
|
95
|
-
(
|
|
96
|
-
key:
|
|
95
|
+
(a(!0), o(u, null, d(m, (r) => (a(), n($, {
|
|
96
|
+
key: r.value.toString()
|
|
97
97
|
}, {
|
|
98
|
-
default:
|
|
99
|
-
e.orientation === "vertical" && e.numberOfMonths > 1 ? (
|
|
100
|
-
|
|
101
|
-
default:
|
|
102
|
-
|
|
103
|
-
default:
|
|
104
|
-
(
|
|
105
|
-
default:
|
|
106
|
-
D(C(
|
|
98
|
+
default: t(() => [
|
|
99
|
+
e.orientation === "vertical" && e.numberOfMonths > 1 ? (a(), o("span", L, C(f(H)(r.value.toString()).format("MMMM, YYYY")), 1)) : p("", !0),
|
|
100
|
+
l(f(S), null, {
|
|
101
|
+
default: t(() => [
|
|
102
|
+
l(h, null, {
|
|
103
|
+
default: t(() => [
|
|
104
|
+
(a(!0), o(u, null, d(M, (i) => (a(), n(F, { key: i }, {
|
|
105
|
+
default: t(() => [
|
|
106
|
+
D(C(i), 1)
|
|
107
107
|
]),
|
|
108
108
|
_: 2
|
|
109
109
|
}, 1024))), 128))
|
|
@@ -113,20 +113,20 @@ const L = {
|
|
|
113
113
|
]),
|
|
114
114
|
_: 2
|
|
115
115
|
}, 1024),
|
|
116
|
-
|
|
117
|
-
default:
|
|
118
|
-
(
|
|
116
|
+
l(z, null, {
|
|
117
|
+
default: t(() => [
|
|
118
|
+
(a(!0), o(u, null, d(r.rows, (i, R) => (a(), n(h, {
|
|
119
119
|
key: `weekDate-${R}`
|
|
120
120
|
}, {
|
|
121
|
-
default:
|
|
122
|
-
(
|
|
123
|
-
key:
|
|
124
|
-
date:
|
|
121
|
+
default: t(() => [
|
|
122
|
+
(a(!0), o(u, null, d(i, (s) => (a(), n(N, {
|
|
123
|
+
key: s.toString(),
|
|
124
|
+
date: s
|
|
125
125
|
}, {
|
|
126
|
-
default:
|
|
127
|
-
|
|
128
|
-
day:
|
|
129
|
-
month:
|
|
126
|
+
default: t(() => [
|
|
127
|
+
l(P, {
|
|
128
|
+
day: s,
|
|
129
|
+
month: r.value
|
|
130
130
|
}, null, 8, ["day", "month"])
|
|
131
131
|
]),
|
|
132
132
|
_: 2
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.checkbox[data-v-
|
|
1
|
+
.checkbox-v2[data-v-b2ea32b4]{--checkbox-color:var(--theme-neutral-border-default);cursor:pointer;align-items:flex-start;gap:.5rem;display:inline-flex}.checkbox-v2__input[data-v-b2ea32b4]{clip-path:inset(50%);white-space:nowrap;border:0;width:.0625rem;height:.0625rem;margin:-.0625rem;padding:0;position:absolute;overflow:hidden}.checkbox-v2__box[data-v-b2ea32b4]{width:1.25rem;height:1.25rem;color:var(--theme-neutral-0);border:.0625rem solid var(--checkbox-color);transition:background-color var(--animation-duration-fast) ease, border-color var(--animation-duration-fast) ease, outline-color var(--animation-duration-fast) ease;border-radius:.3125rem;flex-shrink:0;justify-content:center;align-items:center;display:flex}.checkbox-v2__mark[data-v-b2ea32b4]{width:100%;height:100%}.checkbox-v2__text[data-v-b2ea32b4]{flex-direction:column;gap:.25rem;min-width:0;display:flex}.checkbox-v2__label[data-v-b2ea32b4]{color:var(--theme-neutral-text-title);overflow-wrap:break-word;font-size:.875rem;font-weight:400;line-height:1.25rem}.checkbox-v2__description[data-v-b2ea32b4]{color:var(--theme-neutral-text-caption);overflow-wrap:break-word;font-size:1rem;font-weight:400;line-height:1.25rem}.checkbox-v2[data-v-b2ea32b4]:not(:has(.checkbox-v2__description)){align-items:center}.checkbox-v2--icon-right[data-v-b2ea32b4]{flex-direction:row-reverse}.checkbox-v2--checked .checkbox-v2__box[data-v-b2ea32b4]{background-color:var(--checkbox-color)}.checkbox-v2--checked[data-v-b2ea32b4]{--checkbox-color:var(--theme-primary-500)}.checkbox-v2[data-v-b2ea32b4]:hover:not(.checkbox-v2--disabled){--checkbox-color:var(--theme-primary-300)}.checkbox-v2[data-v-b2ea32b4]:has(.checkbox-v2__input:focus-visible){--checkbox-color:var(--theme-primary-300)}.checkbox-v2:has(.checkbox-v2__input:focus-visible) .checkbox-v2__box[data-v-b2ea32b4]{outline:.0625rem solid var(--theme-primary-300);outline-offset:.125rem}.checkbox-v2[data-v-b2ea32b4]:active:not(.checkbox-v2--disabled){--checkbox-color:var(--theme-primary-700)}.checkbox-v2--disabled[data-v-b2ea32b4]{--checkbox-color:var(--theme-neutral-surface-disabled);cursor:not-allowed;opacity:.5}.checkbox-v2--disabled .checkbox-v2__label[data-v-b2ea32b4]{color:var(--theme-neutral-400)}.checkbox-v2--disabled.checkbox-v2--checked[data-v-b2ea32b4]{--checkbox-color:var(--theme-neutral-icon-disabled)}
|
|
@@ -2,7 +2,7 @@ import './Checkbox.css';
|
|
|
2
2
|
import o from "./Checkbox.vue2.js";
|
|
3
3
|
/* empty css */
|
|
4
4
|
import t from "../../../_virtual/_plugin-vue_export-helper.js";
|
|
5
|
-
const
|
|
5
|
+
const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-b2ea32b4"]]);
|
|
6
6
|
export {
|
|
7
|
-
|
|
7
|
+
m as default
|
|
8
8
|
};
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import { defineComponent as $, useModel as x, useSlots as R, useId as T, useTemplateRef as E, computed as n, watchEffect as N, openBlock as l, createElementBlock as o, mergeProps as d, unref as c, createElementVNode as
|
|
1
|
+
import { defineComponent as $, useModel as x, useSlots as R, useId as T, useTemplateRef as E, computed as n, watchEffect as N, openBlock as l, createElementBlock as o, mergeProps as d, unref as c, createElementVNode as v, createCommentVNode as f, renderSlot as y, createTextVNode as g, toDisplayString as w, mergeModels as L } from "vue";
|
|
2
2
|
import { useTestId as P } from "../shared/useTestId.util.js";
|
|
3
3
|
const S = ["for"], D = ["id", "name", "value", "checked", "disabled", "aria-label", "aria-labelledby"], A = {
|
|
4
4
|
key: 0,
|
|
5
|
-
class: "
|
|
5
|
+
class: "checkbox-v2__mark",
|
|
6
6
|
viewBox: "0 0 20 20",
|
|
7
7
|
fill: "none",
|
|
8
8
|
xmlns: "http://www.w3.org/2000/svg"
|
|
9
9
|
}, H = {
|
|
10
10
|
key: 1,
|
|
11
|
-
class: "
|
|
11
|
+
class: "checkbox-v2__mark",
|
|
12
12
|
viewBox: "0 0 20 20",
|
|
13
13
|
fill: "none",
|
|
14
14
|
xmlns: "http://www.w3.org/2000/svg"
|
|
15
15
|
}, Z = {
|
|
16
16
|
key: 0,
|
|
17
|
-
class: "
|
|
17
|
+
class: "checkbox-v2__text"
|
|
18
18
|
}, z = /* @__PURE__ */ $({
|
|
19
19
|
inheritAttrs: !1,
|
|
20
20
|
__name: "Checkbox",
|
|
@@ -37,18 +37,18 @@ const S = ["for"], D = ["id", "name", "value", "checked", "disabled", "aria-labe
|
|
|
37
37
|
}),
|
|
38
38
|
emits: /* @__PURE__ */ L(["change"], ["update:modelValue", "update:indeterminate"]),
|
|
39
39
|
setup(e, { emit: B }) {
|
|
40
|
-
const t = e, C = B, u = x(e, "modelValue"), r = x(e, "indeterminate"),
|
|
41
|
-
() => !!(t.description ||
|
|
40
|
+
const t = e, C = B, u = x(e, "modelValue"), r = x(e, "indeterminate"), h = R(), i = P(() => t.testId), V = T(), b = E("inputRef"), m = n(() => t.id ?? `${V}-checkbox`), k = n(() => !!(t.label || h.default)), p = n(
|
|
41
|
+
() => !!(t.description || h.description)
|
|
42
42
|
), I = n(() => k.value || p.value), M = n(() => [
|
|
43
|
-
"checkbox",
|
|
44
|
-
`checkbox--icon-${t.iconPosition}`,
|
|
43
|
+
"checkbox-v2",
|
|
44
|
+
`checkbox-v2--icon-${t.iconPosition}`,
|
|
45
45
|
{
|
|
46
|
-
"checkbox--checked": u.value || r.value,
|
|
47
|
-
"checkbox--disabled": t.disabled
|
|
46
|
+
"checkbox-v2--checked": u.value || r.value,
|
|
47
|
+
"checkbox-v2--disabled": t.disabled
|
|
48
48
|
}
|
|
49
49
|
]);
|
|
50
50
|
N(() => {
|
|
51
|
-
|
|
51
|
+
b.value && (b.value.indeterminate = r.value);
|
|
52
52
|
});
|
|
53
53
|
function _(s) {
|
|
54
54
|
if (t.disabled) return;
|
|
@@ -57,14 +57,14 @@ const S = ["for"], D = ["id", "name", "value", "checked", "disabled", "aria-labe
|
|
|
57
57
|
}
|
|
58
58
|
return (s, a) => (l(), o("label", d({
|
|
59
59
|
class: M.value,
|
|
60
|
-
for:
|
|
60
|
+
for: m.value
|
|
61
61
|
}, c(i)("root")), [
|
|
62
|
-
|
|
63
|
-
id:
|
|
62
|
+
v("input", d({
|
|
63
|
+
id: m.value,
|
|
64
64
|
ref_key: "inputRef",
|
|
65
|
-
ref:
|
|
65
|
+
ref: b,
|
|
66
66
|
type: "checkbox",
|
|
67
|
-
class: "
|
|
67
|
+
class: "checkbox-v2__input",
|
|
68
68
|
name: e.name,
|
|
69
69
|
value: e.value,
|
|
70
70
|
checked: u.value,
|
|
@@ -72,41 +72,41 @@ const S = ["for"], D = ["id", "name", "value", "checked", "disabled", "aria-labe
|
|
|
72
72
|
"aria-label": e.ariaLabel,
|
|
73
73
|
"aria-labelledby": e.ariaLabelledby
|
|
74
74
|
}, { ...s.$attrs, ...c(i)("input") }, { onChange: _ }), null, 16, D),
|
|
75
|
-
|
|
76
|
-
class: "
|
|
75
|
+
v("span", d({
|
|
76
|
+
class: "checkbox-v2__box",
|
|
77
77
|
"aria-hidden": "true"
|
|
78
78
|
}, c(i)("box")), [
|
|
79
79
|
r.value ? (l(), o("svg", A, [...a[0] || (a[0] = [
|
|
80
|
-
|
|
80
|
+
v("path", {
|
|
81
81
|
d: "M4 10H16",
|
|
82
82
|
stroke: "currentColor",
|
|
83
83
|
"stroke-width": "2"
|
|
84
84
|
}, null, -1)
|
|
85
85
|
])])) : u.value ? (l(), o("svg", H, [...a[1] || (a[1] = [
|
|
86
|
-
|
|
86
|
+
v("path", {
|
|
87
87
|
d: "M8.13636 13.70149L5.03409 10.25373L4 11.40299L8.13636 16L17 6.14925L15.9659 5L8.13636 13.70149Z",
|
|
88
88
|
fill: "currentColor"
|
|
89
89
|
}, null, -1)
|
|
90
|
-
])])) :
|
|
90
|
+
])])) : f("", !0)
|
|
91
91
|
], 16),
|
|
92
92
|
I.value ? (l(), o("span", Z, [
|
|
93
93
|
k.value ? (l(), o("span", d({
|
|
94
94
|
key: 0,
|
|
95
|
-
class: "
|
|
95
|
+
class: "checkbox-v2__label"
|
|
96
96
|
}, c(i)("label")), [
|
|
97
97
|
y(s.$slots, "default", {}, () => [
|
|
98
98
|
g(w(e.label), 1)
|
|
99
99
|
], !0)
|
|
100
|
-
], 16)) :
|
|
100
|
+
], 16)) : f("", !0),
|
|
101
101
|
p.value ? (l(), o("span", d({
|
|
102
102
|
key: 1,
|
|
103
|
-
class: "
|
|
103
|
+
class: "checkbox-v2__description"
|
|
104
104
|
}, c(i)("description")), [
|
|
105
105
|
y(s.$slots, "description", {}, () => [
|
|
106
106
|
g(w(e.description), 1)
|
|
107
107
|
], !0)
|
|
108
|
-
], 16)) :
|
|
109
|
-
])) :
|
|
108
|
+
], 16)) : f("", !0)
|
|
109
|
+
])) : f("", !0)
|
|
110
110
|
], 16, S));
|
|
111
111
|
}
|
|
112
112
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.combobox[data-v-
|
|
1
|
+
.combobox[data-v-a7d76bc3]{--combobox-field-height:2.5rem;--combobox-field-radius:.5rem;--combobox-font-size:.875rem;--combobox-line-height:1.25rem;--combobox-label-font-size:.875rem;--combobox-label-line-height:1rem;--combobox-border-color:var(--theme-neutral-border-default);flex-direction:column;display:flex}.combobox--small[data-v-a7d76bc3]{--combobox-field-height:2.25rem;--combobox-label-font-size:.75rem}.combobox--large[data-v-a7d76bc3]{--combobox-field-height:2.75rem;--combobox-field-radius:.75rem;--combobox-font-size:1rem;--combobox-line-height:1.5rem;--combobox-label-font-size:1rem;--combobox-label-line-height:1.25rem}.combobox__label[data-v-a7d76bc3]{font-weight:400;font-size:var(--combobox-label-font-size);line-height:var(--combobox-label-line-height);color:var(--theme-neutral-text-title);cursor:pointer;padding:.375rem .5rem}.combobox__field[data-v-a7d76bc3]{min-height:var(--combobox-field-height);background-color:var(--theme-neutral-0);border:.0625rem solid var(--combobox-border-color);border-radius:var(--combobox-field-radius);cursor:text;transition:border-color var(--animation-duration-fast) ease;align-items:center;gap:.25rem;padding:.25rem .5rem;display:flex}.combobox__content[data-v-a7d76bc3]{flex:auto;align-items:center;gap:.25rem;min-width:0;display:flex}.combobox__input[data-v-a7d76bc3]{min-width:2rem;font-family:inherit;font-weight:400;font-size:var(--combobox-font-size);line-height:var(--combobox-line-height);color:var(--theme-neutral-text-body);text-overflow:ellipsis;background:0 0;border:none;outline:none;flex:4rem;order:3;padding:0}@media (max-width:1009.98px){.combobox__input[data-v-a7d76bc3]{font-size:1rem}}.combobox__input[data-v-a7d76bc3]::placeholder{color:var(--theme-neutral-550)}.combobox__input[data-v-a7d76bc3]:disabled{color:var(--theme-neutral-text-disabled);cursor:not-allowed}.combobox__input[data-v-a7d76bc3]:disabled::placeholder{color:var(--theme-neutral-text-disabled)}.combobox__input[data-v-a7d76bc3]:read-only{cursor:pointer}.combobox__chips[data-v-a7d76bc3]{flex:0 auto;order:1;align-items:center;gap:.25rem;min-width:0;display:flex;overflow:hidden}.combobox__chip[data-v-a7d76bc3]{max-width:100%;height:1.125rem;color:var(--theme-neutral-text-subtitle);background-color:var(--theme-neutral-surface-icon);border-radius:.375rem;flex-shrink:0;align-items:center;gap:.5rem;padding:0 .375rem;font-size:.75rem;font-weight:400;line-height:1rem;display:flex}.combobox__chip-label[data-v-a7d76bc3]{white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.combobox__chip-remove[data-v-a7d76bc3]{color:var(--theme-neutral-icon-caption);cursor:pointer;transition:color var(--animation-duration-fast) ease;background:0 0;border:none;align-items:center;margin:0;padding:0;display:flex}.combobox__chip-remove[data-v-a7d76bc3]:hover:not(:disabled){color:var(--theme-neutral-text-body)}.combobox__chip-remove[data-v-a7d76bc3]:focus-visible{outline:.125rem solid var(--theme-primary-500);outline-offset:.125rem}.combobox__chip-remove[data-v-a7d76bc3]:disabled{cursor:not-allowed}.combobox__chip-icon[data-v-a7d76bc3],.combobox__chip-avatar[data-v-a7d76bc3]{flex-shrink:0;width:.75rem;height:.75rem}.combobox__chip-avatar[data-v-a7d76bc3]{object-fit:cover;border-radius:50%}.combobox__chip--measured[data-v-a7d76bc3]{visibility:hidden;pointer-events:none;position:absolute;top:0;left:-9999px}.combobox__chip--counter[data-v-a7d76bc3]{color:var(--theme-neutral-text-caption);flex-shrink:0;order:2}.combobox__clear-button[data-v-a7d76bc3]{color:var(--theme-neutral-icon-caption);cursor:pointer;transition:color var(--animation-duration-fast) ease;background:0 0;border:none;flex-shrink:0;align-items:center;margin:0;padding:0;display:flex}.combobox__clear-button[data-v-a7d76bc3]:hover{color:var(--theme-neutral-text-body)}.combobox__clear-button[data-v-a7d76bc3]:focus-visible{outline:2px solid var(--theme-primary-500);outline-offset:2px}.combobox__clear[data-v-a7d76bc3]{width:1rem;height:1rem}.combobox__arrow-button[data-v-a7d76bc3]{cursor:pointer;background:0 0;border:none;flex-shrink:0;align-items:center;margin:0;padding:0;display:flex}.combobox__arrow-button[data-v-a7d76bc3]:disabled{cursor:not-allowed}.combobox__arrow[data-v-a7d76bc3]{width:1.125rem;height:1.125rem;color:var(--theme-neutral-text-body);transition:transform var(--animation-duration-fast) ease}.combobox__message[data-v-a7d76bc3]{color:var(--theme-neutral-text-body);margin:0;padding:.25rem .5rem;font-size:.625rem;font-weight:400;line-height:1.2}.combobox[data-v-a7d76bc3]:hover:not(.combobox--disabled){--combobox-border-color:var(--theme-primary-300)}.combobox--open[data-v-a7d76bc3],.combobox--open[data-v-a7d76bc3]:hover{--combobox-border-color:var(--theme-primary-500)}.combobox--open .combobox__arrow[data-v-a7d76bc3]{transform:rotate(180deg)}.combobox--invalid[data-v-a7d76bc3]{--combobox-border-color:var(--theme-error-500)}.combobox--invalid .combobox__label[data-v-a7d76bc3],.combobox--invalid .combobox__message[data-v-a7d76bc3]{color:var(--theme-error-500)}.combobox--invalid[data-v-a7d76bc3]:hover:not(.combobox--disabled){--combobox-border-color:var(--theme-error-500)}.combobox--disabled[data-v-a7d76bc3]{--combobox-border-color:var(--theme-neutral-border-disabled)}.combobox--disabled .combobox__field[data-v-a7d76bc3]{cursor:not-allowed}.combobox--disabled .combobox__label[data-v-a7d76bc3],.combobox--disabled .combobox__message[data-v-a7d76bc3],.combobox--disabled .combobox__arrow[data-v-a7d76bc3]{color:var(--theme-neutral-text-disabled)}.combobox--disabled .combobox__label[data-v-a7d76bc3]{cursor:not-allowed}.combobox__field[data-v-a7d76bc3]:has(.combobox__input:focus-visible){outline:.125rem solid var(--theme-primary-500);outline-offset:.125rem}.combobox-list[data-v-a7d76bc3]{flex-direction:column;display:flex}.combobox-list__search[data-v-a7d76bc3]{padding:.5rem .5rem 0}.combobox-list__scroll[data-v-a7d76bc3]{max-height:15rem;overflow-y:auto}.combobox-list__options[data-v-a7d76bc3]{flex-direction:column;gap:.5rem;height:max-content;padding:.5rem;display:flex}.combobox-list__option[data-v-a7d76bc3]{width:100%;min-height:2rem;color:var(--theme-neutral-text-title);text-align:left;cursor:pointer;transition:background-color var(--animation-duration-fast) ease;background-color:#0000;border-radius:.5rem;align-items:flex-start;gap:.5rem;padding:.375rem .5rem;font-size:.875rem;font-weight:400;line-height:1.25rem;display:flex}.combobox-list__option[data-v-a7d76bc3]:hover:not(.combobox-list__option--disabled),.combobox-list__option--active[data-v-a7d76bc3]{background-color:var(--theme-secondary-50)}.combobox-list__option--disabled[data-v-a7d76bc3]{cursor:not-allowed;opacity:.5}.combobox-list__label[data-v-a7d76bc3]{white-space:nowrap;text-overflow:ellipsis;flex:auto;min-width:0;overflow:hidden}.combobox-list__status[data-v-a7d76bc3]{color:var(--theme-neutral-text-caption);margin:0;padding:.25rem .5rem;font-size:.875rem;line-height:1.25rem}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Component } from 'vue';
|
|
1
|
+
import { Component, VNodeChild } from 'vue';
|
|
2
2
|
import { TBreakpoints } from '../../../types/global.types';
|
|
3
3
|
import { PopoverAlign, PopoverSide } from '../Popover';
|
|
4
4
|
export type ComboboxSize = 'small' | 'default' | 'large';
|
|
@@ -12,8 +12,54 @@ export interface ComboboxOptionData {
|
|
|
12
12
|
/** Картинка 12×12 (аватар) перед подписью выбранного значения. */
|
|
13
13
|
avatar?: string;
|
|
14
14
|
}
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
/**
|
|
16
|
+
* Слоты перекрывают то, что компонент рисует по данным варианта: сначала
|
|
17
|
+
* проверяется слот, и только без него в дело идёт `label` и тексты из пропов.
|
|
18
|
+
*
|
|
19
|
+
* Параметр `T` — тип варианта у потребителя. Он же приезжает в слот, поэтому
|
|
20
|
+
* из разметки видны собственные поля данных (ИНН, адрес), а не только
|
|
21
|
+
* `ComboboxOptionData`.
|
|
22
|
+
*/
|
|
23
|
+
export interface ComboboxSlots<T extends ComboboxOptionData = ComboboxOptionData> {
|
|
24
|
+
/**
|
|
25
|
+
* Строка списка. Маркер выбора остаётся снаружи слота — он часть
|
|
26
|
+
* механики выбора, а не содержимого варианта.
|
|
27
|
+
*
|
|
28
|
+
* Внутри `role="option"`, поэтому интерактивные элементы (кнопки, ссылки,
|
|
29
|
+
* поля) сюда класть нельзя: скринридер до них не доберётся.
|
|
30
|
+
*/
|
|
31
|
+
option?: (props: {
|
|
32
|
+
option: T;
|
|
33
|
+
/** Вариант входит в текущее значение. */
|
|
34
|
+
selected: boolean;
|
|
35
|
+
/** Строка под курсором или выбрана с клавиатуры. */
|
|
36
|
+
active: boolean;
|
|
37
|
+
index: number;
|
|
38
|
+
}) => VNodeChild;
|
|
39
|
+
/**
|
|
40
|
+
* Содержимое чипа выбранного значения при `multiple`. Кнопка «убрать»
|
|
41
|
+
* остаётся снаружи — без неё значение нечем снять.
|
|
42
|
+
*
|
|
43
|
+
* Ширину чипов компонент меряет, чтобы спрятать лишние за счётчик «+n»:
|
|
44
|
+
* содержимое переменной ширины это переживает, а вот `width` в процентах
|
|
45
|
+
* внутри слота меряться будет не от того.
|
|
46
|
+
*/
|
|
47
|
+
chip?: (props: {
|
|
48
|
+
option: T;
|
|
49
|
+
index: number;
|
|
50
|
+
}) => VNodeChild;
|
|
51
|
+
/**
|
|
52
|
+
* Пустой список. `notFound` разделяет два случая: вариантов нет вовсе
|
|
53
|
+
* (`false`) или ни один не подошёл под запрос (`true`).
|
|
54
|
+
*/
|
|
55
|
+
empty?: (props: {
|
|
56
|
+
notFound: boolean;
|
|
57
|
+
}) => VNodeChild;
|
|
58
|
+
/** Строка загрузки при `loading`. Прежние варианты остаются под ней. */
|
|
59
|
+
loading?: () => VNodeChild;
|
|
60
|
+
}
|
|
61
|
+
export interface ComboboxProps<T extends ComboboxOptionData = ComboboxOptionData> {
|
|
62
|
+
options: T[];
|
|
17
63
|
/** Множественный выбор: список не закрывается, значения показываются чипами. */
|
|
18
64
|
multiple?: boolean;
|
|
19
65
|
/**
|
|
@@ -39,6 +85,20 @@ export interface ComboboxProps {
|
|
|
39
85
|
invalid?: boolean;
|
|
40
86
|
size?: ComboboxSize;
|
|
41
87
|
disabled?: boolean;
|
|
88
|
+
/**
|
|
89
|
+
* Не раскрывать список, пока показывать нечего: ни вариантов, ни загрузки.
|
|
90
|
+
* Пригодится серверному поиску, где до первого запроса список пуст и пустая
|
|
91
|
+
* плашка только мешает.
|
|
92
|
+
*
|
|
93
|
+
* Внутреннее состояние «открыт» при этом сохраняется: как только придут
|
|
94
|
+
* варианты или включится `loading`, список раскроется сам, без повторного
|
|
95
|
+
* клика. По умолчанию выключено — пустое состояние со своим текстом и слотом
|
|
96
|
+
* `empty` остаётся штатным поведением.
|
|
97
|
+
*
|
|
98
|
+
* На мобильных не действует: там поле поиска живёт внутри шторки, и, спрятав
|
|
99
|
+
* её, запрос было бы негде набрать.
|
|
100
|
+
*/
|
|
101
|
+
hideEmptyList?: boolean;
|
|
42
102
|
/** Текст пустого списка, когда вариантов нет вовсе. */
|
|
43
103
|
emptyText?: string;
|
|
44
104
|
/** Текст пустого списка, когда под запрос ничего не подошло. */
|