@studio-west/component-sw 0.11.18 → 0.11.19
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/SwAlert-BN8mwcp_.js +89 -0
- package/dist/SwButton-B6iaLa_y.js +45 -0
- package/dist/SwButtonGroup-Dmsbam44.js +59 -0
- package/dist/SwCollapse-Dy2XxzJg.js +31 -0
- package/dist/SwDatePicker-CNGIsEmm.js +262 -0
- package/dist/SwDropdown-DMkEn-su.js +114 -0
- package/dist/SwDropdownItem-CscV8R77.js +36 -0
- package/dist/SwDropdownNew-TXu5V6xZ.js +107 -0
- package/dist/SwFormItem-DQJohClb.js +24 -0
- package/dist/SwGide-9v0z3Y49.js +125 -0
- package/dist/SwIcon-0PtPyq2k.js +35 -0
- package/dist/SwInput-fqZBIN92.js +102 -0
- package/dist/SwMessage-BvvbQ1cP.js +55 -0
- package/dist/SwSection-fNuXuePo.js +32 -0
- package/dist/SwSelect-CuBxoXju.js +1594 -0
- package/dist/SwSkeleton-DIwAcNfp.js +28 -0
- package/dist/SwSkeletonItem-D3Wjgl7J.js +35 -0
- package/dist/SwSlider-CyLU7COn.js +179 -0
- package/dist/SwSwitch-DluxsVEW.js +56 -0
- package/dist/SwTable-D5v0TIuo.js +133 -0
- package/dist/SwTableColumn-CCqBUIhN.js +28 -0
- package/dist/SwTabs-zHhFxzck.js +32 -0
- package/dist/SwTabsPane-BY5KEs_h.js +36 -0
- package/dist/component-sw.css +2 -1
- package/dist/index.cjs +6 -6
- package/dist/index.js +58 -7
- package/dist/utils-CGgSSFR1.js +52 -0
- package/package.json +1 -1
- package/src/components/SwButton.vue +1 -0
- package/src/components/SwButtonGroup.vue +1 -0
- package/src/components/SwTable.vue +14 -5
- package/dist/SwButton-yS_tKW9w.js +0 -4
- package/dist/SwButton.vue_vue_type_script_setup_true_lang-aODPwFa6.js +0 -34
- package/dist/SwButtonGroup-D9HH5POO.js +0 -49
- package/dist/SwCollapse-CuN3EbT6.js +0 -33
- package/dist/SwDatePicker-DHP73Q1c.js +0 -366
- package/dist/SwDropdown-DQGTnnKw.js +0 -111
- package/dist/SwDropdownItem-Cua7E0JN.js +0 -31
- package/dist/SwDropdownNew-CYfjZFd2.js +0 -107
- package/dist/SwFormItem-CaA4jsoa.js +0 -24
- package/dist/SwGide-BcLOtvRd.js +0 -138
- package/dist/SwInput-m4LDJuNs.js +0 -90
- package/dist/SwMessage-yOG9UmvF.js +0 -57
- package/dist/SwSection-CQe2kE0O.js +0 -34
- package/dist/SwSelect-BxbCfof-.js +0 -1883
- package/dist/SwSkeleton-B7ysp8L9.js +0 -26
- package/dist/SwSkeletonItem-CU7LvihY.js +0 -29
- package/dist/SwSlider--meCHr2D.js +0 -158
- package/dist/SwSwitch-DeMdyD0-.js +0 -47
- package/dist/SwTable-BSCqB4nS.js +0 -156
- package/dist/SwTableColumn-BLF5bPuJ.js +0 -28
- package/dist/SwTabs-DkSI4oAh.js +0 -38
- package/dist/SwTabsPane-Dwtj8g7T.js +0 -38
- package/dist/index-DX9QZTeL.js +0 -188
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import { Teleport as e, computed as t, createBlock as n, createCommentVNode as r, createElementBlock as i, mergeModels as a, normalizeClass as o, normalizeStyle as s, onMounted as c, onUnmounted as l, openBlock as u, ref as d, renderSlot as f, unref as p, useModel as m, watchEffect as h, withModifiers as g } from "vue";
|
|
2
|
+
//#region src/components/SwDropdownNew.vue
|
|
3
|
+
var _ = ["id"], v = {
|
|
4
|
+
__name: "SwDropdownNew",
|
|
5
|
+
props: /* @__PURE__ */ a({
|
|
6
|
+
class: {
|
|
7
|
+
type: String,
|
|
8
|
+
default: ""
|
|
9
|
+
},
|
|
10
|
+
type: {
|
|
11
|
+
type: String,
|
|
12
|
+
default: ""
|
|
13
|
+
},
|
|
14
|
+
trigger: {
|
|
15
|
+
type: String,
|
|
16
|
+
default: "click"
|
|
17
|
+
},
|
|
18
|
+
placement: {
|
|
19
|
+
type: String,
|
|
20
|
+
default: "bottom-left"
|
|
21
|
+
},
|
|
22
|
+
maxWidth: {
|
|
23
|
+
type: Number,
|
|
24
|
+
default: 0
|
|
25
|
+
}
|
|
26
|
+
}, {
|
|
27
|
+
modelValue: {},
|
|
28
|
+
modelModifiers: {}
|
|
29
|
+
}),
|
|
30
|
+
emits: ["update:modelValue"],
|
|
31
|
+
setup(a, { expose: v }) {
|
|
32
|
+
let y = a, b = m(a, "modelValue"), x = d(null), S = d(null), C = d({}), w = Math.ceil(Math.random() * 1e3), T = d(0), E = t(() => {
|
|
33
|
+
let e = ["sw-dropdown"];
|
|
34
|
+
return y.type.length > 0 && e.push("sw-" + y.type), e;
|
|
35
|
+
}), D = new ResizeObserver(() => {
|
|
36
|
+
b.value && T.value++, T.value > 99 && (T.value = 1);
|
|
37
|
+
});
|
|
38
|
+
h(() => {
|
|
39
|
+
if (!b.value || !S.value || !x.value) return;
|
|
40
|
+
T.value < 2 && D.observe(S.value);
|
|
41
|
+
let e = window.pageYOffset || document.documentElement.scrollTop, t = window.pageXOffset || document.documentElement.scrollLeft;
|
|
42
|
+
document.body.style.position = "fixed", document.body.style.top = `-${e}px`, document.body.style.left = `-${t}px`, document.body.style.position = "", document.body.style.top = "", document.body.style.left = "", document.documentElement.scrollTop = e, document.documentElement.scrollLeft = t;
|
|
43
|
+
let n = x.value.getBoundingClientRect(), r = window.innerWidth, i = window.innerHeight, a = S.value.offsetHeight, o = S.value.offsetWidth, s = n.left + n.width / 2 + t, c = n.top + n.height / 2 + e, l = n.height / 2 + 8, [u, d] = y.placement.split("-", 2);
|
|
44
|
+
switch (u) {
|
|
45
|
+
case "bottom":
|
|
46
|
+
c = e + i - a - l - 8 < c ? c - l - a : c + l, d === void 0 && (s -= o / 2);
|
|
47
|
+
break;
|
|
48
|
+
case "top":
|
|
49
|
+
c = e + a + l + 8 > c ? c + l : c - l - a, d === void 0 && (s -= o / 2);
|
|
50
|
+
break;
|
|
51
|
+
case "left":
|
|
52
|
+
s - o - n.width / 2 - 8 < 0 ? s + n.width / 2 + 8 + o < r ? (s = s + n.width / 2 + 8, c -= a / 2) : (c = e + a + l + 8 > c ? c + l : c - l - a, s = s + n.width / 2 < r ? s + n.width / 2 - o : s - o / 2) : (s = s - o - n.width / 2 - 8, c -= a / 2);
|
|
53
|
+
break;
|
|
54
|
+
case "right":
|
|
55
|
+
s + n.width / 2 + 8 + o > r ? s - o - n.width / 2 - 8 > 0 ? (s = s - o - n.width / 2 - 8, c -= a / 2) : (c = e + a + l + 8 > c ? c + l : c - l - a, s -= n.width / 2) : (s = s + n.width / 2 + 8, c -= a / 2);
|
|
56
|
+
break;
|
|
57
|
+
}
|
|
58
|
+
switch (d) {
|
|
59
|
+
case "left":
|
|
60
|
+
s = t + r - 8 > s - n.width / 2 + o ? s - n.width / 2 : s - o + n.width / 2;
|
|
61
|
+
break;
|
|
62
|
+
case "right":
|
|
63
|
+
s = 8 < s + n.width / 2 - o ? s - o + n.width / 2 : s - n.width / 2;
|
|
64
|
+
break;
|
|
65
|
+
}
|
|
66
|
+
s < 0 && (s = 0), c < 0 && (c = 0), C.value = {
|
|
67
|
+
position: "absolute",
|
|
68
|
+
top: `${c}px`,
|
|
69
|
+
left: `${s}px`,
|
|
70
|
+
maxWidth: y.maxWidth > 0 ? `${y.maxWidth}px` : ""
|
|
71
|
+
};
|
|
72
|
+
}, { flush: "post" });
|
|
73
|
+
let O = () => {
|
|
74
|
+
y.trigger === "click" && (b.value = !b.value);
|
|
75
|
+
}, k = () => {
|
|
76
|
+
y.trigger === "hover" && (b.value = !b.value);
|
|
77
|
+
}, A = () => {
|
|
78
|
+
y.trigger === "context" && (b.value = !b.value);
|
|
79
|
+
}, j = () => {
|
|
80
|
+
b.value && T.value++, T.value > 99 && (T.value = 1);
|
|
81
|
+
};
|
|
82
|
+
return v({ handleResize: j }), c(() => {
|
|
83
|
+
window.addEventListener("resize", j), window.onscrollend === void 0 ? window.addEventListener("scroll", j) : window.addEventListener("scrollend", j);
|
|
84
|
+
}), l(() => {
|
|
85
|
+
D.disconnect(), window.removeEventListener("resize", j), window.onscrollend === void 0 ? window.removeEventListener("scroll", j) : window.removeEventListener("scrollend", j);
|
|
86
|
+
}), (t, a) => (u(), i("div", {
|
|
87
|
+
class: o(E.value),
|
|
88
|
+
onClick: a[0] ||= (e) => O(),
|
|
89
|
+
onMouseover: a[1] ||= g((e) => k(), ["stop"]),
|
|
90
|
+
onMouseleave: a[2] ||= g((e) => k(), ["stop"]),
|
|
91
|
+
onContextmenu: a[3] ||= g((e) => A(), ["stop"]),
|
|
92
|
+
ref_key: "dropdownRef",
|
|
93
|
+
ref: x
|
|
94
|
+
}, [f(t.$slots, "default"), (u(), n(e, { to: "body" }, [b.value ? (u(), i("ul", {
|
|
95
|
+
key: 0,
|
|
96
|
+
popover: "",
|
|
97
|
+
ref_key: "popupRef",
|
|
98
|
+
ref: S,
|
|
99
|
+
id: p(w),
|
|
100
|
+
class: o(["sw-dropdown-popup", y.class]),
|
|
101
|
+
style: s(C.value),
|
|
102
|
+
tabindex: "-1"
|
|
103
|
+
}, [f(t.$slots, "dropdown")], 14, _)) : r("", !0)]))], 34));
|
|
104
|
+
}
|
|
105
|
+
};
|
|
106
|
+
//#endregion
|
|
107
|
+
export { v as default };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { computed as e, createElementBlock as t, normalizeClass as n, openBlock as r, renderSlot as i } from "vue";
|
|
2
|
+
//#region src/components/SwFormItem.vue
|
|
3
|
+
var a = {
|
|
4
|
+
__name: "SwFormItem",
|
|
5
|
+
props: {
|
|
6
|
+
class: {
|
|
7
|
+
type: String,
|
|
8
|
+
default: ""
|
|
9
|
+
},
|
|
10
|
+
type: {
|
|
11
|
+
type: String,
|
|
12
|
+
default: ""
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
setup(a) {
|
|
16
|
+
let o = a, s = e(() => {
|
|
17
|
+
let e = ["sw-form-item"];
|
|
18
|
+
return o.type.length > 0 && e.push("sw-" + o.type), o.class.length > 0 && e.push(o.class), e;
|
|
19
|
+
});
|
|
20
|
+
return (e, a) => (r(), t("div", { class: n(s.value) }, [i(e.$slots, "default")], 2));
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
//#endregion
|
|
24
|
+
export { a as default };
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import { n as e } from "./SwIcon-0PtPyq2k.js";
|
|
2
|
+
import t from "./SwButton-B6iaLa_y.js";
|
|
3
|
+
import n from "./SwDropdown-DMkEn-su.js";
|
|
4
|
+
import { createElementBlock as r, createElementVNode as i, createTextVNode as a, createVNode as o, mergeModels as s, normalizeClass as c, onMounted as l, openBlock as u, ref as d, renderSlot as f, toDisplayString as p, useModel as m, watchEffect as h, withCtx as g } from "vue";
|
|
5
|
+
//#region src/components/SwGide.vue
|
|
6
|
+
var _ = ["src"], v = {
|
|
7
|
+
__name: "SwGide",
|
|
8
|
+
props: /* @__PURE__ */ s({
|
|
9
|
+
steps: {
|
|
10
|
+
type: Array,
|
|
11
|
+
default: () => []
|
|
12
|
+
},
|
|
13
|
+
iconClose: {
|
|
14
|
+
type: String,
|
|
15
|
+
default: ""
|
|
16
|
+
},
|
|
17
|
+
maxWidth: {
|
|
18
|
+
type: Number,
|
|
19
|
+
default: 250
|
|
20
|
+
}
|
|
21
|
+
}, {
|
|
22
|
+
modelValue: {
|
|
23
|
+
type: Number,
|
|
24
|
+
default: 0
|
|
25
|
+
},
|
|
26
|
+
modelModifiers: {}
|
|
27
|
+
}),
|
|
28
|
+
emits: /* @__PURE__ */ s(["close"], ["update:modelValue"]),
|
|
29
|
+
setup(s, { emit: v }) {
|
|
30
|
+
let y = d(null), b = d(!0), x = d(null), S = m(s, "modelValue"), C = v, w = s, T = () => C("close"), E = (e) => {
|
|
31
|
+
let t = S.value + e;
|
|
32
|
+
t < 0 ? S.value = 0 : t >= w.steps.length ? T() : S.value = t;
|
|
33
|
+
}, D = !1, O = (e) => {
|
|
34
|
+
let t = e.getBoundingClientRect(), n = window.innerHeight;
|
|
35
|
+
t.top < 5 ? (D = !0, document.documentElement.scrollTop += t.top - 5) : t.bottom > n - 5 && (D = !0, document.documentElement.scrollTop += t.bottom - n + 5);
|
|
36
|
+
}, k = () => {
|
|
37
|
+
if (!x.value || !y.value) return;
|
|
38
|
+
let e = x.value.getBoundingClientRect(), t = window.pageYOffset || document.documentElement.scrollTop, n = window.pageXOffset || document.documentElement.scrollLeft;
|
|
39
|
+
y.value.style.gridTemplateRows = `${e.top + t - 5}px ${e.height + 10}px 1fr`, y.value.style.gridTemplateColumns = `${e.left + n - 5}px ${e.width + 10}px 1fr`, y.value.style.height = document.documentElement.scrollHeight + "px";
|
|
40
|
+
};
|
|
41
|
+
return h((e) => {
|
|
42
|
+
if (!y.value) return;
|
|
43
|
+
let t = w.steps[S.value]?.tag;
|
|
44
|
+
if (!t || !t.trim()) {
|
|
45
|
+
y.value.style.gridTemplateRows = "40% 0 1fr", y.value.style.gridTemplateColumns = "1fr 0 1fr", y.value.style.height = document.documentElement.scrollHeight + "px";
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
if (x.value = document.querySelector(t), !x.value) {
|
|
49
|
+
console.warn(`[SwGuide] Элемент не найден: ${t}`);
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
O(x.value);
|
|
53
|
+
let n = () => {
|
|
54
|
+
if (D) {
|
|
55
|
+
D = !1;
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
k();
|
|
59
|
+
};
|
|
60
|
+
k();
|
|
61
|
+
let r = new ResizeObserver(k);
|
|
62
|
+
r.observe(x.value), window.addEventListener("resize", n), window.addEventListener("scroll", n, { passive: !0 }), e(() => {
|
|
63
|
+
r.disconnect(), window.removeEventListener("resize", n), window.removeEventListener("scroll", n);
|
|
64
|
+
});
|
|
65
|
+
}), l(() => window.onload = () => x.value = document.querySelector(w.steps[S.value]?.tag)), (s, l) => (u(), r("div", {
|
|
66
|
+
class: "sw-gide",
|
|
67
|
+
ref_key: "swGide",
|
|
68
|
+
ref: y
|
|
69
|
+
}, [
|
|
70
|
+
l[6] ||= i("div", { class: "overlay0" }, null, -1),
|
|
71
|
+
l[7] ||= i("div", { class: "overlay1" }, null, -1),
|
|
72
|
+
o(n, {
|
|
73
|
+
class: "gide",
|
|
74
|
+
trigger: "none",
|
|
75
|
+
placement: w.steps[S.value].placement,
|
|
76
|
+
modelValue: b.value,
|
|
77
|
+
"onUpdate:modelValue": l[2] ||= (e) => b.value = e,
|
|
78
|
+
maxWidth: w.maxWidth
|
|
79
|
+
}, {
|
|
80
|
+
dropdown: g(() => [
|
|
81
|
+
i("header", null, [f(s.$slots, "header", {}, () => [a(p(w.steps[S.value].header) + " ", 1), o(t, {
|
|
82
|
+
type: "primary",
|
|
83
|
+
link: "",
|
|
84
|
+
onClick: T
|
|
85
|
+
}, {
|
|
86
|
+
default: g(() => [o(e, { "icon-class": w.iconClose }, null, 8, ["icon-class"])]),
|
|
87
|
+
_: 1
|
|
88
|
+
})])]),
|
|
89
|
+
f(s.$slots, "default", {}, () => [i("div", null, p(w.steps[S.value].text), 1), i("img", {
|
|
90
|
+
class: c(/left/.test(w.steps[S.value]?.placement) ? "reflect" : null),
|
|
91
|
+
src: w.steps[S.value].img
|
|
92
|
+
}, null, 10, _)]),
|
|
93
|
+
i("footer", null, [f(s.$slots, "footer", {}, () => [o(t, {
|
|
94
|
+
type: S.value === 0 ? "info" : "warning",
|
|
95
|
+
text: "",
|
|
96
|
+
link: "",
|
|
97
|
+
onClick: l[0] ||= (e) => E(-1)
|
|
98
|
+
}, {
|
|
99
|
+
default: g(() => [f(s.$slots, "arrow", {}, () => [l[3] ||= a("‹", -1)])]),
|
|
100
|
+
_: 3
|
|
101
|
+
}, 8, ["type"]), o(t, {
|
|
102
|
+
type: "success",
|
|
103
|
+
onClick: l[1] ||= (e) => E(1),
|
|
104
|
+
text: "",
|
|
105
|
+
link: "",
|
|
106
|
+
class: "sw-revers"
|
|
107
|
+
}, {
|
|
108
|
+
default: g(() => [f(s.$slots, "arrow", {}, () => [l[4] ||= a("‹", -1)])]),
|
|
109
|
+
_: 3
|
|
110
|
+
})])])
|
|
111
|
+
]),
|
|
112
|
+
default: g(() => [l[5] ||= i("div", { class: "hole" }, null, -1)]),
|
|
113
|
+
_: 3
|
|
114
|
+
}, 8, [
|
|
115
|
+
"placement",
|
|
116
|
+
"modelValue",
|
|
117
|
+
"maxWidth"
|
|
118
|
+
]),
|
|
119
|
+
l[8] ||= i("div", { class: "overlay2" }, null, -1),
|
|
120
|
+
l[9] ||= i("div", { class: "overlay3" }, null, -1)
|
|
121
|
+
], 512));
|
|
122
|
+
}
|
|
123
|
+
};
|
|
124
|
+
//#endregion
|
|
125
|
+
export { v as default };
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { r as e } from "./utils-CGgSSFR1.js";
|
|
2
|
+
import { t } from "./SwSelect-CuBxoXju.js";
|
|
3
|
+
import { createElementBlock as n, createElementVNode as r, mergeProps as i, openBlock as a, unref as o } from "vue";
|
|
4
|
+
//#region src/components/SwIcon.vue
|
|
5
|
+
var s = /* @__PURE__ */ t({ default: () => l }), c = ["href"], l = {
|
|
6
|
+
__name: "SwIcon",
|
|
7
|
+
props: {
|
|
8
|
+
prefix: {
|
|
9
|
+
type: String,
|
|
10
|
+
default: "icon"
|
|
11
|
+
},
|
|
12
|
+
iconClass: {
|
|
13
|
+
type: String,
|
|
14
|
+
required: !0
|
|
15
|
+
},
|
|
16
|
+
className: {
|
|
17
|
+
type: String,
|
|
18
|
+
default: ""
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
setup(t) {
|
|
22
|
+
let s = t, l = e(s.iconClass);
|
|
23
|
+
return (e, t) => o(l) ? (a(), n("div", i({
|
|
24
|
+
key: 0,
|
|
25
|
+
style: "mask: url(" + s.iconClass + ") no-repeat 50% 50%;",
|
|
26
|
+
class: "sw-external-icon svg-icon"
|
|
27
|
+
}, e.$attrs), null, 16)) : (a(), n("svg", i({
|
|
28
|
+
key: 1,
|
|
29
|
+
class: "sw-icon icon-" + (s.className || s.iconClass),
|
|
30
|
+
"aria-hidden": "true"
|
|
31
|
+
}, e.$attrs), [r("use", { href: "#" + s.prefix + "-" + s.iconClass }, null, 8, c)], 16));
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
//#endregion
|
|
35
|
+
export { l as n, s as t };
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { n as e } from "./utils-CGgSSFR1.js";
|
|
2
|
+
import { n as t } from "./SwIcon-0PtPyq2k.js";
|
|
3
|
+
import { computed as n, createBlock as r, createCommentVNode as i, createElementBlock as a, createElementVNode as o, createTextVNode as s, defineComponent as c, mergeModels as l, mergeProps as u, normalizeClass as d, openBlock as f, ref as p, renderSlot as m, toDisplayString as h, useModel as g, vModelDynamic as _, watch as v, withDirectives as y } from "vue";
|
|
4
|
+
//#region src/components/SwInput.vue?vue&type=script&setup=true&lang.ts
|
|
5
|
+
var b = ["for"], x = {
|
|
6
|
+
key: 0,
|
|
7
|
+
title: "Это поле обязательно для заполнения."
|
|
8
|
+
}, S = [
|
|
9
|
+
"required",
|
|
10
|
+
"placeholder",
|
|
11
|
+
"type",
|
|
12
|
+
"id",
|
|
13
|
+
"name",
|
|
14
|
+
"size",
|
|
15
|
+
"maxlength",
|
|
16
|
+
"minlength",
|
|
17
|
+
"autofocus"
|
|
18
|
+
], C = /* @__PURE__ */ c({
|
|
19
|
+
__name: "SwInput",
|
|
20
|
+
props: /* @__PURE__ */ l({
|
|
21
|
+
before: { default: "" },
|
|
22
|
+
after: { default: "" },
|
|
23
|
+
placeholder: { default: "" },
|
|
24
|
+
label: { default: "" },
|
|
25
|
+
name: {},
|
|
26
|
+
class: { default: "" },
|
|
27
|
+
size: { default: "" },
|
|
28
|
+
type: { default: "text" },
|
|
29
|
+
inputMode: { default: "text" },
|
|
30
|
+
required: {
|
|
31
|
+
type: Boolean,
|
|
32
|
+
default: !1
|
|
33
|
+
},
|
|
34
|
+
maxlength: { default: 128 },
|
|
35
|
+
minlength: { default: 1 },
|
|
36
|
+
inputSize: { default: 60 },
|
|
37
|
+
autofocus: {
|
|
38
|
+
type: Boolean,
|
|
39
|
+
default: !1
|
|
40
|
+
}
|
|
41
|
+
}, {
|
|
42
|
+
modelValue: {},
|
|
43
|
+
modelModifiers: {}
|
|
44
|
+
}),
|
|
45
|
+
emits: /* @__PURE__ */ l([
|
|
46
|
+
"suffix",
|
|
47
|
+
"prefix",
|
|
48
|
+
"focusInput"
|
|
49
|
+
], ["update:modelValue"]),
|
|
50
|
+
setup(c, { emit: l }) {
|
|
51
|
+
let C = g(c, "modelValue"), w = c, T = p(null), E = l, D = (e) => {
|
|
52
|
+
E("focusInput"), e.target.setSelectionRange(C.value?.length || 0, C.value?.length || 0), T.value !== null && (T.value.style.top = "-.6em");
|
|
53
|
+
}, O = () => {
|
|
54
|
+
(C.value?.length || 0) === 0 && T.value !== null && T.value.removeAttribute("style");
|
|
55
|
+
};
|
|
56
|
+
(C.value?.length || 0) > 0 && T.value !== null && (T.value.style.top = "-.6em");
|
|
57
|
+
let k = () => {
|
|
58
|
+
E("suffix");
|
|
59
|
+
}, A = () => {
|
|
60
|
+
E("prefix");
|
|
61
|
+
}, j = n(() => {
|
|
62
|
+
let e = ["sw-input"];
|
|
63
|
+
return w.size.length > 0 && e.push("sw-" + w.size), w.class.length > 0 && e.push(w.class), e;
|
|
64
|
+
});
|
|
65
|
+
return v(C, (t, n) => {
|
|
66
|
+
w.type === "phone" && t && (C.value = e(t, n));
|
|
67
|
+
}), (e, n) => (f(), a("div", { class: d(j.value) }, [
|
|
68
|
+
w.before.length > 0 ? (f(), r(t, {
|
|
69
|
+
key: 0,
|
|
70
|
+
"icon-class": w.before,
|
|
71
|
+
onClick: A
|
|
72
|
+
}, null, 8, ["icon-class"])) : m(e.$slots, "prefix", { key: 1 }),
|
|
73
|
+
w.label.length > 0 ? (f(), a("label", {
|
|
74
|
+
key: 2,
|
|
75
|
+
for: w.name,
|
|
76
|
+
ref_key: "lab",
|
|
77
|
+
ref: T
|
|
78
|
+
}, [s(h(w.label), 1), w.required ? (f(), a("span", x, "*")) : i("", !0)], 8, b)) : i("", !0),
|
|
79
|
+
y(o("input", u({
|
|
80
|
+
"onUpdate:modelValue": n[0] ||= (e) => C.value = e,
|
|
81
|
+
required: w.required,
|
|
82
|
+
placeholder: w.required && w.label.length === 0 ? w.placeholder + "*" : w.placeholder,
|
|
83
|
+
type: w.type,
|
|
84
|
+
id: w.name,
|
|
85
|
+
name: w.name,
|
|
86
|
+
size: w.inputSize,
|
|
87
|
+
onFocus: D,
|
|
88
|
+
onBlur: O,
|
|
89
|
+
maxlength: w.maxlength,
|
|
90
|
+
minlength: w.minlength,
|
|
91
|
+
autofocus: w.autofocus
|
|
92
|
+
}, e.$attrs), null, 16, S), [[_, C.value]]),
|
|
93
|
+
w.after.length > 0 ? (f(), r(t, {
|
|
94
|
+
key: 3,
|
|
95
|
+
"icon-class": w.after,
|
|
96
|
+
onClick: k
|
|
97
|
+
}, null, 8, ["icon-class"])) : m(e.$slots, "suffix", { key: 4 })
|
|
98
|
+
], 2));
|
|
99
|
+
}
|
|
100
|
+
});
|
|
101
|
+
//#endregion
|
|
102
|
+
export { C as default };
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { n as e } from "./SwIcon-0PtPyq2k.js";
|
|
2
|
+
import t from "./SwButton-B6iaLa_y.js";
|
|
3
|
+
import { createCommentVNode as n, createElementBlock as r, createElementVNode as i, createTextVNode as a, createVNode as o, mergeModels as s, nextTick as c, normalizeClass as l, onUnmounted as u, openBlock as d, ref as f, renderSlot as p, toDisplayString as m, unref as h, useModel as g, useSlots as _, watch as v, withCtx as y } from "vue";
|
|
4
|
+
//#region src/components/SwMessage.vue
|
|
5
|
+
var b = { key: 0 }, x = {
|
|
6
|
+
__name: "SwMessage",
|
|
7
|
+
props: /* @__PURE__ */ s({
|
|
8
|
+
name: {
|
|
9
|
+
type: String,
|
|
10
|
+
default: ""
|
|
11
|
+
},
|
|
12
|
+
class: {
|
|
13
|
+
type: String,
|
|
14
|
+
default: ""
|
|
15
|
+
},
|
|
16
|
+
iconAfter: {
|
|
17
|
+
type: String,
|
|
18
|
+
default: ""
|
|
19
|
+
}
|
|
20
|
+
}, {
|
|
21
|
+
modelValue: {},
|
|
22
|
+
modelModifiers: {}
|
|
23
|
+
}),
|
|
24
|
+
emits: ["update:modelValue"],
|
|
25
|
+
setup(s) {
|
|
26
|
+
let x = g(s, "modelValue"), S = s, C = f(null), w = _(), T = (e) => {
|
|
27
|
+
if (C.value && x.value) {
|
|
28
|
+
let t = C.value.getBoundingClientRect();
|
|
29
|
+
e.clientX >= t.left && e.clientX <= t.right && e.clientY >= t.top && e.clientY <= t.bottom || (x.value = !1);
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
return v(() => x.value, (e) => {
|
|
33
|
+
e ? (C.value.showModal(), c(), window.addEventListener("click", T, !0)) : (C.value.close(), window.removeEventListener("click", T));
|
|
34
|
+
}), u(() => {
|
|
35
|
+
window.removeEventListener("click", T);
|
|
36
|
+
}), (s, c) => (d(), r("dialog", {
|
|
37
|
+
class: l("sw-message " + S.class),
|
|
38
|
+
ref_key: "messageRef",
|
|
39
|
+
ref: C
|
|
40
|
+
}, [
|
|
41
|
+
S.name.length > 0 || h(w)?.header ? (d(), r("header", b, [p(s.$slots, "header", {}, () => [a(m(S.name) + " ", 1), o(t, {
|
|
42
|
+
link: "",
|
|
43
|
+
type: "primary",
|
|
44
|
+
onClick: c[0] ||= (e) => x.value = !1
|
|
45
|
+
}, {
|
|
46
|
+
default: y(() => [o(e, { "icon-class": S.iconAfter }, null, 8, ["icon-class"])]),
|
|
47
|
+
_: 1
|
|
48
|
+
})])])) : n("", !0),
|
|
49
|
+
p(s.$slots, "default"),
|
|
50
|
+
i("footer", null, [p(s.$slots, "footer")])
|
|
51
|
+
], 2));
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
//#endregion
|
|
55
|
+
export { x as default };
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { createElementBlock as e, createElementVNode as t, createTextVNode as n, normalizeClass as r, openBlock as i, renderSlot as a, toDisplayString as o } from "vue";
|
|
2
|
+
//#region src/components/SwSection.vue
|
|
3
|
+
var s = ["icon-class"], c = {
|
|
4
|
+
__name: "SwSection",
|
|
5
|
+
props: {
|
|
6
|
+
name: {
|
|
7
|
+
type: String,
|
|
8
|
+
default: ""
|
|
9
|
+
},
|
|
10
|
+
class: {
|
|
11
|
+
type: String,
|
|
12
|
+
default: ""
|
|
13
|
+
},
|
|
14
|
+
iconAfter: {
|
|
15
|
+
type: String,
|
|
16
|
+
default: ""
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
emits: ["header"],
|
|
20
|
+
setup(c, { emit: l }) {
|
|
21
|
+
let u = c, d = l, f = () => {
|
|
22
|
+
d("header");
|
|
23
|
+
};
|
|
24
|
+
return (c, l) => (i(), e("section", { class: r("sw-section " + u.class) }, [
|
|
25
|
+
t("header", { onClick: f }, [a(c.$slots, "header", {}, () => [n(o(u.name) + " ", 1), t("svg-icon", { "icon-class": u.iconAfter }, null, 8, s)])]),
|
|
26
|
+
a(c.$slots, "default"),
|
|
27
|
+
t("footer", null, [a(c.$slots, "footer")])
|
|
28
|
+
], 2));
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
//#endregion
|
|
32
|
+
export { c as default };
|