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